summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/commandline/commandline-all.rst12
-rw-r--r--docs/source/commandline/commandline-index.rst1
2 files changed, 6 insertions, 7 deletions
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index 1c040383ba9..4f149fbae59 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -213,19 +213,19 @@ OSD-related Options
**-uimodekey** [*keystring*]
- Key used to toggle emulated keyboard on and off. Default setting is *SCRLOCK*.
+ Key used to toggle emulated keyboard on and off. Default setting is *SCRLOCK* on Windows, *Forward Delete* on Mac (use *FN-Delete* on laptop/compact keyboards).
.. _mame-commandline-uifontprovider:
**\-uifontprovider**
- Chooses provider for UI font: win, none or auto. Default setting is *AUTO*.
+ Chooses provider for UI font.
-.. _mame-commandline-menu:
+ On Windows, you can choose from: **win**, **dwrite**, **none** or **auto**.
+ On Mac, you can choose from: **osx** or **auto**.
+ On other platforms, you can choose from: **sdl** or **auto**.
-**\-menu**
-
- Enables menu bar at the top of the MAME window, if available by UI implementation. Default is *OFF*
+ Default setting is *AUTO*.
.. _mame-commandline-keyboardprovider:
diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst
index 267c82e8aad..e5d447fd4b0 100644
--- a/docs/source/commandline/commandline-index.rst
+++ b/docs/source/commandline/commandline-index.rst
@@ -54,7 +54,6 @@ OSD-related Options
| :ref:`uimodekey <mame-commandline-uimodekey>`
| :ref:`uifontprovider <mame-commandline-uifontprovider>`
-| :ref:`menu <mame-commandline-menu>`
| :ref:`keyboardprovider <mame-commandline-keyboardprovider>`
| :ref:`mouseprovider <mame-commandline-mouseprovider>`
| :ref:`lightgunprovider <mame-commandline-lightgunprovider>`
d3d10effect.h (renamed from 3rdparty/dxsdk/Include/d3d10effect.h)209
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d10misc.h (renamed from 3rdparty/dxsdk/Include/d3d10misc.h)17
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d10sdklayers.h1395
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d10shader.h (renamed from 3rdparty/dxsdk/Include/d3d10shader.h)57
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h (renamed from 3rdparty/dxsdk/Include/d3d11.h)7302
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h5222
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h2721
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h4817
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h2545
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h601
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h570
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h6260
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h1921
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h459
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h (renamed from 3rdparty/dxsdk/Include/d3d9.h)13
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h (renamed from 3rdparty/dxsdk/Include/d3d9caps.h)4
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h (renamed from 3rdparty/dxsdk/Include/d3d9types.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h933
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h556
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h1508
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h (renamed from 3rdparty/dxsdk/Include/DXGI.h)669
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h2465
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h2108
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h1489
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h986
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h (renamed from 3rdparty/dxsdk/Include/DXGIFormat.h)25
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h166
-rw-r--r--3rdparty/bgfx/3rdparty/fcpp/cpp1.c2
-rw-r--r--3rdparty/bgfx/3rdparty/fcpp/cpp4.c18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj1
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile1
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c5
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y5
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp108
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp108
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp485
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp1
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h1
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/hash_table.h4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt118
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt161
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt171
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt70
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt3
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt362
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imconfig.h3
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp9113
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h833
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp2213
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp2242
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h703
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp232
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp1686
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.h310
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/memory_editor.h210
-rw-r--r--3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h627
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/License.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/README67
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/bin/__init__.py1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/bin/empty.txt1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.h55
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.mm448
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBarCommunicator.h35
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.h123
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.mm2242
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextLayout.h111
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyle.h109
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyleAttribute.h82
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.h248
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.mm2540
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.stringsbin0 -> 96 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Info.plist26
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj1201
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch7
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.h24
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.mm282
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.stringsbin0 -> 96 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib3992
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Info.plist28
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist20
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj410
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch7
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/TestData.sql215
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/main.m15
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.h204
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.mm1963
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/checkbuildosx.sh66
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/res/info_bar_bg.pngbin0 -> 3081 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_busy.pngbin0 -> 5292 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_flipped.pngbin0 -> 4506 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/cppcheck.suppress42
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/delbin.bat1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/delcvs.bat1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Design.html249
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Icons.html56
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Indicators.pngbin0 -> 8509 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Lexer.txt226
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Markers.pngbin0 -> 20979 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/SciBreak.jpgbin0 -> 33592 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/SciCoding.html259
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/SciRest.jpgbin0 -> 16680 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/SciTEIco.pngbin0 -> 10091 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/SciWord.jpgbin0 -> 6164 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDoc.html7716
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDownload.html70
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaHistory.html10504
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaRelated.html552
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaToDo.html127
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaUsage.html375
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/Steps.html142
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/annotations.pngbin0 -> 33549 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/index.html184
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/doc/styledmargin.pngbin0 -> 17138 bytes-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/Converter.h83
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/PlatGTK.cxx2280
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/ScintillaGTK.cxx3273
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/deps.mak538
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/makefile106
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/makefile.orig105
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.c86
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.h21
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.list1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/ILexer.h98
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/Platform.h539
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/SciLexer.h1773
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.h1163
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.iface4678
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/include/ScintillaWidget.h51
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexA68k.cxx347
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAPDL.cxx259
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexASY.cxx271
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAU3.cxx910
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVE.cxx231
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVS.cxx293
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAbaqus.cxx605
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAda.cxx515
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsm.cxx467
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsn1.cxx188
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexBaan.cxx196
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexBash.cxx845
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexBasic.cxx566
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexBibTeX.cxx310
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexBullant.cxx233
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCLW.cxx682
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCOBOL.cxx381
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCPP.cxx1626
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCSS.cxx567
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCaml.cxx456
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCmake.cxx457
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCoffeeScript.cxx415
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexConf.cxx192
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCrontab.cxx226
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexCsound.cxx214
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexD.cxx568
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMAP.cxx228
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMIS.cxx355
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexECL.cxx521
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexEScript.cxx276
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexEiffel.cxx241
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexErlang.cxx623
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexFlagship.cxx354
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexForth.cxx170
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexFortran.cxx514
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexGAP.cxx266
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexGui4Cli.cxx312
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexHTML.cxx2192
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexHaskell.cxx1111
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexHex.cxx1045
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexInno.cxx290
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexKVIrc.cxx473
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexKix.cxx136
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexLaTeX.cxx539
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexLisp.cxx285
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexLout.cxx215
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexLua.cxx436
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMMIXAL.cxx189
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMPT.cxx193
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMSSQL.cxx354
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMagik.cxx448
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMarkdown.cxx421
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMatlab.cxx314
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMetapost.cxx402
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexModula.cxx743
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexMySQL.cxx573
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexNimrod.cxx433
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexNsis.cxx662
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexOScript.cxx548
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexOpal.cxx525
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexOthers.cxx1149
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPB.cxx365
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPLM.cxx201
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPO.cxx213
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPOV.cxx319
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPS.cxx333
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPascal.cxx615
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPerl.cxx1729
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerPro.cxx630
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerShell.cxx248
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexProgress.cxx282
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexPython.cxx571
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexR.cxx216
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexRebol.cxx325
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexRegistry.cxx416
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexRuby.cxx1837
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexRust.cxx816
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSML.cxx223
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSQL.cxx968
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSTTXT.cxx406
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexScriptol.cxx381
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSmalltalk.cxx326
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSorcus.cxx208
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpecman.cxx292
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpice.cxx206
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTACL.cxx400
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTADS3.cxx903
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTAL.cxx399
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCL.cxx369
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCMD.cxx506
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTeX.cxx497
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexTxt2tags.cxx480
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexVB.cxx319
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexVHDL.cxx565
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexVerilog.cxx1055
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexVisualProlog.cxx504
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexers/LexYAML.cxx317
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.cxx79
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.h35
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.cxx3304
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.h31
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.cxx61
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.h177
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexAccessor.h204
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.cxx92
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.h41
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.cxx111
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.h82
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx70
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.h32
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.cxx57
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.h30
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/OptionSet.h142
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.cxx156
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.h32
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/SparseState.h110
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/StringCopy.h36
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.cxx56
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.h231
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/SubStyles.h178
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.cxx242
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.h41
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/README36
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp304
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.h109
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp.template88
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h.template74
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.pro79
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/WidgetGen.py261
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/Notes.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp1335
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.h132
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp762
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.h156
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro121
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp766
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.h171
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/README86
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaConstants.py.template6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaEditPy.pro121
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/global.h4
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/sepbuild.py340
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/testsepq.py157
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template65
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/Face.py117
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/FileGenerator.py158
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCaseConvert.py126
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCharacterCategory.py36
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/HFacer.py61
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/HeaderOrder.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/LexGen.py54
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/scripts/ScintillaData.py225
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.cxx294
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.h95
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CallTip.cxx334
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CallTip.h93
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.cxx634
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.h47
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.cxx68
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.h45
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.cxx199
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.h26
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.cxx824
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.h231
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.cxx59
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.h35
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.cxx284
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.h69
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Decoration.cxx196
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Decoration.h64
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Document.cxx2817
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Document.h536
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/EditModel.cxx77
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/EditModel.h70
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/EditView.cxx2117
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/EditView.h174
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx7681
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx.orig9647
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Editor.h620
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.cxx191
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.h92
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/FontQuality.h31
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Indicator.cxx180
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Indicator.h60
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.cxx160
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.h66
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.cxx398
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.h86
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/MarginView.cxx470
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/MarginView.h50
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Partitioning.h198
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/PerLine.cxx556
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/PerLine.h136
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.cxx703
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.h201
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/RESearch.cxx960
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/RESearch.h73
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.cxx290
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.h54
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/SciTE.properties6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.cxx1070
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.h104
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Selection.cxx418
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Selection.h193
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/SplitVector.h291
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Style.cxx167
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/Style.h91
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.cxx311
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.h68
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/UnicodeFromUTF8.h32
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.cxx589
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.h199
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/XPM.cxx303
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/src/XPM.h94
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/MessageNumbers.py63
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/README30
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/ScintillaCallable.py159
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/XiteMenu.py28
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/XiteQt.py65
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/XiteWin.py531
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp12
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp.styled12
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx16
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx.styled16
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d47
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d.styled47
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html12
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html.styled12
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua7
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua.styled7
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php.styled6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl5
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl.styled5
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py11
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py.styled11
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb.styled6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb9
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb.styled9
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/lexTests.py126
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/performanceTests.py125
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/simpleTests.py2120
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/LICENSE_1_0.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/README15
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/SciTE.properties5
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/catch.hpp8734
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/makefile67
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/test.mak32
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testCellBuffer.cxx140
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testCharClassify.cxx121
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testContractionState.cxx140
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testDecoration.cxx89
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testPartitioning.cxx182
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testRunStyles.cxx321
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testSparseState.cxx228
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testSplitVector.cxx214
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/testUnicodeFromUTF8.cxx44
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/unit/unitTest.cxx58
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/test/xite.py6
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/tgzsrc4
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/version.txt1
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/CheckD2D.cxx3
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.cxx129
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.h26
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.cxx3306
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.h28
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/SciLexer.vcxproj130
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/SciTE.properties21
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/ScintRes.rc37
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/Scintilla.def2
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/ScintillaWin.cxx3321
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/deps.mak535
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/makefile171
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/win32/scintilla.mak992
-rw-r--r--3rdparty/bgfx/3rdparty/scintilla/zipsrc.bat4
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_image.c3055
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_truetype.h862
-rw-r--r--3rdparty/bgfx/README.md775
-rw-r--r--3rdparty/bgfx/examples/00-helloworld/helloworld.cpp6
-rw-r--r--3rdparty/bgfx/examples/01-cubes/cubes.cpp263
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h53
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/metaballs.cpp477
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h75
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc6
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/raymarch.cpp30
-rw-r--r--3rdparty/bgfx/examples/04-mesh/fs_mesh.sc8
-rw-r--r--3rdparty/bgfx/examples/04-mesh/mesh.cpp10
-rw-r--r--3rdparty/bgfx/examples/04-mesh/vs_mesh.sc6
-rw-r--r--3rdparty/bgfx/examples/05-instancing/instancing.cpp9
-rw-r--r--3rdparty/bgfx/examples/06-bump/bump.cpp461
-rw-r--r--3rdparty/bgfx/examples/06-bump/fs_bump.sc8
-rw-r--r--3rdparty/bgfx/examples/07-callback/callback.cpp15
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update_3d.sc8
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update_cmp.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/update.cpp86
-rw-r--r--3rdparty/bgfx/examples/09-hdr/common.sh1
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc24
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc20
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc34
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc5
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc12
-rw-r--r--3rdparty/bgfx/examples/09-hdr/hdr.cpp706
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/10-font/font.cpp16
-rw-r--r--3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp13
-rw-r--r--3rdparty/bgfx/examples/12-lod/fs_tree.sc5
-rw-r--r--3rdparty/bgfx/examples/12-lod/lod.cpp37
-rw-r--r--3rdparty/bgfx/examples/12-lod/vs_tree.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lightning.sc8
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc8
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc4
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lightning.sc8
-rw-r--r--3rdparty/bgfx/examples/13-stencil/stencil.cpp56
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lightning.sc12
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc26
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lightning.sc17
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp108
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh4
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp17
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning.sh16
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning_main.sh8
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp114
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/drawstress.cpp430
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h35
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h56
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc18
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/18-ibl/ibl.cpp80
-rw-r--r--3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/oit.cpp43
-rw-r--r--3rdparty/bgfx/examples/20-nanovg/nanovg.cpp200
-rw-r--r--3rdparty/bgfx/examples/21-deferred/deferred.cpp960
-rw-r--r--3rdparty/bgfx/examples/22-windows/windows.cpp9
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blit.sc19
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blur.sc39
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_fb.sc9
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/main.cpp2
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp95
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h23
-rw-r--r--3rdparty/bgfx/examples/24-nbody/nbody.cpp22
-rw-r--r--3rdparty/bgfx/examples/25-c99/helloworld.c4
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.cpp64
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.h3
-rw-r--r--3rdparty/bgfx/examples/common/camera.cpp12
-rw-r--r--3rdparty/bgfx/examples/common/camera.h2
-rw-r--r--3rdparty/bgfx/examples/common/cube_atlas.cpp62
-rw-r--r--3rdparty/bgfx/examples/common/cube_atlas.h6
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp188
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.h51
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_android.cpp18
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_asmjs.cpp338
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_glfw.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_ios.mm68
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_nacl.cpp4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_osx.mm58
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h15
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp11
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp227
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_winrt.cpp8
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp118
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.cpp54
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.h6
-rw-r--r--3rdparty/bgfx/examples/common/font/font_manager.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/font/font_manager.h2
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h207
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_basic.sc4
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h333
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field.sc4
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h413
-rw-r--r--3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.sc6
-rw-r--r--3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp51
-rw-r--r--3rdparty/bgfx/examples/common/font/text_buffer_manager.h2
-rw-r--r--3rdparty/bgfx/examples/common/font/text_metrics.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h63
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h63
-rw-r--r--3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h63
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h35
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h166
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h166
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h186
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h226
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h142
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h128
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp77
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h69
-rw-r--r--3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp604
-rw-r--r--3rdparty/bgfx/examples/common/imgui/ocornut_imgui.h2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/scintilla.cpp1128
-rw-r--r--3rdparty/bgfx/examples/common/imgui/scintilla.h26
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h56
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h56
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h57
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h57
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h63
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h69
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h713
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp77
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h93
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.sc2
-rw-r--r--3rdparty/bgfx/examples/makefile20
-rw-r--r--3rdparty/bgfx/examples/runtime/osx-info.plist30
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_indirect.binbin439 -> 439 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_init_instances.binbin6767 -> 6767 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_update_instances.binbin1611 -> 1611 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_bump.binbin3598 -> 3633 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_callback.binbin792 -> 792 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_cubes.binbin260 -> 260 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.binbin676 -> 705 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.binbin308 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.binbin260 -> 260 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.binbin1424 -> 1459 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.binbin1350 -> 1379 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_blur.binbin1172 -> 1189 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_bright.binbin2419 -> 2451 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lum.binbin2467 -> 2484 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lumavg.binbin3067 -> 3084 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_mesh.binbin1853 -> 1872 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_skybox.binbin784 -> 800 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_tonemap.binbin2480 -> 2528 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.binbin2653 -> 2688 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.binbin815 -> 831 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_instancing.binbin260 -> 260 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_mesh.binbin1657 -> 1657 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit.binbin286 -> 286 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb.binbin694 -> 694 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_blit.binbin484 -> 520 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate.binbin634 -> 634 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate_blit.binbin484 -> 520 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.binbin603 -> 603 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_raymarching.binbin10001 -> 10005 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_black.binbin228 -> 228 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm.binbin3554 -> 3573 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_csm.binbin6434 -> 6510 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear.binbin3526 -> 3545 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_csm.binbin6322 -> 6398 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_omni.binbin5184 -> 5203 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_omni.binbin5212 -> 5231 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard.binbin3438 -> 3457 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_csm.binbin5970 -> 6046 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear.binbin3410 -> 3429 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_csm.binbin5858 -> 5934 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_omni.binbin5068 -> 5087 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_omni.binbin5096 -> 5115 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf.binbin11899 -> 11918 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_csm.binbin39887 -> 39963 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear.binbin10823 -> 10842 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_csm.binbin35503 -> 35579 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_omni.binbin12417 -> 12436 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_omni.binbin13505 -> 13524 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm.binbin3730 -> 3749 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_csm.binbin7138 -> 7214 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear.binbin3702 -> 3721 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_csm.binbin7026 -> 7102 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_omni.binbin5360 -> 5379 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_omni.binbin5388 -> 5407 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_texture.binbin606 -> 623 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur.binbin1804 -> 1823 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur_vsm.binbin2164 -> 2183 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth.binbin428 -> 428 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_linear.binbin356 -> 356 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm.binbin568 -> 568 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm_linear.binbin496 -> 496 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_texture.binbin308 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth.binbin480 -> 499 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth_vsm.binbin480 -> 499 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur.binbin1804 -> 1823 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur_vsm.binbin2164 -> 2183 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_lightning.binbin2438 -> 2457 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_texture.binbin606 -> 623 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackblank.binbin228 -> 228 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackcolor.binbin270 -> 270 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex1.binbin348 -> 348 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex2.binbin348 -> 348 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontblank.binbin228 -> 228 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontcolor.binbin270 -> 270 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex1.binbin348 -> 348 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex2.binbin348 -> 348 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svside.binbin464 -> 464 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsideblank.binbin256 -> 256 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidecolor.binbin298 -> 298 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidetex.binbin569 -> 569 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture.binbin308 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture_lightning.binbin2600 -> 2636 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.binbin4797 -> 4815 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.binbin5613 -> 5631 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow.binbin228 -> 228 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.binbin428 -> 428 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_black.binbin228 -> 228 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_lightning.binbin2287 -> 2287 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_texture.binbin606 -> 623 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture.binbin308 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture_lightning.binbin2463 -> 2480 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_tree.binbin1349 -> 1385 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update.binbin308 -> 324 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.binbin489 -> 506 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_cmp.binbin376 -> 393 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blit.binbin491 -> 480 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blur.binbin1506 -> 1476 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_fb.binbin474 -> 484 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump.binbin2088 -> 2088 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump_instanced.binbin2170 -> 2170 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_callback.binbin712 -> 712 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_cubes.binbin510 -> 510 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.binbin510 -> 510 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.binbin2088 -> 2088 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_blur.binbin1080 -> 1080 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_bright.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lum.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lumavg.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_mesh.binbin944 -> 944 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_skybox.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_tonemap.binbin1028 -> 1028 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.binbin991 -> 991 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.binbin674 -> 674 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_instancing.binbin847 -> 847 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_mesh.binbin1433 -> 1433 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit.binbin802 -> 802 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit_blit.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_particle.binbin1149 -> 1149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_raymarching.binbin620 -> 620 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning.binbin1197 -> 1197 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_csm.binbin2146 -> 2146 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear.binbin1237 -> 1237 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_csm.binbin2306 -> 2306 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_omni.binbin2217 -> 2217 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_omni.binbin2057 -> 2057 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_depth.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_hblur.binbin1149 -> 1149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth.binbin492 -> 492 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth_linear.binbin500 -> 500 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture_lightning.binbin974 -> 974 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_unpackdepth.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_vblur.binbin1149 -> 1149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_lightning.binbin936 -> 936 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svback.binbin594 -> 594 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svfront.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svside.binbin764 -> 764 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture_lightning.binbin974 -> 974 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_mesh.binbin1189 -> 1189 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow_pd.binbin492 -> 492 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_lightning.binbin906 -> 906 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture_lightning.binbin974 -> 974 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_tree.binbin1058 -> 1058 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_update.binbin518 -> 518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_vectordisplay_fb.binbin620 -> 620 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.binbin2239 -> 2274 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.binbin553 -> 553 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.binbin137 -> 137 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.binbin589 -> 618 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.binbin201 -> 218 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.binbin137 -> 137 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.binbin661 -> 696 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.binbin1059 -> 1088 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.binbin601 -> 618 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.binbin1624 -> 1656 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.binbin1452 -> 1469 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.binbin1776 -> 1793 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.binbin1410 -> 1433 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.binbin509 -> 525 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.binbin1625 -> 1673 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.binbin1638 -> 1661 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.binbin540 -> 556 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.binbin137 -> 137 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.binbin1278 -> 1278 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.binbin183 -> 183 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.binbin459 -> 459 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.binbin393 -> 429 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.binbin431 -> 431 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.binbin393 -> 429 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.binbin404 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.binbin47430 -> 47438 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm.binbin2719 -> 2722 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_csm.binbin4443 -> 4503 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear.binbin2715 -> 2718 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_csm.binbin4407 -> 4467 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_omni.binbin3769 -> 3772 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_omni.binbin3773 -> 3776 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard.binbin2679 -> 2682 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_csm.binbin4311 -> 4371 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear.binbin2675 -> 2678 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_csm.binbin4355 -> 4415 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_omni.binbin3741 -> 3744 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_omni.binbin3725 -> 3728 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf.binbin7584 -> 7587 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_csm.binbin24432 -> 24492 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear.binbin7260 -> 7263 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_csm.binbin22252 -> 22312 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_omni.binbin7958 -> 7961 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_omni.binbin8662 -> 8665 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm.binbin2799 -> 2802 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_csm.binbin4827 -> 4887 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear.binbin2783 -> 2786 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_csm.binbin4763 -> 4823 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_omni.binbin3869 -> 3872 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_omni.binbin3885 -> 3888 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.binbin555 -> 572 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.binbin941 -> 960 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.binbin1133 -> 1152 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.binbin269 -> 269 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.binbin221 -> 221 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.binbin333 -> 333 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.binbin261 -> 261 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.binbin201 -> 218 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.binbin361 -> 380 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.binbin365 -> 384 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.binbin941 -> 960 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.binbin1133 -> 1152 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lightning.binbin1903 -> 1910 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.binbin555 -> 572 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.binbin227 -> 227 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.binbin201 -> 201 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.binbin201 -> 201 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.binbin227 -> 227 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.binbin201 -> 201 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.binbin201 -> 201 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.binbin277 -> 277 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.binbin227 -> 227 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.binbin374 -> 374 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.binbin201 -> 218 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lightning.binbin2041 -> 2061 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.binbin2446 -> 2464 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.binbin3282 -> 3300 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.binbin269 -> 269 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.binbin149 -> 149 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lightning.binbin1992 -> 1976 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.binbin555 -> 572 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.binbin201 -> 218 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lightning.binbin2168 -> 2169 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.binbin982 -> 1002 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.binbin201 -> 217 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.binbin410 -> 427 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.binbin245 -> 262 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.binbin396 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.binbin955 -> 813 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.binbin335 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.binbin1089 -> 1089 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.binbin1083 -> 1083 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.binbin461 -> 461 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.binbin1089 -> 1089 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.binbin665 -> 665 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.binbin577 -> 577 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.binbin653 -> 653 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.binbin672 -> 672 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.binbin443 -> 443 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.binbin474 -> 474 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.binbin982 -> 982 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.binbin553 -> 553 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.binbin682 -> 682 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.binbin355 -> 355 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.binbin283 -> 283 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning.binbin802 -> 802 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_csm.binbin1451 -> 1451 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear.binbin818 -> 818 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_csm.binbin1515 -> 1515 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_omni.binbin1462 -> 1462 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_omni.binbin1398 -> 1398 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.binbin283 -> 283 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.binbin754 -> 754 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.binbin351 -> 351 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lightning.binbin577 -> 577 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.binbin754 -> 754 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lightning.binbin541 -> 541 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.binbin437 -> 437 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.binbin283 -> 283 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.binbin545 -> 545 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lightning.binbin577 -> 577 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.binbin738 -> 738 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.binbin283 -> 283 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.binbin283 -> 283 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lightning.binbin541 -> 541 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lightning.binbin577 -> 577 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.binbin629 -> 629 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.binbin319 -> 319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.binbin355 -> 355 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.binbin0 -> 1167 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.binbin3353 -> 3319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.binbin2701 -> 2627 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.binbin4783 -> 4783 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.binbin495 -> 495 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_cubes.binbin89 -> 89 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.binbin771 -> 771 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug.binbin211 -> 211 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug_line.binbin89 -> 89 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.binbin1053 -> 1053 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.binbin1858 -> 1858 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.binbin959 -> 1007 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.binbin2431 -> 2431 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.binbin2359 -> 2359 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.binbin3282 -> 3282 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.binbin1777 -> 1797 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.binbin700 -> 700 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.binbin2706 -> 2706 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.binbin2000 -> 2008 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.binbin588 -> 594 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_instancing.binbin89 -> 89 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.binbin1414 -> 1419 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit.binbin101 -> 101 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.binbin373 -> 373 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_blit.binbin411 -> 411 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.binbin320 -> 320 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate_blit.binbin411 -> 411 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.binbin372 -> 372 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.binbin12592 -> 12616 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_black.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.binbin4205 -> 4213 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.binbin10214 -> 10222 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.binbin4249 -> 4257 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.binbin10434 -> 10442 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.binbin7563 -> 7587 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.binbin7517 -> 7541 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.binbin4077 -> 4085 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.binbin9670 -> 9678 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.binbin4109 -> 4117 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.binbin9806 -> 9814 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.binbin7424 -> 7448 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.binbin7390 -> 7414 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.binbin15728 -> 15736 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.binbin63464 -> 63472 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.binbin15779 -> 15787 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.binbin63910 -> 63918 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.binbin19304 -> 19328 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.binbin19249 -> 19273 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.binbin4627 -> 4635 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.binbin12144 -> 12152 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.binbin4671 -> 4679 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.binbin12364 -> 12372 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.binbin7987 -> 8011 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.binbin7941 -> 7965 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.binbin687 -> 687 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.binbin1746 -> 1746 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.binbin2744 -> 2744 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.binbin302 -> 302 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.binbin254 -> 254 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.binbin497 -> 497 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.binbin408 -> 408 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_texture.binbin211 -> 211 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.binbin421 -> 421 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.binbin394 -> 394 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.binbin1746 -> 1746 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.binbin2744 -> 2744 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.binbin2319 -> 2327 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.binbin687 -> 687 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.binbin134 -> 134 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.binbin441 -> 441 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.binbin441 -> 441 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.binbin99 -> 99 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.binbin134 -> 134 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.binbin438 -> 438 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.binbin438 -> 438 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.binbin468 -> 468 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.binbin134 -> 134 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.binbin570 -> 570 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture.binbin211 -> 211 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.binbin2550 -> 2558 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.binbin8399 -> 8399 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.binbin8652 -> 8652 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.binbin302 -> 302 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_black.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.binbin2156 -> 2164 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.binbin687 -> 687 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture.binbin211 -> 211 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.binbin2478 -> 2486 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.binbin1303 -> 1303 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_update.binbin217 -> 217 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.binbin374 -> 375 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_cmp.binbin230 -> 230 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blit.binbin525 -> 414 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blur.binbin2228 -> 2012 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_fb.binbin427 -> 398 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump.binbin1743 -> 1743 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump_instanced.binbin1936 -> 1936 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_callback.binbin506 -> 506 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_cubes.binbin325 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_combine.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug_line.binbin325 -> 325 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_geom.binbin1743 -> 1743 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_light.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_blur.binbin1485 -> 1485 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_bright.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lum.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lumavg.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_mesh.binbin674 -> 674 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_skybox.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_tonemap.binbin1403 -> 1403 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.binbin677 -> 681 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.binbin474 -> 474 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_instancing.binbin602 -> 602 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_mesh.binbin1488 -> 1489 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit.binbin604 -> 604 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit_blit.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_particle.binbin885 -> 885 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_raymarching.binbin420 -> 420 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.binbin958 -> 958 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.binbin1578 -> 1578 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.binbin1003 -> 1003 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.binbin1742 -> 1742 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.binbin1668 -> 1668 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.binbin1504 -> 1504 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_depth.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_hblur.binbin1484 -> 1484 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.binbin301 -> 301 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.binbin314 -> 314 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.binbin720 -> 720 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_vblur.binbin1484 -> 1484 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.binbin625 -> 625 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svback.binbin444 -> 444 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svfront.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svside.binbin628 -> 628 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.binbin720 -> 720 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_mesh.binbin906 -> 906 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow_pd.binbin301 -> 301 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_lightning.binbin625 -> 625 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture_lightning.binbin720 -> 720 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_tree.binbin787 -> 787 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_update.binbin337 -> 337 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/gles/vs_vectordisplay_fb.binbin420 -> 420 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.binbin1353 -> 1340 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.binbin3526 -> 3492 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.binbin2874 -> 2800 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.binbin4465 -> 4465 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.binbin465 -> 465 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_cubes.binbin83 -> 83 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.binbin687 -> 687 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.binbin160 -> 160 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.binbin83 -> 83 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.binbin904 -> 904 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.binbin1726 -> 1726 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.binbin924 -> 924 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.binbin2303 -> 2303 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.binbin2241 -> 2241 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lumavg.binbin3124 -> 3124 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.binbin1629 -> 1649 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_skybox.binbin608 -> 608 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.binbin2554 -> 2554 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.binbin1847 -> 1855 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.binbin511 -> 511 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_instancing.binbin83 -> 83 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.binbin1342 -> 1347 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit.binbin95 -> 95 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.binbin355 -> 355 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_blit.binbin395 -> 395 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.binbin302 -> 302 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate_blit.binbin395 -> 395 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_particle.binbin358 -> 358 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.binbin11926 -> 11950 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_black.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.binbin3968 -> 3976 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.binbin9832 -> 9840 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.binbin4012 -> 4020 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.binbin10052 -> 10060 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.binbin7207 -> 7231 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.binbin7161 -> 7185 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.binbin3846 -> 3854 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.binbin9312 -> 9320 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.binbin3878 -> 3886 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.binbin9448 -> 9456 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.binbin7074 -> 7098 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.binbin7040 -> 7064 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.binbin15115 -> 15123 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.binbin61625 -> 61633 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.binbin15160 -> 15168 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.binbin62047 -> 62055 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.binbin18560 -> 18584 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.binbin18511 -> 18535 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.binbin4365 -> 4373 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.binbin11662 -> 11670 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.binbin4409 -> 4417 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.binbin11882 -> 11890 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.binbin7606 -> 7630 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.binbin7560 -> 7584 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.binbin602 -> 602 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.binbin1619 -> 1619 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.binbin2557 -> 2557 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.binbin290 -> 290 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.binbin242 -> 242 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm.binbin465 -> 465 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm_linear.binbin382 -> 382 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_texture.binbin160 -> 160 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.binbin356 -> 356 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.binbin329 -> 329 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.binbin1619 -> 1619 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.binbin2557 -> 2557 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.binbin2090 -> 2098 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.binbin602 -> 602 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackcolor.binbin128 -> 128 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.binbin427 -> 427 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.binbin427 -> 427 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.binbin99 -> 99 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontcolor.binbin128 -> 128 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.binbin424 -> 424 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.binbin424 -> 424 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svside.binbin448 -> 448 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsideblank.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidecolor.binbin128 -> 128 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.binbin544 -> 544 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture.binbin160 -> 160 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.binbin2312 -> 2320 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.binbin7916 -> 7916 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.binbin8286 -> 8286 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.binbin290 -> 290 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_black.binbin76 -> 76 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.binbin2042 -> 2050 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.binbin602 -> 602 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture.binbin160 -> 160 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.binbin2300 -> 2308 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.binbin1181 -> 1181 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update.binbin161 -> 161 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.binbin306 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_cmp.binbin179 -> 179 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blit.binbin456 -> 351 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blur.binbin2121 -> 1917 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_fb.binbin358 -> 329 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump.binbin1593 -> 1593 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump_instanced.binbin1756 -> 1756 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_callback.binbin464 -> 464 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_cubes.binbin295 -> 295 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.binbin295 -> 295 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.binbin1593 -> 1593 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_blur.binbin1383 -> 1383 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_bright.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lum.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lumavg.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_mesh.binbin614 -> 614 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_skybox.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_tonemap.binbin1313 -> 1313 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.binbin623 -> 627 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.binbin432 -> 432 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_instancing.binbin536 -> 536 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_mesh.binbin1368 -> 1369 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit.binbin556 -> 556 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit_blit.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_particle.binbin825 -> 825 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_raymarching.binbin378 -> 378 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color.binbin224 -> 224 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.binbin874 -> 874 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.binbin1446 -> 1446 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.binbin919 -> 919 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.binbin1610 -> 1610 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.binbin1536 -> 1536 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.binbin1372 -> 1372 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_depth.binbin224 -> 224 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.binbin1388 -> 1388 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.binbin277 -> 277 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.binbin290 -> 290 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.binbin654 -> 654 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.binbin1388 -> 1388 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.binbin571 -> 571 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svback.binbin420 -> 420 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.binbin224 -> 224 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svside.binbin586 -> 586 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.binbin654 -> 654 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_mesh.binbin828 -> 828 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow.binbin224 -> 224 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow_pd.binbin277 -> 277 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color.binbin224 -> 224 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_lightning.binbin571 -> 571 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.binbin654 -> 654 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_tree.binbin715 -> 715 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_update.binbin307 -> 307 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_vectordisplay_fb.binbin378 -> 378 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.binbin0 -> 5921 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.binbin0 -> 804 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.binbin0 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.binbin0 -> 1196 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.binbin0 -> 598 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.binbin0 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.binbin0 -> 1605 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.binbin0 -> 2518 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.binbin0 -> 2044 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.binbin0 -> 3656 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.binbin0 -> 3492 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.binbin0 -> 4916 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.binbin0 -> 2434 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.binbin0 -> 1054 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.binbin0 -> 4043 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.binbin0 -> 2838 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.binbin0 -> 1086 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_instancing.binbin0 -> 404 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.binbin0 -> 1720 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.binbin0 -> 402 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.binbin0 -> 750 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.binbin0 -> 933 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.binbin0 -> 683 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.binbin0 -> 933 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.binbin0 -> 694 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.binbin0 -> 12676 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.binbin0 -> 396 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm.binbin0 -> 4597 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_csm.binbin0 -> 11097 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear.binbin0 -> 4641 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_csm.binbin0 -> 11317 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_omni.binbin0 -> 7861 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_omni.binbin0 -> 7815 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard.binbin0 -> 4425 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_csm.binbin0 -> 10377 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear.binbin0 -> 4457 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_csm.binbin0 -> 10513 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_omni.binbin0 -> 7678 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_omni.binbin0 -> 7644 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf.binbin0 -> 16606 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_csm.binbin0 -> 66411 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear.binbin0 -> 16555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_csm.binbin0 -> 66449 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_omni.binbin0 -> 19991 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_omni.binbin0 -> 19940 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm.binbin0 -> 5037 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_csm.binbin0 -> 13099 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear.binbin0 -> 5081 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_csm.binbin0 -> 13319 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_omni.binbin0 -> 8303 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_omni.binbin0 -> 8257 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.binbin0 -> 1045 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.binbin0 -> 2840 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.binbin0 -> 3934 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.binbin0 -> 623 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.binbin0 -> 566 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.binbin0 -> 807 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.binbin0 -> 729 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.binbin0 -> 598 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.binbin0 -> 815 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.binbin0 -> 790 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.binbin0 -> 2840 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.binbin0 -> 3934 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lightning.binbin0 -> 2666 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.binbin0 -> 1045 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.binbin0 -> 396 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.binbin0 -> 442 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.binbin0 -> 794 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.binbin0 -> 794 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.binbin0 -> 426 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.binbin0 -> 442 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.binbin0 -> 791 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.binbin0 -> 791 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.binbin0 -> 823 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.binbin0 -> 396 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.binbin0 -> 442 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.binbin0 -> 905 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.binbin0 -> 598 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lightning.binbin0 -> 3054 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.binbin0 -> 9729 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.binbin0 -> 9605 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.binbin0 -> 396 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.binbin0 -> 623 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.binbin0 -> 396 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lightning.binbin0 -> 2345 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.binbin0 -> 1045 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.binbin0 -> 598 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lightning.binbin0 -> 2745 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.binbin0 -> 1846 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.binbin0 -> 596 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.binbin0 -> 737 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.binbin0 -> 644 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.binbin0 -> 824 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.binbin0 -> 3314 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.binbin0 -> 796 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.binbin0 -> 2038 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.binbin0 -> 2272 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.binbin0 -> 819 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.binbin0 -> 647 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.binbin0 -> 647 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.binbin0 -> 2038 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.binbin0 -> 1880 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.binbin0 -> 984 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.binbin0 -> 1782 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.binbin0 -> 979 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.binbin0 -> 781 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_instancing.binbin0 -> 987 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.binbin0 -> 1749 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.binbin0 -> 898 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.binbin0 -> 1204 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.binbin0 -> 751 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.binbin0 -> 555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning.binbin0 -> 1223 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_csm.binbin0 -> 1751 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear.binbin0 -> 1282 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_csm.binbin0 -> 1971 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_omni.binbin0 -> 1913 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_omni.binbin0 -> 1693 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.binbin0 -> 555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.binbin0 -> 1835 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.binbin0 -> 618 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.binbin0 -> 629 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lightning.binbin0 -> 1035 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.binbin0 -> 1835 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lightning.binbin0 -> 931 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.binbin0 -> 730 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.binbin0 -> 555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.binbin0 -> 931 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lightning.binbin0 -> 1035 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.binbin0 -> 1190 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.binbin0 -> 555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.binbin0 -> 618 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.binbin0 -> 555 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lightning.binbin0 -> 931 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lightning.binbin0 -> 1035 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.binbin0 -> 1113 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.binbin0 -> 659 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.binbin0 -> 751 bytes-rw-r--r--3rdparty/bgfx/examples/runtime/tvos-info.plist30
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfx.h (renamed from 3rdparty/bgfx/include/bgfx.h)1024
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxdefines.h403
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxplatform.h (renamed from 3rdparty/bgfx/include/bgfxplatform.h)34
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfx.h (renamed from 3rdparty/bgfx/include/bgfx.c99.h)128
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h (renamed from 3rdparty/bgfx/include/bgfxplatform.c99.h)0
-rw-r--r--3rdparty/bgfx/include/bgfxdefines.h373
-rw-r--r--3rdparty/bgfx/makefile2
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua57
-rw-r--r--3rdparty/bgfx/scripts/example-common.lua36
-rw-r--r--3rdparty/bgfx/scripts/genie.lua28
-rw-r--r--3rdparty/bgfx/scripts/shader-embeded.mk4
-rw-r--r--3rdparty/bgfx/scripts/shader.mk18
-rw-r--r--3rdparty/bgfx/scripts/shaderc.lua6
-rw-r--r--3rdparty/bgfx/src/amalgamated.cpp3
-rw-r--r--3rdparty/bgfx/src/amalgamated.mm9
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp700
-rw-r--r--3rdparty/bgfx/src/bgfx_compute.sh35
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h333
-rw-r--r--3rdparty/bgfx/src/bgfx_shader.sh11
-rw-r--r--3rdparty/bgfx/src/config.h35
-rw-r--r--3rdparty/bgfx/src/fs_clear0.bin.h43
-rw-r--r--3rdparty/bgfx/src/fs_clear1.bin.h49
-rw-r--r--3rdparty/bgfx/src/fs_clear2.bin.h55
-rw-r--r--3rdparty/bgfx/src/fs_clear3.bin.h61
-rw-r--r--3rdparty/bgfx/src/fs_clear4.bin.h67
-rw-r--r--3rdparty/bgfx/src/fs_clear5.bin.h73
-rw-r--r--3rdparty/bgfx/src/fs_clear6.bin.h79
-rw-r--r--3rdparty/bgfx/src/fs_clear7.bin.h85
-rw-r--r--3rdparty/bgfx/src/fs_debugfont.bin.h58
-rw-r--r--3rdparty/bgfx/src/glcontext_eagl.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_eagl.mm68
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.cpp19
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.cpp4
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm16
-rw-r--r--3rdparty/bgfx/src/glcontext_ppapi.cpp6
-rw-r--r--3rdparty/bgfx/src/glcontext_ppapi.h2
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.cpp4
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.h2
-rw-r--r--3rdparty/bgfx/src/glimports.h20
-rw-r--r--3rdparty/bgfx/src/image.cpp206
-rw-r--r--3rdparty/bgfx/src/image.h18
-rw-r--r--3rdparty/bgfx/src/ovr.cpp111
-rw-r--r--3rdparty/bgfx/src/ovr.h32
-rw-r--r--3rdparty/bgfx/src/renderdoc.cpp59
-rw-r--r--3rdparty/bgfx/src/renderer.h2
-rw-r--r--3rdparty/bgfx/src/renderer_d3d.h172
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp2037
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.h86
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp5002
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.h434
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp620
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h9
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp676
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h205
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.h714
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm2799
-rw-r--r--3rdparty/bgfx/src/renderer_null.cpp8
-rw-r--r--3rdparty/bgfx/src/renderer_vk.cpp3
-rw-r--r--3rdparty/bgfx/src/shader_dx9bc.cpp748
-rw-r--r--3rdparty/bgfx/src/shader_dx9bc.h258
-rw-r--r--3rdparty/bgfx/src/shader_dxbc.cpp1924
-rw-r--r--3rdparty/bgfx/src/shader_dxbc.h609
-rw-r--r--3rdparty/bgfx/src/shader_spirv.cpp732
-rw-r--r--3rdparty/bgfx/src/shader_spirv.h520
-rw-r--r--3rdparty/bgfx/src/vertexdecl.cpp127
-rw-r--r--3rdparty/bgfx/src/vertexdecl.h2
-rw-r--r--3rdparty/bgfx/src/vs_clear.bin.h41
-rw-r--r--3rdparty/bgfx/src/vs_debugfont.bin.h68
-rw-r--r--3rdparty/bgfx/tools/geometryc/geometryc.cpp26
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.cpp62
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.h14
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp4
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp63
-rw-r--r--3rdparty/bx/include/bx/allocator.h8
-rw-r--r--3rdparty/bx/include/bx/blockalloc.h99
-rw-r--r--3rdparty/bx/include/bx/bx.h8
-rw-r--r--3rdparty/bx/include/bx/config.h1
-rw-r--r--3rdparty/bx/include/bx/cpu.h193
-rw-r--r--3rdparty/bx/include/bx/debug.h5
-rw-r--r--3rdparty/bx/include/bx/fpumath.h97
-rw-r--r--3rdparty/bx/include/bx/handlealloc.h384
-rw-r--r--3rdparty/bx/include/bx/hash.h58
-rw-r--r--3rdparty/bx/include/bx/macros.h37
-rw-r--r--3rdparty/bx/include/bx/mpscqueue.h37
-rw-r--r--3rdparty/bx/include/bx/mutex.h8
-rw-r--r--3rdparty/bx/include/bx/os.h97
-rw-r--r--3rdparty/bx/include/bx/platform.h5
-rw-r--r--3rdparty/bx/include/bx/process.h80
-rw-r--r--3rdparty/bx/include/bx/ringbuffer.h12
-rw-r--r--3rdparty/bx/include/bx/string.h12
-rw-r--r--3rdparty/bx/include/bx/thread.h75
-rw-r--r--3rdparty/bx/include/bx/uint32_t.h4
-rw-r--r--3rdparty/bx/include/compat/freebsd/signal.h1
-rw-r--r--3rdparty/bx/include/compat/mingw/sal.h640
-rw-r--r--3rdparty/bx/include/tinystl/buffer.h48
-rw-r--r--3rdparty/bx/include/tinystl/vector.h50
-rw-r--r--3rdparty/bx/scripts/genie.lua1
-rw-r--r--3rdparty/bx/scripts/toolchain.lua250
-rw-r--r--3rdparty/bx/scripts/unittest++.lua3
-rw-r--r--3rdparty/bx/tests/handle.cpp79
-rw-r--r--3rdparty/bx/tests/misc.cpp8
-rw-r--r--3rdparty/bx/tests/uint32_t.cpp30
-rw-r--r--3rdparty/bx/tests/unordered_map_nonpod.cpp6
-rw-r--r--3rdparty/bx/tests/vector_complex.cpp6
-rw-r--r--3rdparty/bx/tests/vector_header.cpp2
-rw-r--r--3rdparty/bx/tests/vector_nocopy.cpp229
-rw-r--r--3rdparty/bx/tests/vector_nodefault.cpp10
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin431216 -> 418080 bytes-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin392640 -> 392624 bytes-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin397312 -> 396288 bytes-rw-r--r--3rdparty/dxsdk/Include/D2D1.h6996
-rw-r--r--3rdparty/dxsdk/Include/D2D1Helper.h948
-rw-r--r--3rdparty/dxsdk/Include/D2DBaseTypes.h145
-rw-r--r--3rdparty/dxsdk/Include/D2Derr.h206
-rw-r--r--3rdparty/dxsdk/Include/D3DX10math.inl2228
-rw-r--r--3rdparty/dxsdk/Include/D3DX_DXGIFormatConvert.inl800
-rw-r--r--3rdparty/dxsdk/Include/DWrite.h4995
-rw-r--r--3rdparty/dxsdk/Include/DXGIType.h123
-rw-r--r--3rdparty/dxsdk/Include/Dcommon.h65
-rw-r--r--3rdparty/dxsdk/Include/DxErr.h99
-rw-r--r--3rdparty/dxsdk/Include/PIXPlugin.h120
-rw-r--r--3rdparty/dxsdk/Include/X3DAudio.h316
-rw-r--r--3rdparty/dxsdk/Include/XAPO.h645
-rw-r--r--3rdparty/dxsdk/Include/XAPOBase.h337
-rw-r--r--3rdparty/dxsdk/Include/XAPOFX.h167
-rw-r--r--3rdparty/dxsdk/Include/XAudio2.h1282
-rw-r--r--3rdparty/dxsdk/Include/XAudio2fx.h431
-rw-r--r--3rdparty/dxsdk/Include/XDSP.h754
-rw-r--r--3rdparty/dxsdk/Include/XInput.h283
-rw-r--r--3rdparty/dxsdk/Include/audiodefs.h263
-rw-r--r--3rdparty/dxsdk/Include/comdecl.h59
-rw-r--r--3rdparty/dxsdk/Include/d3d10sdklayers.h1363
-rw-r--r--3rdparty/dxsdk/Include/d3d11sdklayers.h1671
-rw-r--r--3rdparty/dxsdk/Include/d3d11shader.h296
-rw-r--r--3rdparty/dxsdk/Include/d3dcommon.h804
-rw-r--r--3rdparty/dxsdk/Include/d3dcompiler.h397
-rw-r--r--3rdparty/dxsdk/Include/d3dcsx.h409
-rw-r--r--3rdparty/dxsdk/Include/d3dx10.h72
-rw-r--r--3rdparty/dxsdk/Include/d3dx10async.h290
-rw-r--r--3rdparty/dxsdk/Include/d3dx10core.h444
-rw-r--r--3rdparty/dxsdk/Include/d3dx10math.h1866
-rw-r--r--3rdparty/dxsdk/Include/d3dx10mesh.h286
-rw-r--r--3rdparty/dxsdk/Include/d3dx10tex.h766
-rw-r--r--3rdparty/dxsdk/Include/d3dx11.h74
-rw-r--r--3rdparty/dxsdk/Include/d3dx11async.h164
-rw-r--r--3rdparty/dxsdk/Include/d3dx11core.h128
-rw-r--r--3rdparty/dxsdk/Include/d3dx11tex.h772
-rw-r--r--3rdparty/dxsdk/Include/dinput.h4417
-rw-r--r--3rdparty/dxsdk/Include/dinputd.h755
-rw-r--r--3rdparty/dxsdk/Include/dsconf.h195
-rw-r--r--3rdparty/dxsdk/Include/dsetup.h283
-rw-r--r--3rdparty/dxsdk/Include/dsound.h2385
-rw-r--r--3rdparty/dxsdk/Include/dxdiag.h187
-rw-r--r--3rdparty/dxsdk/Include/dxfile.h239
-rw-r--r--3rdparty/dxsdk/Include/dxsdkver.h18
-rw-r--r--3rdparty/dxsdk/Include/gameux.h721
-rw-r--r--3rdparty/dxsdk/Include/rmxfguid.h223
-rw-r--r--3rdparty/dxsdk/Include/rmxftmpl.h339
-rw-r--r--3rdparty/dxsdk/Include/rpcsal.h499
-rw-r--r--3rdparty/dxsdk/Include/xact3.h1551
-rw-r--r--3rdparty/dxsdk/Include/xact3d3.h275
-rw-r--r--3rdparty/dxsdk/Include/xact3wb.h598
-rw-r--r--3rdparty/dxsdk/Include/xma2defs.h718
-rw-r--r--3rdparty/dxsdk/Include/xnamath.h2938
-rw-r--r--3rdparty/dxsdk/Include/xnamathconvert.inl5785
-rw-r--r--3rdparty/dxsdk/Include/xnamathmatrix.inl3254
-rw-r--r--3rdparty/dxsdk/Include/xnamathmisc.inl2464
-rw-r--r--3rdparty/dxsdk/Include/xnamathvector.inl13279
-rw-r--r--3rdparty/dxsdk/Lib/x64/D3DCSX.libbin3660 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/D3DCSXd.libbin3682 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/DxErr.libbin5711746 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/X3DAudio.libbin2014 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/XAPOFX.libbin1726 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/XInput.libbin3298 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d2d1.libbin2580 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3d10.libbin8736 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3d10_1.libbin8824 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3d11.libbin13980 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3d9.libbin5092 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dcompiler.libbin5810 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx10.libbin45128 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx10d.libbin45530 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx11.libbin13786 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx11d.libbin14040 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx9.libbin81324 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dx9d.libbin81648 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/d3dxof.libbin1740 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/dinput8.libbin286176 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/dsound.libbin3872 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/dwrite.libbin1746 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/dxgi.libbin3480 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/dxguid.libbin977342 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/xapobase.libbin631676 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x64/xapobased.libbin865442 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/D3DCSX.libbin3832 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/D3DCSXd.libbin3854 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/DxErr.libbin5415290 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/X3DAudio.libbin2016 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/XAPOFX.libbin1722 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/XInput.libbin3432 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d2d1.libbin2664 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3d10.libbin9272 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3d10_1.libbin9360 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3d11.libbin14362 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3d9.libbin5210 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dcompiler.libbin6062 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx10.libbin48486 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx10d.libbin48890 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx11.libbin14636 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx11d.libbin14908 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx9.libbin87600 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dx9d.libbin87926 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/d3dxof.libbin1746 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dinput8.libbin284368 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dsetup.libbin5994 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dsound.libbin4038 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dwrite.libbin1758 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dxgi.libbin3580 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/dxguid.libbin896294 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/xapobase.libbin623810 -> 0 bytes-rw-r--r--3rdparty/dxsdk/Lib/x86/xapobased.libbin846528 -> 0 bytes-rw-r--r--3rdparty/genie/.travis.yml16
-rw-r--r--3rdparty/genie/README.md2
-rw-r--r--3rdparty/genie/build/gmake.bsd/Makefile2
-rw-r--r--3rdparty/genie/build/gmake.darwin/Makefile2
-rw-r--r--3rdparty/genie/build/gmake.darwin/genie.make404
-rw-r--r--3rdparty/genie/build/gmake.linux/Makefile2
-rw-r--r--3rdparty/genie/build/gmake.linux/genie.make250
-rw-r--r--3rdparty/genie/build/gmake.solaris/Makefile2
-rw-r--r--3rdparty/genie/build/gmake.windows/Makefile2
-rw-r--r--3rdparty/genie/build/gmake.windows/genie.make252
-rw-r--r--3rdparty/genie/makefile2
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua4
-rw-r--r--3rdparty/genie/src/actions/make/make_solution.lua2
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua18
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2010_vcxproj_filters.lua4
-rw-r--r--3rdparty/genie/src/actions/vstudio/vs2015.lua3
-rw-r--r--3rdparty/genie/src/base/api.lua8
-rw-r--r--3rdparty/genie/src/base/config.lua11
-rw-r--r--3rdparty/genie/src/base/help.lua14
-rw-r--r--3rdparty/genie/src/host/os_getversion.c246
-rw-r--r--3rdparty/genie/src/host/premake.c9
-rw-r--r--3rdparty/genie/src/host/scripts.c116
-rw-r--r--3rdparty/googletest/.travis.yml46
-rw-r--r--3rdparty/googletest/README.md138
-rw-r--r--3rdparty/googletest/googlemock/CHANGES126
-rw-r--r--3rdparty/googletest/googlemock/CMakeLists.txt186
-rw-r--r--3rdparty/googletest/googlemock/CONTRIBUTORS40
-rw-r--r--3rdparty/googletest/googlemock/LICENSE28
-rw-r--r--3rdparty/googletest/googlemock/Makefile.am224
-rw-r--r--3rdparty/googletest/googlemock/README.md333
-rw-r--r--3rdparty/googletest/googlemock/build-aux/.keep (renamed from 3rdparty/unittest-cpp/ChangeLog)0
-rw-r--r--3rdparty/googletest/googlemock/configure.ac146
-rw-r--r--3rdparty/googletest/googlemock/docs/CheatSheet.md562
-rw-r--r--3rdparty/googletest/googlemock/docs/CookBook.md3675
-rw-r--r--3rdparty/googletest/googlemock/docs/DesignDoc.md280
-rw-r--r--3rdparty/googletest/googlemock/docs/DevGuide.md132
-rw-r--r--3rdparty/googletest/googlemock/docs/Documentation.md12
-rw-r--r--3rdparty/googletest/googlemock/docs/ForDummies.md439
-rw-r--r--3rdparty/googletest/googlemock/docs/FrequentlyAskedQuestions.md628
-rw-r--r--3rdparty/googletest/googlemock/docs/KnownIssues.md19
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_5/CheatSheet.md525
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_5/CookBook.md3250
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_5/Documentation.md11
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_5/ForDummies.md439
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md624
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_6/CheatSheet.md534
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_6/CookBook.md3342
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_6/Documentation.md12
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_6/ForDummies.md439
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md628
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_7/CheatSheet.md556
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_7/CookBook.md3432
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_7/Documentation.md12
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_7/ForDummies.md439
-rw-r--r--3rdparty/googletest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md628
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-actions.h1205
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-cardinalities.h147
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-actions.h2377
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump794
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h1095
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump291
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-matchers.h2179
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump672
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h397
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump161
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-matchers.h4399
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-more-actions.h246
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-more-matchers.h58
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock-spec-builders.h1847
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/gmock.h94
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h8
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump10
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h39
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-port.h46
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h279
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump136
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h511
-rw-r--r--3rdparty/googletest/googlemock/include/gmock/internal/gmock-port.h91
-rw-r--r--3rdparty/googletest/googlemock/make/Makefile101
-rw-r--r--3rdparty/googletest/googlemock/msvc/2005/gmock.sln32
-rw-r--r--3rdparty/googletest/googlemock/msvc/2005/gmock.vcproj191
-rw-r--r--3rdparty/googletest/googlemock/msvc/2005/gmock_config.vsprops15
-rw-r--r--3rdparty/googletest/googlemock/msvc/2005/gmock_main.vcproj187
-rw-r--r--3rdparty/googletest/googlemock/msvc/2005/gmock_test.vcproj201
-rw-r--r--3rdparty/googletest/googlemock/msvc/2010/gmock.sln32
-rw-r--r--3rdparty/googletest/googlemock/msvc/2010/gmock.vcxproj82
-rw-r--r--3rdparty/googletest/googlemock/msvc/2010/gmock_config.props19
-rw-r--r--3rdparty/googletest/googlemock/msvc/2010/gmock_main.vcxproj88
-rw-r--r--3rdparty/googletest/googlemock/msvc/2010/gmock_test.vcxproj101
-rw-r--r--3rdparty/googletest/googlemock/scripts/fuse_gmock_files.py240
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/LICENSE203
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/README35
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/README.cppclean115
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/__init__.py0
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/ast.py1733
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/gmock_class.py227
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py448
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/keywords.py59
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/tokenize.py287
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/cpp/utils.py41
-rw-r--r--3rdparty/googletest/googlemock/scripts/generator/gmock_gen.py31
-rw-r--r--3rdparty/googletest/googlemock/scripts/gmock-config.in303
-rw-r--r--3rdparty/googletest/googlemock/scripts/gmock_doctor.py640
-rw-r--r--3rdparty/googletest/googlemock/scripts/upload.py1387
-rw-r--r--3rdparty/googletest/googlemock/scripts/upload_gmock.py78
-rw-r--r--3rdparty/googletest/googlemock/src/gmock-all.cc47
-rw-r--r--3rdparty/googletest/googlemock/src/gmock-cardinalities.cc156
-rw-r--r--3rdparty/googletest/googlemock/src/gmock-internal-utils.cc174
-rw-r--r--3rdparty/googletest/googlemock/src/gmock-matchers.cc498
-rw-r--r--3rdparty/googletest/googlemock/src/gmock-spec-builders.cc823
-rw-r--r--3rdparty/googletest/googlemock/src/gmock.cc183
-rw-r--r--3rdparty/googletest/googlemock/src/gmock_main.cc54
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-actions_test.cc1411
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-cardinalities_test.cc428
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-generated-actions_test.cc1228
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-generated-function-mockers_test.cc622
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-generated-internal-utils_test.cc127
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-generated-matchers_test.cc1286
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-internal-utils_test.cc699
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-matchers_test.cc5646
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-more-actions_test.cc708
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-nice-strict_test.cc424
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-port_test.cc43
-rw-r--r--3rdparty/googletest/googlemock/test/gmock-spec-builders_test.cc2644
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_all_test.cc51
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_ex_test.cc81
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_leak_test.py108
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_leak_test_.cc100
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_link2_test.cc40
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_link_test.cc40
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_link_test.h669
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_output_test.py180
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_output_test_.cc291
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_output_test_golden.txt310
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_stress_test.cc322
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_test.cc220
-rw-r--r--3rdparty/googletest/googlemock/test/gmock_test_utils.py112
-rw-r--r--3rdparty/googletest/googletest/CHANGES157
-rw-r--r--3rdparty/googletest/googletest/CMakeLists.txt260
-rw-r--r--3rdparty/googletest/googletest/CONTRIBUTORS37
-rw-r--r--3rdparty/googletest/googletest/LICENSE28
-rw-r--r--3rdparty/googletest/googletest/Makefile.am310
-rw-r--r--3rdparty/googletest/googletest/README.md280
-rw-r--r--3rdparty/googletest/googletest/build-aux/.keep0
-rw-r--r--3rdparty/googletest/googletest/cmake/internal_utils.cmake242
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest.cbproj138
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest.groupproj54
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest_all.cc38
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest_link.cc40
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest_main.cbproj82
-rw-r--r--3rdparty/googletest/googletest/codegear/gtest_unittest.cbproj88
-rw-r--r--3rdparty/googletest/googletest/configure.ac68
-rw-r--r--3rdparty/googletest/googletest/docs/AdvancedGuide.md2183
-rw-r--r--3rdparty/googletest/googletest/docs/DevGuide.md139
-rw-r--r--3rdparty/googletest/googletest/docs/Documentation.md14
-rw-r--r--3rdparty/googletest/googletest/docs/FAQ.md1087
-rw-r--r--3rdparty/googletest/googletest/docs/Primer.md502
-rw-r--r--3rdparty/googletest/googletest/docs/PumpManual.md177
-rw-r--r--3rdparty/googletest/googletest/docs/Samples.md14
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_AdvancedGuide.md2096
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_Documentation.md12
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_FAQ.md885
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_Primer.md497
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_PumpManual.md177
-rw-r--r--3rdparty/googletest/googletest/docs/V1_5_XcodeGuide.md93
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_AdvancedGuide.md2178
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_Documentation.md14
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_FAQ.md1037
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_Primer.md501
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_PumpManual.md177
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_Samples.md14
-rw-r--r--3rdparty/googletest/googletest/docs/V1_6_XcodeGuide.md93
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_AdvancedGuide.md2181
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_Documentation.md14
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_FAQ.md1081
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_Primer.md501
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_PumpManual.md177
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_Samples.md14
-rw-r--r--3rdparty/googletest/googletest/docs/V1_7_XcodeGuide.md93
-rw-r--r--3rdparty/googletest/googletest/docs/XcodeGuide.md93
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-death-test.h294
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-message.h250
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-param-test.h1444
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-param-test.h.pump510
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-printers.h993
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-spi.h232
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-test-part.h179
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest-typed-test.h263
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest.h2240
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest_pred_impl.h358
-rw-r--r--3rdparty/googletest/googletest/include/gtest/gtest_prod.h58
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/custom/gtest-port.h69
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/custom/gtest-printers.h42
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/custom/gtest.h41
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h319
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-filepath.h206
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-internal.h1238
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h243
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h5146
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump286
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-param-util.h731
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-port-arch.h93
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-port.h2559
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-string.h167
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-tuple.h1020
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-tuple.h.pump347
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-type-util.h3331
-rw-r--r--3rdparty/googletest/googletest/include/gtest/internal/gtest-type-util.h.pump297
-rw-r--r--3rdparty/googletest/googletest/m4/acx_pthread.m4363
-rw-r--r--3rdparty/googletest/googletest/m4/gtest.m474
-rw-r--r--3rdparty/googletest/googletest/make/Makefile82
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest-md.sln45
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest-md.vcproj126
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest.sln45
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest.vcproj126
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_main-md.vcproj129
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_main.vcproj129
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_prod_test-md.vcproj164
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_prod_test.vcproj164
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_unittest-md.vcproj147
-rw-r--r--3rdparty/googletest/googletest/msvc/gtest_unittest.vcproj147
-rw-r--r--3rdparty/googletest/googletest/samples/prime_tables.h123
-rw-r--r--3rdparty/googletest/googletest/samples/sample1.cc68
-rw-r--r--3rdparty/googletest/googletest/samples/sample1.h43
-rw-r--r--3rdparty/googletest/googletest/samples/sample10_unittest.cc144
-rw-r--r--3rdparty/googletest/googletest/samples/sample1_unittest.cc153
-rw-r--r--3rdparty/googletest/googletest/samples/sample2.cc56
-rw-r--r--3rdparty/googletest/googletest/samples/sample2.h85
-rw-r--r--3rdparty/googletest/googletest/samples/sample2_unittest.cc109
-rw-r--r--3rdparty/googletest/googletest/samples/sample3-inl.h172
-rw-r--r--3rdparty/googletest/googletest/samples/sample3_unittest.cc151
-rw-r--r--3rdparty/googletest/googletest/samples/sample4.cc46
-rw-r--r--3rdparty/googletest/googletest/samples/sample4.h53
-rw-r--r--3rdparty/googletest/googletest/samples/sample4_unittest.cc45
-rw-r--r--3rdparty/googletest/googletest/samples/sample5_unittest.cc199
-rw-r--r--3rdparty/googletest/googletest/samples/sample6_unittest.cc224
-rw-r--r--3rdparty/googletest/googletest/samples/sample7_unittest.cc130
-rw-r--r--3rdparty/googletest/googletest/samples/sample8_unittest.cc173
-rw-r--r--3rdparty/googletest/googletest/samples/sample9_unittest.cc160
-rw-r--r--3rdparty/googletest/googletest/scripts/common.py83
-rw-r--r--3rdparty/googletest/googletest/scripts/fuse_gtest_files.py250
-rw-r--r--3rdparty/googletest/googletest/scripts/gen_gtest_pred_impl.py730
-rw-r--r--3rdparty/googletest/googletest/scripts/gtest-config.in274
-rw-r--r--3rdparty/googletest/googletest/scripts/pump.py855
-rw-r--r--3rdparty/googletest/googletest/scripts/release_docs.py158
-rw-r--r--3rdparty/googletest/googletest/scripts/test/Makefile59
-rw-r--r--3rdparty/googletest/googletest/scripts/upload.py1387
-rw-r--r--3rdparty/googletest/googletest/scripts/upload_gtest.py78
-rw-r--r--3rdparty/googletest/googletest/src/gtest-all.cc48
-rw-r--r--3rdparty/googletest/googletest/src/gtest-death-test.cc1342
-rw-r--r--3rdparty/googletest/googletest/src/gtest-filepath.cc387
-rw-r--r--3rdparty/googletest/googletest/src/gtest-internal-inl.h1183
-rw-r--r--3rdparty/googletest/googletest/src/gtest-port.cc1221
-rw-r--r--3rdparty/googletest/googletest/src/gtest-printers.cc373
-rw-r--r--3rdparty/googletest/googletest/src/gtest-test-part.cc110
-rw-r--r--3rdparty/googletest/googletest/src/gtest-typed-test.cc118
-rw-r--r--3rdparty/googletest/googletest/src/gtest.cc5386
-rw-r--r--3rdparty/googletest/googletest/src/gtest_main.cc38
-rw-r--r--3rdparty/googletest/googletest/test/gtest-death-test_ex_test.cc93
-rw-r--r--3rdparty/googletest/googletest/test/gtest-death-test_test.cc1427
-rw-r--r--3rdparty/googletest/googletest/test/gtest-filepath_test.cc662
-rw-r--r--3rdparty/googletest/googletest/test/gtest-linked_ptr_test.cc154
-rw-r--r--3rdparty/googletest/googletest/test/gtest-listener_test.cc311
-rw-r--r--3rdparty/googletest/googletest/test/gtest-message_test.cc159
-rw-r--r--3rdparty/googletest/googletest/test/gtest-options_test.cc215
-rw-r--r--3rdparty/googletest/googletest/test/gtest-param-test2_test.cc65
-rw-r--r--3rdparty/googletest/googletest/test/gtest-param-test_test.cc1055
-rw-r--r--3rdparty/googletest/googletest/test/gtest-param-test_test.h57
-rw-r--r--3rdparty/googletest/googletest/test/gtest-port_test.cc1304
-rw-r--r--3rdparty/googletest/googletest/test/gtest-printers_test.cc1635
-rw-r--r--3rdparty/googletest/googletest/test/gtest-test-part_test.cc208
-rw-r--r--3rdparty/googletest/googletest/test/gtest-tuple_test.cc320
-rw-r--r--3rdparty/googletest/googletest/test/gtest-typed-test2_test.cc45
-rw-r--r--3rdparty/googletest/googletest/test/gtest-typed-test_test.cc380
-rw-r--r--3rdparty/googletest/googletest/test/gtest-typed-test_test.h66
-rw-r--r--3rdparty/googletest/googletest/test/gtest-unittest-api_test.cc341
-rw-r--r--3rdparty/googletest/googletest/test/gtest_all_test.cc47
-rw-r--r--3rdparty/googletest/googletest/test/gtest_break_on_failure_unittest.py212
-rw-r--r--3rdparty/googletest/googletest/test/gtest_break_on_failure_unittest_.cc88
-rw-r--r--3rdparty/googletest/googletest/test/gtest_catch_exceptions_test.py237
-rw-r--r--3rdparty/googletest/googletest/test/gtest_catch_exceptions_test_.cc311
-rw-r--r--3rdparty/googletest/googletest/test/gtest_color_test.py130
-rw-r--r--3rdparty/googletest/googletest/test/gtest_color_test_.cc71
-rw-r--r--3rdparty/googletest/googletest/test/gtest_env_var_test.py103
-rw-r--r--3rdparty/googletest/googletest/test/gtest_env_var_test_.cc126
-rw-r--r--3rdparty/googletest/googletest/test/gtest_environment_test.cc192
-rw-r--r--3rdparty/googletest/googletest/test/gtest_filter_unittest.py633
-rw-r--r--3rdparty/googletest/googletest/test/gtest_filter_unittest_.cc140
-rw-r--r--3rdparty/googletest/googletest/test/gtest_help_test.py172
-rw-r--r--3rdparty/googletest/googletest/test/gtest_help_test_.cc46
-rw-r--r--3rdparty/googletest/googletest/test/gtest_list_tests_unittest.py207
-rw-r--r--3rdparty/googletest/googletest/test/gtest_list_tests_unittest_.cc157
-rw-r--r--3rdparty/googletest/googletest/test/gtest_main_unittest.cc45
-rw-r--r--3rdparty/googletest/googletest/test/gtest_no_test_unittest.cc56
-rw-r--r--3rdparty/googletest/googletest/test/gtest_output_test.py340
-rw-r--r--3rdparty/googletest/googletest/test/gtest_output_test_.cc1062
-rw-r--r--3rdparty/googletest/googletest/test/gtest_output_test_golden_lin.txt743
-rw-r--r--3rdparty/googletest/googletest/test/gtest_pred_impl_unittest.cc2427
-rw-r--r--3rdparty/googletest/googletest/test/gtest_premature_exit_test.cc127
-rw-r--r--3rdparty/googletest/googletest/test/gtest_prod_test.cc57
-rw-r--r--3rdparty/googletest/googletest/test/gtest_repeat_test.cc253
-rw-r--r--3rdparty/googletest/googletest/test/gtest_shuffle_test.py325
-rw-r--r--3rdparty/googletest/googletest/test/gtest_shuffle_test_.cc103
-rw-r--r--3rdparty/googletest/googletest/test/gtest_sole_header_test.cc57
-rw-r--r--3rdparty/googletest/googletest/test/gtest_stress_test.cc256
-rw-r--r--3rdparty/googletest/googletest/test/gtest_test_utils.py320
-rw-r--r--3rdparty/googletest/googletest/test/gtest_throw_on_failure_ex_test.cc92
-rw-r--r--3rdparty/googletest/googletest/test/gtest_throw_on_failure_test.py171
-rw-r--r--3rdparty/googletest/googletest/test/gtest_throw_on_failure_test_.cc72
-rw-r--r--3rdparty/googletest/googletest/test/gtest_uninitialized_test.py70
-rw-r--r--3rdparty/googletest/googletest/test/gtest_uninitialized_test_.cc43
-rw-r--r--3rdparty/googletest/googletest/test/gtest_unittest.cc7699
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_outfile1_test_.cc49
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_outfile2_test_.cc49
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_outfiles_test.py132
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_output_unittest.py307
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_output_unittest_.cc181
-rw-r--r--3rdparty/googletest/googletest/test/gtest_xml_test_utils.py194
-rw-r--r--3rdparty/googletest/googletest/test/production.cc36
-rw-r--r--3rdparty/googletest/googletest/test/production.h55
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/DebugProject.xcconfig30
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/FrameworkTarget.xcconfig17
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/General.xcconfig41
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/ReleaseProject.xcconfig32
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/StaticLibraryTarget.xcconfig18
-rw-r--r--3rdparty/googletest/googletest/xcode/Config/TestTarget.xcconfig8
-rw-r--r--3rdparty/googletest/googletest/xcode/Resources/Info.plist30
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/Info.plist28
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj457
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/runtests.sh62
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/widget.cc63
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/widget.h59
-rw-r--r--3rdparty/googletest/googletest/xcode/Samples/FrameworkSample/widget_test.cc68
-rw-r--r--3rdparty/googletest/googletest/xcode/Scripts/runtests.sh65
-rw-r--r--3rdparty/googletest/googletest/xcode/Scripts/versiongenerate.py100
-rw-r--r--3rdparty/googletest/googletest/xcode/gtest.xcodeproj/project.pbxproj1135
-rw-r--r--3rdparty/googletest/travis.sh15
-rw-r--r--3rdparty/libflac/include/share/Makefile.am1
-rw-r--r--3rdparty/libflac/include/share/endswap.h77
-rw-r--r--3rdparty/libflac/src/libFLAC/bitreader.c52
-rw-r--r--3rdparty/libflac/src/libFLAC/bitwriter.c28
-rw-r--r--3rdparty/mongoose/mongoose.c2
-rw-r--r--3rdparty/mongoose/mongoose.h1
-rw-r--r--3rdparty/portmidi/pm_linux/pmlinuxalsa.c11
-rw-r--r--3rdparty/portmidi/pm_win/pmwinmm.c19
-rw-r--r--3rdparty/portmidi/porttime/ptlinux.c12
-rw-r--r--3rdparty/unittest-cpp/.gitattributes17
-rw-r--r--3rdparty/unittest-cpp/.gitignore43
-rw-r--r--3rdparty/unittest-cpp/.gitmodules3
-rw-r--r--3rdparty/unittest-cpp/AUTHORS3
-rw-r--r--3rdparty/unittest-cpp/CMakeLists.txt59
-rw-r--r--3rdparty/unittest-cpp/INSTALL370
-rw-r--r--3rdparty/unittest-cpp/LICENSE20
-rw-r--r--3rdparty/unittest-cpp/Makefile.am3
-rw-r--r--3rdparty/unittest-cpp/README.md114
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/AssertException.cpp17
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/AssertException.h23
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/CheckMacros.h179
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Checks.cpp50
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Checks.h158
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/CompositeTestReporter.cpp67
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/CompositeTestReporter.h34
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Config.h73
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/CurrentTest.cpp18
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/CurrentTest.h19
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.cpp33
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h35
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.cpp46
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h52
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/ExceptionMacros.h18
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/ExecuteTest.h59
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/HelperMacros.h52
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Makefile.am9
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/MemoryOutStream.cpp218
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/MemoryOutStream.h87
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Posix/SignalTranslator.cpp46
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Posix/SignalTranslator.h42
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Posix/TimeHelpers.cpp33
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Posix/TimeHelpers.h28
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/ReportAssert.cpp70
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/ReportAssert.h12
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/ReportAssertImpl.h46
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Test.cpp41
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Test.h35
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestDetails.cpp24
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestDetails.h27
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestList.cpp39
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestList.h33
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestMacros.h117
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestReporter.cpp9
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestReporter.h22
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestReporterStdout.cpp46
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestReporterStdout.h19
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestResults.cpp60
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestResults.h38
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestRunner.cpp82
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestRunner.h61
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TestSuite.h12
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TimeConstraint.cpp29
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TimeConstraint.h37
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/TimeHelpers.h7
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/UnitTest++.h1
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/UnitTestPP.h11
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Win32/TimeHelpers.cpp49
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/Win32/TimeHelpers.h45
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/XmlTestReporter.cpp131
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/XmlTestReporter.h38
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/unittestpp_vs2005.vcproj614
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/unittestpp_vs2008.vcproj607
-rw-r--r--3rdparty/unittest-cpp/builds/.gitignore4
-rw-r--r--3rdparty/unittest-cpp/configure.ac34
-rw-r--r--3rdparty/unittest-cpp/docs/Building-Using-CMake.md19
-rw-r--r--3rdparty/unittest-cpp/docs/Home.md20
-rw-r--r--3rdparty/unittest-cpp/docs/Macro-Reference.md73
-rw-r--r--3rdparty/unittest-cpp/docs/Writing-More-Tests-With-the-Bowling-Game-Kata.md105
-rw-r--r--3rdparty/unittest-cpp/docs/Writing-and-Running-Your-First-Test.md65
-rw-r--r--3rdparty/unittest-cpp/tests/Main.cpp6
-rw-r--r--3rdparty/unittest-cpp/tests/RecordingReporter.h98
-rw-r--r--3rdparty/unittest-cpp/tests/ScopedCurrentTest.h37
-rw-r--r--3rdparty/unittest-cpp/tests/TestAssertHandler.cpp136
-rw-r--r--3rdparty/unittest-cpp/tests/TestCheckMacros.cpp518
-rw-r--r--3rdparty/unittest-cpp/tests/TestChecks.cpp318
-rw-r--r--3rdparty/unittest-cpp/tests/TestCompositeTestReporter.cpp176
-rw-r--r--3rdparty/unittest-cpp/tests/TestCurrentTest.cpp38
-rw-r--r--3rdparty/unittest-cpp/tests/TestDeferredTestReporter.cpp122
-rw-r--r--3rdparty/unittest-cpp/tests/TestExceptions.cpp563
-rw-r--r--3rdparty/unittest-cpp/tests/TestMemoryOutStream.cpp336
-rw-r--r--3rdparty/unittest-cpp/tests/TestTest.cpp133
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestList.cpp50
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestMacros.cpp221
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestResults.cpp111
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestRunner.cpp330
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestSuite.cpp12
-rw-r--r--3rdparty/unittest-cpp/tests/TestTimeConstraint.cpp69
-rw-r--r--3rdparty/unittest-cpp/tests/TestTimeConstraintMacro.cpp88
-rw-r--r--3rdparty/unittest-cpp/tests/TestUnitTestPP.cpp148
-rw-r--r--3rdparty/unittest-cpp/tests/TestXmlTestReporter.cpp188
-rw-r--r--README.md1
-rw-r--r--hash/a7800.xml216
-rw-r--r--hash/a800_flop.xml27
-rw-r--r--hash/adam_flop.xml4
-rw-r--r--hash/advantage.xml2
-rw-r--r--hash/bbcb_cass.xml151
-rw-r--r--hash/bbcb_de_cass.xml166
-rw-r--r--hash/bbcb_us_flop.xml25
-rw-r--r--hash/bbcmc_flop.xml25
-rw-r--r--hash/c128_cart.xml23
-rw-r--r--hash/c64_flop.xml52
-rw-r--r--hash/cgenie_cass.xml2
-rw-r--r--hash/coleco.xml27
-rw-r--r--hash/epson_cpm.xml24
-rw-r--r--hash/gameking.xml163
-rw-r--r--hash/gameking3.xml41
-rw-r--r--hash/gbcolor.xml41
-rw-r--r--hash/i7000_card.xml4
-rw-r--r--hash/ibm5170_cdrom.xml139
-rw-r--r--hash/jaguar.xml13
-rw-r--r--hash/lantutor.xml42
-rw-r--r--hash/megadriv.xml5
-rw-r--r--hash/msx1_cart.xml586
-rw-r--r--hash/msx1_flop.xml14
-rw-r--r--hash/msx2_cass.xml4
-rw-r--r--hash/msx2_flop.xml38
-rw-r--r--hash/msx2p_flop.xml70
-rw-r--r--hash/msxr_flop.xml140
-rw-r--r--hash/nes.xml104
-rw-r--r--hash/pet_cass.xml6
-rw-r--r--hash/pet_flop.xml20
-rw-r--r--hash/pet_rom.xml16
-rw-r--r--hash/pico.xml162
-rw-r--r--hash/pro128_cart.xml55
-rwxr-xr-xhash/psx.xml4
-rw-r--r--hash/svi318_flop.xml10
-rw-r--r--hash/tandy2k.xml8
-rw-r--r--hash/tiki100.xml3
-rw-r--r--hash/tntell.xml92
-rw-r--r--hash/tutor.xml87
-rw-r--r--hash/vc4000.xml20
-rw-r--r--hash/vidbrain.xml16
-rw-r--r--hash/x1_cass.xml38
-rw-r--r--makefile75
-rw-r--r--nl_examples/congo_bongo.c45
-rw-r--r--nl_examples/congo_bongo.csv15
-rw-r--r--nl_examples/kidniki.c4
-rw-r--r--nl_examples/msx_mixer_stage.c2
-rw-r--r--samples/MM1_keyboard/beep.wavbin0 -> 16758 bytes-rw-r--r--samples/MM1_keyboard/power_switch.wavbin0 -> 74492 bytes-rw-r--r--samples/floppy/floppy_35_motor.wavbin0 -> 17684 bytes-rw-r--r--samples/floppy/floppy_35_step.wavbin0 -> 5260 bytes-rw-r--r--samples/floppy/floppy_525_motor_end.wavbin0 -> 301418 bytes-rw-r--r--samples/floppy/floppy_525_motor_loop.wavbin0 -> 130392 bytes-rw-r--r--samples/floppy/floppy_525_motor_start.wavbin0 -> 34594 bytes-rw-r--r--samples/floppy/floppy_525_step1.wavbin0 -> 17974 bytes-rw-r--r--samples/floppy/floppy_525_step2.wavbin0 -> 27302 bytes-rw-r--r--samples/floppy/floppy_525_step3.wavbin0 -> 20244 bytes-rw-r--r--samples/floppy/floppy_525_step4.wavbin0 -> 18644 bytes-rw-r--r--samples/floppy/floppy_525_step5.wavbin0 -> 19526 bytes-rw-r--r--scripts/build/file2str.py (renamed from src/build/file2str.py)0
-rw-r--r--scripts/build/makedep.py (renamed from src/build/makedep.py)108
-rw-r--r--scripts/build/makelist.py (renamed from src/build/makelist.py)2
-rw-r--r--scripts/build/png.py (renamed from src/build/png.py)27
-rw-r--r--scripts/build/png2bdc.py (renamed from src/build/png2bdc.py)48
-rw-r--r--scripts/build/verinfo.py (renamed from src/build/verinfo.py)0
-rw-r--r--scripts/genie.lua165
-rw-r--r--scripts/src/3rdparty.lua105
-rw-r--r--scripts/src/bus.lua3427
-rw-r--r--scripts/src/cpu.lua1588
-rw-r--r--scripts/src/devices.lua134
-rw-r--r--scripts/src/emu.lua266
-rw-r--r--scripts/src/lib.lua7
-rw-r--r--scripts/src/machine.lua1513
-rw-r--r--scripts/src/main.lua27
-rw-r--r--scripts/src/netlist.lua281
-rw-r--r--scripts/src/osd/sdl.lua1
-rw-r--r--scripts/src/osd/sdl_cfg.lua3
-rw-r--r--scripts/src/osd/windows.lua5
-rw-r--r--scripts/src/sound.lua786
-rw-r--r--scripts/src/tests.lua11
-rw-r--r--scripts/src/tools.lua118
-rw-r--r--scripts/src/video.lua430
-rw-r--r--scripts/target/ldplayer/ldplayer.lua6
-rw-r--r--scripts/target/mame/arcade.lua42
-rw-r--r--scripts/target/mame/dummy.lua12
-rw-r--r--scripts/target/mame/mess.lua2468
-rw-r--r--scripts/target/mame/nl.lua8
-rw-r--r--scripts/target/mame/tiny.lua6
-rw-r--r--scripts/toolchain.lua123
-rw-r--r--src/devices/bus/a1bus/a1bus.c (renamed from src/emu/bus/a1bus/a1bus.c)0
-rw-r--r--src/devices/bus/a1bus/a1bus.h (renamed from src/emu/bus/a1bus/a1bus.h)0
-rw-r--r--src/devices/bus/a1bus/a1cassette.c (renamed from src/emu/bus/a1bus/a1cassette.c)0
-rw-r--r--src/devices/bus/a1bus/a1cassette.h (renamed from src/emu/bus/a1bus/a1cassette.h)0
-rw-r--r--src/devices/bus/a1bus/a1cffa.c (renamed from src/emu/bus/a1bus/a1cffa.c)0
-rw-r--r--src/devices/bus/a1bus/a1cffa.h (renamed from src/emu/bus/a1bus/a1cffa.h)0
-rw-r--r--src/devices/bus/a2bus/a2alfam2.c (renamed from src/emu/bus/a2bus/a2alfam2.c)0
-rw-r--r--src/devices/bus/a2bus/a2alfam2.h (renamed from src/emu/bus/a2bus/a2alfam2.h)0
-rw-r--r--src/devices/bus/a2bus/a2applicard.c (renamed from src/emu/bus/a2bus/a2applicard.c)0
-rw-r--r--src/devices/bus/a2bus/a2applicard.h (renamed from src/emu/bus/a2bus/a2applicard.h)0
-rw-r--r--src/devices/bus/a2bus/a2arcadebd.c (renamed from src/emu/bus/a2bus/a2arcadebd.c)0
-rw-r--r--src/devices/bus/a2bus/a2arcadebd.h (renamed from src/emu/bus/a2bus/a2arcadebd.h)0
-rw-r--r--src/devices/bus/a2bus/a2bus.c (renamed from src/emu/bus/a2bus/a2bus.c)0
-rw-r--r--src/devices/bus/a2bus/a2bus.h (renamed from src/emu/bus/a2bus/a2bus.h)0
-rw-r--r--src/devices/bus/a2bus/a2cffa.c (renamed from src/emu/bus/a2bus/a2cffa.c)0
-rw-r--r--src/devices/bus/a2bus/a2cffa.h (renamed from src/emu/bus/a2bus/a2cffa.h)0
-rw-r--r--src/devices/bus/a2bus/a2corvus.c (renamed from src/emu/bus/a2bus/a2corvus.c)0
-rw-r--r--src/devices/bus/a2bus/a2corvus.h (renamed from src/emu/bus/a2bus/a2corvus.h)0
-rw-r--r--src/devices/bus/a2bus/a2diskii.c (renamed from src/emu/bus/a2bus/a2diskii.c)0
-rw-r--r--src/devices/bus/a2bus/a2diskii.h (renamed from src/emu/bus/a2bus/a2diskii.h)0
-rw-r--r--src/devices/bus/a2bus/a2diskiing.c (renamed from src/emu/bus/a2bus/a2diskiing.c)0
-rw-r--r--src/devices/bus/a2bus/a2diskiing.h (renamed from src/emu/bus/a2bus/a2diskiing.h)0
-rw-r--r--src/devices/bus/a2bus/a2dx1.c (renamed from src/emu/bus/a2bus/a2dx1.c)0
-rw-r--r--src/devices/bus/a2bus/a2dx1.h (renamed from src/emu/bus/a2bus/a2dx1.h)0
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.c (renamed from src/emu/bus/a2bus/a2eauxslot.c)0
-rw-r--r--src/devices/bus/a2bus/a2eauxslot.h (renamed from src/emu/bus/a2bus/a2eauxslot.h)0
-rw-r--r--src/devices/bus/a2bus/a2echoii.c (renamed from src/emu/bus/a2bus/a2echoii.c)0
-rw-r--r--src/devices/bus/a2bus/a2echoii.h (renamed from src/emu/bus/a2bus/a2echoii.h)0
-rw-r--r--src/devices/bus/a2bus/a2eext80col.c (renamed from src/emu/bus/a2bus/a2eext80col.c)0
-rw-r--r--src/devices/bus/a2bus/a2eext80col.h (renamed from src/emu/bus/a2bus/a2eext80col.h)0
-rw-r--r--src/devices/bus/a2bus/a2eramworks3.c (renamed from src/emu/bus/a2bus/a2eramworks3.c)0
-rw-r--r--src/devices/bus/a2bus/a2eramworks3.h (renamed from src/emu/bus/a2bus/a2eramworks3.h)0
-rw-r--r--src/devices/bus/a2bus/a2estd80col.c (renamed from src/emu/bus/a2bus/a2estd80col.c)0
-rw-r--r--src/devices/bus/a2bus/a2estd80col.h (renamed from src/emu/bus/a2bus/a2estd80col.h)0
-rw-r--r--src/devices/bus/a2bus/a2hsscsi.c (renamed from src/emu/bus/a2bus/a2hsscsi.c)0
-rw-r--r--src/devices/bus/a2bus/a2hsscsi.h (renamed from src/emu/bus/a2bus/a2hsscsi.h)0
-rw-r--r--src/devices/bus/a2bus/a2lang.c (renamed from src/emu/bus/a2bus/a2lang.c)0
-rw-r--r--src/devices/bus/a2bus/a2lang.h (renamed from src/emu/bus/a2bus/a2lang.h)0
-rw-r--r--src/devices/bus/a2bus/a2mcms.c (renamed from src/emu/bus/a2bus/a2mcms.c)0
-rw-r--r--src/devices/bus/a2bus/a2mcms.h (renamed from src/emu/bus/a2bus/a2mcms.h)0
-rw-r--r--src/devices/bus/a2bus/a2memexp.c (renamed from src/emu/bus/a2bus/a2memexp.c)0
-rw-r--r--src/devices/bus/a2bus/a2memexp.h (renamed from src/emu/bus/a2bus/a2memexp.h)0
-rw-r--r--src/devices/bus/a2bus/a2midi.c (renamed from src/emu/bus/a2bus/a2midi.c)0
-rw-r--r--src/devices/bus/a2bus/a2midi.h (renamed from src/emu/bus/a2bus/a2midi.h)0
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.c (renamed from src/emu/bus/a2bus/a2mockingboard.c)0
-rw-r--r--src/devices/bus/a2bus/a2mockingboard.h (renamed from src/emu/bus/a2bus/a2mockingboard.h)0
-rw-r--r--src/devices/bus/a2bus/a2pic.c (renamed from src/emu/bus/a2bus/a2pic.c)0
-rw-r--r--src/devices/bus/a2bus/a2pic.h (renamed from src/emu/bus/a2bus/a2pic.h)0
-rw-r--r--src/devices/bus/a2bus/a2sam.c (renamed from src/emu/bus/a2bus/a2sam.c)0
-rw-r--r--src/devices/bus/a2bus/a2sam.h (renamed from src/emu/bus/a2bus/a2sam.h)0
-rw-r--r--src/devices/bus/a2bus/a2scsi.c (renamed from src/emu/bus/a2bus/a2scsi.c)0
-rw-r--r--src/devices/bus/a2bus/a2scsi.h (renamed from src/emu/bus/a2bus/a2scsi.h)0
-rw-r--r--src/devices/bus/a2bus/a2softcard.c (renamed from src/emu/bus/a2bus/a2softcard.c)0
-rw-r--r--src/devices/bus/a2bus/a2softcard.h (renamed from src/emu/bus/a2bus/a2softcard.h)0
-rw-r--r--src/devices/bus/a2bus/a2ssc.c (renamed from src/emu/bus/a2bus/a2ssc.c)0
-rw-r--r--src/devices/bus/a2bus/a2ssc.h (renamed from src/emu/bus/a2bus/a2ssc.h)0
-rw-r--r--src/devices/bus/a2bus/a2swyft.c (renamed from src/emu/bus/a2bus/a2swyft.c)0
-rw-r--r--src/devices/bus/a2bus/a2swyft.h (renamed from src/emu/bus/a2bus/a2swyft.h)0
-rw-r--r--src/devices/bus/a2bus/a2themill.c (renamed from src/emu/bus/a2bus/a2themill.c)0
-rw-r--r--src/devices/bus/a2bus/a2themill.h (renamed from src/emu/bus/a2bus/a2themill.h)0
-rw-r--r--src/devices/bus/a2bus/a2thunderclock.c (renamed from src/emu/bus/a2bus/a2thunderclock.c)0
-rw-r--r--src/devices/bus/a2bus/a2thunderclock.h (renamed from src/emu/bus/a2bus/a2thunderclock.h)0
-rw-r--r--src/devices/bus/a2bus/a2ultraterm.c (renamed from src/emu/bus/a2bus/a2ultraterm.c)0
-rw-r--r--src/devices/bus/a2bus/a2ultraterm.h (renamed from src/emu/bus/a2bus/a2ultraterm.h)0
-rw-r--r--src/devices/bus/a2bus/a2videoterm.c (renamed from src/emu/bus/a2bus/a2videoterm.c)0
-rw-r--r--src/devices/bus/a2bus/a2videoterm.h (renamed from src/emu/bus/a2bus/a2videoterm.h)0
-rw-r--r--src/devices/bus/a2bus/a2vulcan.c (renamed from src/emu/bus/a2bus/a2vulcan.c)0
-rw-r--r--src/devices/bus/a2bus/a2vulcan.h (renamed from src/emu/bus/a2bus/a2vulcan.h)0
-rw-r--r--src/devices/bus/a2bus/a2zipdrive.c (renamed from src/emu/bus/a2bus/a2zipdrive.c)0
-rw-r--r--src/devices/bus/a2bus/a2zipdrive.h (renamed from src/emu/bus/a2bus/a2zipdrive.h)0
-rw-r--r--src/devices/bus/a2bus/corvfdc01.c (renamed from src/emu/bus/a2bus/corvfdc01.c)0
-rw-r--r--src/devices/bus/a2bus/corvfdc01.h (renamed from src/emu/bus/a2bus/corvfdc01.h)0
-rw-r--r--src/devices/bus/a2bus/corvfdc02.c (renamed from src/emu/bus/a2bus/corvfdc02.c)0
-rw-r--r--src/devices/bus/a2bus/corvfdc02.h (renamed from src/emu/bus/a2bus/corvfdc02.h)0
-rw-r--r--src/devices/bus/a2bus/ezcgi.c (renamed from src/emu/bus/a2bus/ezcgi.c)4
-rw-r--r--src/devices/bus/a2bus/ezcgi.h (renamed from src/emu/bus/a2bus/ezcgi.h)0
-rw-r--r--src/devices/bus/a2bus/laser128.c (renamed from src/emu/bus/a2bus/laser128.c)0
-rw-r--r--src/devices/bus/a2bus/laser128.h (renamed from src/emu/bus/a2bus/laser128.h)0
-rw-r--r--src/devices/bus/a2bus/mouse.c (renamed from src/emu/bus/a2bus/mouse.c)0
-rw-r--r--src/devices/bus/a2bus/mouse.h (renamed from src/emu/bus/a2bus/mouse.h)0
-rw-r--r--src/devices/bus/a2bus/ramcard128k.c (renamed from src/emu/bus/a2bus/ramcard128k.c)0
-rw-r--r--src/devices/bus/a2bus/ramcard128k.h (renamed from src/emu/bus/a2bus/ramcard128k.h)0
-rw-r--r--src/devices/bus/a2bus/ramcard16k.c (renamed from src/emu/bus/a2bus/ramcard16k.c)0
-rw-r--r--src/devices/bus/a2bus/ramcard16k.h (renamed from src/emu/bus/a2bus/ramcard16k.h)0
-rw-r--r--src/devices/bus/a2bus/timemasterho.c (renamed from src/emu/bus/a2bus/timemasterho.c)0
-rw-r--r--src/devices/bus/a2bus/timemasterho.h (renamed from src/emu/bus/a2bus/timemasterho.h)0
-rw-r--r--src/devices/bus/a7800/a78_carts.h (renamed from src/emu/bus/a7800/a78_carts.h)0
-rw-r--r--src/devices/bus/a7800/a78_slot.c (renamed from src/emu/bus/a7800/a78_slot.c)0
-rw-r--r--src/devices/bus/a7800/a78_slot.h (renamed from src/emu/bus/a7800/a78_slot.h)0
-rw-r--r--src/devices/bus/a7800/cpuwiz.c (renamed from src/emu/bus/a7800/cpuwiz.c)0
-rw-r--r--src/devices/bus/a7800/cpuwiz.h (renamed from src/emu/bus/a7800/cpuwiz.h)0
-rw-r--r--src/devices/bus/a7800/hiscore.c (renamed from src/emu/bus/a7800/hiscore.c)0
-rw-r--r--src/devices/bus/a7800/hiscore.h (renamed from src/emu/bus/a7800/hiscore.h)0
-rw-r--r--src/devices/bus/a7800/rom.c (renamed from src/emu/bus/a7800/rom.c)2
-rw-r--r--src/devices/bus/a7800/rom.h (renamed from src/emu/bus/a7800/rom.h)0
-rw-r--r--src/devices/bus/a7800/xboard.c (renamed from src/emu/bus/a7800/xboard.c)0
-rw-r--r--src/devices/bus/a7800/xboard.h (renamed from src/emu/bus/a7800/xboard.h)0
-rw-r--r--src/devices/bus/a800/a800_carts.h (renamed from src/emu/bus/a800/a800_carts.h)0
-rw-r--r--src/devices/bus/a800/a800_slot.c (renamed from src/emu/bus/a800/a800_slot.c)0
-rw-r--r--src/devices/bus/a800/a800_slot.h (renamed from src/emu/bus/a800/a800_slot.h)0
-rw-r--r--src/devices/bus/a800/a8sio.c (renamed from src/emu/bus/a8sio/a8sio.c)0
-rw-r--r--src/devices/bus/a800/a8sio.h (renamed from src/emu/bus/a8sio/a8sio.h)0
-rw-r--r--src/devices/bus/a800/cassette.c (renamed from src/emu/bus/a8sio/cassette.c)0
-rw-r--r--src/devices/bus/a800/cassette.h (renamed from src/emu/bus/a8sio/cassette.h)0
-rw-r--r--src/devices/bus/a800/oss.c (renamed from src/emu/bus/a800/oss.c)0
-rw-r--r--src/devices/bus/a800/oss.h (renamed from src/emu/bus/a800/oss.h)0
-rw-r--r--src/devices/bus/a800/rom.c (renamed from src/emu/bus/a800/rom.c)0
-rw-r--r--src/devices/bus/a800/rom.h (renamed from src/emu/bus/a800/rom.h)0
-rw-r--r--src/devices/bus/a800/sparta.c (renamed from src/emu/bus/a800/sparta.c)0
-rw-r--r--src/devices/bus/a800/sparta.h (renamed from src/emu/bus/a800/sparta.h)0
-rw-r--r--src/devices/bus/abcbus/abc890.c (renamed from src/emu/bus/abcbus/abc890.c)0
-rw-r--r--src/devices/bus/abcbus/abc890.h (renamed from src/emu/bus/abcbus/abc890.h)0
-rw-r--r--src/devices/bus/abcbus/abcbus.c (renamed from src/emu/bus/abcbus/abcbus.c)0
-rw-r--r--src/devices/bus/abcbus/abcbus.h (renamed from src/emu/bus/abcbus/abcbus.h)0
-rw-r--r--src/devices/bus/abcbus/fd2.c (renamed from src/emu/bus/abcbus/fd2.c)0
-rw-r--r--src/devices/bus/abcbus/fd2.h (renamed from src/emu/bus/abcbus/fd2.h)0
-rw-r--r--src/devices/bus/abcbus/hdc.c (renamed from src/emu/bus/abcbus/hdc.c)0
-rw-r--r--src/devices/bus/abcbus/hdc.h (renamed from src/emu/bus/abcbus/hdc.h)0
-rw-r--r--src/devices/bus/abcbus/lux10828.c (renamed from src/emu/bus/abcbus/lux10828.c)0
-rw-r--r--src/devices/bus/abcbus/lux10828.h (renamed from src/emu/bus/abcbus/lux10828.h)0
-rw-r--r--src/devices/bus/abcbus/lux21046.c (renamed from src/emu/bus/abcbus/lux21046.c)0
-rw-r--r--src/devices/bus/abcbus/lux21046.h (renamed from src/emu/bus/abcbus/lux21046.h)0
-rw-r--r--src/devices/bus/abcbus/lux21056.c (renamed from src/emu/bus/abcbus/lux21056.c)0
-rw-r--r--src/devices/bus/abcbus/lux21056.h (renamed from src/emu/bus/abcbus/lux21056.h)0
-rw-r--r--src/devices/bus/abcbus/lux4105.c (renamed from src/emu/bus/abcbus/lux4105.c)0
-rw-r--r--src/devices/bus/abcbus/lux4105.h (renamed from src/emu/bus/abcbus/lux4105.h)0
-rw-r--r--src/devices/bus/abcbus/memcard.c (renamed from src/emu/bus/abcbus/memcard.c)0
-rw-r--r--src/devices/bus/abcbus/memcard.h (renamed from src/emu/bus/abcbus/memcard.h)0
-rw-r--r--src/devices/bus/abcbus/ram.c (renamed from src/emu/bus/abcbus/ram.c)0
-rw-r--r--src/devices/bus/abcbus/ram.h (renamed from src/emu/bus/abcbus/ram.h)0
-rw-r--r--src/devices/bus/abcbus/sio.c (renamed from src/emu/bus/abcbus/sio.c)0
-rw-r--r--src/devices/bus/abcbus/sio.h (renamed from src/emu/bus/abcbus/sio.h)0
-rw-r--r--src/devices/bus/abcbus/slutprov.c (renamed from src/emu/bus/abcbus/slutprov.c)0
-rw-r--r--src/devices/bus/abcbus/slutprov.h (renamed from src/emu/bus/abcbus/slutprov.h)0
-rw-r--r--src/devices/bus/abcbus/turbo.c (renamed from src/emu/bus/abcbus/turbo.c)0
-rw-r--r--src/devices/bus/abcbus/turbo.h (renamed from src/emu/bus/abcbus/turbo.h)0
-rw-r--r--src/devices/bus/abcbus/uni800.c (renamed from src/emu/bus/abcbus/uni800.c)0
-rw-r--r--src/devices/bus/abcbus/uni800.h (renamed from src/emu/bus/abcbus/uni800.h)0
-rw-r--r--src/devices/bus/abckb/abc77.c (renamed from src/emu/bus/abckb/abc77.c)0
-rw-r--r--src/devices/bus/abckb/abc77.h (renamed from src/emu/bus/abckb/abc77.h)0
-rw-r--r--src/devices/bus/abckb/abc800kb.c (renamed from src/emu/bus/abckb/abc800kb.c)0
-rw-r--r--src/devices/bus/abckb/abc800kb.h (renamed from src/emu/bus/abckb/abc800kb.h)0
-rw-r--r--src/devices/bus/abckb/abc99.c (renamed from src/emu/bus/abckb/abc99.c)0
-rw-r--r--src/devices/bus/abckb/abc99.h (renamed from src/emu/bus/abckb/abc99.h)0
-rw-r--r--src/devices/bus/abckb/abckb.c (renamed from src/emu/bus/abckb/abckb.c)0
-rw-r--r--src/devices/bus/abckb/abckb.h (renamed from src/emu/bus/abckb/abckb.h)0
-rw-r--r--src/devices/bus/adam/adamlink.c (renamed from src/emu/bus/adam/adamlink.c)0
-rw-r--r--src/devices/bus/adam/adamlink.h (renamed from src/emu/bus/adam/adamlink.h)0
-rw-r--r--src/devices/bus/adam/exp.c (renamed from src/emu/bus/adam/exp.c)0
-rw-r--r--src/devices/bus/adam/exp.h (renamed from src/emu/bus/adam/exp.h)0
-rw-r--r--src/devices/bus/adam/ide.c (renamed from src/emu/bus/adam/ide.c)0
-rw-r--r--src/devices/bus/adam/ide.h (renamed from src/emu/bus/adam/ide.h)0
-rw-r--r--src/devices/bus/adam/ram.c (renamed from src/emu/bus/adam/ram.c)0
-rw-r--r--src/devices/bus/adam/ram.h (renamed from src/emu/bus/adam/ram.h)0
-rw-r--r--src/devices/bus/adamnet/adamnet.c (renamed from src/emu/bus/adamnet/adamnet.c)0
-rw-r--r--src/devices/bus/adamnet/adamnet.h (renamed from src/emu/bus/adamnet/adamnet.h)0
-rw-r--r--src/devices/bus/adamnet/ddp.c (renamed from src/emu/bus/adamnet/ddp.c)0
-rw-r--r--src/devices/bus/adamnet/ddp.h (renamed from src/emu/bus/adamnet/ddp.h)0
-rw-r--r--src/devices/bus/adamnet/fdc.c (renamed from src/emu/bus/adamnet/fdc.c)0
-rw-r--r--src/devices/bus/adamnet/fdc.h (renamed from src/emu/bus/adamnet/fdc.h)0
-rw-r--r--src/devices/bus/adamnet/kb.c (renamed from src/emu/bus/adamnet/kb.c)0
-rw-r--r--src/devices/bus/adamnet/kb.h (renamed from src/emu/bus/adamnet/kb.h)0
-rw-r--r--src/devices/bus/adamnet/printer.c (renamed from src/emu/bus/adamnet/printer.c)0
-rw-r--r--src/devices/bus/adamnet/printer.h (renamed from src/emu/bus/adamnet/printer.h)0
-rw-r--r--src/devices/bus/adamnet/spi.c (renamed from src/emu/bus/adamnet/spi.c)0
-rw-r--r--src/devices/bus/adamnet/spi.h (renamed from src/emu/bus/adamnet/spi.h)0
-rw-r--r--src/devices/bus/amiga/zorro/a2052.c (renamed from src/emu/bus/amiga/zorro/a2052.c)0
-rw-r--r--src/devices/bus/amiga/zorro/a2052.h (renamed from src/emu/bus/amiga/zorro/a2052.h)0
-rw-r--r--src/devices/bus/amiga/zorro/a2232.c (renamed from src/emu/bus/amiga/zorro/a2232.c)0
-rw-r--r--src/devices/bus/amiga/zorro/a2232.h (renamed from src/emu/bus/amiga/zorro/a2232.h)0
-rw-r--r--src/devices/bus/amiga/zorro/a590.c (renamed from src/emu/bus/amiga/zorro/a590.c)0
-rw-r--r--src/devices/bus/amiga/zorro/a590.h (renamed from src/emu/bus/amiga/zorro/a590.h)0
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.c (renamed from src/emu/bus/amiga/zorro/action_replay.c)0
-rw-r--r--src/devices/bus/amiga/zorro/action_replay.h (renamed from src/emu/bus/amiga/zorro/action_replay.h)0
-rw-r--r--src/devices/bus/amiga/zorro/buddha.c (renamed from src/emu/bus/amiga/zorro/buddha.c)0
-rw-r--r--src/devices/bus/amiga/zorro/buddha.h (renamed from src/emu/bus/amiga/zorro/buddha.h)0
-rw-r--r--src/devices/bus/amiga/zorro/cards.c (renamed from src/emu/bus/amiga/zorro/cards.c)0
-rw-r--r--src/devices/bus/amiga/zorro/cards.h (renamed from src/emu/bus/amiga/zorro/cards.h)0
-rw-r--r--src/devices/bus/amiga/zorro/zorro.c (renamed from src/emu/bus/amiga/zorro/zorro.c)0
-rw-r--r--src/devices/bus/amiga/zorro/zorro.h (renamed from src/emu/bus/amiga/zorro/zorro.h)0
-rw-r--r--src/devices/bus/apf/rom.c (renamed from src/emu/bus/apf/rom.c)0
-rw-r--r--src/devices/bus/apf/rom.h (renamed from src/emu/bus/apf/rom.h)0
-rw-r--r--src/devices/bus/apf/slot.c (renamed from src/emu/bus/apf/slot.c)0
-rw-r--r--src/devices/bus/apf/slot.h (renamed from src/emu/bus/apf/slot.h)0
-rw-r--r--src/devices/bus/apricot/cards.c (renamed from src/emu/bus/apricot/cards.c)0
-rw-r--r--src/devices/bus/apricot/cards.h (renamed from src/emu/bus/apricot/cards.h)0
-rw-r--r--src/devices/bus/apricot/expansion.c (renamed from src/emu/bus/apricot/expansion.c)0
-rw-r--r--src/devices/bus/apricot/expansion.h (renamed from src/emu/bus/apricot/expansion.h)0
-rw-r--r--src/devices/bus/apricot/ram.c (renamed from src/emu/bus/apricot/ram.c)0
-rw-r--r--src/devices/bus/apricot/ram.h (renamed from src/emu/bus/apricot/ram.h)0
-rw-r--r--src/devices/bus/arcadia/rom.c (renamed from src/emu/bus/arcadia/rom.c)0
-rw-r--r--src/devices/bus/arcadia/rom.h (renamed from src/emu/bus/arcadia/rom.h)0
-rw-r--r--src/devices/bus/arcadia/slot.c (renamed from src/emu/bus/arcadia/slot.c)0
-rw-r--r--src/devices/bus/arcadia/slot.h (renamed from src/emu/bus/arcadia/slot.h)0
-rw-r--r--src/devices/bus/astrocde/exp.c (renamed from src/emu/bus/astrocde/exp.c)0
-rw-r--r--src/devices/bus/astrocde/exp.h (renamed from src/emu/bus/astrocde/exp.h)0
-rw-r--r--src/devices/bus/astrocde/ram.c (renamed from src/emu/bus/astrocde/ram.c)0
-rw-r--r--src/devices/bus/astrocde/ram.h (renamed from src/emu/bus/astrocde/ram.h)0
-rw-r--r--src/devices/bus/astrocde/rom.c (renamed from src/emu/bus/astrocde/rom.c)0
-rw-r--r--src/devices/bus/astrocde/rom.h (renamed from src/emu/bus/astrocde/rom.h)0
-rw-r--r--src/devices/bus/astrocde/slot.c (renamed from src/emu/bus/astrocde/slot.c)0
-rw-r--r--src/devices/bus/astrocde/slot.h (renamed from src/emu/bus/astrocde/slot.h)0
-rw-r--r--src/devices/bus/bml3/bml3bus.c (renamed from src/emu/bus/bml3/bml3bus.c)0
-rw-r--r--src/devices/bus/bml3/bml3bus.h (renamed from src/emu/bus/bml3/bml3bus.h)0
-rw-r--r--src/devices/bus/bml3/bml3kanji.c (renamed from src/emu/bus/bml3/bml3kanji.c)0
-rw-r--r--src/devices/bus/bml3/bml3kanji.h (renamed from src/emu/bus/bml3/bml3kanji.h)0
-rw-r--r--src/devices/bus/bml3/bml3mp1802.c (renamed from src/emu/bus/bml3/bml3mp1802.c)0
-rw-r--r--src/devices/bus/bml3/bml3mp1802.h (renamed from src/emu/bus/bml3/bml3mp1802.h)0
-rw-r--r--src/devices/bus/bml3/bml3mp1805.c (renamed from src/emu/bus/bml3/bml3mp1805.c)0
-rw-r--r--src/devices/bus/bml3/bml3mp1805.h (renamed from src/emu/bus/bml3/bml3mp1805.h)0
-rw-r--r--src/devices/bus/bw2/exp.c (renamed from src/emu/bus/bw2/exp.c)0
-rw-r--r--src/devices/bus/bw2/exp.h (renamed from src/emu/bus/bw2/exp.h)0
-rw-r--r--src/devices/bus/bw2/ramcard.c (renamed from src/emu/bus/bw2/ramcard.c)0
-rw-r--r--src/devices/bus/bw2/ramcard.h (renamed from src/emu/bus/bw2/ramcard.h)0
-rw-r--r--src/devices/bus/c64/16kb.c (renamed from src/emu/bus/c64/16kb.c)0
-rw-r--r--src/devices/bus/c64/16kb.h (renamed from src/emu/bus/c64/16kb.h)0
-rw-r--r--src/devices/bus/c64/4dxh.c (renamed from src/emu/bus/c64/4dxh.c)0
-rw-r--r--src/devices/bus/c64/4dxh.h (renamed from src/emu/bus/c64/4dxh.h)0
-rw-r--r--src/devices/bus/c64/4ksa.c (renamed from src/emu/bus/c64/4ksa.c)0
-rw-r--r--src/devices/bus/c64/4ksa.h (renamed from src/emu/bus/c64/4ksa.h)0
-rw-r--r--src/devices/bus/c64/4tba.c (renamed from src/emu/bus/c64/4tba.c)0
-rw-r--r--src/devices/bus/c64/4tba.h (renamed from src/emu/bus/c64/4tba.h)0
-rw-r--r--src/devices/bus/c64/bn1541.c (renamed from src/emu/bus/c64/bn1541.c)0
-rw-r--r--src/devices/bus/c64/bn1541.h (renamed from src/emu/bus/c64/bn1541.h)0
-rw-r--r--src/devices/bus/c64/c128_comal80.c (renamed from src/emu/bus/c64/c128_comal80.c)0
-rw-r--r--src/devices/bus/c64/c128_comal80.h (renamed from src/emu/bus/c64/c128_comal80.h)0
-rw-r--r--src/devices/bus/c64/c128_partner.c250
-rw-r--r--src/devices/bus/c64/c128_partner.h68
-rw-r--r--src/devices/bus/c64/comal80.c (renamed from src/emu/bus/c64/comal80.c)0
-rw-r--r--src/devices/bus/c64/comal80.h (renamed from src/emu/bus/c64/comal80.h)0
-rw-r--r--src/devices/bus/c64/cpm.c (renamed from src/emu/bus/c64/cpm.c)0
-rw-r--r--src/devices/bus/c64/cpm.h (renamed from src/emu/bus/c64/cpm.h)0
-rw-r--r--src/devices/bus/c64/currah_speech.c (renamed from src/emu/bus/c64/currah_speech.c)0
-rw-r--r--src/devices/bus/c64/currah_speech.h (renamed from src/emu/bus/c64/currah_speech.h)0
-rw-r--r--src/devices/bus/c64/dela_ep256.c (renamed from src/emu/bus/c64/dela_ep256.c)0
-rw-r--r--src/devices/bus/c64/dela_ep256.h (renamed from src/emu/bus/c64/dela_ep256.h)0
-rw-r--r--src/devices/bus/c64/dela_ep64.c (renamed from src/emu/bus/c64/dela_ep64.c)0
-rw-r--r--src/devices/bus/c64/dela_ep64.h (renamed from src/emu/bus/c64/dela_ep64.h)0
-rw-r--r--src/devices/bus/c64/dela_ep7x8.c (renamed from src/emu/bus/c64/dela_ep7x8.c)0
-rw-r--r--src/devices/bus/c64/dela_ep7x8.h (renamed from src/emu/bus/c64/dela_ep7x8.h)0
-rw-r--r--src/devices/bus/c64/dinamic.c (renamed from src/emu/bus/c64/dinamic.c)0
-rw-r--r--src/devices/bus/c64/dinamic.h (renamed from src/emu/bus/c64/dinamic.h)0
-rw-r--r--src/devices/bus/c64/dqbb.c (renamed from src/emu/bus/c64/dqbb.c)0
-rw-r--r--src/devices/bus/c64/dqbb.h (renamed from src/emu/bus/c64/dqbb.h)0
-rw-r--r--src/devices/bus/c64/easy_calc_result.c (renamed from src/emu/bus/c64/easy_calc_result.c)0
-rw-r--r--src/devices/bus/c64/easy_calc_result.h (renamed from src/emu/bus/c64/easy_calc_result.h)0
-rw-r--r--src/devices/bus/c64/easyflash.c (renamed from src/emu/bus/c64/easyflash.c)0
-rw-r--r--src/devices/bus/c64/easyflash.h (renamed from src/emu/bus/c64/easyflash.h)0
-rw-r--r--src/devices/bus/c64/epyx_fast_load.c (renamed from src/emu/bus/c64/epyx_fast_load.c)0
-rw-r--r--src/devices/bus/c64/epyx_fast_load.h (renamed from src/emu/bus/c64/epyx_fast_load.h)0
-rw-r--r--src/devices/bus/c64/exos.c (renamed from src/emu/bus/c64/exos.c)0
-rw-r--r--src/devices/bus/c64/exos.h (renamed from src/emu/bus/c64/exos.h)0
-rw-r--r--src/devices/bus/c64/exp.c (renamed from src/emu/bus/c64/exp.c)2
-rw-r--r--src/devices/bus/c64/exp.h (renamed from src/emu/bus/c64/exp.h)0
-rw-r--r--src/devices/bus/c64/fcc.c (renamed from src/emu/bus/c64/fcc.c)0
-rw-r--r--src/devices/bus/c64/fcc.h (renamed from src/emu/bus/c64/fcc.h)0
-rw-r--r--src/devices/bus/c64/final.c (renamed from src/emu/bus/c64/final.c)0
-rw-r--r--src/devices/bus/c64/final.h (renamed from src/emu/bus/c64/final.h)0
-rw-r--r--src/devices/bus/c64/final3.c (renamed from src/emu/bus/c64/final3.c)0
-rw-r--r--src/devices/bus/c64/final3.h (renamed from src/emu/bus/c64/final3.h)0
-rw-r--r--src/devices/bus/c64/fun_play.c (renamed from src/emu/bus/c64/fun_play.c)0
-rw-r--r--src/devices/bus/c64/fun_play.h (renamed from src/emu/bus/c64/fun_play.h)0
-rw-r--r--src/devices/bus/c64/geocable.c (renamed from src/emu/bus/c64/geocable.c)0
-rw-r--r--src/devices/bus/c64/geocable.h (renamed from src/emu/bus/c64/geocable.h)0
-rw-r--r--src/devices/bus/c64/georam.c (renamed from src/emu/bus/c64/georam.c)0
-rw-r--r--src/devices/bus/c64/georam.h (renamed from src/emu/bus/c64/georam.h)0
-rw-r--r--src/devices/bus/c64/ide64.c (renamed from src/emu/bus/c64/ide64.c)0
-rw-r--r--src/devices/bus/c64/ide64.h (renamed from src/emu/bus/c64/ide64.h)0
-rw-r--r--src/devices/bus/c64/ieee488.c (renamed from src/emu/bus/c64/ieee488.c)0
-rw-r--r--src/devices/bus/c64/ieee488.h (renamed from src/emu/bus/c64/ieee488.h)0
-rw-r--r--src/devices/bus/c64/kingsoft.c (renamed from src/emu/bus/c64/kingsoft.c)0
-rw-r--r--src/devices/bus/c64/kingsoft.h (renamed from src/emu/bus/c64/kingsoft.h)0
-rw-r--r--src/devices/bus/c64/mach5.c (renamed from src/emu/bus/c64/mach5.c)0
-rw-r--r--src/devices/bus/c64/mach5.h (renamed from src/emu/bus/c64/mach5.h)0
-rw-r--r--src/devices/bus/c64/magic_desk.c (renamed from src/emu/bus/c64/magic_desk.c)0
-rw-r--r--src/devices/bus/c64/magic_desk.h (renamed from src/emu/bus/c64/magic_desk.h)0
-rw-r--r--src/devices/bus/c64/magic_formel.c (renamed from src/emu/bus/c64/magic_formel.c)0
-rw-r--r--src/devices/bus/c64/magic_formel.h (renamed from src/emu/bus/c64/magic_formel.h)0
-rw-r--r--src/devices/bus/c64/magic_voice.c (renamed from src/emu/bus/c64/magic_voice.c)0
-rw-r--r--src/devices/bus/c64/magic_voice.h (renamed from src/emu/bus/c64/magic_voice.h)0
-rw-r--r--src/devices/bus/c64/midi_maplin.c (renamed from src/emu/bus/c64/midi_maplin.c)0
-rw-r--r--src/devices/bus/c64/midi_maplin.h (renamed from src/emu/bus/c64/midi_maplin.h)0
-rw-r--r--src/devices/bus/c64/midi_namesoft.c (renamed from src/emu/bus/c64/midi_namesoft.c)0
-rw-r--r--src/devices/bus/c64/midi_namesoft.h (renamed from src/emu/bus/c64/midi_namesoft.h)0
-rw-r--r--src/devices/bus/c64/midi_passport.c (renamed from src/emu/bus/c64/midi_passport.c)0
-rw-r--r--src/devices/bus/c64/midi_passport.h (renamed from src/emu/bus/c64/midi_passport.h)0
-rw-r--r--src/devices/bus/c64/midi_sci.c (renamed from src/emu/bus/c64/midi_sci.c)0
-rw-r--r--src/devices/bus/c64/midi_sci.h (renamed from src/emu/bus/c64/midi_sci.h)0
-rw-r--r--src/devices/bus/c64/midi_siel.c (renamed from src/emu/bus/c64/midi_siel.c)0
-rw-r--r--src/devices/bus/c64/midi_siel.h (renamed from src/emu/bus/c64/midi_siel.h)0
-rw-r--r--src/devices/bus/c64/mikro_assembler.c (renamed from src/emu/bus/c64/mikro_assembler.c)0
-rw-r--r--src/devices/bus/c64/mikro_assembler.h (renamed from src/emu/bus/c64/mikro_assembler.h)0
-rw-r--r--src/devices/bus/c64/multiscreen.c (renamed from src/emu/bus/c64/multiscreen.c)0
-rw-r--r--src/devices/bus/c64/multiscreen.h (renamed from src/emu/bus/c64/multiscreen.h)0
-rw-r--r--src/devices/bus/c64/music64.c (renamed from src/emu/bus/c64/music64.c)0
-rw-r--r--src/devices/bus/c64/music64.h (renamed from src/emu/bus/c64/music64.h)0
-rw-r--r--src/devices/bus/c64/neoram.c (renamed from src/emu/bus/c64/neoram.c)0
-rw-r--r--src/devices/bus/c64/neoram.h (renamed from src/emu/bus/c64/neoram.h)0
-rw-r--r--src/devices/bus/c64/ocean.c (renamed from src/emu/bus/c64/ocean.c)0
-rw-r--r--src/devices/bus/c64/ocean.h (renamed from src/emu/bus/c64/ocean.h)0
-rw-r--r--src/devices/bus/c64/pagefox.c (renamed from src/emu/bus/c64/pagefox.c)0
-rw-r--r--src/devices/bus/c64/pagefox.h (renamed from src/emu/bus/c64/pagefox.h)0
-rw-r--r--src/devices/bus/c64/partner.c (renamed from src/emu/bus/c64/partner.c)0
-rw-r--r--src/devices/bus/c64/partner.h (renamed from src/emu/bus/c64/partner.h)0
-rw-r--r--src/devices/bus/c64/prophet64.c (renamed from src/emu/bus/c64/prophet64.c)0
-rw-r--r--src/devices/bus/c64/prophet64.h (renamed from src/emu/bus/c64/prophet64.h)0
-rw-r--r--src/devices/bus/c64/ps64.c (renamed from src/emu/bus/c64/ps64.c)0
-rw-r--r--src/devices/bus/c64/ps64.h (renamed from src/emu/bus/c64/ps64.h)0
-rw-r--r--src/devices/bus/c64/reu.c (renamed from src/emu/bus/c64/reu.c)0
-rw-r--r--src/devices/bus/c64/reu.h (renamed from src/emu/bus/c64/reu.h)0
-rw-r--r--src/devices/bus/c64/rex.c (renamed from src/emu/bus/c64/rex.c)0
-rw-r--r--src/devices/bus/c64/rex.h (renamed from src/emu/bus/c64/rex.h)0
-rw-r--r--src/devices/bus/c64/rex_ep256.c (renamed from src/emu/bus/c64/rex_ep256.c)0
-rw-r--r--src/devices/bus/c64/rex_ep256.h (renamed from src/emu/bus/c64/rex_ep256.h)0
-rw-r--r--src/devices/bus/c64/ross.c (renamed from src/emu/bus/c64/ross.c)0
-rw-r--r--src/devices/bus/c64/ross.h (renamed from src/emu/bus/c64/ross.h)0
-rw-r--r--src/devices/bus/c64/sfx_sound_expander.c (renamed from src/emu/bus/c64/sfx_sound_expander.c)0
-rw-r--r--src/devices/bus/c64/sfx_sound_expander.h (renamed from src/emu/bus/c64/sfx_sound_expander.h)0
-rw-r--r--src/devices/bus/c64/silverrock.c (renamed from src/emu/bus/c64/silverrock.c)0
-rw-r--r--src/devices/bus/c64/silverrock.h (renamed from src/emu/bus/c64/silverrock.h)0
-rw-r--r--src/devices/bus/c64/simons_basic.c (renamed from src/emu/bus/c64/simons_basic.c)0
-rw-r--r--src/devices/bus/c64/simons_basic.h (renamed from src/emu/bus/c64/simons_basic.h)0
-rw-r--r--src/devices/bus/c64/stardos.c (renamed from src/emu/bus/c64/stardos.c)0
-rw-r--r--src/devices/bus/c64/stardos.h (renamed from src/emu/bus/c64/stardos.h)0
-rw-r--r--src/devices/bus/c64/std.c (renamed from src/emu/bus/c64/std.c)0
-rw-r--r--src/devices/bus/c64/std.h (renamed from src/emu/bus/c64/std.h)0
-rw-r--r--src/devices/bus/c64/structured_basic.c (renamed from src/emu/bus/c64/structured_basic.c)0
-rw-r--r--src/devices/bus/c64/structured_basic.h (renamed from src/emu/bus/c64/structured_basic.h)0
-rw-r--r--src/devices/bus/c64/super_explode.c (renamed from src/emu/bus/c64/super_explode.c)0
-rw-r--r--src/devices/bus/c64/super_explode.h (renamed from src/emu/bus/c64/super_explode.h)0
-rw-r--r--src/devices/bus/c64/super_games.c (renamed from src/emu/bus/c64/super_games.c)0
-rw-r--r--src/devices/bus/c64/super_games.h (renamed from src/emu/bus/c64/super_games.h)0
-rw-r--r--src/devices/bus/c64/supercpu.c (renamed from src/emu/bus/c64/supercpu.c)0
-rw-r--r--src/devices/bus/c64/supercpu.h (renamed from src/emu/bus/c64/supercpu.h)0
-rw-r--r--src/devices/bus/c64/sw8k.c (renamed from src/emu/bus/c64/sw8k.c)0
-rw-r--r--src/devices/bus/c64/sw8k.h (renamed from src/emu/bus/c64/sw8k.h)0
-rw-r--r--src/devices/bus/c64/swiftlink.c (renamed from src/emu/bus/c64/swiftlink.c)0
-rw-r--r--src/devices/bus/c64/swiftlink.h (renamed from src/emu/bus/c64/swiftlink.h)0
-rw-r--r--src/devices/bus/c64/system3.c (renamed from src/emu/bus/c64/system3.c)0
-rw-r--r--src/devices/bus/c64/system3.h (renamed from src/emu/bus/c64/system3.h)0
-rw-r--r--src/devices/bus/c64/tdos.c (renamed from src/emu/bus/c64/tdos.c)0
-rw-r--r--src/devices/bus/c64/tdos.h (renamed from src/emu/bus/c64/tdos.h)0
-rw-r--r--src/devices/bus/c64/turbo232.c (renamed from src/emu/bus/c64/turbo232.c)0
-rw-r--r--src/devices/bus/c64/turbo232.h (renamed from src/emu/bus/c64/turbo232.h)0
-rw-r--r--src/devices/bus/c64/user.c (renamed from src/emu/bus/c64/user.c)0
-rw-r--r--src/devices/bus/c64/user.h (renamed from src/emu/bus/c64/user.h)0
-rw-r--r--src/devices/bus/c64/vizastar.c (renamed from src/emu/bus/c64/vizastar.c)0
-rw-r--r--src/devices/bus/c64/vizastar.h (renamed from src/emu/bus/c64/vizastar.h)0
-rw-r--r--src/devices/bus/c64/vw64.c (renamed from src/emu/bus/c64/vw64.c)0
-rw-r--r--src/devices/bus/c64/vw64.h (renamed from src/emu/bus/c64/vw64.h)0
-rw-r--r--src/devices/bus/c64/warp_speed.c (renamed from src/emu/bus/c64/warp_speed.c)0
-rw-r--r--src/devices/bus/c64/warp_speed.h (renamed from src/emu/bus/c64/warp_speed.h)0
-rw-r--r--src/devices/bus/c64/westermann.c (renamed from src/emu/bus/c64/westermann.c)0
-rw-r--r--src/devices/bus/c64/westermann.h (renamed from src/emu/bus/c64/westermann.h)0
-rw-r--r--src/devices/bus/c64/xl80.c (renamed from src/emu/bus/c64/xl80.c)0
-rw-r--r--src/devices/bus/c64/xl80.h (renamed from src/emu/bus/c64/xl80.h)0
-rw-r--r--src/devices/bus/c64/zaxxon.c (renamed from src/emu/bus/c64/zaxxon.c)0
-rw-r--r--src/devices/bus/c64/zaxxon.h (renamed from src/emu/bus/c64/zaxxon.h)0
-rw-r--r--src/devices/bus/cbm2/24k.c (renamed from src/emu/bus/cbm2/24k.c)0
-rw-r--r--src/devices/bus/cbm2/24k.h (renamed from src/emu/bus/cbm2/24k.h)0
-rw-r--r--src/devices/bus/cbm2/exp.c (renamed from src/emu/bus/cbm2/exp.c)0
-rw-r--r--src/devices/bus/cbm2/exp.h (renamed from src/emu/bus/cbm2/exp.h)0
-rw-r--r--src/devices/bus/cbm2/hrg.c (renamed from src/emu/bus/cbm2/hrg.c)0
-rw-r--r--src/devices/bus/cbm2/hrg.h (renamed from src/emu/bus/cbm2/hrg.h)0
-rw-r--r--src/devices/bus/cbm2/std.c (renamed from src/emu/bus/cbm2/std.c)0
-rw-r--r--src/devices/bus/cbm2/std.h (renamed from src/emu/bus/cbm2/std.h)0
-rw-r--r--src/devices/bus/cbm2/user.c (renamed from src/emu/bus/cbm2/user.c)0
-rw-r--r--src/devices/bus/cbm2/user.h (renamed from src/emu/bus/cbm2/user.h)0
-rw-r--r--src/devices/bus/cbmiec/c1526.c269
-rw-r--r--src/devices/bus/cbmiec/c1526.h90
-rw-r--r--src/devices/bus/cbmiec/c1541.c (renamed from src/emu/bus/cbmiec/c1541.c)0
-rw-r--r--src/devices/bus/cbmiec/c1541.h (renamed from src/emu/bus/cbmiec/c1541.h)0
-rw-r--r--src/devices/bus/cbmiec/c1571.c (renamed from src/emu/bus/cbmiec/c1571.c)0
-rw-r--r--src/devices/bus/cbmiec/c1571.h (renamed from src/emu/bus/cbmiec/c1571.h)0
-rw-r--r--src/devices/bus/cbmiec/c1581.c (renamed from src/emu/bus/cbmiec/c1581.c)0
-rw-r--r--src/devices/bus/cbmiec/c1581.h (renamed from src/emu/bus/cbmiec/c1581.h)0
-rw-r--r--src/devices/bus/cbmiec/c64_nl10.c (renamed from src/emu/bus/cbmiec/c64_nl10.c)0
-rw-r--r--src/devices/bus/cbmiec/c64_nl10.h (renamed from src/emu/bus/cbmiec/c64_nl10.h)0
-rw-r--r--src/devices/bus/cbmiec/cbmiec.c (renamed from src/emu/bus/cbmiec/cbmiec.c)7
-rw-r--r--src/devices/bus/cbmiec/cbmiec.h (renamed from src/emu/bus/cbmiec/cbmiec.h)0
-rw-r--r--src/devices/bus/cbmiec/cmdhd.c (renamed from src/emu/bus/cbmiec/cmdhd.c)0
-rw-r--r--src/devices/bus/cbmiec/cmdhd.h (renamed from src/emu/bus/cbmiec/cmdhd.h)0
-rw-r--r--src/devices/bus/cbmiec/diag264_lb_iec.c (renamed from src/emu/bus/cbmiec/diag264_lb_iec.c)0
-rw-r--r--src/devices/bus/cbmiec/diag264_lb_iec.h (renamed from src/emu/bus/cbmiec/diag264_lb_iec.h)0
-rw-r--r--src/devices/bus/cbmiec/fd2000.c (renamed from src/emu/bus/cbmiec/fd2000.c)0
-rw-r--r--src/devices/bus/cbmiec/fd2000.h (renamed from src/emu/bus/cbmiec/fd2000.h)0
-rw-r--r--src/devices/bus/cbmiec/interpod.c (renamed from src/emu/bus/cbmiec/interpod.c)0
-rw-r--r--src/devices/bus/cbmiec/interpod.h (renamed from src/emu/bus/cbmiec/interpod.h)0
-rw-r--r--src/devices/bus/cbmiec/serialbox.c (renamed from src/emu/bus/cbmiec/serialbox.c)0
-rw-r--r--src/devices/bus/cbmiec/serialbox.h (renamed from src/emu/bus/cbmiec/serialbox.h)0
-rw-r--r--src/devices/bus/cbmiec/vic1515.c164
-rw-r--r--src/devices/bus/cbmiec/vic1515.h55
-rw-r--r--src/devices/bus/cbmiec/vic1520.c192
-rw-r--r--src/devices/bus/cbmiec/vic1520.h55
-rw-r--r--src/devices/bus/centronics/comxpl80.c (renamed from src/emu/bus/centronics/comxpl80.c)0
-rw-r--r--src/devices/bus/centronics/comxpl80.h (renamed from src/emu/bus/centronics/comxpl80.h)0
-rw-r--r--src/devices/bus/centronics/covox.c (renamed from src/emu/bus/centronics/covox.c)0
-rw-r--r--src/devices/bus/centronics/covox.h (renamed from src/emu/bus/centronics/covox.h)0
-rw-r--r--src/devices/bus/centronics/ctronics.c (renamed from src/emu/bus/centronics/ctronics.c)2
-rw-r--r--src/devices/bus/centronics/ctronics.h (renamed from src/emu/bus/centronics/ctronics.h)0
-rw-r--r--src/devices/bus/centronics/digiblst.c (renamed from src/emu/bus/centronics/digiblst.c)0
-rw-r--r--src/devices/bus/centronics/digiblst.h (renamed from src/emu/bus/centronics/digiblst.h)0
-rw-r--r--src/devices/bus/centronics/dsjoy.c (renamed from src/emu/bus/centronics/dsjoy.c)0
-rw-r--r--src/devices/bus/centronics/dsjoy.h (renamed from src/emu/bus/centronics/dsjoy.h)0
-rw-r--r--src/devices/bus/centronics/epson_ex800.c (renamed from src/emu/bus/centronics/epson_ex800.c)0
-rw-r--r--src/devices/bus/centronics/epson_ex800.h (renamed from src/emu/bus/centronics/epson_ex800.h)0
-rw-r--r--src/devices/bus/centronics/epson_lx800.c (renamed from src/emu/bus/centronics/epson_lx800.c)0
-rw-r--r--src/devices/bus/centronics/epson_lx800.h (renamed from src/emu/bus/centronics/epson_lx800.h)0
-rw-r--r--src/devices/bus/centronics/epson_lx810l.c (renamed from src/emu/bus/centronics/epson_lx810l.c)94
-rw-r--r--src/devices/bus/centronics/epson_lx810l.h (renamed from src/emu/bus/centronics/epson_lx810l.h)21
-rw-r--r--src/devices/bus/centronics/nec_p72.c94
-rw-r--r--src/devices/bus/centronics/nec_p72.h45
-rw-r--r--src/devices/bus/centronics/printer.c (renamed from src/emu/bus/centronics/printer.c)1
-rw-r--r--src/devices/bus/centronics/printer.h (renamed from src/emu/bus/centronics/printer.h)0
-rw-r--r--src/devices/bus/cgenie/expansion/carts.c (renamed from src/emu/bus/cgenie/expansion/carts.c)0
-rw-r--r--src/devices/bus/cgenie/expansion/carts.h (renamed from src/emu/bus/cgenie/expansion/carts.h)0
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.c (renamed from src/emu/bus/cgenie/expansion/expansion.c)0
-rw-r--r--src/devices/bus/cgenie/expansion/expansion.h (renamed from src/emu/bus/cgenie/expansion/expansion.h)0
-rw-r--r--src/devices/bus/cgenie/expansion/floppy.c (renamed from src/emu/bus/cgenie/expansion/floppy.c)0
-rw-r--r--src/devices/bus/cgenie/expansion/floppy.h (renamed from src/emu/bus/cgenie/expansion/floppy.h)0
-rw-r--r--src/devices/bus/cgenie/parallel/carts.c (renamed from src/emu/bus/cgenie/parallel/carts.c)0
-rw-r--r--src/devices/bus/cgenie/parallel/carts.h (renamed from src/emu/bus/cgenie/parallel/carts.h)0
-rw-r--r--src/devices/bus/cgenie/parallel/joystick.c (renamed from src/emu/bus/cgenie/parallel/joystick.c)0
-rw-r--r--src/devices/bus/cgenie/parallel/joystick.h (renamed from src/emu/bus/cgenie/parallel/joystick.h)0
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.c (renamed from src/emu/bus/cgenie/parallel/parallel.c)0
-rw-r--r--src/devices/bus/cgenie/parallel/parallel.h (renamed from src/emu/bus/cgenie/parallel/parallel.h)0
-rw-r--r--src/devices/bus/cgenie/parallel/printer.c (renamed from src/emu/bus/cgenie/parallel/printer.c)0
-rw-r--r--src/devices/bus/cgenie/parallel/printer.h (renamed from src/emu/bus/cgenie/parallel/printer.h)0
-rw-r--r--src/devices/bus/chanf/rom.c (renamed from src/emu/bus/chanf/rom.c)0
-rw-r--r--src/devices/bus/chanf/rom.h (renamed from src/emu/bus/chanf/rom.h)0
-rw-r--r--src/devices/bus/chanf/slot.c (renamed from src/emu/bus/chanf/slot.c)0
-rw-r--r--src/devices/bus/chanf/slot.h (renamed from src/emu/bus/chanf/slot.h)0
-rw-r--r--src/devices/bus/coco/coco_232.c (renamed from src/emu/bus/coco/coco_232.c)0
-rw-r--r--src/devices/bus/coco/coco_232.h (renamed from src/emu/bus/coco/coco_232.h)0
-rw-r--r--src/devices/bus/coco/coco_dwsock.c (renamed from src/emu/bus/coco/coco_dwsock.c)0
-rw-r--r--src/devices/bus/coco/coco_dwsock.h (renamed from src/emu/bus/coco/coco_dwsock.h)0
-rw-r--r--src/devices/bus/coco/coco_fdc.c (renamed from src/emu/bus/coco/coco_fdc.c)0
-rw-r--r--src/devices/bus/coco/coco_fdc.h (renamed from src/emu/bus/coco/coco_fdc.h)0
-rw-r--r--src/devices/bus/coco/coco_multi.c (renamed from src/emu/bus/coco/coco_multi.c)0
-rw-r--r--src/devices/bus/coco/coco_multi.h (renamed from src/emu/bus/coco/coco_multi.h)0
-rw-r--r--src/devices/bus/coco/coco_orch90.c (renamed from src/emu/bus/coco/coco_orch90.c)0
-rw-r--r--src/devices/bus/coco/coco_orch90.h (renamed from src/emu/bus/coco/coco_orch90.h)0
-rw-r--r--src/devices/bus/coco/coco_pak.c (renamed from src/emu/bus/coco/coco_pak.c)0
-rw-r--r--src/devices/bus/coco/coco_pak.h (renamed from src/emu/bus/coco/coco_pak.h)0
-rw-r--r--src/devices/bus/coco/cococart.c (renamed from src/emu/bus/coco/cococart.c)0
-rw-r--r--src/devices/bus/coco/cococart.h (renamed from src/emu/bus/coco/cococart.h)0
-rw-r--r--src/devices/bus/coleco/ctrl.c (renamed from src/emu/bus/coleco/ctrl.c)0
-rw-r--r--src/devices/bus/coleco/ctrl.h (renamed from src/emu/bus/coleco/ctrl.h)0
-rw-r--r--src/devices/bus/coleco/exp.c (renamed from src/emu/bus/coleco/exp.c)11
-rw-r--r--src/devices/bus/coleco/exp.h (renamed from src/emu/bus/coleco/exp.h)0
-rw-r--r--src/devices/bus/coleco/hand.c (renamed from src/emu/bus/coleco/hand.c)0
-rw-r--r--src/devices/bus/coleco/hand.h (renamed from src/emu/bus/coleco/hand.h)0
-rw-r--r--src/devices/bus/coleco/sac.c (renamed from src/emu/bus/coleco/sac.c)0
-rw-r--r--src/devices/bus/coleco/sac.h (renamed from src/emu/bus/coleco/sac.h)0
-rw-r--r--src/devices/bus/coleco/std.c (renamed from src/emu/bus/coleco/std.c)0
-rw-r--r--src/devices/bus/coleco/std.h (renamed from src/emu/bus/coleco/std.h)0
-rw-r--r--src/devices/bus/coleco/xin1.c71
-rw-r--r--src/devices/bus/coleco/xin1.h48
-rw-r--r--src/devices/bus/compucolor/floppy.c (renamed from src/emu/bus/compucolor/floppy.c)0
-rw-r--r--src/devices/bus/compucolor/floppy.h (renamed from src/emu/bus/compucolor/floppy.h)0
-rw-r--r--src/devices/bus/comx35/clm.c (renamed from src/emu/bus/comx35/clm.c)0
-rw-r--r--src/devices/bus/comx35/clm.h (renamed from src/emu/bus/comx35/clm.h)0
-rw-r--r--src/devices/bus/comx35/eprom.c (renamed from src/emu/bus/comx35/eprom.c)0
-rw-r--r--src/devices/bus/comx35/eprom.h (renamed from src/emu/bus/comx35/eprom.h)0
-rw-r--r--src/devices/bus/comx35/exp.c (renamed from src/emu/bus/comx35/exp.c)0
-rw-r--r--src/devices/bus/comx35/exp.h (renamed from src/emu/bus/comx35/exp.h)0
-rw-r--r--src/devices/bus/comx35/expbox.c (renamed from src/emu/bus/comx35/expbox.c)0
-rw-r--r--src/devices/bus/comx35/expbox.h (renamed from src/emu/bus/comx35/expbox.h)0
-rw-r--r--src/devices/bus/comx35/fdc.c (renamed from src/emu/bus/comx35/fdc.c)0
-rw-r--r--src/devices/bus/comx35/fdc.h (renamed from src/emu/bus/comx35/fdc.h)0
-rw-r--r--src/devices/bus/comx35/joycard.c (renamed from src/emu/bus/comx35/joycard.c)0
-rw-r--r--src/devices/bus/comx35/joycard.h (renamed from src/emu/bus/comx35/joycard.h)0
-rw-r--r--src/devices/bus/comx35/printer.c (renamed from src/emu/bus/comx35/printer.c)0
-rw-r--r--src/devices/bus/comx35/printer.h (renamed from src/emu/bus/comx35/printer.h)0
-rw-r--r--src/devices/bus/comx35/ram.c (renamed from src/emu/bus/comx35/ram.c)0
-rw-r--r--src/devices/bus/comx35/ram.h (renamed from src/emu/bus/comx35/ram.h)0
-rw-r--r--src/devices/bus/comx35/thermal.c (renamed from src/emu/bus/comx35/thermal.c)0
-rw-r--r--src/devices/bus/comx35/thermal.h (renamed from src/emu/bus/comx35/thermal.h)0
-rw-r--r--src/devices/bus/cpc/amdrum.c (renamed from src/emu/bus/cpc/amdrum.c)0
-rw-r--r--src/devices/bus/cpc/amdrum.h (renamed from src/emu/bus/cpc/amdrum.h)0
-rw-r--r--src/devices/bus/cpc/brunword4.c (renamed from src/emu/bus/cpc/brunword4.c)0
-rw-r--r--src/devices/bus/cpc/brunword4.h (renamed from src/emu/bus/cpc/brunword4.h)0
-rw-r--r--src/devices/bus/cpc/cpc_pds.c (renamed from src/emu/bus/cpc/cpc_pds.c)0
-rw-r--r--src/devices/bus/cpc/cpc_pds.h (renamed from src/emu/bus/cpc/cpc_pds.h)0
-rw-r--r--src/devices/bus/cpc/cpc_rom.c (renamed from src/emu/bus/cpc/cpc_rom.c)0
-rw-r--r--src/devices/bus/cpc/cpc_rom.h (renamed from src/emu/bus/cpc/cpc_rom.h)0
-rw-r--r--src/devices/bus/cpc/cpc_rs232.c (renamed from src/emu/bus/cpc/cpc_rs232.c)0
-rw-r--r--src/devices/bus/cpc/cpc_rs232.h (renamed from src/emu/bus/cpc/cpc_rs232.h)0
-rw-r--r--src/devices/bus/cpc/cpc_ssa1.c (renamed from src/emu/bus/cpc/cpc_ssa1.c)0
-rw-r--r--src/devices/bus/cpc/cpc_ssa1.h (renamed from src/emu/bus/cpc/cpc_ssa1.h)0
-rw-r--r--src/devices/bus/cpc/cpcexp.c (renamed from src/emu/bus/cpc/cpcexp.c)0
-rw-r--r--src/devices/bus/cpc/cpcexp.h (renamed from src/emu/bus/cpc/cpcexp.h)10
-rw-r--r--src/devices/bus/cpc/ddi1.c (renamed from src/emu/bus/cpc/ddi1.c)24
-rw-r--r--src/devices/bus/cpc/ddi1.h (renamed from src/emu/bus/cpc/ddi1.h)4
-rw-r--r--src/devices/bus/cpc/hd20.c (renamed from src/emu/bus/cpc/hd20.c)0
-rw-r--r--src/devices/bus/cpc/hd20.h (renamed from src/emu/bus/cpc/hd20.h)0
-rw-r--r--src/devices/bus/cpc/magicsound.c189
-rw-r--r--src/devices/bus/cpc/magicsound.h91
-rw-r--r--src/devices/bus/cpc/mface2.c (renamed from src/emu/bus/cpc/mface2.c)0
-rw-r--r--src/devices/bus/cpc/mface2.h (renamed from src/emu/bus/cpc/mface2.h)0
-rw-r--r--src/devices/bus/cpc/playcity.c (renamed from src/emu/bus/cpc/playcity.c)0
-rw-r--r--src/devices/bus/cpc/playcity.h (renamed from src/emu/bus/cpc/playcity.h)0
-rw-r--r--src/devices/bus/cpc/smartwatch.c (renamed from src/emu/bus/cpc/smartwatch.c)0
-rw-r--r--src/devices/bus/cpc/smartwatch.h (renamed from src/emu/bus/cpc/smartwatch.h)0
-rw-r--r--src/devices/bus/cpc/symbfac2.c (renamed from src/emu/bus/cpc/symbfac2.c)0
-rw-r--r--src/devices/bus/cpc/symbfac2.h (renamed from src/emu/bus/cpc/symbfac2.h)0
-rw-r--r--src/devices/bus/crvision/rom.c (renamed from src/emu/bus/crvision/rom.c)0
-rw-r--r--src/devices/bus/crvision/rom.h (renamed from src/emu/bus/crvision/rom.h)0
-rw-r--r--src/devices/bus/crvision/slot.c (renamed from src/emu/bus/crvision/slot.c)0
-rw-r--r--src/devices/bus/crvision/slot.h (renamed from src/emu/bus/crvision/slot.h)0
-rw-r--r--src/devices/bus/dmv/dmvbus.c (renamed from src/emu/bus/dmv/dmvbus.c)0
-rw-r--r--src/devices/bus/dmv/dmvbus.h (renamed from src/emu/bus/dmv/dmvbus.h)0
-rw-r--r--src/devices/bus/dmv/k210.c (renamed from src/emu/bus/dmv/k210.c)0
-rw-r--r--src/devices/bus/dmv/k210.h (renamed from src/emu/bus/dmv/k210.h)0
-rw-r--r--src/devices/bus/dmv/k220.c (renamed from src/emu/bus/dmv/k220.c)13
-rw-r--r--src/devices/bus/dmv/k220.h (renamed from src/emu/bus/dmv/k220.h)0
-rw-r--r--src/devices/bus/dmv/k230.c (renamed from src/emu/bus/dmv/k230.c)0
-rw-r--r--src/devices/bus/dmv/k230.h (renamed from src/emu/bus/dmv/k230.h)0
-rw-r--r--src/devices/bus/dmv/k233.c (renamed from src/emu/bus/dmv/k233.c)0
-rw-r--r--src/devices/bus/dmv/k233.h (renamed from src/emu/bus/dmv/k233.h)0
-rw-r--r--src/devices/bus/dmv/k801.c (renamed from src/emu/bus/dmv/k801.c)0
-rw-r--r--src/devices/bus/dmv/k801.h (renamed from src/emu/bus/dmv/k801.h)0
-rw-r--r--src/devices/bus/dmv/k803.c (renamed from src/emu/bus/dmv/k803.c)0
-rw-r--r--src/devices/bus/dmv/k803.h (renamed from src/emu/bus/dmv/k803.h)0
-rw-r--r--src/devices/bus/dmv/k806.c (renamed from src/emu/bus/dmv/k806.c)0
-rw-r--r--src/devices/bus/dmv/k806.h (renamed from src/emu/bus/dmv/k806.h)0
-rw-r--r--src/devices/bus/dmv/ram.c (renamed from src/emu/bus/dmv/ram.c)0
-rw-r--r--src/devices/bus/dmv/ram.h (renamed from src/emu/bus/dmv/ram.h)0
-rw-r--r--src/devices/bus/ecbbus/ecbbus.c (renamed from src/emu/bus/ecbbus/ecbbus.c)0
-rw-r--r--src/devices/bus/ecbbus/ecbbus.h (renamed from src/emu/bus/ecbbus/ecbbus.h)0
-rw-r--r--src/devices/bus/ecbbus/grip.c (renamed from src/emu/bus/ecbbus/grip.c)0
-rw-r--r--src/devices/bus/ecbbus/grip.h (renamed from src/emu/bus/ecbbus/grip.h)0
-rw-r--r--src/devices/bus/econet/e01.c (renamed from src/emu/bus/econet/e01.c)0
-rw-r--r--src/devices/bus/econet/e01.h (renamed from src/emu/bus/econet/e01.h)0
-rw-r--r--src/devices/bus/econet/econet.c (renamed from src/emu/bus/econet/econet.c)0
-rw-r--r--src/devices/bus/econet/econet.h (renamed from src/emu/bus/econet/econet.h)0
-rw-r--r--src/devices/bus/ep64/exdos.c (renamed from src/emu/bus/ep64/exdos.c)0
-rw-r--r--src/devices/bus/ep64/exdos.h (renamed from src/emu/bus/ep64/exdos.h)0
-rw-r--r--src/devices/bus/ep64/exp.c (renamed from src/emu/bus/ep64/exp.c)0
-rw-r--r--src/devices/bus/ep64/exp.h (renamed from src/emu/bus/ep64/exp.h)0
-rw-r--r--src/devices/bus/epson_sio/epson_sio.c (renamed from src/emu/bus/epson_sio/epson_sio.c)0
-rw-r--r--src/devices/bus/epson_sio/epson_sio.h (renamed from src/emu/bus/epson_sio/epson_sio.h)0
-rw-r--r--src/devices/bus/epson_sio/pf10.c (renamed from src/emu/bus/epson_sio/pf10.c)0
-rw-r--r--src/devices/bus/epson_sio/pf10.h (renamed from src/emu/bus/epson_sio/pf10.h)0
-rw-r--r--src/devices/bus/epson_sio/tf20.c (renamed from src/emu/bus/epson_sio/tf20.c)0
-rw-r--r--src/devices/bus/epson_sio/tf20.h (renamed from src/emu/bus/epson_sio/tf20.h)0
-rw-r--r--src/devices/bus/gameboy/gb_slot.c (renamed from src/emu/bus/gameboy/gb_slot.c)0
-rw-r--r--src/devices/bus/gameboy/gb_slot.h (renamed from src/emu/bus/gameboy/gb_slot.h)0
-rw-r--r--src/devices/bus/gameboy/mbc.c (renamed from src/emu/bus/gameboy/mbc.c)0
-rw-r--r--src/devices/bus/gameboy/mbc.h (renamed from src/emu/bus/gameboy/mbc.h)0
-rw-r--r--src/devices/bus/gameboy/rom.c (renamed from src/emu/bus/gameboy/rom.c)0
-rw-r--r--src/devices/bus/gameboy/rom.h (renamed from src/emu/bus/gameboy/rom.h)0
-rw-r--r--src/devices/bus/gamegear/ggext.c (renamed from src/emu/bus/gamegear/ggext.c)0
-rw-r--r--src/devices/bus/gamegear/ggext.h (renamed from src/emu/bus/gamegear/ggext.h)0
-rw-r--r--src/devices/bus/gamegear/smsctrladp.c (renamed from src/emu/bus/gamegear/smsctrladp.c)0
-rw-r--r--src/devices/bus/gamegear/smsctrladp.h (renamed from src/emu/bus/gamegear/smsctrladp.h)0
-rw-r--r--src/devices/bus/gba/gba_slot.c (renamed from src/emu/bus/gba/gba_slot.c)0
-rw-r--r--src/devices/bus/gba/gba_slot.h (renamed from src/emu/bus/gba/gba_slot.h)0
-rw-r--r--src/devices/bus/gba/rom.c (renamed from src/emu/bus/gba/rom.c)0
-rw-r--r--src/devices/bus/gba/rom.h (renamed from src/emu/bus/gba/rom.h)0
-rw-r--r--src/devices/bus/generic/carts.c (renamed from src/emu/bus/generic/carts.c)0
-rw-r--r--src/devices/bus/generic/carts.h (renamed from src/emu/bus/generic/carts.h)0
-rw-r--r--src/devices/bus/generic/ram.c (renamed from src/emu/bus/generic/ram.c)0
-rw-r--r--src/devices/bus/generic/ram.h (renamed from src/emu/bus/generic/ram.h)0
-rw-r--r--src/devices/bus/generic/rom.c (renamed from src/emu/bus/generic/rom.c)0
-rw-r--r--src/devices/bus/generic/rom.h (renamed from src/emu/bus/generic/rom.h)0
-rw-r--r--src/devices/bus/generic/slot.c (renamed from src/emu/bus/generic/slot.c)0
-rw-r--r--src/devices/bus/generic/slot.h (renamed from src/emu/bus/generic/slot.h)0
-rw-r--r--src/devices/bus/ieee488/c2031.c (renamed from src/emu/bus/ieee488/c2031.c)0
-rw-r--r--src/devices/bus/ieee488/c2031.h (renamed from src/emu/bus/ieee488/c2031.h)0
-rw-r--r--src/devices/bus/ieee488/c2040.c (renamed from src/emu/bus/ieee488/c2040.c)0
-rw-r--r--src/devices/bus/ieee488/c2040.h (renamed from src/emu/bus/ieee488/c2040.h)0
-rw-r--r--src/devices/bus/ieee488/c2040fdc.c (renamed from src/emu/bus/ieee488/c2040fdc.c)0
-rw-r--r--src/devices/bus/ieee488/c2040fdc.h (renamed from src/emu/bus/ieee488/c2040fdc.h)0
-rw-r--r--src/devices/bus/ieee488/c8050.c (renamed from src/emu/bus/ieee488/c8050.c)0
-rw-r--r--src/devices/bus/ieee488/c8050.h (renamed from src/emu/bus/ieee488/c8050.h)0
-rw-r--r--src/devices/bus/ieee488/c8050fdc.c (renamed from src/emu/bus/ieee488/c8050fdc.c)0
-rw-r--r--src/devices/bus/ieee488/c8050fdc.h (renamed from src/emu/bus/ieee488/c8050fdc.h)0
-rw-r--r--src/devices/bus/ieee488/c8280.c (renamed from src/emu/bus/ieee488/c8280.c)0
-rw-r--r--src/devices/bus/ieee488/c8280.h (renamed from src/emu/bus/ieee488/c8280.h)0
-rw-r--r--src/devices/bus/ieee488/d9060.c (renamed from src/emu/bus/ieee488/d9060.c)0
-rw-r--r--src/devices/bus/ieee488/d9060.h (renamed from src/emu/bus/ieee488/d9060.h)0
-rw-r--r--src/devices/bus/ieee488/hardbox.c (renamed from src/emu/bus/ieee488/hardbox.c)4
-rw-r--r--src/devices/bus/ieee488/hardbox.h (renamed from src/emu/bus/ieee488/hardbox.h)0
-rw-r--r--src/devices/bus/ieee488/ieee488.c (renamed from src/emu/bus/ieee488/ieee488.c)2
-rw-r--r--src/devices/bus/ieee488/ieee488.h (renamed from src/emu/bus/ieee488/ieee488.h)0
-rw-r--r--src/devices/bus/ieee488/shark.c (renamed from src/emu/bus/ieee488/shark.c)0
-rw-r--r--src/devices/bus/ieee488/shark.h (renamed from src/emu/bus/ieee488/shark.h)0
-rw-r--r--src/devices/bus/ieee488/softbox.c (renamed from src/emu/bus/ieee488/softbox.c)2
-rw-r--r--src/devices/bus/ieee488/softbox.h (renamed from src/emu/bus/ieee488/softbox.h)0
-rw-r--r--src/devices/bus/imi7000/imi5000h.c (renamed from src/emu/bus/imi7000/imi5000h.c)0
-rw-r--r--src/devices/bus/imi7000/imi5000h.h (renamed from src/emu/bus/imi7000/imi5000h.h)0
-rw-r--r--src/devices/bus/imi7000/imi7000.c (renamed from src/emu/bus/imi7000/imi7000.c)0
-rw-r--r--src/devices/bus/imi7000/imi7000.h (renamed from src/emu/bus/imi7000/imi7000.h)0
-rw-r--r--src/devices/bus/intv/ecs.c (renamed from src/emu/bus/intv/ecs.c)0
-rw-r--r--src/devices/bus/intv/ecs.h (renamed from src/emu/bus/intv/ecs.h)0
-rw-r--r--src/devices/bus/intv/rom.c (renamed from src/emu/bus/intv/rom.c)0
-rw-r--r--src/devices/bus/intv/rom.h (renamed from src/emu/bus/intv/rom.h)0
-rw-r--r--src/devices/bus/intv/slot.c (renamed from src/emu/bus/intv/slot.c)0
-rw-r--r--src/devices/bus/intv/slot.h (renamed from src/emu/bus/intv/slot.h)0
-rw-r--r--src/devices/bus/intv/voice.c (renamed from src/emu/bus/intv/voice.c)0
-rw-r--r--src/devices/bus/intv/voice.h (renamed from src/emu/bus/intv/voice.h)0
-rw-r--r--src/devices/bus/iq151/disc2.c (renamed from src/emu/bus/iq151/disc2.c)0
-rw-r--r--src/devices/bus/iq151/disc2.h (renamed from src/emu/bus/iq151/disc2.h)0
-rw-r--r--src/devices/bus/iq151/grafik.c (renamed from src/emu/bus/iq151/grafik.c)0
-rw-r--r--src/devices/bus/iq151/grafik.h (renamed from src/emu/bus/iq151/grafik.h)0
-rw-r--r--src/devices/bus/iq151/iq151.c (renamed from src/emu/bus/iq151/iq151.c)0
-rw-r--r--src/devices/bus/iq151/iq151.h (renamed from src/emu/bus/iq151/iq151.h)0
-rw-r--r--src/devices/bus/iq151/minigraf.c (renamed from src/emu/bus/iq151/minigraf.c)0
-rw-r--r--src/devices/bus/iq151/minigraf.h (renamed from src/emu/bus/iq151/minigraf.h)0
-rw-r--r--src/devices/bus/iq151/ms151a.c (renamed from src/emu/bus/iq151/ms151a.c)0
-rw-r--r--src/devices/bus/iq151/ms151a.h (renamed from src/emu/bus/iq151/ms151a.h)0
-rw-r--r--src/devices/bus/iq151/rom.c (renamed from src/emu/bus/iq151/rom.c)0
-rw-r--r--src/devices/bus/iq151/rom.h (renamed from src/emu/bus/iq151/rom.h)0
-rw-r--r--src/devices/bus/iq151/staper.c (renamed from src/emu/bus/iq151/staper.c)0
-rw-r--r--src/devices/bus/iq151/staper.h (renamed from src/emu/bus/iq151/staper.h)0
-rw-r--r--src/devices/bus/iq151/video32.c (renamed from src/emu/bus/iq151/video32.c)0
-rw-r--r--src/devices/bus/iq151/video32.h (renamed from src/emu/bus/iq151/video32.h)0
-rw-r--r--src/devices/bus/iq151/video64.c (renamed from src/emu/bus/iq151/video64.c)0
-rw-r--r--src/devices/bus/iq151/video64.h (renamed from src/emu/bus/iq151/video64.h)0
-rw-r--r--src/devices/bus/isa/3c503.c (renamed from src/emu/bus/isa/3c503.c)0
-rw-r--r--src/devices/bus/isa/3c503.h (renamed from src/emu/bus/isa/3c503.h)0
-rw-r--r--src/devices/bus/isa/3c505.c (renamed from src/emu/bus/isa/3c505.c)0
-rw-r--r--src/devices/bus/isa/3c505.h (renamed from src/emu/bus/isa/3c505.h)0
-rw-r--r--src/devices/bus/isa/adlib.c (renamed from src/emu/bus/isa/adlib.c)0
-rw-r--r--src/devices/bus/isa/adlib.h (renamed from src/emu/bus/isa/adlib.h)0
-rw-r--r--src/devices/bus/isa/aga.c (renamed from src/emu/bus/isa/aga.c)0
-rw-r--r--src/devices/bus/isa/aga.h (renamed from src/emu/bus/isa/aga.h)0
-rw-r--r--src/devices/bus/isa/aha1542.c (renamed from src/emu/bus/isa/aha1542.c)0
-rw-r--r--src/devices/bus/isa/aha1542.h (renamed from src/emu/bus/isa/aha1542.h)0
-rw-r--r--src/devices/bus/isa/cga.c (renamed from src/emu/bus/isa/cga.c)0
-rw-r--r--src/devices/bus/isa/cga.h (renamed from src/emu/bus/isa/cga.h)0
-rw-r--r--src/devices/bus/isa/com.c (renamed from src/emu/bus/isa/com.c)0
-rw-r--r--src/devices/bus/isa/com.h (renamed from src/emu/bus/isa/com.h)0
-rw-r--r--src/devices/bus/isa/dectalk.c (renamed from src/emu/bus/isa/dectalk.c)0
-rw-r--r--src/devices/bus/isa/dectalk.h (renamed from src/emu/bus/isa/dectalk.h)0
-rw-r--r--src/devices/bus/isa/ega.c (renamed from src/emu/bus/isa/ega.c)0
-rw-r--r--src/devices/bus/isa/ega.h (renamed from src/emu/bus/isa/ega.h)0
-rw-r--r--src/devices/bus/isa/fdc.c (renamed from src/emu/bus/isa/fdc.c)0
-rw-r--r--src/devices/bus/isa/fdc.h (renamed from src/emu/bus/isa/fdc.h)0
-rw-r--r--src/devices/bus/isa/finalchs.c (renamed from src/emu/bus/isa/finalchs.c)0
-rw-r--r--src/devices/bus/isa/finalchs.h (renamed from src/emu/bus/isa/finalchs.h)0
-rw-r--r--src/devices/bus/isa/gblaster.c (renamed from src/emu/bus/isa/gblaster.c)12
-rw-r--r--src/devices/bus/isa/gblaster.h (renamed from src/emu/bus/isa/gblaster.h)0
-rw-r--r--src/devices/bus/isa/gus.c (renamed from src/emu/bus/isa/gus.c)2
-rw-r--r--src/devices/bus/isa/gus.h (renamed from src/emu/bus/isa/gus.h)0
-rw-r--r--src/devices/bus/isa/hdc.c (renamed from src/emu/bus/isa/hdc.c)0
-rw-r--r--src/devices/bus/isa/hdc.h (renamed from src/emu/bus/isa/hdc.h)0
-rw-r--r--src/devices/bus/isa/ibm_mfc.c (renamed from src/emu/bus/isa/ibm_mfc.c)0
-rw-r--r--src/devices/bus/isa/ibm_mfc.h (renamed from src/emu/bus/isa/ibm_mfc.h)0
-rw-r--r--src/devices/bus/isa/ide.c (renamed from src/emu/bus/isa/ide.c)0
-rw-r--r--src/devices/bus/isa/ide.h (renamed from src/emu/bus/isa/ide.h)0
-rw-r--r--src/devices/bus/isa/isa.c (renamed from src/emu/bus/isa/isa.c)0
-rw-r--r--src/devices/bus/isa/isa.h (renamed from src/emu/bus/isa/isa.h)0
-rw-r--r--src/devices/bus/isa/isa_cards.c (renamed from src/emu/bus/isa/isa_cards.c)2
-rw-r--r--src/devices/bus/isa/isa_cards.h (renamed from src/emu/bus/isa/isa_cards.h)1
-rw-r--r--src/devices/bus/isa/lpt.c (renamed from src/emu/bus/isa/lpt.c)0
-rw-r--r--src/devices/bus/isa/lpt.h (renamed from src/emu/bus/isa/lpt.h)0
-rw-r--r--src/devices/bus/isa/mach32.c (renamed from src/emu/bus/isa/mach32.c)0
-rw-r--r--src/devices/bus/isa/mach32.h (renamed from src/emu/bus/isa/mach32.h)0
-rw-r--r--src/devices/bus/isa/mc1502_fdc.c (renamed from src/emu/bus/isa/mc1502_fdc.c)0
-rw-r--r--src/devices/bus/isa/mc1502_fdc.h (renamed from src/emu/bus/isa/mc1502_fdc.h)0
-rw-r--r--src/devices/bus/isa/mc1502_rom.c (renamed from src/emu/bus/isa/mc1502_rom.c)0
-rw-r--r--src/devices/bus/isa/mc1502_rom.h (renamed from src/emu/bus/isa/mc1502_rom.h)0
-rw-r--r--src/devices/bus/isa/mda.c (renamed from src/emu/bus/isa/mda.c)0
-rw-r--r--src/devices/bus/isa/mda.h (renamed from src/emu/bus/isa/mda.h)0
-rw-r--r--src/devices/bus/isa/mpu401.c (renamed from src/emu/bus/isa/mpu401.c)0
-rw-r--r--src/devices/bus/isa/mpu401.h (renamed from src/emu/bus/isa/mpu401.h)0
-rw-r--r--src/devices/bus/isa/mufdc.c (renamed from src/emu/bus/isa/mufdc.c)0
-rw-r--r--src/devices/bus/isa/mufdc.h (renamed from src/emu/bus/isa/mufdc.h)0
-rw-r--r--src/devices/bus/isa/ne1000.c (renamed from src/emu/bus/isa/ne1000.c)0
-rw-r--r--src/devices/bus/isa/ne1000.h (renamed from src/emu/bus/isa/ne1000.h)0
-rw-r--r--src/devices/bus/isa/ne2000.c (renamed from src/emu/bus/isa/ne2000.c)0
-rw-r--r--src/devices/bus/isa/ne2000.h (renamed from src/emu/bus/isa/ne2000.h)0
-rw-r--r--src/devices/bus/isa/num9rev.c (renamed from src/emu/bus/isa/num9rev.c)0
-rw-r--r--src/devices/bus/isa/num9rev.h (renamed from src/emu/bus/isa/num9rev.h)0
-rw-r--r--src/devices/bus/isa/omti8621.c (renamed from src/emu/bus/isa/omti8621.c)0
-rw-r--r--src/devices/bus/isa/omti8621.h (renamed from src/emu/bus/isa/omti8621.h)0
-rw-r--r--src/devices/bus/isa/p1_fdc.c (renamed from src/emu/bus/isa/p1_fdc.c)0
-rw-r--r--src/devices/bus/isa/p1_fdc.h (renamed from src/emu/bus/isa/p1_fdc.h)0
-rw-r--r--src/devices/bus/isa/p1_hdc.c (renamed from src/emu/bus/isa/p1_hdc.c)0
-rw-r--r--src/devices/bus/isa/p1_hdc.h (renamed from src/emu/bus/isa/p1_hdc.h)0
-rw-r--r--src/devices/bus/isa/p1_rom.c (renamed from src/emu/bus/isa/p1_rom.c)0
-rw-r--r--src/devices/bus/isa/p1_rom.h (renamed from src/emu/bus/isa/p1_rom.h)0
-rw-r--r--src/devices/bus/isa/pc1640_iga.c (renamed from src/emu/bus/isa/pc1640_iga.c)0
-rw-r--r--src/devices/bus/isa/pc1640_iga.h (renamed from src/emu/bus/isa/pc1640_iga.h)0
-rw-r--r--src/devices/bus/isa/pds.c (renamed from src/emu/bus/isa/pds.c)0
-rw-r--r--src/devices/bus/isa/pds.h (renamed from src/emu/bus/isa/pds.h)0
-rw-r--r--src/devices/bus/isa/pgc.c365
-rw-r--r--src/devices/bus/isa/pgc.h69
-rw-r--r--src/devices/bus/isa/s3virge.c (renamed from src/emu/bus/isa/s3virge.c)0
-rw-r--r--src/devices/bus/isa/s3virge.h (renamed from src/emu/bus/isa/s3virge.h)0
-rw-r--r--src/devices/bus/isa/sb16.c (renamed from src/emu/bus/isa/sb16.c)0
-rw-r--r--src/devices/bus/isa/sb16.h (renamed from src/emu/bus/isa/sb16.h)0
-rw-r--r--src/devices/bus/isa/sblaster.c (renamed from src/emu/bus/isa/sblaster.c)4
-rw-r--r--src/devices/bus/isa/sblaster.h (renamed from src/emu/bus/isa/sblaster.h)0
-rw-r--r--src/devices/bus/isa/sc499.c (renamed from src/emu/bus/isa/sc499.c)0
-rw-r--r--src/devices/bus/isa/sc499.h (renamed from src/emu/bus/isa/sc499.h)0
-rw-r--r--src/devices/bus/isa/side116.c (renamed from src/emu/bus/isa/side116.c)0
-rw-r--r--src/devices/bus/isa/side116.h (renamed from src/emu/bus/isa/side116.h)0
-rw-r--r--src/devices/bus/isa/ssi2001.c (renamed from src/emu/bus/isa/ssi2001.c)0
-rw-r--r--src/devices/bus/isa/ssi2001.h (renamed from src/emu/bus/isa/ssi2001.h)0
-rw-r--r--src/devices/bus/isa/stereo_fx.c (renamed from src/emu/bus/isa/stereo_fx.c)0
-rw-r--r--src/devices/bus/isa/stereo_fx.h (renamed from src/emu/bus/isa/stereo_fx.h)0
-rw-r--r--src/devices/bus/isa/svga_cirrus.c (renamed from src/emu/bus/isa/svga_cirrus.c)0
-rw-r--r--src/devices/bus/isa/svga_cirrus.h (renamed from src/emu/bus/isa/svga_cirrus.h)0
-rw-r--r--src/devices/bus/isa/svga_s3.c (renamed from src/emu/bus/isa/svga_s3.c)0
-rw-r--r--src/devices/bus/isa/svga_s3.h (renamed from src/emu/bus/isa/svga_s3.h)0
-rw-r--r--src/devices/bus/isa/svga_trident.c (renamed from src/emu/bus/isa/svga_trident.c)0
-rw-r--r--src/devices/bus/isa/svga_trident.h (renamed from src/emu/bus/isa/svga_trident.h)0
-rw-r--r--src/devices/bus/isa/svga_tseng.c (renamed from src/emu/bus/isa/svga_tseng.c)0
-rw-r--r--src/devices/bus/isa/svga_tseng.h (renamed from src/emu/bus/isa/svga_tseng.h)0
-rw-r--r--src/devices/bus/isa/trident.c (renamed from src/emu/bus/isa/trident.c)0
-rw-r--r--src/devices/bus/isa/trident.h (renamed from src/emu/bus/isa/trident.h)0
-rw-r--r--src/devices/bus/isa/vga.c (renamed from src/emu/bus/isa/vga.c)0
-rw-r--r--src/devices/bus/isa/vga.h (renamed from src/emu/bus/isa/vga.h)0
-rw-r--r--src/devices/bus/isa/vga_ati.c (renamed from src/emu/bus/isa/vga_ati.c)0
-rw-r--r--src/devices/bus/isa/vga_ati.h (renamed from src/emu/bus/isa/vga_ati.h)0
-rw-r--r--src/devices/bus/isa/wd1002a_wx1.c (renamed from src/emu/bus/isa/wd1002a_wx1.c)0
-rw-r--r--src/devices/bus/isa/wd1002a_wx1.h (renamed from src/emu/bus/isa/wd1002a_wx1.h)0
-rw-r--r--src/devices/bus/isa/wdxt_gen.c (renamed from src/emu/bus/isa/wdxt_gen.c)0
-rw-r--r--src/devices/bus/isa/wdxt_gen.h (renamed from src/emu/bus/isa/wdxt_gen.h)0
-rw-r--r--src/devices/bus/isa/xsu_cards.c (renamed from src/emu/bus/isa/xsu_cards.c)0
-rw-r--r--src/devices/bus/isa/xsu_cards.h (renamed from src/emu/bus/isa/xsu_cards.h)0
-rw-r--r--src/devices/bus/isa/xtide.c (renamed from src/emu/bus/isa/xtide.c)0
-rw-r--r--src/devices/bus/isa/xtide.h (renamed from src/emu/bus/isa/xtide.h)0
-rw-r--r--src/devices/bus/isbx/compis_fdc.c (renamed from src/emu/bus/isbx/compis_fdc.c)0
-rw-r--r--src/devices/bus/isbx/compis_fdc.h (renamed from src/emu/bus/isbx/compis_fdc.h)0
-rw-r--r--src/devices/bus/isbx/isbc_218a.c (renamed from src/emu/bus/isbx/isbc_218a.c)0
-rw-r--r--src/devices/bus/isbx/isbc_218a.h (renamed from src/emu/bus/isbx/isbc_218a.h)0
-rw-r--r--src/devices/bus/isbx/isbx.c (renamed from src/emu/bus/isbx/isbx.c)0
-rw-r--r--src/devices/bus/isbx/isbx.h (renamed from src/emu/bus/isbx/isbx.h)0
-rw-r--r--src/devices/bus/kc/d002.c (renamed from src/emu/bus/kc/d002.c)0
-rw-r--r--src/devices/bus/kc/d002.h (renamed from src/emu/bus/kc/d002.h)0
-rw-r--r--src/devices/bus/kc/d004.c (renamed from src/emu/bus/kc/d004.c)0
-rw-r--r--src/devices/bus/kc/d004.h (renamed from src/emu/bus/kc/d004.h)0
-rw-r--r--src/devices/bus/kc/kc.c (renamed from src/emu/bus/kc/kc.c)0
-rw-r--r--src/devices/bus/kc/kc.h (renamed from src/emu/bus/kc/kc.h)0
-rw-r--r--src/devices/bus/kc/ram.c (renamed from src/emu/bus/kc/ram.c)0
-rw-r--r--src/devices/bus/kc/ram.h (renamed from src/emu/bus/kc/ram.h)0
-rw-r--r--src/devices/bus/kc/rom.c (renamed from src/emu/bus/kc/rom.c)0
-rw-r--r--src/devices/bus/kc/rom.h (renamed from src/emu/bus/kc/rom.h)0
-rw-r--r--src/devices/bus/lpci/cirrus.c (renamed from src/emu/bus/lpci/cirrus.c)0
-rw-r--r--src/devices/bus/lpci/cirrus.h (renamed from src/emu/bus/lpci/cirrus.h)0
-rw-r--r--src/devices/bus/lpci/i82371ab.c (renamed from src/emu/bus/lpci/i82371ab.c)0
-rw-r--r--src/devices/bus/lpci/i82371ab.h (renamed from src/emu/bus/lpci/i82371ab.h)0
-rw-r--r--src/devices/bus/lpci/i82371sb.c (renamed from src/emu/bus/lpci/i82371sb.c)0
-rw-r--r--src/devices/bus/lpci/i82371sb.h (renamed from src/emu/bus/lpci/i82371sb.h)0
-rw-r--r--src/devices/bus/lpci/i82439tx.c (renamed from src/emu/bus/lpci/i82439tx.c)0
-rw-r--r--src/devices/bus/lpci/i82439tx.h (renamed from src/emu/bus/lpci/i82439tx.h)0
-rw-r--r--src/devices/bus/lpci/mpc105.c (renamed from src/emu/bus/lpci/mpc105.c)0
-rw-r--r--src/devices/bus/lpci/mpc105.h (renamed from src/emu/bus/lpci/mpc105.h)0
-rw-r--r--src/devices/bus/lpci/northbridge.c (renamed from src/emu/bus/lpci/northbridge.c)0
-rw-r--r--src/devices/bus/lpci/northbridge.h (renamed from src/emu/bus/lpci/northbridge.h)0
-rw-r--r--src/devices/bus/lpci/pci.c (renamed from src/emu/bus/lpci/pci.c)0
-rw-r--r--src/devices/bus/lpci/pci.h (renamed from src/emu/bus/lpci/pci.h)0
-rw-r--r--src/devices/bus/lpci/southbridge.c (renamed from src/emu/bus/lpci/southbridge.c)0
-rw-r--r--src/devices/bus/lpci/southbridge.h (renamed from src/emu/bus/lpci/southbridge.h)0
-rw-r--r--src/devices/bus/lpci/vt82c505.c96
-rw-r--r--src/devices/bus/lpci/vt82c505.h38
-rw-r--r--src/devices/bus/macpds/macpds.c (renamed from src/emu/bus/macpds/macpds.c)0
-rw-r--r--src/devices/bus/macpds/macpds.h (renamed from src/emu/bus/macpds/macpds.h)0
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.c (renamed from src/emu/bus/macpds/pds_tpdfpd.c)0
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.h (renamed from src/emu/bus/macpds/pds_tpdfpd.h)0
-rw-r--r--src/devices/bus/megadrive/eeprom.c (renamed from src/emu/bus/megadrive/eeprom.c)0
-rw-r--r--src/devices/bus/megadrive/eeprom.h (renamed from src/emu/bus/megadrive/eeprom.h)0
-rw-r--r--src/devices/bus/megadrive/ggenie.c (renamed from src/emu/bus/megadrive/ggenie.c)0
-rw-r--r--src/devices/bus/megadrive/ggenie.h (renamed from src/emu/bus/megadrive/ggenie.h)0
-rw-r--r--src/devices/bus/megadrive/jcart.c (renamed from src/emu/bus/megadrive/jcart.c)0
-rw-r--r--src/devices/bus/megadrive/jcart.h (renamed from src/emu/bus/megadrive/jcart.h)0
-rw-r--r--src/devices/bus/megadrive/md_carts.c (renamed from src/emu/bus/megadrive/md_carts.c)0
-rw-r--r--src/devices/bus/megadrive/md_carts.h (renamed from src/emu/bus/megadrive/md_carts.h)0
-rw-r--r--src/devices/bus/megadrive/md_slot.c (renamed from src/emu/bus/megadrive/md_slot.c)0
-rw-r--r--src/devices/bus/megadrive/md_slot.h (renamed from src/emu/bus/megadrive/md_slot.h)0
-rw-r--r--src/devices/bus/megadrive/rom.c (renamed from src/emu/bus/megadrive/rom.c)0
-rw-r--r--src/devices/bus/megadrive/rom.h (renamed from src/emu/bus/megadrive/rom.h)0
-rw-r--r--src/devices/bus/megadrive/sk.c (renamed from src/emu/bus/megadrive/sk.c)0
-rw-r--r--src/devices/bus/megadrive/sk.h (renamed from src/emu/bus/megadrive/sk.h)0
-rw-r--r--src/devices/bus/megadrive/stm95.c (renamed from src/emu/bus/megadrive/stm95.c)0
-rw-r--r--src/devices/bus/megadrive/stm95.h (renamed from src/emu/bus/megadrive/stm95.h)0
-rw-r--r--src/devices/bus/megadrive/svp.c (renamed from src/emu/bus/megadrive/svp.c)0
-rw-r--r--src/devices/bus/megadrive/svp.h (renamed from src/emu/bus/megadrive/svp.h)0
-rw-r--r--src/devices/bus/midi/midi.c (renamed from src/emu/bus/midi/midi.c)0
-rw-r--r--src/devices/bus/midi/midi.h (renamed from src/emu/bus/midi/midi.h)0
-rw-r--r--src/devices/bus/midi/midiinport.c (renamed from src/emu/bus/midi/midiinport.c)0
-rw-r--r--src/devices/bus/midi/midiinport.h (renamed from src/emu/bus/midi/midiinport.h)0
-rw-r--r--src/devices/bus/midi/midioutport.c (renamed from src/emu/bus/midi/midioutport.c)0
-rw-r--r--src/devices/bus/midi/midioutport.h (renamed from src/emu/bus/midi/midioutport.h)0
-rw-r--r--src/devices/bus/msx_cart/arc.c (renamed from src/emu/bus/msx_cart/arc.c)0
-rw-r--r--src/devices/bus/msx_cart/arc.h (renamed from src/emu/bus/msx_cart/arc.h)0
-rw-r--r--src/devices/bus/msx_cart/ascii.c (renamed from src/emu/bus/msx_cart/ascii.c)92
-rw-r--r--src/devices/bus/msx_cart/ascii.h (renamed from src/emu/bus/msx_cart/ascii.h)24
-rw-r--r--src/devices/bus/msx_cart/bm_012.c (renamed from src/emu/bus/msx_cart/bm_012.c)0
-rw-r--r--src/devices/bus/msx_cart/bm_012.h (renamed from src/emu/bus/msx_cart/bm_012.h)0
-rw-r--r--src/devices/bus/msx_cart/cartridge.c (renamed from src/emu/bus/msx_cart/cartridge.c)3
-rw-r--r--src/devices/bus/msx_cart/cartridge.h (renamed from src/emu/bus/msx_cart/cartridge.h)0
-rw-r--r--src/devices/bus/msx_cart/crossblaim.c (renamed from src/emu/bus/msx_cart/crossblaim.c)0
-rw-r--r--src/devices/bus/msx_cart/crossblaim.h (renamed from src/emu/bus/msx_cart/crossblaim.h)0
-rw-r--r--src/devices/bus/msx_cart/disk.c (renamed from src/emu/bus/msx_cart/disk.c)0
-rw-r--r--src/devices/bus/msx_cart/disk.h (renamed from src/emu/bus/msx_cart/disk.h)0
-rw-r--r--src/devices/bus/msx_cart/dooly.c (renamed from src/emu/bus/msx_cart/dooly.c)0
-rw-r--r--src/devices/bus/msx_cart/dooly.h (renamed from src/emu/bus/msx_cart/dooly.h)0
-rw-r--r--src/devices/bus/msx_cart/fmpac.c (renamed from src/emu/bus/msx_cart/fmpac.c)0
-rw-r--r--src/devices/bus/msx_cart/fmpac.h (renamed from src/emu/bus/msx_cart/fmpac.h)0
-rw-r--r--src/devices/bus/msx_cart/fs_sr022.c71
-rw-r--r--src/devices/bus/msx_cart/fs_sr022.h33
-rw-r--r--src/devices/bus/msx_cart/halnote.c (renamed from src/emu/bus/msx_cart/halnote.c)0
-rw-r--r--src/devices/bus/msx_cart/halnote.h (renamed from src/emu/bus/msx_cart/halnote.h)0
-rw-r--r--src/devices/bus/msx_cart/hfox.c (renamed from src/emu/bus/msx_cart/hfox.c)0
-rw-r--r--src/devices/bus/msx_cart/hfox.h (renamed from src/emu/bus/msx_cart/hfox.h)0
-rw-r--r--src/devices/bus/msx_cart/holy_quran.c (renamed from src/emu/bus/msx_cart/holy_quran.c)0
-rw-r--r--src/devices/bus/msx_cart/holy_quran.h (renamed from src/emu/bus/msx_cart/holy_quran.h)0
-rw-r--r--src/devices/bus/msx_cart/konami.c (renamed from src/emu/bus/msx_cart/konami.c)2
-rw-r--r--src/devices/bus/msx_cart/konami.h (renamed from src/emu/bus/msx_cart/konami.h)0
-rw-r--r--src/devices/bus/msx_cart/korean.c (renamed from src/emu/bus/msx_cart/korean.c)0
-rw-r--r--src/devices/bus/msx_cart/korean.h (renamed from src/emu/bus/msx_cart/korean.h)0
-rw-r--r--src/devices/bus/msx_cart/majutsushi.c (renamed from src/emu/bus/msx_cart/majutsushi.c)0
-rw-r--r--src/devices/bus/msx_cart/majutsushi.h (renamed from src/emu/bus/msx_cart/majutsushi.h)0
-rw-r--r--src/devices/bus/msx_cart/moonsound.c (renamed from src/emu/bus/msx_cart/moonsound.c)8
-rw-r--r--src/devices/bus/msx_cart/moonsound.h (renamed from src/emu/bus/msx_cart/moonsound.h)1
-rw-r--r--src/devices/bus/msx_cart/msx_audio.c (renamed from src/emu/bus/msx_cart/msx_audio.c)0
-rw-r--r--src/devices/bus/msx_cart/msx_audio.h (renamed from src/emu/bus/msx_cart/msx_audio.h)0
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.c (renamed from src/emu/bus/msx_cart/msx_audio_kb.c)0
-rw-r--r--src/devices/bus/msx_cart/msx_audio_kb.h (renamed from src/emu/bus/msx_cart/msx_audio_kb.h)0
-rw-r--r--src/devices/bus/msx_cart/msxdos2.c (renamed from src/emu/bus/msx_cart/msxdos2.c)0
-rw-r--r--src/devices/bus/msx_cart/msxdos2.h (renamed from src/emu/bus/msx_cart/msxdos2.h)0
-rw-r--r--src/devices/bus/msx_cart/nomapper.c (renamed from src/emu/bus/msx_cart/nomapper.c)0
-rw-r--r--src/devices/bus/msx_cart/nomapper.h (renamed from src/emu/bus/msx_cart/nomapper.h)0
-rw-r--r--src/devices/bus/msx_cart/rtype.c (renamed from src/emu/bus/msx_cart/rtype.c)0
-rw-r--r--src/devices/bus/msx_cart/rtype.h (renamed from src/emu/bus/msx_cart/rtype.h)0
-rw-r--r--src/devices/bus/msx_cart/super_swangi.c (renamed from src/emu/bus/msx_cart/super_swangi.c)0
-rw-r--r--src/devices/bus/msx_cart/super_swangi.h (renamed from src/emu/bus/msx_cart/super_swangi.h)0
-rw-r--r--src/devices/bus/msx_cart/superloderunner.c (renamed from src/emu/bus/msx_cart/superloderunner.c)0
-rw-r--r--src/devices/bus/msx_cart/superloderunner.h (renamed from src/emu/bus/msx_cart/superloderunner.h)0
-rw-r--r--src/devices/bus/msx_cart/yamaha.c (renamed from src/emu/bus/msx_cart/yamaha.c)0
-rw-r--r--src/devices/bus/msx_cart/yamaha.h (renamed from src/emu/bus/msx_cart/yamaha.h)0
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.c (renamed from src/emu/bus/msx_slot/bunsetsu.c)0
-rw-r--r--src/devices/bus/msx_slot/bunsetsu.h (renamed from src/emu/bus/msx_slot/bunsetsu.h)0
-rw-r--r--src/devices/bus/msx_slot/cartridge.c (renamed from src/emu/bus/msx_slot/cartridge.c)0
-rw-r--r--src/devices/bus/msx_slot/cartridge.h (renamed from src/emu/bus/msx_slot/cartridge.h)0
-rw-r--r--src/devices/bus/msx_slot/disk.c (renamed from src/emu/bus/msx_slot/disk.c)0
-rw-r--r--src/devices/bus/msx_slot/disk.h (renamed from src/emu/bus/msx_slot/disk.h)0
-rw-r--r--src/devices/bus/msx_slot/fs4600.c (renamed from src/emu/bus/msx_slot/fs4600.c)0
-rw-r--r--src/devices/bus/msx_slot/fs4600.h (renamed from src/emu/bus/msx_slot/fs4600.h)0
-rw-r--r--src/devices/bus/msx_slot/music.c (renamed from src/emu/bus/msx_slot/music.c)0
-rw-r--r--src/devices/bus/msx_slot/music.h (renamed from src/emu/bus/msx_slot/music.h)0
-rw-r--r--src/devices/bus/msx_slot/panasonic08.c (renamed from src/emu/bus/msx_slot/panasonic08.c)0
-rw-r--r--src/devices/bus/msx_slot/panasonic08.h (renamed from src/emu/bus/msx_slot/panasonic08.h)0
-rw-r--r--src/devices/bus/msx_slot/ram.c (renamed from src/emu/bus/msx_slot/ram.c)0
-rw-r--r--src/devices/bus/msx_slot/ram.h (renamed from src/emu/bus/msx_slot/ram.h)0
-rw-r--r--src/devices/bus/msx_slot/ram_mm.c (renamed from src/emu/bus/msx_slot/ram_mm.c)0
-rw-r--r--src/devices/bus/msx_slot/ram_mm.h (renamed from src/emu/bus/msx_slot/ram_mm.h)0
-rw-r--r--src/devices/bus/msx_slot/rom.c (renamed from src/emu/bus/msx_slot/rom.c)0
-rw-r--r--src/devices/bus/msx_slot/rom.h (renamed from src/emu/bus/msx_slot/rom.h)0
-rw-r--r--src/devices/bus/msx_slot/slot.c (renamed from src/emu/bus/msx_slot/slot.c)0
-rw-r--r--src/devices/bus/msx_slot/slot.h (renamed from src/emu/bus/msx_slot/slot.h)0
-rw-r--r--src/devices/bus/msx_slot/sony08.c (renamed from src/emu/bus/msx_slot/sony08.c)0
-rw-r--r--src/devices/bus/msx_slot/sony08.h (renamed from src/emu/bus/msx_slot/sony08.h)0
-rw-r--r--src/devices/bus/nasbus/avc.c (renamed from src/emu/bus/nasbus/avc.c)17
-rw-r--r--src/devices/bus/nasbus/avc.h (renamed from src/emu/bus/nasbus/avc.h)3
-rw-r--r--src/devices/bus/nasbus/cards.c (renamed from src/emu/bus/nasbus/cards.c)0
-rw-r--r--src/devices/bus/nasbus/cards.h (renamed from src/emu/bus/nasbus/cards.h)0
-rw-r--r--src/devices/bus/nasbus/floppy.c (renamed from src/emu/bus/nasbus/floppy.c)0
-rw-r--r--src/devices/bus/nasbus/floppy.h (renamed from src/emu/bus/nasbus/floppy.h)0
-rw-r--r--src/devices/bus/nasbus/nasbus.c (renamed from src/emu/bus/nasbus/nasbus.c)0
-rw-r--r--src/devices/bus/nasbus/nasbus.h (renamed from src/emu/bus/nasbus/nasbus.h)0
-rw-r--r--src/devices/bus/neogeo/banked_cart.c (renamed from src/emu/bus/neogeo/banked_cart.c)0
-rw-r--r--src/devices/bus/neogeo/banked_cart.h (renamed from src/emu/bus/neogeo/banked_cart.h)0
-rw-r--r--src/devices/bus/neogeo/bootleg_cart.c (renamed from src/emu/bus/neogeo/bootleg_cart.c)0
-rw-r--r--src/devices/bus/neogeo/bootleg_cart.h (renamed from src/emu/bus/neogeo/bootleg_cart.h)0
-rw-r--r--src/devices/bus/neogeo/bootleg_hybrid_cart.c (renamed from src/emu/bus/neogeo/bootleg_hybrid_cart.c)0
-rw-r--r--src/devices/bus/neogeo/bootleg_hybrid_cart.h (renamed from src/emu/bus/neogeo/bootleg_hybrid_cart.h)0
-rw-r--r--src/devices/bus/neogeo/bootleg_prot.c (renamed from src/emu/bus/neogeo/bootleg_prot.c)0
-rw-r--r--src/devices/bus/neogeo/bootleg_prot.h (renamed from src/emu/bus/neogeo/bootleg_prot.h)0
-rw-r--r--src/devices/bus/neogeo/cmc_cart.c (renamed from src/emu/bus/neogeo/cmc_cart.c)0
-rw-r--r--src/devices/bus/neogeo/cmc_cart.h (renamed from src/emu/bus/neogeo/cmc_cart.h)0
-rw-r--r--src/devices/bus/neogeo/cmc_prot.c (renamed from src/emu/bus/neogeo/cmc_prot.c)0
-rw-r--r--src/devices/bus/neogeo/cmc_prot.h (renamed from src/emu/bus/neogeo/cmc_prot.h)0
-rw-r--r--src/devices/bus/neogeo/fatfury2_cart.c (renamed from src/emu/bus/neogeo/fatfury2_cart.c)0
-rw-r--r--src/devices/bus/neogeo/fatfury2_cart.h (renamed from src/emu/bus/neogeo/fatfury2_cart.h)0
-rw-r--r--src/devices/bus/neogeo/fatfury2_prot.c (renamed from src/emu/bus/neogeo/fatfury2_prot.c)0
-rw-r--r--src/devices/bus/neogeo/fatfury2_prot.h (renamed from src/emu/bus/neogeo/fatfury2_prot.h)0
-rw-r--r--src/devices/bus/neogeo/kof2002_cart.c (renamed from src/emu/bus/neogeo/kof2002_cart.c)0
-rw-r--r--src/devices/bus/neogeo/kof2002_cart.h (renamed from src/emu/bus/neogeo/kof2002_cart.h)0
-rw-r--r--src/devices/bus/neogeo/kof2002_prot.c (renamed from src/emu/bus/neogeo/kof2002_prot.c)0
-rw-r--r--src/devices/bus/neogeo/kof2002_prot.h (renamed from src/emu/bus/neogeo/kof2002_prot.h)0
-rw-r--r--src/devices/bus/neogeo/kof98_cart.c (renamed from src/emu/bus/neogeo/kof98_cart.c)0
-rw-r--r--src/devices/bus/neogeo/kof98_cart.h (renamed from src/emu/bus/neogeo/kof98_cart.h)0
-rw-r--r--src/devices/bus/neogeo/kof98_prot.c (renamed from src/emu/bus/neogeo/kof98_prot.c)0
-rw-r--r--src/devices/bus/neogeo/kof98_prot.h (renamed from src/emu/bus/neogeo/kof98_prot.h)0
-rw-r--r--src/devices/bus/neogeo/kog_prot.c (renamed from src/emu/bus/neogeo/kog_prot.c)0
-rw-r--r--src/devices/bus/neogeo/kog_prot.h (renamed from src/emu/bus/neogeo/kog_prot.h)0
-rw-r--r--src/devices/bus/neogeo/mslugx_cart.c (renamed from src/emu/bus/neogeo/mslugx_cart.c)0
-rw-r--r--src/devices/bus/neogeo/mslugx_cart.h (renamed from src/emu/bus/neogeo/mslugx_cart.h)0
-rw-r--r--src/devices/bus/neogeo/mslugx_prot.c (renamed from src/emu/bus/neogeo/mslugx_prot.c)0
-rw-r--r--src/devices/bus/neogeo/mslugx_prot.h (renamed from src/emu/bus/neogeo/mslugx_prot.h)0
-rw-r--r--src/devices/bus/neogeo/neogeo_carts.c (renamed from src/emu/bus/neogeo/neogeo_carts.c)0
-rw-r--r--src/devices/bus/neogeo/neogeo_carts.h (renamed from src/emu/bus/neogeo/neogeo_carts.h)0
-rw-r--r--src/devices/bus/neogeo/neogeo_helper.c (renamed from src/emu/bus/neogeo/neogeo_helper.c)0
-rw-r--r--src/devices/bus/neogeo/neogeo_helper.h (renamed from src/emu/bus/neogeo/neogeo_helper.h)0
-rw-r--r--src/devices/bus/neogeo/neogeo_intf.c (renamed from src/emu/bus/neogeo/neogeo_intf.c)0
-rw-r--r--src/devices/bus/neogeo/neogeo_intf.h (renamed from src/emu/bus/neogeo/neogeo_intf.h)0
-rw-r--r--src/devices/bus/neogeo/neogeo_slot.c (renamed from src/emu/bus/neogeo/neogeo_slot.c)0
-rw-r--r--src/devices/bus/neogeo/neogeo_slot.h (renamed from src/emu/bus/neogeo/neogeo_slot.h)0
-rw-r--r--src/devices/bus/neogeo/pcm2_cart.c (renamed from src/emu/bus/neogeo/pcm2_cart.c)0
-rw-r--r--src/devices/bus/neogeo/pcm2_cart.h (renamed from src/emu/bus/neogeo/pcm2_cart.h)0
-rw-r--r--src/devices/bus/neogeo/pcm2_prot.c (renamed from src/emu/bus/neogeo/pcm2_prot.c)0
-rw-r--r--src/devices/bus/neogeo/pcm2_prot.h (renamed from src/emu/bus/neogeo/pcm2_prot.h)0
-rw-r--r--src/devices/bus/neogeo/pvc_cart.c (renamed from src/emu/bus/neogeo/pvc_cart.c)0
-rw-r--r--src/devices/bus/neogeo/pvc_cart.h (renamed from src/emu/bus/neogeo/pvc_cart.h)0
-rw-r--r--src/devices/bus/neogeo/pvc_prot.c (renamed from src/emu/bus/neogeo/pvc_prot.c)0
-rw-r--r--src/devices/bus/neogeo/pvc_prot.h (renamed from src/emu/bus/neogeo/pvc_prot.h)0
-rw-r--r--src/devices/bus/neogeo/rom.c (renamed from src/emu/bus/neogeo/rom.c)0
-rw-r--r--src/devices/bus/neogeo/rom.h (renamed from src/emu/bus/neogeo/rom.h)0
-rw-r--r--src/devices/bus/neogeo/sbp_prot.c (renamed from src/emu/bus/neogeo/sbp_prot.c)0
-rw-r--r--src/devices/bus/neogeo/sbp_prot.h (renamed from src/emu/bus/neogeo/sbp_prot.h)0
-rw-r--r--src/devices/bus/neogeo/sma_cart.c (renamed from src/emu/bus/neogeo/sma_cart.c)0
-rw-r--r--src/devices/bus/neogeo/sma_cart.h (renamed from src/emu/bus/neogeo/sma_cart.h)0
-rw-r--r--src/devices/bus/neogeo/sma_prot.c (renamed from src/emu/bus/neogeo/sma_prot.c)0
-rw-r--r--src/devices/bus/neogeo/sma_prot.h (renamed from src/emu/bus/neogeo/sma_prot.h)0
-rw-r--r--src/devices/bus/nes/2a03pur.c (renamed from src/emu/bus/nes/2a03pur.c)0
-rw-r--r--src/devices/bus/nes/2a03pur.h (renamed from src/emu/bus/nes/2a03pur.h)0
-rw-r--r--src/devices/bus/nes/act53.c (renamed from src/emu/bus/nes/act53.c)0
-rw-r--r--src/devices/bus/nes/act53.h (renamed from src/emu/bus/nes/act53.h)0
-rw-r--r--src/devices/bus/nes/aladdin.c (renamed from src/emu/bus/nes/aladdin.c)0
-rw-r--r--src/devices/bus/nes/aladdin.h (renamed from src/emu/bus/nes/aladdin.h)0
-rw-r--r--src/devices/bus/nes/ave.c (renamed from src/emu/bus/nes/ave.c)0
-rw-r--r--src/devices/bus/nes/ave.h (renamed from src/emu/bus/nes/ave.h)0
-rw-r--r--src/devices/bus/nes/bandai.c (renamed from src/emu/bus/nes/bandai.c)0
-rw-r--r--src/devices/bus/nes/bandai.h (renamed from src/emu/bus/nes/bandai.h)0
-rw-r--r--src/devices/bus/nes/benshieng.c (renamed from src/emu/bus/nes/benshieng.c)0
-rw-r--r--src/devices/bus/nes/benshieng.h (renamed from src/emu/bus/nes/benshieng.h)0
-rw-r--r--src/devices/bus/nes/bootleg.c (renamed from src/emu/bus/nes/bootleg.c)0
-rw-r--r--src/devices/bus/nes/bootleg.h (renamed from src/emu/bus/nes/bootleg.h)0
-rw-r--r--src/devices/bus/nes/camerica.c (renamed from src/emu/bus/nes/camerica.c)0
-rw-r--r--src/devices/bus/nes/camerica.h (renamed from src/emu/bus/nes/camerica.h)0
-rw-r--r--src/devices/bus/nes/cne.c (renamed from src/emu/bus/nes/cne.c)0
-rw-r--r--src/devices/bus/nes/cne.h (renamed from src/emu/bus/nes/cne.h)0
-rw-r--r--src/devices/bus/nes/cony.c (renamed from src/emu/bus/nes/cony.c)0
-rw-r--r--src/devices/bus/nes/cony.h (renamed from src/emu/bus/nes/cony.h)0
-rw-r--r--src/devices/bus/nes/datach.c (renamed from src/emu/bus/nes/datach.c)0
-rw-r--r--src/devices/bus/nes/datach.h (renamed from src/emu/bus/nes/datach.h)0
-rw-r--r--src/devices/bus/nes/discrete.c (renamed from src/emu/bus/nes/discrete.c)0
-rw-r--r--src/devices/bus/nes/discrete.h (renamed from src/emu/bus/nes/discrete.h)0
-rw-r--r--src/devices/bus/nes/disksys.c (renamed from src/emu/bus/nes/disksys.c)0
-rw-r--r--src/devices/bus/nes/disksys.h (renamed from src/emu/bus/nes/disksys.h)0
-rw-r--r--src/devices/bus/nes/event.c (renamed from src/emu/bus/nes/event.c)0
-rw-r--r--src/devices/bus/nes/event.h (renamed from src/emu/bus/nes/event.h)0
-rw-r--r--src/devices/bus/nes/ggenie.c (renamed from src/emu/bus/nes/ggenie.c)0
-rw-r--r--src/devices/bus/nes/ggenie.h (renamed from src/emu/bus/nes/ggenie.h)0
-rw-r--r--src/devices/bus/nes/henggedianzi.c (renamed from src/emu/bus/nes/henggedianzi.c)0
-rw-r--r--src/devices/bus/nes/henggedianzi.h (renamed from src/emu/bus/nes/henggedianzi.h)0
-rw-r--r--src/devices/bus/nes/hes.c (renamed from src/emu/bus/nes/hes.c)0
-rw-r--r--src/devices/bus/nes/hes.h (renamed from src/emu/bus/nes/hes.h)0
-rw-r--r--src/devices/bus/nes/hosenkan.c (renamed from src/emu/bus/nes/hosenkan.c)0
-rw-r--r--src/devices/bus/nes/hosenkan.h (renamed from src/emu/bus/nes/hosenkan.h)0
-rw-r--r--src/devices/bus/nes/irem.c (renamed from src/emu/bus/nes/irem.c)0
-rw-r--r--src/devices/bus/nes/irem.h (renamed from src/emu/bus/nes/irem.h)0
-rw-r--r--src/devices/bus/nes/jaleco.c (renamed from src/emu/bus/nes/jaleco.c)0
-rw-r--r--src/devices/bus/nes/jaleco.h (renamed from src/emu/bus/nes/jaleco.h)0
-rw-r--r--src/devices/bus/nes/jy.c (renamed from src/emu/bus/nes/jy.c)0
-rw-r--r--src/devices/bus/nes/jy.h (renamed from src/emu/bus/nes/jy.h)0
-rw-r--r--src/devices/bus/nes/kaiser.c (renamed from src/emu/bus/nes/kaiser.c)0
-rw-r--r--src/devices/bus/nes/kaiser.h (renamed from src/emu/bus/nes/kaiser.h)0
-rw-r--r--src/devices/bus/nes/karastudio.c (renamed from src/emu/bus/nes/karastudio.c)0
-rw-r--r--src/devices/bus/nes/karastudio.h (renamed from src/emu/bus/nes/karastudio.h)0
-rw-r--r--src/devices/bus/nes/konami.c (renamed from src/emu/bus/nes/konami.c)0
-rw-r--r--src/devices/bus/nes/konami.h (renamed from src/emu/bus/nes/konami.h)0
-rw-r--r--src/devices/bus/nes/legacy.c (renamed from src/emu/bus/nes/legacy.c)0
-rw-r--r--src/devices/bus/nes/legacy.h (renamed from src/emu/bus/nes/legacy.h)0
-rw-r--r--src/devices/bus/nes/mmc1.c (renamed from src/emu/bus/nes/mmc1.c)0
-rw-r--r--src/devices/bus/nes/mmc1.h (renamed from src/emu/bus/nes/mmc1.h)0
-rw-r--r--src/devices/bus/nes/mmc2.c (renamed from src/emu/bus/nes/mmc2.c)0
-rw-r--r--src/devices/bus/nes/mmc2.h (renamed from src/emu/bus/nes/mmc2.h)0
-rw-r--r--src/devices/bus/nes/mmc3.c (renamed from src/emu/bus/nes/mmc3.c)0
-rw-r--r--src/devices/bus/nes/mmc3.h (renamed from src/emu/bus/nes/mmc3.h)0
-rw-r--r--src/devices/bus/nes/mmc3_clones.c (renamed from src/emu/bus/nes/mmc3_clones.c)0
-rw-r--r--src/devices/bus/nes/mmc3_clones.h (renamed from src/emu/bus/nes/mmc3_clones.h)0
-rw-r--r--src/devices/bus/nes/mmc5.c (renamed from src/emu/bus/nes/mmc5.c)0
-rw-r--r--src/devices/bus/nes/mmc5.h (renamed from src/emu/bus/nes/mmc5.h)0
-rw-r--r--src/devices/bus/nes/multigame.c (renamed from src/emu/bus/nes/multigame.c)0
-rw-r--r--src/devices/bus/nes/multigame.h (renamed from src/emu/bus/nes/multigame.h)0
-rw-r--r--src/devices/bus/nes/namcot.c (renamed from src/emu/bus/nes/namcot.c)0
-rw-r--r--src/devices/bus/nes/namcot.h (renamed from src/emu/bus/nes/namcot.h)0
-rw-r--r--src/devices/bus/nes/nanjing.c (renamed from src/emu/bus/nes/nanjing.c)0
-rw-r--r--src/devices/bus/nes/nanjing.h (renamed from src/emu/bus/nes/nanjing.h)0
-rw-r--r--src/devices/bus/nes/nes_carts.c (renamed from src/emu/bus/nes/nes_carts.c)0
-rw-r--r--src/devices/bus/nes/nes_carts.h (renamed from src/emu/bus/nes/nes_carts.h)0
-rw-r--r--src/devices/bus/nes/nes_ines.inc (renamed from src/emu/bus/nes/nes_ines.inc)0
-rw-r--r--src/devices/bus/nes/nes_pcb.inc (renamed from src/emu/bus/nes/nes_pcb.inc)0
-rw-r--r--src/devices/bus/nes/nes_slot.c (renamed from src/emu/bus/nes/nes_slot.c)0
-rw-r--r--src/devices/bus/nes/nes_slot.h (renamed from src/emu/bus/nes/nes_slot.h)0
-rw-r--r--src/devices/bus/nes/nes_unif.inc (renamed from src/emu/bus/nes/nes_unif.inc)0
-rw-r--r--src/devices/bus/nes/ntdec.c (renamed from src/emu/bus/nes/ntdec.c)0
-rw-r--r--src/devices/bus/nes/ntdec.h (renamed from src/emu/bus/nes/ntdec.h)0
-rw-r--r--src/devices/bus/nes/nxrom.c (renamed from src/emu/bus/nes/nxrom.c)0
-rw-r--r--src/devices/bus/nes/nxrom.h (renamed from src/emu/bus/nes/nxrom.h)0
-rw-r--r--src/devices/bus/nes/pirate.c (renamed from src/emu/bus/nes/pirate.c)0
-rw-r--r--src/devices/bus/nes/pirate.h (renamed from src/emu/bus/nes/pirate.h)0
-rw-r--r--src/devices/bus/nes/pt554.c (renamed from src/emu/bus/nes/pt554.c)0
-rw-r--r--src/devices/bus/nes/pt554.h (renamed from src/emu/bus/nes/pt554.h)0
-rw-r--r--src/devices/bus/nes/racermate.c (renamed from src/emu/bus/nes/racermate.c)0
-rw-r--r--src/devices/bus/nes/racermate.h (renamed from src/emu/bus/nes/racermate.h)0
-rw-r--r--src/devices/bus/nes/rcm.c (renamed from src/emu/bus/nes/rcm.c)0
-rw-r--r--src/devices/bus/nes/rcm.h (renamed from src/emu/bus/nes/rcm.h)0
-rw-r--r--src/devices/bus/nes/rexsoft.c (renamed from src/emu/bus/nes/rexsoft.c)0
-rw-r--r--src/devices/bus/nes/rexsoft.h (renamed from src/emu/bus/nes/rexsoft.h)0
-rw-r--r--src/devices/bus/nes/sachen.c (renamed from src/emu/bus/nes/sachen.c)0
-rw-r--r--src/devices/bus/nes/sachen.h (renamed from src/emu/bus/nes/sachen.h)0
-rw-r--r--src/devices/bus/nes/somari.c (renamed from src/emu/bus/nes/somari.c)0
-rw-r--r--src/devices/bus/nes/somari.h (renamed from src/emu/bus/nes/somari.h)0
-rw-r--r--src/devices/bus/nes/sunsoft.c (renamed from src/emu/bus/nes/sunsoft.c)0
-rw-r--r--src/devices/bus/nes/sunsoft.h (renamed from src/emu/bus/nes/sunsoft.h)0
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.c (renamed from src/emu/bus/nes/sunsoft_dcs.c)0
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.h (renamed from src/emu/bus/nes/sunsoft_dcs.h)0
-rw-r--r--src/devices/bus/nes/taito.c (renamed from src/emu/bus/nes/taito.c)0
-rw-r--r--src/devices/bus/nes/taito.h (renamed from src/emu/bus/nes/taito.h)0
-rw-r--r--src/devices/bus/nes/tengen.c (renamed from src/emu/bus/nes/tengen.c)0
-rw-r--r--src/devices/bus/nes/tengen.h (renamed from src/emu/bus/nes/tengen.h)0
-rw-r--r--src/devices/bus/nes/txc.c (renamed from src/emu/bus/nes/txc.c)0
-rw-r--r--src/devices/bus/nes/txc.h (renamed from src/emu/bus/nes/txc.h)0
-rw-r--r--src/devices/bus/nes/waixing.c (renamed from src/emu/bus/nes/waixing.c)0
-rw-r--r--src/devices/bus/nes/waixing.h (renamed from src/emu/bus/nes/waixing.h)0
-rw-r--r--src/devices/bus/nes_ctrl/4score.c (renamed from src/emu/bus/nes_ctrl/4score.c)0
-rw-r--r--src/devices/bus/nes_ctrl/4score.h (renamed from src/emu/bus/nes_ctrl/4score.h)0
-rw-r--r--src/devices/bus/nes_ctrl/arkpaddle.c (renamed from src/emu/bus/nes_ctrl/arkpaddle.c)0
-rw-r--r--src/devices/bus/nes_ctrl/arkpaddle.h (renamed from src/emu/bus/nes_ctrl/arkpaddle.h)0
-rw-r--r--src/devices/bus/nes_ctrl/bcbattle.c (renamed from src/emu/bus/nes_ctrl/bcbattle.c)0
-rw-r--r--src/devices/bus/nes_ctrl/bcbattle.h (renamed from src/emu/bus/nes_ctrl/bcbattle.h)0
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.c (renamed from src/emu/bus/nes_ctrl/ctrl.c)0
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.h (renamed from src/emu/bus/nes_ctrl/ctrl.h)0
-rw-r--r--src/devices/bus/nes_ctrl/fckeybrd.c (renamed from src/emu/bus/nes_ctrl/fckeybrd.c)0
-rw-r--r--src/devices/bus/nes_ctrl/fckeybrd.h (renamed from src/emu/bus/nes_ctrl/fckeybrd.h)0
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.c (renamed from src/emu/bus/nes_ctrl/ftrainer.c)0
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.h (renamed from src/emu/bus/nes_ctrl/ftrainer.h)0
-rw-r--r--src/devices/bus/nes_ctrl/hori.c (renamed from src/emu/bus/nes_ctrl/hori.c)0
-rw-r--r--src/devices/bus/nes_ctrl/hori.h (renamed from src/emu/bus/nes_ctrl/hori.h)0
-rw-r--r--src/devices/bus/nes_ctrl/joypad.c (renamed from src/emu/bus/nes_ctrl/joypad.c)0
-rw-r--r--src/devices/bus/nes_ctrl/joypad.h (renamed from src/emu/bus/nes_ctrl/joypad.h)0
-rw-r--r--src/devices/bus/nes_ctrl/konamihs.c (renamed from src/emu/bus/nes_ctrl/konamihs.c)0
-rw-r--r--src/devices/bus/nes_ctrl/konamihs.h (renamed from src/emu/bus/nes_ctrl/konamihs.h)0
-rw-r--r--src/devices/bus/nes_ctrl/miracle.c (renamed from src/emu/bus/nes_ctrl/miracle.c)0
-rw-r--r--src/devices/bus/nes_ctrl/miracle.h (renamed from src/emu/bus/nes_ctrl/miracle.h)0
-rw-r--r--src/devices/bus/nes_ctrl/mjpanel.c (renamed from src/emu/bus/nes_ctrl/mjpanel.c)0
-rw-r--r--src/devices/bus/nes_ctrl/mjpanel.h (renamed from src/emu/bus/nes_ctrl/mjpanel.h)0
-rw-r--r--src/devices/bus/nes_ctrl/pachinko.c (renamed from src/emu/bus/nes_ctrl/pachinko.c)0
-rw-r--r--src/devices/bus/nes_ctrl/pachinko.h (renamed from src/emu/bus/nes_ctrl/pachinko.h)0
-rw-r--r--src/devices/bus/nes_ctrl/partytap.c (renamed from src/emu/bus/nes_ctrl/partytap.c)0
-rw-r--r--src/devices/bus/nes_ctrl/partytap.h (renamed from src/emu/bus/nes_ctrl/partytap.h)0
-rw-r--r--src/devices/bus/nes_ctrl/powerpad.c (renamed from src/emu/bus/nes_ctrl/powerpad.c)0
-rw-r--r--src/devices/bus/nes_ctrl/powerpad.h (renamed from src/emu/bus/nes_ctrl/powerpad.h)0
-rw-r--r--src/devices/bus/nes_ctrl/suborkey.c (renamed from src/emu/bus/nes_ctrl/suborkey.c)0
-rw-r--r--src/devices/bus/nes_ctrl/suborkey.h (renamed from src/emu/bus/nes_ctrl/suborkey.h)0
-rw-r--r--src/devices/bus/nes_ctrl/zapper.c (renamed from src/emu/bus/nes_ctrl/zapper.c)0
-rw-r--r--src/devices/bus/nes_ctrl/zapper.h (renamed from src/emu/bus/nes_ctrl/zapper.h)0
-rw-r--r--src/devices/bus/nubus/nubus.c (renamed from src/emu/bus/nubus/nubus.c)0
-rw-r--r--src/devices/bus/nubus/nubus.h (renamed from src/emu/bus/nubus/nubus.h)0
-rw-r--r--src/devices/bus/nubus/nubus_48gc.c (renamed from src/emu/bus/nubus/nubus_48gc.c)0
-rw-r--r--src/devices/bus/nubus/nubus_48gc.h (renamed from src/emu/bus/nubus/nubus_48gc.h)0
-rw-r--r--src/devices/bus/nubus/nubus_asntmc3b.c (renamed from src/emu/bus/nubus/nubus_asntmc3b.c)0
-rw-r--r--src/devices/bus/nubus/nubus_asntmc3b.h (renamed from src/emu/bus/nubus/nubus_asntmc3b.h)0
-rw-r--r--src/devices/bus/nubus/nubus_cb264.c (renamed from src/emu/bus/nubus/nubus_cb264.c)0
-rw-r--r--src/devices/bus/nubus/nubus_cb264.h (renamed from src/emu/bus/nubus/nubus_cb264.h)0
-rw-r--r--src/devices/bus/nubus/nubus_image.c (renamed from src/emu/bus/nubus/nubus_image.c)0
-rw-r--r--src/devices/bus/nubus/nubus_image.h (renamed from src/emu/bus/nubus/nubus_image.h)0
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.c (renamed from src/emu/bus/nubus/nubus_m2hires.c)0
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.h (renamed from src/emu/bus/nubus/nubus_m2hires.h)0
-rw-r--r--src/devices/bus/nubus/nubus_m2video.c (renamed from src/emu/bus/nubus/nubus_m2video.c)0
-rw-r--r--src/devices/bus/nubus/nubus_m2video.h (renamed from src/emu/bus/nubus/nubus_m2video.h)0
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.c (renamed from src/emu/bus/nubus/nubus_radiustpd.c)0
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.h (renamed from src/emu/bus/nubus/nubus_radiustpd.h)0
-rw-r--r--src/devices/bus/nubus/nubus_spec8.c (renamed from src/emu/bus/nubus/nubus_spec8.c)0
-rw-r--r--src/devices/bus/nubus/nubus_spec8.h (renamed from src/emu/bus/nubus/nubus_spec8.h)0
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.c (renamed from src/emu/bus/nubus/nubus_specpdq.c)0
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.h (renamed from src/emu/bus/nubus/nubus_specpdq.h)0
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.c (renamed from src/emu/bus/nubus/nubus_vikbw.c)0
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.h (renamed from src/emu/bus/nubus/nubus_vikbw.h)0
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.c (renamed from src/emu/bus/nubus/nubus_wsportrait.c)0
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.h (renamed from src/emu/bus/nubus/nubus_wsportrait.h)0
-rw-r--r--src/devices/bus/nubus/pds30_30hr.c (renamed from src/emu/bus/nubus/pds30_30hr.c)0
-rw-r--r--src/devices/bus/nubus/pds30_30hr.h (renamed from src/emu/bus/nubus/pds30_30hr.h)0
-rw-r--r--src/devices/bus/nubus/pds30_cb264.c (renamed from src/emu/bus/nubus/pds30_cb264.c)0
-rw-r--r--src/devices/bus/nubus/pds30_cb264.h (renamed from src/emu/bus/nubus/pds30_cb264.h)0
-rw-r--r--src/devices/bus/nubus/pds30_mc30.c (renamed from src/emu/bus/nubus/pds30_mc30.c)0
-rw-r--r--src/devices/bus/nubus/pds30_mc30.h (renamed from src/emu/bus/nubus/pds30_mc30.h)0
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.c (renamed from src/emu/bus/nubus/pds30_procolor816.c)0
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.h (renamed from src/emu/bus/nubus/pds30_procolor816.h)0
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.c (renamed from src/emu/bus/nubus/pds30_sigmalview.c)0
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.h (renamed from src/emu/bus/nubus/pds30_sigmalview.h)0
-rw-r--r--src/devices/bus/odyssey2/chess.c (renamed from src/emu/bus/odyssey2/chess.c)0
-rw-r--r--src/devices/bus/odyssey2/chess.h (renamed from src/emu/bus/odyssey2/chess.h)0
-rw-r--r--src/devices/bus/odyssey2/rom.c (renamed from src/emu/bus/odyssey2/rom.c)0
-rw-r--r--src/devices/bus/odyssey2/rom.h (renamed from src/emu/bus/odyssey2/rom.h)0
-rw-r--r--src/devices/bus/odyssey2/slot.c (renamed from src/emu/bus/odyssey2/slot.c)0
-rw-r--r--src/devices/bus/odyssey2/slot.h (renamed from src/emu/bus/odyssey2/slot.h)0
-rw-r--r--src/devices/bus/odyssey2/voice.c (renamed from src/emu/bus/odyssey2/voice.c)0
-rw-r--r--src/devices/bus/odyssey2/voice.h (renamed from src/emu/bus/odyssey2/voice.h)0
-rw-r--r--src/devices/bus/oricext/jasmin.c (renamed from src/emu/bus/oricext/jasmin.c)0
-rw-r--r--src/devices/bus/oricext/jasmin.h (renamed from src/emu/bus/oricext/jasmin.h)0
-rw-r--r--src/devices/bus/oricext/microdisc.c (renamed from src/emu/bus/oricext/microdisc.c)0
-rw-r--r--src/devices/bus/oricext/microdisc.h (renamed from src/emu/bus/oricext/microdisc.h)0
-rw-r--r--src/devices/bus/oricext/oricext.c (renamed from src/emu/bus/oricext/oricext.c)0
-rw-r--r--src/devices/bus/oricext/oricext.h (renamed from src/emu/bus/oricext/oricext.h)0
-rw-r--r--src/devices/bus/pc_joy/pc_joy.c (renamed from src/emu/bus/pc_joy/pc_joy.c)2
-rw-r--r--src/devices/bus/pc_joy/pc_joy.h (renamed from src/emu/bus/pc_joy/pc_joy.h)0
-rw-r--r--src/devices/bus/pc_joy/pc_joy_sw.c (renamed from src/emu/bus/pc_joy/pc_joy_sw.c)0
-rw-r--r--src/devices/bus/pc_joy/pc_joy_sw.h (renamed from src/emu/bus/pc_joy/pc_joy_sw.h)0
-rw-r--r--src/devices/bus/pc_kbd/ec1841.c (renamed from src/emu/bus/pc_kbd/ec1841.c)0
-rw-r--r--src/devices/bus/pc_kbd/ec1841.h (renamed from src/emu/bus/pc_kbd/ec1841.h)0
-rw-r--r--src/devices/bus/pc_kbd/iskr1030.c500
-rw-r--r--src/devices/bus/pc_kbd/iskr1030.h (renamed from src/emu/bus/pc_kbd/iskr1030.h)15
-rw-r--r--src/devices/bus/pc_kbd/keyboards.c (renamed from src/emu/bus/pc_kbd/keyboards.c)0
-rw-r--r--src/devices/bus/pc_kbd/keyboards.h (renamed from src/emu/bus/pc_kbd/keyboards.h)0
-rw-r--r--src/devices/bus/pc_kbd/keytro.c (renamed from src/emu/bus/pc_kbd/keytro.c)0
-rw-r--r--src/devices/bus/pc_kbd/keytro.h (renamed from src/emu/bus/pc_kbd/keytro.h)0
-rw-r--r--src/devices/bus/pc_kbd/msnat.c (renamed from src/emu/bus/pc_kbd/msnat.c)0
-rw-r--r--src/devices/bus/pc_kbd/msnat.h (renamed from src/emu/bus/pc_kbd/msnat.h)0
-rw-r--r--src/devices/bus/pc_kbd/pc83.c (renamed from src/emu/bus/pc_kbd/pc83.c)0
-rw-r--r--src/devices/bus/pc_kbd/pc83.h (renamed from src/emu/bus/pc_kbd/pc83.h)0
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.c (renamed from src/emu/bus/pc_kbd/pc_kbdc.c)0
-rw-r--r--src/devices/bus/pc_kbd/pc_kbdc.h (renamed from src/emu/bus/pc_kbd/pc_kbdc.h)0
-rw-r--r--src/devices/bus/pc_kbd/pcat84.c (renamed from src/emu/bus/pc_kbd/pcat84.c)0
-rw-r--r--src/devices/bus/pc_kbd/pcat84.h (renamed from src/emu/bus/pc_kbd/pcat84.h)0
-rw-r--r--src/devices/bus/pc_kbd/pcxt83.c (renamed from src/emu/bus/pc_kbd/pcxt83.c)0
-rw-r--r--src/devices/bus/pc_kbd/pcxt83.h (renamed from src/emu/bus/pc_kbd/pcxt83.h)0
-rw-r--r--src/devices/bus/pce/pce_rom.c (renamed from src/emu/bus/pce/pce_rom.c)0
-rw-r--r--src/devices/bus/pce/pce_rom.h (renamed from src/emu/bus/pce/pce_rom.h)0
-rw-r--r--src/devices/bus/pce/pce_slot.c (renamed from src/emu/bus/pce/pce_slot.c)0
-rw-r--r--src/devices/bus/pce/pce_slot.h (renamed from src/emu/bus/pce/pce_slot.h)0
-rw-r--r--src/devices/bus/pet/64k.c (renamed from src/emu/bus/pet/64k.c)0
-rw-r--r--src/devices/bus/pet/64k.h (renamed from src/emu/bus/pet/64k.h)0
-rw-r--r--src/devices/bus/pet/c2n.c (renamed from src/emu/bus/pet/c2n.c)0
-rw-r--r--src/devices/bus/pet/c2n.h (renamed from src/emu/bus/pet/c2n.h)0
-rw-r--r--src/devices/bus/pet/cass.c (renamed from src/emu/bus/pet/cass.c)0
-rw-r--r--src/devices/bus/pet/cass.h (renamed from src/emu/bus/pet/cass.h)0
-rw-r--r--src/devices/bus/pet/cb2snd.c (renamed from src/emu/bus/pet/cb2snd.c)0
-rw-r--r--src/devices/bus/pet/cb2snd.h (renamed from src/emu/bus/pet/cb2snd.h)0
-rw-r--r--src/devices/bus/pet/diag.c (renamed from src/emu/bus/pet/diag.c)0
-rw-r--r--src/devices/bus/pet/diag.h (renamed from src/emu/bus/pet/diag.h)0
-rw-r--r--src/devices/bus/pet/diag264_lb_tape.c (renamed from src/emu/bus/pet/diag264_lb_tape.c)0
-rw-r--r--src/devices/bus/pet/diag264_lb_tape.h (renamed from src/emu/bus/pet/diag264_lb_tape.h)0
-rw-r--r--src/devices/bus/pet/exp.c (renamed from src/emu/bus/pet/exp.c)0
-rw-r--r--src/devices/bus/pet/exp.h (renamed from src/emu/bus/pet/exp.h)0
-rw-r--r--src/devices/bus/pet/hsg.c (renamed from src/emu/bus/pet/hsg.c)0
-rw-r--r--src/devices/bus/pet/hsg.h (renamed from src/emu/bus/pet/hsg.h)0
-rw-r--r--src/devices/bus/pet/petuja.c (renamed from src/emu/bus/pet/petuja.c)0
-rw-r--r--src/devices/bus/pet/petuja.h (renamed from src/emu/bus/pet/petuja.h)0
-rw-r--r--src/devices/bus/pet/superpet.c (renamed from src/emu/bus/pet/superpet.c)0
-rw-r--r--src/devices/bus/pet/superpet.h (renamed from src/emu/bus/pet/superpet.h)0
-rw-r--r--src/devices/bus/pet/user.c (renamed from src/emu/bus/pet/user.c)0
-rw-r--r--src/devices/bus/pet/user.h (renamed from src/emu/bus/pet/user.h)0
-rw-r--r--src/devices/bus/plus4/c1551.c (renamed from src/emu/bus/plus4/c1551.c)0
-rw-r--r--src/devices/bus/plus4/c1551.h (renamed from src/emu/bus/plus4/c1551.h)0
-rw-r--r--src/devices/bus/plus4/diag264_lb_user.c (renamed from src/emu/bus/plus4/diag264_lb_user.c)0
-rw-r--r--src/devices/bus/plus4/diag264_lb_user.h (renamed from src/emu/bus/plus4/diag264_lb_user.h)0
-rw-r--r--src/devices/bus/plus4/exp.c (renamed from src/emu/bus/plus4/exp.c)0
-rw-r--r--src/devices/bus/plus4/exp.h (renamed from src/emu/bus/plus4/exp.h)0
-rw-r--r--src/devices/bus/plus4/sid.c (renamed from src/emu/bus/plus4/sid.c)0
-rw-r--r--src/devices/bus/plus4/sid.h (renamed from src/emu/bus/plus4/sid.h)0
-rw-r--r--src/devices/bus/plus4/std.c (renamed from src/emu/bus/plus4/std.c)0
-rw-r--r--src/devices/bus/plus4/std.h (renamed from src/emu/bus/plus4/std.h)0
-rw-r--r--src/devices/bus/plus4/user.c (renamed from src/emu/bus/plus4/user.c)0
-rw-r--r--src/devices/bus/plus4/user.h (renamed from src/emu/bus/plus4/user.h)0
-rw-r--r--src/devices/bus/psx/analogue.c (renamed from src/emu/bus/psx/analogue.c)0
-rw-r--r--src/devices/bus/psx/analogue.h (renamed from src/emu/bus/psx/analogue.h)0
-rw-r--r--src/devices/bus/psx/ctlrport.c (renamed from src/emu/bus/psx/ctlrport.c)0
-rw-r--r--src/devices/bus/psx/ctlrport.h (renamed from src/emu/bus/psx/ctlrport.h)0
-rw-r--r--src/devices/bus/psx/memcard.c (renamed from src/emu/bus/psx/memcard.c)0
-rw-r--r--src/devices/bus/psx/memcard.h (renamed from src/emu/bus/psx/memcard.h)0
-rw-r--r--src/devices/bus/psx/multitap.c (renamed from src/emu/bus/psx/multitap.c)0
-rw-r--r--src/devices/bus/psx/multitap.h (renamed from src/emu/bus/psx/multitap.h)0
-rw-r--r--src/devices/bus/ql/cst_q_plus4.c (renamed from src/emu/bus/ql/cst_q_plus4.c)0
-rw-r--r--src/devices/bus/ql/cst_q_plus4.h (renamed from src/emu/bus/ql/cst_q_plus4.h)0
-rw-r--r--src/devices/bus/ql/cst_qdisc.c (renamed from src/emu/bus/ql/cst_qdisc.c)0
-rw-r--r--src/devices/bus/ql/cst_qdisc.h (renamed from src/emu/bus/ql/cst_qdisc.h)0
-rw-r--r--src/devices/bus/ql/cumana_fdi.c (renamed from src/emu/bus/ql/cumana_fdi.c)0
-rw-r--r--src/devices/bus/ql/cumana_fdi.h (renamed from src/emu/bus/ql/cumana_fdi.h)0
-rw-r--r--src/devices/bus/ql/exp.c (renamed from src/emu/bus/ql/exp.c)0
-rw-r--r--src/devices/bus/ql/exp.h (renamed from src/emu/bus/ql/exp.h)0
-rw-r--r--src/devices/bus/ql/kempston_di.c (renamed from src/emu/bus/ql/kempston_di.c)0
-rw-r--r--src/devices/bus/ql/kempston_di.h (renamed from src/emu/bus/ql/kempston_di.h)0
-rw-r--r--src/devices/bus/ql/miracle_gold_card.c (renamed from src/emu/bus/ql/miracle_gold_card.c)0
-rw-r--r--src/devices/bus/ql/miracle_gold_card.h (renamed from src/emu/bus/ql/miracle_gold_card.h)0
-rw-r--r--src/devices/bus/ql/miracle_hd.c (renamed from src/emu/bus/ql/miracle_hd.c)0
-rw-r--r--src/devices/bus/ql/miracle_hd.h (renamed from src/emu/bus/ql/miracle_hd.h)0
-rw-r--r--src/devices/bus/ql/mp_fdi.c (renamed from src/emu/bus/ql/mp_fdi.c)0
-rw-r--r--src/devices/bus/ql/mp_fdi.h (renamed from src/emu/bus/ql/mp_fdi.h)0
-rw-r--r--src/devices/bus/ql/opd_basic_master.c (renamed from src/emu/bus/ql/opd_basic_master.c)0
-rw-r--r--src/devices/bus/ql/opd_basic_master.h (renamed from src/emu/bus/ql/opd_basic_master.h)0
-rw-r--r--src/devices/bus/ql/pcml_qdisk.c (renamed from src/emu/bus/ql/pcml_qdisk.c)0
-rw-r--r--src/devices/bus/ql/pcml_qdisk.h (renamed from src/emu/bus/ql/pcml_qdisk.h)0
-rw-r--r--src/devices/bus/ql/qubide.c (renamed from src/emu/bus/ql/qubide.c)0
-rw-r--r--src/devices/bus/ql/qubide.h (renamed from src/emu/bus/ql/qubide.h)0
-rw-r--r--src/devices/bus/ql/rom.c (renamed from src/emu/bus/ql/rom.c)0
-rw-r--r--src/devices/bus/ql/rom.h (renamed from src/emu/bus/ql/rom.h)0
-rw-r--r--src/devices/bus/ql/sandy_superdisk.c (renamed from src/emu/bus/ql/sandy_superdisk.c)0
-rw-r--r--src/devices/bus/ql/sandy_superdisk.h (renamed from src/emu/bus/ql/sandy_superdisk.h)0
-rw-r--r--src/devices/bus/ql/sandy_superqboard.c (renamed from src/emu/bus/ql/sandy_superqboard.c)0
-rw-r--r--src/devices/bus/ql/sandy_superqboard.h (renamed from src/emu/bus/ql/sandy_superqboard.h)0
-rw-r--r--src/devices/bus/ql/std.c (renamed from src/emu/bus/ql/std.c)0
-rw-r--r--src/devices/bus/ql/std.h (renamed from src/emu/bus/ql/std.h)0
-rw-r--r--src/devices/bus/ql/trumpcard.c (renamed from src/emu/bus/ql/trumpcard.c)0
-rw-r--r--src/devices/bus/ql/trumpcard.h (renamed from src/emu/bus/ql/trumpcard.h)0
-rw-r--r--src/devices/bus/rs232/keyboard.c (renamed from src/emu/bus/rs232/keyboard.c)0
-rw-r--r--src/devices/bus/rs232/keyboard.h (renamed from src/emu/bus/rs232/keyboard.h)0
-rw-r--r--src/devices/bus/rs232/loopback.c (renamed from src/emu/bus/rs232/loopback.c)0
-rw-r--r--src/devices/bus/rs232/loopback.h (renamed from src/emu/bus/rs232/loopback.h)0
-rw-r--r--src/devices/bus/rs232/null_modem.c (renamed from src/emu/bus/rs232/null_modem.c)0
-rw-r--r--src/devices/bus/rs232/null_modem.h (renamed from src/emu/bus/rs232/null_modem.h)0
-rw-r--r--src/devices/bus/rs232/printer.c (renamed from src/emu/bus/rs232/printer.c)0
-rw-r--r--src/devices/bus/rs232/printer.h (renamed from src/emu/bus/rs232/printer.h)0
-rw-r--r--src/devices/bus/rs232/pty.c138
-rw-r--r--src/devices/bus/rs232/pty.h52
-rw-r--r--src/devices/bus/rs232/rs232.c (renamed from src/emu/bus/rs232/rs232.c)2
-rw-r--r--src/devices/bus/rs232/rs232.h (renamed from src/emu/bus/rs232/rs232.h)0
-rw-r--r--src/devices/bus/rs232/ser_mouse.c (renamed from src/emu/bus/rs232/ser_mouse.c)0
-rw-r--r--src/devices/bus/rs232/ser_mouse.h (renamed from src/emu/bus/rs232/ser_mouse.h)0
-rw-r--r--src/devices/bus/rs232/terminal.c (renamed from src/emu/bus/rs232/terminal.c)0
-rw-r--r--src/devices/bus/rs232/terminal.h (renamed from src/emu/bus/rs232/terminal.h)0
-rw-r--r--src/devices/bus/rs232/xvd701.c (renamed from src/emu/bus/rs232/xvd701.c)0
-rw-r--r--src/devices/bus/rs232/xvd701.h (renamed from src/emu/bus/rs232/xvd701.h)0
-rw-r--r--src/devices/bus/s100/dj2db.c (renamed from src/emu/bus/s100/dj2db.c)0
-rw-r--r--src/devices/bus/s100/dj2db.h (renamed from src/emu/bus/s100/dj2db.h)0
-rw-r--r--src/devices/bus/s100/djdma.c (renamed from src/emu/bus/s100/djdma.c)0
-rw-r--r--src/devices/bus/s100/djdma.h (renamed from src/emu/bus/s100/djdma.h)0
-rw-r--r--src/devices/bus/s100/mm65k16s.c (renamed from src/emu/bus/s100/mm65k16s.c)0
-rw-r--r--src/devices/bus/s100/mm65k16s.h (renamed from src/emu/bus/s100/mm65k16s.h)0
-rw-r--r--src/devices/bus/s100/nsmdsa.c (renamed from src/emu/bus/s100/nsmdsa.c)0
-rw-r--r--src/devices/bus/s100/nsmdsa.h (renamed from src/emu/bus/s100/nsmdsa.h)0
-rw-r--r--src/devices/bus/s100/nsmdsad.c (renamed from src/emu/bus/s100/nsmdsad.c)0
-rw-r--r--src/devices/bus/s100/nsmdsad.h (renamed from src/emu/bus/s100/nsmdsad.h)0
-rw-r--r--src/devices/bus/s100/s100.c (renamed from src/emu/bus/s100/s100.c)0
-rw-r--r--src/devices/bus/s100/s100.h (renamed from src/emu/bus/s100/s100.h)0
-rw-r--r--src/devices/bus/s100/wunderbus.c (renamed from src/emu/bus/s100/wunderbus.c)0
-rw-r--r--src/devices/bus/s100/wunderbus.h (renamed from src/emu/bus/s100/wunderbus.h)0
-rw-r--r--src/devices/bus/saturn/bram.c (renamed from src/emu/bus/saturn/bram.c)0
-rw-r--r--src/devices/bus/saturn/bram.h (renamed from src/emu/bus/saturn/bram.h)0
-rw-r--r--src/devices/bus/saturn/dram.c (renamed from src/emu/bus/saturn/dram.c)0
-rw-r--r--src/devices/bus/saturn/dram.h (renamed from src/emu/bus/saturn/dram.h)0
-rw-r--r--src/devices/bus/saturn/rom.c (renamed from src/emu/bus/saturn/rom.c)0
-rw-r--r--src/devices/bus/saturn/rom.h (renamed from src/emu/bus/saturn/rom.h)0
-rw-r--r--src/devices/bus/saturn/sat_slot.c (renamed from src/emu/bus/saturn/sat_slot.c)0
-rw-r--r--src/devices/bus/saturn/sat_slot.h (renamed from src/emu/bus/saturn/sat_slot.h)0
-rw-r--r--src/devices/bus/scsi/acb4070.c (renamed from src/emu/bus/scsi/acb4070.c)0
-rw-r--r--src/devices/bus/scsi/acb4070.h (renamed from src/emu/bus/scsi/acb4070.h)0
-rw-r--r--src/devices/bus/scsi/cdu76s.c (renamed from src/emu/bus/scsi/cdu76s.c)0
-rw-r--r--src/devices/bus/scsi/cdu76s.h (renamed from src/emu/bus/scsi/cdu76s.h)0
-rw-r--r--src/devices/bus/scsi/d9060hd.c (renamed from src/emu/bus/scsi/d9060hd.c)0
-rw-r--r--src/devices/bus/scsi/d9060hd.h (renamed from src/emu/bus/scsi/d9060hd.h)0
-rw-r--r--src/devices/bus/scsi/omti5100.c187
-rw-r--r--src/devices/bus/scsi/omti5100.h (renamed from src/emu/bus/scsi/omti5100.h)2
-rw-r--r--src/devices/bus/scsi/pc9801_sasi.c (renamed from src/emu/bus/scsi/pc9801_sasi.c)0
-rw-r--r--src/devices/bus/scsi/pc9801_sasi.h (renamed from src/emu/bus/scsi/pc9801_sasi.h)0
-rw-r--r--src/devices/bus/scsi/s1410.c (renamed from src/emu/bus/scsi/s1410.c)0
-rw-r--r--src/devices/bus/scsi/s1410.h (renamed from src/emu/bus/scsi/s1410.h)0
-rw-r--r--src/devices/bus/scsi/sa1403d.c (renamed from src/emu/bus/scsi/sa1403d.c)0
-rw-r--r--src/devices/bus/scsi/sa1403d.h (renamed from src/emu/bus/scsi/sa1403d.h)0
-rw-r--r--src/devices/bus/scsi/scsi.c (renamed from src/emu/bus/scsi/scsi.c)0
-rw-r--r--src/devices/bus/scsi/scsi.h (renamed from src/emu/bus/scsi/scsi.h)0
-rw-r--r--src/devices/bus/scsi/scsicd.c (renamed from src/emu/bus/scsi/scsicd.c)0
-rw-r--r--src/devices/bus/scsi/scsicd.h (renamed from src/emu/bus/scsi/scsicd.h)0
-rw-r--r--src/devices/bus/scsi/scsihd.c (renamed from src/emu/bus/scsi/scsihd.c)0
-rw-r--r--src/devices/bus/scsi/scsihd.h (renamed from src/emu/bus/scsi/scsihd.h)0
-rw-r--r--src/devices/bus/scsi/scsihle.c (renamed from src/emu/bus/scsi/scsihle.c)4
-rw-r--r--src/devices/bus/scsi/scsihle.h (renamed from src/emu/bus/scsi/scsihle.h)0
-rw-r--r--src/devices/bus/scv/rom.c (renamed from src/emu/bus/scv/rom.c)0
-rw-r--r--src/devices/bus/scv/rom.h (renamed from src/emu/bus/scv/rom.h)0
-rw-r--r--src/devices/bus/scv/slot.c (renamed from src/emu/bus/scv/slot.c)0
-rw-r--r--src/devices/bus/scv/slot.h (renamed from src/emu/bus/scv/slot.h)0
-rw-r--r--src/devices/bus/sega8/ccatch.c (renamed from src/emu/bus/sega8/ccatch.c)0
-rw-r--r--src/devices/bus/sega8/ccatch.h (renamed from src/emu/bus/sega8/ccatch.h)0
-rw-r--r--src/devices/bus/sega8/mgear.c (renamed from src/emu/bus/sega8/mgear.c)0
-rw-r--r--src/devices/bus/sega8/mgear.h (renamed from src/emu/bus/sega8/mgear.h)0
-rw-r--r--src/devices/bus/sega8/rom.c (renamed from src/emu/bus/sega8/rom.c)0
-rw-r--r--src/devices/bus/sega8/rom.h (renamed from src/emu/bus/sega8/rom.h)0
-rw-r--r--src/devices/bus/sega8/sega8_slot.c (renamed from src/emu/bus/sega8/sega8_slot.c)0
-rw-r--r--src/devices/bus/sega8/sega8_slot.h (renamed from src/emu/bus/sega8/sega8_slot.h)0
-rw-r--r--src/devices/bus/sms_ctrl/graphic.c (renamed from src/emu/bus/sms_ctrl/graphic.c)0
-rw-r--r--src/devices/bus/sms_ctrl/graphic.h (renamed from src/emu/bus/sms_ctrl/graphic.h)0
-rw-r--r--src/devices/bus/sms_ctrl/joypad.c (renamed from src/emu/bus/sms_ctrl/joypad.c)0
-rw-r--r--src/devices/bus/sms_ctrl/joypad.h (renamed from src/emu/bus/sms_ctrl/joypad.h)0
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.c (renamed from src/emu/bus/sms_ctrl/lphaser.c)0
-rw-r--r--src/devices/bus/sms_ctrl/lphaser.h (renamed from src/emu/bus/sms_ctrl/lphaser.h)0
-rw-r--r--src/devices/bus/sms_ctrl/multitap.c (renamed from src/emu/bus/sms_ctrl/multitap.c)0
-rw-r--r--src/devices/bus/sms_ctrl/multitap.h (renamed from src/emu/bus/sms_ctrl/multitap.h)0
-rw-r--r--src/devices/bus/sms_ctrl/paddle.c (renamed from src/emu/bus/sms_ctrl/paddle.c)0
-rw-r--r--src/devices/bus/sms_ctrl/paddle.h (renamed from src/emu/bus/sms_ctrl/paddle.h)0
-rw-r--r--src/devices/bus/sms_ctrl/rfu.c (renamed from src/emu/bus/sms_ctrl/rfu.c)0
-rw-r--r--src/devices/bus/sms_ctrl/rfu.h (renamed from src/emu/bus/sms_ctrl/rfu.h)0
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.c (renamed from src/emu/bus/sms_ctrl/smsctrl.c)0
-rw-r--r--src/devices/bus/sms_ctrl/smsctrl.h (renamed from src/emu/bus/sms_ctrl/smsctrl.h)0
-rw-r--r--src/devices/bus/sms_ctrl/sports.c (renamed from src/emu/bus/sms_ctrl/sports.c)100
-rw-r--r--src/devices/bus/sms_ctrl/sports.h (renamed from src/emu/bus/sms_ctrl/sports.h)7
-rw-r--r--src/devices/bus/sms_ctrl/sportsjp.c (renamed from src/emu/bus/sms_ctrl/sportsjp.c)0
-rw-r--r--src/devices/bus/sms_ctrl/sportsjp.h (renamed from src/emu/bus/sms_ctrl/sportsjp.h)0
-rw-r--r--src/devices/bus/sms_exp/gender.c (renamed from src/emu/bus/sms_exp/gender.c)0
-rw-r--r--src/devices/bus/sms_exp/gender.h (renamed from src/emu/bus/sms_exp/gender.h)0
-rw-r--r--src/devices/bus/sms_exp/smsexp.c (renamed from src/emu/bus/sms_exp/smsexp.c)0
-rw-r--r--src/devices/bus/sms_exp/smsexp.h (renamed from src/emu/bus/sms_exp/smsexp.h)0
-rw-r--r--src/devices/bus/snes/bsx.c (renamed from src/emu/bus/snes/bsx.c)0
-rw-r--r--src/devices/bus/snes/bsx.h (renamed from src/emu/bus/snes/bsx.h)0
-rw-r--r--src/devices/bus/snes/event.c (renamed from src/emu/bus/snes/event.c)0
-rw-r--r--src/devices/bus/snes/event.h (renamed from src/emu/bus/snes/event.h)0
-rw-r--r--src/devices/bus/snes/rom.c (renamed from src/emu/bus/snes/rom.c)0
-rw-r--r--src/devices/bus/snes/rom.h (renamed from src/emu/bus/snes/rom.h)0
-rw-r--r--src/devices/bus/snes/rom21.c (renamed from src/emu/bus/snes/rom21.c)0
-rw-r--r--src/devices/bus/snes/rom21.h (renamed from src/emu/bus/snes/rom21.h)0
-rw-r--r--src/devices/bus/snes/sa1.c (renamed from src/emu/bus/snes/sa1.c)0
-rw-r--r--src/devices/bus/snes/sa1.h (renamed from src/emu/bus/snes/sa1.h)0
-rw-r--r--src/devices/bus/snes/sdd1.c (renamed from src/emu/bus/snes/sdd1.c)2
-rw-r--r--src/devices/bus/snes/sdd1.h (renamed from src/emu/bus/snes/sdd1.h)0
-rw-r--r--src/devices/bus/snes/sfx.c (renamed from src/emu/bus/snes/sfx.c)0
-rw-r--r--src/devices/bus/snes/sfx.h (renamed from src/emu/bus/snes/sfx.h)0
-rw-r--r--src/devices/bus/snes/sgb.c (renamed from src/emu/bus/snes/sgb.c)0
-rw-r--r--src/devices/bus/snes/sgb.h (renamed from src/emu/bus/snes/sgb.h)0
-rw-r--r--src/devices/bus/snes/snes_carts.c (renamed from src/emu/bus/snes/snes_carts.c)0
-rw-r--r--src/devices/bus/snes/snes_carts.h (renamed from src/emu/bus/snes/snes_carts.h)0
-rw-r--r--src/devices/bus/snes/snes_slot.c (renamed from src/emu/bus/snes/snes_slot.c)0
-rw-r--r--src/devices/bus/snes/snes_slot.h (renamed from src/emu/bus/snes/snes_slot.h)0
-rw-r--r--src/devices/bus/snes/spc7110.c (renamed from src/emu/bus/snes/spc7110.c)0
-rw-r--r--src/devices/bus/snes/spc7110.h (renamed from src/emu/bus/snes/spc7110.h)0
-rw-r--r--src/devices/bus/snes/sufami.c (renamed from src/emu/bus/snes/sufami.c)0
-rw-r--r--src/devices/bus/snes/sufami.h (renamed from src/emu/bus/snes/sufami.h)0
-rw-r--r--src/devices/bus/snes/upd.c (renamed from src/emu/bus/snes/upd.c)0
-rw-r--r--src/devices/bus/snes/upd.h (renamed from src/emu/bus/snes/upd.h)0
-rw-r--r--src/devices/bus/snes_ctrl/bcbattle.c (renamed from src/emu/bus/snes_ctrl/bcbattle.c)0
-rw-r--r--src/devices/bus/snes_ctrl/bcbattle.h (renamed from src/emu/bus/snes_ctrl/bcbattle.h)0
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.c (renamed from src/emu/bus/snes_ctrl/ctrl.c)0
-rw-r--r--src/devices/bus/snes_ctrl/ctrl.h (renamed from src/emu/bus/snes_ctrl/ctrl.h)0
-rw-r--r--src/devices/bus/snes_ctrl/joypad.c (renamed from src/emu/bus/snes_ctrl/joypad.c)0
-rw-r--r--src/devices/bus/snes_ctrl/joypad.h (renamed from src/emu/bus/snes_ctrl/joypad.h)0
-rw-r--r--src/devices/bus/snes_ctrl/miracle.c (renamed from src/emu/bus/snes_ctrl/miracle.c)0
-rw-r--r--src/devices/bus/snes_ctrl/miracle.h (renamed from src/emu/bus/snes_ctrl/miracle.h)0
-rw-r--r--src/devices/bus/snes_ctrl/mouse.c (renamed from src/emu/bus/snes_ctrl/mouse.c)0
-rw-r--r--src/devices/bus/snes_ctrl/mouse.h (renamed from src/emu/bus/snes_ctrl/mouse.h)0
-rw-r--r--src/devices/bus/snes_ctrl/multitap.c (renamed from src/emu/bus/snes_ctrl/multitap.c)0
-rw-r--r--src/devices/bus/snes_ctrl/multitap.h (renamed from src/emu/bus/snes_ctrl/multitap.h)0
-rw-r--r--src/devices/bus/snes_ctrl/pachinko.c (renamed from src/emu/bus/snes_ctrl/pachinko.c)0
-rw-r--r--src/devices/bus/snes_ctrl/pachinko.h (renamed from src/emu/bus/snes_ctrl/pachinko.h)0
-rw-r--r--src/devices/bus/snes_ctrl/sscope.c (renamed from src/emu/bus/snes_ctrl/sscope.c)0
-rw-r--r--src/devices/bus/snes_ctrl/sscope.h (renamed from src/emu/bus/snes_ctrl/sscope.h)0
-rw-r--r--src/devices/bus/snes_ctrl/twintap.c (renamed from src/emu/bus/snes_ctrl/twintap.c)0
-rw-r--r--src/devices/bus/snes_ctrl/twintap.h (renamed from src/emu/bus/snes_ctrl/twintap.h)0
-rw-r--r--src/devices/bus/spc1000/exp.c (renamed from src/emu/bus/spc1000/exp.c)0
-rw-r--r--src/devices/bus/spc1000/exp.h (renamed from src/emu/bus/spc1000/exp.h)0
-rw-r--r--src/devices/bus/spc1000/fdd.c (renamed from src/emu/bus/spc1000/fdd.c)0
-rw-r--r--src/devices/bus/spc1000/fdd.h (renamed from src/emu/bus/spc1000/fdd.h)0
-rw-r--r--src/devices/bus/spc1000/vdp.c (renamed from src/emu/bus/spc1000/vdp.c)0
-rw-r--r--src/devices/bus/spc1000/vdp.h (renamed from src/emu/bus/spc1000/vdp.h)0
-rw-r--r--src/devices/bus/ti99_peb/bwg.c (renamed from src/emu/bus/ti99_peb/bwg.c)4
-rw-r--r--src/devices/bus/ti99_peb/bwg.h (renamed from src/emu/bus/ti99_peb/bwg.h)0
-rw-r--r--src/devices/bus/ti99_peb/evpc.c (renamed from src/emu/bus/ti99_peb/evpc.c)0
-rw-r--r--src/devices/bus/ti99_peb/evpc.h (renamed from src/emu/bus/ti99_peb/evpc.h)0
-rw-r--r--src/devices/bus/ti99_peb/hfdc.c (renamed from src/emu/bus/ti99_peb/hfdc.c)40
-rw-r--r--src/devices/bus/ti99_peb/hfdc.h (renamed from src/emu/bus/ti99_peb/hfdc.h)8
-rw-r--r--src/devices/bus/ti99_peb/horizon.c (renamed from src/emu/bus/ti99_peb/horizon.c)0
-rw-r--r--src/devices/bus/ti99_peb/horizon.h (renamed from src/emu/bus/ti99_peb/horizon.h)0
-rw-r--r--src/devices/bus/ti99_peb/hsgpl.c (renamed from src/emu/bus/ti99_peb/hsgpl.c)18
-rw-r--r--src/devices/bus/ti99_peb/hsgpl.h (renamed from src/emu/bus/ti99_peb/hsgpl.h)10
-rw-r--r--src/devices/bus/ti99_peb/memex.c (renamed from src/emu/bus/ti99_peb/memex.c)0
-rw-r--r--src/devices/bus/ti99_peb/memex.h (renamed from src/emu/bus/ti99_peb/memex.h)0
-rw-r--r--src/devices/bus/ti99_peb/myarcmem.c (renamed from src/emu/bus/ti99_peb/myarcmem.c)0
-rw-r--r--src/devices/bus/ti99_peb/myarcmem.h (renamed from src/emu/bus/ti99_peb/myarcmem.h)0
-rw-r--r--src/devices/bus/ti99_peb/pcode.c (renamed from src/emu/bus/ti99_peb/pcode.c)0
-rw-r--r--src/devices/bus/ti99_peb/pcode.h (renamed from src/emu/bus/ti99_peb/pcode.h)2
-rw-r--r--src/devices/bus/ti99_peb/peribox.c (renamed from src/emu/bus/ti99_peb/peribox.c)0
-rw-r--r--src/devices/bus/ti99_peb/peribox.h (renamed from src/emu/bus/ti99_peb/peribox.h)2
-rw-r--r--src/devices/bus/ti99_peb/samsmem.c (renamed from src/emu/bus/ti99_peb/samsmem.c)0
-rw-r--r--src/devices/bus/ti99_peb/samsmem.h (renamed from src/emu/bus/ti99_peb/samsmem.h)0
-rw-r--r--src/devices/bus/ti99_peb/spchsyn.c (renamed from src/emu/bus/ti99_peb/spchsyn.c)0
-rw-r--r--src/devices/bus/ti99_peb/spchsyn.h (renamed from src/emu/bus/ti99_peb/spchsyn.h)0
-rw-r--r--src/devices/bus/ti99_peb/ti_32kmem.c (renamed from src/emu/bus/ti99_peb/ti_32kmem.c)0
-rw-r--r--src/devices/bus/ti99_peb/ti_32kmem.h (renamed from src/emu/bus/ti99_peb/ti_32kmem.h)0
-rw-r--r--src/devices/bus/ti99_peb/ti_fdc.c (renamed from src/emu/bus/ti99_peb/ti_fdc.c)3
-rw-r--r--src/devices/bus/ti99_peb/ti_fdc.h (renamed from src/emu/bus/ti99_peb/ti_fdc.h)0
-rw-r--r--src/devices/bus/ti99_peb/ti_rs232.c (renamed from src/emu/bus/ti99_peb/ti_rs232.c)11
-rw-r--r--src/devices/bus/ti99_peb/ti_rs232.h (renamed from src/emu/bus/ti99_peb/ti_rs232.h)0
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.c (renamed from src/emu/bus/ti99_peb/tn_ide.c)1
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.h (renamed from src/emu/bus/ti99_peb/tn_ide.h)0
-rw-r--r--src/devices/bus/ti99_peb/tn_usbsm.c (renamed from src/emu/bus/ti99_peb/tn_usbsm.c)0
-rw-r--r--src/devices/bus/ti99_peb/tn_usbsm.h (renamed from src/emu/bus/ti99_peb/tn_usbsm.h)0
-rw-r--r--src/devices/bus/ti99x/990_dk.c (renamed from src/mess/machine/ti99/990_dk.c)0
-rw-r--r--src/devices/bus/ti99x/990_dk.h (renamed from src/mess/machine/ti99/990_dk.h)0
-rw-r--r--src/devices/bus/ti99x/990_hd.c (renamed from src/mess/machine/ti99/990_hd.c)0
-rw-r--r--src/devices/bus/ti99x/990_hd.h (renamed from src/mess/machine/ti99/990_hd.h)0
-rw-r--r--src/devices/bus/ti99x/990_tap.c (renamed from src/mess/machine/ti99/990_tap.c)0
-rw-r--r--src/devices/bus/ti99x/990_tap.h (renamed from src/mess/machine/ti99/990_tap.h)0
-rw-r--r--src/devices/bus/ti99x/998board.c (renamed from src/mess/machine/ti99/mapper8.c)267
-rw-r--r--src/devices/bus/ti99x/998board.h (renamed from src/mess/machine/ti99/mapper8.h)59
-rw-r--r--src/devices/bus/ti99x/datamux.c (renamed from src/mess/machine/ti99/datamux.c)2
-rw-r--r--src/devices/bus/ti99x/datamux.h (renamed from src/mess/machine/ti99/datamux.h)0
-rw-r--r--src/devices/bus/ti99x/genboard.c (renamed from src/mess/machine/ti99/genboard.c)351
-rw-r--r--src/devices/bus/ti99x/genboard.h (renamed from src/mess/machine/ti99/genboard.h)36
-rw-r--r--src/devices/bus/ti99x/grom.c (renamed from src/mess/machine/ti99/grom.c)0
-rw-r--r--src/devices/bus/ti99x/grom.h (renamed from src/mess/machine/ti99/grom.h)0
-rw-r--r--src/devices/bus/ti99x/gromport.c (renamed from src/mess/machine/ti99/gromport.c)216
-rw-r--r--src/devices/bus/ti99x/gromport.h (renamed from src/mess/machine/ti99/gromport.h)28
-rw-r--r--src/devices/bus/ti99x/handset.c (renamed from src/mess/machine/ti99/handset.c)0
-rw-r--r--src/devices/bus/ti99x/handset.h (renamed from src/mess/machine/ti99/handset.h)0
-rw-r--r--src/devices/bus/ti99x/joyport.c (renamed from src/mess/machine/ti99/joyport.c)0
-rw-r--r--src/devices/bus/ti99x/joyport.h (renamed from src/mess/machine/ti99/joyport.h)0
-rw-r--r--src/devices/bus/ti99x/mecmouse.c (renamed from src/mess/machine/ti99/mecmouse.c)0
-rw-r--r--src/devices/bus/ti99x/mecmouse.h (renamed from src/mess/machine/ti99/mecmouse.h)0
-rw-r--r--src/devices/bus/ti99x/ti99defs.h (renamed from src/mess/machine/ti99/ti99defs.h)6
-rw-r--r--src/devices/bus/ti99x/videowrp.c (renamed from src/mess/machine/ti99/videowrp.c)0
-rw-r--r--src/devices/bus/ti99x/videowrp.h (renamed from src/mess/machine/ti99/videowrp.h)2
-rw-r--r--src/devices/bus/tiki100/8088.c176
-rw-r--r--src/devices/bus/tiki100/8088.h60
-rw-r--r--src/devices/bus/tiki100/exp.c207
-rw-r--r--src/devices/bus/tiki100/exp.h193
-rw-r--r--src/devices/bus/tiki100/hdc.c118
-rw-r--r--src/devices/bus/tiki100/hdc.h55
-rw-r--r--src/devices/bus/tvc/hbf.c (renamed from src/emu/bus/tvc/hbf.c)0
-rw-r--r--src/devices/bus/tvc/hbf.h (renamed from src/emu/bus/tvc/hbf.h)0
-rw-r--r--src/devices/bus/tvc/tvc.c (renamed from src/emu/bus/tvc/tvc.c)0
-rw-r--r--src/devices/bus/tvc/tvc.h (renamed from src/emu/bus/tvc/tvc.h)0
-rw-r--r--src/devices/bus/vboy/rom.c (renamed from src/emu/bus/vboy/rom.c)0
-rw-r--r--src/devices/bus/vboy/rom.h (renamed from src/emu/bus/vboy/rom.h)0
-rw-r--r--src/devices/bus/vboy/slot.c (renamed from src/emu/bus/vboy/slot.c)0
-rw-r--r--src/devices/bus/vboy/slot.h (renamed from src/emu/bus/vboy/slot.h)0
-rw-r--r--src/devices/bus/vc4000/rom.c (renamed from src/emu/bus/vc4000/rom.c)0
-rw-r--r--src/devices/bus/vc4000/rom.h (renamed from src/emu/bus/vc4000/rom.h)0
-rw-r--r--src/devices/bus/vc4000/slot.c (renamed from src/emu/bus/vc4000/slot.c)0
-rw-r--r--src/devices/bus/vc4000/slot.h (renamed from src/emu/bus/vc4000/slot.h)0
-rw-r--r--src/devices/bus/vcs/compumat.c (renamed from src/emu/bus/vcs/compumat.c)0
-rw-r--r--src/devices/bus/vcs/compumat.h (renamed from src/emu/bus/vcs/compumat.h)0
-rw-r--r--src/devices/bus/vcs/dpc.c (renamed from src/emu/bus/vcs/dpc.c)0
-rw-r--r--src/devices/bus/vcs/dpc.h (renamed from src/emu/bus/vcs/dpc.h)0
-rwxr-xr-xsrc/devices/bus/vcs/rom.c (renamed from src/emu/bus/vcs/rom.c)0
-rwxr-xr-xsrc/devices/bus/vcs/rom.h (renamed from src/emu/bus/vcs/rom.h)0
-rw-r--r--src/devices/bus/vcs/scharger.c (renamed from src/emu/bus/vcs/scharger.c)0
-rw-r--r--src/devices/bus/vcs/scharger.h (renamed from src/emu/bus/vcs/scharger.h)0
-rwxr-xr-xsrc/devices/bus/vcs/vcs_slot.c (renamed from src/emu/bus/vcs/vcs_slot.c)0
-rwxr-xr-xsrc/devices/bus/vcs/vcs_slot.h (renamed from src/emu/bus/vcs/vcs_slot.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.c (renamed from src/emu/bus/vcs_ctrl/ctrl.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/ctrl.h (renamed from src/emu/bus/vcs_ctrl/ctrl.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/joybooster.c (renamed from src/emu/bus/vcs_ctrl/joybooster.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/joybooster.h (renamed from src/emu/bus/vcs_ctrl/joybooster.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/joystick.c (renamed from src/emu/bus/vcs_ctrl/joystick.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/joystick.h (renamed from src/emu/bus/vcs_ctrl/joystick.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/keypad.c (renamed from src/emu/bus/vcs_ctrl/keypad.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/keypad.h (renamed from src/emu/bus/vcs_ctrl/keypad.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/lightpen.c (renamed from src/emu/bus/vcs_ctrl/lightpen.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/lightpen.h (renamed from src/emu/bus/vcs_ctrl/lightpen.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/paddles.c (renamed from src/emu/bus/vcs_ctrl/paddles.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/paddles.h (renamed from src/emu/bus/vcs_ctrl/paddles.h)0
-rw-r--r--src/devices/bus/vcs_ctrl/wheel.c (renamed from src/emu/bus/vcs_ctrl/wheel.c)0
-rw-r--r--src/devices/bus/vcs_ctrl/wheel.h (renamed from src/emu/bus/vcs_ctrl/wheel.h)0
-rw-r--r--src/devices/bus/vectrex/rom.c (renamed from src/emu/bus/vectrex/rom.c)0
-rw-r--r--src/devices/bus/vectrex/rom.h (renamed from src/emu/bus/vectrex/rom.h)0
-rw-r--r--src/devices/bus/vectrex/slot.c (renamed from src/emu/bus/vectrex/slot.c)0
-rw-r--r--src/devices/bus/vectrex/slot.h (renamed from src/emu/bus/vectrex/slot.h)0
-rw-r--r--src/devices/bus/vic10/exp.c (renamed from src/emu/bus/vic10/exp.c)0
-rw-r--r--src/devices/bus/vic10/exp.h (renamed from src/emu/bus/vic10/exp.h)0
-rw-r--r--src/devices/bus/vic10/std.c (renamed from src/emu/bus/vic10/std.c)0
-rw-r--r--src/devices/bus/vic10/std.h (renamed from src/emu/bus/vic10/std.h)0
-rw-r--r--src/devices/bus/vic20/4cga.c (renamed from src/emu/bus/vic20/4cga.c)0
-rw-r--r--src/devices/bus/vic20/4cga.h (renamed from src/emu/bus/vic20/4cga.h)0
-rw-r--r--src/devices/bus/vic20/exp.c (renamed from src/emu/bus/vic20/exp.c)0
-rw-r--r--src/devices/bus/vic20/exp.h (renamed from src/emu/bus/vic20/exp.h)0
-rw-r--r--src/devices/bus/vic20/fe3.c (renamed from src/emu/bus/vic20/fe3.c)0
-rw-r--r--src/devices/bus/vic20/fe3.h (renamed from src/emu/bus/vic20/fe3.h)0
-rw-r--r--src/devices/bus/vic20/megacart.c (renamed from src/emu/bus/vic20/megacart.c)0
-rw-r--r--src/devices/bus/vic20/megacart.h (renamed from src/emu/bus/vic20/megacart.h)0
-rw-r--r--src/devices/bus/vic20/std.c (renamed from src/emu/bus/vic20/std.c)0
-rw-r--r--src/devices/bus/vic20/std.h (renamed from src/emu/bus/vic20/std.h)0
-rw-r--r--src/devices/bus/vic20/user.c (renamed from src/emu/bus/vic20/user.c)0
-rw-r--r--src/devices/bus/vic20/user.h (renamed from src/emu/bus/vic20/user.h)0
-rw-r--r--src/devices/bus/vic20/vic1010.c (renamed from src/emu/bus/vic20/vic1010.c)0
-rw-r--r--src/devices/bus/vic20/vic1010.h (renamed from src/emu/bus/vic20/vic1010.h)0
-rw-r--r--src/devices/bus/vic20/vic1011.c (renamed from src/emu/bus/vic20/vic1011.c)0
-rw-r--r--src/devices/bus/vic20/vic1011.h (renamed from src/emu/bus/vic20/vic1011.h)0
-rw-r--r--src/devices/bus/vic20/vic1110.c (renamed from src/emu/bus/vic20/vic1110.c)0
-rw-r--r--src/devices/bus/vic20/vic1110.h (renamed from src/emu/bus/vic20/vic1110.h)0
-rw-r--r--src/devices/bus/vic20/vic1111.c (renamed from src/emu/bus/vic20/vic1111.c)0
-rw-r--r--src/devices/bus/vic20/vic1111.h (renamed from src/emu/bus/vic20/vic1111.h)0
-rw-r--r--src/devices/bus/vic20/vic1112.c (renamed from src/emu/bus/vic20/vic1112.c)0
-rw-r--r--src/devices/bus/vic20/vic1112.h (renamed from src/emu/bus/vic20/vic1112.h)0
-rw-r--r--src/devices/bus/vic20/vic1210.c (renamed from src/emu/bus/vic20/vic1210.c)0
-rw-r--r--src/devices/bus/vic20/vic1210.h (renamed from src/emu/bus/vic20/vic1210.h)0
-rw-r--r--src/devices/bus/vidbrain/exp.c (renamed from src/emu/bus/vidbrain/exp.c)0
-rw-r--r--src/devices/bus/vidbrain/exp.h (renamed from src/emu/bus/vidbrain/exp.h)0
-rw-r--r--src/devices/bus/vidbrain/money_minder.c (renamed from src/emu/bus/vidbrain/money_minder.c)0
-rw-r--r--src/devices/bus/vidbrain/money_minder.h (renamed from src/emu/bus/vidbrain/money_minder.h)0
-rw-r--r--src/devices/bus/vidbrain/std.c (renamed from src/emu/bus/vidbrain/std.c)0
-rw-r--r--src/devices/bus/vidbrain/std.h (renamed from src/emu/bus/vidbrain/std.h)0
-rw-r--r--src/devices/bus/vidbrain/timeshare.c (renamed from src/emu/bus/vidbrain/timeshare.c)0
-rw-r--r--src/devices/bus/vidbrain/timeshare.h (renamed from src/emu/bus/vidbrain/timeshare.h)0
-rw-r--r--src/devices/bus/vip/byteio.c (renamed from src/emu/bus/vip/byteio.c)0
-rw-r--r--src/devices/bus/vip/byteio.h (renamed from src/emu/bus/vip/byteio.h)0
-rw-r--r--src/devices/bus/vip/exp.c (renamed from src/emu/bus/vip/exp.c)0
-rw-r--r--src/devices/bus/vip/exp.h (renamed from src/emu/bus/vip/exp.h)0
-rw-r--r--src/devices/bus/vip/vp550.c (renamed from src/emu/bus/vip/vp550.c)0
-rw-r--r--src/devices/bus/vip/vp550.h (renamed from src/emu/bus/vip/vp550.h)0
-rw-r--r--src/devices/bus/vip/vp570.c (renamed from src/emu/bus/vip/vp570.c)0
-rw-r--r--src/devices/bus/vip/vp570.h (renamed from src/emu/bus/vip/vp570.h)0
-rw-r--r--src/devices/bus/vip/vp575.c (renamed from src/emu/bus/vip/vp575.c)0
-rw-r--r--src/devices/bus/vip/vp575.h (renamed from src/emu/bus/vip/vp575.h)0
-rw-r--r--src/devices/bus/vip/vp585.c (renamed from src/emu/bus/vip/vp585.c)0
-rw-r--r--src/devices/bus/vip/vp585.h (renamed from src/emu/bus/vip/vp585.h)0
-rw-r--r--src/devices/bus/vip/vp590.c (renamed from src/emu/bus/vip/vp590.c)0
-rw-r--r--src/devices/bus/vip/vp590.h (renamed from src/emu/bus/vip/vp590.h)0
-rw-r--r--src/devices/bus/vip/vp595.c (renamed from src/emu/bus/vip/vp595.c)0
-rw-r--r--src/devices/bus/vip/vp595.h (renamed from src/emu/bus/vip/vp595.h)0
-rw-r--r--src/devices/bus/vip/vp620.c (renamed from src/emu/bus/vip/vp620.c)0
-rw-r--r--src/devices/bus/vip/vp620.h (renamed from src/emu/bus/vip/vp620.h)0
-rw-r--r--src/devices/bus/vip/vp700.c (renamed from src/emu/bus/vip/vp700.c)0
-rw-r--r--src/devices/bus/vip/vp700.h (renamed from src/emu/bus/vip/vp700.h)0
-rw-r--r--src/devices/bus/vtech/ioexp/carts.c (renamed from src/emu/bus/vtech/ioexp/carts.c)0
-rw-r--r--src/devices/bus/vtech/ioexp/carts.h (renamed from src/emu/bus/vtech/ioexp/carts.h)0
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.c (renamed from src/emu/bus/vtech/ioexp/ioexp.c)0
-rw-r--r--src/devices/bus/vtech/ioexp/ioexp.h (renamed from src/emu/bus/vtech/ioexp/ioexp.h)0
-rw-r--r--src/devices/bus/vtech/ioexp/joystick.c (renamed from src/emu/bus/vtech/ioexp/joystick.c)0
-rw-r--r--src/devices/bus/vtech/ioexp/joystick.h (renamed from src/emu/bus/vtech/ioexp/joystick.h)0
-rw-r--r--src/devices/bus/vtech/ioexp/printer.c (renamed from src/emu/bus/vtech/ioexp/printer.c)0
-rw-r--r--src/devices/bus/vtech/ioexp/printer.h (renamed from src/emu/bus/vtech/ioexp/printer.h)0
-rw-r--r--src/devices/bus/vtech/memexp/carts.c (renamed from src/emu/bus/vtech/memexp/carts.c)0
-rw-r--r--src/devices/bus/vtech/memexp/carts.h (renamed from src/emu/bus/vtech/memexp/carts.h)0
-rw-r--r--src/devices/bus/vtech/memexp/floppy.c (renamed from src/emu/bus/vtech/memexp/floppy.c)0
-rw-r--r--src/devices/bus/vtech/memexp/floppy.h (renamed from src/emu/bus/vtech/memexp/floppy.h)0
-rw-r--r--src/devices/bus/vtech/memexp/memexp.c (renamed from src/emu/bus/vtech/memexp/memexp.c)0
-rw-r--r--src/devices/bus/vtech/memexp/memexp.h (renamed from src/emu/bus/vtech/memexp/memexp.h)0
-rw-r--r--src/devices/bus/vtech/memexp/memory.c (renamed from src/emu/bus/vtech/memexp/memory.c)0
-rw-r--r--src/devices/bus/vtech/memexp/memory.h (renamed from src/emu/bus/vtech/memexp/memory.h)0
-rw-r--r--src/devices/bus/vtech/memexp/rs232.c (renamed from src/emu/bus/vtech/memexp/rs232.c)0
-rw-r--r--src/devices/bus/vtech/memexp/rs232.h (renamed from src/emu/bus/vtech/memexp/rs232.h)0
-rw-r--r--src/devices/bus/vtech/memexp/wordpro.c (renamed from src/emu/bus/vtech/memexp/wordpro.c)0
-rw-r--r--src/devices/bus/vtech/memexp/wordpro.h (renamed from src/emu/bus/vtech/memexp/wordpro.h)0
-rw-r--r--src/devices/bus/wangpc/emb.c (renamed from src/emu/bus/wangpc/emb.c)0
-rw-r--r--src/devices/bus/wangpc/emb.h (renamed from src/emu/bus/wangpc/emb.h)0
-rw-r--r--src/devices/bus/wangpc/lic.c (renamed from src/emu/bus/wangpc/lic.c)0
-rw-r--r--src/devices/bus/wangpc/lic.h (renamed from src/emu/bus/wangpc/lic.h)0
-rw-r--r--src/devices/bus/wangpc/lvc.c (renamed from src/emu/bus/wangpc/lvc.c)0
-rw-r--r--src/devices/bus/wangpc/lvc.h (renamed from src/emu/bus/wangpc/lvc.h)0
-rw-r--r--src/devices/bus/wangpc/mcc.c (renamed from src/emu/bus/wangpc/mcc.c)0
-rw-r--r--src/devices/bus/wangpc/mcc.h (renamed from src/emu/bus/wangpc/mcc.h)0
-rw-r--r--src/devices/bus/wangpc/mvc.c (renamed from src/emu/bus/wangpc/mvc.c)0
-rw-r--r--src/devices/bus/wangpc/mvc.h (renamed from src/emu/bus/wangpc/mvc.h)0
-rw-r--r--src/devices/bus/wangpc/rtc.c (renamed from src/emu/bus/wangpc/rtc.c)0
-rw-r--r--src/devices/bus/wangpc/rtc.h (renamed from src/emu/bus/wangpc/rtc.h)0
-rw-r--r--src/devices/bus/wangpc/tig.c (renamed from src/emu/bus/wangpc/tig.c)0
-rw-r--r--src/devices/bus/wangpc/tig.h (renamed from src/emu/bus/wangpc/tig.h)0
-rw-r--r--src/devices/bus/wangpc/wangpc.c (renamed from src/emu/bus/wangpc/wangpc.c)0
-rw-r--r--src/devices/bus/wangpc/wangpc.h (renamed from src/emu/bus/wangpc/wangpc.h)0
-rw-r--r--src/devices/bus/wangpc/wdc.c (renamed from src/emu/bus/wangpc/wdc.c)0
-rw-r--r--src/devices/bus/wangpc/wdc.h (renamed from src/emu/bus/wangpc/wdc.h)0
-rw-r--r--src/devices/bus/wswan/rom.c (renamed from src/emu/bus/wswan/rom.c)0
-rw-r--r--src/devices/bus/wswan/rom.h (renamed from src/emu/bus/wswan/rom.h)0
-rw-r--r--src/devices/bus/wswan/slot.c (renamed from src/emu/bus/wswan/slot.c)0
-rw-r--r--src/devices/bus/wswan/slot.h (renamed from src/emu/bus/wswan/slot.h)0
-rw-r--r--src/devices/bus/x68k/x68k_neptunex.c (renamed from src/emu/bus/x68k/x68k_neptunex.c)0
-rw-r--r--src/devices/bus/x68k/x68k_neptunex.h (renamed from src/emu/bus/x68k/x68k_neptunex.h)0
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.c (renamed from src/emu/bus/x68k/x68k_scsiext.c)0
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.h (renamed from src/emu/bus/x68k/x68k_scsiext.h)0
-rw-r--r--src/devices/bus/x68k/x68kexp.c (renamed from src/emu/bus/x68k/x68kexp.c)0
-rw-r--r--src/devices/bus/x68k/x68kexp.h (renamed from src/emu/bus/x68k/x68kexp.h)0
-rw-r--r--src/devices/bus/z88/flash.c (renamed from src/emu/bus/z88/flash.c)0
-rw-r--r--src/devices/bus/z88/flash.h (renamed from src/emu/bus/z88/flash.h)0
-rw-r--r--src/devices/bus/z88/ram.c (renamed from src/emu/bus/z88/ram.c)0
-rw-r--r--src/devices/bus/z88/ram.h (renamed from src/emu/bus/z88/ram.h)0
-rw-r--r--src/devices/bus/z88/rom.c (renamed from src/emu/bus/z88/rom.c)0
-rw-r--r--src/devices/bus/z88/rom.h (renamed from src/emu/bus/z88/rom.h)0
-rw-r--r--src/devices/bus/z88/z88.c (renamed from src/emu/bus/z88/z88.c)0
-rw-r--r--src/devices/bus/z88/z88.h (renamed from src/emu/bus/z88/z88.h)0
-rw-r--r--src/devices/cpu/8x300/8x300.c (renamed from src/emu/cpu/8x300/8x300.c)0
-rw-r--r--src/devices/cpu/8x300/8x300.h (renamed from src/emu/cpu/8x300/8x300.h)0
-rw-r--r--src/devices/cpu/8x300/8x300dasm.c (renamed from src/emu/cpu/8x300/8x300dasm.c)0
-rw-r--r--src/devices/cpu/adsp2100/2100dasm.c (renamed from src/emu/cpu/adsp2100/2100dasm.c)0
-rw-r--r--src/devices/cpu/adsp2100/2100ops.inc (renamed from src/emu/cpu/adsp2100/2100ops.inc)0
-rw-r--r--src/devices/cpu/adsp2100/adsp2100.c (renamed from src/emu/cpu/adsp2100/adsp2100.c)0
-rw-r--r--src/devices/cpu/adsp2100/adsp2100.h (renamed from src/emu/cpu/adsp2100/adsp2100.h)0
-rw-r--r--src/devices/cpu/alph8201/8201dasm.c (renamed from src/emu/cpu/alph8201/8201dasm.c)0
-rw-r--r--src/devices/cpu/alph8201/alph8201.c (renamed from src/emu/cpu/alph8201/alph8201.c)0
-rw-r--r--src/devices/cpu/alph8201/alph8201.h (renamed from src/emu/cpu/alph8201/alph8201.h)0
-rw-r--r--src/devices/cpu/alto2/a2curt.c (renamed from src/emu/cpu/alto2/a2curt.c)0
-rw-r--r--src/devices/cpu/alto2/a2curt.h (renamed from src/emu/cpu/alto2/a2curt.h)0
-rw-r--r--src/devices/cpu/alto2/a2dht.c (renamed from src/emu/cpu/alto2/a2dht.c)0
-rw-r--r--src/devices/cpu/alto2/a2dht.h (renamed from src/emu/cpu/alto2/a2dht.h)0
-rw-r--r--src/devices/cpu/alto2/a2disk.c (renamed from src/emu/cpu/alto2/a2disk.c)0
-rw-r--r--src/devices/cpu/alto2/a2disk.h (renamed from src/emu/cpu/alto2/a2disk.h)0
-rw-r--r--src/devices/cpu/alto2/a2disp.c (renamed from src/emu/cpu/alto2/a2disp.c)0
-rw-r--r--src/devices/cpu/alto2/a2disp.h (renamed from src/emu/cpu/alto2/a2disp.h)0
-rw-r--r--src/devices/cpu/alto2/a2dvt.c (renamed from src/emu/cpu/alto2/a2dvt.c)0
-rw-r--r--src/devices/cpu/alto2/a2dvt.h (renamed from src/emu/cpu/alto2/a2dvt.h)0
-rw-r--r--src/devices/cpu/alto2/a2dwt.c (renamed from src/emu/cpu/alto2/a2dwt.c)0
-rw-r--r--src/devices/cpu/alto2/a2dwt.h (renamed from src/emu/cpu/alto2/a2dwt.h)0
-rw-r--r--src/devices/cpu/alto2/a2emu.c (renamed from src/emu/cpu/alto2/a2emu.c)0
-rw-r--r--src/devices/cpu/alto2/a2emu.h (renamed from src/emu/cpu/alto2/a2emu.h)0
-rw-r--r--src/devices/cpu/alto2/a2ether.c (renamed from src/emu/cpu/alto2/a2ether.c)0
-rw-r--r--src/devices/cpu/alto2/a2ether.h (renamed from src/emu/cpu/alto2/a2ether.h)0
-rw-r--r--src/devices/cpu/alto2/a2hw.c (renamed from src/emu/cpu/alto2/a2hw.c)0
-rw-r--r--src/devices/cpu/alto2/a2hw.h (renamed from src/emu/cpu/alto2/a2hw.h)0
-rw-r--r--src/devices/cpu/alto2/a2jkff.h (renamed from src/emu/cpu/alto2/a2jkff.h)0
-rw-r--r--src/devices/cpu/alto2/a2kbd.c (renamed from src/emu/cpu/alto2/a2kbd.c)0
-rw-r--r--src/devices/cpu/alto2/a2kbd.h (renamed from src/emu/cpu/alto2/a2kbd.h)0
-rw-r--r--src/devices/cpu/alto2/a2ksec.c (renamed from src/emu/cpu/alto2/a2ksec.c)0
-rw-r--r--src/devices/cpu/alto2/a2ksec.h (renamed from src/emu/cpu/alto2/a2ksec.h)0
-rw-r--r--src/devices/cpu/alto2/a2kwd.c (renamed from src/emu/cpu/alto2/a2kwd.c)0
-rw-r--r--src/devices/cpu/alto2/a2kwd.h (renamed from src/emu/cpu/alto2/a2kwd.h)0
-rw-r--r--src/devices/cpu/alto2/a2mem.c (renamed from src/emu/cpu/alto2/a2mem.c)0
-rw-r--r--src/devices/cpu/alto2/a2mem.h (renamed from src/emu/cpu/alto2/a2mem.h)0
-rw-r--r--src/devices/cpu/alto2/a2mouse.c (renamed from src/emu/cpu/alto2/a2mouse.c)0
-rw-r--r--src/devices/cpu/alto2/a2mouse.h (renamed from src/emu/cpu/alto2/a2mouse.h)0
-rw-r--r--src/devices/cpu/alto2/a2mrt.c (renamed from src/emu/cpu/alto2/a2mrt.c)0
-rw-r--r--src/devices/cpu/alto2/a2mrt.h (renamed from src/emu/cpu/alto2/a2mrt.h)0
-rw-r--r--src/devices/cpu/alto2/a2part.c (renamed from src/emu/cpu/alto2/a2part.c)0
-rw-r--r--src/devices/cpu/alto2/a2part.h (renamed from src/emu/cpu/alto2/a2part.h)0
-rw-r--r--src/devices/cpu/alto2/a2ram.c (renamed from src/emu/cpu/alto2/a2ram.c)0
-rw-r--r--src/devices/cpu/alto2/a2ram.h (renamed from src/emu/cpu/alto2/a2ram.h)0
-rw-r--r--src/devices/cpu/alto2/a2roms.c (renamed from src/emu/cpu/alto2/a2roms.c)0
-rw-r--r--src/devices/cpu/alto2/a2roms.h (renamed from src/emu/cpu/alto2/a2roms.h)0
-rw-r--r--src/devices/cpu/alto2/alto2cpu.c (renamed from src/emu/cpu/alto2/alto2cpu.c)0
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h (renamed from src/emu/cpu/alto2/alto2cpu.h)0
-rw-r--r--src/devices/cpu/alto2/alto2dsm.c (renamed from src/emu/cpu/alto2/alto2dsm.c)0
-rw-r--r--src/devices/cpu/am29000/am29000.c (renamed from src/emu/cpu/am29000/am29000.c)0
-rw-r--r--src/devices/cpu/am29000/am29000.h (renamed from src/emu/cpu/am29000/am29000.h)0
-rw-r--r--src/devices/cpu/am29000/am29dasm.c (renamed from src/emu/cpu/am29000/am29dasm.c)0
-rw-r--r--src/devices/cpu/am29000/am29ops.h (renamed from src/emu/cpu/am29000/am29ops.h)0
-rw-r--r--src/devices/cpu/amis2000/amis2000.c (renamed from src/emu/cpu/amis2000/amis2000.c)0
-rw-r--r--src/devices/cpu/amis2000/amis2000.h (renamed from src/emu/cpu/amis2000/amis2000.h)0
-rw-r--r--src/devices/cpu/amis2000/amis2000d.c (renamed from src/emu/cpu/amis2000/amis2000d.c)0
-rw-r--r--src/devices/cpu/amis2000/amis2000op.c (renamed from src/emu/cpu/amis2000/amis2000op.c)0
-rw-r--r--src/devices/cpu/apexc/apexc.c (renamed from src/emu/cpu/apexc/apexc.c)0
-rw-r--r--src/devices/cpu/apexc/apexc.h (renamed from src/emu/cpu/apexc/apexc.h)0
-rw-r--r--src/devices/cpu/apexc/apexcdsm.c (renamed from src/emu/cpu/apexc/apexcdsm.c)0
-rw-r--r--src/devices/cpu/arc/arc.c (renamed from src/emu/cpu/arc/arc.c)0
-rw-r--r--src/devices/cpu/arc/arc.h (renamed from src/emu/cpu/arc/arc.h)0
-rw-r--r--src/devices/cpu/arc/arcdasm.c (renamed from src/emu/cpu/arc/arcdasm.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompact.c (renamed from src/emu/cpu/arcompact/arcompact.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompact.h (renamed from src/emu/cpu/arcompact/arcompact.h)0
-rw-r--r--src/devices/cpu/arcompact/arcompact_common.c (renamed from src/emu/cpu/arcompact/arcompact_common.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompact_common.h (renamed from src/emu/cpu/arcompact/arcompact_common.h)0
-rw-r--r--src/devices/cpu/arcompact/arcompact_execute.c (renamed from src/emu/cpu/arcompact/arcompact_execute.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompact_make.py434
-rw-r--r--src/devices/cpu/arcompact/arcompactdasm.c (renamed from src/emu/cpu/arcompact/arcompactdasm.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompactdasm_dispatch.c (renamed from src/emu/cpu/arcompact/arcompactdasm_dispatch.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompactdasm_dispatch.h (renamed from src/emu/cpu/arcompact/arcompactdasm_dispatch.h)0
-rw-r--r--src/devices/cpu/arcompact/arcompactdasm_ops.c (renamed from src/emu/cpu/arcompact/arcompactdasm_ops.c)0
-rw-r--r--src/devices/cpu/arcompact/arcompactdasm_ops.h (renamed from src/emu/cpu/arcompact/arcompactdasm_ops.h)0
-rw-r--r--src/devices/cpu/arm/arm.c (renamed from src/emu/cpu/arm/arm.c)0
-rw-r--r--src/devices/cpu/arm/arm.h (renamed from src/emu/cpu/arm/arm.h)0
-rw-r--r--src/devices/cpu/arm/armdasm.c (renamed from src/emu/cpu/arm/armdasm.c)0
-rw-r--r--src/devices/cpu/arm7/arm7.c (renamed from src/emu/cpu/arm7/arm7.c)0
-rw-r--r--src/devices/cpu/arm7/arm7.h (renamed from src/emu/cpu/arm7/arm7.h)0
-rw-r--r--src/devices/cpu/arm7/arm7core.h (renamed from src/emu/cpu/arm7/arm7core.h)0
-rw-r--r--src/devices/cpu/arm7/arm7core.inc (renamed from src/emu/cpu/arm7/arm7core.inc)0
-rw-r--r--src/devices/cpu/arm7/arm7dasm.c (renamed from src/emu/cpu/arm7/arm7dasm.c)0
-rw-r--r--src/devices/cpu/arm7/arm7drc.inc (renamed from src/emu/cpu/arm7/arm7drc.inc)0
-rw-r--r--src/devices/cpu/arm7/arm7help.h (renamed from src/emu/cpu/arm7/arm7help.h)0
-rw-r--r--src/devices/cpu/arm7/arm7ops.c (renamed from src/emu/cpu/arm7/arm7ops.c)0
-rw-r--r--src/devices/cpu/arm7/arm7tdrc.inc (renamed from src/emu/cpu/arm7/arm7tdrc.inc)0
-rw-r--r--src/devices/cpu/arm7/arm7thmb.c (renamed from src/emu/cpu/arm7/arm7thmb.c)0
-rw-r--r--src/devices/cpu/asap/asap.c (renamed from src/emu/cpu/asap/asap.c)0
-rw-r--r--src/devices/cpu/asap/asap.h (renamed from src/emu/cpu/asap/asap.h)0
-rw-r--r--src/devices/cpu/asap/asapdasm.c (renamed from src/emu/cpu/asap/asapdasm.c)0
-rw-r--r--src/devices/cpu/avr8/avr8.c (renamed from src/emu/cpu/avr8/avr8.c)18
-rw-r--r--src/devices/cpu/avr8/avr8.h (renamed from src/emu/cpu/avr8/avr8.h)18
-rw-r--r--src/devices/cpu/avr8/avr8dasm.c (renamed from src/emu/cpu/avr8/avr8dasm.c)2
-rw-r--r--src/devices/cpu/ccpu/ccpu.c (renamed from src/emu/cpu/ccpu/ccpu.c)0
-rw-r--r--src/devices/cpu/ccpu/ccpu.h (renamed from src/emu/cpu/ccpu/ccpu.h)0
-rw-r--r--src/devices/cpu/ccpu/ccpudasm.c (renamed from src/emu/cpu/ccpu/ccpudasm.c)0
-rw-r--r--src/devices/cpu/cop400/cop400.c (renamed from src/emu/cpu/cop400/cop400.c)0
-rw-r--r--src/devices/cpu/cop400/cop400.h (renamed from src/emu/cpu/cop400/cop400.h)0
-rw-r--r--src/devices/cpu/cop400/cop400op.inc (renamed from src/emu/cpu/cop400/cop400op.inc)0
-rw-r--r--src/devices/cpu/cop400/cop410ds.c (renamed from src/emu/cpu/cop400/cop410ds.c)0
-rw-r--r--src/devices/cpu/cop400/cop420ds.c (renamed from src/emu/cpu/cop400/cop420ds.c)0
-rw-r--r--src/devices/cpu/cop400/cop440ds.c (renamed from src/emu/cpu/cop400/cop440ds.c)0
-rw-r--r--src/devices/cpu/cosmac/cosdasm.c (renamed from src/emu/cpu/cosmac/cosdasm.c)0
-rw-r--r--src/devices/cpu/cosmac/cosmac.c (renamed from src/emu/cpu/cosmac/cosmac.c)0
-rw-r--r--src/devices/cpu/cosmac/cosmac.h (renamed from src/emu/cpu/cosmac/cosmac.h)0
-rw-r--r--src/devices/cpu/cp1610/1610dasm.c (renamed from src/emu/cpu/cp1610/1610dasm.c)0
-rw-r--r--src/devices/cpu/cp1610/cp1610.c (renamed from src/emu/cpu/cp1610/cp1610.c)0
-rw-r--r--src/devices/cpu/cp1610/cp1610.h (renamed from src/emu/cpu/cp1610/cp1610.h)0
-rw-r--r--src/devices/cpu/cubeqcpu/cubedasm.c (renamed from src/emu/cpu/cubeqcpu/cubedasm.c)0
-rw-r--r--src/devices/cpu/cubeqcpu/cubeqcpu.c (renamed from src/emu/cpu/cubeqcpu/cubeqcpu.c)0
-rw-r--r--src/devices/cpu/cubeqcpu/cubeqcpu.h (renamed from src/emu/cpu/cubeqcpu/cubeqcpu.h)0
-rw-r--r--src/devices/cpu/drcbec.c (renamed from src/emu/cpu/drcbec.c)0
-rw-r--r--src/devices/cpu/drcbec.h (renamed from src/emu/cpu/drcbec.h)0
-rw-r--r--src/devices/cpu/drcbeut.c (renamed from src/emu/cpu/drcbeut.c)0
-rw-r--r--src/devices/cpu/drcbeut.h (renamed from src/emu/cpu/drcbeut.h)0
-rw-r--r--src/devices/cpu/drcbex64.c (renamed from src/emu/cpu/drcbex64.c)0
-rw-r--r--src/devices/cpu/drcbex64.h (renamed from src/emu/cpu/drcbex64.h)0
-rw-r--r--src/devices/cpu/drcbex86.c (renamed from src/emu/cpu/drcbex86.c)0
-rw-r--r--src/devices/cpu/drcbex86.h (renamed from src/emu/cpu/drcbex86.h)0
-rw-r--r--src/devices/cpu/drccache.c (renamed from src/emu/cpu/drccache.c)0
-rw-r--r--src/devices/cpu/drccache.h (renamed from src/emu/cpu/drccache.h)0
-rw-r--r--src/devices/cpu/drcfe.c (renamed from src/emu/cpu/drcfe.c)0
-rw-r--r--src/devices/cpu/drcfe.h (renamed from src/emu/cpu/drcfe.h)0
-rw-r--r--src/devices/cpu/drcuml.c (renamed from src/emu/cpu/drcuml.c)0
-rw-r--r--src/devices/cpu/drcuml.h (renamed from src/emu/cpu/drcuml.h)0
-rw-r--r--src/devices/cpu/drcumlsh.h (renamed from src/emu/cpu/drcumlsh.h)0
-rw-r--r--src/devices/cpu/dsp16/dsp16.c (renamed from src/emu/cpu/dsp16/dsp16.c)0
-rw-r--r--src/devices/cpu/dsp16/dsp16.h (renamed from src/emu/cpu/dsp16/dsp16.h)0
-rw-r--r--src/devices/cpu/dsp16/dsp16dis.c (renamed from src/emu/cpu/dsp16/dsp16dis.c)0
-rw-r--r--src/devices/cpu/dsp16/dsp16ops.inc (renamed from src/emu/cpu/dsp16/dsp16ops.inc)0
-rw-r--r--src/devices/cpu/dsp32/dsp32.c (renamed from src/emu/cpu/dsp32/dsp32.c)0
-rw-r--r--src/devices/cpu/dsp32/dsp32.h (renamed from src/emu/cpu/dsp32/dsp32.h)0
-rw-r--r--src/devices/cpu/dsp32/dsp32dis.c (renamed from src/emu/cpu/dsp32/dsp32dis.c)0
-rw-r--r--src/devices/cpu/dsp32/dsp32ops.inc (renamed from src/emu/cpu/dsp32/dsp32ops.inc)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56def.h (renamed from src/emu/cpu/dsp56k/dsp56def.h)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56dsm.c (renamed from src/emu/cpu/dsp56k/dsp56dsm.c)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56k.c (renamed from src/emu/cpu/dsp56k/dsp56k.c)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56k.h (renamed from src/emu/cpu/dsp56k/dsp56k.h)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56mem.c (renamed from src/emu/cpu/dsp56k/dsp56mem.c)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56mem.h (renamed from src/emu/cpu/dsp56k/dsp56mem.h)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56ops.inc (renamed from src/emu/cpu/dsp56k/dsp56ops.inc)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56pcu.c (renamed from src/emu/cpu/dsp56k/dsp56pcu.c)0
-rw-r--r--src/devices/cpu/dsp56k/dsp56pcu.h (renamed from src/emu/cpu/dsp56k/dsp56pcu.h)0
-rw-r--r--src/devices/cpu/dsp56k/inst.c (renamed from src/emu/cpu/dsp56k/inst.c)0
-rw-r--r--src/devices/cpu/dsp56k/inst.h (renamed from src/emu/cpu/dsp56k/inst.h)0
-rw-r--r--src/devices/cpu/dsp56k/opcode.c (renamed from src/emu/cpu/dsp56k/opcode.c)0
-rw-r--r--src/devices/cpu/dsp56k/opcode.h (renamed from src/emu/cpu/dsp56k/opcode.h)0
-rw-r--r--src/devices/cpu/dsp56k/pmove.c (renamed from src/emu/cpu/dsp56k/pmove.c)0
-rw-r--r--src/devices/cpu/dsp56k/pmove.h (renamed from src/emu/cpu/dsp56k/pmove.h)0
-rw-r--r--src/devices/cpu/dsp56k/tables.c (renamed from src/emu/cpu/dsp56k/tables.c)0
-rw-r--r--src/devices/cpu/dsp56k/tables.h (renamed from src/emu/cpu/dsp56k/tables.h)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6200.c (renamed from src/emu/cpu/e0c6200/e0c6200.c)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6200.h (renamed from src/emu/cpu/e0c6200/e0c6200.h)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6200d.c (renamed from src/emu/cpu/e0c6200/e0c6200d.c)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6200op.inc (renamed from src/emu/cpu/e0c6200/e0c6200op.inc)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.c (renamed from src/emu/cpu/e0c6200/e0c6s46.c)0
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.h (renamed from src/emu/cpu/e0c6200/e0c6s46.h)0
-rw-r--r--src/devices/cpu/e132xs/32xsdasm.c (renamed from src/emu/cpu/e132xs/32xsdasm.c)0
-rw-r--r--src/devices/cpu/e132xs/e132xs.c (renamed from src/emu/cpu/e132xs/e132xs.c)16
-rw-r--r--src/devices/cpu/e132xs/e132xs.h (renamed from src/emu/cpu/e132xs/e132xs.h)0
-rw-r--r--src/devices/cpu/e132xs/e132xsop.inc (renamed from src/emu/cpu/e132xs/e132xsop.inc)0
-rw-r--r--src/devices/cpu/es5510/es5510.c (renamed from src/emu/cpu/es5510/es5510.c)0
-rw-r--r--src/devices/cpu/es5510/es5510.h (renamed from src/emu/cpu/es5510/es5510.h)0
-rw-r--r--src/devices/cpu/esrip/esrip.c (renamed from src/emu/cpu/esrip/esrip.c)0
-rw-r--r--src/devices/cpu/esrip/esrip.h (renamed from src/emu/cpu/esrip/esrip.h)0
-rw-r--r--src/devices/cpu/esrip/esripdsm.c (renamed from src/emu/cpu/esrip/esripdsm.c)0
-rw-r--r--src/devices/cpu/f8/f8.c (renamed from src/emu/cpu/f8/f8.c)0
-rw-r--r--src/devices/cpu/f8/f8.h (renamed from src/emu/cpu/f8/f8.h)0
-rw-r--r--src/devices/cpu/f8/f8dasm.c (renamed from src/emu/cpu/f8/f8dasm.c)0
-rw-r--r--src/devices/cpu/g65816/g65816.c (renamed from src/emu/cpu/g65816/g65816.c)0
-rw-r--r--src/devices/cpu/g65816/g65816.h (renamed from src/emu/cpu/g65816/g65816.h)0
-rw-r--r--src/devices/cpu/g65816/g65816cm.h (renamed from src/emu/cpu/g65816/g65816cm.h)0
-rw-r--r--src/devices/cpu/g65816/g65816ds.c (renamed from src/emu/cpu/g65816/g65816ds.c)0
-rw-r--r--src/devices/cpu/g65816/g65816ds.h (renamed from src/emu/cpu/g65816/g65816ds.h)0
-rw-r--r--src/devices/cpu/g65816/g65816o0.c (renamed from src/emu/cpu/g65816/g65816o0.c)0
-rw-r--r--src/devices/cpu/g65816/g65816o1.c (renamed from src/emu/cpu/g65816/g65816o1.c)0
-rw-r--r--src/devices/cpu/g65816/g65816o2.c (renamed from src/emu/cpu/g65816/g65816o2.c)0
-rw-r--r--src/devices/cpu/g65816/g65816o3.c (renamed from src/emu/cpu/g65816/g65816o3.c)0
-rw-r--r--src/devices/cpu/g65816/g65816o4.c (renamed from src/emu/cpu/g65816/g65816o4.c)0
-rw-r--r--src/devices/cpu/g65816/g65816op.h (renamed from src/emu/cpu/g65816/g65816op.h)0
-rw-r--r--src/devices/cpu/h6280/6280dasm.c (renamed from src/emu/cpu/h6280/6280dasm.c)5
-rw-r--r--src/devices/cpu/h6280/h6280.c (renamed from src/emu/cpu/h6280/h6280.c)0
-rw-r--r--src/devices/cpu/h6280/h6280.h (renamed from src/emu/cpu/h6280/h6280.h)0
-rw-r--r--src/devices/cpu/h8/h8.c (renamed from src/emu/cpu/h8/h8.c)0
-rw-r--r--src/devices/cpu/h8/h8.h (renamed from src/emu/cpu/h8/h8.h)0
-rw-r--r--src/devices/cpu/h8/h8.lst (renamed from src/emu/cpu/h8/h8.lst)0
-rw-r--r--src/devices/cpu/h8/h83002.c (renamed from src/emu/cpu/h8/h83002.c)0
-rw-r--r--src/devices/cpu/h8/h83002.h (renamed from src/emu/cpu/h8/h83002.h)0
-rw-r--r--src/devices/cpu/h8/h83006.c (renamed from src/emu/cpu/h8/h83006.c)0
-rw-r--r--src/devices/cpu/h8/h83006.h (renamed from src/emu/cpu/h8/h83006.h)0
-rw-r--r--src/devices/cpu/h8/h83008.c (renamed from src/emu/cpu/h8/h83008.c)0
-rw-r--r--src/devices/cpu/h8/h83008.h (renamed from src/emu/cpu/h8/h83008.h)0
-rw-r--r--src/devices/cpu/h8/h83048.c (renamed from src/emu/cpu/h8/h83048.c)0
-rw-r--r--src/devices/cpu/h8/h83048.h (renamed from src/emu/cpu/h8/h83048.h)0
-rw-r--r--src/devices/cpu/h8/h83337.c (renamed from src/emu/cpu/h8/h83337.c)0
-rw-r--r--src/devices/cpu/h8/h83337.h (renamed from src/emu/cpu/h8/h83337.h)0
-rw-r--r--src/devices/cpu/h8/h8_adc.c (renamed from src/emu/cpu/h8/h8_adc.c)0
-rw-r--r--src/devices/cpu/h8/h8_adc.h (renamed from src/emu/cpu/h8/h8_adc.h)0
-rw-r--r--src/devices/cpu/h8/h8_intc.c (renamed from src/emu/cpu/h8/h8_intc.c)0
-rw-r--r--src/devices/cpu/h8/h8_intc.h (renamed from src/emu/cpu/h8/h8_intc.h)0
-rw-r--r--src/devices/cpu/h8/h8_port.c (renamed from src/emu/cpu/h8/h8_port.c)0
-rw-r--r--src/devices/cpu/h8/h8_port.h (renamed from src/emu/cpu/h8/h8_port.h)0
-rw-r--r--src/devices/cpu/h8/h8_sci.c (renamed from src/emu/cpu/h8/h8_sci.c)0
-rw-r--r--src/devices/cpu/h8/h8_sci.h (renamed from src/emu/cpu/h8/h8_sci.h)0
-rw-r--r--src/devices/cpu/h8/h8_timer16.c (renamed from src/emu/cpu/h8/h8_timer16.c)2
-rw-r--r--src/devices/cpu/h8/h8_timer16.h (renamed from src/emu/cpu/h8/h8_timer16.h)0
-rw-r--r--src/devices/cpu/h8/h8_timer8.c (renamed from src/emu/cpu/h8/h8_timer8.c)0
-rw-r--r--src/devices/cpu/h8/h8_timer8.h (renamed from src/emu/cpu/h8/h8_timer8.h)0
-rw-r--r--src/devices/cpu/h8/h8h.c (renamed from src/emu/cpu/h8/h8h.c)0
-rw-r--r--src/devices/cpu/h8/h8h.h (renamed from src/emu/cpu/h8/h8h.h)0
-rw-r--r--src/devices/cpu/h8/h8make.py (renamed from src/emu/cpu/h8/h8make.py)118
-rw-r--r--src/devices/cpu/h8/h8s2000.c (renamed from src/emu/cpu/h8/h8s2000.c)0
-rw-r--r--src/devices/cpu/h8/h8s2000.h (renamed from src/emu/cpu/h8/h8s2000.h)0
-rw-r--r--src/devices/cpu/h8/h8s2245.c (renamed from src/emu/cpu/h8/h8s2245.c)0
-rw-r--r--src/devices/cpu/h8/h8s2245.h (renamed from src/emu/cpu/h8/h8s2245.h)0
-rw-r--r--src/devices/cpu/h8/h8s2320.c (renamed from src/emu/cpu/h8/h8s2320.c)0
-rw-r--r--src/devices/cpu/h8/h8s2320.h (renamed from src/emu/cpu/h8/h8s2320.h)0
-rw-r--r--src/devices/cpu/h8/h8s2357.c (renamed from src/emu/cpu/h8/h8s2357.c)0
-rw-r--r--src/devices/cpu/h8/h8s2357.h (renamed from src/emu/cpu/h8/h8s2357.h)0
-rw-r--r--src/devices/cpu/h8/h8s2600.c (renamed from src/emu/cpu/h8/h8s2600.c)0
-rw-r--r--src/devices/cpu/h8/h8s2600.h (renamed from src/emu/cpu/h8/h8s2600.h)0
-rw-r--r--src/devices/cpu/h8/h8s2655.c (renamed from src/emu/cpu/h8/h8s2655.c)0
-rw-r--r--src/devices/cpu/h8/h8s2655.h (renamed from src/emu/cpu/h8/h8s2655.h)0
-rw-r--r--src/devices/cpu/hcd62121/hcd62121.c (renamed from src/emu/cpu/hcd62121/hcd62121.c)0
-rw-r--r--src/devices/cpu/hcd62121/hcd62121.h (renamed from src/emu/cpu/hcd62121/hcd62121.h)0
-rw-r--r--src/devices/cpu/hcd62121/hcd62121_ops.h (renamed from src/emu/cpu/hcd62121/hcd62121_ops.h)0
-rw-r--r--src/devices/cpu/hcd62121/hcd62121d.c (renamed from src/emu/cpu/hcd62121/hcd62121d.c)0
-rw-r--r--src/devices/cpu/hd61700/hd61700.c (renamed from src/emu/cpu/hd61700/hd61700.c)0
-rw-r--r--src/devices/cpu/hd61700/hd61700.h (renamed from src/emu/cpu/hd61700/hd61700.h)0
-rw-r--r--src/devices/cpu/hd61700/hd61700d.c (renamed from src/emu/cpu/hd61700/hd61700d.c)0
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.c (renamed from src/emu/cpu/hmcs40/hmcs40.c)0
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.h (renamed from src/emu/cpu/hmcs40/hmcs40.h)0
-rw-r--r--src/devices/cpu/hmcs40/hmcs40d.c (renamed from src/emu/cpu/hmcs40/hmcs40d.c)0
-rw-r--r--src/devices/cpu/hmcs40/hmcs40op.c (renamed from src/emu/cpu/hmcs40/hmcs40op.c)0
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.c961
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.h (renamed from src/emu/cpu/hphybrid/hphybrid.h)4
-rw-r--r--src/devices/cpu/hphybrid/hphybrid_dasm.c (renamed from src/emu/cpu/hphybrid/hphybrid_dasm.c)0
-rw-r--r--src/devices/cpu/i386/cycles.h (renamed from src/emu/cpu/i386/cycles.h)0
-rw-r--r--src/devices/cpu/i386/i386.c (renamed from src/emu/cpu/i386/i386.c)0
-rw-r--r--src/devices/cpu/i386/i386.h (renamed from src/emu/cpu/i386/i386.h)0
-rw-r--r--src/devices/cpu/i386/i386dasm.c (renamed from src/emu/cpu/i386/i386dasm.c)0
-rw-r--r--src/devices/cpu/i386/i386op16.inc (renamed from src/emu/cpu/i386/i386op16.inc)0
-rw-r--r--src/devices/cpu/i386/i386op32.inc (renamed from src/emu/cpu/i386/i386op32.inc)0
-rw-r--r--src/devices/cpu/i386/i386ops.h (renamed from src/emu/cpu/i386/i386ops.h)0
-rw-r--r--src/devices/cpu/i386/i386ops.inc (renamed from src/emu/cpu/i386/i386ops.inc)0
-rw-r--r--src/devices/cpu/i386/i386priv.h (renamed from src/emu/cpu/i386/i386priv.h)0
-rw-r--r--src/devices/cpu/i386/i486ops.inc (renamed from src/emu/cpu/i386/i486ops.inc)0
-rw-r--r--src/devices/cpu/i386/pentops.inc (renamed from src/emu/cpu/i386/pentops.inc)0
-rw-r--r--src/devices/cpu/i386/x87ops.inc (renamed from src/emu/cpu/i386/x87ops.inc)0
-rw-r--r--src/devices/cpu/i4004/4004dasm.c (renamed from src/emu/cpu/i4004/4004dasm.c)0
-rw-r--r--src/devices/cpu/i4004/i4004.c (renamed from src/emu/cpu/i4004/i4004.c)0
-rw-r--r--src/devices/cpu/i4004/i4004.h (renamed from src/emu/cpu/i4004/i4004.h)0
-rw-r--r--src/devices/cpu/i8008/8008dasm.c (renamed from src/emu/cpu/i8008/8008dasm.c)0
-rw-r--r--src/devices/cpu/i8008/i8008.c (renamed from src/emu/cpu/i8008/i8008.c)0
-rw-r--r--src/devices/cpu/i8008/i8008.h (renamed from src/emu/cpu/i8008/i8008.h)0
-rw-r--r--src/devices/cpu/i8085/8085dasm.c (renamed from src/emu/cpu/i8085/8085dasm.c)0
-rw-r--r--src/devices/cpu/i8085/i8085.c (renamed from src/emu/cpu/i8085/i8085.c)0
-rw-r--r--src/devices/cpu/i8085/i8085.h (renamed from src/emu/cpu/i8085/i8085.h)0
-rw-r--r--src/devices/cpu/i8085/i8085cpu.h (renamed from src/emu/cpu/i8085/i8085cpu.h)0
-rw-r--r--src/devices/cpu/i8089/i8089.c (renamed from src/emu/cpu/i8089/i8089.c)0
-rw-r--r--src/devices/cpu/i8089/i8089.h (renamed from src/emu/cpu/i8089/i8089.h)0
-rw-r--r--src/devices/cpu/i8089/i8089_channel.c (renamed from src/emu/cpu/i8089/i8089_channel.c)0
-rw-r--r--src/devices/cpu/i8089/i8089_channel.h (renamed from src/emu/cpu/i8089/i8089_channel.h)0
-rw-r--r--src/devices/cpu/i8089/i8089_dasm.c (renamed from src/emu/cpu/i8089/i8089_dasm.c)0
-rw-r--r--src/devices/cpu/i8089/i8089_ops.c (renamed from src/emu/cpu/i8089/i8089_ops.c)0
-rw-r--r--src/devices/cpu/i86/i186.c (renamed from src/emu/cpu/i86/i186.c)0
-rw-r--r--src/devices/cpu/i86/i186.h (renamed from src/emu/cpu/i86/i186.h)0
-rw-r--r--src/devices/cpu/i86/i286.c (renamed from src/emu/cpu/i86/i286.c)0
-rw-r--r--src/devices/cpu/i86/i286.h (renamed from src/emu/cpu/i86/i286.h)0
-rw-r--r--src/devices/cpu/i86/i86.c (renamed from src/emu/cpu/i86/i86.c)0
-rw-r--r--src/devices/cpu/i86/i86.h (renamed from src/emu/cpu/i86/i86.h)0
-rw-r--r--src/devices/cpu/i86/i86.txt (renamed from src/emu/cpu/i86/i86.txt)0
-rw-r--r--src/devices/cpu/i86/i86inline.h (renamed from src/emu/cpu/i86/i86inline.h)0
-rw-r--r--src/devices/cpu/i860/i860.c (renamed from src/emu/cpu/i860/i860.c)0
-rw-r--r--src/devices/cpu/i860/i860.h (renamed from src/emu/cpu/i860/i860.h)0
-rw-r--r--src/devices/cpu/i860/i860dasm.c (renamed from src/emu/cpu/i860/i860dasm.c)0
-rw-r--r--src/devices/cpu/i860/i860dec.inc (renamed from src/emu/cpu/i860/i860dec.inc)0
-rw-r--r--src/devices/cpu/i860/i860dis.c (renamed from src/emu/cpu/i860/i860dis.c)0
-rw-r--r--src/devices/cpu/i960/i960.c (renamed from src/emu/cpu/i960/i960.c)0
-rw-r--r--src/devices/cpu/i960/i960.h (renamed from src/emu/cpu/i960/i960.h)0
-rw-r--r--src/devices/cpu/i960/i960dis.c (renamed from src/emu/cpu/i960/i960dis.c)0
-rw-r--r--src/devices/cpu/i960/i960dis.h (renamed from src/emu/cpu/i960/i960dis.h)0
-rw-r--r--src/devices/cpu/ie15/ie15.c (renamed from src/emu/cpu/ie15/ie15.c)0
-rw-r--r--src/devices/cpu/ie15/ie15.h (renamed from src/emu/cpu/ie15/ie15.h)0
-rw-r--r--src/devices/cpu/ie15/ie15dasm.c (renamed from src/emu/cpu/ie15/ie15dasm.c)0
-rw-r--r--src/devices/cpu/jaguar/jagdasm.c (renamed from src/emu/cpu/jaguar/jagdasm.c)0
-rw-r--r--src/devices/cpu/jaguar/jaguar.c (renamed from src/emu/cpu/jaguar/jaguar.c)0
-rw-r--r--src/devices/cpu/jaguar/jaguar.h (renamed from src/emu/cpu/jaguar/jaguar.h)0
-rw-r--r--src/devices/cpu/lc8670/lc8670.c (renamed from src/emu/cpu/lc8670/lc8670.c)6
-rw-r--r--src/devices/cpu/lc8670/lc8670.h (renamed from src/emu/cpu/lc8670/lc8670.h)0
-rw-r--r--src/devices/cpu/lc8670/lc8670dsm.c (renamed from src/emu/cpu/lc8670/lc8670dsm.c)0
-rw-r--r--src/devices/cpu/lh5801/5801dasm.c (renamed from src/emu/cpu/lh5801/5801dasm.c)0
-rw-r--r--src/devices/cpu/lh5801/5801tbl.inc (renamed from src/emu/cpu/lh5801/5801tbl.inc)0
-rw-r--r--src/devices/cpu/lh5801/lh5801.c (renamed from src/emu/cpu/lh5801/lh5801.c)0
-rw-r--r--src/devices/cpu/lh5801/lh5801.h (renamed from src/emu/cpu/lh5801/lh5801.h)0
-rw-r--r--src/devices/cpu/lr35902/lr35902.c (renamed from src/emu/cpu/lr35902/lr35902.c)0
-rw-r--r--src/devices/cpu/lr35902/lr35902.h (renamed from src/emu/cpu/lr35902/lr35902.h)0
-rw-r--r--src/devices/cpu/lr35902/lr35902d.c (renamed from src/emu/cpu/lr35902/lr35902d.c)0
-rw-r--r--src/devices/cpu/lr35902/opc_cb.inc (renamed from src/emu/cpu/lr35902/opc_cb.inc)0
-rw-r--r--src/devices/cpu/lr35902/opc_main.inc (renamed from src/emu/cpu/lr35902/opc_main.inc)0
-rw-r--r--src/devices/cpu/m37710/m37710.c (renamed from src/emu/cpu/m37710/m37710.c)0
-rw-r--r--src/devices/cpu/m37710/m37710.h (renamed from src/emu/cpu/m37710/m37710.h)0
-rw-r--r--src/devices/cpu/m37710/m37710cm.h (renamed from src/emu/cpu/m37710/m37710cm.h)0
-rw-r--r--src/devices/cpu/m37710/m37710il.h (renamed from src/emu/cpu/m37710/m37710il.h)0
-rw-r--r--src/devices/cpu/m37710/m37710o0.c (renamed from src/emu/cpu/m37710/m37710o0.c)0
-rw-r--r--src/devices/cpu/m37710/m37710o1.c (renamed from src/emu/cpu/m37710/m37710o1.c)0
-rw-r--r--src/devices/cpu/m37710/m37710o2.c (renamed from src/emu/cpu/m37710/m37710o2.c)0
-rw-r--r--src/devices/cpu/m37710/m37710o3.c (renamed from src/emu/cpu/m37710/m37710o3.c)0
-rw-r--r--src/devices/cpu/m37710/m37710op.h (renamed from src/emu/cpu/m37710/m37710op.h)0
-rw-r--r--src/devices/cpu/m37710/m7700ds.c (renamed from src/emu/cpu/m37710/m7700ds.c)0
-rw-r--r--src/devices/cpu/m37710/m7700ds.h (renamed from src/emu/cpu/m37710/m7700ds.h)0
-rw-r--r--src/devices/cpu/m6502/ddeco16.lst (renamed from src/emu/cpu/m6502/ddeco16.lst)0
-rw-r--r--src/devices/cpu/m6502/deco16.c (renamed from src/emu/cpu/m6502/deco16.c)0
-rw-r--r--src/devices/cpu/m6502/deco16.h (renamed from src/emu/cpu/m6502/deco16.h)0
-rw-r--r--src/devices/cpu/m6502/dm4510.lst (renamed from src/emu/cpu/m6502/dm4510.lst)0
-rw-r--r--src/devices/cpu/m6502/dm6502.lst (renamed from src/emu/cpu/m6502/dm6502.lst)0
-rw-r--r--src/devices/cpu/m6502/dm6509.lst (renamed from src/emu/cpu/m6502/dm6509.lst)0
-rw-r--r--src/devices/cpu/m6502/dm6510.lst (renamed from src/emu/cpu/m6502/dm6510.lst)0
-rw-r--r--src/devices/cpu/m6502/dm65c02.lst (renamed from src/emu/cpu/m6502/dm65c02.lst)0
-rw-r--r--src/devices/cpu/m6502/dm65ce02.lst (renamed from src/emu/cpu/m6502/dm65ce02.lst)0
-rw-r--r--src/devices/cpu/m6502/dm740.lst (renamed from src/emu/cpu/m6502/dm740.lst)0
-rw-r--r--src/devices/cpu/m6502/dn2a03.lst (renamed from src/emu/cpu/m6502/dn2a03.lst)0
-rw-r--r--src/devices/cpu/m6502/dr65c02.lst (renamed from src/emu/cpu/m6502/dr65c02.lst)0
-rw-r--r--src/devices/cpu/m6502/m3745x.c (renamed from src/emu/cpu/m6502/m3745x.c)0
-rw-r--r--src/devices/cpu/m6502/m3745x.h (renamed from src/emu/cpu/m6502/m3745x.h)0
-rw-r--r--src/devices/cpu/m6502/m4510.c (renamed from src/emu/cpu/m6502/m4510.c)0
-rw-r--r--src/devices/cpu/m6502/m4510.h (renamed from src/emu/cpu/m6502/m4510.h)0
-rw-r--r--src/devices/cpu/m6502/m5074x.c (renamed from src/emu/cpu/m6502/m5074x.c)0
-rw-r--r--src/devices/cpu/m6502/m5074x.h (renamed from src/emu/cpu/m6502/m5074x.h)0
-rw-r--r--src/devices/cpu/m6502/m6502.c (renamed from src/emu/cpu/m6502/m6502.c)0
-rw-r--r--src/devices/cpu/m6502/m6502.h (renamed from src/emu/cpu/m6502/m6502.h)0
-rw-r--r--src/devices/cpu/m6502/m6502.txt (renamed from src/emu/cpu/m6502/m6502.txt)0
-rwxr-xr-xsrc/devices/cpu/m6502/m6502make.py (renamed from src/emu/cpu/m6502/m6502make.py)6
-rw-r--r--src/devices/cpu/m6502/m6504.c (renamed from src/emu/cpu/m6502/m6504.c)0
-rw-r--r--src/devices/cpu/m6502/m6504.h (renamed from src/emu/cpu/m6502/m6504.h)0
-rw-r--r--src/devices/cpu/m6502/m6509.c (renamed from src/emu/cpu/m6502/m6509.c)0
-rw-r--r--src/devices/cpu/m6502/m6509.h (renamed from src/emu/cpu/m6502/m6509.h)0
-rw-r--r--src/devices/cpu/m6502/m6510.c (renamed from src/emu/cpu/m6502/m6510.c)0
-rw-r--r--src/devices/cpu/m6502/m6510.h (renamed from src/emu/cpu/m6502/m6510.h)0
-rw-r--r--src/devices/cpu/m6502/m6510t.c (renamed from src/emu/cpu/m6502/m6510t.c)0
-rw-r--r--src/devices/cpu/m6502/m6510t.h (renamed from src/emu/cpu/m6502/m6510t.h)0
-rw-r--r--src/devices/cpu/m6502/m65c02.c (renamed from src/emu/cpu/m6502/m65c02.c)0
-rw-r--r--src/devices/cpu/m6502/m65c02.h (renamed from src/emu/cpu/m6502/m65c02.h)0
-rw-r--r--src/devices/cpu/m6502/m65ce02.c (renamed from src/emu/cpu/m6502/m65ce02.c)0
-rw-r--r--src/devices/cpu/m6502/m65ce02.h (renamed from src/emu/cpu/m6502/m65ce02.h)0
-rw-r--r--src/devices/cpu/m6502/m65sc02.c (renamed from src/emu/cpu/m6502/m65sc02.c)0
-rw-r--r--src/devices/cpu/m6502/m65sc02.h (renamed from src/emu/cpu/m6502/m65sc02.h)0
-rw-r--r--src/devices/cpu/m6502/m740.c (renamed from src/emu/cpu/m6502/m740.c)0
-rw-r--r--src/devices/cpu/m6502/m740.h (renamed from src/emu/cpu/m6502/m740.h)0
-rw-r--r--src/devices/cpu/m6502/m7501.c (renamed from src/emu/cpu/m6502/m7501.c)0
-rw-r--r--src/devices/cpu/m6502/m7501.h (renamed from src/emu/cpu/m6502/m7501.h)0
-rw-r--r--src/devices/cpu/m6502/m8502.c (renamed from src/emu/cpu/m6502/m8502.c)0
-rw-r--r--src/devices/cpu/m6502/m8502.h (renamed from src/emu/cpu/m6502/m8502.h)0
-rw-r--r--src/devices/cpu/m6502/n2a03.c (renamed from src/emu/cpu/m6502/n2a03.c)0
-rw-r--r--src/devices/cpu/m6502/n2a03.h (renamed from src/emu/cpu/m6502/n2a03.h)0
-rw-r--r--src/devices/cpu/m6502/odeco16.lst (renamed from src/emu/cpu/m6502/odeco16.lst)0
-rw-r--r--src/devices/cpu/m6502/om4510.lst (renamed from src/emu/cpu/m6502/om4510.lst)0
-rw-r--r--src/devices/cpu/m6502/om6502.lst (renamed from src/emu/cpu/m6502/om6502.lst)0
-rw-r--r--src/devices/cpu/m6502/om6509.lst (renamed from src/emu/cpu/m6502/om6509.lst)0
-rw-r--r--src/devices/cpu/m6502/om6510.lst (renamed from src/emu/cpu/m6502/om6510.lst)0
-rw-r--r--src/devices/cpu/m6502/om65c02.lst (renamed from src/emu/cpu/m6502/om65c02.lst)0
-rw-r--r--src/devices/cpu/m6502/om65ce02.lst (renamed from src/emu/cpu/m6502/om65ce02.lst)0
-rw-r--r--src/devices/cpu/m6502/om740.lst (renamed from src/emu/cpu/m6502/om740.lst)0
-rw-r--r--src/devices/cpu/m6502/on2a03.lst (renamed from src/emu/cpu/m6502/on2a03.lst)0
-rw-r--r--src/devices/cpu/m6502/r65c02.c (renamed from src/emu/cpu/m6502/r65c02.c)0
-rw-r--r--src/devices/cpu/m6502/r65c02.h (renamed from src/emu/cpu/m6502/r65c02.h)0
-rw-r--r--src/devices/cpu/m6800/6800dasm.c (renamed from src/emu/cpu/m6800/6800dasm.c)0
-rw-r--r--src/devices/cpu/m6800/6800ops.inc (renamed from src/emu/cpu/m6800/6800ops.inc)0
-rw-r--r--src/devices/cpu/m6800/6800tbl.inc (renamed from src/emu/cpu/m6800/6800tbl.inc)0
-rw-r--r--src/devices/cpu/m6800/m6800.c (renamed from src/emu/cpu/m6800/m6800.c)0
-rw-r--r--src/devices/cpu/m6800/m6800.h (renamed from src/emu/cpu/m6800/m6800.h)0
-rw-r--r--src/devices/cpu/m68000/m68000.h (renamed from src/emu/cpu/m68000/m68000.h)0
-rw-r--r--src/devices/cpu/m68000/m68k_in.c (renamed from src/emu/cpu/m68000/m68k_in.c)37
-rw-r--r--src/devices/cpu/m68000/m68kcpu.c (renamed from src/emu/cpu/m68000/m68kcpu.c)12
-rw-r--r--src/devices/cpu/m68000/m68kcpu.h (renamed from src/emu/cpu/m68000/m68kcpu.h)0
-rw-r--r--src/devices/cpu/m68000/m68kdasm.c (renamed from src/emu/cpu/m68000/m68kdasm.c)0
-rw-r--r--src/devices/cpu/m68000/m68kfpu.inc (renamed from src/emu/cpu/m68000/m68kfpu.inc)6
-rw-r--r--src/devices/cpu/m68000/m68kmake.c (renamed from src/emu/cpu/m68000/m68kmake.c)0
-rw-r--r--src/devices/cpu/m68000/m68kmmu.h (renamed from src/emu/cpu/m68000/m68kmmu.h)0
-rw-r--r--src/devices/cpu/m68000/m68kops.c (renamed from src/emu/cpu/m68000/m68kops.c)90
-rw-r--r--src/devices/cpu/m68000/m68kops.h (renamed from src/emu/cpu/m68000/m68kops.h)0
-rw-r--r--src/devices/cpu/m68000/makefile (renamed from src/emu/cpu/m68000/makefile)0
-rw-r--r--src/devices/cpu/m6805/6805dasm.c (renamed from src/emu/cpu/m6805/6805dasm.c)0
-rw-r--r--src/devices/cpu/m6805/6805ops.inc (renamed from src/emu/cpu/m6805/6805ops.inc)0
-rw-r--r--src/devices/cpu/m6805/m6805.c (renamed from src/emu/cpu/m6805/m6805.c)0
-rw-r--r--src/devices/cpu/m6805/m6805.h (renamed from src/emu/cpu/m6805/m6805.h)0
-rw-r--r--src/devices/cpu/m6809/6309dasm.c (renamed from src/emu/cpu/m6809/6309dasm.c)0
-rw-r--r--src/devices/cpu/m6809/6809dasm.c (renamed from src/emu/cpu/m6809/6809dasm.c)0
-rw-r--r--src/devices/cpu/m6809/base6x09.ops (renamed from src/emu/cpu/m6809/base6x09.ops)0
-rw-r--r--src/devices/cpu/m6809/hd6309.c (renamed from src/emu/cpu/m6809/hd6309.c)0
-rw-r--r--src/devices/cpu/m6809/hd6309.h (renamed from src/emu/cpu/m6809/hd6309.h)0
-rw-r--r--src/devices/cpu/m6809/hd6309.ops (renamed from src/emu/cpu/m6809/hd6309.ops)0
-rw-r--r--src/devices/cpu/m6809/knmidasm.c (renamed from src/emu/cpu/m6809/knmidasm.c)0
-rw-r--r--src/devices/cpu/m6809/konami.c (renamed from src/emu/cpu/m6809/konami.c)0
-rw-r--r--src/devices/cpu/m6809/konami.h (renamed from src/emu/cpu/m6809/konami.h)0
-rw-r--r--src/devices/cpu/m6809/konami.ops (renamed from src/emu/cpu/m6809/konami.ops)0
-rw-r--r--src/devices/cpu/m6809/m6809.c (renamed from src/emu/cpu/m6809/m6809.c)0
-rw-r--r--src/devices/cpu/m6809/m6809.h (renamed from src/emu/cpu/m6809/m6809.h)0
-rw-r--r--src/devices/cpu/m6809/m6809.ops (renamed from src/emu/cpu/m6809/m6809.ops)0
-rw-r--r--src/devices/cpu/m6809/m6809inl.h (renamed from src/emu/cpu/m6809/m6809inl.h)0
-rw-r--r--src/devices/cpu/m6809/m6809make.py (renamed from src/emu/cpu/m6809/m6809make.py)0
-rw-r--r--src/devices/cpu/mb86233/mb86233.c (renamed from src/emu/cpu/mb86233/mb86233.c)0
-rw-r--r--src/devices/cpu/mb86233/mb86233.h (renamed from src/emu/cpu/mb86233/mb86233.h)0
-rw-r--r--src/devices/cpu/mb86233/mb86233d.c (renamed from src/emu/cpu/mb86233/mb86233d.c)0
-rw-r--r--src/devices/cpu/mb86235/mb86235.c (renamed from src/emu/cpu/mb86235/mb86235.c)0
-rw-r--r--src/devices/cpu/mb86235/mb86235.h (renamed from src/emu/cpu/mb86235/mb86235.h)0
-rw-r--r--src/devices/cpu/mb86235/mb86235d.c (renamed from src/emu/cpu/mb86235/mb86235d.c)0
-rw-r--r--src/devices/cpu/mb88xx/mb88dasm.c (renamed from src/emu/cpu/mb88xx/mb88dasm.c)0
-rw-r--r--src/devices/cpu/mb88xx/mb88xx.c (renamed from src/emu/cpu/mb88xx/mb88xx.c)0
-rw-r--r--src/devices/cpu/mb88xx/mb88xx.h (renamed from src/emu/cpu/mb88xx/mb88xx.h)0
-rw-r--r--src/devices/cpu/mc68hc11/hc11dasm.c (renamed from src/emu/cpu/mc68hc11/hc11dasm.c)0
-rw-r--r--src/devices/cpu/mc68hc11/hc11ops.h (renamed from src/emu/cpu/mc68hc11/hc11ops.h)0
-rw-r--r--src/devices/cpu/mc68hc11/hc11ops.inc (renamed from src/emu/cpu/mc68hc11/hc11ops.inc)0
-rw-r--r--src/devices/cpu/mc68hc11/mc68hc11.c (renamed from src/emu/cpu/mc68hc11/mc68hc11.c)0
-rw-r--r--src/devices/cpu/mc68hc11/mc68hc11.h (renamed from src/emu/cpu/mc68hc11/mc68hc11.h)0
-rw-r--r--src/devices/cpu/mcs48/mcs48.c (renamed from src/emu/cpu/mcs48/mcs48.c)0
-rw-r--r--src/devices/cpu/mcs48/mcs48.h (renamed from src/emu/cpu/mcs48/mcs48.h)0
-rw-r--r--src/devices/cpu/mcs48/mcs48dsm.c (renamed from src/emu/cpu/mcs48/mcs48dsm.c)0
-rw-r--r--src/devices/cpu/mcs51/mcs51.c (renamed from src/emu/cpu/mcs51/mcs51.c)0
-rw-r--r--src/devices/cpu/mcs51/mcs51.h (renamed from src/emu/cpu/mcs51/mcs51.h)0
-rw-r--r--src/devices/cpu/mcs51/mcs51dasm.c (renamed from src/emu/cpu/mcs51/mcs51dasm.c)0
-rw-r--r--src/devices/cpu/mcs51/mcs51ops.inc (renamed from src/emu/cpu/mcs51/mcs51ops.inc)0
-rw-r--r--src/devices/cpu/mcs96/i8x9x.c (renamed from src/emu/cpu/mcs96/i8x9x.c)0
-rw-r--r--src/devices/cpu/mcs96/i8x9x.h (renamed from src/emu/cpu/mcs96/i8x9x.h)0
-rw-r--r--src/devices/cpu/mcs96/i8xc196.c (renamed from src/emu/cpu/mcs96/i8xc196.c)0
-rw-r--r--src/devices/cpu/mcs96/i8xc196.h (renamed from src/emu/cpu/mcs96/i8xc196.h)0
-rw-r--r--src/devices/cpu/mcs96/mcs96.c (renamed from src/emu/cpu/mcs96/mcs96.c)0
-rw-r--r--src/devices/cpu/mcs96/mcs96.h (renamed from src/emu/cpu/mcs96/mcs96.h)0
-rw-r--r--src/devices/cpu/mcs96/mcs96make.py (renamed from src/emu/cpu/mcs96/mcs96make.py)40
-rw-r--r--src/devices/cpu/mcs96/mcs96ops.lst (renamed from src/emu/cpu/mcs96/mcs96ops.lst)0
-rw-r--r--src/devices/cpu/melps4/m58846.c (renamed from src/emu/cpu/melps4/m58846.c)0
-rw-r--r--src/devices/cpu/melps4/m58846.h (renamed from src/emu/cpu/melps4/m58846.h)0
-rw-r--r--src/devices/cpu/melps4/melps4.c (renamed from src/emu/cpu/melps4/melps4.c)0
-rw-r--r--src/devices/cpu/melps4/melps4.h (renamed from src/emu/cpu/melps4/melps4.h)0
-rw-r--r--src/devices/cpu/melps4/melps4d.c (renamed from src/emu/cpu/melps4/melps4d.c)0
-rw-r--r--src/devices/cpu/melps4/melps4op.c (renamed from src/emu/cpu/melps4/melps4op.c)0
-rw-r--r--src/devices/cpu/minx/minx.c (renamed from src/emu/cpu/minx/minx.c)0
-rw-r--r--src/devices/cpu/minx/minx.h (renamed from src/emu/cpu/minx/minx.h)0
-rw-r--r--src/devices/cpu/minx/minxd.c (renamed from src/emu/cpu/minx/minxd.c)0
-rw-r--r--src/devices/cpu/minx/minxfunc.h (renamed from src/emu/cpu/minx/minxfunc.h)0
-rw-r--r--src/devices/cpu/minx/minxopce.h (renamed from src/emu/cpu/minx/minxopce.h)0
-rw-r--r--src/devices/cpu/minx/minxopcf.h (renamed from src/emu/cpu/minx/minxopcf.h)0
-rw-r--r--src/devices/cpu/minx/minxops.h (renamed from src/emu/cpu/minx/minxops.h)0
-rw-r--r--src/devices/cpu/mips/mips3.c (renamed from src/emu/cpu/mips/mips3.c)48
-rw-r--r--src/devices/cpu/mips/mips3.h (renamed from src/emu/cpu/mips/mips3.h)1
-rw-r--r--src/devices/cpu/mips/mips3com.c (renamed from src/emu/cpu/mips/mips3com.c)0
-rw-r--r--src/devices/cpu/mips/mips3com.h (renamed from src/emu/cpu/mips/mips3com.h)0
-rw-r--r--src/devices/cpu/mips/mips3drc.c (renamed from src/emu/cpu/mips/mips3drc.c)0
-rw-r--r--src/devices/cpu/mips/mips3dsm.c (renamed from src/emu/cpu/mips/mips3dsm.c)9
-rw-r--r--src/devices/cpu/mips/mips3fe.c (renamed from src/emu/cpu/mips/mips3fe.c)0
-rw-r--r--src/devices/cpu/mips/mips3fe.h (renamed from src/emu/cpu/mips/mips3fe.h)0
-rw-r--r--src/devices/cpu/mips/r3000.c (renamed from src/emu/cpu/mips/r3000.c)0
-rw-r--r--src/devices/cpu/mips/r3000.h (renamed from src/emu/cpu/mips/r3000.h)0
-rw-r--r--src/devices/cpu/mips/r3kdasm.c (renamed from src/emu/cpu/mips/r3kdasm.c)0
-rw-r--r--src/devices/cpu/mn10200/mn10200.c (renamed from src/emu/cpu/mn10200/mn10200.c)0
-rw-r--r--src/devices/cpu/mn10200/mn10200.h (renamed from src/emu/cpu/mn10200/mn10200.h)0
-rw-r--r--src/devices/cpu/mn10200/mn102dis.c (renamed from src/emu/cpu/mn10200/mn102dis.c)0
-rw-r--r--src/devices/cpu/nec/nec.c (renamed from src/emu/cpu/nec/nec.c)0
-rw-r--r--src/devices/cpu/nec/nec.h (renamed from src/emu/cpu/nec/nec.h)0
-rw-r--r--src/devices/cpu/nec/necdasm.c (renamed from src/emu/cpu/nec/necdasm.c)0
-rw-r--r--src/devices/cpu/nec/necea.h (renamed from src/emu/cpu/nec/necea.h)0
-rw-r--r--src/devices/cpu/nec/necinstr.h (renamed from src/emu/cpu/nec/necinstr.h)0
-rw-r--r--src/devices/cpu/nec/necinstr.inc (renamed from src/emu/cpu/nec/necinstr.inc)0
-rw-r--r--src/devices/cpu/nec/necmacro.h (renamed from src/emu/cpu/nec/necmacro.h)0
-rw-r--r--src/devices/cpu/nec/necmodrm.h (renamed from src/emu/cpu/nec/necmodrm.h)0
-rw-r--r--src/devices/cpu/nec/necpriv.h (renamed from src/emu/cpu/nec/necpriv.h)0
-rw-r--r--src/devices/cpu/nec/v25.c (renamed from src/emu/cpu/nec/v25.c)0
-rw-r--r--src/devices/cpu/nec/v25.h (renamed from src/emu/cpu/nec/v25.h)0
-rw-r--r--src/devices/cpu/nec/v25instr.h (renamed from src/emu/cpu/nec/v25instr.h)0
-rw-r--r--src/devices/cpu/nec/v25instr.inc (renamed from src/emu/cpu/nec/v25instr.inc)0
-rw-r--r--src/devices/cpu/nec/v25priv.h (renamed from src/emu/cpu/nec/v25priv.h)0
-rw-r--r--src/devices/cpu/nec/v25sfr.c (renamed from src/emu/cpu/nec/v25sfr.c)0
-rw-r--r--src/devices/cpu/nec/v53.c (renamed from src/emu/cpu/nec/v53.c)56
-rw-r--r--src/devices/cpu/nec/v53.h (renamed from src/emu/cpu/nec/v53.h)0
-rw-r--r--src/devices/cpu/pdp1/pdp1.c (renamed from src/emu/cpu/pdp1/pdp1.c)0
-rw-r--r--src/devices/cpu/pdp1/pdp1.h (renamed from src/emu/cpu/pdp1/pdp1.h)0
-rw-r--r--src/devices/cpu/pdp1/pdp1dasm.c (renamed from src/emu/cpu/pdp1/pdp1dasm.c)0
-rw-r--r--src/devices/cpu/pdp1/tx0.c (renamed from src/emu/cpu/pdp1/tx0.c)0
-rw-r--r--src/devices/cpu/pdp1/tx0.h (renamed from src/emu/cpu/pdp1/tx0.h)0
-rw-r--r--src/devices/cpu/pdp1/tx0dasm.c (renamed from src/emu/cpu/pdp1/tx0dasm.c)0
-rw-r--r--src/devices/cpu/pdp8/pdp8.c249
-rw-r--r--src/devices/cpu/pdp8/pdp8.h113
-rw-r--r--src/devices/cpu/pdp8/pdp8dasm.c174
-rw-r--r--src/devices/cpu/pic16c5x/16c5xdsm.c (renamed from src/emu/cpu/pic16c5x/16c5xdsm.c)0
-rw-r--r--src/devices/cpu/pic16c5x/dis16c5x.c (renamed from src/emu/cpu/pic16c5x/dis16c5x.c)0
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.c (renamed from src/emu/cpu/pic16c5x/pic16c5x.c)0
-rw-r--r--src/devices/cpu/pic16c5x/pic16c5x.h (renamed from src/emu/cpu/pic16c5x/pic16c5x.h)0
-rw-r--r--src/devices/cpu/pic16c62x/16c62xdsm.c (renamed from src/emu/cpu/pic16c62x/16c62xdsm.c)0
-rw-r--r--src/devices/cpu/pic16c62x/dis16c62x.c (renamed from src/emu/cpu/pic16c62x/dis16c62x.c)0
-rw-r--r--src/devices/cpu/pic16c62x/pic16c62x.c (renamed from src/emu/cpu/pic16c62x/pic16c62x.c)0
-rw-r--r--src/devices/cpu/pic16c62x/pic16c62x.h (renamed from src/emu/cpu/pic16c62x/pic16c62x.h)0
-rw-r--r--src/devices/cpu/powerpc/drc_ops.c (renamed from src/emu/cpu/powerpc/drc_ops.c)0
-rw-r--r--src/devices/cpu/powerpc/drc_ops.h (renamed from src/emu/cpu/powerpc/drc_ops.h)0
-rw-r--r--src/devices/cpu/powerpc/ppc.c (renamed from src/emu/cpu/powerpc/ppc.c)0
-rw-r--r--src/devices/cpu/powerpc/ppc.h (renamed from src/emu/cpu/powerpc/ppc.h)0
-rw-r--r--src/devices/cpu/powerpc/ppc403.inc (renamed from src/emu/cpu/powerpc/ppc403.inc)0
-rw-r--r--src/devices/cpu/powerpc/ppc602.inc (renamed from src/emu/cpu/powerpc/ppc602.inc)0
-rw-r--r--src/devices/cpu/powerpc/ppc603.inc (renamed from src/emu/cpu/powerpc/ppc603.inc)0
-rw-r--r--src/devices/cpu/powerpc/ppc_dasm.c (renamed from src/emu/cpu/powerpc/ppc_dasm.c)0
-rw-r--r--src/devices/cpu/powerpc/ppc_mem.inc (renamed from src/emu/cpu/powerpc/ppc_mem.inc)0
-rw-r--r--src/devices/cpu/powerpc/ppc_ops.h (renamed from src/emu/cpu/powerpc/ppc_ops.h)0
-rw-r--r--src/devices/cpu/powerpc/ppc_ops.inc (renamed from src/emu/cpu/powerpc/ppc_ops.inc)0
-rw-r--r--src/devices/cpu/powerpc/ppccom.c (renamed from src/emu/cpu/powerpc/ppccom.c)2
-rw-r--r--src/devices/cpu/powerpc/ppccom.h (renamed from src/emu/cpu/powerpc/ppccom.h)0
-rw-r--r--src/devices/cpu/powerpc/ppcdrc.c (renamed from src/emu/cpu/powerpc/ppcdrc.c)0
-rw-r--r--src/devices/cpu/powerpc/ppcfe.c (renamed from src/emu/cpu/powerpc/ppcfe.c)0
-rw-r--r--src/devices/cpu/powerpc/ppcfe.h (renamed from src/emu/cpu/powerpc/ppcfe.h)0
-rw-r--r--src/devices/cpu/pps4/pps4.c (renamed from src/emu/cpu/pps4/pps4.c)0
-rw-r--r--src/devices/cpu/pps4/pps4.h (renamed from src/emu/cpu/pps4/pps4.h)0
-rw-r--r--src/devices/cpu/pps4/pps4dasm.c (renamed from src/emu/cpu/pps4/pps4dasm.c)0
-rw-r--r--src/devices/cpu/psx/dismips.c (renamed from src/emu/cpu/psx/dismips.c)0
-rw-r--r--src/devices/cpu/psx/dismips.mak (renamed from src/emu/cpu/psx/dismips.mak)0
-rw-r--r--src/devices/cpu/psx/dma.c (renamed from src/emu/cpu/psx/dma.c)0
-rw-r--r--src/devices/cpu/psx/dma.h (renamed from src/emu/cpu/psx/dma.h)0
-rw-r--r--src/devices/cpu/psx/gte.c (renamed from src/emu/cpu/psx/gte.c)0
-rw-r--r--src/devices/cpu/psx/gte.h (renamed from src/emu/cpu/psx/gte.h)0
-rw-r--r--src/devices/cpu/psx/irq.c (renamed from src/emu/cpu/psx/irq.c)0
-rw-r--r--src/devices/cpu/psx/irq.h (renamed from src/emu/cpu/psx/irq.h)0
-rw-r--r--src/devices/cpu/psx/mdec.c (renamed from src/emu/cpu/psx/mdec.c)0
-rw-r--r--src/devices/cpu/psx/mdec.h (renamed from src/emu/cpu/psx/mdec.h)0
-rw-r--r--src/devices/cpu/psx/psx.c (renamed from src/emu/cpu/psx/psx.c)8
-rw-r--r--src/devices/cpu/psx/psx.h (renamed from src/emu/cpu/psx/psx.h)4
-rw-r--r--src/devices/cpu/psx/psxdasm.c (renamed from src/emu/cpu/psx/psxdasm.c)0
-rw-r--r--src/devices/cpu/psx/rcnt.c (renamed from src/emu/cpu/psx/rcnt.c)0
-rw-r--r--src/devices/cpu/psx/rcnt.h (renamed from src/emu/cpu/psx/rcnt.h)0
-rw-r--r--src/devices/cpu/psx/sio.c (renamed from src/emu/cpu/psx/sio.c)0
-rw-r--r--src/devices/cpu/psx/sio.h (renamed from src/emu/cpu/psx/sio.h)0
-rw-r--r--src/devices/cpu/rsp/clamp.h (renamed from src/emu/cpu/rsp/clamp.h)0
-rw-r--r--src/devices/cpu/rsp/rsp.c (renamed from src/emu/cpu/rsp/rsp.c)8
-rw-r--r--src/devices/cpu/rsp/rsp.h (renamed from src/emu/cpu/rsp/rsp.h)0
-rw-r--r--src/devices/cpu/rsp/rsp_dasm.c (renamed from src/emu/cpu/rsp/rsp_dasm.c)17
-rw-r--r--src/devices/cpu/rsp/rspcp2.c (renamed from src/emu/cpu/rsp/rspcp2.c)258
-rw-r--r--src/devices/cpu/rsp/rspcp2.h (renamed from src/emu/cpu/rsp/rspcp2.h)35
-rw-r--r--src/devices/cpu/rsp/rspcp2d.c (renamed from src/emu/cpu/rsp/rspcp2d.c)2
-rw-r--r--src/devices/cpu/rsp/rspcp2d.h (renamed from src/emu/cpu/rsp/rspcp2d.h)0
-rw-r--r--src/devices/cpu/rsp/rspdiv.h (renamed from src/emu/cpu/rsp/rspdiv.h)0
-rw-r--r--src/devices/cpu/rsp/rspdrc.c (renamed from src/emu/cpu/rsp/rspdrc.c)2
-rw-r--r--src/devices/cpu/rsp/rspfe.c (renamed from src/emu/cpu/rsp/rspfe.c)0
-rw-r--r--src/devices/cpu/rsp/rspfe.h (renamed from src/emu/cpu/rsp/rspfe.h)0
-rw-r--r--src/devices/cpu/rsp/vabs.h (renamed from src/emu/cpu/rsp/vabs.h)0
-rw-r--r--src/devices/cpu/rsp/vadd.h (renamed from src/emu/cpu/rsp/vadd.h)1
-rw-r--r--src/devices/cpu/rsp/vaddc.h (renamed from src/emu/cpu/rsp/vaddc.h)0
-rw-r--r--src/devices/cpu/rsp/vand.h (renamed from src/emu/cpu/rsp/vand.h)0
-rw-r--r--src/devices/cpu/rsp/vch.h (renamed from src/emu/cpu/rsp/vch.h)0
-rw-r--r--src/devices/cpu/rsp/vcl.h (renamed from src/emu/cpu/rsp/vcl.h)2
-rw-r--r--src/devices/cpu/rsp/vcmp.h (renamed from src/emu/cpu/rsp/vcmp.h)0
-rw-r--r--src/devices/cpu/rsp/vcr.h (renamed from src/emu/cpu/rsp/vcr.h)0
-rw-r--r--src/devices/cpu/rsp/vdivh.h (renamed from src/emu/cpu/rsp/vdivh.h)0
-rw-r--r--src/devices/cpu/rsp/vldst.h (renamed from src/emu/cpu/rsp/vldst.h)0
-rw-r--r--src/devices/cpu/rsp/vmac.h (renamed from src/emu/cpu/rsp/vmac.h)0
-rw-r--r--src/devices/cpu/rsp/vmov.h (renamed from src/emu/cpu/rsp/vmov.h)0
-rw-r--r--src/devices/cpu/rsp/vmrg.h (renamed from src/emu/cpu/rsp/vmrg.h)0
-rw-r--r--src/devices/cpu/rsp/vmudh.h (renamed from src/emu/cpu/rsp/vmudh.h)1
-rw-r--r--src/devices/cpu/rsp/vmul.h (renamed from src/emu/cpu/rsp/vmul.h)0
-rw-r--r--src/devices/cpu/rsp/vmulh.h (renamed from src/emu/cpu/rsp/vmulh.h)1
-rw-r--r--src/devices/cpu/rsp/vmull.h (renamed from src/emu/cpu/rsp/vmull.h)0
-rw-r--r--src/devices/cpu/rsp/vmulm.h (renamed from src/emu/cpu/rsp/vmulm.h)0
-rw-r--r--src/devices/cpu/rsp/vmuln.h (renamed from src/emu/cpu/rsp/vmuln.h)0
-rw-r--r--src/devices/cpu/rsp/vor.h (renamed from src/emu/cpu/rsp/vor.h)0
-rw-r--r--src/devices/cpu/rsp/vrcpsq.h (renamed from src/emu/cpu/rsp/vrcpsq.h)2
-rw-r--r--src/devices/cpu/rsp/vrsq.h (renamed from src/emu/cpu/rsp/vrsq.h)2
-rw-r--r--src/devices/cpu/rsp/vsub.h (renamed from src/emu/cpu/rsp/vsub.h)0
-rw-r--r--src/devices/cpu/rsp/vsubc.h (renamed from src/emu/cpu/rsp/vsubc.h)0
-rw-r--r--src/devices/cpu/rsp/vxor.h (renamed from src/emu/cpu/rsp/vxor.h)0
-rw-r--r--src/devices/cpu/s2650/2650dasm.c (renamed from src/emu/cpu/s2650/2650dasm.c)0
-rw-r--r--src/devices/cpu/s2650/s2650.c (renamed from src/emu/cpu/s2650/s2650.c)0
-rw-r--r--src/devices/cpu/s2650/s2650.h (renamed from src/emu/cpu/s2650/s2650.h)0
-rw-r--r--src/devices/cpu/s2650/s2650cpu.h (renamed from src/emu/cpu/s2650/s2650cpu.h)0
-rw-r--r--src/devices/cpu/saturn/satops.inc (renamed from src/emu/cpu/saturn/satops.inc)0
-rw-r--r--src/devices/cpu/saturn/sattable.inc (renamed from src/emu/cpu/saturn/sattable.inc)0
-rw-r--r--src/devices/cpu/saturn/saturn.c (renamed from src/emu/cpu/saturn/saturn.c)0
-rw-r--r--src/devices/cpu/saturn/saturn.h (renamed from src/emu/cpu/saturn/saturn.h)0
-rw-r--r--src/devices/cpu/saturn/saturnds.c (renamed from src/emu/cpu/saturn/saturnds.c)0
-rw-r--r--src/devices/cpu/sc61860/readpc.c (renamed from src/emu/cpu/sc61860/readpc.c)0
-rw-r--r--src/devices/cpu/sc61860/sc61860.c (renamed from src/emu/cpu/sc61860/sc61860.c)0
-rw-r--r--src/devices/cpu/sc61860/sc61860.h (renamed from src/emu/cpu/sc61860/sc61860.h)0
-rw-r--r--src/devices/cpu/sc61860/scdasm.c (renamed from src/emu/cpu/sc61860/scdasm.c)0
-rw-r--r--src/devices/cpu/sc61860/scops.inc (renamed from src/emu/cpu/sc61860/scops.inc)0
-rw-r--r--src/devices/cpu/sc61860/sctable.inc (renamed from src/emu/cpu/sc61860/sctable.inc)0
-rw-r--r--src/devices/cpu/scmp/scmp.c (renamed from src/emu/cpu/scmp/scmp.c)0
-rw-r--r--src/devices/cpu/scmp/scmp.h (renamed from src/emu/cpu/scmp/scmp.h)0
-rw-r--r--src/devices/cpu/scmp/scmpdasm.c (renamed from src/emu/cpu/scmp/scmpdasm.c)0
-rw-r--r--src/devices/cpu/score/score.c (renamed from src/emu/cpu/score/score.c)0
-rw-r--r--src/devices/cpu/score/score.h (renamed from src/emu/cpu/score/score.h)0
-rw-r--r--src/devices/cpu/score/scoredsm.c (renamed from src/emu/cpu/score/scoredsm.c)0
-rw-r--r--src/devices/cpu/score/scorem.h (renamed from src/emu/cpu/score/scorem.h)0
-rw-r--r--src/devices/cpu/scudsp/scudsp.c (renamed from src/emu/cpu/scudsp/scudsp.c)0
-rw-r--r--src/devices/cpu/scudsp/scudsp.h (renamed from src/emu/cpu/scudsp/scudsp.h)0
-rw-r--r--src/devices/cpu/scudsp/scudspdasm.c (renamed from src/emu/cpu/scudsp/scudspdasm.c)0
-rw-r--r--src/devices/cpu/se3208/se3208.c (renamed from src/emu/cpu/se3208/se3208.c)0
-rw-r--r--src/devices/cpu/se3208/se3208.h (renamed from src/emu/cpu/se3208/se3208.h)0
-rw-r--r--src/devices/cpu/se3208/se3208dis.c (renamed from src/emu/cpu/se3208/se3208dis.c)0
-rw-r--r--src/devices/cpu/sh2/sh2.c (renamed from src/emu/cpu/sh2/sh2.c)20
-rw-r--r--src/devices/cpu/sh2/sh2.h (renamed from src/emu/cpu/sh2/sh2.h)12
-rw-r--r--src/devices/cpu/sh2/sh2comn.c (renamed from src/emu/cpu/sh2/sh2comn.c)35
-rw-r--r--src/devices/cpu/sh2/sh2comn.h (renamed from src/emu/cpu/sh2/sh2comn.h)0
-rw-r--r--src/devices/cpu/sh2/sh2dasm.c (renamed from src/emu/cpu/sh2/sh2dasm.c)0
-rw-r--r--src/devices/cpu/sh2/sh2drc.c (renamed from src/emu/cpu/sh2/sh2drc.c)0
-rw-r--r--src/devices/cpu/sh2/sh2fe.c (renamed from src/emu/cpu/sh2/sh2fe.c)0
-rw-r--r--src/devices/cpu/sh4/sh3comn.c (renamed from src/emu/cpu/sh4/sh3comn.c)0
-rw-r--r--src/devices/cpu/sh4/sh3comn.h (renamed from src/emu/cpu/sh4/sh3comn.h)0
-rw-r--r--src/devices/cpu/sh4/sh4.c (renamed from src/emu/cpu/sh4/sh4.c)0
-rw-r--r--src/devices/cpu/sh4/sh4.h (renamed from src/emu/cpu/sh4/sh4.h)0
-rw-r--r--src/devices/cpu/sh4/sh4comn.c (renamed from src/emu/cpu/sh4/sh4comn.c)0
-rw-r--r--src/devices/cpu/sh4/sh4comn.h (renamed from src/emu/cpu/sh4/sh4comn.h)0
-rw-r--r--src/devices/cpu/sh4/sh4dasm.c (renamed from src/emu/cpu/sh4/sh4dasm.c)0
-rw-r--r--src/devices/cpu/sh4/sh4dmac.c (renamed from src/emu/cpu/sh4/sh4dmac.c)0
-rw-r--r--src/devices/cpu/sh4/sh4dmac.h (renamed from src/emu/cpu/sh4/sh4dmac.h)0
-rw-r--r--src/devices/cpu/sh4/sh4regs.h (renamed from src/emu/cpu/sh4/sh4regs.h)0
-rw-r--r--src/devices/cpu/sh4/sh4tmu.c (renamed from src/emu/cpu/sh4/sh4tmu.c)0
-rw-r--r--src/devices/cpu/sh4/sh4tmu.h (renamed from src/emu/cpu/sh4/sh4tmu.h)0
-rw-r--r--src/devices/cpu/sharc/compute.inc (renamed from src/emu/cpu/sharc/compute.inc)0
-rw-r--r--src/devices/cpu/sharc/sharc.c (renamed from src/emu/cpu/sharc/sharc.c)0
-rw-r--r--src/devices/cpu/sharc/sharc.h (renamed from src/emu/cpu/sharc/sharc.h)0
-rw-r--r--src/devices/cpu/sharc/sharcdma.inc (renamed from src/emu/cpu/sharc/sharcdma.inc)0
-rw-r--r--src/devices/cpu/sharc/sharcdsm.c (renamed from src/emu/cpu/sharc/sharcdsm.c)0
-rw-r--r--src/devices/cpu/sharc/sharcdsm.h (renamed from src/emu/cpu/sharc/sharcdsm.h)0
-rw-r--r--src/devices/cpu/sharc/sharcmem.inc (renamed from src/emu/cpu/sharc/sharcmem.inc)0
-rw-r--r--src/devices/cpu/sharc/sharcops.h (renamed from src/emu/cpu/sharc/sharcops.h)0
-rw-r--r--src/devices/cpu/sharc/sharcops.inc (renamed from src/emu/cpu/sharc/sharcops.inc)0
-rw-r--r--src/devices/cpu/sm510/sm510.c (renamed from src/emu/cpu/sm510/sm510.c)30
-rw-r--r--src/devices/cpu/sm510/sm510.h (renamed from src/emu/cpu/sm510/sm510.h)10
-rw-r--r--src/devices/cpu/sm510/sm510core.c (renamed from src/emu/cpu/sm510/sm510core.c)0
-rw-r--r--src/devices/cpu/sm510/sm510d.c (renamed from src/emu/cpu/sm510/sm510d.c)8
-rw-r--r--src/devices/cpu/sm510/sm510op.c (renamed from src/emu/cpu/sm510/sm510op.c)4
-rw-r--r--src/devices/cpu/sm510/sm511core.c (renamed from src/emu/cpu/sm510/sm511core.c)8
-rw-r--r--src/devices/cpu/sm8500/sm8500.c (renamed from src/emu/cpu/sm8500/sm8500.c)0
-rw-r--r--src/devices/cpu/sm8500/sm8500.h (renamed from src/emu/cpu/sm8500/sm8500.h)0
-rw-r--r--src/devices/cpu/sm8500/sm8500d.c (renamed from src/emu/cpu/sm8500/sm8500d.c)0
-rw-r--r--src/devices/cpu/sm8500/sm85ops.h (renamed from src/emu/cpu/sm8500/sm85ops.h)0
-rw-r--r--src/devices/cpu/spc700/spc700.c (renamed from src/emu/cpu/spc700/spc700.c)0
-rw-r--r--src/devices/cpu/spc700/spc700.h (renamed from src/emu/cpu/spc700/spc700.h)0
-rw-r--r--src/devices/cpu/spc700/spc700ds.c (renamed from src/emu/cpu/spc700/spc700ds.c)0
-rw-r--r--src/devices/cpu/spc700/spc700ds.h (renamed from src/emu/cpu/spc700/spc700ds.h)0
-rw-r--r--src/devices/cpu/ssem/ssem.c (renamed from src/emu/cpu/ssem/ssem.c)2
-rw-r--r--src/devices/cpu/ssem/ssem.h (renamed from src/emu/cpu/ssem/ssem.h)2
-rw-r--r--src/devices/cpu/ssem/ssemdasm.c (renamed from src/emu/cpu/ssem/ssemdasm.c)2
-rw-r--r--src/devices/cpu/ssp1601/ssp1601.c (renamed from src/emu/cpu/ssp1601/ssp1601.c)0
-rw-r--r--src/devices/cpu/ssp1601/ssp1601.h (renamed from src/emu/cpu/ssp1601/ssp1601.h)0
-rw-r--r--src/devices/cpu/ssp1601/ssp1601d.c (renamed from src/emu/cpu/ssp1601/ssp1601d.c)0
-rw-r--r--src/devices/cpu/superfx/sfx_dasm.c (renamed from src/emu/cpu/superfx/sfx_dasm.c)0
-rw-r--r--src/devices/cpu/superfx/superfx.c (renamed from src/emu/cpu/superfx/superfx.c)0
-rw-r--r--src/devices/cpu/superfx/superfx.h (renamed from src/emu/cpu/superfx/superfx.h)0
-rw-r--r--src/devices/cpu/t11/t11.c (renamed from src/emu/cpu/t11/t11.c)43
-rw-r--r--src/devices/cpu/t11/t11.h (renamed from src/emu/cpu/t11/t11.h)18
-rw-r--r--src/devices/cpu/t11/t11dasm.c (renamed from src/emu/cpu/t11/t11dasm.c)0
-rw-r--r--src/devices/cpu/t11/t11ops.inc (renamed from src/emu/cpu/t11/t11ops.inc)0
-rw-r--r--src/devices/cpu/t11/t11table.inc (renamed from src/emu/cpu/t11/t11table.inc)0
-rw-r--r--src/devices/cpu/tlcs90/tlcs90.c (renamed from src/emu/cpu/tlcs90/tlcs90.c)0
-rw-r--r--src/devices/cpu/tlcs90/tlcs90.h (renamed from src/emu/cpu/tlcs90/tlcs90.h)0
-rw-r--r--src/devices/cpu/tlcs900/900tbl.inc (renamed from src/emu/cpu/tlcs900/900tbl.inc)0
-rw-r--r--src/devices/cpu/tlcs900/dasm900.c (renamed from src/emu/cpu/tlcs900/dasm900.c)0
-rw-r--r--src/devices/cpu/tlcs900/tlcs900.c (renamed from src/emu/cpu/tlcs900/tlcs900.c)0
-rw-r--r--src/devices/cpu/tlcs900/tlcs900.h (renamed from src/emu/cpu/tlcs900/tlcs900.h)0
-rw-r--r--src/devices/cpu/tms0980/tms0980.c (renamed from src/emu/cpu/tms0980/tms0980.c)71
-rw-r--r--src/devices/cpu/tms0980/tms0980.h (renamed from src/emu/cpu/tms0980/tms0980.h)18
-rw-r--r--src/devices/cpu/tms0980/tms0980d.c (renamed from src/emu/cpu/tms0980/tms0980d.c)0
-rw-r--r--src/devices/cpu/tms32010/32010dsm.c (renamed from src/emu/cpu/tms32010/32010dsm.c)0
-rw-r--r--src/devices/cpu/tms32010/dis32010.c (renamed from src/emu/cpu/tms32010/dis32010.c)0
-rw-r--r--src/devices/cpu/tms32010/tms32010.c (renamed from src/emu/cpu/tms32010/tms32010.c)0
-rw-r--r--src/devices/cpu/tms32010/tms32010.h (renamed from src/emu/cpu/tms32010/tms32010.h)0
-rw-r--r--src/devices/cpu/tms32025/32025dsm.c (renamed from src/emu/cpu/tms32025/32025dsm.c)0
-rw-r--r--src/devices/cpu/tms32025/dis32025.c (renamed from src/emu/cpu/tms32025/dis32025.c)0
-rw-r--r--src/devices/cpu/tms32025/tms32025.c (renamed from src/emu/cpu/tms32025/tms32025.c)0
-rw-r--r--src/devices/cpu/tms32025/tms32025.h (renamed from src/emu/cpu/tms32025/tms32025.h)0
-rw-r--r--src/devices/cpu/tms32031/32031ops.c (renamed from src/emu/cpu/tms32031/32031ops.c)0
-rw-r--r--src/devices/cpu/tms32031/dis32031.c (renamed from src/emu/cpu/tms32031/dis32031.c)0
-rw-r--r--src/devices/cpu/tms32031/tms32031.c (renamed from src/emu/cpu/tms32031/tms32031.c)0
-rw-r--r--src/devices/cpu/tms32031/tms32031.h (renamed from src/emu/cpu/tms32031/tms32031.h)0
-rw-r--r--src/devices/cpu/tms32051/32051ops.c (renamed from src/emu/cpu/tms32051/32051ops.c)0
-rw-r--r--src/devices/cpu/tms32051/32051ops.h (renamed from src/emu/cpu/tms32051/32051ops.h)0
-rw-r--r--src/devices/cpu/tms32051/dis32051.c (renamed from src/emu/cpu/tms32051/dis32051.c)0
-rw-r--r--src/devices/cpu/tms32051/tms32051.c (renamed from src/emu/cpu/tms32051/tms32051.c)0
-rw-r--r--src/devices/cpu/tms32051/tms32051.h (renamed from src/emu/cpu/tms32051/tms32051.h)0
-rw-r--r--src/devices/cpu/tms32082/dis_mp.c (renamed from src/emu/cpu/tms32082/dis_mp.c)0
-rw-r--r--src/devices/cpu/tms32082/dis_pp.c (renamed from src/emu/cpu/tms32082/dis_pp.c)0
-rw-r--r--src/devices/cpu/tms32082/mp_ops.c (renamed from src/emu/cpu/tms32082/mp_ops.c)67
-rw-r--r--src/devices/cpu/tms32082/tms32082.c (renamed from src/emu/cpu/tms32082/tms32082.c)66
-rw-r--r--src/devices/cpu/tms32082/tms32082.h (renamed from src/emu/cpu/tms32082/tms32082.h)7
-rw-r--r--src/devices/cpu/tms34010/34010dsm.c (renamed from src/emu/cpu/tms34010/34010dsm.c)0
-rw-r--r--src/devices/cpu/tms34010/34010fld.c (renamed from src/emu/cpu/tms34010/34010fld.c)0
-rw-r--r--src/devices/cpu/tms34010/34010gfx.c (renamed from src/emu/cpu/tms34010/34010gfx.c)0
-rw-r--r--src/devices/cpu/tms34010/34010ops.c (renamed from src/emu/cpu/tms34010/34010ops.c)0
-rw-r--r--src/devices/cpu/tms34010/34010ops.h (renamed from src/emu/cpu/tms34010/34010ops.h)0
-rw-r--r--src/devices/cpu/tms34010/34010tbl.c (renamed from src/emu/cpu/tms34010/34010tbl.c)0
-rw-r--r--src/devices/cpu/tms34010/dis34010.c (renamed from src/emu/cpu/tms34010/dis34010.c)0
-rw-r--r--src/devices/cpu/tms34010/makefile (renamed from src/emu/cpu/tms34010/makefile)0
-rw-r--r--src/devices/cpu/tms34010/tms34010.c (renamed from src/emu/cpu/tms34010/tms34010.c)0
-rw-r--r--src/devices/cpu/tms34010/tms34010.h (renamed from src/emu/cpu/tms34010/tms34010.h)0
-rw-r--r--src/devices/cpu/tms57002/57002dsm.c (renamed from src/emu/cpu/tms57002/57002dsm.c)0
-rw-r--r--src/devices/cpu/tms57002/tms57002.c (renamed from src/emu/cpu/tms57002/tms57002.c)0
-rw-r--r--src/devices/cpu/tms57002/tms57002.h (renamed from src/emu/cpu/tms57002/tms57002.h)0
-rw-r--r--src/devices/cpu/tms57002/tms57kdec.c (renamed from src/emu/cpu/tms57002/tms57kdec.c)0
-rw-r--r--src/devices/cpu/tms57002/tmsinstr.lst (renamed from src/emu/cpu/tms57002/tmsinstr.lst)0
-rwxr-xr-xsrc/devices/cpu/tms57002/tmsmake.py (renamed from src/emu/cpu/tms57002/tmsmake.py)0
-rw-r--r--src/devices/cpu/tms7000/7000dasm.c (renamed from src/emu/cpu/tms7000/7000dasm.c)0
-rw-r--r--src/devices/cpu/tms7000/tms7000.c (renamed from src/emu/cpu/tms7000/tms7000.c)0
-rw-r--r--src/devices/cpu/tms7000/tms7000.h (renamed from src/emu/cpu/tms7000/tms7000.h)0
-rw-r--r--src/devices/cpu/tms7000/tms70op.inc (renamed from src/emu/cpu/tms7000/tms70op.inc)0
-rw-r--r--src/devices/cpu/tms9900/9900dasm.c (renamed from src/emu/cpu/tms9900/9900dasm.c)0
-rw-r--r--src/devices/cpu/tms9900/99xxcore.h (renamed from src/emu/cpu/tms9900/99xxcore.h)0
-rw-r--r--src/devices/cpu/tms9900/ti990_10.c (renamed from src/emu/cpu/tms9900/ti990_10.c)0
-rw-r--r--src/devices/cpu/tms9900/ti990_10.h (renamed from src/emu/cpu/tms9900/ti990_10.h)0
-rw-r--r--src/devices/cpu/tms9900/tms9900.c (renamed from src/emu/cpu/tms9900/tms9900.c)0
-rw-r--r--src/devices/cpu/tms9900/tms9900.h (renamed from src/emu/cpu/tms9900/tms9900.h)0
-rw-r--r--src/devices/cpu/tms9900/tms9980a.c (renamed from src/emu/cpu/tms9900/tms9980a.c)0
-rw-r--r--src/devices/cpu/tms9900/tms9980a.h (renamed from src/emu/cpu/tms9900/tms9980a.h)0
-rw-r--r--src/devices/cpu/tms9900/tms9995.c (renamed from src/emu/cpu/tms9900/tms9995.c)2
-rw-r--r--src/devices/cpu/tms9900/tms9995.h (renamed from src/emu/cpu/tms9900/tms9995.h)0
-rw-r--r--src/devices/cpu/tms9900/tms99com.h (renamed from src/emu/cpu/tms9900/tms99com.h)0
-rw-r--r--src/devices/cpu/ucom4/ucom4.c (renamed from src/emu/cpu/ucom4/ucom4.c)102
-rw-r--r--src/devices/cpu/ucom4/ucom4.h (renamed from src/emu/cpu/ucom4/ucom4.h)17
-rw-r--r--src/devices/cpu/ucom4/ucom4d.c (renamed from src/emu/cpu/ucom4/ucom4d.c)0
-rw-r--r--src/devices/cpu/ucom4/ucom4op.c (renamed from src/emu/cpu/ucom4/ucom4op.c)44
-rw-r--r--src/devices/cpu/uml.c (renamed from src/emu/cpu/uml.c)0
-rw-r--r--src/devices/cpu/uml.h (renamed from src/emu/cpu/uml.h)0
-rw-r--r--src/devices/cpu/unsp/unsp.c (renamed from src/emu/cpu/unsp/unsp.c)2
-rw-r--r--src/devices/cpu/unsp/unsp.h (renamed from src/emu/cpu/unsp/unsp.h)2
-rw-r--r--src/devices/cpu/unsp/unspdasm.c (renamed from src/emu/cpu/unsp/unspdasm.c)2
-rw-r--r--src/devices/cpu/upd7725/dasm7725.c (renamed from src/emu/cpu/upd7725/dasm7725.c)0
-rw-r--r--src/devices/cpu/upd7725/upd7725.c (renamed from src/emu/cpu/upd7725/upd7725.c)0
-rw-r--r--src/devices/cpu/upd7725/upd7725.h (renamed from src/emu/cpu/upd7725/upd7725.h)0
-rw-r--r--src/devices/cpu/upd7810/upd7810.c (renamed from src/emu/cpu/upd7810/upd7810.c)0
-rw-r--r--src/devices/cpu/upd7810/upd7810.h (renamed from src/emu/cpu/upd7810/upd7810.h)0
-rw-r--r--src/devices/cpu/upd7810/upd7810_dasm.c (renamed from src/emu/cpu/upd7810/upd7810_dasm.c)0
-rw-r--r--src/devices/cpu/upd7810/upd7810_macros.h (renamed from src/emu/cpu/upd7810/upd7810_macros.h)0
-rw-r--r--src/devices/cpu/upd7810/upd7810_opcodes.c (renamed from src/emu/cpu/upd7810/upd7810_opcodes.c)0
-rw-r--r--src/devices/cpu/upd7810/upd7810_table.c (renamed from src/emu/cpu/upd7810/upd7810_table.c)0
-rw-r--r--src/devices/cpu/v30mz/v30mz.c (renamed from src/emu/cpu/v30mz/v30mz.c)0
-rw-r--r--src/devices/cpu/v30mz/v30mz.h (renamed from src/emu/cpu/v30mz/v30mz.h)0
-rw-r--r--src/devices/cpu/v60/am.inc (renamed from src/emu/cpu/v60/am.inc)0
-rw-r--r--src/devices/cpu/v60/am1.inc (renamed from src/emu/cpu/v60/am1.inc)0
-rw-r--r--src/devices/cpu/v60/am2.inc (renamed from src/emu/cpu/v60/am2.inc)0
-rw-r--r--src/devices/cpu/v60/am3.inc (renamed from src/emu/cpu/v60/am3.inc)0
-rw-r--r--src/devices/cpu/v60/op12.inc (renamed from src/emu/cpu/v60/op12.inc)0
-rw-r--r--src/devices/cpu/v60/op2.inc (renamed from src/emu/cpu/v60/op2.inc)0
-rw-r--r--src/devices/cpu/v60/op3.inc (renamed from src/emu/cpu/v60/op3.inc)0
-rw-r--r--src/devices/cpu/v60/op4.inc (renamed from src/emu/cpu/v60/op4.inc)0
-rw-r--r--src/devices/cpu/v60/op5.inc (renamed from src/emu/cpu/v60/op5.inc)0
-rw-r--r--src/devices/cpu/v60/op6.inc (renamed from src/emu/cpu/v60/op6.inc)0
-rw-r--r--src/devices/cpu/v60/op7a.inc (renamed from src/emu/cpu/v60/op7a.inc)0
-rw-r--r--src/devices/cpu/v60/optable.inc (renamed from src/emu/cpu/v60/optable.inc)0
-rw-r--r--src/devices/cpu/v60/v60.c (renamed from src/emu/cpu/v60/v60.c)65
-rw-r--r--src/devices/cpu/v60/v60.h (renamed from src/emu/cpu/v60/v60.h)0
-rw-r--r--src/devices/cpu/v60/v60d.c (renamed from src/emu/cpu/v60/v60d.c)0
-rw-r--r--src/devices/cpu/v810/v810.c (renamed from src/emu/cpu/v810/v810.c)2
-rw-r--r--src/devices/cpu/v810/v810.h (renamed from src/emu/cpu/v810/v810.h)0
-rw-r--r--src/devices/cpu/v810/v810dasm.c (renamed from src/emu/cpu/v810/v810dasm.c)0
-rw-r--r--src/devices/cpu/vtlb.c (renamed from src/emu/cpu/vtlb.c)0
-rw-r--r--src/devices/cpu/vtlb.h (renamed from src/emu/cpu/vtlb.h)0
-rw-r--r--src/devices/cpu/x86emit.h (renamed from src/emu/cpu/x86emit.h)0
-rw-r--r--src/devices/cpu/x86log.c (renamed from src/emu/cpu/x86log.c)0
-rw-r--r--src/devices/cpu/x86log.h (renamed from src/emu/cpu/x86log.h)0
-rw-r--r--src/devices/cpu/z180/z180.c (renamed from src/emu/cpu/z180/z180.c)0
-rw-r--r--src/devices/cpu/z180/z180.h (renamed from src/emu/cpu/z180/z180.h)0
-rw-r--r--src/devices/cpu/z180/z180cb.inc (renamed from src/emu/cpu/z180/z180cb.inc)0
-rw-r--r--src/devices/cpu/z180/z180dasm.c (renamed from src/emu/cpu/z180/z180dasm.c)0
-rw-r--r--src/devices/cpu/z180/z180dd.inc (renamed from src/emu/cpu/z180/z180dd.inc)0
-rw-r--r--src/devices/cpu/z180/z180ed.inc (renamed from src/emu/cpu/z180/z180ed.inc)0
-rw-r--r--src/devices/cpu/z180/z180fd.inc (renamed from src/emu/cpu/z180/z180fd.inc)0
-rw-r--r--src/devices/cpu/z180/z180op.inc (renamed from src/emu/cpu/z180/z180op.inc)0
-rw-r--r--src/devices/cpu/z180/z180ops.h (renamed from src/emu/cpu/z180/z180ops.h)0
-rw-r--r--src/devices/cpu/z180/z180tbl.h (renamed from src/emu/cpu/z180/z180tbl.h)0
-rw-r--r--src/devices/cpu/z180/z180xy.inc (renamed from src/emu/cpu/z180/z180xy.inc)0
-rw-r--r--src/devices/cpu/z8/z8.c (renamed from src/emu/cpu/z8/z8.c)0
-rw-r--r--src/devices/cpu/z8/z8.h (renamed from src/emu/cpu/z8/z8.h)0
-rw-r--r--src/devices/cpu/z8/z8dasm.c (renamed from src/emu/cpu/z8/z8dasm.c)0
-rw-r--r--src/devices/cpu/z8/z8ops.inc (renamed from src/emu/cpu/z8/z8ops.inc)0
-rw-r--r--src/devices/cpu/z80/kl5c80a12.c (renamed from src/emu/cpu/z80/kl5c80a12.c)0
-rw-r--r--src/devices/cpu/z80/kl5c80a12.h (renamed from src/emu/cpu/z80/kl5c80a12.h)0
-rw-r--r--src/devices/cpu/z80/tmpz84c011.c (renamed from src/emu/cpu/z80/tmpz84c011.c)0
-rw-r--r--src/devices/cpu/z80/tmpz84c011.h (renamed from src/emu/cpu/z80/tmpz84c011.h)0
-rw-r--r--src/devices/cpu/z80/tmpz84c015.c (renamed from src/emu/cpu/z80/tmpz84c015.c)0
-rw-r--r--src/devices/cpu/z80/tmpz84c015.h (renamed from src/emu/cpu/z80/tmpz84c015.h)0
-rw-r--r--src/devices/cpu/z80/z80.c (renamed from src/emu/cpu/z80/z80.c)0
-rw-r--r--src/devices/cpu/z80/z80.h (renamed from src/emu/cpu/z80/z80.h)0
-rw-r--r--src/devices/cpu/z80/z80daisy.c (renamed from src/emu/cpu/z80/z80daisy.c)0
-rw-r--r--src/devices/cpu/z80/z80daisy.h (renamed from src/emu/cpu/z80/z80daisy.h)0
-rw-r--r--src/devices/cpu/z80/z80dasm.c (renamed from src/emu/cpu/z80/z80dasm.c)0
-rw-r--r--src/devices/cpu/z8000/8000dasm.c (renamed from src/emu/cpu/z8000/8000dasm.c)0
-rw-r--r--src/devices/cpu/z8000/makedab.c (renamed from src/emu/cpu/z8000/makedab.c)0
-rw-r--r--src/devices/cpu/z8000/z8000.c (renamed from src/emu/cpu/z8000/z8000.c)0
-rw-r--r--src/devices/cpu/z8000/z8000.h (renamed from src/emu/cpu/z8000/z8000.h)0
-rw-r--r--src/devices/cpu/z8000/z8000cpu.h (renamed from src/emu/cpu/z8000/z8000cpu.h)0
-rw-r--r--src/devices/cpu/z8000/z8000dab.h (renamed from src/emu/cpu/z8000/z8000dab.h)0
-rw-r--r--src/devices/cpu/z8000/z8000ops.inc (renamed from src/emu/cpu/z8000/z8000ops.inc)0
-rw-r--r--src/devices/cpu/z8000/z8000tbl.inc (renamed from src/emu/cpu/z8000/z8000tbl.inc)0
-rw-r--r--src/devices/imagedev/bitbngr.c (renamed from src/emu/imagedev/bitbngr.c)0
-rw-r--r--src/devices/imagedev/bitbngr.h (renamed from src/emu/imagedev/bitbngr.h)0
-rw-r--r--src/devices/imagedev/cassette.c (renamed from src/emu/imagedev/cassette.c)0
-rw-r--r--src/devices/imagedev/cassette.h (renamed from src/emu/imagedev/cassette.h)0
-rw-r--r--src/devices/imagedev/chd_cd.c (renamed from src/emu/imagedev/chd_cd.c)0
-rw-r--r--src/devices/imagedev/chd_cd.h (renamed from src/emu/imagedev/chd_cd.h)0
-rw-r--r--src/devices/imagedev/diablo.c (renamed from src/emu/imagedev/diablo.c)0
-rw-r--r--src/devices/imagedev/diablo.h (renamed from src/emu/imagedev/diablo.h)0
-rw-r--r--src/devices/imagedev/flopdrv.c (renamed from src/emu/imagedev/flopdrv.c)0
-rw-r--r--src/devices/imagedev/flopdrv.h (renamed from src/emu/imagedev/flopdrv.h)0
-rw-r--r--src/devices/imagedev/floppy.c (renamed from src/emu/imagedev/floppy.c)253
-rw-r--r--src/devices/imagedev/floppy.h (renamed from src/emu/imagedev/floppy.h)62
-rw-r--r--src/devices/imagedev/harddriv.c (renamed from src/emu/imagedev/harddriv.c)0
-rw-r--r--src/devices/imagedev/harddriv.h (renamed from src/emu/imagedev/harddriv.h)0
-rw-r--r--src/devices/imagedev/mfmhd.c (renamed from src/emu/machine/ti99_hd.c)960
-rw-r--r--src/devices/imagedev/mfmhd.h (renamed from src/emu/machine/ti99_hd.h)131
-rw-r--r--src/devices/imagedev/midiin.c (renamed from src/emu/imagedev/midiin.c)0
-rw-r--r--src/devices/imagedev/midiin.h (renamed from src/emu/imagedev/midiin.h)0
-rw-r--r--src/devices/imagedev/midiout.c (renamed from src/emu/imagedev/midiout.c)0
-rw-r--r--src/devices/imagedev/midiout.h (renamed from src/emu/imagedev/midiout.h)0
-rw-r--r--src/devices/imagedev/printer.c (renamed from src/emu/imagedev/printer.c)0
-rw-r--r--src/devices/imagedev/printer.h (renamed from src/emu/imagedev/printer.h)0
-rw-r--r--src/devices/imagedev/snapquik.c (renamed from src/emu/imagedev/snapquik.c)0
-rw-r--r--src/devices/imagedev/snapquik.h (renamed from src/emu/imagedev/snapquik.h)0
-rw-r--r--src/devices/machine/40105.c (renamed from src/emu/machine/40105.c)0
-rw-r--r--src/devices/machine/40105.h (renamed from src/emu/machine/40105.h)0
-rw-r--r--src/devices/machine/53c7xx.c (renamed from src/emu/machine/53c7xx.c)0
-rw-r--r--src/devices/machine/53c7xx.h (renamed from src/emu/machine/53c7xx.h)0
-rw-r--r--src/devices/machine/53c810.c (renamed from src/emu/machine/53c810.c)0
-rw-r--r--src/devices/machine/53c810.h (renamed from src/emu/machine/53c810.h)0
-rw-r--r--src/devices/machine/64h156.c (renamed from src/emu/machine/64h156.c)0
-rw-r--r--src/devices/machine/64h156.h (renamed from src/emu/machine/64h156.h)0
-rw-r--r--src/devices/machine/6522via.c (renamed from src/emu/machine/6522via.c)0
-rw-r--r--src/devices/machine/6522via.h (renamed from src/emu/machine/6522via.h)0
-rw-r--r--src/devices/machine/6525tpi.c (renamed from src/emu/machine/6525tpi.c)0
-rw-r--r--src/devices/machine/6525tpi.h (renamed from src/emu/machine/6525tpi.h)0
-rw-r--r--src/devices/machine/6532riot.c (renamed from src/emu/machine/6532riot.c)0
-rw-r--r--src/devices/machine/6532riot.h (renamed from src/emu/machine/6532riot.h)0
-rw-r--r--src/devices/machine/6821pia.c (renamed from src/emu/machine/6821pia.c)0
-rw-r--r--src/devices/machine/6821pia.h (renamed from src/emu/machine/6821pia.h)0
-rw-r--r--src/devices/machine/68230pit.c265
-rw-r--r--src/devices/machine/68230pit.h131
-rw-r--r--src/devices/machine/68307.c (renamed from src/emu/machine/68307.c)0
-rw-r--r--src/devices/machine/68307.h (renamed from src/emu/machine/68307.h)0
-rw-r--r--src/devices/machine/68307bus.c (renamed from src/emu/machine/68307bus.c)0
-rw-r--r--src/devices/machine/68307bus.h (renamed from src/emu/machine/68307bus.h)0
-rw-r--r--src/devices/machine/68307sim.c (renamed from src/emu/machine/68307sim.c)0
-rw-r--r--src/devices/machine/68307sim.h (renamed from src/emu/machine/68307sim.h)0
-rw-r--r--src/devices/machine/68307tmu.c (renamed from src/emu/machine/68307tmu.c)0
-rw-r--r--src/devices/machine/68307tmu.h (renamed from src/emu/machine/68307tmu.h)0
-rw-r--r--src/devices/machine/68340.c (renamed from src/emu/machine/68340.c)0
-rw-r--r--src/devices/machine/68340.h (renamed from src/emu/machine/68340.h)0
-rw-r--r--src/devices/machine/68340dma.c (renamed from src/emu/machine/68340dma.c)0
-rw-r--r--src/devices/machine/68340dma.h (renamed from src/emu/machine/68340dma.h)0
-rw-r--r--src/devices/machine/68340ser.c (renamed from src/emu/machine/68340ser.c)0
-rw-r--r--src/devices/machine/68340ser.h (renamed from src/emu/machine/68340ser.h)0
-rw-r--r--src/devices/machine/68340sim.c (renamed from src/emu/machine/68340sim.c)0
-rw-r--r--src/devices/machine/68340sim.h (renamed from src/emu/machine/68340sim.h)0
-rw-r--r--src/devices/machine/68340tmu.c (renamed from src/emu/machine/68340tmu.c)0
-rw-r--r--src/devices/machine/68340tmu.h (renamed from src/emu/machine/68340tmu.h)0
-rw-r--r--src/devices/machine/6840ptm.c (renamed from src/emu/machine/6840ptm.c)0
-rw-r--r--src/devices/machine/6840ptm.h (renamed from src/emu/machine/6840ptm.h)0
-rw-r--r--src/devices/machine/6850acia.c (renamed from src/emu/machine/6850acia.c)0
-rw-r--r--src/devices/machine/6850acia.h (renamed from src/emu/machine/6850acia.h)0
-rw-r--r--src/devices/machine/68561mpcc.c (renamed from src/emu/machine/68561mpcc.c)0
-rw-r--r--src/devices/machine/68561mpcc.h (renamed from src/emu/machine/68561mpcc.h)0
-rw-r--r--src/devices/machine/7200fifo.c (renamed from src/emu/machine/7200fifo.c)0
-rw-r--r--src/devices/machine/7200fifo.h (renamed from src/emu/machine/7200fifo.h)0
-rw-r--r--src/devices/machine/74123.c (renamed from src/emu/machine/74123.c)0
-rw-r--r--src/devices/machine/74123.h (renamed from src/emu/machine/74123.h)0
-rw-r--r--src/devices/machine/74145.c (renamed from src/emu/machine/74145.c)0
-rw-r--r--src/devices/machine/74145.h (renamed from src/emu/machine/74145.h)0
-rw-r--r--src/devices/machine/74148.c (renamed from src/emu/machine/74148.c)0
-rw-r--r--src/devices/machine/74148.h (renamed from src/emu/machine/74148.h)0
-rw-r--r--src/devices/machine/74153.c (renamed from src/emu/machine/74153.c)0
-rw-r--r--src/devices/machine/74153.h (renamed from src/emu/machine/74153.h)0
-rw-r--r--src/devices/machine/74181.c (renamed from src/emu/machine/74181.c)0
-rw-r--r--src/devices/machine/74181.h (renamed from src/emu/machine/74181.h)0
-rw-r--r--src/devices/machine/7474.c (renamed from src/emu/machine/7474.c)0
-rw-r--r--src/devices/machine/7474.h (renamed from src/emu/machine/7474.h)0
-rw-r--r--src/devices/machine/8042kbdc.c (renamed from src/emu/machine/8042kbdc.c)0
-rw-r--r--src/devices/machine/8042kbdc.h (renamed from src/emu/machine/8042kbdc.h)0
-rw-r--r--src/devices/machine/8530scc.c (renamed from src/emu/machine/8530scc.c)2
-rw-r--r--src/devices/machine/8530scc.h (renamed from src/emu/machine/8530scc.h)0
-rw-r--r--src/devices/machine/aakart.c (renamed from src/emu/machine/aakart.c)0
-rw-r--r--src/devices/machine/aakart.h (renamed from src/emu/machine/aakart.h)0
-rw-r--r--src/devices/machine/adc0808.c (renamed from src/emu/machine/adc0808.c)0
-rw-r--r--src/devices/machine/adc0808.h (renamed from src/emu/machine/adc0808.h)0
-rw-r--r--src/devices/machine/adc083x.c (renamed from src/emu/machine/adc083x.c)0
-rw-r--r--src/devices/machine/adc083x.h (renamed from src/emu/machine/adc083x.h)0
-rw-r--r--src/devices/machine/adc1038.c (renamed from src/emu/machine/adc1038.c)0
-rw-r--r--src/devices/machine/adc1038.h (renamed from src/emu/machine/adc1038.h)0
-rw-r--r--src/devices/machine/adc1213x.c (renamed from src/emu/machine/adc1213x.c)0
-rw-r--r--src/devices/machine/adc1213x.h (renamed from src/emu/machine/adc1213x.h)0
-rw-r--r--src/devices/machine/aicartc.c (renamed from src/emu/machine/aicartc.c)0
-rw-r--r--src/devices/machine/aicartc.h (renamed from src/emu/machine/aicartc.h)0
-rw-r--r--src/devices/machine/akiko.c (renamed from src/emu/machine/akiko.c)0
-rw-r--r--src/devices/machine/akiko.h (renamed from src/emu/machine/akiko.h)0
-rw-r--r--src/devices/machine/am53cf96.c (renamed from src/emu/machine/am53cf96.c)0
-rw-r--r--src/devices/machine/am53cf96.h (renamed from src/emu/machine/am53cf96.h)0
-rw-r--r--src/devices/machine/am9517a.c (renamed from src/emu/machine/am9517a.c)0
-rw-r--r--src/devices/machine/am9517a.h (renamed from src/emu/machine/am9517a.h)0
-rw-r--r--src/devices/machine/amigafdc.c (renamed from src/emu/machine/amigafdc.c)0
-rw-r--r--src/devices/machine/amigafdc.h (renamed from src/emu/machine/amigafdc.h)0
-rw-r--r--src/devices/machine/at28c16.c (renamed from src/emu/machine/at28c16.c)0
-rw-r--r--src/devices/machine/at28c16.h (renamed from src/emu/machine/at28c16.h)0
-rw-r--r--src/devices/machine/at29x.c525
-rw-r--r--src/devices/machine/at29x.h116
-rw-r--r--src/devices/machine/at45dbxx.c (renamed from src/emu/machine/at45dbxx.c)0
-rw-r--r--src/devices/machine/at45dbxx.h (renamed from src/emu/machine/at45dbxx.h)0
-rw-r--r--src/devices/machine/at_keybc.c (renamed from src/emu/machine/at_keybc.c)20
-rw-r--r--src/devices/machine/at_keybc.h (renamed from src/emu/machine/at_keybc.h)1
-rw-r--r--src/devices/machine/atadev.c (renamed from src/emu/machine/atadev.c)0
-rw-r--r--src/devices/machine/atadev.h (renamed from src/emu/machine/atadev.h)0
-rw-r--r--src/devices/machine/ataflash.c (renamed from src/emu/machine/ataflash.c)0
-rw-r--r--src/devices/machine/ataflash.h (renamed from src/emu/machine/ataflash.h)0
-rw-r--r--src/devices/machine/atahle.c (renamed from src/emu/machine/atahle.c)23
-rw-r--r--src/devices/machine/atahle.h (renamed from src/emu/machine/atahle.h)7
-rw-r--r--src/devices/machine/ataintf.c (renamed from src/emu/machine/ataintf.c)0
-rw-r--r--src/devices/machine/ataintf.h (renamed from src/emu/machine/ataintf.h)0
-rw-r--r--src/devices/machine/atapicdr.c (renamed from src/emu/machine/atapicdr.c)0
-rw-r--r--src/devices/machine/atapicdr.h (renamed from src/emu/machine/atapicdr.h)2
-rw-r--r--src/devices/machine/atapihle.c (renamed from src/emu/machine/atapihle.c)6
-rw-r--r--src/devices/machine/atapihle.h (renamed from src/emu/machine/atapihle.h)0
-rw-r--r--src/devices/machine/autoconfig.c (renamed from src/emu/machine/autoconfig.c)0
-rw-r--r--src/devices/machine/autoconfig.h (renamed from src/emu/machine/autoconfig.h)0
-rw-r--r--src/devices/machine/ay31015.c (renamed from src/emu/machine/ay31015.c)0
-rw-r--r--src/devices/machine/ay31015.h (renamed from src/emu/machine/ay31015.h)0
-rw-r--r--src/devices/machine/bankdev.c (renamed from src/emu/machine/bankdev.c)0
-rw-r--r--src/devices/machine/bankdev.h (renamed from src/emu/machine/bankdev.h)0
-rw-r--r--src/devices/machine/bcreader.c (renamed from src/emu/machine/bcreader.c)0
-rw-r--r--src/devices/machine/bcreader.h (renamed from src/emu/machine/bcreader.h)0
-rw-r--r--src/devices/machine/buffer.c (renamed from src/emu/machine/buffer.c)0
-rw-r--r--src/devices/machine/buffer.h (renamed from src/emu/machine/buffer.h)0
-rw-r--r--src/devices/machine/cdp1852.c (renamed from src/emu/machine/cdp1852.c)0
-rw-r--r--src/devices/machine/cdp1852.h (renamed from src/emu/machine/cdp1852.h)0
-rw-r--r--src/devices/machine/cdp1871.c (renamed from src/emu/machine/cdp1871.c)0
-rw-r--r--src/devices/machine/cdp1871.h (renamed from src/emu/machine/cdp1871.h)0
-rw-r--r--src/devices/machine/clock.c (renamed from src/emu/machine/clock.c)0
-rw-r--r--src/devices/machine/clock.h (renamed from src/emu/machine/clock.h)0
-rw-r--r--src/devices/machine/com8116.c (renamed from src/emu/machine/com8116.c)0
-rw-r--r--src/devices/machine/com8116.h (renamed from src/emu/machine/com8116.h)0
-rw-r--r--src/devices/machine/corvushd.c (renamed from src/emu/machine/corvushd.c)0
-rw-r--r--src/devices/machine/corvushd.h (renamed from src/emu/machine/corvushd.h)0
-rw-r--r--src/devices/machine/cr511b.c (renamed from src/emu/machine/cr511b.c)0
-rw-r--r--src/devices/machine/cr511b.h (renamed from src/emu/machine/cr511b.h)0
-rw-r--r--src/devices/machine/cr589.c (renamed from src/emu/machine/cr589.c)0
-rw-r--r--src/devices/machine/cr589.h (renamed from src/emu/machine/cr589.h)0
-rw-r--r--src/devices/machine/cs4031.c (renamed from src/emu/machine/cs4031.c)0
-rw-r--r--src/devices/machine/cs4031.h (renamed from src/emu/machine/cs4031.h)0
-rw-r--r--src/devices/machine/cs8221.c (renamed from src/emu/machine/cs8221.c)0
-rw-r--r--src/devices/machine/cs8221.h (renamed from src/emu/machine/cs8221.h)0
-rw-r--r--src/devices/machine/diablo_hd.c (renamed from src/emu/machine/diablo_hd.c)0
-rw-r--r--src/devices/machine/diablo_hd.h (renamed from src/emu/machine/diablo_hd.h)0
-rw-r--r--src/devices/machine/dmac.c (renamed from src/emu/machine/dmac.c)0
-rw-r--r--src/devices/machine/dmac.h (renamed from src/emu/machine/dmac.h)0
-rw-r--r--src/devices/machine/dp8390.c (renamed from src/emu/machine/dp8390.c)0
-rw-r--r--src/devices/machine/dp8390.h (renamed from src/emu/machine/dp8390.h)0
-rw-r--r--src/devices/machine/ds1204.c (renamed from src/emu/machine/ds1204.c)0
-rw-r--r--src/devices/machine/ds1204.h (renamed from src/emu/machine/ds1204.h)0
-rw-r--r--src/devices/machine/ds128x.c (renamed from src/emu/machine/ds128x.c)0
-rw-r--r--src/devices/machine/ds128x.h (renamed from src/emu/machine/ds128x.h)0
-rw-r--r--src/devices/machine/ds1302.c (renamed from src/emu/machine/ds1302.c)0
-rw-r--r--src/devices/machine/ds1302.h (renamed from src/emu/machine/ds1302.h)0
-rw-r--r--src/devices/machine/ds1315.c (renamed from src/emu/machine/ds1315.c)0
-rw-r--r--src/devices/machine/ds1315.h (renamed from src/emu/machine/ds1315.h)0
-rw-r--r--src/devices/machine/ds2401.c (renamed from src/emu/machine/ds2401.c)0
-rw-r--r--src/devices/machine/ds2401.h (renamed from src/emu/machine/ds2401.h)0
-rw-r--r--src/devices/machine/ds2404.c (renamed from src/emu/machine/ds2404.c)0
-rw-r--r--src/devices/machine/ds2404.h (renamed from src/emu/machine/ds2404.h)0
-rw-r--r--src/devices/machine/ds75160a.c (renamed from src/emu/machine/ds75160a.c)0
-rw-r--r--src/devices/machine/ds75160a.h (renamed from src/emu/machine/ds75160a.h)0
-rw-r--r--src/devices/machine/ds75161a.c (renamed from src/emu/machine/ds75161a.c)0
-rw-r--r--src/devices/machine/ds75161a.h (renamed from src/emu/machine/ds75161a.h)0
-rw-r--r--src/devices/machine/e0516.c (renamed from src/emu/machine/e0516.c)0
-rw-r--r--src/devices/machine/e0516.h (renamed from src/emu/machine/e0516.h)0
-rw-r--r--src/devices/machine/e05a03.c (renamed from src/emu/machine/e05a03.c)0
-rw-r--r--src/devices/machine/e05a03.h (renamed from src/emu/machine/e05a03.h)0
-rw-r--r--src/devices/machine/e05a30.c (renamed from src/emu/machine/e05a30.c)8
-rw-r--r--src/devices/machine/e05a30.h (renamed from src/emu/machine/e05a30.h)0
-rw-r--r--src/devices/machine/eeprom.c (renamed from src/emu/machine/eeprom.c)0
-rw-r--r--src/devices/machine/eeprom.h (renamed from src/emu/machine/eeprom.h)0
-rw-r--r--src/devices/machine/eeprompar.c (renamed from src/emu/machine/eeprompar.c)0
-rw-r--r--src/devices/machine/eeprompar.h (renamed from src/emu/machine/eeprompar.h)0
-rw-r--r--src/devices/machine/eepromser.c (renamed from src/emu/machine/eepromser.c)0
-rw-r--r--src/devices/machine/eepromser.h (renamed from src/emu/machine/eepromser.h)0
-rw-r--r--src/devices/machine/er2055.c (renamed from src/emu/machine/er2055.c)0
-rw-r--r--src/devices/machine/er2055.h (renamed from src/emu/machine/er2055.h)0
-rw-r--r--src/devices/machine/f3853.c (renamed from src/emu/machine/f3853.c)0
-rw-r--r--src/devices/machine/f3853.h (renamed from src/emu/machine/f3853.h)0
-rw-r--r--src/devices/machine/fdc37c665gt.c (renamed from src/emu/machine/fdc37c665gt.c)0
-rw-r--r--src/devices/machine/fdc37c665gt.h (renamed from src/emu/machine/fdc37c665gt.h)0
-rw-r--r--src/devices/machine/fdc_pll.c (renamed from src/emu/machine/fdc_pll.c)8
-rw-r--r--src/devices/machine/fdc_pll.h (renamed from src/emu/machine/fdc_pll.h)0
-rw-r--r--src/devices/machine/gayle.c (renamed from src/emu/machine/gayle.c)0
-rw-r--r--src/devices/machine/gayle.h (renamed from src/emu/machine/gayle.h)0
-rw-r--r--src/devices/machine/hd63450.c (renamed from src/emu/machine/hd63450.c)0
-rw-r--r--src/devices/machine/hd63450.h (renamed from src/emu/machine/hd63450.h)0
-rw-r--r--src/devices/machine/hd64610.c (renamed from src/emu/machine/hd64610.c)0
-rw-r--r--src/devices/machine/hd64610.h (renamed from src/emu/machine/hd64610.h)0
-rw-r--r--src/devices/machine/hdc92x4.c (renamed from src/emu/machine/hdc9234.c)333
-rw-r--r--src/devices/machine/hdc92x4.h (renamed from src/emu/machine/hdc9234.h)73
-rw-r--r--src/devices/machine/i2cmem.c (renamed from src/emu/machine/i2cmem.c)0
-rw-r--r--src/devices/machine/i2cmem.h (renamed from src/emu/machine/i2cmem.h)0
-rw-r--r--src/devices/machine/i6300esb.c (renamed from src/emu/machine/i6300esb.c)0
-rw-r--r--src/devices/machine/i6300esb.h (renamed from src/emu/machine/i6300esb.h)0
-rw-r--r--src/devices/machine/i80130.c (renamed from src/emu/machine/i80130.c)0
-rw-r--r--src/devices/machine/i80130.h (renamed from src/emu/machine/i80130.h)0
-rw-r--r--src/devices/machine/i8155.c (renamed from src/emu/machine/i8155.c)0
-rw-r--r--src/devices/machine/i8155.h (renamed from src/emu/machine/i8155.h)0
-rw-r--r--src/devices/machine/i8212.c (renamed from src/emu/machine/i8212.c)0
-rw-r--r--src/devices/machine/i8212.h (renamed from src/emu/machine/i8212.h)0
-rw-r--r--src/devices/machine/i8214.c (renamed from src/emu/machine/i8214.c)0
-rw-r--r--src/devices/machine/i8214.h (renamed from src/emu/machine/i8214.h)0
-rw-r--r--src/devices/machine/i8243.c (renamed from src/emu/machine/i8243.c)0
-rw-r--r--src/devices/machine/i8243.h (renamed from src/emu/machine/i8243.h)0
-rw-r--r--src/devices/machine/i8251.c (renamed from src/emu/machine/i8251.c)19
-rw-r--r--src/devices/machine/i8251.h (renamed from src/emu/machine/i8251.h)3
-rw-r--r--src/devices/machine/i82541.c (renamed from src/emu/machine/i82541.c)0
-rw-r--r--src/devices/machine/i82541.h (renamed from src/emu/machine/i82541.h)0
-rw-r--r--src/devices/machine/i8255.c (renamed from src/emu/machine/i8255.c)0
-rw-r--r--src/devices/machine/i8255.h (renamed from src/emu/machine/i8255.h)0
-rw-r--r--src/devices/machine/i8257.c (renamed from src/emu/machine/i8257.c)0
-rw-r--r--src/devices/machine/i8257.h (renamed from src/emu/machine/i8257.h)0
-rw-r--r--src/devices/machine/i8271.c1698
-rw-r--r--src/devices/machine/i8271.h296
-rw-r--r--src/devices/machine/i8279.c (renamed from src/emu/machine/i8279.c)0
-rw-r--r--src/devices/machine/i8279.h (renamed from src/emu/machine/i8279.h)0
-rw-r--r--src/devices/machine/i82875p.c (renamed from src/emu/machine/i82875p.c)0
-rw-r--r--src/devices/machine/i82875p.h (renamed from src/emu/machine/i82875p.h)0
-rw-r--r--src/devices/machine/i8355.c (renamed from src/emu/machine/i8355.c)0
-rw-r--r--src/devices/machine/i8355.h (renamed from src/emu/machine/i8355.h)0
-rw-r--r--src/devices/machine/idectrl.c (renamed from src/emu/machine/idectrl.c)10
-rw-r--r--src/devices/machine/idectrl.h (renamed from src/emu/machine/idectrl.h)0
-rw-r--r--src/devices/machine/idehd.c (renamed from src/emu/machine/idehd.c)2
-rw-r--r--src/devices/machine/idehd.h (renamed from src/emu/machine/idehd.h)0
-rw-r--r--src/devices/machine/im6402.c (renamed from src/emu/machine/im6402.c)0
-rw-r--r--src/devices/machine/im6402.h (renamed from src/emu/machine/im6402.h)0
-rw-r--r--src/devices/machine/ins8154.c (renamed from src/emu/machine/ins8154.c)0
-rw-r--r--src/devices/machine/ins8154.h (renamed from src/emu/machine/ins8154.h)0
-rw-r--r--src/devices/machine/ins8250.c (renamed from src/emu/machine/ins8250.c)0
-rw-r--r--src/devices/machine/ins8250.h (renamed from src/emu/machine/ins8250.h)0
-rw-r--r--src/devices/machine/intelfsh.c (renamed from src/emu/machine/intelfsh.c)32
-rw-r--r--src/devices/machine/intelfsh.h (renamed from src/emu/machine/intelfsh.h)12
-rw-r--r--src/devices/machine/jvsdev.c (renamed from src/emu/machine/jvsdev.c)7
-rw-r--r--src/devices/machine/jvsdev.h (renamed from src/emu/machine/jvsdev.h)2
-rw-r--r--src/devices/machine/jvshost.c (renamed from src/emu/machine/jvshost.c)0
-rw-r--r--src/devices/machine/jvshost.h (renamed from src/emu/machine/jvshost.h)0
-rw-r--r--src/devices/machine/k033906.c (renamed from src/emu/machine/k033906.c)0
-rw-r--r--src/devices/machine/k033906.h (renamed from src/emu/machine/k033906.h)0
-rw-r--r--src/devices/machine/k053252.c (renamed from src/emu/machine/k053252.c)0
-rw-r--r--src/devices/machine/k053252.h (renamed from src/emu/machine/k053252.h)0
-rw-r--r--src/devices/machine/k056230.c (renamed from src/emu/machine/k056230.c)0
-rw-r--r--src/devices/machine/k056230.h (renamed from src/emu/machine/k056230.h)0
-rw-r--r--src/devices/machine/kb3600.c (renamed from src/emu/machine/kb3600.c)0
-rw-r--r--src/devices/machine/kb3600.h (renamed from src/emu/machine/kb3600.h)0
-rw-r--r--src/devices/machine/keyboard.c (renamed from src/emu/machine/keyboard.c)0
-rw-r--r--src/devices/machine/keyboard.h (renamed from src/emu/machine/keyboard.h)0
-rw-r--r--src/devices/machine/kr2376.c (renamed from src/emu/machine/kr2376.c)0
-rw-r--r--src/devices/machine/kr2376.h (renamed from src/emu/machine/kr2376.h)0
-rw-r--r--src/devices/machine/laserdsc.c (renamed from src/emu/machine/laserdsc.c)0
-rw-r--r--src/devices/machine/laserdsc.h (renamed from src/emu/machine/laserdsc.h)0
-rw-r--r--src/devices/machine/latch.c (renamed from src/emu/machine/latch.c)0
-rw-r--r--src/devices/machine/latch.h (renamed from src/emu/machine/latch.h)0
-rw-r--r--src/devices/machine/latch8.c (renamed from src/emu/machine/latch8.c)0
-rw-r--r--src/devices/machine/latch8.h (renamed from src/emu/machine/latch8.h)0
-rw-r--r--src/devices/machine/lc89510.c (renamed from src/emu/machine/lc89510.c)0
-rw-r--r--src/devices/machine/lc89510.h (renamed from src/emu/machine/lc89510.h)0
-rw-r--r--src/devices/machine/ldpr8210.c (renamed from src/emu/machine/ldpr8210.c)2
-rw-r--r--src/devices/machine/ldpr8210.h (renamed from src/emu/machine/ldpr8210.h)0
-rw-r--r--src/devices/machine/ldstub.c (renamed from src/emu/machine/ldstub.c)0
-rw-r--r--src/devices/machine/ldstub.h (renamed from src/emu/machine/ldstub.h)0
-rw-r--r--src/devices/machine/ldv1000.c (renamed from src/emu/machine/ldv1000.c)0
-rw-r--r--src/devices/machine/ldv1000.h (renamed from src/emu/machine/ldv1000.h)0
-rw-r--r--src/devices/machine/ldvp931.c (renamed from src/emu/machine/ldvp931.c)0
-rw-r--r--src/devices/machine/ldvp931.h (renamed from src/emu/machine/ldvp931.h)0
-rw-r--r--src/devices/machine/legscsi.c (renamed from src/emu/machine/legscsi.c)0
-rw-r--r--src/devices/machine/legscsi.h (renamed from src/emu/machine/legscsi.h)0
-rw-r--r--src/devices/machine/lh5810.c (renamed from src/emu/machine/lh5810.c)0
-rw-r--r--src/devices/machine/lh5810.h (renamed from src/emu/machine/lh5810.h)0
-rw-r--r--src/devices/machine/linflash.c (renamed from src/emu/machine/linflash.c)0
-rw-r--r--src/devices/machine/linflash.h (renamed from src/emu/machine/linflash.h)0
-rw-r--r--src/devices/machine/lpc-acpi.c (renamed from src/emu/machine/lpc-acpi.c)0
-rw-r--r--src/devices/machine/lpc-acpi.h (renamed from src/emu/machine/lpc-acpi.h)0
-rw-r--r--src/devices/machine/lpc-pit.c (renamed from src/emu/machine/lpc-pit.c)0
-rw-r--r--src/devices/machine/lpc-pit.h (renamed from src/emu/machine/lpc-pit.h)0
-rw-r--r--src/devices/machine/lpc-rtc.c (renamed from src/emu/machine/lpc-rtc.c)0
-rw-r--r--src/devices/machine/lpc-rtc.h (renamed from src/emu/machine/lpc-rtc.h)0
-rw-r--r--src/devices/machine/lpc.c (renamed from src/emu/machine/lpc.c)0
-rw-r--r--src/devices/machine/lpc.h (renamed from src/emu/machine/lpc.h)0
-rw-r--r--src/devices/machine/lpci.c (renamed from src/emu/machine/lpci.c)0
-rw-r--r--src/devices/machine/lpci.h (renamed from src/emu/machine/lpci.h)0
-rw-r--r--src/devices/machine/m6m80011ap.c (renamed from src/emu/machine/m6m80011ap.c)0
-rw-r--r--src/devices/machine/m6m80011ap.h (renamed from src/emu/machine/m6m80011ap.h)0
-rw-r--r--src/devices/machine/matsucd.c (renamed from src/emu/machine/matsucd.c)0
-rw-r--r--src/devices/machine/matsucd.h (renamed from src/emu/machine/matsucd.h)0
-rw-r--r--src/devices/machine/mb14241.c (renamed from src/emu/machine/mb14241.c)0
-rw-r--r--src/devices/machine/mb14241.h (renamed from src/emu/machine/mb14241.h)0
-rw-r--r--src/devices/machine/mb3773.c (renamed from src/emu/machine/mb3773.c)0
-rw-r--r--src/devices/machine/mb3773.h (renamed from src/emu/machine/mb3773.h)0
-rw-r--r--src/devices/machine/mb8421.c (renamed from src/emu/machine/mb8421.c)0
-rw-r--r--src/devices/machine/mb8421.h (renamed from src/emu/machine/mb8421.h)0
-rw-r--r--src/devices/machine/mb87078.c (renamed from src/emu/machine/mb87078.c)0
-rw-r--r--src/devices/machine/mb87078.h (renamed from src/emu/machine/mb87078.h)0
-rw-r--r--src/devices/machine/mb8795.c (renamed from src/emu/machine/mb8795.c)0
-rw-r--r--src/devices/machine/mb8795.h (renamed from src/emu/machine/mb8795.h)0
-rw-r--r--src/devices/machine/mb89352.c (renamed from src/emu/machine/mb89352.c)0
-rw-r--r--src/devices/machine/mb89352.h (renamed from src/emu/machine/mb89352.h)0
-rw-r--r--src/devices/machine/mb89363b.c (renamed from src/emu/machine/mb89363b.c)0
-rw-r--r--src/devices/machine/mb89363b.h (renamed from src/emu/machine/mb89363b.h)0
-rw-r--r--src/devices/machine/mb89371.c (renamed from src/emu/machine/mb89371.c)0
-rw-r--r--src/devices/machine/mb89371.h (renamed from src/emu/machine/mb89371.h)0
-rw-r--r--src/devices/machine/mc146818.c (renamed from src/emu/machine/mc146818.c)17
-rw-r--r--src/devices/machine/mc146818.h (renamed from src/emu/machine/mc146818.h)16
-rw-r--r--src/devices/machine/mc2661.c (renamed from src/emu/machine/mc2661.c)0
-rw-r--r--src/devices/machine/mc2661.h (renamed from src/emu/machine/mc2661.h)0
-rw-r--r--src/devices/machine/mc68328.c (renamed from src/emu/machine/mc68328.c)3
-rw-r--r--src/devices/machine/mc68328.h (renamed from src/emu/machine/mc68328.h)3
-rw-r--r--src/devices/machine/mc6843.c (renamed from src/emu/machine/mc6843.c)0
-rw-r--r--src/devices/machine/mc6843.h (renamed from src/emu/machine/mc6843.h)0
-rw-r--r--src/devices/machine/mc6846.c (renamed from src/emu/machine/mc6846.c)0
-rw-r--r--src/devices/machine/mc6846.h (renamed from src/emu/machine/mc6846.h)0
-rw-r--r--src/devices/machine/mc6852.c (renamed from src/emu/machine/mc6852.c)0
-rw-r--r--src/devices/machine/mc6852.h (renamed from src/emu/machine/mc6852.h)0
-rw-r--r--src/devices/machine/mc6854.c (renamed from src/emu/machine/mc6854.c)0
-rw-r--r--src/devices/machine/mc6854.h (renamed from src/emu/machine/mc6854.h)0
-rw-r--r--src/devices/machine/mc68681.c (renamed from src/emu/machine/mc68681.c)0
-rw-r--r--src/devices/machine/mc68681.h (renamed from src/emu/machine/mc68681.h)0
-rw-r--r--src/devices/machine/mc68901.c (renamed from src/emu/machine/mc68901.c)0
-rw-r--r--src/devices/machine/mc68901.h (renamed from src/emu/machine/mc68901.h)0
-rw-r--r--src/devices/machine/mccs1850.c (renamed from src/emu/machine/mccs1850.c)0
-rw-r--r--src/devices/machine/mccs1850.h (renamed from src/emu/machine/mccs1850.h)0
-rw-r--r--src/devices/machine/mcf5206e.c (renamed from src/emu/machine/mcf5206e.c)0
-rw-r--r--src/devices/machine/mcf5206e.h (renamed from src/emu/machine/mcf5206e.h)0
-rw-r--r--src/devices/machine/microtch.c (renamed from src/emu/machine/microtch.c)0
-rw-r--r--src/devices/machine/microtch.h (renamed from src/emu/machine/microtch.h)0
-rw-r--r--src/devices/machine/mm58167.c (renamed from src/emu/machine/mm58167.c)0
-rw-r--r--src/devices/machine/mm58167.h (renamed from src/emu/machine/mm58167.h)0
-rw-r--r--src/devices/machine/mm58274c.c (renamed from src/emu/machine/mm58274c.c)0
-rw-r--r--src/devices/machine/mm58274c.h (renamed from src/emu/machine/mm58274c.h)0
-rw-r--r--src/devices/machine/mm74c922.c (renamed from src/emu/machine/mm74c922.c)0
-rw-r--r--src/devices/machine/mm74c922.h (renamed from src/emu/machine/mm74c922.h)0
-rw-r--r--src/devices/machine/mos6526.c (renamed from src/emu/machine/mos6526.c)0
-rw-r--r--src/devices/machine/mos6526.h (renamed from src/emu/machine/mos6526.h)0
-rw-r--r--src/devices/machine/mos6529.c (renamed from src/emu/machine/mos6529.c)0
-rw-r--r--src/devices/machine/mos6529.h (renamed from src/emu/machine/mos6529.h)0
-rw-r--r--src/devices/machine/mos6530.c (renamed from src/emu/machine/mos6530.c)0
-rw-r--r--src/devices/machine/mos6530.h (renamed from src/emu/machine/mos6530.h)0
-rw-r--r--src/devices/machine/mos6530n.c (renamed from src/emu/machine/mos6530n.c)0
-rw-r--r--src/devices/machine/mos6530n.h (renamed from src/emu/machine/mos6530n.h)0
-rw-r--r--src/devices/machine/mos6551.c (renamed from src/emu/machine/mos6551.c)0
-rw-r--r--src/devices/machine/mos6551.h (renamed from src/emu/machine/mos6551.h)0
-rw-r--r--src/devices/machine/mos6702.c (renamed from src/emu/machine/mos6702.c)0
-rw-r--r--src/devices/machine/mos6702.h (renamed from src/emu/machine/mos6702.h)0
-rw-r--r--src/devices/machine/mos8706.c (renamed from src/emu/machine/mos8706.c)0
-rw-r--r--src/devices/machine/mos8706.h (renamed from src/emu/machine/mos8706.h)0
-rw-r--r--src/devices/machine/mos8722.c (renamed from src/emu/machine/mos8722.c)0
-rw-r--r--src/devices/machine/mos8722.h (renamed from src/emu/machine/mos8722.h)0
-rw-r--r--src/devices/machine/mos8726.c (renamed from src/emu/machine/mos8726.c)0
-rw-r--r--src/devices/machine/mos8726.h (renamed from src/emu/machine/mos8726.h)0
-rw-r--r--src/devices/machine/mpu401.c (renamed from src/emu/machine/mpu401.c)0
-rw-r--r--src/devices/machine/mpu401.h (renamed from src/emu/machine/mpu401.h)0
-rw-r--r--src/devices/machine/msm5832.c (renamed from src/emu/machine/msm5832.c)0
-rw-r--r--src/devices/machine/msm5832.h (renamed from src/emu/machine/msm5832.h)0
-rw-r--r--src/devices/machine/msm58321.c (renamed from src/emu/machine/msm58321.c)0
-rw-r--r--src/devices/machine/msm58321.h (renamed from src/emu/machine/msm58321.h)0
-rw-r--r--src/devices/machine/msm6242.c (renamed from src/emu/machine/msm6242.c)0
-rw-r--r--src/devices/machine/msm6242.h (renamed from src/emu/machine/msm6242.h)0
-rw-r--r--src/devices/machine/ncr5380.c (renamed from src/emu/machine/ncr5380.c)0
-rw-r--r--src/devices/machine/ncr5380.h (renamed from src/emu/machine/ncr5380.h)0
-rw-r--r--src/devices/machine/ncr5380n.c (renamed from src/emu/machine/ncr5380n.c)0
-rw-r--r--src/devices/machine/ncr5380n.h (renamed from src/emu/machine/ncr5380n.h)0
-rw-r--r--src/devices/machine/ncr5390.c (renamed from src/emu/machine/ncr5390.c)0
-rw-r--r--src/devices/machine/ncr5390.h (renamed from src/emu/machine/ncr5390.h)0
-rw-r--r--src/devices/machine/ncr539x.c (renamed from src/emu/machine/ncr539x.c)0
-rw-r--r--src/devices/machine/ncr539x.h (renamed from src/emu/machine/ncr539x.h)0
-rw-r--r--src/devices/machine/netlist.c (renamed from src/emu/machine/netlist.c)107
-rw-r--r--src/devices/machine/netlist.h (renamed from src/emu/machine/netlist.h)20
-rw-r--r--src/devices/machine/nmc9306.c (renamed from src/emu/machine/nmc9306.c)0
-rw-r--r--src/devices/machine/nmc9306.h (renamed from src/emu/machine/nmc9306.h)0
-rw-r--r--src/devices/machine/nsc810.c (renamed from src/emu/machine/nsc810.c)0
-rw-r--r--src/devices/machine/nsc810.h (renamed from src/emu/machine/nsc810.h)0
-rw-r--r--src/devices/machine/nscsi_bus.c (renamed from src/emu/machine/nscsi_bus.c)0
-rw-r--r--src/devices/machine/nscsi_bus.h (renamed from src/emu/machine/nscsi_bus.h)0
-rw-r--r--src/devices/machine/nscsi_cb.c (renamed from src/emu/machine/nscsi_cb.c)0
-rw-r--r--src/devices/machine/nscsi_cb.h (renamed from src/emu/machine/nscsi_cb.h)0
-rw-r--r--src/devices/machine/nscsi_cd.c (renamed from src/emu/machine/nscsi_cd.c)0
-rw-r--r--src/devices/machine/nscsi_cd.h (renamed from src/emu/machine/nscsi_cd.h)0
-rw-r--r--src/devices/machine/nscsi_hd.c (renamed from src/emu/machine/nscsi_hd.c)0
-rw-r--r--src/devices/machine/nscsi_hd.h (renamed from src/emu/machine/nscsi_hd.h)0
-rw-r--r--src/devices/machine/nscsi_s1410.c (renamed from src/emu/machine/nscsi_s1410.c)0
-rw-r--r--src/devices/machine/nscsi_s1410.h (renamed from src/emu/machine/nscsi_s1410.h)0
-rw-r--r--src/devices/machine/nvram.c (renamed from src/emu/machine/nvram.c)10
-rw-r--r--src/devices/machine/nvram.h (renamed from src/emu/machine/nvram.h)0
-rw-r--r--src/devices/machine/pc_fdc.c (renamed from src/emu/machine/pc_fdc.c)0
-rw-r--r--src/devices/machine/pc_fdc.h (renamed from src/emu/machine/pc_fdc.h)0
-rw-r--r--src/devices/machine/pc_lpt.c (renamed from src/emu/machine/pc_lpt.c)0
-rw-r--r--src/devices/machine/pc_lpt.h (renamed from src/emu/machine/pc_lpt.h)0
-rw-r--r--src/devices/machine/pccard.c (renamed from src/emu/machine/pccard.c)0
-rw-r--r--src/devices/machine/pccard.h (renamed from src/emu/machine/pccard.h)0
-rw-r--r--src/devices/machine/pcf8593.c (renamed from src/emu/machine/pcf8593.c)0
-rw-r--r--src/devices/machine/pcf8593.h (renamed from src/emu/machine/pcf8593.h)0
-rw-r--r--src/devices/machine/pci-apic.c (renamed from src/emu/machine/pci-apic.c)0
-rw-r--r--src/devices/machine/pci-apic.h (renamed from src/emu/machine/pci-apic.h)0
-rw-r--r--src/devices/machine/pci-sata.c (renamed from src/emu/machine/pci-sata.c)0
-rw-r--r--src/devices/machine/pci-sata.h (renamed from src/emu/machine/pci-sata.h)0
-rw-r--r--src/devices/machine/pci-smbus.c (renamed from src/emu/machine/pci-smbus.c)0
-rw-r--r--src/devices/machine/pci-smbus.h (renamed from src/emu/machine/pci-smbus.h)0
-rw-r--r--src/devices/machine/pci-usb.c (renamed from src/emu/machine/pci-usb.c)0
-rw-r--r--src/devices/machine/pci-usb.h (renamed from src/emu/machine/pci-usb.h)0
-rw-r--r--src/devices/machine/pci.c (renamed from src/emu/machine/pci.c)11
-rw-r--r--src/devices/machine/pci.h (renamed from src/emu/machine/pci.h)0
-rw-r--r--src/devices/machine/pci9050.c (renamed from src/emu/machine/pci9050.c)0
-rw-r--r--src/devices/machine/pci9050.h (renamed from src/emu/machine/pci9050.h)0
-rw-r--r--src/devices/machine/pckeybrd.c (renamed from src/emu/machine/pckeybrd.c)0
-rw-r--r--src/devices/machine/pckeybrd.h (renamed from src/emu/machine/pckeybrd.h)0
-rw-r--r--src/devices/machine/pic8259.c (renamed from src/emu/machine/pic8259.c)0
-rw-r--r--src/devices/machine/pic8259.h (renamed from src/emu/machine/pic8259.h)3
-rw-r--r--src/devices/machine/pit8253.c (renamed from src/emu/machine/pit8253.c)28
-rw-r--r--src/devices/machine/pit8253.h (renamed from src/emu/machine/pit8253.h)3
-rw-r--r--src/devices/machine/pla.c (renamed from src/emu/machine/pla.c)0
-rw-r--r--src/devices/machine/pla.h (renamed from src/emu/machine/pla.h)0
-rw-r--r--src/devices/machine/r10696.c (renamed from src/emu/machine/r10696.c)0
-rw-r--r--src/devices/machine/r10696.h (renamed from src/emu/machine/r10696.h)0
-rw-r--r--src/devices/machine/r10788.c (renamed from src/emu/machine/r10788.c)0
-rw-r--r--src/devices/machine/r10788.h (renamed from src/emu/machine/r10788.h)0
-rw-r--r--src/devices/machine/ra17xx.c (renamed from src/emu/machine/ra17xx.c)0
-rw-r--r--src/devices/machine/ra17xx.h (renamed from src/emu/machine/ra17xx.h)0
-rw-r--r--src/devices/machine/ram.c (renamed from src/emu/machine/ram.c)0
-rw-r--r--src/devices/machine/ram.h (renamed from src/emu/machine/ram.h)0
-rw-r--r--src/devices/machine/rescap.h (renamed from src/emu/machine/rescap.h)0
-rw-r--r--src/devices/machine/rf5c296.c (renamed from src/emu/machine/rf5c296.c)0
-rw-r--r--src/devices/machine/rf5c296.h (renamed from src/emu/machine/rf5c296.h)0
-rw-r--r--src/devices/machine/roc10937.c (renamed from src/emu/machine/roc10937.c)0
-rw-r--r--src/devices/machine/roc10937.h (renamed from src/emu/machine/roc10937.h)0
-rw-r--r--src/devices/machine/rp5c01.c (renamed from src/emu/machine/rp5c01.c)0
-rw-r--r--src/devices/machine/rp5c01.h (renamed from src/emu/machine/rp5c01.h)0
-rw-r--r--src/devices/machine/rp5c15.c (renamed from src/emu/machine/rp5c15.c)0
-rw-r--r--src/devices/machine/rp5c15.h (renamed from src/emu/machine/rp5c15.h)0
-rw-r--r--src/devices/machine/rp5h01.c (renamed from src/emu/machine/rp5h01.c)0
-rw-r--r--src/devices/machine/rp5h01.h (renamed from src/emu/machine/rp5h01.h)0
-rw-r--r--src/devices/machine/rtc4543.c (renamed from src/emu/machine/rtc4543.c)0
-rw-r--r--src/devices/machine/rtc4543.h (renamed from src/emu/machine/rtc4543.h)0
-rw-r--r--src/devices/machine/rtc65271.c (renamed from src/emu/machine/rtc65271.c)0
-rw-r--r--src/devices/machine/rtc65271.h (renamed from src/emu/machine/rtc65271.h)0
-rw-r--r--src/devices/machine/rtc9701.c (renamed from src/emu/machine/rtc9701.c)0
-rw-r--r--src/devices/machine/rtc9701.h (renamed from src/emu/machine/rtc9701.h)0
-rw-r--r--src/devices/machine/s2636.c (renamed from src/emu/machine/s2636.c)0
-rw-r--r--src/devices/machine/s2636.h (renamed from src/emu/machine/s2636.h)0
-rw-r--r--src/devices/machine/s3520cf.c (renamed from src/emu/machine/s3520cf.c)0
-rw-r--r--src/devices/machine/s3520cf.h (renamed from src/emu/machine/s3520cf.h)0
-rw-r--r--src/devices/machine/s3c2400.c (renamed from src/emu/machine/s3c2400.c)0
-rw-r--r--src/devices/machine/s3c2400.h (renamed from src/emu/machine/s3c2400.h)0
-rw-r--r--src/devices/machine/s3c2410.c (renamed from src/emu/machine/s3c2410.c)0
-rw-r--r--src/devices/machine/s3c2410.h (renamed from src/emu/machine/s3c2410.h)0
-rw-r--r--src/devices/machine/s3c2440.c (renamed from src/emu/machine/s3c2440.c)0
-rw-r--r--src/devices/machine/s3c2440.h (renamed from src/emu/machine/s3c2440.h)0
-rw-r--r--src/devices/machine/s3c24xx.inc (renamed from src/emu/machine/s3c24xx.inc)0
-rw-r--r--src/devices/machine/s3c44b0.c (renamed from src/emu/machine/s3c44b0.c)0
-rw-r--r--src/devices/machine/s3c44b0.h (renamed from src/emu/machine/s3c44b0.h)0
-rw-r--r--src/devices/machine/saturn.c (renamed from src/emu/machine/saturn.c)2
-rw-r--r--src/devices/machine/serflash.c (renamed from src/emu/machine/serflash.c)0
-rw-r--r--src/devices/machine/serflash.h (renamed from src/emu/machine/serflash.h)0
-rw-r--r--src/devices/machine/smc91c9x.c (renamed from src/emu/machine/smc91c9x.c)0
-rw-r--r--src/devices/machine/smc91c9x.h (renamed from src/emu/machine/smc91c9x.h)0
-rw-r--r--src/devices/machine/smpc.c (renamed from src/emu/machine/smpc.c)12
-rw-r--r--src/devices/machine/smpc.h (renamed from src/emu/machine/smpc.h)0
-rw-r--r--src/devices/machine/spchrom.c (renamed from src/emu/machine/spchrom.c)0
-rw-r--r--src/devices/machine/spchrom.h (renamed from src/emu/machine/spchrom.h)0
-rw-r--r--src/devices/machine/steppers.c (renamed from src/emu/machine/steppers.c)0
-rw-r--r--src/devices/machine/steppers.h (renamed from src/emu/machine/steppers.h)0
-rw-r--r--src/devices/machine/strata.c (renamed from src/emu/machine/strata.c)0
-rw-r--r--src/devices/machine/strata.h (renamed from src/emu/machine/strata.h)0
-rw-r--r--src/devices/machine/stvcd.c (renamed from src/emu/machine/stvcd.c)7
-rw-r--r--src/devices/machine/t10mmc.c (renamed from src/emu/machine/t10mmc.c)0
-rw-r--r--src/devices/machine/t10mmc.h (renamed from src/emu/machine/t10mmc.h)0
-rw-r--r--src/devices/machine/t10sbc.c (renamed from src/emu/machine/t10sbc.c)0
-rw-r--r--src/devices/machine/t10sbc.h (renamed from src/emu/machine/t10sbc.h)0
-rw-r--r--src/devices/machine/t10spc.c (renamed from src/emu/machine/t10spc.c)0
-rw-r--r--src/devices/machine/t10spc.h (renamed from src/emu/machine/t10spc.h)0
-rw-r--r--src/devices/machine/tc009xlvc.c (renamed from src/emu/machine/tc009xlvc.c)0
-rw-r--r--src/devices/machine/tc009xlvc.h (renamed from src/emu/machine/tc009xlvc.h)0
-rw-r--r--src/devices/machine/terminal.c (renamed from src/emu/machine/terminal.c)0
-rw-r--r--src/devices/machine/terminal.h (renamed from src/emu/machine/terminal.h)0
-rw-r--r--src/devices/machine/timekpr.c (renamed from src/emu/machine/timekpr.c)0
-rw-r--r--src/devices/machine/timekpr.h (renamed from src/emu/machine/timekpr.h)0
-rw-r--r--src/devices/machine/tmp68301.c (renamed from src/emu/machine/tmp68301.c)11
-rw-r--r--src/devices/machine/tmp68301.h (renamed from src/emu/machine/tmp68301.h)1
-rw-r--r--src/devices/machine/tms1024.c (renamed from src/emu/machine/tms1024.c)0
-rw-r--r--src/devices/machine/tms1024.h (renamed from src/emu/machine/tms1024.h)0
-rw-r--r--src/devices/machine/tms5501.c (renamed from src/emu/machine/tms5501.c)0
-rw-r--r--src/devices/machine/tms5501.h (renamed from src/emu/machine/tms5501.h)0
-rw-r--r--src/devices/machine/tms6100.c (renamed from src/emu/machine/tms6100.c)23
-rw-r--r--src/devices/machine/tms6100.h (renamed from src/emu/machine/tms6100.h)3
-rw-r--r--src/devices/machine/tms9901.c (renamed from src/emu/machine/tms9901.c)0
-rw-r--r--src/devices/machine/tms9901.h (renamed from src/emu/machine/tms9901.h)0
-rw-r--r--src/devices/machine/tms9902.c (renamed from src/emu/machine/tms9902.c)0
-rw-r--r--src/devices/machine/tms9902.h (renamed from src/emu/machine/tms9902.h)0
-rw-r--r--src/devices/machine/upd1990a.c (renamed from src/emu/machine/upd1990a.c)0
-rw-r--r--src/devices/machine/upd1990a.h (renamed from src/emu/machine/upd1990a.h)0
-rw-r--r--src/devices/machine/upd4701.c (renamed from src/emu/machine/upd4701.c)0
-rw-r--r--src/devices/machine/upd4701.h (renamed from src/emu/machine/upd4701.h)0
-rw-r--r--src/devices/machine/upd4992.c (renamed from src/emu/machine/upd4992.c)0
-rw-r--r--src/devices/machine/upd4992.h (renamed from src/emu/machine/upd4992.h)0
-rw-r--r--src/devices/machine/upd7002.c (renamed from src/emu/machine/upd7002.c)0
-rw-r--r--src/devices/machine/upd7002.h (renamed from src/emu/machine/upd7002.h)0
-rw-r--r--src/devices/machine/upd71071.c (renamed from src/emu/machine/upd71071.c)0
-rw-r--r--src/devices/machine/upd71071.h (renamed from src/emu/machine/upd71071.h)0
-rw-r--r--src/devices/machine/upd765.c (renamed from src/emu/machine/upd765.c)6
-rw-r--r--src/devices/machine/upd765.h (renamed from src/emu/machine/upd765.h)0
-rw-r--r--src/devices/machine/v3021.c (renamed from src/emu/machine/v3021.c)0
-rw-r--r--src/devices/machine/v3021.h (renamed from src/emu/machine/v3021.h)0
-rw-r--r--src/devices/machine/vrc4373.c (renamed from src/emu/machine/vrc4373.c)0
-rw-r--r--src/devices/machine/vrc4373.h (renamed from src/emu/machine/vrc4373.h)0
-rw-r--r--src/devices/machine/vt82c496.c225
-rw-r--r--src/devices/machine/vt82c496.h60
-rw-r--r--src/devices/machine/vt83c461.c (renamed from src/emu/machine/vt83c461.c)0
-rw-r--r--src/devices/machine/vt83c461.h (renamed from src/emu/machine/vt83c461.h)0
-rw-r--r--src/devices/machine/wd11c00_17.c (renamed from src/emu/machine/wd11c00_17.c)0
-rw-r--r--src/devices/machine/wd11c00_17.h (renamed from src/emu/machine/wd11c00_17.h)0
-rw-r--r--src/devices/machine/wd2010.c (renamed from src/emu/machine/wd2010.c)0
-rw-r--r--src/devices/machine/wd2010.h (renamed from src/emu/machine/wd2010.h)0
-rw-r--r--src/devices/machine/wd33c93.c (renamed from src/emu/machine/wd33c93.c)0
-rw-r--r--src/devices/machine/wd33c93.h (renamed from src/emu/machine/wd33c93.h)0
-rw-r--r--src/devices/machine/wd7600.c (renamed from src/emu/machine/wd7600.c)0
-rw-r--r--src/devices/machine/wd7600.h (renamed from src/emu/machine/wd7600.h)0
-rw-r--r--src/devices/machine/wd_fdc.c (renamed from src/emu/machine/wd_fdc.c)4
-rw-r--r--src/devices/machine/wd_fdc.h (renamed from src/emu/machine/wd_fdc.h)2
-rw-r--r--src/devices/machine/wozfdc.c (renamed from src/emu/machine/wozfdc.c)0
-rw-r--r--src/devices/machine/wozfdc.h (renamed from src/emu/machine/wozfdc.h)0
-rw-r--r--src/devices/machine/x2212.c (renamed from src/emu/machine/x2212.c)0
-rw-r--r--src/devices/machine/x2212.h (renamed from src/emu/machine/x2212.h)0
-rw-r--r--src/devices/machine/x76f041.c (renamed from src/emu/machine/x76f041.c)0
-rw-r--r--src/devices/machine/x76f041.h (renamed from src/emu/machine/x76f041.h)0
-rw-r--r--src/devices/machine/x76f100.c (renamed from src/emu/machine/x76f100.c)0
-rw-r--r--src/devices/machine/x76f100.h (renamed from src/emu/machine/x76f100.h)0
-rw-r--r--src/devices/machine/ym2148.c (renamed from src/emu/machine/ym2148.c)0
-rw-r--r--src/devices/machine/ym2148.h (renamed from src/emu/machine/ym2148.h)0
-rw-r--r--src/devices/machine/z80ctc.c (renamed from src/emu/machine/z80ctc.c)2
-rw-r--r--src/devices/machine/z80ctc.h (renamed from src/emu/machine/z80ctc.h)0
-rw-r--r--src/devices/machine/z80dart.c (renamed from src/emu/machine/z80dart.c)0
-rw-r--r--src/devices/machine/z80dart.h (renamed from src/emu/machine/z80dart.h)0
-rw-r--r--src/devices/machine/z80dma.c (renamed from src/emu/machine/z80dma.c)0
-rw-r--r--src/devices/machine/z80dma.h (renamed from src/emu/machine/z80dma.h)0
-rw-r--r--src/devices/machine/z80pio.c (renamed from src/emu/machine/z80pio.c)0
-rw-r--r--src/devices/machine/z80pio.h (renamed from src/emu/machine/z80pio.h)0
-rw-r--r--src/devices/machine/z80scc.c2241
-rw-r--r--src/devices/machine/z80scc.h728
-rw-r--r--src/devices/machine/z80sio.c1429
-rw-r--r--src/devices/machine/z80sio.h533
-rw-r--r--src/devices/machine/z80sti.c (renamed from src/emu/machine/z80sti.c)0
-rw-r--r--src/devices/machine/z80sti.h (renamed from src/emu/machine/z80sti.h)0
-rw-r--r--src/devices/machine/z8536.c (renamed from src/emu/machine/z8536.c)0
-rw-r--r--src/devices/machine/z8536.h (renamed from src/emu/machine/z8536.h)0
-rw-r--r--src/devices/sound/2151intf.c (renamed from src/emu/sound/2151intf.c)0
-rw-r--r--src/devices/sound/2151intf.h (renamed from src/emu/sound/2151intf.h)0
-rw-r--r--src/devices/sound/2203intf.c (renamed from src/emu/sound/2203intf.c)0
-rw-r--r--src/devices/sound/2203intf.h (renamed from src/emu/sound/2203intf.h)0
-rw-r--r--src/devices/sound/2413intf.c (renamed from src/emu/sound/2413intf.c)0
-rw-r--r--src/devices/sound/2413intf.h (renamed from src/emu/sound/2413intf.h)0
-rw-r--r--src/devices/sound/2608intf.c (renamed from src/emu/sound/2608intf.c)0
-rw-r--r--src/devices/sound/2608intf.h (renamed from src/emu/sound/2608intf.h)0
-rw-r--r--src/devices/sound/2610intf.c (renamed from src/emu/sound/2610intf.c)0
-rw-r--r--src/devices/sound/2610intf.h (renamed from src/emu/sound/2610intf.h)0
-rw-r--r--src/devices/sound/2612intf.c (renamed from src/emu/sound/2612intf.c)0
-rw-r--r--src/devices/sound/2612intf.h (renamed from src/emu/sound/2612intf.h)0
-rw-r--r--src/devices/sound/262intf.c (renamed from src/emu/sound/262intf.c)0
-rw-r--r--src/devices/sound/262intf.h (renamed from src/emu/sound/262intf.h)0
-rw-r--r--src/devices/sound/315-5641.c70
-rw-r--r--src/devices/sound/315-5641.h30
-rw-r--r--src/devices/sound/3526intf.c (renamed from src/emu/sound/3526intf.c)0
-rw-r--r--src/devices/sound/3526intf.h (renamed from src/emu/sound/3526intf.h)0
-rw-r--r--src/devices/sound/3812intf.c (renamed from src/emu/sound/3812intf.c)0
-rw-r--r--src/devices/sound/3812intf.h (renamed from src/emu/sound/3812intf.h)0
-rw-r--r--src/devices/sound/8950intf.c (renamed from src/emu/sound/8950intf.c)0
-rw-r--r--src/devices/sound/8950intf.h (renamed from src/emu/sound/8950intf.h)0
-rw-r--r--src/devices/sound/aica.c (renamed from src/emu/sound/aica.c)0
-rw-r--r--src/devices/sound/aica.h (renamed from src/emu/sound/aica.h)0
-rw-r--r--src/devices/sound/aicadsp.c (renamed from src/emu/sound/aicadsp.c)0
-rw-r--r--src/devices/sound/aicadsp.h (renamed from src/emu/sound/aicadsp.h)0
-rw-r--r--src/devices/sound/amiga.c (renamed from src/emu/sound/amiga.c)0
-rw-r--r--src/devices/sound/amiga.h (renamed from src/emu/sound/amiga.h)0
-rw-r--r--src/devices/sound/asc.c (renamed from src/emu/sound/asc.c)0
-rw-r--r--src/devices/sound/asc.h (renamed from src/emu/sound/asc.h)0
-rw-r--r--src/devices/sound/astrocde.c (renamed from src/emu/sound/astrocde.c)0
-rw-r--r--src/devices/sound/astrocde.h (renamed from src/emu/sound/astrocde.h)0
-rw-r--r--src/devices/sound/awacs.c (renamed from src/emu/sound/awacs.c)0
-rw-r--r--src/devices/sound/awacs.h (renamed from src/emu/sound/awacs.h)0
-rw-r--r--src/devices/sound/ay8910.c (renamed from src/emu/sound/ay8910.c)0
-rw-r--r--src/devices/sound/ay8910.h (renamed from src/emu/sound/ay8910.h)0
-rw-r--r--src/devices/sound/beep.c (renamed from src/emu/sound/beep.c)0
-rw-r--r--src/devices/sound/beep.h (renamed from src/emu/sound/beep.h)0
-rw-r--r--src/devices/sound/bsmt2000.c (renamed from src/emu/sound/bsmt2000.c)0
-rw-r--r--src/devices/sound/bsmt2000.h (renamed from src/emu/sound/bsmt2000.h)0
-rw-r--r--src/devices/sound/c140.c (renamed from src/emu/sound/c140.c)20
-rw-r--r--src/devices/sound/c140.h (renamed from src/emu/sound/c140.h)30
-rw-r--r--src/devices/sound/c352.c (renamed from src/emu/sound/c352.c)26
-rw-r--r--src/devices/sound/c352.h (renamed from src/emu/sound/c352.h)11
-rw-r--r--src/devices/sound/c6280.c (renamed from src/emu/sound/c6280.c)0
-rw-r--r--src/devices/sound/c6280.h (renamed from src/emu/sound/c6280.h)0
-rw-r--r--src/devices/sound/cdda.c (renamed from src/emu/sound/cdda.c)0
-rw-r--r--src/devices/sound/cdda.h (renamed from src/emu/sound/cdda.h)0
-rw-r--r--src/devices/sound/cdp1863.c (renamed from src/emu/sound/cdp1863.c)0
-rw-r--r--src/devices/sound/cdp1863.h (renamed from src/emu/sound/cdp1863.h)0
-rw-r--r--src/devices/sound/cdp1864.c (renamed from src/emu/sound/cdp1864.c)0
-rw-r--r--src/devices/sound/cdp1864.h (renamed from src/emu/sound/cdp1864.h)0
-rw-r--r--src/devices/sound/cdp1869.c (renamed from src/emu/sound/cdp1869.c)0
-rw-r--r--src/devices/sound/cdp1869.h (renamed from src/emu/sound/cdp1869.h)0
-rw-r--r--src/devices/sound/cem3394.c (renamed from src/emu/sound/cem3394.c)0
-rw-r--r--src/devices/sound/cem3394.h (renamed from src/emu/sound/cem3394.h)0
-rw-r--r--src/devices/sound/dac.c (renamed from src/emu/sound/dac.c)0
-rw-r--r--src/devices/sound/dac.h (renamed from src/emu/sound/dac.h)0
-rw-r--r--src/devices/sound/digitalk.c (renamed from src/emu/sound/digitalk.c)6
-rw-r--r--src/devices/sound/digitalk.h (renamed from src/emu/sound/digitalk.h)0
-rw-r--r--src/devices/sound/disc_cls.h (renamed from src/emu/sound/disc_cls.h)0
-rw-r--r--src/devices/sound/disc_dev.h (renamed from src/emu/sound/disc_dev.h)0
-rw-r--r--src/devices/sound/disc_dev.inc (renamed from src/emu/sound/disc_dev.inc)0
-rw-r--r--src/devices/sound/disc_flt.h (renamed from src/emu/sound/disc_flt.h)0
-rw-r--r--src/devices/sound/disc_flt.inc (renamed from src/emu/sound/disc_flt.inc)0
-rw-r--r--src/devices/sound/disc_inp.inc (renamed from src/emu/sound/disc_inp.inc)0
-rw-r--r--src/devices/sound/disc_mth.h (renamed from src/emu/sound/disc_mth.h)0
-rw-r--r--src/devices/sound/disc_mth.inc (renamed from src/emu/sound/disc_mth.inc)0
-rw-r--r--src/devices/sound/disc_sys.inc (renamed from src/emu/sound/disc_sys.inc)0
-rw-r--r--src/devices/sound/disc_wav.h (renamed from src/emu/sound/disc_wav.h)0
-rw-r--r--src/devices/sound/disc_wav.inc (renamed from src/emu/sound/disc_wav.inc)0
-rw-r--r--src/devices/sound/discrete.c (renamed from src/emu/sound/discrete.c)16
-rw-r--r--src/devices/sound/discrete.h (renamed from src/emu/sound/discrete.h)2
-rw-r--r--src/devices/sound/dmadac.c (renamed from src/emu/sound/dmadac.c)0
-rw-r--r--src/devices/sound/dmadac.h (renamed from src/emu/sound/dmadac.h)0
-rw-r--r--src/devices/sound/es1373.c (renamed from src/emu/sound/es1373.c)0
-rw-r--r--src/devices/sound/es1373.h (renamed from src/emu/sound/es1373.h)0
-rw-r--r--src/devices/sound/es5503.c (renamed from src/emu/sound/es5503.c)0
-rw-r--r--src/devices/sound/es5503.h (renamed from src/emu/sound/es5503.h)0
-rw-r--r--src/devices/sound/es5506.c (renamed from src/emu/sound/es5506.c)2
-rw-r--r--src/devices/sound/es5506.h (renamed from src/emu/sound/es5506.h)0
-rw-r--r--src/devices/sound/es8712.c (renamed from src/emu/sound/es8712.c)0
-rw-r--r--src/devices/sound/es8712.h (renamed from src/emu/sound/es8712.h)0
-rw-r--r--src/devices/sound/esqpump.c (renamed from src/emu/sound/esqpump.c)0
-rw-r--r--src/devices/sound/esqpump.h (renamed from src/emu/sound/esqpump.h)0
-rw-r--r--src/devices/sound/flt_rc.c (renamed from src/emu/sound/flt_rc.c)0
-rw-r--r--src/devices/sound/flt_rc.h (renamed from src/emu/sound/flt_rc.h)0
-rw-r--r--src/devices/sound/flt_vol.c (renamed from src/emu/sound/flt_vol.c)0
-rw-r--r--src/devices/sound/flt_vol.h (renamed from src/emu/sound/flt_vol.h)0
-rw-r--r--src/devices/sound/fm.c (renamed from src/emu/sound/fm.c)0
-rw-r--r--src/devices/sound/fm.h (renamed from src/emu/sound/fm.h)0
-rw-r--r--src/devices/sound/fm2612.c (renamed from src/emu/sound/fm2612.c)0
-rw-r--r--src/devices/sound/fmopl.c (renamed from src/emu/sound/fmopl.c)0
-rw-r--r--src/devices/sound/fmopl.h (renamed from src/emu/sound/fmopl.h)0
-rw-r--r--src/devices/sound/gaelco.c (renamed from src/emu/sound/gaelco.c)2
-rw-r--r--src/devices/sound/gaelco.h (renamed from src/emu/sound/gaelco.h)0
-rw-r--r--src/devices/sound/hc55516.c (renamed from src/emu/sound/hc55516.c)0
-rw-r--r--src/devices/sound/hc55516.h (renamed from src/emu/sound/hc55516.h)0
-rw-r--r--src/devices/sound/i5000.c (renamed from src/emu/sound/i5000.c)0
-rw-r--r--src/devices/sound/i5000.h (renamed from src/emu/sound/i5000.h)0
-rw-r--r--src/devices/sound/ics2115.c (renamed from src/emu/sound/ics2115.c)0
-rw-r--r--src/devices/sound/ics2115.h (renamed from src/emu/sound/ics2115.h)0
-rw-r--r--src/devices/sound/iremga20.c (renamed from src/emu/sound/iremga20.c)0
-rw-r--r--src/devices/sound/iremga20.h (renamed from src/emu/sound/iremga20.h)0
-rw-r--r--src/devices/sound/k005289.c (renamed from src/emu/sound/k005289.c)0
-rw-r--r--src/devices/sound/k005289.h (renamed from src/emu/sound/k005289.h)0
-rw-r--r--src/devices/sound/k007232.c (renamed from src/emu/sound/k007232.c)0
-rw-r--r--src/devices/sound/k007232.h (renamed from src/emu/sound/k007232.h)0
-rw-r--r--src/devices/sound/k051649.c (renamed from src/emu/sound/k051649.c)0
-rw-r--r--src/devices/sound/k051649.h (renamed from src/emu/sound/k051649.h)0
-rw-r--r--src/devices/sound/k053260.c (renamed from src/emu/sound/k053260.c)0
-rw-r--r--src/devices/sound/k053260.h (renamed from src/emu/sound/k053260.h)0
-rw-r--r--src/devices/sound/k054539.c (renamed from src/emu/sound/k054539.c)0
-rw-r--r--src/devices/sound/k054539.h (renamed from src/emu/sound/k054539.h)0
-rw-r--r--src/devices/sound/k056800.c (renamed from src/emu/sound/k056800.c)0
-rw-r--r--src/devices/sound/k056800.h (renamed from src/emu/sound/k056800.h)0
-rw-r--r--src/devices/sound/l7a1045_l6028_dsp_a.c (renamed from src/emu/sound/l7a1045_l6028_dsp_a.c)2
-rw-r--r--src/devices/sound/l7a1045_l6028_dsp_a.h (renamed from src/emu/sound/l7a1045_l6028_dsp_a.h)2
-rw-r--r--src/devices/sound/lmc1992.c (renamed from src/emu/sound/lmc1992.c)0
-rw-r--r--src/devices/sound/lmc1992.h (renamed from src/emu/sound/lmc1992.h)0
-rw-r--r--src/devices/sound/mas3507d.c (renamed from src/emu/sound/mas3507d.c)0
-rw-r--r--src/devices/sound/mas3507d.h (renamed from src/emu/sound/mas3507d.h)0
-rw-r--r--src/devices/sound/mos6560.c (renamed from src/emu/sound/mos6560.c)0
-rw-r--r--src/devices/sound/mos6560.h (renamed from src/emu/sound/mos6560.h)0
-rw-r--r--src/devices/sound/mos6581.c (renamed from src/emu/sound/mos6581.c)0
-rw-r--r--src/devices/sound/mos6581.h (renamed from src/emu/sound/mos6581.h)0
-rw-r--r--src/devices/sound/mos7360.c (renamed from src/emu/sound/mos7360.c)0
-rw-r--r--src/devices/sound/mos7360.h (renamed from src/emu/sound/mos7360.h)0
-rw-r--r--src/devices/sound/mpeg_audio.c (renamed from src/emu/sound/mpeg_audio.c)0
-rw-r--r--src/devices/sound/mpeg_audio.h (renamed from src/emu/sound/mpeg_audio.h)0
-rw-r--r--src/devices/sound/msm5205.c (renamed from src/emu/sound/msm5205.c)0
-rw-r--r--src/devices/sound/msm5205.h (renamed from src/emu/sound/msm5205.h)0
-rw-r--r--src/devices/sound/msm5232.c (renamed from src/emu/sound/msm5232.c)0
-rw-r--r--src/devices/sound/msm5232.h (renamed from src/emu/sound/msm5232.h)0
-rw-r--r--src/devices/sound/multipcm.c (renamed from src/emu/sound/multipcm.c)0
-rw-r--r--src/devices/sound/multipcm.h (renamed from src/emu/sound/multipcm.h)0
-rw-r--r--src/devices/sound/n63701x.c (renamed from src/emu/sound/n63701x.c)0
-rw-r--r--src/devices/sound/n63701x.h (renamed from src/emu/sound/n63701x.h)0
-rw-r--r--src/devices/sound/namco.c (renamed from src/emu/sound/namco.c)0
-rw-r--r--src/devices/sound/namco.h (renamed from src/emu/sound/namco.h)0
-rw-r--r--src/devices/sound/nes_apu.c (renamed from src/emu/sound/nes_apu.c)4
-rw-r--r--src/devices/sound/nes_apu.h (renamed from src/emu/sound/nes_apu.h)0
-rw-r--r--src/devices/sound/nes_defs.h (renamed from src/emu/sound/nes_defs.h)0
-rw-r--r--src/devices/sound/nile.c (renamed from src/emu/sound/nile.c)0
-rw-r--r--src/devices/sound/nile.h (renamed from src/emu/sound/nile.h)0
-rw-r--r--src/devices/sound/okiadpcm.c (renamed from src/emu/sound/okiadpcm.c)0
-rw-r--r--src/devices/sound/okiadpcm.h (renamed from src/emu/sound/okiadpcm.h)0
-rw-r--r--src/devices/sound/okim6258.c (renamed from src/emu/sound/okim6258.c)0
-rw-r--r--src/devices/sound/okim6258.h (renamed from src/emu/sound/okim6258.h)0
-rw-r--r--src/devices/sound/okim6295.c (renamed from src/emu/sound/okim6295.c)0
-rw-r--r--src/devices/sound/okim6295.h (renamed from src/emu/sound/okim6295.h)0
-rw-r--r--src/devices/sound/okim6376.c (renamed from src/emu/sound/okim6376.c)0
-rw-r--r--src/devices/sound/okim6376.h (renamed from src/emu/sound/okim6376.h)0
-rw-r--r--src/devices/sound/okim9810.c (renamed from src/emu/sound/okim9810.c)0
-rw-r--r--src/devices/sound/okim9810.h (renamed from src/emu/sound/okim9810.h)0
-rw-r--r--src/devices/sound/pci-ac97.c (renamed from src/emu/sound/pci-ac97.c)0
-rw-r--r--src/devices/sound/pci-ac97.h (renamed from src/emu/sound/pci-ac97.h)0
-rw-r--r--src/devices/sound/pokey.c (renamed from src/emu/sound/pokey.c)0
-rw-r--r--src/devices/sound/pokey.h (renamed from src/emu/sound/pokey.h)0
-rw-r--r--src/devices/sound/pokey.txt (renamed from src/emu/sound/pokey.txt)0
-rw-r--r--src/devices/sound/qs1000.c (renamed from src/emu/sound/qs1000.c)0
-rw-r--r--src/devices/sound/qs1000.h (renamed from src/emu/sound/qs1000.h)0
-rw-r--r--src/devices/sound/qsound.c (renamed from src/emu/sound/qsound.c)0
-rw-r--r--src/devices/sound/qsound.h (renamed from src/emu/sound/qsound.h)0
-rw-r--r--src/devices/sound/rf5c400.c (renamed from src/emu/sound/rf5c400.c)12
-rw-r--r--src/devices/sound/rf5c400.h (renamed from src/emu/sound/rf5c400.h)0
-rw-r--r--src/devices/sound/rf5c68.c (renamed from src/emu/sound/rf5c68.c)0
-rw-r--r--src/devices/sound/rf5c68.h (renamed from src/emu/sound/rf5c68.h)0
-rw-r--r--src/devices/sound/s14001a.c (renamed from src/emu/sound/s14001a.c)0
-rw-r--r--src/devices/sound/s14001a.h (renamed from src/emu/sound/s14001a.h)0
-rw-r--r--src/devices/sound/saa1099.c (renamed from src/emu/sound/saa1099.c)0
-rw-r--r--src/devices/sound/saa1099.h (renamed from src/emu/sound/saa1099.h)0
-rw-r--r--src/devices/sound/samples.c (renamed from src/emu/sound/samples.c)12
-rw-r--r--src/devices/sound/samples.h (renamed from src/emu/sound/samples.h)3
-rw-r--r--src/devices/sound/sb0400.c (renamed from src/emu/sound/sb0400.c)0
-rw-r--r--src/devices/sound/sb0400.h (renamed from src/emu/sound/sb0400.h)0
-rw-r--r--src/devices/sound/scsp.c (renamed from src/emu/sound/scsp.c)19
-rw-r--r--src/devices/sound/scsp.h (renamed from src/emu/sound/scsp.h)0
-rw-r--r--src/devices/sound/scspdsp.c (renamed from src/emu/sound/scspdsp.c)0
-rw-r--r--src/devices/sound/scspdsp.h (renamed from src/emu/sound/scspdsp.h)0
-rw-r--r--src/devices/sound/segapcm.c (renamed from src/emu/sound/segapcm.c)0
-rw-r--r--src/devices/sound/segapcm.h (renamed from src/emu/sound/segapcm.h)0
-rw-r--r--src/devices/sound/sid.c (renamed from src/emu/sound/sid.c)0
-rw-r--r--src/devices/sound/sid.h (renamed from src/emu/sound/sid.h)0
-rw-r--r--src/devices/sound/side6581.h (renamed from src/emu/sound/side6581.h)0
-rw-r--r--src/devices/sound/sidenvel.c (renamed from src/emu/sound/sidenvel.c)0
-rw-r--r--src/devices/sound/sidenvel.h (renamed from src/emu/sound/sidenvel.h)0
-rw-r--r--src/devices/sound/sidvoice.c (renamed from src/emu/sound/sidvoice.c)0
-rw-r--r--src/devices/sound/sidvoice.h (renamed from src/emu/sound/sidvoice.h)0
-rw-r--r--src/devices/sound/sidw6581.h (renamed from src/emu/sound/sidw6581.h)0
-rw-r--r--src/devices/sound/sidw8580.h (renamed from src/emu/sound/sidw8580.h)0
-rw-r--r--src/devices/sound/sn76477.c (renamed from src/emu/sound/sn76477.c)2
-rw-r--r--src/devices/sound/sn76477.h (renamed from src/emu/sound/sn76477.h)0
-rw-r--r--src/devices/sound/sn76496.c (renamed from src/emu/sound/sn76496.c)17
-rw-r--r--src/devices/sound/sn76496.h (renamed from src/emu/sound/sn76496.h)4
-rw-r--r--src/devices/sound/snkwave.c (renamed from src/emu/sound/snkwave.c)0
-rw-r--r--src/devices/sound/snkwave.h (renamed from src/emu/sound/snkwave.h)0
-rw-r--r--src/devices/sound/sp0250.c (renamed from src/emu/sound/sp0250.c)0
-rw-r--r--src/devices/sound/sp0250.h (renamed from src/emu/sound/sp0250.h)0
-rw-r--r--src/devices/sound/sp0256.c (renamed from src/emu/sound/sp0256.c)0
-rw-r--r--src/devices/sound/sp0256.h (renamed from src/emu/sound/sp0256.h)0
-rw-r--r--src/devices/sound/speaker.c (renamed from src/emu/sound/speaker.c)0
-rw-r--r--src/devices/sound/speaker.h (renamed from src/emu/sound/speaker.h)0
-rw-r--r--src/devices/sound/spu.c (renamed from src/emu/sound/spu.c)0
-rw-r--r--src/devices/sound/spu.h (renamed from src/emu/sound/spu.h)0
-rw-r--r--src/devices/sound/spu_tables.c (renamed from src/emu/sound/spu_tables.c)0
-rw-r--r--src/devices/sound/spureverb.c (renamed from src/emu/sound/spureverb.c)0
-rw-r--r--src/devices/sound/spureverb.h (renamed from src/emu/sound/spureverb.h)0
-rw-r--r--src/devices/sound/st0016.c (renamed from src/emu/sound/st0016.c)0
-rw-r--r--src/devices/sound/st0016.h (renamed from src/emu/sound/st0016.h)0
-rw-r--r--src/devices/sound/t6721a.c (renamed from src/emu/sound/t6721a.c)0
-rw-r--r--src/devices/sound/t6721a.h (renamed from src/emu/sound/t6721a.h)0
-rw-r--r--src/devices/sound/t6w28.c (renamed from src/emu/sound/t6w28.c)0
-rw-r--r--src/devices/sound/t6w28.h (renamed from src/emu/sound/t6w28.h)0
-rw-r--r--src/devices/sound/tc8830f.c (renamed from src/emu/sound/tc8830f.c)0
-rw-r--r--src/devices/sound/tc8830f.h (renamed from src/emu/sound/tc8830f.h)0
-rw-r--r--src/devices/sound/tiaintf.c (renamed from src/emu/sound/tiaintf.c)0
-rw-r--r--src/devices/sound/tiaintf.h (renamed from src/emu/sound/tiaintf.h)0
-rw-r--r--src/devices/sound/tiasound.c (renamed from src/emu/sound/tiasound.c)0
-rw-r--r--src/devices/sound/tiasound.h (renamed from src/emu/sound/tiasound.h)0
-rw-r--r--src/devices/sound/tms3615.c (renamed from src/emu/sound/tms3615.c)0
-rw-r--r--src/devices/sound/tms3615.h (renamed from src/emu/sound/tms3615.h)0
-rw-r--r--src/devices/sound/tms36xx.c (renamed from src/emu/sound/tms36xx.c)2
-rw-r--r--src/devices/sound/tms36xx.h (renamed from src/emu/sound/tms36xx.h)0
-rw-r--r--src/devices/sound/tms5110.c (renamed from src/emu/sound/tms5110.c)1107
-rw-r--r--src/devices/sound/tms5110.h (renamed from src/emu/sound/tms5110.h)106
-rw-r--r--src/devices/sound/tms5110r.inc (renamed from src/emu/sound/tms5110r.inc)92
-rw-r--r--src/devices/sound/tms5220.c (renamed from src/emu/sound/tms5220.c)729
-rw-r--r--src/devices/sound/tms5220.h (renamed from src/emu/sound/tms5220.h)44
-rw-r--r--src/devices/sound/tms5220.txt (renamed from src/emu/sound/tms5220.txt)0
-rw-r--r--src/devices/sound/upd7752.c (renamed from src/emu/sound/upd7752.c)0
-rw-r--r--src/devices/sound/upd7752.h (renamed from src/emu/sound/upd7752.h)0
-rw-r--r--src/devices/sound/upd7759.c (renamed from src/emu/sound/upd7759.c)25
-rw-r--r--src/devices/sound/upd7759.h (renamed from src/emu/sound/upd7759.h)22
-rw-r--r--src/devices/sound/vlm5030.c (renamed from src/emu/sound/vlm5030.c)0
-rw-r--r--src/devices/sound/vlm5030.h (renamed from src/emu/sound/vlm5030.h)0
-rw-r--r--src/devices/sound/votrax.c (renamed from src/emu/sound/votrax.c)0
-rw-r--r--src/devices/sound/votrax.h (renamed from src/emu/sound/votrax.h)0
-rw-r--r--src/devices/sound/vrc6.c (renamed from src/emu/sound/vrc6.c)0
-rw-r--r--src/devices/sound/vrc6.h (renamed from src/emu/sound/vrc6.h)0
-rw-r--r--src/devices/sound/vrender0.c (renamed from src/emu/sound/vrender0.c)0
-rw-r--r--src/devices/sound/vrender0.h (renamed from src/emu/sound/vrender0.h)0
-rw-r--r--src/devices/sound/wave.c (renamed from src/emu/sound/wave.c)16
-rw-r--r--src/devices/sound/wave.h (renamed from src/emu/sound/wave.h)3
-rw-r--r--src/devices/sound/x1_010.c (renamed from src/emu/sound/x1_010.c)2
-rw-r--r--src/devices/sound/x1_010.h (renamed from src/emu/sound/x1_010.h)0
-rw-r--r--src/devices/sound/ym2151.c (renamed from src/emu/sound/ym2151.c)0
-rw-r--r--src/devices/sound/ym2151.h (renamed from src/emu/sound/ym2151.h)0
-rw-r--r--src/devices/sound/ym2151.txt (renamed from src/emu/sound/ym2151.txt)0
-rw-r--r--src/devices/sound/ym2413.c (renamed from src/emu/sound/ym2413.c)0
-rw-r--r--src/devices/sound/ym2413.h (renamed from src/emu/sound/ym2413.h)0
-rw-r--r--src/devices/sound/ymdeltat.c (renamed from src/emu/sound/ymdeltat.c)0
-rw-r--r--src/devices/sound/ymdeltat.h (renamed from src/emu/sound/ymdeltat.h)0
-rw-r--r--src/devices/sound/ymf262.c (renamed from src/emu/sound/ymf262.c)0
-rw-r--r--src/devices/sound/ymf262.h (renamed from src/emu/sound/ymf262.h)0
-rw-r--r--src/devices/sound/ymf271.c (renamed from src/emu/sound/ymf271.c)0
-rw-r--r--src/devices/sound/ymf271.h (renamed from src/emu/sound/ymf271.h)0
-rw-r--r--src/devices/sound/ymf278b.c (renamed from src/emu/sound/ymf278b.c)57
-rw-r--r--src/devices/sound/ymf278b.h (renamed from src/emu/sound/ymf278b.h)7
-rw-r--r--src/devices/sound/ymz280b.c (renamed from src/emu/sound/ymz280b.c)2
-rw-r--r--src/devices/sound/ymz280b.h (renamed from src/emu/sound/ymz280b.h)0
-rw-r--r--src/devices/sound/ymz770.c (renamed from src/emu/sound/ymz770.c)0
-rw-r--r--src/devices/sound/ymz770.h (renamed from src/emu/sound/ymz770.h)0
-rw-r--r--src/devices/sound/zsg2.c (renamed from src/emu/sound/zsg2.c)0
-rw-r--r--src/devices/sound/zsg2.h (renamed from src/emu/sound/zsg2.h)0
-rw-r--r--src/devices/video/315_5124.c (renamed from src/emu/video/315_5124.c)26
-rw-r--r--src/devices/video/315_5124.h (renamed from src/emu/video/315_5124.h)2
-rw-r--r--src/devices/video/315_5313.c (renamed from src/emu/video/315_5313.c)6
-rw-r--r--src/devices/video/315_5313.h (renamed from src/emu/video/315_5313.h)0
-rw-r--r--src/devices/video/bufsprite.c (renamed from src/emu/video/bufsprite.c)0
-rw-r--r--src/devices/video/bufsprite.h (renamed from src/emu/video/bufsprite.h)0
-rw-r--r--src/devices/video/cdp1861.c (renamed from src/emu/video/cdp1861.c)0
-rw-r--r--src/devices/video/cdp1861.h (renamed from src/emu/video/cdp1861.h)0
-rw-r--r--src/devices/video/cdp1862.c (renamed from src/emu/video/cdp1862.c)0
-rw-r--r--src/devices/video/cdp1862.h (renamed from src/emu/video/cdp1862.h)0
-rw-r--r--src/devices/video/cgapal.c (renamed from src/emu/video/cgapal.c)0
-rw-r--r--src/devices/video/cgapal.h (renamed from src/emu/video/cgapal.h)0
-rw-r--r--src/devices/video/clgd542x.c (renamed from src/emu/video/clgd542x.c)0
-rw-r--r--src/devices/video/clgd542x.h (renamed from src/emu/video/clgd542x.h)0
-rw-r--r--src/devices/video/crt9007.c (renamed from src/emu/video/crt9007.c)0
-rw-r--r--src/devices/video/crt9007.h (renamed from src/emu/video/crt9007.h)0
-rw-r--r--src/devices/video/crt9021.c (renamed from src/emu/video/crt9021.c)0
-rw-r--r--src/devices/video/crt9021.h (renamed from src/emu/video/crt9021.h)0
-rw-r--r--src/devices/video/crt9212.c (renamed from src/emu/video/crt9212.c)0
-rw-r--r--src/devices/video/crt9212.h (renamed from src/emu/video/crt9212.h)0
-rw-r--r--src/devices/video/crtc_ega.c (renamed from src/emu/video/crtc_ega.c)0
-rw-r--r--src/devices/video/crtc_ega.h (renamed from src/emu/video/crtc_ega.h)0
-rw-r--r--src/devices/video/dl1416.c (renamed from src/emu/video/dl1416.c)0
-rw-r--r--src/devices/video/dl1416.h (renamed from src/emu/video/dl1416.h)0
-rw-r--r--src/devices/video/dm9368.c (renamed from src/emu/video/dm9368.c)0
-rw-r--r--src/devices/video/dm9368.h (renamed from src/emu/video/dm9368.h)0
-rw-r--r--src/devices/video/ef9340_1.c (renamed from src/emu/video/ef9340_1.c)0
-rw-r--r--src/devices/video/ef9340_1.h (renamed from src/emu/video/ef9340_1.h)0
-rw-r--r--src/devices/video/ef9341_chargen.h (renamed from src/emu/video/ef9341_chargen.h)0
-rw-r--r--src/devices/video/ef9345.c (renamed from src/emu/video/ef9345.c)2
-rw-r--r--src/devices/video/ef9345.h (renamed from src/emu/video/ef9345.h)0
-rw-r--r--src/devices/video/epic12.c (renamed from src/emu/video/epic12.c)0
-rw-r--r--src/devices/video/epic12.h (renamed from src/emu/video/epic12.h)0
-rw-r--r--src/devices/video/epic12_blit0.c (renamed from src/emu/video/epic12_blit0.c)0
-rw-r--r--src/devices/video/epic12_blit1.c (renamed from src/emu/video/epic12_blit1.c)0
-rw-r--r--src/devices/video/epic12_blit2.c (renamed from src/emu/video/epic12_blit2.c)0
-rw-r--r--src/devices/video/epic12_blit3.c (renamed from src/emu/video/epic12_blit3.c)0
-rw-r--r--src/devices/video/epic12_blit4.c (renamed from src/emu/video/epic12_blit4.c)0
-rw-r--r--src/devices/video/epic12_blit5.c (renamed from src/emu/video/epic12_blit5.c)0
-rw-r--r--src/devices/video/epic12_blit6.c (renamed from src/emu/video/epic12_blit6.c)0
-rw-r--r--src/devices/video/epic12_blit7.c (renamed from src/emu/video/epic12_blit7.c)0
-rw-r--r--src/devices/video/epic12_blit8.c (renamed from src/emu/video/epic12_blit8.c)0
-rw-r--r--src/devices/video/epic12in.inc (renamed from src/emu/video/epic12in.inc)0
-rw-r--r--src/devices/video/epic12pixel.inc (renamed from src/emu/video/epic12pixel.inc)0
-rw-r--r--src/devices/video/fixfreq.c (renamed from src/emu/video/fixfreq.c)0
-rw-r--r--src/devices/video/fixfreq.h (renamed from src/emu/video/fixfreq.h)0
-rw-r--r--src/devices/video/gf4500.c (renamed from src/emu/video/gf4500.c)0
-rw-r--r--src/devices/video/gf4500.h (renamed from src/emu/video/gf4500.h)0
-rw-r--r--src/devices/video/gf7600gs.c (renamed from src/emu/video/gf7600gs.c)0
-rw-r--r--src/devices/video/gf7600gs.h (renamed from src/emu/video/gf7600gs.h)0
-rw-r--r--src/devices/video/h63484.c (renamed from src/emu/video/h63484.c)2
-rw-r--r--src/devices/video/h63484.h (renamed from src/emu/video/h63484.h)0
-rw-r--r--src/devices/video/hd44102.c (renamed from src/emu/video/hd44102.c)0
-rw-r--r--src/devices/video/hd44102.h (renamed from src/emu/video/hd44102.h)0
-rw-r--r--src/devices/video/hd44352.c (renamed from src/emu/video/hd44352.c)0
-rw-r--r--src/devices/video/hd44352.h (renamed from src/emu/video/hd44352.h)0
-rw-r--r--src/devices/video/hd44780.c (renamed from src/emu/video/hd44780.c)0
-rw-r--r--src/devices/video/hd44780.h (renamed from src/emu/video/hd44780.h)16
-rw-r--r--src/devices/video/hd61830.c (renamed from src/emu/video/hd61830.c)0
-rw-r--r--src/devices/video/hd61830.h (renamed from src/emu/video/hd61830.h)0
-rw-r--r--src/devices/video/hd63484.c (renamed from src/emu/video/hd63484.c)0
-rw-r--r--src/devices/video/hd63484.h (renamed from src/emu/video/hd63484.h)0
-rw-r--r--src/devices/video/hd66421.c (renamed from src/emu/video/hd66421.c)0
-rw-r--r--src/devices/video/hd66421.h (renamed from src/emu/video/hd66421.h)0
-rw-r--r--src/devices/video/huc6202.c (renamed from src/emu/video/huc6202.c)0
-rw-r--r--src/devices/video/huc6202.h (renamed from src/emu/video/huc6202.h)0
-rw-r--r--src/devices/video/huc6260.c (renamed from src/emu/video/huc6260.c)0
-rw-r--r--src/devices/video/huc6260.h (renamed from src/emu/video/huc6260.h)0
-rw-r--r--src/devices/video/huc6261.c (renamed from src/emu/video/huc6261.c)0
-rw-r--r--src/devices/video/huc6261.h (renamed from src/emu/video/huc6261.h)0
-rw-r--r--src/devices/video/huc6270.c (renamed from src/emu/video/huc6270.c)0
-rw-r--r--src/devices/video/huc6270.h (renamed from src/emu/video/huc6270.h)0
-rw-r--r--src/devices/video/huc6272.c (renamed from src/emu/video/huc6272.c)0
-rw-r--r--src/devices/video/huc6272.h (renamed from src/emu/video/huc6272.h)0
-rw-r--r--src/devices/video/i8244.c (renamed from src/emu/video/i8244.c)0
-rw-r--r--src/devices/video/i8244.h (renamed from src/emu/video/i8244.h)0
-rw-r--r--src/devices/video/i82730.c (renamed from src/emu/video/i82730.c)6
-rw-r--r--src/devices/video/i82730.h (renamed from src/emu/video/i82730.h)4
-rw-r--r--src/devices/video/i8275.c (renamed from src/emu/video/i8275.c)2
-rw-r--r--src/devices/video/i8275.h (renamed from src/emu/video/i8275.h)0
-rw-r--r--src/devices/video/m50458.c (renamed from src/emu/video/m50458.c)0
-rw-r--r--src/devices/video/m50458.h (renamed from src/emu/video/m50458.h)0
-rw-r--r--src/devices/video/mb90082.c (renamed from src/emu/video/mb90082.c)0
-rw-r--r--src/devices/video/mb90082.h (renamed from src/emu/video/mb90082.h)0
-rw-r--r--src/devices/video/mb_vcu.c (renamed from src/emu/video/mb_vcu.c)2
-rw-r--r--src/devices/video/mb_vcu.h (renamed from src/emu/video/mb_vcu.h)0
-rw-r--r--src/devices/video/mc6845.c (renamed from src/emu/video/mc6845.c)0
-rw-r--r--src/devices/video/mc6845.h (renamed from src/emu/video/mc6845.h)0
-rw-r--r--src/devices/video/mc6847.c (renamed from src/emu/video/mc6847.c)0
-rw-r--r--src/devices/video/mc6847.h (renamed from src/emu/video/mc6847.h)0
-rw-r--r--src/devices/video/mos6566.c (renamed from src/emu/video/mos6566.c)0
-rw-r--r--src/devices/video/mos6566.h (renamed from src/emu/video/mos6566.h)0
-rw-r--r--src/devices/video/msm6222b.c (renamed from src/emu/video/msm6222b.c)0
-rw-r--r--src/devices/video/msm6222b.h (renamed from src/emu/video/msm6222b.h)0
-rw-r--r--src/devices/video/msm6255.c (renamed from src/emu/video/msm6255.c)0
-rw-r--r--src/devices/video/msm6255.h (renamed from src/emu/video/msm6255.h)0
-rw-r--r--src/devices/video/pc_vga.c (renamed from src/emu/video/pc_vga.c)0
-rw-r--r--src/devices/video/pc_vga.h (renamed from src/emu/video/pc_vga.h)0
-rw-r--r--src/devices/video/poly.h (renamed from src/emu/video/poly.h)150
-rw-r--r--src/devices/video/polylgcy.c (renamed from src/emu/video/polylgcy.c)0
-rw-r--r--src/devices/video/polylgcy.h (renamed from src/emu/video/polylgcy.h)6
-rw-r--r--src/devices/video/psx.c (renamed from src/emu/video/psx.c)0
-rw-r--r--src/devices/video/psx.h (renamed from src/emu/video/psx.h)0
-rw-r--r--src/devices/video/ramdac.c (renamed from src/emu/video/ramdac.c)0
-rw-r--r--src/devices/video/ramdac.h (renamed from src/emu/video/ramdac.h)0
-rw-r--r--src/devices/video/saa5050.c (renamed from src/emu/video/saa5050.c)0
-rw-r--r--src/devices/video/saa5050.h (renamed from src/emu/video/saa5050.h)0
-rw-r--r--src/devices/video/scn2674.c (renamed from src/emu/video/scn2674.c)171
-rw-r--r--src/devices/video/scn2674.h (renamed from src/emu/video/scn2674.h)4
-rw-r--r--src/devices/video/sed1200.c (renamed from src/emu/video/sed1200.c)0
-rw-r--r--src/devices/video/sed1200.h (renamed from src/emu/video/sed1200.h)0
-rw-r--r--src/devices/video/sed1330.c (renamed from src/emu/video/sed1330.c)0
-rw-r--r--src/devices/video/sed1330.h (renamed from src/emu/video/sed1330.h)0
-rw-r--r--src/devices/video/sed1520.c (renamed from src/emu/video/sed1520.c)0
-rw-r--r--src/devices/video/sed1520.h (renamed from src/emu/video/sed1520.h)0
-rw-r--r--src/devices/video/snes_ppu.c (renamed from src/emu/video/snes_ppu.c)0
-rw-r--r--src/devices/video/snes_ppu.h (renamed from src/emu/video/snes_ppu.h)0
-rw-r--r--src/devices/video/stvvdp1.c (renamed from src/emu/video/stvvdp1.c)0
-rw-r--r--src/devices/video/stvvdp2.c (renamed from src/emu/video/stvvdp2.c)0
-rw-r--r--src/devices/video/t6a04.c (renamed from src/emu/video/t6a04.c)0
-rw-r--r--src/devices/video/t6a04.h (renamed from src/emu/video/t6a04.h)0
-rw-r--r--src/devices/video/tea1002.c (renamed from src/emu/video/tea1002.c)0
-rw-r--r--src/devices/video/tea1002.h (renamed from src/emu/video/tea1002.h)0
-rw-r--r--src/devices/video/tlc34076.c (renamed from src/emu/video/tlc34076.c)0
-rw-r--r--src/devices/video/tlc34076.h (renamed from src/emu/video/tlc34076.h)0
-rw-r--r--src/devices/video/tms34061.c (renamed from src/emu/video/tms34061.c)0
-rw-r--r--src/devices/video/tms34061.h (renamed from src/emu/video/tms34061.h)0
-rw-r--r--src/devices/video/tms3556.c (renamed from src/emu/video/tms3556.c)0
-rw-r--r--src/devices/video/tms3556.h (renamed from src/emu/video/tms3556.h)0
-rw-r--r--src/devices/video/tms9927.c (renamed from src/emu/video/tms9927.c)0
-rw-r--r--src/devices/video/tms9927.h (renamed from src/emu/video/tms9927.h)0
-rw-r--r--src/devices/video/tms9928a.c (renamed from src/emu/video/tms9928a.c)0
-rw-r--r--src/devices/video/tms9928a.h (renamed from src/emu/video/tms9928a.h)0
-rw-r--r--src/devices/video/upd3301.c (renamed from src/emu/video/upd3301.c)0
-rw-r--r--src/devices/video/upd3301.h (renamed from src/emu/video/upd3301.h)0
-rw-r--r--src/devices/video/upd7220.c (renamed from src/emu/video/upd7220.c)5
-rw-r--r--src/devices/video/upd7220.h (renamed from src/emu/video/upd7220.h)0
-rw-r--r--src/devices/video/upd7227.c (renamed from src/emu/video/upd7227.c)0
-rw-r--r--src/devices/video/upd7227.h (renamed from src/emu/video/upd7227.h)0
-rw-r--r--src/devices/video/v9938.c (renamed from src/emu/video/v9938.c)168
-rw-r--r--src/devices/video/v9938.h (renamed from src/emu/video/v9938.h)59
-rw-r--r--src/devices/video/vic4567.c (renamed from src/emu/video/vic4567.c)0
-rw-r--r--src/devices/video/vic4567.h (renamed from src/emu/video/vic4567.h)0
-rw-r--r--src/devices/video/vooddefs.h (renamed from src/emu/video/vooddefs.h)33
-rw-r--r--src/devices/video/voodoo.c (renamed from src/emu/video/voodoo.c)40
-rw-r--r--src/devices/video/voodoo.h (renamed from src/emu/video/voodoo.h)0
-rw-r--r--src/devices/video/voodoo_pci.c (renamed from src/emu/video/voodoo_pci.c)0
-rw-r--r--src/devices/video/voodoo_pci.h (renamed from src/emu/video/voodoo_pci.h)0
-rw-r--r--src/emu/attotime.c36
-rw-r--r--src/emu/attotime.h132
-rw-r--r--src/emu/audit.c11
-rw-r--r--src/emu/bus/pc_kbd/iskr1030.c453
-rw-r--r--src/emu/bus/scsi/omti5100.c94
-rw-r--r--src/emu/clifront.c6
-rw-r--r--src/emu/cpu/arcompact/arcompact_make.py433
-rw-r--r--src/emu/cpu/hphybrid/hphybrid.c961
-rw-r--r--src/emu/debug/debugcmd.c2
-rw-r--r--src/emu/debug/debugcpu.c11
-rw-r--r--src/emu/device.c4
-rw-r--r--src/emu/dipty.c85
-rw-r--r--src/emu/dipty.h48
-rw-r--r--src/emu/drivenum.c2
-rw-r--r--src/emu/drivenum.h2
-rw-r--r--src/emu/drivers/empty.c2
-rw-r--r--src/emu/drivers/emudummy.c2
-rw-r--r--src/emu/drivers/testcpu.c2
-rw-r--r--src/emu/emu.h1
-rw-r--r--src/emu/emuopts.c35
-rw-r--r--src/emu/emuopts.h17
-rw-r--r--src/emu/emupal.c76
-rw-r--r--src/emu/emupal.h61
-rw-r--r--src/emu/gamedrv.h56
-rw-r--r--src/emu/info.c32
-rw-r--r--src/emu/ioport.c17
-rw-r--r--src/emu/ioport.h1
-rw-r--r--src/emu/luaengine.c2
-rw-r--r--src/emu/machine.c17
-rw-r--r--src/emu/machine/at29040a.c446
-rw-r--r--src/emu/machine/at29040a.h90
-rw-r--r--src/emu/machine/i8271.c1510
-rw-r--r--src/emu/machine/i8271.h165
-rw-r--r--src/emu/mconfig.h2
-rw-r--r--src/emu/memory.c24
-rw-r--r--src/emu/memory.h7
-rw-r--r--src/emu/netlist/macro/nlm_opamp.c47
-rw-r--r--src/emu/netlist/nl_time.h134
-rw-r--r--src/emu/netlist/plib/pstring.c360
-rw-r--r--src/emu/netlist/plib/pstring.h259
-rw-r--r--src/emu/output.c6
-rw-r--r--src/emu/render.c43
-rw-r--r--src/emu/render.h12
-rw-r--r--src/emu/rendfont.c4
-rw-r--r--src/emu/rendlay.c44
-rw-r--r--src/emu/rendlay.h9
-rw-r--r--src/emu/romload.h1
-rw-r--r--src/emu/save.c9
-rw-r--r--src/emu/save.h4
-rw-r--r--src/emu/schedule.c34
-rw-r--r--src/emu/screen.c19
-rw-r--r--src/emu/screen.h15
-rw-r--r--src/emu/softlist.c8
-rw-r--r--src/emu/sound.c26
-rw-r--r--src/emu/ui/devopt.c2
-rw-r--r--src/emu/ui/info_pty.c44
-rw-r--r--src/emu/ui/info_pty.h24
-rw-r--r--src/emu/ui/mainmenu.c9
-rw-r--r--src/emu/ui/mainmenu.h3
-rw-r--r--src/emu/ui/miscmenu.c8
-rw-r--r--src/emu/ui/selgame.c16
-rw-r--r--src/emu/ui/sliders.c3
-rw-r--r--src/emu/ui/ui.c60
-rw-r--r--src/emu/validity.c6
-rw-r--r--src/emu/video.c14
-rw-r--r--src/emu/video/rgbsse.h12
-rw-r--r--src/lib/formats/atom_dsk.c31
-rw-r--r--src/lib/formats/atom_dsk.h22
-rw-r--r--src/lib/formats/bbc_dsk.c216
-rw-r--r--src/lib/formats/bbc_dsk.h62
-rw-r--r--src/lib/formats/flopimg.c2
-rw-r--r--src/lib/formats/mfm_hd.c750
-rw-r--r--src/lib/formats/mfm_hd.h212
-rw-r--r--src/lib/formats/ti99_dsk.c8
-rw-r--r--src/lib/formats/tiki100_dsk.c5
-rw-r--r--src/lib/formats/vector06_dsk.c4
-rw-r--r--src/lib/netlist/analog/nld_bjt.c (renamed from src/emu/netlist/analog/nld_bjt.c)24
-rw-r--r--src/lib/netlist/analog/nld_bjt.h (renamed from src/emu/netlist/analog/nld_bjt.h)30
-rw-r--r--src/lib/netlist/analog/nld_fourterm.c (renamed from src/emu/netlist/analog/nld_fourterm.c)7
-rw-r--r--src/lib/netlist/analog/nld_fourterm.h (renamed from src/emu/netlist/analog/nld_fourterm.h)2
-rw-r--r--src/lib/netlist/analog/nld_opamps.c (renamed from src/emu/netlist/analog/nld_opamps.c)107
-rw-r--r--src/lib/netlist/analog/nld_opamps.h (renamed from src/emu/netlist/analog/nld_opamps.h)6
-rw-r--r--src/lib/netlist/analog/nld_switches.c (renamed from src/emu/netlist/analog/nld_switches.c)2
-rw-r--r--src/lib/netlist/analog/nld_switches.h (renamed from src/emu/netlist/analog/nld_switches.h)2
-rw-r--r--src/lib/netlist/analog/nld_twoterm.c (renamed from src/emu/netlist/analog/nld_twoterm.c)9
-rw-r--r--src/lib/netlist/analog/nld_twoterm.h (renamed from src/emu/netlist/analog/nld_twoterm.h)61
-rw-r--r--src/lib/netlist/build/makefile166
-rw-r--r--src/lib/netlist/devices/net_lib.c (renamed from src/emu/netlist/devices/net_lib.c)62
-rw-r--r--src/lib/netlist/devices/net_lib.h (renamed from src/emu/netlist/devices/net_lib.h)21
-rw-r--r--src/lib/netlist/devices/nld_4020.c (renamed from src/emu/netlist/devices/nld_4020.c)0
-rw-r--r--src/lib/netlist/devices/nld_4020.h (renamed from src/emu/netlist/devices/nld_4020.h)2
-rw-r--r--src/lib/netlist/devices/nld_4066.c (renamed from src/emu/netlist/devices/nld_4066.c)0
-rw-r--r--src/lib/netlist/devices/nld_4066.h (renamed from src/emu/netlist/devices/nld_4066.h)2
-rw-r--r--src/lib/netlist/devices/nld_7400.c (renamed from src/emu/netlist/devices/nld_7400.c)0
-rw-r--r--src/lib/netlist/devices/nld_7400.h (renamed from src/emu/netlist/devices/nld_7400.h)0
-rw-r--r--src/lib/netlist/devices/nld_7402.c (renamed from src/emu/netlist/devices/nld_7402.c)0
-rw-r--r--src/lib/netlist/devices/nld_7402.h (renamed from src/emu/netlist/devices/nld_7402.h)0
-rw-r--r--src/lib/netlist/devices/nld_7404.c (renamed from src/emu/netlist/devices/nld_7404.c)0
-rw-r--r--src/lib/netlist/devices/nld_7404.h (renamed from src/emu/netlist/devices/nld_7404.h)0
-rw-r--r--src/lib/netlist/devices/nld_7408.c (renamed from src/emu/netlist/devices/nld_7408.c)0
-rw-r--r--src/lib/netlist/devices/nld_7408.h (renamed from src/emu/netlist/devices/nld_7408.h)0
-rw-r--r--src/lib/netlist/devices/nld_7410.c (renamed from src/emu/netlist/devices/nld_7410.c)0
-rw-r--r--src/lib/netlist/devices/nld_7410.h (renamed from src/emu/netlist/devices/nld_7410.h)0
-rw-r--r--src/lib/netlist/devices/nld_74107.c (renamed from src/emu/netlist/devices/nld_74107.c)0
-rw-r--r--src/lib/netlist/devices/nld_74107.h (renamed from src/emu/netlist/devices/nld_74107.h)2
-rw-r--r--src/lib/netlist/devices/nld_7411.c (renamed from src/emu/netlist/devices/nld_7411.c)0
-rw-r--r--src/lib/netlist/devices/nld_7411.h (renamed from src/emu/netlist/devices/nld_7411.h)0
-rw-r--r--src/lib/netlist/devices/nld_74123.c (renamed from src/emu/netlist/devices/nld_74123.c)1
-rw-r--r--src/lib/netlist/devices/nld_74123.h (renamed from src/emu/netlist/devices/nld_74123.h)4
-rw-r--r--src/lib/netlist/devices/nld_74153.c (renamed from src/emu/netlist/devices/nld_74153.c)0
-rw-r--r--src/lib/netlist/devices/nld_74153.h (renamed from src/emu/netlist/devices/nld_74153.h)2
-rw-r--r--src/lib/netlist/devices/nld_74175.c (renamed from src/emu/netlist/devices/nld_74175.c)0
-rw-r--r--src/lib/netlist/devices/nld_74175.h (renamed from src/emu/netlist/devices/nld_74175.h)0
-rw-r--r--src/lib/netlist/devices/nld_74192.c (renamed from src/emu/netlist/devices/nld_74192.c)0
-rw-r--r--src/lib/netlist/devices/nld_74192.h (renamed from src/emu/netlist/devices/nld_74192.h)2
-rw-r--r--src/lib/netlist/devices/nld_74193.c (renamed from src/emu/netlist/devices/nld_74193.c)0
-rw-r--r--src/lib/netlist/devices/nld_74193.h (renamed from src/emu/netlist/devices/nld_74193.h)2
-rw-r--r--src/lib/netlist/devices/nld_7420.c (renamed from src/emu/netlist/devices/nld_7420.c)0
-rw-r--r--src/lib/netlist/devices/nld_7420.h (renamed from src/emu/netlist/devices/nld_7420.h)0
-rw-r--r--src/lib/netlist/devices/nld_7425.c (renamed from src/emu/netlist/devices/nld_7425.c)0
-rw-r--r--src/lib/netlist/devices/nld_7425.h (renamed from src/emu/netlist/devices/nld_7425.h)0
-rw-r--r--src/lib/netlist/devices/nld_7427.c (renamed from src/emu/netlist/devices/nld_7427.c)0
-rw-r--r--src/lib/netlist/devices/nld_7427.h (renamed from src/emu/netlist/devices/nld_7427.h)0
-rw-r--r--src/lib/netlist/devices/nld_74279.c (renamed from src/emu/netlist/devices/nld_74279.c)0
-rw-r--r--src/lib/netlist/devices/nld_74279.h (renamed from src/emu/netlist/devices/nld_74279.h)0
-rw-r--r--src/lib/netlist/devices/nld_7430.c (renamed from src/emu/netlist/devices/nld_7430.c)0
-rw-r--r--src/lib/netlist/devices/nld_7430.h (renamed from src/emu/netlist/devices/nld_7430.h)0
-rw-r--r--src/lib/netlist/devices/nld_7432.c (renamed from src/emu/netlist/devices/nld_7432.c)0
-rw-r--r--src/lib/netlist/devices/nld_7432.h (renamed from src/emu/netlist/devices/nld_7432.h)0
-rw-r--r--src/lib/netlist/devices/nld_7437.c (renamed from src/emu/netlist/devices/nld_7437.c)0
-rw-r--r--src/lib/netlist/devices/nld_7437.h (renamed from src/emu/netlist/devices/nld_7437.h)0
-rw-r--r--src/lib/netlist/devices/nld_7448.c (renamed from src/emu/netlist/devices/nld_7448.c)0
-rw-r--r--src/lib/netlist/devices/nld_7448.h (renamed from src/emu/netlist/devices/nld_7448.h)2
-rw-r--r--src/lib/netlist/devices/nld_7450.c (renamed from src/emu/netlist/devices/nld_7450.c)0
-rw-r--r--src/lib/netlist/devices/nld_7450.h (renamed from src/emu/netlist/devices/nld_7450.h)0
-rw-r--r--src/lib/netlist/devices/nld_7474.c (renamed from src/emu/netlist/devices/nld_7474.c)0
-rw-r--r--src/lib/netlist/devices/nld_7474.h (renamed from src/emu/netlist/devices/nld_7474.h)0
-rw-r--r--src/lib/netlist/devices/nld_7483.c (renamed from src/emu/netlist/devices/nld_7483.c)0
-rw-r--r--src/lib/netlist/devices/nld_7483.h (renamed from src/emu/netlist/devices/nld_7483.h)2
-rw-r--r--src/lib/netlist/devices/nld_7486.c (renamed from src/emu/netlist/devices/nld_7486.c)0
-rw-r--r--src/lib/netlist/devices/nld_7486.h (renamed from src/emu/netlist/devices/nld_7486.h)0
-rw-r--r--src/lib/netlist/devices/nld_7490.c (renamed from src/emu/netlist/devices/nld_7490.c)0
-rw-r--r--src/lib/netlist/devices/nld_7490.h (renamed from src/emu/netlist/devices/nld_7490.h)2
-rw-r--r--src/lib/netlist/devices/nld_7493.c (renamed from src/emu/netlist/devices/nld_7493.c)2
-rw-r--r--src/lib/netlist/devices/nld_7493.h (renamed from src/emu/netlist/devices/nld_7493.h)2
-rw-r--r--src/lib/netlist/devices/nld_74ls629.c (renamed from src/emu/netlist/devices/nld_74ls629.c)5
-rw-r--r--src/lib/netlist/devices/nld_74ls629.h (renamed from src/emu/netlist/devices/nld_74ls629.h)4
-rw-r--r--src/lib/netlist/devices/nld_82S16.c (renamed from src/emu/netlist/devices/nld_82S16.c)0
-rw-r--r--src/lib/netlist/devices/nld_82S16.h (renamed from src/emu/netlist/devices/nld_82S16.h)2
-rw-r--r--src/lib/netlist/devices/nld_9310.c (renamed from src/emu/netlist/devices/nld_9310.c)0
-rw-r--r--src/lib/netlist/devices/nld_9310.h (renamed from src/emu/netlist/devices/nld_9310.h)2
-rw-r--r--src/lib/netlist/devices/nld_9312.c (renamed from src/emu/netlist/devices/nld_9312.c)0
-rw-r--r--src/lib/netlist/devices/nld_9312.h (renamed from src/emu/netlist/devices/nld_9312.h)0
-rw-r--r--src/lib/netlist/devices/nld_9316.c (renamed from src/emu/netlist/devices/nld_9316.c)0
-rw-r--r--src/lib/netlist/devices/nld_9316.h (renamed from src/emu/netlist/devices/nld_9316.h)2
-rw-r--r--src/lib/netlist/devices/nld_cmos.h (renamed from src/emu/netlist/devices/nld_cmos.h)4
-rw-r--r--src/lib/netlist/devices/nld_legacy.c (renamed from src/emu/netlist/devices/nld_legacy.c)2
-rw-r--r--src/lib/netlist/devices/nld_legacy.h (renamed from src/emu/netlist/devices/nld_legacy.h)2
-rw-r--r--src/lib/netlist/devices/nld_log.c (renamed from src/emu/netlist/devices/nld_log.c)16
-rw-r--r--src/lib/netlist/devices/nld_log.h (renamed from src/emu/netlist/devices/nld_log.h)9
-rw-r--r--src/lib/netlist/devices/nld_mm5837.c (renamed from src/emu/netlist/devices/nld_mm5837.c)2
-rw-r--r--src/lib/netlist/devices/nld_mm5837.h (renamed from src/emu/netlist/devices/nld_mm5837.h)4
-rw-r--r--src/lib/netlist/devices/nld_ne555.c (renamed from src/emu/netlist/devices/nld_ne555.c)2
-rw-r--r--src/lib/netlist/devices/nld_ne555.h (renamed from src/emu/netlist/devices/nld_ne555.h)4
-rw-r--r--src/lib/netlist/devices/nld_r2r_dac.c (renamed from src/emu/netlist/devices/nld_r2r_dac.c)2
-rw-r--r--src/lib/netlist/devices/nld_r2r_dac.h (renamed from src/emu/netlist/devices/nld_r2r_dac.h)4
-rw-r--r--src/lib/netlist/devices/nld_signal.h (renamed from src/emu/netlist/devices/nld_signal.h)2
-rw-r--r--src/lib/netlist/devices/nld_system.c (renamed from src/emu/netlist/devices/nld_system.c)8
-rw-r--r--src/lib/netlist/devices/nld_system.h (renamed from src/emu/netlist/devices/nld_system.h)19
-rw-r--r--src/lib/netlist/devices/nld_truthtable.c (renamed from src/emu/netlist/devices/nld_truthtable.c)12
-rw-r--r--src/lib/netlist/devices/nld_truthtable.h (renamed from src/emu/netlist/devices/nld_truthtable.h)7
-rw-r--r--src/lib/netlist/macro/nlm_cd4xxx.c (renamed from src/emu/netlist/macro/nlm_cd4xxx.c)14
-rw-r--r--src/lib/netlist/macro/nlm_cd4xxx.h (renamed from src/emu/netlist/macro/nlm_cd4xxx.h)2
-rw-r--r--src/lib/netlist/macro/nlm_opamp.c83
-rw-r--r--src/lib/netlist/macro/nlm_opamp.h (renamed from src/emu/netlist/macro/nlm_opamp.h)10
-rw-r--r--src/lib/netlist/macro/nlm_other.c55
-rw-r--r--src/lib/netlist/macro/nlm_other.h27
-rw-r--r--src/lib/netlist/macro/nlm_ttl74xx.c (renamed from src/emu/netlist/macro/nlm_ttl74xx.c)4
-rw-r--r--src/lib/netlist/macro/nlm_ttl74xx.h (renamed from src/emu/netlist/macro/nlm_ttl74xx.h)6
-rw-r--r--src/lib/netlist/nl_base.c (renamed from src/emu/netlist/nl_base.c)145
-rw-r--r--src/lib/netlist/nl_base.h (renamed from src/emu/netlist/nl_base.h)81
-rw-r--r--src/lib/netlist/nl_config.h (renamed from src/emu/netlist/nl_config.h)23
-rw-r--r--src/lib/netlist/nl_dice_compat.h (renamed from src/emu/netlist/nl_dice_compat.h)0
-rw-r--r--src/lib/netlist/nl_factory.c (renamed from src/emu/netlist/nl_factory.c)34
-rw-r--r--src/lib/netlist/nl_factory.h (renamed from src/emu/netlist/nl_factory.h)21
-rw-r--r--src/lib/netlist/nl_lists.h (renamed from src/emu/netlist/nl_lists.h)0
-rw-r--r--src/lib/netlist/nl_parser.c (renamed from src/emu/netlist/nl_parser.c)61
-rw-r--r--src/lib/netlist/nl_parser.h (renamed from src/emu/netlist/nl_parser.h)10
-rw-r--r--src/lib/netlist/nl_setup.c (renamed from src/emu/netlist/nl_setup.c)440
-rw-r--r--src/lib/netlist/nl_setup.h (renamed from src/emu/netlist/nl_setup.h)100
-rw-r--r--src/lib/netlist/nl_time.h137
-rw-r--r--src/lib/netlist/nl_util.h (renamed from src/emu/netlist/nl_util.h)0
-rw-r--r--src/lib/netlist/plib/palloc.c (renamed from src/emu/netlist/plib/palloc.c)13
-rw-r--r--src/lib/netlist/plib/palloc.h (renamed from src/emu/netlist/plib/palloc.h)25
-rw-r--r--src/lib/netlist/plib/pconfig.h (renamed from src/emu/netlist/plib/pconfig.h)65
-rw-r--r--src/lib/netlist/plib/pfmtlog.c166
-rw-r--r--src/lib/netlist/plib/pfmtlog.h292
-rw-r--r--src/lib/netlist/plib/plists.h (renamed from src/emu/netlist/plib/plists.h)117
-rw-r--r--src/lib/netlist/plib/poptions.h (renamed from src/emu/netlist/plib/poptions.h)0
-rw-r--r--src/lib/netlist/plib/pparser.c (renamed from src/emu/netlist/plib/pparser.c)240
-rw-r--r--src/lib/netlist/plib/pparser.h (renamed from src/emu/netlist/plib/pparser.h)45
-rw-r--r--src/lib/netlist/plib/pstate.c (renamed from src/emu/netlist/plib/pstate.c)4
-rw-r--r--src/lib/netlist/plib/pstate.h (renamed from src/emu/netlist/plib/pstate.h)7
-rw-r--r--src/lib/netlist/plib/pstream.c362
-rw-r--r--src/lib/netlist/plib/pstream.h378
-rw-r--r--src/lib/netlist/plib/pstring.c600
-rw-r--r--src/lib/netlist/plib/pstring.h381
-rw-r--r--src/lib/netlist/plib/ptypes.h97
-rw-r--r--src/lib/netlist/prg/nltool.c (renamed from src/tools/nltool.c)252
-rw-r--r--src/lib/netlist/prg/nlwav.c289
-rw-r--r--src/lib/netlist/solver/mat_cr.h (renamed from src/emu/netlist/solver/mat_cr.h)11
-rw-r--r--src/lib/netlist/solver/nld_ms_direct.h (renamed from src/emu/netlist/solver/nld_ms_direct.h)254
-rw-r--r--src/lib/netlist/solver/nld_ms_direct1.h (renamed from src/emu/netlist/solver/nld_ms_direct1.h)8
-rw-r--r--src/lib/netlist/solver/nld_ms_direct2.h (renamed from src/emu/netlist/solver/nld_ms_direct2.h)12
-rw-r--r--src/lib/netlist/solver/nld_ms_direct_lu.h651
-rw-r--r--src/lib/netlist/solver/nld_ms_gmres.h (renamed from src/emu/netlist/solver/nld_ms_gmres.h)67
-rw-r--r--src/lib/netlist/solver/nld_ms_sor.h (renamed from src/emu/netlist/solver/nld_ms_sor.h)6
-rw-r--r--src/lib/netlist/solver/nld_ms_sor_mat.h (renamed from src/emu/netlist/solver/nld_ms_sor_mat.h)30
-rw-r--r--src/lib/netlist/solver/nld_solver.c (renamed from src/emu/netlist/solver/nld_solver.c)125
-rw-r--r--src/lib/netlist/solver/nld_solver.h (renamed from src/emu/netlist/solver/nld_solver.h)33
-rw-r--r--src/lib/netlist/solver/vector_base.h (renamed from src/emu/netlist/solver/vector_base.h)32
-rw-r--r--src/lib/netlist/tools/nl_convert.c (renamed from src/emu/netlist/tools/nl_convert.c)100
-rw-r--r--src/lib/netlist/tools/nl_convert.h (renamed from src/emu/netlist/tools/nl_convert.h)17
-rw-r--r--src/lib/util/coreutil.c19
-rw-r--r--src/lib/util/coreutil.h1
-rw-r--r--src/lib/util/palette.c60
-rw-r--r--src/lib/util/palette.h3
-rw-r--r--src/mame/arcade.lst497
-rw-r--r--src/mame/audio/alesis.c (renamed from src/mess/audio/alesis.c)0
-rw-r--r--src/mame/audio/arcadia.c (renamed from src/mess/audio/arcadia.c)0
-rw-r--r--src/mame/audio/arcadia.h (renamed from src/mess/audio/arcadia.h)0
-rw-r--r--src/mame/audio/atarijsa.c10
-rw-r--r--src/mame/audio/atarijsa.h5
-rw-r--r--src/mame/audio/cage.c4
-rw-r--r--src/mame/audio/channelf.c (renamed from src/mess/audio/channelf.c)0
-rw-r--r--src/mame/audio/channelf.h (renamed from src/mess/audio/channelf.h)0
-rw-r--r--src/mame/audio/dai_snd.c (renamed from src/mess/audio/dai_snd.c)0
-rw-r--r--src/mame/audio/dai_snd.h (renamed from src/mess/audio/dai_snd.h)0
-rw-r--r--src/mame/audio/dave.c (renamed from src/mess/audio/dave.c)0
-rw-r--r--src/mame/audio/dave.h (renamed from src/mess/audio/dave.h)0
-rw-r--r--src/mame/audio/dcs.c2
-rw-r--r--src/mame/audio/gamate.c (renamed from src/mess/audio/gamate.c)6
-rw-r--r--src/mame/audio/gb.c (renamed from src/mess/audio/gb.c)14
-rw-r--r--src/mame/audio/gb.h (renamed from src/mess/audio/gb.h)0
-rw-r--r--src/mame/audio/hng64.c14
-rw-r--r--src/mame/audio/irem.c158
-rw-r--r--src/mame/audio/irem.h39
-rw-r--r--src/mame/audio/leland.c162
-rw-r--r--src/mame/audio/lynx.c (renamed from src/mess/audio/lynx.c)0
-rw-r--r--src/mame/audio/lynx.h (renamed from src/mess/audio/lynx.h)0
-rw-r--r--src/mame/audio/mac.c (renamed from src/mess/audio/mac.c)0
-rw-r--r--src/mame/audio/mea8000.c (renamed from src/mess/audio/mea8000.c)0
-rw-r--r--src/mame/audio/mea8000.h (renamed from src/mess/audio/mea8000.h)0
-rw-r--r--src/mame/audio/micro3d.c4
-rw-r--r--src/mame/audio/nl_kidniki.c185
-rw-r--r--src/mame/audio/scramble.c13
-rw-r--r--src/mame/audio/seibu.h24
-rw-r--r--src/mame/audio/socrates.c (renamed from src/mess/audio/socrates.c)0
-rw-r--r--src/mame/audio/socrates.h (renamed from src/mess/audio/socrates.h)0
-rw-r--r--src/mame/audio/specimx_snd.c (renamed from src/mess/audio/specimx_snd.c)0
-rw-r--r--src/mame/audio/specimx_snd.h (renamed from src/mess/audio/specimx_snd.h)0
-rw-r--r--src/mame/audio/svis_snd.c (renamed from src/mess/audio/svis_snd.c)0
-rw-r--r--src/mame/audio/svis_snd.h (renamed from src/mess/audio/svis_snd.h)0
-rw-r--r--src/mame/audio/targ.c15
-rw-r--r--src/mame/audio/tvc_snd.c (renamed from src/mess/audio/tvc_snd.c)0
-rw-r--r--src/mame/audio/tvc_snd.h (renamed from src/mess/audio/tvc_snd.h)0
-rw-r--r--src/mame/audio/upd1771.c (renamed from src/mess/audio/upd1771.c)0
-rw-r--r--src/mame/audio/upd1771.h (renamed from src/mess/audio/upd1771.h)0
-rw-r--r--src/mame/audio/vboy.c (renamed from src/mess/audio/vboy.c)0
-rw-r--r--src/mame/audio/vboy.h (renamed from src/mess/audio/vboy.h)0
-rw-r--r--src/mame/audio/vc4000snd.c (renamed from src/mess/audio/vc4000snd.c)0
-rw-r--r--src/mame/audio/vc4000snd.h (renamed from src/mess/audio/vc4000snd.h)0
-rw-r--r--src/mame/audio/wswan_snd.c (renamed from src/mess/audio/wswan_snd.c)0
-rw-r--r--src/mame/audio/wswan_snd.h (renamed from src/mess/audio/wswan_snd.h)0
-rw-r--r--src/mame/drivers/1942.c68
-rw-r--r--src/mame/drivers/1943.c12
-rw-r--r--src/mame/drivers/1945kiii.c5
-rw-r--r--src/mame/drivers/20pacgal.c18
-rw-r--r--src/mame/drivers/24cdjuke.c2
-rw-r--r--src/mame/drivers/2mindril.c2
-rw-r--r--src/mame/drivers/30test.c2
-rw-r--r--src/mame/drivers/39in1.c18
-rw-r--r--src/mame/drivers/3do.c8
-rw-r--r--src/mame/drivers/3x3puzzl.c6
-rw-r--r--src/mame/drivers/4004clk.c (renamed from src/mess/drivers/4004clk.c)13
-rw-r--r--src/mame/drivers/40love.c6
-rw-r--r--src/mame/drivers/4enlinea.c2
-rw-r--r--src/mame/drivers/4enraya.c9
-rw-r--r--src/mame/drivers/4roses.c6
-rw-r--r--src/mame/drivers/5clown.c6
-rw-r--r--src/mame/drivers/68ksbc.c (renamed from src/mess/drivers/68ksbc.c)2
-rw-r--r--src/mame/drivers/8080bw.c253
-rw-r--r--src/mame/drivers/88games.c15
-rw-r--r--src/mame/drivers/a1supply.c6
-rw-r--r--src/mame/drivers/a2600.c (renamed from src/mess/drivers/a2600.c)13
-rw-r--r--src/mame/drivers/a310.c (renamed from src/mess/drivers/a310.c)6
-rw-r--r--src/mame/drivers/a5105.c (renamed from src/mess/drivers/a5105.c)2
-rw-r--r--src/mame/drivers/a51xx.c (renamed from src/mess/drivers/a51xx.c)4
-rw-r--r--src/mame/drivers/a6809.c (renamed from src/mess/drivers/a6809.c)0
-rw-r--r--src/mame/drivers/a7150.c (renamed from src/mess/drivers/a7150.c)2
-rw-r--r--src/mame/drivers/a7800.c (renamed from src/mess/drivers/a7800.c)7
-rw-r--r--src/mame/drivers/abc1600.c (renamed from src/mess/drivers/abc1600.c)2
-rw-r--r--src/mame/drivers/abc80.c (renamed from src/mess/drivers/abc80.c)2
-rw-r--r--src/mame/drivers/abc80x.c (renamed from src/mess/drivers/abc80x.c)8
-rw-r--r--src/mame/drivers/ac1.c (renamed from src/mess/drivers/ac1.c)14
-rw-r--r--src/mame/drivers/ace.c2
-rw-r--r--src/mame/drivers/acefruit.c8
-rw-r--r--src/mame/drivers/aces1.c94
-rw-r--r--src/mame/drivers/acesp.c1076
-rw-r--r--src/mame/drivers/acommand.c2
-rw-r--r--src/mame/drivers/acrnsys1.c (renamed from src/mess/drivers/acrnsys1.c)0
-rw-r--r--src/mame/drivers/actfancr.c10
-rw-r--r--src/mame/drivers/adam.c (renamed from src/mess/drivers/adam.c)2
-rw-r--r--src/mame/drivers/adp.c16
-rw-r--r--src/mame/drivers/advision.c (renamed from src/mess/drivers/advision.c)2
-rw-r--r--src/mame/drivers/aeroboto.c4
-rw-r--r--src/mame/drivers/aerofgt.c89
-rw-r--r--src/mame/drivers/aim65.c (renamed from src/mess/drivers/aim65.c)2
-rw-r--r--src/mame/drivers/aim65_40.c (renamed from src/mess/drivers/aim65_40.c)2
-rw-r--r--src/mame/drivers/airbustr.c6
-rw-r--r--src/mame/drivers/ajax.c18
-rw-r--r--src/mame/drivers/albazc.c2
-rw-r--r--src/mame/drivers/albazg.c2
-rw-r--r--src/mame/drivers/aleck64.c30
-rw-r--r--src/mame/drivers/aleisttl.c4
-rw-r--r--src/mame/drivers/alesis.c (renamed from src/mess/drivers/alesis.c)20
-rw-r--r--src/mame/drivers/alg.c80
-rw-r--r--src/mame/drivers/alien.c2
-rw-r--r--src/mame/drivers/aliens.c39
-rw-r--r--src/mame/drivers/alinvade.c2
-rw-r--r--src/mame/drivers/allied.c24
-rw-r--r--src/mame/drivers/alpha68k.c52
-rw-r--r--src/mame/drivers/alphasma.c (renamed from src/mess/drivers/alphasma.c)4
-rw-r--r--src/mame/drivers/alphatro.c (renamed from src/mess/drivers/alphatro.c)2
-rw-r--r--src/mame/drivers/altair.c (renamed from src/mess/drivers/altair.c)2
-rw-r--r--src/mame/drivers/alto2.c (renamed from src/mess/drivers/alto2.c)2
-rw-r--r--src/mame/drivers/altos5.c (renamed from src/mess/drivers/altos5.c)4
-rw-r--r--src/mame/drivers/alvg.c18
-rw-r--r--src/mame/drivers/amaticmg.c16
-rw-r--r--src/mame/drivers/ambush.c8
-rw-r--r--src/mame/drivers/amico2k.c (renamed from src/mess/drivers/amico2k.c)2
-rw-r--r--src/mame/drivers/amiga.c (renamed from src/mess/drivers/amiga.c)48
-rw-r--r--src/mame/drivers/ampoker2.c26
-rw-r--r--src/mame/drivers/ampro.c (renamed from src/mess/drivers/ampro.c)3
-rw-r--r--src/mame/drivers/amspdwy.c8
-rw-r--r--src/mame/drivers/amstr_pc.c (renamed from src/mess/drivers/amstr_pc.c)12
-rw-r--r--src/mame/drivers/amstrad.c (renamed from src/mess/drivers/amstrad.c)40
-rw-r--r--src/mame/drivers/amusco.c24
-rw-r--r--src/mame/drivers/amust.c (renamed from src/mess/drivers/amust.c)32
-rw-r--r--src/mame/drivers/angelkds.c4
-rw-r--r--src/mame/drivers/apc.c (renamed from src/mess/drivers/apc.c)18
-rw-r--r--src/mame/drivers/apexc.c (renamed from src/mess/drivers/apexc.c)4
-rw-r--r--src/mame/drivers/apf.c (renamed from src/mess/drivers/apf.c)2
-rw-r--r--src/mame/drivers/apogee.c (renamed from src/mess/drivers/apogee.c)0
-rw-r--r--src/mame/drivers/apollo.c (renamed from src/mess/drivers/apollo.c)8
-rw-r--r--src/mame/drivers/apple1.c (renamed from src/mess/drivers/apple1.c)2
-rw-r--r--src/mame/drivers/apple2.c (renamed from src/mess/drivers/apple2.c)83
-rw-r--r--src/mame/drivers/apple2e.c (renamed from src/mess/drivers/apple2e.c)48
-rw-r--r--src/mame/drivers/apple2gs.c (renamed from src/mess/drivers/apple2gs.c)14
-rw-r--r--src/mame/drivers/apple3.c (renamed from src/mess/drivers/apple3.c)2
-rw-r--r--src/mame/drivers/applix.c (renamed from src/mess/drivers/applix.c)2
-rw-r--r--src/mame/drivers/appoooh.c8
-rw-r--r--src/mame/drivers/apricot.c (renamed from src/mess/drivers/apricot.c)4
-rw-r--r--src/mame/drivers/apricotf.c (renamed from src/mess/drivers/apricotf.c)8
-rw-r--r--src/mame/drivers/apricotp.c (renamed from src/mess/drivers/apricotp.c)2
-rw-r--r--src/mame/drivers/aquarium.c2
-rw-r--r--src/mame/drivers/aquarius.c (renamed from src/mess/drivers/aquarius.c)2
-rw-r--r--src/mame/drivers/arabian.c4
-rw-r--r--src/mame/drivers/arachnid.c2
-rw-r--r--src/mame/drivers/arcadecl.c4
-rw-r--r--src/mame/drivers/arcadia.c1710
-rw-r--r--src/mame/drivers/argo.c (renamed from src/mess/drivers/argo.c)2
-rw-r--r--src/mame/drivers/argus.c8
-rw-r--r--src/mame/drivers/aristmk4.c6
-rw-r--r--src/mame/drivers/aristmk5.c30
-rw-r--r--src/mame/drivers/aristmk6.c24
-rw-r--r--src/mame/drivers/arkanoid.c114
-rw-r--r--src/mame/drivers/armedf.c30
-rw-r--r--src/mame/drivers/arsystems.c1004
-rw-r--r--src/mame/drivers/artmagic.c12
-rw-r--r--src/mame/drivers/ashnojoe.c4
-rw-r--r--src/mame/drivers/asst128.c (renamed from src/mess/drivers/asst128.c)32
-rw-r--r--src/mame/drivers/asterix.c10
-rw-r--r--src/mame/drivers/asteroid.c36
-rw-r--r--src/mame/drivers/astinvad.c37
-rw-r--r--src/mame/drivers/astrafr.c366
-rw-r--r--src/mame/drivers/astrcorp.c94
-rw-r--r--src/mame/drivers/astrocde.c150
-rw-r--r--src/mame/drivers/astrof.c32
-rw-r--r--src/mame/drivers/astrohome.c (renamed from src/mess/drivers/astrocde.c)6
-rw-r--r--src/mame/drivers/astropc.c16
-rw-r--r--src/mame/drivers/asuka.c168
-rw-r--r--src/mame/drivers/at.c (renamed from src/mess/drivers/at.c)244
-rw-r--r--src/mame/drivers/atari400.c (renamed from src/mess/drivers/atari400.c)20
-rw-r--r--src/mame/drivers/atari_s1.c10
-rw-r--r--src/mame/drivers/atari_s2.c8
-rw-r--r--src/mame/drivers/atarifb.c14
-rw-r--r--src/mame/drivers/atarig1.c24
-rw-r--r--src/mame/drivers/atarig42.c4
-rw-r--r--src/mame/drivers/atarigt.c12
-rw-r--r--src/mame/drivers/atarigx2.c26
-rw-r--r--src/mame/drivers/atarist.c (renamed from src/mess/drivers/atarist.c)80
-rw-r--r--src/mame/drivers/atarisy1.c122
-rw-r--r--src/mame/drivers/atarisy2.c111
-rw-r--r--src/mame/drivers/atarisy4.c4
-rw-r--r--src/mame/drivers/atarittl.c64
-rw-r--r--src/mame/drivers/atetris.c14
-rw-r--r--src/mame/drivers/atlantis.c6
-rw-r--r--src/mame/drivers/atm.c (renamed from src/mess/drivers/atm.c)8
-rw-r--r--src/mame/drivers/atom.c (renamed from src/mess/drivers/atom.c)43
-rw-r--r--src/mame/drivers/atronic.c60
-rw-r--r--src/mame/drivers/attache.c (renamed from src/mess/drivers/attache.c)28
-rw-r--r--src/mame/drivers/attckufo.c2
-rw-r--r--src/mame/drivers/atvtrack.c6
-rw-r--r--src/mame/drivers/aussiebyte.c574
-rw-r--r--src/mame/drivers/avalnche.c6
-rw-r--r--src/mame/drivers/avigo.c (renamed from src/mess/drivers/avigo.c)10
-rw-r--r--src/mame/drivers/avt.c8
-rw-r--r--src/mame/drivers/ax20.c (renamed from src/mess/drivers/ax20.c)2
-rw-r--r--src/mame/drivers/aztarac.c2
-rw-r--r--src/mame/drivers/b16.c (renamed from src/mess/drivers/b16.c)2
-rw-r--r--src/mame/drivers/b2m.c (renamed from src/mess/drivers/b2m.c)4
-rw-r--r--src/mame/drivers/babbage.c (renamed from src/mess/drivers/babbage.c)2
-rw-r--r--src/mame/drivers/backfire.c4
-rw-r--r--src/mame/drivers/badlands.c4
-rw-r--r--src/mame/drivers/bagman.c24
-rw-r--r--src/mame/drivers/bailey.c4
-rw-r--r--src/mame/drivers/balsente.c66
-rw-r--r--src/mame/drivers/banctec.c (renamed from src/mess/drivers/banctec.c)2
-rw-r--r--src/mame/drivers/bankp.c4
-rw-r--r--src/mame/drivers/barata.c2
-rw-r--r--src/mame/drivers/bartop52.c2
-rw-r--r--src/mame/drivers/basic52.c (renamed from src/mess/drivers/basic52.c)4
-rw-r--r--src/mame/drivers/batman.c2
-rw-r--r--src/mame/drivers/battlane.c6
-rw-r--r--src/mame/drivers/battlera.c6
-rw-r--r--src/mame/drivers/battlex.c2
-rw-r--r--src/mame/drivers/battlnts.c15
-rw-r--r--src/mame/drivers/bbc.c (renamed from src/mess/drivers/bbc.c)945
-rw-r--r--src/mame/drivers/bbcbc.c (renamed from src/mess/drivers/bbcbc.c)2
-rw-r--r--src/mame/drivers/bbusters.c16
-rw-r--r--src/mame/drivers/bcs3.c492
-rw-r--r--src/mame/drivers/beaminv.c4
-rw-r--r--src/mame/drivers/bebox.c (renamed from src/mess/drivers/bebox.c)16
-rw-r--r--src/mame/drivers/beehive.c (renamed from src/mess/drivers/beehive.c)2
-rw-r--r--src/mame/drivers/beezer.c4
-rw-r--r--src/mame/drivers/belatra.c14
-rw-r--r--src/mame/drivers/berzerk.c14
-rw-r--r--src/mame/drivers/besta.c (renamed from src/mess/drivers/besta.c)24
-rw-r--r--src/mame/drivers/bestleag.c4
-rw-r--r--src/mame/drivers/beta.c (renamed from src/mess/drivers/beta.c)2
-rw-r--r--src/mame/drivers/bfcobra.c16
-rw-r--r--src/mame/drivers/bfm_ad5sw.c494
-rw-r--r--src/mame/drivers/bfm_sc1.c28
-rw-r--r--src/mame/drivers/bfm_sc2.c130
-rw-r--r--src/mame/drivers/bfm_sc4.c6238
-rw-r--r--src/mame/drivers/bfm_sc5sw.c3362
-rw-r--r--src/mame/drivers/bfm_swp.c8
-rw-r--r--src/mame/drivers/bfmsys83.c4
-rw-r--r--src/mame/drivers/bfmsys85.c68
-rw-r--r--src/mame/drivers/bgt.c8
-rw-r--r--src/mame/drivers/big10.c37
-rw-r--r--src/mame/drivers/bigbord2.c (renamed from src/mess/drivers/bigbord2.c)2
-rw-r--r--src/mame/drivers/bigevglf.c4
-rw-r--r--src/mame/drivers/bigstrkb.c4
-rw-r--r--src/mame/drivers/binbug.c (renamed from src/mess/drivers/binbug.c)2
-rw-r--r--src/mame/drivers/bingo.c48
-rw-r--r--src/mame/drivers/bingoc.c2
-rw-r--r--src/mame/drivers/bingoman.c4
-rw-r--r--src/mame/drivers/bingor.c10
-rw-r--r--src/mame/drivers/bionicc.c13
-rw-r--r--src/mame/drivers/bishi.c6
-rw-r--r--src/mame/drivers/bitgraph.c (renamed from src/mess/drivers/bitgraph.c)4
-rw-r--r--src/mame/drivers/bk.c (renamed from src/mess/drivers/bk.c)4
-rw-r--r--src/mame/drivers/bking.c6
-rw-r--r--src/mame/drivers/blackt96.c2
-rw-r--r--src/mame/drivers/bladestl.c9
-rw-r--r--src/mame/drivers/blitz.c4
-rw-r--r--src/mame/drivers/blitz68k.c26
-rw-r--r--src/mame/drivers/blktiger.c14
-rw-r--r--src/mame/drivers/blmbycar.c6
-rw-r--r--src/mame/drivers/blockade.c12
-rw-r--r--src/mame/drivers/blockhl.c390
-rw-r--r--src/mame/drivers/blockout.c10
-rw-r--r--src/mame/drivers/bloodbro.c12
-rw-r--r--src/mame/drivers/blueprnt.c8
-rw-r--r--src/mame/drivers/bmcbowl.c2
-rw-r--r--src/mame/drivers/bmcpokr.c6
-rw-r--r--src/mame/drivers/bmjr.c (renamed from src/mess/drivers/bmjr.c)15
-rw-r--r--src/mame/drivers/bml3.c (renamed from src/mess/drivers/bml3.c)19
-rw-r--r--src/mame/drivers/bnstars.c2
-rw-r--r--src/mame/drivers/bntyhunt.c2
-rw-r--r--src/mame/drivers/bob85.c (renamed from src/mess/drivers/bob85.c)2
-rw-r--r--src/mame/drivers/bogeyman.c7
-rw-r--r--src/mame/drivers/bombjack.c6
-rw-r--r--src/mame/drivers/boogwing.c10
-rw-r--r--src/mame/drivers/bottom9.c7
-rw-r--r--src/mame/drivers/bowltry.c2
-rw-r--r--src/mame/drivers/boxer.c2
-rw-r--r--src/mame/drivers/br8641.c200
-rw-r--r--src/mame/drivers/brkthru.c8
-rw-r--r--src/mame/drivers/bsktball.c2
-rw-r--r--src/mame/drivers/btime.c46
-rw-r--r--src/mame/drivers/btoads.c2
-rw-r--r--src/mame/drivers/bublbobl.c34
-rw-r--r--src/mame/drivers/buggychl.c4
-rw-r--r--src/mame/drivers/bullet.c (renamed from src/mess/drivers/bullet.c)4
-rw-r--r--src/mame/drivers/busicom.c (renamed from src/mess/drivers/busicom.c)2
-rw-r--r--src/mame/drivers/buster.c15
-rw-r--r--src/mame/drivers/bw12.c (renamed from src/mess/drivers/bw12.c)4
-rw-r--r--src/mame/drivers/bw2.c (renamed from src/mess/drivers/bw2.c)2
-rw-r--r--src/mame/drivers/bwidow.c20
-rw-r--r--src/mame/drivers/bwing.c10
-rw-r--r--src/mame/drivers/by17.c20
-rw-r--r--src/mame/drivers/by35.c142
-rw-r--r--src/mame/drivers/by6803.c46
-rw-r--r--src/mame/drivers/by68701.c12
-rw-r--r--src/mame/drivers/byvid.c6
-rw-r--r--src/mame/drivers/bzone.c12
-rw-r--r--src/mame/drivers/c10.c (renamed from src/mess/drivers/c10.c)2
-rw-r--r--src/mame/drivers/c128.c (renamed from src/mess/drivers/c128.c)96
-rw-r--r--src/mame/drivers/c64.c (renamed from src/mess/drivers/c64.c)84
-rw-r--r--src/mame/drivers/c64dtv.c (renamed from src/mess/drivers/c64dtv.c)2
-rw-r--r--src/mame/drivers/c65.c (renamed from src/mess/drivers/c65.c)4
-rw-r--r--src/mame/drivers/c65_old.c (renamed from src/mess/drivers/c65_old.c)4
-rw-r--r--src/mame/drivers/c80.c (renamed from src/mess/drivers/c80.c)2
-rw-r--r--src/mame/drivers/c900.c (renamed from src/mess/drivers/c900.c)2
-rw-r--r--src/mame/drivers/cabal.c12
-rw-r--r--src/mame/drivers/cabaret.c2
-rw-r--r--src/mame/drivers/calchase.c4
-rw-r--r--src/mame/drivers/calomega.c86
-rw-r--r--src/mame/drivers/calorie.c5
-rw-r--r--src/mame/drivers/camplynx.c936
-rw-r--r--src/mame/drivers/canon_s80.c54
-rw-r--r--src/mame/drivers/canyon.c4
-rw-r--r--src/mame/drivers/capbowl.c18
-rw-r--r--src/mame/drivers/capcom.c28
-rw-r--r--src/mame/drivers/capr1.c2
-rw-r--r--src/mame/drivers/caprcyc.c2
-rw-r--r--src/mame/drivers/cardline.c2
-rw-r--r--src/mame/drivers/carjmbre.c2
-rw-r--r--src/mame/drivers/carpolo.c2
-rw-r--r--src/mame/drivers/casloopy.c (renamed from src/mess/drivers/casloopy.c)4
-rw-r--r--src/mame/drivers/castle.c4
-rw-r--r--src/mame/drivers/caswin.c8
-rw-r--r--src/mame/drivers/cat.c (renamed from src/mess/drivers/cat.c)4
-rw-r--r--src/mame/drivers/cave.c98
-rw-r--r--src/mame/drivers/cavepc.c2
-rw-r--r--src/mame/drivers/cb2001.c4
-rw-r--r--src/mame/drivers/cball.c2
-rw-r--r--src/mame/drivers/cbasebal.c2
-rw-r--r--src/mame/drivers/cbm2.c (renamed from src/mess/drivers/cbm2.c)32
-rw-r--r--src/mame/drivers/cbuster.c10
-rw-r--r--src/mame/drivers/cc40.c (renamed from src/mess/drivers/cc40.c)2
-rw-r--r--src/mame/drivers/ccastles.c16
-rw-r--r--src/mame/drivers/cchance.c8
-rw-r--r--src/mame/drivers/cchasm.c4
-rw-r--r--src/mame/drivers/cclimber.c74
-rw-r--r--src/mame/drivers/ccs2810.c (renamed from src/mess/drivers/ccs2810.c)5
-rw-r--r--src/mame/drivers/ccs300.c (renamed from src/mess/drivers/ccs300.c)2
-rw-r--r--src/mame/drivers/cd2650.c (renamed from src/mess/drivers/cd2650.c)0
-rw-r--r--src/mame/drivers/cdc721.c (renamed from src/mess/drivers/cdc721.c)2
-rw-r--r--src/mame/drivers/cdi.c28
-rw-r--r--src/mame/drivers/centiped.c30
-rw-r--r--src/mame/drivers/cesclass.c6
-rw-r--r--src/mame/drivers/cfx9850.c (renamed from src/mess/drivers/cfx9850.c)2
-rw-r--r--src/mame/drivers/cgc7900.c (renamed from src/mess/drivers/cgc7900.c)2
-rw-r--r--src/mame/drivers/cgenie.c (renamed from src/mess/drivers/cgenie.c)0
-rw-r--r--src/mame/drivers/chaknpop.c2
-rw-r--r--src/mame/drivers/cham24.c2
-rw-r--r--src/mame/drivers/champbas.c32
-rw-r--r--src/mame/drivers/champbwl.c4
-rw-r--r--src/mame/drivers/chanbara.c26
-rw-r--r--src/mame/drivers/changela.c2
-rw-r--r--src/mame/drivers/channelf.c (renamed from src/mess/drivers/channelf.c)0
-rw-r--r--src/mame/drivers/chaos.c (renamed from src/mess/drivers/chaos.c)2
-rw-r--r--src/mame/drivers/cheekyms.c2
-rw-r--r--src/mame/drivers/chessmst.c (renamed from src/mess/drivers/chessmst.c)2
-rw-r--r--src/mame/drivers/chesstrv.c (renamed from src/mess/drivers/chesstrv.c)4
-rw-r--r--src/mame/drivers/chexx.c420
-rw-r--r--src/mame/drivers/chicago.c18
-rw-r--r--src/mame/drivers/chihiro.c1971
-rw-r--r--src/mame/drivers/chinagat.c8
-rw-r--r--src/mame/drivers/chinsan.c2
-rw-r--r--src/mame/drivers/chqflag.c28
-rw-r--r--src/mame/drivers/chsuper.c6
-rw-r--r--src/mame/drivers/cidelsa.c8
-rw-r--r--src/mame/drivers/cinemat.c50
-rw-r--r--src/mame/drivers/circus.c12
-rw-r--r--src/mame/drivers/circusc.c12
-rw-r--r--src/mame/drivers/cischeat.c16
-rw-r--r--src/mame/drivers/citycon.c6
-rw-r--r--src/mame/drivers/clayshoo.c2
-rw-r--r--src/mame/drivers/clcd.c (renamed from src/mess/drivers/clcd.c)0
-rw-r--r--src/mame/drivers/cliffhgr.c2
-rw-r--r--src/mame/drivers/cloak.c16
-rw-r--r--src/mame/drivers/cloud9.c4
-rw-r--r--src/mame/drivers/clshroad.c8
-rw-r--r--src/mame/drivers/cm1800.c (renamed from src/mess/drivers/cm1800.c)2
-rw-r--r--src/mame/drivers/cmmb.c14
-rw-r--r--src/mame/drivers/cninja.c78
-rw-r--r--src/mame/drivers/cntsteer.c73
-rw-r--r--src/mame/drivers/cobra.c37
-rw-r--r--src/mame/drivers/coco12.c (renamed from src/mess/drivers/coco12.c)0
-rw-r--r--src/mame/drivers/coco3.c (renamed from src/mess/drivers/coco3.c)4
-rw-r--r--src/mame/drivers/cocoloco.c2
-rw-r--r--src/mame/drivers/codata.c (renamed from src/mess/drivers/codata.c)2
-rw-r--r--src/mame/drivers/coinmstr.c10
-rw-r--r--src/mame/drivers/coinmvga.c10
-rw-r--r--src/mame/drivers/coleco.c (renamed from src/mess/drivers/coleco.c)99
-rw-r--r--src/mame/drivers/combatsc.c2
-rw-r--r--src/mame/drivers/comebaby.c2
-rw-r--r--src/mame/drivers/commando.c16
-rw-r--r--src/mame/drivers/compgolf.c4
-rw-r--r--src/mame/drivers/compis.c (renamed from src/mess/drivers/compis.c)4
-rw-r--r--src/mame/drivers/compucolor.c (renamed from src/mess/drivers/compucolor.c)24
-rw-r--r--src/mame/drivers/comquest.c (renamed from src/mess/drivers/comquest.c)2
-rw-r--r--src/mame/drivers/comx35.c (renamed from src/mess/drivers/comx35.c)4
-rw-r--r--src/mame/drivers/concept.c (renamed from src/mess/drivers/concept.c)0
-rw-r--r--src/mame/drivers/contra.c20
-rw-r--r--src/mame/drivers/coolpool.c6
-rw-r--r--src/mame/drivers/coolridr.c77
-rw-r--r--src/mame/drivers/cop01.c6
-rw-r--r--src/mame/drivers/cops.c6
-rw-r--r--src/mame/drivers/copsnrob.c2
-rw-r--r--src/mame/drivers/corona.c4
-rw-r--r--src/mame/drivers/cortex.c (renamed from src/mess/drivers/cortex.c)2
-rw-r--r--src/mame/drivers/cosmic.c32
-rw-r--r--src/mame/drivers/cosmicos.c (renamed from src/mess/drivers/cosmicos.c)2
-rw-r--r--src/mame/drivers/cp1.c (renamed from src/mess/drivers/cp1.c)2
-rw-r--r--src/mame/drivers/cps1.c439
-rw-r--r--src/mame/drivers/cps2.c631
-rw-r--r--src/mame/drivers/cps3.c84
-rw-r--r--src/mame/drivers/craft.c (renamed from src/mess/drivers/craft.c)14
-rw-r--r--src/mame/drivers/crbaloon.c4
-rw-r--r--src/mame/drivers/crgolf.c12
-rw-r--r--src/mame/drivers/crimfght.c261
-rw-r--r--src/mame/drivers/crospang.c6
-rw-r--r--src/mame/drivers/crshrace.c4
-rw-r--r--src/mame/drivers/crvision.c (renamed from src/mess/drivers/crvision.c)4
-rw-r--r--src/mame/drivers/crystal.c6
-rw-r--r--src/mame/drivers/csc.c (renamed from src/mess/drivers/csc.c)2
-rw-r--r--src/mame/drivers/cshooter.c4
-rw-r--r--src/mame/drivers/csplayh5.c116
-rw-r--r--src/mame/drivers/cswat.c2
-rw-r--r--src/mame/drivers/ct486.c (renamed from src/mess/drivers/ct486.c)0
-rw-r--r--src/mame/drivers/cubo.c18
-rw-r--r--src/mame/drivers/cultures.c2
-rw-r--r--src/mame/drivers/cupidon.c14
-rw-r--r--src/mame/drivers/cv1k.c6
-rw-r--r--src/mame/drivers/cvicny.c (renamed from src/mess/drivers/cvicny.c)2
-rw-r--r--src/mame/drivers/cvs.c50
-rw-r--r--src/mame/drivers/cxhumax.c (renamed from src/mess/drivers/cxhumax.c)2
-rw-r--r--src/mame/drivers/cybertnk.c2
-rw-r--r--src/mame/drivers/cybiko.c (renamed from src/mess/drivers/cybiko.c)46
-rw-r--r--src/mame/drivers/cyclemb.c4
-rw-r--r--src/mame/drivers/czk80.c (renamed from src/mess/drivers/czk80.c)2
-rw-r--r--src/mame/drivers/d6800.c (renamed from src/mess/drivers/d6800.c)0
-rw-r--r--src/mame/drivers/d6809.c (renamed from src/mess/drivers/d6809.c)2
-rw-r--r--src/mame/drivers/d9final.c2
-rw-r--r--src/mame/drivers/dacholer.c6
-rw-r--r--src/mame/drivers/dai.c (renamed from src/mess/drivers/dai.c)0
-rw-r--r--src/mame/drivers/dai3wksi.c31
-rw-r--r--src/mame/drivers/darius.c10
-rw-r--r--src/mame/drivers/darkmist.c2
-rw-r--r--src/mame/drivers/darkseal.c10
-rw-r--r--src/mame/drivers/daruma.c169
-rw-r--r--src/mame/drivers/dassault.c12
-rw-r--r--src/mame/drivers/dblcrown.c2
-rw-r--r--src/mame/drivers/dblewing.c2
-rw-r--r--src/mame/drivers/dbz.c6
-rw-r--r--src/mame/drivers/dccons.c (renamed from src/mess/drivers/dccons.c)10
-rw-r--r--src/mame/drivers/dcheese.c18
-rw-r--r--src/mame/drivers/dcon.c4
-rw-r--r--src/mame/drivers/dct11em.c (renamed from src/mess/drivers/dct11em.c)2
-rw-r--r--src/mame/drivers/dday.c4
-rw-r--r--src/mame/drivers/ddayjlc.c4
-rw-r--r--src/mame/drivers/ddealer.c5
-rw-r--r--src/mame/drivers/ddenlovr.c1065
-rw-r--r--src/mame/drivers/ddragon.c46
-rw-r--r--src/mame/drivers/ddragon3.c34
-rw-r--r--src/mame/drivers/ddribble.c4
-rw-r--r--src/mame/drivers/ddz.c2
-rw-r--r--src/mame/drivers/de_2.c34
-rw-r--r--src/mame/drivers/de_3.c92
-rw-r--r--src/mame/drivers/de_3b.c52
-rw-r--r--src/mame/drivers/deadang.c64
-rw-r--r--src/mame/drivers/dec0.c104
-rw-r--r--src/mame/drivers/dec8.c46
-rw-r--r--src/mame/drivers/deco156.c14
-rw-r--r--src/mame/drivers/deco32.c441
-rw-r--r--src/mame/drivers/deco_ld.c10
-rw-r--r--src/mame/drivers/deco_mlc.c4
-rw-r--r--src/mame/drivers/decocass.c10
-rw-r--r--src/mame/drivers/dectalk.c (renamed from src/mess/drivers/dectalk.c)2
-rw-r--r--src/mame/drivers/decwritr.c384
-rw-r--r--src/mame/drivers/deniam.c8
-rw-r--r--src/mame/drivers/deshoros.c2
-rw-r--r--src/mame/drivers/destroyr.c86
-rw-r--r--src/mame/drivers/dfruit.c2
-rw-r--r--src/mame/drivers/dgn_beta.c (renamed from src/mess/drivers/dgn_beta.c)2
-rw-r--r--src/mame/drivers/dgpix.c12
-rw-r--r--src/mame/drivers/dietgo.c8
-rw-r--r--src/mame/drivers/digel804.c (renamed from src/mess/drivers/digel804.c)4
-rw-r--r--src/mame/drivers/dim68k.c (renamed from src/mess/drivers/dim68k.c)2
-rw-r--r--src/mame/drivers/discoboy.c4
-rw-r--r--src/mame/drivers/diverboy.c3
-rw-r--r--src/mame/drivers/djboy.c6
-rw-r--r--src/mame/drivers/djmain.c21
-rw-r--r--src/mame/drivers/dkong.c74
-rw-r--r--src/mame/drivers/dlair.c36
-rw-r--r--src/mame/drivers/dlair2.c30
-rw-r--r--src/mame/drivers/dm7000.c (renamed from src/mess/drivers/dm7000.c)6
-rw-r--r--src/mame/drivers/dmndrby.c4
-rw-r--r--src/mame/drivers/dms5000.c (renamed from src/mess/drivers/dms5000.c)2
-rw-r--r--src/mame/drivers/dms86.c (renamed from src/mess/drivers/dms86.c)2
-rw-r--r--src/mame/drivers/dmv.c (renamed from src/mess/drivers/dmv.c)2
-rw-r--r--src/mame/drivers/docastle.c30
-rw-r--r--src/mame/drivers/dogfgt.c6
-rw-r--r--src/mame/drivers/dolphunk.c (renamed from src/mess/drivers/dolphunk.c)0
-rw-r--r--src/mame/drivers/dominob.c5
-rw-r--r--src/mame/drivers/dooyong.c44
-rw-r--r--src/mame/drivers/dorachan.c48
-rw-r--r--src/mame/drivers/dotrikun.c4
-rw-r--r--src/mame/drivers/dps1.c (renamed from src/mess/drivers/dps1.c)2
-rw-r--r--src/mame/drivers/dragon.c (renamed from src/mess/drivers/dragon.c)0
-rw-r--r--src/mame/drivers/dragrace.c2
-rw-r--r--src/mame/drivers/dreambal.c2
-rw-r--r--src/mame/drivers/dreamwld.c24
-rw-r--r--src/mame/drivers/drgnmst.c2
-rw-r--r--src/mame/drivers/dribling.c6
-rw-r--r--src/mame/drivers/drmicro.c2
-rw-r--r--src/mame/drivers/drtomy.c5
-rw-r--r--src/mame/drivers/drw80pkr.c4
-rw-r--r--src/mame/drivers/dsb46.c (renamed from src/mess/drivers/dsb46.c)2
-rw-r--r--src/mame/drivers/dual68.c (renamed from src/mess/drivers/dual68.c)2
-rw-r--r--src/mame/drivers/dunhuang.c2
-rw-r--r--src/mame/drivers/dvk_kcgd.c384
-rw-r--r--src/mame/drivers/dvk_ksm.c (renamed from src/mess/drivers/dvk_ksm.c)14
-rw-r--r--src/mame/drivers/dwarfd.c12
-rw-r--r--src/mame/drivers/dynadice.c14
-rw-r--r--src/mame/drivers/dynax.c144
-rw-r--r--src/mame/drivers/dynduke.c17
-rw-r--r--src/mame/drivers/eacc.c (renamed from src/mess/drivers/eacc.c)2
-rw-r--r--src/mame/drivers/ec184x.c (renamed from src/mess/drivers/ec184x.c)57
-rw-r--r--src/mame/drivers/ec65.c (renamed from src/mess/drivers/ec65.c)4
-rw-r--r--src/mame/drivers/ecoinf1.c18
-rw-r--r--src/mame/drivers/ecoinf2.c20
-rw-r--r--src/mame/drivers/ecoinf3.c24
-rw-r--r--src/mame/drivers/ecoinfr.c2
-rw-r--r--src/mame/drivers/egghunt.c2
-rw-r--r--src/mame/drivers/einstein.c (renamed from src/mess/drivers/einstein.c)2
-rw-r--r--src/mame/drivers/elecbowl.c (renamed from src/mess/drivers/elecbowl.c)6
-rw-r--r--src/mame/drivers/electra.c2
-rw-r--r--src/mame/drivers/electron.c (renamed from src/mess/drivers/electron.c)57
-rw-r--r--src/mame/drivers/elekscmp.c (renamed from src/mess/drivers/elekscmp.c)2
-rw-r--r--src/mame/drivers/elf.c (renamed from src/mess/drivers/elf.c)2
-rw-r--r--src/mame/drivers/elwro800.c (renamed from src/mess/drivers/elwro800.c)0
-rw-r--r--src/mame/drivers/embargo.c2
-rw-r--r--src/mame/drivers/enigma2.c61
-rw-r--r--src/mame/drivers/enmirage.c (renamed from src/mess/drivers/mirage.c)2
-rw-r--r--src/mame/drivers/eolith.c38
-rw-r--r--src/mame/drivers/eolith16.c2
-rw-r--r--src/mame/drivers/ep64.c (renamed from src/mess/drivers/ep64.c)6
-rw-r--r--src/mame/drivers/epos.c18
-rw-r--r--src/mame/drivers/eprom.c8
-rw-r--r--src/mame/drivers/equites.c16
-rw-r--r--src/mame/drivers/ertictac.c8
-rw-r--r--src/mame/drivers/esd16.c30
-rw-r--r--src/mame/drivers/esh.c6
-rw-r--r--src/mame/drivers/espial.c6
-rw-r--r--src/mame/drivers/esq1.c (renamed from src/mess/drivers/esq1.c)6
-rw-r--r--src/mame/drivers/esq5505.c (renamed from src/mess/drivers/esq5505.c)16
-rw-r--r--src/mame/drivers/esqasr.c (renamed from src/mess/drivers/esqasr.c)4
-rw-r--r--src/mame/drivers/esqkt.c (renamed from src/mess/drivers/esqkt.c)2
-rw-r--r--src/mame/drivers/esqmr.c (renamed from src/mess/drivers/esqmr.c)4
-rw-r--r--src/mame/drivers/esripsys.c6
-rw-r--r--src/mame/drivers/et3400.c (renamed from src/mess/drivers/et3400.c)2
-rw-r--r--src/mame/drivers/eti660.c350
-rw-r--r--src/mame/drivers/ettrivia.c2
-rw-r--r--src/mame/drivers/europc.c (renamed from src/mess/drivers/europc.c)2
-rw-r--r--src/mame/drivers/evmbug.c (renamed from src/mess/drivers/evmbug.c)2
-rw-r--r--src/mame/drivers/excali64.c (renamed from src/mess/drivers/excali64.c)2
-rw-r--r--src/mame/drivers/exedexes.c4
-rw-r--r--src/mame/drivers/exelv.c (renamed from src/mess/drivers/exelv.c)28
-rw-r--r--src/mame/drivers/exerion.c6
-rw-r--r--src/mame/drivers/exidy.c46
-rw-r--r--src/mame/drivers/exidyttl.c6
-rw-r--r--src/mame/drivers/exp85.c (renamed from src/mess/drivers/exp85.c)0
-rw-r--r--src/mame/drivers/expro02.c46
-rw-r--r--src/mame/drivers/exprraid.c14
-rw-r--r--src/mame/drivers/extrema.c20
-rw-r--r--src/mame/drivers/exzisus.c6
-rw-r--r--src/mame/drivers/f-32.c4
-rw-r--r--src/mame/drivers/f1gp.c6
-rw-r--r--src/mame/drivers/famibox.c2
-rw-r--r--src/mame/drivers/fantland.c10
-rw-r--r--src/mame/drivers/fanucs15.c (renamed from src/mess/drivers/fanucs15.c)2
-rw-r--r--src/mame/drivers/fanucspmg.c (renamed from src/mess/drivers/fanucspmg.c)4
-rw-r--r--src/mame/drivers/fastfred.c16
-rw-r--r--src/mame/drivers/fastlane.c2
-rw-r--r--src/mame/drivers/fb01.c (renamed from src/mess/drivers/fb01.c)2
-rw-r--r--src/mame/drivers/fc100.c (renamed from src/mess/drivers/fc100.c)2
-rw-r--r--src/mame/drivers/fcombat.c2
-rw-r--r--src/mame/drivers/fcrash.c86
-rw-r--r--src/mame/drivers/fgoal.c4
-rw-r--r--src/mame/drivers/fidelz80.c (renamed from src/mess/drivers/fidelz80.c)12
-rw-r--r--src/mame/drivers/finalizr.c4
-rw-r--r--src/mame/drivers/fireball.c2
-rw-r--r--src/mame/drivers/firebeat.c1066
-rw-r--r--src/mame/drivers/firetrap.c8
-rw-r--r--src/mame/drivers/fitfight.c8
-rw-r--r--src/mame/drivers/fk1.c (renamed from src/mess/drivers/fk1.c)2
-rw-r--r--src/mame/drivers/flicker.c2
-rw-r--r--src/mame/drivers/flipjack.c2
-rw-r--r--src/mame/drivers/flkatck.c6
-rw-r--r--src/mame/drivers/flower.c4
-rw-r--r--src/mame/drivers/flstory.c12
-rw-r--r--src/mame/drivers/flyball.c4
-rw-r--r--src/mame/drivers/fm7.c (renamed from src/mess/drivers/fm7.c)29
-rw-r--r--src/mame/drivers/fmtowns.c (renamed from src/mess/drivers/fmtowns.c)24
-rw-r--r--src/mame/drivers/foodf.c8
-rw-r--r--src/mame/drivers/force68k.c606
-rw-r--r--src/mame/drivers/forte2.c2
-rw-r--r--src/mame/drivers/fortecar.c2
-rw-r--r--src/mame/drivers/fp1100.c (renamed from src/mess/drivers/fp1100.c)2
-rw-r--r--src/mame/drivers/fp200.c (renamed from src/mess/drivers/fp200.c)2
-rw-r--r--src/mame/drivers/fp6000.c (renamed from src/mess/drivers/fp6000.c)2
-rw-r--r--src/mame/drivers/freekick.c30
-rw-r--r--src/mame/drivers/fresh.c2
-rw-r--r--src/mame/drivers/fromanc2.c6
-rw-r--r--src/mame/drivers/fromance.c16
-rw-r--r--src/mame/drivers/fruitpc.c4
-rw-r--r--src/mame/drivers/ft68m.c (renamed from src/mess/drivers/ft68m.c)2
-rw-r--r--src/mame/drivers/fungames.c4
-rw-r--r--src/mame/drivers/funkball.c2
-rw-r--r--src/mame/drivers/funkybee.c8
-rw-r--r--src/mame/drivers/funkyjet.c8
-rw-r--r--src/mame/drivers/funworld.c28
-rw-r--r--src/mame/drivers/funybubl.c4
-rw-r--r--src/mame/drivers/fuukifg2.c6
-rw-r--r--src/mame/drivers/fuukifg3.c19
-rw-r--r--src/mame/drivers/g627.c6
-rw-r--r--src/mame/drivers/gaelco.c12
-rw-r--r--src/mame/drivers/gaelco2.c44
-rw-r--r--src/mame/drivers/gaelco3d.c14
-rw-r--r--src/mame/drivers/gaiden.c30
-rw-r--r--src/mame/drivers/gal3.c4
-rw-r--r--src/mame/drivers/galaga.c58
-rw-r--r--src/mame/drivers/galastrm.c2
-rw-r--r--src/mame/drivers/galaxi.c5
-rw-r--r--src/mame/drivers/galaxia.c34
-rw-r--r--src/mame/drivers/galaxian.c494
-rw-r--r--src/mame/drivers/galaxold.c126
-rw-r--r--src/mame/drivers/galaxy.c (renamed from src/mess/drivers/galaxy.c)0
-rw-r--r--src/mame/drivers/galeb.c (renamed from src/mess/drivers/galeb.c)0
-rw-r--r--src/mame/drivers/galgame.c2
-rw-r--r--src/mame/drivers/galivan.c22
-rw-r--r--src/mame/drivers/galpani2.c24
-rw-r--r--src/mame/drivers/galpani3.c8
-rw-r--r--src/mame/drivers/galpanic.c9
-rw-r--r--src/mame/drivers/galspnbl.c4
-rw-r--r--src/mame/drivers/gamate.c (renamed from src/mess/drivers/gamate.c)14
-rw-r--r--src/mame/drivers/gambl186.c4
-rw-r--r--src/mame/drivers/gamecom.c (renamed from src/mess/drivers/gamecom.c)2
-rw-r--r--src/mame/drivers/gamecstl.c4
-rw-r--r--src/mame/drivers/gameking.c (renamed from src/mess/drivers/gameking.c)5
-rw-r--r--src/mame/drivers/gameplan.c16
-rw-r--r--src/mame/drivers/gamepock.c (renamed from src/mess/drivers/gamepock.c)0
-rw-r--r--src/mame/drivers/gammagic.c4
-rw-r--r--src/mame/drivers/gamtor.c2
-rw-r--r--src/mame/drivers/gaplus.c18
-rw-r--r--src/mame/drivers/gb.c (renamed from src/mess/drivers/gb.c)43
-rw-r--r--src/mame/drivers/gba.c (renamed from src/mess/drivers/gba.c)6
-rw-r--r--src/mame/drivers/gberet.c8
-rw-r--r--src/mame/drivers/gcpinbal.c2
-rw-r--r--src/mame/drivers/gei.c276
-rw-r--r--src/mame/drivers/geneve.c (renamed from src/mess/drivers/geneve.c)106
-rw-r--r--src/mame/drivers/geniusiq.c (renamed from src/mess/drivers/geniusiq.c)16
-rw-r--r--src/mame/drivers/genpc.c (renamed from src/mess/drivers/genpc.c)2
-rw-r--r--src/mame/drivers/ggconnie.c2
-rw-r--r--src/mame/drivers/ghosteo.c6
-rw-r--r--src/mame/drivers/gijoe.c8
-rw-r--r--src/mame/drivers/gimix.c (renamed from src/mess/drivers/gimix.c)2
-rw-r--r--src/mame/drivers/ginganin.c4
-rw-r--r--src/mame/drivers/gizmondo.c (renamed from src/mess/drivers/gizmondo.c)2
-rw-r--r--src/mame/drivers/gladiatr.c12
-rw-r--r--src/mame/drivers/glasgow.c (renamed from src/mess/drivers/glasgow.c)137
-rw-r--r--src/mame/drivers/glass.c6
-rw-r--r--src/mame/drivers/globalfr.c44
-rw-r--r--src/mame/drivers/globalvr.c18
-rw-r--r--src/mame/drivers/gluck2.c2
-rw-r--r--src/mame/drivers/gmaster.c (renamed from src/mess/drivers/gmaster.c)2
-rw-r--r--src/mame/drivers/gng.c22
-rw-r--r--src/mame/drivers/go2000.c3
-rw-r--r--src/mame/drivers/goal92.c2
-rw-r--r--src/mame/drivers/goindol.c8
-rw-r--r--src/mame/drivers/goldngam.c4
-rw-r--r--src/mame/drivers/goldnpkr.c40
-rw-r--r--src/mame/drivers/goldstar.c207
-rw-r--r--src/mame/drivers/good.c3
-rw-r--r--src/mame/drivers/goodejan.c6
-rw-r--r--src/mame/drivers/gotcha.c4
-rw-r--r--src/mame/drivers/gottlieb.c24
-rw-r--r--src/mame/drivers/gotya.c4
-rw-r--r--src/mame/drivers/gp2x.c (renamed from src/mess/drivers/gp2x.c)2
-rw-r--r--src/mame/drivers/gp32.c (renamed from src/mess/drivers/gp32.c)2
-rw-r--r--src/mame/drivers/gp_1.c20
-rw-r--r--src/mame/drivers/gp_2.c30
-rw-r--r--src/mame/drivers/gpworld.c2
-rw-r--r--src/mame/drivers/gradius3.c91
-rw-r--r--src/mame/drivers/grchamp.c2
-rw-r--r--src/mame/drivers/grfd2301.c (renamed from src/mess/drivers/grfd2301.c)2
-rw-r--r--src/mame/drivers/gridlee.c2
-rw-r--r--src/mame/drivers/groundfx.c2
-rw-r--r--src/mame/drivers/gstream.c6
-rw-r--r--src/mame/drivers/gstriker.c18
-rw-r--r--src/mame/drivers/gsword.c6
-rw-r--r--src/mame/drivers/gticlub.c18
-rw-r--r--src/mame/drivers/gts1.c42
-rw-r--r--src/mame/drivers/gts3.c32
-rw-r--r--src/mame/drivers/gts3a.c70
-rw-r--r--src/mame/drivers/gts80.c44
-rw-r--r--src/mame/drivers/gts80a.c44
-rw-r--r--src/mame/drivers/gts80b.c50
-rw-r--r--src/mame/drivers/guab.c2
-rw-r--r--src/mame/drivers/gumbo.c14
-rw-r--r--src/mame/drivers/gundealr.c12
-rw-r--r--src/mame/drivers/gunpey.c2
-rw-r--r--src/mame/drivers/gunsmoke.c391
-rw-r--r--src/mame/drivers/gyruss.c8
-rw-r--r--src/mame/drivers/h19.c (renamed from src/mess/drivers/h19.c)2
-rw-r--r--src/mame/drivers/h8.c (renamed from src/mess/drivers/h8.c)2
-rw-r--r--src/mame/drivers/h89.c (renamed from src/mess/drivers/h89.c)2
-rw-r--r--src/mame/drivers/halleys.c10
-rw-r--r--src/mame/drivers/hanaawas.c2
-rw-r--r--src/mame/drivers/hankin.c10
-rw-r--r--src/mame/drivers/harddriv.c210
-rw-r--r--src/mame/drivers/harriet.c (renamed from src/mess/drivers/harriet.c)2
-rw-r--r--src/mame/drivers/hazelgr.c2
-rw-r--r--src/mame/drivers/hcastle.c10
-rw-r--r--src/mame/drivers/headonb.c2
-rw-r--r--src/mame/drivers/hec2hrp.c (renamed from src/mess/drivers/hec2hrp.c)14
-rw-r--r--src/mame/drivers/hh_cop400.c (renamed from src/mess/drivers/hh_cop400.c)14
-rw-r--r--src/mame/drivers/hh_hmcs40.c (renamed from src/mess/drivers/hh_hmcs40.c)824
-rw-r--r--src/mame/drivers/hh_melps4.c (renamed from src/mess/drivers/hh_melps4.c)161
-rw-r--r--src/mame/drivers/hh_pic16.c (renamed from src/mess/drivers/hh_pic16.c)4
-rw-r--r--src/mame/drivers/hh_sm510.c (renamed from src/mess/drivers/hh_sm510.c)10
-rw-r--r--src/mame/drivers/hh_tms1k.c (renamed from src/mess/drivers/hh_tms1k.c)101
-rw-r--r--src/mame/drivers/hh_ucom4.c (renamed from src/mess/drivers/hh_ucom4.c)223
-rw-r--r--src/mame/drivers/hideseek.c2
-rw-r--r--src/mame/drivers/higemaru.c2
-rw-r--r--src/mame/drivers/highvdeo.c4
-rw-r--r--src/mame/drivers/hikaru.c12
-rw-r--r--src/mame/drivers/himesiki.c2
-rw-r--r--src/mame/drivers/hitme.c12
-rw-r--r--src/mame/drivers/hitpoker.c2
-rw-r--r--src/mame/drivers/hk68v10.c383
-rw-r--r--src/mame/drivers/hnayayoi.c6
-rw-r--r--src/mame/drivers/hng64.c89
-rw-r--r--src/mame/drivers/holeland.c8
-rw-r--r--src/mame/drivers/homedata.c40
-rw-r--r--src/mame/drivers/homelab.c (renamed from src/mess/drivers/homelab.c)10
-rw-r--r--src/mame/drivers/homerun.c6
-rw-r--r--src/mame/drivers/homez80.c (renamed from src/mess/drivers/homez80.c)2
-rw-r--r--src/mame/drivers/horizon.c (renamed from src/mess/drivers/horizon.c)4
-rw-r--r--src/mame/drivers/hornet.c18
-rw-r--r--src/mame/drivers/hotblock.c2
-rw-r--r--src/mame/drivers/hotstuff.c2
-rw-r--r--src/mame/drivers/hp16500.c (renamed from src/mess/drivers/hp16500.c)8
-rw-r--r--src/mame/drivers/hp48.c (renamed from src/mess/drivers/hp48.c)2
-rw-r--r--src/mame/drivers/hp49gp.c (renamed from src/mess/drivers/hp49gp.c)2
-rw-r--r--src/mame/drivers/hp64k.c (renamed from src/mess/drivers/hp64k.c)620
-rw-r--r--src/mame/drivers/hp9845.c (renamed from src/mess/drivers/hp9845.c)14
-rw-r--r--src/mame/drivers/hp9k.c (renamed from src/mess/drivers/hp9k.c)2
-rw-r--r--src/mame/drivers/hp9k_3xx.c (renamed from src/mess/drivers/hp9k_3xx.c)14
-rw-r--r--src/mame/drivers/hp_ipc.c358
-rw-r--r--src/mame/drivers/hprot1.c (renamed from src/mess/drivers/hprot1.c)6
-rw-r--r--src/mame/drivers/hpz80unk.c (renamed from src/mess/drivers/hpz80unk.c)2
-rw-r--r--src/mame/drivers/hshavoc.c2
-rw-r--r--src/mame/drivers/ht68k.c (renamed from src/mess/drivers/ht68k.c)2
-rw-r--r--src/mame/drivers/huebler.c (renamed from src/mess/drivers/huebler.c)2
-rw-r--r--src/mame/drivers/hunter2.c (renamed from src/mess/drivers/hunter2.c)2
-rw-r--r--src/mame/drivers/hvyunit.c8
-rw-r--r--src/mame/drivers/hx20.c (renamed from src/mess/drivers/hx20.c)4
-rw-r--r--src/mame/drivers/hyhoo.c4
-rw-r--r--src/mame/drivers/hyperscan.c (renamed from src/mess/drivers/hyperscan.c)2
-rw-r--r--src/mame/drivers/hyperspt.c10
-rw-r--r--src/mame/drivers/hyprduel.c6
-rw-r--r--src/mame/drivers/i7000.c415
-rw-r--r--src/mame/drivers/ibm6580.c (renamed from src/mess/drivers/ibm6580.c)2
-rw-r--r--src/mame/drivers/ibmpc.c (renamed from src/mess/drivers/ibmpc.c)2
-rw-r--r--src/mame/drivers/ibmpcjr.c (renamed from src/mess/drivers/ibmpcjr.c)4
-rw-r--r--src/mame/drivers/icatel.c (renamed from src/mess/drivers/icatel.c)28
-rw-r--r--src/mame/drivers/icecold.c4
-rw-r--r--src/mame/drivers/ichiban.c2
-rw-r--r--src/mame/drivers/ie15.c (renamed from src/mess/drivers/ie15.c)15
-rw-r--r--src/mame/drivers/if800.c (renamed from src/mess/drivers/if800.c)2
-rw-r--r--src/mame/drivers/igs009.c4
-rw-r--r--src/mame/drivers/igs011.c34
-rw-r--r--src/mame/drivers/igs017.c669
-rw-r--r--src/mame/drivers/igs_fear.c169
-rw-r--r--src/mame/drivers/igs_m027.c690
-rw-r--r--src/mame/drivers/igs_m036.c12
-rw-r--r--src/mame/drivers/igspc.c4
-rw-r--r--src/mame/drivers/igspoker.c104
-rw-r--r--src/mame/drivers/ikki.c4
-rw-r--r--src/mame/drivers/imds.c (renamed from src/mess/drivers/imds.c)2
-rw-r--r--src/mame/drivers/imds2.c (renamed from src/mess/drivers/imds2.c)48
-rw-r--r--src/mame/drivers/imolagp.c4
-rw-r--r--src/mame/drivers/imsai.c (renamed from src/mess/drivers/imsai.c)2
-rw-r--r--src/mame/drivers/inder.c20
-rw-r--r--src/mame/drivers/indiana.c (renamed from src/mess/drivers/indiana.c)2
-rw-r--r--src/mame/drivers/instruct.c (renamed from src/mess/drivers/instruct.c)0
-rw-r--r--src/mame/drivers/interact.c (renamed from src/mess/drivers/interact.c)4
-rw-r--r--src/mame/drivers/intrscti.c2
-rw-r--r--src/mame/drivers/intv.c (renamed from src/mess/drivers/intv.c)12
-rw-r--r--src/mame/drivers/inufuku.c4
-rw-r--r--src/mame/drivers/invqix.c2
-rw-r--r--src/mame/drivers/ip20.c (renamed from src/mess/drivers/ip20.c)2
-rw-r--r--src/mame/drivers/ip22.c (renamed from src/mess/drivers/ip22.c)6
-rw-r--r--src/mame/drivers/ipc.c (renamed from src/mess/drivers/ipc.c)4
-rw-r--r--src/mame/drivers/ipds.c (renamed from src/mess/drivers/ipds.c)2
-rw-r--r--src/mame/drivers/iq151.c (renamed from src/mess/drivers/iq151.c)0
-rw-r--r--src/mame/drivers/iqblock.c4
-rw-r--r--src/mame/drivers/irisha.c (renamed from src/mess/drivers/irisha.c)2
-rw-r--r--src/mame/drivers/ironhors.c6
-rw-r--r--src/mame/drivers/isbc.c (renamed from src/mess/drivers/isbc.c)8
-rw-r--r--src/mame/drivers/iskr103x.c (renamed from src/mess/drivers/iskr103x.c)2
-rw-r--r--src/mame/drivers/istellar.c2
-rw-r--r--src/mame/drivers/iteagle.c14
-rw-r--r--src/mame/drivers/itech32.c2
-rw-r--r--src/mame/drivers/itech8.c27
-rw-r--r--src/mame/drivers/itgambl2.c34
-rw-r--r--src/mame/drivers/itgambl3.c12
-rw-r--r--src/mame/drivers/itgamble.c20
-rw-r--r--src/mame/drivers/itt3030.c (renamed from src/mess/drivers/itt3030.c)2
-rw-r--r--src/mame/drivers/jack.c43
-rw-r--r--src/mame/drivers/jackie.c2
-rw-r--r--src/mame/drivers/jackpool.c2
-rw-r--r--src/mame/drivers/jade.c (renamed from src/mess/drivers/jade.c)2
-rw-r--r--src/mame/drivers/jaguar.c49
-rw-r--r--src/mame/drivers/jailbrek.c6
-rw-r--r--src/mame/drivers/jalmah.c12
-rw-r--r--src/mame/drivers/jangou.c16
-rw-r--r--src/mame/drivers/jankenmn.c2
-rw-r--r--src/mame/drivers/jantotsu.c2
-rw-r--r--src/mame/drivers/jchan.c4
-rw-r--r--src/mame/drivers/jclub2.c8
-rw-r--r--src/mame/drivers/jedi.c2
-rw-r--r--src/mame/drivers/jeutel.c4
-rw-r--r--src/mame/drivers/jokrwild.c2
-rw-r--r--src/mame/drivers/jollyjgr.c53
-rw-r--r--src/mame/drivers/jongkyo.c2
-rw-r--r--src/mame/drivers/jonos.c (renamed from src/mess/drivers/jonos.c)2
-rw-r--r--src/mame/drivers/joystand.c687
-rw-r--r--src/mame/drivers/jp.c20
-rw-r--r--src/mame/drivers/jpmimpct.c36
-rw-r--r--src/mame/drivers/jpmimpctsw.c2
-rw-r--r--src/mame/drivers/jpmmps.c416
-rw-r--r--src/mame/drivers/jpms80.c48
-rw-r--r--src/mame/drivers/jpmsru.c24
-rw-r--r--src/mame/drivers/jpmsys5.c2
-rw-r--r--src/mame/drivers/jpmsys5sw.c2
-rw-r--r--src/mame/drivers/jpmsys7.c24
-rw-r--r--src/mame/drivers/jr100.c (renamed from src/mess/drivers/jr100.c)0
-rw-r--r--src/mame/drivers/jr200.c (renamed from src/mess/drivers/jr200.c)18
-rw-r--r--src/mame/drivers/jrpacman.c4
-rw-r--r--src/mame/drivers/jtc.c (renamed from src/mess/drivers/jtc.c)8
-rw-r--r--src/mame/drivers/jubilee.c2
-rw-r--r--src/mame/drivers/juicebox.c (renamed from src/mess/drivers/juicebox.c)0
-rw-r--r--src/mame/drivers/junior.c (renamed from src/mess/drivers/junior.c)2
-rw-r--r--src/mame/drivers/junofrst.c9
-rw-r--r--src/mame/drivers/jupace.c (renamed from src/mess/drivers/ace.c)130
-rw-r--r--src/mame/drivers/jupiter.c (renamed from src/mess/drivers/jupiter.c)4
-rw-r--r--src/mame/drivers/jvh.c4
-rw-r--r--src/mame/drivers/k1003.c (renamed from src/mess/drivers/k1003.c)2
-rw-r--r--src/mame/drivers/k8915.c (renamed from src/mess/drivers/k8915.c)2
-rw-r--r--src/mame/drivers/kaneko16.c184
-rw-r--r--src/mame/drivers/kangaroo.c10
-rw-r--r--src/mame/drivers/karnov.c18
-rw-r--r--src/mame/drivers/kas89.c67
-rw-r--r--src/mame/drivers/kaypro.c (renamed from src/mess/drivers/kaypro.c)14
-rw-r--r--src/mame/drivers/kc.c (renamed from src/mess/drivers/kc.c)8
-rw-r--r--src/mame/drivers/kchamp.c10
-rw-r--r--src/mame/drivers/kenseim.c2
-rw-r--r--src/mame/drivers/kickgoal.c4
-rw-r--r--src/mame/drivers/kim1.c (renamed from src/mess/drivers/kim1.c)2
-rw-r--r--src/mame/drivers/kingdrby.c8
-rw-r--r--src/mame/drivers/kingobox.c10
-rw-r--r--src/mame/drivers/kinst.c22
-rw-r--r--src/mame/drivers/kissproto.c2
-rw-r--r--src/mame/drivers/kncljoe.c6
-rw-r--r--src/mame/drivers/koftball.c2
-rw-r--r--src/mame/drivers/koikoi.c2
-rw-r--r--src/mame/drivers/konamigq.c87
-rw-r--r--src/mame/drivers/konamigv.c32
-rw-r--r--src/mame/drivers/konamigx.c192
-rw-r--r--src/mame/drivers/konamim2.c24
-rw-r--r--src/mame/drivers/konendev.c323
-rw-r--r--src/mame/drivers/konin.c (renamed from src/mess/drivers/konin.c)2
-rw-r--r--src/mame/drivers/kontest.c2
-rw-r--r--src/mame/drivers/kopunch.c2
-rw-r--r--src/mame/drivers/korgm1.c (renamed from src/mess/drivers/korgm1.c)2
-rw-r--r--src/mame/drivers/kramermc.c (renamed from src/mess/drivers/kramermc.c)2
-rw-r--r--src/mame/drivers/ksayakyu.c2
-rw-r--r--src/mame/drivers/ksys573.c230
-rw-r--r--src/mame/drivers/kungfur.c2
-rw-r--r--src/mame/drivers/kurukuru.c43
-rw-r--r--src/mame/drivers/kyocera.c (renamed from src/mess/drivers/kyocera.c)4
-rw-r--r--src/mame/drivers/kyugo.c38
-rw-r--r--src/mame/drivers/labyrunr.c6
-rw-r--r--src/mame/drivers/ladybug.c16
-rw-r--r--src/mame/drivers/ladyfrog.c4
-rw-r--r--src/mame/drivers/laser3k.c (renamed from src/mess/drivers/laser3k.c)4
-rw-r--r--src/mame/drivers/laserbas.c6
-rw-r--r--src/mame/drivers/laserbat.c8
-rw-r--r--src/mame/drivers/lasso.c14
-rw-r--r--src/mame/drivers/lastbank.c2
-rw-r--r--src/mame/drivers/lastduel.c181
-rw-r--r--src/mame/drivers/lastfght.c2
-rw-r--r--src/mame/drivers/lazercmd.c6
-rw-r--r--src/mame/drivers/lbeach.c2
-rw-r--r--src/mame/drivers/lc80.c (renamed from src/mess/drivers/lc80.c)6
-rw-r--r--src/mame/drivers/lcmate2.c (renamed from src/mess/drivers/lcmate2.c)2
-rw-r--r--src/mame/drivers/leapster.c (renamed from src/mess/drivers/leapster.c)4
-rw-r--r--src/mame/drivers/legionna.c48
-rw-r--r--src/mame/drivers/leland.c2
-rw-r--r--src/mame/drivers/lemmings.c2
-rw-r--r--src/mame/drivers/lethal.c14
-rw-r--r--src/mame/drivers/lethalj.c29
-rw-r--r--src/mame/drivers/lft.c (renamed from src/mess/drivers/lft.c)4
-rw-r--r--src/mame/drivers/lg-dvd.c41
-rw-r--r--src/mame/drivers/lgp.c4
-rw-r--r--src/mame/drivers/liberate.c25
-rw-r--r--src/mame/drivers/liberatr.c4
-rw-r--r--src/mame/drivers/limenko.c10
-rw-r--r--src/mame/drivers/lindbergh.c165
-rw-r--r--src/mame/drivers/lisa.c (renamed from src/mess/drivers/lisa.c)10
-rw-r--r--src/mame/drivers/littlerb.c2
-rw-r--r--src/mame/drivers/lkage.c14
-rw-r--r--src/mame/drivers/llc.c (renamed from src/mess/drivers/llc.c)2
-rw-r--r--src/mame/drivers/lockon.c4
-rw-r--r--src/mame/drivers/lola8a.c (renamed from src/mess/drivers/lola8a.c)19
-rw-r--r--src/mame/drivers/looping.c8
-rw-r--r--src/mame/drivers/lordgun.c6
-rw-r--r--src/mame/drivers/lsasquad.c6
-rw-r--r--src/mame/drivers/ltcasino.c6
-rw-r--r--src/mame/drivers/ltd.c14
-rw-r--r--src/mame/drivers/luckgrln.c4
-rw-r--r--src/mame/drivers/lucky74.c4
-rw-r--r--src/mame/drivers/lviv.c (renamed from src/mess/drivers/lviv.c)0
-rw-r--r--src/mame/drivers/lwings.c104
-rw-r--r--src/mame/drivers/lynx.c (renamed from src/mess/drivers/lynx.c)4
-rw-r--r--src/mame/drivers/m10.c14
-rw-r--r--src/mame/drivers/m107.c79
-rw-r--r--src/mame/drivers/m14.c2
-rw-r--r--src/mame/drivers/m20.c (renamed from src/mess/drivers/m20.c)10
-rw-r--r--src/mame/drivers/m24.c (renamed from src/mess/drivers/m24.c)4
-rw-r--r--src/mame/drivers/m5.c (renamed from src/mess/drivers/m5.c)0
-rw-r--r--src/mame/drivers/m52.c20
-rw-r--r--src/mame/drivers/m57.c12
-rw-r--r--src/mame/drivers/m58.c27
-rw-r--r--src/mame/drivers/m62.c92
-rw-r--r--src/mame/drivers/m63.c8
-rw-r--r--src/mame/drivers/m6805evs.c (renamed from src/mess/drivers/m6805evs.c)2
-rw-r--r--src/mame/drivers/m72.c1542
-rw-r--r--src/mame/drivers/m79152pc.c (renamed from src/mess/drivers/m79152pc.c)2
-rw-r--r--src/mame/drivers/m79amb.c2
-rw-r--r--src/mame/drivers/m90.c32
-rw-r--r--src/mame/drivers/m92.c174
-rw-r--r--src/mame/drivers/mac.c (renamed from src/mess/drivers/mac.c)52
-rw-r--r--src/mame/drivers/macpci.c (renamed from src/mess/drivers/macpci.c)2
-rw-r--r--src/mame/drivers/macrossp.c78
-rw-r--r--src/mame/drivers/macs.c10
-rw-r--r--src/mame/drivers/madalien.c6
-rw-r--r--src/mame/drivers/madmotor.c2
-rw-r--r--src/mame/drivers/magic10.c35
-rw-r--r--src/mame/drivers/magicard.c14
-rw-r--r--src/mame/drivers/magicfly.c8
-rw-r--r--src/mame/drivers/magictg.c4
-rw-r--r--src/mame/drivers/magmax.c2
-rw-r--r--src/mame/drivers/magtouch.c2
-rw-r--r--src/mame/drivers/mainevt.c88
-rw-r--r--src/mame/drivers/mainsnk.c4
-rw-r--r--src/mame/drivers/malzak.c4
-rw-r--r--src/mame/drivers/manohman.c2
-rw-r--r--src/mame/drivers/mappy.c36
-rw-r--r--src/mame/drivers/marineb.c20
-rw-r--r--src/mame/drivers/marinedt.c2
-rw-r--r--src/mame/drivers/mario.c14
-rw-r--r--src/mame/drivers/markham.c2
-rw-r--r--src/mame/drivers/mastboy.c42
-rw-r--r--src/mame/drivers/matmania.c8
-rw-r--r--src/mame/drivers/maxaflex.c2
-rw-r--r--src/mame/drivers/maygay1bsw.c2
-rw-r--r--src/mame/drivers/maygayep.c1834
-rw-r--r--src/mame/drivers/maygaysw.c20
-rw-r--r--src/mame/drivers/maygayv1.c2
-rw-r--r--src/mame/drivers/mayumi.c2
-rw-r--r--src/mame/drivers/mazerbla.c10
-rw-r--r--src/mame/drivers/mbc200.c (renamed from src/mess/drivers/mbc200.c)2
-rw-r--r--src/mame/drivers/mbc55x.c (renamed from src/mess/drivers/mbc55x.c)2
-rw-r--r--src/mame/drivers/mbdtower.c (renamed from src/mess/drivers/mbdtower.c)4
-rw-r--r--src/mame/drivers/mbee.c (renamed from src/mess/drivers/mbee.c)16
-rw-r--r--src/mame/drivers/mc10.c (renamed from src/mess/drivers/mc10.c)8
-rw-r--r--src/mame/drivers/mc1000.c (renamed from src/mess/drivers/mc1000.c)14
-rw-r--r--src/mame/drivers/mc1502.c (renamed from src/mess/drivers/mc1502.c)2
-rw-r--r--src/mame/drivers/mc80.c (renamed from src/mess/drivers/mc80.c)4
-rw-r--r--src/mame/drivers/mcatadv.c12
-rw-r--r--src/mame/drivers/mcb216.c (renamed from src/mess/drivers/mcb216.c)4
-rw-r--r--src/mame/drivers/mccpm.c (renamed from src/mess/drivers/mccpm.c)2
-rw-r--r--src/mame/drivers/mcr.c66
-rw-r--r--src/mame/drivers/mcr3.c27
-rw-r--r--src/mame/drivers/mcr68.c36
-rw-r--r--src/mame/drivers/meadows.c6
-rw-r--r--src/mame/drivers/meadwttl.c8
-rw-r--r--src/mame/drivers/mediagx.c6
-rw-r--r--src/mame/drivers/megadriv.c (renamed from src/mess/drivers/megadriv.c)66
-rw-r--r--src/mame/drivers/megadrvb.c2
-rw-r--r--src/mame/drivers/megaphx.c2
-rw-r--r--src/mame/drivers/megaplay.c2
-rw-r--r--src/mame/drivers/megasys1.c132
-rw-r--r--src/mame/drivers/megatech.c138
-rw-r--r--src/mame/drivers/megazone.c10
-rw-r--r--src/mame/drivers/meijinsn.c2
-rw-r--r--src/mame/drivers/mekd2.c (renamed from src/mess/drivers/mekd2.c)0
-rw-r--r--src/mame/drivers/mephisto.c511
-rw-r--r--src/mame/drivers/mephistp.c115
-rw-r--r--src/mame/drivers/merit.c164
-rw-r--r--src/mame/drivers/meritm.c248
-rw-r--r--src/mame/drivers/mermaid.c6
-rw-r--r--src/mame/drivers/mes.c (renamed from src/mess/drivers/mes.c)2
-rw-r--r--src/mame/drivers/metalmx.c2
-rw-r--r--src/mame/drivers/metlclsh.c2
-rw-r--r--src/mame/drivers/metro.c80
-rw-r--r--src/mame/drivers/mexico86.c10
-rw-r--r--src/mame/drivers/meyc8080.c8
-rw-r--r--src/mame/drivers/mgames.c2
-rw-r--r--src/mame/drivers/mgavegas.c6
-rw-r--r--src/mame/drivers/mgolf.c2
-rw-r--r--src/mame/drivers/mhavoc.c12
-rw-r--r--src/mame/drivers/mice.c (renamed from src/mess/drivers/mice.c)2
-rw-r--r--src/mame/drivers/micral.c292
-rw-r--r--src/mame/drivers/micro3d.c13
-rw-r--r--src/mame/drivers/microdec.c (renamed from src/mess/drivers/microdec.c)4
-rw-r--r--src/mame/drivers/microkit.c (renamed from src/mess/drivers/microkit.c)2
-rw-r--r--src/mame/drivers/micronic.c (renamed from src/mess/drivers/micronic.c)2
-rw-r--r--src/mame/drivers/micropin.c4
-rw-r--r--src/mame/drivers/microtan.c (renamed from src/mess/drivers/microtan.c)0
-rw-r--r--src/mame/drivers/microvsn.c (renamed from src/mess/drivers/microvsn.c)2
-rw-r--r--src/mame/drivers/midqslvr.c10
-rw-r--r--src/mame/drivers/midtunit.c55
-rw-r--r--src/mame/drivers/midvunit.c42
-rw-r--r--src/mame/drivers/midwunit.c41
-rw-r--r--src/mame/drivers/midxunit.c72
-rw-r--r--src/mame/drivers/midyunit.c232
-rw-r--r--src/mame/drivers/midzeus.c26
-rw-r--r--src/mame/drivers/mikie.c6
-rw-r--r--src/mame/drivers/mikro80.c (renamed from src/mess/drivers/mikro80.c)0
-rw-r--r--src/mame/drivers/mikromik.c (renamed from src/mess/drivers/mikromik.c)6
-rw-r--r--src/mame/drivers/mikrosha.c (renamed from src/mess/drivers/mikrosha.c)0
-rw-r--r--src/mame/drivers/mil4000.c2
-rw-r--r--src/mame/drivers/mini2440.c (renamed from src/mess/drivers/mini2440.c)0
-rw-r--r--src/mame/drivers/miniboy7.c4
-rw-r--r--src/mame/drivers/minicom.c (renamed from src/mess/drivers/minicom.c)4
-rw-r--r--src/mame/drivers/minivadr.c24
-rw-r--r--src/mame/drivers/mirage.c4
-rw-r--r--src/mame/drivers/mirax.c4
-rw-r--r--src/mame/drivers/missb2.c4
-rw-r--r--src/mame/drivers/missile.c18
-rw-r--r--src/mame/drivers/mitchell.c58
-rw-r--r--src/mame/drivers/mits680b.c (renamed from src/mess/drivers/mits680b.c)2
-rw-r--r--src/mame/drivers/mjkjidai.c2
-rw-r--r--src/mame/drivers/mjsister.c2
-rw-r--r--src/mame/drivers/mk1.c (renamed from src/mess/drivers/mk1.c)2
-rw-r--r--src/mame/drivers/mk14.c (renamed from src/mess/drivers/mk14.c)2
-rw-r--r--src/mame/drivers/mk2.c (renamed from src/mess/drivers/mk2.c)0
-rw-r--r--src/mame/drivers/mk85.c (renamed from src/mess/drivers/mk85.c)6
-rw-r--r--src/mame/drivers/mk90.c (renamed from src/mess/drivers/mk90.c)6
-rw-r--r--src/mame/drivers/mkit09.c (renamed from src/mess/drivers/mkit09.c)47
-rw-r--r--src/mame/drivers/mlanding.c2
-rw-r--r--src/mame/drivers/mmagic.c317
-rw-r--r--src/mame/drivers/mmd1.c (renamed from src/mess/drivers/mmd1.c)4
-rw-r--r--src/mame/drivers/mmm.c2
-rw-r--r--src/mame/drivers/mmodular.c (renamed from src/mess/drivers/mmodular.c)60
-rw-r--r--src/mame/drivers/mod8.c (renamed from src/mess/drivers/mod8.c)2
-rw-r--r--src/mame/drivers/model1.c16
-rw-r--r--src/mame/drivers/model2.c132
-rw-r--r--src/mame/drivers/model3.c119
-rw-r--r--src/mame/drivers/modellot.c (renamed from src/mess/drivers/modellot.c)2
-rw-r--r--src/mame/drivers/mogura.c2
-rw-r--r--src/mame/drivers/mole.c12
-rw-r--r--src/mame/drivers/molecular.c (renamed from src/mess/drivers/molecular.c)2
-rw-r--r--src/mame/drivers/momoko.c2
-rw-r--r--src/mame/drivers/monacogp.c4
-rw-r--r--src/mame/drivers/monty.c (renamed from src/mess/drivers/monty.c)4
-rw-r--r--src/mame/drivers/monzagp.c466
-rw-r--r--src/mame/drivers/moo.c18
-rw-r--r--src/mame/drivers/mosaic.c6
-rw-r--r--src/mame/drivers/mouser.c4
-rw-r--r--src/mame/drivers/mpf1.c (renamed from src/mess/drivers/mpf1.c)2
-rw-r--r--src/mame/drivers/mps1230.c162
-rw-r--r--src/mame/drivers/mpu12wbk.c2
-rw-r--r--src/mame/drivers/mpu2.c4
-rw-r--r--src/mame/drivers/mpu3.c2
-rw-r--r--src/mame/drivers/mpu4.c26
-rw-r--r--src/mame/drivers/mpu4avan.c2
-rw-r--r--src/mame/drivers/mpu4bwb.c2
-rw-r--r--src/mame/drivers/mpu4concept.c2
-rw-r--r--src/mame/drivers/mpu4crystal.c204
-rw-r--r--src/mame/drivers/mpu4dealem.c2
-rw-r--r--src/mame/drivers/mpu4empire.c164
-rw-r--r--src/mame/drivers/mpu4mdm.c90
-rw-r--r--src/mame/drivers/mpu4misc.c28
-rw-r--r--src/mame/drivers/mpu4mod2sw.c4
-rw-r--r--src/mame/drivers/mpu4mod4yam.c6
-rw-r--r--src/mame/drivers/mpu4plasma.c16
-rw-r--r--src/mame/drivers/mpu4sw.c66
-rw-r--r--src/mame/drivers/mpu4union.c66
-rw-r--r--src/mame/drivers/mpu4vid.c4
-rw-r--r--src/mame/drivers/mpu5.c1260
-rw-r--r--src/mame/drivers/mpz80.c (renamed from src/mess/drivers/mpz80.c)2
-rw-r--r--src/mame/drivers/mquake.c2
-rw-r--r--src/mame/drivers/mrdo.c14
-rw-r--r--src/mame/drivers/mrflea.c2
-rw-r--r--src/mame/drivers/mrgame.c10
-rw-r--r--src/mame/drivers/mrjong.c6
-rw-r--r--src/mame/drivers/ms0515.c (renamed from src/mess/drivers/ms0515.c)2
-rw-r--r--src/mame/drivers/ms32.c34
-rw-r--r--src/mame/drivers/ms9540.c (renamed from src/mess/drivers/ms9540.c)2
-rw-r--r--src/mame/drivers/msbc1.c (renamed from src/mess/drivers/msbc1.c)2
-rw-r--r--src/mame/drivers/msisaac.c2
-rw-r--r--src/mame/drivers/mstation.c (renamed from src/mess/drivers/mstation.c)2
-rw-r--r--src/mame/drivers/msx.c (renamed from src/mess/drivers/msx.c)133
-rw-r--r--src/mame/drivers/mt735.c71
-rw-r--r--src/mame/drivers/mtx.c (renamed from src/mess/drivers/mtx.c)0
-rw-r--r--src/mame/drivers/mugsmash.c2
-rw-r--r--src/mame/drivers/multfish.c228
-rw-r--r--src/mame/drivers/multfish_boot.c248
-rw-r--r--src/mame/drivers/multfish_ref.c88
-rw-r--r--src/mame/drivers/multi16.c (renamed from src/mess/drivers/multi16.c)2
-rw-r--r--src/mame/drivers/multi8.c (renamed from src/mess/drivers/multi8.c)14
-rw-r--r--src/mame/drivers/munchmo.c4
-rw-r--r--src/mame/drivers/murogem.c8
-rw-r--r--src/mame/drivers/murogmbl.c2
-rw-r--r--src/mame/drivers/mustache.c2
-rw-r--r--src/mame/drivers/mvme350.c257
-rw-r--r--src/mame/drivers/mw18w.c4
-rw-r--r--src/mame/drivers/mw8080bw.c54
-rw-r--r--src/mame/drivers/mwarr.c3
-rw-r--r--src/mame/drivers/mwsub.c2
-rw-r--r--src/mame/drivers/mx2178.c (renamed from src/mess/drivers/mx2178.c)2
-rw-r--r--src/mame/drivers/myb3k.c (renamed from src/mess/drivers/myb3k.c)2
-rw-r--r--src/mame/drivers/mycom.c (renamed from src/mess/drivers/mycom.c)4
-rw-r--r--src/mame/drivers/mystston.c6
-rw-r--r--src/mame/drivers/mystwarr.c60
-rw-r--r--src/mame/drivers/myvision.c (renamed from src/mess/drivers/myvision.c)0
-rw-r--r--src/mame/drivers/mz2000.c (renamed from src/mess/drivers/mz2000.c)20
-rw-r--r--src/mame/drivers/mz2500.c (renamed from src/mess/drivers/mz2500.c)6
-rw-r--r--src/mame/drivers/mz3500.c (renamed from src/mess/drivers/mz3500.c)16
-rw-r--r--src/mame/drivers/mz6500.c (renamed from src/mess/drivers/mz6500.c)2
-rw-r--r--src/mame/drivers/mz700.c (renamed from src/mess/drivers/mz700.c)4
-rw-r--r--src/mame/drivers/mz80.c (renamed from src/mess/drivers/mz80.c)2
-rw-r--r--src/mame/drivers/mzr8105.c369
-rw-r--r--src/mame/drivers/n64.c (renamed from src/mess/drivers/n64.c)33
-rw-r--r--src/mame/drivers/n8080.c24
-rw-r--r--src/mame/drivers/nakajies.c (renamed from src/mess/drivers/nakajies.c)14
-rw-r--r--src/mame/drivers/namcofl.c10
-rw-r--r--src/mame/drivers/namcona1.c80
-rw-r--r--src/mame/drivers/namconb1.c66
-rw-r--r--src/mame/drivers/namcond1.c30
-rw-r--r--src/mame/drivers/namcops2.c1073
-rw-r--r--src/mame/drivers/namcos1.c87
-rw-r--r--src/mame/drivers/namcos10.c347
-rw-r--r--src/mame/drivers/namcos11.c78
-rw-r--r--src/mame/drivers/namcos12.c458
-rw-r--r--src/mame/drivers/namcos2.c38
-rw-r--r--src/mame/drivers/namcos21.c22
-rw-r--r--src/mame/drivers/namcos22.c60
-rw-r--r--src/mame/drivers/namcos23.c235
-rw-r--r--src/mame/drivers/namcos86.c96
-rw-r--r--src/mame/drivers/nanos.c (renamed from src/mess/drivers/nanos.c)2
-rw-r--r--src/mame/drivers/naomi.c320
-rw-r--r--src/mame/drivers/nascom1.c (renamed from src/mess/drivers/nascom1.c)6
-rw-r--r--src/mame/drivers/naughtyb.c28
-rw-r--r--src/mame/drivers/nbmj8688.c78
-rw-r--r--src/mame/drivers/nbmj8891.c86
-rw-r--r--src/mame/drivers/nbmj8900.c4
-rw-r--r--src/mame/drivers/nbmj8991.c36
-rw-r--r--src/mame/drivers/nbmj9195.c72
-rw-r--r--src/mame/drivers/nc.c (renamed from src/mess/drivers/nc.c)2
-rw-r--r--src/mame/drivers/nemesis.c38
-rw-r--r--src/mame/drivers/neogeo.c10
-rw-r--r--src/mame/drivers/neogeo_noslot.c510
-rw-r--r--src/mame/drivers/neoprint.c65
-rw-r--r--src/mame/drivers/neptunp2.c2
-rw-r--r--src/mame/drivers/nes.c (renamed from src/mess/drivers/nes.c)18
-rw-r--r--src/mame/drivers/newbrain.c (renamed from src/mess/drivers/newbrain.c)8
-rw-r--r--src/mame/drivers/news.c4
-rw-r--r--src/mame/drivers/next.c (renamed from src/mess/drivers/next.c)16
-rw-r--r--src/mame/drivers/nexus3d.c8
-rw-r--r--src/mame/drivers/ng_aes.c (renamed from src/mess/drivers/ng_aes.c)4
-rw-r--r--src/mame/drivers/ngen.c (renamed from src/mess/drivers/ngen.c)110
-rw-r--r--src/mame/drivers/ngp.c (renamed from src/mess/drivers/ngp.c)4
-rw-r--r--src/mame/drivers/nightgal.c14
-rw-r--r--src/mame/drivers/ninjakd2.c24
-rw-r--r--src/mame/drivers/ninjaw.c8
-rw-r--r--src/mame/drivers/nitedrvr.c2
-rw-r--r--src/mame/drivers/niyanpai.c10
-rw-r--r--src/mame/drivers/nmg5.c55
-rw-r--r--src/mame/drivers/nmk16.c110
-rw-r--r--src/mame/drivers/norautp.c67
-rw-r--r--src/mame/drivers/nova2001.c30
-rw-r--r--src/mame/drivers/nsm.c2
-rw-r--r--src/mame/drivers/nsmpoker.c2
-rw-r--r--src/mame/drivers/nss.c26
-rw-r--r--src/mame/drivers/nwk-tr.c12
-rw-r--r--src/mame/drivers/nycaptor.c10
-rw-r--r--src/mame/drivers/nyny.c31
-rw-r--r--src/mame/drivers/ob68k1a.c (renamed from src/mess/drivers/ob68k1a.c)2
-rw-r--r--src/mame/drivers/octopus.c (renamed from src/mess/drivers/octopus.c)2
-rw-r--r--src/mame/drivers/odyssey2.c (renamed from src/mess/drivers/odyssey2.c)6
-rw-r--r--src/mame/drivers/ohmygod.c4
-rw-r--r--src/mame/drivers/ojankohs.c10
-rw-r--r--src/mame/drivers/okean240.c (renamed from src/mess/drivers/okean240.c)6
-rw-r--r--src/mame/drivers/olibochu.c3
-rw-r--r--src/mame/drivers/omegrace.c6
-rw-r--r--src/mame/drivers/ondra.c (renamed from src/mess/drivers/ondra.c)0
-rw-r--r--src/mame/drivers/oneshot.c6
-rw-r--r--src/mame/drivers/onetwo.c4
-rw-r--r--src/mame/drivers/onyx.c (renamed from src/mess/drivers/onyx.c)2
-rw-r--r--src/mame/drivers/opwolf.c10
-rw-r--r--src/mame/drivers/orao.c (renamed from src/mess/drivers/orao.c)46
-rw-r--r--src/mame/drivers/orbit.c2
-rw-r--r--src/mame/drivers/oric.c (renamed from src/mess/drivers/oric.c)25
-rw-r--r--src/mame/drivers/orion.c (renamed from src/mess/drivers/orion.c)0
-rw-r--r--src/mame/drivers/osbexec.c (renamed from src/mess/drivers/osbexec.c)2
-rw-r--r--src/mame/drivers/osborne1.c (renamed from src/mess/drivers/osborne1.c)0
-rw-r--r--src/mame/drivers/osi.c (renamed from src/mess/drivers/osi.c)10
-rw-r--r--src/mame/drivers/othello.c2
-rw-r--r--src/mame/drivers/othunder.c209
-rw-r--r--src/mame/drivers/overdriv.c6
-rw-r--r--src/mame/drivers/p112.c (renamed from src/mess/drivers/p112.c)2
-rw-r--r--src/mame/drivers/p2000t.c (renamed from src/mess/drivers/p2000t.c)0
-rw-r--r--src/mame/drivers/p8k.c (renamed from src/mess/drivers/p8k.c)4
-rw-r--r--src/mame/drivers/pachifev.c2
-rw-r--r--src/mame/drivers/pacland.c10
-rw-r--r--src/mame/drivers/pacman.c243
-rw-r--r--src/mame/drivers/palm.c (renamed from src/mess/drivers/palm.c)34
-rw-r--r--src/mame/drivers/palm_dbg.inc (renamed from src/mess/drivers/palm_dbg.inc)0
-rw-r--r--src/mame/drivers/palmz22.c (renamed from src/mess/drivers/palmz22.c)2
-rw-r--r--src/mame/drivers/pandoras.c2
-rw-r--r--src/mame/drivers/pangofun.c2
-rw-r--r--src/mame/drivers/panicr.c4
-rw-r--r--src/mame/drivers/paradise.c22
-rw-r--r--src/mame/drivers/paranoia.c56
-rw-r--r--src/mame/drivers/parodius.c8
-rw-r--r--src/mame/drivers/partner.c (renamed from src/mess/drivers/partner.c)2
-rw-r--r--src/mame/drivers/pasha2.c2
-rw-r--r--src/mame/drivers/paso1600.c (renamed from src/mess/drivers/paso1600.c)2
-rw-r--r--src/mame/drivers/pasogo.c (renamed from src/mess/drivers/pasogo.c)2
-rw-r--r--src/mame/drivers/pasopia.c (renamed from src/mess/drivers/pasopia.c)2
-rw-r--r--src/mame/drivers/pasopia7.c (renamed from src/mess/drivers/pasopia7.c)16
-rw-r--r--src/mame/drivers/pass.c2
-rw-r--r--src/mame/drivers/pastelg.c6
-rw-r--r--src/mame/drivers/pb1000.c (renamed from src/mess/drivers/pb1000.c)6
-rw-r--r--src/mame/drivers/pbaction.c10
-rw-r--r--src/mame/drivers/pc.c (renamed from src/mess/drivers/pc.c)28
-rw-r--r--src/mame/drivers/pc100.c (renamed from src/mess/drivers/pc100.c)25
-rw-r--r--src/mame/drivers/pc1500.c (renamed from src/mess/drivers/pc1500.c)2
-rw-r--r--src/mame/drivers/pc1512.c (renamed from src/mess/drivers/pc1512.c)16
-rw-r--r--src/mame/drivers/pc2000.c (renamed from src/mess/drivers/pc2000.c)32
-rw-r--r--src/mame/drivers/pc4.c (renamed from src/mess/drivers/pc4.c)2
-rw-r--r--src/mame/drivers/pc6001.c (renamed from src/mess/drivers/pc6001.c)12
-rw-r--r--src/mame/drivers/pc8001.c (renamed from src/mess/drivers/pc8001.c)4
-rw-r--r--src/mame/drivers/pc8401a.c (renamed from src/mess/drivers/pc8401a.c)6
-rw-r--r--src/mame/drivers/pc8801.c (renamed from src/mess/drivers/pc8801.c)36
-rw-r--r--src/mame/drivers/pc88va.c (renamed from src/mess/drivers/pc88va.c)6
-rw-r--r--src/mame/drivers/pc9801.c (renamed from src/mess/drivers/pc9801.c)47
-rw-r--r--src/mame/drivers/pcat_dyn.c4
-rw-r--r--src/mame/drivers/pcat_nit.c12
-rw-r--r--src/mame/drivers/pcd.c (renamed from src/mess/drivers/pcd.c)292
-rw-r--r--src/mame/drivers/pce.c (renamed from src/mess/drivers/pce.c)26
-rw-r--r--src/mame/drivers/pce220.c (renamed from src/mess/drivers/pce220.c)4
-rw-r--r--src/mame/drivers/pcfx.c (renamed from src/mess/drivers/pcfx.c)4
-rw-r--r--src/mame/drivers/pcktgal.c14
-rw-r--r--src/mame/drivers/pcm.c (renamed from src/mess/drivers/pcm.c)0
-rw-r--r--src/mame/drivers/pcw.c (renamed from src/mess/drivers/pcw.c)10
-rw-r--r--src/mame/drivers/pcw16.c (renamed from src/mess/drivers/pcw16.c)2
-rw-r--r--src/mame/drivers/pcxt.c4
-rw-r--r--src/mame/drivers/pda600.c (renamed from src/mess/drivers/pda600.c)2
-rw-r--r--src/mame/drivers/pdp1.c (renamed from src/mess/drivers/pdp1.c)38
-rw-r--r--src/mame/drivers/pdp11.c (renamed from src/mess/drivers/pdp11.c)8
-rw-r--r--src/mame/drivers/pecom.c (renamed from src/mess/drivers/pecom.c)0
-rw-r--r--src/mame/drivers/pegasus.c (renamed from src/mess/drivers/pegasus.c)4
-rw-r--r--src/mame/drivers/pencil2.c (renamed from src/mess/drivers/pencil2.c)0
-rw-r--r--src/mame/drivers/pengadvb.c2
-rw-r--r--src/mame/drivers/pengo.c16
-rw-r--r--src/mame/drivers/pentagon.c (renamed from src/mess/drivers/pentagon.c)0
-rw-r--r--src/mame/drivers/peoplepc.c (renamed from src/mess/drivers/peoplepc.c)2
-rw-r--r--src/mame/drivers/peplus.c483
-rw-r--r--src/mame/drivers/pes.c (renamed from src/mess/drivers/pes.c)2
-rw-r--r--src/mame/drivers/pet.c (renamed from src/mess/drivers/pet.c)95
-rw-r--r--src/mame/drivers/peyper.c20
-rw-r--r--src/mame/drivers/pgm.c421
-rw-r--r--src/mame/drivers/pgm2.c16
-rw-r--r--src/mame/drivers/phc25.c (renamed from src/mess/drivers/phc25.c)4
-rw-r--r--src/mame/drivers/phoenix.c155
-rw-r--r--src/mame/drivers/photon2.c58
-rw-r--r--src/mame/drivers/photoply.c2
-rw-r--r--src/mame/drivers/phunsy.c (renamed from src/mess/drivers/phunsy.c)2
-rw-r--r--src/mame/drivers/piggypas.c244
-rw-r--r--src/mame/drivers/pimps.c (renamed from src/mess/drivers/pimps.c)2
-rw-r--r--src/mame/drivers/pinball2k.c8
-rw-r--r--src/mame/drivers/pingpong.c2
-rw-r--r--src/mame/drivers/pinkiri8.c12
-rw-r--r--src/mame/drivers/pipbug.c (renamed from src/mess/drivers/pipbug.c)2
-rw-r--r--src/mame/drivers/pipedrm.c12
-rw-r--r--src/mame/drivers/pipeline.c2
-rw-r--r--src/mame/drivers/pirates.c4
-rw-r--r--src/mame/drivers/pitagjr.c (renamed from src/mess/drivers/pitagjr.c)2
-rw-r--r--src/mame/drivers/pitnrun.c4
-rw-r--r--src/mame/drivers/pk8000.c (renamed from src/mess/drivers/pk8000.c)2
-rw-r--r--src/mame/drivers/pk8020.c (renamed from src/mess/drivers/pk8020.c)0
-rw-r--r--src/mame/drivers/pkscram.c2
-rw-r--r--src/mame/drivers/pktgaldx.c6
-rw-r--r--src/mame/drivers/plan80.c (renamed from src/mess/drivers/plan80.c)2
-rw-r--r--src/mame/drivers/play_1.c10
-rw-r--r--src/mame/drivers/play_2.c16
-rw-r--r--src/mame/drivers/play_3.c4
-rw-r--r--src/mame/drivers/play_5.c22
-rw-r--r--src/mame/drivers/playch10.c12
-rw-r--r--src/mame/drivers/playmark.c22
-rw-r--r--src/mame/drivers/plus4.c (renamed from src/mess/drivers/plus4.c)18
-rw-r--r--src/mame/drivers/pluto5.c228
-rw-r--r--src/mame/drivers/plygonet.c21
-rw-r--r--src/mame/drivers/pm68k.c (renamed from src/mess/drivers/pm68k.c)2
-rw-r--r--src/mame/drivers/pmd85.c (renamed from src/mess/drivers/pmd85.c)35
-rw-r--r--src/mame/drivers/pmi80.c (renamed from src/mess/drivers/pmi80.c)2
-rw-r--r--src/mame/drivers/pntnpuzl.c2
-rw-r--r--src/mame/drivers/pocketc.c (renamed from src/mess/drivers/pocketc.c)28
-rw-r--r--src/mame/drivers/pockstat.c (renamed from src/mess/drivers/pockstat.c)6
-rw-r--r--src/mame/drivers/poisk1.c (renamed from src/mess/drivers/poisk1.c)0
-rw-r--r--src/mame/drivers/pokemini.c (renamed from src/mess/drivers/pokemini.c)2
-rw-r--r--src/mame/drivers/poker72.c2
-rw-r--r--src/mame/drivers/polepos.c2
-rw-r--r--src/mame/drivers/poly.c (renamed from src/mess/drivers/poly.c)2
-rw-r--r--src/mame/drivers/poly88.c (renamed from src/mess/drivers/poly88.c)2
-rw-r--r--src/mame/drivers/poly880.c (renamed from src/mess/drivers/poly880.c)2
-rw-r--r--src/mame/drivers/pong.c8
-rw-r--r--src/mame/drivers/poolshrk.c4
-rw-r--r--src/mame/drivers/pooyan.c6
-rw-r--r--src/mame/drivers/popeye.c10
-rw-r--r--src/mame/drivers/popobear.c2
-rw-r--r--src/mame/drivers/popper.c2
-rw-r--r--src/mame/drivers/portfoli.c (renamed from src/mess/drivers/portfoli.c)2
-rw-r--r--src/mame/drivers/portrait.c4
-rw-r--r--src/mame/drivers/potgoldu.c2
-rw-r--r--src/mame/drivers/powerbal.c6
-rw-r--r--src/mame/drivers/powerins.c8
-rw-r--r--src/mame/drivers/pp01.c (renamed from src/mess/drivers/pp01.c)2
-rw-r--r--src/mame/drivers/ppmast93.c2
-rw-r--r--src/mame/drivers/prehisle.c16
-rw-r--r--src/mame/drivers/prestige.c (renamed from src/mess/drivers/prestige.c)40
-rw-r--r--src/mame/drivers/primo.c (renamed from src/mess/drivers/primo.c)2
-rw-r--r--src/mame/drivers/pro80.c (renamed from src/mess/drivers/pro80.c)2
-rw-r--r--src/mame/drivers/proconn.c274
-rw-r--r--src/mame/drivers/prof180x.c (renamed from src/mess/drivers/prof180x.c)4
-rw-r--r--src/mame/drivers/prof80.c (renamed from src/mess/drivers/prof80.c)2
-rw-r--r--src/mame/drivers/progolf.c4
-rw-r--r--src/mame/drivers/proteus3.c408
-rw-r--r--src/mame/drivers/psattack.c2
-rw-r--r--src/mame/drivers/pse.c6
-rw-r--r--src/mame/drivers/psikyo.c30
-rw-r--r--src/mame/drivers/psikyo4.c16
-rw-r--r--src/mame/drivers/psikyosh.c40
-rw-r--r--src/mame/drivers/psion.c (renamed from src/mess/drivers/psion.c)22
-rw-r--r--src/mame/drivers/psx.c (renamed from src/mess/drivers/psx.c)9
-rw-r--r--src/mame/drivers/psychic5.c6
-rw-r--r--src/mame/drivers/pt68k4.c (renamed from src/mess/drivers/pt68k4.c)4
-rw-r--r--src/mame/drivers/ptcsol.c (renamed from src/mess/drivers/ptcsol.c)0
-rw-r--r--src/mame/drivers/pturn.c2
-rw-r--r--src/mame/drivers/puckpkmn.c2
-rw-r--r--src/mame/drivers/pulsar.c (renamed from src/mess/drivers/pulsar.c)2
-rw-r--r--src/mame/drivers/pv1000.c (renamed from src/mess/drivers/pv1000.c)13
-rw-r--r--src/mame/drivers/pv2000.c (renamed from src/mess/drivers/pv2000.c)2
-rw-r--r--src/mame/drivers/pv9234.c (renamed from src/mess/drivers/pv9234.c)2
-rw-r--r--src/mame/drivers/pve500.c (renamed from src/mess/drivers/pve500.c)2
-rw-r--r--src/mame/drivers/px4.c (renamed from src/mess/drivers/px4.c)0
-rw-r--r--src/mame/drivers/px8.c (renamed from src/mess/drivers/px8.c)2
-rw-r--r--src/mame/drivers/pyl601.c (renamed from src/mess/drivers/pyl601.c)0
-rw-r--r--src/mame/drivers/pyson.c6
-rw-r--r--src/mame/drivers/pzletime.c3
-rw-r--r--src/mame/drivers/qix.c198
-rw-r--r--src/mame/drivers/ql.c (renamed from src/mess/drivers/ql.c)22
-rw-r--r--src/mame/drivers/qtsbc.c (renamed from src/mess/drivers/qtsbc.c)2
-rw-r--r--src/mame/drivers/quakeat.c2
-rw-r--r--src/mame/drivers/quantum.c24
-rw-r--r--src/mame/drivers/quasar.c4
-rw-r--r--src/mame/drivers/queen.c2
-rw-r--r--src/mame/drivers/quizdna.c6
-rw-r--r--src/mame/drivers/quizo.c4
-rw-r--r--src/mame/drivers/quizpani.c2
-rw-r--r--src/mame/drivers/quizpun2.c4
-rw-r--r--src/mame/drivers/quizshow.c2
-rw-r--r--src/mame/drivers/qx10.c (renamed from src/mess/drivers/qx10.c)2
-rw-r--r--src/mame/drivers/r2dtank.c26
-rw-r--r--src/mame/drivers/r2dx_v33.c8
-rw-r--r--src/mame/drivers/rabbit.c2
-rw-r--r--src/mame/drivers/radio86.c (renamed from src/mess/drivers/radio86.c)0
-rw-r--r--src/mame/drivers/raiden.c14
-rw-r--r--src/mame/drivers/raiden2.c72
-rw-r--r--src/mame/drivers/rainbow.c3248
-rw-r--r--src/mame/drivers/rallyx.c34
-rw-r--r--src/mame/drivers/rambo.c227
-rw-r--r--src/mame/drivers/rampart.c6
-rw-r--r--src/mame/drivers/ramtek.c89
-rw-r--r--src/mame/drivers/rastan.c14
-rw-r--r--src/mame/drivers/rastersp.c2
-rw-r--r--src/mame/drivers/ravens.c (renamed from src/mess/drivers/ravens.c)4
-rw-r--r--src/mame/drivers/rbisland.c977
-rw-r--r--src/mame/drivers/rbmk.c2
-rw-r--r--src/mame/drivers/rc759.c (renamed from src/mess/drivers/rc759.c)20
-rw-r--r--src/mame/drivers/rcorsair.c2
-rw-r--r--src/mame/drivers/rd100.c115
-rw-r--r--src/mame/drivers/rd110.c (renamed from src/mess/drivers/rd110.c)2
-rw-r--r--src/mame/drivers/re900.c4
-rw-r--r--src/mame/drivers/realbrk.c14
-rw-r--r--src/mame/drivers/redalert.c8
-rw-r--r--src/mame/drivers/redclash.c12
-rw-r--r--src/mame/drivers/renegade.c6
-rw-r--r--src/mame/drivers/replicator.c727
-rw-r--r--src/mame/drivers/retofinv.c6
-rw-r--r--src/mame/drivers/rex6000.c (renamed from src/mess/drivers/rex6000.c)4
-rw-r--r--src/mame/drivers/rgum.c2
-rw-r--r--src/mame/drivers/riscpc.c (renamed from src/mess/drivers/riscpc.c)14
-rw-r--r--src/mame/drivers/rltennis.c2
-rw-r--r--src/mame/drivers/rm380z.c (renamed from src/mess/drivers/rm380z.c)2
-rw-r--r--src/mame/drivers/rmhaihai.c10
-rw-r--r--src/mame/drivers/rmnimbus.c (renamed from src/mess/drivers/rmnimbus.c)0
-rw-r--r--src/mame/drivers/rmt32.c (renamed from src/mess/drivers/rmt32.c)4
-rw-r--r--src/mame/drivers/rockrage.c8
-rw-r--r--src/mame/drivers/rocnrope.c17
-rw-r--r--src/mame/drivers/rohga.c32
-rw-r--r--src/mame/drivers/rollerg.c4
-rw-r--r--src/mame/drivers/rollext.c366
-rw-r--r--src/mame/drivers/rollrace.c6
-rw-r--r--src/mame/drivers/rotaryf.c2
-rw-r--r--src/mame/drivers/roul.c2
-rw-r--r--src/mame/drivers/route16.c80
-rw-r--r--src/mame/drivers/rowamet.c2
-rw-r--r--src/mame/drivers/royalmah.c26
-rw-r--r--src/mame/drivers/rpunch.c12
-rw-r--r--src/mame/drivers/rsc55.c (renamed from src/mess/drivers/rsc55.c)2
-rw-r--r--src/mame/drivers/rt1715.c (renamed from src/mess/drivers/rt1715.c)6
-rw-r--r--src/mame/drivers/runaway.c4
-rw-r--r--src/mame/drivers/rungun.c12
-rw-r--r--src/mame/drivers/rvoice.c (renamed from src/mess/drivers/rvoice.c)2
-rw-r--r--src/mame/drivers/rx78.c (renamed from src/mess/drivers/rx78.c)0
-rw-r--r--src/mame/drivers/s11.c26
-rw-r--r--src/mame/drivers/s11a.c20
-rw-r--r--src/mame/drivers/s11b.c94
-rw-r--r--src/mame/drivers/s11c.c50
-rw-r--r--src/mame/drivers/s3.c14
-rw-r--r--src/mame/drivers/s4.c34
-rw-r--r--src/mame/drivers/s6.c24
-rw-r--r--src/mame/drivers/s6a.c8
-rw-r--r--src/mame/drivers/s7.c46
-rw-r--r--src/mame/drivers/s8.c4
-rw-r--r--src/mame/drivers/s8a.c2
-rw-r--r--src/mame/drivers/s9.c18
-rw-r--r--src/mame/drivers/sacstate.c (renamed from src/mess/drivers/sacstate.c)2
-rw-r--r--src/mame/drivers/safarir.c4
-rw-r--r--src/mame/drivers/sage2.c (renamed from src/mess/drivers/sage2.c)2
-rw-r--r--src/mame/drivers/sam.c396
-rw-r--r--src/mame/drivers/samcoupe.c (renamed from src/mess/drivers/samcoupe.c)67
-rw-r--r--src/mame/drivers/sandscrp.c6
-rw-r--r--src/mame/drivers/sangho.c141
-rw-r--r--src/mame/drivers/sapi1.c (renamed from src/mess/drivers/sapi1.c)10
-rw-r--r--src/mame/drivers/saturn.c (renamed from src/mess/drivers/saturn.c)10
-rw-r--r--src/mame/drivers/sauro.c10
-rw-r--r--src/mame/drivers/savia84.c (renamed from src/mess/drivers/savia84.c)2
-rw-r--r--src/mame/drivers/savquest.c2
-rw-r--r--src/mame/drivers/sbasketb.c8
-rw-r--r--src/mame/drivers/sbc6510.c (renamed from src/mess/drivers/sbc6510.c)2
-rw-r--r--src/mame/drivers/sbowling.c4
-rw-r--r--src/mame/drivers/sbrain.c (renamed from src/mess/drivers/sbrain.c)2
-rw-r--r--src/mame/drivers/sbrkout.c8
-rw-r--r--src/mame/drivers/sbugger.c4
-rw-r--r--src/mame/drivers/sc1.c (renamed from src/mess/drivers/sc1.c)2
-rw-r--r--src/mame/drivers/sc2.c (renamed from src/mess/drivers/sc2.c)2
-rw-r--r--src/mame/drivers/scobra.c368
-rw-r--r--src/mame/drivers/scorpion.c (renamed from src/mess/drivers/scorpion.c)8
-rw-r--r--src/mame/drivers/scotrsht.c2
-rw-r--r--src/mame/drivers/scramble.c118
-rw-r--r--src/mame/drivers/scregg.c8
-rw-r--r--src/mame/drivers/scv.c (renamed from src/mess/drivers/scv.c)4
-rw-r--r--src/mame/drivers/sderby.c4
-rw-r--r--src/mame/drivers/sdk80.c (renamed from src/mess/drivers/sdk80.c)75
-rw-r--r--src/mame/drivers/sdk85.c (renamed from src/mess/drivers/sdk85.c)2
-rw-r--r--src/mame/drivers/sdk86.c (renamed from src/mess/drivers/sdk86.c)2
-rw-r--r--src/mame/drivers/seabattl.c4
-rw-r--r--src/mame/drivers/sealy.c2
-rw-r--r--src/mame/drivers/seattle.c123
-rw-r--r--src/mame/drivers/seattlecmp.c (renamed from src/mess/drivers/seattle.c)2
-rw-r--r--src/mame/drivers/segac2.c70
-rw-r--r--src/mame/drivers/segacoin.c2
-rw-r--r--src/mame/drivers/segae.c14
-rw-r--r--src/mame/drivers/segag80r.c24
-rw-r--r--src/mame/drivers/segag80v.c22
-rw-r--r--src/mame/drivers/segahang.c166
-rw-r--r--src/mame/drivers/segajw.c2
-rw-r--r--src/mame/drivers/segald.c12
-rw-r--r--src/mame/drivers/segam1.c2
-rw-r--r--src/mame/drivers/segaorun.c359
-rw-r--r--src/mame/drivers/segapico.c (renamed from src/mess/drivers/segapico.c)126
-rw-r--r--src/mame/drivers/segapm.c80
-rw-r--r--src/mame/drivers/segas16a.c231
-rw-r--r--src/mame/drivers/segas16b.c1587
-rw-r--r--src/mame/drivers/segas18.c727
-rw-r--r--src/mame/drivers/segas24.c19
-rw-r--r--src/mame/drivers/segas32.c141
-rw-r--r--src/mame/drivers/segasp.c4
-rw-r--r--src/mame/drivers/segaufo.c14
-rw-r--r--src/mame/drivers/segaxbd.c2290
-rw-r--r--src/mame/drivers/segaybd.c46
-rw-r--r--src/mame/drivers/seibuspi.c108
-rw-r--r--src/mame/drivers/seicross.c12
-rw-r--r--src/mame/drivers/selz80.c (renamed from src/mess/drivers/selz80.c)4
-rw-r--r--src/mame/drivers/sengokmj.c2
-rw-r--r--src/mame/drivers/senjyo.c40
-rw-r--r--src/mame/drivers/seta.c84
-rw-r--r--src/mame/drivers/seta2.c55
-rw-r--r--src/mame/drivers/sf.c10
-rw-r--r--src/mame/drivers/sfbonus.c16
-rw-r--r--src/mame/drivers/sfcbox.c10
-rw-r--r--src/mame/drivers/sfkick.c149
-rw-r--r--src/mame/drivers/sg1000.c (renamed from src/mess/drivers/sg1000.c)14
-rw-r--r--src/mame/drivers/sgi_ip2.c (renamed from src/mess/drivers/sgi_ip2.c)4
-rw-r--r--src/mame/drivers/sgi_ip6.c (renamed from src/mess/drivers/sgi_ip6.c)4
-rw-r--r--src/mame/drivers/sh4robot.c (renamed from src/mess/drivers/sh4robot.c)2
-rw-r--r--src/mame/drivers/shadfrce.c66
-rw-r--r--src/mame/drivers/shangha3.c10
-rw-r--r--src/mame/drivers/shanghai.c10
-rw-r--r--src/mame/drivers/shangkid.c14
-rw-r--r--src/mame/drivers/shaolins.c6
-rw-r--r--src/mame/drivers/shisen.c8
-rw-r--r--src/mame/drivers/shootout.c6
-rw-r--r--src/mame/drivers/shougi.c4
-rw-r--r--src/mame/drivers/shtzone.c2
-rw-r--r--src/mame/drivers/shuuz.c4
-rw-r--r--src/mame/drivers/sidearms.c32
-rw-r--r--src/mame/drivers/sidepckt.c6
-rw-r--r--src/mame/drivers/sigmab52.c8
-rw-r--r--src/mame/drivers/sigmab98.c4
-rw-r--r--src/mame/drivers/silkroad.c4
-rw-r--r--src/mame/drivers/silvmil.c97
-rw-r--r--src/mame/drivers/simpl156.c42
-rw-r--r--src/mame/drivers/simple_st0016.c8
-rw-r--r--src/mame/drivers/simpsons.c21
-rw-r--r--src/mame/drivers/sitcom.c (renamed from src/mess/drivers/sitcom.c)2
-rw-r--r--src/mame/drivers/skeetsht.c4
-rw-r--r--src/mame/drivers/skimaxx.c2
-rw-r--r--src/mame/drivers/skyarmy.c6
-rw-r--r--src/mame/drivers/skydiver.c2
-rw-r--r--src/mame/drivers/skyfox.c6
-rw-r--r--src/mame/drivers/skykid.c10
-rw-r--r--src/mame/drivers/skylncr.c2
-rw-r--r--src/mame/drivers/skyraid.c2
-rw-r--r--src/mame/drivers/slapfght.c40
-rw-r--r--src/mame/drivers/slapshot.c6
-rw-r--r--src/mame/drivers/slc1.c (renamed from src/mess/drivers/slc1.c)0
-rw-r--r--src/mame/drivers/sleic.c2
-rw-r--r--src/mame/drivers/slicer.c (renamed from src/mess/drivers/slicer.c)2
-rw-r--r--src/mame/drivers/sliver.c28
-rw-r--r--src/mame/drivers/slotcarn.c4
-rw-r--r--src/mame/drivers/sm1800.c (renamed from src/mess/drivers/sm1800.c)2
-rw-r--r--src/mame/drivers/smc777.c (renamed from src/mess/drivers/smc777.c)40
-rw-r--r--src/mame/drivers/sms.c (renamed from src/mess/drivers/sms.c)35
-rw-r--r--src/mame/drivers/smsmcorp.c22
-rw-r--r--src/mame/drivers/snes.c (renamed from src/mess/drivers/snes.c)4
-rw-r--r--src/mame/drivers/snesb.c12
-rw-r--r--src/mame/drivers/snk6502.c36
-rw-r--r--src/mame/drivers/snk68.c26
-rw-r--r--src/mame/drivers/snowbros.c56
-rw-r--r--src/mame/drivers/socrates.c (renamed from src/mess/drivers/socrates.c)10
-rw-r--r--src/mame/drivers/softbox.c (renamed from src/mess/drivers/softbox.c)8
-rw-r--r--src/mame/drivers/solomon.c4
-rw-r--r--src/mame/drivers/sonson.c4
-rw-r--r--src/mame/drivers/sorcerer.c (renamed from src/mess/drivers/sorcerer.c)32
-rw-r--r--src/mame/drivers/sothello.c28
-rw-r--r--src/mame/drivers/spacefb.c18
-rw-r--r--src/mame/drivers/spaceg.c2
-rw-r--r--src/mame/drivers/spbactn.c6
-rw-r--r--src/mame/drivers/spc1000.c (renamed from src/mess/drivers/spc1000.c)2
-rw-r--r--src/mame/drivers/spcforce.c42
-rw-r--r--src/mame/drivers/spdodgeb.c6
-rw-r--r--src/mame/drivers/spec128.c (renamed from src/mess/drivers/spec128.c)2
-rw-r--r--src/mame/drivers/special.c (renamed from src/mess/drivers/special.c)4
-rw-r--r--src/mame/drivers/specpls3.c (renamed from src/mess/drivers/specpls3.c)8
-rw-r--r--src/mame/drivers/spectra.c2
-rw-r--r--src/mame/drivers/spectrum.c (renamed from src/mess/drivers/spectrum.c)14
-rw-r--r--src/mame/drivers/speedatk.c2
-rw-r--r--src/mame/drivers/speedbal.c4
-rw-r--r--src/mame/drivers/speedspn.c2
-rw-r--r--src/mame/drivers/speglsht.c2
-rw-r--r--src/mame/drivers/spiders.c23
-rw-r--r--src/mame/drivers/spinb.c10
-rw-r--r--src/mame/drivers/splash.c18
-rw-r--r--src/mame/drivers/splus.c30
-rw-r--r--src/mame/drivers/spoker.c6
-rw-r--r--src/mame/drivers/spool99.c10
-rw-r--r--src/mame/drivers/sprcros2.c4
-rw-r--r--src/mame/drivers/sprint2.c20
-rw-r--r--src/mame/drivers/spy.c5
-rw-r--r--src/mame/drivers/squale.c99
-rw-r--r--src/mame/drivers/srmp2.c16
-rw-r--r--src/mame/drivers/srmp5.c2
-rw-r--r--src/mame/drivers/srmp6.c2
-rw-r--r--src/mame/drivers/srumbler.c8
-rw-r--r--src/mame/drivers/ssem.c (renamed from src/mess/drivers/ssem.c)15
-rw-r--r--src/mame/drivers/ssfindo.c6
-rw-r--r--src/mame/drivers/sshot.c4
-rw-r--r--src/mame/drivers/ssingles.c4
-rw-r--r--src/mame/drivers/sslam.c6
-rw-r--r--src/mame/drivers/ssozumo.c2
-rw-r--r--src/mame/drivers/sspeedr.c2
-rw-r--r--src/mame/drivers/ssrj.c2
-rw-r--r--src/mame/drivers/sstrangr.c38
-rw-r--r--src/mame/drivers/ssv.c62
-rw-r--r--src/mame/drivers/ssystem3.c (renamed from src/mess/drivers/ssystem3.c)90
-rw-r--r--src/mame/drivers/st_mp100.c24
-rw-r--r--src/mame/drivers/st_mp200.c44
-rw-r--r--src/mame/drivers/stactics.c2
-rw-r--r--src/mame/drivers/stadhero.c2
-rw-r--r--src/mame/drivers/starcrus.c2
-rw-r--r--src/mame/drivers/starfire.c8
-rw-r--r--src/mame/drivers/starshp1.c4
-rw-r--r--src/mame/drivers/starwars.c2
-rw-r--r--src/mame/drivers/statriv2.c36
-rw-r--r--src/mame/drivers/stellafr.c4
-rw-r--r--src/mame/drivers/stfight.c16
-rw-r--r--src/mame/drivers/stlforce.c6
-rw-r--r--src/mame/drivers/stratos.c (renamed from src/mess/drivers/stratos.c)2
-rw-r--r--src/mame/drivers/strnskil.c8
-rw-r--r--src/mame/drivers/studio2.c (renamed from src/mess/drivers/studio2.c)16
-rw-r--r--src/mame/drivers/stuntair.c2
-rw-r--r--src/mame/drivers/stv.c140
-rw-r--r--src/mame/drivers/su2000.c2
-rw-r--r--src/mame/drivers/sub.c2
-rw-r--r--src/mame/drivers/subs.c2
-rw-r--r--src/mame/drivers/subsino.c2
-rw-r--r--src/mame/drivers/subsino2.c2
-rw-r--r--src/mame/drivers/summit.c2
-rw-r--r--src/mame/drivers/sumt8035.c4
-rw-r--r--src/mame/drivers/sun1.c (renamed from src/mess/drivers/sun1.c)2
-rw-r--r--src/mame/drivers/sun2.c (renamed from src/mess/drivers/sun2.c)4
-rw-r--r--src/mame/drivers/sun3.c (renamed from src/mess/drivers/sun3.c)18
-rw-r--r--src/mame/drivers/sun4.c (renamed from src/mess/drivers/sun4.c)16
-rw-r--r--src/mame/drivers/suna16.c24
-rw-r--r--src/mame/drivers/suna8.c97
-rw-r--r--src/mame/drivers/supbtime.c8
-rw-r--r--src/mame/drivers/supdrapo.c6
-rw-r--r--src/mame/drivers/supduck.c2
-rw-r--r--src/mame/drivers/super6.c (renamed from src/mess/drivers/super6.c)2
-rw-r--r--src/mame/drivers/super80.c (renamed from src/mess/drivers/super80.c)10
-rw-r--r--src/mame/drivers/supercon.c (renamed from src/mess/drivers/supercon.c)8
-rw-r--r--src/mame/drivers/supercrd.c4
-rw-r--r--src/mame/drivers/superdq.c6
-rw-r--r--src/mame/drivers/superqix.c26
-rw-r--r--src/mame/drivers/superslave.c (renamed from src/mess/drivers/superslave.c)2
-rw-r--r--src/mame/drivers/superwng.c2
-rw-r--r--src/mame/drivers/supracan.c (renamed from src/mess/drivers/supracan.c)7
-rw-r--r--src/mame/drivers/suprgolf.c4
-rw-r--r--src/mame/drivers/suprloco.c4
-rw-r--r--src/mame/drivers/suprnova.c60
-rw-r--r--src/mame/drivers/suprridr.c2
-rw-r--r--src/mame/drivers/suprslam.c2
-rw-r--r--src/mame/drivers/surpratk.c6
-rw-r--r--src/mame/drivers/sv8000.c (renamed from src/mess/drivers/sv8000.c)0
-rw-r--r--src/mame/drivers/svi318.c (renamed from src/mess/drivers/svi318.c)12
-rw-r--r--src/mame/drivers/svision.c (renamed from src/mess/drivers/svision.c)0
-rw-r--r--src/mame/drivers/svmu.c (renamed from src/mess/drivers/svmu.c)2
-rw-r--r--src/mame/drivers/swtpc.c (renamed from src/mess/drivers/swtpc.c)2
-rw-r--r--src/mame/drivers/swtpc09.c (renamed from src/mess/drivers/swtpc09.c)8
-rw-r--r--src/mame/drivers/sym1.c (renamed from src/mess/drivers/sym1.c)0
-rw-r--r--src/mame/drivers/sys2900.c (renamed from src/mess/drivers/sys2900.c)2
-rw-r--r--src/mame/drivers/systec.c (renamed from src/mess/drivers/systec.c)2
-rw-r--r--src/mame/drivers/system1.c204
-rw-r--r--src/mame/drivers/system16.c188
-rw-r--r--src/mame/drivers/tagteam.c4
-rw-r--r--src/mame/drivers/tail2nos.c6
-rw-r--r--src/mame/drivers/taito.c74
-rw-r--r--src/mame/drivers/taito_b.c72
-rw-r--r--src/mame/drivers/taito_f2.c122
-rw-r--r--src/mame/drivers/taito_f3.c112
-rw-r--r--src/mame/drivers/taito_h.c14
-rw-r--r--src/mame/drivers/taito_l.c10
-rw-r--r--src/mame/drivers/taito_o.c2
-rw-r--r--src/mame/drivers/taito_x.c2
-rw-r--r--src/mame/drivers/taito_z.c86
-rw-r--r--src/mame/drivers/taitoair.c45
-rw-r--r--src/mame/drivers/taitogn.c48
-rw-r--r--src/mame/drivers/taitojc.c26
-rw-r--r--src/mame/drivers/taitopjc.c2
-rw-r--r--src/mame/drivers/taitosj.c48
-rw-r--r--src/mame/drivers/taitottl.c26
-rw-r--r--src/mame/drivers/taitotx.c30
-rw-r--r--src/mame/drivers/taitotz.c16
-rw-r--r--src/mame/drivers/taitowlf.c2
-rw-r--r--src/mame/drivers/tamag1.c (renamed from src/mess/drivers/tamag1.c)2
-rw-r--r--src/mame/drivers/tandy1t.c (renamed from src/mess/drivers/tandy1t.c)0
-rw-r--r--src/mame/drivers/tandy2k.c (renamed from src/mess/drivers/tandy2k.c)11
-rw-r--r--src/mame/drivers/tank8.c54
-rw-r--r--src/mame/drivers/tankbatt.c4
-rw-r--r--src/mame/drivers/tankbust.c2
-rw-r--r--src/mame/drivers/taotaido.c6
-rw-r--r--src/mame/drivers/tapatune.c43
-rw-r--r--src/mame/drivers/targeth.c4
-rw-r--r--src/mame/drivers/tasman.c15
-rw-r--r--src/mame/drivers/tatsumi.c12
-rw-r--r--src/mame/drivers/tattack.c2
-rw-r--r--src/mame/drivers/tavernie.c (renamed from src/mess/drivers/tavernie.c)5
-rw-r--r--src/mame/drivers/taxidriv.c2
-rw-r--r--src/mame/drivers/tb303.c (renamed from src/mess/drivers/tb303.c)73
-rw-r--r--src/mame/drivers/tbowl.c6
-rw-r--r--src/mame/drivers/tcl.c2
-rw-r--r--src/mame/drivers/tdv2324.c (renamed from src/mess/drivers/tdv2324.c)2
-rw-r--r--src/mame/drivers/tec1.c (renamed from src/mess/drivers/tec1.c)0
-rw-r--r--src/mame/drivers/techno.c2
-rw-r--r--src/mame/drivers/tecmo.c16
-rw-r--r--src/mame/drivers/tecmo16.c8
-rw-r--r--src/mame/drivers/tecmosys.c6
-rw-r--r--src/mame/drivers/tecnbras.c (renamed from src/mess/drivers/tecnbras.c)2
-rw-r--r--src/mame/drivers/tehkanwc.c10
-rw-r--r--src/mame/drivers/tek405x.c (renamed from src/mess/drivers/tek405x.c)6
-rw-r--r--src/mame/drivers/tek410x.c (renamed from src/mess/drivers/tek410x.c)4
-rw-r--r--src/mame/drivers/tempest.c12
-rw-r--r--src/mame/drivers/terak.c (renamed from src/mess/drivers/terak.c)2
-rw-r--r--src/mame/drivers/terracre.c18
-rw-r--r--src/mame/drivers/test_t400.c (renamed from src/mess/drivers/test_t400.c)4
-rw-r--r--src/mame/drivers/tetrisp2.c26
-rw-r--r--src/mame/drivers/tgtpanic.c2
-rw-r--r--src/mame/drivers/thayers.c4
-rw-r--r--src/mame/drivers/thedealr.c84
-rw-r--r--src/mame/drivers/thedeep.c4
-rw-r--r--src/mame/drivers/thepit.c42
-rw-r--r--src/mame/drivers/thomson.c (renamed from src/mess/drivers/thomson.c)143
-rw-r--r--src/mame/drivers/thoop2.c2
-rw-r--r--src/mame/drivers/thunderx.c19
-rw-r--r--src/mame/drivers/ti630.c (renamed from src/mess/drivers/ti630.c)2
-rw-r--r--src/mame/drivers/ti74.c (renamed from src/mess/drivers/ti74.c)4
-rw-r--r--src/mame/drivers/ti85.c (renamed from src/mess/drivers/ti85.c)22
-rw-r--r--src/mame/drivers/ti89.c (renamed from src/mess/drivers/ti89.c)10
-rw-r--r--src/mame/drivers/ti990_10.c (renamed from src/mess/drivers/ti990_10.c)6
-rw-r--r--src/mame/drivers/ti990_4.c (renamed from src/mess/drivers/ti990_4.c)6
-rw-r--r--src/mame/drivers/ti99_2.c (renamed from src/mess/drivers/ti99_2.c)4
-rw-r--r--src/mame/drivers/ti99_4p.c (renamed from src/mess/drivers/ti99_4p.c)12
-rw-r--r--src/mame/drivers/ti99_4x.c (renamed from src/mess/drivers/ti99_4x.c)18
-rw-r--r--src/mame/drivers/ti99_8.c (renamed from src/mess/drivers/ti99_8.c)13
-rw-r--r--src/mame/drivers/tiamc1.c8
-rw-r--r--src/mame/drivers/ticalc1x.c (renamed from src/mess/drivers/ticalc1x.c)164
-rw-r--r--src/mame/drivers/tigeroad.c14
-rw-r--r--src/mame/drivers/tiki100.c (renamed from src/mess/drivers/tiki100.c)280
-rw-r--r--src/mame/drivers/tim011.c (renamed from src/mess/drivers/tim011.c)2
-rw-r--r--src/mame/drivers/tim100.c (renamed from src/mess/drivers/tim100.c)2
-rw-r--r--src/mame/drivers/timelimt.c4
-rw-r--r--src/mame/drivers/timeplt.c14
-rw-r--r--src/mame/drivers/timetrv.c2
-rw-r--r--src/mame/drivers/timex.c (renamed from src/mess/drivers/timex.c)0
-rw-r--r--src/mame/drivers/tispeak.c (renamed from src/mess/drivers/tispeak.c)784
-rw-r--r--src/mame/drivers/tk2000.c (renamed from src/mess/drivers/tk2000.c)2
-rw-r--r--src/mame/drivers/tk80.c (renamed from src/mess/drivers/tk80.c)10
-rw-r--r--src/mame/drivers/tk80bs.c (renamed from src/mess/drivers/tk80bs.c)2
-rw-r--r--src/mame/drivers/tm990189.c (renamed from src/mess/drivers/tm990189.c)0
-rw-r--r--src/mame/drivers/tmaster.c2
-rw-r--r--src/mame/drivers/tmc1800.c (renamed from src/mess/drivers/tmc1800.c)8
-rw-r--r--src/mame/drivers/tmc2000e.c (renamed from src/mess/drivers/tmc2000e.c)2
-rw-r--r--src/mame/drivers/tmc600.c (renamed from src/mess/drivers/tmc600.c)4
-rw-r--r--src/mame/drivers/tmmjprd.c4
-rw-r--r--src/mame/drivers/tmnt.c129
-rw-r--r--src/mame/drivers/tmspoker.c2
-rw-r--r--src/mame/drivers/tnzs.c68
-rw-r--r--src/mame/drivers/toaplan1.c22
-rw-r--r--src/mame/drivers/toaplan2.c169
-rw-r--r--src/mame/drivers/toki.c16
-rw-r--r--src/mame/drivers/tokyocop.c2
-rw-r--r--src/mame/drivers/tomcat.c2
-rw-r--r--src/mame/drivers/tonton.c39
-rw-r--r--src/mame/drivers/toobin.c12
-rw-r--r--src/mame/drivers/topspeed.c6
-rw-r--r--src/mame/drivers/toratora.c41
-rw-r--r--src/mame/drivers/tourtabl.c4
-rw-r--r--src/mame/drivers/tourvis.c69
-rw-r--r--src/mame/drivers/tp84.c6
-rw-r--r--src/mame/drivers/trackfld.c96
-rw-r--r--src/mame/drivers/travrusa.c32
-rw-r--r--src/mame/drivers/tricep.c (renamed from src/mess/drivers/tricep.c)2
-rw-r--r--src/mame/drivers/triforce.c120
-rw-r--r--src/mame/drivers/triplhnt.c2
-rw-r--r--src/mame/drivers/trs80.c (renamed from src/mess/drivers/trs80.c)2
-rw-r--r--src/mame/drivers/trs80m2.c (renamed from src/mess/drivers/trs80m2.c)10
-rw-r--r--src/mame/drivers/truco.c2
-rw-r--r--src/mame/drivers/trucocl.c2
-rw-r--r--src/mame/drivers/trvmadns.c4
-rw-r--r--src/mame/drivers/trvquest.c2
-rw-r--r--src/mame/drivers/tryout.c2
-rw-r--r--src/mame/drivers/ts802.c (renamed from src/mess/drivers/ts802.c)5
-rw-r--r--src/mame/drivers/ts803.c (renamed from src/mess/drivers/ts803.c)2
-rw-r--r--src/mame/drivers/ts816.c (renamed from src/mess/drivers/ts816.c)2
-rw-r--r--src/mame/drivers/tsamurai.c26
-rw-r--r--src/mame/drivers/tsispch.c (renamed from src/mess/drivers/tsispch.c)4
-rw-r--r--src/mame/drivers/ttchamp.c147
-rw-r--r--src/mame/drivers/tubep.c6
-rw-r--r--src/mame/drivers/tugboat.c8
-rw-r--r--src/mame/drivers/tumbleb.c42
-rw-r--r--src/mame/drivers/tumblep.c4
-rw-r--r--src/mame/drivers/tunhunt.c4
-rw-r--r--src/mame/drivers/turbo.c32
-rw-r--r--src/mame/drivers/tutankhm.c9
-rw-r--r--src/mame/drivers/tutor.c (renamed from src/mess/drivers/tutor.c)0
-rw-r--r--src/mame/drivers/tv950.c (renamed from src/mess/drivers/tv950.c)2
-rw-r--r--src/mame/drivers/tvc.c (renamed from src/mess/drivers/tvc.c)6
-rw-r--r--src/mame/drivers/tvgame.c (renamed from src/mess/drivers/tvgame.c)0
-rw-r--r--src/mame/drivers/twin16.c30
-rw-r--r--src/mame/drivers/twinkle.c34
-rw-r--r--src/mame/drivers/twins.c6
-rw-r--r--src/mame/drivers/tx0.c (renamed from src/mess/drivers/tx0.c)19
-rw-r--r--src/mame/drivers/tx1.c6
-rw-r--r--src/mame/drivers/uapce.c8
-rw-r--r--src/mame/drivers/uknc.c (renamed from src/mess/drivers/uknc.c)10
-rw-r--r--src/mame/drivers/ultraman.c3
-rw-r--r--src/mame/drivers/undrfire.c6
-rw-r--r--src/mame/drivers/unior.c (renamed from src/mess/drivers/unior.c)2
-rw-r--r--src/mame/drivers/unistar.c (renamed from src/mess/drivers/unistar.c)2
-rw-r--r--src/mame/drivers/univac.c (renamed from src/mess/drivers/univac.c)2
-rw-r--r--src/mame/drivers/unixpc.c (renamed from src/mess/drivers/unixpc.c)2
-rw-r--r--src/mame/drivers/unkfr.c4
-rw-r--r--src/mame/drivers/unkhorse.c13
-rw-r--r--src/mame/drivers/upscope.c2
-rw-r--r--src/mame/drivers/usgames.c16
-rw-r--r--src/mame/drivers/ut88.c (renamed from src/mess/drivers/ut88.c)0
-rw-r--r--src/mame/drivers/uzebox.c (renamed from src/mess/drivers/uzebox.c)2
-rw-r--r--src/mame/drivers/v1050.c (renamed from src/mess/drivers/v1050.c)2
-rw-r--r--src/mame/drivers/v6809.c (renamed from src/mess/drivers/v6809.c)3
-rw-r--r--src/mame/drivers/vamphalf.c48
-rw-r--r--src/mame/drivers/vaportra.c8
-rw-r--r--src/mame/drivers/vastar.c10
-rw-r--r--src/mame/drivers/vax11.c (renamed from src/mess/drivers/vax11.c)2
-rw-r--r--src/mame/drivers/vball.c8
-rw-r--r--src/mame/drivers/vboy.c (renamed from src/mess/drivers/vboy.c)2
-rw-r--r--src/mame/drivers/vc4000.c (renamed from src/mess/drivers/vc4000.c)48
-rw-r--r--src/mame/drivers/vcombat.c4
-rw-r--r--src/mame/drivers/vcs80.c (renamed from src/mess/drivers/vcs80.c)2
-rw-r--r--src/mame/drivers/vd.c6
-rw-r--r--src/mame/drivers/vector06.c (renamed from src/mess/drivers/vector06.c)26
-rw-r--r--src/mame/drivers/vector4.c (renamed from src/mess/drivers/vector4.c)2
-rw-r--r--src/mame/drivers/vectrex.c2
-rw-r--r--src/mame/drivers/vega.c2
-rw-r--r--src/mame/drivers/vegaeo.c2
-rw-r--r--src/mame/drivers/vegas.c263
-rw-r--r--src/mame/drivers/vendetta.c20
-rw-r--r--src/mame/drivers/vertigo.c2
-rw-r--r--src/mame/drivers/vg5k.c (renamed from src/mess/drivers/vg5k.c)2
-rw-r--r--src/mame/drivers/vic10.c (renamed from src/mess/drivers/vic10.c)2
-rw-r--r--src/mame/drivers/vic20.c (renamed from src/mess/drivers/vic20.c)8
-rw-r--r--src/mame/drivers/vicdual.c158
-rw-r--r--src/mame/drivers/victor9k.c (renamed from src/mess/drivers/victor9k.c)2
-rw-r--r--src/mame/drivers/victory.c4
-rw-r--r--src/mame/drivers/vidbrain.c (renamed from src/mess/drivers/vidbrain.c)2
-rw-r--r--src/mame/drivers/videopin.c4
-rw-r--r--src/mame/drivers/videopkr.c2
-rw-r--r--src/mame/drivers/vigilant.c28
-rw-r--r--src/mame/drivers/vii.c (renamed from src/mess/drivers/vii.c)14
-rw-r--r--src/mame/drivers/vip.c (renamed from src/mess/drivers/vip.c)4
-rw-r--r--src/mame/drivers/viper.c68
-rw-r--r--src/mame/drivers/vixen.c (renamed from src/mess/drivers/vixen.c)2
-rw-r--r--src/mame/drivers/vk100.c (renamed from src/mess/drivers/vk100.c)86
-rw-r--r--src/mame/drivers/vlc.c2
-rw-r--r--src/mame/drivers/volfied.c12
-rw-r--r--src/mame/drivers/votrpss.c (renamed from src/mess/drivers/votrpss.c)2
-rw-r--r--src/mame/drivers/votrtnt.c (renamed from src/mess/drivers/votrtnt.c)25
-rw-r--r--src/mame/drivers/voyager.c2
-rw-r--r--src/mame/drivers/vp101.c4
-rw-r--r--src/mame/drivers/vpoker.c23
-rw-r--r--src/mame/drivers/vroulet.c2
-rw-r--r--src/mame/drivers/vsnes.c12
-rw-r--r--src/mame/drivers/vt100.c (renamed from src/mess/drivers/vt100.c)24
-rw-r--r--src/mame/drivers/vt220.c (renamed from src/mess/drivers/vt220.c)2
-rw-r--r--src/mame/drivers/vt240.c (renamed from src/mess/drivers/vt240.c)6
-rw-r--r--src/mame/drivers/vt320.c (renamed from src/mess/drivers/vt320.c)8
-rw-r--r--src/mame/drivers/vt520.c (renamed from src/mess/drivers/vt520.c)6
-rw-r--r--src/mame/drivers/vta2000.c (renamed from src/mess/drivers/vta2000.c)2
-rw-r--r--src/mame/drivers/vtech1.c (renamed from src/mess/drivers/vtech1.c)4
-rw-r--r--src/mame/drivers/vtech2.c (renamed from src/mess/drivers/vtech2.c)0
-rw-r--r--src/mame/drivers/vulgus.c6
-rw-r--r--src/mame/drivers/wacky_gator.c178
-rw-r--r--src/mame/drivers/wallc.c8
-rw-r--r--src/mame/drivers/wangpc.c (renamed from src/mess/drivers/wangpc.c)2
-rw-r--r--src/mame/drivers/wardner.c6
-rw-r--r--src/mame/drivers/warpsped.c2
-rw-r--r--src/mame/drivers/warpwarp.c36
-rw-r--r--src/mame/drivers/warriorb.c8
-rw-r--r--src/mame/drivers/wc90.c150
-rw-r--r--src/mame/drivers/wc90b.c6
-rw-r--r--src/mame/drivers/wecleman.c226
-rw-r--r--src/mame/drivers/welltris.c6
-rw-r--r--src/mame/drivers/wgp.c20
-rw-r--r--src/mame/drivers/wheelfir.c2
-rw-r--r--src/mame/drivers/white_mod.c304
-rw-r--r--src/mame/drivers/whitestar.c364
-rw-r--r--src/mame/drivers/wicat.c (renamed from src/mess/drivers/wicat.c)2
-rw-r--r--src/mame/drivers/wico.c2
-rw-r--r--src/mame/drivers/wildfire.c (renamed from src/mess/drivers/wildfire.c)6
-rw-r--r--src/mame/drivers/wildpkr.c2
-rw-r--r--src/mame/drivers/williams.c92
-rw-r--r--src/mame/drivers/wink.c4
-rw-r--r--src/mame/drivers/wiping.c4
-rw-r--r--src/mame/drivers/wiz.c18
-rw-r--r--src/mame/drivers/wms.c54
-rw-r--r--src/mame/drivers/wolfpack.c2
-rw-r--r--src/mame/drivers/wpc_95.c124
-rw-r--r--src/mame/drivers/wpc_an.c34
-rw-r--r--src/mame/drivers/wpc_dcs.c64
-rw-r--r--src/mame/drivers/wpc_dot.c36
-rw-r--r--src/mame/drivers/wpc_flip1.c18
-rw-r--r--src/mame/drivers/wpc_flip2.c98
-rw-r--r--src/mame/drivers/wpc_s.c114
-rw-r--r--src/mame/drivers/wrally.c6
-rw-r--r--src/mame/drivers/wswan.c (renamed from src/mess/drivers/wswan.c)4
-rw-r--r--src/mame/drivers/wwfsstar.c10
-rw-r--r--src/mame/drivers/wyvernf0.c2
-rw-r--r--src/mame/drivers/x07.c (renamed from src/mess/drivers/x07.c)2
-rw-r--r--src/mame/drivers/x1.c (renamed from src/mess/drivers/x1.c)6
-rw-r--r--src/mame/drivers/x1twin.c (renamed from src/mess/drivers/x1twin.c)2
-rw-r--r--src/mame/drivers/x68k.c (renamed from src/mess/drivers/x68k.c)10
-rw-r--r--src/mame/drivers/xain.c8
-rw-r--r--src/mame/drivers/xavix.c (renamed from src/mess/drivers/xavix.c)2
-rw-r--r--src/mame/drivers/xbox.c254
-rw-r--r--src/mame/drivers/xerox820.c (renamed from src/mess/drivers/xerox820.c)8
-rw-r--r--src/mame/drivers/xexex.c6
-rw-r--r--src/mame/drivers/xmen.c76
-rw-r--r--src/mame/drivers/xor100.c (renamed from src/mess/drivers/xor100.c)2
-rw-r--r--src/mame/drivers/xorworld.c9
-rw-r--r--src/mame/drivers/xtheball.c2
-rw-r--r--src/mame/drivers/xtom3d.c2
-rw-r--r--src/mame/drivers/xxmissio.c6
-rw-r--r--src/mame/drivers/xyonix.c8
-rw-r--r--src/mame/drivers/yiear.c4
-rw-r--r--src/mame/drivers/ymmu100.c (renamed from src/mess/drivers/ymmu100.c)4
-rw-r--r--src/mame/drivers/ymmu100.ppm (renamed from src/mess/drivers/ymmu100.ppm)bin578415 -> 578415 bytes-rw-r--r--src/mame/drivers/yunsun16.c40
-rw-r--r--src/mame/drivers/yunsung8.c10
-rw-r--r--src/mame/drivers/z100.c (renamed from src/mess/drivers/z100.c)2
-rw-r--r--src/mame/drivers/z1013.c (renamed from src/mess/drivers/z1013.c)6
-rw-r--r--src/mame/drivers/z80dev.c (renamed from src/mess/drivers/z80dev.c)2
-rw-r--r--src/mame/drivers/z80ne.c (renamed from src/mess/drivers/z80ne.c)8
-rw-r--r--src/mame/drivers/z88.c (renamed from src/mess/drivers/z88.c)22
-rw-r--r--src/mame/drivers/z9001.c (renamed from src/mess/drivers/z9001.c)12
-rw-r--r--src/mame/drivers/zac2650.c6
-rw-r--r--src/mame/drivers/zac_1.c22
-rw-r--r--src/mame/drivers/zac_2.c76
-rw-r--r--src/mame/drivers/zac_proto.c6
-rw-r--r--src/mame/drivers/zaccaria.c20
-rw-r--r--src/mame/drivers/zapcomputer.c175
-rw-r--r--src/mame/drivers/zaurus.c (renamed from src/mess/drivers/zaurus.c)12
-rw-r--r--src/mame/drivers/zaxxon.c24
-rw-r--r--src/mame/drivers/zerozone.c4
-rw-r--r--src/mame/drivers/zexall.c (renamed from src/mess/drivers/zexall.c)2
-rw-r--r--src/mame/drivers/zn.c210
-rw-r--r--src/mame/drivers/zodiack.c10
-rw-r--r--src/mame/drivers/zorba.c (renamed from src/mess/drivers/zorba.c)5
-rw-r--r--src/mame/drivers/zr107.c18
-rw-r--r--src/mame/drivers/zrt80.c (renamed from src/mess/drivers/zrt80.c)0
-rw-r--r--src/mame/drivers/zsbc3.c (renamed from src/mess/drivers/zsbc3.c)2
-rw-r--r--src/mame/drivers/zx.c (renamed from src/mess/drivers/zx.c)4
-rw-r--r--src/mame/etc/template_driver.c2
-rw-r--r--src/mame/includes/1942.h1
-rw-r--r--src/mame/includes/4enraya.h1
-rw-r--r--src/mame/includes/8080bw.h10
-rw-r--r--src/mame/includes/88games.h3
-rw-r--r--src/mame/includes/abc1600.h (renamed from src/mess/includes/abc1600.h)0
-rw-r--r--src/mame/includes/abc80.h (renamed from src/mess/includes/abc80.h)0
-rw-r--r--src/mame/includes/abc80x.h (renamed from src/mess/includes/abc80x.h)0
-rw-r--r--src/mame/includes/ac1.h (renamed from src/mess/includes/ac1.h)9
-rw-r--r--src/mame/includes/adam.h (renamed from src/mess/includes/adam.h)0
-rw-r--r--src/mame/includes/advision.h (renamed from src/mess/includes/advision.h)0
-rw-r--r--src/mame/includes/aerofgt.h1
-rw-r--r--src/mame/includes/aim65.h (renamed from src/mess/includes/aim65.h)0
-rw-r--r--src/mame/includes/ajax.h8
-rw-r--r--src/mame/includes/alesis.h (renamed from src/mess/includes/alesis.h)17
-rw-r--r--src/mame/includes/aliens.h12
-rw-r--r--src/mame/includes/amiga.h5
-rw-r--r--src/mame/includes/amspdwy.h1
-rw-r--r--src/mame/includes/amstrad.h (renamed from src/mess/includes/amstrad.h)3
-rw-r--r--src/mame/includes/apollo.h (renamed from src/mess/includes/apollo.h)0
-rw-r--r--src/mame/includes/apple1.h (renamed from src/mess/includes/apple1.h)0
-rw-r--r--src/mame/includes/apple2.h (renamed from src/mess/includes/apple2.h)0
-rw-r--r--src/mame/includes/apple2gs.h (renamed from src/mess/includes/apple2gs.h)0
-rw-r--r--src/mame/includes/apple3.h (renamed from src/mess/includes/apple3.h)0
-rw-r--r--src/mame/includes/aquarium.h1
-rw-r--r--src/mame/includes/aquarius.h (renamed from src/mess/includes/aquarius.h)0
-rw-r--r--src/mame/includes/arcadia.h (renamed from src/mess/includes/arcadia.h)0
-rw-r--r--src/mame/includes/armedf.h1
-rw-r--r--src/mame/includes/ashnojoe.h1
-rw-r--r--src/mame/includes/asterix.h3
-rw-r--r--src/mame/includes/astrocde.h41
-rw-r--r--src/mame/includes/asuka.h3
-rw-r--r--src/mame/includes/at.h (renamed from src/mess/includes/at.h)6
-rw-r--r--src/mame/includes/atarist.h (renamed from src/mess/includes/atarist.h)0
-rw-r--r--src/mame/includes/atarisy2.h4
-rw-r--r--src/mame/includes/atom.h (renamed from src/mess/includes/atom.h)6
-rw-r--r--src/mame/includes/aussiebyte.h126
-rw-r--r--src/mame/includes/avigo.h (renamed from src/mess/includes/avigo.h)0
-rw-r--r--src/mame/includes/b2m.h (renamed from src/mess/includes/b2m.h)0
-rw-r--r--src/mame/includes/banctec.h (renamed from src/mess/includes/banctec.h)0
-rw-r--r--src/mame/includes/battlnts.h1
-rw-r--r--src/mame/includes/bbc.h (renamed from src/mess/includes/bbc.h)58
-rw-r--r--src/mame/includes/bebox.h (renamed from src/mess/includes/bebox.h)11
-rw-r--r--src/mame/includes/bionicc.h4
-rw-r--r--src/mame/includes/bishi.h1
-rw-r--r--src/mame/includes/bk.h (renamed from src/mess/includes/bk.h)0
-rw-r--r--src/mame/includes/bladestl.h1
-rw-r--r--src/mame/includes/blktiger.h2
-rw-r--r--src/mame/includes/blockhl.h56
-rw-r--r--src/mame/includes/bogeyman.h2
-rw-r--r--src/mame/includes/bottom9.h6
-rw-r--r--src/mame/includes/btime.h3
-rw-r--r--src/mame/includes/bublbobl.h1
-rw-r--r--src/mame/includes/bullet.h (renamed from src/mess/includes/bullet.h)0
-rw-r--r--src/mame/includes/busicom.h (renamed from src/mess/includes/busicom.h)0
-rw-r--r--src/mame/includes/bw12.h (renamed from src/mess/includes/bw12.h)0
-rw-r--r--src/mame/includes/bw2.h (renamed from src/mess/includes/bw2.h)0
-rw-r--r--src/mame/includes/c128.h (renamed from src/mess/includes/c128.h)1
-rw-r--r--src/mame/includes/c64.h (renamed from src/mess/includes/c64.h)73
-rw-r--r--src/mame/includes/c65.h (renamed from src/mess/includes/c65.h)0
-rw-r--r--src/mame/includes/c80.h (renamed from src/mess/includes/c80.h)0
-rw-r--r--src/mame/includes/cbasebal.h1
-rw-r--r--src/mame/includes/cbm2.h (renamed from src/mess/includes/cbm2.h)0
-rw-r--r--src/mame/includes/cclimber.h2
-rw-r--r--src/mame/includes/cgc7900.h (renamed from src/mess/includes/cgc7900.h)0
-rw-r--r--src/mame/includes/channelf.h (renamed from src/mess/includes/channelf.h)0
-rw-r--r--src/mame/includes/chihiro.h29
-rw-r--r--src/mame/includes/chqflag.h6
-rw-r--r--src/mame/includes/citycon.h1
-rw-r--r--src/mame/includes/coco.h (renamed from src/mess/includes/coco.h)9
-rw-r--r--src/mame/includes/coco12.h (renamed from src/mess/includes/coco12.h)2
-rw-r--r--src/mame/includes/coco3.h (renamed from src/mess/includes/coco3.h)0
-rw-r--r--src/mame/includes/coleco.h (renamed from src/mess/includes/coleco.h)62
-rw-r--r--src/mame/includes/compis.h (renamed from src/mess/includes/compis.h)0
-rw-r--r--src/mame/includes/comquest.h (renamed from src/mess/includes/comquest.h)0
-rw-r--r--src/mame/includes/comx35.h (renamed from src/mess/includes/comx35.h)0
-rw-r--r--src/mame/includes/concept.h (renamed from src/mess/includes/concept.h)0
-rw-r--r--src/mame/includes/cosmicos.h (renamed from src/mess/includes/cosmicos.h)0
-rw-r--r--src/mame/includes/crimfght.h29
-rw-r--r--src/mame/includes/crospang.h1
-rw-r--r--src/mame/includes/crshrace.h2
-rw-r--r--src/mame/includes/crvision.h (renamed from src/mess/includes/crvision.h)0
-rw-r--r--src/mame/includes/cxhumax.h (renamed from src/mess/includes/cxhumax.h)0
-rw-r--r--src/mame/includes/cybiko.h (renamed from src/mess/includes/cybiko.h)16
-rw-r--r--src/mame/includes/dai.h (renamed from src/mess/includes/dai.h)0
-rw-r--r--src/mame/includes/dbz.h1
-rw-r--r--src/mame/includes/dccons.h (renamed from src/mess/includes/dccons.h)0
-rw-r--r--src/mame/includes/dec8.h2
-rw-r--r--src/mame/includes/deco32.h4
-rw-r--r--src/mame/includes/dgn_beta.h (renamed from src/mess/includes/dgn_beta.h)0
-rw-r--r--src/mame/includes/dgnalpha.h (renamed from src/mess/includes/dgnalpha.h)0
-rw-r--r--src/mame/includes/dietgo.h1
-rw-r--r--src/mame/includes/djmain.h5
-rw-r--r--src/mame/includes/dm7000.h (renamed from src/mess/includes/dm7000.h)0
-rw-r--r--src/mame/includes/dogfgt.h1
-rw-r--r--src/mame/includes/dragon.h (renamed from src/mess/includes/dragon.h)4
-rw-r--r--src/mame/includes/drgnmst.h1
-rw-r--r--src/mame/includes/dynduke.h5
-rw-r--r--src/mame/includes/ec184x.h (renamed from src/mess/includes/ec184x.h)0
-rw-r--r--src/mame/includes/einstein.h (renamed from src/mess/includes/einstein.h)0
-rw-r--r--src/mame/includes/electron.h (renamed from src/mess/includes/electron.h)0
-rw-r--r--src/mame/includes/elf.h (renamed from src/mess/includes/elf.h)0
-rw-r--r--src/mame/includes/ep64.h (renamed from src/mess/includes/ep64.h)0
-rw-r--r--src/mame/includes/esd16.h1
-rw-r--r--src/mame/includes/eti660.h (renamed from src/mess/includes/eti660.h)46
-rw-r--r--src/mame/includes/exp85.h (renamed from src/mess/includes/exp85.h)0
-rw-r--r--src/mame/includes/f1gp.h1
-rw-r--r--src/mame/includes/fantland.h1
-rw-r--r--src/mame/includes/fidelz80.h (renamed from src/mess/includes/fidelz80.h)0
-rw-r--r--src/mame/includes/fitfight.h1
-rw-r--r--src/mame/includes/flkatck.h1
-rw-r--r--src/mame/includes/flstory.h2
-rw-r--r--src/mame/includes/fm7.h (renamed from src/mess/includes/fm7.h)8
-rw-r--r--src/mame/includes/fmtowns.h (renamed from src/mess/includes/fmtowns.h)0
-rw-r--r--src/mame/includes/fromance.h1
-rw-r--r--src/mame/includes/funkyjet.h1
-rw-r--r--src/mame/includes/gaelco.h1
-rw-r--r--src/mame/includes/gaelco2.h62
-rw-r--r--src/mame/includes/galastrm.h32
-rw-r--r--src/mame/includes/galaxian.h7
-rw-r--r--src/mame/includes/galaxold.h7
-rw-r--r--src/mame/includes/galaxy.h (renamed from src/mess/includes/galaxy.h)0
-rw-r--r--src/mame/includes/galeb.h (renamed from src/mess/includes/galeb.h)0
-rw-r--r--src/mame/includes/galpanic.h4
-rw-r--r--src/mame/includes/gamate.h (renamed from src/mess/includes/gamate.h)0
-rw-r--r--src/mame/includes/gamecom.h (renamed from src/mess/includes/gamecom.h)0
-rw-r--r--src/mame/includes/gamepock.h (renamed from src/mess/includes/gamepock.h)0
-rw-r--r--src/mame/includes/gb.h (renamed from src/mess/includes/gb.h)0
-rw-r--r--src/mame/includes/gba.h (renamed from src/mess/includes/gba.h)0
-rw-r--r--src/mame/includes/gcpinbal.h1
-rw-r--r--src/mame/includes/genpc.h (renamed from src/mess/includes/genpc.h)0
-rw-r--r--src/mame/includes/gijoe.h1
-rw-r--r--src/mame/includes/ginganin.h1
-rw-r--r--src/mame/includes/glass.h1
-rw-r--r--src/mame/includes/gng.h2
-rw-r--r--src/mame/includes/goal92.h1
-rw-r--r--src/mame/includes/gotcha.h1
-rw-r--r--src/mame/includes/gp32.h (renamed from src/mess/includes/gp32.h)0
-rw-r--r--src/mame/includes/gradius3.h6
-rw-r--r--src/mame/includes/gumbo.h1
-rw-r--r--src/mame/includes/harddriv.h9
-rw-r--r--src/mame/includes/hec2hrp.h (renamed from src/mess/includes/hec2hrp.h)0
-rw-r--r--src/mame/includes/hh_tms1k.h (renamed from src/mess/includes/hh_tms1k.h)4
-rw-r--r--src/mame/includes/hh_ucom4.h (renamed from src/mess/includes/hh_ucom4.h)0
-rw-r--r--src/mame/includes/himesiki.h1
-rw-r--r--src/mame/includes/hng64.h163
-rw-r--r--src/mame/includes/hp48.h (renamed from src/mess/includes/hp48.h)0
-rw-r--r--src/mame/includes/huebler.h (renamed from src/mess/includes/huebler.h)0
-rw-r--r--src/mame/includes/hx20.h (renamed from src/mess/includes/hx20.h)0
-rw-r--r--src/mame/includes/imds2.h (renamed from src/mess/includes/imds2.h)5
-rw-r--r--src/mame/includes/intv.h (renamed from src/mess/includes/intv.h)0
-rw-r--r--src/mame/includes/inufuku.h1
-rw-r--r--src/mame/includes/itech8.h14
-rw-r--r--src/mame/includes/jack.h1
-rw-r--r--src/mame/includes/jupiter.h (renamed from src/mess/includes/jupiter.h)0
-rw-r--r--src/mame/includes/kangaroo.h4
-rw-r--r--src/mame/includes/kaypro.h (renamed from src/mess/includes/kaypro.h)0
-rw-r--r--src/mame/includes/kc.h (renamed from src/mess/includes/kc.h)0
-rw-r--r--src/mame/includes/kickgoal.h1
-rw-r--r--src/mame/includes/konamigx.h8
-rw-r--r--src/mame/includes/kramermc.h (renamed from src/mess/includes/kramermc.h)0
-rw-r--r--src/mame/includes/kyocera.h (renamed from src/mess/includes/kyocera.h)0
-rw-r--r--src/mame/includes/lc80.h (renamed from src/mess/includes/lc80.h)0
-rw-r--r--src/mame/includes/leland.h13
-rw-r--r--src/mame/includes/lethalj.h19
-rw-r--r--src/mame/includes/liberate.h3
-rw-r--r--src/mame/includes/lisa.h (renamed from src/mess/includes/lisa.h)0
-rw-r--r--src/mame/includes/lkage.h1
-rw-r--r--src/mame/includes/llc.h (renamed from src/mess/includes/llc.h)0
-rw-r--r--src/mame/includes/lviv.h (renamed from src/mess/includes/lviv.h)0
-rw-r--r--src/mame/includes/lwings.h5
-rw-r--r--src/mame/includes/lynx.h (renamed from src/mess/includes/lynx.h)0
-rw-r--r--src/mame/includes/m107.h7
-rw-r--r--src/mame/includes/m5.h (renamed from src/mess/includes/m5.h)0
-rw-r--r--src/mame/includes/m72.h58
-rw-r--r--src/mame/includes/m92.h9
-rw-r--r--src/mame/includes/mac.h (renamed from src/mess/includes/mac.h)0
-rw-r--r--src/mame/includes/macpci.h (renamed from src/mess/includes/macpci.h)0
-rw-r--r--src/mame/includes/macrossp.h15
-rw-r--r--src/mame/includes/madmotor.h1
-rw-r--r--src/mame/includes/mainevt.h15
-rw-r--r--src/mame/includes/mbc55x.h (renamed from src/mess/includes/mbc55x.h)0
-rw-r--r--src/mame/includes/mbee.h (renamed from src/mess/includes/mbee.h)0
-rw-r--r--src/mame/includes/mboard.h (renamed from src/mess/includes/mboard.h)21
-rw-r--r--src/mame/includes/mc1000.h (renamed from src/mess/includes/mc1000.h)0
-rw-r--r--src/mame/includes/mc1502.h (renamed from src/mess/includes/mc1502.h)0
-rw-r--r--src/mame/includes/mc80.h (renamed from src/mess/includes/mc80.h)0
-rw-r--r--src/mame/includes/mcatadv.h1
-rw-r--r--src/mame/includes/mcr68.h6
-rw-r--r--src/mame/includes/md_cons.h (renamed from src/mess/includes/md_cons.h)0
-rw-r--r--src/mame/includes/megadriv.h2
-rw-r--r--src/mame/includes/megasys1.h1
-rw-r--r--src/mame/includes/metlclsh.h2
-rw-r--r--src/mame/includes/micro3d.h41
-rw-r--r--src/mame/includes/micronic.h (renamed from src/mess/includes/micronic.h)0
-rw-r--r--src/mame/includes/microtan.h (renamed from src/mess/includes/microtan.h)0
-rw-r--r--src/mame/includes/midtunit.h3
-rw-r--r--src/mame/includes/midzeus.h2
-rw-r--r--src/mame/includes/mikro80.h (renamed from src/mess/includes/mikro80.h)0
-rw-r--r--src/mame/includes/mikromik.h (renamed from src/mess/includes/mikromik.h)0
-rw-r--r--src/mame/includes/model2.h181
-rw-r--r--src/mame/includes/model3.h14
-rw-r--r--src/mame/includes/momoko.h1
-rw-r--r--src/mame/includes/moo.h1
-rw-r--r--src/mame/includes/mpf1.h (renamed from src/mess/includes/mpf1.h)0
-rw-r--r--src/mame/includes/mpz80.h (renamed from src/mess/includes/mpz80.h)0
-rw-r--r--src/mame/includes/mrflea.h1
-rw-r--r--src/mame/includes/msbc1.h (renamed from src/mess/includes/msbc1.h)0
-rw-r--r--src/mame/includes/msx.h (renamed from src/mess/includes/msx.h)2
-rw-r--r--src/mame/includes/mtx.h (renamed from src/mess/includes/mtx.h)0
-rw-r--r--src/mame/includes/mz700.h (renamed from src/mess/includes/mz700.h)0
-rw-r--r--src/mame/includes/mz80.h (renamed from src/mess/includes/mz80.h)0
-rw-r--r--src/mame/includes/n64.h15
-rw-r--r--src/mame/includes/namcona1.h27
-rw-r--r--src/mame/includes/namcond1.h25
-rw-r--r--src/mame/includes/namcos1.h11
-rw-r--r--src/mame/includes/nbmj9195.h2
-rw-r--r--src/mame/includes/nc.h (renamed from src/mess/includes/nc.h)0
-rw-r--r--src/mame/includes/nes.h (renamed from src/mess/includes/nes.h)0
-rw-r--r--src/mame/includes/newbrain.h (renamed from src/mess/includes/newbrain.h)0
-rw-r--r--src/mame/includes/news.h1
-rw-r--r--src/mame/includes/next.h (renamed from src/mess/includes/next.h)0
-rw-r--r--src/mame/includes/nova2001.h1
-rw-r--r--src/mame/includes/ob68k1a.h (renamed from src/mess/includes/ob68k1a.h)0
-rw-r--r--src/mame/includes/ondra.h (renamed from src/mess/includes/ondra.h)0
-rw-r--r--src/mame/includes/orao.h (renamed from src/mess/includes/orao.h)19
-rw-r--r--src/mame/includes/orion.h (renamed from src/mess/includes/orion.h)0
-rw-r--r--src/mame/includes/osborne1.h (renamed from src/mess/includes/osborne1.h)0
-rw-r--r--src/mame/includes/osi.h (renamed from src/mess/includes/osi.h)0
-rw-r--r--src/mame/includes/overdriv.h3
-rw-r--r--src/mame/includes/p2000t.h (renamed from src/mess/includes/p2000t.h)0
-rw-r--r--src/mame/includes/partner.h (renamed from src/mess/includes/partner.h)0
-rw-r--r--src/mame/includes/pasopia.h (renamed from src/mess/includes/pasopia.h)0
-rw-r--r--src/mame/includes/pbaction.h1
-rw-r--r--src/mame/includes/pc1251.h (renamed from src/mess/includes/pc1251.h)0
-rw-r--r--src/mame/includes/pc1350.h (renamed from src/mess/includes/pc1350.h)0
-rw-r--r--src/mame/includes/pc1401.h (renamed from src/mess/includes/pc1401.h)0
-rw-r--r--src/mame/includes/pc1403.h (renamed from src/mess/includes/pc1403.h)0
-rw-r--r--src/mame/includes/pc1512.h (renamed from src/mess/includes/pc1512.h)0
-rw-r--r--src/mame/includes/pc4.h (renamed from src/mess/includes/pc4.h)0
-rw-r--r--src/mame/includes/pc8001.h (renamed from src/mess/includes/pc8001.h)0
-rw-r--r--src/mame/includes/pc8401a.h (renamed from src/mess/includes/pc8401a.h)0
-rw-r--r--src/mame/includes/pce.h (renamed from src/mess/includes/pce.h)10
-rw-r--r--src/mame/includes/pcktgal.h2
-rw-r--r--src/mame/includes/pcw.h (renamed from src/mess/includes/pcw.h)0
-rw-r--r--src/mame/includes/pcw16.h (renamed from src/mess/includes/pcw16.h)0
-rw-r--r--src/mame/includes/pdp1.h (renamed from src/mess/includes/pdp1.h)60
-rw-r--r--src/mame/includes/pecom.h (renamed from src/mess/includes/pecom.h)0
-rw-r--r--src/mame/includes/pes.h (renamed from src/mess/includes/pes.h)0
-rw-r--r--src/mame/includes/pet.h (renamed from src/mess/includes/pet.h)0
-rw-r--r--src/mame/includes/pgm.h4
-rw-r--r--src/mame/includes/phc25.h (renamed from src/mess/includes/phc25.h)0
-rw-r--r--src/mame/includes/phoenix.h1
-rw-r--r--src/mame/includes/pk8020.h (renamed from src/mess/includes/pk8020.h)0
-rw-r--r--src/mame/includes/pktgaldx.h2
-rw-r--r--src/mame/includes/plus4.h (renamed from src/mess/includes/plus4.h)0
-rw-r--r--src/mame/includes/plygonet.h5
-rw-r--r--src/mame/includes/pmd85.h (renamed from src/mess/includes/pmd85.h)7
-rw-r--r--src/mame/includes/pocketc.h (renamed from src/mess/includes/pocketc.h)0
-rw-r--r--src/mame/includes/poisk1.h (renamed from src/mess/includes/poisk1.h)0
-rw-r--r--src/mame/includes/poly88.h (renamed from src/mess/includes/poly88.h)0
-rw-r--r--src/mame/includes/poly880.h (renamed from src/mess/includes/poly880.h)0
-rw-r--r--src/mame/includes/portfoli.h (renamed from src/mess/includes/portfoli.h)0
-rw-r--r--src/mame/includes/pp01.h (renamed from src/mess/includes/pp01.h)0
-rw-r--r--src/mame/includes/primo.h (renamed from src/mess/includes/primo.h)0
-rw-r--r--src/mame/includes/prof180x.h (renamed from src/mess/includes/prof180x.h)0
-rw-r--r--src/mame/includes/prof80.h (renamed from src/mess/includes/prof80.h)0
-rw-r--r--src/mame/includes/psikyo.h1
-rw-r--r--src/mame/includes/psion.h (renamed from src/mess/includes/psion.h)0
-rw-r--r--src/mame/includes/px8.h (renamed from src/mess/includes/px8.h)0
-rw-r--r--src/mame/includes/ql.h (renamed from src/mess/includes/ql.h)0
-rw-r--r--src/mame/includes/radio86.h (renamed from src/mess/includes/radio86.h)0
-rw-r--r--src/mame/includes/rastan.h3
-rw-r--r--src/mame/includes/rbisland.h (renamed from src/mame/includes/rainbow.h)1
-rw-r--r--src/mame/includes/rm380z.h (renamed from src/mess/includes/rm380z.h)0
-rw-r--r--src/mame/includes/rmnimbus.h (renamed from src/mess/includes/rmnimbus.h)12
-rw-r--r--src/mame/includes/rockrage.h1
-rw-r--r--src/mame/includes/rocnrope.h26
-rw-r--r--src/mame/includes/rollerg.h5
-rw-r--r--src/mame/includes/route16.h9
-rw-r--r--src/mame/includes/sage2.h (renamed from src/mess/includes/sage2.h)0
-rw-r--r--src/mame/includes/samcoupe.h (renamed from src/mess/includes/samcoupe.h)59
-rw-r--r--src/mame/includes/scramble.h12
-rw-r--r--src/mame/includes/segas16b.h10
-rw-r--r--src/mame/includes/segaxbd.h165
-rw-r--r--src/mame/includes/senjyo.h16
-rw-r--r--src/mame/includes/seta.h1
-rw-r--r--src/mame/includes/sg1000.h (renamed from src/mess/includes/sg1000.h)0
-rw-r--r--src/mame/includes/shadfrce.h19
-rw-r--r--src/mame/includes/sms.h (renamed from src/mess/includes/sms.h)0
-rw-r--r--src/mame/includes/softbox.h (renamed from src/mess/includes/softbox.h)0
-rw-r--r--src/mame/includes/sorcerer.h (renamed from src/mess/includes/sorcerer.h)2
-rw-r--r--src/mame/includes/special.h (renamed from src/mess/includes/special.h)0
-rw-r--r--src/mame/includes/spectrum.h (renamed from src/mess/includes/spectrum.h)2
-rw-r--r--src/mame/includes/spiders.h9
-rw-r--r--src/mame/includes/spy.h5
-rw-r--r--src/mame/includes/ssystem3.h (renamed from src/mess/includes/ssystem3.h)30
-rw-r--r--src/mame/includes/suna16.h10
-rw-r--r--src/mame/includes/suna8.h11
-rw-r--r--src/mame/includes/supbtime.h1
-rw-r--r--src/mame/includes/super6.h (renamed from src/mess/includes/super6.h)0
-rw-r--r--src/mame/includes/super80.h (renamed from src/mess/includes/super80.h)0
-rw-r--r--src/mame/includes/superqix.h1
-rw-r--r--src/mame/includes/superslave.h (renamed from src/mess/includes/superslave.h)0
-rw-r--r--src/mame/includes/suprslam.h1
-rw-r--r--src/mame/includes/svi318.h (renamed from src/mess/includes/svi318.h)0
-rw-r--r--src/mame/includes/svision.h (renamed from src/mess/includes/svision.h)0
-rw-r--r--src/mame/includes/swtpc09.h (renamed from src/mess/includes/swtpc09.h)0
-rw-r--r--src/mame/includes/system1.h7
-rw-r--r--src/mame/includes/system16.h3
-rw-r--r--src/mame/includes/taito_b.h1
-rw-r--r--src/mame/includes/taito_f2.h2
-rw-r--r--src/mame/includes/taito_f3.h12
-rw-r--r--src/mame/includes/taito_o.h3
-rw-r--r--src/mame/includes/taitoair.h4
-rw-r--r--src/mame/includes/tandy2k.h (renamed from src/mess/includes/tandy2k.h)0
-rw-r--r--src/mame/includes/tank8.h59
-rw-r--r--src/mame/includes/tdv2324.h (renamed from src/mess/includes/tdv2324.h)0
-rw-r--r--src/mame/includes/tek405x.h (renamed from src/mess/includes/tek405x.h)0
-rw-r--r--src/mame/includes/thomson.h (renamed from src/mess/includes/thomson.h)52
-rw-r--r--src/mame/includes/ti85.h (renamed from src/mess/includes/ti85.h)0
-rw-r--r--src/mame/includes/ti89.h (renamed from src/mess/includes/ti89.h)0
-rw-r--r--src/mame/includes/tiki100.h (renamed from src/mess/includes/tiki100.h)68
-rw-r--r--src/mame/includes/tmc1800.h (renamed from src/mess/includes/tmc1800.h)0
-rw-r--r--src/mame/includes/tmc2000e.h (renamed from src/mess/includes/tmc2000e.h)0
-rw-r--r--src/mame/includes/tmc600.h (renamed from src/mess/includes/tmc600.h)0
-rw-r--r--src/mame/includes/tnzs.h24
-rw-r--r--src/mame/includes/trackfld.h1
-rw-r--r--src/mame/includes/trs80.h (renamed from src/mess/includes/trs80.h)0
-rw-r--r--src/mame/includes/trs80m2.h (renamed from src/mess/includes/trs80m2.h)0
-rw-r--r--src/mame/includes/tsispch.h (renamed from src/mess/includes/tsispch.h)0
-rw-r--r--src/mame/includes/tumbleb.h1
-rw-r--r--src/mame/includes/tumblep.h1
-rw-r--r--src/mame/includes/tutankhm.h7
-rw-r--r--src/mame/includes/tx0.h (renamed from src/mess/includes/tx0.h)12
-rw-r--r--src/mame/includes/ultraman.h7
-rw-r--r--src/mame/includes/ut88.h (renamed from src/mess/includes/ut88.h)0
-rw-r--r--src/mame/includes/v1050.h (renamed from src/mess/includes/v1050.h)0
-rw-r--r--src/mame/includes/vc4000.h (renamed from src/mess/includes/vc4000.h)7
-rw-r--r--src/mame/includes/vcs80.h (renamed from src/mess/includes/vcs80.h)0
-rw-r--r--src/mame/includes/vector06.h (renamed from src/mess/includes/vector06.h)70
-rw-r--r--src/mame/includes/vic10.h (renamed from src/mess/includes/vic10.h)0
-rw-r--r--src/mame/includes/vic20.h (renamed from src/mess/includes/vic20.h)0
-rw-r--r--src/mame/includes/vicdual.h17
-rw-r--r--src/mame/includes/victor9k.h (renamed from src/mess/includes/victor9k.h)0
-rw-r--r--src/mame/includes/vidbrain.h (renamed from src/mess/includes/vidbrain.h)0
-rw-r--r--src/mame/includes/vip.h (renamed from src/mess/includes/vip.h)0
-rw-r--r--src/mame/includes/vixen.h (renamed from src/mess/includes/vixen.h)0
-rw-r--r--src/mame/includes/volfied.h1
-rw-r--r--src/mame/includes/vtech2.h (renamed from src/mess/includes/vtech2.h)0
-rw-r--r--src/mame/includes/wangpc.h (renamed from src/mess/includes/wangpc.h)0
-rw-r--r--src/mame/includes/warpwarp.h19
-rw-r--r--src/mame/includes/wgp.h11
-rw-r--r--src/mame/includes/wswan.h (renamed from src/mess/includes/wswan.h)0
-rw-r--r--src/mame/includes/x07.h (renamed from src/mess/includes/x07.h)0
-rw-r--r--src/mame/includes/x1.h (renamed from src/mess/includes/x1.h)0
-rw-r--r--src/mame/includes/x68k.h (renamed from src/mess/includes/x68k.h)0
-rw-r--r--src/mame/includes/xbox.h321
-rw-r--r--src/mame/includes/xerox820.h (renamed from src/mess/includes/xerox820.h)0
-rw-r--r--src/mame/includes/xexex.h1
-rw-r--r--src/mame/includes/xmen.h10
-rw-r--r--src/mame/includes/xor100.h (renamed from src/mess/includes/xor100.h)0
-rw-r--r--src/mame/includes/xxmissio.h2
-rw-r--r--src/mame/includes/z80ne.h (renamed from src/mess/includes/z80ne.h)0
-rw-r--r--src/mame/includes/z88.h (renamed from src/mess/includes/z88.h)0
-rw-r--r--src/mame/includes/zx.h (renamed from src/mess/includes/zx.h)0
-rw-r--r--src/mame/layout/4004clk.lay47
-rw-r--r--src/mame/layout/abc1600.lay (renamed from src/mess/layout/abc1600.lay)0
-rw-r--r--src/mame/layout/acrnsys1.lay (renamed from src/mess/layout/acrnsys1.lay)0
-rw-r--r--src/mame/layout/aim65.lay135
-rw-r--r--src/mame/layout/aim65_40.lay (renamed from src/mess/layout/aim65_40.lay)0
-rw-r--r--src/mame/layout/amaztron.lay (renamed from src/mess/layout/amaztron.lay)0
-rw-r--r--src/mame/layout/amico2k.lay (renamed from src/mess/layout/amico2k.lay)0
-rw-r--r--src/mame/layout/amiga.lay (renamed from src/mess/layout/amiga.lay)0
-rw-r--r--src/mame/layout/apollo.lay (renamed from src/mess/layout/apollo.lay)0
-rw-r--r--src/mame/layout/apollo_15i.lay (renamed from src/mess/layout/apollo_15i.lay)0
-rw-r--r--src/mame/layout/apollo_dsp.lay (renamed from src/mess/layout/apollo_dsp.lay)0
-rw-r--r--src/mame/layout/apricotp.lay (renamed from src/mess/layout/apricotp.lay)0
-rw-r--r--src/mame/layout/aquastge.lay15
-rw-r--r--src/mame/layout/astro.lay (renamed from src/mess/layout/astro.lay)0
-rw-r--r--src/mame/layout/avigo.lay (renamed from src/mess/layout/avigo.lay)0
-rw-r--r--src/mame/layout/babbage.lay (renamed from src/mess/layout/babbage.lay)0
-rw-r--r--src/mame/layout/bankshot.lay (renamed from src/mess/layout/bankshot.lay)0
-rw-r--r--src/mame/layout/bbc.lay (renamed from src/mess/layout/bbc.lay)0
-rw-r--r--src/mame/layout/beta.lay (renamed from src/mess/layout/beta.lay)0
-rw-r--r--src/mame/layout/bigtrak.lay (renamed from src/mess/layout/bigtrak.lay)0
-rw-r--r--src/mame/layout/bitgrpha.lay (renamed from src/mess/layout/bitgrpha.lay)0
-rw-r--r--src/mame/layout/bitgrphb.lay (renamed from src/mess/layout/bitgrphb.lay)0
-rw-r--r--src/mame/layout/bob85.lay (renamed from src/mess/layout/bob85.lay)0
-rw-r--r--src/mame/layout/borisdpl.lay (renamed from src/mess/layout/borisdpl.lay)0
-rw-r--r--src/mame/layout/bridgec3.lay (renamed from src/mess/layout/bridgec3.lay)0
-rw-r--r--src/mame/layout/c80.lay (renamed from src/mess/layout/c80.lay)0
-rw-r--r--src/mame/layout/cc40.lay (renamed from src/mess/layout/cc40.lay)0
-rw-r--r--src/mame/layout/chessmst.lay (renamed from src/mess/layout/chessmst.lay)0
-rw-r--r--src/mame/layout/chesstrv.lay (renamed from src/mess/layout/chesstrv.lay)0
-rw-r--r--src/mame/layout/chexx.lay75
-rw-r--r--src/mame/layout/cmezspin.lay262
-rw-r--r--src/mame/layout/cnsector.lay (renamed from src/mess/layout/cnsector.lay)0
-rw-r--r--src/mame/layout/coco3.lay (renamed from src/mess/layout/coco3.lay)0
-rw-r--r--src/mame/layout/comp4.lay (renamed from src/mess/layout/comp4.lay)0
-rw-r--r--src/mame/layout/cosmicos.lay (renamed from src/mess/layout/cosmicos.lay)0
-rw-r--r--src/mame/layout/cp1.lay (renamed from src/mess/layout/cp1.lay)0
-rw-r--r--src/mame/layout/cvicny.lay (renamed from src/mess/layout/cvicny.lay)0
-rw-r--r--src/mame/layout/dataman.lay78
-rw-r--r--src/mame/layout/digel804.lay (renamed from src/mess/layout/digel804.lay)0
-rw-r--r--src/mame/layout/dmv.lay (renamed from src/mess/layout/dmv.lay)0
-rw-r--r--src/mame/layout/dolphunk.lay (renamed from src/mess/layout/dolphunk.lay)0
-rw-r--r--src/mame/layout/eacc.lay (renamed from src/mess/layout/eacc.lay)0
-rw-r--r--src/mame/layout/ebaskb2.lay (renamed from src/mess/layout/ebaskb2.lay)0
-rw-r--r--src/mame/layout/ebball.lay (renamed from src/mess/layout/ebball.lay)0
-rw-r--r--src/mame/layout/ebball2.lay (renamed from src/mess/layout/ebball2.lay)0
-rw-r--r--src/mame/layout/ebball3.lay (renamed from src/mess/layout/ebball3.lay)0
-rw-r--r--src/mame/layout/efball.lay (renamed from src/mess/layout/efball.lay)0
-rw-r--r--src/mame/layout/efootb4.lay (renamed from src/mess/layout/efootb4.lay)0
-rw-r--r--src/mame/layout/einvader.lay (renamed from src/mess/layout/einvader.lay)0
-rw-r--r--src/mame/layout/einvaderc.lay (renamed from src/mess/layout/einvaderc.lay)0
-rw-r--r--src/mame/layout/elecbowl.lay (renamed from src/mess/layout/elecbowl.lay)0
-rw-r--r--src/mame/layout/elecdet.lay (renamed from src/mess/layout/elecdet.lay)0
-rw-r--r--src/mame/layout/elekscmp.lay (renamed from src/mess/layout/elekscmp.lay)0
-rw-r--r--src/mame/layout/elf2.lay (renamed from src/mess/layout/elf2.lay)0
-rw-r--r--src/mame/layout/esq1by22.lay (renamed from src/mess/layout/esq1by22.lay)0
-rw-r--r--src/mame/layout/esq2by40.lay (renamed from src/mess/layout/esq2by40.lay)0
-rw-r--r--src/mame/layout/et3400.lay (renamed from src/mess/layout/et3400.lay)0
-rw-r--r--src/mame/layout/fb01.lay (renamed from src/mess/layout/fb01.lay)0
-rw-r--r--src/mame/layout/fccpu1.lay17
-rw-r--r--src/mame/layout/fidelz80.lay (renamed from src/mess/layout/fidelz80.lay)0
-rw-r--r--src/mame/layout/funjacks.lay (renamed from src/mess/layout/funjacks.lay)0
-rw-r--r--src/mame/layout/funrlgl.lay (renamed from src/mess/layout/funrlgl.lay)0
-rw-r--r--src/mame/layout/gamecom.lay (renamed from src/mess/layout/gamecom.lay)0
-rw-r--r--src/mame/layout/gjackpot.lay (renamed from src/mess/layout/gjackpot.lay)0
-rw-r--r--src/mame/layout/gl3000s.lay (renamed from src/mess/layout/gl3000s.lay)0
-rw-r--r--src/mame/layout/glasgow.lay (renamed from src/mess/layout/glasgow.lay)0
-rw-r--r--src/mame/layout/gpoker.lay (renamed from src/mess/layout/gpoker.lay)0
-rw-r--r--src/mame/layout/h2hbaseb.lay (renamed from src/mess/layout/h2hbaseb.lay)0
-rw-r--r--src/mame/layout/h2hfootb.lay (renamed from src/mess/layout/h2hfootb.lay)0
-rw-r--r--src/mame/layout/h8.lay (renamed from src/mess/layout/h8.lay)0
-rw-r--r--src/mame/layout/hh_hmcs40_test.lay (renamed from src/mess/layout/hh_hmcs40_test.lay)0
-rw-r--r--src/mame/layout/hh_melps4_test.lay (renamed from src/mess/layout/hh_melps4_test.lay)0
-rw-r--r--src/mame/layout/hh_sm510_test.lay (renamed from src/mess/layout/hh_sm510_test.lay)0
-rw-r--r--src/mame/layout/hh_tms1k_test.lay (renamed from src/mess/layout/hh_tms1k_test.lay)0
-rw-r--r--src/mame/layout/hh_ucom4_test.lay (renamed from src/mess/layout/hh_ucom4_test.lay)0
-rw-r--r--src/mame/layout/ie15.lay (renamed from src/mess/layout/ie15.lay)0
-rw-r--r--src/mame/layout/instruct.lay (renamed from src/mess/layout/instruct.lay)0
-rw-r--r--src/mame/layout/junior.lay (renamed from src/mess/layout/junior.lay)0
-rw-r--r--src/mame/layout/k1003.lay (renamed from src/mess/layout/k1003.lay)0
-rw-r--r--src/mame/layout/kim1.lay (renamed from src/mess/layout/kim1.lay)0
-rw-r--r--src/mame/layout/lantutor.lay (renamed from src/mess/layout/lantutor.lay)2
-rw-r--r--src/mame/layout/lc80.lay (renamed from src/mess/layout/lc80.lay)0
-rw-r--r--src/mame/layout/lightfgt.lay (renamed from src/mess/layout/lightfgt.lay)0
-rw-r--r--src/mame/layout/llc1.lay (renamed from src/mess/layout/llc1.lay)0
-rw-r--r--src/mame/layout/lynx.lay (renamed from src/mess/layout/lynx.lay)0
-rw-r--r--src/mame/layout/mac.lay (renamed from src/mess/layout/mac.lay)0
-rw-r--r--src/mame/layout/maniac.lay (renamed from src/mess/layout/maniac.lay)0
-rw-r--r--src/mame/layout/mathmagi.lay (renamed from src/mess/layout/mathmagi.lay)0
-rw-r--r--src/mame/layout/mbdtower.lay (renamed from src/mess/layout/mbdtower.lay)0
-rw-r--r--src/mame/layout/megacd.lay (renamed from src/mess/layout/megacd.lay)0
-rw-r--r--src/mame/layout/mekd2.lay (renamed from src/mess/layout/mekd2.lay)0
-rw-r--r--src/mame/layout/mephisto.lay (renamed from src/mess/layout/mephisto.lay)0
-rw-r--r--src/mame/layout/merlin.lay (renamed from src/mess/layout/merlin.lay)0
-rw-r--r--src/mame/layout/minicom.lay (renamed from src/mess/layout/minicom.lay)0
-rw-r--r--src/mame/layout/mirage.lay (renamed from src/mess/layout/mirage.lay)0
-rw-r--r--src/mame/layout/mk1.lay (renamed from src/mess/layout/mk1.lay)0
-rw-r--r--src/mame/layout/mk14.lay (renamed from src/mess/layout/mk14.lay)0
-rw-r--r--src/mame/layout/mk2.lay (renamed from src/mess/layout/mk2.lay)0
-rw-r--r--src/mame/layout/mkit09.lay (renamed from src/mess/layout/mkit09.lay)0
-rw-r--r--src/mame/layout/mmd1.lay (renamed from src/mess/layout/mmd1.lay)0
-rw-r--r--src/mame/layout/mmd2.lay (renamed from src/mess/layout/mmd2.lay)0
-rw-r--r--src/mame/layout/mmerlin.lay (renamed from src/mess/layout/mmerlin.lay)0
-rw-r--r--src/mame/layout/monzagp.lay106
-rw-r--r--src/mame/layout/mpf1.lay (renamed from src/mess/layout/mpf1.lay)0
-rw-r--r--src/mame/layout/mpf1b.lay (renamed from src/mess/layout/mpf1b.lay)0
-rw-r--r--src/mame/layout/mpf1p.lay (renamed from src/mess/layout/mpf1p.lay)0
-rw-r--r--src/mame/layout/mvbfree.lay (renamed from src/mess/layout/mvbfree.lay)0
-rw-r--r--src/mame/layout/newbrain.lay (renamed from src/mess/layout/newbrain.lay)0
-rw-r--r--src/mame/layout/pairmtch.lay201
-rw-r--r--src/mame/layout/pc1500.lay (renamed from src/mess/layout/pc1500.lay)0
-rw-r--r--src/mame/layout/pc8500.lay (renamed from src/mess/layout/pc8500.lay)0
-rw-r--r--src/mame/layout/pcw.lay (renamed from src/mess/layout/pcw.lay)0
-rw-r--r--src/mame/layout/piggypas.lay27
-rw-r--r--src/mame/layout/pmi80.lay (renamed from src/mess/layout/pmi80.lay)0
-rw-r--r--src/mame/layout/poly880.lay (renamed from src/mess/layout/poly880.lay)0
-rw-r--r--src/mame/layout/pro80.lay (renamed from src/mess/layout/pro80.lay)0
-rw-r--r--src/mame/layout/pve500.lay (renamed from src/mess/layout/pve500.lay)0
-rw-r--r--src/mame/layout/px4.lay (renamed from src/mess/layout/px4.lay)0
-rw-r--r--src/mame/layout/px8.lay (renamed from src/mess/layout/px8.lay)0
-rw-r--r--src/mame/layout/rainbow.lay (renamed from src/mess/layout/rainbow.lay)0
-rw-r--r--src/mame/layout/ravens.lay (renamed from src/mess/layout/ravens.lay)0
-rw-r--r--src/mame/layout/savia84.lay (renamed from src/mess/layout/savia84.lay)0
-rw-r--r--src/mame/layout/sc1.lay (renamed from src/mess/layout/sc1.lay)0
-rw-r--r--src/mame/layout/sc2.lay (renamed from src/mess/layout/sc2.lay)0
-rw-r--r--src/mame/layout/sdk85.lay (renamed from src/mess/layout/sdk85.lay)0
-rw-r--r--src/mame/layout/sdk86.lay (renamed from src/mess/layout/sdk86.lay)0
-rw-r--r--src/mame/layout/selz80.lay (renamed from src/mess/layout/selz80.lay)0
-rw-r--r--src/mame/layout/simon.lay (renamed from src/mess/layout/simon.lay)0
-rw-r--r--src/mame/layout/sitcom.lay (renamed from src/mess/layout/sitcom.lay)0
-rw-r--r--src/mame/layout/slc1.lay (renamed from src/mess/layout/slc1.lay)0
-rw-r--r--src/mame/layout/sms1.lay (renamed from src/mess/layout/sms1.lay)0
-rw-r--r--src/mame/layout/snmath.lay68
-rw-r--r--src/mame/layout/snspell.lay (renamed from src/mess/layout/snspell.lay)8
-rw-r--r--src/mame/layout/splitsec.lay (renamed from src/mess/layout/splitsec.lay)0
-rw-r--r--src/mame/layout/sr16.lay (renamed from src/mess/layout/sr16.lay)0
-rw-r--r--src/mame/layout/ssimon.lay (renamed from src/mess/layout/ssimon.lay)0
-rw-r--r--src/mame/layout/starwbc.lay (renamed from src/mess/layout/starwbc.lay)0
-rw-r--r--src/mame/layout/stopthie.lay (renamed from src/mess/layout/stopthie.lay)0
-rw-r--r--src/mame/layout/super80.lay (renamed from src/mess/layout/super80.lay)0
-rw-r--r--src/mame/layout/svision.lay (renamed from src/mess/layout/svision.lay)0
-rw-r--r--src/mame/layout/svmu.lay (renamed from src/mess/layout/svmu.lay)0
-rw-r--r--src/mame/layout/sym1.lay (renamed from src/mess/layout/sym1.lay)0
-rw-r--r--src/mame/layout/tactix.lay150
-rw-r--r--src/mame/layout/tama.lay (renamed from src/mess/layout/tama.lay)0
-rw-r--r--src/mame/layout/tandy12.lay (renamed from src/mess/layout/tandy12.lay)0
-rw-r--r--src/mame/layout/tavernie.lay (renamed from src/mess/layout/tavernie.lay)0
-rw-r--r--src/mame/layout/tb303.lay45
-rw-r--r--src/mame/layout/tbreakup.lay (renamed from src/mess/layout/tbreakup.lay)0
-rw-r--r--src/mame/layout/tc4.lay (renamed from src/mess/layout/tc4.lay)0
-rw-r--r--src/mame/layout/tec1.lay (renamed from src/mess/layout/tec1.lay)0
-rw-r--r--src/mame/layout/tecnbras.lay (renamed from src/mess/layout/tecnbras.lay)0
-rw-r--r--src/mame/layout/ti1270.lay (renamed from src/mess/layout/ti1270.lay)0
-rw-r--r--src/mame/layout/ti30.lay (renamed from src/mess/layout/ti30.lay)0
-rw-r--r--src/mame/layout/ti74.lay (renamed from src/mess/layout/ti74.lay)0
-rw-r--r--src/mame/layout/ti95.lay (renamed from src/mess/layout/ti95.lay)0
-rw-r--r--src/mame/layout/tisr16.lay (renamed from src/mess/layout/tisr16.lay)0
-rw-r--r--src/mame/layout/tk80.lay (renamed from src/mess/layout/tk80.lay)0
-rw-r--r--src/mame/layout/tm990189.lay (renamed from src/mess/layout/tm990189.lay)0
-rw-r--r--src/mame/layout/tm990189v.lay (renamed from src/mess/layout/tm990189v.lay)0
-rw-r--r--src/mame/layout/tntell.lay101
-rw-r--r--src/mame/layout/unixpc.lay (renamed from src/mess/layout/unixpc.lay)0
-rw-r--r--src/mame/layout/ut88mini.lay (renamed from src/mess/layout/ut88mini.lay)0
-rw-r--r--src/mame/layout/vboy.lay (renamed from src/mess/layout/vboy.lay)0
-rw-r--r--src/mame/layout/vcs80.lay (renamed from src/mess/layout/vcs80.lay)0
-rw-r--r--src/mame/layout/vidbrain.lay (renamed from src/mess/layout/vidbrain.lay)0
-rw-r--r--src/mame/layout/vk100.lay (renamed from src/mess/layout/vk100.lay)0
-rw-r--r--src/mame/layout/votrpss.lay (renamed from src/mess/layout/votrpss.lay)0
-rw-r--r--src/mame/layout/votrtnt.lay (renamed from src/mess/layout/votrtnt.lay)0
-rw-r--r--src/mame/layout/vsc.lay (renamed from src/mess/layout/vsc.lay)0
-rw-r--r--src/mame/layout/vt100.lay (renamed from src/mess/layout/vt100.lay)0
-rw-r--r--src/mame/layout/wicat.lay (renamed from src/mess/layout/wicat.lay)0
-rw-r--r--src/mame/layout/wildfire.lay (renamed from src/mess/layout/wildfire.lay)0
-rw-r--r--src/mame/layout/wizatron.lay (renamed from src/mess/layout/wizatron.lay)0
-rw-r--r--src/mame/layout/wswan.lay (renamed from src/mess/layout/wswan.lay)0
-rw-r--r--src/mame/layout/x68000.lay (renamed from src/mess/layout/x68000.lay)0
-rw-r--r--src/mame/layout/z80dev.lay (renamed from src/mess/layout/z80dev.lay)0
-rw-r--r--src/mame/layout/z80ne.lay (renamed from src/mess/layout/z80ne.lay)0
-rw-r--r--src/mame/layout/z80net.lay (renamed from src/mess/layout/z80net.lay)0
-rw-r--r--src/mame/layout/z80netb.lay (renamed from src/mess/layout/z80netb.lay)0
-rw-r--r--src/mame/layout/z80netf.lay (renamed from src/mess/layout/z80netf.lay)0
-rw-r--r--src/mame/layout/zapcomputer.lay44
-rw-r--r--src/mame/machine/6883sam.c (renamed from src/mess/machine/6883sam.c)0
-rw-r--r--src/mame/machine/6883sam.h (renamed from src/mess/machine/6883sam.h)0
-rw-r--r--src/mame/machine/abc1600mac.c (renamed from src/mess/machine/abc1600mac.c)0
-rw-r--r--src/mame/machine/abc1600mac.h (renamed from src/mess/machine/abc1600mac.h)0
-rw-r--r--src/mame/machine/abc80kb.c (renamed from src/mess/machine/abc80kb.c)0
-rw-r--r--src/mame/machine/abc80kb.h (renamed from src/mess/machine/abc80kb.h)0
-rw-r--r--src/mame/machine/ac1.c (renamed from src/mess/machine/ac1.c)14
-rw-r--r--src/mame/machine/advision.c (renamed from src/mess/machine/advision.c)0
-rw-r--r--src/mame/machine/aim65.c (renamed from src/mess/machine/aim65.c)0
-rw-r--r--src/mame/machine/ajax.c6
-rw-r--r--src/mame/machine/amiga.c62
-rw-r--r--src/mame/machine/amigakbd.c (renamed from src/mess/machine/amigakbd.c)0
-rw-r--r--src/mame/machine/amigakbd.h (renamed from src/mess/machine/amigakbd.h)0
-rw-r--r--src/mame/machine/amstrad.c (renamed from src/mess/machine/amstrad.c)26
-rw-r--r--src/mame/machine/apollo.c (renamed from src/mess/machine/apollo.c)0
-rw-r--r--src/mame/machine/apollo_dbg.c (renamed from src/mess/machine/apollo_dbg.c)0
-rw-r--r--src/mame/machine/apollo_kbd.c (renamed from src/mess/machine/apollo_kbd.c)0
-rw-r--r--src/mame/machine/apollo_kbd.h (renamed from src/mess/machine/apollo_kbd.h)0
-rw-r--r--src/mame/machine/appldriv.c (renamed from src/mess/machine/appldriv.c)0
-rw-r--r--src/mame/machine/appldriv.h (renamed from src/mess/machine/appldriv.h)0
-rw-r--r--src/mame/machine/apple1.c (renamed from src/mess/machine/apple1.c)0
-rw-r--r--src/mame/machine/apple2.c (renamed from src/mess/machine/apple2.c)0
-rw-r--r--src/mame/machine/apple2gs.c (renamed from src/mess/machine/apple2gs.c)2
-rw-r--r--src/mame/machine/apple3.c (renamed from src/mess/machine/apple3.c)0
-rw-r--r--src/mame/machine/applefdc.c (renamed from src/mess/machine/applefdc.c)0
-rw-r--r--src/mame/machine/applefdc.h (renamed from src/mess/machine/applefdc.h)0
-rw-r--r--src/mame/machine/apricotkb.c (renamed from src/mess/machine/apricotkb.c)0
-rw-r--r--src/mame/machine/apricotkb.h (renamed from src/mess/machine/apricotkb.h)0
-rw-r--r--src/mame/machine/apricotkb_hle.c (renamed from src/mess/machine/apricotkb_hle.c)0
-rw-r--r--src/mame/machine/apricotkb_hle.h (renamed from src/mess/machine/apricotkb_hle.h)0
-rw-r--r--src/mame/machine/at.c (renamed from src/mess/machine/at.c)17
-rw-r--r--src/mame/machine/atari.c12
-rw-r--r--src/mame/machine/atari_vg.c117
-rw-r--r--src/mame/machine/atari_vg.h7
-rw-r--r--src/mame/machine/atarifdc.c (renamed from src/mess/machine/atarifdc.c)0
-rw-r--r--src/mame/machine/atarifdc.h (renamed from src/mess/machine/atarifdc.h)0
-rw-r--r--src/mame/machine/awboard.c10
-rw-r--r--src/mame/machine/b2m.c (renamed from src/mess/machine/b2m.c)0
-rw-r--r--src/mame/machine/bbc.c (renamed from src/mess/machine/bbc.c)701
-rw-r--r--src/mame/machine/bebox.c (renamed from src/mess/machine/bebox.c)37
-rw-r--r--src/mame/machine/beta.c (renamed from src/mess/machine/beta.c)0
-rw-r--r--src/mame/machine/beta.h (renamed from src/mess/machine/beta.h)0
-rw-r--r--src/mame/machine/bk.c (renamed from src/mess/machine/bk.c)0
-rw-r--r--src/mame/machine/c65_old.c (renamed from src/mess/machine/c65_old.c)0
-rw-r--r--src/mame/machine/cbm_snqk.c (renamed from src/mess/machine/cbm_snqk.c)0
-rw-r--r--src/mame/machine/cbm_snqk.h (renamed from src/mess/machine/cbm_snqk.h)0
-rw-r--r--src/mame/machine/cdi070.c2
-rw-r--r--src/mame/machine/cdi070.h2
-rw-r--r--src/mame/machine/cdicdic.c2
-rw-r--r--src/mame/machine/cdicdic.h2
-rw-r--r--src/mame/machine/cdislave.c2
-rw-r--r--src/mame/machine/cdislave.h2
-rw-r--r--src/mame/machine/coco.c (renamed from src/mess/machine/coco.c)54
-rw-r--r--src/mame/machine/coco12.c (renamed from src/mess/machine/coco12.c)5
-rw-r--r--src/mame/machine/coco3.c (renamed from src/mess/machine/coco3.c)0
-rw-r--r--src/mame/machine/coco_vhd.c (renamed from src/mess/machine/coco_vhd.c)0
-rw-r--r--src/mame/machine/coco_vhd.h (renamed from src/mess/machine/coco_vhd.h)0
-rw-r--r--src/mame/machine/coleco.c (renamed from src/mess/machine/coleco.c)92
-rw-r--r--src/mame/machine/coleco.h (renamed from src/mess/machine/coleco.h)3
-rw-r--r--src/mame/machine/compiskb.c (renamed from src/mess/machine/compiskb.c)0
-rw-r--r--src/mame/machine/compiskb.h (renamed from src/mess/machine/compiskb.h)0
-rw-r--r--src/mame/machine/concept.c (renamed from src/mess/machine/concept.c)0
-rw-r--r--src/mame/machine/cuda.c (renamed from src/mess/machine/cuda.c)0
-rw-r--r--src/mame/machine/cuda.h (renamed from src/mess/machine/cuda.h)0
-rw-r--r--src/mame/machine/cx4data.inc (renamed from src/mess/machine/cx4data.inc)0
-rw-r--r--src/mame/machine/cx4fn.inc (renamed from src/mess/machine/cx4fn.inc)0
-rw-r--r--src/mame/machine/cx4oam.inc (renamed from src/mess/machine/cx4oam.inc)0
-rw-r--r--src/mame/machine/cx4ops.inc (renamed from src/mess/machine/cx4ops.inc)0
-rw-r--r--src/mame/machine/cybiko.c (renamed from src/mess/machine/cybiko.c)5
-rw-r--r--src/mame/machine/dai.c (renamed from src/mess/machine/dai.c)0
-rw-r--r--src/mame/machine/dc-ctrl.c42
-rw-r--r--src/mame/machine/dc-ctrl.h6
-rw-r--r--src/mame/machine/dc.c10
-rw-r--r--src/mame/machine/dccons.c (renamed from src/mess/machine/dccons.c)25
-rw-r--r--src/mame/machine/dec_lk201.c (renamed from src/mess/machine/dec_lk201.c)0
-rw-r--r--src/mame/machine/dec_lk201.h (renamed from src/mess/machine/dec_lk201.h)0
-rw-r--r--src/mame/machine/deco146.c2
-rw-r--r--src/mame/machine/dgn_beta.c (renamed from src/mess/machine/dgn_beta.c)0
-rw-r--r--src/mame/machine/dgnalpha.c (renamed from src/mess/machine/dgnalpha.c)0
-rw-r--r--src/mame/machine/dmv_keyb.c (renamed from src/mess/machine/dmv_keyb.c)0
-rw-r--r--src/mame/machine/dmv_keyb.h (renamed from src/mess/machine/dmv_keyb.h)0
-rw-r--r--src/mame/machine/docg3.c (renamed from src/mess/machine/docg3.c)0
-rw-r--r--src/mame/machine/docg3.h (renamed from src/mess/machine/docg3.h)0
-rw-r--r--src/mame/machine/dragon.c (renamed from src/mess/machine/dragon.c)12
-rw-r--r--src/mame/machine/egret.c (renamed from src/mess/machine/egret.c)0
-rw-r--r--src/mame/machine/egret.h (renamed from src/mess/machine/egret.h)0
-rw-r--r--src/mame/machine/einstein.c (renamed from src/mess/machine/einstein.c)0
-rw-r--r--src/mame/machine/electron.c (renamed from src/mess/machine/electron.c)8
-rw-r--r--src/mame/machine/esqpanel.c (renamed from src/mess/machine/esqpanel.c)0
-rw-r--r--src/mame/machine/esqpanel.h (renamed from src/mess/machine/esqpanel.h)0
-rw-r--r--src/mame/machine/esqvfd.c (renamed from src/mess/machine/esqvfd.c)0
-rw-r--r--src/mame/machine/esqvfd.h (renamed from src/mess/machine/esqvfd.h)0
-rw-r--r--src/mame/machine/fd1089.c2
-rw-r--r--src/mame/machine/fd1094.c10
-rw-r--r--src/mame/machine/fm_scsi.c (renamed from src/mess/machine/fm_scsi.c)0
-rw-r--r--src/mame/machine/fm_scsi.h (renamed from src/mess/machine/fm_scsi.h)0
-rw-r--r--src/mame/machine/gaelco2.c18
-rw-r--r--src/mame/machine/galaxy.c (renamed from src/mess/machine/galaxy.c)0
-rw-r--r--src/mame/machine/gamecom.c (renamed from src/mess/machine/gamecom.c)0
-rw-r--r--src/mame/machine/gamepock.c (renamed from src/mess/machine/gamepock.c)0
-rw-r--r--src/mame/machine/gb.c (renamed from src/mess/machine/gb.c)0
-rw-r--r--src/mame/machine/genpc.c (renamed from src/mess/machine/genpc.c)0
-rw-r--r--src/mame/machine/harddriv.c17
-rw-r--r--src/mame/machine/hec2hrp.c (renamed from src/mess/machine/hec2hrp.c)0
-rw-r--r--src/mame/machine/hecdisk2.c (renamed from src/mess/machine/hecdisk2.c)0
-rw-r--r--src/mame/machine/hng64_net.c2
-rw-r--r--src/mame/machine/hp48.c (renamed from src/mess/machine/hp48.c)0
-rw-r--r--src/mame/machine/ie15_kbd.c (renamed from src/mess/machine/ie15_kbd.c)0
-rw-r--r--src/mame/machine/ie15_kbd.h (renamed from src/mess/machine/ie15_kbd.h)0
-rw-r--r--src/mame/machine/intv.c (renamed from src/mess/machine/intv.c)0
-rw-r--r--src/mame/machine/isbc_215g.c (renamed from src/mess/machine/isbc_215g.c)0
-rw-r--r--src/mame/machine/isbc_215g.h (renamed from src/mess/machine/isbc_215g.h)0
-rw-r--r--src/mame/machine/iteagle_fpga.c74
-rw-r--r--src/mame/machine/iteagle_fpga.h2
-rw-r--r--src/mame/machine/jvs13551.c37
-rw-r--r--src/mame/machine/jvs13551.h3
-rw-r--r--src/mame/machine/k7659kb.c (renamed from src/mess/machine/k7659kb.c)0
-rw-r--r--src/mame/machine/k7659kb.h (renamed from src/mess/machine/k7659kb.h)0
-rw-r--r--src/mame/machine/kay_kbd.c (renamed from src/mess/machine/kay_kbd.c)0
-rw-r--r--src/mame/machine/kaypro.c (renamed from src/mess/machine/kaypro.c)0
-rw-r--r--src/mame/machine/kb_7007_3.h (renamed from src/mess/machine/kb_7007_3.h)0
-rw-r--r--src/mame/machine/kb_poisk1.h (renamed from src/mess/machine/kb_poisk1.h)0
-rw-r--r--src/mame/machine/kc.c (renamed from src/mess/machine/kc.c)0
-rw-r--r--src/mame/machine/kc_keyb.c (renamed from src/mess/machine/kc_keyb.c)0
-rw-r--r--src/mame/machine/kc_keyb.h (renamed from src/mess/machine/kc_keyb.h)0
-rw-r--r--src/mame/machine/kramermc.c (renamed from src/mess/machine/kramermc.c)0
-rw-r--r--src/mame/machine/lisa.c (renamed from src/mess/machine/lisa.c)0
-rw-r--r--src/mame/machine/llc.c (renamed from src/mess/machine/llc.c)0
-rw-r--r--src/mame/machine/lviv.c (renamed from src/mess/machine/lviv.c)0
-rw-r--r--src/mame/machine/lynx.c (renamed from src/mess/machine/lynx.c)0
-rw-r--r--src/mame/machine/m1comm.c4
-rw-r--r--src/mame/machine/m20_8086.c (renamed from src/mess/machine/m20_8086.c)0
-rw-r--r--src/mame/machine/m20_8086.h (renamed from src/mess/machine/m20_8086.h)0
-rw-r--r--src/mame/machine/m20_kbd.c (renamed from src/mess/machine/m20_kbd.c)0
-rw-r--r--src/mame/machine/m20_kbd.h (renamed from src/mess/machine/m20_kbd.h)0
-rw-r--r--src/mame/machine/m24_kbd.c (renamed from src/mess/machine/m24_kbd.c)0
-rw-r--r--src/mame/machine/m24_kbd.h (renamed from src/mess/machine/m24_kbd.h)0
-rw-r--r--src/mame/machine/m24_z8000.c (renamed from src/mess/machine/m24_z8000.c)0
-rw-r--r--src/mame/machine/m24_z8000.h (renamed from src/mess/machine/m24_z8000.h)0
-rw-r--r--src/mame/machine/m2comm.c597
-rw-r--r--src/mame/machine/m2comm.h89
-rw-r--r--src/mame/machine/mac.c (renamed from src/mess/machine/mac.c)0
-rw-r--r--src/mame/machine/macadb.c (renamed from src/mess/machine/macadb.c)0
-rw-r--r--src/mame/machine/mackbd.c (renamed from src/mess/machine/mackbd.c)0
-rw-r--r--src/mame/machine/mackbd.h (renamed from src/mess/machine/mackbd.h)0
-rw-r--r--src/mame/machine/macpci.c (renamed from src/mess/machine/macpci.c)0
-rw-r--r--src/mame/machine/macrtc.c (renamed from src/mess/machine/macrtc.c)0
-rw-r--r--src/mame/machine/macrtc.h (renamed from src/mess/machine/macrtc.h)0
-rw-r--r--src/mame/machine/mbc55x.c (renamed from src/mess/machine/mbc55x.c)0
-rw-r--r--src/mame/machine/mbee.c (renamed from src/mess/machine/mbee.c)7
-rw-r--r--src/mame/machine/mboard.c (renamed from src/mess/machine/mboard.c)27
-rw-r--r--src/mame/machine/mc80.c (renamed from src/mess/machine/mc80.c)0
-rw-r--r--src/mame/machine/mc8123.h1
-rw-r--r--src/mame/machine/mega32x.c (renamed from src/mess/machine/mega32x.c)4
-rw-r--r--src/mame/machine/mega32x.h (renamed from src/mess/machine/mega32x.h)0
-rw-r--r--src/mame/machine/megacd.c (renamed from src/mess/machine/megacd.c)0
-rw-r--r--src/mame/machine/megacd.h (renamed from src/mess/machine/megacd.h)0
-rw-r--r--src/mame/machine/megacdcd.c (renamed from src/mess/machine/megacdcd.c)0
-rw-r--r--src/mame/machine/megacdcd.h (renamed from src/mess/machine/megacdcd.h)0
-rw-r--r--src/mame/machine/megadriv.c24
-rw-r--r--src/mame/machine/micro3d.c18
-rw-r--r--src/mame/machine/microdrv.c (renamed from src/mess/machine/microdrv.c)0
-rw-r--r--src/mame/machine/microdrv.h (renamed from src/mess/machine/microdrv.h)0
-rw-r--r--src/mame/machine/micropolis.c (renamed from src/mess/machine/micropolis.c)0
-rw-r--r--src/mame/machine/micropolis.h (renamed from src/mess/machine/micropolis.h)0
-rw-r--r--src/mame/machine/microtan.c (renamed from src/mess/machine/microtan.c)0
-rw-r--r--src/mame/machine/mie.c26
-rw-r--r--src/mame/machine/mie.h1
-rw-r--r--src/mame/machine/mikro80.c (renamed from src/mess/machine/mikro80.c)0
-rw-r--r--src/mame/machine/mm1kb.c (renamed from src/mess/machine/mm1kb.c)35
-rw-r--r--src/mame/machine/mm1kb.h (renamed from src/mess/machine/mm1kb.h)22
-rw-r--r--src/mame/machine/model3.c2
-rw-r--r--src/mame/machine/ms7004.c (renamed from src/mess/machine/ms7004.c)15
-rw-r--r--src/mame/machine/ms7004.h (renamed from src/mess/machine/ms7004.h)0
-rw-r--r--src/mame/machine/msx.c (renamed from src/mess/machine/msx.c)10
-rw-r--r--src/mame/machine/msx_matsushita.c (renamed from src/mess/machine/msx_matsushita.c)0
-rw-r--r--src/mame/machine/msx_matsushita.h (renamed from src/mess/machine/msx_matsushita.h)0
-rw-r--r--src/mame/machine/msx_s1985.c (renamed from src/mess/machine/msx_s1985.c)0
-rw-r--r--src/mame/machine/msx_s1985.h (renamed from src/mess/machine/msx_s1985.h)0
-rw-r--r--src/mame/machine/msx_switched.c (renamed from src/mess/machine/msx_switched.c)0
-rw-r--r--src/mame/machine/msx_switched.h (renamed from src/mess/machine/msx_switched.h)0
-rw-r--r--src/mame/machine/msx_systemflags.c (renamed from src/mess/machine/msx_systemflags.c)0
-rw-r--r--src/mame/machine/msx_systemflags.h (renamed from src/mess/machine/msx_systemflags.h)0
-rw-r--r--src/mame/machine/mtx.c (renamed from src/mess/machine/mtx.c)0
-rw-r--r--src/mame/machine/mz700.c (renamed from src/mess/machine/mz700.c)0
-rw-r--r--src/mame/machine/mz80.c (renamed from src/mess/machine/mz80.c)0
-rw-r--r--src/mame/machine/n64.c137
-rw-r--r--src/mame/machine/namco62.c2
-rw-r--r--src/mame/machine/namco62.h2
-rw-r--r--src/mame/machine/namcond1.c23
-rw-r--r--src/mame/machine/namcos1.c8
-rw-r--r--src/mame/machine/nc.c (renamed from src/mess/machine/nc.c)0
-rw-r--r--src/mame/machine/nes.c (renamed from src/mess/machine/nes.c)0
-rw-r--r--src/mame/machine/nextkbd.c (renamed from src/mess/machine/nextkbd.c)0
-rw-r--r--src/mame/machine/nextkbd.h (renamed from src/mess/machine/nextkbd.h)0
-rw-r--r--src/mame/machine/nextmo.c (renamed from src/mess/machine/nextmo.c)0
-rw-r--r--src/mame/machine/nextmo.h (renamed from src/mess/machine/nextmo.h)0
-rw-r--r--src/mame/machine/ngen_kb.c (renamed from src/mess/machine/ngen_kb.c)0
-rw-r--r--src/mame/machine/ngen_kb.h (renamed from src/mess/machine/ngen_kb.h)0
-rw-r--r--src/mame/machine/nmk004.c2
-rw-r--r--src/mame/machine/ns10crypt.c415
-rw-r--r--src/mame/machine/ns10crypt.h108
-rw-r--r--src/mame/machine/ondra.c (renamed from src/mess/machine/ondra.c)0
-rw-r--r--src/mame/machine/orao.c80
-rw-r--r--src/mame/machine/orion.c (renamed from src/mess/machine/orion.c)2
-rw-r--r--src/mame/machine/osborne1.c (renamed from src/mess/machine/osborne1.c)0
-rw-r--r--src/mame/machine/p2000t.c (renamed from src/mess/machine/p2000t.c)0
-rw-r--r--src/mame/machine/partner.c (renamed from src/mess/machine/partner.c)0
-rw-r--r--src/mame/machine/pc1251.c (renamed from src/mess/machine/pc1251.c)0
-rw-r--r--src/mame/machine/pc1350.c (renamed from src/mess/machine/pc1350.c)0
-rw-r--r--src/mame/machine/pc1401.c (renamed from src/mess/machine/pc1401.c)0
-rw-r--r--src/mame/machine/pc1403.c (renamed from src/mess/machine/pc1403.c)0
-rw-r--r--src/mame/machine/pc1512kb.c (renamed from src/mess/machine/pc1512kb.c)0
-rw-r--r--src/mame/machine/pc1512kb.h (renamed from src/mess/machine/pc1512kb.h)0
-rw-r--r--src/mame/machine/pc9801_118.c (renamed from src/mess/machine/pc9801_118.c)0
-rw-r--r--src/mame/machine/pc9801_118.h (renamed from src/mess/machine/pc9801_118.h)0
-rw-r--r--src/mame/machine/pc9801_26.c (renamed from src/mess/machine/pc9801_26.c)0
-rw-r--r--src/mame/machine/pc9801_26.h (renamed from src/mess/machine/pc9801_26.h)0
-rw-r--r--src/mame/machine/pc9801_86.c (renamed from src/mess/machine/pc9801_86.c)0
-rw-r--r--src/mame/machine/pc9801_86.h (renamed from src/mess/machine/pc9801_86.h)0
-rw-r--r--src/mame/machine/pc9801_cbus.c (renamed from src/mess/machine/pc9801_cbus.c)0
-rw-r--r--src/mame/machine/pc9801_cbus.h (renamed from src/mess/machine/pc9801_cbus.h)0
-rw-r--r--src/mame/machine/pc9801_kbd.c (renamed from src/mess/machine/pc9801_kbd.c)0
-rw-r--r--src/mame/machine/pc9801_kbd.h (renamed from src/mess/machine/pc9801_kbd.h)0
-rw-r--r--src/mame/machine/pcd_kbd.c (renamed from src/mess/machine/pcd_kbd.c)9
-rw-r--r--src/mame/machine/pcd_kbd.h (renamed from src/mess/machine/pcd_kbd.h)0
-rw-r--r--src/mame/machine/pce.c (renamed from src/mess/machine/pce.c)16
-rw-r--r--src/mame/machine/pce220_ser.c (renamed from src/mess/machine/pce220_ser.c)0
-rw-r--r--src/mame/machine/pce220_ser.h (renamed from src/mess/machine/pce220_ser.h)0
-rw-r--r--src/mame/machine/pce_cd.c (renamed from src/mess/machine/pce_cd.c)7
-rw-r--r--src/mame/machine/pce_cd.h (renamed from src/mess/machine/pce_cd.h)2
-rw-r--r--src/mame/machine/pecom.c (renamed from src/mess/machine/pecom.c)0
-rw-r--r--src/mame/machine/pgmcrypt.c185
-rw-r--r--src/mame/machine/pgmcrypt.h4
-rw-r--r--src/mame/machine/pgmprot_orlegend.c13
-rw-r--r--src/mame/machine/pk8020.c (renamed from src/mess/machine/pk8020.c)0
-rw-r--r--src/mame/machine/pmd85.c (renamed from src/mess/machine/pmd85.c)0
-rw-r--r--src/mame/machine/poly88.c (renamed from src/mess/machine/poly88.c)0
-rw-r--r--src/mame/machine/pp01.c (renamed from src/mess/machine/pp01.c)0
-rw-r--r--src/mame/machine/primo.c (renamed from src/mess/machine/primo.c)0
-rw-r--r--src/mame/machine/prof80mmu.c (renamed from src/mess/machine/prof80mmu.c)0
-rw-r--r--src/mame/machine/prof80mmu.h (renamed from src/mess/machine/prof80mmu.h)0
-rw-r--r--src/mame/machine/psion_pack.c (renamed from src/mess/machine/psion_pack.c)0
-rw-r--r--src/mame/machine/psion_pack.h (renamed from src/mess/machine/psion_pack.h)0
-rw-r--r--src/mame/machine/psxcd.c (renamed from src/mess/machine/psxcd.c)0
-rw-r--r--src/mame/machine/psxcd.h (renamed from src/mess/machine/psxcd.h)0
-rw-r--r--src/mame/machine/pxa255.h2
-rw-r--r--src/mame/machine/qimi.c (renamed from src/mess/machine/qimi.c)0
-rw-r--r--src/mame/machine/qimi.h (renamed from src/mess/machine/qimi.h)0
-rw-r--r--src/mame/machine/qx10kbd.c (renamed from src/mess/machine/qx10kbd.c)0
-rw-r--r--src/mame/machine/qx10kbd.h (renamed from src/mess/machine/qx10kbd.h)0
-rw-r--r--src/mame/machine/radio86.c (renamed from src/mess/machine/radio86.c)0
-rw-r--r--src/mame/machine/raiden2cop.c10
-rw-r--r--src/mame/machine/rbisland.c (renamed from src/mame/machine/rainbow.c)2
-rw-r--r--src/mame/machine/rm380z.c (renamed from src/mess/machine/rm380z.c)0
-rw-r--r--src/mame/machine/rmnimbus.c (renamed from src/mess/machine/rmnimbus.c)10
-rw-r--r--src/mame/machine/rmnkbd.c (renamed from src/mess/machine/rmnkbd.c)0
-rw-r--r--src/mame/machine/rmnkbd.h (renamed from src/mess/machine/rmnkbd.h)0
-rw-r--r--src/mame/machine/rx01.c (renamed from src/mess/machine/rx01.c)0
-rw-r--r--src/mame/machine/rx01.h (renamed from src/mess/machine/rx01.h)0
-rw-r--r--src/mame/machine/s32comm.c142
-rw-r--r--src/mame/machine/s32comm.h18
-rw-r--r--src/mame/machine/samcoupe.c (renamed from src/mess/machine/samcoupe.c)18
-rw-r--r--src/mame/machine/scramble.c17
-rw-r--r--src/mame/machine/segacrp2.c2
-rw-r--r--src/mame/machine/segacrp2.h2
-rw-r--r--src/mame/machine/sgi.c (renamed from src/mess/machine/sgi.c)0
-rw-r--r--src/mame/machine/sgi.h (renamed from src/mess/machine/sgi.h)0
-rw-r--r--src/mame/machine/slikshot.c4
-rw-r--r--src/mame/machine/smartmed.c (renamed from src/mess/machine/smartmed.c)0
-rw-r--r--src/mame/machine/smartmed.h (renamed from src/mess/machine/smartmed.h)0
-rw-r--r--src/mame/machine/sms.c (renamed from src/mess/machine/sms.c)70
-rw-r--r--src/mame/machine/snes.c6
-rw-r--r--src/mame/machine/snescx4.c (renamed from src/mess/machine/snescx4.c)0
-rw-r--r--src/mame/machine/snescx4.h (renamed from src/mess/machine/snescx4.h)0
-rw-r--r--src/mame/machine/sonydriv.c (renamed from src/mess/machine/sonydriv.c)0
-rw-r--r--src/mame/machine/sonydriv.h (renamed from src/mess/machine/sonydriv.h)0
-rw-r--r--src/mame/machine/sorcerer.c (renamed from src/mess/machine/sorcerer.c)13
-rw-r--r--src/mame/machine/spec_snqk.c (renamed from src/mess/machine/spec_snqk.c)169
-rw-r--r--src/mame/machine/spec_snqk.h (renamed from src/mess/machine/spec_snqk.h)0
-rw-r--r--src/mame/machine/special.c (renamed from src/mess/machine/special.c)0
-rw-r--r--src/mame/machine/super80.c (renamed from src/mess/machine/super80.c)4
-rw-r--r--src/mame/machine/svi318.c (renamed from src/mess/machine/svi318.c)0
-rw-r--r--src/mame/machine/swim.c (renamed from src/mess/machine/swim.c)0
-rw-r--r--src/mame/machine/swim.h (renamed from src/mess/machine/swim.h)0
-rw-r--r--src/mame/machine/swtpc09.c (renamed from src/mess/machine/swtpc09.c)0
-rw-r--r--src/mame/machine/tandy2kb.c (renamed from src/mess/machine/tandy2kb.c)0
-rw-r--r--src/mame/machine/tandy2kb.h (renamed from src/mess/machine/tandy2kb.h)0
-rw-r--r--src/mame/machine/teleprinter.c (renamed from src/mess/machine/teleprinter.c)0
-rw-r--r--src/mame/machine/teleprinter.h (renamed from src/mess/machine/teleprinter.h)0
-rw-r--r--src/mame/machine/thomflop.c (renamed from src/mess/machine/thomflop.c)14
-rw-r--r--src/mame/machine/thomflop.h (renamed from src/mess/machine/thomflop.h)0
-rw-r--r--src/mame/machine/thomson.c (renamed from src/mess/machine/thomson.c)459
-rw-r--r--src/mame/machine/ti85.c (renamed from src/mess/machine/ti85.c)0
-rw-r--r--src/mame/machine/tnzs.c40
-rw-r--r--src/mame/machine/trs80.c (renamed from src/mess/machine/trs80.c)0
-rw-r--r--src/mame/machine/trs80m2kb.c (renamed from src/mess/machine/trs80m2kb.c)0
-rw-r--r--src/mame/machine/trs80m2kb.h (renamed from src/mess/machine/trs80m2kb.h)0
-rw-r--r--src/mame/machine/upd65031.c (renamed from src/mess/machine/upd65031.c)0
-rw-r--r--src/mame/machine/upd65031.h (renamed from src/mess/machine/upd65031.h)0
-rw-r--r--src/mame/machine/ut88.c (renamed from src/mess/machine/ut88.c)0
-rw-r--r--src/mame/machine/v1050kb.c (renamed from src/mess/machine/v1050kb.c)0
-rw-r--r--src/mame/machine/v1050kb.h (renamed from src/mess/machine/v1050kb.h)0
-rw-r--r--src/mame/machine/vector06.c (renamed from src/mess/machine/vector06.c)42
-rw-r--r--src/mame/machine/victor9k_fdc.c (renamed from src/mess/machine/victor9k_fdc.c)0
-rw-r--r--src/mame/machine/victor9k_fdc.h (renamed from src/mess/machine/victor9k_fdc.h)0
-rw-r--r--src/mame/machine/victor9kb.c (renamed from src/mess/machine/victor9kb.c)32
-rw-r--r--src/mame/machine/victor9kb.h (renamed from src/mess/machine/victor9kb.h)0
-rw-r--r--src/mame/machine/vtech2.c (renamed from src/mess/machine/vtech2.c)0
-rw-r--r--src/mame/machine/wangpckb.c (renamed from src/mess/machine/wangpckb.c)0
-rw-r--r--src/mame/machine/wangpckb.h (renamed from src/mess/machine/wangpckb.h)0
-rw-r--r--src/mame/machine/wswan.c (renamed from src/mess/machine/wswan.c)0
-rw-r--r--src/mame/machine/x1.c (renamed from src/mess/machine/x1.c)0
-rw-r--r--src/mame/machine/x68k_hdc.c (renamed from src/mess/machine/x68k_hdc.c)0
-rw-r--r--src/mame/machine/x68k_hdc.h (renamed from src/mess/machine/x68k_hdc.h)0
-rw-r--r--src/mame/machine/x68k_kbd.c (renamed from src/mess/machine/x68k_kbd.c)0
-rw-r--r--src/mame/machine/x68k_kbd.h (renamed from src/mess/machine/x68k_kbd.h)0
-rw-r--r--src/mame/machine/x820kb.c (renamed from src/mess/machine/x820kb.c)0
-rw-r--r--src/mame/machine/x820kb.h (renamed from src/mess/machine/x820kb.h)0
-rw-r--r--src/mame/machine/xbox.c1542
-rw-r--r--src/mame/machine/z80bin.c (renamed from src/mess/machine/z80bin.c)4
-rw-r--r--src/mame/machine/z80bin.h (renamed from src/mess/machine/z80bin.h)2
-rw-r--r--src/mame/machine/z80ne.c (renamed from src/mess/machine/z80ne.c)0
-rw-r--r--src/mame/machine/zx.c (renamed from src/mess/machine/zx.c)0
-rw-r--r--src/mame/machine/zx8302.c (renamed from src/mess/machine/zx8302.c)0
-rw-r--r--src/mame/machine/zx8302.h (renamed from src/mess/machine/zx8302.h)0
-rw-r--r--src/mame/mame.mak10
-rw-r--r--src/mame/mess.lst90
-rw-r--r--src/mame/osd/windows/mame/mame.man7
-rw-r--r--src/mame/osd/windows/mess/mess.man7
-rw-r--r--src/mame/video/4enraya.c7
-rw-r--r--src/mame/video/733_asr.c (renamed from src/mess/video/733_asr.c)0
-rw-r--r--src/mame/video/733_asr.h (renamed from src/mess/video/733_asr.h)0
-rw-r--r--src/mame/video/8080bw.c214
-rw-r--r--src/mame/video/88games.c12
-rw-r--r--src/mame/video/911_chr.h (renamed from src/mess/video/911_chr.h)0
-rw-r--r--src/mame/video/911_key.h (renamed from src/mess/video/911_key.h)0
-rw-r--r--src/mame/video/911_vdt.c (renamed from src/mess/video/911_vdt.c)0
-rw-r--r--src/mame/video/911_vdt.h (renamed from src/mess/video/911_vdt.h)0
-rw-r--r--src/mame/video/abc1600.c (renamed from src/mess/video/abc1600.c)0
-rw-r--r--src/mame/video/abc1600.h (renamed from src/mess/video/abc1600.h)0
-rw-r--r--src/mame/video/abc80.c (renamed from src/mess/video/abc80.c)0
-rw-r--r--src/mame/video/abc800.c (renamed from src/mess/video/abc800.c)0
-rw-r--r--src/mame/video/abc802.c (renamed from src/mess/video/abc802.c)0
-rw-r--r--src/mame/video/abc806.c (renamed from src/mess/video/abc806.c)0
-rw-r--r--src/mame/video/ac1.c (renamed from src/mess/video/ac1.c)0
-rw-r--r--src/mame/video/advision.c (renamed from src/mess/video/advision.c)0
-rw-r--r--src/mame/video/aerofgt.c2
-rw-r--r--src/mame/video/ajax.c40
-rw-r--r--src/mame/video/alesis.c (renamed from src/mess/video/alesis.c)0
-rw-r--r--src/mame/video/aliens.c35
-rw-r--r--src/mame/video/amiga.c10
-rw-r--r--src/mame/video/amspdwy.c5
-rw-r--r--src/mame/video/antic.c9
-rw-r--r--src/mame/video/antic.h3
-rw-r--r--src/mame/video/apollo.c (renamed from src/mess/video/apollo.c)0
-rw-r--r--src/mame/video/apple1.c (renamed from src/mess/video/apple1.c)0
-rw-r--r--src/mame/video/apple2.c (renamed from src/mess/video/apple2.c)69
-rw-r--r--src/mame/video/apple2.h (renamed from src/mess/video/apple2.h)2
-rw-r--r--src/mame/video/apple2gs.c (renamed from src/mess/video/apple2gs.c)0
-rw-r--r--src/mame/video/apple3.c (renamed from src/mess/video/apple3.c)0
-rw-r--r--src/mame/video/aquarius.c (renamed from src/mess/video/aquarius.c)0
-rw-r--r--src/mame/video/arcadia.c (renamed from src/mess/video/arcadia.c)0
-rw-r--r--src/mame/video/astrocde.c27
-rw-r--r--src/mame/video/atarimo.c14
-rw-r--r--src/mame/video/atarist.c (renamed from src/mess/video/atarist.c)0
-rw-r--r--src/mame/video/atarist.h (renamed from src/mess/video/atarist.h)0
-rw-r--r--src/mame/video/atarisy2.c30
-rw-r--r--src/mame/video/aussiebyte.c196
-rw-r--r--src/mame/video/avgdvg.c4
-rw-r--r--src/mame/video/avgdvg.h2
-rw-r--r--src/mame/video/avigo.c (renamed from src/mess/video/avigo.c)0
-rw-r--r--src/mame/video/b2m.c (renamed from src/mess/video/b2m.c)0
-rw-r--r--src/mame/video/battlnts.c2
-rw-r--r--src/mame/video/bbc.c (renamed from src/mess/video/bbc.c)36
-rw-r--r--src/mame/video/bionicc.c39
-rw-r--r--src/mame/video/bk.c (renamed from src/mess/video/bk.c)0
-rw-r--r--src/mame/video/bladestl.c2
-rw-r--r--src/mame/video/blockhl.c62
-rw-r--r--src/mame/video/bogeyman.c6
-rw-r--r--src/mame/video/bottom9.c48
-rw-r--r--src/mame/video/btime.c9
-rw-r--r--src/mame/video/busicom.c (renamed from src/mess/video/busicom.c)0
-rw-r--r--src/mame/video/cgc7900.c (renamed from src/mess/video/cgc7900.c)0
-rw-r--r--src/mame/video/channelf.c (renamed from src/mess/video/channelf.c)0
-rw-r--r--src/mame/video/chihiro.c546
-rw-r--r--src/mame/video/chqflag.c34
-rw-r--r--src/mame/video/comquest.c (renamed from src/mess/video/comquest.c)0
-rw-r--r--src/mame/video/comx35.c (renamed from src/mess/video/comx35.c)0
-rw-r--r--src/mame/video/cps1.c26
-rw-r--r--src/mame/video/crimfght.c58
-rw-r--r--src/mame/video/crt.c (renamed from src/mess/video/crt.c)0
-rw-r--r--src/mame/video/crt.h (renamed from src/mess/video/crt.h)0
-rw-r--r--src/mame/video/dai.c (renamed from src/mess/video/dai.c)0
-rw-r--r--src/mame/video/deco16ic.c21
-rw-r--r--src/mame/video/deco32.c10
-rw-r--r--src/mame/video/dgn_beta.c (renamed from src/mess/video/dgn_beta.c)0
-rw-r--r--src/mame/video/dynduke.c7
-rw-r--r--src/mame/video/electron.c (renamed from src/mess/video/electron.c)0
-rw-r--r--src/mame/video/fm7.c (renamed from src/mess/video/fm7.c)56
-rw-r--r--src/mame/video/fmtowns.c (renamed from src/mess/video/fmtowns.c)0
-rw-r--r--src/mame/video/galastrm.c144
-rw-r--r--src/mame/video/galaxian.c19
-rw-r--r--src/mame/video/galaxold.c13
-rw-r--r--src/mame/video/galaxy.c (renamed from src/mess/video/galaxy.c)0
-rw-r--r--src/mame/video/galeb.c (renamed from src/mess/video/galeb.c)0
-rw-r--r--src/mame/video/galpanic.c11
-rw-r--r--src/mame/video/gamecom.c (renamed from src/mess/video/gamecom.c)0
-rw-r--r--src/mame/video/gb_lcd.c (renamed from src/mess/video/gb_lcd.c)0
-rw-r--r--src/mame/video/gb_lcd.h (renamed from src/mess/video/gb_lcd.h)0
-rw-r--r--src/mame/video/gba.c (renamed from src/mess/video/gba.c)2
-rw-r--r--src/mame/video/gime.c (renamed from src/mess/video/gime.c)0
-rw-r--r--src/mame/video/gime.h (renamed from src/mess/video/gime.h)0
-rw-r--r--src/mame/video/gradius3.c29
-rw-r--r--src/mame/video/gtia.c2
-rw-r--r--src/mame/video/hec2video.c (renamed from src/mess/video/hec2video.c)0
-rw-r--r--src/mame/video/hexion.c2
-rw-r--r--src/mame/video/hng64.c890
-rw-r--r--src/mame/video/hng64_3d.c1298
-rw-r--r--src/mame/video/hng64_sprite.c2
-rw-r--r--src/mame/video/hp48.c (renamed from src/mess/video/hp48.c)0
-rw-r--r--src/mame/video/igs017_igs031.c448
-rw-r--r--src/mame/video/igs017_igs031.h106
-rw-r--r--src/mame/video/intv.c (renamed from src/mess/video/intv.c)0
-rw-r--r--src/mame/video/itech8.c5
-rw-r--r--src/mame/video/jack.c6
-rw-r--r--src/mame/video/k051960.c107
-rw-r--r--src/mame/video/k051960.h33
-rw-r--r--src/mame/video/k052109.c48
-rw-r--r--src/mame/video/k052109.h23
-rw-r--r--src/mame/video/k057714.c737
-rw-r--r--src/mame/video/k057714.h69
-rw-r--r--src/mame/video/k1ge.c (renamed from src/mess/video/k1ge.c)0
-rw-r--r--src/mame/video/k1ge.h (renamed from src/mess/video/k1ge.h)0
-rw-r--r--src/mame/video/kangaroo.c9
-rw-r--r--src/mame/video/kaypro.c (renamed from src/mess/video/kaypro.c)0
-rw-r--r--src/mame/video/kc.c (renamed from src/mess/video/kc.c)0
-rw-r--r--src/mame/video/konamigx.c32
-rw-r--r--src/mame/video/kramermc.c (renamed from src/mess/video/kramermc.c)0
-rw-r--r--src/mame/video/kyocera.c (renamed from src/mess/video/kyocera.c)0
-rw-r--r--src/mame/video/lethalj.c13
-rw-r--r--src/mame/video/liberate.c8
-rw-r--r--src/mame/video/llc.c (renamed from src/mess/video/llc.c)0
-rw-r--r--src/mame/video/lviv.c (renamed from src/mess/video/lviv.c)0
-rw-r--r--src/mame/video/lwings.c12
-rw-r--r--src/mame/video/m72.c218
-rw-r--r--src/mame/video/mac.c (renamed from src/mess/video/mac.c)4
-rw-r--r--src/mame/video/macrossp.c317
-rw-r--r--src/mame/video/mainevt.c34
-rw-r--r--src/mame/video/maria.c (renamed from src/mess/video/maria.c)0
-rw-r--r--src/mame/video/maria.h (renamed from src/mess/video/maria.h)0
-rw-r--r--src/mame/video/mbc55x.c (renamed from src/mess/video/mbc55x.c)0
-rw-r--r--src/mame/video/mbee.c (renamed from src/mess/video/mbee.c)0
-rw-r--r--src/mame/video/mc80.c (renamed from src/mess/video/mc80.c)0
-rw-r--r--src/mame/video/mcd212.c4
-rw-r--r--src/mame/video/mcd212.h2
-rw-r--r--src/mame/video/mcr68.c27
-rw-r--r--src/mame/video/micro3d.c9
-rw-r--r--src/mame/video/microtan.c (renamed from src/mess/video/microtan.c)0
-rw-r--r--src/mame/video/midtunit.c14
-rw-r--r--src/mame/video/midzeus.c579
-rw-r--r--src/mame/video/midzeus2.c131
-rw-r--r--src/mame/video/mikro80.c (renamed from src/mess/video/mikro80.c)0
-rw-r--r--src/mame/video/mikromik.c (renamed from src/mess/video/mikromik.c)58
-rw-r--r--src/mame/video/model2.c216
-rw-r--r--src/mame/video/model2rd.inc52
-rw-r--r--src/mame/video/model3.c153
-rw-r--r--src/mame/video/mz700.c (renamed from src/mess/video/mz700.c)0
-rw-r--r--src/mame/video/mz80.c (renamed from src/mess/video/mz80.c)0
-rw-r--r--src/mame/video/n64.c255
-rw-r--r--src/mame/video/n64.h11
-rw-r--r--src/mame/video/n64types.h2
-rw-r--r--src/mame/video/namcona1.c47
-rw-r--r--src/mame/video/namcos22.c4
-rw-r--r--src/mame/video/naughtyb.c2
-rw-r--r--src/mame/video/nbmj9195.c6
-rw-r--r--src/mame/video/nc.c (renamed from src/mess/video/nc.c)0
-rw-r--r--src/mame/video/nes.c (renamed from src/mess/video/nes.c)23
-rw-r--r--src/mame/video/newbrain.c (renamed from src/mess/video/newbrain.c)0
-rw-r--r--src/mame/video/newport.c (renamed from src/mess/video/newport.c)0
-rw-r--r--src/mame/video/newport.h (renamed from src/mess/video/newport.h)0
-rw-r--r--src/mame/video/nick.c (renamed from src/mess/video/nick.c)0
-rw-r--r--src/mame/video/nick.h (renamed from src/mess/video/nick.h)0
-rw-r--r--src/mame/video/nova2001.c10
-rw-r--r--src/mame/video/ondra.c (renamed from src/mess/video/ondra.c)0
-rw-r--r--src/mame/video/orao.c (renamed from src/mess/video/orao.c)0
-rw-r--r--src/mame/video/orion.c (renamed from src/mess/video/orion.c)0
-rw-r--r--src/mame/video/osi.c (renamed from src/mess/video/osi.c)0
-rw-r--r--src/mame/video/p2000m.c (renamed from src/mess/video/p2000m.c)0
-rw-r--r--src/mame/video/pc080sn.c1
-rw-r--r--src/mame/video/pc090oj.c1
-rw-r--r--src/mame/video/pc1251.c (renamed from src/mess/video/pc1251.c)0
-rw-r--r--src/mame/video/pc1350.c (renamed from src/mess/video/pc1350.c)0
-rw-r--r--src/mame/video/pc1401.c (renamed from src/mess/video/pc1401.c)0
-rw-r--r--src/mame/video/pc1403.c (renamed from src/mess/video/pc1403.c)0
-rw-r--r--src/mame/video/pc1512.c (renamed from src/mess/video/pc1512.c)0
-rw-r--r--src/mame/video/pc4.c (renamed from src/mess/video/pc4.c)0
-rw-r--r--src/mame/video/pc8401a.c (renamed from src/mess/video/pc8401a.c)0
-rw-r--r--src/mame/video/pc_t1t.c (renamed from src/mess/video/pc_t1t.c)0
-rw-r--r--src/mame/video/pc_t1t.h (renamed from src/mess/video/pc_t1t.h)0
-rw-r--r--src/mame/video/pcd.c486
-rw-r--r--src/mame/video/pcd.h117
-rw-r--r--src/mame/video/pcw.c (renamed from src/mess/video/pcw.c)0
-rw-r--r--src/mame/video/pcw16.c (renamed from src/mess/video/pcw16.c)0
-rw-r--r--src/mame/video/pdp1.c (renamed from src/mess/video/pdp1.c)3
-rw-r--r--src/mame/video/pecom.c (renamed from src/mess/video/pecom.c)0
-rw-r--r--src/mame/video/pk8020.c (renamed from src/mess/video/pk8020.c)0
-rw-r--r--src/mame/video/pocketc.c (renamed from src/mess/video/pocketc.c)0
-rw-r--r--src/mame/video/poisk1.c (renamed from src/mess/video/poisk1.c)0
-rw-r--r--src/mame/video/poisk1.h (renamed from src/mess/video/poisk1.h)0
-rw-r--r--src/mame/video/poly88.c (renamed from src/mess/video/poly88.c)0
-rw-r--r--src/mame/video/powervr2.c5
-rw-r--r--src/mame/video/powervr2.h1
-rw-r--r--src/mame/video/pp01.c (renamed from src/mess/video/pp01.c)0
-rw-r--r--src/mame/video/primo.c (renamed from src/mess/video/primo.c)0
-rw-r--r--src/mame/video/rbisland.c (renamed from src/mame/video/rainbow.c)2
-rw-r--r--src/mame/video/rdpbhelp.h13
-rw-r--r--src/mame/video/rdpblend.c3
-rw-r--r--src/mame/video/rdpblend.h2
-rw-r--r--src/mame/video/rdptpipe.c25
-rw-r--r--src/mame/video/rdptpipe.h2
-rw-r--r--src/mame/video/rm380z.c (renamed from src/mess/video/rm380z.c)0
-rw-r--r--src/mame/video/rmnimbus.c (renamed from src/mess/video/rmnimbus.c)0
-rw-r--r--src/mame/video/rockrage.c2
-rw-r--r--src/mame/video/rollerg.c18
-rw-r--r--src/mame/video/route16.c50
-rw-r--r--src/mame/video/samcoupe.c (renamed from src/mess/video/samcoupe.c)0
-rw-r--r--src/mame/video/sega16sp.c36
-rw-r--r--src/mame/video/sega16sp.h19
-rw-r--r--src/mame/video/segaic16.c86
-rw-r--r--src/mame/video/segaic16_road.c12
-rw-r--r--src/mame/video/segaic16_road.h2
-rw-r--r--src/mame/video/segas32.c4
-rw-r--r--src/mame/video/segaxbd.c6
-rw-r--r--src/mame/video/senjyo.c90
-rw-r--r--src/mame/video/seta.c9
-rw-r--r--src/mame/video/shadfrce.c56
-rw-r--r--src/mame/video/special.c (renamed from src/mess/video/special.c)0
-rw-r--r--src/mame/video/spectrum.c (renamed from src/mess/video/spectrum.c)0
-rw-r--r--src/mame/video/spy.c30
-rw-r--r--src/mame/video/ssystem3.c (renamed from src/mess/video/ssystem3.c)4
-rw-r--r--src/mame/video/starcrus.c2
-rw-r--r--src/mame/video/stic.c (renamed from src/mess/video/stic.c)0
-rw-r--r--src/mame/video/stic.h (renamed from src/mess/video/stic.h)0
-rw-r--r--src/mame/video/suna8.c261
-rw-r--r--src/mame/video/super80.c (renamed from src/mess/video/super80.c)0
-rw-r--r--src/mame/video/superqix.c9
-rw-r--r--src/mame/video/system1.c48
-rw-r--r--src/mame/video/taitoair.c32
-rw-r--r--src/mame/video/tank8.c18
-rw-r--r--src/mame/video/tc0100scn.c1
-rw-r--r--src/mame/video/tc0110pcr.c1
-rw-r--r--src/mame/video/tc0150rod.c1
-rw-r--r--src/mame/video/tc0180vcu.c1
-rw-r--r--src/mame/video/tc0280grd.c1
-rw-r--r--src/mame/video/tc0360pri.c1
-rw-r--r--src/mame/video/tc0480scp.c1
-rw-r--r--src/mame/video/tecmo_spr.c13
-rw-r--r--src/mame/video/tecmo_spr.h6
-rw-r--r--src/mame/video/thomson.c (renamed from src/mess/video/thomson.c)12
-rw-r--r--src/mame/video/thunderx.c4
-rw-r--r--src/mame/video/ti85.c (renamed from src/mess/video/ti85.c)0
-rw-r--r--src/mame/video/timex.c (renamed from src/mess/video/timex.c)0
-rw-r--r--src/mame/video/tmc1800.c (renamed from src/mess/video/tmc1800.c)0
-rw-r--r--src/mame/video/tmc600.c (renamed from src/mess/video/tmc600.c)0
-rw-r--r--src/mame/video/trs80.c (renamed from src/mess/video/trs80.c)0
-rw-r--r--src/mame/video/tutankhm.c32
-rw-r--r--src/mame/video/tx0.c (renamed from src/mess/video/tx0.c)2
-rw-r--r--src/mame/video/ultraman.c40
-rw-r--r--src/mame/video/ut88.c (renamed from src/mess/video/ut88.c)0
-rw-r--r--src/mame/video/uv201.c (renamed from src/mess/video/uv201.c)0
-rw-r--r--src/mame/video/uv201.h (renamed from src/mess/video/uv201.h)0
-rw-r--r--src/mame/video/v1050.c (renamed from src/mess/video/v1050.c)0
-rw-r--r--src/mame/video/vc4000.c (renamed from src/mess/video/vc4000.c)2
-rw-r--r--src/mame/video/vector06.c (renamed from src/mess/video/vector06.c)0
-rw-r--r--src/mame/video/vicdual.c2
-rw-r--r--src/mame/video/vsystem_spr.c6
-rw-r--r--src/mame/video/vtech2.c (renamed from src/mess/video/vtech2.c)0
-rw-r--r--src/mame/video/vtvideo.c (renamed from src/mess/video/vtvideo.c)0
-rw-r--r--src/mame/video/vtvideo.h (renamed from src/mess/video/vtvideo.h)0
-rw-r--r--src/mame/video/wswan_video.c (renamed from src/mess/video/wswan_video.c)0
-rw-r--r--src/mame/video/wswan_video.h (renamed from src/mess/video/wswan_video.h)0
-rw-r--r--src/mame/video/x68k.c (renamed from src/mess/video/x68k.c)0
-rw-r--r--src/mame/video/xxmissio.c9
-rw-r--r--src/mame/video/z88.c (renamed from src/mess/video/z88.c)0
-rw-r--r--src/mame/video/zx.c (renamed from src/mess/video/zx.c)0
-rw-r--r--src/mame/video/zx8301.c (renamed from src/mess/video/zx8301.c)0
-rw-r--r--src/mame/video/zx8301.h (renamed from src/mess/video/zx8301.h)0
-rw-r--r--src/mess/drivers/arcadia.c842
-rw-r--r--src/mess/drivers/bcs3.c528
-rw-r--r--src/mess/drivers/br8641.c64
-rw-r--r--src/mess/drivers/camplynx.c660
-rw-r--r--src/mess/drivers/daruma.c169
-rw-r--r--src/mess/drivers/eti660.c244
-rw-r--r--src/mess/drivers/i7000.c401
-rw-r--r--src/mess/drivers/mephisto.c566
-rw-r--r--src/mess/drivers/rainbow.c2465
-rw-r--r--src/mess/drivers/rambo.c227
-rw-r--r--src/mess/drivers/replicator.c751
-rw-r--r--src/mess/drivers/xbox.c224
-rw-r--r--src/mess/includes/ace.h80
-rw-r--r--src/mess/layout/4004clk.lay18
-rw-r--r--src/mess/layout/aim65.lay100
-rw-r--r--src/mess/layout/supercon.lay18
-rw-r--r--src/mess/layout/tb303.lay20
-rw-r--r--src/mess/machine/orao.c79
-rw-r--r--src/mess/machine/ti99/speech8.c163
-rw-r--r--src/mess/machine/ti99/speech8.h67
-rw-r--r--src/mess/video/pmd85.c69
-rw-r--r--src/osd/modules/debugger/osx/debugview.m3
-rw-r--r--src/osd/modules/debugger/osx/debugwindowhandler.m3
-rw-r--r--src/osd/modules/debugger/osx/pointsviewer.m4
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.c24
-rw-r--r--src/osd/modules/debugger/win/debugwininfo.c8
-rw-r--r--src/osd/modules/debugger/win/editwininfo.c4
-rw-r--r--src/osd/modules/netdev/pcap.c9
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.c2
-rw-r--r--src/osd/modules/render/drawbgfx.c6
-rw-r--r--src/osd/modules/render/drawogl.c3
-rw-r--r--src/osd/osdcomm.h2
-rw-r--r--src/osd/osdcore.h19
-rw-r--r--src/osd/osdmini/minifile.c28
-rw-r--r--src/osd/sdl/input.c7
-rw-r--r--src/osd/sdl/man/castool.12
-rw-r--r--src/osd/sdl/man/chdman.12
-rw-r--r--src/osd/sdl/man/floptool.12
-rw-r--r--src/osd/sdl/man/imgtool.12
-rw-r--r--src/osd/sdl/man/jedutil.12
-rw-r--r--src/osd/sdl/man/ldresample.12
-rw-r--r--src/osd/sdl/man/ldverify.12
-rw-r--r--src/osd/sdl/man/mame.62
-rw-r--r--src/osd/sdl/man/romcmp.12
-rw-r--r--src/osd/sdl/man/testkeys.12
-rw-r--r--src/osd/sdl/sdlfile.c19
-rw-r--r--src/osd/sdl/sdlfile.h1
-rw-r--r--src/osd/sdl/sdlptty_os2.c5
-rw-r--r--src/osd/sdl/sdlptty_unix.c124
-rw-r--r--src/osd/windows/input.c45
-rw-r--r--src/osd/windows/output.c8
-rw-r--r--src/osd/windows/window.c8
-rw-r--r--src/osd/windows/winfile.c8
-rw-r--r--src/osd/windows/winmain.c3
-rw-r--r--src/osd/windows/winmain.h2
-rw-r--r--src/osd/windows/winutil.c13
-rw-r--r--src/osd/windows/winutil.h1
-rw-r--r--src/tools/castool.c (renamed from src/mess/tools/castool/main.c)0
-rw-r--r--src/tools/floptool.c (renamed from src/mess/tools/floptool/main.c)0
-rw-r--r--src/tools/imgtool/charconv.c (renamed from src/mess/tools/imgtool/charconv.c)0
-rw-r--r--src/tools/imgtool/charconv.h (renamed from src/mess/tools/imgtool/charconv.h)0
-rw-r--r--src/tools/imgtool/filtbas.c (renamed from src/mess/tools/imgtool/filtbas.c)0
-rw-r--r--src/tools/imgtool/filteoln.c (renamed from src/mess/tools/imgtool/filteoln.c)0
-rw-r--r--src/tools/imgtool/filter.c (renamed from src/mess/tools/imgtool/filter.c)0
-rw-r--r--src/tools/imgtool/filter.h (renamed from src/mess/tools/imgtool/filter.h)0
-rw-r--r--src/tools/imgtool/formats/coco_dsk.c (renamed from src/mess/tools/imgtool/formats/coco_dsk.c)0
-rw-r--r--src/tools/imgtool/formats/coco_dsk.h (renamed from src/mess/tools/imgtool/formats/coco_dsk.h)0
-rw-r--r--src/tools/imgtool/formats/vt_dsk.c (renamed from src/mess/tools/imgtool/formats/vt_dsk.c)0
-rw-r--r--src/tools/imgtool/formats/vt_dsk.h (renamed from src/mess/tools/imgtool/formats/vt_dsk.h)0
-rw-r--r--src/tools/imgtool/iflopimg.c (renamed from src/mess/tools/imgtool/iflopimg.c)0
-rw-r--r--src/tools/imgtool/iflopimg.h (renamed from src/mess/tools/imgtool/iflopimg.h)0
-rw-r--r--src/tools/imgtool/imghd.c (renamed from src/mess/tools/imgtool/imghd.c)0
-rw-r--r--src/tools/imgtool/imghd.h (renamed from src/mess/tools/imgtool/imghd.h)0
-rw-r--r--src/tools/imgtool/imgterrs.c (renamed from src/mess/tools/imgtool/imgterrs.c)0
-rw-r--r--src/tools/imgtool/imgterrs.h (renamed from src/mess/tools/imgtool/imgterrs.h)0
-rw-r--r--src/tools/imgtool/imgtool.c (renamed from src/mess/tools/imgtool/imgtool.c)0
-rw-r--r--src/tools/imgtool/imgtool.h (renamed from src/mess/tools/imgtool/imgtool.h)0
-rw-r--r--src/tools/imgtool/library.c (renamed from src/mess/tools/imgtool/library.c)0
-rw-r--r--src/tools/imgtool/library.h (renamed from src/mess/tools/imgtool/library.h)0
-rw-r--r--src/tools/imgtool/main.c (renamed from src/mess/tools/imgtool/main.c)0
-rw-r--r--src/tools/imgtool/main.h (renamed from src/mess/tools/imgtool/main.h)0
-rw-r--r--src/tools/imgtool/modules.c (renamed from src/mess/tools/imgtool/modules.c)0
-rw-r--r--src/tools/imgtool/modules.h (renamed from src/mess/tools/imgtool/modules.h)0
-rw-r--r--src/tools/imgtool/modules/amiga.c (renamed from src/mess/tools/imgtool/modules/amiga.c)0
-rw-r--r--src/tools/imgtool/modules/bml3.c (renamed from src/mess/tools/imgtool/modules/bml3.c)0
-rw-r--r--src/tools/imgtool/modules/concept.c (renamed from src/mess/tools/imgtool/modules/concept.c)0
-rw-r--r--src/tools/imgtool/modules/cybiko.c (renamed from src/mess/tools/imgtool/modules/cybiko.c)0
-rw-r--r--src/tools/imgtool/modules/cybikoxt.c (renamed from src/mess/tools/imgtool/modules/cybikoxt.c)0
-rw-r--r--src/tools/imgtool/modules/fat.c (renamed from src/mess/tools/imgtool/modules/fat.c)0
-rw-r--r--src/tools/imgtool/modules/fat.h (renamed from src/mess/tools/imgtool/modules/fat.h)0
-rw-r--r--src/tools/imgtool/modules/hp48.c (renamed from src/mess/tools/imgtool/modules/hp48.c)0
-rw-r--r--src/tools/imgtool/modules/mac.c (renamed from src/mess/tools/imgtool/modules/mac.c)0
-rw-r--r--src/tools/imgtool/modules/macbin.c (renamed from src/mess/tools/imgtool/modules/macbin.c)0
-rw-r--r--src/tools/imgtool/modules/macutil.c (renamed from src/mess/tools/imgtool/modules/macutil.c)0
-rw-r--r--src/tools/imgtool/modules/macutil.h (renamed from src/mess/tools/imgtool/modules/macutil.h)0
-rw-r--r--src/tools/imgtool/modules/os9.c (renamed from src/mess/tools/imgtool/modules/os9.c)0
-rw-r--r--src/tools/imgtool/modules/pc_flop.c (renamed from src/mess/tools/imgtool/modules/pc_flop.c)0
-rw-r--r--src/tools/imgtool/modules/pc_hard.c (renamed from src/mess/tools/imgtool/modules/pc_hard.c)0
-rw-r--r--src/tools/imgtool/modules/prodos.c (renamed from src/mess/tools/imgtool/modules/prodos.c)0
-rw-r--r--src/tools/imgtool/modules/psion.c (renamed from src/mess/tools/imgtool/modules/psion.c)0
-rw-r--r--src/tools/imgtool/modules/rsdos.c (renamed from src/mess/tools/imgtool/modules/rsdos.c)0
-rw-r--r--src/tools/imgtool/modules/thomson.c (renamed from src/mess/tools/imgtool/modules/thomson.c)0
-rw-r--r--src/tools/imgtool/modules/ti99.c (renamed from src/mess/tools/imgtool/modules/ti99.c)0
-rw-r--r--src/tools/imgtool/modules/ti990hd.c (renamed from src/mess/tools/imgtool/modules/ti990hd.c)0
-rw-r--r--src/tools/imgtool/modules/vzdos.c (renamed from src/mess/tools/imgtool/modules/vzdos.c)0
-rw-r--r--src/tools/imgtool/stream.c (renamed from src/mess/tools/imgtool/stream.c)0
-rw-r--r--src/tools/imgtool/stream.h (renamed from src/mess/tools/imgtool/stream.h)0
-rw-r--r--src/version.c2
-rw-r--r--tests/lib/util/corestr.c32
-rw-r--r--tests/main.c9
8884 files changed, 523922 insertions, 165396 deletions
diff --git a/.gitignore b/.gitignore
index c5dfc2b31cc..63662f92d07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,24 @@
*~
/*
-!/*/
+/*/
+!/3rdparty/
+!/artwork/
+!/docs/
+!/hash/
+!/hlsl/
+!/keymaps/
+!/nl_examples/
+!/samples/
+!/scripts/
+!/src/
+!/tests/
+!/web/
!/.gitattributes
!/.gitignore
!/.travis.yml
!/makefile
-!/mame.doxygen
+!/mame.doxygen
!/*.md
-/cfg
-/diff
-/ini
-/inp
-/nvram
-/obj
-/roms
-/snap
src/regtests/chdman/temp
src/regtests/jedutil/output
-/sta
-*.pyc
-/build
-/documentation \ No newline at end of file
+*.pyc \ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 15718c091af..86054759bba 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,17 +2,36 @@ language: cpp
compiler:
- gcc
- clang
+os:
+ - linux
+ - osx
+matrix:
+ exclude:
+ - os: osx
+ compiler: gcc
env:
- - SUBTARGET=arcade MAME=mamearcade64
+ - SUBTARGET=arcade MAME=mamearcade64 LDOPTS="-Wl,-no-keep-memory"
- SUBTARGET=mess MAME=mess64
script:
- - if [ $CC == 'clang' ];
- then make -j2 linux_x64_clang && ./$MAME -validate;
+ - if [ $TRAVIS_OS_NAME == 'linux' ]; then
+ if [ $CC == 'clang' ]; then
+ make -j2 linux_x64_clang && ./$MAME -validate;
else make -j2 OPTIMIZE=0 && ./$MAME -validate;
fi
+ elif [ $TRAVIS_OS_NAME == 'osx' ]; then
+ unset LDOPTS && make -j2 OPTIMIZE=0 MACOSX_USE_LIBSDL=1 && ./$MAME -validate;
+ fi
sudo: required
before_install:
- - sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y
- - sudo add-apt-repository ppa:shahar-evron/qt-backports -y
- - sudo apt-get update -qq
- - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libasound2-dev libqt4-dev libqt4-dev-bin
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y; fi"
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then sudo add-apt-repository ppa:shahar-evron/qt-backports -y; fi"
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then sudo apt-get update -qq; fi"
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ]; then sudo apt-get install -y --force-yes libsdl2-dev libsdl2-ttf-dev libasound2-dev libqt4-dev libqt4-dev-bin; fi"
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'osx' ]; then brew update; fi"
+ - "if [ ${TRAVIS_OS_NAME:-'linux'} = 'osx' ]; then brew install sdl2 sdl2_ttf; fi"
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - secure: "sK8JJcn1A0yLnbDJ/7vmJgESuXmP6D4QlvQvsYLp1xAx5eTVSJ5Z+GSXLBJ9CnoeJ5AlPVPX4rXdRV93UyxYlTh1O97x8VZZQtYBNPRjk/VCflsOOg7C+jcJKX/knMu/QG2MVEDE5G2b8mHSAgWljG/7Z2N0rYZlWppwklYafOkyW4uE0E7PU5XpmKim4ra6Y1eDSbap+XJiDwgUm9moDZrgAv7eom9NIWGNMRIozSRyR2IkYimlWE92FOy5PzLJtFGK02iumbYN+39mTux59v/h/m6HD6cD7Wf10Lco9+Fnmi9Bs+VvIReJIP9pDABRvJ3MkUV4I9BjUT9xk48lzxqjGtdfUwOMDOTABd4Pb/5cmNtyNUQIosy5oiplR6USBnqD7/gmJw+mfn3A+jdQHGne+akypwzUjSM6XrezjTiZLlDDG+QpA0kwAnxSXw8H2SpVyynMSn4nu0iZmOiOZMtFY0jKlt/W7OFC5wTuJFrky+bBGlVIv3KGOTJNJNgasXV4u0NXOjHyeBFpFYCIf0FZLfYyf7ITu94JxUzXGcVi5D0lBwvKY9HfJ4yJxciyfH6V7yU1+o23E/Meqe/tjt6dTW8DM5xIokrnusfzE5b0zw5GFyg54nbpazXpcPnrMdxhp+t2C7xKrxcZXhBECRYegj+Z86D9BJP/yum1YrQ="
diff --git a/3rdparty/bgfx/.gitignore b/3rdparty/bgfx/.gitignore
index 728a1d0fe01..3f3804ea8ea 100644
--- a/3rdparty/bgfx/.gitignore
+++ b/3rdparty/bgfx/.gitignore
@@ -4,3 +4,4 @@
.git
.svn
tags
+.gdb_history
diff --git a/3rdparty/bgfx/3rdparty/.editorconfig b/3rdparty/bgfx/3rdparty/.editorconfig
index 6bca1a7a2cf..9f05daea32d 100644
--- a/3rdparty/bgfx/3rdparty/.editorconfig
+++ b/3rdparty/bgfx/3rdparty/.editorconfig
@@ -1,5 +1,9 @@
root = true
+[fcpp/*]
+indent_style = space
+indent_size = 2
+
[ocornut-imgui/*]
-indent_style = space
-indent_size = 4
+indent_style = space
+indent_size = 4
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt b/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt
new file mode 100644
index 00000000000..6b0f7a3e83e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt
@@ -0,0 +1,77 @@
+MICROSOFT SOFTWARE LICENSE TERMS
+MICROSOFT DIRECTX SOFTWARE DEVELOPMENT KIT (SDK)
+These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
+• updates,
+• supplements,
+• Internet-based services, and
+• support services
+for this software, unless other terms accompany those items. If so, those terms apply.
+BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
+If you comply with these license terms, you have the rights below.
+1. INSTALLATION AND USE RIGHTS.
+a. Installation and Use. You may install and use any number of copies of the software on your devices.
+b. Included Microsoft Programs. The software contains other Microsoft programs. The license terms with those programs apply to your use of them.
+2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
+a. Media Elements and Templates. You may copy and use images, clip art, animations, sounds, music, shapes, video clips and templates provided with the software and identified for such use in documents and projects that you create. You may distribute those documents and projects non-commercially. If you wish to use these media elements or templates for any other purpose, go to www.microsoft.com/permission to learn whether that use is allowed.
+b. Distributable Code. The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below.
+i. Right to Use and Distribute. The code and text files listed below are “Distributable Code.â€
+• DIRECTX REDIST.TXT Files. You may copy and distribute the object code form of code listed in DIRECTX REDIST.TXT files.
+• Sample Code. You may modify, copy, and distribute the source and object code form of code marked as “sampleâ€, as well as those marked as follows:
+\Utilities\bin\x86\dxerr
+\Utilities\bin\x64\dxerr
+\Utilities\bin\x86\dxtex
+\Utilities\bin\x64\dxtex
+\Utilities\bin\x86\DxViewer
+\Utilities\bin\x64\DxViewer
+\Utilities\bin\x86\GDFTrace
+\Utilities\bin\x64\GDFTrace
+\Utilities\bin\x86\MeshConvert
+\Utilities\bin\x64\MeshConvert
+\Utilities\Source\Sas
+\Utilities\Source\Effects11
+• Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
+ii. Distribution Requirements. For any Distributable Code you distribute, you must
+• add significant primary functionality to it in your programs;
+• require distributors and external end users to agree to terms that protect it at least as much as this agreement;
+• display your valid copyright notice on your programs; and
+• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.
+iii. Distribution Restrictions. You may not
+• alter any copyright, trademark or patent notice in the Distributable Code;
+• use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
+• distribute Distributable Code to run on a platform other than the Windows, Xbox and Windows Mobile platforms;
+• include Distributable Code in malicious, deceptive or unlawful programs; or
+• modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
+• the code be disclosed or distributed in source code form; or
+• others have the right to modify it.
+3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
+• disclose the results of any benchmark tests of the software to any third party without Microsoft’s prior written approval;
+• work around any technical limitations in the software;
+• reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
+• make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
+• publish the software for others to copy;
+• rent, lease or lend the software; or
+• use the software for commercial software hosting services.
+4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
+5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
+6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
+7. SUPPORT SERVICES. Because this software is “as is,†we may not provide support services for it.
+8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
+9. APPLICABLE LAW.
+a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
+b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
+10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
+11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.†YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
+This limitation applies to
+• anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
+• claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
+It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
+Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
+Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
+EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
+LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
+Cette limitation concerne :
+• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
+• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
+Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
+EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas. \ No newline at end of file
diff --git a/3rdparty/dxsdk/Include/d3d10.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10.h
index 5c48a551e61..980838b336d 100644
--- a/3rdparty/dxsdk/Include/d3d10.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10.h
@@ -8,17 +8,14 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 7.00.0555 */
+ /* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -31,7 +28,7 @@
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
+#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
@@ -50,144 +47,168 @@
#ifndef __ID3D10DeviceChild_FWD_DEFINED__
#define __ID3D10DeviceChild_FWD_DEFINED__
typedef interface ID3D10DeviceChild ID3D10DeviceChild;
+
#endif /* __ID3D10DeviceChild_FWD_DEFINED__ */
#ifndef __ID3D10DepthStencilState_FWD_DEFINED__
#define __ID3D10DepthStencilState_FWD_DEFINED__
typedef interface ID3D10DepthStencilState ID3D10DepthStencilState;
+
#endif /* __ID3D10DepthStencilState_FWD_DEFINED__ */
#ifndef __ID3D10BlendState_FWD_DEFINED__
#define __ID3D10BlendState_FWD_DEFINED__
typedef interface ID3D10BlendState ID3D10BlendState;
+
#endif /* __ID3D10BlendState_FWD_DEFINED__ */
#ifndef __ID3D10RasterizerState_FWD_DEFINED__
#define __ID3D10RasterizerState_FWD_DEFINED__
typedef interface ID3D10RasterizerState ID3D10RasterizerState;
+
#endif /* __ID3D10RasterizerState_FWD_DEFINED__ */
#ifndef __ID3D10Resource_FWD_DEFINED__
#define __ID3D10Resource_FWD_DEFINED__
typedef interface ID3D10Resource ID3D10Resource;
+
#endif /* __ID3D10Resource_FWD_DEFINED__ */
#ifndef __ID3D10Buffer_FWD_DEFINED__
#define __ID3D10Buffer_FWD_DEFINED__
typedef interface ID3D10Buffer ID3D10Buffer;
+
#endif /* __ID3D10Buffer_FWD_DEFINED__ */
#ifndef __ID3D10Texture1D_FWD_DEFINED__
#define __ID3D10Texture1D_FWD_DEFINED__
typedef interface ID3D10Texture1D ID3D10Texture1D;
+
#endif /* __ID3D10Texture1D_FWD_DEFINED__ */
#ifndef __ID3D10Texture2D_FWD_DEFINED__
#define __ID3D10Texture2D_FWD_DEFINED__
typedef interface ID3D10Texture2D ID3D10Texture2D;
+
#endif /* __ID3D10Texture2D_FWD_DEFINED__ */
#ifndef __ID3D10Texture3D_FWD_DEFINED__
#define __ID3D10Texture3D_FWD_DEFINED__
typedef interface ID3D10Texture3D ID3D10Texture3D;
+
#endif /* __ID3D10Texture3D_FWD_DEFINED__ */
#ifndef __ID3D10View_FWD_DEFINED__
#define __ID3D10View_FWD_DEFINED__
typedef interface ID3D10View ID3D10View;
+
#endif /* __ID3D10View_FWD_DEFINED__ */
#ifndef __ID3D10ShaderResourceView_FWD_DEFINED__
#define __ID3D10ShaderResourceView_FWD_DEFINED__
typedef interface ID3D10ShaderResourceView ID3D10ShaderResourceView;
+
#endif /* __ID3D10ShaderResourceView_FWD_DEFINED__ */
#ifndef __ID3D10RenderTargetView_FWD_DEFINED__
#define __ID3D10RenderTargetView_FWD_DEFINED__
typedef interface ID3D10RenderTargetView ID3D10RenderTargetView;
+
#endif /* __ID3D10RenderTargetView_FWD_DEFINED__ */
#ifndef __ID3D10DepthStencilView_FWD_DEFINED__
#define __ID3D10DepthStencilView_FWD_DEFINED__
typedef interface ID3D10DepthStencilView ID3D10DepthStencilView;
+
#endif /* __ID3D10DepthStencilView_FWD_DEFINED__ */
#ifndef __ID3D10VertexShader_FWD_DEFINED__
#define __ID3D10VertexShader_FWD_DEFINED__
typedef interface ID3D10VertexShader ID3D10VertexShader;
+
#endif /* __ID3D10VertexShader_FWD_DEFINED__ */
#ifndef __ID3D10GeometryShader_FWD_DEFINED__
#define __ID3D10GeometryShader_FWD_DEFINED__
typedef interface ID3D10GeometryShader ID3D10GeometryShader;
+
#endif /* __ID3D10GeometryShader_FWD_DEFINED__ */
#ifndef __ID3D10PixelShader_FWD_DEFINED__
#define __ID3D10PixelShader_FWD_DEFINED__
typedef interface ID3D10PixelShader ID3D10PixelShader;
+
#endif /* __ID3D10PixelShader_FWD_DEFINED__ */
#ifndef __ID3D10InputLayout_FWD_DEFINED__
#define __ID3D10InputLayout_FWD_DEFINED__
typedef interface ID3D10InputLayout ID3D10InputLayout;
+
#endif /* __ID3D10InputLayout_FWD_DEFINED__ */
#ifndef __ID3D10SamplerState_FWD_DEFINED__
#define __ID3D10SamplerState_FWD_DEFINED__
typedef interface ID3D10SamplerState ID3D10SamplerState;
+
#endif /* __ID3D10SamplerState_FWD_DEFINED__ */
#ifndef __ID3D10Asynchronous_FWD_DEFINED__
#define __ID3D10Asynchronous_FWD_DEFINED__
typedef interface ID3D10Asynchronous ID3D10Asynchronous;
+
#endif /* __ID3D10Asynchronous_FWD_DEFINED__ */
#ifndef __ID3D10Query_FWD_DEFINED__
#define __ID3D10Query_FWD_DEFINED__
typedef interface ID3D10Query ID3D10Query;
+
#endif /* __ID3D10Query_FWD_DEFINED__ */
#ifndef __ID3D10Predicate_FWD_DEFINED__
#define __ID3D10Predicate_FWD_DEFINED__
typedef interface ID3D10Predicate ID3D10Predicate;
+
#endif /* __ID3D10Predicate_FWD_DEFINED__ */
#ifndef __ID3D10Counter_FWD_DEFINED__
#define __ID3D10Counter_FWD_DEFINED__
typedef interface ID3D10Counter ID3D10Counter;
+
#endif /* __ID3D10Counter_FWD_DEFINED__ */
#ifndef __ID3D10Device_FWD_DEFINED__
#define __ID3D10Device_FWD_DEFINED__
typedef interface ID3D10Device ID3D10Device;
+
#endif /* __ID3D10Device_FWD_DEFINED__ */
#ifndef __ID3D10Multithread_FWD_DEFINED__
#define __ID3D10Multithread_FWD_DEFINED__
typedef interface ID3D10Multithread ID3D10Multithread;
+
#endif /* __ID3D10Multithread_FWD_DEFINED__ */
@@ -607,18 +628,12 @@ extern "C"{
#define MAKE_D3D10_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D10, code )
#define MAKE_D3D10_STATUS( code ) MAKE_HRESULT( 0, _FACD3D10, code )
-#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D10_HRESULT(1)
-#define D3D10_ERROR_FILE_NOT_FOUND MAKE_D3D10_HRESULT(2)
-#if __SAL_H_FULL_VER < 140050727
-#undef __in_range
-#undef __in_xcount_opt
-#define __in_range(x, y)
-#define __in_xcount_opt(x)
-#endif
+/* Direct3D errors are now found in winerror.h */
typedef
enum D3D10_INPUT_CLASSIFICATION
- { D3D10_INPUT_PER_VERTEX_DATA = 0,
- D3D10_INPUT_PER_INSTANCE_DATA = 1
+ {
+ D3D10_INPUT_PER_VERTEX_DATA = 0,
+ D3D10_INPUT_PER_INSTANCE_DATA = 1
} D3D10_INPUT_CLASSIFICATION;
#define D3D10_APPEND_ALIGNED_ELEMENT ( 0xffffffff )
@@ -636,8 +651,9 @@ typedef struct D3D10_INPUT_ELEMENT_DESC
typedef
enum D3D10_FILL_MODE
- { D3D10_FILL_WIREFRAME = 2,
- D3D10_FILL_SOLID = 3
+ {
+ D3D10_FILL_WIREFRAME = 2,
+ D3D10_FILL_SOLID = 3
} D3D10_FILL_MODE;
typedef D3D_PRIMITIVE_TOPOLOGY D3D10_PRIMITIVE_TOPOLOGY;
@@ -646,9 +662,10 @@ typedef D3D_PRIMITIVE D3D10_PRIMITIVE;
typedef
enum D3D10_CULL_MODE
- { D3D10_CULL_NONE = 1,
- D3D10_CULL_FRONT = 2,
- D3D10_CULL_BACK = 3
+ {
+ D3D10_CULL_NONE = 1,
+ D3D10_CULL_FRONT = 2,
+ D3D10_CULL_BACK = 3
} D3D10_CULL_MODE;
typedef struct D3D10_SO_DECLARATION_ENTRY
@@ -672,96 +689,107 @@ typedef struct D3D10_VIEWPORT
typedef
enum D3D10_RESOURCE_DIMENSION
- { D3D10_RESOURCE_DIMENSION_UNKNOWN = 0,
- D3D10_RESOURCE_DIMENSION_BUFFER = 1,
- D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2,
- D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3,
- D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4
+ {
+ D3D10_RESOURCE_DIMENSION_UNKNOWN = 0,
+ D3D10_RESOURCE_DIMENSION_BUFFER = 1,
+ D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2,
+ D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3,
+ D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4
} D3D10_RESOURCE_DIMENSION;
typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION;
typedef
enum D3D10_DSV_DIMENSION
- { D3D10_DSV_DIMENSION_UNKNOWN = 0,
- D3D10_DSV_DIMENSION_TEXTURE1D = 1,
- D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2,
- D3D10_DSV_DIMENSION_TEXTURE2D = 3,
- D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4,
- D3D10_DSV_DIMENSION_TEXTURE2DMS = 5,
- D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
+ {
+ D3D10_DSV_DIMENSION_UNKNOWN = 0,
+ D3D10_DSV_DIMENSION_TEXTURE1D = 1,
+ D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2,
+ D3D10_DSV_DIMENSION_TEXTURE2D = 3,
+ D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4,
+ D3D10_DSV_DIMENSION_TEXTURE2DMS = 5,
+ D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
} D3D10_DSV_DIMENSION;
typedef
enum D3D10_RTV_DIMENSION
- { D3D10_RTV_DIMENSION_UNKNOWN = 0,
- D3D10_RTV_DIMENSION_BUFFER = 1,
- D3D10_RTV_DIMENSION_TEXTURE1D = 2,
- D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3,
- D3D10_RTV_DIMENSION_TEXTURE2D = 4,
- D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5,
- D3D10_RTV_DIMENSION_TEXTURE2DMS = 6,
- D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
- D3D10_RTV_DIMENSION_TEXTURE3D = 8
+ {
+ D3D10_RTV_DIMENSION_UNKNOWN = 0,
+ D3D10_RTV_DIMENSION_BUFFER = 1,
+ D3D10_RTV_DIMENSION_TEXTURE1D = 2,
+ D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D10_RTV_DIMENSION_TEXTURE2D = 4,
+ D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D10_RTV_DIMENSION_TEXTURE2DMS = 6,
+ D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
+ D3D10_RTV_DIMENSION_TEXTURE3D = 8
} D3D10_RTV_DIMENSION;
typedef
enum D3D10_USAGE
- { D3D10_USAGE_DEFAULT = 0,
- D3D10_USAGE_IMMUTABLE = 1,
- D3D10_USAGE_DYNAMIC = 2,
- D3D10_USAGE_STAGING = 3
+ {
+ D3D10_USAGE_DEFAULT = 0,
+ D3D10_USAGE_IMMUTABLE = 1,
+ D3D10_USAGE_DYNAMIC = 2,
+ D3D10_USAGE_STAGING = 3
} D3D10_USAGE;
typedef
enum D3D10_BIND_FLAG
- { D3D10_BIND_VERTEX_BUFFER = 0x1L,
- D3D10_BIND_INDEX_BUFFER = 0x2L,
- D3D10_BIND_CONSTANT_BUFFER = 0x4L,
- D3D10_BIND_SHADER_RESOURCE = 0x8L,
- D3D10_BIND_STREAM_OUTPUT = 0x10L,
- D3D10_BIND_RENDER_TARGET = 0x20L,
- D3D10_BIND_DEPTH_STENCIL = 0x40L
+ {
+ D3D10_BIND_VERTEX_BUFFER = 0x1L,
+ D3D10_BIND_INDEX_BUFFER = 0x2L,
+ D3D10_BIND_CONSTANT_BUFFER = 0x4L,
+ D3D10_BIND_SHADER_RESOURCE = 0x8L,
+ D3D10_BIND_STREAM_OUTPUT = 0x10L,
+ D3D10_BIND_RENDER_TARGET = 0x20L,
+ D3D10_BIND_DEPTH_STENCIL = 0x40L
} D3D10_BIND_FLAG;
typedef
enum D3D10_CPU_ACCESS_FLAG
- { D3D10_CPU_ACCESS_WRITE = 0x10000L,
- D3D10_CPU_ACCESS_READ = 0x20000L
+ {
+ D3D10_CPU_ACCESS_WRITE = 0x10000L,
+ D3D10_CPU_ACCESS_READ = 0x20000L
} D3D10_CPU_ACCESS_FLAG;
typedef
enum D3D10_RESOURCE_MISC_FLAG
- { D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
- D3D10_RESOURCE_MISC_SHARED = 0x2L,
- D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4L,
- D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10L,
- D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20L
+ {
+ D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
+ D3D10_RESOURCE_MISC_SHARED = 0x2L,
+ D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4L,
+ D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10L,
+ D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20L
} D3D10_RESOURCE_MISC_FLAG;
typedef
enum D3D10_MAP
- { D3D10_MAP_READ = 1,
- D3D10_MAP_WRITE = 2,
- D3D10_MAP_READ_WRITE = 3,
- D3D10_MAP_WRITE_DISCARD = 4,
- D3D10_MAP_WRITE_NO_OVERWRITE = 5
+ {
+ D3D10_MAP_READ = 1,
+ D3D10_MAP_WRITE = 2,
+ D3D10_MAP_READ_WRITE = 3,
+ D3D10_MAP_WRITE_DISCARD = 4,
+ D3D10_MAP_WRITE_NO_OVERWRITE = 5
} D3D10_MAP;
typedef
enum D3D10_MAP_FLAG
- { D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000L
+ {
+ D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000L
} D3D10_MAP_FLAG;
typedef
enum D3D10_RAISE_FLAG
- { D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L
+ {
+ D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L
} D3D10_RAISE_FLAG;
typedef
enum D3D10_CLEAR_FLAG
- { D3D10_CLEAR_DEPTH = 0x1L,
- D3D10_CLEAR_STENCIL = 0x2L
+ {
+ D3D10_CLEAR_DEPTH = 0x1L,
+ D3D10_CLEAR_STENCIL = 0x2L
} D3D10_CLEAR_FLAG;
typedef RECT D3D10_RECT;
@@ -799,32 +827,33 @@ EXTERN_C const IID IID_ID3D10DeviceChild;
public:
virtual void STDMETHODCALLTYPE GetDevice(
/* [annotation] */
- __out ID3D10Device **ppDevice) = 0;
+ _Out_ ID3D10Device **ppDevice) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData) = 0;
+ _Out_writes_bytes_opt_(*pDataSize) void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData) = 0;
+ _In_reads_bytes_opt_(DataSize) const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData) = 0;
+ _In_opt_ const IUnknown *pData) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10DeviceChildVtbl
@@ -835,7 +864,7 @@ EXTERN_C const IID IID_ID3D10DeviceChild;
ID3D10DeviceChild * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10DeviceChild * This);
@@ -846,32 +875,32 @@ EXTERN_C const IID IID_ID3D10DeviceChild;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10DeviceChild * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D10DeviceChildVtbl;
@@ -924,32 +953,35 @@ EXTERN_C const IID IID_ID3D10DeviceChild;
typedef
enum D3D10_COMPARISON_FUNC
- { D3D10_COMPARISON_NEVER = 1,
- D3D10_COMPARISON_LESS = 2,
- D3D10_COMPARISON_EQUAL = 3,
- D3D10_COMPARISON_LESS_EQUAL = 4,
- D3D10_COMPARISON_GREATER = 5,
- D3D10_COMPARISON_NOT_EQUAL = 6,
- D3D10_COMPARISON_GREATER_EQUAL = 7,
- D3D10_COMPARISON_ALWAYS = 8
+ {
+ D3D10_COMPARISON_NEVER = 1,
+ D3D10_COMPARISON_LESS = 2,
+ D3D10_COMPARISON_EQUAL = 3,
+ D3D10_COMPARISON_LESS_EQUAL = 4,
+ D3D10_COMPARISON_GREATER = 5,
+ D3D10_COMPARISON_NOT_EQUAL = 6,
+ D3D10_COMPARISON_GREATER_EQUAL = 7,
+ D3D10_COMPARISON_ALWAYS = 8
} D3D10_COMPARISON_FUNC;
typedef
enum D3D10_DEPTH_WRITE_MASK
- { D3D10_DEPTH_WRITE_MASK_ZERO = 0,
- D3D10_DEPTH_WRITE_MASK_ALL = 1
+ {
+ D3D10_DEPTH_WRITE_MASK_ZERO = 0,
+ D3D10_DEPTH_WRITE_MASK_ALL = 1
} D3D10_DEPTH_WRITE_MASK;
typedef
enum D3D10_STENCIL_OP
- { D3D10_STENCIL_OP_KEEP = 1,
- D3D10_STENCIL_OP_ZERO = 2,
- D3D10_STENCIL_OP_REPLACE = 3,
- D3D10_STENCIL_OP_INCR_SAT = 4,
- D3D10_STENCIL_OP_DECR_SAT = 5,
- D3D10_STENCIL_OP_INVERT = 6,
- D3D10_STENCIL_OP_INCR = 7,
- D3D10_STENCIL_OP_DECR = 8
+ {
+ D3D10_STENCIL_OP_KEEP = 1,
+ D3D10_STENCIL_OP_ZERO = 2,
+ D3D10_STENCIL_OP_REPLACE = 3,
+ D3D10_STENCIL_OP_INCR_SAT = 4,
+ D3D10_STENCIL_OP_DECR_SAT = 5,
+ D3D10_STENCIL_OP_INVERT = 6,
+ D3D10_STENCIL_OP_INCR = 7,
+ D3D10_STENCIL_OP_DECR = 8
} D3D10_STENCIL_OP;
typedef struct D3D10_DEPTH_STENCILOP_DESC
@@ -994,10 +1026,11 @@ EXTERN_C const IID IID_ID3D10DepthStencilState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_DEPTH_STENCIL_DESC *pDesc) = 0;
+ _Out_ D3D10_DEPTH_STENCIL_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10DepthStencilStateVtbl
@@ -1008,7 +1041,7 @@ EXTERN_C const IID IID_ID3D10DepthStencilState;
ID3D10DepthStencilState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10DepthStencilState * This);
@@ -1019,37 +1052,37 @@ EXTERN_C const IID IID_ID3D10DepthStencilState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10DepthStencilState * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10DepthStencilState * This,
/* [annotation] */
- __out D3D10_DEPTH_STENCIL_DESC *pDesc);
+ _Out_ D3D10_DEPTH_STENCIL_DESC *pDesc);
END_INTERFACE
} ID3D10DepthStencilStateVtbl;
@@ -1106,41 +1139,44 @@ EXTERN_C const IID IID_ID3D10DepthStencilState;
typedef
enum D3D10_BLEND
- { D3D10_BLEND_ZERO = 1,
- D3D10_BLEND_ONE = 2,
- D3D10_BLEND_SRC_COLOR = 3,
- D3D10_BLEND_INV_SRC_COLOR = 4,
- D3D10_BLEND_SRC_ALPHA = 5,
- D3D10_BLEND_INV_SRC_ALPHA = 6,
- D3D10_BLEND_DEST_ALPHA = 7,
- D3D10_BLEND_INV_DEST_ALPHA = 8,
- D3D10_BLEND_DEST_COLOR = 9,
- D3D10_BLEND_INV_DEST_COLOR = 10,
- D3D10_BLEND_SRC_ALPHA_SAT = 11,
- D3D10_BLEND_BLEND_FACTOR = 14,
- D3D10_BLEND_INV_BLEND_FACTOR = 15,
- D3D10_BLEND_SRC1_COLOR = 16,
- D3D10_BLEND_INV_SRC1_COLOR = 17,
- D3D10_BLEND_SRC1_ALPHA = 18,
- D3D10_BLEND_INV_SRC1_ALPHA = 19
+ {
+ D3D10_BLEND_ZERO = 1,
+ D3D10_BLEND_ONE = 2,
+ D3D10_BLEND_SRC_COLOR = 3,
+ D3D10_BLEND_INV_SRC_COLOR = 4,
+ D3D10_BLEND_SRC_ALPHA = 5,
+ D3D10_BLEND_INV_SRC_ALPHA = 6,
+ D3D10_BLEND_DEST_ALPHA = 7,
+ D3D10_BLEND_INV_DEST_ALPHA = 8,
+ D3D10_BLEND_DEST_COLOR = 9,
+ D3D10_BLEND_INV_DEST_COLOR = 10,
+ D3D10_BLEND_SRC_ALPHA_SAT = 11,
+ D3D10_BLEND_BLEND_FACTOR = 14,
+ D3D10_BLEND_INV_BLEND_FACTOR = 15,
+ D3D10_BLEND_SRC1_COLOR = 16,
+ D3D10_BLEND_INV_SRC1_COLOR = 17,
+ D3D10_BLEND_SRC1_ALPHA = 18,
+ D3D10_BLEND_INV_SRC1_ALPHA = 19
} D3D10_BLEND;
typedef
enum D3D10_BLEND_OP
- { D3D10_BLEND_OP_ADD = 1,
- D3D10_BLEND_OP_SUBTRACT = 2,
- D3D10_BLEND_OP_REV_SUBTRACT = 3,
- D3D10_BLEND_OP_MIN = 4,
- D3D10_BLEND_OP_MAX = 5
+ {
+ D3D10_BLEND_OP_ADD = 1,
+ D3D10_BLEND_OP_SUBTRACT = 2,
+ D3D10_BLEND_OP_REV_SUBTRACT = 3,
+ D3D10_BLEND_OP_MIN = 4,
+ D3D10_BLEND_OP_MAX = 5
} D3D10_BLEND_OP;
typedef
enum D3D10_COLOR_WRITE_ENABLE
- { D3D10_COLOR_WRITE_ENABLE_RED = 1,
- D3D10_COLOR_WRITE_ENABLE_GREEN = 2,
- D3D10_COLOR_WRITE_ENABLE_BLUE = 4,
- D3D10_COLOR_WRITE_ENABLE_ALPHA = 8,
- D3D10_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN ) | D3D10_COLOR_WRITE_ENABLE_BLUE ) | D3D10_COLOR_WRITE_ENABLE_ALPHA )
+ {
+ D3D10_COLOR_WRITE_ENABLE_RED = 1,
+ D3D10_COLOR_WRITE_ENABLE_GREEN = 2,
+ D3D10_COLOR_WRITE_ENABLE_BLUE = 4,
+ D3D10_COLOR_WRITE_ENABLE_ALPHA = 8,
+ D3D10_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN ) | D3D10_COLOR_WRITE_ENABLE_BLUE ) | D3D10_COLOR_WRITE_ENABLE_ALPHA )
} D3D10_COLOR_WRITE_ENABLE;
typedef struct D3D10_BLEND_DESC
@@ -1178,10 +1214,11 @@ EXTERN_C const IID IID_ID3D10BlendState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_BLEND_DESC *pDesc) = 0;
+ _Out_ D3D10_BLEND_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10BlendStateVtbl
@@ -1192,7 +1229,7 @@ EXTERN_C const IID IID_ID3D10BlendState;
ID3D10BlendState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10BlendState * This);
@@ -1203,37 +1240,37 @@ EXTERN_C const IID IID_ID3D10BlendState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10BlendState * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10BlendState * This,
/* [annotation] */
- __out D3D10_BLEND_DESC *pDesc);
+ _Out_ D3D10_BLEND_DESC *pDesc);
END_INTERFACE
} ID3D10BlendStateVtbl;
@@ -1324,10 +1361,11 @@ EXTERN_C const IID IID_ID3D10RasterizerState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_RASTERIZER_DESC *pDesc) = 0;
+ _Out_ D3D10_RASTERIZER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10RasterizerStateVtbl
@@ -1338,7 +1376,7 @@ EXTERN_C const IID IID_ID3D10RasterizerState;
ID3D10RasterizerState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10RasterizerState * This);
@@ -1349,37 +1387,37 @@ EXTERN_C const IID IID_ID3D10RasterizerState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10RasterizerState * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10RasterizerState * This,
/* [annotation] */
- __out D3D10_RASTERIZER_DESC *pDesc);
+ _Out_ D3D10_RASTERIZER_DESC *pDesc);
END_INTERFACE
} ID3D10RasterizerStateVtbl;
@@ -1467,16 +1505,17 @@ EXTERN_C const IID IID_ID3D10Resource;
public:
virtual void STDMETHODCALLTYPE GetType(
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType) = 0;
+ _Out_ D3D10_RESOURCE_DIMENSION *rType) = 0;
virtual void STDMETHODCALLTYPE SetEvictionPriority(
/* [annotation] */
- __in UINT EvictionPriority) = 0;
+ _In_ UINT EvictionPriority) = 0;
virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10ResourceVtbl
@@ -1487,7 +1526,7 @@ EXTERN_C const IID IID_ID3D10Resource;
ID3D10Resource * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Resource * This);
@@ -1498,42 +1537,42 @@ EXTERN_C const IID IID_ID3D10Resource;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Resource * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D10Resource * This,
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType);
+ _Out_ D3D10_RESOURCE_DIMENSION *rType);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D10Resource * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D10Resource * This);
@@ -1628,7 +1667,7 @@ struct CD3D10_BUFFER_DESC : public D3D10_BUFFER_DESC
MiscFlags = miscFlags;
}
~CD3D10_BUFFER_DESC() {}
- operator const D3D10_BUFFER_DESC&() const { return *this; }
+// operator const D3D10_BUFFER_DESC&() const { return *this; }
};
#endif
@@ -1653,20 +1692,21 @@ EXTERN_C const IID IID_ID3D10Buffer;
public:
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out void **ppData) = 0;
+ _Out_ void **ppData) = 0;
virtual void STDMETHODCALLTYPE Unmap( void) = 0;
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_BUFFER_DESC *pDesc) = 0;
+ _Out_ D3D10_BUFFER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10BufferVtbl
@@ -1677,7 +1717,7 @@ EXTERN_C const IID IID_ID3D10Buffer;
ID3D10Buffer * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Buffer * This);
@@ -1688,42 +1728,42 @@ EXTERN_C const IID IID_ID3D10Buffer;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Buffer * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D10Buffer * This,
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType);
+ _Out_ D3D10_RESOURCE_DIMENSION *rType);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D10Buffer * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D10Buffer * This);
@@ -1731,11 +1771,11 @@ EXTERN_C const IID IID_ID3D10Buffer;
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D10Buffer * This,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out void **ppData);
+ _Out_ void **ppData);
void ( STDMETHODCALLTYPE *Unmap )(
ID3D10Buffer * This);
@@ -1743,7 +1783,7 @@ EXTERN_C const IID IID_ID3D10Buffer;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Buffer * This,
/* [annotation] */
- __out D3D10_BUFFER_DESC *pDesc);
+ _Out_ D3D10_BUFFER_DESC *pDesc);
END_INTERFACE
} ID3D10BufferVtbl;
@@ -1854,7 +1894,7 @@ struct CD3D10_TEXTURE1D_DESC : public D3D10_TEXTURE1D_DESC
MiscFlags = miscFlags;
}
~CD3D10_TEXTURE1D_DESC() {}
- operator const D3D10_TEXTURE1D_DESC&() const { return *this; }
+// operator const D3D10_TEXTURE1D_DESC&() const { return *this; }
};
#endif
@@ -1879,24 +1919,25 @@ EXTERN_C const IID IID_ID3D10Texture1D;
public:
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out void **ppData) = 0;
+ _Out_ void **ppData) = 0;
virtual void STDMETHODCALLTYPE Unmap(
/* [annotation] */
- __in UINT Subresource) = 0;
+ _In_ UINT Subresource) = 0;
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_TEXTURE1D_DESC *pDesc) = 0;
+ _Out_ D3D10_TEXTURE1D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10Texture1DVtbl
@@ -1907,7 +1948,7 @@ EXTERN_C const IID IID_ID3D10Texture1D;
ID3D10Texture1D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Texture1D * This);
@@ -1918,42 +1959,42 @@ EXTERN_C const IID IID_ID3D10Texture1D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Texture1D * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D10Texture1D * This,
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType);
+ _Out_ D3D10_RESOURCE_DIMENSION *rType);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D10Texture1D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D10Texture1D * This);
@@ -1961,23 +2002,23 @@ EXTERN_C const IID IID_ID3D10Texture1D;
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D10Texture1D * This,
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out void **ppData);
+ _Out_ void **ppData);
void ( STDMETHODCALLTYPE *Unmap )(
ID3D10Texture1D * This,
/* [annotation] */
- __in UINT Subresource);
+ _In_ UINT Subresource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Texture1D * This,
/* [annotation] */
- __out D3D10_TEXTURE1D_DESC *pDesc);
+ _Out_ D3D10_TEXTURE1D_DESC *pDesc);
END_INTERFACE
} ID3D10Texture1DVtbl;
@@ -2096,7 +2137,7 @@ struct CD3D10_TEXTURE2D_DESC : public D3D10_TEXTURE2D_DESC
MiscFlags = miscFlags;
}
~CD3D10_TEXTURE2D_DESC() {}
- operator const D3D10_TEXTURE2D_DESC&() const { return *this; }
+// operator const D3D10_TEXTURE2D_DESC&() const { return *this; }
};
#endif
typedef struct D3D10_MAPPED_TEXTURE2D
@@ -2127,24 +2168,25 @@ EXTERN_C const IID IID_ID3D10Texture2D;
public:
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D) = 0;
+ _Out_ D3D10_MAPPED_TEXTURE2D *pMappedTex2D) = 0;
virtual void STDMETHODCALLTYPE Unmap(
/* [annotation] */
- __in UINT Subresource) = 0;
+ _In_ UINT Subresource) = 0;
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_TEXTURE2D_DESC *pDesc) = 0;
+ _Out_ D3D10_TEXTURE2D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10Texture2DVtbl
@@ -2155,7 +2197,7 @@ EXTERN_C const IID IID_ID3D10Texture2D;
ID3D10Texture2D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Texture2D * This);
@@ -2166,42 +2208,42 @@ EXTERN_C const IID IID_ID3D10Texture2D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Texture2D * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D10Texture2D * This,
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType);
+ _Out_ D3D10_RESOURCE_DIMENSION *rType);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D10Texture2D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D10Texture2D * This);
@@ -2209,23 +2251,23 @@ EXTERN_C const IID IID_ID3D10Texture2D;
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D10Texture2D * This,
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D);
+ _Out_ D3D10_MAPPED_TEXTURE2D *pMappedTex2D);
void ( STDMETHODCALLTYPE *Unmap )(
ID3D10Texture2D * This,
/* [annotation] */
- __in UINT Subresource);
+ _In_ UINT Subresource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Texture2D * This,
/* [annotation] */
- __out D3D10_TEXTURE2D_DESC *pDesc);
+ _Out_ D3D10_TEXTURE2D_DESC *pDesc);
END_INTERFACE
} ID3D10Texture2DVtbl;
@@ -2339,7 +2381,7 @@ struct CD3D10_TEXTURE3D_DESC : public D3D10_TEXTURE3D_DESC
MiscFlags = miscFlags;
}
~CD3D10_TEXTURE3D_DESC() {}
- operator const D3D10_TEXTURE3D_DESC&() const { return *this; }
+// operator const D3D10_TEXTURE3D_DESC&() const { return *this; }
};
#endif
typedef struct D3D10_MAPPED_TEXTURE3D
@@ -2371,24 +2413,25 @@ EXTERN_C const IID IID_ID3D10Texture3D;
public:
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D) = 0;
+ _Out_ D3D10_MAPPED_TEXTURE3D *pMappedTex3D) = 0;
virtual void STDMETHODCALLTYPE Unmap(
/* [annotation] */
- __in UINT Subresource) = 0;
+ _In_ UINT Subresource) = 0;
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_TEXTURE3D_DESC *pDesc) = 0;
+ _Out_ D3D10_TEXTURE3D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10Texture3DVtbl
@@ -2399,7 +2442,7 @@ EXTERN_C const IID IID_ID3D10Texture3D;
ID3D10Texture3D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Texture3D * This);
@@ -2410,42 +2453,42 @@ EXTERN_C const IID IID_ID3D10Texture3D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Texture3D * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D10Texture3D * This,
/* [annotation] */
- __out D3D10_RESOURCE_DIMENSION *rType);
+ _Out_ D3D10_RESOURCE_DIMENSION *rType);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D10Texture3D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D10Texture3D * This);
@@ -2453,23 +2496,23 @@ EXTERN_C const IID IID_ID3D10Texture3D;
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D10Texture3D * This,
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D10_MAP MapType,
+ _In_ D3D10_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D);
+ _Out_ D3D10_MAPPED_TEXTURE3D *pMappedTex3D);
void ( STDMETHODCALLTYPE *Unmap )(
ID3D10Texture3D * This,
/* [annotation] */
- __in UINT Subresource);
+ _In_ UINT Subresource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Texture3D * This,
/* [annotation] */
- __out D3D10_TEXTURE3D_DESC *pDesc);
+ _Out_ D3D10_TEXTURE3D_DESC *pDesc);
END_INTERFACE
} ID3D10Texture3DVtbl;
@@ -2542,12 +2585,13 @@ EXTERN_C const IID IID_ID3D10Texture3D;
typedef
enum D3D10_TEXTURECUBE_FACE
- { D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0,
- D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1,
- D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2,
- D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
- D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4,
- D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5
+ {
+ D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0,
+ D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1,
+ D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2,
+ D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
+ D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4,
+ D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5
} D3D10_TEXTURECUBE_FACE;
@@ -2572,10 +2616,11 @@ EXTERN_C const IID IID_ID3D10View;
public:
virtual void STDMETHODCALLTYPE GetResource(
/* [annotation] */
- __out ID3D10Resource **ppResource) = 0;
+ _Out_ ID3D10Resource **ppResource) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10ViewVtbl
@@ -2586,7 +2631,7 @@ EXTERN_C const IID IID_ID3D10View;
ID3D10View * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10View * This);
@@ -2597,37 +2642,37 @@ EXTERN_C const IID IID_ID3D10View;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10View * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D10View * This,
/* [annotation] */
- __out ID3D10Resource **ppResource);
+ _Out_ ID3D10Resource **ppResource);
END_INTERFACE
} ID3D10ViewVtbl;
@@ -2787,10 +2832,11 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10ShaderResourceViewVtbl
@@ -2801,7 +2847,7 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView;
ID3D10ShaderResourceView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10ShaderResourceView * This);
@@ -2812,42 +2858,42 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __out ID3D10Resource **ppResource);
+ _Out_ ID3D10Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10ShaderResourceView * This,
/* [annotation] */
- __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
+ _Out_ D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D10ShaderResourceViewVtbl;
@@ -3001,10 +3047,11 @@ EXTERN_C const IID IID_ID3D10RenderTargetView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D10_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10RenderTargetViewVtbl
@@ -3015,7 +3062,7 @@ EXTERN_C const IID IID_ID3D10RenderTargetView;
ID3D10RenderTargetView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10RenderTargetView * This);
@@ -3026,42 +3073,42 @@ EXTERN_C const IID IID_ID3D10RenderTargetView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __out ID3D10Resource **ppResource);
+ _Out_ ID3D10Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10RenderTargetView * This,
/* [annotation] */
- __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc);
+ _Out_ D3D10_RENDER_TARGET_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D10RenderTargetViewVtbl;
@@ -3192,10 +3239,11 @@ EXTERN_C const IID IID_ID3D10DepthStencilView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10DepthStencilViewVtbl
@@ -3206,7 +3254,7 @@ EXTERN_C const IID IID_ID3D10DepthStencilView;
ID3D10DepthStencilView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10DepthStencilView * This);
@@ -3217,42 +3265,42 @@ EXTERN_C const IID IID_ID3D10DepthStencilView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __out ID3D10Resource **ppResource);
+ _Out_ ID3D10Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10DepthStencilView * This,
/* [annotation] */
- __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc);
+ _Out_ D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D10DepthStencilViewVtbl;
@@ -3325,6 +3373,7 @@ EXTERN_C const IID IID_ID3D10VertexShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D10VertexShaderVtbl
@@ -3335,7 +3384,7 @@ EXTERN_C const IID IID_ID3D10VertexShader;
ID3D10VertexShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10VertexShader * This);
@@ -3346,32 +3395,32 @@ EXTERN_C const IID IID_ID3D10VertexShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10VertexShader * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D10VertexShaderVtbl;
@@ -3437,6 +3486,7 @@ EXTERN_C const IID IID_ID3D10GeometryShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D10GeometryShaderVtbl
@@ -3447,7 +3497,7 @@ EXTERN_C const IID IID_ID3D10GeometryShader;
ID3D10GeometryShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10GeometryShader * This);
@@ -3458,32 +3508,32 @@ EXTERN_C const IID IID_ID3D10GeometryShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10GeometryShader * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D10GeometryShaderVtbl;
@@ -3549,6 +3599,7 @@ EXTERN_C const IID IID_ID3D10PixelShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D10PixelShaderVtbl
@@ -3559,7 +3610,7 @@ EXTERN_C const IID IID_ID3D10PixelShader;
ID3D10PixelShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10PixelShader * This);
@@ -3570,32 +3621,32 @@ EXTERN_C const IID IID_ID3D10PixelShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10PixelShader * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D10PixelShaderVtbl;
@@ -3661,6 +3712,7 @@ EXTERN_C const IID IID_ID3D10InputLayout;
public:
};
+
#else /* C style interface */
typedef struct ID3D10InputLayoutVtbl
@@ -3671,7 +3723,7 @@ EXTERN_C const IID IID_ID3D10InputLayout;
ID3D10InputLayout * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10InputLayout * This);
@@ -3682,32 +3734,32 @@ EXTERN_C const IID IID_ID3D10InputLayout;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10InputLayout * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D10InputLayoutVtbl;
@@ -3761,31 +3813,33 @@ EXTERN_C const IID IID_ID3D10InputLayout;
typedef
enum D3D10_FILTER
- { D3D10_FILTER_MIN_MAG_MIP_POINT = 0,
- D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
- D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
- D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
- D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
- D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
- D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
- D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
- D3D10_FILTER_ANISOTROPIC = 0x55,
- D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
- D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
- D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
- D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
- D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
- D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
- D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
- D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
- D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
- D3D10_FILTER_TEXT_1BIT = 0x80000000
+ {
+ D3D10_FILTER_MIN_MAG_MIP_POINT = 0,
+ D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
+ D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
+ D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
+ D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
+ D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
+ D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
+ D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+ D3D10_FILTER_ANISOTROPIC = 0x55,
+ D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
+ D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
+ D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
+ D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
+ D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
+ D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
+ D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
+ D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
+ D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
+ D3D10_FILTER_TEXT_1BIT = 0x80000000
} D3D10_FILTER;
typedef
enum D3D10_FILTER_TYPE
- { D3D10_FILTER_TYPE_POINT = 0,
- D3D10_FILTER_TYPE_LINEAR = 1
+ {
+ D3D10_FILTER_TYPE_POINT = 0,
+ D3D10_FILTER_TYPE_LINEAR = 1
} D3D10_FILTER_TYPE;
#define D3D10_FILTER_TYPE_MASK ( 0x3 )
@@ -3835,11 +3889,12 @@ enum D3D10_FILTER_TYPE
( ( d3d10Filter ) == D3D10_TEXT_1BIT_BIT )
typedef
enum D3D10_TEXTURE_ADDRESS_MODE
- { D3D10_TEXTURE_ADDRESS_WRAP = 1,
- D3D10_TEXTURE_ADDRESS_MIRROR = 2,
- D3D10_TEXTURE_ADDRESS_CLAMP = 3,
- D3D10_TEXTURE_ADDRESS_BORDER = 4,
- D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5
+ {
+ D3D10_TEXTURE_ADDRESS_WRAP = 1,
+ D3D10_TEXTURE_ADDRESS_MIRROR = 2,
+ D3D10_TEXTURE_ADDRESS_CLAMP = 3,
+ D3D10_TEXTURE_ADDRESS_BORDER = 4,
+ D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5
} D3D10_TEXTURE_ADDRESS_MODE;
typedef struct D3D10_SAMPLER_DESC
@@ -3878,10 +3933,11 @@ EXTERN_C const IID IID_ID3D10SamplerState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_SAMPLER_DESC *pDesc) = 0;
+ _Out_ D3D10_SAMPLER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10SamplerStateVtbl
@@ -3892,7 +3948,7 @@ EXTERN_C const IID IID_ID3D10SamplerState;
ID3D10SamplerState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10SamplerState * This);
@@ -3903,37 +3959,37 @@ EXTERN_C const IID IID_ID3D10SamplerState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10SamplerState * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10SamplerState * This,
/* [annotation] */
- __out D3D10_SAMPLER_DESC *pDesc);
+ _Out_ D3D10_SAMPLER_DESC *pDesc);
END_INTERFACE
} ID3D10SamplerStateVtbl;
@@ -3990,31 +4046,32 @@ EXTERN_C const IID IID_ID3D10SamplerState;
typedef
enum D3D10_FORMAT_SUPPORT
- { D3D10_FORMAT_SUPPORT_BUFFER = 0x1,
- D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2,
- D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4,
- D3D10_FORMAT_SUPPORT_SO_BUFFER = 0x8,
- D3D10_FORMAT_SUPPORT_TEXTURE1D = 0x10,
- D3D10_FORMAT_SUPPORT_TEXTURE2D = 0x20,
- D3D10_FORMAT_SUPPORT_TEXTURE3D = 0x40,
- D3D10_FORMAT_SUPPORT_TEXTURECUBE = 0x80,
- D3D10_FORMAT_SUPPORT_SHADER_LOAD = 0x100,
- D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200,
- D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400,
- D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800,
- D3D10_FORMAT_SUPPORT_MIP = 0x1000,
- D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000,
- D3D10_FORMAT_SUPPORT_RENDER_TARGET = 0x4000,
- D3D10_FORMAT_SUPPORT_BLENDABLE = 0x8000,
- D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000,
- D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000,
- D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000,
- D3D10_FORMAT_SUPPORT_DISPLAY = 0x80000,
- D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000,
- D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000,
- D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000,
- D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x800000,
- D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000
+ {
+ D3D10_FORMAT_SUPPORT_BUFFER = 0x1,
+ D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2,
+ D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4,
+ D3D10_FORMAT_SUPPORT_SO_BUFFER = 0x8,
+ D3D10_FORMAT_SUPPORT_TEXTURE1D = 0x10,
+ D3D10_FORMAT_SUPPORT_TEXTURE2D = 0x20,
+ D3D10_FORMAT_SUPPORT_TEXTURE3D = 0x40,
+ D3D10_FORMAT_SUPPORT_TEXTURECUBE = 0x80,
+ D3D10_FORMAT_SUPPORT_SHADER_LOAD = 0x100,
+ D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200,
+ D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400,
+ D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800,
+ D3D10_FORMAT_SUPPORT_MIP = 0x1000,
+ D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000,
+ D3D10_FORMAT_SUPPORT_RENDER_TARGET = 0x4000,
+ D3D10_FORMAT_SUPPORT_BLENDABLE = 0x8000,
+ D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000,
+ D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000,
+ D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000,
+ D3D10_FORMAT_SUPPORT_DISPLAY = 0x80000,
+ D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000,
+ D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000,
+ D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000,
+ D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x800000,
+ D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000
} D3D10_FORMAT_SUPPORT;
@@ -4043,16 +4100,17 @@ EXTERN_C const IID IID_ID3D10Asynchronous;
virtual HRESULT STDMETHODCALLTYPE GetData(
/* [annotation] */
- __out_bcount_opt(DataSize) void *pData,
+ _Out_writes_bytes_opt_(DataSize) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags) = 0;
+ _In_ UINT GetDataFlags) = 0;
virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10AsynchronousVtbl
@@ -4063,7 +4121,7 @@ EXTERN_C const IID IID_ID3D10Asynchronous;
ID3D10Asynchronous * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Asynchronous * This);
@@ -4074,32 +4132,32 @@ EXTERN_C const IID IID_ID3D10Asynchronous;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Asynchronous * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *Begin )(
ID3D10Asynchronous * This);
@@ -4110,11 +4168,11 @@ EXTERN_C const IID IID_ID3D10Asynchronous;
HRESULT ( STDMETHODCALLTYPE *GetData )(
ID3D10Asynchronous * This,
/* [annotation] */
- __out_bcount_opt(DataSize) void *pData,
+ _Out_writes_bytes_opt_(DataSize) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags);
+ _In_ UINT GetDataFlags);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D10Asynchronous * This);
@@ -4183,24 +4241,27 @@ EXTERN_C const IID IID_ID3D10Asynchronous;
typedef
enum D3D10_ASYNC_GETDATA_FLAG
- { D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1
+ {
+ D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1
} D3D10_ASYNC_GETDATA_FLAG;
typedef
enum D3D10_QUERY
- { D3D10_QUERY_EVENT = 0,
- D3D10_QUERY_OCCLUSION = ( D3D10_QUERY_EVENT + 1 ) ,
- D3D10_QUERY_TIMESTAMP = ( D3D10_QUERY_OCCLUSION + 1 ) ,
- D3D10_QUERY_TIMESTAMP_DISJOINT = ( D3D10_QUERY_TIMESTAMP + 1 ) ,
- D3D10_QUERY_PIPELINE_STATISTICS = ( D3D10_QUERY_TIMESTAMP_DISJOINT + 1 ) ,
- D3D10_QUERY_OCCLUSION_PREDICATE = ( D3D10_QUERY_PIPELINE_STATISTICS + 1 ) ,
- D3D10_QUERY_SO_STATISTICS = ( D3D10_QUERY_OCCLUSION_PREDICATE + 1 ) ,
- D3D10_QUERY_SO_OVERFLOW_PREDICATE = ( D3D10_QUERY_SO_STATISTICS + 1 )
+ {
+ D3D10_QUERY_EVENT = 0,
+ D3D10_QUERY_OCCLUSION = ( D3D10_QUERY_EVENT + 1 ) ,
+ D3D10_QUERY_TIMESTAMP = ( D3D10_QUERY_OCCLUSION + 1 ) ,
+ D3D10_QUERY_TIMESTAMP_DISJOINT = ( D3D10_QUERY_TIMESTAMP + 1 ) ,
+ D3D10_QUERY_PIPELINE_STATISTICS = ( D3D10_QUERY_TIMESTAMP_DISJOINT + 1 ) ,
+ D3D10_QUERY_OCCLUSION_PREDICATE = ( D3D10_QUERY_PIPELINE_STATISTICS + 1 ) ,
+ D3D10_QUERY_SO_STATISTICS = ( D3D10_QUERY_OCCLUSION_PREDICATE + 1 ) ,
+ D3D10_QUERY_SO_OVERFLOW_PREDICATE = ( D3D10_QUERY_SO_STATISTICS + 1 )
} D3D10_QUERY;
typedef
enum D3D10_QUERY_MISC_FLAG
- { D3D10_QUERY_MISC_PREDICATEHINT = 0x1
+ {
+ D3D10_QUERY_MISC_PREDICATEHINT = 0x1
} D3D10_QUERY_MISC_FLAG;
typedef struct D3D10_QUERY_DESC
@@ -4231,10 +4292,11 @@ EXTERN_C const IID IID_ID3D10Query;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_QUERY_DESC *pDesc) = 0;
+ _Out_ D3D10_QUERY_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10QueryVtbl
@@ -4245,7 +4307,7 @@ EXTERN_C const IID IID_ID3D10Query;
ID3D10Query * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Query * This);
@@ -4256,32 +4318,32 @@ EXTERN_C const IID IID_ID3D10Query;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Query * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *Begin )(
ID3D10Query * This);
@@ -4292,11 +4354,11 @@ EXTERN_C const IID IID_ID3D10Query;
HRESULT ( STDMETHODCALLTYPE *GetData )(
ID3D10Query * This,
/* [annotation] */
- __out_bcount_opt(DataSize) void *pData,
+ _Out_writes_bytes_opt_(DataSize) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags);
+ _In_ UINT GetDataFlags);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D10Query * This);
@@ -4304,7 +4366,7 @@ EXTERN_C const IID IID_ID3D10Query;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Query * This,
/* [annotation] */
- __out D3D10_QUERY_DESC *pDesc);
+ _Out_ D3D10_QUERY_DESC *pDesc);
END_INTERFACE
} ID3D10QueryVtbl;
@@ -4386,6 +4448,7 @@ EXTERN_C const IID IID_ID3D10Predicate;
public:
};
+
#else /* C style interface */
typedef struct ID3D10PredicateVtbl
@@ -4396,7 +4459,7 @@ EXTERN_C const IID IID_ID3D10Predicate;
ID3D10Predicate * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Predicate * This);
@@ -4407,32 +4470,32 @@ EXTERN_C const IID IID_ID3D10Predicate;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Predicate * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *Begin )(
ID3D10Predicate * This);
@@ -4443,11 +4506,11 @@ EXTERN_C const IID IID_ID3D10Predicate;
HRESULT ( STDMETHODCALLTYPE *GetData )(
ID3D10Predicate * This,
/* [annotation] */
- __out_bcount_opt(DataSize) void *pData,
+ _Out_writes_bytes_opt_(DataSize) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags);
+ _In_ UINT GetDataFlags);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D10Predicate * This);
@@ -4455,7 +4518,7 @@ EXTERN_C const IID IID_ID3D10Predicate;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Predicate * This,
/* [annotation] */
- __out D3D10_QUERY_DESC *pDesc);
+ _Out_ D3D10_QUERY_DESC *pDesc);
END_INTERFACE
} ID3D10PredicateVtbl;
@@ -4550,33 +4613,35 @@ typedef struct D3D10_QUERY_DATA_SO_STATISTICS
typedef
enum D3D10_COUNTER
- { D3D10_COUNTER_GPU_IDLE = 0,
- D3D10_COUNTER_VERTEX_PROCESSING = ( D3D10_COUNTER_GPU_IDLE + 1 ) ,
- D3D10_COUNTER_GEOMETRY_PROCESSING = ( D3D10_COUNTER_VERTEX_PROCESSING + 1 ) ,
- D3D10_COUNTER_PIXEL_PROCESSING = ( D3D10_COUNTER_GEOMETRY_PROCESSING + 1 ) ,
- D3D10_COUNTER_OTHER_GPU_PROCESSING = ( D3D10_COUNTER_PIXEL_PROCESSING + 1 ) ,
- D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_OTHER_GPU_PROCESSING + 1 ) ,
- D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION + 1 ) ,
- D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION + 1 ) ,
- D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION + 1 ) ,
- D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION + 1 ) ,
- D3D10_COUNTER_VS_MEMORY_LIMITED = ( D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION + 1 ) ,
- D3D10_COUNTER_VS_COMPUTATION_LIMITED = ( D3D10_COUNTER_VS_MEMORY_LIMITED + 1 ) ,
- D3D10_COUNTER_GS_MEMORY_LIMITED = ( D3D10_COUNTER_VS_COMPUTATION_LIMITED + 1 ) ,
- D3D10_COUNTER_GS_COMPUTATION_LIMITED = ( D3D10_COUNTER_GS_MEMORY_LIMITED + 1 ) ,
- D3D10_COUNTER_PS_MEMORY_LIMITED = ( D3D10_COUNTER_GS_COMPUTATION_LIMITED + 1 ) ,
- D3D10_COUNTER_PS_COMPUTATION_LIMITED = ( D3D10_COUNTER_PS_MEMORY_LIMITED + 1 ) ,
- D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = ( D3D10_COUNTER_PS_COMPUTATION_LIMITED + 1 ) ,
- D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = ( D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE + 1 ) ,
- D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
+ {
+ D3D10_COUNTER_GPU_IDLE = 0,
+ D3D10_COUNTER_VERTEX_PROCESSING = ( D3D10_COUNTER_GPU_IDLE + 1 ) ,
+ D3D10_COUNTER_GEOMETRY_PROCESSING = ( D3D10_COUNTER_VERTEX_PROCESSING + 1 ) ,
+ D3D10_COUNTER_PIXEL_PROCESSING = ( D3D10_COUNTER_GEOMETRY_PROCESSING + 1 ) ,
+ D3D10_COUNTER_OTHER_GPU_PROCESSING = ( D3D10_COUNTER_PIXEL_PROCESSING + 1 ) ,
+ D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_OTHER_GPU_PROCESSING + 1 ) ,
+ D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION + 1 ) ,
+ D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION + 1 ) ,
+ D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION + 1 ) ,
+ D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION + 1 ) ,
+ D3D10_COUNTER_VS_MEMORY_LIMITED = ( D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION + 1 ) ,
+ D3D10_COUNTER_VS_COMPUTATION_LIMITED = ( D3D10_COUNTER_VS_MEMORY_LIMITED + 1 ) ,
+ D3D10_COUNTER_GS_MEMORY_LIMITED = ( D3D10_COUNTER_VS_COMPUTATION_LIMITED + 1 ) ,
+ D3D10_COUNTER_GS_COMPUTATION_LIMITED = ( D3D10_COUNTER_GS_MEMORY_LIMITED + 1 ) ,
+ D3D10_COUNTER_PS_MEMORY_LIMITED = ( D3D10_COUNTER_GS_COMPUTATION_LIMITED + 1 ) ,
+ D3D10_COUNTER_PS_COMPUTATION_LIMITED = ( D3D10_COUNTER_PS_MEMORY_LIMITED + 1 ) ,
+ D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = ( D3D10_COUNTER_PS_COMPUTATION_LIMITED + 1 ) ,
+ D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = ( D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE + 1 ) ,
+ D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
} D3D10_COUNTER;
typedef
enum D3D10_COUNTER_TYPE
- { D3D10_COUNTER_TYPE_FLOAT32 = 0,
- D3D10_COUNTER_TYPE_UINT16 = ( D3D10_COUNTER_TYPE_FLOAT32 + 1 ) ,
- D3D10_COUNTER_TYPE_UINT32 = ( D3D10_COUNTER_TYPE_UINT16 + 1 ) ,
- D3D10_COUNTER_TYPE_UINT64 = ( D3D10_COUNTER_TYPE_UINT32 + 1 )
+ {
+ D3D10_COUNTER_TYPE_FLOAT32 = 0,
+ D3D10_COUNTER_TYPE_UINT16 = ( D3D10_COUNTER_TYPE_FLOAT32 + 1 ) ,
+ D3D10_COUNTER_TYPE_UINT32 = ( D3D10_COUNTER_TYPE_UINT16 + 1 ) ,
+ D3D10_COUNTER_TYPE_UINT64 = ( D3D10_COUNTER_TYPE_UINT32 + 1 )
} D3D10_COUNTER_TYPE;
typedef struct D3D10_COUNTER_DESC
@@ -4614,10 +4679,11 @@ EXTERN_C const IID IID_ID3D10Counter;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D10_COUNTER_DESC *pDesc) = 0;
+ _Out_ D3D10_COUNTER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10CounterVtbl
@@ -4628,7 +4694,7 @@ EXTERN_C const IID IID_ID3D10Counter;
ID3D10Counter * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Counter * This);
@@ -4639,32 +4705,32 @@ EXTERN_C const IID IID_ID3D10Counter;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10Counter * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *Begin )(
ID3D10Counter * This);
@@ -4675,11 +4741,11 @@ EXTERN_C const IID IID_ID3D10Counter;
HRESULT ( STDMETHODCALLTYPE *GetData )(
ID3D10Counter * This,
/* [annotation] */
- __out_bcount_opt(DataSize) void *pData,
+ _Out_writes_bytes_opt_(DataSize) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags);
+ _In_ UINT GetDataFlags);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D10Counter * This);
@@ -4687,7 +4753,7 @@ EXTERN_C const IID IID_ID3D10Counter;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10Counter * This,
/* [annotation] */
- __out D3D10_COUNTER_DESC *pDesc);
+ _Out_ D3D10_COUNTER_DESC *pDesc);
END_INTERFACE
} ID3D10CounterVtbl;
@@ -4769,439 +4835,439 @@ EXTERN_C const IID IID_ID3D10Device;
public:
virtual void STDMETHODCALLTYPE VSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE PSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE PSSetShader(
/* [annotation] */
- __in_opt ID3D10PixelShader *pPixelShader) = 0;
+ _In_opt_ ID3D10PixelShader *pPixelShader) = 0;
virtual void STDMETHODCALLTYPE PSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE VSSetShader(
/* [annotation] */
- __in_opt ID3D10VertexShader *pVertexShader) = 0;
+ _In_opt_ ID3D10VertexShader *pVertexShader) = 0;
virtual void STDMETHODCALLTYPE DrawIndexed(
/* [annotation] */
- __in UINT IndexCount,
+ _In_ UINT IndexCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation) = 0;
+ _In_ INT BaseVertexLocation) = 0;
virtual void STDMETHODCALLTYPE Draw(
/* [annotation] */
- __in UINT VertexCount,
+ _In_ UINT VertexCount,
/* [annotation] */
- __in UINT StartVertexLocation) = 0;
+ _In_ UINT StartVertexLocation) = 0;
virtual void STDMETHODCALLTYPE PSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE IASetInputLayout(
/* [annotation] */
- __in_opt ID3D10InputLayout *pInputLayout) = 0;
+ _In_opt_ ID3D10InputLayout *pInputLayout) = 0;
virtual void STDMETHODCALLTYPE IASetVertexBuffers(
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pStrides,
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pOffsets) = 0;
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE IASetIndexBuffer(
/* [annotation] */
- __in_opt ID3D10Buffer *pIndexBuffer,
+ _In_opt_ ID3D10Buffer *pIndexBuffer,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT Offset) = 0;
+ _In_ UINT Offset) = 0;
virtual void STDMETHODCALLTYPE DrawIndexedInstanced(
/* [annotation] */
- __in UINT IndexCountPerInstance,
+ _In_ UINT IndexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation,
+ _In_ INT BaseVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation) = 0;
+ _In_ UINT StartInstanceLocation) = 0;
virtual void STDMETHODCALLTYPE DrawInstanced(
/* [annotation] */
- __in UINT VertexCountPerInstance,
+ _In_ UINT VertexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartVertexLocation,
+ _In_ UINT StartVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation) = 0;
+ _In_ UINT StartInstanceLocation) = 0;
virtual void STDMETHODCALLTYPE GSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE GSSetShader(
/* [annotation] */
- __in_opt ID3D10GeometryShader *pShader) = 0;
+ _In_opt_ ID3D10GeometryShader *pShader) = 0;
virtual void STDMETHODCALLTYPE IASetPrimitiveTopology(
/* [annotation] */
- __in D3D10_PRIMITIVE_TOPOLOGY Topology) = 0;
+ _In_ D3D10_PRIMITIVE_TOPOLOGY Topology) = 0;
virtual void STDMETHODCALLTYPE VSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE VSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE SetPredication(
/* [annotation] */
- __in_opt ID3D10Predicate *pPredicate,
+ _In_opt_ ID3D10Predicate *pPredicate,
/* [annotation] */
- __in BOOL PredicateValue) = 0;
+ _In_ BOOL PredicateValue) = 0;
virtual void STDMETHODCALLTYPE GSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE GSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE OMSetRenderTargets(
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D10DepthStencilView *pDepthStencilView) = 0;
+ _In_opt_ ID3D10DepthStencilView *pDepthStencilView) = 0;
virtual void STDMETHODCALLTYPE OMSetBlendState(
/* [annotation] */
- __in_opt ID3D10BlendState *pBlendState,
+ _In_opt_ ID3D10BlendState *pBlendState,
/* [annotation] */
- __in const FLOAT BlendFactor[ 4 ],
+ _In_ const FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __in UINT SampleMask) = 0;
+ _In_ UINT SampleMask) = 0;
virtual void STDMETHODCALLTYPE OMSetDepthStencilState(
/* [annotation] */
- __in_opt ID3D10DepthStencilState *pDepthStencilState,
+ _In_opt_ ID3D10DepthStencilState *pDepthStencilState,
/* [annotation] */
- __in UINT StencilRef) = 0;
+ _In_ UINT StencilRef) = 0;
virtual void STDMETHODCALLTYPE SOSetTargets(
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
/* [annotation] */
- __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppSOTargets,
/* [annotation] */
- __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0;
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE DrawAuto( void) = 0;
virtual void STDMETHODCALLTYPE RSSetState(
/* [annotation] */
- __in_opt ID3D10RasterizerState *pRasterizerState) = 0;
+ _In_opt_ ID3D10RasterizerState *pRasterizerState) = 0;
virtual void STDMETHODCALLTYPE RSSetViewports(
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
/* [annotation] */
- __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports) = 0;
+ _In_reads_opt_(NumViewports) const D3D10_VIEWPORT *pViewports) = 0;
virtual void STDMETHODCALLTYPE RSSetScissorRects(
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
/* [annotation] */
- __in_ecount_opt(NumRects) const D3D10_RECT *pRects) = 0;
+ _In_reads_opt_(NumRects) const D3D10_RECT *pRects) = 0;
virtual void STDMETHODCALLTYPE CopySubresourceRegion(
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in UINT DstX,
+ _In_ UINT DstX,
/* [annotation] */
- __in UINT DstY,
+ _In_ UINT DstY,
/* [annotation] */
- __in UINT DstZ,
+ _In_ UINT DstZ,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pSrcBox) = 0;
+ _In_opt_ const D3D10_BOX *pSrcBox) = 0;
virtual void STDMETHODCALLTYPE CopyResource(
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource) = 0;
+ _In_ ID3D10Resource *pSrcResource) = 0;
virtual void STDMETHODCALLTYPE UpdateSubresource(
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pDstBox,
+ _In_opt_ const D3D10_BOX *pDstBox,
/* [annotation] */
- __in const void *pSrcData,
+ _In_ const void *pSrcData,
/* [annotation] */
- __in UINT SrcRowPitch,
+ _In_ UINT SrcRowPitch,
/* [annotation] */
- __in UINT SrcDepthPitch) = 0;
+ _In_ UINT SrcDepthPitch) = 0;
virtual void STDMETHODCALLTYPE ClearRenderTargetView(
/* [annotation] */
- __in ID3D10RenderTargetView *pRenderTargetView,
+ _In_ ID3D10RenderTargetView *pRenderTargetView,
/* [annotation] */
- __in const FLOAT ColorRGBA[ 4 ]) = 0;
+ _In_ const FLOAT ColorRGBA[ 4 ]) = 0;
virtual void STDMETHODCALLTYPE ClearDepthStencilView(
/* [annotation] */
- __in ID3D10DepthStencilView *pDepthStencilView,
+ _In_ ID3D10DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in UINT ClearFlags,
+ _In_ UINT ClearFlags,
/* [annotation] */
- __in FLOAT Depth,
+ _In_ FLOAT Depth,
/* [annotation] */
- __in UINT8 Stencil) = 0;
+ _In_ UINT8 Stencil) = 0;
virtual void STDMETHODCALLTYPE GenerateMips(
/* [annotation] */
- __in ID3D10ShaderResourceView *pShaderResourceView) = 0;
+ _In_ ID3D10ShaderResourceView *pShaderResourceView) = 0;
virtual void STDMETHODCALLTYPE ResolveSubresource(
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in DXGI_FORMAT Format) = 0;
+ _In_ DXGI_FORMAT Format) = 0;
virtual void STDMETHODCALLTYPE VSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE PSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE PSGetShader(
/* [annotation] */
- __out ID3D10PixelShader **ppPixelShader) = 0;
+ _Out_ ID3D10PixelShader **ppPixelShader) = 0;
virtual void STDMETHODCALLTYPE PSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE VSGetShader(
/* [annotation] */
- __out ID3D10VertexShader **ppVertexShader) = 0;
+ _Out_ ID3D10VertexShader **ppVertexShader) = 0;
virtual void STDMETHODCALLTYPE PSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE IAGetInputLayout(
/* [annotation] */
- __out ID3D10InputLayout **ppInputLayout) = 0;
+ _Out_ ID3D10InputLayout **ppInputLayout) = 0;
virtual void STDMETHODCALLTYPE IAGetVertexBuffers(
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppVertexBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pStrides,
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0;
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE IAGetIndexBuffer(
/* [annotation] */
- __out_opt ID3D10Buffer **pIndexBuffer,
+ _Out_opt_ ID3D10Buffer **pIndexBuffer,
/* [annotation] */
- __out_opt DXGI_FORMAT *Format,
+ _Out_opt_ DXGI_FORMAT *Format,
/* [annotation] */
- __out_opt UINT *Offset) = 0;
+ _Out_opt_ UINT *Offset) = 0;
virtual void STDMETHODCALLTYPE GSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE GSGetShader(
/* [annotation] */
- __out ID3D10GeometryShader **ppGeometryShader) = 0;
+ _Out_ ID3D10GeometryShader **ppGeometryShader) = 0;
virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology(
/* [annotation] */
- __out D3D10_PRIMITIVE_TOPOLOGY *pTopology) = 0;
+ _Out_ D3D10_PRIMITIVE_TOPOLOGY *pTopology) = 0;
virtual void STDMETHODCALLTYPE VSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE VSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE GetPredication(
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate,
+ _Out_opt_ ID3D10Predicate **ppPredicate,
/* [annotation] */
- __out_opt BOOL *pPredicateValue) = 0;
+ _Out_opt_ BOOL *pPredicateValue) = 0;
virtual void STDMETHODCALLTYPE GSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE GSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE OMGetRenderTargets(
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0;
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView) = 0;
virtual void STDMETHODCALLTYPE OMGetBlendState(
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState,
+ _Out_opt_ ID3D10BlendState **ppBlendState,
/* [annotation] */
- __out_opt FLOAT BlendFactor[ 4 ],
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __out_opt UINT *pSampleMask) = 0;
+ _Out_opt_ UINT *pSampleMask) = 0;
virtual void STDMETHODCALLTYPE OMGetDepthStencilState(
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState,
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState,
/* [annotation] */
- __out_opt UINT *pStencilRef) = 0;
+ _Out_opt_ UINT *pStencilRef) = 0;
virtual void STDMETHODCALLTYPE SOGetTargets(
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppSOTargets,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0;
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE RSGetState(
/* [annotation] */
- __out ID3D10RasterizerState **ppRasterizerState) = 0;
+ _Out_ ID3D10RasterizerState **ppRasterizerState) = 0;
virtual void STDMETHODCALLTYPE RSGetViewports(
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
/* [annotation] */
- __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports) = 0;
+ _Out_writes_opt_(*NumViewports) D3D10_VIEWPORT *pViewports) = 0;
virtual void STDMETHODCALLTYPE RSGetScissorRects(
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
/* [annotation] */
- __out_ecount_opt(*NumRects) D3D10_RECT *pRects) = 0;
+ _Out_writes_opt_(*NumRects) D3D10_RECT *pRects) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0;
@@ -5212,25 +5278,25 @@ EXTERN_C const IID IID_ID3D10Device;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData) = 0;
+ _Out_writes_bytes_opt_(*pDataSize) void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData) = 0;
+ _In_reads_bytes_opt_(DataSize) const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData) = 0;
+ _In_opt_ const IUnknown *pData) = 0;
virtual void STDMETHODCALLTYPE ClearState( void) = 0;
@@ -5238,214 +5304,215 @@ EXTERN_C const IID IID_ID3D10Device;
virtual HRESULT STDMETHODCALLTYPE CreateBuffer(
/* [annotation] */
- __in const D3D10_BUFFER_DESC *pDesc,
+ _In_ const D3D10_BUFFER_DESC *pDesc,
/* [annotation] */
- __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_opt_ const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D10Buffer **ppBuffer) = 0;
+ _Out_opt_ ID3D10Buffer **ppBuffer) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture1D(
/* [annotation] */
- __in const D3D10_TEXTURE1D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE1D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture1D **ppTexture1D) = 0;
+ _Out_ ID3D10Texture1D **ppTexture1D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture2D(
/* [annotation] */
- __in const D3D10_TEXTURE2D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE2D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture2D **ppTexture2D) = 0;
+ _Out_ ID3D10Texture2D **ppTexture2D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture3D(
/* [annotation] */
- __in const D3D10_TEXTURE3D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE3D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture3D **ppTexture3D) = 0;
+ _Out_ ID3D10Texture3D **ppTexture3D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView(
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10ShaderResourceView **ppSRView) = 0;
+ _Out_opt_ ID3D10ShaderResourceView **ppSRView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView(
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10RenderTargetView **ppRTView) = 0;
+ _Out_opt_ ID3D10RenderTargetView **ppRTView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView(
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0;
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateInputLayout(
/* [annotation] */
- __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+ _In_reads_(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
/* [annotation] */
- __in const void *pShaderBytecodeWithInputSignature,
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10InputLayout **ppInputLayout) = 0;
+ _Out_opt_ ID3D10InputLayout **ppInputLayout) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateVertexShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10VertexShader **ppVertexShader) = 0;
+ _Out_opt_ ID3D10VertexShader **ppVertexShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader) = 0;
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+ _In_reads_opt_(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
/* [annotation] */
- __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
+ _In_range_( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
/* [annotation] */
- __in UINT OutputStreamStride,
+ _In_ UINT OutputStreamStride,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader) = 0;
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreatePixelShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10PixelShader **ppPixelShader) = 0;
+ _Out_opt_ ID3D10PixelShader **ppPixelShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateBlendState(
/* [annotation] */
- __in const D3D10_BLEND_DESC *pBlendStateDesc,
+ _In_ const D3D10_BLEND_DESC *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState) = 0;
+ _Out_opt_ ID3D10BlendState **ppBlendState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState(
/* [annotation] */
- __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ _In_ const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState) = 0;
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState(
/* [annotation] */
- __in const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+ _In_ const D3D10_RASTERIZER_DESC *pRasterizerDesc,
/* [annotation] */
- __out_opt ID3D10RasterizerState **ppRasterizerState) = 0;
+ _Out_opt_ ID3D10RasterizerState **ppRasterizerState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSamplerState(
/* [annotation] */
- __in const D3D10_SAMPLER_DESC *pSamplerDesc,
+ _In_ const D3D10_SAMPLER_DESC *pSamplerDesc,
/* [annotation] */
- __out_opt ID3D10SamplerState **ppSamplerState) = 0;
+ _Out_opt_ ID3D10SamplerState **ppSamplerState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateQuery(
/* [annotation] */
- __in const D3D10_QUERY_DESC *pQueryDesc,
+ _In_ const D3D10_QUERY_DESC *pQueryDesc,
/* [annotation] */
- __out_opt ID3D10Query **ppQuery) = 0;
+ _Out_opt_ ID3D10Query **ppQuery) = 0;
virtual HRESULT STDMETHODCALLTYPE CreatePredicate(
/* [annotation] */
- __in const D3D10_QUERY_DESC *pPredicateDesc,
+ _In_ const D3D10_QUERY_DESC *pPredicateDesc,
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate) = 0;
+ _Out_opt_ ID3D10Predicate **ppPredicate) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateCounter(
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pCounterDesc,
+ _In_ const D3D10_COUNTER_DESC *pCounterDesc,
/* [annotation] */
- __out_opt ID3D10Counter **ppCounter) = 0;
+ _Out_opt_ ID3D10Counter **ppCounter) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport(
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __out UINT *pFormatSupport) = 0;
+ _Out_ UINT *pFormatSupport) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels(
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT SampleCount,
+ _In_ UINT SampleCount,
/* [annotation] */
- __out UINT *pNumQualityLevels) = 0;
+ _Out_ UINT *pNumQualityLevels) = 0;
virtual void STDMETHODCALLTYPE CheckCounterInfo(
/* [annotation] */
- __out D3D10_COUNTER_INFO *pCounterInfo) = 0;
+ _Out_ D3D10_COUNTER_INFO *pCounterInfo) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckCounter(
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pDesc,
+ _In_ const D3D10_COUNTER_DESC *pDesc,
/* [annotation] */
- __out D3D10_COUNTER_TYPE *pType,
+ _Out_ D3D10_COUNTER_TYPE *pType,
/* [annotation] */
- __out UINT *pActiveCounters,
+ _Out_ UINT *pActiveCounters,
/* [annotation] */
- __out_ecount_opt(*pNameLength) LPSTR szName,
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
/* [annotation] */
- __inout_opt UINT *pNameLength,
+ _Inout_opt_ UINT *pNameLength,
/* [annotation] */
- __out_ecount_opt(*pUnitsLength) LPSTR szUnits,
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
/* [annotation] */
- __inout_opt UINT *pUnitsLength,
+ _Inout_opt_ UINT *pUnitsLength,
/* [annotation] */
- __out_ecount_opt(*pDescriptionLength) LPSTR szDescription,
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
/* [annotation] */
- __inout_opt UINT *pDescriptionLength) = 0;
+ _Inout_opt_ UINT *pDescriptionLength) = 0;
virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0;
virtual HRESULT STDMETHODCALLTYPE OpenSharedResource(
/* [annotation] */
- __in HANDLE hResource,
+ _In_ HANDLE hResource,
/* [annotation] */
- __in REFIID ReturnedInterface,
+ _In_ REFIID ReturnedInterface,
/* [annotation] */
- __out_opt void **ppResource) = 0;
+ _Out_opt_ void **ppResource) = 0;
virtual void STDMETHODCALLTYPE SetTextFilterSize(
/* [annotation] */
- __in UINT Width,
+ _In_ UINT Width,
/* [annotation] */
- __in UINT Height) = 0;
+ _In_ UINT Height) = 0;
virtual void STDMETHODCALLTYPE GetTextFilterSize(
/* [annotation] */
- __out_opt UINT *pWidth,
+ _Out_opt_ UINT *pWidth,
/* [annotation] */
- __out_opt UINT *pHeight) = 0;
+ _Out_opt_ UINT *pHeight) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10DeviceVtbl
@@ -5456,7 +5523,7 @@ EXTERN_C const IID IID_ID3D10Device;
ID3D10Device * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Device * This);
@@ -5467,211 +5534,211 @@ EXTERN_C const IID IID_ID3D10Device;
void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSSetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSSetShader )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10PixelShader *pPixelShader);
+ _In_opt_ ID3D10PixelShader *pPixelShader);
void ( STDMETHODCALLTYPE *PSSetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *VSSetShader )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10VertexShader *pVertexShader);
+ _In_opt_ ID3D10VertexShader *pVertexShader);
void ( STDMETHODCALLTYPE *DrawIndexed )(
ID3D10Device * This,
/* [annotation] */
- __in UINT IndexCount,
+ _In_ UINT IndexCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation);
+ _In_ INT BaseVertexLocation);
void ( STDMETHODCALLTYPE *Draw )(
ID3D10Device * This,
/* [annotation] */
- __in UINT VertexCount,
+ _In_ UINT VertexCount,
/* [annotation] */
- __in UINT StartVertexLocation);
+ _In_ UINT StartVertexLocation);
void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *IASetInputLayout )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10InputLayout *pInputLayout);
+ _In_opt_ ID3D10InputLayout *pInputLayout);
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pStrides,
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10Buffer *pIndexBuffer,
+ _In_opt_ ID3D10Buffer *pIndexBuffer,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT Offset);
+ _In_ UINT Offset);
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D10Device * This,
/* [annotation] */
- __in UINT IndexCountPerInstance,
+ _In_ UINT IndexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation,
+ _In_ INT BaseVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D10Device * This,
/* [annotation] */
- __in UINT VertexCountPerInstance,
+ _In_ UINT VertexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartVertexLocation,
+ _In_ UINT StartVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSSetShader )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10GeometryShader *pShader);
+ _In_opt_ ID3D10GeometryShader *pShader);
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D10Device * This,
/* [annotation] */
- __in D3D10_PRIMITIVE_TOPOLOGY Topology);
+ _In_ D3D10_PRIMITIVE_TOPOLOGY Topology);
void ( STDMETHODCALLTYPE *VSSetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSSetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10Predicate *pPredicate,
+ _In_opt_ ID3D10Predicate *pPredicate,
/* [annotation] */
- __in BOOL PredicateValue);
+ _In_ BOOL PredicateValue);
void ( STDMETHODCALLTYPE *GSSetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSSetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D10DepthStencilView *pDepthStencilView);
+ _In_opt_ ID3D10DepthStencilView *pDepthStencilView);
void ( STDMETHODCALLTYPE *OMSetBlendState )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10BlendState *pBlendState,
+ _In_opt_ ID3D10BlendState *pBlendState,
/* [annotation] */
- __in const FLOAT BlendFactor[ 4 ],
+ _In_ const FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __in UINT SampleMask);
+ _In_ UINT SampleMask);
void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10DepthStencilState *pDepthStencilState,
+ _In_opt_ ID3D10DepthStencilState *pDepthStencilState,
/* [annotation] */
- __in UINT StencilRef);
+ _In_ UINT StencilRef);
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
/* [annotation] */
- __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppSOTargets,
/* [annotation] */
- __in_ecount_opt(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *DrawAuto )(
ID3D10Device * This);
@@ -5679,286 +5746,286 @@ EXTERN_C const IID IID_ID3D10Device;
void ( STDMETHODCALLTYPE *RSSetState )(
ID3D10Device * This,
/* [annotation] */
- __in_opt ID3D10RasterizerState *pRasterizerState);
+ _In_opt_ ID3D10RasterizerState *pRasterizerState);
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D10Device * This,
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
/* [annotation] */
- __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports);
+ _In_reads_opt_(NumViewports) const D3D10_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D10Device * This,
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
/* [annotation] */
- __in_ecount_opt(NumRects) const D3D10_RECT *pRects);
+ _In_reads_opt_(NumRects) const D3D10_RECT *pRects);
void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in UINT DstX,
+ _In_ UINT DstX,
/* [annotation] */
- __in UINT DstY,
+ _In_ UINT DstY,
/* [annotation] */
- __in UINT DstZ,
+ _In_ UINT DstZ,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pSrcBox);
+ _In_opt_ const D3D10_BOX *pSrcBox);
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource);
+ _In_ ID3D10Resource *pSrcResource);
void ( STDMETHODCALLTYPE *UpdateSubresource )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pDstBox,
+ _In_opt_ const D3D10_BOX *pDstBox,
/* [annotation] */
- __in const void *pSrcData,
+ _In_ const void *pSrcData,
/* [annotation] */
- __in UINT SrcRowPitch,
+ _In_ UINT SrcRowPitch,
/* [annotation] */
- __in UINT SrcDepthPitch);
+ _In_ UINT SrcDepthPitch);
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10RenderTargetView *pRenderTargetView,
+ _In_ ID3D10RenderTargetView *pRenderTargetView,
/* [annotation] */
- __in const FLOAT ColorRGBA[ 4 ]);
+ _In_ const FLOAT ColorRGBA[ 4 ]);
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10DepthStencilView *pDepthStencilView,
+ _In_ ID3D10DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in UINT ClearFlags,
+ _In_ UINT ClearFlags,
/* [annotation] */
- __in FLOAT Depth,
+ _In_ FLOAT Depth,
/* [annotation] */
- __in UINT8 Stencil);
+ _In_ UINT8 Stencil);
void ( STDMETHODCALLTYPE *GenerateMips )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10ShaderResourceView *pShaderResourceView);
+ _In_ ID3D10ShaderResourceView *pShaderResourceView);
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in DXGI_FORMAT Format);
+ _In_ DXGI_FORMAT Format);
void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSGetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSGetShader )(
ID3D10Device * This,
/* [annotation] */
- __out ID3D10PixelShader **ppPixelShader);
+ _Out_ ID3D10PixelShader **ppPixelShader);
void ( STDMETHODCALLTYPE *PSGetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *VSGetShader )(
ID3D10Device * This,
/* [annotation] */
- __out ID3D10VertexShader **ppVertexShader);
+ _Out_ ID3D10VertexShader **ppVertexShader);
void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *IAGetInputLayout )(
ID3D10Device * This,
/* [annotation] */
- __out ID3D10InputLayout **ppInputLayout);
+ _Out_ ID3D10InputLayout **ppInputLayout);
void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppVertexBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pStrides,
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets);
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
ID3D10Device * This,
/* [annotation] */
- __out_opt ID3D10Buffer **pIndexBuffer,
+ _Out_opt_ ID3D10Buffer **pIndexBuffer,
/* [annotation] */
- __out_opt DXGI_FORMAT *Format,
+ _Out_opt_ DXGI_FORMAT *Format,
/* [annotation] */
- __out_opt UINT *Offset);
+ _Out_opt_ UINT *Offset);
void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSGetShader )(
ID3D10Device * This,
/* [annotation] */
- __out ID3D10GeometryShader **ppGeometryShader);
+ _Out_ ID3D10GeometryShader **ppGeometryShader);
void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
ID3D10Device * This,
/* [annotation] */
- __out D3D10_PRIMITIVE_TOPOLOGY *pTopology);
+ _Out_ D3D10_PRIMITIVE_TOPOLOGY *pTopology);
void ( STDMETHODCALLTYPE *VSGetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSGetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *GetPredication )(
ID3D10Device * This,
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate,
+ _Out_opt_ ID3D10Predicate **ppPredicate,
/* [annotation] */
- __out_opt BOOL *pPredicateValue);
+ _Out_opt_ BOOL *pPredicateValue);
void ( STDMETHODCALLTYPE *GSGetShaderResources )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSGetSamplers )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView);
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView);
void ( STDMETHODCALLTYPE *OMGetBlendState )(
ID3D10Device * This,
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState,
+ _Out_opt_ ID3D10BlendState **ppBlendState,
/* [annotation] */
- __out_opt FLOAT BlendFactor[ 4 ],
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __out_opt UINT *pSampleMask);
+ _Out_opt_ UINT *pSampleMask);
void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
ID3D10Device * This,
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState,
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState,
/* [annotation] */
- __out_opt UINT *pStencilRef);
+ _Out_opt_ UINT *pStencilRef);
void ( STDMETHODCALLTYPE *SOGetTargets )(
ID3D10Device * This,
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppSOTargets,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets);
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
void ( STDMETHODCALLTYPE *RSGetState )(
ID3D10Device * This,
/* [annotation] */
- __out ID3D10RasterizerState **ppRasterizerState);
+ _Out_ ID3D10RasterizerState **ppRasterizerState);
void ( STDMETHODCALLTYPE *RSGetViewports )(
ID3D10Device * This,
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
/* [annotation] */
- __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports);
+ _Out_writes_opt_(*NumViewports) D3D10_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSGetScissorRects )(
ID3D10Device * This,
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
/* [annotation] */
- __out_ecount_opt(*NumRects) D3D10_RECT *pRects);
+ _Out_writes_opt_(*NumRects) D3D10_RECT *pRects);
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D10Device * This);
@@ -5973,27 +6040,27 @@ EXTERN_C const IID IID_ID3D10Device;
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *ClearState )(
ID3D10Device * This);
@@ -6004,211 +6071,211 @@ EXTERN_C const IID IID_ID3D10Device;
HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_BUFFER_DESC *pDesc,
+ _In_ const D3D10_BUFFER_DESC *pDesc,
/* [annotation] */
- __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_opt_ const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D10Buffer **ppBuffer);
+ _Out_opt_ ID3D10Buffer **ppBuffer);
HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_TEXTURE1D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE1D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture1D **ppTexture1D);
+ _Out_ ID3D10Texture1D **ppTexture1D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_TEXTURE2D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE2D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture2D **ppTexture2D);
+ _Out_ ID3D10Texture2D **ppTexture2D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_TEXTURE3D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE3D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture3D **ppTexture3D);
+ _Out_ ID3D10Texture3D **ppTexture3D);
HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10ShaderResourceView **ppSRView);
+ _Out_opt_ ID3D10ShaderResourceView **ppSRView);
HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10RenderTargetView **ppRTView);
+ _Out_opt_ ID3D10RenderTargetView **ppRTView);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D10Device * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView);
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView);
HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
ID3D10Device * This,
/* [annotation] */
- __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+ _In_reads_(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
/* [annotation] */
- __in const void *pShaderBytecodeWithInputSignature,
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10InputLayout **ppInputLayout);
+ _Out_opt_ ID3D10InputLayout **ppInputLayout);
HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
ID3D10Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10VertexShader **ppVertexShader);
+ _Out_opt_ ID3D10VertexShader **ppVertexShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
ID3D10Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader);
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
ID3D10Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+ _In_reads_opt_(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
/* [annotation] */
- __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
+ _In_range_( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
/* [annotation] */
- __in UINT OutputStreamStride,
+ _In_ UINT OutputStreamStride,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader);
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
ID3D10Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10PixelShader **ppPixelShader);
+ _Out_opt_ ID3D10PixelShader **ppPixelShader);
HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_BLEND_DESC *pBlendStateDesc,
+ _In_ const D3D10_BLEND_DESC *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState);
+ _Out_opt_ ID3D10BlendState **ppBlendState);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ _In_ const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState);
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState);
HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+ _In_ const D3D10_RASTERIZER_DESC *pRasterizerDesc,
/* [annotation] */
- __out_opt ID3D10RasterizerState **ppRasterizerState);
+ _Out_opt_ ID3D10RasterizerState **ppRasterizerState);
HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_SAMPLER_DESC *pSamplerDesc,
+ _In_ const D3D10_SAMPLER_DESC *pSamplerDesc,
/* [annotation] */
- __out_opt ID3D10SamplerState **ppSamplerState);
+ _Out_opt_ ID3D10SamplerState **ppSamplerState);
HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_QUERY_DESC *pQueryDesc,
+ _In_ const D3D10_QUERY_DESC *pQueryDesc,
/* [annotation] */
- __out_opt ID3D10Query **ppQuery);
+ _Out_opt_ ID3D10Query **ppQuery);
HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_QUERY_DESC *pPredicateDesc,
+ _In_ const D3D10_QUERY_DESC *pPredicateDesc,
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate);
+ _Out_opt_ ID3D10Predicate **ppPredicate);
HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pCounterDesc,
+ _In_ const D3D10_COUNTER_DESC *pCounterDesc,
/* [annotation] */
- __out_opt ID3D10Counter **ppCounter);
+ _Out_opt_ ID3D10Counter **ppCounter);
HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
ID3D10Device * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __out UINT *pFormatSupport);
+ _Out_ UINT *pFormatSupport);
HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
ID3D10Device * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT SampleCount,
+ _In_ UINT SampleCount,
/* [annotation] */
- __out UINT *pNumQualityLevels);
+ _Out_ UINT *pNumQualityLevels);
void ( STDMETHODCALLTYPE *CheckCounterInfo )(
ID3D10Device * This,
/* [annotation] */
- __out D3D10_COUNTER_INFO *pCounterInfo);
+ _Out_ D3D10_COUNTER_INFO *pCounterInfo);
HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
ID3D10Device * This,
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pDesc,
+ _In_ const D3D10_COUNTER_DESC *pDesc,
/* [annotation] */
- __out D3D10_COUNTER_TYPE *pType,
+ _Out_ D3D10_COUNTER_TYPE *pType,
/* [annotation] */
- __out UINT *pActiveCounters,
+ _Out_ UINT *pActiveCounters,
/* [annotation] */
- __out_ecount_opt(*pNameLength) LPSTR szName,
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
/* [annotation] */
- __inout_opt UINT *pNameLength,
+ _Inout_opt_ UINT *pNameLength,
/* [annotation] */
- __out_ecount_opt(*pUnitsLength) LPSTR szUnits,
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
/* [annotation] */
- __inout_opt UINT *pUnitsLength,
+ _Inout_opt_ UINT *pUnitsLength,
/* [annotation] */
- __out_ecount_opt(*pDescriptionLength) LPSTR szDescription,
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
/* [annotation] */
- __inout_opt UINT *pDescriptionLength);
+ _Inout_opt_ UINT *pDescriptionLength);
UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
ID3D10Device * This);
@@ -6216,25 +6283,25 @@ EXTERN_C const IID IID_ID3D10Device;
HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
ID3D10Device * This,
/* [annotation] */
- __in HANDLE hResource,
+ _In_ HANDLE hResource,
/* [annotation] */
- __in REFIID ReturnedInterface,
+ _In_ REFIID ReturnedInterface,
/* [annotation] */
- __out_opt void **ppResource);
+ _Out_opt_ void **ppResource);
void ( STDMETHODCALLTYPE *SetTextFilterSize )(
ID3D10Device * This,
/* [annotation] */
- __in UINT Width,
+ _In_ UINT Width,
/* [annotation] */
- __in UINT Height);
+ _In_ UINT Height);
void ( STDMETHODCALLTYPE *GetTextFilterSize )(
ID3D10Device * This,
/* [annotation] */
- __out_opt UINT *pWidth,
+ _Out_opt_ UINT *pWidth,
/* [annotation] */
- __out_opt UINT *pHeight);
+ _Out_opt_ UINT *pHeight);
END_INTERFACE
} ID3D10DeviceVtbl;
@@ -6555,6 +6622,14 @@ EXTERN_C const IID IID_ID3D10Device;
#endif /* __ID3D10Device_INTERFACE_DEFINED__ */
+/* interface __MIDL_itf_d3d10_0000_0023 */
+/* [local] */
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0023_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0023_v0_0_s_ifspec;
+
#ifndef __ID3D10Multithread_INTERFACE_DEFINED__
#define __ID3D10Multithread_INTERFACE_DEFINED__
@@ -6576,12 +6651,13 @@ EXTERN_C const IID IID_ID3D10Multithread;
virtual BOOL STDMETHODCALLTYPE SetMultithreadProtected(
/* [annotation] */
- __in BOOL bMTProtect) = 0;
+ _In_ BOOL bMTProtect) = 0;
virtual BOOL STDMETHODCALLTYPE GetMultithreadProtected( void) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10MultithreadVtbl
@@ -6592,7 +6668,7 @@ EXTERN_C const IID IID_ID3D10Multithread;
ID3D10Multithread * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Multithread * This);
@@ -6609,7 +6685,7 @@ EXTERN_C const IID IID_ID3D10Multithread;
BOOL ( STDMETHODCALLTYPE *SetMultithreadProtected )(
ID3D10Multithread * This,
/* [annotation] */
- __in BOOL bMTProtect);
+ _In_ BOOL bMTProtect);
BOOL ( STDMETHODCALLTYPE *GetMultithreadProtected )(
ID3D10Multithread * This);
@@ -6665,13 +6741,16 @@ EXTERN_C const IID IID_ID3D10Multithread;
typedef
enum D3D10_CREATE_DEVICE_FLAG
- { D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1,
- D3D10_CREATE_DEVICE_DEBUG = 0x2,
- D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
- D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8,
- D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = 0x10,
- D3D10_CREATE_DEVICE_BGRA_SUPPORT = 0x20,
- D3D10_CREATE_DEVICE_STRICT_VALIDATION = 0x200
+ {
+ D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1,
+ D3D10_CREATE_DEVICE_DEBUG = 0x2,
+ D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
+ D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8,
+ D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = 0x10,
+ D3D10_CREATE_DEVICE_BGRA_SUPPORT = 0x20,
+ D3D10_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80,
+ D3D10_CREATE_DEVICE_STRICT_VALIDATION = 0x200,
+ D3D10_CREATE_DEVICE_DEBUGGABLE = 0x400
} D3D10_CREATE_DEVICE_FLAG;
diff --git a/3rdparty/dxsdk/Include/d3d10_1.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10_1.h
index fc1bdcd127e..09f212b14d4 100644
--- a/3rdparty/dxsdk/Include/d3d10_1.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10_1.h
@@ -1,19 +1,21 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 7.00.0555 */
+ /* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -26,7 +28,7 @@
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
+#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
@@ -45,18 +47,21 @@
#ifndef __ID3D10BlendState1_FWD_DEFINED__
#define __ID3D10BlendState1_FWD_DEFINED__
typedef interface ID3D10BlendState1 ID3D10BlendState1;
+
#endif /* __ID3D10BlendState1_FWD_DEFINED__ */
#ifndef __ID3D10ShaderResourceView1_FWD_DEFINED__
#define __ID3D10ShaderResourceView1_FWD_DEFINED__
typedef interface ID3D10ShaderResourceView1 ID3D10ShaderResourceView1;
+
#endif /* __ID3D10ShaderResourceView1_FWD_DEFINED__ */
#ifndef __ID3D10Device1_FWD_DEFINED__
#define __ID3D10Device1_FWD_DEFINED__
typedef interface ID3D10Device1 ID3D10Device1;
+
#endif /* __ID3D10Device1_FWD_DEFINED__ */
@@ -123,11 +128,12 @@ If possibly targeting d3d10.1, include d3d10_1.h instead of d3d10.h, or ensure d
typedef
enum D3D10_FEATURE_LEVEL1
- { D3D10_FEATURE_LEVEL_10_0 = 0xa000,
- D3D10_FEATURE_LEVEL_10_1 = 0xa100,
- D3D10_FEATURE_LEVEL_9_1 = 0x9100,
- D3D10_FEATURE_LEVEL_9_2 = 0x9200,
- D3D10_FEATURE_LEVEL_9_3 = 0x9300
+ {
+ D3D10_FEATURE_LEVEL_10_0 = 0xa000,
+ D3D10_FEATURE_LEVEL_10_1 = 0xa100,
+ D3D10_FEATURE_LEVEL_9_1 = 0x9100,
+ D3D10_FEATURE_LEVEL_9_2 = 0x9200,
+ D3D10_FEATURE_LEVEL_9_3 = 0x9300
} D3D10_FEATURE_LEVEL1;
typedef struct D3D10_RENDER_TARGET_BLEND_DESC1
@@ -171,10 +177,11 @@ EXTERN_C const IID IID_ID3D10BlendState1;
public:
virtual void STDMETHODCALLTYPE GetDesc1(
/* [annotation] */
- __out D3D10_BLEND_DESC1 *pDesc) = 0;
+ _Out_ D3D10_BLEND_DESC1 *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10BlendState1Vtbl
@@ -185,7 +192,7 @@ EXTERN_C const IID IID_ID3D10BlendState1;
ID3D10BlendState1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10BlendState1 * This);
@@ -196,42 +203,42 @@ EXTERN_C const IID IID_ID3D10BlendState1;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10BlendState1 * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10BlendState1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10BlendState1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10BlendState1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10BlendState1 * This,
/* [annotation] */
- __out D3D10_BLEND_DESC *pDesc);
+ _Out_ D3D10_BLEND_DESC *pDesc);
void ( STDMETHODCALLTYPE *GetDesc1 )(
ID3D10BlendState1 * This,
/* [annotation] */
- __out D3D10_BLEND_DESC1 *pDesc);
+ _Out_ D3D10_BLEND_DESC1 *pDesc);
END_INTERFACE
} ID3D10BlendState1Vtbl;
@@ -341,10 +348,11 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView1;
public:
virtual void STDMETHODCALLTYPE GetDesc1(
/* [annotation] */
- __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0;
+ _Out_ D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10ShaderResourceView1Vtbl
@@ -355,7 +363,7 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView1;
ID3D10ShaderResourceView1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10ShaderResourceView1 * This);
@@ -366,47 +374,47 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView1;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __out ID3D10Device **ppDevice);
+ _Out_ ID3D10Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __out ID3D10Resource **ppResource);
+ _Out_ ID3D10Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
+ _Out_ D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
void ( STDMETHODCALLTYPE *GetDesc1 )(
ID3D10ShaderResourceView1 * This,
/* [annotation] */
- __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc);
+ _Out_ D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc);
END_INTERFACE
} ID3D10ShaderResourceView1Vtbl;
@@ -471,8 +479,9 @@ EXTERN_C const IID IID_ID3D10ShaderResourceView1;
typedef
enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS
- { D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
- D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
+ {
+ D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
+ D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
} D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS;
@@ -497,22 +506,23 @@ EXTERN_C const IID IID_ID3D10Device1;
public:
virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1(
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
+ _In_opt_ const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
/* [annotation] */
- __out_opt ID3D10ShaderResourceView1 **ppSRView) = 0;
+ _Out_opt_ ID3D10ShaderResourceView1 **ppSRView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateBlendState1(
/* [annotation] */
- __in const D3D10_BLEND_DESC1 *pBlendStateDesc,
+ _In_ const D3D10_BLEND_DESC1 *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D10BlendState1 **ppBlendState) = 0;
+ _Out_opt_ ID3D10BlendState1 **ppBlendState) = 0;
virtual D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE GetFeatureLevel( void) = 0;
};
+
#else /* C style interface */
typedef struct ID3D10Device1Vtbl
@@ -523,7 +533,7 @@ EXTERN_C const IID IID_ID3D10Device1;
ID3D10Device1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Device1 * This);
@@ -534,211 +544,211 @@ EXTERN_C const IID IID_ID3D10Device1;
void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSSetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSSetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10PixelShader *pPixelShader);
+ _In_opt_ ID3D10PixelShader *pPixelShader);
void ( STDMETHODCALLTYPE *PSSetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *VSSetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10VertexShader *pVertexShader);
+ _In_opt_ ID3D10VertexShader *pVertexShader);
void ( STDMETHODCALLTYPE *DrawIndexed )(
ID3D10Device1 * This,
/* [annotation] */
- __in UINT IndexCount,
+ _In_ UINT IndexCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation);
+ _In_ INT BaseVertexLocation);
void ( STDMETHODCALLTYPE *Draw )(
ID3D10Device1 * This,
/* [annotation] */
- __in UINT VertexCount,
+ _In_ UINT VertexCount,
/* [annotation] */
- __in UINT StartVertexLocation);
+ _In_ UINT StartVertexLocation);
void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *IASetInputLayout )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10InputLayout *pInputLayout);
+ _In_opt_ ID3D10InputLayout *pInputLayout);
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppVertexBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pStrides,
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10Buffer *pIndexBuffer,
+ _In_opt_ ID3D10Buffer *pIndexBuffer,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT Offset);
+ _In_ UINT Offset);
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D10Device1 * This,
/* [annotation] */
- __in UINT IndexCountPerInstance,
+ _In_ UINT IndexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation,
+ _In_ INT BaseVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D10Device1 * This,
/* [annotation] */
- __in UINT VertexCountPerInstance,
+ _In_ UINT VertexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartVertexLocation,
+ _In_ UINT StartVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSSetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10GeometryShader *pShader);
+ _In_opt_ ID3D10GeometryShader *pShader);
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D10Device1 * This,
/* [annotation] */
- __in D3D10_PRIMITIVE_TOPOLOGY Topology);
+ _In_ D3D10_PRIMITIVE_TOPOLOGY Topology);
void ( STDMETHODCALLTYPE *VSSetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSSetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10Predicate *pPredicate,
+ _In_opt_ ID3D10Predicate *pPredicate,
/* [annotation] */
- __in BOOL PredicateValue);
+ _In_ BOOL PredicateValue);
void ( STDMETHODCALLTYPE *GSSetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSSetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D10SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D10DepthStencilView *pDepthStencilView);
+ _In_opt_ ID3D10DepthStencilView *pDepthStencilView);
void ( STDMETHODCALLTYPE *OMSetBlendState )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10BlendState *pBlendState,
+ _In_opt_ ID3D10BlendState *pBlendState,
/* [annotation] */
- __in const FLOAT BlendFactor[ 4 ],
+ _In_ const FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __in UINT SampleMask);
+ _In_ UINT SampleMask);
void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10DepthStencilState *pDepthStencilState,
+ _In_opt_ ID3D10DepthStencilState *pDepthStencilState,
/* [annotation] */
- __in UINT StencilRef);
+ _In_ UINT StencilRef);
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
/* [annotation] */
- __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets,
+ _In_reads_opt_(NumBuffers) ID3D10Buffer *const *ppSOTargets,
/* [annotation] */
- __in_ecount_opt(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *DrawAuto )(
ID3D10Device1 * This);
@@ -746,286 +756,286 @@ EXTERN_C const IID IID_ID3D10Device1;
void ( STDMETHODCALLTYPE *RSSetState )(
ID3D10Device1 * This,
/* [annotation] */
- __in_opt ID3D10RasterizerState *pRasterizerState);
+ _In_opt_ ID3D10RasterizerState *pRasterizerState);
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
/* [annotation] */
- __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports);
+ _In_reads_opt_(NumViewports) const D3D10_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_range_(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
/* [annotation] */
- __in_ecount_opt(NumRects) const D3D10_RECT *pRects);
+ _In_reads_opt_(NumRects) const D3D10_RECT *pRects);
void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in UINT DstX,
+ _In_ UINT DstX,
/* [annotation] */
- __in UINT DstY,
+ _In_ UINT DstY,
/* [annotation] */
- __in UINT DstZ,
+ _In_ UINT DstZ,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pSrcBox);
+ _In_opt_ const D3D10_BOX *pSrcBox);
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource);
+ _In_ ID3D10Resource *pSrcResource);
void ( STDMETHODCALLTYPE *UpdateSubresource )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in_opt const D3D10_BOX *pDstBox,
+ _In_opt_ const D3D10_BOX *pDstBox,
/* [annotation] */
- __in const void *pSrcData,
+ _In_ const void *pSrcData,
/* [annotation] */
- __in UINT SrcRowPitch,
+ _In_ UINT SrcRowPitch,
/* [annotation] */
- __in UINT SrcDepthPitch);
+ _In_ UINT SrcDepthPitch);
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10RenderTargetView *pRenderTargetView,
+ _In_ ID3D10RenderTargetView *pRenderTargetView,
/* [annotation] */
- __in const FLOAT ColorRGBA[ 4 ]);
+ _In_ const FLOAT ColorRGBA[ 4 ]);
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10DepthStencilView *pDepthStencilView,
+ _In_ ID3D10DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in UINT ClearFlags,
+ _In_ UINT ClearFlags,
/* [annotation] */
- __in FLOAT Depth,
+ _In_ FLOAT Depth,
/* [annotation] */
- __in UINT8 Stencil);
+ _In_ UINT8 Stencil);
void ( STDMETHODCALLTYPE *GenerateMips )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10ShaderResourceView *pShaderResourceView);
+ _In_ ID3D10ShaderResourceView *pShaderResourceView);
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pDstResource,
+ _In_ ID3D10Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in ID3D10Resource *pSrcResource,
+ _In_ ID3D10Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in DXGI_FORMAT Format);
+ _In_ DXGI_FORMAT Format);
void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSGetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSGetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __out ID3D10PixelShader **ppPixelShader);
+ _Out_ ID3D10PixelShader **ppPixelShader);
void ( STDMETHODCALLTYPE *PSGetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *VSGetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __out ID3D10VertexShader **ppVertexShader);
+ _Out_ ID3D10VertexShader **ppVertexShader);
void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *IAGetInputLayout )(
ID3D10Device1 * This,
/* [annotation] */
- __out ID3D10InputLayout **ppInputLayout);
+ _Out_ ID3D10InputLayout **ppInputLayout);
void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppVertexBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pStrides,
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets);
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
ID3D10Device1 * This,
/* [annotation] */
- __out_opt ID3D10Buffer **pIndexBuffer,
+ _Out_opt_ ID3D10Buffer **pIndexBuffer,
/* [annotation] */
- __out_opt DXGI_FORMAT *Format,
+ _Out_opt_ DXGI_FORMAT *Format,
/* [annotation] */
- __out_opt UINT *Offset);
+ _Out_opt_ UINT *Offset);
void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSGetShader )(
ID3D10Device1 * This,
/* [annotation] */
- __out ID3D10GeometryShader **ppGeometryShader);
+ _Out_ ID3D10GeometryShader **ppGeometryShader);
void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
ID3D10Device1 * This,
/* [annotation] */
- __out D3D10_PRIMITIVE_TOPOLOGY *pTopology);
+ _Out_ D3D10_PRIMITIVE_TOPOLOGY *pTopology);
void ( STDMETHODCALLTYPE *VSGetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSGetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *GetPredication )(
ID3D10Device1 * This,
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate,
+ _Out_opt_ ID3D10Predicate **ppPredicate,
/* [annotation] */
- __out_opt BOOL *pPredicateValue);
+ _Out_opt_ BOOL *pPredicateValue);
void ( STDMETHODCALLTYPE *GSGetShaderResources )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSGetSamplers )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D10SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumViews) ID3D10RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView);
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView);
void ( STDMETHODCALLTYPE *OMGetBlendState )(
ID3D10Device1 * This,
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState,
+ _Out_opt_ ID3D10BlendState **ppBlendState,
/* [annotation] */
- __out_opt FLOAT BlendFactor[ 4 ],
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __out_opt UINT *pSampleMask);
+ _Out_opt_ UINT *pSampleMask);
void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
ID3D10Device1 * This,
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState,
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState,
/* [annotation] */
- __out_opt UINT *pStencilRef);
+ _Out_opt_ UINT *pStencilRef);
void ( STDMETHODCALLTYPE *SOGetTargets )(
ID3D10Device1 * This,
/* [annotation] */
- __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ _In_range_( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets,
+ _Out_writes_opt_(NumBuffers) ID3D10Buffer **ppSOTargets,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets);
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
void ( STDMETHODCALLTYPE *RSGetState )(
ID3D10Device1 * This,
/* [annotation] */
- __out ID3D10RasterizerState **ppRasterizerState);
+ _Out_ ID3D10RasterizerState **ppRasterizerState);
void ( STDMETHODCALLTYPE *RSGetViewports )(
ID3D10Device1 * This,
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports,
/* [annotation] */
- __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports);
+ _Out_writes_opt_(*NumViewports) D3D10_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSGetScissorRects )(
ID3D10Device1 * This,
/* [annotation] */
- __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
+ _Inout_ /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects,
/* [annotation] */
- __out_ecount_opt(*NumRects) D3D10_RECT *pRects);
+ _Out_writes_opt_(*NumRects) D3D10_RECT *pRects);
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D10Device1 * This);
@@ -1040,27 +1050,27 @@ EXTERN_C const IID IID_ID3D10Device1;
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D10Device1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D10Device1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D10Device1 * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *ClearState )(
ID3D10Device1 * This);
@@ -1071,211 +1081,211 @@ EXTERN_C const IID IID_ID3D10Device1;
HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_BUFFER_DESC *pDesc,
+ _In_ const D3D10_BUFFER_DESC *pDesc,
/* [annotation] */
- __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_opt_ const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D10Buffer **ppBuffer);
+ _Out_opt_ ID3D10Buffer **ppBuffer);
HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_TEXTURE1D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE1D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture1D **ppTexture1D);
+ _Out_ ID3D10Texture1D **ppTexture1D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_TEXTURE2D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE2D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture2D **ppTexture2D);
+ _Out_ ID3D10Texture2D **ppTexture2D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_TEXTURE3D_DESC *pDesc,
+ _In_ const D3D10_TEXTURE3D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D10_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out ID3D10Texture3D **ppTexture3D);
+ _Out_ ID3D10Texture3D **ppTexture3D);
HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10ShaderResourceView **ppSRView);
+ _Out_opt_ ID3D10ShaderResourceView **ppSRView);
HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10RenderTargetView **ppRTView);
+ _Out_opt_ ID3D10RenderTargetView **ppRTView);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_opt_ const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilView **ppDepthStencilView);
+ _Out_opt_ ID3D10DepthStencilView **ppDepthStencilView);
HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
ID3D10Device1 * This,
/* [annotation] */
- __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+ _In_reads_(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
/* [annotation] */
- __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ _In_range_( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
/* [annotation] */
- __in const void *pShaderBytecodeWithInputSignature,
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10InputLayout **ppInputLayout);
+ _Out_opt_ ID3D10InputLayout **ppInputLayout);
HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10VertexShader **ppVertexShader);
+ _Out_opt_ ID3D10VertexShader **ppVertexShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader);
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
ID3D10Device1 * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+ _In_reads_opt_(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
/* [annotation] */
- __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
+ _In_range_( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries,
/* [annotation] */
- __in UINT OutputStreamStride,
+ _In_ UINT OutputStreamStride,
/* [annotation] */
- __out_opt ID3D10GeometryShader **ppGeometryShader);
+ _Out_opt_ ID3D10GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
ID3D10Device1 * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D10PixelShader **ppPixelShader);
+ _Out_opt_ ID3D10PixelShader **ppPixelShader);
HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_BLEND_DESC *pBlendStateDesc,
+ _In_ const D3D10_BLEND_DESC *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D10BlendState **ppBlendState);
+ _Out_opt_ ID3D10BlendState **ppBlendState);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ _In_ const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
/* [annotation] */
- __out_opt ID3D10DepthStencilState **ppDepthStencilState);
+ _Out_opt_ ID3D10DepthStencilState **ppDepthStencilState);
HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+ _In_ const D3D10_RASTERIZER_DESC *pRasterizerDesc,
/* [annotation] */
- __out_opt ID3D10RasterizerState **ppRasterizerState);
+ _Out_opt_ ID3D10RasterizerState **ppRasterizerState);
HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_SAMPLER_DESC *pSamplerDesc,
+ _In_ const D3D10_SAMPLER_DESC *pSamplerDesc,
/* [annotation] */
- __out_opt ID3D10SamplerState **ppSamplerState);
+ _Out_opt_ ID3D10SamplerState **ppSamplerState);
HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_QUERY_DESC *pQueryDesc,
+ _In_ const D3D10_QUERY_DESC *pQueryDesc,
/* [annotation] */
- __out_opt ID3D10Query **ppQuery);
+ _Out_opt_ ID3D10Query **ppQuery);
HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_QUERY_DESC *pPredicateDesc,
+ _In_ const D3D10_QUERY_DESC *pPredicateDesc,
/* [annotation] */
- __out_opt ID3D10Predicate **ppPredicate);
+ _Out_opt_ ID3D10Predicate **ppPredicate);
HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pCounterDesc,
+ _In_ const D3D10_COUNTER_DESC *pCounterDesc,
/* [annotation] */
- __out_opt ID3D10Counter **ppCounter);
+ _Out_opt_ ID3D10Counter **ppCounter);
HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
ID3D10Device1 * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __out UINT *pFormatSupport);
+ _Out_ UINT *pFormatSupport);
HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
ID3D10Device1 * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT SampleCount,
+ _In_ UINT SampleCount,
/* [annotation] */
- __out UINT *pNumQualityLevels);
+ _Out_ UINT *pNumQualityLevels);
void ( STDMETHODCALLTYPE *CheckCounterInfo )(
ID3D10Device1 * This,
/* [annotation] */
- __out D3D10_COUNTER_INFO *pCounterInfo);
+ _Out_ D3D10_COUNTER_INFO *pCounterInfo);
HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_COUNTER_DESC *pDesc,
+ _In_ const D3D10_COUNTER_DESC *pDesc,
/* [annotation] */
- __out D3D10_COUNTER_TYPE *pType,
+ _Out_ D3D10_COUNTER_TYPE *pType,
/* [annotation] */
- __out UINT *pActiveCounters,
+ _Out_ UINT *pActiveCounters,
/* [annotation] */
- __out_ecount_opt(*pNameLength) LPSTR szName,
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
/* [annotation] */
- __inout_opt UINT *pNameLength,
+ _Inout_opt_ UINT *pNameLength,
/* [annotation] */
- __out_ecount_opt(*pUnitsLength) LPSTR szUnits,
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
/* [annotation] */
- __inout_opt UINT *pUnitsLength,
+ _Inout_opt_ UINT *pUnitsLength,
/* [annotation] */
- __out_ecount_opt(*pDescriptionLength) LPSTR szDescription,
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
/* [annotation] */
- __inout_opt UINT *pDescriptionLength);
+ _Inout_opt_ UINT *pDescriptionLength);
UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
ID3D10Device1 * This);
@@ -1283,41 +1293,41 @@ EXTERN_C const IID IID_ID3D10Device1;
HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
ID3D10Device1 * This,
/* [annotation] */
- __in HANDLE hResource,
+ _In_ HANDLE hResource,
/* [annotation] */
- __in REFIID ReturnedInterface,
+ _In_ REFIID ReturnedInterface,
/* [annotation] */
- __out_opt void **ppResource);
+ _Out_opt_ void **ppResource);
void ( STDMETHODCALLTYPE *SetTextFilterSize )(
ID3D10Device1 * This,
/* [annotation] */
- __in UINT Width,
+ _In_ UINT Width,
/* [annotation] */
- __in UINT Height);
+ _In_ UINT Height);
void ( STDMETHODCALLTYPE *GetTextFilterSize )(
ID3D10Device1 * This,
/* [annotation] */
- __out_opt UINT *pWidth,
+ _Out_opt_ UINT *pWidth,
/* [annotation] */
- __out_opt UINT *pHeight);
+ _Out_opt_ UINT *pHeight);
HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView1 )(
ID3D10Device1 * This,
/* [annotation] */
- __in ID3D10Resource *pResource,
+ _In_ ID3D10Resource *pResource,
/* [annotation] */
- __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
+ _In_opt_ const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,
/* [annotation] */
- __out_opt ID3D10ShaderResourceView1 **ppSRView);
+ _Out_opt_ ID3D10ShaderResourceView1 **ppSRView);
HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )(
ID3D10Device1 * This,
/* [annotation] */
- __in const D3D10_BLEND_DESC1 *pBlendStateDesc,
+ _In_ const D3D10_BLEND_DESC1 *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D10BlendState1 **ppBlendState);
+ _Out_opt_ ID3D10BlendState1 **ppBlendState);
D3D10_FEATURE_LEVEL1 ( STDMETHODCALLTYPE *GetFeatureLevel )(
ID3D10Device1 * This);
@@ -1695,13 +1705,13 @@ typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE1)(IDXGIAdapter *,
D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, ID3D10Device1**);
HRESULT WINAPI D3D10CreateDevice1(
- IDXGIAdapter *pAdapter,
+ _In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
D3D10_FEATURE_LEVEL1 HardwareLevel,
UINT SDKVersion,
- ID3D10Device1 **ppDevice);
+ _Out_opt_ ID3D10Device1 **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDeviceAndSwapChain1
@@ -1747,15 +1757,16 @@ typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1)(IDXGIAdapter *
D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device1 **);
HRESULT WINAPI D3D10CreateDeviceAndSwapChain1(
- IDXGIAdapter *pAdapter,
+ _In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
D3D10_FEATURE_LEVEL1 HardwareLevel,
UINT SDKVersion,
- DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
- IDXGISwapChain **ppSwapChain,
- ID3D10Device1 **ppDevice);
+ _In_opt_ DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
+ _Out_opt_ IDXGISwapChain **ppSwapChain,
+ _Out_opt_ ID3D10Device1 **ppDevice);
+
DEFINE_GUID(IID_ID3D10BlendState1,0xEDAD8D99,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61);
DEFINE_GUID(IID_ID3D10ShaderResourceView1,0x9B7E4C87,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
DEFINE_GUID(IID_ID3D10Device1,0x9B7E4C8F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
diff --git a/3rdparty/dxsdk/Include/d3d10_1shader.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10_1shader.h
index 2726f8fc211..91e5c9daedc 100644
--- a/3rdparty/dxsdk/Include/d3d10_1shader.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10_1shader.h
@@ -12,6 +12,9 @@
#include "d3d10shader.h"
+
+
+
//----------------------------------------------------------------------------
// Shader debugging structures
//----------------------------------------------------------------------------
@@ -245,6 +248,7 @@ typedef struct _D3D10_SHADER_DEBUG_INFO
// Interface definitions
//
+
typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1;
typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1;
@@ -261,28 +265,28 @@ DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown)
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
- STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+ STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
- STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
- STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+ STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
- STDMETHOD(GetMovInstructionCount)(THIS_ UINT* pCount) PURE;
- STDMETHOD(GetMovcInstructionCount)(THIS_ UINT* pCount) PURE;
- STDMETHOD(GetConversionInstructionCount)(THIS_ UINT* pCount) PURE;
- STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT* pCount) PURE;
+ STDMETHOD(GetMovInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
+ STDMETHOD(GetMovcInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
+ STDMETHOD(GetConversionInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
+ STDMETHOD(GetBitwiseInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
- STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE* pPrim) PURE;
- STDMETHOD(IsLevel9Shader)(THIS_ BOOL* pbLevel9Shader) PURE;
- STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL* pbSampleFrequency) PURE;
+ STDMETHOD(GetGSInputPrimitive)(THIS_ _Out_ D3D10_PRIMITIVE* pPrim) PURE;
+ STDMETHOD(IsLevel9Shader)(THIS_ _Out_ BOOL* pbLevel9Shader) PURE;
+ STDMETHOD(IsSampleFrequencyShader)(THIS_ _Out_ BOOL* pbSampleFrequency) PURE;
};
//////////////////////////////////////////////////////////////////////////////
diff --git a/3rdparty/dxsdk/Include/d3d10effect.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10effect.h
index 738785422f6..9f5cf7b1e78 100644
--- a/3rdparty/dxsdk/Include/d3d10effect.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10effect.h
@@ -11,6 +11,8 @@
#ifndef __D3D10EFFECT_H__
#define __D3D10EFFECT_H__
+
+
#include "d3d10.h"
//////////////////////////////////////////////////////////////////////////////
@@ -131,7 +133,7 @@ DECLARE_INTERFACE_(ID3D10StateBlock, IUnknown)
STDMETHOD(Capture)(THIS) PURE;
STDMETHOD(Apply)(THIS) PURE;
STDMETHOD(ReleaseAllDeviceObjects)(THIS) PURE;
- STDMETHOD(GetDevice)(THIS_ ID3D10Device **ppDevice) PURE;
+ STDMETHOD(GetDevice)(_Out_ THIS_ ID3D10Device **ppDevice) PURE;
};
#ifdef __cplusplus
@@ -163,14 +165,14 @@ extern "C" {
//
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
-HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
-HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
-HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
-HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
-HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *pMask);
-HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *pMask);
-BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry);
+HRESULT WINAPI D3D10StateBlockMaskUnion(_In_ D3D10_STATE_BLOCK_MASK *pA, _In_ D3D10_STATE_BLOCK_MASK *pB, _Out_ D3D10_STATE_BLOCK_MASK *pResult);
+HRESULT WINAPI D3D10StateBlockMaskIntersect(_In_ D3D10_STATE_BLOCK_MASK *pA, _In_ D3D10_STATE_BLOCK_MASK *pB, _Out_ D3D10_STATE_BLOCK_MASK *pResult);
+HRESULT WINAPI D3D10StateBlockMaskDifference(_In_ D3D10_STATE_BLOCK_MASK *pA, _In_ D3D10_STATE_BLOCK_MASK *pB, _Out_ D3D10_STATE_BLOCK_MASK *pResult);
+HRESULT WINAPI D3D10StateBlockMaskEnableCapture(_Inout_ D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
+HRESULT WINAPI D3D10StateBlockMaskDisableCapture(_Inout_ D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
+HRESULT WINAPI D3D10StateBlockMaskEnableAll(_Out_ D3D10_STATE_BLOCK_MASK *pMask);
+HRESULT WINAPI D3D10StateBlockMaskDisableAll(_Out_ D3D10_STATE_BLOCK_MASK *pMask);
+BOOL WINAPI D3D10StateBlockMaskGetSetting(_In_ D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry);
//----------------------------------------------------------------------------
// D3D10CreateStateBlock
@@ -192,7 +194,7 @@ BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D1
// bit mask
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock);
+HRESULT WINAPI D3D10CreateStateBlock(_In_ ID3D10Device *pDevice, _In_ D3D10_STATE_BLOCK_MASK *pStateBlockMask, _Out_ ID3D10StateBlock **ppStateBlock);
#ifdef __cplusplus
}
@@ -369,7 +371,7 @@ DECLARE_INTERFACE(ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -396,8 +398,8 @@ DECLARE_INTERFACE(ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -418,7 +420,7 @@ DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -445,26 +447,26 @@ DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
STDMETHOD(SetFloat)(THIS_ float Value) PURE;
- STDMETHOD(GetFloat)(THIS_ float *pValue) PURE;
+ STDMETHOD(GetFloat)(THIS_ _Out_ float *pValue) PURE;
- STDMETHOD(SetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetFloatArray)(THIS_ _In_reads_(Count) float *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetFloatArray)(THIS_ _Out_writes_(Count) float *pData, UINT Offset, UINT Count) PURE;
STDMETHOD(SetInt)(THIS_ int Value) PURE;
- STDMETHOD(GetInt)(THIS_ int *pValue) PURE;
+ STDMETHOD(GetInt)(THIS_ _Out_ int *pValue) PURE;
- STDMETHOD(SetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetIntArray)(THIS_ _In_reads_(Count) int *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetIntArray)(THIS_ _Out_writes_(Count) int *pData, UINT Offset, UINT Count) PURE;
STDMETHOD(SetBool)(THIS_ BOOL Value) PURE;
- STDMETHOD(GetBool)(THIS_ BOOL *pValue) PURE;
+ STDMETHOD(GetBool)(THIS_ _Out_ BOOL *pValue) PURE;
- STDMETHOD(SetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetBoolArray)(THIS_ _In_reads_(Count) BOOL *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetBoolArray)(THIS_ _Out_writes_(Count) BOOL *pData, UINT Offset, UINT Count) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -485,7 +487,7 @@ DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -512,8 +514,8 @@ DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
STDMETHOD(SetBoolVector) (THIS_ BOOL *pData) PURE;
STDMETHOD(SetIntVector) (THIS_ int *pData) PURE;
@@ -550,7 +552,7 @@ DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -577,8 +579,8 @@ DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT ByteOffset, UINT ByteCount) PURE;
STDMETHOD(SetMatrix)(THIS_ float *pData) PURE;
STDMETHOD(GetMatrix)(THIS_ float *pData) PURE;
@@ -611,7 +613,7 @@ DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -638,11 +640,11 @@ DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(GetString)(THIS_ LPCSTR *ppString) PURE;
- STDMETHOD(GetStringArray)(THIS_ LPCSTR *ppStrings, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetString)(THIS_ _Out_ LPCSTR *ppString) PURE;
+ STDMETHOD(GetStringArray)(THIS_ _Out_writes_(Count) LPCSTR *ppStrings, UINT Offset, UINT Count) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -664,7 +666,7 @@ DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -691,14 +693,14 @@ DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(SetResource)(THIS_ ID3D10ShaderResourceView *pResource) PURE;
- STDMETHOD(GetResource)(THIS_ ID3D10ShaderResourceView **ppResource) PURE;
+ STDMETHOD(SetResource)(THIS_ _In_opt_ ID3D10ShaderResourceView *pResource) PURE;
+ STDMETHOD(GetResource)(THIS_ _Out_ ID3D10ShaderResourceView **ppResource) PURE;
- STDMETHOD(SetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetResourceArray)(THIS_ _In_reads_(Count) ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetResourceArray)(THIS_ _Out_writes_(Count) ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -719,7 +721,7 @@ DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -746,14 +748,14 @@ DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(SetRenderTarget)(THIS_ ID3D10RenderTargetView *pResource) PURE;
- STDMETHOD(GetRenderTarget)(THIS_ ID3D10RenderTargetView **ppResource) PURE;
+ STDMETHOD(SetRenderTarget)(THIS_ _In_opt_ ID3D10RenderTargetView *pResource) PURE;
+ STDMETHOD(GetRenderTarget)(THIS_ _Out_ ID3D10RenderTargetView **ppResource) PURE;
- STDMETHOD(SetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRenderTargetArray)(THIS_ _In_reads_(Count) ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetRenderTargetArray)(THIS_ _Out_writes_(Count) ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -774,7 +776,7 @@ DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -801,14 +803,14 @@ DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(SetDepthStencil)(THIS_ ID3D10DepthStencilView *pResource) PURE;
- STDMETHOD(GetDepthStencil)(THIS_ ID3D10DepthStencilView **ppResource) PURE;
+ STDMETHOD(SetDepthStencil)(THIS_ _In_opt_ ID3D10DepthStencilView *pResource) PURE;
+ STDMETHOD(GetDepthStencil)(THIS_ _Out_ ID3D10DepthStencilView **ppResource) PURE;
- STDMETHOD(SetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetDepthStencilArray)(THIS_ _In_reads_(Count) ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE;
+ STDMETHOD(GetDepthStencilArray)(THIS_ _Out_writes_(Count) ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -828,7 +830,7 @@ DEFINE_GUID(IID_ID3D10EffectConstantBuffer,
DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -855,14 +857,14 @@ DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *pConstantBuffer) PURE;
- STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **ppConstantBuffer) PURE;
+ STDMETHOD(SetConstantBuffer)(THIS_ _In_opt_ ID3D10Buffer *pConstantBuffer) PURE;
+ STDMETHOD(GetConstantBuffer)(THIS_ _Out_ ID3D10Buffer **ppConstantBuffer) PURE;
- STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *pTextureBuffer) PURE;
- STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **ppTextureBuffer) PURE;
+ STDMETHOD(SetTextureBuffer)(THIS_ _In_opt_ ID3D10ShaderResourceView *pTextureBuffer) PURE;
+ STDMETHOD(GetTextureBuffer)(THIS_ _Out_ ID3D10ShaderResourceView **ppTextureBuffer) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -908,7 +910,7 @@ DEFINE_GUID(IID_ID3D10EffectShaderVariable,
DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -935,17 +937,17 @@ DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(GetShaderDesc)(THIS_ UINT ShaderIndex, D3D10_EFFECT_SHADER_DESC *pDesc) PURE;
+ STDMETHOD(GetShaderDesc)(THIS_ UINT ShaderIndex, _Out_ D3D10_EFFECT_SHADER_DESC *pDesc) PURE;
- STDMETHOD(GetVertexShader)(THIS_ UINT ShaderIndex, ID3D10VertexShader **ppVS) PURE;
- STDMETHOD(GetGeometryShader)(THIS_ UINT ShaderIndex, ID3D10GeometryShader **ppGS) PURE;
- STDMETHOD(GetPixelShader)(THIS_ UINT ShaderIndex, ID3D10PixelShader **ppPS) PURE;
+ STDMETHOD(GetVertexShader)(THIS_ UINT ShaderIndex, _Out_ ID3D10VertexShader **ppVS) PURE;
+ STDMETHOD(GetGeometryShader)(THIS_ UINT ShaderIndex, _Out_ ID3D10GeometryShader **ppGS) PURE;
+ STDMETHOD(GetPixelShader)(THIS_ UINT ShaderIndex, _Out_ ID3D10PixelShader **ppPS) PURE;
- STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -965,7 +967,7 @@ DEFINE_GUID(IID_ID3D10EffectBlendVariable,
DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -992,8 +994,8 @@ DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
STDMETHOD(GetBlendState)(THIS_ UINT Index, ID3D10BlendState **ppBlendState) PURE;
STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_BLEND_DESC *pBlendDesc) PURE;
@@ -1016,7 +1018,7 @@ DEFINE_GUID(IID_ID3D10EffectDepthStencilVariable,
DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -1043,11 +1045,11 @@ DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(GetDepthStencilState)(THIS_ UINT Index, ID3D10DepthStencilState **ppDepthStencilState) PURE;
- STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc) PURE;
+ STDMETHOD(GetDepthStencilState)(THIS_ UINT Index, _Out_ ID3D10DepthStencilState **ppDepthStencilState) PURE;
+ STDMETHOD(GetBackingStore)(THIS_ UINT Index, _Out_ D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -1067,7 +1069,7 @@ DEFINE_GUID(IID_ID3D10EffectRasterizerVariable,
DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -1094,11 +1096,11 @@ DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(GetRasterizerState)(THIS_ UINT Index, ID3D10RasterizerState **ppRasterizerState) PURE;
- STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_RASTERIZER_DESC *pRasterizerDesc) PURE;
+ STDMETHOD(GetRasterizerState)(THIS_ UINT Index, _Out_ ID3D10RasterizerState **ppRasterizerState) PURE;
+ STDMETHOD(GetBackingStore)(THIS_ UINT Index, _Out_ D3D10_RASTERIZER_DESC *pRasterizerDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -1118,7 +1120,7 @@ DEFINE_GUID(IID_ID3D10EffectSamplerVariable,
DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable)
{
STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;
@@ -1145,11 +1147,11 @@ DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable)
STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE;
- STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
- STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
+ STDMETHOD(SetRawValue)(THIS_ _In_reads_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
+ STDMETHOD(GetRawValue)(THIS_ _Out_writes_bytes_(ByteCount) void *pData, UINT Offset, UINT ByteCount) PURE;
- STDMETHOD(GetSampler)(THIS_ UINT Index, ID3D10SamplerState **ppSampler) PURE;
- STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_SAMPLER_DESC *pSamplerDesc) PURE;
+ STDMETHOD(GetSampler)(THIS_ UINT Index, _Out_ ID3D10SamplerState **ppSampler) PURE;
+ STDMETHOD(GetBackingStore)(THIS_ UINT Index, _Out_ D3D10_SAMPLER_DESC *pSamplerDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -1223,7 +1225,7 @@ DECLARE_INTERFACE(ID3D10EffectPass)
STDMETHOD(Apply)(THIS_ UINT Flags) PURE;
- STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE;
+ STDMETHOD(ComputeStateBlockMask)(THIS_ _Out_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -1264,7 +1266,7 @@ DECLARE_INTERFACE(ID3D10EffectTechnique)
STDMETHOD_(ID3D10EffectPass*, GetPassByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectPass*, GetPassByName)(THIS_ LPCSTR Name) PURE;
- STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE;
+ STDMETHOD(ComputeStateBlockMask)(THIS_ _Out_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE;
};
//////////////////////////////////////////////////////////////////////////////
@@ -1318,10 +1320,10 @@ DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
STDMETHOD_(BOOL, IsPool)(THIS) PURE;
// Managing D3D Device
- STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
+ STDMETHOD(GetDevice)(THIS_ _Out_ ID3D10Device** ppDevice) PURE;
// New Reflection APIs
- STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_EFFECT_DESC *pDesc) PURE;
STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
@@ -1419,15 +1421,15 @@ extern "C" {
//
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10CompileEffectFromMemory(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags,
- ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
+HRESULT WINAPI D3D10CompileEffectFromMemory(_In_reads_bytes_(DataLength) void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, _In_opt_ CONST D3D10_SHADER_MACRO *pDefines,
+ _In_opt_ ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags,
+ _Out_ ID3D10Blob **ppCompiledEffect, _Out_opt_ ID3D10Blob **ppErrors);
-HRESULT WINAPI D3D10CreateEffectFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect);
+HRESULT WINAPI D3D10CreateEffectFromMemory(_In_reads_bytes_(DataLength) void *pData, SIZE_T DataLength, UINT FXFlags, _In_ ID3D10Device *pDevice,
+ _In_opt_ ID3D10EffectPool *pEffectPool, _Out_ ID3D10Effect **ppEffect);
-HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool **ppEffectPool);
+HRESULT WINAPI D3D10CreateEffectPoolFromMemory(_In_reads_bytes_(DataLength) void *pData, SIZE_T DataLength, UINT FXFlags, _In_ ID3D10Device *pDevice,
+ _Out_ ID3D10EffectPool **ppEffectPool);
//----------------------------------------------------------------------------
@@ -1444,12 +1446,13 @@ HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, U
// Returns a buffer containing the disassembled effect.
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10DisassembleEffect(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly);
+HRESULT WINAPI D3D10DisassembleEffect(_In_ ID3D10Effect *pEffect, BOOL EnableColorCode, _Out_ ID3D10Blob **ppDisassembly);
#ifdef __cplusplus
}
#endif //__cplusplus
+
#endif //__D3D10EFFECT_H__
diff --git a/3rdparty/dxsdk/Include/d3d10misc.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10misc.h
index a20644d414c..c46951fa890 100644
--- a/3rdparty/dxsdk/Include/d3d10misc.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10misc.h
@@ -18,6 +18,8 @@
extern "C" {
#endif //__cplusplus
+
+
///////////////////////////////////////////////////////////////////////////
// D3D10_DRIVER_TYPE
// ----------------
@@ -72,12 +74,12 @@ DEFINE_GUID(GUID_DeviceType,
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDevice(
- IDXGIAdapter *pAdapter,
+ _In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
- ID3D10Device **ppDevice);
+ _Out_opt_ ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDeviceAndSwapChain
@@ -116,14 +118,14 @@ HRESULT WINAPI D3D10CreateDevice(
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
- IDXGIAdapter *pAdapter,
+ _In_opt_ IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
- DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
- IDXGISwapChain **ppSwapChain,
- ID3D10Device **ppDevice);
+ _In_opt_ DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
+ _Out_opt_ IDXGISwapChain **ppSwapChain,
+ _Out_opt_ ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
@@ -132,7 +134,8 @@ HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
// Creates a Buffer of n Bytes
//////////////////////////////////////////////////////////////////////////
-HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer);
+HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, _Out_ LPD3D10BLOB *ppBuffer);
+
#ifdef __cplusplus
}
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10sdklayers.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10sdklayers.h
new file mode 100644
index 00000000000..3a1e8c8692d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10sdklayers.h
@@ -0,0 +1,1395 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d10sdklayers_h__
+#define __d3d10sdklayers_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D10Debug_FWD_DEFINED__
+#define __ID3D10Debug_FWD_DEFINED__
+typedef interface ID3D10Debug ID3D10Debug;
+
+#endif /* __ID3D10Debug_FWD_DEFINED__ */
+
+
+#ifndef __ID3D10SwitchToRef_FWD_DEFINED__
+#define __ID3D10SwitchToRef_FWD_DEFINED__
+typedef interface ID3D10SwitchToRef ID3D10SwitchToRef;
+
+#endif /* __ID3D10SwitchToRef_FWD_DEFINED__ */
+
+
+#ifndef __ID3D10InfoQueue_FWD_DEFINED__
+#define __ID3D10InfoQueue_FWD_DEFINED__
+typedef interface ID3D10InfoQueue ID3D10InfoQueue;
+
+#endif /* __ID3D10InfoQueue_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgi.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d10sdklayers_0000_0000 */
+/* [local] */
+
+#define D3D10_SDK_LAYERS_VERSION ( 11 )
+
+#define D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 )
+
+#define D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 )
+
+#define D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 )
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D10Debug_INTERFACE_DEFINED__
+#define __ID3D10Debug_INTERFACE_DEFINED__
+
+/* interface ID3D10Debug */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D10Debug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9B7E4E01-342C-4106-A19F-4F2704F689F0")
+ ID3D10Debug : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ UINT Mask) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay(
+ UINT Milliseconds) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
+ /* [annotation] */
+ _In_opt_ IDXGISwapChain *pSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSwapChain(
+ /* [annotation] */
+ _Out_ IDXGISwapChain **ppSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Validate( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D10DebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D10Debug * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D10Debug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D10Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D10Debug * This,
+ UINT Mask);
+
+ UINT ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D10Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )(
+ ID3D10Debug * This,
+ UINT Milliseconds);
+
+ UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )(
+ ID3D10Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetSwapChain )(
+ ID3D10Debug * This,
+ /* [annotation] */
+ _In_opt_ IDXGISwapChain *pSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSwapChain )(
+ ID3D10Debug * This,
+ /* [annotation] */
+ _Out_ IDXGISwapChain **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *Validate )(
+ ID3D10Debug * This);
+
+ END_INTERFACE
+ } ID3D10DebugVtbl;
+
+ interface ID3D10Debug
+ {
+ CONST_VTBL struct ID3D10DebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D10Debug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D10Debug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D10Debug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D10Debug_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D10Debug_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#define ID3D10Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \
+ ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) )
+
+#define ID3D10Debug_GetPresentPerRenderOpDelay(This) \
+ ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) )
+
+#define ID3D10Debug_SetSwapChain(This,pSwapChain) \
+ ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) )
+
+#define ID3D10Debug_GetSwapChain(This,ppSwapChain) \
+ ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) )
+
+#define ID3D10Debug_Validate(This) \
+ ( (This)->lpVtbl -> Validate(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D10Debug_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D10SwitchToRef_INTERFACE_DEFINED__
+#define __ID3D10SwitchToRef_INTERFACE_DEFINED__
+
+/* interface ID3D10SwitchToRef */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D10SwitchToRef;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9B7E4E02-342C-4106-A19F-4F2704F689F0")
+ ID3D10SwitchToRef : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE SetUseRef(
+ BOOL UseRef) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D10SwitchToRefVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D10SwitchToRef * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D10SwitchToRef * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D10SwitchToRef * This);
+
+ BOOL ( STDMETHODCALLTYPE *SetUseRef )(
+ ID3D10SwitchToRef * This,
+ BOOL UseRef);
+
+ BOOL ( STDMETHODCALLTYPE *GetUseRef )(
+ ID3D10SwitchToRef * This);
+
+ END_INTERFACE
+ } ID3D10SwitchToRefVtbl;
+
+ interface ID3D10SwitchToRef
+ {
+ CONST_VTBL struct ID3D10SwitchToRefVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D10SwitchToRef_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D10SwitchToRef_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D10SwitchToRef_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D10SwitchToRef_SetUseRef(This,UseRef) \
+ ( (This)->lpVtbl -> SetUseRef(This,UseRef) )
+
+#define ID3D10SwitchToRef_GetUseRef(This) \
+ ( (This)->lpVtbl -> GetUseRef(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D10SwitchToRef_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d10sdklayers_0000_0002 */
+/* [local] */
+
+DEFINE_GUID(DXGI_DEBUG_D3D10, 0x243b4c52, 0x3606, 0x4d3a, 0x99, 0xd7, 0xa7, 0xe7, 0xb3, 0x3e, 0xd7, 0x6);
+#define D3D10_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D")
+#define D3D10_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput")
+#define D3D10_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage")
+#define D3D10_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride")
+#define D3D10_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s")
+#define D3D10_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s")
+#define D3D10_MUTE_ID_STRING __TEXT("Mute_ID_%s")
+#define D3D10_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d")
+#define D3D10_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO")
+#define D3D10_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s")
+#define D3D10_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s")
+#define D3D10_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s")
+#define D3D10_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d")
+#define D3D10_APPSIZE_STRING __TEXT("Size")
+#define D3D10_APPNAME_STRING __TEXT("Name")
+typedef
+enum D3D10_MESSAGE_CATEGORY
+ {
+ D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
+ D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_INITIALIZATION = ( D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_CLEANUP = ( D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_COMPILATION = ( D3D10_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_STATE_CREATION = ( D3D10_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_STATE_SETTING = ( D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_STATE_GETTING = ( D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_EXECUTION = ( D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
+ D3D10_MESSAGE_CATEGORY_SHADER = ( D3D10_MESSAGE_CATEGORY_EXECUTION + 1 )
+ } D3D10_MESSAGE_CATEGORY;
+
+typedef
+enum D3D10_MESSAGE_SEVERITY
+ {
+ D3D10_MESSAGE_SEVERITY_CORRUPTION = 0,
+ D3D10_MESSAGE_SEVERITY_ERROR = ( D3D10_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
+ D3D10_MESSAGE_SEVERITY_WARNING = ( D3D10_MESSAGE_SEVERITY_ERROR + 1 ) ,
+ D3D10_MESSAGE_SEVERITY_INFO = ( D3D10_MESSAGE_SEVERITY_WARNING + 1 ) ,
+ D3D10_MESSAGE_SEVERITY_MESSAGE = ( D3D10_MESSAGE_SEVERITY_INFO + 1 )
+ } D3D10_MESSAGE_SEVERITY;
+
+typedef
+enum D3D10_MESSAGE_ID
+ {
+ D3D10_MESSAGE_ID_UNKNOWN = 0,
+ D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_UNKNOWN + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_THIS = ( D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D10_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
+ D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
+ D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
+ D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
+ D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
+ D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
+ D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
+ D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) ,
+ D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
+ D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
+ D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
+ D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
+ D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
+ D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
+ D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_REF_THREADING_MODE = ( D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
+ D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
+ D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
+ D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
+ D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
+ D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
+ D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
+ D3D10_MESSAGE_ID_REF_INFO = ( D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_REF_INFO + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) ,
+ D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) ,
+ D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
+ D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) ,
+ D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) ,
+ D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) ,
+ D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_BUFFER = ( D3D10_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D10_MESSAGE_ID_LIVE_BUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D10_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D10_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D10_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D10_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D10_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D10_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D10_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D10_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_SAMPLER = ( D3D10_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D10_MESSAGE_ID_LIVE_SAMPLER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D10_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D10_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_QUERY = ( D3D10_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_PREDICATE = ( D3D10_MESSAGE_ID_LIVE_QUERY + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_COUNTER = ( D3D10_MESSAGE_ID_LIVE_PREDICATE + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_DEVICE = ( D3D10_MESSAGE_ID_LIVE_COUNTER + 1 ) ,
+ D3D10_MESSAGE_ID_LIVE_SWAPCHAIN = ( D3D10_MESSAGE_ID_LIVE_DEVICE + 1 ) ,
+ D3D10_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D10_MESSAGE_ID_LIVE_SWAPCHAIN + 1 ) ,
+ D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000,
+ D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) ,
+ D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) ,
+ D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) ,
+ D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) ,
+ D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) ,
+ D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) ,
+ D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) ,
+ D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) ,
+ D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) ,
+ D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) ,
+ D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) ,
+ D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) ,
+ D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) ,
+ D3D10_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) ,
+ D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES + 1 )
+ } D3D10_MESSAGE_ID;
+
+typedef struct D3D10_MESSAGE
+ {
+ D3D10_MESSAGE_CATEGORY Category;
+ D3D10_MESSAGE_SEVERITY Severity;
+ D3D10_MESSAGE_ID ID;
+ /* [annotation] */
+ _Field_size_(DescriptionByteLength) const char *pDescription;
+ SIZE_T DescriptionByteLength;
+ } D3D10_MESSAGE;
+
+typedef struct D3D10_INFO_QUEUE_FILTER_DESC
+ {
+ UINT NumCategories;
+ /* [annotation] */
+ _Field_size_(NumCategories) D3D10_MESSAGE_CATEGORY *pCategoryList;
+ UINT NumSeverities;
+ /* [annotation] */
+ _Field_size_(NumSeverities) D3D10_MESSAGE_SEVERITY *pSeverityList;
+ UINT NumIDs;
+ /* [annotation] */
+ _Field_size_(NumIDs) D3D10_MESSAGE_ID *pIDList;
+ } D3D10_INFO_QUEUE_FILTER_DESC;
+
+typedef struct D3D10_INFO_QUEUE_FILTER
+ {
+ D3D10_INFO_QUEUE_FILTER_DESC AllowList;
+ D3D10_INFO_QUEUE_FILTER_DESC DenyList;
+ } D3D10_INFO_QUEUE_FILTER;
+
+#define D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3D10InfoQueue_INTERFACE_DEFINED__
+#define __ID3D10InfoQueue_INTERFACE_DEFINED__
+
+/* interface ID3D10InfoQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D10InfoQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1b940b17-2642-4d1f-ab1f-b99bad0c395f")
+ ID3D10InfoQueue : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMessage(
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D10_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddMessage(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
+ /* [annotation] */
+ _In_ BOOL bMute) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D10InfoQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D10InfoQueue * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D10InfoQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit);
+
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D10_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ ID3D10InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
+ ID3D10InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ ID3D10InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ ID3D10InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ ID3D10InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ ID3D10InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_CATEGORY Category);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_SEVERITY Severity);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D10_MESSAGE_ID ID);
+
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ ID3D10InfoQueue * This,
+ /* [annotation] */
+ _In_ BOOL bMute);
+
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ ID3D10InfoQueue * This);
+
+ END_INTERFACE
+ } ID3D10InfoQueueVtbl;
+
+ interface ID3D10InfoQueue
+ {
+ CONST_VTBL struct ID3D10InfoQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D10InfoQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D10InfoQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D10InfoQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D10InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
+
+#define ID3D10InfoQueue_ClearStoredMessages(This) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This) )
+
+#define ID3D10InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
+
+#define ID3D10InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
+
+#define ID3D10InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
+
+#define ID3D10InfoQueue_GetNumStoredMessages(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This) )
+
+#define ID3D10InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
+
+#define ID3D10InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
+
+#define ID3D10InfoQueue_GetMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This) )
+
+#define ID3D10InfoQueue_AddStorageFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
+
+#define ID3D10InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D10InfoQueue_ClearStorageFilter(This) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This) )
+
+#define ID3D10InfoQueue_PushEmptyStorageFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
+
+#define ID3D10InfoQueue_PushCopyOfStorageFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
+
+#define ID3D10InfoQueue_PushStorageFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
+
+#define ID3D10InfoQueue_PopStorageFilter(This) \
+ ( (This)->lpVtbl -> PopStorageFilter(This) )
+
+#define ID3D10InfoQueue_GetStorageFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
+
+#define ID3D10InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
+
+#define ID3D10InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D10InfoQueue_ClearRetrievalFilter(This) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
+
+#define ID3D10InfoQueue_PushEmptyRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
+
+#define ID3D10InfoQueue_PushCopyOfRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
+
+#define ID3D10InfoQueue_PushRetrievalFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
+
+#define ID3D10InfoQueue_PopRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This) )
+
+#define ID3D10InfoQueue_GetRetrievalFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
+
+#define ID3D10InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
+
+#define ID3D10InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define ID3D10InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
+
+#define ID3D10InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
+
+#define ID3D10InfoQueue_SetBreakOnID(This,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
+
+#define ID3D10InfoQueue_GetBreakOnCategory(This,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
+
+#define ID3D10InfoQueue_GetBreakOnSeverity(This,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
+
+#define ID3D10InfoQueue_GetBreakOnID(This,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
+
+#define ID3D10InfoQueue_SetMuteDebugOutput(This,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
+
+#define ID3D10InfoQueue_GetMuteDebugOutput(This) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D10InfoQueue_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d10sdklayers_0000_0003 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D10Debug,0x9B7E4E01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
+DEFINE_GUID(IID_ID3D10SwitchToRef,0x9B7E4E02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
+DEFINE_GUID(IID_ID3D10InfoQueue,0x1b940b17,0x2642,0x4d1f,0xab,0x1f,0xb9,0x9b,0xad,0x0c,0x39,0x5f);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/dxsdk/Include/d3d10shader.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10shader.h
index d5a8a7f3b3a..63b9da055f9 100644
--- a/3rdparty/dxsdk/Include/d3d10shader.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d10shader.h
@@ -10,9 +10,12 @@
#ifndef __D3D10SHADER_H__
#define __D3D10SHADER_H__
+
#include "d3d10.h"
+
+
//---------------------------------------------------------------------------
// D3D10_TX_VERSION:
// --------------
@@ -99,6 +102,9 @@
#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
#define D3D10_SHADER_IEEE_STRICTNESS (1 << 13)
#define D3D10_SHADER_WARNINGS_ARE_ERRORS (1 << 18)
+#define D3D10_SHADER_RESOURCES_MAY_ALIAS (1 << 19)
+#define D3D10_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)
+#define D3D10_ALL_RESOURCES_BOUND (1 << 21)
// optimization level flags
@@ -254,10 +260,14 @@ typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
// Interface definitions
//
+
+
+
typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType;
typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE;
// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD}
+interface DECLSPEC_UUID("C530AD7D-9B16-4395-A979-BA2ECFF83ADD") ID3D10ShaderReflectionType;
DEFINE_GUID(IID_ID3D10ShaderReflectionType,
0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
@@ -277,6 +287,7 @@ typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable;
typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE;
// {1BF63C95-2650-405d-99C1-3636BD1DA0A1}
+interface DECLSPEC_UUID("1BF63C95-2650-405d-99C1-3636BD1DA0A1") ID3D10ShaderReflectionVariable;
DEFINE_GUID(IID_ID3D10ShaderReflectionVariable,
0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
@@ -285,7 +296,7 @@ DEFINE_GUID(IID_ID3D10ShaderReflectionVariable,
DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
{
- STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE;
};
@@ -294,6 +305,7 @@ typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionCon
typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER;
// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}
+interface DECLSPEC_UUID("66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0") ID3D10ShaderReflectionConstantBuffer;
DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer,
0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
@@ -302,7 +314,7 @@ DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer,
DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
{
- STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
@@ -312,6 +324,7 @@ typedef interface ID3D10ShaderReflection ID3D10ShaderReflection;
typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION;
// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}
+interface DECLSPEC_UUID("D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA") ID3D10ShaderReflection;
DEFINE_GUID(IID_ID3D10ShaderReflection,
0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
@@ -324,15 +337,15 @@ DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
- STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE;
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
- STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+ STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
- STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
};
@@ -344,7 +357,6 @@ DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
extern "C" {
#endif //__cplusplus
-
//----------------------------------------------------------------------------
// D3D10CompileShader:
// ------------------
@@ -359,7 +371,7 @@ extern "C" {
// Resource name in module.
// pSrcData
// Pointer to source code.
-// SrcDataLen
+// SrcDataSize
// Size of source code, in bytes.
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
@@ -384,8 +396,8 @@ extern "C" {
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
+HRESULT WINAPI D3D10CompileShader(_In_reads_bytes_(SrcDataSize) LPCSTR pSrcData, SIZE_T SrcDataSize, _In_opt_ LPCSTR pFileName, _In_opt_ CONST D3D10_SHADER_MACRO* pDefines, _In_opt_ LPD3D10INCLUDE pInclude,
+ LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, _Out_ ID3D10Blob** ppShader, _Out_opt_ ID3D10Blob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3D10DisassembleShader:
@@ -405,7 +417,7 @@ HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFi
// Returns a buffer containing the disassembled shader.
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly);
+HRESULT WINAPI D3D10DisassembleShader(_In_reads_bytes_(BytecodeLength) CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, _In_opt_ LPCSTR pComments, _Out_ ID3D10Blob** ppDisassembly);
//----------------------------------------------------------------------------
@@ -418,11 +430,11 @@ HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength
// Pointer to the device in question
//----------------------------------------------------------------------------
-LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice);
+LPCSTR WINAPI D3D10GetPixelShaderProfile(_In_ ID3D10Device *pDevice);
-LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice);
+LPCSTR WINAPI D3D10GetVertexShaderProfile(_In_ ID3D10Device *pDevice);
-LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);
+LPCSTR WINAPI D3D10GetGeometryShaderProfile(_In_ ID3D10Device *pDevice);
//----------------------------------------------------------------------------
// D3D10ReflectShader:
@@ -442,7 +454,7 @@ LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);
//
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);
+HRESULT WINAPI D3D10ReflectShader(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10ShaderReflection **ppReflector);
//----------------------------------------------------------------------------
// D3D10PreprocessShader
@@ -453,7 +465,7 @@ HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLe
// Parameters:
// pSrcData
// Pointer to source code
-// SrcDataLen
+// SrcDataSize
// Size of source code, in bytes
// pFileName
// Source file name (used for error output)
@@ -472,8 +484,8 @@ HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLe
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
+HRESULT WINAPI D3D10PreprocessShader(_In_reads_bytes_(SrcDataSize) LPCSTR pSrcData, SIZE_T SrcDataSize, _In_opt_ LPCSTR pFileName, _In_opt_ CONST D3D10_SHADER_MACRO* pDefines,
+ _In_opt_ LPD3D10INCLUDE pInclude, _Out_ ID3D10Blob** ppShaderText, _Out_opt_ ID3D10Blob** ppErrorMsgs);
//////////////////////////////////////////////////////////////////////////
//
@@ -504,9 +516,9 @@ HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR
//
//////////////////////////////////////////////////////////////////////////
-HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
-HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
-HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
+HRESULT WINAPI D3D10GetInputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
+HRESULT WINAPI D3D10GetOutputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
+HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob **ppSignatureBlob);
//----------------------------------------------------------------------------
// D3D10GetShaderDebugInfo:
@@ -524,11 +536,12 @@ HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode,
// of this buffer, see definition of D3D10_SHADER_DEBUG_INFO above.
//----------------------------------------------------------------------------
-HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo);
+HRESULT WINAPI D3D10GetShaderDebugInfo(_In_reads_bytes_(BytecodeLength) CONST void *pShaderBytecode, SIZE_T BytecodeLength, _Out_ ID3D10Blob** ppDebugInfo);
#ifdef __cplusplus
}
#endif //__cplusplus
+
#endif //__D3D10SHADER_H__
diff --git a/3rdparty/dxsdk/Include/d3d11.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h
index d06c877f53e..65466a3814b 100644
--- a/3rdparty/dxsdk/Include/d3d11.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h
@@ -8,15 +8,14 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 7.00.0555 */
+ /* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif
+
+
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -29,7 +28,7 @@
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
+#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
@@ -48,186 +47,287 @@
#ifndef __ID3D11DeviceChild_FWD_DEFINED__
#define __ID3D11DeviceChild_FWD_DEFINED__
typedef interface ID3D11DeviceChild ID3D11DeviceChild;
+
#endif /* __ID3D11DeviceChild_FWD_DEFINED__ */
#ifndef __ID3D11DepthStencilState_FWD_DEFINED__
#define __ID3D11DepthStencilState_FWD_DEFINED__
typedef interface ID3D11DepthStencilState ID3D11DepthStencilState;
+
#endif /* __ID3D11DepthStencilState_FWD_DEFINED__ */
#ifndef __ID3D11BlendState_FWD_DEFINED__
#define __ID3D11BlendState_FWD_DEFINED__
typedef interface ID3D11BlendState ID3D11BlendState;
+
#endif /* __ID3D11BlendState_FWD_DEFINED__ */
#ifndef __ID3D11RasterizerState_FWD_DEFINED__
#define __ID3D11RasterizerState_FWD_DEFINED__
typedef interface ID3D11RasterizerState ID3D11RasterizerState;
+
#endif /* __ID3D11RasterizerState_FWD_DEFINED__ */
#ifndef __ID3D11Resource_FWD_DEFINED__
#define __ID3D11Resource_FWD_DEFINED__
typedef interface ID3D11Resource ID3D11Resource;
+
#endif /* __ID3D11Resource_FWD_DEFINED__ */
#ifndef __ID3D11Buffer_FWD_DEFINED__
#define __ID3D11Buffer_FWD_DEFINED__
typedef interface ID3D11Buffer ID3D11Buffer;
+
#endif /* __ID3D11Buffer_FWD_DEFINED__ */
#ifndef __ID3D11Texture1D_FWD_DEFINED__
#define __ID3D11Texture1D_FWD_DEFINED__
typedef interface ID3D11Texture1D ID3D11Texture1D;
+
#endif /* __ID3D11Texture1D_FWD_DEFINED__ */
#ifndef __ID3D11Texture2D_FWD_DEFINED__
#define __ID3D11Texture2D_FWD_DEFINED__
typedef interface ID3D11Texture2D ID3D11Texture2D;
+
#endif /* __ID3D11Texture2D_FWD_DEFINED__ */
#ifndef __ID3D11Texture3D_FWD_DEFINED__
#define __ID3D11Texture3D_FWD_DEFINED__
typedef interface ID3D11Texture3D ID3D11Texture3D;
+
#endif /* __ID3D11Texture3D_FWD_DEFINED__ */
#ifndef __ID3D11View_FWD_DEFINED__
#define __ID3D11View_FWD_DEFINED__
typedef interface ID3D11View ID3D11View;
+
#endif /* __ID3D11View_FWD_DEFINED__ */
#ifndef __ID3D11ShaderResourceView_FWD_DEFINED__
#define __ID3D11ShaderResourceView_FWD_DEFINED__
typedef interface ID3D11ShaderResourceView ID3D11ShaderResourceView;
+
#endif /* __ID3D11ShaderResourceView_FWD_DEFINED__ */
#ifndef __ID3D11RenderTargetView_FWD_DEFINED__
#define __ID3D11RenderTargetView_FWD_DEFINED__
typedef interface ID3D11RenderTargetView ID3D11RenderTargetView;
+
#endif /* __ID3D11RenderTargetView_FWD_DEFINED__ */
#ifndef __ID3D11DepthStencilView_FWD_DEFINED__
#define __ID3D11DepthStencilView_FWD_DEFINED__
typedef interface ID3D11DepthStencilView ID3D11DepthStencilView;
+
#endif /* __ID3D11DepthStencilView_FWD_DEFINED__ */
#ifndef __ID3D11UnorderedAccessView_FWD_DEFINED__
#define __ID3D11UnorderedAccessView_FWD_DEFINED__
typedef interface ID3D11UnorderedAccessView ID3D11UnorderedAccessView;
+
#endif /* __ID3D11UnorderedAccessView_FWD_DEFINED__ */
#ifndef __ID3D11VertexShader_FWD_DEFINED__
#define __ID3D11VertexShader_FWD_DEFINED__
typedef interface ID3D11VertexShader ID3D11VertexShader;
+
#endif /* __ID3D11VertexShader_FWD_DEFINED__ */
#ifndef __ID3D11HullShader_FWD_DEFINED__
#define __ID3D11HullShader_FWD_DEFINED__
typedef interface ID3D11HullShader ID3D11HullShader;
+
#endif /* __ID3D11HullShader_FWD_DEFINED__ */
#ifndef __ID3D11DomainShader_FWD_DEFINED__
#define __ID3D11DomainShader_FWD_DEFINED__
typedef interface ID3D11DomainShader ID3D11DomainShader;
+
#endif /* __ID3D11DomainShader_FWD_DEFINED__ */
#ifndef __ID3D11GeometryShader_FWD_DEFINED__
#define __ID3D11GeometryShader_FWD_DEFINED__
typedef interface ID3D11GeometryShader ID3D11GeometryShader;
+
#endif /* __ID3D11GeometryShader_FWD_DEFINED__ */
#ifndef __ID3D11PixelShader_FWD_DEFINED__
#define __ID3D11PixelShader_FWD_DEFINED__
typedef interface ID3D11PixelShader ID3D11PixelShader;
+
#endif /* __ID3D11PixelShader_FWD_DEFINED__ */
#ifndef __ID3D11ComputeShader_FWD_DEFINED__
#define __ID3D11ComputeShader_FWD_DEFINED__
typedef interface ID3D11ComputeShader ID3D11ComputeShader;
+
#endif /* __ID3D11ComputeShader_FWD_DEFINED__ */
#ifndef __ID3D11InputLayout_FWD_DEFINED__
#define __ID3D11InputLayout_FWD_DEFINED__
typedef interface ID3D11InputLayout ID3D11InputLayout;
+
#endif /* __ID3D11InputLayout_FWD_DEFINED__ */
#ifndef __ID3D11SamplerState_FWD_DEFINED__
#define __ID3D11SamplerState_FWD_DEFINED__
typedef interface ID3D11SamplerState ID3D11SamplerState;
+
#endif /* __ID3D11SamplerState_FWD_DEFINED__ */
#ifndef __ID3D11Asynchronous_FWD_DEFINED__
#define __ID3D11Asynchronous_FWD_DEFINED__
typedef interface ID3D11Asynchronous ID3D11Asynchronous;
+
#endif /* __ID3D11Asynchronous_FWD_DEFINED__ */
#ifndef __ID3D11Query_FWD_DEFINED__
#define __ID3D11Query_FWD_DEFINED__
typedef interface ID3D11Query ID3D11Query;
+
#endif /* __ID3D11Query_FWD_DEFINED__ */
#ifndef __ID3D11Predicate_FWD_DEFINED__
#define __ID3D11Predicate_FWD_DEFINED__
typedef interface ID3D11Predicate ID3D11Predicate;
+
#endif /* __ID3D11Predicate_FWD_DEFINED__ */
#ifndef __ID3D11Counter_FWD_DEFINED__
#define __ID3D11Counter_FWD_DEFINED__
typedef interface ID3D11Counter ID3D11Counter;
+
#endif /* __ID3D11Counter_FWD_DEFINED__ */
#ifndef __ID3D11ClassInstance_FWD_DEFINED__
#define __ID3D11ClassInstance_FWD_DEFINED__
typedef interface ID3D11ClassInstance ID3D11ClassInstance;
+
#endif /* __ID3D11ClassInstance_FWD_DEFINED__ */
#ifndef __ID3D11ClassLinkage_FWD_DEFINED__
#define __ID3D11ClassLinkage_FWD_DEFINED__
typedef interface ID3D11ClassLinkage ID3D11ClassLinkage;
+
#endif /* __ID3D11ClassLinkage_FWD_DEFINED__ */
#ifndef __ID3D11CommandList_FWD_DEFINED__
#define __ID3D11CommandList_FWD_DEFINED__
typedef interface ID3D11CommandList ID3D11CommandList;
+
#endif /* __ID3D11CommandList_FWD_DEFINED__ */
#ifndef __ID3D11DeviceContext_FWD_DEFINED__
#define __ID3D11DeviceContext_FWD_DEFINED__
typedef interface ID3D11DeviceContext ID3D11DeviceContext;
+
#endif /* __ID3D11DeviceContext_FWD_DEFINED__ */
+#ifndef __ID3D11VideoDecoder_FWD_DEFINED__
+#define __ID3D11VideoDecoder_FWD_DEFINED__
+typedef interface ID3D11VideoDecoder ID3D11VideoDecoder;
+
+#endif /* __ID3D11VideoDecoder_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessorEnumerator_FWD_DEFINED__
+#define __ID3D11VideoProcessorEnumerator_FWD_DEFINED__
+typedef interface ID3D11VideoProcessorEnumerator ID3D11VideoProcessorEnumerator;
+
+#endif /* __ID3D11VideoProcessorEnumerator_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessor_FWD_DEFINED__
+#define __ID3D11VideoProcessor_FWD_DEFINED__
+typedef interface ID3D11VideoProcessor ID3D11VideoProcessor;
+
+#endif /* __ID3D11VideoProcessor_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11AuthenticatedChannel_FWD_DEFINED__
+#define __ID3D11AuthenticatedChannel_FWD_DEFINED__
+typedef interface ID3D11AuthenticatedChannel ID3D11AuthenticatedChannel;
+
+#endif /* __ID3D11AuthenticatedChannel_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11CryptoSession_FWD_DEFINED__
+#define __ID3D11CryptoSession_FWD_DEFINED__
+typedef interface ID3D11CryptoSession ID3D11CryptoSession;
+
+#endif /* __ID3D11CryptoSession_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoDecoderOutputView_FWD_DEFINED__
+#define __ID3D11VideoDecoderOutputView_FWD_DEFINED__
+typedef interface ID3D11VideoDecoderOutputView ID3D11VideoDecoderOutputView;
+
+#endif /* __ID3D11VideoDecoderOutputView_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessorInputView_FWD_DEFINED__
+#define __ID3D11VideoProcessorInputView_FWD_DEFINED__
+typedef interface ID3D11VideoProcessorInputView ID3D11VideoProcessorInputView;
+
+#endif /* __ID3D11VideoProcessorInputView_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessorOutputView_FWD_DEFINED__
+#define __ID3D11VideoProcessorOutputView_FWD_DEFINED__
+typedef interface ID3D11VideoProcessorOutputView ID3D11VideoProcessorOutputView;
+
+#endif /* __ID3D11VideoProcessorOutputView_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoContext_FWD_DEFINED__
+#define __ID3D11VideoContext_FWD_DEFINED__
+typedef interface ID3D11VideoContext ID3D11VideoContext;
+
+#endif /* __ID3D11VideoContext_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoDevice_FWD_DEFINED__
+#define __ID3D11VideoDevice_FWD_DEFINED__
+typedef interface ID3D11VideoDevice ID3D11VideoDevice;
+
+#endif /* __ID3D11VideoDevice_FWD_DEFINED__ */
+
+
#ifndef __ID3D11Device_FWD_DEFINED__
#define __ID3D11Device_FWD_DEFINED__
typedef interface ID3D11Device ID3D11Device;
+
#endif /* __ID3D11Device_FWD_DEFINED__ */
@@ -267,6 +367,8 @@ extern "C"{
#define D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 )
+#define D3D11_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT ( 16 )
+
#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 )
#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 )
@@ -413,6 +515,22 @@ extern "C"{
#define D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 )
+#define D3D11_CS_THREADGROUPID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D11_CS_THREADGROUPID_REGISTER_COUNT ( 1 )
+
+#define D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS ( 1 )
+
+#define D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT ( 1 )
+
+#define D3D11_CS_THREADIDINGROUP_REGISTER_COMPONENTS ( 3 )
+
+#define D3D11_CS_THREADIDINGROUP_REGISTER_COUNT ( 1 )
+
+#define D3D11_CS_THREADID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D11_CS_THREADID_REGISTER_COUNT ( 1 )
+
#define D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 )
#define D3D11_CS_THREAD_GROUP_MAX_X ( 1024 )
@@ -437,7 +555,8 @@ extern "C"{
#define D3D11_DEFAULT_DEPTH_BIAS ( 0 )
#define D3D11_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f )
-#define D3D11_DEFAULT_MAX_ANISOTROPY ( 16 )
+#define D3D11_DEFAULT_MAX_ANISOTROPY ( 16 )
+
#define D3D11_DEFAULT_MIP_LOD_BIAS ( 0.0f )
#define D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 )
@@ -502,6 +621,16 @@ extern "C"{
#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 )
+#define D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 )
+
#define D3D11_DS_OUTPUT_REGISTER_COMPONENTS ( 4 )
#define D3D11_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
@@ -635,6 +764,8 @@ extern "C"{
#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 )
+#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS ( 128 )
+
#define D3D11_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 )
#define D3D11_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 )
@@ -775,6 +906,8 @@ extern "C"{
#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 )
#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f )
+#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM ( 2048 )
+
#define D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 )
#define D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 )
@@ -825,13 +958,13 @@ extern "C"{
#define D3D11_SO_STREAM_COUNT ( 4 )
-#define D3D11_SPEC_DATE_DAY ( 04 )
+#define D3D11_SPEC_DATE_DAY ( 16 )
-#define D3D11_SPEC_DATE_MONTH ( 06 )
+#define D3D11_SPEC_DATE_MONTH ( 05 )
-#define D3D11_SPEC_DATE_YEAR ( 2009 )
+#define D3D11_SPEC_DATE_YEAR ( 2011 )
-#define D3D11_SPEC_VERSION ( 1.0 )
+#define D3D11_SPEC_VERSION ( 1.07 )
#define D3D11_SRGB_GAMMA ( 2.2f )
#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f )
#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f )
@@ -908,22 +1041,23 @@ extern "C"{
#define D3D11_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 )
#endif
+#ifndef _D3D11_1_CONSTANTS
+#define _D3D11_1_CONSTANTS
+#define D3D11_1_UAV_SLOT_COUNT ( 64 )
+
+#endif
+#ifndef _D3D11_2_CONSTANTS
+#define _D3D11_2_CONSTANTS
+#define D3D11_2_TILED_RESOURCE_TILE_SIZE_IN_BYTES ( 65536 )
+
+#endif
#define _FACD3D11 ( 0x87c )
#define _FACD3D11DEBUG ( ( _FACD3D11 + 1 ) )
+/* Direct3D errors are now found in winerror.h */
#define MAKE_D3D11_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D11, code )
#define MAKE_D3D11_STATUS( code ) MAKE_HRESULT( 0, _FACD3D11, code )
-#define D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D11_HRESULT(1)
-#define D3D11_ERROR_FILE_NOT_FOUND MAKE_D3D11_HRESULT(2)
-#define D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS MAKE_D3D11_HRESULT(3)
-#define D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD MAKE_D3D11_HRESULT(4)
-#if __SAL_H_FULL_VER < 140050727
-#undef __in_range
-#undef __in_xcount_opt
-#define __in_range(x, y)
-#define __in_xcount_opt(x)
-#endif
#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
}
struct CD3D11_DEFAULT {};
@@ -932,8 +1066,9 @@ extern "C"{
#endif
typedef
enum D3D11_INPUT_CLASSIFICATION
- { D3D11_INPUT_PER_VERTEX_DATA = 0,
- D3D11_INPUT_PER_INSTANCE_DATA = 1
+ {
+ D3D11_INPUT_PER_VERTEX_DATA = 0,
+ D3D11_INPUT_PER_INSTANCE_DATA = 1
} D3D11_INPUT_CLASSIFICATION;
#define D3D11_APPEND_ALIGNED_ELEMENT ( 0xffffffff )
@@ -951,8 +1086,9 @@ typedef struct D3D11_INPUT_ELEMENT_DESC
typedef
enum D3D11_FILL_MODE
- { D3D11_FILL_WIREFRAME = 2,
- D3D11_FILL_SOLID = 3
+ {
+ D3D11_FILL_WIREFRAME = 2,
+ D3D11_FILL_SOLID = 3
} D3D11_FILL_MODE;
typedef D3D_PRIMITIVE_TOPOLOGY D3D11_PRIMITIVE_TOPOLOGY;
@@ -961,9 +1097,10 @@ typedef D3D_PRIMITIVE D3D11_PRIMITIVE;
typedef
enum D3D11_CULL_MODE
- { D3D11_CULL_NONE = 1,
- D3D11_CULL_FRONT = 2,
- D3D11_CULL_BACK = 3
+ {
+ D3D11_CULL_NONE = 1,
+ D3D11_CULL_FRONT = 2,
+ D3D11_CULL_BACK = 3
} D3D11_CULL_MODE;
typedef struct D3D11_SO_DECLARATION_ENTRY
@@ -997,114 +1134,153 @@ inline bool operator!=( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r )
{ return !( l == r ); }
extern "C"{
#endif
+typedef struct D3D11_DRAW_INSTANCED_INDIRECT_ARGS
+ {
+ UINT VertexCountPerInstance;
+ UINT InstanceCount;
+ UINT StartVertexLocation;
+ UINT StartInstanceLocation;
+ } D3D11_DRAW_INSTANCED_INDIRECT_ARGS;
+
+typedef struct D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS
+ {
+ UINT IndexCountPerInstance;
+ UINT InstanceCount;
+ UINT StartIndexLocation;
+ INT BaseVertexLocation;
+ UINT StartInstanceLocation;
+ } D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS;
+
typedef
enum D3D11_RESOURCE_DIMENSION
- { D3D11_RESOURCE_DIMENSION_UNKNOWN = 0,
- D3D11_RESOURCE_DIMENSION_BUFFER = 1,
- D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2,
- D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3,
- D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4
+ {
+ D3D11_RESOURCE_DIMENSION_UNKNOWN = 0,
+ D3D11_RESOURCE_DIMENSION_BUFFER = 1,
+ D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2,
+ D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3,
+ D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4
} D3D11_RESOURCE_DIMENSION;
typedef D3D_SRV_DIMENSION D3D11_SRV_DIMENSION;
typedef
enum D3D11_DSV_DIMENSION
- { D3D11_DSV_DIMENSION_UNKNOWN = 0,
- D3D11_DSV_DIMENSION_TEXTURE1D = 1,
- D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2,
- D3D11_DSV_DIMENSION_TEXTURE2D = 3,
- D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4,
- D3D11_DSV_DIMENSION_TEXTURE2DMS = 5,
- D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
+ {
+ D3D11_DSV_DIMENSION_UNKNOWN = 0,
+ D3D11_DSV_DIMENSION_TEXTURE1D = 1,
+ D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2,
+ D3D11_DSV_DIMENSION_TEXTURE2D = 3,
+ D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4,
+ D3D11_DSV_DIMENSION_TEXTURE2DMS = 5,
+ D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
} D3D11_DSV_DIMENSION;
typedef
enum D3D11_RTV_DIMENSION
- { D3D11_RTV_DIMENSION_UNKNOWN = 0,
- D3D11_RTV_DIMENSION_BUFFER = 1,
- D3D11_RTV_DIMENSION_TEXTURE1D = 2,
- D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3,
- D3D11_RTV_DIMENSION_TEXTURE2D = 4,
- D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5,
- D3D11_RTV_DIMENSION_TEXTURE2DMS = 6,
- D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
- D3D11_RTV_DIMENSION_TEXTURE3D = 8
+ {
+ D3D11_RTV_DIMENSION_UNKNOWN = 0,
+ D3D11_RTV_DIMENSION_BUFFER = 1,
+ D3D11_RTV_DIMENSION_TEXTURE1D = 2,
+ D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D11_RTV_DIMENSION_TEXTURE2D = 4,
+ D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D11_RTV_DIMENSION_TEXTURE2DMS = 6,
+ D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
+ D3D11_RTV_DIMENSION_TEXTURE3D = 8
} D3D11_RTV_DIMENSION;
typedef
enum D3D11_UAV_DIMENSION
- { D3D11_UAV_DIMENSION_UNKNOWN = 0,
- D3D11_UAV_DIMENSION_BUFFER = 1,
- D3D11_UAV_DIMENSION_TEXTURE1D = 2,
- D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3,
- D3D11_UAV_DIMENSION_TEXTURE2D = 4,
- D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5,
- D3D11_UAV_DIMENSION_TEXTURE3D = 8
+ {
+ D3D11_UAV_DIMENSION_UNKNOWN = 0,
+ D3D11_UAV_DIMENSION_BUFFER = 1,
+ D3D11_UAV_DIMENSION_TEXTURE1D = 2,
+ D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D11_UAV_DIMENSION_TEXTURE2D = 4,
+ D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D11_UAV_DIMENSION_TEXTURE3D = 8
} D3D11_UAV_DIMENSION;
typedef
enum D3D11_USAGE
- { D3D11_USAGE_DEFAULT = 0,
- D3D11_USAGE_IMMUTABLE = 1,
- D3D11_USAGE_DYNAMIC = 2,
- D3D11_USAGE_STAGING = 3
+ {
+ D3D11_USAGE_DEFAULT = 0,
+ D3D11_USAGE_IMMUTABLE = 1,
+ D3D11_USAGE_DYNAMIC = 2,
+ D3D11_USAGE_STAGING = 3
} D3D11_USAGE;
typedef
enum D3D11_BIND_FLAG
- { D3D11_BIND_VERTEX_BUFFER = 0x1L,
- D3D11_BIND_INDEX_BUFFER = 0x2L,
- D3D11_BIND_CONSTANT_BUFFER = 0x4L,
- D3D11_BIND_SHADER_RESOURCE = 0x8L,
- D3D11_BIND_STREAM_OUTPUT = 0x10L,
- D3D11_BIND_RENDER_TARGET = 0x20L,
- D3D11_BIND_DEPTH_STENCIL = 0x40L,
- D3D11_BIND_UNORDERED_ACCESS = 0x80L
+ {
+ D3D11_BIND_VERTEX_BUFFER = 0x1L,
+ D3D11_BIND_INDEX_BUFFER = 0x2L,
+ D3D11_BIND_CONSTANT_BUFFER = 0x4L,
+ D3D11_BIND_SHADER_RESOURCE = 0x8L,
+ D3D11_BIND_STREAM_OUTPUT = 0x10L,
+ D3D11_BIND_RENDER_TARGET = 0x20L,
+ D3D11_BIND_DEPTH_STENCIL = 0x40L,
+ D3D11_BIND_UNORDERED_ACCESS = 0x80L,
+ D3D11_BIND_DECODER = 0x200L,
+ D3D11_BIND_VIDEO_ENCODER = 0x400L
} D3D11_BIND_FLAG;
typedef
enum D3D11_CPU_ACCESS_FLAG
- { D3D11_CPU_ACCESS_WRITE = 0x10000L,
- D3D11_CPU_ACCESS_READ = 0x20000L
+ {
+ D3D11_CPU_ACCESS_WRITE = 0x10000L,
+ D3D11_CPU_ACCESS_READ = 0x20000L
} D3D11_CPU_ACCESS_FLAG;
typedef
enum D3D11_RESOURCE_MISC_FLAG
- { D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
- D3D11_RESOURCE_MISC_SHARED = 0x2L,
- D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L,
- D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L,
- D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L,
- D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L,
- D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L,
- D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L,
- D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L
+ {
+ D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
+ D3D11_RESOURCE_MISC_SHARED = 0x2L,
+ D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L,
+ D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L,
+ D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L,
+ D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L,
+ D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L,
+ D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L,
+ D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L,
+ D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x800L,
+ D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x1000L,
+ D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x2000L,
+ D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x4000L,
+ D3D11_RESOURCE_MISC_GUARDED = 0x8000L,
+ D3D11_RESOURCE_MISC_TILE_POOL = 0x20000L,
+ D3D11_RESOURCE_MISC_TILED = 0x40000L,
+ D3D11_RESOURCE_MISC_HW_PROTECTED = 0x80000L
} D3D11_RESOURCE_MISC_FLAG;
typedef
enum D3D11_MAP
- { D3D11_MAP_READ = 1,
- D3D11_MAP_WRITE = 2,
- D3D11_MAP_READ_WRITE = 3,
- D3D11_MAP_WRITE_DISCARD = 4,
- D3D11_MAP_WRITE_NO_OVERWRITE = 5
+ {
+ D3D11_MAP_READ = 1,
+ D3D11_MAP_WRITE = 2,
+ D3D11_MAP_READ_WRITE = 3,
+ D3D11_MAP_WRITE_DISCARD = 4,
+ D3D11_MAP_WRITE_NO_OVERWRITE = 5
} D3D11_MAP;
typedef
enum D3D11_MAP_FLAG
- { D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L
+ {
+ D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L
} D3D11_MAP_FLAG;
typedef
enum D3D11_RAISE_FLAG
- { D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L
+ {
+ D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L
} D3D11_RAISE_FLAG;
typedef
enum D3D11_CLEAR_FLAG
- { D3D11_CLEAR_DEPTH = 0x1L,
- D3D11_CLEAR_STENCIL = 0x2L
+ {
+ D3D11_CLEAR_DEPTH = 0x1L,
+ D3D11_CLEAR_STENCIL = 0x2L
} D3D11_CLEAR_FLAG;
typedef RECT D3D11_RECT;
@@ -1211,32 +1387,33 @@ EXTERN_C const IID IID_ID3D11DeviceChild;
public:
virtual void STDMETHODCALLTYPE GetDevice(
/* [annotation] */
- __out ID3D11Device **ppDevice) = 0;
+ _Outptr_ ID3D11Device **ppDevice) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData) = 0;
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData) = 0;
+ _In_reads_bytes_opt_( DataSize ) const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData) = 0;
+ _In_opt_ const IUnknown *pData) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11DeviceChildVtbl
@@ -1247,7 +1424,7 @@ EXTERN_C const IID IID_ID3D11DeviceChild;
ID3D11DeviceChild * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11DeviceChild * This);
@@ -1258,32 +1435,32 @@ EXTERN_C const IID IID_ID3D11DeviceChild;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11DeviceChild * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11DeviceChild * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11DeviceChildVtbl;
@@ -1336,32 +1513,35 @@ EXTERN_C const IID IID_ID3D11DeviceChild;
typedef
enum D3D11_COMPARISON_FUNC
- { D3D11_COMPARISON_NEVER = 1,
- D3D11_COMPARISON_LESS = 2,
- D3D11_COMPARISON_EQUAL = 3,
- D3D11_COMPARISON_LESS_EQUAL = 4,
- D3D11_COMPARISON_GREATER = 5,
- D3D11_COMPARISON_NOT_EQUAL = 6,
- D3D11_COMPARISON_GREATER_EQUAL = 7,
- D3D11_COMPARISON_ALWAYS = 8
+ {
+ D3D11_COMPARISON_NEVER = 1,
+ D3D11_COMPARISON_LESS = 2,
+ D3D11_COMPARISON_EQUAL = 3,
+ D3D11_COMPARISON_LESS_EQUAL = 4,
+ D3D11_COMPARISON_GREATER = 5,
+ D3D11_COMPARISON_NOT_EQUAL = 6,
+ D3D11_COMPARISON_GREATER_EQUAL = 7,
+ D3D11_COMPARISON_ALWAYS = 8
} D3D11_COMPARISON_FUNC;
typedef
enum D3D11_DEPTH_WRITE_MASK
- { D3D11_DEPTH_WRITE_MASK_ZERO = 0,
- D3D11_DEPTH_WRITE_MASK_ALL = 1
+ {
+ D3D11_DEPTH_WRITE_MASK_ZERO = 0,
+ D3D11_DEPTH_WRITE_MASK_ALL = 1
} D3D11_DEPTH_WRITE_MASK;
typedef
enum D3D11_STENCIL_OP
- { D3D11_STENCIL_OP_KEEP = 1,
- D3D11_STENCIL_OP_ZERO = 2,
- D3D11_STENCIL_OP_REPLACE = 3,
- D3D11_STENCIL_OP_INCR_SAT = 4,
- D3D11_STENCIL_OP_DECR_SAT = 5,
- D3D11_STENCIL_OP_INVERT = 6,
- D3D11_STENCIL_OP_INCR = 7,
- D3D11_STENCIL_OP_DECR = 8
+ {
+ D3D11_STENCIL_OP_KEEP = 1,
+ D3D11_STENCIL_OP_ZERO = 2,
+ D3D11_STENCIL_OP_REPLACE = 3,
+ D3D11_STENCIL_OP_INCR_SAT = 4,
+ D3D11_STENCIL_OP_DECR_SAT = 5,
+ D3D11_STENCIL_OP_INVERT = 6,
+ D3D11_STENCIL_OP_INCR = 7,
+ D3D11_STENCIL_OP_DECR = 8
} D3D11_STENCIL_OP;
typedef struct D3D11_DEPTH_STENCILOP_DESC
@@ -1464,10 +1644,11 @@ EXTERN_C const IID IID_ID3D11DepthStencilState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_DEPTH_STENCIL_DESC *pDesc) = 0;
+ _Out_ D3D11_DEPTH_STENCIL_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11DepthStencilStateVtbl
@@ -1478,7 +1659,7 @@ EXTERN_C const IID IID_ID3D11DepthStencilState;
ID3D11DepthStencilState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11DepthStencilState * This);
@@ -1489,37 +1670,37 @@ EXTERN_C const IID IID_ID3D11DepthStencilState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11DepthStencilState * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11DepthStencilState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11DepthStencilState * This,
/* [annotation] */
- __out D3D11_DEPTH_STENCIL_DESC *pDesc);
+ _Out_ D3D11_DEPTH_STENCIL_DESC *pDesc);
END_INTERFACE
} ID3D11DepthStencilStateVtbl;
@@ -1576,41 +1757,44 @@ EXTERN_C const IID IID_ID3D11DepthStencilState;
typedef
enum D3D11_BLEND
- { D3D11_BLEND_ZERO = 1,
- D3D11_BLEND_ONE = 2,
- D3D11_BLEND_SRC_COLOR = 3,
- D3D11_BLEND_INV_SRC_COLOR = 4,
- D3D11_BLEND_SRC_ALPHA = 5,
- D3D11_BLEND_INV_SRC_ALPHA = 6,
- D3D11_BLEND_DEST_ALPHA = 7,
- D3D11_BLEND_INV_DEST_ALPHA = 8,
- D3D11_BLEND_DEST_COLOR = 9,
- D3D11_BLEND_INV_DEST_COLOR = 10,
- D3D11_BLEND_SRC_ALPHA_SAT = 11,
- D3D11_BLEND_BLEND_FACTOR = 14,
- D3D11_BLEND_INV_BLEND_FACTOR = 15,
- D3D11_BLEND_SRC1_COLOR = 16,
- D3D11_BLEND_INV_SRC1_COLOR = 17,
- D3D11_BLEND_SRC1_ALPHA = 18,
- D3D11_BLEND_INV_SRC1_ALPHA = 19
+ {
+ D3D11_BLEND_ZERO = 1,
+ D3D11_BLEND_ONE = 2,
+ D3D11_BLEND_SRC_COLOR = 3,
+ D3D11_BLEND_INV_SRC_COLOR = 4,
+ D3D11_BLEND_SRC_ALPHA = 5,
+ D3D11_BLEND_INV_SRC_ALPHA = 6,
+ D3D11_BLEND_DEST_ALPHA = 7,
+ D3D11_BLEND_INV_DEST_ALPHA = 8,
+ D3D11_BLEND_DEST_COLOR = 9,
+ D3D11_BLEND_INV_DEST_COLOR = 10,
+ D3D11_BLEND_SRC_ALPHA_SAT = 11,
+ D3D11_BLEND_BLEND_FACTOR = 14,
+ D3D11_BLEND_INV_BLEND_FACTOR = 15,
+ D3D11_BLEND_SRC1_COLOR = 16,
+ D3D11_BLEND_INV_SRC1_COLOR = 17,
+ D3D11_BLEND_SRC1_ALPHA = 18,
+ D3D11_BLEND_INV_SRC1_ALPHA = 19
} D3D11_BLEND;
typedef
enum D3D11_BLEND_OP
- { D3D11_BLEND_OP_ADD = 1,
- D3D11_BLEND_OP_SUBTRACT = 2,
- D3D11_BLEND_OP_REV_SUBTRACT = 3,
- D3D11_BLEND_OP_MIN = 4,
- D3D11_BLEND_OP_MAX = 5
+ {
+ D3D11_BLEND_OP_ADD = 1,
+ D3D11_BLEND_OP_SUBTRACT = 2,
+ D3D11_BLEND_OP_REV_SUBTRACT = 3,
+ D3D11_BLEND_OP_MIN = 4,
+ D3D11_BLEND_OP_MAX = 5
} D3D11_BLEND_OP;
typedef
enum D3D11_COLOR_WRITE_ENABLE
- { D3D11_COLOR_WRITE_ENABLE_RED = 1,
- D3D11_COLOR_WRITE_ENABLE_GREEN = 2,
- D3D11_COLOR_WRITE_ENABLE_BLUE = 4,
- D3D11_COLOR_WRITE_ENABLE_ALPHA = 8,
- D3D11_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN ) | D3D11_COLOR_WRITE_ENABLE_BLUE ) | D3D11_COLOR_WRITE_ENABLE_ALPHA )
+ {
+ D3D11_COLOR_WRITE_ENABLE_RED = 1,
+ D3D11_COLOR_WRITE_ENABLE_GREEN = 2,
+ D3D11_COLOR_WRITE_ENABLE_BLUE = 4,
+ D3D11_COLOR_WRITE_ENABLE_ALPHA = 8,
+ D3D11_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN ) | D3D11_COLOR_WRITE_ENABLE_BLUE ) | D3D11_COLOR_WRITE_ENABLE_ALPHA )
} D3D11_COLOR_WRITE_ENABLE;
typedef struct D3D11_RENDER_TARGET_BLEND_DESC
@@ -1684,10 +1868,11 @@ EXTERN_C const IID IID_ID3D11BlendState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_BLEND_DESC *pDesc) = 0;
+ _Out_ D3D11_BLEND_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11BlendStateVtbl
@@ -1698,7 +1883,7 @@ EXTERN_C const IID IID_ID3D11BlendState;
ID3D11BlendState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11BlendState * This);
@@ -1709,37 +1894,37 @@ EXTERN_C const IID IID_ID3D11BlendState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11BlendState * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11BlendState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11BlendState * This,
/* [annotation] */
- __out D3D11_BLEND_DESC *pDesc);
+ _Out_ D3D11_BLEND_DESC *pDesc);
END_INTERFACE
} ID3D11BlendStateVtbl;
@@ -1880,10 +2065,11 @@ EXTERN_C const IID IID_ID3D11RasterizerState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_RASTERIZER_DESC *pDesc) = 0;
+ _Out_ D3D11_RASTERIZER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11RasterizerStateVtbl
@@ -1894,7 +2080,7 @@ EXTERN_C const IID IID_ID3D11RasterizerState;
ID3D11RasterizerState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11RasterizerState * This);
@@ -1905,37 +2091,37 @@ EXTERN_C const IID IID_ID3D11RasterizerState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11RasterizerState * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11RasterizerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11RasterizerState * This,
/* [annotation] */
- __out D3D11_RASTERIZER_DESC *pDesc);
+ _Out_ D3D11_RASTERIZER_DESC *pDesc);
END_INTERFACE
} ID3D11RasterizerStateVtbl;
@@ -2032,16 +2218,17 @@ EXTERN_C const IID IID_ID3D11Resource;
public:
virtual void STDMETHODCALLTYPE GetType(
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension) = 0;
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension) = 0;
virtual void STDMETHODCALLTYPE SetEvictionPriority(
/* [annotation] */
- __in UINT EvictionPriority) = 0;
+ _In_ UINT EvictionPriority) = 0;
virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11ResourceVtbl
@@ -2052,7 +2239,7 @@ EXTERN_C const IID IID_ID3D11Resource;
ID3D11Resource * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Resource * This);
@@ -2063,42 +2250,42 @@ EXTERN_C const IID IID_ID3D11Resource;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Resource * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Resource * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D11Resource * This,
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension);
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D11Resource * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D11Resource * This);
@@ -2223,10 +2410,11 @@ EXTERN_C const IID IID_ID3D11Buffer;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_BUFFER_DESC *pDesc) = 0;
+ _Out_ D3D11_BUFFER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11BufferVtbl
@@ -2237,7 +2425,7 @@ EXTERN_C const IID IID_ID3D11Buffer;
ID3D11Buffer * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Buffer * This);
@@ -2248,42 +2436,42 @@ EXTERN_C const IID IID_ID3D11Buffer;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Buffer * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Buffer * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D11Buffer * This,
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension);
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D11Buffer * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D11Buffer * This);
@@ -2291,7 +2479,7 @@ EXTERN_C const IID IID_ID3D11Buffer;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Buffer * This,
/* [annotation] */
- __out D3D11_BUFFER_DESC *pDesc);
+ _Out_ D3D11_BUFFER_DESC *pDesc);
END_INTERFACE
} ID3D11BufferVtbl;
@@ -2423,10 +2611,11 @@ EXTERN_C const IID IID_ID3D11Texture1D;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_TEXTURE1D_DESC *pDesc) = 0;
+ _Out_ D3D11_TEXTURE1D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11Texture1DVtbl
@@ -2437,7 +2626,7 @@ EXTERN_C const IID IID_ID3D11Texture1D;
ID3D11Texture1D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Texture1D * This);
@@ -2448,42 +2637,42 @@ EXTERN_C const IID IID_ID3D11Texture1D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Texture1D * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Texture1D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D11Texture1D * This,
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension);
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D11Texture1D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D11Texture1D * This);
@@ -2491,7 +2680,7 @@ EXTERN_C const IID IID_ID3D11Texture1D;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Texture1D * This,
/* [annotation] */
- __out D3D11_TEXTURE1D_DESC *pDesc);
+ _Out_ D3D11_TEXTURE1D_DESC *pDesc);
END_INTERFACE
} ID3D11Texture1DVtbl;
@@ -2631,10 +2820,11 @@ EXTERN_C const IID IID_ID3D11Texture2D;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_TEXTURE2D_DESC *pDesc) = 0;
+ _Out_ D3D11_TEXTURE2D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11Texture2DVtbl
@@ -2645,7 +2835,7 @@ EXTERN_C const IID IID_ID3D11Texture2D;
ID3D11Texture2D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Texture2D * This);
@@ -2656,42 +2846,42 @@ EXTERN_C const IID IID_ID3D11Texture2D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Texture2D * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Texture2D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D11Texture2D * This,
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension);
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D11Texture2D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D11Texture2D * This);
@@ -2699,7 +2889,7 @@ EXTERN_C const IID IID_ID3D11Texture2D;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Texture2D * This,
/* [annotation] */
- __out D3D11_TEXTURE2D_DESC *pDesc);
+ _Out_ D3D11_TEXTURE2D_DESC *pDesc);
END_INTERFACE
} ID3D11Texture2DVtbl;
@@ -2834,10 +3024,11 @@ EXTERN_C const IID IID_ID3D11Texture3D;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_TEXTURE3D_DESC *pDesc) = 0;
+ _Out_ D3D11_TEXTURE3D_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11Texture3DVtbl
@@ -2848,7 +3039,7 @@ EXTERN_C const IID IID_ID3D11Texture3D;
ID3D11Texture3D * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Texture3D * This);
@@ -2859,42 +3050,42 @@ EXTERN_C const IID IID_ID3D11Texture3D;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Texture3D * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Texture3D * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetType )(
ID3D11Texture3D * This,
/* [annotation] */
- __out D3D11_RESOURCE_DIMENSION *pResourceDimension);
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
void ( STDMETHODCALLTYPE *SetEvictionPriority )(
ID3D11Texture3D * This,
/* [annotation] */
- __in UINT EvictionPriority);
+ _In_ UINT EvictionPriority);
UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
ID3D11Texture3D * This);
@@ -2902,7 +3093,7 @@ EXTERN_C const IID IID_ID3D11Texture3D;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Texture3D * This,
/* [annotation] */
- __out D3D11_TEXTURE3D_DESC *pDesc);
+ _Out_ D3D11_TEXTURE3D_DESC *pDesc);
END_INTERFACE
} ID3D11Texture3DVtbl;
@@ -2969,12 +3160,13 @@ EXTERN_C const IID IID_ID3D11Texture3D;
typedef
enum D3D11_TEXTURECUBE_FACE
- { D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0,
- D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1,
- D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2,
- D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
- D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4,
- D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5
+ {
+ D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0,
+ D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1,
+ D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2,
+ D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
+ D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4,
+ D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5
} D3D11_TEXTURECUBE_FACE;
@@ -2999,10 +3191,11 @@ EXTERN_C const IID IID_ID3D11View;
public:
virtual void STDMETHODCALLTYPE GetResource(
/* [annotation] */
- __out ID3D11Resource **ppResource) = 0;
+ _Outptr_ ID3D11Resource **ppResource) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11ViewVtbl
@@ -3013,7 +3206,7 @@ EXTERN_C const IID IID_ID3D11View;
ID3D11View * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11View * This);
@@ -3024,37 +3217,37 @@ EXTERN_C const IID IID_ID3D11View;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11View * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11View * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D11View * This,
/* [annotation] */
- __out ID3D11Resource **ppResource);
+ _Outptr_ ID3D11Resource **ppResource);
END_INTERFACE
} ID3D11ViewVtbl;
@@ -3125,7 +3318,8 @@ typedef struct D3D11_BUFFER_SRV
typedef
enum D3D11_BUFFEREX_SRV_FLAG
- { D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1
+ {
+ D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1
} D3D11_BUFFEREX_SRV_FLAG;
typedef struct D3D11_BUFFEREX_SRV
@@ -3289,7 +3483,7 @@ struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
- __in ID3D11Buffer*,
+ _In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements,
@@ -3302,7 +3496,7 @@ struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC
BufferEx.Flags = flags;
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
- __in ID3D11Texture1D* pTex1D,
+ _In_ ID3D11Texture1D* pTex1D,
D3D11_SRV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
@@ -3337,7 +3531,7 @@ struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
- __in ID3D11Texture2D* pTex2D,
+ _In_ ID3D11Texture2D* pTex2D,
D3D11_SRV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
@@ -3398,7 +3592,7 @@ struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC
}
}
explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
- __in ID3D11Texture3D* pTex3D,
+ _In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mostDetailedMip = 0,
UINT mipLevels = -1 )
@@ -3442,10 +3636,11 @@ EXTERN_C const IID IID_ID3D11ShaderResourceView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11ShaderResourceViewVtbl
@@ -3456,7 +3651,7 @@ EXTERN_C const IID IID_ID3D11ShaderResourceView;
ID3D11ShaderResourceView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ShaderResourceView * This);
@@ -3467,42 +3662,42 @@ EXTERN_C const IID IID_ID3D11ShaderResourceView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __out ID3D11Resource **ppResource);
+ _Outptr_ ID3D11Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11ShaderResourceView * This,
/* [annotation] */
- __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc);
+ _Out_ D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D11ShaderResourceViewVtbl;
@@ -3689,7 +3884,7 @@ struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC(
- __in ID3D11Buffer*,
+ _In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements )
@@ -3700,7 +3895,7 @@ struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC
Buffer.NumElements = numElements;
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC(
- __in ID3D11Texture1D* pTex1D,
+ _In_ ID3D11Texture1D* pTex1D,
D3D11_RTV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -3731,7 +3926,7 @@ struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC(
- __in ID3D11Texture2D* pTex2D,
+ _In_ ID3D11Texture2D* pTex2D,
D3D11_RTV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -3770,7 +3965,7 @@ struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC
}
}
explicit CD3D11_RENDER_TARGET_VIEW_DESC(
- __in ID3D11Texture3D* pTex3D,
+ _In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstWSlice = 0,
@@ -3816,10 +4011,11 @@ EXTERN_C const IID IID_ID3D11RenderTargetView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D11_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11RenderTargetViewVtbl
@@ -3830,7 +4026,7 @@ EXTERN_C const IID IID_ID3D11RenderTargetView;
ID3D11RenderTargetView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11RenderTargetView * This);
@@ -3841,42 +4037,42 @@ EXTERN_C const IID IID_ID3D11RenderTargetView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __out ID3D11Resource **ppResource);
+ _Outptr_ ID3D11Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11RenderTargetView * This,
/* [annotation] */
- __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc);
+ _Out_ D3D11_RENDER_TARGET_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D11RenderTargetViewVtbl;
@@ -3960,8 +4156,8 @@ struct CD3D11_VIEWPORT : public D3D11_VIEWPORT
MaxDepth = maxDepth;
}
explicit CD3D11_VIEWPORT(
- __in ID3D11Buffer*,
- __in ID3D11RenderTargetView* pRTView,
+ _In_ ID3D11Buffer*,
+ _In_ ID3D11RenderTargetView* pRTView,
FLOAT topLeftX = 0.0f,
FLOAT minDepth = D3D11_MIN_DEPTH,
FLOAT maxDepth = D3D11_MAX_DEPTH )
@@ -3984,8 +4180,8 @@ struct CD3D11_VIEWPORT : public D3D11_VIEWPORT
MaxDepth = maxDepth;
}
explicit CD3D11_VIEWPORT(
- __in ID3D11Texture1D* pTex1D,
- __in ID3D11RenderTargetView* pRTView,
+ _In_ ID3D11Texture1D* pTex1D,
+ _In_ ID3D11RenderTargetView* pRTView,
FLOAT topLeftX = 0.0f,
FLOAT minDepth = D3D11_MIN_DEPTH,
FLOAT maxDepth = D3D11_MAX_DEPTH )
@@ -4014,8 +4210,8 @@ struct CD3D11_VIEWPORT : public D3D11_VIEWPORT
MaxDepth = maxDepth;
}
explicit CD3D11_VIEWPORT(
- __in ID3D11Texture2D* pTex2D,
- __in ID3D11RenderTargetView* pRTView,
+ _In_ ID3D11Texture2D* pTex2D,
+ _In_ ID3D11RenderTargetView* pRTView,
FLOAT topLeftX = 0.0f,
FLOAT topLeftY = 0.0f,
FLOAT minDepth = D3D11_MIN_DEPTH,
@@ -4049,8 +4245,8 @@ struct CD3D11_VIEWPORT : public D3D11_VIEWPORT
MaxDepth = maxDepth;
}
explicit CD3D11_VIEWPORT(
- __in ID3D11Texture3D* pTex3D,
- __in ID3D11RenderTargetView* pRTView,
+ _In_ ID3D11Texture3D* pTex3D,
+ _In_ ID3D11RenderTargetView* pRTView,
FLOAT topLeftX = 0.0f,
FLOAT topLeftY = 0.0f,
FLOAT minDepth = D3D11_MIN_DEPTH,
@@ -4119,8 +4315,9 @@ typedef struct D3D11_TEX2DMS_ARRAY_DSV
typedef
enum D3D11_DSV_FLAG
- { D3D11_DSV_READ_ONLY_DEPTH = 0x1L,
- D3D11_DSV_READ_ONLY_STENCIL = 0x2L
+ {
+ D3D11_DSV_READ_ONLY_DEPTH = 0x1L,
+ D3D11_DSV_READ_ONLY_STENCIL = 0x2L
} D3D11_DSV_FLAG;
typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC
@@ -4187,7 +4384,7 @@ struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC
}
}
explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
- __in ID3D11Texture1D* pTex1D,
+ _In_ ID3D11Texture1D* pTex1D,
D3D11_DSV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -4220,7 +4417,7 @@ struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC
}
}
explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
- __in ID3D11Texture2D* pTex2D,
+ _In_ ID3D11Texture2D* pTex2D,
D3D11_DSV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -4287,10 +4484,11 @@ EXTERN_C const IID IID_ID3D11DepthStencilView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11DepthStencilViewVtbl
@@ -4301,7 +4499,7 @@ EXTERN_C const IID IID_ID3D11DepthStencilView;
ID3D11DepthStencilView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11DepthStencilView * This);
@@ -4312,42 +4510,42 @@ EXTERN_C const IID IID_ID3D11DepthStencilView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __out ID3D11Resource **ppResource);
+ _Outptr_ ID3D11Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11DepthStencilView * This,
/* [annotation] */
- __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc);
+ _Out_ D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D11DepthStencilViewVtbl;
@@ -4408,9 +4606,10 @@ EXTERN_C const IID IID_ID3D11DepthStencilView;
typedef
enum D3D11_BUFFER_UAV_FLAG
- { D3D11_BUFFER_UAV_FLAG_RAW = 0x1,
- D3D11_BUFFER_UAV_FLAG_APPEND = 0x2,
- D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4
+ {
+ D3D11_BUFFER_UAV_FLAG_RAW = 0x1,
+ D3D11_BUFFER_UAV_FLAG_APPEND = 0x2,
+ D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4
} D3D11_BUFFER_UAV_FLAG;
typedef struct D3D11_BUFFER_UAV
@@ -4517,7 +4716,7 @@ struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DE
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC(
- __in ID3D11Buffer*,
+ _In_ ID3D11Buffer*,
DXGI_FORMAT format,
UINT firstElement,
UINT numElements,
@@ -4530,7 +4729,7 @@ struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DE
Buffer.Flags = flags;
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC(
- __in ID3D11Texture1D* pTex1D,
+ _In_ ID3D11Texture1D* pTex1D,
D3D11_UAV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -4561,7 +4760,7 @@ struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DE
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC(
- __in ID3D11Texture2D* pTex2D,
+ _In_ ID3D11Texture2D* pTex2D,
D3D11_UAV_DIMENSION viewDimension,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
@@ -4592,7 +4791,7 @@ struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DE
}
}
explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC(
- __in ID3D11Texture3D* pTex3D,
+ _In_ ID3D11Texture3D* pTex3D,
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
UINT mipSlice = 0,
UINT firstWSlice = 0,
@@ -4638,10 +4837,11 @@ EXTERN_C const IID IID_ID3D11UnorderedAccessView;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc) = 0;
+ _Out_ D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11UnorderedAccessViewVtbl
@@ -4652,7 +4852,7 @@ EXTERN_C const IID IID_ID3D11UnorderedAccessView;
ID3D11UnorderedAccessView * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11UnorderedAccessView * This);
@@ -4663,42 +4863,42 @@ EXTERN_C const IID IID_ID3D11UnorderedAccessView;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetResource )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __out ID3D11Resource **ppResource);
+ _Outptr_ ID3D11Resource **ppResource);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11UnorderedAccessView * This,
/* [annotation] */
- __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc);
+ _Out_ D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc);
END_INTERFACE
} ID3D11UnorderedAccessViewVtbl;
@@ -4771,6 +4971,7 @@ EXTERN_C const IID IID_ID3D11VertexShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11VertexShaderVtbl
@@ -4781,7 +4982,7 @@ EXTERN_C const IID IID_ID3D11VertexShader;
ID3D11VertexShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11VertexShader * This);
@@ -4792,32 +4993,32 @@ EXTERN_C const IID IID_ID3D11VertexShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11VertexShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11VertexShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11VertexShaderVtbl;
@@ -4883,6 +5084,7 @@ EXTERN_C const IID IID_ID3D11HullShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11HullShaderVtbl
@@ -4893,7 +5095,7 @@ EXTERN_C const IID IID_ID3D11HullShader;
ID3D11HullShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11HullShader * This);
@@ -4904,32 +5106,32 @@ EXTERN_C const IID IID_ID3D11HullShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11HullShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11HullShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11HullShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11HullShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11HullShaderVtbl;
@@ -4995,6 +5197,7 @@ EXTERN_C const IID IID_ID3D11DomainShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11DomainShaderVtbl
@@ -5005,7 +5208,7 @@ EXTERN_C const IID IID_ID3D11DomainShader;
ID3D11DomainShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11DomainShader * This);
@@ -5016,32 +5219,32 @@ EXTERN_C const IID IID_ID3D11DomainShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11DomainShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11DomainShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11DomainShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11DomainShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11DomainShaderVtbl;
@@ -5107,6 +5310,7 @@ EXTERN_C const IID IID_ID3D11GeometryShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11GeometryShaderVtbl
@@ -5117,7 +5321,7 @@ EXTERN_C const IID IID_ID3D11GeometryShader;
ID3D11GeometryShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11GeometryShader * This);
@@ -5128,32 +5332,32 @@ EXTERN_C const IID IID_ID3D11GeometryShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11GeometryShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11GeometryShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11GeometryShaderVtbl;
@@ -5219,6 +5423,7 @@ EXTERN_C const IID IID_ID3D11PixelShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11PixelShaderVtbl
@@ -5229,7 +5434,7 @@ EXTERN_C const IID IID_ID3D11PixelShader;
ID3D11PixelShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11PixelShader * This);
@@ -5240,32 +5445,32 @@ EXTERN_C const IID IID_ID3D11PixelShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11PixelShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11PixelShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11PixelShaderVtbl;
@@ -5331,6 +5536,7 @@ EXTERN_C const IID IID_ID3D11ComputeShader;
public:
};
+
#else /* C style interface */
typedef struct ID3D11ComputeShaderVtbl
@@ -5341,7 +5547,7 @@ EXTERN_C const IID IID_ID3D11ComputeShader;
ID3D11ComputeShader * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ComputeShader * This);
@@ -5352,32 +5558,32 @@ EXTERN_C const IID IID_ID3D11ComputeShader;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11ComputeShader * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11ComputeShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11ComputeShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11ComputeShader * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11ComputeShaderVtbl;
@@ -5443,6 +5649,7 @@ EXTERN_C const IID IID_ID3D11InputLayout;
public:
};
+
#else /* C style interface */
typedef struct ID3D11InputLayoutVtbl
@@ -5453,7 +5660,7 @@ EXTERN_C const IID IID_ID3D11InputLayout;
ID3D11InputLayout * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11InputLayout * This);
@@ -5464,32 +5671,32 @@ EXTERN_C const IID IID_ID3D11InputLayout;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11InputLayout * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11InputLayout * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
END_INTERFACE
} ID3D11InputLayoutVtbl;
@@ -5543,32 +5750,65 @@ EXTERN_C const IID IID_ID3D11InputLayout;
typedef
enum D3D11_FILTER
- { D3D11_FILTER_MIN_MAG_MIP_POINT = 0,
- D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
- D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
- D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
- D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
- D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
- D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
- D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
- D3D11_FILTER_ANISOTROPIC = 0x55,
- D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
- D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
- D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
- D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
- D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
- D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
- D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
- D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
- D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5
+ {
+ D3D11_FILTER_MIN_MAG_MIP_POINT = 0,
+ D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
+ D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
+ D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
+ D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
+ D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
+ D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
+ D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+ D3D11_FILTER_ANISOTROPIC = 0x55,
+ D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
+ D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
+ D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
+ D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
+ D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
+ D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
+ D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
+ D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
+ D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
+ D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
+ D3D11_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
+ D3D11_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104,
+ D3D11_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105,
+ D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110,
+ D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
+ D3D11_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
+ D3D11_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
+ D3D11_FILTER_MINIMUM_ANISOTROPIC = 0x155,
+ D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
+ D3D11_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
+ D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184,
+ D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185,
+ D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190,
+ D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
+ D3D11_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
+ D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
+ D3D11_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5
} D3D11_FILTER;
typedef
enum D3D11_FILTER_TYPE
- { D3D11_FILTER_TYPE_POINT = 0,
- D3D11_FILTER_TYPE_LINEAR = 1
+ {
+ D3D11_FILTER_TYPE_POINT = 0,
+ D3D11_FILTER_TYPE_LINEAR = 1
} D3D11_FILTER_TYPE;
+typedef
+enum D3D11_FILTER_REDUCTION_TYPE
+ {
+ D3D11_FILTER_REDUCTION_TYPE_STANDARD = 0,
+ D3D11_FILTER_REDUCTION_TYPE_COMPARISON = 1,
+ D3D11_FILTER_REDUCTION_TYPE_MINIMUM = 2,
+ D3D11_FILTER_REDUCTION_TYPE_MAXIMUM = 3
+ } D3D11_FILTER_REDUCTION_TYPE;
+
+#define D3D11_FILTER_REDUCTION_TYPE_MASK ( 0x3 )
+
+#define D3D11_FILTER_REDUCTION_TYPE_SHIFT ( 7 )
+
#define D3D11_FILTER_TYPE_MASK ( 0x3 )
#define D3D11_MIN_FILTER_SHIFT ( 4 )
@@ -5577,23 +5817,26 @@ enum D3D11_FILTER_TYPE
#define D3D11_MIP_FILTER_SHIFT ( 0 )
+// D3D11_COMPARISON_FILTERING_BIT is no longer used / meaningless. The D3D11_FILTER_REDUCTION_TYPE enum replaced it.
+// Old code that uses D3D11_COMPARISON_FILTERING_BIT and would never use D3D11_FILTER_MINIMUM_* or D3D11_FILTER_MAXIMUM_*
+// will still work fine though, so the define is left to avoid breaks.
#define D3D11_COMPARISON_FILTERING_BIT ( 0x80 )
#define D3D11_ANISOTROPIC_FILTERING_BIT ( 0x40 )
-#define D3D11_ENCODE_BASIC_FILTER( min, mag, mip, bComparison ) \
- ( ( D3D11_FILTER ) ( \
- ( ( bComparison ) ? D3D11_COMPARISON_FILTERING_BIT : 0 ) | \
- ( ( ( min ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIN_FILTER_SHIFT ) | \
- ( ( ( mag ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MAG_FILTER_SHIFT ) | \
- ( ( ( mip ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIP_FILTER_SHIFT ) ) )
-#define D3D11_ENCODE_ANISOTROPIC_FILTER( bComparison ) \
+#define D3D11_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \
+ ( ( D3D11_FILTER ) ( \
+ ( ( ( min ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIN_FILTER_SHIFT ) | \
+ ( ( ( mag ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MAG_FILTER_SHIFT ) | \
+ ( ( ( mip ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIP_FILTER_SHIFT ) | \
+ ( ( ( reduction ) & D3D11_FILTER_REDUCTION_TYPE_MASK ) << D3D11_FILTER_REDUCTION_TYPE_SHIFT ) ) )
+#define D3D11_ENCODE_ANISOTROPIC_FILTER( reduction ) \
( ( D3D11_FILTER ) ( \
D3D11_ANISOTROPIC_FILTERING_BIT | \
D3D11_ENCODE_BASIC_FILTER( D3D11_FILTER_TYPE_LINEAR, \
D3D11_FILTER_TYPE_LINEAR, \
D3D11_FILTER_TYPE_LINEAR, \
- bComparison ) ) )
+ reduction ) ) )
#define D3D11_DECODE_MIN_FILTER( d3d11Filter ) \
( ( D3D11_FILTER_TYPE ) \
( ( ( d3d11Filter ) >> D3D11_MIN_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) )
@@ -5603,8 +5846,11 @@ enum D3D11_FILTER_TYPE
#define D3D11_DECODE_MIP_FILTER( d3d11Filter ) \
( ( D3D11_FILTER_TYPE ) \
( ( ( d3d11Filter ) >> D3D11_MIP_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) )
+#define D3D11_DECODE_FILTER_REDUCTION( d3d11Filter ) \
+ ( ( D3D11_FILTER_REDUCTION_TYPE ) \
+ ( ( ( d3d11Filter ) >> D3D11_FILTER_REDUCTION_TYPE_SHIFT ) & D3D11_FILTER_REDUCTION_TYPE_MASK ) )
#define D3D11_DECODE_IS_COMPARISON_FILTER( d3d11Filter ) \
- ( ( d3d11Filter ) & D3D11_COMPARISON_FILTERING_BIT )
+ ( D3D11_DECODE_FILTER_REDUCTION( d3d11Filter ) == D3D11_FILTER_REDUCTION_TYPE_COMPARISON )
#define D3D11_DECODE_IS_ANISOTROPIC_FILTER( d3d11Filter ) \
( ( ( d3d11Filter ) & D3D11_ANISOTROPIC_FILTERING_BIT ) && \
( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER( d3d11Filter ) ) && \
@@ -5612,11 +5858,12 @@ enum D3D11_FILTER_TYPE
( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER( d3d11Filter ) ) )
typedef
enum D3D11_TEXTURE_ADDRESS_MODE
- { D3D11_TEXTURE_ADDRESS_WRAP = 1,
- D3D11_TEXTURE_ADDRESS_MIRROR = 2,
- D3D11_TEXTURE_ADDRESS_CLAMP = 3,
- D3D11_TEXTURE_ADDRESS_BORDER = 4,
- D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5
+ {
+ D3D11_TEXTURE_ADDRESS_WRAP = 1,
+ D3D11_TEXTURE_ADDRESS_MIRROR = 2,
+ D3D11_TEXTURE_ADDRESS_CLAMP = 3,
+ D3D11_TEXTURE_ADDRESS_BORDER = 4,
+ D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5
} D3D11_TEXTURE_ADDRESS_MODE;
typedef struct D3D11_SAMPLER_DESC
@@ -5666,7 +5913,7 @@ struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC
FLOAT mipLODBias,
UINT maxAnisotropy,
D3D11_COMPARISON_FUNC comparisonFunc,
- __in_ecount_opt( 4 ) const FLOAT* borderColor, // RGBA
+ _In_reads_opt_( 4 ) const FLOAT* borderColor, // RGBA
FLOAT minLOD,
FLOAT maxLOD )
{
@@ -5713,10 +5960,11 @@ EXTERN_C const IID IID_ID3D11SamplerState;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_SAMPLER_DESC *pDesc) = 0;
+ _Out_ D3D11_SAMPLER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11SamplerStateVtbl
@@ -5727,7 +5975,7 @@ EXTERN_C const IID IID_ID3D11SamplerState;
ID3D11SamplerState * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11SamplerState * This);
@@ -5738,37 +5986,37 @@ EXTERN_C const IID IID_ID3D11SamplerState;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11SamplerState * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11SamplerState * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11SamplerState * This,
/* [annotation] */
- __out D3D11_SAMPLER_DESC *pDesc);
+ _Out_ D3D11_SAMPLER_DESC *pDesc);
END_INTERFACE
} ID3D11SamplerStateVtbl;
@@ -5825,45 +6073,55 @@ EXTERN_C const IID IID_ID3D11SamplerState;
typedef
enum D3D11_FORMAT_SUPPORT
- { D3D11_FORMAT_SUPPORT_BUFFER = 0x1,
- D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2,
- D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4,
- D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8,
- D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10,
- D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20,
- D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40,
- D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80,
- D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100,
- D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200,
- D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400,
- D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800,
- D3D11_FORMAT_SUPPORT_MIP = 0x1000,
- D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000,
- D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000,
- D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000,
- D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000,
- D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000,
- D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000,
- D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000,
- D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000,
- D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000,
- D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000,
- D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000,
- D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000,
- D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000,
- D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000
+ {
+ D3D11_FORMAT_SUPPORT_BUFFER = 0x1,
+ D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2,
+ D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4,
+ D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8,
+ D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10,
+ D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20,
+ D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40,
+ D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80,
+ D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100,
+ D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200,
+ D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400,
+ D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800,
+ D3D11_FORMAT_SUPPORT_MIP = 0x1000,
+ D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000,
+ D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000,
+ D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000,
+ D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000,
+ D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000,
+ D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000,
+ D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000,
+ D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000,
+ D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000,
+ D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000,
+ D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000,
+ D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000,
+ D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000,
+ D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000,
+ D3D11_FORMAT_SUPPORT_DECODER_OUTPUT = 0x8000000,
+ D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT = 0x10000000,
+ D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT = 0x20000000,
+ D3D11_FORMAT_SUPPORT_VIDEO_ENCODER = 0x40000000
} D3D11_FORMAT_SUPPORT;
typedef
enum D3D11_FORMAT_SUPPORT2
- { D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1,
- D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2,
- D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4,
- D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8,
- D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10,
- D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20,
- D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40,
- D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80
+ {
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1,
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2,
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4,
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8,
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10,
+ D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20,
+ D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40,
+ D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80,
+ D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100,
+ D3D11_FORMAT_SUPPORT2_TILED = 0x200,
+ D3D11_FORMAT_SUPPORT2_SHAREABLE = 0x400,
+ D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
} D3D11_FORMAT_SUPPORT2;
@@ -5890,6 +6148,7 @@ EXTERN_C const IID IID_ID3D11Asynchronous;
};
+
#else /* C style interface */
typedef struct ID3D11AsynchronousVtbl
@@ -5900,7 +6159,7 @@ EXTERN_C const IID IID_ID3D11Asynchronous;
ID3D11Asynchronous * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Asynchronous * This);
@@ -5911,32 +6170,32 @@ EXTERN_C const IID IID_ID3D11Asynchronous;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Asynchronous * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Asynchronous * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D11Asynchronous * This);
@@ -5996,32 +6255,35 @@ EXTERN_C const IID IID_ID3D11Asynchronous;
typedef
enum D3D11_ASYNC_GETDATA_FLAG
- { D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1
+ {
+ D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1
} D3D11_ASYNC_GETDATA_FLAG;
typedef
enum D3D11_QUERY
- { D3D11_QUERY_EVENT = 0,
- D3D11_QUERY_OCCLUSION = ( D3D11_QUERY_EVENT + 1 ) ,
- D3D11_QUERY_TIMESTAMP = ( D3D11_QUERY_OCCLUSION + 1 ) ,
- D3D11_QUERY_TIMESTAMP_DISJOINT = ( D3D11_QUERY_TIMESTAMP + 1 ) ,
- D3D11_QUERY_PIPELINE_STATISTICS = ( D3D11_QUERY_TIMESTAMP_DISJOINT + 1 ) ,
- D3D11_QUERY_OCCLUSION_PREDICATE = ( D3D11_QUERY_PIPELINE_STATISTICS + 1 ) ,
- D3D11_QUERY_SO_STATISTICS = ( D3D11_QUERY_OCCLUSION_PREDICATE + 1 ) ,
- D3D11_QUERY_SO_OVERFLOW_PREDICATE = ( D3D11_QUERY_SO_STATISTICS + 1 ) ,
- D3D11_QUERY_SO_STATISTICS_STREAM0 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1 ) ,
- D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = ( D3D11_QUERY_SO_STATISTICS_STREAM0 + 1 ) ,
- D3D11_QUERY_SO_STATISTICS_STREAM1 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1 ) ,
- D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = ( D3D11_QUERY_SO_STATISTICS_STREAM1 + 1 ) ,
- D3D11_QUERY_SO_STATISTICS_STREAM2 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1 ) ,
- D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = ( D3D11_QUERY_SO_STATISTICS_STREAM2 + 1 ) ,
- D3D11_QUERY_SO_STATISTICS_STREAM3 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1 ) ,
- D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = ( D3D11_QUERY_SO_STATISTICS_STREAM3 + 1 )
+ {
+ D3D11_QUERY_EVENT = 0,
+ D3D11_QUERY_OCCLUSION = ( D3D11_QUERY_EVENT + 1 ) ,
+ D3D11_QUERY_TIMESTAMP = ( D3D11_QUERY_OCCLUSION + 1 ) ,
+ D3D11_QUERY_TIMESTAMP_DISJOINT = ( D3D11_QUERY_TIMESTAMP + 1 ) ,
+ D3D11_QUERY_PIPELINE_STATISTICS = ( D3D11_QUERY_TIMESTAMP_DISJOINT + 1 ) ,
+ D3D11_QUERY_OCCLUSION_PREDICATE = ( D3D11_QUERY_PIPELINE_STATISTICS + 1 ) ,
+ D3D11_QUERY_SO_STATISTICS = ( D3D11_QUERY_OCCLUSION_PREDICATE + 1 ) ,
+ D3D11_QUERY_SO_OVERFLOW_PREDICATE = ( D3D11_QUERY_SO_STATISTICS + 1 ) ,
+ D3D11_QUERY_SO_STATISTICS_STREAM0 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1 ) ,
+ D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = ( D3D11_QUERY_SO_STATISTICS_STREAM0 + 1 ) ,
+ D3D11_QUERY_SO_STATISTICS_STREAM1 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1 ) ,
+ D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = ( D3D11_QUERY_SO_STATISTICS_STREAM1 + 1 ) ,
+ D3D11_QUERY_SO_STATISTICS_STREAM2 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1 ) ,
+ D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = ( D3D11_QUERY_SO_STATISTICS_STREAM2 + 1 ) ,
+ D3D11_QUERY_SO_STATISTICS_STREAM3 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1 ) ,
+ D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = ( D3D11_QUERY_SO_STATISTICS_STREAM3 + 1 )
} D3D11_QUERY;
typedef
enum D3D11_QUERY_MISC_FLAG
- { D3D11_QUERY_MISC_PREDICATEHINT = 0x1
+ {
+ D3D11_QUERY_MISC_PREDICATEHINT = 0x1
} D3D11_QUERY_MISC_FLAG;
typedef struct D3D11_QUERY_DESC
@@ -6073,10 +6335,11 @@ EXTERN_C const IID IID_ID3D11Query;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_QUERY_DESC *pDesc) = 0;
+ _Out_ D3D11_QUERY_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11QueryVtbl
@@ -6087,7 +6350,7 @@ EXTERN_C const IID IID_ID3D11Query;
ID3D11Query * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Query * This);
@@ -6098,32 +6361,32 @@ EXTERN_C const IID IID_ID3D11Query;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Query * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Query * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D11Query * This);
@@ -6131,7 +6394,7 @@ EXTERN_C const IID IID_ID3D11Query;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Query * This,
/* [annotation] */
- __out D3D11_QUERY_DESC *pDesc);
+ _Out_ D3D11_QUERY_DESC *pDesc);
END_INTERFACE
} ID3D11QueryVtbl;
@@ -6204,6 +6467,7 @@ EXTERN_C const IID IID_ID3D11Predicate;
public:
};
+
#else /* C style interface */
typedef struct ID3D11PredicateVtbl
@@ -6214,7 +6478,7 @@ EXTERN_C const IID IID_ID3D11Predicate;
ID3D11Predicate * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Predicate * This);
@@ -6225,32 +6489,32 @@ EXTERN_C const IID IID_ID3D11Predicate;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Predicate * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Predicate * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D11Predicate * This);
@@ -6258,7 +6522,7 @@ EXTERN_C const IID IID_ID3D11Predicate;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Predicate * This,
/* [annotation] */
- __out D3D11_QUERY_DESC *pDesc);
+ _Out_ D3D11_QUERY_DESC *pDesc);
END_INTERFACE
} ID3D11PredicateVtbl;
@@ -6347,15 +6611,17 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS
typedef
enum D3D11_COUNTER
- { D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
+ {
+ D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
} D3D11_COUNTER;
typedef
enum D3D11_COUNTER_TYPE
- { D3D11_COUNTER_TYPE_FLOAT32 = 0,
- D3D11_COUNTER_TYPE_UINT16 = ( D3D11_COUNTER_TYPE_FLOAT32 + 1 ) ,
- D3D11_COUNTER_TYPE_UINT32 = ( D3D11_COUNTER_TYPE_UINT16 + 1 ) ,
- D3D11_COUNTER_TYPE_UINT64 = ( D3D11_COUNTER_TYPE_UINT32 + 1 )
+ {
+ D3D11_COUNTER_TYPE_FLOAT32 = 0,
+ D3D11_COUNTER_TYPE_UINT16 = ( D3D11_COUNTER_TYPE_FLOAT32 + 1 ) ,
+ D3D11_COUNTER_TYPE_UINT32 = ( D3D11_COUNTER_TYPE_UINT16 + 1 ) ,
+ D3D11_COUNTER_TYPE_UINT64 = ( D3D11_COUNTER_TYPE_UINT32 + 1 )
} D3D11_COUNTER_TYPE;
typedef struct D3D11_COUNTER_DESC
@@ -6414,10 +6680,11 @@ EXTERN_C const IID IID_ID3D11Counter;
public:
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_COUNTER_DESC *pDesc) = 0;
+ _Out_ D3D11_COUNTER_DESC *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11CounterVtbl
@@ -6428,7 +6695,7 @@ EXTERN_C const IID IID_ID3D11Counter;
ID3D11Counter * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Counter * This);
@@ -6439,32 +6706,32 @@ EXTERN_C const IID IID_ID3D11Counter;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11Counter * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Counter * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
UINT ( STDMETHODCALLTYPE *GetDataSize )(
ID3D11Counter * This);
@@ -6472,7 +6739,7 @@ EXTERN_C const IID IID_ID3D11Counter;
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11Counter * This,
/* [annotation] */
- __out D3D11_COUNTER_DESC *pDesc);
+ _Out_ D3D11_COUNTER_DESC *pDesc);
END_INTERFACE
} ID3D11CounterVtbl;
@@ -6533,14 +6800,16 @@ EXTERN_C const IID IID_ID3D11Counter;
typedef
enum D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS
- { D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
- D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
+ {
+ D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff,
+ D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe
} D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS;
typedef
enum D3D11_DEVICE_CONTEXT_TYPE
- { D3D11_DEVICE_CONTEXT_IMMEDIATE = 0,
- D3D11_DEVICE_CONTEXT_DEFERRED = ( D3D11_DEVICE_CONTEXT_IMMEDIATE + 1 )
+ {
+ D3D11_DEVICE_CONTEXT_IMMEDIATE = 0,
+ D3D11_DEVICE_CONTEXT_DEFERRED = ( D3D11_DEVICE_CONTEXT_IMMEDIATE + 1 )
} D3D11_DEVICE_CONTEXT_TYPE;
typedef struct D3D11_CLASS_INSTANCE_DESC
@@ -6577,26 +6846,27 @@ EXTERN_C const IID IID_ID3D11ClassInstance;
public:
virtual void STDMETHODCALLTYPE GetClassLinkage(
/* [annotation] */
- __out ID3D11ClassLinkage **ppLinkage) = 0;
+ _Outptr_ ID3D11ClassLinkage **ppLinkage) = 0;
virtual void STDMETHODCALLTYPE GetDesc(
/* [annotation] */
- __out D3D11_CLASS_INSTANCE_DESC *pDesc) = 0;
+ _Out_ D3D11_CLASS_INSTANCE_DESC *pDesc) = 0;
virtual void STDMETHODCALLTYPE GetInstanceName(
/* [annotation] */
- __out_ecount_opt(*pBufferLength) LPSTR pInstanceName,
+ _Out_writes_opt_(*pBufferLength) LPSTR pInstanceName,
/* [annotation] */
- __inout SIZE_T *pBufferLength) = 0;
+ _Inout_ SIZE_T *pBufferLength) = 0;
virtual void STDMETHODCALLTYPE GetTypeName(
/* [annotation] */
- __out_ecount_opt(*pBufferLength) LPSTR pTypeName,
+ _Out_writes_opt_(*pBufferLength) LPSTR pTypeName,
/* [annotation] */
- __inout SIZE_T *pBufferLength) = 0;
+ _Inout_ SIZE_T *pBufferLength) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11ClassInstanceVtbl
@@ -6607,7 +6877,7 @@ EXTERN_C const IID IID_ID3D11ClassInstance;
ID3D11ClassInstance * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ClassInstance * This);
@@ -6618,56 +6888,56 @@ EXTERN_C const IID IID_ID3D11ClassInstance;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11ClassInstance * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11ClassInstance * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11ClassInstance * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11ClassInstance * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *GetClassLinkage )(
ID3D11ClassInstance * This,
/* [annotation] */
- __out ID3D11ClassLinkage **ppLinkage);
+ _Outptr_ ID3D11ClassLinkage **ppLinkage);
void ( STDMETHODCALLTYPE *GetDesc )(
ID3D11ClassInstance * This,
/* [annotation] */
- __out D3D11_CLASS_INSTANCE_DESC *pDesc);
+ _Out_ D3D11_CLASS_INSTANCE_DESC *pDesc);
void ( STDMETHODCALLTYPE *GetInstanceName )(
ID3D11ClassInstance * This,
/* [annotation] */
- __out_ecount_opt(*pBufferLength) LPSTR pInstanceName,
+ _Out_writes_opt_(*pBufferLength) LPSTR pInstanceName,
/* [annotation] */
- __inout SIZE_T *pBufferLength);
+ _Inout_ SIZE_T *pBufferLength);
void ( STDMETHODCALLTYPE *GetTypeName )(
ID3D11ClassInstance * This,
/* [annotation] */
- __out_ecount_opt(*pBufferLength) LPSTR pTypeName,
+ _Out_writes_opt_(*pBufferLength) LPSTR pTypeName,
/* [annotation] */
- __inout SIZE_T *pBufferLength);
+ _Inout_ SIZE_T *pBufferLength);
END_INTERFACE
} ID3D11ClassInstanceVtbl;
@@ -6745,28 +7015,29 @@ EXTERN_C const IID IID_ID3D11ClassLinkage;
public:
virtual HRESULT STDMETHODCALLTYPE GetClassInstance(
/* [annotation] */
- __in LPCSTR pClassInstanceName,
+ _In_ LPCSTR pClassInstanceName,
/* [annotation] */
- __in UINT InstanceIndex,
+ _In_ UINT InstanceIndex,
/* [annotation] */
- __out ID3D11ClassInstance **ppInstance) = 0;
+ _COM_Outptr_ ID3D11ClassInstance **ppInstance) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateClassInstance(
/* [annotation] */
- __in LPCSTR pClassTypeName,
+ _In_ LPCSTR pClassTypeName,
/* [annotation] */
- __in UINT ConstantBufferOffset,
+ _In_ UINT ConstantBufferOffset,
/* [annotation] */
- __in UINT ConstantVectorOffset,
+ _In_ UINT ConstantVectorOffset,
/* [annotation] */
- __in UINT TextureOffset,
+ _In_ UINT TextureOffset,
/* [annotation] */
- __in UINT SamplerOffset,
+ _In_ UINT SamplerOffset,
/* [annotation] */
- __out ID3D11ClassInstance **ppInstance) = 0;
+ _COM_Outptr_ ID3D11ClassInstance **ppInstance) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11ClassLinkageVtbl
@@ -6777,7 +7048,7 @@ EXTERN_C const IID IID_ID3D11ClassLinkage;
ID3D11ClassLinkage * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11ClassLinkage * This);
@@ -6788,56 +7059,56 @@ EXTERN_C const IID IID_ID3D11ClassLinkage;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
HRESULT ( STDMETHODCALLTYPE *GetClassInstance )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __in LPCSTR pClassInstanceName,
+ _In_ LPCSTR pClassInstanceName,
/* [annotation] */
- __in UINT InstanceIndex,
+ _In_ UINT InstanceIndex,
/* [annotation] */
- __out ID3D11ClassInstance **ppInstance);
+ _COM_Outptr_ ID3D11ClassInstance **ppInstance);
HRESULT ( STDMETHODCALLTYPE *CreateClassInstance )(
ID3D11ClassLinkage * This,
/* [annotation] */
- __in LPCSTR pClassTypeName,
+ _In_ LPCSTR pClassTypeName,
/* [annotation] */
- __in UINT ConstantBufferOffset,
+ _In_ UINT ConstantBufferOffset,
/* [annotation] */
- __in UINT ConstantVectorOffset,
+ _In_ UINT ConstantVectorOffset,
/* [annotation] */
- __in UINT TextureOffset,
+ _In_ UINT TextureOffset,
/* [annotation] */
- __in UINT SamplerOffset,
+ _In_ UINT SamplerOffset,
/* [annotation] */
- __out ID3D11ClassInstance **ppInstance);
+ _COM_Outptr_ ID3D11ClassInstance **ppInstance);
END_INTERFACE
} ID3D11ClassLinkageVtbl;
@@ -6911,6 +7182,7 @@ EXTERN_C const IID IID_ID3D11CommandList;
};
+
#else /* C style interface */
typedef struct ID3D11CommandListVtbl
@@ -6921,7 +7193,7 @@ EXTERN_C const IID IID_ID3D11CommandList;
ID3D11CommandList * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11CommandList * This);
@@ -6932,32 +7204,32 @@ EXTERN_C const IID IID_ID3D11CommandList;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11CommandList * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11CommandList * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11CommandList * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11CommandList * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
UINT ( STDMETHODCALLTYPE *GetContextFlags )(
ID3D11CommandList * This);
@@ -7017,11 +7289,24 @@ EXTERN_C const IID IID_ID3D11CommandList;
typedef
enum D3D11_FEATURE
- { D3D11_FEATURE_THREADING = 0,
- D3D11_FEATURE_DOUBLES = ( D3D11_FEATURE_THREADING + 1 ) ,
- D3D11_FEATURE_FORMAT_SUPPORT = ( D3D11_FEATURE_DOUBLES + 1 ) ,
- D3D11_FEATURE_FORMAT_SUPPORT2 = ( D3D11_FEATURE_FORMAT_SUPPORT + 1 ) ,
- D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = ( D3D11_FEATURE_FORMAT_SUPPORT2 + 1 )
+ {
+ D3D11_FEATURE_THREADING = 0,
+ D3D11_FEATURE_DOUBLES = ( D3D11_FEATURE_THREADING + 1 ) ,
+ D3D11_FEATURE_FORMAT_SUPPORT = ( D3D11_FEATURE_DOUBLES + 1 ) ,
+ D3D11_FEATURE_FORMAT_SUPPORT2 = ( D3D11_FEATURE_FORMAT_SUPPORT + 1 ) ,
+ D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = ( D3D11_FEATURE_FORMAT_SUPPORT2 + 1 ) ,
+ D3D11_FEATURE_D3D11_OPTIONS = ( D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS + 1 ) ,
+ D3D11_FEATURE_ARCHITECTURE_INFO = ( D3D11_FEATURE_D3D11_OPTIONS + 1 ) ,
+ D3D11_FEATURE_D3D9_OPTIONS = ( D3D11_FEATURE_ARCHITECTURE_INFO + 1 ) ,
+ D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT = ( D3D11_FEATURE_D3D9_OPTIONS + 1 ) ,
+ D3D11_FEATURE_D3D9_SHADOW_SUPPORT = ( D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT + 1 ) ,
+ D3D11_FEATURE_D3D11_OPTIONS1 = ( D3D11_FEATURE_D3D9_SHADOW_SUPPORT + 1 ) ,
+ D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT = ( D3D11_FEATURE_D3D11_OPTIONS1 + 1 ) ,
+ D3D11_FEATURE_MARKER_SUPPORT = ( D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT + 1 ) ,
+ D3D11_FEATURE_D3D9_OPTIONS1 = ( D3D11_FEATURE_MARKER_SUPPORT + 1 ) ,
+ D3D11_FEATURE_D3D11_OPTIONS2 = ( D3D11_FEATURE_D3D9_OPTIONS1 + 1 ) ,
+ D3D11_FEATURE_D3D11_OPTIONS3 = ( D3D11_FEATURE_D3D11_OPTIONS2 + 1 ) ,
+ D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = ( D3D11_FEATURE_D3D11_OPTIONS3 + 1 )
} D3D11_FEATURE;
typedef struct D3D11_FEATURE_DATA_THREADING
@@ -7052,6 +7337,132 @@ typedef struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
} D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS;
+// =============================================================================
+// In the D3D11_FEATURE_DATA_D3D11_OPTIONS struct below,
+// the following groupings of capabilities will always be set identically.
+// That is, all the BOOLs in a grouping will be TRUE or FALSE together.
+//
+// Group: DiscardAPIsSeenByDriver, FlagsForUpdateAndCopySeenByDriver
+//
+// Group: ClearView, CopyWithOverlap, ConstantBufferPartialUpdate
+// ConstantBufferOffsetting, MapNoOverwriteOnDynamicConstantBuffer
+//
+// Group: MapNoOverwriteOnDynamicBufferSRV,
+// MultisampleRTVWithForcedSampleCountOne
+//
+typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS
+ {
+ BOOL OutputMergerLogicOp;
+ BOOL UAVOnlyRenderingForcedSampleCount;
+ BOOL DiscardAPIsSeenByDriver;
+ BOOL FlagsForUpdateAndCopySeenByDriver;
+ BOOL ClearView;
+ BOOL CopyWithOverlap;
+ BOOL ConstantBufferPartialUpdate;
+ BOOL ConstantBufferOffsetting;
+ BOOL MapNoOverwriteOnDynamicConstantBuffer;
+ BOOL MapNoOverwriteOnDynamicBufferSRV;
+ BOOL MultisampleRTVWithForcedSampleCountOne;
+ BOOL SAD4ShaderInstructions;
+ BOOL ExtendedDoublesShaderInstructions;
+ BOOL ExtendedResourceSharing;
+ } D3D11_FEATURE_DATA_D3D11_OPTIONS;
+
+typedef struct D3D11_FEATURE_DATA_ARCHITECTURE_INFO
+ {
+ BOOL TileBasedDeferredRenderer;
+ } D3D11_FEATURE_DATA_ARCHITECTURE_INFO;
+
+typedef struct D3D11_FEATURE_DATA_D3D9_OPTIONS
+ {
+ BOOL FullNonPow2TextureSupport;
+ } D3D11_FEATURE_DATA_D3D9_OPTIONS;
+
+typedef struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT
+ {
+ BOOL SupportsDepthAsTextureWithLessEqualComparisonFilter;
+ } D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT;
+
+typedef
+enum D3D11_SHADER_MIN_PRECISION_SUPPORT
+ {
+ D3D11_SHADER_MIN_PRECISION_10_BIT = 0x1,
+ D3D11_SHADER_MIN_PRECISION_16_BIT = 0x2
+ } D3D11_SHADER_MIN_PRECISION_SUPPORT;
+
+typedef struct D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT
+ {
+ UINT PixelShaderMinPrecision;
+ UINT AllOtherShaderStagesMinPrecision;
+ } D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT;
+
+typedef
+enum D3D11_TILED_RESOURCES_TIER
+ {
+ D3D11_TILED_RESOURCES_NOT_SUPPORTED = 0,
+ D3D11_TILED_RESOURCES_TIER_1 = 1,
+ D3D11_TILED_RESOURCES_TIER_2 = 2,
+ D3D11_TILED_RESOURCES_TIER_3 = 3
+ } D3D11_TILED_RESOURCES_TIER;
+
+typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS1
+ {
+ D3D11_TILED_RESOURCES_TIER TiledResourcesTier;
+ BOOL MinMaxFiltering;
+ BOOL ClearViewAlsoSupportsDepthOnlyFormats;
+ BOOL MapOnDefaultBuffers;
+ } D3D11_FEATURE_DATA_D3D11_OPTIONS1;
+
+typedef struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT
+ {
+ BOOL SimpleInstancingSupported;
+ } D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT;
+
+typedef struct D3D11_FEATURE_DATA_MARKER_SUPPORT
+ {
+ BOOL Profile;
+ } D3D11_FEATURE_DATA_MARKER_SUPPORT;
+
+typedef struct D3D11_FEATURE_DATA_D3D9_OPTIONS1
+ {
+ BOOL FullNonPow2TextureSupported;
+ BOOL DepthAsTextureWithLessEqualComparisonFilterSupported;
+ BOOL SimpleInstancingSupported;
+ BOOL TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported;
+ } D3D11_FEATURE_DATA_D3D9_OPTIONS1;
+
+typedef
+enum D3D11_CONSERVATIVE_RASTERIZATION_TIER
+ {
+ D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED = 0,
+ D3D11_CONSERVATIVE_RASTERIZATION_TIER_1 = 1,
+ D3D11_CONSERVATIVE_RASTERIZATION_TIER_2 = 2,
+ D3D11_CONSERVATIVE_RASTERIZATION_TIER_3 = 3
+ } D3D11_CONSERVATIVE_RASTERIZATION_TIER;
+
+typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS2
+ {
+ BOOL PSSpecifiedStencilRefSupported;
+ BOOL TypedUAVLoadAdditionalFormats;
+ BOOL ROVsSupported;
+ D3D11_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier;
+ D3D11_TILED_RESOURCES_TIER TiledResourcesTier;
+ BOOL MapOnDefaultTextures;
+ BOOL StandardSwizzle;
+ BOOL UnifiedMemoryArchitecture;
+ } D3D11_FEATURE_DATA_D3D11_OPTIONS2;
+
+typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS3
+ {
+ BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizer;
+ } D3D11_FEATURE_DATA_D3D11_OPTIONS3;
+
+typedef struct D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT
+ {
+ UINT MaxGPUVirtualAddressBitsPerResource;
+ UINT MaxGPUVirtualAddressBitsPerProcess;
+ } D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT;
+
extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_c_ifspec;
@@ -7074,791 +7485,791 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
public:
virtual void STDMETHODCALLTYPE VSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE PSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE PSSetShader(
/* [annotation] */
- __in_opt ID3D11PixelShader *pPixelShader,
+ _In_opt_ ID3D11PixelShader *pPixelShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE PSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE VSSetShader(
/* [annotation] */
- __in_opt ID3D11VertexShader *pVertexShader,
+ _In_opt_ ID3D11VertexShader *pVertexShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE DrawIndexed(
/* [annotation] */
- __in UINT IndexCount,
+ _In_ UINT IndexCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation) = 0;
+ _In_ INT BaseVertexLocation) = 0;
virtual void STDMETHODCALLTYPE Draw(
/* [annotation] */
- __in UINT VertexCount,
+ _In_ UINT VertexCount,
/* [annotation] */
- __in UINT StartVertexLocation) = 0;
+ _In_ UINT StartVertexLocation) = 0;
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D11_MAP MapType,
+ _In_ D3D11_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0;
+ _Out_opt_ D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0;
virtual void STDMETHODCALLTYPE Unmap(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in UINT Subresource) = 0;
+ _In_ UINT Subresource) = 0;
virtual void STDMETHODCALLTYPE PSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE IASetInputLayout(
/* [annotation] */
- __in_opt ID3D11InputLayout *pInputLayout) = 0;
+ _In_opt_ ID3D11InputLayout *pInputLayout) = 0;
virtual void STDMETHODCALLTYPE IASetVertexBuffers(
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pStrides,
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pOffsets) = 0;
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE IASetIndexBuffer(
/* [annotation] */
- __in_opt ID3D11Buffer *pIndexBuffer,
+ _In_opt_ ID3D11Buffer *pIndexBuffer,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT Offset) = 0;
+ _In_ UINT Offset) = 0;
virtual void STDMETHODCALLTYPE DrawIndexedInstanced(
/* [annotation] */
- __in UINT IndexCountPerInstance,
+ _In_ UINT IndexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation,
+ _In_ INT BaseVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation) = 0;
+ _In_ UINT StartInstanceLocation) = 0;
virtual void STDMETHODCALLTYPE DrawInstanced(
/* [annotation] */
- __in UINT VertexCountPerInstance,
+ _In_ UINT VertexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartVertexLocation,
+ _In_ UINT StartVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation) = 0;
+ _In_ UINT StartInstanceLocation) = 0;
virtual void STDMETHODCALLTYPE GSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE GSSetShader(
/* [annotation] */
- __in_opt ID3D11GeometryShader *pShader,
+ _In_opt_ ID3D11GeometryShader *pShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE IASetPrimitiveTopology(
/* [annotation] */
- __in D3D11_PRIMITIVE_TOPOLOGY Topology) = 0;
+ _In_ D3D11_PRIMITIVE_TOPOLOGY Topology) = 0;
virtual void STDMETHODCALLTYPE VSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE VSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE Begin(
/* [annotation] */
- __in ID3D11Asynchronous *pAsync) = 0;
+ _In_ ID3D11Asynchronous *pAsync) = 0;
virtual void STDMETHODCALLTYPE End(
/* [annotation] */
- __in ID3D11Asynchronous *pAsync) = 0;
+ _In_ ID3D11Asynchronous *pAsync) = 0;
virtual HRESULT STDMETHODCALLTYPE GetData(
/* [annotation] */
- __in ID3D11Asynchronous *pAsync,
+ _In_ ID3D11Asynchronous *pAsync,
/* [annotation] */
- __out_bcount_opt( DataSize ) void *pData,
+ _Out_writes_bytes_opt_( DataSize ) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags) = 0;
+ _In_ UINT GetDataFlags) = 0;
virtual void STDMETHODCALLTYPE SetPredication(
/* [annotation] */
- __in_opt ID3D11Predicate *pPredicate,
+ _In_opt_ ID3D11Predicate *pPredicate,
/* [annotation] */
- __in BOOL PredicateValue) = 0;
+ _In_ BOOL PredicateValue) = 0;
virtual void STDMETHODCALLTYPE GSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE GSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE OMSetRenderTargets(
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D11DepthStencilView *pDepthStencilView) = 0;
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView) = 0;
virtual void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews(
/* [annotation] */
- __in UINT NumRTVs,
+ _In_ UINT NumRTVs,
/* [annotation] */
- __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D11DepthStencilView *pDepthStencilView,
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT UAVStartSlot,
/* [annotation] */
- __in UINT NumUAVs,
+ _In_ UINT NumUAVs,
/* [annotation] */
- __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
/* [annotation] */
- __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts) = 0;
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts) = 0;
virtual void STDMETHODCALLTYPE OMSetBlendState(
/* [annotation] */
- __in_opt ID3D11BlendState *pBlendState,
+ _In_opt_ ID3D11BlendState *pBlendState,
/* [annotation] */
- __in_opt const FLOAT BlendFactor[ 4 ],
+ _In_opt_ const FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __in UINT SampleMask) = 0;
+ _In_ UINT SampleMask) = 0;
virtual void STDMETHODCALLTYPE OMSetDepthStencilState(
/* [annotation] */
- __in_opt ID3D11DepthStencilState *pDepthStencilState,
+ _In_opt_ ID3D11DepthStencilState *pDepthStencilState,
/* [annotation] */
- __in UINT StencilRef) = 0;
+ _In_ UINT StencilRef) = 0;
virtual void STDMETHODCALLTYPE SOSetTargets(
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
/* [annotation] */
- __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets,
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppSOTargets,
/* [annotation] */
- __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0;
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE DrawAuto( void) = 0;
virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect(
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs) = 0;
+ _In_ UINT AlignedByteOffsetForArgs) = 0;
virtual void STDMETHODCALLTYPE DrawInstancedIndirect(
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs) = 0;
+ _In_ UINT AlignedByteOffsetForArgs) = 0;
virtual void STDMETHODCALLTYPE Dispatch(
/* [annotation] */
- __in UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountX,
/* [annotation] */
- __in UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountY,
/* [annotation] */
- __in UINT ThreadGroupCountZ) = 0;
+ _In_ UINT ThreadGroupCountZ) = 0;
virtual void STDMETHODCALLTYPE DispatchIndirect(
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs) = 0;
+ _In_ UINT AlignedByteOffsetForArgs) = 0;
virtual void STDMETHODCALLTYPE RSSetState(
/* [annotation] */
- __in_opt ID3D11RasterizerState *pRasterizerState) = 0;
+ _In_opt_ ID3D11RasterizerState *pRasterizerState) = 0;
virtual void STDMETHODCALLTYPE RSSetViewports(
/* [annotation] */
- __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
/* [annotation] */
- __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports) = 0;
+ _In_reads_opt_(NumViewports) const D3D11_VIEWPORT *pViewports) = 0;
virtual void STDMETHODCALLTYPE RSSetScissorRects(
/* [annotation] */
- __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
/* [annotation] */
- __in_ecount_opt(NumRects) const D3D11_RECT *pRects) = 0;
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects) = 0;
virtual void STDMETHODCALLTYPE CopySubresourceRegion(
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in UINT DstX,
+ _In_ UINT DstX,
/* [annotation] */
- __in UINT DstY,
+ _In_ UINT DstY,
/* [annotation] */
- __in UINT DstZ,
+ _In_ UINT DstZ,
/* [annotation] */
- __in ID3D11Resource *pSrcResource,
+ _In_ ID3D11Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in_opt const D3D11_BOX *pSrcBox) = 0;
+ _In_opt_ const D3D11_BOX *pSrcBox) = 0;
virtual void STDMETHODCALLTYPE CopyResource(
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in ID3D11Resource *pSrcResource) = 0;
+ _In_ ID3D11Resource *pSrcResource) = 0;
virtual void STDMETHODCALLTYPE UpdateSubresource(
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in_opt const D3D11_BOX *pDstBox,
+ _In_opt_ const D3D11_BOX *pDstBox,
/* [annotation] */
- __in const void *pSrcData,
+ _In_ const void *pSrcData,
/* [annotation] */
- __in UINT SrcRowPitch,
+ _In_ UINT SrcRowPitch,
/* [annotation] */
- __in UINT SrcDepthPitch) = 0;
+ _In_ UINT SrcDepthPitch) = 0;
virtual void STDMETHODCALLTYPE CopyStructureCount(
/* [annotation] */
- __in ID3D11Buffer *pDstBuffer,
+ _In_ ID3D11Buffer *pDstBuffer,
/* [annotation] */
- __in UINT DstAlignedByteOffset,
+ _In_ UINT DstAlignedByteOffset,
/* [annotation] */
- __in ID3D11UnorderedAccessView *pSrcView) = 0;
+ _In_ ID3D11UnorderedAccessView *pSrcView) = 0;
virtual void STDMETHODCALLTYPE ClearRenderTargetView(
/* [annotation] */
- __in ID3D11RenderTargetView *pRenderTargetView,
+ _In_ ID3D11RenderTargetView *pRenderTargetView,
/* [annotation] */
- __in const FLOAT ColorRGBA[ 4 ]) = 0;
+ _In_ const FLOAT ColorRGBA[ 4 ]) = 0;
virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint(
/* [annotation] */
- __in ID3D11UnorderedAccessView *pUnorderedAccessView,
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
/* [annotation] */
- __in const UINT Values[ 4 ]) = 0;
+ _In_ const UINT Values[ 4 ]) = 0;
virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat(
/* [annotation] */
- __in ID3D11UnorderedAccessView *pUnorderedAccessView,
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
/* [annotation] */
- __in const FLOAT Values[ 4 ]) = 0;
+ _In_ const FLOAT Values[ 4 ]) = 0;
virtual void STDMETHODCALLTYPE ClearDepthStencilView(
/* [annotation] */
- __in ID3D11DepthStencilView *pDepthStencilView,
+ _In_ ID3D11DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in UINT ClearFlags,
+ _In_ UINT ClearFlags,
/* [annotation] */
- __in FLOAT Depth,
+ _In_ FLOAT Depth,
/* [annotation] */
- __in UINT8 Stencil) = 0;
+ _In_ UINT8 Stencil) = 0;
virtual void STDMETHODCALLTYPE GenerateMips(
/* [annotation] */
- __in ID3D11ShaderResourceView *pShaderResourceView) = 0;
+ _In_ ID3D11ShaderResourceView *pShaderResourceView) = 0;
virtual void STDMETHODCALLTYPE SetResourceMinLOD(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
FLOAT MinLOD) = 0;
virtual FLOAT STDMETHODCALLTYPE GetResourceMinLOD(
/* [annotation] */
- __in ID3D11Resource *pResource) = 0;
+ _In_ ID3D11Resource *pResource) = 0;
virtual void STDMETHODCALLTYPE ResolveSubresource(
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in ID3D11Resource *pSrcResource,
+ _In_ ID3D11Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in DXGI_FORMAT Format) = 0;
+ _In_ DXGI_FORMAT Format) = 0;
virtual void STDMETHODCALLTYPE ExecuteCommandList(
/* [annotation] */
- __in ID3D11CommandList *pCommandList,
+ _In_ ID3D11CommandList *pCommandList,
BOOL RestoreContextState) = 0;
virtual void STDMETHODCALLTYPE HSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE HSSetShader(
/* [annotation] */
- __in_opt ID3D11HullShader *pHullShader,
+ _In_opt_ ID3D11HullShader *pHullShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE HSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE HSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE DSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE DSSetShader(
/* [annotation] */
- __in_opt ID3D11DomainShader *pDomainShader,
+ _In_opt_ ID3D11DomainShader *pDomainShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE DSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE DSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE CSSetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE CSSetUnorderedAccessViews(
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
/* [annotation] */
- __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
/* [annotation] */
- __in_ecount(NumUAVs) const UINT *pUAVInitialCounts) = 0;
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts) = 0;
virtual void STDMETHODCALLTYPE CSSetShader(
/* [annotation] */
- __in_opt ID3D11ComputeShader *pComputeShader,
+ _In_opt_ ID3D11ComputeShader *pComputeShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances) = 0;
virtual void STDMETHODCALLTYPE CSSetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0;
virtual void STDMETHODCALLTYPE CSSetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE VSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE PSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE PSGetShader(
/* [annotation] */
- __out ID3D11PixelShader **ppPixelShader,
+ _Outptr_result_maybenull_ ID3D11PixelShader **ppPixelShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE PSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE VSGetShader(
/* [annotation] */
- __out ID3D11VertexShader **ppVertexShader,
+ _Outptr_result_maybenull_ ID3D11VertexShader **ppVertexShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE PSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE IAGetInputLayout(
/* [annotation] */
- __out ID3D11InputLayout **ppInputLayout) = 0;
+ _Outptr_result_maybenull_ ID3D11InputLayout **ppInputLayout) = 0;
virtual void STDMETHODCALLTYPE IAGetVertexBuffers(
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers,
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppVertexBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pStrides,
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0;
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets) = 0;
virtual void STDMETHODCALLTYPE IAGetIndexBuffer(
/* [annotation] */
- __out_opt ID3D11Buffer **pIndexBuffer,
+ _Outptr_opt_result_maybenull_ ID3D11Buffer **pIndexBuffer,
/* [annotation] */
- __out_opt DXGI_FORMAT *Format,
+ _Out_opt_ DXGI_FORMAT *Format,
/* [annotation] */
- __out_opt UINT *Offset) = 0;
+ _Out_opt_ UINT *Offset) = 0;
virtual void STDMETHODCALLTYPE GSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE GSGetShader(
/* [annotation] */
- __out ID3D11GeometryShader **ppGeometryShader,
+ _Outptr_result_maybenull_ ID3D11GeometryShader **ppGeometryShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology(
/* [annotation] */
- __out D3D11_PRIMITIVE_TOPOLOGY *pTopology) = 0;
+ _Out_ D3D11_PRIMITIVE_TOPOLOGY *pTopology) = 0;
virtual void STDMETHODCALLTYPE VSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE VSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE GetPredication(
/* [annotation] */
- __out_opt ID3D11Predicate **ppPredicate,
+ _Outptr_opt_result_maybenull_ ID3D11Predicate **ppPredicate,
/* [annotation] */
- __out_opt BOOL *pPredicateValue) = 0;
+ _Out_opt_ BOOL *pPredicateValue) = 0;
virtual void STDMETHODCALLTYPE GSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE GSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE OMGetRenderTargets(
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0;
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView) = 0;
virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews(
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
/* [annotation] */
- __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView,
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
/* [annotation] */
- __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
virtual void STDMETHODCALLTYPE OMGetBlendState(
/* [annotation] */
- __out_opt ID3D11BlendState **ppBlendState,
+ _Outptr_opt_result_maybenull_ ID3D11BlendState **ppBlendState,
/* [annotation] */
- __out_opt FLOAT BlendFactor[ 4 ],
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __out_opt UINT *pSampleMask) = 0;
+ _Out_opt_ UINT *pSampleMask) = 0;
virtual void STDMETHODCALLTYPE OMGetDepthStencilState(
/* [annotation] */
- __out_opt ID3D11DepthStencilState **ppDepthStencilState,
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilState **ppDepthStencilState,
/* [annotation] */
- __out_opt UINT *pStencilRef) = 0;
+ _Out_opt_ UINT *pStencilRef) = 0;
virtual void STDMETHODCALLTYPE SOGetTargets(
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppSOTargets) = 0;
virtual void STDMETHODCALLTYPE RSGetState(
/* [annotation] */
- __out ID3D11RasterizerState **ppRasterizerState) = 0;
+ _Outptr_result_maybenull_ ID3D11RasterizerState **ppRasterizerState) = 0;
virtual void STDMETHODCALLTYPE RSGetViewports(
/* [annotation] */
- __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
/* [annotation] */
- __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports) = 0;
+ _Out_writes_opt_(*pNumViewports) D3D11_VIEWPORT *pViewports) = 0;
virtual void STDMETHODCALLTYPE RSGetScissorRects(
/* [annotation] */
- __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
/* [annotation] */
- __out_ecount_opt(*pNumRects) D3D11_RECT *pRects) = 0;
+ _Out_writes_opt_(*pNumRects) D3D11_RECT *pRects) = 0;
virtual void STDMETHODCALLTYPE HSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE HSGetShader(
/* [annotation] */
- __out ID3D11HullShader **ppHullShader,
+ _Outptr_result_maybenull_ ID3D11HullShader **ppHullShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE HSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE HSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE DSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE DSGetShader(
/* [annotation] */
- __out ID3D11DomainShader **ppDomainShader,
+ _Outptr_result_maybenull_ ID3D11DomainShader **ppDomainShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE DSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE DSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE CSGetShaderResources(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0;
virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews(
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
/* [annotation] */
- __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0;
virtual void STDMETHODCALLTYPE CSGetShader(
/* [annotation] */
- __out ID3D11ComputeShader **ppComputeShader,
+ _Outptr_result_maybenull_ ID3D11ComputeShader **ppComputeShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances) = 0;
+ _Inout_opt_ UINT *pNumClassInstances) = 0;
virtual void STDMETHODCALLTYPE CSGetSamplers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers) = 0;
virtual void STDMETHODCALLTYPE CSGetConstantBuffers(
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0;
virtual void STDMETHODCALLTYPE ClearState( void) = 0;
@@ -7871,10 +8282,11 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
virtual HRESULT STDMETHODCALLTYPE FinishCommandList(
BOOL RestoreDeferredContextState,
/* [annotation] */
- __out_opt ID3D11CommandList **ppCommandList) = 0;
+ _COM_Outptr_opt_ ID3D11CommandList **ppCommandList) = 0;
};
+
#else /* C style interface */
typedef struct ID3D11DeviceContextVtbl
@@ -7885,7 +8297,7 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
ID3D11DeviceContext * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11DeviceContext * This);
@@ -7896,308 +8308,308 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
void ( STDMETHODCALLTYPE *GetDevice )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11Device **ppDevice);
+ _Outptr_ ID3D11Device **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt( *pDataSize ) void *pData);
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt( DataSize ) const void *pData);
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11PixelShader *pPixelShader,
+ _In_opt_ ID3D11PixelShader *pPixelShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *PSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *VSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11VertexShader *pVertexShader,
+ _In_opt_ ID3D11VertexShader *pVertexShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *DrawIndexed )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT IndexCount,
+ _In_ UINT IndexCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation);
+ _In_ INT BaseVertexLocation);
void ( STDMETHODCALLTYPE *Draw )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT VertexCount,
+ _In_ UINT VertexCount,
/* [annotation] */
- __in UINT StartVertexLocation);
+ _In_ UINT StartVertexLocation);
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in UINT Subresource,
+ _In_ UINT Subresource,
/* [annotation] */
- __in D3D11_MAP MapType,
+ _In_ D3D11_MAP MapType,
/* [annotation] */
- __in UINT MapFlags,
+ _In_ UINT MapFlags,
/* [annotation] */
- __out D3D11_MAPPED_SUBRESOURCE *pMappedResource);
+ _Out_opt_ D3D11_MAPPED_SUBRESOURCE *pMappedResource);
void ( STDMETHODCALLTYPE *Unmap )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in UINT Subresource);
+ _In_ UINT Subresource);
void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *IASetInputLayout )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11InputLayout *pInputLayout);
+ _In_opt_ ID3D11InputLayout *pInputLayout);
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pStrides,
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
/* [annotation] */
- __in_ecount(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11Buffer *pIndexBuffer,
+ _In_opt_ ID3D11Buffer *pIndexBuffer,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT Offset);
+ _In_ UINT Offset);
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT IndexCountPerInstance,
+ _In_ UINT IndexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartIndexLocation,
+ _In_ UINT StartIndexLocation,
/* [annotation] */
- __in INT BaseVertexLocation,
+ _In_ INT BaseVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT VertexCountPerInstance,
+ _In_ UINT VertexCountPerInstance,
/* [annotation] */
- __in UINT InstanceCount,
+ _In_ UINT InstanceCount,
/* [annotation] */
- __in UINT StartVertexLocation,
+ _In_ UINT StartVertexLocation,
/* [annotation] */
- __in UINT StartInstanceLocation);
+ _In_ UINT StartInstanceLocation);
void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11GeometryShader *pShader,
+ _In_opt_ ID3D11GeometryShader *pShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in D3D11_PRIMITIVE_TOPOLOGY Topology);
+ _In_ D3D11_PRIMITIVE_TOPOLOGY Topology);
void ( STDMETHODCALLTYPE *VSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *Begin )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Asynchronous *pAsync);
+ _In_ ID3D11Asynchronous *pAsync);
void ( STDMETHODCALLTYPE *End )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Asynchronous *pAsync);
+ _In_ ID3D11Asynchronous *pAsync);
HRESULT ( STDMETHODCALLTYPE *GetData )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Asynchronous *pAsync,
+ _In_ ID3D11Asynchronous *pAsync,
/* [annotation] */
- __out_bcount_opt( DataSize ) void *pData,
+ _Out_writes_bytes_opt_( DataSize ) void *pData,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in UINT GetDataFlags);
+ _In_ UINT GetDataFlags);
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11Predicate *pPredicate,
+ _In_opt_ ID3D11Predicate *pPredicate,
/* [annotation] */
- __in BOOL PredicateValue);
+ _In_ BOOL PredicateValue);
void ( STDMETHODCALLTYPE *GSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D11DepthStencilView *pDepthStencilView);
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView);
void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT NumRTVs,
+ _In_ UINT NumRTVs,
/* [annotation] */
- __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ _In_reads_opt_(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
/* [annotation] */
- __in_opt ID3D11DepthStencilView *pDepthStencilView,
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT UAVStartSlot,
/* [annotation] */
- __in UINT NumUAVs,
+ _In_ UINT NumUAVs,
/* [annotation] */
- __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
/* [annotation] */
- __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts);
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
void ( STDMETHODCALLTYPE *OMSetBlendState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11BlendState *pBlendState,
+ _In_opt_ ID3D11BlendState *pBlendState,
/* [annotation] */
- __in_opt const FLOAT BlendFactor[ 4 ],
+ _In_opt_ const FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __in UINT SampleMask);
+ _In_ UINT SampleMask);
void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11DepthStencilState *pDepthStencilState,
+ _In_opt_ ID3D11DepthStencilState *pDepthStencilState,
/* [annotation] */
- __in UINT StencilRef);
+ _In_ UINT StencilRef);
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
/* [annotation] */
- __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets,
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppSOTargets,
/* [annotation] */
- __in_ecount_opt(NumBuffers) const UINT *pOffsets);
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
void ( STDMETHODCALLTYPE *DrawAuto )(
ID3D11DeviceContext * This);
@@ -8205,614 +8617,614 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs);
+ _In_ UINT AlignedByteOffsetForArgs);
void ( STDMETHODCALLTYPE *DrawInstancedIndirect )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs);
+ _In_ UINT AlignedByteOffsetForArgs);
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountX,
/* [annotation] */
- __in UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountY,
/* [annotation] */
- __in UINT ThreadGroupCountZ);
+ _In_ UINT ThreadGroupCountZ);
void ( STDMETHODCALLTYPE *DispatchIndirect )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Buffer *pBufferForArgs,
+ _In_ ID3D11Buffer *pBufferForArgs,
/* [annotation] */
- __in UINT AlignedByteOffsetForArgs);
+ _In_ UINT AlignedByteOffsetForArgs);
void ( STDMETHODCALLTYPE *RSSetState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11RasterizerState *pRasterizerState);
+ _In_opt_ ID3D11RasterizerState *pRasterizerState);
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
/* [annotation] */
- __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports);
+ _In_reads_opt_(NumViewports) const D3D11_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
/* [annotation] */
- __in_ecount_opt(NumRects) const D3D11_RECT *pRects);
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects);
void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in UINT DstX,
+ _In_ UINT DstX,
/* [annotation] */
- __in UINT DstY,
+ _In_ UINT DstY,
/* [annotation] */
- __in UINT DstZ,
+ _In_ UINT DstZ,
/* [annotation] */
- __in ID3D11Resource *pSrcResource,
+ _In_ ID3D11Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in_opt const D3D11_BOX *pSrcBox);
+ _In_opt_ const D3D11_BOX *pSrcBox);
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in ID3D11Resource *pSrcResource);
+ _In_ ID3D11Resource *pSrcResource);
void ( STDMETHODCALLTYPE *UpdateSubresource )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in_opt const D3D11_BOX *pDstBox,
+ _In_opt_ const D3D11_BOX *pDstBox,
/* [annotation] */
- __in const void *pSrcData,
+ _In_ const void *pSrcData,
/* [annotation] */
- __in UINT SrcRowPitch,
+ _In_ UINT SrcRowPitch,
/* [annotation] */
- __in UINT SrcDepthPitch);
+ _In_ UINT SrcDepthPitch);
void ( STDMETHODCALLTYPE *CopyStructureCount )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Buffer *pDstBuffer,
+ _In_ ID3D11Buffer *pDstBuffer,
/* [annotation] */
- __in UINT DstAlignedByteOffset,
+ _In_ UINT DstAlignedByteOffset,
/* [annotation] */
- __in ID3D11UnorderedAccessView *pSrcView);
+ _In_ ID3D11UnorderedAccessView *pSrcView);
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11RenderTargetView *pRenderTargetView,
+ _In_ ID3D11RenderTargetView *pRenderTargetView,
/* [annotation] */
- __in const FLOAT ColorRGBA[ 4 ]);
+ _In_ const FLOAT ColorRGBA[ 4 ]);
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11UnorderedAccessView *pUnorderedAccessView,
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
/* [annotation] */
- __in const UINT Values[ 4 ]);
+ _In_ const UINT Values[ 4 ]);
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11UnorderedAccessView *pUnorderedAccessView,
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
/* [annotation] */
- __in const FLOAT Values[ 4 ]);
+ _In_ const FLOAT Values[ 4 ]);
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11DepthStencilView *pDepthStencilView,
+ _In_ ID3D11DepthStencilView *pDepthStencilView,
/* [annotation] */
- __in UINT ClearFlags,
+ _In_ UINT ClearFlags,
/* [annotation] */
- __in FLOAT Depth,
+ _In_ FLOAT Depth,
/* [annotation] */
- __in UINT8 Stencil);
+ _In_ UINT8 Stencil);
void ( STDMETHODCALLTYPE *GenerateMips )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11ShaderResourceView *pShaderResourceView);
+ _In_ ID3D11ShaderResourceView *pShaderResourceView);
void ( STDMETHODCALLTYPE *SetResourceMinLOD )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
FLOAT MinLOD);
FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pResource);
+ _In_ ID3D11Resource *pResource);
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11Resource *pDstResource,
+ _In_ ID3D11Resource *pDstResource,
/* [annotation] */
- __in UINT DstSubresource,
+ _In_ UINT DstSubresource,
/* [annotation] */
- __in ID3D11Resource *pSrcResource,
+ _In_ ID3D11Resource *pSrcResource,
/* [annotation] */
- __in UINT SrcSubresource,
+ _In_ UINT SrcSubresource,
/* [annotation] */
- __in DXGI_FORMAT Format);
+ _In_ DXGI_FORMAT Format);
void ( STDMETHODCALLTYPE *ExecuteCommandList )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in ID3D11CommandList *pCommandList,
+ _In_ ID3D11CommandList *pCommandList,
BOOL RestoreContextState);
void ( STDMETHODCALLTYPE *HSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *HSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11HullShader *pHullShader,
+ _In_opt_ ID3D11HullShader *pHullShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *HSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *HSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *DSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *DSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11DomainShader *pDomainShader,
+ _In_opt_ ID3D11DomainShader *pDomainShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *DSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *DSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *CSSetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
/* [annotation] */
- __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
/* [annotation] */
- __in_ecount(NumUAVs) const UINT *pUAVInitialCounts);
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
void ( STDMETHODCALLTYPE *CSSetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_opt ID3D11ComputeShader *pComputeShader,
+ _In_opt_ ID3D11ComputeShader *pComputeShader,
/* [annotation] */
- __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
UINT NumClassInstances);
void ( STDMETHODCALLTYPE *CSSetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
void ( STDMETHODCALLTYPE *CSSetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *PSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *PSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11PixelShader **ppPixelShader,
+ _Outptr_result_maybenull_ ID3D11PixelShader **ppPixelShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *PSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *VSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11VertexShader **ppVertexShader,
+ _Outptr_result_maybenull_ ID3D11VertexShader **ppVertexShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *IAGetInputLayout )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11InputLayout **ppInputLayout);
+ _Outptr_result_maybenull_ ID3D11InputLayout **ppInputLayout);
void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers,
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppVertexBuffers,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pStrides,
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
/* [annotation] */
- __out_ecount_opt(NumBuffers) UINT *pOffsets);
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out_opt ID3D11Buffer **pIndexBuffer,
+ _Outptr_opt_result_maybenull_ ID3D11Buffer **pIndexBuffer,
/* [annotation] */
- __out_opt DXGI_FORMAT *Format,
+ _Out_opt_ DXGI_FORMAT *Format,
/* [annotation] */
- __out_opt UINT *Offset);
+ _Out_opt_ UINT *Offset);
void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *GSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11GeometryShader **ppGeometryShader,
+ _Outptr_result_maybenull_ ID3D11GeometryShader **ppGeometryShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out D3D11_PRIMITIVE_TOPOLOGY *pTopology);
+ _Out_ D3D11_PRIMITIVE_TOPOLOGY *pTopology);
void ( STDMETHODCALLTYPE *VSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *VSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *GetPredication )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out_opt ID3D11Predicate **ppPredicate,
+ _Outptr_opt_result_maybenull_ ID3D11Predicate **ppPredicate,
/* [annotation] */
- __out_opt BOOL *pPredicateValue);
+ _Out_opt_ BOOL *pPredicateValue);
void ( STDMETHODCALLTYPE *GSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *GSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
/* [annotation] */
- __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView);
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView);
void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
/* [annotation] */
- __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
+ _Out_writes_opt_(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView,
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
/* [annotation] */
- __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
void ( STDMETHODCALLTYPE *OMGetBlendState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out_opt ID3D11BlendState **ppBlendState,
+ _Outptr_opt_result_maybenull_ ID3D11BlendState **ppBlendState,
/* [annotation] */
- __out_opt FLOAT BlendFactor[ 4 ],
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
/* [annotation] */
- __out_opt UINT *pSampleMask);
+ _Out_opt_ UINT *pSampleMask);
void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out_opt ID3D11DepthStencilState **ppDepthStencilState,
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilState **ppDepthStencilState,
/* [annotation] */
- __out_opt UINT *pStencilRef);
+ _Out_opt_ UINT *pStencilRef);
void ( STDMETHODCALLTYPE *SOGetTargets )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppSOTargets);
void ( STDMETHODCALLTYPE *RSGetState )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11RasterizerState **ppRasterizerState);
+ _Outptr_result_maybenull_ ID3D11RasterizerState **ppRasterizerState);
void ( STDMETHODCALLTYPE *RSGetViewports )(
ID3D11DeviceContext * This,
/* [annotation] */
- __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
/* [annotation] */
- __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports);
+ _Out_writes_opt_(*pNumViewports) D3D11_VIEWPORT *pViewports);
void ( STDMETHODCALLTYPE *RSGetScissorRects )(
ID3D11DeviceContext * This,
/* [annotation] */
- __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
/* [annotation] */
- __out_ecount_opt(*pNumRects) D3D11_RECT *pRects);
+ _Out_writes_opt_(*pNumRects) D3D11_RECT *pRects);
void ( STDMETHODCALLTYPE *HSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *HSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11HullShader **ppHullShader,
+ _Outptr_result_maybenull_ ID3D11HullShader **ppHullShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *HSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *HSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *DSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *DSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11DomainShader **ppDomainShader,
+ _Outptr_result_maybenull_ ID3D11DomainShader **ppDomainShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *DSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *DSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *CSGetShaderResources )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
/* [annotation] */
- __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs,
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
/* [annotation] */
- __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
void ( STDMETHODCALLTYPE *CSGetShader )(
ID3D11DeviceContext * This,
/* [annotation] */
- __out ID3D11ComputeShader **ppComputeShader,
+ _Outptr_result_maybenull_ ID3D11ComputeShader **ppComputeShader,
/* [annotation] */
- __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
/* [annotation] */
- __inout_opt UINT *pNumClassInstances);
+ _Inout_opt_ UINT *pNumClassInstances);
void ( STDMETHODCALLTYPE *CSGetSamplers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
/* [annotation] */
- __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers);
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
void ( STDMETHODCALLTYPE *CSGetConstantBuffers )(
ID3D11DeviceContext * This,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
/* [annotation] */
- __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
/* [annotation] */
- __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
void ( STDMETHODCALLTYPE *ClearState )(
ID3D11DeviceContext * This);
@@ -8830,7 +9242,7 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
ID3D11DeviceContext * This,
BOOL RestoreDeferredContextState,
/* [annotation] */
- __out_opt ID3D11CommandList **ppCommandList);
+ _COM_Outptr_opt_ ID3D11CommandList **ppCommandList);
END_INTERFACE
} ID3D11DeviceContextVtbl;
@@ -9203,6 +9615,3928 @@ EXTERN_C const IID IID_ID3D11DeviceContext;
#endif /* __ID3D11DeviceContext_INTERFACE_DEFINED__ */
+/* interface __MIDL_itf_d3d11_0000_0030 */
+/* [local] */
+
+#if !defined( D3D11_VIDEO_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_VIDEO_DEFAULT {};
+extern const DECLSPEC_SELECTANY CD3D11_VIDEO_DEFAULT D3D11_VIDEO_DEFAULT;
+extern "C"{
+#endif
+
+
+#if !defined(APP_DEPRECATED_HRESULT) && !defined(APP_DEPRECATED_HRESULT_TYPEDEF)
+#define APP_DEPRECATED_HRESULT_TYPEDEF
+typedef HRESULT APP_DEPRECATED_HRESULT;
+
+#endif
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG2_MOCOMP, 0xe6a9f44b, 0x61b0, 0x4563,0x9e,0xa4,0x63,0xd2,0xa3,0xc6,0xfe,0x66);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG2_IDCT, 0xbf22ad00, 0x03ea, 0x4690,0x80,0x77,0x47,0x33,0x46,0x20,0x9b,0x7e);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG2_VLD, 0xee27417f, 0x5e28, 0x4e65,0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG1_VLD, 0x6f3ec719, 0x3735, 0x42cc,0x80,0x63,0x65,0xcc,0x3c,0xb3,0x66,0x16);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG2and1_VLD, 0x86695f12, 0x340e, 0x4f04,0x9f,0xd3,0x92,0x53,0xdd,0x32,0x74,0x60);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_MOCOMP_NOFGT, 0x1b81be64, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_MOCOMP_FGT, 0x1b81be65, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_IDCT_NOFGT, 0x1b81be66, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_IDCT_FGT, 0x1b81be67, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_NOFGT, 0x1b81be68, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_FGT, 0x1b81be69, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_WITHFMOASO_NOFGT, 0xd5f04ff9, 0x3418,0x45d8,0x95,0x61,0x32,0xa7,0x6a,0xae,0x2d,0xdd);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_STEREO_PROGRESSIVE_NOFGT, 0xd79be8da, 0x0cf1,0x4c81,0xb8,0x2a,0x69,0xa4,0xe2,0x36,0xf4,0x3d);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_STEREO_NOFGT, 0xf9aaccbb, 0xc2b6,0x4cfc,0x87,0x79,0x57,0x07,0xb1,0x76,0x05,0x52);
+DEFINE_GUID(D3D11_DECODER_PROFILE_H264_VLD_MULTIVIEW_NOFGT, 0x705b9d82, 0x76cf,0x49d6,0xb7,0xe6,0xac,0x88,0x72,0xdb,0x01,0x3c);
+DEFINE_GUID(D3D11_DECODER_PROFILE_WMV8_POSTPROC, 0x1b81be80, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_WMV8_MOCOMP, 0x1b81be81, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_WMV9_POSTPROC, 0x1b81be90, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_WMV9_MOCOMP, 0x1b81be91, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_WMV9_IDCT, 0x1b81be94, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_VC1_POSTPROC, 0x1b81beA0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_VC1_MOCOMP, 0x1b81beA1, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_VC1_IDCT, 0x1b81beA2, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_VC1_VLD, 0x1b81beA3, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d,0x4eda,0x9a,0xe3,0x9a,0x65,0x35,0x8d,0x8d,0x2e);
+DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_GMC, 0xab998b5b, 0x4258,0x44a9,0x9f,0xeb,0x94,0xe5,0x97,0xa6,0xba,0xae);
+DEFINE_GUID(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN, 0x5b11d51b, 0x2f4c,0x4452,0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);
+DEFINE_GUID(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN10, 0x107af0e0, 0xef1a,0x4d19,0xab,0xa8,0x67,0xa1,0x63,0x07,0x3d,0x13);
+typedef struct D3D11_VIDEO_DECODER_DESC
+ {
+ GUID Guid;
+ UINT SampleWidth;
+ UINT SampleHeight;
+ DXGI_FORMAT OutputFormat;
+ } D3D11_VIDEO_DECODER_DESC;
+
+typedef struct D3D11_VIDEO_DECODER_CONFIG
+ {
+ GUID guidConfigBitstreamEncryption;
+ GUID guidConfigMBcontrolEncryption;
+ GUID guidConfigResidDiffEncryption;
+ UINT ConfigBitstreamRaw;
+ UINT ConfigMBcontrolRasterOrder;
+ UINT ConfigResidDiffHost;
+ UINT ConfigSpatialResid8;
+ UINT ConfigResid8Subtraction;
+ UINT ConfigSpatialHost8or9Clipping;
+ UINT ConfigSpatialResidInterleaved;
+ UINT ConfigIntraResidUnsigned;
+ UINT ConfigResidDiffAccelerator;
+ UINT ConfigHostInverseScan;
+ UINT ConfigSpecificIDCT;
+ UINT Config4GroupedCoefs;
+ USHORT ConfigMinRenderTargetBuffCount;
+ USHORT ConfigDecoderSpecific;
+ } D3D11_VIDEO_DECODER_CONFIG;
+
+typedef
+enum D3D11_VIDEO_DECODER_BUFFER_TYPE
+ {
+ D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0,
+ D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL = 1,
+ D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE = 2,
+ D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL = 3,
+ D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX = 4,
+ D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL = 5,
+ D3D11_VIDEO_DECODER_BUFFER_BITSTREAM = 6,
+ D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR = 7,
+ D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN = 8
+ } D3D11_VIDEO_DECODER_BUFFER_TYPE;
+
+typedef struct _D3D11_AES_CTR_IV
+ {
+ UINT64 IV;
+ UINT64 Count;
+ } D3D11_AES_CTR_IV;
+
+typedef struct D3D11_ENCRYPTED_BLOCK_INFO
+ {
+ UINT NumEncryptedBytesAtBeginning;
+ UINT NumBytesInSkipPattern;
+ UINT NumBytesInEncryptPattern;
+ } D3D11_ENCRYPTED_BLOCK_INFO;
+
+typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC
+ {
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
+ UINT BufferIndex;
+ UINT DataOffset;
+ UINT DataSize;
+ UINT FirstMBaddress;
+ UINT NumMBsInBuffer;
+ UINT Width;
+ UINT Height;
+ UINT Stride;
+ UINT ReservedBits;
+ /* [annotation] */
+ _Field_size_opt_(IVSize) void *pIV;
+ UINT IVSize;
+ BOOL PartialEncryption;
+ D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
+ } D3D11_VIDEO_DECODER_BUFFER_DESC;
+
+typedef struct D3D11_VIDEO_DECODER_EXTENSION
+ {
+ UINT Function;
+ /* [annotation] */
+ _Field_size_(PrivateInputDataSize) void *pPrivateInputData;
+ UINT PrivateInputDataSize;
+ /* [annotation] */
+ _Field_size_(PrivateOutputDataSize) void *pPrivateOutputData;
+ UINT PrivateOutputDataSize;
+ UINT ResourceCount;
+ /* [annotation] */
+ _Field_size_opt_(ResourceCount) ID3D11Resource **ppResourceList;
+ } D3D11_VIDEO_DECODER_EXTENSION;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0030_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0030_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoDecoder_INTERFACE_DEFINED__
+#define __ID3D11VideoDecoder_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoDecoder */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoDecoder;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3C9C5B51-995D-48d1-9B8D-FA5CAEDED65C")
+ ID3D11VideoDecoder : public ID3D11DeviceChild
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetCreationParameters(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_DESC *pVideoDesc,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_CONFIG *pConfig) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDriverHandle(
+ /* [annotation] */
+ _Out_ HANDLE *pDriverHandle) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoDecoderVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoDecoder * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoDecoder * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoDecoder * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCreationParameters )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_DESC *pVideoDesc,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_CONFIG *pConfig);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDriverHandle )(
+ ID3D11VideoDecoder * This,
+ /* [annotation] */
+ _Out_ HANDLE *pDriverHandle);
+
+ END_INTERFACE
+ } ID3D11VideoDecoderVtbl;
+
+ interface ID3D11VideoDecoder
+ {
+ CONST_VTBL struct ID3D11VideoDecoderVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoDecoder_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoDecoder_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoDecoder_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoDecoder_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoDecoder_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoDecoder_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoDecoder_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoDecoder_GetCreationParameters(This,pVideoDesc,pConfig) \
+ ( (This)->lpVtbl -> GetCreationParameters(This,pVideoDesc,pConfig) )
+
+#define ID3D11VideoDecoder_GetDriverHandle(This,pDriverHandle) \
+ ( (This)->lpVtbl -> GetDriverHandle(This,pDriverHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoDecoder_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0031 */
+/* [local] */
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT
+ {
+ D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT = 0x1,
+ D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT = 0x2
+ } D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_DEVICE_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_LINEAR_SPACE = 0x1,
+ D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_xvYCC = 0x2,
+ D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_RGB_RANGE_CONVERSION = 0x4,
+ D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION = 0x8,
+ D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_NOMINAL_RANGE = 0x10
+ } D3D11_VIDEO_PROCESSOR_DEVICE_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_FEATURE_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_FILL = 0x1,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_CONSTRICTION = 0x2,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LUMA_KEY = 0x4,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_PALETTE = 0x8,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LEGACY = 0x10,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_STEREO = 0x20,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ROTATION = 0x40,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_STREAM = 0x80,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_PIXEL_ASPECT_RATIO = 0x100,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_MIRROR = 0x200,
+ D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x400
+ } D3D11_VIDEO_PROCESSOR_FEATURE_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_FILTER_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS = 0x1,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST = 0x2,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_HUE = 0x4,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_SATURATION = 0x8,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_NOISE_REDUCTION = 0x10,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_EDGE_ENHANCEMENT = 0x20,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_ANAMORPHIC_SCALING = 0x40,
+ D3D11_VIDEO_PROCESSOR_FILTER_CAPS_STEREO_ADJUSTMENT = 0x80
+ } D3D11_VIDEO_PROCESSOR_FILTER_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_FORMAT_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_INTERLACED = 0x1,
+ D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_PROCAMP = 0x2,
+ D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_LUMA_KEY = 0x4,
+ D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_PALETTE_INTERLACED = 0x8
+ } D3D11_VIDEO_PROCESSOR_FORMAT_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DENOISE = 0x1,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DERINGING = 0x2,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT = 0x4,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_COLOR_CORRECTION = 0x8,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING = 0x10,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_IMAGE_STABILIZATION = 0x20,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_SUPER_RESOLUTION = 0x40,
+ D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING = 0x80
+ } D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_STEREO_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_STEREO_CAPS_MONO_OFFSET = 0x1,
+ D3D11_VIDEO_PROCESSOR_STEREO_CAPS_ROW_INTERLEAVED = 0x2,
+ D3D11_VIDEO_PROCESSOR_STEREO_CAPS_COLUMN_INTERLEAVED = 0x4,
+ D3D11_VIDEO_PROCESSOR_STEREO_CAPS_CHECKERBOARD = 0x8,
+ D3D11_VIDEO_PROCESSOR_STEREO_CAPS_FLIP_MODE = 0x10
+ } D3D11_VIDEO_PROCESSOR_STEREO_CAPS;
+
+typedef struct D3D11_VIDEO_PROCESSOR_CAPS
+ {
+ UINT DeviceCaps;
+ UINT FeatureCaps;
+ UINT FilterCaps;
+ UINT InputFormatCaps;
+ UINT AutoStreamCaps;
+ UINT StereoCaps;
+ UINT RateConversionCapsCount;
+ UINT MaxInputStreams;
+ UINT MaxStreamStates;
+ } D3D11_VIDEO_PROCESSOR_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND = 0x1,
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB = 0x2,
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE = 0x4,
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION = 0x8,
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE = 0x10,
+ D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION = 0x20
+ } D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS
+ {
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32 = 0x1,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_22 = 0x2,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2224 = 0x4,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2332 = 0x8,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32322 = 0x10,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_55 = 0x20,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_64 = 0x40,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_87 = 0x80,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_222222222223 = 0x100,
+ D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_OTHER = 0x80000000
+ } D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS;
+
+typedef struct D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS
+ {
+ UINT PastFrames;
+ UINT FutureFrames;
+ UINT ProcessorCaps;
+ UINT ITelecineCaps;
+ UINT CustomRateCount;
+ } D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS;
+
+typedef
+enum D3D11_CONTENT_PROTECTION_CAPS
+ {
+ D3D11_CONTENT_PROTECTION_CAPS_SOFTWARE = 0x1,
+ D3D11_CONTENT_PROTECTION_CAPS_HARDWARE = 0x2,
+ D3D11_CONTENT_PROTECTION_CAPS_PROTECTION_ALWAYS_ON = 0x4,
+ D3D11_CONTENT_PROTECTION_CAPS_PARTIAL_DECRYPTION = 0x8,
+ D3D11_CONTENT_PROTECTION_CAPS_CONTENT_KEY = 0x10,
+ D3D11_CONTENT_PROTECTION_CAPS_FRESHEN_SESSION_KEY = 0x20,
+ D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK = 0x40,
+ D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK_KEY = 0x80,
+ D3D11_CONTENT_PROTECTION_CAPS_SEQUENTIAL_CTR_IV = 0x100,
+ D3D11_CONTENT_PROTECTION_CAPS_ENCRYPT_SLICEDATA_ONLY = 0x200,
+ D3D11_CONTENT_PROTECTION_CAPS_DECRYPTION_BLT = 0x400,
+ D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECT_UNCOMPRESSED = 0x800,
+ D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECTED_MEMORY_PAGEABLE = 0x1000,
+ D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_TEARDOWN = 0x2000,
+ D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_DRM_COMMUNICATION = 0x4000
+ } D3D11_CONTENT_PROTECTION_CAPS;
+
+DEFINE_GUID(D3D11_CRYPTO_TYPE_AES128_CTR, 0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f );
+DEFINE_GUID(D3D11_DECODER_ENCRYPTION_HW_CENC, 0x89d6ac4f, 0x9f2, 0x4229, 0xb2, 0xcd, 0x37, 0x74, 0xa, 0x6d, 0xfd, 0x81);
+DEFINE_GUID(D3D11_KEY_EXCHANGE_HW_PROTECTION, 0xb1170d8a, 0x628d, 0x4da3, 0xad, 0x3b, 0x82, 0xdd, 0xb0, 0x8b, 0x49, 0x70);
+typedef struct D3D11_VIDEO_CONTENT_PROTECTION_CAPS
+ {
+ UINT Caps;
+ UINT KeyExchangeTypeCount;
+ UINT BlockAlignmentSize;
+ ULONGLONG ProtectedMemorySize;
+ } D3D11_VIDEO_CONTENT_PROTECTION_CAPS;
+
+typedef struct D3D11_VIDEO_PROCESSOR_CUSTOM_RATE
+ {
+ DXGI_RATIONAL CustomRate;
+ UINT OutputFrames;
+ BOOL InputInterlaced;
+ UINT InputFramesOrFields;
+ } D3D11_VIDEO_PROCESSOR_CUSTOM_RATE;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_FILTER
+ {
+ D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS = 0,
+ D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST = 1,
+ D3D11_VIDEO_PROCESSOR_FILTER_HUE = 2,
+ D3D11_VIDEO_PROCESSOR_FILTER_SATURATION = 3,
+ D3D11_VIDEO_PROCESSOR_FILTER_NOISE_REDUCTION = 4,
+ D3D11_VIDEO_PROCESSOR_FILTER_EDGE_ENHANCEMENT = 5,
+ D3D11_VIDEO_PROCESSOR_FILTER_ANAMORPHIC_SCALING = 6,
+ D3D11_VIDEO_PROCESSOR_FILTER_STEREO_ADJUSTMENT = 7
+ } D3D11_VIDEO_PROCESSOR_FILTER;
+
+typedef struct D3D11_VIDEO_PROCESSOR_FILTER_RANGE
+ {
+ int Minimum;
+ int Maximum;
+ int Default;
+ float Multiplier;
+ } D3D11_VIDEO_PROCESSOR_FILTER_RANGE;
+
+typedef
+enum D3D11_VIDEO_FRAME_FORMAT
+ {
+ D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0,
+ D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1,
+ D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2
+ } D3D11_VIDEO_FRAME_FORMAT;
+
+typedef
+enum D3D11_VIDEO_USAGE
+ {
+ D3D11_VIDEO_USAGE_PLAYBACK_NORMAL = 0,
+ D3D11_VIDEO_USAGE_OPTIMAL_SPEED = 1,
+ D3D11_VIDEO_USAGE_OPTIMAL_QUALITY = 2
+ } D3D11_VIDEO_USAGE;
+
+typedef struct D3D11_VIDEO_PROCESSOR_CONTENT_DESC
+ {
+ D3D11_VIDEO_FRAME_FORMAT InputFrameFormat;
+ DXGI_RATIONAL InputFrameRate;
+ UINT InputWidth;
+ UINT InputHeight;
+ DXGI_RATIONAL OutputFrameRate;
+ UINT OutputWidth;
+ UINT OutputHeight;
+ D3D11_VIDEO_USAGE Usage;
+ } D3D11_VIDEO_PROCESSOR_CONTENT_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoProcessorEnumerator_INTERFACE_DEFINED__
+#define __ID3D11VideoProcessorEnumerator_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoProcessorEnumerator */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoProcessorEnumerator;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("31627037-53AB-4200-9061-05FAA9AB45F9")
+ ID3D11VideoProcessorEnumerator : public ID3D11DeviceChild
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorContentDesc(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pContentDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckVideoProcessorFormat(
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFlags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorCaps(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CAPS *pCaps) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorRateConversionCaps(
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorCustomRate(
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _In_ UINT CustomRateIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CUSTOM_RATE *pRate) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorFilterRange(
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_FILTER_RANGE *pRange) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoProcessorEnumeratorVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoProcessorEnumerator * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoProcessorEnumerator * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorContentDesc )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pContentDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoProcessorFormat )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorCaps )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorRateConversionCaps )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorCustomRate )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _In_ UINT CustomRateIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CUSTOM_RATE *pRate);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorFilterRange )(
+ ID3D11VideoProcessorEnumerator * This,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_FILTER_RANGE *pRange);
+
+ END_INTERFACE
+ } ID3D11VideoProcessorEnumeratorVtbl;
+
+ interface ID3D11VideoProcessorEnumerator
+ {
+ CONST_VTBL struct ID3D11VideoProcessorEnumeratorVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoProcessorEnumerator_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoProcessorEnumerator_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoProcessorEnumerator_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoProcessorEnumerator_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoProcessorEnumerator_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoProcessorEnumerator_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoProcessorEnumerator_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoProcessorEnumerator_GetVideoProcessorContentDesc(This,pContentDesc) \
+ ( (This)->lpVtbl -> GetVideoProcessorContentDesc(This,pContentDesc) )
+
+#define ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(This,Format,pFlags) \
+ ( (This)->lpVtbl -> CheckVideoProcessorFormat(This,Format,pFlags) )
+
+#define ID3D11VideoProcessorEnumerator_GetVideoProcessorCaps(This,pCaps) \
+ ( (This)->lpVtbl -> GetVideoProcessorCaps(This,pCaps) )
+
+#define ID3D11VideoProcessorEnumerator_GetVideoProcessorRateConversionCaps(This,TypeIndex,pCaps) \
+ ( (This)->lpVtbl -> GetVideoProcessorRateConversionCaps(This,TypeIndex,pCaps) )
+
+#define ID3D11VideoProcessorEnumerator_GetVideoProcessorCustomRate(This,TypeIndex,CustomRateIndex,pRate) \
+ ( (This)->lpVtbl -> GetVideoProcessorCustomRate(This,TypeIndex,CustomRateIndex,pRate) )
+
+#define ID3D11VideoProcessorEnumerator_GetVideoProcessorFilterRange(This,Filter,pRange) \
+ ( (This)->lpVtbl -> GetVideoProcessorFilterRange(This,Filter,pRange) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoProcessorEnumerator_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0032 */
+/* [local] */
+
+typedef struct D3D11_VIDEO_COLOR_RGBA
+ {
+ float R;
+ float G;
+ float B;
+ float A;
+ } D3D11_VIDEO_COLOR_RGBA;
+
+typedef struct D3D11_VIDEO_COLOR_YCbCrA
+ {
+ float Y;
+ float Cb;
+ float Cr;
+ float A;
+ } D3D11_VIDEO_COLOR_YCbCrA;
+
+typedef struct D3D11_VIDEO_COLOR
+ {
+ union
+ {
+ D3D11_VIDEO_COLOR_YCbCrA YCbCr;
+ D3D11_VIDEO_COLOR_RGBA RGBA;
+ } ;
+ } D3D11_VIDEO_COLOR;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE
+ {
+ D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_UNDEFINED = 0,
+ D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 = 1,
+ D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255 = 2
+ } D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE;
+
+typedef struct D3D11_VIDEO_PROCESSOR_COLOR_SPACE
+ {
+ UINT Usage : 1;
+ UINT RGB_Range : 1;
+ UINT YCbCr_Matrix : 1;
+ UINT YCbCr_xvYCC : 1;
+ UINT Nominal_Range : 2;
+ UINT Reserved : 26;
+ } D3D11_VIDEO_PROCESSOR_COLOR_SPACE;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE
+ {
+ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_OPAQUE = 0,
+ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_BACKGROUND = 1,
+ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_DESTINATION = 2,
+ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_SOURCE_STREAM = 3
+ } D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_OUTPUT_RATE
+ {
+ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_NORMAL = 0,
+ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_HALF = 1,
+ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_CUSTOM = 2
+ } D3D11_VIDEO_PROCESSOR_OUTPUT_RATE;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_STEREO_FORMAT
+ {
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO = 0,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_HORIZONTAL = 1,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_VERTICAL = 2,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_SEPARATE = 3,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO_OFFSET = 4,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_ROW_INTERLEAVED = 5,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_COLUMN_INTERLEAVED = 6,
+ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_CHECKERBOARD = 7
+ } D3D11_VIDEO_PROCESSOR_STEREO_FORMAT;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE
+ {
+ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_NONE = 0,
+ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME0 = 1,
+ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME1 = 2
+ } D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_ROTATION
+ {
+ D3D11_VIDEO_PROCESSOR_ROTATION_IDENTITY = 0,
+ D3D11_VIDEO_PROCESSOR_ROTATION_90 = 1,
+ D3D11_VIDEO_PROCESSOR_ROTATION_180 = 2,
+ D3D11_VIDEO_PROCESSOR_ROTATION_270 = 3
+ } D3D11_VIDEO_PROCESSOR_ROTATION;
+
+typedef struct D3D11_VIDEO_PROCESSOR_STREAM
+ {
+ BOOL Enable;
+ UINT OutputIndex;
+ UINT InputFrameOrField;
+ UINT PastFrames;
+ UINT FutureFrames;
+ /* [annotation] */
+ _Field_size_(PastFrames) ID3D11VideoProcessorInputView **ppPastSurfaces;
+ ID3D11VideoProcessorInputView *pInputSurface;
+ /* [annotation] */
+ _Field_size_(FutureFrames) ID3D11VideoProcessorInputView **ppFutureSurfaces;
+ /* [annotation] */
+ _Field_size_opt_(PastFrames) ID3D11VideoProcessorInputView **ppPastSurfacesRight;
+ ID3D11VideoProcessorInputView *pInputSurfaceRight;
+ /* [annotation] */
+ _Field_size_(FutureFrames) ID3D11VideoProcessorInputView **ppFutureSurfacesRight;
+ } D3D11_VIDEO_PROCESSOR_STREAM;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0032_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0032_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoProcessor_INTERFACE_DEFINED__
+#define __ID3D11VideoProcessor_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoProcessor */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoProcessor;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1D7B0652-185F-41c6-85CE-0C5BE3D4AE6C")
+ ID3D11VideoProcessor : public ID3D11DeviceChild
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetContentDesc(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc) = 0;
+
+ virtual void STDMETHODCALLTYPE GetRateConversionCaps(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoProcessorVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoProcessor * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoProcessor * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoProcessor * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetContentDesc )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetRateConversionCaps )(
+ ID3D11VideoProcessor * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps);
+
+ END_INTERFACE
+ } ID3D11VideoProcessorVtbl;
+
+ interface ID3D11VideoProcessor
+ {
+ CONST_VTBL struct ID3D11VideoProcessorVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoProcessor_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoProcessor_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoProcessor_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoProcessor_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoProcessor_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoProcessor_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoProcessor_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoProcessor_GetContentDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetContentDesc(This,pDesc) )
+
+#define ID3D11VideoProcessor_GetRateConversionCaps(This,pCaps) \
+ ( (This)->lpVtbl -> GetRateConversionCaps(This,pCaps) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoProcessor_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0033 */
+/* [local] */
+
+typedef struct D3D11_OMAC
+ {
+ BYTE Omac[ 16 ];
+ } D3D11_OMAC;
+
+typedef
+enum D3D11_AUTHENTICATED_CHANNEL_TYPE
+ {
+ D3D11_AUTHENTICATED_CHANNEL_D3D11 = 1,
+ D3D11_AUTHENTICATED_CHANNEL_DRIVER_SOFTWARE = 2,
+ D3D11_AUTHENTICATED_CHANNEL_DRIVER_HARDWARE = 3
+ } D3D11_AUTHENTICATED_CHANNEL_TYPE;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0033_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0033_v0_0_s_ifspec;
+
+#ifndef __ID3D11AuthenticatedChannel_INTERFACE_DEFINED__
+#define __ID3D11AuthenticatedChannel_INTERFACE_DEFINED__
+
+/* interface ID3D11AuthenticatedChannel */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11AuthenticatedChannel;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3015A308-DCBD-47aa-A747-192486D14D4A")
+ ID3D11AuthenticatedChannel : public ID3D11DeviceChild
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetCertificateSize(
+ /* [annotation] */
+ _Out_ UINT *pCertificateSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCertificate(
+ /* [annotation] */
+ _In_ UINT CertificateSize,
+ /* [annotation] */
+ _Out_writes_bytes_(CertificateSize) BYTE *pCertificate) = 0;
+
+ virtual void STDMETHODCALLTYPE GetChannelHandle(
+ /* [annotation] */
+ _Out_ HANDLE *pChannelHandle) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11AuthenticatedChannelVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11AuthenticatedChannel * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11AuthenticatedChannel * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11AuthenticatedChannel * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCertificateSize )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _Out_ UINT *pCertificateSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCertificate )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _In_ UINT CertificateSize,
+ /* [annotation] */
+ _Out_writes_bytes_(CertificateSize) BYTE *pCertificate);
+
+ void ( STDMETHODCALLTYPE *GetChannelHandle )(
+ ID3D11AuthenticatedChannel * This,
+ /* [annotation] */
+ _Out_ HANDLE *pChannelHandle);
+
+ END_INTERFACE
+ } ID3D11AuthenticatedChannelVtbl;
+
+ interface ID3D11AuthenticatedChannel
+ {
+ CONST_VTBL struct ID3D11AuthenticatedChannelVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11AuthenticatedChannel_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11AuthenticatedChannel_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11AuthenticatedChannel_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11AuthenticatedChannel_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11AuthenticatedChannel_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11AuthenticatedChannel_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11AuthenticatedChannel_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11AuthenticatedChannel_GetCertificateSize(This,pCertificateSize) \
+ ( (This)->lpVtbl -> GetCertificateSize(This,pCertificateSize) )
+
+#define ID3D11AuthenticatedChannel_GetCertificate(This,CertificateSize,pCertificate) \
+ ( (This)->lpVtbl -> GetCertificate(This,CertificateSize,pCertificate) )
+
+#define ID3D11AuthenticatedChannel_GetChannelHandle(This,pChannelHandle) \
+ ( (This)->lpVtbl -> GetChannelHandle(This,pChannelHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11AuthenticatedChannel_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0034 */
+/* [local] */
+
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_PROTECTION, 0xa84eb584, 0xc495, 0x48aa, 0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE, 0xbc1b18a5, 0xb1fb, 0x42ab, 0xbd, 0x94, 0xb5, 0x82, 0x8b, 0x4b, 0xf7, 0xbe );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE, 0xec1c539d, 0x8cff, 0x4e2a, 0xbc, 0xc4, 0xf5, 0x69, 0x2f, 0x99, 0xf4, 0x80 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION, 0x2634499e, 0xd018, 0x4d74, 0xac, 0x17, 0x7f, 0x72, 0x40, 0x59, 0x52, 0x8d );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT, 0xdb207b3, 0x9450, 0x46a6, 0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS, 0x649bbadb, 0xf0f4, 0x4639, 0xa1, 0x5b, 0x24, 0x39, 0x3f, 0xc3, 0xab, 0xac );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT, 0x12f0bd6, 0xe662, 0x4474, 0xbe, 0xfd, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT, 0x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_OUTPUT_ID, 0x839ddca3, 0x9b4e, 0x41e4, 0xb0, 0x53, 0x89, 0x2b, 0xd2, 0xa1, 0x1e, 0xe7 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ATTRIBUTES, 0x6214d9d2, 0x432c, 0x4abb, 0x9f, 0xce, 0x21, 0x6e, 0xea, 0x26, 0x9e, 0x3b );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID_COUNT, 0xb30f7066, 0x203c, 0x4b07, 0x93, 0xfc, 0xce, 0xaa, 0xfd, 0x61, 0x24, 0x1e );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID, 0xf83a5958, 0xe986, 0x4bda, 0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7 );
+DEFINE_GUID( D3D11_AUTHENTICATED_QUERY_CURRENT_ENCRYPTION_WHEN_ACCESSIBLE, 0xec1791c7, 0xdad3, 0x4f15, 0x9e, 0xc3, 0xfa, 0xa9, 0x3d, 0x60, 0xd4, 0xf0 );
+DEFINE_GUID( D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE, 0x6114bdb, 0x3523, 0x470a, 0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0 );
+DEFINE_GUID( D3D11_AUTHENTICATED_CONFIGURE_PROTECTION, 0x50455658, 0x3f47, 0x4362, 0xbf, 0x99, 0xbf, 0xdf, 0xcd, 0xe9, 0xed, 0x29 );
+DEFINE_GUID( D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION, 0x6346cc54, 0x2cfc, 0x4ad4, 0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0 );
+DEFINE_GUID( D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE, 0x772d047, 0x1b40, 0x48e8, 0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1 );
+DEFINE_GUID( D3D11_AUTHENTICATED_CONFIGURE_ENCRYPTION_WHEN_ACCESSIBLE, 0x41fff286, 0x6ae0, 0x4d43, 0x9d, 0x55, 0xa4, 0x6e, 0x9e, 0xfd, 0x15, 0x8a );
+typedef struct D3D11_AUTHENTICATED_QUERY_INPUT
+ {
+ GUID QueryType;
+ HANDLE hChannel;
+ UINT SequenceNumber;
+ } D3D11_AUTHENTICATED_QUERY_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT
+ {
+ D3D11_OMAC omac;
+ GUID QueryType;
+ HANDLE hChannel;
+ UINT SequenceNumber;
+ HRESULT ReturnCode;
+ } D3D11_AUTHENTICATED_QUERY_OUTPUT;
+
+typedef union D3D11_AUTHENTICATED_PROTECTION_FLAGS
+ {
+ struct __MIDL___MIDL_itf_d3d11_0000_0034_0001
+ {
+ UINT ProtectionEnabled : 1;
+ UINT OverlayOrFullscreenRequired : 1;
+ UINT Reserved : 30;
+ } Flags;
+ UINT Value;
+ } D3D11_AUTHENTICATED_PROTECTION_FLAGS;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ D3D11_AUTHENTICATED_PROTECTION_FLAGS ProtectionFlags;
+ } D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType;
+ } D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ HANDLE DeviceHandle;
+ } D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_INPUT Input;
+ HANDLE DecoderHandle;
+ } D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ HANDLE DecoderHandle;
+ HANDLE CryptoSessionHandle;
+ HANDLE DeviceHandle;
+ } D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ UINT RestrictedSharedResourceProcessCount;
+ } D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_INPUT Input;
+ UINT ProcessIndex;
+ } D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT;
+
+typedef
+enum D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE
+ {
+ D3D11_PROCESSIDTYPE_UNKNOWN = 0,
+ D3D11_PROCESSIDTYPE_DWM = 1,
+ D3D11_PROCESSIDTYPE_HANDLE = 2
+ } D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ UINT ProcessIndex;
+ D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessIdentifier;
+ HANDLE ProcessHandle;
+ } D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ UINT UnrestrictedProtectedSharedResourceCount;
+ } D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_INPUT Input;
+ HANDLE DeviceHandle;
+ HANDLE CryptoSessionHandle;
+ } D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ HANDLE DeviceHandle;
+ HANDLE CryptoSessionHandle;
+ UINT OutputIDCount;
+ } D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_INPUT Input;
+ HANDLE DeviceHandle;
+ HANDLE CryptoSessionHandle;
+ UINT OutputIDIndex;
+ } D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ HANDLE DeviceHandle;
+ HANDLE CryptoSessionHandle;
+ UINT OutputIDIndex;
+ UINT64 OutputID;
+ } D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT;
+
+typedef
+enum D3D11_BUS_TYPE
+ {
+ D3D11_BUS_TYPE_OTHER = 0,
+ D3D11_BUS_TYPE_PCI = 0x1,
+ D3D11_BUS_TYPE_PCIX = 0x2,
+ D3D11_BUS_TYPE_PCIEXPRESS = 0x3,
+ D3D11_BUS_TYPE_AGP = 0x4,
+ D3D11_BUS_IMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x10000,
+ D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x20000,
+ D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x30000,
+ D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x40000,
+ D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x50000,
+ D3D11_BUS_IMPL_MODIFIER_NON_STANDARD = 0x80000000
+ } D3D11_BUS_TYPE;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_ACESSIBILITY_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ D3D11_BUS_TYPE BusType;
+ BOOL AccessibleInContiguousBlocks;
+ BOOL AccessibleInNonContiguousBlocks;
+ } D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ UINT EncryptionGuidCount;
+ } D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_INPUT Input;
+ UINT EncryptionGuidIndex;
+ } D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ UINT EncryptionGuidIndex;
+ GUID EncryptionGuid;
+ } D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT
+ {
+ D3D11_AUTHENTICATED_QUERY_OUTPUT Output;
+ GUID EncryptionGuid;
+ } D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_INPUT
+ {
+ D3D11_OMAC omac;
+ GUID ConfigureType;
+ HANDLE hChannel;
+ UINT SequenceNumber;
+ } D3D11_AUTHENTICATED_CONFIGURE_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_OUTPUT
+ {
+ D3D11_OMAC omac;
+ GUID ConfigureType;
+ HANDLE hChannel;
+ UINT SequenceNumber;
+ HRESULT ReturnCode;
+ } D3D11_AUTHENTICATED_CONFIGURE_OUTPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT
+ {
+ D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
+ UINT StartSequenceQuery;
+ UINT StartSequenceConfigure;
+ } D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT
+ {
+ D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
+ D3D11_AUTHENTICATED_PROTECTION_FLAGS Protections;
+ } D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT
+ {
+ D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
+ HANDLE DecoderHandle;
+ HANDLE CryptoSessionHandle;
+ HANDLE DeviceHandle;
+ } D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT
+ {
+ D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
+ D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE ProcessType;
+ HANDLE ProcessHandle;
+ BOOL AllowAccess;
+ } D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT;
+
+typedef struct D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT
+ {
+ D3D11_AUTHENTICATED_CONFIGURE_INPUT Parameters;
+ GUID EncryptionGuid;
+ } D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT;
+
+DEFINE_GUID(D3D11_KEY_EXCHANGE_RSAES_OAEP, 0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0034_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0034_v0_0_s_ifspec;
+
+#ifndef __ID3D11CryptoSession_INTERFACE_DEFINED__
+#define __ID3D11CryptoSession_INTERFACE_DEFINED__
+
+/* interface ID3D11CryptoSession */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11CryptoSession;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9B32F9AD-BDCC-40a6-A39D-D5C865845720")
+ ID3D11CryptoSession : public ID3D11DeviceChild
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetCryptoType(
+ /* [annotation] */
+ _Out_ GUID *pCryptoType) = 0;
+
+ virtual void STDMETHODCALLTYPE GetDecoderProfile(
+ /* [annotation] */
+ _Out_ GUID *pDecoderProfile) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCertificateSize(
+ /* [annotation] */
+ _Out_ UINT *pCertificateSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCertificate(
+ /* [annotation] */
+ _In_ UINT CertificateSize,
+ /* [annotation] */
+ _Out_writes_bytes_(CertificateSize) BYTE *pCertificate) = 0;
+
+ virtual void STDMETHODCALLTYPE GetCryptoSessionHandle(
+ /* [annotation] */
+ _Out_ HANDLE *pCryptoSessionHandle) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11CryptoSessionVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11CryptoSession * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11CryptoSession * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11CryptoSession * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetCryptoType )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _Out_ GUID *pCryptoType);
+
+ void ( STDMETHODCALLTYPE *GetDecoderProfile )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _Out_ GUID *pDecoderProfile);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCertificateSize )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _Out_ UINT *pCertificateSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCertificate )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _In_ UINT CertificateSize,
+ /* [annotation] */
+ _Out_writes_bytes_(CertificateSize) BYTE *pCertificate);
+
+ void ( STDMETHODCALLTYPE *GetCryptoSessionHandle )(
+ ID3D11CryptoSession * This,
+ /* [annotation] */
+ _Out_ HANDLE *pCryptoSessionHandle);
+
+ END_INTERFACE
+ } ID3D11CryptoSessionVtbl;
+
+ interface ID3D11CryptoSession
+ {
+ CONST_VTBL struct ID3D11CryptoSessionVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11CryptoSession_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11CryptoSession_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11CryptoSession_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11CryptoSession_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11CryptoSession_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11CryptoSession_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11CryptoSession_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11CryptoSession_GetCryptoType(This,pCryptoType) \
+ ( (This)->lpVtbl -> GetCryptoType(This,pCryptoType) )
+
+#define ID3D11CryptoSession_GetDecoderProfile(This,pDecoderProfile) \
+ ( (This)->lpVtbl -> GetDecoderProfile(This,pDecoderProfile) )
+
+#define ID3D11CryptoSession_GetCertificateSize(This,pCertificateSize) \
+ ( (This)->lpVtbl -> GetCertificateSize(This,pCertificateSize) )
+
+#define ID3D11CryptoSession_GetCertificate(This,CertificateSize,pCertificate) \
+ ( (This)->lpVtbl -> GetCertificate(This,CertificateSize,pCertificate) )
+
+#define ID3D11CryptoSession_GetCryptoSessionHandle(This,pCryptoSessionHandle) \
+ ( (This)->lpVtbl -> GetCryptoSessionHandle(This,pCryptoSessionHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11CryptoSession_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0035 */
+/* [local] */
+
+typedef
+enum D3D11_VDOV_DIMENSION
+ {
+ D3D11_VDOV_DIMENSION_UNKNOWN = 0,
+ D3D11_VDOV_DIMENSION_TEXTURE2D = 1
+ } D3D11_VDOV_DIMENSION;
+
+typedef struct D3D11_TEX2D_VDOV
+ {
+ UINT ArraySlice;
+ } D3D11_TEX2D_VDOV;
+
+typedef struct D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC
+ {
+ GUID DecodeProfile;
+ D3D11_VDOV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_TEX2D_VDOV Texture2D;
+ } ;
+ } D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0035_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0035_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoDecoderOutputView_INTERFACE_DEFINED__
+#define __ID3D11VideoDecoderOutputView_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoDecoderOutputView */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoDecoderOutputView;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C2931AEA-2A85-4f20-860F-FBA1FD256E18")
+ ID3D11VideoDecoderOutputView : public ID3D11View
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoDecoderOutputViewVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoDecoderOutputView * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoDecoderOutputView * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11VideoDecoderOutputView * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc);
+
+ END_INTERFACE
+ } ID3D11VideoDecoderOutputViewVtbl;
+
+ interface ID3D11VideoDecoderOutputView
+ {
+ CONST_VTBL struct ID3D11VideoDecoderOutputViewVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoDecoderOutputView_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoDecoderOutputView_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoDecoderOutputView_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoDecoderOutputView_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoDecoderOutputView_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoDecoderOutputView_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoDecoderOutputView_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoDecoderOutputView_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11VideoDecoderOutputView_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoDecoderOutputView_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0036 */
+/* [local] */
+
+typedef
+enum D3D11_VPIV_DIMENSION
+ {
+ D3D11_VPIV_DIMENSION_UNKNOWN = 0,
+ D3D11_VPIV_DIMENSION_TEXTURE2D = 1
+ } D3D11_VPIV_DIMENSION;
+
+typedef struct D3D11_TEX2D_VPIV
+ {
+ UINT MipSlice;
+ UINT ArraySlice;
+ } D3D11_TEX2D_VPIV;
+
+typedef struct D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC
+ {
+ UINT FourCC;
+ D3D11_VPIV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_TEX2D_VPIV Texture2D;
+ } ;
+ } D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0036_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0036_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoProcessorInputView_INTERFACE_DEFINED__
+#define __ID3D11VideoProcessorInputView_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoProcessorInputView */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoProcessorInputView;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("11EC5A5F-51DC-4945-AB34-6E8C21300EA5")
+ ID3D11VideoProcessorInputView : public ID3D11View
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoProcessorInputViewVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoProcessorInputView * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoProcessorInputView * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoProcessorInputView * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11VideoProcessorInputView * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc);
+
+ END_INTERFACE
+ } ID3D11VideoProcessorInputViewVtbl;
+
+ interface ID3D11VideoProcessorInputView
+ {
+ CONST_VTBL struct ID3D11VideoProcessorInputViewVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoProcessorInputView_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoProcessorInputView_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoProcessorInputView_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoProcessorInputView_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoProcessorInputView_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoProcessorInputView_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoProcessorInputView_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoProcessorInputView_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11VideoProcessorInputView_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoProcessorInputView_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0037 */
+/* [local] */
+
+typedef
+enum D3D11_VPOV_DIMENSION
+ {
+ D3D11_VPOV_DIMENSION_UNKNOWN = 0,
+ D3D11_VPOV_DIMENSION_TEXTURE2D = 1,
+ D3D11_VPOV_DIMENSION_TEXTURE2DARRAY = 2
+ } D3D11_VPOV_DIMENSION;
+
+typedef struct D3D11_TEX2D_VPOV
+ {
+ UINT MipSlice;
+ } D3D11_TEX2D_VPOV;
+
+typedef struct D3D11_TEX2D_ARRAY_VPOV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D11_TEX2D_ARRAY_VPOV;
+
+typedef struct D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC
+ {
+ D3D11_VPOV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_TEX2D_VPOV Texture2D;
+ D3D11_TEX2D_ARRAY_VPOV Texture2DArray;
+ } ;
+ } D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0037_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0037_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoProcessorOutputView_INTERFACE_DEFINED__
+#define __ID3D11VideoProcessorOutputView_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoProcessorOutputView */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoProcessorOutputView;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("A048285E-25A9-4527-BD93-D68B68C44254")
+ ID3D11VideoProcessorOutputView : public ID3D11View
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc(
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoProcessorOutputViewVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoProcessorOutputView * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoProcessorOutputView * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11VideoProcessorOutputView * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc);
+
+ END_INTERFACE
+ } ID3D11VideoProcessorOutputViewVtbl;
+
+ interface ID3D11VideoProcessorOutputView
+ {
+ CONST_VTBL struct ID3D11VideoProcessorOutputViewVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoProcessorOutputView_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoProcessorOutputView_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoProcessorOutputView_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoProcessorOutputView_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoProcessorOutputView_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoProcessorOutputView_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoProcessorOutputView_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoProcessorOutputView_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11VideoProcessorOutputView_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoProcessorOutputView_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11VideoContext_INTERFACE_DEFINED__
+#define __ID3D11VideoContext_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoContext */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoContext;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("61F21C45-3C0E-4a74-9CEA-67100D9AD5E4")
+ ID3D11VideoContext : public ID3D11DeviceChild
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetDecoderBuffer(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE Type,
+ /* [annotation] */
+ _Out_ UINT *pBufferSize,
+ /* [annotation] */
+ _Outptr_result_bytebuffer_(*pBufferSize) void **ppBuffer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReleaseDecoderBuffer(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_DECODER_BUFFER_TYPE Type) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderBeginFrame(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoderOutputView *pView,
+ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderEndFrame(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SubmitDecoderBuffers(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_(NumBuffers) const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc) = 0;
+
+ virtual APP_DEPRECATED_HRESULT STDMETHODCALLTYPE DecoderExtension(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_EXTENSION *pExtensionData) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputTargetRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputBackgroundColor(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL YCbCr,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_COLOR *pColor) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputColorSpace(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputAlphaFillMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE AlphaFillMode,
+ /* [annotation] */
+ _In_ UINT StreamIndex) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputConstriction(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ SIZE Size) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputStereoMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable) = 0;
+
+ virtual APP_DEPRECATED_HRESULT STDMETHODCALLTYPE VideoProcessorSetOutputExtension(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputTargetRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *Enabled,
+ /* [annotation] */
+ _Out_ RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputBackgroundColor(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pYCbCr,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_COLOR *pColor) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputColorSpace(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputAlphaFillMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE *pAlphaFillMode,
+ /* [annotation] */
+ _Out_ UINT *pStreamIndex) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputConstriction(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ SIZE *pSize) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputStereoMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled) = 0;
+
+ virtual APP_DEPRECATED_HRESULT STDMETHODCALLTYPE VideoProcessorGetOutputExtension(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamFrameFormat(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_FRAME_FORMAT FrameFormat) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamColorSpace(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamOutputRate(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE OutputRate,
+ /* [annotation] */
+ _In_ BOOL RepeatFrame,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pCustomRate) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamSourceRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamDestRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamAlpha(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Alpha) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamPalette(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _In_reads_opt_(Count) const UINT *pEntries) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamPixelAspectRatio(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pDestinationAspectRatio) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamLumaKey(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Lower,
+ /* [annotation] */
+ _In_ FLOAT Upper) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamStereoFormat(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT Format,
+ /* [annotation] */
+ _In_ BOOL LeftViewFrame0,
+ /* [annotation] */
+ _In_ BOOL BaseViewFrame0,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE FlipMode,
+ /* [annotation] */
+ _In_ int MonoOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamAutoProcessingMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamFilter(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ int Level) = 0;
+
+ virtual APP_DEPRECATED_HRESULT STDMETHODCALLTYPE VideoProcessorSetStreamExtension(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamFrameFormat(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_FRAME_FORMAT *pFrameFormat) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamColorSpace(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamOutputRate(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE *pOutputRate,
+ /* [annotation] */
+ _Out_ BOOL *pRepeatFrame,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pCustomRate) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamSourceRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamDestRect(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamAlpha(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pAlpha) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamPalette(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _Out_writes_(Count) UINT *pEntries) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamPixelAspectRatio(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pDestinationAspectRatio) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamLumaKey(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pLower,
+ /* [annotation] */
+ _Out_ FLOAT *pUpper) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamStereoFormat(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT *pFormat,
+ /* [annotation] */
+ _Out_ BOOL *pLeftViewFrame0,
+ /* [annotation] */
+ _Out_ BOOL *pBaseViewFrame0,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE *pFlipMode,
+ /* [annotation] */
+ _Out_ int *MonoOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamAutoProcessingMode(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamFilter(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ int *pLevel) = 0;
+
+ virtual APP_DEPRECATED_HRESULT STDMETHODCALLTYPE VideoProcessorGetStreamExtension(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessorBlt(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorOutputView *pView,
+ /* [annotation] */
+ _In_ UINT OutputFrame,
+ /* [annotation] */
+ _In_ UINT StreamCount,
+ /* [annotation] */
+ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM *pStreams) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE NegotiateCryptoSessionKeyExchange(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData) = 0;
+
+ virtual void STDMETHODCALLTYPE EncryptionBlt(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV) = 0;
+
+ virtual void STDMETHODCALLTYPE DecryptionBlt(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_opt_ D3D11_ENCRYPTED_BLOCK_INFO *pEncryptedBlockInfo,
+ /* [annotation] */
+ _In_ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV) = 0;
+
+ virtual void STDMETHODCALLTYPE StartSessionKeyRefresh(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT RandomNumberSize,
+ /* [annotation] */
+ _Out_writes_bytes_(RandomNumberSize) void *pRandomNumber) = 0;
+
+ virtual void STDMETHODCALLTYPE FinishSessionKeyRefresh(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEncryptionBltKey(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT KeySize,
+ /* [annotation] */
+ _Out_writes_bytes_(KeySize) void *pReadbackKey) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE NegotiateAuthenticatedChannelKeyExchange(
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryAuthenticatedChannel(
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _In_ UINT OutputSize,
+ /* [annotation] */
+ _Out_writes_bytes_(OutputSize) void *pOutput) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ConfigureAuthenticatedChannel(
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _Out_ D3D11_AUTHENTICATED_CONFIGURE_OUTPUT *pOutput) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamRotation(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ROTATION Rotation) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamRotation(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ROTATION *pRotation) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoContextVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoContext * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoContext * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoContext * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDecoderBuffer )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE Type,
+ /* [annotation] */
+ _Out_ UINT *pBufferSize,
+ /* [annotation] */
+ _Outptr_result_bytebuffer_(*pBufferSize) void **ppBuffer);
+
+ HRESULT ( STDMETHODCALLTYPE *ReleaseDecoderBuffer )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_DECODER_BUFFER_TYPE Type);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderBeginFrame )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoderOutputView *pView,
+ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderEndFrame )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder);
+
+ HRESULT ( STDMETHODCALLTYPE *SubmitDecoderBuffers )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_(NumBuffers) const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *DecoderExtension )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_EXTENSION *pExtensionData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputTargetRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputBackgroundColor )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL YCbCr,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_COLOR *pColor);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputColorSpace )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputAlphaFillMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE AlphaFillMode,
+ /* [annotation] */
+ _In_ UINT StreamIndex);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputConstriction )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ SIZE Size);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputStereoMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorSetOutputExtension )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputTargetRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *Enabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputBackgroundColor )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pYCbCr,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_COLOR *pColor);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputColorSpace )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputAlphaFillMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE *pAlphaFillMode,
+ /* [annotation] */
+ _Out_ UINT *pStreamIndex);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputConstriction )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ SIZE *pSize);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputStereoMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorGetOutputExtension )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamFrameFormat )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_FRAME_FORMAT FrameFormat);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamColorSpace )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamOutputRate )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE OutputRate,
+ /* [annotation] */
+ _In_ BOOL RepeatFrame,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pCustomRate);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamSourceRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamDestRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamAlpha )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Alpha);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamPalette )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _In_reads_opt_(Count) const UINT *pEntries);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamPixelAspectRatio )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pDestinationAspectRatio);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamLumaKey )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Lower,
+ /* [annotation] */
+ _In_ FLOAT Upper);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamStereoFormat )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT Format,
+ /* [annotation] */
+ _In_ BOOL LeftViewFrame0,
+ /* [annotation] */
+ _In_ BOOL BaseViewFrame0,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE FlipMode,
+ /* [annotation] */
+ _In_ int MonoOffset);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamAutoProcessingMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamFilter )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ int Level);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorSetStreamExtension )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamFrameFormat )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_FRAME_FORMAT *pFrameFormat);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamColorSpace )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamOutputRate )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE *pOutputRate,
+ /* [annotation] */
+ _Out_ BOOL *pRepeatFrame,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pCustomRate);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamSourceRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamDestRect )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamAlpha )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pAlpha);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamPalette )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _Out_writes_(Count) UINT *pEntries);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamPixelAspectRatio )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pDestinationAspectRatio);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamLumaKey )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pLower,
+ /* [annotation] */
+ _Out_ FLOAT *pUpper);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamStereoFormat )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT *pFormat,
+ /* [annotation] */
+ _Out_ BOOL *pLeftViewFrame0,
+ /* [annotation] */
+ _Out_ BOOL *pBaseViewFrame0,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE *pFlipMode,
+ /* [annotation] */
+ _Out_ int *MonoOffset);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamAutoProcessingMode )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamFilter )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ int *pLevel);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorGetStreamExtension )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *VideoProcessorBlt )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorOutputView *pView,
+ /* [annotation] */
+ _In_ UINT OutputFrame,
+ /* [annotation] */
+ _In_ UINT StreamCount,
+ /* [annotation] */
+ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM *pStreams);
+
+ HRESULT ( STDMETHODCALLTYPE *NegotiateCryptoSessionKeyExchange )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData);
+
+ void ( STDMETHODCALLTYPE *EncryptionBlt )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV);
+
+ void ( STDMETHODCALLTYPE *DecryptionBlt )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_opt_ D3D11_ENCRYPTED_BLOCK_INFO *pEncryptedBlockInfo,
+ /* [annotation] */
+ _In_ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV);
+
+ void ( STDMETHODCALLTYPE *StartSessionKeyRefresh )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT RandomNumberSize,
+ /* [annotation] */
+ _Out_writes_bytes_(RandomNumberSize) void *pRandomNumber);
+
+ void ( STDMETHODCALLTYPE *FinishSessionKeyRefresh )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession);
+
+ HRESULT ( STDMETHODCALLTYPE *GetEncryptionBltKey )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT KeySize,
+ /* [annotation] */
+ _Out_writes_bytes_(KeySize) void *pReadbackKey);
+
+ HRESULT ( STDMETHODCALLTYPE *NegotiateAuthenticatedChannelKeyExchange )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *QueryAuthenticatedChannel )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _In_ UINT OutputSize,
+ /* [annotation] */
+ _Out_writes_bytes_(OutputSize) void *pOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *ConfigureAuthenticatedChannel )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _Out_ D3D11_AUTHENTICATED_CONFIGURE_OUTPUT *pOutput);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamRotation )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ROTATION Rotation);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamRotation )(
+ ID3D11VideoContext * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ROTATION *pRotation);
+
+ END_INTERFACE
+ } ID3D11VideoContextVtbl;
+
+ interface ID3D11VideoContext
+ {
+ CONST_VTBL struct ID3D11VideoContextVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoContext_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoContext_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoContext_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoContext_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoContext_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoContext_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoContext_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoContext_GetDecoderBuffer(This,pDecoder,Type,pBufferSize,ppBuffer) \
+ ( (This)->lpVtbl -> GetDecoderBuffer(This,pDecoder,Type,pBufferSize,ppBuffer) )
+
+#define ID3D11VideoContext_ReleaseDecoderBuffer(This,pDecoder,Type) \
+ ( (This)->lpVtbl -> ReleaseDecoderBuffer(This,pDecoder,Type) )
+
+#define ID3D11VideoContext_DecoderBeginFrame(This,pDecoder,pView,ContentKeySize,pContentKey) \
+ ( (This)->lpVtbl -> DecoderBeginFrame(This,pDecoder,pView,ContentKeySize,pContentKey) )
+
+#define ID3D11VideoContext_DecoderEndFrame(This,pDecoder) \
+ ( (This)->lpVtbl -> DecoderEndFrame(This,pDecoder) )
+
+#define ID3D11VideoContext_SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc) \
+ ( (This)->lpVtbl -> SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc) )
+
+#define ID3D11VideoContext_DecoderExtension(This,pDecoder,pExtensionData) \
+ ( (This)->lpVtbl -> DecoderExtension(This,pDecoder,pExtensionData) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputTargetRect(This,pVideoProcessor,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputTargetRect(This,pVideoProcessor,Enable,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputBackgroundColor(This,pVideoProcessor,YCbCr,pColor) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputBackgroundColor(This,pVideoProcessor,YCbCr,pColor) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputColorSpace(This,pVideoProcessor,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputColorSpace(This,pVideoProcessor,pColorSpace) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputAlphaFillMode(This,pVideoProcessor,AlphaFillMode,StreamIndex) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputAlphaFillMode(This,pVideoProcessor,AlphaFillMode,StreamIndex) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputConstriction(This,pVideoProcessor,Enable,Size) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputConstriction(This,pVideoProcessor,Enable,Size) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputStereoMode(This,pVideoProcessor,Enable) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputStereoMode(This,pVideoProcessor,Enable) )
+
+#define ID3D11VideoContext_VideoProcessorSetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputTargetRect(This,pVideoProcessor,Enabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputTargetRect(This,pVideoProcessor,Enabled,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputBackgroundColor(This,pVideoProcessor,pYCbCr,pColor) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputBackgroundColor(This,pVideoProcessor,pYCbCr,pColor) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputColorSpace(This,pVideoProcessor,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputColorSpace(This,pVideoProcessor,pColorSpace) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputAlphaFillMode(This,pVideoProcessor,pAlphaFillMode,pStreamIndex) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputAlphaFillMode(This,pVideoProcessor,pAlphaFillMode,pStreamIndex) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputConstriction(This,pVideoProcessor,pEnabled,pSize) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputConstriction(This,pVideoProcessor,pEnabled,pSize) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputStereoMode(This,pVideoProcessor,pEnabled) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputStereoMode(This,pVideoProcessor,pEnabled) )
+
+#define ID3D11VideoContext_VideoProcessorGetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamFrameFormat(This,pVideoProcessor,StreamIndex,FrameFormat) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamFrameFormat(This,pVideoProcessor,StreamIndex,FrameFormat) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamOutputRate(This,pVideoProcessor,StreamIndex,OutputRate,RepeatFrame,pCustomRate) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamOutputRate(This,pVideoProcessor,StreamIndex,OutputRate,RepeatFrame,pCustomRate) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamSourceRect(This,pVideoProcessor,StreamIndex,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamSourceRect(This,pVideoProcessor,StreamIndex,Enable,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamDestRect(This,pVideoProcessor,StreamIndex,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamDestRect(This,pVideoProcessor,StreamIndex,Enable,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamAlpha(This,pVideoProcessor,StreamIndex,Enable,Alpha) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamAlpha(This,pVideoProcessor,StreamIndex,Enable,Alpha) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,Enable,pSourceAspectRatio,pDestinationAspectRatio) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,Enable,pSourceAspectRatio,pDestinationAspectRatio) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamLumaKey(This,pVideoProcessor,StreamIndex,Enable,Lower,Upper) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamLumaKey(This,pVideoProcessor,StreamIndex,Enable,Lower,Upper) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamStereoFormat(This,pVideoProcessor,StreamIndex,Enable,Format,LeftViewFrame0,BaseViewFrame0,FlipMode,MonoOffset) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamStereoFormat(This,pVideoProcessor,StreamIndex,Enable,Format,LeftViewFrame0,BaseViewFrame0,FlipMode,MonoOffset) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,Enable) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,Enable) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,Enable,Level) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,Enable,Level) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamFrameFormat(This,pVideoProcessor,StreamIndex,pFrameFormat) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamFrameFormat(This,pVideoProcessor,StreamIndex,pFrameFormat) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamOutputRate(This,pVideoProcessor,StreamIndex,pOutputRate,pRepeatFrame,pCustomRate) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamOutputRate(This,pVideoProcessor,StreamIndex,pOutputRate,pRepeatFrame,pCustomRate) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamSourceRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamSourceRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamDestRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamDestRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamAlpha(This,pVideoProcessor,StreamIndex,pEnabled,pAlpha) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamAlpha(This,pVideoProcessor,StreamIndex,pEnabled,pAlpha) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,pEnabled,pSourceAspectRatio,pDestinationAspectRatio) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,pEnabled,pSourceAspectRatio,pDestinationAspectRatio) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamLumaKey(This,pVideoProcessor,StreamIndex,pEnabled,pLower,pUpper) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamLumaKey(This,pVideoProcessor,StreamIndex,pEnabled,pLower,pUpper) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamStereoFormat(This,pVideoProcessor,StreamIndex,pEnable,pFormat,pLeftViewFrame0,pBaseViewFrame0,pFlipMode,MonoOffset) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamStereoFormat(This,pVideoProcessor,StreamIndex,pEnable,pFormat,pLeftViewFrame0,pBaseViewFrame0,pFlipMode,MonoOffset) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,pEnabled) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,pEnabled) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,pEnabled,pLevel) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,pEnabled,pLevel) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext_VideoProcessorBlt(This,pVideoProcessor,pView,OutputFrame,StreamCount,pStreams) \
+ ( (This)->lpVtbl -> VideoProcessorBlt(This,pVideoProcessor,pView,OutputFrame,StreamCount,pStreams) )
+
+#define ID3D11VideoContext_NegotiateCryptoSessionKeyExchange(This,pCryptoSession,DataSize,pData) \
+ ( (This)->lpVtbl -> NegotiateCryptoSessionKeyExchange(This,pCryptoSession,DataSize,pData) )
+
+#define ID3D11VideoContext_EncryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,IVSize,pIV) \
+ ( (This)->lpVtbl -> EncryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,IVSize,pIV) )
+
+#define ID3D11VideoContext_DecryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,pEncryptedBlockInfo,ContentKeySize,pContentKey,IVSize,pIV) \
+ ( (This)->lpVtbl -> DecryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,pEncryptedBlockInfo,ContentKeySize,pContentKey,IVSize,pIV) )
+
+#define ID3D11VideoContext_StartSessionKeyRefresh(This,pCryptoSession,RandomNumberSize,pRandomNumber) \
+ ( (This)->lpVtbl -> StartSessionKeyRefresh(This,pCryptoSession,RandomNumberSize,pRandomNumber) )
+
+#define ID3D11VideoContext_FinishSessionKeyRefresh(This,pCryptoSession) \
+ ( (This)->lpVtbl -> FinishSessionKeyRefresh(This,pCryptoSession) )
+
+#define ID3D11VideoContext_GetEncryptionBltKey(This,pCryptoSession,KeySize,pReadbackKey) \
+ ( (This)->lpVtbl -> GetEncryptionBltKey(This,pCryptoSession,KeySize,pReadbackKey) )
+
+#define ID3D11VideoContext_NegotiateAuthenticatedChannelKeyExchange(This,pChannel,DataSize,pData) \
+ ( (This)->lpVtbl -> NegotiateAuthenticatedChannelKeyExchange(This,pChannel,DataSize,pData) )
+
+#define ID3D11VideoContext_QueryAuthenticatedChannel(This,pChannel,InputSize,pInput,OutputSize,pOutput) \
+ ( (This)->lpVtbl -> QueryAuthenticatedChannel(This,pChannel,InputSize,pInput,OutputSize,pOutput) )
+
+#define ID3D11VideoContext_ConfigureAuthenticatedChannel(This,pChannel,InputSize,pInput,pOutput) \
+ ( (This)->lpVtbl -> ConfigureAuthenticatedChannel(This,pChannel,InputSize,pInput,pOutput) )
+
+#define ID3D11VideoContext_VideoProcessorSetStreamRotation(This,pVideoProcessor,StreamIndex,Enable,Rotation) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamRotation(This,pVideoProcessor,StreamIndex,Enable,Rotation) )
+
+#define ID3D11VideoContext_VideoProcessorGetStreamRotation(This,pVideoProcessor,StreamIndex,pEnable,pRotation) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamRotation(This,pVideoProcessor,StreamIndex,pEnable,pRotation) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoContext_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11VideoDevice_INTERFACE_DEFINED__
+#define __ID3D11VideoDevice_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("10EC4D5B-975A-4689-B9E4-D0AAC30FE333")
+ ID3D11VideoDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pVideoDesc,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pConfig,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoDecoder **ppDecoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ UINT RateConversionIndex,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessor **ppVideoProcessor) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateAuthenticatedChannel(
+ /* [annotation] */
+ _In_ D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11AuthenticatedChannel **ppAuthenticatedChannel) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCryptoSession(
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ const GUID *pKeyExchangeType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11CryptoSession **ppCryptoSession) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderOutputView(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoDecoderOutputView **ppVDOVView) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessorInputView(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorInputView **ppVPIView) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessorOutputView(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorOutputView **ppVPOView) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessorEnumerator(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessorEnumerator **ppEnum) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetVideoDecoderProfileCount( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoDecoderProfile(
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pDecoderProfile) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckVideoDecoderFormat(
+ /* [annotation] */
+ _In_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ BOOL *pSupported) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoDecoderConfigCount(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ UINT *pCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoDecoderConfig(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_CONFIG *pConfig) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetContentProtectionCaps(
+ /* [annotation] */
+ _In_opt_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_CONTENT_PROTECTION_CAPS *pCaps) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckCryptoKeyExchange(
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pKeyExchangeType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoDevice * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoDevice * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoDevice * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pVideoDesc,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pConfig,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoDecoder **ppDecoder);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ UINT RateConversionIndex,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessor **ppVideoProcessor);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateAuthenticatedChannel )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11AuthenticatedChannel **ppAuthenticatedChannel);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCryptoSession )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ const GUID *pKeyExchangeType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11CryptoSession **ppCryptoSession);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderOutputView )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoDecoderOutputView **ppVDOVView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorInputView )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorInputView **ppVPIView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorOutputView )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorOutputView **ppVPOView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorEnumerator )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessorEnumerator **ppEnum);
+
+ UINT ( STDMETHODCALLTYPE *GetVideoDecoderProfileCount )(
+ ID3D11VideoDevice * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderProfile )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pDecoderProfile);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoDecoderFormat )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ BOOL *pSupported);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderConfigCount )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ UINT *pCount);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderConfig )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_CONFIG *pConfig);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContentProtectionCaps )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_opt_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_CONTENT_PROTECTION_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCryptoKeyExchange )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pKeyExchangeType);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoDevice * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ END_INTERFACE
+ } ID3D11VideoDeviceVtbl;
+
+ interface ID3D11VideoDevice
+ {
+ CONST_VTBL struct ID3D11VideoDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoDevice_CreateVideoDecoder(This,pVideoDesc,pConfig,ppDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pVideoDesc,pConfig,ppDecoder) )
+
+#define ID3D11VideoDevice_CreateVideoProcessor(This,pEnum,RateConversionIndex,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,pEnum,RateConversionIndex,ppVideoProcessor) )
+
+#define ID3D11VideoDevice_CreateAuthenticatedChannel(This,ChannelType,ppAuthenticatedChannel) \
+ ( (This)->lpVtbl -> CreateAuthenticatedChannel(This,ChannelType,ppAuthenticatedChannel) )
+
+#define ID3D11VideoDevice_CreateCryptoSession(This,pCryptoType,pDecoderProfile,pKeyExchangeType,ppCryptoSession) \
+ ( (This)->lpVtbl -> CreateCryptoSession(This,pCryptoType,pDecoderProfile,pKeyExchangeType,ppCryptoSession) )
+
+#define ID3D11VideoDevice_CreateVideoDecoderOutputView(This,pResource,pDesc,ppVDOVView) \
+ ( (This)->lpVtbl -> CreateVideoDecoderOutputView(This,pResource,pDesc,ppVDOVView) )
+
+#define ID3D11VideoDevice_CreateVideoProcessorInputView(This,pResource,pEnum,pDesc,ppVPIView) \
+ ( (This)->lpVtbl -> CreateVideoProcessorInputView(This,pResource,pEnum,pDesc,ppVPIView) )
+
+#define ID3D11VideoDevice_CreateVideoProcessorOutputView(This,pResource,pEnum,pDesc,ppVPOView) \
+ ( (This)->lpVtbl -> CreateVideoProcessorOutputView(This,pResource,pEnum,pDesc,ppVPOView) )
+
+#define ID3D11VideoDevice_CreateVideoProcessorEnumerator(This,pDesc,ppEnum) \
+ ( (This)->lpVtbl -> CreateVideoProcessorEnumerator(This,pDesc,ppEnum) )
+
+#define ID3D11VideoDevice_GetVideoDecoderProfileCount(This) \
+ ( (This)->lpVtbl -> GetVideoDecoderProfileCount(This) )
+
+#define ID3D11VideoDevice_GetVideoDecoderProfile(This,Index,pDecoderProfile) \
+ ( (This)->lpVtbl -> GetVideoDecoderProfile(This,Index,pDecoderProfile) )
+
+#define ID3D11VideoDevice_CheckVideoDecoderFormat(This,pDecoderProfile,Format,pSupported) \
+ ( (This)->lpVtbl -> CheckVideoDecoderFormat(This,pDecoderProfile,Format,pSupported) )
+
+#define ID3D11VideoDevice_GetVideoDecoderConfigCount(This,pDesc,pCount) \
+ ( (This)->lpVtbl -> GetVideoDecoderConfigCount(This,pDesc,pCount) )
+
+#define ID3D11VideoDevice_GetVideoDecoderConfig(This,pDesc,Index,pConfig) \
+ ( (This)->lpVtbl -> GetVideoDecoderConfig(This,pDesc,Index,pConfig) )
+
+#define ID3D11VideoDevice_GetContentProtectionCaps(This,pCryptoType,pDecoderProfile,pCaps) \
+ ( (This)->lpVtbl -> GetContentProtectionCaps(This,pCryptoType,pDecoderProfile,pCaps) )
+
+#define ID3D11VideoDevice_CheckCryptoKeyExchange(This,pCryptoType,pDecoderProfile,Index,pKeyExchangeType) \
+ ( (This)->lpVtbl -> CheckCryptoKeyExchange(This,pCryptoType,pDecoderProfile,Index,pKeyExchangeType) )
+
+#define ID3D11VideoDevice_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoDevice_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoDevice_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_0000_0040 */
+/* [local] */
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0040_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0040_v0_0_s_ifspec;
+
#ifndef __ID3D11Device_INTERFACE_DEFINED__
#define __ID3D11Device_INTERFACE_DEFINED__
@@ -9220,284 +13554,284 @@ EXTERN_C const IID IID_ID3D11Device;
public:
virtual HRESULT STDMETHODCALLTYPE CreateBuffer(
/* [annotation] */
- __in const D3D11_BUFFER_DESC *pDesc,
+ _In_ const D3D11_BUFFER_DESC *pDesc,
/* [annotation] */
- __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_opt_ const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Buffer **ppBuffer) = 0;
+ _COM_Outptr_opt_ ID3D11Buffer **ppBuffer) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture1D(
/* [annotation] */
- __in const D3D11_TEXTURE1D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE1D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture1D **ppTexture1D) = 0;
+ _COM_Outptr_opt_ ID3D11Texture1D **ppTexture1D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture2D(
/* [annotation] */
- __in const D3D11_TEXTURE2D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE2D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture2D **ppTexture2D) = 0;
+ _COM_Outptr_opt_ ID3D11Texture2D **ppTexture2D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateTexture3D(
/* [annotation] */
- __in const D3D11_TEXTURE3D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE3D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture3D **ppTexture3D) = 0;
+ _COM_Outptr_opt_ ID3D11Texture3D **ppTexture3D) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11ShaderResourceView **ppSRView) = 0;
+ _COM_Outptr_opt_ ID3D11ShaderResourceView **ppSRView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11UnorderedAccessView **ppUAView) = 0;
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView **ppUAView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11RenderTargetView **ppRTView) = 0;
+ _COM_Outptr_opt_ ID3D11RenderTargetView **ppRTView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView(
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0;
+ _COM_Outptr_opt_ ID3D11DepthStencilView **ppDepthStencilView) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateInputLayout(
/* [annotation] */
- __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ _In_reads_(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
/* [annotation] */
- __in const void *pShaderBytecodeWithInputSignature,
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D11InputLayout **ppInputLayout) = 0;
+ _COM_Outptr_opt_ ID3D11InputLayout **ppInputLayout) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateVertexShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11VertexShader **ppVertexShader) = 0;
+ _COM_Outptr_opt_ ID3D11VertexShader **ppVertexShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11GeometryShader **ppGeometryShader) = 0;
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ _In_reads_opt_(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
/* [annotation] */
- __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
+ _In_range_( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
/* [annotation] */
- __in_ecount_opt(NumStrides) const UINT *pBufferStrides,
+ _In_reads_opt_(NumStrides) const UINT *pBufferStrides,
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
/* [annotation] */
- __in UINT RasterizedStream,
+ _In_ UINT RasterizedStream,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11GeometryShader **ppGeometryShader) = 0;
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreatePixelShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11PixelShader **ppPixelShader) = 0;
+ _COM_Outptr_opt_ ID3D11PixelShader **ppPixelShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateHullShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11HullShader **ppHullShader) = 0;
+ _COM_Outptr_opt_ ID3D11HullShader **ppHullShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDomainShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11DomainShader **ppDomainShader) = 0;
+ _COM_Outptr_opt_ ID3D11DomainShader **ppDomainShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateComputeShader(
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11ComputeShader **ppComputeShader) = 0;
+ _COM_Outptr_opt_ ID3D11ComputeShader **ppComputeShader) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage(
/* [annotation] */
- __out ID3D11ClassLinkage **ppLinkage) = 0;
+ _COM_Outptr_ ID3D11ClassLinkage **ppLinkage) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateBlendState(
/* [annotation] */
- __in const D3D11_BLEND_DESC *pBlendStateDesc,
+ _In_ const D3D11_BLEND_DESC *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D11BlendState **ppBlendState) = 0;
+ _COM_Outptr_opt_ ID3D11BlendState **ppBlendState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState(
/* [annotation] */
- __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ _In_ const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
/* [annotation] */
- __out_opt ID3D11DepthStencilState **ppDepthStencilState) = 0;
+ _COM_Outptr_opt_ ID3D11DepthStencilState **ppDepthStencilState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState(
/* [annotation] */
- __in const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ _In_ const D3D11_RASTERIZER_DESC *pRasterizerDesc,
/* [annotation] */
- __out_opt ID3D11RasterizerState **ppRasterizerState) = 0;
+ _COM_Outptr_opt_ ID3D11RasterizerState **ppRasterizerState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSamplerState(
/* [annotation] */
- __in const D3D11_SAMPLER_DESC *pSamplerDesc,
+ _In_ const D3D11_SAMPLER_DESC *pSamplerDesc,
/* [annotation] */
- __out_opt ID3D11SamplerState **ppSamplerState) = 0;
+ _COM_Outptr_opt_ ID3D11SamplerState **ppSamplerState) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateQuery(
/* [annotation] */
- __in const D3D11_QUERY_DESC *pQueryDesc,
+ _In_ const D3D11_QUERY_DESC *pQueryDesc,
/* [annotation] */
- __out_opt ID3D11Query **ppQuery) = 0;
+ _COM_Outptr_opt_ ID3D11Query **ppQuery) = 0;
virtual HRESULT STDMETHODCALLTYPE CreatePredicate(
/* [annotation] */
- __in const D3D11_QUERY_DESC *pPredicateDesc,
+ _In_ const D3D11_QUERY_DESC *pPredicateDesc,
/* [annotation] */
- __out_opt ID3D11Predicate **ppPredicate) = 0;
+ _COM_Outptr_opt_ ID3D11Predicate **ppPredicate) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateCounter(
/* [annotation] */
- __in const D3D11_COUNTER_DESC *pCounterDesc,
+ _In_ const D3D11_COUNTER_DESC *pCounterDesc,
/* [annotation] */
- __out_opt ID3D11Counter **ppCounter) = 0;
+ _COM_Outptr_opt_ ID3D11Counter **ppCounter) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext(
UINT ContextFlags,
/* [annotation] */
- __out_opt ID3D11DeviceContext **ppDeferredContext) = 0;
+ _COM_Outptr_opt_ ID3D11DeviceContext **ppDeferredContext) = 0;
virtual HRESULT STDMETHODCALLTYPE OpenSharedResource(
/* [annotation] */
- __in HANDLE hResource,
+ _In_ HANDLE hResource,
/* [annotation] */
- __in REFIID ReturnedInterface,
+ _In_ REFIID ReturnedInterface,
/* [annotation] */
- __out_opt void **ppResource) = 0;
+ _COM_Outptr_opt_ void **ppResource) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport(
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __out UINT *pFormatSupport) = 0;
+ _Out_ UINT *pFormatSupport) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels(
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT SampleCount,
+ _In_ UINT SampleCount,
/* [annotation] */
- __out UINT *pNumQualityLevels) = 0;
+ _Out_ UINT *pNumQualityLevels) = 0;
virtual void STDMETHODCALLTYPE CheckCounterInfo(
/* [annotation] */
- __out D3D11_COUNTER_INFO *pCounterInfo) = 0;
+ _Out_ D3D11_COUNTER_INFO *pCounterInfo) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckCounter(
/* [annotation] */
- __in const D3D11_COUNTER_DESC *pDesc,
+ _In_ const D3D11_COUNTER_DESC *pDesc,
/* [annotation] */
- __out D3D11_COUNTER_TYPE *pType,
+ _Out_ D3D11_COUNTER_TYPE *pType,
/* [annotation] */
- __out UINT *pActiveCounters,
+ _Out_ UINT *pActiveCounters,
/* [annotation] */
- __out_ecount_opt(*pNameLength) LPSTR szName,
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
/* [annotation] */
- __inout_opt UINT *pNameLength,
+ _Inout_opt_ UINT *pNameLength,
/* [annotation] */
- __out_ecount_opt(*pUnitsLength) LPSTR szUnits,
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
/* [annotation] */
- __inout_opt UINT *pUnitsLength,
+ _Inout_opt_ UINT *pUnitsLength,
/* [annotation] */
- __out_ecount_opt(*pDescriptionLength) LPSTR szDescription,
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
/* [annotation] */
- __inout_opt UINT *pDescriptionLength) = 0;
+ _Inout_opt_ UINT *pDescriptionLength) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
D3D11_FEATURE Feature,
/* [annotation] */
- __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData,
+ _Out_writes_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData) = 0;
+ _Out_writes_bytes_opt_(*pDataSize) void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData) = 0;
+ _In_reads_bytes_opt_(DataSize) const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData) = 0;
+ _In_opt_ const IUnknown *pData) = 0;
virtual D3D_FEATURE_LEVEL STDMETHODCALLTYPE GetFeatureLevel( void) = 0;
@@ -9507,7 +13841,7 @@ EXTERN_C const IID IID_ID3D11Device;
virtual void STDMETHODCALLTYPE GetImmediateContext(
/* [annotation] */
- __out ID3D11DeviceContext **ppImmediateContext) = 0;
+ _Outptr_ ID3D11DeviceContext **ppImmediateContext) = 0;
virtual HRESULT STDMETHODCALLTYPE SetExceptionMode(
UINT RaiseFlags) = 0;
@@ -9516,6 +13850,7 @@ EXTERN_C const IID IID_ID3D11Device;
};
+
#else /* C style interface */
typedef struct ID3D11DeviceVtbl
@@ -9526,7 +13861,7 @@ EXTERN_C const IID IID_ID3D11Device;
ID3D11Device * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D11Device * This);
@@ -9537,317 +13872,317 @@ EXTERN_C const IID IID_ID3D11Device;
HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_BUFFER_DESC *pDesc,
+ _In_ const D3D11_BUFFER_DESC *pDesc,
/* [annotation] */
- __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_opt_ const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Buffer **ppBuffer);
+ _COM_Outptr_opt_ ID3D11Buffer **ppBuffer);
HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_TEXTURE1D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE1D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture1D **ppTexture1D);
+ _COM_Outptr_opt_ ID3D11Texture1D **ppTexture1D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_TEXTURE2D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE2D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture2D **ppTexture2D);
+ _COM_Outptr_opt_ ID3D11Texture2D **ppTexture2D);
HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_TEXTURE3D_DESC *pDesc,
+ _In_ const D3D11_TEXTURE3D_DESC *pDesc,
/* [annotation] */
- __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
/* [annotation] */
- __out_opt ID3D11Texture3D **ppTexture3D);
+ _COM_Outptr_opt_ ID3D11Texture3D **ppTexture3D);
HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D11Device * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11ShaderResourceView **ppSRView);
+ _COM_Outptr_opt_ ID3D11ShaderResourceView **ppSRView);
HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D11Device * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11UnorderedAccessView **ppUAView);
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView **ppUAView);
HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D11Device * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11RenderTargetView **ppRTView);
+ _COM_Outptr_opt_ ID3D11RenderTargetView **ppRTView);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D11Device * This,
/* [annotation] */
- __in ID3D11Resource *pResource,
+ _In_ ID3D11Resource *pResource,
/* [annotation] */
- __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_opt_ const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
/* [annotation] */
- __out_opt ID3D11DepthStencilView **ppDepthStencilView);
+ _COM_Outptr_opt_ ID3D11DepthStencilView **ppDepthStencilView);
HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
ID3D11Device * This,
/* [annotation] */
- __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ _In_reads_(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
/* [annotation] */
- __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
/* [annotation] */
- __in const void *pShaderBytecodeWithInputSignature,
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __out_opt ID3D11InputLayout **ppInputLayout);
+ _COM_Outptr_opt_ ID3D11InputLayout **ppInputLayout);
HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11VertexShader **ppVertexShader);
+ _COM_Outptr_opt_ ID3D11VertexShader **ppVertexShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11GeometryShader **ppGeometryShader);
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ _In_reads_opt_(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
/* [annotation] */
- __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
+ _In_range_( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
/* [annotation] */
- __in_ecount_opt(NumStrides) const UINT *pBufferStrides,
+ _In_reads_opt_(NumStrides) const UINT *pBufferStrides,
/* [annotation] */
- __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
/* [annotation] */
- __in UINT RasterizedStream,
+ _In_ UINT RasterizedStream,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11GeometryShader **ppGeometryShader);
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11PixelShader **ppPixelShader);
+ _COM_Outptr_opt_ ID3D11PixelShader **ppPixelShader);
HRESULT ( STDMETHODCALLTYPE *CreateHullShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11HullShader **ppHullShader);
+ _COM_Outptr_opt_ ID3D11HullShader **ppHullShader);
HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11DomainShader **ppDomainShader);
+ _COM_Outptr_opt_ ID3D11DomainShader **ppDomainShader);
HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )(
ID3D11Device * This,
/* [annotation] */
- __in const void *pShaderBytecode,
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
/* [annotation] */
- __in SIZE_T BytecodeLength,
+ _In_ SIZE_T BytecodeLength,
/* [annotation] */
- __in_opt ID3D11ClassLinkage *pClassLinkage,
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
/* [annotation] */
- __out_opt ID3D11ComputeShader **ppComputeShader);
+ _COM_Outptr_opt_ ID3D11ComputeShader **ppComputeShader);
HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )(
ID3D11Device * This,
/* [annotation] */
- __out ID3D11ClassLinkage **ppLinkage);
+ _COM_Outptr_ ID3D11ClassLinkage **ppLinkage);
HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_BLEND_DESC *pBlendStateDesc,
+ _In_ const D3D11_BLEND_DESC *pBlendStateDesc,
/* [annotation] */
- __out_opt ID3D11BlendState **ppBlendState);
+ _COM_Outptr_opt_ ID3D11BlendState **ppBlendState);
HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ _In_ const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
/* [annotation] */
- __out_opt ID3D11DepthStencilState **ppDepthStencilState);
+ _COM_Outptr_opt_ ID3D11DepthStencilState **ppDepthStencilState);
HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ _In_ const D3D11_RASTERIZER_DESC *pRasterizerDesc,
/* [annotation] */
- __out_opt ID3D11RasterizerState **ppRasterizerState);
+ _COM_Outptr_opt_ ID3D11RasterizerState **ppRasterizerState);
HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_SAMPLER_DESC *pSamplerDesc,
+ _In_ const D3D11_SAMPLER_DESC *pSamplerDesc,
/* [annotation] */
- __out_opt ID3D11SamplerState **ppSamplerState);
+ _COM_Outptr_opt_ ID3D11SamplerState **ppSamplerState);
HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_QUERY_DESC *pQueryDesc,
+ _In_ const D3D11_QUERY_DESC *pQueryDesc,
/* [annotation] */
- __out_opt ID3D11Query **ppQuery);
+ _COM_Outptr_opt_ ID3D11Query **ppQuery);
HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_QUERY_DESC *pPredicateDesc,
+ _In_ const D3D11_QUERY_DESC *pPredicateDesc,
/* [annotation] */
- __out_opt ID3D11Predicate **ppPredicate);
+ _COM_Outptr_opt_ ID3D11Predicate **ppPredicate);
HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_COUNTER_DESC *pCounterDesc,
+ _In_ const D3D11_COUNTER_DESC *pCounterDesc,
/* [annotation] */
- __out_opt ID3D11Counter **ppCounter);
+ _COM_Outptr_opt_ ID3D11Counter **ppCounter);
HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )(
ID3D11Device * This,
UINT ContextFlags,
/* [annotation] */
- __out_opt ID3D11DeviceContext **ppDeferredContext);
+ _COM_Outptr_opt_ ID3D11DeviceContext **ppDeferredContext);
HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
ID3D11Device * This,
/* [annotation] */
- __in HANDLE hResource,
+ _In_ HANDLE hResource,
/* [annotation] */
- __in REFIID ReturnedInterface,
+ _In_ REFIID ReturnedInterface,
/* [annotation] */
- __out_opt void **ppResource);
+ _COM_Outptr_opt_ void **ppResource);
HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
ID3D11Device * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __out UINT *pFormatSupport);
+ _Out_ UINT *pFormatSupport);
HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
ID3D11Device * This,
/* [annotation] */
- __in DXGI_FORMAT Format,
+ _In_ DXGI_FORMAT Format,
/* [annotation] */
- __in UINT SampleCount,
+ _In_ UINT SampleCount,
/* [annotation] */
- __out UINT *pNumQualityLevels);
+ _Out_ UINT *pNumQualityLevels);
void ( STDMETHODCALLTYPE *CheckCounterInfo )(
ID3D11Device * This,
/* [annotation] */
- __out D3D11_COUNTER_INFO *pCounterInfo);
+ _Out_ D3D11_COUNTER_INFO *pCounterInfo);
HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
ID3D11Device * This,
/* [annotation] */
- __in const D3D11_COUNTER_DESC *pDesc,
+ _In_ const D3D11_COUNTER_DESC *pDesc,
/* [annotation] */
- __out D3D11_COUNTER_TYPE *pType,
+ _Out_ D3D11_COUNTER_TYPE *pType,
/* [annotation] */
- __out UINT *pActiveCounters,
+ _Out_ UINT *pActiveCounters,
/* [annotation] */
- __out_ecount_opt(*pNameLength) LPSTR szName,
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
/* [annotation] */
- __inout_opt UINT *pNameLength,
+ _Inout_opt_ UINT *pNameLength,
/* [annotation] */
- __out_ecount_opt(*pUnitsLength) LPSTR szUnits,
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
/* [annotation] */
- __inout_opt UINT *pUnitsLength,
+ _Inout_opt_ UINT *pUnitsLength,
/* [annotation] */
- __out_ecount_opt(*pDescriptionLength) LPSTR szDescription,
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
/* [annotation] */
- __inout_opt UINT *pDescriptionLength);
+ _Inout_opt_ UINT *pDescriptionLength);
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D11Device * This,
D3D11_FEATURE Feature,
/* [annotation] */
- __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData,
+ _Out_writes_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D11Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation] */
- __out_bcount_opt(*pDataSize) void *pData);
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D11Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in UINT DataSize,
+ _In_ UINT DataSize,
/* [annotation] */
- __in_bcount_opt(DataSize) const void *pData);
+ _In_reads_bytes_opt_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D11Device * This,
/* [annotation] */
- __in REFGUID guid,
+ _In_ REFGUID guid,
/* [annotation] */
- __in_opt const IUnknown *pData);
+ _In_opt_ const IUnknown *pData);
D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )(
ID3D11Device * This);
@@ -9861,7 +14196,7 @@ EXTERN_C const IID IID_ID3D11Device;
void ( STDMETHODCALLTYPE *GetImmediateContext )(
ID3D11Device * This,
/* [annotation] */
- __out ID3D11DeviceContext **ppImmediateContext);
+ _Outptr_ ID3D11DeviceContext **ppImmediateContext);
HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )(
ID3D11Device * This,
@@ -10024,28 +14359,33 @@ EXTERN_C const IID IID_ID3D11Device;
#endif /* __ID3D11Device_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d11_0000_0031 */
+/* interface __MIDL_itf_d3d11_0000_0041 */
/* [local] */
typedef
enum D3D11_CREATE_DEVICE_FLAG
- { D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1,
- D3D11_CREATE_DEVICE_DEBUG = 0x2,
- D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
- D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8,
- D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20
+ {
+ D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1,
+ D3D11_CREATE_DEVICE_DEBUG = 0x2,
+ D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
+ D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8,
+ D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20,
+ D3D11_CREATE_DEVICE_DEBUGGABLE = 0x40,
+ D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80,
+ D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x100,
+ D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x800
} D3D11_CREATE_DEVICE_FLAG;
#define D3D11_SDK_VERSION ( 7 )
-#include "d3d10_1.h"
#if !defined( D3D11_IGNORE_SDK_LAYERS )
#include "d3d11sdklayers.h"
#endif
-#include "d3d10misc.h"
+#include "d3d10_1.h"
#include "d3d10shader.h"
-#include "d3d10effect.h"
#include "d3d10_1shader.h"
+#include "d3d10misc.h"
+#include "d3d10effect.h"
///////////////////////////////////////////////////////////////////////////
// D3D11CreateDevice
@@ -10086,23 +14426,23 @@ enum D3D11_CREATE_DEVICE_FLAG
// D3D11CreateDevice
//
///////////////////////////////////////////////////////////////////////////
-typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)( __in_opt IDXGIAdapter*,
+typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)( _In_opt_ IDXGIAdapter*,
D3D_DRIVER_TYPE, HMODULE, UINT,
- __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*,
- UINT FeatureLevels, UINT, __out_opt ID3D11Device**,
- __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** );
+ _In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL*,
+ UINT FeatureLevels, UINT, _COM_Outptr_opt_ ID3D11Device**,
+ _Out_opt_ D3D_FEATURE_LEVEL*, _COM_Outptr_opt_ ID3D11DeviceContext** );
HRESULT WINAPI D3D11CreateDevice(
- __in_opt IDXGIAdapter* pAdapter,
+ _In_opt_ IDXGIAdapter* pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
- __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
+ _In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
- __out_opt ID3D11Device** ppDevice,
- __out_opt D3D_FEATURE_LEVEL* pFeatureLevel,
- __out_opt ID3D11DeviceContext** ppImmediateContext );
+ _COM_Outptr_opt_ ID3D11Device** ppDevice,
+ _Out_opt_ D3D_FEATURE_LEVEL* pFeatureLevel,
+ _COM_Outptr_opt_ ID3D11DeviceContext** ppImmediateContext );
///////////////////////////////////////////////////////////////////////////
// D3D11CreateDeviceAndSwapChain
@@ -10157,26 +14497,26 @@ HRESULT WINAPI D3D11CreateDevice(
// IDXGIFactory::CreateSwapChain
//
///////////////////////////////////////////////////////////////////////////
-typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)( __in_opt IDXGIAdapter*,
+typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)( _In_opt_ IDXGIAdapter*,
D3D_DRIVER_TYPE, HMODULE, UINT,
- __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*,
- UINT FeatureLevels, UINT, __in_opt CONST DXGI_SWAP_CHAIN_DESC*,
- __out_opt IDXGISwapChain**, __out_opt ID3D11Device**,
- __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** );
+ _In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL*,
+ UINT FeatureLevels, UINT, _In_opt_ CONST DXGI_SWAP_CHAIN_DESC*,
+ _COM_Outptr_opt_ IDXGISwapChain**, _COM_Outptr_opt_ ID3D11Device**,
+ _Out_opt_ D3D_FEATURE_LEVEL*, _COM_Outptr_opt_ ID3D11DeviceContext** );
HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
- __in_opt IDXGIAdapter* pAdapter,
+ _In_opt_ IDXGIAdapter* pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
- __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
+ _In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
- __in_opt CONST DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
- __out_opt IDXGISwapChain** ppSwapChain,
- __out_opt ID3D11Device** ppDevice,
- __out_opt D3D_FEATURE_LEVEL* pFeatureLevel,
- __out_opt ID3D11DeviceContext** ppImmediateContext );
+ _In_opt_ CONST DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
+ _COM_Outptr_opt_ IDXGISwapChain** ppSwapChain,
+ _COM_Outptr_opt_ ID3D11Device** ppDevice,
+ _Out_opt_ D3D_FEATURE_LEVEL* pFeatureLevel,
+ _COM_Outptr_opt_ ID3D11DeviceContext** ppImmediateContext );
DEFINE_GUID(IID_ID3D11DeviceChild,0x1841e5c8,0x16b0,0x489b,0xbc,0xc8,0x44,0xcf,0xb0,0xd5,0xde,0xae);
DEFINE_GUID(IID_ID3D11DepthStencilState,0x03823efb,0x8d8f,0x4e1c,0x9a,0xa2,0xf6,0x4b,0xb2,0xcb,0xfd,0xf1);
@@ -10208,11 +14548,21 @@ DEFINE_GUID(IID_ID3D11ClassInstance,0xa6cd7faa,0xb0b7,0x4a2f,0x94,0x36,0x86,0x62
DEFINE_GUID(IID_ID3D11ClassLinkage,0xddf57cba,0x9543,0x46e4,0xa1,0x2b,0xf2,0x07,0xa0,0xfe,0x7f,0xed);
DEFINE_GUID(IID_ID3D11CommandList,0xa24bc4d1,0x769e,0x43f7,0x80,0x13,0x98,0xff,0x56,0x6c,0x18,0xe2);
DEFINE_GUID(IID_ID3D11DeviceContext,0xc0bfa96c,0xe089,0x44fb,0x8e,0xaf,0x26,0xf8,0x79,0x61,0x90,0xda);
+DEFINE_GUID(IID_ID3D11VideoDecoder,0x3C9C5B51,0x995D,0x48d1,0x9B,0x8D,0xFA,0x5C,0xAE,0xDE,0xD6,0x5C);
+DEFINE_GUID(IID_ID3D11VideoProcessorEnumerator,0x31627037,0x53AB,0x4200,0x90,0x61,0x05,0xFA,0xA9,0xAB,0x45,0xF9);
+DEFINE_GUID(IID_ID3D11VideoProcessor,0x1D7B0652,0x185F,0x41c6,0x85,0xCE,0x0C,0x5B,0xE3,0xD4,0xAE,0x6C);
+DEFINE_GUID(IID_ID3D11AuthenticatedChannel,0x3015A308,0xDCBD,0x47aa,0xA7,0x47,0x19,0x24,0x86,0xD1,0x4D,0x4A);
+DEFINE_GUID(IID_ID3D11CryptoSession,0x9B32F9AD,0xBDCC,0x40a6,0xA3,0x9D,0xD5,0xC8,0x65,0x84,0x57,0x20);
+DEFINE_GUID(IID_ID3D11VideoDecoderOutputView,0xC2931AEA,0x2A85,0x4f20,0x86,0x0F,0xFB,0xA1,0xFD,0x25,0x6E,0x18);
+DEFINE_GUID(IID_ID3D11VideoProcessorInputView,0x11EC5A5F,0x51DC,0x4945,0xAB,0x34,0x6E,0x8C,0x21,0x30,0x0E,0xA5);
+DEFINE_GUID(IID_ID3D11VideoProcessorOutputView,0xA048285E,0x25A9,0x4527,0xBD,0x93,0xD6,0x8B,0x68,0xC4,0x42,0x54);
+DEFINE_GUID(IID_ID3D11VideoContext,0x61F21C45,0x3C0E,0x4a74,0x9C,0xEA,0x67,0x10,0x0D,0x9A,0xD5,0xE4);
+DEFINE_GUID(IID_ID3D11VideoDevice,0x10EC4D5B,0x975A,0x4689,0xB9,0xE4,0xD0,0xAA,0xC3,0x0F,0xE3,0x33);
DEFINE_GUID(IID_ID3D11Device,0xdb6f6ddb,0xac77,0x4e88,0x82,0x53,0x81,0x9d,0xf9,0xbb,0xf1,0x40);
-extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0041_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0041_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h
new file mode 100644
index 00000000000..5ad94f83b8b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h
@@ -0,0 +1,5222 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d11_1_h__
+#define __d3d11_1_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D11BlendState1_FWD_DEFINED__
+#define __ID3D11BlendState1_FWD_DEFINED__
+typedef interface ID3D11BlendState1 ID3D11BlendState1;
+
+#endif /* __ID3D11BlendState1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11RasterizerState1_FWD_DEFINED__
+#define __ID3D11RasterizerState1_FWD_DEFINED__
+typedef interface ID3D11RasterizerState1 ID3D11RasterizerState1;
+
+#endif /* __ID3D11RasterizerState1_FWD_DEFINED__ */
+
+
+#ifndef __ID3DDeviceContextState_FWD_DEFINED__
+#define __ID3DDeviceContextState_FWD_DEFINED__
+typedef interface ID3DDeviceContextState ID3DDeviceContextState;
+
+#endif /* __ID3DDeviceContextState_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11DeviceContext1_FWD_DEFINED__
+#define __ID3D11DeviceContext1_FWD_DEFINED__
+typedef interface ID3D11DeviceContext1 ID3D11DeviceContext1;
+
+#endif /* __ID3D11DeviceContext1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoContext1_FWD_DEFINED__
+#define __ID3D11VideoContext1_FWD_DEFINED__
+typedef interface ID3D11VideoContext1 ID3D11VideoContext1;
+
+#endif /* __ID3D11VideoContext1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoDevice1_FWD_DEFINED__
+#define __ID3D11VideoDevice1_FWD_DEFINED__
+typedef interface ID3D11VideoDevice1 ID3D11VideoDevice1;
+
+#endif /* __ID3D11VideoDevice1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessorEnumerator1_FWD_DEFINED__
+#define __ID3D11VideoProcessorEnumerator1_FWD_DEFINED__
+typedef interface ID3D11VideoProcessorEnumerator1 ID3D11VideoProcessorEnumerator1;
+
+#endif /* __ID3D11VideoProcessorEnumerator1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11Device1_FWD_DEFINED__
+#define __ID3D11Device1_FWD_DEFINED__
+typedef interface ID3D11Device1 ID3D11Device1;
+
+#endif /* __ID3D11Device1_FWD_DEFINED__ */
+
+
+#ifndef __ID3DUserDefinedAnnotation_FWD_DEFINED__
+#define __ID3DUserDefinedAnnotation_FWD_DEFINED__
+typedef interface ID3DUserDefinedAnnotation ID3DUserDefinedAnnotation;
+
+#endif /* __ID3DUserDefinedAnnotation_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgi1_2.h"
+#include "d3dcommon.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d11_1_0000_0000 */
+/* [local] */
+
+#ifdef __cplusplus
+}
+#endif
+#include "d3d11.h" //
+#ifdef __cplusplus
+extern "C"{
+#endif
+typedef
+enum D3D11_COPY_FLAGS
+ {
+ D3D11_COPY_NO_OVERWRITE = 0x1,
+ D3D11_COPY_DISCARD = 0x2
+ } D3D11_COPY_FLAGS;
+
+typedef
+enum D3D11_LOGIC_OP
+ {
+ D3D11_LOGIC_OP_CLEAR = 0,
+ D3D11_LOGIC_OP_SET = ( D3D11_LOGIC_OP_CLEAR + 1 ) ,
+ D3D11_LOGIC_OP_COPY = ( D3D11_LOGIC_OP_SET + 1 ) ,
+ D3D11_LOGIC_OP_COPY_INVERTED = ( D3D11_LOGIC_OP_COPY + 1 ) ,
+ D3D11_LOGIC_OP_NOOP = ( D3D11_LOGIC_OP_COPY_INVERTED + 1 ) ,
+ D3D11_LOGIC_OP_INVERT = ( D3D11_LOGIC_OP_NOOP + 1 ) ,
+ D3D11_LOGIC_OP_AND = ( D3D11_LOGIC_OP_INVERT + 1 ) ,
+ D3D11_LOGIC_OP_NAND = ( D3D11_LOGIC_OP_AND + 1 ) ,
+ D3D11_LOGIC_OP_OR = ( D3D11_LOGIC_OP_NAND + 1 ) ,
+ D3D11_LOGIC_OP_NOR = ( D3D11_LOGIC_OP_OR + 1 ) ,
+ D3D11_LOGIC_OP_XOR = ( D3D11_LOGIC_OP_NOR + 1 ) ,
+ D3D11_LOGIC_OP_EQUIV = ( D3D11_LOGIC_OP_XOR + 1 ) ,
+ D3D11_LOGIC_OP_AND_REVERSE = ( D3D11_LOGIC_OP_EQUIV + 1 ) ,
+ D3D11_LOGIC_OP_AND_INVERTED = ( D3D11_LOGIC_OP_AND_REVERSE + 1 ) ,
+ D3D11_LOGIC_OP_OR_REVERSE = ( D3D11_LOGIC_OP_AND_INVERTED + 1 ) ,
+ D3D11_LOGIC_OP_OR_INVERTED = ( D3D11_LOGIC_OP_OR_REVERSE + 1 )
+ } D3D11_LOGIC_OP;
+
+typedef struct D3D11_RENDER_TARGET_BLEND_DESC1
+ {
+ BOOL BlendEnable;
+ BOOL LogicOpEnable;
+ D3D11_BLEND SrcBlend;
+ D3D11_BLEND DestBlend;
+ D3D11_BLEND_OP BlendOp;
+ D3D11_BLEND SrcBlendAlpha;
+ D3D11_BLEND DestBlendAlpha;
+ D3D11_BLEND_OP BlendOpAlpha;
+ D3D11_LOGIC_OP LogicOp;
+ UINT8 RenderTargetWriteMask;
+ } D3D11_RENDER_TARGET_BLEND_DESC1;
+
+typedef struct D3D11_BLEND_DESC1
+ {
+ BOOL AlphaToCoverageEnable;
+ BOOL IndependentBlendEnable;
+ D3D11_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ];
+ } D3D11_BLEND_DESC1;
+
+/* Note, the array size for RenderTarget[] above is D3D11_SIMULTANEOUS_RENDERTARGET_COUNT.
+ IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_BLEND_DESC1 : public D3D11_BLEND_DESC1
+{
+ CD3D11_BLEND_DESC1()
+ {}
+ explicit CD3D11_BLEND_DESC1( const D3D11_BLEND_DESC1& o ) :
+ D3D11_BLEND_DESC1( o )
+ {}
+ explicit CD3D11_BLEND_DESC1( CD3D11_DEFAULT )
+ {
+ AlphaToCoverageEnable = FALSE;
+ IndependentBlendEnable = FALSE;
+ const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc =
+ {
+ FALSE,FALSE,
+ D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
+ D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD,
+ D3D11_LOGIC_OP_NOOP,
+ D3D11_COLOR_WRITE_ENABLE_ALL,
+ };
+ for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
+ RenderTarget[ i ] = defaultRenderTargetBlendDesc;
+ }
+ ~CD3D11_BLEND_DESC1() {}
+ operator const D3D11_BLEND_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D11BlendState1_INTERFACE_DEFINED__
+#define __ID3D11BlendState1_INTERFACE_DEFINED__
+
+/* interface ID3D11BlendState1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11BlendState1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("cc86fabe-da55-401d-85e7-e3c9de2877e9")
+ ID3D11BlendState1 : public ID3D11BlendState
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_BLEND_DESC1 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11BlendState1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11BlendState1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11BlendState1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11BlendState1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _Out_ D3D11_BLEND_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11BlendState1 * This,
+ /* [annotation] */
+ _Out_ D3D11_BLEND_DESC1 *pDesc);
+
+ END_INTERFACE
+ } ID3D11BlendState1Vtbl;
+
+ interface ID3D11BlendState1
+ {
+ CONST_VTBL struct ID3D11BlendState1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11BlendState1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11BlendState1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11BlendState1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11BlendState1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11BlendState1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11BlendState1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11BlendState1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11BlendState1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11BlendState1_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11BlendState1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_1_0000_0001 */
+/* [local] */
+
+typedef struct D3D11_RASTERIZER_DESC1
+ {
+ D3D11_FILL_MODE FillMode;
+ D3D11_CULL_MODE CullMode;
+ BOOL FrontCounterClockwise;
+ INT DepthBias;
+ FLOAT DepthBiasClamp;
+ FLOAT SlopeScaledDepthBias;
+ BOOL DepthClipEnable;
+ BOOL ScissorEnable;
+ BOOL MultisampleEnable;
+ BOOL AntialiasedLineEnable;
+ UINT ForcedSampleCount;
+ } D3D11_RASTERIZER_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_RASTERIZER_DESC1 : public D3D11_RASTERIZER_DESC1
+{
+ CD3D11_RASTERIZER_DESC1()
+ {}
+ explicit CD3D11_RASTERIZER_DESC1( const D3D11_RASTERIZER_DESC1& o ) :
+ D3D11_RASTERIZER_DESC1( o )
+ {}
+ explicit CD3D11_RASTERIZER_DESC1( CD3D11_DEFAULT )
+ {
+ FillMode = D3D11_FILL_SOLID;
+ CullMode = D3D11_CULL_BACK;
+ FrontCounterClockwise = FALSE;
+ DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
+ DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
+ SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
+ DepthClipEnable = TRUE;
+ ScissorEnable = FALSE;
+ MultisampleEnable = FALSE;
+ AntialiasedLineEnable = FALSE;
+ ForcedSampleCount = 0;
+ }
+ explicit CD3D11_RASTERIZER_DESC1(
+ D3D11_FILL_MODE fillMode,
+ D3D11_CULL_MODE cullMode,
+ BOOL frontCounterClockwise,
+ INT depthBias,
+ FLOAT depthBiasClamp,
+ FLOAT slopeScaledDepthBias,
+ BOOL depthClipEnable,
+ BOOL scissorEnable,
+ BOOL multisampleEnable,
+ BOOL antialiasedLineEnable,
+ UINT forcedSampleCount )
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ ScissorEnable = scissorEnable;
+ MultisampleEnable = multisampleEnable;
+ AntialiasedLineEnable = antialiasedLineEnable;
+ ForcedSampleCount = forcedSampleCount;
+ }
+ ~CD3D11_RASTERIZER_DESC1() {}
+ operator const D3D11_RASTERIZER_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D11RasterizerState1_INTERFACE_DEFINED__
+#define __ID3D11RasterizerState1_INTERFACE_DEFINED__
+
+/* interface ID3D11RasterizerState1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11RasterizerState1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1217d7a6-5039-418c-b042-9cbe256afd6e")
+ ID3D11RasterizerState1 : public ID3D11RasterizerState
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC1 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11RasterizerState1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11RasterizerState1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11RasterizerState1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11RasterizerState1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11RasterizerState1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC1 *pDesc);
+
+ END_INTERFACE
+ } ID3D11RasterizerState1Vtbl;
+
+ interface ID3D11RasterizerState1
+ {
+ CONST_VTBL struct ID3D11RasterizerState1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11RasterizerState1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11RasterizerState1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11RasterizerState1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11RasterizerState1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11RasterizerState1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11RasterizerState1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11RasterizerState1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11RasterizerState1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11RasterizerState1_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11RasterizerState1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_1_0000_0002 */
+/* [local] */
+
+typedef
+enum D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG
+ {
+ D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED = 0x1
+ } D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3DDeviceContextState_INTERFACE_DEFINED__
+#define __ID3DDeviceContextState_INTERFACE_DEFINED__
+
+/* interface ID3DDeviceContextState */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3DDeviceContextState;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5c1e0d8a-7c23-48f9-8c59-a92958ceff11")
+ ID3DDeviceContextState : public ID3D11DeviceChild
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3DDeviceContextStateVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3DDeviceContextState * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3DDeviceContextState * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3DDeviceContextState * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3DDeviceContextState * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3DDeviceContextState * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3DDeviceContextState * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3DDeviceContextState * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ END_INTERFACE
+ } ID3DDeviceContextStateVtbl;
+
+ interface ID3DDeviceContextState
+ {
+ CONST_VTBL struct ID3DDeviceContextStateVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3DDeviceContextState_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3DDeviceContextState_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3DDeviceContextState_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3DDeviceContextState_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3DDeviceContextState_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3DDeviceContextState_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3DDeviceContextState_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3DDeviceContextState_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11DeviceContext1_INTERFACE_DEFINED__
+#define __ID3D11DeviceContext1_INTERFACE_DEFINED__
+
+/* interface ID3D11DeviceContext1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11DeviceContext1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("bb2c6faa-b5fb-4082-8e6b-388b8cfa90e1")
+ ID3D11DeviceContext1 : public ID3D11DeviceContext
+ {
+ public:
+ virtual void STDMETHODCALLTYPE CopySubresourceRegion1(
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox,
+ /* [annotation] */
+ _In_ UINT CopyFlags) = 0;
+
+ virtual void STDMETHODCALLTYPE UpdateSubresource1(
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch,
+ /* [annotation] */
+ _In_ UINT CopyFlags) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardResource(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardView(
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView) = 0;
+
+ virtual void STDMETHODCALLTYPE VSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE HSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE DSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE GSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE PSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE CSSetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE VSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE HSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE DSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE GSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE PSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE CSGetConstantBuffers1(
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants) = 0;
+
+ virtual void STDMETHODCALLTYPE SwapDeviceContextState(
+ /* [annotation] */
+ _In_ ID3DDeviceContextState *pState,
+ /* [annotation] */
+ _Outptr_opt_ ID3DDeviceContextState **ppPreviousState) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearView(
+ /* [annotation] */
+ _In_ ID3D11View *pView,
+ /* [annotation] */
+ _In_ const FLOAT Color[ 4 ],
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRect,
+ UINT NumRects) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardView1(
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects,
+ UINT NumRects) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11DeviceContext1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11DeviceContext1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11DeviceContext1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11DeviceContext1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11PixelShader *pPixelShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11VertexShader *pVertexShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DrawIndexed )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT IndexCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation);
+
+ void ( STDMETHODCALLTYPE *Draw )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT VertexCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation);
+
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource,
+ /* [annotation] */
+ _In_ D3D11_MAP MapType,
+ /* [annotation] */
+ _In_ UINT MapFlags,
+ /* [annotation] */
+ _Out_opt_ D3D11_MAPPED_SUBRESOURCE *pMappedResource);
+
+ void ( STDMETHODCALLTYPE *Unmap )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IASetInputLayout )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11InputLayout *pInputLayout);
+
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pIndexBuffer,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT Offset);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT IndexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT VertexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11GeometryShader *pShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ D3D11_PRIMITIVE_TOPOLOGY Topology);
+
+ void ( STDMETHODCALLTYPE *VSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *Begin )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ void ( STDMETHODCALLTYPE *End )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *GetData )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( DataSize ) void *pData,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ UINT GetDataFlags);
+
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Predicate *pPredicate,
+ /* [annotation] */
+ _In_ BOOL PredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT NumRTVs,
+ /* [annotation] */
+ _In_reads_opt_(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_ UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *OMSetBlendState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11BlendState *pBlendState,
+ /* [annotation] */
+ _In_opt_ const FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _In_ UINT SampleMask);
+
+ void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilState *pDepthStencilState,
+ /* [annotation] */
+ _In_ UINT StencilRef);
+
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppSOTargets,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *DrawAuto )(
+ ID3D11DeviceContext1 * This);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *DrawInstancedIndirect )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountX,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountY,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountZ);
+
+ void ( STDMETHODCALLTYPE *DispatchIndirect )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *RSSetState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11RasterizerState *pRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ /* [annotation] */
+ _In_reads_opt_(NumViewports) const D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox);
+
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch);
+
+ void ( STDMETHODCALLTYPE *CopyStructureCount )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pDstBuffer,
+ /* [annotation] */
+ _In_ UINT DstAlignedByteOffset,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pSrcView);
+
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11RenderTargetView *pRenderTargetView,
+ /* [annotation] */
+ _In_ const FLOAT ColorRGBA[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const UINT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const FLOAT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_ UINT ClearFlags,
+ /* [annotation] */
+ _In_ FLOAT Depth,
+ /* [annotation] */
+ _In_ UINT8 Stencil);
+
+ void ( STDMETHODCALLTYPE *GenerateMips )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11ShaderResourceView *pShaderResourceView);
+
+ void ( STDMETHODCALLTYPE *SetResourceMinLOD )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ FLOAT MinLOD);
+
+ FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format);
+
+ void ( STDMETHODCALLTYPE *ExecuteCommandList )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CommandList *pCommandList,
+ BOOL RestoreContextState);
+
+ void ( STDMETHODCALLTYPE *HSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11HullShader *pHullShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DomainShader *pDomainShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSSetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *CSSetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11ComputeShader *pComputeShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSSetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11PixelShader **ppPixelShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11VertexShader **ppVertexShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IAGetInputLayout )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11InputLayout **ppInputLayout);
+
+ void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppVertexBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Buffer **pIndexBuffer,
+ /* [annotation] */
+ _Out_opt_ DXGI_FORMAT *Format,
+ /* [annotation] */
+ _Out_opt_ UINT *Offset);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11GeometryShader **ppGeometryShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Out_ D3D11_PRIMITIVE_TOPOLOGY *pTopology);
+
+ void ( STDMETHODCALLTYPE *VSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *GetPredication )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Predicate **ppPredicate,
+ /* [annotation] */
+ _Out_opt_ BOOL *pPredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *OMGetBlendState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11BlendState **ppBlendState,
+ /* [annotation] */
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _Out_opt_ UINT *pSampleMask);
+
+ void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilState **ppDepthStencilState,
+ /* [annotation] */
+ _Out_opt_ UINT *pStencilRef);
+
+ void ( STDMETHODCALLTYPE *SOGetTargets )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppSOTargets);
+
+ void ( STDMETHODCALLTYPE *RSGetState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11RasterizerState **ppRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSGetViewports )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumViewports) D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSGetScissorRects )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumRects) D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *HSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11HullShader **ppHullShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11DomainShader **ppDomainShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSGetShaderResources )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *CSGetShader )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11ComputeShader **ppComputeShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSGetSamplers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D11DeviceContext1 * This);
+
+ void ( STDMETHODCALLTYPE *Flush )(
+ ID3D11DeviceContext1 * This);
+
+ D3D11_DEVICE_CONTEXT_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D11DeviceContext1 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetContextFlags )(
+ ID3D11DeviceContext1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *FinishCommandList )(
+ ID3D11DeviceContext1 * This,
+ BOOL RestoreDeferredContextState,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11CommandList **ppCommandList);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *DiscardView )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *SwapDeviceContextState )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3DDeviceContextState *pState,
+ /* [annotation] */
+ _Outptr_opt_ ID3DDeviceContextState **ppPreviousState);
+
+ void ( STDMETHODCALLTYPE *ClearView )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pView,
+ /* [annotation] */
+ _In_ const FLOAT Color[ 4 ],
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRect,
+ UINT NumRects);
+
+ void ( STDMETHODCALLTYPE *DiscardView1 )(
+ ID3D11DeviceContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects,
+ UINT NumRects);
+
+ END_INTERFACE
+ } ID3D11DeviceContext1Vtbl;
+
+ interface ID3D11DeviceContext1
+ {
+ CONST_VTBL struct ID3D11DeviceContext1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11DeviceContext1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11DeviceContext1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11DeviceContext1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11DeviceContext1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11DeviceContext1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11DeviceContext1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11DeviceContext1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11DeviceContext1_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \
+ ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) )
+
+#define ID3D11DeviceContext1_Draw(This,VertexCount,StartVertexLocation) \
+ ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) )
+
+#define ID3D11DeviceContext1_Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) \
+ ( (This)->lpVtbl -> Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) )
+
+#define ID3D11DeviceContext1_Unmap(This,pResource,Subresource) \
+ ( (This)->lpVtbl -> Unmap(This,pResource,Subresource) )
+
+#define ID3D11DeviceContext1_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_IASetInputLayout(This,pInputLayout) \
+ ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) )
+
+#define ID3D11DeviceContext1_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext1_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext1_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_GSSetShader(This,pShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> GSSetShader(This,pShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_IASetPrimitiveTopology(This,Topology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) )
+
+#define ID3D11DeviceContext1_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_Begin(This,pAsync) \
+ ( (This)->lpVtbl -> Begin(This,pAsync) )
+
+#define ID3D11DeviceContext1_End(This,pAsync) \
+ ( (This)->lpVtbl -> End(This,pAsync) )
+
+#define ID3D11DeviceContext1_GetData(This,pAsync,pData,DataSize,GetDataFlags) \
+ ( (This)->lpVtbl -> GetData(This,pAsync,pData,DataSize,GetDataFlags) )
+
+#define ID3D11DeviceContext1_SetPredication(This,pPredicate,PredicateValue) \
+ ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) )
+
+#define ID3D11DeviceContext1_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) )
+
+#define ID3D11DeviceContext1_OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext1_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \
+ ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) )
+
+#define ID3D11DeviceContext1_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \
+ ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) )
+
+#define ID3D11DeviceContext1_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \
+ ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) )
+
+#define ID3D11DeviceContext1_DrawAuto(This) \
+ ( (This)->lpVtbl -> DrawAuto(This) )
+
+#define ID3D11DeviceContext1_DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext1_DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext1_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D11DeviceContext1_DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext1_RSSetState(This,pRasterizerState) \
+ ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) )
+
+#define ID3D11DeviceContext1_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D11DeviceContext1_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D11DeviceContext1_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) )
+
+#define ID3D11DeviceContext1_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D11DeviceContext1_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D11DeviceContext1_CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) \
+ ( (This)->lpVtbl -> CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) )
+
+#define ID3D11DeviceContext1_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) )
+
+#define ID3D11DeviceContext1_ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext1_ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext1_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) )
+
+#define ID3D11DeviceContext1_GenerateMips(This,pShaderResourceView) \
+ ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) )
+
+#define ID3D11DeviceContext1_SetResourceMinLOD(This,pResource,MinLOD) \
+ ( (This)->lpVtbl -> SetResourceMinLOD(This,pResource,MinLOD) )
+
+#define ID3D11DeviceContext1_GetResourceMinLOD(This,pResource) \
+ ( (This)->lpVtbl -> GetResourceMinLOD(This,pResource) )
+
+#define ID3D11DeviceContext1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D11DeviceContext1_ExecuteCommandList(This,pCommandList,RestoreContextState) \
+ ( (This)->lpVtbl -> ExecuteCommandList(This,pCommandList,RestoreContextState) )
+
+#define ID3D11DeviceContext1_HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext1_CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext1_CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_IAGetInputLayout(This,ppInputLayout) \
+ ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) )
+
+#define ID3D11DeviceContext1_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext1_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext1_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_IAGetPrimitiveTopology(This,pTopology) \
+ ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) )
+
+#define ID3D11DeviceContext1_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_GetPredication(This,ppPredicate,pPredicateValue) \
+ ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) )
+
+#define ID3D11DeviceContext1_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \
+ ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) )
+
+#define ID3D11DeviceContext1_OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext1_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \
+ ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) )
+
+#define ID3D11DeviceContext1_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \
+ ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) )
+
+#define ID3D11DeviceContext1_SOGetTargets(This,NumBuffers,ppSOTargets) \
+ ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets) )
+
+#define ID3D11DeviceContext1_RSGetState(This,ppRasterizerState) \
+ ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) )
+
+#define ID3D11DeviceContext1_RSGetViewports(This,pNumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSGetViewports(This,pNumViewports,pViewports) )
+
+#define ID3D11DeviceContext1_RSGetScissorRects(This,pNumRects,pRects) \
+ ( (This)->lpVtbl -> RSGetScissorRects(This,pNumRects,pRects) )
+
+#define ID3D11DeviceContext1_HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext1_CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext1_CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext1_CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext1_CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext1_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D11DeviceContext1_Flush(This) \
+ ( (This)->lpVtbl -> Flush(This) )
+
+#define ID3D11DeviceContext1_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+#define ID3D11DeviceContext1_GetContextFlags(This) \
+ ( (This)->lpVtbl -> GetContextFlags(This) )
+
+#define ID3D11DeviceContext1_FinishCommandList(This,RestoreDeferredContextState,ppCommandList) \
+ ( (This)->lpVtbl -> FinishCommandList(This,RestoreDeferredContextState,ppCommandList) )
+
+
+#define ID3D11DeviceContext1_CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) \
+ ( (This)->lpVtbl -> CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) )
+
+#define ID3D11DeviceContext1_UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) \
+ ( (This)->lpVtbl -> UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) )
+
+#define ID3D11DeviceContext1_DiscardResource(This,pResource) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource) )
+
+#define ID3D11DeviceContext1_DiscardView(This,pResourceView) \
+ ( (This)->lpVtbl -> DiscardView(This,pResourceView) )
+
+#define ID3D11DeviceContext1_VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext1_SwapDeviceContextState(This,pState,ppPreviousState) \
+ ( (This)->lpVtbl -> SwapDeviceContextState(This,pState,ppPreviousState) )
+
+#define ID3D11DeviceContext1_ClearView(This,pView,Color,pRect,NumRects) \
+ ( (This)->lpVtbl -> ClearView(This,pView,Color,pRect,NumRects) )
+
+#define ID3D11DeviceContext1_DiscardView1(This,pResourceView,pRects,NumRects) \
+ ( (This)->lpVtbl -> DiscardView1(This,pResourceView,pRects,NumRects) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11DeviceContext1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_1_0000_0004 */
+/* [local] */
+
+typedef struct D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK
+ {
+ UINT ClearSize;
+ UINT EncryptedSize;
+ } D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK;
+
+typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC1
+ {
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
+ UINT DataOffset;
+ UINT DataSize;
+ /* [annotation] */
+ _Field_size_opt_(IVSize) void *pIV;
+ UINT IVSize;
+ /* [annotation] */
+ _Field_size_opt_(SubSampleMappingCount) D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK *pSubSampleMappingBlock;
+ UINT SubSampleMappingCount;
+ } D3D11_VIDEO_DECODER_BUFFER_DESC1;
+
+typedef struct D3D11_VIDEO_DECODER_BEGIN_FRAME_CRYPTO_SESSION
+ {
+ ID3D11CryptoSession *pCryptoSession;
+ UINT BlobSize;
+ /* [annotation] */
+ _Field_size_opt_(BlobSize) void *pBlob;
+ GUID *pKeyInfoId;
+ UINT PrivateDataSize;
+ /* [annotation] */
+ _Field_size_opt_(PrivateDataSize) void *pPrivateData;
+ } D3D11_VIDEO_DECODER_BEGIN_FRAME_CRYPTO_SESSION;
+
+typedef
+enum D3D11_VIDEO_DECODER_CAPS
+ {
+ D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE = 0x1,
+ D3D11_VIDEO_DECODER_CAPS_NON_REAL_TIME = 0x2,
+ D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_DYNAMIC = 0x4,
+ D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_REQUIRED = 0x8,
+ D3D11_VIDEO_DECODER_CAPS_UNSUPPORTED = 0x10
+ } D3D11_VIDEO_DECODER_CAPS;
+
+typedef
+enum D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS
+ {
+ D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_ROTATION = 0x1,
+ D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_RESIZE = 0x2,
+ D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_COLOR_SPACE_CONVERSION = 0x4,
+ D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_TRIPLE_BUFFER_OUTPUT = 0x8
+ } D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS;
+
+typedef struct D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT
+ {
+ BOOL Enable;
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT Format;
+ } D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT;
+
+typedef
+enum D3D11_CRYPTO_SESSION_STATUS
+ {
+ D3D11_CRYPTO_SESSION_STATUS_OK = 0,
+ D3D11_CRYPTO_SESSION_STATUS_KEY_LOST = 1,
+ D3D11_CRYPTO_SESSION_STATUS_KEY_AND_CONTENT_LOST = 2
+ } D3D11_CRYPTO_SESSION_STATUS;
+
+typedef struct D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA
+ {
+ UINT PrivateDataSize;
+ UINT HWProtectionDataSize;
+ BYTE pbInput[ 4 ];
+ } D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA;
+
+typedef struct D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA
+ {
+ UINT PrivateDataSize;
+ UINT MaxHWProtectionDataSize;
+ UINT HWProtectionDataSize;
+ UINT64 TransportTime;
+ UINT64 ExecutionTime;
+ BYTE pbOutput[ 4 ];
+ } D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA;
+
+typedef struct D3D11_KEY_EXCHANGE_HW_PROTECTION_DATA
+ {
+ UINT HWProtectionFunctionID;
+ D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA *pInputData;
+ D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA *pOutputData;
+ HRESULT Status;
+ } D3D11_KEY_EXCHANGE_HW_PROTECTION_DATA;
+
+typedef struct D3D11_VIDEO_SAMPLE_DESC
+ {
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT Format;
+ DXGI_COLOR_SPACE_TYPE ColorSpace;
+ } D3D11_VIDEO_SAMPLE_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0004_v0_0_s_ifspec;
+
+#ifndef __ID3D11VideoContext1_INTERFACE_DEFINED__
+#define __ID3D11VideoContext1_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoContext1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoContext1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("A7F026DA-A5F8-4487-A564-15E34357651E")
+ ID3D11VideoContext1 : public ID3D11VideoContext
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SubmitDecoderBuffers1(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_(NumBuffers) const D3D11_VIDEO_DECODER_BUFFER_DESC1 *pBufferDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDataForNewHardwareKey(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT PrivateInputSize,
+ /* [annotation] */
+ _In_reads_(PrivateInputSize) const void *pPrivatInputData,
+ /* [annotation] */
+ _Out_ UINT64 *pPrivateOutputData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckCryptoSessionStatus(
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _Out_ D3D11_CRYPTO_SESSION_STATUS *pStatus) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderEnableDownsampling(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc,
+ /* [annotation] */
+ _In_ UINT ReferenceFrameCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderUpdateDownsampling(
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputColorSpace1(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetOutputShaderUsage(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL ShaderUsage) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputColorSpace1(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ DXGI_COLOR_SPACE_TYPE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetOutputShaderUsage(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pShaderUsage) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamColorSpace1(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorSetStreamMirror(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ BOOL FlipHorizontal,
+ /* [annotation] */
+ _In_ BOOL FlipVertical) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamColorSpace1(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ DXGI_COLOR_SPACE_TYPE *pColorSpace) = 0;
+
+ virtual void STDMETHODCALLTYPE VideoProcessorGetStreamMirror(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ BOOL *pFlipHorizontal,
+ /* [annotation] */
+ _Out_ BOOL *pFlipVertical) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessorGetBehaviorHints(
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT OutputWidth,
+ /* [annotation] */
+ _In_ UINT OutputHeight,
+ /* [annotation] */
+ _In_ DXGI_FORMAT OutputFormat,
+ /* [annotation] */
+ _In_ UINT StreamCount,
+ /* [annotation] */
+ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT *pStreams,
+ /* [annotation] */
+ _Out_ UINT *pBehaviorHints) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoContext1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoContext1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoContext1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoContext1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDecoderBuffer )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE Type,
+ /* [annotation] */
+ _Out_ UINT *pBufferSize,
+ /* [annotation] */
+ _Outptr_result_bytebuffer_(*pBufferSize) void **ppBuffer);
+
+ HRESULT ( STDMETHODCALLTYPE *ReleaseDecoderBuffer )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_DECODER_BUFFER_TYPE Type);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderBeginFrame )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoderOutputView *pView,
+ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderEndFrame )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder);
+
+ HRESULT ( STDMETHODCALLTYPE *SubmitDecoderBuffers )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_(NumBuffers) const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *DecoderExtension )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_EXTENSION *pExtensionData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputTargetRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputBackgroundColor )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL YCbCr,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_COLOR *pColor);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputColorSpace )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputAlphaFillMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE AlphaFillMode,
+ /* [annotation] */
+ _In_ UINT StreamIndex);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputConstriction )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ SIZE Size);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputStereoMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL Enable);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorSetOutputExtension )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputTargetRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *Enabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputBackgroundColor )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pYCbCr,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_COLOR *pColor);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputColorSpace )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputAlphaFillMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE *pAlphaFillMode,
+ /* [annotation] */
+ _Out_ UINT *pStreamIndex);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputConstriction )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ SIZE *pSize);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputStereoMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorGetOutputExtension )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamFrameFormat )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_FRAME_FORMAT FrameFormat);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamColorSpace )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamOutputRate )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE OutputRate,
+ /* [annotation] */
+ _In_ BOOL RepeatFrame,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pCustomRate);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamSourceRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamDestRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamAlpha )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Alpha);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamPalette )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _In_reads_opt_(Count) const UINT *pEntries);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamPixelAspectRatio )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _In_opt_ const DXGI_RATIONAL *pDestinationAspectRatio);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamLumaKey )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ FLOAT Lower,
+ /* [annotation] */
+ _In_ FLOAT Upper);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamStereoFormat )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT Format,
+ /* [annotation] */
+ _In_ BOOL LeftViewFrame0,
+ /* [annotation] */
+ _In_ BOOL BaseViewFrame0,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE FlipMode,
+ /* [annotation] */
+ _In_ int MonoOffset);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamAutoProcessingMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamFilter )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ int Level);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorSetStreamExtension )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ void *pData);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamFrameFormat )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_FRAME_FORMAT *pFrameFormat);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamColorSpace )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_COLOR_SPACE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamOutputRate )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_OUTPUT_RATE *pOutputRate,
+ /* [annotation] */
+ _Out_ BOOL *pRepeatFrame,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pCustomRate);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamSourceRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamDestRect )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ RECT *pRect);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamAlpha )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pAlpha);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamPalette )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ UINT Count,
+ /* [annotation] */
+ _Out_writes_(Count) UINT *pEntries);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamPixelAspectRatio )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pSourceAspectRatio,
+ /* [annotation] */
+ _Out_ DXGI_RATIONAL *pDestinationAspectRatio);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamLumaKey )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ FLOAT *pLower,
+ /* [annotation] */
+ _Out_ FLOAT *pUpper);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamStereoFormat )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FORMAT *pFormat,
+ /* [annotation] */
+ _Out_ BOOL *pLeftViewFrame0,
+ /* [annotation] */
+ _Out_ BOOL *pBaseViewFrame0,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE *pFlipMode,
+ /* [annotation] */
+ _Out_ int *MonoOffset);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamAutoProcessingMode )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamFilter )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ BOOL *pEnabled,
+ /* [annotation] */
+ _Out_ int *pLevel);
+
+ APP_DEPRECATED_HRESULT ( STDMETHODCALLTYPE *VideoProcessorGetStreamExtension )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ const GUID *pExtensionGuid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Out_writes_bytes_(DataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *VideoProcessorBlt )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorOutputView *pView,
+ /* [annotation] */
+ _In_ UINT OutputFrame,
+ /* [annotation] */
+ _In_ UINT StreamCount,
+ /* [annotation] */
+ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM *pStreams);
+
+ HRESULT ( STDMETHODCALLTYPE *NegotiateCryptoSessionKeyExchange )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData);
+
+ void ( STDMETHODCALLTYPE *EncryptionBlt )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV);
+
+ void ( STDMETHODCALLTYPE *DecryptionBlt )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pSrcSurface,
+ /* [annotation] */
+ _In_ ID3D11Texture2D *pDstSurface,
+ /* [annotation] */
+ _In_opt_ D3D11_ENCRYPTED_BLOCK_INFO *pEncryptedBlockInfo,
+ /* [annotation] */
+ _In_ UINT ContentKeySize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey,
+ /* [annotation] */
+ _In_ UINT IVSize,
+ /* [annotation] */
+ _Inout_opt_bytecount_(IVSize) void *pIV);
+
+ void ( STDMETHODCALLTYPE *StartSessionKeyRefresh )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT RandomNumberSize,
+ /* [annotation] */
+ _Out_writes_bytes_(RandomNumberSize) void *pRandomNumber);
+
+ void ( STDMETHODCALLTYPE *FinishSessionKeyRefresh )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession);
+
+ HRESULT ( STDMETHODCALLTYPE *GetEncryptionBltKey )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT KeySize,
+ /* [annotation] */
+ _Out_writes_bytes_(KeySize) void *pReadbackKey);
+
+ HRESULT ( STDMETHODCALLTYPE *NegotiateAuthenticatedChannelKeyExchange )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _Inout_updates_bytes_(DataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *QueryAuthenticatedChannel )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _In_ UINT OutputSize,
+ /* [annotation] */
+ _Out_writes_bytes_(OutputSize) void *pOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *ConfigureAuthenticatedChannel )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11AuthenticatedChannel *pChannel,
+ /* [annotation] */
+ _In_ UINT InputSize,
+ /* [annotation] */
+ _In_reads_bytes_(InputSize) const void *pInput,
+ /* [annotation] */
+ _Out_ D3D11_AUTHENTICATED_CONFIGURE_OUTPUT *pOutput);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamRotation )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_ROTATION Rotation);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamRotation )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_ROTATION *pRotation);
+
+ HRESULT ( STDMETHODCALLTYPE *SubmitDecoderBuffers1 )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_(NumBuffers) const D3D11_VIDEO_DECODER_BUFFER_DESC1 *pBufferDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDataForNewHardwareKey )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _In_ UINT PrivateInputSize,
+ /* [annotation] */
+ _In_reads_(PrivateInputSize) const void *pPrivatInputData,
+ /* [annotation] */
+ _Out_ UINT64 *pPrivateOutputData);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCryptoSessionStatus )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11CryptoSession *pCryptoSession,
+ /* [annotation] */
+ _Out_ D3D11_CRYPTO_SESSION_STATUS *pStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderEnableDownsampling )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc,
+ /* [annotation] */
+ _In_ UINT ReferenceFrameCount);
+
+ HRESULT ( STDMETHODCALLTYPE *DecoderUpdateDownsampling )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoDecoder *pDecoder,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputColorSpace1 )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetOutputShaderUsage )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ BOOL ShaderUsage);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputColorSpace1 )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ DXGI_COLOR_SPACE_TYPE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetOutputShaderUsage )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _Out_ BOOL *pShaderUsage);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamColorSpace1 )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorSetStreamMirror )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _In_ BOOL Enable,
+ /* [annotation] */
+ _In_ BOOL FlipHorizontal,
+ /* [annotation] */
+ _In_ BOOL FlipVertical);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamColorSpace1 )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ DXGI_COLOR_SPACE_TYPE *pColorSpace);
+
+ void ( STDMETHODCALLTYPE *VideoProcessorGetStreamMirror )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT StreamIndex,
+ /* [annotation] */
+ _Out_ BOOL *pEnable,
+ /* [annotation] */
+ _Out_ BOOL *pFlipHorizontal,
+ /* [annotation] */
+ _Out_ BOOL *pFlipVertical);
+
+ HRESULT ( STDMETHODCALLTYPE *VideoProcessorGetBehaviorHints )(
+ ID3D11VideoContext1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessor *pVideoProcessor,
+ /* [annotation] */
+ _In_ UINT OutputWidth,
+ /* [annotation] */
+ _In_ UINT OutputHeight,
+ /* [annotation] */
+ _In_ DXGI_FORMAT OutputFormat,
+ /* [annotation] */
+ _In_ UINT StreamCount,
+ /* [annotation] */
+ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT *pStreams,
+ /* [annotation] */
+ _Out_ UINT *pBehaviorHints);
+
+ END_INTERFACE
+ } ID3D11VideoContext1Vtbl;
+
+ interface ID3D11VideoContext1
+ {
+ CONST_VTBL struct ID3D11VideoContext1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoContext1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoContext1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoContext1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoContext1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoContext1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoContext1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoContext1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoContext1_GetDecoderBuffer(This,pDecoder,Type,pBufferSize,ppBuffer) \
+ ( (This)->lpVtbl -> GetDecoderBuffer(This,pDecoder,Type,pBufferSize,ppBuffer) )
+
+#define ID3D11VideoContext1_ReleaseDecoderBuffer(This,pDecoder,Type) \
+ ( (This)->lpVtbl -> ReleaseDecoderBuffer(This,pDecoder,Type) )
+
+#define ID3D11VideoContext1_DecoderBeginFrame(This,pDecoder,pView,ContentKeySize,pContentKey) \
+ ( (This)->lpVtbl -> DecoderBeginFrame(This,pDecoder,pView,ContentKeySize,pContentKey) )
+
+#define ID3D11VideoContext1_DecoderEndFrame(This,pDecoder) \
+ ( (This)->lpVtbl -> DecoderEndFrame(This,pDecoder) )
+
+#define ID3D11VideoContext1_SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc) \
+ ( (This)->lpVtbl -> SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc) )
+
+#define ID3D11VideoContext1_DecoderExtension(This,pDecoder,pExtensionData) \
+ ( (This)->lpVtbl -> DecoderExtension(This,pDecoder,pExtensionData) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputTargetRect(This,pVideoProcessor,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputTargetRect(This,pVideoProcessor,Enable,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputBackgroundColor(This,pVideoProcessor,YCbCr,pColor) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputBackgroundColor(This,pVideoProcessor,YCbCr,pColor) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputColorSpace(This,pVideoProcessor,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputColorSpace(This,pVideoProcessor,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputAlphaFillMode(This,pVideoProcessor,AlphaFillMode,StreamIndex) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputAlphaFillMode(This,pVideoProcessor,AlphaFillMode,StreamIndex) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputConstriction(This,pVideoProcessor,Enable,Size) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputConstriction(This,pVideoProcessor,Enable,Size) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputStereoMode(This,pVideoProcessor,Enable) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputStereoMode(This,pVideoProcessor,Enable) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputTargetRect(This,pVideoProcessor,Enabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputTargetRect(This,pVideoProcessor,Enabled,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputBackgroundColor(This,pVideoProcessor,pYCbCr,pColor) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputBackgroundColor(This,pVideoProcessor,pYCbCr,pColor) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputColorSpace(This,pVideoProcessor,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputColorSpace(This,pVideoProcessor,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputAlphaFillMode(This,pVideoProcessor,pAlphaFillMode,pStreamIndex) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputAlphaFillMode(This,pVideoProcessor,pAlphaFillMode,pStreamIndex) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputConstriction(This,pVideoProcessor,pEnabled,pSize) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputConstriction(This,pVideoProcessor,pEnabled,pSize) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputStereoMode(This,pVideoProcessor,pEnabled) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputStereoMode(This,pVideoProcessor,pEnabled) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputExtension(This,pVideoProcessor,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamFrameFormat(This,pVideoProcessor,StreamIndex,FrameFormat) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamFrameFormat(This,pVideoProcessor,StreamIndex,FrameFormat) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamOutputRate(This,pVideoProcessor,StreamIndex,OutputRate,RepeatFrame,pCustomRate) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamOutputRate(This,pVideoProcessor,StreamIndex,OutputRate,RepeatFrame,pCustomRate) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamSourceRect(This,pVideoProcessor,StreamIndex,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamSourceRect(This,pVideoProcessor,StreamIndex,Enable,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamDestRect(This,pVideoProcessor,StreamIndex,Enable,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamDestRect(This,pVideoProcessor,StreamIndex,Enable,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamAlpha(This,pVideoProcessor,StreamIndex,Enable,Alpha) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamAlpha(This,pVideoProcessor,StreamIndex,Enable,Alpha) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,Enable,pSourceAspectRatio,pDestinationAspectRatio) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,Enable,pSourceAspectRatio,pDestinationAspectRatio) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamLumaKey(This,pVideoProcessor,StreamIndex,Enable,Lower,Upper) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamLumaKey(This,pVideoProcessor,StreamIndex,Enable,Lower,Upper) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamStereoFormat(This,pVideoProcessor,StreamIndex,Enable,Format,LeftViewFrame0,BaseViewFrame0,FlipMode,MonoOffset) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamStereoFormat(This,pVideoProcessor,StreamIndex,Enable,Format,LeftViewFrame0,BaseViewFrame0,FlipMode,MonoOffset) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,Enable) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,Enable) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,Enable,Level) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,Enable,Level) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamFrameFormat(This,pVideoProcessor,StreamIndex,pFrameFormat) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamFrameFormat(This,pVideoProcessor,StreamIndex,pFrameFormat) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamColorSpace(This,pVideoProcessor,StreamIndex,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamOutputRate(This,pVideoProcessor,StreamIndex,pOutputRate,pRepeatFrame,pCustomRate) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamOutputRate(This,pVideoProcessor,StreamIndex,pOutputRate,pRepeatFrame,pCustomRate) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamSourceRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamSourceRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamDestRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamDestRect(This,pVideoProcessor,StreamIndex,pEnabled,pRect) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamAlpha(This,pVideoProcessor,StreamIndex,pEnabled,pAlpha) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamAlpha(This,pVideoProcessor,StreamIndex,pEnabled,pAlpha) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamPalette(This,pVideoProcessor,StreamIndex,Count,pEntries) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,pEnabled,pSourceAspectRatio,pDestinationAspectRatio) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamPixelAspectRatio(This,pVideoProcessor,StreamIndex,pEnabled,pSourceAspectRatio,pDestinationAspectRatio) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamLumaKey(This,pVideoProcessor,StreamIndex,pEnabled,pLower,pUpper) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamLumaKey(This,pVideoProcessor,StreamIndex,pEnabled,pLower,pUpper) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamStereoFormat(This,pVideoProcessor,StreamIndex,pEnable,pFormat,pLeftViewFrame0,pBaseViewFrame0,pFlipMode,MonoOffset) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamStereoFormat(This,pVideoProcessor,StreamIndex,pEnable,pFormat,pLeftViewFrame0,pBaseViewFrame0,pFlipMode,MonoOffset) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,pEnabled) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamAutoProcessingMode(This,pVideoProcessor,StreamIndex,pEnabled) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,pEnabled,pLevel) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamFilter(This,pVideoProcessor,StreamIndex,Filter,pEnabled,pLevel) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamExtension(This,pVideoProcessor,StreamIndex,pExtensionGuid,DataSize,pData) )
+
+#define ID3D11VideoContext1_VideoProcessorBlt(This,pVideoProcessor,pView,OutputFrame,StreamCount,pStreams) \
+ ( (This)->lpVtbl -> VideoProcessorBlt(This,pVideoProcessor,pView,OutputFrame,StreamCount,pStreams) )
+
+#define ID3D11VideoContext1_NegotiateCryptoSessionKeyExchange(This,pCryptoSession,DataSize,pData) \
+ ( (This)->lpVtbl -> NegotiateCryptoSessionKeyExchange(This,pCryptoSession,DataSize,pData) )
+
+#define ID3D11VideoContext1_EncryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,IVSize,pIV) \
+ ( (This)->lpVtbl -> EncryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,IVSize,pIV) )
+
+#define ID3D11VideoContext1_DecryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,pEncryptedBlockInfo,ContentKeySize,pContentKey,IVSize,pIV) \
+ ( (This)->lpVtbl -> DecryptionBlt(This,pCryptoSession,pSrcSurface,pDstSurface,pEncryptedBlockInfo,ContentKeySize,pContentKey,IVSize,pIV) )
+
+#define ID3D11VideoContext1_StartSessionKeyRefresh(This,pCryptoSession,RandomNumberSize,pRandomNumber) \
+ ( (This)->lpVtbl -> StartSessionKeyRefresh(This,pCryptoSession,RandomNumberSize,pRandomNumber) )
+
+#define ID3D11VideoContext1_FinishSessionKeyRefresh(This,pCryptoSession) \
+ ( (This)->lpVtbl -> FinishSessionKeyRefresh(This,pCryptoSession) )
+
+#define ID3D11VideoContext1_GetEncryptionBltKey(This,pCryptoSession,KeySize,pReadbackKey) \
+ ( (This)->lpVtbl -> GetEncryptionBltKey(This,pCryptoSession,KeySize,pReadbackKey) )
+
+#define ID3D11VideoContext1_NegotiateAuthenticatedChannelKeyExchange(This,pChannel,DataSize,pData) \
+ ( (This)->lpVtbl -> NegotiateAuthenticatedChannelKeyExchange(This,pChannel,DataSize,pData) )
+
+#define ID3D11VideoContext1_QueryAuthenticatedChannel(This,pChannel,InputSize,pInput,OutputSize,pOutput) \
+ ( (This)->lpVtbl -> QueryAuthenticatedChannel(This,pChannel,InputSize,pInput,OutputSize,pOutput) )
+
+#define ID3D11VideoContext1_ConfigureAuthenticatedChannel(This,pChannel,InputSize,pInput,pOutput) \
+ ( (This)->lpVtbl -> ConfigureAuthenticatedChannel(This,pChannel,InputSize,pInput,pOutput) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamRotation(This,pVideoProcessor,StreamIndex,Enable,Rotation) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamRotation(This,pVideoProcessor,StreamIndex,Enable,Rotation) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamRotation(This,pVideoProcessor,StreamIndex,pEnable,pRotation) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamRotation(This,pVideoProcessor,StreamIndex,pEnable,pRotation) )
+
+
+#define ID3D11VideoContext1_SubmitDecoderBuffers1(This,pDecoder,NumBuffers,pBufferDesc) \
+ ( (This)->lpVtbl -> SubmitDecoderBuffers1(This,pDecoder,NumBuffers,pBufferDesc) )
+
+#define ID3D11VideoContext1_GetDataForNewHardwareKey(This,pCryptoSession,PrivateInputSize,pPrivatInputData,pPrivateOutputData) \
+ ( (This)->lpVtbl -> GetDataForNewHardwareKey(This,pCryptoSession,PrivateInputSize,pPrivatInputData,pPrivateOutputData) )
+
+#define ID3D11VideoContext1_CheckCryptoSessionStatus(This,pCryptoSession,pStatus) \
+ ( (This)->lpVtbl -> CheckCryptoSessionStatus(This,pCryptoSession,pStatus) )
+
+#define ID3D11VideoContext1_DecoderEnableDownsampling(This,pDecoder,InputColorSpace,pOutputDesc,ReferenceFrameCount) \
+ ( (This)->lpVtbl -> DecoderEnableDownsampling(This,pDecoder,InputColorSpace,pOutputDesc,ReferenceFrameCount) )
+
+#define ID3D11VideoContext1_DecoderUpdateDownsampling(This,pDecoder,pOutputDesc) \
+ ( (This)->lpVtbl -> DecoderUpdateDownsampling(This,pDecoder,pOutputDesc) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputColorSpace1(This,pVideoProcessor,ColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputColorSpace1(This,pVideoProcessor,ColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorSetOutputShaderUsage(This,pVideoProcessor,ShaderUsage) \
+ ( (This)->lpVtbl -> VideoProcessorSetOutputShaderUsage(This,pVideoProcessor,ShaderUsage) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputColorSpace1(This,pVideoProcessor,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputColorSpace1(This,pVideoProcessor,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorGetOutputShaderUsage(This,pVideoProcessor,pShaderUsage) \
+ ( (This)->lpVtbl -> VideoProcessorGetOutputShaderUsage(This,pVideoProcessor,pShaderUsage) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamColorSpace1(This,pVideoProcessor,StreamIndex,ColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamColorSpace1(This,pVideoProcessor,StreamIndex,ColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorSetStreamMirror(This,pVideoProcessor,StreamIndex,Enable,FlipHorizontal,FlipVertical) \
+ ( (This)->lpVtbl -> VideoProcessorSetStreamMirror(This,pVideoProcessor,StreamIndex,Enable,FlipHorizontal,FlipVertical) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamColorSpace1(This,pVideoProcessor,StreamIndex,pColorSpace) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamColorSpace1(This,pVideoProcessor,StreamIndex,pColorSpace) )
+
+#define ID3D11VideoContext1_VideoProcessorGetStreamMirror(This,pVideoProcessor,StreamIndex,pEnable,pFlipHorizontal,pFlipVertical) \
+ ( (This)->lpVtbl -> VideoProcessorGetStreamMirror(This,pVideoProcessor,StreamIndex,pEnable,pFlipHorizontal,pFlipVertical) )
+
+#define ID3D11VideoContext1_VideoProcessorGetBehaviorHints(This,pVideoProcessor,OutputWidth,OutputHeight,OutputFormat,StreamCount,pStreams,pBehaviorHints) \
+ ( (This)->lpVtbl -> VideoProcessorGetBehaviorHints(This,pVideoProcessor,OutputWidth,OutputHeight,OutputFormat,StreamCount,pStreams,pBehaviorHints) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoContext1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11VideoDevice1_INTERFACE_DEFINED__
+#define __ID3D11VideoDevice1_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoDevice1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoDevice1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("29DA1D51-1321-4454-804B-F5FC9F861F0F")
+ ID3D11VideoDevice1 : public ID3D11VideoDevice
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetCryptoSessionPrivateDataSize(
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ const GUID *pKeyExchangeType,
+ /* [annotation] */
+ _Out_ UINT *pPrivateInputSize,
+ /* [annotation] */
+ _Out_ UINT *pPrivateOutputSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetVideoDecoderCaps(
+ /* [annotation] */
+ _In_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ UINT SampleWidth,
+ /* [annotation] */
+ _In_ UINT SampleHeight,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _In_ UINT BitRate,
+ /* [annotation] */
+ _In_opt_ const GUID *pCryptoType,
+ /* [annotation] */
+ _Out_ UINT *pDecoderCaps) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckVideoDecoderDownsampling(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pInputDesc,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pInputConfig,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc,
+ /* [annotation] */
+ _Out_ BOOL *pSupported,
+ /* [annotation] */
+ _Out_ BOOL *pRealTimeHint) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RecommendVideoDecoderDownsampleParameters(
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pInputDesc,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pInputConfig,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_SAMPLE_DESC *pRecommendedOutputDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoDevice1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoDevice1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoDevice1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoDevice1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pVideoDesc,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pConfig,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoDecoder **ppDecoder);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ UINT RateConversionIndex,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessor **ppVideoProcessor);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateAuthenticatedChannel )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11AuthenticatedChannel **ppAuthenticatedChannel);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCryptoSession )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ const GUID *pKeyExchangeType,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11CryptoSession **ppCryptoSession);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderOutputView )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoDecoderOutputView **ppVDOVView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorInputView )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorInputView **ppVPIView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorOutputView )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ ID3D11VideoProcessorEnumerator *pEnum,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VideoProcessorOutputView **ppVPOView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessorEnumerator )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11VideoProcessorEnumerator **ppEnum);
+
+ UINT ( STDMETHODCALLTYPE *GetVideoDecoderProfileCount )(
+ ID3D11VideoDevice1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderProfile )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pDecoderProfile);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoDecoderFormat )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ BOOL *pSupported);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderConfigCount )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ UINT *pCount);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderConfig )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pDesc,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_DECODER_CONFIG *pConfig);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContentProtectionCaps )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_opt_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_CONTENT_PROTECTION_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCryptoKeyExchange )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ UINT Index,
+ /* [annotation] */
+ _Out_ GUID *pKeyExchangeType);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCryptoSessionPrivateDataSize )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const GUID *pCryptoType,
+ /* [annotation] */
+ _In_opt_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ const GUID *pKeyExchangeType,
+ /* [annotation] */
+ _Out_ UINT *pPrivateInputSize,
+ /* [annotation] */
+ _Out_ UINT *pPrivateOutputSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoDecoderCaps )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const GUID *pDecoderProfile,
+ /* [annotation] */
+ _In_ UINT SampleWidth,
+ /* [annotation] */
+ _In_ UINT SampleHeight,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _In_ UINT BitRate,
+ /* [annotation] */
+ _In_opt_ const GUID *pCryptoType,
+ /* [annotation] */
+ _Out_ UINT *pDecoderCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoDecoderDownsampling )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pInputDesc,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pInputConfig,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_SAMPLE_DESC *pOutputDesc,
+ /* [annotation] */
+ _Out_ BOOL *pSupported,
+ /* [annotation] */
+ _Out_ BOOL *pRealTimeHint);
+
+ HRESULT ( STDMETHODCALLTYPE *RecommendVideoDecoderDownsampleParameters )(
+ ID3D11VideoDevice1 * This,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_DESC *pInputDesc,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ const D3D11_VIDEO_DECODER_CONFIG *pInputConfig,
+ /* [annotation] */
+ _In_ const DXGI_RATIONAL *pFrameRate,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_SAMPLE_DESC *pRecommendedOutputDesc);
+
+ END_INTERFACE
+ } ID3D11VideoDevice1Vtbl;
+
+ interface ID3D11VideoDevice1
+ {
+ CONST_VTBL struct ID3D11VideoDevice1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoDevice1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoDevice1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoDevice1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoDevice1_CreateVideoDecoder(This,pVideoDesc,pConfig,ppDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pVideoDesc,pConfig,ppDecoder) )
+
+#define ID3D11VideoDevice1_CreateVideoProcessor(This,pEnum,RateConversionIndex,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,pEnum,RateConversionIndex,ppVideoProcessor) )
+
+#define ID3D11VideoDevice1_CreateAuthenticatedChannel(This,ChannelType,ppAuthenticatedChannel) \
+ ( (This)->lpVtbl -> CreateAuthenticatedChannel(This,ChannelType,ppAuthenticatedChannel) )
+
+#define ID3D11VideoDevice1_CreateCryptoSession(This,pCryptoType,pDecoderProfile,pKeyExchangeType,ppCryptoSession) \
+ ( (This)->lpVtbl -> CreateCryptoSession(This,pCryptoType,pDecoderProfile,pKeyExchangeType,ppCryptoSession) )
+
+#define ID3D11VideoDevice1_CreateVideoDecoderOutputView(This,pResource,pDesc,ppVDOVView) \
+ ( (This)->lpVtbl -> CreateVideoDecoderOutputView(This,pResource,pDesc,ppVDOVView) )
+
+#define ID3D11VideoDevice1_CreateVideoProcessorInputView(This,pResource,pEnum,pDesc,ppVPIView) \
+ ( (This)->lpVtbl -> CreateVideoProcessorInputView(This,pResource,pEnum,pDesc,ppVPIView) )
+
+#define ID3D11VideoDevice1_CreateVideoProcessorOutputView(This,pResource,pEnum,pDesc,ppVPOView) \
+ ( (This)->lpVtbl -> CreateVideoProcessorOutputView(This,pResource,pEnum,pDesc,ppVPOView) )
+
+#define ID3D11VideoDevice1_CreateVideoProcessorEnumerator(This,pDesc,ppEnum) \
+ ( (This)->lpVtbl -> CreateVideoProcessorEnumerator(This,pDesc,ppEnum) )
+
+#define ID3D11VideoDevice1_GetVideoDecoderProfileCount(This) \
+ ( (This)->lpVtbl -> GetVideoDecoderProfileCount(This) )
+
+#define ID3D11VideoDevice1_GetVideoDecoderProfile(This,Index,pDecoderProfile) \
+ ( (This)->lpVtbl -> GetVideoDecoderProfile(This,Index,pDecoderProfile) )
+
+#define ID3D11VideoDevice1_CheckVideoDecoderFormat(This,pDecoderProfile,Format,pSupported) \
+ ( (This)->lpVtbl -> CheckVideoDecoderFormat(This,pDecoderProfile,Format,pSupported) )
+
+#define ID3D11VideoDevice1_GetVideoDecoderConfigCount(This,pDesc,pCount) \
+ ( (This)->lpVtbl -> GetVideoDecoderConfigCount(This,pDesc,pCount) )
+
+#define ID3D11VideoDevice1_GetVideoDecoderConfig(This,pDesc,Index,pConfig) \
+ ( (This)->lpVtbl -> GetVideoDecoderConfig(This,pDesc,Index,pConfig) )
+
+#define ID3D11VideoDevice1_GetContentProtectionCaps(This,pCryptoType,pDecoderProfile,pCaps) \
+ ( (This)->lpVtbl -> GetContentProtectionCaps(This,pCryptoType,pDecoderProfile,pCaps) )
+
+#define ID3D11VideoDevice1_CheckCryptoKeyExchange(This,pCryptoType,pDecoderProfile,Index,pKeyExchangeType) \
+ ( (This)->lpVtbl -> CheckCryptoKeyExchange(This,pCryptoType,pDecoderProfile,Index,pKeyExchangeType) )
+
+#define ID3D11VideoDevice1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoDevice1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoDevice1_GetCryptoSessionPrivateDataSize(This,pCryptoType,pDecoderProfile,pKeyExchangeType,pPrivateInputSize,pPrivateOutputSize) \
+ ( (This)->lpVtbl -> GetCryptoSessionPrivateDataSize(This,pCryptoType,pDecoderProfile,pKeyExchangeType,pPrivateInputSize,pPrivateOutputSize) )
+
+#define ID3D11VideoDevice1_GetVideoDecoderCaps(This,pDecoderProfile,SampleWidth,SampleHeight,pFrameRate,BitRate,pCryptoType,pDecoderCaps) \
+ ( (This)->lpVtbl -> GetVideoDecoderCaps(This,pDecoderProfile,SampleWidth,SampleHeight,pFrameRate,BitRate,pCryptoType,pDecoderCaps) )
+
+#define ID3D11VideoDevice1_CheckVideoDecoderDownsampling(This,pInputDesc,InputColorSpace,pInputConfig,pFrameRate,pOutputDesc,pSupported,pRealTimeHint) \
+ ( (This)->lpVtbl -> CheckVideoDecoderDownsampling(This,pInputDesc,InputColorSpace,pInputConfig,pFrameRate,pOutputDesc,pSupported,pRealTimeHint) )
+
+#define ID3D11VideoDevice1_RecommendVideoDecoderDownsampleParameters(This,pInputDesc,InputColorSpace,pInputConfig,pFrameRate,pRecommendedOutputDesc) \
+ ( (This)->lpVtbl -> RecommendVideoDecoderDownsampleParameters(This,pInputDesc,InputColorSpace,pInputConfig,pFrameRate,pRecommendedOutputDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoDevice1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11VideoProcessorEnumerator1_INTERFACE_DEFINED__
+#define __ID3D11VideoProcessorEnumerator1_INTERFACE_DEFINED__
+
+/* interface ID3D11VideoProcessorEnumerator1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11VideoProcessorEnumerator1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("465217F2-5568-43CF-B5B9-F61D54531CA1")
+ ID3D11VideoProcessorEnumerator1 : public ID3D11VideoProcessorEnumerator
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CheckVideoProcessorFormatConversion(
+ /* [annotation] */
+ _In_ DXGI_FORMAT InputFormat,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ DXGI_FORMAT OutputFormat,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE OutputColorSpace,
+ /* [annotation] */
+ _Out_ BOOL *pSupported) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11VideoProcessorEnumerator1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11VideoProcessorEnumerator1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11VideoProcessorEnumerator1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorContentDesc )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pContentDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoProcessorFormat )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorCaps )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorRateConversionCaps )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorCustomRate )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ UINT TypeIndex,
+ /* [annotation] */
+ _In_ UINT CustomRateIndex,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_CUSTOM_RATE *pRate);
+
+ HRESULT ( STDMETHODCALLTYPE *GetVideoProcessorFilterRange )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ D3D11_VIDEO_PROCESSOR_FILTER Filter,
+ /* [annotation] */
+ _Out_ D3D11_VIDEO_PROCESSOR_FILTER_RANGE *pRange);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckVideoProcessorFormatConversion )(
+ ID3D11VideoProcessorEnumerator1 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT InputFormat,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE InputColorSpace,
+ /* [annotation] */
+ _In_ DXGI_FORMAT OutputFormat,
+ /* [annotation] */
+ _In_ DXGI_COLOR_SPACE_TYPE OutputColorSpace,
+ /* [annotation] */
+ _Out_ BOOL *pSupported);
+
+ END_INTERFACE
+ } ID3D11VideoProcessorEnumerator1Vtbl;
+
+ interface ID3D11VideoProcessorEnumerator1
+ {
+ CONST_VTBL struct ID3D11VideoProcessorEnumerator1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11VideoProcessorEnumerator1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11VideoProcessorEnumerator1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11VideoProcessorEnumerator1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11VideoProcessorEnumerator1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11VideoProcessorEnumerator1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11VideoProcessorEnumerator1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11VideoProcessorEnumerator1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11VideoProcessorEnumerator1_GetVideoProcessorContentDesc(This,pContentDesc) \
+ ( (This)->lpVtbl -> GetVideoProcessorContentDesc(This,pContentDesc) )
+
+#define ID3D11VideoProcessorEnumerator1_CheckVideoProcessorFormat(This,Format,pFlags) \
+ ( (This)->lpVtbl -> CheckVideoProcessorFormat(This,Format,pFlags) )
+
+#define ID3D11VideoProcessorEnumerator1_GetVideoProcessorCaps(This,pCaps) \
+ ( (This)->lpVtbl -> GetVideoProcessorCaps(This,pCaps) )
+
+#define ID3D11VideoProcessorEnumerator1_GetVideoProcessorRateConversionCaps(This,TypeIndex,pCaps) \
+ ( (This)->lpVtbl -> GetVideoProcessorRateConversionCaps(This,TypeIndex,pCaps) )
+
+#define ID3D11VideoProcessorEnumerator1_GetVideoProcessorCustomRate(This,TypeIndex,CustomRateIndex,pRate) \
+ ( (This)->lpVtbl -> GetVideoProcessorCustomRate(This,TypeIndex,CustomRateIndex,pRate) )
+
+#define ID3D11VideoProcessorEnumerator1_GetVideoProcessorFilterRange(This,Filter,pRange) \
+ ( (This)->lpVtbl -> GetVideoProcessorFilterRange(This,Filter,pRange) )
+
+
+#define ID3D11VideoProcessorEnumerator1_CheckVideoProcessorFormatConversion(This,InputFormat,InputColorSpace,OutputFormat,OutputColorSpace,pSupported) \
+ ( (This)->lpVtbl -> CheckVideoProcessorFormatConversion(This,InputFormat,InputColorSpace,OutputFormat,OutputColorSpace,pSupported) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11VideoProcessorEnumerator1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11Device1_INTERFACE_DEFINED__
+#define __ID3D11Device1_INTERFACE_DEFINED__
+
+/* interface ID3D11Device1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Device1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("a04bfb29-08ef-43d6-a49c-a9bdbdcbe686")
+ ID3D11Device1 : public ID3D11Device
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetImmediateContext1(
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext1 **ppImmediateContext) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext1(
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext1 **ppDeferredContext) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateBlendState1(
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC1 *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState1 **ppBlendState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState1(
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC1 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState1 **ppRasterizerState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDeviceContextState(
+ UINT Flags,
+ /* [annotation] */
+ _In_reads_( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels,
+ UINT FeatureLevels,
+ UINT SDKVersion,
+ REFIID EmulatedInterface,
+ /* [annotation] */
+ _Out_opt_ D3D_FEATURE_LEVEL *pChosenFeatureLevel,
+ /* [annotation] */
+ _Out_opt_ ID3DDeviceContextState **ppContextState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OpenSharedResource1(
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OpenSharedResourceByName(
+ /* [annotation] */
+ _In_ LPCWSTR lpName,
+ /* [annotation] */
+ _In_ DWORD dwDesiredAccess,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Device1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Device1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Device1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Device1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_BUFFER_DESC *pDesc,
+ /* [annotation] */
+ _In_opt_ const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Buffer **ppBuffer);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE1D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture1D **ppTexture1D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE2D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture2D **ppTexture2D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE3D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture3D **ppTexture3D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ShaderResourceView **ppSRView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView **ppUAView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RenderTargetView **ppRTView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11InputLayout **ppInputLayout);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VertexShader **ppVertexShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_reads_opt_(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
+ /* [annotation] */
+ _In_reads_opt_(NumStrides) const UINT *pBufferStrides,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
+ /* [annotation] */
+ _In_ UINT RasterizedStream,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11PixelShader **ppPixelShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateHullShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11HullShader **ppHullShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DomainShader **ppDomainShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ComputeShader **ppComputeShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11ClassLinkage **ppLinkage);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilState **ppDepthStencilState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_SAMPLER_DESC *pSamplerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11SamplerState **ppSamplerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pQueryDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Query **ppQuery);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pPredicateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Predicate **ppPredicate);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pCounterDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Counter **ppCounter);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )(
+ ID3D11Device1 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID ReturnedInterface,
+ /* [annotation] */
+ _COM_Outptr_opt_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFormatSupport);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels);
+
+ void ( STDMETHODCALLTYPE *CheckCounterInfo )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_INFO *pCounterInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_TYPE *pType,
+ /* [annotation] */
+ _Out_ UINT *pActiveCounters,
+ /* [annotation] */
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNameLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
+ /* [annotation] */
+ _Inout_opt_ UINT *pUnitsLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
+ /* [annotation] */
+ _Inout_opt_ UINT *pDescriptionLength);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D11Device1 * This,
+ D3D11_FEATURE Feature,
+ /* [annotation] */
+ _Out_writes_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )(
+ ID3D11Device1 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
+ ID3D11Device1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D11Device1 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )(
+ ID3D11Device1 * This,
+ UINT RaiseFlags);
+
+ UINT ( STDMETHODCALLTYPE *GetExceptionMode )(
+ ID3D11Device1 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext1 )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext1 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext1 )(
+ ID3D11Device1 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext1 **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC1 *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState1 **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState1 )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC1 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState1 **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeviceContextState )(
+ ID3D11Device1 * This,
+ UINT Flags,
+ /* [annotation] */
+ _In_reads_( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels,
+ UINT FeatureLevels,
+ UINT SDKVersion,
+ REFIID EmulatedInterface,
+ /* [annotation] */
+ _Out_opt_ D3D_FEATURE_LEVEL *pChosenFeatureLevel,
+ /* [annotation] */
+ _Out_opt_ ID3DDeviceContextState **ppContextState);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource1 )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResourceByName )(
+ ID3D11Device1 * This,
+ /* [annotation] */
+ _In_ LPCWSTR lpName,
+ /* [annotation] */
+ _In_ DWORD dwDesiredAccess,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ END_INTERFACE
+ } ID3D11Device1Vtbl;
+
+ interface ID3D11Device1
+ {
+ CONST_VTBL struct ID3D11Device1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Device1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Device1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Device1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Device1_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \
+ ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) )
+
+#define ID3D11Device1_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \
+ ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) )
+
+#define ID3D11Device1_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \
+ ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) )
+
+#define ID3D11Device1_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \
+ ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) )
+
+#define ID3D11Device1_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) )
+
+#define ID3D11Device1_CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) )
+
+#define ID3D11Device1_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) )
+
+#define ID3D11Device1_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) )
+
+#define ID3D11Device1_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \
+ ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) )
+
+#define ID3D11Device1_CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) \
+ ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) )
+
+#define ID3D11Device1_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device1_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device1_CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) \
+ ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) )
+
+#define ID3D11Device1_CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) \
+ ( (This)->lpVtbl -> CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) )
+
+#define ID3D11Device1_CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) \
+ ( (This)->lpVtbl -> CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) )
+
+#define ID3D11Device1_CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) \
+ ( (This)->lpVtbl -> CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) )
+
+#define ID3D11Device1_CreateClassLinkage(This,ppLinkage) \
+ ( (This)->lpVtbl -> CreateClassLinkage(This,ppLinkage) )
+
+#define ID3D11Device1_CreateBlendState(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device1_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \
+ ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) )
+
+#define ID3D11Device1_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device1_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \
+ ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) )
+
+#define ID3D11Device1_CreateQuery(This,pQueryDesc,ppQuery) \
+ ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) )
+
+#define ID3D11Device1_CreatePredicate(This,pPredicateDesc,ppPredicate) \
+ ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) )
+
+#define ID3D11Device1_CreateCounter(This,pCounterDesc,ppCounter) \
+ ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) )
+
+#define ID3D11Device1_CreateDeferredContext(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device1_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) )
+
+#define ID3D11Device1_CheckFormatSupport(This,Format,pFormatSupport) \
+ ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) )
+
+#define ID3D11Device1_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \
+ ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) )
+
+#define ID3D11Device1_CheckCounterInfo(This,pCounterInfo) \
+ ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) )
+
+#define ID3D11Device1_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \
+ ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) )
+
+#define ID3D11Device1_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D11Device1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Device1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Device1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D11Device1_GetFeatureLevel(This) \
+ ( (This)->lpVtbl -> GetFeatureLevel(This) )
+
+#define ID3D11Device1_GetCreationFlags(This) \
+ ( (This)->lpVtbl -> GetCreationFlags(This) )
+
+#define ID3D11Device1_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D11Device1_GetImmediateContext(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext(This,ppImmediateContext) )
+
+#define ID3D11Device1_SetExceptionMode(This,RaiseFlags) \
+ ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) )
+
+#define ID3D11Device1_GetExceptionMode(This) \
+ ( (This)->lpVtbl -> GetExceptionMode(This) )
+
+
+#define ID3D11Device1_GetImmediateContext1(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext1(This,ppImmediateContext) )
+
+#define ID3D11Device1_CreateDeferredContext1(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext1(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device1_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device1_CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device1_CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) \
+ ( (This)->lpVtbl -> CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) )
+
+#define ID3D11Device1_OpenSharedResource1(This,hResource,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource1(This,hResource,returnedInterface,ppResource) )
+
+#define ID3D11Device1_OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Device1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3DUserDefinedAnnotation_INTERFACE_DEFINED__
+#define __ID3DUserDefinedAnnotation_INTERFACE_DEFINED__
+
+/* interface ID3DUserDefinedAnnotation */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3DUserDefinedAnnotation;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("b2daad8b-03d4-4dbf-95eb-32ab4b63d0ab")
+ ID3DUserDefinedAnnotation : public IUnknown
+ {
+ public:
+ virtual INT STDMETHODCALLTYPE BeginEvent(
+ /* [annotation] */
+ _In_ LPCWSTR Name) = 0;
+
+ virtual INT STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ /* [annotation] */
+ _In_ LPCWSTR Name) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetStatus( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3DUserDefinedAnnotationVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3DUserDefinedAnnotation * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3DUserDefinedAnnotation * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3DUserDefinedAnnotation * This);
+
+ INT ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3DUserDefinedAnnotation * This,
+ /* [annotation] */
+ _In_ LPCWSTR Name);
+
+ INT ( STDMETHODCALLTYPE *EndEvent )(
+ ID3DUserDefinedAnnotation * This);
+
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3DUserDefinedAnnotation * This,
+ /* [annotation] */
+ _In_ LPCWSTR Name);
+
+ BOOL ( STDMETHODCALLTYPE *GetStatus )(
+ ID3DUserDefinedAnnotation * This);
+
+ END_INTERFACE
+ } ID3DUserDefinedAnnotationVtbl;
+
+ interface ID3DUserDefinedAnnotation
+ {
+ CONST_VTBL struct ID3DUserDefinedAnnotationVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3DUserDefinedAnnotation_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3DUserDefinedAnnotation_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3DUserDefinedAnnotation_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3DUserDefinedAnnotation_BeginEvent(This,Name) \
+ ( (This)->lpVtbl -> BeginEvent(This,Name) )
+
+#define ID3DUserDefinedAnnotation_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3DUserDefinedAnnotation_SetMarker(This,Name) \
+ ( (This)->lpVtbl -> SetMarker(This,Name) )
+
+#define ID3DUserDefinedAnnotation_GetStatus(This) \
+ ( (This)->lpVtbl -> GetStatus(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3DUserDefinedAnnotation_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_1_0000_0009 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D11BlendState1,0xcc86fabe,0xda55,0x401d,0x85,0xe7,0xe3,0xc9,0xde,0x28,0x77,0xe9);
+DEFINE_GUID(IID_ID3D11RasterizerState1,0x1217d7a6,0x5039,0x418c,0xb0,0x42,0x9c,0xbe,0x25,0x6a,0xfd,0x6e);
+DEFINE_GUID(IID_ID3DDeviceContextState,0x5c1e0d8a,0x7c23,0x48f9,0x8c,0x59,0xa9,0x29,0x58,0xce,0xff,0x11);
+DEFINE_GUID(IID_ID3D11DeviceContext1,0xbb2c6faa,0xb5fb,0x4082,0x8e,0x6b,0x38,0x8b,0x8c,0xfa,0x90,0xe1);
+DEFINE_GUID(IID_ID3D11VideoContext1,0xA7F026DA,0xA5F8,0x4487,0xA5,0x64,0x15,0xE3,0x43,0x57,0x65,0x1E);
+DEFINE_GUID(IID_ID3D11VideoDevice1,0x29DA1D51,0x1321,0x4454,0x80,0x4B,0xF5,0xFC,0x9F,0x86,0x1F,0x0F);
+DEFINE_GUID(IID_ID3D11VideoProcessorEnumerator1,0x465217F2,0x5568,0x43CF,0xB5,0xB9,0xF6,0x1D,0x54,0x53,0x1C,0xA1);
+DEFINE_GUID(IID_ID3D11Device1,0xa04bfb29,0x08ef,0x43d6,0xa4,0x9c,0xa9,0xbd,0xbd,0xcb,0xe6,0x86);
+DEFINE_GUID(IID_ID3DUserDefinedAnnotation,0xb2daad8b,0x03d4,0x4dbf,0x95,0xeb,0x32,0xab,0x4b,0x63,0xd0,0xab);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0009_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_1_0000_0009_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h
new file mode 100644
index 00000000000..c8dccdc7ca5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h
@@ -0,0 +1,2721 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d11_2_h__
+#define __d3d11_2_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D11DeviceContext2_FWD_DEFINED__
+#define __ID3D11DeviceContext2_FWD_DEFINED__
+typedef interface ID3D11DeviceContext2 ID3D11DeviceContext2;
+
+#endif /* __ID3D11DeviceContext2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11Device2_FWD_DEFINED__
+#define __ID3D11Device2_FWD_DEFINED__
+typedef interface ID3D11Device2 ID3D11Device2;
+
+#endif /* __ID3D11Device2_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgi1_3.h"
+#include "d3dcommon.h"
+#include "d3d11_1.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d11_2_0000_0000 */
+/* [local] */
+
+#ifdef __cplusplus
+}
+#endif
+#include "d3d11_1.h" //
+#ifdef __cplusplus
+extern "C"{
+#endif
+typedef struct D3D11_TILED_RESOURCE_COORDINATE
+ {
+ UINT X;
+ UINT Y;
+ UINT Z;
+ UINT Subresource;
+ } D3D11_TILED_RESOURCE_COORDINATE;
+
+typedef struct D3D11_TILE_REGION_SIZE
+ {
+ UINT NumTiles;
+ BOOL bUseBox;
+ UINT Width;
+ UINT16 Height;
+ UINT16 Depth;
+ } D3D11_TILE_REGION_SIZE;
+
+typedef
+enum D3D11_TILE_MAPPING_FLAG
+ {
+ D3D11_TILE_MAPPING_NO_OVERWRITE = 0x1
+ } D3D11_TILE_MAPPING_FLAG;
+
+typedef
+enum D3D11_TILE_RANGE_FLAG
+ {
+ D3D11_TILE_RANGE_NULL = 0x1,
+ D3D11_TILE_RANGE_SKIP = 0x2,
+ D3D11_TILE_RANGE_REUSE_SINGLE_TILE = 0x4
+ } D3D11_TILE_RANGE_FLAG;
+
+typedef struct D3D11_SUBRESOURCE_TILING
+ {
+ UINT WidthInTiles;
+ UINT16 HeightInTiles;
+ UINT16 DepthInTiles;
+ UINT StartTileIndexInOverallResource;
+ } D3D11_SUBRESOURCE_TILING;
+
+#define D3D11_PACKED_TILE ( 0xffffffff )
+
+typedef struct D3D11_TILE_SHAPE
+ {
+ UINT WidthInTexels;
+ UINT HeightInTexels;
+ UINT DepthInTexels;
+ } D3D11_TILE_SHAPE;
+
+typedef struct D3D11_PACKED_MIP_DESC
+ {
+ UINT8 NumStandardMips;
+ UINT8 NumPackedMips;
+ UINT NumTilesForPackedMips;
+ UINT StartTileIndexInOverallResource;
+ } D3D11_PACKED_MIP_DESC;
+
+typedef
+enum D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG
+ {
+ D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE = 0x1
+ } D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG;
+
+typedef
+enum D3D11_TILE_COPY_FLAG
+ {
+ D3D11_TILE_COPY_NO_OVERWRITE = 0x1,
+ D3D11_TILE_COPY_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2,
+ D3D11_TILE_COPY_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4
+ } D3D11_TILE_COPY_FLAG;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_2_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_2_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D11DeviceContext2_INTERFACE_DEFINED__
+#define __ID3D11DeviceContext2_INTERFACE_DEFINED__
+
+/* interface ID3D11DeviceContext2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11DeviceContext2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("420d5b32-b90c-4da4-bef0-359f6a24a83a")
+ ID3D11DeviceContext2 : public ID3D11DeviceContext1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE UpdateTileMappings(
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ UINT NumTiledResourceRegions,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT NumRanges,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeFlags,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pTilePoolStartOffsets,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
+ /* [annotation] */
+ _In_ UINT Flags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CopyTileMappings(
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSourceTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ UINT Flags) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyTiles(
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBuffer,
+ /* [annotation] */
+ _In_ UINT64 BufferStartOffsetInBytes,
+ /* [annotation] */
+ _In_ UINT Flags) = 0;
+
+ virtual void STDMETHODCALLTYPE UpdateTiles(
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pDestTileRegionSize,
+ /* [annotation] */
+ _In_ const void *pSourceTileData,
+ /* [annotation] */
+ _In_ UINT Flags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ResizeTilePool(
+ /* [annotation] */
+ _In_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT64 NewSizeInBytes) = 0;
+
+ virtual void STDMETHODCALLTYPE TiledResourceBarrier(
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessBeforeBarrier,
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessAfterBarrier) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE IsAnnotationEnabled( void) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarkerInt(
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEventInt(
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11DeviceContext2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11DeviceContext2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11DeviceContext2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11DeviceContext2 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11PixelShader *pPixelShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11VertexShader *pVertexShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DrawIndexed )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT IndexCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation);
+
+ void ( STDMETHODCALLTYPE *Draw )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT VertexCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation);
+
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource,
+ /* [annotation] */
+ _In_ D3D11_MAP MapType,
+ /* [annotation] */
+ _In_ UINT MapFlags,
+ /* [annotation] */
+ _Out_opt_ D3D11_MAPPED_SUBRESOURCE *pMappedResource);
+
+ void ( STDMETHODCALLTYPE *Unmap )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IASetInputLayout )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11InputLayout *pInputLayout);
+
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pIndexBuffer,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT Offset);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT IndexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT VertexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11GeometryShader *pShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ D3D11_PRIMITIVE_TOPOLOGY Topology);
+
+ void ( STDMETHODCALLTYPE *VSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *Begin )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ void ( STDMETHODCALLTYPE *End )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *GetData )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( DataSize ) void *pData,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ UINT GetDataFlags);
+
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Predicate *pPredicate,
+ /* [annotation] */
+ _In_ BOOL PredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT NumRTVs,
+ /* [annotation] */
+ _In_reads_opt_(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_ UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *OMSetBlendState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11BlendState *pBlendState,
+ /* [annotation] */
+ _In_opt_ const FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _In_ UINT SampleMask);
+
+ void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilState *pDepthStencilState,
+ /* [annotation] */
+ _In_ UINT StencilRef);
+
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppSOTargets,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *DrawAuto )(
+ ID3D11DeviceContext2 * This);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *DrawInstancedIndirect )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountX,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountY,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountZ);
+
+ void ( STDMETHODCALLTYPE *DispatchIndirect )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *RSSetState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11RasterizerState *pRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ /* [annotation] */
+ _In_reads_opt_(NumViewports) const D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox);
+
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch);
+
+ void ( STDMETHODCALLTYPE *CopyStructureCount )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pDstBuffer,
+ /* [annotation] */
+ _In_ UINT DstAlignedByteOffset,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pSrcView);
+
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11RenderTargetView *pRenderTargetView,
+ /* [annotation] */
+ _In_ const FLOAT ColorRGBA[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const UINT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const FLOAT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_ UINT ClearFlags,
+ /* [annotation] */
+ _In_ FLOAT Depth,
+ /* [annotation] */
+ _In_ UINT8 Stencil);
+
+ void ( STDMETHODCALLTYPE *GenerateMips )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11ShaderResourceView *pShaderResourceView);
+
+ void ( STDMETHODCALLTYPE *SetResourceMinLOD )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ FLOAT MinLOD);
+
+ FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format);
+
+ void ( STDMETHODCALLTYPE *ExecuteCommandList )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11CommandList *pCommandList,
+ BOOL RestoreContextState);
+
+ void ( STDMETHODCALLTYPE *HSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11HullShader *pHullShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DomainShader *pDomainShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSSetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *CSSetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11ComputeShader *pComputeShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSSetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11PixelShader **ppPixelShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11VertexShader **ppVertexShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IAGetInputLayout )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11InputLayout **ppInputLayout);
+
+ void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppVertexBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Buffer **pIndexBuffer,
+ /* [annotation] */
+ _Out_opt_ DXGI_FORMAT *Format,
+ /* [annotation] */
+ _Out_opt_ UINT *Offset);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11GeometryShader **ppGeometryShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Out_ D3D11_PRIMITIVE_TOPOLOGY *pTopology);
+
+ void ( STDMETHODCALLTYPE *VSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *GetPredication )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Predicate **ppPredicate,
+ /* [annotation] */
+ _Out_opt_ BOOL *pPredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *OMGetBlendState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11BlendState **ppBlendState,
+ /* [annotation] */
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _Out_opt_ UINT *pSampleMask);
+
+ void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilState **ppDepthStencilState,
+ /* [annotation] */
+ _Out_opt_ UINT *pStencilRef);
+
+ void ( STDMETHODCALLTYPE *SOGetTargets )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppSOTargets);
+
+ void ( STDMETHODCALLTYPE *RSGetState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11RasterizerState **ppRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSGetViewports )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumViewports) D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSGetScissorRects )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumRects) D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *HSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11HullShader **ppHullShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11DomainShader **ppDomainShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSGetShaderResources )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *CSGetShader )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11ComputeShader **ppComputeShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSGetSamplers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D11DeviceContext2 * This);
+
+ void ( STDMETHODCALLTYPE *Flush )(
+ ID3D11DeviceContext2 * This);
+
+ D3D11_DEVICE_CONTEXT_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D11DeviceContext2 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetContextFlags )(
+ ID3D11DeviceContext2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *FinishCommandList )(
+ ID3D11DeviceContext2 * This,
+ BOOL RestoreDeferredContextState,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11CommandList **ppCommandList);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *DiscardView )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *SwapDeviceContextState )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3DDeviceContextState *pState,
+ /* [annotation] */
+ _Outptr_opt_ ID3DDeviceContextState **ppPreviousState);
+
+ void ( STDMETHODCALLTYPE *ClearView )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pView,
+ /* [annotation] */
+ _In_ const FLOAT Color[ 4 ],
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRect,
+ UINT NumRects);
+
+ void ( STDMETHODCALLTYPE *DiscardView1 )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects,
+ UINT NumRects);
+
+ HRESULT ( STDMETHODCALLTYPE *UpdateTileMappings )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ UINT NumTiledResourceRegions,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT NumRanges,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeFlags,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pTilePoolStartOffsets,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *CopyTileMappings )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSourceTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBuffer,
+ /* [annotation] */
+ _In_ UINT64 BufferStartOffsetInBytes,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ void ( STDMETHODCALLTYPE *UpdateTiles )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pDestTileRegionSize,
+ /* [annotation] */
+ _In_ const void *pSourceTileData,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeTilePool )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT64 NewSizeInBytes);
+
+ void ( STDMETHODCALLTYPE *TiledResourceBarrier )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessBeforeBarrier,
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessAfterBarrier);
+
+ BOOL ( STDMETHODCALLTYPE *IsAnnotationEnabled )(
+ ID3D11DeviceContext2 * This);
+
+ void ( STDMETHODCALLTYPE *SetMarkerInt )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data);
+
+ void ( STDMETHODCALLTYPE *BeginEventInt )(
+ ID3D11DeviceContext2 * This,
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data);
+
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D11DeviceContext2 * This);
+
+ END_INTERFACE
+ } ID3D11DeviceContext2Vtbl;
+
+ interface ID3D11DeviceContext2
+ {
+ CONST_VTBL struct ID3D11DeviceContext2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11DeviceContext2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11DeviceContext2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11DeviceContext2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11DeviceContext2_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11DeviceContext2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11DeviceContext2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11DeviceContext2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11DeviceContext2_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \
+ ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) )
+
+#define ID3D11DeviceContext2_Draw(This,VertexCount,StartVertexLocation) \
+ ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) )
+
+#define ID3D11DeviceContext2_Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) \
+ ( (This)->lpVtbl -> Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) )
+
+#define ID3D11DeviceContext2_Unmap(This,pResource,Subresource) \
+ ( (This)->lpVtbl -> Unmap(This,pResource,Subresource) )
+
+#define ID3D11DeviceContext2_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_IASetInputLayout(This,pInputLayout) \
+ ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) )
+
+#define ID3D11DeviceContext2_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext2_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext2_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext2_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext2_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_GSSetShader(This,pShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> GSSetShader(This,pShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_IASetPrimitiveTopology(This,Topology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) )
+
+#define ID3D11DeviceContext2_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_Begin(This,pAsync) \
+ ( (This)->lpVtbl -> Begin(This,pAsync) )
+
+#define ID3D11DeviceContext2_End(This,pAsync) \
+ ( (This)->lpVtbl -> End(This,pAsync) )
+
+#define ID3D11DeviceContext2_GetData(This,pAsync,pData,DataSize,GetDataFlags) \
+ ( (This)->lpVtbl -> GetData(This,pAsync,pData,DataSize,GetDataFlags) )
+
+#define ID3D11DeviceContext2_SetPredication(This,pPredicate,PredicateValue) \
+ ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) )
+
+#define ID3D11DeviceContext2_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) )
+
+#define ID3D11DeviceContext2_OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext2_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \
+ ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) )
+
+#define ID3D11DeviceContext2_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \
+ ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) )
+
+#define ID3D11DeviceContext2_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \
+ ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) )
+
+#define ID3D11DeviceContext2_DrawAuto(This) \
+ ( (This)->lpVtbl -> DrawAuto(This) )
+
+#define ID3D11DeviceContext2_DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext2_DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext2_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D11DeviceContext2_DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext2_RSSetState(This,pRasterizerState) \
+ ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) )
+
+#define ID3D11DeviceContext2_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D11DeviceContext2_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D11DeviceContext2_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) )
+
+#define ID3D11DeviceContext2_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D11DeviceContext2_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D11DeviceContext2_CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) \
+ ( (This)->lpVtbl -> CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) )
+
+#define ID3D11DeviceContext2_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) )
+
+#define ID3D11DeviceContext2_ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext2_ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext2_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) )
+
+#define ID3D11DeviceContext2_GenerateMips(This,pShaderResourceView) \
+ ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) )
+
+#define ID3D11DeviceContext2_SetResourceMinLOD(This,pResource,MinLOD) \
+ ( (This)->lpVtbl -> SetResourceMinLOD(This,pResource,MinLOD) )
+
+#define ID3D11DeviceContext2_GetResourceMinLOD(This,pResource) \
+ ( (This)->lpVtbl -> GetResourceMinLOD(This,pResource) )
+
+#define ID3D11DeviceContext2_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D11DeviceContext2_ExecuteCommandList(This,pCommandList,RestoreContextState) \
+ ( (This)->lpVtbl -> ExecuteCommandList(This,pCommandList,RestoreContextState) )
+
+#define ID3D11DeviceContext2_HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext2_CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext2_CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_IAGetInputLayout(This,ppInputLayout) \
+ ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) )
+
+#define ID3D11DeviceContext2_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext2_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext2_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_IAGetPrimitiveTopology(This,pTopology) \
+ ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) )
+
+#define ID3D11DeviceContext2_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_GetPredication(This,ppPredicate,pPredicateValue) \
+ ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) )
+
+#define ID3D11DeviceContext2_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \
+ ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) )
+
+#define ID3D11DeviceContext2_OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext2_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \
+ ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) )
+
+#define ID3D11DeviceContext2_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \
+ ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) )
+
+#define ID3D11DeviceContext2_SOGetTargets(This,NumBuffers,ppSOTargets) \
+ ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets) )
+
+#define ID3D11DeviceContext2_RSGetState(This,ppRasterizerState) \
+ ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) )
+
+#define ID3D11DeviceContext2_RSGetViewports(This,pNumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSGetViewports(This,pNumViewports,pViewports) )
+
+#define ID3D11DeviceContext2_RSGetScissorRects(This,pNumRects,pRects) \
+ ( (This)->lpVtbl -> RSGetScissorRects(This,pNumRects,pRects) )
+
+#define ID3D11DeviceContext2_HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext2_CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext2_CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext2_CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext2_CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext2_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D11DeviceContext2_Flush(This) \
+ ( (This)->lpVtbl -> Flush(This) )
+
+#define ID3D11DeviceContext2_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+#define ID3D11DeviceContext2_GetContextFlags(This) \
+ ( (This)->lpVtbl -> GetContextFlags(This) )
+
+#define ID3D11DeviceContext2_FinishCommandList(This,RestoreDeferredContextState,ppCommandList) \
+ ( (This)->lpVtbl -> FinishCommandList(This,RestoreDeferredContextState,ppCommandList) )
+
+
+#define ID3D11DeviceContext2_CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) \
+ ( (This)->lpVtbl -> CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) )
+
+#define ID3D11DeviceContext2_UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) \
+ ( (This)->lpVtbl -> UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) )
+
+#define ID3D11DeviceContext2_DiscardResource(This,pResource) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource) )
+
+#define ID3D11DeviceContext2_DiscardView(This,pResourceView) \
+ ( (This)->lpVtbl -> DiscardView(This,pResourceView) )
+
+#define ID3D11DeviceContext2_VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext2_SwapDeviceContextState(This,pState,ppPreviousState) \
+ ( (This)->lpVtbl -> SwapDeviceContextState(This,pState,ppPreviousState) )
+
+#define ID3D11DeviceContext2_ClearView(This,pView,Color,pRect,NumRects) \
+ ( (This)->lpVtbl -> ClearView(This,pView,Color,pRect,NumRects) )
+
+#define ID3D11DeviceContext2_DiscardView1(This,pResourceView,pRects,NumRects) \
+ ( (This)->lpVtbl -> DiscardView1(This,pResourceView,pRects,NumRects) )
+
+
+#define ID3D11DeviceContext2_UpdateTileMappings(This,pTiledResource,NumTiledResourceRegions,pTiledResourceRegionStartCoordinates,pTiledResourceRegionSizes,pTilePool,NumRanges,pRangeFlags,pTilePoolStartOffsets,pRangeTileCounts,Flags) \
+ ( (This)->lpVtbl -> UpdateTileMappings(This,pTiledResource,NumTiledResourceRegions,pTiledResourceRegionStartCoordinates,pTiledResourceRegionSizes,pTilePool,NumRanges,pRangeFlags,pTilePoolStartOffsets,pRangeTileCounts,Flags) )
+
+#define ID3D11DeviceContext2_CopyTileMappings(This,pDestTiledResource,pDestRegionStartCoordinate,pSourceTiledResource,pSourceRegionStartCoordinate,pTileRegionSize,Flags) \
+ ( (This)->lpVtbl -> CopyTileMappings(This,pDestTiledResource,pDestRegionStartCoordinate,pSourceTiledResource,pSourceRegionStartCoordinate,pTileRegionSize,Flags) )
+
+#define ID3D11DeviceContext2_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D11DeviceContext2_UpdateTiles(This,pDestTiledResource,pDestTileRegionStartCoordinate,pDestTileRegionSize,pSourceTileData,Flags) \
+ ( (This)->lpVtbl -> UpdateTiles(This,pDestTiledResource,pDestTileRegionStartCoordinate,pDestTileRegionSize,pSourceTileData,Flags) )
+
+#define ID3D11DeviceContext2_ResizeTilePool(This,pTilePool,NewSizeInBytes) \
+ ( (This)->lpVtbl -> ResizeTilePool(This,pTilePool,NewSizeInBytes) )
+
+#define ID3D11DeviceContext2_TiledResourceBarrier(This,pTiledResourceOrViewAccessBeforeBarrier,pTiledResourceOrViewAccessAfterBarrier) \
+ ( (This)->lpVtbl -> TiledResourceBarrier(This,pTiledResourceOrViewAccessBeforeBarrier,pTiledResourceOrViewAccessAfterBarrier) )
+
+#define ID3D11DeviceContext2_IsAnnotationEnabled(This) \
+ ( (This)->lpVtbl -> IsAnnotationEnabled(This) )
+
+#define ID3D11DeviceContext2_SetMarkerInt(This,pLabel,Data) \
+ ( (This)->lpVtbl -> SetMarkerInt(This,pLabel,Data) )
+
+#define ID3D11DeviceContext2_BeginEventInt(This,pLabel,Data) \
+ ( (This)->lpVtbl -> BeginEventInt(This,pLabel,Data) )
+
+#define ID3D11DeviceContext2_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11DeviceContext2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11Device2_INTERFACE_DEFINED__
+#define __ID3D11Device2_INTERFACE_DEFINED__
+
+/* interface ID3D11Device2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Device2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9d06dffa-d1e5-4d07-83a8-1bb123f2f841")
+ ID3D11Device2 : public ID3D11Device1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetImmediateContext2(
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext2 **ppImmediateContext) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext2(
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext2 **ppDeferredContext) = 0;
+
+ virtual void STDMETHODCALLTYPE GetResourceTiling(
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ /* [annotation] */
+ _Out_opt_ D3D11_PACKED_MIP_DESC *pPackedMipDesc,
+ /* [annotation] */
+ _Out_opt_ D3D11_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ /* [annotation] */
+ _In_ UINT FirstSubresourceTilingToGet,
+ /* [annotation] */
+ _Out_writes_(*pNumSubresourceTilings) D3D11_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels1(
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _In_ UINT Flags,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Device2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Device2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Device2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Device2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_BUFFER_DESC *pDesc,
+ /* [annotation] */
+ _In_opt_ const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Buffer **ppBuffer);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE1D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture1D **ppTexture1D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE2D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture2D **ppTexture2D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE3D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture3D **ppTexture3D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ShaderResourceView **ppSRView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView **ppUAView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RenderTargetView **ppRTView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11InputLayout **ppInputLayout);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VertexShader **ppVertexShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_reads_opt_(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
+ /* [annotation] */
+ _In_reads_opt_(NumStrides) const UINT *pBufferStrides,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
+ /* [annotation] */
+ _In_ UINT RasterizedStream,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11PixelShader **ppPixelShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateHullShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11HullShader **ppHullShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DomainShader **ppDomainShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ComputeShader **ppComputeShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11ClassLinkage **ppLinkage);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilState **ppDepthStencilState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_SAMPLER_DESC *pSamplerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11SamplerState **ppSamplerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pQueryDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Query **ppQuery);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pPredicateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Predicate **ppPredicate);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pCounterDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Counter **ppCounter);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )(
+ ID3D11Device2 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID ReturnedInterface,
+ /* [annotation] */
+ _COM_Outptr_opt_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFormatSupport);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels);
+
+ void ( STDMETHODCALLTYPE *CheckCounterInfo )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_INFO *pCounterInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_TYPE *pType,
+ /* [annotation] */
+ _Out_ UINT *pActiveCounters,
+ /* [annotation] */
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNameLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
+ /* [annotation] */
+ _Inout_opt_ UINT *pUnitsLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
+ /* [annotation] */
+ _Inout_opt_ UINT *pDescriptionLength);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D11Device2 * This,
+ D3D11_FEATURE Feature,
+ /* [annotation] */
+ _Out_writes_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )(
+ ID3D11Device2 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
+ ID3D11Device2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D11Device2 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )(
+ ID3D11Device2 * This,
+ UINT RaiseFlags);
+
+ UINT ( STDMETHODCALLTYPE *GetExceptionMode )(
+ ID3D11Device2 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext1 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext1 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext1 )(
+ ID3D11Device2 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext1 **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC1 *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState1 **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState1 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC1 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState1 **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeviceContextState )(
+ ID3D11Device2 * This,
+ UINT Flags,
+ /* [annotation] */
+ _In_reads_( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels,
+ UINT FeatureLevels,
+ UINT SDKVersion,
+ REFIID EmulatedInterface,
+ /* [annotation] */
+ _Out_opt_ D3D_FEATURE_LEVEL *pChosenFeatureLevel,
+ /* [annotation] */
+ _Out_opt_ ID3DDeviceContextState **ppContextState);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource1 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResourceByName )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ LPCWSTR lpName,
+ /* [annotation] */
+ _In_ DWORD dwDesiredAccess,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext2 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext2 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext2 )(
+ ID3D11Device2 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext2 **ppDeferredContext);
+
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ /* [annotation] */
+ _Out_opt_ D3D11_PACKED_MIP_DESC *pPackedMipDesc,
+ /* [annotation] */
+ _Out_opt_ D3D11_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ /* [annotation] */
+ _In_ UINT FirstSubresourceTilingToGet,
+ /* [annotation] */
+ _Out_writes_(*pNumSubresourceTilings) D3D11_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels1 )(
+ ID3D11Device2 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _In_ UINT Flags,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels);
+
+ END_INTERFACE
+ } ID3D11Device2Vtbl;
+
+ interface ID3D11Device2
+ {
+ CONST_VTBL struct ID3D11Device2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Device2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Device2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Device2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Device2_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \
+ ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) )
+
+#define ID3D11Device2_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \
+ ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) )
+
+#define ID3D11Device2_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \
+ ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) )
+
+#define ID3D11Device2_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \
+ ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) )
+
+#define ID3D11Device2_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) )
+
+#define ID3D11Device2_CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) )
+
+#define ID3D11Device2_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) )
+
+#define ID3D11Device2_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) )
+
+#define ID3D11Device2_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \
+ ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) )
+
+#define ID3D11Device2_CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) \
+ ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) )
+
+#define ID3D11Device2_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device2_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device2_CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) \
+ ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) )
+
+#define ID3D11Device2_CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) \
+ ( (This)->lpVtbl -> CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) )
+
+#define ID3D11Device2_CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) \
+ ( (This)->lpVtbl -> CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) )
+
+#define ID3D11Device2_CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) \
+ ( (This)->lpVtbl -> CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) )
+
+#define ID3D11Device2_CreateClassLinkage(This,ppLinkage) \
+ ( (This)->lpVtbl -> CreateClassLinkage(This,ppLinkage) )
+
+#define ID3D11Device2_CreateBlendState(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device2_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \
+ ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) )
+
+#define ID3D11Device2_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device2_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \
+ ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) )
+
+#define ID3D11Device2_CreateQuery(This,pQueryDesc,ppQuery) \
+ ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) )
+
+#define ID3D11Device2_CreatePredicate(This,pPredicateDesc,ppPredicate) \
+ ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) )
+
+#define ID3D11Device2_CreateCounter(This,pCounterDesc,ppCounter) \
+ ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) )
+
+#define ID3D11Device2_CreateDeferredContext(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device2_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) )
+
+#define ID3D11Device2_CheckFormatSupport(This,Format,pFormatSupport) \
+ ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) )
+
+#define ID3D11Device2_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \
+ ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) )
+
+#define ID3D11Device2_CheckCounterInfo(This,pCounterInfo) \
+ ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) )
+
+#define ID3D11Device2_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \
+ ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) )
+
+#define ID3D11Device2_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D11Device2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Device2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Device2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D11Device2_GetFeatureLevel(This) \
+ ( (This)->lpVtbl -> GetFeatureLevel(This) )
+
+#define ID3D11Device2_GetCreationFlags(This) \
+ ( (This)->lpVtbl -> GetCreationFlags(This) )
+
+#define ID3D11Device2_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D11Device2_GetImmediateContext(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext(This,ppImmediateContext) )
+
+#define ID3D11Device2_SetExceptionMode(This,RaiseFlags) \
+ ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) )
+
+#define ID3D11Device2_GetExceptionMode(This) \
+ ( (This)->lpVtbl -> GetExceptionMode(This) )
+
+
+#define ID3D11Device2_GetImmediateContext1(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext1(This,ppImmediateContext) )
+
+#define ID3D11Device2_CreateDeferredContext1(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext1(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device2_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device2_CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device2_CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) \
+ ( (This)->lpVtbl -> CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) )
+
+#define ID3D11Device2_OpenSharedResource1(This,hResource,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource1(This,hResource,returnedInterface,ppResource) )
+
+#define ID3D11Device2_OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) )
+
+
+#define ID3D11Device2_GetImmediateContext2(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext2(This,ppImmediateContext) )
+
+#define ID3D11Device2_CreateDeferredContext2(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext2(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device2_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+
+#define ID3D11Device2_CheckMultisampleQualityLevels1(This,Format,SampleCount,Flags,pNumQualityLevels) \
+ ( (This)->lpVtbl -> CheckMultisampleQualityLevels1(This,Format,SampleCount,Flags,pNumQualityLevels) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Device2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_2_0000_0002 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D11DeviceContext2,0x420d5b32,0xb90c,0x4da4,0xbe,0xf0,0x35,0x9f,0x6a,0x24,0xa8,0x3a);
+DEFINE_GUID(IID_ID3D11Device2,0x9d06dffa,0xd1e5,0x4d07,0x83,0xa8,0x1b,0xb1,0x23,0xf2,0xf8,0x41);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_2_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_2_0000_0002_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h
new file mode 100644
index 00000000000..76922367dc4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h
@@ -0,0 +1,4817 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d11_3_h__
+#define __d3d11_3_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D11Texture2D1_FWD_DEFINED__
+#define __ID3D11Texture2D1_FWD_DEFINED__
+typedef interface ID3D11Texture2D1 ID3D11Texture2D1;
+
+#endif /* __ID3D11Texture2D1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11Texture3D1_FWD_DEFINED__
+#define __ID3D11Texture3D1_FWD_DEFINED__
+typedef interface ID3D11Texture3D1 ID3D11Texture3D1;
+
+#endif /* __ID3D11Texture3D1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11RasterizerState2_FWD_DEFINED__
+#define __ID3D11RasterizerState2_FWD_DEFINED__
+typedef interface ID3D11RasterizerState2 ID3D11RasterizerState2;
+
+#endif /* __ID3D11RasterizerState2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11ShaderResourceView1_FWD_DEFINED__
+#define __ID3D11ShaderResourceView1_FWD_DEFINED__
+typedef interface ID3D11ShaderResourceView1 ID3D11ShaderResourceView1;
+
+#endif /* __ID3D11ShaderResourceView1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11RenderTargetView1_FWD_DEFINED__
+#define __ID3D11RenderTargetView1_FWD_DEFINED__
+typedef interface ID3D11RenderTargetView1 ID3D11RenderTargetView1;
+
+#endif /* __ID3D11RenderTargetView1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11UnorderedAccessView1_FWD_DEFINED__
+#define __ID3D11UnorderedAccessView1_FWD_DEFINED__
+typedef interface ID3D11UnorderedAccessView1 ID3D11UnorderedAccessView1;
+
+#endif /* __ID3D11UnorderedAccessView1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11Query1_FWD_DEFINED__
+#define __ID3D11Query1_FWD_DEFINED__
+typedef interface ID3D11Query1 ID3D11Query1;
+
+#endif /* __ID3D11Query1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11DeviceContext3_FWD_DEFINED__
+#define __ID3D11DeviceContext3_FWD_DEFINED__
+typedef interface ID3D11DeviceContext3 ID3D11DeviceContext3;
+
+#endif /* __ID3D11DeviceContext3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11Device3_FWD_DEFINED__
+#define __ID3D11Device3_FWD_DEFINED__
+typedef interface ID3D11Device3 ID3D11Device3;
+
+#endif /* __ID3D11Device3_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgi1_3.h"
+#include "d3dcommon.h"
+#include "d3d11_2.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0000 */
+/* [local] */
+
+#ifdef __cplusplus
+}
+#endif
+#include "d3d11_2.h" //
+#ifdef __cplusplus
+extern "C"{
+#endif
+typedef
+enum D3D11_CONTEXT_TYPE
+ {
+ D3D11_CONTEXT_TYPE_ALL = 0,
+ D3D11_CONTEXT_TYPE_3D = 1,
+ D3D11_CONTEXT_TYPE_COMPUTE = 2,
+ D3D11_CONTEXT_TYPE_COPY = 3,
+ D3D11_CONTEXT_TYPE_VIDEO = 4
+ } D3D11_CONTEXT_TYPE;
+
+typedef
+enum D3D11_TEXTURE_LAYOUT
+ {
+ D3D11_TEXTURE_LAYOUT_UNDEFINED = 0,
+ D3D11_TEXTURE_LAYOUT_ROW_MAJOR = 1,
+ D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE = 2
+ } D3D11_TEXTURE_LAYOUT;
+
+typedef struct D3D11_TEXTURE2D_DESC1
+ {
+ UINT Width;
+ UINT Height;
+ UINT MipLevels;
+ UINT ArraySize;
+ DXGI_FORMAT Format;
+ DXGI_SAMPLE_DESC SampleDesc;
+ D3D11_USAGE Usage;
+ UINT BindFlags;
+ UINT CPUAccessFlags;
+ UINT MiscFlags;
+ D3D11_TEXTURE_LAYOUT TextureLayout;
+ } D3D11_TEXTURE2D_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_TEXTURE2D_DESC1 : public D3D11_TEXTURE2D_DESC1
+{
+ CD3D11_TEXTURE2D_DESC1()
+ {}
+ explicit CD3D11_TEXTURE2D_DESC1( const D3D11_TEXTURE2D_DESC1& o ) :
+ D3D11_TEXTURE2D_DESC1( o )
+ {}
+ explicit CD3D11_TEXTURE2D_DESC1(
+ DXGI_FORMAT format,
+ UINT width,
+ UINT height,
+ UINT arraySize = 1,
+ UINT mipLevels = 0,
+ UINT bindFlags = D3D11_BIND_SHADER_RESOURCE,
+ D3D11_USAGE usage = D3D11_USAGE_DEFAULT,
+ UINT cpuaccessFlags = 0,
+ UINT sampleCount = 1,
+ UINT sampleQuality = 0,
+ UINT miscFlags = 0,
+ D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
+ {
+ Width = width;
+ Height = height;
+ MipLevels = mipLevels;
+ ArraySize = arraySize;
+ Format = format;
+ SampleDesc.Count = sampleCount;
+ SampleDesc.Quality = sampleQuality;
+ Usage = usage;
+ BindFlags = bindFlags;
+ CPUAccessFlags = cpuaccessFlags;
+ MiscFlags = miscFlags;
+ TextureLayout = textureLayout;
+ }
+ explicit CD3D11_TEXTURE2D_DESC1(
+ const D3D11_TEXTURE2D_DESC &desc,
+ D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
+ {
+ Width = desc.Width;
+ Height = desc.Height;
+ MipLevels = desc.MipLevels;
+ ArraySize = desc.ArraySize;
+ Format = desc.Format;
+ SampleDesc.Count = desc.SampleDesc.Count;
+ SampleDesc.Quality = desc. SampleDesc.Quality;
+ Usage = desc.Usage;
+ BindFlags = desc.BindFlags;
+ CPUAccessFlags = desc.CPUAccessFlags;
+ MiscFlags = desc.MiscFlags;
+ TextureLayout = textureLayout;
+ }
+ ~CD3D11_TEXTURE2D_DESC1() {}
+ operator const D3D11_TEXTURE2D_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D11Texture2D1_INTERFACE_DEFINED__
+#define __ID3D11Texture2D1_INTERFACE_DEFINED__
+
+/* interface ID3D11Texture2D1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Texture2D1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("51218251-1E33-4617-9CCB-4D3A4367E7BB")
+ ID3D11Texture2D1 : public ID3D11Texture2D
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE2D_DESC1 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Texture2D1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Texture2D1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Texture2D1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Texture2D1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetType )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
+
+ void ( STDMETHODCALLTYPE *SetEvictionPriority )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _In_ UINT EvictionPriority);
+
+ UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
+ ID3D11Texture2D1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE2D_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11Texture2D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE2D_DESC1 *pDesc);
+
+ END_INTERFACE
+ } ID3D11Texture2D1Vtbl;
+
+ interface ID3D11Texture2D1
+ {
+ CONST_VTBL struct ID3D11Texture2D1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Texture2D1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Texture2D1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Texture2D1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Texture2D1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11Texture2D1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Texture2D1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Texture2D1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11Texture2D1_GetType(This,pResourceDimension) \
+ ( (This)->lpVtbl -> GetType(This,pResourceDimension) )
+
+#define ID3D11Texture2D1_SetEvictionPriority(This,EvictionPriority) \
+ ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) )
+
+#define ID3D11Texture2D1_GetEvictionPriority(This) \
+ ( (This)->lpVtbl -> GetEvictionPriority(This) )
+
+
+#define ID3D11Texture2D1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11Texture2D1_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Texture2D1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0001 */
+/* [local] */
+
+typedef struct D3D11_TEXTURE3D_DESC1
+ {
+ UINT Width;
+ UINT Height;
+ UINT Depth;
+ UINT MipLevels;
+ DXGI_FORMAT Format;
+ D3D11_USAGE Usage;
+ UINT BindFlags;
+ UINT CPUAccessFlags;
+ UINT MiscFlags;
+ D3D11_TEXTURE_LAYOUT TextureLayout;
+ } D3D11_TEXTURE3D_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_TEXTURE3D_DESC1 : public D3D11_TEXTURE3D_DESC1
+{
+ CD3D11_TEXTURE3D_DESC1()
+ {}
+ explicit CD3D11_TEXTURE3D_DESC1( const D3D11_TEXTURE3D_DESC1& o ) :
+ D3D11_TEXTURE3D_DESC1( o )
+ {}
+ explicit CD3D11_TEXTURE3D_DESC1(
+ DXGI_FORMAT format,
+ UINT width,
+ UINT height,
+ UINT depth,
+ UINT mipLevels = 0,
+ UINT bindFlags = D3D11_BIND_SHADER_RESOURCE,
+ D3D11_USAGE usage = D3D11_USAGE_DEFAULT,
+ UINT cpuaccessFlags = 0,
+ UINT miscFlags = 0,
+ D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
+ {
+ Width = width;
+ Height = height;
+ Depth = depth;
+ MipLevels = mipLevels;
+ Format = format;
+ Usage = usage;
+ BindFlags = bindFlags;
+ CPUAccessFlags = cpuaccessFlags;
+ MiscFlags = miscFlags;
+ TextureLayout = textureLayout;
+ }
+ explicit CD3D11_TEXTURE3D_DESC1(
+ const D3D11_TEXTURE3D_DESC &desc,
+ D3D11_TEXTURE_LAYOUT textureLayout = D3D11_TEXTURE_LAYOUT_UNDEFINED)
+ {
+ Width = desc.Width;
+ Height = desc.Height;
+ Depth = desc.Depth;
+ MipLevels = desc.MipLevels;
+ Format = desc.Format;
+ Usage = desc.Usage;
+ BindFlags = desc.BindFlags;
+ CPUAccessFlags = desc.CPUAccessFlags;
+ MiscFlags = desc.MiscFlags;
+ TextureLayout = textureLayout;
+ }
+ ~CD3D11_TEXTURE3D_DESC1() {}
+ operator const D3D11_TEXTURE3D_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D11Texture3D1_INTERFACE_DEFINED__
+#define __ID3D11Texture3D1_INTERFACE_DEFINED__
+
+/* interface ID3D11Texture3D1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Texture3D1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0C711683-2853-4846-9BB0-F3E60639E46A")
+ ID3D11Texture3D1 : public ID3D11Texture3D
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE3D_DESC1 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Texture3D1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Texture3D1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Texture3D1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Texture3D1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetType )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RESOURCE_DIMENSION *pResourceDimension);
+
+ void ( STDMETHODCALLTYPE *SetEvictionPriority )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _In_ UINT EvictionPriority);
+
+ UINT ( STDMETHODCALLTYPE *GetEvictionPriority )(
+ ID3D11Texture3D1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE3D_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11Texture3D1 * This,
+ /* [annotation] */
+ _Out_ D3D11_TEXTURE3D_DESC1 *pDesc);
+
+ END_INTERFACE
+ } ID3D11Texture3D1Vtbl;
+
+ interface ID3D11Texture3D1
+ {
+ CONST_VTBL struct ID3D11Texture3D1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Texture3D1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Texture3D1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Texture3D1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Texture3D1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11Texture3D1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Texture3D1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Texture3D1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11Texture3D1_GetType(This,pResourceDimension) \
+ ( (This)->lpVtbl -> GetType(This,pResourceDimension) )
+
+#define ID3D11Texture3D1_SetEvictionPriority(This,EvictionPriority) \
+ ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) )
+
+#define ID3D11Texture3D1_GetEvictionPriority(This) \
+ ( (This)->lpVtbl -> GetEvictionPriority(This) )
+
+
+#define ID3D11Texture3D1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11Texture3D1_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Texture3D1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0002 */
+/* [local] */
+
+typedef
+enum D3D11_CONSERVATIVE_RASTERIZATION_MODE
+ {
+ D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0,
+ D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON = 1
+ } D3D11_CONSERVATIVE_RASTERIZATION_MODE;
+
+typedef struct D3D11_RASTERIZER_DESC2
+ {
+ D3D11_FILL_MODE FillMode;
+ D3D11_CULL_MODE CullMode;
+ BOOL FrontCounterClockwise;
+ INT DepthBias;
+ FLOAT DepthBiasClamp;
+ FLOAT SlopeScaledDepthBias;
+ BOOL DepthClipEnable;
+ BOOL ScissorEnable;
+ BOOL MultisampleEnable;
+ BOOL AntialiasedLineEnable;
+ UINT ForcedSampleCount;
+ D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
+ } D3D11_RASTERIZER_DESC2;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_RASTERIZER_DESC2 : public D3D11_RASTERIZER_DESC2
+{
+ CD3D11_RASTERIZER_DESC2()
+ {}
+ explicit CD3D11_RASTERIZER_DESC2( const D3D11_RASTERIZER_DESC2& o ) :
+ D3D11_RASTERIZER_DESC2( o )
+ {}
+ explicit CD3D11_RASTERIZER_DESC2( CD3D11_DEFAULT )
+ {
+ FillMode = D3D11_FILL_SOLID;
+ CullMode = D3D11_CULL_BACK;
+ FrontCounterClockwise = FALSE;
+ DepthBias = D3D11_DEFAULT_DEPTH_BIAS;
+ DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP;
+ SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
+ DepthClipEnable = TRUE;
+ ScissorEnable = FALSE;
+ MultisampleEnable = FALSE;
+ AntialiasedLineEnable = FALSE;
+ ForcedSampleCount = 0;
+ ConservativeRaster = D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF;
+ }
+ explicit CD3D11_RASTERIZER_DESC2(
+ D3D11_FILL_MODE fillMode,
+ D3D11_CULL_MODE cullMode,
+ BOOL frontCounterClockwise,
+ INT depthBias,
+ FLOAT depthBiasClamp,
+ FLOAT slopeScaledDepthBias,
+ BOOL depthClipEnable,
+ BOOL scissorEnable,
+ BOOL multisampleEnable,
+ BOOL antialiasedLineEnable,
+ UINT forcedSampleCount,
+ D3D11_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster )
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ ScissorEnable = scissorEnable;
+ MultisampleEnable = multisampleEnable;
+ AntialiasedLineEnable = antialiasedLineEnable;
+ ForcedSampleCount = forcedSampleCount;
+ ConservativeRaster = conservativeRaster;
+ }
+ ~CD3D11_RASTERIZER_DESC2() {}
+ operator const D3D11_RASTERIZER_DESC2&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3D11RasterizerState2_INTERFACE_DEFINED__
+#define __ID3D11RasterizerState2_INTERFACE_DEFINED__
+
+/* interface ID3D11RasterizerState2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11RasterizerState2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6fbd02fb-209f-46c4-b059-2ed15586a6ac")
+ ID3D11RasterizerState2 : public ID3D11RasterizerState1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc2(
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC2 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11RasterizerState2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11RasterizerState2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11RasterizerState2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11RasterizerState2 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC1 *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc2 )(
+ ID3D11RasterizerState2 * This,
+ /* [annotation] */
+ _Out_ D3D11_RASTERIZER_DESC2 *pDesc);
+
+ END_INTERFACE
+ } ID3D11RasterizerState2Vtbl;
+
+ interface ID3D11RasterizerState2
+ {
+ CONST_VTBL struct ID3D11RasterizerState2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11RasterizerState2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11RasterizerState2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11RasterizerState2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11RasterizerState2_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11RasterizerState2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11RasterizerState2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11RasterizerState2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11RasterizerState2_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11RasterizerState2_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+
+#define ID3D11RasterizerState2_GetDesc2(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc2(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11RasterizerState2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0003 */
+/* [local] */
+
+typedef struct D3D11_TEX2D_SRV1
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_SRV1;
+
+typedef struct D3D11_TEX2D_ARRAY_SRV1
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_ARRAY_SRV1;
+
+typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC1
+ {
+ DXGI_FORMAT Format;
+ D3D11_SRV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_BUFFER_SRV Buffer;
+ D3D11_TEX1D_SRV Texture1D;
+ D3D11_TEX1D_ARRAY_SRV Texture1DArray;
+ D3D11_TEX2D_SRV1 Texture2D;
+ D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
+ D3D11_TEX2DMS_SRV Texture2DMS;
+ D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
+ D3D11_TEX3D_SRV Texture3D;
+ D3D11_TEXCUBE_SRV TextureCube;
+ D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
+ D3D11_BUFFEREX_SRV BufferEx;
+ } ;
+ } D3D11_SHADER_RESOURCE_VIEW_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_SHADER_RESOURCE_VIEW_DESC1 : public D3D11_SHADER_RESOURCE_VIEW_DESC1
+{
+ CD3D11_SHADER_RESOURCE_VIEW_DESC1()
+ {}
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1( const D3D11_SHADER_RESOURCE_VIEW_DESC1& o ) :
+ D3D11_SHADER_RESOURCE_VIEW_DESC1( o )
+ {}
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
+ D3D11_SRV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mostDetailedMip = 0, // FirstElement for BUFFER
+ UINT mipLevels = -1, // NumElements for BUFFER
+ UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
+ UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY
+ UINT flags = 0, // BUFFEREX only
+ UINT planeSlice = 0 ) // Texture2D and Texture2DArray only
+ {
+ Format = format;
+ ViewDimension = viewDimension;
+ switch (viewDimension)
+ {
+ case D3D11_SRV_DIMENSION_BUFFER:
+ Buffer.FirstElement = mostDetailedMip;
+ Buffer.NumElements = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE1D:
+ Texture1D.MostDetailedMip = mostDetailedMip;
+ Texture1D.MipLevels = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MostDetailedMip = mostDetailedMip;
+ Texture1DArray.MipLevels = mipLevels;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2D:
+ Texture2D.MostDetailedMip = mostDetailedMip;
+ Texture2D.MipLevels = mipLevels;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MostDetailedMip = mostDetailedMip;
+ Texture2DArray.MipLevels = mipLevels;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DMS:
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
+ Texture2DMSArray.FirstArraySlice = firstArraySlice;
+ Texture2DMSArray.ArraySize = arraySize;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE3D:
+ Texture3D.MostDetailedMip = mostDetailedMip;
+ Texture3D.MipLevels = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURECUBE:
+ TextureCube.MostDetailedMip = mostDetailedMip;
+ TextureCube.MipLevels = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
+ TextureCubeArray.MostDetailedMip = mostDetailedMip;
+ TextureCubeArray.MipLevels = mipLevels;
+ TextureCubeArray.First2DArrayFace = firstArraySlice;
+ TextureCubeArray.NumCubes = arraySize;
+ break;
+ case D3D11_SRV_DIMENSION_BUFFEREX:
+ BufferEx.FirstElement = mostDetailedMip;
+ BufferEx.NumElements = mipLevels;
+ BufferEx.Flags = flags;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
+ _In_ ID3D11Buffer*,
+ DXGI_FORMAT format,
+ UINT firstElement,
+ UINT numElements,
+ UINT flags = 0 )
+ {
+ Format = format;
+ ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
+ BufferEx.FirstElement = firstElement;
+ BufferEx.NumElements = numElements;
+ BufferEx.Flags = flags;
+ }
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
+ _In_ ID3D11Texture1D* pTex1D,
+ D3D11_SRV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mostDetailedMip = 0,
+ UINT mipLevels = -1,
+ UINT firstArraySlice = 0,
+ UINT arraySize = -1 )
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels ||
+ (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension))
+ {
+ D3D11_TEXTURE1D_DESC TexDesc;
+ pTex1D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
+ if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_SRV_DIMENSION_TEXTURE1D:
+ Texture1D.MostDetailedMip = mostDetailedMip;
+ Texture1D.MipLevels = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MostDetailedMip = mostDetailedMip;
+ Texture1DArray.MipLevels = mipLevels;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
+ _In_ ID3D11Texture2D* pTex2D,
+ D3D11_SRV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mostDetailedMip = 0,
+ UINT mipLevels = -1,
+ UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
+ UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY
+ UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D or TEXTURE2DARRAY
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format ||
+ (-1 == mipLevels &&
+ D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension &&
+ D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) ||
+ (-1 == arraySize &&
+ (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
+ D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension ||
+ D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)))
+ {
+ D3D11_TEXTURE2D_DESC TexDesc;
+ pTex2D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
+ if (-1 == arraySize)
+ {
+ arraySize = TexDesc.ArraySize - firstArraySlice;
+ if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension) arraySize /= 6;
+ }
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_SRV_DIMENSION_TEXTURE2D:
+ Texture2D.MostDetailedMip = mostDetailedMip;
+ Texture2D.MipLevels = mipLevels;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MostDetailedMip = mostDetailedMip;
+ Texture2DArray.MipLevels = mipLevels;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DMS:
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
+ Texture2DMSArray.FirstArraySlice = firstArraySlice;
+ Texture2DMSArray.ArraySize = arraySize;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURECUBE:
+ TextureCube.MostDetailedMip = mostDetailedMip;
+ TextureCube.MipLevels = mipLevels;
+ break;
+ case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
+ TextureCubeArray.MostDetailedMip = mostDetailedMip;
+ TextureCubeArray.MipLevels = mipLevels;
+ TextureCubeArray.First2DArrayFace = firstArraySlice;
+ TextureCubeArray.NumCubes = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_SHADER_RESOURCE_VIEW_DESC1(
+ _In_ ID3D11Texture3D* pTex3D,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mostDetailedMip = 0,
+ UINT mipLevels = -1 )
+ {
+ ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
+ if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels)
+ {
+ D3D11_TEXTURE3D_DESC TexDesc;
+ pTex3D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
+ }
+ Format = format;
+ Texture3D.MostDetailedMip = mostDetailedMip;
+ Texture3D.MipLevels = mipLevels;
+ }
+ ~CD3D11_SHADER_RESOURCE_VIEW_DESC1() {}
+ operator const D3D11_SHADER_RESOURCE_VIEW_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0003_v0_0_s_ifspec;
+
+#ifndef __ID3D11ShaderResourceView1_INTERFACE_DEFINED__
+#define __ID3D11ShaderResourceView1_INTERFACE_DEFINED__
+
+/* interface ID3D11ShaderResourceView1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11ShaderResourceView1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("91308b87-9040-411d-8c67-c39253ce3802")
+ ID3D11ShaderResourceView1 : public ID3D11ShaderResourceView
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc1) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11ShaderResourceView1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11ShaderResourceView1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11ShaderResourceView1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11ShaderResourceView1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11ShaderResourceView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc1);
+
+ END_INTERFACE
+ } ID3D11ShaderResourceView1Vtbl;
+
+ interface ID3D11ShaderResourceView1
+ {
+ CONST_VTBL struct ID3D11ShaderResourceView1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11ShaderResourceView1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11ShaderResourceView1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11ShaderResourceView1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11ShaderResourceView1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11ShaderResourceView1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11ShaderResourceView1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11ShaderResourceView1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11ShaderResourceView1_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11ShaderResourceView1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11ShaderResourceView1_GetDesc1(This,pDesc1) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc1) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11ShaderResourceView1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0004 */
+/* [local] */
+
+typedef struct D3D11_TEX2D_RTV1
+ {
+ UINT MipSlice;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_RTV1;
+
+typedef struct D3D11_TEX2D_ARRAY_RTV1
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_ARRAY_RTV1;
+
+typedef struct D3D11_RENDER_TARGET_VIEW_DESC1
+ {
+ DXGI_FORMAT Format;
+ D3D11_RTV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_BUFFER_RTV Buffer;
+ D3D11_TEX1D_RTV Texture1D;
+ D3D11_TEX1D_ARRAY_RTV Texture1DArray;
+ D3D11_TEX2D_RTV1 Texture2D;
+ D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
+ D3D11_TEX2DMS_RTV Texture2DMS;
+ D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
+ D3D11_TEX3D_RTV Texture3D;
+ } ;
+ } D3D11_RENDER_TARGET_VIEW_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_RENDER_TARGET_VIEW_DESC1 : public D3D11_RENDER_TARGET_VIEW_DESC1
+{
+ CD3D11_RENDER_TARGET_VIEW_DESC1()
+ {}
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1( const D3D11_RENDER_TARGET_VIEW_DESC1& o ) :
+ D3D11_RENDER_TARGET_VIEW_DESC1( o )
+ {}
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
+ D3D11_RTV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0, // FirstElement for BUFFER
+ UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D
+ UINT arraySize = -1, // WSize for TEXTURE3D
+ UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D and TEXTURE2DARRAY
+ {
+ Format = format;
+ ViewDimension = viewDimension;
+ switch (viewDimension)
+ {
+ case D3D11_RTV_DIMENSION_BUFFER:
+ Buffer.FirstElement = mipSlice;
+ Buffer.NumElements = firstArraySlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE1D:
+ Texture1D.MipSlice = mipSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MipSlice = mipSlice;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2D:
+ Texture2D.MipSlice = mipSlice;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MipSlice = mipSlice;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DMS:
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
+ Texture2DMSArray.FirstArraySlice = firstArraySlice;
+ Texture2DMSArray.ArraySize = arraySize;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE3D:
+ Texture3D.MipSlice = mipSlice;
+ Texture3D.FirstWSlice = firstArraySlice;
+ Texture3D.WSize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
+ _In_ ID3D11Buffer*,
+ DXGI_FORMAT format,
+ UINT firstElement,
+ UINT numElements )
+ {
+ Format = format;
+ ViewDimension = D3D11_RTV_DIMENSION_BUFFER;
+ Buffer.FirstElement = firstElement;
+ Buffer.NumElements = numElements;
+ }
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
+ _In_ ID3D11Texture1D* pTex1D,
+ D3D11_RTV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstArraySlice = 0,
+ UINT arraySize = -1 )
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format ||
+ (-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension))
+ {
+ D3D11_TEXTURE1D_DESC TexDesc;
+ pTex1D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_RTV_DIMENSION_TEXTURE1D:
+ Texture1D.MipSlice = mipSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MipSlice = mipSlice;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
+ _In_ ID3D11Texture2D* pTex2D,
+ D3D11_RTV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstArraySlice = 0,
+ UINT arraySize = -1,
+ UINT planeSlice = 0 )
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format ||
+ (-1 == arraySize &&
+ (D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
+ D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
+ {
+ D3D11_TEXTURE2D_DESC TexDesc;
+ pTex2D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_RTV_DIMENSION_TEXTURE2D:
+ Texture2D.MipSlice = mipSlice;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MipSlice = mipSlice;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DMS:
+ break;
+ case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY:
+ Texture2DMSArray.FirstArraySlice = firstArraySlice;
+ Texture2DMSArray.ArraySize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_RENDER_TARGET_VIEW_DESC1(
+ _In_ ID3D11Texture3D* pTex3D,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstWSlice = 0,
+ UINT wSize = -1 )
+ {
+ ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
+ if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
+ {
+ D3D11_TEXTURE3D_DESC TexDesc;
+ pTex3D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice;
+ }
+ Format = format;
+ Texture3D.MipSlice = mipSlice;
+ Texture3D.FirstWSlice = firstWSlice;
+ Texture3D.WSize = wSize;
+ }
+ ~CD3D11_RENDER_TARGET_VIEW_DESC1() {}
+ operator const D3D11_RENDER_TARGET_VIEW_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0004_v0_0_s_ifspec;
+
+#ifndef __ID3D11RenderTargetView1_INTERFACE_DEFINED__
+#define __ID3D11RenderTargetView1_INTERFACE_DEFINED__
+
+/* interface ID3D11RenderTargetView1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11RenderTargetView1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("ffbe2e23-f011-418a-ac56-5ceed7c5b94b")
+ ID3D11RenderTargetView1 : public ID3D11RenderTargetView
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc1) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11RenderTargetView1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11RenderTargetView1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11RenderTargetView1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11RenderTargetView1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RENDER_TARGET_VIEW_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11RenderTargetView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc1);
+
+ END_INTERFACE
+ } ID3D11RenderTargetView1Vtbl;
+
+ interface ID3D11RenderTargetView1
+ {
+ CONST_VTBL struct ID3D11RenderTargetView1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11RenderTargetView1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11RenderTargetView1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11RenderTargetView1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11RenderTargetView1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11RenderTargetView1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11RenderTargetView1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11RenderTargetView1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11RenderTargetView1_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11RenderTargetView1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11RenderTargetView1_GetDesc1(This,pDesc1) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc1) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11RenderTargetView1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0005 */
+/* [local] */
+
+typedef struct D3D11_TEX2D_UAV1
+ {
+ UINT MipSlice;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_UAV1;
+
+typedef struct D3D11_TEX2D_ARRAY_UAV1
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ } D3D11_TEX2D_ARRAY_UAV1;
+
+typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
+ {
+ DXGI_FORMAT Format;
+ D3D11_UAV_DIMENSION ViewDimension;
+ union
+ {
+ D3D11_BUFFER_UAV Buffer;
+ D3D11_TEX1D_UAV Texture1D;
+ D3D11_TEX1D_ARRAY_UAV Texture1DArray;
+ D3D11_TEX2D_UAV1 Texture2D;
+ D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
+ D3D11_TEX3D_UAV Texture3D;
+ } ;
+ } D3D11_UNORDERED_ACCESS_VIEW_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_UNORDERED_ACCESS_VIEW_DESC1 : public D3D11_UNORDERED_ACCESS_VIEW_DESC1
+{
+ CD3D11_UNORDERED_ACCESS_VIEW_DESC1()
+ {}
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1( const D3D11_UNORDERED_ACCESS_VIEW_DESC1& o ) :
+ D3D11_UNORDERED_ACCESS_VIEW_DESC1( o )
+ {}
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
+ D3D11_UAV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0, // FirstElement for BUFFER
+ UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D
+ UINT arraySize = -1, // WSize for TEXTURE3D
+ UINT flags = 0, // BUFFER only
+ UINT planeSlice = 0 ) // PlaneSlice for TEXTURE2D and TEXTURE2DARRAY
+ {
+ Format = format;
+ ViewDimension = viewDimension;
+ switch (viewDimension)
+ {
+ case D3D11_UAV_DIMENSION_BUFFER:
+ Buffer.FirstElement = mipSlice;
+ Buffer.NumElements = firstArraySlice;
+ Buffer.Flags = flags;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE1D:
+ Texture1D.MipSlice = mipSlice;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MipSlice = mipSlice;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE2D:
+ Texture2D.MipSlice = mipSlice;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MipSlice = mipSlice;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE3D:
+ Texture3D.MipSlice = mipSlice;
+ Texture3D.FirstWSlice = firstArraySlice;
+ Texture3D.WSize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
+ _In_ ID3D11Buffer*,
+ DXGI_FORMAT format,
+ UINT firstElement,
+ UINT numElements,
+ UINT flags = 0 )
+ {
+ Format = format;
+ ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
+ Buffer.FirstElement = firstElement;
+ Buffer.NumElements = numElements;
+ Buffer.Flags = flags;
+ }
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
+ _In_ ID3D11Texture1D* pTex1D,
+ D3D11_UAV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstArraySlice = 0,
+ UINT arraySize = -1 )
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format ||
+ (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension))
+ {
+ D3D11_TEXTURE1D_DESC TexDesc;
+ pTex1D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_UAV_DIMENSION_TEXTURE1D:
+ Texture1D.MipSlice = mipSlice;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
+ Texture1DArray.MipSlice = mipSlice;
+ Texture1DArray.FirstArraySlice = firstArraySlice;
+ Texture1DArray.ArraySize = arraySize;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
+ _In_ ID3D11Texture2D* pTex2D,
+ D3D11_UAV_DIMENSION viewDimension,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstArraySlice = 0,
+ UINT arraySize = -1,
+ UINT planeSlice = 0 )
+ {
+ ViewDimension = viewDimension;
+ if (DXGI_FORMAT_UNKNOWN == format ||
+ (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension))
+ {
+ D3D11_TEXTURE2D_DESC TexDesc;
+ pTex2D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
+ }
+ Format = format;
+ switch (viewDimension)
+ {
+ case D3D11_UAV_DIMENSION_TEXTURE2D:
+ Texture2D.MipSlice = mipSlice;
+ Texture2D.PlaneSlice = planeSlice;
+ break;
+ case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
+ Texture2DArray.MipSlice = mipSlice;
+ Texture2DArray.FirstArraySlice = firstArraySlice;
+ Texture2DArray.ArraySize = arraySize;
+ Texture2DArray.PlaneSlice = planeSlice;
+ break;
+ default: break;
+ }
+ }
+ explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC1(
+ _In_ ID3D11Texture3D* pTex3D,
+ DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
+ UINT mipSlice = 0,
+ UINT firstWSlice = 0,
+ UINT wSize = -1 )
+ {
+ ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
+ if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize)
+ {
+ D3D11_TEXTURE3D_DESC TexDesc;
+ pTex3D->GetDesc( &TexDesc );
+ if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
+ if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice;
+ }
+ Format = format;
+ Texture3D.MipSlice = mipSlice;
+ Texture3D.FirstWSlice = firstWSlice;
+ Texture3D.WSize = wSize;
+ }
+ ~CD3D11_UNORDERED_ACCESS_VIEW_DESC1() {}
+ operator const D3D11_UNORDERED_ACCESS_VIEW_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0005_v0_0_s_ifspec;
+
+#ifndef __ID3D11UnorderedAccessView1_INTERFACE_DEFINED__
+#define __ID3D11UnorderedAccessView1_INTERFACE_DEFINED__
+
+/* interface ID3D11UnorderedAccessView1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11UnorderedAccessView1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("7b3b6153-a886-4544-ab37-6537c8500403")
+ ID3D11UnorderedAccessView1 : public ID3D11UnorderedAccessView
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc1) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11UnorderedAccessView1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11UnorderedAccessView1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11UnorderedAccessView1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *GetResource )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Resource **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11UnorderedAccessView1 * This,
+ /* [annotation] */
+ _Out_ D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc1);
+
+ END_INTERFACE
+ } ID3D11UnorderedAccessView1Vtbl;
+
+ interface ID3D11UnorderedAccessView1
+ {
+ CONST_VTBL struct ID3D11UnorderedAccessView1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11UnorderedAccessView1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11UnorderedAccessView1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11UnorderedAccessView1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11UnorderedAccessView1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11UnorderedAccessView1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11UnorderedAccessView1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11UnorderedAccessView1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11UnorderedAccessView1_GetResource(This,ppResource) \
+ ( (This)->lpVtbl -> GetResource(This,ppResource) )
+
+
+#define ID3D11UnorderedAccessView1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11UnorderedAccessView1_GetDesc1(This,pDesc1) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc1) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11UnorderedAccessView1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0006 */
+/* [local] */
+
+typedef struct D3D11_QUERY_DESC1
+ {
+ D3D11_QUERY Query;
+ UINT MiscFlags;
+ D3D11_CONTEXT_TYPE ContextType;
+ } D3D11_QUERY_DESC1;
+
+#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
+}
+struct CD3D11_QUERY_DESC1 : public D3D11_QUERY_DESC1
+{
+ CD3D11_QUERY_DESC1()
+ {}
+ explicit CD3D11_QUERY_DESC1( const D3D11_QUERY_DESC1& o ) :
+ D3D11_QUERY_DESC1( o )
+ {}
+ explicit CD3D11_QUERY_DESC1(
+ D3D11_QUERY query,
+ UINT miscFlags = 0,
+ D3D11_CONTEXT_TYPE contextType = D3D11_CONTEXT_TYPE_ALL )
+ {
+ Query = query;
+ MiscFlags = miscFlags;
+ ContextType = contextType;
+ }
+ ~CD3D11_QUERY_DESC1() {}
+ operator const D3D11_QUERY_DESC1&() const { return *this; }
+};
+extern "C"{
+#endif
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0006_v0_0_s_ifspec;
+
+#ifndef __ID3D11Query1_INTERFACE_DEFINED__
+#define __ID3D11Query1_INTERFACE_DEFINED__
+
+/* interface ID3D11Query1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Query1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("631b4766-36dc-461d-8db6-c47e13e60916")
+ ID3D11Query1 : public ID3D11Query
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc1(
+ /* [annotation] */
+ _Out_ D3D11_QUERY_DESC1 *pDesc1) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Query1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Query1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Query1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Query1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ UINT ( STDMETHODCALLTYPE *GetDataSize )(
+ ID3D11Query1 * This);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _Out_ D3D11_QUERY_DESC *pDesc);
+
+ void ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D11Query1 * This,
+ /* [annotation] */
+ _Out_ D3D11_QUERY_DESC1 *pDesc1);
+
+ END_INTERFACE
+ } ID3D11Query1Vtbl;
+
+ interface ID3D11Query1
+ {
+ CONST_VTBL struct ID3D11Query1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Query1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Query1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Query1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Query1_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11Query1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Query1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Query1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11Query1_GetDataSize(This) \
+ ( (This)->lpVtbl -> GetDataSize(This) )
+
+
+#define ID3D11Query1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+
+#define ID3D11Query1_GetDesc1(This,pDesc1) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc1) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Query1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11DeviceContext3_INTERFACE_DEFINED__
+#define __ID3D11DeviceContext3_INTERFACE_DEFINED__
+
+/* interface ID3D11DeviceContext3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11DeviceContext3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("b4e3c01d-e79e-4637-91b2-510e9f4c9b8f")
+ ID3D11DeviceContext3 : public ID3D11DeviceContext2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Flush1(
+ D3D11_CONTEXT_TYPE ContextType,
+ /* [annotation] */
+ _In_opt_ HANDLE hEvent) = 0;
+
+ virtual void STDMETHODCALLTYPE SetHardwareProtectionState(
+ /* [annotation] */
+ _In_ BOOL HwProtectionEnable) = 0;
+
+ virtual void STDMETHODCALLTYPE GetHardwareProtectionState(
+ /* [annotation] */
+ _Out_ BOOL *pHwProtectionEnable) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11DeviceContext3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11DeviceContext3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11DeviceContext3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11DeviceContext3 * This);
+
+ void ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11Device **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11PixelShader *pPixelShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11VertexShader *pVertexShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DrawIndexed )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT IndexCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation);
+
+ void ( STDMETHODCALLTYPE *Draw )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT VertexCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation);
+
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource,
+ /* [annotation] */
+ _In_ D3D11_MAP MapType,
+ /* [annotation] */
+ _In_ UINT MapFlags,
+ /* [annotation] */
+ _Out_opt_ D3D11_MAPPED_SUBRESOURCE *pMappedResource);
+
+ void ( STDMETHODCALLTYPE *Unmap )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_ UINT Subresource);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IASetInputLayout )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11InputLayout *pInputLayout);
+
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppVertexBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pStrides,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pIndexBuffer,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT Offset);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT IndexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartIndexLocation,
+ /* [annotation] */
+ _In_ INT BaseVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT VertexCountPerInstance,
+ /* [annotation] */
+ _In_ UINT InstanceCount,
+ /* [annotation] */
+ _In_ UINT StartVertexLocation,
+ /* [annotation] */
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11GeometryShader *pShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ D3D11_PRIMITIVE_TOPOLOGY Topology);
+
+ void ( STDMETHODCALLTYPE *VSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *Begin )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ void ( STDMETHODCALLTYPE *End )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *GetData )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Asynchronous *pAsync,
+ /* [annotation] */
+ _Out_writes_bytes_opt_( DataSize ) void *pData,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_ UINT GetDataFlags);
+
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11Predicate *pPredicate,
+ /* [annotation] */
+ _In_ BOOL PredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT NumRTVs,
+ /* [annotation] */
+ _In_reads_opt_(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_ UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *OMSetBlendState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11BlendState *pBlendState,
+ /* [annotation] */
+ _In_opt_ const FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _In_ UINT SampleMask);
+
+ void ( STDMETHODCALLTYPE *OMSetDepthStencilState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DepthStencilState *pDepthStencilState,
+ /* [annotation] */
+ _In_ UINT StencilRef);
+
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppSOTargets,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *DrawAuto )(
+ ID3D11DeviceContext3 * This);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *DrawInstancedIndirect )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountX,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountY,
+ /* [annotation] */
+ _In_ UINT ThreadGroupCountZ);
+
+ void ( STDMETHODCALLTYPE *DispatchIndirect )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBufferForArgs,
+ /* [annotation] */
+ _In_ UINT AlignedByteOffsetForArgs);
+
+ void ( STDMETHODCALLTYPE *RSSetState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11RasterizerState *pRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ /* [annotation] */
+ _In_reads_opt_(NumViewports) const D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox);
+
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch);
+
+ void ( STDMETHODCALLTYPE *CopyStructureCount )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pDstBuffer,
+ /* [annotation] */
+ _In_ UINT DstAlignedByteOffset,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pSrcView);
+
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11RenderTargetView *pRenderTargetView,
+ /* [annotation] */
+ _In_ const FLOAT ColorRGBA[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const UINT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11UnorderedAccessView *pUnorderedAccessView,
+ /* [annotation] */
+ _In_ const FLOAT Values[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11DepthStencilView *pDepthStencilView,
+ /* [annotation] */
+ _In_ UINT ClearFlags,
+ /* [annotation] */
+ _In_ FLOAT Depth,
+ /* [annotation] */
+ _In_ UINT8 Stencil);
+
+ void ( STDMETHODCALLTYPE *GenerateMips )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11ShaderResourceView *pShaderResourceView);
+
+ void ( STDMETHODCALLTYPE *SetResourceMinLOD )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ FLOAT MinLOD);
+
+ FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format);
+
+ void ( STDMETHODCALLTYPE *ExecuteCommandList )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11CommandList *pCommandList,
+ BOOL RestoreContextState);
+
+ void ( STDMETHODCALLTYPE *HSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11HullShader *pHullShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DomainShader *pDomainShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSSetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _In_reads_opt_(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews,
+ /* [annotation] */
+ _In_reads_opt_(NumUAVs) const UINT *pUAVInitialCounts);
+
+ void ( STDMETHODCALLTYPE *CSSetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11ComputeShader *pComputeShader,
+ /* [annotation] */
+ _In_reads_opt_(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances,
+ UINT NumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSSetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _In_reads_opt_(NumSamplers) ID3D11SamplerState *const *ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *PSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *PSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11PixelShader **ppPixelShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *VSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11VertexShader **ppVertexShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *IAGetInputLayout )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11InputLayout **ppInputLayout);
+
+ void ( STDMETHODCALLTYPE *IAGetVertexBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppVertexBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pStrides,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pOffsets);
+
+ void ( STDMETHODCALLTYPE *IAGetIndexBuffer )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Buffer **pIndexBuffer,
+ /* [annotation] */
+ _Out_opt_ DXGI_FORMAT *Format,
+ /* [annotation] */
+ _Out_opt_ UINT *Offset);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *GSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11GeometryShader **ppGeometryShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Out_ D3D11_PRIMITIVE_TOPOLOGY *pTopology);
+
+ void ( STDMETHODCALLTYPE *VSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *VSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *GetPredication )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11Predicate **ppPredicate,
+ /* [annotation] */
+ _Out_opt_ BOOL *pPredicateValue);
+
+ void ( STDMETHODCALLTYPE *GSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *GSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargets )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilView **ppDepthStencilView,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *OMGetBlendState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11BlendState **ppBlendState,
+ /* [annotation] */
+ _Out_opt_ FLOAT BlendFactor[ 4 ],
+ /* [annotation] */
+ _Out_opt_ UINT *pSampleMask);
+
+ void ( STDMETHODCALLTYPE *OMGetDepthStencilState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_opt_result_maybenull_ ID3D11DepthStencilState **ppDepthStencilState,
+ /* [annotation] */
+ _Out_opt_ UINT *pStencilRef);
+
+ void ( STDMETHODCALLTYPE *SOGetTargets )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppSOTargets);
+
+ void ( STDMETHODCALLTYPE *RSGetState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11RasterizerState **ppRasterizerState);
+
+ void ( STDMETHODCALLTYPE *RSGetViewports )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumViewports) D3D11_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSGetScissorRects )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Inout_ /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumRects) D3D11_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *HSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *HSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11HullShader **ppHullShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *HSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *DSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *DSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11DomainShader **ppDomainShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *DSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *CSGetShaderResources )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews,
+ /* [annotation] */
+ _Out_writes_opt_(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews);
+
+ void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_1_UAV_SLOT_COUNT - StartSlot ) UINT NumUAVs,
+ /* [annotation] */
+ _Out_writes_opt_(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews);
+
+ void ( STDMETHODCALLTYPE *CSGetShader )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Outptr_result_maybenull_ ID3D11ComputeShader **ppComputeShader,
+ /* [annotation] */
+ _Out_writes_opt_(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumClassInstances);
+
+ void ( STDMETHODCALLTYPE *CSGetSamplers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers,
+ /* [annotation] */
+ _Out_writes_opt_(NumSamplers) ID3D11SamplerState **ppSamplers);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers);
+
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D11DeviceContext3 * This);
+
+ void ( STDMETHODCALLTYPE *Flush )(
+ ID3D11DeviceContext3 * This);
+
+ D3D11_DEVICE_CONTEXT_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D11DeviceContext3 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetContextFlags )(
+ ID3D11DeviceContext3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *FinishCommandList )(
+ ID3D11DeviceContext3 * This,
+ BOOL RestoreDeferredContextState,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11CommandList **ppCommandList);
+
+ void ( STDMETHODCALLTYPE *CopySubresourceRegion1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_ UINT DstX,
+ /* [annotation] */
+ _In_ UINT DstY,
+ /* [annotation] */
+ _In_ UINT DstZ,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *UpdateSubresource1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch,
+ /* [annotation] */
+ _In_ UINT CopyFlags);
+
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource);
+
+ void ( STDMETHODCALLTYPE *DiscardView )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView);
+
+ void ( STDMETHODCALLTYPE *VSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSSetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) ID3D11Buffer *const *ppConstantBuffers,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pFirstConstant,
+ /* [annotation] */
+ _In_reads_opt_(NumBuffers) const UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *VSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *HSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *DSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *GSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *PSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *CSGetConstantBuffers1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot,
+ /* [annotation] */
+ _In_range_( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) ID3D11Buffer **ppConstantBuffers,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pFirstConstant,
+ /* [annotation] */
+ _Out_writes_opt_(NumBuffers) UINT *pNumConstants);
+
+ void ( STDMETHODCALLTYPE *SwapDeviceContextState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3DDeviceContextState *pState,
+ /* [annotation] */
+ _Outptr_opt_ ID3DDeviceContextState **ppPreviousState);
+
+ void ( STDMETHODCALLTYPE *ClearView )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pView,
+ /* [annotation] */
+ _In_ const FLOAT Color[ 4 ],
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRect,
+ UINT NumRects);
+
+ void ( STDMETHODCALLTYPE *DiscardView1 )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11View *pResourceView,
+ /* [annotation] */
+ _In_reads_opt_(NumRects) const D3D11_RECT *pRects,
+ UINT NumRects);
+
+ HRESULT ( STDMETHODCALLTYPE *UpdateTileMappings )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ UINT NumTiledResourceRegions,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates,
+ /* [annotation] */
+ _In_reads_opt_(NumTiledResourceRegions) const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes,
+ /* [annotation] */
+ _In_opt_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT NumRanges,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeFlags,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pTilePoolStartOffsets,
+ /* [annotation] */
+ _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *CopyTileMappings )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSourceTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pTileRegionSize,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pBuffer,
+ /* [annotation] */
+ _In_ UINT64 BufferStartOffsetInBytes,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ void ( STDMETHODCALLTYPE *UpdateTiles )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDestTiledResource,
+ /* [annotation] */
+ _In_ const D3D11_TILED_RESOURCE_COORDINATE *pDestTileRegionStartCoordinate,
+ /* [annotation] */
+ _In_ const D3D11_TILE_REGION_SIZE *pDestTileRegionSize,
+ /* [annotation] */
+ _In_ const void *pSourceTileData,
+ /* [annotation] */
+ _In_ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeTilePool )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ ID3D11Buffer *pTilePool,
+ /* [annotation] */
+ _In_ UINT64 NewSizeInBytes);
+
+ void ( STDMETHODCALLTYPE *TiledResourceBarrier )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessBeforeBarrier,
+ /* [annotation] */
+ _In_opt_ ID3D11DeviceChild *pTiledResourceOrViewAccessAfterBarrier);
+
+ BOOL ( STDMETHODCALLTYPE *IsAnnotationEnabled )(
+ ID3D11DeviceContext3 * This);
+
+ void ( STDMETHODCALLTYPE *SetMarkerInt )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data);
+
+ void ( STDMETHODCALLTYPE *BeginEventInt )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ LPCWSTR pLabel,
+ INT Data);
+
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D11DeviceContext3 * This);
+
+ void ( STDMETHODCALLTYPE *Flush1 )(
+ ID3D11DeviceContext3 * This,
+ D3D11_CONTEXT_TYPE ContextType,
+ /* [annotation] */
+ _In_opt_ HANDLE hEvent);
+
+ void ( STDMETHODCALLTYPE *SetHardwareProtectionState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _In_ BOOL HwProtectionEnable);
+
+ void ( STDMETHODCALLTYPE *GetHardwareProtectionState )(
+ ID3D11DeviceContext3 * This,
+ /* [annotation] */
+ _Out_ BOOL *pHwProtectionEnable);
+
+ END_INTERFACE
+ } ID3D11DeviceContext3Vtbl;
+
+ interface ID3D11DeviceContext3
+ {
+ CONST_VTBL struct ID3D11DeviceContext3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11DeviceContext3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11DeviceContext3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11DeviceContext3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11DeviceContext3_GetDevice(This,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,ppDevice) )
+
+#define ID3D11DeviceContext3_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11DeviceContext3_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11DeviceContext3_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+
+#define ID3D11DeviceContext3_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \
+ ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) )
+
+#define ID3D11DeviceContext3_Draw(This,VertexCount,StartVertexLocation) \
+ ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) )
+
+#define ID3D11DeviceContext3_Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) \
+ ( (This)->lpVtbl -> Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) )
+
+#define ID3D11DeviceContext3_Unmap(This,pResource,Subresource) \
+ ( (This)->lpVtbl -> Unmap(This,pResource,Subresource) )
+
+#define ID3D11DeviceContext3_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_IASetInputLayout(This,pInputLayout) \
+ ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) )
+
+#define ID3D11DeviceContext3_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext3_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext3_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext3_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D11DeviceContext3_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_GSSetShader(This,pShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> GSSetShader(This,pShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_IASetPrimitiveTopology(This,Topology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) )
+
+#define ID3D11DeviceContext3_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_Begin(This,pAsync) \
+ ( (This)->lpVtbl -> Begin(This,pAsync) )
+
+#define ID3D11DeviceContext3_End(This,pAsync) \
+ ( (This)->lpVtbl -> End(This,pAsync) )
+
+#define ID3D11DeviceContext3_GetData(This,pAsync,pData,DataSize,GetDataFlags) \
+ ( (This)->lpVtbl -> GetData(This,pAsync,pData,DataSize,GetDataFlags) )
+
+#define ID3D11DeviceContext3_SetPredication(This,pPredicate,PredicateValue) \
+ ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) )
+
+#define ID3D11DeviceContext3_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) )
+
+#define ID3D11DeviceContext3_OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext3_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \
+ ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) )
+
+#define ID3D11DeviceContext3_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \
+ ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) )
+
+#define ID3D11DeviceContext3_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \
+ ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) )
+
+#define ID3D11DeviceContext3_DrawAuto(This) \
+ ( (This)->lpVtbl -> DrawAuto(This) )
+
+#define ID3D11DeviceContext3_DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext3_DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext3_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D11DeviceContext3_DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \
+ ( (This)->lpVtbl -> DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) )
+
+#define ID3D11DeviceContext3_RSSetState(This,pRasterizerState) \
+ ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) )
+
+#define ID3D11DeviceContext3_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D11DeviceContext3_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D11DeviceContext3_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) )
+
+#define ID3D11DeviceContext3_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D11DeviceContext3_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D11DeviceContext3_CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) \
+ ( (This)->lpVtbl -> CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) )
+
+#define ID3D11DeviceContext3_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) )
+
+#define ID3D11DeviceContext3_ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext3_ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) )
+
+#define ID3D11DeviceContext3_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) )
+
+#define ID3D11DeviceContext3_GenerateMips(This,pShaderResourceView) \
+ ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) )
+
+#define ID3D11DeviceContext3_SetResourceMinLOD(This,pResource,MinLOD) \
+ ( (This)->lpVtbl -> SetResourceMinLOD(This,pResource,MinLOD) )
+
+#define ID3D11DeviceContext3_GetResourceMinLOD(This,pResource) \
+ ( (This)->lpVtbl -> GetResourceMinLOD(This,pResource) )
+
+#define ID3D11DeviceContext3_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D11DeviceContext3_ExecuteCommandList(This,pCommandList,RestoreContextState) \
+ ( (This)->lpVtbl -> ExecuteCommandList(This,pCommandList,RestoreContextState) )
+
+#define ID3D11DeviceContext3_HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \
+ ( (This)->lpVtbl -> CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) )
+
+#define ID3D11DeviceContext3_CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) \
+ ( (This)->lpVtbl -> CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) )
+
+#define ID3D11DeviceContext3_CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_IAGetInputLayout(This,ppInputLayout) \
+ ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) )
+
+#define ID3D11DeviceContext3_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \
+ ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) )
+
+#define ID3D11DeviceContext3_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \
+ ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) )
+
+#define ID3D11DeviceContext3_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_IAGetPrimitiveTopology(This,pTopology) \
+ ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) )
+
+#define ID3D11DeviceContext3_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_GetPredication(This,ppPredicate,pPredicateValue) \
+ ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) )
+
+#define ID3D11DeviceContext3_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \
+ ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) )
+
+#define ID3D11DeviceContext3_OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext3_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \
+ ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) )
+
+#define ID3D11DeviceContext3_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \
+ ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) )
+
+#define ID3D11DeviceContext3_SOGetTargets(This,NumBuffers,ppSOTargets) \
+ ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets) )
+
+#define ID3D11DeviceContext3_RSGetState(This,ppRasterizerState) \
+ ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) )
+
+#define ID3D11DeviceContext3_RSGetViewports(This,pNumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSGetViewports(This,pNumViewports,pViewports) )
+
+#define ID3D11DeviceContext3_RSGetScissorRects(This,pNumRects,pRects) \
+ ( (This)->lpVtbl -> RSGetScissorRects(This,pNumRects,pRects) )
+
+#define ID3D11DeviceContext3_HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \
+ ( (This)->lpVtbl -> CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) )
+
+#define ID3D11DeviceContext3_CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) \
+ ( (This)->lpVtbl -> CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) )
+
+#define ID3D11DeviceContext3_CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) \
+ ( (This)->lpVtbl -> CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) )
+
+#define ID3D11DeviceContext3_CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \
+ ( (This)->lpVtbl -> CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) )
+
+#define ID3D11DeviceContext3_CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) )
+
+#define ID3D11DeviceContext3_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D11DeviceContext3_Flush(This) \
+ ( (This)->lpVtbl -> Flush(This) )
+
+#define ID3D11DeviceContext3_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+#define ID3D11DeviceContext3_GetContextFlags(This) \
+ ( (This)->lpVtbl -> GetContextFlags(This) )
+
+#define ID3D11DeviceContext3_FinishCommandList(This,RestoreDeferredContextState,ppCommandList) \
+ ( (This)->lpVtbl -> FinishCommandList(This,RestoreDeferredContextState,ppCommandList) )
+
+
+#define ID3D11DeviceContext3_CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) \
+ ( (This)->lpVtbl -> CopySubresourceRegion1(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox,CopyFlags) )
+
+#define ID3D11DeviceContext3_UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) \
+ ( (This)->lpVtbl -> UpdateSubresource1(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch,CopyFlags) )
+
+#define ID3D11DeviceContext3_DiscardResource(This,pResource) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource) )
+
+#define ID3D11DeviceContext3_DiscardView(This,pResourceView) \
+ ( (This)->lpVtbl -> DiscardView(This,pResourceView) )
+
+#define ID3D11DeviceContext3_VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSSetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> VSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> HSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> DSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> GSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> PSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) \
+ ( (This)->lpVtbl -> CSGetConstantBuffers1(This,StartSlot,NumBuffers,ppConstantBuffers,pFirstConstant,pNumConstants) )
+
+#define ID3D11DeviceContext3_SwapDeviceContextState(This,pState,ppPreviousState) \
+ ( (This)->lpVtbl -> SwapDeviceContextState(This,pState,ppPreviousState) )
+
+#define ID3D11DeviceContext3_ClearView(This,pView,Color,pRect,NumRects) \
+ ( (This)->lpVtbl -> ClearView(This,pView,Color,pRect,NumRects) )
+
+#define ID3D11DeviceContext3_DiscardView1(This,pResourceView,pRects,NumRects) \
+ ( (This)->lpVtbl -> DiscardView1(This,pResourceView,pRects,NumRects) )
+
+
+#define ID3D11DeviceContext3_UpdateTileMappings(This,pTiledResource,NumTiledResourceRegions,pTiledResourceRegionStartCoordinates,pTiledResourceRegionSizes,pTilePool,NumRanges,pRangeFlags,pTilePoolStartOffsets,pRangeTileCounts,Flags) \
+ ( (This)->lpVtbl -> UpdateTileMappings(This,pTiledResource,NumTiledResourceRegions,pTiledResourceRegionStartCoordinates,pTiledResourceRegionSizes,pTilePool,NumRanges,pRangeFlags,pTilePoolStartOffsets,pRangeTileCounts,Flags) )
+
+#define ID3D11DeviceContext3_CopyTileMappings(This,pDestTiledResource,pDestRegionStartCoordinate,pSourceTiledResource,pSourceRegionStartCoordinate,pTileRegionSize,Flags) \
+ ( (This)->lpVtbl -> CopyTileMappings(This,pDestTiledResource,pDestRegionStartCoordinate,pSourceTiledResource,pSourceRegionStartCoordinate,pTileRegionSize,Flags) )
+
+#define ID3D11DeviceContext3_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D11DeviceContext3_UpdateTiles(This,pDestTiledResource,pDestTileRegionStartCoordinate,pDestTileRegionSize,pSourceTileData,Flags) \
+ ( (This)->lpVtbl -> UpdateTiles(This,pDestTiledResource,pDestTileRegionStartCoordinate,pDestTileRegionSize,pSourceTileData,Flags) )
+
+#define ID3D11DeviceContext3_ResizeTilePool(This,pTilePool,NewSizeInBytes) \
+ ( (This)->lpVtbl -> ResizeTilePool(This,pTilePool,NewSizeInBytes) )
+
+#define ID3D11DeviceContext3_TiledResourceBarrier(This,pTiledResourceOrViewAccessBeforeBarrier,pTiledResourceOrViewAccessAfterBarrier) \
+ ( (This)->lpVtbl -> TiledResourceBarrier(This,pTiledResourceOrViewAccessBeforeBarrier,pTiledResourceOrViewAccessAfterBarrier) )
+
+#define ID3D11DeviceContext3_IsAnnotationEnabled(This) \
+ ( (This)->lpVtbl -> IsAnnotationEnabled(This) )
+
+#define ID3D11DeviceContext3_SetMarkerInt(This,pLabel,Data) \
+ ( (This)->lpVtbl -> SetMarkerInt(This,pLabel,Data) )
+
+#define ID3D11DeviceContext3_BeginEventInt(This,pLabel,Data) \
+ ( (This)->lpVtbl -> BeginEventInt(This,pLabel,Data) )
+
+#define ID3D11DeviceContext3_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+
+#define ID3D11DeviceContext3_Flush1(This,ContextType,hEvent) \
+ ( (This)->lpVtbl -> Flush1(This,ContextType,hEvent) )
+
+#define ID3D11DeviceContext3_SetHardwareProtectionState(This,HwProtectionEnable) \
+ ( (This)->lpVtbl -> SetHardwareProtectionState(This,HwProtectionEnable) )
+
+#define ID3D11DeviceContext3_GetHardwareProtectionState(This,pHwProtectionEnable) \
+ ( (This)->lpVtbl -> GetHardwareProtectionState(This,pHwProtectionEnable) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11DeviceContext3_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11Device3_INTERFACE_DEFINED__
+#define __ID3D11Device3_INTERFACE_DEFINED__
+
+/* interface ID3D11Device3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Device3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("A05C8C37-D2C6-4732-B3A0-9CE0B0DC9AE6")
+ ID3D11Device3 : public ID3D11Device2
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateTexture2D1(
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE2D_DESC1 *pDesc1,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc1->MipLevels * pDesc1->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture2D1 **ppTexture2D) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateTexture3D1(
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE3D_DESC1 *pDesc1,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc1->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture3D1 **ppTexture3D) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState2(
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC2 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState2 **ppRasterizerState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ShaderResourceView1 **ppSRView1) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView1(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView1 **ppUAView1) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView1(
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RenderTargetView1 **ppRTView1) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateQuery1(
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC1 *pQueryDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Query1 **ppQuery1) = 0;
+
+ virtual void STDMETHODCALLTYPE GetImmediateContext3(
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext3 **ppImmediateContext) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext3(
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext3 **ppDeferredContext) = 0;
+
+ virtual void STDMETHODCALLTYPE WriteToSubresource(
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch) = 0;
+
+ virtual void STDMETHODCALLTYPE ReadFromSubresource(
+ /* [annotation] */
+ _Out_ void *pDstData,
+ /* [annotation] */
+ _In_ UINT DstRowPitch,
+ /* [annotation] */
+ _In_ UINT DstDepthPitch,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11Device3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Device3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Device3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Device3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBuffer )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_BUFFER_DESC *pDesc,
+ /* [annotation] */
+ _In_opt_ const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Buffer **ppBuffer);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE1D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture1D **ppTexture1D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE2D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels * pDesc->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture2D **ppTexture2D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE3D_DESC *pDesc,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture3D **ppTexture3D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ShaderResourceView **ppSRView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView **ppUAView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RenderTargetView **ppRTView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilView **ppDepthStencilView);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs,
+ /* [annotation] */
+ _In_range_( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecodeWithInputSignature,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11InputLayout **ppInputLayout);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11VertexShader **ppVertexShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_reads_opt_(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries,
+ /* [annotation] */
+ _In_reads_opt_(NumStrides) const UINT *pBufferStrides,
+ /* [annotation] */
+ _In_range_( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides,
+ /* [annotation] */
+ _In_ UINT RasterizedStream,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11GeometryShader **ppGeometryShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11PixelShader **ppPixelShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateHullShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11HullShader **ppHullShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DomainShader **ppDomainShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_reads_(BytecodeLength) const void *pShaderBytecode,
+ /* [annotation] */
+ _In_ SIZE_T BytecodeLength,
+ /* [annotation] */
+ _In_opt_ ID3D11ClassLinkage *pClassLinkage,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ComputeShader **ppComputeShader);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11ClassLinkage **ppLinkage);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DepthStencilState **ppDepthStencilState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_SAMPLER_DESC *pSamplerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11SamplerState **ppSamplerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateQuery )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pQueryDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Query **ppQuery);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePredicate )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC *pPredicateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Predicate **ppPredicate);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCounter )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pCounterDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Counter **ppCounter);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )(
+ ID3D11Device3 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID ReturnedInterface,
+ /* [annotation] */
+ _COM_Outptr_opt_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _Out_ UINT *pFormatSupport);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels);
+
+ void ( STDMETHODCALLTYPE *CheckCounterInfo )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_INFO *pCounterInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckCounter )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_COUNTER_DESC *pDesc,
+ /* [annotation] */
+ _Out_ D3D11_COUNTER_TYPE *pType,
+ /* [annotation] */
+ _Out_ UINT *pActiveCounters,
+ /* [annotation] */
+ _Out_writes_opt_(*pNameLength) LPSTR szName,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNameLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pUnitsLength) LPSTR szUnits,
+ /* [annotation] */
+ _Inout_opt_ UINT *pUnitsLength,
+ /* [annotation] */
+ _Out_writes_opt_(*pDescriptionLength) LPSTR szDescription,
+ /* [annotation] */
+ _Inout_opt_ UINT *pDescriptionLength);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D11Device3 * This,
+ D3D11_FEATURE Feature,
+ /* [annotation] */
+ _Out_writes_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_ UINT DataSize,
+ /* [annotation] */
+ _In_reads_bytes_opt_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ REFGUID guid,
+ /* [annotation] */
+ _In_opt_ const IUnknown *pData);
+
+ D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )(
+ ID3D11Device3 * This);
+
+ UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
+ ID3D11Device3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D11Device3 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )(
+ ID3D11Device3 * This,
+ UINT RaiseFlags);
+
+ UINT ( STDMETHODCALLTYPE *GetExceptionMode )(
+ ID3D11Device3 * This);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext1 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext1 )(
+ ID3D11Device3 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext1 **ppDeferredContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_BLEND_DESC1 *pBlendStateDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11BlendState1 **ppBlendState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC1 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState1 **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeviceContextState )(
+ ID3D11Device3 * This,
+ UINT Flags,
+ /* [annotation] */
+ _In_reads_( FeatureLevels ) const D3D_FEATURE_LEVEL *pFeatureLevels,
+ UINT FeatureLevels,
+ UINT SDKVersion,
+ REFIID EmulatedInterface,
+ /* [annotation] */
+ _Out_opt_ D3D_FEATURE_LEVEL *pChosenFeatureLevel,
+ /* [annotation] */
+ _Out_opt_ ID3DDeviceContextState **ppContextState);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResource1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedResourceByName )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ LPCWSTR lpName,
+ /* [annotation] */
+ _In_ DWORD dwDesiredAccess,
+ /* [annotation] */
+ _In_ REFIID returnedInterface,
+ /* [annotation] */
+ _COM_Outptr_ void **ppResource);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext2 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext2 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext2 )(
+ ID3D11Device3 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext2 **ppDeferredContext);
+
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pTiledResource,
+ /* [annotation] */
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ /* [annotation] */
+ _Out_opt_ D3D11_PACKED_MIP_DESC *pPackedMipDesc,
+ /* [annotation] */
+ _Out_opt_ D3D11_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ /* [annotation] */
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ /* [annotation] */
+ _In_ UINT FirstSubresourceTilingToGet,
+ /* [annotation] */
+ _Out_writes_(*pNumSubresourceTilings) D3D11_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation] */
+ _In_ UINT SampleCount,
+ /* [annotation] */
+ _In_ UINT Flags,
+ /* [annotation] */
+ _Out_ UINT *pNumQualityLevels);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture2D1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE2D_DESC1 *pDesc1,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc1->MipLevels * pDesc1->ArraySize)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture2D1 **ppTexture2D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateTexture3D1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_TEXTURE3D_DESC1 *pDesc1,
+ /* [annotation] */
+ _In_reads_opt_(_Inexpressible_(pDesc1->MipLevels)) const D3D11_SUBRESOURCE_DATA *pInitialData,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Texture3D1 **ppTexture3D);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState2 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_RASTERIZER_DESC2 *pRasterizerDesc,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RasterizerState2 **ppRasterizerState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_SHADER_RESOURCE_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11ShaderResourceView1 **ppSRView1);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_UNORDERED_ACCESS_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11UnorderedAccessView1 **ppUAView1);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pResource,
+ /* [annotation] */
+ _In_opt_ const D3D11_RENDER_TARGET_VIEW_DESC1 *pDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11RenderTargetView1 **ppRTView1);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateQuery1 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ const D3D11_QUERY_DESC1 *pQueryDesc1,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11Query1 **ppQuery1);
+
+ void ( STDMETHODCALLTYPE *GetImmediateContext3 )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Outptr_ ID3D11DeviceContext3 **ppImmediateContext);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext3 )(
+ ID3D11Device3 * This,
+ UINT ContextFlags,
+ /* [annotation] */
+ _COM_Outptr_opt_ ID3D11DeviceContext3 **ppDeferredContext);
+
+ void ( STDMETHODCALLTYPE *WriteToSubresource )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _In_ ID3D11Resource *pDstResource,
+ /* [annotation] */
+ _In_ UINT DstSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pDstBox,
+ /* [annotation] */
+ _In_ const void *pSrcData,
+ /* [annotation] */
+ _In_ UINT SrcRowPitch,
+ /* [annotation] */
+ _In_ UINT SrcDepthPitch);
+
+ void ( STDMETHODCALLTYPE *ReadFromSubresource )(
+ ID3D11Device3 * This,
+ /* [annotation] */
+ _Out_ void *pDstData,
+ /* [annotation] */
+ _In_ UINT DstRowPitch,
+ /* [annotation] */
+ _In_ UINT DstDepthPitch,
+ /* [annotation] */
+ _In_ ID3D11Resource *pSrcResource,
+ /* [annotation] */
+ _In_ UINT SrcSubresource,
+ /* [annotation] */
+ _In_opt_ const D3D11_BOX *pSrcBox);
+
+ END_INTERFACE
+ } ID3D11Device3Vtbl;
+
+ interface ID3D11Device3
+ {
+ CONST_VTBL struct ID3D11Device3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Device3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Device3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Device3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Device3_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \
+ ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) )
+
+#define ID3D11Device3_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \
+ ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) )
+
+#define ID3D11Device3_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \
+ ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) )
+
+#define ID3D11Device3_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \
+ ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) )
+
+#define ID3D11Device3_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) )
+
+#define ID3D11Device3_CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) )
+
+#define ID3D11Device3_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) )
+
+#define ID3D11Device3_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) )
+
+#define ID3D11Device3_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \
+ ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) )
+
+#define ID3D11Device3_CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) \
+ ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) )
+
+#define ID3D11Device3_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device3_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) \
+ ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) )
+
+#define ID3D11Device3_CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) \
+ ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) )
+
+#define ID3D11Device3_CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) \
+ ( (This)->lpVtbl -> CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) )
+
+#define ID3D11Device3_CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) \
+ ( (This)->lpVtbl -> CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) )
+
+#define ID3D11Device3_CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) \
+ ( (This)->lpVtbl -> CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) )
+
+#define ID3D11Device3_CreateClassLinkage(This,ppLinkage) \
+ ( (This)->lpVtbl -> CreateClassLinkage(This,ppLinkage) )
+
+#define ID3D11Device3_CreateBlendState(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device3_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \
+ ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) )
+
+#define ID3D11Device3_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device3_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \
+ ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) )
+
+#define ID3D11Device3_CreateQuery(This,pQueryDesc,ppQuery) \
+ ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) )
+
+#define ID3D11Device3_CreatePredicate(This,pPredicateDesc,ppPredicate) \
+ ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) )
+
+#define ID3D11Device3_CreateCounter(This,pCounterDesc,ppCounter) \
+ ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) )
+
+#define ID3D11Device3_CreateDeferredContext(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device3_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) )
+
+#define ID3D11Device3_CheckFormatSupport(This,Format,pFormatSupport) \
+ ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) )
+
+#define ID3D11Device3_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \
+ ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) )
+
+#define ID3D11Device3_CheckCounterInfo(This,pCounterInfo) \
+ ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) )
+
+#define ID3D11Device3_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \
+ ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) )
+
+#define ID3D11Device3_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D11Device3_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D11Device3_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D11Device3_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D11Device3_GetFeatureLevel(This) \
+ ( (This)->lpVtbl -> GetFeatureLevel(This) )
+
+#define ID3D11Device3_GetCreationFlags(This) \
+ ( (This)->lpVtbl -> GetCreationFlags(This) )
+
+#define ID3D11Device3_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D11Device3_GetImmediateContext(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext(This,ppImmediateContext) )
+
+#define ID3D11Device3_SetExceptionMode(This,RaiseFlags) \
+ ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) )
+
+#define ID3D11Device3_GetExceptionMode(This) \
+ ( (This)->lpVtbl -> GetExceptionMode(This) )
+
+
+#define ID3D11Device3_GetImmediateContext1(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext1(This,ppImmediateContext) )
+
+#define ID3D11Device3_CreateDeferredContext1(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext1(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device3_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \
+ ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) )
+
+#define ID3D11Device3_CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState1(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device3_CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) \
+ ( (This)->lpVtbl -> CreateDeviceContextState(This,Flags,pFeatureLevels,FeatureLevels,SDKVersion,EmulatedInterface,pChosenFeatureLevel,ppContextState) )
+
+#define ID3D11Device3_OpenSharedResource1(This,hResource,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResource1(This,hResource,returnedInterface,ppResource) )
+
+#define ID3D11Device3_OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) \
+ ( (This)->lpVtbl -> OpenSharedResourceByName(This,lpName,dwDesiredAccess,returnedInterface,ppResource) )
+
+
+#define ID3D11Device3_GetImmediateContext2(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext2(This,ppImmediateContext) )
+
+#define ID3D11Device3_CreateDeferredContext2(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext2(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device3_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+
+#define ID3D11Device3_CheckMultisampleQualityLevels1(This,Format,SampleCount,Flags,pNumQualityLevels) \
+ ( (This)->lpVtbl -> CheckMultisampleQualityLevels1(This,Format,SampleCount,Flags,pNumQualityLevels) )
+
+
+#define ID3D11Device3_CreateTexture2D1(This,pDesc1,pInitialData,ppTexture2D) \
+ ( (This)->lpVtbl -> CreateTexture2D1(This,pDesc1,pInitialData,ppTexture2D) )
+
+#define ID3D11Device3_CreateTexture3D1(This,pDesc1,pInitialData,ppTexture3D) \
+ ( (This)->lpVtbl -> CreateTexture3D1(This,pDesc1,pInitialData,ppTexture3D) )
+
+#define ID3D11Device3_CreateRasterizerState2(This,pRasterizerDesc,ppRasterizerState) \
+ ( (This)->lpVtbl -> CreateRasterizerState2(This,pRasterizerDesc,ppRasterizerState) )
+
+#define ID3D11Device3_CreateShaderResourceView1(This,pResource,pDesc1,ppSRView1) \
+ ( (This)->lpVtbl -> CreateShaderResourceView1(This,pResource,pDesc1,ppSRView1) )
+
+#define ID3D11Device3_CreateUnorderedAccessView1(This,pResource,pDesc1,ppUAView1) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView1(This,pResource,pDesc1,ppUAView1) )
+
+#define ID3D11Device3_CreateRenderTargetView1(This,pResource,pDesc1,ppRTView1) \
+ ( (This)->lpVtbl -> CreateRenderTargetView1(This,pResource,pDesc1,ppRTView1) )
+
+#define ID3D11Device3_CreateQuery1(This,pQueryDesc1,ppQuery1) \
+ ( (This)->lpVtbl -> CreateQuery1(This,pQueryDesc1,ppQuery1) )
+
+#define ID3D11Device3_GetImmediateContext3(This,ppImmediateContext) \
+ ( (This)->lpVtbl -> GetImmediateContext3(This,ppImmediateContext) )
+
+#define ID3D11Device3_CreateDeferredContext3(This,ContextFlags,ppDeferredContext) \
+ ( (This)->lpVtbl -> CreateDeferredContext3(This,ContextFlags,ppDeferredContext) )
+
+#define ID3D11Device3_WriteToSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> WriteToSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D11Device3_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,pSrcResource,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,pSrcResource,SrcSubresource,pSrcBox) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Device3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11_3_0000_0009 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D11Texture2D1,0x51218251,0x1E33,0x4617,0x9C,0xCB,0x4D,0x3A,0x43,0x67,0xE7,0xBB);
+DEFINE_GUID(IID_ID3D11Texture3D1,0x0C711683,0x2853,0x4846,0x9B,0xB0,0xF3,0xE6,0x06,0x39,0xE4,0x6A);
+DEFINE_GUID(IID_ID3D11RasterizerState2,0x6fbd02fb,0x209f,0x46c4,0xb0,0x59,0x2e,0xd1,0x55,0x86,0xa6,0xac);
+DEFINE_GUID(IID_ID3D11ShaderResourceView1,0x91308b87,0x9040,0x411d,0x8c,0x67,0xc3,0x92,0x53,0xce,0x38,0x02);
+DEFINE_GUID(IID_ID3D11RenderTargetView1,0xffbe2e23,0xf011,0x418a,0xac,0x56,0x5c,0xee,0xd7,0xc5,0xb9,0x4b);
+DEFINE_GUID(IID_ID3D11UnorderedAccessView1,0x7b3b6153,0xa886,0x4544,0xab,0x37,0x65,0x37,0xc8,0x50,0x04,0x03);
+DEFINE_GUID(IID_ID3D11Query1,0x631b4766,0x36dc,0x461d,0x8d,0xb6,0xc4,0x7e,0x13,0xe6,0x09,0x16);
+DEFINE_GUID(IID_ID3D11DeviceContext3,0xb4e3c01d,0xe79e,0x4637,0x91,0xb2,0x51,0x0e,0x9f,0x4c,0x9b,0x8f);
+DEFINE_GUID(IID_ID3D11Device3,0xA05C8C37,0xD2C6,0x4732,0xB3,0xA0,0x9C,0xE0,0xB0,0xDC,0x9A,0xE6);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0009_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11_3_0000_0009_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h
new file mode 100644
index 00000000000..903163ba2c1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h
@@ -0,0 +1,2545 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d11sdklayers_h__
+#define __d3d11sdklayers_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D11Debug_FWD_DEFINED__
+#define __ID3D11Debug_FWD_DEFINED__
+typedef interface ID3D11Debug ID3D11Debug;
+
+#endif /* __ID3D11Debug_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11SwitchToRef_FWD_DEFINED__
+#define __ID3D11SwitchToRef_FWD_DEFINED__
+typedef interface ID3D11SwitchToRef ID3D11SwitchToRef;
+
+#endif /* __ID3D11SwitchToRef_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11TracingDevice_FWD_DEFINED__
+#define __ID3D11TracingDevice_FWD_DEFINED__
+typedef interface ID3D11TracingDevice ID3D11TracingDevice;
+
+#endif /* __ID3D11TracingDevice_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11RefTrackingOptions_FWD_DEFINED__
+#define __ID3D11RefTrackingOptions_FWD_DEFINED__
+typedef interface ID3D11RefTrackingOptions ID3D11RefTrackingOptions;
+
+#endif /* __ID3D11RefTrackingOptions_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11RefDefaultTrackingOptions_FWD_DEFINED__
+#define __ID3D11RefDefaultTrackingOptions_FWD_DEFINED__
+typedef interface ID3D11RefDefaultTrackingOptions ID3D11RefDefaultTrackingOptions;
+
+#endif /* __ID3D11RefDefaultTrackingOptions_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11InfoQueue_FWD_DEFINED__
+#define __ID3D11InfoQueue_FWD_DEFINED__
+typedef interface ID3D11InfoQueue ID3D11InfoQueue;
+
+#endif /* __ID3D11InfoQueue_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "d3d11.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d11sdklayers_0000_0000 */
+/* [local] */
+
+#define D3D11_SDK_LAYERS_VERSION ( 1 )
+
+#define D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 )
+
+#define D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 )
+
+#define D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 )
+
+#define D3D11_DEBUG_FEATURE_ALWAYS_DISCARD_OFFERED_RESOURCE ( 0x8 )
+
+#define D3D11_DEBUG_FEATURE_NEVER_DISCARD_OFFERED_RESOURCE ( 0x10 )
+
+#define D3D11_DEBUG_FEATURE_AVOID_BEHAVIOR_CHANGING_DEBUG_AIDS ( 0x40 )
+
+#define D3D11_DEBUG_FEATURE_DISABLE_TILED_RESOURCE_MAPPING_TRACKING_AND_VALIDATION ( 0x80 )
+
+typedef
+enum D3D11_RLDO_FLAGS
+ {
+ D3D11_RLDO_SUMMARY = 0x1,
+ D3D11_RLDO_DETAIL = 0x2,
+ D3D11_RLDO_IGNORE_INTERNAL = 0x4
+ } D3D11_RLDO_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D11_RLDO_FLAGS)
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D11Debug_INTERFACE_DEFINED__
+#define __ID3D11Debug_INTERFACE_DEFINED__
+
+/* interface ID3D11Debug */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11Debug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("79cf2233-7536-4948-9d36-1e4692dc5760")
+ ID3D11Debug : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ UINT Mask) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay(
+ UINT Milliseconds) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
+ /* [annotation] */
+ _In_opt_ IDXGISwapChain *pSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSwapChain(
+ /* [annotation] */
+ _Out_ IDXGISwapChain **ppSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ValidateContext(
+ /* [annotation] */
+ _In_ ID3D11DeviceContext *pContext) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
+ D3D11_RLDO_FLAGS Flags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ValidateContextForDispatch(
+ /* [annotation] */
+ _In_ ID3D11DeviceContext *pContext) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11DebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11Debug * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11Debug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D11Debug * This,
+ UINT Mask);
+
+ UINT ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D11Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )(
+ ID3D11Debug * This,
+ UINT Milliseconds);
+
+ UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )(
+ ID3D11Debug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetSwapChain )(
+ ID3D11Debug * This,
+ /* [annotation] */
+ _In_opt_ IDXGISwapChain *pSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSwapChain )(
+ ID3D11Debug * This,
+ /* [annotation] */
+ _Out_ IDXGISwapChain **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *ValidateContext )(
+ ID3D11Debug * This,
+ /* [annotation] */
+ _In_ ID3D11DeviceContext *pContext);
+
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
+ ID3D11Debug * This,
+ D3D11_RLDO_FLAGS Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *ValidateContextForDispatch )(
+ ID3D11Debug * This,
+ /* [annotation] */
+ _In_ ID3D11DeviceContext *pContext);
+
+ END_INTERFACE
+ } ID3D11DebugVtbl;
+
+ interface ID3D11Debug
+ {
+ CONST_VTBL struct ID3D11DebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11Debug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11Debug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11Debug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11Debug_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D11Debug_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#define ID3D11Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \
+ ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) )
+
+#define ID3D11Debug_GetPresentPerRenderOpDelay(This) \
+ ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) )
+
+#define ID3D11Debug_SetSwapChain(This,pSwapChain) \
+ ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) )
+
+#define ID3D11Debug_GetSwapChain(This,ppSwapChain) \
+ ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) )
+
+#define ID3D11Debug_ValidateContext(This,pContext) \
+ ( (This)->lpVtbl -> ValidateContext(This,pContext) )
+
+#define ID3D11Debug_ReportLiveDeviceObjects(This,Flags) \
+ ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
+
+#define ID3D11Debug_ValidateContextForDispatch(This,pContext) \
+ ( (This)->lpVtbl -> ValidateContextForDispatch(This,pContext) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11Debug_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11sdklayers_0000_0001 */
+/* [local] */
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D11SwitchToRef_INTERFACE_DEFINED__
+#define __ID3D11SwitchToRef_INTERFACE_DEFINED__
+
+/* interface ID3D11SwitchToRef */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11SwitchToRef;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1ef337e3-58e7-4f83-a692-db221f5ed47e")
+ ID3D11SwitchToRef : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE SetUseRef(
+ BOOL UseRef) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11SwitchToRefVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11SwitchToRef * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11SwitchToRef * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11SwitchToRef * This);
+
+ BOOL ( STDMETHODCALLTYPE *SetUseRef )(
+ ID3D11SwitchToRef * This,
+ BOOL UseRef);
+
+ BOOL ( STDMETHODCALLTYPE *GetUseRef )(
+ ID3D11SwitchToRef * This);
+
+ END_INTERFACE
+ } ID3D11SwitchToRefVtbl;
+
+ interface ID3D11SwitchToRef
+ {
+ CONST_VTBL struct ID3D11SwitchToRefVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11SwitchToRef_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11SwitchToRef_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11SwitchToRef_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11SwitchToRef_SetUseRef(This,UseRef) \
+ ( (This)->lpVtbl -> SetUseRef(This,UseRef) )
+
+#define ID3D11SwitchToRef_GetUseRef(This) \
+ ( (This)->lpVtbl -> GetUseRef(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11SwitchToRef_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11sdklayers_0000_0002 */
+/* [local] */
+
+typedef
+enum D3D11_SHADER_TRACKING_RESOURCE_TYPE
+ {
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_NONE = 0,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_UAV_DEVICEMEMORY = 1,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_NON_UAV_DEVICEMEMORY = 2,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL_DEVICEMEMORY = 3,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_GROUPSHARED_MEMORY = 4,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL_SHARED_MEMORY = 5,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_GROUPSHARED_NON_UAV = 6,
+ D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL = 7
+ } D3D11_SHADER_TRACKING_RESOURCE_TYPE;
+
+typedef
+enum D3D11_SHADER_TRACKING_OPTION
+ {
+ D3D11_SHADER_TRACKING_OPTION_IGNORE = 0,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_UNINITIALIZED = 0x1,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_RAW = 0x2,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_WAR = 0x4,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_WAW = 0x8,
+ D3D11_SHADER_TRACKING_OPTION_ALLOW_SAME = 0x10,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY = 0x20,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS = 0x40,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS = 0x80,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS = 0x100,
+ D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS = 0x200,
+ D3D11_SHADER_TRACKING_OPTION_UAV_SPECIFIC_FLAGS = ( ( ( D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS ) | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS ) | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS ) ,
+ D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS = ( ( ( ( ( ( ( D3D11_SHADER_TRACKING_OPTION_TRACK_RAW | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR ) | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW ) | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY ) | D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS ) | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS ) | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS ) | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS ) ,
+ D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS_ALLOWING_SAME = ( D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS | D3D11_SHADER_TRACKING_OPTION_ALLOW_SAME ) ,
+ D3D11_SHADER_TRACKING_OPTION_ALL_OPTIONS = ( D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS_ALLOWING_SAME | D3D11_SHADER_TRACKING_OPTION_TRACK_UNINITIALIZED )
+ } D3D11_SHADER_TRACKING_OPTIONS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3D11TracingDevice_INTERFACE_DEFINED__
+#define __ID3D11TracingDevice_INTERFACE_DEFINED__
+
+/* interface ID3D11TracingDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11TracingDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1911c771-1587-413e-a7e0-fb26c3de0268")
+ ID3D11TracingDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetShaderTrackingOptionsByType(
+ /* [annotation] */
+ _In_ UINT ResourceTypeFlags,
+ /* [annotation] */
+ _In_ UINT Options) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetShaderTrackingOptions(
+ /* [annotation] */
+ _In_ IUnknown *pShader,
+ /* [annotation] */
+ _In_ UINT Options) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11TracingDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11TracingDevice * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11TracingDevice * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11TracingDevice * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetShaderTrackingOptionsByType )(
+ ID3D11TracingDevice * This,
+ /* [annotation] */
+ _In_ UINT ResourceTypeFlags,
+ /* [annotation] */
+ _In_ UINT Options);
+
+ HRESULT ( STDMETHODCALLTYPE *SetShaderTrackingOptions )(
+ ID3D11TracingDevice * This,
+ /* [annotation] */
+ _In_ IUnknown *pShader,
+ /* [annotation] */
+ _In_ UINT Options);
+
+ END_INTERFACE
+ } ID3D11TracingDeviceVtbl;
+
+ interface ID3D11TracingDevice
+ {
+ CONST_VTBL struct ID3D11TracingDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11TracingDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11TracingDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11TracingDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11TracingDevice_SetShaderTrackingOptionsByType(This,ResourceTypeFlags,Options) \
+ ( (This)->lpVtbl -> SetShaderTrackingOptionsByType(This,ResourceTypeFlags,Options) )
+
+#define ID3D11TracingDevice_SetShaderTrackingOptions(This,pShader,Options) \
+ ( (This)->lpVtbl -> SetShaderTrackingOptions(This,pShader,Options) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11TracingDevice_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11RefTrackingOptions_INTERFACE_DEFINED__
+#define __ID3D11RefTrackingOptions_INTERFACE_DEFINED__
+
+/* interface ID3D11RefTrackingOptions */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11RefTrackingOptions;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("193dacdf-0db2-4c05-a55c-ef06cac56fd9")
+ ID3D11RefTrackingOptions : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetTrackingOptions(
+ UINT uOptions) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11RefTrackingOptionsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11RefTrackingOptions * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11RefTrackingOptions * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11RefTrackingOptions * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetTrackingOptions )(
+ ID3D11RefTrackingOptions * This,
+ UINT uOptions);
+
+ END_INTERFACE
+ } ID3D11RefTrackingOptionsVtbl;
+
+ interface ID3D11RefTrackingOptions
+ {
+ CONST_VTBL struct ID3D11RefTrackingOptionsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11RefTrackingOptions_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11RefTrackingOptions_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11RefTrackingOptions_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11RefTrackingOptions_SetTrackingOptions(This,uOptions) \
+ ( (This)->lpVtbl -> SetTrackingOptions(This,uOptions) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11RefTrackingOptions_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11RefDefaultTrackingOptions_INTERFACE_DEFINED__
+#define __ID3D11RefDefaultTrackingOptions_INTERFACE_DEFINED__
+
+/* interface ID3D11RefDefaultTrackingOptions */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11RefDefaultTrackingOptions;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("03916615-c644-418c-9bf4-75db5be63ca0")
+ ID3D11RefDefaultTrackingOptions : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetTrackingOptions(
+ UINT ResourceTypeFlags,
+ UINT Options) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11RefDefaultTrackingOptionsVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11RefDefaultTrackingOptions * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11RefDefaultTrackingOptions * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11RefDefaultTrackingOptions * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetTrackingOptions )(
+ ID3D11RefDefaultTrackingOptions * This,
+ UINT ResourceTypeFlags,
+ UINT Options);
+
+ END_INTERFACE
+ } ID3D11RefDefaultTrackingOptionsVtbl;
+
+ interface ID3D11RefDefaultTrackingOptions
+ {
+ CONST_VTBL struct ID3D11RefDefaultTrackingOptionsVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11RefDefaultTrackingOptions_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11RefDefaultTrackingOptions_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11RefDefaultTrackingOptions_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11RefDefaultTrackingOptions_SetTrackingOptions(This,ResourceTypeFlags,Options) \
+ ( (This)->lpVtbl -> SetTrackingOptions(This,ResourceTypeFlags,Options) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11RefDefaultTrackingOptions_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11sdklayers_0000_0005 */
+/* [local] */
+
+DEFINE_GUID(DXGI_DEBUG_D3D11, 0x4b99317b, 0xac39, 0x4aa6, 0xbb, 0xb, 0xba, 0xa0, 0x47, 0x84, 0x79, 0x8f);
+#define D3D11_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D")
+#define D3D11_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput")
+#define D3D11_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage")
+#define D3D11_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride")
+#define D3D11_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s")
+#define D3D11_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s")
+#define D3D11_MUTE_ID_STRING __TEXT("Mute_ID_%s")
+#define D3D11_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d")
+#define D3D11_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO")
+#define D3D11_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s")
+#define D3D11_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s")
+#define D3D11_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s")
+#define D3D11_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d")
+#define D3D11_APPSIZE_STRING __TEXT("Size")
+#define D3D11_APPNAME_STRING __TEXT("Name")
+#define D3D11_FORCE_DEBUGGABLE __TEXT("ForceDebuggable")
+#define D3D11_FORCE_SHADER_SKIP_OPTIMIZATION __TEXT("ForceShaderSkipOptimization")
+typedef
+enum D3D11_MESSAGE_CATEGORY
+ {
+ D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
+ D3D11_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_INITIALIZATION = ( D3D11_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_CLEANUP = ( D3D11_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_COMPILATION = ( D3D11_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_STATE_CREATION = ( D3D11_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_STATE_SETTING = ( D3D11_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_STATE_GETTING = ( D3D11_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D11_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_EXECUTION = ( D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
+ D3D11_MESSAGE_CATEGORY_SHADER = ( D3D11_MESSAGE_CATEGORY_EXECUTION + 1 )
+ } D3D11_MESSAGE_CATEGORY;
+
+typedef
+enum D3D11_MESSAGE_SEVERITY
+ {
+ D3D11_MESSAGE_SEVERITY_CORRUPTION = 0,
+ D3D11_MESSAGE_SEVERITY_ERROR = ( D3D11_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
+ D3D11_MESSAGE_SEVERITY_WARNING = ( D3D11_MESSAGE_SEVERITY_ERROR + 1 ) ,
+ D3D11_MESSAGE_SEVERITY_INFO = ( D3D11_MESSAGE_SEVERITY_WARNING + 1 ) ,
+ D3D11_MESSAGE_SEVERITY_MESSAGE = ( D3D11_MESSAGE_SEVERITY_INFO + 1 )
+ } D3D11_MESSAGE_SEVERITY;
+
+typedef
+enum D3D11_MESSAGE_ID
+ {
+ D3D11_MESSAGE_ID_UNKNOWN = 0,
+ D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_UNKNOWN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_THIS = ( D3D11_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D11_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
+ D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
+ D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
+ D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
+ D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
+ D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
+ D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
+ D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) ,
+ D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
+ D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
+ D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_REF_THREADING_MODE = ( D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
+ D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
+ D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
+ D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
+ D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
+ D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
+ D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
+ D3D11_MESSAGE_ID_REF_INFO = ( D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_REF_INFO + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) ,
+ D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) ,
+ D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) ,
+ D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_BUFFER = ( D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D11_MESSAGE_ID_LIVE_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_SAMPLER = ( D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D11_MESSAGE_ID_LIVE_SAMPLER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_QUERY = ( D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PREDICATE = ( D3D11_MESSAGE_ID_LIVE_QUERY + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_COUNTER = ( D3D11_MESSAGE_ID_LIVE_PREDICATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEVICE = ( D3D11_MESSAGE_ID_LIVE_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_SWAPCHAIN = ( D3D11_MESSAGE_ID_LIVE_DEVICE + 1 ) ,
+ D3D11_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D11_MESSAGE_ID_LIVE_SWAPCHAIN + 1 ) ,
+ D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) ,
+ D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) ,
+ D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) ,
+ D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) ,
+ D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) ,
+ D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) ,
+ D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) ,
+ D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x200000,
+ D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_D3D11_MESSAGES_START + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) ,
+ D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_CONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_CONTEXT = ( D3D11_MESSAGE_ID_CREATE_CONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_CONTEXT = ( D3D11_MESSAGE_ID_LIVE_CONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_BUFFER = ( D3D11_MESSAGE_ID_DESTROY_CONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_BUFFER_WIN7 = ( D3D11_MESSAGE_ID_CREATE_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_BUFFER = ( D3D11_MESSAGE_ID_LIVE_BUFFER_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_TEXTURE1D = ( D3D11_MESSAGE_ID_DESTROY_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE1D_WIN7 = ( D3D11_MESSAGE_ID_CREATE_TEXTURE1D + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_TEXTURE1D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE1D_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_TEXTURE2D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE1D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE2D_WIN7 = ( D3D11_MESSAGE_ID_CREATE_TEXTURE2D + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_TEXTURE2D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE2D_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_TEXTURE3D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE2D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_TEXTURE3D_WIN7 = ( D3D11_MESSAGE_ID_CREATE_TEXTURE3D + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_TEXTURE3D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE3D_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE3D + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW_WIN7 = ( D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW_WIN7 = ( D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW_WIN7 = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_VERTEXSHADER = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_VERTEXSHADER_WIN7 = ( D3D11_MESSAGE_ID_CREATE_VERTEXSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER = ( D3D11_MESSAGE_ID_LIVE_VERTEXSHADER_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_HULLSHADER = ( D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_HULLSHADER = ( D3D11_MESSAGE_ID_CREATE_HULLSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_HULLSHADER = ( D3D11_MESSAGE_ID_LIVE_HULLSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_DOMAINSHADER = ( D3D11_MESSAGE_ID_DESTROY_HULLSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DOMAINSHADER = ( D3D11_MESSAGE_ID_CREATE_DOMAINSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER = ( D3D11_MESSAGE_ID_LIVE_DOMAINSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER_WIN7 = ( D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_PIXELSHADER = ( D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PIXELSHADER_WIN7 = ( D3D11_MESSAGE_ID_CREATE_PIXELSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_PIXELSHADER = ( D3D11_MESSAGE_ID_LIVE_PIXELSHADER_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_DESTROY_PIXELSHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT_WIN7 = ( D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT = ( D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_SAMPLER = ( D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_SAMPLER_WIN7 = ( D3D11_MESSAGE_ID_CREATE_SAMPLER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_SAMPLER = ( D3D11_MESSAGE_ID_LIVE_SAMPLER_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_BLENDSTATE = ( D3D11_MESSAGE_ID_DESTROY_SAMPLER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_BLENDSTATE_WIN7 = ( D3D11_MESSAGE_ID_CREATE_BLENDSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_BLENDSTATE = ( D3D11_MESSAGE_ID_LIVE_BLENDSTATE_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_DESTROY_BLENDSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE_WIN7 = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE_WIN7 = ( D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_QUERY = ( D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_QUERY_WIN7 = ( D3D11_MESSAGE_ID_CREATE_QUERY + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_QUERY = ( D3D11_MESSAGE_ID_LIVE_QUERY_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_PREDICATE = ( D3D11_MESSAGE_ID_DESTROY_QUERY + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PREDICATE_WIN7 = ( D3D11_MESSAGE_ID_CREATE_PREDICATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_PREDICATE = ( D3D11_MESSAGE_ID_LIVE_PREDICATE_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_COUNTER = ( D3D11_MESSAGE_ID_DESTROY_PREDICATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_COUNTER = ( D3D11_MESSAGE_ID_CREATE_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_COMMANDLIST = ( D3D11_MESSAGE_ID_DESTROY_COUNTER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_COMMANDLIST = ( D3D11_MESSAGE_ID_CREATE_COMMANDLIST + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_COMMANDLIST = ( D3D11_MESSAGE_ID_LIVE_COMMANDLIST + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_DESTROY_COMMANDLIST + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE = ( D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE = ( D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEVICE_WIN7 = ( D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY_WIN7 = ( D3D11_MESSAGE_ID_LIVE_DEVICE_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY_WIN7 + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_COMPUTESHADER = ( D3D11_MESSAGE_ID_CREATE_COMPUTESHADER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_COMPUTESHADER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL = ( D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) ,
+ D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV = ( D3D11_MESSAGE_ID_REF_WARNING + 1 ) ,
+ D3D11_MESSAGE_ID_SHADER_ABORT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV + 1 ) ,
+ D3D11_MESSAGE_ID_SHADER_MESSAGE = ( D3D11_MESSAGE_ID_SHADER_ABORT + 1 ) ,
+ D3D11_MESSAGE_ID_SHADER_ERROR = ( D3D11_MESSAGE_ID_SHADER_MESSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_SHADER_ERROR + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
+ D3D11_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN = ( D3D11_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NUMUAVS_INVALIDRANGE = ( D3D11_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_MESSAGES_END = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NUMUAVS_INVALIDRANGE + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_1_MESSAGES_START = 0x300000,
+ D3D11_MESSAGE_ID_CREATE_VIDEODECODER = ( D3D11_MESSAGE_ID_D3D11_1_MESSAGES_START + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSORENUM = ( D3D11_MESSAGE_ID_CREATE_VIDEODECODER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSOR = ( D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSORENUM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_DECODEROUTPUTVIEW = ( D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSOR + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_PROCESSORINPUTVIEW = ( D3D11_MESSAGE_ID_CREATE_DECODEROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_PROCESSOROUTPUTVIEW = ( D3D11_MESSAGE_ID_CREATE_PROCESSORINPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_DEVICECONTEXTSTATE = ( D3D11_MESSAGE_ID_CREATE_PROCESSOROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_VIDEODECODER = ( D3D11_MESSAGE_ID_CREATE_DEVICECONTEXTSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSORENUM = ( D3D11_MESSAGE_ID_LIVE_VIDEODECODER + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSOR = ( D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSORENUM + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DECODEROUTPUTVIEW = ( D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSOR + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PROCESSORINPUTVIEW = ( D3D11_MESSAGE_ID_LIVE_DECODEROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_PROCESSOROUTPUTVIEW = ( D3D11_MESSAGE_ID_LIVE_PROCESSORINPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_DEVICECONTEXTSTATE = ( D3D11_MESSAGE_ID_LIVE_PROCESSOROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_VIDEODECODER = ( D3D11_MESSAGE_ID_LIVE_DEVICECONTEXTSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSORENUM = ( D3D11_MESSAGE_ID_DESTROY_VIDEODECODER + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = ( D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSORENUM + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_DECODEROUTPUTVIEW = ( D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSOR + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_PROCESSORINPUTVIEW = ( D3D11_MESSAGE_ID_DESTROY_DECODEROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_PROCESSOROUTPUTVIEW = ( D3D11_MESSAGE_ID_DESTROY_PROCESSORINPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_DEVICECONTEXTSTATE = ( D3D11_MESSAGE_ID_DESTROY_PROCESSOROUTPUTVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFLAGS = ( D3D11_MESSAGE_ID_DESTROY_DEVICECONTEXTSTATE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFEATURELEVEL = ( D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_FEATURELEVELS_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFEATURELEVEL + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDREFIID = ( D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_FEATURELEVELS_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DISCARDVIEW_INVALIDVIEW = ( D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDREFIID + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION1_INVALIDCOPYFLAGS = ( D3D11_MESSAGE_ID_DEVICE_DISCARDVIEW_INVALIDVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE1_INVALIDCOPYFLAGS = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION1_INVALIDCOPYFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE1_INVALIDCOPYFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_ZEROWIDTHHEIGHT = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERSIZE = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERUSAGE = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERPROFILECOUNT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEODECODERPROFILECOUNT_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_INVALIDINDEX = ( D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_INVALIDINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_INVALIDINDEX = ( D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_INVALIDINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERCREATIONPARAMS_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERDRIVERHANDLE_NULLPARAM = ( D3D11_MESSAGE_ID_GETDECODERCREATIONPARAMS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERBUFFER_NULLPARAM = ( D3D11_MESSAGE_ID_GETDECODERDRIVERHANDLE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDBUFFER = ( D3D11_MESSAGE_ID_GETDECODERBUFFER_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDTYPE = ( D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDBUFFER + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERBUFFER_LOCKED = ( D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NULLPARAM = ( D3D11_MESSAGE_ID_GETDECODERBUFFER_LOCKED + 1 ) ,
+ D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_INVALIDTYPE = ( D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NOTLOCKED = ( D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DECODERBEGINFRAME_NULLPARAM = ( D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NOTLOCKED + 1 ) ,
+ D3D11_MESSAGE_ID_DECODERBEGINFRAME_HAZARD = ( D3D11_MESSAGE_ID_DECODERBEGINFRAME_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_DECODERENDFRAME_NULLPARAM = ( D3D11_MESSAGE_ID_DECODERBEGINFRAME_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_NULLPARAM = ( D3D11_MESSAGE_ID_DECODERENDFRAME_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_INVALIDTYPE = ( D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_DECODEREXTENSION_NULLPARAM = ( D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DECODEREXTENSION_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DECODEREXTENSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_DECODEREXTENSION_INVALIDRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDFRAMEFORMAT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDUSAGE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDFRAMEFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDINPUTFRAMERATE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDOUTPUTFRAMERATE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDINPUTFRAMERATE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDWIDTHHEIGHT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDOUTPUTFRAMERATE + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORCONTENTDESC_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDWIDTHHEIGHT + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORCONTENTDESC_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORCAPS_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORCAPS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_INVALIDINDEX = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_INVALIDINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_INVALIDINDEX = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_INVALIDINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTTARGETRECT_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTTARGETRECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_INVALIDALPHA = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_INVALIDALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDFILLMODE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDFILLMODE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTEXTENSION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTTARGETRECT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTEXTENSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTBACKGROUNDCOLOR_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTTARGETRECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTBACKGROUNDCOLOR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTALPHAFILLMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCONSTRICTION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTALPHAFILLMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCONSTRICTION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_INVALIDSIZE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSTEREOMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_INVALIDSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTEXTENSION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSTEREOMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTEXTENSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDRATE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDFLAG = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDRATE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDFLAG + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDRECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDRECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDALPHA = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDCOUNT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDALPHA = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDALPHA + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDRATIO = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDRATIO + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDRANGE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDRANGE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FLIPUNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_MONOOFFSETUNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FLIPUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FORMATUNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_MONOOFFSETUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FORMATUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDFILTER = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDFILTER + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDLEVEL = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDLEVEL + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSTREAMCOUNT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_TARGETRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSTREAMCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDOUTPUT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_TARGETRECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDPASTFRAMES = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDOUTPUT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDFUTUREFRAMES = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDPASTFRAMES + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSOURCERECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDFUTUREFRAMES + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDDESTRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSOURCERECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDINPUTRESOURCE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDDESTRECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAYSIZE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDINPUTRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAY = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAYSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTEXPECTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTNOTEXPECTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTEXPECTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_STEREONOTENABLED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTNOTEXPECTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDRIGHTRESOURCE = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_STEREONOTENABLED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NOSTEREOSTREAMS = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDRIGHTRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INPUTHAZARD = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NOSTEREOSTREAMS + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_OUTPUTHAZARD = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INPUTHAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_OUTPUTHAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDTYPE = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDBIND = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDBIND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDMIP = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEMIP = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAYSIZE = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAYSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDDIMENSION = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDDIMENSION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDTYPE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDBIND = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMISC = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDBIND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDUSAGE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMISC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFOURCC = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMIP = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFOURCC + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_UNSUPPORTEDMIP = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAYSIZE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_UNSUPPORTEDMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAY = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAYSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDDIMENSION = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDDIMENSION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_NULLPARAM = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDTYPE = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDBIND = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDBIND + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMIP = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDMIP = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDARRAY = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDMIP + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDARRAY = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDDIMENSION = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDDIMENSION + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING_ATOMIC_INCONSISTENT = ( D3D11_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING_READING_UNINITIALIZED_RESOURCE = ( D3D11_MESSAGE_ID_REF_WARNING_ATOMIC_INCONSISTENT + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING_RAW_HAZARD = ( D3D11_MESSAGE_ID_REF_WARNING_READING_UNINITIALIZED_RESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING_WAR_HAZARD = ( D3D11_MESSAGE_ID_REF_WARNING_RAW_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_REF_WARNING_WAW_HAZARD = ( D3D11_MESSAGE_ID_REF_WARNING_WAR_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECRYPTOSESSION_NULLPARAM = ( D3D11_MESSAGE_ID_REF_WARNING_WAW_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATECRYPTOSESSION_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATECRYPTOSESSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOTYPE_NULLPARAM = ( D3D11_MESSAGE_ID_CREATECRYPTOSESSION_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_GETDECODERPROFILE_NULLPARAM = ( D3D11_MESSAGE_ID_GETCRYPTOTYPE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATESIZE_NULLPARAM = ( D3D11_MESSAGE_ID_GETDECODERPROFILE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_NULLPARAM = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATESIZE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_WRONGSIZE = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_WRONGSIZE = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_WRONGSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_NULLPARAM = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_WRONGSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_UNSUPPORTED = ( D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_NULLPARAM = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_WRONGDEVICE = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_WRONGDEVICE = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_WRONGDEVICE + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_FORMAT_MISMATCH = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_WRONGDEVICE + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SIZE_MISMATCH = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_FORMAT_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MULTISAMPLED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SIZE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_NOT_STAGING = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MULTISAMPLED + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MAPPED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_NOT_STAGING + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_MAPPED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_OFFERED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_OFFERED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_OFFERED + 1 ) ,
+ D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_CONTENT_UNDEFINED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_OFFERED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_UNSUPPORTED = ( D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_CONTENT_UNDEFINED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_NULLPARAM = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_WRONGDEVICE = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_WRONGDEVICE = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_WRONGDEVICE + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_FORMAT_MISMATCH = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_WRONGDEVICE + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SIZE_MISMATCH = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_FORMAT_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MULTISAMPLED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SIZE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_NOT_STAGING = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MULTISAMPLED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_NOT_RENDER_TARGET = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_NOT_STAGING + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_MAPPED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_NOT_RENDER_TARGET + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MAPPED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_OFFERED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MAPPED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_OFFERED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_OFFERED + 1 ) ,
+ D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_CONTENT_UNDEFINED = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_OFFERED + 1 ) ,
+ D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_NULLPARAM = ( D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_CONTENT_UNDEFINED + 1 ) ,
+ D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_INVALIDSIZE = ( D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_FINISHSESSIONKEYREFRESH_NULLPARAM = ( D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_INVALIDSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_NULLPARAM = ( D3D11_MESSAGE_ID_FINISHSESSIONKEYREFRESH_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_INVALIDSIZE = ( D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCONTENTPROTECTIONCAPS_NULLPARAM = ( D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_INVALIDSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_NULLPARAM = ( D3D11_MESSAGE_ID_GETCONTENTPROTECTIONCAPS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_INVALIDINDEX = ( D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_INVALIDINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_UNSUPPORTED = ( D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_INVALIDTYPE = ( D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_INVALIDCHANNEL = ( D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_NULLPARAM = ( D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_INVALIDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_INVALIDCHANNEL = ( D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_NULLPARAM = ( D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_INVALIDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_WRONGSIZE = ( D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDCHANNEL = ( D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_WRONGSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_NULLPARAM = ( D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_NULLPARAM = ( D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGCHANNEL = ( D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_UNSUPPORTEDQUERY = ( D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGSIZE = ( D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_UNSUPPORTEDQUERY + 1 ) ,
+ D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_INVALIDPROCESSINDEX = ( D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_NULLPARAM = ( D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_INVALIDPROCESSINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGCHANNEL = ( D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_UNSUPPORTEDCONFIGURE = ( D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGSIZE = ( D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_UNSUPPORTEDCONFIGURE + 1 ) ,
+ D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_INVALIDPROCESSIDTYPE = ( D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_INVALIDPROCESSIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_INVALIDSIZE = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDSIZE = ( D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_INVALIDSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY = ( D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDSIZE + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_OUTOFMEMORY = ( D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + 1 ) ,
+ D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_NULLPARAM = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_OUTOFMEMORY + 1 ) ,
+ D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDTYPE = ( D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDBIND = ( D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDARRAY = ( D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDBIND + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_NULLPARAM = ( D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDARRAY + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALID = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALID + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) ,
+ D3D11_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 = ( D3D11_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_GETDC_INACCESSIBLE = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT = ( D3D11_MESSAGE_ID_GETDC_INACCESSIBLE + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 = ( D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE = ( D3D11_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA = ( D3D11_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = ( D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = ( D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX = ( D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT + 1 ) ,
+ D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
+ D3D11_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM = ( D3D11_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM = ( D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT = ( D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT + 1 ) ,
+ D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_1_MESSAGES_END = ( D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_2_MESSAGES_START = ( D3D11_MESSAGE_ID_D3D11_1_MESSAGES_END + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE = ( D3D11_MESSAGE_ID_D3D11_2_MESSAGES_START + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_COPYTILES_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_UPDATETILES_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_COPYTILES_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_RESIZETILEPOOL_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_UPDATETILES_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_TILEDRESOURCEBARRIER_INVALID_PARAMETER = ( D3D11_MESSAGE_ID_RESIZETILEPOOL_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING = ( D3D11_MESSAGE_ID_TILEDRESOURCEBARRIER_INVALID_PARAMETER + 1 ) ,
+ D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR = ( D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING + 1 ) ,
+ D3D11_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS = ( D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR + 1 ) ,
+ D3D11_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA = ( D3D11_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS + 1 ) ,
+ D3D11_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE = ( D3D11_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA + 1 ) ,
+ D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES = ( D3D11_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE + 1 ) ,
+ D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT = ( D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES + 1 ) ,
+ D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT + 1 ) ,
+ D3D11_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE = ( D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_RESIZETILEPOOL_SHRINK_WITH_MAPPINGS_STILL_DEFINED_PAST_END = ( D3D11_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER = ( D3D11_MESSAGE_ID_RESIZETILEPOOL_SHRINK_WITH_MAPPINGS_STILL_DEFINED_PAST_END + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = ( D3D11_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEDEVICE_WARNING = ( D3D11_MESSAGE_ID_CREATEDEVICE_INVALIDARGS + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWUINT_HAZARD = ( D3D11_MESSAGE_ID_CREATEDEVICE_WARNING + 1 ) ,
+ D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_HAZARD = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWUINT_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_CRYPTOSESSION = ( D3D11_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL = ( D3D11_MESSAGE_ID_CREATE_CRYPTOSESSION + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_CRYPTOSESSION = ( D3D11_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL = ( D3D11_MESSAGE_ID_LIVE_CRYPTOSESSION + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_CRYPTOSESSION = ( D3D11_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL = ( D3D11_MESSAGE_ID_DESTROY_CRYPTOSESSION + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_2_MESSAGES_END = ( D3D11_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_3_MESSAGES_START = ( D3D11_MESSAGE_ID_D3D11_2_MESSAGES_END + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = ( D3D11_MESSAGE_ID_D3D11_3_MESSAGES_START + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE = ( D3D11_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS = ( D3D11_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D = ( D3D11_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB = ( D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT = ( D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH = ( D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH = ( D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD = ( D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD = ( D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_OUTPUTDIMENSIONSTOOLARGE = ( D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_NONPOW2SCALEUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_OUTPUTDIMENSIONSTOOLARGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_FRACTIONALDOWNSCALETOLARGE = ( D3D11_MESSAGE_ID_JPEGDECODE_NONPOW2SCALEUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH = ( D3D11_MESSAGE_ID_JPEGDECODE_FRACTIONALDOWNSCALETOLARGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH = ( D3D11_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS = ( D3D11_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE = ( D3D11_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_HAZARD = ( D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE = ( D3D11_MESSAGE_ID_JPEGDECODE_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS = ( D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE = ( D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS = ( D3D11_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = ( D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET = ( D3D11_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS = ( D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = ( D3D11_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGENCODE_SOURCENOT2D + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH = ( D3D11_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH = ( D3D11_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED = ( D3D11_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL = ( D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE = ( D3D11_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_HAZARD = ( D3D11_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE = ( D3D11_MESSAGE_ID_JPEGENCODE_HAZARD + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS = ( D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE = ( D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + 1 ) ,
+ D3D11_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED = ( D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + 1 ) ,
+ D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY = ( D3D11_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
+ D3D11_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY + 1 ) ,
+ D3D11_MESSAGE_ID_DEVICE_SETHARDWAREPROTECTION_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + 1 ) ,
+ D3D11_MESSAGE_ID_D3D11_3_MESSAGES_END = ( D3D11_MESSAGE_ID_DEVICE_SETHARDWAREPROTECTION_INVALIDCONTEXT + 1 )
+ } D3D11_MESSAGE_ID;
+
+typedef struct D3D11_MESSAGE
+ {
+ D3D11_MESSAGE_CATEGORY Category;
+ D3D11_MESSAGE_SEVERITY Severity;
+ D3D11_MESSAGE_ID ID;
+ /* [annotation] */
+ _Field_size_(DescriptionByteLength) const char *pDescription;
+ SIZE_T DescriptionByteLength;
+ } D3D11_MESSAGE;
+
+typedef struct D3D11_INFO_QUEUE_FILTER_DESC
+ {
+ UINT NumCategories;
+ /* [annotation] */
+ _Field_size_(NumCategories) D3D11_MESSAGE_CATEGORY *pCategoryList;
+ UINT NumSeverities;
+ /* [annotation] */
+ _Field_size_(NumSeverities) D3D11_MESSAGE_SEVERITY *pSeverityList;
+ UINT NumIDs;
+ /* [annotation] */
+ _Field_size_(NumIDs) D3D11_MESSAGE_ID *pIDList;
+ } D3D11_INFO_QUEUE_FILTER_DESC;
+
+typedef struct D3D11_INFO_QUEUE_FILTER
+ {
+ D3D11_INFO_QUEUE_FILTER_DESC AllowList;
+ D3D11_INFO_QUEUE_FILTER_DESC DenyList;
+ } D3D11_INFO_QUEUE_FILTER;
+
+#define D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0005_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0005_v0_0_s_ifspec;
+
+#ifndef __ID3D11InfoQueue_INTERFACE_DEFINED__
+#define __ID3D11InfoQueue_INTERFACE_DEFINED__
+
+/* interface ID3D11InfoQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11InfoQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6")
+ ID3D11InfoQueue : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMessage(
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D11_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddMessage(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
+ /* [annotation] */
+ _In_ BOOL bMute) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11InfoQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11InfoQueue * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11InfoQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit);
+
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D11_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ ID3D11InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
+ ID3D11InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ ID3D11InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ ID3D11InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ ID3D11InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ ID3D11InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_CATEGORY Category);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_SEVERITY Severity);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ D3D11_MESSAGE_ID ID);
+
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ ID3D11InfoQueue * This,
+ /* [annotation] */
+ _In_ BOOL bMute);
+
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ ID3D11InfoQueue * This);
+
+ END_INTERFACE
+ } ID3D11InfoQueueVtbl;
+
+ interface ID3D11InfoQueue
+ {
+ CONST_VTBL struct ID3D11InfoQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11InfoQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11InfoQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11InfoQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
+
+#define ID3D11InfoQueue_ClearStoredMessages(This) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This) )
+
+#define ID3D11InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
+
+#define ID3D11InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
+
+#define ID3D11InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
+
+#define ID3D11InfoQueue_GetNumStoredMessages(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This) )
+
+#define ID3D11InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
+
+#define ID3D11InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
+
+#define ID3D11InfoQueue_GetMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This) )
+
+#define ID3D11InfoQueue_AddStorageFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
+
+#define ID3D11InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D11InfoQueue_ClearStorageFilter(This) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This) )
+
+#define ID3D11InfoQueue_PushEmptyStorageFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
+
+#define ID3D11InfoQueue_PushCopyOfStorageFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
+
+#define ID3D11InfoQueue_PushStorageFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
+
+#define ID3D11InfoQueue_PopStorageFilter(This) \
+ ( (This)->lpVtbl -> PopStorageFilter(This) )
+
+#define ID3D11InfoQueue_GetStorageFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
+
+#define ID3D11InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
+
+#define ID3D11InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D11InfoQueue_ClearRetrievalFilter(This) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
+
+#define ID3D11InfoQueue_PushEmptyRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
+
+#define ID3D11InfoQueue_PushCopyOfRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
+
+#define ID3D11InfoQueue_PushRetrievalFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
+
+#define ID3D11InfoQueue_PopRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This) )
+
+#define ID3D11InfoQueue_GetRetrievalFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
+
+#define ID3D11InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
+
+#define ID3D11InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define ID3D11InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
+
+#define ID3D11InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
+
+#define ID3D11InfoQueue_SetBreakOnID(This,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
+
+#define ID3D11InfoQueue_GetBreakOnCategory(This,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
+
+#define ID3D11InfoQueue_GetBreakOnSeverity(This,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
+
+#define ID3D11InfoQueue_GetBreakOnID(This,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
+
+#define ID3D11InfoQueue_SetMuteDebugOutput(This,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
+
+#define ID3D11InfoQueue_GetMuteDebugOutput(This) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11InfoQueue_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11sdklayers_0000_0006 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D11Debug,0x79cf2233,0x7536,0x4948,0x9d,0x36,0x1e,0x46,0x92,0xdc,0x57,0x60);
+DEFINE_GUID(IID_ID3D11SwitchToRef,0x1ef337e3,0x58e7,0x4f83,0xa6,0x92,0xdb,0x22,0x1f,0x5e,0xd4,0x7e);
+DEFINE_GUID(IID_ID3D11TracingDevice,0x1911c771,0x1587,0x413e,0xa7,0xe0,0xfb,0x26,0xc3,0xde,0x02,0x68);
+DEFINE_GUID(IID_ID3D11RefTrackingOptions,0x193dacdf,0x0db2,0x4c05,0xa5,0x5c,0xef,0x06,0xca,0xc5,0x6f,0xd9);
+DEFINE_GUID(IID_ID3D11RefDefaultTrackingOptions,0x03916615,0xc644,0x418c,0x9b,0xf4,0x75,0xdb,0x5b,0xe6,0x3c,0xa0);
+DEFINE_GUID(IID_ID3D11InfoQueue,0x6543dbb6,0x1b48,0x42f5,0xab,0x82,0xe9,0x7e,0xc7,0x43,0x26,0xf6);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0006_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0006_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h
new file mode 100644
index 00000000000..84c36cf64c2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h
@@ -0,0 +1,601 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// File: D3D11Shader.h
+// Content: D3D11 Shader Types and APIs
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef __D3D11SHADER_H__
+#define __D3D11SHADER_H__
+
+#include "d3dcommon.h"
+
+
+typedef enum D3D11_SHADER_VERSION_TYPE
+{
+ D3D11_SHVER_PIXEL_SHADER = 0,
+ D3D11_SHVER_VERTEX_SHADER = 1,
+ D3D11_SHVER_GEOMETRY_SHADER = 2,
+
+ // D3D11 Shaders
+ D3D11_SHVER_HULL_SHADER = 3,
+ D3D11_SHVER_DOMAIN_SHADER = 4,
+ D3D11_SHVER_COMPUTE_SHADER = 5,
+
+ D3D11_SHVER_RESERVED0 = 0xFFF0,
+} D3D11_SHADER_VERSION_TYPE;
+
+#define D3D11_SHVER_GET_TYPE(_Version) \
+ (((_Version) >> 16) & 0xffff)
+#define D3D11_SHVER_GET_MAJOR(_Version) \
+ (((_Version) >> 4) & 0xf)
+#define D3D11_SHVER_GET_MINOR(_Version) \
+ (((_Version) >> 0) & 0xf)
+
+// Slot ID for library function return
+#define D3D_RETURN_PARAMETER_INDEX (-1)
+
+typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
+
+typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
+
+
+typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
+{
+ LPCSTR SemanticName; // Name of the semantic
+ UINT SemanticIndex; // Index of the semantic
+ UINT Register; // Number of member variables
+ D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
+ D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
+ BYTE Mask; // Mask to indicate which components of the register
+ // are used (combination of D3D10_COMPONENT_MASK values)
+ BYTE ReadWriteMask; // Mask to indicate whether a given component is
+ // never written (if this is an output signature) or
+ // always read (if this is an input signature).
+ // (combination of D3D_MASK_* values)
+ UINT Stream; // Stream index
+ D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
+} D3D11_SIGNATURE_PARAMETER_DESC;
+
+typedef struct _D3D11_SHADER_BUFFER_DESC
+{
+ LPCSTR Name; // Name of the constant buffer
+ D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
+ UINT Variables; // Number of member variables
+ UINT Size; // Size of CB (in bytes)
+ UINT uFlags; // Buffer description flags
+} D3D11_SHADER_BUFFER_DESC;
+
+typedef struct _D3D11_SHADER_VARIABLE_DESC
+{
+ LPCSTR Name; // Name of the variable
+ UINT StartOffset; // Offset in constant buffer's backing store
+ UINT Size; // Size of variable (in bytes)
+ UINT uFlags; // Variable flags
+ LPVOID DefaultValue; // Raw pointer to default value
+ UINT StartTexture; // First texture index (or -1 if no textures used)
+ UINT TextureSize; // Number of texture slots possibly used.
+ UINT StartSampler; // First sampler index (or -1 if no textures used)
+ UINT SamplerSize; // Number of sampler slots possibly used.
+} D3D11_SHADER_VARIABLE_DESC;
+
+typedef struct _D3D11_SHADER_TYPE_DESC
+{
+ D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
+ D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
+ UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
+ UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
+ UINT Elements; // Number of elements (0 if not an array)
+ UINT Members; // Number of members (0 if not a structure)
+ UINT Offset; // Offset from the start of structure (0 if not a structure member)
+ LPCSTR Name; // Name of type, can be NULL
+} D3D11_SHADER_TYPE_DESC;
+
+typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
+
+typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
+
+typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
+
+typedef struct _D3D11_SHADER_DESC
+{
+ UINT Version; // Shader version
+ LPCSTR Creator; // Creator string
+ UINT Flags; // Shader compilation/parse flags
+
+ UINT ConstantBuffers; // Number of constant buffers
+ UINT BoundResources; // Number of bound resources
+ UINT InputParameters; // Number of parameters in the input signature
+ UINT OutputParameters; // Number of parameters in the output signature
+
+ UINT InstructionCount; // Number of emitted instructions
+ UINT TempRegisterCount; // Number of temporary registers used
+ UINT TempArrayCount; // Number of temporary arrays used
+ UINT DefCount; // Number of constant defines
+ UINT DclCount; // Number of declarations (input + output)
+ UINT TextureNormalInstructions; // Number of non-categorized texture instructions
+ UINT TextureLoadInstructions; // Number of texture load instructions
+ UINT TextureCompInstructions; // Number of texture comparison instructions
+ UINT TextureBiasInstructions; // Number of texture bias instructions
+ UINT TextureGradientInstructions; // Number of texture gradient instructions
+ UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
+ UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
+ UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
+ UINT StaticFlowControlCount; // Number of static flow control instructions used
+ UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
+ UINT MacroInstructionCount; // Number of macro instructions used
+ UINT ArrayInstructionCount; // Number of array instructions used
+ UINT CutInstructionCount; // Number of cut instructions used
+ UINT EmitInstructionCount; // Number of emit instructions used
+ D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
+ UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
+ D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
+ UINT PatchConstantParameters; // Number of parameters in the patch constant signature
+ UINT cGSInstanceCount; // Number of Geometry shader instances
+ UINT cControlPoints; // Number of control points in the HS->DS stage
+ D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
+ D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
+ D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
+ // instruction counts
+ UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
+ UINT cInterlockedInstructions; // Number of interlocked instructions
+ UINT cTextureStoreInstructions; // Number of texture writes
+} D3D11_SHADER_DESC;
+
+typedef struct _D3D11_SHADER_INPUT_BIND_DESC
+{
+ LPCSTR Name; // Name of the resource
+ D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
+ UINT BindPoint; // Starting bind point
+ UINT BindCount; // Number of contiguous bind points (for arrays)
+
+ UINT uFlags; // Input binding flags
+ D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
+ D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
+ UINT NumSamples; // Number of samples (0 if not MS texture)
+} D3D11_SHADER_INPUT_BIND_DESC;
+
+#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
+#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
+#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
+#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
+#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
+#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
+#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
+#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
+#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
+
+
+typedef struct _D3D11_LIBRARY_DESC
+{
+ LPCSTR Creator; // The name of the originator of the library.
+ UINT Flags; // Compilation flags.
+ UINT FunctionCount; // Number of functions exported from the library.
+} D3D11_LIBRARY_DESC;
+
+typedef struct _D3D11_FUNCTION_DESC
+{
+ UINT Version; // Shader version
+ LPCSTR Creator; // Creator string
+ UINT Flags; // Shader compilation/parse flags
+
+ UINT ConstantBuffers; // Number of constant buffers
+ UINT BoundResources; // Number of bound resources
+
+ UINT InstructionCount; // Number of emitted instructions
+ UINT TempRegisterCount; // Number of temporary registers used
+ UINT TempArrayCount; // Number of temporary arrays used
+ UINT DefCount; // Number of constant defines
+ UINT DclCount; // Number of declarations (input + output)
+ UINT TextureNormalInstructions; // Number of non-categorized texture instructions
+ UINT TextureLoadInstructions; // Number of texture load instructions
+ UINT TextureCompInstructions; // Number of texture comparison instructions
+ UINT TextureBiasInstructions; // Number of texture bias instructions
+ UINT TextureGradientInstructions; // Number of texture gradient instructions
+ UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
+ UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
+ UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
+ UINT StaticFlowControlCount; // Number of static flow control instructions used
+ UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
+ UINT MacroInstructionCount; // Number of macro instructions used
+ UINT ArrayInstructionCount; // Number of array instructions used
+ UINT MovInstructionCount; // Number of mov instructions used
+ UINT MovcInstructionCount; // Number of movc instructions used
+ UINT ConversionInstructionCount; // Number of type conversion instructions used
+ UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
+ D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
+ UINT64 RequiredFeatureFlags; // Required feature flags
+
+ LPCSTR Name; // Function name
+ INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
+ BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
+ BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
+ BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
+} D3D11_FUNCTION_DESC;
+
+typedef struct _D3D11_PARAMETER_DESC
+{
+ LPCSTR Name; // Parameter name.
+ LPCSTR SemanticName; // Parameter semantic name (+index).
+ D3D_SHADER_VARIABLE_TYPE Type; // Element type.
+ D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
+ UINT Rows; // Rows are for matrix parameters.
+ UINT Columns; // Components or Columns in matrix.
+ D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
+ D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
+
+ UINT FirstInRegister; // The first input register for this parameter.
+ UINT FirstInComponent; // The first input register component for this parameter.
+ UINT FirstOutRegister; // The first output register for this parameter.
+ UINT FirstOutComponent; // The first output register component for this parameter.
+} D3D11_PARAMETER_DESC;
+
+
+//////////////////////////////////////////////////////////////////////////////
+// Interfaces ////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType;
+typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE;
+
+typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable;
+typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE;
+
+typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer;
+typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER;
+
+typedef interface ID3D11ShaderReflection ID3D11ShaderReflection;
+typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION;
+
+typedef interface ID3D11LibraryReflection ID3D11LibraryReflection;
+typedef interface ID3D11LibraryReflection *LPD3D11LIBRARYREFLECTION;
+
+typedef interface ID3D11FunctionReflection ID3D11FunctionReflection;
+typedef interface ID3D11FunctionReflection *LPD3D11FUNCTIONREFLECTION;
+
+typedef interface ID3D11FunctionParameterReflection ID3D11FunctionParameterReflection;
+typedef interface ID3D11FunctionParameterReflection *LPD3D11FUNCTIONPARAMETERREFLECTION;
+
+// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
+interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
+DEFINE_GUID(IID_ID3D11ShaderReflectionType,
+0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
+
+#undef INTERFACE
+#define INTERFACE ID3D11ShaderReflectionType
+
+DECLARE_INTERFACE(ID3D11ShaderReflectionType)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_TYPE_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
+ STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
+
+ STDMETHOD(IsEqual)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
+ STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
+ STDMETHOD(IsOfType)(THIS_ _In_ ID3D11ShaderReflectionType* pType) PURE;
+ STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D11ShaderReflectionType* pBase) PURE;
+};
+
+// {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
+interface DECLSPEC_UUID("51F23923-F3E5-4BD1-91CB-606177D8DB4C") ID3D11ShaderReflectionVariable;
+DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
+0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
+
+#undef INTERFACE
+#define INTERFACE ID3D11ShaderReflectionVariable
+
+DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
+
+ STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
+};
+
+// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
+interface DECLSPEC_UUID("EB62D63D-93DD-4318-8AE8-C6F83AD371B8") ID3D11ShaderReflectionConstantBuffer;
+DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
+0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
+
+#undef INTERFACE
+#define INTERFACE ID3D11ShaderReflectionConstantBuffer
+
+DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
+{
+ STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+};
+
+// The ID3D11ShaderReflection IID may change from SDK version to SDK version
+// if the reflection API changes. This prevents new code with the new API
+// from working with an old binary. Recompiling with the new header
+// will pick up the new IID.
+
+// 8d536ca1-0cca-4956-a837-786963755584
+interface DECLSPEC_UUID("8d536ca1-0cca-4956-a837-786963755584") ID3D11ShaderReflection;
+DEFINE_GUID(IID_ID3D11ShaderReflection,
+0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84);
+
+#undef INTERFACE
+#define INTERFACE ID3D11ShaderReflection
+
+DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
+ _Out_ LPVOID *ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_SHADER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
+ _Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+
+ STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
+ _Out_ D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+
+ STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
+
+ STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
+ STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
+
+ STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
+ STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
+
+ STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
+ _Out_opt_ UINT* pSizeX,
+ _Out_opt_ UINT* pSizeY,
+ _Out_opt_ UINT* pSizeZ) PURE;
+
+ STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
+};
+
+// {54384F1B-5B3E-4BB7-AE01-60BA3097CBB6}
+interface DECLSPEC_UUID("54384F1B-5B3E-4BB7-AE01-60BA3097CBB6") ID3D11LibraryReflection;
+DEFINE_GUID(IID_ID3D11LibraryReflection,
+0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x1, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6);
+
+#undef INTERFACE
+#define INTERFACE ID3D11LibraryReflection
+
+DECLARE_INTERFACE_(ID3D11LibraryReflection, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_LIBRARY_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D11FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
+};
+
+// {207BCECB-D683-4A06-A8A3-9B149B9F73A4}
+interface DECLSPEC_UUID("207BCECB-D683-4A06-A8A3-9B149B9F73A4") ID3D11FunctionReflection;
+DEFINE_GUID(IID_ID3D11FunctionReflection,
+0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4);
+
+#undef INTERFACE
+#define INTERFACE ID3D11FunctionReflection
+
+DECLARE_INTERFACE(ID3D11FunctionReflection)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_FUNCTION_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
+ STDMETHOD_(ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
+ _Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
+ _Out_ D3D11_SHADER_INPUT_BIND_DESC * pDesc) PURE;
+
+ // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
+ STDMETHOD_(ID3D11FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
+};
+
+// {42757488-334F-47FE-982E-1A65D08CC462}
+interface DECLSPEC_UUID("42757488-334F-47FE-982E-1A65D08CC462") ID3D11FunctionParameterReflection;
+DEFINE_GUID(IID_ID3D11FunctionParameterReflection,
+0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62);
+
+#undef INTERFACE
+#define INTERFACE ID3D11FunctionParameterReflection
+
+DECLARE_INTERFACE(ID3D11FunctionParameterReflection)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D11_PARAMETER_DESC * pDesc) PURE;
+};
+
+// {CAC701EE-80FC-4122-8242-10B39C8CEC34}
+interface DECLSPEC_UUID("CAC701EE-80FC-4122-8242-10B39C8CEC34") ID3D11Module;
+DEFINE_GUID(IID_ID3D11Module,
+0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34);
+
+#undef INTERFACE
+#define INTERFACE ID3D11Module
+
+DECLARE_INTERFACE_(ID3D11Module, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ // Create an instance of a module for resource re-binding.
+ STDMETHOD(CreateInstance)(THIS_ _In_opt_ LPCSTR pNamespace,
+ _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance) PURE;
+};
+
+
+// {469E07F7-045A-48D5-AA12-68A478CDF75D}
+interface DECLSPEC_UUID("469E07F7-045A-48D5-AA12-68A478CDF75D") ID3D11ModuleInstance;
+DEFINE_GUID(IID_ID3D11ModuleInstance,
+0x469e07f7, 0x45a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d);
+
+#undef INTERFACE
+#define INTERFACE ID3D11ModuleInstance
+
+DECLARE_INTERFACE_(ID3D11ModuleInstance, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ //
+ // Resource binding API.
+ //
+ STDMETHOD(BindConstantBuffer)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
+ STDMETHOD(BindConstantBufferByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT cbDstOffset) PURE;
+
+ STDMETHOD(BindResource)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+ STDMETHOD(BindResourceByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+
+ STDMETHOD(BindSampler)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+ STDMETHOD(BindSamplerByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+
+ STDMETHOD(BindUnorderedAccessView)(THIS_ _In_ UINT uSrcSlot, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+ STDMETHOD(BindUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pName, _In_ UINT uDstSlot, _In_ UINT uCount) PURE;
+
+ STDMETHOD(BindResourceAsUnorderedAccessView)(THIS_ _In_ UINT uSrcSrvSlot, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
+ STDMETHOD(BindResourceAsUnorderedAccessViewByName)(THIS_ _In_ LPCSTR pSrvName, _In_ UINT uDstUavSlot, _In_ UINT uCount) PURE;
+};
+
+
+// {59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E}
+interface DECLSPEC_UUID("59A6CD0E-E10D-4C1F-88C0-63ABA1DAF30E") ID3D11Linker;
+DEFINE_GUID(IID_ID3D11Linker,
+0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0xe);
+
+#undef INTERFACE
+#define INTERFACE ID3D11Linker
+
+DECLARE_INTERFACE_(ID3D11Linker, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ // Link the shader and produce a shader blob suitable to D3D runtime.
+ STDMETHOD(Link)(THIS_ _In_ interface ID3D11ModuleInstance * pEntry,
+ _In_ LPCSTR pEntryName,
+ _In_ LPCSTR pTargetName,
+ _In_ UINT uFlags,
+ _COM_Outptr_ ID3DBlob ** ppShaderBlob,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
+
+ // Add an instance of a library module to be used for linking.
+ STDMETHOD(UseLibrary)(THIS_ _In_ interface ID3D11ModuleInstance * pLibraryMI) PURE;
+
+ // Add a clip plane with the plane coefficients taken from a cbuffer entry for 10L9 shaders.
+ STDMETHOD(AddClipPlaneFromCBuffer)(THIS_ _In_ UINT uCBufferSlot, _In_ UINT uCBufferEntry) PURE;
+};
+
+
+// {D80DD70C-8D2F-4751-94A1-03C79B3556DB}
+interface DECLSPEC_UUID("D80DD70C-8D2F-4751-94A1-03C79B3556DB") ID3D11LinkingNode;
+DEFINE_GUID(IID_ID3D11LinkingNode,
+0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x3, 0xc7, 0x9b, 0x35, 0x56, 0xdb);
+
+#undef INTERFACE
+#define INTERFACE ID3D11LinkingNode
+
+DECLARE_INTERFACE_(ID3D11LinkingNode, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+};
+
+
+// {54133220-1CE8-43D3-8236-9855C5CEECFF}
+interface DECLSPEC_UUID("54133220-1CE8-43D3-8236-9855C5CEECFF") ID3D11FunctionLinkingGraph;
+DEFINE_GUID(IID_ID3D11FunctionLinkingGraph,
+0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff);
+
+#undef INTERFACE
+#define INTERFACE ID3D11FunctionLinkingGraph
+
+DECLARE_INTERFACE_(ID3D11FunctionLinkingGraph, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ // Create a shader module out of FLG description.
+ STDMETHOD(CreateModuleInstance)(THIS_ _COM_Outptr_ interface ID3D11ModuleInstance ** ppModuleInstance,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
+
+ STDMETHOD(SetInputSignature)(THIS_ __in_ecount(cInputParameters) const D3D11_PARAMETER_DESC * pInputParameters,
+ _In_ UINT cInputParameters,
+ _COM_Outptr_ interface ID3D11LinkingNode ** ppInputNode) PURE;
+
+ STDMETHOD(SetOutputSignature)(THIS_ __in_ecount(cOutputParameters) const D3D11_PARAMETER_DESC * pOutputParameters,
+ _In_ UINT cOutputParameters,
+ _COM_Outptr_ interface ID3D11LinkingNode ** ppOutputNode) PURE;
+
+ STDMETHOD(CallFunction)(THIS_ _In_opt_ LPCSTR pModuleInstanceNamespace,
+ _In_ interface ID3D11Module * pModuleWithFunctionPrototype,
+ _In_ LPCSTR pFunctionName,
+ _COM_Outptr_ interface ID3D11LinkingNode ** ppCallNode) PURE;
+
+ STDMETHOD(PassValue)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
+ _In_ INT SrcParameterIndex,
+ _In_ interface ID3D11LinkingNode * pDstNode,
+ _In_ INT DstParameterIndex) PURE;
+
+ STDMETHOD(PassValueWithSwizzle)(THIS_ _In_ interface ID3D11LinkingNode * pSrcNode,
+ _In_ INT SrcParameterIndex,
+ _In_ LPCSTR pSrcSwizzle,
+ _In_ interface ID3D11LinkingNode * pDstNode,
+ _In_ INT DstParameterIndex,
+ _In_ LPCSTR pDstSwizzle) PURE;
+
+ STDMETHOD(GetLastError)(THIS_ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob ** ppErrorBuffer) PURE;
+
+ STDMETHOD(GenerateHlsl)(THIS_ _In_ UINT uFlags, // uFlags is reserved for future use.
+ _COM_Outptr_ ID3DBlob ** ppBuffer) PURE;
+};
+
+
+//////////////////////////////////////////////////////////////////////////////
+// APIs //////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif //__cplusplus
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__D3D11SHADER_H__
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h
new file mode 100644
index 00000000000..d06a785a1c4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h
@@ -0,0 +1,570 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d11ShaderTracing_h__
+#define __d3d11ShaderTracing_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D11ShaderTrace_FWD_DEFINED__
+#define __ID3D11ShaderTrace_FWD_DEFINED__
+typedef interface ID3D11ShaderTrace ID3D11ShaderTrace;
+
+#endif /* __ID3D11ShaderTrace_FWD_DEFINED__ */
+
+
+#ifndef __ID3D11ShaderTraceFactory_FWD_DEFINED__
+#define __ID3D11ShaderTraceFactory_FWD_DEFINED__
+typedef interface ID3D11ShaderTraceFactory ID3D11ShaderTraceFactory;
+
+#endif /* __ID3D11ShaderTraceFactory_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d11ShaderTracing_0000_0000 */
+/* [local] */
+
+typedef
+enum D3D11_SHADER_TYPE
+ {
+ D3D11_VERTEX_SHADER = 1,
+ D3D11_HULL_SHADER = 2,
+ D3D11_DOMAIN_SHADER = 3,
+ D3D11_GEOMETRY_SHADER = 4,
+ D3D11_PIXEL_SHADER = 5,
+ D3D11_COMPUTE_SHADER = 6
+ } D3D11_SHADER_TYPE;
+
+#define D3D11_TRACE_COMPONENT_X 0x1
+#define D3D11_TRACE_COMPONENT_Y 0x2
+#define D3D11_TRACE_COMPONENT_Z 0x4
+#define D3D11_TRACE_COMPONENT_W 0x8
+typedef UINT8 D3D11_TRACE_COMPONENT_MASK;
+
+typedef struct D3D11_VERTEX_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ } D3D11_VERTEX_SHADER_TRACE_DESC;
+
+typedef struct D3D11_HULL_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ } D3D11_HULL_SHADER_TRACE_DESC;
+
+typedef struct D3D11_DOMAIN_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ } D3D11_DOMAIN_SHADER_TRACE_DESC;
+
+typedef struct D3D11_GEOMETRY_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ } D3D11_GEOMETRY_SHADER_TRACE_DESC;
+
+typedef struct D3D11_PIXEL_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ INT X;
+ INT Y;
+ UINT64 SampleMask;
+ } D3D11_PIXEL_SHADER_TRACE_DESC;
+
+typedef struct D3D11_COMPUTE_SHADER_TRACE_DESC
+ {
+ UINT64 Invocation;
+ UINT ThreadIDInGroup[ 3 ];
+ UINT ThreadGroupID[ 3 ];
+ } D3D11_COMPUTE_SHADER_TRACE_DESC;
+
+#define D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_WRITES 0x1
+#define D3D11_SHADER_TRACE_FLAG_RECORD_REGISTER_READS 0x2
+typedef struct D3D11_SHADER_TRACE_DESC
+ {
+ D3D11_SHADER_TYPE Type;
+ UINT Flags;
+ union
+ {
+ D3D11_VERTEX_SHADER_TRACE_DESC VertexShaderTraceDesc;
+ D3D11_HULL_SHADER_TRACE_DESC HullShaderTraceDesc;
+ D3D11_DOMAIN_SHADER_TRACE_DESC DomainShaderTraceDesc;
+ D3D11_GEOMETRY_SHADER_TRACE_DESC GeometryShaderTraceDesc;
+ D3D11_PIXEL_SHADER_TRACE_DESC PixelShaderTraceDesc;
+ D3D11_COMPUTE_SHADER_TRACE_DESC ComputeShaderTraceDesc;
+ } ;
+ } D3D11_SHADER_TRACE_DESC;
+
+typedef
+enum D3D11_TRACE_GS_INPUT_PRIMITIVE
+ {
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_UNDEFINED = 0,
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_POINT = 1,
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE = 2,
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE = 3,
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_LINE_ADJ = 6,
+ D3D11_TRACE_GS_INPUT_PRIMITIVE_TRIANGLE_ADJ = 7
+ } D3D11_TRACE_GS_INPUT_PRIMITIVE;
+
+typedef struct D3D11_TRACE_STATS
+ {
+ D3D11_SHADER_TRACE_DESC TraceDesc;
+ UINT8 NumInvocationsInStamp;
+ UINT8 TargetStampIndex;
+ UINT NumTraceSteps;
+ D3D11_TRACE_COMPONENT_MASK InputMask[ 32 ];
+ D3D11_TRACE_COMPONENT_MASK OutputMask[ 32 ];
+ UINT16 NumTemps;
+ UINT16 MaxIndexableTempIndex;
+ UINT16 IndexableTempSize[ 4096 ];
+ UINT16 ImmediateConstantBufferSize;
+ UINT PixelPosition[ 4 ][ 2 ];
+ UINT64 PixelCoverageMask[ 4 ];
+ UINT64 PixelDiscardedMask[ 4 ];
+ UINT64 PixelCoverageMaskAfterShader[ 4 ];
+ UINT64 PixelCoverageMaskAfterA2CSampleMask[ 4 ];
+ UINT64 PixelCoverageMaskAfterA2CSampleMaskDepth[ 4 ];
+ UINT64 PixelCoverageMaskAfterA2CSampleMaskDepthStencil[ 4 ];
+ BOOL PSOutputsDepth;
+ BOOL PSOutputsMask;
+ D3D11_TRACE_GS_INPUT_PRIMITIVE GSInputPrimitive;
+ BOOL GSInputsPrimitiveID;
+ D3D11_TRACE_COMPONENT_MASK HSOutputPatchConstantMask[ 32 ];
+ D3D11_TRACE_COMPONENT_MASK DSInputPatchConstantMask[ 32 ];
+ } D3D11_TRACE_STATS;
+
+typedef struct D3D11_TRACE_VALUE
+ {
+ UINT Bits[ 4 ];
+ D3D11_TRACE_COMPONENT_MASK ValidMask;
+ } D3D11_TRACE_VALUE;
+
+typedef
+enum D3D11_TRACE_REGISTER_TYPE
+ {
+ D3D11_TRACE_OUTPUT_NULL_REGISTER = 0,
+ D3D11_TRACE_INPUT_REGISTER = ( D3D11_TRACE_OUTPUT_NULL_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER = ( D3D11_TRACE_INPUT_REGISTER + 1 ) ,
+ D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER = ( D3D11_TRACE_INPUT_PRIMITIVE_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_TEMP_REGISTER = ( D3D11_TRACE_IMMEDIATE_CONSTANT_BUFFER + 1 ) ,
+ D3D11_TRACE_INDEXABLE_TEMP_REGISTER = ( D3D11_TRACE_TEMP_REGISTER + 1 ) ,
+ D3D11_TRACE_OUTPUT_REGISTER = ( D3D11_TRACE_INDEXABLE_TEMP_REGISTER + 1 ) ,
+ D3D11_TRACE_OUTPUT_DEPTH_REGISTER = ( D3D11_TRACE_OUTPUT_REGISTER + 1 ) ,
+ D3D11_TRACE_CONSTANT_BUFFER = ( D3D11_TRACE_OUTPUT_DEPTH_REGISTER + 1 ) ,
+ D3D11_TRACE_IMMEDIATE32 = ( D3D11_TRACE_CONSTANT_BUFFER + 1 ) ,
+ D3D11_TRACE_SAMPLER = ( D3D11_TRACE_IMMEDIATE32 + 1 ) ,
+ D3D11_TRACE_RESOURCE = ( D3D11_TRACE_SAMPLER + 1 ) ,
+ D3D11_TRACE_RASTERIZER = ( D3D11_TRACE_RESOURCE + 1 ) ,
+ D3D11_TRACE_OUTPUT_COVERAGE_MASK = ( D3D11_TRACE_RASTERIZER + 1 ) ,
+ D3D11_TRACE_STREAM = ( D3D11_TRACE_OUTPUT_COVERAGE_MASK + 1 ) ,
+ D3D11_TRACE_THIS_POINTER = ( D3D11_TRACE_STREAM + 1 ) ,
+ D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER = ( D3D11_TRACE_THIS_POINTER + 1 ) ,
+ D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER = ( D3D11_TRACE_OUTPUT_CONTROL_POINT_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER = ( D3D11_TRACE_INPUT_FORK_INSTANCE_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER = ( D3D11_TRACE_INPUT_JOIN_INSTANCE_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER = ( D3D11_TRACE_INPUT_CONTROL_POINT_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER = ( D3D11_TRACE_OUTPUT_CONTROL_POINT_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER = ( D3D11_TRACE_INPUT_PATCH_CONSTANT_REGISTER + 1 ) ,
+ D3D11_TRACE_UNORDERED_ACCESS_VIEW = ( D3D11_TRACE_INPUT_DOMAIN_POINT_REGISTER + 1 ) ,
+ D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY = ( D3D11_TRACE_UNORDERED_ACCESS_VIEW + 1 ) ,
+ D3D11_TRACE_INPUT_THREAD_ID_REGISTER = ( D3D11_TRACE_THREAD_GROUP_SHARED_MEMORY + 1 ) ,
+ D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER = ( D3D11_TRACE_INPUT_THREAD_GROUP_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER = ( D3D11_TRACE_INPUT_COVERAGE_MASK_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER = ( D3D11_TRACE_INPUT_THREAD_ID_IN_GROUP_FLATTENED_REGISTER + 1 ) ,
+ D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER = ( D3D11_TRACE_INPUT_GS_INSTANCE_ID_REGISTER + 1 ) ,
+ D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER = ( D3D11_TRACE_OUTPUT_DEPTH_GREATER_EQUAL_REGISTER + 1 ) ,
+ D3D11_TRACE_IMMEDIATE64 = ( D3D11_TRACE_OUTPUT_DEPTH_LESS_EQUAL_REGISTER + 1 ) ,
+ D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER = ( D3D11_TRACE_IMMEDIATE64 + 1 ) ,
+ D3D11_TRACE_INTERFACE_POINTER = ( D3D11_TRACE_INPUT_CYCLE_COUNTER_REGISTER + 1 )
+ } D3D11_TRACE_REGISTER_TYPE;
+
+#define D3D11_TRACE_REGISTER_FLAGS_RELATIVE_INDEXING 0x1
+typedef struct D3D11_TRACE_REGISTER
+ {
+ D3D11_TRACE_REGISTER_TYPE RegType;
+ union
+ {
+ UINT16 Index1D;
+ UINT16 Index2D[ 2 ];
+ } ;
+ UINT8 OperandIndex;
+ UINT8 Flags;
+ } D3D11_TRACE_REGISTER;
+
+#define D3D11_TRACE_MISC_GS_EMIT 0x1
+#define D3D11_TRACE_MISC_GS_CUT 0x2
+#define D3D11_TRACE_MISC_PS_DISCARD 0x4
+#define D3D11_TRACE_MISC_GS_EMIT_STREAM 0x8
+#define D3D11_TRACE_MISC_GS_CUT_STREAM 0x10
+#define D3D11_TRACE_MISC_HALT 0x20
+#define D3D11_TRACE_MISC_MESSAGE 0x40
+typedef UINT16 D3D11_TRACE_MISC_OPERATIONS_MASK;
+
+typedef struct D3D11_TRACE_STEP
+ {
+ UINT ID;
+ BOOL InstructionActive;
+ UINT8 NumRegistersWritten;
+ UINT8 NumRegistersRead;
+ D3D11_TRACE_MISC_OPERATIONS_MASK MiscOperations;
+ UINT OpcodeType;
+ UINT64 CurrentGlobalCycle;
+ } D3D11_TRACE_STEP;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D11ShaderTrace_INTERFACE_DEFINED__
+#define __ID3D11ShaderTrace_INTERFACE_DEFINED__
+
+/* interface ID3D11ShaderTrace */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11ShaderTrace;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("36b013e6-2811-4845-baa7-d623fe0df104")
+ ID3D11ShaderTrace : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE TraceReady(
+ /* [annotation] */
+ _Out_opt_ UINT64 *pTestCount) = 0;
+
+ virtual void STDMETHODCALLTYPE ResetTrace( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTraceStats(
+ /* [annotation] */
+ _Out_ D3D11_TRACE_STATS *pTraceStats) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PSSelectStamp(
+ /* [annotation] */
+ _In_ UINT stampIndex) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetInitialRegisterContents(
+ /* [annotation] */
+ _In_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStep(
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_STEP *pTraceStep) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetWrittenRegister(
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _In_ UINT writtenRegisterIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetReadRegister(
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _In_ UINT readRegisterIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11ShaderTraceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11ShaderTrace * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11ShaderTrace * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11ShaderTrace * This);
+
+ HRESULT ( STDMETHODCALLTYPE *TraceReady )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _Out_opt_ UINT64 *pTestCount);
+
+ void ( STDMETHODCALLTYPE *ResetTrace )(
+ ID3D11ShaderTrace * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTraceStats )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_STATS *pTraceStats);
+
+ HRESULT ( STDMETHODCALLTYPE *PSSelectStamp )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _In_ UINT stampIndex);
+
+ HRESULT ( STDMETHODCALLTYPE *GetInitialRegisterContents )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _In_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStep )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_STEP *pTraceStep);
+
+ HRESULT ( STDMETHODCALLTYPE *GetWrittenRegister )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _In_ UINT writtenRegisterIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue);
+
+ HRESULT ( STDMETHODCALLTYPE *GetReadRegister )(
+ ID3D11ShaderTrace * This,
+ /* [annotation] */
+ _In_ UINT stepIndex,
+ /* [annotation] */
+ _In_ UINT readRegisterIndex,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_REGISTER *pRegister,
+ /* [annotation] */
+ _Out_ D3D11_TRACE_VALUE *pValue);
+
+ END_INTERFACE
+ } ID3D11ShaderTraceVtbl;
+
+ interface ID3D11ShaderTrace
+ {
+ CONST_VTBL struct ID3D11ShaderTraceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11ShaderTrace_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11ShaderTrace_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11ShaderTrace_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11ShaderTrace_TraceReady(This,pTestCount) \
+ ( (This)->lpVtbl -> TraceReady(This,pTestCount) )
+
+#define ID3D11ShaderTrace_ResetTrace(This) \
+ ( (This)->lpVtbl -> ResetTrace(This) )
+
+#define ID3D11ShaderTrace_GetTraceStats(This,pTraceStats) \
+ ( (This)->lpVtbl -> GetTraceStats(This,pTraceStats) )
+
+#define ID3D11ShaderTrace_PSSelectStamp(This,stampIndex) \
+ ( (This)->lpVtbl -> PSSelectStamp(This,stampIndex) )
+
+#define ID3D11ShaderTrace_GetInitialRegisterContents(This,pRegister,pValue) \
+ ( (This)->lpVtbl -> GetInitialRegisterContents(This,pRegister,pValue) )
+
+#define ID3D11ShaderTrace_GetStep(This,stepIndex,pTraceStep) \
+ ( (This)->lpVtbl -> GetStep(This,stepIndex,pTraceStep) )
+
+#define ID3D11ShaderTrace_GetWrittenRegister(This,stepIndex,writtenRegisterIndex,pRegister,pValue) \
+ ( (This)->lpVtbl -> GetWrittenRegister(This,stepIndex,writtenRegisterIndex,pRegister,pValue) )
+
+#define ID3D11ShaderTrace_GetReadRegister(This,stepIndex,readRegisterIndex,pRegister,pValue) \
+ ( (This)->lpVtbl -> GetReadRegister(This,stepIndex,readRegisterIndex,pRegister,pValue) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11ShaderTrace_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__
+#define __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__
+
+/* interface ID3D11ShaderTraceFactory */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D11ShaderTraceFactory;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1fbad429-66ab-41cc-9617-667ac10e4459")
+ ID3D11ShaderTraceFactory : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateShaderTrace(
+ /* [annotation] */
+ _In_ IUnknown *pShader,
+ /* [annotation] */
+ _In_ D3D11_SHADER_TRACE_DESC *pTraceDesc,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11ShaderTrace **ppShaderTrace) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D11ShaderTraceFactoryVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D11ShaderTraceFactory * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D11ShaderTraceFactory * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D11ShaderTraceFactory * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderTrace )(
+ ID3D11ShaderTraceFactory * This,
+ /* [annotation] */
+ _In_ IUnknown *pShader,
+ /* [annotation] */
+ _In_ D3D11_SHADER_TRACE_DESC *pTraceDesc,
+ /* [annotation] */
+ _COM_Outptr_ ID3D11ShaderTrace **ppShaderTrace);
+
+ END_INTERFACE
+ } ID3D11ShaderTraceFactoryVtbl;
+
+ interface ID3D11ShaderTraceFactory
+ {
+ CONST_VTBL struct ID3D11ShaderTraceFactoryVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D11ShaderTraceFactory_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D11ShaderTraceFactory_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D11ShaderTraceFactory_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D11ShaderTraceFactory_CreateShaderTrace(This,pShader,pTraceDesc,ppShaderTrace) \
+ ( (This)->lpVtbl -> CreateShaderTrace(This,pShader,pTraceDesc,ppShaderTrace) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D11ShaderTraceFactory_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d11ShaderTracing_0000_0002 */
+/* [local] */
+
+HRESULT WINAPI
+D3DDisassemble11Trace(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ ID3D11ShaderTrace* pTrace,
+ _In_ UINT StartStep,
+ _In_ UINT NumSteps,
+ _In_ UINT Flags,
+ _COM_Outptr_ interface ID3D10Blob** ppDisassembly);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d11ShaderTracing_0000_0002_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h
new file mode 100644
index 00000000000..bf7f76852dd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h
@@ -0,0 +1,6260 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12_h__
+#define __d3d12_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12Object_FWD_DEFINED__
+#define __ID3D12Object_FWD_DEFINED__
+typedef interface ID3D12Object ID3D12Object;
+
+#endif /* __ID3D12Object_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceChild_FWD_DEFINED__
+#define __ID3D12DeviceChild_FWD_DEFINED__
+typedef interface ID3D12DeviceChild ID3D12DeviceChild;
+
+#endif /* __ID3D12DeviceChild_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12RootSignature_FWD_DEFINED__
+#define __ID3D12RootSignature_FWD_DEFINED__
+typedef interface ID3D12RootSignature ID3D12RootSignature;
+
+#endif /* __ID3D12RootSignature_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12RootSignatureDeserializer_FWD_DEFINED__
+#define __ID3D12RootSignatureDeserializer_FWD_DEFINED__
+typedef interface ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer;
+
+#endif /* __ID3D12RootSignatureDeserializer_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Pageable_FWD_DEFINED__
+#define __ID3D12Pageable_FWD_DEFINED__
+typedef interface ID3D12Pageable ID3D12Pageable;
+
+#endif /* __ID3D12Pageable_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Heap_FWD_DEFINED__
+#define __ID3D12Heap_FWD_DEFINED__
+typedef interface ID3D12Heap ID3D12Heap;
+
+#endif /* __ID3D12Heap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Resource_FWD_DEFINED__
+#define __ID3D12Resource_FWD_DEFINED__
+typedef interface ID3D12Resource ID3D12Resource;
+
+#endif /* __ID3D12Resource_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandAllocator_FWD_DEFINED__
+#define __ID3D12CommandAllocator_FWD_DEFINED__
+typedef interface ID3D12CommandAllocator ID3D12CommandAllocator;
+
+#endif /* __ID3D12CommandAllocator_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Fence_FWD_DEFINED__
+#define __ID3D12Fence_FWD_DEFINED__
+typedef interface ID3D12Fence ID3D12Fence;
+
+#endif /* __ID3D12Fence_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12PipelineState_FWD_DEFINED__
+#define __ID3D12PipelineState_FWD_DEFINED__
+typedef interface ID3D12PipelineState ID3D12PipelineState;
+
+#endif /* __ID3D12PipelineState_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__
+#define __ID3D12DescriptorHeap_FWD_DEFINED__
+typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap;
+
+#endif /* __ID3D12DescriptorHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12QueryHeap_FWD_DEFINED__
+#define __ID3D12QueryHeap_FWD_DEFINED__
+typedef interface ID3D12QueryHeap ID3D12QueryHeap;
+
+#endif /* __ID3D12QueryHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandSignature_FWD_DEFINED__
+#define __ID3D12CommandSignature_FWD_DEFINED__
+typedef interface ID3D12CommandSignature ID3D12CommandSignature;
+
+#endif /* __ID3D12CommandSignature_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandList_FWD_DEFINED__
+#define __ID3D12CommandList_FWD_DEFINED__
+typedef interface ID3D12CommandList ID3D12CommandList;
+
+#endif /* __ID3D12CommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList;
+
+#endif /* __ID3D12GraphicsCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12CommandQueue_FWD_DEFINED__
+#define __ID3D12CommandQueue_FWD_DEFINED__
+typedef interface ID3D12CommandQueue ID3D12CommandQueue;
+
+#endif /* __ID3D12CommandQueue_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device_FWD_DEFINED__
+#define __ID3D12Device_FWD_DEFINED__
+typedef interface ID3D12Device ID3D12Device;
+
+#endif /* __ID3D12Device_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgi.h"
+#include "d3dcommon.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12_0000_0000 */
+/* [local] */
+
+#ifndef _D3D12_CONSTANTS
+#define _D3D12_CONSTANTS
+#define D3D12_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff )
+
+#define D3D12_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff )
+
+#define D3D12_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff )
+
+#define D3D12_APPEND_ALIGNED_ELEMENT ( 0xffffffff )
+
+#define D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 )
+
+#define D3D12_CLIP_OR_CULL_DISTANCE_COUNT ( 8 )
+
+#define D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT ( 16 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 )
+
+#define D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 )
+
+#define D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 )
+
+#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 )
+
+#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 )
+
+#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 )
+
+#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 )
+
+#define D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT ( 256 )
+
+#define D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 )
+
+#define D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 )
+
+#define D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 )
+
+#define D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 )
+
+#define D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 )
+
+#define D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 )
+
+#define D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 )
+
+#define D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 )
+
+#define D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 )
+
+#define D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 )
+
+#define D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 )
+
+#define D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 )
+
+#define D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 )
+
+#define D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 )
+
+#define D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 )
+
+#define D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 )
+
+#define D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 )
+
+#define D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 )
+
+#define D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 )
+
+#define D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 )
+
+#define D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 )
+
+#define D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 )
+
+#define D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 )
+
+#define D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 )
+
+#define D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 )
+
+#define D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 )
+
+#define D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 )
+
+#define D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 )
+
+#define D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 )
+
+#define D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 )
+
+#define D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 )
+
+#define D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 )
+
+#define D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 )
+
+#define D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_X ( 768 )
+
+#define D3D12_CS_4_X_THREAD_GROUP_MAX_Y ( 768 )
+
+#define D3D12_CS_4_X_UAV_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 )
+
+#define D3D12_CS_TGSM_REGISTER_COUNT ( 8192 )
+
+#define D3D12_CS_TGSM_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADGROUPID_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADIDINGROUP_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREADID_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_CS_THREADID_REGISTER_COUNT ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_X ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_Y ( 1024 )
+
+#define D3D12_CS_THREAD_GROUP_MAX_Z ( 64 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_X ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_Y ( 1 )
+
+#define D3D12_CS_THREAD_GROUP_MIN_Z ( 1 )
+
+#define D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 )
+
+#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f )
+#define D3D12_DEFAULT_BLEND_FACTOR_RED ( 1.0f )
+#define D3D12_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f )
+#define D3D12_DEFAULT_DEPTH_BIAS ( 0 )
+
+#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f )
+#define D3D12_DEFAULT_MAX_ANISOTROPY ( 16 )
+
+#define D3D12_DEFAULT_MIP_LOD_BIAS ( 0.0f )
+#define D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 4194304 )
+
+#define D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 )
+
+#define D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 )
+
+#define D3D12_DEFAULT_SAMPLE_MASK ( 0xffffffff )
+
+#define D3D12_DEFAULT_SCISSOR_ENDX ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_ENDY ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_STARTX ( 0 )
+
+#define D3D12_DEFAULT_SCISSOR_STARTY ( 0 )
+
+#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f )
+#define D3D12_DEFAULT_STENCIL_READ_MASK ( 0xff )
+
+#define D3D12_DEFAULT_STENCIL_REFERENCE ( 0 )
+
+#define D3D12_DEFAULT_STENCIL_WRITE_MASK ( 0xff )
+
+#define D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_HEIGHT ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f )
+#define D3D12_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f )
+#define D3D12_DEFAULT_VIEWPORT_TOPLEFTX ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_TOPLEFTY ( 0 )
+
+#define D3D12_DEFAULT_VIEWPORT_WIDTH ( 0 )
+
+#define D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND ( 0xffffffff )
+
+#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END ( 0xfffffff7 )
+
+#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 )
+
+#define D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_DS_OUTPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 )
+#define D3D12_FLOAT32_MAX ( 3.402823466e+38f )
+#define D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f )
+#define D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f )
+#define D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f )
+#define D3D12_FLOAT_TO_SRGB_OFFSET ( 0.055f )
+#define D3D12_FLOAT_TO_SRGB_SCALE_1 ( 12.92f )
+#define D3D12_FLOAT_TO_SRGB_SCALE_2 ( 1.055f )
+#define D3D12_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f )
+#define D3D12_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f )
+#define D3D12_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f )
+#define D3D12_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f )
+#define D3D12_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f )
+#define D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_GS_INPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_GS_INPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_GS_INPUT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_GS_INPUT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_GS_INPUT_REGISTER_VERTICES ( 32 )
+
+#define D3D12_GS_MAX_INSTANCE_COUNT ( 32 )
+
+#define D3D12_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES ( 1024 )
+
+#define D3D12_GS_OUTPUT_ELEMENTS ( 32 )
+
+#define D3D12_GS_OUTPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_GS_OUTPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_CONTROL_POINT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff )
+
+#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff )
+
+#define D3D12_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f )
+#define D3D12_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f )
+#define D3D12_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 )
+
+#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT ( 1 )
+
+#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS ( 128 )
+
+#define D3D12_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 )
+
+#define D3D12_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 )
+
+#define D3D12_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 )
+
+#define D3D12_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 )
+
+#define D3D12_IA_INSTANCE_ID_BIT_COUNT ( 32 )
+
+#define D3D12_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 )
+
+#define D3D12_IA_PATCH_MAX_CONTROL_POINT_COUNT ( 32 )
+
+#define D3D12_IA_PRIMITIVE_ID_BIT_COUNT ( 32 )
+
+#define D3D12_IA_VERTEX_ID_BIT_COUNT ( 32 )
+
+#define D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 )
+
+#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 )
+
+#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 )
+
+#define D3D12_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff )
+
+#define D3D12_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff )
+
+#define D3D12_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL ( 0xffffffff )
+
+#define D3D12_KEEP_UNORDERED_ACCESS_VIEWS ( 0xffffffff )
+
+#define D3D12_LINEAR_GAMMA ( 1.0f )
+#define D3D12_MAJOR_VERSION ( 12 )
+
+#define D3D12_MAX_BORDER_COLOR_COMPONENT ( 1.0f )
+#define D3D12_MAX_DEPTH ( 1.0f )
+#define D3D12_MAX_LIVE_STATIC_SAMPLERS ( 2032 )
+
+#define D3D12_MAX_MAXANISOTROPY ( 16 )
+
+#define D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 )
+
+#define D3D12_MAX_POSITION_VALUE ( 3.402823466e+34f )
+#define D3D12_MAX_ROOT_COST ( 64 )
+
+#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1 ( 1000000 )
+
+#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2 ( 1000000 )
+
+#define D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE ( 2048 )
+
+#define D3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 )
+
+#define D3D12_MINOR_VERSION ( 0 )
+
+#define D3D12_MIN_BORDER_COLOR_COMPONENT ( 0.0f )
+#define D3D12_MIN_DEPTH ( 0.0f )
+#define D3D12_MIN_MAXANISOTROPY ( 0 )
+
+#define D3D12_MIP_LOD_BIAS_MAX ( 15.99f )
+#define D3D12_MIP_LOD_BIAS_MIN ( -16.0f )
+#define D3D12_MIP_LOD_FRACTIONAL_BIT_COUNT ( 8 )
+
+#define D3D12_MIP_LOD_RANGE_BIT_COUNT ( 8 )
+
+#define D3D12_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f )
+#define D3D12_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 )
+
+#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff )
+
+#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff8 )
+
+#define D3D12_PACKED_TILE ( 0xffffffff )
+
+#define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 )
+
+#define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 )
+
+#define D3D12_PS_CS_UAV_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_PS_CS_UAV_REGISTER_COUNT ( 8 )
+
+#define D3D12_PS_CS_UAV_REGISTER_READS_PER_INST ( 1 )
+
+#define D3D12_PS_CS_UAV_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff )
+
+#define D3D12_PS_FRONTFACING_FALSE_VALUE ( 0 )
+
+#define D3D12_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff )
+
+#define D3D12_PS_INPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_PS_INPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_PS_INPUT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_PS_INPUT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f )
+#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 )
+
+#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 )
+
+#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 )
+
+#define D3D12_PS_OUTPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_PS_OUTPUT_REGISTER_COUNT ( 8 )
+
+#define D3D12_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f )
+#define D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT ( 16 )
+
+#define D3D12_REQ_BLEND_OBJECT_COUNT_PER_DEVICE ( 4096 )
+
+#define D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 )
+
+#define D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 )
+
+#define D3D12_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE ( 4096 )
+
+#define D3D12_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 )
+
+#define D3D12_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 )
+
+#define D3D12_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 16384 )
+
+#define D3D12_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 )
+
+#define D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 )
+
+#define D3D12_REQ_MAXANISOTROPY ( 16 )
+
+#define D3D12_REQ_MIP_LEVELS ( 15 )
+
+#define D3D12_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 )
+
+#define D3D12_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE ( 4096 )
+
+#define D3D12_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 16384 )
+
+#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 )
+
+#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f )
+#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM ( 2048 )
+
+#define D3D12_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 )
+
+#define D3D12_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 )
+
+#define D3D12_REQ_SUBRESOURCES ( 30720 )
+
+#define D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 2048 )
+
+#define D3D12_REQ_TEXTURE1D_U_DIMENSION ( 16384 )
+
+#define D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 2048 )
+
+#define D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 16384 )
+
+#define D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 )
+
+#define D3D12_REQ_TEXTURECUBE_DIMENSION ( 16384 )
+
+#define D3D12_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 )
+
+#define D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES ( 0xffffffff )
+
+#define D3D12_SHADER_MAJOR_VERSION ( 5 )
+
+#define D3D12_SHADER_MAX_INSTANCES ( 65535 )
+
+#define D3D12_SHADER_MAX_INTERFACES ( 253 )
+
+#define D3D12_SHADER_MAX_INTERFACE_CALL_SITES ( 4096 )
+
+#define D3D12_SHADER_MAX_TYPES ( 65535 )
+
+#define D3D12_SHADER_MINOR_VERSION ( 1 )
+
+#define D3D12_SHIFT_INSTRUCTION_PAD_VALUE ( 0 )
+
+#define D3D12_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 )
+
+#define D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 )
+
+#define D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 )
+
+#define D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT ( 4096 )
+
+#define D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 )
+
+#define D3D12_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 512 )
+
+#define D3D12_SO_BUFFER_SLOT_COUNT ( 4 )
+
+#define D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff )
+
+#define D3D12_SO_NO_RASTERIZED_STREAM ( 0xffffffff )
+
+#define D3D12_SO_OUTPUT_COMPONENT_COUNT ( 128 )
+
+#define D3D12_SO_STREAM_COUNT ( 4 )
+
+#define D3D12_SPEC_DATE_DAY ( 14 )
+
+#define D3D12_SPEC_DATE_MONTH ( 11 )
+
+#define D3D12_SPEC_DATE_YEAR ( 2014 )
+
+#define D3D12_SPEC_VERSION ( 1.16 )
+#define D3D12_SRGB_GAMMA ( 2.2f )
+#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f )
+#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f )
+#define D3D12_SRGB_TO_FLOAT_EXPONENT ( 2.4f )
+#define D3D12_SRGB_TO_FLOAT_OFFSET ( 0.055f )
+#define D3D12_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f )
+#define D3D12_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f )
+#define D3D12_STANDARD_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 )
+
+#define D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 )
+
+#define D3D12_STANDARD_PIXEL_COMPONENT_COUNT ( 128 )
+
+#define D3D12_STANDARD_PIXEL_ELEMENT_COUNT ( 32 )
+
+#define D3D12_STANDARD_VECTOR_SIZE ( 4 )
+
+#define D3D12_STANDARD_VERTEX_ELEMENT_COUNT ( 32 )
+
+#define D3D12_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 )
+
+#define D3D12_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 )
+
+#define D3D12_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 8 )
+
+#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff )
+
+#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 )
+
+#define D3D12_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR ( 64 )
+
+#define D3D12_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 64 )
+
+#define D3D12_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR ( 63 )
+
+#define D3D12_TESSELLATOR_MAX_TESSELLATION_FACTOR ( 64 )
+
+#define D3D12_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR ( 2 )
+
+#define D3D12_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 1 )
+
+#define D3D12_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR ( 1 )
+
+#define D3D12_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 16 )
+
+#define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT ( 256 )
+
+#define D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT ( 512 )
+
+#define D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES ( 65536 )
+
+#define D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT ( 4096 )
+
+#define D3D12_UAV_SLOT_COUNT ( 64 )
+
+#define D3D12_UNBOUND_MEMORY_ACCESS_RESULT ( 0 )
+
+#define D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 )
+
+#define D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 )
+
+#define D3D12_VIEWPORT_BOUNDS_MAX ( 32767 )
+
+#define D3D12_VIEWPORT_BOUNDS_MIN ( -32768 )
+
+#define D3D12_VS_INPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_VS_INPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_VS_INPUT_REGISTER_READS_PER_INST ( 2 )
+
+#define D3D12_VS_INPUT_REGISTER_READ_PORTS ( 1 )
+
+#define D3D12_VS_OUTPUT_REGISTER_COMPONENTS ( 4 )
+
+#define D3D12_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 )
+
+#define D3D12_VS_OUTPUT_REGISTER_COUNT ( 32 )
+
+#define D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 )
+
+#define D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 )
+
+#define D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 )
+
+#endif
+
+typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS;
+
+typedef
+enum D3D12_COMMAND_LIST_TYPE
+ {
+ D3D12_COMMAND_LIST_TYPE_DIRECT = 0,
+ D3D12_COMMAND_LIST_TYPE_BUNDLE = 1,
+ D3D12_COMMAND_LIST_TYPE_COMPUTE = 2,
+ D3D12_COMMAND_LIST_TYPE_COPY = 3
+ } D3D12_COMMAND_LIST_TYPE;
+
+typedef
+enum D3D12_COMMAND_QUEUE_FLAGS
+ {
+ D3D12_COMMAND_QUEUE_FLAG_NONE = 0,
+ D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1
+ } D3D12_COMMAND_QUEUE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS );
+typedef
+enum D3D12_COMMAND_QUEUE_PRIORITY
+ {
+ D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0,
+ D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100
+ } D3D12_COMMAND_QUEUE_PRIORITY;
+
+typedef struct D3D12_COMMAND_QUEUE_DESC
+ {
+ D3D12_COMMAND_LIST_TYPE Type;
+ INT Priority;
+ D3D12_COMMAND_QUEUE_FLAGS Flags;
+ UINT NodeMask;
+ } D3D12_COMMAND_QUEUE_DESC;
+
+typedef
+enum D3D12_PRIMITIVE_TOPOLOGY_TYPE
+ {
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0,
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1,
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2,
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3,
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4
+ } D3D12_PRIMITIVE_TOPOLOGY_TYPE;
+
+typedef
+enum D3D12_INPUT_CLASSIFICATION
+ {
+ D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0,
+ D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1
+ } D3D12_INPUT_CLASSIFICATION;
+
+typedef struct D3D12_INPUT_ELEMENT_DESC
+ {
+ LPCSTR SemanticName;
+ UINT SemanticIndex;
+ DXGI_FORMAT Format;
+ UINT InputSlot;
+ UINT AlignedByteOffset;
+ D3D12_INPUT_CLASSIFICATION InputSlotClass;
+ UINT InstanceDataStepRate;
+ } D3D12_INPUT_ELEMENT_DESC;
+
+typedef
+enum D3D12_FILL_MODE
+ {
+ D3D12_FILL_MODE_WIREFRAME = 2,
+ D3D12_FILL_MODE_SOLID = 3
+ } D3D12_FILL_MODE;
+
+typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY;
+
+typedef D3D_PRIMITIVE D3D12_PRIMITIVE;
+
+typedef
+enum D3D12_CULL_MODE
+ {
+ D3D12_CULL_MODE_NONE = 1,
+ D3D12_CULL_MODE_FRONT = 2,
+ D3D12_CULL_MODE_BACK = 3
+ } D3D12_CULL_MODE;
+
+typedef struct D3D12_SO_DECLARATION_ENTRY
+ {
+ UINT Stream;
+ LPCSTR SemanticName;
+ UINT SemanticIndex;
+ BYTE StartComponent;
+ BYTE ComponentCount;
+ BYTE OutputSlot;
+ } D3D12_SO_DECLARATION_ENTRY;
+
+typedef struct D3D12_VIEWPORT
+ {
+ FLOAT TopLeftX;
+ FLOAT TopLeftY;
+ FLOAT Width;
+ FLOAT Height;
+ FLOAT MinDepth;
+ FLOAT MaxDepth;
+ } D3D12_VIEWPORT;
+
+typedef RECT D3D12_RECT;
+
+typedef struct D3D12_BOX
+ {
+ UINT left;
+ UINT top;
+ UINT front;
+ UINT right;
+ UINT bottom;
+ UINT back;
+ } D3D12_BOX;
+
+typedef
+enum D3D12_COMPARISON_FUNC
+ {
+ D3D12_COMPARISON_FUNC_NEVER = 1,
+ D3D12_COMPARISON_FUNC_LESS = 2,
+ D3D12_COMPARISON_FUNC_EQUAL = 3,
+ D3D12_COMPARISON_FUNC_LESS_EQUAL = 4,
+ D3D12_COMPARISON_FUNC_GREATER = 5,
+ D3D12_COMPARISON_FUNC_NOT_EQUAL = 6,
+ D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7,
+ D3D12_COMPARISON_FUNC_ALWAYS = 8
+ } D3D12_COMPARISON_FUNC;
+
+typedef
+enum D3D12_DEPTH_WRITE_MASK
+ {
+ D3D12_DEPTH_WRITE_MASK_ZERO = 0,
+ D3D12_DEPTH_WRITE_MASK_ALL = 1
+ } D3D12_DEPTH_WRITE_MASK;
+
+typedef
+enum D3D12_STENCIL_OP
+ {
+ D3D12_STENCIL_OP_KEEP = 1,
+ D3D12_STENCIL_OP_ZERO = 2,
+ D3D12_STENCIL_OP_REPLACE = 3,
+ D3D12_STENCIL_OP_INCR_SAT = 4,
+ D3D12_STENCIL_OP_DECR_SAT = 5,
+ D3D12_STENCIL_OP_INVERT = 6,
+ D3D12_STENCIL_OP_INCR = 7,
+ D3D12_STENCIL_OP_DECR = 8
+ } D3D12_STENCIL_OP;
+
+typedef struct D3D12_DEPTH_STENCILOP_DESC
+ {
+ D3D12_STENCIL_OP StencilFailOp;
+ D3D12_STENCIL_OP StencilDepthFailOp;
+ D3D12_STENCIL_OP StencilPassOp;
+ D3D12_COMPARISON_FUNC StencilFunc;
+ } D3D12_DEPTH_STENCILOP_DESC;
+
+typedef struct D3D12_DEPTH_STENCIL_DESC
+ {
+ BOOL DepthEnable;
+ D3D12_DEPTH_WRITE_MASK DepthWriteMask;
+ D3D12_COMPARISON_FUNC DepthFunc;
+ BOOL StencilEnable;
+ UINT8 StencilReadMask;
+ UINT8 StencilWriteMask;
+ D3D12_DEPTH_STENCILOP_DESC FrontFace;
+ D3D12_DEPTH_STENCILOP_DESC BackFace;
+ } D3D12_DEPTH_STENCIL_DESC;
+
+typedef
+enum D3D12_BLEND
+ {
+ D3D12_BLEND_ZERO = 1,
+ D3D12_BLEND_ONE = 2,
+ D3D12_BLEND_SRC_COLOR = 3,
+ D3D12_BLEND_INV_SRC_COLOR = 4,
+ D3D12_BLEND_SRC_ALPHA = 5,
+ D3D12_BLEND_INV_SRC_ALPHA = 6,
+ D3D12_BLEND_DEST_ALPHA = 7,
+ D3D12_BLEND_INV_DEST_ALPHA = 8,
+ D3D12_BLEND_DEST_COLOR = 9,
+ D3D12_BLEND_INV_DEST_COLOR = 10,
+ D3D12_BLEND_SRC_ALPHA_SAT = 11,
+ D3D12_BLEND_BLEND_FACTOR = 14,
+ D3D12_BLEND_INV_BLEND_FACTOR = 15,
+ D3D12_BLEND_SRC1_COLOR = 16,
+ D3D12_BLEND_INV_SRC1_COLOR = 17,
+ D3D12_BLEND_SRC1_ALPHA = 18,
+ D3D12_BLEND_INV_SRC1_ALPHA = 19
+ } D3D12_BLEND;
+
+typedef
+enum D3D12_BLEND_OP
+ {
+ D3D12_BLEND_OP_ADD = 1,
+ D3D12_BLEND_OP_SUBTRACT = 2,
+ D3D12_BLEND_OP_REV_SUBTRACT = 3,
+ D3D12_BLEND_OP_MIN = 4,
+ D3D12_BLEND_OP_MAX = 5
+ } D3D12_BLEND_OP;
+
+typedef
+enum D3D12_COLOR_WRITE_ENABLE
+ {
+ D3D12_COLOR_WRITE_ENABLE_RED = 1,
+ D3D12_COLOR_WRITE_ENABLE_GREEN = 2,
+ D3D12_COLOR_WRITE_ENABLE_BLUE = 4,
+ D3D12_COLOR_WRITE_ENABLE_ALPHA = 8,
+ D3D12_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN ) | D3D12_COLOR_WRITE_ENABLE_BLUE ) | D3D12_COLOR_WRITE_ENABLE_ALPHA )
+ } D3D12_COLOR_WRITE_ENABLE;
+
+typedef
+enum D3D12_LOGIC_OP
+ {
+ D3D12_LOGIC_OP_CLEAR = 0,
+ D3D12_LOGIC_OP_SET = ( D3D12_LOGIC_OP_CLEAR + 1 ) ,
+ D3D12_LOGIC_OP_COPY = ( D3D12_LOGIC_OP_SET + 1 ) ,
+ D3D12_LOGIC_OP_COPY_INVERTED = ( D3D12_LOGIC_OP_COPY + 1 ) ,
+ D3D12_LOGIC_OP_NOOP = ( D3D12_LOGIC_OP_COPY_INVERTED + 1 ) ,
+ D3D12_LOGIC_OP_INVERT = ( D3D12_LOGIC_OP_NOOP + 1 ) ,
+ D3D12_LOGIC_OP_AND = ( D3D12_LOGIC_OP_INVERT + 1 ) ,
+ D3D12_LOGIC_OP_NAND = ( D3D12_LOGIC_OP_AND + 1 ) ,
+ D3D12_LOGIC_OP_OR = ( D3D12_LOGIC_OP_NAND + 1 ) ,
+ D3D12_LOGIC_OP_NOR = ( D3D12_LOGIC_OP_OR + 1 ) ,
+ D3D12_LOGIC_OP_XOR = ( D3D12_LOGIC_OP_NOR + 1 ) ,
+ D3D12_LOGIC_OP_EQUIV = ( D3D12_LOGIC_OP_XOR + 1 ) ,
+ D3D12_LOGIC_OP_AND_REVERSE = ( D3D12_LOGIC_OP_EQUIV + 1 ) ,
+ D3D12_LOGIC_OP_AND_INVERTED = ( D3D12_LOGIC_OP_AND_REVERSE + 1 ) ,
+ D3D12_LOGIC_OP_OR_REVERSE = ( D3D12_LOGIC_OP_AND_INVERTED + 1 ) ,
+ D3D12_LOGIC_OP_OR_INVERTED = ( D3D12_LOGIC_OP_OR_REVERSE + 1 )
+ } D3D12_LOGIC_OP;
+
+typedef struct D3D12_RENDER_TARGET_BLEND_DESC
+ {
+ BOOL BlendEnable;
+ BOOL LogicOpEnable;
+ D3D12_BLEND SrcBlend;
+ D3D12_BLEND DestBlend;
+ D3D12_BLEND_OP BlendOp;
+ D3D12_BLEND SrcBlendAlpha;
+ D3D12_BLEND DestBlendAlpha;
+ D3D12_BLEND_OP BlendOpAlpha;
+ D3D12_LOGIC_OP LogicOp;
+ UINT8 RenderTargetWriteMask;
+ } D3D12_RENDER_TARGET_BLEND_DESC;
+
+typedef struct D3D12_BLEND_DESC
+ {
+ BOOL AlphaToCoverageEnable;
+ BOOL IndependentBlendEnable;
+ D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[ 8 ];
+ } D3D12_BLEND_DESC;
+
+/* Note, the array size for RenderTarget[] above is D3D12_SIMULTANEOUS_RENDERTARGET_COUNT.
+ IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */
+typedef
+enum D3D12_CONSERVATIVE_RASTERIZATION_MODE
+ {
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0,
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1
+ } D3D12_CONSERVATIVE_RASTERIZATION_MODE;
+
+typedef struct D3D12_RASTERIZER_DESC
+ {
+ D3D12_FILL_MODE FillMode;
+ D3D12_CULL_MODE CullMode;
+ BOOL FrontCounterClockwise;
+ INT DepthBias;
+ FLOAT DepthBiasClamp;
+ FLOAT SlopeScaledDepthBias;
+ BOOL DepthClipEnable;
+ BOOL MultisampleEnable;
+ BOOL AntialiasedLineEnable;
+ UINT ForcedSampleCount;
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
+ } D3D12_RASTERIZER_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D12Object_INTERFACE_DEFINED__
+#define __ID3D12Object_INTERFACE_DEFINED__
+
+/* interface ID3D12Object */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Object;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("c4fec28f-7966-4e95-9f94-f431cb56c3b8")
+ ID3D12Object : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetName(
+ _In_z_ LPCWSTR Name) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12ObjectVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Object * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Object * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Object * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Object * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Object * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Object * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Object * This,
+ _In_z_ LPCWSTR Name);
+
+ END_INTERFACE
+ } ID3D12ObjectVtbl;
+
+ interface ID3D12Object
+ {
+ CONST_VTBL struct ID3D12ObjectVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Object_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Object_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Object_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Object_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Object_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Object_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Object_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Object_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceChild_INTERFACE_DEFINED__
+#define __ID3D12DeviceChild_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceChild */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceChild;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("905db94b-a00c-4140-9df5-2b64ca9ea357")
+ ID3D12DeviceChild : public ID3D12Object
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetDevice(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceChildVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceChild * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceChild * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceChild * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12DeviceChild * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12DeviceChild * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12DeviceChild * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12DeviceChild * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12DeviceChild * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12DeviceChildVtbl;
+
+ interface ID3D12DeviceChild
+ {
+ CONST_VTBL struct ID3D12DeviceChildVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceChild_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceChild_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceChild_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12DeviceChild_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12DeviceChild_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12DeviceChild_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12DeviceChild_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceChild_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12RootSignature_INTERFACE_DEFINED__
+#define __ID3D12RootSignature_INTERFACE_DEFINED__
+
+/* interface ID3D12RootSignature */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12RootSignature;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("c54a6b66-72df-4ee8-8be5-a946a1429214")
+ ID3D12RootSignature : public ID3D12DeviceChild
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12RootSignatureVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12RootSignature * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12RootSignature * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12RootSignature * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12RootSignature * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12RootSignature * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12RootSignature * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12RootSignature * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12RootSignature * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12RootSignatureVtbl;
+
+ interface ID3D12RootSignature
+ {
+ CONST_VTBL struct ID3D12RootSignatureVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12RootSignature_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12RootSignature_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12RootSignature_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12RootSignature_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12RootSignature_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12RootSignature_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12RootSignature_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12RootSignature_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12RootSignature_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0001 */
+/* [local] */
+
+typedef struct D3D12_SHADER_BYTECODE
+ {
+ _Field_size_bytes_full_(BytecodeLength) const void *pShaderBytecode;
+ SIZE_T BytecodeLength;
+ } D3D12_SHADER_BYTECODE;
+
+typedef struct D3D12_STREAM_OUTPUT_DESC
+ {
+ _Field_size_full_(NumEntries) const D3D12_SO_DECLARATION_ENTRY *pSODeclaration;
+ UINT NumEntries;
+ _Field_size_full_(NumStrides) const UINT *pBufferStrides;
+ UINT NumStrides;
+ UINT RasterizedStream;
+ } D3D12_STREAM_OUTPUT_DESC;
+
+typedef struct D3D12_INPUT_LAYOUT_DESC
+ {
+ _Field_size_full_(NumElements) const D3D12_INPUT_ELEMENT_DESC *pInputElementDescs;
+ UINT NumElements;
+ } D3D12_INPUT_LAYOUT_DESC;
+
+typedef
+enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE
+ {
+ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0,
+ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1,
+ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2
+ } D3D12_INDEX_BUFFER_STRIP_CUT_VALUE;
+
+typedef struct D3D12_CACHED_PIPELINE_STATE
+ {
+ _Field_size_bytes_full_(CachedBlobSizeInBytes) const void *pCachedBlob;
+ SIZE_T CachedBlobSizeInBytes;
+ } D3D12_CACHED_PIPELINE_STATE;
+
+typedef
+enum D3D12_PIPELINE_STATE_FLAGS
+ {
+ D3D12_PIPELINE_STATE_FLAG_NONE = 0,
+ D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1
+ } D3D12_PIPELINE_STATE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS );
+typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ {
+ ID3D12RootSignature *pRootSignature;
+ D3D12_SHADER_BYTECODE VS;
+ D3D12_SHADER_BYTECODE PS;
+ D3D12_SHADER_BYTECODE DS;
+ D3D12_SHADER_BYTECODE HS;
+ D3D12_SHADER_BYTECODE GS;
+ D3D12_STREAM_OUTPUT_DESC StreamOutput;
+ D3D12_BLEND_DESC BlendState;
+ UINT SampleMask;
+ D3D12_RASTERIZER_DESC RasterizerState;
+ D3D12_DEPTH_STENCIL_DESC DepthStencilState;
+ D3D12_INPUT_LAYOUT_DESC InputLayout;
+ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
+ UINT NumRenderTargets;
+ DXGI_FORMAT RTVFormats[ 8 ];
+ DXGI_FORMAT DSVFormat;
+ DXGI_SAMPLE_DESC SampleDesc;
+ UINT NodeMask;
+ D3D12_CACHED_PIPELINE_STATE CachedPSO;
+ D3D12_PIPELINE_STATE_FLAGS Flags;
+ } D3D12_GRAPHICS_PIPELINE_STATE_DESC;
+
+typedef struct D3D12_COMPUTE_PIPELINE_STATE_DESC
+ {
+ ID3D12RootSignature *pRootSignature;
+ D3D12_SHADER_BYTECODE CS;
+ UINT NodeMask;
+ D3D12_CACHED_PIPELINE_STATE CachedPSO;
+ D3D12_PIPELINE_STATE_FLAGS Flags;
+ } D3D12_COMPUTE_PIPELINE_STATE_DESC;
+
+typedef
+enum D3D12_FEATURE
+ {
+ D3D12_FEATURE_D3D12_OPTIONS = 0,
+ D3D12_FEATURE_ARCHITECTURE = ( D3D12_FEATURE_D3D12_OPTIONS + 1 ) ,
+ D3D12_FEATURE_FEATURE_LEVELS = ( D3D12_FEATURE_ARCHITECTURE + 1 ) ,
+ D3D12_FEATURE_FORMAT_SUPPORT = ( D3D12_FEATURE_FEATURE_LEVELS + 1 ) ,
+ D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = ( D3D12_FEATURE_FORMAT_SUPPORT + 1 ) ,
+ D3D12_FEATURE_FORMAT_INFO = ( D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS + 1 ) ,
+ D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = ( D3D12_FEATURE_FORMAT_INFO + 1 )
+ } D3D12_FEATURE;
+
+typedef
+enum D3D12_SHADER_MIN_PRECISION_SUPPORT
+ {
+ D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0,
+ D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1,
+ D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2
+ } D3D12_SHADER_MIN_PRECISION_SUPPORT;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT );
+typedef
+enum D3D12_TILED_RESOURCES_TIER
+ {
+ D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0,
+ D3D12_TILED_RESOURCES_TIER_1 = 1,
+ D3D12_TILED_RESOURCES_TIER_2 = 2,
+ D3D12_TILED_RESOURCES_TIER_3 = 3
+ } D3D12_TILED_RESOURCES_TIER;
+
+typedef
+enum D3D12_RESOURCE_BINDING_TIER
+ {
+ D3D12_RESOURCE_BINDING_TIER_1 = 1,
+ D3D12_RESOURCE_BINDING_TIER_2 = 2,
+ D3D12_RESOURCE_BINDING_TIER_3 = 3
+ } D3D12_RESOURCE_BINDING_TIER;
+
+typedef
+enum D3D12_CONSERVATIVE_RASTERIZATION_TIER
+ {
+ D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0,
+ D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1,
+ D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2,
+ D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3
+ } D3D12_CONSERVATIVE_RASTERIZATION_TIER;
+
+typedef
+enum D3D12_FORMAT_SUPPORT1
+ {
+ D3D12_FORMAT_SUPPORT1_NONE = 0,
+ D3D12_FORMAT_SUPPORT1_BUFFER = 0x1,
+ D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x2,
+ D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x4,
+ D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x8,
+ D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x10,
+ D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x20,
+ D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x40,
+ D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x80,
+ D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x100,
+ D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x200,
+ D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x400,
+ D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x800,
+ D3D12_FORMAT_SUPPORT1_MIP = 0x1000,
+ D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x4000,
+ D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x8000,
+ D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x10000,
+ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x40000,
+ D3D12_FORMAT_SUPPORT1_DISPLAY = 0x80000,
+ D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x100000,
+ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x200000,
+ D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x400000,
+ D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x800000,
+ D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x1000000,
+ D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000,
+ D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x4000000,
+ D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x8000000,
+ D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000,
+ D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000,
+ D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000
+ } D3D12_FORMAT_SUPPORT1;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 );
+typedef
+enum D3D12_FORMAT_SUPPORT2
+ {
+ D3D12_FORMAT_SUPPORT2_NONE = 0,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10,
+ D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20,
+ D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40,
+ D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80,
+ D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100,
+ D3D12_FORMAT_SUPPORT2_TILED = 0x200,
+ D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
+ } D3D12_FORMAT_SUPPORT2;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 );
+typedef
+enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS
+ {
+ D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0,
+ D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x1
+ } D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS );
+typedef
+enum D3D12_CROSS_NODE_SHARING_TIER
+ {
+ D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED = 0,
+ D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED = 1,
+ D3D12_CROSS_NODE_SHARING_TIER_1 = 2,
+ D3D12_CROSS_NODE_SHARING_TIER_2 = 3
+ } D3D12_CROSS_NODE_SHARING_TIER;
+
+typedef
+enum D3D12_RESOURCE_HEAP_TIER
+ {
+ D3D12_RESOURCE_HEAP_TIER_1 = 1,
+ D3D12_RESOURCE_HEAP_TIER_2 = 2
+ } D3D12_RESOURCE_HEAP_TIER;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS
+ {
+ _Out_ BOOL DoublePrecisionFloatShaderOps;
+ _Out_ BOOL OutputMergerLogicOp;
+ _Out_ D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport;
+ _Out_ D3D12_TILED_RESOURCES_TIER TiledResourcesTier;
+ _Out_ D3D12_RESOURCE_BINDING_TIER ResourceBindingTier;
+ _Out_ BOOL PSSpecifiedStencilRefSupported;
+ _Out_ BOOL TypedUAVLoadAdditionalFormats;
+ _Out_ BOOL ROVsSupported;
+ _Out_ D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier;
+ _Out_ UINT MaxGPUVirtualAddressBitsPerResource;
+ _Out_ BOOL StandardSwizzle64KBSupported;
+ _Out_ D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier;
+ _Out_ BOOL CrossAdapterRowMajorTextureSupported;
+ _Out_ BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
+ _Out_ D3D12_RESOURCE_HEAP_TIER ResourceHeapTier;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS;
+
+typedef struct D3D12_FEATURE_DATA_ARCHITECTURE
+ {
+ _In_ UINT NodeIndex;
+ _Out_ BOOL TileBasedRenderer;
+ _Out_ BOOL UMA;
+ _Out_ BOOL CacheCoherentUMA;
+ } D3D12_FEATURE_DATA_ARCHITECTURE;
+
+typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS
+ {
+ _In_ UINT NumFeatureLevels;
+ _In_reads_(NumFeatureLevels) const D3D_FEATURE_LEVEL *pFeatureLevelsRequested;
+ _Out_ D3D_FEATURE_LEVEL MaxSupportedFeatureLevel;
+ } D3D12_FEATURE_DATA_FEATURE_LEVELS;
+
+typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT
+ {
+ _In_ DXGI_FORMAT Format;
+ _Out_ D3D12_FORMAT_SUPPORT1 Support1;
+ _Out_ D3D12_FORMAT_SUPPORT2 Support2;
+ } D3D12_FEATURE_DATA_FORMAT_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS
+ {
+ _In_ DXGI_FORMAT Format;
+ _In_ UINT SampleCount;
+ _In_ D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags;
+ _Out_ UINT NumQualityLevels;
+ } D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS;
+
+typedef struct D3D12_FEATURE_DATA_FORMAT_INFO
+ {
+ DXGI_FORMAT Format;
+ UINT8 PlaneCount;
+ } D3D12_FEATURE_DATA_FORMAT_INFO;
+
+typedef struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT
+ {
+ UINT MaxGPUVirtualAddressBitsPerResource;
+ UINT MaxGPUVirtualAddressBitsPerProcess;
+ } D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT;
+
+typedef struct D3D12_RESOURCE_ALLOCATION_INFO
+ {
+ UINT64 SizeInBytes;
+ UINT64 Alignment;
+ } D3D12_RESOURCE_ALLOCATION_INFO;
+
+typedef
+enum D3D12_HEAP_TYPE
+ {
+ D3D12_HEAP_TYPE_DEFAULT = 1,
+ D3D12_HEAP_TYPE_UPLOAD = 2,
+ D3D12_HEAP_TYPE_READBACK = 3,
+ D3D12_HEAP_TYPE_CUSTOM = 4
+ } D3D12_HEAP_TYPE;
+
+typedef
+enum D3D12_CPU_PAGE_PROPERTY
+ {
+ D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0,
+ D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE = 1,
+ D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2,
+ D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3
+ } D3D12_CPU_PAGE_PROPERTY;
+
+typedef
+enum D3D12_MEMORY_POOL
+ {
+ D3D12_MEMORY_POOL_UNKNOWN = 0,
+ D3D12_MEMORY_POOL_L0 = 1,
+ D3D12_MEMORY_POOL_L1 = 2
+ } D3D12_MEMORY_POOL;
+
+typedef struct D3D12_HEAP_PROPERTIES
+ {
+ D3D12_HEAP_TYPE Type;
+ D3D12_CPU_PAGE_PROPERTY CPUPageProperty;
+ D3D12_MEMORY_POOL MemoryPoolPreference;
+ UINT CreationNodeMask;
+ UINT VisibleNodeMask;
+ } D3D12_HEAP_PROPERTIES;
+
+typedef
+enum D3D12_HEAP_FLAGS
+ {
+ D3D12_HEAP_FLAG_NONE = 0,
+ D3D12_HEAP_FLAG_SHARED = 0x1,
+ D3D12_HEAP_FLAG_DENY_BUFFERS = 0x4,
+ D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x8,
+ D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20,
+ D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40,
+ D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80,
+ D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0,
+ D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0,
+ D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44,
+ D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84
+ } D3D12_HEAP_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS );
+typedef struct D3D12_HEAP_DESC
+ {
+ UINT64 SizeInBytes;
+ D3D12_HEAP_PROPERTIES Properties;
+ UINT64 Alignment;
+ D3D12_HEAP_FLAGS Flags;
+ } D3D12_HEAP_DESC;
+
+typedef
+enum D3D12_RESOURCE_DIMENSION
+ {
+ D3D12_RESOURCE_DIMENSION_UNKNOWN = 0,
+ D3D12_RESOURCE_DIMENSION_BUFFER = 1,
+ D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2,
+ D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3,
+ D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4
+ } D3D12_RESOURCE_DIMENSION;
+
+typedef
+enum D3D12_TEXTURE_LAYOUT
+ {
+ D3D12_TEXTURE_LAYOUT_UNKNOWN = 0,
+ D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1,
+ D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2,
+ D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3
+ } D3D12_TEXTURE_LAYOUT;
+
+typedef
+enum D3D12_RESOURCE_FLAGS
+ {
+ D3D12_RESOURCE_FLAG_NONE = 0,
+ D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1,
+ D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2,
+ D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4,
+ D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8,
+ D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10,
+ D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20
+ } D3D12_RESOURCE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS );
+typedef struct D3D12_RESOURCE_DESC
+ {
+ D3D12_RESOURCE_DIMENSION Dimension;
+ UINT64 Alignment;
+ UINT64 Width;
+ UINT Height;
+ UINT16 DepthOrArraySize;
+ UINT16 MipLevels;
+ DXGI_FORMAT Format;
+ DXGI_SAMPLE_DESC SampleDesc;
+ D3D12_TEXTURE_LAYOUT Layout;
+ D3D12_RESOURCE_FLAGS Flags;
+ } D3D12_RESOURCE_DESC;
+
+typedef struct D3D12_DEPTH_STENCIL_VALUE
+ {
+ FLOAT Depth;
+ UINT8 Stencil;
+ } D3D12_DEPTH_STENCIL_VALUE;
+
+typedef struct D3D12_CLEAR_VALUE
+ {
+ DXGI_FORMAT Format;
+ union
+ {
+ FLOAT Color[ 4 ];
+ D3D12_DEPTH_STENCIL_VALUE DepthStencil;
+ } ;
+ } D3D12_CLEAR_VALUE;
+
+typedef struct D3D12_RANGE
+ {
+ SIZE_T Begin;
+ SIZE_T End;
+ } D3D12_RANGE;
+
+typedef struct D3D12_SUBRESOURCE_INFO
+ {
+ UINT64 Offset;
+ UINT RowPitch;
+ UINT DepthPitch;
+ } D3D12_SUBRESOURCE_INFO;
+
+typedef struct D3D12_TILED_RESOURCE_COORDINATE
+ {
+ UINT X;
+ UINT Y;
+ UINT Z;
+ UINT Subresource;
+ } D3D12_TILED_RESOURCE_COORDINATE;
+
+typedef struct D3D12_TILE_REGION_SIZE
+ {
+ UINT NumTiles;
+ BOOL UseBox;
+ UINT Width;
+ UINT16 Height;
+ UINT16 Depth;
+ } D3D12_TILE_REGION_SIZE;
+
+typedef
+enum D3D12_TILE_RANGE_FLAGS
+ {
+ D3D12_TILE_RANGE_FLAG_NONE = 0,
+ D3D12_TILE_RANGE_FLAG_NULL = 1,
+ D3D12_TILE_RANGE_FLAG_SKIP = 2,
+ D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4
+ } D3D12_TILE_RANGE_FLAGS;
+
+typedef struct D3D12_SUBRESOURCE_TILING
+ {
+ UINT WidthInTiles;
+ UINT16 HeightInTiles;
+ UINT16 DepthInTiles;
+ UINT StartTileIndexInOverallResource;
+ } D3D12_SUBRESOURCE_TILING;
+
+typedef struct D3D12_TILE_SHAPE
+ {
+ UINT WidthInTexels;
+ UINT HeightInTexels;
+ UINT DepthInTexels;
+ } D3D12_TILE_SHAPE;
+
+typedef struct D3D12_PACKED_MIP_INFO
+ {
+ UINT8 NumStandardMips;
+ UINT8 NumPackedMips;
+ UINT NumTilesForPackedMips;
+ UINT StartTileIndexInOverallResource;
+ } D3D12_PACKED_MIP_INFO;
+
+typedef
+enum D3D12_TILE_MAPPING_FLAGS
+ {
+ D3D12_TILE_MAPPING_FLAG_NONE = 0,
+ D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1
+ } D3D12_TILE_MAPPING_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS );
+typedef
+enum D3D12_TILE_COPY_FLAGS
+ {
+ D3D12_TILE_COPY_FLAG_NONE = 0,
+ D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1,
+ D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2,
+ D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4
+ } D3D12_TILE_COPY_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS );
+typedef
+enum D3D12_RESOURCE_STATES
+ {
+ D3D12_RESOURCE_STATE_COMMON = 0,
+ D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1,
+ D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2,
+ D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4,
+ D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8,
+ D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10,
+ D3D12_RESOURCE_STATE_DEPTH_READ = 0x20,
+ D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40,
+ D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80,
+ D3D12_RESOURCE_STATE_STREAM_OUT = 0x100,
+ D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200,
+ D3D12_RESOURCE_STATE_COPY_DEST = 0x400,
+ D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800,
+ D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000,
+ D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000,
+ D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) ,
+ D3D12_RESOURCE_STATE_PRESENT = 0,
+ D3D12_RESOURCE_STATE_PREDICATION = 0x200
+ } D3D12_RESOURCE_STATES;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES );
+typedef
+enum D3D12_RESOURCE_BARRIER_TYPE
+ {
+ D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0,
+ D3D12_RESOURCE_BARRIER_TYPE_ALIASING = ( D3D12_RESOURCE_BARRIER_TYPE_TRANSITION + 1 ) ,
+ D3D12_RESOURCE_BARRIER_TYPE_UAV = ( D3D12_RESOURCE_BARRIER_TYPE_ALIASING + 1 )
+ } D3D12_RESOURCE_BARRIER_TYPE;
+
+
+typedef struct D3D12_RESOURCE_TRANSITION_BARRIER
+ {
+ ID3D12Resource *pResource;
+ UINT Subresource;
+ D3D12_RESOURCE_STATES StateBefore;
+ D3D12_RESOURCE_STATES StateAfter;
+ } D3D12_RESOURCE_TRANSITION_BARRIER;
+
+typedef struct D3D12_RESOURCE_ALIASING_BARRIER
+ {
+ ID3D12Resource *pResourceBefore;
+ ID3D12Resource *pResourceAfter;
+ } D3D12_RESOURCE_ALIASING_BARRIER;
+
+typedef struct D3D12_RESOURCE_UAV_BARRIER
+ {
+ ID3D12Resource *pResource;
+ } D3D12_RESOURCE_UAV_BARRIER;
+
+typedef
+enum D3D12_RESOURCE_BARRIER_FLAGS
+ {
+ D3D12_RESOURCE_BARRIER_FLAG_NONE = 0,
+ D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1,
+ D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2
+ } D3D12_RESOURCE_BARRIER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS );
+typedef struct D3D12_RESOURCE_BARRIER
+ {
+ D3D12_RESOURCE_BARRIER_TYPE Type;
+ D3D12_RESOURCE_BARRIER_FLAGS Flags;
+ union
+ {
+ D3D12_RESOURCE_TRANSITION_BARRIER Transition;
+ D3D12_RESOURCE_ALIASING_BARRIER Aliasing;
+ D3D12_RESOURCE_UAV_BARRIER UAV;
+ } ;
+ } D3D12_RESOURCE_BARRIER;
+
+typedef struct D3D12_SUBRESOURCE_FOOTPRINT
+ {
+ DXGI_FORMAT Format;
+ UINT Width;
+ UINT Height;
+ UINT Depth;
+ UINT RowPitch;
+ } D3D12_SUBRESOURCE_FOOTPRINT;
+
+typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT
+ {
+ UINT64 Offset;
+ D3D12_SUBRESOURCE_FOOTPRINT Footprint;
+ } D3D12_PLACED_SUBRESOURCE_FOOTPRINT;
+
+typedef
+enum D3D12_TEXTURE_COPY_TYPE
+ {
+ D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0,
+ D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1
+ } D3D12_TEXTURE_COPY_TYPE;
+
+typedef struct D3D12_TEXTURE_COPY_LOCATION
+ {
+ ID3D12Resource *pResource;
+ D3D12_TEXTURE_COPY_TYPE Type;
+ union
+ {
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint;
+ UINT SubresourceIndex;
+ } ;
+ } D3D12_TEXTURE_COPY_LOCATION;
+
+typedef
+enum D3D12_SHADER_COMPONENT_MAPPING
+ {
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0 = 0,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1 = 1,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2 = 2,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3 = 3,
+ D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0 = 4,
+ D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1 = 5
+ } D3D12_SHADER_COMPONENT_MAPPING;
+
+#define D3D12_SHADER_COMPONENT_MAPPING_MASK 0x7
+#define D3D12_SHADER_COMPONENT_MAPPING_SHIFT 3
+#define D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES (1<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*4))
+#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(Src0,Src1,Src2,Src3) ((((Src0)&D3D12_SHADER_COMPONENT_MAPPING_MASK)| \
+ (((Src1)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<D3D12_SHADER_COMPONENT_MAPPING_SHIFT)| \
+ (((Src2)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*2))| \
+ (((Src3)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*3))| \
+ D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES))
+#define D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(ComponentToExtract,Mapping) ((D3D12_SHADER_COMPONENT_MAPPING)(Mapping >> (D3D12_SHADER_COMPONENT_MAPPING_SHIFT*ComponentToExtract) & D3D12_SHADER_COMPONENT_MAPPING_MASK))
+#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0,1,2,3)
+typedef
+enum D3D12_BUFFER_SRV_FLAGS
+ {
+ D3D12_BUFFER_SRV_FLAG_NONE = 0,
+ D3D12_BUFFER_SRV_FLAG_RAW = 0x1
+ } D3D12_BUFFER_SRV_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS );
+typedef struct D3D12_BUFFER_SRV
+ {
+ UINT64 FirstElement;
+ UINT NumElements;
+ UINT StructureByteStride;
+ D3D12_BUFFER_SRV_FLAGS Flags;
+ } D3D12_BUFFER_SRV;
+
+typedef struct D3D12_TEX1D_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEX1D_SRV;
+
+typedef struct D3D12_TEX1D_ARRAY_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEX1D_ARRAY_SRV;
+
+typedef struct D3D12_TEX2D_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT PlaneSlice;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEX2D_SRV;
+
+typedef struct D3D12_TEX2D_ARRAY_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEX2D_ARRAY_SRV;
+
+typedef struct D3D12_TEX3D_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEX3D_SRV;
+
+typedef struct D3D12_TEXCUBE_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEXCUBE_SRV;
+
+typedef struct D3D12_TEXCUBE_ARRAY_SRV
+ {
+ UINT MostDetailedMip;
+ UINT MipLevels;
+ UINT First2DArrayFace;
+ UINT NumCubes;
+ FLOAT ResourceMinLODClamp;
+ } D3D12_TEXCUBE_ARRAY_SRV;
+
+typedef struct D3D12_TEX2DMS_SRV
+ {
+ UINT UnusedField_NothingToDefine;
+ } D3D12_TEX2DMS_SRV;
+
+typedef struct D3D12_TEX2DMS_ARRAY_SRV
+ {
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX2DMS_ARRAY_SRV;
+
+typedef
+enum D3D12_SRV_DIMENSION
+ {
+ D3D12_SRV_DIMENSION_UNKNOWN = 0,
+ D3D12_SRV_DIMENSION_BUFFER = 1,
+ D3D12_SRV_DIMENSION_TEXTURE1D = 2,
+ D3D12_SRV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D12_SRV_DIMENSION_TEXTURE2D = 4,
+ D3D12_SRV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D12_SRV_DIMENSION_TEXTURE2DMS = 6,
+ D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
+ D3D12_SRV_DIMENSION_TEXTURE3D = 8,
+ D3D12_SRV_DIMENSION_TEXTURECUBE = 9,
+ D3D12_SRV_DIMENSION_TEXTURECUBEARRAY = 10
+ } D3D12_SRV_DIMENSION;
+
+typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC
+ {
+ DXGI_FORMAT Format;
+ D3D12_SRV_DIMENSION ViewDimension;
+ UINT Shader4ComponentMapping;
+ union
+ {
+ D3D12_BUFFER_SRV Buffer;
+ D3D12_TEX1D_SRV Texture1D;
+ D3D12_TEX1D_ARRAY_SRV Texture1DArray;
+ D3D12_TEX2D_SRV Texture2D;
+ D3D12_TEX2D_ARRAY_SRV Texture2DArray;
+ D3D12_TEX2DMS_SRV Texture2DMS;
+ D3D12_TEX2DMS_ARRAY_SRV Texture2DMSArray;
+ D3D12_TEX3D_SRV Texture3D;
+ D3D12_TEXCUBE_SRV TextureCube;
+ D3D12_TEXCUBE_ARRAY_SRV TextureCubeArray;
+ } ;
+ } D3D12_SHADER_RESOURCE_VIEW_DESC;
+
+typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
+ UINT SizeInBytes;
+ } D3D12_CONSTANT_BUFFER_VIEW_DESC;
+
+typedef
+enum D3D12_FILTER
+ {
+ D3D12_FILTER_MIN_MAG_MIP_POINT = 0,
+ D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
+ D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
+ D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
+ D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
+ D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
+ D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
+ D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+ D3D12_FILTER_ANISOTROPIC = 0x55,
+ D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
+ D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
+ D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
+ D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
+ D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
+ D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
+ D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
+ D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
+ D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
+ D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
+ D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
+ D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104,
+ D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105,
+ D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110,
+ D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
+ D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
+ D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
+ D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155,
+ D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
+ D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
+ D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184,
+ D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185,
+ D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190,
+ D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
+ D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
+ D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
+ D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5
+ } D3D12_FILTER;
+
+typedef
+enum D3D12_FILTER_TYPE
+ {
+ D3D12_FILTER_TYPE_POINT = 0,
+ D3D12_FILTER_TYPE_LINEAR = 1
+ } D3D12_FILTER_TYPE;
+
+typedef
+enum D3D12_FILTER_REDUCTION_TYPE
+ {
+ D3D12_FILTER_REDUCTION_TYPE_STANDARD = 0,
+ D3D12_FILTER_REDUCTION_TYPE_COMPARISON = 1,
+ D3D12_FILTER_REDUCTION_TYPE_MINIMUM = 2,
+ D3D12_FILTER_REDUCTION_TYPE_MAXIMUM = 3
+ } D3D12_FILTER_REDUCTION_TYPE;
+
+#define D3D12_FILTER_REDUCTION_TYPE_MASK ( 0x3 )
+
+#define D3D12_FILTER_REDUCTION_TYPE_SHIFT ( 7 )
+
+#define D3D12_FILTER_TYPE_MASK ( 0x3 )
+
+#define D3D12_MIN_FILTER_SHIFT ( 4 )
+
+#define D3D12_MAG_FILTER_SHIFT ( 2 )
+
+#define D3D12_MIP_FILTER_SHIFT ( 0 )
+
+#define D3D12_ANISOTROPIC_FILTERING_BIT ( 0x40 )
+
+#define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \
+ ( ( D3D12_FILTER ) ( \
+ ( ( ( min ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIN_FILTER_SHIFT ) | \
+ ( ( ( mag ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MAG_FILTER_SHIFT ) | \
+ ( ( ( mip ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIP_FILTER_SHIFT ) | \
+ ( ( ( reduction ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) << D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) )
+#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction ) \
+ ( ( D3D12_FILTER ) ( \
+ D3D12_ANISOTROPIC_FILTERING_BIT | \
+ D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \
+ D3D12_FILTER_TYPE_LINEAR, \
+ D3D12_FILTER_TYPE_LINEAR, \
+ reduction ) ) )
+#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \
+ ( ( D3D12_FILTER_TYPE ) \
+ ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
+#define D3D12_DECODE_MAG_FILTER( D3D12Filter ) \
+ ( ( D3D12_FILTER_TYPE ) \
+ ( ( ( D3D12Filter ) >> D3D12_MAG_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
+#define D3D12_DECODE_MIP_FILTER( D3D12Filter ) \
+ ( ( D3D12_FILTER_TYPE ) \
+ ( ( ( D3D12Filter ) >> D3D12_MIP_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
+#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) \
+ ( ( D3D12_FILTER_REDUCTION_TYPE ) \
+ ( ( ( D3D12Filter ) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) )
+#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter ) \
+ ( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON )
+#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \
+ ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \
+ ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \
+ ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \
+ ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) )
+typedef
+enum D3D12_TEXTURE_ADDRESS_MODE
+ {
+ D3D12_TEXTURE_ADDRESS_MODE_WRAP = 1,
+ D3D12_TEXTURE_ADDRESS_MODE_MIRROR = 2,
+ D3D12_TEXTURE_ADDRESS_MODE_CLAMP = 3,
+ D3D12_TEXTURE_ADDRESS_MODE_BORDER = 4,
+ D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 5
+ } D3D12_TEXTURE_ADDRESS_MODE;
+
+typedef struct D3D12_SAMPLER_DESC
+ {
+ D3D12_FILTER Filter;
+ D3D12_TEXTURE_ADDRESS_MODE AddressU;
+ D3D12_TEXTURE_ADDRESS_MODE AddressV;
+ D3D12_TEXTURE_ADDRESS_MODE AddressW;
+ FLOAT MipLODBias;
+ UINT MaxAnisotropy;
+ D3D12_COMPARISON_FUNC ComparisonFunc;
+ FLOAT BorderColor[ 4 ];
+ FLOAT MinLOD;
+ FLOAT MaxLOD;
+ } D3D12_SAMPLER_DESC;
+
+typedef
+enum D3D12_BUFFER_UAV_FLAGS
+ {
+ D3D12_BUFFER_UAV_FLAG_NONE = 0,
+ D3D12_BUFFER_UAV_FLAG_RAW = 0x1
+ } D3D12_BUFFER_UAV_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS );
+typedef struct D3D12_BUFFER_UAV
+ {
+ UINT64 FirstElement;
+ UINT NumElements;
+ UINT StructureByteStride;
+ UINT64 CounterOffsetInBytes;
+ D3D12_BUFFER_UAV_FLAGS Flags;
+ } D3D12_BUFFER_UAV;
+
+typedef struct D3D12_TEX1D_UAV
+ {
+ UINT MipSlice;
+ } D3D12_TEX1D_UAV;
+
+typedef struct D3D12_TEX1D_ARRAY_UAV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX1D_ARRAY_UAV;
+
+typedef struct D3D12_TEX2D_UAV
+ {
+ UINT MipSlice;
+ UINT PlaneSlice;
+ } D3D12_TEX2D_UAV;
+
+typedef struct D3D12_TEX2D_ARRAY_UAV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ } D3D12_TEX2D_ARRAY_UAV;
+
+typedef struct D3D12_TEX3D_UAV
+ {
+ UINT MipSlice;
+ UINT FirstWSlice;
+ UINT WSize;
+ } D3D12_TEX3D_UAV;
+
+typedef
+enum D3D12_UAV_DIMENSION
+ {
+ D3D12_UAV_DIMENSION_UNKNOWN = 0,
+ D3D12_UAV_DIMENSION_BUFFER = 1,
+ D3D12_UAV_DIMENSION_TEXTURE1D = 2,
+ D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D12_UAV_DIMENSION_TEXTURE2D = 4,
+ D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D12_UAV_DIMENSION_TEXTURE3D = 8
+ } D3D12_UAV_DIMENSION;
+
+typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC
+ {
+ DXGI_FORMAT Format;
+ D3D12_UAV_DIMENSION ViewDimension;
+ union
+ {
+ D3D12_BUFFER_UAV Buffer;
+ D3D12_TEX1D_UAV Texture1D;
+ D3D12_TEX1D_ARRAY_UAV Texture1DArray;
+ D3D12_TEX2D_UAV Texture2D;
+ D3D12_TEX2D_ARRAY_UAV Texture2DArray;
+ D3D12_TEX3D_UAV Texture3D;
+ } ;
+ } D3D12_UNORDERED_ACCESS_VIEW_DESC;
+
+typedef struct D3D12_BUFFER_RTV
+ {
+ UINT64 FirstElement;
+ UINT NumElements;
+ } D3D12_BUFFER_RTV;
+
+typedef struct D3D12_TEX1D_RTV
+ {
+ UINT MipSlice;
+ } D3D12_TEX1D_RTV;
+
+typedef struct D3D12_TEX1D_ARRAY_RTV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX1D_ARRAY_RTV;
+
+typedef struct D3D12_TEX2D_RTV
+ {
+ UINT MipSlice;
+ UINT PlaneSlice;
+ } D3D12_TEX2D_RTV;
+
+typedef struct D3D12_TEX2DMS_RTV
+ {
+ UINT UnusedField_NothingToDefine;
+ } D3D12_TEX2DMS_RTV;
+
+typedef struct D3D12_TEX2D_ARRAY_RTV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ UINT PlaneSlice;
+ } D3D12_TEX2D_ARRAY_RTV;
+
+typedef struct D3D12_TEX2DMS_ARRAY_RTV
+ {
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX2DMS_ARRAY_RTV;
+
+typedef struct D3D12_TEX3D_RTV
+ {
+ UINT MipSlice;
+ UINT FirstWSlice;
+ UINT WSize;
+ } D3D12_TEX3D_RTV;
+
+typedef
+enum D3D12_RTV_DIMENSION
+ {
+ D3D12_RTV_DIMENSION_UNKNOWN = 0,
+ D3D12_RTV_DIMENSION_BUFFER = 1,
+ D3D12_RTV_DIMENSION_TEXTURE1D = 2,
+ D3D12_RTV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D12_RTV_DIMENSION_TEXTURE2D = 4,
+ D3D12_RTV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D12_RTV_DIMENSION_TEXTURE2DMS = 6,
+ D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
+ D3D12_RTV_DIMENSION_TEXTURE3D = 8
+ } D3D12_RTV_DIMENSION;
+
+typedef struct D3D12_RENDER_TARGET_VIEW_DESC
+ {
+ DXGI_FORMAT Format;
+ D3D12_RTV_DIMENSION ViewDimension;
+ union
+ {
+ D3D12_BUFFER_RTV Buffer;
+ D3D12_TEX1D_RTV Texture1D;
+ D3D12_TEX1D_ARRAY_RTV Texture1DArray;
+ D3D12_TEX2D_RTV Texture2D;
+ D3D12_TEX2D_ARRAY_RTV Texture2DArray;
+ D3D12_TEX2DMS_RTV Texture2DMS;
+ D3D12_TEX2DMS_ARRAY_RTV Texture2DMSArray;
+ D3D12_TEX3D_RTV Texture3D;
+ } ;
+ } D3D12_RENDER_TARGET_VIEW_DESC;
+
+typedef struct D3D12_TEX1D_DSV
+ {
+ UINT MipSlice;
+ } D3D12_TEX1D_DSV;
+
+typedef struct D3D12_TEX1D_ARRAY_DSV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX1D_ARRAY_DSV;
+
+typedef struct D3D12_TEX2D_DSV
+ {
+ UINT MipSlice;
+ } D3D12_TEX2D_DSV;
+
+typedef struct D3D12_TEX2D_ARRAY_DSV
+ {
+ UINT MipSlice;
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX2D_ARRAY_DSV;
+
+typedef struct D3D12_TEX2DMS_DSV
+ {
+ UINT UnusedField_NothingToDefine;
+ } D3D12_TEX2DMS_DSV;
+
+typedef struct D3D12_TEX2DMS_ARRAY_DSV
+ {
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX2DMS_ARRAY_DSV;
+
+typedef
+enum D3D12_DSV_FLAGS
+ {
+ D3D12_DSV_FLAG_NONE = 0,
+ D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1,
+ D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2
+ } D3D12_DSV_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS );
+typedef
+enum D3D12_DSV_DIMENSION
+ {
+ D3D12_DSV_DIMENSION_UNKNOWN = 0,
+ D3D12_DSV_DIMENSION_TEXTURE1D = 1,
+ D3D12_DSV_DIMENSION_TEXTURE1DARRAY = 2,
+ D3D12_DSV_DIMENSION_TEXTURE2D = 3,
+ D3D12_DSV_DIMENSION_TEXTURE2DARRAY = 4,
+ D3D12_DSV_DIMENSION_TEXTURE2DMS = 5,
+ D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
+ } D3D12_DSV_DIMENSION;
+
+typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC
+ {
+ DXGI_FORMAT Format;
+ D3D12_DSV_DIMENSION ViewDimension;
+ D3D12_DSV_FLAGS Flags;
+ union
+ {
+ D3D12_TEX1D_DSV Texture1D;
+ D3D12_TEX1D_ARRAY_DSV Texture1DArray;
+ D3D12_TEX2D_DSV Texture2D;
+ D3D12_TEX2D_ARRAY_DSV Texture2DArray;
+ D3D12_TEX2DMS_DSV Texture2DMS;
+ D3D12_TEX2DMS_ARRAY_DSV Texture2DMSArray;
+ } ;
+ } D3D12_DEPTH_STENCIL_VIEW_DESC;
+
+typedef
+enum D3D12_CLEAR_FLAGS
+ {
+ D3D12_CLEAR_FLAG_DEPTH = 0x1,
+ D3D12_CLEAR_FLAG_STENCIL = 0x2
+ } D3D12_CLEAR_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS );
+typedef
+enum D3D12_FENCE_FLAGS
+ {
+ D3D12_FENCE_FLAG_NONE = 0,
+ D3D12_FENCE_FLAG_SHARED = 0x1,
+ D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2
+ } D3D12_FENCE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS );
+typedef
+enum D3D12_DESCRIPTOR_HEAP_TYPE
+ {
+ D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0,
+ D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV + 1 ) ,
+ D3D12_DESCRIPTOR_HEAP_TYPE_RTV = ( D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER + 1 ) ,
+ D3D12_DESCRIPTOR_HEAP_TYPE_DSV = ( D3D12_DESCRIPTOR_HEAP_TYPE_RTV + 1 ) ,
+ D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = ( D3D12_DESCRIPTOR_HEAP_TYPE_DSV + 1 )
+ } D3D12_DESCRIPTOR_HEAP_TYPE;
+
+typedef
+enum D3D12_DESCRIPTOR_HEAP_FLAGS
+ {
+ D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0,
+ D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1
+ } D3D12_DESCRIPTOR_HEAP_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS );
+typedef struct D3D12_DESCRIPTOR_HEAP_DESC
+ {
+ D3D12_DESCRIPTOR_HEAP_TYPE Type;
+ UINT NumDescriptors;
+ D3D12_DESCRIPTOR_HEAP_FLAGS Flags;
+ UINT NodeMask;
+ } D3D12_DESCRIPTOR_HEAP_DESC;
+
+typedef
+enum D3D12_DESCRIPTOR_RANGE_TYPE
+ {
+ D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0,
+ D3D12_DESCRIPTOR_RANGE_TYPE_UAV = ( D3D12_DESCRIPTOR_RANGE_TYPE_SRV + 1 ) ,
+ D3D12_DESCRIPTOR_RANGE_TYPE_CBV = ( D3D12_DESCRIPTOR_RANGE_TYPE_UAV + 1 ) ,
+ D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_RANGE_TYPE_CBV + 1 )
+ } D3D12_DESCRIPTOR_RANGE_TYPE;
+
+typedef struct D3D12_DESCRIPTOR_RANGE
+ {
+ D3D12_DESCRIPTOR_RANGE_TYPE RangeType;
+ UINT NumDescriptors;
+ UINT BaseShaderRegister;
+ UINT RegisterSpace;
+ UINT OffsetInDescriptorsFromTableStart;
+ } D3D12_DESCRIPTOR_RANGE;
+
+typedef struct D3D12_ROOT_DESCRIPTOR_TABLE
+ {
+ UINT NumDescriptorRanges;
+ _Field_size_full_(NumDescriptorRanges) const D3D12_DESCRIPTOR_RANGE *pDescriptorRanges;
+ } D3D12_ROOT_DESCRIPTOR_TABLE;
+
+typedef struct D3D12_ROOT_CONSTANTS
+ {
+ UINT ShaderRegister;
+ UINT RegisterSpace;
+ UINT Num32BitValues;
+ } D3D12_ROOT_CONSTANTS;
+
+typedef struct D3D12_ROOT_DESCRIPTOR
+ {
+ UINT ShaderRegister;
+ UINT RegisterSpace;
+ } D3D12_ROOT_DESCRIPTOR;
+
+typedef
+enum D3D12_SHADER_VISIBILITY
+ {
+ D3D12_SHADER_VISIBILITY_ALL = 0,
+ D3D12_SHADER_VISIBILITY_VERTEX = 1,
+ D3D12_SHADER_VISIBILITY_HULL = 2,
+ D3D12_SHADER_VISIBILITY_DOMAIN = 3,
+ D3D12_SHADER_VISIBILITY_GEOMETRY = 4,
+ D3D12_SHADER_VISIBILITY_PIXEL = 5
+ } D3D12_SHADER_VISIBILITY;
+
+typedef
+enum D3D12_ROOT_PARAMETER_TYPE
+ {
+ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0,
+ D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = ( D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE + 1 ) ,
+ D3D12_ROOT_PARAMETER_TYPE_CBV = ( D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS + 1 ) ,
+ D3D12_ROOT_PARAMETER_TYPE_SRV = ( D3D12_ROOT_PARAMETER_TYPE_CBV + 1 ) ,
+ D3D12_ROOT_PARAMETER_TYPE_UAV = ( D3D12_ROOT_PARAMETER_TYPE_SRV + 1 )
+ } D3D12_ROOT_PARAMETER_TYPE;
+
+typedef struct D3D12_ROOT_PARAMETER
+ {
+ D3D12_ROOT_PARAMETER_TYPE ParameterType;
+ union
+ {
+ D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable;
+ D3D12_ROOT_CONSTANTS Constants;
+ D3D12_ROOT_DESCRIPTOR Descriptor;
+ } ;
+ D3D12_SHADER_VISIBILITY ShaderVisibility;
+ } D3D12_ROOT_PARAMETER;
+
+typedef
+enum D3D12_ROOT_SIGNATURE_FLAGS
+ {
+ D3D12_ROOT_SIGNATURE_FLAG_NONE = 0,
+ D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x1,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x2,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x4,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x8,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20,
+ D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40
+ } D3D12_ROOT_SIGNATURE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS );
+typedef
+enum D3D12_STATIC_BORDER_COLOR
+ {
+ D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0,
+ D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = ( D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK + 1 ) ,
+ D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK + 1 )
+ } D3D12_STATIC_BORDER_COLOR;
+
+typedef struct D3D12_STATIC_SAMPLER_DESC
+ {
+ D3D12_FILTER Filter;
+ D3D12_TEXTURE_ADDRESS_MODE AddressU;
+ D3D12_TEXTURE_ADDRESS_MODE AddressV;
+ D3D12_TEXTURE_ADDRESS_MODE AddressW;
+ FLOAT MipLODBias;
+ UINT MaxAnisotropy;
+ D3D12_COMPARISON_FUNC ComparisonFunc;
+ D3D12_STATIC_BORDER_COLOR BorderColor;
+ FLOAT MinLOD;
+ FLOAT MaxLOD;
+ UINT ShaderRegister;
+ UINT RegisterSpace;
+ D3D12_SHADER_VISIBILITY ShaderVisibility;
+ } D3D12_STATIC_SAMPLER_DESC;
+
+typedef struct D3D12_ROOT_SIGNATURE_DESC
+ {
+ UINT NumParameters;
+ _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER *pParameters;
+ UINT NumStaticSamplers;
+ _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers;
+ D3D12_ROOT_SIGNATURE_FLAGS Flags;
+ } D3D12_ROOT_SIGNATURE_DESC;
+
+typedef
+enum D3D_ROOT_SIGNATURE_VERSION
+ {
+ D3D_ROOT_SIGNATURE_VERSION_1 = 0x1
+ } D3D_ROOT_SIGNATURE_VERSION;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__
+#define __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__
+
+/* interface ID3D12RootSignatureDeserializer */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12RootSignatureDeserializer;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("34AB647B-3CC8-46AC-841B-C0965645C046")
+ ID3D12RootSignatureDeserializer : public IUnknown
+ {
+ public:
+ virtual const D3D12_ROOT_SIGNATURE_DESC *STDMETHODCALLTYPE GetRootSignatureDesc( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12RootSignatureDeserializerVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12RootSignatureDeserializer * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12RootSignatureDeserializer * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12RootSignatureDeserializer * This);
+
+ const D3D12_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetRootSignatureDesc )(
+ ID3D12RootSignatureDeserializer * This);
+
+ END_INTERFACE
+ } ID3D12RootSignatureDeserializerVtbl;
+
+ interface ID3D12RootSignatureDeserializer
+ {
+ CONST_VTBL struct ID3D12RootSignatureDeserializerVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12RootSignatureDeserializer_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12RootSignatureDeserializer_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12RootSignatureDeserializer_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12RootSignatureDeserializer_GetRootSignatureDesc(This) \
+ ( (This)->lpVtbl -> GetRootSignatureDesc(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0002 */
+/* [local] */
+
+typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(
+ _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature,
+ _In_ D3D_ROOT_SIGNATURE_VERSION Version,
+ _Out_ ID3DBlob** ppBlob,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);
+
+HRESULT WINAPI D3D12SerializeRootSignature(
+ _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature,
+ _In_ D3D_ROOT_SIGNATURE_VERSION Version,
+ _Out_ ID3DBlob** ppBlob,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob);
+
+typedef HRESULT (WINAPI* PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER)(
+ _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSizeInBytes,
+ _In_ REFIID pRootSignatureDeserializerInterface,
+ _Out_ void** ppRootSignatureDeserializer);
+
+HRESULT WINAPI D3D12CreateRootSignatureDeserializer(
+ _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSizeInBytes,
+ _In_ REFIID pRootSignatureDeserializerInterface,
+ _Out_ void** ppRootSignatureDeserializer);
+typedef struct D3D12_CPU_DESCRIPTOR_HANDLE
+ {
+ SIZE_T ptr;
+ } D3D12_CPU_DESCRIPTOR_HANDLE;
+
+typedef struct D3D12_GPU_DESCRIPTOR_HANDLE
+ {
+ UINT64 ptr;
+ } D3D12_GPU_DESCRIPTOR_HANDLE;
+
+// If rects are supplied in D3D12_DISCARD_REGION, below, the resource
+// must have 2D subresources with all specified subresources the same dimension.
+typedef struct D3D12_DISCARD_REGION
+ {
+ UINT NumRects;
+ _In_reads_(NumRects) const D3D12_RECT *pRects;
+ UINT FirstSubresource;
+ UINT NumSubresources;
+ } D3D12_DISCARD_REGION;
+
+typedef
+enum D3D12_QUERY_HEAP_TYPE
+ {
+ D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0,
+ D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1,
+ D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2,
+ D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3
+ } D3D12_QUERY_HEAP_TYPE;
+
+typedef struct D3D12_QUERY_HEAP_DESC
+ {
+ D3D12_QUERY_HEAP_TYPE Type;
+ UINT Count;
+ UINT NodeMask;
+ } D3D12_QUERY_HEAP_DESC;
+
+typedef
+enum D3D12_QUERY_TYPE
+ {
+ D3D12_QUERY_TYPE_OCCLUSION = 0,
+ D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1,
+ D3D12_QUERY_TYPE_TIMESTAMP = 2,
+ D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3,
+ D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4,
+ D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5,
+ D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6,
+ D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7
+ } D3D12_QUERY_TYPE;
+
+typedef
+enum D3D12_PREDICATION_OP
+ {
+ D3D12_PREDICATION_OP_EQUAL_ZERO = 0,
+ D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1
+ } D3D12_PREDICATION_OP;
+
+typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS
+ {
+ UINT64 IAVertices;
+ UINT64 IAPrimitives;
+ UINT64 VSInvocations;
+ UINT64 GSInvocations;
+ UINT64 GSPrimitives;
+ UINT64 CInvocations;
+ UINT64 CPrimitives;
+ UINT64 PSInvocations;
+ UINT64 HSInvocations;
+ UINT64 DSInvocations;
+ UINT64 CSInvocations;
+ } D3D12_QUERY_DATA_PIPELINE_STATISTICS;
+
+typedef struct D3D12_QUERY_DATA_SO_STATISTICS
+ {
+ UINT64 NumPrimitivesWritten;
+ UINT64 PrimitivesStorageNeeded;
+ } D3D12_QUERY_DATA_SO_STATISTICS;
+
+typedef struct D3D12_STREAM_OUTPUT_BUFFER_VIEW
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
+ UINT64 SizeInBytes;
+ D3D12_GPU_VIRTUAL_ADDRESS BufferFilledSizeLocation;
+ } D3D12_STREAM_OUTPUT_BUFFER_VIEW;
+
+typedef struct D3D12_DRAW_ARGUMENTS
+ {
+ UINT VertexCountPerInstance;
+ UINT InstanceCount;
+ UINT StartVertexLocation;
+ UINT StartInstanceLocation;
+ } D3D12_DRAW_ARGUMENTS;
+
+typedef struct D3D12_DRAW_INDEXED_ARGUMENTS
+ {
+ UINT IndexCountPerInstance;
+ UINT InstanceCount;
+ UINT StartIndexLocation;
+ INT BaseVertexLocation;
+ UINT StartInstanceLocation;
+ } D3D12_DRAW_INDEXED_ARGUMENTS;
+
+typedef struct D3D12_DISPATCH_ARGUMENTS
+ {
+ UINT ThreadGroupCountX;
+ UINT ThreadGroupCountY;
+ UINT ThreadGroupCountZ;
+ } D3D12_DISPATCH_ARGUMENTS;
+
+typedef struct D3D12_VERTEX_BUFFER_VIEW
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
+ UINT SizeInBytes;
+ UINT StrideInBytes;
+ } D3D12_VERTEX_BUFFER_VIEW;
+
+typedef struct D3D12_INDEX_BUFFER_VIEW
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
+ UINT SizeInBytes;
+ DXGI_FORMAT Format;
+ } D3D12_INDEX_BUFFER_VIEW;
+
+typedef
+enum D3D12_INDIRECT_ARGUMENT_TYPE
+ {
+ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0,
+ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = ( D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 )
+ } D3D12_INDIRECT_ARGUMENT_TYPE;
+
+typedef struct D3D12_INDIRECT_ARGUMENT_DESC
+ {
+ D3D12_INDIRECT_ARGUMENT_TYPE Type;
+ union
+ {
+ struct
+ {
+ UINT Slot;
+ } VertexBuffer;
+ struct
+ {
+ UINT RootParameterIndex;
+ UINT DestOffsetIn32BitValues;
+ UINT Num32BitValuesToSet;
+ } Constant;
+ struct
+ {
+ UINT RootParameterIndex;
+ } ConstantBufferView;
+ struct
+ {
+ UINT RootParameterIndex;
+ } ShaderResourceView;
+ struct
+ {
+ UINT RootParameterIndex;
+ } UnorderedAccessView;
+ } ;
+ } D3D12_INDIRECT_ARGUMENT_DESC;
+
+typedef struct D3D12_COMMAND_SIGNATURE_DESC
+ {
+ UINT ByteStride;
+ UINT NumArgumentDescs;
+ _Field_size_full_(NumArgumentDescs) const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs;
+ UINT NodeMask;
+ } D3D12_COMMAND_SIGNATURE_DESC;
+
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3D12Pageable_INTERFACE_DEFINED__
+#define __ID3D12Pageable_INTERFACE_DEFINED__
+
+/* interface ID3D12Pageable */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Pageable;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("63ee58fb-1268-4835-86da-f008ce62f0d6")
+ ID3D12Pageable : public ID3D12DeviceChild
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12PageableVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Pageable * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Pageable * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Pageable * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Pageable * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Pageable * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Pageable * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Pageable * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12Pageable * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12PageableVtbl;
+
+ interface ID3D12Pageable
+ {
+ CONST_VTBL struct ID3D12PageableVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Pageable_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Pageable_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Pageable_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Pageable_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Pageable_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Pageable_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Pageable_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Pageable_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Pageable_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Heap_INTERFACE_DEFINED__
+#define __ID3D12Heap_INTERFACE_DEFINED__
+
+/* interface ID3D12Heap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Heap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6b3b2502-6e51-45b3-90ee-9884265e8df3")
+ ID3D12Heap : public ID3D12Pageable
+ {
+ public:
+ virtual D3D12_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12HeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Heap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Heap * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Heap * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Heap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Heap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Heap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Heap * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12Heap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Heap * This);
+
+ END_INTERFACE
+ } ID3D12HeapVtbl;
+
+ interface ID3D12Heap
+ {
+ CONST_VTBL struct ID3D12HeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Heap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Heap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Heap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Heap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Heap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Heap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Heap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Heap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12Heap_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+
+
+
+
+#endif /* __ID3D12Heap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Resource_INTERFACE_DEFINED__
+#define __ID3D12Resource_INTERFACE_DEFINED__
+
+/* interface ID3D12Resource */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Resource;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("696442be-a72e-4059-bc79-5b5c98040fad")
+ ID3D12Resource : public ID3D12Pageable
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Map(
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pReadRange,
+ _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData) = 0;
+
+ virtual void STDMETHODCALLTYPE Unmap(
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pWrittenRange) = 0;
+
+ virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+
+ virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE WriteToSubresource(
+ UINT DstSubresource,
+ _In_opt_ const D3D12_BOX *pDstBox,
+ _In_ const void *pSrcData,
+ UINT SrcRowPitch,
+ UINT SrcDepthPitch) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReadFromSubresource(
+ _Out_ void *pDstData,
+ UINT DstRowPitch,
+ UINT DstDepthPitch,
+ UINT SrcSubresource,
+ _In_opt_ const D3D12_BOX *pSrcBox) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetHeapProperties(
+ _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
+ _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12ResourceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Resource * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Resource * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Resource * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Resource * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Resource * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Resource * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Resource * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12Resource * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ ID3D12Resource * This,
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pReadRange,
+ _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData);
+
+ void ( STDMETHODCALLTYPE *Unmap )(
+ ID3D12Resource * This,
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pWrittenRange);
+
+ D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Resource * This);
+
+ D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )(
+ ID3D12Resource * This);
+
+ HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )(
+ ID3D12Resource * This,
+ UINT DstSubresource,
+ _In_opt_ const D3D12_BOX *pDstBox,
+ _In_ const void *pSrcData,
+ UINT SrcRowPitch,
+ UINT SrcDepthPitch);
+
+ HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )(
+ ID3D12Resource * This,
+ _Out_ void *pDstData,
+ UINT DstRowPitch,
+ UINT DstDepthPitch,
+ UINT SrcSubresource,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )(
+ ID3D12Resource * This,
+ _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
+ _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags);
+
+ END_INTERFACE
+ } ID3D12ResourceVtbl;
+
+ interface ID3D12Resource
+ {
+ CONST_VTBL struct ID3D12ResourceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Resource_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Resource_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Resource_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Resource_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Resource_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Resource_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Resource_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Resource_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12Resource_Map(This,Subresource,pReadRange,ppData) \
+ ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) )
+
+#define ID3D12Resource_Unmap(This,Subresource,pWrittenRange) \
+ ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) )
+
+#define ID3D12Resource_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+
+#define ID3D12Resource_GetGPUVirtualAddress(This) \
+ ( (This)->lpVtbl -> GetGPUVirtualAddress(This) )
+
+#define ID3D12Resource_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D12Resource_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) )
+
+#define ID3D12Resource_GetHeapProperties(This,pHeapProperties,pHeapFlags) \
+ ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+
+
+
+
+#endif /* __ID3D12Resource_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12CommandAllocator_INTERFACE_DEFINED__
+#define __ID3D12CommandAllocator_INTERFACE_DEFINED__
+
+/* interface ID3D12CommandAllocator */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12CommandAllocator;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6102dee4-af59-4b09-b999-b44d73f09b24")
+ ID3D12CommandAllocator : public ID3D12Pageable
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12CommandAllocatorVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12CommandAllocator * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12CommandAllocator * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12CommandAllocator * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12CommandAllocator * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12CommandAllocator * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12CommandAllocator * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12CommandAllocator * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12CommandAllocator * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12CommandAllocator * This);
+
+ END_INTERFACE
+ } ID3D12CommandAllocatorVtbl;
+
+ interface ID3D12CommandAllocator
+ {
+ CONST_VTBL struct ID3D12CommandAllocatorVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12CommandAllocator_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12CommandAllocator_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12CommandAllocator_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12CommandAllocator_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12CommandAllocator_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12CommandAllocator_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12CommandAllocator_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12CommandAllocator_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12CommandAllocator_Reset(This) \
+ ( (This)->lpVtbl -> Reset(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12CommandAllocator_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Fence_INTERFACE_DEFINED__
+#define __ID3D12Fence_INTERFACE_DEFINED__
+
+/* interface ID3D12Fence */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Fence;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0a753dcf-c4d8-4b91-adf6-be5a60d95a76")
+ ID3D12Fence : public ID3D12Pageable
+ {
+ public:
+ virtual UINT64 STDMETHODCALLTYPE GetCompletedValue( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetEventOnCompletion(
+ UINT64 Value,
+ HANDLE hEvent) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Signal(
+ UINT64 Value) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12FenceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Fence * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Fence * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Fence * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Fence * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Fence * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Fence * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Fence * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12Fence * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )(
+ ID3D12Fence * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )(
+ ID3D12Fence * This,
+ UINT64 Value,
+ HANDLE hEvent);
+
+ HRESULT ( STDMETHODCALLTYPE *Signal )(
+ ID3D12Fence * This,
+ UINT64 Value);
+
+ END_INTERFACE
+ } ID3D12FenceVtbl;
+
+ interface ID3D12Fence
+ {
+ CONST_VTBL struct ID3D12FenceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Fence_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Fence_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Fence_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Fence_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Fence_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Fence_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Fence_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Fence_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12Fence_GetCompletedValue(This) \
+ ( (This)->lpVtbl -> GetCompletedValue(This) )
+
+#define ID3D12Fence_SetEventOnCompletion(This,Value,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnCompletion(This,Value,hEvent) )
+
+#define ID3D12Fence_Signal(This,Value) \
+ ( (This)->lpVtbl -> Signal(This,Value) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Fence_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12PipelineState_INTERFACE_DEFINED__
+#define __ID3D12PipelineState_INTERFACE_DEFINED__
+
+/* interface ID3D12PipelineState */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12PipelineState;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("765a30f3-f624-4c6f-a828-ace948622445")
+ ID3D12PipelineState : public ID3D12Pageable
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetCachedBlob(
+ _COM_Outptr_ ID3DBlob **ppBlob) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12PipelineStateVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12PipelineState * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12PipelineState * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12PipelineState * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12PipelineState * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12PipelineState * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12PipelineState * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12PipelineState * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12PipelineState * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCachedBlob )(
+ ID3D12PipelineState * This,
+ _COM_Outptr_ ID3DBlob **ppBlob);
+
+ END_INTERFACE
+ } ID3D12PipelineStateVtbl;
+
+ interface ID3D12PipelineState
+ {
+ CONST_VTBL struct ID3D12PipelineStateVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12PipelineState_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12PipelineState_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12PipelineState_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12PipelineState_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12PipelineState_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12PipelineState_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12PipelineState_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12PipelineState_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12PipelineState_GetCachedBlob(This,ppBlob) \
+ ( (This)->lpVtbl -> GetCachedBlob(This,ppBlob) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12PipelineState_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DescriptorHeap_INTERFACE_DEFINED__
+#define __ID3D12DescriptorHeap_INTERFACE_DEFINED__
+
+/* interface ID3D12DescriptorHeap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DescriptorHeap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8efb471d-616c-4f49-90f7-127bb763fa51")
+ ID3D12DescriptorHeap : public ID3D12Pageable
+ {
+ public:
+ virtual D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+
+ virtual D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( void) = 0;
+
+ virtual D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DescriptorHeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DescriptorHeap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DescriptorHeap * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DescriptorHeap * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12DescriptorHeap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12DescriptorHeap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12DescriptorHeap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12DescriptorHeap * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12DescriptorHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ D3D12_DESCRIPTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12DescriptorHeap * This);
+
+ D3D12_CPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )(
+ ID3D12DescriptorHeap * This);
+
+ D3D12_GPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )(
+ ID3D12DescriptorHeap * This);
+
+ END_INTERFACE
+ } ID3D12DescriptorHeapVtbl;
+
+ interface ID3D12DescriptorHeap
+ {
+ CONST_VTBL struct ID3D12DescriptorHeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DescriptorHeap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DescriptorHeap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DescriptorHeap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DescriptorHeap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12DescriptorHeap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12DescriptorHeap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12DescriptorHeap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12DescriptorHeap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12DescriptorHeap_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+
+#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This) \
+ ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This) )
+
+#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This) \
+ ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif /* __ID3D12DescriptorHeap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12QueryHeap_INTERFACE_DEFINED__
+#define __ID3D12QueryHeap_INTERFACE_DEFINED__
+
+/* interface ID3D12QueryHeap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12QueryHeap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0d9658ae-ed45-469e-a61d-970ec583cab4")
+ ID3D12QueryHeap : public ID3D12Pageable
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12QueryHeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12QueryHeap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12QueryHeap * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12QueryHeap * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12QueryHeap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12QueryHeap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12QueryHeap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12QueryHeap * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12QueryHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12QueryHeapVtbl;
+
+ interface ID3D12QueryHeap
+ {
+ CONST_VTBL struct ID3D12QueryHeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12QueryHeap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12QueryHeap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12QueryHeap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12QueryHeap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12QueryHeap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12QueryHeap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12QueryHeap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12QueryHeap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12QueryHeap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12CommandSignature_INTERFACE_DEFINED__
+#define __ID3D12CommandSignature_INTERFACE_DEFINED__
+
+/* interface ID3D12CommandSignature */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12CommandSignature;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("c36a797c-ec80-4f0a-8985-a7b2475082d1")
+ ID3D12CommandSignature : public ID3D12Pageable
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12CommandSignatureVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12CommandSignature * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12CommandSignature * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12CommandSignature * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12CommandSignature * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12CommandSignature * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12CommandSignature * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12CommandSignature * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12CommandSignature * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12CommandSignatureVtbl;
+
+ interface ID3D12CommandSignature
+ {
+ CONST_VTBL struct ID3D12CommandSignatureVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12CommandSignature_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12CommandSignature_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12CommandSignature_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12CommandSignature_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12CommandSignature_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12CommandSignature_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12CommandSignature_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12CommandSignature_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12CommandSignature_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12CommandList_INTERFACE_DEFINED__
+#define __ID3D12CommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12CommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12CommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("7116d91c-e7e4-47ce-b8c6-ec8168f437e5")
+ ID3D12CommandList : public ID3D12DeviceChild
+ {
+ public:
+ virtual D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE GetType( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12CommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12CommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12CommandList * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12CommandList * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12CommandList * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12CommandList * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12CommandList * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12CommandList * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12CommandList * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12CommandList * This);
+
+ END_INTERFACE
+ } ID3D12CommandListVtbl;
+
+ interface ID3D12CommandList
+ {
+ CONST_VTBL struct ID3D12CommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12CommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12CommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12CommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12CommandList_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12CommandList_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12CommandList_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12CommandList_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12CommandList_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12CommandList_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12CommandList_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList_INTERFACE_DEFINED__
+#define __ID3D12GraphicsCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12GraphicsCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12GraphicsCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5b160d0f-ac1b-4185-8ba8-b3ae42a5a455")
+ ID3D12GraphicsCommandList : public ID3D12CommandList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearState(
+ _In_opt_ ID3D12PipelineState *pPipelineState) = 0;
+
+ virtual void STDMETHODCALLTYPE DrawInstanced(
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE DrawIndexedInstanced(
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE Dispatch(
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyBufferRegion(
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyTextureRegion(
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyResource(
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyTiles(
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveSubresource(
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format) = 0;
+
+ virtual void STDMETHODCALLTYPE IASetPrimitiveTopology(
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology) = 0;
+
+ virtual void STDMETHODCALLTYPE RSSetViewports(
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports) = 0;
+
+ virtual void STDMETHODCALLTYPE RSSetScissorRects(
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects) = 0;
+
+ virtual void STDMETHODCALLTYPE OMSetBlendFactor(
+ _In_opt_ const FLOAT BlendFactor[ 4 ]) = 0;
+
+ virtual void STDMETHODCALLTYPE OMSetStencilRef(
+ _In_ UINT StencilRef) = 0;
+
+ virtual void STDMETHODCALLTYPE SetPipelineState(
+ _In_ ID3D12PipelineState *pPipelineState) = 0;
+
+ virtual void STDMETHODCALLTYPE ResourceBarrier(
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteBundle(
+ _In_ ID3D12GraphicsCommandList *pCommandList) = 0;
+
+ virtual void STDMETHODCALLTYPE SetDescriptorHeaps(
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap **ppDescriptorHeaps) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRootSignature(
+ _In_ ID3D12RootSignature *pRootSignature) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRootSignature(
+ _In_ ID3D12RootSignature *pRootSignature) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRootDescriptorTable(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRootDescriptorTable(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstant(
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstant(
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstants(
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstants(
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRootConstantBufferView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRootConstantBufferView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRootShaderResourceView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRootShaderResourceView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetComputeRootUnorderedAccessView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGraphicsRootUnorderedAccessView(
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0;
+
+ virtual void STDMETHODCALLTYPE IASetIndexBuffer(
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView) = 0;
+
+ virtual void STDMETHODCALLTYPE IASetVertexBuffers(
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews) = 0;
+
+ virtual void STDMETHODCALLTYPE SOSetTargets(
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews) = 0;
+
+ virtual void STDMETHODCALLTYPE OMSetRenderTargets(
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearDepthStencilView(
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRenderTargetView(
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint(
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat(
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardResource(
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE EndQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveQueryData(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE SetPredication(
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEvent(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteIndirect(
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12GraphicsCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12GraphicsCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12GraphicsCommandList * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12GraphicsCommandList * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12GraphicsCommandList * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12GraphicsCommandList * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12GraphicsCommandList * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12GraphicsCommandList * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12GraphicsCommandList * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12GraphicsCommandList * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12GraphicsCommandList * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState);
+
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12GraphicsCommandList * This,
+ _In_opt_ ID3D12PipelineState *pPipelineState);
+
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ void ( STDMETHODCALLTYPE *CopyBufferRegion )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes);
+
+ void ( STDMETHODCALLTYPE *CopyTextureRegion )(
+ ID3D12GraphicsCommandList * This,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource);
+
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags);
+
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format);
+
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D12GraphicsCommandList * This,
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D12GraphicsCommandList * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D12GraphicsCommandList * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
+ ID3D12GraphicsCommandList * This,
+ _In_opt_ const FLOAT BlendFactor[ 4 ]);
+
+ void ( STDMETHODCALLTYPE *OMSetStencilRef )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT StencilRef);
+
+ void ( STDMETHODCALLTYPE *SetPipelineState )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12PipelineState *pPipelineState);
+
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ void ( STDMETHODCALLTYPE *ExecuteBundle )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12GraphicsCommandList *pCommandList);
+
+ void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap **ppDescriptorHeaps);
+
+ void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12RootSignature *pRootSignature);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12RootSignature *pRootSignature);
+
+ void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D12GraphicsCommandList * This,
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D12GraphicsCommandList * This,
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D12GraphicsCommandList * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D12GraphicsCommandList * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D12GraphicsCommandList * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12GraphicsCommandList * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12GraphicsCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12GraphicsCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12GraphicsCommandList * This);
+
+ void ( STDMETHODCALLTYPE *ExecuteIndirect )(
+ ID3D12GraphicsCommandList * This,
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset);
+
+ END_INTERFACE
+ } ID3D12GraphicsCommandListVtbl;
+
+ interface ID3D12GraphicsCommandList
+ {
+ CONST_VTBL struct ID3D12GraphicsCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12GraphicsCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12GraphicsCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12GraphicsCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12GraphicsCommandList_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12GraphicsCommandList_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12GraphicsCommandList_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12GraphicsCommandList_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12GraphicsCommandList_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12GraphicsCommandList_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12GraphicsCommandList_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12GraphicsCommandList_Reset(This,pAllocator,pInitialState) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) )
+
+#define ID3D12GraphicsCommandList_ClearState(This,pPipelineState) \
+ ( (This)->lpVtbl -> ClearState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D12GraphicsCommandList_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \
+ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) )
+
+#define ID3D12GraphicsCommandList_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \
+ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) )
+
+#define ID3D12GraphicsCommandList_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D12GraphicsCommandList_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D12GraphicsCommandList_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D12GraphicsCommandList_IASetPrimitiveTopology(This,PrimitiveTopology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) )
+
+#define ID3D12GraphicsCommandList_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D12GraphicsCommandList_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList_OMSetBlendFactor(This,BlendFactor) \
+ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) )
+
+#define ID3D12GraphicsCommandList_OMSetStencilRef(This,StencilRef) \
+ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) )
+
+#define ID3D12GraphicsCommandList_SetPipelineState(This,pPipelineState) \
+ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12GraphicsCommandList_ExecuteBundle(This,pCommandList) \
+ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) )
+
+#define ID3D12GraphicsCommandList_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \
+ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) )
+
+#define ID3D12GraphicsCommandList_SetComputeRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList_IASetIndexBuffer(This,pView) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) )
+
+#define ID3D12GraphicsCommandList_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList_SOSetTargets(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) )
+
+#define ID3D12GraphicsCommandList_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12GraphicsCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12GraphicsCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12GraphicsCommandList_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12GraphicsCommandList_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \
+ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12CommandQueue_INTERFACE_DEFINED__
+#define __ID3D12CommandQueue_INTERFACE_DEFINED__
+
+/* interface ID3D12CommandQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12CommandQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0ec870a6-5d7e-4c22-8cfc-5baae07616ed")
+ ID3D12CommandQueue : public ID3D12Pageable
+ {
+ public:
+ virtual void STDMETHODCALLTYPE UpdateTileMappings(
+ _In_ ID3D12Resource *pResource,
+ UINT NumResourceRegions,
+ _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
+ _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes,
+ _In_opt_ ID3D12Heap *pHeap,
+ UINT NumRanges,
+ _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags,
+ _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets,
+ _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
+ D3D12_TILE_MAPPING_FLAGS Flags) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyTileMappings(
+ _In_ ID3D12Resource *pDstResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pRegionSize,
+ D3D12_TILE_MAPPING_FLAGS Flags) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteCommandLists(
+ _In_ UINT NumCommandLists,
+ _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEvent(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Signal(
+ ID3D12Fence *pFence,
+ UINT64 Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Wait(
+ ID3D12Fence *pFence,
+ UINT64 Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTimestampFrequency(
+ _Out_ UINT64 *pFrequency) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetClockCalibration(
+ _Out_ UINT64 *pGpuTimestamp,
+ _Out_ UINT64 *pCpuTimestamp) = 0;
+
+ virtual D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12CommandQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12CommandQueue * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12CommandQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12CommandQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12CommandQueue * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12CommandQueue * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12CommandQueue * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12CommandQueue * This,
+ _In_z_ LPCWSTR Name);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12CommandQueue * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ void ( STDMETHODCALLTYPE *UpdateTileMappings )(
+ ID3D12CommandQueue * This,
+ _In_ ID3D12Resource *pResource,
+ UINT NumResourceRegions,
+ _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
+ _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes,
+ _In_opt_ ID3D12Heap *pHeap,
+ UINT NumRanges,
+ _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags,
+ _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets,
+ _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
+ D3D12_TILE_MAPPING_FLAGS Flags);
+
+ void ( STDMETHODCALLTYPE *CopyTileMappings )(
+ ID3D12CommandQueue * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pRegionSize,
+ D3D12_TILE_MAPPING_FLAGS Flags);
+
+ void ( STDMETHODCALLTYPE *ExecuteCommandLists )(
+ ID3D12CommandQueue * This,
+ _In_ UINT NumCommandLists,
+ _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists);
+
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12CommandQueue * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12CommandQueue * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12CommandQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Signal )(
+ ID3D12CommandQueue * This,
+ ID3D12Fence *pFence,
+ UINT64 Value);
+
+ HRESULT ( STDMETHODCALLTYPE *Wait )(
+ ID3D12CommandQueue * This,
+ ID3D12Fence *pFence,
+ UINT64 Value);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTimestampFrequency )(
+ ID3D12CommandQueue * This,
+ _Out_ UINT64 *pFrequency);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClockCalibration )(
+ ID3D12CommandQueue * This,
+ _Out_ UINT64 *pGpuTimestamp,
+ _Out_ UINT64 *pCpuTimestamp);
+
+ D3D12_COMMAND_QUEUE_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12CommandQueue * This);
+
+ END_INTERFACE
+ } ID3D12CommandQueueVtbl;
+
+ interface ID3D12CommandQueue
+ {
+ CONST_VTBL struct ID3D12CommandQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12CommandQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12CommandQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12CommandQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12CommandQueue_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12CommandQueue_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12CommandQueue_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12CommandQueue_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12CommandQueue_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12CommandQueue_UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) \
+ ( (This)->lpVtbl -> UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) )
+
+#define ID3D12CommandQueue_CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) \
+ ( (This)->lpVtbl -> CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) )
+
+#define ID3D12CommandQueue_ExecuteCommandLists(This,NumCommandLists,ppCommandLists) \
+ ( (This)->lpVtbl -> ExecuteCommandLists(This,NumCommandLists,ppCommandLists) )
+
+#define ID3D12CommandQueue_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12CommandQueue_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12CommandQueue_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12CommandQueue_Signal(This,pFence,Value) \
+ ( (This)->lpVtbl -> Signal(This,pFence,Value) )
+
+#define ID3D12CommandQueue_Wait(This,pFence,Value) \
+ ( (This)->lpVtbl -> Wait(This,pFence,Value) )
+
+#define ID3D12CommandQueue_GetTimestampFrequency(This,pFrequency) \
+ ( (This)->lpVtbl -> GetTimestampFrequency(This,pFrequency) )
+
+#define ID3D12CommandQueue_GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) \
+ ( (This)->lpVtbl -> GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) )
+
+#define ID3D12CommandQueue_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+
+
+
+
+#endif /* __ID3D12CommandQueue_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device_INTERFACE_DEFINED__
+#define __ID3D12Device_INTERFACE_DEFINED__
+
+/* interface ID3D12Device */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("189819f1-1db6-4b57-be54-1821339b85f7")
+ ID3D12Device : public ID3D12Object
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetNodeCount( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue(
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommandAllocator(
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateGraphicsPipelineState(
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateComputePipelineState(
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommandList(
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDescriptorHeap(
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize(
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateRootSignature(
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateConstantBufferView(
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateShaderResourceView(
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateUnorderedAccessView(
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateRenderTargetView(
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateDepthStencilView(
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateSampler(
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyDescriptors(
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0;
+
+ virtual void STDMETHODCALLTYPE CopyDescriptorsSimple(
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0;
+
+ virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo(
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0;
+
+ virtual D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties(
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource(
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateHeap(
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource(
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateReservedResource(
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSharedHandle(
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OpenSharedHandle(
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OpenSharedHandleByName(
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MakeResident(
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Evict(
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateFence(
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0;
+
+ virtual void STDMETHODCALLTYPE GetCopyableFootprints(
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateQueryHeap(
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetStablePowerState(
+ BOOL Enable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommandSignature(
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature) = 0;
+
+ virtual void STDMETHODCALLTYPE GetResourceTiling(
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips) = 0;
+
+ virtual LUID STDMETHODCALLTYPE GetAdapterLuid( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device * This,
+ _In_z_ LPCWSTR Name);
+
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device * This);
+
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device * This,
+ BOOL Enable);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device * This);
+
+ END_INTERFACE
+ } ID3D12DeviceVtbl;
+
+ interface ID3D12Device
+ {
+ CONST_VTBL struct ID3D12DeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+
+#define ID3D12Device_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+
+#define ID3D12Device_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+
+#define ID3D12Device_CreateCommittedResource(This,pHeapProperties,HeapFlags,pResourceDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pResourceDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+
+#define ID3D12Device_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif /* __ID3D12Device_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0017 */
+/* [local] */
+
+typedef struct D3D12_SUBRESOURCE_DATA
+ {
+ const void *pData;
+ LONG_PTR RowPitch;
+ LONG_PTR SlicePitch;
+ } D3D12_SUBRESOURCE_DATA;
+
+typedef struct D3D12_MEMCPY_DEST
+ {
+ void *pData;
+ SIZE_T RowPitch;
+ SIZE_T SlicePitch;
+ } D3D12_MEMCPY_DEST;
+
+#if !defined( D3D12_IGNORE_SDK_LAYERS )
+#include "d3d12sdklayers.h"
+#endif
+
+///////////////////////////////////////////////////////////////////////////
+// D3D12CreateDevice
+// ------------------
+//
+// pAdapter
+// If NULL, D3D12CreateDevice will choose the primary adapter.
+// If non-NULL, D3D12CreateDevice will use the provided adapter.
+// MinimumFeatureLevel
+// The minimum feature level required for successful device creation.
+// riid
+// The interface IID of the device to be returned. Expected: ID3D12Device.
+// ppDevice
+// Pointer to returned interface. May be NULL.
+//
+// Return Values
+// Any of those documented for
+// CreateDXGIFactory1
+// IDXGIFactory::EnumAdapters
+// D3D12CreateDevice
+//
+///////////////////////////////////////////////////////////////////////////
+typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*,
+ D3D_FEATURE_LEVEL,
+ _In_ REFIID, _COM_Outptr_opt_ void** );
+
+HRESULT WINAPI D3D12CreateDevice(
+ _In_opt_ IUnknown* pAdapter,
+ D3D_FEATURE_LEVEL MinimumFeatureLevel,
+ _In_ REFIID riid, // Expected: ID3D12Device
+ _COM_Outptr_opt_ void** ppDevice );
+
+
+typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** );
+
+HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug );
+
+DEFINE_GUID(IID_ID3D12Object,0xc4fec28f,0x7966,0x4e95,0x9f,0x94,0xf4,0x31,0xcb,0x56,0xc3,0xb8);
+DEFINE_GUID(IID_ID3D12DeviceChild,0x905db94b,0xa00c,0x4140,0x9d,0xf5,0x2b,0x64,0xca,0x9e,0xa3,0x57);
+DEFINE_GUID(IID_ID3D12RootSignature,0xc54a6b66,0x72df,0x4ee8,0x8b,0xe5,0xa9,0x46,0xa1,0x42,0x92,0x14);
+DEFINE_GUID(IID_ID3D12RootSignatureDeserializer,0x34AB647B,0x3CC8,0x46AC,0x84,0x1B,0xC0,0x96,0x56,0x45,0xC0,0x46);
+DEFINE_GUID(IID_ID3D12Pageable,0x63ee58fb,0x1268,0x4835,0x86,0xda,0xf0,0x08,0xce,0x62,0xf0,0xd6);
+DEFINE_GUID(IID_ID3D12Heap,0x6b3b2502,0x6e51,0x45b3,0x90,0xee,0x98,0x84,0x26,0x5e,0x8d,0xf3);
+DEFINE_GUID(IID_ID3D12Resource,0x696442be,0xa72e,0x4059,0xbc,0x79,0x5b,0x5c,0x98,0x04,0x0f,0xad);
+DEFINE_GUID(IID_ID3D12CommandAllocator,0x6102dee4,0xaf59,0x4b09,0xb9,0x99,0xb4,0x4d,0x73,0xf0,0x9b,0x24);
+DEFINE_GUID(IID_ID3D12Fence,0x0a753dcf,0xc4d8,0x4b91,0xad,0xf6,0xbe,0x5a,0x60,0xd9,0x5a,0x76);
+DEFINE_GUID(IID_ID3D12PipelineState,0x765a30f3,0xf624,0x4c6f,0xa8,0x28,0xac,0xe9,0x48,0x62,0x24,0x45);
+DEFINE_GUID(IID_ID3D12DescriptorHeap,0x8efb471d,0x616c,0x4f49,0x90,0xf7,0x12,0x7b,0xb7,0x63,0xfa,0x51);
+DEFINE_GUID(IID_ID3D12QueryHeap,0x0d9658ae,0xed45,0x469e,0xa6,0x1d,0x97,0x0e,0xc5,0x83,0xca,0xb4);
+DEFINE_GUID(IID_ID3D12CommandSignature,0xc36a797c,0xec80,0x4f0a,0x89,0x85,0xa7,0xb2,0x47,0x50,0x82,0xd1);
+DEFINE_GUID(IID_ID3D12CommandList,0x7116d91c,0xe7e4,0x47ce,0xb8,0xc6,0xec,0x81,0x68,0xf4,0x37,0xe5);
+DEFINE_GUID(IID_ID3D12GraphicsCommandList,0x5b160d0f,0xac1b,0x4185,0x8b,0xa8,0xb3,0xae,0x42,0xa5,0xa4,0x55);
+DEFINE_GUID(IID_ID3D12CommandQueue,0x0ec870a6,0x5d7e,0x4c22,0x8c,0xfc,0x5b,0xaa,0xe0,0x76,0x16,0xed);
+DEFINE_GUID(IID_ID3D12Device,0x189819f1,0x1db6,0x4b57,0xbe,0x54,0x18,0x21,0x33,0x9b,0x85,0xf7);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0017_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0017_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
new file mode 100644
index 00000000000..b7a6dbd039c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
@@ -0,0 +1,1921 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12sdklayers_h__
+#define __d3d12sdklayers_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12Debug_FWD_DEFINED__
+#define __ID3D12Debug_FWD_DEFINED__
+typedef interface ID3D12Debug ID3D12Debug;
+
+#endif /* __ID3D12Debug_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice_FWD_DEFINED__
+#define __ID3D12DebugDevice_FWD_DEFINED__
+typedef interface ID3D12DebugDevice ID3D12DebugDevice;
+
+#endif /* __ID3D12DebugDevice_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandQueue_FWD_DEFINED__
+#define __ID3D12DebugCommandQueue_FWD_DEFINED__
+typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue;
+
+#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList_FWD_DEFINED__
+#define __ID3D12DebugCommandList_FWD_DEFINED__
+typedef interface ID3D12DebugCommandList ID3D12DebugCommandList;
+
+#endif /* __ID3D12DebugCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12InfoQueue_FWD_DEFINED__
+#define __ID3D12InfoQueue_FWD_DEFINED__
+typedef interface ID3D12InfoQueue ID3D12InfoQueue;
+
+#endif /* __ID3D12InfoQueue_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "d3d12.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0000 */
+/* [local] */
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D12Debug_INTERFACE_DEFINED__
+#define __ID3D12Debug_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0")
+ ID3D12Debug : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug * This);
+
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug * This);
+
+ END_INTERFACE
+ } ID3D12DebugVtbl;
+
+ interface ID3D12Debug
+ {
+ CONST_VTBL struct ID3D12DebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */
+/* [local] */
+
+typedef
+enum D3D12_DEBUG_FEATURE
+ {
+ D3D12_DEBUG_FEATURE_NONE = 0,
+ D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DRAW = 0x1,
+ D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DISPATCH = 0x2
+ } D3D12_DEBUG_FEATURE;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEBUG_FEATURE );
+typedef
+enum D3D12_RLDO_FLAGS
+ {
+ D3D12_RLDO_NONE = 0,
+ D3D12_RLDO_SUMMARY = 0x1,
+ D3D12_RLDO_DETAIL = 0x2,
+ D3D12_RLDO_IGNORE_INTERNAL = 0x4
+ } D3D12_RLDO_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS)
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__
+#define __ID3D12DebugDevice_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3febd6dd-4973-4787-8194-e45f9e28923e")
+ ID3D12DebugDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ D3D12_DEBUG_FEATURE Mask) = 0;
+
+ virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
+ D3D12_RLDO_FLAGS Flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugDevice * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugDevice * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugDevice * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugDevice * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugDevice * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
+ ID3D12DebugDevice * This,
+ D3D12_RLDO_FLAGS Flags);
+
+ END_INTERFACE
+ } ID3D12DebugDeviceVtbl;
+
+ interface ID3D12DebugDevice
+ {
+ CONST_VTBL struct ID3D12DebugDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugDevice_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugDevice_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#define ID3D12DebugDevice_ReportLiveDeviceObjects(This,Flags) \
+ ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0002 */
+/* [local] */
+
+DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_s_ifspec;
+
+#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053a")
+ ID3D12DebugCommandQueue : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE AssertResourceState(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandQueue * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandQueue * This);
+
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandQueue * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ END_INTERFACE
+ } ID3D12DebugCommandQueueVtbl;
+
+ interface ID3D12DebugCommandQueue
+ {
+ CONST_VTBL struct ID3D12DebugCommandQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandQueue_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053f")
+ ID3D12DebugCommandList : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE AssertResourceState(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ D3D12_DEBUG_FEATURE Mask) = 0;
+
+ virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandList * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandList * This);
+
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugCommandList * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugCommandList * This);
+
+ END_INTERFACE
+ } ID3D12DebugCommandListVtbl;
+
+ interface ID3D12DebugCommandList
+ {
+ CONST_VTBL struct ID3D12DebugCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandList_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#define ID3D12DebugCommandList_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugCommandList_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0004 */
+/* [local] */
+
+typedef
+enum D3D12_MESSAGE_CATEGORY
+ {
+ D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
+ D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_INITIALIZATION = ( D3D12_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_CLEANUP = ( D3D12_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_COMPILATION = ( D3D12_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_CREATION = ( D3D12_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_SETTING = ( D3D12_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_GETTING = ( D3D12_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D12_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_EXECUTION = ( D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_SHADER = ( D3D12_MESSAGE_CATEGORY_EXECUTION + 1 )
+ } D3D12_MESSAGE_CATEGORY;
+
+typedef
+enum D3D12_MESSAGE_SEVERITY
+ {
+ D3D12_MESSAGE_SEVERITY_CORRUPTION = 0,
+ D3D12_MESSAGE_SEVERITY_ERROR = ( D3D12_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_WARNING = ( D3D12_MESSAGE_SEVERITY_ERROR + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_INFO = ( D3D12_MESSAGE_SEVERITY_WARNING + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_MESSAGE = ( D3D12_MESSAGE_SEVERITY_INFO + 1 )
+ } D3D12_MESSAGE_SEVERITY;
+
+typedef
+enum D3D12_MESSAGE_ID
+ {
+ D3D12_MESSAGE_ID_UNKNOWN = 0,
+ D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D12_MESSAGE_ID_UNKNOWN + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_THIS = ( D3D12_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D12_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
+ D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
+ D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
+ D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
+ D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
+ D3D12_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
+ D3D12_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_REF_THREADING_MODE = ( D3D12_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
+ D3D12_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D12_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
+ D3D12_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D12_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
+ D3D12_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D12_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
+ D3D12_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D12_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
+ D3D12_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D12_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
+ D3D12_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D12_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
+ D3D12_MESSAGE_ID_REF_INFO = ( D3D12_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_REF_INFO + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INPUTLAYOUT_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SAMPLER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SAMPLER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_POSITION_NOT_PRESENT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_POSITION_NOT_PRESENT + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_BOUND_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
+ D3D12_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D12_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_BUFFER = ( D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D12_MESSAGE_ID_LIVE_BUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D12_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D12_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D12_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D12_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D12_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D12_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D12_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D12_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_SAMPLER = ( D3D12_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D12_MESSAGE_ID_LIVE_SAMPLER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D12_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_QUERY = ( D3D12_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_PREDICATE = ( D3D12_MESSAGE_ID_LIVE_QUERY + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_COUNTER = ( D3D12_MESSAGE_ID_LIVE_PREDICATE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_DEVICE = ( D3D12_MESSAGE_ID_LIVE_COUNTER + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = ( D3D12_MESSAGE_ID_LIVE_DEVICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_LIVE_SWAPCHAIN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D12_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D12_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D12_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_SHADER_ABORT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV + 1 ) ,
+ D3D12_MESSAGE_ID_SHADER_MESSAGE = ( D3D12_MESSAGE_ID_SHADER_ABORT + 1 ) ,
+ D3D12_MESSAGE_ID_SHADER_ERROR = ( D3D12_MESSAGE_ID_SHADER_MESSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_SHADER_ERROR + 1 ) ,
+ D3D12_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
+ D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY = ( D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) ,
+ D3D12_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 = ( D3D12_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_GETDC_INACCESSIBLE = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT = ( D3D12_MESSAGE_ID_GETDC_INACCESSIBLE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE = ( D3D12_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA = ( D3D12_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = ( D3D12_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = ( D3D12_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
+ D3D12_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM = ( D3D12_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_SETEVENTONHARDWARECONTENTPROTECTIONTILT_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM = ( D3D12_MESSAGE_ID_SETEVENTONHARDWARECONTENTPROTECTIONTILT_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT + 1 ) ,
+ D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE = ( D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE = ( D3D12_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 = ( D3D12_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 + 1 ) ,
+ D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTILES_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
+ D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING = ( D3D12_MESSAGE_ID_COPYTILES_INVALID_PARAMETER + 1 ) ,
+ D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR = ( D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING + 1 ) ,
+ D3D12_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS = ( D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR + 1 ) ,
+ D3D12_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA = ( D3D12_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS + 1 ) ,
+ D3D12_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE = ( D3D12_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA + 1 ) ,
+ D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE + 1 ) ,
+ D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES + 1 ) ,
+ D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT + 1 ) ,
+ D3D12_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE = ( D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER = ( D3D12_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = ( D3D12_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = ( D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS + 1 ) ,
+ D3D12_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEDEVICE_WARNING + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_CRYPTOSESSION = ( D3D12_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_CREATE_CRYPTOSESSION + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_CRYPTOSESSION = ( D3D12_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_LIVE_CRYPTOSESSION + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_CRYPTOSESSION = ( D3D12_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_DESTROY_CRYPTOSESSION + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALID_TYPE = ( D3D12_MESSAGE_ID_MAP_INVALID_SUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_UNSUPPORTED_TYPE = ( D3D12_MESSAGE_ID_MAP_INVALID_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_MAP_UNSUPPORTED_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = ( D3D12_MESSAGE_ID_UNMAP_INVALID_SUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_INEFFICIENT_PRESENT = ( D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = ( D3D12_MESSAGE_ID_INEFFICIENT_PRESENT + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET + 1 ) ,
+ D3D12_MESSAGE_ID_QUERY_STATE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_OPEN + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_BUNDLE_API = ( D3D12_MESSAGE_ID_QUERY_STATE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = ( D3D12_MESSAGE_ID_INVALID_BUNDLE_API + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED_WITH_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED + 1 ) ,
+ D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = ( D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED_WITH_INVALID_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_INDIRECT_ARGUMENT_BUFFER = ( D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_COMPUTE_AND_GRAPHICS_PIPELINE = ( D3D12_MESSAGE_ID_INVALID_INDIRECT_ARGUMENT_BUFFER + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = ( D3D12_MESSAGE_ID_COMPUTE_AND_GRAPHICS_PIPELINE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC + 1 ) ,
+ D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = ( D3D12_MESSAGE_ID_COMMAND_LIST_SYNC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_IMAGE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_IMAGE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_QUEUE_IMAGE_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_IMAGE_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = ( D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = ( D3D12_MESSAGE_ID_CREATE_PIPELINESTATE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_RESOURCE = ( D3D12_MESSAGE_ID_CREATE_IMAGECOMMANDLIST + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_CREATE_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_LIBRARY = ( D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_HEAP = ( D3D12_MESSAGE_ID_CREATE_LIBRARY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = ( D3D12_MESSAGE_ID_CREATE_HEAP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_QUERYHEAP = ( D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_CREATE_QUERYHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = ( D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = ( D3D12_MESSAGE_ID_LIVE_PIPELINESTATE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_RESOURCE = ( D3D12_MESSAGE_ID_LIVE_IMAGECOMMANDLIST + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_LIVE_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_LIBRARY = ( D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_HEAP = ( D3D12_MESSAGE_ID_LIVE_LIBRARY + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = ( D3D12_MESSAGE_ID_LIVE_HEAP + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_QUERYHEAP = ( D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE + 1 ) ,
+ D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_LIVE_QUERYHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = ( D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = ( D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_RESOURCE = ( D3D12_MESSAGE_ID_DESTROY_IMAGECOMMANDLIST + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_DESTROY_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_LIBRARY = ( D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_HEAP = ( D3D12_MESSAGE_ID_DESTROY_LIBRARY + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = ( D3D12_MESSAGE_ID_DESTROY_HEAP + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = ( D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE + 1 ) ,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_DESTROY_QUERYHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDHEAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_LARGEALLOCATION = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_SMALLALLOCATION = ( D3D12_MESSAGE_ID_CREATERESOURCE_LARGEALLOCATION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCE_SMALLALLOCATION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_HAS_PENDING_INITIAL_DATA = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = ( D3D12_MESSAGE_ID_RESOURCE_HAS_PENDING_INITIAL_DATA + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = ( D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = ( D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = ( D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = ( D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = ( D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = ( D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = ( D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = ( D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE + 1 ) ,
+ D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_LARGE_OFFSET = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_LARGE_OFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = ( D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE + 1 ) ,
+ D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = ( D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = ( D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = ( D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = ( D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS + 1 ) ,
+ D3D12_MESSAGE_ID_MAKERESIDENT_INVALIDOBJECT = ( D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY + 1 ) ,
+ D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = ( D3D12_MESSAGE_ID_MAKERESIDENT_INVALIDOBJECT + 1 ) ,
+ D3D12_MESSAGE_ID_EVICT_INVALIDOBJECT = ( D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY + 1 ) ,
+ D3D12_MESSAGE_ID_HEAPS_UNSUPPORTED = ( D3D12_MESSAGE_ID_EVICT_INVALIDOBJECT + 1 ) ,
+ D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = ( D3D12_MESSAGE_ID_HEAPS_UNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = ( D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_LARGE_OFFSET = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_LARGE_OFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_SET_INDEX_BUFFER_LARGE_OFFSET = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_LARGE_OFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = ( D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC + 1 ) ,
+ D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT + 1 ) ,
+ D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = ( D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERY_HEAP_JPEG_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS + 1 ) ,
+ D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_JPEG_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = ( D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY + 1 ) ,
+ D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS + 1 ) ,
+ D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS + 1 ) ,
+ D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE = ( D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = ( D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE + 1 ) ,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = ( D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID + 1 ) ,
+ D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE = ( D3D12_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOMPONENTS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D = ( D3D12_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD = ( D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD = ( D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UPSCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_TIER4DOWNSCALETOLARGE = ( D3D12_MESSAGE_ID_JPEGDECODE_UPSCALEUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_TIER3DOWNSCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_TIER4DOWNSCALETOLARGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_TIER3DOWNSCALEUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS = ( D3D12_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE = ( D3D12_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_HAZARD = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE = ( D3D12_MESSAGE_ID_JPEGDECODE_HAZARD + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET = ( D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDCOMPONENTS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_HAZARD = ( D3D12_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE = ( D3D12_MESSAGE_ID_JPEGENCODE_HAZARD + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY = ( D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = ( D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALIDDEPTH = ( D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALIDDEPTH + 1 ) ,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = ( D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDHEAP = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = ( D3D12_MESSAGE_ID_MAP_INVALIDHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDRANGE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = ( D3D12_MESSAGE_ID_MAP_INVALIDRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_NULLRANGE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_NULLRANGE = ( D3D12_MESSAGE_ID_MAP_NULLRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = ( D3D12_MESSAGE_ID_UNMAP_NULLRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = ( D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION + 1 ) ,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX + 1 ) ,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX + 1 ) ,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER + 1 ) ,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED + 1 ) ,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX + 1 ) ,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX + 1 ) ,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP + 1 ) ,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX + 1 ) ,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX + 1 ) ,
+ D3D12_MESSAGE_ID_INVALID_NODE_INDEX = ( D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED + 1 ) ,
+ D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_INVALID_NODE_INDEX + 1 ) ,
+ D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = ( D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = ( D3D12_MESSAGE_ID_NODE_MASK_MISMATCH + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = ( D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = ( D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = ( D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES + 1 ) ,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE + 1 ) ,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT + 1 ) ,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = ( D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT + 1 ) ,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = ( D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = ( D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE + 1 ) ,
+ D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE + 1 ) ,
+ D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS + 1 ) ,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = ( D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE + 1 ) ,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED + 1 ) ,
+ D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT + 1 ) ,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_NEEDED = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = ( D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_NEEDED + 1 ) ,
+ D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = ( D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY + 1 ) ,
+ D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = ( D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = ( D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE + 1 ) ,
+ D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = ( D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT + 1 ) ,
+ D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT + 1 )
+ } D3D12_MESSAGE_ID;
+
+typedef struct D3D12_MESSAGE
+ {
+ D3D12_MESSAGE_CATEGORY Category;
+ D3D12_MESSAGE_SEVERITY Severity;
+ D3D12_MESSAGE_ID ID;
+ _Field_size_(DescriptionByteLength) const char *pDescription;
+ SIZE_T DescriptionByteLength;
+ } D3D12_MESSAGE;
+
+typedef struct D3D12_INFO_QUEUE_FILTER_DESC
+ {
+ UINT NumCategories;
+ _Field_size_(NumCategories) D3D12_MESSAGE_CATEGORY *pCategoryList;
+ UINT NumSeverities;
+ _Field_size_(NumSeverities) D3D12_MESSAGE_SEVERITY *pSeverityList;
+ UINT NumIDs;
+ _Field_size_(NumIDs) D3D12_MESSAGE_ID *pIDList;
+ } D3D12_INFO_QUEUE_FILTER_DESC;
+
+typedef struct D3D12_INFO_QUEUE_FILTER
+ {
+ D3D12_INFO_QUEUE_FILTER_DESC AllowList;
+ D3D12_INFO_QUEUE_FILTER_DESC DenyList;
+ } D3D12_INFO_QUEUE_FILTER;
+
+#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_s_ifspec;
+
+#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__
+#define __ID3D12InfoQueue_INTERFACE_DEFINED__
+
+/* interface ID3D12InfoQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12InfoQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0742a90b-c387-483f-b946-30a7e4e61458")
+ ID3D12InfoQueue : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
+ _In_ UINT64 MessageCountLimit) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMessage(
+ _In_ UINT64 MessageIndex,
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
+ _Inout_ SIZE_T *pMessageByteLength) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddMessage(
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ BOOL bEnable) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
+ _In_ D3D12_MESSAGE_CATEGORY Category) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
+ _In_ D3D12_MESSAGE_SEVERITY Severity) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
+ _In_ D3D12_MESSAGE_ID ID) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
+ _In_ BOOL bMute) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12InfoQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12InfoQueue * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12InfoQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ ID3D12InfoQueue * This,
+ _In_ UINT64 MessageCountLimit);
+
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ ID3D12InfoQueue * This,
+ _In_ UINT64 MessageIndex,
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ ID3D12InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ ID3D12InfoQueue * This);
+
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ ID3D12InfoQueue * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ ID3D12InfoQueue * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ ID3D12InfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ BOOL bEnable);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_ID ID);
+
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ ID3D12InfoQueue * This,
+ _In_ BOOL bMute);
+
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ ID3D12InfoQueue * This);
+
+ END_INTERFACE
+ } ID3D12InfoQueueVtbl;
+
+ interface ID3D12InfoQueue
+ {
+ CONST_VTBL struct ID3D12InfoQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12InfoQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12InfoQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12InfoQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
+
+#define ID3D12InfoQueue_ClearStoredMessages(This) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This) )
+
+#define ID3D12InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
+
+#define ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetNumStoredMessages(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This) )
+
+#define ID3D12InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
+
+#define ID3D12InfoQueue_GetMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This) )
+
+#define ID3D12InfoQueue_AddStorageFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue_ClearStorageFilter(This) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushEmptyStorageFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushCopyOfStorageFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushStorageFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
+
+#define ID3D12InfoQueue_PopStorageFilter(This) \
+ ( (This)->lpVtbl -> PopStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetStorageFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
+
+#define ID3D12InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue_ClearRetrievalFilter(This) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushEmptyRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushCopyOfRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushRetrievalFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
+
+#define ID3D12InfoQueue_PopRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_GetRetrievalFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
+
+#define ID3D12InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
+
+#define ID3D12InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define ID3D12InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
+
+#define ID3D12InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
+
+#define ID3D12InfoQueue_SetBreakOnID(This,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
+
+#define ID3D12InfoQueue_GetBreakOnCategory(This,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
+
+#define ID3D12InfoQueue_GetBreakOnSeverity(This,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
+
+#define ID3D12InfoQueue_GetBreakOnID(This,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
+
+#define ID3D12InfoQueue_SetMuteDebugOutput(This,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
+
+#define ID3D12InfoQueue_GetMuteDebugOutput(This) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0005 */
+/* [local] */
+
+DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0);
+DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e);
+DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a);
+DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f);
+DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h
new file mode 100644
index 00000000000..fbeb7633d26
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h
@@ -0,0 +1,459 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// File: D3D12Shader.h
+// Content: D3D12 Shader Types and APIs
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef __D3D12SHADER_H__
+#define __D3D12SHADER_H__
+
+#include "d3dcommon.h"
+
+typedef enum D3D12_SHADER_VERSION_TYPE
+{
+ D3D12_SHVER_PIXEL_SHADER = 0,
+ D3D12_SHVER_VERTEX_SHADER = 1,
+ D3D12_SHVER_GEOMETRY_SHADER = 2,
+
+ // D3D11 Shaders
+ D3D12_SHVER_HULL_SHADER = 3,
+ D3D12_SHVER_DOMAIN_SHADER = 4,
+ D3D12_SHVER_COMPUTE_SHADER = 5,
+
+ D3D12_SHVER_RESERVED0 = 0xFFF0,
+} D3D12_SHADER_VERSION_TYPE;
+
+#define D3D12_SHVER_GET_TYPE(_Version) \
+ (((_Version) >> 16) & 0xffff)
+#define D3D12_SHVER_GET_MAJOR(_Version) \
+ (((_Version) >> 4) & 0xf)
+#define D3D12_SHVER_GET_MINOR(_Version) \
+ (((_Version) >> 0) & 0xf)
+
+// Slot ID for library function return
+#define D3D_RETURN_PARAMETER_INDEX (-1)
+
+typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
+
+typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
+
+
+typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
+{
+ LPCSTR SemanticName; // Name of the semantic
+ UINT SemanticIndex; // Index of the semantic
+ UINT Register; // Number of member variables
+ D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
+ D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
+ BYTE Mask; // Mask to indicate which components of the register
+ // are used (combination of D3D10_COMPONENT_MASK values)
+ BYTE ReadWriteMask; // Mask to indicate whether a given component is
+ // never written (if this is an output signature) or
+ // always read (if this is an input signature).
+ // (combination of D3D_MASK_* values)
+ UINT Stream; // Stream index
+ D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
+} D3D12_SIGNATURE_PARAMETER_DESC;
+
+typedef struct _D3D12_SHADER_BUFFER_DESC
+{
+ LPCSTR Name; // Name of the constant buffer
+ D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
+ UINT Variables; // Number of member variables
+ UINT Size; // Size of CB (in bytes)
+ UINT uFlags; // Buffer description flags
+} D3D12_SHADER_BUFFER_DESC;
+
+typedef struct _D3D12_SHADER_VARIABLE_DESC
+{
+ LPCSTR Name; // Name of the variable
+ UINT StartOffset; // Offset in constant buffer's backing store
+ UINT Size; // Size of variable (in bytes)
+ UINT uFlags; // Variable flags
+ LPVOID DefaultValue; // Raw pointer to default value
+ UINT StartTexture; // First texture index (or -1 if no textures used)
+ UINT TextureSize; // Number of texture slots possibly used.
+ UINT StartSampler; // First sampler index (or -1 if no textures used)
+ UINT SamplerSize; // Number of sampler slots possibly used.
+} D3D12_SHADER_VARIABLE_DESC;
+
+typedef struct _D3D12_SHADER_TYPE_DESC
+{
+ D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
+ D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
+ UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
+ UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
+ UINT Elements; // Number of elements (0 if not an array)
+ UINT Members; // Number of members (0 if not a structure)
+ UINT Offset; // Offset from the start of structure (0 if not a structure member)
+ LPCSTR Name; // Name of type, can be NULL
+} D3D12_SHADER_TYPE_DESC;
+
+typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
+
+typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
+
+typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
+
+typedef struct _D3D12_SHADER_DESC
+{
+ UINT Version; // Shader version
+ LPCSTR Creator; // Creator string
+ UINT Flags; // Shader compilation/parse flags
+
+ UINT ConstantBuffers; // Number of constant buffers
+ UINT BoundResources; // Number of bound resources
+ UINT InputParameters; // Number of parameters in the input signature
+ UINT OutputParameters; // Number of parameters in the output signature
+
+ UINT InstructionCount; // Number of emitted instructions
+ UINT TempRegisterCount; // Number of temporary registers used
+ UINT TempArrayCount; // Number of temporary arrays used
+ UINT DefCount; // Number of constant defines
+ UINT DclCount; // Number of declarations (input + output)
+ UINT TextureNormalInstructions; // Number of non-categorized texture instructions
+ UINT TextureLoadInstructions; // Number of texture load instructions
+ UINT TextureCompInstructions; // Number of texture comparison instructions
+ UINT TextureBiasInstructions; // Number of texture bias instructions
+ UINT TextureGradientInstructions; // Number of texture gradient instructions
+ UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
+ UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
+ UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
+ UINT StaticFlowControlCount; // Number of static flow control instructions used
+ UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
+ UINT MacroInstructionCount; // Number of macro instructions used
+ UINT ArrayInstructionCount; // Number of array instructions used
+ UINT CutInstructionCount; // Number of cut instructions used
+ UINT EmitInstructionCount; // Number of emit instructions used
+ D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
+ UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
+ D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
+ UINT PatchConstantParameters; // Number of parameters in the patch constant signature
+ UINT cGSInstanceCount; // Number of Geometry shader instances
+ UINT cControlPoints; // Number of control points in the HS->DS stage
+ D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
+ D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
+ D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
+ // instruction counts
+ UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
+ UINT cInterlockedInstructions; // Number of interlocked instructions
+ UINT cTextureStoreInstructions; // Number of texture writes
+} D3D12_SHADER_DESC;
+
+typedef struct _D3D12_SHADER_INPUT_BIND_DESC
+{
+ LPCSTR Name; // Name of the resource
+ D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
+ UINT BindPoint; // Starting bind point
+ UINT BindCount; // Number of contiguous bind points (for arrays)
+
+ UINT uFlags; // Input binding flags
+ D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
+ D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
+ UINT NumSamples; // Number of samples (0 if not MS texture)
+ UINT Space; // Register space
+ UINT uID; // Range ID in the bytecode
+} D3D12_SHADER_INPUT_BIND_DESC;
+
+#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
+#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
+#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
+#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
+#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
+#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
+#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
+#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
+#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
+#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
+#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
+#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
+#define D3D_SHADER_REQUIRES_ROVS 0x00001000
+#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
+
+
+typedef struct _D3D12_LIBRARY_DESC
+{
+ LPCSTR Creator; // The name of the originator of the library.
+ UINT Flags; // Compilation flags.
+ UINT FunctionCount; // Number of functions exported from the library.
+} D3D12_LIBRARY_DESC;
+
+typedef struct _D3D12_FUNCTION_DESC
+{
+ UINT Version; // Shader version
+ LPCSTR Creator; // Creator string
+ UINT Flags; // Shader compilation/parse flags
+
+ UINT ConstantBuffers; // Number of constant buffers
+ UINT BoundResources; // Number of bound resources
+
+ UINT InstructionCount; // Number of emitted instructions
+ UINT TempRegisterCount; // Number of temporary registers used
+ UINT TempArrayCount; // Number of temporary arrays used
+ UINT DefCount; // Number of constant defines
+ UINT DclCount; // Number of declarations (input + output)
+ UINT TextureNormalInstructions; // Number of non-categorized texture instructions
+ UINT TextureLoadInstructions; // Number of texture load instructions
+ UINT TextureCompInstructions; // Number of texture comparison instructions
+ UINT TextureBiasInstructions; // Number of texture bias instructions
+ UINT TextureGradientInstructions; // Number of texture gradient instructions
+ UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
+ UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
+ UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
+ UINT StaticFlowControlCount; // Number of static flow control instructions used
+ UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
+ UINT MacroInstructionCount; // Number of macro instructions used
+ UINT ArrayInstructionCount; // Number of array instructions used
+ UINT MovInstructionCount; // Number of mov instructions used
+ UINT MovcInstructionCount; // Number of movc instructions used
+ UINT ConversionInstructionCount; // Number of type conversion instructions used
+ UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
+ D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
+ UINT64 RequiredFeatureFlags; // Required feature flags
+
+ LPCSTR Name; // Function name
+ INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
+ BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
+ BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
+ BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
+} D3D12_FUNCTION_DESC;
+
+typedef struct _D3D12_PARAMETER_DESC
+{
+ LPCSTR Name; // Parameter name.
+ LPCSTR SemanticName; // Parameter semantic name (+index).
+ D3D_SHADER_VARIABLE_TYPE Type; // Element type.
+ D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
+ UINT Rows; // Rows are for matrix parameters.
+ UINT Columns; // Components or Columns in matrix.
+ D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
+ D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
+
+ UINT FirstInRegister; // The first input register for this parameter.
+ UINT FirstInComponent; // The first input register component for this parameter.
+ UINT FirstOutRegister; // The first output register for this parameter.
+ UINT FirstOutComponent; // The first output register component for this parameter.
+} D3D12_PARAMETER_DESC;
+
+
+//////////////////////////////////////////////////////////////////////////////
+// Interfaces ////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
+typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
+
+typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
+typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
+
+typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
+typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
+
+typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
+typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
+
+typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
+typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
+
+typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
+typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
+
+typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
+typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
+
+
+// {E913C351-783D-48CA-A1D1-4F306284AD56}
+interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
+DEFINE_GUID(IID_ID3D12ShaderReflectionType,
+0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
+
+#undef INTERFACE
+#define INTERFACE ID3D12ShaderReflectionType
+
+DECLARE_INTERFACE(ID3D12ShaderReflectionType)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
+ STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
+
+ STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
+ STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
+ STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
+ STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
+};
+
+// {8337A8A6-A216-444A-B2F4-314733A73AEA}
+interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
+DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
+0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
+
+#undef INTERFACE
+#define INTERFACE ID3D12ShaderReflectionVariable
+
+DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
+
+ STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
+};
+
+// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}
+interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
+DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
+0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
+
+#undef INTERFACE
+#define INTERFACE ID3D12ShaderReflectionConstantBuffer
+
+DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
+{
+ STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+};
+
+// The ID3D12ShaderReflection IID may change from SDK version to SDK version
+// if the reflection API changes. This prevents new code with the new API
+// from working with an old binary. Recompiling with the new header
+// will pick up the new IID.
+
+// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}
+interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
+DEFINE_GUID(IID_ID3D12ShaderReflection,
+0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
+
+#undef INTERFACE
+#define INTERFACE ID3D12ShaderReflection
+
+DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
+ _Out_ LPVOID *ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
+ _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+
+ STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+ STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
+ _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
+ _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
+
+ STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
+ STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
+
+ STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
+ STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
+
+ STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
+ STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
+
+ STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
+ _Out_opt_ UINT* pSizeX,
+ _Out_opt_ UINT* pSizeY,
+ _Out_opt_ UINT* pSizeZ) PURE;
+
+ STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
+};
+
+// {8E349D19-54DB-4A56-9DC9-119D87BDB804}
+interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
+DEFINE_GUID(IID_ID3D12LibraryReflection,
+0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
+
+#undef INTERFACE
+#define INTERFACE ID3D12LibraryReflection
+
+DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
+ STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
+};
+
+// {1108795C-2772-4BA9-B2A8-D464DC7E2799}
+interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
+DEFINE_GUID(IID_ID3D12FunctionReflection,
+0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
+
+#undef INTERFACE
+#define INTERFACE ID3D12FunctionReflection
+
+DECLARE_INTERFACE(ID3D12FunctionReflection)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
+ STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
+ _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
+
+ STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
+
+ STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
+ _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
+
+ // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
+ STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
+};
+
+// {EC25F42D-7006-4F2B-B33E-02CC3375733F}
+interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
+DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
+0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
+
+#undef INTERFACE
+#define INTERFACE ID3D12FunctionParameterReflection
+
+DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
+{
+ STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
+};
+
+
+//////////////////////////////////////////////////////////////////////////////
+// APIs //////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif //__cplusplus
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__D3D12SHADER_H__
+
diff --git a/3rdparty/dxsdk/Include/d3d9.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h
index b9ff114c84b..f6e532b71bc 100644
--- a/3rdparty/dxsdk/Include/d3d9.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h
@@ -18,6 +18,7 @@
#if(DIRECT3D_VERSION >= 0x0900)
+
/* This identifier is passed to Direct3DCreate9 in order to ensure that an
* application was built against the correct header files. This number is
* incremented whenever a header (or other) change would require applications
@@ -47,7 +48,6 @@
#endif
#define D3DAPI WINAPI
-
/*
* Interface IID's
*/
@@ -1809,7 +1809,6 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9;
#define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c)
#endif
-
/****************************************************************************
* Flags for SetPrivateData method on all D3D9 interfaces
*
@@ -2021,9 +2020,9 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9;
#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180)
-//*********************
-// D3D9Ex interfaces
-//*********************
+/*********************
+ * D3D9Ex interfaces
+ *********************/
HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex**);
@@ -2041,6 +2040,7 @@ DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9)
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3D9 methods ***/
+ STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE;
STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE;
STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE;
@@ -2067,6 +2067,7 @@ typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX;
#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a)
#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p)
#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b)
@@ -2089,6 +2090,7 @@ typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX;
#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirect3D9Ex_AddRef(p) (p)->AddRef()
#define IDirect3D9Ex_Release(p) (p)->Release()
+#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a)
#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount()
#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c)
#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b)
@@ -2786,6 +2788,7 @@ typedef struct IDirect3DCryptoSession9 *LPDIRECT3DCRYPTOSESSION9, *PDIRECT3DCRYP
};
#endif
+
#endif /* (DIRECT3D_VERSION >= 0x0900) */
#endif /* _D3D_H_ */
diff --git a/3rdparty/dxsdk/Include/d3d9caps.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h
index c10c4cdfda6..8298cc4f558 100644
--- a/3rdparty/dxsdk/Include/d3d9caps.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h
@@ -17,6 +17,8 @@
// include this file content only if compiling for DX9 interfaces
#if(DIRECT3D_VERSION >= 0x0900)
+
+
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
@@ -258,6 +260,7 @@ typedef struct _D3DCAPS9
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */
#define D3DCAPS3_DXVAHD 0x00000400L
+#define D3DCAPS3_DXVAHD_LIMITED 0x00000800L
//
@@ -562,6 +565,7 @@ typedef struct _D3DCAPS9
#pragma pack()
+
#endif /* (DIRECT3D_VERSION >= 0x0900) */
#endif /* _d3d9CAPS_H_ */
diff --git a/3rdparty/dxsdk/Include/d3d9types.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h
index ef8e9de0093..ef8e9de0093 100644
--- a/3rdparty/dxsdk/Include/d3d9types.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
new file mode 100644
index 00000000000..17e646e0773
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
@@ -0,0 +1,933 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3dcommon_h__
+#define __d3dcommon_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER <= 1600
+#ifndef VS2008_SAL_COMPAT
+#define VS2008_SAL_COMPAT
+// BK - SAL compatibility for VS2008
+
+#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
+ extern "C++" { \
+ inline ENUMTYPE operator | (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) | ( (int)_b) ); } \
+ inline ENUMTYPE operator |= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) |= ( (int)_b) ); } \
+ inline ENUMTYPE operator & (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) & ( (int)_b) ); } \
+ inline ENUMTYPE operator &= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) &= ( (int)_b) ); } \
+ inline ENUMTYPE operator ~ (ENUMTYPE _a) { return (ENUMTYPE) (~( (int) _a) ); } \
+ inline ENUMTYPE operator ^ (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) ^ ( (int)_b) ); } \
+ inline ENUMTYPE operator ^= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) ^= ( (int)_b) ); } \
+ }
+
+#undef _Out_
+#define _Out_
+#undef _In_
+#define _In_
+#undef _Always_
+#define _Always_(annos)
+#define _In_reads_(size)
+#define _In_reads_opt_(size)
+#define _In_reads_bytes_(size)
+#define _In_reads_bytes_opt_(size)
+#define _Inout_updates_bytes_(size)
+#define _Out_writes_(size)
+#define _Out_writes_opt_(size)
+#define _Out_writes_to_opt_(size,count)
+#define _Out_writes_bytes_(size)
+#define _Out_writes_bytes_opt_(size)
+#define _Out_writes_bytes_to_(size,count)
+#define _Outptr_
+#define _Outptr_opt_result_maybenull_
+#define _Outptr_opt_result_bytebuffer_(size)
+#define _Outptr_result_maybenull_
+#define _Outptr_result_bytebuffer_(size)
+#define _Out_writes_all_opt_(size)
+#define _COM_Outptr_
+#define _COM_Outptr_opt_
+#define _COM_Outptr_opt_result_maybenull_
+#define _Field_size_(size)
+#define _Field_size_full_(size)
+#define _Field_size_opt_(size)
+#define _Field_size_bytes_full_(size)
+#define nullptr NULL
+
+#endif // BK - VS2008_SAL_COMPAT
+#endif //
+
+/* Forward Declarations */
+
+#ifndef __ID3D10Blob_FWD_DEFINED__
+#define __ID3D10Blob_FWD_DEFINED__
+typedef interface ID3D10Blob ID3D10Blob;
+
+#endif /* __ID3D10Blob_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3dcommon_0000_0000 */
+/* [local] */
+
+typedef
+enum D3D_DRIVER_TYPE
+ {
+ D3D_DRIVER_TYPE_UNKNOWN = 0,
+ D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) ,
+ D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) ,
+ D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) ,
+ D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) ,
+ D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 )
+ } D3D_DRIVER_TYPE;
+
+typedef
+enum D3D_FEATURE_LEVEL
+ {
+ D3D_FEATURE_LEVEL_9_1 = 0x9100,
+ D3D_FEATURE_LEVEL_9_2 = 0x9200,
+ D3D_FEATURE_LEVEL_9_3 = 0x9300,
+ D3D_FEATURE_LEVEL_10_0 = 0xa000,
+ D3D_FEATURE_LEVEL_10_1 = 0xa100,
+ D3D_FEATURE_LEVEL_11_0 = 0xb000,
+ D3D_FEATURE_LEVEL_11_1 = 0xb100,
+ D3D_FEATURE_LEVEL_12_0 = 0xc000,
+ D3D_FEATURE_LEVEL_12_1 = 0xc100
+ } D3D_FEATURE_LEVEL;
+
+#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
+#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048
+#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512
+#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256
+#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2
+#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535
+#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575
+#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1
+#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4
+#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128
+#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048
+#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192
+typedef
+enum D3D_PRIMITIVE_TOPOLOGY
+ {
+ D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
+ D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
+ D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
+ D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
+ D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
+ D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
+ D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
+ D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
+ D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
+ D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
+ D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
+ D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
+ D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
+ D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
+ D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
+ D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
+ D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
+ D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
+ D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
+ D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
+ D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
+ D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
+ D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
+ D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
+ D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
+ D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
+ D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
+ D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
+ D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
+ D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
+ D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
+ D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
+ D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
+ D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
+ D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
+ D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
+ D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
+ D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
+ D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
+ D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
+ D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
+ D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
+ D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
+ D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
+ D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
+ D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
+ D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
+ D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
+ D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
+ D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
+ D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
+ D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
+ D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
+ D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
+ D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
+ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
+ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
+ D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
+ D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
+ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
+ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
+ D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
+ D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
+ } D3D_PRIMITIVE_TOPOLOGY;
+
+typedef
+enum D3D_PRIMITIVE
+ {
+ D3D_PRIMITIVE_UNDEFINED = 0,
+ D3D_PRIMITIVE_POINT = 1,
+ D3D_PRIMITIVE_LINE = 2,
+ D3D_PRIMITIVE_TRIANGLE = 3,
+ D3D_PRIMITIVE_LINE_ADJ = 6,
+ D3D_PRIMITIVE_TRIANGLE_ADJ = 7,
+ D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
+ D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
+ D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10,
+ D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11,
+ D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12,
+ D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13,
+ D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14,
+ D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15,
+ D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16,
+ D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17,
+ D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18,
+ D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19,
+ D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20,
+ D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21,
+ D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22,
+ D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23,
+ D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24,
+ D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25,
+ D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26,
+ D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 27,
+ D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 28,
+ D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 29,
+ D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 30,
+ D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 31,
+ D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 32,
+ D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 33,
+ D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 34,
+ D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 35,
+ D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 36,
+ D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 37,
+ D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 38,
+ D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 39,
+ D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
+ D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
+ D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
+ D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
+ D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
+ D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
+ D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
+ D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
+ D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
+ D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
+ D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
+ D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
+ D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH,
+ D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH
+ } D3D_PRIMITIVE;
+
+typedef
+enum D3D_SRV_DIMENSION
+ {
+ D3D_SRV_DIMENSION_UNKNOWN = 0,
+ D3D_SRV_DIMENSION_BUFFER = 1,
+ D3D_SRV_DIMENSION_TEXTURE1D = 2,
+ D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3,
+ D3D_SRV_DIMENSION_TEXTURE2D = 4,
+ D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D_SRV_DIMENSION_TEXTURE2DMS = 6,
+ D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
+ D3D_SRV_DIMENSION_TEXTURE3D = 8,
+ D3D_SRV_DIMENSION_TEXTURECUBE = 9,
+ D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
+ D3D_SRV_DIMENSION_BUFFEREX = 11,
+ D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
+ D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
+ D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
+ D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
+ D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
+ D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
+ D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
+ D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
+ D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
+ D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
+ D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
+ D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
+ D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
+ D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
+ D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
+ D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
+ D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
+ D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
+ D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
+ D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
+ D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
+ D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
+ D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
+ D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
+ D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
+ D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
+ D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
+ D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
+ D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
+ D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
+ D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
+ D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
+ D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
+ } D3D_SRV_DIMENSION;
+
+typedef struct _D3D_SHADER_MACRO
+ {
+ LPCSTR Name;
+ LPCSTR Definition;
+ } D3D_SHADER_MACRO;
+
+typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO;
+
+DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D10Blob_INTERFACE_DEFINED__
+#define __ID3D10Blob_INTERFACE_DEFINED__
+
+/* interface ID3D10Blob */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D10Blob;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102")
+ ID3D10Blob : public IUnknown
+ {
+ public:
+ virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0;
+
+ virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D10BlobVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D10Blob * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D10Blob * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D10Blob * This);
+
+ LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
+ ID3D10Blob * This);
+
+ SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
+ ID3D10Blob * This);
+
+ END_INTERFACE
+ } ID3D10BlobVtbl;
+
+ interface ID3D10Blob
+ {
+ CONST_VTBL struct ID3D10BlobVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D10Blob_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D10Blob_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D10Blob_GetBufferPointer(This) \
+ ( (This)->lpVtbl -> GetBufferPointer(This) )
+
+#define ID3D10Blob_GetBufferSize(This) \
+ ( (This)->lpVtbl -> GetBufferSize(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3dcommon_0000_0001 */
+/* [local] */
+
+typedef interface ID3D10Blob* LPD3D10BLOB;
+typedef ID3D10Blob ID3DBlob;
+
+typedef ID3DBlob* LPD3DBLOB;
+#define IID_ID3DBlob IID_ID3D10Blob
+typedef
+enum _D3D_INCLUDE_TYPE
+ {
+ D3D_INCLUDE_LOCAL = 0,
+ D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) ,
+ D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL,
+ D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM,
+ D3D_INCLUDE_FORCE_DWORD = 0x7fffffff
+ } D3D_INCLUDE_TYPE;
+
+typedef interface ID3DInclude ID3DInclude;
+#undef INTERFACE
+#define INTERFACE ID3DInclude
+DECLARE_INTERFACE(ID3DInclude)
+{
+ STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
+ STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
+};
+typedef ID3DInclude* LPD3DINCLUDE;
+typedef
+enum _D3D_SHADER_VARIABLE_CLASS
+ {
+ D3D_SVC_SCALAR = 0,
+ D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) ,
+ D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) ,
+ D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) ,
+ D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) ,
+ D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) ,
+ D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) ,
+ D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) ,
+ D3D10_SVC_SCALAR = D3D_SVC_SCALAR,
+ D3D10_SVC_VECTOR = D3D_SVC_VECTOR,
+ D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS,
+ D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS,
+ D3D10_SVC_OBJECT = D3D_SVC_OBJECT,
+ D3D10_SVC_STRUCT = D3D_SVC_STRUCT,
+ D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS,
+ D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER,
+ D3D_SVC_FORCE_DWORD = 0x7fffffff
+ } D3D_SHADER_VARIABLE_CLASS;
+
+typedef
+enum _D3D_SHADER_VARIABLE_FLAGS
+ {
+ D3D_SVF_USERPACKED = 1,
+ D3D_SVF_USED = 2,
+ D3D_SVF_INTERFACE_POINTER = 4,
+ D3D_SVF_INTERFACE_PARAMETER = 8,
+ D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED,
+ D3D10_SVF_USED = D3D_SVF_USED,
+ D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER,
+ D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER,
+ D3D_SVF_FORCE_DWORD = 0x7fffffff
+ } D3D_SHADER_VARIABLE_FLAGS;
+
+typedef
+enum _D3D_SHADER_VARIABLE_TYPE
+ {
+ D3D_SVT_VOID = 0,
+ D3D_SVT_BOOL = 1,
+ D3D_SVT_INT = 2,
+ D3D_SVT_FLOAT = 3,
+ D3D_SVT_STRING = 4,
+ D3D_SVT_TEXTURE = 5,
+ D3D_SVT_TEXTURE1D = 6,
+ D3D_SVT_TEXTURE2D = 7,
+ D3D_SVT_TEXTURE3D = 8,
+ D3D_SVT_TEXTURECUBE = 9,
+ D3D_SVT_SAMPLER = 10,
+ D3D_SVT_SAMPLER1D = 11,
+ D3D_SVT_SAMPLER2D = 12,
+ D3D_SVT_SAMPLER3D = 13,
+ D3D_SVT_SAMPLERCUBE = 14,
+ D3D_SVT_PIXELSHADER = 15,
+ D3D_SVT_VERTEXSHADER = 16,
+ D3D_SVT_PIXELFRAGMENT = 17,
+ D3D_SVT_VERTEXFRAGMENT = 18,
+ D3D_SVT_UINT = 19,
+ D3D_SVT_UINT8 = 20,
+ D3D_SVT_GEOMETRYSHADER = 21,
+ D3D_SVT_RASTERIZER = 22,
+ D3D_SVT_DEPTHSTENCIL = 23,
+ D3D_SVT_BLEND = 24,
+ D3D_SVT_BUFFER = 25,
+ D3D_SVT_CBUFFER = 26,
+ D3D_SVT_TBUFFER = 27,
+ D3D_SVT_TEXTURE1DARRAY = 28,
+ D3D_SVT_TEXTURE2DARRAY = 29,
+ D3D_SVT_RENDERTARGETVIEW = 30,
+ D3D_SVT_DEPTHSTENCILVIEW = 31,
+ D3D_SVT_TEXTURE2DMS = 32,
+ D3D_SVT_TEXTURE2DMSARRAY = 33,
+ D3D_SVT_TEXTURECUBEARRAY = 34,
+ D3D_SVT_HULLSHADER = 35,
+ D3D_SVT_DOMAINSHADER = 36,
+ D3D_SVT_INTERFACE_POINTER = 37,
+ D3D_SVT_COMPUTESHADER = 38,
+ D3D_SVT_DOUBLE = 39,
+ D3D_SVT_RWTEXTURE1D = 40,
+ D3D_SVT_RWTEXTURE1DARRAY = 41,
+ D3D_SVT_RWTEXTURE2D = 42,
+ D3D_SVT_RWTEXTURE2DARRAY = 43,
+ D3D_SVT_RWTEXTURE3D = 44,
+ D3D_SVT_RWBUFFER = 45,
+ D3D_SVT_BYTEADDRESS_BUFFER = 46,
+ D3D_SVT_RWBYTEADDRESS_BUFFER = 47,
+ D3D_SVT_STRUCTURED_BUFFER = 48,
+ D3D_SVT_RWSTRUCTURED_BUFFER = 49,
+ D3D_SVT_APPEND_STRUCTURED_BUFFER = 50,
+ D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51,
+ D3D_SVT_MIN8FLOAT = 52,
+ D3D_SVT_MIN10FLOAT = 53,
+ D3D_SVT_MIN16FLOAT = 54,
+ D3D_SVT_MIN12INT = 55,
+ D3D_SVT_MIN16INT = 56,
+ D3D_SVT_MIN16UINT = 57,
+ D3D10_SVT_VOID = D3D_SVT_VOID,
+ D3D10_SVT_BOOL = D3D_SVT_BOOL,
+ D3D10_SVT_INT = D3D_SVT_INT,
+ D3D10_SVT_FLOAT = D3D_SVT_FLOAT,
+ D3D10_SVT_STRING = D3D_SVT_STRING,
+ D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE,
+ D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D,
+ D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D,
+ D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D,
+ D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE,
+ D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER,
+ D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D,
+ D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D,
+ D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D,
+ D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE,
+ D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER,
+ D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER,
+ D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT,
+ D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT,
+ D3D10_SVT_UINT = D3D_SVT_UINT,
+ D3D10_SVT_UINT8 = D3D_SVT_UINT8,
+ D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER,
+ D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER,
+ D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL,
+ D3D10_SVT_BLEND = D3D_SVT_BLEND,
+ D3D10_SVT_BUFFER = D3D_SVT_BUFFER,
+ D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER,
+ D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER,
+ D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY,
+ D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY,
+ D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW,
+ D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW,
+ D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS,
+ D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY,
+ D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY,
+ D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER,
+ D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER,
+ D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER,
+ D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER,
+ D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE,
+ D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D,
+ D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY,
+ D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D,
+ D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY,
+ D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D,
+ D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER,
+ D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER,
+ D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER,
+ D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER,
+ D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER,
+ D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER,
+ D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER,
+ D3D_SVT_FORCE_DWORD = 0x7fffffff
+ } D3D_SHADER_VARIABLE_TYPE;
+
+typedef
+enum _D3D_SHADER_INPUT_FLAGS
+ {
+ D3D_SIF_USERPACKED = 0x1,
+ D3D_SIF_COMPARISON_SAMPLER = 0x2,
+ D3D_SIF_TEXTURE_COMPONENT_0 = 0x4,
+ D3D_SIF_TEXTURE_COMPONENT_1 = 0x8,
+ D3D_SIF_TEXTURE_COMPONENTS = 0xc,
+ D3D_SIF_UNUSED = 0x10,
+ D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED,
+ D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER,
+ D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0,
+ D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1,
+ D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS,
+ D3D_SIF_FORCE_DWORD = 0x7fffffff
+ } D3D_SHADER_INPUT_FLAGS;
+
+typedef
+enum _D3D_SHADER_INPUT_TYPE
+ {
+ D3D_SIT_CBUFFER = 0,
+ D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) ,
+ D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) ,
+ D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) ,
+ D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) ,
+ D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) ,
+ D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) ,
+ D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) ,
+ D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) ,
+ D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
+ D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
+ D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
+ D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
+ D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
+ D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
+ D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER,
+ D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED,
+ D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED,
+ D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED,
+ D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS,
+ D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS,
+ D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED,
+ D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED,
+ D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER
+ } D3D_SHADER_INPUT_TYPE;
+
+typedef
+enum _D3D_SHADER_CBUFFER_FLAGS
+ {
+ D3D_CBF_USERPACKED = 1,
+ D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED,
+ D3D_CBF_FORCE_DWORD = 0x7fffffff
+ } D3D_SHADER_CBUFFER_FLAGS;
+
+typedef
+enum _D3D_CBUFFER_TYPE
+ {
+ D3D_CT_CBUFFER = 0,
+ D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) ,
+ D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) ,
+ D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) ,
+ D3D10_CT_CBUFFER = D3D_CT_CBUFFER,
+ D3D10_CT_TBUFFER = D3D_CT_TBUFFER,
+ D3D11_CT_CBUFFER = D3D_CT_CBUFFER,
+ D3D11_CT_TBUFFER = D3D_CT_TBUFFER,
+ D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS,
+ D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO
+ } D3D_CBUFFER_TYPE;
+
+typedef
+enum D3D_NAME
+ {
+ D3D_NAME_UNDEFINED = 0,
+ D3D_NAME_POSITION = 1,
+ D3D_NAME_CLIP_DISTANCE = 2,
+ D3D_NAME_CULL_DISTANCE = 3,
+ D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
+ D3D_NAME_VIEWPORT_ARRAY_INDEX = 5,
+ D3D_NAME_VERTEX_ID = 6,
+ D3D_NAME_PRIMITIVE_ID = 7,
+ D3D_NAME_INSTANCE_ID = 8,
+ D3D_NAME_IS_FRONT_FACE = 9,
+ D3D_NAME_SAMPLE_INDEX = 10,
+ D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11,
+ D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12,
+ D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13,
+ D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
+ D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
+ D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
+ D3D_NAME_TARGET = 64,
+ D3D_NAME_DEPTH = 65,
+ D3D_NAME_COVERAGE = 66,
+ D3D_NAME_DEPTH_GREATER_EQUAL = 67,
+ D3D_NAME_DEPTH_LESS_EQUAL = 68,
+ D3D_NAME_STENCIL_REF = 69,
+ D3D_NAME_INNER_COVERAGE = 70,
+ D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED,
+ D3D10_NAME_POSITION = D3D_NAME_POSITION,
+ D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE,
+ D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE,
+ D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX,
+ D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX,
+ D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID,
+ D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID,
+ D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID,
+ D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE,
+ D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX,
+ D3D10_NAME_TARGET = D3D_NAME_TARGET,
+ D3D10_NAME_DEPTH = D3D_NAME_DEPTH,
+ D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE,
+ D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
+ D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
+ D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR,
+ D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
+ D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
+ D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
+ D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
+ D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL,
+ D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF,
+ D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE
+ } D3D_NAME;
+
+typedef
+enum D3D_RESOURCE_RETURN_TYPE
+ {
+ D3D_RETURN_TYPE_UNORM = 1,
+ D3D_RETURN_TYPE_SNORM = 2,
+ D3D_RETURN_TYPE_SINT = 3,
+ D3D_RETURN_TYPE_UINT = 4,
+ D3D_RETURN_TYPE_FLOAT = 5,
+ D3D_RETURN_TYPE_MIXED = 6,
+ D3D_RETURN_TYPE_DOUBLE = 7,
+ D3D_RETURN_TYPE_CONTINUED = 8,
+ D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
+ D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
+ D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
+ D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
+ D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
+ D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
+ D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
+ D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
+ D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
+ D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
+ D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
+ D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
+ D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE,
+ D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED
+ } D3D_RESOURCE_RETURN_TYPE;
+
+typedef
+enum D3D_REGISTER_COMPONENT_TYPE
+ {
+ D3D_REGISTER_COMPONENT_UNKNOWN = 0,
+ D3D_REGISTER_COMPONENT_UINT32 = 1,
+ D3D_REGISTER_COMPONENT_SINT32 = 2,
+ D3D_REGISTER_COMPONENT_FLOAT32 = 3,
+ D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN,
+ D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32,
+ D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32,
+ D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32
+ } D3D_REGISTER_COMPONENT_TYPE;
+
+typedef
+enum D3D_TESSELLATOR_DOMAIN
+ {
+ D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0,
+ D3D_TESSELLATOR_DOMAIN_ISOLINE = 1,
+ D3D_TESSELLATOR_DOMAIN_TRI = 2,
+ D3D_TESSELLATOR_DOMAIN_QUAD = 3,
+ D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED,
+ D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE,
+ D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI,
+ D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD
+ } D3D_TESSELLATOR_DOMAIN;
+
+typedef
+enum D3D_TESSELLATOR_PARTITIONING
+ {
+ D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
+ D3D_TESSELLATOR_PARTITIONING_INTEGER = 1,
+ D3D_TESSELLATOR_PARTITIONING_POW2 = 2,
+ D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3,
+ D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4,
+ D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED,
+ D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER,
+ D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2,
+ D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
+ D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN
+ } D3D_TESSELLATOR_PARTITIONING;
+
+typedef
+enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
+ {
+ D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0,
+ D3D_TESSELLATOR_OUTPUT_POINT = 1,
+ D3D_TESSELLATOR_OUTPUT_LINE = 2,
+ D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
+ D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4,
+ D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED,
+ D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT,
+ D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE,
+ D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW,
+ D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
+ } D3D_TESSELLATOR_OUTPUT_PRIMITIVE;
+
+typedef
+enum D3D_MIN_PRECISION
+ {
+ D3D_MIN_PRECISION_DEFAULT = 0,
+ D3D_MIN_PRECISION_FLOAT_16 = 1,
+ D3D_MIN_PRECISION_FLOAT_2_8 = 2,
+ D3D_MIN_PRECISION_RESERVED = 3,
+ D3D_MIN_PRECISION_SINT_16 = 4,
+ D3D_MIN_PRECISION_UINT_16 = 5,
+ D3D_MIN_PRECISION_ANY_16 = 0xf0,
+ D3D_MIN_PRECISION_ANY_10 = 0xf1
+ } D3D_MIN_PRECISION;
+
+typedef
+enum D3D_INTERPOLATION_MODE
+ {
+ D3D_INTERPOLATION_UNDEFINED = 0,
+ D3D_INTERPOLATION_CONSTANT = 1,
+ D3D_INTERPOLATION_LINEAR = 2,
+ D3D_INTERPOLATION_LINEAR_CENTROID = 3,
+ D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4,
+ D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5,
+ D3D_INTERPOLATION_LINEAR_SAMPLE = 6,
+ D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7
+ } D3D_INTERPOLATION_MODE;
+
+typedef
+enum _D3D_PARAMETER_FLAGS
+ {
+ D3D_PF_NONE = 0,
+ D3D_PF_IN = 0x1,
+ D3D_PF_OUT = 0x2,
+ D3D_PF_FORCE_DWORD = 0x7fffffff
+ } D3D_PARAMETER_FLAGS;
+
+DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
+DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41);
+DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2);
+#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName)
+#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName)
+#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName)
+#define D3D_SET_OBJECT_NAME_W(pObject, pName) D3D_SET_OBJECT_NAME_N_W(pObject, wcslen(pName), pName)
+#define D3D_COMPONENT_MASK_X 1
+#define D3D_COMPONENT_MASK_Y 2
+#define D3D_COMPONENT_MASK_Z 4
+#define D3D_COMPONENT_MASK_W 8
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h
new file mode 100644
index 00000000000..c13f964a1bf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h
@@ -0,0 +1,556 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// File: D3DCompiler.h
+// Content: D3D Compilation Types and APIs
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef __D3DCOMPILER_H__
+#define __D3DCOMPILER_H__
+
+
+// Current name of the DLL shipped in the same SDK as this header.
+
+
+
+#define D3DCOMPILER_DLL_W L"d3dcompiler_47.dll"
+#define D3DCOMPILER_DLL_A "d3dcompiler_47.dll"
+
+// Current HLSL compiler version.
+
+#define D3D_COMPILER_VERSION 47
+
+#ifdef UNICODE
+ #define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
+#else
+ #define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
+#endif
+
+#include "d3d11shader.h"
+#include "d3d12shader.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// APIs //////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+extern "C" {
+#endif //__cplusplus
+
+
+
+//----------------------------------------------------------------------------
+// D3DReadFileToBlob:
+// -----------------
+// Simple helper routine to read a file on disk into memory
+// for passing to other routines in this API.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DReadFileToBlob(_In_ LPCWSTR pFileName,
+ _Out_ ID3DBlob** ppContents);
+
+//----------------------------------------------------------------------------
+// D3DWriteBlobToFile:
+// ------------------
+// Simple helper routine to write a memory blob to a file on disk.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DWriteBlobToFile(_In_ ID3DBlob* pBlob,
+ _In_ LPCWSTR pFileName,
+ _In_ BOOL bOverwrite);
+
+//----------------------------------------------------------------------------
+// D3DCOMPILE flags:
+// -----------------
+// D3DCOMPILE_DEBUG
+// Insert debug file/line/type/symbol information.
+//
+// D3DCOMPILE_SKIP_VALIDATION
+// Do not validate the generated code against known capabilities and
+// constraints. This option is only recommended when compiling shaders
+// you KNOW will work. (ie. have compiled before without this option.)
+// Shaders are always validated by D3D before they are set to the device.
+//
+// D3DCOMPILE_SKIP_OPTIMIZATION
+// Instructs the compiler to skip optimization steps during code generation.
+// Unless you are trying to isolate a problem in your code using this option
+// is not recommended.
+//
+// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
+// Unless explicitly specified, matrices will be packed in row-major order
+// on input and output from the shader.
+//
+// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
+// Unless explicitly specified, matrices will be packed in column-major
+// order on input and output from the shader. This is generally more
+// efficient, since it allows vector-matrix multiplication to be performed
+// using a series of dot-products.
+//
+// D3DCOMPILE_PARTIAL_PRECISION
+// Force all computations in resulting shader to occur at partial precision.
+// This may result in faster evaluation of shaders on some hardware.
+//
+// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
+// Force compiler to compile against the next highest available software
+// target for vertex shaders. This flag also turns optimizations off,
+// and debugging on.
+//
+// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
+// Force compiler to compile against the next highest available software
+// target for pixel shaders. This flag also turns optimizations off,
+// and debugging on.
+//
+// D3DCOMPILE_NO_PRESHADER
+// Disables Preshaders. Using this flag will cause the compiler to not
+// pull out static expression for evaluation on the host cpu
+//
+// D3DCOMPILE_AVOID_FLOW_CONTROL
+// Hint compiler to avoid flow-control constructs where possible.
+//
+// D3DCOMPILE_PREFER_FLOW_CONTROL
+// Hint compiler to prefer flow-control constructs where possible.
+//
+// D3DCOMPILE_ENABLE_STRICTNESS
+// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
+// Specifying this flag enables the strict mode. Deprecated syntax may be
+// removed in a future release, and enabling syntax is a good way to make
+// sure your shaders comply to the latest spec.
+//
+// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
+// This enables older shaders to compile to 4_0 targets.
+//
+//----------------------------------------------------------------------------
+
+#define D3DCOMPILE_DEBUG (1 << 0)
+#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
+#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
+#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
+#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
+#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
+#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
+#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
+#define D3DCOMPILE_NO_PRESHADER (1 << 8)
+#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
+#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
+#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
+#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
+#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
+#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
+#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
+#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
+#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
+#define D3DCOMPILE_RESERVED16 (1 << 16)
+#define D3DCOMPILE_RESERVED17 (1 << 17)
+#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
+#define D3DCOMPILE_RESOURCES_MAY_ALIAS (1 << 19)
+#define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)
+#define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21)
+
+//----------------------------------------------------------------------------
+// D3DCOMPILE_EFFECT flags:
+// -------------------------------------
+// These flags are passed in when creating an effect, and affect
+// either compilation behavior or runtime effect behavior
+//
+// D3DCOMPILE_EFFECT_CHILD_EFFECT
+// Compile this .fx file to a child effect. Child effects have no
+// initializers for any shared values as these are initialied in the
+// master effect (pool).
+//
+// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
+// By default, performance mode is enabled. Performance mode
+// disallows mutable state objects by preventing non-literal
+// expressions from appearing in state object definitions.
+// Specifying this flag will disable the mode and allow for mutable
+// state objects.
+//
+//----------------------------------------------------------------------------
+
+#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
+#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
+
+//----------------------------------------------------------------------------
+// D3DCompile:
+// ----------
+// Compile source text into bytecode appropriate for the given target.
+//----------------------------------------------------------------------------
+
+// D3D_COMPILE_STANDARD_FILE_INCLUDE can be passed for pInclude in any
+// API and indicates that a simple default include handler should be
+// used. The include handler will include files relative to the
+// current directory and files relative to the directory of the initial source
+// file. When used with APIs like D3DCompile pSourceName must be a
+// file name and the initial relative directory will be derived from it.
+#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
+
+HRESULT WINAPI
+D3DCompile(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_opt_ LPCSTR pSourceName,
+ _In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
+ _In_opt_ ID3DInclude* pInclude,
+ _In_opt_ LPCSTR pEntrypoint,
+ _In_ LPCSTR pTarget,
+ _In_ UINT Flags1,
+ _In_ UINT Flags2,
+ _Out_ ID3DBlob** ppCode,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
+
+typedef HRESULT (WINAPI *pD3DCompile)
+ (LPCVOID pSrcData,
+ SIZE_T SrcDataSize,
+ LPCSTR pFileName,
+ CONST D3D_SHADER_MACRO* pDefines,
+ ID3DInclude* pInclude,
+ LPCSTR pEntrypoint,
+ LPCSTR pTarget,
+ UINT Flags1,
+ UINT Flags2,
+ ID3DBlob** ppCode,
+ ID3DBlob** ppErrorMsgs);
+
+#define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001
+#define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002
+#define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
+
+HRESULT WINAPI
+D3DCompile2(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_opt_ LPCSTR pSourceName,
+ _In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
+ _In_opt_ ID3DInclude* pInclude,
+ _In_ LPCSTR pEntrypoint,
+ _In_ LPCSTR pTarget,
+ _In_ UINT Flags1,
+ _In_ UINT Flags2,
+ _In_ UINT SecondaryDataFlags,
+ _In_reads_bytes_opt_(SecondaryDataSize) LPCVOID pSecondaryData,
+ _In_ SIZE_T SecondaryDataSize,
+ _Out_ ID3DBlob** ppCode,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
+
+HRESULT WINAPI
+D3DCompileFromFile(_In_ LPCWSTR pFileName,
+ _In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
+ _In_opt_ ID3DInclude* pInclude,
+ _In_ LPCSTR pEntrypoint,
+ _In_ LPCSTR pTarget,
+ _In_ UINT Flags1,
+ _In_ UINT Flags2,
+ _Out_ ID3DBlob** ppCode,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
+
+//----------------------------------------------------------------------------
+// D3DPreprocess:
+// -------------
+// Process source text with the compiler's preprocessor and return
+// the resulting text.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DPreprocess(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_opt_ LPCSTR pSourceName,
+ _In_opt_ CONST D3D_SHADER_MACRO* pDefines,
+ _In_opt_ ID3DInclude* pInclude,
+ _Out_ ID3DBlob** ppCodeText,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
+
+typedef HRESULT (WINAPI *pD3DPreprocess)
+ (LPCVOID pSrcData,
+ SIZE_T SrcDataSize,
+ LPCSTR pFileName,
+ CONST D3D_SHADER_MACRO* pDefines,
+ ID3DInclude* pInclude,
+ ID3DBlob** ppCodeText,
+ ID3DBlob** ppErrorMsgs);
+
+//----------------------------------------------------------------------------
+// D3DGetDebugInfo:
+// -----------------------
+// Gets shader debug info. Debug info is generated by D3DCompile and is
+// embedded in the body of the shader.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DGetDebugInfo(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _Out_ ID3DBlob** ppDebugInfo);
+
+//----------------------------------------------------------------------------
+// D3DReflect:
+// ----------
+// Shader code contains metadata that can be inspected via the
+// reflection APIs.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DReflect(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ REFIID pInterface,
+ _Out_ void** ppReflector);
+
+//----------------------------------------------------------------------------
+// D3DReflectLibrary:
+// ----------
+// Library code contains metadata that can be inspected via the library
+// reflection APIs.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DReflectLibrary(__in_bcount(SrcDataSize) LPCVOID pSrcData,
+ __in SIZE_T SrcDataSize,
+ __in REFIID riid,
+ __out LPVOID * ppReflector);
+
+//----------------------------------------------------------------------------
+// D3DDisassemble:
+// ----------------------
+// Takes a binary shader and returns a buffer containing text assembly.
+//----------------------------------------------------------------------------
+
+#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
+#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
+#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
+#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
+#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
+#define D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 0x00000020
+#define D3D_DISASM_INSTRUCTION_ONLY 0x00000040
+#define D3D_DISASM_PRINT_HEX_LITERALS 0x00000080
+
+HRESULT WINAPI
+D3DDisassemble(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ UINT Flags,
+ _In_opt_ LPCSTR szComments,
+ _Out_ ID3DBlob** ppDisassembly);
+
+typedef HRESULT (WINAPI *pD3DDisassemble)
+ (_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ UINT Flags,
+ _In_opt_ LPCSTR szComments,
+ _Out_ ID3DBlob** ppDisassembly);
+
+HRESULT WINAPI
+D3DDisassembleRegion(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ UINT Flags,
+ _In_opt_ LPCSTR szComments,
+ _In_ SIZE_T StartByteOffset,
+ _In_ SIZE_T NumInsts,
+ _Out_opt_ SIZE_T* pFinishByteOffset,
+ _Out_ ID3DBlob** ppDisassembly);
+
+//----------------------------------------------------------------------------
+// Shader linking and Function Linking Graph (FLG) APIs
+//----------------------------------------------------------------------------
+HRESULT WINAPI
+D3DCreateLinker(__out interface ID3D11Linker ** ppLinker);
+
+HRESULT WINAPI
+D3DLoadModule(_In_ LPCVOID pSrcData,
+ _In_ SIZE_T cbSrcDataSize,
+ _Out_ interface ID3D11Module ** ppModule);
+
+HRESULT WINAPI
+D3DCreateFunctionLinkingGraph(_In_ UINT uFlags,
+ _Out_ interface ID3D11FunctionLinkingGraph ** ppFunctionLinkingGraph);
+
+//----------------------------------------------------------------------------
+// D3DGetTraceInstructionOffsets:
+// -----------------------
+// Determines byte offsets for instructions within a shader blob.
+// This information is useful for going between trace instruction
+// indices and byte offsets that are used in debug information.
+//----------------------------------------------------------------------------
+
+#define D3D_GET_INST_OFFSETS_INCLUDE_NON_EXECUTABLE 0x00000001
+
+HRESULT WINAPI
+D3DGetTraceInstructionOffsets(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ UINT Flags,
+ _In_ SIZE_T StartInstIndex,
+ _In_ SIZE_T NumInsts,
+ _Out_writes_to_opt_(NumInsts, min(NumInsts, *pTotalInsts)) SIZE_T* pOffsets,
+ _Out_opt_ SIZE_T* pTotalInsts);
+
+//----------------------------------------------------------------------------
+// D3DGetInputSignatureBlob:
+// -----------------------
+// Retrieve the input signature from a compilation result.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DGetInputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _Out_ ID3DBlob** ppSignatureBlob);
+
+//----------------------------------------------------------------------------
+// D3DGetOutputSignatureBlob:
+// -----------------------
+// Retrieve the output signature from a compilation result.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DGetOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _Out_ ID3DBlob** ppSignatureBlob);
+
+//----------------------------------------------------------------------------
+// D3DGetInputAndOutputSignatureBlob:
+// -----------------------
+// Retrieve the input and output signatures from a compilation result.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DGetInputAndOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _Out_ ID3DBlob** ppSignatureBlob);
+
+//----------------------------------------------------------------------------
+// D3DStripShader:
+// -----------------------
+// Removes unwanted blobs from a compilation result
+//----------------------------------------------------------------------------
+
+typedef enum D3DCOMPILER_STRIP_FLAGS
+{
+ D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001,
+ D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002,
+ D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004,
+ D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008,
+ D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010,
+ D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
+} D3DCOMPILER_STRIP_FLAGS;
+
+HRESULT WINAPI
+D3DStripShader(_In_reads_bytes_(BytecodeLength) LPCVOID pShaderBytecode,
+ _In_ SIZE_T BytecodeLength,
+ _In_ UINT uStripFlags,
+ _Out_ ID3DBlob** ppStrippedBlob);
+
+//----------------------------------------------------------------------------
+// D3DGetBlobPart:
+// -----------------------
+// Extracts information from a compilation result.
+//----------------------------------------------------------------------------
+
+typedef enum D3D_BLOB_PART
+{
+ D3D_BLOB_INPUT_SIGNATURE_BLOB,
+ D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
+ D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
+ D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
+ D3D_BLOB_ALL_SIGNATURE_BLOB,
+ D3D_BLOB_DEBUG_INFO,
+ D3D_BLOB_LEGACY_SHADER,
+ D3D_BLOB_XNA_PREPASS_SHADER,
+ D3D_BLOB_XNA_SHADER,
+ D3D_BLOB_PDB,
+ D3D_BLOB_PRIVATE_DATA,
+ D3D_BLOB_ROOT_SIGNATURE,
+
+ // Test parts are only produced by special compiler versions and so
+ // are usually not present in shaders.
+ D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
+ D3D_BLOB_TEST_COMPILE_DETAILS,
+ D3D_BLOB_TEST_COMPILE_PERF,
+ D3D_BLOB_TEST_COMPILE_REPORT,
+} D3D_BLOB_PART;
+
+HRESULT WINAPI
+D3DGetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ D3D_BLOB_PART Part,
+ _In_ UINT Flags,
+ _Out_ ID3DBlob** ppPart);
+
+//----------------------------------------------------------------------------
+// D3DSetBlobPart:
+// -----------------------
+// Update information in a compilation result.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DSetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ D3D_BLOB_PART Part,
+ _In_ UINT Flags,
+ _In_reads_bytes_(PartSize) LPCVOID pPart,
+ _In_ SIZE_T PartSize,
+ _Out_ ID3DBlob** ppNewShader);
+
+//----------------------------------------------------------------------------
+// D3DCreateBlob:
+// -----------------------
+// Create an ID3DBlob instance.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DCreateBlob(_In_ SIZE_T Size,
+ _Out_ ID3DBlob** ppBlob);
+
+//----------------------------------------------------------------------------
+// D3DCompressShaders:
+// -----------------------
+// Compresses a set of shaders into a more compact form.
+//----------------------------------------------------------------------------
+
+typedef struct _D3D_SHADER_DATA
+{
+ LPCVOID pBytecode;
+ SIZE_T BytecodeLength;
+} D3D_SHADER_DATA;
+
+#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
+
+HRESULT WINAPI
+D3DCompressShaders(_In_ UINT uNumShaders,
+ _In_reads_(uNumShaders) D3D_SHADER_DATA* pShaderData,
+ _In_ UINT uFlags,
+ _Out_ ID3DBlob** ppCompressedData);
+
+//----------------------------------------------------------------------------
+// D3DDecompressShaders:
+// -----------------------
+// Decompresses one or more shaders from a compressed set.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DDecompressShaders(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
+ _In_ SIZE_T SrcDataSize,
+ _In_ UINT uNumShaders,
+ _In_ UINT uStartIndex,
+ _In_reads_opt_(uNumShaders) UINT* pIndices,
+ _In_ UINT uFlags,
+ _Out_writes_(uNumShaders) ID3DBlob** ppShaders,
+ _Out_opt_ UINT* pTotalShaders);
+
+
+
+
+//----------------------------------------------------------------------------
+// D3DDisassemble10Effect:
+// -----------------------
+// Takes a D3D10 effect interface and returns a
+// buffer containing text assembly.
+//----------------------------------------------------------------------------
+
+HRESULT WINAPI
+D3DDisassemble10Effect(_In_ interface ID3D10Effect *pEffect,
+ _In_ UINT Flags,
+ _Out_ ID3DBlob** ppDisassembly);
+
+
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif // #ifndef __D3DCOMPILER_H__
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
new file mode 100644
index 00000000000..6b5e97d858a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
@@ -0,0 +1,1508 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) Microsoft Corporation. All Rights Reserved.
+//
+// File: d3dx12.h
+// Content: D3DX12 utility library
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef __D3DX12_H__
+#define __D3DX12_H__
+
+#include "d3d12.h"
+
+#if defined( __cplusplus )
+
+struct CD3DX12_DEFAULT {};
+extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT;
+
+//------------------------------------------------------------------------------------------------
+inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
+{
+ return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width &&
+ l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth;
+}
+
+//------------------------------------------------------------------------------------------------
+inline bool operator!=( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RECT : public D3D12_RECT
+{
+ CD3DX12_RECT()
+ {}
+ explicit CD3DX12_RECT( const D3D12_RECT& o ) :
+ D3D12_RECT( o )
+ {}
+ explicit CD3DX12_RECT(
+ LONG Left,
+ LONG Top,
+ LONG Right,
+ LONG Bottom )
+ {
+ left = Left;
+ top = Top;
+ right = Right;
+ bottom = Bottom;
+ }
+ ~CD3DX12_RECT() {}
+// operator const D3D12_RECT&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_BOX : public D3D12_BOX
+{
+ CD3DX12_BOX()
+ {}
+ explicit CD3DX12_BOX( const D3D12_BOX& o ) :
+ D3D12_BOX( o )
+ {}
+ explicit CD3DX12_BOX(
+ LONG Left,
+ LONG Right )
+ {
+ left = Left;
+ top = 0;
+ front = 0;
+ right = Right;
+ bottom = 1;
+ back = 1;
+ }
+ explicit CD3DX12_BOX(
+ LONG Left,
+ LONG Top,
+ LONG Right,
+ LONG Bottom )
+ {
+ left = Left;
+ top = Top;
+ front = 0;
+ right = Right;
+ bottom = Bottom;
+ back = 1;
+ }
+ explicit CD3DX12_BOX(
+ LONG Left,
+ LONG Top,
+ LONG Front,
+ LONG Right,
+ LONG Bottom,
+ LONG Back )
+ {
+ left = Left;
+ top = Top;
+ front = Front;
+ right = Right;
+ bottom = Bottom;
+ back = Back;
+ }
+ ~CD3DX12_BOX() {}
+// operator const D3D12_BOX&() const { return *this; }
+};
+inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r )
+{
+ return l.left == r.left && l.top == r.top && l.front == r.front &&
+ l.right == r.right && l.bottom == r.bottom && l.back == r.back;
+}
+inline bool operator!=( const D3D12_BOX& l, const D3D12_BOX& r )
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC
+{
+ CD3DX12_DEPTH_STENCIL_DESC()
+ {}
+ explicit CD3DX12_DEPTH_STENCIL_DESC( const D3D12_DEPTH_STENCIL_DESC& o ) :
+ D3D12_DEPTH_STENCIL_DESC( o )
+ {}
+ explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT )
+ {
+ DepthEnable = TRUE;
+ DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
+ DepthFunc = D3D12_COMPARISON_FUNC_LESS;
+ StencilEnable = FALSE;
+ StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK;
+ StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK;
+ const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp =
+ { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS };
+ FrontFace = defaultStencilOp;
+ BackFace = defaultStencilOp;
+ }
+ explicit CD3DX12_DEPTH_STENCIL_DESC(
+ BOOL depthEnable,
+ D3D12_DEPTH_WRITE_MASK depthWriteMask,
+ D3D12_COMPARISON_FUNC depthFunc,
+ BOOL stencilEnable,
+ UINT8 stencilReadMask,
+ UINT8 stencilWriteMask,
+ D3D12_STENCIL_OP frontStencilFailOp,
+ D3D12_STENCIL_OP frontStencilDepthFailOp,
+ D3D12_STENCIL_OP frontStencilPassOp,
+ D3D12_COMPARISON_FUNC frontStencilFunc,
+ D3D12_STENCIL_OP backStencilFailOp,
+ D3D12_STENCIL_OP backStencilDepthFailOp,
+ D3D12_STENCIL_OP backStencilPassOp,
+ D3D12_COMPARISON_FUNC backStencilFunc )
+ {
+ DepthEnable = depthEnable;
+ DepthWriteMask = depthWriteMask;
+ DepthFunc = depthFunc;
+ StencilEnable = stencilEnable;
+ StencilReadMask = stencilReadMask;
+ StencilWriteMask = stencilWriteMask;
+ FrontFace.StencilFailOp = frontStencilFailOp;
+ FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
+ FrontFace.StencilPassOp = frontStencilPassOp;
+ FrontFace.StencilFunc = frontStencilFunc;
+ BackFace.StencilFailOp = backStencilFailOp;
+ BackFace.StencilDepthFailOp = backStencilDepthFailOp;
+ BackFace.StencilPassOp = backStencilPassOp;
+ BackFace.StencilFunc = backStencilFunc;
+ }
+ ~CD3DX12_DEPTH_STENCIL_DESC() {}
+// operator const D3D12_DEPTH_STENCIL_DESC&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC
+{
+ CD3DX12_BLEND_DESC()
+ {}
+ explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) :
+ D3D12_BLEND_DESC( o )
+ {}
+ explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT )
+ {
+ AlphaToCoverageEnable = FALSE;
+ IndependentBlendEnable = FALSE;
+ const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc =
+ {
+ FALSE,FALSE,
+ D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
+ D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
+ D3D12_LOGIC_OP_NOOP,
+ D3D12_COLOR_WRITE_ENABLE_ALL,
+ };
+ for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
+ RenderTarget[ i ] = defaultRenderTargetBlendDesc;
+ }
+ ~CD3DX12_BLEND_DESC() {}
+// operator const D3D12_BLEND_DESC&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC
+{
+ CD3DX12_RASTERIZER_DESC()
+ {}
+ explicit CD3DX12_RASTERIZER_DESC( const D3D12_RASTERIZER_DESC& o ) :
+ D3D12_RASTERIZER_DESC( o )
+ {}
+ explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT )
+ {
+ FillMode = D3D12_FILL_MODE_SOLID;
+ CullMode = D3D12_CULL_MODE_BACK;
+ FrontCounterClockwise = FALSE;
+ DepthBias = D3D12_DEFAULT_DEPTH_BIAS;
+ DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP;
+ SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
+ DepthClipEnable = TRUE;
+ MultisampleEnable = FALSE;
+ AntialiasedLineEnable = FALSE;
+ ForcedSampleCount = 0;
+ ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
+ }
+ explicit CD3DX12_RASTERIZER_DESC(
+ D3D12_FILL_MODE fillMode,
+ D3D12_CULL_MODE cullMode,
+ BOOL frontCounterClockwise,
+ INT depthBias,
+ FLOAT depthBiasClamp,
+ FLOAT slopeScaledDepthBias,
+ BOOL depthClipEnable,
+ BOOL multisampleEnable,
+ BOOL antialiasedLineEnable,
+ UINT forcedSampleCount,
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster)
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ MultisampleEnable = multisampleEnable;
+ AntialiasedLineEnable = antialiasedLineEnable;
+ ForcedSampleCount = forcedSampleCount;
+ ConservativeRaster = conservativeRaster;
+ }
+ ~CD3DX12_RASTERIZER_DESC() {}
+// operator const D3D12_RASTERIZER_DESC&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO
+{
+ CD3DX12_RESOURCE_ALLOCATION_INFO()
+ {}
+ explicit CD3DX12_RESOURCE_ALLOCATION_INFO( const D3D12_RESOURCE_ALLOCATION_INFO& o ) :
+ D3D12_RESOURCE_ALLOCATION_INFO( o )
+ {}
+ CD3DX12_RESOURCE_ALLOCATION_INFO(
+ UINT64 size,
+ UINT64 alignment )
+ {
+ SizeInBytes = size;
+ Alignment = alignment;
+ }
+// operator const D3D12_RESOURCE_ALLOCATION_INFO&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES
+{
+ CD3DX12_HEAP_PROPERTIES()
+ {}
+ explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES &o) :
+ D3D12_HEAP_PROPERTIES(o)
+ {}
+ CD3DX12_HEAP_PROPERTIES(
+ D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
+ D3D12_MEMORY_POOL memoryPoolPreference,
+ UINT creationNodeMask = 1,
+ UINT nodeMask = 1 )
+ {
+ Type = D3D12_HEAP_TYPE_CUSTOM;
+ CPUPageProperty = cpuPageProperty;
+ MemoryPoolPreference = memoryPoolPreference;
+ CreationNodeMask = creationNodeMask;
+ VisibleNodeMask = nodeMask;
+ }
+ explicit CD3DX12_HEAP_PROPERTIES(
+ D3D12_HEAP_TYPE type,
+ UINT creationNodeMask = 1,
+ UINT nodeMask = 1 )
+ {
+ Type = type;
+ CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
+ MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
+ CreationNodeMask = creationNodeMask;
+ VisibleNodeMask = nodeMask;
+ }
+// operator const D3D12_HEAP_PROPERTIES&() const { return *this; }
+ bool IsCPUAccessible() const
+ {
+ return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM &&
+ (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK));
+ }
+};
+inline bool operator==( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
+{
+ return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty &&
+ l.MemoryPoolPreference == r.MemoryPoolPreference &&
+ l.CreationNodeMask == r.CreationNodeMask &&
+ l.VisibleNodeMask == r.VisibleNodeMask;
+}
+inline bool operator!=( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
+{
+ CD3DX12_HEAP_DESC()
+ {}
+ explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) :
+ D3D12_HEAP_DESC(o)
+ {}
+ CD3DX12_HEAP_DESC(
+ UINT64 size,
+ D3D12_HEAP_PROPERTIES properties,
+ UINT64 alignment = 0,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = size;
+ Properties = properties;
+ Alignment = alignment;
+ Flags = flags;
+ }
+ CD3DX12_HEAP_DESC(
+ UINT64 size,
+ D3D12_HEAP_TYPE type,
+ UINT64 alignment = 0,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = size;
+ Properties = CD3DX12_HEAP_PROPERTIES( type );
+ Alignment = alignment;
+ Flags = flags;
+ }
+ CD3DX12_HEAP_DESC(
+ UINT64 size,
+ D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
+ D3D12_MEMORY_POOL memoryPoolPreference,
+ UINT64 alignment = 0,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = size;
+ Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
+ Alignment = alignment;
+ Flags = flags;
+ }
+ CD3DX12_HEAP_DESC(
+ const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
+ D3D12_HEAP_PROPERTIES properties,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = resAllocInfo.SizeInBytes;
+ Properties = properties;
+ Alignment = resAllocInfo.Alignment;
+ Flags = flags;
+ }
+ CD3DX12_HEAP_DESC(
+ const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
+ D3D12_HEAP_TYPE type,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = resAllocInfo.SizeInBytes;
+ Properties = CD3DX12_HEAP_PROPERTIES( type );
+ Alignment = resAllocInfo.Alignment;
+ Flags = flags;
+ }
+ CD3DX12_HEAP_DESC(
+ const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
+ D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
+ D3D12_MEMORY_POOL memoryPoolPreference,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
+ {
+ SizeInBytes = resAllocInfo.SizeInBytes;
+ Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
+ Alignment = resAllocInfo.Alignment;
+ Flags = flags;
+ }
+// operator const D3D12_HEAP_DESC&() const { return *this; }
+ bool IsCPUAccessible() const
+ { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
+};
+inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
+{
+ return l.SizeInBytes == r.SizeInBytes &&
+ l.Properties == r.Properties &&
+ l.Alignment == r.Alignment &&
+ l.Flags == r.Flags;
+}
+inline bool operator!=( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
+{
+ CD3DX12_CLEAR_VALUE()
+ {}
+ explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) :
+ D3D12_CLEAR_VALUE(o)
+ {}
+ CD3DX12_CLEAR_VALUE(
+ DXGI_FORMAT format,
+ const FLOAT color[4] )
+ {
+ Format = format;
+ memcpy( Color, color, sizeof( Color ) );
+ }
+ CD3DX12_CLEAR_VALUE(
+ DXGI_FORMAT format,
+ FLOAT depth,
+ UINT8 stencil )
+ {
+ Format = format;
+ /* Use memcpy to preserve NAN values */
+ memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) );
+ DepthStencil.Stencil = stencil;
+ }
+// operator const D3D12_CLEAR_VALUE&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RANGE : public D3D12_RANGE
+{
+ CD3DX12_RANGE()
+ {}
+ explicit CD3DX12_RANGE(const D3D12_RANGE &o) :
+ D3D12_RANGE(o)
+ {}
+ CD3DX12_RANGE(
+ SIZE_T begin,
+ SIZE_T end )
+ {
+ Begin = begin;
+ End = end;
+ }
+// operator const D3D12_RANGE&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE
+{
+ CD3DX12_TILED_RESOURCE_COORDINATE()
+ {}
+ explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE &o) :
+ D3D12_TILED_RESOURCE_COORDINATE(o)
+ {}
+ CD3DX12_TILED_RESOURCE_COORDINATE(
+ UINT x,
+ UINT y,
+ UINT z,
+ UINT subresource )
+ {
+ X = x;
+ Y = y;
+ Z = z;
+ Subresource = subresource;
+ }
+// operator const D3D12_TILED_RESOURCE_COORDINATE&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE
+{
+ CD3DX12_TILE_REGION_SIZE()
+ {}
+ explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE &o) :
+ D3D12_TILE_REGION_SIZE(o)
+ {}
+ CD3DX12_TILE_REGION_SIZE(
+ UINT numTiles,
+ BOOL useBox,
+ UINT width,
+ UINT16 height,
+ UINT16 depth )
+ {
+ NumTiles = numTiles;
+ UseBox = useBox;
+ Width = width;
+ Height = height;
+ Depth = depth;
+ }
+// operator const D3D12_TILE_REGION_SIZE&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING
+{
+ CD3DX12_SUBRESOURCE_TILING()
+ {}
+ explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING &o) :
+ D3D12_SUBRESOURCE_TILING(o)
+ {}
+ CD3DX12_SUBRESOURCE_TILING(
+ UINT widthInTiles,
+ UINT16 heightInTiles,
+ UINT16 depthInTiles,
+ UINT startTileIndexInOverallResource )
+ {
+ WidthInTiles = widthInTiles;
+ HeightInTiles = heightInTiles;
+ DepthInTiles = depthInTiles;
+ StartTileIndexInOverallResource = startTileIndexInOverallResource;
+ }
+// operator const D3D12_SUBRESOURCE_TILING&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE
+{
+ CD3DX12_TILE_SHAPE()
+ {}
+ explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE &o) :
+ D3D12_TILE_SHAPE(o)
+ {}
+ CD3DX12_TILE_SHAPE(
+ UINT widthInTexels,
+ UINT heightInTexels,
+ UINT depthInTexels )
+ {
+ WidthInTexels = widthInTexels;
+ HeightInTexels = heightInTexels;
+ DepthInTexels = depthInTexels;
+ }
+// operator const D3D12_TILE_SHAPE&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
+{
+ CD3DX12_RESOURCE_BARRIER()
+ {}
+ explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) :
+ D3D12_RESOURCE_BARRIER(o)
+ {}
+ static inline CD3DX12_RESOURCE_BARRIER Transition(
+ _In_ ID3D12Resource* pResource,
+ D3D12_RESOURCE_STATES stateBefore,
+ D3D12_RESOURCE_STATES stateAfter,
+ UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,
+ D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE)
+ {
+ CD3DX12_RESOURCE_BARRIER result;
+ ZeroMemory(&result, sizeof(result));
+ D3D12_RESOURCE_BARRIER &barrier = result;
+ result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
+ result.Flags = flags;
+ barrier.Transition.pResource = pResource;
+ barrier.Transition.StateBefore = stateBefore;
+ barrier.Transition.StateAfter = stateAfter;
+ barrier.Transition.Subresource = subresource;
+ return result;
+ }
+ static inline CD3DX12_RESOURCE_BARRIER Aliasing(
+ _In_ ID3D12Resource* pResourceBefore,
+ _In_ ID3D12Resource* pResourceAfter)
+ {
+ CD3DX12_RESOURCE_BARRIER result;
+ ZeroMemory(&result, sizeof(result));
+ D3D12_RESOURCE_BARRIER &barrier = result;
+ result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING;
+ barrier.Aliasing.pResourceBefore = pResourceBefore;
+ barrier.Aliasing.pResourceAfter = pResourceAfter;
+ return result;
+ }
+ static inline CD3DX12_RESOURCE_BARRIER UAV(
+ _In_ ID3D12Resource* pResource)
+ {
+ CD3DX12_RESOURCE_BARRIER result;
+ ZeroMemory(&result, sizeof(result));
+ D3D12_RESOURCE_BARRIER &barrier = result;
+ result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
+ barrier.UAV.pResource = pResource;
+ return result;
+ }
+// operator const D3D12_RESOURCE_BARRIER&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO
+{
+ CD3DX12_PACKED_MIP_INFO()
+ {}
+ explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO &o) :
+ D3D12_PACKED_MIP_INFO(o)
+ {}
+ CD3DX12_PACKED_MIP_INFO(
+ UINT8 numStandardMips,
+ UINT8 numPackedMips,
+ UINT numTilesForPackedMips,
+ UINT startTileIndexInOverallResource )
+ {
+ NumStandardMips = numStandardMips;
+ NumPackedMips = numPackedMips;
+ NumTilesForPackedMips = numTilesForPackedMips;
+ StartTileIndexInOverallResource = startTileIndexInOverallResource;
+ }
+// operator const D3D12_PACKED_MIP_INFO&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
+{
+ CD3DX12_SUBRESOURCE_FOOTPRINT()
+ {}
+ explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT &o) :
+ D3D12_SUBRESOURCE_FOOTPRINT(o)
+ {}
+ CD3DX12_SUBRESOURCE_FOOTPRINT(
+ DXGI_FORMAT format,
+ UINT width,
+ UINT height,
+ UINT depth,
+ UINT rowPitch )
+ {
+ Format = format;
+ Width = width;
+ Height = height;
+ Depth = depth;
+ RowPitch = rowPitch;
+ }
+ explicit CD3DX12_SUBRESOURCE_FOOTPRINT(
+ const D3D12_RESOURCE_DESC& resDesc,
+ UINT rowPitch )
+ {
+ Format = resDesc.Format;
+ Width = UINT( resDesc.Width );
+ Height = resDesc.Height;
+ Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1);
+ RowPitch = rowPitch;
+ }
+// operator const D3D12_SUBRESOURCE_FOOTPRINT&() const { return *this; }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION
+{
+ CD3DX12_TEXTURE_COPY_LOCATION()
+ {}
+ explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION &o) :
+ D3D12_TEXTURE_COPY_LOCATION(o)
+ {}
+ CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes) { pResource = pRes; }
+ CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint)
+ {
+ pResource = pRes;
+ Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ PlacedFootprint = Footprint;
+ }
+ CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes, UINT Sub)
+ {
+ pResource = pRes;
+ Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ SubresourceIndex = Sub;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
+{
+ CD3DX12_DESCRIPTOR_RANGE() { }
+ explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) :
+ D3D12_DESCRIPTOR_RANGE(o)
+ {}
+ CD3DX12_DESCRIPTOR_RANGE(
+ D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
+ UINT numDescriptors,
+ UINT baseShaderRegister,
+ UINT registerSpace = 0,
+ UINT offsetInDescriptorsFromTableStart =
+ D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
+ {
+ Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
+ }
+
+ inline void Init(
+ D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
+ UINT numDescriptors,
+ UINT baseShaderRegister,
+ UINT registerSpace = 0,
+ UINT offsetInDescriptorsFromTableStart =
+ D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
+ {
+ Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_DESCRIPTOR_RANGE &range,
+ D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
+ UINT numDescriptors,
+ UINT baseShaderRegister,
+ UINT registerSpace = 0,
+ UINT offsetInDescriptorsFromTableStart =
+ D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
+ {
+ range.RangeType = rangeType;
+ range.NumDescriptors = numDescriptors;
+ range.BaseShaderRegister = baseShaderRegister;
+ range.RegisterSpace = registerSpace;
+ range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE
+{
+ CD3DX12_ROOT_DESCRIPTOR_TABLE() {}
+ explicit CD3DX12_ROOT_DESCRIPTOR_TABLE(const D3D12_ROOT_DESCRIPTOR_TABLE &o) :
+ D3D12_ROOT_DESCRIPTOR_TABLE(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR_TABLE(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
+ {
+ Init(numDescriptorRanges, _pDescriptorRanges);
+ }
+
+ inline void Init(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
+ {
+ Init(*this, numDescriptorRanges, _pDescriptorRanges);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_ROOT_DESCRIPTOR_TABLE &rootDescriptorTable,
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
+ {
+ rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges;
+ rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS
+{
+ CD3DX12_ROOT_CONSTANTS() {}
+ explicit CD3DX12_ROOT_CONSTANTS(const D3D12_ROOT_CONSTANTS &o) :
+ D3D12_ROOT_CONSTANTS(o)
+ {}
+ CD3DX12_ROOT_CONSTANTS(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0)
+ {
+ Init(num32BitValues, shaderRegister, registerSpace);
+ }
+
+ inline void Init(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0)
+ {
+ Init(*this, num32BitValues, shaderRegister, registerSpace);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_ROOT_CONSTANTS &rootConstants,
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0)
+ {
+ rootConstants.Num32BitValues = num32BitValues;
+ rootConstants.ShaderRegister = shaderRegister;
+ rootConstants.RegisterSpace = registerSpace;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR
+{
+ CD3DX12_ROOT_DESCRIPTOR() {}
+ explicit CD3DX12_ROOT_DESCRIPTOR(const D3D12_ROOT_DESCRIPTOR &o) :
+ D3D12_ROOT_DESCRIPTOR(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR(
+ UINT shaderRegister,
+ UINT registerSpace = 0)
+ {
+ Init(shaderRegister, registerSpace);
+ }
+
+ inline void Init(
+ UINT shaderRegister,
+ UINT registerSpace = 0)
+ {
+ Init(*this, shaderRegister, registerSpace);
+ }
+
+ static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0)
+ {
+ table.ShaderRegister = shaderRegister;
+ table.RegisterSpace = registerSpace;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER
+{
+ CD3DX12_ROOT_PARAMETER() {}
+ explicit CD3DX12_ROOT_PARAMETER(const D3D12_ROOT_PARAMETER &o) :
+ D3D12_ROOT_PARAMETER(o)
+ {}
+
+ static inline void InitAsDescriptorTable(
+ _Out_ D3D12_ROOT_PARAMETER &rootParam,
+ UINT numDescriptorRanges,
+ _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
+ rootParam.ShaderVisibility = visibility;
+ CD3DX12_ROOT_DESCRIPTOR_TABLE::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges);
+ }
+
+ static inline void InitAsConstants(
+ _Out_ D3D12_ROOT_PARAMETER &rootParam,
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
+ rootParam.ShaderVisibility = visibility;
+ CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace);
+ }
+
+ static inline void InitAsConstantBufferView(
+ _Out_ D3D12_ROOT_PARAMETER &rootParam,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
+ rootParam.ShaderVisibility = visibility;
+ CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
+ }
+
+ static inline void InitAsShaderResourceView(
+ _Out_ D3D12_ROOT_PARAMETER &rootParam,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV;
+ rootParam.ShaderVisibility = visibility;
+ CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
+ }
+
+ static inline void InitAsUnorderedAccessView(
+ _Out_ D3D12_ROOT_PARAMETER &rootParam,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
+ rootParam.ShaderVisibility = visibility;
+ CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
+ }
+
+ inline void InitAsDescriptorTable(
+ UINT numDescriptorRanges,
+ _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
+ }
+
+ inline void InitAsConstants(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsConstantBufferView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsShaderResourceView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsUnorderedAccessView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
+ {
+ InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, visibility);
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC
+{
+ CD3DX12_STATIC_SAMPLER_DESC() {}
+ explicit CD3DX12_STATIC_SAMPLER_DESC(const D3D12_STATIC_SAMPLER_DESC &o) :
+ D3D12_STATIC_SAMPLER_DESC(o)
+ {}
+ CD3DX12_STATIC_SAMPLER_DESC(
+ UINT shaderRegister,
+ D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
+ D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ FLOAT mipLODBias = 0,
+ UINT maxAnisotropy = 16,
+ D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
+ D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
+ FLOAT minLOD = 0.f,
+ FLOAT maxLOD = D3D12_FLOAT32_MAX,
+ D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
+ UINT registerSpace = 0)
+ {
+ Init(
+ shaderRegister,
+ filter,
+ addressU,
+ addressV,
+ addressW,
+ mipLODBias,
+ maxAnisotropy,
+ comparisonFunc,
+ borderColor,
+ minLOD,
+ maxLOD,
+ shaderVisibility,
+ registerSpace);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_STATIC_SAMPLER_DESC &samplerDesc,
+ UINT shaderRegister,
+ D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
+ D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ FLOAT mipLODBias = 0,
+ UINT maxAnisotropy = 16,
+ D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
+ D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
+ FLOAT minLOD = 0.f,
+ FLOAT maxLOD = D3D12_FLOAT32_MAX,
+ D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
+ UINT registerSpace = 0)
+ {
+ samplerDesc.ShaderRegister = shaderRegister;
+ samplerDesc.Filter = filter;
+ samplerDesc.AddressU = addressU;
+ samplerDesc.AddressV = addressV;
+ samplerDesc.AddressW = addressW;
+ samplerDesc.MipLODBias = mipLODBias;
+ samplerDesc.MaxAnisotropy = maxAnisotropy;
+ samplerDesc.ComparisonFunc = comparisonFunc;
+ samplerDesc.BorderColor = borderColor;
+ samplerDesc.MinLOD = minLOD;
+ samplerDesc.MaxLOD = maxLOD;
+ samplerDesc.ShaderVisibility = shaderVisibility;
+ samplerDesc.RegisterSpace = registerSpace;
+ }
+ inline void Init(
+ UINT shaderRegister,
+ D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
+ D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ FLOAT mipLODBias = 0,
+ UINT maxAnisotropy = 16,
+ D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
+ D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
+ FLOAT minLOD = 0.f,
+ FLOAT maxLOD = D3D12_FLOAT32_MAX,
+ D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
+ UINT registerSpace = 0)
+ {
+ Init(
+ *this,
+ shaderRegister,
+ filter,
+ addressU,
+ addressV,
+ addressW,
+ mipLODBias,
+ maxAnisotropy,
+ comparisonFunc,
+ borderColor,
+ minLOD,
+ maxLOD,
+ shaderVisibility,
+ registerSpace);
+ }
+
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC
+{
+ CD3DX12_ROOT_SIGNATURE_DESC() {}
+ explicit CD3DX12_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) :
+ D3D12_ROOT_SIGNATURE_DESC(o)
+ {}
+ CD3DX12_ROOT_SIGNATURE_DESC(
+ UINT numParameters,
+ _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
+ UINT numStaticSamplers = 0,
+ _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
+ D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
+ {
+ Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
+ }
+ CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
+ {
+ Init(0, NULL, 0, NULL, D3D12_ROOT_SIGNATURE_FLAG_NONE);
+ }
+
+ inline void Init(
+ UINT numParameters,
+ _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
+ UINT numStaticSamplers = 0,
+ _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
+ D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
+ {
+ Init(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_ROOT_SIGNATURE_DESC &desc,
+ UINT numParameters,
+ _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
+ UINT numStaticSamplers = 0,
+ _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
+ D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
+ {
+ desc.NumParameters = numParameters;
+ desc.pParameters = _pParameters;
+ desc.NumStaticSamplers = numStaticSamplers;
+ desc.pStaticSamplers = _pStaticSamplers;
+ desc.Flags = flags;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE
+{
+ CD3DX12_CPU_DESCRIPTOR_HANDLE() {}
+ explicit CD3DX12_CPU_DESCRIPTOR_HANDLE(const D3D12_CPU_DESCRIPTOR_HANDLE &o) :
+ D3D12_CPU_DESCRIPTOR_HANDLE(o)
+ {}
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
+ {
+ InitOffsetted(other, offsetScaledByIncrementSize);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ ptr += offsetInDescriptors * descriptorIncrementSize;
+ return *this;
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize)
+ {
+ ptr += offsetScaledByIncrementSize;
+ return *this;
+ }
+ bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other)
+ {
+ return (ptr == other.ptr);
+ }
+ bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other)
+ {
+ return (ptr != other.ptr);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other)
+ {
+ ptr = other.ptr;
+ return *this;
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
+ {
+ InitOffsetted(*this, base, offsetScaledByIncrementSize);
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
+ {
+ handle.ptr = base.ptr + offsetScaledByIncrementSize;
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ handle.ptr = base.ptr + offsetInDescriptors * descriptorIncrementSize;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
+{
+ CD3DX12_GPU_DESCRIPTOR_HANDLE() {}
+ explicit CD3DX12_GPU_DESCRIPTOR_HANDLE(const D3D12_GPU_DESCRIPTOR_HANDLE &o) :
+ D3D12_GPU_DESCRIPTOR_HANDLE(o)
+ {}
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
+ {
+ InitOffsetted(other, offsetScaledByIncrementSize);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ ptr += offsetInDescriptors * descriptorIncrementSize;
+ return *this;
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize)
+ {
+ ptr += offsetScaledByIncrementSize;
+ return *this;
+ }
+ inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other)
+ {
+ return (ptr == other.ptr);
+ }
+ inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other)
+ {
+ return (ptr != other.ptr);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other)
+ {
+ ptr = other.ptr;
+ return *this;
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
+ {
+ InitOffsetted(*this, base, offsetScaledByIncrementSize);
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
+ {
+ handle.ptr = base.ptr + offsetScaledByIncrementSize;
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
+ {
+ handle.ptr = base.ptr + offsetInDescriptors * descriptorIncrementSize;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+inline UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize )
+{
+ return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize;
+}
+
+//------------------------------------------------------------------------------------------------
+template <typename T, typename U, typename V>
+inline void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT ArraySize, _Out_ T& MipSlice, _Out_ U& ArraySlice, _Out_ V& PlaneSlice )
+{
+ MipSlice = static_cast<T>(Subresource % MipLevels);
+ ArraySlice = static_cast<U>((Subresource / MipLevels) % ArraySize);
+ PlaneSlice = static_cast<V>(Subresource / (MipLevels * ArraySize));
+}
+
+//------------------------------------------------------------------------------------------------
+inline UINT8 D3D12GetFormatPlaneCount(
+ _In_ ID3D12Device* pDevice,
+ DXGI_FORMAT Format
+ )
+{
+ D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = {Format};
+ if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo))))
+ {
+ return 0;
+ }
+ return formatInfo.PlaneCount;
+}
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
+{
+ CD3DX12_RESOURCE_DESC()
+ {}
+ explicit CD3DX12_RESOURCE_DESC( const D3D12_RESOURCE_DESC& o ) :
+ D3D12_RESOURCE_DESC( o )
+ {}
+ CD3DX12_RESOURCE_DESC(
+ D3D12_RESOURCE_DIMENSION dimension,
+ UINT64 alignment,
+ UINT64 width,
+ UINT height,
+ UINT16 depthOrArraySize,
+ UINT16 mipLevels,
+ DXGI_FORMAT format,
+ UINT sampleCount,
+ UINT sampleQuality,
+ D3D12_TEXTURE_LAYOUT layout,
+ D3D12_RESOURCE_FLAGS flags )
+ {
+ Dimension = dimension;
+ Alignment = alignment;
+ Width = width;
+ Height = height;
+ DepthOrArraySize = depthOrArraySize;
+ MipLevels = mipLevels;
+ Format = format;
+ SampleDesc.Count = sampleCount;
+ SampleDesc.Quality = sampleQuality;
+ Layout = layout;
+ Flags = flags;
+ }
+ static inline CD3DX12_RESOURCE_DESC Buffer(
+ const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
+ D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE )
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes,
+ 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
+ }
+ static inline CD3DX12_RESOURCE_DESC Buffer(
+ UINT64 width,
+ D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
+ UINT64 alignment = 0 )
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1,
+ DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
+ }
+ static inline CD3DX12_RESOURCE_DESC Tex1D(
+ DXGI_FORMAT format,
+ UINT64 width,
+ UINT16 arraySize = 1,
+ UINT16 mipLevels = 0,
+ D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
+ D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
+ UINT64 alignment = 0 )
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize,
+ mipLevels, format, 1, 0, layout, flags );
+ }
+ static inline CD3DX12_RESOURCE_DESC Tex2D(
+ DXGI_FORMAT format,
+ UINT64 width,
+ UINT height,
+ UINT16 arraySize = 1,
+ UINT16 mipLevels = 0,
+ UINT sampleCount = 1,
+ UINT sampleQuality = 0,
+ D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
+ D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
+ UINT64 alignment = 0 )
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize,
+ mipLevels, format, sampleCount, sampleQuality, layout, flags );
+ }
+ static inline CD3DX12_RESOURCE_DESC Tex3D(
+ DXGI_FORMAT format,
+ UINT64 width,
+ UINT height,
+ UINT16 depth,
+ UINT16 mipLevels = 0,
+ D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
+ D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
+ UINT64 alignment = 0 )
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth,
+ mipLevels, format, 1, 0, layout, flags );
+ }
+ inline UINT16 Depth() const
+ { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
+ inline UINT16 ArraySize() const
+ { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
+ inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
+ { return D3D12GetFormatPlaneCount(pDevice, Format); }
+ inline UINT Subresources(_In_ ID3D12Device* pDevice) const
+ { return MipLevels * ArraySize() * PlaneCount(pDevice); }
+ inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)
+ { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
+// operator const D3D12_RESOURCE_DESC&() const { return *this; }
+};
+inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
+{
+ return l.Dimension == r.Dimension &&
+ l.Alignment == r.Alignment &&
+ l.Width == r.Width &&
+ l.Height == r.Height &&
+ l.DepthOrArraySize == r.DepthOrArraySize &&
+ l.MipLevels == r.MipLevels &&
+ l.Format == r.Format &&
+ l.SampleDesc.Count == r.SampleDesc.Count &&
+ l.SampleDesc.Quality == r.SampleDesc.Quality &&
+ l.Layout == r.Layout &&
+ l.Flags == r.Flags;
+}
+inline bool operator!=( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+// Row-by-row memcpy
+inline void MemcpySubresource(
+ _In_ const D3D12_MEMCPY_DEST* pDest,
+ _In_ const D3D12_SUBRESOURCE_DATA* pSrc,
+ SIZE_T RowSizeInBytes,
+ UINT NumRows,
+ UINT NumSlices)
+{
+ for (UINT z = 0; z < NumSlices; ++z)
+ {
+ BYTE* pDestSlice = reinterpret_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
+ const BYTE* pSrcSlice = reinterpret_cast<const BYTE*>(pSrc->pData) + pSrc->SlicePitch * z;
+ for (UINT y = 0; y < NumRows; ++y)
+ {
+ memcpy(pDestSlice + pDest->RowPitch * y,
+ pSrcSlice + pSrc->RowPitch * y,
+ RowSizeInBytes);
+ }
+ }
+}
+
+//------------------------------------------------------------------------------------------------
+// Returns required size of a buffer to be used for data upload
+inline UINT64 GetRequiredIntermediateSize(
+ _In_ ID3D12Resource* pDestinationResource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources)
+{
+ D3D12_RESOURCE_DESC Desc = pDestinationResource->GetDesc();
+ UINT64 RequiredSize = 0;
+
+ ID3D12Device* pDevice;
+ pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
+ pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize);
+ pDevice->Release();
+
+ return RequiredSize;
+}
+
+//------------------------------------------------------------------------------------------------
+// All arrays must be populated (e.g. by calling GetCopyableFootprints)
+inline UINT64 UpdateSubresources(
+ _In_ ID3D12GraphicsCommandList* pCmdList,
+ _In_ ID3D12Resource* pDestinationResource,
+ _In_ ID3D12Resource* pIntermediate,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 RequiredSize,
+ _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts,
+ _In_reads_(NumSubresources) const UINT* pNumRows,
+ _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes,
+ _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData)
+{
+ // Minor validation
+ D3D12_RESOURCE_DESC IntermediateDesc = pIntermediate->GetDesc();
+ D3D12_RESOURCE_DESC DestinationDesc = pDestinationResource->GetDesc();
+ if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER ||
+ IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset ||
+ RequiredSize > (SIZE_T)-1 ||
+ (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER &&
+ (FirstSubresource != 0 || NumSubresources != 1)))
+ {
+ return 0;
+ }
+
+ BYTE* pData;
+ HRESULT hr = pIntermediate->Map(0, NULL, reinterpret_cast<void**>(&pData));
+ if (FAILED(hr))
+ {
+ return 0;
+ }
+
+ for (UINT i = 0; i < NumSubresources; ++i)
+ {
+ if (pRowSizesInBytes[i] > (SIZE_T)-1) return 0;
+ D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, pLayouts[i].Footprint.RowPitch * pNumRows[i] };
+ MemcpySubresource(&DestData, &pSrcData[i], (SIZE_T)pRowSizesInBytes[i], pNumRows[i], pLayouts[i].Footprint.Depth);
+ }
+ pIntermediate->Unmap(0, NULL);
+
+ if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
+ {
+ CD3DX12_BOX SrcBox( UINT( pLayouts[0].Offset ), UINT( pLayouts[0].Offset + pLayouts[0].Footprint.Width ) );
+ pCmdList->CopyBufferRegion(
+ pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width);
+ }
+ else
+ {
+ for (UINT i = 0; i < NumSubresources; ++i)
+ {
+ CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
+ CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]);
+ pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr);
+ }
+ }
+ return RequiredSize;
+}
+
+//------------------------------------------------------------------------------------------------
+// Heap-allocating UpdateSubresources implementation
+inline UINT64 UpdateSubresources(
+ _In_ ID3D12GraphicsCommandList* pCmdList,
+ _In_ ID3D12Resource* pDestinationResource,
+ _In_ ID3D12Resource* pIntermediate,
+ UINT64 IntermediateOffset,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
+{
+ UINT64 RequiredSize = 0;
+ UINT64 MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
+ if (MemToAlloc > SIZE_MAX)
+ {
+ return 0;
+ }
+ void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast<SIZE_T>(MemToAlloc));
+ if (pMem == NULL)
+ {
+ return 0;
+ }
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts = reinterpret_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
+ UINT64* pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
+ UINT* pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
+
+ D3D12_RESOURCE_DESC Desc = pDestinationResource->GetDesc();
+ ID3D12Device* pDevice;
+ pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
+ pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
+ pDevice->Release();
+
+ UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
+ HeapFree(GetProcessHeap(), 0, pMem);
+ return Result;
+}
+
+//------------------------------------------------------------------------------------------------
+// Stack-allocating UpdateSubresources implementation
+template <UINT MaxSubresources>
+inline UINT64 UpdateSubresources(
+ _In_ ID3D12GraphicsCommandList* pCmdList,
+ _In_ ID3D12Resource* pDestinationResource,
+ _In_ ID3D12Resource* pIntermediate,
+ UINT64 IntermediateOffset,
+ _In_range_(0, MaxSubresources) UINT FirstSubresource,
+ _In_range_(1, MaxSubresources - FirstSubresource) UINT NumSubresources,
+ _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
+{
+ UINT64 RequiredSize = 0;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
+ UINT NumRows[MaxSubresources];
+ UINT64 RowSizesInBytes[MaxSubresources];
+
+ D3D12_RESOURCE_DESC Desc = pDestinationResource->GetDesc();
+ ID3D12Device* pDevice;
+ pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
+ pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize);
+ pDevice->Release();
+
+ return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pSrcData);
+}
+
+//------------------------------------------------------------------------------------------------
+inline bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout )
+{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; }
+
+//------------------------------------------------------------------------------------------------
+inline ID3D12CommandList * const * CommandListCast(ID3D12GraphicsCommandList * const * pp)
+{
+ // This cast is useful for passing strongly typed command list pointers into
+ // ExecuteCommandLists.
+ // This cast is valid as long as the const-ness is respected. D3D12 APIs do
+ // respect the const-ness of their arguments.
+ return reinterpret_cast<ID3D12CommandList * const *>(pp);
+}
+
+
+#endif // defined( __cplusplus )
+
+#endif //__D3DX12_H__
+
+
+
diff --git a/3rdparty/dxsdk/Include/DXGI.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h
index b13ba688749..e3b9817340b 100644
--- a/3rdparty/dxsdk/Include/DXGI.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h
@@ -3,17 +3,14 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 7.00.0555 */
+ /* File created by MIDL compiler version 8.00.0613 */
/* @@MIDL_FILE_HEADING( ) */
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -26,7 +23,7 @@
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
+#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
@@ -45,84 +42,98 @@
#ifndef __IDXGIObject_FWD_DEFINED__
#define __IDXGIObject_FWD_DEFINED__
typedef interface IDXGIObject IDXGIObject;
+
#endif /* __IDXGIObject_FWD_DEFINED__ */
#ifndef __IDXGIDeviceSubObject_FWD_DEFINED__
#define __IDXGIDeviceSubObject_FWD_DEFINED__
typedef interface IDXGIDeviceSubObject IDXGIDeviceSubObject;
+
#endif /* __IDXGIDeviceSubObject_FWD_DEFINED__ */
#ifndef __IDXGIResource_FWD_DEFINED__
#define __IDXGIResource_FWD_DEFINED__
typedef interface IDXGIResource IDXGIResource;
+
#endif /* __IDXGIResource_FWD_DEFINED__ */
#ifndef __IDXGIKeyedMutex_FWD_DEFINED__
#define __IDXGIKeyedMutex_FWD_DEFINED__
typedef interface IDXGIKeyedMutex IDXGIKeyedMutex;
+
#endif /* __IDXGIKeyedMutex_FWD_DEFINED__ */
#ifndef __IDXGISurface_FWD_DEFINED__
#define __IDXGISurface_FWD_DEFINED__
typedef interface IDXGISurface IDXGISurface;
+
#endif /* __IDXGISurface_FWD_DEFINED__ */
#ifndef __IDXGISurface1_FWD_DEFINED__
#define __IDXGISurface1_FWD_DEFINED__
typedef interface IDXGISurface1 IDXGISurface1;
+
#endif /* __IDXGISurface1_FWD_DEFINED__ */
#ifndef __IDXGIAdapter_FWD_DEFINED__
#define __IDXGIAdapter_FWD_DEFINED__
typedef interface IDXGIAdapter IDXGIAdapter;
+
#endif /* __IDXGIAdapter_FWD_DEFINED__ */
#ifndef __IDXGIOutput_FWD_DEFINED__
#define __IDXGIOutput_FWD_DEFINED__
typedef interface IDXGIOutput IDXGIOutput;
+
#endif /* __IDXGIOutput_FWD_DEFINED__ */
#ifndef __IDXGISwapChain_FWD_DEFINED__
#define __IDXGISwapChain_FWD_DEFINED__
typedef interface IDXGISwapChain IDXGISwapChain;
+
#endif /* __IDXGISwapChain_FWD_DEFINED__ */
#ifndef __IDXGIFactory_FWD_DEFINED__
#define __IDXGIFactory_FWD_DEFINED__
typedef interface IDXGIFactory IDXGIFactory;
+
#endif /* __IDXGIFactory_FWD_DEFINED__ */
#ifndef __IDXGIDevice_FWD_DEFINED__
#define __IDXGIDevice_FWD_DEFINED__
typedef interface IDXGIDevice IDXGIDevice;
+
#endif /* __IDXGIDevice_FWD_DEFINED__ */
#ifndef __IDXGIFactory1_FWD_DEFINED__
#define __IDXGIFactory1_FWD_DEFINED__
typedef interface IDXGIFactory1 IDXGIFactory1;
+
#endif /* __IDXGIFactory1_FWD_DEFINED__ */
#ifndef __IDXGIAdapter1_FWD_DEFINED__
#define __IDXGIAdapter1_FWD_DEFINED__
typedef interface IDXGIAdapter1 IDXGIAdapter1;
+
#endif /* __IDXGIAdapter1_FWD_DEFINED__ */
#ifndef __IDXGIDevice1_FWD_DEFINED__
#define __IDXGIDevice1_FWD_DEFINED__
typedef interface IDXGIDevice1 IDXGIDevice1;
+
#endif /* __IDXGIDevice1_FWD_DEFINED__ */
@@ -144,13 +155,13 @@ extern "C"{
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
#define DXGI_CPU_ACCESS_FIELD 15
-#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
-#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
-#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
-#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
-#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) )
-#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) )
-#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) )
+#define DXGI_USAGE_SHADER_INPUT 0x00000010UL
+#define DXGI_USAGE_RENDER_TARGET_OUTPUT 0x00000020UL
+#define DXGI_USAGE_BACK_BUFFER 0x00000040UL
+#define DXGI_USAGE_SHARED 0x00000080UL
+#define DXGI_USAGE_READ_ONLY 0x00000100UL
+#define DXGI_USAGE_DISCARD_ON_PRESENT 0x00000200UL
+#define DXGI_USAGE_UNORDERED_ACCESS 0x00000400UL
typedef UINT DXGI_USAGE;
typedef struct DXGI_FRAME_STATISTICS
@@ -225,9 +236,10 @@ typedef struct DXGI_SHARED_RESOURCE
typedef
enum DXGI_RESIDENCY
- { DXGI_RESIDENCY_FULLY_RESIDENT = 1,
- DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
- DXGI_RESIDENCY_EVICTED_TO_DISK = 3
+ {
+ DXGI_RESIDENCY_FULLY_RESIDENT = 1,
+ DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
+ DXGI_RESIDENCY_EVICTED_TO_DISK = 3
} DXGI_RESIDENCY;
typedef struct DXGI_SURFACE_DESC
@@ -240,15 +252,27 @@ typedef struct DXGI_SURFACE_DESC
typedef
enum DXGI_SWAP_EFFECT
- { DXGI_SWAP_EFFECT_DISCARD = 0,
- DXGI_SWAP_EFFECT_SEQUENTIAL = 1
+ {
+ DXGI_SWAP_EFFECT_DISCARD = 0,
+ DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
+ DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3,
+ DXGI_SWAP_EFFECT_FLIP_DISCARD = 4
} DXGI_SWAP_EFFECT;
typedef
enum DXGI_SWAP_CHAIN_FLAG
- { DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
- DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
- DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4
+ {
+ DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
+ DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
+ DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4,
+ DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 8,
+ DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 16,
+ DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 32,
+ DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 64,
+ DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 128,
+ DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 256,
+ DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 512,
+ DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024
} DXGI_SWAP_CHAIN_FLAG;
typedef struct DXGI_SWAP_CHAIN_DESC
@@ -285,33 +309,34 @@ EXTERN_C const IID IID_IDXGIObject;
public:
virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData) = 0;
+ _In_reads_bytes_(DataSize) const void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown) = 0;
+ _In_ const IUnknown *pUnknown) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData) = 0;
+ _Out_writes_bytes_(*pDataSize) void *pData) = 0;
virtual HRESULT STDMETHODCALLTYPE GetParent(
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent) = 0;
+ _COM_Outptr_ void **ppParent) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIObjectVtbl
@@ -322,7 +347,7 @@ EXTERN_C const IID IID_IDXGIObject;
IDXGIObject * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIObject * This);
@@ -333,33 +358,33 @@ EXTERN_C const IID IID_IDXGIObject;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIObject * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
END_INTERFACE
} IDXGIObjectVtbl;
@@ -424,12 +449,13 @@ EXTERN_C const IID IID_IDXGIDeviceSubObject;
public:
virtual HRESULT STDMETHODCALLTYPE GetDevice(
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice) = 0;
+ _COM_Outptr_ void **ppDevice) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIDeviceSubObjectVtbl
@@ -440,7 +466,7 @@ EXTERN_C const IID IID_IDXGIDeviceSubObject;
IDXGIDeviceSubObject * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDeviceSubObject * This);
@@ -451,40 +477,40 @@ EXTERN_C const IID IID_IDXGIDeviceSubObject;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIDeviceSubObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIDeviceSubObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDeviceSubObject * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIDeviceSubObject * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGIDeviceSubObject * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
END_INTERFACE
} IDXGIDeviceSubObjectVtbl;
@@ -553,21 +579,21 @@ EXTERN_C const IID IID_IDXGIResource;
public:
virtual HRESULT STDMETHODCALLTYPE GetSharedHandle(
/* [annotation][out] */
- __out HANDLE *pSharedHandle) = 0;
+ _Out_ HANDLE *pSharedHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE GetUsage(
- /* [annotation][out] */
- __out DXGI_USAGE *pUsage) = 0;
+ /* [out] */ DXGI_USAGE *pUsage) = 0;
virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority(
/* [in] */ UINT EvictionPriority) = 0;
virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority(
/* [annotation][retval][out] */
- __out UINT *pEvictionPriority) = 0;
+ _Out_ UINT *pEvictionPriority) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIResourceVtbl
@@ -578,7 +604,7 @@ EXTERN_C const IID IID_IDXGIResource;
IDXGIResource * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIResource * This);
@@ -589,50 +615,49 @@ EXTERN_C const IID IID_IDXGIResource;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIResource * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIResource * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIResource * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIResource * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGIResource * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetSharedHandle )(
IDXGIResource * This,
/* [annotation][out] */
- __out HANDLE *pSharedHandle);
+ _Out_ HANDLE *pSharedHandle);
HRESULT ( STDMETHODCALLTYPE *GetUsage )(
IDXGIResource * This,
- /* [annotation][out] */
- __out DXGI_USAGE *pUsage);
+ /* [out] */ DXGI_USAGE *pUsage);
HRESULT ( STDMETHODCALLTYPE *SetEvictionPriority )(
IDXGIResource * This,
@@ -641,7 +666,7 @@ EXTERN_C const IID IID_IDXGIResource;
HRESULT ( STDMETHODCALLTYPE *GetEvictionPriority )(
IDXGIResource * This,
/* [annotation][retval][out] */
- __out UINT *pEvictionPriority);
+ _Out_ UINT *pEvictionPriority);
END_INTERFACE
} IDXGIResourceVtbl;
@@ -730,6 +755,7 @@ EXTERN_C const IID IID_IDXGIKeyedMutex;
};
+
#else /* C style interface */
typedef struct IDXGIKeyedMutexVtbl
@@ -740,7 +766,7 @@ EXTERN_C const IID IID_IDXGIKeyedMutex;
IDXGIKeyedMutex * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIKeyedMutex * This);
@@ -751,40 +777,40 @@ EXTERN_C const IID IID_IDXGIKeyedMutex;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIKeyedMutex * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIKeyedMutex * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIKeyedMutex * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIKeyedMutex * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGIKeyedMutex * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *AcquireSync )(
IDXGIKeyedMutex * This,
@@ -883,17 +909,18 @@ EXTERN_C const IID IID_IDXGISurface;
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [annotation][out] */
- __out DXGI_SURFACE_DESC *pDesc) = 0;
+ _Out_ DXGI_SURFACE_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE Map(
/* [annotation][out] */
- __out DXGI_MAPPED_RECT *pLockedRect,
+ _Out_ DXGI_MAPPED_RECT *pLockedRect,
/* [in] */ UINT MapFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE Unmap( void) = 0;
};
+
#else /* C style interface */
typedef struct IDXGISurfaceVtbl
@@ -904,7 +931,7 @@ EXTERN_C const IID IID_IDXGISurface;
IDXGISurface * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGISurface * This);
@@ -915,50 +942,50 @@ EXTERN_C const IID IID_IDXGISurface;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGISurface * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGISurface * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGISurface * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGISurface * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGISurface * This,
/* [annotation][out] */
- __out DXGI_SURFACE_DESC *pDesc);
+ _Out_ DXGI_SURFACE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *Map )(
IDXGISurface * This,
/* [annotation][out] */
- __out DXGI_MAPPED_RECT *pLockedRect,
+ _Out_ DXGI_MAPPED_RECT *pLockedRect,
/* [in] */ UINT MapFlags);
HRESULT ( STDMETHODCALLTYPE *Unmap )(
@@ -1042,14 +1069,15 @@ EXTERN_C const IID IID_IDXGISurface1;
virtual HRESULT STDMETHODCALLTYPE GetDC(
/* [in] */ BOOL Discard,
/* [annotation][out] */
- __out HDC *phdc) = 0;
+ _Out_ HDC *phdc) = 0;
virtual HRESULT STDMETHODCALLTYPE ReleaseDC(
/* [annotation][in] */
- __in_opt RECT *pDirtyRect) = 0;
+ _In_opt_ RECT *pDirtyRect) = 0;
};
+
#else /* C style interface */
typedef struct IDXGISurface1Vtbl
@@ -1060,7 +1088,7 @@ EXTERN_C const IID IID_IDXGISurface1;
IDXGISurface1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGISurface1 * This);
@@ -1071,50 +1099,50 @@ EXTERN_C const IID IID_IDXGISurface1;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGISurface1 * This,
/* [annotation][out] */
- __out DXGI_SURFACE_DESC *pDesc);
+ _Out_ DXGI_SURFACE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *Map )(
IDXGISurface1 * This,
/* [annotation][out] */
- __out DXGI_MAPPED_RECT *pLockedRect,
+ _Out_ DXGI_MAPPED_RECT *pLockedRect,
/* [in] */ UINT MapFlags);
HRESULT ( STDMETHODCALLTYPE *Unmap )(
@@ -1124,12 +1152,12 @@ EXTERN_C const IID IID_IDXGISurface1;
IDXGISurface1 * This,
/* [in] */ BOOL Discard,
/* [annotation][out] */
- __out HDC *phdc);
+ _Out_ HDC *phdc);
HRESULT ( STDMETHODCALLTYPE *ReleaseDC )(
IDXGISurface1 * This,
/* [annotation][in] */
- __in_opt RECT *pDirtyRect);
+ _In_opt_ RECT *pDirtyRect);
END_INTERFACE
} IDXGISurface1Vtbl;
@@ -1225,20 +1253,21 @@ EXTERN_C const IID IID_IDXGIAdapter;
virtual HRESULT STDMETHODCALLTYPE EnumOutputs(
/* [in] */ UINT Output,
/* [annotation][out][in] */
- __out IDXGIOutput **ppOutput) = 0;
+ _COM_Outptr_ IDXGIOutput **ppOutput) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [annotation][out] */
- __out DXGI_ADAPTER_DESC *pDesc) = 0;
+ _Out_ DXGI_ADAPTER_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport(
/* [annotation][in] */
- __in REFGUID InterfaceName,
+ _In_ REFGUID InterfaceName,
/* [annotation][out] */
- __out LARGE_INTEGER *pUMDVersion) = 0;
+ _Out_ LARGE_INTEGER *pUMDVersion) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIAdapterVtbl
@@ -1249,7 +1278,7 @@ EXTERN_C const IID IID_IDXGIAdapter;
IDXGIAdapter * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIAdapter * This);
@@ -1260,51 +1289,51 @@ EXTERN_C const IID IID_IDXGIAdapter;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIAdapter * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIAdapter * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIAdapter * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
IDXGIAdapter * This,
/* [in] */ UINT Output,
/* [annotation][out][in] */
- __out IDXGIOutput **ppOutput);
+ _COM_Outptr_ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIAdapter * This,
/* [annotation][out] */
- __out DXGI_ADAPTER_DESC *pDesc);
+ _Out_ DXGI_ADAPTER_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
IDXGIAdapter * This,
/* [annotation][in] */
- __in REFGUID InterfaceName,
+ _In_ REFGUID InterfaceName,
/* [annotation][out] */
- __out LARGE_INTEGER *pUMDVersion);
+ _Out_ LARGE_INTEGER *pUMDVersion);
END_INTERFACE
} IDXGIAdapterVtbl;
@@ -1391,59 +1420,60 @@ EXTERN_C const IID IID_IDXGIOutput;
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [annotation][out] */
- __out DXGI_OUTPUT_DESC *pDesc) = 0;
+ _Out_ DXGI_OUTPUT_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList(
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
- __inout UINT *pNumModes,
+ _Inout_ UINT *pNumModes,
/* [annotation][out] */
- __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc) = 0;
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode(
/* [annotation][in] */
- __in const DXGI_MODE_DESC *pModeToMatch,
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
/* [annotation][out] */
- __out DXGI_MODE_DESC *pClosestMatch,
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
/* [annotation][in] */
- __in_opt IUnknown *pConcernedDevice) = 0;
+ _In_opt_ IUnknown *pConcernedDevice) = 0;
virtual HRESULT STDMETHODCALLTYPE WaitForVBlank( void) = 0;
virtual HRESULT STDMETHODCALLTYPE TakeOwnership(
/* [annotation][in] */
- __in IUnknown *pDevice,
+ _In_ IUnknown *pDevice,
BOOL Exclusive) = 0;
virtual void STDMETHODCALLTYPE ReleaseOwnership( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities(
/* [annotation][out] */
- __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) = 0;
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGammaControl(
/* [annotation][in] */
- __in const DXGI_GAMMA_CONTROL *pArray) = 0;
+ _In_ const DXGI_GAMMA_CONTROL *pArray) = 0;
virtual HRESULT STDMETHODCALLTYPE GetGammaControl(
/* [annotation][out] */
- __out DXGI_GAMMA_CONTROL *pArray) = 0;
+ _Out_ DXGI_GAMMA_CONTROL *pArray) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDisplaySurface(
/* [annotation][in] */
- __in IDXGISurface *pScanoutSurface) = 0;
+ _In_ IDXGISurface *pScanoutSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData(
/* [annotation][in] */
- __in IDXGISurface *pDestination) = 0;
+ _In_ IDXGISurface *pDestination) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics(
/* [annotation][out] */
- __out DXGI_FRAME_STATISTICS *pStats) = 0;
+ _Out_ DXGI_FRAME_STATISTICS *pStats) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIOutputVtbl
@@ -1454,7 +1484,7 @@ EXTERN_C const IID IID_IDXGIOutput;
IDXGIOutput * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIOutput * This);
@@ -1465,56 +1495,56 @@ EXTERN_C const IID IID_IDXGIOutput;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIOutput * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIOutput * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIOutput * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIOutput * This,
/* [annotation][out] */
- __out DXGI_OUTPUT_DESC *pDesc);
+ _Out_ DXGI_OUTPUT_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
IDXGIOutput * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
- __inout UINT *pNumModes,
+ _Inout_ UINT *pNumModes,
/* [annotation][out] */
- __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
IDXGIOutput * This,
/* [annotation][in] */
- __in const DXGI_MODE_DESC *pModeToMatch,
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
/* [annotation][out] */
- __out DXGI_MODE_DESC *pClosestMatch,
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
/* [annotation][in] */
- __in_opt IUnknown *pConcernedDevice);
+ _In_opt_ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
IDXGIOutput * This);
@@ -1522,7 +1552,7 @@ EXTERN_C const IID IID_IDXGIOutput;
HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
IDXGIOutput * This,
/* [annotation][in] */
- __in IUnknown *pDevice,
+ _In_ IUnknown *pDevice,
BOOL Exclusive);
void ( STDMETHODCALLTYPE *ReleaseOwnership )(
@@ -1531,32 +1561,32 @@ EXTERN_C const IID IID_IDXGIOutput;
HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
IDXGIOutput * This,
/* [annotation][out] */
- __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
IDXGIOutput * This,
/* [annotation][in] */
- __in const DXGI_GAMMA_CONTROL *pArray);
+ _In_ const DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
IDXGIOutput * This,
/* [annotation][out] */
- __out DXGI_GAMMA_CONTROL *pArray);
+ _Out_ DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
IDXGIOutput * This,
/* [annotation][in] */
- __in IDXGISurface *pScanoutSurface);
+ _In_ IDXGISurface *pScanoutSurface);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
IDXGIOutput * This,
/* [annotation][in] */
- __in IDXGISurface *pDestination);
+ _In_ IDXGISurface *pDestination);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGIOutput * This,
/* [annotation][out] */
- __out DXGI_FRAME_STATISTICS *pStats);
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
END_INTERFACE
} IDXGIOutputVtbl;
@@ -1645,9 +1675,14 @@ EXTERN_C const IID IID_IDXGIOutput;
/* [local] */
#define DXGI_MAX_SWAP_CHAIN_BUFFERS ( 16 )
-#define DXGI_PRESENT_TEST 0x00000001UL
-#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL
-#define DXGI_PRESENT_RESTART 0x00000004UL
+#define DXGI_PRESENT_TEST 0x00000001UL
+#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL
+#define DXGI_PRESENT_RESTART 0x00000004UL
+#define DXGI_PRESENT_DO_NOT_WAIT 0x00000008UL
+#define DXGI_PRESENT_STEREO_PREFER_RIGHT 0x00000010UL
+#define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020UL
+#define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040UL
+#define DXGI_PRESENT_USE_DURATION 0x00000100UL
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_c_ifspec;
@@ -1675,24 +1710,24 @@ EXTERN_C const IID IID_IDXGISwapChain;
virtual HRESULT STDMETHODCALLTYPE GetBuffer(
/* [in] */ UINT Buffer,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][out][in] */
- __out void **ppSurface) = 0;
+ _COM_Outptr_ void **ppSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE SetFullscreenState(
/* [in] */ BOOL Fullscreen,
/* [annotation][in] */
- __in_opt IDXGIOutput *pTarget) = 0;
+ _In_opt_ IDXGIOutput *pTarget) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFullscreenState(
/* [annotation][out] */
- __out BOOL *pFullscreen,
+ _Out_opt_ BOOL *pFullscreen,
/* [annotation][out] */
- __out IDXGIOutput **ppTarget) = 0;
+ _COM_Outptr_opt_result_maybenull_ IDXGIOutput **ppTarget) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [annotation][out] */
- __out DXGI_SWAP_CHAIN_DESC *pDesc) = 0;
+ _Out_ DXGI_SWAP_CHAIN_DESC *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE ResizeBuffers(
/* [in] */ UINT BufferCount,
@@ -1703,22 +1738,23 @@ EXTERN_C const IID IID_IDXGISwapChain;
virtual HRESULT STDMETHODCALLTYPE ResizeTarget(
/* [annotation][in] */
- __in const DXGI_MODE_DESC *pNewTargetParameters) = 0;
+ _In_ const DXGI_MODE_DESC *pNewTargetParameters) = 0;
virtual HRESULT STDMETHODCALLTYPE GetContainingOutput(
/* [annotation][out] */
- __out IDXGIOutput **ppOutput) = 0;
+ _COM_Outptr_ IDXGIOutput **ppOutput) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics(
/* [annotation][out] */
- __out DXGI_FRAME_STATISTICS *pStats) = 0;
+ _Out_ DXGI_FRAME_STATISTICS *pStats) = 0;
virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount(
/* [annotation][out] */
- __out UINT *pLastPresentCount) = 0;
+ _Out_ UINT *pLastPresentCount) = 0;
};
+
#else /* C style interface */
typedef struct IDXGISwapChainVtbl
@@ -1729,7 +1765,7 @@ EXTERN_C const IID IID_IDXGISwapChain;
IDXGISwapChain * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGISwapChain * This);
@@ -1740,40 +1776,40 @@ EXTERN_C const IID IID_IDXGISwapChain;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppDevice);
+ _COM_Outptr_ void **ppDevice);
HRESULT ( STDMETHODCALLTYPE *Present )(
IDXGISwapChain * This,
@@ -1784,27 +1820,27 @@ EXTERN_C const IID IID_IDXGISwapChain;
IDXGISwapChain * This,
/* [in] */ UINT Buffer,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][out][in] */
- __out void **ppSurface);
+ _COM_Outptr_ void **ppSurface);
HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )(
IDXGISwapChain * This,
/* [in] */ BOOL Fullscreen,
/* [annotation][in] */
- __in_opt IDXGIOutput *pTarget);
+ _In_opt_ IDXGIOutput *pTarget);
HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )(
IDXGISwapChain * This,
/* [annotation][out] */
- __out BOOL *pFullscreen,
+ _Out_opt_ BOOL *pFullscreen,
/* [annotation][out] */
- __out IDXGIOutput **ppTarget);
+ _COM_Outptr_opt_result_maybenull_ IDXGIOutput **ppTarget);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGISwapChain * This,
/* [annotation][out] */
- __out DXGI_SWAP_CHAIN_DESC *pDesc);
+ _Out_ DXGI_SWAP_CHAIN_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )(
IDXGISwapChain * This,
@@ -1817,22 +1853,22 @@ EXTERN_C const IID IID_IDXGISwapChain;
HRESULT ( STDMETHODCALLTYPE *ResizeTarget )(
IDXGISwapChain * This,
/* [annotation][in] */
- __in const DXGI_MODE_DESC *pNewTargetParameters);
+ _In_ const DXGI_MODE_DESC *pNewTargetParameters);
HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )(
IDXGISwapChain * This,
/* [annotation][out] */
- __out IDXGIOutput **ppOutput);
+ _COM_Outptr_ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGISwapChain * This,
/* [annotation][out] */
- __out DXGI_FRAME_STATISTICS *pStats);
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )(
IDXGISwapChain * This,
/* [annotation][out] */
- __out UINT *pLastPresentCount);
+ _Out_ UINT *pLastPresentCount);
END_INTERFACE
} IDXGISwapChainVtbl;
@@ -1945,7 +1981,7 @@ EXTERN_C const IID IID_IDXGIFactory;
virtual HRESULT STDMETHODCALLTYPE EnumAdapters(
/* [in] */ UINT Adapter,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter) = 0;
+ _COM_Outptr_ IDXGIAdapter **ppAdapter) = 0;
virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation(
HWND WindowHandle,
@@ -1953,23 +1989,24 @@ EXTERN_C const IID IID_IDXGIFactory;
virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation(
/* [annotation][out] */
- __out HWND *pWindowHandle) = 0;
+ _Out_ HWND *pWindowHandle) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
/* [annotation][in] */
- __in IUnknown *pDevice,
+ _In_ IUnknown *pDevice,
/* [annotation][in] */
- __in DXGI_SWAP_CHAIN_DESC *pDesc,
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
/* [annotation][out] */
- __out IDXGISwapChain **ppSwapChain) = 0;
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter(
/* [in] */ HMODULE Module,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter) = 0;
+ _COM_Outptr_ IDXGIAdapter **ppAdapter) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIFactoryVtbl
@@ -1980,7 +2017,7 @@ EXTERN_C const IID IID_IDXGIFactory;
IDXGIFactory * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIFactory * This);
@@ -1991,39 +2028,39 @@ EXTERN_C const IID IID_IDXGIFactory;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIFactory * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIFactory * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIFactory * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
IDXGIFactory * This,
/* [in] */ UINT Adapter,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter);
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
IDXGIFactory * This,
@@ -2033,22 +2070,22 @@ EXTERN_C const IID IID_IDXGIFactory;
HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
IDXGIFactory * This,
/* [annotation][out] */
- __out HWND *pWindowHandle);
+ _Out_ HWND *pWindowHandle);
HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
IDXGIFactory * This,
/* [annotation][in] */
- __in IUnknown *pDevice,
+ _In_ IUnknown *pDevice,
/* [annotation][in] */
- __in DXGI_SWAP_CHAIN_DESC *pDesc,
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
/* [annotation][out] */
- __out IDXGISwapChain **ppSwapChain);
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain);
HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
IDXGIFactory * This,
/* [in] */ HMODULE Module,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter);
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
END_INTERFACE
} IDXGIFactoryVtbl;
@@ -2115,8 +2152,8 @@ EXTERN_C const IID IID_IDXGIFactory;
/* interface __MIDL_itf_dxgi_0000_0010 */
/* [local] */
-HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **ppFactory);
-HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void **ppFactory);
+HRESULT WINAPI CreateDXGIFactory(REFIID riid, _COM_Outptr_ void **ppFactory);
+HRESULT WINAPI CreateDXGIFactory1(REFIID riid, _COM_Outptr_ void **ppFactory);
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0010_v0_0_c_ifspec;
@@ -2139,23 +2176,23 @@ EXTERN_C const IID IID_IDXGIDevice;
public:
virtual HRESULT STDMETHODCALLTYPE GetAdapter(
/* [annotation][out] */
- __out IDXGIAdapter **pAdapter) = 0;
+ _COM_Outptr_ IDXGIAdapter **pAdapter) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateSurface(
/* [annotation][in] */
- __in const DXGI_SURFACE_DESC *pDesc,
+ _In_ const DXGI_SURFACE_DESC *pDesc,
/* [in] */ UINT NumSurfaces,
/* [in] */ DXGI_USAGE Usage,
/* [annotation][in] */
- __in_opt const DXGI_SHARED_RESOURCE *pSharedResource,
+ _In_opt_ const DXGI_SHARED_RESOURCE *pSharedResource,
/* [annotation][out] */
- __out IDXGISurface **ppSurface) = 0;
+ _COM_Outptr_ IDXGISurface **ppSurface) = 0;
virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency(
/* [annotation][size_is][in] */
- __in_ecount(NumResources) IUnknown *const *ppResources,
+ _In_reads_(NumResources) IUnknown *const *ppResources,
/* [annotation][size_is][out] */
- __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus,
+ _Out_writes_(NumResources) DXGI_RESIDENCY *pResidencyStatus,
/* [in] */ UINT NumResources) = 0;
virtual HRESULT STDMETHODCALLTYPE SetGPUThreadPriority(
@@ -2163,10 +2200,11 @@ EXTERN_C const IID IID_IDXGIDevice;
virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority(
/* [annotation][retval][out] */
- __out INT *pPriority) = 0;
+ _Out_ INT *pPriority) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIDeviceVtbl
@@ -2177,7 +2215,7 @@ EXTERN_C const IID IID_IDXGIDevice;
IDXGIDevice * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDevice * This);
@@ -2188,56 +2226,56 @@ EXTERN_C const IID IID_IDXGIDevice;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIDevice * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIDevice * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIDevice * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetAdapter )(
IDXGIDevice * This,
/* [annotation][out] */
- __out IDXGIAdapter **pAdapter);
+ _COM_Outptr_ IDXGIAdapter **pAdapter);
HRESULT ( STDMETHODCALLTYPE *CreateSurface )(
IDXGIDevice * This,
/* [annotation][in] */
- __in const DXGI_SURFACE_DESC *pDesc,
+ _In_ const DXGI_SURFACE_DESC *pDesc,
/* [in] */ UINT NumSurfaces,
/* [in] */ DXGI_USAGE Usage,
/* [annotation][in] */
- __in_opt const DXGI_SHARED_RESOURCE *pSharedResource,
+ _In_opt_ const DXGI_SHARED_RESOURCE *pSharedResource,
/* [annotation][out] */
- __out IDXGISurface **ppSurface);
+ _COM_Outptr_ IDXGISurface **ppSurface);
HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )(
IDXGIDevice * This,
/* [annotation][size_is][in] */
- __in_ecount(NumResources) IUnknown *const *ppResources,
+ _In_reads_(NumResources) IUnknown *const *ppResources,
/* [annotation][size_is][out] */
- __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus,
+ _Out_writes_(NumResources) DXGI_RESIDENCY *pResidencyStatus,
/* [in] */ UINT NumResources);
HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )(
@@ -2247,7 +2285,7 @@ EXTERN_C const IID IID_IDXGIDevice;
HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )(
IDXGIDevice * This,
/* [annotation][retval][out] */
- __out INT *pPriority);
+ _Out_ INT *pPriority);
END_INTERFACE
} IDXGIDeviceVtbl;
@@ -2316,9 +2354,11 @@ EXTERN_C const IID IID_IDXGIDevice;
typedef
enum DXGI_ADAPTER_FLAG
- { DXGI_ADAPTER_FLAG_NONE = 0,
- DXGI_ADAPTER_FLAG_REMOTE = 1,
- DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xffffffff
+ {
+ DXGI_ADAPTER_FLAG_NONE = 0,
+ DXGI_ADAPTER_FLAG_REMOTE = 1,
+ DXGI_ADAPTER_FLAG_SOFTWARE = 2,
+ DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xffffffff
} DXGI_ADAPTER_FLAG;
typedef struct DXGI_ADAPTER_DESC1
@@ -2365,12 +2405,13 @@ EXTERN_C const IID IID_IDXGIFactory1;
virtual HRESULT STDMETHODCALLTYPE EnumAdapters1(
/* [in] */ UINT Adapter,
/* [annotation][out] */
- __out IDXGIAdapter1 **ppAdapter) = 0;
+ _COM_Outptr_ IDXGIAdapter1 **ppAdapter) = 0;
virtual BOOL STDMETHODCALLTYPE IsCurrent( void) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIFactory1Vtbl
@@ -2381,7 +2422,7 @@ EXTERN_C const IID IID_IDXGIFactory1;
IDXGIFactory1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIFactory1 * This);
@@ -2392,39 +2433,39 @@ EXTERN_C const IID IID_IDXGIFactory1;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIFactory1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIFactory1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIFactory1 * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
IDXGIFactory1 * This,
/* [in] */ UINT Adapter,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter);
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
IDXGIFactory1 * This,
@@ -2434,28 +2475,28 @@ EXTERN_C const IID IID_IDXGIFactory1;
HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
IDXGIFactory1 * This,
/* [annotation][out] */
- __out HWND *pWindowHandle);
+ _Out_ HWND *pWindowHandle);
HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
IDXGIFactory1 * This,
/* [annotation][in] */
- __in IUnknown *pDevice,
+ _In_ IUnknown *pDevice,
/* [annotation][in] */
- __in DXGI_SWAP_CHAIN_DESC *pDesc,
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
/* [annotation][out] */
- __out IDXGISwapChain **ppSwapChain);
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain);
HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
IDXGIFactory1 * This,
/* [in] */ HMODULE Module,
/* [annotation][out] */
- __out IDXGIAdapter **ppAdapter);
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )(
IDXGIFactory1 * This,
/* [in] */ UINT Adapter,
/* [annotation][out] */
- __out IDXGIAdapter1 **ppAdapter);
+ _COM_Outptr_ IDXGIAdapter1 **ppAdapter);
BOOL ( STDMETHODCALLTYPE *IsCurrent )(
IDXGIFactory1 * This);
@@ -2546,10 +2587,11 @@ EXTERN_C const IID IID_IDXGIAdapter1;
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc1(
/* [annotation][out] */
- __out DXGI_ADAPTER_DESC1 *pDesc) = 0;
+ _Out_ DXGI_ADAPTER_DESC1 *pDesc) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIAdapter1Vtbl
@@ -2560,7 +2602,7 @@ EXTERN_C const IID IID_IDXGIAdapter1;
IDXGIAdapter1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIAdapter1 * This);
@@ -2571,56 +2613,56 @@ EXTERN_C const IID IID_IDXGIAdapter1;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIAdapter1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIAdapter1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIAdapter1 * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
IDXGIAdapter1 * This,
/* [in] */ UINT Output,
/* [annotation][out][in] */
- __out IDXGIOutput **ppOutput);
+ _COM_Outptr_ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIAdapter1 * This,
/* [annotation][out] */
- __out DXGI_ADAPTER_DESC *pDesc);
+ _Out_ DXGI_ADAPTER_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
IDXGIAdapter1 * This,
/* [annotation][in] */
- __in REFGUID InterfaceName,
+ _In_ REFGUID InterfaceName,
/* [annotation][out] */
- __out LARGE_INTEGER *pUMDVersion);
+ _Out_ LARGE_INTEGER *pUMDVersion);
HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
IDXGIAdapter1 * This,
/* [annotation][out] */
- __out DXGI_ADAPTER_DESC1 *pDesc);
+ _Out_ DXGI_ADAPTER_DESC1 *pDesc);
END_INTERFACE
} IDXGIAdapter1Vtbl;
@@ -2702,10 +2744,11 @@ EXTERN_C const IID IID_IDXGIDevice1;
virtual HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency(
/* [annotation][out] */
- __out UINT *pMaxLatency) = 0;
+ _Out_ UINT *pMaxLatency) = 0;
};
+
#else /* C style interface */
typedef struct IDXGIDevice1Vtbl
@@ -2716,7 +2759,7 @@ EXTERN_C const IID IID_IDXGIDevice1;
IDXGIDevice1 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
+ _COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIDevice1 * This);
@@ -2727,56 +2770,56 @@ EXTERN_C const IID IID_IDXGIDevice1;
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIDevice1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
- __in_bcount(DataSize) const void *pData);
+ _In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIDevice1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][in] */
- __in const IUnknown *pUnknown);
+ _In_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice1 * This,
/* [annotation][in] */
- __in REFGUID Name,
+ _In_ REFGUID Name,
/* [annotation][out][in] */
- __inout UINT *pDataSize,
+ _Inout_ UINT *pDataSize,
/* [annotation][out] */
- __out_bcount(*pDataSize) void *pData);
+ _Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIDevice1 * This,
/* [annotation][in] */
- __in REFIID riid,
+ _In_ REFIID riid,
/* [annotation][retval][out] */
- __out void **ppParent);
+ _COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetAdapter )(
IDXGIDevice1 * This,
/* [annotation][out] */
- __out IDXGIAdapter **pAdapter);
+ _COM_Outptr_ IDXGIAdapter **pAdapter);
HRESULT ( STDMETHODCALLTYPE *CreateSurface )(
IDXGIDevice1 * This,
/* [annotation][in] */
- __in const DXGI_SURFACE_DESC *pDesc,
+ _In_ const DXGI_SURFACE_DESC *pDesc,
/* [in] */ UINT NumSurfaces,
/* [in] */ DXGI_USAGE Usage,
/* [annotation][in] */
- __in_opt const DXGI_SHARED_RESOURCE *pSharedResource,
+ _In_opt_ const DXGI_SHARED_RESOURCE *pSharedResource,
/* [annotation][out] */
- __out IDXGISurface **ppSurface);
+ _COM_Outptr_ IDXGISurface **ppSurface);
HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )(
IDXGIDevice1 * This,
/* [annotation][size_is][in] */
- __in_ecount(NumResources) IUnknown *const *ppResources,
+ _In_reads_(NumResources) IUnknown *const *ppResources,
/* [annotation][size_is][out] */
- __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus,
+ _Out_writes_(NumResources) DXGI_RESIDENCY *pResidencyStatus,
/* [in] */ UINT NumResources);
HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )(
@@ -2786,7 +2829,7 @@ EXTERN_C const IID IID_IDXGIDevice1;
HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )(
IDXGIDevice1 * This,
/* [annotation][retval][out] */
- __out INT *pPriority);
+ _Out_ INT *pPriority);
HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )(
IDXGIDevice1 * This,
@@ -2795,7 +2838,7 @@ EXTERN_C const IID IID_IDXGIDevice1;
HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )(
IDXGIDevice1 * This,
/* [annotation][out] */
- __out UINT *pMaxLatency);
+ _Out_ UINT *pMaxLatency);
END_INTERFACE
} IDXGIDevice1Vtbl;
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h
new file mode 100644
index 00000000000..6b34f63bb6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h
@@ -0,0 +1,2465 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __dxgi1_2_h__
+#define __dxgi1_2_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IDXGIDisplayControl_FWD_DEFINED__
+#define __IDXGIDisplayControl_FWD_DEFINED__
+typedef interface IDXGIDisplayControl IDXGIDisplayControl;
+
+#endif /* __IDXGIDisplayControl_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIOutputDuplication_FWD_DEFINED__
+#define __IDXGIOutputDuplication_FWD_DEFINED__
+typedef interface IDXGIOutputDuplication IDXGIOutputDuplication;
+
+#endif /* __IDXGIOutputDuplication_FWD_DEFINED__ */
+
+
+#ifndef __IDXGISurface2_FWD_DEFINED__
+#define __IDXGISurface2_FWD_DEFINED__
+typedef interface IDXGISurface2 IDXGISurface2;
+
+#endif /* __IDXGISurface2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIResource1_FWD_DEFINED__
+#define __IDXGIResource1_FWD_DEFINED__
+typedef interface IDXGIResource1 IDXGIResource1;
+
+#endif /* __IDXGIResource1_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIDevice2_FWD_DEFINED__
+#define __IDXGIDevice2_FWD_DEFINED__
+typedef interface IDXGIDevice2 IDXGIDevice2;
+
+#endif /* __IDXGIDevice2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGISwapChain1_FWD_DEFINED__
+#define __IDXGISwapChain1_FWD_DEFINED__
+typedef interface IDXGISwapChain1 IDXGISwapChain1;
+
+#endif /* __IDXGISwapChain1_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIFactory2_FWD_DEFINED__
+#define __IDXGIFactory2_FWD_DEFINED__
+typedef interface IDXGIFactory2 IDXGIFactory2;
+
+#endif /* __IDXGIFactory2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIAdapter2_FWD_DEFINED__
+#define __IDXGIAdapter2_FWD_DEFINED__
+typedef interface IDXGIAdapter2 IDXGIAdapter2;
+
+#endif /* __IDXGIAdapter2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIOutput1_FWD_DEFINED__
+#define __IDXGIOutput1_FWD_DEFINED__
+typedef interface IDXGIOutput1 IDXGIOutput1;
+
+#endif /* __IDXGIOutput1_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "dxgi.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0000 */
+/* [local] */
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0000_v0_0_s_ifspec;
+
+#ifndef __IDXGIDisplayControl_INTERFACE_DEFINED__
+#define __IDXGIDisplayControl_INTERFACE_DEFINED__
+
+/* interface IDXGIDisplayControl */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIDisplayControl;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("ea9dbf1a-c88e-4486-854a-98aa0138f30c")
+ IDXGIDisplayControl : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE IsStereoEnabled( void) = 0;
+
+ virtual void STDMETHODCALLTYPE SetStereoEnabled(
+ BOOL enabled) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDisplayControlVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDisplayControl * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDisplayControl * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDisplayControl * This);
+
+ BOOL ( STDMETHODCALLTYPE *IsStereoEnabled )(
+ IDXGIDisplayControl * This);
+
+ void ( STDMETHODCALLTYPE *SetStereoEnabled )(
+ IDXGIDisplayControl * This,
+ BOOL enabled);
+
+ END_INTERFACE
+ } IDXGIDisplayControlVtbl;
+
+ interface IDXGIDisplayControl
+ {
+ CONST_VTBL struct IDXGIDisplayControlVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDisplayControl_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDisplayControl_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDisplayControl_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDisplayControl_IsStereoEnabled(This) \
+ ( (This)->lpVtbl -> IsStereoEnabled(This) )
+
+#define IDXGIDisplayControl_SetStereoEnabled(This,enabled) \
+ ( (This)->lpVtbl -> SetStereoEnabled(This,enabled) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDisplayControl_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0001 */
+/* [local] */
+
+typedef struct DXGI_OUTDUPL_MOVE_RECT
+ {
+ POINT SourcePoint;
+ RECT DestinationRect;
+ } DXGI_OUTDUPL_MOVE_RECT;
+
+typedef struct DXGI_OUTDUPL_DESC
+ {
+ DXGI_MODE_DESC ModeDesc;
+ DXGI_MODE_ROTATION Rotation;
+ BOOL DesktopImageInSystemMemory;
+ } DXGI_OUTDUPL_DESC;
+
+typedef struct DXGI_OUTDUPL_POINTER_POSITION
+ {
+ POINT Position;
+ BOOL Visible;
+ } DXGI_OUTDUPL_POINTER_POSITION;
+
+typedef
+enum DXGI_OUTDUPL_POINTER_SHAPE_TYPE
+ {
+ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME = 0x1,
+ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR = 0x2,
+ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR = 0x4
+ } DXGI_OUTDUPL_POINTER_SHAPE_TYPE;
+
+typedef struct DXGI_OUTDUPL_POINTER_SHAPE_INFO
+ {
+ UINT Type;
+ UINT Width;
+ UINT Height;
+ UINT Pitch;
+ POINT HotSpot;
+ } DXGI_OUTDUPL_POINTER_SHAPE_INFO;
+
+typedef struct DXGI_OUTDUPL_FRAME_INFO
+ {
+ LARGE_INTEGER LastPresentTime;
+ LARGE_INTEGER LastMouseUpdateTime;
+ UINT AccumulatedFrames;
+ BOOL RectsCoalesced;
+ BOOL ProtectedContentMaskedOut;
+ DXGI_OUTDUPL_POINTER_POSITION PointerPosition;
+ UINT TotalMetadataBufferSize;
+ UINT PointerShapeBufferSize;
+ } DXGI_OUTDUPL_FRAME_INFO;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0001_v0_0_s_ifspec;
+
+#ifndef __IDXGIOutputDuplication_INTERFACE_DEFINED__
+#define __IDXGIOutputDuplication_INTERFACE_DEFINED__
+
+/* interface IDXGIOutputDuplication */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIOutputDuplication;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("191cfac3-a341-470d-b26e-a864f428319c")
+ IDXGIOutputDuplication : public IDXGIObject
+ {
+ public:
+ virtual void STDMETHODCALLTYPE GetDesc(
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_DESC *pDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AcquireNextFrame(
+ /* [annotation][in] */
+ _In_ UINT TimeoutInMilliseconds,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_FRAME_INFO *pFrameInfo,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIResource **ppDesktopResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFrameDirtyRects(
+ /* [annotation][in] */
+ _In_ UINT DirtyRectsBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(DirtyRectsBufferSize, *pDirtyRectsBufferSizeRequired) RECT *pDirtyRectsBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pDirtyRectsBufferSizeRequired) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFrameMoveRects(
+ /* [annotation][in] */
+ _In_ UINT MoveRectsBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(MoveRectsBufferSize, *pMoveRectsBufferSizeRequired) DXGI_OUTDUPL_MOVE_RECT *pMoveRectBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pMoveRectsBufferSizeRequired) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFramePointerShape(
+ /* [annotation][in] */
+ _In_ UINT PointerShapeBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(PointerShapeBufferSize, *pPointerShapeBufferSizeRequired) void *pPointerShapeBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pPointerShapeBufferSizeRequired,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_POINTER_SHAPE_INFO *pPointerShapeInfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MapDesktopSurface(
+ /* [annotation][out] */
+ _Out_ DXGI_MAPPED_RECT *pLockedRect) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE UnMapDesktopSurface( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReleaseFrame( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIOutputDuplicationVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIOutputDuplication * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIOutputDuplication * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIOutputDuplication * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ void ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *AcquireNextFrame )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ UINT TimeoutInMilliseconds,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_FRAME_INFO *pFrameInfo,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIResource **ppDesktopResource);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameDirtyRects )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ UINT DirtyRectsBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(DirtyRectsBufferSize, *pDirtyRectsBufferSizeRequired) RECT *pDirtyRectsBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pDirtyRectsBufferSizeRequired);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameMoveRects )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ UINT MoveRectsBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(MoveRectsBufferSize, *pMoveRectsBufferSizeRequired) DXGI_OUTDUPL_MOVE_RECT *pMoveRectBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pMoveRectsBufferSizeRequired);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFramePointerShape )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][in] */
+ _In_ UINT PointerShapeBufferSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_to_(PointerShapeBufferSize, *pPointerShapeBufferSizeRequired) void *pPointerShapeBuffer,
+ /* [annotation][out] */
+ _Out_ UINT *pPointerShapeBufferSizeRequired,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTDUPL_POINTER_SHAPE_INFO *pPointerShapeInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *MapDesktopSurface )(
+ IDXGIOutputDuplication * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MAPPED_RECT *pLockedRect);
+
+ HRESULT ( STDMETHODCALLTYPE *UnMapDesktopSurface )(
+ IDXGIOutputDuplication * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReleaseFrame )(
+ IDXGIOutputDuplication * This);
+
+ END_INTERFACE
+ } IDXGIOutputDuplicationVtbl;
+
+ interface IDXGIOutputDuplication
+ {
+ CONST_VTBL struct IDXGIOutputDuplicationVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIOutputDuplication_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIOutputDuplication_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIOutputDuplication_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIOutputDuplication_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIOutputDuplication_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIOutputDuplication_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIOutputDuplication_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIOutputDuplication_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIOutputDuplication_AcquireNextFrame(This,TimeoutInMilliseconds,pFrameInfo,ppDesktopResource) \
+ ( (This)->lpVtbl -> AcquireNextFrame(This,TimeoutInMilliseconds,pFrameInfo,ppDesktopResource) )
+
+#define IDXGIOutputDuplication_GetFrameDirtyRects(This,DirtyRectsBufferSize,pDirtyRectsBuffer,pDirtyRectsBufferSizeRequired) \
+ ( (This)->lpVtbl -> GetFrameDirtyRects(This,DirtyRectsBufferSize,pDirtyRectsBuffer,pDirtyRectsBufferSizeRequired) )
+
+#define IDXGIOutputDuplication_GetFrameMoveRects(This,MoveRectsBufferSize,pMoveRectBuffer,pMoveRectsBufferSizeRequired) \
+ ( (This)->lpVtbl -> GetFrameMoveRects(This,MoveRectsBufferSize,pMoveRectBuffer,pMoveRectsBufferSizeRequired) )
+
+#define IDXGIOutputDuplication_GetFramePointerShape(This,PointerShapeBufferSize,pPointerShapeBuffer,pPointerShapeBufferSizeRequired,pPointerShapeInfo) \
+ ( (This)->lpVtbl -> GetFramePointerShape(This,PointerShapeBufferSize,pPointerShapeBuffer,pPointerShapeBufferSizeRequired,pPointerShapeInfo) )
+
+#define IDXGIOutputDuplication_MapDesktopSurface(This,pLockedRect) \
+ ( (This)->lpVtbl -> MapDesktopSurface(This,pLockedRect) )
+
+#define IDXGIOutputDuplication_UnMapDesktopSurface(This) \
+ ( (This)->lpVtbl -> UnMapDesktopSurface(This) )
+
+#define IDXGIOutputDuplication_ReleaseFrame(This) \
+ ( (This)->lpVtbl -> ReleaseFrame(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIOutputDuplication_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0002 */
+/* [local] */
+
+typedef
+enum DXGI_ALPHA_MODE
+ {
+ DXGI_ALPHA_MODE_UNSPECIFIED = 0,
+ DXGI_ALPHA_MODE_PREMULTIPLIED = 1,
+ DXGI_ALPHA_MODE_STRAIGHT = 2,
+ DXGI_ALPHA_MODE_IGNORE = 3,
+ DXGI_ALPHA_MODE_FORCE_DWORD = 0xffffffff
+ } DXGI_ALPHA_MODE;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0002_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0002_v0_0_s_ifspec;
+
+#ifndef __IDXGISurface2_INTERFACE_DEFINED__
+#define __IDXGISurface2_INTERFACE_DEFINED__
+
+/* interface IDXGISurface2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGISurface2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("aba496dd-b617-4cb8-a866-bc44d7eb1fa2")
+ IDXGISurface2 : public IDXGISurface1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetResource(
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppParentResource,
+ /* [annotation][out] */
+ _Out_ UINT *pSubresourceIndex) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGISurface2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGISurface2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGISurface2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGISurface2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGISurface2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SURFACE_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ IDXGISurface2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MAPPED_RECT *pLockedRect,
+ /* [in] */ UINT MapFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *Unmap )(
+ IDXGISurface2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDC )(
+ IDXGISurface2 * This,
+ /* [in] */ BOOL Discard,
+ /* [annotation][out] */
+ _Out_ HDC *phdc);
+
+ HRESULT ( STDMETHODCALLTYPE *ReleaseDC )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_opt_ RECT *pDirtyRect);
+
+ HRESULT ( STDMETHODCALLTYPE *GetResource )(
+ IDXGISurface2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppParentResource,
+ /* [annotation][out] */
+ _Out_ UINT *pSubresourceIndex);
+
+ END_INTERFACE
+ } IDXGISurface2Vtbl;
+
+ interface IDXGISurface2
+ {
+ CONST_VTBL struct IDXGISurface2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGISurface2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGISurface2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGISurface2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGISurface2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGISurface2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGISurface2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGISurface2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGISurface2_GetDevice(This,riid,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
+
+
+#define IDXGISurface2_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGISurface2_Map(This,pLockedRect,MapFlags) \
+ ( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) )
+
+#define IDXGISurface2_Unmap(This) \
+ ( (This)->lpVtbl -> Unmap(This) )
+
+
+#define IDXGISurface2_GetDC(This,Discard,phdc) \
+ ( (This)->lpVtbl -> GetDC(This,Discard,phdc) )
+
+#define IDXGISurface2_ReleaseDC(This,pDirtyRect) \
+ ( (This)->lpVtbl -> ReleaseDC(This,pDirtyRect) )
+
+
+#define IDXGISurface2_GetResource(This,riid,ppParentResource,pSubresourceIndex) \
+ ( (This)->lpVtbl -> GetResource(This,riid,ppParentResource,pSubresourceIndex) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGISurface2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIResource1_INTERFACE_DEFINED__
+#define __IDXGIResource1_INTERFACE_DEFINED__
+
+/* interface IDXGIResource1 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIResource1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("30961379-4609-4a41-998e-54fe567ee0c1")
+ IDXGIResource1 : public IDXGIResource
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateSubresourceSurface(
+ UINT index,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISurface2 **ppSurface) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSharedHandle(
+ /* [annotation][in] */
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ /* [annotation][in] */
+ _In_ DWORD dwAccess,
+ /* [annotation][in] */
+ _In_opt_ LPCWSTR lpName,
+ /* [annotation][out] */
+ _Out_ HANDLE *pHandle) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIResource1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIResource1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIResource1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIResource1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSharedHandle )(
+ IDXGIResource1 * This,
+ /* [annotation][out] */
+ _Out_ HANDLE *pSharedHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *GetUsage )(
+ IDXGIResource1 * This,
+ /* [out] */ DXGI_USAGE *pUsage);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEvictionPriority )(
+ IDXGIResource1 * This,
+ /* [in] */ UINT EvictionPriority);
+
+ HRESULT ( STDMETHODCALLTYPE *GetEvictionPriority )(
+ IDXGIResource1 * This,
+ /* [annotation][retval][out] */
+ _Out_ UINT *pEvictionPriority);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSubresourceSurface )(
+ IDXGIResource1 * This,
+ UINT index,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISurface2 **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ IDXGIResource1 * This,
+ /* [annotation][in] */
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ /* [annotation][in] */
+ _In_ DWORD dwAccess,
+ /* [annotation][in] */
+ _In_opt_ LPCWSTR lpName,
+ /* [annotation][out] */
+ _Out_ HANDLE *pHandle);
+
+ END_INTERFACE
+ } IDXGIResource1Vtbl;
+
+ interface IDXGIResource1
+ {
+ CONST_VTBL struct IDXGIResource1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIResource1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIResource1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIResource1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIResource1_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIResource1_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIResource1_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIResource1_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIResource1_GetDevice(This,riid,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
+
+
+#define IDXGIResource1_GetSharedHandle(This,pSharedHandle) \
+ ( (This)->lpVtbl -> GetSharedHandle(This,pSharedHandle) )
+
+#define IDXGIResource1_GetUsage(This,pUsage) \
+ ( (This)->lpVtbl -> GetUsage(This,pUsage) )
+
+#define IDXGIResource1_SetEvictionPriority(This,EvictionPriority) \
+ ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) )
+
+#define IDXGIResource1_GetEvictionPriority(This,pEvictionPriority) \
+ ( (This)->lpVtbl -> GetEvictionPriority(This,pEvictionPriority) )
+
+
+#define IDXGIResource1_CreateSubresourceSurface(This,index,ppSurface) \
+ ( (This)->lpVtbl -> CreateSubresourceSurface(This,index,ppSurface) )
+
+#define IDXGIResource1_CreateSharedHandle(This,pAttributes,dwAccess,lpName,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pAttributes,dwAccess,lpName,pHandle) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIResource1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0004 */
+/* [local] */
+
+typedef
+enum _DXGI_OFFER_RESOURCE_PRIORITY
+ {
+ DXGI_OFFER_RESOURCE_PRIORITY_LOW = 1,
+ DXGI_OFFER_RESOURCE_PRIORITY_NORMAL = ( DXGI_OFFER_RESOURCE_PRIORITY_LOW + 1 ) ,
+ DXGI_OFFER_RESOURCE_PRIORITY_HIGH = ( DXGI_OFFER_RESOURCE_PRIORITY_NORMAL + 1 )
+ } DXGI_OFFER_RESOURCE_PRIORITY;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0004_v0_0_s_ifspec;
+
+#ifndef __IDXGIDevice2_INTERFACE_DEFINED__
+#define __IDXGIDevice2_INTERFACE_DEFINED__
+
+/* interface IDXGIDevice2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIDevice2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("05008617-fbfd-4051-a790-144884b4f6a9")
+ IDXGIDevice2 : public IDXGIDevice1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE OfferResources(
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][in] */
+ _In_ DXGI_OFFER_RESOURCE_PRIORITY Priority) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReclaimResources(
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][size_is][out] */
+ _Out_writes_all_opt_(NumResources) BOOL *pDiscarded) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnqueueSetEvent(
+ /* [annotation][in] */
+ _In_ HANDLE hEvent) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDevice2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDevice2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDevice2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDevice2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAdapter )(
+ IDXGIDevice2 * This,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **pAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSurface )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_SURFACE_DESC *pDesc,
+ /* [in] */ UINT NumSurfaces,
+ /* [in] */ DXGI_USAGE Usage,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SHARED_RESOURCE *pSharedResource,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISurface **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )(
+ IDXGIDevice2 * This,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IUnknown *const *ppResources,
+ /* [annotation][size_is][out] */
+ _Out_writes_(NumResources) DXGI_RESIDENCY *pResidencyStatus,
+ /* [in] */ UINT NumResources);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )(
+ IDXGIDevice2 * This,
+ /* [in] */ INT Priority);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )(
+ IDXGIDevice2 * This,
+ /* [annotation][retval][out] */
+ _Out_ INT *pPriority);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )(
+ IDXGIDevice2 * This,
+ /* [in] */ UINT MaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )(
+ IDXGIDevice2 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pMaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *OfferResources )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][in] */
+ _In_ DXGI_OFFER_RESOURCE_PRIORITY Priority);
+
+ HRESULT ( STDMETHODCALLTYPE *ReclaimResources )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][size_is][out] */
+ _Out_writes_all_opt_(NumResources) BOOL *pDiscarded);
+
+ HRESULT ( STDMETHODCALLTYPE *EnqueueSetEvent )(
+ IDXGIDevice2 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent);
+
+ END_INTERFACE
+ } IDXGIDevice2Vtbl;
+
+ interface IDXGIDevice2
+ {
+ CONST_VTBL struct IDXGIDevice2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDevice2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDevice2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDevice2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDevice2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIDevice2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIDevice2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIDevice2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIDevice2_GetAdapter(This,pAdapter) \
+ ( (This)->lpVtbl -> GetAdapter(This,pAdapter) )
+
+#define IDXGIDevice2_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \
+ ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) )
+
+#define IDXGIDevice2_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \
+ ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) )
+
+#define IDXGIDevice2_SetGPUThreadPriority(This,Priority) \
+ ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) )
+
+#define IDXGIDevice2_GetGPUThreadPriority(This,pPriority) \
+ ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) )
+
+
+#define IDXGIDevice2_SetMaximumFrameLatency(This,MaxLatency) \
+ ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) )
+
+#define IDXGIDevice2_GetMaximumFrameLatency(This,pMaxLatency) \
+ ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) )
+
+
+#define IDXGIDevice2_OfferResources(This,NumResources,ppResources,Priority) \
+ ( (This)->lpVtbl -> OfferResources(This,NumResources,ppResources,Priority) )
+
+#define IDXGIDevice2_ReclaimResources(This,NumResources,ppResources,pDiscarded) \
+ ( (This)->lpVtbl -> ReclaimResources(This,NumResources,ppResources,pDiscarded) )
+
+#define IDXGIDevice2_EnqueueSetEvent(This,hEvent) \
+ ( (This)->lpVtbl -> EnqueueSetEvent(This,hEvent) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDevice2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0005 */
+/* [local] */
+
+#define DXGI_ENUM_MODES_STEREO ( 4UL )
+
+#define DXGI_ENUM_MODES_DISABLED_STEREO ( 8UL )
+
+#define DXGI_SHARED_RESOURCE_READ ( 0x80000000L )
+
+#define DXGI_SHARED_RESOURCE_WRITE ( 1 )
+
+typedef struct DXGI_MODE_DESC1
+ {
+ UINT Width;
+ UINT Height;
+ DXGI_RATIONAL RefreshRate;
+ DXGI_FORMAT Format;
+ DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
+ DXGI_MODE_SCALING Scaling;
+ BOOL Stereo;
+ } DXGI_MODE_DESC1;
+
+typedef
+enum DXGI_SCALING
+ {
+ DXGI_SCALING_STRETCH = 0,
+ DXGI_SCALING_NONE = 1,
+ DXGI_SCALING_ASPECT_RATIO_STRETCH = 2
+ } DXGI_SCALING;
+
+typedef struct DXGI_SWAP_CHAIN_DESC1
+ {
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT Format;
+ BOOL Stereo;
+ DXGI_SAMPLE_DESC SampleDesc;
+ DXGI_USAGE BufferUsage;
+ UINT BufferCount;
+ DXGI_SCALING Scaling;
+ DXGI_SWAP_EFFECT SwapEffect;
+ DXGI_ALPHA_MODE AlphaMode;
+ UINT Flags;
+ } DXGI_SWAP_CHAIN_DESC1;
+
+typedef struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC
+ {
+ DXGI_RATIONAL RefreshRate;
+ DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
+ DXGI_MODE_SCALING Scaling;
+ BOOL Windowed;
+ } DXGI_SWAP_CHAIN_FULLSCREEN_DESC;
+
+typedef struct DXGI_PRESENT_PARAMETERS
+ {
+ UINT DirtyRectsCount;
+ RECT *pDirtyRects;
+ RECT *pScrollRect;
+ POINT *pScrollOffset;
+ } DXGI_PRESENT_PARAMETERS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0005_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0005_v0_0_s_ifspec;
+
+#ifndef __IDXGISwapChain1_INTERFACE_DEFINED__
+#define __IDXGISwapChain1_INTERFACE_DEFINED__
+
+/* interface IDXGISwapChain1 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGISwapChain1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("790a45f7-0d42-4876-983a-0a55cfe6f4aa")
+ IDXGISwapChain1 : public IDXGISwapChain
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetDesc1(
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC1 *pDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFullscreenDesc(
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetHwnd(
+ /* [annotation][out] */
+ _Out_ HWND *pHwnd) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCoreWindow(
+ /* [annotation][in] */
+ _In_ REFIID refiid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppUnk) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Present1(
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT PresentFlags,
+ /* [annotation][in] */
+ _In_ const DXGI_PRESENT_PARAMETERS *pPresentParameters) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE IsTemporaryMonoSupported( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRestrictToOutput(
+ /* [annotation][out] */
+ _Out_ IDXGIOutput **ppRestrictToOutput) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBackgroundColor(
+ /* [annotation][in] */
+ _In_ const DXGI_RGBA *pColor) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetBackgroundColor(
+ /* [annotation][out] */
+ _Out_ DXGI_RGBA *pColor) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetRotation(
+ /* [annotation][in] */
+ _In_ DXGI_MODE_ROTATION Rotation) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRotation(
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_ROTATION *pRotation) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGISwapChain1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGISwapChain1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGISwapChain1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGISwapChain1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *Present )(
+ IDXGISwapChain1 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBuffer )(
+ IDXGISwapChain1 * This,
+ /* [in] */ UINT Buffer,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][out][in] */
+ _COM_Outptr_ void **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )(
+ IDXGISwapChain1 * This,
+ /* [in] */ BOOL Fullscreen,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_opt_ BOOL *pFullscreen,
+ /* [annotation][out] */
+ _COM_Outptr_opt_result_maybenull_ IDXGIOutput **ppTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )(
+ IDXGISwapChain1 * This,
+ /* [in] */ UINT BufferCount,
+ /* [in] */ UINT Width,
+ /* [in] */ UINT Height,
+ /* [in] */ DXGI_FORMAT NewFormat,
+ /* [in] */ UINT SwapChainFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeTarget )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pNewTargetParameters);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutput **ppOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pLastPresentCount);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenDesc )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetHwnd )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pHwnd);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCoreWindow )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ REFIID refiid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppUnk);
+
+ HRESULT ( STDMETHODCALLTYPE *Present1 )(
+ IDXGISwapChain1 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT PresentFlags,
+ /* [annotation][in] */
+ _In_ const DXGI_PRESENT_PARAMETERS *pPresentParameters);
+
+ BOOL ( STDMETHODCALLTYPE *IsTemporaryMonoSupported )(
+ IDXGISwapChain1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRestrictToOutput )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ IDXGIOutput **ppRestrictToOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundColor )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBackgroundColor )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *SetRotation )(
+ IDXGISwapChain1 * This,
+ /* [annotation][in] */
+ _In_ DXGI_MODE_ROTATION Rotation);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRotation )(
+ IDXGISwapChain1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_ROTATION *pRotation);
+
+ END_INTERFACE
+ } IDXGISwapChain1Vtbl;
+
+ interface IDXGISwapChain1
+ {
+ CONST_VTBL struct IDXGISwapChain1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGISwapChain1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGISwapChain1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGISwapChain1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGISwapChain1_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGISwapChain1_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGISwapChain1_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGISwapChain1_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGISwapChain1_GetDevice(This,riid,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
+
+
+#define IDXGISwapChain1_Present(This,SyncInterval,Flags) \
+ ( (This)->lpVtbl -> Present(This,SyncInterval,Flags) )
+
+#define IDXGISwapChain1_GetBuffer(This,Buffer,riid,ppSurface) \
+ ( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) )
+
+#define IDXGISwapChain1_SetFullscreenState(This,Fullscreen,pTarget) \
+ ( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) )
+
+#define IDXGISwapChain1_GetFullscreenState(This,pFullscreen,ppTarget) \
+ ( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) )
+
+#define IDXGISwapChain1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGISwapChain1_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \
+ ( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) )
+
+#define IDXGISwapChain1_ResizeTarget(This,pNewTargetParameters) \
+ ( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) )
+
+#define IDXGISwapChain1_GetContainingOutput(This,ppOutput) \
+ ( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) )
+
+#define IDXGISwapChain1_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+#define IDXGISwapChain1_GetLastPresentCount(This,pLastPresentCount) \
+ ( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) )
+
+
+#define IDXGISwapChain1_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#define IDXGISwapChain1_GetFullscreenDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetFullscreenDesc(This,pDesc) )
+
+#define IDXGISwapChain1_GetHwnd(This,pHwnd) \
+ ( (This)->lpVtbl -> GetHwnd(This,pHwnd) )
+
+#define IDXGISwapChain1_GetCoreWindow(This,refiid,ppUnk) \
+ ( (This)->lpVtbl -> GetCoreWindow(This,refiid,ppUnk) )
+
+#define IDXGISwapChain1_Present1(This,SyncInterval,PresentFlags,pPresentParameters) \
+ ( (This)->lpVtbl -> Present1(This,SyncInterval,PresentFlags,pPresentParameters) )
+
+#define IDXGISwapChain1_IsTemporaryMonoSupported(This) \
+ ( (This)->lpVtbl -> IsTemporaryMonoSupported(This) )
+
+#define IDXGISwapChain1_GetRestrictToOutput(This,ppRestrictToOutput) \
+ ( (This)->lpVtbl -> GetRestrictToOutput(This,ppRestrictToOutput) )
+
+#define IDXGISwapChain1_SetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> SetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain1_GetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> GetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain1_SetRotation(This,Rotation) \
+ ( (This)->lpVtbl -> SetRotation(This,Rotation) )
+
+#define IDXGISwapChain1_GetRotation(This,pRotation) \
+ ( (This)->lpVtbl -> GetRotation(This,pRotation) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGISwapChain1_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIFactory2_INTERFACE_DEFINED__
+#define __IDXGIFactory2_INTERFACE_DEFINED__
+
+/* interface IDXGIFactory2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIFactory2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("50c83a1c-e072-4c48-87b0-3630fa36a6d0")
+ IDXGIFactory2 : public IDXGIFactory1
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE IsWindowedStereoEnabled( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForHwnd(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ HWND hWnd,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ IUnknown *pWindow,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSharedResourceAdapterLuid(
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _Out_ LUID *pLuid) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterStereoStatusWindow(
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterStereoStatusEvent(
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual void STDMETHODCALLTYPE UnregisterStereoStatus(
+ /* [annotation][in] */
+ _In_ DWORD dwCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusWindow(
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusEvent(
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual void STDMETHODCALLTYPE UnregisterOcclusionStatus(
+ /* [annotation][in] */
+ _In_ DWORD dwCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForComposition(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIFactory2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIFactory2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIFactory2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIFactory2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
+ IDXGIFactory2 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
+ IDXGIFactory2 * This,
+ HWND WindowHandle,
+ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
+ IDXGIFactory2 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pWindowHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
+ IDXGIFactory2 * This,
+ /* [in] */ HMODULE Module,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )(
+ IDXGIFactory2 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter1 **ppAdapter);
+
+ BOOL ( STDMETHODCALLTYPE *IsCurrent )(
+ IDXGIFactory2 * This);
+
+ BOOL ( STDMETHODCALLTYPE *IsWindowedStereoEnabled )(
+ IDXGIFactory2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForHwnd )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ HWND hWnd,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForCoreWindow )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ IUnknown *pWindow,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSharedResourceAdapterLuid )(
+ IDXGIFactory2 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _Out_ LUID *pLuid);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusWindow )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusEvent )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterStereoStatus )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusWindow )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusEvent )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterOcclusionStatus )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForComposition )(
+ IDXGIFactory2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ END_INTERFACE
+ } IDXGIFactory2Vtbl;
+
+ interface IDXGIFactory2
+ {
+ CONST_VTBL struct IDXGIFactory2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIFactory2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIFactory2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIFactory2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIFactory2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIFactory2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIFactory2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIFactory2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIFactory2_EnumAdapters(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory2_MakeWindowAssociation(This,WindowHandle,Flags) \
+ ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) )
+
+#define IDXGIFactory2_GetWindowAssociation(This,pWindowHandle) \
+ ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) )
+
+#define IDXGIFactory2_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) )
+
+#define IDXGIFactory2_CreateSoftwareAdapter(This,Module,ppAdapter) \
+ ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) )
+
+
+#define IDXGIFactory2_EnumAdapters1(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters1(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory2_IsCurrent(This) \
+ ( (This)->lpVtbl -> IsCurrent(This) )
+
+
+#define IDXGIFactory2_IsWindowedStereoEnabled(This) \
+ ( (This)->lpVtbl -> IsWindowedStereoEnabled(This) )
+
+#define IDXGIFactory2_CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory2_CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory2_GetSharedResourceAdapterLuid(This,hResource,pLuid) \
+ ( (This)->lpVtbl -> GetSharedResourceAdapterLuid(This,hResource,pLuid) )
+
+#define IDXGIFactory2_RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory2_RegisterStereoStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory2_UnregisterStereoStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterStereoStatus(This,dwCookie) )
+
+#define IDXGIFactory2_RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory2_RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory2_UnregisterOcclusionStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterOcclusionStatus(This,dwCookie) )
+
+#define IDXGIFactory2_CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIFactory2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0007 */
+/* [local] */
+
+typedef
+enum DXGI_GRAPHICS_PREEMPTION_GRANULARITY
+ {
+ DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY = 0,
+ DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY = 1,
+ DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY = 2,
+ DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY = 3,
+ DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY = 4
+ } DXGI_GRAPHICS_PREEMPTION_GRANULARITY;
+
+typedef
+enum DXGI_COMPUTE_PREEMPTION_GRANULARITY
+ {
+ DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY = 0,
+ DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY = 1,
+ DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY = 2,
+ DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY = 3,
+ DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY = 4
+ } DXGI_COMPUTE_PREEMPTION_GRANULARITY;
+
+typedef struct DXGI_ADAPTER_DESC2
+ {
+ WCHAR Description[ 128 ];
+ UINT VendorId;
+ UINT DeviceId;
+ UINT SubSysId;
+ UINT Revision;
+ SIZE_T DedicatedVideoMemory;
+ SIZE_T DedicatedSystemMemory;
+ SIZE_T SharedSystemMemory;
+ LUID AdapterLuid;
+ UINT Flags;
+ DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity;
+ DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity;
+ } DXGI_ADAPTER_DESC2;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0007_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0007_v0_0_s_ifspec;
+
+#ifndef __IDXGIAdapter2_INTERFACE_DEFINED__
+#define __IDXGIAdapter2_INTERFACE_DEFINED__
+
+/* interface IDXGIAdapter2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIAdapter2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0AA1AE0A-FA0E-4B84-8644-E05FF8E5ACB5")
+ IDXGIAdapter2 : public IDXGIAdapter1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetDesc2(
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC2 *pDesc) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIAdapter2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIAdapter2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIAdapter2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIAdapter2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIAdapter2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIAdapter2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIAdapter2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIAdapter2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
+ IDXGIAdapter2 * This,
+ /* [in] */ UINT Output,
+ /* [annotation][out][in] */
+ _COM_Outptr_ IDXGIOutput **ppOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIAdapter2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
+ IDXGIAdapter2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID InterfaceName,
+ /* [annotation][out] */
+ _Out_ LARGE_INTEGER *pUMDVersion);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
+ IDXGIAdapter2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc2 )(
+ IDXGIAdapter2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC2 *pDesc);
+
+ END_INTERFACE
+ } IDXGIAdapter2Vtbl;
+
+ interface IDXGIAdapter2
+ {
+ CONST_VTBL struct IDXGIAdapter2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIAdapter2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIAdapter2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIAdapter2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIAdapter2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIAdapter2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIAdapter2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIAdapter2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIAdapter2_EnumOutputs(This,Output,ppOutput) \
+ ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) )
+
+#define IDXGIAdapter2_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIAdapter2_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \
+ ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) )
+
+
+#define IDXGIAdapter2_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+
+#define IDXGIAdapter2_GetDesc2(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc2(This,pDesc) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIAdapter2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIOutput1_INTERFACE_DEFINED__
+#define __IDXGIOutput1_INTERFACE_DEFINED__
+
+/* interface IDXGIOutput1 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIOutput1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("00cddea8-939b-4b83-a340-a685226666cc")
+ IDXGIOutput1 : public IDXGIOutput
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList1(
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode1(
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC1 *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC1 *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData1(
+ /* [annotation][in] */
+ _In_ IDXGIResource *pDestination) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DuplicateOutput(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIOutput1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIOutput1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIOutput1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIOutput1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIOutput1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTPUT_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
+ IDXGIOutput1 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
+ IDXGIOutput1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ BOOL Exclusive);
+
+ void ( STDMETHODCALLTYPE *ReleaseOwnership )(
+ IDXGIOutput1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
+ IDXGIOutput1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
+ IDXGIOutput1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pScanoutSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGIOutput1 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
+ IDXGIOutput1 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC1 *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC1 *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
+ IDXGIOutput1 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
+
+ END_INTERFACE
+ } IDXGIOutput1Vtbl;
+
+ interface IDXGIOutput1
+ {
+ CONST_VTBL struct IDXGIOutput1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIOutput1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIOutput1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIOutput1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIOutput1_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIOutput1_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIOutput1_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIOutput1_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIOutput1_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIOutput1_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput1_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput1_WaitForVBlank(This) \
+ ( (This)->lpVtbl -> WaitForVBlank(This) )
+
+#define IDXGIOutput1_TakeOwnership(This,pDevice,Exclusive) \
+ ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
+
+#define IDXGIOutput1_ReleaseOwnership(This) \
+ ( (This)->lpVtbl -> ReleaseOwnership(This) )
+
+#define IDXGIOutput1_GetGammaControlCapabilities(This,pGammaCaps) \
+ ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
+
+#define IDXGIOutput1_SetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> SetGammaControl(This,pArray) )
+
+#define IDXGIOutput1_GetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> GetGammaControl(This,pArray) )
+
+#define IDXGIOutput1_SetDisplaySurface(This,pScanoutSurface) \
+ ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
+
+#define IDXGIOutput1_GetDisplaySurfaceData(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
+
+#define IDXGIOutput1_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+
+#define IDXGIOutput1_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput1_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput1_GetDisplaySurfaceData1(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
+
+#define IDXGIOutput1_DuplicateOutput(This,pDevice,ppOutputDuplication) \
+ ( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIOutput1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_2_0000_0009 */
+/* [local] */
+
+DEFINE_GUID(IID_IDXGIDisplayControl,0xea9dbf1a,0xc88e,0x4486,0x85,0x4a,0x98,0xaa,0x01,0x38,0xf3,0x0c);
+DEFINE_GUID(IID_IDXGIOutputDuplication,0x191cfac3,0xa341,0x470d,0xb2,0x6e,0xa8,0x64,0xf4,0x28,0x31,0x9c);
+DEFINE_GUID(IID_IDXGISurface2,0xaba496dd,0xb617,0x4cb8,0xa8,0x66,0xbc,0x44,0xd7,0xeb,0x1f,0xa2);
+DEFINE_GUID(IID_IDXGIResource1,0x30961379,0x4609,0x4a41,0x99,0x8e,0x54,0xfe,0x56,0x7e,0xe0,0xc1);
+DEFINE_GUID(IID_IDXGIDevice2,0x05008617,0xfbfd,0x4051,0xa7,0x90,0x14,0x48,0x84,0xb4,0xf6,0xa9);
+DEFINE_GUID(IID_IDXGISwapChain1,0x790a45f7,0x0d42,0x4876,0x98,0x3a,0x0a,0x55,0xcf,0xe6,0xf4,0xaa);
+DEFINE_GUID(IID_IDXGIFactory2,0x50c83a1c,0xe072,0x4c48,0x87,0xb0,0x36,0x30,0xfa,0x36,0xa6,0xd0);
+DEFINE_GUID(IID_IDXGIAdapter2,0x0AA1AE0A,0xFA0E,0x4B84,0x86,0x44,0xE0,0x5F,0xF8,0xE5,0xAC,0xB5);
+DEFINE_GUID(IID_IDXGIOutput1,0x00cddea8,0x939b,0x4b83,0xa3,0x40,0xa6,0x85,0x22,0x66,0x66,0xcc);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0009_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_2_0000_0009_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h
new file mode 100644
index 00000000000..a11f6b65c82
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h
@@ -0,0 +1,2108 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __dxgi1_3_h__
+#define __dxgi1_3_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IDXGIDevice3_FWD_DEFINED__
+#define __IDXGIDevice3_FWD_DEFINED__
+typedef interface IDXGIDevice3 IDXGIDevice3;
+
+#endif /* __IDXGIDevice3_FWD_DEFINED__ */
+
+
+#ifndef __IDXGISwapChain2_FWD_DEFINED__
+#define __IDXGISwapChain2_FWD_DEFINED__
+typedef interface IDXGISwapChain2 IDXGISwapChain2;
+
+#endif /* __IDXGISwapChain2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIOutput2_FWD_DEFINED__
+#define __IDXGIOutput2_FWD_DEFINED__
+typedef interface IDXGIOutput2 IDXGIOutput2;
+
+#endif /* __IDXGIOutput2_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIFactory3_FWD_DEFINED__
+#define __IDXGIFactory3_FWD_DEFINED__
+typedef interface IDXGIFactory3 IDXGIFactory3;
+
+#endif /* __IDXGIFactory3_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIDecodeSwapChain_FWD_DEFINED__
+#define __IDXGIDecodeSwapChain_FWD_DEFINED__
+typedef interface IDXGIDecodeSwapChain IDXGIDecodeSwapChain;
+
+#endif /* __IDXGIDecodeSwapChain_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIFactoryMedia_FWD_DEFINED__
+#define __IDXGIFactoryMedia_FWD_DEFINED__
+typedef interface IDXGIFactoryMedia IDXGIFactoryMedia;
+
+#endif /* __IDXGIFactoryMedia_FWD_DEFINED__ */
+
+
+#ifndef __IDXGISwapChainMedia_FWD_DEFINED__
+#define __IDXGISwapChainMedia_FWD_DEFINED__
+typedef interface IDXGISwapChainMedia IDXGISwapChainMedia;
+
+#endif /* __IDXGISwapChainMedia_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIOutput3_FWD_DEFINED__
+#define __IDXGIOutput3_FWD_DEFINED__
+typedef interface IDXGIOutput3 IDXGIOutput3;
+
+#endif /* __IDXGIOutput3_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "dxgi1_2.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0000 */
+/* [local] */
+
+#define DXGI_CREATE_FACTORY_DEBUG 0x1
+HRESULT WINAPI CreateDXGIFactory2(UINT Flags, REFIID riid, _COM_Outptr_ void **ppFactory);
+HRESULT WINAPI DXGIGetDebugInterface1(UINT Flags, REFIID riid, _COM_Outptr_ void **pDebug);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0000_v0_0_s_ifspec;
+
+#ifndef __IDXGIDevice3_INTERFACE_DEFINED__
+#define __IDXGIDevice3_INTERFACE_DEFINED__
+
+/* interface IDXGIDevice3 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIDevice3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6007896c-3244-4afd-bf18-a6d3beda5023")
+ IDXGIDevice3 : public IDXGIDevice2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Trim( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDevice3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDevice3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDevice3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDevice3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAdapter )(
+ IDXGIDevice3 * This,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **pAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSurface )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_SURFACE_DESC *pDesc,
+ /* [in] */ UINT NumSurfaces,
+ /* [in] */ DXGI_USAGE Usage,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SHARED_RESOURCE *pSharedResource,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISurface **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )(
+ IDXGIDevice3 * This,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IUnknown *const *ppResources,
+ /* [annotation][size_is][out] */
+ _Out_writes_(NumResources) DXGI_RESIDENCY *pResidencyStatus,
+ /* [in] */ UINT NumResources);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )(
+ IDXGIDevice3 * This,
+ /* [in] */ INT Priority);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )(
+ IDXGIDevice3 * This,
+ /* [annotation][retval][out] */
+ _Out_ INT *pPriority);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )(
+ IDXGIDevice3 * This,
+ /* [in] */ UINT MaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )(
+ IDXGIDevice3 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pMaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *OfferResources )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][in] */
+ _In_ DXGI_OFFER_RESOURCE_PRIORITY Priority);
+
+ HRESULT ( STDMETHODCALLTYPE *ReclaimResources )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ UINT NumResources,
+ /* [annotation][size_is][in] */
+ _In_reads_(NumResources) IDXGIResource *const *ppResources,
+ /* [annotation][size_is][out] */
+ _Out_writes_all_opt_(NumResources) BOOL *pDiscarded);
+
+ HRESULT ( STDMETHODCALLTYPE *EnqueueSetEvent )(
+ IDXGIDevice3 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent);
+
+ void ( STDMETHODCALLTYPE *Trim )(
+ IDXGIDevice3 * This);
+
+ END_INTERFACE
+ } IDXGIDevice3Vtbl;
+
+ interface IDXGIDevice3
+ {
+ CONST_VTBL struct IDXGIDevice3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDevice3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDevice3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDevice3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDevice3_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIDevice3_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIDevice3_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIDevice3_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIDevice3_GetAdapter(This,pAdapter) \
+ ( (This)->lpVtbl -> GetAdapter(This,pAdapter) )
+
+#define IDXGIDevice3_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \
+ ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) )
+
+#define IDXGIDevice3_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \
+ ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) )
+
+#define IDXGIDevice3_SetGPUThreadPriority(This,Priority) \
+ ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) )
+
+#define IDXGIDevice3_GetGPUThreadPriority(This,pPriority) \
+ ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) )
+
+
+#define IDXGIDevice3_SetMaximumFrameLatency(This,MaxLatency) \
+ ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) )
+
+#define IDXGIDevice3_GetMaximumFrameLatency(This,pMaxLatency) \
+ ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) )
+
+
+#define IDXGIDevice3_OfferResources(This,NumResources,ppResources,Priority) \
+ ( (This)->lpVtbl -> OfferResources(This,NumResources,ppResources,Priority) )
+
+#define IDXGIDevice3_ReclaimResources(This,NumResources,ppResources,pDiscarded) \
+ ( (This)->lpVtbl -> ReclaimResources(This,NumResources,ppResources,pDiscarded) )
+
+#define IDXGIDevice3_EnqueueSetEvent(This,hEvent) \
+ ( (This)->lpVtbl -> EnqueueSetEvent(This,hEvent) )
+
+
+#define IDXGIDevice3_Trim(This) \
+ ( (This)->lpVtbl -> Trim(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDevice3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0001 */
+/* [local] */
+
+typedef struct DXGI_MATRIX_3X2_F
+ {
+ FLOAT _11;
+ FLOAT _12;
+ FLOAT _21;
+ FLOAT _22;
+ FLOAT _31;
+ FLOAT _32;
+ } DXGI_MATRIX_3X2_F;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0001_v0_0_s_ifspec;
+
+#ifndef __IDXGISwapChain2_INTERFACE_DEFINED__
+#define __IDXGISwapChain2_INTERFACE_DEFINED__
+
+/* interface IDXGISwapChain2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGISwapChain2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("a8be2ac4-199f-4946-b331-79599fb98de7")
+ IDXGISwapChain2 : public IDXGISwapChain1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetSourceSize(
+ UINT Width,
+ UINT Height) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSourceSize(
+ /* [annotation][out] */
+ _Out_ UINT *pWidth,
+ /* [annotation][out] */
+ _Out_ UINT *pHeight) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency(
+ UINT MaxLatency) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency(
+ /* [annotation][out] */
+ _Out_ UINT *pMaxLatency) = 0;
+
+ virtual HANDLE STDMETHODCALLTYPE GetFrameLatencyWaitableObject( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetMatrixTransform(
+ const DXGI_MATRIX_3X2_F *pMatrix) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMatrixTransform(
+ /* [annotation][out] */
+ _Out_ DXGI_MATRIX_3X2_F *pMatrix) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGISwapChain2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGISwapChain2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGISwapChain2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGISwapChain2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *Present )(
+ IDXGISwapChain2 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBuffer )(
+ IDXGISwapChain2 * This,
+ /* [in] */ UINT Buffer,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][out][in] */
+ _COM_Outptr_ void **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )(
+ IDXGISwapChain2 * This,
+ /* [in] */ BOOL Fullscreen,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_opt_ BOOL *pFullscreen,
+ /* [annotation][out] */
+ _COM_Outptr_opt_result_maybenull_ IDXGIOutput **ppTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )(
+ IDXGISwapChain2 * This,
+ /* [in] */ UINT BufferCount,
+ /* [in] */ UINT Width,
+ /* [in] */ UINT Height,
+ /* [in] */ DXGI_FORMAT NewFormat,
+ /* [in] */ UINT SwapChainFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeTarget )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pNewTargetParameters);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutput **ppOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pLastPresentCount);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenDesc )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetHwnd )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pHwnd);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCoreWindow )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ REFIID refiid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppUnk);
+
+ HRESULT ( STDMETHODCALLTYPE *Present1 )(
+ IDXGISwapChain2 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT PresentFlags,
+ /* [annotation][in] */
+ _In_ const DXGI_PRESENT_PARAMETERS *pPresentParameters);
+
+ BOOL ( STDMETHODCALLTYPE *IsTemporaryMonoSupported )(
+ IDXGISwapChain2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRestrictToOutput )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ IDXGIOutput **ppRestrictToOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundColor )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBackgroundColor )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *SetRotation )(
+ IDXGISwapChain2 * This,
+ /* [annotation][in] */
+ _In_ DXGI_MODE_ROTATION Rotation);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRotation )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_ROTATION *pRotation);
+
+ HRESULT ( STDMETHODCALLTYPE *SetSourceSize )(
+ IDXGISwapChain2 * This,
+ UINT Width,
+ UINT Height);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSourceSize )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pWidth,
+ /* [annotation][out] */
+ _Out_ UINT *pHeight);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )(
+ IDXGISwapChain2 * This,
+ UINT MaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pMaxLatency);
+
+ HANDLE ( STDMETHODCALLTYPE *GetFrameLatencyWaitableObject )(
+ IDXGISwapChain2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMatrixTransform )(
+ IDXGISwapChain2 * This,
+ const DXGI_MATRIX_3X2_F *pMatrix);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMatrixTransform )(
+ IDXGISwapChain2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MATRIX_3X2_F *pMatrix);
+
+ END_INTERFACE
+ } IDXGISwapChain2Vtbl;
+
+ interface IDXGISwapChain2
+ {
+ CONST_VTBL struct IDXGISwapChain2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGISwapChain2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGISwapChain2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGISwapChain2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGISwapChain2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGISwapChain2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGISwapChain2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGISwapChain2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGISwapChain2_GetDevice(This,riid,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
+
+
+#define IDXGISwapChain2_Present(This,SyncInterval,Flags) \
+ ( (This)->lpVtbl -> Present(This,SyncInterval,Flags) )
+
+#define IDXGISwapChain2_GetBuffer(This,Buffer,riid,ppSurface) \
+ ( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) )
+
+#define IDXGISwapChain2_SetFullscreenState(This,Fullscreen,pTarget) \
+ ( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) )
+
+#define IDXGISwapChain2_GetFullscreenState(This,pFullscreen,ppTarget) \
+ ( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) )
+
+#define IDXGISwapChain2_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGISwapChain2_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \
+ ( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) )
+
+#define IDXGISwapChain2_ResizeTarget(This,pNewTargetParameters) \
+ ( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) )
+
+#define IDXGISwapChain2_GetContainingOutput(This,ppOutput) \
+ ( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) )
+
+#define IDXGISwapChain2_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+#define IDXGISwapChain2_GetLastPresentCount(This,pLastPresentCount) \
+ ( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) )
+
+
+#define IDXGISwapChain2_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#define IDXGISwapChain2_GetFullscreenDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetFullscreenDesc(This,pDesc) )
+
+#define IDXGISwapChain2_GetHwnd(This,pHwnd) \
+ ( (This)->lpVtbl -> GetHwnd(This,pHwnd) )
+
+#define IDXGISwapChain2_GetCoreWindow(This,refiid,ppUnk) \
+ ( (This)->lpVtbl -> GetCoreWindow(This,refiid,ppUnk) )
+
+#define IDXGISwapChain2_Present1(This,SyncInterval,PresentFlags,pPresentParameters) \
+ ( (This)->lpVtbl -> Present1(This,SyncInterval,PresentFlags,pPresentParameters) )
+
+#define IDXGISwapChain2_IsTemporaryMonoSupported(This) \
+ ( (This)->lpVtbl -> IsTemporaryMonoSupported(This) )
+
+#define IDXGISwapChain2_GetRestrictToOutput(This,ppRestrictToOutput) \
+ ( (This)->lpVtbl -> GetRestrictToOutput(This,ppRestrictToOutput) )
+
+#define IDXGISwapChain2_SetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> SetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain2_GetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> GetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain2_SetRotation(This,Rotation) \
+ ( (This)->lpVtbl -> SetRotation(This,Rotation) )
+
+#define IDXGISwapChain2_GetRotation(This,pRotation) \
+ ( (This)->lpVtbl -> GetRotation(This,pRotation) )
+
+
+#define IDXGISwapChain2_SetSourceSize(This,Width,Height) \
+ ( (This)->lpVtbl -> SetSourceSize(This,Width,Height) )
+
+#define IDXGISwapChain2_GetSourceSize(This,pWidth,pHeight) \
+ ( (This)->lpVtbl -> GetSourceSize(This,pWidth,pHeight) )
+
+#define IDXGISwapChain2_SetMaximumFrameLatency(This,MaxLatency) \
+ ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) )
+
+#define IDXGISwapChain2_GetMaximumFrameLatency(This,pMaxLatency) \
+ ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) )
+
+#define IDXGISwapChain2_GetFrameLatencyWaitableObject(This) \
+ ( (This)->lpVtbl -> GetFrameLatencyWaitableObject(This) )
+
+#define IDXGISwapChain2_SetMatrixTransform(This,pMatrix) \
+ ( (This)->lpVtbl -> SetMatrixTransform(This,pMatrix) )
+
+#define IDXGISwapChain2_GetMatrixTransform(This,pMatrix) \
+ ( (This)->lpVtbl -> GetMatrixTransform(This,pMatrix) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGISwapChain2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIOutput2_INTERFACE_DEFINED__
+#define __IDXGIOutput2_INTERFACE_DEFINED__
+
+/* interface IDXGIOutput2 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIOutput2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("595e39d1-2724-4663-99b1-da969de28364")
+ IDXGIOutput2 : public IDXGIOutput1
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE SupportsOverlays( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIOutput2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIOutput2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIOutput2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIOutput2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIOutput2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTPUT_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
+ IDXGIOutput2 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
+ IDXGIOutput2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ BOOL Exclusive);
+
+ void ( STDMETHODCALLTYPE *ReleaseOwnership )(
+ IDXGIOutput2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
+ IDXGIOutput2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
+ IDXGIOutput2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pScanoutSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGIOutput2 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
+ IDXGIOutput2 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC1 *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC1 *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
+ IDXGIOutput2 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
+
+ BOOL ( STDMETHODCALLTYPE *SupportsOverlays )(
+ IDXGIOutput2 * This);
+
+ END_INTERFACE
+ } IDXGIOutput2Vtbl;
+
+ interface IDXGIOutput2
+ {
+ CONST_VTBL struct IDXGIOutput2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIOutput2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIOutput2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIOutput2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIOutput2_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIOutput2_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIOutput2_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIOutput2_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIOutput2_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIOutput2_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput2_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput2_WaitForVBlank(This) \
+ ( (This)->lpVtbl -> WaitForVBlank(This) )
+
+#define IDXGIOutput2_TakeOwnership(This,pDevice,Exclusive) \
+ ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
+
+#define IDXGIOutput2_ReleaseOwnership(This) \
+ ( (This)->lpVtbl -> ReleaseOwnership(This) )
+
+#define IDXGIOutput2_GetGammaControlCapabilities(This,pGammaCaps) \
+ ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
+
+#define IDXGIOutput2_SetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> SetGammaControl(This,pArray) )
+
+#define IDXGIOutput2_GetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> GetGammaControl(This,pArray) )
+
+#define IDXGIOutput2_SetDisplaySurface(This,pScanoutSurface) \
+ ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
+
+#define IDXGIOutput2_GetDisplaySurfaceData(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
+
+#define IDXGIOutput2_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+
+#define IDXGIOutput2_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput2_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput2_GetDisplaySurfaceData1(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
+
+#define IDXGIOutput2_DuplicateOutput(This,pDevice,ppOutputDuplication) \
+ ( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
+
+
+#define IDXGIOutput2_SupportsOverlays(This) \
+ ( (This)->lpVtbl -> SupportsOverlays(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIOutput2_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIFactory3_INTERFACE_DEFINED__
+#define __IDXGIFactory3_INTERFACE_DEFINED__
+
+/* interface IDXGIFactory3 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIFactory3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("25483823-cd46-4c7d-86ca-47aa95b837bd")
+ IDXGIFactory3 : public IDXGIFactory2
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIFactory3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIFactory3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIFactory3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIFactory3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
+ IDXGIFactory3 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
+ IDXGIFactory3 * This,
+ HWND WindowHandle,
+ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
+ IDXGIFactory3 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pWindowHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
+ IDXGIFactory3 * This,
+ /* [in] */ HMODULE Module,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )(
+ IDXGIFactory3 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter1 **ppAdapter);
+
+ BOOL ( STDMETHODCALLTYPE *IsCurrent )(
+ IDXGIFactory3 * This);
+
+ BOOL ( STDMETHODCALLTYPE *IsWindowedStereoEnabled )(
+ IDXGIFactory3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForHwnd )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ HWND hWnd,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForCoreWindow )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ IUnknown *pWindow,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSharedResourceAdapterLuid )(
+ IDXGIFactory3 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _Out_ LUID *pLuid);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusWindow )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusEvent )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterStereoStatus )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusWindow )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusEvent )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterOcclusionStatus )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForComposition )(
+ IDXGIFactory3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
+ IDXGIFactory3 * This);
+
+ END_INTERFACE
+ } IDXGIFactory3Vtbl;
+
+ interface IDXGIFactory3
+ {
+ CONST_VTBL struct IDXGIFactory3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIFactory3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIFactory3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIFactory3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIFactory3_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIFactory3_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIFactory3_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIFactory3_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIFactory3_EnumAdapters(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory3_MakeWindowAssociation(This,WindowHandle,Flags) \
+ ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) )
+
+#define IDXGIFactory3_GetWindowAssociation(This,pWindowHandle) \
+ ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) )
+
+#define IDXGIFactory3_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) )
+
+#define IDXGIFactory3_CreateSoftwareAdapter(This,Module,ppAdapter) \
+ ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) )
+
+
+#define IDXGIFactory3_EnumAdapters1(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters1(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory3_IsCurrent(This) \
+ ( (This)->lpVtbl -> IsCurrent(This) )
+
+
+#define IDXGIFactory3_IsWindowedStereoEnabled(This) \
+ ( (This)->lpVtbl -> IsWindowedStereoEnabled(This) )
+
+#define IDXGIFactory3_CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory3_CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory3_GetSharedResourceAdapterLuid(This,hResource,pLuid) \
+ ( (This)->lpVtbl -> GetSharedResourceAdapterLuid(This,hResource,pLuid) )
+
+#define IDXGIFactory3_RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory3_RegisterStereoStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory3_UnregisterStereoStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterStereoStatus(This,dwCookie) )
+
+#define IDXGIFactory3_RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory3_RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory3_UnregisterOcclusionStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterOcclusionStatus(This,dwCookie) )
+
+#define IDXGIFactory3_CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) )
+
+
+#define IDXGIFactory3_GetCreationFlags(This) \
+ ( (This)->lpVtbl -> GetCreationFlags(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIFactory3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0004 */
+/* [local] */
+
+typedef struct DXGI_DECODE_SWAP_CHAIN_DESC
+ {
+ UINT Flags;
+ } DXGI_DECODE_SWAP_CHAIN_DESC;
+
+typedef
+enum DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS
+ {
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE = 0x1,
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709 = 0x2,
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_xvYCC = 0x4
+ } DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0004_v0_0_s_ifspec;
+
+#ifndef __IDXGIDecodeSwapChain_INTERFACE_DEFINED__
+#define __IDXGIDecodeSwapChain_INTERFACE_DEFINED__
+
+/* interface IDXGIDecodeSwapChain */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIDecodeSwapChain;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2633066b-4514-4c7a-8fd8-12ea98059d18")
+ IDXGIDecodeSwapChain : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE PresentBuffer(
+ UINT BufferToPresent,
+ UINT SyncInterval,
+ UINT Flags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSourceRect(
+ const RECT *pRect) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetTargetRect(
+ const RECT *pRect) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDestSize(
+ UINT Width,
+ UINT Height) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSourceRect(
+ /* [annotation][out] */
+ _Out_ RECT *pRect) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTargetRect(
+ /* [annotation][out] */
+ _Out_ RECT *pRect) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDestSize(
+ /* [annotation][out] */
+ _Out_ UINT *pWidth,
+ /* [annotation][out] */
+ _Out_ UINT *pHeight) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetColorSpace(
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS ColorSpace) = 0;
+
+ virtual DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS STDMETHODCALLTYPE GetColorSpace( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDecodeSwapChainVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDecodeSwapChain * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDecodeSwapChain * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDecodeSwapChain * This);
+
+ HRESULT ( STDMETHODCALLTYPE *PresentBuffer )(
+ IDXGIDecodeSwapChain * This,
+ UINT BufferToPresent,
+ UINT SyncInterval,
+ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *SetSourceRect )(
+ IDXGIDecodeSwapChain * This,
+ const RECT *pRect);
+
+ HRESULT ( STDMETHODCALLTYPE *SetTargetRect )(
+ IDXGIDecodeSwapChain * This,
+ const RECT *pRect);
+
+ HRESULT ( STDMETHODCALLTYPE *SetDestSize )(
+ IDXGIDecodeSwapChain * This,
+ UINT Width,
+ UINT Height);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSourceRect )(
+ IDXGIDecodeSwapChain * This,
+ /* [annotation][out] */
+ _Out_ RECT *pRect);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTargetRect )(
+ IDXGIDecodeSwapChain * This,
+ /* [annotation][out] */
+ _Out_ RECT *pRect);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDestSize )(
+ IDXGIDecodeSwapChain * This,
+ /* [annotation][out] */
+ _Out_ UINT *pWidth,
+ /* [annotation][out] */
+ _Out_ UINT *pHeight);
+
+ HRESULT ( STDMETHODCALLTYPE *SetColorSpace )(
+ IDXGIDecodeSwapChain * This,
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS ColorSpace);
+
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS ( STDMETHODCALLTYPE *GetColorSpace )(
+ IDXGIDecodeSwapChain * This);
+
+ END_INTERFACE
+ } IDXGIDecodeSwapChainVtbl;
+
+ interface IDXGIDecodeSwapChain
+ {
+ CONST_VTBL struct IDXGIDecodeSwapChainVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDecodeSwapChain_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDecodeSwapChain_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDecodeSwapChain_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDecodeSwapChain_PresentBuffer(This,BufferToPresent,SyncInterval,Flags) \
+ ( (This)->lpVtbl -> PresentBuffer(This,BufferToPresent,SyncInterval,Flags) )
+
+#define IDXGIDecodeSwapChain_SetSourceRect(This,pRect) \
+ ( (This)->lpVtbl -> SetSourceRect(This,pRect) )
+
+#define IDXGIDecodeSwapChain_SetTargetRect(This,pRect) \
+ ( (This)->lpVtbl -> SetTargetRect(This,pRect) )
+
+#define IDXGIDecodeSwapChain_SetDestSize(This,Width,Height) \
+ ( (This)->lpVtbl -> SetDestSize(This,Width,Height) )
+
+#define IDXGIDecodeSwapChain_GetSourceRect(This,pRect) \
+ ( (This)->lpVtbl -> GetSourceRect(This,pRect) )
+
+#define IDXGIDecodeSwapChain_GetTargetRect(This,pRect) \
+ ( (This)->lpVtbl -> GetTargetRect(This,pRect) )
+
+#define IDXGIDecodeSwapChain_GetDestSize(This,pWidth,pHeight) \
+ ( (This)->lpVtbl -> GetDestSize(This,pWidth,pHeight) )
+
+#define IDXGIDecodeSwapChain_SetColorSpace(This,ColorSpace) \
+ ( (This)->lpVtbl -> SetColorSpace(This,ColorSpace) )
+
+#define IDXGIDecodeSwapChain_GetColorSpace(This) \
+ ( (This)->lpVtbl -> GetColorSpace(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDecodeSwapChain_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIFactoryMedia_INTERFACE_DEFINED__
+#define __IDXGIFactoryMedia_INTERFACE_DEFINED__
+
+/* interface IDXGIFactoryMedia */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIFactoryMedia;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("41e7d1f2-a591-4f7b-a2e5-fa9c843e1c12")
+ IDXGIFactoryMedia : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForCompositionSurfaceHandle(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_opt_ HANDLE hSurface,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDecodeSwapChainForCompositionSurfaceHandle(
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_opt_ HANDLE hSurface,
+ /* [annotation][in] */
+ _In_ DXGI_DECODE_SWAP_CHAIN_DESC *pDesc,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pYuvDecodeBuffers,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIDecodeSwapChain **ppSwapChain) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIFactoryMediaVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIFactoryMedia * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIFactoryMedia * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIFactoryMedia * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForCompositionSurfaceHandle )(
+ IDXGIFactoryMedia * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_opt_ HANDLE hSurface,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateDecodeSwapChainForCompositionSurfaceHandle )(
+ IDXGIFactoryMedia * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_opt_ HANDLE hSurface,
+ /* [annotation][in] */
+ _In_ DXGI_DECODE_SWAP_CHAIN_DESC *pDesc,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pYuvDecodeBuffers,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIDecodeSwapChain **ppSwapChain);
+
+ END_INTERFACE
+ } IDXGIFactoryMediaVtbl;
+
+ interface IDXGIFactoryMedia
+ {
+ CONST_VTBL struct IDXGIFactoryMediaVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIFactoryMedia_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIFactoryMedia_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIFactoryMedia_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIFactoryMedia_CreateSwapChainForCompositionSurfaceHandle(This,pDevice,hSurface,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForCompositionSurfaceHandle(This,pDevice,hSurface,pDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactoryMedia_CreateDecodeSwapChainForCompositionSurfaceHandle(This,pDevice,hSurface,pDesc,pYuvDecodeBuffers,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateDecodeSwapChainForCompositionSurfaceHandle(This,pDevice,hSurface,pDesc,pYuvDecodeBuffers,pRestrictToOutput,ppSwapChain) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIFactoryMedia_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0006 */
+/* [local] */
+
+typedef
+enum DXGI_FRAME_PRESENTATION_MODE
+ {
+ DXGI_FRAME_PRESENTATION_MODE_COMPOSED = 0,
+ DXGI_FRAME_PRESENTATION_MODE_OVERLAY = 1,
+ DXGI_FRAME_PRESENTATION_MODE_NONE = 2,
+ DXGI_FRAME_PRESENTATION_MODE_COMPOSITION_FAILURE = 3
+ } DXGI_FRAME_PRESENTATION_MODE;
+
+typedef struct DXGI_FRAME_STATISTICS_MEDIA
+ {
+ UINT PresentCount;
+ UINT PresentRefreshCount;
+ UINT SyncRefreshCount;
+ LARGE_INTEGER SyncQPCTime;
+ LARGE_INTEGER SyncGPUTime;
+ DXGI_FRAME_PRESENTATION_MODE CompositionMode;
+ UINT ApprovedPresentDuration;
+ } DXGI_FRAME_STATISTICS_MEDIA;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0006_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0006_v0_0_s_ifspec;
+
+#ifndef __IDXGISwapChainMedia_INTERFACE_DEFINED__
+#define __IDXGISwapChainMedia_INTERFACE_DEFINED__
+
+/* interface IDXGISwapChainMedia */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGISwapChainMedia;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("dd95b90b-f05f-4f6a-bd65-25bfb264bd84")
+ IDXGISwapChainMedia : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetFrameStatisticsMedia(
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS_MEDIA *pStats) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPresentDuration(
+ UINT Duration) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckPresentDurationSupport(
+ UINT DesiredPresentDuration,
+ /* [annotation][out] */
+ _Out_ UINT *pClosestSmallerPresentDuration,
+ /* [annotation][out] */
+ _Out_ UINT *pClosestLargerPresentDuration) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGISwapChainMediaVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGISwapChainMedia * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGISwapChainMedia * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGISwapChainMedia * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatisticsMedia )(
+ IDXGISwapChainMedia * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS_MEDIA *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPresentDuration )(
+ IDXGISwapChainMedia * This,
+ UINT Duration);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckPresentDurationSupport )(
+ IDXGISwapChainMedia * This,
+ UINT DesiredPresentDuration,
+ /* [annotation][out] */
+ _Out_ UINT *pClosestSmallerPresentDuration,
+ /* [annotation][out] */
+ _Out_ UINT *pClosestLargerPresentDuration);
+
+ END_INTERFACE
+ } IDXGISwapChainMediaVtbl;
+
+ interface IDXGISwapChainMedia
+ {
+ CONST_VTBL struct IDXGISwapChainMediaVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGISwapChainMedia_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGISwapChainMedia_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGISwapChainMedia_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGISwapChainMedia_GetFrameStatisticsMedia(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatisticsMedia(This,pStats) )
+
+#define IDXGISwapChainMedia_SetPresentDuration(This,Duration) \
+ ( (This)->lpVtbl -> SetPresentDuration(This,Duration) )
+
+#define IDXGISwapChainMedia_CheckPresentDurationSupport(This,DesiredPresentDuration,pClosestSmallerPresentDuration,pClosestLargerPresentDuration) \
+ ( (This)->lpVtbl -> CheckPresentDurationSupport(This,DesiredPresentDuration,pClosestSmallerPresentDuration,pClosestLargerPresentDuration) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGISwapChainMedia_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0007 */
+/* [local] */
+
+typedef
+enum DXGI_OVERLAY_SUPPORT_FLAG
+ {
+ DXGI_OVERLAY_SUPPORT_FLAG_DIRECT = 0x1,
+ DXGI_OVERLAY_SUPPORT_FLAG_SCALING = 0x2
+ } DXGI_OVERLAY_SUPPORT_FLAG;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0007_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0007_v0_0_s_ifspec;
+
+#ifndef __IDXGIOutput3_INTERFACE_DEFINED__
+#define __IDXGIOutput3_INTERFACE_DEFINED__
+
+/* interface IDXGIOutput3 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIOutput3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8a6bb301-7e7e-41F4-a8e0-5b32f7f99b18")
+ IDXGIOutput3 : public IDXGIOutput2
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CheckOverlaySupport(
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT EnumFormat,
+ /* [annotation][out] */
+ _In_ IUnknown *pConcernedDevice,
+ /* [annotation][out] */
+ _Out_ UINT *pFlags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIOutput3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIOutput3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIOutput3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIOutput3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIOutput3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTPUT_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
+ IDXGIOutput3 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
+ IDXGIOutput3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ BOOL Exclusive);
+
+ void ( STDMETHODCALLTYPE *ReleaseOwnership )(
+ IDXGIOutput3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
+ IDXGIOutput3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
+ IDXGIOutput3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pScanoutSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGIOutput3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
+ IDXGIOutput3 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC1 *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC1 *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
+
+ BOOL ( STDMETHODCALLTYPE *SupportsOverlays )(
+ IDXGIOutput3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckOverlaySupport )(
+ IDXGIOutput3 * This,
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT EnumFormat,
+ /* [annotation][out] */
+ _In_ IUnknown *pConcernedDevice,
+ /* [annotation][out] */
+ _Out_ UINT *pFlags);
+
+ END_INTERFACE
+ } IDXGIOutput3Vtbl;
+
+ interface IDXGIOutput3
+ {
+ CONST_VTBL struct IDXGIOutput3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIOutput3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIOutput3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIOutput3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIOutput3_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIOutput3_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIOutput3_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIOutput3_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIOutput3_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIOutput3_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput3_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput3_WaitForVBlank(This) \
+ ( (This)->lpVtbl -> WaitForVBlank(This) )
+
+#define IDXGIOutput3_TakeOwnership(This,pDevice,Exclusive) \
+ ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
+
+#define IDXGIOutput3_ReleaseOwnership(This) \
+ ( (This)->lpVtbl -> ReleaseOwnership(This) )
+
+#define IDXGIOutput3_GetGammaControlCapabilities(This,pGammaCaps) \
+ ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
+
+#define IDXGIOutput3_SetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> SetGammaControl(This,pArray) )
+
+#define IDXGIOutput3_GetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> GetGammaControl(This,pArray) )
+
+#define IDXGIOutput3_SetDisplaySurface(This,pScanoutSurface) \
+ ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
+
+#define IDXGIOutput3_GetDisplaySurfaceData(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
+
+#define IDXGIOutput3_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+
+#define IDXGIOutput3_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput3_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput3_GetDisplaySurfaceData1(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
+
+#define IDXGIOutput3_DuplicateOutput(This,pDevice,ppOutputDuplication) \
+ ( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
+
+
+#define IDXGIOutput3_SupportsOverlays(This) \
+ ( (This)->lpVtbl -> SupportsOverlays(This) )
+
+
+#define IDXGIOutput3_CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) \
+ ( (This)->lpVtbl -> CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIOutput3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_3_0000_0008 */
+/* [local] */
+
+DEFINE_GUID(IID_IDXGIDevice3,0x6007896c,0x3244,0x4afd,0xbf,0x18,0xa6,0xd3,0xbe,0xda,0x50,0x23);
+DEFINE_GUID(IID_IDXGISwapChain2,0xa8be2ac4,0x199f,0x4946,0xb3,0x31,0x79,0x59,0x9f,0xb9,0x8d,0xe7);
+DEFINE_GUID(IID_IDXGIOutput2,0x595e39d1,0x2724,0x4663,0x99,0xb1,0xda,0x96,0x9d,0xe2,0x83,0x64);
+DEFINE_GUID(IID_IDXGIFactory3,0x25483823,0xcd46,0x4c7d,0x86,0xca,0x47,0xaa,0x95,0xb8,0x37,0xbd);
+DEFINE_GUID(IID_IDXGIDecodeSwapChain,0x2633066b,0x4514,0x4c7a,0x8f,0xd8,0x12,0xea,0x98,0x05,0x9d,0x18);
+DEFINE_GUID(IID_IDXGIFactoryMedia,0x41e7d1f2,0xa591,0x4f7b,0xa2,0xe5,0xfa,0x9c,0x84,0x3e,0x1c,0x12);
+DEFINE_GUID(IID_IDXGISwapChainMedia,0xdd95b90b,0xf05f,0x4f6a,0xbd,0x65,0x25,0xbf,0xb2,0x64,0xbd,0x84);
+DEFINE_GUID(IID_IDXGIOutput3,0x8a6bb301,0x7e7e,0x41F4,0xa8,0xe0,0x5b,0x32,0xf7,0xf9,0x9b,0x18);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0008_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_3_0000_0008_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h
new file mode 100644
index 00000000000..933d44692f9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h
@@ -0,0 +1,1489 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __dxgi1_4_h__
+#define __dxgi1_4_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IDXGISwapChain3_FWD_DEFINED__
+#define __IDXGISwapChain3_FWD_DEFINED__
+typedef interface IDXGISwapChain3 IDXGISwapChain3;
+
+#endif /* __IDXGISwapChain3_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIOutput4_FWD_DEFINED__
+#define __IDXGIOutput4_FWD_DEFINED__
+typedef interface IDXGIOutput4 IDXGIOutput4;
+
+#endif /* __IDXGIOutput4_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIFactory4_FWD_DEFINED__
+#define __IDXGIFactory4_FWD_DEFINED__
+typedef interface IDXGIFactory4 IDXGIFactory4;
+
+#endif /* __IDXGIFactory4_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIAdapter3_FWD_DEFINED__
+#define __IDXGIAdapter3_FWD_DEFINED__
+typedef interface IDXGIAdapter3 IDXGIAdapter3;
+
+#endif /* __IDXGIAdapter3_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "dxgi1_3.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_dxgi1_4_0000_0000 */
+/* [local] */
+
+typedef
+enum DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG
+ {
+ DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1,
+ DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT = 0x2
+ } DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0000_v0_0_s_ifspec;
+
+#ifndef __IDXGISwapChain3_INTERFACE_DEFINED__
+#define __IDXGISwapChain3_INTERFACE_DEFINED__
+
+/* interface IDXGISwapChain3 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGISwapChain3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("94d99bdb-f1f8-4ab0-b236-7da0170edab1")
+ IDXGISwapChain3 : public IDXGISwapChain2
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetCurrentBackBufferIndex( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CheckColorSpaceSupport(
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
+ /* [annotation][out] */
+ _Out_ UINT *pColorSpaceSupport) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetColorSpace1(
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ResizeBuffers1(
+ /* [annotation][in] */
+ _In_ UINT BufferCount,
+ /* [annotation][in] */
+ _In_ UINT Width,
+ /* [annotation][in] */
+ _In_ UINT Height,
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation][in] */
+ _In_ UINT SwapChainFlags,
+ /* [annotation][in] */
+ _In_reads_(BufferCount) const UINT *pCreationNodeMask,
+ /* [annotation][in] */
+ _In_reads_(BufferCount) IUnknown *const *ppPresentQueue) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGISwapChain3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGISwapChain3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGISwapChain3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGISwapChain3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *Present )(
+ IDXGISwapChain3 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBuffer )(
+ IDXGISwapChain3 * This,
+ /* [in] */ UINT Buffer,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][out][in] */
+ _COM_Outptr_ void **ppSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )(
+ IDXGISwapChain3 * This,
+ /* [in] */ BOOL Fullscreen,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_opt_ BOOL *pFullscreen,
+ /* [annotation][out] */
+ _COM_Outptr_opt_result_maybenull_ IDXGIOutput **ppTarget);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )(
+ IDXGISwapChain3 * This,
+ /* [in] */ UINT BufferCount,
+ /* [in] */ UINT Width,
+ /* [in] */ UINT Height,
+ /* [in] */ DXGI_FORMAT NewFormat,
+ /* [in] */ UINT SwapChainFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeTarget )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pNewTargetParameters);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutput **ppOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pLastPresentCount);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFullscreenDesc )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetHwnd )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pHwnd);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCoreWindow )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ REFIID refiid,
+ /* [annotation][out] */
+ _COM_Outptr_ void **ppUnk);
+
+ HRESULT ( STDMETHODCALLTYPE *Present1 )(
+ IDXGISwapChain3 * This,
+ /* [in] */ UINT SyncInterval,
+ /* [in] */ UINT PresentFlags,
+ /* [annotation][in] */
+ _In_ const DXGI_PRESENT_PARAMETERS *pPresentParameters);
+
+ BOOL ( STDMETHODCALLTYPE *IsTemporaryMonoSupported )(
+ IDXGISwapChain3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRestrictToOutput )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ IDXGIOutput **ppRestrictToOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundColor )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBackgroundColor )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_RGBA *pColor);
+
+ HRESULT ( STDMETHODCALLTYPE *SetRotation )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ DXGI_MODE_ROTATION Rotation);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRotation )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_ROTATION *pRotation);
+
+ HRESULT ( STDMETHODCALLTYPE *SetSourceSize )(
+ IDXGISwapChain3 * This,
+ UINT Width,
+ UINT Height);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSourceSize )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pWidth,
+ /* [annotation][out] */
+ _Out_ UINT *pHeight);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )(
+ IDXGISwapChain3 * This,
+ UINT MaxLatency);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ UINT *pMaxLatency);
+
+ HANDLE ( STDMETHODCALLTYPE *GetFrameLatencyWaitableObject )(
+ IDXGISwapChain3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMatrixTransform )(
+ IDXGISwapChain3 * This,
+ const DXGI_MATRIX_3X2_F *pMatrix);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMatrixTransform )(
+ IDXGISwapChain3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_MATRIX_3X2_F *pMatrix);
+
+ UINT ( STDMETHODCALLTYPE *GetCurrentBackBufferIndex )(
+ IDXGISwapChain3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckColorSpaceSupport )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
+ /* [annotation][out] */
+ _Out_ UINT *pColorSpaceSupport);
+
+ HRESULT ( STDMETHODCALLTYPE *SetColorSpace1 )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace);
+
+ HRESULT ( STDMETHODCALLTYPE *ResizeBuffers1 )(
+ IDXGISwapChain3 * This,
+ /* [annotation][in] */
+ _In_ UINT BufferCount,
+ /* [annotation][in] */
+ _In_ UINT Width,
+ /* [annotation][in] */
+ _In_ UINT Height,
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation][in] */
+ _In_ UINT SwapChainFlags,
+ /* [annotation][in] */
+ _In_reads_(BufferCount) const UINT *pCreationNodeMask,
+ /* [annotation][in] */
+ _In_reads_(BufferCount) IUnknown *const *ppPresentQueue);
+
+ END_INTERFACE
+ } IDXGISwapChain3Vtbl;
+
+ interface IDXGISwapChain3
+ {
+ CONST_VTBL struct IDXGISwapChain3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGISwapChain3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGISwapChain3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGISwapChain3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGISwapChain3_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGISwapChain3_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGISwapChain3_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGISwapChain3_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGISwapChain3_GetDevice(This,riid,ppDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) )
+
+
+#define IDXGISwapChain3_Present(This,SyncInterval,Flags) \
+ ( (This)->lpVtbl -> Present(This,SyncInterval,Flags) )
+
+#define IDXGISwapChain3_GetBuffer(This,Buffer,riid,ppSurface) \
+ ( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) )
+
+#define IDXGISwapChain3_SetFullscreenState(This,Fullscreen,pTarget) \
+ ( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) )
+
+#define IDXGISwapChain3_GetFullscreenState(This,pFullscreen,ppTarget) \
+ ( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) )
+
+#define IDXGISwapChain3_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGISwapChain3_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \
+ ( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) )
+
+#define IDXGISwapChain3_ResizeTarget(This,pNewTargetParameters) \
+ ( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) )
+
+#define IDXGISwapChain3_GetContainingOutput(This,ppOutput) \
+ ( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) )
+
+#define IDXGISwapChain3_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+#define IDXGISwapChain3_GetLastPresentCount(This,pLastPresentCount) \
+ ( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) )
+
+
+#define IDXGISwapChain3_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+#define IDXGISwapChain3_GetFullscreenDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetFullscreenDesc(This,pDesc) )
+
+#define IDXGISwapChain3_GetHwnd(This,pHwnd) \
+ ( (This)->lpVtbl -> GetHwnd(This,pHwnd) )
+
+#define IDXGISwapChain3_GetCoreWindow(This,refiid,ppUnk) \
+ ( (This)->lpVtbl -> GetCoreWindow(This,refiid,ppUnk) )
+
+#define IDXGISwapChain3_Present1(This,SyncInterval,PresentFlags,pPresentParameters) \
+ ( (This)->lpVtbl -> Present1(This,SyncInterval,PresentFlags,pPresentParameters) )
+
+#define IDXGISwapChain3_IsTemporaryMonoSupported(This) \
+ ( (This)->lpVtbl -> IsTemporaryMonoSupported(This) )
+
+#define IDXGISwapChain3_GetRestrictToOutput(This,ppRestrictToOutput) \
+ ( (This)->lpVtbl -> GetRestrictToOutput(This,ppRestrictToOutput) )
+
+#define IDXGISwapChain3_SetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> SetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain3_GetBackgroundColor(This,pColor) \
+ ( (This)->lpVtbl -> GetBackgroundColor(This,pColor) )
+
+#define IDXGISwapChain3_SetRotation(This,Rotation) \
+ ( (This)->lpVtbl -> SetRotation(This,Rotation) )
+
+#define IDXGISwapChain3_GetRotation(This,pRotation) \
+ ( (This)->lpVtbl -> GetRotation(This,pRotation) )
+
+
+#define IDXGISwapChain3_SetSourceSize(This,Width,Height) \
+ ( (This)->lpVtbl -> SetSourceSize(This,Width,Height) )
+
+#define IDXGISwapChain3_GetSourceSize(This,pWidth,pHeight) \
+ ( (This)->lpVtbl -> GetSourceSize(This,pWidth,pHeight) )
+
+#define IDXGISwapChain3_SetMaximumFrameLatency(This,MaxLatency) \
+ ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) )
+
+#define IDXGISwapChain3_GetMaximumFrameLatency(This,pMaxLatency) \
+ ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) )
+
+#define IDXGISwapChain3_GetFrameLatencyWaitableObject(This) \
+ ( (This)->lpVtbl -> GetFrameLatencyWaitableObject(This) )
+
+#define IDXGISwapChain3_SetMatrixTransform(This,pMatrix) \
+ ( (This)->lpVtbl -> SetMatrixTransform(This,pMatrix) )
+
+#define IDXGISwapChain3_GetMatrixTransform(This,pMatrix) \
+ ( (This)->lpVtbl -> GetMatrixTransform(This,pMatrix) )
+
+
+#define IDXGISwapChain3_GetCurrentBackBufferIndex(This) \
+ ( (This)->lpVtbl -> GetCurrentBackBufferIndex(This) )
+
+#define IDXGISwapChain3_CheckColorSpaceSupport(This,ColorSpace,pColorSpaceSupport) \
+ ( (This)->lpVtbl -> CheckColorSpaceSupport(This,ColorSpace,pColorSpaceSupport) )
+
+#define IDXGISwapChain3_SetColorSpace1(This,ColorSpace) \
+ ( (This)->lpVtbl -> SetColorSpace1(This,ColorSpace) )
+
+#define IDXGISwapChain3_ResizeBuffers1(This,BufferCount,Width,Height,Format,SwapChainFlags,pCreationNodeMask,ppPresentQueue) \
+ ( (This)->lpVtbl -> ResizeBuffers1(This,BufferCount,Width,Height,Format,SwapChainFlags,pCreationNodeMask,ppPresentQueue) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGISwapChain3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_4_0000_0001 */
+/* [local] */
+
+typedef
+enum DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG
+ {
+ DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1
+ } DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0001_v0_0_s_ifspec;
+
+#ifndef __IDXGIOutput4_INTERFACE_DEFINED__
+#define __IDXGIOutput4_INTERFACE_DEFINED__
+
+/* interface IDXGIOutput4 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIOutput4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("dc7dca35-2196-414d-9F53-617884032a60")
+ IDXGIOutput4 : public IDXGIOutput3
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CheckOverlayColorSpaceSupport(
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
+ /* [annotation][in] */
+ _In_ IUnknown *pConcernedDevice,
+ /* [annotation][out] */
+ _Out_ UINT *pFlags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIOutput4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIOutput4 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIOutput4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIOutput4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIOutput4 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_OUTPUT_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
+ IDXGIOutput4 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
+ IDXGIOutput4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ BOOL Exclusive);
+
+ void ( STDMETHODCALLTYPE *ReleaseOwnership )(
+ IDXGIOutput4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
+ IDXGIOutput4 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
+
+ HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
+ IDXGIOutput4 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_GAMMA_CONTROL *pArray);
+
+ HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pScanoutSurface);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ IDXGISurface *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
+ IDXGIOutput4 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_FRAME_STATISTICS *pStats);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
+ IDXGIOutput4 * This,
+ /* [in] */ DXGI_FORMAT EnumFormat,
+ /* [in] */ UINT Flags,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pNumModes,
+ /* [annotation][out] */
+ _Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ const DXGI_MODE_DESC1 *pModeToMatch,
+ /* [annotation][out] */
+ _Out_ DXGI_MODE_DESC1 *pClosestMatch,
+ /* [annotation][in] */
+ _In_opt_ IUnknown *pConcernedDevice);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ IDXGIResource *pDestination);
+
+ HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
+
+ BOOL ( STDMETHODCALLTYPE *SupportsOverlays )(
+ IDXGIOutput4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckOverlaySupport )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT EnumFormat,
+ /* [annotation][out] */
+ _In_ IUnknown *pConcernedDevice,
+ /* [annotation][out] */
+ _Out_ UINT *pFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckOverlayColorSpaceSupport )(
+ IDXGIOutput4 * This,
+ /* [annotation][in] */
+ _In_ DXGI_FORMAT Format,
+ /* [annotation][in] */
+ _In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
+ /* [annotation][in] */
+ _In_ IUnknown *pConcernedDevice,
+ /* [annotation][out] */
+ _Out_ UINT *pFlags);
+
+ END_INTERFACE
+ } IDXGIOutput4Vtbl;
+
+ interface IDXGIOutput4
+ {
+ CONST_VTBL struct IDXGIOutput4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIOutput4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIOutput4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIOutput4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIOutput4_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIOutput4_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIOutput4_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIOutput4_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIOutput4_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIOutput4_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput4_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput4_WaitForVBlank(This) \
+ ( (This)->lpVtbl -> WaitForVBlank(This) )
+
+#define IDXGIOutput4_TakeOwnership(This,pDevice,Exclusive) \
+ ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
+
+#define IDXGIOutput4_ReleaseOwnership(This) \
+ ( (This)->lpVtbl -> ReleaseOwnership(This) )
+
+#define IDXGIOutput4_GetGammaControlCapabilities(This,pGammaCaps) \
+ ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
+
+#define IDXGIOutput4_SetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> SetGammaControl(This,pArray) )
+
+#define IDXGIOutput4_GetGammaControl(This,pArray) \
+ ( (This)->lpVtbl -> GetGammaControl(This,pArray) )
+
+#define IDXGIOutput4_SetDisplaySurface(This,pScanoutSurface) \
+ ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
+
+#define IDXGIOutput4_GetDisplaySurfaceData(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
+
+#define IDXGIOutput4_GetFrameStatistics(This,pStats) \
+ ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
+
+
+#define IDXGIOutput4_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
+ ( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
+
+#define IDXGIOutput4_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
+ ( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
+
+#define IDXGIOutput4_GetDisplaySurfaceData1(This,pDestination) \
+ ( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
+
+#define IDXGIOutput4_DuplicateOutput(This,pDevice,ppOutputDuplication) \
+ ( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
+
+
+#define IDXGIOutput4_SupportsOverlays(This) \
+ ( (This)->lpVtbl -> SupportsOverlays(This) )
+
+
+#define IDXGIOutput4_CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) \
+ ( (This)->lpVtbl -> CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) )
+
+
+#define IDXGIOutput4_CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) \
+ ( (This)->lpVtbl -> CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIOutput4_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIFactory4_INTERFACE_DEFINED__
+#define __IDXGIFactory4_INTERFACE_DEFINED__
+
+/* interface IDXGIFactory4 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIFactory4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1bc6ea02-ef36-464f-bf0c-21ca39e5168a")
+ IDXGIFactory4 : public IDXGIFactory3
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE EnumAdapterByLuid(
+ /* [annotation] */
+ _In_ LUID AdapterLuid,
+ /* [annotation] */
+ _In_ REFIID riid,
+ /* [annotation] */
+ _COM_Outptr_ void **ppvAdapter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
+ /* [annotation] */
+ _In_ REFIID riid,
+ /* [annotation] */
+ _COM_Outptr_ void **ppvAdapter) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIFactory4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIFactory4 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIFactory4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIFactory4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters )(
+ IDXGIFactory4 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )(
+ IDXGIFactory4 * This,
+ HWND WindowHandle,
+ UINT Flags);
+
+ HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )(
+ IDXGIFactory4 * This,
+ /* [annotation][out] */
+ _Out_ HWND *pWindowHandle);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ DXGI_SWAP_CHAIN_DESC *pDesc,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )(
+ IDXGIFactory4 * This,
+ /* [in] */ HMODULE Module,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter **ppAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )(
+ IDXGIFactory4 * This,
+ /* [in] */ UINT Adapter,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGIAdapter1 **ppAdapter);
+
+ BOOL ( STDMETHODCALLTYPE *IsCurrent )(
+ IDXGIFactory4 * This);
+
+ BOOL ( STDMETHODCALLTYPE *IsWindowedStereoEnabled )(
+ IDXGIFactory4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForHwnd )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ HWND hWnd,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForCoreWindow )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ IUnknown *pWindow,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSharedResourceAdapterLuid )(
+ IDXGIFactory4 * This,
+ /* [annotation] */
+ _In_ HANDLE hResource,
+ /* [annotation] */
+ _Out_ LUID *pLuid);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusWindow )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterStereoStatusEvent )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterStereoStatus )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusWindow )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ HWND WindowHandle,
+ /* [annotation][in] */
+ _In_ UINT wMsg,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterOcclusionStatusEvent )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterOcclusionStatus )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *CreateSwapChainForComposition )(
+ IDXGIFactory4 * This,
+ /* [annotation][in] */
+ _In_ IUnknown *pDevice,
+ /* [annotation][in] */
+ _In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
+ /* [annotation][in] */
+ _In_opt_ IDXGIOutput *pRestrictToOutput,
+ /* [annotation][out] */
+ _COM_Outptr_ IDXGISwapChain1 **ppSwapChain);
+
+ UINT ( STDMETHODCALLTYPE *GetCreationFlags )(
+ IDXGIFactory4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumAdapterByLuid )(
+ IDXGIFactory4 * This,
+ /* [annotation] */
+ _In_ LUID AdapterLuid,
+ /* [annotation] */
+ _In_ REFIID riid,
+ /* [annotation] */
+ _COM_Outptr_ void **ppvAdapter);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumWarpAdapter )(
+ IDXGIFactory4 * This,
+ /* [annotation] */
+ _In_ REFIID riid,
+ /* [annotation] */
+ _COM_Outptr_ void **ppvAdapter);
+
+ END_INTERFACE
+ } IDXGIFactory4Vtbl;
+
+ interface IDXGIFactory4
+ {
+ CONST_VTBL struct IDXGIFactory4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIFactory4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIFactory4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIFactory4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIFactory4_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIFactory4_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIFactory4_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIFactory4_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIFactory4_EnumAdapters(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory4_MakeWindowAssociation(This,WindowHandle,Flags) \
+ ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) )
+
+#define IDXGIFactory4_GetWindowAssociation(This,pWindowHandle) \
+ ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) )
+
+#define IDXGIFactory4_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) )
+
+#define IDXGIFactory4_CreateSoftwareAdapter(This,Module,ppAdapter) \
+ ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) )
+
+
+#define IDXGIFactory4_EnumAdapters1(This,Adapter,ppAdapter) \
+ ( (This)->lpVtbl -> EnumAdapters1(This,Adapter,ppAdapter) )
+
+#define IDXGIFactory4_IsCurrent(This) \
+ ( (This)->lpVtbl -> IsCurrent(This) )
+
+
+#define IDXGIFactory4_IsWindowedStereoEnabled(This) \
+ ( (This)->lpVtbl -> IsWindowedStereoEnabled(This) )
+
+#define IDXGIFactory4_CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForHwnd(This,pDevice,hWnd,pDesc,pFullscreenDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory4_CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForCoreWindow(This,pDevice,pWindow,pDesc,pRestrictToOutput,ppSwapChain) )
+
+#define IDXGIFactory4_GetSharedResourceAdapterLuid(This,hResource,pLuid) \
+ ( (This)->lpVtbl -> GetSharedResourceAdapterLuid(This,hResource,pLuid) )
+
+#define IDXGIFactory4_RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory4_RegisterStereoStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterStereoStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory4_UnregisterStereoStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterStereoStatus(This,dwCookie) )
+
+#define IDXGIFactory4_RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusWindow(This,WindowHandle,wMsg,pdwCookie) )
+
+#define IDXGIFactory4_RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterOcclusionStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIFactory4_UnregisterOcclusionStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterOcclusionStatus(This,dwCookie) )
+
+#define IDXGIFactory4_CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) \
+ ( (This)->lpVtbl -> CreateSwapChainForComposition(This,pDevice,pDesc,pRestrictToOutput,ppSwapChain) )
+
+
+#define IDXGIFactory4_GetCreationFlags(This) \
+ ( (This)->lpVtbl -> GetCreationFlags(This) )
+
+
+#define IDXGIFactory4_EnumAdapterByLuid(This,AdapterLuid,riid,ppvAdapter) \
+ ( (This)->lpVtbl -> EnumAdapterByLuid(This,AdapterLuid,riid,ppvAdapter) )
+
+#define IDXGIFactory4_EnumWarpAdapter(This,riid,ppvAdapter) \
+ ( (This)->lpVtbl -> EnumWarpAdapter(This,riid,ppvAdapter) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIFactory4_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_4_0000_0003 */
+/* [local] */
+
+typedef
+enum DXGI_MEMORY_SEGMENT_GROUP
+ {
+ DXGI_MEMORY_SEGMENT_GROUP_LOCAL = 0,
+ DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL = 1
+ } DXGI_MEMORY_SEGMENT_GROUP;
+
+typedef struct DXGI_QUERY_VIDEO_MEMORY_INFO
+ {
+ UINT64 Budget;
+ UINT64 CurrentUsage;
+ UINT64 AvailableForReservation;
+ UINT64 CurrentReservation;
+ } DXGI_QUERY_VIDEO_MEMORY_INFO;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0003_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0003_v0_0_s_ifspec;
+
+#ifndef __IDXGIAdapter3_INTERFACE_DEFINED__
+#define __IDXGIAdapter3_INTERFACE_DEFINED__
+
+/* interface IDXGIAdapter3 */
+/* [unique][local][uuid][object] */
+
+
+EXTERN_C const IID IID_IDXGIAdapter3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("645967A4-1392-4310-A798-8053CE3E93FD")
+ IDXGIAdapter3 : public IDXGIAdapter2
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE RegisterHardwareContentProtectionTeardownStatusEvent(
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual void STDMETHODCALLTYPE UnregisterHardwareContentProtectionTeardownStatus(
+ /* [annotation][in] */
+ _In_ DWORD dwCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryVideoMemoryInfo(
+ /* [annotation][in] */
+ _In_ UINT NodeIndex,
+ /* [annotation][in] */
+ _In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
+ /* [annotation][out] */
+ _Out_ DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetVideoMemoryReservation(
+ /* [annotation][in] */
+ _In_ UINT NodeIndex,
+ /* [annotation][in] */
+ _In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
+ /* [annotation][in] */
+ _In_ UINT64 Reservation) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterVideoMemoryBudgetChangeNotificationEvent(
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie) = 0;
+
+ virtual void STDMETHODCALLTYPE UnregisterVideoMemoryBudgetChangeNotification(
+ /* [annotation][in] */
+ _In_ DWORD dwCookie) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIAdapter3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIAdapter3 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIAdapter3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIAdapter3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [in] */ UINT DataSize,
+ /* [annotation][in] */
+ _In_reads_bytes_(DataSize) const void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][in] */
+ _In_ const IUnknown *pUnknown);
+
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID Name,
+ /* [annotation][out][in] */
+ _Inout_ UINT *pDataSize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pDataSize) void *pData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetParent )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][retval][out] */
+ _COM_Outptr_ void **ppParent);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
+ IDXGIAdapter3 * This,
+ /* [in] */ UINT Output,
+ /* [annotation][out][in] */
+ _COM_Outptr_ IDXGIOutput **ppOutput);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc )(
+ IDXGIAdapter3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ REFGUID InterfaceName,
+ /* [annotation][out] */
+ _Out_ LARGE_INTEGER *pUMDVersion);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
+ IDXGIAdapter3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC1 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDesc2 )(
+ IDXGIAdapter3 * This,
+ /* [annotation][out] */
+ _Out_ DXGI_ADAPTER_DESC2 *pDesc);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterHardwareContentProtectionTeardownStatusEvent )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterHardwareContentProtectionTeardownStatus )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ HRESULT ( STDMETHODCALLTYPE *QueryVideoMemoryInfo )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ UINT NodeIndex,
+ /* [annotation][in] */
+ _In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
+ /* [annotation][out] */
+ _Out_ DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *SetVideoMemoryReservation )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ UINT NodeIndex,
+ /* [annotation][in] */
+ _In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
+ /* [annotation][in] */
+ _In_ UINT64 Reservation);
+
+ HRESULT ( STDMETHODCALLTYPE *RegisterVideoMemoryBudgetChangeNotificationEvent )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ HANDLE hEvent,
+ /* [annotation][out] */
+ _Out_ DWORD *pdwCookie);
+
+ void ( STDMETHODCALLTYPE *UnregisterVideoMemoryBudgetChangeNotification )(
+ IDXGIAdapter3 * This,
+ /* [annotation][in] */
+ _In_ DWORD dwCookie);
+
+ END_INTERFACE
+ } IDXGIAdapter3Vtbl;
+
+ interface IDXGIAdapter3
+ {
+ CONST_VTBL struct IDXGIAdapter3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIAdapter3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIAdapter3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIAdapter3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIAdapter3_SetPrivateData(This,Name,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
+
+#define IDXGIAdapter3_SetPrivateDataInterface(This,Name,pUnknown) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
+
+#define IDXGIAdapter3_GetPrivateData(This,Name,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
+
+#define IDXGIAdapter3_GetParent(This,riid,ppParent) \
+ ( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
+
+
+#define IDXGIAdapter3_EnumOutputs(This,Output,ppOutput) \
+ ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) )
+
+#define IDXGIAdapter3_GetDesc(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc(This,pDesc) )
+
+#define IDXGIAdapter3_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \
+ ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) )
+
+
+#define IDXGIAdapter3_GetDesc1(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc1(This,pDesc) )
+
+
+#define IDXGIAdapter3_GetDesc2(This,pDesc) \
+ ( (This)->lpVtbl -> GetDesc2(This,pDesc) )
+
+
+#define IDXGIAdapter3_RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIAdapter3_UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) )
+
+#define IDXGIAdapter3_QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) \
+ ( (This)->lpVtbl -> QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) )
+
+#define IDXGIAdapter3_SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) \
+ ( (This)->lpVtbl -> SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) )
+
+#define IDXGIAdapter3_RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) \
+ ( (This)->lpVtbl -> RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) )
+
+#define IDXGIAdapter3_UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) \
+ ( (This)->lpVtbl -> UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIAdapter3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgi1_4_0000_0004 */
+/* [local] */
+
+DEFINE_GUID(IID_IDXGISwapChain3,0x94d99bdb,0xf1f8,0x4ab0,0xb2,0x36,0x7d,0xa0,0x17,0x0e,0xda,0xb1);
+DEFINE_GUID(IID_IDXGIOutput4,0xdc7dca35,0x2196,0x414d,0x9F,0x53,0x61,0x78,0x84,0x03,0x2a,0x60);
+DEFINE_GUID(IID_IDXGIFactory4,0x1bc6ea02,0xef36,0x464f,0xbf,0x0c,0x21,0xca,0x39,0xe5,0x16,0x8a);
+DEFINE_GUID(IID_IDXGIAdapter3,0x645967A4,0x1392,0x4310,0xA7,0x98,0x80,0x53,0xCE,0x3E,0x93,0xFD);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgi1_4_0000_0004_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h
new file mode 100644
index 00000000000..9ed929c1287
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h
@@ -0,0 +1,986 @@
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* @@MIDL_FILE_HEADING( ) */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __dxgidebug_h__
+#define __dxgidebug_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IDXGIInfoQueue_FWD_DEFINED__
+#define __IDXGIInfoQueue_FWD_DEFINED__
+typedef interface IDXGIInfoQueue IDXGIInfoQueue;
+
+#endif /* __IDXGIInfoQueue_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIDebug_FWD_DEFINED__
+#define __IDXGIDebug_FWD_DEFINED__
+typedef interface IDXGIDebug IDXGIDebug;
+
+#endif /* __IDXGIDebug_FWD_DEFINED__ */
+
+
+#ifndef __IDXGIDebug1_FWD_DEFINED__
+#define __IDXGIDebug1_FWD_DEFINED__
+typedef interface IDXGIDebug1 IDXGIDebug1;
+
+#endif /* __IDXGIDebug1_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_dxgidebug_0000_0000 */
+/* [local] */
+
+#define DXGI_DEBUG_BINARY_VERSION ( 1 )
+
+typedef
+enum DXGI_DEBUG_RLO_FLAGS
+ {
+ DXGI_DEBUG_RLO_SUMMARY = 0x1,
+ DXGI_DEBUG_RLO_DETAIL = 0x2,
+ DXGI_DEBUG_RLO_IGNORE_INTERNAL = 0x4,
+ DXGI_DEBUG_RLO_ALL = 0x7
+ } DXGI_DEBUG_RLO_FLAGS;
+
+typedef GUID DXGI_DEBUG_ID;
+
+DEFINE_GUID(DXGI_DEBUG_ALL, 0xe48ae283, 0xda80, 0x490b, 0x87, 0xe6, 0x43, 0xe9, 0xa9, 0xcf, 0xda, 0x8);
+DEFINE_GUID(DXGI_DEBUG_DX, 0x35cdd7fc, 0x13b2, 0x421d, 0xa5, 0xd7, 0x7e, 0x44, 0x51, 0x28, 0x7d, 0x64);
+DEFINE_GUID(DXGI_DEBUG_DXGI, 0x25cddaa4, 0xb1c6, 0x47e1, 0xac, 0x3e, 0x98, 0x87, 0x5b, 0x5a, 0x2e, 0x2a);
+DEFINE_GUID(DXGI_DEBUG_APP, 0x6cd6e01, 0x4219, 0x4ebd, 0x87, 0x9, 0x27, 0xed, 0x23, 0x36, 0xc, 0x62);
+typedef
+enum DXGI_INFO_QUEUE_MESSAGE_CATEGORY
+ {
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN = 0,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER = ( DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION + 1 )
+ } DXGI_INFO_QUEUE_MESSAGE_CATEGORY;
+
+typedef
+enum DXGI_INFO_QUEUE_MESSAGE_SEVERITY
+ {
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION = 0,
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING + 1 ) ,
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE = ( DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO + 1 )
+ } DXGI_INFO_QUEUE_MESSAGE_SEVERITY;
+
+typedef int DXGI_INFO_QUEUE_MESSAGE_ID;
+
+#define DXGI_INFO_QUEUE_MESSAGE_ID_STRING_FROM_APPLICATION 0
+typedef struct DXGI_INFO_QUEUE_MESSAGE
+ {
+ DXGI_DEBUG_ID Producer;
+ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category;
+ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity;
+ DXGI_INFO_QUEUE_MESSAGE_ID ID;
+ /* [annotation] */
+ _Field_size_(DescriptionByteLength) const char *pDescription;
+ SIZE_T DescriptionByteLength;
+ } DXGI_INFO_QUEUE_MESSAGE;
+
+typedef struct DXGI_INFO_QUEUE_FILTER_DESC
+ {
+ UINT NumCategories;
+ /* [annotation] */
+ _Field_size_(NumCategories) DXGI_INFO_QUEUE_MESSAGE_CATEGORY *pCategoryList;
+ UINT NumSeverities;
+ /* [annotation] */
+ _Field_size_(NumSeverities) DXGI_INFO_QUEUE_MESSAGE_SEVERITY *pSeverityList;
+ UINT NumIDs;
+ /* [annotation] */
+ _Field_size_(NumIDs) DXGI_INFO_QUEUE_MESSAGE_ID *pIDList;
+ } DXGI_INFO_QUEUE_FILTER_DESC;
+
+typedef struct DXGI_INFO_QUEUE_FILTER
+ {
+ DXGI_INFO_QUEUE_FILTER_DESC AllowList;
+ DXGI_INFO_QUEUE_FILTER_DESC DenyList;
+ } DXGI_INFO_QUEUE_FILTER;
+
+#define DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
+HRESULT WINAPI DXGIGetDebugInterface(REFIID riid, void **ppDebug);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0000_v0_0_s_ifspec;
+
+#ifndef __IDXGIInfoQueue_INTERFACE_DEFINED__
+#define __IDXGIInfoQueue_INTERFACE_DEFINED__
+
+/* interface IDXGIInfoQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_IDXGIInfoQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("D67441C7-672A-476f-9E82-CD55B44949CE")
+ IDXGIInfoQueue : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStoredMessages(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMessage(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) DXGI_INFO_QUEUE_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilters(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushDenyAllStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopStorageFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushDenyAllRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopRetrievalFilter(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddMessage(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ BOOL bMute) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput(
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIInfoQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIInfoQueue * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIInfoQueue * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIInfoQueue * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ UINT64 MessageCountLimit);
+
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ UINT64 MessageIndex,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pMessageByteLength) DXGI_INFO_QUEUE_MESSAGE *pMessage,
+ /* [annotation] */
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilters )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushDenyAllStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _Out_writes_bytes_opt_(*pFilterByteLength) DXGI_INFO_QUEUE_FILTER *pFilter,
+ /* [annotation] */
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushDenyAllRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_FILTER *pFilter);
+
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ LPCSTR pDescription);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID,
+ /* [annotation] */
+ _In_ BOOL bEnable);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity);
+
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ DXGI_INFO_QUEUE_MESSAGE_ID ID);
+
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer,
+ /* [annotation] */
+ _In_ BOOL bMute);
+
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ IDXGIInfoQueue * This,
+ /* [annotation] */
+ _In_ DXGI_DEBUG_ID Producer);
+
+ END_INTERFACE
+ } IDXGIInfoQueueVtbl;
+
+ interface IDXGIInfoQueue
+ {
+ CONST_VTBL struct IDXGIInfoQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIInfoQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIInfoQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIInfoQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIInfoQueue_SetMessageCountLimit(This,Producer,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,Producer,MessageCountLimit) )
+
+#define IDXGIInfoQueue_ClearStoredMessages(This,Producer) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This,Producer) )
+
+#define IDXGIInfoQueue_GetMessage(This,Producer,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,Producer,MessageIndex,pMessage,pMessageByteLength) )
+
+#define IDXGIInfoQueue_GetNumStoredMessagesAllowedByRetrievalFilters(This,Producer) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilters(This,Producer) )
+
+#define IDXGIInfoQueue_GetNumStoredMessages(This,Producer) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This,Producer) )
+
+#define IDXGIInfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This,Producer) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This,Producer) )
+
+#define IDXGIInfoQueue_GetMessageCountLimit(This,Producer) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This,Producer) )
+
+#define IDXGIInfoQueue_GetNumMessagesAllowedByStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_GetNumMessagesDeniedByStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_AddStorageFilterEntries(This,Producer,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,Producer,pFilter) )
+
+#define IDXGIInfoQueue_GetStorageFilter(This,Producer,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,Producer,pFilter,pFilterByteLength) )
+
+#define IDXGIInfoQueue_ClearStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushEmptyStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushDenyAllStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushDenyAllStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushCopyOfStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushStorageFilter(This,Producer,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,Producer,pFilter) )
+
+#define IDXGIInfoQueue_PopStorageFilter(This,Producer) \
+ ( (This)->lpVtbl -> PopStorageFilter(This,Producer) )
+
+#define IDXGIInfoQueue_GetStorageFilterStackSize(This,Producer) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This,Producer) )
+
+#define IDXGIInfoQueue_AddRetrievalFilterEntries(This,Producer,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,Producer,pFilter) )
+
+#define IDXGIInfoQueue_GetRetrievalFilter(This,Producer,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,Producer,pFilter,pFilterByteLength) )
+
+#define IDXGIInfoQueue_ClearRetrievalFilter(This,Producer) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushEmptyRetrievalFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushDenyAllRetrievalFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushDenyAllRetrievalFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushCopyOfRetrievalFilter(This,Producer) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This,Producer) )
+
+#define IDXGIInfoQueue_PushRetrievalFilter(This,Producer,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,Producer,pFilter) )
+
+#define IDXGIInfoQueue_PopRetrievalFilter(This,Producer) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This,Producer) )
+
+#define IDXGIInfoQueue_GetRetrievalFilterStackSize(This,Producer) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This,Producer) )
+
+#define IDXGIInfoQueue_AddMessage(This,Producer,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Producer,Category,Severity,ID,pDescription) )
+
+#define IDXGIInfoQueue_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define IDXGIInfoQueue_SetBreakOnCategory(This,Producer,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Producer,Category,bEnable) )
+
+#define IDXGIInfoQueue_SetBreakOnSeverity(This,Producer,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Producer,Severity,bEnable) )
+
+#define IDXGIInfoQueue_SetBreakOnID(This,Producer,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,Producer,ID,bEnable) )
+
+#define IDXGIInfoQueue_GetBreakOnCategory(This,Producer,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Producer,Category) )
+
+#define IDXGIInfoQueue_GetBreakOnSeverity(This,Producer,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Producer,Severity) )
+
+#define IDXGIInfoQueue_GetBreakOnID(This,Producer,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,Producer,ID) )
+
+#define IDXGIInfoQueue_SetMuteDebugOutput(This,Producer,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,Producer,bMute) )
+
+#define IDXGIInfoQueue_GetMuteDebugOutput(This,Producer) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This,Producer) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIInfoQueue_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIDebug_INTERFACE_DEFINED__
+#define __IDXGIDebug_INTERFACE_DEFINED__
+
+/* interface IDXGIDebug */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_IDXGIDebug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("119E7452-DE9E-40fe-8806-88F90C12B441")
+ IDXGIDebug : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE ReportLiveObjects(
+ GUID apiid,
+ DXGI_DEBUG_RLO_FLAGS flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDebug * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDebug * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDebug * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveObjects )(
+ IDXGIDebug * This,
+ GUID apiid,
+ DXGI_DEBUG_RLO_FLAGS flags);
+
+ END_INTERFACE
+ } IDXGIDebugVtbl;
+
+ interface IDXGIDebug
+ {
+ CONST_VTBL struct IDXGIDebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDebug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDebug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDebug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDebug_ReportLiveObjects(This,apiid,flags) \
+ ( (This)->lpVtbl -> ReportLiveObjects(This,apiid,flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDebug_INTERFACE_DEFINED__ */
+
+
+#ifndef __IDXGIDebug1_INTERFACE_DEFINED__
+#define __IDXGIDebug1_INTERFACE_DEFINED__
+
+/* interface IDXGIDebug1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_IDXGIDebug1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("c5a05f0c-16f2-4adf-9f4d-a8c4d58ac550")
+ IDXGIDebug1 : public IDXGIDebug
+ {
+ public:
+ virtual void STDMETHODCALLTYPE EnableLeakTrackingForThread( void) = 0;
+
+ virtual void STDMETHODCALLTYPE DisableLeakTrackingForThread( void) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE IsLeakTrackingEnabledForThread( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IDXGIDebug1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ IDXGIDebug1 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ IDXGIDebug1 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ IDXGIDebug1 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveObjects )(
+ IDXGIDebug1 * This,
+ GUID apiid,
+ DXGI_DEBUG_RLO_FLAGS flags);
+
+ void ( STDMETHODCALLTYPE *EnableLeakTrackingForThread )(
+ IDXGIDebug1 * This);
+
+ void ( STDMETHODCALLTYPE *DisableLeakTrackingForThread )(
+ IDXGIDebug1 * This);
+
+ BOOL ( STDMETHODCALLTYPE *IsLeakTrackingEnabledForThread )(
+ IDXGIDebug1 * This);
+
+ END_INTERFACE
+ } IDXGIDebug1Vtbl;
+
+ interface IDXGIDebug1
+ {
+ CONST_VTBL struct IDXGIDebug1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IDXGIDebug1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IDXGIDebug1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IDXGIDebug1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IDXGIDebug1_ReportLiveObjects(This,apiid,flags) \
+ ( (This)->lpVtbl -> ReportLiveObjects(This,apiid,flags) )
+
+
+#define IDXGIDebug1_EnableLeakTrackingForThread(This) \
+ ( (This)->lpVtbl -> EnableLeakTrackingForThread(This) )
+
+#define IDXGIDebug1_DisableLeakTrackingForThread(This) \
+ ( (This)->lpVtbl -> DisableLeakTrackingForThread(This) )
+
+#define IDXGIDebug1_IsLeakTrackingEnabledForThread(This) \
+ ( (This)->lpVtbl -> IsLeakTrackingEnabledForThread(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IDXGIDebug1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_dxgidebug_0000_0003 */
+/* [local] */
+
+DEFINE_GUID(IID_IDXGIInfoQueue,0xD67441C7,0x672A,0x476f,0x9E,0x82,0xCD,0x55,0xB4,0x49,0x49,0xCE);
+DEFINE_GUID(IID_IDXGIDebug,0x119E7452,0xDE9E,0x40fe,0x88,0x06,0x88,0xF9,0x0C,0x12,0xB4,0x41);
+DEFINE_GUID(IID_IDXGIDebug1,0xc5a05f0c,0x16f2,0x4adf,0x9f,0x4d,0xa8,0xc4,0xd5,0x8a,0xc5,0x50);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0003_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_dxgidebug_0000_0003_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/dxsdk/Include/DXGIFormat.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
index e84f7f5866d..4159caba4b8 100644
--- a/3rdparty/dxsdk/Include/DXGIFormat.h
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
@@ -1,3 +1,6 @@
+//
+// Copyright (C) Microsoft. All rights reserved.
+//
#ifndef __dxgiformat_h__
#define __dxgiformat_h__
@@ -106,6 +109,28 @@ typedef enum DXGI_FORMAT
DXGI_FORMAT_BC7_TYPELESS = 97,
DXGI_FORMAT_BC7_UNORM = 98,
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
+ DXGI_FORMAT_AYUV = 100,
+ DXGI_FORMAT_Y410 = 101,
+ DXGI_FORMAT_Y416 = 102,
+ DXGI_FORMAT_NV12 = 103,
+ DXGI_FORMAT_P010 = 104,
+ DXGI_FORMAT_P016 = 105,
+ DXGI_FORMAT_420_OPAQUE = 106,
+ DXGI_FORMAT_YUY2 = 107,
+ DXGI_FORMAT_Y210 = 108,
+ DXGI_FORMAT_Y216 = 109,
+ DXGI_FORMAT_NV11 = 110,
+ DXGI_FORMAT_AI44 = 111,
+ DXGI_FORMAT_IA44 = 112,
+ DXGI_FORMAT_P8 = 113,
+ DXGI_FORMAT_A8P8 = 114,
+ DXGI_FORMAT_B4G4R4A4_UNORM = 115,
+
+ DXGI_FORMAT_P208 = 130,
+ DXGI_FORMAT_V208 = 131,
+ DXGI_FORMAT_V408 = 132,
+
+
DXGI_FORMAT_FORCE_UINT = 0xffffffff
} DXGI_FORMAT;
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h
new file mode 100644
index 00000000000..28b706fced2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h
@@ -0,0 +1,166 @@
+//
+// Copyright (C) Microsoft. All rights reserved.
+//
+#ifndef __dxgitype_h__
+#define __dxgitype_h__
+
+#include "dxgiformat.h"
+
+#define _FACDXGI 0x87a
+#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
+#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
+
+#if defined(__MINGW32__) || !defined(DXGI_ERROR_INVALID_CALL)
+# define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)
+# define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)
+# define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)
+# define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)
+# define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)
+# define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)
+# define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)
+# define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
+# define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)
+# define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)
+# define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)
+# define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)
+# define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)
+# define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)
+# define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)
+# define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)
+# define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)
+# define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)
+# define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)
+# define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)
+# define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35)
+# define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36)
+#endif // defined(__MINGW32__) || (_WIN32_WINNT < 0x0601)
+
+#define DXGI_CPU_ACCESS_NONE ( 0 )
+#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
+#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
+#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
+#define DXGI_CPU_ACCESS_FIELD 15
+
+
+typedef struct DXGI_RGB
+{
+ float Red;
+ float Green;
+ float Blue;
+} DXGI_RGB;
+
+#ifndef D3DCOLORVALUE_DEFINED
+typedef struct _D3DCOLORVALUE {
+ float r;
+ float g;
+ float b;
+ float a;
+} D3DCOLORVALUE;
+
+#define D3DCOLORVALUE_DEFINED
+#endif
+
+typedef D3DCOLORVALUE DXGI_RGBA;
+
+typedef struct DXGI_GAMMA_CONTROL
+{
+ DXGI_RGB Scale;
+ DXGI_RGB Offset;
+ DXGI_RGB GammaCurve[ 1025 ];
+} DXGI_GAMMA_CONTROL;
+
+typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
+{
+ BOOL ScaleAndOffsetSupported;
+ float MaxConvertedValue;
+ float MinConvertedValue;
+ UINT NumGammaControlPoints;
+ float ControlPointPositions[1025];
+} DXGI_GAMMA_CONTROL_CAPABILITIES;
+
+typedef struct DXGI_RATIONAL
+{
+ UINT Numerator;
+ UINT Denominator;
+} DXGI_RATIONAL;
+
+typedef enum DXGI_MODE_SCANLINE_ORDER
+{
+ DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
+ DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
+ DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
+ DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
+} DXGI_MODE_SCANLINE_ORDER;
+
+typedef enum DXGI_MODE_SCALING
+{
+ DXGI_MODE_SCALING_UNSPECIFIED = 0,
+ DXGI_MODE_SCALING_CENTERED = 1,
+ DXGI_MODE_SCALING_STRETCHED = 2
+} DXGI_MODE_SCALING;
+
+typedef enum DXGI_MODE_ROTATION
+{
+ DXGI_MODE_ROTATION_UNSPECIFIED = 0,
+ DXGI_MODE_ROTATION_IDENTITY = 1,
+ DXGI_MODE_ROTATION_ROTATE90 = 2,
+ DXGI_MODE_ROTATION_ROTATE180 = 3,
+ DXGI_MODE_ROTATION_ROTATE270 = 4
+} DXGI_MODE_ROTATION;
+
+typedef struct DXGI_MODE_DESC
+{
+ UINT Width;
+ UINT Height;
+ DXGI_RATIONAL RefreshRate;
+ DXGI_FORMAT Format;
+ DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
+ DXGI_MODE_SCALING Scaling;
+} DXGI_MODE_DESC;
+
+// The following values are used with DXGI_SAMPLE_DESC::Quality:
+#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff
+#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe
+
+typedef struct DXGI_SAMPLE_DESC
+{
+ UINT Count;
+ UINT Quality;
+} DXGI_SAMPLE_DESC;
+
+typedef enum DXGI_COLOR_SPACE_TYPE
+{
+ DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
+ DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
+ DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
+ DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
+ DXGI_COLOR_SPACE_RESERVED = 4,
+ DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
+ DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
+ DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
+ DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
+ DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
+ DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
+ DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
+ DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF
+} DXGI_COLOR_SPACE_TYPE;
+
+typedef struct DXGI_JPEG_DC_HUFFMAN_TABLE
+{
+ BYTE CodeCounts[12];
+ BYTE CodeValues[12];
+} DXGI_JPEG_DC_HUFFMAN_TABLE;
+
+typedef struct DXGI_JPEG_AC_HUFFMAN_TABLE
+{
+ BYTE CodeCounts[16];
+ BYTE CodeValues[162];
+} DXGI_JPEG_AC_HUFFMAN_TABLE;
+
+typedef struct DXGI_JPEG_QUANTIZATION_TABLE
+{
+ BYTE Elements[64];
+} DXGI_JPEG_QUANTIZATION_TABLE;
+
+#endif // __dxgitype_h__
+
diff --git a/3rdparty/bgfx/3rdparty/fcpp/cpp1.c b/3rdparty/bgfx/3rdparty/fcpp/cpp1.c
index f101c2a858a..17e6fc88cfe 100644
--- a/3rdparty/bgfx/3rdparty/fcpp/cpp1.c
+++ b/3rdparty/bgfx/3rdparty/fcpp/cpp1.c
@@ -143,7 +143,7 @@ int fppPreProcess(struct fppTag *tags)
#endif
}
fflush(stdout);
- fclose(stdout);
+// BK - fclose(stdout);
if (global->errors > 0 && !global->eflag)
return(IO_ERROR);
diff --git a/3rdparty/bgfx/3rdparty/fcpp/cpp4.c b/3rdparty/bgfx/3rdparty/fcpp/cpp4.c
index fb73a13a7c6..cfa871e6c41 100644
--- a/3rdparty/bgfx/3rdparty/fcpp/cpp4.c
+++ b/3rdparty/bgfx/3rdparty/fcpp/cpp4.c
@@ -127,24 +127,24 @@ ReturnCode dodefine(struct Global *global)
* DEF_NOARGS is needed to distinguish between
* "#define foo" and "#define foo()".
*/
- global->nargs = DEF_NOARGS; /* No () parameters */
+ global->nargs = DEF_NOARGS; /* No () parameters */
}
if (type[c] == SPA) /* At whitespace? */
c = skipws(global); /* Not any more. */
- global->workp = global->work; /* Replacement put here */
- global->inmacro = TRUE; /* Keep \<newline> now */
- quoting = 0; /* No # seen yet. */
+ global->workp = global->work; /* Replacement put here */
+ global->inmacro = TRUE; /* Keep \<newline> now */
+ quoting = 0; /* No # seen yet. */
while (c != EOF_CHAR && c != '\n') { /* Compile macro body */
#if OK_CONCAT
if (c == '#') { /* Token concatenation? */
if ((c = get(global)) != '#') { /* No, not really */
- quoting = 1; /* Maybe quoting op. */
- continue;
+ quoting = 1; /* Maybe quoting op. */
+ continue;
}
while (global->workp > global->work && type[(unsigned)*(global->workp - 1)] == SPA)
- --global->workp; /* Erase leading spaces */
- if((ret=save(global, TOK_SEP))) /* Stuff a delimiter */
- return(ret);
+ --global->workp; /* Erase leading spaces */
+// if ((ret=save(global, TOK_SEP))) /* Stuff a delimiter */
+// return(ret);
c = skipws(global); /* Eat whitespace */
continue;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md b/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
index 2c308bcf73c..ee09e0250e6 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
@@ -1,9 +1,43 @@
GLSL optimizer Change Log
=========================
+2015 08
+-------
+
+Changes:
+
+* 2D shadow and 2D array uniforms got their own glslopt_basic_type entries.
+
+Fixes:
+
+* Fixed translation of 2D texture arrays (GLSL with EXT_texture_array, GLES3 and Metal).
+
+
+2015 06
+-------
+
+Fixes:
+
+* Fixed some cases of different precision matrix assignments being miscompiled on Metal.
+* Fixed yet more issues with translation of weird loops.
+* Fixed translation of matrix+scalar, matrix-scalar, matrix/scalar operations on Metal.
+
+
+2015 05
+-------
+
+Fixes:
+
+* Fixes some cases of highp/mediump sampler sampling resulting in resulting temporaries wrongly being lowp.
+
+
2015 04
-------
+Goodies:
+* GLES2: support EXT_draw_instanced / gl_InstanceIDEXT.
+* Support gl_VertexID in GLSL < 1.30 when EXT_gpu_shader4 is used.
+
Fixes:
* Metal: fixed some bugs with translation of weird loops.
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
index 2c8a23954a5..92063b3edc8 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
@@ -317,7 +317,6 @@
<ClCompile Include="..\..\src\glsl\opt_swizzle_swizzle.cpp" />
<ClCompile Include="..\..\src\glsl\opt_tree_grafting.cpp" />
<ClCompile Include="..\..\src\glsl\opt_vectorize.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_vector_splitting.cpp" />
<ClCompile Include="..\..\src\glsl\s_expression.cpp" />
<ClCompile Include="..\..\src\glsl\standalone_scaffolding.cpp" />
<ClCompile Include="..\..\src\glsl\strtod.c" />
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
index 31bb2648f1e..6e9f9443410 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
@@ -491,9 +491,6 @@
<ClCompile Include="..\..\src\glsl\ir_stats.cpp">
<Filter>src\glsl</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_vector_splitting.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\util\hash_table.c">
<Filter>src\util</Filter>
</ClCompile>
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj
index 04a79805cf7..0adb4785f4c 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj
@@ -126,7 +126,6 @@
2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */; };
2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */; };
2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */; };
- 2BA84CA619580C9D0021BE1D /* opt_vector_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */; };
2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */; };
2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */; };
2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */; };
@@ -292,7 +291,6 @@
2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector_insert.cpp; path = ../../src/glsl/lower_vector_insert.cpp; sourceTree = "<group>"; };
2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_varyings.cpp; path = ../../src/glsl/opt_dead_builtin_varyings.cpp; sourceTree = "<group>"; };
2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flip_matrices.cpp; path = ../../src/glsl/opt_flip_matrices.cpp; sourceTree = "<group>"; };
- 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_vector_splitting.cpp; path = ../../src/glsl/opt_vector_splitting.cpp; sourceTree = "<group>"; };
2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard.cpp; path = ../../src/glsl/lower_discard.cpp; sourceTree = SOURCE_ROOT; };
2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_instructions.cpp; path = ../../src/glsl/lower_instructions.cpp; sourceTree = SOURCE_ROOT; };
2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector.cpp; path = ../../src/glsl/lower_vector.cpp; sourceTree = SOURCE_ROOT; };
@@ -543,7 +541,6 @@
2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */,
2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */,
2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */,
- 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */,
2BA55A991207FEA6002DC82D /* program.h */,
2BA55A9A1207FEA6002DC82D /* s_expression.cpp */,
2BA55A9B1207FEA6002DC82D /* s_expression.h */,
@@ -730,7 +727,6 @@
2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */,
2B6A99F61223B1670059FBED /* glcpp-parse.c in Sources */,
2B6A99FB1223B1670059FBED /* pp.c in Sources */,
- 2BA84CA619580C9D0021BE1D /* opt_vector_splitting.cpp in Sources */,
2BBA49281254706A00D42573 /* glsl_symbol_table.cpp in Sources */,
2BBA492A1254706A00D42573 /* loop_analysis.cpp in Sources */,
2BBA492C1254706A00D42573 /* loop_controls.cpp in Sources */,
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile
index 373bfeb8c46..27d7ad363bd 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile
@@ -103,7 +103,6 @@ SRC = ast_array_index.cpp \
opt_swizzle_swizzle.cpp \
opt_tree_grafting.cpp \
opt_vectorize.cpp \
- opt_vector_splitting.cpp \
s_expression.cpp \
standalone_scaffolding.cpp \
strtod.c \
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp
index de0ddd0e1cf..55d9e91a137 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp
@@ -1212,7 +1212,7 @@ emit_inline_matrix_constructor(const glsl_type *type, int ast_precision,
*
* - Construct a matrix from an arbirary combination of vectors and
* scalars. The components of the constructor parameters are assigned
- * to the matrix in colum-major order until the matrix is full.
+ * to the matrix in column-major order until the matrix is full.
*
* - Construct a matrix from a single matrix. The source matrix is copied
* to the upper left portion of the constructed matrix, and the remaining
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp
index 9223557f6b9..c19ca4321ef 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp
@@ -3136,13 +3136,13 @@ process_initializer(ir_variable *var, ast_declaration *decl,
static void
apply_precision_to_variable(const struct ast_type_qualifier& qual,
- ir_variable *var,
+ ir_variable *var, bool function_param,
struct _mesa_glsl_parse_state *state)
{
if (!state->es_shader)
return;
- if (var->type->is_sampler() && qual.precision == ast_precision_none)
- var->data.precision = ast_precision_low; // samplers default to low precision
+ if (var->type->is_sampler() && qual.precision == ast_precision_none && !function_param)
+ var->data.precision = ast_precision_low; // samplers default to low precision (outside of function arguments)
else
var->data.precision = qual.precision;
}
@@ -3548,7 +3548,7 @@ ast_declarator_list::hir(exec_list *instructions,
apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
& loc, false);
- apply_precision_to_variable(this->type->qualifier, var, state);
+ apply_precision_to_variable(this->type->qualifier, var, false, state);
if (this->type->qualifier.flags.q.invariant) {
if (!is_varying_var(var, state->stage)) {
@@ -4005,7 +4005,7 @@ ast_parameter_declarator::hir(exec_list *instructions,
*/
apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc,
true);
- apply_precision_to_variable(this->type->qualifier, var, state);
+ apply_precision_to_variable(this->type->qualifier, var, true, state);
/* From section 4.1.7 of the GLSL 4.40 spec:
*
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
index 91beeb0ac0b..d887201ade1 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
@@ -830,10 +830,12 @@ void
builtin_variable_generator::generate_vs_special_vars()
{
- if (state->is_version(130, 300))
+ if (state->is_version(130, 300) || state->EXT_gpu_shader4_enable)
add_system_value(SYSTEM_VALUE_VERTEX_ID, state->metal_target ? uint_t : int_t, "gl_VertexID", glsl_precision_high);
if (state->ARB_draw_instanced_enable)
add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB", glsl_precision_high);
+ if (state->EXT_draw_instanced_enable)
+ add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDEXT", glsl_precision_high);
if (state->ARB_draw_instanced_enable || state->is_version(140, 300))
add_system_value(SYSTEM_VALUE_INSTANCE_ID, state->metal_target ? uint_t : int_t, "gl_InstanceID", glsl_precision_high);
if (state->AMD_vertex_shader_layer_enable)
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
index 21f7780b17b..66e5f083bd1 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
@@ -3727,7 +3727,7 @@ _arguments_parse (argument_list_t *arguments,
else {
if (argument->head == NULL) {
/* Don't treat initial whitespace as
- * part of the arguement. */
+ * part of the argument. */
if (node->token->type == SPACE)
continue;
}
@@ -4679,6 +4679,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_draw_instanced)
add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->EXT_draw_instanced)
+ add_builtin_define(parser, "GL_EXT_draw_instanced", 1);
+
if (extensions->ARB_conservative_depth) {
add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y
index 9cc5f4ac501..25a91169e90 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y
@@ -1462,7 +1462,7 @@ _arguments_parse (argument_list_t *arguments,
else {
if (argument->head == NULL) {
/* Don't treat initial whitespace as
- * part of the arguement. */
+ * part of the argument. */
if (node->token->type == SPACE)
continue;
}
@@ -2414,6 +2414,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_draw_instanced)
add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->EXT_draw_instanced)
+ add_builtin_define(parser, "GL_EXT_draw_instanced", 1);
+
if (extensions->ARB_conservative_depth) {
add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp
index df9b8be424a..c4e7a03cccc 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp
@@ -265,6 +265,21 @@ static void propagate_precision_expr(ir_instruction *ir, void *data)
}
+static void propagate_precision_texture(ir_instruction *ir, void *data)
+{
+ ir_texture* tex = ir->as_texture();
+ if (!tex)
+ return;
+
+ glsl_precision sampler_prec = tex->sampler->get_precision();
+ if (tex->get_precision() == sampler_prec || sampler_prec == glsl_precision_undefined)
+ return;
+
+ // set precision of ir_texture node to that of the sampler itself
+ tex->set_precision(sampler_prec);
+ ((precision_ctx*)data)->res = true;
+}
+
struct undefined_ass_ctx
{
ir_variable* var;
@@ -381,8 +396,19 @@ static bool propagate_precision(exec_list* list, bool assign_high_to_undefined)
ctx.root_ir = list;
foreach_in_list(ir_instruction, ir, list)
{
+ visit_tree (ir, propagate_precision_texture, &ctx);
visit_tree (ir, propagate_precision_deref, &ctx);
+ bool hadProgress = ctx.res;
+ ctx.res = false;
visit_tree (ir, propagate_precision_assign, &ctx);
+ if (ctx.res)
+ {
+ // assignment precision propagation might have added precision
+ // to some variables; need to propagate dereference precision right
+ // after that too.
+ visit_tree (ir, propagate_precision_deref, &ctx);
+ }
+ ctx.res |= hadProgress;
visit_tree (ir, propagate_precision_call, &ctx);
visit_tree (ir, propagate_precision_expr, &ctx);
}
@@ -428,10 +454,6 @@ static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_
progress2 = propagate_precision (ir, state->metal_target); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx);
progress2 = do_copy_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation", ir, state, mem_ctx);
progress2 = do_copy_propagation_elements(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation elems", ir, state, mem_ctx);
- if (state->es_shader && linked)
- {
- progress2 = optimize_split_vectors(ir, linked, OPT_SPLIT_ONLY_LOOP_INDUCTORS); progress |= progress2; if (progress2) debug_print_ir("After split vectors", ir, state, mem_ctx);
- }
if (linked)
{
@@ -462,7 +484,6 @@ static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_
progress2 = do_swizzle_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After swizzle swizzle", ir, state, mem_ctx);
progress2 = do_noop_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After noop swizzle", ir, state, mem_ctx);
progress2 = optimize_split_arrays(ir, linked, state->metal_target && state->stage == MESA_SHADER_FRAGMENT); progress |= progress2; if (progress2) debug_print_ir ("After split arrays", ir, state, mem_ctx);
- progress2 = optimize_split_vectors(ir, linked, OPT_SPLIT_ONLY_UNUSED); progress |= progress2; if (progress2) debug_print_ir("After split unused vectors", ir, state, mem_ctx);
progress2 = optimize_redundant_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After redundant jumps", ir, state, mem_ctx);
// do loop stuff only when linked; otherwise causes duplicate loop induction variable
@@ -502,7 +523,14 @@ static void glsl_type_to_optimizer_desc(const glsl_type* type, glsl_precision pr
else if (type->is_sampler())
{
if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_2D)
- out->type = kGlslTypeTex2D;
+ {
+ if (type->sampler_shadow)
+ out->type = kGlslTypeTex2DShadow;
+ else if (type->sampler_array)
+ out->type = kGlslTypeTex2DArray;
+ else
+ out->type = kGlslTypeTex2D;
+ }
else if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_3D)
out->type = kGlslTypeTex3D;
else if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE)
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h
index 8dfc74bb007..668351e0079 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h
@@ -52,6 +52,8 @@ enum glslopt_basic_type {
kGlslTypeTex2D,
kGlslTypeTex3D,
kGlslTypeTexCube,
+ kGlslTypeTex2DShadow,
+ kGlslTypeTex2DArray,
kGlslTypeOther,
kGlslTypeCount
};
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp
index 58f0ba475df..f742e9fd11c 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp
@@ -562,7 +562,9 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index, true, false, AMD_vertex_shader_viewport_index),
EXT(EXT_draw_buffers, false, true, EXT_draw_buffers),
+ EXT(EXT_draw_instanced, false, true, EXT_draw_instanced),
EXT(EXT_frag_depth, false, true, EXT_frag_depth),
+ EXT(EXT_gpu_shader4, true, false, EXT_gpu_shader4),
EXT(EXT_separate_shader_objects, false, true, dummy_true),
EXT(EXT_shader_framebuffer_fetch, false, true, EXT_shader_framebuffer_fetch),
EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix),
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h
index 746fd0dcf2f..51530d5368b 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h
@@ -473,8 +473,12 @@ struct _mesa_glsl_parse_state {
bool AMD_vertex_shader_viewport_index_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
+ bool EXT_draw_instanced_enable;
+ bool EXT_draw_instanced_warn;
bool EXT_frag_depth_enable;
bool EXT_frag_depth_warn;
+ bool EXT_gpu_shader4_enable;
+ bool EXT_gpu_shader4_warn;
bool EXT_separate_shader_objects_enable;
bool EXT_separate_shader_objects_warn;
bool EXT_shader_framebuffer_fetch_enable;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h
index e1154e9dfc3..c4f5465f846 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h
@@ -124,14 +124,6 @@ bool lower_vector_insert(exec_list *instructions, bool lower_nonconstant_index);
void lower_named_interface_blocks(void *mem_ctx, gl_shader *shader);
bool optimize_redundant_jumps(exec_list *instructions);
-typedef enum {
- OPT_SPLIT_ONLY_LOOP_INDUCTORS = 0, //< only split vectors that are used as loop inductors (and are not used by any vector operation)
- OPT_SPLIT_ONLY_UNUSED = 1, //< only split vectors that have unused components (and are not used by any vector operation)
- OPT_SPLIT_ANY_POSSIBLE = 2, //< Split all vectors that are only accessed by their components
-} glsl_vector_splitting_mode;
-
-bool optimize_split_vectors(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode);
-
bool optimize_split_arrays(exec_list *instructions, bool linked, bool split_shader_outputs);
bool lower_offset_arrays(exec_list *instructions);
void optimize_dead_builtin_variables(exec_list *instructions,
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
index d7628eed793..f11893bbad6 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
@@ -231,6 +231,10 @@ _mesa_print_ir_glsl(exec_list *instructions,
}
if (state->ARB_shader_texture_lod_enable)
str.asprintf_append ("#extension GL_ARB_shader_texture_lod : enable\n");
+ if (state->ARB_draw_instanced_enable)
+ str.asprintf_append ("#extension GL_ARB_draw_instanced : enable\n");
+ if (state->EXT_gpu_shader4_enable)
+ str.asprintf_append ("#extension GL_EXT_gpu_shader4 : enable\n");
if (state->EXT_shader_texture_lod_enable)
str.asprintf_append ("#extension GL_EXT_shader_texture_lod : enable\n");
if (state->OES_standard_derivatives_enable)
@@ -242,12 +246,16 @@ _mesa_print_ir_glsl(exec_list *instructions,
if (state->es_shader && state->language_version < 300)
{
if (state->EXT_draw_buffers_enable)
- str.asprintf_append ("#extension GL_EXT_draw_buffers : require\n");
+ str.asprintf_append ("#extension GL_EXT_draw_buffers : enable\n");
+ if (state->EXT_draw_instanced_enable)
+ str.asprintf_append ("#extension GL_EXT_draw_instanced : enable\n");
}
if (state->EXT_shader_framebuffer_fetch_enable)
str.asprintf_append ("#extension GL_EXT_shader_framebuffer_fetch : enable\n");
if (state->ARB_shader_bit_encoding_enable)
str.asprintf_append("#extension GL_ARB_shader_bit_encoding : enable\n");
+ if (state->EXT_texture_array_enable)
+ str.asprintf_append ("#extension GL_EXT_texture_array : enable\n");
}
// remove unused struct declarations
@@ -816,14 +824,17 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
{
glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality;
const bool is_shadow = ir->sampler->type->sampler_shadow;
+ const bool is_array = ir->sampler->type->sampler_array;
const glsl_type* uv_type = ir->coordinate->type;
const int uv_dim = uv_type->vector_elements;
int sampler_uv_dim = tex_sampler_dim_size[sampler_dim];
if (is_shadow)
sampler_uv_dim += 1;
+ if (is_array)
+ sampler_uv_dim += 1;
const bool is_proj = (uv_dim > sampler_uv_dim);
const bool is_lod = (ir->op == ir_txl);
-
+
#if 0 // BK - disable LOD workarounds.
if (is_lod && state->es_shader && state->language_version < 300 && state->stage == MESA_SHADER_FRAGMENT)
{
@@ -855,6 +866,7 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
}
#endif // 0
+
// texture function name
//ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130
if(state->language_version<130)
@@ -869,6 +881,9 @@ void ir_print_glsl_visitor::visit(ir_texture *ir)
else
buffer.asprintf_append ("texture");
}
+
+ if (is_array && state->EXT_texture_array_enable)
+ buffer.asprintf_append ("Array");
if (is_proj)
buffer.asprintf_append ("Proj");
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
index 01dcf8ee978..f9988a31f61 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
@@ -101,6 +101,7 @@ struct metal_print_context
, paramsStr(ralloc_strdup(buffer, ""))
, writingParams(false)
, matrixCastsDone(false)
+ , matrixConstructorsDone(false)
, shadowSamplerDone(false)
, textureCounter(0)
, attributeCounter(0)
@@ -118,6 +119,7 @@ struct metal_print_context
string_buffer paramsStr;
bool writingParams;
bool matrixCastsDone;
+ bool matrixConstructorsDone;
bool shadowSamplerDone;
int textureCounter;
int attributeCounter;
@@ -207,6 +209,7 @@ _mesa_print_ir_metal(exec_list *instructions,
// includes, prefix etc.
ctx.prefixStr.asprintf_append ("#include <metal_stdlib>\n");
+ ctx.prefixStr.asprintf_append ("#pragma clang diagnostic ignored \"-Wparentheses-equality\"\n");
ctx.prefixStr.asprintf_append ("using namespace metal;\n");
ctx.inputStr.asprintf_append("struct xlatMtlShaderInput {\n");
@@ -233,8 +236,10 @@ _mesa_print_ir_metal(exec_list *instructions,
// skip gl_ variables if they aren't used/assigned
if (strstr(var->name, "gl_") == var->name)
{
- if (!var->data.used && !var->data.assigned)
- continue;
+ if (NULL == strstr(var->name, "gl_FragData_") ) {
+ if (!var->data.used && !var->data.assigned)
+ continue;
+ }
}
//
@@ -462,6 +467,8 @@ static void print_type_precision(string_buffer& buffer, const glsl_type *t, glsl
typeName = "depth2d<float>"; // depth type must always be float
else if (!strcmp(typeName, "samplerCubeShadow"))
typeName = "depthcube<float>"; // depth type must always be float
+ else if (!strcmp(typeName, "sampler2DArray"))
+ typeName = halfPrec ? "texture2d_array<half>" : "texture2d_array<float>";
if (t->base_type == GLSL_TYPE_ARRAY) {
print_type_precision(buffer, t->fields.array, prec, true);
@@ -940,22 +947,57 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
bool op0cast = ir->operands[0] && is_different_precision(arg_prec, ir->operands[0]->get_precision());
bool op1cast = ir->operands[1] && is_different_precision(arg_prec, ir->operands[1]->get_precision());
bool op2cast = ir->operands[2] && is_different_precision(arg_prec, ir->operands[2]->get_precision());
+ const bool op0matrix = ir->operands[0] && ir->operands[0]->type->is_matrix();
+ const bool op1matrix = ir->operands[1] && ir->operands[1]->type->is_matrix();
+ bool op0castTo1 = false;
+ bool op1castTo0 = false;
// Metal does not support matrix precision casts, so when any of the arguments is a matrix,
// take precision from it. This isn't fully robust now, but oh well.
- if (op0cast && ir->operands[0]->type->is_matrix() && !op1cast)
+ if (op0cast && op0matrix && !op1cast)
{
op0cast = false;
arg_prec = ir->operands[0]->get_precision();
op1cast = ir->operands[1] && is_different_precision(arg_prec, ir->operands[1]->get_precision());
}
- if (op1cast && ir->operands[1]->type->is_matrix() && !op0cast)
+ if (op1cast && op1matrix && !op0cast)
{
op1cast = false;
arg_prec = ir->operands[1]->get_precision();
op0cast = ir->operands[0] && is_different_precision(arg_prec, ir->operands[0]->get_precision());
}
+ // Metal does not have matrix+scalar and matrix-scalar operations; we need to create matrices
+ // out of the non-matrix argument.
+ if (ir->operation == ir_binop_add || ir->operation == ir_binop_sub)
+ {
+ if (op0matrix && !op1matrix)
+ {
+ op1cast = true;
+ op1castTo0 = true;
+ }
+ if (op1matrix && !op0matrix)
+ {
+ op0cast = true;
+ op0castTo1 = true;
+ }
+ if (op1castTo0 || op0castTo1)
+ {
+ if (!ctx.matrixConstructorsDone)
+ {
+ ctx.prefixStr.asprintf_append(
+ "inline float4x4 _xlinit_float4x4(float v) { return float4x4(float4(v), float4(v), float4(v), float4(v)); }\n"
+ "inline float3x3 _xlinit_float3x3(float v) { return float3x3(float3(v), float3(v), float3(v)); }\n"
+ "inline float2x2 _xlinit_float2x2(float v) { return float2x2(float2(v), float2(v)); }\n"
+ "inline half4x4 _xlinit_half4x4(half v) { return half4x4(half4(v), half4(v), half4(v), half4(v)); }\n"
+ "inline half3x3 _xlinit_half3x3(half v) { return half3x3(half3(v), half3(v), half3(v)); }\n"
+ "inline half2x2 _xlinit_half2x2(half v) { return half2x2(half2(v), half2(v)); }\n"
+ );
+ ctx.matrixConstructorsDone = true;
+ }
+ }
+ }
+
const bool rescast = is_different_precision(arg_prec, res_prec) && !ir->type->is_boolean();
if (rescast)
{
@@ -1000,6 +1042,7 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
}
else if (is_binop_func_like(ir->operation, ir->type))
{
+ // binary operation that must be printed like a function, "foo(a,b)"
if (ir->operation == ir_binop_mod)
{
buffer.asprintf_append ("(");
@@ -1025,23 +1068,58 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
if (ir->operation == ir_binop_mod)
buffer.asprintf_append ("))");
}
+ else if (ir->get_num_operands() == 2 && ir->operation == ir_binop_div && op0matrix && !op1matrix)
+ {
+ // "matrix/scalar" - Metal does not have it, so print multiply by inverse instead
+ buffer.asprintf_append ("(");
+ ir->operands[0]->accept(this);
+ const bool halfCast = (arg_prec == glsl_precision_medium || arg_prec == glsl_precision_low);
+ buffer.asprintf_append (halfCast ? " * (1.0h/half(" : " * (1.0/(");
+ ir->operands[1]->accept(this);
+ buffer.asprintf_append (")))");
+ }
else if (ir->get_num_operands() == 2)
{
+ // regular binary operator
buffer.asprintf_append ("(");
if (ir->operands[0])
{
- if (op0cast)
+ if (op0castTo1)
+ {
+ buffer.asprintf_append ("_xlinit_");
+ print_type_precision(buffer, ir->operands[1]->type, arg_prec, false);
+ buffer.asprintf_append ("(");
+ }
+ else if (op0cast)
+ {
print_cast (buffer, arg_prec, ir->operands[0]);
+ }
ir->operands[0]->accept(this);
+ if (op0castTo1)
+ {
+ buffer.asprintf_append (")");
+ }
}
buffer.asprintf_append (" %s ", operator_glsl_strs[ir->operation]);
if (ir->operands[1])
{
- if (op1cast)
+ if (op1castTo0)
+ {
+ buffer.asprintf_append ("_xlinit_");
+ print_type_precision(buffer, ir->operands[0]->type, arg_prec, false);
+ buffer.asprintf_append ("(");
+ }
+ else if (op1cast)
+ {
print_cast (buffer, arg_prec, ir->operands[1]);
+ }
ir->operands[1]->accept(this);
+ if (op1castTo0)
+ {
+ buffer.asprintf_append (")");
+ }
}
buffer.asprintf_append (")");
}
@@ -1087,17 +1165,26 @@ static int tex_sampler_dim_size[] = {
};
-static void print_texture_uv (ir_print_metal_visitor* vis, ir_texture* ir, bool is_shadow, bool is_proj, int uv_dim, int sampler_uv_dim)
+static void print_texture_uv (ir_print_metal_visitor* vis, ir_texture* ir, bool is_shadow, bool is_proj, bool is_array, int uv_dim, int sampler_uv_dim)
{
if (!is_shadow)
{
- if (!is_proj)
+ if (!is_proj && !is_array)
{
// regular UV
vis->buffer.asprintf_append (sampler_uv_dim == 3 ? "(float3)(" : "(float2)(");
ir->coordinate->accept(vis);
vis->buffer.asprintf_append (")");
}
+ else if (is_array)
+ {
+ // array sample
+ vis->buffer.asprintf_append ("(float2)((");
+ ir->coordinate->accept(vis);
+ vis->buffer.asprintf_append (").xy), (uint)((");
+ ir->coordinate->accept(vis);
+ vis->buffer.asprintf_append (").z)");
+ }
else
{
// regular projected
@@ -1139,12 +1226,13 @@ void ir_print_metal_visitor::visit(ir_texture *ir)
{
glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality;
const bool is_shadow = ir->sampler->type->sampler_shadow;
+ const bool is_array = ir->sampler->type->sampler_array;
const glsl_type* uv_type = ir->coordinate->type;
const int uv_dim = uv_type->vector_elements;
int sampler_uv_dim = tex_sampler_dim_size[sampler_dim];
if (is_shadow)
sampler_uv_dim += 1;
- const bool is_proj = (uv_dim > sampler_uv_dim);
+ const bool is_proj = (uv_dim > sampler_uv_dim) && !is_array;
// texture name & call to sample
ir->sampler->accept(this);
@@ -1166,7 +1254,7 @@ void ir_print_metal_visitor::visit(ir_texture *ir)
buffer.asprintf_append (", ");
// texture coordinate
- print_texture_uv (this, ir, is_shadow, is_proj, uv_dim, sampler_uv_dim);
+ print_texture_uv (this, ir, is_shadow, is_proj, is_array, uv_dim, sampler_uv_dim);
// lod bias
if (ir->op == ir_txb)
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp
index ea2b0aa0774..832c73b535c 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp
@@ -256,7 +256,7 @@ namespace {
*
* As uniforms are added to the active set the number of active uniforms and
* the storage requirements for those uniforms are accumulated. The active
- * uniforms are added the the hash table supplied to the constructor.
+ * uniforms are added to the hash table supplied to the constructor.
*
* If the same uniform is added multiple times (i.e., once for each shader
* target), it will only be accounted once.
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp
index 71fdcfc1a39..240ffc7399d 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp
@@ -28,6 +28,8 @@
static bool is_loop_terminator(ir_if *ir);
+static bool used_outside_loops(exec_node *head, ir_variable *var, bool first_assignment);
+
static bool all_expression_operands_are_loop_constant(ir_rvalue *,
hash_table *);
@@ -121,13 +123,20 @@ loop_state::get_for_inductor(const ir_variable *ir)
}
void
+loop_state::insert_non_inductor(ir_variable *var)
+{
+ // key doesn't matter, just needs to be non-NULL
+ hash_table_insert(this->ht_non_inductors, this, var);
+}
+
+bool
loop_state::insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop)
{
ir_variable* var = loopvar->var;
// Check if this variable is already marked as "sure can't be a private inductor variable"
if (hash_table_find(this->ht_non_inductors, var))
- return;
+ return false;
// Check if this variable is used after the loop anywhere. If it is, it can't be a
// variable that's private to the loop.
@@ -143,7 +152,7 @@ loop_state::insert_inductor(loop_variable* loopvar, loop_variable_state* state,
// add to list of "non inductors", so that next loop does not try
// to add it as inductor again
hash_table_insert(this->ht_non_inductors, state, var);
- return;
+ return false;
}
}
@@ -166,12 +175,13 @@ loop_state::insert_inductor(loop_variable* loopvar, loop_variable_state* state,
// add to list of "non inductors", so that next loop does not try
// to add it as inductor again
hash_table_insert(this->ht_non_inductors, state, var);
- return;
+ return false;
}
}
state->private_induction_variable_count++;
hash_table_insert(this->ht_inductors, state, var);
+ return true;
}
@@ -245,6 +255,8 @@ public:
virtual ir_visitor_status visit(ir_loop_jump *);
virtual ir_visitor_status visit(ir_dereference_variable *);
+ virtual ir_visitor_status visit(ir_variable *);
+
virtual ir_visitor_status visit_enter(ir_call *);
virtual ir_visitor_status visit_enter(ir_loop *);
@@ -289,6 +301,28 @@ loop_analysis::visit(ir_loop_jump *ir)
ir_visitor_status
+loop_analysis::visit(ir_variable *var)
+{
+ // if inside a loop, simply continue - we're only interested in variables declared
+ // entirely outside of any loops
+ if (!this->state.is_empty())
+ return visit_continue;
+
+ // Check if this variable is used outside a loop anywhere. If it is, it can't be a
+ // variable that's private to the loop, so can't be an inductor.
+ // This doesn't reject all possible non-inductors, notably anything declared in an
+ // outer loop that isn't an inductor in an inner loop, but it can eliminate some
+ // problem cases
+ if (used_outside_loops(var->next, var, false))
+ {
+ // add to list of "non inductors"
+ loops->insert_non_inductor(var);
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
loop_analysis::visit_enter(ir_call *)
{
/* Mark every loop that we're currently analyzing as containing an ir_call
@@ -451,11 +485,12 @@ loop_analysis::visit_leave(ir_loop *ir)
ir_rvalue *const inc =
get_basic_induction_increment(lv->first_assignment, ls->var_hash);
if (inc != NULL) {
- lv->increment = inc;
+ lv->increment = inc;
- lv->remove();
- ls->induction_variables.push_tail(lv);
- loops->insert_inductor(lv, ls, ir);
+ if (loops->insert_inductor(lv, ls, ir)) {
+ lv->remove();
+ ls->induction_variables.push_tail(lv);
+ }
}
}
@@ -699,6 +734,65 @@ is_loop_terminator(ir_if *ir)
}
+bool
+used_outside_loops(exec_node *head, ir_variable *var, bool first_assignment)
+{
+ ir_variable_refcount_visitor refs;
+ for (exec_node* node = head;
+ !node->is_tail_sentinel();
+ node = node->next)
+ {
+ ir_instruction *ir = (ir_instruction *) node;
+ if (ir->ir_type == ir_type_variable)
+ continue;
+
+ // ignore the first assignment
+ if (!first_assignment && ir->ir_type == ir_type_assignment)
+ {
+ ir_assignment *assign = ir->as_assignment();
+ ir_variable *assignee = assign->lhs->whole_variable_referenced();
+
+ if(assignee == var)
+ {
+ first_assignment = true;
+ continue;
+ }
+ }
+
+ // we don't want to recurse into loops
+ if (ir->ir_type == ir_type_loop)
+ continue;
+
+ // recurse only for if statements, the other case we would need to recurse is
+ // loops, but we are looking for uses outside of loops.
+ if (ir->ir_type == ir_type_if)
+ {
+ ir_if *irif = ir->as_if();
+ if (used_outside_loops(irif->then_instructions.head, var, first_assignment))
+ return true;
+ if (used_outside_loops(irif->else_instructions.head, var, first_assignment))
+ return true;
+
+ // if we didn't find in each branch with our recursion, skip
+ // otherwise the accept (&refs) below will recurse into loops
+ // and may give a false positive.
+ continue;
+ }
+
+ // we know that we're not inside a loop as we haven't recursed inside,
+ // and we started outside of a loop, so any references to this variable
+ // mean it is used outside of any loops
+ ir->accept (&refs);
+ if (refs.find_variable_entry(var))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
loop_state *
analyze_loop_variables(exec_list *instructions)
{
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h
index 09882d933d7..299dbcfc89b 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h
@@ -249,7 +249,8 @@ public:
loop_variable_state *insert(ir_loop *ir);
loop_variable_state* get_for_inductor (const ir_variable*);
- void insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop);
+ bool insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop);
+ void insert_non_inductor(ir_variable *var);
bool loop_found;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp
index db73c7b0fc2..f6b38e3f84d 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp
@@ -569,8 +569,8 @@ private:
* return pack_uvec2_to_uint(uvec2(
* round(clamp(VEC2_RVALUE, 0.0f, 1.0f) * 65535.0f)));
*
- * Here it is safe to directly convert the vec2 to uvec2 because the the
- * vec2 has been clamped to a non-negative range.
+ * Here it is safe to directly convert the vec2 to uvec2 because the vec2
+ * has been clamped to a non-negative range.
*/
assert(vec2_rval->type == glsl_type::vec2_type);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp
index d7face480d5..cb8cf87e3b5 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp
@@ -35,7 +35,7 @@
* the built-in varyings have pre-assigned locations. Also, the elimination
* of unused gl_TexCoord elements requires its own lowering pass anyway.
*
- * It's implemented by replacing all occurences of dead varyings with
+ * It's implemented by replacing all occurrences of dead varyings with
* temporary variables, which creates dead code. It is recommended to run
* a dead-code elimination pass after this.
*
@@ -280,7 +280,7 @@ public:
*
* We're going to break down the gl_TexCoord array into separate
* variables. First, add declarations of the new variables all
- * occurences of gl_TexCoord will be replaced with.
+ * occurrences of gl_TexCoord will be replaced with.
*/
if (info->lower_texcoord_array) {
prepare_array(ir, this->new_texcoord, ARRAY_SIZE(this->new_texcoord),
@@ -411,7 +411,7 @@ public:
* variable dereference representing gl_TexCoord[i].
*/
if (this->info->lower_texcoord_array) {
- /* gl_TexCoord[i] occurence */
+ /* gl_TexCoord[i] occurrence */
ir_dereference_array *const da = (*rvalue)->as_dereference_array();
if (da && da->variable_referenced() ==
@@ -425,7 +425,7 @@ public:
/* Same for gl_FragData. */
if (this->info->lower_fragdata_array) {
- /* gl_FragData[i] occurence */
+ /* gl_FragData[i] occurrence */
ir_dereference_array *const da = (*rvalue)->as_dereference_array();
if (da && da->variable_referenced() == this->info->fragdata_array) {
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp
index b9c373b2b48..90cca2b755c 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp
@@ -150,7 +150,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
parameters[i]->data.precision = param->get_precision();
prec_params_max = higher_precision (prec_params_max, (glsl_precision)parameters[i]->data.precision);
- /* Remove the read-only decoration becuase we're going to write
+ /* Remove the read-only decoration because we're going to write
* directly to this variable. If the cloned variable is left
* read-only and the inlined function is inside a loop, the loop
* analysis code will get confused.
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp
deleted file mode 100644
index 978d429a5ec..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Based on work Copyright © 2010 Intel Corporation, vector splitting
- * implemented by Copyright © 2014 Unity Technologies
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file opt_vector_splitting.cpp
- *
- * If a vector is always dereferenced only by its xyzw components separately,
- * and never accessed as a whole (or with swizzle mask with >1 bits set), then
- * split it apart into its elements, making it more amenable to other
- * optimization passes.
- *
- * This skips uniforms/varyings, which would need careful
- * handling due to their ir->location fields tying them to the GL API
- * and other shader stages.
- */
-
-#include "ir.h"
-#include "ir_visitor.h"
-#include "ir_rvalue_visitor.h"
-#include "glsl_types.h"
-#include "ir_optimization.h"
-#include "loop_analysis.h"
-
-static bool debug = false;
-
-namespace {
- namespace opt_vector_splitting {
-
- class variable_entry : public exec_node
- {
- public:
- variable_entry(ir_variable *var)
- {
- this->var = var;
- this->split = true;
- this->use_mask = 0;
- this->declaration = false;
- this->components = NULL;
- this->mem_ctx = NULL;
- }
-
- ir_variable *var; /* The key: the variable's pointer. */
-
- /** Whether this array should be split or not. */
- bool split;
-
- /** bitmask for the components in the vector that actually get written to.
- * If multiple slots are written simultaneously, split gets set to false.*/
- int use_mask;
-
- /* If the variable had a decl we can work with in the instruction
- * stream. We can't do splitting on function arguments, which
- * don't get this variable set.
- */
- bool declaration;
-
- ir_variable **components;
-
- /** ralloc_parent(this->var) -- the shader's talloc context. */
- void *mem_ctx;
- };
-
- } /* namespace */
-
-
-using namespace opt_vector_splitting;
-
-/**
- * This class does a walk over the tree, coming up with the set of
- * variables that could be split by looking to see if they are arrays
- * that are only ever constant-index dereferenced.
- */
-class ir_vector_reference_visitor : public ir_hierarchical_visitor {
-public:
- ir_vector_reference_visitor(void)
- {
- this->mem_ctx = ralloc_context(NULL);
- this->variable_list.make_empty();
- }
-
- ~ir_vector_reference_visitor(void)
- {
- ralloc_free(mem_ctx);
- }
-
- bool get_split_list(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode);
-
- virtual ir_visitor_status visit(ir_variable *);
- virtual ir_visitor_status visit(ir_dereference_variable *);
- virtual ir_visitor_status visit_enter(ir_swizzle *);
- virtual ir_visitor_status visit_enter(ir_assignment *);
- virtual ir_visitor_status visit_enter(ir_function_signature *);
-
- variable_entry *get_variable_entry(ir_variable *var);
-
- /* List of variable_entry */
- exec_list variable_list;
-
- /* Current split mode */
- glsl_vector_splitting_mode mode;
-
- loop_state *loopstate;
-
- void *mem_ctx;
-};
-
-} /* namespace */
-
-variable_entry *
-ir_vector_reference_visitor::get_variable_entry(ir_variable *var)
-{
- assert(var);
-
- if (var->data.mode != ir_var_auto &&
- var->data.mode != ir_var_temporary)
- return NULL;
-
- if (!var->type->is_vector())
- return NULL;
-
- // If mode is loop_inductors, allow only loop inductors to be stored.
- if (mode == OPT_SPLIT_ONLY_LOOP_INDUCTORS && loopstate)
- {
- loop_variable_state* inductor_state = loopstate->get_for_inductor(var);
- if (!inductor_state)
- {
- return NULL;
- }
- }
-
- foreach_in_list(variable_entry, entry, &this->variable_list) {
- if (entry->var == var)
- return entry;
- }
-
-
- variable_entry *entry = new(mem_ctx) variable_entry(var);
- this->variable_list.push_tail(entry);
- return entry;
-}
-
-
-ir_visitor_status
-ir_vector_reference_visitor::visit(ir_variable *ir)
-{
- variable_entry *entry = this->get_variable_entry(ir);
-
- if (entry)
- entry->declaration = true;
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_vector_reference_visitor::visit(ir_dereference_variable *ir)
-{
- variable_entry *entry = this->get_variable_entry(ir->var);
-
- /* If we made it to here without seeing an ir_swizzle,
- * then the dereference of this vector didn't have a swizzle in it
- * (see the visit_continue_with_parent below), so we can't split
- * the variable.
- */
- if (entry)
- entry->split = false;
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_vector_reference_visitor::visit_enter(ir_swizzle *ir)
-{
- ir_variable *var = ir->variable_referenced();
- if (!var)
- return visit_continue;
-
- variable_entry *entry = this->get_variable_entry(var);
-
- if (entry)
- {
- if (ir->mask.num_components > 1)
- {
- entry->split = false;
- }
- else
- {
- // Update the usemask
- entry->use_mask |= (1 << ir->mask.x);
- }
- }
-
- // Skip the rest of the swizzle IR tree, we're done here.
- return visit_continue_with_parent;
-}
-
-ir_visitor_status
-ir_vector_reference_visitor::visit_enter(ir_assignment *ir)
-{
- ir_dereference_variable *dest = ir->lhs->as_dereference_variable();
- if (dest)
- {
- variable_entry *entry = this->get_variable_entry(dest->var);
- if (entry)
- {
- // Count how many bits the write mask has
- unsigned maskbitval = ir->write_mask; // count the number of bits set
- int maskbitcount; // accumulates the total bits set
- for ( maskbitcount = 0; maskbitval; maskbitcount++)
- {
- maskbitval &= maskbitval - 1; // clear the least significant bit set
- }
- if (maskbitcount > 1)
- {
- // Writing to more than one slot, cannot split.
- entry->split = false;
- }
-
- // Update write mask
- entry->use_mask |= ir->write_mask;
- }
- }
-
- // Visit only the rhs, there may be swizzles and variable dereferences there as well
- ir->rhs->accept(this);
- return visit_continue_with_parent;
-
-}
-
-ir_visitor_status
-ir_vector_reference_visitor::visit_enter(ir_function_signature *ir)
-{
- /* We don't have logic for array-splitting function arguments,
- * so just look at the body instructions and not the parameter
- * declarations.
- */
- visit_list_elements(this, &ir->body);
- return visit_continue_with_parent;
-}
-
-bool
-ir_vector_reference_visitor::get_split_list(exec_list *instructions,
- bool linked,
- glsl_vector_splitting_mode _mode)
-{
- mode = _mode;
-
- if (linked)
- {
- loop_state* ls = analyze_loop_variables(instructions);
- if (ls->loop_found)
- set_loop_controls(instructions, ls);
-
- loopstate = ls;
- }
- else
- {
- loopstate = NULL;
- }
-
- visit_list_elements(this, instructions);
-
- /* If the shaders aren't linked yet, we can't mess with global
- * declarations, which need to be matched by name across shaders.
- */
- if (!linked) {
- foreach_in_list(ir_variable, var, instructions) {
- if (var) {
- variable_entry *entry = get_variable_entry(var);
- if (entry)
- entry->remove();
- }
- }
- }
-
- /* Trim out variables we found that we can't split. */
- foreach_in_list_safe(variable_entry, entry, &variable_list) {
-
- if (debug) {
- printf("array %s@%p: decl %d, split %d\n",
- entry->var->name, (void *) entry->var, entry->declaration,
- entry->split);
- }
-
- if (!(entry->declaration && entry->split)) {
- entry->remove();
- }
- else if (mode == OPT_SPLIT_ONLY_UNUSED)
- {
- /* Build mask of fully used vector (vec2 -> 0x3, vec3 -> 0x7, vec4 -> 0xe) */
- unsigned int fullmask = (1 << entry->var->type->vector_elements) - 1;
- if (entry->use_mask == fullmask)
- {
- entry->remove();
- }
- }
- }
-
- return !variable_list.is_empty();
-}
-
-/**
- * This class rewrites the dereferences of arrays that have been split
- * to use the newly created ir_variables for each component.
- */
-class ir_vector_splitting_visitor : public ir_rvalue_visitor {
-public:
- ir_vector_splitting_visitor(exec_list *vars)
- {
- this->variable_list = vars;
- }
-
- virtual ~ir_vector_splitting_visitor()
- {
- }
-
- virtual ir_visitor_status visit_leave(ir_assignment *);
-
- void split_rvalue(ir_rvalue **rval);
- void handle_rvalue(ir_rvalue **rvalue);
- variable_entry *get_splitting_entry(ir_variable *var);
-
- exec_list *variable_list;
-};
-
-variable_entry *
-ir_vector_splitting_visitor::get_splitting_entry(ir_variable *var)
-{
- assert(var);
-
- foreach_in_list(variable_entry, entry, this->variable_list) {
- if (entry->var == var) {
- return entry;
- }
- }
-
- return NULL;
-}
-
-void
-ir_vector_splitting_visitor::split_rvalue(ir_rvalue **rval)
-{
- ir_swizzle *swizzle = (*rval)->as_swizzle();
-
- if (!swizzle)
- return;
-
- ir_variable *var = swizzle->variable_referenced();
- if (!var)
- return;
-
- variable_entry *entry = get_splitting_entry(var);
- if (!entry)
- return;
-
- assert(swizzle->mask.num_components == 1);
-
- *rval = new(entry->mem_ctx)
- ir_dereference_variable(entry->components[swizzle->mask.x]);
-}
-
-void
-ir_vector_splitting_visitor::handle_rvalue(ir_rvalue **rvalue)
-{
- if (!*rvalue)
- return;
-
- ir_rvalue *v = *rvalue;
- split_rvalue(&v);
- *rvalue = v;
-}
-
-ir_visitor_status
-ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
-{
- /* The normal rvalue visitor skips the LHS of assignments, but we
- * need to process those just the same.
- */
- ir_rvalue *lhs = ir->lhs;
-
- ir_dereference_variable *dest = ir->lhs->as_dereference_variable();
- if (dest)
- {
- variable_entry *entry = get_splitting_entry(dest->var);
- if (entry)
- {
- // Find the only set bit in writemask
- int component = 0;
- while (((ir->write_mask & (1 << component)) == 0) && (component < 4))
- {
- component++;
- }
- assert(ir->write_mask == (1 << component));
-
- ir_dereference_variable *newderef = new(entry->mem_ctx)
- ir_dereference_variable(entry->components[component]);
-
- ir->set_lhs(newderef);
- }
- }
- else
- {
- ir->lhs = lhs->as_dereference();
- ir->lhs->accept(this);
- }
-
- handle_rvalue(&ir->rhs);
- ir->rhs->accept(this);
-
- if (ir->condition) {
- handle_rvalue(&ir->condition);
- ir->condition->accept(this);
- }
-
- return visit_continue;
-}
-
-bool
-optimize_split_vectors(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode)
-{
- ir_vector_reference_visitor refs;
- if (!refs.get_split_list(instructions, linked, mode))
- return false;
-
- void *mem_ctx = ralloc_context(NULL);
-
- /* Replace the decls of the vectors to be split with their split
- * components.
- */
- foreach_in_list(variable_entry, entry, &refs.variable_list) {
- const struct glsl_type *type = entry->var->type;
- const struct glsl_type *subtype;
- glsl_precision subprec = (glsl_precision)entry->var->data.precision;
-
- subtype = type->get_base_type();
-
- entry->mem_ctx = ralloc_parent(entry->var);
-
- entry->components = ralloc_array(mem_ctx,
- ir_variable *,
- type->vector_elements);
-
- for (unsigned int i = 0; i < type->vector_elements; i++) {
- const char *name = ralloc_asprintf(mem_ctx, "%s_%c",
- entry->var->name, "xyzw"[i]);
-
- entry->components[i] =
- new(entry->mem_ctx) ir_variable(subtype, name, ir_var_temporary, subprec);
- entry->var->insert_before(entry->components[i]);
- }
-
- entry->var->remove();
- }
-
- ir_vector_splitting_visitor split(&refs.variable_list);
- visit_list_elements(&split, instructions);
-
- if (debug)
- _mesa_print_ir(stdout, instructions, NULL);
-
- ralloc_free(mem_ctx);
-
- return true;
-
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp
index 2d014b47a9f..b5ad168ae71 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp
@@ -106,6 +106,8 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.OES_EGL_image_external = true;
ctx->Extensions.OES_standard_derivatives = true;
+ ctx->Extensions.EXT_draw_instanced = true;
+ ctx->Extensions.EXT_gpu_shader4 = true;
ctx->Extensions.EXT_shader_integer_mix = true;
ctx->Extensions.EXT_texture3D = true;
ctx->Extensions.EXT_texture_array = true;
@@ -113,6 +115,8 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.NV_texture_rectangle = true;
+ ctx->Const.AllowGLSLExtensionDirectiveMidShader = true; // makes it easier to run tests
+
ctx->Const.GLSLVersion = 120;
/* 1.20 minimums. */
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp
index 37ae920360e..eb0d0489785 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp
@@ -135,7 +135,6 @@
'glsl/opt_swizzle_swizzle.cpp',
'glsl/opt_tree_grafting.cpp',
'glsl/opt_vectorize.cpp',
- 'glsl/opt_vector_splitting.cpp',
'glsl/opt_flip_matrices.cpp',
'glsl/opt_dead_builtin_varyings.cpp',
'glsl/program.h',
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h
index 2003632bf78..d351159d062 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h
@@ -1491,6 +1491,7 @@ struct gl_extensions
GLboolean EXT_depth_bounds_test;
GLboolean EXT_draw_buffers;
GLboolean EXT_draw_buffers2;
+ GLboolean EXT_draw_instanced;
GLboolean EXT_framebuffer_blit;
GLboolean EXT_framebuffer_multisample;
GLboolean EXT_framebuffer_multisample_blit_scaled;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/hash_table.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/hash_table.h
index e95fc4982ec..20595aac4c9 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/hash_table.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/hash_table.h
@@ -116,8 +116,8 @@ extern void hash_table_insert(struct hash_table *ht, void *data,
* Add an element to a hash table with replacement
*
* \return
- * 1 if it did replace the the value (in which case the old key is kept), 0 if
- * it did not replace the value (in which case the new key is kept).
+ * 1 if it did replace the value (in which case the old key is kept), 0 if it
+ * did not replace the value (in which case the new key is kept).
*
* \warning
* If \c key is already in the hash table, \c data will \b replace the most
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt
index fae455fda01..90a8b9fa394 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt
@@ -5,7 +5,8 @@ void main ()
discard;
};
a_2 = 4.0;
- for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) {
+ for (int i_1 = 0; i_1 < 10; i_1++) {
+ a_2 += 1.0;
};
while (true) {
a_2 += 2.0;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
index 73a494c030a..da1b7ee4b1b 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
@@ -7,7 +7,8 @@ void main ()
discard;
};
a_2 = 4.0;
- for (highp int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) {
+ for (highp int i_1 = 0; i_1 < 10; i_1++) {
+ a_2 += 1.0;
};
while (true) {
a_2 += 2.0;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt
index 3f7ca4fde74..0069dadf46a 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt
@@ -16,7 +16,8 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
discard_fragment();
};
a_2 = 4.0;
- for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) {
+ for (int i_1 = 0; i_1 < 10; i_1++) {
+ a_2 += 1.0;
};
while (true) {
a_2 += 2.0;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt
index c934a7645e2..bc1b63be667 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt
@@ -5,16 +5,24 @@ void main ()
int myIdx_2;
r_1 = vec4(0.0, 0.0, 0.0, 0.0);
myIdx_2 = 1;
- for (; myIdx_2 < loopNum; myIdx_2++) {
+ while (true) {
+ if ((myIdx_2 >= loopNum)) {
+ break;
+ };
r_1.x = (r_1.x + 1.0);
r_1.y = (r_1.y + 2.0);
r_1.z = (r_1.z + 3.0);
+ myIdx_2++;
};
myIdx_2 = 2;
- for (; myIdx_2 < loopNum; myIdx_2++) {
+ while (true) {
+ if ((myIdx_2 >= loopNum)) {
+ break;
+ };
r_1.x = (r_1.x + 1.0);
r_1.y = (r_1.y + 2.0);
r_1.z = (r_1.z + 3.0);
+ myIdx_2++;
};
gl_FragColor = r_1;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt
new file mode 100644
index 00000000000..97eb0711264
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt
@@ -0,0 +1,15 @@
+#version 300 es
+
+// There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler)
+// was producing a missing cast between half4 and float4 on Metal output.
+// Shader is a minimal part of Unity's camera motion blur shader that exposes the bug
+
+vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod(s, coord.xy, coord.w); }
+uniform highp sampler2D _CameraDepthTexture;
+in highp vec2 varUV;
+out mediump vec4 _fragData;
+void main()
+{
+ highp float z = xll_tex2Dlod(_CameraDepthTexture, vec4(varUV, 0.0, 0.0)).x;
+ _fragData = vec4(z);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt
new file mode 100644
index 00000000000..836ee2a6cbd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt
@@ -0,0 +1,17 @@
+#version 300 es
+uniform highp sampler2D _CameraDepthTexture;
+in highp vec2 varUV;
+out mediump vec4 _fragData;
+void main ()
+{
+ highp vec4 tmpvar_1;
+ tmpvar_1 = textureLod (_CameraDepthTexture, varUV, 0.0).xxxx;
+ _fragData = tmpvar_1;
+}
+
+
+// stats: 0 alu 1 tex 0 flow
+// inputs: 1
+// #0: varUV (high float) 2x1 [-1]
+// textures: 1
+// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt
new file mode 100644
index 00000000000..993c73706a7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt
@@ -0,0 +1,26 @@
+#include <metal_stdlib>
+using namespace metal;
+struct xlatMtlShaderInput {
+ float2 varUV;
+};
+struct xlatMtlShaderOutput {
+ half4 _fragData [[color(0)]];
+};
+struct xlatMtlShaderUniform {
+};
+fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
+ , texture2d<float> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ float4 tmpvar_1;
+ tmpvar_1 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.varUV), level(0.0)).xxxx;
+ _mtl_o._fragData = half4(tmpvar_1);
+ return _mtl_o;
+}
+
+
+// stats: 0 alu 1 tex 0 flow
+// inputs: 1
+// #0: varUV (high float) 2x1 [-1]
+// textures: 1
+// #0: _CameraDepthTexture (high 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt
new file mode 100644
index 00000000000..07579cf9242
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt
@@ -0,0 +1,118 @@
+#version 300 es
+
+// There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler)
+// was producing a missing cast between half4 and float4 on Metal output.
+// Shader is part of Unity's camera motion blur shader.
+
+vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod( s, coord.xy, coord.w); }
+struct v2f {
+ highp vec4 pos;
+ highp vec2 uv;
+};
+uniform highp vec3 _WorldSpaceCameraPos;
+uniform highp vec4 _ProjectionParams;
+uniform highp vec4 _ScreenParams;
+uniform highp vec4 _ZBufferParams;
+uniform highp vec4 _WorldSpaceLightPos0;
+uniform highp mat4 _Object2World;
+uniform highp mat4 _World2Object;
+uniform highp float _MaxRadiusOrKInPaper;
+const highp int SmallDiscKernelSamples = 12;
+const highp vec2[12] SmallDiscKernel = vec2[12]( vec2( -0.326212, -0.40581), vec2( -0.840144, -0.07358), vec2( -0.695914, 0.457137), vec2( -0.203345, 0.620716), vec2( 0.96234, -0.194983), vec2( 0.473434, -0.480026), vec2( 0.519456, 0.767022), vec2( 0.185461, -0.893124), vec2( 0.507431, 0.064425), vec2( 0.89642, 0.412458), vec2( -0.32194, -0.932615), vec2( -0.791559, -0.59771));
+uniform sampler2D _MainTex;
+uniform highp sampler2D _CameraDepthTexture;
+uniform sampler2D _VelTex;
+uniform sampler2D _NeighbourMaxTex;
+uniform sampler2D _NoiseTex;
+uniform sampler2D _TileTexDebug;
+uniform highp vec4 _MainTex_TexelSize;
+uniform highp vec4 _CameraDepthTexture_TexelSize;
+uniform highp vec4 _VelTex_TexelSize;
+uniform highp mat4 _InvViewProj;
+uniform highp mat4 _PrevViewProj;
+uniform highp mat4 _ToPrevViewProjCombined;
+uniform highp float _Jitter;
+uniform highp float _VelocityScale;
+uniform highp float _DisplayVelocityScale;
+uniform highp float _MaxVelocity;
+uniform highp float _MinVelocity;
+uniform highp vec4 _BlurDirectionPacked;
+uniform highp float _SoftZDistance;
+highp float Linear01Depth( in highp float z )
+{
+ return (1.0 / ((_ZBufferParams.x * z) + _ZBufferParams.y));
+}
+highp float cone( in highp vec2 px, in highp vec2 py, in highp vec2 v )
+{
+ return clamp( (1.0 - (length((px - py)) / length(v))), 0.0, 1.0);
+}
+highp float cylinder( in highp vec2 x, in highp vec2 y, in highp vec2 v )
+{
+ highp float lv = length(v);
+ return (1.0 - smoothstep( (0.95 * lv), (1.05 * lv), length((x - y))));
+}
+highp float softDepthCompare( in highp float za, in highp float zb )
+{
+ return clamp( (1.0 - ((za - zb) / _SoftZDistance)), 0.0, 1.0);
+}
+highp vec4 ReconstructionDiscBlur( in v2f i )
+{
+ highp vec2 xf = i.uv;
+ highp vec2 x = i.uv;
+
+ if ((_MainTex_TexelSize.y < 0.0))
+ {
+ xf.y = (1.0 - xf.y);
+ }
+
+ highp vec2 x2 = xf;
+ highp vec2 vn = xll_tex2Dlod(_NeighbourMaxTex, vec4(x2, 0.0, 0.0)).xy;
+ highp vec4 cx = xll_tex2Dlod(_MainTex, vec4(x, 0.0, 0.0));
+
+ highp vec2 vx = xll_tex2Dlod(_VelTex, vec4(xf, 0.0, 0.0)).xy;
+ highp vec4 noise = ((xll_tex2Dlod( _NoiseTex, (vec4(i.uv, 0.0, 0.0) * 11.0)) * 2.0) - 1.0);
+ highp float zx = xll_tex2Dlod(_CameraDepthTexture, vec4(x, 0.0, 0.0)).x;
+
+ zx = (-Linear01Depth( zx));
+ noise *= (_MainTex_TexelSize.xyxy * _Jitter);
+
+ highp float weight = 1.0;
+ highp vec4 sum = (cx * weight);
+ highp vec4 jitteredDir = (vn.xyxy + noise.xyyz);
+
+ jitteredDir = ((max( abs(jitteredDir.xyxy), ((_MainTex_TexelSize.xyxy * _MaxVelocity) * 0.15)) * sign(jitteredDir.xyxy)) * vec4( 1.0, 1.0, -1.0, -1.0));
+ highp int l = 0;
+ for ( ; (l < 12); (l++)) {
+
+ highp vec4 y = (i.uv.xyxy + ((jitteredDir.xyxy * SmallDiscKernel[l].xyxy) * vec4( 1.0, 1.0, -1.0, -1.0)));
+ highp vec4 yf = y;
+
+ if ((_MainTex_TexelSize.y < 0.0)){
+ yf.yw = (1.0 - yf.yw);
+ }
+
+ highp vec2 vy = xll_tex2Dlod( _VelTex, vec4( yf.xy, 0.0, 0.0)).xy;
+ highp float zy = xll_tex2Dlod( _CameraDepthTexture, vec4( y.xy, 0.0, 0.0)).x;
+ zy = (-Linear01Depth( zy));
+
+ highp float f = softDepthCompare( zx, zy);
+ highp float b = softDepthCompare( zy, zx);
+ highp float alphay = (((b * cone( x, y.xy, vx)) + (f * cone( y.xy, x, vy))) + ((cylinder( y.xy, x, vy) * cylinder( x, y.xy, vx)) * 2.0));
+
+ highp vec4 cy = xll_tex2Dlod( _MainTex, vec4( y.xy, 0.0, 0.0));
+ sum += (cy * alphay);
+ weight += alphay;
+ }
+
+ return (sum / weight);
+}
+in highp vec2 xlv_TEXCOORD0;
+out mediump vec4 _fragData;
+void main() {
+ highp vec4 xl_retval;
+ v2f xlt_i;
+ xlt_i.pos = vec4(0.0);
+ xlt_i.uv = vec2(xlv_TEXCOORD0);
+ xl_retval = ReconstructionDiscBlur(xlt_i);
+ _fragData = vec4(xl_retval);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt
new file mode 100644
index 00000000000..8b29e014c1a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt
@@ -0,0 +1,161 @@
+#version 300 es
+uniform highp vec4 _ZBufferParams;
+uniform sampler2D _MainTex;
+uniform highp sampler2D _CameraDepthTexture;
+uniform sampler2D _VelTex;
+uniform sampler2D _NeighbourMaxTex;
+uniform sampler2D _NoiseTex;
+uniform highp vec4 _MainTex_TexelSize;
+uniform highp float _Jitter;
+uniform highp float _MaxVelocity;
+uniform highp float _SoftZDistance;
+in highp vec2 xlv_TEXCOORD0;
+out mediump vec4 _fragData;
+void main ()
+{
+ highp vec2 tmpvar_1;
+ tmpvar_1 = xlv_TEXCOORD0;
+ highp vec4 jitteredDir_3;
+ highp vec4 sum_4;
+ highp float weight_5;
+ highp float zx_6;
+ highp vec2 vx_7;
+ highp vec2 x_8;
+ highp vec2 xf_9;
+ xf_9 = xlv_TEXCOORD0;
+ x_8 = xlv_TEXCOORD0;
+ if ((_MainTex_TexelSize.y < 0.0)) {
+ xf_9.y = (1.0 - xlv_TEXCOORD0.y);
+ };
+ lowp vec4 tmpvar_10;
+ tmpvar_10 = textureLod (_NeighbourMaxTex, xf_9, 0.0);
+ highp vec2 tmpvar_11;
+ tmpvar_11 = tmpvar_10.xy;
+ lowp vec4 tmpvar_12;
+ tmpvar_12 = textureLod (_MainTex, xlv_TEXCOORD0, 0.0);
+ highp vec4 tmpvar_13;
+ tmpvar_13 = tmpvar_12;
+ lowp vec4 tmpvar_14;
+ tmpvar_14 = textureLod (_VelTex, xf_9, 0.0);
+ highp vec2 tmpvar_15;
+ tmpvar_15 = tmpvar_14.xy;
+ vx_7 = tmpvar_15;
+ highp vec4 tmpvar_16;
+ tmpvar_16.zw = vec2(0.0, 0.0);
+ tmpvar_16.xy = xlv_TEXCOORD0;
+ highp vec4 coord_17;
+ coord_17 = (tmpvar_16 * 11.0);
+ lowp vec4 tmpvar_18;
+ tmpvar_18 = textureLod (_NoiseTex, coord_17.xy, coord_17.w);
+ highp vec4 tmpvar_19;
+ tmpvar_19 = ((tmpvar_18 * 2.0) - 1.0);
+ zx_6 = -((1.0/((
+ (_ZBufferParams.x * textureLod (_CameraDepthTexture, xlv_TEXCOORD0, 0.0).x)
+ + _ZBufferParams.y))));
+ weight_5 = 1.0;
+ sum_4 = tmpvar_13;
+ highp vec4 tmpvar_20;
+ tmpvar_20 = (tmpvar_11.xyxy + (tmpvar_19 * (_MainTex_TexelSize.xyxy * _Jitter)).xyyz);
+ jitteredDir_3 = ((max (
+ abs(tmpvar_20.xyxy)
+ ,
+ ((_MainTex_TexelSize.xyxy * _MaxVelocity) * 0.15)
+ ) * sign(tmpvar_20.xyxy)) * vec4(1.0, 1.0, -1.0, -1.0));
+ for (highp int l_2 = 0; l_2 < 12; l_2++) {
+ highp float zy_21;
+ highp vec4 yf_22;
+ highp vec4 tmpvar_23;
+ tmpvar_23 = (tmpvar_1.xyxy + ((jitteredDir_3.xyxy * vec2[12](vec2(-0.326212, -0.40581), vec2(-0.840144, -0.07358), vec2(-0.695914, 0.457137), vec2(-0.203345, 0.620716), vec2(0.96234, -0.194983), vec2(0.473434, -0.480026), vec2(0.519456, 0.767022), vec2(0.185461, -0.893124), vec2(0.507431, 0.064425), vec2(0.89642, 0.412458), vec2(-0.32194, -0.932615), vec2(-0.791559, -0.59771))[l_2].xyxy) * vec4(1.0, 1.0, -1.0, -1.0)));
+ yf_22 = tmpvar_23;
+ if ((_MainTex_TexelSize.y < 0.0)) {
+ yf_22.yw = (1.0 - tmpvar_23.yw);
+ };
+ lowp vec4 tmpvar_24;
+ tmpvar_24 = textureLod (_VelTex, yf_22.xy, 0.0);
+ highp vec2 tmpvar_25;
+ tmpvar_25 = tmpvar_24.xy;
+ zy_21 = -((1.0/((
+ (_ZBufferParams.x * textureLod (_CameraDepthTexture, tmpvar_23.xy, 0.0).x)
+ + _ZBufferParams.y))));
+ highp vec2 x_26;
+ x_26 = (x_8 - tmpvar_23.xy);
+ highp vec2 x_27;
+ x_27 = (tmpvar_23.xy - x_8);
+ highp float tmpvar_28;
+ tmpvar_28 = sqrt(dot (tmpvar_25, tmpvar_25));
+ highp vec2 x_29;
+ x_29 = (tmpvar_23.xy - x_8);
+ highp float edge0_30;
+ edge0_30 = (0.95 * tmpvar_28);
+ highp float tmpvar_31;
+ tmpvar_31 = clamp (((
+ sqrt(dot (x_29, x_29))
+ - edge0_30) / (
+ (1.05 * tmpvar_28)
+ - edge0_30)), 0.0, 1.0);
+ highp float tmpvar_32;
+ tmpvar_32 = sqrt(dot (vx_7, vx_7));
+ highp vec2 x_33;
+ x_33 = (x_8 - tmpvar_23.xy);
+ highp float edge0_34;
+ edge0_34 = (0.95 * tmpvar_32);
+ highp float tmpvar_35;
+ tmpvar_35 = clamp (((
+ sqrt(dot (x_33, x_33))
+ - edge0_34) / (
+ (1.05 * tmpvar_32)
+ - edge0_34)), 0.0, 1.0);
+ highp float tmpvar_36;
+ tmpvar_36 = (((
+ clamp ((1.0 - ((zy_21 - zx_6) / _SoftZDistance)), 0.0, 1.0)
+ *
+ clamp ((1.0 - (sqrt(
+ dot (x_26, x_26)
+ ) / sqrt(
+ dot (vx_7, vx_7)
+ ))), 0.0, 1.0)
+ ) + (
+ clamp ((1.0 - ((zx_6 - zy_21) / _SoftZDistance)), 0.0, 1.0)
+ *
+ clamp ((1.0 - (sqrt(
+ dot (x_27, x_27)
+ ) / sqrt(
+ dot (tmpvar_25, tmpvar_25)
+ ))), 0.0, 1.0)
+ )) + ((
+ (1.0 - (tmpvar_31 * (tmpvar_31 * (3.0 -
+ (2.0 * tmpvar_31)
+ ))))
+ *
+ (1.0 - (tmpvar_35 * (tmpvar_35 * (3.0 -
+ (2.0 * tmpvar_35)
+ ))))
+ ) * 2.0));
+ lowp vec4 tmpvar_37;
+ tmpvar_37 = textureLod (_MainTex, tmpvar_23.xy, 0.0);
+ highp vec4 tmpvar_38;
+ tmpvar_38 = tmpvar_37;
+ sum_4 = (sum_4 + (tmpvar_38 * tmpvar_36));
+ weight_5 = (weight_5 + tmpvar_36);
+ };
+ highp vec4 tmpvar_39;
+ tmpvar_39 = (sum_4 / weight_5);
+ _fragData = tmpvar_39;
+}
+
+
+// stats: 99 alu 8 tex 4 flow
+// inputs: 1
+// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
+// uniforms: 5 (total size: 0)
+// #0: _ZBufferParams (high float) 4x1 [-1]
+// #1: _MainTex_TexelSize (high float) 4x1 [-1]
+// #2: _Jitter (high float) 1x1 [-1]
+// #3: _MaxVelocity (high float) 1x1 [-1]
+// #4: _SoftZDistance (high float) 1x1 [-1]
+// textures: 5
+// #0: _MainTex (low 2d) 0x0 [-1]
+// #1: _CameraDepthTexture (high 2d) 0x0 [-1]
+// #2: _VelTex (low 2d) 0x0 [-1]
+// #3: _NeighbourMaxTex (low 2d) 0x0 [-1]
+// #4: _NoiseTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt
new file mode 100644
index 00000000000..504f13c2fa0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt
@@ -0,0 +1,171 @@
+#include <metal_stdlib>
+using namespace metal;
+constant float2 _xlat_mtl_const1[12] = {float2(-0.326212, -0.40581), float2(-0.840144, -0.07358), float2(-0.695914, 0.457137), float2(-0.203345, 0.620716), float2(0.96234, -0.194983), float2(0.473434, -0.480026), float2(0.519456, 0.767022), float2(0.185461, -0.893124), float2(0.507431, 0.064425), float2(0.89642, 0.412458), float2(-0.32194, -0.932615), float2(-0.791559, -0.59771)};
+struct xlatMtlShaderInput {
+ float2 xlv_TEXCOORD0;
+};
+struct xlatMtlShaderOutput {
+ half4 _fragData [[color(0)]];
+};
+struct xlatMtlShaderUniform {
+ float4 _ZBufferParams;
+ float4 _MainTex_TexelSize;
+ float _Jitter;
+ float _MaxVelocity;
+ float _SoftZDistance;
+};
+fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
+ , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]
+ , texture2d<float> _CameraDepthTexture [[texture(1)]], sampler _mtlsmp__CameraDepthTexture [[sampler(1)]]
+ , texture2d<half> _VelTex [[texture(2)]], sampler _mtlsmp__VelTex [[sampler(2)]]
+ , texture2d<half> _NeighbourMaxTex [[texture(3)]], sampler _mtlsmp__NeighbourMaxTex [[sampler(3)]]
+ , texture2d<half> _NoiseTex [[texture(4)]], sampler _mtlsmp__NoiseTex [[sampler(4)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ float2 tmpvar_1;
+ tmpvar_1 = _mtl_i.xlv_TEXCOORD0;
+ float4 jitteredDir_3;
+ float4 sum_4;
+ float weight_5;
+ float zx_6;
+ float2 vx_7;
+ float2 x_8;
+ float2 xf_9;
+ xf_9 = _mtl_i.xlv_TEXCOORD0;
+ x_8 = _mtl_i.xlv_TEXCOORD0;
+ if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
+ xf_9.y = (1.0 - _mtl_i.xlv_TEXCOORD0.y);
+ };
+ half4 tmpvar_10;
+ tmpvar_10 = _NeighbourMaxTex.sample(_mtlsmp__NeighbourMaxTex, (float2)(xf_9), level(0.0));
+ float2 tmpvar_11;
+ tmpvar_11 = float2(tmpvar_10.xy);
+ half4 tmpvar_12;
+ tmpvar_12 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0));
+ float4 tmpvar_13;
+ tmpvar_13 = float4(tmpvar_12);
+ half4 tmpvar_14;
+ tmpvar_14 = _VelTex.sample(_mtlsmp__VelTex, (float2)(xf_9), level(0.0));
+ float2 tmpvar_15;
+ tmpvar_15 = float2(tmpvar_14.xy);
+ vx_7 = tmpvar_15;
+ float4 tmpvar_16;
+ tmpvar_16.zw = float2(0.0, 0.0);
+ tmpvar_16.xy = _mtl_i.xlv_TEXCOORD0;
+ float4 coord_17;
+ coord_17 = (tmpvar_16 * 11.0);
+ half4 tmpvar_18;
+ tmpvar_18 = _NoiseTex.sample(_mtlsmp__NoiseTex, (float2)(coord_17.xy), level(coord_17.w));
+ float4 tmpvar_19;
+ tmpvar_19 = float4(((tmpvar_18 * (half)2.0) - (half)1.0));
+ zx_6 = -((1.0/((
+ (_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0)).x)
+ + _mtl_u._ZBufferParams.y))));
+ weight_5 = 1.0;
+ sum_4 = tmpvar_13;
+ float4 tmpvar_20;
+ tmpvar_20 = (tmpvar_11.xyxy + (tmpvar_19 * (_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._Jitter)).xyyz);
+ jitteredDir_3 = ((max (
+ abs(tmpvar_20.xyxy)
+ ,
+ ((_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._MaxVelocity) * 0.15)
+ ) * sign(tmpvar_20.xyxy)) * float4(1.0, 1.0, -1.0, -1.0));
+ for (int l_2 = 0; l_2 < 12; l_2++) {
+ float zy_21;
+ float4 yf_22;
+ float4 tmpvar_23;
+ tmpvar_23 = (tmpvar_1.xyxy + ((jitteredDir_3.xyxy * _xlat_mtl_const1[l_2].xyxy) * float4(1.0, 1.0, -1.0, -1.0)));
+ yf_22 = tmpvar_23;
+ if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
+ yf_22.yw = (1.0 - tmpvar_23.yw);
+ };
+ half4 tmpvar_24;
+ tmpvar_24 = _VelTex.sample(_mtlsmp__VelTex, (float2)(yf_22.xy), level(0.0));
+ float2 tmpvar_25;
+ tmpvar_25 = float2(tmpvar_24.xy);
+ zy_21 = -((1.0/((
+ (_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(tmpvar_23.xy), level(0.0)).x)
+ + _mtl_u._ZBufferParams.y))));
+ float2 x_26;
+ x_26 = (x_8 - tmpvar_23.xy);
+ float2 x_27;
+ x_27 = (tmpvar_23.xy - x_8);
+ float tmpvar_28;
+ tmpvar_28 = sqrt(dot (tmpvar_25, tmpvar_25));
+ float2 x_29;
+ x_29 = (tmpvar_23.xy - x_8);
+ float edge0_30;
+ edge0_30 = (0.95 * tmpvar_28);
+ float tmpvar_31;
+ tmpvar_31 = clamp (((
+ sqrt(dot (x_29, x_29))
+ - edge0_30) / (
+ (1.05 * tmpvar_28)
+ - edge0_30)), 0.0, 1.0);
+ float tmpvar_32;
+ tmpvar_32 = sqrt(dot (vx_7, vx_7));
+ float2 x_33;
+ x_33 = (x_8 - tmpvar_23.xy);
+ float edge0_34;
+ edge0_34 = (0.95 * tmpvar_32);
+ float tmpvar_35;
+ tmpvar_35 = clamp (((
+ sqrt(dot (x_33, x_33))
+ - edge0_34) / (
+ (1.05 * tmpvar_32)
+ - edge0_34)), 0.0, 1.0);
+ float tmpvar_36;
+ tmpvar_36 = (((
+ clamp ((1.0 - ((zy_21 - zx_6) / _mtl_u._SoftZDistance)), 0.0, 1.0)
+ *
+ clamp ((1.0 - (sqrt(
+ dot (x_26, x_26)
+ ) / sqrt(
+ dot (vx_7, vx_7)
+ ))), 0.0, 1.0)
+ ) + (
+ clamp ((1.0 - ((zx_6 - zy_21) / _mtl_u._SoftZDistance)), 0.0, 1.0)
+ *
+ clamp ((1.0 - (sqrt(
+ dot (x_27, x_27)
+ ) / sqrt(
+ dot (tmpvar_25, tmpvar_25)
+ ))), 0.0, 1.0)
+ )) + ((
+ (1.0 - (tmpvar_31 * (tmpvar_31 * (3.0 -
+ (2.0 * tmpvar_31)
+ ))))
+ *
+ (1.0 - (tmpvar_35 * (tmpvar_35 * (3.0 -
+ (2.0 * tmpvar_35)
+ ))))
+ ) * 2.0));
+ half4 tmpvar_37;
+ tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
+ float4 tmpvar_38;
+ tmpvar_38 = float4(tmpvar_37);
+ sum_4 = (sum_4 + (tmpvar_38 * tmpvar_36));
+ weight_5 = (weight_5 + tmpvar_36);
+ };
+ float4 tmpvar_39;
+ tmpvar_39 = (sum_4 / weight_5);
+ _mtl_o._fragData = half4(tmpvar_39);
+ return _mtl_o;
+}
+
+
+// stats: 99 alu 8 tex 4 flow
+// inputs: 1
+// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
+// uniforms: 5 (total size: 44)
+// #0: _ZBufferParams (high float) 4x1 [-1] loc 0
+// #1: _MainTex_TexelSize (high float) 4x1 [-1] loc 16
+// #2: _Jitter (high float) 1x1 [-1] loc 32
+// #3: _MaxVelocity (high float) 1x1 [-1] loc 36
+// #4: _SoftZDistance (high float) 1x1 [-1] loc 40
+// textures: 5
+// #0: _MainTex (low 2d) 0x0 [-1] loc 0
+// #1: _CameraDepthTexture (high 2d) 0x0 [-1] loc 1
+// #2: _VelTex (low 2d) 0x0 [-1] loc 2
+// #3: _NeighbourMaxTex (low 2d) 0x0 [-1] loc 3
+// #4: _NoiseTex (low 2d) 0x0 [-1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt
new file mode 100644
index 00000000000..5cf1a88c22f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt
@@ -0,0 +1,29 @@
+struct v2f {
+ highp vec2 uv;
+ highp vec3 nl;
+};
+uniform sampler2D _MainTex;
+uniform highp vec4 _TerrainTreeLightColors[4];
+lowp vec4 xlat_main (in v2f i) {
+ lowp vec4 col = texture2D( _MainTex, i.uv);
+ mediump vec3 light = vec3(0.0);
+ if(col.x >= 0.0) {
+ for (float j = 0.0; (j < i.uv.x); (j++)) {
+ light += col.xyz;
+ }
+ }
+ if(col.x >= 1.0) {
+ float j = i.uv.y;
+ j *= sin(j);
+ light += col.xyz*j;
+ }
+ return vec4(light, 1.0);
+}
+varying highp vec2 xlv_uv;
+varying highp vec3 xlv_nl;
+void main() {
+ v2f i;
+ i.uv = xlv_uv;
+ i.nl = xlv_nl;
+ gl_FragData[0] = xlat_main(i);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt
new file mode 100644
index 00000000000..774b8fe2d52
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt
@@ -0,0 +1,36 @@
+uniform sampler2D _MainTex;
+varying highp vec2 xlv_uv;
+void main ()
+{
+ lowp vec4 tmpvar_1;
+ highp vec2 tmpvar_2;
+ tmpvar_2 = xlv_uv;
+ mediump vec3 light_3;
+ lowp vec4 col_4;
+ lowp vec4 tmpvar_5;
+ tmpvar_5 = texture2D (_MainTex, xlv_uv);
+ col_4 = tmpvar_5;
+ light_3 = vec3(0.0, 0.0, 0.0);
+ if ((tmpvar_5.x >= 0.0)) {
+ for (highp float j_6 = 0.0; j_6 < tmpvar_2.x; j_6 += 1.0) {
+ light_3 = (light_3 + col_4.xyz);
+ };
+ };
+ if ((tmpvar_5.x >= 1.0)) {
+ highp float j_7;
+ j_7 = (xlv_uv.y * sin(xlv_uv.y));
+ light_3 = (light_3 + (tmpvar_5.xyz * j_7));
+ };
+ mediump vec4 tmpvar_8;
+ tmpvar_8.w = 1.0;
+ tmpvar_8.xyz = light_3;
+ tmpvar_1 = tmpvar_8;
+ gl_FragData[0] = tmpvar_1;
+}
+
+
+// stats: 12 alu 1 tex 4 flow
+// inputs: 1
+// #0: xlv_uv (high float) 2x1 [-1]
+// textures: 1
+// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt
new file mode 100644
index 00000000000..34ab82efd00
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt
@@ -0,0 +1,24 @@
+struct v2f {
+ highp vec2 uv;
+ highp vec3 nl;
+};
+uniform sampler2D _MainTex;
+uniform highp vec4 _TerrainTreeLightColors[4];
+lowp vec4 xlat_main (in v2f i) {
+ lowp vec4 col = texture2D( _MainTex, i.uv);
+ mediump vec3 light = vec3(0.0);
+ if(col.x >= 0.0) {
+ for (float j = 0.0; (j < i.uv.x); (j++)) {
+ light += col.xyz;
+ }
+ }
+ return vec4(light, 1.0);
+}
+varying highp vec2 xlv_uv;
+varying highp vec3 xlv_nl;
+void main() {
+ v2f i;
+ i.uv = xlv_uv;
+ i.nl = xlv_nl;
+ gl_FragData[0] = xlat_main(i);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt
new file mode 100644
index 00000000000..3383ff082fa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt
@@ -0,0 +1,31 @@
+uniform sampler2D _MainTex;
+varying highp vec2 xlv_uv;
+void main ()
+{
+ lowp vec4 tmpvar_1;
+ highp vec2 tmpvar_2;
+ tmpvar_2 = xlv_uv;
+ mediump vec3 light_3;
+ lowp vec4 col_4;
+ lowp vec4 tmpvar_5;
+ tmpvar_5 = texture2D (_MainTex, xlv_uv);
+ col_4 = tmpvar_5;
+ light_3 = vec3(0.0, 0.0, 0.0);
+ if ((tmpvar_5.x >= 0.0)) {
+ for (highp float j_6 = 0.0; j_6 < tmpvar_2.x; j_6 += 1.0) {
+ light_3 = (light_3 + col_4.xyz);
+ };
+ };
+ mediump vec4 tmpvar_7;
+ tmpvar_7.w = 1.0;
+ tmpvar_7.xyz = light_3;
+ tmpvar_1 = tmpvar_7;
+ gl_FragData[0] = tmpvar_1;
+}
+
+
+// stats: 7 alu 1 tex 3 flow
+// inputs: 1
+// #0: xlv_uv (high float) 2x1 [-1]
+// textures: 1
+// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt
new file mode 100644
index 00000000000..196b2f75ec9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt
@@ -0,0 +1,94 @@
+#version 300 es
+
+// Shader below was causing invalid matrix assignment (different types, i.e. half3x3 vs float3x3)
+// in the resulting Metal code. Caused by some combination of matrix transposes and other operations
+// on them.
+
+mat3 xll_transpose_mf3x3(mat3 m) {
+ return mat3( m[0][0], m[1][0], m[2][0],
+ m[0][1], m[1][1], m[2][1],
+ m[0][2], m[1][2], m[2][2]);
+}
+vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; }
+struct SurfaceOutput {
+ lowp vec3 Albedo;
+ lowp vec3 Normal;
+ lowp vec3 Emission;
+ mediump float Specular;
+ lowp float Gloss;
+ lowp float Alpha;
+};
+struct Input {
+ highp vec2 uv_PanelTex;
+ highp vec2 uv2_DecalTex;
+};
+struct v2f_surf {
+ highp vec4 pos;
+ highp vec4 pack0;
+ highp vec4 tSpace0;
+ highp vec4 tSpace1;
+ highp vec4 tSpace2;
+};
+uniform highp vec4 _WorldSpaceLightPos0;
+uniform sampler2D _PanelNorm;
+uniform sampler2D _DecalNorm;
+highp vec3 UnityWorldSpaceLightDir( in highp vec3 worldPos ) {
+ return (_WorldSpaceLightPos0.xyz - (worldPos * _WorldSpaceLightPos0.w));
+}
+void surf( in Input IN, inout SurfaceOutput o ) {
+
+ lowp vec3 baseNormal = ((texture( _DecalNorm, IN.uv2_DecalTex).xyz * 2.0) - 1.0);
+ lowp vec3 detailNormal = ((texture( _PanelNorm, IN.uv_PanelTex).xyz * 2.0) - 1.0);
+ highp mat3 nBasis = xll_transpose_mf3x3(mat3( vec3( baseNormal.z, baseNormal.y, (-baseNormal.x)), vec3( baseNormal.x, baseNormal.z, (-baseNormal.y)), vec3( baseNormal.x, baseNormal.y, baseNormal.z)));
+
+ lowp vec3 combinedNormal = normalize((((detailNormal.x * xll_matrixindex_mf3x3_i (nBasis, 0)) + (detailNormal.y * xll_matrixindex_mf3x3_i (nBasis, 1))) + (detailNormal.z * xll_matrixindex_mf3x3_i (nBasis, 2))));
+ combinedNormal *= 1.0;
+ o.Normal = combinedNormal;
+}
+lowp vec4 frag_surf( in v2f_surf IN ) {
+ Input surfIN;
+
+ surfIN.uv_PanelTex = IN.pack0.xy;
+ surfIN.uv2_DecalTex = IN.pack0.zw;
+ highp vec3 worldPos = vec3( IN.tSpace0.w, IN.tSpace1.w, IN.tSpace2.w);
+
+ lowp vec3 lightDir = normalize(UnityWorldSpaceLightDir( worldPos));
+
+ SurfaceOutput o;
+ o.Albedo = vec3( 0.0);
+ o.Emission = vec3( 0.0);
+
+ o.Specular = 0.0;
+ o.Alpha = 0.0;
+ o.Gloss = 0.0;
+ lowp vec3 normalWorldVertex = vec3( 0.0, 0.0, 1.0);
+
+ surf( surfIN, o);
+ lowp vec3 worldN;
+ worldN.x = dot( IN.tSpace0.xyz, o.Normal);
+ worldN.y = dot( IN.tSpace1.xyz, o.Normal);
+
+ worldN.z = dot( IN.tSpace2.xyz, o.Normal);
+ o.Normal = worldN;
+
+ lowp vec4 res;
+ res.xyz = ((o.Normal * 0.5) + 0.5);
+ res.w = o.Specular;
+ return res;
+}
+in highp vec4 xlv_TEXCOORD0;
+in highp vec4 xlv_TEXCOORD1;
+in highp vec4 xlv_TEXCOORD2;
+in highp vec4 xlv_TEXCOORD3;
+out lowp vec4 _fragData;
+void main() {
+ lowp vec4 xl_retval;
+ v2f_surf xlt_IN;
+ xlt_IN.pos = vec4(0.0);
+ xlt_IN.pack0 = vec4(xlv_TEXCOORD0);
+ xlt_IN.tSpace0 = vec4(xlv_TEXCOORD1);
+ xlt_IN.tSpace1 = vec4(xlv_TEXCOORD2);
+ xlt_IN.tSpace2 = vec4(xlv_TEXCOORD3);
+ xl_retval = frag_surf( xlt_IN);
+ _fragData = vec4(xl_retval);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt
new file mode 100644
index 00000000000..c5fcdb4bb5e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt
@@ -0,0 +1,78 @@
+#version 300 es
+uniform sampler2D _PanelNorm;
+uniform sampler2D _DecalNorm;
+in highp vec4 xlv_TEXCOORD0;
+in highp vec4 xlv_TEXCOORD1;
+in highp vec4 xlv_TEXCOORD2;
+in highp vec4 xlv_TEXCOORD3;
+out lowp vec4 _fragData;
+void main ()
+{
+ lowp vec4 res_1;
+ lowp vec3 worldN_2;
+ lowp vec3 combinedNormal_3;
+ lowp vec3 tmpvar_4;
+ tmpvar_4 = ((texture (_DecalNorm, xlv_TEXCOORD0.zw).xyz * 2.0) - 1.0);
+ lowp vec3 tmpvar_5;
+ tmpvar_5 = ((texture (_PanelNorm, xlv_TEXCOORD0.xy).xyz * 2.0) - 1.0);
+ lowp vec3 tmpvar_6;
+ tmpvar_6.x = tmpvar_4.z;
+ tmpvar_6.y = tmpvar_4.y;
+ tmpvar_6.z = -(tmpvar_4.x);
+ lowp vec3 tmpvar_7;
+ tmpvar_7.x = tmpvar_4.x;
+ tmpvar_7.y = tmpvar_4.z;
+ tmpvar_7.z = -(tmpvar_4.y);
+ highp mat3 tmpvar_8;
+ lowp mat3 tmpvar_9;
+ tmpvar_9[uint(0)].x = tmpvar_6.x;
+ tmpvar_9[uint(0)].y = tmpvar_7.x;
+ tmpvar_9[uint(0)].z = tmpvar_4.x;
+ tmpvar_9[1u].x = tmpvar_6.y;
+ tmpvar_9[1u].y = tmpvar_7.y;
+ tmpvar_9[1u].z = tmpvar_4.y;
+ tmpvar_9[2u].x = tmpvar_6.z;
+ tmpvar_9[2u].y = tmpvar_7.z;
+ tmpvar_9[2u].z = tmpvar_4.z;
+ tmpvar_8 = tmpvar_9;
+ highp vec3 v_10;
+ v_10.x = tmpvar_8[0].x;
+ v_10.y = tmpvar_8[1].x;
+ v_10.z = tmpvar_8[2].x;
+ highp vec3 v_11;
+ v_11.x = tmpvar_8[0].y;
+ v_11.y = tmpvar_8[1].y;
+ v_11.z = tmpvar_8[2].y;
+ highp vec3 v_12;
+ v_12.x = tmpvar_8[0].z;
+ v_12.y = tmpvar_8[1].z;
+ v_12.z = tmpvar_8[2].z;
+ combinedNormal_3 = normalize(((
+ (tmpvar_5.x * v_10)
+ +
+ (tmpvar_5.y * v_11)
+ ) + (tmpvar_5.z * v_12)));
+ highp float tmpvar_13;
+ tmpvar_13 = dot (xlv_TEXCOORD1.xyz, combinedNormal_3);
+ worldN_2.x = tmpvar_13;
+ highp float tmpvar_14;
+ tmpvar_14 = dot (xlv_TEXCOORD2.xyz, combinedNormal_3);
+ worldN_2.y = tmpvar_14;
+ highp float tmpvar_15;
+ tmpvar_15 = dot (xlv_TEXCOORD3.xyz, combinedNormal_3);
+ worldN_2.z = tmpvar_15;
+ res_1.xyz = ((worldN_2 * 0.5) + 0.5);
+ res_1.w = 0.0;
+ _fragData = res_1;
+}
+
+
+// stats: 18 alu 2 tex 0 flow
+// inputs: 4
+// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
+// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
+// #2: xlv_TEXCOORD2 (high float) 4x1 [-1]
+// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
+// textures: 2
+// #0: _PanelNorm (low 2d) 0x0 [-1]
+// #1: _DecalNorm (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt
new file mode 100644
index 00000000000..bb6013bd8b7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt
@@ -0,0 +1,93 @@
+#include <metal_stdlib>
+using namespace metal;
+inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
+inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
+inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }
+inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }
+inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }
+inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }
+struct xlatMtlShaderInput {
+ float4 xlv_TEXCOORD0;
+ float4 xlv_TEXCOORD1;
+ float4 xlv_TEXCOORD2;
+ float4 xlv_TEXCOORD3;
+};
+struct xlatMtlShaderOutput {
+ half4 _fragData [[color(0)]];
+};
+struct xlatMtlShaderUniform {
+};
+fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
+ , texture2d<half> _PanelNorm [[texture(0)]], sampler _mtlsmp__PanelNorm [[sampler(0)]]
+ , texture2d<half> _DecalNorm [[texture(1)]], sampler _mtlsmp__DecalNorm [[sampler(1)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ half4 res_1;
+ half3 worldN_2;
+ half3 combinedNormal_3;
+ half3 tmpvar_4;
+ tmpvar_4 = ((_DecalNorm.sample(_mtlsmp__DecalNorm, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz * (half)2.0) - (half)1.0);
+ half3 tmpvar_5;
+ tmpvar_5 = ((_PanelNorm.sample(_mtlsmp__PanelNorm, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * (half)2.0) - (half)1.0);
+ half3 tmpvar_6;
+ tmpvar_6.x = tmpvar_4.z;
+ tmpvar_6.y = tmpvar_4.y;
+ tmpvar_6.z = -(tmpvar_4.x);
+ half3 tmpvar_7;
+ tmpvar_7.x = tmpvar_4.x;
+ tmpvar_7.y = tmpvar_4.z;
+ tmpvar_7.z = -(tmpvar_4.y);
+ float3x3 tmpvar_8;
+ half3x3 tmpvar_9;
+ tmpvar_9[0].x = tmpvar_6.x;
+ tmpvar_9[0].y = tmpvar_7.x;
+ tmpvar_9[0].z = tmpvar_4.x;
+ tmpvar_9[1].x = tmpvar_6.y;
+ tmpvar_9[1].y = tmpvar_7.y;
+ tmpvar_9[1].z = tmpvar_4.y;
+ tmpvar_9[2].x = tmpvar_6.z;
+ tmpvar_9[2].y = tmpvar_7.z;
+ tmpvar_9[2].z = tmpvar_4.z;
+ tmpvar_8 = _xlcast_float3x3(tmpvar_9);
+ float3 v_10;
+ v_10.x = tmpvar_8[0].x;
+ v_10.y = tmpvar_8[1].x;
+ v_10.z = tmpvar_8[2].x;
+ float3 v_11;
+ v_11.x = tmpvar_8[0].y;
+ v_11.y = tmpvar_8[1].y;
+ v_11.z = tmpvar_8[2].y;
+ float3 v_12;
+ v_12.x = tmpvar_8[0].z;
+ v_12.y = tmpvar_8[1].z;
+ v_12.z = tmpvar_8[2].z;
+ combinedNormal_3 = normalize(((
+ ((half3)((float)tmpvar_5.x * v_10))
+ +
+ ((half3)((float)tmpvar_5.y * v_11))
+ ) + ((half3)((float)tmpvar_5.z * v_12))));
+ float tmpvar_13;
+ tmpvar_13 = dot (_mtl_i.xlv_TEXCOORD1.xyz, (float3)combinedNormal_3);
+ worldN_2.x = half(tmpvar_13);
+ float tmpvar_14;
+ tmpvar_14 = dot (_mtl_i.xlv_TEXCOORD2.xyz, (float3)combinedNormal_3);
+ worldN_2.y = half(tmpvar_14);
+ float tmpvar_15;
+ tmpvar_15 = dot (_mtl_i.xlv_TEXCOORD3.xyz, (float3)combinedNormal_3);
+ worldN_2.z = half(tmpvar_15);
+ res_1.xyz = ((worldN_2 * (half)0.5) + (half)0.5);
+ res_1.w = half(0.0);
+ _mtl_o._fragData = res_1;
+ return _mtl_o;
+}
+
+
+// stats: 18 alu 2 tex 0 flow
+// inputs: 4
+// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
+// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
+// #2: xlv_TEXCOORD2 (high float) 4x1 [-1]
+// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
+// textures: 2
+// #0: _PanelNorm (low 2d) 0x0 [-1] loc 0
+// #1: _DecalNorm (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt
new file mode 100644
index 00000000000..03239e9097f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt
@@ -0,0 +1,30 @@
+#version 300 es
+out mediump vec4 _fragData;
+uniform highp float _Speed;
+uniform highp vec4 _Time;
+highp vec4 func( in highp vec2 uv )
+{
+ highp float s = sin(_Speed * _Time.x);
+ highp float c = cos(_Speed * _Time.x);
+
+ highp mat2 rotationMatrix = mat2(c, s, -s, c);
+ // various operations on a matrix
+ rotationMatrix = rotationMatrix * 2.0;
+ rotationMatrix = rotationMatrix - 1.0;
+ rotationMatrix = s - rotationMatrix;
+ rotationMatrix = c + rotationMatrix;
+ rotationMatrix /= s;
+
+ mediump mat2 halfMatrix = mat2(c, s, -s, c);
+ halfMatrix = halfMatrix * 2.0;
+ halfMatrix = halfMatrix - 1.0;
+ halfMatrix = s - halfMatrix;
+ halfMatrix = c + halfMatrix;
+ halfMatrix /= s;
+
+ return vec4((rotationMatrix * uv), (halfMatrix * uv));
+}
+in highp vec2 uv;
+void main() {
+ _fragData = func(uv);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt
new file mode 100644
index 00000000000..4f2d14e9aca
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt
@@ -0,0 +1,49 @@
+#version 300 es
+out mediump vec4 _fragData;
+uniform highp float _Speed;
+uniform highp vec4 _Time;
+in highp vec2 uv;
+void main ()
+{
+ mediump mat2 halfMatrix_1;
+ highp mat2 rotationMatrix_2;
+ highp float tmpvar_3;
+ highp float tmpvar_4;
+ tmpvar_4 = (_Speed * _Time.x);
+ tmpvar_3 = sin(tmpvar_4);
+ highp float tmpvar_5;
+ tmpvar_5 = cos(tmpvar_4);
+ highp mat2 tmpvar_6;
+ tmpvar_6[uint(0)].x = tmpvar_5;
+ tmpvar_6[uint(0)].y = tmpvar_3;
+ tmpvar_6[1u].x = -(tmpvar_3);
+ tmpvar_6[1u].y = tmpvar_5;
+ rotationMatrix_2 = (tmpvar_6 * 2.0);
+ rotationMatrix_2 = (rotationMatrix_2 - 1.0);
+ rotationMatrix_2 = (tmpvar_3 - rotationMatrix_2);
+ rotationMatrix_2 = (tmpvar_5 + rotationMatrix_2);
+ rotationMatrix_2 = (rotationMatrix_2 / tmpvar_3);
+ highp mat2 tmpvar_7;
+ tmpvar_7[uint(0)].x = tmpvar_5;
+ tmpvar_7[uint(0)].y = tmpvar_3;
+ tmpvar_7[1u].x = -(tmpvar_3);
+ tmpvar_7[1u].y = tmpvar_5;
+ halfMatrix_1 = tmpvar_7;
+ halfMatrix_1 = (halfMatrix_1 * 2.0);
+ halfMatrix_1 = (halfMatrix_1 - 1.0);
+ halfMatrix_1 = (tmpvar_3 - halfMatrix_1);
+ halfMatrix_1 = (tmpvar_5 + halfMatrix_1);
+ halfMatrix_1 = (halfMatrix_1 / tmpvar_3);
+ highp vec4 tmpvar_8;
+ tmpvar_8.xy = (rotationMatrix_2 * uv);
+ tmpvar_8.zw = (halfMatrix_1 * uv);
+ _fragData = tmpvar_8;
+}
+
+
+// stats: 17 alu 0 tex 0 flow
+// inputs: 1
+// #0: uv (high float) 2x1 [-1]
+// uniforms: 2 (total size: 0)
+// #0: _Speed (high float) 1x1 [-1]
+// #1: _Time (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt
new file mode 100644
index 00000000000..458ecd3d401
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt
@@ -0,0 +1,70 @@
+#include <metal_stdlib>
+using namespace metal;
+inline float4x4 _xlinit_float4x4(float v) { return float4x4(float4(v), float4(v), float4(v), float4(v)); }
+inline float3x3 _xlinit_float3x3(float v) { return float3x3(float3(v), float3(v), float3(v)); }
+inline float2x2 _xlinit_float2x2(float v) { return float2x2(float2(v), float2(v)); }
+inline half4x4 _xlinit_half4x4(half v) { return half4x4(half4(v), half4(v), half4(v), half4(v)); }
+inline half3x3 _xlinit_half3x3(half v) { return half3x3(half3(v), half3(v), half3(v)); }
+inline half2x2 _xlinit_half2x2(half v) { return half2x2(half2(v), half2(v)); }
+inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
+inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
+inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }
+inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }
+inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }
+inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }
+struct xlatMtlShaderInput {
+ float2 uv;
+};
+struct xlatMtlShaderOutput {
+ half4 _fragData [[color(0)]];
+};
+struct xlatMtlShaderUniform {
+ float _Speed;
+ float4 _Time;
+};
+fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ half2x2 halfMatrix_1;
+ float2x2 rotationMatrix_2;
+ float tmpvar_3;
+ float tmpvar_4;
+ tmpvar_4 = (_mtl_u._Speed * _mtl_u._Time.x);
+ tmpvar_3 = sin(tmpvar_4);
+ float tmpvar_5;
+ tmpvar_5 = cos(tmpvar_4);
+ float2x2 tmpvar_6;
+ tmpvar_6[0].x = tmpvar_5;
+ tmpvar_6[0].y = tmpvar_3;
+ tmpvar_6[1].x = -(tmpvar_3);
+ tmpvar_6[1].y = tmpvar_5;
+ rotationMatrix_2 = (tmpvar_6 * 2.0);
+ rotationMatrix_2 = (rotationMatrix_2 - _xlinit_float2x2(1.0));
+ rotationMatrix_2 = (_xlinit_float2x2(tmpvar_3) - rotationMatrix_2);
+ rotationMatrix_2 = (_xlinit_float2x2(tmpvar_5) + rotationMatrix_2);
+ rotationMatrix_2 = (rotationMatrix_2 * (1.0/(tmpvar_3)));
+ float2x2 tmpvar_7;
+ tmpvar_7[0].x = tmpvar_5;
+ tmpvar_7[0].y = tmpvar_3;
+ tmpvar_7[1].x = -(tmpvar_3);
+ tmpvar_7[1].y = tmpvar_5;
+ halfMatrix_1 = _xlcast_half2x2(tmpvar_7);
+ halfMatrix_1 = (halfMatrix_1 * (half)2.0);
+ halfMatrix_1 = (halfMatrix_1 - _xlinit_half2x2(1.0));
+ halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_3) - halfMatrix_1)));
+ halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_5) + halfMatrix_1)));
+ halfMatrix_1 = _xlcast_half2x2(((float2x2)(halfMatrix_1 * (1.0h/half(tmpvar_3)))));
+ float4 tmpvar_8;
+ tmpvar_8.xy = (rotationMatrix_2 * _mtl_i.uv);
+ tmpvar_8.zw = ((float2)(halfMatrix_1 * (half2)_mtl_i.uv));
+ _mtl_o._fragData = half4(tmpvar_8);
+ return _mtl_o;
+}
+
+
+// stats: 17 alu 0 tex 0 flow
+// inputs: 1
+// #0: uv (high float) 2x1 [-1]
+// uniforms: 2 (total size: 32)
+// #0: _Speed (high float) 1x1 [-1] loc 0
+// #1: _Time (high float) 4x1 [-1] loc 16
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt
index d137db0959b..5dc2197325b 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt
@@ -1,4 +1,4 @@
-#extension GL_EXT_draw_buffers : require
+#extension GL_EXT_draw_buffers : enable
void main ()
{
gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
index bb9473b03d2..3c7c7d1a82d 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
@@ -12,7 +12,8 @@ void main ()
discard;
};
c_1 = 0.0;
- for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) {
+ for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++) {
+ c_1 = (c_1 + xx);
};
lowp vec4 tmpvar_4;
tmpvar_4 = vec4(c_1);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
index c8a562aa297..bdda6f01f74 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
@@ -5,13 +5,13 @@ uniform mediump float _EmberFadeStart;
varying mediump vec2 xlv_TEXCOORD0;
void main ()
{
- mediump float x_1;
- x_1 = ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd));
- lowp float tmpvar_2;
- tmpvar_2 = clamp (x_1, 0.0, 1.0);
+ lowp float tmpvar_1;
+ mediump float tmpvar_2;
+ tmpvar_2 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0);
+ tmpvar_1 = tmpvar_2;
lowp vec4 tmpvar_3;
tmpvar_3.w = 1.0;
- tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(tmpvar_2));
+ tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(tmpvar_1));
gl_FragColor = tmpvar_3;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt
index 2ba7fa7884c..7301c179fe4 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt
@@ -11,21 +11,17 @@ void main ()
lowp vec4 tmpvar_2;
tmpvar_2 = texture2D (texlow, varUV.xy);
c_1 = tmpvar_2;
- mediump vec4 tmpvar_3;
- tmpvar_3 = texture2D (texmed, varUV.xy);
+ c_1 = (c_1 + texture2D (texmed, varUV.xy));
+ highp vec4 tmpvar_3;
+ tmpvar_3 = texture2D (texhigh, varUV.xy);
c_1 = (c_1 + tmpvar_3);
- highp vec4 tmpvar_4;
- tmpvar_4 = texture2D (texhigh, varUV.xy);
+ lowp vec4 tmpvar_4;
+ tmpvar_4 = textureCube (cubelow, varUV.xyz);
c_1 = (c_1 + tmpvar_4);
- lowp vec4 tmpvar_5;
- tmpvar_5 = textureCube (cubelow, varUV.xyz);
+ c_1 = (c_1 + textureCube (cubemed, varUV.xyz));
+ highp vec4 tmpvar_5;
+ tmpvar_5 = textureCube (cubehigh, varUV.xyz);
c_1 = (c_1 + tmpvar_5);
- mediump vec4 tmpvar_6;
- tmpvar_6 = textureCube (cubemed, varUV.xyz);
- c_1 = (c_1 + tmpvar_6);
- highp vec4 tmpvar_7;
- tmpvar_7 = textureCube (cubehigh, varUV.xyz);
- c_1 = (c_1 + tmpvar_7);
gl_FragData[0] = c_1;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt
index b0fdc185634..af995d19c3d 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt
@@ -13,21 +13,17 @@ void main ()
lowp vec4 tmpvar_2;
tmpvar_2 = texture (texlow, varUV.xy);
c_1 = tmpvar_2;
- mediump vec4 tmpvar_3;
- tmpvar_3 = texture (texmed, varUV.xy);
+ c_1 = (c_1 + texture (texmed, varUV.xy));
+ highp vec4 tmpvar_3;
+ tmpvar_3 = texture (texhigh, varUV.xy);
c_1 = (c_1 + tmpvar_3);
- highp vec4 tmpvar_4;
- tmpvar_4 = texture (texhigh, varUV.xy);
+ lowp vec4 tmpvar_4;
+ tmpvar_4 = texture (cubelow, varUV.xyz);
c_1 = (c_1 + tmpvar_4);
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture (cubelow, varUV.xyz);
+ c_1 = (c_1 + texture (cubemed, varUV.xyz));
+ highp vec4 tmpvar_5;
+ tmpvar_5 = texture (cubehigh, varUV.xyz);
c_1 = (c_1 + tmpvar_5);
- mediump vec4 tmpvar_6;
- tmpvar_6 = texture (cubemed, varUV.xyz);
- c_1 = (c_1 + tmpvar_6);
- highp vec4 tmpvar_7;
- tmpvar_7 = texture (cubehigh, varUV.xyz);
- c_1 = (c_1 + tmpvar_7);
_fragData = c_1;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt
index f59c19a1c6c..7d8a5f943ab 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt
@@ -21,21 +21,17 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
half4 tmpvar_2;
tmpvar_2 = texlow.sample(_mtlsmp_texlow, (float2)(_mtl_i.varUV.xy));
c_1 = tmpvar_2;
- half4 tmpvar_3;
- tmpvar_3 = texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy));
- c_1 = (c_1 + tmpvar_3);
- float4 tmpvar_4;
- tmpvar_4 = float4(texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy)));
- c_1 = half4(((float4)c_1 + tmpvar_4));
- half4 tmpvar_5;
- tmpvar_5 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz));
- c_1 = (c_1 + tmpvar_5);
- half4 tmpvar_6;
- tmpvar_6 = cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz));
- c_1 = (c_1 + tmpvar_6);
- float4 tmpvar_7;
- tmpvar_7 = float4(cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz)));
- c_1 = half4(((float4)c_1 + tmpvar_7));
+ c_1 = (c_1 + texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy)));
+ float4 tmpvar_3;
+ tmpvar_3 = texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy));
+ c_1 = half4(((float4)c_1 + tmpvar_3));
+ half4 tmpvar_4;
+ tmpvar_4 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz));
+ c_1 = (c_1 + tmpvar_4);
+ c_1 = (c_1 + cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz)));
+ float4 tmpvar_5;
+ tmpvar_5 = cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz));
+ c_1 = half4(((float4)c_1 + tmpvar_5));
_mtl_o._fragData = c_1;
return _mtl_o;
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt
new file mode 100644
index 00000000000..3fd866df99d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt
@@ -0,0 +1,20 @@
+#extension GL_EXT_texture_array : require
+
+vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture2DArray (s, coord); }
+vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture2DArray (s, coord.xyz, coord.w); }
+
+uniform sampler2DArray myarr;
+
+vec4 xlat_main( in vec4 uv ) {
+ vec4 s = xll_tex2DArray( myarr, uv.xyz);
+ vec4 sswiz = xll_tex2DArray( myarr, uv.xyw);
+ vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5));
+ return s + sswiz + sbias;
+}
+
+varying vec4 uv;
+void main() {
+ vec4 xl_retval;
+ xl_retval = xlat_main(uv);
+ gl_FragData[0] = vec4(xl_retval);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt
new file mode 100644
index 00000000000..a84428edb42
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt
@@ -0,0 +1,19 @@
+#version 300 es
+out lowp vec4 _fragData;
+
+vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture (s, coord); }
+vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture (s, coord.xyz, coord.w); }
+
+uniform lowp sampler2DArray myarr;
+
+lowp vec4 xlat_main( in highp vec4 uv ) {
+ highp vec4 s = xll_tex2DArray( myarr, uv.xyz);
+ highp vec4 sswiz = xll_tex2DArray( myarr, uv.xyw);
+ highp vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5));
+ highp vec4 slod = textureLod(myarr, uv.xyz, 2.5);
+ return (((s + sswiz) + sbias) + slod);
+}
+in highp vec4 uv;
+void main() {
+ _fragData = xlat_main(uv);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt
new file mode 100644
index 00000000000..ed5629c6d12
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt
@@ -0,0 +1,14 @@
+#extension GL_EXT_texture_array : enable
+uniform sampler2DArray myarr;
+varying vec4 uv;
+void main ()
+{
+ gl_FragData[0] = ((texture2DArray (myarr, uv.xyz) + texture2DArray (myarr, uv.xyw)) + texture2DArray (myarr, uv.xyz, 1.5));
+}
+
+
+// stats: 2 alu 3 tex 0 flow
+// inputs: 1
+// #0: uv (high float) 4x1 [-1]
+// textures: 1
+// #0: myarr (high 2darray) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt
new file mode 100644
index 00000000000..1b564fee2ba
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt
@@ -0,0 +1,33 @@
+#version 300 es
+out lowp vec4 _fragData;
+uniform sampler2DArray myarr;
+in highp vec4 uv;
+void main ()
+{
+ lowp vec4 tmpvar_1;
+ highp vec4 slod_2;
+ lowp vec4 tmpvar_3;
+ tmpvar_3 = texture (myarr, uv.xyz);
+ highp vec4 tmpvar_4;
+ tmpvar_4 = tmpvar_3;
+ lowp vec4 tmpvar_5;
+ tmpvar_5 = texture (myarr, uv.xyw);
+ highp vec4 tmpvar_6;
+ tmpvar_6 = tmpvar_5;
+ lowp vec4 tmpvar_7;
+ tmpvar_7 = texture (myarr, uv.xyz, 1.5);
+ highp vec4 tmpvar_8;
+ tmpvar_8 = tmpvar_7;
+ lowp vec4 tmpvar_9;
+ tmpvar_9 = textureLod (myarr, uv.xyz, 2.5);
+ slod_2 = tmpvar_9;
+ tmpvar_1 = ((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2));
+ _fragData = tmpvar_1;
+}
+
+
+// stats: 3 alu 4 tex 0 flow
+// inputs: 1
+// #0: uv (high float) 4x1 [-1]
+// textures: 1
+// #0: myarr (low 2darray) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt
new file mode 100644
index 00000000000..f74638ff102
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt
@@ -0,0 +1,42 @@
+#include <metal_stdlib>
+using namespace metal;
+struct xlatMtlShaderInput {
+ float4 uv;
+};
+struct xlatMtlShaderOutput {
+ half4 _fragData [[color(0)]];
+};
+struct xlatMtlShaderUniform {
+};
+fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
+ , texture2d_array<half> myarr [[texture(0)]], sampler _mtlsmp_myarr [[sampler(0)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ half4 tmpvar_1;
+ float4 slod_2;
+ half4 tmpvar_3;
+ tmpvar_3 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z));
+ float4 tmpvar_4;
+ tmpvar_4 = float4(tmpvar_3);
+ half4 tmpvar_5;
+ tmpvar_5 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyw).xy), (uint)((_mtl_i.uv.xyw).z));
+ float4 tmpvar_6;
+ tmpvar_6 = float4(tmpvar_5);
+ half4 tmpvar_7;
+ tmpvar_7 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), bias(1.5));
+ float4 tmpvar_8;
+ tmpvar_8 = float4(tmpvar_7);
+ half4 tmpvar_9;
+ tmpvar_9 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), level(2.5));
+ slod_2 = float4(tmpvar_9);
+ tmpvar_1 = half4(((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2)));
+ _mtl_o._fragData = tmpvar_1;
+ return _mtl_o;
+}
+
+
+// stats: 3 alu 4 tex 0 flow
+// inputs: 1
+// #0: uv (high float) 4x1 [-1]
+// textures: 1
+// #0: myarr (low 2darray) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt
index a99982e46a5..68e11513629 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt
@@ -10,4 +10,4 @@ void main ()
// inputs: 1
// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
// textures: 1
-// #0: shadowmap (high 2d) 0x0 [-1]
+// #0: shadowmap (high 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt
index d64af25bfa3..fcbba67c309 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt
@@ -13,4 +13,4 @@ void main ()
// inputs: 1
// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
// textures: 1
-// #0: shadowmap (low 2d) 0x0 [-1]
+// #0: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt
index 6523b890fd6..64af66456a0 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt
@@ -20,4 +20,4 @@ void main ()
// #0: uvHi (high float) 4x1 [-1]
// #1: uvMed (medium float) 4x1 [-1]
// textures: 1
-// #0: shadowmap (low 2d) 0x0 [-1]
+// #0: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
index 6c7de8b1500..2d85a7fc869 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
@@ -30,4 +30,4 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
// #0: uvHi (high float) 4x1 [-1]
// #1: uvMed (medium float) 4x1 [-1]
// textures: 1
-// #0: shadowmap (low 2d) 0x0 [-1] loc 0
+// #0: shadowmap (low 2dshadow) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
index 2e61bbdab8d..33f2890ec37 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
@@ -38,4 +38,4 @@ void main ()
// #0: uv (high float) 4x1 [-1]
// textures: 2
// #0: tex (low 2d) 0x0 [-1]
-// #1: shadowmap (low 2d) 0x0 [-1]
+// #1: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt
index 5f4cfe4cd1b..cbcfaba03ea 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt
@@ -20,4 +20,4 @@ void main ()
// #0: uv (high float) 4x1 [-1]
// textures: 2
// #0: tex (low 2d) 0x0 [-1]
-// #1: shadowmap (low 2d) 0x0 [-1]
+// #1: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt
index 287e243e6fc..961349b0a26 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt
@@ -30,4 +30,4 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
// #0: uv (high float) 4x1 [-1]
// textures: 2
// #0: tex (low 2d) 0x0 [-1] loc 0
-// #1: shadowmap (low 2d) 0x0 [-1] loc 1
+// #1: shadowmap (low 2dshadow) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
index 898fcd4d743..376ff3ebd06 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
@@ -53,116 +53,116 @@ void main ()
highp float range_37;
highp float lumaN_38;
highp float lumaS_39;
- highp vec4 rgbyM_40;
- highp vec2 posM_41;
- posM_41 = xlv_TEXCOORD0;
+ highp vec2 posM_40;
+ posM_40 = xlv_TEXCOORD0;
+ highp vec4 tmpvar_41;
lowp vec4 tmpvar_42;
tmpvar_42 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
- rgbyM_40 = tmpvar_42;
+ tmpvar_41 = tmpvar_42;
highp vec4 tmpvar_43;
tmpvar_43.zw = vec2(0.0, 0.0);
tmpvar_43.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_44;
- tmpvar_44 = impl_low_texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0);
- highp vec4 rgba_45;
- rgba_45 = tmpvar_44;
- lumaS_39 = rgba_45.w;
+ highp vec4 tmpvar_44;
+ lowp vec4 tmpvar_45;
+ tmpvar_45 = impl_low_texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0);
+ tmpvar_44 = tmpvar_45;
+ lumaS_39 = tmpvar_44.w;
highp vec4 tmpvar_46;
tmpvar_46.zw = vec2(0.0, 0.0);
tmpvar_46.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_47;
- tmpvar_47 = impl_low_texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0);
- highp float tmpvar_48;
- highp vec4 rgba_49;
- rgba_49 = tmpvar_47;
- tmpvar_48 = rgba_49.w;
+ highp vec4 tmpvar_47;
+ lowp vec4 tmpvar_48;
+ tmpvar_48 = impl_low_texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0);
+ tmpvar_47 = tmpvar_48;
+ highp float tmpvar_49;
+ tmpvar_49 = tmpvar_47.w;
highp vec4 tmpvar_50;
tmpvar_50.zw = vec2(0.0, 0.0);
tmpvar_50.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_51;
- tmpvar_51 = impl_low_texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0);
- highp vec4 rgba_52;
- rgba_52 = tmpvar_51;
- lumaN_38 = rgba_52.w;
+ highp vec4 tmpvar_51;
+ lowp vec4 tmpvar_52;
+ tmpvar_52 = impl_low_texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0);
+ tmpvar_51 = tmpvar_52;
+ lumaN_38 = tmpvar_51.w;
highp vec4 tmpvar_53;
tmpvar_53.zw = vec2(0.0, 0.0);
tmpvar_53.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_54;
- tmpvar_54 = impl_low_texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0);
- highp float tmpvar_55;
- highp vec4 rgba_56;
- rgba_56 = tmpvar_54;
- tmpvar_55 = rgba_56.w;
+ highp vec4 tmpvar_54;
+ lowp vec4 tmpvar_55;
+ tmpvar_55 = impl_low_texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0);
+ tmpvar_54 = tmpvar_55;
+ highp float tmpvar_56;
+ tmpvar_56 = tmpvar_54.w;
highp float tmpvar_57;
- tmpvar_57 = max (max (rgba_52.w, rgba_56.w), max (max (rgba_49.w, rgba_45.w), rgbyM_40.w));
- range_37 = (tmpvar_57 - min (min (rgba_52.w, rgba_56.w), min (
- min (rgba_49.w, rgba_45.w)
- , rgbyM_40.w)));
+ tmpvar_57 = max (max (tmpvar_51.w, tmpvar_54.w), max (max (tmpvar_47.w, tmpvar_44.w), tmpvar_41.w));
+ range_37 = (tmpvar_57 - min (min (tmpvar_51.w, tmpvar_54.w), min (
+ min (tmpvar_47.w, tmpvar_44.w)
+ , tmpvar_41.w)));
if ((range_37 < max (0.0833, (tmpvar_57 * 0.166)))) {
- tmpvar_2 = rgbyM_40;
+ tmpvar_2 = tmpvar_41;
} else {
highp vec4 tmpvar_58;
tmpvar_58.zw = vec2(0.0, 0.0);
tmpvar_58.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- lowp vec4 tmpvar_59;
- tmpvar_59 = impl_low_texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0);
- highp vec4 rgba_60;
- rgba_60 = tmpvar_59;
+ highp vec4 tmpvar_59;
+ lowp vec4 tmpvar_60;
+ tmpvar_60 = impl_low_texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0);
+ tmpvar_59 = tmpvar_60;
highp vec4 tmpvar_61;
tmpvar_61.zw = vec2(0.0, 0.0);
tmpvar_61.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- lowp vec4 tmpvar_62;
- tmpvar_62 = impl_low_texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0);
- highp vec4 rgba_63;
- rgba_63 = tmpvar_62;
+ highp vec4 tmpvar_62;
+ lowp vec4 tmpvar_63;
+ tmpvar_63 = impl_low_texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0);
+ tmpvar_62 = tmpvar_63;
highp vec4 tmpvar_64;
tmpvar_64.zw = vec2(0.0, 0.0);
tmpvar_64.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_65;
- tmpvar_65 = impl_low_texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0);
- highp vec4 rgba_66;
- rgba_66 = tmpvar_65;
+ highp vec4 tmpvar_65;
+ lowp vec4 tmpvar_66;
+ tmpvar_66 = impl_low_texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0);
+ tmpvar_65 = tmpvar_66;
highp vec4 tmpvar_67;
tmpvar_67.zw = vec2(0.0, 0.0);
tmpvar_67.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_68;
- tmpvar_68 = impl_low_texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0);
- highp vec4 rgba_69;
- rgba_69 = tmpvar_68;
- lumaNS_36 = (rgba_52.w + rgba_45.w);
- lumaWE_35 = (rgba_56.w + rgba_49.w);
+ highp vec4 tmpvar_68;
+ lowp vec4 tmpvar_69;
+ tmpvar_69 = impl_low_texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0);
+ tmpvar_68 = tmpvar_69;
+ lumaNS_36 = (tmpvar_51.w + tmpvar_44.w);
+ lumaWE_35 = (tmpvar_54.w + tmpvar_47.w);
subpixRcpRange_34 = (1.0/(range_37));
- lumaNESE_33 = (rgba_66.w + rgba_63.w);
- lumaNWSW_32 = (rgba_60.w + rgba_69.w);
+ lumaNESE_33 = (tmpvar_65.w + tmpvar_62.w);
+ lumaNWSW_32 = (tmpvar_59.w + tmpvar_68.w);
lengthSign_31 = fxaaQualityRcpFrame_1.x;
horzSpan_30 = ((abs(
- ((-2.0 * rgba_56.w) + lumaNWSW_32)
+ ((-2.0 * tmpvar_54.w) + lumaNWSW_32)
) + (
- (abs(((-2.0 * rgbyM_40.w) + lumaNS_36)) * 2.0)
+ (abs(((-2.0 * tmpvar_41.w) + lumaNS_36)) * 2.0)
+
- abs(((-2.0 * rgba_49.w) + lumaNESE_33))
+ abs(((-2.0 * tmpvar_47.w) + lumaNESE_33))
)) >= (abs(
- ((-2.0 * rgba_45.w) + (rgba_69.w + rgba_63.w))
+ ((-2.0 * tmpvar_44.w) + (tmpvar_68.w + tmpvar_62.w))
) + (
- (abs(((-2.0 * rgbyM_40.w) + lumaWE_35)) * 2.0)
+ (abs(((-2.0 * tmpvar_41.w) + lumaWE_35)) * 2.0)
+
- abs(((-2.0 * rgba_52.w) + (rgba_60.w + rgba_66.w)))
+ abs(((-2.0 * tmpvar_51.w) + (tmpvar_59.w + tmpvar_65.w)))
)));
subpixA_29 = (((lumaNS_36 + lumaWE_35) * 2.0) + (lumaNWSW_32 + lumaNESE_33));
if (!(horzSpan_30)) {
- lumaN_38 = tmpvar_55;
+ lumaN_38 = tmpvar_56;
};
if (!(horzSpan_30)) {
- lumaS_39 = tmpvar_48;
+ lumaS_39 = tmpvar_49;
};
if (horzSpan_30) {
lengthSign_31 = fxaaQualityRcpFrame_1.y;
};
- subpixB_28 = ((subpixA_29 * 0.0833333) - rgbyM_40.w);
- gradientN_27 = (lumaN_38 - rgbyM_40.w);
- gradientS_26 = (lumaS_39 - rgbyM_40.w);
- lumaNN_25 = (lumaN_38 + rgbyM_40.w);
- lumaSS_24 = (lumaS_39 + rgbyM_40.w);
+ subpixB_28 = ((subpixA_29 * 0.0833333) - tmpvar_41.w);
+ gradientN_27 = (lumaN_38 - tmpvar_41.w);
+ gradientS_26 = (lumaS_39 - tmpvar_41.w);
+ lumaNN_25 = (lumaN_38 + tmpvar_41.w);
+ lumaSS_24 = (lumaS_39 + tmpvar_41.w);
pairN_23 = (abs(gradientN_27) >= abs(gradientS_26));
highp float tmpvar_70;
tmpvar_70 = max (abs(gradientN_27), abs(gradientS_26));
@@ -195,25 +195,25 @@ void main ()
posP_20.x = (posB_22.x + tmpvar_72);
posP_20.y = (posB_22.y + tmpvar_73);
subpixD_19 = ((-2.0 * tmpvar_71) + 3.0);
- lowp vec4 tmpvar_74;
- tmpvar_74 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_75;
- rgba_75 = tmpvar_74;
- lumaEndN_18 = rgba_75.w;
+ highp vec4 tmpvar_74;
+ lowp vec4 tmpvar_75;
+ tmpvar_75 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_74 = tmpvar_75;
+ lumaEndN_18 = tmpvar_74.w;
subpixE_17 = (tmpvar_71 * tmpvar_71);
- lowp vec4 tmpvar_76;
- tmpvar_76 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_77;
- rgba_77 = tmpvar_76;
- lumaEndP_16 = rgba_77.w;
+ highp vec4 tmpvar_76;
+ lowp vec4 tmpvar_77;
+ tmpvar_77 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_76 = tmpvar_77;
+ lumaEndP_16 = tmpvar_76.w;
if (!(pairN_23)) {
lumaNN_25 = lumaSS_24;
};
gradientScaled_15 = (tmpvar_70 / 4.0);
subpixF_14 = (subpixD_19 * subpixE_17);
- lumaMLTZero_13 = ((rgbyM_40.w - (lumaNN_25 * 0.5)) < 0.0);
- lumaEndN_18 = (rgba_75.w - (lumaNN_25 * 0.5));
- lumaEndP_16 = (rgba_77.w - (lumaNN_25 * 0.5));
+ lumaMLTZero_13 = ((tmpvar_41.w - (lumaNN_25 * 0.5)) < 0.0);
+ lumaEndN_18 = (tmpvar_74.w - (lumaNN_25 * 0.5));
+ lumaEndP_16 = (tmpvar_76.w - (lumaNN_25 * 0.5));
doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
if (!(doneN_12)) {
@@ -231,18 +231,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_78;
- tmpvar_78 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_79;
- rgba_79 = tmpvar_78;
- lumaEndN_18 = rgba_79.w;
+ highp vec4 tmpvar_78;
+ lowp vec4 tmpvar_79;
+ tmpvar_79 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_78 = tmpvar_79;
+ lumaEndN_18 = tmpvar_78.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_80;
- tmpvar_80 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_81;
- rgba_81 = tmpvar_80;
- lumaEndP_16 = rgba_81.w;
+ highp vec4 tmpvar_80;
+ lowp vec4 tmpvar_81;
+ tmpvar_81 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_80 = tmpvar_81;
+ lumaEndP_16 = tmpvar_80.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -267,18 +267,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_82;
- tmpvar_82 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_83;
- rgba_83 = tmpvar_82;
- lumaEndN_18 = rgba_83.w;
+ highp vec4 tmpvar_82;
+ lowp vec4 tmpvar_83;
+ tmpvar_83 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_82 = tmpvar_83;
+ lumaEndN_18 = tmpvar_82.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_84;
- tmpvar_84 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_85;
- rgba_85 = tmpvar_84;
- lumaEndP_16 = rgba_85.w;
+ highp vec4 tmpvar_84;
+ lowp vec4 tmpvar_85;
+ tmpvar_85 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_84 = tmpvar_85;
+ lumaEndP_16 = tmpvar_84.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -303,18 +303,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_86;
- tmpvar_86 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_87;
- rgba_87 = tmpvar_86;
- lumaEndN_18 = rgba_87.w;
+ highp vec4 tmpvar_86;
+ lowp vec4 tmpvar_87;
+ tmpvar_87 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_86 = tmpvar_87;
+ lumaEndN_18 = tmpvar_86.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_88;
- tmpvar_88 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_89;
- rgba_89 = tmpvar_88;
- lumaEndP_16 = rgba_89.w;
+ highp vec4 tmpvar_88;
+ lowp vec4 tmpvar_89;
+ tmpvar_89 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_88 = tmpvar_89;
+ lumaEndP_16 = tmpvar_88.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -339,18 +339,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_90;
- tmpvar_90 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_91;
- rgba_91 = tmpvar_90;
- lumaEndN_18 = rgba_91.w;
+ highp vec4 tmpvar_90;
+ lowp vec4 tmpvar_91;
+ tmpvar_91 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_90 = tmpvar_91;
+ lumaEndN_18 = tmpvar_90.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_92;
- tmpvar_92 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_93;
- rgba_93 = tmpvar_92;
- lumaEndP_16 = rgba_93.w;
+ highp vec4 tmpvar_92;
+ lowp vec4 tmpvar_93;
+ tmpvar_93 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_92 = tmpvar_93;
+ lumaEndP_16 = tmpvar_92.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -375,18 +375,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_94;
- tmpvar_94 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_95;
- rgba_95 = tmpvar_94;
- lumaEndN_18 = rgba_95.w;
+ highp vec4 tmpvar_94;
+ lowp vec4 tmpvar_95;
+ tmpvar_95 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_94 = tmpvar_95;
+ lumaEndN_18 = tmpvar_94.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_96;
- tmpvar_96 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_97;
- rgba_97 = tmpvar_96;
- lumaEndP_16 = rgba_97.w;
+ highp vec4 tmpvar_96;
+ lowp vec4 tmpvar_97;
+ tmpvar_97 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_96 = tmpvar_97;
+ lumaEndP_16 = tmpvar_96.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -411,18 +411,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_98;
- tmpvar_98 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_99;
- rgba_99 = tmpvar_98;
- lumaEndN_18 = rgba_99.w;
+ highp vec4 tmpvar_98;
+ lowp vec4 tmpvar_99;
+ tmpvar_99 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_98 = tmpvar_99;
+ lumaEndN_18 = tmpvar_98.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_100;
- tmpvar_100 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_101;
- rgba_101 = tmpvar_100;
- lumaEndP_16 = rgba_101.w;
+ highp vec4 tmpvar_100;
+ lowp vec4 tmpvar_101;
+ tmpvar_101 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_100 = tmpvar_101;
+ lumaEndP_16 = tmpvar_100.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -447,18 +447,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_102;
- tmpvar_102 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_103;
- rgba_103 = tmpvar_102;
- lumaEndN_18 = rgba_103.w;
+ highp vec4 tmpvar_102;
+ lowp vec4 tmpvar_103;
+ tmpvar_103 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_102 = tmpvar_103;
+ lumaEndN_18 = tmpvar_102.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_104;
- tmpvar_104 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_105;
- rgba_105 = tmpvar_104;
- lumaEndP_16 = rgba_105.w;
+ highp vec4 tmpvar_104;
+ lowp vec4 tmpvar_105;
+ tmpvar_105 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_104 = tmpvar_105;
+ lumaEndP_16 = tmpvar_104.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -483,18 +483,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_106;
- tmpvar_106 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_107;
- rgba_107 = tmpvar_106;
- lumaEndN_18 = rgba_107.w;
+ highp vec4 tmpvar_106;
+ lowp vec4 tmpvar_107;
+ tmpvar_107 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_106 = tmpvar_107;
+ lumaEndN_18 = tmpvar_106.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_108;
- tmpvar_108 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_109;
- rgba_109 = tmpvar_108;
- lumaEndP_16 = rgba_109.w;
+ highp vec4 tmpvar_108;
+ lowp vec4 tmpvar_109;
+ tmpvar_109 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_108 = tmpvar_109;
+ lumaEndP_16 = tmpvar_108.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -519,18 +519,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_110;
- tmpvar_110 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_111;
- rgba_111 = tmpvar_110;
- lumaEndN_18 = rgba_111.w;
+ highp vec4 tmpvar_110;
+ lowp vec4 tmpvar_111;
+ tmpvar_111 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_110 = tmpvar_111;
+ lumaEndN_18 = tmpvar_110.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_112;
- tmpvar_112 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_113;
- rgba_113 = tmpvar_112;
- lumaEndP_16 = rgba_113.w;
+ highp vec4 tmpvar_112;
+ lowp vec4 tmpvar_113;
+ tmpvar_113 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_112 = tmpvar_113;
+ lumaEndP_16 = tmpvar_112.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -555,18 +555,18 @@ void main ()
};
if (doneNP_10) {
if (!(doneN_12)) {
- lowp vec4 tmpvar_114;
- tmpvar_114 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- highp vec4 rgba_115;
- rgba_115 = tmpvar_114;
- lumaEndN_18 = rgba_115.w;
+ highp vec4 tmpvar_114;
+ lowp vec4 tmpvar_115;
+ tmpvar_115 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
+ tmpvar_114 = tmpvar_115;
+ lumaEndN_18 = tmpvar_114.w;
};
if (!(doneP_11)) {
- lowp vec4 tmpvar_116;
- tmpvar_116 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- highp vec4 rgba_117;
- rgba_117 = tmpvar_116;
- lumaEndP_16 = rgba_117.w;
+ highp vec4 tmpvar_116;
+ lowp vec4 tmpvar_117;
+ tmpvar_117 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
+ tmpvar_116 = tmpvar_117;
+ lumaEndP_16 = tmpvar_116.w;
};
if (!(doneN_12)) {
lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
@@ -629,16 +629,16 @@ void main ()
highp float tmpvar_121;
tmpvar_121 = max (tmpvar_120, subpixH_3);
if (!(horzSpan_30)) {
- posM_41.x = (xlv_TEXCOORD0.x + (tmpvar_121 * lengthSign_31));
+ posM_40.x = (xlv_TEXCOORD0.x + (tmpvar_121 * lengthSign_31));
};
if (horzSpan_30) {
- posM_41.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31));
+ posM_40.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31));
};
lowp vec4 tmpvar_122;
- tmpvar_122 = impl_low_texture2DLodEXT (_MainTex, posM_41, 0.0);
+ tmpvar_122 = impl_low_texture2DLodEXT (_MainTex, posM_40, 0.0);
highp vec4 tmpvar_123;
tmpvar_123.xyz = tmpvar_122.xyz;
- tmpvar_123.w = rgbyM_40.w;
+ tmpvar_123.w = tmpvar_41.w;
tmpvar_2 = tmpvar_123;
};
gl_FragData[0] = tmpvar_2;
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
index 34fdad70dfe..8ba9f361fe6 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
@@ -51,16 +51,14 @@ void main ()
};
randomDir_14 = (randomDir_14 * -(tmpvar_18));
randomDir_14 = (randomDir_14 + (viewNorm_7 * 0.3));
- highp vec4 tmpvar_19;
- tmpvar_19 = texture (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_5)));
- highp float tmpvar_20;
- tmpvar_20 = clamp (((depth_6 -
+ highp float tmpvar_19;
+ tmpvar_19 = clamp (((depth_6 -
(randomDir_14.z * _Params.x)
) - (
- dot (tmpvar_19.zw, vec2(1.0, 0.00392157))
+ dot (texture (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_5))).zw, vec2(1.0, 0.00392157))
* _ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_20 > _Params.y)) {
- occ_4 = (occ_4 + pow ((1.0 - tmpvar_20), _Params.z));
+ if ((tmpvar_19 > _Params.y)) {
+ occ_4 = (occ_4 + pow ((1.0 - tmpvar_19), _Params.z));
};
};
occ_4 = (occ_4 / 8.0);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
index d31961e7107..de7007b9112 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
@@ -29,7 +29,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
tmpvar_9 = ((_RandomTexture.sample(_mtlsmp__RandomTexture, (float2)(_mtl_i.xlv_TEXCOORD1)).xyz * (half)2.0) - (half)1.0);
randN_8 = tmpvar_9;
float4 tmpvar_10;
- tmpvar_10 = float4(_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)(_mtl_i.xlv_TEXCOORD0)));
+ tmpvar_10 = _CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)(_mtl_i.xlv_TEXCOORD0));
float3 n_11;
float3 tmpvar_12;
tmpvar_12 = ((tmpvar_10.xyz * float3(3.5554, 3.5554, 0.0)) + float3(-1.7777, -1.7777, 1.0));
@@ -60,16 +60,14 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]]
};
randomDir_14 = (randomDir_14 * -(tmpvar_18));
randomDir_14 = half3(((float3)randomDir_14 + (viewNorm_7 * 0.3)));
- float4 tmpvar_19;
- tmpvar_19 = float4(_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)randomDir_14.xy * scale_5)))));
- float tmpvar_20;
- tmpvar_20 = clamp (((depth_6 -
+ float tmpvar_19;
+ tmpvar_19 = clamp (((depth_6 -
((float)randomDir_14.z * _mtl_u._Params.x)
) - (
- dot (tmpvar_19.zw, float2(1.0, 0.00392157))
+ dot (_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)randomDir_14.xy * scale_5)))).zw, float2(1.0, 0.00392157))
* _mtl_u._ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_20 > _mtl_u._Params.y)) {
- occ_4 = (occ_4 + pow ((1.0 - tmpvar_20), _mtl_u._Params.z));
+ if ((tmpvar_19 > _mtl_u._Params.y)) {
+ occ_4 = (occ_4 + pow ((1.0 - tmpvar_19), _mtl_u._Params.z));
};
};
occ_4 = (occ_4 / 8.0);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
index fe23cd4dc43..ddca5d1f288 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
@@ -19,23 +19,23 @@
#include <windows.h>
#include <gl/GL.h>
extern "C" {
-typedef char GLcharARB; /* native character */
-typedef unsigned int GLhandleARB; /* shader object handle */
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-typedef void (WINAPI * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (WINAPI * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (WINAPI * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (WINAPI * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef void (WINAPI * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (WINAPI * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-static PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
-static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
-static PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
-static PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
-static PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
-static PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
+typedef char GLchar; /* native character */
+typedef unsigned int GLuint; /* shader object handle */
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_COMPILE_STATUS 0x8B81
+typedef void (WINAPI * PFNGLDELETESHADERPROC) (GLuint shader);
+typedef GLuint (WINAPI * PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (WINAPI * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+typedef void (WINAPI * PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef void (WINAPI * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (WINAPI * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+static PFNGLDELETESHADERPROC glDeleteShader;
+static PFNGLCREATESHADERPROC glCreateShader;
+static PFNGLSHADERSOURCEPROC glShaderSource;
+static PFNGLCOMPILESHADERPROC glCompileShader;
+static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
+static PFNGLGETSHADERIVPROC glGetShaderiv;
}
#endif // #ifdef _MSC_VER
@@ -154,12 +154,12 @@ static bool InitializeOpenGL ()
#ifdef _MSC_VER
if (hasGLSL)
{
- glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)wglGetProcAddress("glDeleteObjectARB");
- glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)wglGetProcAddress("glCreateShaderObjectARB");
- glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)wglGetProcAddress("glShaderSourceARB");
- glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)wglGetProcAddress("glCompileShaderARB");
- glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)wglGetProcAddress("glGetInfoLogARB");
- glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)wglGetProcAddress("glGetObjectParameterivARB");
+ glDeleteShader = (PFNGLDELETESHADERPROC)wglGetProcAddress("glDeleteShader");
+ glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader");
+ glShaderSource = (PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource");
+ glCompileShader = (PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader");
+ glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)wglGetProcAddress("glGetShaderInfoLog");
+ glGetShaderiv = (PFNGLGETSHADERIVPROC)wglGetProcAddress("glGetShaderiv");
}
#endif
@@ -266,6 +266,8 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons
if (gles)
{
replace_string (src, "GL_EXT_shader_texture_lod", "GL_ARB_shader_texture_lod", 0);
+ replace_string (src, "GL_EXT_draw_instanced", "GL_ARB_draw_instanced", 0);
+ replace_string (src, "gl_InstanceIDEXT", "gl_InstanceIDARB ", 0);
replace_string (src, "#extension GL_OES_standard_derivatives : require", "", 0);
replace_string (src, "#extension GL_EXT_shadow_samplers : require", "", 0);
replace_string (src, "#extension GL_EXT_frag_depth : require", "", 0);
@@ -458,6 +460,8 @@ static const char* kGlslTypeNames[kGlslTypeCount] = {
"2d",
"3d",
"cube",
+ "2dshadow",
+ "2darray",
"other",
};
static const char* kGlslPrecNames[kGlslPrecCount] = {
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt
new file mode 100644
index 00000000000..b5d7a308376
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt
@@ -0,0 +1,16 @@
+#extension GL_ARB_draw_instanced : require
+#extension GL_EXT_gpu_shader4 : require
+
+attribute vec3 _inPos;
+attribute vec3 _inNor;
+
+void main()
+{
+ vec3 p;
+ p = _inPos;
+ p.y += float(gl_VertexID);
+ p.y += float(gl_InstanceIDARB);
+ p += _inNor;
+ gl_Position = vec4(p,1.0);
+ gl_PointSize = p.x;
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt
new file mode 100644
index 00000000000..dbf6c16502f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt
@@ -0,0 +1,14 @@
+#extension GL_EXT_draw_instanced : require
+
+attribute highp vec3 _inPos;
+attribute highp vec3 _inNor;
+
+void main()
+{
+ highp vec3 p;
+ p = _inPos;
+ p.y += float(gl_InstanceIDEXT);
+ p += _inNor;
+ gl_Position = vec4(p,1.0);
+ gl_PointSize = p.x;
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt
new file mode 100644
index 00000000000..9b18e44eab2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt
@@ -0,0 +1,23 @@
+#extension GL_ARB_draw_instanced : enable
+#extension GL_EXT_gpu_shader4 : enable
+attribute vec3 _inPos;
+attribute vec3 _inNor;
+void main ()
+{
+ vec3 p_1;
+ p_1.xz = _inPos.xz;
+ p_1.y = (_inPos.y + float(gl_VertexID));
+ p_1.y = (p_1.y + float(gl_InstanceIDARB));
+ p_1 = (p_1 + _inNor);
+ vec4 tmpvar_2;
+ tmpvar_2.w = 1.0;
+ tmpvar_2.xyz = p_1;
+ gl_Position = tmpvar_2;
+ gl_PointSize = p_1.x;
+}
+
+
+// stats: 6 alu 0 tex 0 flow
+// inputs: 2
+// #0: _inPos (high float) 3x1 [-1]
+// #1: _inNor (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt
new file mode 100644
index 00000000000..f82939e25d1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt
@@ -0,0 +1,21 @@
+#extension GL_EXT_draw_instanced : enable
+attribute highp vec3 _inPos;
+attribute highp vec3 _inNor;
+void main ()
+{
+ highp vec3 p_1;
+ p_1.xz = _inPos.xz;
+ p_1.y = (_inPos.y + float(gl_InstanceIDEXT));
+ p_1 = (p_1 + _inNor);
+ highp vec4 tmpvar_2;
+ tmpvar_2.w = 1.0;
+ tmpvar_2.xyz = p_1;
+ gl_Position = tmpvar_2;
+ gl_PointSize = p_1.x;
+}
+
+
+// stats: 4 alu 0 tex 0 flow
+// inputs: 2
+// #0: _inPos (high float) 3x1 [-1]
+// #1: _inNor (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt
index d851b3948b6..2f8889de926 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt
@@ -40,14 +40,14 @@ vec4 Temp_0;
vec4 Temp_1;
vec4 Temp_2;
vec4 Temp_3;
-int tmpvar_1;
+ivec4 Temp_int_0;
void main ()
{
Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]);
Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0);
Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0);
- vec4 tmpvar_2;
- tmpvar_2 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
+ vec4 tmpvar_1;
+ tmpvar_1 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy;
Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz;
@@ -60,58 +60,30 @@ void main ()
Temp_0.w = inversesqrt(Temp_0.w);
Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz;
Temp_2.xyz = glstate_lightmodel_ambient.xyz;
- tmpvar_1 = 0;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + glstate_lightmodel_ambient.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
+ Temp_int_0.w = 0;
+ while (true) {
+ if ((Temp_int_0.w >= 4)) {
+ break;
+ };
+ Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[Temp_int_0.w].wwww) + unity_LightPosition[Temp_int_0.w].xyzx).xyz;
+ Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
+ Temp_2.w = ((Temp_1.w * unity_LightAtten[Temp_int_0.w].z) + 1.0);
+ Temp_2.w = (1.0/(Temp_2.w));
+ Temp_1.w = inversesqrt(Temp_1.w);
+ Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
+ Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
+ Temp_1.w = max (Temp_1.w, 0.0);
+ Temp_1.w = (Temp_1.w * Temp_2.w);
+ Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
+ Temp_int_0.w = (Temp_int_0.w + 1);
+ };
VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz;
VtxGeoOutput2_COLOR0.w = 1.0;
- gl_Position = tmpvar_2;
+ gl_Position = tmpvar_1;
}
-// stats: 87 alu 0 tex 0 flow
+// stats: 43 alu 0 tex 2 flow
// inputs: 3
// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1]
// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
index e62f0f22107..dce767a5403 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
@@ -40,14 +40,14 @@ vec4 Temp_0;
vec4 Temp_1;
vec4 Temp_2;
vec4 Temp_3;
-highp int tmpvar_1;
+highp ivec4 Temp_int_0;
void main ()
{
Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]);
Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0);
Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0);
- highp vec4 tmpvar_2;
- tmpvar_2 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
+ highp vec4 tmpvar_1;
+ tmpvar_1 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy;
Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz;
@@ -60,58 +60,30 @@ void main ()
Temp_0.w = inversesqrt(Temp_0.w);
Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz;
Temp_2.xyz = glstate_lightmodel_ambient.xyz;
- tmpvar_1 = 0;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + glstate_lightmodel_ambient.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- tmpvar_1++;
+ Temp_int_0.w = 0;
+ while (true) {
+ if ((Temp_int_0.w >= 4)) {
+ break;
+ };
+ Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[Temp_int_0.w].wwww) + unity_LightPosition[Temp_int_0.w].xyzx).xyz;
+ Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
+ Temp_2.w = ((Temp_1.w * unity_LightAtten[Temp_int_0.w].z) + 1.0);
+ Temp_2.w = (1.0/(Temp_2.w));
+ Temp_1.w = inversesqrt(Temp_1.w);
+ Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
+ Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
+ Temp_1.w = max (Temp_1.w, 0.0);
+ Temp_1.w = (Temp_1.w * Temp_2.w);
+ Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
+ Temp_int_0.w = (Temp_int_0.w + 1);
+ };
VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz;
VtxGeoOutput2_COLOR0.w = 1.0;
- gl_Position = tmpvar_2;
+ gl_Position = tmpvar_1;
}
-// stats: 87 alu 0 tex 0 flow
+// stats: 43 alu 0 tex 2 flow
// inputs: 3
// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1]
// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt
index 748e6b5e632..8976a6750d2 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt
@@ -52,7 +52,7 @@ float4 Temp_0_2;
float4 Temp_1_3;
float4 Temp_2_4;
float4 Temp_3_5;
-int tmpvar_6;
+int4 Temp_int_0_6;
Temp_0_2 = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]);
Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2);
Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2);
@@ -69,51 +69,23 @@ int tmpvar_6;
Temp_0_2.w = rsqrt(Temp_0_2.w);
Temp_1_3.xyz = (Temp_0_2.wwww * Temp_1_3.xyzx).xyz;
Temp_2_4.xyz = _mtl_u.glstate_lightmodel_ambient.xyz;
- tmpvar_6 = 0;
- Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz;
- Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
- Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0);
- Temp_2_4.w = (1.0/(Temp_2_4.w));
- Temp_1_3.w = rsqrt(Temp_1_3.w);
- Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
- Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
- Temp_1_3.w = max (Temp_1_3.w, 0.0);
- Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
- Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + _mtl_u.glstate_lightmodel_ambient.xyzx).xyz;
- tmpvar_6++;
- Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz;
- Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
- Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0);
- Temp_2_4.w = (1.0/(Temp_2_4.w));
- Temp_1_3.w = rsqrt(Temp_1_3.w);
- Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
- Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
- Temp_1_3.w = max (Temp_1_3.w, 0.0);
- Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
- Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz;
- tmpvar_6++;
- Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz;
- Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
- Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0);
- Temp_2_4.w = (1.0/(Temp_2_4.w));
- Temp_1_3.w = rsqrt(Temp_1_3.w);
- Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
- Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
- Temp_1_3.w = max (Temp_1_3.w, 0.0);
- Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
- Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz;
- tmpvar_6++;
- Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz;
- Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
- Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0);
- Temp_2_4.w = (1.0/(Temp_2_4.w));
- Temp_1_3.w = rsqrt(Temp_1_3.w);
- Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
- Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
- Temp_1_3.w = max (Temp_1_3.w, 0.0);
- Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
- Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz;
- tmpvar_6++;
+ Temp_int_0_6.w = 0;
+ while (true) {
+ if ((Temp_int_0_6.w >= 4)) {
+ break;
+ };
+ Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[Temp_int_0_6.w].wwww) + _mtl_u.unity_LightPosition[Temp_int_0_6.w].xyzx).xyz;
+ Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
+ Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[Temp_int_0_6.w].z) + 1.0);
+ Temp_2_4.w = (1.0/(Temp_2_4.w));
+ Temp_1_3.w = rsqrt(Temp_1_3.w);
+ Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
+ Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
+ Temp_1_3.w = max (Temp_1_3.w, 0.0);
+ Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
+ Temp_2_4.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_6.w].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz;
+ Temp_int_0_6.w = (Temp_int_0_6.w + 1);
+ };
_mtl_o.VtxGeoOutput2_COLOR0.xyz = (Temp_2_4.xyzx + Temp_2_4.xyzx).xyz;
_mtl_o.VtxGeoOutput2_COLOR0.w = 1.0;
_mtl_o.gl_Position = phase0_Output0_1;
@@ -121,7 +93,7 @@ int tmpvar_6;
}
-// stats: 87 alu 0 tex 0 flow
+// stats: 43 alu 0 tex 2 flow
// inputs: 3
// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1] loc 0
// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
index b1fca1d8e9b..d3a42f5a079 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
@@ -40,7 +40,10 @@ void main ()
Temp_int_1.xyz = floatBitsToInt((intBitsToFloat(Temp_int_0).www * intBitsToFloat(Temp_int_1).xyz));
Temp_2.xyz = glstate_lightmodel_ambient.xyz;
Temp_int_0.w = 0;
- for (; Temp_int_0.w < 4; Temp_int_0.w = (Temp_int_0.w + 1)) {
+ while (true) {
+ if ((Temp_int_0.w >= 4)) {
+ break;
+ };
Temp_3.xyz = ((-(
intBitsToFloat(Temp_int_0)
.xyz) * unity_LightPosition[Temp_int_0.w].www) + unity_LightPosition[Temp_int_0.w].xyz);
@@ -61,6 +64,7 @@ void main ()
Temp_2.w = max (Temp_2.w, 0.0);
Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w));
Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyz * intBitsToFloat(Temp_int_1).www) + Temp_2.xyz);
+ Temp_int_0.w = (Temp_int_0.w + 1);
};
COLOR0.xyz = (Temp_2.xyz * _Color.xyz);
COLOR0.w = (_Color.w * _ReflectColor.w);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
index ede21264b0c..a6e6c9b72a8 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
@@ -49,7 +49,10 @@ int4 Temp_int_1_5;
Temp_int_1_5.xyz = as_type<int3>((as_type<float4>(Temp_int_0_4).www * as_type<float4>(Temp_int_1_5).xyz));
Temp_2_2.xyz = _mtl_u.glstate_lightmodel_ambient.xyz;
Temp_int_0_4.w = 0;
- for (; Temp_int_0_4.w < 4; Temp_int_0_4.w = (Temp_int_0_4.w + 1)) {
+ while (true) {
+ if ((Temp_int_0_4.w >= 4)) {
+ break;
+ };
Temp_3_3.xyz = ((-(
as_type<float4>(Temp_int_0_4)
.xyz) * _mtl_u.unity_LightPosition[Temp_int_0_4.w].www) + _mtl_u.unity_LightPosition[Temp_int_0_4.w].xyz);
@@ -70,6 +73,7 @@ int4 Temp_int_1_5;
Temp_2_2.w = max (Temp_2_2.w, 0.0);
Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w));
Temp_2_2.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_4.w].xyz * as_type<float4>(Temp_int_1_5).www) + Temp_2_2.xyz);
+ Temp_int_0_4.w = (Temp_int_0_4.w + 1);
};
_mtl_o.COLOR0.xyz = (Temp_2_2.xyz * _mtl_u._Color.xyz);
_mtl_o.COLOR0.w = (_mtl_u._Color.w * _mtl_u._ReflectColor.w);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt
new file mode 100644
index 00000000000..c13e7e1c9f3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt
@@ -0,0 +1,63 @@
+#line 1
+attribute vec4 _glesVertex;
+attribute vec3 _glesNormal;
+struct v2f {
+ lowp vec4 color;
+ highp vec4 pos;
+};
+struct appdata {
+ highp vec3 pos;
+ highp vec3 normal;
+};
+uniform mediump vec4 unity_LightColor[8];
+uniform highp vec4 unity_LightPosition[8];
+uniform highp ivec4 unity_VertexLightParams;
+mediump vec3 computeLighting(in highp int idx, in mediump vec3 dirToLight, in mediump vec3 eyeNormal, in mediump float atten)
+{
+ mediump float NdotL = max( dot( eyeNormal, dirToLight), 0.0);
+ mediump vec3 color = NdotL * unity_LightColor[idx].xyz;
+ return color * atten;
+}
+mediump vec3 computeOneLight( in highp int idx, in mediump vec3 eyeNormal)
+{
+ highp vec3 dirToLight = unity_LightPosition[idx].xyz;
+ mediump float att = 1.0;
+
+ att *= 0.5;
+ return min( computeLighting( idx, dirToLight, eyeNormal, att), vec3(1.0));
+}
+v2f vert( in appdata IN )
+{
+ v2f o;
+ mediump vec4 color = vec4(0.0, 0.0, 0.0, 1.1);
+
+ mediump vec3 eyeNormal = IN.normal;
+
+ mediump vec3 lcolor = vec3(0.0);
+
+ // loop doing up to N lights, with max cap
+ highp int il = 0;
+ for ( ; (float(il) < min( 8.0, float(unity_VertexLightParams.x))); (++il))
+ {
+ lcolor += computeOneLight(il, eyeNormal);
+ }
+ color.xyz = lcolor.xyz;
+
+ // other forms of a similar loop
+ for (int j = 0; j < int(min(float(unity_VertexLightParams.y),4.0)); ++j)
+ color.xyz += unity_LightColor[j].xyz;
+
+ o.color = color;
+ o.pos = vec4(IN.pos,1.0);
+ return o;
+}
+varying lowp vec4 xlv_COLOR0;
+void main() {
+ v2f xl_retval;
+ appdata xlt_IN;
+ xlt_IN.pos = _glesVertex.xyz;
+ xlt_IN.normal = _glesNormal;
+ xl_retval = vert(xlt_IN);
+ xlv_COLOR0 = vec4(xl_retval.color);
+ gl_Position = vec4(xl_retval.pos);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt
new file mode 100644
index 00000000000..e2f957ddb19
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt
@@ -0,0 +1,66 @@
+#version 300 es
+#line 2
+in vec4 _glesVertex;
+in vec3 _glesNormal;
+struct v2f {
+ lowp vec4 color;
+ highp vec4 pos;
+};
+struct appdata {
+ highp vec3 pos;
+ highp vec3 normal;
+};
+uniform mediump vec4 unity_LightColor[8];
+uniform highp vec4 unity_LightPosition[8];
+uniform highp ivec4 unity_VertexLightParams;
+mediump vec3 computeLighting(in highp int idx, in mediump vec3 dirToLight, in mediump vec3 eyeNormal, in mediump float atten)
+{
+ mediump float NdotL = max( dot( eyeNormal, dirToLight), 0.0);
+ mediump vec3 color = NdotL * unity_LightColor[idx].xyz;
+ return color * atten;
+}
+mediump vec3 computeOneLight( in highp int idx, in mediump vec3 eyeNormal)
+{
+ highp vec3 dirToLight = unity_LightPosition[idx].xyz;
+ mediump float att = 1.0;
+
+ att *= 0.5;
+ return min( computeLighting( idx, dirToLight, eyeNormal, att), vec3(1.0));
+}
+v2f vert( in appdata IN )
+{
+ v2f o;
+ mediump vec4 color = vec4(0.0, 0.0, 0.0, 1.1);
+
+ mediump vec3 eyeNormal = IN.normal;
+
+ mediump vec3 lcolor = vec3(0.0);
+
+ // loop doing up to N lights, with max cap
+ highp int il = 0;
+ for ( ; (float(il) < min( 8.0, float(unity_VertexLightParams.x))); (++il))
+ {
+ lcolor += computeOneLight(il, eyeNormal);
+ }
+ color.xyz = lcolor.xyz;
+
+ // other forms of a similar loop
+ for (int j = 0; j < int(min(float(unity_VertexLightParams.y),4.0)); ++j)
+ color.xyz += unity_LightColor[j].xyz;
+ for (int j = 0; j < min(unity_VertexLightParams.y,4); ++j)
+ color.xyz *= unity_LightColor[j].xyz;
+
+ o.color = color;
+ o.pos = vec4(IN.pos,1.0);
+ return o;
+}
+out lowp vec4 xlv_COLOR0;
+void main() {
+ v2f xl_retval;
+ appdata xlt_IN;
+ xlt_IN.pos = _glesVertex.xyz;
+ xlt_IN.normal = _glesNormal;
+ xl_retval = vert(xlt_IN);
+ xlv_COLOR0 = vec4(xl_retval.color);
+ gl_Position = vec4(xl_retval.pos);
+}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt
new file mode 100644
index 00000000000..0a91784e1a8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt
@@ -0,0 +1,65 @@
+attribute vec4 _glesVertex;
+attribute vec3 _glesNormal;
+uniform mediump vec4 unity_LightColor[8];
+uniform highp vec4 unity_LightPosition[8];
+uniform highp ivec4 unity_VertexLightParams;
+varying lowp vec4 xlv_COLOR0;
+void main ()
+{
+ highp vec3 tmpvar_1;
+ highp vec3 tmpvar_2;
+ tmpvar_1 = _glesVertex.xyz;
+ tmpvar_2 = _glesNormal;
+ highp int j_3;
+ highp int il_4;
+ mediump vec3 lcolor_5;
+ mediump vec3 eyeNormal_6;
+ mediump vec4 color_7;
+ lowp vec4 tmpvar_8;
+ color_7 = vec4(0.0, 0.0, 0.0, 1.1);
+ eyeNormal_6 = tmpvar_2;
+ lcolor_5 = vec3(0.0, 0.0, 0.0);
+ il_4 = 0;
+ while (true) {
+ highp float tmpvar_9;
+ tmpvar_9 = min (8.0, float(unity_VertexLightParams.x));
+ if ((float(il_4) >= tmpvar_9)) {
+ break;
+ };
+ highp vec3 tmpvar_10;
+ tmpvar_10 = unity_LightPosition[il_4].xyz;
+ mediump vec3 dirToLight_11;
+ dirToLight_11 = tmpvar_10;
+ lcolor_5 = (lcolor_5 + min ((
+ (max (dot (eyeNormal_6, dirToLight_11), 0.0) * unity_LightColor[il_4].xyz)
+ * 0.5), vec3(1.0, 1.0, 1.0)));
+ il_4++;
+ };
+ color_7.xyz = lcolor_5;
+ j_3 = 0;
+ while (true) {
+ highp float tmpvar_12;
+ tmpvar_12 = min (float(unity_VertexLightParams.y), 4.0);
+ if ((j_3 >= int(tmpvar_12))) {
+ break;
+ };
+ color_7.xyz = (color_7.xyz + unity_LightColor[j_3].xyz);
+ j_3++;
+ };
+ tmpvar_8 = color_7;
+ highp vec4 tmpvar_13;
+ tmpvar_13.w = 1.0;
+ tmpvar_13.xyz = tmpvar_1;
+ xlv_COLOR0 = tmpvar_8;
+ gl_Position = tmpvar_13;
+}
+
+
+// stats: 22 alu 0 tex 4 flow
+// inputs: 2
+// #0: _glesVertex (high float) 4x1 [-1]
+// #1: _glesNormal (high float) 3x1 [-1]
+// uniforms: 3 (total size: 0)
+// #0: unity_LightColor (medium float) 4x1 [8]
+// #1: unity_LightPosition (high float) 4x1 [8]
+// #2: unity_VertexLightParams (high int) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt
new file mode 100644
index 00000000000..83f6ba5d505
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt
@@ -0,0 +1,77 @@
+#version 300 es
+in vec4 _glesVertex;
+in vec3 _glesNormal;
+uniform mediump vec4 unity_LightColor[8];
+uniform highp vec4 unity_LightPosition[8];
+uniform highp ivec4 unity_VertexLightParams;
+out lowp vec4 xlv_COLOR0;
+void main ()
+{
+ highp vec3 tmpvar_1;
+ highp vec3 tmpvar_2;
+ tmpvar_1 = _glesVertex.xyz;
+ tmpvar_2 = _glesNormal;
+ highp int j_3;
+ highp int j_4;
+ highp int il_5;
+ mediump vec3 lcolor_6;
+ mediump vec3 eyeNormal_7;
+ mediump vec4 color_8;
+ lowp vec4 tmpvar_9;
+ color_8 = vec4(0.0, 0.0, 0.0, 1.1);
+ eyeNormal_7 = tmpvar_2;
+ lcolor_6 = vec3(0.0, 0.0, 0.0);
+ il_5 = 0;
+ while (true) {
+ highp float tmpvar_10;
+ tmpvar_10 = min (8.0, float(unity_VertexLightParams.x));
+ if ((float(il_5) >= tmpvar_10)) {
+ break;
+ };
+ highp vec3 tmpvar_11;
+ tmpvar_11 = unity_LightPosition[il_5].xyz;
+ mediump vec3 dirToLight_12;
+ dirToLight_12 = tmpvar_11;
+ lcolor_6 = (lcolor_6 + min ((
+ (max (dot (eyeNormal_7, dirToLight_12), 0.0) * unity_LightColor[il_5].xyz)
+ * 0.5), vec3(1.0, 1.0, 1.0)));
+ il_5++;
+ };
+ color_8.xyz = lcolor_6;
+ j_4 = 0;
+ while (true) {
+ highp float tmpvar_13;
+ tmpvar_13 = min (float(unity_VertexLightParams.y), 4.0);
+ if ((j_4 >= int(tmpvar_13))) {
+ break;
+ };
+ color_8.xyz = (color_8.xyz + unity_LightColor[j_4].xyz);
+ j_4++;
+ };
+ j_3 = 0;
+ while (true) {
+ highp int tmpvar_14;
+ tmpvar_14 = min (unity_VertexLightParams.y, 4);
+ if ((j_3 >= tmpvar_14)) {
+ break;
+ };
+ color_8.xyz = (color_8.xyz * unity_LightColor[j_3].xyz);
+ j_3++;
+ };
+ tmpvar_9 = color_8;
+ highp vec4 tmpvar_15;
+ tmpvar_15.w = 1.0;
+ tmpvar_15.xyz = tmpvar_1;
+ xlv_COLOR0 = tmpvar_9;
+ gl_Position = tmpvar_15;
+}
+
+
+// stats: 27 alu 0 tex 6 flow
+// inputs: 2
+// #0: _glesVertex (high float) 4x1 [-1]
+// #1: _glesNormal (high float) 3x1 [-1]
+// uniforms: 3 (total size: 0)
+// #0: unity_LightColor (medium float) 4x1 [8]
+// #1: unity_LightPosition (high float) 4x1 [8]
+// #2: unity_VertexLightParams (high int) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt
new file mode 100644
index 00000000000..4fff005a315
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt
@@ -0,0 +1,85 @@
+#include <metal_stdlib>
+using namespace metal;
+struct xlatMtlShaderInput {
+ float4 _glesVertex [[attribute(0)]];
+ float3 _glesNormal [[attribute(1)]];
+};
+struct xlatMtlShaderOutput {
+ float4 gl_Position [[position]];
+ half4 xlv_COLOR0;
+};
+struct xlatMtlShaderUniform {
+ half4 unity_LightColor[8];
+ float4 unity_LightPosition[8];
+ int4 unity_VertexLightParams;
+};
+vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
+{
+ xlatMtlShaderOutput _mtl_o;
+ float3 tmpvar_1;
+ tmpvar_1 = _mtl_i._glesVertex.xyz;
+ int j_2;
+ int j_3;
+ int il_4;
+ half3 lcolor_5;
+ half3 eyeNormal_6;
+ half4 color_7;
+ half4 tmpvar_8;
+ color_7 = half4(float4(0.0, 0.0, 0.0, 1.1));
+ eyeNormal_6 = half3(_mtl_i._glesNormal);
+ lcolor_5 = half3(float3(0.0, 0.0, 0.0));
+ il_4 = 0;
+ while (true) {
+ float tmpvar_9;
+ tmpvar_9 = min (8.0, float(_mtl_u.unity_VertexLightParams.x));
+ if ((float(il_4) >= tmpvar_9)) {
+ break;
+ };
+ float3 tmpvar_10;
+ tmpvar_10 = _mtl_u.unity_LightPosition[il_4].xyz;
+ half3 dirToLight_11;
+ dirToLight_11 = half3(tmpvar_10);
+ lcolor_5 = (lcolor_5 + min ((
+ (max (dot (eyeNormal_6, dirToLight_11), (half)0.0) * _mtl_u.unity_LightColor[il_4].xyz)
+ * (half)0.5), (half3)float3(1.0, 1.0, 1.0)));
+ il_4++;
+ };
+ color_7.xyz = lcolor_5;
+ j_3 = 0;
+ while (true) {
+ float tmpvar_12;
+ tmpvar_12 = min (float(_mtl_u.unity_VertexLightParams.y), 4.0);
+ if ((j_3 >= int(tmpvar_12))) {
+ break;
+ };
+ color_7.xyz = (color_7.xyz + _mtl_u.unity_LightColor[j_3].xyz);
+ j_3++;
+ };
+ j_2 = 0;
+ while (true) {
+ int tmpvar_13;
+ tmpvar_13 = min (_mtl_u.unity_VertexLightParams.y, 4);
+ if ((j_2 >= tmpvar_13)) {
+ break;
+ };
+ color_7.xyz = (color_7.xyz * _mtl_u.unity_LightColor[j_2].xyz);
+ j_2++;
+ };
+ tmpvar_8 = color_7;
+ float4 tmpvar_14;
+ tmpvar_14.w = 1.0;
+ tmpvar_14.xyz = tmpvar_1;
+ _mtl_o.xlv_COLOR0 = tmpvar_8;
+ _mtl_o.gl_Position = tmpvar_14;
+ return _mtl_o;
+}
+
+
+// stats: 27 alu 0 tex 6 flow
+// inputs: 2
+// #0: _glesVertex (high float) 4x1 [-1] loc 0
+// #1: _glesNormal (high float) 3x1 [-1] loc 1
+// uniforms: 3 (total size: 208)
+// #0: unity_LightColor (medium float) 4x1 [8] loc 0
+// #1: unity_LightPosition (high float) 4x1 [8] loc 64
+// #2: unity_VertexLightParams (high int) 4x1 [-1] loc 192
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
index 692c217222e..b6e32666a2b 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
@@ -17,134 +17,134 @@ void main ()
highp vec2 tmpvar_6;
tmpvar_6.y = 1.0;
tmpvar_6.x = float(tmpvar_5.x);
- mediump vec4 tmpvar_7;
- mediump vec2 coord_8;
- coord_8 = tmpvar_6;
+ mediump vec2 coord_7;
+ coord_7 = tmpvar_6;
+ mediump vec4 tmpvar_8;
+ tmpvar_8.zw = vec2(0.0, 0.0);
+ tmpvar_8.xy = (coord_7 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_10;
- tmpvar_10 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0);
- tmpvar_7 = tmpvar_10;
+ tmpvar_10 = texture2DLod (_DynLampInfo, tmpvar_8.xy, 0.0);
+ tmpvar_9 = tmpvar_10;
highp vec2 tmpvar_11;
tmpvar_11.y = 2.0;
tmpvar_11.x = float(tmpvar_5.x);
- mediump vec4 tmpvar_12;
- mediump vec2 coord_13;
- coord_13 = tmpvar_11;
+ mediump vec2 coord_12;
+ coord_12 = tmpvar_11;
+ mediump vec4 tmpvar_13;
+ tmpvar_13.zw = vec2(0.0, 0.0);
+ tmpvar_13.xy = (coord_12 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_14;
- tmpvar_14.zw = vec2(0.0, 0.0);
- tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_15;
- tmpvar_15 = texture2DLod (_DynLampInfo, tmpvar_14.xy, 0.0);
- tmpvar_12 = tmpvar_15;
+ tmpvar_15 = texture2DLod (_DynLampInfo, tmpvar_13.xy, 0.0);
+ tmpvar_14 = tmpvar_15;
highp vec2 tmpvar_16;
tmpvar_16.y = 1.0;
tmpvar_16.x = float(tmpvar_5.y);
- mediump vec4 tmpvar_17;
- mediump vec2 coord_18;
- coord_18 = tmpvar_16;
+ mediump vec2 coord_17;
+ coord_17 = tmpvar_16;
+ mediump vec4 tmpvar_18;
+ tmpvar_18.zw = vec2(0.0, 0.0);
+ tmpvar_18.xy = (coord_17 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_19;
- tmpvar_19.zw = vec2(0.0, 0.0);
- tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_20;
- tmpvar_20 = texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0);
- tmpvar_17 = tmpvar_20;
+ tmpvar_20 = texture2DLod (_DynLampInfo, tmpvar_18.xy, 0.0);
+ tmpvar_19 = tmpvar_20;
highp vec2 tmpvar_21;
tmpvar_21.y = 2.0;
tmpvar_21.x = float(tmpvar_5.y);
- mediump vec4 tmpvar_22;
- mediump vec2 coord_23;
- coord_23 = tmpvar_21;
+ mediump vec2 coord_22;
+ coord_22 = tmpvar_21;
+ mediump vec4 tmpvar_23;
+ tmpvar_23.zw = vec2(0.0, 0.0);
+ tmpvar_23.xy = (coord_22 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_24;
- tmpvar_24.zw = vec2(0.0, 0.0);
- tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_25;
- tmpvar_25 = texture2DLod (_DynLampInfo, tmpvar_24.xy, 0.0);
- tmpvar_22 = tmpvar_25;
+ tmpvar_25 = texture2DLod (_DynLampInfo, tmpvar_23.xy, 0.0);
+ tmpvar_24 = tmpvar_25;
highp vec2 tmpvar_26;
tmpvar_26.y = 1.0;
tmpvar_26.x = float(tmpvar_5.z);
- mediump vec4 tmpvar_27;
- mediump vec2 coord_28;
- coord_28 = tmpvar_26;
+ mediump vec2 coord_27;
+ coord_27 = tmpvar_26;
+ mediump vec4 tmpvar_28;
+ tmpvar_28.zw = vec2(0.0, 0.0);
+ tmpvar_28.xy = (coord_27 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_29;
- tmpvar_29.zw = vec2(0.0, 0.0);
- tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_30;
- tmpvar_30 = texture2DLod (_DynLampInfo, tmpvar_29.xy, 0.0);
- tmpvar_27 = tmpvar_30;
+ tmpvar_30 = texture2DLod (_DynLampInfo, tmpvar_28.xy, 0.0);
+ tmpvar_29 = tmpvar_30;
highp vec2 tmpvar_31;
tmpvar_31.y = 2.0;
tmpvar_31.x = float(tmpvar_5.z);
- mediump vec4 tmpvar_32;
- mediump vec2 coord_33;
- coord_33 = tmpvar_31;
+ mediump vec2 coord_32;
+ coord_32 = tmpvar_31;
+ mediump vec4 tmpvar_33;
+ tmpvar_33.zw = vec2(0.0, 0.0);
+ tmpvar_33.xy = (coord_32 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_34;
- tmpvar_34.zw = vec2(0.0, 0.0);
- tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_35;
- tmpvar_35 = texture2DLod (_DynLampInfo, tmpvar_34.xy, 0.0);
- tmpvar_32 = tmpvar_35;
+ tmpvar_35 = texture2DLod (_DynLampInfo, tmpvar_33.xy, 0.0);
+ tmpvar_34 = tmpvar_35;
highp vec2 tmpvar_36;
tmpvar_36.y = 1.0;
tmpvar_36.x = float(tmpvar_5.w);
- mediump vec4 tmpvar_37;
- mediump vec2 coord_38;
- coord_38 = tmpvar_36;
+ mediump vec2 coord_37;
+ coord_37 = tmpvar_36;
+ mediump vec4 tmpvar_38;
+ tmpvar_38.zw = vec2(0.0, 0.0);
+ tmpvar_38.xy = (coord_37 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_39;
- tmpvar_39.zw = vec2(0.0, 0.0);
- tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_40;
- tmpvar_40 = texture2DLod (_DynLampInfo, tmpvar_39.xy, 0.0);
- tmpvar_37 = tmpvar_40;
+ tmpvar_40 = texture2DLod (_DynLampInfo, tmpvar_38.xy, 0.0);
+ tmpvar_39 = tmpvar_40;
highp vec2 tmpvar_41;
tmpvar_41.y = 2.0;
tmpvar_41.x = float(tmpvar_5.w);
- mediump vec4 tmpvar_42;
- mediump vec2 coord_43;
- coord_43 = tmpvar_41;
+ mediump vec2 coord_42;
+ coord_42 = tmpvar_41;
+ mediump vec4 tmpvar_43;
+ tmpvar_43.zw = vec2(0.0, 0.0);
+ tmpvar_43.xy = (coord_42 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_44;
- tmpvar_44.zw = vec2(0.0, 0.0);
- tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_45;
- tmpvar_45 = texture2DLod (_DynLampInfo, tmpvar_44.xy, 0.0);
- tmpvar_42 = tmpvar_45;
+ tmpvar_45 = texture2DLod (_DynLampInfo, tmpvar_43.xy, 0.0);
+ tmpvar_44 = tmpvar_45;
mediump vec3 hybridCol_46;
mediump vec4 atten_47;
highp vec3 tmpvar_48;
- tmpvar_48 = (tmpvar_7.xyz - tmpvar_2);
+ tmpvar_48 = (tmpvar_9.xyz - tmpvar_2);
highp float tmpvar_49;
tmpvar_49 = dot (tmpvar_48, tmpvar_48);
mediump vec4 tmpvar_50;
tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = (tmpvar_49 * tmpvar_7.w);
+ tmpvar_50.x = (tmpvar_49 * tmpvar_9.w);
highp vec3 tmpvar_51;
- tmpvar_51 = (tmpvar_17.xyz - tmpvar_2);
+ tmpvar_51 = (tmpvar_19.xyz - tmpvar_2);
highp float tmpvar_52;
tmpvar_52 = dot (tmpvar_51, tmpvar_51);
mediump vec4 tmpvar_53;
tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = (tmpvar_52 * tmpvar_17.w);
+ tmpvar_53.y = (tmpvar_52 * tmpvar_19.w);
highp vec3 tmpvar_54;
- tmpvar_54 = (tmpvar_27.xyz - tmpvar_2);
+ tmpvar_54 = (tmpvar_29.xyz - tmpvar_2);
highp float tmpvar_55;
tmpvar_55 = dot (tmpvar_54, tmpvar_54);
mediump vec4 tmpvar_56;
tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = (tmpvar_55 * tmpvar_27.w);
+ tmpvar_56.z = (tmpvar_55 * tmpvar_29.w);
highp vec3 tmpvar_57;
- tmpvar_57 = (tmpvar_37.xyz - tmpvar_2);
+ tmpvar_57 = (tmpvar_39.xyz - tmpvar_2);
highp float tmpvar_58;
tmpvar_58 = dot (tmpvar_57, tmpvar_57);
mediump vec4 tmpvar_59;
tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = (tmpvar_58 * tmpvar_37.w);
+ tmpvar_59.w = (tmpvar_58 * tmpvar_39.w);
atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
+ hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
tmpvar_3 = hybridCol_46;
tmpvar_1 = tmpvar_3;
gl_Position = (glstate_matrix_mvp * _glesVertex);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
index dc583a7a2c9..8b320c4946f 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
@@ -18,134 +18,134 @@ void main ()
highp vec2 tmpvar_6;
tmpvar_6.y = 1.0;
tmpvar_6.x = float(tmpvar_5.x);
- mediump vec4 tmpvar_7;
- mediump vec2 coord_8;
- coord_8 = tmpvar_6;
+ mediump vec2 coord_7;
+ coord_7 = tmpvar_6;
+ mediump vec4 tmpvar_8;
+ tmpvar_8.zw = vec2(0.0, 0.0);
+ tmpvar_8.xy = (coord_7 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_10;
- tmpvar_10 = textureLod (_DynLampInfo, tmpvar_9.xy, 0.0);
- tmpvar_7 = tmpvar_10;
+ tmpvar_10 = textureLod (_DynLampInfo, tmpvar_8.xy, 0.0);
+ tmpvar_9 = tmpvar_10;
highp vec2 tmpvar_11;
tmpvar_11.y = 2.0;
tmpvar_11.x = float(tmpvar_5.x);
- mediump vec4 tmpvar_12;
- mediump vec2 coord_13;
- coord_13 = tmpvar_11;
+ mediump vec2 coord_12;
+ coord_12 = tmpvar_11;
+ mediump vec4 tmpvar_13;
+ tmpvar_13.zw = vec2(0.0, 0.0);
+ tmpvar_13.xy = (coord_12 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_14;
- tmpvar_14.zw = vec2(0.0, 0.0);
- tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_15;
- tmpvar_15 = textureLod (_DynLampInfo, tmpvar_14.xy, 0.0);
- tmpvar_12 = tmpvar_15;
+ tmpvar_15 = textureLod (_DynLampInfo, tmpvar_13.xy, 0.0);
+ tmpvar_14 = tmpvar_15;
highp vec2 tmpvar_16;
tmpvar_16.y = 1.0;
tmpvar_16.x = float(tmpvar_5.y);
- mediump vec4 tmpvar_17;
- mediump vec2 coord_18;
- coord_18 = tmpvar_16;
+ mediump vec2 coord_17;
+ coord_17 = tmpvar_16;
+ mediump vec4 tmpvar_18;
+ tmpvar_18.zw = vec2(0.0, 0.0);
+ tmpvar_18.xy = (coord_17 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_19;
- tmpvar_19.zw = vec2(0.0, 0.0);
- tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_20;
- tmpvar_20 = textureLod (_DynLampInfo, tmpvar_19.xy, 0.0);
- tmpvar_17 = tmpvar_20;
+ tmpvar_20 = textureLod (_DynLampInfo, tmpvar_18.xy, 0.0);
+ tmpvar_19 = tmpvar_20;
highp vec2 tmpvar_21;
tmpvar_21.y = 2.0;
tmpvar_21.x = float(tmpvar_5.y);
- mediump vec4 tmpvar_22;
- mediump vec2 coord_23;
- coord_23 = tmpvar_21;
+ mediump vec2 coord_22;
+ coord_22 = tmpvar_21;
+ mediump vec4 tmpvar_23;
+ tmpvar_23.zw = vec2(0.0, 0.0);
+ tmpvar_23.xy = (coord_22 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_24;
- tmpvar_24.zw = vec2(0.0, 0.0);
- tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_25;
- tmpvar_25 = textureLod (_DynLampInfo, tmpvar_24.xy, 0.0);
- tmpvar_22 = tmpvar_25;
+ tmpvar_25 = textureLod (_DynLampInfo, tmpvar_23.xy, 0.0);
+ tmpvar_24 = tmpvar_25;
highp vec2 tmpvar_26;
tmpvar_26.y = 1.0;
tmpvar_26.x = float(tmpvar_5.z);
- mediump vec4 tmpvar_27;
- mediump vec2 coord_28;
- coord_28 = tmpvar_26;
+ mediump vec2 coord_27;
+ coord_27 = tmpvar_26;
+ mediump vec4 tmpvar_28;
+ tmpvar_28.zw = vec2(0.0, 0.0);
+ tmpvar_28.xy = (coord_27 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_29;
- tmpvar_29.zw = vec2(0.0, 0.0);
- tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_30;
- tmpvar_30 = textureLod (_DynLampInfo, tmpvar_29.xy, 0.0);
- tmpvar_27 = tmpvar_30;
+ tmpvar_30 = textureLod (_DynLampInfo, tmpvar_28.xy, 0.0);
+ tmpvar_29 = tmpvar_30;
highp vec2 tmpvar_31;
tmpvar_31.y = 2.0;
tmpvar_31.x = float(tmpvar_5.z);
- mediump vec4 tmpvar_32;
- mediump vec2 coord_33;
- coord_33 = tmpvar_31;
+ mediump vec2 coord_32;
+ coord_32 = tmpvar_31;
+ mediump vec4 tmpvar_33;
+ tmpvar_33.zw = vec2(0.0, 0.0);
+ tmpvar_33.xy = (coord_32 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_34;
- tmpvar_34.zw = vec2(0.0, 0.0);
- tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_35;
- tmpvar_35 = textureLod (_DynLampInfo, tmpvar_34.xy, 0.0);
- tmpvar_32 = tmpvar_35;
+ tmpvar_35 = textureLod (_DynLampInfo, tmpvar_33.xy, 0.0);
+ tmpvar_34 = tmpvar_35;
highp vec2 tmpvar_36;
tmpvar_36.y = 1.0;
tmpvar_36.x = float(tmpvar_5.w);
- mediump vec4 tmpvar_37;
- mediump vec2 coord_38;
- coord_38 = tmpvar_36;
+ mediump vec2 coord_37;
+ coord_37 = tmpvar_36;
+ mediump vec4 tmpvar_38;
+ tmpvar_38.zw = vec2(0.0, 0.0);
+ tmpvar_38.xy = (coord_37 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_39;
- tmpvar_39.zw = vec2(0.0, 0.0);
- tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_40;
- tmpvar_40 = textureLod (_DynLampInfo, tmpvar_39.xy, 0.0);
- tmpvar_37 = tmpvar_40;
+ tmpvar_40 = textureLod (_DynLampInfo, tmpvar_38.xy, 0.0);
+ tmpvar_39 = tmpvar_40;
highp vec2 tmpvar_41;
tmpvar_41.y = 2.0;
tmpvar_41.x = float(tmpvar_5.w);
- mediump vec4 tmpvar_42;
- mediump vec2 coord_43;
- coord_43 = tmpvar_41;
+ mediump vec2 coord_42;
+ coord_42 = tmpvar_41;
+ mediump vec4 tmpvar_43;
+ tmpvar_43.zw = vec2(0.0, 0.0);
+ tmpvar_43.xy = (coord_42 / _DynLampInfo_bufferSize);
mediump vec4 tmpvar_44;
- tmpvar_44.zw = vec2(0.0, 0.0);
- tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize);
lowp vec4 tmpvar_45;
- tmpvar_45 = textureLod (_DynLampInfo, tmpvar_44.xy, 0.0);
- tmpvar_42 = tmpvar_45;
+ tmpvar_45 = textureLod (_DynLampInfo, tmpvar_43.xy, 0.0);
+ tmpvar_44 = tmpvar_45;
mediump vec3 hybridCol_46;
mediump vec4 atten_47;
highp vec3 tmpvar_48;
- tmpvar_48 = (tmpvar_7.xyz - tmpvar_2);
+ tmpvar_48 = (tmpvar_9.xyz - tmpvar_2);
highp float tmpvar_49;
tmpvar_49 = dot (tmpvar_48, tmpvar_48);
mediump vec4 tmpvar_50;
tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = (tmpvar_49 * tmpvar_7.w);
+ tmpvar_50.x = (tmpvar_49 * tmpvar_9.w);
highp vec3 tmpvar_51;
- tmpvar_51 = (tmpvar_17.xyz - tmpvar_2);
+ tmpvar_51 = (tmpvar_19.xyz - tmpvar_2);
highp float tmpvar_52;
tmpvar_52 = dot (tmpvar_51, tmpvar_51);
mediump vec4 tmpvar_53;
tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = (tmpvar_52 * tmpvar_17.w);
+ tmpvar_53.y = (tmpvar_52 * tmpvar_19.w);
highp vec3 tmpvar_54;
- tmpvar_54 = (tmpvar_27.xyz - tmpvar_2);
+ tmpvar_54 = (tmpvar_29.xyz - tmpvar_2);
highp float tmpvar_55;
tmpvar_55 = dot (tmpvar_54, tmpvar_54);
mediump vec4 tmpvar_56;
tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = (tmpvar_55 * tmpvar_27.w);
+ tmpvar_56.z = (tmpvar_55 * tmpvar_29.w);
highp vec3 tmpvar_57;
- tmpvar_57 = (tmpvar_37.xyz - tmpvar_2);
+ tmpvar_57 = (tmpvar_39.xyz - tmpvar_2);
highp float tmpvar_58;
tmpvar_58 = dot (tmpvar_57, tmpvar_57);
mediump vec4 tmpvar_59;
tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = (tmpvar_58 * tmpvar_37.w);
+ tmpvar_59.w = (tmpvar_58 * tmpvar_39.w);
atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
+ hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
tmpvar_3 = hybridCol_46;
tmpvar_1 = tmpvar_3;
gl_Position = (glstate_matrix_mvp * _glesVertex);
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
index a8e3d7ef567..a56f7df0793 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
@@ -27,134 +27,134 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]],
float2 tmpvar_6;
tmpvar_6.y = 1.0;
tmpvar_6.x = float(tmpvar_5.x);
- half4 tmpvar_7;
- half2 coord_8;
- coord_8 = half2(tmpvar_6);
+ half2 coord_7;
+ coord_7 = half2(tmpvar_6);
+ half4 tmpvar_8;
+ tmpvar_8.zw = half2(float2(0.0, 0.0));
+ tmpvar_8.xy = (coord_7 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_9;
- tmpvar_9.zw = half2(float2(0.0, 0.0));
- tmpvar_9.xy = (coord_8 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_10;
- tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_9.xy), level(0.0));
- tmpvar_7 = tmpvar_10;
+ tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_8.xy), level(0.0));
+ tmpvar_9 = tmpvar_10;
float2 tmpvar_11;
tmpvar_11.y = 2.0;
tmpvar_11.x = float(tmpvar_5.x);
- half4 tmpvar_12;
- half2 coord_13;
- coord_13 = half2(tmpvar_11);
+ half2 coord_12;
+ coord_12 = half2(tmpvar_11);
+ half4 tmpvar_13;
+ tmpvar_13.zw = half2(float2(0.0, 0.0));
+ tmpvar_13.xy = (coord_12 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_14;
- tmpvar_14.zw = half2(float2(0.0, 0.0));
- tmpvar_14.xy = (coord_13 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_15;
- tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_14.xy), level(0.0));
- tmpvar_12 = tmpvar_15;
+ tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_13.xy), level(0.0));
+ tmpvar_14 = tmpvar_15;
float2 tmpvar_16;
tmpvar_16.y = 1.0;
tmpvar_16.x = float(tmpvar_5.y);
- half4 tmpvar_17;
- half2 coord_18;
- coord_18 = half2(tmpvar_16);
+ half2 coord_17;
+ coord_17 = half2(tmpvar_16);
+ half4 tmpvar_18;
+ tmpvar_18.zw = half2(float2(0.0, 0.0));
+ tmpvar_18.xy = (coord_17 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_19;
- tmpvar_19.zw = half2(float2(0.0, 0.0));
- tmpvar_19.xy = (coord_18 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_20;
- tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_19.xy), level(0.0));
- tmpvar_17 = tmpvar_20;
+ tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_18.xy), level(0.0));
+ tmpvar_19 = tmpvar_20;
float2 tmpvar_21;
tmpvar_21.y = 2.0;
tmpvar_21.x = float(tmpvar_5.y);
- half4 tmpvar_22;
- half2 coord_23;
- coord_23 = half2(tmpvar_21);
+ half2 coord_22;
+ coord_22 = half2(tmpvar_21);
+ half4 tmpvar_23;
+ tmpvar_23.zw = half2(float2(0.0, 0.0));
+ tmpvar_23.xy = (coord_22 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_24;
- tmpvar_24.zw = half2(float2(0.0, 0.0));
- tmpvar_24.xy = (coord_23 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_25;
- tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_24.xy), level(0.0));
- tmpvar_22 = tmpvar_25;
+ tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_23.xy), level(0.0));
+ tmpvar_24 = tmpvar_25;
float2 tmpvar_26;
tmpvar_26.y = 1.0;
tmpvar_26.x = float(tmpvar_5.z);
- half4 tmpvar_27;
- half2 coord_28;
- coord_28 = half2(tmpvar_26);
+ half2 coord_27;
+ coord_27 = half2(tmpvar_26);
+ half4 tmpvar_28;
+ tmpvar_28.zw = half2(float2(0.0, 0.0));
+ tmpvar_28.xy = (coord_27 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_29;
- tmpvar_29.zw = half2(float2(0.0, 0.0));
- tmpvar_29.xy = (coord_28 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_30;
- tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_29.xy), level(0.0));
- tmpvar_27 = tmpvar_30;
+ tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_28.xy), level(0.0));
+ tmpvar_29 = tmpvar_30;
float2 tmpvar_31;
tmpvar_31.y = 2.0;
tmpvar_31.x = float(tmpvar_5.z);
- half4 tmpvar_32;
- half2 coord_33;
- coord_33 = half2(tmpvar_31);
+ half2 coord_32;
+ coord_32 = half2(tmpvar_31);
+ half4 tmpvar_33;
+ tmpvar_33.zw = half2(float2(0.0, 0.0));
+ tmpvar_33.xy = (coord_32 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_34;
- tmpvar_34.zw = half2(float2(0.0, 0.0));
- tmpvar_34.xy = (coord_33 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_35;
- tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_34.xy), level(0.0));
- tmpvar_32 = tmpvar_35;
+ tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_33.xy), level(0.0));
+ tmpvar_34 = tmpvar_35;
float2 tmpvar_36;
tmpvar_36.y = 1.0;
tmpvar_36.x = float(tmpvar_5.w);
- half4 tmpvar_37;
- half2 coord_38;
- coord_38 = half2(tmpvar_36);
+ half2 coord_37;
+ coord_37 = half2(tmpvar_36);
+ half4 tmpvar_38;
+ tmpvar_38.zw = half2(float2(0.0, 0.0));
+ tmpvar_38.xy = (coord_37 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_39;
- tmpvar_39.zw = half2(float2(0.0, 0.0));
- tmpvar_39.xy = (coord_38 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_40;
- tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_39.xy), level(0.0));
- tmpvar_37 = tmpvar_40;
+ tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_38.xy), level(0.0));
+ tmpvar_39 = tmpvar_40;
float2 tmpvar_41;
tmpvar_41.y = 2.0;
tmpvar_41.x = float(tmpvar_5.w);
- half4 tmpvar_42;
- half2 coord_43;
- coord_43 = half2(tmpvar_41);
+ half2 coord_42;
+ coord_42 = half2(tmpvar_41);
+ half4 tmpvar_43;
+ tmpvar_43.zw = half2(float2(0.0, 0.0));
+ tmpvar_43.xy = (coord_42 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_44;
- tmpvar_44.zw = half2(float2(0.0, 0.0));
- tmpvar_44.xy = (coord_43 / _mtl_u._DynLampInfo_bufferSize);
half4 tmpvar_45;
- tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_44.xy), level(0.0));
- tmpvar_42 = tmpvar_45;
+ tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_43.xy), level(0.0));
+ tmpvar_44 = tmpvar_45;
half3 hybridCol_46;
half4 atten_47;
float3 tmpvar_48;
- tmpvar_48 = ((float3)tmpvar_7.xyz - tmpvar_2);
+ tmpvar_48 = ((float3)tmpvar_9.xyz - tmpvar_2);
float tmpvar_49;
tmpvar_49 = dot (tmpvar_48, tmpvar_48);
half4 tmpvar_50;
tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = half((tmpvar_49 * (float)tmpvar_7.w));
+ tmpvar_50.x = half((tmpvar_49 * (float)tmpvar_9.w));
float3 tmpvar_51;
- tmpvar_51 = ((float3)tmpvar_17.xyz - tmpvar_2);
+ tmpvar_51 = ((float3)tmpvar_19.xyz - tmpvar_2);
float tmpvar_52;
tmpvar_52 = dot (tmpvar_51, tmpvar_51);
half4 tmpvar_53;
tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = half((tmpvar_52 * (float)tmpvar_17.w));
+ tmpvar_53.y = half((tmpvar_52 * (float)tmpvar_19.w));
float3 tmpvar_54;
- tmpvar_54 = ((float3)tmpvar_27.xyz - tmpvar_2);
+ tmpvar_54 = ((float3)tmpvar_29.xyz - tmpvar_2);
float tmpvar_55;
tmpvar_55 = dot (tmpvar_54, tmpvar_54);
half4 tmpvar_56;
tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = half((tmpvar_55 * (float)tmpvar_27.w));
+ tmpvar_56.z = half((tmpvar_55 * (float)tmpvar_29.w));
float3 tmpvar_57;
- tmpvar_57 = ((float3)tmpvar_37.xyz - tmpvar_2);
+ tmpvar_57 = ((float3)tmpvar_39.xyz - tmpvar_2);
float tmpvar_58;
tmpvar_58 = dot (tmpvar_57, tmpvar_57);
half4 tmpvar_59;
tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = half((tmpvar_58 * (float)tmpvar_37.w));
+ tmpvar_59.w = half((tmpvar_58 * (float)tmpvar_39.w));
atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w));
+ hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
+ hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
tmpvar_3 = float3(hybridCol_46);
tmpvar_1 = half3(tmpvar_3);
_mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imconfig.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imconfig.h
index 17cad4a4b43..f41c5660b3a 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imconfig.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imconfig.h
@@ -12,7 +12,8 @@
//#define ImVector MyVector
//---- Define assertion handler. Defaults to calling assert().
-//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
+#include <assert.h>
+#define IM_ASSERT(_EXPR, ...) assert(_EXPR)
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows.
//#define IMGUI_API __declspec( dllexport )
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index 0971cf8950c..80f4b6eaf03 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -1,8 +1,13 @@
-// ImGui library v1.39 WIP
-// See ImGui::ShowTestWindow() for sample code.
+// ImGui library v1.46 WIP
+// Main code & documentation
+
+// See ImGui::ShowTestWindow() in imgui_demo.cpp for demo code.
// Read 'Programmer guide' below for notes on how to setup ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
-// Developed by Omar Cornut and ImGui contributors.
+// Releases change-log at https://github.com/ocornut/imgui/releases
+// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
+// This library is free but I need your support to sustain development and maintenance.
+// If you work for a company, please consider financial support, e.g: https://www.patreon.com/imgui
/*
@@ -13,17 +18,16 @@
- API BREAKING CHANGES (read me when you update!)
- FREQUENTLY ASKED QUESTIONS (FAQ), TIPS
- How do I update to a newer version of ImGui?
- - Can I have multiple widgets with the same label? (Yes)
- - Why is my text output blurry?
- - How can I load a different font than the default?
+ - Can I have multiple widgets with the same label? Can I have widget without a label? (Yes)
+ - I integrated ImGui in my engine and the text or lines are blurry..
+ - I integrated ImGui in my engine and some elements are disappearing when I move windows around..
+ - How can I load a different font than the default?
- How can I load multiple fonts?
- - How can I display and input Chinese, Japanese, Korean characters?
+ - How can I display and input non-latin characters such as Chinese, Japanese, Korean, Cyrillic?
- ISSUES & TODO-LIST
- CODE
- - SAMPLE CODE
- - FONT DATA
-
+
MISSION STATEMENT
=================
@@ -54,7 +58,7 @@
- TAB/SHIFT+TAB to cycle through keyboard editable fields
- use mouse wheel to scroll
- use CTRL+mouse wheel to zoom window contents (if IO.FontAllowScaling is true)
- - CTRL+Click on a slider to input value as text
+ - CTRL+Click on a slider or drag box to input value as text
- text editor:
- Hold SHIFT or use mouse to select text.
- CTRL+Left/Right to word jump
@@ -71,17 +75,17 @@
- read the FAQ below this section!
- your code creates the UI, if your code doesn't run the UI is gone! == very dynamic UI, no construction/destructions steps, less data retention on your side, no state duplication, less sync, less bugs.
- - call and read ImGui::ShowTestWindow() for sample code demonstrating most features.
+ - call and read ImGui::ShowTestWindow() for demo code demonstrating most features.
- see examples/ folder for standalone sample applications. e.g. examples/opengl_example/
- customization: PushStyleColor()/PushStyleVar() or the style editor to tweak the look of the interface (e.g. if you want a more compact UI or a different color scheme).
- getting started:
- initialisation: call ImGui::GetIO() to retrieve the ImGuiIO structure and fill the 'Settings' data.
- - every frame:
+ - every frame:
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().
2/ use any ImGui function you want between NewFrame() and Render()
3/ ImGui::Render() to render all the accumulated command-lists. it will call your RenderDrawListFn handler that you set in the IO structure.
- - all rendering information are stored into command-lists until ImGui::Render() is called.
+ - all rendering information are stored into command-lists until ImGui::Render() is called.
- ImGui never touches or know about your GPU state. the only function that knows about GPU is the RenderDrawListFn handler that you must provide.
- effectively it means you can create widgets at any time in your code, regardless of "update" vs "render" considerations.
- refer to the examples applications in the examples/ folder for instruction on how to setup your code.
@@ -91,15 +95,15 @@
ImGuiIO& io = ImGui::GetIO();
io.DisplaySize.x = 1920.0f;
io.DisplaySize.y = 1280.0f;
- io.DeltaTime = 1.0f/60.0f;
io.IniFilename = "imgui.ini";
+ io.RenderDrawListsFn = my_render_function; // Setup a render function, or set to NULL and call GetDrawData() after Render() to access the render data.
// TODO: Fill others settings of the io structure
- // Load texture
+ // Load texture atlas
unsigned char* pixels;
int width, height, bytes_per_pixels;
io.Fonts->GetTexDataAsRGBA32(pixels, &width, &height, &bytes_per_pixels);
- // TODO: copy texture to graphics memory.
+ // TODO: copy texture to graphics memory.
// TODO: store your texture pointer/identifier in 'io.Fonts->TexID'
// Application main loop
@@ -107,9 +111,10 @@
{
// 1) get low-level input
// e.g. on Win32, GetKeyboardState(), or poll your events, etc.
-
+
// 2) TODO: fill all fields of IO structure and call NewFrame
ImGuiIO& io = ImGui::GetIO();
+ io.DeltaTime = 1.0f/60.0f;
io.MousePos = mouse_pos;
io.MouseDown[0] = mouse_button_0;
io.KeysDown[i] = ...
@@ -127,24 +132,63 @@
// swap video buffer, etc.
}
- - after calling ImGui::NewFrame() you can read back 'io.WantCaptureMouse' and 'io.WantCaptureKeyboard' to tell if ImGui
- wants to use your inputs. if it does you can discard/hide the inputs from the rest of your application.
+ - after calling ImGui::NewFrame() you can read back flags from the IO structure to tell how ImGui intends to use your inputs.
+ When 'io.WantCaptureMouse' or 'io.WantCaptureKeyboard' flags are set you may want to discard/hide the inputs from the rest of your application.
+ When 'io.WantInputsCharacters' is set to may want to notify your OS to popup an on-screen keyboard, if available.
+
API BREAKING CHANGES
====================
Occasionally introducing changes that are breaking the API. The breakage are generally minor and easy to fix.
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.
-
- - 2015/05/03 (1.39) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same).
+ Also read releases logs https://github.com/ocornut/imgui/releases for more details.
+
+ - 2015/08/29 (1.45) - with the addition of horizontal scrollbar we made various fixes to inconsistencies with dealing with cursor position.
+ GetCursorPos()/SetCursorPos() functions now include the scrolled amount. It shouldn't affect the majority of users, but take note that SetCursorPosX(100.0f) puts you at +100 from the starting x position which may include scrolling, not at +100 from the window left side.
+ GetContentRegionMax()/GetWindowContentRegionMin()/GetWindowContentRegionMax() functions allow include the scrolled amount. Typically those were used in cases where no scrolling would happen so it may not be a problem, but watch out!
+ - 2015/08/29 (1.45) - renamed style.ScrollbarWidth to style.ScrollbarSize
+ - 2015/08/05 (1.44) - split imgui.cpp into extra files: imgui_demo.cpp imgui_draw.cpp imgui_internal.h that you need to add to your project.
+ - 2015/07/18 (1.44) - fixed angles in ImDrawList::PathArcTo(), PathArcToFast() (introduced in 1.43) being off by an extra PI for no justifiable reason
+ - 2015/07/14 (1.43) - add new ImFontAtlas::AddFont() API. For the old AddFont***, moved the 'font_no' parameter of ImFontAtlas::AddFont** functions to the ImFontConfig structure.
+ you need to render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of text.
+ - 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amount of CPU/GPU and enables us to get anti-aliasing for a marginal cost.
+ this necessary change will break your rendering function! the fix should be very easy. sorry for that :(
+ - if you are using a vanilla copy of one of the imgui_impl_XXXX.cpp provided in the example, you just need to update your copy and you can ignore the rest.
+ - the signature of the io.RenderDrawListsFn handler has changed!
+ ImGui_XXXX_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
+ became:
+ ImGui_XXXX_RenderDrawLists(ImDrawData* draw_data).
+ argument 'cmd_lists' -> 'draw_data->CmdLists'
+ argument 'cmd_lists_count' -> 'draw_data->CmdListsCount'
+ ImDrawList 'commands' -> 'CmdBuffer'
+ ImDrawList 'vtx_buffer' -> 'VtxBuffer'
+ ImDrawList n/a -> 'IdxBuffer' (new)
+ ImDrawCmd 'vtx_count' -> 'ElemCount'
+ ImDrawCmd 'clip_rect' -> 'ClipRect'
+ ImDrawCmd 'user_callback' -> 'UserCallback'
+ ImDrawCmd 'texture_id' -> 'TextureId'
+ - each ImDrawList now contains both a vertex buffer and an index buffer. For each command, render ElemCount/3 triangles using indices from the index buffer.
+ - if you REALLY cannot render indexed primitives, you can call the draw_data->DeIndexAllBuffers() method to de-index the buffers. This is slow and a waste of CPU/GPU. Prefer using indexed rendering!
+ - refer to code in the examples/ folder or ask on the GitHub if you are unsure of how to upgrade. please upgrade!
+ - 2015/07/10 (1.43) - changed SameLine() parameters from int to float.
+ - 2015/07/02 (1.42) - renamed SetScrollPosHere() to SetScrollFromCursorPos(). Kept inline redirection function (will obsolete).
+ - 2015/07/02 (1.42) - renamed GetScrollPosY() to GetScrollY(). Necessary to reduce confusion along with other scrolling functions, because positions (e.g. cursor position) are not equivalent to scrolling amount.
+ - 2015/06/14 (1.41) - changed ImageButton() default bg_col parameter from (0,0,0,1) (black) to (0,0,0,0) (transparent) - makes a difference when texture have transparence
+ - 2015/06/14 (1.41) - changed Selectable() API from (label, selected, size) to (label, selected, flags, size). Size override should have been rarely be used. Sorry!
+ - 2015/05/31 (1.40) - renamed GetWindowCollapsed() to IsWindowCollapsed() for consistency. Kept inline redirection function (will obsolete).
+ - 2015/05/31 (1.40) - renamed IsRectClipped() to IsRectVisible() for consistency. Note that return value is opposite! Kept inline redirection function (will obsolete).
+ - 2015/05/27 (1.40) - removed the third 'repeat_if_held' parameter from Button() - sorry! it was rarely used and inconsistent. Use PushButtonRepeat(true) / PopButtonRepeat() to enable repeat on desired buttons.
+ - 2015/05/11 (1.40) - changed BeginPopup() API, takes a string identifier instead of a bool. ImGui needs to manage the open/closed state of popups. Call OpenPopup() to actually set the "opened" state of a popup. BeginPopup() returns true if the popup is opened.
+ - 2015/05/03 (1.40) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same).
- 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function (will obsolete).
- 2015/04/09 (1.38) - renamed ImDrawList::AddArc() to ImDrawList::AddArcFast() for compatibility with future API
- 2015/04/03 (1.38) - removed ImGuiCol_CheckHovered, ImGuiCol_CheckActive, replaced with the more general ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive.
- 2014/04/03 (1.38) - removed support for passing -FLT_MAX..+FLT_MAX as the range for a SliderFloat(). Use DragFloat() or Inputfloat() instead.
- - 2015/03/17 (1.36) - renamed GetItemRectMin()/GetItemRectMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function (will obsolete).
+ - 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function (will obsolete).
- 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing
- 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function (will obsolete).
- - 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth
+ - 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing)
- 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function (will obsolete).
- 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once.
- 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now.
@@ -166,7 +210,7 @@
// <Copy to GPU>
io.Fonts->TexID = (your_texture_identifier);
you now have much more flexibility to load multiple TTF fonts and manage the texture buffer for internal needs.
- it is now recommended your sample the font texture with bilinear interpolation.
+ it is now recommended that you sample the font texture with bilinear interpolation.
(1.30) - added texture identifier in ImDrawCmd passed to your render function (we can now render images). make sure to set io.Fonts->TexID.
(1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix)
(1.30) - removed ImGui::IsItemFocused() in favor of ImGui::IsItemActive() which handles all widgets
@@ -190,48 +234,61 @@
A: Overwrite the following files:
imgui.cpp
imgui.h
+ imgui_demo.cpp
+ imgui_draw.cpp
+ imgui_internal.h
stb_rect_pack.h
stb_textedit.h
stb_truetype.h
+ Don't overwrite imconfig.h if you have made modification to your copy.
Check the "API BREAKING CHANGES" sections for a list of occasional API breaking changes. If you have a problem with a function, search for its name
in the code, there will likely be a comment about it. Please report any issue to the GitHub page!
- Q: Can I have multiple widgets with the same label?
+ Q: Can I have multiple widgets with the same label? Can I have widget without a label? (Yes)
A: Yes. A primer on the use of labels/IDs in ImGui..
-
+
+ - Elements that are not clickable, such as Text() items don't need an ID.
+
- Interactive widgets require state to be carried over multiple frames (most typically ImGui often needs to remember what is the "active" widget).
to do so they need an unique ID. unique ID are typically derived from a string label, an integer index or a pointer.
-
+
Button("OK"); // Label = "OK", ID = hash of "OK"
Button("Cancel"); // Label = "Cancel", ID = hash of "Cancel"
- - Elements that are not clickable, such as Text() items don't need an ID.
-
- ID are uniquely scoped within windows, tree nodes, etc. so no conflict can happen if you have two buttons called "OK" in two different windows
or in two different locations of a tree.
- - if you have a same ID twice in the same location, you'll have a conflict:
+ - If you have a same ID twice in the same location, you'll have a conflict:
Button("OK");
- Button("OK"); // ID collision! Both buttons will be treated as the same.
+ Button("OK"); // ID collision! Both buttons will be treated as the same.
Fear not! this is easy to solve and there are many ways to solve it!
- - when passing a label you can optionally specify extra unique ID information within string itself. This helps solving the simpler collision cases.
+ - When passing a label you can optionally specify extra unique ID information within string itself. This helps solving the simpler collision cases.
use "##" to pass a complement to the ID that won't be visible to the end-user:
- Button("Play##0"); // Label = "Play", ID = hash of "Play##0"
- Button("Play##1"); // Label = "Play", ID = hash of "Play##1" (different from above)
+ Button("Play"); // Label = "Play", ID = hash of "Play"
+ Button("Play##foo1"); // Label = "Play", ID = hash of "Play##foo1" (different from above)
+ Button("Play##foo2"); // Label = "Play", ID = hash of "Play##foo2" (different from above)
- - occasionally (rarely) you might want change a label while preserving a constant ID. This allows you to animate labels.
- use "###" to pass a label that isn't part of ID:
+ - If you want to completely hide the label, but still need an ID:
- Button("Hello###ID"; // Label = "Hello", ID = hash of "ID"
- Button("World###ID"; // Label = "World", ID = hash of "ID" (same as above)
+ Checkbox("##On", &b); // Label = "", ID = hash of "##On" (no label!)
- - use PushID() / PopID() to create scopes and avoid ID conflicts within the same Window.
- this is the most convenient way of distinguish ID if you are iterating and creating many UI elements.
- you can push a pointer, a string or an integer value. remember that ID are formed from the addition of everything in the ID stack!
+ - Occasionally/rarely you might want change a label while preserving a constant ID. This allows you to animate labels.
+ For example you may want to include varying information in a window title bar (and windows are uniquely identified by their ID.. obviously)
+ Use "###" to pass a label that isn't part of ID:
+
+ Button("Hello###ID"; // Label = "Hello", ID = hash of "ID"
+ Button("World###ID"; // Label = "World", ID = hash of "ID" (same as above)
+
+ sprintf(buf, "My game (%f FPS)###MyGame");
+ Begin(buf); // Variable label, ID = hash of "MyGame"
+
+ - Use PushID() / PopID() to create scopes and avoid ID conflicts within the same Window.
+ This is the most convenient way of distinguishing ID if you are iterating and creating many UI elements.
+ You can push a pointer, a string or an integer value. Remember that ID are formed from the concatenation of everything in the ID stack!
for (int i = 0; i < 100; i++)
{
@@ -256,7 +313,7 @@
PopID();
}
- - more example showing that you can stack multiple prefixes into the ID stack:
+ - More example showing that you can stack multiple prefixes into the ID stack:
Button("Click"); // Label = "Click", ID = hash of "Click"
PushID("node");
@@ -266,7 +323,7 @@
PopID();
PopID();
- - tree nodes implicitly creates a scope for you by calling PushID().
+ - Tree nodes implicitly creates a scope for you by calling PushID().
Button("Click"); // Label = "Click", ID = hash of "Click"
if (TreeNode("node"))
@@ -275,104 +332,150 @@
TreePop();
}
- - when working with trees, ID are used to preserve the opened/closed state of each tree node.
- depending on your use cases you may want to use strings, indices or pointers as ID.
+ - When working with trees, ID are used to preserve the opened/closed state of each tree node.
+ Depending on your use cases you may want to use strings, indices or pointers as ID.
e.g. when displaying a single object that may change over time (1-1 relationship), using a static string as ID will preserve your node open/closed state when the targeted object change.
e.g. when displaying a list of objects, using indices or pointers as ID will preserve the node open/closed state differently. experiment and see what makes more sense!
- Q: Why is my text output blurry?
- A: In your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
+ Q: I integrated ImGui in my engine and the text or lines are blurry..
+ A: In your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f).
+ Also make sure your orthographic projection matrix and io.DisplaySize matches your actual framebuffer dimension.
+
+ Q. I integrated ImGui in my engine and some elements are disappearing when I move windows around..
+ Most likely you are mishandling the clipping rectangles in your render function. Rectangles provided by ImGui are defined as (x1,y1,x2,y2) and NOT as (x1,y1,width,height).
Q: How can I load a different font than the default? (default is an embedded version of ProggyClean.ttf, rendered at size 13)
A: Use the font atlas to load the TTF file you want:
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
- io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
+ ImGuiIO& io = ImGui::GetIO();
+ io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
+ io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
Q: How can I load multiple fonts?
A: Use the font atlas to pack them into a single texture:
- ImFont* font0 = io.Fonts->AddFontDefault();
- ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
- ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
- io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
- // the first loaded font gets used by default
- // use ImGui::PushFont()/ImGui::PopFont() to change the font at runtime
-
- Q: How can I render and input Chinese, Japanese, Korean characters?
+ ImGuiIO& io = ImGui::GetIO();
+ ImFont* font0 = io.Fonts->AddFontDefault();
+ ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
+ ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
+ io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
+ // the first loaded font gets used by default
+ // use ImGui::PushFont()/ImGui::PopFont() to change the font at runtime
+
+ // Options
+ ImFontConfig config;
+ config.OversampleH = 3;
+ config.OversampleV = 3;
+ config.GlyphExtraSpacing.x = 1.0f;
+ io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, &config);
+
+ // Combine multiple fonts into one
+ ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
+ ImFontConfig config;
+ config.MergeMode = true;
+ io.Fonts->AddFontDefault();
+ io.Fonts->LoadFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
+ io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese());
+
+ Read extra_fonts/README.txt or ImFontAtlas class for more details.
+
+ Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
A: When loading a font, pass custom Unicode ranges to specify the glyphs to load. ImGui will support UTF-8 encoding across the board.
Character input depends on you passing the right character code to io.AddInputCharacter(). The example applications do that.
- io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, io.Fonts->GetGlyphRangesJapanese()); // Load Japanese characters
- io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
- io.ImeWindowHandle = MY_HWND; // To input using Microsoft IME, give ImGui the hwnd of your application
+ io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels, NULL, io.Fonts->GetGlyphRangesJapanese()); // Load Japanese characters
+ io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
+ io.ImeWindowHandle = MY_HWND; // To input using Microsoft IME, give ImGui the hwnd of your application
- 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.
- tip: you can create widgets without a Begin()/End() block, they will go in an implicit window called "Debug"
- - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window.
+ - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window. this is also useful to set yourself in the context of another window (to get/set other settings)
- tip: you can call Render() multiple times (e.g for VR renders).
- - tip: call and read the ShowTestWindow() code for more example of how to use ImGui!
+ - tip: call and read the ShowTestWindow() code in imgui_demo.cpp for more example of how to use ImGui!
ISSUES & TODO-LIST
==================
+ Issue numbers (#) refer to github issues.
+ The list below consist mostly of notes of things to do before they are requested/discussed by users (at that point it usually happens on the github)
- - misc: merge or clarify ImVec4 vs ImRect?
- - window: add horizontal scroll
- - window: fix resize grip rendering scaling along with Rounding style setting
- - window: autofit feedback loop when user relies on any dynamic layout (window width multiplier, column). maybe just clearly drop manual autofit?
- - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list.
+ - window: maximum window size settings (per-axis). for large popups in particular user may not want the popup to fill all space.
+ - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
+ - window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column). clarify.
- window: allow resizing of child windows (possibly given min/max for each axis?)
- window: background options for child windows, border option (disable rounding)
+ - window: add a way to clear an existing window instead of appending (e.g. for tooltip override using a consistent api rather than the deferred tooltip)
- window: resizing from any sides? + mouse cursor directives for app.
+!- window: begin with *p_opened == false should return false.
+ - window: get size/pos helpers given names (see discussion in #249)
+ - window: a collapsed window can be stuck behind the main menu bar?
+ - window: detect extra End() call that pop the "Debug" window out and assert at call site instead of later.
+!- scrolling: allow immediately effective change of scroll if we haven't appended items yet
+ - splitter: formalize the splitter idiom into an official api (we want to handle n-way split)
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
- widgets: clean up widgets internal toward exposing everything.
+ - widgets: add disabled and read-only modes (#211)
- main: considering adding EndFrame()/Init(). some constructs are awkward in the implementation because of the lack of them.
- 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
- main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
- - input text: add ImGuiInputTextFlags_EnterToApply? (off github issue #218)
-!- input number: large int not reliably supported because of int<>float conversions.
+ - input text: add ImGuiInputTextFlags_EnterToApply? (off #218)
+ - input text multi-line: way to dynamically grow the buffer without forcing the user to initially allocate for worse case (follow up on #200)
+ - input text multi-line: line numbers? status bar? (follow up on #200)
- input number: optional range min/max for Input*() functions
- input number: holding [-]/[+] buttons could increase the step speed non-linearly (or user-controlled)
- input number: use mouse wheel to step up/down
- - input number: non-decimal input.
+ - input number: applying arithmetics ops (+,-,*,/) messes up with text edit undo stack.
- text: proper alignment options
- - layout: horizontal layout helper (github issue #97)
+ - image/image button: misalignment on padded/bordered button?
+ - image/image button: parameters are confusing, image() has tint_col,border_col whereas imagebutton() has bg_col/tint_col. Even thou they are different parameters ordering could be more consistent. can we fix that?
+ - layout: horizontal layout helper (#97)
- layout: more generic alignment state (left/right/centered) for single items?
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
- - columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (github issue #125)
- - columns: declare column set (each column: fixed size, %, fill, distribute default size among fills) (github issue #125)
- - columns: columns header to act as button (~sort op) and allow resize/reorder (github issue #125)
- - columns: user specify columns size (github issue #125)
- - popup: border options. richer api like BeginChild() perhaps? (github issue #197)
+ - columns: separator function or parameter that works within the column (currently Separator() bypass all columns) (#125)
+ - columns: declare column set (each column: fixed size, %, fill, distribute default size among fills) (#125)
+ - columns: columns header to act as button (~sort op) and allow resize/reorder (#125)
+ - columns: user specify columns size (#125)
+ - popup: border options. richer api like BeginChild() perhaps? (#197)
- combo: sparse combo boxes (via function call?)
- - combo: turn child handling code into pop up helper
- combo: contents should extends to fit label if combo widget is small
- - combo/listbox: keyboard control. need inputtext like non-active focus + key handling. considering keybord for custom listbox (see github pr #203)
+ - combo/listbox: keyboard control. need InputText-like non-active focus + key handling. considering keyboard for custom listbox (pr #203)
- listbox: multiple selection
- listbox: user may want to initial scroll to focus on the one selected value?
- ! menubar, menus (github issue #126)
+ - listbox: keyboard navigation.
+ - listbox: scrolling should track modified selection.
+-! menus/popups: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331)
+ - menus: local shortcuts, global shortcuts (#126)
+ - menus: icons
+ - menus: menubars: some sort of priority / effect of main menu-bar on desktop size?
+ - statusbar: add a per-window status bar helper similar to what menubar does.
- tabs
+ - separator: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y)
- gauge: various forms of gauge/loading bars widgets
- - color: better color editor.
+ - color: add a better color picker
+ - plot: PlotLines() should use the polygon-stroke facilities (currently issues with averaging normals)
- plot: make it easier for user to draw extra stuff into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
- plot: "smooth" automatic scale over time, user give an input 0.0(full user scale) 1.0(full derived from value)
- 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)
- - file selection widget -> build the tool in our codebase to improve model-dialog idioms
+ - applet: file selection widget (as an example)
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
- slider: initial absolute click is imprecise. change to relative movement slider (same as scrollbar).
- slider: add dragging-based widgets to edit values with mouse (on 2 axises), saving screen real-estate.
+ - slider: tint background based on value (e.g. v_min -> v_max, or use 0.0f either side of the sign)
+ - slider & drag: int data passing through a float
+ - drag float: up/down axis
- text edit: clean up the mess caused by converting UTF-8 <> wchar. the code is rather inefficient right now.
- text edit: centered text for slider as input text so it matches typical positioning.
- - text edit: flag to disable live update of the user buffer.
+ - text edit: flag to disable live update of the user buffer.
- text edit: field resize behavior - field could stretch when being edited? hover tooltip shows more text?
- - text edit: add multi-line text edit
- - tree: add treenode/treepush int variants? because (void*) cast from int warns on some platforms/settings
+ - tree node / optimization: avoid formatting when clipped.
+ - tree node: tree-node/header right-most side doesn't take account of horizontal scrolling.
+ - tree node: add treenode/treepush int variants? because (void*) cast from int warns on some platforms/settings
+ - textwrapped: figure out better way to use TextWrapped() in an always auto-resize context (tooltip, etc.) (git issue #249)
- settings: write more decent code to allow saving/loading new fields
- settings: api for per-tool simple persistent data (bool,int,float,columns sizes,etc.) in .ini file
- ! style: store rounded corners in texture to use 1 quad per corner (filled and wireframe). so rounding have minor cost.
- - style: checkbox: padding for "active" color should be a multiplier of the
- - style: colorbox not always square?
+ - style: store rounded corners in texture to use 1 quad per corner (filled and wireframe). so rounding have minor cost.
+ - style: color-box not always square?
+ - style: a concept of "compact style" that the end-user can easily rely on (e.g. PushStyleCompact()?) that maps to other settings? avoid implementing duplicate helpers such as SmallCheckbox(), etc.
- text: simple markup language for color change?
- log: LogButtons() options for specifying depth and/or hiding depth slider
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
@@ -381,17 +484,17 @@
- filters: set a current filter that tree node can automatically query to hide themselves
- filters: handle wildcards (with implicit leading/trailing *), regexps
- shortcuts: add a shortcut api, e.g. parse "&Save" and/or "Save (CTRL+S)", pass in to widgets or provide simple ways to use (button=activate, input=focus)
- ! keyboard: tooltip & combo boxes are messing up / not honoring keyboard tabbing
+!- keyboard: tooltip & combo boxes are messing up / not honoring keyboard tabbing
- keyboard: full keyboard navigation and focus.
+ - focus: SetKeyboardFocusHere() on with >= 0 offset could be done on same frame (else latch and modulate on beginning of next frame)
- input: rework IO to be able to pass actual events to fix temporal aliasing issues.
- input: support track pad style scrolling & slider edit.
- - portability: big-endian test/support (github issue #81)
- - misc: mark printf compiler attributes on relevant functions
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
- misc: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
- style editor: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space?
- style editor: color child window height expressed in multiple of line height.
- - optimization/render: use indexed rendering to reduce vertex data cost (e.g. for remote/networked imgui)
+!- examples: directx9/directx11: resizing window duplicate the font data :(
+ - optimization: use another hash function than crc32, e.g. FNV1a
- 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)?
- optimization: turn some the various stack vectors into statically-sized arrays
- optimization: better clipping for multi-component widgets
@@ -402,9 +505,12 @@
#endif
#include "imgui.h"
+#define IMGUI_DEFINE_MATH_OPERATORS
+#include "imgui_internal.h"
+
#include <ctype.h> // toupper, isprint
#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
-#include <stdio.h> // vsnprintf, sscanf
+#include <stdio.h> // vsnprintf, sscanf, printf
#include <new> // new (ptr)
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
@@ -413,8 +519,10 @@
#endif
#ifdef _MSC_VER
+#pragma warning (disable: 4127) // condition expression is constant
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
+#define snprintf _snprintf
#endif
// Clang warnings with -Weverything
@@ -424,136 +532,95 @@
#pragma clang diagnostic ignored "-Wformat-nonliteral" // warning : format string is not a string literal // passing non-literal to vsnformat(). yes, user passing incorrect format strings can crash the code.
#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
#pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it.
-#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness //
+#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness //
#pragma clang diagnostic ignored "-Wmissing-noreturn" // warning : function xx could be declared with attribute 'noreturn' warning // GetDefaultFontData() asserts which some implementation makes it never return.
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"// warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
+#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
-#endif
-
-//-------------------------------------------------------------------------
-// STB libraries implementation
-//-------------------------------------------------------------------------
-
-struct ImGuiTextEditState;
-
-//#define IMGUI_STB_NAMESPACE ImStb
-//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
-//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
-
-#ifdef IMGUI_STB_NAMESPACE
-namespace IMGUI_STB_NAMESPACE
-{
-#endif
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#pragma clang diagnostic ignored "-Wmissing-prototypes"
-#endif
-
-#define STBRP_ASSERT(x) IM_ASSERT(x)
-#ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
-#define STBRP_STATIC
-#define STB_RECT_PACK_IMPLEMENTATION
-#endif
-#include "stb_rect_pack.h"
-
-#define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x))
-#define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x))
-#define STBTT_assert(x) IM_ASSERT(x)
-#ifndef IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
-#define STBTT_STATIC
-#define STB_TRUETYPE_IMPLEMENTATION
-#else
-#define STBTT_DEF extern
-#endif
-#include "stb_truetype.h"
-
-#undef STB_TEXTEDIT_STRING
-#undef STB_TEXTEDIT_CHARTYPE
-#define STB_TEXTEDIT_STRING ImGuiTextEditState
-#define STB_TEXTEDIT_CHARTYPE ImWchar
-#include "stb_textedit.h"
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#ifdef IMGUI_STB_NAMESPACE
-} // namespace ImStb
-using namespace IMGUI_STB_NAMESPACE;
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
#endif
//-------------------------------------------------------------------------
// Forward Declarations
//-------------------------------------------------------------------------
-struct ImRect;
-struct ImGuiColMod;
-struct ImGuiStyleMod;
-struct ImGuiDrawContext;
-struct ImGuiTextEditState;
-struct ImGuiIniData;
-struct ImGuiState;
-struct ImGuiWindow;
-typedef int ImGuiButtonFlags; // enum ImGuiButtonFlags_
-
-static bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, ImGuiButtonFlags flags = 0);
-static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL);
-
-static void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
-static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
-static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& pos_max, const ImVec2* clip_max = NULL, ImGuiAlign align = ImGuiAlign_Default);
-static void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
-static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale = 1.0f, bool shadow = false);
-static void RenderCheckMark(ImVec2 pos, ImU32 col);
-
-static void SetFont(ImFont* font);
-static bool ItemAdd(const ImRect& bb, const ImGuiID* id);
-static void ItemSize(ImVec2 size, float text_offset_y = 0.0f);
-static void ItemSize(const ImRect& bb, float text_offset_y = 0.0f);
-static void PushColumnClipRect(int column_index = -1);
-static bool IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged);
-
-static bool IsMouseHoveringRect(const ImRect& bb);
-static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true);
-
-static void Scrollbar(ImGuiWindow* window);
-static bool CloseWindowButton(bool* p_opened = NULL);
-static void FocusWindow(ImGuiWindow* window);
-static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs);
-
-// Helpers: String
-static int ImStricmp(const char* str1, const char* str2);
-static int ImStrnicmp(const char* str1, const char* str2, int count);
-static char* ImStrdup(const char *str);
-static size_t ImStrlenW(const ImWchar* str);
-static const char* ImStristr(const char* haystack, const char* needle, const char* needle_end);
-static size_t ImFormatString(char* buf, size_t buf_size, const char* fmt, ...);
-static size_t ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args);
-
-// Helpers: Misc
-static ImU32 ImHash(const void* data, size_t data_size, ImU32 seed);
-static bool ImLoadFileToMemory(const char* filename, const char* file_open_mode, void** out_file_data, size_t* out_file_size, size_t padding_bytes = 0);
-static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
-static inline bool ImCharIsSpace(int c) { return c == ' ' || c == '\t' || c == 0x3000; }
-
-// Helpers: UTF-8 <> wchar
-static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int in_char); // return output UTF-8 bytes count
-static ptrdiff_t ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
-static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
-static ptrdiff_t ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count
-static int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count)
-static int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string as UTF-8 code-points
+static void LogRenderedText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL);
+static const char* FindTextDisplayEnd(const char* text, const char* text_end = NULL);
+
+static void PushMultiItemsWidths(int components, float w_full = 0.0f);
+static float GetDraggedColumnOffset(int column_index);
+
+static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true);
+
+static void SetCurrentFont(ImFont* font);
+static void SetCurrentWindow(ImGuiWindow* window);
+static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y);
+static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiSetCond cond);
+static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond cond);
+static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiSetCond cond);
+static ImGuiWindow* FindWindowByName(const char* name);
+static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs);
+static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags);
+static inline bool IsWindowContentHoverable(ImGuiWindow* window);
+static void ClearSetNextWindowData();
+static void CheckStacksSize(ImGuiWindow* window, bool write);
+static void Scrollbar(ImGuiWindow* window, bool horizontal);
+static bool CloseWindowButton(bool* p_opened);
+
+static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDrawList* draw_list);
+static void AddWindowToRenderList(ImVector<ImDrawList*>& out_render_list, ImGuiWindow* window);
+static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows, ImGuiWindow* window);
+
+static ImGuiIniData* FindWindowSettings(const char* name);
+static ImGuiIniData* AddWindowSettings(const char* name);
+static void LoadSettings();
+static void SaveSettings();
+static void MarkSettingsDirty();
+
+static void PushClipRect(const ImRect& clip_rect, bool clipped_by_current = true);
+static void PushColumnClipRect(int column_index = -1);
+static void PopClipRect();
+static ImRect GetVisibleRect();
+
+static bool BeginPopupEx(const char* str_id, ImGuiWindowFlags extra_flags);
+static void CloseInactivePopups();
+static void ClosePopupToLevel(int remaining);
+static void ClosePopup(ImGuiID id);
+static bool IsPopupOpen(ImGuiID id);
+static ImGuiWindow* GetFrontMostModalRootWindow();
+static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, ImGuiWindowFlags flags, int* last_dir, const ImRect& r_inner);
+
+static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data);
+static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end);
+static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL, ImVec2* out_offset = NULL, bool stop_on_new_line = false);
+
+static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, const char* display_format, char* buf, int buf_size);
+static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, int decimal_precision, char* buf, int buf_size);
+static void DataTypeApplyOp(ImGuiDataType data_type, int op, void* value1, const void* value2);
+static void DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* scalar_format);
//-----------------------------------------------------------------------------
// Platform dependent default implementations
//-----------------------------------------------------------------------------
-static const char* GetClipboardTextFn_DefaultImpl();
-static void SetClipboardTextFn_DefaultImpl(const char* text);
-static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
+static const char* GetClipboardTextFn_DefaultImpl();
+static void SetClipboardTextFn_DefaultImpl(const char* text);
+static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
+
+//-----------------------------------------------------------------------------
+// Context
+//-----------------------------------------------------------------------------
+
+// We access everything through this pointer (always assumed to be != NULL)
+// You can swap the pointer to a different context by calling ImGui::SetInternalState()
+static ImGuiState GImDefaultState;
+ImGuiState* GImGui = &GImDefaultState;
+
+// Statically allocated default font atlas. This is merely a maneuver to keep ImFontAtlas definition at the bottom of the .h file (otherwise it'd be inside ImGuiIO)
+// Also we wouldn't be able to new() one at this point, before users may define IO.MemAllocFn.
+static ImFontAtlas GImDefaultFontAtlas;
//-----------------------------------------------------------------------------
// User facing structures
@@ -575,22 +642,29 @@ ImGuiStyle::ImGuiStyle()
WindowFillAlphaDefault = 0.70f; // Default alpha of window background, if not specified in ImGui::Begin()
IndentSpacing = 22.0f; // Horizontal spacing when e.g. entering a tree node
ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns
- ScrollbarWidth = 16.0f; // Width of the vertical scrollbar
- ScrollbarRounding = 0.0f; // Radius of grab corners rounding for scrollbar
+ ScrollbarSize = 16.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar
+ ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar
GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar
+ GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
DisplayWindowPadding = ImVec2(22,22); // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
DisplaySafeAreaPadding = ImVec2(4,4); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
+ AntiAliasedLines = true; // Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU.
+ AntiAliasedShapes = true; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
+ CurveTessellationTol = 1.25f; // Tessellation tolerance. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
+ Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
Colors[ImGuiCol_Border] = ImVec4(0.70f, 0.70f, 0.70f, 0.65f);
- Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.60f);
+ Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
Colors[ImGuiCol_FrameBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.30f); // Background of checkbox, radio button, plot, slider, text input
Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.90f, 0.80f, 0.80f, 0.40f);
Colors[ImGuiCol_FrameBgActive] = ImVec4(0.90f, 0.65f, 0.65f, 0.45f);
Colors[ImGuiCol_TitleBg] = ImVec4(0.50f, 0.50f, 1.00f, 0.45f);
Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.40f, 0.40f, 0.80f, 0.20f);
+ Colors[ImGuiCol_TitleBgActive] = ImVec4(0.50f, 0.50f, 1.00f, 0.55f);
+ Colors[ImGuiCol_MenuBarBg] = ImVec4(0.40f, 0.40f, 0.55f, 0.80f);
Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.40f, 0.40f, 0.80f, 0.15f);
Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.80f, 0.30f);
Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.80f, 0.40f);
@@ -620,12 +694,9 @@ ImGuiStyle::ImGuiStyle()
Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
Colors[ImGuiCol_TooltipBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
+ Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
}
-// Statically allocated font atlas. This is merely a maneuver to keep ImFontAtlas definition at the bottom of the .h file (otherwise it'd be inside ImGuiIO)
-// Also we wouldn't be able to new() one at this point, before users may define IO.MemAllocFn.
-static ImFontAtlas GDefaultFontAtlas;
-
ImGuiIO::ImGuiIO()
{
// Most fields are initialized with zero
@@ -636,13 +707,22 @@ ImGuiIO::ImGuiIO()
IniSavingRate = 5.0f;
IniFilename = "imgui.ini";
LogFilename = "imgui_log.txt";
- Fonts = &GDefaultFontAtlas;
+ Fonts = &GImDefaultFontAtlas;
FontGlobalScale = 1.0f;
+ DisplayFramebufferScale = ImVec2(1.0f, 1.0f);
MousePos = ImVec2(-1,-1);
MousePosPrev = ImVec2(-1,-1);
MouseDoubleClickTime = 0.30f;
MouseDoubleClickMaxDist = 6.0f;
MouseDragThreshold = 6.0f;
+ for (int i = 0; i < IM_ARRAYSIZE(MouseDownDuration); i++)
+ MouseDownDuration[i] = MouseDownDurationPrev[i] = -1.0f;
+ for (int i = 0; i < IM_ARRAYSIZE(KeysDownDuration); i++)
+ KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f;
+ for (int i = 0; i < ImGuiKey_COUNT; i++)
+ KeyMap[i] = -1;
+ KeyRepeatDelay = 0.250f;
+ KeyRepeatRate = 0.050f;
UserData = NULL;
// User functions
@@ -659,80 +739,61 @@ ImGuiIO::ImGuiIO()
// - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
void ImGuiIO::AddInputCharacter(ImWchar c)
{
- const size_t n = ImStrlenW(InputCharacters);
- if (n + 1 < sizeof(InputCharacters) / sizeof(InputCharacters[0]))
+ const int n = ImStrlenW(InputCharacters);
+ if (n + 1 < IM_ARRAYSIZE(InputCharacters))
{
InputCharacters[n] = c;
- InputCharacters[n+1] = 0;
+ InputCharacters[n+1] = '\0';
}
}
+void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
+{
+ // We can't pass more wchars than ImGuiIO::InputCharacters[] can hold so don't convert more
+ const int wchars_buf_len = sizeof(ImGuiIO::InputCharacters) / sizeof(ImWchar);
+ ImWchar wchars[wchars_buf_len];
+ ImTextStrFromUtf8(wchars, wchars_buf_len, utf8_chars, NULL);
+ for (int i = 0; wchars[i] != 0 && i < wchars_buf_len; i++)
+ AddInputCharacter(wchars[i]);
+}
+
//-----------------------------------------------------------------------------
-// Helpers
+// HELPERS
//-----------------------------------------------------------------------------
-#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
-
-#undef PI
-const float PI = 3.14159265358979323846f;
-
-#ifdef INT_MAX
-#define IM_INT_MIN INT_MIN
-#define IM_INT_MAX INT_MAX
-#else
#define IM_INT_MIN (-2147483647-1)
#define IM_INT_MAX (2147483647)
-#endif
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
-#ifdef _MSC_VER
-#define STR_NEWLINE "\r\n"
+#ifdef _WIN32
+#define IM_NEWLINE "\r\n"
#else
-#define STR_NEWLINE "\n"
+#define IM_NEWLINE "\n"
#endif
-// Math bits
-// We are keeping those static in the .cpp file so as not to leak them outside, in the case the user has implicit cast operators between ImVec2 and its own types.
-static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x*rhs, lhs.y*rhs); }
-//static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x/rhs, lhs.y/rhs); }
-static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); }
-static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); }
-static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2 rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); }
-static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2 rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); }
-static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
-static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
-static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
-//static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
-
-static inline int ImMin(int lhs, int rhs) { return lhs < rhs ? lhs : rhs; }
-static inline int ImMax(int lhs, int rhs) { return lhs >= rhs ? lhs : rhs; }
-static inline float ImMin(float lhs, float rhs) { return lhs < rhs ? lhs : rhs; }
-static inline float ImMax(float lhs, float rhs) { return lhs >= rhs ? lhs : rhs; }
-static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMin(lhs.x,rhs.x), ImMin(lhs.y,rhs.y)); }
-static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMax(lhs.x,rhs.x), ImMax(lhs.y,rhs.y)); }
-static inline int ImClamp(int v, int mn, int mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
-static inline float ImClamp(float v, float mn, float mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
-static 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)); }
-static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
-static inline float ImLerp(float a, float b, float t) { return a + (b - a) * t; }
-static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
-static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; }
-
-static int ImStricmp(const char* str1, const char* str2)
+bool ImIsPointInTriangle(const ImVec2& p, const ImVec2& a, const ImVec2& b, const ImVec2& c)
+{
+ bool b1 = ((p.x - b.x) * (a.y - b.y) - (p.y - b.y) * (a.x - b.x)) < 0.0f;
+ bool b2 = ((p.x - c.x) * (b.y - c.y) - (p.y - c.y) * (b.x - c.x)) < 0.0f;
+ bool b3 = ((p.x - a.x) * (c.y - a.y) - (p.y - a.y) * (c.x - a.x)) < 0.0f;
+ return ((b1 == b2) && (b2 == b3));
+}
+
+int ImStricmp(const char* str1, const char* str2)
{
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
return d;
}
-static int ImStrnicmp(const char* str1, const char* str2, int count)
+int ImStrnicmp(const char* str1, const char* str2, int count)
{
int d = 0;
while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
return d;
}
-static char* ImStrdup(const char *str)
+char* ImStrdup(const char *str)
{
char *buff = (char*)ImGui::MemAlloc(strlen(str) + 1);
IM_ASSERT(buff);
@@ -740,20 +801,27 @@ static char* ImStrdup(const char *str)
return buff;
}
-static size_t ImStrlenW(const ImWchar* str)
+int ImStrlenW(const ImWchar* str)
{
- size_t n = 0;
+ int n = 0;
while (*str++) n++;
return n;
}
-static const char* ImStristr(const char* haystack, const char* needle, const char* needle_end)
+const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin) // find beginning-of-line
+{
+ while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n')
+ buf_mid_line--;
+ return buf_mid_line;
+}
+
+const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end)
{
if (!needle_end)
needle_end = needle + strlen(needle);
const char un0 = (char)toupper(*needle);
- while (*haystack)
+ while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
{
if (toupper(*haystack) == un0)
{
@@ -769,32 +837,49 @@ static const char* ImStristr(const char* haystack, const char* needle, const cha
return NULL;
}
-// Pass data_size==0 for zero-terminated string
-// Try to replace with FNV1a hash?
-static ImU32 ImHash(const void* data, size_t data_size, ImU32 seed = 0)
-{
+int ImFormatString(char* buf, int buf_size, const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ int w = vsnprintf(buf, buf_size, fmt, args);
+ va_end(args);
+ buf[buf_size-1] = 0;
+ return (w == -1) ? buf_size : w;
+}
+
+int ImFormatStringV(char* buf, int buf_size, const char* fmt, va_list args)
+{
+ int w = vsnprintf(buf, buf_size, fmt, args);
+ buf[buf_size-1] = 0;
+ return (w == -1) ? buf_size : w;
+}
+
+// Pass data_size==0 for zero-terminated strings
+// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements.
+ImU32 ImHash(const void* data, int data_size, ImU32 seed)
+{
static ImU32 crc32_lut[256] = { 0 };
if (!crc32_lut[1])
{
const ImU32 polynomial = 0xEDB88320;
- for (ImU32 i = 0; i < 256; i++)
- {
- ImU32 crc = i;
- for (ImU32 j = 0; j < 8; j++)
- crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
- crc32_lut[i] = crc;
+ for (ImU32 i = 0; i < 256; i++)
+ {
+ ImU32 crc = i;
+ for (ImU32 j = 0; j < 8; j++)
+ crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
+ crc32_lut[i] = crc;
}
}
seed = ~seed;
- ImU32 crc = seed;
+ ImU32 crc = seed;
const unsigned char* current = (const unsigned char*)data;
if (data_size > 0)
{
// Known size
- while (data_size--)
- crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
+ while (data_size--)
+ crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
}
else
{
@@ -803,7 +888,7 @@ static ImU32 ImHash(const void* data, size_t data_size, ImU32 seed = 0)
{
// We support a syntax of "label###id" where only "###id" is included in the hash, and only "label" gets displayed.
// Because this syntax is rarely used we are optimizing for the common case.
- // - If we reach ### in the string we discard the hash so far and reset to the seed.
+ // - If we reach ### in the string we discard the hash so far and reset to the seed.
// - We don't do 'current += 2; continue;' after handling ### to keep the code smaller.
if (c == '#' && current[0] == '#' && current[1] == '#')
crc = seed;
@@ -811,24 +896,189 @@ static ImU32 ImHash(const void* data, size_t data_size, ImU32 seed = 0)
crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
}
}
- return ~crc;
-}
+ return ~crc;
+}
+
+//-----------------------------------------------------------------------------
+// ImText* helpers
+//-----------------------------------------------------------------------------
-static size_t ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
+// Convert UTF-8 to 32-bits character, process single character input.
+// Based on stb_from_utf8() from github.com/nothings/stb/
+// We handle UTF-8 decoding error by skipping forward.
+int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end)
{
- va_list args;
- va_start(args, fmt);
- int w = vsnprintf(buf, buf_size, fmt, args);
- va_end(args);
- buf[buf_size-1] = 0;
- return (w == -1) ? buf_size : (size_t)w;
+ unsigned int c = (unsigned int)-1;
+ const unsigned char* str = (const unsigned char*)in_text;
+ if (!(*str & 0x80))
+ {
+ c = (unsigned int)(*str++);
+ *out_char = c;
+ return 1;
+ }
+ if ((*str & 0xe0) == 0xc0)
+ {
+ *out_char = 0xFFFD; // will be invalid but not end of string
+ if (in_text_end && in_text_end - (const char*)str < 2) return 1;
+ if (*str < 0xc2) return 2;
+ c = (unsigned int)((*str++ & 0x1f) << 6);
+ if ((*str & 0xc0) != 0x80) return 2;
+ c += (*str++ & 0x3f);
+ *out_char = c;
+ return 2;
+ }
+ if ((*str & 0xf0) == 0xe0)
+ {
+ *out_char = 0xFFFD; // will be invalid but not end of string
+ if (in_text_end && in_text_end - (const char*)str < 3) return 1;
+ if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3;
+ if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below
+ c = (unsigned int)((*str++ & 0x0f) << 12);
+ if ((*str & 0xc0) != 0x80) return 3;
+ c += (unsigned int)((*str++ & 0x3f) << 6);
+ if ((*str & 0xc0) != 0x80) return 3;
+ c += (*str++ & 0x3f);
+ *out_char = c;
+ return 3;
+ }
+ if ((*str & 0xf8) == 0xf0)
+ {
+ *out_char = 0xFFFD; // will be invalid but not end of string
+ if (in_text_end && in_text_end - (const char*)str < 4) return 1;
+ if (*str > 0xf4) return 4;
+ if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 4;
+ if (*str == 0xf4 && str[1] > 0x8f) return 4; // str[1] < 0x80 is checked below
+ c = (unsigned int)((*str++ & 0x07) << 18);
+ if ((*str & 0xc0) != 0x80) return 4;
+ c += (unsigned int)((*str++ & 0x3f) << 12);
+ if ((*str & 0xc0) != 0x80) return 4;
+ c += (unsigned int)((*str++ & 0x3f) << 6);
+ if ((*str & 0xc0) != 0x80) return 4;
+ c += (*str++ & 0x3f);
+ // utf-8 encodings of values used in surrogate pairs are invalid
+ if ((c & 0xFFFFF800) == 0xD800) return 4;
+ *out_char = c;
+ return 4;
+ }
+ *out_char = 0;
+ return 0;
}
-static size_t ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args)
+int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
{
- int w = vsnprintf(buf, buf_size, fmt, args);
- buf[buf_size-1] = 0;
- return (w == -1) ? buf_size : (size_t)w;
+ ImWchar* buf_out = buf;
+ ImWchar* buf_end = buf + buf_size;
+ while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
+ {
+ unsigned int c;
+ in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
+ if (c == 0)
+ break;
+ if (c < 0x10000) // FIXME: Losing characters that don't fit in 2 bytes
+ *buf_out++ = (ImWchar)c;
+ }
+ *buf_out = 0;
+ if (in_text_remaining)
+ *in_text_remaining = in_text;
+ return (int)(buf_out - buf);
+}
+
+int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
+{
+ int char_count = 0;
+ while ((!in_text_end || in_text < in_text_end) && *in_text)
+ {
+ unsigned int c;
+ in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
+ if (c == 0)
+ break;
+ if (c < 0x10000)
+ char_count++;
+ }
+ return char_count;
+}
+
+// Based on stb_to_utf8() from github.com/nothings/stb/
+static inline int ImTextCharToUtf8(char* buf, int buf_size, unsigned int c)
+{
+ if (c < 0x80)
+ {
+ buf[0] = (char)c;
+ return 1;
+ }
+ if (c < 0x800)
+ {
+ if (buf_size < 2) return 0;
+ buf[0] = (char)(0xc0 + (c >> 6));
+ buf[1] = (char)(0x80 + (c & 0x3f));
+ return 2;
+ }
+ if (c >= 0xdc00 && c < 0xe000)
+ {
+ return 0;
+ }
+ if (c >= 0xd800 && c < 0xdc00)
+ {
+ if (buf_size < 4) return 0;
+ buf[0] = (char)(0xf0 + (c >> 18));
+ buf[1] = (char)(0x80 + ((c >> 12) & 0x3f));
+ buf[2] = (char)(0x80 + ((c >> 6) & 0x3f));
+ buf[3] = (char)(0x80 + ((c ) & 0x3f));
+ return 4;
+ }
+ //else if (c < 0x10000)
+ {
+ if (buf_size < 3) return 0;
+ buf[0] = (char)(0xe0 + (c >> 12));
+ buf[1] = (char)(0x80 + ((c>> 6) & 0x3f));
+ buf[2] = (char)(0x80 + ((c ) & 0x3f));
+ return 3;
+ }
+}
+
+static inline int ImTextCountUtf8BytesFromChar(unsigned int c)
+{
+ if (c < 0x80) return 1;
+ if (c < 0x800) return 2;
+ if (c >= 0xdc00 && c < 0xe000) return 0;
+ if (c >= 0xd800 && c < 0xdc00) return 4;
+ return 3;
+}
+
+int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
+{
+ char* buf_out = buf;
+ const char* buf_end = buf + buf_size;
+ while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
+ {
+ unsigned int c = (unsigned int)(*in_text++);
+ if (c < 0x80)
+ *buf_out++ = (char)c;
+ else
+ buf_out += ImTextCharToUtf8(buf_out, (int)(buf_end-buf_out-1), c);
+ }
+ *buf_out = 0;
+ return (int)(buf_out - buf);
+}
+
+int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
+{
+ int bytes_count = 0;
+ while ((!in_text_end || in_text < in_text_end) && *in_text)
+ {
+ unsigned int c = (unsigned int)(*in_text++);
+ if (c < 0x80)
+ bytes_count++;
+ else
+ bytes_count += ImTextCountUtf8BytesFromChar(c);
+ }
+ return bytes_count;
+}
+
+ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in)
+{
+ float s = 1.0f/255.0f;
+ return ImVec4((in & 0xFF) * s, ((in >> 8) & 0xFF) * s, ((in >> 16) & 0xFF) * s, (in >> 24) * s);
}
ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
@@ -865,7 +1115,7 @@ void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float&
// Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593
// also http://en.wikipedia.org/wiki/HSL_and_HSV
void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b)
-{
+{
if (s == 0.0f)
{
// gray
@@ -893,484 +1143,48 @@ void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float&
// Load file content into memory
// Memory allocated with ImGui::MemAlloc(), must be freed by user using ImGui::MemFree()
-static bool ImLoadFileToMemory(const char* filename, const char* file_open_mode, void** out_file_data, size_t* out_file_size, size_t padding_bytes)
+void* ImLoadFileToMemory(const char* filename, const char* file_open_mode, int* out_file_size, int padding_bytes)
{
- IM_ASSERT(filename && file_open_mode && out_file_data && out_file_size);
- *out_file_data = NULL;
- *out_file_size = 0;
+ IM_ASSERT(filename && file_open_mode);
+ if (out_file_size)
+ *out_file_size = 0;
FILE* f;
if ((f = fopen(filename, file_open_mode)) == NULL)
- return false;
+ return NULL;
long file_size_signed;
if (fseek(f, 0, SEEK_END) || (file_size_signed = ftell(f)) == -1 || fseek(f, 0, SEEK_SET))
{
fclose(f);
- return false;
+ return NULL;
}
- size_t file_size = (size_t)file_size_signed;
+ int file_size = (int)file_size_signed;
void* file_data = ImGui::MemAlloc(file_size + padding_bytes);
if (file_data == NULL)
{
fclose(f);
- return false;
+ return NULL;
}
- if (fread(file_data, 1, file_size, f) != file_size)
+ if (fread(file_data, 1, (size_t)file_size, f) != (size_t)file_size)
{
fclose(f);
ImGui::MemFree(file_data);
- return false;
+ return NULL;
}
if (padding_bytes > 0)
memset((void *)(((char*)file_data) + file_size), 0, padding_bytes);
fclose(f);
- *out_file_data = file_data;
- *out_file_size = file_size;
+ if (out_file_size)
+ *out_file_size = file_size;
- return true;
+ return file_data;
}
//-----------------------------------------------------------------------------
-
-enum ImGuiButtonFlags_
-{
- ImGuiButtonFlags_Repeat = (1 << 0),
- ImGuiButtonFlags_PressedOnClick = (1 << 1),
- ImGuiButtonFlags_FlattenChilds = (1 << 2)
-};
-
-struct ImGuiColMod // Color modifier, backup of modified data so we can restore it
-{
- ImGuiCol Col;
- ImVec4 PreviousValue;
-};
-
-struct ImGuiStyleMod // Style modifier, backup of modified data so we can restore it
-{
- ImGuiStyleVar Var;
- ImVec2 PreviousValue;
-};
-
-struct ImRect // 2D axis aligned bounding-box
-{
- ImVec2 Min;
- ImVec2 Max;
-
- ImRect() { Min = ImVec2(FLT_MAX,FLT_MAX); Max = ImVec2(-FLT_MAX,-FLT_MAX); }
- ImRect(const ImVec2& min, const ImVec2& max) { Min = min; Max = max; }
- ImRect(const ImVec4& v) { Min.x = v.x; Min.y = v.y; Max.x = v.z; Max.y = v.w; }
- ImRect(float x1, float y1, float x2, float y2) { Min.x = x1; Min.y = y1; Max.x = x2; Max.y = y2; }
-
- ImVec2 GetCenter() const { return Min + (Max-Min)*0.5f; }
- ImVec2 GetSize() const { return Max-Min; }
- float GetWidth() const { return (Max-Min).x; }
- float GetHeight() const { return (Max-Min).y; }
- ImVec2 GetTL() const { return Min; }
- ImVec2 GetTR() const { return ImVec2(Max.x,Min.y); }
- ImVec2 GetBL() const { return ImVec2(Min.x,Max.y); }
- ImVec2 GetBR() const { return Max; }
- bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
- bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x < Max.x && r.Max.y < Max.y; }
- bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
- void Add(const ImVec2& rhs) { Min.x = ImMin(Min.x, rhs.x); Min.y = ImMin(Min.y, rhs.y); Max.x = ImMax(Max.x, rhs.x); Max.y = ImMax(Max.x, rhs.x); }
- void Add(const ImRect& rhs) { Min.x = ImMin(Min.x, rhs.Min.x); Min.y = ImMin(Min.y, rhs.Min.y); Max.x = ImMax(Max.x, rhs.Max.x); Max.y = ImMax(Max.y, rhs.Max.y); }
- void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
- void Expand(const ImVec2& amount) { Min -= amount; Max += amount; }
- void Reduce(const ImVec2& amount) { Min += amount; Max -= amount; }
- void Clip(const ImRect& clip) { Min.x = ImMax(Min.x, clip.Min.x); Min.y = ImMax(Min.y, clip.Min.y); Max.x = ImMin(Max.x, clip.Max.x); Max.y = ImMin(Max.y, clip.Max.y); }
- ImVec2 GetClosestPoint(ImVec2 p, bool on_edge) const
- {
- if (!on_edge && Contains(p))
- return p;
- if (p.x > Max.x) p.x = Max.x;
- else if (p.x < Min.x) p.x = Min.x;
- if (p.y > Max.y) p.y = Max.y;
- else if (p.y < Min.y) p.y = Min.y;
- return p;
- }
-};
-typedef ImRect ImGuiAabb; // FIXME-OBSOLETE
-
-struct ImGuiGroupData
-{
- ImVec2 BackupCursorPos;
- ImVec2 BackupCursorMaxPos;
- float BackupColumnsStartX;
- float BackupCurrentLineHeight;
- float BackupCurrentLineTextBaseOffset;
- float BackupLogLinePosY;
-};
-
-// Temporary per-window data, reset at the beginning of the frame
-struct ImGuiDrawContext
-{
- ImVec2 CursorPos;
- ImVec2 CursorPosPrevLine;
- ImVec2 CursorStartPos;
- ImVec2 CursorMaxPos; // Implicitly calculate the size of our contents, always extending. Saved into window->SizeContents at the end of the frame
- float CurrentLineHeight;
- float CurrentLineTextBaseOffset;
- float PrevLineHeight;
- float PrevLineTextBaseOffset;
- float LogLinePosY;
- int TreeDepth;
- ImGuiID LastItemID;
- ImRect LastItemRect;
- bool LastItemHoveredAndUsable;
- bool LastItemHoveredRect;
- ImVector<ImGuiWindow*> ChildWindows;
- ImVector<bool> AllowKeyboardFocus;
- ImVector<float> ItemWidth; // 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
- ImVector<float> TextWrapPos;
- ImVector<ImGuiGroupData> GroupStack;
- ImGuiColorEditMode ColorEditMode;
- ImGuiStorage* StateStorage;
- int StackSizesBackup[5]; // store size of various stacks for asserting
-
- float ColumnsStartX; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
- 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.
- int ColumnsCurrent;
- int ColumnsCount;
- ImVec2 ColumnsStartPos;
- float ColumnsCellMinY;
- float ColumnsCellMaxY;
- bool ColumnsShowBorders;
- ImGuiID ColumnsSetID;
- ImVector<float> ColumnsOffsetsT; // Columns offset normalized 0.0 (far left) -> 1.0 (far right)
-
- ImGuiDrawContext()
- {
- CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos = ImVec2(0.0f, 0.0f);
- CurrentLineHeight = PrevLineHeight = 0.0f;
- CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
- LogLinePosY = -1.0f;
- TreeDepth = 0;
- LastItemID = 0;
- LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f);
- LastItemHoveredAndUsable = LastItemHoveredRect = false;
- ColorEditMode = ImGuiColorEditMode_RGB;
- StateStorage = NULL;
- memset(StackSizesBackup, 0, sizeof(StackSizesBackup));
-
- ColumnsStartX = 0.0f;
- ColumnsOffsetX = 0.0f;
- ColumnsCurrent = 0;
- ColumnsCount = 1;
- ColumnsStartPos = ImVec2(0.0f, 0.0f);
- ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
- ColumnsShowBorders = true;
- ColumnsSetID = 0;
- }
-};
-
-// Internal state of the currently focused/edited text input box
-struct ImGuiTextEditState
-{
- ImGuiID Id; // widget id owning the text state
- ImWchar Text[1024]; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
- char InitialText[1024*3+1]; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
- size_t CurLenA, CurLenW; // we need to maintain our buffer length in both UTF-8 and wchar format.
- size_t BufSizeA; // end-user buffer size, <= 1024 (or increase above)
- float Width; // widget width
- float ScrollX;
- STB_TexteditState StbState;
- float CursorAnim;
- ImVec2 InputCursorScreenPos; // Cursor position in screen space to be used by IME callback.
- bool SelectedAllMouseLock;
- ImFont* Font;
- float FontSize;
-
- ImGuiTextEditState() { memset(this, 0, sizeof(*this)); }
-
- void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
- bool CursorIsVisible() const { return CursorAnim <= 0.0f || fmodf(CursorAnim, 1.20f) <= 0.80f; } // Blinking
- bool HasSelection() const { return StbState.select_start != StbState.select_end; }
- void SelectAll() { StbState.select_start = 0; StbState.select_end = (int)ImStrlenW(Text); StbState.cursor = StbState.select_end; StbState.has_preferred_x = false; }
-
- void OnKeyPressed(int key);
- void UpdateScrollOffset();
- ImVec2 CalcDisplayOffsetFromCharIdx(int i) const;
-
- // Static functions because they are used to render non-focused instances of a text input box
- static const char* GetTextPointerClippedA(ImFont* font, float font_size, const char* text, float width, ImVec2* out_text_size = NULL);
- static const ImWchar* GetTextPointerClippedW(ImFont* font, float font_size, const ImWchar* text, float width, ImVec2* out_text_size = NULL);
- static void RenderTextScrolledClipped(ImFont* font, float font_size, const char* text, ImVec2 pos_base, float width, float scroll_x);
-};
-
-// Data saved in imgui.ini file
-struct ImGuiIniData
-{
- char* Name;
- ImGuiID ID;
- ImVec2 Pos;
- ImVec2 Size;
- bool Collapsed;
-
- ImGuiIniData() { memset(this, 0, sizeof(*this)); }
- ~ImGuiIniData() { if (Name) { ImGui::MemFree(Name); Name = NULL; } }
-};
-
-struct ImGuiMouseCursorData
-{
- ImGuiMouseCursor Type;
- ImVec2 Offset;
- ImVec2 Size;
- ImVec2 TexUvMin[2];
- ImVec2 TexUvMax[2];
-};
-
-// Main state for ImGui
-struct ImGuiState
-{
- bool Initialized;
- ImGuiIO IO;
- ImGuiStyle Style;
- ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
- float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize()
- float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Size of characters.
- ImVec2 FontTexUvWhitePixel; // (Shortcut) == Font->TexUvForWhite
-
- float Time;
- int FrameCount;
- int FrameCountRendered;
- ImVector<ImGuiWindow*> Windows;
- ImVector<ImGuiWindow*> WindowsSortBuffer;
- ImGuiWindow* CurrentWindow; // Being drawn into
- ImVector<ImGuiWindow*> CurrentWindowStack;
- int CurrentPopupStackSize;
- ImGuiWindow* FocusedWindow; // Will catch keyboard inputs
- ImGuiWindow* HoveredWindow; // Will catch mouse inputs
- ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only)
- ImGuiID HoveredId; // Hovered widget
- ImGuiID ActiveId; // Active widget
- ImGuiID ActiveIdPreviousFrame;
- bool ActiveIdIsAlive;
- bool ActiveIdIsJustActivated; // Set when
- bool ActiveIdIsFocusedOnly; // Set only by active widget. Denote focus but no active interaction.
- ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window. Only valid if ActiveID is the "#MOVE" identifier of a window.
- float SettingsDirtyTimer;
- ImVector<ImGuiIniData*> Settings;
- int DisableHideTextAfterDoubleHash;
- ImVector<ImGuiColMod> ColorModifiers;
- ImVector<ImGuiStyleMod> StyleModifiers;
- ImVector<ImFont*> FontStack;
-
- ImVec2 SetNextWindowPosVal;
- ImGuiSetCond SetNextWindowPosCond;
- ImVec2 SetNextWindowSizeVal;
- ImGuiSetCond SetNextWindowSizeCond;
- bool SetNextWindowCollapsedVal;
- ImGuiSetCond SetNextWindowCollapsedCond;
- bool SetNextWindowFocus;
- bool SetNextTreeNodeOpenedVal;
- ImGuiSetCond SetNextTreeNodeOpenedCond;
-
- // Render
- ImVector<ImDrawList*> RenderDrawLists[3];
-
- // Mouse cursor
- ImGuiMouseCursor MouseCursor;
- ImDrawList MouseCursorDrawList; // Optional software render of mouse cursors, if io.MouseDrawCursor is set
- ImGuiMouseCursorData MouseCursorData[ImGuiMouseCursor_Count_];
-
- // Widget state
- ImGuiTextEditState InputTextState;
- ImGuiID ScalarAsInputTextId; // Temporary text input when CTRL+clicking on a slider, etc.
- ImGuiStorage ColorEditModeStorage; // for user selection
- ImGuiID ActiveComboID;
- ImVec2 ActiveClickDeltaToCenter;
- float DragCurrentValue; // current dragged value, always float, not rounded by end-user precision settings
- ImVec2 DragLastMouseDelta;
- float DragSpeedDefaultRatio; // if speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
- float DragSpeedScaleSlow;
- float DragSpeedScaleFast;
- float ScrollbarClickDeltaToGrabCenter; // distance between mouse and center of grab box, normalized in parent space
- char Tooltip[1024];
- char* PrivateClipboard; // if no custom clipboard handler is defined
-
- // Logging
- bool LogEnabled;
- FILE* LogFile;
- ImGuiTextBuffer* LogClipboard; // pointer so our GImGui static constructor doesn't call heap allocators.
- int LogStartDepth;
- int LogAutoExpandMaxDepth;
-
- // Misc
- float FramerateSecPerFrame[120]; // calculate estimate of framerate for user
- int FramerateSecPerFrameIdx;
- float FramerateSecPerFrameAccum;
- char TempBuffer[1024*3+1]; // temporary text buffer
-
- ImGuiState()
- {
- Initialized = false;
- Font = NULL;
- FontBaseSize = FontSize = 0.0f;
- FontTexUvWhitePixel = ImVec2(0.0f, 0.0f);
-
- Time = 0.0f;
- FrameCount = 0;
- FrameCountRendered = -1;
- CurrentWindow = NULL;
- CurrentPopupStackSize = 0;
- FocusedWindow = NULL;
- HoveredWindow = NULL;
- HoveredRootWindow = NULL;
- HoveredId = 0;
- ActiveId = 0;
- ActiveIdPreviousFrame = 0;
- ActiveIdIsAlive = false;
- ActiveIdIsJustActivated = false;
- ActiveIdIsFocusedOnly = false;
- MovedWindow = NULL;
- SettingsDirtyTimer = 0.0f;
- DisableHideTextAfterDoubleHash = 0;
-
- SetNextWindowPosVal = ImVec2(0.0f, 0.0f);
- SetNextWindowPosCond = 0;
- SetNextWindowSizeVal = ImVec2(0.0f, 0.0f);
- SetNextWindowSizeCond = 0;
- SetNextWindowCollapsedVal = false;
- SetNextWindowCollapsedCond = 0;
- SetNextWindowFocus = false;
- SetNextTreeNodeOpenedVal = false;
- SetNextTreeNodeOpenedCond = 0;
-
- ScalarAsInputTextId = 0;
- ActiveComboID = 0;
- ActiveClickDeltaToCenter = ImVec2(0.0f, 0.0f);
- DragCurrentValue = 0.0f;
- DragLastMouseDelta = ImVec2(0.0f, 0.0f);
- DragSpeedDefaultRatio = 0.01f;
- DragSpeedScaleSlow = 0.01f;
- DragSpeedScaleFast = 10.0f;
- ScrollbarClickDeltaToGrabCenter = 0.0f;
- memset(Tooltip, 0, sizeof(Tooltip));
- PrivateClipboard = NULL;
-
- MouseCursor = ImGuiMouseCursor_Arrow;
-
- LogEnabled = false;
- LogFile = NULL;
- LogClipboard = NULL;
- LogStartDepth = 0;
- LogAutoExpandMaxDepth = 2;
-
- memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
- FramerateSecPerFrameIdx = 0;
- FramerateSecPerFrameAccum = 0.0f;
- }
-};
-
-static ImGuiState GImDefaultState; // Internal state storage
-static ImGuiState* GImGui = &GImDefaultState; // We access everything through this pointer. NB: this pointer is always assumed to be != NULL
-
-struct ImGuiWindow
-{
- char* Name;
- ImGuiID ID;
- ImGuiWindowFlags Flags;
- ImVec2 PosFloat;
- ImVec2 Pos; // Position rounded-up to nearest pixel
- ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
- ImVec2 SizeFull; // Size when non collapsed
- ImVec2 SizeContents; // Size of contents (== extents reach of the drawing cursor) from previous frame
- ImGuiID MoveID; // == window->GetID("#MOVE")
- float ScrollY;
- float NextScrollY;
- bool ScrollbarY;
- bool Active; // Set to true on Begin()
- bool WasActive;
- bool Accessed; // Set to true when any widget access the current window
- bool Collapsed; // Set when collapsing window to become only title-bar
- bool SkipItems; // == Visible && !Collapsed
- int AutoFitFrames;
- bool AutoFitOnlyGrows;
- int AutoPosLastDirection;
- int HiddenFrames;
- int SetWindowPosAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowPos() call will succeed with this particular flag.
- int SetWindowSizeAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowSize() call will succeed with this particular flag.
- int SetWindowCollapsedAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowCollapsed() call will succeed with this particular flag.
-
- ImGuiDrawContext DC; // Temporary per-window data, reset at the beginning of the frame
- ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
- ImVector<ImVec4> ClipRectStack; // Scissoring / clipping rectangle. x1, y1, x2, y2.
- ImRect ClippedRect; // = ClipRectStack.front() after setup in Begin()
- int LastFrameDrawn;
- float ItemWidthDefault;
- ImGuiStorage StateStorage;
- float FontWindowScale; // Scale multiplier per-window
- ImDrawList* DrawList;
- ImGuiWindow* RootWindow;
-
- // Focus
- int FocusIdxAllCounter; // Start at -1 and increase as assigned via FocusItemRegister()
- int FocusIdxTabCounter; // (same, but only count widgets which you can Tab through)
- int FocusIdxAllRequestCurrent; // Item being requested for focus
- int FocusIdxTabRequestCurrent; // Tab-able item being requested for focus
- int FocusIdxAllRequestNext; // Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
- int FocusIdxTabRequestNext; // "
-
-public:
- ImGuiWindow(const char* name);
- ~ImGuiWindow();
-
- ImGuiID GetID(const char* str, const char* str_end = NULL);
- ImGuiID GetID(const void* ptr);
-
- bool FocusItemRegister(bool is_active, bool tab_stop = true); // Return true if focus is requested
- void FocusItemUnregister();
-
- ImRect Rect() const { return ImRect(Pos, Pos+Size); }
- float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale; }
- float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0 : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; }
- ImRect TitleBarRect() const { return ImRect(Pos, Pos + ImVec2(SizeFull.x, TitleBarHeight())); }
- ImVec2 WindowPadding() const { return ((Flags & ImGuiWindowFlags_ChildWindow) && !(Flags & ImGuiWindowFlags_ShowBorders) && !(Flags & ImGuiWindowFlags_ComboBox)) ? ImVec2(0,0) : GImGui->Style.WindowPadding; }
- 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); }
- ImU32 Color(const ImVec4& col) const { ImVec4 c = col; c.w *= GImGui->Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
-};
-
-static inline ImGuiWindow* GetCurrentWindow()
-{
- // If this ever crash it probably means that ImGui::NewFrame() hasn't been called. We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
- ImGuiState& g = *GImGui;
- g.CurrentWindow->Accessed = true;
- return g.CurrentWindow;
-}
-
-static inline void SetCurrentWindow(ImGuiWindow* window)
-{
- ImGuiState& g = *GImGui;
- g.CurrentWindow = window;
- if (window)
- g.FontSize = window->CalcFontSize();
-}
-
-static inline ImGuiWindow* GetParentWindow()
-{
- ImGuiState& g = *GImGui;
- IM_ASSERT(g.CurrentWindowStack.size() >= 2);
- return g.CurrentWindowStack[g.CurrentWindowStack.size() - 2];
-}
-
-static void SetActiveId(ImGuiID id)
-{
- ImGuiState& g = *GImGui;
- g.ActiveId = id;
- g.ActiveIdIsFocusedOnly = false;
- g.ActiveIdIsJustActivated = true;
-}
-
-static void RegisterAliveId(ImGuiID id)
-{
- ImGuiState& g = *GImGui;
- if (g.ActiveId == id)
- g.ActiveIdIsAlive = true;
-}
-
+// ImGuiStorage
//-----------------------------------------------------------------------------
// Helper: Key->value storage
@@ -1451,8 +1265,7 @@ void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val)
return &it->val_p;
}
-// FIXME-OPT: Wasting CPU because all SetInt() are preceeded by GetInt() calls so we should have the result from lower_bound already in place.
-// However we only use SetInt() on explicit user action (so that's maximum once a frame) so the optimisation isn't much needed.
+// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
void ImGuiStorage::SetInt(ImU32 key, int val)
{
ImVector<Pair>::iterator it = LowerBound(Data, key);
@@ -1488,11 +1301,13 @@ void ImGuiStorage::SetVoidPtr(ImU32 key, void* val)
void ImGuiStorage::SetAllInt(int v)
{
- for (size_t i = 0; i < Data.size(); i++)
+ for (int i = 0; i < Data.Size; i++)
Data[i].val_i = v;
}
//-----------------------------------------------------------------------------
+// ImGuiTextFilter
+//-----------------------------------------------------------------------------
// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
ImGuiTextFilter::ImGuiTextFilter(const char* default_filter)
@@ -1509,14 +1324,16 @@ ImGuiTextFilter::ImGuiTextFilter(const char* default_filter)
}
}
-void ImGuiTextFilter::Draw(const char* label, float width)
+bool ImGuiTextFilter::Draw(const char* label, float width)
{
- if (width > 0.0f)
+ if (width != 0.0f)
ImGui::PushItemWidth(width);
- ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
- if (width > 0.0f)
+ bool value_changed = ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
+ if (width != 0.0f)
ImGui::PopItemWidth();
- Build();
+ if (value_changed)
+ Build();
+ return value_changed;
}
void ImGuiTextFilter::TextRange::split(char separator, ImVector<TextRange>& out)
@@ -1544,7 +1361,7 @@ void ImGuiTextFilter::Build()
input_range.split(',', Filters);
CountGrep = 0;
- for (size_t i = 0; i != Filters.size(); i++)
+ for (int i = 0; i != Filters.Size; i++)
{
Filters[i].trim_blanks();
if (Filters[i].empty())
@@ -1554,15 +1371,15 @@ void ImGuiTextFilter::Build()
}
}
-bool ImGuiTextFilter::PassFilter(const char* val) const
+bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
{
if (Filters.empty())
return true;
- if (val == NULL)
- val = "";
+ if (text == NULL)
+ text = "";
- for (size_t i = 0; i != Filters.size(); i++)
+ for (int i = 0; i != Filters.Size; i++)
{
const TextRange& f = Filters[i];
if (f.empty())
@@ -1570,13 +1387,13 @@ bool ImGuiTextFilter::PassFilter(const char* val) const
if (f.front() == '-')
{
// Subtract
- if (ImStristr(val, f.begin()+1, f.end()) != NULL)
+ if (ImStristr(text, text_end, f.begin()+1, f.end()) != NULL)
return false;
}
else
{
// Grep
- if (ImStristr(val, f.begin(), f.end()) != NULL)
+ if (ImStristr(text, text_end, f.begin(), f.end()) != NULL)
return true;
}
}
@@ -1589,8 +1406,10 @@ bool ImGuiTextFilter::PassFilter(const char* val) const
}
//-----------------------------------------------------------------------------
+// ImGuiTextBuffer
+//-----------------------------------------------------------------------------
-// On some platform vsnprintf() takes va_list by reference and modifies it.
+// On some platform vsnprintf() takes va_list by reference and modifies it.
// va_copy is the 'correct' way to copy a va_list but Visual Studio prior to 2013 doesn't have it.
#ifndef va_copy
#define va_copy(dest, src) (dest = src)
@@ -1606,16 +1425,16 @@ void ImGuiTextBuffer::appendv(const char* fmt, va_list args)
if (len <= 0)
return;
- const size_t write_off = Buf.size();
- const size_t needed_sz = write_off + (size_t)len;
- if (write_off + (size_t)len >= Buf.capacity())
+ const int write_off = Buf.Size;
+ const int needed_sz = write_off + len;
+ if (write_off + len >= Buf.Capacity)
{
- const size_t double_capacity = Buf.capacity() * 2;
+ int double_capacity = Buf.Capacity * 2;
Buf.reserve(needed_sz > double_capacity ? needed_sz : double_capacity);
}
Buf.resize(needed_sz);
- ImFormatStringV(&Buf[write_off] - 1, (size_t)len+1, fmt, args_copy);
+ ImFormatStringV(&Buf[write_off] - 1, len+1, fmt, args_copy);
}
void ImGuiTextBuffer::append(const char* fmt, ...)
@@ -1627,30 +1446,83 @@ void ImGuiTextBuffer::append(const char* fmt, ...)
}
//-----------------------------------------------------------------------------
+// ImGuiSimpleColumns
+//-----------------------------------------------------------------------------
+
+ImGuiSimpleColumns::ImGuiSimpleColumns()
+{
+ Count = 0;
+ Spacing = Width = NextWidth = 0.0f;
+ memset(Pos, 0, sizeof(Pos));
+ memset(NextWidths, 0, sizeof(NextWidths));
+}
+
+void ImGuiSimpleColumns::Update(int count, float spacing, bool clear)
+{
+ IM_ASSERT(Count <= IM_ARRAYSIZE(Pos));
+ Count = count;
+ Width = NextWidth = 0.0f;
+ Spacing = spacing;
+ if (clear) memset(NextWidths, 0, sizeof(NextWidths));
+ for (int i = 0; i < Count; i++)
+ {
+ if (i > 0 && NextWidths[i] > 0.0f)
+ Width += Spacing;
+ Pos[i] = (float)(int)Width;
+ Width += NextWidths[i];
+ NextWidths[i] = 0.0f;
+ }
+}
+
+float ImGuiSimpleColumns::DeclColumns(float w0, float w1, float w2) // not using va_arg because they promote float to double
+{
+ NextWidth = 0.0f;
+ NextWidths[0] = ImMax(NextWidths[0], w0);
+ NextWidths[1] = ImMax(NextWidths[1], w1);
+ NextWidths[2] = ImMax(NextWidths[2], w2);
+ for (int i = 0; i < 3; i++)
+ NextWidth += NextWidths[i] + ((i > 0 && NextWidths[i] > 0.0f) ? Spacing : 0.0f);
+ return ImMax(Width, NextWidth);
+}
+
+float ImGuiSimpleColumns::CalcExtraSpace(float avail_w)
+{
+ return ImMax(0.0f, avail_w - Width);
+}
+
+//-----------------------------------------------------------------------------
+// ImGuiWindow
+//-----------------------------------------------------------------------------
ImGuiWindow::ImGuiWindow(const char* name)
{
Name = ImStrdup(name);
- ID = ImHash(name, 0);
+ ID = ImHash(name, 0);
IDStack.push_back(ID);
MoveID = GetID("#MOVE");
Flags = 0;
PosFloat = Pos = ImVec2(0.0f, 0.0f);
Size = SizeFull = ImVec2(0.0f, 0.0f);
- SizeContents = ImVec2(0.0f, 0.0f);
- ScrollY = 0.0f;
- NextScrollY = 0.0f;
- ScrollbarY = false;
+ SizeContents = SizeContentsExplicit = ImVec2(0.0f, 0.0f);
+ WindowPadding = ImVec2(0.0f, 0.0f);
+ Scroll = ImVec2(0.0f, 0.0f);
+ ScrollTarget = ImVec2(FLT_MAX, FLT_MAX);
+ ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f);
+ ScrollbarX = ScrollbarY = false;
+ ScrollbarSizes = ImVec2(0.0f, 0.0f);
Active = WasActive = false;
Accessed = false;
Collapsed = false;
SkipItems = false;
- AutoFitFrames = -1;
+ BeginCount = 0;
+ PopupID = 0;
+ AutoFitFramesX = AutoFitFramesY = -1;
AutoFitOnlyGrows = false;
AutoPosLastDirection = -1;
HiddenFrames = 0;
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiSetCond_Always | ImGuiSetCond_Once | ImGuiSetCond_FirstUseEver | ImGuiSetCond_Appearing;
+ SetWindowPosCenterWanted = false;
LastFrameDrawn = -1;
ItemWidthDefault = 0.0f;
@@ -1658,7 +1530,9 @@ ImGuiWindow::ImGuiWindow(const char* name)
DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList));
new(DrawList) ImDrawList();
+ DrawList->_OwnerName = Name;
RootWindow = NULL;
+ RootNonPopupWindow = NULL;
FocusIdxAllCounter = FocusIdxTabCounter = -1;
FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = IM_INT_MAX;
@@ -1677,209 +1551,236 @@ ImGuiWindow::~ImGuiWindow()
ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
{
ImGuiID seed = IDStack.back();
- const ImGuiID id = ImHash(str, str_end ? str_end - str : 0, seed);
- RegisterAliveId(id);
+ ImGuiID id = ImHash(str, str_end ? (int)(str_end - str) : 0, seed);
+ ImGui::KeepAliveID(id);
return id;
}
ImGuiID ImGuiWindow::GetID(const void* ptr)
{
ImGuiID seed = IDStack.back();
- const ImGuiID id = ImHash(&ptr, sizeof(void*), seed);
- RegisterAliveId(id);
+ ImGuiID id = ImHash(&ptr, sizeof(void*), seed);
+ ImGui::KeepAliveID(id);
return id;
}
-bool ImGuiWindow::FocusItemRegister(bool is_active, bool tab_stop)
+//-----------------------------------------------------------------------------
+// Internal API exposed in imgui_internal.h
+//-----------------------------------------------------------------------------
+
+static void SetCurrentWindow(ImGuiWindow* window)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
-
- const bool allow_keyboard_focus = window->DC.AllowKeyboardFocus.back();
- FocusIdxAllCounter++;
- if (allow_keyboard_focus)
- FocusIdxTabCounter++;
+ g.CurrentWindow = window;
+ if (window)
+ g.FontSize = window->CalcFontSize();
+}
- // Process keyboard input at this point: TAB, Shift-TAB switch focus
- // We can always TAB out of a widget that doesn't allow tabbing in.
- if (tab_stop && FocusIdxAllRequestNext == IM_INT_MAX && FocusIdxTabRequestNext == IM_INT_MAX && is_active && IsKeyPressedMap(ImGuiKey_Tab))
- {
- // Modulo on index will be applied at the end of frame once we've got the total counter of items.
- FocusIdxTabRequestNext = FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1);
- }
+ImGuiWindow* ImGui::GetParentWindow()
+{
+ ImGuiState& g = *GImGui;
+ IM_ASSERT(g.CurrentWindowStack.Size >= 2);
+ return g.CurrentWindowStack[g.CurrentWindowStack.Size - 2];
+}
- if (FocusIdxAllCounter == FocusIdxAllRequestCurrent)
- return true;
+void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window = NULL)
+{
+ ImGuiState& g = *GImGui;
+ g.ActiveId = id;
+ g.ActiveIdAllowHoveringOthers = false;
+ g.ActiveIdIsJustActivated = true;
+ g.ActiveIdWindow = window;
+}
- if (allow_keyboard_focus)
- if (FocusIdxTabCounter == FocusIdxTabRequestCurrent)
- return true;
+void ImGui::SetHoveredID(ImGuiID id)
+{
+ ImGuiState& g = *GImGui;
+ g.HoveredId = id;
+ g.HoveredIdAllowHoveringOthers = false;
+}
- return false;
+void ImGui::KeepAliveID(ImGuiID id)
+{
+ ImGuiState& g = *GImGui;
+ if (g.ActiveId == id)
+ g.ActiveIdIsAlive = true;
}
-void ImGuiWindow::FocusItemUnregister()
+// Advance cursor given item size for layout.
+void ImGui::ItemSize(const ImVec2& size, float text_offset_y)
{
- FocusIdxAllCounter--;
- FocusIdxTabCounter--;
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return;
+
+ // Always align ourselves on pixel boundaries
+ ImGuiState& g = *GImGui;
+ const float line_height = ImMax(window->DC.CurrentLineHeight, size.y);
+ const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y);
+ window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y);
+ window->DC.CursorPos = ImVec2((float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX), (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y));
+ window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
+ window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
+
+ //window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, 0xFF0000FF, 4); // Debug
+
+ window->DC.PrevLineHeight = line_height;
+ window->DC.PrevLineTextBaseOffset = text_base_offset;
+ window->DC.CurrentLineHeight = window->DC.CurrentLineTextBaseOffset = 0.0f;
}
-static inline void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDrawList* draw_list)
+void ImGui::ItemSize(const ImRect& bb, float text_offset_y)
{
- if (!draw_list->commands.empty() && !draw_list->vtx_buffer.empty())
- {
- if (draw_list->commands.back().vtx_count == 0)
- draw_list->commands.pop_back();
- out_render_list.push_back(draw_list);
- GImGui->IO.MetricsRenderVertices += (int)draw_list->vtx_buffer.size();
- }
+ ItemSize(bb.GetSize(), text_offset_y);
}
-static void AddWindowToRenderList(ImVector<ImDrawList*>& out_render_list, ImGuiWindow* window)
+// Declare item bounding box for clipping and interaction.
+// Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface
+// declares their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd().
+bool ImGui::ItemAdd(const ImRect& bb, const ImGuiID* id)
{
- AddDrawListToRenderList(out_render_list, window->DrawList);
- for (size_t i = 0; i < window->DC.ChildWindows.size(); i++)
+ ImGuiWindow* window = GetCurrentWindow();
+ window->DC.LastItemID = id ? *id : 0;
+ window->DC.LastItemRect = bb;
+ if (IsClippedEx(bb, id, false))
{
- ImGuiWindow* child = window->DC.ChildWindows[i];
- if (child->Active) // clipped children may have been marked not active
- AddWindowToRenderList(out_render_list, child);
+ window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
+ return false;
}
-}
-//-----------------------------------------------------------------------------
+ // This is a sensible default, but widgets are free to override it after calling ItemAdd()
+ ImGuiState& g = *GImGui;
+ if (IsMouseHoveringRect(bb.Min, bb.Max))
+ {
+ // Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background)
+ // So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
+ window->DC.LastItemHoveredRect = true;
+ window->DC.LastItemHoveredAndUsable = false;
+ if (g.HoveredRootWindow == window->RootWindow)
+ if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdAllowHoveringOthers || (g.ActiveId == window->MoveID))
+ if (IsWindowContentHoverable(window))
+ window->DC.LastItemHoveredAndUsable = true;
+ }
+ else
+ {
+ window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
+ }
-void* ImGui::MemAlloc(size_t sz)
-{
- return GImGui->IO.MemAllocFn(sz);
+ return true;
}
-void ImGui::MemFree(void* ptr)
-{
- return GImGui->IO.MemFreeFn(ptr);
-}
-
-static ImGuiIniData* FindWindowSettings(const char* name)
+bool ImGui::IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged)
{
ImGuiState& g = *GImGui;
- ImGuiID id = ImHash(name, 0);
- for (size_t i = 0; i != g.Settings.size(); i++)
+ ImGuiWindow* window = GetCurrentWindowRead();
+
+ if (!bb.Overlaps(window->ClipRect))
{
- ImGuiIniData* ini = g.Settings[i];
- if (ini->ID == id)
- return ini;
+ if (!id || *id != GImGui->ActiveId)
+ if (clip_even_when_logged || !g.LogEnabled)
+ return true;
}
- return NULL;
+ return false;
}
-static ImGuiIniData* AddWindowSettings(const char* name)
+bool ImGui::IsHovered(const ImRect& bb, ImGuiID id, bool flatten_childs)
{
- ImGuiIniData* ini = (ImGuiIniData*)ImGui::MemAlloc(sizeof(ImGuiIniData));
- new(ini) ImGuiIniData();
- ini->Name = ImStrdup(name);
- ini->ID = ImHash(name, 0);
- ini->Collapsed = false;
- ini->Pos = ImVec2(FLT_MAX,FLT_MAX);
- ini->Size = ImVec2(0,0);
- GImGui->Settings.push_back(ini);
- return ini;
+ ImGuiState& g = *GImGui;
+ if (g.HoveredId == 0 || g.HoveredId == id || g.HoveredIdAllowHoveringOthers)
+ {
+ ImGuiWindow* window = GetCurrentWindowRead();
+ if (g.HoveredWindow == window || (flatten_childs && g.HoveredRootWindow == window->RootWindow))
+ if ((g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdAllowHoveringOthers) && ImGui::IsMouseHoveringRect(bb.Min, bb.Max))
+ if (IsWindowContentHoverable(g.HoveredRootWindow))
+ return true;
+ }
+ return false;
}
-// Zero-tolerance, poor-man .ini parsing
-// FIXME: Write something less rubbish
-static void LoadSettings()
+bool ImGui::FocusableItemRegister(ImGuiWindow* window, bool is_active, bool tab_stop)
{
ImGuiState& g = *GImGui;
- const char* filename = g.IO.IniFilename;
- if (!filename)
- return;
- char* file_data;
- size_t file_size;
- if (!ImLoadFileToMemory(filename, "rb", (void**)&file_data, &file_size, 1))
- return;
+ const bool allow_keyboard_focus = window->DC.AllowKeyboardFocus;
+ window->FocusIdxAllCounter++;
+ if (allow_keyboard_focus)
+ window->FocusIdxTabCounter++;
- ImGuiIniData* settings = NULL;
- const char* buf_end = file_data + file_size;
- for (const char* line_start = file_data; line_start < buf_end; )
+ // Process keyboard input at this point: TAB, Shift-TAB switch focus
+ // We can always TAB out of a widget that doesn't allow tabbing in.
+ if (tab_stop && window->FocusIdxAllRequestNext == IM_INT_MAX && window->FocusIdxTabRequestNext == IM_INT_MAX && is_active && IsKeyPressedMap(ImGuiKey_Tab))
{
- const char* line_end = line_start;
- while (line_end < buf_end && *line_end != '\n' && *line_end != '\r')
- line_end++;
-
- if (line_start[0] == '[' && line_end > line_start && line_end[-1] == ']')
- {
- char name[64];
- ImFormatString(name, IM_ARRAYSIZE(name), "%.*s", line_end-line_start-2, line_start+1);
- settings = FindWindowSettings(name);
- if (!settings)
- settings = AddWindowSettings(name);
- }
- else if (settings)
- {
- float x, y;
- int i;
- if (sscanf(line_start, "Pos=%f,%f", &x, &y) == 2)
- settings->Pos = ImVec2(x, y);
- else if (sscanf(line_start, "Size=%f,%f", &x, &y) == 2)
- settings->Size = ImMax(ImVec2(x, y), g.Style.WindowMinSize);
- else if (sscanf(line_start, "Collapsed=%d", &i) == 1)
- settings->Collapsed = (i != 0);
- }
-
- line_start = line_end+1;
+ // Modulo on index will be applied at the end of frame once we've got the total counter of items.
+ window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1);
}
- ImGui::MemFree(file_data);
+ if (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent)
+ return true;
+
+ if (allow_keyboard_focus)
+ if (window->FocusIdxTabCounter == window->FocusIdxTabRequestCurrent)
+ return true;
+
+ return false;
}
-static void SaveSettings()
+void ImGui::FocusableItemUnregister(ImGuiWindow* window)
+{
+ window->FocusIdxAllCounter--;
+ window->FocusIdxTabCounter--;
+}
+
+ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_x, float default_y)
{
ImGuiState& g = *GImGui;
- const char* filename = g.IO.IniFilename;
- if (!filename)
- return;
+ ImVec2 content_max;
+ if (size.x < 0.0f || size.y < 0.0f)
+ content_max = g.CurrentWindow->Pos + ImGui::GetContentRegionMax();
+ if (size.x <= 0.0f)
+ size.x = (size.x == 0.0f) ? default_x : ImMax(content_max.x - g.CurrentWindow->DC.CursorPos.x, 4.0f) + size.x;
+ if (size.y <= 0.0f)
+ size.y = (size.y == 0.0f) ? default_y : ImMax(content_max.y - g.CurrentWindow->DC.CursorPos.y, 4.0f) + size.y;
+ return size;
+}
- // Gather data from windows that were active during this session
- for (size_t i = 0; i != g.Windows.size(); i++)
- {
- ImGuiWindow* window = g.Windows[i];
- if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
- continue;
- ImGuiIniData* settings = FindWindowSettings(window->Name);
- settings->Pos = window->Pos;
- settings->Size = window->SizeFull;
- settings->Collapsed = window->Collapsed;
- }
+float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
+{
+ if (wrap_pos_x < 0.0f)
+ return 0.0f;
- // Write .ini file
- // If a window wasn't opened in this session we preserve its settings
- FILE* f = fopen(filename, "wt");
- if (!f)
- return;
- for (size_t i = 0; i != g.Settings.size(); i++)
- {
- const ImGuiIniData* settings = g.Settings[i];
- if (settings->Pos.x == FLT_MAX)
- continue;
- const char* name = settings->Name;
- if (const char* p = strstr(name, "###")) // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
- name = p;
- fprintf(f, "[%s]\n", name);
- fprintf(f, "Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y);
- fprintf(f, "Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y);
- fprintf(f, "Collapsed=%d\n", settings->Collapsed);
- fprintf(f, "\n");
- }
+ ImGuiWindow* window = GetCurrentWindowRead();
+ if (wrap_pos_x == 0.0f)
+ wrap_pos_x = ImGui::GetContentRegionMax().x + window->Pos.x;
+ else if (wrap_pos_x > 0.0f)
+ wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space
- fclose(f);
+ const float wrap_width = wrap_pos_x > 0.0f ? ImMax(wrap_pos_x - pos.x, 0.00001f) : 0.0f;
+ return wrap_width;
}
-static void MarkSettingsDirty()
+//-----------------------------------------------------------------------------
+
+void* ImGui::MemAlloc(size_t sz)
{
- ImGuiState& g = *GImGui;
+ GImGui->IO.MetricsAllocs++;
+ return GImGui->IO.MemAllocFn(sz);
+}
- if (g.SettingsDirtyTimer <= 0.0f)
- g.SettingsDirtyTimer = g.IO.IniSavingRate;
+void ImGui::MemFree(void* ptr)
+{
+ if (ptr) GImGui->IO.MetricsAllocs--;
+ return GImGui->IO.MemFreeFn(ptr);
+}
+
+const char* ImGui::GetClipboardText()
+{
+ return GImGui->IO.GetClipboardTextFn ? GImGui->IO.GetClipboardTextFn() : "";
+}
+
+void ImGui::SetClipboardText(const char* text)
+{
+ if (GImGui->IO.SetClipboardTextFn)
+ GImGui->IO.SetClipboardTextFn(text);
}
const char* ImGui::GetVersion()
@@ -1903,7 +1804,6 @@ void ImGui::SetInternalState(void* state, bool construct)
{
if (construct)
new (state) ImGuiState();
-
GImGui = (ImGuiState*)state;
}
@@ -1917,16 +1817,32 @@ ImGuiStyle& ImGui::GetStyle()
return GImGui->Style;
}
+// Same value as passed to your RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
+ImDrawData* ImGui::GetDrawData()
+{
+ return GImGui->RenderDrawData.Valid ? &GImGui->RenderDrawData : NULL;
+}
+
+float ImGui::GetTime()
+{
+ return GImGui->Time;
+}
+
+int ImGui::GetFrameCount()
+{
+ return GImGui->FrameCount;
+}
+
void ImGui::NewFrame()
{
ImGuiState& g = *GImGui;
// Check user data
- IM_ASSERT(g.IO.DeltaTime > 0.0f);
+ IM_ASSERT(g.IO.DeltaTime >= 0.0f);
IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f);
- IM_ASSERT(g.IO.RenderDrawListsFn != NULL); // Must be implemented
- IM_ASSERT(g.IO.Fonts->Fonts.size() > 0); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
+ IM_ASSERT(g.IO.Fonts->Fonts.Size > 0); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
+ IM_ASSERT(g.Style.CurveTessellationTol > 0.0f); // Invalid
if (!g.Initialized)
{
@@ -1939,11 +1855,20 @@ void ImGui::NewFrame()
g.Initialized = true;
}
- SetFont(g.IO.Fonts->Fonts[0]);
+ SetCurrentFont(g.IO.Fonts->Fonts[0]);
g.Time += g.IO.DeltaTime;
g.FrameCount += 1;
g.Tooltip[0] = '\0';
+ g.OverlayDrawList.Clear();
+ g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
+ g.OverlayDrawList.PushClipRectFullScreen();
+ g.OverlayDrawList.AddDrawCmd();
+
+ // Mark rendering data as invalid to prevent user who may have a handle on it to use it
+ g.RenderDrawData.Valid = false;
+ g.RenderDrawData.CmdLists = NULL;
+ g.RenderDrawData.CmdListsCount = g.RenderDrawData.TotalVtxCount = g.RenderDrawData.TotalIdxCount = 0;
// Update inputs state
if (g.IO.MousePos.x < 0 && g.IO.MousePos.y < 0)
@@ -1953,10 +1878,12 @@ void ImGui::NewFrame()
else
g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev;
g.IO.MousePosPrev = g.IO.MousePos;
- for (size_t i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
+ for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
{
- g.IO.MouseDownTime[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownTime[i] < 0.0f ? 0.0f : g.IO.MouseDownTime[i] + g.IO.DeltaTime) : -1.0f;
- g.IO.MouseClicked[i] = (g.IO.MouseDownTime[i] == 0.0f);
+ g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f;
+ g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f;
+ g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i];
+ g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f;
g.IO.MouseDoubleClicked[i] = false;
if (g.IO.MouseClicked[i])
{
@@ -1978,8 +1905,9 @@ void ImGui::NewFrame()
g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(g.IO.MousePos - g.IO.MouseClickedPos[i]));
}
}
- for (size_t i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++)
- g.IO.KeysDownTime[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownTime[i] < 0.0f ? 0.0f : g.IO.KeysDownTime[i] + g.IO.DeltaTime) : -1.0f;
+ memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration));
+ for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++)
+ g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f;
// Calculate frame-rate for the user, as a purely luxurious feature
g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx];
@@ -1988,9 +1916,11 @@ void ImGui::NewFrame()
g.IO.Framerate = 1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame));
// Clear reference to active widget if the widget isn't alive anymore
+ g.HoveredIdPreviousFrame = g.HoveredId;
g.HoveredId = 0;
+ g.HoveredIdAllowHoveringOthers = false;
if (!g.ActiveIdIsAlive && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
- SetActiveId(0);
+ SetActiveID(0);
g.ActiveIdPreviousFrame = g.ActiveId;
g.ActiveIdIsAlive = false;
g.ActiveIdIsJustActivated = false;
@@ -2012,28 +1942,43 @@ void ImGui::NewFrame()
else
g.HoveredRootWindow = FindHoveredWindow(g.IO.MousePos, true);
+ if (ImGuiWindow* modal_window = GetFrontMostModalRootWindow())
+ {
+ g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f);
+ if (g.HoveredRootWindow != modal_window)
+ g.HoveredRootWindow = g.HoveredWindow = NULL;
+ }
+ else
+ {
+ g.ModalWindowDarkeningRatio = 0.0f;
+ }
+
// Are we using inputs? Tell user so they can capture/discard the inputs away from the rest of their application.
// When clicking outside of a window we assume the click is owned by the application and won't request capture.
int mouse_earliest_button_down = -1;
+ bool mouse_any_down = false;
for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
{
if (g.IO.MouseClicked[i])
- g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL);
+ g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL) || (!g.OpenedPopupStack.empty());
+ mouse_any_down |= g.IO.MouseDown[i];
if (g.IO.MouseDown[i])
if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
mouse_earliest_button_down = i;
}
bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
- g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (g.ActiveId != 0);
- g.IO.WantCaptureKeyboard = (g.ActiveId != 0);
+ g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (!mouse_owned_by_application && mouse_any_down) || (g.ActiveId != 0) || (!g.OpenedPopupStack.empty()) || (g.CaptureMouseNextFrame);
+ g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (g.CaptureKeyboardNextFrame);
+ g.IO.WantTextInput = (g.ActiveId != 0 && g.InputTextState.Id == g.ActiveId);
g.MouseCursor = ImGuiMouseCursor_Arrow;
+ g.CaptureMouseNextFrame = g.CaptureKeyboardNextFrame = false;
// If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
if (mouse_owned_by_application)
g.HoveredWindow = g.HoveredRootWindow = NULL;
// Scale & Scrolling
- if (g.HoveredWindow && g.IO.MouseWheel != 0.0f)
+ if (g.HoveredWindow && g.IO.MouseWheel != 0.0f && !g.HoveredWindow->Collapsed)
{
ImGuiWindow* window = g.HoveredWindow;
if (g.IO.KeyCtrl)
@@ -2058,7 +2003,7 @@ void ImGui::NewFrame()
if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse))
{
const int scroll_lines = (window->Flags & ImGuiWindowFlags_ComboBox) ? 3 : 5;
- window->NextScrollY -= g.IO.MouseWheel * window->CalcFontSize() * scroll_lines;
+ SetWindowScrollY(window, window->Scroll.y - g.IO.MouseWheel * window->CalcFontSize() * scroll_lines);
}
}
}
@@ -2066,12 +2011,10 @@ void ImGui::NewFrame()
// Pressing TAB activate widget focus
// NB: Don't discard FocusedWindow if it isn't active, so that a window that go on/off programatically won't lose its keyboard focus.
if (g.ActiveId == 0 && g.FocusedWindow != NULL && g.FocusedWindow->Active && IsKeyPressedMap(ImGuiKey_Tab, false))
- {
g.FocusedWindow->FocusIdxTabRequestNext = 0;
- }
// Mark all windows as not visible
- for (size_t i = 0; i != g.Windows.size(); i++)
+ for (int i = 0; i != g.Windows.Size; i++)
{
ImGuiWindow* window = g.Windows[i];
window->WasActive = window->Active;
@@ -2082,6 +2025,8 @@ void ImGui::NewFrame()
// No window should be open at the beginning of the frame.
// But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
g.CurrentWindowStack.resize(0);
+ g.CurrentPopupStack.resize(0);
+ CloseInactivePopups();
// Create implicit window - we will only render it if the user has added something to it.
ImGui::SetNextWindowSize(ImVec2(400,400), ImGuiSetCond_FirstUseEver);
@@ -2097,7 +2042,7 @@ void ImGui::Shutdown()
SaveSettings();
- for (size_t i = 0; i < g.Windows.size(); i++)
+ for (int i = 0; i < g.Windows.Size; i++)
{
g.Windows[i]->~ImGuiWindow();
ImGui::MemFree(g.Windows[i]);
@@ -2108,24 +2053,26 @@ void ImGui::Shutdown()
g.FocusedWindow = NULL;
g.HoveredWindow = NULL;
g.HoveredRootWindow = NULL;
- for (size_t i = 0; i < g.Settings.size(); i++)
- {
- g.Settings[i]->~ImGuiIniData();
- ImGui::MemFree(g.Settings[i]);
- }
+ for (int i = 0; i < g.Settings.Size; i++)
+ ImGui::MemFree(g.Settings[i].Name);
g.Settings.clear();
g.ColorModifiers.clear();
g.StyleModifiers.clear();
g.FontStack.clear();
- for (size_t i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
+ g.OpenedPopupStack.clear();
+ g.CurrentPopupStack.clear();
+ for (int i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
g.RenderDrawLists[i].clear();
- g.MouseCursorDrawList.ClearFreeMemory();
+ g.OverlayDrawList.ClearFreeMemory();
g.ColorEditModeStorage.Clear();
if (g.PrivateClipboard)
{
ImGui::MemFree(g.PrivateClipboard);
g.PrivateClipboard = NULL;
}
+ g.InputTextState.Text.clear();
+ g.InputTextState.InitialText.clear();
+ g.InputTextState.TempTextBuffer.clear();
if (g.LogFile && g.LogFile != stdout)
{
@@ -2144,6 +2091,128 @@ void ImGui::Shutdown()
g.Initialized = false;
}
+static ImGuiIniData* FindWindowSettings(const char* name)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiID id = ImHash(name, 0);
+ for (int i = 0; i != g.Settings.Size; i++)
+ {
+ ImGuiIniData* ini = &g.Settings[i];
+ if (ini->ID == id)
+ return ini;
+ }
+ return NULL;
+}
+
+static ImGuiIniData* AddWindowSettings(const char* name)
+{
+ GImGui->Settings.resize(GImGui->Settings.Size + 1);
+ ImGuiIniData* ini = &GImGui->Settings.back();
+ ini->Name = ImStrdup(name);
+ ini->ID = ImHash(name, 0);
+ ini->Collapsed = false;
+ ini->Pos = ImVec2(FLT_MAX,FLT_MAX);
+ ini->Size = ImVec2(0,0);
+ return ini;
+}
+
+// Zero-tolerance, poor-man .ini parsing
+// FIXME: Write something less rubbish
+static void LoadSettings()
+{
+ ImGuiState& g = *GImGui;
+ const char* filename = g.IO.IniFilename;
+ if (!filename)
+ return;
+
+ int file_size;
+ char* file_data = (char*)ImLoadFileToMemory(filename, "rb", &file_size, 1);
+ if (!file_data)
+ return;
+
+ ImGuiIniData* settings = NULL;
+ const char* buf_end = file_data + file_size;
+ for (const char* line_start = file_data; line_start < buf_end; )
+ {
+ const char* line_end = line_start;
+ while (line_end < buf_end && *line_end != '\n' && *line_end != '\r')
+ line_end++;
+
+ if (line_start[0] == '[' && line_end > line_start && line_end[-1] == ']')
+ {
+ char name[64];
+ ImFormatString(name, IM_ARRAYSIZE(name), "%.*s", (int)(line_end-line_start-2), line_start+1);
+ settings = FindWindowSettings(name);
+ if (!settings)
+ settings = AddWindowSettings(name);
+ }
+ else if (settings)
+ {
+ float x, y;
+ int i;
+ if (sscanf(line_start, "Pos=%f,%f", &x, &y) == 2)
+ settings->Pos = ImVec2(x, y);
+ else if (sscanf(line_start, "Size=%f,%f", &x, &y) == 2)
+ settings->Size = ImMax(ImVec2(x, y), g.Style.WindowMinSize);
+ else if (sscanf(line_start, "Collapsed=%d", &i) == 1)
+ settings->Collapsed = (i != 0);
+ }
+
+ line_start = line_end+1;
+ }
+
+ ImGui::MemFree(file_data);
+}
+
+static void SaveSettings()
+{
+ ImGuiState& g = *GImGui;
+ const char* filename = g.IO.IniFilename;
+ if (!filename)
+ return;
+
+ // Gather data from windows that were active during this session
+ for (int i = 0; i != g.Windows.Size; i++)
+ {
+ ImGuiWindow* window = g.Windows[i];
+ if (window->Flags & ImGuiWindowFlags_NoSavedSettings)
+ continue;
+ ImGuiIniData* settings = FindWindowSettings(window->Name);
+ settings->Pos = window->Pos;
+ settings->Size = window->SizeFull;
+ settings->Collapsed = window->Collapsed;
+ }
+
+ // Write .ini file
+ // If a window wasn't opened in this session we preserve its settings
+ FILE* f = fopen(filename, "wt");
+ if (!f)
+ return;
+ for (int i = 0; i != g.Settings.Size; i++)
+ {
+ const ImGuiIniData* settings = &g.Settings[i];
+ if (settings->Pos.x == FLT_MAX)
+ continue;
+ const char* name = settings->Name;
+ if (const char* p = strstr(name, "###")) // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
+ name = p;
+ fprintf(f, "[%s]\n", name);
+ fprintf(f, "Pos=%d,%d\n", (int)settings->Pos.x, (int)settings->Pos.y);
+ fprintf(f, "Size=%d,%d\n", (int)settings->Size.x, (int)settings->Size.y);
+ fprintf(f, "Collapsed=%d\n", settings->Collapsed);
+ fprintf(f, "\n");
+ }
+
+ fclose(f);
+}
+
+static void MarkSettingsDirty()
+{
+ ImGuiState& g = *GImGui;
+ if (g.SettingsDirtyTimer <= 0.0f)
+ g.SettingsDirtyTimer = g.IO.IniSavingRate;
+}
+
// FIXME: Add a more explicit sort order in the window structure.
static int ChildWindowComparer(const void* lhs, const void* rhs)
{
@@ -2163,10 +2232,10 @@ static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows,
out_sorted_windows.push_back(window);
if (window->Active)
{
- const size_t count = window->DC.ChildWindows.size();
+ int count = window->DC.ChildWindows.Size;
if (count > 1)
- qsort(window->DC.ChildWindows.begin(), count, sizeof(ImGuiWindow*), ChildWindowComparer);
- for (size_t i = 0; i < count; i++)
+ qsort(window->DC.ChildWindows.begin(), (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer);
+ for (int i = 0; i < count; i++)
{
ImGuiWindow* child = window->DC.ChildWindows[i];
if (child->Active)
@@ -2175,107 +2244,153 @@ static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows,
}
}
-static void PushClipRect(const ImVec4& clip_rect, bool clipped = true)
+static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDrawList* draw_list)
{
- ImGuiWindow* window = GetCurrentWindow();
+ if (!draw_list->CmdBuffer.empty() && !draw_list->VtxBuffer.empty())
+ {
+ if (draw_list->CmdBuffer.back().ElemCount == 0)
+ draw_list->CmdBuffer.pop_back();
+ out_render_list.push_back(draw_list);
+
+ // Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices)
+ // If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
+ const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8);
+ IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx);
+
+ GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size;
+ GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size;
+ }
+}
+
+static void AddWindowToRenderList(ImVector<ImDrawList*>& out_render_list, ImGuiWindow* window)
+{
+ AddDrawListToRenderList(out_render_list, window->DrawList);
+ for (int i = 0; i < window->DC.ChildWindows.Size; i++)
+ {
+ ImGuiWindow* child = window->DC.ChildWindows[i];
+ if (!child->Active) // clipped children may have been marked not active
+ continue;
+ if ((child->Flags & ImGuiWindowFlags_Popup) && child->HiddenFrames > 0)
+ continue;
+ AddWindowToRenderList(out_render_list, child);
+ }
+}
- ImVec4 cr = clip_rect;
- if (clipped && !window->ClipRectStack.empty())
+static void PushClipRect(const ImRect& clip_rect, bool clipped)
+{
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
+
+ ImRect cr = clip_rect;
+ if (clipped)
{
- // Clip with existing clip rect
- const ImVec4 cur_cr = window->ClipRectStack.back();
- 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));
+ // Clip our argument with the current clip rect
+ cr.Clip(window->ClipRect);
}
- cr.z = ImMax(cr.x, cr.z);
- cr.w = ImMax(cr.y, cr.w);
+ cr.Max.x = ImMax(cr.Min.x, cr.Max.x);
+ cr.Max.y = ImMax(cr.Min.y, cr.Max.y);
- IM_ASSERT(cr.x <= cr.z && cr.y <= cr.w);
- window->ClipRectStack.push_back(cr);
- window->DrawList->PushClipRect(cr);
+ IM_ASSERT(cr.Min.x <= cr.Max.x && cr.Min.y <= cr.Max.y);
+ window->ClipRect = cr;
+ window->DrawList->PushClipRect(ImVec4(cr.Min.x, cr.Min.y, cr.Max.x, cr.Max.y));
}
static void PopClipRect()
{
- ImGuiWindow* window = GetCurrentWindow();
- window->ClipRectStack.pop_back();
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
window->DrawList->PopClipRect();
+ window->ClipRect = window->DrawList->_ClipRectStack.back();
}
-void ImGui::Render()
+// This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal.
+void ImGui::EndFrame()
{
ImGuiState& g = *GImGui;
- IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
+ IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
+ IM_ASSERT(g.FrameCountEnded != g.FrameCount); // ImGui::EndFrame() called multiple times, or forgot to call ImGui::NewFrame() again
- const bool first_render_of_the_frame = (g.FrameCountRendered != g.FrameCount);
- g.FrameCountRendered = g.FrameCount;
-
- if (first_render_of_the_frame)
+ // Render tooltip
+ if (g.Tooltip[0])
{
- // Hide implicit "Debug" window if it hasn't been used
- IM_ASSERT(g.CurrentWindowStack.size() == 1); // Mismatched Begin/End
- if (g.CurrentWindow && !g.CurrentWindow->Accessed)
- g.CurrentWindow->Active = false;
- ImGui::End();
+ ImGui::BeginTooltip();
+ ImGui::TextUnformatted(g.Tooltip);
+ ImGui::EndTooltip();
+ }
- // Click to focus window and start moving (after we're done with all our widgets)
- if (g.ActiveId == 0 && g.HoveredId == 0 && g.IO.MouseClicked[0])
+ // Hide implicit "Debug" window if it hasn't been used
+ IM_ASSERT(g.CurrentWindowStack.Size == 1); // Mismatched Begin/End
+ if (g.CurrentWindow && !g.CurrentWindow->Accessed)
+ g.CurrentWindow->Active = false;
+ ImGui::End();
+
+ // Click to focus window and start moving (after we're done with all our widgets)
+ if (!g.ActiveId)
+ g.MovedWindow = NULL;
+ if (g.ActiveId == 0 && g.HoveredId == 0 && g.IO.MouseClicked[0])
+ {
+ if (!(g.FocusedWindow && !g.FocusedWindow->WasActive && g.FocusedWindow->Active)) // Unless we just made a popup appear
{
if (g.HoveredRootWindow != NULL)
{
- IM_ASSERT(g.MovedWindow == NULL);
- g.MovedWindow = g.HoveredWindow;
- SetActiveId(g.HoveredRootWindow->MoveID);
+ FocusWindow(g.HoveredWindow);
+ if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove))
+ {
+ g.MovedWindow = g.HoveredWindow;
+ SetActiveID(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
+ }
}
- else if (g.FocusedWindow != NULL)
+ else if (g.FocusedWindow != NULL && GetFrontMostModalRootWindow() == NULL)
{
// Clicking on void disable focus
FocusWindow(NULL);
}
}
+ }
- // Sort the window list so that all child windows are after their parent
- // We cannot do that on FocusWindow() because childs may not exist yet
- g.WindowsSortBuffer.resize(0);
- g.WindowsSortBuffer.reserve(g.Windows.size());
- for (size_t i = 0; i != g.Windows.size(); i++)
- {
- ImGuiWindow* window = g.Windows[i];
- if (window->Flags & ImGuiWindowFlags_ChildWindow) // if a child is active its parent will add it
- if (window->Active)
- continue;
- AddWindowToSortedBuffer(g.WindowsSortBuffer, window);
- }
- IM_ASSERT(g.Windows.size() == g.WindowsSortBuffer.size()); // we done something wrong
- g.Windows.swap(g.WindowsSortBuffer);
-
- // Clear Input data for next frame
- g.IO.MouseWheel = 0.0f;
- memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters));
+ // Sort the window list so that all child windows are after their parent
+ // We cannot do that on FocusWindow() because childs may not exist yet
+ g.WindowsSortBuffer.resize(0);
+ g.WindowsSortBuffer.reserve(g.Windows.Size);
+ for (int i = 0; i != g.Windows.Size; i++)
+ {
+ ImGuiWindow* window = g.Windows[i];
+ if (window->Flags & ImGuiWindowFlags_ChildWindow) // if a child is active its parent will add it
+ if (window->Active)
+ continue;
+ AddWindowToSortedBuffer(g.WindowsSortBuffer, window);
}
+ IM_ASSERT(g.Windows.Size == g.WindowsSortBuffer.Size); // we done something wrong
+ g.Windows.swap(g.WindowsSortBuffer);
+
+ // Clear Input data for next frame
+ g.IO.MouseWheel = 0.0f;
+ memset(g.IO.InputCharacters, 0, sizeof(g.IO.InputCharacters));
+
+ g.FrameCountEnded = g.FrameCount;
+}
+
+void ImGui::Render()
+{
+ ImGuiState& g = *GImGui;
+ IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
+
+ if (g.FrameCountEnded != g.FrameCount)
+ ImGui::EndFrame();
+ g.FrameCountRendered = g.FrameCount;
// Skip render altogether if alpha is 0.0
- // Note that vertex buffers have been created, so it is best practice that you don't create windows in the first place, or respond to Begin() returning false
+ // Note that vertex buffers have been created and are wasted, so it is best practice that you don't create windows in the first place, or consistently respond to Begin() returning false.
if (g.Style.Alpha > 0.0f)
{
- // Render tooltip
- if (g.Tooltip[0])
- {
- ImGui::BeginTooltip();
- ImGui::TextUnformatted(g.Tooltip);
- ImGui::EndTooltip();
- }
-
// Gather windows to render
- g.IO.MetricsRenderVertices = 0;
- g.IO.MetricsActiveWindows = 0;
- for (size_t i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
+ g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsActiveWindows = 0;
+ for (int i = 0; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
g.RenderDrawLists[i].resize(0);
- for (size_t i = 0; i != g.Windows.size(); i++)
+ for (int i = 0; i != g.Windows.Size; i++)
{
ImGuiWindow* window = g.Windows[i];
if (window->Active && window->HiddenFrames <= 0 && (window->Flags & (ImGuiWindowFlags_ChildWindow)) == 0)
{
- // FIXME: Generalize this with a proper layering system so we can stack.
+ // FIXME: Generalize this with a proper layering system so e.g. user can draw in specific layers, below text, ..
g.IO.MetricsActiveWindows++;
if (window->Flags & ImGuiWindowFlags_Popup)
AddWindowToRenderList(g.RenderDrawLists[1], window);
@@ -2287,45 +2402,52 @@ void ImGui::Render()
}
// Flatten layers
- size_t n = g.RenderDrawLists[0].size();
- size_t flattened_size = n;
- for (size_t i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
- flattened_size += g.RenderDrawLists[i].size();
+ int n = g.RenderDrawLists[0].Size;
+ int flattened_size = n;
+ for (int i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
+ flattened_size += g.RenderDrawLists[i].Size;
g.RenderDrawLists[0].resize(flattened_size);
- for (size_t i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
+ for (int i = 1; i < IM_ARRAYSIZE(g.RenderDrawLists); i++)
{
ImVector<ImDrawList*>& layer = g.RenderDrawLists[i];
- if (!layer.empty())
- {
- memcpy(&g.RenderDrawLists[0][n], &layer[0], layer.size() * sizeof(ImDrawList*));
- n += layer.size();
- }
+ if (layer.empty())
+ continue;
+ memcpy(&g.RenderDrawLists[0][n], &layer[0], layer.Size * sizeof(ImDrawList*));
+ n += layer.Size;
}
+ // Draw software mouse cursor if requested
if (g.IO.MouseDrawCursor)
{
const ImGuiMouseCursorData& cursor_data = g.MouseCursorData[g.MouseCursor];
- const ImVec2 pos = g.IO.MousePos - cursor_data.Offset;
+ const ImVec2 pos = g.IO.MousePos - cursor_data.HotOffset;
const ImVec2 size = cursor_data.Size;
const ImTextureID tex_id = g.IO.Fonts->TexID;
- g.MouseCursorDrawList.Clear();
- g.MouseCursorDrawList.PushTextureID(tex_id);
- g.MouseCursorDrawList.AddImage(tex_id, pos+ImVec2(1,0), pos+ImVec2(1,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
- g.MouseCursorDrawList.AddImage(tex_id, pos+ImVec2(2,0), pos+ImVec2(2,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
- g.MouseCursorDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0xFF000000); // Black border
- g.MouseCursorDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[0], cursor_data.TexUvMax[0], 0xFFFFFFFF); // White fill
- g.MouseCursorDrawList.PopTextureID();
- AddDrawListToRenderList(g.RenderDrawLists[0], &g.MouseCursorDrawList);
+ g.OverlayDrawList.PushTextureID(tex_id);
+ g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(1,0), pos+ImVec2(1,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
+ g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(2,0), pos+ImVec2(2,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
+ g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0xFF000000); // Black border
+ g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[0], cursor_data.TexUvMax[0], 0xFFFFFFFF); // White fill
+ g.OverlayDrawList.PopTextureID();
}
+ if (!g.OverlayDrawList.VtxBuffer.empty())
+ AddDrawListToRenderList(g.RenderDrawLists[0], &g.OverlayDrawList);
- // Render
- if (!g.RenderDrawLists[0].empty())
- g.IO.RenderDrawListsFn(&g.RenderDrawLists[0][0], (int)g.RenderDrawLists[0].size());
+ // Setup draw data
+ g.RenderDrawData.Valid = true;
+ g.RenderDrawData.CmdLists = (g.RenderDrawLists[0].Size > 0) ? &g.RenderDrawLists[0][0] : NULL;
+ g.RenderDrawData.CmdListsCount = g.RenderDrawLists[0].Size;
+ g.RenderDrawData.TotalVtxCount = g.IO.MetricsRenderVertices;
+ g.RenderDrawData.TotalIdxCount = g.IO.MetricsRenderIndices;
+
+ // Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
+ if (g.RenderDrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
+ g.IO.RenderDrawListsFn(&g.RenderDrawData);
}
}
// Find the optional ## from which we stop displaying text.
-static const char* FindTextDisplayEnd(const char* text, const char* text_end = NULL)
+static const char* FindTextDisplayEnd(const char* text, const char* text_end)
{
const char* text_display_end = text;
if (!text_end)
@@ -2367,10 +2489,10 @@ void ImGui::LogText(const char* fmt, ...)
// Internal version that takes a position to decide on newline placement and pad items according to their depth.
// We split text into individual lines to add current tree level padding
-static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end)
+static void LogRenderedText(const ImVec2& ref_pos, const char* text, const char* text_end)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = ImGui::GetCurrentWindowRead();
if (!text_end)
text_end = FindTextDisplayEnd(text, text_end);
@@ -2405,7 +2527,7 @@ static void LogText(const ImVec2& ref_pos, const char* text, const char* text_en
{
const int char_count = (int)(line_end - text_remaining);
if (log_new_line || !is_first_line)
- ImGui::LogText(STR_NEWLINE "%*s%.*s", tree_depth*4, "", char_count, text_remaining);
+ ImGui::LogText(IM_NEWLINE "%*s%.*s", tree_depth*4, "", char_count, text_remaining);
else
ImGui::LogText(" %.*s", char_count, text_remaining);
}
@@ -2416,24 +2538,9 @@ static void LogText(const ImVec2& ref_pos, const char* text, const char* text_en
}
}
-static float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
-{
- if (wrap_pos_x < 0.0f)
- return 0.0f;
-
- ImGuiWindow* window = GetCurrentWindow();
- if (wrap_pos_x == 0.0f)
- wrap_pos_x = ImGui::GetContentRegionMax().x;
- if (wrap_pos_x > 0.0f)
- wrap_pos_x += window->Pos.x; // wrap_pos_x is provided is window local space
-
- const float wrap_width = wrap_pos_x > 0.0f ? ImMax(wrap_pos_x - pos.x, 0.00001f) : 0.0f;
- return wrap_width;
-}
-
// Internal ImGui functions to render text
// RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
-static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash)
+void ImGui::RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -2459,11 +2566,11 @@ static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool
// Log as text
if (g.LogEnabled)
- LogText(pos, text, text_display_end);
+ LogRenderedText(pos, text, text_display_end);
}
}
-static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width)
+void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -2476,11 +2583,11 @@ static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end
{
window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_end, wrap_width);
if (g.LogEnabled)
- LogText(pos, text, text_end);
+ LogRenderedText(pos, text, text_end);
}
}
-static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& pos_max, const ImVec2* clip_max, ImGuiAlign align)
+void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, ImGuiAlign align, const ImVec2* clip_min, const ImVec2* clip_max)
{
// Hide anything after a '##' string
const char* text_display_end = FindTextDisplayEnd(text, text_end);
@@ -2492,36 +2599,47 @@ static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end
ImGuiWindow* window = GetCurrentWindow();
// Perform CPU side clipping for single clipped element to avoid using scissor state
+ ImVec2 pos = pos_min;
const ImVec2 text_size = text_size_if_known ? *text_size_if_known : ImGui::CalcTextSize(text, text_display_end, false, 0.0f);
+
if (!clip_max) clip_max = &pos_max;
- const bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y);
+ bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y);
+ if (!clip_min) clip_min = &pos_min; else need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y);
// Align
if (align & ImGuiAlign_Center) pos.x = ImMax(pos.x, (pos.x + pos_max.x - text_size.x) * 0.5f);
else if (align & ImGuiAlign_Right) pos.x = ImMax(pos.x, pos_max.x - text_size.x);
+ if (align & ImGuiAlign_VCenter) pos.y = ImMax(pos.y, (pos.y + pos_max.y - text_size.y) * 0.5f);
// Render
- window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, need_clipping ? clip_max : NULL);
+ if (need_clipping)
+ {
+ ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y);
+ window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect);
+ }
+ else
+ {
+ window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, NULL);
+ }
if (g.LogEnabled)
- LogText(pos, text, text_display_end);
+ LogRenderedText(pos, text, text_display_end);
}
// Render a rectangle shaped with optional rounding and borders
-static void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
+void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
{
ImGuiWindow* window = GetCurrentWindow();
window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding);
if (border && (window->Flags & ImGuiWindowFlags_ShowBorders))
{
- // FIXME: This is the best I've found that works on multiple renderer/back ends. Bit dodgy.
- window->DrawList->AddRect(p_min+ImVec2(1.5f,1.5f), p_max+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), rounding);
- window->DrawList->AddRect(p_min+ImVec2(0.5f,0.5f), p_max+ImVec2(0,0), window->Color(ImGuiCol_Border), rounding);
+ window->DrawList->AddRect(p_min+ImVec2(1,1), p_max, window->Color(ImGuiCol_BorderShadow), rounding);
+ window->DrawList->AddRect(p_min, p_max-ImVec2(1,1), window->Color(ImGuiCol_Border), rounding);
}
}
// Render a triangle to denote expanded/collapsed state
-static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale, bool shadow)
+void ImGui::RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale, bool shadow)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -2544,13 +2662,13 @@ static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale, bool
b = center + ImVec2(-0.500f,0.866f)*r;
c = center + ImVec2(-0.500f,-0.866f)*r;
}
-
+
if (shadow && (window->Flags & ImGuiWindowFlags_ShowBorders) != 0)
window->DrawList->AddTriangleFilled(a+ImVec2(2,2), b+ImVec2(2,2), c+ImVec2(2,2), window->Color(ImGuiCol_BorderShadow));
window->DrawList->AddTriangleFilled(a, b, c, window->Color(ImGuiCol_Text));
}
-static void RenderCheckMark(ImVec2 pos, ImU32 col)
+void ImGui::RenderCheckMark(ImVec2 pos, ImU32 col)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -2558,15 +2676,17 @@ static void RenderCheckMark(ImVec2 pos, ImU32 col)
ImVec2 a, b, c;
float start_x = (float)(int)(g.FontSize * 0.307f + 0.5f);
float rem_third = (float)(int)((g.FontSize - start_x) / 3.0f);
- a.x = pos.x + start_x;
+ a.x = pos.x + 0.5f + start_x;
b.x = a.x + rem_third;
c.x = a.x + rem_third * 3.0f;
- b.y = pos.y + (float)(int)(g.Font->BaseLine * (g.FontSize / g.Font->FontSize) + 0.5f) + (float)(int)(g.Font->DisplayOffset.y);
+ b.y = pos.y - 1.0f + (float)(int)(g.Font->Ascent * (g.FontSize / g.Font->FontSize) + 0.5f) + (float)(int)(g.Font->DisplayOffset.y);
a.y = b.y - rem_third;
c.y = b.y - rem_third * 2.0f;
- window->DrawList->AddLine(a, b, col);
- window->DrawList->AddLine(b, c, col);
+ window->DrawList->PathLineTo(a);
+ window->DrawList->PathLineTo(b);
+ window->DrawList->PathLineTo(c);
+ window->DrawList->PathStroke(col, false);
}
// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
@@ -2586,7 +2706,7 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
// Cancel out character spacing for the last character of a line (it is baked into glyph->XAdvance field)
- const float font_scale = font_size / font->FontSize;
+ const float font_scale = font_size / font->FontSize;
const float character_spacing_x = 1.0f * font_scale;
if (text_size.x > 0.0f)
text_size.x -= character_spacing_x;
@@ -2594,7 +2714,9 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
return text_size;
}
-// Helper to calculate coarse clipping of large list of evenly sized items.
+// Helper to calculate coarse clipping of large list of evenly sized items.
+// NB: Prefer using the ImGuiListClipper higher-level helper if you can!
+// NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX
// 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.
// {
// float item_height = ImGui::GetTextLineHeightWithSpacing();
@@ -2608,8 +2730,7 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
-
+ ImGuiWindow* window = GetCurrentWindowRead();
if (g.LogEnabled)
{
// If logging is active, do not perform any clipping
@@ -2619,15 +2740,10 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items
}
const ImVec2 pos = window->DC.CursorPos;
- const ImVec4 clip_rect = window->ClipRectStack.back();
- const float clip_y1 = clip_rect.y;
- const float clip_y2 = clip_rect.w;
-
- int start = (int)((clip_y1 - pos.y) / items_height);
- int end = (int)((clip_y2 - pos.y) / items_height);
+ int start = (int)((window->ClipRect.Min.y - pos.y) / items_height);
+ int end = (int)((window->ClipRect.Max.y - pos.y) / items_height);
start = ImClamp(start, 0, items_count);
end = ImClamp(end + 1, start, items_count);
-
*out_items_display_start = start;
*out_items_display_end = end;
}
@@ -2636,16 +2752,18 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items
static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs)
{
ImGuiState& g = *GImGui;
- for (int i = (int)g.Windows.size()-1; i >= 0; i--)
+ for (int i = g.Windows.Size-1; i >= 0; i--)
{
- ImGuiWindow* window = g.Windows[(size_t)i];
+ ImGuiWindow* window = g.Windows[i];
if (!window->Active)
continue;
+ if (window->Flags & ImGuiWindowFlags_NoInputs)
+ continue;
if (excluding_childs && (window->Flags & ImGuiWindowFlags_ChildWindow) != 0)
continue;
// Using the clipped AABB so a child window will typically be clipped by its parent.
- ImRect bb(window->ClippedRect.Min - g.Style.TouchExtraPadding, window->ClippedRect.Max + g.Style.TouchExtraPadding);
+ ImRect bb(window->ClippedWindowRect.Min - g.Style.TouchExtraPadding, window->ClippedWindowRect.Max + g.Style.TouchExtraPadding);
if (bb.Contains(pos))
return window;
}
@@ -2655,34 +2773,25 @@ static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs)
// Test if mouse cursor is hovering given rectangle
// NB- Rectangle is clipped by our current clip setting
// NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
-static bool IsMouseHoveringRect(const ImRect& rect)
+bool ImGui::IsMouseHoveringRect(const ImVec2& pos_min, const ImVec2& pos_max, bool clip)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
// Clip
- ImRect rect_clipped = rect;
- if (!window->ClipRectStack.empty())
- {
- const ImVec4 clip_rect = window->ClipRectStack.back();
- rect_clipped.Clip(ImRect(ImVec2(clip_rect.x, clip_rect.y), ImVec2(clip_rect.z, clip_rect.w)));
- }
+ ImRect rect_clipped(pos_min, pos_max);
+ if (clip)
+ rect_clipped.Clip(window->ClipRect);
// Expand for touch input
const ImRect rect_for_touch(rect_clipped.Min - g.Style.TouchExtraPadding, rect_clipped.Max + g.Style.TouchExtraPadding);
return rect_for_touch.Contains(g.IO.MousePos);
}
-bool ImGui::IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max)
-{
- return IsMouseHoveringRect(ImRect(rect_min, rect_max));
-}
-
bool ImGui::IsMouseHoveringWindow()
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- return g.HoveredWindow == window;
+ return g.HoveredWindow == g.CurrentWindow;
}
bool ImGui::IsMouseHoveringAnyWindow()
@@ -2698,33 +2807,48 @@ bool ImGui::IsPosHoveringAnyWindow(const ImVec2& pos)
static bool IsKeyPressedMap(ImGuiKey key, bool repeat)
{
- ImGuiState& g = *GImGui;
- const int key_index = g.IO.KeyMap[key];
+ const int key_index = GImGui->IO.KeyMap[key];
return ImGui::IsKeyPressed(key_index, repeat);
}
+int ImGui::GetKeyIndex(ImGuiKey key)
+{
+ IM_ASSERT(key >= 0 && key < ImGuiKey_COUNT);
+ return GImGui->IO.KeyMap[key];
+}
+
bool ImGui::IsKeyDown(int key_index)
{
- ImGuiState& g = *GImGui;
- IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- return g.IO.KeysDown[key_index];
+ if (key_index < 0) return false;
+ IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(GImGui->IO.KeysDown));
+ return GImGui->IO.KeysDown[key_index];
}
bool ImGui::IsKeyPressed(int key_index, bool repeat)
{
ImGuiState& g = *GImGui;
+ if (key_index < 0) return false;
IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- const float t = g.IO.KeysDownTime[key_index];
+ const float t = g.IO.KeysDownDuration[key_index];
if (t == 0.0f)
return true;
- // FIXME: Repeat rate should be provided elsewhere?
- const float KEY_REPEAT_DELAY = 0.250f;
- const float KEY_REPEAT_RATE = 0.020f;
- if (repeat && t > KEY_REPEAT_DELAY)
- if ((fmodf(t - KEY_REPEAT_DELAY, KEY_REPEAT_RATE) > KEY_REPEAT_RATE*0.5f) != (fmodf(t - KEY_REPEAT_DELAY - g.IO.DeltaTime, KEY_REPEAT_RATE) > KEY_REPEAT_RATE*0.5f))
+ if (repeat && t > g.IO.KeyRepeatDelay)
+ {
+ float delay = g.IO.KeyRepeatDelay, rate = g.IO.KeyRepeatRate;
+ if ((fmodf(t - delay, rate) > rate*0.5f) != (fmodf(t - delay - g.IO.DeltaTime, rate) > rate*0.5f))
return true;
+ }
+ return false;
+}
+bool ImGui::IsKeyReleased(int key_index)
+{
+ ImGuiState& g = *GImGui;
+ if (key_index < 0) return false;
+ IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
+ if (g.IO.KeysDownDurationPrev[key_index] >= 0.0f && !g.IO.KeysDown[key_index])
+ return true;
return false;
}
@@ -2739,20 +2863,27 @@ bool ImGui::IsMouseClicked(int button, bool repeat)
{
ImGuiState& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- const float t = g.IO.MouseDownTime[button];
+ const float t = g.IO.MouseDownDuration[button];
if (t == 0.0f)
return true;
- // FIXME: Repeat rate should be provided elsewhere?
- const float MOUSE_REPEAT_DELAY = 0.250f;
- const float MOUSE_REPEAT_RATE = 0.020f;
- if (repeat && t > MOUSE_REPEAT_DELAY)
- if ((fmodf(t - MOUSE_REPEAT_DELAY, MOUSE_REPEAT_RATE) > MOUSE_REPEAT_RATE*0.5f) != (fmodf(t - MOUSE_REPEAT_DELAY - g.IO.DeltaTime, MOUSE_REPEAT_RATE) > MOUSE_REPEAT_RATE*0.5f))
+ if (repeat && t > g.IO.KeyRepeatDelay)
+ {
+ float delay = g.IO.KeyRepeatDelay, rate = g.IO.KeyRepeatRate;
+ if ((fmodf(t - delay, rate) > rate*0.5f) != (fmodf(t - delay - g.IO.DeltaTime, rate) > rate*0.5f))
return true;
+ }
return false;
}
+bool ImGui::IsMouseReleased(int button)
+{
+ ImGuiState& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseReleased[button];
+}
+
bool ImGui::IsMouseDoubleClicked(int button)
{
ImGuiState& g = *GImGui;
@@ -2764,6 +2895,8 @@ bool ImGui::IsMouseDragging(int button, float lock_threshold)
{
ImGuiState& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ if (!g.IO.MouseDown[button])
+ return false;
if (lock_threshold < 0.0f)
lock_threshold = g.IO.MouseDragThreshold;
return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold;
@@ -2774,6 +2907,15 @@ ImVec2 ImGui::GetMousePos()
return GImGui->IO.MousePos;
}
+// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed!
+ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
+{
+ ImGuiState& g = *GImGui;
+ if (g.CurrentPopupStack.Size > 0)
+ return g.OpenedPopupStack[g.CurrentPopupStack.Size-1].MousePosOnOpen;
+ return g.IO.MousePos;
+}
+
ImVec2 ImGui::GetMouseDragDelta(int button, float lock_threshold)
{
ImGuiState& g = *GImGui;
@@ -2804,15 +2946,25 @@ void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
GImGui->MouseCursor = cursor_type;
}
+void ImGui::CaptureKeyboardFromApp()
+{
+ GImGui->CaptureKeyboardNextFrame = true;
+}
+
+void ImGui::CaptureMouseFromApp()
+{
+ GImGui->CaptureMouseNextFrame = true;
+}
+
bool ImGui::IsItemHovered()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.LastItemHoveredAndUsable;
}
bool ImGui::IsItemHoveredRect()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.LastItemHoveredRect;
}
@@ -2821,46 +2973,50 @@ bool ImGui::IsItemActive()
ImGuiState& g = *GImGui;
if (g.ActiveId)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return g.ActiveId == window->DC.LastItemID;
}
return false;
}
+bool ImGui::IsAnyItemHovered()
+{
+ return GImGui->HoveredId != 0 || GImGui->HoveredIdPreviousFrame != 0;
+}
+
bool ImGui::IsAnyItemActive()
{
- ImGuiState& g = *GImGui;
- return g.ActiveId != 0;
+ return GImGui->ActiveId != 0;
}
bool ImGui::IsItemVisible()
{
- ImGuiWindow* window = GetCurrentWindow();
- ImRect r(window->ClipRectStack.back());
+ ImGuiWindow* window = GetCurrentWindowRead();
+ ImRect r(window->ClipRect);
return r.Overlaps(window->DC.LastItemRect);
}
ImVec2 ImGui::GetItemRectMin()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.LastItemRect.Min;
}
ImVec2 ImGui::GetItemRectMax()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.LastItemRect.Max;
}
ImVec2 ImGui::GetItemRectSize()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.LastItemRect.GetSize();
}
ImVec2 ImGui::CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge, float outward)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
ImRect rect = window->DC.LastItemRect;
rect.Expand(outward);
return rect.GetClosestPoint(pos, on_edge);
@@ -2881,22 +3037,12 @@ void ImGui::SetTooltip(const char* fmt, ...)
va_end(args);
}
-float ImGui::GetTime()
-{
- return GImGui->Time;
-}
-
-int ImGui::GetFrameCount()
-{
- return GImGui->FrameCount;
-}
-
-static ImVec4 GetVisibleRect()
+static ImRect GetVisibleRect()
{
ImGuiState& g = *GImGui;
if (g.IO.DisplayVisibleMin.x != g.IO.DisplayVisibleMax.x && g.IO.DisplayVisibleMin.y != g.IO.DisplayVisibleMax.y)
- return ImVec4(g.IO.DisplayVisibleMin.x, g.IO.DisplayVisibleMin.y, g.IO.DisplayVisibleMax.x, g.IO.DisplayVisibleMax.y);
- return ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
+ return ImRect(g.IO.DisplayVisibleMin, g.IO.DisplayVisibleMax);
+ return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
}
void ImGui::BeginTooltip()
@@ -2908,59 +3054,222 @@ void ImGui::BeginTooltip()
void ImGui::EndTooltip()
{
- IM_ASSERT(GetCurrentWindow()->Flags & ImGuiWindowFlags_Tooltip);
+ IM_ASSERT(GetCurrentWindowRead()->Flags & ImGuiWindowFlags_Tooltip);
ImGui::End();
}
-void ImGui::BeginPopup(bool* p_opened)
+static bool IsPopupOpen(ImGuiID id)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- IM_ASSERT(p_opened != NULL); // Must provide a bool at the moment
+ const bool opened = g.OpenedPopupStack.Size > g.CurrentPopupStack.Size && g.OpenedPopupStack[g.CurrentPopupStack.Size].PopupID == id;
+ return opened;
+}
+
+// One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL)
+void ImGui::OpenPopup(const char* str_id)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImGuiID id = window->GetID(str_id);
+ int current_stack_size = g.CurrentPopupStack.Size;
+ ImGuiPopupRef popup_ref = ImGuiPopupRef(id, window, window->GetID("##menus"), g.IO.MousePos); // Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here)
+ if (g.OpenedPopupStack.Size < current_stack_size + 1)
+ g.OpenedPopupStack.push_back(popup_ref);
+ else if (g.OpenedPopupStack[current_stack_size].PopupID != id)
+ {
+ g.OpenedPopupStack.resize(current_stack_size+1);
+ g.OpenedPopupStack[current_stack_size] = popup_ref;
+ }
+}
+
+static void CloseInactivePopups()
+{
+ ImGuiState& g = *GImGui;
+ if (g.OpenedPopupStack.empty())
+ return;
+
+ // When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it.
+ // Don't close our own child popup windows
+ int n = 0;
+ if (g.FocusedWindow)
+ {
+ for (n = 0; n < g.OpenedPopupStack.Size; n++)
+ {
+ ImGuiPopupRef& popup = g.OpenedPopupStack[n];
+ if (!popup.Window)
+ continue;
+ IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0);
+ if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow)
+ continue;
+
+ bool has_focus = false;
+ for (int m = n; m < g.OpenedPopupStack.Size && !has_focus; m++)
+ has_focus = (g.OpenedPopupStack[m].Window && g.OpenedPopupStack[m].Window->RootWindow == g.FocusedWindow->RootWindow);
+ if (!has_focus)
+ break;
+ }
+ }
+ if (n < g.OpenedPopupStack.Size) // This test is not required but it allows to set a useful breakpoint on the line below
+ g.OpenedPopupStack.resize(n);
+}
+
+static ImGuiWindow* GetFrontMostModalRootWindow()
+{
+ ImGuiState& g = *GImGui;
+ if (!g.OpenedPopupStack.empty())
+ if (ImGuiWindow* front_most_popup = g.OpenedPopupStack.back().Window)
+ if (front_most_popup->Flags & ImGuiWindowFlags_Modal)
+ return front_most_popup;
+ return NULL;
+}
+
+static void ClosePopupToLevel(int remaining)
+{
+ ImGuiState& g = *GImGui;
+ if (remaining > 0)
+ ImGui::FocusWindow(g.OpenedPopupStack[remaining-1].Window);
+ else
+ ImGui::FocusWindow(g.OpenedPopupStack[0].ParentWindow);
+ g.OpenedPopupStack.resize(remaining);
+}
+
+static void ClosePopup(ImGuiID id)
+{
+ if (!IsPopupOpen(id))
+ return;
+ ImGuiState& g = *GImGui;
+ ClosePopupToLevel(g.OpenedPopupStack.Size - 1);
+}
+
+// Close the popup we have begin-ed into.
+void ImGui::CloseCurrentPopup()
+{
+ ImGuiState& g = *GImGui;
+ int popup_idx = g.CurrentPopupStack.Size - 1;
+ if (popup_idx < 0 || popup_idx > g.OpenedPopupStack.Size || g.CurrentPopupStack[popup_idx].PopupID != g.OpenedPopupStack[popup_idx].PopupID)
+ return;
+ while (popup_idx > 0 && g.OpenedPopupStack[popup_idx].Window && (g.OpenedPopupStack[popup_idx].Window->Flags & ImGuiWindowFlags_ChildMenu))
+ popup_idx--;
+ ClosePopupToLevel(popup_idx);
+}
+
+static void ClearSetNextWindowData()
+{
+ ImGuiState& g = *GImGui;
+ g.SetNextWindowPosCond = g.SetNextWindowSizeCond = g.SetNextWindowContentSizeCond = g.SetNextWindowCollapsedCond = g.SetNextWindowFocus = 0;
+}
+
+static bool BeginPopupEx(const char* str_id, ImGuiWindowFlags extra_flags)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ const ImGuiID id = window->GetID(str_id);
+ if (!IsPopupOpen(id))
+ {
+ ClearSetNextWindowData(); // We behave like Begin() and need to consume those values
+ return false;
+ }
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
- ImGuiWindowFlags flags = ImGuiWindowFlags_Popup|ImGuiWindowFlags_ShowBorders|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize;
- float alpha = 1.0f;
+ ImGuiWindowFlags flags = extra_flags|ImGuiWindowFlags_Popup|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize;
- char name[20];
- ImFormatString(name, 20, "##Popup%02d", g.CurrentPopupStackSize++);
- ImGui::Begin(name, p_opened, ImVec2(0.0f, 0.0f), alpha, flags);
+ char name[32];
+ if (flags & ImGuiWindowFlags_ChildMenu)
+ ImFormatString(name, 20, "##menu_%d", g.CurrentPopupStack.Size); // Recycle windows based on depth
+ else
+ ImFormatString(name, 20, "##popup_%08x", id); // Not recycling, so we can close/open during the same frame
+ float alpha = 1.0f;
+ bool opened = ImGui::Begin(name, NULL, ImVec2(0.0f, 0.0f), alpha, flags);
if (!(window->Flags & ImGuiWindowFlags_ShowBorders))
- GetCurrentWindow()->Flags &= ~ImGuiWindowFlags_ShowBorders;
+ g.CurrentWindow->Flags &= ~ImGuiWindowFlags_ShowBorders;
+ if (!opened) // opened can be 'false' when the popup is completely clipped (e.g. zero size display)
+ ImGui::EndPopup();
+
+ return opened;
}
-void ImGui::EndPopup()
+bool ImGui::BeginPopup(const char* str_id)
+{
+ return BeginPopupEx(str_id, ImGuiWindowFlags_ShowBorders);
+}
+
+bool ImGui::BeginPopupModal(const char* name, bool* p_opened, ImGuiWindowFlags extra_flags)
{
ImGuiState& g = *GImGui;
- IM_ASSERT(GetCurrentWindow()->Flags & ImGuiWindowFlags_Popup);
- IM_ASSERT(g.CurrentPopupStackSize > 0);
- g.CurrentPopupStackSize--;
+ ImGuiWindow* window = g.CurrentWindow;
+ const ImGuiID id = window->GetID(name);
+ if (!IsPopupOpen(id))
+ {
+ ClearSetNextWindowData(); // We behave like Begin() and need to consume those values
+ return false;
+ }
+
+ ImGuiWindowFlags flags = extra_flags|ImGuiWindowFlags_Popup|ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoSavedSettings;
+ bool opened = ImGui::Begin(name, p_opened, ImVec2(0.0f, 0.0f), -1.0f, flags);
+ if (!opened || (p_opened && !*p_opened)) // Opened can be 'false' when the popup is completely clipped (e.g. zero size display)
+ {
+ ImGui::EndPopup();
+ if (opened)
+ ClosePopup(id);
+ return false;
+ }
+
+ return opened;
+}
+
+void ImGui::EndPopup()
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ IM_ASSERT(window->Flags & ImGuiWindowFlags_Popup);
+ IM_ASSERT(GImGui->CurrentPopupStack.Size > 0);
ImGui::End();
- ImGui::PopStyleVar();
+ if (!(window->Flags & ImGuiWindowFlags_Modal))
+ ImGui::PopStyleVar();
+}
+
+bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
+{
+ if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(mouse_button))
+ ImGui::OpenPopup(str_id);
+ return ImGui::BeginPopup(str_id);
+}
+
+bool ImGui::BeginPopupContextWindow(bool also_over_items, const char* str_id, int mouse_button)
+{
+ if (!str_id) str_id = "window_context_menu";
+ if (ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(mouse_button))
+ if (also_over_items || !ImGui::IsAnyItemHovered())
+ ImGui::OpenPopup(str_id);
+ return ImGui::BeginPopup(str_id);
+}
+
+bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
+{
+ if (!str_id) str_id = "void_context_menu";
+ if (!ImGui::IsMouseHoveringAnyWindow() && ImGui::IsMouseClicked(mouse_button))
+ ImGui::OpenPopup(str_id);
+ return ImGui::BeginPopup(str_id);
}
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
- ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
-
- const ImVec2 content_max = window->Pos + ImGui::GetContentRegionMax();
- const ImVec2 cursor_pos = window->Pos + ImGui::GetCursorPos();
- ImVec2 size = size_arg;
+ const ImVec2 content_avail = ImGui::GetContentRegionAvail();
+ ImVec2 size = ImRound(size_arg);
if (size.x <= 0.0f)
{
if (size.x == 0.0f)
flags |= ImGuiWindowFlags_ChildWindowAutoFitX;
- size.x = ImMax(content_max.x - cursor_pos.x, g.Style.WindowMinSize.x) - fabsf(size.x);
+ size.x = ImMax(content_avail.x, 4.0f) - fabsf(size.x); // Arbitrary minimum zero-ish child size of 4.0f (0.0f causing too much issues)
}
if (size.y <= 0.0f)
{
if (size.y == 0.0f)
flags |= ImGuiWindowFlags_ChildWindowAutoFitY;
- size.y = ImMax(content_max.y - cursor_pos.y, g.Style.WindowMinSize.y) - fabsf(size.y);
+ size.y = ImMax(content_avail.y, 4.0f) - fabsf(size.y);
}
if (border)
flags |= ImGuiWindowFlags_ShowBorders;
@@ -2981,7 +3290,7 @@ bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border,
bool ImGui::BeginChild(ImGuiID id, const ImVec2& size, bool border, ImGuiWindowFlags extra_flags)
{
char str_id[32];
- ImFormatString(str_id, IM_ARRAYSIZE(str_id), "child_%x", id);
+ ImFormatString(str_id, IM_ARRAYSIZE(str_id), "child_%08x", id);
bool ret = ImGui::BeginChild(str_id, size, border, extra_flags);
return ret;
}
@@ -2991,7 +3300,7 @@ void ImGui::EndChild()
ImGuiWindow* window = GetCurrentWindow();
IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow);
- if (window->Flags & ImGuiWindowFlags_ComboBox)
+ if ((window->Flags & ImGuiWindowFlags_ComboBox) || window->BeginCount > 1)
{
ImGui::End();
}
@@ -3000,11 +3309,11 @@ void ImGui::EndChild()
// When using auto-filling child window, we don't provide full width/height to ItemSize so that it doesn't feed back into automatic size-fitting.
ImGuiState& g = *GImGui;
ImVec2 sz = ImGui::GetWindowSize();
- if (window->Flags & ImGuiWindowFlags_ChildWindowAutoFitX)
- sz.x = ImMax(g.Style.WindowMinSize.x, sz.x - g.Style.WindowPadding.x);
+ if (window->Flags & ImGuiWindowFlags_ChildWindowAutoFitX) // Arbitrary minimum zeroish child size of 4.0f
+ sz.x = ImMax(4.0f, sz.x - g.Style.WindowPadding.x);
if (window->Flags & ImGuiWindowFlags_ChildWindowAutoFitY)
- sz.y = ImMax(g.Style.WindowMinSize.y, sz.y - g.Style.WindowPadding.y);
-
+ sz.y = ImMax(4.0f, sz.y - g.Style.WindowPadding.y);
+
ImGui::End();
window = GetCurrentWindow();
@@ -3015,13 +3324,13 @@ void ImGui::EndChild()
}
// Helper to create a child window / scrolling region that looks like a normal widget frame.
-void ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size)
+bool ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags)
{
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, style.Colors[ImGuiCol_FrameBg]);
ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, style.FrameRounding);
- ImGui::BeginChild(id, size);
+ return ImGui::BeginChild(id, size, false, ImGuiWindowFlags_NoMove | extra_flags);
}
void ImGui::EndChildFrame()
@@ -3034,25 +3343,26 @@ void ImGui::EndChildFrame()
// Save and compare stack sizes on Begin()/End() to detect usage errors
static void CheckStacksSize(ImGuiWindow* window, bool write)
{
- // NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
+ // NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
ImGuiState& g = *GImGui;
int* p_backup = &window->DC.StackSizesBackup[0];
- { int current = (int)window->IDStack.size(); if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopID()
- { int current = (int)window->DC.GroupStack.size(); if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot EndGroup()
- { int current = (int)g.ColorModifiers.size(); if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleColor()
- { int current = (int)g.StyleModifiers.size(); if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleVar()
- { int current = (int)g.FontStack.size(); if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopFont()
+ { int current = window->IDStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopID()
+ { int current = window->DC.GroupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot EndGroup()
+ { int current = g.CurrentPopupStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot EndPopup()/EndMenu()
+ { int current = g.ColorModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleColor()
+ { int current = g.StyleModifiers.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopStyleVar()
+ { int current = g.FontStack.Size; if (write) *p_backup = current; else IM_ASSERT(*p_backup == current); p_backup++; } // User forgot PopFont()
IM_ASSERT(p_backup == window->DC.StackSizesBackup + IM_ARRAYSIZE(window->DC.StackSizesBackup));
}
-static ImVec2 FindBestWindowPos(const ImVec2& mouse_pos, const ImVec2& size, int* last_dir, const ImRect& r_inner)
+static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size, ImGuiWindowFlags flags, int* last_dir, const ImRect& r_inner)
{
const ImGuiStyle& style = GImGui->Style;
// Clamp into visible area while not overlapping the cursor
- ImRect r_outer(GetVisibleRect());
+ ImRect r_outer(GetVisibleRect());
r_outer.Reduce(style.DisplaySafeAreaPadding);
- ImVec2 mouse_pos_clamped = ImClamp(mouse_pos, r_outer.Min, r_outer.Max - size);
+ ImVec2 base_pos_clamped = ImClamp(base_pos, r_outer.Min, r_outer.Max - size);
for (int n = (*last_dir != -1) ? -1 : 0; n < 4; n++) // Right, down, up, left. Favor last used direction.
{
@@ -3061,12 +3371,19 @@ static ImVec2 FindBestWindowPos(const ImVec2& mouse_pos, const ImVec2& size, int
if (rect.GetWidth() < size.x || rect.GetHeight() < size.y)
continue;
*last_dir = dir;
- return ImVec2(dir == 0 ? r_inner.Max.x : dir == 3 ? r_inner.Min.x - size.x : mouse_pos_clamped.x, dir == 1 ? r_inner.Max.y : dir == 2 ? r_inner.Min.y - size.y : mouse_pos_clamped.y);
+ return ImVec2(dir == 0 ? r_inner.Max.x : dir == 3 ? r_inner.Min.x - size.x : base_pos_clamped.x, dir == 1 ? r_inner.Max.y : dir == 2 ? r_inner.Min.y - size.y : base_pos_clamped.y);
}
// Fallback
*last_dir = -1;
- return mouse_pos + ImVec2(2,2);
+ if (flags & ImGuiWindowFlags_Tooltip) // For tooltip we prefer avoiding the cursor at all cost even if it means that part of the tooltip won't be visible.
+ return base_pos + ImVec2(2,2);
+
+ // Otherwise try to keep within display
+ ImVec2 pos = base_pos;
+ pos.x = ImMax(ImMin(pos.x + size.x, r_outer.Max.x) - size.x, r_outer.Min.x);
+ pos.y = ImMax(ImMin(pos.y + size.y, r_outer.Max.y) - size.y, r_outer.Min.y);
+ return pos;
}
static ImGuiWindow* FindWindowByName(const char* name)
@@ -3074,7 +3391,7 @@ static ImGuiWindow* FindWindowByName(const char* name)
// FIXME-OPT: Store sorted hashes -> pointers.
ImGuiState& g = *GImGui;
ImGuiID id = ImHash(name, 0);
- for (size_t i = 0; i < g.Windows.size(); i++)
+ for (int i = 0; i < g.Windows.Size; i++)
if (g.Windows[i]->ID == id)
return g.Windows[i];
return NULL;
@@ -3127,24 +3444,27 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
{
- window->AutoFitFrames = 2;
+ window->AutoFitFramesX = window->AutoFitFramesY = 2;
window->AutoFitOnlyGrows = false;
}
- else if (ImLengthSqr(window->Size) < 0.00001f)
+ else
{
- window->AutoFitFrames = 2;
- window->AutoFitOnlyGrows = true;
+ if (window->Size.x <= 0.0f)
+ window->AutoFitFramesX = 2;
+ if (window->Size.y <= 0.0f)
+ window->AutoFitFramesY = 2;
+ window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0);
}
g.Windows.push_back(window);
return window;
}
-// Push a new ImGui window to add widgets to.
-// - 'size' for a regular window denote the initial size for first-time creation (no saved data) and isn't that useful. Use SetNextWindowSize() prior to calling Begin() for more flexible window manipulation.
+// Push a new ImGui window to add widgets to.
// - A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair.
// - Begin/End can be called multiple times during the frame with the same window name to append content.
-// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file).
+// - 'size_on_first_use' for a regular window denote the initial size for first-time creation (no saved data) and isn't that useful. Use SetNextWindowSize() prior to calling Begin() for more flexible window manipulation.
+// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file).
// You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file.
// - Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned.
// - 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.
@@ -3158,8 +3478,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
{
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
+ IM_ASSERT(name != NULL); // Window name required
IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
- IM_ASSERT(name != NULL); // Must pass a name
+ IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet
+
+ if (flags & ImGuiWindowFlags_NoInputs)
+ flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
// Find or create
bool window_is_new = false;
@@ -3169,34 +3493,67 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window = CreateNewWindow(name, size_on_first_use, flags);
window_is_new = true;
}
- window->Flags = (ImGuiWindowFlags)flags;
const int current_frame = ImGui::GetFrameCount();
- const bool window_was_visible = (window->LastFrameDrawn == current_frame - 1); // Not using !WasActive because the implicit "Debug" window would always toggle off->on
+ const bool first_begin_of_the_frame = (window->LastFrameDrawn != current_frame);
+ if (first_begin_of_the_frame)
+ window->Flags = (ImGuiWindowFlags)flags;
+ else
+ flags = window->Flags;
// Add to stack
ImGuiWindow* parent_window = !g.CurrentWindowStack.empty() ? g.CurrentWindowStack.back() : NULL;
g.CurrentWindowStack.push_back(window);
SetCurrentWindow(window);
CheckStacksSize(window, true);
+ IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow));
+
+ bool window_was_visible = (window->LastFrameDrawn == current_frame - 1); // Not using !WasActive because the implicit "Debug" window would always toggle off->on
+ if (flags & ImGuiWindowFlags_Popup)
+ {
+ ImGuiPopupRef& popup_ref = g.OpenedPopupStack[g.CurrentPopupStack.Size];
+ window_was_visible &= (window->PopupID == popup_ref.PopupID);
+ window_was_visible &= (window == popup_ref.Window);
+ popup_ref.Window = window;
+ g.CurrentPopupStack.push_back(popup_ref);
+ window->PopupID = popup_ref.PopupID;
+ }
// Process SetNextWindow***() calls
- bool window_pos_set_by_api = false;
+ bool window_pos_set_by_api = false, window_size_set_by_api = false;
if (g.SetNextWindowPosCond)
{
const ImVec2 backup_cursor_pos = window->DC.CursorPos; // FIXME: not sure of the exact reason of this anymore :( need to look into that.
if (!window_was_visible) window->SetWindowPosAllowFlags |= ImGuiSetCond_Appearing;
window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.SetNextWindowPosCond) != 0;
- ImGui::SetWindowPos(g.SetNextWindowPosVal, g.SetNextWindowPosCond);
+ if (window_pos_set_by_api && ImLengthSqr(g.SetNextWindowPosVal - ImVec2(-FLT_MAX,-FLT_MAX)) < 0.001f)
+ {
+ window->SetWindowPosCenterWanted = true; // May be processed on the next frame if this is our first frame and we are measuring size
+ window->SetWindowPosAllowFlags &= ~(ImGuiSetCond_Once | ImGuiSetCond_FirstUseEver | ImGuiSetCond_Appearing);
+ }
+ else
+ {
+ ImGui::SetWindowPos(g.SetNextWindowPosVal, g.SetNextWindowPosCond);
+ }
window->DC.CursorPos = backup_cursor_pos;
g.SetNextWindowPosCond = 0;
}
if (g.SetNextWindowSizeCond)
{
if (!window_was_visible) window->SetWindowSizeAllowFlags |= ImGuiSetCond_Appearing;
+ window_size_set_by_api = (window->SetWindowSizeAllowFlags & g.SetNextWindowSizeCond) != 0;
ImGui::SetWindowSize(g.SetNextWindowSizeVal, g.SetNextWindowSizeCond);
g.SetNextWindowSizeCond = 0;
}
+ if (g.SetNextWindowContentSizeCond)
+ {
+ window->SizeContentsExplicit = g.SetNextWindowContentSizeVal;
+ g.SetNextWindowContentSizeCond = 0;
+ }
+ else if (first_begin_of_the_frame)
+ {
+ window->SizeContentsExplicit = ImVec2(0.0f, 0.0f);
+ }
if (g.SetNextWindowCollapsedCond)
{
if (!window_was_visible) window->SetWindowCollapsedAllowFlags |= ImGuiSetCond_Appearing;
@@ -3210,59 +3567,57 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
// Update known root window (if we are a child window, otherwise window == window->RootWindow)
- size_t root_idx = g.CurrentWindowStack.size() - 1;
- while (root_idx > 0)
- {
- if ((g.CurrentWindowStack[root_idx]->Flags & ImGuiWindowFlags_ChildWindow) == 0)
+ int root_idx, root_non_popup_idx;
+ for (root_idx = g.CurrentWindowStack.Size - 1; root_idx > 0; root_idx--)
+ if (!(g.CurrentWindowStack[root_idx]->Flags & ImGuiWindowFlags_ChildWindow))
+ break;
+ for (root_non_popup_idx = root_idx; root_non_popup_idx > 0; root_non_popup_idx--)
+ if (!(g.CurrentWindowStack[root_non_popup_idx]->Flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup)))
break;
- root_idx--;
- }
window->RootWindow = g.CurrentWindowStack[root_idx];
+ window->RootNonPopupWindow = g.CurrentWindowStack[root_non_popup_idx]; // This is merely for displaying the TitleBgActive color.
// Default alpha
if (bg_alpha < 0.0f)
bg_alpha = style.WindowFillAlphaDefault;
// When reusing window again multiple times a frame, just append content (don't need to setup again)
- const bool first_begin_of_the_frame = (window->LastFrameDrawn != current_frame);
if (first_begin_of_the_frame)
{
window->Active = true;
+ window->BeginCount = 0;
window->DrawList->Clear();
- window->ClipRectStack.resize(0);
+ window->ClipRect = ImVec4(-FLT_MAX,-FLT_MAX,+FLT_MAX,+FLT_MAX);
window->LastFrameDrawn = current_frame;
window->IDStack.resize(1);
- }
- // Setup texture, outer clipping rectangle
- window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
- if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ComboBox))
- PushClipRect(parent_window->ClipRectStack.back());
- else
- PushClipRect(GetVisibleRect());
+ // Setup texture, outer clipping rectangle
+ window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_ComboBox|ImGuiWindowFlags_Popup)))
+ PushClipRect(parent_window->ClipRect);
+ else
+ PushClipRect(GetVisibleRect());
- if (first_begin_of_the_frame)
- {
// New windows appears in front
if (!window_was_visible)
{
window->AutoPosLastDirection = -1;
- if (!(flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Tooltip))
- {
- FocusWindow(window);
+ if (!(flags & ImGuiWindowFlags_NoFocusOnAppearing))
+ if (!(flags & (ImGuiWindowFlags_ChildWindow|ImGuiWindowFlags_Tooltip)) || (flags & ImGuiWindowFlags_Popup))
+ FocusWindow(window);
- // Popup first latch mouse position, will position itself when it appears next frame
- if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
- window->PosFloat = g.IO.MousePos;
- }
+ // Popup first latch mouse position, will position itself when it appears next frame
+ if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
+ window->PosFloat = g.IO.MousePos;
}
// Collapse window by double-clicking on title bar
// At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing
if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse))
{
- if (g.HoveredWindow == window && IsMouseHoveringRect(window->TitleBarRect()) && g.IO.MouseDoubleClicked[0])
+ ImRect title_bar_rect = window->TitleBarRect();
+ if (g.HoveredWindow == window && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0])
{
window->Collapsed = !window->Collapsed;
if (!(flags & ImGuiWindowFlags_NoSavedSettings))
@@ -3281,30 +3636,42 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// SIZE
- // Save contents size from last frame for auto-fitting
- window->SizeContents = window_is_new ? ImVec2(0.0f, 0.0f) : window->DC.CursorMaxPos - window->Pos;
- window->SizeContents.y += window->ScrollY;
+ // Save contents size from last frame for auto-fitting (unless explicitly specified)
+ window->SizeContents.x = (window->SizeContentsExplicit.x != 0.0f) ? window->SizeContentsExplicit.x : ((window_is_new ? 0.0f : window->DC.CursorMaxPos.x - window->Pos.x) + window->Scroll.x);
+ window->SizeContents.y = (window->SizeContentsExplicit.y != 0.0f) ? window->SizeContentsExplicit.y : ((window_is_new ? 0.0f : window->DC.CursorMaxPos.y - window->Pos.y) + window->Scroll.y);
// Hide popup/tooltip window when first appearing while we measure size (because we recycle them)
- if ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0 && !window->WasActive)
+ if ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0 && !window_was_visible)
{
window->HiddenFrames = 1;
- window->Size = window->SizeFull = window->SizeContents = ImVec2(0.f, 0.f); // TODO: We don't support SetNextWindowSize() for tooltips or popups yet
+ if (flags & ImGuiWindowFlags_AlwaysAutoResize)
+ {
+ if (!window_size_set_by_api)
+ window->Size = window->SizeFull = ImVec2(0.f, 0.f);
+ window->SizeContents = ImVec2(0.f, 0.f);
+ }
}
+ // Lock window padding so that altering the ShowBorders flag for children doesn't have side-effects.
+ window->WindowPadding = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_ShowBorders | ImGuiWindowFlags_ComboBox | ImGuiWindowFlags_Popup))) ? ImVec2(0,0) : style.WindowPadding;
+
// Calculate auto-fit size
ImVec2 size_auto_fit;
if ((flags & ImGuiWindowFlags_Tooltip) != 0)
{
// Tooltip always resize. We keep the spacing symmetric on both axises for aesthetic purpose.
- size_auto_fit = window->SizeContents + style.WindowPadding - ImVec2(0.0f, style.ItemSpacing.y);
+ size_auto_fit = window->SizeContents + window->WindowPadding - ImVec2(0.0f, style.ItemSpacing.y);
}
else
{
- size_auto_fit = ImClamp(window->SizeContents + style.WindowPadding, style.WindowMinSize, ImMax(style.WindowMinSize, g.IO.DisplaySize - style.WindowPadding));
- if (size_auto_fit.y < window->SizeContents.y + style.WindowPadding.y)
- size_auto_fit.x += style.ScrollbarWidth;
- size_auto_fit.y -= style.ItemSpacing.y;
+ size_auto_fit = ImClamp(window->SizeContents + window->WindowPadding, style.WindowMinSize, ImMax(style.WindowMinSize, g.IO.DisplaySize - window->WindowPadding));
+
+ // Handling case of auto fit window not fitting in screen on one axis, we are growing auto fit size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
+ if (size_auto_fit.x < window->SizeContents.x && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar))
+ size_auto_fit.y += style.ScrollbarSize;
+ if (size_auto_fit.y < window->SizeContents.y && !(flags & ImGuiWindowFlags_NoScrollbar))
+ size_auto_fit.x += style.ScrollbarSize;
+ size_auto_fit.y = ImMax(size_auto_fit.y - style.ItemSpacing.y, 0.0f);
}
// Handle automatic resize
@@ -3312,20 +3679,25 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
{
// We still process initial auto-fit on collapsed windows to get a window width,
// But otherwise we don't honor ImGuiWindowFlags_AlwaysAutoResize when collapsed.
- if (window->AutoFitFrames > 0)
- window->SizeFull = window->AutoFitOnlyGrows ? ImMax(window->SizeFull, size_auto_fit) : size_auto_fit;
+ if (window->AutoFitFramesX > 0)
+ window->SizeFull.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x;
+ if (window->AutoFitFramesY > 0)
+ window->SizeFull.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y;
window->Size = window->TitleBarRect().GetSize();
}
else
{
- if (flags & ImGuiWindowFlags_AlwaysAutoResize)
+ if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window_size_set_by_api)
{
window->SizeFull = size_auto_fit;
}
- else if (window->AutoFitFrames > 0)
+ else if ((window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) && !window_size_set_by_api)
{
// Auto-fit only grows during the first few frames
- window->SizeFull = window->AutoFitOnlyGrows ? ImMax(window->SizeFull, size_auto_fit) : size_auto_fit;
+ if (window->AutoFitFramesX > 0)
+ window->SizeFull.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x;
+ if (window->AutoFitFramesY > 0)
+ window->SizeFull.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y;
if (!(flags & ImGuiWindowFlags_NoSavedSettings))
MarkSettingsDirty();
}
@@ -3333,35 +3705,58 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
// Minimum window size
- if (!(flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Tooltip))
+ if (!(flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize)))
+ {
window->SizeFull = ImMax(window->SizeFull, style.WindowMinSize);
+ if (!window->Collapsed)
+ window->Size = window->SizeFull;
+ }
// POSITION
// Position child window
if (flags & ImGuiWindowFlags_ChildWindow)
- {
parent_window->DC.ChildWindows.push_back(window);
+ if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup))
+ {
window->Pos = window->PosFloat = parent_window->DC.CursorPos;
- window->SizeFull = size_on_first_use; // NB: argument name 'size_on_first_use' misleading here, it's really just 'size' as provided by user.
+ window->Size = window->SizeFull = size_on_first_use; // NB: argument name 'size_on_first_use' misleading here, it's really just 'size' as provided by user.
}
- // Position popup
- if ((flags & ImGuiWindowFlags_Popup) != 0 && window_appearing_after_being_hidden && !window_pos_set_by_api)
+ bool window_pos_center = false;
+ window_pos_center |= (window->SetWindowPosCenterWanted && window->HiddenFrames == 0);
+ window_pos_center |= ((flags & ImGuiWindowFlags_Modal) && !window_pos_set_by_api && window_appearing_after_being_hidden);
+ if (window_pos_center)
+ {
+ // Center (any sort of window)
+ ImRect fullscreen_rect(GetVisibleRect());
+ SetWindowPos(ImMax(style.DisplaySafeAreaPadding, fullscreen_rect.GetCenter() - window->SizeFull * 0.5f));
+ }
+ else if (flags & ImGuiWindowFlags_ChildMenu)
+ {
+ IM_ASSERT(window_pos_set_by_api);
+ ImRect rect_to_avoid;
+ if (parent_window->DC.MenuBarAppending)
+ rect_to_avoid = ImRect(-FLT_MAX, parent_window->Pos.y + parent_window->TitleBarHeight(), FLT_MAX, parent_window->Pos.y + parent_window->TitleBarHeight() + parent_window->MenuBarHeight());
+ else
+ rect_to_avoid = ImRect(parent_window->Pos.x + style.ItemSpacing.x, -FLT_MAX, parent_window->Pos.x + parent_window->Size.x - style.ItemSpacing.x - parent_window->ScrollbarSizes.x, FLT_MAX); // We want some overlap to convey the relative depth of each popup (here hard-coded to 4)
+ window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
+ }
+ else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_appearing_after_being_hidden)
{
ImRect rect_to_avoid(window->PosFloat.x - 1, window->PosFloat.y - 1, window->PosFloat.x + 1, window->PosFloat.y + 1);
- window->PosFloat = FindBestWindowPos(window->PosFloat, window->Size, &window->AutoPosLastDirection, rect_to_avoid);
+ window->PosFloat = FindBestPopupWindowPos(window->PosFloat, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
}
// Position tooltip (always follows mouse)
if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api)
{
ImRect rect_to_avoid(g.IO.MousePos.x - 16, g.IO.MousePos.y - 8, g.IO.MousePos.x + 24, g.IO.MousePos.y + 24); // FIXME: Completely hard-coded. Perhaps center on cursor hit-point instead?
- window->PosFloat = FindBestWindowPos(g.IO.MousePos, window->Size, &window->AutoPosLastDirection, rect_to_avoid);
+ window->PosFloat = FindBestPopupWindowPos(g.IO.MousePos, window->Size, flags, &window->AutoPosLastDirection, rect_to_avoid);
}
// User moving window (at the beginning of the frame to avoid input lag or sheering). Only valid for root windows.
- RegisterAliveId(window->MoveID);
+ KeepAliveID(window->MoveID);
if (g.ActiveId == window->MoveID)
{
if (g.IO.MouseDown[0])
@@ -3377,15 +3772,15 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
else
{
- SetActiveId(0);
+ SetActiveID(0);
g.MovedWindow = NULL; // Not strictly necessary but doing it for sanity.
}
}
- // Clamp into display
+ // Clamp position so it stays visible
if (!(flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Tooltip))
{
- if (window->AutoFitFrames <= 0 && g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
+ if (!window_pos_set_by_api && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
{
ImVec2 padding = ImMax(style.DisplayWindowPadding, style.DisplaySafeAreaPadding);
window->PosFloat = ImMax(window->PosFloat + window->Size, padding) - window->Size;
@@ -3398,26 +3793,36 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
if (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize))
window->ItemWidthDefault = (float)(int)(window->Size.x * 0.65f);
else
- window->ItemWidthDefault = 200.0f;
+ window->ItemWidthDefault = (float)(int)(g.FontSize * 16.0f);
// Prepare for focus requests
- if (window->FocusIdxAllRequestNext == IM_INT_MAX || window->FocusIdxAllCounter == -1)
- window->FocusIdxAllRequestCurrent = IM_INT_MAX;
- else
- window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1);
- if (window->FocusIdxTabRequestNext == IM_INT_MAX || window->FocusIdxTabCounter == -1)
- window->FocusIdxTabRequestCurrent = IM_INT_MAX;
- else
- window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1);
+ window->FocusIdxAllRequestCurrent = (window->FocusIdxAllRequestNext == IM_INT_MAX || window->FocusIdxAllCounter == -1) ? IM_INT_MAX : (window->FocusIdxAllRequestNext + (window->FocusIdxAllCounter+1)) % (window->FocusIdxAllCounter+1);
+ window->FocusIdxTabRequestCurrent = (window->FocusIdxTabRequestNext == IM_INT_MAX || window->FocusIdxTabCounter == -1) ? IM_INT_MAX : (window->FocusIdxTabRequestNext + (window->FocusIdxTabCounter+1)) % (window->FocusIdxTabCounter+1);
window->FocusIdxAllCounter = window->FocusIdxTabCounter = -1;
window->FocusIdxAllRequestNext = window->FocusIdxTabRequestNext = IM_INT_MAX;
// Apply scrolling
- window->ScrollY = window->NextScrollY;
- window->ScrollY = ImMax(window->ScrollY, 0.0f);
+ if (window->ScrollTarget.x < FLT_MAX)
+ {
+ window->Scroll.x = window->ScrollTarget.x;
+ window->ScrollTarget.x = FLT_MAX;
+ }
+ if (window->ScrollTarget.y < FLT_MAX)
+ {
+ float center_ratio = window->ScrollTargetCenterRatio.y;
+ window->Scroll.y = window->ScrollTarget.y - ((1.0f - center_ratio) * window->TitleBarHeight()) - (center_ratio * window->SizeFull.y);
+ window->ScrollTarget.y = FLT_MAX;
+ }
+ window->Scroll = ImMax(window->Scroll, ImVec2(0.0f, 0.0f));
if (!window->Collapsed && !window->SkipItems)
- window->ScrollY = ImMin(window->ScrollY, ImMax(0.0f, window->SizeContents.y - window->SizeFull.y));
- window->NextScrollY = window->ScrollY;
+ window->Scroll = ImMin(window->Scroll, ImMax(ImVec2(0.0f, 0.0f), window->SizeContents - window->SizeFull + window->ScrollbarSizes));
+
+ // Modal window darkens what is behind them
+ if ((flags & ImGuiWindowFlags_Modal) != 0 && window == GetFrontMostModalRootWindow())
+ {
+ ImRect fullscreen_rect = GetVisibleRect();
+ window->DrawList->AddRectFilled(fullscreen_rect.Min, fullscreen_rect.Max, window->Color(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
+ }
// Draw window + handle manual resize
ImRect title_bar_rect = window->TitleBarRect();
@@ -3435,10 +3840,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
else
{
ImU32 resize_col = 0;
- if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFrames <= 0 && !(flags & ImGuiWindowFlags_NoResize))
+ const float resize_corner_size = ImMax(g.FontSize * 1.35f, window_rounding + 1.0f + g.FontSize * 0.2f);
+ if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && !(flags & ImGuiWindowFlags_NoResize))
{
// Manual resize
- const ImRect resize_rect(window->Rect().GetBR()-ImVec2(14,14), window->Rect().GetBR());
+ const ImVec2 br = window->Rect().GetBR();
+ const ImRect resize_rect(br - ImVec2(resize_corner_size * 0.75f, resize_corner_size * 0.75f), br);
const ImGuiID resize_id = window->GetID("#RESIZE");
bool hovered, held;
ButtonBehavior(resize_rect, resize_id, &hovered, &held, true, ImGuiButtonFlags_FlattenChilds);
@@ -3453,7 +3860,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->SizeFull = size_auto_fit;
if (!(flags & ImGuiWindowFlags_NoSavedSettings))
MarkSettingsDirty();
- SetActiveId(0);
+ SetActiveID(0);
}
else if (held)
{
@@ -3466,8 +3873,10 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
title_bar_rect = window->TitleBarRect();
}
- // Scrollbar
- window->ScrollbarY = (window->SizeContents.y > window->Size.y) && !(flags & ImGuiWindowFlags_NoScrollbar);
+ // Scrollbars
+ window->ScrollbarY = (window->SizeContents.y > window->Size.y + style.ItemSpacing.y) && !(flags & ImGuiWindowFlags_NoScrollbar);
+ window->ScrollbarX = (window->SizeContents.x > window->Size.x - (window->ScrollbarY ? style.ScrollbarSize : 0.0f) - window->WindowPadding.x) && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar);
+ window->ScrollbarSizes = ImVec2(window->ScrollbarY ? style.ScrollbarSize : 0.0f, window->ScrollbarX ? style.ScrollbarSize : 0.0f);
// Window background
if (bg_alpha > 0.0f)
@@ -3476,15 +3885,24 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ComboBg, bg_alpha), window_rounding);
else if ((flags & ImGuiWindowFlags_Tooltip) != 0)
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_TooltipBg, bg_alpha), window_rounding);
+ else if ((flags & ImGuiWindowFlags_Popup) != 0)
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
else if ((flags & ImGuiWindowFlags_ChildWindow) != 0)
- window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size-ImVec2(window->ScrollbarY?style.ScrollbarWidth:0.0f,0.0f), window->Color(ImGuiCol_ChildWindowBg, bg_alpha), window_rounding, window->ScrollbarY ? (1|8) : (0xF));
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ChildWindowBg, bg_alpha), window_rounding);
else
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
}
// Title bar
if (!(flags & ImGuiWindowFlags_NoTitleBar))
- window->DrawList->AddRectFilled(title_bar_rect.GetTL(), title_bar_rect.GetBR(), window->Color(ImGuiCol_TitleBg), window_rounding, 1|2);
+ window->DrawList->AddRectFilled(title_bar_rect.GetTL(), title_bar_rect.GetBR(), window->Color((g.FocusedWindow && window->RootNonPopupWindow == g.FocusedWindow->RootNonPopupWindow) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg), window_rounding, 1|2);
+
+ // Menu bar
+ if (flags & ImGuiWindowFlags_MenuBar)
+ {
+ ImRect menu_bar_rect = window->MenuBarRect();
+ window->DrawList->AddRectFilled(menu_bar_rect.GetTL(), menu_bar_rect.GetBR(), window->Color(ImGuiCol_MenuBarBg), (flags & ImGuiWindowFlags_NoTitleBar) ? window_rounding : 0.0f, 1|2);
+ }
// Borders
if (flags & ImGuiWindowFlags_ShowBorders)
@@ -3495,47 +3913,46 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->DrawList->AddLine(title_bar_rect.GetBL(), title_bar_rect.GetBR(), window->Color(ImGuiCol_Border));
}
- // Scrollbar
+ // Scrollbars
+ if (window->ScrollbarX)
+ Scrollbar(window, true);
if (window->ScrollbarY)
- Scrollbar(window);
+ Scrollbar(window, false);
// Render resize grip
// (after the input handling so we don't have a frame of latency)
if (!(flags & ImGuiWindowFlags_NoResize))
{
- const float r = window_rounding;
const ImVec2 br = window->Rect().GetBR();
- if (r == 0.0f)
- {
- window->DrawList->AddTriangleFilled(br, br-ImVec2(0,14), br-ImVec2(14,0), resize_col);
- }
- else
- {
- // FIXME: We should draw 4 triangles and decide on a size that's not dependent on the rounding size (previously used 18)
- window->DrawList->AddArcFast(br - ImVec2(r,r), r, resize_col, 6, 9, true);
- window->DrawList->AddTriangleFilled(br+ImVec2(0,-2*r),br+ImVec2(0,-r),br+ImVec2(-r,-r), resize_col);
- window->DrawList->AddTriangleFilled(br+ImVec2(-r,-r), br+ImVec2(-r,0),br+ImVec2(-2*r,0), resize_col);
- }
+ window->DrawList->PathLineTo(br + ImVec2(-resize_corner_size, 0.0f));
+ window->DrawList->PathLineTo(br + ImVec2(0.0f, -resize_corner_size));
+ window->DrawList->PathArcToFast(ImVec2(br.x - window_rounding, br.y - window_rounding), window_rounding, 0, 3);
+ window->DrawList->PathFill(resize_col);
}
}
// Setup drawing context
- window->DC.ColumnsStartX = window->WindowPadding().x;
+ window->DC.ColumnsStartX = 0.0f + window->WindowPadding.x - window->Scroll.x;
window->DC.ColumnsOffsetX = 0.0f;
- window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.ColumnsStartX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->WindowPadding().y) - ImVec2(0.0f, window->ScrollY);
+ window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.ColumnsStartX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->MenuBarHeight() + window->WindowPadding.y - window->Scroll.y);
window->DC.CursorPos = window->DC.CursorStartPos;
window->DC.CursorPosPrevLine = window->DC.CursorPos;
window->DC.CursorMaxPos = window->DC.CursorStartPos;
window->DC.CurrentLineHeight = window->DC.PrevLineHeight = 0.0f;
window->DC.CurrentLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f;
+ window->DC.MenuBarAppending = false;
+ window->DC.MenuBarOffsetX = ImMax(window->WindowPadding.x, style.ItemSpacing.x);
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
window->DC.ChildWindows.resize(0);
- window->DC.ItemWidth.resize(0);
- window->DC.ItemWidth.push_back(window->ItemWidthDefault);
- window->DC.AllowKeyboardFocus.resize(0);
- window->DC.AllowKeyboardFocus.push_back(true);
- window->DC.TextWrapPos.resize(0);
- window->DC.TextWrapPos.push_back(-1.0f); // disabled
+ window->DC.LayoutType = ImGuiLayoutType_Vertical;
+ window->DC.ItemWidth = window->ItemWidthDefault;
+ window->DC.TextWrapPos = -1.0f; // disabled
+ window->DC.AllowKeyboardFocus = true;
+ window->DC.ButtonRepeat = false;
+ window->DC.ItemWidthStack.resize(0);
+ window->DC.TextWrapPosStack.resize(0);
+ window->DC.AllowKeyboardFocusStack.resize(0);
+ window->DC.ButtonRepeatStack.resize(0);
window->DC.ColorEditMode = ImGuiColorEditMode_UserSelect;
window->DC.ColumnsCurrent = 0;
window->DC.ColumnsCount = 1;
@@ -3544,9 +3961,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->DC.TreeDepth = 0;
window->DC.StateStorage = &window->StateStorage;
window->DC.GroupStack.resize(0);
+ window->MenuColumns.Update(3, style.ItemSpacing.x, !window_was_visible);
- if (window->AutoFitFrames > 0)
- window->AutoFitFrames--;
+ if (window->AutoFitFramesX > 0)
+ window->AutoFitFramesX--;
+ if (window->AutoFitFramesY > 0)
+ window->AutoFitFramesY--;
// Title bar
if (!(flags & ImGuiWindowFlags_NoTitleBar))
@@ -3557,7 +3977,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
const ImVec2 text_size = CalcTextSize(name, NULL, true);
if (!(flags & ImGuiWindowFlags_NoCollapse))
RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true);
-
+
ImVec2 text_min = window->Pos + style.FramePadding;
ImVec2 text_max = window->Pos + ImVec2(window->Size.x - style.FramePadding.x, style.FramePadding.y*2 + text_size.y);
ImVec2 clip_max = ImVec2(window->Pos.x + window->Size.x - (p_opened ? title_bar_rect.GetHeight() - 3 : style.FramePadding.x), text_max.y); // Match the size of CloseWindowButton()
@@ -3566,24 +3986,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
if (style.WindowTitleAlign & ImGuiAlign_Center) pad_right = pad_left;
if (pad_left) text_min.x += g.FontSize + style.ItemInnerSpacing.x;
if (pad_right) text_max.x -= g.FontSize + style.ItemInnerSpacing.x;
- RenderTextClipped(text_min, name, NULL, &text_size, text_max, &clip_max, style.WindowTitleAlign);
- }
- if (flags & ImGuiWindowFlags_Popup)
- {
- if (p_opened)
- {
- if (g.IO.MouseClicked[0] && (!g.HoveredWindow || g.HoveredWindow->RootWindow != window))
- *p_opened = false;
- else if (!g.FocusedWindow)
- *p_opened = false;
- else if (g.FocusedWindow->RootWindow != window)// && !(g.FocusedWindow->RootWindow->Flags & ImGuiWindowFlags_Tooltip))
- *p_opened = false;
- }
+ RenderTextClipped(text_min, text_max, name, NULL, &text_size, style.WindowTitleAlign, NULL, &clip_max);
}
// Save clipped aabb so we can access it in constant-time in FindHoveredWindow()
- window->ClippedRect = window->Rect();
- window->ClippedRect.Clip(window->ClipRectStack.front());
+ window->ClippedWindowRect = window->Rect();
+ window->ClippedWindowRect.Clip(window->ClipRect);
// Pressing CTRL+C while holding on a window copy its content to the clipboard
// This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope.
@@ -3599,14 +4007,17 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
const ImRect title_bar_rect = window->TitleBarRect();
- ImVec4 clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding().x*0.5f, title_bar_rect.Max.y+0.5f, window->Rect().Max.x+0.5f-window->WindowPadding().x*0.5f, window->Rect().Max.y-1.5f);
- if (window->ScrollbarY)
- clip_rect.z -= style.ScrollbarWidth;
+ ImRect clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding.x*0.5f, title_bar_rect.Max.y+window->MenuBarHeight()+0.5f, window->Pos.x+window->Size.x-window->WindowPadding.x*0.5f, window->Pos.y+window->Size.y);
+ if ((flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_ShowBorders))
+ clip_rect.Min += ImVec2(1.0f,1.0f);
+ clip_rect.Max.x -= window->ScrollbarY ? style.ScrollbarSize : 0.0f;
+ clip_rect.Max.y -= window->ScrollbarX ? style.ScrollbarSize : 0.0f;
PushClipRect(clip_rect);
// Clear 'accessed' flag last thing
if (first_begin_of_the_frame)
window->Accessed = false;
+ window->BeginCount++;
// Child window can be out of sight and have "negative" clip windows.
// Mark them as collapsed so commands are skipped earlier (we can't manually collapse because they have no title bar).
@@ -3615,8 +4026,8 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
window->Collapsed = parent_window && parent_window->Collapsed;
- const ImVec4 clip_rect_t = window->ClipRectStack.back();
- window->Collapsed |= (clip_rect_t.x >= clip_rect_t.z || clip_rect_t.y >= clip_rect_t.w);
+ if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
+ window->Collapsed |= (window->ClipRect.Min.x >= window->ClipRect.Max.x || window->ClipRect.Min.y >= window->ClipRect.Max.y);
// We also hide the window from rendering because we've already added its border to the command list.
// (we could perform the check earlier in the function but it is simpler at this point)
@@ -3627,7 +4038,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->Active = false;
// Return false if we don't intend to display anything to allow user to perform an early out optimization
- window->SkipItems = (window->Collapsed || !window->Active) && window->AutoFitFrames <= 0;
+ window->SkipItems = (window->Collapsed || !window->Active) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0;
return !window->SkipItems;
}
@@ -3638,8 +4049,6 @@ void ImGui::End()
ImGui::Columns(1, "#CloseColumns");
PopClipRect(); // inner window clip rectangle
- PopClipRect(); // outer window clip rectangle
- window->DrawList->PopTextureID();
// Stop logging
if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging
@@ -3647,82 +4056,115 @@ void ImGui::End()
// Pop
// NB: we don't clear 'window->RootWindow'. The pointer is allowed to live until the next call to Begin().
- CheckStacksSize(window, false);
g.CurrentWindowStack.pop_back();
+ if (window->Flags & ImGuiWindowFlags_Popup)
+ g.CurrentPopupStack.pop_back();
+ CheckStacksSize(window, false);
SetCurrentWindow(g.CurrentWindowStack.empty() ? NULL : g.CurrentWindowStack.back());
}
// Vertical scrollbar
// The entire piece of code below is rather confusing because:
// - We handle absolute seeking (when first clicking outside the grab) and relative manipulation (afterward or when clicking inside the grab)
-// - We store values as ratio and in a form that allows the window content to change while we are holding on a scrollbar
-static void Scrollbar(ImGuiWindow* window)
+// - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar
+// - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal.
+static void Scrollbar(ImGuiWindow* window, bool horizontal)
{
ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const ImGuiID id = window->GetID("#SCROLLY");
+ const ImGuiID id = window->GetID(horizontal ? "#SCROLLX" : "#SCROLLY");
// Render background
- ImRect bb(window->Rect().Max.x - style.ScrollbarWidth, window->Pos.y + window->TitleBarHeight()+1, window->Rect().Max.x, window->Rect().Max.y-1);
- window->DrawList->AddRectFilled(bb.Min, bb.Max, window->Color(ImGuiCol_ScrollbarBg));
- bb.Expand(-3.0f);
- const float scrollbar_height = bb.GetHeight();
+ bool other_scrollbar = (horizontal ? window->ScrollbarY : window->ScrollbarX);
+ float other_scrollbar_size_w = other_scrollbar ? style.ScrollbarSize : 0.0f;
+ const ImRect window_rect = window->Rect();
+ const float border_offset = (window->Flags & ImGuiWindowFlags_ShowBorders) ? 1.0f : 0.0f;
+ ImRect bb = horizontal
+ ? ImRect(window->Pos.x + border_offset, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - other_scrollbar_size_w, window_rect.Max.y)
+ : ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + window->TitleBarHeight() + border_offset, window_rect.Max.x, window_rect.Max.y - other_scrollbar_size_w);
+
+ float window_rounding = (window->Flags & ImGuiWindowFlags_ChildWindow) ? style.ChildWindowRounding : style.WindowRounding;
+ int window_rounding_corners;
+ if (horizontal)
+ window_rounding_corners = 8 | (other_scrollbar ? 0 : 4);
+ else
+ window_rounding_corners = ((window->Flags & ImGuiWindowFlags_NoTitleBar) ? 2 : 0) | (other_scrollbar ? 0 : 4);
+ window->DrawList->AddRectFilled(bb.Min, bb.Max, window->Color(ImGuiCol_ScrollbarBg), window_rounding, window_rounding_corners);
+ bb.Reduce(ImVec2(ImClamp((float)(int)((bb.Max.x - bb.Min.x - 2.0f) * 0.5f), 0.0f, 3.0f), ImClamp((float)(int)((bb.Max.y - bb.Min.y - 2.0f) * 0.5f), 0.0f, 3.0f)));
+
+ // V denote the main axis of the scrollbar
+ float scrollbar_size_v = horizontal ? bb.GetWidth() : bb.GetHeight();
+ float scroll_v = horizontal ? window->Scroll.x : window->Scroll.y;
+ float win_size_avail_v = (horizontal ? window->Size.x : window->Size.y) - other_scrollbar_size_w;
+ float win_size_contents_v = horizontal ? window->SizeContents.x : window->SizeContents.y;
// The grabable box size generally represent the amount visible (vs the total scrollable amount)
// But we maintain a minimum size in pixel to allow for the user to still aim inside.
- const float grab_h_pixels = ImMin(ImMax(scrollbar_height * ImSaturate(window->Size.y / ImMax(window->SizeContents.y, window->Size.y)), style.GrabMinSize), scrollbar_height);
- const float grab_h_norm = grab_h_pixels / scrollbar_height;
+ const float grab_h_pixels = ImMin(ImMax(scrollbar_size_v * ImSaturate(win_size_avail_v / ImMax(win_size_contents_v, win_size_avail_v)), style.GrabMinSize), scrollbar_size_v);
+ const float grab_h_norm = grab_h_pixels / scrollbar_size_v;
// Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar().
bool held = false;
bool hovered = false;
const bool previously_held = (g.ActiveId == id);
- ButtonBehavior(bb, id, &hovered, &held, true);
+ ImGui::ButtonBehavior(bb, id, &hovered, &held, true);
- const float scroll_max = ImMax(1.0f, window->SizeContents.y - window->Size.y);
- float scroll_ratio = ImSaturate(window->ScrollY / scroll_max);
- float grab_y_norm = scroll_ratio * (scrollbar_height - grab_h_pixels) / scrollbar_height;
- if (held)
+ float scroll_max = ImMax(1.0f, win_size_contents_v - win_size_avail_v);
+ float scroll_ratio = ImSaturate(scroll_v / scroll_max);
+ float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v;
+ if (held && grab_h_norm < 1.0f)
{
- const float clicked_y_norm = ImSaturate((g.IO.MousePos.y - bb.Min.y) / scrollbar_height); // Click position in scrollbar space (0.0f->1.0f)
- g.HoveredId = id;
+ float scrollbar_pos_v = horizontal ? bb.Min.x : bb.Min.y;
+ float mouse_pos_v = horizontal ? g.IO.MousePos.x : g.IO.MousePos.y;
+ float* click_delta_to_grab_center_v = horizontal ? &g.ScrollbarClickDeltaToGrabCenter.x : &g.ScrollbarClickDeltaToGrabCenter.y;
+
+ // Click position in scrollbar normalized space (0.0f->1.0f)
+ const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v);
+ ImGui::SetHoveredID(id);
bool seek_absolute = false;
if (!previously_held)
{
// On initial click calculate the distance between mouse and the center of the grab
- if (clicked_y_norm >= grab_y_norm && clicked_y_norm <= grab_y_norm + grab_h_norm)
+ if (clicked_v_norm >= grab_v_norm && clicked_v_norm <= grab_v_norm + grab_h_norm)
{
- g.ScrollbarClickDeltaToGrabCenter = clicked_y_norm - grab_y_norm - grab_h_norm*0.5f;
+ *click_delta_to_grab_center_v = clicked_v_norm - grab_v_norm - grab_h_norm*0.5f;
}
else
{
seek_absolute = true;
- g.ScrollbarClickDeltaToGrabCenter = 0;
+ *click_delta_to_grab_center_v = 0.0f;
}
}
// Apply scroll
- const float scroll_y_norm = ImSaturate((clicked_y_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm*0.5f) / (1.0f - grab_h_norm));
- window->ScrollY = (float)(int)(0.5f + scroll_y_norm * (window->SizeContents.y - window->Size.y));
- window->NextScrollY = window->ScrollY;
+ // It is ok to modify Scroll here because we are being called in Begin() after the calculation of SizeContents and before setting up our starting position
+ const float scroll_v_norm = ImSaturate((clicked_v_norm - *click_delta_to_grab_center_v - grab_h_norm*0.5f) / (1.0f - grab_h_norm));
+ scroll_v = (float)(int)(0.5f + scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v));
+ if (horizontal)
+ window->Scroll.x = scroll_v;
+ else
+ window->Scroll.y = scroll_v;
// Update values for rendering
- scroll_ratio = ImSaturate(window->ScrollY / scroll_max);
- grab_y_norm = scroll_ratio * (scrollbar_height - grab_h_pixels) / scrollbar_height;
+ scroll_ratio = ImSaturate(scroll_v / scroll_max);
+ grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v;
// Update distance to grab now that we have seeked and saturated
if (seek_absolute)
- g.ScrollbarClickDeltaToGrabCenter = clicked_y_norm - grab_y_norm - grab_h_norm*0.5f;
+ *click_delta_to_grab_center_v = clicked_v_norm - grab_v_norm - grab_h_norm*0.5f;
}
// Render
const ImU32 grab_col = window->Color(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab);
- window->DrawList->AddRectFilled(ImVec2(bb.Min.x, ImLerp(bb.Min.y, bb.Max.y, grab_y_norm)), ImVec2(bb.Max.x, ImLerp(bb.Min.y, bb.Max.y, grab_y_norm) + grab_h_pixels), grab_col, style.ScrollbarRounding);
+ if (horizontal)
+ window->DrawList->AddRectFilled(ImVec2(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm), bb.Min.y), ImVec2(ImLerp(bb.Min.x, bb.Max.x, grab_v_norm) + grab_h_pixels, bb.Max.y), grab_col, style.ScrollbarRounding);
+ else
+ window->DrawList->AddRectFilled(ImVec2(bb.Min.x, ImLerp(bb.Min.y, bb.Max.y, grab_v_norm)), ImVec2(bb.Max.x, ImLerp(bb.Min.y, bb.Max.y, grab_v_norm) + grab_h_pixels), grab_col, style.ScrollbarRounding);
}
// Moving window to front of display (which happens to be back of our sorted list)
-static void FocusWindow(ImGuiWindow* window)
+void ImGui::FocusWindow(ImGuiWindow* window)
{
ImGuiState& g = *GImGui;
@@ -3733,14 +4175,19 @@ static void FocusWindow(ImGuiWindow* window)
if (!window)
return;
- // And move its root window to the top of the pile
+ // And move its root window to the top of the pile
if (window->RootWindow)
window = window->RootWindow;
- if (g.Windows.back() == window)
- return;
+ // Steal focus on active widgets
+ if (window->Flags & ImGuiWindowFlags_Popup) // FIXME: This statement should be unnecessary. Need further testing before removing it..
+ if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != window)
+ ImGui::SetActiveID(0);
- for (size_t i = 0; i < g.Windows.size(); i++)
+ // Bring to front
+ if ((window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) || g.Windows.back() == window)
+ return;
+ for (int i = 0; i < g.Windows.Size; i++)
if (g.Windows[i] == window)
{
g.Windows.erase(g.Windows.begin() + i);
@@ -3752,47 +4199,49 @@ static void FocusWindow(ImGuiWindow* window)
void ImGui::PushItemWidth(float item_width)
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.ItemWidth.push_back(item_width == 0.0f ? window->ItemWidthDefault : item_width);
+ window->DC.ItemWidth = (item_width == 0.0f ? window->ItemWidthDefault : item_width);
+ window->DC.ItemWidthStack.push_back(window->DC.ItemWidth);
}
-static void PushMultiItemsWidths(int components, float w_full = 0.0f)
+static void PushMultiItemsWidths(int components, float w_full)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
const ImGuiStyle& style = GImGui->Style;
if (w_full <= 0.0f)
w_full = ImGui::CalcItemWidth();
const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)) / (float)components));
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)));
- window->DC.ItemWidth.push_back(w_item_last);
+ window->DC.ItemWidthStack.push_back(w_item_last);
for (int i = 0; i < components-1; i++)
- window->DC.ItemWidth.push_back(w_item_one);
+ window->DC.ItemWidthStack.push_back(w_item_one);
+ window->DC.ItemWidth = window->DC.ItemWidthStack.back();
}
void ImGui::PopItemWidth()
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.ItemWidth.pop_back();
+ window->DC.ItemWidthStack.pop_back();
+ window->DC.ItemWidth = window->DC.ItemWidthStack.empty() ? window->ItemWidthDefault : window->DC.ItemWidthStack.back();
}
float ImGui::CalcItemWidth()
{
- ImGuiWindow* window = GetCurrentWindow();
- float w = window->DC.ItemWidth.back();
+ ImGuiWindow* window = GetCurrentWindowRead();
+ float w = window->DC.ItemWidth;
if (w < 0.0f)
{
// 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.
ImGuiState& g = *GImGui;
- float width_to_right_edge = window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x;
+ float width_to_right_edge = ImGui::GetContentRegionAvail().x;
w = ImMax(1.0f, width_to_right_edge + w - g.Style.FramePadding.x * 2.0f);
}
w = (float)(int)w;
return w;
}
-static void SetFont(ImFont* font)
+static void SetCurrentFont(ImFont* font)
{
ImGuiState& g = *GImGui;
-
IM_ASSERT(font && font->IsLoaded());
IM_ASSERT(font->Scale > 0.0f);
g.Font = font;
@@ -3804,11 +4253,9 @@ static void SetFont(ImFont* font)
void ImGui::PushFont(ImFont* font)
{
ImGuiState& g = *GImGui;
-
if (!font)
font = g.IO.Fonts->Fonts[0];
-
- SetFont(font);
+ SetCurrentFont(font);
g.FontStack.push_back(font);
g.CurrentWindow->DrawList->PushTextureID(font->ContainerAtlas->TexID);
}
@@ -3816,40 +4263,56 @@ void ImGui::PushFont(ImFont* font)
void ImGui::PopFont()
{
ImGuiState& g = *GImGui;
-
g.CurrentWindow->DrawList->PopTextureID();
g.FontStack.pop_back();
- SetFont(g.FontStack.empty() ? g.IO.Fonts->Fonts[0] : g.FontStack.back());
+ SetCurrentFont(g.FontStack.empty() ? g.IO.Fonts->Fonts[0] : g.FontStack.back());
}
void ImGui::PushAllowKeyboardFocus(bool allow_keyboard_focus)
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.AllowKeyboardFocus.push_back(allow_keyboard_focus);
+ window->DC.AllowKeyboardFocus = allow_keyboard_focus;
+ window->DC.AllowKeyboardFocusStack.push_back(allow_keyboard_focus);
}
void ImGui::PopAllowKeyboardFocus()
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.AllowKeyboardFocus.pop_back();
+ window->DC.AllowKeyboardFocusStack.pop_back();
+ window->DC.AllowKeyboardFocus = window->DC.AllowKeyboardFocusStack.empty() ? true : window->DC.AllowKeyboardFocusStack.back();
+}
+
+void ImGui::PushButtonRepeat(bool repeat)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ window->DC.ButtonRepeat = repeat;
+ window->DC.ButtonRepeatStack.push_back(repeat);
}
-void ImGui::PushTextWrapPos(float wrap_x)
+void ImGui::PopButtonRepeat()
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.TextWrapPos.push_back(wrap_x);
+ window->DC.ButtonRepeatStack.pop_back();
+ window->DC.ButtonRepeat = window->DC.ButtonRepeatStack.empty() ? false : window->DC.ButtonRepeatStack.back();
+}
+
+void ImGui::PushTextWrapPos(float wrap_pos_x)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ window->DC.TextWrapPos = wrap_pos_x;
+ window->DC.TextWrapPosStack.push_back(wrap_pos_x);
}
void ImGui::PopTextWrapPos()
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.TextWrapPos.pop_back();
+ window->DC.TextWrapPosStack.pop_back();
+ window->DC.TextWrapPos = window->DC.TextWrapPosStack.empty() ? -1.0f : window->DC.TextWrapPosStack.back();
}
void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
{
ImGuiState& g = *GImGui;
-
ImGuiColMod backup;
backup.Col = idx;
backup.PreviousValue = g.Style.Colors[idx];
@@ -3860,7 +4323,6 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
void ImGui::PopStyleColor(int count)
{
ImGuiState& g = *GImGui;
-
while (count > 0)
{
ImGuiColMod& backup = g.ColorModifiers.back();
@@ -3891,6 +4353,7 @@ static ImVec2* GetStyleVarVec2Addr(ImGuiStyleVar idx)
switch (idx)
{
case ImGuiStyleVar_WindowPadding: return &g.Style.WindowPadding;
+ case ImGuiStyleVar_WindowMinSize: return &g.Style.WindowMinSize;
case ImGuiStyleVar_FramePadding: return &g.Style.FramePadding;
case ImGuiStyleVar_ItemSpacing: return &g.Style.ItemSpacing;
case ImGuiStyleVar_ItemInnerSpacing: return &g.Style.ItemInnerSpacing;
@@ -3901,7 +4364,6 @@ static ImVec2* GetStyleVarVec2Addr(ImGuiStyleVar idx)
void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
{
ImGuiState& g = *GImGui;
-
float* pvar = GetStyleVarFloatAddr(idx);
IM_ASSERT(pvar != NULL); // Called function with wrong-type? Variable is not a float.
ImGuiStyleMod backup;
@@ -3915,7 +4377,6 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
{
ImGuiState& g = *GImGui;
-
ImVec2* pvar = GetStyleVarVec2Addr(idx);
IM_ASSERT(pvar != NULL); // Called function with wrong-type? Variable is not a ImVec2.
ImGuiStyleMod backup;
@@ -3928,7 +4389,6 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
void ImGui::PopStyleVar(int count)
{
ImGuiState& g = *GImGui;
-
while (count > 0)
{
ImGuiStyleMod& backup = g.StyleModifiers.back();
@@ -3947,6 +4407,7 @@ const char* ImGui::GetStyleColName(ImGuiCol idx)
switch (idx)
{
case ImGuiCol_Text: return "Text";
+ case ImGuiCol_TextDisabled: return "TextDisabled";
case ImGuiCol_WindowBg: return "WindowBg";
case ImGuiCol_ChildWindowBg: return "ChildWindowBg";
case ImGuiCol_Border: return "Border";
@@ -3956,6 +4417,8 @@ const char* ImGui::GetStyleColName(ImGuiCol idx)
case ImGuiCol_FrameBgActive: return "FrameBgActive";
case ImGuiCol_TitleBg: return "TitleBg";
case ImGuiCol_TitleBgCollapsed: return "TitleBgCollapsed";
+ case ImGuiCol_TitleBgActive: return "TitleBgActive";
+ case ImGuiCol_MenuBarBg: return "MenuBarBg";
case ImGuiCol_ScrollbarBg: return "ScrollbarBg";
case ImGuiCol_ScrollbarGrab: return "ScrollbarGrab";
case ImGuiCol_ScrollbarGrabHovered: return "ScrollbarGrabHovered";
@@ -3985,50 +4448,71 @@ const char* ImGui::GetStyleColName(ImGuiCol idx)
case ImGuiCol_PlotHistogramHovered: return "PlotHistogramHovered";
case ImGuiCol_TextSelectedBg: return "TextSelectedBg";
case ImGuiCol_TooltipBg: return "TooltipBg";
+ case ImGuiCol_ModalWindowDarkening: return "ModalWindowDarkening";
}
IM_ASSERT(0);
return "Unknown";
}
+bool ImGui::IsWindowHovered()
+{
+ ImGuiState& g = *GImGui;
+ return g.HoveredWindow == g.CurrentWindow && IsWindowContentHoverable(g.HoveredRootWindow);
+}
+
bool ImGui::IsWindowFocused()
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- return g.FocusedWindow == window;
+ return g.FocusedWindow == g.CurrentWindow;
}
bool ImGui::IsRootWindowFocused()
{
ImGuiState& g = *GImGui;
- ImGuiWindow* root_window = GetCurrentWindow()->RootWindow;
+ ImGuiWindow* root_window = g.CurrentWindow->RootWindow;
return g.FocusedWindow == root_window;
}
bool ImGui::IsRootWindowOrAnyChildFocused()
{
ImGuiState& g = *GImGui;
- ImGuiWindow* root_window = GetCurrentWindow()->RootWindow;
+ ImGuiWindow* root_window = g.CurrentWindow->RootWindow;
return g.FocusedWindow && g.FocusedWindow->RootWindow == root_window;
}
float ImGui::GetWindowWidth()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GImGui->CurrentWindow;
return window->Size.x;
}
+float ImGui::GetWindowHeight()
+{
+ ImGuiWindow* window = GImGui->CurrentWindow;
+ return window->Size.y;
+}
+
ImVec2 ImGui::GetWindowPos()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
return window->Pos;
}
+static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y)
+{
+ window->DC.CursorMaxPos.y += window->Scroll.y;
+ window->Scroll.y = new_scroll_y;
+ window->DC.CursorMaxPos.y -= window->Scroll.y;
+}
+
static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiSetCond cond)
{
// Test condition (NB: bit 0 is always true) and clear flags for next time
if (cond && (window->SetWindowPosAllowFlags & cond) == 0)
return;
window->SetWindowPosAllowFlags &= ~(ImGuiSetCond_Once | ImGuiSetCond_FirstUseEver | ImGuiSetCond_Appearing);
+ window->SetWindowPosCenterWanted = false;
// Set
const ImVec2 old_pos = window->Pos;
@@ -4053,7 +4537,7 @@ void ImGui::SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond)
ImVec2 ImGui::GetWindowSize()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->Size;
}
@@ -4065,23 +4549,31 @@ static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond
window->SetWindowSizeAllowFlags &= ~(ImGuiSetCond_Once | ImGuiSetCond_FirstUseEver | ImGuiSetCond_Appearing);
// Set
- if (ImLengthSqr(size) > 0.00001f)
+ if (size.x > 0.0f)
+ {
+ window->AutoFitFramesX = 0;
+ window->SizeFull.x = size.x;
+ }
+ else
+ {
+ window->AutoFitFramesX = 2;
+ window->AutoFitOnlyGrows = false;
+ }
+ if (size.y > 0.0f)
{
- window->SizeFull = size;
- window->AutoFitFrames = 0;
+ window->AutoFitFramesY = 0;
+ window->SizeFull.y = size.y;
}
else
{
- // Autofit
- window->AutoFitFrames = 2;
+ window->AutoFitFramesY = 2;
window->AutoFitOnlyGrows = false;
}
}
void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCond cond)
{
- ImGuiWindow* window = GetCurrentWindow();
- SetWindowSize(window, size, cond);
+ SetWindowSize(GImGui->CurrentWindow, size, cond);
}
void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond)
@@ -4104,14 +4596,12 @@ static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiSetCond
void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCond cond)
{
- ImGuiWindow* window = GetCurrentWindow();
- SetWindowCollapsed(window, collapsed, cond);
+ SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond);
}
-bool ImGui::GetWindowCollapsed()
+bool ImGui::IsWindowCollapsed()
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->Collapsed;
+ return GImGui->CurrentWindow->Collapsed;
}
void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond)
@@ -4123,8 +4613,7 @@ void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond co
void ImGui::SetWindowFocus()
{
- ImGuiWindow* window = GetCurrentWindow();
- FocusWindow(window);
+ FocusWindow(GImGui->CurrentWindow);
}
void ImGui::SetWindowFocus(const char* name)
@@ -4148,6 +4637,13 @@ void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond)
g.SetNextWindowPosCond = cond ? cond : ImGuiSetCond_Always;
}
+void ImGui::SetNextWindowPosCenter(ImGuiSetCond cond)
+{
+ ImGuiState& g = *GImGui;
+ g.SetNextWindowPosVal = ImVec2(-FLT_MAX, -FLT_MAX);
+ g.SetNextWindowPosCond = cond ? cond : ImGuiSetCond_Always;
+}
+
void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond)
{
ImGuiState& g = *GImGui;
@@ -4155,6 +4651,20 @@ void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond)
g.SetNextWindowSizeCond = cond ? cond : ImGuiSetCond_Always;
}
+void ImGui::SetNextWindowContentSize(const ImVec2& size)
+{
+ ImGuiState& g = *GImGui;
+ g.SetNextWindowContentSizeVal = size;
+ g.SetNextWindowContentSizeCond = ImGuiSetCond_Always;
+}
+
+void ImGui::SetNextWindowContentWidth(float width)
+{
+ ImGuiState& g = *GImGui;
+ g.SetNextWindowContentSizeVal = ImVec2(width, g.SetNextWindowContentSizeCond ? g.SetNextWindowContentSizeVal.y : 0.0f);
+ g.SetNextWindowContentSizeCond = ImGuiSetCond_Always;
+}
+
void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond)
{
ImGuiState& g = *GImGui;
@@ -4168,39 +4678,48 @@ void ImGui::SetNextWindowFocus()
g.SetNextWindowFocus = true;
}
+// In window space (not screen space!)
ImVec2 ImGui::GetContentRegionMax()
{
- ImGuiWindow* window = GetCurrentWindow();
- ImVec2 window_padding = window->WindowPadding();
- ImVec2 mx = window->Size - window_padding;
+ ImGuiWindow* window = GetCurrentWindowRead();
+ ImVec2 content_region_size = ImVec2(window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x - window->ScrollbarSizes.x, window->SizeContentsExplicit.y ? window->SizeContentsExplicit.y : window->Size.y - window->ScrollbarSizes.y);
+ ImVec2 mx = content_region_size - window->Scroll - window->WindowPadding;
if (window->DC.ColumnsCount != 1)
- {
- mx.x = ImGui::GetColumnOffset(window->DC.ColumnsCurrent + 1);
- mx.x -= window_padding.x;
- }
- else
- {
- if (window->ScrollbarY)
- mx.x -= GImGui->Style.ScrollbarWidth;
- }
+ mx.x = ImGui::GetColumnOffset(window->DC.ColumnsCurrent + 1) - window->WindowPadding.x;
return mx;
}
+ImVec2 ImGui::GetContentRegionAvail()
+{
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return GetContentRegionMax() - (window->DC.CursorPos - window->Pos);
+}
+
+float ImGui::GetContentRegionAvailWidth()
+{
+ return GetContentRegionAvail().x;
+}
+
+// In window space (not screen space!)
ImVec2 ImGui::GetWindowContentRegionMin()
{
- ImGuiWindow* window = GetCurrentWindow();
- return ImVec2(0, window->TitleBarHeight()) + window->WindowPadding();
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return ImVec2(-window->Scroll.x, -window->Scroll.y + window->TitleBarHeight() + window->MenuBarHeight()) + window->WindowPadding;
}
ImVec2 ImGui::GetWindowContentRegionMax()
{
- ImGuiWindow* window = GetCurrentWindow();
- ImVec2 m = window->Size - window->WindowPadding();
- if (window->ScrollbarY)
- m.x -= GImGui->Style.ScrollbarWidth;
+ ImGuiWindow* window = GetCurrentWindowRead();
+ ImVec2 content_region_size = ImVec2(window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x, window->SizeContentsExplicit.y ? window->SizeContentsExplicit.y : window->Size.y);
+ ImVec2 m = content_region_size - window->Scroll - window->WindowPadding - window->ScrollbarSizes;
return m;
}
+float ImGui::GetWindowContentRegionWidth()
+{
+ return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x;
+}
+
float ImGui::GetTextLineHeight()
{
ImGuiState& g = *GImGui;
@@ -4213,6 +4732,12 @@ float ImGui::GetTextLineHeightWithSpacing()
return g.FontSize + g.Style.ItemSpacing.y;
}
+float ImGui::GetItemsLineHeightWithSpacing()
+{
+ ImGuiState& g = *GImGui;
+ return g.FontSize + g.Style.FramePadding.y * 2.0f + g.Style.ItemSpacing.y;
+}
+
ImDrawList* ImGui::GetWindowDrawList()
{
ImGuiWindow* window = GetCurrentWindow();
@@ -4239,48 +4764,56 @@ void ImGui::SetWindowFontScale(float scale)
g.FontSize = window->CalcFontSize();
}
-// NB: internally we store CursorPos in absolute screen coordinates because it is more convenient.
-// Conversion happens as we pass the value to user, but it makes our naming convention dodgy. May want to rename 'DC.CursorPos'.
+// User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient.
+// Conversion happens as we pass the value to user, but it makes our naming convention confusing because GetCursorPos() == (DC.CursorPos - window.Pos). May want to rename 'DC.CursorPos'.
ImVec2 ImGui::GetCursorPos()
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->DC.CursorPos - window->Pos;
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->DC.CursorPos - window->Pos + window->Scroll;
}
float ImGui::GetCursorPosX()
{
- return ImGui::GetCursorPos().x;
+ ImGuiWindow* window = GetCurrentWindow();
+ return window->DC.CursorPos.x - window->Pos.x + window->Scroll.x;
}
float ImGui::GetCursorPosY()
{
- return ImGui::GetCursorPos().y;
+ ImGuiWindow* window = GetCurrentWindow();
+ return window->DC.CursorPos.y - window->Pos.y + window->Scroll.y;
}
-void ImGui::SetCursorPos(const ImVec2& pos)
+void ImGui::SetCursorPos(const ImVec2& local_pos)
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.CursorPos = window->Pos + pos;
+ window->DC.CursorPos = window->Pos - window->Scroll + local_pos;
window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
}
void ImGui::SetCursorPosX(float x)
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.CursorPos.x = window->Pos.x + x;
+ window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x;
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x);
}
void ImGui::SetCursorPosY(float y)
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.CursorPos.y = window->Pos.y + y;
+ window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y;
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
}
+ImVec2 ImGui::GetCursorStartPos()
+{
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->DC.CursorStartPos - window->Pos;
+}
+
ImVec2 ImGui::GetCursorScreenPos()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.CursorPos;
}
@@ -4290,22 +4823,59 @@ void ImGui::SetCursorScreenPos(const ImVec2& screen_pos)
window->DC.CursorPos = screen_pos;
}
-float ImGui::GetScrollPosY()
+float ImGui::GetScrollX()
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->ScrollY;
+ return GImGui->CurrentWindow->Scroll.x;
+}
+
+float ImGui::GetScrollY()
+{
+ return GImGui->CurrentWindow->Scroll.y;
+}
+
+float ImGui::GetScrollMaxX()
+{
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->SizeContents.x - window->SizeFull.x - window->ScrollbarSizes.x;
}
float ImGui::GetScrollMaxY()
{
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->SizeContents.y - window->SizeFull.y - window->ScrollbarSizes.y;
+}
+
+void ImGui::SetScrollX(float scroll_x)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ window->ScrollTarget.x = scroll_x;
+ window->ScrollTargetCenterRatio.x = 0.0f;
+}
+
+void ImGui::SetScrollY(float scroll_y)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ window->ScrollTarget.y = scroll_y + window->TitleBarHeight(); // title bar height canceled out when using ScrollTargetRelY
+ window->ScrollTargetCenterRatio.y = 0.0f;
+}
+
+void ImGui::SetScrollFromPosY(float pos_y, float center_y_ratio)
+{
+ // We store a target position so centering can occur on the next frame when we are guaranteed to have a known window size
ImGuiWindow* window = GetCurrentWindow();
- return window->SizeContents.y - window->SizeFull.y;
+ IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f);
+ window->ScrollTarget.y = (float)(int)(pos_y + window->Scroll.y);
+ if (center_y_ratio <= 0.0f && window->ScrollTarget.y <= window->WindowPadding.y) // Minor hack to make "scroll to top" take account of WindowPadding, else it would scroll to (WindowPadding.y - ItemSpacing.y)
+ window->ScrollTarget.y = 0.0f;
+ window->ScrollTargetCenterRatio.y = center_y_ratio;
}
-void ImGui::SetScrollPosHere()
+// center_y_ratio: 0.0f top of last item, 0.5f vertical center of last item, 1.0f bottom of last item.
+void ImGui::SetScrollHere(float center_y_ratio)
{
ImGuiWindow* window = GetCurrentWindow();
- window->NextScrollY = (window->DC.CursorPos.y + window->ScrollY) - (window->Pos.y + window->SizeFull.y * 0.5f) - (window->TitleBarHeight() + window->WindowPadding().y);
+ float target_y = window->DC.CursorPosPrevLine.y + (window->DC.PrevLineHeight * center_y_ratio) + (GImGui->Style.ItemSpacing.y * (center_y_ratio - 0.5f) * 2.0f); // Precisely aim above, in the middle or below the last line.
+ ImGui::SetScrollFromPosY(target_y - window->Pos.y, center_y_ratio);
}
void ImGui::SetKeyboardFocusHere(int offset)
@@ -4323,17 +4893,17 @@ void ImGui::SetStateStorage(ImGuiStorage* tree)
ImGuiStorage* ImGui::GetStateStorage()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.StateStorage;
}
void ImGui::TextV(const char* fmt, va_list args)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
TextUnformatted(g.TempBuffer, text_end);
}
@@ -4361,6 +4931,21 @@ void ImGui::TextColored(const ImVec4& col, const char* fmt, ...)
va_end(args);
}
+void ImGui::TextDisabledV(const char* fmt, va_list args)
+{
+ ImGui::PushStyleColor(ImGuiCol_Text, GImGui->Style.Colors[ImGuiCol_TextDisabled]);
+ TextV(fmt, args);
+ ImGui::PopStyleColor();
+}
+
+void ImGui::TextDisabled(const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ TextDisabledV(fmt, args);
+ va_end(args);
+}
+
void ImGui::TextWrappedV(const char* fmt, va_list args)
{
ImGui::PushTextWrapPos(0.0f);
@@ -4378,42 +4963,42 @@ void ImGui::TextWrapped(const char* fmt, ...)
void ImGui::TextUnformatted(const char* text, const char* text_end)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
IM_ASSERT(text != NULL);
const char* text_begin = text;
if (text_end == NULL)
text_end = text + strlen(text); // FIXME-OPT
- const float wrap_pos_x = window->DC.TextWrapPos.back();
+ const float wrap_pos_x = window->DC.TextWrapPos;
const bool wrap_enabled = wrap_pos_x >= 0.0f;
if (text_end - text > 2000 && !wrap_enabled)
{
// Long text!
// Perform manual coarse clipping to optimize for long multi-line text
- // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled.
+ // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled.
// 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.
const char* line = text;
const float line_height = ImGui::GetTextLineHeight();
const ImVec2 text_pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrentLineTextBaseOffset);
- const ImVec4 clip_rect = window->ClipRectStack.back();
+ const ImRect clip_rect = window->ClipRect;
ImVec2 text_size(0,0);
- if (text_pos.y <= clip_rect.w)
+ if (text_pos.y <= clip_rect.Max.y)
{
ImVec2 pos = text_pos;
// Lines to skip (can't skip when logging text)
if (!g.LogEnabled)
{
- int lines_skippable = (int)((clip_rect.y - text_pos.y) / line_height) - 1;
+ int lines_skippable = (int)((clip_rect.Min.y - text_pos.y) / line_height);
if (lines_skippable > 0)
{
int lines_skipped = 0;
- while (line < text_end && lines_skipped <= lines_skippable)
+ while (line < text_end && lines_skipped < lines_skippable)
{
const char* line_end = strchr(line, '\n');
line = line_end + 1;
@@ -4474,7 +5059,7 @@ void ImGui::TextUnformatted(const char* text, const char* text_end)
text_pos.y += window->DC.CurrentLineTextBaseOffset;
ImRect bb(text_pos, text_pos + text_size);
- ItemSize(bb.GetSize());
+ ItemSize(text_size);
if (!ItemAdd(bb, NULL))
return;
@@ -4485,12 +5070,12 @@ void ImGui::TextUnformatted(const char* text, const char* text_end)
void ImGui::AlignFirstTextHeightToWidgets()
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
// Declare a dummy item size to that upcoming items that are smaller will center-align on the newly expanded line height.
+ ImGuiState& g = *GImGui;
ItemSize(ImVec2(0, g.FontSize + g.Style.FramePadding.y*2), g.Style.FramePadding.y);
ImGui::SameLine(0, 0);
}
@@ -4498,16 +5083,13 @@ void ImGui::AlignFirstTextHeightToWidgets()
// Add a label+text combo aligned to other label+value widgets
void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const float w = ImGui::CalcItemWidth();
-
- const char* value_text_begin = &g.TempBuffer[0];
- const char* value_text_end = value_text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
+ const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const ImRect value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + style.FramePadding.x*2, label_size.y + style.FramePadding.y*2));
@@ -4517,7 +5099,9 @@ void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
return;
// Render
- RenderTextClipped(ImVec2(value_bb.Min.x, value_bb.Min.y + style.FramePadding.y), value_text_begin, value_text_end, NULL, value_bb.Max);
+ const char* value_text_begin = &g.TempBuffer[0];
+ const char* value_text_end = value_text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
+ RenderTextClipped(value_bb.Min, value_bb.Max, value_text_begin, value_text_end, NULL, ImGuiAlign_VCenter);
RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y + style.FramePadding.y), label);
}
@@ -4531,9 +5115,8 @@ void ImGui::LabelText(const char* label, const char* fmt, ...)
static inline bool IsWindowContentHoverable(ImGuiWindow* window)
{
- ImGuiState& g = *GImGui;
-
// An active popup disable hovering on other windows (apart from its own children)
+ ImGuiState& g = *GImGui;
if (ImGuiWindow* focused_window = g.FocusedWindow)
if (ImGuiWindow* focused_root_window = focused_window->RootWindow)
if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) != 0 && focused_root_window->WasActive && focused_root_window != window->RootWindow)
@@ -4542,30 +5125,24 @@ static inline bool IsWindowContentHoverable(ImGuiWindow* window)
return true;
}
-static bool IsHovered(const ImRect& bb, ImGuiID id, bool flatten_childs = false)
+bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, ImGuiButtonFlags flags)
{
ImGuiState& g = *GImGui;
- if (g.HoveredId == 0)
+ ImGuiWindow* window = GetCurrentWindow();
+
+ if (flags & ImGuiButtonFlags_Disabled)
{
- ImGuiWindow* window = GetCurrentWindow();
- if (g.HoveredWindow == window || (flatten_childs && g.HoveredRootWindow == window->RootWindow))
- if ((g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdIsFocusedOnly) && IsMouseHoveringRect(bb))
- if (IsWindowContentHoverable(g.HoveredRootWindow))
- return true;
+ if (out_hovered) *out_hovered = false;
+ if (out_held) *out_held = false;
+ if (g.ActiveId == id) SetActiveID(0);
+ return false;
}
- return false;
-}
-
-static bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, ImGuiButtonFlags flags)
-{
- ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
bool pressed = false;
const bool hovered = IsHovered(bb, id, (flags & ImGuiButtonFlags_FlattenChilds) != 0);
if (hovered)
{
- g.HoveredId = id;
+ SetHoveredID(id);
if (allow_key_modifiers || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt))
{
if (g.IO.MouseClicked[0])
@@ -4573,14 +5150,19 @@ static bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
if (flags & ImGuiButtonFlags_PressedOnClick)
{
pressed = true;
- SetActiveId(0);
+ SetActiveID(0);
}
else
{
- SetActiveId(id);
+ SetActiveID(id, window);
}
FocusWindow(window);
}
+ else if (g.IO.MouseReleased[0] && (flags & ImGuiButtonFlags_PressedOnRelease))
+ {
+ pressed = true;
+ SetActiveID(0);
+ }
else if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && ImGui::IsMouseClicked(0, true))
{
pressed = true;
@@ -4599,7 +5181,7 @@ static bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
{
if (hovered)
pressed = true;
- SetActiveId(0);
+ SetActiveID(0);
}
}
@@ -4609,75 +5191,69 @@ static bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
return pressed;
}
-bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_held)
+bool ImGui::ButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFlags flags)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
+ const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
- const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : (label_size.x + style.FramePadding.x*2), size_arg.y != 0.0f ? size_arg.y : (label_size.y + style.FramePadding.y*2));
- const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
+ ImVec2 pos = window->DC.CursorPos;
+ if ((flags & ImGuiButtonFlags_AlignTextBaseLine) && style.FramePadding.y < window->DC.CurrentLineTextBaseOffset)
+ pos.y += window->DC.CurrentLineTextBaseOffset - style.FramePadding.y;
+ ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
+
+ const ImRect bb(pos, pos + size);
ItemSize(bb, style.FramePadding.y);
if (!ItemAdd(bb, &id))
return false;
+ if (window->DC.ButtonRepeat) flags |= ImGuiButtonFlags_Repeat;
bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held, true, repeat_when_held ? ImGuiButtonFlags_Repeat : 0);
+ bool pressed = ButtonBehavior(bb, id, &hovered, &held, true, flags);
// Render
const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
+ RenderTextClipped(bb.Min, bb.Max, label, NULL, &label_size, ImGuiAlign_Center | ImGuiAlign_VCenter);
- const ImVec2 off = ImVec2(ImMax(0.0f, size.x - label_size.x) * 0.5f, ImMax(0.0f, size.y - label_size.y) * 0.5f); // Center (only applies if we explicitly gave a size bigger than the text size, which isn't the common path)
- RenderTextClipped(bb.Min + off, label, NULL, &label_size, bb.Max); // Render clip (only applies if we explicitly gave a size smaller than the text size, which isn't the commmon path)
+ // Automatically close popups
+ //if (pressed && !(flags & ImGuiButtonFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
+ // ImGui::CloseCurrentPopup();
return pressed;
}
-// Small buttons fits within text without additional spacing.
+bool ImGui::Button(const char* label, const ImVec2& size_arg)
+{
+ return ButtonEx(label, size_arg, 0);
+}
+
+// Small buttons fits within text without additional vertical spacing.
bool ImGui::SmallButton(const char* label)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- if (window->SkipItems)
- return false;
-
- const ImGuiStyle& style = g.Style;
- const ImGuiID id = window->GetID(label);
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
-
- ImVec2 text_pos = window->DC.CursorPos;
- text_pos.y += window->DC.CurrentLineTextBaseOffset;
- ImRect bb(text_pos, text_pos + label_size + ImVec2(style.FramePadding.x*2,0));
- ItemSize(bb);
- if (!ItemAdd(bb, &id))
- return false;
-
- bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held, true);
-
- // Render
- const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
- RenderFrame(bb.Min, bb.Max, col);
- RenderText(bb.Min + ImVec2(style.FramePadding.x,0), label);
-
+ float backup_padding_y = g.Style.FramePadding.y;
+ g.Style.FramePadding.y = 0.0f;
+ bool pressed = ButtonEx(label, ImVec2(0,0), ImGuiButtonFlags_AlignTextBaseLine);
+ g.Style.FramePadding.y = backup_padding_y;
return pressed;
}
// Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack.
// Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id)
-bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size)
+bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiID id = window->GetID(str_id);
+ ImVec2 size = CalcItemSize(size_arg, 0.0f, 0.0f);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
ItemSize(bb);
if (!ItemAdd(bb, &id))
@@ -4692,14 +5268,14 @@ bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size)
// Upper-right button to close a window.
static bool CloseWindowButton(bool* p_opened)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
const ImGuiID id = window->GetID("#CLOSE");
const float size = window->TitleBarHeight() - 4.0f;
- const ImRect bb(window->Rect().GetTR() + ImVec2(-3.0f-size,2.0f), window->Rect().GetTR() + ImVec2(-3.0f,2.0f+size));
+ const ImRect bb(window->Rect().GetTR() + ImVec2(-2.0f-size,2.0f), window->Rect().GetTR() + ImVec2(-2.0f,2.0f+size));
bool hovered, held;
- bool pressed = ButtonBehavior(bb, id, &hovered, &held, true);
+ bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, true);
// Render
const ImU32 col = window->Color((held && hovered) ? ImGuiCol_CloseButtonActive : hovered ? ImGuiCol_CloseButtonHovered : ImGuiCol_CloseButton);
@@ -4749,22 +5325,22 @@ void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2&
// The color used are the button colors.
bool 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)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
// Default to using texture ID as ID. User can still push string/integer prefixes.
- // We could hash the size/uv to create a unique ID but that would prevent the user from animating buttons.
+ // We could hash the size/uv to create a unique ID but that would prevent the user from animating UV.
ImGui::PushID((void *)user_texture_id);
const ImGuiID id = window->GetID("#image");
ImGui::PopID();
const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding;
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2);
- const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
+ const ImRect image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
ItemSize(bb);
if (!ItemAdd(bb, &id))
return false;
@@ -4774,8 +5350,7 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
// Render
const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
- if (padding.x > 0.0f || padding.y > 0.0f)
- RenderFrame(bb.Min, bb.Max, col);
+ RenderFrame(bb.Min, bb.Max, col);
if (bg_col.w > 0.0f)
window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, window->Color(bg_col));
window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, window->Color(tint_col));
@@ -4787,9 +5362,9 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
void ImGui::LogToTTY(int max_depth)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
if (g.LogEnabled)
return;
+ ImGuiWindow* window = GetCurrentWindowRead();
g.LogEnabled = true;
g.LogFile = stdout;
@@ -4802,9 +5377,10 @@ void ImGui::LogToTTY(int max_depth)
void ImGui::LogToFile(int max_depth, const char* filename)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
if (g.LogEnabled)
return;
+ ImGuiWindow* window = GetCurrentWindowRead();
+
if (!filename)
{
filename = g.IO.LogFilename;
@@ -4827,10 +5403,10 @@ void ImGui::LogToFile(int max_depth, const char* filename)
// Start logging ImGui output to clipboard
void ImGui::LogToClipboard(int max_depth)
{
- ImGuiWindow* window = GetCurrentWindow();
ImGuiState& g = *GImGui;
if (g.LogEnabled)
return;
+ ImGuiWindow* window = GetCurrentWindowRead();
g.LogEnabled = true;
g.LogFile = NULL;
@@ -4845,7 +5421,7 @@ void ImGui::LogFinish()
if (!g.LogEnabled)
return;
- ImGui::LogText(STR_NEWLINE);
+ ImGui::LogText(IM_NEWLINE);
g.LogEnabled = false;
if (g.LogFile != NULL)
{
@@ -4870,7 +5446,7 @@ void ImGui::LogButtons()
ImGui::PushID("LogButtons");
const bool log_to_tty = ImGui::Button("Log To TTY");
- ImGui::SameLine();
+ ImGui::SameLine();
const bool log_to_file = ImGui::Button("Log To File");
ImGui::SameLine();
const bool log_to_clipboard = ImGui::Button("Log To Clipboard");
@@ -4892,24 +5468,13 @@ void ImGui::LogButtons()
LogToClipboard(g.LogAutoExpandMaxDepth);
}
-bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display_frame, bool default_open)
+bool ImGui::TreeNodeBehaviorIsOpened(ImGuiID id, ImGuiTreeNodeFlags flags)
{
- ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- if (window->SkipItems)
- return false;
-
- const ImGuiStyle& style = g.Style;
-
- IM_ASSERT(str_id != NULL || label != NULL);
- if (str_id == NULL)
- str_id = label;
- if (label == NULL)
- label = str_id;
- const ImGuiID id = window->GetID(str_id);
-
// We only write to the tree storage if the user clicks (or explicitely use SetNextTreeNode*** functions)
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
ImGuiStorage* storage = window->DC.StateStorage;
+
bool opened;
if (g.SetNextTreeNodeOpenedCond != 0)
{
@@ -4936,40 +5501,62 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
}
else
{
- opened = storage->GetInt(id, default_open) != 0;
+ opened = storage->GetInt(id, (flags & ImGuiTreeNodeFlags_DefaultOpen) ? 1 : 0) != 0;
}
+ // When logging is enabled, we automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior).
+ // NB- If we are above max depth we still allow manually opened nodes to be logged.
+ if (g.LogEnabled && !(flags & ImGuiTreeNodeFlags_NoAutoExpandOnLog) && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
+ opened = true;
+
+ return opened;
+}
+
+bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display_frame, bool default_open)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ ImGuiState& g = *GImGui;
+ const ImGuiStyle& style = g.Style;
+
+ IM_ASSERT(str_id != NULL || label != NULL);
+ if (str_id == NULL)
+ str_id = label;
+ if (label == NULL)
+ label = str_id;
+ const ImGuiID id = window->GetID(str_id);
+
// Framed header expand a little outside the default padding
- const ImVec2 window_padding = window->WindowPadding();
+ const ImVec2 window_padding = window->WindowPadding;
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const ImVec2 pos_min = window->DC.CursorPos;
const ImVec2 pos_max = window->Pos + GetContentRegionMax();
ImRect bb = ImRect(pos_min, ImVec2(pos_max.x, pos_min.y + label_size.y));
if (display_frame)
{
- bb.Min.x -= window_padding.x*0.5f - 1;
- bb.Max.x += window_padding.x*0.5f - 1;
+ bb.Min.x -= (float)(int)(window_padding.x*0.5f) - 1;
+ bb.Max.x += (float)(int)(window_padding.x*0.5f) - 1;
bb.Max.y += style.FramePadding.y * 2;
}
- // FIXME: we don't provide our width so that it doesn't get feed back into AutoFit. Should manage that better so we can still hover without extending ContentsSize
- const ImRect text_bb(bb.Min, bb.Min + ImVec2(g.FontSize + style.FramePadding.x*2*2,0) + label_size);
+ const float collapser_width = g.FontSize + style.FramePadding.x*2;
+ const ImRect text_bb(bb.Min, bb.Min + ImVec2(collapser_width + style.FramePadding.x*2*0 + (label_size.x > 0.0f ? label_size.x : 0.0f), label_size.y));
ItemSize(ImVec2(text_bb.GetSize().x, bb.GetSize().y), display_frame ? style.FramePadding.y : 0.0f);
- // When logging is enabled, if automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behavior).
- // NB- If we are above max depth we still allow manually opened nodes to be logged.
- if (g.LogEnabled && !display_frame && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
- opened = true;
+ const ImRect interact_bb = display_frame ? bb : ImRect(text_bb.Min, text_bb.Max + ImVec2(style.FramePadding.x*2,0.0f)); // FIXME
+ bool opened = TreeNodeBehaviorIsOpened(id, (default_open ? ImGuiTreeNodeFlags_DefaultOpen : 0) | (display_frame ? ImGuiTreeNodeFlags_NoAutoExpandOnLog : 0));
- if (!ItemAdd(bb, &id))
+ if (!ItemAdd(interact_bb, &id))
return opened;
bool hovered, held;
- bool pressed = ButtonBehavior(display_frame ? bb : text_bb, id, &hovered, &held, false);
+ bool pressed = ButtonBehavior(interact_bb, id, &hovered, &held, false);
if (pressed)
{
opened = !opened;
- storage->SetInt(id, opened);
+ window->DC.StateStorage->SetInt(id, opened);
}
// Render
@@ -4983,13 +5570,13 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
{
// NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here.
const char log_prefix[] = "\n##";
- LogText(bb.Min + style.FramePadding, log_prefix, log_prefix+3);
+ LogRenderedText(bb.Min + style.FramePadding, log_prefix, log_prefix+3);
}
- RenderText(bb.Min + style.FramePadding + ImVec2(g.FontSize + style.FramePadding.x*2,0), label);
+ RenderTextClipped(bb.Min + style.FramePadding + ImVec2(collapser_width,0), bb.Max, label, NULL, &label_size);
if (g.LogEnabled)
{
const char log_suffix[] = "##";
- LogText(bb.Min + style.FramePadding, log_suffix, log_suffix+2);
+ LogRenderedText(bb.Min + style.FramePadding, log_suffix, log_suffix+2);
}
}
else
@@ -4999,8 +5586,8 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
RenderFrame(bb.Min, bb.Max, col, false);
RenderCollapseTriangle(bb.Min + ImVec2(style.FramePadding.x, g.FontSize*0.15f), opened, 0.70f, false);
if (g.LogEnabled)
- LogText(bb.Min, ">");
- RenderText(bb.Min + ImVec2(g.FontSize + style.FramePadding.x*2,0), label);
+ LogRenderedText(bb.Min, ">");
+ RenderText(bb.Min + ImVec2(collapser_width,0), label);
}
return opened;
@@ -5008,17 +5595,20 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
void ImGui::Bullet()
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const float line_height = g.FontSize;
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(line_height, line_height));
ItemSize(bb);
if (!ItemAdd(bb, NULL))
+ {
+ ImGui::SameLine(0, -1);
return;
+ }
// Render
const float bullet_size = line_height*0.15f;
@@ -5031,15 +5621,15 @@ void ImGui::Bullet()
// Text with a little bullet aligned to the typical tree node.
void ImGui::BulletTextV(const char* fmt, va_list args)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
- const char* text_begin = g.TempBuffer;
- const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
+
+ const char* text_begin = g.TempBuffer;
+ const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
const float line_height = g.FontSize;
const ImVec2 label_size = CalcTextSize(text_begin, text_end, true);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(line_height + (label_size.x > 0.0f ? (style.FramePadding.x*2) : 0.0f),0) + label_size); // Empty text doesn't add padding
@@ -5064,13 +5654,12 @@ void ImGui::BulletText(const char* fmt, ...)
// If returning 'true' the node is open and the user is responsible for calling TreePop
bool ImGui::TreeNodeV(const char* str_id, const char* fmt, va_list args)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
-
if (!str_id || !str_id[0])
str_id = fmt;
@@ -5096,11 +5685,11 @@ bool ImGui::TreeNode(const char* str_id, const char* fmt, ...)
// If returning 'true' the node is open and the user is responsible for calling TreePop
bool ImGui::TreeNodeV(const void* ptr_id, const char* fmt, va_list args)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
if (!ptr_id)
@@ -5155,7 +5744,7 @@ void ImGui::PushID(const void* ptr_id)
window->IDStack.push_back(window->GetID(ptr_id));
}
-void ImGui::PushID(const int int_id)
+void ImGui::PushID(int int_id)
{
const void* ptr_id = (void*)(intptr_t)int_id;
ImGuiWindow* window = GetCurrentWindow();
@@ -5170,25 +5759,65 @@ void ImGui::PopID()
ImGuiID ImGui::GetID(const char* str_id)
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->GetID(str_id);
+ return GImGui->CurrentWindow->GetID(str_id);
}
ImGuiID ImGui::GetID(const char* str_id_begin, const char* str_id_end)
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->GetID(str_id_begin, str_id_end);
+ return GImGui->CurrentWindow->GetID(str_id_begin, str_id_end);
}
ImGuiID ImGui::GetID(const void* ptr_id)
{
- ImGuiWindow* window = GetCurrentWindow();
- return window->GetID(ptr_id);
+ return GImGui->CurrentWindow->GetID(ptr_id);
+}
+
+static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, const char* display_format, char* buf, int buf_size)
+{
+ if (data_type == ImGuiDataType_Int)
+ ImFormatString(buf, buf_size, display_format, *(int*)data_ptr);
+ else if (data_type == ImGuiDataType_Float)
+ ImFormatString(buf, buf_size, display_format, *(float*)data_ptr);
+}
+
+static inline void DataTypeFormatString(ImGuiDataType data_type, void* data_ptr, int decimal_precision, char* buf, int buf_size)
+{
+ if (data_type == ImGuiDataType_Int)
+ {
+ if (decimal_precision < 0)
+ ImFormatString(buf, buf_size, "%d", *(int*)data_ptr);
+ else
+ ImFormatString(buf, buf_size, "%.*d", decimal_precision, *(int*)data_ptr);
+ }
+ else if (data_type == ImGuiDataType_Float)
+ {
+ if (decimal_precision < 0)
+ ImFormatString(buf, buf_size, "%f", *(float*)data_ptr); // Ideally we'd have a minimum decimal precision of 1 to visually denote that it is a float, while hiding non-significant digits?
+ else
+ ImFormatString(buf, buf_size, "%.*f", decimal_precision, *(float*)data_ptr);
+ }
+}
+
+static void DataTypeApplyOp(ImGuiDataType data_type, int op, void* value1, const void* value2)// Store into value1
+{
+ if (data_type == ImGuiDataType_Int)
+ {
+ if (op == '+')
+ *(int*)value1 = *(int*)value1 + *(const int*)value2;
+ else if (op == '-')
+ *(int*)value1 = *(int*)value1 - *(const int*)value2;
+ }
+ else if (data_type == ImGuiDataType_Float)
+ {
+ if (op == '+')
+ *(float*)value1 = *(float*)value1 + *(const float*)value2;
+ else if (op == '-')
+ *(float*)value1 = *(float*)value1 - *(const float*)value2;
+ }
}
// User can input math operators (e.g. +100) to edit a numerical values.
-// NB: only call right after InputText because we are using its InitialValue storage
-static void ApplyNumericalTextInput(const char* buf, float *v)
+static void DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* data_ptr, const char* scalar_format)
{
while (ImCharIsSpace(*buf))
buf++;
@@ -5209,51 +5838,61 @@ static void ApplyNumericalTextInput(const char* buf, float *v)
if (!buf[0])
return;
- float ref_v = *v;
- if (op)
- if (sscanf(GImGui->InputTextState.InitialText, "%f", &ref_v) < 1)
+ if (data_type == ImGuiDataType_Int)
+ {
+ if (!scalar_format)
+ scalar_format = "%d";
+ int* v = (int*)data_ptr;
+ int ref_v = *v;
+ if (op && sscanf(initial_value_buf, scalar_format, &ref_v) < 1)
return;
- float op_v = 0.0f;
- if (sscanf(buf, "%f", &op_v) < 1)
- return;
-
- if (op == '+')
- *v = ref_v + op_v;
- else if (op == '*')
- *v = ref_v * op_v;
- else if (op == '/')
+ // Store operand in a float so we can use fractional value for multipliers (*1.1), but constant always parsed as integer so we can fit big integers (e.g. 2000000003) past float precision
+ float op_v = 0.0f;
+ if (op == '+') { if (sscanf(buf, "%f", &op_v) == 1) *v = (int)(ref_v + op_v); } // Add (use "+-" to subtract)
+ else if (op == '*') { if (sscanf(buf, "%f", &op_v) == 1) *v = (int)(ref_v * op_v); } // Multiply
+ else if (op == '/') { if (sscanf(buf, "%f", &op_v) == 1 && op_v != 0.0f) *v = (int)(ref_v / op_v); }// Divide
+ else { if (sscanf(buf, scalar_format, &ref_v) == 1) *v = ref_v; } // Assign constant
+ }
+ else if (data_type == ImGuiDataType_Float)
{
- if (op_v == 0.0f)
+ // For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in
+ scalar_format = "%f";
+ float* v = (float*)data_ptr;
+ float ref_v = *v;
+ if (op && sscanf(initial_value_buf, scalar_format, &ref_v) < 1)
+ return;
+ float op_v = 0.0f;
+ if (sscanf(buf, scalar_format, &op_v) < 1)
return;
- *v = ref_v / op_v;
+
+ if (op == '+') { *v = ref_v + op_v; } // Add (use "+-" to subtract)
+ else if (op == '*') { *v = ref_v * op_v; } // Multiply
+ else if (op == '/') { if (op_v != 0.0f) *v = ref_v / op_v; } // Divide
+ else { *v = op_v; } // Assign constant
}
- else
- *v = op_v;
}
// Create text input in place of a slider (when CTRL+Clicking on slider)
-static bool SliderFloatAsInputText(const char* label, float* v, ImGuiID id, int decimal_precision)
+bool ImGui::InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
- char text_buf[64];
- ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%.*f", decimal_precision, *v);
-
- SetActiveId(g.ScalarAsInputTextId);
- g.HoveredId = 0;
-
// Our replacement widget will override the focus ID (registered previously to allow for a TAB focus to happen)
- window->FocusItemUnregister();
+ SetActiveID(g.ScalarAsInputTextId, window);
+ SetHoveredID(0);
+ FocusableItemUnregister(window);
- bool value_changed = ImGui::InputText(label, text_buf, IM_ARRAYSIZE(text_buf), ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll);
+ char buf[32];
+ DataTypeFormatString(data_type, data_ptr, decimal_precision, buf, IM_ARRAYSIZE(buf));
+ bool value_changed = InputTextEx(label, buf, IM_ARRAYSIZE(buf), aabb.GetSize() - g.Style.FramePadding*2.0f, ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_AutoSelectAll);
if (g.ScalarAsInputTextId == 0)
{
// First frame
IM_ASSERT(g.ActiveId == id); // InputText ID expected to match the Slider ID (else we'd need to store them both, which is also possible)
g.ScalarAsInputTextId = g.ActiveId;
- g.HoveredId = id;
+ SetHoveredID(id);
}
else if (g.ActiveId != g.ScalarAsInputTextId)
{
@@ -5261,15 +5900,14 @@ static bool SliderFloatAsInputText(const char* label, float* v, ImGuiID id, int
g.ScalarAsInputTextId = 0;
}
if (value_changed)
- {
- ApplyNumericalTextInput(text_buf, v);
- }
+ DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, NULL);
return value_changed;
}
// Parse display precision back from the display format string
-static inline void ParseFormat(const char* fmt, int& decimal_precision)
+int ImGui::ParseFormatPrecision(const char* fmt, int default_precision)
{
+ int precision = default_precision;
while ((fmt = strchr(fmt, '%')) != NULL)
{
fmt++;
@@ -5278,30 +5916,33 @@ static inline void ParseFormat(const char* fmt, int& decimal_precision)
fmt++;
if (*fmt == '.')
{
- decimal_precision = atoi(fmt + 1);
- if (decimal_precision < 0 || decimal_precision > 10)
- decimal_precision = 3;
+ precision = atoi(fmt + 1);
+ if (precision < 0 || precision > 10)
+ precision = default_precision;
}
break;
}
+ return precision;
}
-static inline float RoundScalar(float value, int decimal_precision)
+float ImGui::RoundScalar(float value, int decimal_precision)
{
// Round past decimal precision
- // 0: 1, 1: 0.1, 2: 0.01, etc.
// So when our value is 1.99999 with a precision of 0.001 we'll end up rounding to 2.0
// FIXME: Investigate better rounding methods
- const float min_step = 1.0f / powf(10.0f, (float)decimal_precision);
- const float remainder = fmodf(value, min_step);
+ static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f };
+ float min_step = (decimal_precision >= 0 && decimal_precision < 10) ? min_steps[decimal_precision] : powf(10.0f, (float)-decimal_precision);
+ bool negative = value < 0.0f;
+ value = fabsf(value);
+ float remainder = fmodf(value, min_step);
if (remainder <= min_step*0.5f)
value -= remainder;
else
value += (min_step - remainder);
- return value;
+ return negative ? -value : value;
}
-static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_min, float v_max, float power, int decimal_precision, bool horizontal)
+bool ImGui::SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_min, float v_max, float power, int decimal_precision, bool horizontal)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -5312,18 +5953,16 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
const bool is_non_linear = fabsf(power - 1.0f) > 0.0001f;
- const float padding = horizontal ? style.FramePadding.x : style.FramePadding.y;
- const float slider_sz = horizontal ? (frame_bb.GetWidth() - padding * 2.0f) : (frame_bb.GetHeight() - padding * 2.0f);
+ const float grab_padding = 2.0f;
+ const float slider_sz = horizontal ? (frame_bb.GetWidth() - grab_padding * 2.0f) : (frame_bb.GetHeight() - grab_padding * 2.0f);
float grab_sz;
if (decimal_precision > 0)
grab_sz = ImMin(style.GrabMinSize, slider_sz);
else
grab_sz = ImMin(ImMax(1.0f * (slider_sz / (v_max-v_min+1.0f)), style.GrabMinSize), slider_sz); // Integer sliders, if possible have the grab size represent 1 unit
const float slider_usable_sz = slider_sz - grab_sz;
- const float slider_usable_pos_min = (horizontal ? frame_bb.Min.x : frame_bb.Min.y) + padding + grab_sz*0.5f;
- const float slider_usable_pos_max = (horizontal ? frame_bb.Max.x : frame_bb.Max.y) - padding - grab_sz*0.5f;
-
- bool value_changed = false;
+ const float slider_usable_pos_min = (horizontal ? frame_bb.Min.x : frame_bb.Min.y) + grab_padding + grab_sz*0.5f;
+ const float slider_usable_pos_max = (horizontal ? frame_bb.Max.x : frame_bb.Max.y) - grab_padding - grab_sz*0.5f;
// For logarithmic sliders that cross over sign boundary we want the exponential increase to be symmetric around 0.0f
float linear_zero_pos = 0.0f; // 0.0->1.0f
@@ -5341,6 +5980,7 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
}
// Process clicking on the slider
+ bool value_changed = false;
if (g.ActiveId == id)
{
if (g.IO.MouseDown[0])
@@ -5381,7 +6021,6 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
// Round past decimal precision
new_value = RoundScalar(new_value, decimal_precision);
-
if (*v != new_value)
{
*v = new_value;
@@ -5390,7 +6029,7 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
}
else
{
- SetActiveId(0);
+ SetActiveID(0);
}
}
@@ -5422,10 +6061,10 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
const float grab_pos = ImLerp(slider_usable_pos_min, slider_usable_pos_max, grab_t);
ImRect grab_bb;
if (horizontal)
- grab_bb = ImRect(ImVec2(grab_pos - grab_sz*0.5f, frame_bb.Min.y + 2.0f), ImVec2(grab_pos + grab_sz*0.5f, frame_bb.Max.y - 2.0f));
+ grab_bb = ImRect(ImVec2(grab_pos - grab_sz*0.5f, frame_bb.Min.y + grab_padding), ImVec2(grab_pos + grab_sz*0.5f, frame_bb.Max.y - grab_padding));
else
- grab_bb = ImRect(ImVec2(frame_bb.Min.x + 2.0f, grab_pos - grab_sz*0.5f), ImVec2(frame_bb.Max.x - 2.0f, grab_pos + grab_sz*0.5f));
- window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, window->Color(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab));
+ grab_bb = ImRect(ImVec2(frame_bb.Min.x + grab_padding, grab_pos - grab_sz*0.5f), ImVec2(frame_bb.Max.x - grab_padding, grab_pos + grab_sz*0.5f));
+ window->DrawList->AddRectFilled(grab_bb.Min, grab_bb.Max, window->Color(g.ActiveId == id ? ImGuiCol_SliderGrabActive : ImGuiCol_SliderGrab), style.GrabRounding);
return value_changed;
}
@@ -5437,14 +6076,14 @@ static bool SliderScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, f
// "Gold: %.0f" Gold: 1
bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = ImGui::CalcItemWidth();
+ const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
@@ -5459,41 +6098,38 @@ bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, c
const bool hovered = IsHovered(frame_bb, id);
if (hovered)
- g.HoveredId = id;
+ SetHoveredID(id);
if (!display_format)
display_format = "%.3f";
- int decimal_precision = 3;
- ParseFormat(display_format, decimal_precision);
+ int decimal_precision = ParseFormatPrecision(display_format, 3);
// Tabbing or CTRL-clicking on Slider turns it into an input box
bool start_text_input = false;
- const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId == id);
+ const bool tab_focus_requested = FocusableItemRegister(window, g.ActiveId == id);
if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
{
- SetActiveId(id);
+ SetActiveID(id, window);
FocusWindow(window);
- const bool is_ctrl_down = g.IO.KeyCtrl;
- if (tab_focus_requested || is_ctrl_down)
+ if (tab_focus_requested || g.IO.KeyCtrl)
{
start_text_input = true;
g.ScalarAsInputTextId = 0;
}
}
if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id))
- return SliderFloatAsInputText(label, v, id, decimal_precision);
+ return InputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision);
ItemSize(total_bb, style.FramePadding.y);
// Actual slider behavior + render grab
- const bool value_changed = SliderScalarBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, true);
+ const bool value_changed = SliderBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, true);
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
char value_buf[64];
const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v);
- const ImVec2 value_text_size = CalcTextSize(value_buf, value_buf_end, true);
- RenderTextClipped(ImVec2(ImMax(frame_bb.Min.x + style.FramePadding.x, frame_bb.GetCenter().x - value_text_size.x*0.5f), frame_bb.Min.y + style.FramePadding.y), value_buf, value_buf_end, &value_text_size, frame_bb.Max);
+ RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImGuiAlign_Center|ImGuiAlign_VCenter);
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
@@ -5503,11 +6139,11 @@ bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, c
bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
@@ -5521,28 +6157,26 @@ bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float
const bool hovered = IsHovered(frame_bb, id);
if (hovered)
- g.HoveredId = id;
+ SetHoveredID(id);
if (!display_format)
display_format = "%.3f";
- int decimal_precision = 3;
- ParseFormat(display_format, decimal_precision);
+ int decimal_precision = ParseFormatPrecision(display_format, 3);
if (hovered && g.IO.MouseClicked[0])
{
- SetActiveId(id);
+ SetActiveID(id, window);
FocusWindow(window);
}
// Actual slider behavior + render grab
- bool value_changed = SliderScalarBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, false);
+ bool value_changed = SliderBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, false);
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
// For the vertical slider we allow centered text to overlap the frame padding
char value_buf[64];
char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v);
- const ImVec2 value_text_size = CalcTextSize(value_buf, value_buf_end, true);
- RenderTextClipped(ImVec2(ImMax(frame_bb.Min.x, frame_bb.GetCenter().x - value_text_size.x*0.5f), frame_bb.Min.y + style.FramePadding.y), value_buf, value_buf_end, &value_text_size, frame_bb.Max);
+ RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, value_buf, value_buf_end, NULL, ImGuiAlign_Center);
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
@@ -5552,9 +6186,9 @@ bool ImGui::VSliderFloat(const char* label, const ImVec2& size, float* v, float
bool ImGui::SliderAngle(const char* label, float* v_rad, float v_degrees_min, float v_degrees_max)
{
- float v_deg = (*v_rad) * 360.0f / (2*PI);
+ float v_deg = (*v_rad) * 360.0f / (2*IM_PI);
bool value_changed = ImGui::SliderFloat(label, &v_deg, v_degrees_min, v_degrees_max, "%.0f deg", 1.0f);
- *v_rad = v_deg * (2*PI) / 360.0f;
+ *v_rad = v_deg * (2*IM_PI) / 360.0f;
return value_changed;
}
@@ -5579,13 +6213,13 @@ bool ImGui::VSliderInt(const char* label, const ImVec2& size, int* v, int v_min,
}
// Add multiple sliders on 1 line for compact edition of multiple components
-static bool SliderFloatN(const char* label, float* v, int components, float v_min, float v_max, const char* display_format, float power)
+bool ImGui::SliderFloatN(const char* label, float* v, int components, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -5594,7 +6228,7 @@ static bool SliderFloatN(const char* label, float* v, int components, float v_mi
{
ImGui::PushID(i);
value_changed |= ImGui::SliderFloat("##v", &v[i], v_min, v_max, display_format, power);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -5621,13 +6255,13 @@ bool ImGui::SliderFloat4(const char* label, float v[4], float v_min, float v_max
return SliderFloatN(label, v, 4, v_min, v_max, display_format, power);
}
-static bool SliderIntN(const char* label, int* v, int components, int v_min, int v_max, const char* display_format)
+bool ImGui::SliderIntN(const char* label, int* v, int components, int v_min, int v_max, const char* display_format)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -5636,7 +6270,7 @@ static bool SliderIntN(const char* label, int* v, int components, int v_min, int
{
ImGui::PushID(i);
value_changed |= ImGui::SliderInt("##v", &v[i], v_min, v_max, display_format);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -5663,8 +6297,7 @@ bool ImGui::SliderInt4(const char* label, int v[4], int v_min, int v_max, const
return SliderIntN(label, v, 4, v_min, v_max, display_format);
}
-// FIXME-WIP: Work in progress. May change API / behavior.
-static bool DragScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_speed, float v_min, float v_max, int decimal_precision, float power)
+bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_speed, float v_min, float v_max, int decimal_precision, float power)
{
ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
@@ -5733,23 +6366,23 @@ static bool DragScalarBehavior(const ImRect& frame_bb, ImGuiID id, float* v, flo
}
else
{
- SetActiveId(0);
+ SetActiveID(0);
}
}
return value_changed;
}
-bool ImGui::DragFloat(const char* label, float *v, float v_speed, float v_min, float v_max, const char* display_format, float power)
+bool ImGui::DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = ImGui::CalcItemWidth();
+ const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
@@ -5765,19 +6398,18 @@ bool ImGui::DragFloat(const char* label, float *v, float v_speed, float v_min, f
const bool hovered = IsHovered(frame_bb, id);
if (hovered)
- g.HoveredId = id;
+ SetHoveredID(id);
if (!display_format)
display_format = "%.3f";
- int decimal_precision = 3;
- ParseFormat(display_format, decimal_precision);
+ int decimal_precision = ParseFormatPrecision(display_format, 3);
// Tabbing or CTRL-clicking on Drag turns it into an input box
bool start_text_input = false;
- const bool tab_focus_requested = window->FocusItemRegister(g.ActiveId == id);
+ const bool tab_focus_requested = FocusableItemRegister(window, g.ActiveId == id);
if (tab_focus_requested || (hovered && (g.IO.MouseClicked[0] | g.IO.MouseDoubleClicked[0])))
{
- SetActiveId(id);
+ SetActiveID(id, window);
FocusWindow(window);
if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0])
@@ -5787,18 +6419,16 @@ bool ImGui::DragFloat(const char* label, float *v, float v_speed, float v_min, f
}
}
if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id))
- return SliderFloatAsInputText(label, v, id, decimal_precision);
-
- ItemSize(total_bb, style.FramePadding.y);
+ return InputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision);
// Actual drag behavior
- const bool value_changed = DragScalarBehavior(frame_bb, id, v, v_speed, v_min, v_max, decimal_precision, power);
+ ItemSize(total_bb, style.FramePadding.y);
+ const bool value_changed = DragBehavior(frame_bb, id, v, v_speed, v_min, v_max, decimal_precision, power);
// Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
char value_buf[64];
const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v);
- const ImVec2 value_text_size = CalcTextSize(value_buf, value_buf_end, true);
- RenderTextClipped(ImVec2(ImMax(frame_bb.Min.x + style.FramePadding.x, inner_bb.GetCenter().x - value_text_size.x*0.5f), frame_bb.Min.y + style.FramePadding.y), value_buf, value_buf_end, &value_text_size, frame_bb.Max);
+ RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImGuiAlign_Center|ImGuiAlign_VCenter);
if (label_size.x > 0.0f)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);
@@ -5806,13 +6436,13 @@ bool ImGui::DragFloat(const char* label, float *v, float v_speed, float v_min, f
return value_changed;
}
-static bool DragFloatN(const char* label, float* v, int components, float v_speed, float v_min, float v_max, const char* display_format, float power)
+bool ImGui::DragFloatN(const char* label, float* v, int components, float v_speed, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -5821,7 +6451,7 @@ static bool DragFloatN(const char* label, float* v, int components, float v_spee
{
ImGui::PushID(i);
value_changed |= ImGui::DragFloat("##v", &v[i], v_speed, v_min, v_max, display_format, power);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -5838,16 +6468,41 @@ bool ImGui::DragFloat2(const char* label, float v[2], float v_speed, float v_min
return DragFloatN(label, v, 2, v_speed, v_min, v_max, display_format, power);
}
-bool ImGui::DragFloat3(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* display_format, float power)
+bool ImGui::DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* display_format, float power)
{
return DragFloatN(label, v, 3, v_speed, v_min, v_max, display_format, power);
}
-bool ImGui::DragFloat4(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* display_format, float power)
+bool ImGui::DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* display_format, float power)
{
return DragFloatN(label, v, 4, v_speed, v_min, v_max, display_format, power);
}
+bool ImGui::DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed, float v_min, float v_max, const char* display_format, const char* display_format_max, float power)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ ImGuiState& g = *GImGui;
+ ImGui::PushID(label);
+ ImGui::BeginGroup();
+ PushMultiItemsWidths(2);
+
+ bool value_changed = ImGui::DragFloat("##min", v_current_min, v_speed, (v_min >= v_max) ? -FLT_MAX : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format, power);
+ ImGui::PopItemWidth();
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
+ value_changed |= ImGui::DragFloat("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? FLT_MAX : v_max, display_format_max ? display_format_max : display_format, power);
+ ImGui::PopItemWidth();
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
+
+ ImGui::TextUnformatted(label, FindTextDisplayEnd(label));
+ ImGui::EndGroup();
+ ImGui::PopID();
+
+ return value_changed;
+}
+
// NB: v_speed is float to allow adjusting the drag speed with more precision
bool ImGui::DragInt(const char* label, int* v, float v_speed, int v_min, int v_max, const char* display_format)
{
@@ -5859,13 +6514,13 @@ bool ImGui::DragInt(const char* label, int* v, float v_speed, int v_min, int v_m
return value_changed;
}
-static bool DragIntN(const char* label, int* v, int components, float v_speed, int v_min, int v_max, const char* display_format)
+bool ImGui::DragIntN(const char* label, int* v, int components, float v_speed, int v_min, int v_max, const char* display_format)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -5874,7 +6529,7 @@ static bool DragIntN(const char* label, int* v, int components, float v_speed, i
{
ImGui::PushID(i);
value_changed |= ImGui::DragInt("##v", &v[i], v_speed, v_min, v_max, display_format);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -5901,24 +6556,43 @@ bool ImGui::DragInt4(const char* label, int v[4], float v_speed, int v_min, int
return DragIntN(label, v, 4, v_speed, v_min, v_max, display_format);
}
-enum ImGuiPlotType
+bool ImGui::DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed, int v_min, int v_max, const char* display_format, const char* display_format_max)
{
- ImGuiPlotType_Lines,
- ImGuiPlotType_Histogram
-};
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
-static 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)
-{
ImGuiState& g = *GImGui;
+ ImGui::PushID(label);
+ ImGui::BeginGroup();
+ PushMultiItemsWidths(2);
+
+ bool value_changed = ImGui::DragInt("##min", v_current_min, v_speed, (v_min >= v_max) ? IM_INT_MIN : v_min, (v_min >= v_max) ? *v_current_max : ImMin(v_max, *v_current_max), display_format);
+ ImGui::PopItemWidth();
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
+ value_changed |= ImGui::DragInt("##max", v_current_max, v_speed, (v_min >= v_max) ? *v_current_min : ImMax(v_min, *v_current_min), (v_min >= v_max) ? IM_INT_MAX : v_max, display_format_max ? display_format_max : display_format);
+ ImGui::PopItemWidth();
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
+
+ ImGui::TextUnformatted(label, FindTextDisplayEnd(label));
+ ImGui::EndGroup();
+ ImGui::PopID();
+
+ return value_changed;
+}
+
+void ImGui::PlotEx(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)
+{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
if (graph_size.x == 0.0f)
- graph_size.x = ImGui::CalcItemWidth() + (style.FramePadding.x * 2);
+ graph_size.x = CalcItemWidth() + (style.FramePadding.x * 2);
if (graph_size.y == 0.0f)
graph_size.y = label_size.y + (style.FramePadding.y * 2);
@@ -5948,18 +6622,17 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
- int res_w = ImMin((int)graph_size.x, values_count);
- if (plot_type == ImGuiPlotType_Lines)
- res_w -= 1;
+ int res_w = ImMin((int)graph_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
+ int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
// Tooltip on hover
int v_hovered = -1;
- if (IsMouseHoveringRect(inner_bb))
+ if (IsHovered(inner_bb, 0))
{
const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f);
- const int v_idx = (int)(t * (values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0)));
+ const int v_idx = (int)(t * item_count);
IM_ASSERT(v_idx >= 0 && v_idx < values_count);
-
+
const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
if (plot_type == ImGuiPlotType_Lines)
@@ -5973,7 +6646,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
float v0 = values_getter(data, (0 + values_offset) % values_count);
float t0 = 0.0f;
- ImVec2 p0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) / (scale_max - scale_min)) );
+ ImVec2 tp0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) / (scale_max - scale_min)) ); // Point in the normalized space of our target rectangle
const ImU32 col_base = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram);
const ImU32 col_hovered = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered);
@@ -5981,24 +6654,32 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
for (int n = 0; n < res_w; n++)
{
const float t1 = t0 + t_step;
- const int v_idx = (int)(t0 * values_count);
- IM_ASSERT(v_idx >= 0 && v_idx < values_count);
- const float v1 = values_getter(data, (v_idx + values_offset + 1) % values_count);
- const ImVec2 p1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) / (scale_max - scale_min)) );
-
- // NB- Draw calls are merged together by the DrawList system.
+ const int v1_idx = (int)(t0 * item_count + 0.5f);
+ IM_ASSERT(v1_idx >= 0 && v1_idx < values_count);
+ const float v1 = values_getter(data, (v1_idx + values_offset + 1) % values_count);
+ const ImVec2 tp1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) / (scale_max - scale_min)) );
+
+ // NB: Draw calls are merged together by the DrawList system. Still, we should render our batch are lower level to save a bit of CPU.
+ ImVec2 pos0 = ImLerp(inner_bb.Min, inner_bb.Max, tp0);
+ ImVec2 pos1 = ImLerp(inner_bb.Min, inner_bb.Max, (plot_type == ImGuiPlotType_Lines) ? tp1 : ImVec2(tp1.x, 1.0f));
if (plot_type == ImGuiPlotType_Lines)
- window->DrawList->AddLine(ImLerp(inner_bb.Min, inner_bb.Max, p0), ImLerp(inner_bb.Min, inner_bb.Max, p1), v_hovered == v_idx ? col_hovered : col_base);
+ {
+ window->DrawList->AddLine(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base);
+ }
else if (plot_type == ImGuiPlotType_Histogram)
- window->DrawList->AddRectFilled(ImLerp(inner_bb.Min, inner_bb.Max, p0), ImLerp(inner_bb.Min, inner_bb.Max, ImVec2(p1.x, 1.0f))+ImVec2(-1,0), v_hovered == v_idx ? col_hovered : col_base);
+ {
+ if (pos1.x >= pos0.x + 2.0f)
+ pos1.x -= 1.0f;
+ window->DrawList->AddRectFilled(pos0, pos1, v_hovered == v1_idx ? col_hovered : col_base);
+ }
t0 = t1;
- p0 = p1;
+ tp0 = tp1;
}
// Text overlay
if (overlay_text)
- RenderTextClipped(ImVec2(ImMax(inner_bb.Min.x, inner_bb.GetCenter().x - ImGui::CalcTextSize(overlay_text, NULL, true).x*0.5f), frame_bb.Min.y + style.FramePadding.y), overlay_text, NULL, NULL, frame_bb.Max);
+ RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImGuiAlign_Center);
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);
}
@@ -6006,9 +6687,9 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
struct ImGuiPlotArrayGetterData
{
const float* Values;
- size_t Stride;
+ int Stride;
- ImGuiPlotArrayGetterData(const float* values, size_t stride) { Values = values; Stride = stride; }
+ ImGuiPlotArrayGetterData(const float* values, int stride) { Values = values; Stride = stride; }
};
static float Plot_ArrayGetter(void* data, int idx)
@@ -6018,35 +6699,35 @@ static float Plot_ArrayGetter(void* data, int idx)
return v;
}
-void ImGui::PlotLines(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, size_t stride)
+void ImGui::PlotLines(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride)
{
ImGuiPlotArrayGetterData data(values, stride);
- Plot(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
+ PlotEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
}
void ImGui::PlotLines(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)
{
- Plot(ImGuiPlotType_Lines, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
+ PlotEx(ImGuiPlotType_Lines, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
}
-void ImGui::PlotHistogram(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, size_t stride)
+void ImGui::PlotHistogram(const char* label, const float* values, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride)
{
ImGuiPlotArrayGetterData data(values, stride);
- Plot(ImGuiPlotType_Histogram, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
+ PlotEx(ImGuiPlotType_Histogram, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
}
void ImGui::PlotHistogram(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)
{
- Plot(ImGuiPlotType_Histogram, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
+ PlotEx(ImGuiPlotType_Histogram, label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
}
bool ImGui::Checkbox(const char* label, bool* v)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
@@ -6056,7 +6737,7 @@ bool ImGui::Checkbox(const char* label, bool* v)
ImRect total_bb = check_bb;
if (label_size.x > 0)
- SameLine(0, (int)style.ItemInnerSpacing.x);
+ SameLine(0, style.ItemInnerSpacing.x);
const ImRect text_bb(window->DC.CursorPos + ImVec2(0,style.FramePadding.y), window->DC.CursorPos + ImVec2(0,style.FramePadding.y) + label_size);
if (label_size.x > 0)
{
@@ -6076,12 +6757,12 @@ bool ImGui::Checkbox(const char* label, bool* v)
if (*v)
{
const float check_sz = ImMin(check_bb.GetWidth(), check_bb.GetHeight());
- const float pad = check_sz < 8.0f ? 1.0f : check_sz < 13.0f ? 2.0f : 3.0f;
+ const float pad = ImMax(1.0f, (float)(int)(check_sz / 6.0f));
window->DrawList->AddRectFilled(check_bb.Min+ImVec2(pad,pad), check_bb.Max-ImVec2(pad,pad), window->Color(ImGuiCol_CheckMark), style.FrameRounding);
}
if (g.LogEnabled)
- LogText(text_bb.GetTL(), *v ? "[x]" : "[ ]");
+ LogRenderedText(text_bb.GetTL(), *v ? "[x]" : "[ ]");
RenderText(text_bb.GetTL(), label);
return pressed;
@@ -6100,11 +6781,11 @@ bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int f
bool ImGui::RadioButton(const char* label, bool active)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
@@ -6114,7 +6795,7 @@ bool ImGui::RadioButton(const char* label, bool active)
ImRect total_bb = check_bb;
if (label_size.x > 0)
- SameLine(0, (int)style.ItemInnerSpacing.x);
+ SameLine(0, style.ItemInnerSpacing.x);
const ImRect text_bb(window->DC.CursorPos + ImVec2(0, style.FramePadding.y), window->DC.CursorPos + ImVec2(0, style.FramePadding.y) + label_size);
if (label_size.x > 0)
{
@@ -6137,7 +6818,7 @@ bool ImGui::RadioButton(const char* label, bool active)
if (active)
{
const float check_sz = ImMin(check_bb.GetWidth(), check_bb.GetHeight());
- const float pad = check_sz < 8.0f ? 1.0f : check_sz < 13.0f ? 2.0f : 3.0f;
+ const float pad = ImMax(1.0f, (float)(int)(check_sz / 6.0f));
window->DrawList->AddCircleFilled(center, radius-pad, window->Color(ImGuiCol_CheckMark), 16);
}
@@ -6148,7 +6829,7 @@ bool ImGui::RadioButton(const char* label, bool active)
}
if (g.LogEnabled)
- LogText(text_bb.GetTL(), active ? "(x)" : "( )");
+ LogRenderedText(text_bb.GetTL(), active ? "(x)" : "( )");
RenderText(text_bb.GetTL(), label);
return pressed;
@@ -6164,54 +6845,117 @@ bool ImGui::RadioButton(const char* label, int* v, int v_button)
return pressed;
}
+static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end)
+{
+ int line_count = 0;
+ const char* s = text_begin;
+ while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding
+ if (c == '\n')
+ line_count++;
+ s--;
+ if (s[0] != '\n' && s[0] != '\r')
+ line_count++;
+ *out_text_end = s;
+ return line_count;
+}
+
+static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line)
+{
+ ImFont* font = GImGui->Font;
+ const float line_height = GImGui->FontSize;
+ const float scale = line_height / font->FontSize;
+
+ ImVec2 text_size = ImVec2(0,0);
+ float line_width = 0.0f;
+
+ const ImWchar* s = text_begin;
+ while (s < text_end)
+ {
+ unsigned int c = (unsigned int)(*s++);
+ if (c == '\n')
+ {
+ text_size.x = ImMax(text_size.x, line_width);
+ text_size.y += line_height;
+ line_width = 0.0f;
+ if (stop_on_new_line)
+ break;
+ continue;
+ }
+ if (c == '\r')
+ continue;
+
+ const float char_width = font->GetCharAdvance((unsigned short)c) * scale;
+ line_width += char_width;
+ }
+
+ if (text_size.x < line_width)
+ text_size.x = line_width;
+
+ if (out_offset)
+ *out_offset = ImVec2(line_width, text_size.y + line_height); // offset allow for the possibility of sitting after a trailing \n
+
+ if (line_width > 0 || text_size.y == 0.0f) // whereas size.y will ignore the trailing \n
+ text_size.y += line_height;
+
+ if (remaining)
+ *remaining = s;
+
+ return text_size;
+}
+
// Wrapper for stb_textedit.h to edit text (our wrapper is for: statically sized buffer, single-line, wchar characters. InputText converts between UTF-8 and wchar)
-static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj) { return (int)ImStrlenW(obj->Text); }
+namespace ImGuiStb
+{
+
+static int STB_TEXTEDIT_STRINGLEN(const STB_TEXTEDIT_STRING* obj) { return obj->CurLenW; }
static ImWchar STB_TEXTEDIT_GETCHAR(const STB_TEXTEDIT_STRING* obj, int idx) { return obj->Text[idx]; }
-static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx) { (void)line_start_idx; return obj->Font->CalcTextSizeW(obj->FontSize, FLT_MAX, &obj->Text[char_idx], &obj->Text[char_idx]+1, NULL).x; }
+static float STB_TEXTEDIT_GETWIDTH(STB_TEXTEDIT_STRING* obj, int line_start_idx, int char_idx) { ImWchar c = obj->Text[line_start_idx+char_idx]; if (c == '\n') return STB_TEXTEDIT_GETWIDTH_NEWLINE; return GImGui->Font->GetCharAdvance(c) * (GImGui->FontSize / GImGui->Font->FontSize); }
static int STB_TEXTEDIT_KEYTOTEXT(int key) { return key >= 0x10000 ? 0 : key; }
static ImWchar STB_TEXTEDIT_NEWLINE = '\n';
static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx)
{
+ const ImWchar* text = obj->Text.Data;
const ImWchar* text_remaining = NULL;
- const ImVec2 size = obj->Font->CalcTextSizeW(obj->FontSize, FLT_MAX, obj->Text + line_start_idx, NULL, &text_remaining);
+ const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true);
r->x0 = 0.0f;
r->x1 = size.x;
r->baseline_y_delta = size.y;
r->ymin = 0.0f;
r->ymax = size.y;
- r->num_chars = (int)(text_remaining - (obj->Text + line_start_idx));
+ r->num_chars = (int)(text_remaining - (text + line_start_idx));
}
static bool is_separator(unsigned int c) { return c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|'; }
#define STB_TEXTEDIT_IS_SPACE(CH) ( ImCharIsSpace((unsigned int)CH) || is_separator((unsigned int)CH) )
static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n)
{
- ImWchar* dst = obj->Text + pos;
+ ImWchar* dst = obj->Text.Data + pos;
// We maintain our buffer length in both UTF-8 and wchar formats
obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n);
obj->CurLenW -= n;
// Offset remaining text
- const ImWchar* src = obj->Text + pos + n;
+ const ImWchar* src = obj->Text.Data + pos + n;
while (ImWchar c = *src++)
- *dst++ = c;
+ *dst++ = c;
*dst = '\0';
}
static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len)
{
- const size_t text_len = obj->CurLenW;
- if ((size_t)new_text_len + text_len + 1 > IM_ARRAYSIZE(obj->Text))
+ const int text_len = obj->CurLenW;
+ if (new_text_len + text_len + 1 > obj->Text.Size)
return false;
const int new_text_len_utf8 = ImTextCountUtf8BytesFromStr(new_text, new_text + new_text_len);
- if ((size_t)new_text_len_utf8 + obj->CurLenA + 1 > obj->BufSizeA)
+ if (new_text_len_utf8 + obj->CurLenA + 1 > obj->BufSizeA)
return false;
- if (pos != (int)text_len)
- memmove(obj->Text + (size_t)pos + new_text_len, obj->Text + (size_t)pos, (text_len - (size_t)pos) * sizeof(ImWchar));
- memcpy(obj->Text + (size_t)pos, new_text, (size_t)new_text_len * sizeof(ImWchar));
+ ImWchar* text = obj->Text.Data;
+ if (pos != text_len)
+ memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos) * sizeof(ImWchar));
+ memcpy(text + pos, new_text, (size_t)new_text_len * sizeof(ImWchar));
obj->CurLenW += new_text_len;
obj->CurLenA += new_text_len_utf8;
@@ -6237,169 +6981,16 @@ static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const Im
#define STB_TEXTEDIT_K_WORDRIGHT 0x1000D // keyboard input to move cursor right one word
#define STB_TEXTEDIT_K_SHIFT 0x20000
-#ifdef IMGUI_STB_NAMESPACE
-namespace IMGUI_STB_NAMESPACE
-{
-#endif
#define STB_TEXTEDIT_IMPLEMENTATION
#include "stb_textedit.h"
-#ifdef IMGUI_STB_NAMESPACE
-}
-#endif
-
-void ImGuiTextEditState::OnKeyPressed(int key)
-{
- stb_textedit_key(this, &StbState, key);
- CursorAnimReset();
-}
-
-void ImGuiTextEditState::UpdateScrollOffset()
-{
- // Scroll in chunks of quarter width
- const float scroll_x_increment = Width * 0.25f;
- const float cursor_offset_x = Font->CalcTextSizeW(FontSize, FLT_MAX, Text, Text+StbState.cursor, NULL).x;
-
- // If widget became bigger than text (because of a resize), reset horizontal scrolling
- if (ScrollX > 0.0f)
- {
- const float text_width = cursor_offset_x + Font->CalcTextSizeW(FontSize, FLT_MAX, Text+StbState.cursor, NULL, NULL).x;
- if (text_width < Width)
- {
- ScrollX = 0.0f;
- return;
- }
- }
-
- if (cursor_offset_x < ScrollX)
- ScrollX = ImMax(0.0f, cursor_offset_x - scroll_x_increment);
- else if (cursor_offset_x - Width >= ScrollX)
- ScrollX = cursor_offset_x - Width + scroll_x_increment;
-}
-
-ImVec2 ImGuiTextEditState::CalcDisplayOffsetFromCharIdx(int i) const
-{
- const ImWchar* text_start = GetTextPointerClippedW(Font, FontSize, Text, ScrollX, NULL);
- const ImWchar* text_end = (Text+i >= text_start) ? Text+i : text_start; // Clip if requested character is outside of display
- IM_ASSERT(text_end >= text_start);
-
- const ImVec2 offset = Font->CalcTextSizeW(FontSize, Width+1, text_start, text_end, NULL);
- return offset;
-}
-
-// [Static]
-const char* ImGuiTextEditState::GetTextPointerClippedA(ImFont* font, float font_size, const char* text, float width, ImVec2* out_text_size)
-{
- if (width <= 0.0f)
- return text;
-
- const char* text_clipped_end = NULL;
- const ImVec2 text_size = font->CalcTextSizeA(font_size, width, 0.0f, text, NULL, &text_clipped_end);
- if (out_text_size)
- *out_text_size = text_size;
- return text_clipped_end;
-}
-
-// [Static]
-const ImWchar* ImGuiTextEditState::GetTextPointerClippedW(ImFont* font, float font_size, const ImWchar* text, float width, ImVec2* out_text_size)
-{
- if (width <= 0.0f)
- return text;
-
- const ImWchar* text_clipped_end = NULL;
- const ImVec2 text_size = font->CalcTextSizeW(font_size, width, text, NULL, &text_clipped_end);
- if (out_text_size)
- *out_text_size = text_size;
- return text_clipped_end;
-}
-
-// [Static]
-void ImGuiTextEditState::RenderTextScrolledClipped(ImFont* font, float font_size, const char* buf, ImVec2 pos, float width, float scroll_x)
-{
- ImGuiWindow* window = GetCurrentWindow();
- const ImU32 font_color = window->Color(ImGuiCol_Text);
- //window->DrawList->AddLine(pos, pos+ImVec2(width,0), 0xFF00FFFF);
-
- // Determine start and end of visible string
- // FIXME-OPT: This is pretty slow for what it does.
- const char* text_start = scroll_x <= 0.0f ? buf : GetTextPointerClippedA(font, font_size, buf, scroll_x, NULL);
- const char* text_end = GetTextPointerClippedA(font, font_size, text_start, width + 1, NULL); // +1 to allow character spacing to fit outside the allowed width
- window->DrawList->AddText(font, font_size, pos, font_color, text_start, text_end);
-
- // Log as text
- if (GImGui->LogEnabled)
- LogText(pos, buf, NULL);
-}
-
-bool ImGui::InputFloat(const char* label, float *v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags)
-{
- ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- if (window->SkipItems)
- return false;
-
- const ImGuiStyle& style = g.Style;
- const float w = ImGui::CalcItemWidth();
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
-
- ImGui::BeginGroup();
- ImGui::PushID(label);
- const ImVec2 button_sz = ImVec2(g.FontSize, g.FontSize) + style.FramePadding * 2;
- if (step > 0.0f)
- ImGui::PushItemWidth(ImMax(1.0f, w - (button_sz.x + style.ItemInnerSpacing.x)*2));
-
- char buf[64];
- if (decimal_precision < 0)
- ImFormatString(buf, IM_ARRAYSIZE(buf), "%f", *v); // Ideally we'd have a minimum decimal precision of 1 to visually denote that it is a float, while hiding non-significant digits?
- else
- ImFormatString(buf, IM_ARRAYSIZE(buf), "%.*f", decimal_precision, *v);
- bool value_changed = false;
- const ImGuiInputTextFlags flags = extra_flags | (ImGuiInputTextFlags_CharsDecimal|ImGuiInputTextFlags_AutoSelectAll);
- if (ImGui::InputText("", buf, IM_ARRAYSIZE(buf), flags))
- {
- ApplyNumericalTextInput(buf, v);
- value_changed = true;
- }
-
- // Step buttons
- if (step > 0.0f)
- {
- ImGui::PopItemWidth();
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
- if (ImGui::Button("-", button_sz, true))
- {
- *v -= g.IO.KeyCtrl && step_fast > 0.0f ? step_fast : step;
- value_changed = true;
- }
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
- if (ImGui::Button("+", button_sz, true))
- {
- *v += g.IO.KeyCtrl && step_fast > 0.0f ? step_fast : step;
- value_changed = true;
- }
- }
-
- ImGui::PopID();
-
- if (label_size.x > 0)
- {
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
- RenderText(ImVec2(window->DC.CursorPos.x, window->DC.CursorPos.y + style.FramePadding.y), label);
- ItemSize(label_size, style.FramePadding.y);
- }
- ImGui::EndGroup();
-
- return value_changed;
}
-bool ImGui::InputInt(const char* label, int *v, int step, int step_fast, ImGuiInputTextFlags extra_flags)
+void ImGuiTextEditState::OnKeyPressed(int key)
{
- float f = (float)*v;
- const bool value_changed = ImGui::InputFloat(label, &f, (float)step, (float)step_fast, 0, extra_flags);
- if (value_changed)
- *v = (int)f;
- return value_changed;
+ stb_textedit_key(this, &StbState, key);
+ CursorFollow = true;
+ CursorAnimReset();
}
// Public API to manipulate UTF-8 text
@@ -6422,23 +7013,22 @@ void ImGuiTextEditCallbackData::DeleteChars(int pos, int bytes_count)
void ImGuiTextEditCallbackData::InsertChars(int pos, const char* new_text, const char* new_text_end)
{
- const size_t text_len = strlen(Buf);
+ const int text_len = (int)strlen(Buf);
if (!new_text_end)
new_text_end = new_text + strlen(new_text);
- const size_t new_text_len = (size_t)(new_text_end - new_text);
+ const int new_text_len = (int)(new_text_end - new_text);
if (new_text_len + text_len + 1 >= BufSize)
return;
- size_t upos = (size_t)pos;
- if (text_len != upos)
- memmove(Buf + upos + new_text_len, Buf + upos, text_len - upos);
- memcpy(Buf + upos, new_text, new_text_len * sizeof(char));
+ if (text_len != pos)
+ memmove(Buf + pos + new_text_len, Buf + pos, (size_t)(text_len - pos));
+ memcpy(Buf + pos, new_text, (size_t)new_text_len * sizeof(char));
Buf[text_len + new_text_len] = '\0';
BufDirty = true;
if (CursorPos >= pos)
- CursorPos += (int)new_text_len;
+ CursorPos += new_text_len;
SelectionStart = SelectionEnd = CursorPos;
}
@@ -6448,7 +7038,13 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
unsigned int c = *p_char;
if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF)))
- return false;
+ {
+ bool pass = false;
+ pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline));
+ pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
+ if (!pass)
+ return false;
+ }
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.
return false;
@@ -6476,7 +7072,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
{
ImGuiTextEditCallbackData callback_data;
memset(&callback_data, 0, sizeof(ImGuiTextEditCallbackData));
- callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter;
+ callback_data.EventFlag = ImGuiInputTextFlags_CallbackCharFilter;
callback_data.EventChar = (ImWchar)c;
callback_data.Flags = flags;
callback_data.UserData = user_data;
@@ -6491,25 +7087,48 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
}
// Edit a string of text
-bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
+bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackHistory) && (flags & ImGuiInputTextFlags_Multiline))); // Can't use both together (they both use up/down keys)
+ IM_ASSERT(!((flags & ImGuiInputTextFlags_CallbackCompletion) && (flags & ImGuiInputTextFlags_AllowTabInput))); // Can't use both together (they both use tab key)
+
+ ImGuiState& g = *GImGui;
const ImGuiIO& io = g.IO;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = ImGui::CalcItemWidth();
+ const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0;
+ const bool is_editable = (flags & ImGuiInputTextFlags_ReadOnly) == 0;
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+ ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ ImVec2 size = CalcItemSize(size_arg, CalcItemWidth(), is_multiline ? ImGui::GetTextLineHeight() * 8.0f : label_size.y); // Arbitrary default of 8 lines high for multi-line
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + size + style.FramePadding*2.0f);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? (style.ItemInnerSpacing.x + label_size.x) : 0.0f, 0.0f));
- ItemSize(total_bb, style.FramePadding.y);
- if (!ItemAdd(total_bb, &id))
- return false;
+
+ ImGuiWindow* draw_window = window;
+ if (is_multiline)
+ {
+ ImGui::BeginGroup();
+ if (!ImGui::BeginChildFrame(id, frame_bb.GetSize()))
+ {
+ ImGui::EndChildFrame();
+ ImGui::EndGroup();
+ return false;
+ }
+ draw_window = GetCurrentWindow();
+ draw_window->DC.CursorPos += style.FramePadding;
+ size.x -= draw_window->ScrollbarSizes.x;
+ }
+ else
+ {
+ ItemSize(total_bb, style.FramePadding.y);
+ if (!ItemAdd(total_bb, &id))
+ return false;
+ }
// NB: we are only allowed to access 'edit_state' if we are the active widget.
ImGuiTextEditState& edit_state = g.InputTextState;
@@ -6517,88 +7136,86 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
const bool is_ctrl_down = io.KeyCtrl;
const bool is_shift_down = io.KeyShift;
const bool is_alt_down = io.KeyAlt;
- const bool focus_requested = window->FocusItemRegister(g.ActiveId == id, (flags & ImGuiInputTextFlags_CallbackCompletion) == 0); // Using completion callback disable keyboard tabbing
+ const bool focus_requested = FocusableItemRegister(window, g.ActiveId == id, (flags & (ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_AllowTabInput)) == 0); // Using completion callback disable keyboard tabbing
const bool focus_requested_by_code = focus_requested && (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent);
const bool focus_requested_by_tab = focus_requested && !focus_requested_by_code;
const bool hovered = IsHovered(frame_bb, id);
if (hovered)
{
- g.HoveredId = id;
+ SetHoveredID(id);
g.MouseCursor = ImGuiMouseCursor_TextInput;
}
const bool user_clicked = hovered && io.MouseClicked[0];
+ const bool user_scrolled = is_multiline && g.ActiveId == 0 && edit_state.Id == id && g.ActiveIdPreviousFrame == draw_window->GetID("#SCROLLY");
bool select_all = (g.ActiveId != id) && (flags & ImGuiInputTextFlags_AutoSelectAll) != 0;
- if (focus_requested || user_clicked)
+ if (focus_requested || user_clicked || user_scrolled)
{
if (g.ActiveId != id)
{
// Start edition
// Take a copy of the initial buffer value (both in original UTF-8 format and converted to wchar)
// From the moment we focused we are ignoring the content of 'buf'
- ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf);
+ const int prev_len_w = edit_state.CurLenW;
+ edit_state.Text.resize(buf_size+1); // wchar count <= utf-8 count. we use +1 to make sure that .Data isn't NULL so it doesn't crash.
+ edit_state.InitialText.resize(buf_size+1); // utf-8. we use +1 to make sure that .Data isn't NULL so it doesn't crash.
+ ImFormatString(edit_state.InitialText.Data, edit_state.InitialText.Size, "%s", buf);
const char* buf_end = NULL;
- edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
- edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
- edit_state.Width = w + style.FramePadding.x;
- edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f);
+ edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text.Data, edit_state.Text.Size, buf, NULL, &buf_end);
+ edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
+ edit_state.InputCursorScreenPos = ImVec2(-1.f, -1.f);
edit_state.CursorAnimReset();
- if (edit_state.Id != id)
+ // Preserve cursor position and undo/redo stack if we come back to same widget
+ // FIXME: We should probably compare the whole buffer to be on the safety side. Comparing buf (utf8) and edit_state.Text (wchar).
+ const bool recycle_state = (edit_state.Id == id) && (prev_len_w == edit_state.CurLenW);
+ if (recycle_state)
{
- edit_state.Id = id;
- edit_state.ScrollX = 0.0f;
- stb_textedit_initialize_state(&edit_state.StbState, true);
- if (focus_requested_by_code)
- select_all = true;
+ // Recycle existing cursor/selection/undo stack but clamp position
+ // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler.
+ edit_state.StbState.cursor = ImMin(edit_state.StbState.cursor, edit_state.CurLenW);
+ edit_state.StbState.select_start = ImMin(edit_state.StbState.select_start, edit_state.CurLenW);
+ edit_state.StbState.select_end = ImMin(edit_state.StbState.select_end, edit_state.CurLenW);
}
else
{
- // Recycle existing cursor/selection/undo stack but clamp position
- // Note a single mouse click will override the cursor/position immediately by calling stb_textedit_click handler.
- edit_state.StbState.cursor = ImMin(edit_state.StbState.cursor, (int)edit_state.CurLenW);
- edit_state.StbState.select_start = ImMin(edit_state.StbState.select_start, (int)edit_state.CurLenW);
- edit_state.StbState.select_end = ImMin(edit_state.StbState.select_end, (int)edit_state.CurLenW);
+ edit_state.Id = id;
+ edit_state.ScrollX = 0.0f;
+ stb_textedit_initialize_state(&edit_state.StbState, !is_multiline);
+ if (!is_multiline && focus_requested_by_code)
+ select_all = true;
}
- if (focus_requested_by_tab || (user_clicked && is_ctrl_down))
+ if (flags & ImGuiInputTextFlags_AlwaysInsertMode)
+ edit_state.StbState.insert_mode = true;
+ if (!is_multiline && (focus_requested_by_tab || (user_clicked && is_ctrl_down)))
select_all = true;
}
- SetActiveId(id);
+ SetActiveID(id, window);
FocusWindow(window);
}
else if (io.MouseClicked[0])
{
// Release focus when we click outside
if (g.ActiveId == id)
- {
- SetActiveId(0);
- }
+ SetActiveID(0);
}
- // Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget.
- // Down the line we should have a cleaner concept of focused vs active in the library.
- if (g.ActiveId == id)
- g.ActiveIdIsFocusedOnly = !io.MouseDown[0];
-
bool value_changed = false;
bool cancel_edit = false;
bool enter_pressed = false;
+
if (g.ActiveId == id)
- //if (edit_state.Id == id) // Works, but double-click to select-all sets cursors to end which in turn tends to scroll toward the right when shrinking widget.
{
- // Update some data if we are active or last active
- edit_state.Width = w + style.FramePadding.x;
edit_state.BufSizeA = buf_size;
- edit_state.Font = g.Font;
- edit_state.FontSize = g.FontSize;
- edit_state.UpdateScrollOffset();
- }
- if (g.ActiveId == id)
- {
+
+ // Although we are active we don't prevent mouse from hovering other elements unless we are interacting right now with the widget.
+ // Down the line we should have a cleaner concept of focused vs active in the library.
+ g.ActiveIdAllowHoveringOthers = !io.MouseDown[0];
+
// Edit in progress
- const float mx = g.IO.MousePos.x - frame_bb.Min.x - style.FramePadding.x;
- const float my = g.FontSize*0.5f; // Flatten mouse because we are doing a single-line edit
+ const float mouse_x = (g.IO.MousePos.x - frame_bb.Min.x - style.FramePadding.x) + edit_state.ScrollX;
+ const float mouse_y = (is_multiline ? (g.IO.MousePos.y - draw_window->DC.CursorPos.y - style.FramePadding.y) : (g.FontSize*0.5f));
if (select_all || (hovered && io.MouseDoubleClicked[0]))
{
@@ -6607,13 +7224,14 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
}
else if (io.MouseClicked[0] && !edit_state.SelectedAllMouseLock)
{
- stb_textedit_click(&edit_state, &edit_state.StbState, mx + edit_state.ScrollX, my);
+ stb_textedit_click(&edit_state, &edit_state.StbState, mouse_x, mouse_y);
edit_state.CursorAnimReset();
}
else if (io.MouseDown[0] && !edit_state.SelectedAllMouseLock)
{
- stb_textedit_drag(&edit_state, &edit_state.StbState, mx + edit_state.ScrollX, my);
+ stb_textedit_drag(&edit_state, &edit_state.StbState, mouse_x, mouse_y);
edit_state.CursorAnimReset();
+ edit_state.CursorFollow = true;
}
if (edit_state.SelectedAllMouseLock && !io.MouseDown[0])
edit_state.SelectedAllMouseLock = false;
@@ -6621,16 +7239,17 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
if (g.IO.InputCharacters[0])
{
// Process text input (before we check for Return because using some IME will effectively send a Return?)
- for (int n = 0; n < IM_ARRAYSIZE(g.IO.InputCharacters) && g.IO.InputCharacters[n]; n++)
+ // We ignore CTRL inputs, but need to allow CTRL+ALT as some keyboards (e.g. German) use AltGR - which is Alt+Ctrl - to input certain characters.
+ if (!(is_ctrl_down && !is_alt_down) && is_editable)
{
- unsigned int c = (unsigned int)g.IO.InputCharacters[n];
- if (c)
- {
- // Insert character if they pass filtering
- if (!InputTextFilterCharacter(&c, flags, callback, user_data))
- continue;
- edit_state.OnKeyPressed((int)c);
- }
+ for (int n = 0; n < IM_ARRAYSIZE(g.IO.InputCharacters) && g.IO.InputCharacters[n]; n++)
+ if (unsigned int c = (unsigned int)g.IO.InputCharacters[n])
+ {
+ // Insert character if they pass filtering
+ if (!InputTextFilterCharacter(&c, flags, callback, user_data))
+ continue;
+ edit_state.OnKeyPressed((int)c);
+ }
}
// Consume characters
@@ -6639,18 +7258,40 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
const int k_mask = (is_shift_down ? STB_TEXTEDIT_K_SHIFT : 0);
const bool is_ctrl_only = is_ctrl_down && !is_alt_down && !is_shift_down;
- if (IsKeyPressedMap(ImGuiKey_LeftArrow)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_WORDLEFT | k_mask : STB_TEXTEDIT_K_LEFT | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_RightArrow)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_WORDRIGHT | k_mask : STB_TEXTEDIT_K_RIGHT | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Home)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_End)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Delete)) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Backspace)) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Enter)) { SetActiveId(0); enter_pressed = true; }
- else if (IsKeyPressedMap(ImGuiKey_Escape)) { SetActiveId(0); cancel_edit = true; }
- else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_Z)) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_UNDO); }
- else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_Y)) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_REDO); }
- else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_A)) { edit_state.SelectAll(); }
- else if (is_ctrl_only && (IsKeyPressedMap(ImGuiKey_X) || IsKeyPressedMap(ImGuiKey_C)))
+ if (IsKeyPressedMap(ImGuiKey_LeftArrow)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_WORDLEFT | k_mask : STB_TEXTEDIT_K_LEFT | k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_RightArrow)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_WORDRIGHT | k_mask : STB_TEXTEDIT_K_RIGHT | k_mask); }
+ else if (is_multiline && IsKeyPressedMap(ImGuiKey_UpArrow)) { if (is_ctrl_down) SetWindowScrollY(draw_window, draw_window->Scroll.y - g.FontSize); else edit_state.OnKeyPressed(STB_TEXTEDIT_K_UP | k_mask); }
+ else if (is_multiline && IsKeyPressedMap(ImGuiKey_DownArrow)) { if (is_ctrl_down) SetWindowScrollY(draw_window, draw_window->Scroll.y + g.FontSize); else edit_state.OnKeyPressed(STB_TEXTEDIT_K_DOWN| k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_Home)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_End)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_Delete) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_Backspace) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); }
+ else if (IsKeyPressedMap(ImGuiKey_Enter))
+ {
+ bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0;
+ if (!is_multiline || (ctrl_enter_for_new_line && !is_ctrl_down) || (!ctrl_enter_for_new_line && is_ctrl_down))
+ {
+ SetActiveID(0);
+ enter_pressed = true;
+ }
+ else if (is_editable) // New line
+ {
+ unsigned int c = '\n';
+ if (InputTextFilterCharacter(&c, flags, callback, user_data))
+ edit_state.OnKeyPressed((int)c);
+ }
+ }
+ else if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressedMap(ImGuiKey_Tab) && !is_ctrl_down && !is_shift_down && !is_alt_down && is_editable)
+ {
+ unsigned int c = '\t';
+ if (InputTextFilterCharacter(&c, flags, callback, user_data))
+ edit_state.OnKeyPressed((int)c);
+ }
+ else if (IsKeyPressedMap(ImGuiKey_Escape)) { SetActiveID(0); cancel_edit = true; }
+ else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_Z) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_UNDO); edit_state.ClearSelection(); }
+ else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_Y) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_REDO); edit_state.ClearSelection(); }
+ else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_A)) { edit_state.SelectAll(); edit_state.CursorFollow = true; }
+ else if (is_ctrl_only && ((IsKeyPressedMap(ImGuiKey_X) && is_editable) || IsKeyPressedMap(ImGuiKey_C)) && (!is_multiline || edit_state.HasSelection()))
{
// Cut, Copy
const bool cut = IsKeyPressedMap(ImGuiKey_X);
@@ -6660,15 +7301,19 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
if (g.IO.SetClipboardTextFn)
{
const int ib = edit_state.HasSelection() ? ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end) : 0;
- const int ie = edit_state.HasSelection() ? ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end) : (int)edit_state.CurLenW;
- ImTextStrToUtf8(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), edit_state.Text+ib, edit_state.Text+ie);
- g.IO.SetClipboardTextFn(g.TempBuffer);
+ const int ie = edit_state.HasSelection() ? ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end) : edit_state.CurLenW;
+ edit_state.TempTextBuffer.resize((ie-ib) * 4 + 1);
+ ImTextStrToUtf8(edit_state.TempTextBuffer.Data, edit_state.TempTextBuffer.Size, edit_state.Text.Data+ib, edit_state.Text.Data+ie);
+ g.IO.SetClipboardTextFn(edit_state.TempTextBuffer.Data);
}
if (cut)
+ {
+ edit_state.CursorFollow = true;
stb_textedit_cut(&edit_state, &edit_state.StbState);
+ }
}
- else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_V))
+ else if (is_ctrl_only && IsKeyPressedMap(ImGuiKey_V) && is_editable)
{
// Paste
if (g.IO.GetClipboardTextFn)
@@ -6676,7 +7321,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
if (const char* clipboard = g.IO.GetClipboardTextFn())
{
// Remove new-line from pasted buffer
- const size_t clipboard_len = strlen(clipboard);
+ const int clipboard_len = (int)strlen(clipboard);
ImWchar* clipboard_filtered = (ImWchar*)ImGui::MemAlloc((clipboard_len+1) * sizeof(ImWchar));
int clipboard_filtered_len = 0;
for (const char* s = clipboard; *s; )
@@ -6685,28 +7330,29 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
s += ImTextCharFromUtf8(&c, s, NULL);
if (c == 0)
break;
- if (c >= 0x10000)
- continue;
- if (!InputTextFilterCharacter(&c, flags, callback, user_data))
+ if (c >= 0x10000 || !InputTextFilterCharacter(&c, flags, callback, user_data))
continue;
clipboard_filtered[clipboard_filtered_len++] = (ImWchar)c;
}
clipboard_filtered[clipboard_filtered_len] = 0;
if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation
+ {
stb_textedit_paste(&edit_state, &edit_state.StbState, clipboard_filtered, clipboard_filtered_len);
+ edit_state.CursorFollow = true;
+ }
ImGui::MemFree(clipboard_filtered);
}
}
}
- edit_state.CursorAnim += g.IO.DeltaTime;
- edit_state.UpdateScrollOffset();
-
if (cancel_edit)
{
// Restore initial value
- ImFormatString(buf, buf_size, "%s", edit_state.InitialText);
- value_changed = true;
+ if (is_editable)
+ {
+ ImFormatString(buf, buf_size, "%s", edit_state.InitialText.Data);
+ value_changed = true;
+ }
}
else
{
@@ -6714,7 +7360,11 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
// Note that as soon as we can focus into the input box, the in-widget value gets priority over any underlying modification of the input buffer
// FIXME: We actually always render 'buf' in RenderTextScrolledClipped
// FIXME-OPT: CPU waste to do this every time the widget is active, should mark dirty state from the stb_textedit callbacks
- ImTextStrToUtf8(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), edit_state.Text, NULL);
+ if (is_editable)
+ {
+ edit_state.TempTextBuffer.resize(edit_state.Text.Size * 4);
+ ImTextStrToUtf8(edit_state.TempTextBuffer.Data, edit_state.TempTextBuffer.Size, edit_state.Text.Data, NULL);
+ }
// User callback
if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackAlways)) != 0)
@@ -6743,24 +7393,27 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
if (event_key != ImGuiKey_COUNT || (flags & ImGuiInputTextFlags_CallbackAlways) != 0)
{
ImGuiTextEditCallbackData callback_data;
- callback_data.EventFlag = event_flag;
+ callback_data.EventFlag = event_flag;
+ callback_data.Flags = flags;
+ callback_data.UserData = user_data;
+ callback_data.ReadOnly = !is_editable;
+
callback_data.EventKey = event_key;
- callback_data.Buf = g.TempBuffer;
+ callback_data.Buf = edit_state.TempTextBuffer.Data;
callback_data.BufSize = edit_state.BufSizeA;
callback_data.BufDirty = false;
- callback_data.Flags = flags;
- callback_data.UserData = user_data;
// We have to convert from position from wchar to UTF-8 positions
- const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(edit_state.Text, edit_state.Text + edit_state.StbState.cursor);
- const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(edit_state.Text, edit_state.Text + edit_state.StbState.select_start);
- const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(edit_state.Text, edit_state.Text + edit_state.StbState.select_end);
+ ImWchar* text = edit_state.Text.Data;
+ const int utf8_cursor_pos = callback_data.CursorPos = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.cursor);
+ const int utf8_selection_start = callback_data.SelectionStart = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.select_start);
+ const int utf8_selection_end = callback_data.SelectionEnd = ImTextCountUtf8BytesFromStr(text, text + edit_state.StbState.select_end);
// Call user code
callback(&callback_data);
// Read back what user may have modified
- IM_ASSERT(callback_data.Buf == g.TempBuffer); // Invalid to modify those fields
+ IM_ASSERT(callback_data.Buf == edit_state.TempTextBuffer.Data); // Invalid to modify those fields
IM_ASSERT(callback_data.BufSize == edit_state.BufSizeA);
IM_ASSERT(callback_data.Flags == flags);
if (callback_data.CursorPos != utf8_cursor_pos) edit_state.StbState.cursor = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.CursorPos);
@@ -6768,58 +7421,180 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
if (callback_data.SelectionEnd != utf8_selection_end) edit_state.StbState.select_end = ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd);
if (callback_data.BufDirty)
{
- edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), g.TempBuffer, NULL);
- edit_state.CurLenA = strlen(g.TempBuffer);
+ edit_state.CurLenW = ImTextStrFromUtf8(text, edit_state.Text.Size, edit_state.TempTextBuffer.Data, NULL);
+ edit_state.CurLenA = (int)strlen(edit_state.TempTextBuffer.Data);
edit_state.CursorAnimReset();
}
}
}
- if (strcmp(g.TempBuffer, buf) != 0)
+ if (is_editable && strcmp(edit_state.TempTextBuffer.Data, buf) != 0)
{
- ImFormatString(buf, buf_size, "%s", g.TempBuffer);
+ ImFormatString(buf, buf_size, "%s", edit_state.TempTextBuffer.Data);
value_changed = true;
}
}
}
-
- RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
- const ImVec2 font_off_up = ImVec2(0.0f, g.FontSize+1.0f); // FIXME: those offsets are part of the style or font API
- const ImVec2 font_off_dn = ImVec2(0.0f, 2.0f);
+ if (!is_multiline)
+ RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
- if (g.ActiveId == id)
+ ImVec2 render_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding;
+
+ ImVec4 clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + size.x + style.FramePadding.x*2.0f, frame_bb.Min.y + size.y + style.FramePadding.y*2.0f);
+ ImVec2 text_size(0.f, 0.f);
+ if (g.ActiveId == id || (edit_state.Id == id && is_multiline && g.ActiveId == draw_window->GetID("#SCROLLY")))
{
- // Draw selection
- const int select_begin_idx = edit_state.StbState.select_start;
- const int select_end_idx = edit_state.StbState.select_end;
- if (select_begin_idx != select_end_idx)
+ edit_state.CursorAnim += g.IO.DeltaTime;
+
+ // We need to:
+ // - Display the text (this can be more easily clipped)
+ // - Handle scrolling, highlight selection, display cursor (those all requires some form of 1d->2d cursor position calculation)
+ // - Measure text height (for scrollbar)
+ // We are attempting to do most of that in **one main pass** to minimize the computation cost (non-negligible for large amount of text) + 2nd pass for selection rendering (we could merge them by an extra refactoring effort)
+ const ImWchar* text_begin = edit_state.Text.Data;
+ const ImWchar* text_end = text_begin + edit_state.CurLenW;
+ ImVec2 cursor_offset, select_start_offset;
+
+ {
+ // Count lines + find lines numbers of cursor and select_start
+ int matches_remaining = 0;
+ int matches_line_no[2] = { -1, -999 };
+ const ImWchar* matches_ptr[2] = { NULL, NULL };
+ matches_ptr[0] = text_begin + edit_state.StbState.cursor; matches_remaining++;
+ if (edit_state.StbState.select_start != edit_state.StbState.select_end)
+ {
+ matches_ptr[1] = text_begin + ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end);
+ matches_line_no[1] = -1;
+ matches_remaining++;
+ }
+ matches_remaining += is_multiline ? 1 : 0; // So that we never exit the loop until all lines are counted.
+
+ int line_count = 0;
+ for (const ImWchar* s = text_begin; s < text_end+1; s++)
+ if ((*s) == '\n' || s == text_end)
+ {
+ line_count++;
+ if (matches_line_no[0] == -1 && s >= matches_ptr[0]) { matches_line_no[0] = line_count; if (--matches_remaining <= 0) break; }
+ if (matches_line_no[1] == -1 && s >= matches_ptr[1]) { matches_line_no[1] = line_count; if (--matches_remaining <= 0) break; }
+ }
+
+ // Calculate 2d position
+ IM_ASSERT(matches_line_no[0] != -1);
+ cursor_offset.x = InputTextCalcTextSizeW(ImStrbolW(matches_ptr[0], text_begin), matches_ptr[0]).x;
+ cursor_offset.y = matches_line_no[0] * g.FontSize;
+ if (matches_line_no[1] >= 0)
+ {
+ select_start_offset.x = InputTextCalcTextSizeW(ImStrbolW(matches_ptr[1], text_begin), matches_ptr[1]).x;
+ select_start_offset.y = matches_line_no[1] * g.FontSize;
+ }
+
+ // Calculate text height
+ if (is_multiline)
+ text_size = ImVec2(size.x, line_count * g.FontSize);
+ }
+
+ // Scroll
+ if (edit_state.CursorFollow)
{
- const ImVec2 select_begin_pos = frame_bb.Min + style.FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(ImMin(select_begin_idx,select_end_idx));
- const ImVec2 select_end_pos = frame_bb.Min + style.FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(ImMax(select_begin_idx,select_end_idx));
- window->DrawList->AddRectFilled(select_begin_pos - font_off_up, select_end_pos + font_off_dn, window->Color(ImGuiCol_TextSelectedBg));
+ // Horizontal scroll in chunks of quarter width
+ if (!(flags & ImGuiInputTextFlags_NoHorizontalScroll))
+ {
+ const float scroll_increment_x = size.x * 0.25f;
+ if (cursor_offset.x < edit_state.ScrollX)
+ edit_state.ScrollX = (float)(int)ImMax(0.0f, cursor_offset.x - scroll_increment_x);
+ else if (cursor_offset.x - size.x >= edit_state.ScrollX)
+ edit_state.ScrollX = (float)(int)(cursor_offset.x - size.x + scroll_increment_x);
+ }
+ else
+ {
+ edit_state.ScrollX = 0.0f;
+ }
+
+ // Vertical scroll
+ if (is_multiline)
+ {
+ float scroll_y = draw_window->Scroll.y;
+ if (cursor_offset.y - g.FontSize < scroll_y)
+ scroll_y = ImMax(0.0f, cursor_offset.y - g.FontSize);
+ else if (cursor_offset.y - size.y >= scroll_y)
+ scroll_y = cursor_offset.y - size.y;
+ draw_window->DC.CursorPos.y += (draw_window->Scroll.y - scroll_y); // To avoid a frame of lag
+ draw_window->Scroll.y = scroll_y;
+ render_pos.y = draw_window->DC.CursorPos.y;
+ }
}
- }
+ edit_state.CursorFollow = false;
+ ImVec2 render_scroll = ImVec2(edit_state.ScrollX, 0.0f);
- //const float render_scroll_x = (g.ActiveId == id) ? edit_state.ScrollX : 0.0f;
- const float render_scroll_x = (edit_state.Id == id) ? edit_state.ScrollX : 0.0f;
- ImGuiTextEditState::RenderTextScrolledClipped(g.Font, g.FontSize, buf, frame_bb.Min + style.FramePadding, w + style.FramePadding.x, render_scroll_x);
+ // Draw selection
+ if (edit_state.StbState.select_start != edit_state.StbState.select_end)
+ {
+ const ImWchar* text_selected_begin = text_begin + ImMin(edit_state.StbState.select_start, edit_state.StbState.select_end);
+ const ImWchar* text_selected_end = text_begin + ImMax(edit_state.StbState.select_start, edit_state.StbState.select_end);
- if (g.ActiveId == id)
- {
- const ImVec2 cursor_pos = frame_bb.Min + style.FramePadding + edit_state.CalcDisplayOffsetFromCharIdx(edit_state.StbState.cursor);
+ float bg_offy_up = is_multiline ? 0.0f : -1.0f; // FIXME: those offsets should be part of the style? they don't play so well with multi-line selection.
+ float bg_offy_dn = is_multiline ? 0.0f : 2.0f;
+ ImU32 bg_color = draw_window->Color(ImGuiCol_TextSelectedBg);
+ ImVec2 rect_pos = render_pos + select_start_offset - render_scroll;
+ for (const ImWchar* p = text_selected_begin; p < text_selected_end; )
+ {
+ if (rect_pos.y > clip_rect.w + g.FontSize)
+ break;
+ if (rect_pos.y < clip_rect.y)
+ {
+ while (p < text_selected_end)
+ if (*p++ == '\n')
+ break;
+ }
+ else
+ {
+ ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true);
+ if (rect_size.x <= 0.0f) rect_size.x = (float)(int)(g.Font->GetCharAdvance((unsigned short)' ') * 0.50f); // So we can see selected empty lines
+ ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos +ImVec2(rect_size.x, bg_offy_dn));
+ rect.Clip(clip_rect);
+ if (rect.Overlaps(clip_rect))
+ draw_window->DrawList->AddRectFilled(rect.Min, rect.Max, bg_color);
+ }
+ rect_pos.x = render_pos.x - render_scroll.x;
+ rect_pos.y += g.FontSize;
+ }
+ }
+
+ draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos - render_scroll, draw_window->Color(ImGuiCol_Text), buf, buf+edit_state.CurLenA, 0.0f, is_multiline ? NULL : &clip_rect);
// Draw blinking cursor
- if (g.InputTextState.CursorIsVisible())
- window->DrawList->AddRect(cursor_pos - font_off_up + ImVec2(0,2), cursor_pos + font_off_dn - ImVec2(0,3), window->Color(ImGuiCol_Text));
-
+ ImVec2 cursor_screen_pos = render_pos + cursor_offset - render_scroll;
+ bool cursor_is_visible = (g.InputTextState.CursorAnim <= 0.0f) || fmodf(g.InputTextState.CursorAnim, 1.20f) <= 0.80f;
+ if (cursor_is_visible)
+ draw_window->DrawList->AddLine(cursor_screen_pos + ImVec2(0.0f,-g.FontSize+0.5f), cursor_screen_pos + ImVec2(0.0f,-1.5f), window->Color(ImGuiCol_Text));
+
// Notify OS of text input position for advanced IME
- if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.InputCursorScreenPos - cursor_pos) > 0.0001f)
- io.ImeSetInputScreenPosFn((int)cursor_pos.x - 1, (int)(cursor_pos.y - g.FontSize)); // -1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.
+ if (is_editable && io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.InputCursorScreenPos - cursor_screen_pos) > 0.0001f)
+ io.ImeSetInputScreenPosFn((int)cursor_screen_pos.x - 1, (int)(cursor_screen_pos.y - g.FontSize)); // -1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.
+
+ edit_state.InputCursorScreenPos = cursor_screen_pos;
+ }
+ else
+ {
+ // Render text only
+ const char* buf_end = NULL;
+ if (is_multiline)
+ text_size = ImVec2(size.x, InputTextCalcTextLenAndLineCount(buf, &buf_end) * g.FontSize); // We don't need width
+ draw_window->DrawList->AddText(g.Font, g.FontSize, render_pos, draw_window->Color(ImGuiCol_Text), buf, buf_end, 0.0f, is_multiline ? NULL : &clip_rect);
+ }
- edit_state.InputCursorScreenPos = cursor_pos;
+ if (is_multiline)
+ {
+ ImGui::Dummy(text_size + ImVec2(0.0f, g.FontSize)); // Always add room to scroll an extra line
+ ImGui::EndChildFrame();
+ ImGui::EndGroup();
}
+ // Log as text
+ if (g.LogEnabled)
+ LogRenderedText(render_pos, buf, NULL);
+
if (label_size.x > 0)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
@@ -6829,13 +7604,105 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
return value_changed;
}
-static bool InputFloatN(const char* label, float* v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags)
+bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
+{
+ IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline()
+ bool ret = InputTextEx(label, buf, (int)buf_size, ImVec2(0,0), flags, callback, user_data);
+ return ret;
+}
+
+bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
{
+ bool ret = InputTextEx(label, buf, (int)buf_size, size, flags | ImGuiInputTextFlags_Multiline, callback, user_data);
+ return ret;
+}
+
+// NB: scalar_format here must be a simple "%xx" format string with no prefix/suffix (unlike the Drag/Slider functions "display_format" argument)
+bool ImGui::InputScalarEx(const char* label, ImGuiDataType data_type, void* data_ptr, void* step_ptr, void* step_fast_ptr, const char* scalar_format, ImGuiInputTextFlags extra_flags)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
ImGuiState& g = *GImGui;
+ const ImGuiStyle& style = g.Style;
+ const float w = CalcItemWidth();
+ const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
+
+ ImGui::BeginGroup();
+ ImGui::PushID(label);
+ const ImVec2 button_sz = ImVec2(g.FontSize, g.FontSize) + style.FramePadding * 2;
+ if (step_ptr)
+ ImGui::PushItemWidth(ImMax(1.0f, w - (button_sz.x + style.ItemInnerSpacing.x)*2));
+
+ char buf[64];
+ DataTypeFormatString(data_type, data_ptr, scalar_format, buf, IM_ARRAYSIZE(buf));
+
+ bool value_changed = false;
+ if (!(extra_flags & ImGuiInputTextFlags_CharsHexadecimal))
+ extra_flags |= ImGuiInputTextFlags_CharsDecimal;
+ extra_flags |= ImGuiInputTextFlags_AutoSelectAll;
+ if (ImGui::InputText("", buf, IM_ARRAYSIZE(buf), extra_flags))
+ {
+ DataTypeApplyOpFromText(buf, GImGui->InputTextState.InitialText.begin(), data_type, data_ptr, scalar_format);
+ value_changed = true;
+ }
+
+ // Step buttons
+ if (step_ptr)
+ {
+ ImGui::PopItemWidth();
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
+ if (ButtonEx("-", button_sz, ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
+ {
+ DataTypeApplyOp(data_type, '-', data_ptr, g.IO.KeyCtrl && step_fast_ptr ? step_fast_ptr : step_ptr);
+ value_changed = true;
+ }
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
+ if (ButtonEx("+", button_sz, ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
+ {
+ DataTypeApplyOp(data_type, '+', data_ptr, g.IO.KeyCtrl && step_fast_ptr ? step_fast_ptr : step_ptr);
+ value_changed = true;
+ }
+ }
+ ImGui::PopID();
+
+ if (label_size.x > 0)
+ {
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
+ RenderText(ImVec2(window->DC.CursorPos.x, window->DC.CursorPos.y + style.FramePadding.y), label);
+ ItemSize(label_size, style.FramePadding.y);
+ }
+ ImGui::EndGroup();
+
+ return value_changed;
+}
+
+bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags)
+{
+ char display_format[16];
+ if (decimal_precision < 0)
+ strcpy(display_format, "%f"); // Ideally we'd have a minimum decimal precision of 1 to visually denote that this is a float, while hiding non-significant digits? %f doesn't have a minimum of 1
+ else
+ ImFormatString(display_format, 16, "%%.%df", decimal_precision);
+ return InputScalarEx(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), display_format, extra_flags);
+}
+
+bool ImGui::InputInt(const char* label, int* v, int step, int step_fast, ImGuiInputTextFlags extra_flags)
+{
+ // Hexadecimal input provided as a convenience but the flag name is awkward. Typically you'd use InputText() to parse your own data, if you want to handle prefixes.
+ const char* scalar_format = (extra_flags & ImGuiInputTextFlags_CharsHexadecimal) ? "%08X" : "%d";
+ return InputScalarEx(label, ImGuiDataType_Int, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), scalar_format, extra_flags);
+}
+
+bool ImGui::InputFloatN(const char* label, float* v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags)
+{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -6844,7 +7711,7 @@ static bool InputFloatN(const char* label, float* v, int components, int decimal
{
ImGui::PushID(i);
value_changed |= ImGui::InputFloat("##v", &v[i], 0, 0, decimal_precision, extra_flags);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -6872,13 +7739,13 @@ bool ImGui::InputFloat4(const char* label, float v[4], int decimal_precision, Im
return InputFloatN(label, v, 4, decimal_precision, extra_flags);
}
-static bool InputIntN(const char* label, int* v, int components, ImGuiInputTextFlags extra_flags)
+bool ImGui::InputIntN(const char* label, int* v, int components, ImGuiInputTextFlags extra_flags)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
bool value_changed = false;
ImGui::BeginGroup();
ImGui::PushID(label);
@@ -6887,7 +7754,7 @@ static bool InputIntN(const char* label, int* v, int components, ImGuiInputTextF
{
ImGui::PushID(i);
value_changed |= ImGui::InputInt("##v", &v[i], 0, 0, extra_flags);
- ImGui::SameLine(0, (int)g.Style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, g.Style.ItemInnerSpacing.x);
ImGui::PopID();
ImGui::PopItemWidth();
}
@@ -6954,7 +7821,7 @@ bool ImGui::Combo(const char* label, int* current_item, const char** items, int
bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items)
{
int items_count = 0;
- const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this
+ const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this, or at least only when combo is open
while (*p)
{
p += strlen(p) + 1;
@@ -6967,18 +7834,18 @@ bool ImGui::Combo(const char* label, int* current_item, const char* items_separa
// Combo box function.
bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = ImGui::CalcItemWidth();
+ const float w = CalcItemWidth();
const ImVec2 label_size = CalcTextSize(label, NULL, true);
const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
- const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(style.ItemInnerSpacing.x + label_size.x,0));
+ const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, &id))
return false;
@@ -6986,141 +7853,166 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
const float arrow_size = (g.FontSize + style.FramePadding.x * 2.0f);
const bool hovered = IsHovered(frame_bb, id);
- bool value_changed = false;
const ImRect value_bb(frame_bb.Min, frame_bb.Max - ImVec2(arrow_size, 0.0f));
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
- 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
+ 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
RenderCollapseTriangle(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y) + style.FramePadding, true);
if (*current_item >= 0 && *current_item < items_count)
{
const char* item_text;
if (items_getter(data, *current_item, &item_text))
- RenderTextClipped(frame_bb.Min + style.FramePadding, item_text, NULL, NULL, value_bb.Max);
+ RenderTextClipped(frame_bb.Min + style.FramePadding, value_bb.Max, item_text, NULL, NULL);
}
if (label_size.x > 0)
RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
-
- ImGui::PushID((int)id);
+
bool menu_toggled = false;
if (hovered)
{
- g.HoveredId = id;
+ SetHoveredID(id);
if (g.IO.MouseClicked[0])
{
- menu_toggled = true;
- g.ActiveComboID = (g.ActiveComboID == id) ? 0 : id;
- if (g.ActiveComboID)
+ SetActiveID(0);
+ if (IsPopupOpen(id))
+ {
+ ClosePopup(id);
+ }
+ else
+ {
FocusWindow(window);
+ ImGui::OpenPopup(label);
+ menu_toggled = true;
+ }
}
}
-
- if (g.ActiveComboID == id)
+
+ bool value_changed = false;
+ if (IsPopupOpen(id))
{
// Size default to hold ~7 items
if (height_in_items < 0)
height_in_items = 7;
- const ImVec2 backup_pos = ImGui::GetCursorPos();
- const float popup_off_x = 0.0f;//style.ItemInnerSpacing.x;
- const float popup_height = (label_size.y + style.ItemSpacing.y) * ImMin(items_count, height_in_items) + (style.FramePadding.y * 3);
- const ImRect popup_rect(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));
- ImGui::SetCursorPos(popup_rect.Min - window->Pos);
-
- const ImGuiWindowFlags flags = ImGuiWindowFlags_ComboBox | ((window->Flags & ImGuiWindowFlags_ShowBorders) ? ImGuiWindowFlags_ShowBorders : 0);
+ float popup_height = (label_size.y + style.ItemSpacing.y) * ImMin(items_count, height_in_items) + (style.FramePadding.y * 3);
+ ImRect popup_rect(ImVec2(frame_bb.Min.x, frame_bb.Max.y), ImVec2(frame_bb.Max.x, frame_bb.Max.y + popup_height));
+ popup_rect.Max.y = ImMin(popup_rect.Max.y, g.IO.DisplaySize.y - style.DisplaySafeAreaPadding.y); // Adhoc height limit for Combo. Ideally should be handled in Begin() along with other popups size, we want to have the possibility of moving the popup above as well.
+ ImGui::SetNextWindowPos(popup_rect.Min);
+ ImGui::SetNextWindowSize(popup_rect.GetSize());
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, style.FramePadding);
- ImGui::BeginChild("#ComboBox", popup_rect.GetSize(), false, flags);
- ImGui::Spacing();
-
- bool combo_item_active = false;
- combo_item_active |= (g.ActiveId == GetCurrentWindow()->GetID("#SCROLLY"));
- // Display items
- for (int i = 0; i < items_count; i++)
+ const ImGuiWindowFlags flags = ImGuiWindowFlags_ComboBox | ((window->Flags & ImGuiWindowFlags_ShowBorders) ? ImGuiWindowFlags_ShowBorders : 0);
+ if (BeginPopupEx(label, flags))
{
- ImGui::PushID((void*)(intptr_t)i);
- const bool item_selected = (i == *current_item);
- const char* item_text;
- if (!items_getter(data, i, &item_text))
- item_text = "*Unknown item*";
- if (ImGui::Selectable(item_text, item_selected))
+ // Display items
+ ImGui::Spacing();
+ for (int i = 0; i < items_count; i++)
{
- SetActiveId(0);
- g.ActiveComboID = 0;
- value_changed = true;
- *current_item = i;
+ ImGui::PushID((void*)(intptr_t)i);
+ const bool item_selected = (i == *current_item);
+ const char* item_text;
+ if (!items_getter(data, i, &item_text))
+ item_text = "*Unknown item*";
+ if (ImGui::Selectable(item_text, item_selected))
+ {
+ SetActiveID(0);
+ value_changed = true;
+ *current_item = i;
+ }
+ if (item_selected && menu_toggled)
+ ImGui::SetScrollHere();
+ ImGui::PopID();
}
- if (item_selected && menu_toggled)
- ImGui::SetScrollPosHere();
- combo_item_active |= ImGui::IsItemActive();
- ImGui::PopID();
+ ImGui::EndPopup();
}
- ImGui::EndChild();
ImGui::PopStyleVar();
- ImGui::SetCursorPos(backup_pos);
-
- if (!combo_item_active && g.ActiveId != 0)
- g.ActiveComboID = 0;
}
-
- ImGui::PopID();
-
return value_changed;
}
// Tip: pass an empty label (e.g. "##dummy") then you can use the space to draw other text or image.
// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID.
-bool ImGui::Selectable(const char* label, bool selected, const ImVec2& size_arg)
+bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const ImGuiID id = window->GetID(label);
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
-
- const float w = ImMax(label_size.x, window->Pos.x + ImGui::GetContentRegionMax().x - style.WindowPadding.x - window->DC.CursorPos.x);
- const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : w, size_arg.y != 0.0f ? size_arg.y : label_size.y);
- ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
+
+ if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
+ PopClipRect();
+
+ ImGuiID id = window->GetID(label);
+ ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+ ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y);
+ ImVec2 pos = window->DC.CursorPos;
+ pos.y += window->DC.CurrentLineTextBaseOffset;
+ ImRect bb(pos, pos + size);
ItemSize(bb);
- if (size_arg.x == 0.0f)
- bb.Max.x += style.WindowPadding.x;
-
- // Selectables are meant to be tightly packed together. So for both rendering and collision we extend to compensate for spacing.
- ImRect bb_with_spacing = bb;
- const float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f);
- const float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f);
- const float spacing_R = style.ItemSpacing.x - spacing_L;
- const float spacing_D = style.ItemSpacing.y - spacing_U;
+
+ // Fill horizontal space.
+ ImVec2 window_padding = window->WindowPadding;
+ float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? ImGui::GetWindowContentRegionMax().x : ImGui::GetContentRegionMax().x;
+ float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - window->DC.CursorPos.x);
+ ImVec2 size_draw((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size_arg.y != 0.0f ? size_arg.y : size.y);
+ ImRect bb_with_spacing(pos, pos + size_draw);
+ if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth))
+ bb_with_spacing.Max.x += window_padding.x;
+
+ // Selectables are tightly packed together, we extend the box to cover spacing between selectable.
+ float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f);
+ float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f);
+ float spacing_R = style.ItemSpacing.x - spacing_L;
+ float spacing_D = style.ItemSpacing.y - spacing_U;
bb_with_spacing.Min.x -= spacing_L;
bb_with_spacing.Min.y -= spacing_U;
bb_with_spacing.Max.x += spacing_R;
bb_with_spacing.Max.y += spacing_D;
if (!ItemAdd(bb_with_spacing, &id))
+ {
+ if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
+ PushColumnClipRect();
return false;
+ }
+ ImGuiButtonFlags button_flags = 0;
+ if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick;
+ if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnClick|ImGuiButtonFlags_PressedOnRelease;
+ if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled;
bool hovered, held;
- bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, true);
+ bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, true, button_flags);
+ if (flags & ImGuiSelectableFlags_Disabled)
+ selected = false;
// Render
if (hovered || selected)
{
const ImU32 col = window->Color((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
- RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, style.FrameRounding);
+ RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, 0.0f);
+ }
+
+ if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
+ {
+ PushColumnClipRect();
+ bb_with_spacing.Max.x -= (ImGui::GetContentRegionMax().x - max_x);
}
- //const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);
- RenderTextClipped(bb.Min, label, NULL, &label_size, bb_with_spacing.Max);
+ if (flags & ImGuiSelectableFlags_Disabled) ImGui::PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
+ RenderTextClipped(bb.Min, bb_with_spacing.Max, label, NULL, &label_size);
+ if (flags & ImGuiSelectableFlags_Disabled) ImGui::PopStyleColor();
+ // Automatically close popups
+ if (pressed && !(flags & ImGuiSelectableFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
+ ImGui::CloseCurrentPopup();
return pressed;
}
-bool ImGui::Selectable(const char* label, bool* p_selected, const ImVec2& size_arg)
+bool ImGui::Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
{
- if (ImGui::Selectable(label, *p_selected, size_arg))
+ if (ImGui::Selectable(label, *p_selected, flags, size_arg))
{
*p_selected = !*p_selected;
return true;
@@ -7133,18 +8025,18 @@ bool ImGui::Selectable(const char* label, bool* p_selected, const ImVec2& size_a
bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg)
{
ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
const ImGuiStyle& style = ImGui::GetStyle();
const ImGuiID id = ImGui::GetID(label);
const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
// Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
- ImVec2 size;
- size.x = (size_arg.x != 0.0f) ? (size_arg.x) : ImGui::CalcItemWidth() + style.FramePadding.x * 2.0f;
- size.y = (size_arg.y != 0.0f) ? (size_arg.y) : ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y;
- const ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
- const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
- const ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
+ ImVec2 size = CalcItemSize(size_arg, CalcItemWidth() + style.FramePadding.x * 2.0f, ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y);
+ ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
+ ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
+ ImRect bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));
window->DC.LastItemRect = bb;
ImGui::BeginGroup();
@@ -7176,7 +8068,7 @@ void ImGui::ListBoxFooter()
ImGuiWindow* parent_window = GetParentWindow();
const ImRect bb = parent_window->DC.LastItemRect;
const ImGuiStyle& style = ImGui::GetStyle();
-
+
ImGui::EndChildFrame();
// Redeclare item size so that it includes the label (we have stored the full size in LastItemRect)
@@ -7195,15 +8087,13 @@ bool ImGui::ListBox(const char* label, int* current_item, const char** items, in
bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
{
- ImGuiWindow* window = GetCurrentWindow();
- if (window->SkipItems)
- return false;
-
if (!ImGui::ListBoxHeader(label, items_count, height_in_items))
return false;
+ // Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper.
bool value_changed = false;
- for (int i = 0; i < items_count; i++)
+ ImGuiListClipper clipper(items_count, ImGui::GetTextLineHeightWithSpacing());
+ for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
{
const bool item_selected = (i == *current_item);
const char* item_text;
@@ -7218,38 +8108,41 @@ bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(v
}
ImGui::PopID();
}
-
+ clipper.End();
ImGui::ListBoxFooter();
return value_changed;
}
-bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected)
+bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, bool enabled)
{
- (void)shortcut; // FIXME-MENU: Shortcut are not supported yet. Argument is reserved.
-
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
- ImVec2 pos = ImGui::GetCursorScreenPos();
- const ImVec2 label_size = CalcTextSize(label, NULL, true);
- const float symbol_spacing = (float)(int)(g.FontSize * 1.50f + 0.5f);
- const float w = ImMax(label_size.x + symbol_spacing, window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x); // Feedback to next frame
- bool ret = ImGui::Selectable(label, false, ImVec2(w, 0.0f));
+ ImGuiState& g = *GImGui;
+ ImVec2 pos = window->DC.CursorPos;
+ ImVec2 label_size = CalcTextSize(label, NULL, true);
+ ImVec2 shortcut_size = shortcut ? CalcTextSize(shortcut, NULL) : ImVec2(0.0f, 0.0f);
+ float w = window->MenuColumns.DeclColumns(label_size.x, shortcut_size.x, (float)(int)(g.FontSize * 1.20f)); // Feedback for next frame
+ float extra_w = ImMax(0.0f, ImGui::GetContentRegionAvail().x - w);
- if (selected)
+ bool pressed = ImGui::Selectable(label, false, ImGuiSelectableFlags_MenuItem | ImGuiSelectableFlags_DrawFillAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
+ if (shortcut_size.x > 0.0f)
{
- pos.x = window->Pos.x + ImGui::GetContentRegionMax().x - g.FontSize;
- RenderCheckMark(pos, window->Color(ImGuiCol_Text));
+ ImGui::PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
+ RenderText(pos + ImVec2(window->MenuColumns.Pos[1] + extra_w, 0.0f), shortcut, NULL, false);
+ ImGui::PopStyleColor();
}
- return ret;
+ if (selected)
+ RenderCheckMark(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.20f, 0.0f), window->Color(ImGuiCol_Text));
+
+ return pressed;
}
-bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected)
+bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled)
{
- if (ImGui::MenuItem(label, shortcut, p_selected ? *p_selected : false))
+ if (ImGui::MenuItem(label, shortcut, p_selected ? *p_selected : false, enabled))
{
if (p_selected)
*p_selected = !*p_selected;
@@ -7258,18 +8151,188 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool* p_selected)
return false;
}
+bool ImGui::BeginMainMenuBar()
+{
+ ImGuiState& g = *GImGui;
+ ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f));
+ ImGui::SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.FontBaseSize + g.Style.FramePadding.y * 2.0f));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0,0));
+ if (!ImGui::Begin("##MainMenuBar", NULL, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_MenuBar)
+ || !ImGui::BeginMenuBar())
+ {
+ ImGui::End();
+ ImGui::PopStyleVar(2);
+ return false;
+ }
+ g.CurrentWindow->DC.MenuBarOffsetX += g.Style.DisplaySafeAreaPadding.x;
+ return true;
+}
+
+void ImGui::EndMainMenuBar()
+{
+ ImGui::EndMenuBar();
+ ImGui::End();
+ ImGui::PopStyleVar(2);
+}
+
+bool ImGui::BeginMenuBar()
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+ if (!(window->Flags & ImGuiWindowFlags_MenuBar))
+ return false;
+
+ IM_ASSERT(!window->DC.MenuBarAppending);
+ ImGui::BeginGroup(); // Save position
+ ImGui::PushID("##menubar");
+ ImRect rect = window->MenuBarRect();
+ PushClipRect(ImVec4(rect.Min.x+0.5f, rect.Min.y-0.5f, rect.Max.x+0.5f, rect.Max.y-1.5f), false);
+ window->DC.CursorPos = ImVec2(rect.Min.x + window->DC.MenuBarOffsetX, rect.Min.y);// + g.Style.FramePadding.y);
+ window->DC.LayoutType = ImGuiLayoutType_Horizontal;
+ window->DC.MenuBarAppending = true;
+ ImGui::AlignFirstTextHeightToWidgets();
+ return true;
+}
+
+void ImGui::EndMenuBar()
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return;
+
+ IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar);
+ IM_ASSERT(window->DC.MenuBarAppending);
+ PopClipRect();
+ ImGui::PopID();
+ window->DC.MenuBarOffsetX = window->DC.CursorPos.x - window->MenuBarRect().Min.x;
+ window->DC.GroupStack.back().AdvanceCursor = false;
+ ImGui::EndGroup();
+ window->DC.LayoutType = ImGuiLayoutType_Vertical;
+ window->DC.MenuBarAppending = false;
+}
+
+bool ImGui::BeginMenu(const char* label, bool enabled)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ ImGuiState& g = *GImGui;
+ const ImGuiStyle& style = g.Style;
+ const ImGuiID id = window->GetID(label);
+
+ ImVec2 label_size = CalcTextSize(label, NULL, true);
+ ImGuiWindow* backed_focused_window = g.FocusedWindow;
+
+ bool pressed;
+ bool opened = IsPopupOpen(id);
+ bool menuset_opened = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenedPopupStack.Size > g.CurrentPopupStack.Size && g.OpenedPopupStack[g.CurrentPopupStack.Size].ParentMenuSet == window->GetID("##menus"));
+ if (menuset_opened)
+ g.FocusedWindow = window;
+
+ ImVec2 popup_pos, pos = window->DC.CursorPos;
+ if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
+ {
+ popup_pos = ImVec2(pos.x - window->WindowPadding.x, pos.y - style.FramePadding.y + window->MenuBarHeight());
+ window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, style.ItemSpacing * 2.0f);
+ float w = label_size.x;
+ pressed = ImGui::Selectable(label, opened, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
+ ImGui::PopStyleVar();
+ ImGui::SameLine();
+ window->DC.CursorPos.x += (float)(int)(style.ItemSpacing.x * 0.5f);
+ }
+ else
+ {
+ popup_pos = ImVec2(pos.x, pos.y - style.WindowPadding.y);
+ float w = window->MenuColumns.DeclColumns(label_size.x, 0.0f, (float)(int)(g.FontSize * 1.20f)); // Feedback to next frame
+ float extra_w = ImMax(0.0f, ImGui::GetContentRegionAvail().x - w);
+ pressed = ImGui::Selectable(label, opened, ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | (!enabled ? ImGuiSelectableFlags_Disabled : 0), ImVec2(w, 0.0f));
+ if (!enabled) ImGui::PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
+ RenderCollapseTriangle(pos + ImVec2(window->MenuColumns.Pos[2] + extra_w + g.FontSize * 0.20f, 0.0f), false);
+ if (!enabled) ImGui::PopStyleColor();
+ }
+
+ bool hovered = enabled && IsHovered(window->DC.LastItemRect, id);
+ if (menuset_opened)
+ g.FocusedWindow = backed_focused_window;
+
+ bool want_open = false, want_close = false;
+ if (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu))
+ {
+ // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers so menus feel more reactive.
+ bool moving_within_opened_triangle = false;
+ if (g.HoveredWindow == window && g.OpenedPopupStack.Size > g.CurrentPopupStack.Size && g.OpenedPopupStack[g.CurrentPopupStack.Size].ParentWindow == window)
+ {
+ if (ImGuiWindow* next_window = g.OpenedPopupStack[g.CurrentPopupStack.Size].Window)
+ {
+ ImRect next_window_rect = next_window->Rect();
+ ImVec2 ta = g.IO.MousePos - g.IO.MouseDelta;
+ ImVec2 tb = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR();
+ ImVec2 tc = (window->Pos.x < next_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR();
+ float extra = ImClamp(fabsf(ta.x - tb.x) * 0.30f, 5.0f, 30.0f); // add a bit of extra slack.
+ ta.x += (window->Pos.x < next_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues
+ tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -100.0f); // triangle is maximum 200 high to limit the slope and the bias toward large sub-menus
+ tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +100.0f);
+ moving_within_opened_triangle = ImIsPointInTriangle(g.IO.MousePos, ta, tb, tc);
+ //window->DrawList->PushClipRectFullScreen(); window->DrawList->AddTriangleFilled(ta, tb, tc, moving_within_opened_triangle ? 0x80008000 : 0x80000080); window->DrawList->PopClipRect(); // Debug
+ }
+ }
+
+ want_close = (opened && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_within_opened_triangle);
+ want_open = (!opened && hovered && !moving_within_opened_triangle) || (!opened && hovered && pressed);
+ }
+ else if (opened && pressed && menuset_opened) // menu-bar: click open menu to close
+ {
+ want_close = true;
+ want_open = opened = false;
+ }
+ else if (pressed || (hovered && menuset_opened && !opened)) // menu-bar: first click to open, then hover to open others
+ want_open = true;
+
+ if (want_close && IsPopupOpen(id))
+ ClosePopupToLevel(GImGui->CurrentPopupStack.Size);
+
+ if (!opened && want_open && g.OpenedPopupStack.Size > g.CurrentPopupStack.Size)
+ {
+ // Don't recycle same menu level in the same frame, first close the other menu and yield for a frame.
+ ImGui::OpenPopup(label);
+ return false;
+ }
+
+ opened |= want_open;
+ if (want_open)
+ ImGui::OpenPopup(label);
+
+ if (opened)
+ {
+ ImGui::SetNextWindowPos(popup_pos, ImGuiSetCond_Always);
+ ImGuiWindowFlags flags = ImGuiWindowFlags_ShowBorders | ((window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) ? ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_ChildWindow : ImGuiWindowFlags_ChildMenu);
+ opened = BeginPopupEx(label, flags); // opened can be 'false' when the popup is completely clipped (e.g. zero size display)
+ }
+
+ return opened;
+}
+
+void ImGui::EndMenu()
+{
+ ImGui::EndPopup();
+}
+
// A little colored square. Return true when clicked.
bool ImGui::ColorButton(const ImVec4& col, bool small_height, bool outline_border)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID("#colorbutton");
const float square_size = g.FontSize;
- const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(square_size + style.FramePadding.x*2, square_size + (small_height ? 0 : style.FramePadding.y*2)));
+ const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(square_size + style.FramePadding.y*2, square_size + (small_height ? 0 : style.FramePadding.y*2)));
ItemSize(bb, small_height ? 0.0f : style.FramePadding.y);
if (!ItemAdd(bb, &id))
return false;
@@ -7308,15 +8371,15 @@ bool ImGui::ColorEdit3(const char* label, float col[3])
// Use CTRL-Click to input value and TAB to go to next item.
bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w_full = ImGui::CalcItemWidth();
- const float square_sz = (g.FontSize + style.FramePadding.x * 2.0f);
+ const float w_full = CalcItemWidth();
+ const float square_sz = (g.FontSize + style.FramePadding.y * 2.0f);
ImGuiColorEditMode edit_mode = window->DC.ColorEditMode;
if (edit_mode == ImGuiColorEditMode_UserSelect || edit_mode == ImGuiColorEditMode_UserSelectShowButton)
@@ -7348,19 +8411,19 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
const bool hide_prefix = (w_item_one <= CalcTextSize("M:999").x);
const char* ids[4] = { "##X", "##Y", "##Z", "##W" };
- const char* fmt_table[3][4] =
+ const char* fmt_table[3][4] =
{
- { "%3.0f", "%3.0f", "%3.0f", "%3.0f" },
+ { "%3.0f", "%3.0f", "%3.0f", "%3.0f" },
{ "R:%3.0f", "G:%3.0f", "B:%3.0f", "A:%3.0f" },
- { "H:%3.0f", "S:%3.0f", "V:%3.0f", "A:%3.0f" }
+ { "H:%3.0f", "S:%3.0f", "V:%3.0f", "A:%3.0f" }
};
- const char** fmt = hide_prefix ? fmt_table[0] : hsv ? fmt_table[2] : fmt_table[1];
+ const char** fmt = hide_prefix ? fmt_table[0] : hsv ? fmt_table[2] : fmt_table[1];
ImGui::PushItemWidth(w_item_one);
for (int n = 0; n < components; n++)
{
if (n > 0)
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
if (n + 1 == components)
ImGui::PushItemWidth(w_item_last);
value_changed |= ImGui::DragInt(ids[n], &i[n], 1.0f, 0, 255, fmt[n]);
@@ -7382,7 +8445,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
value_changed |= ImGui::InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
ImGui::PopItemWidth();
char* p = buf;
- while (*p == '#' || ImCharIsSpace(*p))
+ while (*p == '#' || ImCharIsSpace(*p))
p++;
// Treat at unsigned (%X is unsigned)
@@ -7395,7 +8458,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
break;
}
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
const ImVec4 col_display(col[0], col[1], col[2], 1.0f);
if (ImGui::ColorButton(col_display))
@@ -7403,15 +8466,15 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
if (window->DC.ColorEditMode == ImGuiColorEditMode_UserSelectShowButton)
{
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
const char* button_titles[3] = { "RGB", "HSV", "HEX" };
- if (ImGui::Button(button_titles[edit_mode]))
+ if (ButtonEx(button_titles[edit_mode], ImVec2(0,0), ImGuiButtonFlags_DontClosePopups))
g.ColorEditModeStorage.SetInt(id, (edit_mode + 1) % 3); // Don't set local copy of 'edit_mode' right away!
ImGui::SameLine();
}
else
{
- ImGui::SameLine(0, (int)style.ItemInnerSpacing.x);
+ ImGui::SameLine(0, style.ItemInnerSpacing.x);
}
ImGui::TextUnformatted(label, FindTextDisplayEnd(label));
@@ -7459,7 +8522,7 @@ void ImGui::Separator()
x1 += window->DC.ColumnsStartX;
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y));
- ItemSize(ImVec2(0.0f, bb.GetSize().y)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit
+ ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit // FIXME: Height should be 1.0f not 0.0f ?
if (!ItemAdd(bb, NULL))
{
if (window->DC.ColumnsCount > 1)
@@ -7471,7 +8534,7 @@ void ImGui::Separator()
ImGuiState& g = *GImGui;
if (g.LogEnabled)
- ImGui::LogText(STR_NEWLINE "--------------------------------");
+ ImGui::LogText(IM_NEWLINE "--------------------------------");
if (window->DC.ColumnsCount > 1)
{
@@ -7480,101 +8543,36 @@ void ImGui::Separator()
}
}
-// A little vertical spacing.
void ImGui::Spacing()
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
ItemSize(ImVec2(0,0));
}
-// Advance cursor given item size.
-static void ItemSize(ImVec2 size, float text_offset_y)
+void ImGui::Dummy(const ImVec2& size)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
- // Always align ourselves on pixel boundaries
- const float line_height = ImMax(window->DC.CurrentLineHeight, size.y);
- const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y);
- window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y);
- window->DC.CursorPos = ImVec2((float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX), (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y));
- window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
- window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
-
- //window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, 0xFF0000FF, 4); // Debug
-
- window->DC.PrevLineHeight = line_height;
- window->DC.PrevLineTextBaseOffset = text_base_offset;
- window->DC.CurrentLineHeight = window->DC.CurrentLineTextBaseOffset = 0.0f;
-}
-
-static inline void ItemSize(const ImRect& bb, float text_offset_y)
-{
- ItemSize(bb.GetSize(), text_offset_y);
-}
-
-static bool IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged)
-{
- ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
-
- if (!bb.Overlaps(ImRect(window->ClipRectStack.back())))
- {
- if (!id || *id != GImGui->ActiveId)
- if (clip_even_when_logged || !g.LogEnabled)
- return true;
- }
- return false;
-}
-
-bool ImGui::IsRectClipped(const ImVec2& size)
-{
- ImGuiWindow* window = GetCurrentWindow();
- return IsClippedEx(ImRect(window->DC.CursorPos, window->DC.CursorPos + size), NULL, true);
+
+ const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
+ ItemSize(bb);
+ ItemAdd(bb, NULL);
}
-static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
+bool ImGui::IsRectVisible(const ImVec2& size)
{
- ImGuiWindow* window = GetCurrentWindow();
- window->DC.LastItemID = id ? *id : 0;
- window->DC.LastItemRect = bb;
- if (IsClippedEx(bb, id, false))
- {
- window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
- return false;
- }
-
- // This is a sensible default, but widgets are free to override it after calling ItemAdd()
- ImGuiState& g = *GImGui;
- if (IsMouseHoveringRect(bb))
- {
- // Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background)
- // So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
- window->DC.LastItemHoveredRect = true;
- window->DC.LastItemHoveredAndUsable = false;
- if (g.HoveredRootWindow == window->RootWindow)
- if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
- if (IsWindowContentHoverable(window))
- window->DC.LastItemHoveredAndUsable = true;
- }
- else
- {
- window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
- }
-
- return true;
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
}
void ImGui::BeginGroup()
{
ImGuiWindow* window = GetCurrentWindow();
- window->DC.GroupStack.resize(window->DC.GroupStack.size() + 1);
+ window->DC.GroupStack.resize(window->DC.GroupStack.Size + 1);
ImGuiGroupData& group_data = window->DC.GroupStack.back();
group_data.BackupCursorPos = window->DC.CursorPos;
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
@@ -7582,6 +8580,7 @@ void ImGui::BeginGroup()
group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight;
group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset;
group_data.BackupLogLinePosY = window->DC.LogLinePosY;
+ group_data.AdvanceCursor = true;
window->DC.ColumnsStartX = window->DC.CursorPos.x - window->Pos.x;
window->DC.CursorMaxPos = window->DC.CursorPos;
@@ -7605,12 +8604,16 @@ void ImGui::EndGroup()
window->DC.CursorPos = group_data.BackupCursorPos;
window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight;
- window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset; // FIXME: Ideally we'll grab the base offset from the first line of the group.
+ window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset;
window->DC.ColumnsStartX = group_data.BackupColumnsStartX;
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
- ItemSize(group_bb.GetSize(), group_data.BackupCurrentLineTextBaseOffset);
- ItemAdd(group_bb, NULL);
+ if (group_data.AdvanceCursor)
+ {
+ window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrentLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
+ ItemSize(group_bb.GetSize(), group_data.BackupCurrentLineTextBaseOffset);
+ ItemAdd(group_bb, NULL);
+ }
window->DC.GroupStack.pop_back();
@@ -7618,28 +8621,28 @@ void ImGui::EndGroup()
}
// Gets back to previous line and continue with horizontal layout
-// column_x == 0 : follow on previous item
-// columm_x != 0 : align to specified column
+// local_pos_x == 0 : follow on previous item
+// local_pos_x != 0 : align to specified column
// spacing_w < 0 : use default spacing if column_x==0, no spacing if column_x!=0
// spacing_w >= 0 : enforce spacing
-void ImGui::SameLine(int column_x, int spacing_w)
+void ImGui::SameLine(float local_pos_x, float spacing_w)
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
+
+ ImGuiState& g = *GImGui;
float x, y;
- if (column_x != 0)
+ if (local_pos_x != 0.0f)
{
- if (spacing_w < 0) spacing_w = 0;
- x = window->Pos.x + (float)column_x + (float)spacing_w;
+ if (spacing_w < 0.0f) spacing_w = 0.0f;
+ x = window->Pos.x - window->Scroll.x + local_pos_x + spacing_w;
y = window->DC.CursorPosPrevLine.y;
}
else
{
- if (spacing_w < 0) spacing_w = (int)g.Style.ItemSpacing.x;
- x = window->DC.CursorPosPrevLine.x + (float)spacing_w;
+ if (spacing_w < 0.0f) spacing_w = g.Style.ItemSpacing.x;
+ x = window->DC.CursorPosPrevLine.x + spacing_w;
y = window->DC.CursorPosPrevLine.y;
}
window->DC.CurrentLineHeight = window->DC.PrevLineHeight;
@@ -7649,11 +8652,11 @@ void ImGui::SameLine(int column_x, int spacing_w)
void ImGui::NextColumn()
{
- ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
+ ImGuiState& g = *GImGui;
if (window->DC.ColumnsCount > 1)
{
ImGui::PopItemWidth();
@@ -7663,12 +8666,14 @@ void ImGui::NextColumn()
if (++window->DC.ColumnsCurrent < window->DC.ColumnsCount)
{
window->DC.ColumnsOffsetX = ImGui::GetColumnOffset(window->DC.ColumnsCurrent) - window->DC.ColumnsStartX + g.Style.ItemSpacing.x;
+ window->DrawList->ChannelsSetCurrent(window->DC.ColumnsCurrent);
}
else
{
window->DC.ColumnsCurrent = 0;
window->DC.ColumnsOffsetX = 0.0f;
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY;
+ window->DrawList->ChannelsSetCurrent(0);
}
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX);
window->DC.CursorPos.y = window->DC.ColumnsCellMinY;
@@ -7682,13 +8687,13 @@ void ImGui::NextColumn()
int ImGui::GetColumnIndex()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.ColumnsCurrent;
}
int ImGui::GetColumnsCount()
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
return window->DC.ColumnsCount;
}
@@ -7697,21 +8702,20 @@ static float GetDraggedColumnOffset(int column_index)
// Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing
// window creates a feedback loop because we store normalized positions/ So while dragging we enforce absolute positioning
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = ImGui::GetCurrentWindowRead();
IM_ASSERT(column_index > 0); // We cannot drag column 0. If you get this assert you may have a conflict between the ID of your columns and another widgets.
IM_ASSERT(g.ActiveId == window->DC.ColumnsSetID + ImGuiID(column_index));
- float x = g.IO.MousePos.x + g.ActiveClickDeltaToCenter.x;
- x -= window->Pos.x;
+ float x = g.IO.MousePos.x + g.ActiveClickDeltaToCenter.x - window->Pos.x;
x = ImClamp(x, ImGui::GetColumnOffset(column_index-1)+g.Style.ColumnsMinSpacing, ImGui::GetColumnOffset(column_index+1)-g.Style.ColumnsMinSpacing);
- return x;
+ return (float)(int)x;
}
float ImGui::GetColumnOffset(int column_index)
{
ImGuiState& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
@@ -7723,13 +8727,14 @@ float ImGui::GetColumnOffset(int column_index)
}
// Read from cache
- IM_ASSERT(column_index < (int)window->DC.ColumnsOffsetsT.size());
+ IM_ASSERT(column_index < window->DC.ColumnsOffsetsT.Size);
const float t = window->DC.ColumnsOffsetsT[column_index];
+ const float content_region_width = window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x;
const float min_x = window->DC.ColumnsStartX;
- const float max_x = window->Size.x - (g.Style.ScrollbarWidth);// - window->WindowPadding().x;
- const float offset = min_x + t * (max_x - min_x);
- return offset;
+ const float max_x = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
+ const float x = min_x + t * (max_x - min_x);
+ return (float)(int)x;
}
void ImGui::SetColumnOffset(int column_index, float offset)
@@ -7739,11 +8744,12 @@ void ImGui::SetColumnOffset(int column_index, float offset)
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
- IM_ASSERT(column_index < (int)window->DC.ColumnsOffsetsT.size());
+ IM_ASSERT(column_index < window->DC.ColumnsOffsetsT.Size);
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
+ const float content_region_width = window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x;
const float min_x = window->DC.ColumnsStartX;
- const float max_x = window->Size.x - (g.Style.ScrollbarWidth);// - window->WindowPadding().x;
+ const float max_x = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
const float t = (offset - min_x) / (max_x - min_x);
window->DC.StateStorage->SetFloat(column_id, t);
window->DC.ColumnsOffsetsT[column_index] = t;
@@ -7751,7 +8757,7 @@ void ImGui::SetColumnOffset(int column_index, float offset)
float ImGui::GetColumnWidth(int column_index)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = GetCurrentWindowRead();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
@@ -7761,7 +8767,7 @@ float ImGui::GetColumnWidth(int column_index)
static void PushColumnClipRect(int column_index)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiWindow* window = ImGui::GetCurrentWindow();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
@@ -7781,6 +8787,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
ItemSize(ImVec2(0,0)); // Advance to column 0
ImGui::PopItemWidth();
PopClipRect();
+ window->DrawList->ChannelsMerge();
window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
window->DC.CursorPos.y = window->DC.ColumnsCellMaxY;
@@ -7794,10 +8801,8 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
for (int i = 1; i < window->DC.ColumnsCount; i++)
{
float x = window->Pos.x + GetColumnOffset(i);
-
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(i);
const ImRect column_rect(ImVec2(x-4,y1),ImVec2(x+4,y2));
-
if (IsClippedEx(column_rect, &column_id, false))
continue;
@@ -7809,7 +8814,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
// Draw before resize so our items positioning are in sync with the line being drawn
const ImU32 col = window->Color(held ? ImGuiCol_ColumnActive : hovered ? ImGuiCol_ColumnHovered : ImGuiCol_Column);
const float xi = (float)(int)x;
- window->DrawList->AddLine(ImVec2(xi, y1), ImVec2(xi, y2), col);
+ window->DrawList->AddLine(ImVec2(xi, y1+1.0f), ImVec2(xi, y2), col);
if (held)
{
@@ -7837,16 +8842,16 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
if (window->DC.ColumnsCount != 1)
{
// Cache column offsets
- window->DC.ColumnsOffsetsT.resize((size_t)columns_count + 1);
+ window->DC.ColumnsOffsetsT.resize(columns_count + 1);
for (int column_index = 0; column_index < columns_count + 1; column_index++)
{
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
- RegisterAliveId(column_id);
+ KeepAliveID(column_id);
const float default_t = column_index / (float)window->DC.ColumnsCount;
const float t = window->DC.StateStorage->GetFloat(column_id, default_t); // Cheaply store our floating point value inside the integer (could store an union into the map?)
window->DC.ColumnsOffsetsT[column_index] = t;
}
-
+ window->DrawList->ChannelsSplit(window->DC.ColumnsCount);
PushColumnClipRect();
ImGui::PushItemWidth(ImGui::GetColumnWidth() * 0.65f);
}
@@ -7948,1579 +8953,22 @@ void ImGui::Color(const char* prefix, unsigned int v)
}
//-----------------------------------------------------------------------------
-// ImDrawList
-//-----------------------------------------------------------------------------
-
-static ImVec4 GNullClipRect(-9999.0f,-9999.0f, +9999.0f, +9999.0f);
-
-void ImDrawList::Clear()
-{
- commands.resize(0);
- vtx_buffer.resize(0);
- vtx_write = NULL;
- clip_rect_stack.resize(0);
- texture_id_stack.resize(0);
-}
-
-void ImDrawList::ClearFreeMemory()
-{
- commands.clear();
- vtx_buffer.clear();
- vtx_write = NULL;
- clip_rect_stack.clear();
- texture_id_stack.clear();
-}
-
-void ImDrawList::AddDrawCmd()
-{
- ImDrawCmd draw_cmd;
- draw_cmd.vtx_count = 0;
- draw_cmd.clip_rect = clip_rect_stack.empty() ? GNullClipRect : clip_rect_stack.back();
- draw_cmd.texture_id = texture_id_stack.empty() ? NULL : texture_id_stack.back();
- draw_cmd.user_callback = NULL;
- draw_cmd.user_callback_data = NULL;
-
- IM_ASSERT(draw_cmd.clip_rect.x <= draw_cmd.clip_rect.z && draw_cmd.clip_rect.y <= draw_cmd.clip_rect.w);
- commands.push_back(draw_cmd);
-}
-
-void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
-{
- ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
- if (!current_cmd || current_cmd->vtx_count != 0 || current_cmd->user_callback != NULL)
- {
- AddDrawCmd();
- current_cmd = &commands.back();
- }
- current_cmd->user_callback = callback;
- current_cmd->user_callback_data = callback_data;
-
- // Force a new command after us
- // We function this way so that the most common calls (AddLine, AddRect..) always have a command to add to without doing any check.
- AddDrawCmd();
-}
-
-void ImDrawList::UpdateClipRect()
-{
- ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
- if (!current_cmd || (current_cmd->vtx_count != 0) || current_cmd->user_callback != NULL)
- {
- AddDrawCmd();
- }
- else
- {
- current_cmd->clip_rect = clip_rect_stack.empty() ? GNullClipRect : clip_rect_stack.back();
- }
-}
-
-// Scissoring. The values in clip_rect are x1, y1, x2, y2.
-void ImDrawList::PushClipRect(const ImVec4& clip_rect)
-{
- clip_rect_stack.push_back(clip_rect);
- UpdateClipRect();
-}
-
-void ImDrawList::PushClipRectFullScreen()
-{
- PushClipRect(GNullClipRect);
-
- // This would be more correct but we're not supposed to access ImGuiState from here?
- //ImGuiState& g = *GImGui;
- //PushClipRect(GetVisibleRect());
-}
-
-void ImDrawList::PopClipRect()
-{
- IM_ASSERT(clip_rect_stack.size() > 0);
- clip_rect_stack.pop_back();
- UpdateClipRect();
-}
-
-void ImDrawList::UpdateTextureID()
-{
- ImDrawCmd* current_cmd = commands.empty() ? NULL : &commands.back();
- const ImTextureID texture_id = texture_id_stack.empty() ? NULL : texture_id_stack.back();
- if (!current_cmd || (current_cmd->vtx_count != 0 && current_cmd->texture_id != texture_id) || current_cmd->user_callback != NULL)
- {
- AddDrawCmd();
- }
- else
- {
- current_cmd->texture_id = texture_id;
- }
-}
-
-void ImDrawList::PushTextureID(const ImTextureID& texture_id)
-{
- texture_id_stack.push_back(texture_id);
- UpdateTextureID();
-}
-
-void ImDrawList::PopTextureID()
-{
- IM_ASSERT(texture_id_stack.size() > 0);
- texture_id_stack.pop_back();
- UpdateTextureID();
-}
-
-void ImDrawList::PrimReserve(unsigned int vtx_count)
-{
- ImDrawCmd& draw_cmd = commands.back();
- draw_cmd.vtx_count += vtx_count;
-
- size_t vtx_buffer_size = vtx_buffer.size();
- vtx_buffer.resize(vtx_buffer_size + vtx_count);
- vtx_write = &vtx_buffer[vtx_buffer_size];
-}
-
-void ImDrawList::PrimTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col)
-{
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- vtx_write[0].pos = a; vtx_write[0].uv = uv; vtx_write[0].col = col;
- vtx_write[1].pos = b; vtx_write[1].uv = uv; vtx_write[1].col = col;
- vtx_write[2].pos = c; vtx_write[2].uv = uv; vtx_write[2].col = col;
- vtx_write += 3;
-}
-
-void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col)
-{
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- const ImVec2 b(c.x, a.y);
- const ImVec2 d(a.x, c.y);
- vtx_write[0].pos = a; vtx_write[0].uv = uv; vtx_write[0].col = col;
- vtx_write[1].pos = b; vtx_write[1].uv = uv; vtx_write[1].col = col;
- vtx_write[2].pos = c; vtx_write[2].uv = uv; vtx_write[2].col = col;
- vtx_write[3].pos = a; vtx_write[3].uv = uv; vtx_write[3].col = col;
- vtx_write[4].pos = c; vtx_write[4].uv = uv; vtx_write[4].col = col;
- vtx_write[5].pos = d; vtx_write[5].uv = uv; vtx_write[5].col = col;
- vtx_write += 6;
-}
-
-void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col)
-{
- const ImVec2 b(c.x, a.y);
- const ImVec2 d(a.x, c.y);
- const ImVec2 uv_b(uv_c.x, uv_a.y);
- const ImVec2 uv_d(uv_a.x, uv_c.y);
- vtx_write[0].pos = a; vtx_write[0].uv = uv_a; vtx_write[0].col = col;
- vtx_write[1].pos = b; vtx_write[1].uv = uv_b; vtx_write[1].col = col;
- vtx_write[2].pos = c; vtx_write[2].uv = uv_c; vtx_write[2].col = col;
- vtx_write[3].pos = a; vtx_write[3].uv = uv_a; vtx_write[3].col = col;
- vtx_write[4].pos = c; vtx_write[4].uv = uv_c; vtx_write[4].col = col;
- vtx_write[5].pos = d; vtx_write[5].uv = uv_d; vtx_write[5].col = col;
- vtx_write += 6;
-}
-
-void ImDrawList::PrimQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col)
-{
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- vtx_write[0].pos = a; vtx_write[0].uv = uv; vtx_write[0].col = col;
- vtx_write[1].pos = b; vtx_write[1].uv = uv; vtx_write[1].col = col;
- vtx_write[2].pos = c; vtx_write[2].uv = uv; vtx_write[2].col = col;
- vtx_write[3].pos = a; vtx_write[3].uv = uv; vtx_write[3].col = col;
- vtx_write[4].pos = c; vtx_write[4].uv = uv; vtx_write[4].col = col;
- vtx_write[5].pos = d; vtx_write[5].uv = uv; vtx_write[5].col = col;
- vtx_write += 6;
-}
-
-// FIXME-OPT: In many instances the caller could provide a normal.
-void ImDrawList::PrimLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness)
-{
- const float inv_length = 1.0f / sqrtf(ImLengthSqr(b - a));
- const float dx = (b.x - a.x) * (thickness * 0.5f * inv_length); // line direction, halved
- const float dy = (b.y - a.y) * (thickness * 0.5f * inv_length); // line direction, halved
-
- const ImVec2 pa(a.x + dy, a.y - dx);
- const ImVec2 pb(b.x + dy, b.y - dx);
- const ImVec2 pc(b.x - dy, b.y + dx);
- const ImVec2 pd(a.x - dy, a.y + dx);
- PrimQuad(pa, pb, pc, pd, col);
-}
-
-void ImDrawList::AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness)
-{
- if ((col >> 24) == 0)
- return;
-
- PrimReserve(6);
- PrimLine(a, b, col, thickness);
-}
-
-void ImDrawList::AddArcFast(const ImVec2& center, float radius, ImU32 col, int a_min, int a_max, bool filled, const ImVec2& third_point_offset)
-{
- if ((col >> 24) == 0)
- return;
-
- const int SAMPLES = 12;
- static ImVec2 circle_vtx[SAMPLES];
- static bool circle_vtx_builds = false;
- if (!circle_vtx_builds)
- {
- for (int i = 0; i < SAMPLES; i++)
- {
- const float a = ((float)i / (float)SAMPLES) * 2*PI;
- circle_vtx[i].x = cosf(a + PI);
- circle_vtx[i].y = sinf(a + PI);
- }
- circle_vtx_builds = true;
- }
-
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- if (filled)
- {
- PrimReserve((unsigned int)(a_max-a_min) * 3);
- for (int a0 = a_min; a0 < a_max; a0++)
- {
- int a1 = (a0 + 1 == SAMPLES) ? 0 : a0 + 1;
- PrimVtx(center + circle_vtx[a0] * radius, uv, col);
- PrimVtx(center + circle_vtx[a1] * radius, uv, col);
- PrimVtx(center + third_point_offset, uv, col);
- }
- }
- else
- {
- PrimReserve((unsigned int)(a_max-a_min) * 6);
- for (int a0 = a_min; a0 < a_max; a0++)
- {
- int a1 = (a0 + 1 == SAMPLES) ? 0 : a0 + 1;
- PrimLine(center + circle_vtx[a0] * radius, center + circle_vtx[a1] * radius, col);
- }
- }
-}
-
-void ImDrawList::AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners)
-{
- if ((col >> 24) == 0)
- return;
-
- float r = rounding;
- r = ImMin(r, fabsf(b.x-a.x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ));
- r = ImMin(r, fabsf(b.y-a.y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ));
-
- if (r == 0.0f || rounding_corners == 0)
- {
- PrimReserve(4*6);
- PrimLine(ImVec2(a.x,a.y), ImVec2(b.x,a.y), col);
- PrimLine(ImVec2(b.x,a.y), ImVec2(b.x,b.y), col);
- PrimLine(ImVec2(b.x,b.y), ImVec2(a.x,b.y), col);
- PrimLine(ImVec2(a.x,b.y), ImVec2(a.x,a.y), col);
- }
- else
- {
- PrimReserve(4*6);
- PrimLine(ImVec2(a.x + ((rounding_corners & 1)?r:0), a.y), ImVec2(b.x - ((rounding_corners & 2)?r:0), a.y), col);
- PrimLine(ImVec2(b.x, a.y + ((rounding_corners & 2)?r:0)), ImVec2(b.x, b.y - ((rounding_corners & 4)?r:0)), col);
- PrimLine(ImVec2(b.x - ((rounding_corners & 4)?r:0), b.y), ImVec2(a.x + ((rounding_corners & 8)?r:0), b.y), col);
- PrimLine(ImVec2(a.x, b.y - ((rounding_corners & 8)?r:0)), ImVec2(a.x, a.y + ((rounding_corners & 1)?r:0)), col);
-
- if (rounding_corners & 1) AddArcFast(ImVec2(a.x+r,a.y+r), r, col, 0, 3);
- if (rounding_corners & 2) AddArcFast(ImVec2(b.x-r,a.y+r), r, col, 3, 6);
- if (rounding_corners & 4) AddArcFast(ImVec2(b.x-r,b.y-r), r, col, 6, 9);
- if (rounding_corners & 8) AddArcFast(ImVec2(a.x+r,b.y-r), r, col, 9, 12);
- }
-}
-
-void ImDrawList::AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners)
-{
- if ((col >> 24) == 0)
- return;
-
- float r = rounding;
- r = ImMin(r, fabsf(b.x-a.x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ));
- r = ImMin(r, fabsf(b.y-a.y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ));
-
- if (r == 0.0f || rounding_corners == 0)
- {
- // Use triangle so we can merge more draw calls together (at the cost of extra vertices)
- PrimReserve(6);
- PrimRect(a, b, col);
- }
- else
- {
- PrimReserve(6+6*2);
- PrimRect(ImVec2(a.x+r,a.y), ImVec2(b.x-r,b.y), col);
-
- float top_y = (rounding_corners & 1) ? a.y+r : a.y;
- float bot_y = (rounding_corners & 8) ? b.y-r : b.y;
- PrimRect(ImVec2(a.x,top_y), ImVec2(a.x+r,bot_y), col);
-
- top_y = (rounding_corners & 2) ? a.y+r : a.y;
- bot_y = (rounding_corners & 4) ? b.y-r : b.y;
- PrimRect(ImVec2(b.x-r,top_y), ImVec2(b.x,bot_y), col);
-
- if (rounding_corners & 1) AddArcFast(ImVec2(a.x+r,a.y+r), r, col, 0, 3, true);
- if (rounding_corners & 2) AddArcFast(ImVec2(b.x-r,a.y+r), r, col, 3, 6, true);
- if (rounding_corners & 4) AddArcFast(ImVec2(b.x-r,b.y-r), r, col, 6, 9, true);
- if (rounding_corners & 8) AddArcFast(ImVec2(a.x+r,b.y-r), r, col, 9, 12, true);
- }
-}
-
-void ImDrawList::AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col)
-{
- if ((col >> 24) == 0)
- return;
-
- PrimReserve(3);
- PrimTriangle(a, b, c, col);
-}
-
-void ImDrawList::AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments)
-{
- if ((col >> 24) == 0)
- return;
-
- PrimReserve((unsigned int)num_segments*6);
- const float a_step = 2*PI/(float)num_segments;
- float a0 = 0.0f;
- for (int i = 0; i < num_segments; i++)
- {
- const float a1 = (i + 1) == num_segments ? 0.0f : a0 + a_step;
- PrimLine(centre + ImVec2(cosf(a0), sinf(a0))*radius, centre + ImVec2(cosf(a1), sinf(a1))*radius, col);
- a0 = a1;
- }
-}
-
-void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments)
-{
- if ((col >> 24) == 0)
- return;
-
- const ImVec2 uv = GImGui->FontTexUvWhitePixel;
- PrimReserve((unsigned int)num_segments*3);
- const float a_step = 2*PI/(float)num_segments;
- float a0 = 0.0f;
- for (int i = 0; i < num_segments; i++)
- {
- const float a1 = (i + 1) == num_segments ? 0.0f : a0 + a_step;
- PrimVtx(centre + ImVec2(cosf(a0), sinf(a0))*radius, uv, col);
- PrimVtx(centre + ImVec2(cosf(a1), sinf(a1))*radius, uv, col);
- PrimVtx(centre, uv, col);
- a0 = a1;
- }
-}
-
-void ImDrawList::AddText(const 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)
-{
- if ((col >> 24) == 0)
- return;
-
- if (text_end == NULL)
- text_end = text_begin + strlen(text_begin);
- if (text_begin == text_end)
- return;
-
- IM_ASSERT(font->ContainerAtlas->TexID == texture_id_stack.back()); // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
-
- // reserve vertices for worse case
- const unsigned int char_count = (unsigned int)(text_end - text_begin);
- const unsigned int vtx_count_max = char_count * 6;
- const size_t vtx_begin = vtx_buffer.size();
- PrimReserve(vtx_count_max);
-
- font->RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, this, wrap_width, cpu_clip_max);
-
- // give back unused vertices
- vtx_buffer.resize((size_t)(vtx_write - &vtx_buffer.front()));
- const size_t vtx_count = vtx_buffer.size() - vtx_begin;
- commands.back().vtx_count -= (unsigned int)(vtx_count_max - vtx_count);
- vtx_write -= (vtx_count_max - vtx_count);
-}
-
-void ImDrawList::AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col)
-{
- if ((col >> 24) == 0)
- return;
-
- // FIXME-OPT: This is wasting draw calls.
- const bool push_texture_id = texture_id_stack.empty() || user_texture_id != texture_id_stack.back();
- if (push_texture_id)
- PushTextureID(user_texture_id);
-
- PrimReserve(6);
- PrimRectUV(a, b, uv0, uv1, col);
-
- if (push_texture_id)
- PopTextureID();
-}
-
-//-----------------------------------------------------------------------------
-// ImFontAtlias
-//-----------------------------------------------------------------------------
-
-struct ImFontAtlas::ImFontAtlasData
-{
- // Input
- ImFont* OutFont; // Load into this font
- void* TTFData; // TTF data, we own the memory
- size_t TTFDataSize; // TTF data size, in bytes
- float SizePixels; // Desired output size, in pixels
- const ImWchar* GlyphRanges; // List of Unicode range (2 value per range, values are inclusive, zero-terminated list)
- int FontNo; // Index of font within .TTF file (0)
-
- // Temporary Build Data
- stbtt_fontinfo FontInfo;
- stbrp_rect* Rects;
- stbtt_pack_range* Ranges;
- int RangesCount;
-};
-
-ImFontAtlas::ImFontAtlas()
-{
- TexID = NULL;
- TexPixelsAlpha8 = NULL;
- TexPixelsRGBA32 = NULL;
- TexWidth = TexHeight = 0;
- TexUvWhitePixel = ImVec2(0, 0);
-}
-
-ImFontAtlas::~ImFontAtlas()
-{
- Clear();
-}
-
-void ImFontAtlas::ClearInputData()
-{
- for (size_t i = 0; i < InputData.size(); i++)
- {
- if (InputData[i]->TTFData)
- ImGui::MemFree(InputData[i]->TTFData);
- ImGui::MemFree(InputData[i]);
- }
- InputData.clear();
-}
-
-void ImFontAtlas::ClearTexData()
-{
- if (TexPixelsAlpha8)
- ImGui::MemFree(TexPixelsAlpha8);
- if (TexPixelsRGBA32)
- ImGui::MemFree(TexPixelsRGBA32);
- TexPixelsAlpha8 = NULL;
- TexPixelsRGBA32 = NULL;
-}
-
-void ImFontAtlas::ClearFonts()
-{
- for (size_t i = 0; i < Fonts.size(); i++)
- {
- Fonts[i]->~ImFont();
- ImGui::MemFree(Fonts[i]);
- }
- Fonts.clear();
-}
-
-void ImFontAtlas::Clear()
-{
- ClearInputData();
- ClearTexData();
- ClearFonts();
-}
-
-void ImGui::GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size)
-{
- printf("GetDefaultFontData() is obsoleted in ImGui 1.30.\n");
- printf("Please use ImGui::GetIO().Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8() functions to retrieve uncompressed texture data.\n");
- if (fnt_data) *fnt_data = NULL;
- if (fnt_size) *fnt_size = 0;
- if (png_data) *png_data = NULL;
- if (png_size) *png_size = 0;
- IM_ASSERT(false);
-}
-
-void ImFontAtlas::GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
-{
- // Lazily build
- if (TexPixelsAlpha8 == NULL)
- {
- if (InputData.empty())
- AddFontDefault();
- Build();
- }
-
- *out_pixels = TexPixelsAlpha8;
- if (out_width) *out_width = TexWidth;
- if (out_height) *out_height = TexHeight;
- if (out_bytes_per_pixel) *out_bytes_per_pixel = 1;
-}
-
-void ImFontAtlas::GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
-{
- // Lazily convert to RGBA32 format
- // Although it is likely to be the most commonly used format, our font rendering is 8 bpp
- if (!TexPixelsRGBA32)
- {
- unsigned char* pixels;
- GetTexDataAsAlpha8(&pixels, NULL, NULL);
- TexPixelsRGBA32 = (unsigned int*)ImGui::MemAlloc((size_t)(TexWidth * TexHeight * 4));
- const unsigned char* src = pixels;
- unsigned int* dst = TexPixelsRGBA32;
- for (int n = TexWidth * TexHeight; n > 0; n--)
- *dst++ = ((unsigned int)(*src++) << 24) | 0x00FFFFFF;
- }
-
- *out_pixels = (unsigned char*)TexPixelsRGBA32;
- if (out_width) *out_width = TexWidth;
- if (out_height) *out_height = TexHeight;
- if (out_bytes_per_pixel) *out_bytes_per_pixel = 4;
-}
-
-static void GetDefaultCompressedFontDataTTF(const void** ttf_compressed_data, unsigned int* ttf_compressed_size);
-static unsigned int stb_decompress_length(unsigned char *input);
-static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length);
-
-// Load embedded ProggyClean.ttf at size 13
-ImFont* ImFontAtlas::AddFontDefault()
-{
- unsigned int ttf_compressed_size;
- const void* ttf_compressed;
- GetDefaultCompressedFontDataTTF(&ttf_compressed, &ttf_compressed_size);
- ImFont* font = AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, 13.0f, GetGlyphRangesDefault(), 0);
- font->DisplayOffset.y += 1;
- return font;
-}
-
-ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImWchar* glyph_ranges, int font_no)
-{
- void* data = NULL;
- size_t data_size = 0;
- if (!ImLoadFileToMemory(filename, "rb", (void**)&data, &data_size))
- {
- IM_ASSERT(0); // Could not load file.
- return NULL;
- }
-
- ImFont* font = AddFontFromMemoryTTF(data, (unsigned int)data_size, size_pixels, glyph_ranges, font_no);
- return font;
-}
-
-// Transfer ownership of 'ttf_data' to ImFontAtlas, will be deleted after Build()
-ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImWchar* glyph_ranges, int font_no)
-{
- // Create new font
- ImFont* font = (ImFont*)ImGui::MemAlloc(sizeof(ImFont));
- new (font) ImFont();
- Fonts.push_back(font);
-
- // Add to build list
- ImFontAtlasData* data = (ImFontAtlasData*)ImGui::MemAlloc(sizeof(ImFontAtlasData));
- memset(data, 0, sizeof(ImFontAtlasData));
- data->OutFont = font;
- data->TTFData = ttf_data;
- data->TTFDataSize = (size_t)ttf_size;
- data->SizePixels = size_pixels;
- data->GlyphRanges = glyph_ranges;
- data->FontNo = font_no;
- InputData.push_back(data);
-
- // Invalidate texture
- ClearTexData();
-
- return font;
-}
-
-ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImWchar* glyph_ranges, int font_no)
-{
- // Decompress
- const size_t buf_decompressed_size = stb_decompress_length((unsigned char*)compressed_ttf_data);
- unsigned char* buf_decompressed_data = (unsigned char *)ImGui::MemAlloc(buf_decompressed_size);
- stb_decompress(buf_decompressed_data, (unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size);
-
- // Add
- ImFont* font = AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, glyph_ranges, font_no);
- return font;
-}
-
-bool ImFontAtlas::Build()
-{
- IM_ASSERT(InputData.size() > 0);
-
- TexID = NULL;
- TexWidth = TexHeight = 0;
- TexUvWhitePixel = ImVec2(0, 0);
- ClearTexData();
-
- // Initialize font information early (so we can error without any cleanup) + count glyphs
- int total_glyph_count = 0;
- int total_glyph_range_count = 0;
- for (size_t input_i = 0; input_i < InputData.size(); input_i++)
- {
- ImFontAtlasData& data = *InputData[input_i];
- IM_ASSERT(data.OutFont && (!data.OutFont->IsLoaded() || data.OutFont->ContainerAtlas == this));
- const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)data.TTFData, data.FontNo);
- IM_ASSERT(font_offset >= 0);
- if (!stbtt_InitFont(&data.FontInfo, (unsigned char*)data.TTFData, font_offset))
- return false;
-
- if (!data.GlyphRanges)
- data.GlyphRanges = GetGlyphRangesDefault();
- for (const ImWchar* in_range = data.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
- {
- total_glyph_count += (in_range[1] - in_range[0]) + 1;
- total_glyph_range_count++;
- }
- }
-
- // Start packing
- TexWidth = (total_glyph_count > 1000) ? 1024 : 512; // Width doesn't actually matters.
- TexHeight = 0;
- const int max_tex_height = 1024*32;
- stbtt_pack_context spc;
- int ret = stbtt_PackBegin(&spc, NULL, TexWidth, max_tex_height, 0, 1, NULL);
- IM_ASSERT(ret);
- stbtt_PackSetOversampling(&spc, 1, 1);
-
- // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values).
- ImVector<stbrp_rect> extra_rects;
- RenderCustomTexData(0, &extra_rects);
- stbrp_pack_rects((stbrp_context*)spc.pack_info, &extra_rects[0], (int)extra_rects.size());
- for (size_t i = 0; i < extra_rects.size(); i++)
- if (extra_rects[i].was_packed)
- TexHeight = ImMax(TexHeight, extra_rects[i].y + extra_rects[i].h);
-
- // Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0)
- int buf_packedchars_n = 0, buf_rects_n = 0, buf_ranges_n = 0;
- stbtt_packedchar* buf_packedchars = (stbtt_packedchar*)ImGui::MemAlloc(total_glyph_count * sizeof(stbtt_packedchar));
- stbrp_rect* buf_rects = (stbrp_rect*)ImGui::MemAlloc(total_glyph_count * sizeof(stbrp_rect));
- stbtt_pack_range* buf_ranges = (stbtt_pack_range*)ImGui::MemAlloc(total_glyph_range_count * sizeof(stbtt_pack_range));
- memset(buf_packedchars, 0, total_glyph_count * sizeof(stbtt_packedchar));
- memset(buf_rects, 0, total_glyph_count * sizeof(stbrp_rect)); // Unnecessary but let's clear this for the sake of sanity.
- memset(buf_ranges, 0, total_glyph_range_count * sizeof(stbtt_pack_range));
-
- // First font pass: pack all glyphs (no rendering at this point, we are working with glyph sizes only)
- for (size_t input_i = 0; input_i < InputData.size(); input_i++)
- {
- ImFontAtlasData& data = *InputData[input_i];
-
- // Setup ranges
- int glyph_count = 0;
- int glyph_ranges_count = 0;
- for (const ImWchar* in_range = data.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
- {
- glyph_count += (in_range[1] - in_range[0]) + 1;
- glyph_ranges_count++;
- }
- data.Ranges = buf_ranges + buf_ranges_n;
- data.RangesCount = glyph_ranges_count;
- buf_ranges_n += glyph_ranges_count;
- for (int i = 0; i < glyph_ranges_count; i++)
- {
- const ImWchar* in_range = &data.GlyphRanges[i * 2];
- stbtt_pack_range& range = data.Ranges[i];
- range.font_size = data.SizePixels;
- range.first_unicode_char_in_range = in_range[0];
- range.num_chars_in_range = (in_range[1] - in_range[0]) + 1;
- range.chardata_for_range = buf_packedchars + buf_packedchars_n;
- buf_packedchars_n += range.num_chars_in_range;
- }
-
- // Pack
- data.Rects = buf_rects + buf_rects_n;
- buf_rects_n += glyph_count;
- const int n = stbtt_PackFontRangesGatherRects(&spc, &data.FontInfo, data.Ranges, data.RangesCount, data.Rects);
- stbrp_pack_rects((stbrp_context*)spc.pack_info, data.Rects, n);
-
- // Extend texture height
- for (int i = 0; i < n; i++)
- if (data.Rects[i].was_packed)
- TexHeight = ImMax(TexHeight, data.Rects[i].y + data.Rects[i].h);
- }
- IM_ASSERT(buf_rects_n == total_glyph_count);
- IM_ASSERT(buf_packedchars_n == total_glyph_count);
- IM_ASSERT(buf_ranges_n == total_glyph_range_count);
-
- // Create texture
- TexHeight = ImUpperPowerOfTwo(TexHeight);
- TexPixelsAlpha8 = (unsigned char*)ImGui::MemAlloc(TexWidth * TexHeight);
- memset(TexPixelsAlpha8, 0, TexWidth * TexHeight);
- spc.pixels = TexPixelsAlpha8;
- spc.height = TexHeight;
-
- // Second pass: render characters
- for (size_t input_i = 0; input_i < InputData.size(); input_i++)
- {
- ImFontAtlasData& data = *InputData[input_i];
- ret = stbtt_PackFontRangesRenderIntoRects(&spc, &data.FontInfo, data.Ranges, data.RangesCount, data.Rects);
- data.Rects = NULL;
- }
-
- // End packing
- stbtt_PackEnd(&spc);
- ImGui::MemFree(buf_rects);
- buf_rects = NULL;
-
- // Third pass: setup ImFont and glyphs for runtime
- for (size_t input_i = 0; input_i < InputData.size(); input_i++)
- {
- ImFontAtlasData& data = *InputData[input_i];
- data.OutFont->ContainerAtlas = this;
- data.OutFont->FontSize = data.SizePixels;
-
- const float font_scale = stbtt_ScaleForPixelHeight(&data.FontInfo, data.SizePixels);
- int font_ascent, font_descent, font_line_gap;
- stbtt_GetFontVMetrics(&data.FontInfo, &font_ascent, &font_descent, &font_line_gap);
- data.OutFont->BaseLine = (font_ascent * font_scale);
- data.OutFont->Glyphs.resize(0);
-
- const float uv_scale_x = 1.0f / TexWidth;
- const float uv_scale_y = 1.0f / TexHeight;
- const int character_spacing_x = 1;
- for (int i = 0; i < data.RangesCount; i++)
- {
- stbtt_pack_range& range = data.Ranges[i];
- for (int char_idx = 0; char_idx < range.num_chars_in_range; char_idx += 1)
- {
- const int codepoint = range.first_unicode_char_in_range + char_idx;
- const stbtt_packedchar& pc = range.chardata_for_range[char_idx];
- if (!pc.x0 && !pc.x1 && !pc.y0 && !pc.y1)
- continue;
-
- data.OutFont->Glyphs.resize(data.OutFont->Glyphs.size() + 1);
- ImFont::Glyph& glyph = data.OutFont->Glyphs.back();
- glyph.Codepoint = (ImWchar)codepoint;
- glyph.Width = (signed short)pc.x1 - pc.x0 + 1;
- glyph.Height = (signed short)pc.y1 - pc.y0 + 1;
- glyph.XOffset = (signed short)(pc.xoff);
- glyph.YOffset = (signed short)(pc.yoff + (int)(font_ascent * font_scale));
- glyph.XAdvance = (signed short)(pc.xadvance + character_spacing_x); // Bake spacing into XAdvance
- glyph.U0 = ((float)pc.x0 - 0.5f) * uv_scale_x;
- glyph.V0 = ((float)pc.y0 - 0.5f) * uv_scale_y;
- glyph.U1 = ((float)pc.x0 - 0.5f + glyph.Width) * uv_scale_x;
- glyph.V1 = ((float)pc.y0 - 0.5f + glyph.Height) * uv_scale_y;
- }
- }
-
- data.OutFont->BuildLookupTable();
- }
-
- // Cleanup temporaries
- ImGui::MemFree(buf_packedchars);
- ImGui::MemFree(buf_ranges);
- buf_packedchars = NULL;
- buf_ranges = NULL;
-
- // Render into our custom data block
- RenderCustomTexData(1, &extra_rects);
-
- return true;
-}
-
-void ImFontAtlas::RenderCustomTexData(int pass, void* p_rects)
-{
- // . = white layer, X = black layer, others are blank
- const int TEX_DATA_W = 90;
- const int TEX_DATA_H = 27;
- const char texture_data[TEX_DATA_W*TEX_DATA_H+1] =
- {
- "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX"
- "..- -X.....X- X.X - X.X -X.....X - X.....X"
- "--- -XXX.XXX- X...X - X...X -X....X - X....X"
- "X - X.X - X.....X - X.....X -X...X - X...X"
- "XX - X.X -X.......X- X.......X -X..X.X - X.X..X"
- "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X"
- "X..X - X.X - X.X - X.X -XX X.X - X.X XX"
- "X...X - X.X - X.X - XX X.X XX - X.X - X.X "
- "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X "
- "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X "
- "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X "
- "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X "
- "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X "
- "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X "
- "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X "
- "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X "
- "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX "
- "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------"
- "X.X X..X - -X.......X- X.......X - XX XX - "
- "XX X..X - - X.....X - X.....X - X.X X.X - "
- " X..X - X...X - X...X - X..X X..X - "
- " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - "
- "------------ - X - X -X.....................X- "
- " ----------------------------------- X...XXXXXXXXXXXXX...X - "
- " - X..X X..X - "
- " - X.X X.X - "
- " - XX XX - "
- };
-
- ImVector<stbrp_rect>& rects = *(ImVector<stbrp_rect>*)p_rects;
- if (pass == 0)
- {
- stbrp_rect r;
- memset(&r, 0, sizeof(r));
- r.w = (TEX_DATA_W*2)+1;
- r.h = TEX_DATA_H+1;
- rects.push_back(r);
- }
- else if (pass == 1)
- {
- // Copy pixels
- const stbrp_rect& r = rects[0];
- for (int y = 0, n = 0; y < TEX_DATA_H; y++)
- for (int x = 0; x < TEX_DATA_W; x++, n++)
- {
- const int offset0 = (int)(r.x + x) + (int)(r.y + y) * TexWidth;
- const int offset1 = offset0 + 1 + TEX_DATA_W;
- TexPixelsAlpha8[offset0] = texture_data[n] == '.' ? 0xFF : 0x00;
- TexPixelsAlpha8[offset1] = texture_data[n] == 'X' ? 0xFF : 0x00;
- }
- const ImVec2 tex_uv_scale(1.0f / TexWidth, 1.0f / TexHeight);
- TexUvWhitePixel = ImVec2(r.x + 0.5f, r.y + 0.5f) * tex_uv_scale;
-
- const ImVec2 cursor_datas[ImGuiMouseCursor_Count_][3] =
- {
- // Pos ........ Size ......... Offset ......
- { ImVec2(0,3), ImVec2(12,19), ImVec2( 0, 0) }, // ImGuiMouseCursor_Arrow
- { ImVec2(13,0), ImVec2(7,16), ImVec2( 4, 8) }, // ImGuiMouseCursor_TextInput
- { ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) }, // ImGuiMouseCursor_Move
- { ImVec2(21,0), ImVec2( 9,23), ImVec2( 5,11) }, // ImGuiMouseCursor_ResizeNS
- { ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 5) }, // ImGuiMouseCursor_ResizeEW
- { ImVec2(73,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNESW
- { ImVec2(55,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNWSE
- };
-
- for (int type = 0; type < ImGuiMouseCursor_Count_; type++)
- {
- ImGuiMouseCursorData& cursor_data = GImGui->MouseCursorData[type];
- ImVec2 pos = cursor_datas[type][0] + ImVec2((float)r.x, (float)r.y);
- const ImVec2 size = cursor_datas[type][1];
- cursor_data.Type = type;
- cursor_data.Size = size;
- cursor_data.Offset = cursor_datas[type][2];
- cursor_data.TexUvMin[0] = (pos) * tex_uv_scale;
- cursor_data.TexUvMax[0] = (pos + size) * tex_uv_scale;
- pos.x += TEX_DATA_W+1;
- cursor_data.TexUvMin[1] = (pos) * tex_uv_scale;
- cursor_data.TexUvMax[1] = (pos + size) * tex_uv_scale;
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-// ImFont
-//-----------------------------------------------------------------------------
-
-ImFont::ImFont()
-{
- Scale = 1.0f;
- FallbackChar = (ImWchar)'?';
- Clear();
-}
-
-ImFont::~ImFont()
-{
- // Invalidate active font so that the user gets a clear crash instead of a dangling pointer.
- // If you want to delete fonts you need to do it between Render() and NewFrame().
- ImGuiState& g = *GImGui;
- if (g.Font == this)
- g.Font = NULL;
- Clear();
-}
-
-void ImFont::Clear()
-{
- FontSize = 0.0f;
- DisplayOffset = ImVec2(-0.5f, 0.5f);
- BaseLine = 0.0f;
- ContainerAtlas = NULL;
- Glyphs.clear();
- FallbackGlyph = NULL;
- FallbackXAdvance = 0.0f;
- IndexXAdvance.clear();
- IndexLookup.clear();
-}
-
-// Retrieve list of range (2 int per range, values are inclusive)
-const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
-{
- static const ImWchar ranges[] =
- {
- 0x0020, 0x00FF, // Basic Latin + Latin Supplement
- 0,
- };
- return &ranges[0];
-}
-
-const ImWchar* ImFontAtlas::GetGlyphRangesChinese()
-{
- static const ImWchar ranges[] =
- {
- 0x0020, 0x00FF, // Basic Latin + Latin Supplement
- 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
- 0x31F0, 0x31FF, // Katakana Phonetic Extensions
- 0xFF00, 0xFFEF, // Half-width characters
- 0x4e00, 0x9FAF, // CJK Ideograms
- 0,
- };
- return &ranges[0];
-}
-
-const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
-{
- // Store the 1946 ideograms code points as successive offsets from the initial unicode codepoint 0x4E00. Each offset has an implicit +1.
- // This encoding helps us reduce the source code size.
- static const short offsets_from_0x4E00[] =
- {
- -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,
- 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,
- 5,4,12,24,3,13,12,10,24,0,0,0,1,0,1,1,2,9,10,2,2,0,0,3,3,1,0,3,8,0,3,2,4,4,1,6,11,10,14,6,15,3,4,15,1,0,0,5,2,2,0,0,1,6,5,5,6,0,3,6,5,0,0,1,0,
- 11,2,2,8,4,7,0,10,0,1,2,17,19,3,0,2,5,0,6,2,4,4,6,1,1,11,2,0,3,1,2,1,2,10,7,6,3,16,0,8,24,0,0,3,1,1,3,0,1,6,0,0,0,2,0,1,5,15,0,1,0,0,2,11,19,
- 1,4,19,7,6,5,1,0,0,0,0,5,1,0,1,9,0,0,5,0,2,0,1,0,3,0,11,3,0,2,0,0,0,0,0,9,3,6,4,12,0,14,0,0,29,10,8,0,14,37,13,0,31,16,19,0,8,30,1,20,8,3,48,
- 21,1,0,12,0,10,44,34,42,54,11,18,82,0,2,1,2,12,1,0,6,2,17,2,12,7,0,7,17,4,2,6,24,23,8,23,39,2,16,23,1,0,5,1,2,15,14,5,6,2,11,0,8,6,2,2,2,14,
- 20,4,15,3,4,11,10,10,2,5,2,1,30,2,1,0,0,22,5,5,0,3,1,5,4,1,0,0,2,2,21,1,5,1,2,16,2,1,3,4,0,8,4,0,0,5,14,11,2,16,1,13,1,7,0,22,15,3,1,22,7,14,
- 22,19,11,24,18,46,10,20,64,45,3,2,0,4,5,0,1,4,25,1,0,0,2,10,0,0,0,1,0,1,2,0,0,9,1,2,0,0,0,2,5,2,1,1,5,5,8,1,1,1,5,1,4,9,1,3,0,1,0,1,1,2,0,0,
- 2,0,1,8,22,8,1,0,0,0,0,4,2,1,0,9,8,5,0,9,1,30,24,2,6,4,39,0,14,5,16,6,26,179,0,2,1,1,0,0,0,5,2,9,6,0,2,5,16,7,5,1,1,0,2,4,4,7,15,13,14,0,0,
- 3,0,1,0,0,0,2,1,6,4,5,1,4,9,0,3,1,8,0,0,10,5,0,43,0,2,6,8,4,0,2,0,0,9,6,0,9,3,1,6,20,14,6,1,4,0,7,2,3,0,2,0,5,0,3,1,0,3,9,7,0,3,4,0,4,9,1,6,0,
- 9,0,0,2,3,10,9,28,3,6,2,4,1,2,32,4,1,18,2,0,3,1,5,30,10,0,2,2,2,0,7,9,8,11,10,11,7,2,13,7,5,10,0,3,40,2,0,1,6,12,0,4,5,1,5,11,11,21,4,8,3,7,
- 8,8,33,5,23,0,0,19,8,8,2,3,0,6,1,1,1,5,1,27,4,2,5,0,3,5,6,3,1,0,3,1,12,5,3,3,2,0,7,7,2,1,0,4,0,1,1,2,0,10,10,6,2,5,9,7,5,15,15,21,6,11,5,20,
- 4,3,5,5,2,5,0,2,1,0,1,7,28,0,9,0,5,12,5,5,18,30,0,12,3,3,21,16,25,32,9,3,14,11,24,5,66,9,1,2,0,5,9,1,5,1,8,0,8,3,3,0,1,15,1,4,8,1,2,7,0,7,2,
- 8,3,7,5,3,7,10,2,1,0,0,2,25,0,6,4,0,10,0,4,2,4,1,12,5,38,4,0,4,1,10,5,9,4,0,14,4,2,5,18,20,21,1,3,0,5,0,7,0,3,7,1,3,1,1,8,1,0,0,0,3,2,5,2,11,
- 6,0,13,1,3,9,1,12,0,16,6,2,1,0,2,1,12,6,13,11,2,0,28,1,7,8,14,13,8,13,0,2,0,5,4,8,10,2,37,42,19,6,6,7,4,14,11,18,14,80,7,6,0,4,72,12,36,27,
- 7,7,0,14,17,19,164,27,0,5,10,7,3,13,6,14,0,2,2,5,3,0,6,13,0,0,10,29,0,4,0,3,13,0,3,1,6,51,1,5,28,2,0,8,0,20,2,4,0,25,2,10,13,10,0,16,4,0,1,0,
- 2,1,7,0,1,8,11,0,0,1,2,7,2,23,11,6,6,4,16,2,2,2,0,22,9,3,3,5,2,0,15,16,21,2,9,20,15,15,5,3,9,1,0,0,1,7,7,5,4,2,2,2,38,24,14,0,0,15,5,6,24,14,
- 5,5,11,0,21,12,0,3,8,4,11,1,8,0,11,27,7,2,4,9,21,59,0,1,39,3,60,62,3,0,12,11,0,3,30,11,0,13,88,4,15,5,28,13,1,4,48,17,17,4,28,32,46,0,16,0,
- 18,11,1,8,6,38,11,2,6,11,38,2,0,45,3,11,2,7,8,4,30,14,17,2,1,1,65,18,12,16,4,2,45,123,12,56,33,1,4,3,4,7,0,0,0,3,2,0,16,4,2,4,2,0,7,4,5,2,26,
- 2,25,6,11,6,1,16,2,6,17,77,15,3,35,0,1,0,5,1,0,38,16,6,3,12,3,3,3,0,9,3,1,3,5,2,9,0,18,0,25,1,3,32,1,72,46,6,2,7,1,3,14,17,0,28,1,40,13,0,20,
- 15,40,6,38,24,12,43,1,1,9,0,12,6,0,6,2,4,19,3,7,1,48,0,9,5,0,5,6,9,6,10,15,2,11,19,3,9,2,0,1,10,1,27,8,1,3,6,1,14,0,26,0,27,16,3,4,9,6,2,23,
- 9,10,5,25,2,1,6,1,1,48,15,9,15,14,3,4,26,60,29,13,37,21,1,6,4,0,2,11,22,23,16,16,2,2,1,3,0,5,1,6,4,0,0,4,0,0,8,3,0,2,5,0,7,1,7,3,13,2,4,10,
- 3,0,2,31,0,18,3,0,12,10,4,1,0,7,5,7,0,5,4,12,2,22,10,4,2,15,2,8,9,0,23,2,197,51,3,1,1,4,13,4,3,21,4,19,3,10,5,40,0,4,1,1,10,4,1,27,34,7,21,
- 2,17,2,9,6,4,2,3,0,4,2,7,8,2,5,1,15,21,3,4,4,2,2,17,22,1,5,22,4,26,7,0,32,1,11,42,15,4,1,2,5,0,19,3,1,8,6,0,10,1,9,2,13,30,8,2,24,17,19,1,4,
- 4,25,13,0,10,16,11,39,18,8,5,30,82,1,6,8,18,77,11,13,20,75,11,112,78,33,3,0,0,60,17,84,9,1,1,12,30,10,49,5,32,158,178,5,5,6,3,3,1,3,1,4,7,6,
- 19,31,21,0,2,9,5,6,27,4,9,8,1,76,18,12,1,4,0,3,3,6,3,12,2,8,30,16,2,25,1,5,5,4,3,0,6,10,2,3,1,0,5,1,19,3,0,8,1,5,2,6,0,0,0,19,1,2,0,5,1,2,5,
- 1,3,7,0,4,12,7,3,10,22,0,9,5,1,0,2,20,1,1,3,23,30,3,9,9,1,4,191,14,3,15,6,8,50,0,1,0,0,4,0,0,1,0,2,4,2,0,2,3,0,2,0,2,2,8,7,0,1,1,1,3,3,17,11,
- 91,1,9,3,2,13,4,24,15,41,3,13,3,1,20,4,125,29,30,1,0,4,12,2,21,4,5,5,19,11,0,13,11,86,2,18,0,7,1,8,8,2,2,22,1,2,6,5,2,0,1,2,8,0,2,0,5,2,1,0,
- 2,10,2,0,5,9,2,1,2,0,1,0,4,0,0,10,2,5,3,0,6,1,0,1,4,4,33,3,13,17,3,18,6,4,7,1,5,78,0,4,1,13,7,1,8,1,0,35,27,15,3,0,0,0,1,11,5,41,38,15,22,6,
- 14,14,2,1,11,6,20,63,5,8,27,7,11,2,2,40,58,23,50,54,56,293,8,8,1,5,1,14,0,1,12,37,89,8,8,8,2,10,6,0,0,0,4,5,2,1,0,1,1,2,7,0,3,3,0,4,6,0,3,2,
- 19,3,8,0,0,0,4,4,16,0,4,1,5,1,3,0,3,4,6,2,17,10,10,31,6,4,3,6,10,126,7,3,2,2,0,9,0,0,5,20,13,0,15,0,6,0,2,5,8,64,50,3,2,12,2,9,0,0,11,8,20,
- 109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38,
- };
- static int ranges_unpacked = false;
- static ImWchar ranges[8 + IM_ARRAYSIZE(offsets_from_0x4E00)*2 + 1] =
- {
- 0x0020, 0x00FF, // Basic Latin + Latin Supplement
- 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
- 0x31F0, 0x31FF, // Katakana Phonetic Extensions
- 0xFF00, 0xFFEF, // Half-width characters
- };
- if (!ranges_unpacked)
- {
- // Unpack
- int codepoint = 0x4e00;
- ImWchar* dst = &ranges[8];
- for (int n = 0; n < IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2)
- dst[0] = dst[1] = (ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1));
- dst[0] = 0;
- ranges_unpacked = true;
- }
- return &ranges[0];
-}
-
-void ImFont::BuildLookupTable()
-{
- int max_codepoint = 0;
- for (size_t i = 0; i != Glyphs.size(); i++)
- max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint);
-
- IndexXAdvance.clear();
- IndexXAdvance.resize((size_t)max_codepoint + 1);
- IndexLookup.clear();
- IndexLookup.resize((size_t)max_codepoint + 1);
- for (size_t i = 0; i < (size_t)max_codepoint + 1; i++)
- {
- IndexXAdvance[i] = -1.0f;
- IndexLookup[i] = -1;
- }
- for (size_t i = 0; i < Glyphs.size(); i++)
- {
- const size_t codepoint = (int)Glyphs[i].Codepoint;
- IndexXAdvance[codepoint] = Glyphs[i].XAdvance;
- IndexLookup[codepoint] = (int)i;
- }
-
- // Create a glyph to handle TAB
- // FIXME: Needs proper TAB handling but it needs to be contextualized (can arbitrary say that each string starts at "column 0"
- if (FindGlyph((unsigned short)' '))
- {
- if (Glyphs.back().Codepoint != '\t') // So we can call this function multiple times
- Glyphs.resize(Glyphs.size() + 1);
- ImFont::Glyph& tab_glyph = Glyphs.back();
- tab_glyph = *FindGlyph((unsigned short)' ');
- tab_glyph.Codepoint = '\t';
- tab_glyph.XAdvance *= 4;
- IndexXAdvance[(size_t)tab_glyph.Codepoint] = (float)tab_glyph.XAdvance;
- IndexLookup[(size_t)tab_glyph.Codepoint] = (int)(Glyphs.size()-1);
- }
-
- FallbackGlyph = NULL;
- FallbackGlyph = FindGlyph(FallbackChar);
- FallbackXAdvance = FallbackGlyph ? FallbackGlyph->XAdvance : 0.0f;
- for (size_t i = 0; i < (size_t)max_codepoint + 1; i++)
- if (IndexXAdvance[i] < 0.0f)
- IndexXAdvance[i] = FallbackXAdvance;
-}
-
-void ImFont::SetFallbackChar(ImWchar c)
-{
- FallbackChar = c;
- BuildLookupTable();
-}
-
-const ImFont::Glyph* ImFont::FindGlyph(unsigned short c) const
-{
- if (c < (int)IndexLookup.size())
- {
- const int i = IndexLookup[c];
- if (i != -1)
- return &Glyphs[i];
- }
- return FallbackGlyph;
-}
-
-// Convert UTF-8 to 32-bits character, process single character input.
-// Based on stb_from_utf8() from github.com/nothings/stb/
-// We handle UTF-8 decoding error by skipping forward.
-static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end)
-{
- unsigned int c = (unsigned int)-1;
- const unsigned char* str = (const unsigned char*)in_text;
- if (!(*str & 0x80))
- {
- c = (unsigned int)(*str++);
- *out_char = c;
- return 1;
- }
- if ((*str & 0xe0) == 0xc0)
- {
- *out_char = 0;
- if (in_text_end && in_text_end - (const char*)str < 2) return 0;
- if (*str < 0xc2) return 0;
- c = (unsigned int)((*str++ & 0x1f) << 6);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (*str++ & 0x3f);
- *out_char = c;
- return 2;
- }
- if ((*str & 0xf0) == 0xe0)
- {
- *out_char = 0;
- if (in_text_end && in_text_end - (const char*)str < 3) return 0;
- if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 0;
- if (*str == 0xed && str[1] > 0x9f) return 0; // str[1] < 0x80 is checked below
- c = (unsigned int)((*str++ & 0x0f) << 12);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (unsigned int)((*str++ & 0x3f) << 6);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (*str++ & 0x3f);
- *out_char = c;
- return 3;
- }
- if ((*str & 0xf8) == 0xf0)
- {
- *out_char = 0;
- if (in_text_end && in_text_end - (const char*)str < 4) return 0;
- if (*str > 0xf4) return 0;
- if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 0;
- if (*str == 0xf4 && str[1] > 0x8f) return 0; // str[1] < 0x80 is checked below
- c = (unsigned int)((*str++ & 0x07) << 18);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (unsigned int)((*str++ & 0x3f) << 12);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (unsigned int)((*str++ & 0x3f) << 6);
- if ((*str & 0xc0) != 0x80) return 0;
- c += (*str++ & 0x3f);
- // utf-8 encodings of values used in surrogate pairs are invalid
- if ((c & 0xFFFFF800) == 0xD800) return 0;
- *out_char = c;
- return 4;
- }
- *out_char = 0;
- return 0;
-}
-
-static ptrdiff_t ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
-{
- ImWchar* buf_out = buf;
- ImWchar* buf_end = buf + buf_size;
- while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
- {
- unsigned int c;
- in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
- if (c == 0)
- break;
- if (c < 0x10000) // FIXME: Losing characters that don't fit in 2 bytes
- *buf_out++ = (ImWchar)c;
- }
- *buf_out = 0;
- if (in_text_remaining)
- *in_text_remaining = in_text;
- return buf_out - buf;
-}
-
-static int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
-{
- int char_count = 0;
- while ((!in_text_end || in_text < in_text_end) && *in_text)
- {
- unsigned int c;
- in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
- if (c == 0)
- break;
- if (c < 0x10000)
- char_count++;
- }
- return char_count;
-}
-
-// Based on stb_to_utf8() from github.com/nothings/stb/
-static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int c)
-{
- if (c)
- {
- size_t i = 0;
- size_t n = buf_size;
- if (c < 0x80)
- {
- if (i+1 > n) return 0;
- buf[i++] = (char)c;
- return 1;
- }
- else if (c < 0x800)
- {
- if (i+2 > n) return 0;
- buf[i++] = (char)(0xc0 + (c >> 6));
- buf[i++] = (char)(0x80 + (c & 0x3f));
- return 2;
- }
- else if (c >= 0xdc00 && c < 0xe000)
- {
- return 0;
- }
- else if (c >= 0xd800 && c < 0xdc00)
- {
- if (i+4 > n) return 0;
- buf[i++] = (char)(0xf0 + (c >> 18));
- buf[i++] = (char)(0x80 + ((c >> 12) & 0x3f));
- buf[i++] = (char)(0x80 + ((c >> 6) & 0x3f));
- buf[i++] = (char)(0x80 + ((c ) & 0x3f));
- return 4;
- }
- //else if (c < 0x10000)
- {
- if (i+3 > n) return 0;
- buf[i++] = (char)(0xe0 + (c >> 12));
- buf[i++] = (char)(0x80 + ((c>> 6) & 0x3f));
- buf[i++] = (char)(0x80 + ((c ) & 0x3f));
- return 3;
- }
- }
- return 0;
-}
-
-static ptrdiff_t ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
-{
- char* buf_out = buf;
- const char* buf_end = buf + buf_size;
- while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
- {
- buf_out += ImTextCharToUtf8(buf_out, (uintptr_t)(buf_end-buf_out-1), (unsigned int)*in_text);
- in_text++;
- }
- *buf_out = 0;
- return buf_out - buf;
-}
-
-static int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
-{
- int bytes_count = 0;
- while ((!in_text_end || in_text < in_text_end) && *in_text)
- {
- char dummy[5]; // FIXME-OPT
- bytes_count += ImTextCharToUtf8(dummy, 5, (unsigned int)*in_text);
- in_text++;
- }
- return bytes_count;
-}
-
-const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
-{
- // Simple word-wrapping for English, not full-featured. Please submit failing cases!
- // FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
-
- // For references, possible wrap point marked with ^
- // "aaa bbb, ccc,ddd. eee fff. ggg!"
- // ^ ^ ^ ^ ^__ ^ ^
-
- // List of hardcoded separators: .,;!?'"
-
- // Skip extra blanks after a line returns (that includes not counting them in width computation)
- // e.g. "Hello world" --> "Hello" "World"
-
- // Cut words that cannot possibly fit within one line.
- // e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
-
- float line_width = 0.0f;
- float word_width = 0.0f;
- float blank_width = 0.0f;
-
- const char* word_end = text;
- const char* prev_word_end = NULL;
- bool inside_word = true;
-
- const char* s = text;
- while (s < text_end)
- {
- unsigned int c = (unsigned int)*s;
- const char* next_s;
- if (c < 0x80)
- next_s = s + 1;
- else
- next_s = s + ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0)
- break;
-
- if (c == '\n')
- {
- line_width = word_width = blank_width = 0.0f;
- inside_word = true;
- s = next_s;
- continue;
- }
-
- const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(size_t)c] * scale : FallbackXAdvance;
- if (ImCharIsSpace(c))
- {
- if (inside_word)
- {
- line_width += blank_width;
- blank_width = 0.0f;
- }
- blank_width += char_width;
- inside_word = false;
- }
- else
- {
- word_width += char_width;
- if (inside_word)
- {
- word_end = next_s;
- }
- else
- {
- prev_word_end = word_end;
- line_width += word_width + blank_width;
- word_width = blank_width = 0.0f;
- }
-
- // Allow wrapping after punctuation.
- inside_word = !(c == '.' || c == ',' || c == ';' || c == '!' || c == '?' || c == '\"');
- }
-
- // We ignore blank width at the end of the line (they can be skipped)
- if (line_width + word_width >= wrap_width)
- {
- // Words that cannot possibly fit within an entire line will be cut anywhere.
- if (word_width < wrap_width)
- s = prev_word_end ? prev_word_end : word_end;
- break;
- }
-
- s = next_s;
- }
-
- return s;
-}
-
-ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining) const
-{
- if (!text_end)
- text_end = text_begin + strlen(text_begin); // FIXME-OPT: Need to avoid this.
-
- const float scale = size / FontSize;
- const float line_height = FontSize * scale;
-
- ImVec2 text_size = ImVec2(0,0);
- float line_width = 0.0f;
-
- const bool word_wrap_enabled = (wrap_width > 0.0f);
- const char* word_wrap_eol = NULL;
-
- const char* s = text_begin;
- while (s < text_end)
- {
- if (word_wrap_enabled)
- {
- // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
- if (!word_wrap_eol)
- {
- word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
- if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
- word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
- }
-
- if (s >= word_wrap_eol)
- {
- if (text_size.x < line_width)
- text_size.x = line_width;
- text_size.y += line_height;
- line_width = 0.0f;
- word_wrap_eol = NULL;
-
- // Wrapping skips upcoming blanks
- while (s < text_end)
- {
- const char c = *s;
- if (ImCharIsSpace(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
- }
- continue;
- }
- }
-
- // Decode and advance source (handle unlikely UTF-8 decoding failure by skipping to the next byte)
- const char* prev_s = s;
- unsigned int c = (unsigned int)*s;
- if (c < 0x80)
- {
- s += 1;
- }
- else
- {
- s += ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0)
- break;
- }
-
- if (c == '\n')
- {
- text_size.x = ImMax(text_size.x, line_width);
- text_size.y += line_height;
- line_width = 0.0f;
- continue;
- }
-
- const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(size_t)c] * scale : FallbackXAdvance;
- if (line_width + char_width >= max_width)
- {
- s = prev_s;
- break;
- }
-
- line_width += char_width;
- }
-
- if (line_width > 0 || text_size.y == 0.0f)
- {
- if (text_size.x < line_width)
- text_size.x = line_width;
- text_size.y += line_height;
- }
-
- if (remaining)
- *remaining = s;
-
- return text_size;
-}
-
-ImVec2 ImFont::CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining) const
-{
- if (!text_end)
- text_end = text_begin + ImStrlenW(text_begin);
-
- const float scale = size / FontSize;
- const float line_height = FontSize * scale;
-
- ImVec2 text_size = ImVec2(0,0);
- float line_width = 0.0f;
-
- const ImWchar* s = text_begin;
- while (s < text_end)
- {
- const unsigned int c = (unsigned int)(*s++);
-
- if (c == '\n')
- {
- text_size.x = ImMax(text_size.x, line_width);
- text_size.y += line_height;
- line_width = 0.0f;
- continue;
- }
-
- const float char_width = ((size_t)c < IndexXAdvance.size()) ? IndexXAdvance[(size_t)c] * scale : FallbackXAdvance;
- if (line_width + char_width >= max_width)
- {
- s--;
- break;
- }
-
- line_width += char_width;
- }
-
- if (line_width > 0 || text_size.y == 0.0f)
- {
- if (text_size.x < line_width)
- text_size.x = line_width;
- text_size.y += line_height;
- }
-
- if (remaining)
- *remaining = s;
-
- return text_size;
-}
-
-void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect_ref, const char* text_begin, const char* text_end, ImDrawList* draw_list, float wrap_width, const ImVec2* cpu_clip_max) const
-{
- if (!text_end)
- text_end = text_begin + strlen(text_begin);
-
- const float scale = size / FontSize;
- const float line_height = FontSize * scale;
-
- // Align to be pixel perfect
- pos.x = (float)(int)pos.x + DisplayOffset.x;
- pos.y = (float)(int)pos.y + DisplayOffset.y;
-
- const bool word_wrap_enabled = (wrap_width > 0.0f);
- const char* word_wrap_eol = NULL;
-
- ImVec4 clip_rect = clip_rect_ref;
- if (cpu_clip_max)
- {
- clip_rect.z = ImMin(clip_rect.z, cpu_clip_max->x);
- clip_rect.w = ImMin(clip_rect.w, cpu_clip_max->y);
- }
- float x = pos.x;
- float y = pos.y;
-
- ImDrawVert* out_vertices = draw_list->vtx_write;
-
- const char* s = text_begin;
- while (s < text_end)
- {
- if (word_wrap_enabled)
- {
- // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
- if (!word_wrap_eol)
- {
- word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x));
- if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
- word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
- }
-
- if (s >= word_wrap_eol)
- {
- x = pos.x;
- y += line_height;
- word_wrap_eol = NULL;
-
- // Wrapping skips upcoming blanks
- while (s < text_end)
- {
- const char c = *s;
- if (ImCharIsSpace(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
- }
- continue;
- }
- }
-
- // Decode and advance source (handle unlikely UTF-8 decoding failure by skipping to the next byte)
- unsigned int c = (unsigned int)*s;
- if (c < 0x80)
- {
- s += 1;
- }
- else
- {
- s += ImTextCharFromUtf8(&c, s, text_end);
- if (c == 0)
- break;
- }
-
- if (c == '\n')
- {
- x = pos.x;
- y += line_height;
- continue;
- }
-
- float char_width = 0.0f;
- if (const Glyph* glyph = FindGlyph((unsigned short)c))
- {
- char_width = glyph->XAdvance * scale;
- if (c != ' ' && c != '\t')
- {
- // Clipping on Y is more likely
- float y1 = (float)(y + glyph->YOffset * scale);
- float y2 = (float)(y1 + glyph->Height * scale);
- if (y1 <= clip_rect.w && y2 >= clip_rect.y)
- {
- float x1 = (float)(x + glyph->XOffset * scale);
- float x2 = (float)(x1 + glyph->Width * scale);
- if (x1 <= clip_rect.z && x2 >= clip_rect.x)
- {
- // Render a character
- float u1 = glyph->U0;
- float v1 = glyph->V0;
- float u2 = glyph->U1;
- float v2 = glyph->V1;
-
- // 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)
- if (cpu_clip_max)
- {
- if (x2 > cpu_clip_max->x)
- {
- const float clip_tx = (cpu_clip_max->x - x1) / (x2 - x1);
- x2 = cpu_clip_max->x;
- u2 = u1 + clip_tx * (u2 - u1);
- }
- if (y2 > cpu_clip_max->y)
- {
- const float clip_ty = (cpu_clip_max->y - y1) / (y2 - y1);
- y2 = cpu_clip_max->y;
- v2 = v1 + clip_ty * (v2 - v1);
- }
- }
-
- // NB: we are not calling PrimRectUV() here because non-inlined causes too much overhead in a debug build.
- out_vertices[0].pos = ImVec2(x1, y1);
- out_vertices[0].uv = ImVec2(u1, v1);
- out_vertices[0].col = col;
-
- out_vertices[1].pos = ImVec2(x2, y1);
- out_vertices[1].uv = ImVec2(u2, v1);
- out_vertices[1].col = col;
-
- out_vertices[2].pos = ImVec2(x2, y2);
- out_vertices[2].uv = ImVec2(u2, v2);
- out_vertices[2].col = col;
-
- out_vertices[3] = out_vertices[0];
- out_vertices[4] = out_vertices[2];
-
- out_vertices[5].pos = ImVec2(x1, y2);
- out_vertices[5].uv = ImVec2(u1, v2);
- out_vertices[5].col = col;
-
- out_vertices += 6;
- }
- }
- }
- }
-
- x += char_width;
- }
-
- draw_list->vtx_write = out_vertices;
-}
-
-//-----------------------------------------------------------------------------
// PLATFORM DEPENDANT HELPERS
//-----------------------------------------------------------------------------
-#if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS)
-
-#ifndef _WINDOWS_
+#if defined(_WIN32) && !defined(_WINDOWS_) && (!defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS) || !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS))
+#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
// Win32 API clipboard implementation
+#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS)
+
+#ifdef _MSC_VER
+#pragma comment(lib, "user32")
+#endif
+
static const char* GetClipboardTextFn_DefaultImpl()
{
static char* buf_local = NULL;
@@ -9529,9 +8977,9 @@ static const char* GetClipboardTextFn_DefaultImpl()
ImGui::MemFree(buf_local);
buf_local = NULL;
}
- if (!OpenClipboard(NULL))
+ if (!OpenClipboard(NULL))
return NULL;
- HANDLE wbuf_handle = GetClipboardData(CF_UNICODETEXT);
+ HANDLE wbuf_handle = GetClipboardData(CF_UNICODETEXT);
if (wbuf_handle == NULL)
return NULL;
if (ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle))
@@ -9540,24 +8988,23 @@ static const char* GetClipboardTextFn_DefaultImpl()
buf_local = (char*)ImGui::MemAlloc(buf_len * sizeof(char));
ImTextStrToUtf8(buf_local, buf_len, wbuf_global, NULL);
}
- GlobalUnlock(wbuf_handle);
- CloseClipboard();
+ GlobalUnlock(wbuf_handle);
+ CloseClipboard();
return buf_local;
}
-// Win32 API clipboard implementation
static void SetClipboardTextFn_DefaultImpl(const char* text)
{
if (!OpenClipboard(NULL))
return;
const int wbuf_length = ImTextCountCharsFromUtf8(text, NULL) + 1;
- HGLOBAL wbuf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length * sizeof(ImWchar));
+ HGLOBAL wbuf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length * sizeof(ImWchar));
if (wbuf_handle == NULL)
return;
- ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle);
+ ImWchar* wbuf_global = (ImWchar*)GlobalLock(wbuf_handle);
ImTextStrFromUtf8(wbuf_global, wbuf_length, text, NULL);
- GlobalUnlock(wbuf_handle);
+ GlobalUnlock(wbuf_handle);
EmptyClipboard();
SetClipboardData(CF_UNICODETEXT, wbuf_handle);
CloseClipboard();
@@ -9583,19 +9030,18 @@ static void SetClipboardTextFn_DefaultImpl(const char* text)
const char* text_end = text + strlen(text);
g.PrivateClipboard = (char*)ImGui::MemAlloc((size_t)(text_end - text) + 1);
memcpy(g.PrivateClipboard, text, (size_t)(text_end - text));
- g.PrivateClipboard[(size_t)(text_end - text)] = 0;
+ g.PrivateClipboard[(int)(text_end - text)] = 0;
}
#endif
-#if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)
+// Win32 API IME support (for Asian languages, etc.)
+#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)
-#ifndef _WINDOWS_
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-#include <Imm.h>
+#include <imm.h>
+#ifdef _MSC_VER
#pragma comment(lib, "imm32")
+#endif
static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
{
@@ -9613,1224 +9059,31 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
#else
-static void ImeSetInputScreenPosFn_DefaultImpl(int, int)
-{
-}
+static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {}
#endif
-#ifdef IMGUI_DISABLE_TEST_WINDOWS
-
-void ImGui::ShowUserGuide() {}
-void ImGui::ShowStyleEditor(ImGuiStyle*) {}
-void ImGui::ShowTestWindow(bool*) {}
-void ImGui::ShowMetricsWindow(bool*) {}
-
-#else
-
//-----------------------------------------------------------------------------
// HELP
//-----------------------------------------------------------------------------
-void ImGui::ShowUserGuide()
-{
- ImGuiState& g = *GImGui;
-
- ImGui::BulletText("Double-click on title bar to collapse window.");
- ImGui::BulletText("Click and drag on lower right corner to resize window.");
- ImGui::BulletText("Click and drag on any empty space to move window.");
- ImGui::BulletText("Mouse Wheel to scroll.");
- if (g.IO.FontAllowUserScaling)
- ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
- ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
- ImGui::BulletText("CTRL+Click on a slider to input text.");
- ImGui::BulletText(
- "While editing text:\n"
- "- Hold SHIFT or use mouse to select text\n"
- "- CTRL+Left/Right to word jump\n"
- "- CTRL+A select all\n"
- "- CTRL+X,CTRL+C,CTRL+V clipboard\n"
- "- CTRL+Z,CTRL+Y undo/redo\n"
- "- ESCAPE to revert\n"
- "- You can apply arithmetic operators +,*,/ on numerical values.\n"
- " Use +- to subtract.\n");
-}
-
-void ImGui::ShowStyleEditor(ImGuiStyle* ref)
-{
- ImGuiState& g = *GImGui;
- ImGuiStyle& style = g.Style;
-
- const ImGuiStyle def; // Default style
-
- if (ImGui::Button("Revert Style"))
- g.Style = ref ? *ref : def;
- if (ref)
- {
- ImGui::SameLine();
- if (ImGui::Button("Save Style"))
- *ref = g.Style;
- }
-
- ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.55f);
-
- if (ImGui::TreeNode("Sizes"))
- {
- 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.
- ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 16.0f, "%.0f");
- ImGui::SliderFloat("ChildWindowRounding", &style.ChildWindowRounding, 0.0f, 16.0f, "%.0f");
- ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 16.0f, "%.0f");
- ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
- ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 20.0f, "%.0f");
- ImGui::SliderFloat("ScrollbarWidth", &style.ScrollbarWidth, 1.0f, 20.0f, "%.0f");
- ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 16.0f, "%.0f");
- ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Colors"))
- {
- static int output_dest = 0;
- static bool output_only_modified = false;
- if (ImGui::Button("Output Colors"))
- {
- if (output_dest == 0)
- ImGui::LogToClipboard();
- else
- ImGui::LogToTTY();
- ImGui::LogText("ImGuiStyle& style = ImGui::GetStyle();" STR_NEWLINE);
- for (int i = 0; i < ImGuiCol_COUNT; i++)
- {
- const ImVec4& col = style.Colors[i];
- const char* name = ImGui::GetStyleColName(i);
- if (!output_only_modified || memcmp(&col, (ref ? &ref->Colors[i] : &def.Colors[i]), sizeof(ImVec4)) != 0)
- ImGui::LogText("style.Colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" STR_NEWLINE, name, 22 - strlen(name), "", col.x, col.y, col.z, col.w);
- }
- ImGui::LogFinish();
- }
- ImGui::SameLine(); ImGui::PushItemWidth(150); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY"); ImGui::PopItemWidth();
- ImGui::SameLine(); ImGui::Checkbox("Only Modified Fields", &output_only_modified);
-
- static ImGuiColorEditMode edit_mode = ImGuiColorEditMode_RGB;
- ImGui::RadioButton("RGB", &edit_mode, ImGuiColorEditMode_RGB);
- ImGui::SameLine();
- ImGui::RadioButton("HSV", &edit_mode, ImGuiColorEditMode_HSV);
- ImGui::SameLine();
- ImGui::RadioButton("HEX", &edit_mode, ImGuiColorEditMode_HEX);
- //ImGui::Text("Tip: Click on colored square to change edit mode.");
-
- static ImGuiTextFilter filter;
- filter.Draw("Filter colors", 200);
-
- ImGui::BeginChild("#colors", ImVec2(0, 300), true);
-
- ImGui::ColorEditMode(edit_mode);
- for (int i = 0; i < ImGuiCol_COUNT; i++)
- {
- const char* name = ImGui::GetStyleColName(i);
- if (!filter.PassFilter(name))
- continue;
- ImGui::PushID(i);
- ImGui::ColorEdit4(name, (float*)&style.Colors[i], true);
- if (memcmp(&style.Colors[i], (ref ? &ref->Colors[i] : &def.Colors[i]), sizeof(ImVec4)) != 0)
- {
- ImGui::SameLine(); if (ImGui::Button("Revert")) style.Colors[i] = ref ? ref->Colors[i] : def.Colors[i];
- if (ref) { ImGui::SameLine(); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i]; }
- }
- ImGui::PopID();
- }
- ImGui::EndChild();
-
- ImGui::TreePop();
- }
-
- ImGui::PopItemWidth();
-}
-
-//-----------------------------------------------------------------------------
-// SAMPLE CODE
-//-----------------------------------------------------------------------------
-
-static void ShowExampleAppConsole(bool* opened);
-static void ShowExampleAppLongText(bool* opened);
-static void ShowExampleAppAutoResize(bool* opened);
-static void ShowExampleAppFixedOverlay(bool* opened);
-static void ShowExampleAppManipulatingWindowTitle(bool* opened);
-static void ShowExampleAppCustomRendering(bool* opened);
-
-// Demonstrate ImGui features (unfortunately this makes this function a little bloated!)
-void ImGui::ShowTestWindow(bool* opened)
-{
- // Examples apps
- static bool show_app_metrics = false;
- static bool show_app_console = false;
- static bool show_app_long_text = false;
- static bool show_app_auto_resize = false;
- static bool show_app_fixed_overlay = false;
- static bool show_app_custom_rendering = false;
- static bool show_app_manipulating_window_title = false;
- if (show_app_metrics)
- ImGui::ShowMetricsWindow(&show_app_metrics);
- if (show_app_console)
- ShowExampleAppConsole(&show_app_console);
- if (show_app_long_text)
- ShowExampleAppLongText(&show_app_long_text);
- if (show_app_auto_resize)
- ShowExampleAppAutoResize(&show_app_auto_resize);
- if (show_app_fixed_overlay)
- ShowExampleAppFixedOverlay(&show_app_fixed_overlay);
- if (show_app_manipulating_window_title)
- ShowExampleAppManipulatingWindowTitle(&show_app_manipulating_window_title);
- if (show_app_custom_rendering)
- ShowExampleAppCustomRendering(&show_app_custom_rendering);
-
- static bool no_titlebar = false;
- static bool no_border = true;
- static bool no_resize = false;
- static bool no_move = false;
- static bool no_scrollbar = false;
- static bool no_collapse = false;
- static float bg_alpha = 0.65f;
-
- // Demonstrate the various window flags. Typically you would just use the default.
- ImGuiWindowFlags window_flags = 0;
- if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
- if (!no_border) window_flags |= ImGuiWindowFlags_ShowBorders;
- if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;
- if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
- if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
- if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;
- if (!ImGui::Begin("ImGui Test", opened, ImVec2(550,680), bg_alpha, window_flags))
- {
- // Early out if the window is collapsed, as an optimization.
- ImGui::End();
- return;
- }
-
- //ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // 2/3 of the space for widget and 1/3 for labels
- ImGui::PushItemWidth(-140); // Right align, keep 140 pixels for labels
-
- ImGui::Text("ImGui says hello.");
- //ImGui::Text("MousePos (%g, %g)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
- //ImGui::Text("MouseWheel %d", ImGui::GetIO().MouseWheel);
- //ImGui::Text("KeyMods %s%s%s", ImGui::GetIO().KeyCtrl ? "CTRL" : "", ImGui::GetIO().KeyShift ? "SHIFT" : "", ImGui::GetIO().KeyAlt? "ALT" : "");
- //ImGui::Text("WantCaptureMouse: %d", ImGui::GetIO().WantCaptureMouse);
- //ImGui::Text("WantCaptureKeyboard: %d", ImGui::GetIO().WantCaptureKeyboard);
-
- ImGui::Spacing();
- if (ImGui::CollapsingHeader("Help"))
- {
- ImGui::TextWrapped("This window is being created by the ShowTestWindow() function. Please refer to the code for programming reference.\n\nUser Guide:");
- ImGui::ShowUserGuide();
- }
-
- if (ImGui::CollapsingHeader("Window options"))
- {
- ImGui::Checkbox("no titlebar", &no_titlebar); ImGui::SameLine(150);
- ImGui::Checkbox("no border", &no_border); ImGui::SameLine(300);
- ImGui::Checkbox("no resize", &no_resize);
- ImGui::Checkbox("no move", &no_move); ImGui::SameLine(150);
- ImGui::Checkbox("no scrollbar", &no_scrollbar); ImGui::SameLine(300);
- ImGui::Checkbox("no collapse", &no_collapse);
- ImGui::SliderFloat("bg alpha", &bg_alpha, 0.0f, 1.0f);
-
- if (ImGui::TreeNode("Style"))
- {
- ImGui::ShowStyleEditor();
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Fonts", "Fonts (%d)", (int)ImGui::GetIO().Fonts->Fonts.size()))
- {
- ImGui::TextWrapped("Tip: Load fonts with GetIO().Fonts->AddFontFromFileTTF().");
- for (size_t i = 0; i < ImGui::GetIO().Fonts->Fonts.size(); i++)
- {
- ImFont* font = ImGui::GetIO().Fonts->Fonts[i];
- ImGui::BulletText("Font %d: %.2f pixels, %d glyphs", i, font->FontSize, font->Glyphs.size());
- ImGui::TreePush((void*)i);
- ImGui::PushFont(font);
- ImGui::Text("The quick brown fox jumps over the lazy dog");
- ImGui::PopFont();
- if (i > 0 && ImGui::Button("Set as default"))
- {
- ImGui::GetIO().Fonts->Fonts[i] = ImGui::GetIO().Fonts->Fonts[0];
- ImGui::GetIO().Fonts->Fonts[0] = font;
- }
- ImGui::SliderFloat("font scale", &font->Scale, 0.3f, 2.0f, "%.1f"); // scale only this font
- ImGui::TreePop();
- }
- static float window_scale = 1.0f;
- ImGui::SliderFloat("this window scale", &window_scale, 0.3f, 2.0f, "%.1f"); // scale only this window
- ImGui::SliderFloat("global scale", &ImGui::GetIO().FontGlobalScale, 0.3f, 2.0f, "%.1f"); // scale everything
- ImGui::SetWindowFontScale(window_scale);
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Logging"))
- {
- ImGui::LogButtons();
- ImGui::TreePop();
- }
- }
-
- if (ImGui::CollapsingHeader("Widgets"))
- {
- static bool a=false;
- if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; }
- if (a)
- {
- ImGui::SameLine();
- ImGui::Text("Thanks for clicking me!");
- }
-
- if (ImGui::TreeNode("Tree"))
- {
- for (size_t i = 0; i < 5; i++)
- {
- if (ImGui::TreeNode((void*)i, "Child %d", i))
- {
- ImGui::Text("blah blah");
- ImGui::SameLine();
- if (ImGui::SmallButton("print"))
- printf("Child %d pressed", (int)i);
- ImGui::TreePop();
- }
- }
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Bullets"))
- {
- ImGui::BulletText("Bullet point 1");
- ImGui::BulletText("Bullet point 2\nOn multiple lines");
- ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
- ImGui::Bullet(); ImGui::SmallButton("Button 1");
- ImGui::Bullet(); ImGui::SmallButton("Button 2");
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Colored Text"))
- {
- // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
- ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink");
- ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow");
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Word Wrapping"))
- {
- // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
- ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules that works for English and possibly other languages.");
- ImGui::Spacing();
-
- static float wrap_width = 200.0f;
- ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f");
-
- ImGui::Text("Test paragraph 1:");
- ImGui::GetWindowDrawList()->AddRectFilled(ImGui::GetCursorScreenPos() + ImVec2(wrap_width, 0.0f), ImGui::GetCursorScreenPos() + ImVec2(wrap_width+10, ImGui::GetTextLineHeight()), 0xFFFF00FF);
- ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
- ImGui::Text("lazy dog. This paragraph is made to fit within %.0f pixels. The quick brown fox jumps over the lazy dog.", wrap_width);
- ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), 0xFF00FFFF);
- ImGui::PopTextWrapPos();
-
- ImGui::Text("Test paragraph 2:");
- ImGui::GetWindowDrawList()->AddRectFilled(ImGui::GetCursorScreenPos() + ImVec2(wrap_width, 0.0f), ImGui::GetCursorScreenPos() + ImVec2(wrap_width+10, ImGui::GetTextLineHeight()), 0xFFFF00FF);
- ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
- ImGui::Text("aaaaaaaa bbbbbbbb, cccccccc,dddddddd. eeeeeeee ffffffff. gggggggg!hhhhhhhh");
- ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), 0xFF00FFFF);
- ImGui::PopTextWrapPos();
-
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("UTF-8 Text"))
- {
- // UTF-8 test with Japanese characters
- // (needs a suitable font, try Arial Unicode or M+ fonts http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html)
- // Most compiler appears to support UTF-8 in source code (with Visual Studio you need to save your file as 'UTF-8 without signature')
- // However for the sake for maximum portability here we are *not* including raw UTF-8 character in this source file, instead we encode the string with hexadecimal constants.
- // In your own application be reasonable and use UTF-8 in source or retrieve the data from file system!
- // Note that characters values are preserved even if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
- ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges.");
- ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
- ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
- static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
- ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf));
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Clipping"))
- {
- static ImVec2 size(80, 20);
- ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text if it won't fit in its frame.");
- ImGui::SliderFloat2("size", (float*)&size, 5.0f, 200.0f);
- ImGui::Button("Line 1 hello\nLine 2 clip me!", size);
- 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.");
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Images"))
- {
- 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!");
- ImVec2 tex_screen_pos = ImGui::GetCursorScreenPos();
- float tex_w = (float)ImGui::GetIO().Fonts->TexWidth;
- float tex_h = (float)ImGui::GetIO().Fonts->TexHeight;
- ImTextureID tex_id = ImGui::GetIO().Fonts->TexID;
- ImGui::Image(tex_id, ImVec2(tex_w, tex_h), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
- if (ImGui::IsItemHovered())
- {
- ImGui::BeginTooltip();
- float focus_sz = 32.0f;
- float focus_x = ImClamp(ImGui::GetMousePos().x - tex_screen_pos.x - focus_sz * 0.5f, 0.0f, tex_w - focus_sz);
- float focus_y = ImClamp(ImGui::GetMousePos().y - tex_screen_pos.y - focus_sz * 0.5f, 0.0f, tex_h - focus_sz);
- ImGui::Text("Min: (%.2f, %.2f)", focus_x, focus_y);
- ImGui::Text("Max: (%.2f, %.2f)", focus_x + focus_sz, focus_y + focus_sz);
- ImVec2 uv0 = ImVec2((focus_x) / tex_w, (focus_y) / tex_h);
- ImVec2 uv1 = ImVec2((focus_x + focus_sz) / tex_w, (focus_y + focus_sz) / tex_h);
- ImGui::Image(tex_id, ImVec2(128,128), uv0, uv1, ImColor(255,255,255,255), ImColor(255,255,255,128));
- ImGui::EndTooltip();
- }
- ImGui::TextWrapped("And now some textured buttons..");
- static int pressed_count = 0;
- for (int i = 0; i < 8; i++)
- {
- if (i > 0)
- ImGui::SameLine();
- ImGui::PushID(i);
- int frame_padding = -1 + i; // -1 padding uses default padding
- if (ImGui::ImageButton(tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/tex_w,32/tex_h), frame_padding))
- pressed_count += 1;
- ImGui::PopID();
- }
- ImGui::Text("Pressed %d times.", pressed_count);
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Selectables"))
- {
- if (ImGui::TreeNode("Basic"))
- {
- static bool selected[3] = { false, true, false };
- ImGui::Selectable("1. I am selectable", &selected[0]);
- ImGui::Selectable("2. I am selectable", &selected[1]);
- ImGui::Text("3. I am not selectable");
- ImGui::Selectable("4. I am selectable", &selected[2]);
- ImGui::TreePop();
- }
- if (ImGui::TreeNode("Rendering more text into the same block"))
- {
- static bool selected[3] = { false, false, false };
- ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
- ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
- ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
- ImGui::TreePop();
- }
- if (ImGui::TreeNode("Grid"))
- {
- static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
- for (int i = 0; i < 16; i++)
- {
- ImGui::PushID(i);
- if (ImGui::Selectable("Me", &selected[i], ImVec2(50,50)))
- {
- int x = i % 4, y = i / 4;
- if (x > 0) selected[i - 1] ^= 1;
- if (x < 3) selected[i + 1] ^= 1;
- if (y > 0) selected[i - 4] ^= 1;
- if (y < 3) selected[i + 4] ^= 1;
- }
- if ((i % 4) < 3) ImGui::SameLine();
- ImGui::PopID();
- }
- ImGui::TreePop();
- }
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Popup, Menus"))
- {
- static int selected_fish = -1;
- const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" };
- static bool toggles[] = { true, false, false, false, false };
-
- {
- static bool popup_open = false;
- if (ImGui::Button("Select.."))
- popup_open = true;
- ImGui::SameLine();
- ImGui::Text(selected_fish == -1 ? "<None>" : names[selected_fish]);
- if (popup_open)
- {
- ImGui::BeginPopup(&popup_open);
- ImGui::Text("Aquarium");
- ImGui::Separator();
- for (int i = 0; i < IM_ARRAYSIZE(names); i++)
- {
- if (ImGui::Selectable(names[i]))
- {
- selected_fish = i;
- popup_open = false;
- }
- }
- ImGui::EndPopup();
- }
- }
- {
- static bool popup_open = false;
- if (ImGui::Button("Toggle.."))
- popup_open = true;
- if (popup_open)
- {
- ImGui::BeginPopup(&popup_open);
- for (int i = 0; i < IM_ARRAYSIZE(names); i++)
- if (ImGui::MenuItem(names[i], "", &toggles[i]))
- popup_open = false;
-
- ImGui::Separator();
- ImGui::Text("Tooltip here");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("I am a tooltip over a popup");
-
- ImGui::EndPopup();
- }
- }
-
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Filtered Text Input"))
- {
- static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
- static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal);
- static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
- static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase);
- static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank);
- struct TextFilters { static int FilterImGuiLetters(ImGuiTextEditCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } };
- static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters);
- ImGui::TreePop();
- }
-
- static bool check = true;
- ImGui::Checkbox("checkbox", &check);
-
- static int e = 0;
- ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine();
- ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine();
- ImGui::RadioButton("radio c", &e, 2);
-
- // Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style.
- for (int i = 0; i < 7; i++)
- {
- if (i > 0) ImGui::SameLine();
- ImGui::PushID(i);
- ImGui::PushStyleColor(ImGuiCol_Button, ImColor::HSV(i/7.0f, 0.6f, 0.6f));
- ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImColor::HSV(i/7.0f, 0.7f, 0.7f));
- ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImColor::HSV(i/7.0f, 0.8f, 0.8f));
- ImGui::Button("Click");
- ImGui::PopStyleColor(3);
- ImGui::PopID();
- }
-
- ImGui::Text("Hover over me");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("I am a tooltip");
-
- ImGui::SameLine();
- ImGui::Text("- or me");
- if (ImGui::IsItemHovered())
- {
- ImGui::BeginTooltip();
- ImGui::Text("I am a fancy tooltip");
- static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
- ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
- ImGui::EndTooltip();
- }
-
- // Testing IMGUI_ONCE_UPON_A_FRAME macro
- //for (int i = 0; i < 5; i++)
- //{
- // IMGUI_ONCE_UPON_A_FRAME
- // {
- // ImGui::Text("This will be displayed only once.");
- // }
- //}
-
- ImGui::Separator();
-
- ImGui::LabelText("label", "Value");
-
- static int item = 1;
- ImGui::Combo("combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
-
- const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK" };
- static int item2 = -1;
- ImGui::Combo("combo scroll", &item2, items, IM_ARRAYSIZE(items));
-
- {
- static char str0[128] = "Hello, world!";
- static int i0=123;
- static float f0=0.001f;
- ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
- ImGui::InputInt("input int", &i0);
- ImGui::InputFloat("input float", &f0, 0.01f, 1.0f);
-
- static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
- ImGui::InputFloat3("input float3", vec4a);
- }
-
- {
- static int i1=50;
- static int i2=42;
- ImGui::DragInt("drag int", &i1, 1);
- ImGui::SameLine();
- ImGui::TextColored(ImColor(170,170,170,255), "(?)");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input text");
-
- ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%.0f%%");
-
- static float f1=1.00f;
- static float f2=0.0067f;
- ImGui::DragFloat("drag float", &f1, 1.0f);
- ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns");
- }
-
- {
- static int i1=0;
- //static int i2=42;
- ImGui::SliderInt("slider int 0..3", &i1, 0, 3);
- //ImGui::SliderInt("slider int -100..100", &i2, -100, 100);
-
- static float f1=0.123f;
- static float f2=0.0f;
- ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");
- ImGui::SliderFloat("slider log float", &f2, -10.0f, 10.0f, "%.4f", 3.0f);
- static float angle = 0.0f;
- ImGui::SliderAngle("slider angle", &angle);
- }
-
- static float col1[3] = { 1.0f,0.0f,0.2f };
- static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
- ImGui::ColorEdit3("color 1", col1);
- ImGui::ColorEdit4("color 2", col2);
-
- const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
- static int listbox_item_current = 1;
- ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
-
- //static int listbox_item_current2 = 2;
- //ImGui::PushItemWidth(-1);
- //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
- //ImGui::PopItemWidth();
-
- if (ImGui::TreeNode("Multi-component Widgets"))
- {
- ImGui::Unindent();
-
- static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
- static int vec4i[4] = { 1, 5, 100, 255 };
-
- ImGui::InputFloat2("input float2", vec4f);
- ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
- ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
- ImGui::InputInt2("input int2", vec4i);
- ImGui::SliderInt2("slider int2", vec4i, 0, 255);
-
- ImGui::InputFloat3("input float3", vec4f);
- ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
- ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
- ImGui::InputInt3("input int3", vec4i);
- ImGui::SliderInt3("slider int3", vec4i, 0, 255);
-
- ImGui::InputFloat4("input float4", vec4f);
- ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
- ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
- ImGui::InputInt4("input int4", vec4i);
- ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
- ImGui::SliderInt4("slider int4", vec4i, 0, 255);
-
- ImGui::Indent();
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Vertical Sliders"))
- {
- ImGui::Unindent();
- const float spacing = 4;
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing));
-
- static int int_value = 0;
- ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5);
- ImGui::SameLine();
-
- static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
- ImGui::PushID("set1");
- for (int i = 0; i < 7; i++)
- {
- if (i > 0) ImGui::SameLine();
- ImGui::PushID(i);
- ImGui::PushStyleColor(ImGuiCol_FrameBg, ImColor::HSV(i/7.0f, 0.5f, 0.5f));
- ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImColor::HSV(i/7.0f, 0.6f, 0.5f));
- ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImColor::HSV(i/7.0f, 0.7f, 0.5f));
- ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImColor::HSV(i/7.0f, 0.9f, 0.9f));
- ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, "");
- if (ImGui::IsItemActive() || ImGui::IsItemHovered())
- ImGui::SetTooltip("%.3f", values[i]);
- ImGui::PopStyleColor(4);
- ImGui::PopID();
- }
- ImGui::PopID();
-
- ImGui::SameLine();
- ImGui::PushID("set2");
- static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
- const int rows = 3;
- const ImVec2 small_slider_size(18, (160.0f-(rows-1)*spacing)/rows);
- for (int nx = 0; nx < 4; nx++)
- {
- if (nx > 0) ImGui::SameLine();
- ImGui::BeginGroup();
- for (int ny = 0; ny < rows; ny++)
- {
- ImGui::PushID(nx*rows+ny);
- ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, "");
- if (ImGui::IsItemActive() || ImGui::IsItemHovered())
- ImGui::SetTooltip("%.3f", values2[nx]);
- ImGui::PopID();
- }
- ImGui::EndGroup();
- }
- ImGui::PopID();
-
- ImGui::SameLine();
- ImGui::PushID("set3");
- for (int i = 0; i < 4; i++)
- {
- if (i > 0) ImGui::SameLine();
- ImGui::PushID(i);
- ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40);
- ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f");
- ImGui::PopStyleVar();
- ImGui::PopID();
- }
- ImGui::PopID();
- ImGui::PopStyleVar();
-
- ImGui::Indent();
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Dragging"))
- {
- // You can use ImGui::GetItemActiveDragDelta() to query for the dragged amount on any widget.
- static ImVec2 value_raw(0.0f, 0.0f);
- static ImVec2 value_with_lock_threshold(0.0f, 0.0f);
- ImGui::Button("Drag Me");
- if (ImGui::IsItemActive())
- {
- value_raw = ImGui::GetMouseDragDelta(0, 0.0f);
- value_with_lock_threshold = ImGui::GetMouseDragDelta(0);
- //ImGui::SetTooltip("Delta: %.1f, %.1f", value.x, value.y);
-
- // Draw a line between the button and the mouse cursor
- ImDrawList* draw_list = ImGui::GetWindowDrawList();
- draw_list->PushClipRectFullScreen();
- draw_list->AddLine(ImGui::CalcItemRectClosestPoint(ImGui::GetIO().MousePos, true, -2.0f), ImGui::GetIO().MousePos, ImColor(ImGui::GetStyle().Colors[ImGuiCol_Button]), 4.0f);
- draw_list->PopClipRect();
- }
- ImGui::SameLine(); ImGui::Text("Raw (%.1f, %.1f), WithLockThresold (%.1f, %.1f)", value_raw.x, value_raw.y, value_with_lock_threshold.x, value_with_lock_threshold.y);
- ImGui::TreePop();
- }
- }
-
- if (ImGui::CollapsingHeader("Graphs widgets"))
- {
- static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
- ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
-
- static bool pause;
- static ImVector<float> values; if (values.empty()) { values.resize(90); memset(&values.front(), 0, values.size()*sizeof(float)); }
- static size_t values_offset = 0;
- if (!pause)
- {
- // create dummy data at fixed 60 hz rate
- static float refresh_time = -1.0f;
- if (ImGui::GetTime() > refresh_time + 1.0f/60.0f)
- {
- refresh_time = ImGui::GetTime();
- static float phase = 0.0f;
- values[values_offset] = cosf(phase);
- values_offset = (values_offset+1)%values.size();
- phase += 0.10f*values_offset;
- }
- }
- ImGui::PlotLines("##Graph", &values.front(), (int)values.size(), (int)values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80));
- ImGui::SameLine(0, (int)ImGui::GetStyle().ItemInnerSpacing.x);
- ImGui::BeginGroup();
- ImGui::Text("Graph");
- ImGui::Checkbox("pause", &pause);
- ImGui::EndGroup();
- ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80));
- }
-
- if (ImGui::CollapsingHeader("Layout"))
- {
- if (ImGui::TreeNode("Widgets Alignment"))
- {
- static float f = 0.0f;
- ImGui::Text("Fixed: 100 pixels");
- ImGui::PushItemWidth(100);
- ImGui::InputFloat("float##1", &f);
- ImGui::PopItemWidth();
-
- ImGui::Text("Proportional: 50%% of window width");
- ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
- ImGui::InputFloat("float##2", &f);
- ImGui::PopItemWidth();
-
- ImGui::Text("Right-aligned: Leave 100 pixels for label");
- ImGui::PushItemWidth(-100);
- ImGui::InputFloat("float##3", &f);
- ImGui::PopItemWidth();
-
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Basic Horizontal Layout"))
- {
- ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceeding item)");
-
- // Text
- ImGui::Text("Two items: Hello");
- ImGui::SameLine();
- ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
-
- // Adjust spacing
- ImGui::Text("More spacing: Hello");
- ImGui::SameLine(0, 20);
- ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
-
- // Button
- ImGui::AlignFirstTextHeightToWidgets();
- ImGui::Text("Normal buttons"); ImGui::SameLine();
- ImGui::Button("Banana"); ImGui::SameLine();
- ImGui::Button("Apple"); ImGui::SameLine();
- ImGui::Button("Corniflower");
-
- // Button
- ImGui::Text("Small buttons"); ImGui::SameLine();
- ImGui::SmallButton("Like this one"); ImGui::SameLine();
- ImGui::Text("can fit within a text block.");
-
- // Aligned to arbitrary position. Easy/cheap column.
- ImGui::Text("Aligned");
- ImGui::SameLine(150); ImGui::Text("x=150");
- ImGui::SameLine(300); ImGui::Text("x=300");
- ImGui::Text("Aligned");
- ImGui::SameLine(150); ImGui::SmallButton("x=150");
- ImGui::SameLine(300); ImGui::SmallButton("x=300");
-
- // Checkbox
- static bool c1=false,c2=false,c3=false,c4=false;
- ImGui::Checkbox("My", &c1); ImGui::SameLine();
- ImGui::Checkbox("Tailor", &c2); ImGui::SameLine();
- ImGui::Checkbox("Is", &c3); ImGui::SameLine();
- ImGui::Checkbox("Rich", &c4);
-
- // Various
- static float f0=1.0f, f1=2.0f, f2=3.0f;
- ImGui::PushItemWidth(80);
- const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
- static int item = -1;
- ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
- ImGui::SliderFloat("X", &f0, 0.0f,5.0f); ImGui::SameLine();
- ImGui::SliderFloat("Y", &f1, 0.0f,5.0f); ImGui::SameLine();
- ImGui::SliderFloat("Z", &f2, 0.0f,5.0f);
- ImGui::PopItemWidth();
-
- ImGui::PushItemWidth(80);
- ImGui::Text("Lists:");
- static int selection[4] = { 0, 1, 2, 3 };
- for (int i = 0; i < 4; i++)
- {
- if (i > 0) ImGui::SameLine();
- ImGui::PushID(i);
- ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items));
- ImGui::PopID();
- //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i);
- }
- ImGui::PopItemWidth();
-
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Groups"))
- {
- ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items)");
-
- ImVec2 size;
- ImGui::BeginGroup();
- {
- ImGui::BeginGroup();
- ImGui::Button("AAA");
- ImGui::SameLine();
- ImGui::Button("BBB");
- ImGui::SameLine();
- ImGui::BeginGroup();
- ImGui::Button("CCC");
- ImGui::Button("DDD");
- ImGui::EndGroup();
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("Group hovered");
- ImGui::SameLine();
- ImGui::Button("EEE");
- ImGui::EndGroup();
-
- // Capture the group size and create widgets using the same size
- size = ImGui::GetItemRectSize();
- const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f };
- ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size);
- }
- ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
- ImGui::SameLine();
- ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
- ImGui::EndGroup();
- ImGui::SameLine();
-
- ImGui::Button("LEVERAGE\nBUZZWORD", size);
- ImGui::SameLine();
-
- ImGui::ListBoxHeader("List", size);
- ImGui::Selectable("Selected", true);
- ImGui::Selectable("Not Selected", false);
- ImGui::ListBoxFooter();
-
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Text Baseline Alignment"))
- {
- ImGui::TextWrapped("(This is testing the vertical alignment that occurs on text to keep it at the same baseline as widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets)");
-
- ImGui::Text("One\nTwo\nThree"); ImGui::SameLine();
- ImGui::Text("Hello\nWorld"); ImGui::SameLine();
- ImGui::Text("Banana");
-
- ImGui::Text("Banana"); ImGui::SameLine();
- ImGui::Text("Hello\nWorld"); ImGui::SameLine();
- ImGui::Text("One\nTwo\nThree");
-
- ImGui::Button("HOP"); ImGui::SameLine();
- ImGui::Text("Banana"); ImGui::SameLine();
- ImGui::Text("Hello\nWorld"); ImGui::SameLine();
- ImGui::Text("Banana");
-
- ImGui::Button("HOP"); ImGui::SameLine();
- ImGui::Text("Hello\nWorld"); ImGui::SameLine();
- ImGui::Text("Banana");
-
- ImGui::Button("TEST"); ImGui::SameLine();
- ImGui::Text("TEST"); ImGui::SameLine();
- ImGui::SmallButton("TEST");
-
- ImGui::AlignFirstTextHeightToWidgets(); // If your line starts with text, call this to align it to upcoming widgets.
- ImGui::Text("Text aligned to Widget"); ImGui::SameLine();
- ImGui::Button("Widget"); ImGui::SameLine();
- ImGui::Text("Widget"); ImGui::SameLine();
- ImGui::SmallButton("Widget");
-
- ImGui::TreePop();
- }
- }
-
- if (ImGui::CollapsingHeader("Child regions"))
- {
- ImGui::Text("Without border");
- static int line = 50;
- bool goto_line = ImGui::Button("Goto");
- ImGui::SameLine();
- ImGui::PushItemWidth(100);
- goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
- ImGui::PopItemWidth();
- ImGui::BeginChild("Sub1", ImVec2(ImGui::GetWindowWidth() * 0.5f,300));
- for (int i = 0; i < 100; i++)
- {
- ImGui::Text("%04d: scrollable region", i);
- if (goto_line && line == i)
- ImGui::SetScrollPosHere();
- }
- if (goto_line && line >= 100)
- ImGui::SetScrollPosHere();
- ImGui::EndChild();
-
- ImGui::SameLine();
-
- ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, 5.0f);
- ImGui::BeginChild("Sub2", ImVec2(0,300), true);
- ImGui::Text("With border");
- ImGui::Columns(2);
- for (int i = 0; i < 100; i++)
- {
- if (i == 50)
- ImGui::NextColumn();
- char buf[32];
- ImFormatString(buf, IM_ARRAYSIZE(buf), "%08x", i*5731);
- ImGui::Button(buf);
- }
- ImGui::EndChild();
- ImGui::PopStyleVar();
- }
-
- if (ImGui::CollapsingHeader("Columns"))
- {
- // Basic columns
- ImGui::Text("Basic:");
- ImGui::Columns(4, "mycolumns");
- ImGui::Separator();
- ImGui::Text("ID"); ImGui::NextColumn();
- ImGui::Text("Name"); ImGui::NextColumn();
- ImGui::Text("Path"); ImGui::NextColumn();
- ImGui::Text("Flags"); ImGui::NextColumn();
- ImGui::Separator();
- const char* names[3] = { "Robert", "Stephanie", "C64" };
- const char* paths[3] = { "/path/robert", "/path/stephanie", "/path/computer" };
- for (int i = 0; i < 3; i++)
- {
- ImGui::Text("%04d", i); ImGui::NextColumn();
- ImGui::Text(names[i]); ImGui::NextColumn();
- ImGui::Text(paths[i]); ImGui::NextColumn();
- ImGui::Text("...."); ImGui::NextColumn();
- }
- ImGui::Columns(1);
-
- ImGui::Separator();
- ImGui::Spacing();
-
- // Scrolling columns
- /*
- ImGui::Text("Scrolling:");
- ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y));
- ImGui::Columns(3);
- ImGui::Text("ID"); ImGui::NextColumn();
- ImGui::Text("Name"); ImGui::NextColumn();
- ImGui::Text("Path"); ImGui::NextColumn();
- ImGui::Columns(1);
- ImGui::Separator();
- ImGui::EndChild();
- ImGui::BeginChild("##scrollingregion", ImVec2(0, 60));
- ImGui::Columns(3);
- for (int i = 0; i < 10; i++)
- {
- ImGui::Text("%04d", i); ImGui::NextColumn();
- ImGui::Text("Foobar"); ImGui::NextColumn();
- ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn();
- }
- ImGui::Columns(1);
- ImGui::EndChild();
-
- ImGui::Separator();
- ImGui::Spacing();
- */
-
- // Create multiple items in a same cell before switching to next column
- ImGui::Text("Mixed items:");
- ImGui::Columns(3, "mixed");
- ImGui::Separator();
-
- static int e = 0;
- ImGui::Text("Hello");
- ImGui::Button("Banana");
- ImGui::RadioButton("radio a", &e, 0);
- ImGui::NextColumn();
-
- ImGui::Text("ImGui");
- ImGui::Button("Apple");
- ImGui::RadioButton("radio b", &e, 1);
- static float foo = 1.0f;
- ImGui::InputFloat("red", &foo, 0.05f, 0, 3);
- ImGui::Text("An extra line here.");
- ImGui::NextColumn();
-
- ImGui::Text("Sailor");
- ImGui::Button("Corniflower");
- ImGui::RadioButton("radio c", &e, 2);
- static float bar = 1.0f;
- ImGui::InputFloat("blue", &bar, 0.05f, 0, 3);
- ImGui::NextColumn();
-
- if (ImGui::CollapsingHeader("Category A")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
- if (ImGui::CollapsingHeader("Category B")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
- if (ImGui::CollapsingHeader("Category C")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
- ImGui::Columns(1);
-
- ImGui::Separator();
- ImGui::Spacing();
-
- // Tree items
- ImGui::Text("Tree items:");
- ImGui::Columns(2, "tree items");
- ImGui::Separator();
- if (ImGui::TreeNode("Hello")) { ImGui::BulletText("Sailor"); ImGui::TreePop(); } ImGui::NextColumn();
- if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Marin"); ImGui::TreePop(); } ImGui::NextColumn();
- ImGui::Columns(1);
-
- ImGui::Separator();
- ImGui::Spacing();
-
- // Word-wrapping
- ImGui::Text("Word-wrapping:");
- ImGui::Columns(2, "word-wrapping");
- ImGui::Separator();
- ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
- ImGui::Text("Hello Left");
- ImGui::NextColumn();
- ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
- ImGui::Text("Hello Right");
- ImGui::Columns(1);
-
- ImGui::Separator();
- ImGui::Spacing();
-
- if (ImGui::TreeNode("Inside a tree.."))
- {
- if (ImGui::TreeNode("node 1 (with borders)"))
- {
- ImGui::Columns(4);
- for (int i = 0; i < 8; i++)
- {
- ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
- ImGui::NextColumn();
- }
- ImGui::Columns(1);
- ImGui::TreePop();
- }
- if (ImGui::TreeNode("node 2 (without borders)"))
- {
- ImGui::Columns(4, NULL, false);
- for (int i = 0; i < 8; i++)
- {
- ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
- ImGui::NextColumn();
- }
- ImGui::Columns(1);
- ImGui::TreePop();
- }
- ImGui::TreePop();
- }
- }
-
- if (ImGui::CollapsingHeader("Filtering"))
- {
- static ImGuiTextFilter filter;
- ImGui::Text("Filter usage:\n"
- " \"\" display all lines\n"
- " \"xxx\" display lines containing \"xxx\"\n"
- " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
- " \"-xxx\" hide lines containing \"xxx\"");
- filter.Draw();
- const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
- for (size_t i = 0; i < IM_ARRAYSIZE(lines); i++)
- if (filter.PassFilter(lines[i]))
- ImGui::BulletText("%s", lines[i]);
- }
-
- if (ImGui::CollapsingHeader("Keyboard, Mouse & Focus"))
- {
- if (ImGui::TreeNode("Tabbing"))
- {
- ImGui::Text("Use TAB/SHIFT+TAB to cycle thru keyboard editable fields.");
- static char buf[32] = "dummy";
- ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
- ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
- ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
- ImGui::PushAllowKeyboardFocus(false);
- ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
- //ImGui::SameLine(); ImGui::Text("(?)"); if (ImGui::IsHovered()) ImGui::SetTooltip("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets.");
- ImGui::PopAllowKeyboardFocus();
- ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Focus from code"))
- {
- bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
- bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine();
- bool focus_3 = ImGui::Button("Focus on 3");
- int has_focus = 0;
- static char buf[128] = "click on a button to set focus";
-
- if (focus_1) ImGui::SetKeyboardFocusHere();
- ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
- if (ImGui::IsItemActive()) has_focus = 1;
-
- if (focus_2) ImGui::SetKeyboardFocusHere();
- ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
- if (ImGui::IsItemActive()) has_focus = 2;
-
- ImGui::PushAllowKeyboardFocus(false);
- if (focus_3) ImGui::SetKeyboardFocusHere();
- ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
- if (ImGui::IsItemActive()) has_focus = 3;
- ImGui::PopAllowKeyboardFocus();
- if (has_focus)
- ImGui::Text("Item with focus: %d", has_focus);
- else
- ImGui::Text("Item with focus: <none>");
- ImGui::TextWrapped("Cursor & selection are preserved when refocusing last used item in code.");
- ImGui::TreePop();
- }
-
- if (ImGui::TreeNode("Mouse cursors"))
- {
- ImGui::TextWrapped("(Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. You can also set io.MouseDrawCursor to ask ImGui to render the cursor for you in software)");
- ImGui::Checkbox("io.MouseDrawCursor", &ImGui::GetIO().MouseDrawCursor);
- ImGui::Text("Hover to see mouse cursors:");
- for (int i = 0; i < ImGuiMouseCursor_Count_; i++)
- {
- char label[32];
- sprintf(label, "Mouse cursor %d", i);
- ImGui::Bullet(); ImGui::Selectable(label, false);
- if (ImGui::IsItemHovered())
- ImGui::SetMouseCursor(i);
- }
- ImGui::TreePop();
- }
- }
-
- if (ImGui::CollapsingHeader("App Examples"))
- {
- ImGui::Checkbox("Metrics", &show_app_metrics);
- ImGui::Checkbox("Console", &show_app_console);
- ImGui::Checkbox("Long text display", &show_app_long_text);
- ImGui::Checkbox("Auto-resizing window", &show_app_auto_resize);
- ImGui::Checkbox("Simple overlay", &show_app_fixed_overlay);
- ImGui::Checkbox("Manipulating window title", &show_app_manipulating_window_title);
- ImGui::Checkbox("Custom rendering", &show_app_custom_rendering);
- }
-
- ImGui::End();
-}
-
void ImGui::ShowMetricsWindow(bool* opened)
{
if (ImGui::Begin("ImGui Metrics", opened))
{
ImGui::Text("ImGui %s", ImGui::GetVersion());
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
- ImGui::Text("%d vertices", ImGui::GetIO().MetricsRenderVertices);
+ ImGui::Text("%d vertices, %d indices (%d triangles)", ImGui::GetIO().MetricsRenderVertices, ImGui::GetIO().MetricsRenderIndices, ImGui::GetIO().MetricsRenderIndices / 3);
+ ImGui::Text("%d allocations", ImGui::GetIO().MetricsAllocs);
+ static bool show_clip_rects = true;
+ ImGui::Checkbox("Show clipping rectangles when hovering a ImDrawCmd", &show_clip_rects);
ImGui::Separator();
struct Funcs
{
static void NodeDrawList(ImDrawList* draw_list, const char* label)
{
- bool node_opened = ImGui::TreeNode(draw_list, "%s: %d vtx, %d cmds", label, draw_list->vtx_buffer.size(), draw_list->commands.size());
+ bool node_opened = ImGui::TreeNode(draw_list, "%s: '%s' %d vtx, %d indices, %d cmds", label, draw_list->_OwnerName ? draw_list->_OwnerName : "", draw_list->VtxBuffer.Size, draw_list->IdxBuffer.Size, draw_list->CmdBuffer.Size);
if (draw_list == ImGui::GetWindowDrawList())
{
ImGui::SameLine();
@@ -10838,19 +9091,36 @@ void ImGui::ShowMetricsWindow(bool* opened)
}
if (!node_opened)
return;
- for (const ImDrawCmd* pcmd = draw_list->commands.begin(); pcmd < draw_list->commands.end(); pcmd++)
- if (pcmd->user_callback)
- ImGui::BulletText("Callback %p, user_data %p", pcmd->user_callback, pcmd->user_callback_data);
+
+ int elem_offset = 0;
+ for (const ImDrawCmd* pcmd = draw_list->CmdBuffer.begin(); pcmd < draw_list->CmdBuffer.end(); elem_offset += pcmd->ElemCount, pcmd++)
+ {
+ if (pcmd->UserCallback)
+ ImGui::BulletText("Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData);
else
- ImGui::BulletText("Draw %d vtx, tex = %p", pcmd->vtx_count, pcmd->texture_id);
+ {
+ ImGui::BulletText("Draw %d indexed vtx, tex = %p, clip_rect = (%.0f,%.0f)..(%.0f,%.0f)", pcmd->ElemCount, pcmd->TextureId, pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
+ if (show_clip_rects && ImGui::IsItemHovered())
+ {
+ ImRect clip_rect = pcmd->ClipRect;
+ ImRect vtxs_rect;
+ for (int i = elem_offset; i < elem_offset + (int)pcmd->ElemCount; i++)
+ vtxs_rect.Add(draw_list->VtxBuffer[draw_list->IdxBuffer[i]].pos);
+ GImGui->OverlayDrawList.PushClipRectFullScreen();
+ clip_rect.Round(); GImGui->OverlayDrawList.AddRect(clip_rect.Min, clip_rect.Max, ImColor(255,255,0));
+ vtxs_rect.Round(); GImGui->OverlayDrawList.AddRect(vtxs_rect.Min, vtxs_rect.Max, ImColor(255,0,255));
+ GImGui->OverlayDrawList.PopClipRect();
+ }
+ }
+ }
ImGui::TreePop();
}
static void NodeWindows(ImVector<ImGuiWindow*>& windows, const char* label)
{
- if (!ImGui::TreeNode(label, "%s (%d)", label, (int)windows.size()))
+ if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size))
return;
- for (int i = 0; i < (int)windows.size(); i++)
+ for (int i = 0; i < windows.Size; i++)
Funcs::NodeWindow(windows[i], "Window");
ImGui::TreePop();
}
@@ -10861,7 +9131,8 @@ void ImGui::ShowMetricsWindow(bool* opened)
return;
NodeDrawList(window->DrawList, "DrawList");
if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow");
- if (window->DC.ChildWindows.size() > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows");
+ if (window->DC.ChildWindows.Size > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows");
+ ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.Size * (int)sizeof(ImGuiStorage::Pair));
ImGui::TreePop();
}
};
@@ -10869,795 +9140,35 @@ void ImGui::ShowMetricsWindow(bool* opened)
ImGuiState& g = *GImGui; // Access private state
g.DisableHideTextAfterDoubleHash++; // Not exposed (yet). Disable processing that hides text after '##' markers.
Funcs::NodeWindows(g.Windows, "Windows");
- if (ImGui::TreeNode("DrawList", "Active DrawLists (%d)", (int)g.RenderDrawLists[0].size()))
+ if (ImGui::TreeNode("DrawList", "Active DrawLists (%d)", g.RenderDrawLists[0].Size))
{
- for (int i = 0; i < (int)g.RenderDrawLists[0].size(); i++)
+ for (int i = 0; i < g.RenderDrawLists[0].Size; i++)
Funcs::NodeDrawList(g.RenderDrawLists[0][i], "DrawList");
ImGui::TreePop();
}
- g.DisableHideTextAfterDoubleHash--;
- }
- ImGui::End();
-}
-
-static void ShowExampleAppAutoResize(bool* opened)
-{
- if (!ImGui::Begin("Example: Auto-Resizing Window", opened, ImGuiWindowFlags_AlwaysAutoResize))
- {
- ImGui::End();
- return;
- }
-
- static int lines = 10;
- ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
- ImGui::SliderInt("Number of lines", &lines, 1, 20);
- for (int i = 0; i < lines; i++)
- ImGui::Text("%*sThis is line %d", i*4, "", i); // Pad with space to extend size horizontally
-
- ImGui::End();
-}
-
-static void ShowExampleAppFixedOverlay(bool* opened)
-{
- ImGui::SetNextWindowPos(ImVec2(10,10));
- if (!ImGui::Begin("Example: Fixed Overlay", opened, ImVec2(0,0), 0.3f, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoSavedSettings))
- {
- ImGui::End();
- return;
- }
-
- ImGui::Text("Simple overlay\non the top-left side of the screen.");
- ImGui::Separator();
- ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
-
- ImGui::End();
-}
-
-static void ShowExampleAppManipulatingWindowTitle(bool* opened)
-{
- (void)opened;
-
- // By default, Windows are uniquely identified by their title.
- // You can use the "##" and "###" markers to manipulate the display/ID. Read FAQ at the top of this file!
-
- // Using "##" to display same title but have unique identifier.
- ImGui::SetNextWindowPos(ImVec2(100,100), ImGuiSetCond_FirstUseEver);
- ImGui::Begin("Same title as another window##1");
- ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
- ImGui::End();
-
- ImGui::SetNextWindowPos(ImVec2(100,200), ImGuiSetCond_FirstUseEver);
- ImGui::Begin("Same title as another window##2");
- ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
- ImGui::End();
-
- // Using "###" to display a changing title but keep a static identifier "AnimatedTitle"
- char buf[128];
- ImFormatString(buf, IM_ARRAYSIZE(buf), "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime()/0.25f)&3], rand());
- ImGui::SetNextWindowPos(ImVec2(100,300), ImGuiSetCond_FirstUseEver);
- ImGui::Begin(buf);
- ImGui::Text("This window has a changing title.");
- ImGui::End();
-}
-
-static void ShowExampleAppCustomRendering(bool* opened)
-{
- ImGui::SetNextWindowSize(ImVec2(300,350), ImGuiSetCond_FirstUseEver);
- if (!ImGui::Begin("Example: Custom Rendering", opened))
- {
- ImGui::End();
- return;
- }
-
- // Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc.
- // Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4.
- // ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types)
- // In this example we aren't using the operators.
-
- static ImVector<ImVec2> points;
- static bool adding_line = false;
- if (ImGui::Button("Clear")) points.clear();
- if (points.size() >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } }
- ImGui::Text("Left-click and drag to add lines");
- ImGui::Text("Right-click to undo");
-
- ImDrawList* draw_list = ImGui::GetWindowDrawList();
-
- // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered()
- // However you can draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos().
- // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max).
- ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates!
- 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
- draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), 0xFFFFFFFF);
- bool adding_preview = false;
- ImGui::InvisibleButton("canvas", canvas_size);
- if (ImGui::IsItemHovered())
- {
- ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y);
- if (!adding_line && ImGui::GetIO().MouseClicked[0])
- {
- points.push_back(mouse_pos_in_canvas);
- adding_line = true;
- }
- if (adding_line)
- {
- adding_preview = true;
- points.push_back(mouse_pos_in_canvas);
- if (!ImGui::GetIO().MouseDown[0])
- adding_line = adding_preview = false;
- }
- if (ImGui::GetIO().MouseClicked[1] && !points.empty())
- {
- adding_line = false;
- points.pop_back();
- points.pop_back();
- }
- }
- draw_list->PushClipRect(ImVec4(canvas_pos.x, canvas_pos.y, canvas_pos.x+canvas_size.x, canvas_pos.y+canvas_size.y)); // clip lines within the canvas (if we resize it, etc.)
- for (int i = 0; i < (int)points.size() - 1; i += 2)
- draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i+1].x, canvas_pos.y + points[i+1].y), 0xFF00FFFF);
- draw_list->PopClipRect();
- if (adding_preview)
- points.pop_back();
- ImGui::End();
-}
-
-struct ExampleAppConsole
-{
- char InputBuf[256];
- ImVector<char*> Items;
- bool ScrollToBottom;
- ImVector<char*> History;
- int HistoryPos; // -1: new line, 0..History.size()-1 browsing history.
- ImVector<const char*> Commands;
-
- ExampleAppConsole()
- {
- ClearLog();
- HistoryPos = -1;
- Commands.push_back("HELP");
- Commands.push_back("HISTORY");
- Commands.push_back("CLEAR");
- Commands.push_back("CLASSIFY"); // "classify" is here to provide an example of "C"+[tab] completing to "CL" and displaying matches.
- }
- ~ExampleAppConsole()
- {
- ClearLog();
- for (size_t i = 0; i < Items.size(); i++)
- ImGui::MemFree(History[i]);
- }
-
- void ClearLog()
- {
- for (size_t i = 0; i < Items.size(); i++)
- ImGui::MemFree(Items[i]);
- Items.clear();
- ScrollToBottom = true;
- }
-
- void AddLog(const char* fmt, ...)
- {
- char buf[1024];
- va_list args;
- va_start(args, fmt);
- ImFormatStringV(buf, IM_ARRAYSIZE(buf), fmt, args);
- va_end(args);
- Items.push_back(ImStrdup(buf));
- ScrollToBottom = true;
- }
-
- void Run(const char* title, bool* opened)
- {
- ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
- if (!ImGui::Begin(title, opened))
- {
- ImGui::End();
- return;
- }
-
- ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
- ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion.");
-
- // TODO: display from bottom
- // TODO: clip manually
-
- if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.size()); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine();
- if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
- if (ImGui::SmallButton("Clear")) ClearLog();
- //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); }
-
- ImGui::Separator();
-
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
- static ImGuiTextFilter filter;
- filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180);
- //if (ImGui::IsItemHovered()) ImGui::SetKeyboardFocusHere(-1); // Auto focus on hover
- ImGui::PopStyleVar();
- ImGui::Separator();
-
- // 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());
- // 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.
- // 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.
- ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetTextLineHeightWithSpacing()*2));
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing
- for (size_t i = 0; i < Items.size(); i++)
- {
- const char* item = Items[i];
- if (!filter.PassFilter(item))
- continue;
- ImVec4 col(1,1,1,1); // A better implement may store a type per-item. For the sample let's just parse the text.
- if (strstr(item, "[error]")) col = ImVec4(1.0f,0.4f,0.4f,1.0f);
- else if (strncmp(item, "# ", 2) == 0) col = ImVec4(1.0f,0.8f,0.6f,1.0f);
- ImGui::PushStyleColor(ImGuiCol_Text, col);
- ImGui::TextUnformatted(item);
- ImGui::PopStyleColor();
- }
- if (ScrollToBottom)
- ImGui::SetScrollPosHere();
- ScrollToBottom = false;
- ImGui::PopStyleVar();
- ImGui::EndChild();
- ImGui::Separator();
-
- // Command-line
- if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this))
+ if (ImGui::TreeNode("Popups", "Opened Popups Stack (%d)", g.OpenedPopupStack.Size))
{
- char* input_end = InputBuf+strlen(InputBuf);
- while (input_end > InputBuf && input_end[-1] == ' ') input_end--; *input_end = 0;
- if (InputBuf[0])
- ExecCommand(InputBuf);
- strcpy(InputBuf, "");
- }
-
- // Demonstrate keeping auto focus on the input box
- if (ImGui::IsItemHovered() || (ImGui::IsRootWindowOrAnyChildFocused() && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)))
- ImGui::SetKeyboardFocusHere(-1); // Auto focus
-
- ImGui::End();
- }
-
- void ExecCommand(const char* command_line)
- {
- AddLog("# %s\n", command_line);
-
- // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal.
- HistoryPos = -1;
- for (int i = (int)History.size()-1; i >= 0; i--)
- if (ImStricmp(History[i], command_line) == 0)
+ for (int i = 0; i < g.OpenedPopupStack.Size; i++)
{
- ImGui::MemFree(History[i]);
- History.erase(History.begin() + i);
- break;
+ ImGuiWindow* window = g.OpenedPopupStack[i].Window;
+ ImGui::BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenedPopupStack[i].PopupID, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : "");
}
- History.push_back(ImStrdup(command_line));
-
- // Process command
- if (ImStricmp(command_line, "CLEAR") == 0)
- {
- ClearLog();
- }
- else if (ImStricmp(command_line, "HELP") == 0)
- {
- AddLog("Commands:");
- for (size_t i = 0; i < Commands.size(); i++)
- AddLog("- %s", Commands[i]);
- }
- else if (ImStricmp(command_line, "HISTORY") == 0)
- {
- for (size_t i = History.size() >= 10 ? History.size() - 10 : 0; i < History.size(); i++)
- AddLog("%3d: %s\n", i, History[i]);
+ ImGui::TreePop();
}
- else
+ if (ImGui::TreeNode("Basic state"))
{
- AddLog("Unknown command: '%s'\n", command_line);
- }
- }
-
- static int TextEditCallbackStub(ImGuiTextEditCallbackData* data)
- {
- ExampleAppConsole* console = (ExampleAppConsole*)data->UserData;
- return console->TextEditCallback(data);
- }
-
- int TextEditCallback(ImGuiTextEditCallbackData* data)
- {
- //AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd);
- switch (data->EventFlag)
- {
- case ImGuiInputTextFlags_CallbackCompletion:
- {
- // Example of TEXT COMPLETION
-
- // Locate beginning of current word
- const char* word_end = data->Buf + data->CursorPos;
- const char* word_start = word_end;
- while (word_start > data->Buf)
- {
- const char c = word_start[-1];
- if (ImCharIsSpace(c) || c == ',' || c == ';')
- break;
- word_start--;
- }
-
- // Build a list of candidates
- ImVector<const char*> candidates;
- for (size_t i = 0; i < Commands.size(); i++)
- if (ImStrnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0)
- candidates.push_back(Commands[i]);
-
- if (candidates.size() == 0)
- {
- // No match
- AddLog("No match for \"%.*s\"!\n", word_end-word_start, word_start);
- }
- else if (candidates.size() == 1)
- {
- // Single match. Delete the beginning of the word and replace it entirely so we've got nice casing
- data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start));
- data->InsertChars(data->CursorPos, candidates[0]);
- data->InsertChars(data->CursorPos, " ");
- }
- else
- {
- // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY"
- int match_len = (int)(word_end - word_start);
- for (;;)
- {
- int c = 0;
- bool all_candidates_matches = true;
- for (size_t i = 0; i < candidates.size() && all_candidates_matches; i++)
- if (i == 0)
- c = toupper(candidates[i][match_len]);
- else if (c != toupper(candidates[i][match_len]))
- all_candidates_matches = false;
- if (!all_candidates_matches)
- break;
- match_len++;
- }
-
- if (match_len > 0)
- {
- data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start));
- data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len);
- }
-
- // List matches
- AddLog("Possible matches:\n");
- for (size_t i = 0; i < candidates.size(); i++)
- AddLog("- %s\n", candidates[i]);
- }
-
- break;
- }
- case ImGuiInputTextFlags_CallbackHistory:
- {
- // Example of HISTORY
- const int prev_history_pos = HistoryPos;
- if (data->EventKey == ImGuiKey_UpArrow)
- {
- if (HistoryPos == -1)
- HistoryPos = (int)(History.size() - 1);
- else if (HistoryPos > 0)
- HistoryPos--;
- }
- else if (data->EventKey == ImGuiKey_DownArrow)
- {
- if (HistoryPos != -1)
- if (++HistoryPos >= (int)History.size())
- HistoryPos = -1;
- }
-
- // A better implementation would preserve the data on the current input line along with cursor position.
- if (prev_history_pos != HistoryPos)
- {
- ImFormatString(data->Buf, data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
- data->BufDirty = true;
- data->CursorPos = data->SelectionStart = data->SelectionEnd = (int)strlen(data->Buf);
- }
- }
+ ImGui::Text("FocusedWindow: '%s'", g.FocusedWindow ? g.FocusedWindow->Name : "NULL");
+ ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
+ ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL");
+ ImGui::Text("HoveredID: 0x%08X/0x%08X", g.HoveredId, g.HoveredIdPreviousFrame); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
+ ImGui::Text("ActiveID: 0x%08X/0x%08X", g.ActiveId, g.ActiveIdPreviousFrame);
+ ImGui::TreePop();
}
- return 0;
- }
-};
-
-static void ShowExampleAppConsole(bool* opened)
-{
- static ExampleAppConsole console;
- console.Run("Example: Console", opened);
-}
-
-static void ShowExampleAppLongText(bool* opened)
-{
- ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
- if (!ImGui::Begin("Example: Long text display", opened))
- {
- ImGui::End();
- return;
- }
-
- static int test_type = 0;
- static ImGuiTextBuffer log;
- static int lines = 0;
- ImGui::Text("Printing unusually long amount of text.");
- ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped");
- ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
- if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
- ImGui::SameLine();
- if (ImGui::Button("Add 1000 lines"))
- {
- for (int i = 0; i < 1000; i++)
- log.append("%i The quick brown fox jumps over the lazy dog\n", lines+i);
- lines += 1000;
- }
- ImGui::BeginChild("Log");
- switch (test_type)
- {
- case 0:
- // Single call to TextUnformatted() with a big buffer
- ImGui::TextUnformatted(log.begin(), log.end());
- break;
- case 1:
- // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the CalcListClipping() helper.
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
- int display_start, display_end;
- ImGui::CalcListClipping(lines, ImGui::GetTextLineHeight(), &display_start, &display_end);
- ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * ImGui::GetTextLineHeight());
- for (int i = display_start; i < display_end; i++)
- ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
- ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (lines - display_end) * ImGui::GetTextLineHeight());
- ImGui::PopStyleVar();
- break;
- case 2:
- // Multiple calls to Text(), not clipped
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
- for (int i = 0; i < lines; i++)
- ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
- ImGui::PopStyleVar();
- break;
+ g.DisableHideTextAfterDoubleHash--;
}
- ImGui::EndChild();
ImGui::End();
}
-// End of Sample code
-#endif
-
-//-----------------------------------------------------------------------------
-// FONT DATA
-//-----------------------------------------------------------------------------
-// Compressed with stb_compress() then converted to a C array.
-// Use the program in extra_fonts/binary_to_compressed_c.cpp to create the array from a TTF file.
-// Decompressor from stb.h (public domain) by Sean Barrett https://github.com/nothings/stb/blob/master/stb.h
-//-----------------------------------------------------------------------------
-
-static unsigned int stb_decompress_length(unsigned char *input)
-{
- return (input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11];
-}
-
-static unsigned char *stb__barrier, *stb__barrier2, *stb__barrier3, *stb__barrier4;
-static unsigned char *stb__dout;
-static void stb__match(unsigned char *data, unsigned int length)
-{
- // INVERSE of memmove... write each byte before copying the next...
- IM_ASSERT (stb__dout + length <= stb__barrier);
- if (stb__dout + length > stb__barrier) { stb__dout += length; return; }
- if (data < stb__barrier4) { stb__dout = stb__barrier+1; return; }
- while (length--) *stb__dout++ = *data++;
-}
-
-static void stb__lit(unsigned char *data, unsigned int length)
-{
- IM_ASSERT (stb__dout + length <= stb__barrier);
- if (stb__dout + length > stb__barrier) { stb__dout += length; return; }
- if (data < stb__barrier2) { stb__dout = stb__barrier+1; return; }
- memcpy(stb__dout, data, length);
- stb__dout += length;
-}
-
-#define stb__in2(x) ((i[x] << 8) + i[(x)+1])
-#define stb__in3(x) ((i[x] << 16) + stb__in2((x)+1))
-#define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1))
-
-static unsigned char *stb_decompress_token(unsigned char *i)
-{
- if (*i >= 0x20) { // use fewer if's for cases that expand small
- if (*i >= 0x80) stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2;
- else if (*i >= 0x40) stb__match(stb__dout-(stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3;
- else /* *i >= 0x20 */ stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
- } else { // more ifs for cases that expand large, since overhead is amortized
- if (*i >= 0x18) stb__match(stb__dout-(stb__in3(0) - 0x180000 + 1), i[3]+1), i += 4;
- else if (*i >= 0x10) stb__match(stb__dout-(stb__in3(0) - 0x100000 + 1), stb__in2(3)+1), i += 5;
- else if (*i >= 0x08) stb__lit(i+2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1);
- else if (*i == 0x07) stb__lit(i+3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1);
- else if (*i == 0x06) stb__match(stb__dout-(stb__in3(1)+1), i[4]+1), i += 5;
- else if (*i == 0x04) stb__match(stb__dout-(stb__in3(1)+1), stb__in2(4)+1), i += 6;
- }
- return i;
-}
-
-static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
-{
- const unsigned long ADLER_MOD = 65521;
- unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
- unsigned long blocklen, i;
-
- blocklen = buflen % 5552;
- while (buflen) {
- for (i=0; i + 7 < blocklen; i += 8) {
- s1 += buffer[0], s2 += s1;
- s1 += buffer[1], s2 += s1;
- s1 += buffer[2], s2 += s1;
- s1 += buffer[3], s2 += s1;
- s1 += buffer[4], s2 += s1;
- s1 += buffer[5], s2 += s1;
- s1 += buffer[6], s2 += s1;
- s1 += buffer[7], s2 += s1;
-
- buffer += 8;
- }
-
- for (; i < blocklen; ++i)
- s1 += *buffer++, s2 += s1;
-
- s1 %= ADLER_MOD, s2 %= ADLER_MOD;
- buflen -= blocklen;
- blocklen = 5552;
- }
- return (unsigned int)(s2 << 16) + (unsigned int)s1;
-}
-
-static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length)
-{
- unsigned int olen;
- if (stb__in4(0) != 0x57bC0000) return 0;
- if (stb__in4(4) != 0) return 0; // error! stream is > 4GB
- olen = stb_decompress_length(i);
- stb__barrier2 = i;
- stb__barrier3 = i+length;
- stb__barrier = output + olen;
- stb__barrier4 = output;
- i += 16;
-
- stb__dout = output;
- for (;;) {
- unsigned char *old_i = i;
- i = stb_decompress_token(i);
- if (i == old_i) {
- if (*i == 0x05 && i[1] == 0xfa) {
- IM_ASSERT(stb__dout == output + olen);
- if (stb__dout != output + olen) return 0;
- if (stb_adler32(1, output, olen) != (unsigned int) stb__in4(2))
- return 0;
- return olen;
- } else {
- IM_ASSERT(0); /* NOTREACHED */
- return 0;
- }
- }
- IM_ASSERT(stb__dout <= output + olen);
- if (stb__dout > output + olen)
- return 0;
- }
-}
-
-//-----------------------------------------------------------------------------
-// ProggyClean.ttf
-// Copyright (c) 2004, 2005 Tristan Grimmer
-// MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
-// Download and more information at http://upperbounds.net
-//-----------------------------------------------------------------------------
-static const unsigned int proggy_clean_ttf_compressed_size = 9583;
-static const unsigned int proggy_clean_ttf_compressed_data[9584/4] =
-{
- 0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
- 0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
- 0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
- 0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
- 0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
- 0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
- 0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
- 0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
- 0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
- 0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
- 0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
- 0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
- 0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
- 0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
- 0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
- 0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
- 0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
- 0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
- 0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
- 0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
- 0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
- 0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
- 0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
- 0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
- 0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
- 0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
- 0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
- 0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
- 0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
- 0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
- 0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
- 0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
- 0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
- 0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
- 0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
- 0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
- 0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
- 0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
- 0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
- 0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
- 0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
- 0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
- 0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
- 0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
- 0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
- 0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
- 0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
- 0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
- 0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
- 0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
- 0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
- 0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
- 0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
- 0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
- 0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
- 0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
- 0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
- 0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
- 0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
- 0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
- 0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
- 0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
- 0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
- 0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
- 0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
- 0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
- 0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
- 0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
- 0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
- 0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
- 0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
- 0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
- 0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
- 0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
- 0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
- 0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
- 0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
- 0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
- 0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
- 0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
- 0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
- 0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
- 0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
- 0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
- 0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
- 0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
- 0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
- 0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
- 0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
- 0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
- 0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
- 0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
- 0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
- 0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
- 0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
- 0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
- 0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
- 0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
- 0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
- 0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
- 0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
- 0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
- 0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
- 0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
- 0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
- 0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
- 0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
- 0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
- 0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
- 0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
- 0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
- 0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
- 0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
- 0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
- 0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
- 0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
- 0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
- 0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
- 0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
- 0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
- 0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
- 0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
- 0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
- 0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
- 0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
- 0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
- 0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
- 0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
- 0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
- 0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
- 0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
- 0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
- 0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
- 0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
- 0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
- 0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
- 0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
- 0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
- 0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
- 0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
- 0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
- 0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
- 0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
- 0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
- 0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
- 0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
- 0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
- 0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
- 0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
- 0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
- 0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
- 0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
- 0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
- 0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
- 0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
- 0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
- 0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
- 0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
- 0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
- 0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
- 0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
- 0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
- 0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
- 0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
- 0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
- 0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
- 0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
- 0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
- 0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
- 0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
- 0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
- 0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
- 0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
- 0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
- 0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
- 0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
- 0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
- 0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
- 0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
- 0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
- 0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
- 0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
- 0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
- 0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
- 0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
- 0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
- 0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
- 0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
- 0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
- 0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
- 0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
- 0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
- 0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
- 0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
- 0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
- 0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
- 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
- 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
- 0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
- 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
-};
-
-static void GetDefaultCompressedFontDataTTF(const void** ttf_compressed_data, unsigned int* ttf_compressed_size)
-{
- *ttf_compressed_data = proggy_clean_ttf_compressed_data;
- *ttf_compressed_size = proggy_clean_ttf_compressed_size;
-}
-
//-----------------------------------------------------------------------------
//---- Include imgui_user.inl at the end of imgui.cpp
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
index 19a233fb081..7bb0aacc56a 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
@@ -1,24 +1,28 @@
-// ImGui library v1.39 WIP
-// See .cpp file for documentation.
-// See ImGui::ShowTestWindow() for sample code.
-// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
+// ImGui library v1.46 WIP
+// Headers
+
+// See imgui.cpp file for documentation.
+// See ImGui::ShowTestWindow() in imgui_demo.cpp for demo code.
+// Read 'Programmer guide' in imgui.cpp for notes on how to setup ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
#pragma once
+#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
#include "imconfig.h" // User-editable configuration file
+#endif
#include <float.h> // FLT_MAX
#include <stdarg.h> // va_list
#include <stddef.h> // ptrdiff_t, NULL
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
-#define IMGUI_VERSION "1.39 WIP"
+#define IMGUI_VERSION "1.46 WIP"
// Define assertion handler.
#ifndef IM_ASSERT
#include <assert.h>
-#define IM_ASSERT(_EXPR) assert(_EXPR)
+#define IM_ASSERT(_EXPR, ...) assert(_EXPR)
#endif
// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
@@ -26,9 +30,16 @@
#define IMGUI_API
#endif
+#if defined(__clang__) || defined(__GNUC__)
+#define IM_PRINTFARGS(FMT) __attribute__((format(printf, FMT, (FMT+1))))
+#else
+#define IM_PRINTFARGS(FMT)
+#endif
+
// Forward declarations
struct ImDrawCmd;
struct ImDrawList;
+struct ImDrawData;
struct ImFont;
struct ImFontAtlas;
struct ImGuiIO;
@@ -48,7 +59,8 @@ typedef int ImGuiMouseCursor; // enum ImGuiMouseCursor_
typedef int ImGuiWindowFlags; // enum ImGuiWindowFlags_
typedef int ImGuiSetCond; // enum ImGuiSetCond_
typedef int ImGuiInputTextFlags; // enum ImGuiInputTextFlags_
-struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
+typedef int ImGuiSelectableFlags; // enum ImGuiSelectableFlags_
+struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
struct ImVec2
@@ -57,7 +69,7 @@ struct ImVec2
ImVec2() { x = y = 0.0f; }
ImVec2(float _x, float _y) { x = _x; y = _y; }
-#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2.
+#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
IM_VEC2_CLASS_EXTRA
#endif
};
@@ -68,84 +80,20 @@ struct ImVec4
ImVec4() { x = y = z = w = 0.0f; }
ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
-#ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec4.
+#ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4.
IM_VEC4_CLASS_EXTRA
#endif
};
-namespace ImGui
-{
- // Proxy functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
- IMGUI_API void* MemAlloc(size_t sz);
- IMGUI_API void MemFree(void* ptr);
-}
-
-// Lightweight 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).
-// Use '#define ImVector std::vector' if you want to use the STL type or your own type.
-// Our implementation does NOT call c++ constructors because we don't use them in ImGui. Don't use this class as a straight std::vector replacement in your code!
-#ifndef ImVector
-template<typename T>
-class ImVector
-{
-protected:
- size_t Size;
- size_t Capacity;
- T* Data;
-
-public:
- typedef T value_type;
- typedef value_type* iterator;
- typedef const value_type* const_iterator;
-
- ImVector() { Size = Capacity = 0; Data = NULL; }
- ~ImVector() { if (Data) ImGui::MemFree(Data); }
-
- inline bool empty() const { return Size == 0; }
- inline size_t size() const { return Size; }
- inline size_t capacity() const { return Capacity; }
-
- inline value_type& at(size_t i) { IM_ASSERT(i < Size); return Data[i]; }
- inline const value_type& at(size_t i) const { IM_ASSERT(i < Size); return Data[i]; }
- inline value_type& operator[](size_t i) { IM_ASSERT(i < Size); return Data[i]; }
- inline const value_type& operator[](size_t i) const { IM_ASSERT(i < Size); return Data[i]; }
-
- inline void clear() { if (Data) { Size = Capacity = 0; ImGui::MemFree(Data); Data = NULL; } }
- inline iterator begin() { return Data; }
- inline const_iterator begin() const { return Data; }
- inline iterator end() { return Data + Size; }
- inline const_iterator end() const { return Data + Size; }
- inline value_type& front() { IM_ASSERT(Size > 0); return Data[0]; }
- inline const value_type& front() const { IM_ASSERT(Size > 0); return Data[0]; }
- inline value_type& back() { IM_ASSERT(Size > 0); return Data[Size-1]; }
- inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size-1]; }
- 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; }
-
- inline void resize(size_t new_size) { if (new_size > Capacity) reserve(new_size); Size = new_size; }
- inline void reserve(size_t new_capacity)
- {
- if (new_capacity <= Capacity) return;
- T* new_data = (value_type*)ImGui::MemAlloc(new_capacity * sizeof(value_type));
- memcpy(new_data, Data, Size * sizeof(value_type));
- ImGui::MemFree(Data);
- Data = new_data;
- Capacity = new_capacity;
- }
-
- inline void push_back(const value_type& v) { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
- inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
-
- inline iterator erase(const_iterator it) { IM_ASSERT(it >= begin() && it < end()); const ptrdiff_t off = it - begin(); memmove(Data + off, Data + off + 1, (Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; }
- inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= begin() && it <= end()); const ptrdiff_t off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
-};
-#endif // #ifndef ImVector
-
// Helpers at bottom of the file:
+// - class ImVector<> // Lightweight std::vector like class.
// - IMGUI_ONCE_UPON_A_FRAME // Execute a block of code once per frame only (convenient for creating UI within deep-nested code that runs multiple times)
// - struct ImGuiTextFilter // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
// - struct ImGuiTextBuffer // Text buffer for logging/accumulating text
// - struct ImGuiStorage // Custom key value storage (if you need to alter open/close states manually)
// - struct ImGuiTextEditCallbackData // Shared state of ImGui::InputText() when using custom callbacks
-// - struct ImColor // Helper functions to created packed 32-bit RGBA color values
+// - struct ImGuiListClipper // Helper to manually clip large list of items.
+// - struct ImColor // Helper functions to created packed 32-bit RGBA color values
// - struct ImDrawList // Draw command list
// - struct ImFontAtlas // Bake multiple fonts into a single texture, TTF font loader, bake glyphs into bitmap
// - struct ImFont // Single font
@@ -157,6 +105,7 @@ namespace ImGui
// Main
IMGUI_API ImGuiIO& GetIO();
IMGUI_API ImGuiStyle& GetStyle();
+ IMGUI_API ImDrawData* GetDrawData(); // same value as passed to your RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
IMGUI_API void NewFrame();
IMGUI_API void Render();
IMGUI_API void Shutdown();
@@ -166,41 +115,52 @@ namespace ImGui
IMGUI_API void ShowMetricsWindow(bool* opened = NULL); // metrics window for debugging imgui
// Window
- // See implementation in .cpp for details
- IMGUI_API bool Begin(const char* name = "Debug", bool* p_opened = NULL, ImGuiWindowFlags flags = 0); // return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false).
- IMGUI_API bool Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0); // this is the older/longer API. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! maybe obsolete this API eventually.
+ IMGUI_API bool Begin(const char* name, bool* p_opened = NULL, ImGuiWindowFlags flags = 0); // see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false).
+ IMGUI_API bool Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0); // this is the older/longer API. the extra parameters aren't very relevant. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! maybe obsolete this API eventually.
IMGUI_API void End();
- IMGUI_API bool BeginChild(const char* str_id, const 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). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
- IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
+ IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
+ IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
IMGUI_API void EndChild();
- IMGUI_API ImVec2 GetContentRegionMax(); // window or current column boundaries, in windows coordinates
- IMGUI_API ImVec2 GetWindowContentRegionMin(); // window boundaries, in windows coordinates
- IMGUI_API ImVec2 GetWindowContentRegionMax();
+ IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
+ IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
+ IMGUI_API float GetContentRegionAvailWidth(); //
+ IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min (roughly (0,0)-Scroll), in window coordinates
+ IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
+ IMGUI_API float GetWindowContentRegionWidth(); //
IMGUI_API ImDrawList* GetWindowDrawList(); // get rendering command-list if you want to append your own draw primitives
IMGUI_API ImFont* GetWindowFont();
IMGUI_API float GetWindowFontSize(); // size (also height in pixels) of current font with current scale applied
IMGUI_API void SetWindowFontScale(float scale); // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows
- 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
- IMGUI_API ImVec2 GetWindowSize(); // get current window position
+ IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList api)
+ IMGUI_API ImVec2 GetWindowSize(); // get current window size
IMGUI_API float GetWindowWidth();
- IMGUI_API bool GetWindowCollapsed();
-
- IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position - call before Begin()
- IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit
- IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set next window collapsed state
- IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most
+ IMGUI_API float GetWindowHeight();
+ IMGUI_API bool IsWindowCollapsed();
+
+ IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position. call before Begin()
+ IMGUI_API void SetNextWindowPosCenter(ImGuiSetCond cond = 0); // set next window position to be centered on screen. call before Begin()
+ IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
+ IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (enforce the range of scrollbars). set axis to 0.0f to leave it automatic. call before Begin()
+ IMGUI_API void SetNextWindowContentWidth(float width); // set next window content width (enforce the range of horizontal scrollbar). call before Begin()
+ IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set next window collapsed state. call before Begin()
+ IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set current window position - call within Begin()/End(). may incur tearing
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set current window collapsed state
IMGUI_API void SetWindowFocus(); // set current window to be focused / front-most
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing
- IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
+ IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. may incur tearing
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus.
- IMGUI_API float GetScrollPosY(); // get scrolling position [0..GetScrollMaxY()]
- IMGUI_API float GetScrollMaxY(); // get maximum scrolling position == ContentSize.Y - WindowSize.Y
- IMGUI_API void SetScrollPosHere(); // adjust scrolling position to center into the current cursor position
+ IMGUI_API float GetScrollX(); // get scrolling amount [0..GetScrollMaxX()]
+ IMGUI_API float GetScrollY(); // get scrolling amount [0..GetScrollMaxY()]
+ IMGUI_API float GetScrollMaxX(); // get maximum scrolling amount ~~ ContentSize.X - WindowSize.X
+ IMGUI_API float GetScrollMaxY(); // get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y
+ IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0..GetScrollMaxX()]
+ IMGUI_API void SetScrollY(float scroll_y); // set scrolling amount [0..GetScrollMaxY()]
+ IMGUI_API void SetScrollHere(float center_y_ratio = 0.5f); // adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom.
+ IMGUI_API void SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position valid. use GetCursorPos() or GetCursorStartPos()+offset to get valid positions.
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
IMGUI_API void SetStateStorage(ImGuiStorage* tree); // replace tree state storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
IMGUI_API ImGuiStorage* GetStateStorage();
@@ -218,27 +178,20 @@ namespace ImGui
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 -1.0f always align width to the right side)
IMGUI_API void PopItemWidth();
IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position
- IMGUI_API void PushAllowKeyboardFocus(bool v); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
- IMGUI_API void PopAllowKeyboardFocus();
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
IMGUI_API void PopTextWrapPos();
+ IMGUI_API void PushAllowKeyboardFocus(bool v); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
+ IMGUI_API void PopAllowKeyboardFocus();
+ IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (uses io.KeyRepeatDelay/io.KeyRepeatRate for now). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
+ IMGUI_API void PopButtonRepeat();
- // Tooltip
- IMGUI_API void SetTooltip(const char* fmt, ...); // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins
- IMGUI_API void SetTooltipV(const char* fmt, va_list args);
- IMGUI_API void BeginTooltip(); // use to create full-featured tooltip windows that aren't just text
- IMGUI_API void EndTooltip();
-
- // Popup
- IMGUI_API void BeginPopup(bool* p_opened);
- IMGUI_API void EndPopup();
-
- // Layout
- IMGUI_API void BeginGroup();
+ // Cursor / Layout
+ IMGUI_API void BeginGroup(); // lock horizontal starting position. once closing a group it is seen as a single item (so you can use IsItemHovered() on a group, SameLine() between groups, etc.
IMGUI_API void EndGroup();
IMGUI_API void Separator(); // horizontal line
- IMGUI_API void SameLine(int column_x = 0, int spacing_w = -1); // call between widgets or groups to layout them horizontally
- IMGUI_API void Spacing(); // add vertical spacing
+ IMGUI_API void SameLine(float local_pos_x = 0.0f, float spacing_w = -1.0f); // call between widgets or groups to layout them horizontally
+ IMGUI_API void Spacing(); // add spacing
+ IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size
IMGUI_API void Indent(); // move content position toward the right by style.IndentSpacing pixels
IMGUI_API void Unindent(); // move content position back to the left (cancel Indent)
IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border=true); // setup number of columns. use an identifier to distinguish multiple column sets. close with Columns(1).
@@ -251,45 +204,49 @@ namespace ImGui
IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position
IMGUI_API float GetCursorPosX(); // "
IMGUI_API float GetCursorPosY(); // "
- IMGUI_API void SetCursorPos(const ImVec2& pos); // "
+ IMGUI_API void SetCursorPos(const ImVec2& local_pos); // "
IMGUI_API void SetCursorPosX(float x); // "
IMGUI_API void SetCursorPosY(float y); // "
+ IMGUI_API ImVec2 GetCursorStartPos(); // initial cursor position
IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates [0..io.DisplaySize]
IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute screen coordinates [0..io.DisplaySize]
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
IMGUI_API float GetTextLineHeight(); // height of font == GetWindowFontSize()
- IMGUI_API float GetTextLineHeightWithSpacing(); // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
+ IMGUI_API float GetTextLineHeightWithSpacing(); // distance (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
+ IMGUI_API float GetItemsLineHeightWithSpacing(); // distance (in pixels) between 2 consecutive lines of standard height widgets == GetWindowFontSize() + GetStyle().FramePadding.y*2 + GetStyle().ItemSpacing.y
// ID scopes
- // If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
- // You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
+ // If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
+ // You can also use "##extra" within your widget name to distinguish them from each others. Read the FAQ for more details.
IMGUI_API void PushID(const char* str_id); // push identifier into the ID stack. IDs are hash of the *entire* stack!
IMGUI_API void PushID(const char* str_id_begin, const char* str_id_end);
IMGUI_API void PushID(const void* ptr_id);
- IMGUI_API void PushID(const int int_id);
+ IMGUI_API void PushID(int int_id);
IMGUI_API void PopID();
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed
IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end);
IMGUI_API ImGuiID GetID(const void* ptr_id);
// Widgets
- IMGUI_API void Text(const char* fmt, ...);
+ IMGUI_API void Text(const char* fmt, ...) IM_PRINTFARGS(1);
IMGUI_API void TextV(const char* fmt, va_list args);
- IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
+ IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_PRINTFARGS(2); // shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
IMGUI_API void TextColoredV(const ImVec4& col, const char* fmt, va_list args);
- IMGUI_API void TextWrapped(const char* fmt, ...); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
+ IMGUI_API void TextDisabled(const char* fmt, ...) IM_PRINTFARGS(1); // shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor();
+ IMGUI_API void TextDisabledV(const char* fmt, va_list args);
+ IMGUI_API void TextWrapped(const char* fmt, ...) IM_PRINTFARGS(1); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().
IMGUI_API void TextWrappedV(const char* fmt, va_list args);
- 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
- IMGUI_API void LabelText(const char* label, const char* fmt, ...); // display text+label aligned the same way as value+label widgets
+ 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
+ IMGUI_API void LabelText(const char* label, const char* fmt, ...) IM_PRINTFARGS(2); // display text+label aligned the same way as value+label widgets
IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args);
IMGUI_API void Bullet();
- IMGUI_API void BulletText(const char* fmt, ...);
+ IMGUI_API void BulletText(const char* fmt, ...) IM_PRINTFARGS(1);
IMGUI_API void BulletTextV(const char* fmt, va_list args);
- IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0,0), bool repeat_when_held = false);
+ IMGUI_API bool Button(const char* label, const ImVec2& size = ImVec2(0,0));
IMGUI_API bool SmallButton(const char* label);
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size);
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));
- 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 padding
+ 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,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding
IMGUI_API bool CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false);
IMGUI_API bool Checkbox(const char* label, bool* v);
IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
@@ -302,36 +259,26 @@ namespace ImGui
IMGUI_API bool ColorEdit3(const char* label, float col[3]);
IMGUI_API bool ColorEdit4(const char* label, float col[4], bool show_alpha = true);
IMGUI_API void ColorEditMode(ImGuiColorEditMode mode);
- IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
+ IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), int stride = sizeof(float));
IMGUI_API void PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
- IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
+ IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), int stride = sizeof(float));
IMGUI_API void PlotHistogram(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
- // Widgets: Sliders (tip: ctrl+click on a slider to input text)
- 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
- 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);
- IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
- IMGUI_API bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
- IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);
- IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
- IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
- IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
- IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
- IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
- IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
-
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound
IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
IMGUI_API bool DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
IMGUI_API bool DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
+ IMGUI_API bool DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", const char* display_format_max = NULL, float power = 1.0f);
IMGUI_API bool DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f"); // If v_min >= v_max we have no bound
IMGUI_API bool DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
IMGUI_API bool DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
IMGUI_API bool DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
+ IMGUI_API bool DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f", const char* display_format_max = NULL);
// Widgets: Input
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
+ IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
IMGUI_API bool InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
@@ -341,32 +288,40 @@ namespace ImGui
IMGUI_API bool InputInt3(const char* label, int v[3], ImGuiInputTextFlags extra_flags = 0);
IMGUI_API bool InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_flags = 0);
+ // Widgets: Sliders (tip: ctrl+click on a slider to input text)
+ 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
+ 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);
+ IMGUI_API bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+ IMGUI_API bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+ IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);
+ IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
+ IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
+ IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
+ IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
+ IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+ IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
+
// Widgets: Trees
- IMGUI_API bool TreeNode(const char* str_label_id); // if returning 'true' the node is open and the user is responsible for calling TreePop
- IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...); // "
- IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...); // "
- IMGUI_API bool TreeNodeV(const char* str_id, const char* fmt, va_list args); // "
- IMGUI_API bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args); // "
- IMGUI_API void TreePush(const char* str_id = NULL); // already called by TreeNode(), but you can call Push/Pop yourself for layouting purpose
- IMGUI_API void TreePush(const void* ptr_id = NULL); // "
+ IMGUI_API bool TreeNode(const char* str_label_id); // if returning 'true' the node is open and the user is responsible for calling TreePop()
+ IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...) IM_PRINTFARGS(2); // "
+ IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...) IM_PRINTFARGS(2); // "
+ IMGUI_API bool TreeNodeV(const char* str_id, const char* fmt, va_list args); // "
+ IMGUI_API bool TreeNodeV(const void* ptr_id, const char* fmt, va_list args); // "
+ IMGUI_API void TreePush(const char* str_id = NULL); // already called by TreeNode(), but you can call Push/Pop yourself for layouting purpose
+ IMGUI_API void TreePush(const void* ptr_id = NULL); // "
IMGUI_API void TreePop();
- IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0); // set next tree node to be opened.
+ IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0); // set next tree node to be opened.
// Widgets: Selectable / Lists
- IMGUI_API bool Selectable(const char* label, bool selected = false, const ImVec2& size = ImVec2(0,0));
- IMGUI_API bool Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
+ IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
+ IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0));
IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
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);
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.
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
IMGUI_API void ListBoxFooter(); // terminate the scrolling region
- // Widgets: Menus
- // FIXME-WIP: v1.39 in development
- IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false); // bool enabled = true
- IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected); // bool enabled = true
-
- // Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare your own within the ImGui namespace!)
+ // Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace)
IMGUI_API void Value(const char* prefix, bool b);
IMGUI_API void Value(const char* prefix, int v);
IMGUI_API void Value(const char* prefix, unsigned int v);
@@ -374,70 +329,117 @@ namespace ImGui
IMGUI_API void Color(const char* prefix, const ImVec4& v);
IMGUI_API void Color(const char* prefix, unsigned int v);
+ // Tooltip
+ IMGUI_API void SetTooltip(const char* fmt, ...) IM_PRINTFARGS(1); // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins
+ IMGUI_API void SetTooltipV(const char* fmt, va_list args);
+ IMGUI_API void BeginTooltip(); // use to create full-featured tooltip windows that aren't just text
+ IMGUI_API void EndTooltip();
+
+ // Menus
+ IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar. only call EndMainMenuBar() if this returns true!
+ IMGUI_API void EndMainMenuBar();
+ IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set). only call EndMenuBar() if this returns true!
+ IMGUI_API void EndMenuBar();
+ IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true!
+ IMGUI_API void EndMenu();
+ IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
+ IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
+
+ // Popup
+ IMGUI_API void OpenPopup(const char* str_id); // mark popup as open. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). close childs popups if any. will close popup when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.
+ IMGUI_API bool BeginPopup(const char* str_id); // return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
+ IMGUI_API bool BeginPopupModal(const char* name, bool* p_opened = NULL, ImGuiWindowFlags extra_flags = 0); // modal dialog (can't close them by clicking outside)
+ IMGUI_API bool BeginPopupContextItem(const char* str_id, int mouse_button = 1); // helper to open and begin popup when clicked on last item
+ IMGUI_API bool BeginPopupContextWindow(bool also_over_items = true, const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on current window
+ IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (no window)
+ IMGUI_API void EndPopup();
+ IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
+
// Logging: all text output from interface is redirected to tty/file/clipboard. Tree nodes are automatically opened.
IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty
IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file
IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard
IMGUI_API void LogFinish(); // stop logging (close file, etc.)
IMGUI_API void LogButtons(); // helper to display buttons for logging to tty/file/clipboard
- IMGUI_API void LogText(const char* fmt, ...); // pass text data straight to log (without being displayed)
+ IMGUI_API void LogText(const char* fmt, ...) IM_PRINTFARGS(1); // pass text data straight to log (without being displayed)
// Utilities
IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse?
IMGUI_API bool IsItemHoveredRect(); // was the last item hovered by mouse? even if another item is active while we are hovering this
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
- IMGUI_API bool IsAnyItemActive(); //
- IMGUI_API bool IsItemVisible();
+ IMGUI_API bool IsItemVisible(); // was the last item visible? (aka not out of sight due to clipping/scrolling.)
+ IMGUI_API bool IsAnyItemHovered();
+ IMGUI_API bool IsAnyItemActive();
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item in screen space
IMGUI_API ImVec2 GetItemRectMax(); // "
IMGUI_API ImVec2 GetItemRectSize(); // "
- IMGUI_API bool IsWindowFocused(); // is current window focused (differentiate child windows from each others)
- IMGUI_API bool IsRootWindowFocused(); // is current root window focused
+ IMGUI_API bool IsWindowHovered(); // is current window hovered and hoverable (not blocked by a popup) (differentiate child windows from each others)
+ IMGUI_API bool IsWindowFocused(); // is current window focused
+ IMGUI_API bool IsRootWindowFocused(); // is current root window focused (top parent window in case of child windows)
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
- IMGUI_API bool IsRectClipped(const ImVec2& size); // test if rectangle of given size starting from cursor pos is out of clipping region. to perform coarse clipping on user's side (as an optimization)
- IMGUI_API bool IsKeyDown(int key_index); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
- IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // "
- IMGUI_API bool IsMouseDown(int button);
- IMGUI_API bool IsMouseClicked(int button, bool repeat = false);
- IMGUI_API bool IsMouseDoubleClicked(int button);
- IMGUI_API bool IsMouseHoveringWindow(); // is mouse hovering current window ("window" in API names always refer to current window)
- IMGUI_API bool IsMouseHoveringAnyWindow(); // is mouse hovering any active imgui window
- IMGUI_API bool IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max);// is mouse hovering given bounding rect
- IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
+ IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle of given size starting from cursor pos is visible (not clipped). to perform coarse clipping on user's side (as an optimization)
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
- IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
- IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
- IMGUI_API void ResetMouseDragDelta(int button = 0);
- IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
- IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
IMGUI_API float GetTime();
IMGUI_API int GetFrameCount();
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
IMGUI_API ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f); // utility to find the closest point the last item bounding rectangle edge. useful to visually link items
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
- 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
+ IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
- IMGUI_API void BeginChildFrame(ImGuiID id, const ImVec2& size); // helper to create a child window / scrolling region that looks like a normal widget frame
+ IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame
IMGUI_API void EndChildFrame();
+ IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in);
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
- // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
+ // Inputs
+ IMGUI_API int GetKeyIndex(ImGuiKey key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
+ IMGUI_API bool IsKeyDown(int key_index); // key_index into the keys_down[] array, imgui doesn't know the semantic of each entry, uses your own indices!
+ IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // uses user's key indices as stored in the keys_down[] array. if repeat=true. uses io.KeyRepeatDelay / KeyRepeatRate
+ IMGUI_API bool IsKeyReleased(int key_index); // "
+ IMGUI_API bool IsMouseDown(int button); // is mouse button held
+ IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down)
+ IMGUI_API bool IsMouseDoubleClicked(int button); // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
+ IMGUI_API bool IsMouseReleased(int button); // did mouse button released (went from Down to !Down)
+ IMGUI_API bool IsMouseHoveringWindow(); // is mouse hovering current window ("window" in API names always refer to current window). disregarding of any consideration of being blocked by a popup. (unlike IsWindowHovered() this will return true even if the window is blocked because of a popup)
+ IMGUI_API bool IsMouseHoveringAnyWindow(); // is mouse hovering any visible window
+ IMGUI_API bool IsMouseHoveringRect(const ImVec2& pos_min, const ImVec2& pos_max, bool clip = true); // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings. disregarding of consideration of focus/window ordering/blocked by a popup.
+ IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
+ IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
+ IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse positioning at the time of opening popup we have BeginPopup() into
+ IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
+ IMGUI_API void ResetMouseDragDelta(int button = 0); //
+ IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
+ IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
+ IMGUI_API void CaptureKeyboardFromApp(); // manually enforce imgui setting the io.WantCaptureKeyboard flag next frame (your application needs to handle it). e.g. capture keyboard when your widget is being hovered.
+ IMGUI_API void CaptureMouseFromApp(); // manually enforce imgui setting the io.WantCaptureMouse flag next frame (your application needs to handle it).
+
+ // Helpers functions to access functions pointers in ImGui::GetIO()
+ IMGUI_API void* MemAlloc(size_t sz);
+ IMGUI_API void MemFree(void* ptr);
+ IMGUI_API const char* GetClipboardText();
+ IMGUI_API void SetClipboardText(const char* text);
+
+ // Internal state/context access - if you want to use multiple ImGui context, or share context between modules (e.g. DLL), or allocate the memory yourself
IMGUI_API const char* GetVersion();
IMGUI_API void* GetInternalState();
IMGUI_API size_t GetInternalStateSize();
IMGUI_API void SetInternalState(void* state, bool construct = false);
// Obsolete (will be removed)
- IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size); // OBSOLETE
- static inline void OpenNextNode(bool open) { ImGui::SetNextTreeNodeOpened(open, 0); } // OBSOLETE
- static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE
- static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE
- static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE
- static inline bool IsClipped(const ImVec2& size) { return IsRectClipped(size); } // OBSOLETE
- static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ static inline void OpenNextNode(bool open) { ImGui::SetNextTreeNodeOpened(open, 0); } // OBSOLETE 1.34+
+ static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE 1.36+
+ static inline bool GetWindowCollapsed() { return ImGui::IsWindowCollapsed(); } // OBSOLETE 1.39+
+ static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE 1.36+
+ static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE 1.36+
+ static inline bool IsClipped(const ImVec2& size) { return !IsRectVisible(size); } // OBSOLETE 1.38+
+ static inline bool IsRectClipped(const ImVec2& size) { return !IsRectVisible(size); } // OBSOLETE 1.39+
+ static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE 1.36+
+ static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETE 1.42+
+#endif
} // namespace ImGui
@@ -454,13 +456,20 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame
ImGuiWindowFlags_ShowBorders = 1 << 7, // Show borders around windows and items
ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file
+ ImGuiWindowFlags_NoInputs = 1 << 9, // Disable catching mouse or keyboard inputs
+ ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar
+ ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Enable horizontal scrollbar (off by default). You need to use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
+ ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state
+ ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus)
// [Internal]
- ImGuiWindowFlags_ChildWindow = 1 << 9, // For internal use by BeginChild()
- ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 10, // For internal use by BeginChild()
- ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 11, // For internal use by BeginChild()
- ImGuiWindowFlags_ComboBox = 1 << 12, // For internal use by ComboBox()
- ImGuiWindowFlags_Tooltip = 1 << 13, // For internal use by BeginTooltip()
- ImGuiWindowFlags_Popup = 1 << 14 // For internal use by BeginPopup()
+ ImGuiWindowFlags_ChildWindow = 1 << 20, // Don't use! For internal use by BeginChild()
+ ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21, // Don't use! For internal use by BeginChild()
+ ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 22, // Don't use! For internal use by BeginChild()
+ ImGuiWindowFlags_ComboBox = 1 << 23, // Don't use! For internal use by ComboBox()
+ ImGuiWindowFlags_Tooltip = 1 << 24, // Don't use! For internal use by BeginTooltip()
+ ImGuiWindowFlags_Popup = 1 << 25, // Don't use! For internal use by BeginPopup()
+ ImGuiWindowFlags_Modal = 1 << 26, // Don't use! For internal use by BeginPopupModal()
+ ImGuiWindowFlags_ChildMenu = 1 << 27 // Don't use! For internal use by BeginMenu()
};
// Flags for ImGui::InputText()
@@ -476,29 +485,46 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_CallbackCompletion = 1 << 6, // Call user function on pressing TAB (for completion handling)
ImGuiInputTextFlags_CallbackHistory = 1 << 7, // Call user function on pressing Up/Down arrows (for history handling)
ImGuiInputTextFlags_CallbackAlways = 1 << 8, // Call user function every time
- ImGuiInputTextFlags_CallbackCharFilter = 1 << 9 // Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character.
+ ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, // Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character.
+ ImGuiInputTextFlags_AllowTabInput = 1 << 10, // Pressing TAB input a '\t' character into the text field
+ ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, // In multi-line mode, allow exiting edition by pressing Enter. Ctrl+Enter to add new line (by default adds new lines with Enter).
+ ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, // Disable following the cursor horizontally
+ ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13, // Insert mode
+ ImGuiInputTextFlags_ReadOnly = 1 << 14, // Read-only mode
+ // [Internal]
+ ImGuiInputTextFlags_Multiline = 1 << 20 // For internal use by InputTextMultiline()
+};
+
+// Flags for ImGui::Selectable()
+enum ImGuiSelectableFlags_
+{
+ // Default: 0
+ ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window
+ ImGuiSelectableFlags_SpanAllColumns = 1 << 1 // Selectable frame can span all columns (text will still fit in current column)
};
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
enum ImGuiKey_
{
- ImGuiKey_Tab,
- ImGuiKey_LeftArrow,
- ImGuiKey_RightArrow,
- ImGuiKey_UpArrow,
- ImGuiKey_DownArrow,
- ImGuiKey_Home,
- ImGuiKey_End,
- ImGuiKey_Delete,
- ImGuiKey_Backspace,
- ImGuiKey_Enter,
- ImGuiKey_Escape,
- ImGuiKey_A, // for CTRL+A: select all
- ImGuiKey_C, // for CTRL+C: copy
- ImGuiKey_V, // for CTRL+V: paste
- ImGuiKey_X, // for CTRL+X: cut
- ImGuiKey_Y, // for CTRL+Y: redo
- ImGuiKey_Z, // for CTRL+Z: undo
+ ImGuiKey_Tab, // for tabbing through fields
+ ImGuiKey_LeftArrow, // for text edit
+ ImGuiKey_RightArrow,// for text edit
+ ImGuiKey_UpArrow, // for text edit
+ ImGuiKey_DownArrow, // for text edit
+ ImGuiKey_PageUp,
+ ImGuiKey_PageDown,
+ ImGuiKey_Home, // for text edit
+ ImGuiKey_End, // for text edit
+ ImGuiKey_Delete, // for text edit
+ ImGuiKey_Backspace, // for text edit
+ ImGuiKey_Enter, // for text edit
+ ImGuiKey_Escape, // for text edit
+ ImGuiKey_A, // for text edit CTRL+A: select all
+ ImGuiKey_C, // for text edit CTRL+C: copy
+ ImGuiKey_V, // for text edit CTRL+V: paste
+ ImGuiKey_X, // for text edit CTRL+X: cut
+ ImGuiKey_Y, // for text edit CTRL+Y: redo
+ ImGuiKey_Z, // for text edit CTRL+Z: undo
ImGuiKey_COUNT
};
@@ -506,6 +532,7 @@ enum ImGuiKey_
enum ImGuiCol_
{
ImGuiCol_Text,
+ ImGuiCol_TextDisabled,
ImGuiCol_WindowBg,
ImGuiCol_ChildWindowBg,
ImGuiCol_Border,
@@ -515,6 +542,8 @@ enum ImGuiCol_
ImGuiCol_FrameBgActive,
ImGuiCol_TitleBg,
ImGuiCol_TitleBgCollapsed,
+ ImGuiCol_TitleBgActive,
+ ImGuiCol_MenuBarBg,
ImGuiCol_ScrollbarBg,
ImGuiCol_ScrollbarGrab,
ImGuiCol_ScrollbarGrabHovered,
@@ -544,6 +573,7 @@ enum ImGuiCol_
ImGuiCol_PlotHistogramHovered,
ImGuiCol_TextSelectedBg,
ImGuiCol_TooltipBg,
+ ImGuiCol_ModalWindowDarkening, // darken entire screen when a modal window is active
ImGuiCol_COUNT
};
@@ -554,6 +584,7 @@ enum ImGuiStyleVar_
ImGuiStyleVar_Alpha, // float
ImGuiStyleVar_WindowPadding, // ImVec2
ImGuiStyleVar_WindowRounding, // float
+ ImGuiStyleVar_WindowMinSize, // ImVec2
ImGuiStyleVar_ChildWindowRounding, // float
ImGuiStyleVar_FramePadding, // ImVec2
ImGuiStyleVar_FrameRounding, // float
@@ -568,7 +599,9 @@ enum ImGuiAlign_
ImGuiAlign_Left = 1 << 0,
ImGuiAlign_Center = 1 << 1,
ImGuiAlign_Right = 1 << 2,
- ImGuiAlign_Default = ImGuiAlign_Left,
+ ImGuiAlign_Top = 1 << 3,
+ ImGuiAlign_VCenter = 1 << 4,
+ ImGuiAlign_Default = ImGuiAlign_Left | ImGuiAlign_Top
};
// Enumeration for ColorEditMode()
@@ -620,17 +653,21 @@ struct ImGuiStyle
float WindowFillAlphaDefault; // Default alpha of window background, if not specified in ImGui::Begin()
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node
float ColumnsMinSpacing; // Minimum horizontal spacing between two columns
- float ScrollbarWidth; // Width of the vertical scrollbar
+ float ScrollbarSize; // Width of the vertical scrollbar, Height of the horizontal scrollbar
float ScrollbarRounding; // Radius of grab corners for scrollbar
float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar
+ float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
ImVec2 DisplayWindowPadding; // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
ImVec2 DisplaySafeAreaPadding; // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
+ bool AntiAliasedLines; // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
+ bool AntiAliasedShapes; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
+ float CurveTessellationTol; // Tessellation tolerance. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
ImVec4 Colors[ImGuiCol_COUNT];
IMGUI_API ImGuiStyle();
};
-// This is where your app communicate with ImGui. Call ImGui::GetIO() to access.
+// This is where your app communicate with ImGui. Access via ImGui::GetIO().
// Read 'Programmer guide' section in .cpp file for general usage.
struct ImGuiIO
{
@@ -647,11 +684,14 @@ struct ImGuiIO
float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging
int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array
+ float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds. (for actions where 'repeat' is active)
+ float KeyRepeatRate; // = 0.020f // When holding a key/button, rate at which it repeats, in seconds.
void* UserData; // = NULL // Store your own data for retrieval by callbacks.
ImFontAtlas* Fonts; // <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
float FontGlobalScale; // = 1.0f // Global scale all fonts
bool FontAllowUserScaling; // = false // Allow user scaling text of individual window with CTRL+Wheel.
+ ImVec2 DisplayFramebufferScale; // = (1.0f,1.0f) // For retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui.
ImVec2 DisplayVisibleMin; // <unset> (0.0f,0.0f) // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area.
ImVec2 DisplayVisibleMax; // <unset> (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize
@@ -659,9 +699,10 @@ struct ImGuiIO
// User Functions
//------------------------------------------------------------------
- // REQUIRED: rendering function.
- // See example code if you are unsure of how to implement this.
- void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
+ // Rendering function, will be called in Render().
+ // Alternatively you can keep this to NULL and call GetDrawData() after Render() to get the same pointer.
+ // See example applications if you are unsure of how to implement this.
+ void (*RenderDrawListsFn)(ImDrawData* data);
// Optional: access OS clipboard
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
@@ -683,8 +724,8 @@ struct ImGuiIO
//------------------------------------------------------------------
ImVec2 MousePos; // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
- bool MouseDown[5]; // Mouse buttons. ImGui itself only uses button 0 (left button). Others buttons allows to track if mouse is being used by your application + available to user as a convenience via IsMouse** API.
- float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
+ bool MouseDown[5]; // Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
+ float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
bool KeyCtrl; // Keyboard modifier pressed: Control
bool KeyShift; // Keyboard modifier pressed: Shift
@@ -692,8 +733,9 @@ struct ImGuiIO
bool KeysDown[512]; // Keyboard keys that are pressed (in whatever storage order you naturally have access to keyboard data)
ImWchar InputCharacters[16+1]; // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
- // Function
- IMGUI_API void AddInputCharacter(ImWchar c); // Helper to add a new character into InputCharacters[]
+ // Functions
+ IMGUI_API void AddInputCharacter(ImWchar c); // Helper to add a new character into InputCharacters[]
+ IMGUI_API void AddInputCharactersUTF8(const char* utf8_chars); // Helper to add new characters into InputCharacters[] from an UTF-8 string
//------------------------------------------------------------------
// Output - Retrieve after calling NewFrame(), you can use them to discard inputs or hide them from the rest of your application
@@ -701,8 +743,11 @@ struct ImGuiIO
bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input)
+ bool WantTextInput; // Some text input widget is active, which will read input characters from the InputCharacters array.
float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
- int MetricsRenderVertices; // Vertices processed during last call to Render()
+ int MetricsAllocs; // Number of active memory allocations
+ int MetricsRenderVertices; // Vertices output during last call to Render()
+ int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
int MetricsActiveWindows; // Number of visible windows (exclude child windows)
//------------------------------------------------------------------
@@ -715,10 +760,13 @@ struct ImGuiIO
ImVec2 MouseClickedPos[5]; // Position at time of clicking
float MouseClickedTime[5]; // Time of last click (used to figure out double-click)
bool MouseDoubleClicked[5]; // Has mouse button been double-clicked?
+ bool MouseReleased[5]; // Mouse button went from Down to !Down
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.
- float MouseDownTime[5]; // Time the mouse button has been down
+ float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked)
+ float MouseDownDurationPrev[5]; // Previous time the mouse button has been down
float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the click point
- float KeysDownTime[512]; // Time the keyboard key has been down
+ float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed)
+ float KeysDownDurationPrev[512]; // Previous duration the key has been down
IMGUI_API ImGuiIO();
};
@@ -727,6 +775,61 @@ struct ImGuiIO
// Helpers
//-----------------------------------------------------------------------------
+// Lightweight 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).
+// Our implementation does NOT call c++ constructors because we don't use them in ImGui. Don't use this class as a straight std::vector replacement in your code!
+template<typename T>
+class ImVector
+{
+public:
+ int Size;
+ int Capacity;
+ T* Data;
+
+ typedef T value_type;
+ typedef value_type* iterator;
+ typedef const value_type* const_iterator;
+
+ ImVector() { Size = Capacity = 0; Data = NULL; }
+ ~ImVector() { if (Data) ImGui::MemFree(Data); }
+
+ inline bool empty() const { return Size == 0; }
+ inline int size() const { return Size; }
+ inline int capacity() const { return Capacity; }
+
+ inline value_type& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; }
+ inline const value_type& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; }
+
+ inline void clear() { if (Data) { Size = Capacity = 0; ImGui::MemFree(Data); Data = NULL; } }
+ inline iterator begin() { return Data; }
+ inline const_iterator begin() const { return Data; }
+ inline iterator end() { return Data + Size; }
+ inline const_iterator end() const { return Data + Size; }
+ inline value_type& front() { IM_ASSERT(Size > 0); return Data[0]; }
+ inline const value_type& front() const { IM_ASSERT(Size > 0); return Data[0]; }
+ inline value_type& back() { IM_ASSERT(Size > 0); return Data[Size-1]; }
+ inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size-1]; }
+ inline void swap(ImVector<T>& rhs) { int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
+
+ inline int _grow_capacity(int new_size) { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > new_size ? new_capacity : new_size; }
+
+ inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
+ inline void reserve(int new_capacity)
+ {
+ if (new_capacity <= Capacity) return;
+ T* new_data = (value_type*)ImGui::MemAlloc((size_t)new_capacity * sizeof(value_type));
+ memcpy(new_data, Data, (size_t)Size * sizeof(value_type));
+ ImGui::MemFree(Data);
+ Data = new_data;
+ Capacity = new_capacity;
+ }
+
+ inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size+1)); Data[Size++] = v; }
+ inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
+
+ inline iterator erase(const_iterator it) { IM_ASSERT(it >= begin() && it < end()); const ptrdiff_t off = it - begin(); memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; }
+ inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= begin() && it <= end()); const ptrdiff_t off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
+};
+
// Helper: execute a block of code once a frame only
// Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame.
// Usage:
@@ -740,7 +843,7 @@ struct ImGuiOnceUponAFrame
{
ImGuiOnceUponAFrame() { RefFrame = -1; }
mutable int RefFrame;
- operator bool() const { const int current_frame = ImGui::GetFrameCount(); if (RefFrame == current_frame) return false; RefFrame = current_frame; return true; }
+ operator bool() const { int current_frame = ImGui::GetFrameCount(); if (RefFrame == current_frame) return false; RefFrame = current_frame; return true; }
};
// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
@@ -767,11 +870,11 @@ struct ImGuiTextFilter
int CountGrep;
ImGuiTextFilter(const char* default_filter = "");
- void Clear() { InputBuf[0] = 0; Build(); }
- void Draw(const char* label = "Filter (inc,-exc)", float width = -1.0f); // Helper calling InputText+Build
- bool PassFilter(const char* val) const;
- bool IsActive() const { return !Filters.empty(); }
- IMGUI_API void Build();
+ void Clear() { InputBuf[0] = 0; Build(); }
+ bool Draw(const char* label = "Filter (inc,-exc)", float width = 0.0f); // Helper calling InputText+Build
+ bool PassFilter(const char* text, const char* text_end = NULL) const;
+ bool IsActive() const { return !Filters.empty(); }
+ IMGUI_API void Build();
};
// Helper: Text buffer for logging/accumulating text
@@ -780,12 +883,14 @@ struct ImGuiTextBuffer
ImVector<char> Buf;
ImGuiTextBuffer() { Buf.push_back(0); }
+ inline char operator[](int i) { return Buf.Data[i]; }
const char* begin() const { return &Buf.front(); }
const char* end() const { return &Buf.back(); } // Buf is zero-terminated, so end() will point on the zero-terminator
- size_t size() const { return Buf.size()-1; }
- bool empty() { return size() >= 1; }
+ int size() const { return Buf.Size - 1; }
+ bool empty() { return Buf.Size >= 2; }
void clear() { Buf.clear(); Buf.push_back(0); }
- IMGUI_API void append(const char* fmt, ...);
+ const char* c_str() const { return Buf.Data; }
+ IMGUI_API void append(const char* fmt, ...) IM_PRINTFARGS(2);
IMGUI_API void appendv(const char* fmt, va_list args);
};
@@ -799,13 +904,13 @@ struct ImGuiTextBuffer
// - You want to store custom debug data easily without adding or editing structures in your code.
struct ImGuiStorage
{
- struct Pair
- {
- ImGuiID key;
- union { int val_i; float val_f; void* val_p; };
- Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
- Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
- Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
+ struct Pair
+ {
+ ImGuiID key;
+ union { int val_i; float val_f; void* val_p; };
+ Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
+ Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
+ Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
};
ImVector<Pair> Data;
@@ -820,7 +925,7 @@ struct ImGuiStorage
IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL
IMGUI_API void SetVoidPtr(ImGuiID key, void* val);
- // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
+ // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
// - 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.
// - A typical use case where this is convenient:
// float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar;
@@ -839,6 +944,7 @@ struct ImGuiTextEditCallbackData
ImGuiInputTextFlags EventFlag; // One of ImGuiInputTextFlags_Callback* // Read-only
ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
void* UserData; // What user passed to InputText() // Read-only
+ bool ReadOnly; // Read-only mode // Read-only
// CharFilter event:
ImWchar EventChar; // Character input // Read-write (replace character or set to zero)
@@ -846,24 +952,26 @@ struct ImGuiTextEditCallbackData
// Completion,History,Always events:
ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only
char* Buf; // Current text // Read-write (pointed data only)
- size_t BufSize; // // Read-only
+ int BufSize; // // Read-only
bool BufDirty; // Set if you modify Buf directly // Write
int CursorPos; // // Read-write
int SelectionStart; // // Read-write (== to SelectionEnd when no selection)
int SelectionEnd; // // Read-write
// NB: calling those function loses selection.
- void DeleteChars(int pos, int bytes_count);
- void InsertChars(int pos, const char* text, const char* text_end = NULL);
+ void DeleteChars(int pos, int bytes_count);
+ void InsertChars(int pos, const char* text, const char* text_end = NULL);
+ bool HasSelection() const { return SelectionStart != SelectionEnd; }
};
// ImColor() is just a helper that implicity converts to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
-// None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either formats.
+// None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either ImU32 or ImVec4 formats.
struct ImColor
{
ImVec4 Value;
- 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; }
+ ImColor(int r, int g, int b, int a = 255) { float sc = 1.0f/255.0f; Value.x = (float)r * sc; Value.y = (float)g * sc; Value.z = (float)b * sc; Value.w = (float)a * sc; }
+ ImColor(ImU32 rgba) { float sc = 1.0f/255.0f; Value.x = (float)(rgba&0xFF) * sc; Value.y = (float)((rgba>>8)&0xFF) * sc; Value.z = (float)((rgba>>16)&0xFF) * sc; Value.w = (float)(rgba >> 24) * sc; }
ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
ImColor(const ImVec4& col) { Value = col; }
operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); }
@@ -872,17 +980,50 @@ struct ImColor
static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r,g,b,a); }
};
+// Helper: Manually clip large list of items.
+// If you are displaying thousands of even spaced items and you have a random access to the list, you can perform clipping yourself to save on CPU.
+// Usage:
+// ImGuiListClipper clipper(count, ImGui::GetTextLineHeightWithSpacing());
+// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) // display only visible items
+// ImGui::Text("line number %d", i);
+// clipper.End();
+// NB: 'count' is only used to clamp the result, if you don't know your count you can use INT_MAX
+struct ImGuiListClipper
+{
+ float ItemsHeight;
+ int ItemsCount, DisplayStart, DisplayEnd;
+
+ ImGuiListClipper() { ItemsHeight = 0.0f; ItemsCount = DisplayStart = DisplayEnd = -1; }
+ ImGuiListClipper(int count, float height) { ItemsCount = -1; Begin(count, height); }
+ ~ImGuiListClipper() { IM_ASSERT(ItemsCount == -1); } // user forgot to call End()
+
+ void Begin(int count, float height) // items_height: generally pass GetTextLineHeightWithSpacing() or GetItemsLineHeightWithSpacing()
+ {
+ IM_ASSERT(ItemsCount == -1);
+ ItemsCount = count;
+ ItemsHeight = height;
+ ImGui::CalcListClipping(ItemsCount, ItemsHeight, &DisplayStart, &DisplayEnd); // calculate how many to clip/display
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + DisplayStart * ItemsHeight); // advance cursor
+ }
+ void End()
+ {
+ IM_ASSERT(ItemsCount >= 0);
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ItemsCount - DisplayEnd) * ItemsHeight); // advance cursor
+ ItemsCount = -1;
+ }
+};
+
//-----------------------------------------------------------------------------
// Draw List
-// Hold a series of drawing commands. The user provides a renderer for ImDrawList.
+// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.
//-----------------------------------------------------------------------------
// Draw callbacks for advanced uses.
-// NB- You most likely DO NOT need to care about draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
+// NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
// Draw callback are useful for example if you want to render a complex 3D scene inside a UI element.
// The expected behavior from your rendering loop is:
-// if (cmd.user_callback != NULL)
-// cmd.user_callback(parent_list, cmd);
+// if (cmd.UserCallback != NULL)
+// cmd.UserCallback(parent_list, cmd);
// else
// RenderTriangles()
// It is up to you to decide if your rendering loop or the callback should be responsible for backup/restoring rendering state.
@@ -891,13 +1032,20 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
struct ImDrawCmd
{
- unsigned int vtx_count; // Number of vertices (multiple of 3) to be drawn as triangles. The vertices are stored in the callee ImDrawList's vtx_buffer[] array.
- ImVec4 clip_rect; // Clipping rectangle (x1, y1, x2, y2)
- ImTextureID texture_id; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
- ImDrawCallback user_callback; // If != NULL, call the function instead of rendering the vertices. vtx_count will be 0. clip_rect and texture_id will be set normally.
- void* user_callback_data; // The draw callback code can access this.
+ unsigned int ElemCount; // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
+ ImVec4 ClipRect; // Clipping rectangle (x1, y1, x2, y2)
+ ImTextureID TextureId; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
+ ImDrawCallback UserCallback; // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
+ void* UserCallbackData; // The draw callback code can access this.
+
+ ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = -8192.0f; ClipRect.z = ClipRect.w = +8192.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
};
+// Vertex index (override with, e.g. '#define ImDrawIdx unsigned int' in ImConfig)
+#ifndef ImDrawIdx
+typedef unsigned short ImDrawIdx;
+#endif
+
// Vertex layout
#ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT
struct ImDrawVert
@@ -913,6 +1061,14 @@ struct ImDrawVert
IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
#endif
+// Draw channels are used by the Columns API to "split" the render list into different channels while building, so items of each column can be batched together.
+// You can also use them to simulate drawing layers and submit primitives in a different order than how they will be rendered.
+struct ImDrawChannel
+{
+ ImVector<ImDrawCmd> CmdBuffer;
+ ImVector<ImDrawIdx> IdxBuffer;
+};
+
// Draw command list
// This is the low-level list of polygons that ImGui functions are filling. At the end of the frame, all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.
// At the moment, each ImGui window contains its own ImDrawList but they could potentially be merged in the future.
@@ -923,15 +1079,24 @@ IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
struct ImDrawList
{
// This is what you have to render
- ImVector<ImDrawCmd> commands; // Commands. Typically 1 command = 1 gpu draw call.
- ImVector<ImDrawVert> vtx_buffer; // Vertex buffer. Each command consume ImDrawCmd::vtx_count of those
-
- // [Internal to ImGui]
- ImVector<ImVec4> clip_rect_stack; // [Internal]
- ImVector<ImTextureID> texture_id_stack; // [Internal]
- ImDrawVert* vtx_write; // [Internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
-
- ImDrawList() { Clear(); }
+ ImVector<ImDrawCmd> CmdBuffer; // Commands. Typically 1 command = 1 gpu draw call.
+ ImVector<ImDrawIdx> IdxBuffer; // Index buffer. Each command consume ImDrawCmd::ElemCount of those
+ ImVector<ImDrawVert> VtxBuffer; // Vertex buffer.
+
+ // [Internal, used while building lists]
+ const char* _OwnerName; // Pointer to owner window's name (if any) for debugging
+ unsigned int _VtxCurrentIdx; // [Internal] == VtxBuffer.Size
+ ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
+ ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
+ ImVector<ImVec4> _ClipRectStack; // [Internal]
+ ImVector<ImTextureID> _TextureIdStack; // [Internal]
+ ImVector<ImVec2> _Path; // [Internal] current path building
+ int _ChannelsCurrent; // [Internal] current channel number (0)
+ int _ChannelsCount; // [Internal] number of active channels (1+)
+ ImVector<ImDrawChannel> _Channels; // [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size)
+
+ ImDrawList() { _OwnerName = NULL; Clear(); }
+ ~ImDrawList() { ClearFreeMemory(); }
IMGUI_API void Clear();
IMGUI_API void ClearFreeMemory();
IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2.
@@ -940,31 +1105,89 @@ struct ImDrawList
IMGUI_API void PushTextureID(const ImTextureID& texture_id);
IMGUI_API void PopTextureID();
- // Primitives
+ // Primitives
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners = 0x0F);
IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners = 0x0F);
+ IMGUI_API void AddRectFilledMultiColor(const ImVec2& a, const ImVec2& b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
- IMGUI_API void AddArcFast(const ImVec2& center, float radius, ImU32 col, int a_min_12, int a_max_12, bool filled = false, const ImVec2& third_point_offset = ImVec2(0,0)); // Angles in 0..12 range
- IMGUI_API void AddText(const 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);
- IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
+ IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
+ IMGUI_API void AddText(const 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 ImVec4* cpu_fine_clip_rect = NULL);
+ IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), ImU32 col = 0xFFFFFFFF);
+ IMGUI_API void AddPolyline(const ImVec2* points, const int num_points, ImU32 col, bool closed, float thickness, bool anti_aliased);
+ IMGUI_API void AddConvexPolyFilled(const ImVec2* points, const int num_points, ImU32 col, bool anti_aliased);
+ IMGUI_API void AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments = 0);
+
+ // Stateful path API, add points then finish with PathFill() or PathStroke()
+ inline void PathClear() { _Path.resize(0); }
+ inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
+ inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || _Path[_Path.Size-1].x != pos.x || _Path[_Path.Size-1].y != pos.y) _Path.push_back(pos); }
+ inline void PathFill(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col, true); PathClear(); }
+ inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness, true); PathClear(); }
+ IMGUI_API void PathArcTo(const ImVec2& centre, float radius, float a_min, float a_max, int num_segments = 10);
+ IMGUI_API void PathArcToFast(const ImVec2& centre, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
+ IMGUI_API void PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0);
+ IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, int rounding_corners = 0x0F);
+
+ // Channels
+ // - Use to simulate layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
+ // - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
+ IMGUI_API void ChannelsSplit(int channels_count);
+ IMGUI_API void ChannelsMerge();
+ IMGUI_API void ChannelsSetCurrent(int channel_index);
// Advanced
- IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'user_callback' in ImDrawCmd and call the function instead of rendering triangles.
+ IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
// Internal helpers
- IMGUI_API void PrimReserve(unsigned int vtx_count);
- IMGUI_API void PrimTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
+ // NB: all primitives needs to be reserved via PrimReserve() beforehand!
+ IMGUI_API void PrimReserve(int idx_count, int vtx_count);
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col);
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
- IMGUI_API void PrimQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col);
- IMGUI_API void PrimLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
+ inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); }
+ inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
+ inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
IMGUI_API void UpdateClipRect();
IMGUI_API void UpdateTextureID();
- IMGUI_API void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { vtx_write->pos = pos; vtx_write->uv = uv; vtx_write->col = col; vtx_write++; }
+};
+
+// All draw data to render an ImGui frame
+struct ImDrawData
+{
+ bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
+ ImDrawList** CmdLists;
+ int CmdListsCount;
+ int TotalVtxCount; // For convenience, sum of all cmd_lists vtx_buffer.Size
+ int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
+
+ // Functions
+ ImDrawData() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
+ IMGUI_API void DeIndexAllBuffers(); // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
+ IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
+};
+
+struct ImFontConfig
+{
+ void* FontData; // // TTF data
+ int FontDataSize; // // TTF data size
+ bool FontDataOwnedByAtlas; // true // TTF data ownership taken by the container ImFontAtlas (will delete memory itself). Set to true
+ int FontNo; // 0 // Index of font within TTF file
+ float SizePixels; // // Size in pixels for rasterizer
+ int OversampleH, OversampleV; // 3, 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.
+ bool PixelSnapH; // false // Align every character to pixel boundary (if enabled, set OversampleH/V to 1)
+ ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs
+ const ImWchar* GlyphRanges; // // List of Unicode range (2 value per range, values are inclusive, zero-terminated list)
+ bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs).
+ bool MergeGlyphCenterV; // false // When merging (multiple ImFontInput for one ImFont), vertically center new glyphs instead of aligning their baseline
+
+ // [Internal]
+ char Name[32]; // Name (strictly for debugging)
+ ImFont* DstFont;
+
+ IMGUI_API ImFontConfig();
};
// Load and rasterize multiple TTF fonts into a same texture.
@@ -979,10 +1202,12 @@ struct ImFontAtlas
{
IMGUI_API ImFontAtlas();
IMGUI_API ~ImFontAtlas();
- IMGUI_API ImFont* AddFontDefault();
- IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0);
- IMGUI_API ImFont* AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0); // Transfer ownership of 'ttf_data' to ImFontAtlas, will be deleted after Build()
- IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0); // 'compressed_ttf_data' untouched and still owned by caller. Compress with binary_to_compressed_c.cpp
+ IMGUI_API ImFont* AddFont(const ImFontConfig* font_cfg);
+ IMGUI_API ImFont* AddFontDefault(const ImFontConfig* font_cfg = NULL);
+ IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL);
+ IMGUI_API ImFont* AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // Transfer ownership of 'ttf_data' to ImFontAtlas, will be deleted after Build()
+ IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_ttf_data' still owned by caller. Compress with binary_to_compressed_c.cpp
+ IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_ttf_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 paramaeter
IMGUI_API void ClearTexData(); // Clear the CPU-side texture data. Saves RAM once the texture has been copied to graphics memory.
IMGUI_API void ClearInputData(); // Clear the input TTF data (inc sizes, glyph ranges)
IMGUI_API void ClearFonts(); // Clear the ImGui-side font data (glyphs storage, UV coordinates)
@@ -995,58 +1220,60 @@ struct ImFontAtlas
// Pitch = Width * BytesPerPixels
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
- IMGUI_API void SetTexID(void* id) { TexID = id; }
+ void SetTexID(void* id) { TexID = id; }
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
// (Those functions could be static but aren't so most users don't have to refer to the ImFontAtlas:: name ever if in their code; just using io.Fonts->)
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
+ IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
IMGUI_API const ImWchar* GetGlyphRangesChinese(); // Japanese + full set of about 21000 CJK Unified Ideographs
+ IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
// Members
// (Access texture data via GetTexData*() calls which will setup a default font for you.)
void* TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It ia passed back to you during rendering.
unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
- int TexWidth;
- int TexHeight;
+ int TexWidth; // Texture width calculated during Build().
+ int TexHeight; // Texture height calculated during Build().
+ int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel (part of the TexExtraData block)
ImVector<ImFont*> Fonts;
// Private
- struct ImFontAtlasData;
- ImVector<ImFontAtlasData*> InputData; // Internal data
+ ImVector<ImFontConfig> ConfigData; // Internal data
IMGUI_API bool Build(); // Build pixels data. This is automatically for you by the GetTexData*** functions.
IMGUI_API void RenderCustomTexData(int pass, void* rects);
};
-// TTF font loading and rendering
+// Font runtime data and rendering
// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
-// Kerning isn't supported. At the moment some ImGui code does per-character CalcTextSize calls, need something more state-ful.
struct ImFont
{
// Members: Settings
- float FontSize; // <user set> // Height of characters, set during loading (don't change after loading)
- float Scale; // = 1.0f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
- ImVec2 DisplayOffset; // = (0.0f,0.0f) // Offset font rendering by xx pixels
- ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
+ float FontSize; // <user set> // Height of characters, set during loading (don't change after loading)
+ float Scale; // = 1.0f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
+ ImVec2 DisplayOffset; // = (0.0f,1.0f) // Offset font rendering by xx pixels
+ ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
+ ImFontConfig* ConfigData; // // Pointer within ImFontAtlas->ConfigData
+ int ConfigDataCount; //
// Members: Runtime data
struct Glyph
{
- ImWchar Codepoint;
- signed short XAdvance;
- signed short Width, Height;
- signed short XOffset, YOffset;
- float U0, V0, U1, V1; // Texture coordinates
+ ImWchar Codepoint;
+ float XAdvance;
+ float X0, Y0, X1, Y1;
+ float U0, V0, U1, V1; // Texture coordinates
};
- float BaseLine; // Distance from top to bottom of e.g. 'A' [0..FontSize]
- ImFontAtlas* ContainerAtlas; // What we has been loaded into
- ImVector<Glyph> Glyphs;
- const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
- float FallbackXAdvance; //
- ImVector<float> IndexXAdvance; // Glyphs->XAdvance directly indexable (for CalcTextSize functions which are often bottleneck in large UI)
- ImVector<int> IndexLookup; // Index glyphs by Unicode code-point
+ float Ascent, Descent; // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
+ ImFontAtlas* ContainerAtlas; // What we has been loaded into
+ ImVector<Glyph> Glyphs;
+ const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
+ float FallbackXAdvance; //
+ ImVector<float> IndexXAdvance; // Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs, for CalcTextSize functions which are often bottleneck in large UI)
+ ImVector<int> IndexLookup; // Sparse. Index glyphs by Unicode code-point.
// Methods
IMGUI_API ImFont();
@@ -1055,14 +1282,14 @@ struct ImFont
IMGUI_API void BuildLookupTable();
IMGUI_API const Glyph* FindGlyph(unsigned short c) const;
IMGUI_API void SetFallbackChar(ImWchar c);
- IMGUI_API bool IsLoaded() const { return ContainerAtlas != NULL; }
+ float GetCharAdvance(unsigned short c) const { return ((int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] : FallbackXAdvance; }
+ bool IsLoaded() const { return ContainerAtlas != NULL; }
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
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
- IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const; // wchar
- IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawList* draw_list, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
+ IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawList* draw_list, float wrap_width = 0.0f, bool cpu_fine_clip = false) const;
};
//---- Include imgui_user.h at the end of imgui.h
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
new file mode 100644
index 00000000000..d78630ee5a1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
@@ -0,0 +1,2213 @@
+// ImGui library v1.46 WIP
+// Demo code
+
+// Don't remove this file from your project! It is useful reference code that you can execute.
+// You can call ImGui::ShowTestWindow() in your code to learn about various features of ImGui.
+// Everything in this file will be stripped out by the linker if you don't call ImGui::ShowTestWindow().
+
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+
+#include "imgui.h"
+#include <ctype.h> // toupper, isprint
+#include <math.h> // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf
+#include <stdio.h> // vsnprintf, sscanf, printf
+#include <stdint.h> // intptr_t
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
+#define snprintf _snprintf
+#endif
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
+#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
+#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
+#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
+#endif
+
+// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
+#ifdef _WIN32
+#define IM_NEWLINE "\r\n"
+#else
+#define IM_NEWLINE "\n"
+#endif
+
+#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
+
+//-----------------------------------------------------------------------------
+// DEMO CODE
+//-----------------------------------------------------------------------------
+
+#ifndef IMGUI_DISABLE_TEST_WINDOWS
+
+static void ShowExampleAppConsole(bool* opened);
+static void ShowExampleAppLog(bool* opened);
+static void ShowExampleAppLayout(bool* opened);
+static void ShowExampleAppLongText(bool* opened);
+static void ShowExampleAppAutoResize(bool* opened);
+static void ShowExampleAppFixedOverlay(bool* opened);
+static void ShowExampleAppManipulatingWindowTitle(bool* opened);
+static void ShowExampleAppCustomRendering(bool* opened);
+static void ShowExampleAppMainMenuBar();
+static void ShowExampleMenuFile();
+
+static void ShowHelpMarker(const char* desc)
+{
+ ImGui::TextDisabled("(?)");
+ if (ImGui::IsItemHovered())
+ ImGui::SetTooltip(desc);
+}
+
+void ImGui::ShowUserGuide()
+{
+ ImGui::BulletText("Double-click on title bar to collapse window.");
+ ImGui::BulletText("Click and drag on lower right corner to resize window.");
+ ImGui::BulletText("Click and drag on any empty space to move window.");
+ ImGui::BulletText("Mouse Wheel to scroll.");
+ if (ImGui::GetIO().FontAllowUserScaling)
+ ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
+ ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
+ ImGui::BulletText("CTRL+Click on a slider or drag box to input text.");
+ ImGui::BulletText(
+ "While editing text:\n"
+ "- Hold SHIFT or use mouse to select text\n"
+ "- CTRL+Left/Right to word jump\n"
+ "- CTRL+A or double-click to select all\n"
+ "- CTRL+X,CTRL+C,CTRL+V clipboard\n"
+ "- CTRL+Z,CTRL+Y undo/redo\n"
+ "- ESCAPE to revert\n"
+ "- You can apply arithmetic operators +,*,/ on numerical values.\n"
+ " Use +- to subtract.\n");
+}
+
+// Demonstrate most ImGui features (big function!)
+void ImGui::ShowTestWindow(bool* opened)
+{
+ // Examples apps
+ static bool show_app_metrics = false;
+ static bool show_app_main_menu_bar = false;
+ static bool show_app_console = false;
+ static bool show_app_log = false;
+ static bool show_app_layout = false;
+ static bool show_app_long_text = false;
+ static bool show_app_auto_resize = false;
+ static bool show_app_fixed_overlay = false;
+ static bool show_app_custom_rendering = false;
+ static bool show_app_manipulating_window_title = false;
+ static bool show_app_about = false;
+ if (show_app_metrics) ImGui::ShowMetricsWindow(&show_app_metrics);
+ if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
+ if (show_app_console) ShowExampleAppConsole(&show_app_console);
+ if (show_app_log) ShowExampleAppLog(&show_app_log);
+ if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
+ if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text);
+ if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize);
+ if (show_app_fixed_overlay) ShowExampleAppFixedOverlay(&show_app_fixed_overlay);
+ if (show_app_manipulating_window_title) ShowExampleAppManipulatingWindowTitle(&show_app_manipulating_window_title);
+ if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
+ if (show_app_about)
+ {
+ ImGui::Begin("About ImGui", &show_app_about, ImGuiWindowFlags_AlwaysAutoResize);
+ ImGui::Text("ImGui %s", ImGui::GetVersion());
+ ImGui::Separator();
+ ImGui::Text("By Omar Cornut and all github contributors.");
+ ImGui::Text("ImGui is licensed under the MIT License, see LICENSE for more information.");
+ ImGui::End();
+ }
+
+ static bool no_titlebar = false;
+ static bool no_border = true;
+ static bool no_resize = false;
+ static bool no_move = false;
+ static bool no_scrollbar = false;
+ static bool no_collapse = false;
+ static bool no_menu = false;
+ static float bg_alpha = 0.65f;
+
+ // Demonstrate the various window flags. Typically you would just use the default.
+ ImGuiWindowFlags window_flags = 0;
+ if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
+ if (!no_border) window_flags |= ImGuiWindowFlags_ShowBorders;
+ if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;
+ if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
+ if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
+ if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;
+ if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
+ if (!ImGui::Begin("ImGui Demo", opened, ImVec2(550,680), bg_alpha, window_flags))
+ {
+ // Early out if the window is collapsed, as an optimization.
+ ImGui::End();
+ return;
+ }
+
+ //ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // 2/3 of the space for widget and 1/3 for labels
+ ImGui::PushItemWidth(-140); // Right align, keep 140 pixels for labels
+
+ ImGui::Text("ImGui says hello.");
+
+ // Menu
+ if (ImGui::BeginMenuBar())
+ {
+ if (ImGui::BeginMenu("Menu"))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Examples"))
+ {
+ ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
+ ImGui::MenuItem("Console", NULL, &show_app_console);
+ ImGui::MenuItem("Log", NULL, &show_app_log);
+ ImGui::MenuItem("Simple layout", NULL, &show_app_layout);
+ ImGui::MenuItem("Long text display", NULL, &show_app_long_text);
+ ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize);
+ ImGui::MenuItem("Simple overlay", NULL, &show_app_fixed_overlay);
+ ImGui::MenuItem("Manipulating window title", NULL, &show_app_manipulating_window_title);
+ ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering);
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Help"))
+ {
+ ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
+ ImGui::MenuItem("About ImGui", NULL, &show_app_about);
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::Spacing();
+ if (ImGui::CollapsingHeader("Help"))
+ {
+ ImGui::TextWrapped("This window is being created by the ShowTestWindow() function. Please refer to the code for programming reference.\n\nUser Guide:");
+ ImGui::ShowUserGuide();
+ }
+
+ if (ImGui::CollapsingHeader("Window options"))
+ {
+ ImGui::Checkbox("no titlebar", &no_titlebar); ImGui::SameLine(150);
+ ImGui::Checkbox("no border", &no_border); ImGui::SameLine(300);
+ ImGui::Checkbox("no resize", &no_resize);
+ ImGui::Checkbox("no move", &no_move); ImGui::SameLine(150);
+ ImGui::Checkbox("no scrollbar", &no_scrollbar); ImGui::SameLine(300);
+ ImGui::Checkbox("no collapse", &no_collapse);
+ ImGui::Checkbox("no menu", &no_menu);
+ ImGui::SliderFloat("bg alpha", &bg_alpha, 0.0f, 1.0f);
+
+ if (ImGui::TreeNode("Style"))
+ {
+ ImGui::ShowStyleEditor();
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Fonts", "Fonts (%d)", ImGui::GetIO().Fonts->Fonts.Size))
+ {
+ ImGui::TextWrapped("Tip: Load fonts with io.Fonts->AddFontFromFileTTF().");
+ ImFontAtlas* atlas = ImGui::GetIO().Fonts;
+ if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
+ {
+ ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
+ ImGui::TreePop();
+ }
+ ImGui::PushItemWidth(100);
+ for (int i = 0; i < atlas->Fonts.Size; i++)
+ {
+ ImFont* font = atlas->Fonts[i];
+ ImGui::BulletText("Font %d: \'%s\', %.2f px, %d glyphs", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size);
+ ImGui::TreePush((void*)intptr_t(i));
+ if (i > 0) { ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { atlas->Fonts[i] = atlas->Fonts[0]; atlas->Fonts[0] = font; } }
+ ImGui::PushFont(font);
+ ImGui::Text("The quick brown fox jumps over the lazy dog");
+ ImGui::PopFont();
+ if (ImGui::TreeNode("Details"))
+ {
+ ImGui::DragFloat("font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // scale only this font
+ ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
+ ImGui::Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar);
+ for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
+ ImGui::BulletText("Input %d: \'%s\'", config_i, font->ConfigData[config_i].Name);
+ ImGui::TreePop();
+ }
+ ImGui::TreePop();
+ }
+ static float window_scale = 1.0f;
+ ImGui::DragFloat("this window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.1f"); // scale only this window
+ ImGui::DragFloat("global scale", &ImGui::GetIO().FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.1f"); // scale everything
+ ImGui::PopItemWidth();
+ ImGui::SetWindowFontScale(window_scale);
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Logging"))
+ {
+ ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded. You can also call ImGui::LogText() to output directly to the log without a visual output.");
+ ImGui::LogButtons();
+ ImGui::TreePop();
+ }
+ }
+
+ if (ImGui::CollapsingHeader("Widgets"))
+ {
+ if (ImGui::TreeNode("Tree"))
+ {
+ for (int i = 0; i < 5; i++)
+ {
+ if (ImGui::TreeNode((void*)intptr_t(i), "Child %d", i))
+ {
+ ImGui::Text("blah blah");
+ ImGui::SameLine();
+ if (ImGui::SmallButton("print"))
+ printf("Child %d pressed", i);
+ ImGui::TreePop();
+ }
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Bullets"))
+ {
+ ImGui::BulletText("Bullet point 1");
+ ImGui::BulletText("Bullet point 2\nOn multiple lines");
+ ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
+ ImGui::Bullet(); ImGui::SmallButton("Button");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Colored Text"))
+ {
+ // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
+ ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink");
+ ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow");
+ ImGui::TextDisabled("Disabled");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Word Wrapping"))
+ {
+ // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
+ ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
+ ImGui::Spacing();
+
+ static float wrap_width = 200.0f;
+ ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f");
+
+ ImGui::Text("Test paragraph 1:");
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+ ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), 0xFFFF00FF);
+ ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
+ ImGui::Text("lazy dog. This paragraph is made to fit within %.0f pixels. The quick brown fox jumps over the lazy dog.", wrap_width);
+ ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), 0xFF00FFFF);
+ ImGui::PopTextWrapPos();
+
+ ImGui::Text("Test paragraph 2:");
+ pos = ImGui::GetCursorScreenPos();
+ ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), 0xFFFF00FF);
+ ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width);
+ ImGui::Text("aaaaaaaa bbbbbbbb, cccccccc,dddddddd. eeeeeeee ffffffff. gggggggg!hhhhhhhh");
+ ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), 0xFF00FFFF);
+ ImGui::PopTextWrapPos();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("UTF-8 Text"))
+ {
+ // UTF-8 test with Japanese characters
+ // (needs a suitable font, try Arial Unicode or M+ fonts http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html)
+ // Most compiler appears to support UTF-8 in source code (with Visual Studio you need to save your file as 'UTF-8 without signature')
+ // However for the sake for maximum portability here we are *not* including raw UTF-8 character in this source file, instead we encode the string with hexadecimal constants.
+ // In your own application be reasonable and use UTF-8 in source or retrieve the data from file system!
+ // Note that characters values are preserved even if the font cannot be displayed, so you can safely copy & paste garbled characters into another application.
+ ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->LoadFromFileTTF() manually to load extra character ranges.");
+ ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
+ ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
+ static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
+ ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf));
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Images"))
+ {
+ 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!");
+ ImVec2 tex_screen_pos = ImGui::GetCursorScreenPos();
+ float tex_w = (float)ImGui::GetIO().Fonts->TexWidth;
+ float tex_h = (float)ImGui::GetIO().Fonts->TexHeight;
+ ImTextureID tex_id = ImGui::GetIO().Fonts->TexID;
+ ImGui::Text("%.0fx%.0f", tex_w, tex_h);
+ ImGui::Image(tex_id, ImVec2(tex_w, tex_h), ImVec2(0,0), ImVec2(1,1), ImColor(255,255,255,255), ImColor(255,255,255,128));
+ if (ImGui::IsItemHovered())
+ {
+ ImGui::BeginTooltip();
+ float focus_sz = 32.0f;
+ float focus_x = ImGui::GetMousePos().x - tex_screen_pos.x - focus_sz * 0.5f; if (focus_x < 0.0f) focus_x = 0.0f; else if (focus_x > tex_w - focus_sz) focus_x = tex_w - focus_sz;
+ float focus_y = ImGui::GetMousePos().y - tex_screen_pos.y - focus_sz * 0.5f; if (focus_y < 0.0f) focus_y = 0.0f; else if (focus_y > tex_h - focus_sz) focus_y = tex_h - focus_sz;
+ ImGui::Text("Min: (%.2f, %.2f)", focus_x, focus_y);
+ ImGui::Text("Max: (%.2f, %.2f)", focus_x + focus_sz, focus_y + focus_sz);
+ ImVec2 uv0 = ImVec2((focus_x) / tex_w, (focus_y) / tex_h);
+ ImVec2 uv1 = ImVec2((focus_x + focus_sz) / tex_w, (focus_y + focus_sz) / tex_h);
+ ImGui::Image(tex_id, ImVec2(128,128), uv0, uv1, ImColor(255,255,255,255), ImColor(255,255,255,128));
+ ImGui::EndTooltip();
+ }
+ ImGui::TextWrapped("And now some textured buttons..");
+ static int pressed_count = 0;
+ for (int i = 0; i < 8; i++)
+ {
+ if (i > 0)
+ ImGui::SameLine();
+ ImGui::PushID(i);
+ int frame_padding = -1 + i; // -1 = uses default padding
+ if (ImGui::ImageButton(tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/tex_w,32/tex_h), frame_padding, ImColor(0,0,0,255)))
+ pressed_count += 1;
+ ImGui::PopID();
+ }
+ ImGui::Text("Pressed %d times.", pressed_count);
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Selectables"))
+ {
+ if (ImGui::TreeNode("Basic"))
+ {
+ static bool selected[3] = { false, true, false };
+ ImGui::Selectable("1. I am selectable", &selected[0]);
+ ImGui::Selectable("2. I am selectable", &selected[1]);
+ ImGui::Text("3. I am not selectable");
+ ImGui::Selectable("4. I am selectable", &selected[2]);
+ ImGui::TreePop();
+ }
+ if (ImGui::TreeNode("Rendering more text into the same block"))
+ {
+ static bool selected[3] = { false, false, false };
+ ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
+ ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
+ ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
+ ImGui::TreePop();
+ }
+ if (ImGui::TreeNode("Grid"))
+ {
+ static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
+ for (int i = 0; i < 16; i++)
+ {
+ ImGui::PushID(i);
+ if (ImGui::Selectable("Me", &selected[i], 0, ImVec2(50,50)))
+ {
+ int x = i % 4, y = i / 4;
+ if (x > 0) selected[i - 1] ^= 1;
+ if (x < 3) selected[i + 1] ^= 1;
+ if (y > 0) selected[i - 4] ^= 1;
+ if (y < 3) selected[i + 4] ^= 1;
+ }
+ if ((i % 4) < 3) ImGui::SameLine();
+ ImGui::PopID();
+ }
+ ImGui::TreePop();
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Filtered Text Input"))
+ {
+ static char buf1[64] = ""; ImGui::InputText("default", buf1, 64);
+ static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal);
+ static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase);
+ static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase);
+ static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank);
+ struct TextFilters { static int FilterImGuiLetters(ImGuiTextEditCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } };
+ static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters);
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Multi-line Text Input"))
+ {
+ static bool read_only = false;
+ static char text[1024*16] = "// F00F bug\nlabel:\n\tlock cmpxchg8b eax\n";
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
+ ImGui::Checkbox("Read-only", &read_only);
+ ImGui::PopStyleVar();
+ ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-1.0f, ImGui::GetTextLineHeight() * 16), ImGuiInputTextFlags_AllowTabInput | (read_only ? ImGuiInputTextFlags_ReadOnly : 0));
+ ImGui::TreePop();
+ }
+
+ static bool a=false;
+ if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; }
+ if (a)
+ {
+ ImGui::SameLine();
+ ImGui::Text("Thanks for clicking me!");
+ }
+
+ static bool check = true;
+ ImGui::Checkbox("checkbox", &check);
+
+ static int e = 0;
+ ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine();
+ ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine();
+ ImGui::RadioButton("radio c", &e, 2);
+
+ // Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style.
+ for (int i = 0; i < 7; i++)
+ {
+ if (i > 0) ImGui::SameLine();
+ ImGui::PushID(i);
+ ImGui::PushStyleColor(ImGuiCol_Button, ImColor::HSV(i/7.0f, 0.6f, 0.6f));
+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImColor::HSV(i/7.0f, 0.7f, 0.7f));
+ ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImColor::HSV(i/7.0f, 0.8f, 0.8f));
+ ImGui::Button("Click");
+ ImGui::PopStyleColor(3);
+ ImGui::PopID();
+ }
+
+ ImGui::Text("Hover over me");
+ if (ImGui::IsItemHovered())
+ ImGui::SetTooltip("I am a tooltip");
+
+ ImGui::SameLine();
+ ImGui::Text("- or me");
+ if (ImGui::IsItemHovered())
+ {
+ ImGui::BeginTooltip();
+ ImGui::Text("I am a fancy tooltip");
+ static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
+ ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
+ ImGui::EndTooltip();
+ }
+
+ // Testing IMGUI_ONCE_UPON_A_FRAME macro
+ //for (int i = 0; i < 5; i++)
+ //{
+ // IMGUI_ONCE_UPON_A_FRAME
+ // {
+ // ImGui::Text("This will be displayed only once.");
+ // }
+ //}
+
+ ImGui::Separator();
+
+ ImGui::LabelText("label", "Value");
+
+ static int item = 1;
+ ImGui::Combo("combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); // Combo using values packed in a single constant string (for really quick combo)
+
+ const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK" };
+ static int item2 = -1;
+ ImGui::Combo("combo scroll", &item2, items, IM_ARRAYSIZE(items)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
+
+ {
+ static char str0[128] = "Hello, world!";
+ static int i0=123;
+ static float f0=0.001f;
+ ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
+ ImGui::SameLine(); ShowHelpMarker("Hold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n");
+
+ ImGui::InputInt("input int", &i0);
+ ImGui::SameLine(); ShowHelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
+
+ ImGui::InputFloat("input float", &f0, 0.01f, 1.0f);
+
+ static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
+ ImGui::InputFloat3("input float3", vec4a);
+ }
+
+ {
+ static int i1=50, i2=42;
+ ImGui::DragInt("drag int", &i1, 1);
+ ImGui::SameLine(); ShowHelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
+
+ ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%.0f%%");
+
+ static float f1=1.00f, f2=0.0067f;
+ ImGui::DragFloat("drag float", &f1, 0.005f);
+ ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns");
+ }
+
+ {
+ static int i1=0;
+ ImGui::SliderInt("slider int", &i1, -1, 3);
+ ImGui::SameLine(); ShowHelpMarker("CTRL+click to input value.");
+
+ static float f1=0.123f, f2=0.0f;
+ ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");
+ ImGui::SliderFloat("slider log float", &f2, -10.0f, 10.0f, "%.4f", 3.0f);
+ static float angle = 0.0f;
+ ImGui::SliderAngle("slider angle", &angle);
+ }
+
+ static float col1[3] = { 1.0f,0.0f,0.2f };
+ static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
+ ImGui::ColorEdit3("color 1", col1);
+ ImGui::SameLine(); ShowHelpMarker("Click on the colored square to change edit mode.\nCTRL+click on individual component to input value.\n");
+
+ ImGui::ColorEdit4("color 2", col2);
+
+ const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
+ static int listbox_item_current = 1;
+ ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
+
+ //static int listbox_item_current2 = 2;
+ //ImGui::PushItemWidth(-1);
+ //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
+ //ImGui::PopItemWidth();
+
+ if (ImGui::TreeNode("Range Widgets"))
+ {
+ ImGui::Unindent();
+
+ static float begin = 10, end = 90;
+ static int begin_i = 100, end_i = 1000;
+ ImGui::DragFloatRange2("range", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%");
+ ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %.0f units", "Max: %.0f units");
+
+ ImGui::Indent();
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Multi-component Widgets"))
+ {
+ ImGui::Unindent();
+
+ static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
+ static int vec4i[4] = { 1, 5, 100, 255 };
+
+ ImGui::InputFloat2("input float2", vec4f);
+ ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
+ ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
+ ImGui::InputInt2("input int2", vec4i);
+ ImGui::SliderInt2("slider int2", vec4i, 0, 255);
+ ImGui::Spacing();
+
+ ImGui::InputFloat3("input float3", vec4f);
+ ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
+ ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
+ ImGui::InputInt3("input int3", vec4i);
+ ImGui::SliderInt3("slider int3", vec4i, 0, 255);
+ ImGui::Spacing();
+
+ ImGui::InputFloat4("input float4", vec4f);
+ ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
+ ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
+ ImGui::InputInt4("input int4", vec4i);
+ ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
+ ImGui::SliderInt4("slider int4", vec4i, 0, 255);
+
+ ImGui::Indent();
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Vertical Sliders"))
+ {
+ ImGui::Unindent();
+ const float spacing = 4;
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing));
+
+ static int int_value = 0;
+ ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5);
+ ImGui::SameLine();
+
+ static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
+ ImGui::PushID("set1");
+ for (int i = 0; i < 7; i++)
+ {
+ if (i > 0) ImGui::SameLine();
+ ImGui::PushID(i);
+ ImGui::PushStyleColor(ImGuiCol_FrameBg, ImColor::HSV(i/7.0f, 0.5f, 0.5f));
+ ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImColor::HSV(i/7.0f, 0.6f, 0.5f));
+ ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImColor::HSV(i/7.0f, 0.7f, 0.5f));
+ ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImColor::HSV(i/7.0f, 0.9f, 0.9f));
+ ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, "");
+ if (ImGui::IsItemActive() || ImGui::IsItemHovered())
+ ImGui::SetTooltip("%.3f", values[i]);
+ ImGui::PopStyleColor(4);
+ ImGui::PopID();
+ }
+ ImGui::PopID();
+
+ ImGui::SameLine();
+ ImGui::PushID("set2");
+ static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
+ const int rows = 3;
+ const ImVec2 small_slider_size(18, (160.0f-(rows-1)*spacing)/rows);
+ for (int nx = 0; nx < 4; nx++)
+ {
+ if (nx > 0) ImGui::SameLine();
+ ImGui::BeginGroup();
+ for (int ny = 0; ny < rows; ny++)
+ {
+ ImGui::PushID(nx*rows+ny);
+ ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, "");
+ if (ImGui::IsItemActive() || ImGui::IsItemHovered())
+ ImGui::SetTooltip("%.3f", values2[nx]);
+ ImGui::PopID();
+ }
+ ImGui::EndGroup();
+ }
+ ImGui::PopID();
+
+ ImGui::SameLine();
+ ImGui::PushID("set3");
+ for (int i = 0; i < 4; i++)
+ {
+ if (i > 0) ImGui::SameLine();
+ ImGui::PushID(i);
+ ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40);
+ ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f");
+ ImGui::PopStyleVar();
+ ImGui::PopID();
+ }
+ ImGui::PopID();
+ ImGui::PopStyleVar();
+
+ ImGui::Indent();
+ ImGui::TreePop();
+ }
+ }
+
+ if (ImGui::CollapsingHeader("Graphs widgets"))
+ {
+ static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
+ ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
+
+ static bool pause;
+ static ImVector<float> values; if (values.empty()) { values.resize(90); memset(values.Data, 0, values.Size*sizeof(float)); }
+ static int values_offset = 0;
+ if (!pause)
+ {
+ static float refresh_time = ImGui::GetTime(); // Create dummy data at fixed 60 hz rate for the demo
+ for (; ImGui::GetTime() > refresh_time + 1.0f/60.0f; refresh_time += 1.0f/60.0f)
+ {
+ static float phase = 0.0f;
+ values[values_offset] = cosf(phase);
+ values_offset = (values_offset+1)%values.Size;
+ phase += 0.10f*values_offset;
+ }
+ }
+ ImGui::PlotLines("##Lines", values.Data, values.Size, values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,80));
+ ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x);
+ ImGui::BeginGroup();
+ ImGui::Text("Lines");
+ ImGui::Checkbox("pause", &pause);
+ ImGui::EndGroup();
+ ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80));
+
+ // Use functions to generate output
+ // FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count.
+ struct Funcs
+ {
+ static float Sin(void*, int i) { return sinf(i * 0.1f); }
+ static float Saw(void*, int i) { return (i & 1) ? 1.0f : 0.0f; }
+ };
+ static int func_type = 0, display_count = 70;
+ ImGui::Separator();
+ ImGui::PushItemWidth(100); ImGui::Combo("func", &func_type, "Sin\0Saw\0"); ImGui::PopItemWidth();
+ ImGui::SameLine();
+ ImGui::SliderInt("Sample count", &display_count, 1, 500);
+ float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
+ ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80));
+ ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80));
+ }
+
+ if (ImGui::CollapsingHeader("Layout"))
+ {
+ if (ImGui::TreeNode("Child regions"))
+ {
+ ImGui::Text("Without border");
+ static int line = 50;
+ bool goto_line = ImGui::Button("Goto");
+ ImGui::SameLine();
+ ImGui::PushItemWidth(100);
+ goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
+ ImGui::PopItemWidth();
+ ImGui::BeginChild("Sub1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f,300), false, ImGuiWindowFlags_HorizontalScrollbar);
+ for (int i = 0; i < 100; i++)
+ {
+ ImGui::Text("%04d: scrollable region", i);
+ if (goto_line && line == i)
+ ImGui::SetScrollHere();
+ }
+ if (goto_line && line >= 100)
+ ImGui::SetScrollHere();
+ ImGui::EndChild();
+
+ ImGui::SameLine();
+
+ ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, 5.0f);
+ ImGui::BeginChild("Sub2", ImVec2(0,300), true);
+ ImGui::Text("With border");
+ ImGui::Columns(2);
+ for (int i = 0; i < 100; i++)
+ {
+ if (i == 50)
+ ImGui::NextColumn();
+ char buf[32];
+ sprintf(buf, "%08x", i*5731);
+ ImGui::Button(buf, ImVec2(-1.0f, 0.0f));
+ }
+ ImGui::EndChild();
+ ImGui::PopStyleVar();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Widgets Alignment"))
+ {
+ static float f = 0.0f;
+ ImGui::Text("PushItemWidth(100)");
+ ImGui::PushItemWidth(100);
+ ImGui::DragFloat("float##1", &f);
+ ImGui::PopItemWidth();
+
+ ImGui::Text("PushItemWidth(GetWindowWidth() * 0.5f);");
+ ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
+ ImGui::DragFloat("float##2", &f);
+ ImGui::PopItemWidth();
+
+ ImGui::Text("PushItemWidth(GetContentRegionAvailWidth() * 0.5f);");
+ ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() * 0.5f);
+ ImGui::DragFloat("float##3", &f);
+ ImGui::PopItemWidth();
+
+ ImGui::Text("PushItemWidth(-100);");
+ ImGui::PushItemWidth(-100);
+ ImGui::DragFloat("float##4", &f);
+ ImGui::PopItemWidth();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Basic Horizontal Layout"))
+ {
+ ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceeding item)");
+
+ // Text
+ ImGui::Text("Two items: Hello"); ImGui::SameLine();
+ ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
+
+ // Adjust spacing
+ ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20);
+ ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
+
+ // Button
+ ImGui::AlignFirstTextHeightToWidgets();
+ ImGui::Text("Normal buttons"); ImGui::SameLine();
+ ImGui::Button("Banana"); ImGui::SameLine();
+ ImGui::Button("Apple"); ImGui::SameLine();
+ ImGui::Button("Corniflower");
+
+ // Button
+ ImGui::Text("Small buttons"); ImGui::SameLine();
+ ImGui::SmallButton("Like this one"); ImGui::SameLine();
+ ImGui::Text("can fit within a text block.");
+
+ // Aligned to arbitrary position. Easy/cheap column.
+ ImGui::Text("Aligned");
+ ImGui::SameLine(150); ImGui::Text("x=150");
+ ImGui::SameLine(300); ImGui::Text("x=300");
+ ImGui::Text("Aligned");
+ ImGui::SameLine(150); ImGui::SmallButton("x=150");
+ ImGui::SameLine(300); ImGui::SmallButton("x=300");
+
+ // Checkbox
+ static bool c1=false,c2=false,c3=false,c4=false;
+ ImGui::Checkbox("My", &c1); ImGui::SameLine();
+ ImGui::Checkbox("Tailor", &c2); ImGui::SameLine();
+ ImGui::Checkbox("Is", &c3); ImGui::SameLine();
+ ImGui::Checkbox("Rich", &c4);
+
+ // Various
+ static float f0=1.0f, f1=2.0f, f2=3.0f;
+ ImGui::PushItemWidth(80);
+ const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
+ static int item = -1;
+ ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine();
+ ImGui::SliderFloat("X", &f0, 0.0f,5.0f); ImGui::SameLine();
+ ImGui::SliderFloat("Y", &f1, 0.0f,5.0f); ImGui::SameLine();
+ ImGui::SliderFloat("Z", &f2, 0.0f,5.0f);
+ ImGui::PopItemWidth();
+
+ ImGui::PushItemWidth(80);
+ ImGui::Text("Lists:");
+ static int selection[4] = { 0, 1, 2, 3 };
+ for (int i = 0; i < 4; i++)
+ {
+ if (i > 0) ImGui::SameLine();
+ ImGui::PushID(i);
+ ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items));
+ ImGui::PopID();
+ //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i);
+ }
+ ImGui::PopItemWidth();
+
+ // Dummy
+ ImVec2 sz(30,30);
+ ImGui::Button("A", sz); ImGui::SameLine();
+ ImGui::Dummy(sz); ImGui::SameLine();
+ ImGui::Button("B", sz);
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Groups"))
+ {
+ ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
+ ImGui::BeginGroup();
+ {
+ ImGui::BeginGroup();
+ ImGui::Button("AAA");
+ ImGui::SameLine();
+ ImGui::Button("BBB");
+ ImGui::SameLine();
+ ImGui::BeginGroup();
+ ImGui::Button("CCC");
+ ImGui::Button("DDD");
+ ImGui::EndGroup();
+ if (ImGui::IsItemHovered())
+ ImGui::SetTooltip("Group hovered");
+ ImGui::SameLine();
+ ImGui::Button("EEE");
+ ImGui::EndGroup();
+ }
+ // Capture the group size and create widgets using the same size
+ ImVec2 size = ImGui::GetItemRectSize();
+ const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f };
+ ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size);
+
+ ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
+ ImGui::SameLine();
+ ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f,size.y));
+ ImGui::EndGroup();
+ ImGui::SameLine();
+
+ ImGui::Button("LEVERAGE\nBUZZWORD", size);
+ ImGui::SameLine();
+
+ ImGui::ListBoxHeader("List", size);
+ ImGui::Selectable("Selected", true);
+ ImGui::Selectable("Not Selected", false);
+ ImGui::ListBoxFooter();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Text Baseline Alignment"))
+ {
+ ImGui::TextWrapped("(This is testing the vertical alignment that occurs on text to keep it at the same baseline as widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets)");
+
+ ImGui::Text("One\nTwo\nThree"); ImGui::SameLine();
+ ImGui::Text("Hello\nWorld"); ImGui::SameLine();
+ ImGui::Text("Banana");
+
+ ImGui::Text("Banana"); ImGui::SameLine();
+ ImGui::Text("Hello\nWorld"); ImGui::SameLine();
+ ImGui::Text("One\nTwo\nThree");
+
+ ImGui::Button("HOP"); ImGui::SameLine();
+ ImGui::Text("Banana"); ImGui::SameLine();
+ ImGui::Text("Hello\nWorld"); ImGui::SameLine();
+ ImGui::Text("Banana");
+
+ ImGui::Button("HOP"); ImGui::SameLine();
+ ImGui::Text("Hello\nWorld"); ImGui::SameLine();
+ ImGui::Text("Banana");
+
+ ImGui::Button("TEST"); ImGui::SameLine();
+ ImGui::Text("TEST"); ImGui::SameLine();
+ ImGui::SmallButton("TEST");
+
+ ImGui::AlignFirstTextHeightToWidgets(); // If your line starts with text, call this to align it to upcoming widgets.
+ ImGui::Text("Text aligned to Widget"); ImGui::SameLine();
+ ImGui::Button("Widget"); ImGui::SameLine();
+ ImGui::Text("Widget"); ImGui::SameLine();
+ ImGui::SmallButton("Widget");
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Scrolling"))
+ {
+ ImGui::TextWrapped("(Use SetScrollHere() or SetScrollFromPosY() to scroll to a given position.)");
+ static bool track = true;
+ static int track_line = 50, scroll_to_px = 200;
+ ImGui::Checkbox("Track", &track);
+ ImGui::SameLine(130); track |= ImGui::DragInt("##line", &track_line, 0.25f, 0, 99, "Line %.0f");
+ bool scroll_to = ImGui::Button("Scroll To");
+ ImGui::SameLine(130); scroll_to |= ImGui::DragInt("##pos_y", &scroll_to_px, 1.00f, 0, 9999, "y = %.0f px");
+ if (scroll_to) track = false;
+
+ for (int i = 0; i < 5; i++)
+ {
+ if (i > 0) ImGui::SameLine();
+ ImGui::BeginGroup();
+ ImGui::Text("%s", i == 0 ? "Top" : i == 1 ? "25%" : i == 2 ? "Center" : i == 3 ? "75%" : "Bottom");
+ ImGui::BeginChild(ImGui::GetID((void*)intptr_t(i)), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
+ if (scroll_to)
+ ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_px, i * 0.25f);
+ for (int line = 0; line < 100; line++)
+ {
+ if (track && line == track_line)
+ {
+ ImGui::TextColored(ImColor(255,255,0), "Line %d", line);
+ ImGui::SetScrollHere(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom
+ }
+ else
+ {
+ ImGui::Text("Line %d", line);
+ }
+ }
+ ImGui::EndChild();
+ ImGui::EndGroup();
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Horizontal Scrolling"))
+ {
+ ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
+ ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
+ static int lines = 7;
+ ImGui::SliderInt("Lines", &lines, 1, 15);
+ ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
+ ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
+ for (int line = 0; line < lines; line++)
+ {
+ // Display random stuff
+ int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
+ for (int n = 0; n < num_buttons; n++)
+ {
+ if (n > 0) ImGui::SameLine();
+ ImGui::PushID(n + line * 1000);
+ char num_buf[16];
+ const char* label = (!(n%15)) ? "FizzBuzz" : (!(n%3)) ? "Fizz" : (!(n%5)) ? "Buzz" : (sprintf(num_buf, "%d", n), num_buf);
+ float hue = n*0.05f;
+ ImGui::PushStyleColor(ImGuiCol_Button, ImColor::HSV(hue, 0.6f, 0.6f));
+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImColor::HSV(hue, 0.7f, 0.7f));
+ ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImColor::HSV(hue, 0.8f, 0.8f));
+ ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f));
+ ImGui::PopStyleColor(3);
+ ImGui::PopID();
+ }
+ }
+ ImGui::EndChild();
+ ImGui::PopStyleVar(2);
+ float scroll_x_delta = 0.0f;
+ ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f;
+ ImGui::SameLine(); ImGui::Text("Scroll from code"); ImGui::SameLine();
+ ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f;
+ if (scroll_x_delta != 0.0f)
+ {
+ ImGui::BeginChild("scrolling"); // Demonstrate a trick: you can use Begin to set yourself in the context of another window (here we are already out of your child window)
+ ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta);
+ ImGui::End();
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Clipping"))
+ {
+ static ImVec2 size(100, 100), offset(50, 20);
+ ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost.");
+ ImGui::DragFloat2("size", (float*)&size, 0.5f, 0.0f, 200.0f, "%.0f");
+ ImGui::DragFloat2("offset", (float*)&offset, 0.5f, -200, 200.0f, "%.0f");
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+ ImVec4 clip_rect(pos.x, pos.y, pos.x+size.x, pos.y+size.y);
+ ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x+size.x,pos.y+size.y), ImColor(90,90,120,255));
+ ImGui::GetWindowDrawList()->AddText(ImGui::GetWindowFont(), ImGui::GetWindowFontSize()*2.0f, ImVec2(pos.x+offset.x,pos.y+offset.y), ImColor(255,255,255,255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect);
+ ImGui::InvisibleButton("##dummy", size);
+ if (ImGui::IsItemActive() && ImGui::IsMouseDragging()) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; }
+ ImGui::TreePop();
+ }
+ }
+
+ if (ImGui::CollapsingHeader("Popups & Modal windows"))
+ {
+ if (ImGui::TreeNode("Popups"))
+ {
+ ImGui::TextWrapped("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it.");
+
+ static int selected_fish = -1;
+ const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" };
+ static bool toggles[] = { true, false, false, false, false };
+
+ if (ImGui::Button("Select.."))
+ ImGui::OpenPopup("select");
+ ImGui::SameLine();
+ ImGui::Text(selected_fish == -1 ? "<None>" : names[selected_fish]);
+ if (ImGui::BeginPopup("select"))
+ {
+ ImGui::Text("Aquarium");
+ ImGui::Separator();
+ for (int i = 0; i < IM_ARRAYSIZE(names); i++)
+ if (ImGui::Selectable(names[i]))
+ selected_fish = i;
+ ImGui::EndPopup();
+ }
+
+ if (ImGui::Button("Toggle.."))
+ ImGui::OpenPopup("toggle");
+ if (ImGui::BeginPopup("toggle"))
+ {
+ for (int i = 0; i < IM_ARRAYSIZE(names); i++)
+ ImGui::MenuItem(names[i], "", &toggles[i]);
+ if (ImGui::BeginMenu("Sub-menu"))
+ {
+ ImGui::MenuItem("Click me");
+ ImGui::EndMenu();
+ }
+
+ ImGui::Separator();
+ ImGui::Text("Tooltip here");
+ if (ImGui::IsItemHovered())
+ ImGui::SetTooltip("I am a tooltip over a popup");
+
+ if (ImGui::Button("Stacked Popup"))
+ ImGui::OpenPopup("another popup");
+ if (ImGui::BeginPopup("another popup"))
+ {
+ for (int i = 0; i < IM_ARRAYSIZE(names); i++)
+ ImGui::MenuItem(names[i], "", &toggles[i]);
+ if (ImGui::BeginMenu("Sub-menu"))
+ {
+ ImGui::MenuItem("Click me");
+ ImGui::EndMenu();
+ }
+ ImGui::EndPopup();
+ }
+ ImGui::EndPopup();
+ }
+
+ if (ImGui::Button("Popup Menu.."))
+ ImGui::OpenPopup("popup from button");
+ if (ImGui::BeginPopup("popup from button"))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndPopup();
+ }
+
+ ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
+ ImGui::Separator();
+ ImGui::MenuItem("Menu item", "CTRL+M");
+ if (ImGui::BeginMenu("Menu"))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ ImGui::Separator();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Context menus"))
+ {
+ static float value = 0.5f;
+ ImGui::Text("Value = %.3f (<-- right-click here)", value);
+ if (ImGui::BeginPopupContextItem("item context menu"))
+ {
+ if (ImGui::Selectable("Set to zero")) value = 0.0f;
+ if (ImGui::Selectable("Set to PI")) value = 3.1415f;
+ ImGui::EndPopup();
+ }
+
+ static ImVec4 color = ImColor(1.0f, 0.0f, 1.0f, 1.0f);
+ ImGui::ColorButton(color);
+ if (ImGui::BeginPopupContextItem("color context menu"))
+ {
+ ImGui::Text("Edit color");
+ ImGui::ColorEdit3("##edit", (float*)&color);
+ if (ImGui::Button("Close"))
+ ImGui::CloseCurrentPopup();
+ ImGui::EndPopup();
+ }
+ ImGui::SameLine(); ImGui::Text("(<-- right-click here)");
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Modals"))
+ {
+ ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window.");
+
+ if (ImGui::Button("Delete.."))
+ ImGui::OpenPopup("Delete?");
+ if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
+ {
+ ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
+ ImGui::Separator();
+
+ static bool dont_ask_me_next_time = false;
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
+ ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time);
+ ImGui::PopStyleVar();
+
+ if (ImGui::Button("OK", ImVec2(120,0))) { ImGui::CloseCurrentPopup(); }
+ ImGui::SameLine();
+ if (ImGui::Button("Cancel", ImVec2(120,0))) { ImGui::CloseCurrentPopup(); }
+ ImGui::EndPopup();
+ }
+
+ if (ImGui::Button("Stacked modals.."))
+ ImGui::OpenPopup("Stacked 1");
+ if (ImGui::BeginPopupModal("Stacked 1"))
+ {
+ ImGui::Text("Hello from Stacked The First");
+
+ if (ImGui::Button("Another one.."))
+ ImGui::OpenPopup("Stacked 2");
+ if (ImGui::BeginPopupModal("Stacked 2"))
+ {
+ ImGui::Text("Hello from Stacked The Second");
+ if (ImGui::Button("Close"))
+ ImGui::CloseCurrentPopup();
+ ImGui::EndPopup();
+ }
+
+ if (ImGui::Button("Close"))
+ ImGui::CloseCurrentPopup();
+ ImGui::EndPopup();
+ }
+
+ ImGui::TreePop();
+ }
+ }
+
+ if (ImGui::CollapsingHeader("Columns"))
+ {
+ // Basic columns
+ ImGui::Text("Basic:");
+ ImGui::Columns(4, "mycolumns");
+ ImGui::Separator();
+ ImGui::Text("ID"); ImGui::NextColumn();
+ ImGui::Text("Name"); ImGui::NextColumn();
+ ImGui::Text("Path"); ImGui::NextColumn();
+ ImGui::Text("Flags"); ImGui::NextColumn();
+ ImGui::Separator();
+ const char* names[3] = { "One", "Two", "Three" };
+ const char* paths[3] = { "/path/one", "/path/two", "/path/three" };
+ static int selected = -1;
+ for (int i = 0; i < 3; i++)
+ {
+ char label[32];
+ sprintf(label, "%04d", i);
+ if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SpanAllColumns))
+ selected = i;
+ ImGui::NextColumn();
+ ImGui::Text(names[i]); ImGui::NextColumn();
+ ImGui::Text(paths[i]); ImGui::NextColumn();
+ ImGui::Text("...."); ImGui::NextColumn();
+ }
+ ImGui::Columns(1);
+
+ ImGui::Separator();
+ ImGui::Spacing();
+
+ // Scrolling columns
+ /*
+ ImGui::Text("Scrolling:");
+ ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y));
+ ImGui::Columns(3);
+ ImGui::Text("ID"); ImGui::NextColumn();
+ ImGui::Text("Name"); ImGui::NextColumn();
+ ImGui::Text("Path"); ImGui::NextColumn();
+ ImGui::Columns(1);
+ ImGui::Separator();
+ ImGui::EndChild();
+ ImGui::BeginChild("##scrollingregion", ImVec2(0, 60));
+ ImGui::Columns(3);
+ for (int i = 0; i < 10; i++)
+ {
+ ImGui::Text("%04d", i); ImGui::NextColumn();
+ ImGui::Text("Foobar"); ImGui::NextColumn();
+ ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn();
+ }
+ ImGui::Columns(1);
+ ImGui::EndChild();
+
+ ImGui::Separator();
+ ImGui::Spacing();
+ */
+
+ // Create multiple items in a same cell before switching to next column
+ ImGui::Text("Mixed items:");
+ ImGui::Columns(3, "mixed");
+ ImGui::Separator();
+
+ static int e = 0;
+ ImGui::Text("Hello");
+ ImGui::Button("Banana");
+ ImGui::RadioButton("radio a", &e, 0);
+ ImGui::NextColumn();
+
+ ImGui::Text("ImGui");
+ ImGui::Button("Apple");
+ ImGui::RadioButton("radio b", &e, 1);
+ static float foo = 1.0f;
+ ImGui::InputFloat("red", &foo, 0.05f, 0, 3);
+ ImGui::Text("An extra line here.");
+ ImGui::NextColumn();
+
+ ImGui::Text("Sailor");
+ ImGui::Button("Corniflower");
+ ImGui::RadioButton("radio c", &e, 2);
+ static float bar = 1.0f;
+ ImGui::InputFloat("blue", &bar, 0.05f, 0, 3);
+ ImGui::NextColumn();
+
+ if (ImGui::CollapsingHeader("Category A")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
+ if (ImGui::CollapsingHeader("Category B")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
+ if (ImGui::CollapsingHeader("Category C")) ImGui::Text("Blah blah blah"); ImGui::NextColumn();
+ ImGui::Columns(1);
+
+ ImGui::Separator();
+ ImGui::Spacing();
+
+ // Tree items
+ ImGui::Text("Tree items:");
+ ImGui::Columns(2, "tree items");
+ ImGui::Separator();
+ if (ImGui::TreeNode("Hello")) { ImGui::BulletText("Sailor"); ImGui::TreePop(); } ImGui::NextColumn();
+ if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Marin"); ImGui::TreePop(); } ImGui::NextColumn();
+ ImGui::Columns(1);
+
+ ImGui::Separator();
+ ImGui::Spacing();
+
+ // Word wrapping
+ ImGui::Text("Word-wrapping:");
+ ImGui::Columns(2, "word-wrapping");
+ ImGui::Separator();
+ ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
+ ImGui::Text("Hello Left");
+ ImGui::NextColumn();
+ ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
+ ImGui::Text("Hello Right");
+ ImGui::Columns(1);
+
+ ImGui::Separator();
+ ImGui::Spacing();
+
+ if (ImGui::TreeNode("Inside a tree.."))
+ {
+ if (ImGui::TreeNode("node 1 (with borders)"))
+ {
+ ImGui::Columns(4);
+ for (int i = 0; i < 8; i++)
+ {
+ ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
+ ImGui::NextColumn();
+ }
+ ImGui::Columns(1);
+ ImGui::TreePop();
+ }
+ if (ImGui::TreeNode("node 2 (without borders)"))
+ {
+ ImGui::Columns(4, NULL, false);
+ for (int i = 0; i < 8; i++)
+ {
+ ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
+ ImGui::NextColumn();
+ }
+ ImGui::Columns(1);
+ ImGui::TreePop();
+ }
+ ImGui::TreePop();
+ }
+ }
+
+ if (ImGui::CollapsingHeader("Filtering"))
+ {
+ static ImGuiTextFilter filter;
+ ImGui::Text("Filter usage:\n"
+ " \"\" display all lines\n"
+ " \"xxx\" display lines containing \"xxx\"\n"
+ " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
+ " \"-xxx\" hide lines containing \"xxx\"");
+ filter.Draw();
+ const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
+ for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
+ if (filter.PassFilter(lines[i]))
+ ImGui::BulletText("%s", lines[i]);
+ }
+
+ if (ImGui::CollapsingHeader("Keyboard, Mouse & Focus"))
+ {
+ if (ImGui::TreeNode("Tabbing"))
+ {
+ ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
+ static char buf[32] = "dummy";
+ ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
+ ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
+ ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
+ ImGui::PushAllowKeyboardFocus(false);
+ ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
+ //ImGui::SameLine(); ShowHelperMarker("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets.");
+ ImGui::PopAllowKeyboardFocus();
+ ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Focus from code"))
+ {
+ bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
+ bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine();
+ bool focus_3 = ImGui::Button("Focus on 3");
+ int has_focus = 0;
+ static char buf[128] = "click on a button to set focus";
+
+ if (focus_1) ImGui::SetKeyboardFocusHere();
+ ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
+ if (ImGui::IsItemActive()) has_focus = 1;
+
+ if (focus_2) ImGui::SetKeyboardFocusHere();
+ ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
+ if (ImGui::IsItemActive()) has_focus = 2;
+
+ ImGui::PushAllowKeyboardFocus(false);
+ if (focus_3) ImGui::SetKeyboardFocusHere();
+ ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
+ if (ImGui::IsItemActive()) has_focus = 3;
+ ImGui::PopAllowKeyboardFocus();
+ if (has_focus)
+ ImGui::Text("Item with focus: %d", has_focus);
+ else
+ ImGui::Text("Item with focus: <none>");
+ ImGui::TextWrapped("Cursor & selection are preserved when refocusing last used item in code.");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Dragging"))
+ {
+ ImGui::TextWrapped("You can use ImGui::GetItemActiveDragDelta() to query for the dragged amount on any widget.");
+ ImGui::Button("Drag Me");
+ if (ImGui::IsItemActive())
+ {
+ // Draw a line between the button and the mouse cursor
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+ draw_list->PushClipRectFullScreen();
+ draw_list->AddLine(ImGui::CalcItemRectClosestPoint(ImGui::GetIO().MousePos, true, -2.0f), ImGui::GetIO().MousePos, ImColor(ImGui::GetStyle().Colors[ImGuiCol_Button]), 4.0f);
+ draw_list->PopClipRect();
+ ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f);
+ ImVec2 value_with_lock_threshold = ImGui::GetMouseDragDelta(0);
+ ImVec2 mouse_delta = ImGui::GetIO().MouseDelta;
+ ImGui::SameLine(); ImGui::Text("Raw (%.1f, %.1f), WithLockThresold (%.1f, %.1f), MouseDelta (%.1f, %.1f)", value_raw.x, value_raw.y, value_with_lock_threshold.x, value_with_lock_threshold.y, mouse_delta.x, mouse_delta.y);
+ }
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Keyboard & Mouse State"))
+ {
+ ImGuiIO& io = ImGui::GetIO();
+
+ ImGui::Text("MousePos: (%g, %g)", io.MousePos.x, io.MousePos.y);
+ ImGui::Text("Mouse down:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
+ ImGui::Text("Mouse clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
+ ImGui::Text("Mouse dbl-clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
+ ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
+ ImGui::Text("MouseWheel: %.1f", io.MouseWheel);
+
+ ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (io.KeysDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("%d (%.02f secs)", i, io.KeysDownDuration[i]); }
+ ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d", i); }
+ ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d", i); }
+ ImGui::Text("KeyMods: %s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "");
+
+ ImGui::Text("WantCaptureMouse: %s", io.WantCaptureMouse ? "true" : "false");
+ ImGui::Text("WantCaptureKeyboard: %s", io.WantCaptureKeyboard ? "true" : "false");
+ ImGui::Text("WantTextInput: %s", io.WantTextInput ? "true" : "false");
+
+ ImGui::Button("Hover me\nto enforce\ninputs capture");
+ if (ImGui::IsItemHovered())
+ ImGui::CaptureKeyboardFromApp();
+
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Mouse cursors"))
+ {
+ ImGui::TextWrapped("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. You can also set io.MouseDrawCursor to ask ImGui to render the cursor for you in software.");
+ ImGui::Checkbox("io.MouseDrawCursor", &ImGui::GetIO().MouseDrawCursor);
+ ImGui::Text("Hover to see mouse cursors:");
+ for (int i = 0; i < ImGuiMouseCursor_Count_; i++)
+ {
+ char label[32];
+ sprintf(label, "Mouse cursor %d", i);
+ ImGui::Bullet(); ImGui::Selectable(label, false);
+ if (ImGui::IsItemHovered())
+ ImGui::SetMouseCursor(i);
+ }
+ ImGui::TreePop();
+ }
+ }
+
+ ImGui::End();
+}
+
+void ImGui::ShowStyleEditor(ImGuiStyle* ref)
+{
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ const ImGuiStyle def; // Default style
+ if (ImGui::Button("Revert Style"))
+ style = ref ? *ref : def;
+ if (ref)
+ {
+ ImGui::SameLine();
+ if (ImGui::Button("Save Style"))
+ *ref = style;
+ }
+
+ ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.55f);
+
+ if (ImGui::TreeNode("Rendering"))
+ {
+ ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines);
+ ImGui::Checkbox("Anti-aliased shapes", &style.AntiAliasedShapes);
+ ImGui::PushItemWidth(100);
+ ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, NULL, 2.0f);
+ if (style.CurveTessellationTol < 0.0f) style.CurveTessellationTol = 0.10f;
+ ImGui::PopItemWidth();
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Sizes"))
+ {
+ 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.
+ ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::SliderFloat("ChildWindowRounding", &style.ChildWindowRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
+ ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
+ ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
+ ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::TreePop();
+ }
+
+ if (ImGui::TreeNode("Colors"))
+ {
+ static int output_dest = 0;
+ static bool output_only_modified = false;
+ if (ImGui::Button("Output Colors"))
+ {
+ if (output_dest == 0)
+ ImGui::LogToClipboard();
+ else
+ ImGui::LogToTTY();
+ ImGui::LogText("ImGuiStyle& style = ImGui::GetStyle();" IM_NEWLINE);
+ for (int i = 0; i < ImGuiCol_COUNT; i++)
+ {
+ const ImVec4& col = style.Colors[i];
+ const char* name = ImGui::GetStyleColName(i);
+ if (!output_only_modified || memcmp(&col, (ref ? &ref->Colors[i] : &def.Colors[i]), sizeof(ImVec4)) != 0)
+ ImGui::LogText("style.Colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 22 - (int)strlen(name), "", col.x, col.y, col.z, col.w);
+ }
+ ImGui::LogFinish();
+ }
+ ImGui::SameLine(); ImGui::PushItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY"); ImGui::PopItemWidth();
+ ImGui::SameLine(); ImGui::Checkbox("Only Modified Fields", &output_only_modified);
+
+ static ImGuiColorEditMode edit_mode = ImGuiColorEditMode_RGB;
+ ImGui::RadioButton("RGB", &edit_mode, ImGuiColorEditMode_RGB);
+ ImGui::SameLine();
+ ImGui::RadioButton("HSV", &edit_mode, ImGuiColorEditMode_HSV);
+ ImGui::SameLine();
+ ImGui::RadioButton("HEX", &edit_mode, ImGuiColorEditMode_HEX);
+ //ImGui::Text("Tip: Click on colored square to change edit mode.");
+
+ static ImGuiTextFilter filter;
+ filter.Draw("Filter colors", 200);
+
+ ImGui::BeginChild("#colors", ImVec2(0, 300), true);
+ ImGui::PushItemWidth(-160);
+ ImGui::ColorEditMode(edit_mode);
+ for (int i = 0; i < ImGuiCol_COUNT; i++)
+ {
+ const char* name = ImGui::GetStyleColName(i);
+ if (!filter.PassFilter(name))
+ continue;
+ ImGui::PushID(i);
+ ImGui::ColorEdit4(name, (float*)&style.Colors[i], true);
+ if (memcmp(&style.Colors[i], (ref ? &ref->Colors[i] : &def.Colors[i]), sizeof(ImVec4)) != 0)
+ {
+ ImGui::SameLine(); if (ImGui::Button("Revert")) style.Colors[i] = ref ? ref->Colors[i] : def.Colors[i];
+ if (ref) { ImGui::SameLine(); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i]; }
+ }
+ ImGui::PopID();
+ }
+ ImGui::PopItemWidth();
+ ImGui::EndChild();
+
+ ImGui::TreePop();
+ }
+
+ ImGui::PopItemWidth();
+}
+
+static void ShowExampleAppMainMenuBar()
+{
+ if (ImGui::BeginMainMenuBar())
+ {
+ if (ImGui::BeginMenu("File"))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Edit"))
+ {
+ if (ImGui::MenuItem("Undo", "CTRL+Z")) {}
+ if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item
+ ImGui::Separator();
+ if (ImGui::MenuItem("Cut", "CTRL+X")) {}
+ if (ImGui::MenuItem("Copy", "CTRL+C")) {}
+ if (ImGui::MenuItem("Paste", "CTRL+V")) {}
+ ImGui::EndMenu();
+ }
+ ImGui::EndMainMenuBar();
+ }
+}
+
+static void ShowExampleMenuFile()
+{
+ ImGui::MenuItem("(dummy menu)", NULL, false, false);
+ if (ImGui::MenuItem("New")) {}
+ if (ImGui::MenuItem("Open", "Ctrl+O")) {}
+ if (ImGui::BeginMenu("Open Recent"))
+ {
+ ImGui::MenuItem("fish_hat.c");
+ ImGui::MenuItem("fish_hat.inl");
+ ImGui::MenuItem("fish_hat.h");
+ if (ImGui::BeginMenu("More.."))
+ {
+ ImGui::MenuItem("Hello");
+ ImGui::MenuItem("Sailor");
+ if (ImGui::BeginMenu("Recurse.."))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenu();
+ }
+ if (ImGui::MenuItem("Save", "Ctrl+S")) {}
+ if (ImGui::MenuItem("Save As..")) {}
+ ImGui::Separator();
+ if (ImGui::BeginMenu("Options"))
+ {
+ static bool enabled = true;
+ ImGui::MenuItem("Enabled", "", &enabled);
+ ImGui::BeginChild("child", ImVec2(0, 60), true);
+ for (int i = 0; i < 10; i++)
+ ImGui::Text("Scrolling Text %d", i);
+ ImGui::EndChild();
+ static float f = 0.5f;
+ static int n = 0;
+ ImGui::SliderFloat("Value", &f, 0.0f, 1.0f);
+ ImGui::InputFloat("Input", &f, 0.1f);
+ ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0");
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Colors"))
+ {
+ for (int i = 0; i < ImGuiCol_COUNT; i++)
+ ImGui::MenuItem(ImGui::GetStyleColName((ImGuiCol)i));
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Disabled", false)) // Disabled
+ {
+ IM_ASSERT(0);
+ }
+ if (ImGui::MenuItem("Checked", NULL, true)) {}
+ if (ImGui::MenuItem("Quit", "Alt+F4")) {}
+}
+
+static void ShowExampleAppAutoResize(bool* opened)
+{
+ if (!ImGui::Begin("Example: Auto-resizing window", opened, ImGuiWindowFlags_AlwaysAutoResize))
+ {
+ ImGui::End();
+ return;
+ }
+
+ static int lines = 10;
+ ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
+ ImGui::SliderInt("Number of lines", &lines, 1, 20);
+ for (int i = 0; i < lines; i++)
+ ImGui::Text("%*sThis is line %d", i*4, "", i); // Pad with space to extend size horizontally
+ ImGui::End();
+}
+
+static void ShowExampleAppFixedOverlay(bool* opened)
+{
+ ImGui::SetNextWindowPos(ImVec2(10,10));
+ if (!ImGui::Begin("Example: Fixed Overlay", opened, ImVec2(0,0), 0.3f, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoSavedSettings))
+ {
+ ImGui::End();
+ return;
+ }
+ ImGui::Text("Simple overlay\non the top-left side of the screen.");
+ ImGui::Separator();
+ ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
+ ImGui::End();
+}
+
+static void ShowExampleAppManipulatingWindowTitle(bool* opened)
+{
+ (void)opened;
+
+ // By default, Windows are uniquely identified by their title.
+ // You can use the "##" and "###" markers to manipulate the display/ID. Read FAQ at the top of this file!
+
+ // Using "##" to display same title but have unique identifier.
+ ImGui::SetNextWindowPos(ImVec2(100,100), ImGuiSetCond_FirstUseEver);
+ ImGui::Begin("Same title as another window##1");
+ ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
+ ImGui::End();
+
+ ImGui::SetNextWindowPos(ImVec2(100,200), ImGuiSetCond_FirstUseEver);
+ ImGui::Begin("Same title as another window##2");
+ ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
+ ImGui::End();
+
+ // Using "###" to display a changing title but keep a static identifier "AnimatedTitle"
+ char buf[128];
+ sprintf(buf, "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime()/0.25f)&3], rand());
+ ImGui::SetNextWindowPos(ImVec2(100,300), ImGuiSetCond_FirstUseEver);
+ ImGui::Begin(buf);
+ ImGui::Text("This window has a changing title.");
+ ImGui::End();
+}
+
+static void ShowExampleAppCustomRendering(bool* opened)
+{
+ ImGui::SetNextWindowSize(ImVec2(300,350), ImGuiSetCond_FirstUseEver);
+ if (!ImGui::Begin("Example: Custom rendering", opened))
+ {
+ ImGui::End();
+ return;
+ }
+
+ // Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc.
+ // Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4.
+ // ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types)
+ // In this example we aren't using the operators.
+
+ static ImVector<ImVec2> points;
+ static bool adding_line = false;
+ if (ImGui::Button("Clear")) points.clear();
+ if (points.Size >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } }
+ ImGui::Text("Left-click and drag to add lines");
+ ImGui::Text("Right-click to undo");
+
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+
+ // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered()
+ // However you can draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos().
+ // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max).
+ ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates!
+ ImVec2 canvas_size = ImGui::GetContentRegionAvail(); // Resize canvas to what's available
+ if (canvas_size.x < 50.0f) canvas_size.x = 50.0f;
+ if (canvas_size.y < 50.0f) canvas_size.y = 50.0f;
+ draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), ImColor(0,0,0), ImColor(255,0,0), ImColor(255,255,0), ImColor(0,255,0));
+ draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), ImColor(255,255,255));
+
+ draw_list->AddBezierCurve(ImVec2(canvas_pos.x+20,canvas_pos.y+20), ImVec2(canvas_pos.x+100,canvas_pos.y+20), ImVec2(canvas_pos.x+canvas_size.x-100,canvas_pos.y+canvas_size.y-20), ImVec2(canvas_pos.x+canvas_size.x-20,canvas_pos.y+canvas_size.y-20), ImColor(255,200,0), 5.0f);
+
+ bool adding_preview = false;
+ ImGui::InvisibleButton("canvas", canvas_size);
+ if (ImGui::IsItemHovered())
+ {
+ ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y);
+ if (!adding_line && ImGui::GetIO().MouseClicked[0])
+ {
+ points.push_back(mouse_pos_in_canvas);
+ adding_line = true;
+ }
+ if (adding_line)
+ {
+ adding_preview = true;
+ points.push_back(mouse_pos_in_canvas);
+ if (!ImGui::GetIO().MouseDown[0])
+ adding_line = adding_preview = false;
+ }
+ if (ImGui::GetIO().MouseClicked[1] && !points.empty())
+ {
+ adding_line = false;
+ points.pop_back();
+ points.pop_back();
+ }
+ }
+ draw_list->PushClipRect(ImVec4(canvas_pos.x, canvas_pos.y, canvas_pos.x+canvas_size.x, canvas_pos.y+canvas_size.y)); // clip lines within the canvas (if we resize it, etc.)
+ for (int i = 0; i < points.Size - 1; i += 2)
+ draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i+1].x, canvas_pos.y + points[i+1].y), 0xFF00FFFF, 2.0f);
+ draw_list->PopClipRect();
+ if (adding_preview)
+ points.pop_back();
+ ImGui::End();
+}
+
+// For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions.
+struct ExampleAppConsole
+{
+ char InputBuf[256];
+ ImVector<char*> Items;
+ bool ScrollToBottom;
+ ImVector<char*> History;
+ int HistoryPos; // -1: new line, 0..History.Size-1 browsing history.
+ ImVector<const char*> Commands;
+
+ ExampleAppConsole()
+ {
+ ClearLog();
+ HistoryPos = -1;
+ Commands.push_back("HELP");
+ Commands.push_back("HISTORY");
+ Commands.push_back("CLEAR");
+ Commands.push_back("CLASSIFY"); // "classify" is here to provide an example of "C"+[tab] completing to "CL" and displaying matches.
+ }
+ ~ExampleAppConsole()
+ {
+ ClearLog();
+ for (int i = 0; i < Items.Size; i++)
+ free(History[i]);
+ }
+
+ void ClearLog()
+ {
+ for (int i = 0; i < Items.Size; i++)
+ free(Items[i]);
+ Items.clear();
+ ScrollToBottom = true;
+ }
+
+ void AddLog(const char* fmt, ...) IM_PRINTFARGS(2)
+ {
+ char buf[1024];
+ va_list args;
+ va_start(args, fmt);
+ vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args);
+ buf[IM_ARRAYSIZE(buf)-1] = 0;
+ va_end(args);
+ Items.push_back(strdup(buf));
+ ScrollToBottom = true;
+ }
+
+ void Draw(const char* title, bool* opened)
+ {
+ ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
+ if (!ImGui::Begin(title, opened))
+ {
+ ImGui::End();
+ return;
+ }
+
+ ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
+ ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion.");
+
+ // TODO: display items starting from the bottom
+
+ if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine();
+ if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
+ if (ImGui::SmallButton("Clear")) ClearLog();
+ //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); }
+
+ ImGui::Separator();
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
+ static ImGuiTextFilter filter;
+ filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180);
+ ImGui::PopStyleVar();
+ ImGui::Separator();
+
+ // 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());
+ // 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.
+ // 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.
+ ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetItemsLineHeightWithSpacing()), false, ImGuiWindowFlags_HorizontalScrollbar);
+ if (ImGui::BeginPopupContextWindow())
+ {
+ if (ImGui::Selectable("Clear")) ClearLog();
+ ImGui::EndPopup();
+ }
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing
+ for (int i = 0; i < Items.Size; i++)
+ {
+ const char* item = Items[i];
+ if (!filter.PassFilter(item))
+ continue;
+ ImVec4 col = ImColor(255,255,255); // A better implementation may store a type per-item. For the sample let's just parse the text.
+ if (strstr(item, "[error]")) col = ImColor(255,100,100);
+ else if (strncmp(item, "# ", 2) == 0) col = ImColor(255,200,150);
+ ImGui::PushStyleColor(ImGuiCol_Text, col);
+ ImGui::TextUnformatted(item);
+ ImGui::PopStyleColor();
+ }
+ if (ScrollToBottom)
+ ImGui::SetScrollHere();
+ ScrollToBottom = false;
+ ImGui::PopStyleVar();
+ ImGui::EndChild();
+ ImGui::Separator();
+
+ // Command-line
+ if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this))
+ {
+ char* input_end = InputBuf+strlen(InputBuf);
+ while (input_end > InputBuf && input_end[-1] == ' ') input_end--; *input_end = 0;
+ if (InputBuf[0])
+ ExecCommand(InputBuf);
+ strcpy(InputBuf, "");
+ }
+
+ // Demonstrate keeping auto focus on the input box
+ if (ImGui::IsItemHovered() || (ImGui::IsRootWindowOrAnyChildFocused() && !ImGui::IsAnyItemActive() && !ImGui::IsMouseClicked(0)))
+ ImGui::SetKeyboardFocusHere(-1); // Auto focus
+
+ ImGui::End();
+ }
+
+ static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; }
+ static int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; }
+
+ void ExecCommand(const char* command_line)
+ {
+ AddLog("# %s\n", command_line);
+
+ // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal.
+ HistoryPos = -1;
+ for (int i = History.Size-1; i >= 0; i--)
+ if (Stricmp(History[i], command_line) == 0)
+ {
+ free(History[i]);
+ History.erase(History.begin() + i);
+ break;
+ }
+ History.push_back(strdup(command_line));
+
+ // Process command
+ if (Stricmp(command_line, "CLEAR") == 0)
+ {
+ ClearLog();
+ }
+ else if (Stricmp(command_line, "HELP") == 0)
+ {
+ AddLog("Commands:");
+ for (int i = 0; i < Commands.Size; i++)
+ AddLog("- %s", Commands[i]);
+ }
+ else if (Stricmp(command_line, "HISTORY") == 0)
+ {
+ for (int i = History.Size >= 10 ? History.Size - 10 : 0; i < History.Size; i++)
+ AddLog("%3d: %s\n", i, History[i]);
+ }
+ else
+ {
+ AddLog("Unknown command: '%s'\n", command_line);
+ }
+ }
+
+ static int TextEditCallbackStub(ImGuiTextEditCallbackData* data) // In C++11 you are better off using lambdas for this sort of forwarding callbacks
+ {
+ ExampleAppConsole* console = (ExampleAppConsole*)data->UserData;
+ return console->TextEditCallback(data);
+ }
+
+ int TextEditCallback(ImGuiTextEditCallbackData* data)
+ {
+ //AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd);
+ switch (data->EventFlag)
+ {
+ case ImGuiInputTextFlags_CallbackCompletion:
+ {
+ // Example of TEXT COMPLETION
+
+ // Locate beginning of current word
+ const char* word_end = data->Buf + data->CursorPos;
+ const char* word_start = word_end;
+ while (word_start > data->Buf)
+ {
+ const char c = word_start[-1];
+ if (c == ' ' || c == '\t' || c == ',' || c == ';')
+ break;
+ word_start--;
+ }
+
+ // Build a list of candidates
+ ImVector<const char*> candidates;
+ for (int i = 0; i < Commands.Size; i++)
+ if (Strnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0)
+ candidates.push_back(Commands[i]);
+
+ if (candidates.Size == 0)
+ {
+ // No match
+ AddLog("No match for \"%.*s\"!\n", (int)(word_end-word_start), word_start);
+ }
+ else if (candidates.Size == 1)
+ {
+ // Single match. Delete the beginning of the word and replace it entirely so we've got nice casing
+ data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start));
+ data->InsertChars(data->CursorPos, candidates[0]);
+ data->InsertChars(data->CursorPos, " ");
+ }
+ else
+ {
+ // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY"
+ int match_len = (int)(word_end - word_start);
+ for (;;)
+ {
+ int c = 0;
+ bool all_candidates_matches = true;
+ for (int i = 0; i < candidates.Size && all_candidates_matches; i++)
+ if (i == 0)
+ c = toupper(candidates[i][match_len]);
+ else if (c != toupper(candidates[i][match_len]))
+ all_candidates_matches = false;
+ if (!all_candidates_matches)
+ break;
+ match_len++;
+ }
+
+ if (match_len > 0)
+ {
+ data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start));
+ data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len);
+ }
+
+ // List matches
+ AddLog("Possible matches:\n");
+ for (int i = 0; i < candidates.Size; i++)
+ AddLog("- %s\n", candidates[i]);
+ }
+
+ break;
+ }
+ case ImGuiInputTextFlags_CallbackHistory:
+ {
+ // Example of HISTORY
+ const int prev_history_pos = HistoryPos;
+ if (data->EventKey == ImGuiKey_UpArrow)
+ {
+ if (HistoryPos == -1)
+ HistoryPos = History.Size - 1;
+ else if (HistoryPos > 0)
+ HistoryPos--;
+ }
+ else if (data->EventKey == ImGuiKey_DownArrow)
+ {
+ if (HistoryPos != -1)
+ if (++HistoryPos >= History.Size)
+ HistoryPos = -1;
+ }
+
+ // A better implementation would preserve the data on the current input line along with cursor position.
+ if (prev_history_pos != HistoryPos)
+ {
+ snprintf(data->Buf, data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
+ data->BufDirty = true;
+ data->CursorPos = data->SelectionStart = data->SelectionEnd = (int)strlen(data->Buf);
+ }
+ }
+ }
+ return 0;
+ }
+};
+
+static void ShowExampleAppConsole(bool* opened)
+{
+ static ExampleAppConsole console;
+ console.Draw("Example: Console", opened);
+}
+
+// Usage:
+// static ExampleAppLog my_log;
+// my_log.AddLog("Hello %d world\n", 123);
+// my_log.Draw("title");
+struct ExampleAppLog
+{
+ ImGuiTextBuffer Buf;
+ ImGuiTextFilter Filter;
+ ImVector<int> LineOffsets; // Index to lines offset
+ bool ScrollToBottom;
+
+ void Clear() { Buf.clear(); LineOffsets.clear(); }
+
+ void AddLog(const char* fmt, ...) IM_PRINTFARGS(2)
+ {
+ int old_size = Buf.size();
+ va_list args;
+ va_start(args, fmt);
+ Buf.appendv(fmt, args);
+ va_end(args);
+ for (int new_size = Buf.size(); old_size < new_size; old_size++)
+ if (Buf[old_size] == '\n')
+ LineOffsets.push_back(old_size);
+ ScrollToBottom = true;
+ }
+
+ void Draw(const char* title, bool* p_opened = NULL)
+ {
+ ImGui::SetNextWindowSize(ImVec2(500,400), ImGuiSetCond_FirstUseEver);
+ ImGui::Begin(title, p_opened);
+ if (ImGui::Button("Clear")) Clear();
+ ImGui::SameLine();
+ bool copy = ImGui::Button("Copy");
+ ImGui::SameLine();
+ Filter.Draw("Filter", -100.0f);
+ ImGui::Separator();
+ ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar);
+ if (copy) ImGui::LogToClipboard();
+
+ if (Filter.IsActive())
+ {
+ const char* buf_begin = Buf.begin();
+ const char* line = buf_begin;
+ for (int line_no = 0; line != NULL; line_no++)
+ {
+ const char* line_end = (line_no < LineOffsets.Size) ? buf_begin + LineOffsets[line_no] : NULL;
+ if (Filter.PassFilter(line, line_end))
+ ImGui::TextUnformatted(line, line_end);
+ line = line_end && line_end[1] ? line_end + 1 : NULL;
+ }
+ }
+ else
+ {
+ ImGui::TextUnformatted(Buf.begin());
+ }
+
+ if (ScrollToBottom)
+ ImGui::SetScrollHere(1.0f);
+ ScrollToBottom = false;
+ ImGui::EndChild();
+ ImGui::End();
+ }
+};
+
+static void ShowExampleAppLog(bool* opened)
+{
+ static ExampleAppLog log;
+
+ // Demo fill
+ static float last_time = -1.0f;
+ float time = ImGui::GetTime();
+ if (time - last_time >= 0.3f)
+ {
+ const char* random_words[] = { "system", "info", "warning", "error", "fatal", "notice", "log" };
+ log.AddLog("[%s] Hello, time is %.1f, rand() %d\n", random_words[rand() % IM_ARRAYSIZE(random_words)], time, (int)rand());
+ last_time = time;
+ }
+
+ log.Draw("Example: Log", opened);
+}
+
+static void ShowExampleAppLayout(bool* opened)
+{
+ ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiSetCond_FirstUseEver);
+ if (ImGui::Begin("Example: Layout", opened, ImGuiWindowFlags_MenuBar))
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ if (ImGui::BeginMenu("File"))
+ {
+ if (ImGui::MenuItem("Close")) *opened = false;
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenuBar();
+ }
+
+ // left
+ static int selected = 0;
+ ImGui::BeginChild("left pane", ImVec2(150, 0), true);
+ for (int i = 0; i < 100; i++)
+ {
+ char label[128];
+ sprintf(label, "MyObject %d", i);
+ if (ImGui::Selectable(label, selected == i))
+ selected = i;
+ }
+ ImGui::EndChild();
+ ImGui::SameLine();
+
+ // right
+ ImGui::BeginGroup();
+ ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetItemsLineHeightWithSpacing())); // Leave room for 1 line below us
+ ImGui::Text("MyObject: %d", selected);
+ ImGui::Separator();
+ ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
+ ImGui::EndChild();
+ ImGui::BeginChild("buttons");
+ if (ImGui::Button("Revert")) {}
+ ImGui::SameLine();
+ if (ImGui::Button("Save")) {}
+ ImGui::EndChild();
+ ImGui::EndGroup();
+ }
+ ImGui::End();
+}
+
+static void ShowExampleAppLongText(bool* opened)
+{
+ ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
+ if (!ImGui::Begin("Example: Long text display", opened))
+ {
+ ImGui::End();
+ return;
+ }
+
+ static int test_type = 0;
+ static ImGuiTextBuffer log;
+ static int lines = 0;
+ ImGui::Text("Printing unusually long amount of text.");
+ ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped\0");
+ ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
+ if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
+ ImGui::SameLine();
+ if (ImGui::Button("Add 1000 lines"))
+ {
+ for (int i = 0; i < 1000; i++)
+ log.append("%i The quick brown fox jumps over the lazy dog\n", lines+i);
+ lines += 1000;
+ }
+ ImGui::BeginChild("Log");
+ switch (test_type)
+ {
+ case 0:
+ // Single call to TextUnformatted() with a big buffer
+ ImGui::TextUnformatted(log.begin(), log.end());
+ break;
+ case 1:
+ {
+ // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper.
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
+ ImGuiListClipper clipper(lines, ImGui::GetTextLineHeight());
+ for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
+ ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
+ clipper.End();
+ ImGui::PopStyleVar();
+ break;
+ }
+ case 2:
+ // Multiple calls to Text(), not clipped (slow)
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
+ for (int i = 0; i < lines; i++)
+ ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
+ ImGui::PopStyleVar();
+ break;
+ }
+ ImGui::EndChild();
+ ImGui::End();
+}
+
+// End of Demo code
+#else
+
+void ImGui::ShowTestWindow(bool*) {}
+void ImGui::ShowUserGuide(bool*) {}
+void ImGui::ShowStyleEditor(bool*) {}
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp
new file mode 100644
index 00000000000..09fcf015430
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp
@@ -0,0 +1,2242 @@
+// ImGui library v1.46 WIP
+// Drawing and font code
+
+// Contains implementation for
+// - ImDrawList
+// - ImDrawData
+// - ImFontAtlas
+// - ImFont
+// - Default font data
+
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+
+#include "imgui.h"
+#define IMGUI_DEFINE_MATH_OPERATORS
+#include "imgui_internal.h"
+
+#include <stdio.h> // vsnprintf, sscanf, printf
+#include <new> // new (ptr)
+#ifndef alloca
+#if _WIN32
+#include <malloc.h> // alloca
+#else
+#include <alloca.h> // alloca
+#endif
+#endif
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
+#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
+#define snprintf _snprintf
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
+#endif
+
+//-------------------------------------------------------------------------
+// STB libraries implementation
+//-------------------------------------------------------------------------
+
+//#define IMGUI_STB_NAMESPACE ImGuiStb
+//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
+//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
+
+#ifdef IMGUI_STB_NAMESPACE
+namespace IMGUI_STB_NAMESPACE
+{
+#endif
+
+#ifdef _MSC_VER
+#pragma warning (push)
+#pragma warning (disable: 4456) // declaration of 'xx' hides previous local declaration
+#endif
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#endif
+
+#define STBRP_ASSERT(x) IM_ASSERT(x)
+#ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
+#define STBRP_STATIC
+#define STB_RECT_PACK_IMPLEMENTATION
+#endif
+#include "stb_rect_pack.h"
+
+#define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x))
+#define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x))
+#define STBTT_assert(x) IM_ASSERT(x)
+#ifndef IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
+#define STBTT_STATIC
+#define STB_TRUETYPE_IMPLEMENTATION
+#else
+#define STBTT_DEF extern
+#endif
+#include "stb_truetype.h"
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#ifdef _MSC_VER
+#pragma warning (pop)
+#endif
+
+#ifdef IMGUI_STB_NAMESPACE
+} // namespace ImGuiStb
+using namespace IMGUI_STB_NAMESPACE;
+#endif
+
+//-----------------------------------------------------------------------------
+// ImDrawList
+//-----------------------------------------------------------------------------
+
+static ImVec4 GNullClipRect(-8192.0f, -8192.0f, +8192.0f, +8192.0f); // Large values that are easy to encode in a few bits+shift
+
+void ImDrawList::Clear()
+{
+ CmdBuffer.resize(0);
+ IdxBuffer.resize(0);
+ VtxBuffer.resize(0);
+ _VtxCurrentIdx = 0;
+ _VtxWritePtr = NULL;
+ _IdxWritePtr = NULL;
+ _ClipRectStack.resize(0);
+ _TextureIdStack.resize(0);
+ _Path.resize(0);
+ _ChannelsCurrent = 0;
+ _ChannelsCount = 1;
+ // NB: Do not clear channels so our allocations are re-used after the first frame.
+}
+
+void ImDrawList::ClearFreeMemory()
+{
+ CmdBuffer.clear();
+ IdxBuffer.clear();
+ VtxBuffer.clear();
+ _VtxCurrentIdx = 0;
+ _VtxWritePtr = NULL;
+ _IdxWritePtr = NULL;
+ _ClipRectStack.clear();
+ _TextureIdStack.clear();
+ _Path.clear();
+ _ChannelsCurrent = 0;
+ _ChannelsCount = 1;
+ for (int i = 0; i < _Channels.Size; i++)
+ {
+ if (i == 0) memset(&_Channels[0], 0, sizeof(_Channels[0])); // channel 0 is a copy of CmdBuffer/IdxBuffer, don't destruct again
+ _Channels[i].CmdBuffer.clear();
+ _Channels[i].IdxBuffer.clear();
+ }
+ _Channels.clear();
+}
+
+void ImDrawList::AddDrawCmd()
+{
+ ImDrawCmd draw_cmd;
+ draw_cmd.ClipRect = _ClipRectStack.Size ? _ClipRectStack.back() : GNullClipRect;
+ draw_cmd.TextureId = _TextureIdStack.Size ? _TextureIdStack.back() : NULL;
+
+ IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w);
+ CmdBuffer.push_back(draw_cmd);
+}
+
+void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
+{
+ ImDrawCmd* current_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL;
+ if (!current_cmd || current_cmd->ElemCount != 0 || current_cmd->UserCallback != NULL)
+ {
+ AddDrawCmd();
+ current_cmd = &CmdBuffer.back();
+ }
+ current_cmd->UserCallback = callback;
+ current_cmd->UserCallbackData = callback_data;
+
+ // Force a new command after us (we function this way so that the most common calls AddLine, AddRect, etc. always have a command to add to without doing any check).
+ AddDrawCmd();
+}
+
+void ImDrawList::UpdateClipRect()
+{
+ ImDrawCmd* current_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL;
+ if (!current_cmd || (current_cmd->ElemCount != 0) || current_cmd->UserCallback != NULL)
+ {
+ AddDrawCmd();
+ }
+ else
+ {
+ ImVec4 current_clip_rect = _ClipRectStack.Size ? _ClipRectStack.back() : GNullClipRect;
+ if (CmdBuffer.Size >= 2 && ImLengthSqr(CmdBuffer.Data[CmdBuffer.Size-2].ClipRect - current_clip_rect) < 0.00001f)
+ CmdBuffer.pop_back();
+ else
+ current_cmd->ClipRect = current_clip_rect;
+ }
+}
+
+// Scissoring. The values in clip_rect are x1, y1, x2, y2.
+void ImDrawList::PushClipRect(const ImVec4& clip_rect)
+{
+ _ClipRectStack.push_back(clip_rect);
+ UpdateClipRect();
+}
+
+void ImDrawList::PushClipRectFullScreen()
+{
+ PushClipRect(GNullClipRect);
+
+ // FIXME-OPT: This would be more correct but we're not supposed to access ImGuiState from here?
+ //ImGuiState& g = *GImGui;
+ //PushClipRect(GetVisibleRect());
+}
+
+void ImDrawList::PopClipRect()
+{
+ IM_ASSERT(_ClipRectStack.Size > 0);
+ _ClipRectStack.pop_back();
+ UpdateClipRect();
+}
+
+void ImDrawList::UpdateTextureID()
+{
+ ImDrawCmd* current_cmd = CmdBuffer.Size ? &CmdBuffer.back() : NULL;
+ const ImTextureID texture_id = _TextureIdStack.Size ? _TextureIdStack.back() : NULL;
+ if (!current_cmd || (current_cmd->ElemCount != 0 && current_cmd->TextureId != texture_id) || current_cmd->UserCallback != NULL)
+ AddDrawCmd();
+ else
+ current_cmd->TextureId = texture_id;
+}
+
+void ImDrawList::PushTextureID(const ImTextureID& texture_id)
+{
+ _TextureIdStack.push_back(texture_id);
+ UpdateTextureID();
+}
+
+void ImDrawList::PopTextureID()
+{
+ IM_ASSERT(_TextureIdStack.Size > 0);
+ _TextureIdStack.pop_back();
+ UpdateTextureID();
+}
+
+void ImDrawList::ChannelsSplit(int channels_count)
+{
+ IM_ASSERT(_ChannelsCurrent == 0 && _ChannelsCount == 1);
+ int old_channels_count = _Channels.Size;
+ if (old_channels_count < channels_count)
+ _Channels.resize(channels_count);
+ _ChannelsCount = channels_count;
+
+ // _Channels[] (24 bytes each) hold storage that we'll swap with this->_CmdBuffer/_IdxBuffer
+ // The content of _Channels[0] at this point doesn't matter. We clear it to make state tidy in a debugger but we don't strictly need to.
+ // When we switch to the next channel, we'll copy _CmdBuffer/_IdxBuffer into _Channels[0] and then _Channels[1] into _CmdBuffer/_IdxBuffer
+ memset(&_Channels[0], 0, sizeof(ImDrawChannel));
+ for (int i = 1; i < channels_count; i++)
+ {
+ if (i >= old_channels_count)
+ {
+ new(&_Channels[i]) ImDrawChannel();
+ }
+ else
+ {
+ _Channels[i].CmdBuffer.resize(0);
+ _Channels[i].IdxBuffer.resize(0);
+ }
+ if (_Channels[i].CmdBuffer.Size == 0)
+ {
+ ImDrawCmd draw_cmd;
+ draw_cmd.ClipRect = _ClipRectStack.back();
+ draw_cmd.TextureId = _TextureIdStack.back();
+ _Channels[i].CmdBuffer.push_back(draw_cmd);
+ }
+ }
+}
+
+void ImDrawList::ChannelsMerge()
+{
+ // Note that we never use or rely on channels.Size because it is merely a buffer that we never shrink back to 0 to keep all sub-buffers ready for use.
+ if (_ChannelsCount <= 1)
+ return;
+
+ ChannelsSetCurrent(0);
+ if (CmdBuffer.Size && CmdBuffer.back().ElemCount == 0)
+ CmdBuffer.pop_back();
+
+ int new_cmd_buffer_count = 0, new_idx_buffer_count = 0;
+ for (int i = 1; i < _ChannelsCount; i++)
+ {
+ ImDrawChannel& ch = _Channels[i];
+ if (ch.CmdBuffer.Size && ch.CmdBuffer.back().ElemCount == 0)
+ ch.CmdBuffer.pop_back();
+ new_cmd_buffer_count += ch.CmdBuffer.Size;
+ new_idx_buffer_count += ch.IdxBuffer.Size;
+ }
+ CmdBuffer.resize(CmdBuffer.Size + new_cmd_buffer_count);
+ IdxBuffer.resize(IdxBuffer.Size + new_idx_buffer_count);
+
+ ImDrawCmd* cmd_write = CmdBuffer.Data + CmdBuffer.Size - new_cmd_buffer_count;
+ _IdxWritePtr = IdxBuffer.Data + IdxBuffer.Size - new_idx_buffer_count;
+ for (int i = 1; i < _ChannelsCount; i++)
+ {
+ ImDrawChannel& ch = _Channels[i];
+ if (int sz = ch.CmdBuffer.Size) { memcpy(cmd_write, ch.CmdBuffer.Data, sz * sizeof(ImDrawCmd)); cmd_write += sz; }
+ if (int sz = ch.IdxBuffer.Size) { memcpy(_IdxWritePtr, ch.IdxBuffer.Data, sz * sizeof(ImDrawIdx)); _IdxWritePtr += sz; }
+ }
+ AddDrawCmd();
+ _ChannelsCount = 1;
+}
+
+void ImDrawList::ChannelsSetCurrent(int idx)
+{
+ IM_ASSERT(idx < _ChannelsCount);
+ if (_ChannelsCurrent == idx) return;
+ memcpy(&_Channels.Data[_ChannelsCurrent].CmdBuffer, &CmdBuffer, sizeof(CmdBuffer)); // copy 12 bytes, four times
+ memcpy(&_Channels.Data[_ChannelsCurrent].IdxBuffer, &IdxBuffer, sizeof(IdxBuffer));
+ _ChannelsCurrent = idx;
+ memcpy(&CmdBuffer, &_Channels.Data[_ChannelsCurrent].CmdBuffer, sizeof(CmdBuffer));
+ memcpy(&IdxBuffer, &_Channels.Data[_ChannelsCurrent].IdxBuffer, sizeof(IdxBuffer));
+ _IdxWritePtr = IdxBuffer.Data + IdxBuffer.Size;
+}
+
+// NB: this can be called with negative count for removing primitives (as long as the result does not underflow)
+void ImDrawList::PrimReserve(int idx_count, int vtx_count)
+{
+ ImDrawCmd& draw_cmd = CmdBuffer.Data[CmdBuffer.Size-1];
+ draw_cmd.ElemCount += idx_count;
+
+ int vtx_buffer_size = VtxBuffer.Size;
+ VtxBuffer.resize(vtx_buffer_size + vtx_count);
+ _VtxWritePtr = VtxBuffer.Data + vtx_buffer_size;
+
+ int idx_buffer_size = IdxBuffer.Size;
+ IdxBuffer.resize(idx_buffer_size + idx_count);
+ _IdxWritePtr = IdxBuffer.Data + idx_buffer_size;
+}
+
+void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col)
+{
+ const ImVec2 uv = GImGui->FontTexUvWhitePixel;
+ const ImVec2 b(c.x, a.y);
+ const ImVec2 d(a.x, c.y);
+ _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2);
+ _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3);
+ _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
+ _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col;
+ _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col;
+ _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col;
+ _VtxWritePtr += 4;
+ _VtxCurrentIdx += 4;
+ _IdxWritePtr += 6;
+}
+
+void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col)
+{
+ const ImVec2 b(c.x, a.y);
+ const ImVec2 d(a.x, c.y);
+ const ImVec2 uv_b(uv_c.x, uv_a.y);
+ const ImVec2 uv_d(uv_a.x, uv_c.y);
+ _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2);
+ _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3);
+ _VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col;
+ _VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col;
+ _VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col;
+ _VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col;
+ _VtxWritePtr += 4;
+ _VtxCurrentIdx += 4;
+ _IdxWritePtr += 6;
+}
+
+// TODO: Thickness anti-aliased lines cap are missing their AA fringe.
+void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, bool closed, float thickness, bool anti_aliased)
+{
+ if (points_count < 2)
+ return;
+
+ const ImVec2 uv = GImGui->FontTexUvWhitePixel;
+ anti_aliased &= GImGui->Style.AntiAliasedLines;
+ //if (ImGui::GetIO().KeyCtrl) anti_aliased = false; // Debug
+
+ int count = points_count;
+ if (!closed)
+ count = points_count-1;
+
+ const bool thick_line = thickness > 1.0f;
+ if (anti_aliased)
+ {
+ // Anti-aliased stroke
+ const float AA_SIZE = 1.0f;
+ const ImU32 col_trans = col & 0x00ffffff;
+
+ const int idx_count = thick_line ? count*18 : count*12;
+ const int vtx_count = thick_line ? points_count*4 : points_count*3;
+ PrimReserve(idx_count, vtx_count);
+
+ // Temporary buffer
+ ImVec2* temp_normals = (ImVec2*)alloca(points_count * (thick_line ? 5 : 3) * sizeof(ImVec2));
+ ImVec2* temp_points = temp_normals + points_count;
+
+ for (int i1 = 0; i1 < count; i1++)
+ {
+ const int i2 = (i1+1) == points_count ? 0 : i1+1;
+ ImVec2 diff = points[i2] - points[i1];
+ diff *= ImInvLength(diff, 1.0f);
+ temp_normals[i1].x = diff.y;
+ temp_normals[i1].y = -diff.x;
+ }
+ if (!closed)
+ temp_normals[points_count-1] = temp_normals[points_count-2];
+
+ if (!thick_line)
+ {
+ if (!closed)
+ {
+ temp_points[0] = points[0] + temp_normals[0] * AA_SIZE;
+ temp_points[1] = points[0] - temp_normals[0] * AA_SIZE;
+ temp_points[(points_count-1)*2+0] = points[points_count-1] + temp_normals[points_count-1] * AA_SIZE;
+ temp_points[(points_count-1)*2+1] = points[points_count-1] - temp_normals[points_count-1] * AA_SIZE;
+ }
+
+ // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer.
+ unsigned int idx1 = _VtxCurrentIdx;
+ for (int i1 = 0; i1 < count; i1++)
+ {
+ const int i2 = (i1+1) == points_count ? 0 : i1+1;
+ unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+3;
+
+ // Average normals
+ ImVec2 dm = (temp_normals[i1] + temp_normals[i2]) * 0.5f;
+ float dmr2 = dm.x*dm.x + dm.y*dm.y;
+ if (dmr2 > 0.000001f)
+ {
+ float scale = 1.0f / dmr2;
+ if (scale > 100.0f) scale = 100.0f;
+ dm *= scale;
+ }
+ dm *= AA_SIZE;
+ temp_points[i2*2+0] = points[i2] + dm;
+ temp_points[i2*2+1] = points[i2] - dm;
+
+ // Add indexes
+ _IdxWritePtr[0] = (ImDrawIdx)(idx2+0); _IdxWritePtr[1] = (ImDrawIdx)(idx1+0); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2);
+ _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+0);
+ _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0);
+ _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10]= (ImDrawIdx)(idx2+0); _IdxWritePtr[11]= (ImDrawIdx)(idx2+1);
+ _IdxWritePtr += 12;
+
+ idx1 = idx2;
+ }
+
+ // Add vertexes
+ for (int i = 0; i < points_count; i++)
+ {
+ _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
+ _VtxWritePtr[1].pos = temp_points[i*2+0]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans;
+ _VtxWritePtr[2].pos = temp_points[i*2+1]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col_trans;
+ _VtxWritePtr += 3;
+ }
+ }
+ else
+ {
+ const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f;
+ if (!closed)
+ {
+ temp_points[0] = points[0] + temp_normals[0] * (half_inner_thickness + AA_SIZE);
+ temp_points[1] = points[0] + temp_normals[0] * (half_inner_thickness);
+ temp_points[2] = points[0] - temp_normals[0] * (half_inner_thickness);
+ temp_points[3] = points[0] - temp_normals[0] * (half_inner_thickness + AA_SIZE);
+ temp_points[(points_count-1)*4+0] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE);
+ temp_points[(points_count-1)*4+1] = points[points_count-1] + temp_normals[points_count-1] * (half_inner_thickness);
+ temp_points[(points_count-1)*4+2] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness);
+ temp_points[(points_count-1)*4+3] = points[points_count-1] - temp_normals[points_count-1] * (half_inner_thickness + AA_SIZE);
+ }
+
+ // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer.
+ unsigned int idx1 = _VtxCurrentIdx;
+ for (int i1 = 0; i1 < count; i1++)
+ {
+ const int i2 = (i1+1) == points_count ? 0 : i1+1;
+ unsigned int idx2 = (i1+1) == points_count ? _VtxCurrentIdx : idx1+4;
+
+ // Average normals
+ ImVec2 dm = (temp_normals[i1] + temp_normals[i2]) * 0.5f;
+ float dmr2 = dm.x*dm.x + dm.y*dm.y;
+ if (dmr2 > 0.000001f)
+ {
+ float scale = 1.0f / dmr2;
+ if (scale > 100.0f) scale = 100.0f;
+ dm *= scale;
+ }
+ ImVec2 dm_out = dm * (half_inner_thickness + AA_SIZE);
+ ImVec2 dm_in = dm * half_inner_thickness;
+ temp_points[i2*4+0] = points[i2] + dm_out;
+ temp_points[i2*4+1] = points[i2] + dm_in;
+ temp_points[i2*4+2] = points[i2] - dm_in;
+ temp_points[i2*4+3] = points[i2] - dm_out;
+
+ // Add indexes
+ _IdxWritePtr[0] = (ImDrawIdx)(idx2+1); _IdxWritePtr[1] = (ImDrawIdx)(idx1+1); _IdxWritePtr[2] = (ImDrawIdx)(idx1+2);
+ _IdxWritePtr[3] = (ImDrawIdx)(idx1+2); _IdxWritePtr[4] = (ImDrawIdx)(idx2+2); _IdxWritePtr[5] = (ImDrawIdx)(idx2+1);
+ _IdxWritePtr[6] = (ImDrawIdx)(idx2+1); _IdxWritePtr[7] = (ImDrawIdx)(idx1+1); _IdxWritePtr[8] = (ImDrawIdx)(idx1+0);
+ _IdxWritePtr[9] = (ImDrawIdx)(idx1+0); _IdxWritePtr[10] = (ImDrawIdx)(idx2+0); _IdxWritePtr[11] = (ImDrawIdx)(idx2+1);
+ _IdxWritePtr[12] = (ImDrawIdx)(idx2+2); _IdxWritePtr[13] = (ImDrawIdx)(idx1+2); _IdxWritePtr[14] = (ImDrawIdx)(idx1+3);
+ _IdxWritePtr[15] = (ImDrawIdx)(idx1+3); _IdxWritePtr[16] = (ImDrawIdx)(idx2+3); _IdxWritePtr[17] = (ImDrawIdx)(idx2+2);
+ _IdxWritePtr += 18;
+
+ idx1 = idx2;
+ }
+
+ // Add vertexes
+ for (int i = 0; i < points_count; i++)
+ {
+ _VtxWritePtr[0].pos = temp_points[i*4+0]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col_trans;
+ _VtxWritePtr[1].pos = temp_points[i*4+1]; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col;
+ _VtxWritePtr[2].pos = temp_points[i*4+2]; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col;
+ _VtxWritePtr[3].pos = temp_points[i*4+3]; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col_trans;
+ _VtxWritePtr += 4;
+ }
+ }
+ _VtxCurrentIdx += (ImDrawIdx)vtx_count;
+ }
+ else
+ {
+ // Non Anti-aliased Stroke
+ const int idx_count = count*6;
+ const int vtx_count = count*4; // FIXME-OPT: Not sharing edges
+ PrimReserve(idx_count, vtx_count);
+
+ for (int i1 = 0; i1 < count; i1++)
+ {
+ const int i2 = (i1+1) == points_count ? 0 : i1+1;
+ const ImVec2& p1 = points[i1];
+ const ImVec2& p2 = points[i2];
+ ImVec2 diff = p2 - p1;
+ diff *= ImInvLength(diff, 1.0f);
+
+ const float dx = diff.x * (thickness * 0.5f);
+ const float dy = diff.y * (thickness * 0.5f);
+ _VtxWritePtr[0].pos.x = p1.x + dy; _VtxWritePtr[0].pos.y = p1.y - dx; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
+ _VtxWritePtr[1].pos.x = p2.x + dy; _VtxWritePtr[1].pos.y = p2.y - dx; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col;
+ _VtxWritePtr[2].pos.x = p2.x - dy; _VtxWritePtr[2].pos.y = p2.y + dx; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col;
+ _VtxWritePtr[3].pos.x = p1.x - dy; _VtxWritePtr[3].pos.y = p1.y + dx; _VtxWritePtr[3].uv = uv; _VtxWritePtr[3].col = col;
+ _VtxWritePtr += 4;
+
+ _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2);
+ _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3);
+ _IdxWritePtr += 6;
+ _VtxCurrentIdx += 4;
+ }
+ }
+}
+
+void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col, bool anti_aliased)
+{
+ const ImVec2 uv = GImGui->FontTexUvWhitePixel;
+ anti_aliased &= GImGui->Style.AntiAliasedShapes;
+ //if (ImGui::GetIO().KeyCtrl) anti_aliased = false; // Debug
+
+ if (anti_aliased)
+ {
+ // Anti-aliased Fill
+ const float AA_SIZE = 1.0f;
+ const ImU32 col_trans = col & 0x00ffffff;
+ const int idx_count = (points_count-2)*3 + points_count*6;
+ const int vtx_count = (points_count*2);
+ PrimReserve(idx_count, vtx_count);
+
+ // Add indexes for fill
+ unsigned int vtx_inner_idx = _VtxCurrentIdx;
+ unsigned int vtx_outer_idx = _VtxCurrentIdx+1;
+ for (int i = 2; i < points_count; i++)
+ {
+ _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+((i-1)<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_inner_idx+(i<<1));
+ _IdxWritePtr += 3;
+ }
+
+ // Compute normals
+ ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2));
+ for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++)
+ {
+ const ImVec2& p0 = points[i0];
+ const ImVec2& p1 = points[i1];
+ ImVec2 diff = p1 - p0;
+ diff *= ImInvLength(diff, 1.0f);
+ temp_normals[i0].x = diff.y;
+ temp_normals[i0].y = -diff.x;
+ }
+
+ for (int i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++)
+ {
+ // Average normals
+ const ImVec2& n0 = temp_normals[i0];
+ const ImVec2& n1 = temp_normals[i1];
+ ImVec2 dm = (n0 + n1) * 0.5f;
+ float dmr2 = dm.x*dm.x + dm.y*dm.y;
+ if (dmr2 > 0.000001f)
+ {
+ float scale = 1.0f / dmr2;
+ if (scale > 100.0f) scale = 100.0f;
+ dm *= scale;
+ }
+ dm *= AA_SIZE * 0.5f;
+
+ // Add vertices
+ _VtxWritePtr[0].pos = (points[i1] - dm); _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; // Inner
+ _VtxWritePtr[1].pos = (points[i1] + dm); _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col_trans; // Outer
+ _VtxWritePtr += 2;
+
+ // Add indexes for fringes
+ _IdxWritePtr[0] = (ImDrawIdx)(vtx_inner_idx+(i1<<1)); _IdxWritePtr[1] = (ImDrawIdx)(vtx_inner_idx+(i0<<1)); _IdxWritePtr[2] = (ImDrawIdx)(vtx_outer_idx+(i0<<1));
+ _IdxWritePtr[3] = (ImDrawIdx)(vtx_outer_idx+(i0<<1)); _IdxWritePtr[4] = (ImDrawIdx)(vtx_outer_idx+(i1<<1)); _IdxWritePtr[5] = (ImDrawIdx)(vtx_inner_idx+(i1<<1));
+ _IdxWritePtr += 6;
+ }
+ _VtxCurrentIdx += (ImDrawIdx)vtx_count;
+ }
+ else
+ {
+ // Non Anti-aliased Fill
+ const int idx_count = (points_count-2)*3;
+ const int vtx_count = points_count;
+ PrimReserve(idx_count, vtx_count);
+ for (int i = 0; i < vtx_count; i++)
+ {
+ _VtxWritePtr[0].pos = points[i]; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col;
+ _VtxWritePtr++;
+ }
+ for (int i = 2; i < points_count; i++)
+ {
+ _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+i-1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+i);
+ _IdxWritePtr += 3;
+ }
+ _VtxCurrentIdx += (ImDrawIdx)vtx_count;
+ }
+}
+
+void ImDrawList::PathArcToFast(const ImVec2& centre, float radius, int amin, int amax)
+{
+ static ImVec2 circle_vtx[12];
+ static bool circle_vtx_builds = false;
+ const int circle_vtx_count = IM_ARRAYSIZE(circle_vtx);
+ if (!circle_vtx_builds)
+ {
+ for (int i = 0; i < circle_vtx_count; i++)
+ {
+ const float a = ((float)i / (float)circle_vtx_count) * 2*IM_PI;
+ circle_vtx[i].x = cosf(a);
+ circle_vtx[i].y = sinf(a);
+ }
+ circle_vtx_builds = true;
+ }
+
+ if (amin > amax) return;
+ if (radius == 0.0f)
+ {
+ _Path.push_back(centre);
+ }
+ else
+ {
+ _Path.reserve(_Path.Size + (amax - amin + 1));
+ for (int a = amin; a <= amax; a++)
+ {
+ const ImVec2& c = circle_vtx[a % circle_vtx_count];
+ _Path.push_back(ImVec2(centre.x + c.x * radius, centre.y + c.y * radius));
+ }
+ }
+}
+
+void ImDrawList::PathArcTo(const ImVec2& centre, float radius, float amin, float amax, int num_segments)
+{
+ if (radius == 0.0f)
+ _Path.push_back(centre);
+ _Path.reserve(_Path.Size + (num_segments + 1));
+ for (int i = 0; i <= num_segments; i++)
+ {
+ const float a = amin + ((float)i / (float)num_segments) * (amax - amin);
+ _Path.push_back(ImVec2(centre.x + cosf(a) * radius, centre.y + sinf(a) * radius));
+ }
+}
+
+static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
+{
+ float dx = x4 - x1;
+ float dy = y4 - y1;
+ float d2 = ((x2 - x4) * dy - (y2 - y4) * dx);
+ float d3 = ((x3 - x4) * dy - (y3 - y4) * dx);
+ d2 = (d2 >= 0) ? d2 : -d2;
+ d3 = (d3 >= 0) ? d3 : -d3;
+ if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy))
+ {
+ path->push_back(ImVec2(x4, y4));
+ }
+ else if (level < 10)
+ {
+ float x12 = (x1+x2)*0.5f, y12 = (y1+y2)*0.5f;
+ float x23 = (x2+x3)*0.5f, y23 = (y2+y3)*0.5f;
+ float x34 = (x3+x4)*0.5f, y34 = (y3+y4)*0.5f;
+ float x123 = (x12+x23)*0.5f, y123 = (y12+y23)*0.5f;
+ float x234 = (x23+x34)*0.5f, y234 = (y23+y34)*0.5f;
+ float x1234 = (x123+x234)*0.5f, y1234 = (y123+y234)*0.5f;
+
+ PathBezierToCasteljau(path, x1,y1, x12,y12, x123,y123, x1234,y1234, tess_tol, level+1);
+ PathBezierToCasteljau(path, x1234,y1234, x234,y234, x34,y34, x4,y4, tess_tol, level+1);
+ }
+}
+
+void ImDrawList::PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments)
+{
+ ImVec2 p1 = _Path.back();
+ if (num_segments == 0)
+ {
+ // Auto-tessellated
+ PathBezierToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, GImGui->Style.CurveTessellationTol, 0);
+ }
+ else
+ {
+ float t_step = 1.0f / (float)num_segments;
+ for (int i_step = 1; i_step <= num_segments; i_step++)
+ {
+ float t = t_step * i_step;
+ float u = 1.0f - t;
+ float w1 = u*u*u;
+ float w2 = 3*u*u*t;
+ float w3 = 3*u*t*t;
+ float w4 = t*t*t;
+ _Path.push_back(ImVec2(w1*p1.x + w2*p2.x + w3*p3.x + w4*p4.x, w1*p1.y + w2*p2.y + w3*p3.y + w4*p4.y));
+ }
+ }
+}
+
+void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, int rounding_corners)
+{
+ float r = rounding;
+ r = ImMin(r, fabsf(b.x-a.x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ) - 1.0f);
+ r = ImMin(r, fabsf(b.y-a.y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ) - 1.0f);
+
+ if (r <= 0.0f || rounding_corners == 0)
+ {
+ PathLineTo(a);
+ PathLineTo(ImVec2(b.x,a.y));
+ PathLineTo(b);
+ PathLineTo(ImVec2(a.x,b.y));
+ }
+ else
+ {
+ const float r0 = (rounding_corners & 1) ? r : 0.0f;
+ const float r1 = (rounding_corners & 2) ? r : 0.0f;
+ const float r2 = (rounding_corners & 4) ? r : 0.0f;
+ const float r3 = (rounding_corners & 8) ? r : 0.0f;
+ PathArcToFast(ImVec2(a.x+r0,a.y+r0), r0, 6, 9);
+ PathArcToFast(ImVec2(b.x-r1,a.y+r1), r1, 9, 12);
+ PathArcToFast(ImVec2(b.x-r2,b.y-r2), r2, 0, 3);
+ PathArcToFast(ImVec2(a.x+r3,b.y-r3), r3, 3, 6);
+ }
+}
+
+void ImDrawList::AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness)
+{
+ if ((col >> 24) == 0)
+ return;
+ PathLineTo(a + ImVec2(0.5f,0.5f));
+ PathLineTo(b + ImVec2(0.5f,0.5f));
+ PathStroke(col, false, thickness);
+}
+
+void ImDrawList::AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners)
+{
+ if ((col >> 24) == 0)
+ return;
+ PathRect(a + ImVec2(0.5f,0.5f), b + ImVec2(0.5f,0.5f), rounding, rounding_corners);
+ PathStroke(col, true);
+}
+
+void ImDrawList::AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners)
+{
+ if ((col >> 24) == 0)
+ return;
+ if (rounding > 0.0f)
+ {
+ PathRect(a, b, rounding, rounding_corners);
+ PathFill(col);
+ }
+ else
+ {
+ PrimReserve(6, 4);
+ PrimRect(a, b, col);
+ }
+}
+
+void ImDrawList::AddRectFilledMultiColor(const ImVec2& a, const ImVec2& c, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left)
+{
+ if (((col_upr_left | col_upr_right | col_bot_right | col_bot_left) >> 24) == 0)
+ return;
+
+ const ImVec2 uv = GImGui->FontTexUvWhitePixel;
+ PrimReserve(6, 4);
+ PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+1)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2));
+ PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+2)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx+3));
+ PrimWriteVtx(a, uv, col_upr_left);
+ PrimWriteVtx(ImVec2(c.x, a.y), uv, col_upr_right);
+ PrimWriteVtx(c, uv, col_bot_right);
+ PrimWriteVtx(ImVec2(a.x, c.y), uv, col_bot_left);
+}
+
+void ImDrawList::AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ PathLineTo(a);
+ PathLineTo(b);
+ PathLineTo(c);
+ PathFill(col);
+}
+
+void ImDrawList::AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ const float a_max = IM_PI*2.0f * ((float)num_segments - 1.0f) / (float)num_segments;
+ PathArcTo(centre, radius, 0.0f, a_max, num_segments);
+ PathStroke(col, true);
+}
+
+void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ const float a_max = IM_PI*2.0f * ((float)num_segments - 1.0f) / (float)num_segments;
+ PathArcTo(centre, radius, 0.0f, a_max, num_segments);
+ PathFill(col);
+}
+
+void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ PathLineTo(pos0);
+ PathBezierCurveTo(cp0, cp1, pos1, num_segments);
+ PathStroke(col, false, thickness);
+}
+
+void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ if (text_end == NULL)
+ text_end = text_begin + strlen(text_begin);
+ if (text_begin == text_end)
+ return;
+
+ IM_ASSERT(font->ContainerAtlas->TexID == _TextureIdStack.back()); // Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
+
+ // reserve vertices for worse case (over-reserving is useful and easily amortized)
+ const int char_count = (int)(text_end - text_begin);
+ const int vtx_count_max = char_count * 4;
+ const int idx_count_max = char_count * 6;
+ const int vtx_begin = VtxBuffer.Size;
+ const int idx_begin = IdxBuffer.Size;
+ PrimReserve(idx_count_max, vtx_count_max);
+
+ ImVec4 clip_rect = _ClipRectStack.back();
+ if (cpu_fine_clip_rect)
+ {
+ clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x);
+ clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y);
+ clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z);
+ clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w);
+ }
+ font->RenderText(font_size, pos, col, clip_rect, text_begin, text_end, this, wrap_width, cpu_fine_clip_rect != NULL);
+
+ // give back unused vertices
+ // FIXME-OPT: clean this up
+ VtxBuffer.resize((int)(_VtxWritePtr - VtxBuffer.Data));
+ IdxBuffer.resize((int)(_IdxWritePtr - IdxBuffer.Data));
+ int vtx_unused = vtx_count_max - (VtxBuffer.Size - vtx_begin);
+ int idx_unused = idx_count_max - (IdxBuffer.Size - idx_begin);
+ CmdBuffer.back().ElemCount -= idx_unused;
+ _VtxWritePtr -= vtx_unused;
+ _IdxWritePtr -= idx_unused;
+ _VtxCurrentIdx = (ImDrawIdx)VtxBuffer.Size;
+}
+
+// This is one of the few function breaking the encapsulation of ImDrawLst, but it is just so useful.
+void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ AddText(GImGui->Font, GImGui->FontSize, pos, col, text_begin, text_end);
+}
+
+void ImDrawList::AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col)
+{
+ if ((col >> 24) == 0)
+ return;
+
+ // FIXME-OPT: This is wasting draw calls.
+ const bool push_texture_id = _TextureIdStack.empty() || user_texture_id != _TextureIdStack.back();
+ if (push_texture_id)
+ PushTextureID(user_texture_id);
+
+ PrimReserve(6, 4);
+ PrimRectUV(a, b, uv0, uv1, col);
+
+ if (push_texture_id)
+ PopTextureID();
+}
+
+//-----------------------------------------------------------------------------
+// ImDrawData
+//-----------------------------------------------------------------------------
+
+// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
+void ImDrawData::DeIndexAllBuffers()
+{
+ ImVector<ImDrawVert> new_vtx_buffer;
+ TotalVtxCount = TotalIdxCount = 0;
+ for (int i = 0; i < CmdListsCount; i++)
+ {
+ ImDrawList* cmd_list = CmdLists[i];
+ if (cmd_list->IdxBuffer.empty())
+ continue;
+ new_vtx_buffer.resize(cmd_list->IdxBuffer.Size);
+ for (int j = 0; j < cmd_list->IdxBuffer.Size; j++)
+ new_vtx_buffer[j] = cmd_list->VtxBuffer[cmd_list->IdxBuffer[j]];
+ cmd_list->VtxBuffer.swap(new_vtx_buffer);
+ cmd_list->IdxBuffer.resize(0);
+ TotalVtxCount += cmd_list->VtxBuffer.Size;
+ }
+}
+
+// Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
+void ImDrawData::ScaleClipRects(const ImVec2& scale)
+{
+ for (int i = 0; i < CmdListsCount; i++)
+ {
+ ImDrawList* cmd_list = CmdLists[i];
+ for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
+ {
+ ImDrawCmd* cmd = &cmd_list->CmdBuffer[cmd_i];
+ cmd->ClipRect = ImVec4(cmd->ClipRect.x * scale.x, cmd->ClipRect.y * scale.y, cmd->ClipRect.z * scale.x, cmd->ClipRect.w * scale.y);
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+// ImFontAtlas
+//-----------------------------------------------------------------------------
+
+ImFontConfig::ImFontConfig()
+{
+ FontData = NULL;
+ FontDataSize = 0;
+ FontDataOwnedByAtlas = true;
+ FontNo = 0;
+ SizePixels = 0.0f;
+ OversampleH = 3;
+ OversampleV = 1;
+ PixelSnapH = false;
+ GlyphExtraSpacing = ImVec2(0.0f, 0.0f);
+ GlyphRanges = NULL;
+ MergeMode = false;
+ MergeGlyphCenterV = false;
+ DstFont = NULL;
+ memset(Name, 0, sizeof(Name));
+}
+
+ImFontAtlas::ImFontAtlas()
+{
+ TexID = NULL;
+ TexPixelsAlpha8 = NULL;
+ TexPixelsRGBA32 = NULL;
+ TexWidth = TexHeight = TexDesiredWidth = 0;
+ TexUvWhitePixel = ImVec2(0, 0);
+}
+
+ImFontAtlas::~ImFontAtlas()
+{
+ Clear();
+}
+
+void ImFontAtlas::ClearInputData()
+{
+ for (int i = 0; i < ConfigData.Size; i++)
+ if (ConfigData[i].FontData && ConfigData[i].FontDataOwnedByAtlas)
+ {
+ ImGui::MemFree(ConfigData[i].FontData);
+ ConfigData[i].FontData = NULL;
+ }
+
+ // When clearing this we lose access to the font name and other information used to build the font.
+ for (int i = 0; i < Fonts.Size; i++)
+ if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size)
+ {
+ Fonts[i]->ConfigData = NULL;
+ Fonts[i]->ConfigDataCount = 0;
+ }
+ ConfigData.clear();
+}
+
+void ImFontAtlas::ClearTexData()
+{
+ if (TexPixelsAlpha8)
+ ImGui::MemFree(TexPixelsAlpha8);
+ if (TexPixelsRGBA32)
+ ImGui::MemFree(TexPixelsRGBA32);
+ TexPixelsAlpha8 = NULL;
+ TexPixelsRGBA32 = NULL;
+}
+
+void ImFontAtlas::ClearFonts()
+{
+ for (int i = 0; i < Fonts.Size; i++)
+ {
+ Fonts[i]->~ImFont();
+ ImGui::MemFree(Fonts[i]);
+ }
+ Fonts.clear();
+}
+
+void ImFontAtlas::Clear()
+{
+ ClearInputData();
+ ClearTexData();
+ ClearFonts();
+}
+
+void ImFontAtlas::GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
+{
+ // Build atlas on demand
+ if (TexPixelsAlpha8 == NULL)
+ {
+ if (ConfigData.empty())
+ AddFontDefault();
+ Build();
+ }
+
+ *out_pixels = TexPixelsAlpha8;
+ if (out_width) *out_width = TexWidth;
+ if (out_height) *out_height = TexHeight;
+ if (out_bytes_per_pixel) *out_bytes_per_pixel = 1;
+}
+
+void ImFontAtlas::GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel)
+{
+ // Convert to RGBA32 format on demand
+ // Although it is likely to be the most commonly used format, our font rendering is 1 channel / 8 bpp
+ if (!TexPixelsRGBA32)
+ {
+ unsigned char* pixels;
+ GetTexDataAsAlpha8(&pixels, NULL, NULL);
+ TexPixelsRGBA32 = (unsigned int*)ImGui::MemAlloc((size_t)(TexWidth * TexHeight * 4));
+ const unsigned char* src = pixels;
+ unsigned int* dst = TexPixelsRGBA32;
+ for (int n = TexWidth * TexHeight; n > 0; n--)
+ *dst++ = ((unsigned int)(*src++) << 24) | 0x00FFFFFF;
+ }
+
+ *out_pixels = (unsigned char*)TexPixelsRGBA32;
+ if (out_width) *out_width = TexWidth;
+ if (out_height) *out_height = TexHeight;
+ if (out_bytes_per_pixel) *out_bytes_per_pixel = 4;
+}
+
+ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
+{
+ IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0);
+ IM_ASSERT(font_cfg->SizePixels > 0.0f);
+
+ // Create new font
+ if (!font_cfg->MergeMode)
+ {
+ ImFont* font = (ImFont*)ImGui::MemAlloc(sizeof(ImFont));
+ new (font) ImFont();
+ Fonts.push_back(font);
+ }
+
+ ConfigData.push_back(*font_cfg);
+ ImFontConfig& new_font_cfg = ConfigData.back();
+ new_font_cfg.DstFont = Fonts.back();
+ if (!new_font_cfg.FontDataOwnedByAtlas)
+ {
+ new_font_cfg.FontData = ImGui::MemAlloc(new_font_cfg.FontDataSize);
+ new_font_cfg.FontDataOwnedByAtlas = true;
+ memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize);
+ }
+
+ // Invalidate texture
+ ClearTexData();
+ return Fonts.back();
+}
+
+// Default font TTF is compressed with stb_compress then base85 encoded (see extra_fonts/binary_to_compressed_c.cpp for encoder)
+static unsigned int stb_decompress_length(unsigned char *input);
+static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length);
+static const char* GetDefaultCompressedFontDataTTFBase85();
+static unsigned int Decode85Byte(char c) { return c >= '\\' ? c-36 : c-35; }
+static void Decode85(const unsigned char* src, unsigned char* dst)
+{
+ while (*src)
+ {
+ unsigned int tmp = Decode85Byte(src[0]) + 85*(Decode85Byte(src[1]) + 85*(Decode85Byte(src[2]) + 85*(Decode85Byte(src[3]) + 85*Decode85Byte(src[4]))));
+ dst[0] = ((tmp >> 0) & 0xFF); dst[1] = ((tmp >> 8) & 0xFF); dst[2] = ((tmp >> 16) & 0xFF); dst[3] = ((tmp >> 24) & 0xFF); // We can't assume little-endianess.
+ src += 5;
+ dst += 4;
+ }
+}
+
+// Load embedded ProggyClean.ttf at size 13, disable oversampling
+ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
+{
+ ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
+ if (!font_cfg_template)
+ {
+ font_cfg.OversampleH = font_cfg.OversampleV = 1;
+ font_cfg.PixelSnapH = true;
+ }
+ if (font_cfg.Name[0] == '\0') strcpy(font_cfg.Name, "<default>");
+
+ const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85();
+ ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, 13.0f, &font_cfg, GetGlyphRangesDefault());
+ return font;
+}
+
+ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
+{
+ int data_size = 0;
+ void* data = ImLoadFileToMemory(filename, "rb", &data_size, 0);
+ if (!data)
+ {
+ IM_ASSERT(0); // Could not load file.
+ return NULL;
+ }
+ ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
+ if (font_cfg.Name[0] == '\0')
+ {
+ // Store a short copy of filename into into the font name for convenience
+ const char* p;
+ for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
+ snprintf(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s", p);
+ }
+ return AddFontFromMemoryTTF(data, data_size, size_pixels, &font_cfg, glyph_ranges);
+}
+
+// NBM Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
+ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
+{
+ ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
+ IM_ASSERT(font_cfg.FontData == NULL);
+ font_cfg.FontData = ttf_data;
+ font_cfg.FontDataSize = ttf_size;
+ font_cfg.SizePixels = size_pixels;
+ if (glyph_ranges)
+ font_cfg.GlyphRanges = glyph_ranges;
+ return AddFont(&font_cfg);
+}
+
+ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
+{
+ const unsigned int buf_decompressed_size = stb_decompress_length((unsigned char*)compressed_ttf_data);
+ unsigned char* buf_decompressed_data = (unsigned char *)ImGui::MemAlloc(buf_decompressed_size);
+ stb_decompress(buf_decompressed_data, (unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size);
+
+ ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
+ IM_ASSERT(font_cfg.FontData == NULL);
+ font_cfg.FontDataOwnedByAtlas = true;
+ return AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, font_cfg_template, glyph_ranges);
+}
+
+ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg, const ImWchar* glyph_ranges)
+{
+ int compressed_ttf_size = (((int)strlen(compressed_ttf_data_base85) + 4) / 5) * 4;
+ void* compressed_ttf = ImGui::MemAlloc(compressed_ttf_size);
+ Decode85((const unsigned char*)compressed_ttf_data_base85, (unsigned char*)compressed_ttf);
+ ImFont* font = AddFontFromMemoryCompressedTTF(compressed_ttf, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges);
+ ImGui::MemFree(compressed_ttf);
+ return font;
+}
+
+bool ImFontAtlas::Build()
+{
+ IM_ASSERT(ConfigData.Size > 0);
+
+ TexID = NULL;
+ TexWidth = TexHeight = 0;
+ TexUvWhitePixel = ImVec2(0, 0);
+ ClearTexData();
+
+ struct ImFontTempBuildData
+ {
+ stbtt_fontinfo FontInfo;
+ stbrp_rect* Rects;
+ stbtt_pack_range* Ranges;
+ int RangesCount;
+ };
+ ImFontTempBuildData* tmp_array = (ImFontTempBuildData*)ImGui::MemAlloc((size_t)ConfigData.Size * sizeof(ImFontTempBuildData));
+
+ // Initialize font information early (so we can error without any cleanup) + count glyphs
+ int total_glyph_count = 0;
+ int total_glyph_range_count = 0;
+ for (int input_i = 0; input_i < ConfigData.Size; input_i++)
+ {
+ ImFontConfig& cfg = ConfigData[input_i];
+ ImFontTempBuildData& tmp = tmp_array[input_i];
+
+ IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == this));
+ const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)cfg.FontData, cfg.FontNo);
+ IM_ASSERT(font_offset >= 0);
+ if (!stbtt_InitFont(&tmp.FontInfo, (unsigned char*)cfg.FontData, font_offset))
+ return false;
+
+ // Count glyphs
+ if (!cfg.GlyphRanges)
+ cfg.GlyphRanges = GetGlyphRangesDefault();
+ for (const ImWchar* in_range = cfg.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
+ {
+ total_glyph_count += (in_range[1] - in_range[0]) + 1;
+ total_glyph_range_count++;
+ }
+ }
+
+ // Start packing
+ TexWidth = (TexDesiredWidth > 0) ? TexDesiredWidth : (total_glyph_count > 2000) ? 2048 : (total_glyph_count > 1000) ? 1024 : 512; // Width doesn't actually matters much but some API/GPU have texture size limitations, and increasing width can decrease height.
+ TexHeight = 0;
+ const int max_tex_height = 1024*32;
+ stbtt_pack_context spc;
+ stbtt_PackBegin(&spc, NULL, TexWidth, max_tex_height, 0, 1, NULL);
+
+ // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values).
+ ImVector<stbrp_rect> extra_rects;
+ RenderCustomTexData(0, &extra_rects);
+ stbtt_PackSetOversampling(&spc, 1, 1);
+ stbrp_pack_rects((stbrp_context*)spc.pack_info, &extra_rects[0], extra_rects.Size);
+ for (int i = 0; i < extra_rects.Size; i++)
+ if (extra_rects[i].was_packed)
+ TexHeight = ImMax(TexHeight, extra_rects[i].y + extra_rects[i].h);
+
+ // Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0)
+ int buf_packedchars_n = 0, buf_rects_n = 0, buf_ranges_n = 0;
+ stbtt_packedchar* buf_packedchars = (stbtt_packedchar*)ImGui::MemAlloc(total_glyph_count * sizeof(stbtt_packedchar));
+ stbrp_rect* buf_rects = (stbrp_rect*)ImGui::MemAlloc(total_glyph_count * sizeof(stbrp_rect));
+ stbtt_pack_range* buf_ranges = (stbtt_pack_range*)ImGui::MemAlloc(total_glyph_range_count * sizeof(stbtt_pack_range));
+ memset(buf_packedchars, 0, total_glyph_count * sizeof(stbtt_packedchar));
+ memset(buf_rects, 0, total_glyph_count * sizeof(stbrp_rect)); // Unnecessary but let's clear this for the sake of sanity.
+ memset(buf_ranges, 0, total_glyph_range_count * sizeof(stbtt_pack_range));
+
+ // First font pass: pack all glyphs (no rendering at this point, we are working with rectangles in an infinitely tall texture at this point)
+ for (int input_i = 0; input_i < ConfigData.Size; input_i++)
+ {
+ ImFontConfig& cfg = ConfigData[input_i];
+ ImFontTempBuildData& tmp = tmp_array[input_i];
+
+ // Setup ranges
+ int glyph_count = 0;
+ int glyph_ranges_count = 0;
+ for (const ImWchar* in_range = cfg.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
+ {
+ glyph_count += (in_range[1] - in_range[0]) + 1;
+ glyph_ranges_count++;
+ }
+ tmp.Ranges = buf_ranges + buf_ranges_n;
+ tmp.RangesCount = glyph_ranges_count;
+ buf_ranges_n += glyph_ranges_count;
+ for (int i = 0; i < glyph_ranges_count; i++)
+ {
+ const ImWchar* in_range = &cfg.GlyphRanges[i * 2];
+ stbtt_pack_range& range = tmp.Ranges[i];
+ range.font_size = cfg.SizePixels;
+ range.first_unicode_codepoint_in_range = in_range[0];
+ range.num_chars = (in_range[1] - in_range[0]) + 1;
+ range.chardata_for_range = buf_packedchars + buf_packedchars_n;
+ buf_packedchars_n += range.num_chars;
+ }
+
+ // Pack
+ tmp.Rects = buf_rects + buf_rects_n;
+ buf_rects_n += glyph_count;
+ stbtt_PackSetOversampling(&spc, cfg.OversampleH, cfg.OversampleV);
+ int n = stbtt_PackFontRangesGatherRects(&spc, &tmp.FontInfo, tmp.Ranges, tmp.RangesCount, tmp.Rects);
+ stbrp_pack_rects((stbrp_context*)spc.pack_info, tmp.Rects, n);
+
+ // Extend texture height
+ for (int i = 0; i < n; i++)
+ if (tmp.Rects[i].was_packed)
+ TexHeight = ImMax(TexHeight, tmp.Rects[i].y + tmp.Rects[i].h);
+ }
+ IM_ASSERT(buf_rects_n == total_glyph_count);
+ IM_ASSERT(buf_packedchars_n == total_glyph_count);
+ IM_ASSERT(buf_ranges_n == total_glyph_range_count);
+
+ // Create texture
+ TexHeight = ImUpperPowerOfTwo(TexHeight);
+ TexPixelsAlpha8 = (unsigned char*)ImGui::MemAlloc(TexWidth * TexHeight);
+ memset(TexPixelsAlpha8, 0, TexWidth * TexHeight);
+ spc.pixels = TexPixelsAlpha8;
+ spc.height = TexHeight;
+
+ // Second pass: render characters
+ for (int input_i = 0; input_i < ConfigData.Size; input_i++)
+ {
+ ImFontConfig& cfg = ConfigData[input_i];
+ ImFontTempBuildData& tmp = tmp_array[input_i];
+ stbtt_PackSetOversampling(&spc, cfg.OversampleH, cfg.OversampleV);
+ stbtt_PackFontRangesRenderIntoRects(&spc, &tmp.FontInfo, tmp.Ranges, tmp.RangesCount, tmp.Rects);
+ tmp.Rects = NULL;
+ }
+
+ // End packing
+ stbtt_PackEnd(&spc);
+ ImGui::MemFree(buf_rects);
+ buf_rects = NULL;
+
+ // Third pass: setup ImFont and glyphs for runtime
+ for (int input_i = 0; input_i < ConfigData.Size; input_i++)
+ {
+ ImFontConfig& cfg = ConfigData[input_i];
+ ImFontTempBuildData& tmp = tmp_array[input_i];
+ ImFont* dst_font = cfg.DstFont;
+
+ float font_scale = stbtt_ScaleForPixelHeight(&tmp.FontInfo, cfg.SizePixels);
+ int unscaled_ascent, unscaled_descent, unscaled_line_gap;
+ stbtt_GetFontVMetrics(&tmp.FontInfo, &unscaled_ascent, &unscaled_descent, &unscaled_line_gap);
+
+ float ascent = unscaled_ascent * font_scale;
+ float descent = unscaled_descent * font_scale;
+ if (!cfg.MergeMode)
+ {
+ dst_font->ContainerAtlas = this;
+ dst_font->ConfigData = &cfg;
+ dst_font->ConfigDataCount = 0;
+ dst_font->FontSize = cfg.SizePixels;
+ dst_font->Ascent = ascent;
+ dst_font->Descent = descent;
+ dst_font->Glyphs.resize(0);
+ }
+ dst_font->ConfigDataCount++;
+ float off_y = (cfg.MergeMode && cfg.MergeGlyphCenterV) ? (ascent - dst_font->Ascent) * 0.5f : 0.0f;
+
+ dst_font->FallbackGlyph = NULL; // Always clear fallback so FindGlyph can return NULL. It will be set again in BuildLookupTable()
+ for (int i = 0; i < tmp.RangesCount; i++)
+ {
+ stbtt_pack_range& range = tmp.Ranges[i];
+ for (int char_idx = 0; char_idx < range.num_chars; char_idx += 1)
+ {
+ const stbtt_packedchar& pc = range.chardata_for_range[char_idx];
+ if (!pc.x0 && !pc.x1 && !pc.y0 && !pc.y1)
+ continue;
+
+ const int codepoint = range.first_unicode_codepoint_in_range + char_idx;
+ if (cfg.MergeMode && dst_font->FindGlyph((unsigned short)codepoint))
+ continue;
+
+ stbtt_aligned_quad q;
+ float dummy_x = 0.0f, dummy_y = 0.0f;
+ stbtt_GetPackedQuad(range.chardata_for_range, TexWidth, TexHeight, char_idx, &dummy_x, &dummy_y, &q, 0);
+
+ dst_font->Glyphs.resize(dst_font->Glyphs.Size + 1);
+ ImFont::Glyph& glyph = dst_font->Glyphs.back();
+ glyph.Codepoint = (ImWchar)codepoint;
+ glyph.X0 = q.x0; glyph.Y0 = q.y0; glyph.X1 = q.x1; glyph.Y1 = q.y1;
+ glyph.U0 = q.s0; glyph.V0 = q.t0; glyph.U1 = q.s1; glyph.V1 = q.t1;
+ glyph.Y0 += (float)(int)(dst_font->Ascent + off_y + 0.5f);
+ glyph.Y1 += (float)(int)(dst_font->Ascent + off_y + 0.5f);
+ glyph.XAdvance = (pc.xadvance + cfg.GlyphExtraSpacing.x); // Bake spacing into XAdvance
+ if (cfg.PixelSnapH)
+ glyph.XAdvance = (float)(int)(glyph.XAdvance + 0.5f);
+ }
+ }
+ cfg.DstFont->BuildLookupTable();
+ }
+
+ // Cleanup temporaries
+ ImGui::MemFree(buf_packedchars);
+ ImGui::MemFree(buf_ranges);
+ ImGui::MemFree(tmp_array);
+
+ // Render into our custom data block
+ RenderCustomTexData(1, &extra_rects);
+
+ return true;
+}
+
+void ImFontAtlas::RenderCustomTexData(int pass, void* p_rects)
+{
+ // A work of art lies ahead! (. = white layer, X = black layer, others are blank)
+ // The white texels on the top left are the ones we'll use everywhere in ImGui to render filled shapes.
+ const int TEX_DATA_W = 90;
+ const int TEX_DATA_H = 27;
+ const char texture_data[TEX_DATA_W*TEX_DATA_H+1] =
+ {
+ "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX"
+ "..- -X.....X- X.X - X.X -X.....X - X.....X"
+ "--- -XXX.XXX- X...X - X...X -X....X - X....X"
+ "X - X.X - X.....X - X.....X -X...X - X...X"
+ "XX - X.X -X.......X- X.......X -X..X.X - X.X..X"
+ "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X"
+ "X..X - X.X - X.X - X.X -XX X.X - X.X XX"
+ "X...X - X.X - X.X - XX X.X XX - X.X - X.X "
+ "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X "
+ "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X "
+ "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X "
+ "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X "
+ "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X "
+ "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X "
+ "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X "
+ "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X "
+ "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX "
+ "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------"
+ "X.X X..X - -X.......X- X.......X - XX XX - "
+ "XX X..X - - X.....X - X.....X - X.X X.X - "
+ " X..X - X...X - X...X - X..X X..X - "
+ " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - "
+ "------------ - X - X -X.....................X- "
+ " ----------------------------------- X...XXXXXXXXXXXXX...X - "
+ " - X..X X..X - "
+ " - X.X X.X - "
+ " - XX XX - "
+ };
+
+ ImVector<stbrp_rect>& rects = *(ImVector<stbrp_rect>*)p_rects;
+ if (pass == 0)
+ {
+ // Request rectangles
+ stbrp_rect r;
+ memset(&r, 0, sizeof(r));
+ r.w = (TEX_DATA_W*2)+1;
+ r.h = TEX_DATA_H+1;
+ rects.push_back(r);
+ }
+ else if (pass == 1)
+ {
+ // Render/copy pixels
+ const stbrp_rect& r = rects[0];
+ for (int y = 0, n = 0; y < TEX_DATA_H; y++)
+ for (int x = 0; x < TEX_DATA_W; x++, n++)
+ {
+ const int offset0 = (int)(r.x + x) + (int)(r.y + y) * TexWidth;
+ const int offset1 = offset0 + 1 + TEX_DATA_W;
+ TexPixelsAlpha8[offset0] = texture_data[n] == '.' ? 0xFF : 0x00;
+ TexPixelsAlpha8[offset1] = texture_data[n] == 'X' ? 0xFF : 0x00;
+ }
+ const ImVec2 tex_uv_scale(1.0f / TexWidth, 1.0f / TexHeight);
+ TexUvWhitePixel = ImVec2((r.x + 0.5f) * tex_uv_scale.x, (r.y + 0.5f) * tex_uv_scale.y);
+
+ // Setup mouse cursors
+ const ImVec2 cursor_datas[ImGuiMouseCursor_Count_][3] =
+ {
+ // Pos ........ Size ......... Offset ......
+ { ImVec2(0,3), ImVec2(12,19), ImVec2( 0, 0) }, // ImGuiMouseCursor_Arrow
+ { ImVec2(13,0), ImVec2(7,16), ImVec2( 4, 8) }, // ImGuiMouseCursor_TextInput
+ { ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) }, // ImGuiMouseCursor_Move
+ { ImVec2(21,0), ImVec2( 9,23), ImVec2( 5,11) }, // ImGuiMouseCursor_ResizeNS
+ { ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 5) }, // ImGuiMouseCursor_ResizeEW
+ { ImVec2(73,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNESW
+ { ImVec2(55,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNWSE
+ };
+
+ for (int type = 0; type < ImGuiMouseCursor_Count_; type++)
+ {
+ ImGuiMouseCursorData& cursor_data = GImGui->MouseCursorData[type];
+ ImVec2 pos = cursor_datas[type][0] + ImVec2((float)r.x, (float)r.y);
+ const ImVec2 size = cursor_datas[type][1];
+ cursor_data.Type = type;
+ cursor_data.Size = size;
+ cursor_data.HotOffset = cursor_datas[type][2];
+ cursor_data.TexUvMin[0] = (pos) * tex_uv_scale;
+ cursor_data.TexUvMax[0] = (pos + size) * tex_uv_scale;
+ pos.x += TEX_DATA_W+1;
+ cursor_data.TexUvMin[1] = (pos) * tex_uv_scale;
+ cursor_data.TexUvMax[1] = (pos + size) * tex_uv_scale;
+ }
+ }
+}
+
+// Retrieve list of range (2 int per range, values are inclusive)
+const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
+{
+ static const ImWchar ranges[] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0,
+ };
+ return &ranges[0];
+}
+
+const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
+{
+ static const ImWchar ranges[] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0x3131, 0x3163, // Korean alphabets
+ 0xAC00, 0xD79D, // Korean characters
+ 0,
+ };
+ return &ranges[0];
+}
+
+const ImWchar* ImFontAtlas::GetGlyphRangesChinese()
+{
+ static const ImWchar ranges[] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
+ 0x31F0, 0x31FF, // Katakana Phonetic Extensions
+ 0xFF00, 0xFFEF, // Half-width characters
+ 0x4e00, 0x9FAF, // CJK Ideograms
+ 0,
+ };
+ return &ranges[0];
+}
+
+const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
+{
+ // Store the 1946 ideograms code points as successive offsets from the initial unicode codepoint 0x4E00. Each offset has an implicit +1.
+ // This encoding helps us reduce the source code size.
+ static const short offsets_from_0x4E00[] =
+ {
+ -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,
+ 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,
+ 5,4,12,24,3,13,12,10,24,0,0,0,1,0,1,1,2,9,10,2,2,0,0,3,3,1,0,3,8,0,3,2,4,4,1,6,11,10,14,6,15,3,4,15,1,0,0,5,2,2,0,0,1,6,5,5,6,0,3,6,5,0,0,1,0,
+ 11,2,2,8,4,7,0,10,0,1,2,17,19,3,0,2,5,0,6,2,4,4,6,1,1,11,2,0,3,1,2,1,2,10,7,6,3,16,0,8,24,0,0,3,1,1,3,0,1,6,0,0,0,2,0,1,5,15,0,1,0,0,2,11,19,
+ 1,4,19,7,6,5,1,0,0,0,0,5,1,0,1,9,0,0,5,0,2,0,1,0,3,0,11,3,0,2,0,0,0,0,0,9,3,6,4,12,0,14,0,0,29,10,8,0,14,37,13,0,31,16,19,0,8,30,1,20,8,3,48,
+ 21,1,0,12,0,10,44,34,42,54,11,18,82,0,2,1,2,12,1,0,6,2,17,2,12,7,0,7,17,4,2,6,24,23,8,23,39,2,16,23,1,0,5,1,2,15,14,5,6,2,11,0,8,6,2,2,2,14,
+ 20,4,15,3,4,11,10,10,2,5,2,1,30,2,1,0,0,22,5,5,0,3,1,5,4,1,0,0,2,2,21,1,5,1,2,16,2,1,3,4,0,8,4,0,0,5,14,11,2,16,1,13,1,7,0,22,15,3,1,22,7,14,
+ 22,19,11,24,18,46,10,20,64,45,3,2,0,4,5,0,1,4,25,1,0,0,2,10,0,0,0,1,0,1,2,0,0,9,1,2,0,0,0,2,5,2,1,1,5,5,8,1,1,1,5,1,4,9,1,3,0,1,0,1,1,2,0,0,
+ 2,0,1,8,22,8,1,0,0,0,0,4,2,1,0,9,8,5,0,9,1,30,24,2,6,4,39,0,14,5,16,6,26,179,0,2,1,1,0,0,0,5,2,9,6,0,2,5,16,7,5,1,1,0,2,4,4,7,15,13,14,0,0,
+ 3,0,1,0,0,0,2,1,6,4,5,1,4,9,0,3,1,8,0,0,10,5,0,43,0,2,6,8,4,0,2,0,0,9,6,0,9,3,1,6,20,14,6,1,4,0,7,2,3,0,2,0,5,0,3,1,0,3,9,7,0,3,4,0,4,9,1,6,0,
+ 9,0,0,2,3,10,9,28,3,6,2,4,1,2,32,4,1,18,2,0,3,1,5,30,10,0,2,2,2,0,7,9,8,11,10,11,7,2,13,7,5,10,0,3,40,2,0,1,6,12,0,4,5,1,5,11,11,21,4,8,3,7,
+ 8,8,33,5,23,0,0,19,8,8,2,3,0,6,1,1,1,5,1,27,4,2,5,0,3,5,6,3,1,0,3,1,12,5,3,3,2,0,7,7,2,1,0,4,0,1,1,2,0,10,10,6,2,5,9,7,5,15,15,21,6,11,5,20,
+ 4,3,5,5,2,5,0,2,1,0,1,7,28,0,9,0,5,12,5,5,18,30,0,12,3,3,21,16,25,32,9,3,14,11,24,5,66,9,1,2,0,5,9,1,5,1,8,0,8,3,3,0,1,15,1,4,8,1,2,7,0,7,2,
+ 8,3,7,5,3,7,10,2,1,0,0,2,25,0,6,4,0,10,0,4,2,4,1,12,5,38,4,0,4,1,10,5,9,4,0,14,4,2,5,18,20,21,1,3,0,5,0,7,0,3,7,1,3,1,1,8,1,0,0,0,3,2,5,2,11,
+ 6,0,13,1,3,9,1,12,0,16,6,2,1,0,2,1,12,6,13,11,2,0,28,1,7,8,14,13,8,13,0,2,0,5,4,8,10,2,37,42,19,6,6,7,4,14,11,18,14,80,7,6,0,4,72,12,36,27,
+ 7,7,0,14,17,19,164,27,0,5,10,7,3,13,6,14,0,2,2,5,3,0,6,13,0,0,10,29,0,4,0,3,13,0,3,1,6,51,1,5,28,2,0,8,0,20,2,4,0,25,2,10,13,10,0,16,4,0,1,0,
+ 2,1,7,0,1,8,11,0,0,1,2,7,2,23,11,6,6,4,16,2,2,2,0,22,9,3,3,5,2,0,15,16,21,2,9,20,15,15,5,3,9,1,0,0,1,7,7,5,4,2,2,2,38,24,14,0,0,15,5,6,24,14,
+ 5,5,11,0,21,12,0,3,8,4,11,1,8,0,11,27,7,2,4,9,21,59,0,1,39,3,60,62,3,0,12,11,0,3,30,11,0,13,88,4,15,5,28,13,1,4,48,17,17,4,28,32,46,0,16,0,
+ 18,11,1,8,6,38,11,2,6,11,38,2,0,45,3,11,2,7,8,4,30,14,17,2,1,1,65,18,12,16,4,2,45,123,12,56,33,1,4,3,4,7,0,0,0,3,2,0,16,4,2,4,2,0,7,4,5,2,26,
+ 2,25,6,11,6,1,16,2,6,17,77,15,3,35,0,1,0,5,1,0,38,16,6,3,12,3,3,3,0,9,3,1,3,5,2,9,0,18,0,25,1,3,32,1,72,46,6,2,7,1,3,14,17,0,28,1,40,13,0,20,
+ 15,40,6,38,24,12,43,1,1,9,0,12,6,0,6,2,4,19,3,7,1,48,0,9,5,0,5,6,9,6,10,15,2,11,19,3,9,2,0,1,10,1,27,8,1,3,6,1,14,0,26,0,27,16,3,4,9,6,2,23,
+ 9,10,5,25,2,1,6,1,1,48,15,9,15,14,3,4,26,60,29,13,37,21,1,6,4,0,2,11,22,23,16,16,2,2,1,3,0,5,1,6,4,0,0,4,0,0,8,3,0,2,5,0,7,1,7,3,13,2,4,10,
+ 3,0,2,31,0,18,3,0,12,10,4,1,0,7,5,7,0,5,4,12,2,22,10,4,2,15,2,8,9,0,23,2,197,51,3,1,1,4,13,4,3,21,4,19,3,10,5,40,0,4,1,1,10,4,1,27,34,7,21,
+ 2,17,2,9,6,4,2,3,0,4,2,7,8,2,5,1,15,21,3,4,4,2,2,17,22,1,5,22,4,26,7,0,32,1,11,42,15,4,1,2,5,0,19,3,1,8,6,0,10,1,9,2,13,30,8,2,24,17,19,1,4,
+ 4,25,13,0,10,16,11,39,18,8,5,30,82,1,6,8,18,77,11,13,20,75,11,112,78,33,3,0,0,60,17,84,9,1,1,12,30,10,49,5,32,158,178,5,5,6,3,3,1,3,1,4,7,6,
+ 19,31,21,0,2,9,5,6,27,4,9,8,1,76,18,12,1,4,0,3,3,6,3,12,2,8,30,16,2,25,1,5,5,4,3,0,6,10,2,3,1,0,5,1,19,3,0,8,1,5,2,6,0,0,0,19,1,2,0,5,1,2,5,
+ 1,3,7,0,4,12,7,3,10,22,0,9,5,1,0,2,20,1,1,3,23,30,3,9,9,1,4,191,14,3,15,6,8,50,0,1,0,0,4,0,0,1,0,2,4,2,0,2,3,0,2,0,2,2,8,7,0,1,1,1,3,3,17,11,
+ 91,1,9,3,2,13,4,24,15,41,3,13,3,1,20,4,125,29,30,1,0,4,12,2,21,4,5,5,19,11,0,13,11,86,2,18,0,7,1,8,8,2,2,22,1,2,6,5,2,0,1,2,8,0,2,0,5,2,1,0,
+ 2,10,2,0,5,9,2,1,2,0,1,0,4,0,0,10,2,5,3,0,6,1,0,1,4,4,33,3,13,17,3,18,6,4,7,1,5,78,0,4,1,13,7,1,8,1,0,35,27,15,3,0,0,0,1,11,5,41,38,15,22,6,
+ 14,14,2,1,11,6,20,63,5,8,27,7,11,2,2,40,58,23,50,54,56,293,8,8,1,5,1,14,0,1,12,37,89,8,8,8,2,10,6,0,0,0,4,5,2,1,0,1,1,2,7,0,3,3,0,4,6,0,3,2,
+ 19,3,8,0,0,0,4,4,16,0,4,1,5,1,3,0,3,4,6,2,17,10,10,31,6,4,3,6,10,126,7,3,2,2,0,9,0,0,5,20,13,0,15,0,6,0,2,5,8,64,50,3,2,12,2,9,0,0,11,8,20,
+ 109,2,18,23,0,0,9,61,3,0,28,41,77,27,19,17,81,5,2,14,5,83,57,252,14,154,263,14,20,8,13,6,57,39,38,
+ };
+ static int ranges_unpacked = false;
+ static ImWchar ranges[8 + IM_ARRAYSIZE(offsets_from_0x4E00)*2 + 1] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0x3000, 0x30FF, // Punctuations, Hiragana, Katakana
+ 0x31F0, 0x31FF, // Katakana Phonetic Extensions
+ 0xFF00, 0xFFEF, // Half-width characters
+ };
+ if (!ranges_unpacked)
+ {
+ // Unpack
+ int codepoint = 0x4e00;
+ ImWchar* dst = &ranges[8];
+ for (int n = 0; n < IM_ARRAYSIZE(offsets_from_0x4E00); n++, dst += 2)
+ dst[0] = dst[1] = (ImWchar)(codepoint += (offsets_from_0x4E00[n] + 1));
+ dst[0] = 0;
+ ranges_unpacked = true;
+ }
+ return &ranges[0];
+}
+
+const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic()
+{
+ static const ImWchar ranges[] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement
+ 0x2DE0, 0x2DFF, // Cyrillic Extended-A
+ 0xA640, 0xA69F, // Cyrillic Extended-B
+ 0,
+ };
+ return &ranges[0];
+}
+
+//-----------------------------------------------------------------------------
+// ImFont
+//-----------------------------------------------------------------------------
+
+ImFont::ImFont()
+{
+ Scale = 1.0f;
+ FallbackChar = (ImWchar)'?';
+ Clear();
+}
+
+ImFont::~ImFont()
+{
+ // Invalidate active font so that the user gets a clear crash instead of a dangling pointer.
+ // If you want to delete fonts you need to do it between Render() and NewFrame().
+ // FIXME-CLEANUP
+ /*
+ ImGuiState& g = *GImGui;
+ if (g.Font == this)
+ g.Font = NULL;
+ */
+ Clear();
+}
+
+void ImFont::Clear()
+{
+ FontSize = 0.0f;
+ DisplayOffset = ImVec2(0.0f, 1.0f);
+ ConfigData = NULL;
+ ConfigDataCount = 0;
+ Ascent = Descent = 0.0f;
+ ContainerAtlas = NULL;
+ Glyphs.clear();
+ FallbackGlyph = NULL;
+ FallbackXAdvance = 0.0f;
+ IndexXAdvance.clear();
+ IndexLookup.clear();
+}
+
+void ImFont::BuildLookupTable()
+{
+ int max_codepoint = 0;
+ for (int i = 0; i != Glyphs.Size; i++)
+ max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint);
+
+ IndexXAdvance.clear();
+ IndexXAdvance.resize(max_codepoint + 1);
+ IndexLookup.clear();
+ IndexLookup.resize(max_codepoint + 1);
+ for (int i = 0; i < max_codepoint + 1; i++)
+ {
+ IndexXAdvance[i] = -1.0f;
+ IndexLookup[i] = -1;
+ }
+ for (int i = 0; i < Glyphs.Size; i++)
+ {
+ int codepoint = (int)Glyphs[i].Codepoint;
+ IndexXAdvance[codepoint] = Glyphs[i].XAdvance;
+ IndexLookup[codepoint] = i;
+ }
+
+ // Create a glyph to handle TAB
+ // FIXME: Needs proper TAB handling but it needs to be contextualized (or we could arbitrary say that each string starts at "column 0" ?)
+ if (FindGlyph((unsigned short)' '))
+ {
+ if (Glyphs.back().Codepoint != '\t') // So we can call this function multiple times
+ Glyphs.resize(Glyphs.Size + 1);
+ ImFont::Glyph& tab_glyph = Glyphs.back();
+ tab_glyph = *FindGlyph((unsigned short)' ');
+ tab_glyph.Codepoint = '\t';
+ tab_glyph.XAdvance *= 4;
+ IndexXAdvance[(int)tab_glyph.Codepoint] = (float)tab_glyph.XAdvance;
+ IndexLookup[(int)tab_glyph.Codepoint] = (int)(Glyphs.Size-1);
+ }
+
+ FallbackGlyph = NULL;
+ FallbackGlyph = FindGlyph(FallbackChar);
+ FallbackXAdvance = FallbackGlyph ? FallbackGlyph->XAdvance : 0.0f;
+ for (int i = 0; i < max_codepoint + 1; i++)
+ if (IndexXAdvance[i] < 0.0f)
+ IndexXAdvance[i] = FallbackXAdvance;
+}
+
+void ImFont::SetFallbackChar(ImWchar c)
+{
+ FallbackChar = c;
+ BuildLookupTable();
+}
+
+const ImFont::Glyph* ImFont::FindGlyph(unsigned short c) const
+{
+ if (c < IndexLookup.Size)
+ {
+ const int i = IndexLookup[c];
+ if (i != -1)
+ return &Glyphs[i];
+ }
+ return FallbackGlyph;
+}
+
+const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
+{
+ // Simple word-wrapping for English, not full-featured. Please submit failing cases!
+ // FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
+
+ // For references, possible wrap point marked with ^
+ // "aaa bbb, ccc,ddd. eee fff. ggg!"
+ // ^ ^ ^ ^ ^__ ^ ^
+
+ // List of hardcoded separators: .,;!?'"
+
+ // Skip extra blanks after a line returns (that includes not counting them in width computation)
+ // e.g. "Hello world" --> "Hello" "World"
+
+ // Cut words that cannot possibly fit within one line.
+ // e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
+
+ float line_width = 0.0f;
+ float word_width = 0.0f;
+ float blank_width = 0.0f;
+
+ const char* word_end = text;
+ const char* prev_word_end = NULL;
+ bool inside_word = true;
+
+ const char* s = text;
+ while (s < text_end)
+ {
+ unsigned int c = (unsigned int)*s;
+ const char* next_s;
+ if (c < 0x80)
+ next_s = s + 1;
+ else
+ next_s = s + ImTextCharFromUtf8(&c, s, text_end);
+ if (c == 0)
+ break;
+
+ if (c < 32)
+ {
+ if (c == '\n')
+ {
+ line_width = word_width = blank_width = 0.0f;
+ inside_word = true;
+ s = next_s;
+ continue;
+ }
+ if (c == '\r')
+ {
+ s = next_s;
+ continue;
+ }
+ }
+
+ const float char_width = ((int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] * scale : FallbackXAdvance;
+ if (ImCharIsSpace(c))
+ {
+ if (inside_word)
+ {
+ line_width += blank_width;
+ blank_width = 0.0f;
+ }
+ blank_width += char_width;
+ inside_word = false;
+ }
+ else
+ {
+ word_width += char_width;
+ if (inside_word)
+ {
+ word_end = next_s;
+ }
+ else
+ {
+ prev_word_end = word_end;
+ line_width += word_width + blank_width;
+ word_width = blank_width = 0.0f;
+ }
+
+ // Allow wrapping after punctuation.
+ inside_word = !(c == '.' || c == ',' || c == ';' || c == '!' || c == '?' || c == '\"');
+ }
+
+ // We ignore blank width at the end of the line (they can be skipped)
+ if (line_width + word_width >= wrap_width)
+ {
+ // Words that cannot possibly fit within an entire line will be cut anywhere.
+ if (word_width < wrap_width)
+ s = prev_word_end ? prev_word_end : word_end;
+ break;
+ }
+
+ s = next_s;
+ }
+
+ return s;
+}
+
+ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining) const
+{
+ if (!text_end)
+ text_end = text_begin + strlen(text_begin); // FIXME-OPT: Need to avoid this.
+
+ const float line_height = size;
+ const float scale = size / FontSize;
+
+ ImVec2 text_size = ImVec2(0,0);
+ float line_width = 0.0f;
+
+ const bool word_wrap_enabled = (wrap_width > 0.0f);
+ const char* word_wrap_eol = NULL;
+
+ const char* s = text_begin;
+ while (s < text_end)
+ {
+ if (word_wrap_enabled)
+ {
+ // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
+ if (!word_wrap_eol)
+ {
+ word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
+ if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
+ word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
+ }
+
+ if (s >= word_wrap_eol)
+ {
+ if (text_size.x < line_width)
+ text_size.x = line_width;
+ text_size.y += line_height;
+ line_width = 0.0f;
+ word_wrap_eol = NULL;
+
+ // Wrapping skips upcoming blanks
+ while (s < text_end)
+ {
+ const char c = *s;
+ if (ImCharIsSpace(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
+ }
+ continue;
+ }
+ }
+
+ // Decode and advance source
+ const char* prev_s = s;
+ unsigned int c = (unsigned int)*s;
+ if (c < 0x80)
+ {
+ s += 1;
+ }
+ else
+ {
+ s += ImTextCharFromUtf8(&c, s, text_end);
+ if (c == 0)
+ break;
+ }
+
+ if (c < 32)
+ {
+ if (c == '\n')
+ {
+ text_size.x = ImMax(text_size.x, line_width);
+ text_size.y += line_height;
+ line_width = 0.0f;
+ continue;
+ }
+ if (c == '\r')
+ continue;
+ }
+
+ const float char_width = ((int)c < IndexXAdvance.Size ? IndexXAdvance[(int)c] : FallbackXAdvance) * scale;
+ if (line_width + char_width >= max_width)
+ {
+ s = prev_s;
+ break;
+ }
+
+ line_width += char_width;
+ }
+
+ if (text_size.x < line_width)
+ text_size.x = line_width;
+
+ if (line_width > 0 || text_size.y == 0.0f)
+ text_size.y += line_height;
+
+ if (remaining)
+ *remaining = s;
+
+ return text_size;
+}
+
+void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawList* draw_list, float wrap_width, bool cpu_fine_clip) const
+{
+ if (!text_end)
+ text_end = text_begin + strlen(text_begin);
+
+ // Align to be pixel perfect
+ pos.x = (float)(int)pos.x + DisplayOffset.x;
+ pos.y = (float)(int)pos.y + DisplayOffset.y;
+ float x = pos.x;
+ float y = pos.y;
+ if (y > clip_rect.w)
+ return;
+
+ const float scale = size / FontSize;
+ const float line_height = FontSize * scale;
+ const bool word_wrap_enabled = (wrap_width > 0.0f);
+ const char* word_wrap_eol = NULL;
+
+ ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
+ ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
+ unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
+
+ const char* s = text_begin;
+ if (!word_wrap_enabled && y + line_height < clip_rect.y)
+ while (s < text_end && *s != '\n') // Fast-forward to next line
+ s++;
+ while (s < text_end)
+ {
+ if (word_wrap_enabled)
+ {
+ // Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
+ if (!word_wrap_eol)
+ {
+ word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x));
+ if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
+ word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
+ }
+
+ if (s >= word_wrap_eol)
+ {
+ x = pos.x;
+ y += line_height;
+ word_wrap_eol = NULL;
+
+ // Wrapping skips upcoming blanks
+ while (s < text_end)
+ {
+ const char c = *s;
+ if (ImCharIsSpace(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
+ }
+ continue;
+ }
+ }
+
+ // Decode and advance source
+ unsigned int c = (unsigned int)*s;
+ if (c < 0x80)
+ {
+ s += 1;
+ }
+ else
+ {
+ s += ImTextCharFromUtf8(&c, s, text_end);
+ if (c == 0)
+ break;
+ }
+
+ if (c < 32)
+ {
+ if (c == '\n')
+ {
+ x = pos.x;
+ y += line_height;
+
+ if (y > clip_rect.w)
+ break;
+ if (!word_wrap_enabled && y + line_height < clip_rect.y)
+ while (s < text_end && *s != '\n') // Fast-forward to next line
+ s++;
+ continue;
+ }
+ if (c == '\r')
+ continue;
+ }
+
+ float char_width = 0.0f;
+ if (const Glyph* glyph = FindGlyph((unsigned short)c))
+ {
+ char_width = glyph->XAdvance * scale;
+
+ // Clipping on Y is more likely
+ if (c != ' ' && c != '\t')
+ {
+ // We don't do a second finer clipping test on the Y axis (TODO: do some measurement see if it is worth it, probably not)
+ float y1 = (float)(y + glyph->Y0 * scale);
+ float y2 = (float)(y + glyph->Y1 * scale);
+
+ float x1 = (float)(x + glyph->X0 * scale);
+ float x2 = (float)(x + glyph->X1 * scale);
+ if (x1 <= clip_rect.z && x2 >= clip_rect.x)
+ {
+ // Render a character
+ float u1 = glyph->U0;
+ float v1 = glyph->V0;
+ float u2 = glyph->U1;
+ float v2 = glyph->V1;
+
+ // CPU side clipping used to fit text in their frame when the frame is too small. Only does clipping for axis aligned quads.
+ if (cpu_fine_clip)
+ {
+ if (x1 < clip_rect.x)
+ {
+ u1 = u1 + (1.0f - (x2 - clip_rect.x) / (x2 - x1)) * (u2 - u1);
+ x1 = clip_rect.x;
+ }
+ if (y1 < clip_rect.y)
+ {
+ v1 = v1 + (1.0f - (y2 - clip_rect.y) / (y2 - y1)) * (v2 - v1);
+ y1 = clip_rect.y;
+ }
+ if (x2 > clip_rect.z)
+ {
+ u2 = u1 + ((clip_rect.z - x1) / (x2 - x1)) * (u2 - u1);
+ x2 = clip_rect.z;
+ }
+ if (y2 > clip_rect.w)
+ {
+ v2 = v1 + ((clip_rect.w - y1) / (y2 - y1)) * (v2 - v1);
+ y2 = clip_rect.w;
+ }
+ if (y1 >= y2)
+ {
+ x += char_width;
+ continue;
+ }
+ }
+
+ // NB: we are not calling PrimRectUV() here because non-inlined causes too much overhead in a debug build.
+ // inlined:
+ {
+ idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2);
+ idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3);
+ vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1;
+ vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1;
+ vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2;
+ vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2;
+ vtx_write += 4;
+ vtx_current_idx += 4;
+ idx_write += 6;
+ }
+ }
+ }
+ }
+
+ x += char_width;
+ }
+
+ draw_list->_VtxWritePtr = vtx_write;
+ draw_list->_VtxCurrentIdx = vtx_current_idx;
+ draw_list->_IdxWritePtr = idx_write;
+}
+
+//-----------------------------------------------------------------------------
+// DEFAULT FONT DATA
+//-----------------------------------------------------------------------------
+// Compressed with stb_compress() then converted to a C array.
+// Use the program in extra_fonts/binary_to_compressed_c.cpp to create the array from a TTF file.
+// Decompression from stb.h (public domain) by Sean Barrett https://github.com/nothings/stb/blob/master/stb.h
+//-----------------------------------------------------------------------------
+
+static unsigned int stb_decompress_length(unsigned char *input)
+{
+ return (input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11];
+}
+
+static unsigned char *stb__barrier, *stb__barrier2, *stb__barrier3, *stb__barrier4;
+static unsigned char *stb__dout;
+static void stb__match(unsigned char *data, unsigned int length)
+{
+ // INVERSE of memmove... write each byte before copying the next...
+ IM_ASSERT (stb__dout + length <= stb__barrier);
+ if (stb__dout + length > stb__barrier) { stb__dout += length; return; }
+ if (data < stb__barrier4) { stb__dout = stb__barrier+1; return; }
+ while (length--) *stb__dout++ = *data++;
+}
+
+static void stb__lit(unsigned char *data, unsigned int length)
+{
+ IM_ASSERT (stb__dout + length <= stb__barrier);
+ if (stb__dout + length > stb__barrier) { stb__dout += length; return; }
+ if (data < stb__barrier2) { stb__dout = stb__barrier+1; return; }
+ memcpy(stb__dout, data, length);
+ stb__dout += length;
+}
+
+#define stb__in2(x) ((i[x] << 8) + i[(x)+1])
+#define stb__in3(x) ((i[x] << 16) + stb__in2((x)+1))
+#define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1))
+
+static unsigned char *stb_decompress_token(unsigned char *i)
+{
+ if (*i >= 0x20) { // use fewer if's for cases that expand small
+ if (*i >= 0x80) stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2;
+ else if (*i >= 0x40) stb__match(stb__dout-(stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3;
+ else /* *i >= 0x20 */ stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
+ } else { // more ifs for cases that expand large, since overhead is amortized
+ if (*i >= 0x18) stb__match(stb__dout-(stb__in3(0) - 0x180000 + 1), i[3]+1), i += 4;
+ else if (*i >= 0x10) stb__match(stb__dout-(stb__in3(0) - 0x100000 + 1), stb__in2(3)+1), i += 5;
+ else if (*i >= 0x08) stb__lit(i+2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1);
+ else if (*i == 0x07) stb__lit(i+3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1);
+ else if (*i == 0x06) stb__match(stb__dout-(stb__in3(1)+1), i[4]+1), i += 5;
+ else if (*i == 0x04) stb__match(stb__dout-(stb__in3(1)+1), stb__in2(4)+1), i += 6;
+ }
+ return i;
+}
+
+static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
+{
+ const unsigned long ADLER_MOD = 65521;
+ unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
+ unsigned long blocklen, i;
+
+ blocklen = buflen % 5552;
+ while (buflen) {
+ for (i=0; i + 7 < blocklen; i += 8) {
+ s1 += buffer[0], s2 += s1;
+ s1 += buffer[1], s2 += s1;
+ s1 += buffer[2], s2 += s1;
+ s1 += buffer[3], s2 += s1;
+ s1 += buffer[4], s2 += s1;
+ s1 += buffer[5], s2 += s1;
+ s1 += buffer[6], s2 += s1;
+ s1 += buffer[7], s2 += s1;
+
+ buffer += 8;
+ }
+
+ for (; i < blocklen; ++i)
+ s1 += *buffer++, s2 += s1;
+
+ s1 %= ADLER_MOD, s2 %= ADLER_MOD;
+ buflen -= blocklen;
+ blocklen = 5552;
+ }
+ return (unsigned int)(s2 << 16) + (unsigned int)s1;
+}
+
+static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length)
+{
+ unsigned int olen;
+ if (stb__in4(0) != 0x57bC0000) return 0;
+ if (stb__in4(4) != 0) return 0; // error! stream is > 4GB
+ olen = stb_decompress_length(i);
+ stb__barrier2 = i;
+ stb__barrier3 = i+length;
+ stb__barrier = output + olen;
+ stb__barrier4 = output;
+ i += 16;
+
+ stb__dout = output;
+ for (;;) {
+ unsigned char *old_i = i;
+ i = stb_decompress_token(i);
+ if (i == old_i) {
+ if (*i == 0x05 && i[1] == 0xfa) {
+ IM_ASSERT(stb__dout == output + olen);
+ if (stb__dout != output + olen) return 0;
+ if (stb_adler32(1, output, olen) != (unsigned int) stb__in4(2))
+ return 0;
+ return olen;
+ } else {
+ IM_ASSERT(0); /* NOTREACHED */
+ return 0;
+ }
+ }
+ IM_ASSERT(stb__dout <= output + olen);
+ if (stb__dout > output + olen)
+ return 0;
+ }
+}
+
+//-----------------------------------------------------------------------------
+// ProggyClean.ttf
+// Copyright (c) 2004, 2005 Tristan Grimmer
+// MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
+// Download and more information at http://upperbounds.net
+//-----------------------------------------------------------------------------
+// File: 'ProggyClean.ttf' (41208 bytes)
+// Exported using binary_to_compressed_c.cpp
+//-----------------------------------------------------------------------------
+static const char proggy_clean_ttf_compressed_data_base85[11980+1] =
+ "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/"
+ "2*>]b(MC;$jPfY.;h^`IWM9<Lh2TlS+f-s$o6Q<BWH`YiU.xfLq$N;$0iR/GX:U(jcW2p/W*q?-qmnUCI;jHSAiFWM.R*kU@C=GH?a9wp8f$e.-4^Qg1)Q-GL(lf(r/7GrRgwV%MS=C#"
+ "`8ND>Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1<q-UE31#^-V'8IRUo7Qf./L>=Ke$$'5F%)]0^#0X@U.a<r:QLtFsLcL6##lOj)#.Y5<-R&KgLwqJfLgN&;Q?gI^#DY2uL"
+ "i@^rMl9t=cWq6##weg>$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;-<nLENhvx>-VsM.M0rJfLH2eTM`*oJMHRC`N"
+ "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`&#0j@'DbG&#^$PG.Ll+DNa<XCMKEV*N)LN/N"
+ "*b=%Q6pia-Xg8I$<MR&,VdJe$<(7G;Ckl'&hF;;$<_=X(b.RS%%)###MPBuuE1V:v&cX&#2m#(&cV]`k9OhLMbn%s$G2,B$BfD3X*sp5#l,$R#]x_X1xKX%b5U*[r5iMfUo9U`N99hG)"
+ "tm+/Us9pG)XPu`<0s-)WTt(gCRxIg(%6sfh=ktMKn3j)<6<b5Sk_/0(^]AaN#(p/L>&VZ>1i%h1S9u5o@YaaW$e+b<TWFn/Z:Oh(Cx2$lNEoN^e)#CFY@@I;BOQ*sRwZtZxRcU7uW6CX"
+ "ow0i(?$Q[cjOd[P4d)]>ROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc."
+ "x]Ip.PH^'/aqUO/$1WxLoW0[iLA<QT;5HKD+@qQ'NQ(3_PLhE48R.qAPSwQ0/WK?Z,[x?-J;jQTWA0X@KJ(_Y8N-:/M74:/-ZpKrUss?d#dZq]DAbkU*JqkL+nwX@@47`5>w=4h(9.`G"
+ "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?G<Nald$qs]@]L<J7bR*>gv:[7MI2k).'2($5FNP&EQ(,)"
+ "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#"
+ "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM"
+ "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0<q-]L_?^)1vw'.,MRsqVr.L;aN&#/EgJ)PBc[-f>+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu"
+ "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/"
+ "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[K<L"
+ "%a2E-grWVM3@2=-k22tL]4$##6We'8UJCKE[d_=%wI;'6X-GsLX4j^SgJ$##R*w,vP3wK#iiW&#*h^D&R?jp7+/u&#(AP##XU8c$fSYW-J95_-Dp[g9wcO&#M-h1OcJlc-*vpw0xUX&#"
+ "OQFKNX@QI'IoPp7nb,QU//MQ&ZDkKP)X<WSVL(68uVl&#c'[0#(s1X&xm$Y%B7*K:eDA323j998GXbA#pwMs-jgD$9QISB-A_(aN4xoFM^@C58D0+Q+q3n0#3U1InDjF682-SjMXJK)("
+ "h$hxua_K]ul92%'BOU&#BRRh-slg8KDlr:%L71Ka:.A;%YULjDPmL<LYs8i#XwJOYaKPKc1h:'9Ke,g)b),78=I39B;xiY$bgGw-&.Zi9InXDuYa%G*f2Bq7mn9^#p1vv%#(Wi-;/Z5h"
+ "o;#2:;%d&#x9v68C5g?ntX0X)pT`;%pB3q7mgGN)3%(P8nTd5L7GeA-GL@+%J3u2:(Yf>et`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO"
+ "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J<j$UpK<Q4a1]MupW^-"
+ "sj_$%[HK%'F####QRZJ::Y3EGl4'@%FkiAOg#p[##O`gukTfBHagL<LHw%q&OV0##F=6/:chIm0@eCP8X]:kFI%hl8hgO@RcBhS-@Qb$%+m=hPDLg*%K8ln(wcf3/'DW-$.lR?n[nCH-"
+ "eXOONTJlh:.RYF%3'p6sq:UIMA945&^HFS87@$EP2iG<-lCO$%c`uKGD3rC$x0BL8aFn--`ke%#HMP'vh1/R&O_J9'um,.<tx[@%wsJk&bUT2`0uMv7gg#qp/ij.L56'hl;.s5CUrxjO"
+ "M7-##.l+Au'A&O:-T72L]P`&=;ctp'XScX*rU.>-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%"
+ "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$M<Jnq79VsJW/mWS*PUiq76;]/NM_>hLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]"
+ "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et"
+ "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$<M-SGZ':+Q_k+uvOSLiEo(<aD/K<CCc`'Lx>'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:"
+ "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VB<HFF*qL("
+ "$/V,;(kXZejWO`<[5??ewY(*9=%wDc;,u<'9t3W-(H1th3+G]ucQ]kLs7df($/*JL]@*t7Bu_G3_7mp7<iaQjO@.kLg;x3B0lqp7Hf,^Ze7-##@/c58Mo(3;knp0%)A7?-W+eI'o8)b<"
+ "nKnw'Ho8C=Y>pqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<<aG/1N$#FX$0V5Y6x'aErI3I$7x%E`v<-BY,)%-?Psf*l?%C3.mM(=/M0:JxG'?"
+ "7WhH%o'a<-80g0NBxoO(GH<dM]n.+%q@jH?f.UsJ2Ggs&4<-e47&Kl+f//9@`b+?.TeN_&B8Ss?v;^Trk;f#YvJkl&w$]>-+k?'(<S:68tq*WoDfZu';mM?8X[ma8W%*`-=;D.(nc7/;"
+ ")g:T1=^J$&BRV(-lTmNB6xqB[@0*o.erM*<SWF]u2=st-*(6v>^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M"
+ "D?@f&1'BW-)Ju<L25gl8uhVm1hL$##*8###'A3/LkKW+(^rWX?5W_8g)a(m&K8P>#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX("
+ "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs"
+ "bIu)'Z,*[>br5fX^:FPAWr-m2KgL<LUN098kTF&#lvo58=/vjDo;.;)Ka*hLR#/k=rKbxuV`>Q_nN6'8uTG&#1T5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q"
+ "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aeg<Z'<$#4H)6,>e0jT6'N#(q%.O=?2S]u*(m<-"
+ "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i"
+ "sZ88+dKQ)W6>J%CL<KE>`.d*(B`-n8D9oK<Up]c$X$(,)M8Zt7/[rdkqTgl-0cuGMv'?>-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P&#9r+$%CE=68>K8r0=dSC%%(@p7"
+ ".m7jilQ02'0-VWAg<a/''3u.=4L$Y)6k/K:_[3=&jvL<L0C/2'v:^;-DIBW,B4E68:kZ;%?8(Q8BH=kO65BW?xSG&#@uU,DS*,?.+(o(#1vCS8#CHF>TlGW'b)Tq7VT9q^*^$$.:&N@@"
+ "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*"
+ "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u"
+ "@-W$U%VEQ/,,>>#)D<h#`)h0:<Q6909ua+&VU%n2:cG3FJ-%@Bj-DgLr`Hw&HAKjKjseK</xKT*)B,N9X3]krc12t'pgTV(Lv-tL[xg_%=M_q7a^x?7Ubd>#%8cY#YZ?=,`Wdxu/ae&#"
+ "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$s<Eh#c&)q.MXI%#v9ROa5FZO%sF7q7Nwb&#ptUJ:aqJe$Sl68%.D###EC><?-aF&#RNQv>o8lKN%5/$(vdfq7+ebA#"
+ "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(<c`Q8N)jEIF*+?P2a8g%)$q]o2aH8C&<SibC/q,(e:v;-b#6[$NtDZ84Je2KNvB#$P5?tQ3nt(0"
+ "d=j.LQf./Ll33+(;q3L-w=8dX$#WF&uIJ@-bfI>%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoF&#4DoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8"
+ "6e%B/:=>)N4xeW.*wft-;$'58-ESqr<b?UI(_%@[P46>#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#"
+ "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjL<Lni;''X.`$#8+1GD"
+ ":k$YUWsbn8ogh6rxZ2Z9]%nd+>V#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#<NEdtg(n'=S1A(Q1/I&4([%dM`,Iu'1:_hL>SfD07&6D<fp8dHM7/g+"
+ "tlPN9J*rKaPct&?'uBCem^jn%9_K)<,C5K3s=5g&GmJb*[SYq7K;TRLGCsM-$$;S%:Y@r7AK0pprpL<Lrh,q7e/%KWK:50I^+m'vi`3?%Zp+<-d+$L-Sv:@.o19n$s0&39;kn;S%BSq*"
+ "$3WoJSCLweV[aZ'MQIjO<7;X-X;&+dMLvu#^UsGEC9WEc[X(wI7#2.(F0jV*eZf<-Qv3J-c+J5AlrB#$p(H68LvEA'q3n0#m,[`*8Ft)FcYgEud]CWfm68,(aLA$@EFTgLXoBq/UPlp7"
+ ":d[/;r_ix=:TF`S5H-b<LI&HY(K=h#)]Lk$K14lVfm:x$H<3^Ql<M`$OhapBnkup'D#L$Pb_`N*g]2e;X/Dtg,bsj&K#2[-:iYr'_wgH)NUIR8a1n#S?Yej'h8^58UbZd+^FKD*T@;6A"
+ "7aQC[K8d-(v6GI$x:T<&'Gp5Uf>@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-<aN((^7('#Z0wK#5GX@7"
+ "u][`*S^43933A4rl][`*O4CgLEl]v$1Q3AeF37dbXk,.)vj#x'd`;qgbQR%FW,2(?LO=s%Sc68%NP'##Aotl8x=BE#j1UD([3$M(]UI2LX3RpKN@;/#f'f/&_mt&F)XdF<9t4)Qa.*kT"
+ "LwQ'(TTB9.xH'>#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5<N?)NBS)QN*_I,?&)2'IM%L3I)X((e/dl2&8'<M"
+ ":^#M*Q+[T.Xri.LYS3v%fF`68h;b-X[/En'CR.q7E)p'/kle2HM,u;^%OKC-N+Ll%F9CF<Nf'^#t2L,;27W:0O@6##U6W7:$rJfLWHj$#)woqBefIZ.PK<b*t7ed;p*_m;4ExK#h@&]>"
+ "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%"
+ "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;"
+ "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmL<LD)F^%[tC'8;+9E#C$g%#5Y>q9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:"
+ "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3<n-&%H%b<FDj2M<hH=&Eh<2Len$b*aTX=-8QxN)k11IM1c^j%"
+ "9s<L<NFSo)B?+<-(GxsF,^-Eh@$4dXhN$+#rxK8'je'D7k`e;)2pYwPA'_p9&@^18ml1^[@g4t*[JOa*[=Qp7(qJ_oOL^('7fB&Hq-:sf,sNj8xq^>$U4O]GKx'm9)b@p7YsvK3w^YR-"
+ "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*"
+ "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdF<TddF<9Ah-6&9tWoDlh]&1SpGMq>Ti1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IX<N+T+0MlMBPQ*Vj>SsD<U4JHY"
+ "8kD2)2fU/M#$e.)T4,_=8hLim[&);?UkK'-x?'(:siIfL<$pFM`i<?%W(mGDHM%>iWP,##P`%/L<eXi:@Z9C.7o=@(pXdAO/NLQ8lPl+HPOQa8wD8=^GlPa8TKI1CjhsCTSLJM'/Wl>-"
+ "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n<bhPmUkMw>%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL<LoNs'6,'85`"
+ "0?t/'_U59@]ddF<#LdF<eWdF<OuN/45rY<-L@&#+fm>69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdF<gR@2L=FNU-<b[(9c/ML3m;Z[$oF3g)GAWqpARc=<ROu7cL5l;-[A]%/"
+ "+fsd;l#SafT/f*W]0=O'$(Tb<[)*@e775R-:Yob%g*>l*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj"
+ "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#<IGe;__.thjZl<%w(Wk2xmp4Q@I#I9,DF]u7-P=.-_:YJ]aS@V"
+ "?6*C()dOp7:WL,b&3Rg/.cmM9&r^>$(>.Z-I&J(Q0Hd5Q%7Co-b`-c<N(6r@ip+AurK<m86QIth*#v;-OBqi+L7wDE-Ir8K['m+DDSLwK&/.?-V%U_%3:qKNu$_b*B-kp7NaD'QdWQPK"
+ "Yq[@>P)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8<FfNkgg^oIbah*#8/Qt$F&:K*-(N/'+1vMB,u()-a.VUU*#[e%gAAO(S>WlA2);Sa"
+ ">gXm8YB`1d@K#n]76-a$U,mF<fX]idqd)<3,]J7JmW4`6]uks=4-72L(jEk+:bJ0M^q-8Dm_Z?0olP1C9Sa&H[d&c$ooQUj]Exd*3ZM@-WGW2%s',B-_M%>%Ul:#/'xoFM9QX-$.QN'>"
+ "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B</R90;eZ]%Ncq;-Tl]#F>2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I"
+ "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1<Vc52=u`3^o-n1'g4v58Hj&6_t7$##?M)c<$bgQ_'SY((-xkA#"
+ "Y(,p'H9rIVY-b,'%bCPF7.J<Up^,(dU1VY*5#WkTU>h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-u<Hp,3@e^9UB1J+ak9-TN/mhKPg+AJYd$"
+ "MlvAF_jCK*.O-^(63adMT->W%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)"
+ "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo"
+ "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P"
+ "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*<h`e-GI7)?OK2A.d7_c)?wQ5AS@DL3r#7fSkgl6-++D:'A,uq7SvlB$pcpH'q3n0#_%dY#xCpr-l<F0NR@-##FEV6NTF6##$l84N1w?AO>'IAO"
+ "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#"
+ ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T<XoIB&hx=T1PcDaB&;HH+-AFr?(m9HZV)FKS8JCw;SD=6[^/DZUL`EUDf]GGlG&>"
+ "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#<xU?#@.i?#D:%@#HF7@#LRI@#P_[@#Tkn@#Xw*A#]-=A#a9OA#"
+ "d<F&#*;G##.GY##2Sl##6`($#:l:$#>xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4&#3^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4"
+ "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#"
+ "/QHC#3^ZC#7jmC#;v)D#?,<D#C8ND#GDaD#KPsD#O]/E#g1A5#KA*1#gC17#MGd;#8(02#L-d3#rWM4#Hga1#,<w0#T.j<#O#'2#CYN1#qa^:#_4m3#o@/=#eG8=#t8J5#`+78#4uI-#"
+ "m3B2#SB[8#Q0@8#i[*9#iOn8#1Nm;#^sN9#qh<9#:=x-#P;K2#$%X9#bC+.#Rg;<#mN=.#MTF.#RZO.#2?)4#Y#(/#[)1/#b;L/#dAU/#0Sv;#lY$0#n`-0#sf60#(F24#wrH0#%/e0#"
+ "TmD<#%JSMFove:CTBEXI:<eh2g)B,3h2^G3i;#d3jD>)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP"
+ "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp"
+ "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#";
+
+static const char* GetDefaultCompressedFontDataTTFBase85()
+{
+ return proggy_clean_ttf_compressed_data_base85;
+}
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
new file mode 100644
index 00000000000..1fac4326916
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
@@ -0,0 +1,703 @@
+// ImGui library v1.46 WIP
+// Internals
+// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
+
+// Implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
+// #define IMGUI_DEFINE_MATH_OPERATORS
+
+#pragma once
+
+#ifndef IMGUI_VERSION
+#error Must include imgui.h before imgui_internal.h
+#endif
+
+#include <stdio.h> // FILE*
+#include <math.h> // sqrtf()
+
+#ifdef _MSC_VER
+#pragma warning (push)
+#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
+#endif
+
+//-----------------------------------------------------------------------------
+// Forward Declarations
+//-----------------------------------------------------------------------------
+
+struct ImRect;
+struct ImGuiColMod;
+struct ImGuiStyleMod;
+struct ImGuiGroupData;
+struct ImGuiSimpleColumns;
+struct ImGuiDrawContext;
+struct ImGuiTextEditState;
+struct ImGuiIniData;
+struct ImGuiMouseCursorData;
+struct ImGuiPopupRef;
+struct ImGuiState;
+struct ImGuiWindow;
+
+typedef int ImGuiLayoutType; // enum ImGuiLayoutType_
+typedef int ImGuiButtonFlags; // enum ImGuiButtonFlags_
+typedef int ImGuiTreeNodeFlags; // enum ImGuiTreeNodeFlags_
+
+//-------------------------------------------------------------------------
+// STB libraries
+//-------------------------------------------------------------------------
+
+namespace ImGuiStb
+{
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#endif
+
+#undef STB_TEXTEDIT_STRING
+#undef STB_TEXTEDIT_CHARTYPE
+#define STB_TEXTEDIT_STRING ImGuiTextEditState
+#define STB_TEXTEDIT_CHARTYPE ImWchar
+#define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f
+#include "stb_textedit.h"
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+} // namespace ImGuiStb
+
+//-----------------------------------------------------------------------------
+// Context
+//-----------------------------------------------------------------------------
+
+extern IMGUI_API ImGuiState* GImGui;
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
+#define IM_PI 3.14159265358979323846f
+
+// Helpers: UTF-8 <> wchar
+IMGUI_API int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
+IMGUI_API int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
+IMGUI_API int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_remaining = NULL); // return input UTF-8 bytes count
+IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end); // return number of UTF-8 code-points (NOT bytes count)
+IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string as UTF-8 code-points
+
+// Helpers: Misc
+IMGUI_API ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings
+IMGUI_API void* ImLoadFileToMemory(const char* filename, const char* file_open_mode, int* out_file_size = NULL, int padding_bytes = 0);
+IMGUI_API bool ImIsPointInTriangle(const ImVec2& p, const ImVec2& a, const ImVec2& b, const ImVec2& c);
+static inline bool ImCharIsSpace(int c) { return c == ' ' || c == '\t' || c == 0x3000; }
+static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
+
+// Helpers: String
+IMGUI_API int ImStricmp(const char* str1, const char* str2);
+IMGUI_API int ImStrnicmp(const char* str1, const char* str2, int count);
+IMGUI_API char* ImStrdup(const char* str);
+IMGUI_API int ImStrlenW(const ImWchar* str);
+IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line
+IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end);
+IMGUI_API int ImFormatString(char* buf, int buf_size, const char* fmt, ...) IM_PRINTFARGS(3);
+IMGUI_API int ImFormatStringV(char* buf, int buf_size, const char* fmt, va_list args);
+
+// Helpers: Math
+// We are keeping those not leaking to the user by default, in the case the user has implicit cast operators between ImVec2 and its own types (when IM_VEC2_CLASS_EXTRA is defined)
+#ifdef IMGUI_DEFINE_MATH_OPERATORS
+static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x*rhs, lhs.y*rhs); }
+static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x/rhs, lhs.y/rhs); }
+static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); }
+static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); }
+static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); }
+static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); }
+static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
+static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
+static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
+static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
+static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z, lhs.w-lhs.w); }
+#endif
+
+static inline int ImMin(int lhs, int rhs) { return lhs < rhs ? lhs : rhs; }
+static inline int ImMax(int lhs, int rhs) { return lhs >= rhs ? lhs : rhs; }
+static inline float ImMin(float lhs, float rhs) { return lhs < rhs ? lhs : rhs; }
+static inline float ImMax(float lhs, float rhs) { return lhs >= rhs ? lhs : rhs; }
+static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMin(lhs.x,rhs.x), ImMin(lhs.y,rhs.y)); }
+static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMax(lhs.x,rhs.x), ImMax(lhs.y,rhs.y)); }
+static inline int ImClamp(int v, int mn, int mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
+static inline float ImClamp(float v, float mn, float mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
+static 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)); }
+static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
+static inline float ImLerp(float a, float b, float t) { return a + (b - a) * t; }
+static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t) { return ImVec2(a.x + (b.x - a.x) * t.x, a.y + (b.y - a.y) * t.y); }
+static inline float ImLengthSqr(const ImVec2& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y; }
+static inline float ImLengthSqr(const ImVec4& lhs) { return lhs.x*lhs.x + lhs.y*lhs.y + lhs.z*lhs.z + lhs.w*lhs.w; }
+static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = lhs.x*lhs.x + lhs.y*lhs.y; if (d > 0.0f) return 1.0f / sqrtf(d); return fail_value; }
+static inline ImVec2 ImRound(ImVec2 v) { return ImVec2((float)(int)v.x, (float)(int)v.y); }
+
+//-----------------------------------------------------------------------------
+// Types
+//-----------------------------------------------------------------------------
+
+enum ImGuiButtonFlags_
+{
+ ImGuiButtonFlags_Repeat = 1 << 0,
+ ImGuiButtonFlags_PressedOnClick = 1 << 1, // return pressed on click only (default requires click+release)
+ ImGuiButtonFlags_PressedOnRelease = 1 << 2, // return pressed on release only (default requires click+release)
+ ImGuiButtonFlags_FlattenChilds = 1 << 3,
+ ImGuiButtonFlags_DontClosePopups = 1 << 4,
+ ImGuiButtonFlags_Disabled = 1 << 5,
+ ImGuiButtonFlags_AlignTextBaseLine = 1 << 6
+};
+
+enum ImGuiTreeNodeFlags_
+{
+ ImGuiTreeNodeFlags_DefaultOpen = 1 << 0,
+ ImGuiTreeNodeFlags_NoAutoExpandOnLog = 1 << 1
+};
+
+enum ImGuiSelectableFlagsPrivate_
+{
+ // NB: need to be in sync with last value of ImGuiSelectableFlags_
+ ImGuiSelectableFlags_Menu = 1 << 2,
+ ImGuiSelectableFlags_MenuItem = 1 << 3,
+ ImGuiSelectableFlags_Disabled = 1 << 4,
+ ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 5
+};
+
+// FIXME: this is in development, not exposed/functional as a generic feature yet.
+enum ImGuiLayoutType_
+{
+ ImGuiLayoutType_Vertical,
+ ImGuiLayoutType_Horizontal
+};
+
+enum ImGuiPlotType
+{
+ ImGuiPlotType_Lines,
+ ImGuiPlotType_Histogram
+};
+
+enum ImGuiDataType
+{
+ ImGuiDataType_Int,
+ ImGuiDataType_Float
+};
+
+// 2D axis aligned bounding-box
+// NB: we can't rely on ImVec2 math operators being available here
+struct IMGUI_API ImRect
+{
+ ImVec2 Min; // Upper-left
+ ImVec2 Max; // Lower-right
+
+ ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {}
+ ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
+ ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
+ ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}
+
+ ImVec2 GetCenter() const { return ImVec2((Min.x+Max.x)*0.5f, (Min.y+Max.y)*0.5f); }
+ ImVec2 GetSize() const { return ImVec2(Max.x-Min.x, Max.y-Min.y); }
+ float GetWidth() const { return Max.x-Min.x; }
+ float GetHeight() const { return Max.y-Min.y; }
+ ImVec2 GetTL() const { return Min; }
+ ImVec2 GetTR() const { return ImVec2(Max.x, Min.y); }
+ ImVec2 GetBL() const { return ImVec2(Min.x, Max.y); }
+ ImVec2 GetBR() const { return Max; }
+ bool Contains(const ImVec2& p) const { return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }
+ bool Contains(const ImRect& r) const { return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x < Max.x && r.Max.y < Max.y; }
+ bool Overlaps(const ImRect& r) const { return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }
+ void Add(const ImVec2& rhs) { if (Min.x > rhs.x) Min.x = rhs.x; if (Min.y > rhs.y) Min.y = rhs.y; if (Max.x < rhs.x) Max.x = rhs.x; if (Max.y < rhs.y) Max.y = rhs.y; }
+ void Add(const ImRect& rhs) { if (Min.x > rhs.Min.x) Min.x = rhs.Min.x; if (Min.y > rhs.Min.y) Min.y = rhs.Min.y; if (Max.x < rhs.Max.x) Max.x = rhs.Max.x; if (Max.y < rhs.Max.y) Max.y = rhs.Max.y; }
+ void Expand(const float amount) { Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }
+ void Expand(const ImVec2& amount) { Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }
+ void Reduce(const ImVec2& amount) { Min.x += amount.x; Min.y += amount.y; Max.x -= amount.x; Max.y -= amount.y; }
+ void Clip(const ImRect& clip) { if (Min.x < clip.Min.x) Min.x = clip.Min.x; if (Min.y < clip.Min.y) Min.y = clip.Min.y; if (Max.x > clip.Max.x) Max.x = clip.Max.x; if (Max.y > clip.Max.y) Max.y = clip.Max.y; }
+ void Round() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; }
+ ImVec2 GetClosestPoint(ImVec2 p, bool on_edge) const
+ {
+ if (!on_edge && Contains(p))
+ return p;
+ if (p.x > Max.x) p.x = Max.x;
+ else if (p.x < Min.x) p.x = Min.x;
+ if (p.y > Max.y) p.y = Max.y;
+ else if (p.y < Min.y) p.y = Min.y;
+ return p;
+ }
+};
+
+// Stacked color modifier, backup of modified data so we can restore it
+struct ImGuiColMod
+{
+ ImGuiCol Col;
+ ImVec4 PreviousValue;
+};
+
+// Stacked style modifier, backup of modified data so we can restore it
+struct ImGuiStyleMod
+{
+ ImGuiStyleVar Var;
+ ImVec2 PreviousValue;
+};
+
+// Stacked data for BeginGroup()/EndGroup()
+struct ImGuiGroupData
+{
+ ImVec2 BackupCursorPos;
+ ImVec2 BackupCursorMaxPos;
+ float BackupColumnsStartX;
+ float BackupCurrentLineHeight;
+ float BackupCurrentLineTextBaseOffset;
+ float BackupLogLinePosY;
+ bool AdvanceCursor;
+};
+
+// Simple column measurement currently used for MenuItem() only. This is very short-sighted for now and not a generic helper.
+struct IMGUI_API ImGuiSimpleColumns
+{
+ int Count;
+ float Spacing;
+ float Width, NextWidth;
+ float Pos[8], NextWidths[8];
+
+ ImGuiSimpleColumns();
+ void Update(int count, float spacing, bool clear);
+ float DeclColumns(float w0, float w1, float w2);
+ float CalcExtraSpace(float avail_w);
+};
+
+// Internal state of the currently focused/edited text input box
+struct IMGUI_API ImGuiTextEditState
+{
+ ImGuiID Id; // widget id owning the text state
+ ImVector<ImWchar> Text; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
+ ImVector<char> InitialText; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
+ ImVector<char> TempTextBuffer;
+ int CurLenA, CurLenW; // we need to maintain our buffer length in both UTF-8 and wchar format.
+ int BufSizeA; // end-user buffer size
+ float ScrollX;
+ ImGuiStb::STB_TexteditState StbState;
+ float CursorAnim;
+ bool CursorFollow;
+ ImVec2 InputCursorScreenPos; // Cursor position in screen space to be used by IME callback.
+ bool SelectedAllMouseLock;
+
+ ImGuiTextEditState() { memset(this, 0, sizeof(*this)); }
+ void CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking
+ bool HasSelection() const { return StbState.select_start != StbState.select_end; }
+ void ClearSelection() { StbState.select_start = StbState.select_end = StbState.cursor; }
+ void SelectAll() { StbState.select_start = 0; StbState.select_end = CurLenW; StbState.cursor = StbState.select_end; StbState.has_preferred_x = false; }
+ void OnKeyPressed(int key);
+};
+
+// Data saved in imgui.ini file
+struct ImGuiIniData
+{
+ char* Name;
+ ImGuiID ID;
+ ImVec2 Pos;
+ ImVec2 Size;
+ bool Collapsed;
+};
+
+// Mouse cursor data (used when io.MouseDrawCursor is set)
+struct ImGuiMouseCursorData
+{
+ ImGuiMouseCursor Type;
+ ImVec2 HotOffset;
+ ImVec2 Size;
+ ImVec2 TexUvMin[2];
+ ImVec2 TexUvMax[2];
+};
+
+// Storage for current popup stack
+struct ImGuiPopupRef
+{
+ ImGuiID PopupID; // Set on OpenPopup()
+ ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
+ ImGuiWindow* ParentWindow; // Set on OpenPopup()
+ ImGuiID ParentMenuSet; // Set on OpenPopup()
+ ImVec2 MousePosOnOpen; // Copy of mouse position at the time of opening popup
+
+ ImGuiPopupRef(ImGuiID id, ImGuiWindow* parent_window, ImGuiID parent_menu_set, const ImVec2& mouse_pos) { PopupID = id; Window = NULL; ParentWindow = parent_window; ParentMenuSet = parent_menu_set; MousePosOnOpen = mouse_pos; }
+};
+
+// Main state for ImGui
+struct ImGuiState
+{
+ bool Initialized;
+ ImGuiIO IO;
+ ImGuiStyle Style;
+ ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
+ float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize()
+ float FontBaseSize; // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Size of characters.
+ ImVec2 FontTexUvWhitePixel; // (Shortcut) == Font->TexUvForWhite
+
+ float Time;
+ int FrameCount;
+ int FrameCountEnded;
+ int FrameCountRendered;
+ ImVector<ImGuiWindow*> Windows;
+ ImVector<ImGuiWindow*> WindowsSortBuffer;
+ ImGuiWindow* CurrentWindow; // Being drawn into
+ ImVector<ImGuiWindow*> CurrentWindowStack;
+ ImGuiWindow* FocusedWindow; // Will catch keyboard inputs
+ ImGuiWindow* HoveredWindow; // Will catch mouse inputs
+ ImGuiWindow* HoveredRootWindow; // Will catch mouse inputs (for focus/move only)
+ ImGuiID HoveredId; // Hovered widget
+ bool HoveredIdAllowHoveringOthers;
+ ImGuiID HoveredIdPreviousFrame;
+ ImGuiID ActiveId; // Active widget
+ ImGuiID ActiveIdPreviousFrame;
+ bool ActiveIdIsAlive;
+ bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
+ bool ActiveIdAllowHoveringOthers; // Set only by active widget
+ ImGuiWindow* ActiveIdWindow;
+ ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window. Pointer is only valid if ActiveID is the "#MOVE" identifier of a window.
+ ImVector<ImGuiIniData> Settings; // .ini Settings
+ float SettingsDirtyTimer; // Save .ini settinngs on disk when time reaches zero
+ int DisableHideTextAfterDoubleHash;
+ ImVector<ImGuiColMod> ColorModifiers; // Stack for PushStyleColor()/PopStyleColor()
+ ImVector<ImGuiStyleMod> StyleModifiers; // Stack for PushStyleVar()/PopStyleVar()
+ ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont()
+ ImVector<ImGuiPopupRef> OpenedPopupStack; // Which popups are open (persistent)
+ ImVector<ImGuiPopupRef> CurrentPopupStack; // Which level of BeginPopup() we are in (reset every frame)
+
+ // Storage for SetNexWindow** and SetNextTreeNode*** functions
+ ImVec2 SetNextWindowPosVal;
+ ImVec2 SetNextWindowSizeVal;
+ ImVec2 SetNextWindowContentSizeVal;
+ bool SetNextWindowCollapsedVal;
+ ImGuiSetCond SetNextWindowPosCond;
+ ImGuiSetCond SetNextWindowSizeCond;
+ ImGuiSetCond SetNextWindowContentSizeCond;
+ ImGuiSetCond SetNextWindowCollapsedCond;
+ bool SetNextWindowFocus;
+ bool SetNextTreeNodeOpenedVal;
+ ImGuiSetCond SetNextTreeNodeOpenedCond;
+
+ // Render
+ ImDrawData RenderDrawData; // Main ImDrawData instance to pass render information to the user
+ ImVector<ImDrawList*> RenderDrawLists[3];
+ float ModalWindowDarkeningRatio;
+ ImDrawList OverlayDrawList; // Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays
+ ImGuiMouseCursor MouseCursor;
+ ImGuiMouseCursorData MouseCursorData[ImGuiMouseCursor_Count_];
+
+ // Widget state
+ ImGuiTextEditState InputTextState;
+ ImGuiID ScalarAsInputTextId; // Temporary text input when CTRL+clicking on a slider, etc.
+ ImGuiStorage ColorEditModeStorage; // Store user selection of color edit mode
+ ImVec2 ActiveClickDeltaToCenter;
+ float DragCurrentValue; // Currently dragged value, always float, not rounded by end-user precision settings
+ ImVec2 DragLastMouseDelta;
+ float DragSpeedDefaultRatio; // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
+ float DragSpeedScaleSlow;
+ float DragSpeedScaleFast;
+ ImVec2 ScrollbarClickDeltaToGrabCenter; // Distance between mouse and center of grab box, normalized in parent space. Use storage?
+ char Tooltip[1024];
+ char* PrivateClipboard; // If no custom clipboard handler is defined
+
+ // Logging
+ bool LogEnabled;
+ FILE* LogFile; // If != NULL log to stdout/ file
+ ImGuiTextBuffer* LogClipboard; // Else log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
+ int LogStartDepth;
+ int LogAutoExpandMaxDepth;
+
+ // Misc
+ float FramerateSecPerFrame[120]; // calculate estimate of framerate for user
+ int FramerateSecPerFrameIdx;
+ float FramerateSecPerFrameAccum;
+ bool CaptureMouseNextFrame; // explicit capture via CaptureInputs() sets those flags
+ bool CaptureKeyboardNextFrame;
+ char TempBuffer[1024*3+1]; // temporary text buffer
+
+ ImGuiState()
+ {
+ Initialized = false;
+ Font = NULL;
+ FontSize = FontBaseSize = 0.0f;
+ FontTexUvWhitePixel = ImVec2(0.0f, 0.0f);
+
+ Time = 0.0f;
+ FrameCount = 0;
+ FrameCountEnded = FrameCountRendered = -1;
+ CurrentWindow = NULL;
+ FocusedWindow = NULL;
+ HoveredWindow = NULL;
+ HoveredRootWindow = NULL;
+ HoveredId = 0;
+ HoveredIdAllowHoveringOthers = false;
+ HoveredIdPreviousFrame = 0;
+ ActiveId = 0;
+ ActiveIdPreviousFrame = 0;
+ ActiveIdIsAlive = false;
+ ActiveIdIsJustActivated = false;
+ ActiveIdAllowHoveringOthers = false;
+ ActiveIdWindow = NULL;
+ MovedWindow = NULL;
+ SettingsDirtyTimer = 0.0f;
+ DisableHideTextAfterDoubleHash = 0;
+
+ SetNextWindowPosVal = ImVec2(0.0f, 0.0f);
+ SetNextWindowSizeVal = ImVec2(0.0f, 0.0f);
+ SetNextWindowCollapsedVal = false;
+ SetNextWindowPosCond = 0;
+ SetNextWindowSizeCond = 0;
+ SetNextWindowCollapsedCond = 0;
+ SetNextWindowFocus = false;
+ SetNextTreeNodeOpenedVal = false;
+ SetNextTreeNodeOpenedCond = 0;
+
+ ScalarAsInputTextId = 0;
+ ActiveClickDeltaToCenter = ImVec2(0.0f, 0.0f);
+ DragCurrentValue = 0.0f;
+ DragLastMouseDelta = ImVec2(0.0f, 0.0f);
+ DragSpeedDefaultRatio = 0.01f;
+ DragSpeedScaleSlow = 0.01f;
+ DragSpeedScaleFast = 10.0f;
+ ScrollbarClickDeltaToGrabCenter = ImVec2(0.0f, 0.0f);
+ memset(Tooltip, 0, sizeof(Tooltip));
+ PrivateClipboard = NULL;
+
+ ModalWindowDarkeningRatio = 0.0f;
+ OverlayDrawList._OwnerName = "##Overlay"; // Give it a name for debugging
+ MouseCursor = ImGuiMouseCursor_Arrow;
+
+ LogEnabled = false;
+ LogFile = NULL;
+ LogClipboard = NULL;
+ LogStartDepth = 0;
+ LogAutoExpandMaxDepth = 2;
+
+ memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
+ FramerateSecPerFrameIdx = 0;
+ FramerateSecPerFrameAccum = 0.0f;
+ CaptureMouseNextFrame = CaptureKeyboardNextFrame = false;
+ }
+};
+
+// Transient per-window data, reset at the beginning of the frame
+// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiDrawContext is quite tenuous and could be reconsidered.
+struct IMGUI_API ImGuiDrawContext
+{
+ ImVec2 CursorPos;
+ ImVec2 CursorPosPrevLine;
+ ImVec2 CursorStartPos;
+ ImVec2 CursorMaxPos; // Implicitly calculate the size of our contents, always extending. Saved into window->SizeContents at the end of the frame
+ float CurrentLineHeight;
+ float CurrentLineTextBaseOffset;
+ float PrevLineHeight;
+ float PrevLineTextBaseOffset;
+ float LogLinePosY;
+ int TreeDepth;
+ ImGuiID LastItemID;
+ ImRect LastItemRect;
+ bool LastItemHoveredAndUsable;
+ bool LastItemHoveredRect;
+ bool MenuBarAppending;
+ float MenuBarOffsetX;
+ ImVector<ImGuiWindow*> ChildWindows;
+ ImGuiStorage* StateStorage;
+ ImGuiLayoutType LayoutType;
+
+ // We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
+ float ItemWidth; // == ItemWidthStack.back(). 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
+ float TextWrapPos; // == TextWrapPosStack.back() [empty == -1.0f]
+ bool AllowKeyboardFocus; // == AllowKeyboardFocusStack.back() [empty == true]
+ bool ButtonRepeat; // == ButtonRepeatStack.back() [empty == false]
+ ImVector<float> ItemWidthStack;
+ ImVector<float> TextWrapPosStack;
+ ImVector<bool> AllowKeyboardFocusStack;
+ ImVector<bool> ButtonRepeatStack;
+ ImVector<ImGuiGroupData>GroupStack;
+ ImGuiColorEditMode ColorEditMode;
+ int StackSizesBackup[6]; // Store size of various stacks for asserting
+
+ float ColumnsStartX; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
+ 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.
+ int ColumnsCurrent;
+ int ColumnsCount;
+ ImVec2 ColumnsStartPos;
+ float ColumnsCellMinY;
+ float ColumnsCellMaxY;
+ bool ColumnsShowBorders;
+ ImGuiID ColumnsSetID;
+ ImVector<float> ColumnsOffsetsT; // Columns offset normalized 0.0 (far left) -> 1.0 (far right)
+
+ ImGuiDrawContext()
+ {
+ CursorPos = CursorPosPrevLine = CursorStartPos = CursorMaxPos = ImVec2(0.0f, 0.0f);
+ CurrentLineHeight = PrevLineHeight = 0.0f;
+ CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
+ LogLinePosY = -1.0f;
+ TreeDepth = 0;
+ LastItemID = 0;
+ LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f);
+ LastItemHoveredAndUsable = LastItemHoveredRect = false;
+ MenuBarAppending = false;
+ MenuBarOffsetX = 0.0f;
+ StateStorage = NULL;
+ LayoutType = ImGuiLayoutType_Vertical;
+ ItemWidth = 0.0f;
+ ButtonRepeat = false;
+ AllowKeyboardFocus = true;
+ TextWrapPos = -1.0f;
+ ColorEditMode = ImGuiColorEditMode_RGB;
+ memset(StackSizesBackup, 0, sizeof(StackSizesBackup));
+
+ ColumnsStartX = 0.0f;
+ ColumnsOffsetX = 0.0f;
+ ColumnsCurrent = 0;
+ ColumnsCount = 1;
+ ColumnsStartPos = ImVec2(0.0f, 0.0f);
+ ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
+ ColumnsShowBorders = true;
+ ColumnsSetID = 0;
+ }
+};
+
+// Windows data
+struct IMGUI_API ImGuiWindow
+{
+ char* Name;
+ ImGuiID ID;
+ ImGuiWindowFlags Flags;
+ ImVec2 PosFloat;
+ ImVec2 Pos; // Position rounded-up to nearest pixel
+ ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
+ ImVec2 SizeFull; // Size when non collapsed
+ ImVec2 SizeContents; // Size of contents (== extents reach of the drawing cursor) from previous frame
+ ImVec2 SizeContentsExplicit; // Size of contents explicitly set by the user via SetNextWindowContentSize()
+ ImVec2 WindowPadding; // Window padding at the time of begin. We need to lock it, in particular manipulation of the ShowBorder would have an effect
+ ImGuiID MoveID; // == window->GetID("#MOVE")
+ ImVec2 Scroll;
+ ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
+ ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
+ bool ScrollbarX, ScrollbarY;
+ ImVec2 ScrollbarSizes; //
+ bool Active; // Set to true on Begin()
+ bool WasActive;
+ bool Accessed; // Set to true when any widget access the current window
+ bool Collapsed; // Set when collapsing window to become only title-bar
+ bool SkipItems; // == Visible && !Collapsed
+ int BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
+ ImGuiID PopupID; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
+ int AutoFitFramesX, AutoFitFramesY;
+ bool AutoFitOnlyGrows;
+ int AutoPosLastDirection;
+ int HiddenFrames;
+ int SetWindowPosAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowPos() call will succeed with this particular flag.
+ int SetWindowSizeAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowSize() call will succeed with this particular flag.
+ int SetWindowCollapsedAllowFlags; // bit ImGuiSetCond_*** specify if SetWindowCollapsed() call will succeed with this particular flag.
+ bool SetWindowPosCenterWanted;
+
+ ImGuiDrawContext DC; // Temporary per-window data, reset at the beginning of the frame
+ ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack
+ ImRect ClipRect; // = DrawList->clip_rect_stack.back(). Scissoring / clipping rectangle. x1, y1, x2, y2.
+ ImRect ClippedWindowRect; // = ClipRect just after setup in Begin()
+ int LastFrameDrawn;
+ float ItemWidthDefault;
+ ImGuiSimpleColumns MenuColumns; // Simplified columns storage for menu items
+ ImGuiStorage StateStorage;
+ float FontWindowScale; // Scale multiplier per-window
+ ImDrawList* DrawList;
+ ImGuiWindow* RootWindow;
+ ImGuiWindow* RootNonPopupWindow;
+
+ // Focus
+ int FocusIdxAllCounter; // Start at -1 and increase as assigned via FocusItemRegister()
+ int FocusIdxTabCounter; // (same, but only count widgets which you can Tab through)
+ int FocusIdxAllRequestCurrent; // Item being requested for focus
+ int FocusIdxTabRequestCurrent; // Tab-able item being requested for focus
+ int FocusIdxAllRequestNext; // Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
+ int FocusIdxTabRequestNext; // "
+
+public:
+ ImGuiWindow(const char* name);
+ ~ImGuiWindow();
+
+ ImGuiID GetID(const char* str, const char* str_end = NULL);
+ ImGuiID GetID(const void* ptr);
+
+ ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x+Size.x, Pos.y+Size.y); }
+ float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale; }
+ float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; }
+ ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
+ float MenuBarHeight() const { return (Flags & ImGuiWindowFlags_MenuBar) ? CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f : 0.0f; }
+ ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
+ 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); }
+ ImU32 Color(const ImVec4& col) const { ImVec4 c = col; c.w *= GImGui->Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
+};
+
+//-----------------------------------------------------------------------------
+// Internal API
+// No guarantee of forward compatibility here.
+//-----------------------------------------------------------------------------
+
+namespace ImGui
+{
+ // We should always have a CurrentWindow in the stack (there is an implicit "Debug" window)
+ // If this ever crash because g.CurrentWindow is NULL it means that either
+ // - ImGui::NewFrame() has never been called, which is illegal.
+ // - You are calling ImGui functions after ImGui::Render() and before the next ImGui::NewFrame(), which is also illegal.
+ inline ImGuiWindow* GetCurrentWindowRead() { ImGuiState& g = *GImGui; return g.CurrentWindow; }
+ inline ImGuiWindow* GetCurrentWindow() { ImGuiState& g = *GImGui; g.CurrentWindow->Accessed = true; return g.CurrentWindow; }
+ IMGUI_API ImGuiWindow* GetParentWindow();
+ IMGUI_API void FocusWindow(ImGuiWindow* window);
+
+ IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
+ IMGUI_API void SetHoveredID(ImGuiID id);
+ IMGUI_API void KeepAliveID(ImGuiID id);
+
+ IMGUI_API void EndFrame(); // This automatically called by Render()
+
+ IMGUI_API void ItemSize(const ImVec2& size, float text_offset_y = 0.0f);
+ IMGUI_API void ItemSize(const ImRect& bb, float text_offset_y = 0.0f);
+ IMGUI_API bool ItemAdd(const ImRect& bb, const ImGuiID* id);
+ IMGUI_API bool IsClippedEx(const ImRect& bb, const ImGuiID* id, bool clip_even_when_logged);
+ IMGUI_API bool IsHovered(const ImRect& bb, ImGuiID id, bool flatten_childs = false);
+ IMGUI_API bool FocusableItemRegister(ImGuiWindow* window, bool is_active, bool tab_stop = true); // Return true if focus is requested
+ IMGUI_API void FocusableItemUnregister(ImGuiWindow* window);
+ IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y);
+ IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
+
+ // NB: All position are in absolute pixels coordinates (not window coordinates)
+ IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
+ IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
+ IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, ImGuiAlign align = ImGuiAlign_Default, const ImVec2* clip_min = NULL, const ImVec2* clip_max = NULL);
+ IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
+ IMGUI_API void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale = 1.0f, bool shadow = false);
+ IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col);
+
+ IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, ImGuiButtonFlags flags = 0);
+ IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0,0), ImGuiButtonFlags flags = 0);
+
+ IMGUI_API bool SliderBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_min, float v_max, float power, int decimal_precision, bool horizontal);
+ IMGUI_API bool SliderFloatN(const char* label, float* v, int components, float v_min, float v_max, const char* display_format, float power);
+ IMGUI_API bool SliderIntN(const char* label, int* v, int components, int v_min, int v_max, const char* display_format);
+
+ IMGUI_API bool DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_speed, float v_min, float v_max, int decimal_precision, float power);
+ IMGUI_API bool DragFloatN(const char* label, float* v, int components, float v_speed, float v_min, float v_max, const char* display_format, float power);
+ IMGUI_API bool DragIntN(const char* label, int* v, int components, float v_speed, int v_min, int v_max, const char* display_format);
+
+ IMGUI_API bool InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
+ IMGUI_API bool InputFloatN(const char* label, float* v, int components, int decimal_precision, ImGuiInputTextFlags extra_flags);
+ IMGUI_API bool InputIntN(const char* label, int* v, int components, ImGuiInputTextFlags extra_flags);
+ IMGUI_API bool InputScalarEx(const char* label, ImGuiDataType data_type, void* data_ptr, void* step_ptr, void* step_fast_ptr, const char* scalar_format, ImGuiInputTextFlags extra_flags);
+ IMGUI_API bool InputScalarAsWidgetReplacement(const ImRect& aabb, const char* label, ImGuiDataType data_type, void* data_ptr, ImGuiID id, int decimal_precision);
+
+ IMGUI_API bool TreeNodeBehaviorIsOpened(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
+
+ IMGUI_API void PlotEx(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);
+
+ IMGUI_API int ParseFormatPrecision(const char* fmt, int default_value);
+ IMGUI_API float RoundScalar(float value, int decimal_precision);
+
+} // namespace ImGuiP
+
+#ifdef _MSC_VER
+#pragma warning (pop)
+#endif
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp
new file mode 100644
index 00000000000..669137c27f3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp
@@ -0,0 +1,232 @@
+// Creating a node graph editor for ImGui
+// Quick demo, not production code!
+// See https://github.com/ocornut/imgui/issues/306
+// v0.01
+// Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif
+
+#include <math.h>
+#include "imgui.h"
+
+// NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h"
+// Here we only declare simple +/- operators so others don't leak into the demo code.
+static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); }
+static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); }
+
+struct Node
+{
+ int ID;
+ char Name[32];
+ ImVec2 Pos, Size;
+ float Value;
+ int InputsCount, OutputsCount;
+
+ Node(int id, const char* name, const ImVec2& pos, float value, int inputs_count, int outputs_count) { ID = id; strncpy(Name, name, 31); Name[31] = 0; Pos = pos; Value = value; InputsCount = inputs_count; OutputsCount = outputs_count; }
+
+ ImVec2 GetInputSlotPos(int slot_no) const { return ImVec2(Pos.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)InputsCount+1)); }
+ ImVec2 GetOutputSlotPos(int slot_no) const { return ImVec2(Pos.x + Size.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)OutputsCount+1)); }
+};
+
+struct NodeLink
+{
+ int InputIdx, InputSlot, OutputIdx, OutputSlot;
+
+ NodeLink(int input_idx, int input_slot, int output_idx, int output_slot) { InputIdx = input_idx; InputSlot = input_slot; OutputIdx = output_idx; OutputSlot = output_slot; }
+};
+
+// Really dumb data structure provided for the example.
+// Note that we storing links are INDICES (not ID) to make example code shorter, obviously a bad idea for any general purpose code.
+void ShowExampleAppCustomNodeGraph(bool* opened)
+{
+ ImGui::SetNextWindowSize(ImVec2(700,600), ImGuiSetCond_FirstUseEver);
+ if (!ImGui::Begin("Example: Custom Node Graph", opened))
+ {
+ ImGui::End();
+ return;
+ }
+
+ static ImVector<Node> nodes;
+ static ImVector<NodeLink> links;
+ static bool inited = false;
+ static ImVec2 scrolling = ImVec2(0.0f, 0.0f);
+ static int node_selected = -1;
+ if (!inited)
+ {
+ nodes.push_back(Node(0, "MainTex", ImVec2(40,50), 0.5f, 1, 1));
+ nodes.push_back(Node(1, "BumpMap", ImVec2(40,150), 0.42f, 1, 1));
+ nodes.push_back(Node(2, "Combine", ImVec2(270,80), 1.0f, 2, 2));
+ links.push_back(NodeLink(0, 0, 2, 0));
+ links.push_back(NodeLink(1, 0, 2, 1));
+ inited = true;
+ }
+
+ // Draw a list of nodes on the left side
+ bool open_context_menu = false;
+ int node_hovered_in_list = -1;
+ int node_hovered_in_scene = -1;
+ ImGui::BeginChild("node_list", ImVec2(100,0));
+ ImGui::Text("Nodes");
+ ImGui::Separator();
+ for (int node_idx = 0; node_idx < nodes.Size; node_idx++)
+ {
+ Node* node = &nodes[node_idx];
+ ImGui::PushID(node->ID);
+ if (ImGui::Selectable(node->Name, node->ID == node_selected))
+ node_selected = node->ID;
+ if (ImGui::IsItemHovered())
+ {
+ node_hovered_in_list = node->ID;
+ open_context_menu |= ImGui::IsMouseClicked(1);
+ }
+ ImGui::PopID();
+ }
+ ImGui::EndChild();
+
+ ImGui::SameLine();
+ ImGui::BeginGroup();
+
+ const float NODE_SLOT_RADIUS = 4.0f;
+ const ImVec2 NODE_WINDOW_PADDING(8.0f, 8.0f);
+
+ // Create our child canvas
+ ImGui::Text("Hold middle mouse button to scroll (%.2f,%.2f)", scrolling.x, scrolling.y);
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(1,1));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0,0));
+ ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImColor(40,40,40,200));
+ ImGui::BeginChild("scrolling_region", ImVec2(0,0), true, ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoMove);
+ ImGui::PushItemWidth(120.0f);
+
+ ImDrawList* draw_list = ImGui::GetWindowDrawList();
+ draw_list->ChannelsSplit(2);
+ ImVec2 offset = ImGui::GetCursorScreenPos() - scrolling;
+
+ // Display links
+ draw_list->ChannelsSetCurrent(0); // Background
+ for (int link_idx = 0; link_idx < links.Size; link_idx++)
+ {
+ NodeLink* link = &links[link_idx];
+ Node* node_inp = &nodes[link->InputIdx];
+ Node* node_out = &nodes[link->OutputIdx];
+
+#if 1
+ // Hermite spline
+ // TODO: move to ImDrawList path API
+ ImVec2 p1 = offset+node_inp->GetOutputSlotPos(link->InputSlot);
+ ImVec2 t1 = ImVec2(+80.0f, 0.0f);
+ ImVec2 p2 = offset+node_out->GetInputSlotPos(link->OutputSlot);
+ ImVec2 t2 = ImVec2(+80.0f, 0.0f);
+ const int STEPS = 12;
+ for (int step = 0; step <= STEPS; step++)
+ {
+ float t = (float)step / (float)STEPS;
+ float h1 = +2*t*t*t - 3*t*t + 1.0f;
+ float h2 = -2*t*t*t + 3*t*t;
+ float h3 = t*t*t - 2*t*t + t;
+ float h4 = t*t*t - t*t;
+ draw_list->PathLineTo(ImVec2(h1*p1.x + h2*p2.x + h3*t1.x + h4*t2.x, h1*p1.y + h2*p2.y + h3*t1.y + h4*t2.y));
+ }
+ draw_list->PathStroke(ImColor(200,200,100), false, 3.0f);
+#else
+ draw_list->AddLine(offset+node_inp->GetOutputSlotPos(link->InputSlot), offset+node_out->GetInputSlotPos(link->OutputSlot), ImColor(200,200,100), 3.0f);
+#endif
+ }
+
+ // Display nodes
+ for (int node_idx = 0; node_idx < nodes.Size; node_idx++)
+ {
+ Node* node = &nodes[node_idx];
+ ImGui::PushID(node->ID);
+ ImVec2 node_rect_min = offset + node->Pos;
+
+ // Display node contents first
+ draw_list->ChannelsSetCurrent(1); // Foreground
+ bool old_any_active = ImGui::IsAnyItemActive();
+ ImGui::SetCursorScreenPos(node_rect_min + NODE_WINDOW_PADDING);
+ ImGui::BeginGroup(); // Lock horizontal position
+ ImGui::Text("%s", node->Name);
+ ImGui::SliderFloat("##value", &node->Value, 0.0f, 1.0f, "Alpha %.2f");
+ float dummy_color[3] = { node->Pos.x / ImGui::GetWindowWidth(), node->Pos.y / ImGui::GetWindowHeight(), fmodf((float)node->ID * 0.5f, 1.0f) };
+ ImGui::ColorEdit3("##color", &dummy_color[0]);
+ ImGui::EndGroup();
+
+ // Save the size of what we have emitted and weither any of the widgets are being used
+ bool node_widgets_active = (!old_any_active && ImGui::IsAnyItemActive());
+ node->Size = ImGui::GetItemRectSize() + NODE_WINDOW_PADDING + NODE_WINDOW_PADDING;
+ ImVec2 node_rect_max = node_rect_min + node->Size;
+
+ // Display node box
+ draw_list->ChannelsSetCurrent(0); // Background
+ ImGui::SetCursorScreenPos(node_rect_min);
+ ImGui::InvisibleButton("node", node->Size);
+ if (ImGui::IsItemHovered())
+ {
+ node_hovered_in_scene = node->ID;
+ open_context_menu |= ImGui::IsMouseClicked(1);
+ }
+ bool node_moving_active = ImGui::IsItemActive();
+ if (node_widgets_active || node_moving_active)
+ node_selected = node->ID;
+ if (node_moving_active && ImGui::IsMouseDragging(0))
+ node->Pos = node->Pos + ImGui::GetIO().MouseDelta;
+
+ ImU32 node_bg_color = (node_hovered_in_list == node->ID || node_hovered_in_scene == node->ID || (node_hovered_in_list == -1 && node_selected == node->ID)) ? ImColor(75,75,75) : ImColor(60,60,60);
+ draw_list->AddRectFilled(node_rect_min, node_rect_max, node_bg_color, 4.0f);
+ draw_list->AddRect(node_rect_min, node_rect_max, ImColor(100,100,100), 4.0f);
+ for (int slot_idx = 0; slot_idx < node->InputsCount; slot_idx++)
+ draw_list->AddCircleFilled(offset + node->GetInputSlotPos(slot_idx), NODE_SLOT_RADIUS, ImColor(150,150,150,150));
+ for (int slot_idx = 0; slot_idx < node->OutputsCount; slot_idx++)
+ draw_list->AddCircleFilled(offset + node->GetOutputSlotPos(slot_idx), NODE_SLOT_RADIUS, ImColor(150,150,150,150));
+
+ ImGui::PopID();
+ }
+ draw_list->ChannelsMerge();
+
+ // Open context menu
+ if (!ImGui::IsAnyItemHovered() && ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(1))
+ {
+ node_selected = node_hovered_in_list = node_hovered_in_scene = -1;
+ open_context_menu = true;
+ }
+ if (open_context_menu)
+ {
+ ImGui::OpenPopup("context_menu");
+ if (node_hovered_in_list != -1)
+ node_selected = node_hovered_in_list;
+ if (node_hovered_in_scene != -1)
+ node_selected = node_hovered_in_scene;
+ }
+
+ // Draw context menu
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8,8));
+ if (ImGui::BeginPopup("context_menu"))
+ {
+ Node* node = node_selected != -1 ? &nodes[node_selected] : NULL;
+ ImVec2 scene_pos = ImGui::GetMousePosOnOpeningCurrentPopup() - offset;
+ if (node)
+ {
+ ImGui::Text("Node '%s'", node->Name);
+ ImGui::Separator();
+ if (ImGui::MenuItem("Rename..", NULL, false, false)) {}
+ if (ImGui::MenuItem("Delete", NULL, false, false)) {}
+ if (ImGui::MenuItem("Copy", NULL, false, false)) {}
+ }
+ else
+ {
+ if (ImGui::MenuItem("Add")) { nodes.push_back(Node(nodes.Size, "New node", scene_pos, 0.5f, 2, 2)); }
+ if (ImGui::MenuItem("Paste", NULL, false, false)) {}
+ }
+ ImGui::EndPopup();
+ }
+ ImGui::PopStyleVar();
+
+ // Scrolling
+ if (ImGui::IsWindowHovered() && !ImGui::IsAnyItemActive() && ImGui::IsMouseDragging(2, 0.0f))
+ scrolling = scrolling - ImGui::GetIO().MouseDelta;
+
+ ImGui::PopItemWidth();
+ ImGui::EndChild();
+ ImGui::PopStyleColor();
+ ImGui::PopStyleVar(2);
+ ImGui::EndGroup();
+
+ ImGui::End();
+}
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp
new file mode 100644
index 00000000000..2f27fc192d9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp
@@ -0,0 +1,1686 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+/*
+ * Based on ImWindow code from:
+ * https://github.com/thennequin/ImWindow
+ *
+ * MIT license:
+ * https://github.com/thennequin/ImWindow/blob/master/LICENSE
+ */
+
+#include "imgui_wm.h"
+#include "imgui_internal.h"
+#include <algorithm>
+
+#define IMGUI_NEW(type) new (ImGui::MemAlloc(sizeof(type) ) ) type
+#define IMGUI_DELETE(type, obj) reinterpret_cast<type*>(obj)->~type(), ImGui::MemFree(obj)
+#define IMGUI_DELETE_NULL(type, obj) for (;;) { if (NULL != obj) { IMGUI_DELETE(type, obj); obj = NULL; } break; }
+
+namespace ImGuiWM
+{
+ enum EPlatformWindowAction
+ {
+ E_PLATFORM_WINDOW_ACTION_DESTOY = 1,
+ E_PLATFORM_WINDOW_ACTION_SHOW = 2,
+ E_PLATFORM_WINDOW_ACTION_HIDE = 4,
+ E_PLATFORM_WINDOW_ACTION_SET_POSITION = 8,
+ E_PLATFORM_WINDOW_ACTION_SET_SIZE = 16,
+ };
+
+ static const ImVec2 IM_VEC2_0 = ImVec2(0, 0);
+ static const ImVec2 IM_VEC2_N1 = ImVec2(-1, -1);
+
+ int Id::s_iNextId = 0;
+
+ Id::Id()
+ {
+ m_iId = s_iNextId++;
+ ImFormatString(m_pId, 11, "0x%8X", m_iId);
+ }
+
+ ImU32 Id::GetId() const
+ {
+ return m_iId;
+ }
+
+ const char* Id::GetStr() const
+ {
+ return m_pId;
+ }
+
+ Window::Window()
+ {
+ m_pTitle = NULL;
+ WindowManager::GetInstance()->AddWindow(this);
+ }
+
+ Window::~Window()
+ {
+ WindowManager::GetInstance()->RemoveWindow(this);
+ ImGui::MemFree(m_pTitle);
+ }
+
+ void Window::Destroy()
+ {
+ WindowManager::GetInstance()->DestroyWindow(this);
+ }
+
+ void Window::SetTitle(const char* pTitle)
+ {
+ ImGui::MemFree(m_pTitle);
+ m_pTitle = ImStrdup(pTitle);
+ }
+
+ const char* Window::GetTitle() const
+ {
+ return m_pTitle;
+ }
+
+ const ImVec2& Window::GetLastPosition() const
+ {
+ return m_oLastPosition;
+ }
+
+ const ImVec2& Window::GetLastSize() const
+ {
+ return m_oLastSize;
+ }
+
+ Container::Container(Container* pParent)
+ {
+ IM_ASSERT(NULL != pParent);
+ m_pSplits[0] = NULL;
+ m_pSplits[1] = NULL;
+ m_bVerticalSplit = false;
+ m_iActiveWindow = 0;
+ m_fSplitRatio = 0.5f;
+ m_bIsDrag = false;
+ m_pParent = pParent;
+ m_pParentWindow = (NULL != pParent) ? pParent->m_pParentWindow : NULL;
+ }
+
+ Container::Container(PlatformWindow* pParent)
+ {
+ IM_ASSERT(NULL != pParent);
+ m_pSplits[0] = NULL;
+ m_pSplits[1] = NULL;
+ m_bVerticalSplit = false;
+ m_iActiveWindow = 0;
+ m_fSplitRatio = 0.5f;
+ m_bIsDrag = false;
+ m_pParent = NULL;
+ m_pParentWindow = pParent;
+ }
+
+ Container::~Container()
+ {
+ while (m_lWindows.begin() != m_lWindows.end())
+ {
+ Window* window = *m_lWindows.begin();
+ WindowManager::GetInstance()->RemoveWindow(window);
+ IMGUI_DELETE(Window, window);
+ m_lWindows.erase(m_lWindows.begin());
+ }
+
+ IMGUI_DELETE_NULL(Container, m_pSplits[0]);
+ IMGUI_DELETE_NULL(Container, m_pSplits[1]);
+ }
+
+ void Container::CreateSplits()
+ {
+ m_pSplits[0] = IMGUI_NEW(Container)(this);
+ m_pSplits[1] = IMGUI_NEW(Container)(this);
+ }
+
+ void Container::Dock(Window* pWindow, EDockOrientation eOrientation)
+ {
+ IM_ASSERT(NULL != pWindow);
+
+ if (NULL != pWindow)
+ {
+ IM_ASSERT(eOrientation != E_DOCK_ORIENTATION_CENTER || !IsSplit());
+
+ if (!IsSplit())
+ {
+ if (m_lWindows.size() == 0)
+ {
+ eOrientation = E_DOCK_ORIENTATION_CENTER;
+ }
+
+ switch (eOrientation)
+ {
+ case E_DOCK_ORIENTATION_CENTER:
+ {
+ m_lWindows.push_back(pWindow);
+ m_iActiveWindow = int(m_lWindows.size() - 1);
+ }
+ break;
+ case E_DOCK_ORIENTATION_TOP:
+ {
+ m_bVerticalSplit = true;
+ CreateSplits();
+ m_pSplits[0]->Dock(pWindow);
+ m_pSplits[1]->m_lWindows.insert(m_pSplits[1]->m_lWindows.begin(), m_lWindows.begin(), m_lWindows.end());
+ m_lWindows.clear();
+ m_iActiveWindow = 0;
+ }
+ break;
+ case E_DOCK_ORIENTATION_LEFT:
+ {
+ m_bVerticalSplit = false;
+ CreateSplits();
+ m_pSplits[0]->Dock(pWindow);
+ m_pSplits[1]->m_lWindows.insert(m_pSplits[1]->m_lWindows.begin(), m_lWindows.begin(), m_lWindows.end());
+ m_lWindows.clear();
+ m_iActiveWindow = 0;
+ }
+ break;
+ case E_DOCK_ORIENTATION_RIGHT:
+ {
+ m_bVerticalSplit = false;
+ CreateSplits();
+ m_pSplits[0]->m_lWindows.insert(m_pSplits[0]->m_lWindows.begin(), m_lWindows.begin(), m_lWindows.end());
+ m_pSplits[1]->Dock(pWindow);
+ m_lWindows.clear();
+ m_iActiveWindow = 0;
+ }
+ break;
+ case E_DOCK_ORIENTATION_BOTTOM:
+ {
+ m_bVerticalSplit = true;
+ CreateSplits();
+ m_pSplits[0]->m_lWindows.insert(m_pSplits[0]->m_lWindows.begin(), m_lWindows.begin(), m_lWindows.end());
+ m_pSplits[1]->Dock(pWindow);
+ m_lWindows.clear();
+ m_iActiveWindow = 0;
+ }
+ break;
+ }
+ }
+ else
+ {
+ switch (eOrientation)
+ {
+ case E_DOCK_ORIENTATION_CENTER:
+ IM_ASSERT(false);
+ break;
+ case E_DOCK_ORIENTATION_TOP:
+ {
+ Container* pSplit0 = m_pSplits[0];
+ Container* pSplit1 = m_pSplits[1];
+ CreateSplits();
+ m_pSplits[0]->m_lWindows.push_back(pWindow);
+ m_pSplits[1]->m_bVerticalSplit = m_bVerticalSplit;
+ m_pSplits[1]->m_fSplitRatio = m_fSplitRatio;
+ m_pSplits[1]->m_pSplits[0] = pSplit0;
+ m_pSplits[1]->m_pSplits[1] = pSplit1;
+ m_pSplits[1]->m_pSplits[0]->m_pParent = m_pSplits[1];
+ m_pSplits[1]->m_pSplits[1]->m_pParent = m_pSplits[1];
+ m_fSplitRatio = WindowManager::GetInstance()->GetConfig().m_fDragMarginSizeRatio;
+ m_bVerticalSplit = true;
+ }
+ break;
+ case E_DOCK_ORIENTATION_LEFT:
+ {
+ Container* pSplit0 = m_pSplits[0];
+ Container* pSplit1 = m_pSplits[1];
+ CreateSplits();
+ m_pSplits[0]->m_lWindows.push_back(pWindow);
+ m_pSplits[1]->m_bVerticalSplit = m_bVerticalSplit;
+ m_pSplits[1]->m_fSplitRatio = m_fSplitRatio;
+ m_pSplits[1]->m_pSplits[0] = pSplit0;
+ m_pSplits[1]->m_pSplits[1] = pSplit1;
+ m_pSplits[1]->m_pSplits[0]->m_pParent = m_pSplits[1];
+ m_pSplits[1]->m_pSplits[1]->m_pParent = m_pSplits[1];
+ m_fSplitRatio = WindowManager::GetInstance()->GetConfig().m_fDragMarginSizeRatio;
+ m_bVerticalSplit = false;
+ }
+ break;
+ case E_DOCK_ORIENTATION_RIGHT:
+ {
+ Container* pSplit0 = m_pSplits[0];
+ Container* pSplit1 = m_pSplits[1];
+ CreateSplits();
+ m_pSplits[1]->m_lWindows.push_back(pWindow);
+ m_pSplits[0]->m_bVerticalSplit = m_bVerticalSplit;
+ m_pSplits[0]->m_fSplitRatio = m_fSplitRatio;
+ m_pSplits[0]->m_pSplits[0] = pSplit0;
+ m_pSplits[0]->m_pSplits[1] = pSplit1;
+ m_pSplits[0]->m_pSplits[0]->m_pParent = m_pSplits[0];
+ m_pSplits[0]->m_pSplits[1]->m_pParent = m_pSplits[0];
+ m_fSplitRatio = 1.f - WindowManager::GetInstance()->GetConfig().m_fDragMarginSizeRatio;
+ m_bVerticalSplit = false;
+ }
+ break;
+ case E_DOCK_ORIENTATION_BOTTOM:
+ {
+ Container* pSplit0 = m_pSplits[0];
+ Container* pSplit1 = m_pSplits[1];
+ CreateSplits();
+ m_pSplits[1]->m_lWindows.push_back(pWindow);
+ m_pSplits[0]->m_bVerticalSplit = m_bVerticalSplit;
+ m_pSplits[0]->m_fSplitRatio = m_fSplitRatio;
+ m_pSplits[0]->m_pSplits[0] = pSplit0;
+ m_pSplits[0]->m_pSplits[1] = pSplit1;
+ m_pSplits[0]->m_pSplits[0]->m_pParent = m_pSplits[0];
+ m_pSplits[0]->m_pSplits[1]->m_pParent = m_pSplits[0];
+ m_fSplitRatio = 1.f - WindowManager::GetInstance()->GetConfig().m_fDragMarginSizeRatio;
+ m_bVerticalSplit = true;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ bool Container::UnDock(Window* pWindow)
+ {
+ if (std::find(m_lWindows.begin(), m_lWindows.end(), pWindow) != m_lWindows.end())
+ {
+ m_lWindows.remove(pWindow);
+ if (m_iActiveWindow >= int(m_lWindows.size()))
+ {
+ m_iActiveWindow = int(m_lWindows.size() - 1);
+ }
+ return true;
+ }
+
+ if (NULL != m_pSplits[0] && NULL != m_pSplits[1])
+ {
+ if (m_pSplits[0]->UnDock(pWindow))
+ {
+ if (m_pSplits[0]->IsEmpty())
+ {
+ if (m_pSplits[1]->IsSplit())
+ {
+ Container* pSplit = m_pSplits[1];
+ m_bVerticalSplit = pSplit->m_bVerticalSplit;
+ IMGUI_DELETE_NULL(Container, m_pSplits[0]);
+ m_pSplits[0] = pSplit->m_pSplits[0];
+ m_pSplits[1] = pSplit->m_pSplits[1];
+ pSplit->m_pSplits[0] = NULL;
+ pSplit->m_pSplits[1] = NULL;
+ m_pSplits[0]->m_pParent = this;
+ m_pSplits[1]->m_pParent = this;
+ IMGUI_DELETE_NULL(Container, pSplit);
+ }
+ else
+ {
+ m_lWindows.insert(m_lWindows.end(), m_pSplits[1]->m_lWindows.begin(), m_pSplits[1]->m_lWindows.end());
+ m_pSplits[1]->m_lWindows.clear();
+ m_pSplits[1]->m_iActiveWindow = 0;
+ IMGUI_DELETE_NULL(Container, m_pSplits[0]);
+ IMGUI_DELETE_NULL(Container, m_pSplits[1]);
+ }
+ }
+ return true;
+ }
+
+ if (m_pSplits[1]->UnDock(pWindow))
+ {
+ if (m_pSplits[1]->IsEmpty())
+ {
+ if (m_pSplits[0]->IsSplit())
+ {
+ Container* pSplit = m_pSplits[0];
+ m_bVerticalSplit = pSplit->m_bVerticalSplit;
+ IMGUI_DELETE_NULL(Container, m_pSplits[1]);
+ m_pSplits[0] = pSplit->m_pSplits[0];
+ m_pSplits[1] = pSplit->m_pSplits[1];
+ pSplit->m_pSplits[0] = NULL;
+ pSplit->m_pSplits[1] = NULL;
+ m_pSplits[0]->m_pParent = this;
+ m_pSplits[1]->m_pParent = this;
+ IMGUI_DELETE_NULL(Container, pSplit);
+ }
+ else
+ {
+ m_lWindows.insert(m_lWindows.end(), m_pSplits[0]->m_lWindows.begin(), m_pSplits[0]->m_lWindows.end());
+ m_pSplits[0]->m_lWindows.clear();
+ m_pSplits[0]->m_iActiveWindow = 0;
+ IMGUI_DELETE_NULL(Container, m_pSplits[0]);
+ IMGUI_DELETE_NULL(Container, m_pSplits[1]);
+ }
+ }
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ bool Container::IsEmpty()
+ {
+ //IM_ASSERT(IsSplit() != HasWindowTabbed());
+ return !(IsSplit() || HasWindowTabbed());
+ }
+
+ bool Container::IsSplit()
+ {
+ IM_ASSERT((NULL == m_pSplits[0]) == (NULL == m_pSplits[1]));
+ return (NULL != m_pSplits[0] && NULL != m_pSplits[1]);
+ }
+
+ bool Container::HasWindowTabbed()
+ {
+ return m_lWindows.size() > 0;
+ }
+
+ Container* Container::HasWindow(const Window* pWindow)
+ {
+ if (std::find(m_lWindows.begin(), m_lWindows.end(), pWindow) != m_lWindows.end())
+ {
+ return this;
+ }
+ else
+ {
+ if (NULL != m_pSplits[0])
+ {
+ Container* pContainer = m_pSplits[0]->HasWindow(pWindow);
+ if (NULL != pContainer)
+ {
+ return pContainer;
+ }
+ }
+ if (NULL != m_pSplits[1])
+ {
+ Container* pContainer = m_pSplits[1]->HasWindow(pWindow);
+ if (NULL != pContainer)
+ {
+ return pContainer;
+ }
+ }
+ }
+ return NULL;
+ }
+
+ PlatformWindow* Container::GetPlatformWindowParent() const
+ {
+ return m_pParentWindow;
+ }
+
+ void Container::Paint()
+ {
+ WindowManager* pWindowManager = WindowManager::GetInstance();
+ ImGuiWindow* pWindow = ImGui::GetCurrentWindow();
+ const ImGuiStyle& oStyle = ImGui::GetStyle();
+ ImDrawList* pDrawList = ImGui::GetWindowDrawList();
+
+ const ImVec2 oPos = ImGui::GetWindowPos();
+ const ImVec2 oSize = ImGui::GetWindowSize();
+ const ImVec2 oMin = ImVec2(oPos.x + 1, oPos.y + 1);
+ const ImVec2 oMax = ImVec2(oPos.x + oSize.x - 2, oPos.y + oSize.y - 2);
+
+ m_oLastPosition = oPos;
+ m_oLastSize = oSize;
+
+ const int iSeparatorHalfSize = 2;
+ const int iSeparatorSize = iSeparatorHalfSize * 2;
+
+ if (IsSplit())
+ {
+ if (m_bVerticalSplit)
+ {
+ float iFirstHeight = oSize.y * m_fSplitRatio - iSeparatorHalfSize - pWindow->WindowPadding.x;
+
+ ImGui::BeginChild("Split1", ImVec2(0, iFirstHeight), false, ImGuiWindowFlags_NoScrollbar);
+ m_pSplits[0]->Paint();
+ ImGui::EndChild();
+
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f));
+ ImRect oSeparatorRect(0, iFirstHeight, oSize.x, iFirstHeight + iSeparatorSize);
+ ImGui::Button("", oSeparatorRect.GetSize());
+ if (ImGui::IsItemHovered() || m_bIsDrag)
+ {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
+ }
+ ImGui::PopStyleVar(1);
+
+ if (ImGui::IsItemActive())
+ {
+ if (!m_bIsDrag)
+ {
+ m_bIsDrag = true;
+ }
+ m_fSplitRatio += ImGui::GetIO().MouseDelta.y / oSize.y;
+ m_fSplitRatio = ImClamp(m_fSplitRatio, 0.05f, 0.95f);
+
+ }
+ else
+ {
+ m_bIsDrag = false;
+ }
+
+ ImGui::BeginChild("Split2", ImVec2(0, 0), false, ImGuiWindowFlags_NoScrollbar);
+ m_pSplits[1]->Paint(/*iX, iY + iFirstHeight, iWidth, iSecondHeight*/);
+ ImGui::EndChild();
+ }
+ else
+ {
+ float iFirstWidth = oSize.x * m_fSplitRatio - iSeparatorHalfSize - pWindow->WindowPadding.y;
+ ImGui::BeginChild("Split1", ImVec2(iFirstWidth, 0), false, ImGuiWindowFlags_NoScrollbar);
+ m_pSplits[0]->Paint();
+ ImGui::EndChild();
+
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f));
+ ImGui::SameLine();
+
+ ImRect oSeparatorRect(iFirstWidth, 0, iFirstWidth + iSeparatorSize, oSize.y);
+ ImGui::Button("", oSeparatorRect.GetSize());
+
+ if (ImGui::IsItemHovered() || m_bIsDrag)
+ {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW);
+ }
+ ImGui::PopStyleVar(1);
+
+ if (ImGui::IsItemActive())
+ {
+ if (!m_bIsDrag)
+ {
+ m_bIsDrag = true;
+ }
+
+ m_fSplitRatio += ImGui::GetIO().MouseDelta.x / oSize.x;
+ m_fSplitRatio = ImClamp(m_fSplitRatio, 0.05f, 0.95f);
+ }
+ else
+ {
+ m_bIsDrag = false;
+ }
+
+ ImGui::SameLine();
+
+ ImGui::BeginChild("Split2", ImVec2(0, 0), false, ImGuiWindowFlags_NoScrollbar);
+ m_pSplits[1]->Paint();
+ ImGui::EndChild();
+ }
+ }
+ else if (HasWindowTabbed())
+ {
+ ImGui::InvisibleButton("TabListButton", ImVec2(16, 16));
+ ImGui::SameLine();
+
+ if (ImGui::BeginPopupContextItem("TabListMenu", 0))
+ {
+ int iIndex = 0;
+ for (WindowList::const_iterator itWindow = m_lWindows.begin(); itWindow != m_lWindows.end(); ++itWindow, ++iIndex)
+ {
+ if (ImGui::Selectable((*itWindow)->GetTitle()))
+ {
+ m_iActiveWindow = iIndex;
+ }
+ }
+ ImGui::EndPopup();
+ }
+
+ ImColor oLinesColor = ImColor(160, 160, 160, 255);
+ if (ImGui::IsItemHovered())
+ {
+ oLinesColor = ImColor(255, 255, 255, 255);
+ }
+ ImVec2 oButtonMin = ImGui::GetItemRectMin();
+ ImVec2 oButtonMax = ImGui::GetItemRectMax();
+ ImVec2 oButtonSize = ImVec2(oButtonMax.x - oButtonMin.x, oButtonMax.y - oButtonMin.y);
+ pDrawList->AddLine(
+ ImVec2(oButtonMin.x + 1, oButtonMin.y + oButtonSize.y / 2),
+ ImVec2(oButtonMax.x - 1, oButtonMin.y + oButtonSize.y / 2),
+ oLinesColor);
+
+ pDrawList->AddLine(
+ ImVec2(oButtonMin.x + 1, oButtonMin.y + oButtonSize.y / 2 - 4),
+ ImVec2(oButtonMax.x - 1, oButtonMin.y + oButtonSize.y / 2 - 4),
+ oLinesColor);
+
+ pDrawList->AddLine(
+ ImVec2(oButtonMin.x + 1, oButtonMin.y + oButtonSize.y / 2 + 4),
+ ImVec2(oButtonMax.x - 1, oButtonMin.y + oButtonSize.y / 2 + 4),
+ oLinesColor);
+
+ pDrawList->ChannelsSplit(2);
+
+ //Tabs
+ int iIndex = 0;
+ int iNewActive = m_iActiveWindow;
+ int iSize = int(m_lWindows.size());
+ for (WindowList::iterator it = m_lWindows.begin(); it != m_lWindows.end(); ++it)
+ {
+ const ImVec2 oTextSize = ImGui::CalcTextSize((*it)->GetTitle());
+ ImVec2 oRectSize(oTextSize.x + 15, 25);
+
+ ImGui::PushID(iIndex);
+
+ bool bSelected = iIndex == m_iActiveWindow;
+ if (ImGui::InvisibleButton((*it)->GetId(), oRectSize))
+ {
+ iNewActive = iIndex;
+ }
+ if (iIndex < (iSize - 1))
+ {
+ ImGui::SameLine();
+ }
+
+ if (ImGui::IsItemActive())
+ {
+ if (ImGui::IsMouseDragging())
+ {
+ pWindowManager->StartDragWindow(*it);
+ }
+ }
+
+ ImColor oNormalTab(50, 50, 50, 255); // normal
+ ImColor oSelectedTab(37, 37, 37, 255); // selected
+ ImColor oBorderColor(72, 72, 72, 255); // border
+
+ ImVec2 oRectMin = ImGui::GetItemBoxMin();
+ ImVec2 oRectMax = ImGui::GetItemBoxMax();
+
+ const float fOverlap = 10.f;
+ const float fSlopWidth = 30.f;
+ const float sSlopP1Ratio = 0.6f;
+ const float fSlopP2Ratio = 0.4f;
+ const float fSlopHRatio = 0.f;
+ const float fShadowDropSize = 15.f;
+ const float fShadowSlopRatio = 0.6f;
+ const float fShadowAlpha = 0.75f;
+
+ pDrawList->PathClear();
+ if (bSelected)
+ {
+ pDrawList->ChannelsSetCurrent(1);
+ }
+ else
+ {
+ pDrawList->ChannelsSetCurrent(0);
+ }
+
+ //Drop shadows
+ const ImVec2 uv = GImGui->FontTexUvWhitePixel;
+ pDrawList->PrimReserve(3, 3);
+ pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx)); pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx + 1)); pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx + 2));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMin.x - fOverlap - fShadowDropSize, oRectMax.y), uv, ImColor(0.f, 0.f, 0.f, 0.f));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMin.x - fOverlap + fSlopWidth * fShadowSlopRatio, oRectMin.y), uv, ImColor(0.f, 0.f, 0.f, 0.f));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMin.x - fOverlap + fSlopWidth * fShadowSlopRatio, oRectMax.y), uv, ImColor(0.f, 0.f, 0.f, fShadowAlpha));
+ if (bSelected)
+ {
+ pDrawList->PrimReserve(3, 3);
+ pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx)); pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx + 1)); pDrawList->PrimWriteIdx((ImDrawIdx)(pDrawList->_VtxCurrentIdx + 2));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMax.x + fOverlap + fShadowDropSize, oRectMax.y), uv, ImColor(0.f, 0.f, 0.f, 0.f));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMax.x + fOverlap - fSlopWidth * fShadowSlopRatio, oRectMin.y), uv, ImColor(0.f, 0.f, 0.f, 0.f));
+ pDrawList->PrimWriteVtx(ImVec2(oRectMax.x + fOverlap - fSlopWidth * fShadowSlopRatio, oRectMax.y), uv, ImColor(0.f, 0.f, 0.f, fShadowAlpha));
+ }
+
+ // Draw tab and border
+ if (bSelected)
+ {
+ pDrawList->PathLineTo(ImVec2(oMin.x, oRectMax.y));
+ }
+ pDrawList->PathLineTo(ImVec2(oRectMin.x - fOverlap, oRectMax.y));
+ pDrawList->PathBezierCurveTo(
+ ImVec2(oRectMin.x + fSlopWidth * sSlopP1Ratio - fOverlap, oRectMin.y + (oRectMax.y - oRectMin.y) * fSlopHRatio),
+ ImVec2(oRectMin.x + fSlopWidth * fSlopP2Ratio - fOverlap, oRectMin.y),
+ ImVec2(oRectMin.x + fSlopWidth - fOverlap, oRectMin.y)
+ );
+ pDrawList->PathLineTo(ImVec2(oRectMax.x - fSlopWidth + fOverlap, oRectMin.y));
+ pDrawList->PathBezierCurveTo(
+ ImVec2(oRectMax.x - fSlopWidth * fSlopP2Ratio + fOverlap, oRectMin.y),
+ ImVec2(oRectMax.x - fSlopWidth * sSlopP1Ratio + fOverlap, oRectMin.y + (oRectMax.y - oRectMin.y) * fSlopHRatio),
+ ImVec2(oRectMax.x + fOverlap, oRectMax.y)
+ );
+
+ if (bSelected)
+ {
+ pDrawList->AddConvexPolyFilled(pDrawList->_Path.Data + 1, pDrawList->_Path.Size - 1, bSelected ? oSelectedTab : oNormalTab, true);
+ if (oMax.x > (oRectMax.x + fOverlap))
+ {
+ pDrawList->PathLineTo(ImVec2(oMax.x, oRectMax.y));
+ }
+ pDrawList->AddPolyline(pDrawList->_Path.Data, pDrawList->_Path.Size, oBorderColor, false, 1.5f, true);
+ }
+ else
+ {
+ pDrawList->AddConvexPolyFilled(pDrawList->_Path.Data, pDrawList->_Path.Size, bSelected ? oSelectedTab : oNormalTab, true);
+ }
+
+ pDrawList->PathClear();
+
+ ImGui::RenderTextClipped(oRectMin, ImVec2(oRectMax.x, oRectMax.y), (*it)->GetTitle(), NULL, &oTextSize, ImGuiAlign_Center | ImGuiAlign_VCenter);
+
+ if (ImGui::BeginPopupContextItem("TabMenu"))
+ {
+ if (ImGui::Selectable("Close"))
+ {
+ (*it)->Destroy();
+ }
+ if (ImGui::BeginMenu("Dock to"))
+ {
+ int iIndex1 = 0;
+
+ if (pWindowManager->GetMainPlatformWindow()->GetContainer()->IsEmpty())
+ {
+ ImGui::PushID(0);
+ if (ImGui::Selectable("Main")) pWindowManager->Dock((*it));
+ ImGui::PopID();
+ ++iIndex1;
+ }
+ const WindowList& lWindows = pWindowManager->GetWindowList();
+ for (WindowList::const_iterator itWindow = lWindows.begin(); itWindow != lWindows.end(); ++itWindow)
+ {
+ if ((*it) != (*itWindow))
+ {
+ ImGui::PushID(iIndex1);
+ if (ImGui::BeginMenu((*itWindow)->GetTitle()))
+ {
+ bool bHovered = false;
+ PlatformWindow* pPlatformWindow = pWindowManager->GetWindowParent((*itWindow));
+
+ ImVec2 oLastWinPos = (*itWindow)->GetLastPosition();
+ ImVec2 oLastWinSize = (*itWindow)->GetLastSize();
+
+ ImGui::PushID(0);
+ if (ImGui::Selectable("Tab")) pWindowManager->DockWith((*it), (*itWindow), E_DOCK_ORIENTATION_CENTER);
+ if (ImGui::IsItemHovered() && NULL != pPlatformWindow)
+ {
+ bHovered = true;
+ pWindowManager->DrawWindowArea(pPlatformWindow, oLastWinPos, oLastWinSize, ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ ImGui::PopID();
+
+ ImGui::PushID(1);
+ if (ImGui::Selectable("Top")) pWindowManager->DockWith((*it), (*itWindow), E_DOCK_ORIENTATION_TOP);
+ if (ImGui::IsItemHovered() && NULL != pPlatformWindow)
+ {
+ bHovered = true;
+ pWindowManager->DrawWindowArea(pPlatformWindow, oLastWinPos, ImVec2(oLastWinSize.x, oLastWinSize.y / 2.f), ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ ImGui::PopID();
+
+ ImGui::PushID(2);
+ if (ImGui::Selectable("Left")) pWindowManager->DockWith((*it), (*itWindow), E_DOCK_ORIENTATION_LEFT);
+ if (ImGui::IsItemHovered() && NULL != pPlatformWindow)
+ {
+ bHovered = true;
+ pWindowManager->DrawWindowArea(pPlatformWindow, oLastWinPos, ImVec2(oLastWinSize.x / 2.f, oLastWinSize.y), ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ ImGui::PopID();
+
+ ImGui::PushID(3);
+ if (ImGui::Selectable("Right")) pWindowManager->DockWith((*it), (*itWindow), E_DOCK_ORIENTATION_RIGHT);
+ if (ImGui::IsItemHovered() && NULL != pPlatformWindow)
+ {
+ bHovered = true;
+ pWindowManager->DrawWindowArea(pPlatformWindow, ImVec2(oLastWinPos.x + oLastWinSize.x / 2.f, oLastWinPos.y), ImVec2(oLastWinSize.x / 2.f, oLastWinSize.y), ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ ImGui::PopID();
+
+ ImGui::PushID(4);
+ if (ImGui::Selectable("Bottom")) pWindowManager->DockWith((*it), (*itWindow), E_DOCK_ORIENTATION_BOTTOM);
+ if (ImGui::IsItemHovered() && NULL != pPlatformWindow)
+ {
+ bHovered = true;
+ pWindowManager->DrawWindowArea(pPlatformWindow, ImVec2(oLastWinPos.x, oLastWinPos.y + oLastWinSize.y / 2.f), ImVec2(oLastWinSize.x, oLastWinSize.y / 2.f), ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ ImGui::PopID();
+
+ if (!bHovered)
+ {
+ if (NULL != pPlatformWindow)
+ {
+ pWindowManager->DrawWindowArea(pPlatformWindow, oLastWinPos, oLastWinSize, ImColor(0.f, 0.5f, 1.f, 0.5f));
+ }
+ }
+
+ ImGui::EndMenu();
+ }
+ ImGui::PopID();
+ }
+ ++iIndex1;
+ }
+
+ ImGui::EndMenu();
+ }
+ if (ImGui::Selectable("Float"))
+ {
+ pWindowManager->Float((*it));
+ }
+
+ ImGui::EndPopup();
+ }
+
+ ImGui::PopID();
+
+ ++iIndex;
+ }
+ m_iActiveWindow = iNewActive;
+ pDrawList->ChannelsMerge();
+
+ WindowList::iterator itActiveWindow = m_lWindows.begin();
+ std::advance(itActiveWindow, m_iActiveWindow);
+
+ //Draw active
+ IM_ASSERT(itActiveWindow != m_lWindows.end());
+ if (itActiveWindow != m_lWindows.end())
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, oStyle.WindowPadding);
+ //ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImColor(59, 59, 59, 255));
+ ImGui::BeginChild((*itActiveWindow)->GetId(), ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar);
+
+
+ ImVec2 oWinPos = ImGui::GetWindowPos();
+ ImVec2 oWinSize = ImGui::GetWindowSize();
+
+ for (WindowList::iterator it = m_lWindows.begin(); it != m_lWindows.end(); ++it)
+ {
+ (*it)->m_oLastPosition = oWinPos;
+ (*it)->m_oLastSize = oWinSize;
+ }
+ (*itActiveWindow)->OnGui();
+
+ ImGui::EndChild();
+ //ImGui::PopStyleColor(1);
+ ImGui::PopStyleVar(1);
+ }
+ }
+ else
+ {
+ // This case can happened only where it's main container
+ IM_ASSERT(m_pParent == NULL);
+ }
+ }
+
+ Container* Container::GetBestDocking(const ImVec2 oCursorPos, EDockOrientation& oOutOrientation, ImVec2& oOutAreaPos, ImVec2& oOutAreaSize)
+ {
+ if (m_pParent == NULL ||
+ (oCursorPos.x >= m_oLastPosition.x && oCursorPos.x <= (m_oLastPosition.x + m_oLastSize.x) &&
+ oCursorPos.y >= m_oLastPosition.y && oCursorPos.y <= (m_oLastPosition.y + m_oLastSize.y)))
+ {
+ if (IsSplit())
+ {
+ Container* pBestContainer = NULL;
+ pBestContainer = m_pSplits[0]->GetBestDocking(oCursorPos, oOutOrientation, oOutAreaPos, oOutAreaSize);
+ if (NULL != pBestContainer)
+ {
+ return pBestContainer;
+ }
+ pBestContainer = m_pSplits[1]->GetBestDocking(oCursorPos, oOutOrientation, oOutAreaPos, oOutAreaSize);
+ if (NULL != pBestContainer)
+ {
+ return pBestContainer;
+ }
+ }
+ else
+ {
+ const float c_fBoxHalfSize = 20.f;
+ const float c_fBoxSize = c_fBoxHalfSize * 2.f;
+ const float c_fMinSize = c_fBoxSize * 4.f;
+ const float c_fSplitRatio = 0.5f;
+ //const float c_fSplitRatio = oConfig.m_fDragMarginSizeRatio;
+ const ImColor oBoxColor(200, 200, 255, 255);
+ const ImColor oBoxHightlightColor(100, 100, 255, 255);
+
+ if (m_oLastSize.x < c_fMinSize && m_oLastSize.y < c_fMinSize)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_CENTER;
+ oOutAreaPos = m_oLastPosition;
+ oOutAreaSize = m_oLastSize;
+ return this;
+ }
+ else
+ {
+ ImVec2 oCenter = ImVec2(m_oLastPosition.x + m_oLastSize.x / 2.f, m_oLastPosition.y + m_oLastSize.y / 2.f);
+
+ bool bIsInCenter = false;
+ bool bIsInTop = false;
+ bool bIsInLeft = false;
+ bool bIsInRight = false;
+ bool bIsInBottom = false;
+
+ //Center
+ ImRect oRectCenter(ImVec2(oCenter.x - c_fBoxHalfSize, oCenter.y - c_fBoxHalfSize), ImVec2(oCenter.x + c_fBoxHalfSize, oCenter.y + c_fBoxHalfSize));
+ bIsInCenter = oRectCenter.Contains(oCursorPos);
+ WindowManager::GetInstance()->DrawWindowArea(m_pParentWindow, oRectCenter.Min, oRectCenter.GetSize(), bIsInCenter ? oBoxHightlightColor : oBoxColor);
+
+ if (m_oLastSize.y >= c_fMinSize)
+ {
+ //Top
+ ImRect oRectTop(ImVec2(oCenter.x - c_fBoxHalfSize, oCenter.y - c_fBoxHalfSize * 4.f), ImVec2(oCenter.x + c_fBoxHalfSize, oCenter.y - c_fBoxHalfSize * 2.f));
+ bIsInTop = oRectTop.Contains(oCursorPos);
+ WindowManager::GetInstance()->DrawWindowArea(m_pParentWindow, oRectTop.Min, oRectTop.GetSize(), bIsInTop ? oBoxHightlightColor : oBoxColor);
+
+ //Bottom
+ ImRect oRectBottom(ImVec2(oCenter.x - c_fBoxHalfSize, oCenter.y + c_fBoxHalfSize * 2.f), ImVec2(oCenter.x + c_fBoxHalfSize, oCenter.y + c_fBoxHalfSize * 4.f));
+ bIsInBottom = oRectBottom.Contains(oCursorPos);
+ WindowManager::GetInstance()->DrawWindowArea(m_pParentWindow, oRectBottom.Min, oRectBottom.GetSize(), bIsInBottom ? oBoxHightlightColor : oBoxColor);
+ }
+
+ if (m_oLastSize.x >= c_fMinSize)
+ {
+ //Left
+ ImRect oRectLeft(ImVec2(oCenter.x - c_fBoxHalfSize * 4.f, oCenter.y - c_fBoxHalfSize), ImVec2(oCenter.x - c_fBoxHalfSize * 2.f, oCenter.y + c_fBoxHalfSize));
+ bIsInLeft = oRectLeft.Contains(oCursorPos);
+ WindowManager::GetInstance()->DrawWindowArea(m_pParentWindow, oRectLeft.Min, oRectLeft.GetSize(), bIsInLeft ? oBoxHightlightColor : oBoxColor);
+
+ //Right
+ ImRect oRectRight(ImVec2(oCenter.x + c_fBoxHalfSize * 2.f, oCenter.y - c_fBoxHalfSize), ImVec2(oCenter.x + c_fBoxHalfSize * 4.f, oCenter.y + c_fBoxHalfSize));
+ bIsInRight = oRectRight.Contains(oCursorPos);
+ WindowManager::GetInstance()->DrawWindowArea(m_pParentWindow, oRectRight.Min, oRectRight.GetSize(), bIsInRight ? oBoxHightlightColor : oBoxColor);
+ }
+
+ if (bIsInCenter)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_CENTER;
+ oOutAreaPos = m_oLastPosition;
+ oOutAreaSize = m_oLastSize;
+ return this;
+ }
+ else if (bIsInTop)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_TOP;
+ oOutAreaPos = m_oLastPosition;
+ oOutAreaSize = ImVec2(m_oLastSize.x, m_oLastSize.y * c_fSplitRatio);
+ return this;
+ }
+ else if (bIsInLeft)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_LEFT;
+ oOutAreaPos = m_oLastPosition;
+ oOutAreaSize = ImVec2(m_oLastSize.x * c_fSplitRatio, m_oLastSize.y);
+ return this;
+ }
+ else if (bIsInRight)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_RIGHT;
+ oOutAreaPos = ImVec2(m_oLastPosition.x + m_oLastSize.x * (1.f - c_fSplitRatio), m_oLastPosition.y);
+ oOutAreaSize = ImVec2(m_oLastSize.x * c_fSplitRatio, m_oLastSize.y);
+ return this;
+ }
+ else if (bIsInBottom)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_BOTTOM;
+ oOutAreaPos = ImVec2(m_oLastPosition.x, m_oLastPosition.y + m_oLastSize.y * (1.f - c_fSplitRatio));
+ oOutAreaSize = ImVec2(m_oLastSize.x, m_oLastSize.y * c_fSplitRatio);
+ return this;
+ }
+ }
+ }
+ }
+
+ return NULL;
+ }
+
+ PlatformWindow::PlatformWindow(bool bMain, bool bIsDragWindow)
+ {
+ m_bMain = bMain;
+ m_bIsDragWindow = bIsDragWindow;
+ m_pContainer = IMGUI_NEW(Container)(this);
+ m_pState = NULL;
+ m_pPreviousState = NULL;
+
+ void* pTemp = ImGui::GetInternalState();
+ m_pState = ImGui::MemAlloc(ImGui::GetInternalStateSize());
+ ImGui::SetInternalState(m_pState, true);
+ ImGui::GetIO().IniFilename = NULL;
+ ImGui::SetInternalState(pTemp);
+ }
+
+ PlatformWindow::~PlatformWindow()
+ {
+ IMGUI_DELETE_NULL(Container, m_pContainer);
+
+ SetState();
+ if (!IsMain())
+ {
+ ImGui::GetIO().Fonts = NULL;
+ }
+ ImGui::Shutdown();
+ RestoreState();
+ ImGui::MemFree(m_pState);
+ }
+
+ void PlatformWindow::OnClose()
+ {
+ WindowManager::GetInstance()->OnClosePlatformWindow(this);
+ }
+
+ static bool s_bStatePush = false;
+
+ bool PlatformWindow::IsStateSet()
+ {
+ return s_bStatePush;
+ }
+
+ void PlatformWindow::SetState()
+ {
+ IM_ASSERT(s_bStatePush == false);
+ s_bStatePush = true;
+ m_pPreviousState = ImGui::GetInternalState();
+ ImGui::SetInternalState(m_pState);
+ memcpy(&((ImGuiState*)m_pState)->Style, &((ImGuiState*)m_pPreviousState)->Style, sizeof(ImGuiStyle));
+ }
+
+ void PlatformWindow::RestoreState()
+ {
+ IM_ASSERT(s_bStatePush == true);
+ s_bStatePush = false;
+ memcpy(&((ImGuiState*)m_pPreviousState)->Style, &((ImGuiState*)m_pState)->Style, sizeof(ImGuiStyle));
+ ImGui::SetInternalState(m_pPreviousState);
+ }
+
+ void PlatformWindow::OnLoseFocus()
+ {
+ ImGuiState& g = *((ImGuiState*)m_pState);
+ g.SetNextWindowPosCond = g.SetNextWindowSizeCond = g.SetNextWindowContentSizeCond = g.SetNextWindowCollapsedCond = g.SetNextWindowFocus = 0;
+ }
+
+ void PlatformWindow::Paint()
+ {
+ WindowManager::GetInstance()->Paint(this);
+ }
+
+ bool PlatformWindow::IsMain()
+ {
+ return m_bMain;
+ }
+
+ void PlatformWindow::Dock(Window* pWindow)
+ {
+ m_pContainer->Dock(pWindow);
+ }
+
+ bool PlatformWindow::UnDock(Window* pWindow)
+ {
+ return m_pContainer->UnDock(pWindow);
+ }
+
+ Container* PlatformWindow::GetContainer()
+ {
+ return m_pContainer;
+ }
+
+ Container* PlatformWindow::HasWindow(Window* pWindow)
+ {
+ return m_pContainer->HasWindow(pWindow);
+ }
+
+ void PlatformWindow::PaintContainer()
+ {
+ m_pContainer->Paint();
+ }
+
+ WindowManager::DrawWindowAreaAction::DrawWindowAreaAction(PlatformWindow* pWindow, const ImVec2& oRectPos, const ImVec2& oRectSize, const ImColor& oColor)
+ : m_oColor(oColor)
+ {
+ m_pWindow = pWindow;
+ m_oRectPos = oRectPos;
+ m_oRectSize = oRectSize;
+ }
+
+ WindowManager* WindowManager::s_pInstance = 0;
+
+ //////////////////////////////////////////////////////////////////////////
+
+ WindowManager::Config::Config()
+ : m_fDragMarginRatio(0.1f)
+ , m_fDragMarginSizeRatio(0.25f)
+ , m_oHightlightAreaColor(0.f, 0.5f, 1.f, 0.5f)
+ {
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+
+ WindowManager::WindowManager()
+ {
+ s_pInstance = this;
+ m_pMainPlatformWindow = NULL;
+ m_pDragPlatformWindow = NULL;
+ m_pCurrentPlatformWindow = NULL;
+ m_pDraggedWindow = NULL;
+ m_oDragPreviewOffset = ImVec2(-20, -10);
+ }
+
+ WindowManager::~WindowManager()
+ {
+ IMGUI_DELETE_NULL(PlatformWindow, m_pMainPlatformWindow);
+ IMGUI_DELETE_NULL(PlatformWindow, m_pDragPlatformWindow);
+ s_pInstance = 0;
+ ImGui::Shutdown();
+ }
+
+ bool WindowManager::Init()
+ {
+ m_pMainPlatformWindow = CreatePlatformWindow(true, NULL, false);
+ if (NULL != m_pMainPlatformWindow)
+ {
+ m_pMainPlatformWindow->Show();
+
+ m_pDragPlatformWindow = CreatePlatformWindow(false, m_pMainPlatformWindow, true);
+ return true;
+ }
+ return false;
+ }
+
+ bool WindowManager::Run()
+ {
+ if (m_pMainPlatformWindow != NULL)
+ {
+ ImGuiIO& io = ImGui::GetIO();
+ m_pMainPlatformWindow->SetSize(io.DisplaySize);
+ }
+ InternalRun();
+ return m_pMainPlatformWindow != NULL;
+ }
+
+ void WindowManager::Exit()
+ {
+ //TODO : Manual exit
+ }
+
+ PlatformWindow* WindowManager::GetMainPlatformWindow()
+ {
+ return m_pMainPlatformWindow;
+ }
+
+ WindowManager::Config& WindowManager::GetConfig()
+ {
+ return m_oConfig;
+ }
+
+ void WindowManager::SetMainTitle(const char* pTitle)
+ {
+ if (NULL != m_pMainPlatformWindow)
+ {
+ m_pMainPlatformWindow->SetTitle(pTitle);
+ }
+ }
+
+ void WindowManager::Dock(Window* pWindow, EDockOrientation eOrientation, PlatformWindow* pToPlatformWindow)
+ {
+ DockAction* pAction = IMGUI_NEW(DockAction);
+ pAction->m_bFloat = false;
+ pAction->m_pWindow = pWindow;
+ pAction->m_pWith = NULL;
+ pAction->m_eOrientation = eOrientation;
+ pAction->m_pToPlatformWindow = (pToPlatformWindow != NULL) ? pToPlatformWindow : m_pMainPlatformWindow;
+ pAction->m_pToContainer = NULL;
+ m_lDockActions.push_back(pAction);
+ }
+
+ void WindowManager::DockTo(Window* pWindow, EDockOrientation eOrientation, Container* pContainer)
+ {
+ IM_ASSERT(NULL != pContainer);
+ if (NULL != pContainer)
+ {
+ DockAction* pAction = IMGUI_NEW(DockAction);
+ pAction->m_bFloat = false;
+ pAction->m_pWindow = pWindow;
+ pAction->m_pWith = NULL;
+ pAction->m_eOrientation = eOrientation;
+ pAction->m_pToPlatformWindow = NULL;
+ pAction->m_pToContainer = pContainer;
+ m_lDockActions.push_back(pAction);
+ }
+ }
+
+ void WindowManager::DockWith(Window* pWindow, Window* pWithWindow, EDockOrientation eOrientation)
+ {
+ DockAction* pAction = IMGUI_NEW(DockAction);
+ pAction->m_bFloat = false;
+ pAction->m_pWindow = pWindow;
+ pAction->m_pWith = pWithWindow;
+ pAction->m_eOrientation = eOrientation;
+ m_lDockActions.push_back(pAction);
+ }
+
+ void WindowManager::Float(Window* pWindow, const ImVec2& oPosition, const ImVec2& oSize)
+ {
+ DockAction* pAction = IMGUI_NEW(DockAction);
+ pAction->m_bFloat = true;
+ pAction->m_pWindow = pWindow;
+ pAction->m_oPosition = oPosition;
+ pAction->m_oSize = oSize;
+ m_lDockActions.push_back(pAction);
+ }
+
+ const WindowList& WindowManager::GetWindowList() const
+ {
+ return m_lWindows;
+ }
+
+ PlatformWindow* WindowManager::GetCurrentPlatformWindow()
+ {
+ return m_pCurrentPlatformWindow;
+ }
+
+ PlatformWindow* WindowManager::GetWindowParent(Window* pWindow)
+ {
+ Container* pContainer = m_pMainPlatformWindow->HasWindow(pWindow);
+ if (NULL != pContainer)
+ {
+ return m_pMainPlatformWindow;
+ }
+
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ pContainer = (*it)->HasWindow(pWindow);
+ if (NULL != pContainer)
+ {
+ return *it;
+ }
+ }
+ IM_ASSERT(false);
+ return NULL;
+ }
+
+ void WindowManager::Log(const char* pFormat, ...)
+ {
+ char pBuffer[32768];
+ va_list argptr;
+ va_start(argptr, pFormat);
+ ImFormatStringV(pBuffer, sizeof(char) * 32767, pFormat, argptr);
+ va_end(argptr);
+ LogFormatted(pBuffer);
+ }
+
+ void WindowManager::PreUpdate()
+ {
+ if (NULL != m_pMainPlatformWindow)
+ {
+ m_pMainPlatformWindow->PreUpdate();
+ }
+
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ (*it)->PreUpdate();
+ }
+ }
+
+ void WindowManager::Update()
+ {
+ UpdatePlatformwWindowActions();
+ UpdateDockActions();
+ UpdateOrphans();
+
+ while (m_lToDestroyWindows.begin() != m_lToDestroyWindows.end())
+ {
+ Window* pWindow = *m_lToDestroyWindows.begin();
+
+ m_lToDestroyWindows.remove(pWindow);
+ m_lOrphanWindows.remove(pWindow);
+ m_lWindows.remove(pWindow);
+
+ InternalUnDock(pWindow);
+
+ IMGUI_DELETE(Window, pWindow);
+ }
+
+ while (m_lToDestroyPlatformWindows.begin() != m_lToDestroyPlatformWindows.end())
+ {
+ PlatformWindow* pPlatformWindow = *m_lToDestroyPlatformWindows.begin();
+ m_lToDestroyPlatformWindows.remove(pPlatformWindow);
+ m_lPlatformWindows.remove(pPlatformWindow);
+ IMGUI_DELETE(PlatformWindow, pPlatformWindow);
+ }
+
+ UpdateDragWindow();
+
+ m_pCurrentPlatformWindow = m_pMainPlatformWindow;
+ if (NULL != m_pMainPlatformWindow)
+ {
+ m_pMainPlatformWindow->Paint();
+ }
+
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ m_pCurrentPlatformWindow = (*it);
+ (*it)->Paint();
+ }
+
+ m_pCurrentPlatformWindow = NULL;
+ }
+
+ void WindowManager::UpdatePlatformwWindowActions()
+ {
+ while (m_lPlatformWindowActions.begin() != m_lPlatformWindowActions.end())
+ {
+ PlatformWindowAction* pAction = *m_lPlatformWindowActions.begin();
+
+ IM_ASSERT((pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_SHOW & E_PLATFORM_WINDOW_ACTION_HIDE) == 0); // Can't show and hide
+
+ if (pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_DESTOY)
+ {
+ //pAction->m_pPlatformWindow->Show();
+ //todo destroy
+ bool bFound = false;
+ if (m_pMainPlatformWindow == pAction->m_pPlatformWindow)
+ {
+ while (m_lPlatformWindows.begin() != m_lPlatformWindows.end())
+ {
+ IMGUI_DELETE(PlatformWindow, *m_lPlatformWindows.begin());
+ m_lPlatformWindows.erase(m_lPlatformWindows.begin());
+ }
+ IMGUI_DELETE(PlatformWindow, m_pMainPlatformWindow);
+ m_pMainPlatformWindow = NULL;
+ bFound = true;
+ }
+ else
+ {
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ if (*it == pAction->m_pPlatformWindow)
+ {
+ IMGUI_DELETE(PlatformWindow, *it);
+ m_lPlatformWindows.erase(it);
+ bFound = true;
+ break;
+ }
+ }
+ }
+
+ if (!bFound)
+ {
+ IM_ASSERT(false, "ImwPlatformWindow not found, maybe already closed");
+ }
+ }
+
+ if (pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_SHOW)
+ {
+ pAction->m_pPlatformWindow->Show();
+ }
+
+ if (pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_HIDE)
+ {
+ pAction->m_pPlatformWindow->Hide();
+ }
+
+ if (pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_SET_POSITION)
+ {
+ pAction->m_pPlatformWindow->SetPosition(pAction->m_oPosition);
+ }
+
+ if (pAction->m_iFlags & E_PLATFORM_WINDOW_ACTION_SET_SIZE)
+ {
+ pAction->m_pPlatformWindow->SetSize(pAction->m_oSize);
+ }
+
+ IMGUI_DELETE(PlatformWindowAction, *m_lPlatformWindowActions.begin());
+ m_lPlatformWindowActions.erase(m_lPlatformWindowActions.begin());
+ }
+ }
+
+ void WindowManager::UpdateDockActions()
+ {
+ while (m_lDockActions.begin() != m_lDockActions.end())
+ {
+ DockAction* pAction = *m_lDockActions.begin();
+
+ InternalUnDock(pAction->m_pWindow);
+
+ if (pAction->m_bFloat)
+ {
+ if (!InternalFloat(pAction->m_pWindow, pAction->m_oPosition, pAction->m_oSize) )
+ {
+ InternalDock(pAction->m_pWindow, E_DOCK_ORIENTATION_LEFT, m_pMainPlatformWindow);
+ }
+ }
+ else
+ {
+ if (NULL != pAction->m_pWith)
+ {
+ InternalDockWith(pAction->m_pWindow, pAction->m_pWith, pAction->m_eOrientation);
+ }
+ else if (NULL != pAction->m_pToContainer)
+ {
+ InternalDockTo(pAction->m_pWindow, pAction->m_eOrientation, pAction->m_pToContainer);
+ }
+ else
+ {
+ InternalDock(pAction->m_pWindow, pAction->m_eOrientation, pAction->m_pToPlatformWindow);
+ }
+ }
+
+ m_lOrphanWindows.remove(pAction->m_pWindow);
+
+ IMGUI_DELETE(PlatformWindowAction, pAction);
+ m_lDockActions.erase(m_lDockActions.begin());
+ }
+ }
+
+ void WindowManager::UpdateOrphans()
+ {
+ while (m_lOrphanWindows.begin() != m_lOrphanWindows.end())
+ {
+ if (m_pMainPlatformWindow->m_pContainer->IsEmpty())
+ {
+ InternalDock(*m_lOrphanWindows.begin(), E_DOCK_ORIENTATION_CENTER, m_pMainPlatformWindow);
+ }
+ else
+ {
+ ImVec2 oSize = ImVec2(300, 300);
+ ImVec2 oPos = m_pMainPlatformWindow->GetPosition();
+ ImVec2 oMainSize = m_pMainPlatformWindow->GetSize();
+ oPos.x += (oMainSize.x - oSize.x) / 2;
+ oPos.y += (oMainSize.y - oSize.y) / 2;
+ InternalFloat(*m_lOrphanWindows.begin(), oPos, oSize);
+ }
+ m_lOrphanWindows.erase(m_lOrphanWindows.begin());
+ }
+ }
+
+ void WindowManager::Paint(PlatformWindow* pWindow)
+ {
+ if (!pWindow->GetContainer()->IsEmpty() )
+ {
+ float fY = 0.f;
+
+ ImGui::SetNextWindowPos(ImVec2(0, fY), ImGuiSetCond_Always);
+ ImGui::SetNextWindowSize(ImVec2(pWindow->GetSize().x, pWindow->GetSize().y - fY), ImGuiSetCond_Always);
+ int iFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
+
+ if (NULL != m_pDraggedWindow)
+ {
+ iFlags += ImGuiWindowFlags_NoInputs;
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(5.0f, 5.0f));
+
+ char name[64];
+ ImFormatString(name, sizeof(name), "Window %p", pWindow);
+ ImGui::Begin(name, NULL, iFlags);
+ pWindow->PaintBegin();
+ pWindow->PaintContainer();
+ pWindow->PaintEnd();
+ ImGui::End();
+ ImGui::PopStyleVar(1);
+
+ ImGui::Begin("##Overlay", NULL, ImVec2(0, 0), 0.f, ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize);
+ ImDrawList* pDrawList = ImGui::GetWindowDrawList();
+ for (ImwList<DrawWindowAreaAction>::iterator it = m_lDrawWindowAreas.begin(); it != m_lDrawWindowAreas.end();)
+ {
+ const DrawWindowAreaAction& oAction = *it;
+
+ if (pWindow == oAction.m_pWindow)
+ {
+ ImVec2 oPosA = oAction.m_oRectPos;
+ ImVec2 oPosB = oAction.m_oRectSize;
+ oPosB.x += oPosA.x;
+ oPosB.y += oPosA.y;
+
+ pDrawList->PushClipRectFullScreen();
+ pDrawList->AddRectFilled(oPosA, oPosB, oAction.m_oColor);
+ pDrawList->PopClipRect();
+ ImwList<DrawWindowAreaAction>::iterator toRemove = it;
+ ++it;
+ m_lDrawWindowAreas.erase(toRemove);
+ }
+ else
+ {
+ ++it;
+ }
+ }
+
+ ImGui::End();
+ }
+ }
+
+ static ImVec2 GetCursorPos()
+ {
+ ImGuiIO& io = ImGui::GetIO();
+ return io.MousePos;
+ }
+
+ void WindowManager::StartDragWindow(Window* pWindow)
+ {
+ if (NULL == m_pDraggedWindow)
+ {
+ m_pDraggedWindow = pWindow;
+
+ PlatformWindowAction* pAction = IMGUI_NEW(PlatformWindowAction);
+ pAction->m_pPlatformWindow = m_pDragPlatformWindow;
+ pAction->m_iFlags = E_PLATFORM_WINDOW_ACTION_SHOW | E_PLATFORM_WINDOW_ACTION_SET_POSITION | E_PLATFORM_WINDOW_ACTION_SET_SIZE;
+ ImVec2 oCursorPos = GetCursorPos();
+ pAction->m_oPosition = ImVec2(oCursorPos.x + m_oDragPreviewOffset.x, oCursorPos.y + m_oDragPreviewOffset.y);
+ pAction->m_oSize = ImVec2(pWindow->GetLastSize().x, pWindow->GetLastSize().y);
+ m_lPlatformWindowActions.push_back(pAction);
+
+ Dock(pWindow, E_DOCK_ORIENTATION_CENTER, m_pDragPlatformWindow);
+ ((ImGuiState*)m_pDragPlatformWindow->m_pState)->IO.MouseDown[0] = true;
+ }
+ }
+
+ void WindowManager::StopDragWindow()
+ {
+ PlatformWindowAction* pAction = IMGUI_NEW(PlatformWindowAction);
+ pAction->m_pPlatformWindow = m_pDragPlatformWindow;
+ pAction->m_iFlags = E_PLATFORM_WINDOW_ACTION_HIDE;
+ m_pDragPlatformWindow->Hide();
+ m_lPlatformWindowActions.push_back(pAction);
+ m_pDraggedWindow = NULL;
+ }
+
+ void WindowManager::UpdateDragWindow()
+ {
+ if (NULL != m_pDraggedWindow)
+ {
+ m_pCurrentPlatformWindow = m_pDragPlatformWindow;
+ m_pDragPlatformWindow->Paint();
+ m_pCurrentPlatformWindow = NULL;
+
+ ImVec2 oCursorPos = GetCursorPos();
+ m_pDragPlatformWindow->SetPosition(ImVec2(oCursorPos.x + m_oDragPreviewOffset.x, oCursorPos.y + m_oDragPreviewOffset.y));
+
+ //Search best dock area
+ EDockOrientation eBestDockOrientation;
+ ImVec2 oHightlightPos;
+ ImVec2 oHightlightSize;
+ Container* pBestContainer = GetBestDocking(m_pMainPlatformWindow, oCursorPos, eBestDockOrientation, oHightlightPos, oHightlightSize);
+ if (NULL == pBestContainer)
+ {
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end() && NULL == pBestContainer; ++it)
+ {
+ pBestContainer = GetBestDocking(*it, oCursorPos, eBestDockOrientation, oHightlightPos, oHightlightSize);
+ }
+ }
+ if (pBestContainer)
+ {
+ DrawWindowArea(pBestContainer->GetPlatformWindowParent(), oHightlightPos, oHightlightSize, m_oConfig.m_oHightlightAreaColor);
+ }
+
+ //if (!((ImGuiState*)m_pDragPlatformWindow->m_pState)->IO.MouseDown[0])
+ ImGuiIO& io = ImGui::GetIO();
+ if (!io.MouseDown[0])
+ {
+ if (NULL != pBestContainer)
+ {
+ DockTo(m_pDraggedWindow, eBestDockOrientation, pBestContainer);
+ }
+ else
+ {
+ Float(m_pDraggedWindow, m_pDragPlatformWindow->GetPosition(), m_pDragPlatformWindow->GetSize());
+ }
+
+ StopDragWindow();
+ }
+ }
+ }
+
+ Container* WindowManager::GetBestDocking(PlatformWindow* pPlatformWindow, const ImVec2 oCursorPos, EDockOrientation& oOutOrientation, ImVec2& oOutAreaPos, ImVec2& oOutAreaSize)
+ {
+ ImVec2 oPos = pPlatformWindow->GetPosition();
+ ImVec2 oSize = pPlatformWindow->GetSize();
+ if (oCursorPos.x >= oPos.x && oCursorPos.x <= (oPos.x + oSize.x) &&
+ oCursorPos.y >= oPos.y && oCursorPos.y <= (oPos.y + oSize.y))
+ {
+ ImVec2 oRectPos(oCursorPos.x - oPos.x, oCursorPos.y - oPos.y);
+
+ Container* pBestContainer = pPlatformWindow->GetContainer()->GetBestDocking(oRectPos, oOutOrientation, oOutAreaPos, oOutAreaSize);
+ if (NULL != pBestContainer)
+ {
+ return pBestContainer;
+ }
+
+ //Left
+ if (oRectPos.x <= oSize.x * m_oConfig.m_fDragMarginRatio)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_LEFT;
+ oOutAreaPos = IM_VEC2_0;
+ oOutAreaSize = ImVec2(oSize.x * m_oConfig.m_fDragMarginSizeRatio, oSize.y);
+ }
+ //Right
+ else if (oRectPos.x >= oSize.x * (1.f - m_oConfig.m_fDragMarginRatio))
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_RIGHT;
+ oOutAreaPos = ImVec2(oSize.x * (1.f - m_oConfig.m_fDragMarginSizeRatio), 0.f);
+ oOutAreaSize = ImVec2(oSize.x * m_oConfig.m_fDragMarginSizeRatio, oSize.y);
+ }
+ //Top
+ else if (oRectPos.y <= oSize.y * m_oConfig.m_fDragMarginRatio)
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_TOP;
+ oOutAreaPos = IM_VEC2_0;
+ oOutAreaSize = ImVec2(oSize.x, oSize.y * m_oConfig.m_fDragMarginSizeRatio);
+ }
+ //Bottom
+ else if (oRectPos.y >= oSize.y * (1.f - m_oConfig.m_fDragMarginRatio))
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_BOTTOM;
+ oOutAreaPos = ImVec2(0.f, oSize.y * (1.f - m_oConfig.m_fDragMarginSizeRatio));
+ oOutAreaSize = ImVec2(oSize.x, oSize.y * m_oConfig.m_fDragMarginSizeRatio);
+ }
+ else
+ {
+ oOutOrientation = E_DOCK_ORIENTATION_CENTER;
+ oOutAreaPos = IM_VEC2_0;
+ oOutAreaSize = ImVec2(oSize.x, oSize.y);
+ //IM_ASSERT(false); //Best dock orientation not found
+ return NULL;
+ }
+ return pPlatformWindow->GetContainer();
+ }
+ return NULL;
+ }
+
+ void WindowManager::AddWindow(Window* pWindow)
+ {
+ m_lWindows.push_back(pWindow);
+
+ m_lOrphanWindows.push_back(pWindow);
+ }
+
+ void WindowManager::RemoveWindow(Window* pWindow)
+ {
+ m_lWindows.remove(pWindow);
+ m_lOrphanWindows.remove(pWindow);
+ }
+
+ void WindowManager::DestroyWindow(Window* pWindow)
+ {
+ if (NULL != pWindow && std::find(m_lToDestroyWindows.begin(), m_lToDestroyWindows.end(), pWindow) == m_lToDestroyWindows.end())
+ {
+ m_lToDestroyWindows.push_back(pWindow);
+ }
+ }
+
+ void WindowManager::InternalDock(Window* pWindow, EDockOrientation eOrientation, PlatformWindow* pToPlatformWindow)
+ {
+ pToPlatformWindow->m_pContainer->Dock(pWindow, eOrientation);
+ }
+
+ void WindowManager::InternalDockTo(Window* pWindow, EDockOrientation eOrientation, Container* pToContainer)
+ {
+ pToContainer->Dock(pWindow, eOrientation);
+ }
+
+ void WindowManager::InternalDockWith(Window* pWindow, Window* pWithWindow, EDockOrientation eOrientation)
+ {
+ Container* pContainer = m_pMainPlatformWindow->HasWindow(pWithWindow);
+ if (NULL != pContainer)
+ {
+ pContainer->Dock(pWindow, eOrientation);
+ }
+
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ pContainer = (*it)->HasWindow(pWithWindow);
+ if (NULL != pContainer)
+ {
+ pContainer->Dock(pWindow, eOrientation);
+ break;
+ }
+ }
+ }
+
+ bool WindowManager::InternalFloat(Window* pWindow, ImVec2 oPosition, ImVec2 oSize)
+ {
+ PlatformWindow* pPlatformWindow = CreatePlatformWindow(false, m_pMainPlatformWindow, false);
+ if (NULL == pPlatformWindow)
+ {
+ return false;
+ }
+
+ m_lPlatformWindows.push_back(pPlatformWindow);
+
+ if (oSize.x == IM_VEC2_N1.x && oSize.y == IM_VEC2_N1.y)
+ {
+ oSize = pWindow->GetLastSize();
+ }
+
+ if (oPosition.x == IM_VEC2_N1.x && oPosition.y == IM_VEC2_N1.y)
+ {
+ oPosition = GetCursorPos();
+ oPosition.x -= 20;
+ oPosition.x -= 10;
+ }
+ pPlatformWindow->Dock(pWindow);
+ pPlatformWindow->SetSize(oSize);
+ pPlatformWindow->SetPosition(oPosition);
+ pPlatformWindow->Show();
+
+ return true;
+ }
+
+ void WindowManager::InternalUnDock(Window* pWindow)
+ {
+ if (m_pMainPlatformWindow->UnDock(pWindow))
+ {
+ return;
+ }
+
+ for (PlatformWindowList::iterator it = m_lPlatformWindows.begin(); it != m_lPlatformWindows.end(); ++it)
+ {
+ if ((*it)->UnDock(pWindow))
+ {
+ //Destroy empty platform window if not main window
+ if (!(*it)->IsMain() && (*it)->GetContainer()->IsEmpty())
+ {
+ m_lToDestroyPlatformWindows.push_back(*it);
+ }
+ return;
+ }
+ }
+
+ m_pDragPlatformWindow->UnDock(pWindow);
+ }
+
+ void WindowManager::OnClosePlatformWindow(PlatformWindow* pWindow)
+ {
+ PlatformWindowAction* pAction = IMGUI_NEW(PlatformWindowAction);
+ pAction->m_iFlags = E_PLATFORM_WINDOW_ACTION_DESTOY;
+ pAction->m_pPlatformWindow = pWindow;
+ m_lPlatformWindowActions.push_back(pAction);
+ }
+
+ void WindowManager::DrawWindowArea(PlatformWindow* pWindow, const ImVec2& oPos, const ImVec2& oSize, const ImColor& oColor)
+ {
+ m_lDrawWindowAreas.push_back(DrawWindowAreaAction(pWindow, oPos, oSize, oColor));
+ }
+
+ // Static
+ WindowManager* WindowManager::GetInstance()
+ {
+ return s_pInstance;
+ }
+
+} // namespace ImWindow
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.h
new file mode 100644
index 00000000000..797f4a3f17f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.h
@@ -0,0 +1,310 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+/*
+ * Based on ImWindow code from:
+ * https://github.com/thennequin/ImWindow
+ *
+ * MIT license:
+ * https://github.com/thennequin/ImWindow/blob/master/LICENSE
+ */
+
+#ifndef IMGUI_WM_H_HEADER_GUARD
+#define IMGUI_WM_H_HEADER_GUARD
+
+#include "imgui.h"
+
+typedef unsigned int ImU32;
+
+#ifndef ImwList
+# include <list>
+# define ImwList std::list
+#endif // ImList
+
+#ifndef ImwMap
+# include <unordered_map>
+# define ImwMap std::unordered_map
+#endif // ImMap
+
+namespace ImGuiWM
+{
+ enum EDockOrientation
+ {
+ E_DOCK_ORIENTATION_CENTER,
+ E_DOCK_ORIENTATION_TOP,
+ E_DOCK_ORIENTATION_LEFT,
+ E_DOCK_ORIENTATION_RIGHT,
+ E_DOCK_ORIENTATION_BOTTOM,
+ };
+
+ class Id
+ {
+ public:
+ Id();
+ ImU32 GetId() const;
+ const char* GetStr() const;
+
+ private:
+ ImU32 m_iId;
+ char m_pId[11];
+ static int s_iNextId;
+ };
+
+ class Window
+ {
+ friend class WindowManager;
+ friend class Container;
+
+ public:
+ virtual void OnGui() = 0;
+ virtual void OnMenu() {};
+
+ const char* GetId() const { return m_oId.GetStr(); }
+
+ void Destroy();
+
+ void SetTitle(const char* pTitle);
+ const char* GetTitle() const;
+
+ const ImVec2& GetLastPosition() const;
+ const ImVec2& GetLastSize() const;
+
+ protected:
+ Window();
+ virtual ~Window();
+
+ char* m_pTitle;
+ Id m_oId;
+
+ ImVec2 m_oLastPosition;
+ ImVec2 m_oLastSize;
+ };
+
+ typedef ImwList<Window*> WindowList;
+
+ class PlatformWindow;
+
+ class Container
+ {
+ friend class PlatformWindow;
+
+ public:
+ void Dock(Window* pWindow,EDockOrientation eOrientation = E_DOCK_ORIENTATION_CENTER);
+ bool UnDock(Window* pWindow);
+
+ bool IsEmpty();
+ bool IsSplit();
+ bool HasWindowTabbed();
+ Container* HasWindow(const Window* pWindow);
+ PlatformWindow* GetPlatformWindowParent() const;
+ Container* GetBestDocking(const ImVec2 oCursorPosInContainer,EDockOrientation& oOutOrientation,ImVec2& oOutAreaPos,ImVec2& oOutAreaSize);
+
+ protected:
+ Container(Container* pParent);
+ Container(PlatformWindow* pParent);
+ ~Container();
+
+ void CreateSplits();
+ void Paint();
+
+ Container* m_pParent;
+ PlatformWindow* m_pParentWindow;
+ WindowList m_lWindows;
+ Container* m_pSplits[2];
+
+ float m_fSplitRatio;
+ bool m_bVerticalSplit;
+ int m_iActiveWindow;
+
+ bool m_bIsDrag;
+
+ ImVec2 m_oLastPosition;
+ ImVec2 m_oLastSize;
+ };
+
+ class PlatformWindow
+ {
+ friend class WindowManager;
+
+ public:
+ PlatformWindow(bool bMainWindow,bool bIsDragWindow);
+ virtual ~PlatformWindow();
+
+ virtual bool Init(PlatformWindow* pParent) = 0;
+
+ virtual const ImVec2& GetPosition() const = 0;
+ virtual const ImVec2& GetSize() const = 0;
+
+ virtual void Show() = 0;
+ virtual void Hide() = 0;
+ virtual void SetSize(const ImVec2& size) = 0;
+ virtual void SetPosition(const ImVec2& pos) = 0;
+ virtual void SetTitle(const char* pTitle) = 0;
+
+ bool IsMain();
+
+ void Dock(Window* pWindow);
+ bool UnDock(Window* pWindow);
+
+ Container* GetContainer();
+ Container* HasWindow(Window* pWindow);
+ bool IsStateSet();
+
+ protected:
+ void SetState();
+ void RestoreState();
+ void OnLoseFocus();
+ virtual void PreUpdate() = 0;
+ virtual void PaintBegin() = 0;
+ virtual void Paint();
+ virtual void PaintEnd() = 0;
+ virtual void Destroy() = 0;
+ virtual void StartDrag() = 0;
+ virtual void StopDrag() = 0;
+ virtual bool IsDraging() = 0;
+
+ void PaintContainer();
+ void OnClose();
+
+ Id m_oId;
+ bool m_bMain;
+ bool m_bIsDragWindow;
+ Container* m_pContainer;
+ void* m_pState;
+ void* m_pPreviousState;
+ };
+
+ typedef ImwList<PlatformWindow*> PlatformWindowList;
+
+ class WindowManager
+ {
+ friend class Window;
+ friend class PlatformWindow;
+ friend class Container;
+
+ struct PlatformWindowAction
+ {
+ PlatformWindow* m_pPlatformWindow;
+ unsigned int m_iFlags;
+ ImVec2 m_oPosition;
+ ImVec2 m_oSize;
+ };
+
+ struct DockAction
+ {
+ Window* m_pWindow;
+
+ // Is Dock or Float
+ bool m_bFloat;
+
+ //For Docking
+ Window* m_pWith;
+ EDockOrientation m_eOrientation;
+ PlatformWindow* m_pToPlatformWindow;
+ Container* m_pToContainer;
+
+ //For Floating
+ ImVec2 m_oPosition;
+ ImVec2 m_oSize;
+ };
+
+ struct DrawWindowAreaAction
+ {
+ DrawWindowAreaAction(PlatformWindow* pWindow,const ImVec2& oRectPos,const ImVec2& oRectSize,const ImColor& oColor);
+ PlatformWindow* m_pWindow;
+ ImVec2 m_oRectPos;
+ ImVec2 m_oRectSize;
+ ImColor m_oColor;
+ };
+
+ public:
+ struct Config
+ {
+ Config();
+ float m_fDragMarginRatio;
+ float m_fDragMarginSizeRatio;
+ ImColor m_oHightlightAreaColor;
+ };
+
+ WindowManager();
+ virtual ~WindowManager();
+
+ bool Init();
+ bool Run();
+ void Exit();
+
+ PlatformWindow* GetMainPlatformWindow();
+ Config& GetConfig();
+
+ void SetMainTitle(const char* pTitle);
+
+ void Dock(Window* pWindow, EDockOrientation eOrientation = E_DOCK_ORIENTATION_CENTER, PlatformWindow* pToPlatformWindow = NULL);
+ void DockTo(Window* pWindow, EDockOrientation eOrientation = E_DOCK_ORIENTATION_CENTER, Container* pContainer = NULL);
+ void DockWith(Window* pWindow, Window* pWithWindow,EDockOrientation eOrientation = E_DOCK_ORIENTATION_CENTER);
+ void Float(Window* pWindow, const ImVec2& oPosition = ImVec2(-1,-1), const ImVec2& oSize = ImVec2(-1,-1));
+
+ const WindowList& GetWindowList() const;
+ PlatformWindow* GetCurrentPlatformWindow();
+ PlatformWindow* GetWindowParent(Window* pWindow);
+
+ void Log(const char* pFormat, ...);
+ virtual void LogFormatted(const char* pStr) = 0;;
+
+ static WindowManager* GetInstance();
+
+ protected:
+ virtual PlatformWindow* CreatePlatformWindow(bool bMain,PlatformWindow* pParent,bool bDragWindow) = 0;
+ virtual void InternalRun() = 0;
+
+ void AddWindow(Window* pWindow);
+ void RemoveWindow(Window* pWindow);
+ void DestroyWindow(Window* pWindow);
+
+ void InternalDock(Window* pWindow,EDockOrientation eOrientation,PlatformWindow* pToPlatformWindow);
+ void InternalDockTo(Window* pWindow,EDockOrientation eOrientation,Container* pToContainer);
+ void InternalDockWith(Window* pWindow,Window* pWithWindow,EDockOrientation eOrientation);
+ bool InternalFloat(Window* pWindow,ImVec2 oPosition,ImVec2 oSize);
+ void InternalUnDock(Window* pWindow);
+ void InternalDrag(Window* pWindow);
+
+ void OnClosePlatformWindow(PlatformWindow* pWindow);
+
+ void DrawWindowArea(PlatformWindow* pWindow,const ImVec2& oPos,const ImVec2& oSize,const ImColor& oColor);
+
+ void PreUpdate();
+ void Update();
+ void UpdatePlatformwWindowActions();
+ void UpdateDockActions();
+ void UpdateOrphans();
+
+ void Paint(PlatformWindow* pWindow);
+
+ void StartDragWindow(Window* pWindow);
+ void StopDragWindow();
+ void UpdateDragWindow();
+ Container* GetBestDocking(PlatformWindow* pPlatformWindow,const ImVec2 oCursorPos,EDockOrientation& oOutOrientation,ImVec2& oOutAreaPos,ImVec2& oOutAreaSize);
+
+ Config m_oConfig;
+ PlatformWindow* m_pMainPlatformWindow;
+ PlatformWindowList m_lPlatformWindows;
+ PlatformWindow* m_pDragPlatformWindow;
+ WindowList m_lWindows;
+ WindowList m_lOrphanWindows;
+ WindowList m_lToDestroyWindows;
+ PlatformWindowList m_lToDestroyPlatformWindows;
+ ImwList<PlatformWindowAction*> m_lPlatformWindowActions;
+ ImwList<DockAction*> m_lDockActions;
+ ImwList<DrawWindowAreaAction> m_lDrawWindowAreas;
+
+ PlatformWindow* m_pCurrentPlatformWindow;
+ Window* m_pDraggedWindow;
+
+ ImVec2 m_oDragPreviewOffset;
+
+ static WindowManager* s_pInstance;
+ };
+}
+
+#endif // IMGUI_WM_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/memory_editor.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/memory_editor.h
new file mode 100644
index 00000000000..5409235715f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/memory_editor.h
@@ -0,0 +1,210 @@
+// Mini memory editor for ImGui (to embed in your game/tools)
+// v0.10
+//
+// You can adjust the keyboard repeat delay/rate in ImGuiIO.
+// The code assume a mono-space font for simplicity! If you don't use the default font, use ImGui::PushFont()/PopFont() to switch to a mono-space font before caling this.
+//
+// Usage:
+// static MemoryEditor memory_editor; // save your state somewhere
+// memory_editor.Draw("Memory Editor", mem_block, mem_block_size, (size_t)mem_block); // run
+//
+// TODO: better resizing policy (ImGui doesn't have flexible window resizing constraints yet)
+
+struct MemoryEditor
+{
+ bool Open;
+ bool AllowEdits;
+ int Rows;
+ int DataEditingAddr;
+ bool DataEditingTakeFocus;
+ char DataInput[32];
+ char AddrInput[32];
+
+ MemoryEditor()
+ {
+ Open = true;
+ Rows = 16;
+ DataEditingAddr = -1;
+ DataEditingTakeFocus = false;
+ strcpy(DataInput, "");
+ strcpy(AddrInput, "");
+ AllowEdits = true;
+ }
+
+ void Draw(const char* title, unsigned char* mem_data, int mem_size, size_t base_display_addr = 0)
+ {
+ if (ImGui::Begin(title, &Open))
+ {
+ ImGui::BeginChild("##scrolling", ImVec2(0, -ImGui::GetItemsLineHeightWithSpacing()));
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0));
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
+
+ int addr_digits_count = 0;
+ for (int n = base_display_addr + mem_size - 1; n > 0; n >>= 4)
+ addr_digits_count++;
+
+ float glyph_width = ImGui::CalcTextSize("F").x;
+ float cell_width = glyph_width * 3; // "FF " we include trailing space in the width to easily catch clicks everywhere
+
+ float line_height = ImGui::GetTextLineHeight();
+ int line_total_count = (int)((mem_size + Rows-1) / Rows);
+ ImGuiListClipper clipper(line_total_count, line_height);
+ int visible_start_addr = clipper.DisplayStart * Rows;
+ int visible_end_addr = clipper.DisplayEnd * Rows;
+
+ bool data_next = false;
+
+ if (!AllowEdits || DataEditingAddr >= mem_size)
+ DataEditingAddr = -1;
+
+ int data_editing_addr_backup = DataEditingAddr;
+ if (DataEditingAddr != -1)
+ {
+ if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow)) && DataEditingAddr >= Rows) { DataEditingAddr -= Rows; DataEditingTakeFocus = true; }
+ else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow)) && DataEditingAddr < mem_size - Rows) { DataEditingAddr += Rows; DataEditingTakeFocus = true; }
+ else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_LeftArrow)) && DataEditingAddr > 0) { DataEditingAddr -= 1; DataEditingTakeFocus = true; }
+ else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_RightArrow)) && DataEditingAddr < mem_size - 1) { DataEditingAddr += 1; DataEditingTakeFocus = true; }
+ }
+ if ((DataEditingAddr / Rows) != (data_editing_addr_backup / Rows))
+ {
+ // Track cursor movements
+ float scroll_offset = ((DataEditingAddr / Rows) - (data_editing_addr_backup / Rows)) * line_height;
+ bool scroll_desired = (scroll_offset < 0.0f && DataEditingAddr < visible_start_addr + Rows*2) || (scroll_offset > 0.0f && DataEditingAddr > visible_end_addr - Rows*2);
+ if (scroll_desired)
+ ImGui::SetScrollY(ImGui::GetScrollY() + scroll_offset);
+ }
+
+ bool draw_separator = true;
+ for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible items
+ {
+ int addr = line_i * Rows;
+ ImGui::Text("%0*X: ", addr_digits_count, base_display_addr+addr);
+ ImGui::SameLine();
+
+ // Draw Hexadecimal
+ float line_start_x = ImGui::GetCursorPosX();
+ for (int n = 0; n < Rows && addr < mem_size; n++, addr++)
+ {
+ ImGui::SameLine(line_start_x + cell_width * n);
+
+ if (DataEditingAddr == addr)
+ {
+ // Display text input on current byte
+ ImGui::PushID(addr);
+ struct FuncHolder
+ {
+ // FIXME: We should have a way to retrieve the text edit cursor position more easily in the API, this is rather tedious.
+ static int Callback(ImGuiTextEditCallbackData* data)
+ {
+ int* p_cursor_pos = (int*)data->UserData;
+ if (!data->HasSelection())
+ *p_cursor_pos = data->CursorPos;
+ return 0;
+ }
+ };
+ int cursor_pos = -1;
+ bool data_write = false;
+ if (DataEditingTakeFocus)
+ {
+ ImGui::SetKeyboardFocusHere();
+ sprintf(AddrInput, "%0*X", addr_digits_count, base_display_addr+addr);
+ sprintf(DataInput, "%02X", mem_data[addr]);
+ }
+ ImGui::PushItemWidth(ImGui::CalcTextSize("FF").x);
+ ImGuiInputTextFlags flags = ImGuiInputTextFlags_CharsHexadecimal|ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_AutoSelectAll|ImGuiInputTextFlags_NoHorizontalScroll|ImGuiInputTextFlags_AlwaysInsertMode|ImGuiInputTextFlags_CallbackAlways;
+ if (ImGui::InputText("##data", DataInput, 32, flags, FuncHolder::Callback, &cursor_pos))
+ data_write = data_next = true;
+ else if (!DataEditingTakeFocus && !ImGui::IsItemActive())
+ DataEditingAddr = -1;
+ DataEditingTakeFocus = false;
+ ImGui::PopItemWidth();
+ if (cursor_pos >= 2)
+ data_write = data_next = true;
+ if (data_write)
+ {
+ int data;
+ if (sscanf(DataInput, "%X", &data) == 1)
+ mem_data[addr] = (unsigned char)data;
+ }
+ ImGui::PopID();
+ }
+ else
+ {
+ ImGui::Text("%02X ", mem_data[addr]);
+ if (AllowEdits && ImGui::IsItemHovered() && ImGui::IsMouseClicked(0))
+ {
+ DataEditingTakeFocus = true;
+ DataEditingAddr = addr;
+ }
+ }
+ }
+
+ ImGui::SameLine(line_start_x + cell_width * Rows + glyph_width * 2);
+
+ if (draw_separator)
+ {
+ ImVec2 screen_pos = ImGui::GetCursorScreenPos();
+ ImGui::GetWindowDrawList()->AddLine(ImVec2(screen_pos.x - glyph_width, screen_pos.y - 9999), ImVec2(screen_pos.x - glyph_width, screen_pos.y + 9999), ImColor(ImGui::GetStyle().Colors[ImGuiCol_Border]));
+ draw_separator = false;
+ }
+
+ // Draw ASCII values
+ addr = line_i * Rows;
+ for (int n = 0; n < Rows && addr < mem_size; n++, addr++)
+ {
+ if (n > 0) ImGui::SameLine();
+ int c = mem_data[addr];
+ ImGui::Text("%c", (c >= 32 && c < 128) ? c : '.');
+ }
+ }
+ clipper.End();
+ ImGui::PopStyleVar(2);
+
+ ImGui::EndChild();
+
+ if (data_next && DataEditingAddr < mem_size)
+ {
+ DataEditingAddr = DataEditingAddr + 1;
+ DataEditingTakeFocus = true;
+ }
+
+ ImGui::Separator();
+
+ ImGui::AlignFirstTextHeightToWidgets();
+ ImGui::PushItemWidth(50);
+ ImGui::PushAllowKeyboardFocus(false);
+ int rows_backup = Rows;
+ if (ImGui::DragInt("##rows", &Rows, 0.2f, 4, 32, "%.0f rows"))
+ {
+ ImVec2 new_window_size = ImGui::GetWindowSize();
+ new_window_size.x += (Rows - rows_backup) * (cell_width + glyph_width);
+ ImGui::SetWindowSize(new_window_size);
+ }
+ ImGui::PopAllowKeyboardFocus();
+ ImGui::PopItemWidth();
+ ImGui::SameLine();
+ ImGui::Text("Range %0*X..%0*X", addr_digits_count, (int)base_display_addr, addr_digits_count, (int)base_display_addr+mem_size-1);
+ ImGui::SameLine();
+ ImGui::PushItemWidth(70);
+ if (ImGui::InputText("##addr", AddrInput, 32, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_EnterReturnsTrue))
+ {
+ int goto_addr;
+ if (sscanf(AddrInput, "%X", &goto_addr) == 1)
+ {
+ goto_addr -= base_display_addr;
+ if (goto_addr >= 0 && goto_addr < mem_size)
+ {
+ ImGui::BeginChild("##scrolling");
+ ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + (goto_addr / Rows) * ImGui::GetTextLineHeight());
+ ImGui::EndChild();
+ DataEditingAddr = goto_addr;
+ DataEditingTakeFocus = true;
+ }
+ }
+ }
+ ImGui::PopItemWidth();
+ }
+ ImGui::End();
+ }
+};
diff --git a/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h b/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
index f0df30e4fd1..4666d1e4c5b 100644
--- a/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
+++ b/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
@@ -1,7 +1,7 @@
/******************************************************************************
* The MIT License (MIT)
*
- * Copyright (c) 2014 Crytek
+ * Copyright (c) 2015 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -22,221 +22,494 @@
* THE SOFTWARE.
******************************************************************************/
-
#pragma once
+#if !defined(RENDERDOC_NO_STDINT)
#include <stdint.h>
-
-#ifdef WIN32
-
-#ifdef RENDERDOC_EXPORTS
-#define RENDERDOC_API __declspec(dllexport)
-#else
-#define RENDERDOC_API __declspec(dllimport)
#endif
-#define RENDERDOC_CC __cdecl
+#if defined(WIN32)
+ #define RENDERDOC_CC __cdecl
#elif defined(__linux__)
-
-#ifdef RENDERDOC_EXPORTS
-#define RENDERDOC_API __attribute__ ((visibility ("default")))
+ #define RENDERDOC_CC
#else
-#define RENDERDOC_API
+ #error "Unknown platform"
#endif
-#define RENDERDOC_CC
-
-#else
-
-#error "Unknown platform"
-
+#ifdef __cplusplus
+extern "C" {
#endif
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc capture options
+//
-struct CaptureOptions
+typedef enum
{
- CaptureOptions()
- : AllowVSync(true),
- AllowFullscreen(true),
- DebugDeviceMode(false),
- CaptureCallstacks(false),
- CaptureCallstacksOnlyDraws(false),
- DelayForDebugger(0),
- VerifyMapWrites(false),
- HookIntoChildren(false),
- RefAllResources(false),
- SaveAllInitials(false),
- CaptureAllCmdLists(false)
- {}
-
- // Whether or not to allow the application to enable vsync
- //
- // Enabled - allows the application to enable or disable vsync at will
- // Disabled - vsync is force disabled
- uint32_t AllowVSync;
+ // Allow the application to enable vsync
+ //
+ // Default - enabled
+ //
+ // 1 - The application can enable or disable vsync at will
+ // 0 - vsync is force disabled
+ eRENDERDOC_Option_AllowVSync = 0,
- // Whether or not to allow the application to enable fullscreen
+ // Allow the application to enable fullscreen
//
- // Enabled - allows the application to enable or disable fullscreen at will
- // Disabled - fullscreen is force disabled
- uint32_t AllowFullscreen;
-
- // Enables in-built API debugging features and records the results into the
- // capture logfile, which is matched up with events on replay
- uint32_t DebugDeviceMode;
-
- // Captures callstacks for every API event during capture
- uint32_t CaptureCallstacks;
+ // Default - enabled
+ //
+ // 1 - The application can enable or disable fullscreen at will
+ // 0 - fullscreen is force disabled
+ eRENDERDOC_Option_AllowFullscreen = 1,
- // Only captures callstacks for drawcall type API events.
- // Ignored if CaptureCallstacks is disabled
- uint32_t CaptureCallstacksOnlyDraws;
+ // Record API debugging events and messages
+ //
+ // Default - disabled
+ //
+ // 1 - Enable built-in API debugging features and records the results into
+ // the capture logfile, which is matched up with events on replay
+ // 0 - no API debugging is forcibly enabled
+ eRENDERDOC_Option_DebugDeviceMode = 2,
+
+ // Capture CPU callstacks for API events
+ //
+ // Default - disabled
+ //
+ // 1 - Enables capturing of callstacks
+ // 0 - no callstacks are captured
+ eRENDERDOC_Option_CaptureCallstacks = 3,
+
+ // When capturing CPU callstacks, only capture them from drawcalls.
+ // This option does nothing without the above option being enabled
+ //
+ // Default - disabled
+ //
+ // 1 - Only captures callstacks for drawcall type API events.
+ // Ignored if CaptureCallstacks is disabled
+ // 0 - Callstacks, if enabled, are captured for every event.
+ eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
- // Specify a delay in seconds to wait for a debugger to attach after
+ // Specify a delay in seconds to wait for a debugger to attach, after
// creating or injecting into a process, before continuing to allow it to run.
- uint32_t DelayForDebugger;
-
- // Verify any writes to mapped buffers, to check that they don't overwrite the
- // bounds of the pointer returned.
- uint32_t VerifyMapWrites;
-
- // Hooks any system API events that create child processes, and injects
- // renderdoc into them recursively with the same options.
- uint32_t HookIntoChildren;
-
- // By default renderdoc only includes resources in the final logfile necessary
- // for that frame, this allows you to override that behaviour
//
- // Enabled - all live resources at the time of capture are included in the log
- // and available for inspection
- // Disabled - only the resources referenced by the captured frame are included
- uint32_t RefAllResources;
+ // 0 indicates no delay, and the process will run immediately after injection
+ //
+ // Default - 0 seconds
+ //
+ eRENDERDOC_Option_DelayForDebugger = 5,
+
+ // Verify any writes to mapped buffers, by checking the memory after the
+ // bounds of the returned pointer to detect any modification.
+ //
+ // Default - disabled
+ //
+ // 1 - Verify any writes to mapped buffers
+ // 0 - No verification is performed, and overwriting bounds may cause
+ // crashes or corruption in RenderDoc
+ eRENDERDOC_Option_VerifyMapWrites = 6,
+
+ // Hooks any system API calls that create child processes, and injects
+ // RenderDoc into them recursively with the same options.
+ //
+ // Default - disabled
+ //
+ // 1 - Hooks into spawned child processes
+ // 0 - Child processes are not hooked by RenderDoc
+ eRENDERDOC_Option_HookIntoChildren = 7,
- // By default renderdoc skips saving initial states for
- uint32_t SaveAllInitials;
+ // By default RenderDoc only includes resources in the final logfile necessary
+ // for that frame, this allows you to override that behaviour.
+ //
+ // Default - disabled
+ //
+ // 1 - all live resources at the time of capture are included in the log
+ // and available for inspection
+ // 0 - only the resources referenced by the captured frame are included
+ eRENDERDOC_Option_RefAllResources = 8,
+
+ // By default RenderDoc skips saving initial states for resources where the
+ // previous contents don't appear to be used, assuming that writes before
+ // reads indicate previous contents aren't used.
+ //
+ // Default - disabled
+ //
+ // 1 - initial contents at the start of each captured frame are saved, even if
+ // they are later overwritten or cleared before being used.
+ // 0 - unless a read is detected, initial contents will not be saved and will
+ // appear as black or empty data.
+ eRENDERDOC_Option_SaveAllInitials = 9,
// In APIs that allow for the recording of command lists to be replayed later,
- // renderdoc may choose to not capture command lists before a frame capture is
+ // RenderDoc may choose to not capture command lists before a frame capture is
// triggered, to reduce overheads. This means any command lists recorded once
// and replayed many times will not be available and may cause a failure to
// capture.
//
- // Enabled - All command lists are captured from the start of the application
- // Disabled - Command lists are only captured if their recording begins during
- // the period when a frame capture is in progress.
- uint32_t CaptureAllCmdLists;
-};
+ // Note this is only true for APIs where multithreading is difficult or
+ // discouraged. Newer APIs like Vulkan and D3D12 will ignore this option
+ // and always capture all command lists since the API is heavily oriented
+ // around it and the overheads have been reduced by API design.
+ //
+ // 1 - All command lists are captured from the start of the application
+ // 0 - Command lists are only captured if their recording begins during
+ // the period when a frame capture is in progress.
+ eRENDERDOC_Option_CaptureAllCmdLists = 10,
-enum KeyButton
+ // Mute API debugging output when the debug device mode option is enabled
+ //
+ // Default - enabled
+ //
+ // 1 - Mute any API debug messages from being displayed or passed through
+ // 0 - API debugging is displayed as normal
+ eRENDERDOC_Option_DebugOutputMute = 11,
+
+} RENDERDOC_CaptureOption;
+
+// Sets an option that controls how RenderDoc behaves on capture.
+//
+// Returns 1 if the option and value are valid
+// Returns 0 if either is invalid and the option is unchanged
+typedef int (RENDERDOC_CC *pRENDERDOC_SetCaptureOptionU32)(RENDERDOC_CaptureOption opt, uint32_t val);
+typedef int (RENDERDOC_CC *pRENDERDOC_SetCaptureOptionF32)(RENDERDOC_CaptureOption opt, float val);
+
+// Gets the current value of an option as a uint32_t
+//
+// If the option is invalid, 0xffffffff is returned
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_CaptureOption opt);
+
+// Gets the current value of an option as a float
+//
+// If the option is invalid, -FLT_MAX is returned
+typedef float (RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt);
+
+typedef enum
{
- eKey_0 = 0x30, // '0'
- // ...
- eKey_9 = 0x39, // '9'
- eKey_A = 0x41, // 'A'
- // ...
- eKey_Z = 0x5A, // 'Z'
-
- eKey_Divide,
- eKey_Multiply,
- eKey_Subtract,
- eKey_Plus,
-
- eKey_F1,
- eKey_F2,
- eKey_F3,
- eKey_F4,
- eKey_F5,
- eKey_F6,
- eKey_F7,
- eKey_F8,
- eKey_F9,
- eKey_F10,
- eKey_F11,
- eKey_F12,
-
- eKey_Home,
- eKey_End,
- eKey_Insert,
- eKey_Delete,
- eKey_PageUp,
- eKey_PageDn,
-
- eKey_Backspace,
- eKey_Tab,
- eKey_PrtScrn,
- eKey_Pause,
-
- eKey_Max,
-};
-
-enum InAppOverlay
+ // '0' - '9' matches ASCII values
+ eRENDERDOC_Key_0 = 0x30,
+ eRENDERDOC_Key_1 = 0x31,
+ eRENDERDOC_Key_2 = 0x32,
+ eRENDERDOC_Key_3 = 0x33,
+ eRENDERDOC_Key_4 = 0x34,
+ eRENDERDOC_Key_5 = 0x35,
+ eRENDERDOC_Key_6 = 0x36,
+ eRENDERDOC_Key_7 = 0x37,
+ eRENDERDOC_Key_8 = 0x38,
+ eRENDERDOC_Key_9 = 0x39,
+
+ // 'A' - 'Z' matches ASCII values
+ eRENDERDOC_Key_A = 0x41,
+ eRENDERDOC_Key_B = 0x42,
+ eRENDERDOC_Key_C = 0x43,
+ eRENDERDOC_Key_D = 0x44,
+ eRENDERDOC_Key_E = 0x45,
+ eRENDERDOC_Key_F = 0x46,
+ eRENDERDOC_Key_G = 0x47,
+ eRENDERDOC_Key_H = 0x48,
+ eRENDERDOC_Key_I = 0x49,
+ eRENDERDOC_Key_J = 0x4A,
+ eRENDERDOC_Key_K = 0x4B,
+ eRENDERDOC_Key_L = 0x4C,
+ eRENDERDOC_Key_M = 0x4D,
+ eRENDERDOC_Key_N = 0x4E,
+ eRENDERDOC_Key_O = 0x4F,
+ eRENDERDOC_Key_P = 0x50,
+ eRENDERDOC_Key_Q = 0x51,
+ eRENDERDOC_Key_R = 0x52,
+ eRENDERDOC_Key_S = 0x53,
+ eRENDERDOC_Key_T = 0x54,
+ eRENDERDOC_Key_U = 0x55,
+ eRENDERDOC_Key_V = 0x56,
+ eRENDERDOC_Key_W = 0x57,
+ eRENDERDOC_Key_X = 0x58,
+ eRENDERDOC_Key_Y = 0x59,
+ eRENDERDOC_Key_Z = 0x5A,
+
+ // leave the rest of the ASCII range free
+ // in case we want to use it later
+ eRENDERDOC_Key_NonPrintable = 0x100,
+
+ eRENDERDOC_Key_Divide,
+ eRENDERDOC_Key_Multiply,
+ eRENDERDOC_Key_Subtract,
+ eRENDERDOC_Key_Plus,
+
+ eRENDERDOC_Key_F1,
+ eRENDERDOC_Key_F2,
+ eRENDERDOC_Key_F3,
+ eRENDERDOC_Key_F4,
+ eRENDERDOC_Key_F5,
+ eRENDERDOC_Key_F6,
+ eRENDERDOC_Key_F7,
+ eRENDERDOC_Key_F8,
+ eRENDERDOC_Key_F9,
+ eRENDERDOC_Key_F10,
+ eRENDERDOC_Key_F11,
+ eRENDERDOC_Key_F12,
+
+ eRENDERDOC_Key_Home,
+ eRENDERDOC_Key_End,
+ eRENDERDOC_Key_Insert,
+ eRENDERDOC_Key_Delete,
+ eRENDERDOC_Key_PageUp,
+ eRENDERDOC_Key_PageDn,
+
+ eRENDERDOC_Key_Backspace,
+ eRENDERDOC_Key_Tab,
+ eRENDERDOC_Key_PrtScrn,
+ eRENDERDOC_Key_Pause,
+
+ eRENDERDOC_Key_Max,
+} RENDERDOC_InputButton;
+
+// Sets which key or keys can be used to toggle focus between multiple windows
+//
+// If keys is NULL or num is 0, toggle keys will be disabled
+typedef void (RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton *keys, int num);
+
+// Sets which key or keys can be used to capture the next frame
+//
+// If keys is NULL or num is 0, captures keys will be disabled
+typedef void (RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num);
+
+typedef enum
{
- eOverlay_Enabled = 0x1,
- eOverlay_FrameRate = 0x2,
- eOverlay_FrameNumber = 0x4,
- eOverlay_CaptureList = 0x8,
-
- eOverlay_Default = (eOverlay_Enabled|eOverlay_FrameRate|eOverlay_FrameNumber|eOverlay_CaptureList),
- eOverlay_All = INT32_MAX,
- eOverlay_None = 0,
-};
-
-// API breaking change history:
-// Version 1 -> 2 - strings changed from wchar_t* to char* (UTF-8)
-// Version 2 -> 3 - StartFrameCapture, EndFrameCapture and SetActiveWindow take
-// 'device' pointer as well as window handles.
-// This is either ID3D11Device* or the GL context (HGLRC/GLXContext)
-// You can still pass NULL to both to capture the default, as long as
-// there's only one device/window pair alive.
-#define RENDERDOC_API_VERSION 3
-
-//////////////////////////////////////////////////////////////////////////
-// In-program functions
-//////////////////////////////////////////////////////////////////////////
-
-extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPIVersion();
-typedef int (RENDERDOC_CC *pRENDERDOC_GetAPIVersion)();
+ // This single bit controls whether the overlay is enabled or disabled globally
+ eRENDERDOC_Overlay_Enabled = 0x1,
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_Shutdown();
-typedef void (RENDERDOC_CC *pRENDERDOC_Shutdown)();
+ // Show the average framerate over several seconds as well as min/max
+ eRENDERDOC_Overlay_FrameRate = 0x2,
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetLogFile(const char *logfile);
-typedef void (RENDERDOC_CC *pRENDERDOC_SetLogFile)(const char *logfile);
+ // Show the current frame number
+ eRENDERDOC_Overlay_FrameNumber = 0x4,
-extern "C" RENDERDOC_API const char* RENDERDOC_CC RENDERDOC_GetLogFile();
-typedef const char* (RENDERDOC_CC *pRENDERDOC_GetLogFile)();
+ // Show a list of recent captures, and how many captures have been made
+ eRENDERDOC_Overlay_CaptureList = 0x8,
-extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_GetCapture(uint32_t idx, char *logfile, uint32_t *pathlength, uint64_t *timestamp);
-typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *logfile, uint32_t *pathlength, uint64_t *timestamp);
+ // Default values for the overlay mask
+ eRENDERDOC_Overlay_Default =
+ (eRENDERDOC_Overlay_Enabled|
+ eRENDERDOC_Overlay_FrameRate|
+ eRENDERDOC_Overlay_FrameNumber|
+ eRENDERDOC_Overlay_CaptureList),
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetCaptureOptions(const CaptureOptions *opts);
-typedef void (RENDERDOC_CC *pRENDERDOC_SetCaptureOptions)(const CaptureOptions *opts);
+ // Enable all bits
+ eRENDERDOC_Overlay_All = ~0U,
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetActiveWindow(void *device, void *wndHandle);
-typedef void (RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(void *device, void *wndHandle);
+ // Disable all bits
+ eRENDERDOC_Overlay_None = 0,
+} RENDERDOC_OverlayBits;
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_TriggerCapture();
-typedef void (RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
-
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_StartFrameCapture(void *device, void *wndHandle);
-typedef void (RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(void *device, void *wndHandle);
+// returns the overlay bits that have been set
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
+// sets the overlay bits with an and & or mask
+typedef void (RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
-extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EndFrameCapture(void *device, void *wndHandle);
-typedef uint32_t (RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(void *device, void *wndHandle);
+// this function will attempt to shut down RenderDoc.
+//
+// Note: that this will only work correctly if done immediately after
+// the dll is loaded, before any API work happens. RenderDoc will remove its
+// injected hooks and shut down. Behaviour is undefined if this is called
+// after any API functions have been called.
+typedef void (RENDERDOC_CC *pRENDERDOC_Shutdown)();
-extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_GetOverlayBits();
-typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
+// This function will unload RenderDoc's crash handler.
+//
+// If you use your own crash handler and don't want RenderDoc's handler to
+// intercede, you can call this function to unload it and any unhandled
+// exceptions will pass to the next handler.
+typedef void (RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_MaskOverlayBits(uint32_t And, uint32_t Or);
-typedef void (RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
+// Sets the logfile path template
+//
+// logfile is a UTF-8 string that gives a template for how captures will be named
+// and where they will be saved.
+//
+// Any extension is stripped off the path, and captures are saved in the directory
+// specified, and named with the filename and the frame number appended. If the
+// directory does not exist it will be created, including any parent directories.
+//
+// If pathtemplate is NULL, the template will remain unchanged
+//
+// Example:
+//
+// SetLogFilePathTemplate("my_captures/example");
+//
+// Capture #1 -> my_captures/example_frame123.rdc
+// Capture #2 -> my_captures/example_frame456.rdc
+typedef void (RENDERDOC_CC *pRENDERDOC_SetLogFilePathTemplate)(const char *pathtemplate);
+
+// returns the current logfile template, see SetLogFileTemplate above, as a UTF-8 string
+typedef const char* (RENDERDOC_CC *pRENDERDOC_GetLogFilePathTemplate)();
+
+// returns the number of captures that have been made
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetNumCaptures)();
+
+// This function returns the details of a capture, by index. New captures are added
+// to the end of the list.
+//
+// logfile will be filled with the absolute path to the capture file, as a UTF-8 string
+// pathlength will be written with the length in bytes of the logfile string
+// timestamp will be written with the time of the capture, in seconds since the Unix epoch
+//
+// Any of the parameters can be NULL and they'll be skipped.
+//
+// The function will return 1 if the capture index is valid, or 0 if the index is invalid
+// If the index is invalid, the values will be unchanged
+//
+// Note: when captures are deleted in the UI they will remain in this list, so the
+// logfile path may not exist anymore.
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *logfile, uint32_t *pathlength, uint64_t *timestamp);
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetFocusToggleKeys(KeyButton *keys, int num);
-typedef void (RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(KeyButton *keys, int num);
+// capture the next frame on whichever window and API is currently considered active
+typedef void (RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_SetCaptureKeys(KeyButton *keys, int num);
-typedef void (RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(KeyButton *keys, int num);
+// returns 1 if the RenderDoc UI is connected to this application, 0 otherwise
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_IsRemoteAccessConnected)();
+
+// This function will launch the Replay UI associated with the RenderDoc library injected
+// into the running application.
+//
+// if connectRemoteAccess is 1, the Replay UI will be launched with a command line parameter
+// to connect to this application
+// cmdline is the rest of the command line, as a UTF-8 string. E.g. a captures to open
+// if cmdline is NULL, the command line will be empty.
+//
+// returns the PID of the replay UI if successful, 0 if not successful.
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectRemoteAccess, const char *cmdline);
+
+// RenderDoc can return a higher version than requested if it's backwards compatible,
+// this function returns the actual version returned. If a parameter is NULL, it will be
+// ignored and the others will be filled out.
+typedef void (RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_InitRemoteAccess(uint32_t *ident);
-typedef void (RENDERDOC_CC *pRENDERDOC_InitRemoteAccess)(uint32_t *ident);
+//////////////////////////////////////////////////////////////////////////
+// Capturing functions
+//
+
+// A device pointer is a pointer to the API's root handle.
+//
+// This would be an ID3D11Device, HGLRC/GLXContext, ID3D12Device, etc
+typedef void* RENDERDOC_DevicePointer;
+
+// A window handle is the OS's native window handle
+//
+// This would be an HWND, GLXDrawable, etc
+typedef void* RENDERDOC_WindowHandle;
+
+// This sets the RenderDoc in-app overlay in the API/window pair as 'active' and it will
+// respond to keypresses. Neither parameter can be NULL
+typedef void (RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+// When choosing either a device pointer or a window handle to capture, you can pass NULL.
+// Passing NULL specifies a 'wildcard' match against anything. This allows you to specify
+// any API rendering to a specific window, or a specific API instance rendering to any window,
+// or in the simplest case of one window and one API, you can just pass NULL for both.
+//
+// In either case, if there are two or more possible matching (device,window) pairs it
+// is undefined which one will be captured.
+//
+// Note: for headless rendering you can pass NULL for the window handle and either specify
+// a device pointer or leave it NULL as above.
+
+// Immediately starts capturing API calls on the specified device pointer and window handle.
+//
+// If there is no matching thing to capture (e.g. no supported API has been initialised),
+// this will do nothing.
+//
+// The results are undefined (including crashes) if two captures are started overlapping,
+// even on separate devices and/oror windows.
+typedef void (RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+// Returns whether or not a frame capture is currently ongoing anywhere.
+//
+// This will return 1 if a capture is ongoing, and 0 if there is no capture running
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_IsFrameCapturing)();
+
+// Ends capturing immediately.
+//
+// This will return 1 if the capture succeeded, and 0 if there was an error capturing.
+typedef uint32_t (RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePointer device, RENDERDOC_WindowHandle wndHandle);
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc API versions
+//
+
+// RenderDoc uses semantic versioning (http://semver.org/).
+//
+// MAJOR version is incremented when incompatible API changes happen.
+// MINOR version is incremented when functionality is added in a backwards-compatible manner.
+// PATCH version is incremented when backwards-compatible bug fixes happen.
+//
+// Note that this means the API returned can be higher than the one you might have requested.
+// e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned
+// instead of 1.0.0. You can check this with the GetAPIVersion entry point
+typedef enum
+{
+ eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 000 000
+} RENDERDOC_Version;
-extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_UnloadCrashHandler();
-typedef void (RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
+// eRENDERDOC_API_Version_1_0_0
+typedef struct
+{
+ pRENDERDOC_GetAPIVersion GetAPIVersion;
+
+ pRENDERDOC_SetCaptureOptionU32 SetCaptureOptionU32;
+ pRENDERDOC_SetCaptureOptionF32 SetCaptureOptionF32;
+
+ pRENDERDOC_GetCaptureOptionU32 GetCaptureOptionU32;
+ pRENDERDOC_GetCaptureOptionF32 GetCaptureOptionF32;
+
+ pRENDERDOC_SetFocusToggleKeys SetFocusToggleKeys;
+ pRENDERDOC_SetCaptureKeys SetCaptureKeys;
+
+ pRENDERDOC_GetOverlayBits GetOverlayBits;
+ pRENDERDOC_MaskOverlayBits MaskOverlayBits;
+
+ pRENDERDOC_Shutdown Shutdown;
+ pRENDERDOC_UnloadCrashHandler UnloadCrashHandler;
+
+ pRENDERDOC_SetLogFilePathTemplate SetLogFilePathTemplate;
+ pRENDERDOC_GetLogFilePathTemplate GetLogFilePathTemplate;
+
+ pRENDERDOC_GetNumCaptures GetNumCaptures;
+ pRENDERDOC_GetCapture GetCapture;
+
+ pRENDERDOC_TriggerCapture TriggerCapture;
+
+ pRENDERDOC_IsRemoteAccessConnected IsRemoteAccessConnected;
+ pRENDERDOC_LaunchReplayUI LaunchReplayUI;
+
+ pRENDERDOC_SetActiveWindow SetActiveWindow;
+
+ pRENDERDOC_StartFrameCapture StartFrameCapture;
+ pRENDERDOC_IsFrameCapturing IsFrameCapturing;
+ pRENDERDOC_EndFrameCapture EndFrameCapture;
+} RENDERDOC_API_1_0_0;
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc API entry point
+//
+// This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
+//
+// The name is the same as the typedef - "RENDERDOC_GetAPI"
+//
+// This function is not thread safe, and should not be called on multiple threads at once.
+// Ideally, call this once as early as possible in your application's startup, before doing
+// any API work, since some configuration functionality etc has to be done also before
+// initialising any APIs.
+//
+// Parameters:
+// version is a single value from the RENDERDOC_Version above.
+//
+// outAPIPointers will be filled out with a pointer to the corresponding struct of function
+// pointers.
+//
+// Returns:
+// 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
+// 0 - if the requested version is not supported or the arguments are invalid.
+//
+typedef int (RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/License.txt b/3rdparty/bgfx/3rdparty/scintilla/License.txt
new file mode 100644
index 00000000000..cbe25b2fc2a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/License.txt
@@ -0,0 +1,20 @@
+License for Scintilla and SciTE
+
+Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+
+All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation.
+
+NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
+OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/README b/3rdparty/bgfx/3rdparty/scintilla/README
new file mode 100644
index 00000000000..9980cdcff10
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/README
@@ -0,0 +1,67 @@
+README for building of Scintilla and SciTE
+
+Scintilla can be built by itself.
+To build SciTE, Scintilla must first be built.
+
+
+*** GTK+/Linux version ***
+
+You must first have GTK+ 2.0 or later and GCC (4.1 or better) installed.
+GTK+ 1.x will not work.
+Other C++ compilers may work but may require tweaking the make file.
+
+To build Scintilla, use the makefile located in the scintilla/gtk directory
+ cd scintilla/gtk
+ make
+ cd ../..
+
+To build and install SciTE, use the makefile located in the scite/gtk directory
+ cd scite/gtk
+ make
+ make install
+
+This installs SciTE into $prefix/bin. The value of $prefix is determined from
+the location of Gnome if it is installed. This is usually /usr if installed
+with Linux or /usr/local if built from source. If Gnome is not installed
+/usr/bin is used as the prefix. The prefix can be overridden on the command
+line like "make prefix=/opt" but the same value should be used for both make
+and make install as this location is compiled into the executable. The global
+properties file is installed at $prefix/share/scite/SciTEGlobal.properties.
+The language specific properties files are also installed into this directory.
+
+To remove SciTE
+ make uninstall
+
+To clean the object files which may be needed to change $prefix
+ make clean
+
+The current make file only supports static linking between SciTE and Scintilla.
+
+
+*** Windows version ***
+
+A C++ compiler is required. Visual Studio 2010 is the development system
+used for most development although TDM Mingw32 4.7.1 is also supported.
+
+To build Scintilla, make in the scintilla/win32 directory
+ cd scintilla\win32
+GCC: mingw32-make
+VS .NET: nmake -f scintilla.mak
+ cd ..\..
+
+To build SciTE, use the makefiles located in the scite/win32 directory
+ cd scite\win32
+GCC: mingw32-make
+VS .NET: nmake -f scite.mak
+
+An executable SciTE will now be in scite/bin.
+
+*** GTK+/Windows version ***
+
+Mingw32 is known to work. Other compilers will probably not work.
+
+Only Scintilla will build with GTK+ on Windows. SciTE will not work.
+
+To build Scintilla, make in the scintilla/gtk directory
+ cd scintilla\gtk
+ mingw32-make
diff --git a/3rdparty/bgfx/3rdparty/scintilla/bin/__init__.py b/3rdparty/bgfx/3rdparty/scintilla/bin/__init__.py
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/bin/__init__.py
@@ -0,0 +1 @@
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/bin/empty.txt b/3rdparty/bgfx/3rdparty/scintilla/bin/empty.txt
new file mode 100644
index 00000000000..66183855a57
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/bin/empty.txt
@@ -0,0 +1 @@
+This empty files ensures that the directory is created. \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.h
new file mode 100644
index 00000000000..1ce13953067
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.h
@@ -0,0 +1,55 @@
+
+/**
+ * Scintilla source code edit control
+ * InfoBar.h - Implements special info bar with zoom info, caret position etc. to be used with
+ * ScintillaView.
+ *
+ * Mike Lischke <mlischke@sun.com>
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "InfoBarCommunicator.h"
+
+/**
+ * Extended text cell for vertically aligned text.
+ */
+@interface VerticallyCenteredTextFieldCell : NSTextFieldCell
+{
+ BOOL mIsEditingOrSelecting;
+}
+
+@end
+
+@interface InfoBar : NSView <InfoBarCommunicator>
+{
+@private
+ NSImage* mBackground;
+ IBDisplay mDisplayMask;
+
+ float mScaleFactor;
+ NSPopUpButton* mZoomPopup;
+
+ int mCurrentCaretX;
+ int mCurrentCaretY;
+ NSTextField* mCaretPositionLabel;
+ NSTextField* mStatusTextLabel;
+
+ id <InfoBarCommunicator> mCallback;
+}
+
+- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
+ value: (float) value;
+- (void) setCallback: (id <InfoBarCommunicator>) callback;
+
+- (void) createItems;
+- (void) positionSubViews;
+- (void) setDisplay: (IBDisplay) display;
+- (void) zoomItemAction: (id) sender;
+- (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag;
+- (void) setCaretPosition: (NSPoint) position;
+- (void) sizeToFit;
+
+@end
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.mm b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.mm
new file mode 100644
index 00000000000..01e2ce49c68
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBar.mm
@@ -0,0 +1,448 @@
+
+/**
+ * Scintilla source code edit control
+ * InfoBar.mm - Implements special info bar with zoom info, caret position etc. to be used with
+ * ScintillaView.
+ *
+ * Mike Lischke <mlischke@sun.com>
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import "InfoBar.h"
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation VerticallyCenteredTextFieldCell
+
+// Inspired by code from Daniel Jalkut, Red Sweater Software.
+
+- (NSRect) drawingRectForBounds: (NSRect) theRect
+{
+ // Get the parent's idea of where we should draw
+ NSRect newRect = [super drawingRectForBounds: theRect];
+
+ // When the text field is being edited or selected, we have to turn off the magic because it
+ // screws up the configuration of the field editor. We sneak around this by intercepting
+ // selectWithFrame and editWithFrame and sneaking a reduced, centered rect in at the last minute.
+ if (mIsEditingOrSelecting == NO)
+ {
+ // Get our ideal size for current text
+ NSSize textSize = [self cellSizeForBounds: theRect];
+
+ // Center that in the proposed rect
+ CGFloat heightDelta = newRect.size.height - textSize.height;
+ if (heightDelta > 0)
+ {
+ newRect.size.height -= heightDelta;
+ newRect.origin.y += ceil(heightDelta / 2);
+ }
+ }
+
+ return newRect;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) selectWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj
+ delegate:(id) anObject start: (NSInteger) selStart length: (NSInteger) selLength
+{
+ aRect = [self drawingRectForBounds: aRect];
+ mIsEditingOrSelecting = YES;
+ [super selectWithFrame: aRect
+ inView: controlView
+ editor: textObj
+ delegate: anObject
+ start: selStart
+ length: selLength];
+ mIsEditingOrSelecting = NO;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) editWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj
+ delegate: (id) anObject event: (NSEvent*) theEvent
+{
+ aRect = [self drawingRectForBounds: aRect];
+ mIsEditingOrSelecting = YES;
+ [super editWithFrame: aRect
+ inView: controlView
+ editor: textObj
+ delegate: anObject
+ event: theEvent];
+ mIsEditingOrSelecting = NO;
+}
+
+@end
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation InfoBar
+
+- (id) initWithFrame: (NSRect) frame
+{
+ self = [super initWithFrame: frame];
+ if (self)
+ {
+ NSBundle* bundle = [NSBundle bundleForClass: [InfoBar class]];
+
+ NSString* path = [bundle pathForResource: @"info_bar_bg" ofType: @"tiff" inDirectory: nil];
+ mBackground = [[NSImage alloc] initWithContentsOfFile: path];
+ if (![mBackground isValid])
+ NSLog(@"Background image for info bar is invalid.");
+
+ mScaleFactor = 1.0;
+ mCurrentCaretX = 0;
+ mCurrentCaretY = 0;
+ [self createItems];
+ }
+ return self;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by a connected component (usually the info bar) if something changed there.
+ *
+ * @param type The type of the notification.
+ * @param message Carries the new status message if the type is a status message change.
+ * @param location Carries the new location (e.g. caret) if the type is a caret change or similar type.
+ * @param value Carries the new zoom value if the type is a zoom change.
+ */
+- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
+ value: (float) value
+{
+ switch (type)
+ {
+ case IBNZoomChanged:
+ [self setScaleFactor: value adjustPopup: YES];
+ break;
+ case IBNCaretChanged:
+ [self setCaretPosition: location];
+ break;
+ case IBNStatusChanged:
+ [mStatusTextLabel setStringValue: message];
+ break;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to set a protocol object we can use to send change notifications to.
+ */
+- (void) setCallback: (id <InfoBarCommunicator>) callback
+{
+ mCallback = callback;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+static NSString *DefaultScaleMenuLabels[] = {
+ @"20%", @"30%", @"50%", @"75%", @"100%", @"130%", @"160%", @"200%", @"250%", @"300%"
+};
+static float DefaultScaleMenuFactors[] = {
+ 0.2f, 0.3f, 0.5f, 0.75f, 1.0f, 1.3f, 1.6f, 2.0f, 2.5f, 3.0f
+};
+static unsigned DefaultScaleMenuSelectedItemIndex = 4;
+static float BarFontSize = 10.0;
+
+- (void) createItems
+{
+ // 1) The zoom popup.
+ unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuLabels) / sizeof(NSString *);
+
+ // Create the popup button.
+ mZoomPopup = [[NSPopUpButton allocWithZone:[self zone]] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0) pullsDown: NO];
+
+ // No border or background please.
+ [[mZoomPopup cell] setBordered: NO];
+ [[mZoomPopup cell] setArrowPosition: NSPopUpArrowAtBottom];
+
+ // Fill it.
+ for (unsigned count = 0; count < numberOfDefaultItems; count++)
+ {
+ [mZoomPopup addItemWithTitle: NSLocalizedStringFromTable(DefaultScaleMenuLabels[count], @"ZoomValues", nil)];
+ id currentItem = [mZoomPopup itemAtIndex: count];
+ if (DefaultScaleMenuFactors[count] != 0.0)
+ [currentItem setRepresentedObject: [NSNumber numberWithFloat: DefaultScaleMenuFactors[count]]];
+ }
+ [mZoomPopup selectItemAtIndex: DefaultScaleMenuSelectedItemIndex];
+
+ // Hook it up.
+ [mZoomPopup setTarget: self];
+ [mZoomPopup setAction: @selector(zoomItemAction:)];
+
+ // Set a suitable font.
+ [mZoomPopup setFont: [NSFont menuBarFontOfSize: BarFontSize]];
+
+ // Make sure the popup is big enough to fit the cells.
+ [mZoomPopup sizeToFit];
+
+ // Don't let it become first responder
+ [mZoomPopup setRefusesFirstResponder: YES];
+
+ // put it in the scrollview.
+ [self addSubview: mZoomPopup];
+ [mZoomPopup release];
+
+ // 2) The caret position label.
+ Class oldCellClass = [NSTextField cellClass];
+ [NSTextField setCellClass: [VerticallyCenteredTextFieldCell class]];
+
+ mCaretPositionLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 50.0, 1.0)];
+ [mCaretPositionLabel setBezeled: NO];
+ [mCaretPositionLabel setBordered: NO];
+ [mCaretPositionLabel setEditable: NO];
+ [mCaretPositionLabel setSelectable: NO];
+ [mCaretPositionLabel setDrawsBackground: NO];
+ [mCaretPositionLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]];
+
+ NSTextFieldCell* cell = [mCaretPositionLabel cell];
+ [cell setPlaceholderString: @"0:0"];
+ [cell setAlignment: NSCenterTextAlignment];
+
+ [self addSubview: mCaretPositionLabel];
+ [mCaretPositionLabel release];
+
+ // 3) The status text.
+ mStatusTextLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0)];
+ [mStatusTextLabel setBezeled: NO];
+ [mStatusTextLabel setBordered: NO];
+ [mStatusTextLabel setEditable: NO];
+ [mStatusTextLabel setSelectable: NO];
+ [mStatusTextLabel setDrawsBackground: NO];
+ [mStatusTextLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]];
+
+ cell = [mStatusTextLabel cell];
+ [cell setPlaceholderString: @""];
+
+ [self addSubview: mStatusTextLabel];
+ [mStatusTextLabel release];
+
+ // Restore original cell class so that everything else doesn't get broken
+ [NSTextField setCellClass: oldCellClass];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) dealloc
+{
+ [mBackground release];
+ [super dealloc];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Fill the background.
+ */
+- (void) drawRect: (NSRect) rect
+{
+ // Since the background is seamless, we don't need to take care for the proper offset.
+ // Simply tile the background over the invalid rectangle.
+ NSPoint target = {rect.origin.x, 0};
+ while (target.x < rect.origin.x + rect.size.width)
+ {
+ [mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1];
+ target.x += mBackground.size.width;
+ }
+
+ // Draw separator lines between items.
+ NSRect verticalLineRect;
+ CGFloat component = 190.0 / 255.0;
+ NSColor* lineColor = [NSColor colorWithDeviceRed: component green: component blue: component alpha: 1];
+
+ if (mDisplayMask & IBShowZoom)
+ {
+ verticalLineRect = [mZoomPopup frame];
+ verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
+ verticalLineRect.size.width = 1.0;
+ if (NSIntersectsRect(rect, verticalLineRect))
+ {
+ [lineColor set];
+ NSRectFill(verticalLineRect);
+ }
+ }
+
+ if (mDisplayMask & IBShowCaretPosition)
+ {
+ verticalLineRect = [mCaretPositionLabel frame];
+ verticalLineRect.origin.x += verticalLineRect.size.width + 1.0;
+ verticalLineRect.size.width = 1.0;
+ if (NSIntersectsRect(rect, verticalLineRect))
+ {
+ [lineColor set];
+ NSRectFill(verticalLineRect);
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) isOpaque
+{
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to reposition our content depending on the size of the view.
+ */
+- (void) setFrame: (NSRect) newFrame
+{
+ [super setFrame: newFrame];
+ [self positionSubViews];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) positionSubViews
+{
+ NSRect currentBounds = {{0, 0}, {0, [self frame].size.height}};
+ if (mDisplayMask & IBShowZoom)
+ {
+ [mZoomPopup setHidden: NO];
+ currentBounds.size.width = [mZoomPopup frame].size.width;
+ [mZoomPopup setFrame: currentBounds];
+ currentBounds.origin.x += currentBounds.size.width + 1; // Add 1 for the separator.
+ }
+ else
+ [mZoomPopup setHidden: YES];
+
+ if (mDisplayMask & IBShowCaretPosition)
+ {
+ [mCaretPositionLabel setHidden: NO];
+ currentBounds.size.width = [mCaretPositionLabel frame].size.width;
+ [mCaretPositionLabel setFrame: currentBounds];
+ currentBounds.origin.x += currentBounds.size.width + 1;
+ }
+ else
+ [mCaretPositionLabel setHidden: YES];
+
+ if (mDisplayMask & IBShowStatusText)
+ {
+ // The status text always takes the rest of the available space.
+ [mStatusTextLabel setHidden: NO];
+ currentBounds.size.width = [self frame].size.width - currentBounds.origin.x;
+ [mStatusTextLabel setFrame: currentBounds];
+ }
+ else
+ [mStatusTextLabel setHidden: YES];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to switch the visible parts of the info bar.
+ *
+ * @param display Bitwise ORed IBDisplay values which determine what to show on the bar.
+ */
+- (void) setDisplay: (IBDisplay) display
+{
+ if (mDisplayMask != display)
+ {
+ mDisplayMask = display;
+ [self positionSubViews];
+ [self needsDisplay];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Handler for selection changes in the zoom menu.
+ */
+- (void) zoomItemAction: (id) sender
+{
+ NSNumber* selectedFactorObject = [[sender selectedCell] representedObject];
+
+ if (selectedFactorObject == nil)
+ {
+ NSLog(@"Scale popup action: setting arbitrary zoom factors is not yet supported.");
+ return;
+ }
+ else
+ {
+ [self setScaleFactor: [selectedFactorObject floatValue] adjustPopup: NO];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag
+{
+ if (mScaleFactor != newScaleFactor)
+ {
+ mScaleFactor = newScaleFactor;
+ if (flag)
+ {
+ unsigned count = 0;
+ unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuFactors) / sizeof(float);
+
+ // We only work with some preset zoom values. If the given value does not correspond
+ // to one then show no selection.
+ while (count < numberOfDefaultItems && (fabs(newScaleFactor - DefaultScaleMenuFactors[count]) > 0.07))
+ count++;
+ if (count == numberOfDefaultItems)
+ [mZoomPopup selectItemAtIndex: -1];
+ else
+ {
+ [mZoomPopup selectItemAtIndex: count];
+
+ // Set scale factor to found preset value if it comes close.
+ mScaleFactor = DefaultScaleMenuFactors[count];
+ }
+ }
+ else
+ {
+ // Internally set. Notify owner.
+ [mCallback notify: IBNZoomChanged message: nil location: NSZeroPoint value: newScaleFactor];
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called from the notification method to update the caret position display.
+ */
+- (void) setCaretPosition: (NSPoint) position
+{
+ // Make the position one-based.
+ int newX = (int) position.x + 1;
+ int newY = (int) position.y + 1;
+
+ if (mCurrentCaretX != newX || mCurrentCaretY != newY)
+ {
+ mCurrentCaretX = newX;
+ mCurrentCaretY = newY;
+
+ [mCaretPositionLabel setStringValue: [NSString stringWithFormat: @"%d:%d", newX, newY]];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Makes the bar resize to the smallest width that can accommodate the currently enabled items.
+ */
+- (void) sizeToFit
+{
+ NSRect frame = [self frame];
+ frame.size.width = 0;
+ if (mDisplayMask & IBShowZoom)
+ frame.size.width += [mZoomPopup frame].size.width;
+
+ if (mDisplayMask & IBShowCaretPosition)
+ frame.size.width += [mCaretPositionLabel frame].size.width;
+
+ if (mDisplayMask & IBShowStatusText)
+ frame.size.width += [mStatusTextLabel frame].size.width;
+
+ [self setFrame: frame];
+}
+
+@end
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBarCommunicator.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBarCommunicator.h
new file mode 100644
index 00000000000..382f3bb8edd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/InfoBarCommunicator.h
@@ -0,0 +1,35 @@
+/*
+ * InfoBarCommunicator.h - Definitions of a communication protocol and other data types used for
+ * the info bar implementation.
+ *
+ * Mike Lischke <mlischke@sun.com>
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+typedef NS_OPTIONS(NSUInteger, IBDisplay) {
+ IBShowZoom = 0x01,
+ IBShowCaretPosition = 0x02,
+ IBShowStatusText = 0x04,
+ IBShowAll = 0xFF
+};
+
+/**
+ * The info bar communicator protocol is used for communication between ScintillaView and its
+ * information bar component. Using this protocol decouples any potential info target from the main
+ * ScintillaView implementation. The protocol is used two-way.
+ */
+
+typedef NS_ENUM(NSInteger, NotificationType) {
+ IBNZoomChanged, // The user selected another zoom value.
+ IBNCaretChanged, // The caret in the editor changed.
+ IBNStatusChanged, // The application set a new status message.
+};
+
+@protocol InfoBarCommunicator
+- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
+ value: (float) value;
+- (void) setCallback: (id <InfoBarCommunicator>) callback;
+@end
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.h
new file mode 100644
index 00000000000..60977c92e92
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.h
@@ -0,0 +1,123 @@
+
+/**
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#ifndef PLATCOCOA_H
+#define PLATCOCOA_H
+
+#include <assert.h>
+
+#include <sys/time.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+
+#include <Cocoa/Cocoa.h>
+#include "QuartzTextLayout.h"
+
+#include "Platform.h"
+#include "Scintilla.h"
+
+NSRect PRectangleToNSRect(Scintilla::PRectangle& rc);
+Scintilla::PRectangle NSRectToPRectangle(NSRect& rc);
+CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet);
+
+@interface ScintillaContextMenu : NSMenu
+{
+ Scintilla::ScintillaCocoa* owner;
+}
+- (void) handleCommand: (NSMenuItem*) sender;
+- (void) setOwner: (Scintilla::ScintillaCocoa*) newOwner;
+
+@end
+
+namespace Scintilla {
+
+// A class to do the actual text rendering for us using Quartz 2D.
+class SurfaceImpl : public Surface
+{
+private:
+ bool unicodeMode;
+ float x;
+ float y;
+
+ CGContextRef gc;
+
+ /** The text layout instance */
+ QuartzTextLayout* textLayout;
+ int codePage;
+ int verticalDeviceResolution;
+
+ /** If the surface is a bitmap context, contains a reference to the bitmap data. */
+ uint8_t* bitmapData;
+ /** If the surface is a bitmap context, stores the dimensions of the bitmap. */
+ int bitmapWidth;
+ int bitmapHeight;
+
+ /** Set the CGContext's fill colour to the specified desired colour. */
+ void FillColour( const ColourDesired& back );
+
+
+ // 24-bit RGB+A bitmap data constants
+ static const int BITS_PER_COMPONENT = 8;
+ static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4;
+ static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8;
+public:
+ SurfaceImpl();
+ ~SurfaceImpl();
+
+ void Init(WindowID wid);
+ void Init(SurfaceID sid, WindowID wid);
+ void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
+ CGContextRef GetContext() { return gc; }
+
+ void Release();
+ bool Initialised();
+ void PenColour(ColourDesired fore);
+
+ /** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */
+ CGImageRef GetImage();
+ void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect);
+
+ int LogPixelsY();
+ int DeviceHeightFont(int points);
+ void MoveTo(int x_, int y_);
+ void LineTo(int x_, int y_);
+ void Polygon(Scintilla::Point *pts, int npts, ColourDesired fore, ColourDesired back);
+ void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void FillRectangle(PRectangle rc, ColourDesired back);
+ void FillRectangle(PRectangle rc, Surface &surfacePattern);
+ void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags);
+ void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage);
+ void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource);
+ void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore,
+ ColourDesired back);
+ void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore,
+ ColourDesired back);
+ void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
+ void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
+ XYPOSITION WidthText(Font &font_, const char *s, int len);
+ XYPOSITION WidthChar(Font &font_, char ch);
+ XYPOSITION Ascent(Font &font_);
+ XYPOSITION Descent(Font &font_);
+ XYPOSITION InternalLeading(Font &font_);
+ XYPOSITION ExternalLeading(Font &font_);
+ XYPOSITION Height(Font &font_);
+ XYPOSITION AverageCharWidth(Font &font_);
+
+ void SetClip(PRectangle rc);
+ void FlushCachedState();
+
+ void SetUnicodeMode(bool unicodeMode_);
+ void SetDBCSMode(int codePage_);
+}; // SurfaceImpl class
+
+} // Scintilla namespace
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.mm b/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.mm
new file mode 100644
index 00000000000..02cae162b5b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/PlatCocoa.mm
@@ -0,0 +1,2242 @@
+/**
+ * Scintilla source code edit control
+ * PlatCocoa.mm - implementation of platform facilities on MacOS X/Cocoa
+ *
+ * Written by Mike Lischke
+ * Based on PlatMacOSX.cxx
+ * Based on work by Evan Jones (c) 2002 <ejones@uwaterloo.ca>
+ * Based on PlatGTK.cxx Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#include <assert.h>
+#include <sys/time.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+
+#include <stdexcept>
+#include <vector>
+#include <map>
+
+#import <Foundation/NSGeometry.h>
+
+#import "Platform.h"
+#import "ScintillaView.h"
+#import "ScintillaCocoa.h"
+#import "PlatCocoa.h"
+
+#include "StringCopy.h"
+#include "XPM.h"
+
+using namespace Scintilla;
+
+extern sptr_t scintilla_send_message(void* sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts a PRectangle as used by Scintilla to standard Obj-C NSRect structure .
+ */
+NSRect PRectangleToNSRect(PRectangle& rc)
+{
+ return NSMakeRect(rc.left, rc.top, rc.Width(), rc.Height());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts an NSRect as used by the system to a native Scintilla rectangle.
+ */
+PRectangle NSRectToPRectangle(NSRect& rc)
+{
+ return PRectangle(static_cast<XYPOSITION>(rc.origin.x), static_cast<XYPOSITION>(rc.origin.y),
+ static_cast<XYPOSITION>(NSMaxX(rc)),
+ static_cast<XYPOSITION>(NSMaxY(rc)));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts a PRectangle as used by Scintilla to a Quartz-style rectangle.
+ */
+inline CGRect PRectangleToCGRect(PRectangle& rc)
+{
+ return CGRectMake(rc.left, rc.top, rc.Width(), rc.Height());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts a Quartz-style rectangle to a PRectangle structure as used by Scintilla.
+ */
+inline PRectangle CGRectToPRectangle(const CGRect& rect)
+{
+ PRectangle rc;
+ rc.left = (int)(rect.origin.x + 0.5);
+ rc.top = (int)(rect.origin.y + 0.5);
+ rc.right = (int)(rect.origin.x + rect.size.width + 0.5);
+ rc.bottom = (int)(rect.origin.y + rect.size.height + 0.5);
+ return rc;
+}
+
+//----------------- Point --------------------------------------------------------------------------
+
+/**
+ * Converts a point given as a long into a native Point structure.
+ */
+Scintilla::Point Scintilla::Point::FromLong(long lpoint)
+{
+ return Scintilla::Point(
+ Platform::LowShortFromLong(lpoint),
+ Platform::HighShortFromLong(lpoint)
+ );
+}
+
+//----------------- Font ---------------------------------------------------------------------------
+
+Font::Font(): fid(0)
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+
+Font::~Font()
+{
+ Release();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+static int FontCharacterSet(Font &f) {
+ return reinterpret_cast<QuartzTextStyle *>(f.GetID())->getCharacterSet();
+}
+
+/**
+ * Creates a CTFontRef with the given properties.
+ */
+void Font::Create(const FontParameters &fp)
+{
+ Release();
+
+ QuartzTextStyle* style = new QuartzTextStyle();
+ fid = style;
+
+ // Create the font with attributes
+ QuartzFont font(fp.faceName, strlen(fp.faceName), fp.size, fp.weight, fp.italic);
+ CTFontRef fontRef = font.getFontID();
+ style->setFontRef(fontRef, fp.characterSet);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Font::Release()
+{
+ if (fid)
+ delete reinterpret_cast<QuartzTextStyle*>( fid );
+ fid = 0;
+}
+
+//----------------- SurfaceImpl --------------------------------------------------------------------
+
+SurfaceImpl::SurfaceImpl()
+{
+ unicodeMode = true;
+ x = 0;
+ y = 0;
+ gc = NULL;
+
+ textLayout = new QuartzTextLayout(NULL);
+ codePage = 0;
+ verticalDeviceResolution = 0;
+
+ bitmapData = NULL; // Release will try and delete bitmapData if != NULL
+ bitmapWidth = 0;
+ bitmapHeight = 0;
+
+ Release();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+SurfaceImpl::~SurfaceImpl()
+{
+ Release();
+ delete textLayout;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::Release()
+{
+ textLayout->setContext (NULL);
+ if ( bitmapData != NULL )
+ {
+ delete[] bitmapData;
+ // We only "own" the graphics context if we are a bitmap context
+ if (gc != NULL)
+ CGContextRelease(gc);
+ }
+ bitmapData = NULL;
+ gc = NULL;
+
+ bitmapWidth = 0;
+ bitmapHeight = 0;
+ x = 0;
+ y = 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool SurfaceImpl::Initialised()
+{
+ // We are initalised if the graphics context is not null
+ return gc != NULL;// || port != NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::Init(WindowID)
+{
+ // To be able to draw, the surface must get a CGContext handle. We save the graphics port,
+ // then acquire/release the context on an as-need basis (see above).
+ // XXX Docs on QDBeginCGContext are light, a better way to do this would be good.
+ // AFAIK we should not hold onto a context retrieved this way, thus the need for
+ // acquire/release of the context.
+
+ Release();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::Init(SurfaceID sid, WindowID)
+{
+ Release();
+ gc = reinterpret_cast<CGContextRef>(sid);
+ CGContextSetLineWidth(gc, 1.0);
+ textLayout->setContext(gc);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::InitPixMap(int width, int height, Surface* surface_, WindowID /* wid */)
+{
+ Release();
+
+ // Create a new bitmap context, along with the RAM for the bitmap itself
+ bitmapWidth = width;
+ bitmapHeight = height;
+
+ const int bitmapBytesPerRow = (width * BYTES_PER_PIXEL);
+ const int bitmapByteCount = (bitmapBytesPerRow * height);
+
+ // Create an RGB color space.
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ if (colorSpace == NULL)
+ return;
+
+ // Create the bitmap.
+ bitmapData = new uint8_t[bitmapByteCount];
+ // create the context
+ gc = CGBitmapContextCreate(bitmapData,
+ width,
+ height,
+ BITS_PER_COMPONENT,
+ bitmapBytesPerRow,
+ colorSpace,
+ kCGImageAlphaPremultipliedLast);
+
+ if (gc == NULL)
+ {
+ // the context couldn't be created for some reason,
+ // and we have no use for the bitmap without the context
+ delete[] bitmapData;
+ bitmapData = NULL;
+ }
+ textLayout->setContext (gc);
+
+ // the context retains the color space, so we can release it
+ CGColorSpaceRelease(colorSpace);
+
+ if (gc != NULL && bitmapData != NULL)
+ {
+ // "Erase" to white.
+ CGContextClearRect( gc, CGRectMake( 0, 0, width, height ) );
+ CGContextSetRGBFillColor( gc, 1.0, 1.0, 1.0, 1.0 );
+ CGContextFillRect( gc, CGRectMake( 0, 0, width, height ) );
+ }
+
+ SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface_);
+ unicodeMode = psurfOther->unicodeMode;
+ codePage = psurfOther->codePage;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::PenColour(ColourDesired fore)
+{
+ if (gc)
+ {
+ ColourDesired colour(fore.AsLong());
+
+ // Set the Stroke color to match
+ CGContextSetRGBStrokeColor(gc, colour.GetRed() / 255.0, colour.GetGreen() / 255.0,
+ colour.GetBlue() / 255.0, 1.0 );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::FillColour(const ColourDesired& back)
+{
+ if (gc)
+ {
+ ColourDesired colour(back.AsLong());
+
+ // Set the Fill color to match
+ CGContextSetRGBFillColor(gc, colour.GetRed() / 255.0, colour.GetGreen() / 255.0,
+ colour.GetBlue() / 255.0, 1.0 );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+CGImageRef SurfaceImpl::GetImage()
+{
+ // For now, assume that GetImage can only be called on PixMap surfaces.
+ if (bitmapData == NULL)
+ return NULL;
+
+ CGContextFlush(gc);
+
+ // Create an RGB color space.
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ if( colorSpace == NULL )
+ return NULL;
+
+ const int bitmapBytesPerRow = ((int) bitmapWidth * BYTES_PER_PIXEL);
+ const int bitmapByteCount = (bitmapBytesPerRow * (int) bitmapHeight);
+
+ // Make a copy of the bitmap data for the image creation and divorce it
+ // From the SurfaceImpl lifetime
+ CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, bitmapData, bitmapByteCount);
+
+ // Create a data provider.
+ CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(dataRef);
+
+ CGImageRef image = NULL;
+ if (dataProvider != NULL)
+ {
+ // Create the CGImage.
+ image = CGImageCreate(bitmapWidth,
+ bitmapHeight,
+ BITS_PER_COMPONENT,
+ BITS_PER_PIXEL,
+ bitmapBytesPerRow,
+ colorSpace,
+ kCGImageAlphaPremultipliedLast,
+ dataProvider,
+ NULL,
+ 0,
+ kCGRenderingIntentDefault);
+ }
+
+ // The image retains the color space, so we can release it.
+ CGColorSpaceRelease(colorSpace);
+ colorSpace = NULL;
+
+ // Done with the data provider.
+ CGDataProviderRelease(dataProvider);
+ dataProvider = NULL;
+
+ // Done with the data provider.
+ CFRelease(dataRef);
+
+ return image;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Returns the vertical logical device resolution of the main monitor.
+ * This is no longer called.
+ * For Cocoa, all screens are treated as 72 DPI, even retina displays.
+ */
+int SurfaceImpl::LogPixelsY()
+{
+ return 72;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts the logical font height in points into a device height.
+ * For Cocoa, points are always used for the result even on retina displays.
+ */
+int SurfaceImpl::DeviceHeightFont(int points)
+{
+ return points;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::MoveTo(int x_, int y_)
+{
+ x = x_;
+ y = y_;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::LineTo(int x_, int y_)
+{
+ CGContextBeginPath( gc );
+
+ // Because Quartz is based on floating point, lines are drawn with half their colour
+ // on each side of the line. Integer coordinates specify the INTERSECTION of the pixel
+ // division lines. If you specify exact pixel values, you get a line that
+ // is twice as thick but half as intense. To get pixel aligned rendering,
+ // we render the "middle" of the pixels by adding 0.5 to the coordinates.
+ CGContextMoveToPoint( gc, x + 0.5, y + 0.5 );
+ CGContextAddLineToPoint( gc, x_ + 0.5, y_ + 0.5 );
+ CGContextStrokePath( gc );
+ x = x_;
+ y = y_;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::Polygon(Scintilla::Point *pts, int npts, ColourDesired fore,
+ ColourDesired back)
+{
+ // Allocate memory for the array of points.
+ std::vector<CGPoint> points(npts);
+
+ for (int i = 0;i < npts;i++)
+ {
+ // Quartz floating point issues: plot the MIDDLE of the pixels
+ points[i].x = pts[i].x + 0.5;
+ points[i].y = pts[i].y + 0.5;
+ }
+
+ CGContextBeginPath(gc);
+
+ // Set colours
+ FillColour(back);
+ PenColour(fore);
+
+ // Draw the polygon
+ CGContextAddLines(gc, points.data(), npts);
+
+ // Explicitly close the path, so it is closed for stroking AND filling (implicit close = filling only)
+ CGContextClosePath( gc );
+ CGContextDrawPath( gc, kCGPathFillStroke );
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)
+{
+ if (gc)
+ {
+ CGContextBeginPath( gc );
+ FillColour(back);
+ PenColour(fore);
+
+ // Quartz integer -> float point conversion fun (see comment in SurfaceImpl::LineTo)
+ // We subtract 1 from the Width() and Height() so that all our drawing is within the area defined
+ // by the PRectangle. Otherwise, we draw one pixel too far to the right and bottom.
+ CGContextAddRect( gc, CGRectMake( rc.left + 0.5, rc.top + 0.5, rc.Width() - 1, rc.Height() - 1 ) );
+ CGContextDrawPath( gc, kCGPathFillStroke );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back)
+{
+ if (gc)
+ {
+ FillColour(back);
+ // Snap rectangle boundaries to nearest int
+ rc.left = lround(rc.left);
+ rc.right = lround(rc.right);
+ CGRect rect = PRectangleToCGRect(rc);
+ CGContextFillRect(gc, rect);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void drawImageRefCallback(CGImageRef pattern, CGContextRef gc)
+{
+ CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void releaseImageRefCallback(CGImageRef pattern)
+{
+ CGImageRelease(pattern);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern)
+{
+ SurfaceImpl& patternSurface = static_cast<SurfaceImpl &>(surfacePattern);
+
+ // For now, assume that copy can only be called on PixMap surfaces. Shows up black.
+ CGImageRef image = patternSurface.GetImage();
+ if (image == NULL)
+ {
+ FillRectangle(rc, ColourDesired(0));
+ return;
+ }
+
+ const CGPatternCallbacks drawImageCallbacks = { 0,
+ reinterpret_cast<CGPatternDrawPatternCallback>(drawImageRefCallback),
+ reinterpret_cast<CGPatternReleaseInfoCallback>(releaseImageRefCallback) };
+
+ CGPatternRef pattern = CGPatternCreate(image,
+ CGRectMake(0, 0, patternSurface.bitmapWidth, patternSurface.bitmapHeight),
+ CGAffineTransformIdentity,
+ patternSurface.bitmapWidth,
+ patternSurface.bitmapHeight,
+ kCGPatternTilingNoDistortion,
+ true,
+ &drawImageCallbacks
+ );
+ if (pattern != NULL)
+ {
+ // Create a pattern color space
+ CGColorSpaceRef colorSpace = CGColorSpaceCreatePattern( NULL );
+ if( colorSpace != NULL ) {
+
+ CGContextSaveGState( gc );
+ CGContextSetFillColorSpace( gc, colorSpace );
+
+ // Unlike the documentation, you MUST pass in a "components" parameter:
+ // For coloured patterns it is the alpha value.
+ const CGFloat alpha = 1.0;
+ CGContextSetFillPattern( gc, pattern, &alpha );
+ CGContextFillRect( gc, PRectangleToCGRect( rc ) );
+ CGContextRestoreGState( gc );
+ // Free the color space, the pattern and image
+ CGColorSpaceRelease( colorSpace );
+ } /* colorSpace != NULL */
+ colorSpace = NULL;
+ CGPatternRelease( pattern );
+ pattern = NULL;
+ } /* pattern != NULL */
+}
+
+void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ // This is only called from the margin marker drawing code for SC_MARK_ROUNDRECT
+ // The Win32 version does
+ // ::RoundRect(hdc, rc.left + 1, rc.top, rc.right - 1, rc.bottom, 8, 8 );
+ // which is a rectangle with rounded corners each having a radius of 4 pixels.
+ // It would be almost as good just cutting off the corners with lines at
+ // 45 degrees as is done on GTK+.
+
+ // Create a rectangle with semicircles at the corners
+ const int MAX_RADIUS = 4;
+ const int radius = std::min(MAX_RADIUS, static_cast<int>(std::min(rc.Height()/2, rc.Width()/2)));
+
+ // Points go clockwise, starting from just below the top left
+ // Corners are kept together, so we can easily create arcs to connect them
+ CGPoint corners[4][3] =
+ {
+ {
+ { rc.left, rc.top + radius },
+ { rc.left, rc.top },
+ { rc.left + radius, rc.top },
+ },
+ {
+ { rc.right - radius - 1, rc.top },
+ { rc.right - 1, rc.top },
+ { rc.right - 1, rc.top + radius },
+ },
+ {
+ { rc.right - 1, rc.bottom - radius - 1 },
+ { rc.right - 1, rc.bottom - 1 },
+ { rc.right - radius - 1, rc.bottom - 1 },
+ },
+ {
+ { rc.left + radius, rc.bottom - 1 },
+ { rc.left, rc.bottom - 1 },
+ { rc.left, rc.bottom - radius - 1 },
+ },
+ };
+
+ // Align the points in the middle of the pixels
+ for( int i = 0; i < 4; ++ i )
+ {
+ for( int j = 0; j < 3; ++ j )
+ {
+ corners[i][j].x += 0.5;
+ corners[i][j].y += 0.5;
+ }
+ }
+
+ PenColour( fore );
+ FillColour( back );
+
+ // Move to the last point to begin the path
+ CGContextBeginPath( gc );
+ CGContextMoveToPoint( gc, corners[3][2].x, corners[3][2].y );
+
+ for ( int i = 0; i < 4; ++ i )
+ {
+ CGContextAddLineToPoint( gc, corners[i][0].x, corners[i][0].y );
+ CGContextAddArcToPoint( gc, corners[i][1].x, corners[i][1].y, corners[i][2].x, corners[i][2].y, radius );
+ }
+
+ // Close the path to enclose it for stroking and for filling, then draw it
+ CGContextClosePath( gc );
+ CGContextDrawPath( gc, kCGPathFillStroke );
+}
+
+// DrawChamferedRectangle is a helper function for AlphaRectangle that either fills or strokes a
+// rectangle with its corners chamfered at 45 degrees.
+static void DrawChamferedRectangle(CGContextRef gc, PRectangle rc, int cornerSize, CGPathDrawingMode mode) {
+ // Points go clockwise, starting from just below the top left
+ CGPoint corners[4][2] =
+ {
+ {
+ { rc.left, rc.top + cornerSize },
+ { rc.left + cornerSize, rc.top },
+ },
+ {
+ { rc.right - cornerSize - 1, rc.top },
+ { rc.right - 1, rc.top + cornerSize },
+ },
+ {
+ { rc.right - 1, rc.bottom - cornerSize - 1 },
+ { rc.right - cornerSize - 1, rc.bottom - 1 },
+ },
+ {
+ { rc.left + cornerSize, rc.bottom - 1 },
+ { rc.left, rc.bottom - cornerSize - 1 },
+ },
+ };
+
+ // Align the points in the middle of the pixels
+ for( int i = 0; i < 4; ++ i )
+ {
+ for( int j = 0; j < 2; ++ j )
+ {
+ corners[i][j].x += 0.5;
+ corners[i][j].y += 0.5;
+ }
+ }
+
+ // Move to the last point to begin the path
+ CGContextBeginPath( gc );
+ CGContextMoveToPoint( gc, corners[3][1].x, corners[3][1].y );
+
+ for ( int i = 0; i < 4; ++ i )
+ {
+ CGContextAddLineToPoint( gc, corners[i][0].x, corners[i][0].y );
+ CGContextAddLineToPoint( gc, corners[i][1].x, corners[i][1].y );
+ }
+
+ // Close the path to enclose it for stroking and for filling, then draw it
+ CGContextClosePath( gc );
+ CGContextDrawPath( gc, mode );
+}
+
+void Scintilla::SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int /*flags*/)
+{
+ if ( gc ) {
+ // Snap rectangle boundaries to nearest int
+ rc.left = lround(rc.left);
+ rc.right = lround(rc.right);
+ // Set the Fill color to match
+ CGContextSetRGBFillColor( gc, fill.GetRed() / 255.0, fill.GetGreen() / 255.0, fill.GetBlue() / 255.0, alphaFill / 255.0 );
+ CGContextSetRGBStrokeColor( gc, outline.GetRed() / 255.0, outline.GetGreen() / 255.0, outline.GetBlue() / 255.0, alphaOutline / 255.0 );
+ PRectangle rcFill = rc;
+ if (cornerSize == 0) {
+ // A simple rectangle, no rounded corners
+ if ((fill == outline) && (alphaFill == alphaOutline)) {
+ // Optimization for simple case
+ CGRect rect = PRectangleToCGRect( rcFill );
+ CGContextFillRect( gc, rect );
+ } else {
+ rcFill.left += 1.0;
+ rcFill.top += 1.0;
+ rcFill.right -= 1.0;
+ rcFill.bottom -= 1.0;
+ CGRect rect = PRectangleToCGRect( rcFill );
+ CGContextFillRect( gc, rect );
+ CGContextAddRect( gc, CGRectMake( rc.left + 0.5, rc.top + 0.5, rc.Width() - 1, rc.Height() - 1 ) );
+ CGContextStrokePath( gc );
+ }
+ } else {
+ // Approximate rounded corners with 45 degree chamfers.
+ // Drawing real circular arcs often leaves some over- or under-drawn pixels.
+ if ((fill == outline) && (alphaFill == alphaOutline)) {
+ // Specializing this case avoids a few stray light/dark pixels in corners.
+ rcFill.left -= 0.5;
+ rcFill.top -= 0.5;
+ rcFill.right += 0.5;
+ rcFill.bottom += 0.5;
+ DrawChamferedRectangle( gc, rcFill, cornerSize, kCGPathFill );
+ } else {
+ rcFill.left += 0.5;
+ rcFill.top += 0.5;
+ rcFill.right -= 0.5;
+ rcFill.bottom -= 0.5;
+ DrawChamferedRectangle( gc, rcFill, cornerSize-1, kCGPathFill );
+ DrawChamferedRectangle( gc, rc, cornerSize, kCGPathStroke );
+ }
+ }
+ }
+}
+
+static void ProviderReleaseData(void *, const void *data, size_t) {
+ const unsigned char *pixels = reinterpret_cast<const unsigned char *>(data);
+ delete []pixels;
+}
+
+static CGImageRef ImageCreateFromRGBA(int width, int height, const unsigned char *pixelsImage, bool invert) {
+ CGImageRef image = 0;
+
+ // Create an RGB color space.
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ if (colorSpace) {
+ const int bitmapBytesPerRow = ((int) width * 4);
+ const int bitmapByteCount = (bitmapBytesPerRow * (int) height);
+
+ // Create a data provider.
+ CGDataProviderRef dataProvider = 0;
+ if (invert) {
+ unsigned char *pixelsUpsideDown = new unsigned char[bitmapByteCount];
+
+ for (int y=0; y<height; y++) {
+ int yInverse = height - y - 1;
+ memcpy(pixelsUpsideDown + y * bitmapBytesPerRow,
+ pixelsImage + yInverse * bitmapBytesPerRow,
+ bitmapBytesPerRow);
+ }
+
+ dataProvider = CGDataProviderCreateWithData(
+ NULL, pixelsUpsideDown, bitmapByteCount, ProviderReleaseData);
+ } else {
+ dataProvider = CGDataProviderCreateWithData(
+ NULL, pixelsImage, bitmapByteCount, NULL);
+
+ }
+ if (dataProvider) {
+ // Create the CGImage.
+ image = CGImageCreate(width,
+ height,
+ 8,
+ 8 * 4,
+ bitmapBytesPerRow,
+ colorSpace,
+ kCGImageAlphaLast,
+ dataProvider,
+ NULL,
+ 0,
+ kCGRenderingIntentDefault);
+
+ CGDataProviderRelease(dataProvider);
+ }
+
+ // The image retains the color space, so we can release it.
+ CGColorSpaceRelease(colorSpace);
+ }
+ return image;
+}
+
+void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) {
+ CGImageRef image = ImageCreateFromRGBA(width, height, pixelsImage, true);
+ if (image) {
+ CGRect drawRect = CGRectMake(rc.left, rc.top, rc.Width(), rc.Height());
+ CGContextDrawImage(gc, drawRect, image);
+ CGImageRelease(image);
+ }
+}
+
+void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ CGRect ellipseRect = CGRectMake(rc.left, rc.top, rc.Width(), rc.Height());
+ FillColour(back);
+ PenColour(fore);
+ CGContextBeginPath(gc);
+ CGContextAddEllipseInRect(gc, ellipseRect);
+ CGContextDrawPath(gc, kCGPathFillStroke);
+}
+
+void SurfaceImpl::CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect)
+{
+ SurfaceImpl& source = static_cast<SurfaceImpl &>(surfaceSource);
+ CGImageRef image = source.GetImage();
+
+ CGRect src = PRectangleToCGRect(srcRect);
+ CGRect dst = PRectangleToCGRect(dstRect);
+
+ /* source from QuickDrawToQuartz2D.pdf on developer.apple.com */
+ float w = (float) CGImageGetWidth(image);
+ float h = (float) CGImageGetHeight(image);
+ CGRect drawRect = CGRectMake (0, 0, w, h);
+ if (!CGRectEqualToRect (src, dst))
+ {
+ CGFloat sx = CGRectGetWidth(dst) / CGRectGetWidth(src);
+ CGFloat sy = CGRectGetHeight(dst) / CGRectGetHeight(src);
+ CGFloat dx = CGRectGetMinX(dst) - (CGRectGetMinX(src) * sx);
+ CGFloat dy = CGRectGetMinY(dst) - (CGRectGetMinY(src) * sy);
+ drawRect = CGRectMake (dx, dy, w*sx, h*sy);
+ }
+ CGContextSaveGState (gc);
+ CGContextClipToRect (gc, dst);
+ CGContextDrawImage (gc, drawRect, image);
+ CGContextRestoreGState (gc);
+ CGImageRelease(image);
+}
+
+void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource) {
+ // Maybe we have to make the Surface two contexts:
+ // a bitmap context which we do all the drawing on, and then a "real" context
+ // which we copy the output to when we call "Synchronize". Ugh! Gross and slow!
+
+ // For now, assume that copy can only be called on PixMap surfaces
+ SurfaceImpl& source = static_cast<SurfaceImpl &>(surfaceSource);
+
+ // Get the CGImageRef
+ CGImageRef image = source.GetImage();
+ // If we could not get an image reference, fill the rectangle black
+ if ( image == NULL )
+ {
+ FillRectangle( rc, ColourDesired( 0 ) );
+ return;
+ }
+
+ // Now draw the image on the surface
+
+ // Some fancy clipping work is required here: draw only inside of rc
+ CGContextSaveGState( gc );
+ CGContextClipToRect( gc, PRectangleToCGRect( rc ) );
+
+ //Platform::DebugPrintf(stderr, "Copy: CGContextDrawImage: (%d, %d) - (%d X %d)\n", rc.left - from.x, rc.top - from.y, source.bitmapWidth, source.bitmapHeight );
+ CGContextDrawImage( gc, CGRectMake( rc.left - from.x, rc.top - from.y, source.bitmapWidth, source.bitmapHeight ), image );
+
+ // Undo the clipping fun
+ CGContextRestoreGState( gc );
+
+ // Done with the image
+ CGImageRelease( image );
+ image = NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back)
+{
+ FillRectangle(rc, back);
+ DrawTextTransparent(rc, font_, ybase, s, len, fore);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back)
+{
+ CGContextSaveGState(gc);
+ CGContextClipToRect(gc, PRectangleToCGRect(rc));
+ DrawTextNoClip(rc, font_, ybase, s, len, fore, back);
+ CGContextRestoreGState(gc);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet)
+{
+ if (unicode)
+ return kCFStringEncodingUTF8;
+
+ // Unsupported -> Latin1 as reasonably safe
+ enum { notSupported = kCFStringEncodingISOLatin1};
+
+ switch (characterSet)
+ {
+ case SC_CHARSET_ANSI:
+ return kCFStringEncodingISOLatin1;
+ case SC_CHARSET_DEFAULT:
+ return kCFStringEncodingISOLatin1;
+ case SC_CHARSET_BALTIC:
+ return kCFStringEncodingWindowsBalticRim;
+ case SC_CHARSET_CHINESEBIG5:
+ return kCFStringEncodingBig5;
+ case SC_CHARSET_EASTEUROPE:
+ return kCFStringEncodingWindowsLatin2;
+ case SC_CHARSET_GB2312:
+ return kCFStringEncodingGB_18030_2000;
+ case SC_CHARSET_GREEK:
+ return kCFStringEncodingWindowsGreek;
+ case SC_CHARSET_HANGUL:
+ return kCFStringEncodingEUC_KR;
+ case SC_CHARSET_MAC:
+ return kCFStringEncodingMacRoman;
+ case SC_CHARSET_OEM:
+ return kCFStringEncodingISOLatin1;
+ case SC_CHARSET_RUSSIAN:
+ return kCFStringEncodingKOI8_R;
+ case SC_CHARSET_CYRILLIC:
+ return kCFStringEncodingWindowsCyrillic;
+ case SC_CHARSET_SHIFTJIS:
+ return kCFStringEncodingShiftJIS;
+ case SC_CHARSET_SYMBOL:
+ return kCFStringEncodingMacSymbol;
+ case SC_CHARSET_TURKISH:
+ return kCFStringEncodingWindowsLatin5;
+ case SC_CHARSET_JOHAB:
+ return kCFStringEncodingWindowsKoreanJohab;
+ case SC_CHARSET_HEBREW:
+ return kCFStringEncodingWindowsHebrew;
+ case SC_CHARSET_ARABIC:
+ return kCFStringEncodingWindowsArabic;
+ case SC_CHARSET_VIETNAMESE:
+ return kCFStringEncodingWindowsVietnamese;
+ case SC_CHARSET_THAI:
+ return kCFStringEncodingISOLatinThai;
+ case SC_CHARSET_8859_15:
+ return kCFStringEncodingISOLatin1;
+ default:
+ return notSupported;
+ }
+}
+
+void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore)
+{
+ CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_));
+ ColourDesired colour(fore.AsLong());
+ CGColorRef color = CGColorCreateGenericRGB(colour.GetRed()/255.0,colour.GetGreen()/255.0,colour.GetBlue()/255.0,1.0);
+
+ QuartzTextStyle* style = reinterpret_cast<QuartzTextStyle*>(font_.GetID());
+ style->setCTStyleColor(color);
+
+ CGColorRelease(color);
+
+ textLayout->setText (reinterpret_cast<const UInt8*>(s), len, encoding, *reinterpret_cast<QuartzTextStyle*>(font_.GetID()));
+ textLayout->draw(rc.left, ybase);
+}
+
+static size_t utf8LengthFromLead(unsigned char uch) {
+ if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) {
+ return 4;
+ } else if (uch >= (0x80 + 0x40 + 0x20)) {
+ return 3;
+ } else if (uch >= (0x80)) {
+ return 2;
+ } else {
+ return 1;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)
+{
+ CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_));
+ textLayout->setText (reinterpret_cast<const UInt8*>(s), len, encoding, *reinterpret_cast<QuartzTextStyle*>(font_.GetID()));
+
+ CTLineRef mLine = textLayout->getCTLine();
+ assert(mLine != NULL);
+
+ if (unicodeMode) {
+ // Map the widths given for UTF-16 characters back onto the UTF-8 input string
+ CFIndex fit = textLayout->getStringLength();
+ int ui=0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ int i=0;
+ while (ui<fit) {
+ size_t lenChar = utf8LengthFromLead(us[i]);
+ size_t codeUnits = (lenChar < 4) ? 1 : 2;
+ CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+codeUnits, NULL);
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = static_cast<XYPOSITION>(xPosition);
+ }
+ ui += codeUnits;
+ }
+ XYPOSITION lastPos = 0.0f;
+ if (i > 0)
+ lastPos = positions[i-1];
+ while (i<len) {
+ positions[i++] = lastPos;
+ }
+ } else if (codePage) {
+ int ui = 0;
+ for (int i=0;i<len;) {
+ size_t lenChar = Platform::IsDBCSLeadByte(codePage, s[i]) ? 2 : 1;
+ CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+1, NULL);
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = static_cast<XYPOSITION>(xPosition);
+ }
+ ui++;
+ }
+ } else { // Single byte encoding
+ for (int i=0;i<len;i++) {
+ CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, i+1, NULL);
+ positions[i] = static_cast<XYPOSITION>(xPosition);
+ }
+ }
+
+}
+
+XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) {
+ if (font_.GetID())
+ {
+ CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_));
+ textLayout->setText (reinterpret_cast<const UInt8*>(s), len, encoding, *reinterpret_cast<QuartzTextStyle*>(font_.GetID()));
+
+ return static_cast<XYPOSITION>(textLayout->MeasureStringWidth());
+ }
+ return 1;
+}
+
+XYPOSITION SurfaceImpl::WidthChar(Font &font_, char ch) {
+ char str[2] = { ch, '\0' };
+ if (font_.GetID())
+ {
+ CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_));
+ textLayout->setText (reinterpret_cast<const UInt8*>(str), 1, encoding, *reinterpret_cast<QuartzTextStyle*>(font_.GetID()));
+
+ return textLayout->MeasureStringWidth();
+ }
+ else
+ return 1;
+}
+
+// This string contains a good range of characters to test for size.
+const char sizeString[] = "`~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890"
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+XYPOSITION SurfaceImpl::Ascent(Font &font_) {
+ if (!font_.GetID())
+ return 1;
+
+ float ascent = reinterpret_cast<QuartzTextStyle*>( font_.GetID() )->getAscent();
+ return ascent + 0.5f;
+
+}
+
+XYPOSITION SurfaceImpl::Descent(Font &font_) {
+ if (!font_.GetID())
+ return 1;
+
+ float descent = reinterpret_cast<QuartzTextStyle*>( font_.GetID() )->getDescent();
+ return descent + 0.5f;
+
+}
+
+XYPOSITION SurfaceImpl::InternalLeading(Font &) {
+ return 0;
+}
+
+XYPOSITION SurfaceImpl::ExternalLeading(Font &font_) {
+ if (!font_.GetID())
+ return 1;
+
+ float leading = reinterpret_cast<QuartzTextStyle*>( font_.GetID() )->getLeading();
+ return leading + 0.5f;
+
+}
+
+XYPOSITION SurfaceImpl::Height(Font &font_) {
+
+ return Ascent(font_) + Descent(font_);
+}
+
+XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) {
+
+ if (!font_.GetID())
+ return 1;
+
+ const int sizeStringLength = ELEMENTS( sizeString );
+ XYPOSITION width = WidthText( font_, sizeString, sizeStringLength );
+
+ return (int) ((width / (float) sizeStringLength) + 0.5);
+}
+
+void SurfaceImpl::SetClip(PRectangle rc) {
+ CGContextClipToRect( gc, PRectangleToCGRect( rc ) );
+}
+
+void SurfaceImpl::FlushCachedState() {
+ CGContextSynchronize( gc );
+}
+
+void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) {
+ unicodeMode = unicodeMode_;
+}
+
+void SurfaceImpl::SetDBCSMode(int codePage_) {
+ if (codePage_ && (codePage_ != SC_CP_UTF8))
+ codePage = codePage_;
+}
+
+Surface *Surface::Allocate(int)
+{
+ return new SurfaceImpl();
+}
+
+//----------------- Window -------------------------------------------------------------------------
+
+// Cocoa uses different types for windows and views, so a Window may
+// be either an NSWindow or NSView and the code will check the type
+// before performing an action.
+
+Window::~Window()
+{
+}
+
+// Window::Destroy needs to see definition of ListBoxImpl so is located after ListBoxImpl
+
+//--------------------------------------------------------------------------------------------------
+
+bool Window::HasFocus()
+{
+ NSView* container = reinterpret_cast<NSView*>(wid);
+ return [[container window] firstResponder] == container;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+static CGFloat ScreenMax(NSWindow* win)
+{
+ return NSMaxY([[NSScreen mainScreen] frame]);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+PRectangle Window::GetPosition()
+{
+ if (wid)
+ {
+ NSRect rect;
+ id idWin = reinterpret_cast<id>(wid);
+ NSWindow* win;
+ if ([idWin isKindOfClass: [NSView class]])
+ {
+ // NSView
+ NSView* view = reinterpret_cast<NSView*>(idWin);
+ win = [view window];
+ rect = [view convertRect: [view bounds] toView: nil];
+ rect = [win convertRectToScreen:rect];
+ }
+ else
+ {
+ // NSWindow
+ win = reinterpret_cast<NSWindow*>(idWin);
+ rect = [win frame];
+ }
+ CGFloat screenHeight = ScreenMax(win);
+ // Invert screen positions to match Scintilla
+ return PRectangle(
+ static_cast<XYPOSITION>(NSMinX(rect)), static_cast<XYPOSITION>(screenHeight - NSMaxY(rect)),
+ static_cast<XYPOSITION>(NSMaxX(rect)), static_cast<XYPOSITION>(screenHeight - NSMinY(rect)));
+ }
+ else
+ {
+ return PRectangle(0, 0, 1, 1);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::SetPosition(PRectangle rc)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isKindOfClass: [NSView class]])
+ {
+ // NSView
+ // Moves this view inside the parent view
+ NSRect nsrc = NSMakeRect(rc.left, rc.bottom, rc.Width(), rc.Height());
+ NSView* view = reinterpret_cast<NSView*>(idWin);
+ nsrc = [[view window] convertRectFromScreen:nsrc];
+ [view setFrame: nsrc];
+ }
+ else
+ {
+ // NSWindow
+ PLATFORM_ASSERT([idWin isKindOfClass: [NSWindow class]]);
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ CGFloat screenHeight = ScreenMax(win);
+ NSRect nsrc = NSMakeRect(rc.left, screenHeight - rc.bottom,
+ rc.Width(), rc.Height());
+ [win setFrame: nsrc display:YES];
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::SetPositionRelative(PRectangle rc, Window window)
+{
+ PRectangle rcOther = window.GetPosition();
+ rc.left += rcOther.left;
+ rc.right += rcOther.left;
+ rc.top += rcOther.top;
+ rc.bottom += rcOther.top;
+ SetPosition(rc);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+PRectangle Window::GetClientPosition()
+{
+ // This means, in MacOS X terms, get the "frame bounds". Call GetPosition, just like on Win32.
+ return GetPosition();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::Show(bool show)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isKindOfClass: [NSWindow class]])
+ {
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ if (show)
+ {
+ [win orderFront:nil];
+ }
+ else
+ {
+ [win orderOut:nil];
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Invalidates the entire window or view so it is completely redrawn.
+ */
+void Window::InvalidateAll()
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ NSView* container;
+ if ([idWin isKindOfClass: [NSView class]])
+ {
+ container = reinterpret_cast<NSView*>(idWin);
+ }
+ else
+ {
+ // NSWindow
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ container = reinterpret_cast<NSView*>([win contentView]);
+ container.needsDisplay = YES;
+ }
+ container.needsDisplay = YES;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Invalidates part of the window or view so only this part redrawn.
+ */
+void Window::InvalidateRectangle(PRectangle rc)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ NSView* container;
+ if ([idWin isKindOfClass: [NSView class]])
+ {
+ container = reinterpret_cast<NSView*>(idWin);
+ }
+ else
+ {
+ // NSWindow
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ container = reinterpret_cast<NSView*>([win contentView]);
+ }
+ [container setNeedsDisplayInRect: PRectangleToNSRect(rc)];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::SetFont(Font&)
+{
+ // Implemented on list subclass on Cocoa.
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts the Scintilla cursor enum into an NSCursor and stores it in the associated NSView,
+ * which then will take care to set up a new mouse tracking rectangle.
+ */
+void Window::SetCursor(Cursor curs)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isMemberOfClass: [SCIContentView class]])
+ {
+ SCIContentView* container = reinterpret_cast<SCIContentView*>(idWin);
+ [container setCursor: curs];
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::SetTitle(const char* s)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isKindOfClass: [NSWindow class]])
+ {
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ NSString* sTitle = [NSString stringWithUTF8String:s];
+ [win setTitle:sTitle];
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+PRectangle Window::GetMonitorRect(Point)
+{
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isKindOfClass: [NSWindow class]])
+ {
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ NSScreen* screen = [win screen];
+ NSRect rect = [screen frame];
+ CGFloat screenHeight = rect.origin.y + rect.size.height;
+ // Invert screen positions to match Scintilla
+ return PRectangle(
+ static_cast<XYPOSITION>(NSMinX(rect)), static_cast<XYPOSITION>(screenHeight - NSMaxY(rect)),
+ static_cast<XYPOSITION>(NSMaxX(rect)), static_cast<XYPOSITION>(screenHeight - NSMinY(rect)));
+ }
+ }
+ return PRectangle();
+}
+
+//----------------- ImageFromXPM -------------------------------------------------------------------
+
+// Convert an XPM image into an NSImage for use with Cocoa
+
+static NSImage* ImageFromXPM(XPM* pxpm)
+{
+ NSImage* img = nil;
+ if (pxpm)
+ {
+ const int width = pxpm->GetWidth();
+ const int height = pxpm->GetHeight();
+ PRectangle rcxpm(0, 0, width, height);
+ Surface* surfaceXPM = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceXPM)
+ {
+ surfaceXPM->InitPixMap(width, height, NULL, NULL);
+ SurfaceImpl* surfaceIXPM = static_cast<SurfaceImpl*>(surfaceXPM);
+ CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height));
+ pxpm->Draw(surfaceXPM, rcxpm);
+ img = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease];
+ CGImageRef imageRef = surfaceIXPM->GetImage();
+ NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef];
+ [img addRepresentation: bitmapRep];
+ [bitmapRep release];
+ CGImageRelease(imageRef);
+ delete surfaceXPM;
+ }
+ }
+ return img;
+}
+
+//----------------- ListBox and related classes ----------------------------------------------------
+
+//----------------- IListBox -----------------------------------------------------------------------
+
+namespace {
+
+// unnamed namespace hides IListBox interface
+
+class IListBox {
+public:
+ virtual int Rows() = 0;
+ virtual NSImage* ImageForRow(NSInteger row) = 0;
+ virtual NSString* TextForRow(NSInteger row) = 0;
+ virtual void DoubleClick() = 0;
+};
+
+} // unnamed namespace
+
+//----------------- AutoCompletionDataSource -------------------------------------------------------
+
+@interface AutoCompletionDataSource :
+NSObject
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+<NSTableViewDataSource>
+#endif
+{
+ IListBox* box;
+}
+
+@property IListBox* box;
+
+@end
+
+@implementation AutoCompletionDataSource
+
+@synthesize box;
+
+- (void) doubleClick: (id) sender
+{
+#pragma unused(sender)
+ if (box)
+ {
+ box->DoubleClick();
+ }
+}
+
+- (id)tableView: (NSTableView*)aTableView objectValueForTableColumn: (NSTableColumn*)aTableColumn row: (NSInteger)rowIndex
+{
+#pragma unused(aTableView)
+ if (!box)
+ return nil;
+ if ([(NSString*)[aTableColumn identifier] isEqualToString: @"icon"])
+ {
+ return box->ImageForRow(rowIndex);
+ }
+ else {
+ return box->TextForRow(rowIndex);
+ }
+}
+
+- (void)tableView: (NSTableView*)aTableView setObjectValue: anObject forTableColumn: (NSTableColumn*)aTableColumn row: (NSInteger)rowIndex
+{
+#pragma unused(aTableView)
+#pragma unused(anObject)
+#pragma unused(aTableColumn)
+#pragma unused(rowIndex)
+}
+
+- (NSInteger)numberOfRowsInTableView: (NSTableView*)aTableView
+{
+#pragma unused(aTableView)
+ if (!box)
+ return 0;
+ return box->Rows();
+}
+
+@end
+
+//----------------- ListBoxImpl --------------------------------------------------------------------
+
+namespace { // unnamed namespace hides ListBoxImpl and associated classes
+
+struct RowData
+{
+ int type;
+ std::string text;
+ RowData(int type_, const char* text_) :
+ type(type_), text(text_)
+ {
+ }
+};
+
+class LinesData
+{
+ std::vector<RowData> lines;
+public:
+ LinesData()
+ {
+ }
+ ~LinesData()
+ {
+ }
+ int Length() const
+ {
+ return static_cast<int>(lines.size());
+ }
+ void Clear()
+ {
+ lines.clear();
+ }
+ void Add(int /* index */, int type, char* str)
+ {
+ lines.push_back(RowData(type, str));
+ }
+ int GetType(size_t index) const
+ {
+ if (index < lines.size())
+ {
+ return lines[index].type;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ const char* GetString(size_t index) const
+ {
+ if (index < lines.size())
+ {
+ return lines[index].text.c_str();
+ }
+ else
+ {
+ return 0;
+ }
+ }
+};
+
+// Map from icon type to an NSImage*
+typedef std::map<NSInteger, NSImage*> ImageMap;
+
+class ListBoxImpl : public ListBox, IListBox
+{
+private:
+ ImageMap images;
+ int lineHeight;
+ bool unicodeMode;
+ int desiredVisibleRows;
+ XYPOSITION maxItemWidth;
+ unsigned int aveCharWidth;
+ XYPOSITION maxIconWidth;
+ Font font;
+ int maxWidth;
+
+ NSTableView* table;
+ NSScrollView* scroller;
+ NSTableColumn* colIcon;
+ NSTableColumn* colText;
+ AutoCompletionDataSource* ds;
+
+ LinesData ld;
+ CallBackAction doubleClickAction;
+ void* doubleClickActionData;
+
+public:
+ ListBoxImpl() : lineHeight(10), unicodeMode(false),
+ desiredVisibleRows(5), maxItemWidth(0), aveCharWidth(8), maxIconWidth(0),
+ doubleClickAction(NULL), doubleClickActionData(NULL)
+ {
+ }
+ ~ListBoxImpl() {}
+
+ // ListBox methods
+ void SetFont(Font& font);
+ void Create(Window& parent, int ctrlID, Scintilla::Point pt, int lineHeight_, bool unicodeMode_, int technology_);
+ void SetAverageCharWidth(int width);
+ void SetVisibleRows(int rows);
+ int GetVisibleRows() const;
+ PRectangle GetDesiredRect();
+ int CaretFromEdge();
+ void Clear();
+ void Append(char* s, int type = -1);
+ int Length();
+ void Select(int n);
+ int GetSelection();
+ int Find(const char* prefix);
+ void GetValue(int n, char* value, int len);
+ void RegisterImage(int type, const char* xpm_data);
+ void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage);
+ void ClearRegisteredImages();
+ void SetDoubleClickAction(CallBackAction action, void* data)
+ {
+ doubleClickAction = action;
+ doubleClickActionData = data;
+ }
+ void SetList(const char* list, char separator, char typesep);
+
+ // To clean up when closed
+ void ReleaseViews();
+
+ // For access from AutoCompletionDataSource implement IListBox
+ int Rows();
+ NSImage* ImageForRow(NSInteger row);
+ NSString* TextForRow(NSInteger row);
+ void DoubleClick();
+};
+
+void ListBoxImpl::Create(Window& /*parent*/, int /*ctrlID*/, Scintilla::Point pt,
+ int lineHeight_, bool unicodeMode_, int)
+{
+ lineHeight = lineHeight_;
+ unicodeMode = unicodeMode_;
+ maxWidth = 2000;
+
+ NSRect lbRect = NSMakeRect(pt.x,pt.y, 120, lineHeight * desiredVisibleRows);
+ NSWindow* winLB = [[NSWindow alloc] initWithContentRect: lbRect
+ styleMask: NSBorderlessWindowMask
+ backing: NSBackingStoreBuffered
+ defer: NO];
+ [winLB setLevel:NSFloatingWindowLevel];
+ [winLB setHasShadow:YES];
+ scroller = [NSScrollView alloc];
+ NSRect scRect = NSMakeRect(0, 0, lbRect.size.width, lbRect.size.height);
+ [scroller initWithFrame: scRect];
+ [scroller setHasVerticalScroller:YES];
+ table = [[NSTableView alloc] initWithFrame: scRect];
+ [table setHeaderView:nil];
+ [scroller setDocumentView: table];
+ colIcon = [[NSTableColumn alloc] initWithIdentifier:@"icon"];
+ [colIcon setWidth: 20];
+ [colIcon setEditable:NO];
+ [colIcon setHidden:YES];
+ NSImageCell* imCell = [[[NSImageCell alloc] init] autorelease];
+ [colIcon setDataCell:imCell];
+ [table addTableColumn:colIcon];
+ colText = [[NSTableColumn alloc] initWithIdentifier:@"name"];
+ [colText setResizingMask:NSTableColumnAutoresizingMask];
+ [colText setEditable:NO];
+ [table addTableColumn:colText];
+ ds = [[AutoCompletionDataSource alloc] init];
+ [ds setBox:this];
+ [table setDataSource: ds]; // Weak reference
+ [scroller setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+ [[winLB contentView] addSubview: scroller];
+
+ [table setTarget:ds];
+ [table setDoubleAction:@selector(doubleClick:)];
+ table.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList;
+ wid = winLB;
+}
+
+void ListBoxImpl::SetFont(Font& font_)
+{
+ // NSCell setFont takes an NSFont* rather than a CTFontRef but they
+ // are the same thing toll-free bridged.
+ QuartzTextStyle* style = reinterpret_cast<QuartzTextStyle*>(font_.GetID());
+ font.Release();
+ font.SetID(new QuartzTextStyle(*style));
+ NSFont *pfont = (NSFont *)style->getFontRef();
+ [[colText dataCell] setFont: pfont];
+ CGFloat itemHeight = ceil([pfont boundingRectForFont].size.height);
+ [table setRowHeight:itemHeight];
+}
+
+void ListBoxImpl::SetAverageCharWidth(int width)
+{
+ aveCharWidth = width;
+}
+
+void ListBoxImpl::SetVisibleRows(int rows)
+{
+ desiredVisibleRows = rows;
+}
+
+int ListBoxImpl::GetVisibleRows() const
+{
+ return desiredVisibleRows;
+}
+
+PRectangle ListBoxImpl::GetDesiredRect()
+{
+ PRectangle rcDesired;
+ rcDesired = GetPosition();
+
+ // There appears to be an extra pixel above and below the row contents
+ CGFloat itemHeight = [table rowHeight] + 2;
+
+ int rows = Length();
+ if ((rows == 0) || (rows > desiredVisibleRows))
+ rows = desiredVisibleRows;
+
+ rcDesired.bottom = rcDesired.top + static_cast<XYPOSITION>(itemHeight * rows);
+ rcDesired.right = rcDesired.left + maxItemWidth + aveCharWidth;
+
+ if (Length() > rows)
+ {
+ [scroller setHasVerticalScroller:YES];
+ rcDesired.right += [NSScroller scrollerWidthForControlSize:NSRegularControlSize
+ scrollerStyle:NSScrollerStyleLegacy];
+ }
+ else
+ {
+ [scroller setHasVerticalScroller:NO];
+ }
+ rcDesired.right += maxIconWidth;
+ rcDesired.right += 6;
+
+ return rcDesired;
+}
+
+int ListBoxImpl::CaretFromEdge()
+{
+ if ([colIcon isHidden])
+ return 3;
+ else
+ return 6 + static_cast<int>([colIcon width]);
+}
+
+void ListBoxImpl::ReleaseViews()
+{
+ [table release];
+ table = nil;
+ [scroller release];
+ scroller = nil;
+ [colIcon release];
+ colIcon = nil;
+ [colText release ];
+ colText = nil;
+ [ds release];
+ ds = nil;
+}
+
+void ListBoxImpl::Clear()
+{
+ maxItemWidth = 0;
+ maxIconWidth = 0;
+ ld.Clear();
+}
+
+void ListBoxImpl::Append(char* s, int type)
+{
+ int count = Length();
+ ld.Add(count, type, s);
+
+ Scintilla::SurfaceImpl surface;
+ XYPOSITION width = surface.WidthText(font, s, static_cast<int>(strlen(s)));
+ if (width > maxItemWidth)
+ {
+ maxItemWidth = width;
+ [colText setWidth: maxItemWidth];
+ }
+ ImageMap::iterator it = images.find(type);
+ if (it != images.end())
+ {
+ NSImage* img = it->second;
+ if (img)
+ {
+ XYPOSITION widthIcon = static_cast<XYPOSITION>(img.size.width);
+ if (widthIcon > maxIconWidth)
+ {
+ [colIcon setHidden: NO];
+ maxIconWidth = widthIcon;
+ [colIcon setWidth: maxIconWidth];
+ }
+ }
+ }
+}
+
+void ListBoxImpl::SetList(const char* list, char separator, char typesep)
+{
+ Clear();
+ size_t count = strlen(list) + 1;
+ std::vector<char> words(list, list+count);
+ char* startword = words.data();
+ char* numword = NULL;
+ int i = 0;
+ for (; words[i]; i++)
+ {
+ if (words[i] == separator)
+ {
+ words[i] = '\0';
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ startword = words.data() + i + 1;
+ numword = NULL;
+ }
+ else if (words[i] == typesep)
+ {
+ numword = words.data() + i;
+ }
+ }
+ if (startword)
+ {
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ }
+ [table reloadData];
+}
+
+int ListBoxImpl::Length()
+{
+ return ld.Length();
+}
+
+void ListBoxImpl::Select(int n)
+{
+ [table selectRowIndexes:[NSIndexSet indexSetWithIndex:n] byExtendingSelection:NO];
+ [table scrollRowToVisible:n];
+}
+
+int ListBoxImpl::GetSelection()
+{
+ return static_cast<int>([table selectedRow]);
+}
+
+int ListBoxImpl::Find(const char* prefix)
+{
+ int count = Length();
+ for (int i = 0; i < count; i++)
+ {
+ const char* s = ld.GetString(i);
+ if (s && (s[0] != '\0') && (0 == strncmp(prefix, s, strlen(prefix))))
+ {
+ return i;
+ }
+ }
+ return - 1;
+}
+
+void ListBoxImpl::GetValue(int n, char* value, int len)
+{
+ const char* textString = ld.GetString(n);
+ if (textString == NULL)
+ {
+ value[0] = '\0';
+ return;
+ }
+ strlcpy(value, textString, len);
+}
+
+void ListBoxImpl::RegisterImage(int type, const char* xpm_data)
+{
+ XPM xpm(xpm_data);
+ NSImage* img = ImageFromXPM(&xpm);
+ [img retain];
+ ImageMap::iterator it=images.find(type);
+ if (it == images.end())
+ {
+ images[type] = img;
+ }
+ else
+ {
+ [it->second release];
+ it->second = img;
+ }
+}
+
+void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) {
+ CGImageRef imageRef = ImageCreateFromRGBA(width, height, pixelsImage, false);
+ NSSize sz = {static_cast<CGFloat>(width), static_cast<CGFloat>(height)};
+ NSImage *img = [[[NSImage alloc] initWithSize: sz] autorelease];
+ NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef];
+ [img addRepresentation: bitmapRep];
+ [bitmapRep release];
+ CGImageRelease(imageRef);
+ [img retain];
+ ImageMap::iterator it=images.find(type);
+ if (it == images.end())
+ {
+ images[type] = img;
+ }
+ else
+ {
+ [it->second release];
+ it->second = img;
+ }
+}
+
+void ListBoxImpl::ClearRegisteredImages()
+{
+ for (ImageMap::iterator it=images.begin();
+ it != images.end(); ++it)
+ {
+ [it->second release];
+ it->second = nil;
+ }
+ images.clear();
+}
+
+int ListBoxImpl::Rows()
+{
+ return ld.Length();
+}
+
+NSImage* ListBoxImpl::ImageForRow(NSInteger row)
+{
+ ImageMap::iterator it = images.find(ld.GetType(row));
+ if (it != images.end())
+ {
+ NSImage* img = it->second;
+ return img;
+ }
+ else
+ {
+ return nil;
+ }
+}
+
+NSString* ListBoxImpl::TextForRow(NSInteger row)
+{
+ const char* textString = ld.GetString(row);
+ NSString* sTitle;
+ if (unicodeMode)
+ sTitle = [NSString stringWithUTF8String:textString];
+ else
+ sTitle = [NSString stringWithCString:textString encoding:NSWindowsCP1252StringEncoding];
+ return sTitle;
+}
+
+void ListBoxImpl::DoubleClick()
+{
+ if (doubleClickAction)
+ {
+ doubleClickAction(doubleClickActionData);
+ }
+}
+
+} // unnamed namespace
+
+//----------------- ListBox ------------------------------------------------------------------------
+
+ListBox::ListBox()
+{
+}
+
+ListBox::~ListBox()
+{
+}
+
+ListBox* ListBox::Allocate()
+{
+ ListBoxImpl* lb = new ListBoxImpl();
+ return lb;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Window::Destroy()
+{
+ ListBoxImpl *listbox = dynamic_cast<ListBoxImpl *>(this);
+ if (listbox)
+ {
+ listbox->ReleaseViews();
+ }
+ if (wid)
+ {
+ id idWin = reinterpret_cast<id>(wid);
+ if ([idWin isKindOfClass: [NSWindow class]])
+ {
+ NSWindow* win = reinterpret_cast<NSWindow*>(idWin);
+ [win release];
+ }
+ }
+ wid = 0;
+}
+
+
+//----------------- ScintillaContextMenu -----------------------------------------------------------
+
+@implementation ScintillaContextMenu : NSMenu
+
+// This NSMenu subclass serves also as target for menu commands and forwards them as
+// notification messages to the front end.
+
+- (void) handleCommand: (NSMenuItem*) sender
+{
+ owner->HandleCommand([sender tag]);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) setOwner: (Scintilla::ScintillaCocoa*) newOwner
+{
+ owner = newOwner;
+}
+
+@end
+
+//----------------- Menu ---------------------------------------------------------------------------
+
+Menu::Menu()
+ : mid(0)
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Menu::CreatePopUp()
+{
+ Destroy();
+ mid = [[ScintillaContextMenu alloc] initWithTitle: @""];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Menu::Destroy()
+{
+ ScintillaContextMenu* menu = reinterpret_cast<ScintillaContextMenu*>(mid);
+ [menu release];
+ mid = NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Menu::Show(Point, Window &)
+{
+ // Cocoa menus are handled a bit differently. We only create the menu. The framework
+ // takes care to show it properly.
+}
+
+//----------------- ElapsedTime --------------------------------------------------------------------
+
+// ElapsedTime is used for precise performance measurements during development
+// and not for anything a user sees.
+
+ElapsedTime::ElapsedTime() {
+ struct timeval curTime;
+ gettimeofday( &curTime, NULL );
+
+ bigBit = curTime.tv_sec;
+ littleBit = curTime.tv_usec;
+}
+
+double ElapsedTime::Duration(bool reset) {
+ struct timeval curTime;
+ gettimeofday( &curTime, NULL );
+ long endBigBit = curTime.tv_sec;
+ long endLittleBit = curTime.tv_usec;
+ double result = 1000000.0 * (endBigBit - bigBit);
+ result += endLittleBit - littleBit;
+ result /= 1000000.0;
+ if (reset) {
+ bigBit = endBigBit;
+ littleBit = endLittleBit;
+ }
+ return result;
+}
+
+//----------------- Platform -----------------------------------------------------------------------
+
+ColourDesired Platform::Chrome()
+{
+ return ColourDesired(0xE0, 0xE0, 0xE0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+ColourDesired Platform::ChromeHighlight()
+{
+ return ColourDesired(0xFF, 0xFF, 0xFF);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Returns the currently set system font for the user.
+ */
+const char *Platform::DefaultFont()
+{
+ NSString* name = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSFixedPitchFont"];
+ return [name UTF8String];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Returns the currently set system font size for the user.
+ */
+int Platform::DefaultFontSize()
+{
+ return static_cast<int>([[NSUserDefaults standardUserDefaults]
+ integerForKey: @"NSFixedPitchFontSize"]);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Returns the time span in which two consecutive mouse clicks must occur to be considered as
+ * double click.
+ *
+ * @return time span in milliseconds
+ */
+unsigned int Platform::DoubleClickTime()
+{
+ float threshold = [[NSUserDefaults standardUserDefaults] floatForKey:
+ @"com.apple.mouse.doubleClickThreshold"];
+ if (threshold == 0)
+ threshold = 0.5;
+ return static_cast<unsigned int>(threshold * 1000.0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool Platform::MouseButtonBounce()
+{
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper method for the backend to reach through to the scintilla window.
+ */
+long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam)
+{
+ return scintilla_send_message(w, msg, wParam, lParam);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper method for the backend to reach through to the scintilla window.
+ */
+long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam)
+{
+ return scintilla_send_message(w, msg, wParam, (long) lParam);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool Platform::IsDBCSLeadByte(int codePage, char ch)
+{
+ // Byte ranges found in Wikipedia articles with relevant search strings in each case
+ unsigned char uch = static_cast<unsigned char>(ch);
+ switch (codePage)
+ {
+ case 932:
+ // Shift_jis
+ return ((uch >= 0x81) && (uch <= 0x9F)) ||
+ ((uch >= 0xE0) && (uch <= 0xFC));
+ // Lead bytes F0 to FC may be a Microsoft addition.
+ case 936:
+ // GBK
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 949:
+ // Korean Wansung KS C-5601-1987
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 950:
+ // Big5
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 1361:
+ // Korean Johab KS C-5601-1992
+ return
+ ((uch >= 0x84) && (uch <= 0xD3)) ||
+ ((uch >= 0xD8) && (uch <= 0xDE)) ||
+ ((uch >= 0xE0) && (uch <= 0xF9));
+ }
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+int Platform::DBCSCharLength(int /* codePage */, const char* /* s */)
+{
+ // DBCS no longer uses this.
+ return 1;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+int Platform::DBCSCharMaxLength()
+{
+ return 2;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+int Platform::Minimum(int a, int b)
+{
+ return (a < b) ? a : b;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+int Platform::Maximum(int a, int b) {
+ return (a > b) ? a : b;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+//#define TRACE
+#ifdef TRACE
+
+void Platform::DebugDisplay(const char *s)
+{
+ fprintf( stderr, "%s", s );
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Platform::DebugPrintf(const char *format, ...)
+{
+ const int BUF_SIZE = 2000;
+ char buffer[BUF_SIZE];
+
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsnprintf(buffer, BUF_SIZE, format, pArguments);
+ va_end(pArguments);
+ Platform::DebugDisplay(buffer);
+}
+
+#else
+
+void Platform::DebugDisplay(const char *) {}
+
+void Platform::DebugPrintf(const char *, ...) {}
+
+#endif
+
+//--------------------------------------------------------------------------------------------------
+
+static bool assertionPopUps = true;
+
+bool Platform::ShowAssertionPopUps(bool assertionPopUps_)
+{
+ bool ret = assertionPopUps;
+ assertionPopUps = assertionPopUps_;
+ return ret;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void Platform::Assert(const char *c, const char *file, int line)
+{
+ char buffer[2000];
+ snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d\r\n", c, file, line);
+ Platform::DebugDisplay(buffer);
+#ifdef DEBUG
+ // Jump into debugger in assert on Mac (CL269835)
+ ::Debugger();
+#endif
+}
+
+//--------------------------------------------------------------------------------------------------
+
+int Platform::Clamp(int val, int minVal, int maxVal)
+{
+ if (val > maxVal)
+ val = maxVal;
+ if (val < minVal)
+ val = minVal;
+ return val;
+}
+
+//----------------- DynamicLibrary -----------------------------------------------------------------
+
+/**
+ * Implements the platform specific part of library loading.
+ *
+ * @param modulePath The path to the module to load.
+ * @return A library instance or NULL if the module could not be found or another problem occurred.
+ */
+DynamicLibrary* DynamicLibrary::Load(const char* /* modulePath */)
+{
+ // Not implemented.
+ return NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextLayout.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextLayout.h
new file mode 100644
index 00000000000..33869ae6e11
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextLayout.h
@@ -0,0 +1,111 @@
+/*
+ * QuartzTextLayout.h
+ *
+ * Original Code by Evan Jones on Wed Oct 02 2002.
+ * Contributors:
+ * Shane Caraveo, ActiveState
+ * Bernd Paradies, Adobe
+ *
+ */
+
+#ifndef _QUARTZ_TEXT_LAYOUT_H
+#define _QUARTZ_TEXT_LAYOUT_H
+
+#include <Cocoa/Cocoa.h>
+
+#include "QuartzTextStyle.h"
+
+
+class QuartzTextLayout
+{
+public:
+ /** Create a text layout for drawing on the specified context. */
+ explicit QuartzTextLayout( CGContextRef context )
+ {
+ mString = NULL;
+ mLine = NULL;
+ stringLength = 0;
+ setContext(context);
+ }
+
+ ~QuartzTextLayout()
+ {
+ if ( mString != NULL )
+ {
+ CFRelease(mString);
+ mString = NULL;
+ }
+ if ( mLine != NULL )
+ {
+ CFRelease(mLine);
+ mLine = NULL;
+ }
+ }
+
+ inline void setText( const UInt8* buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle& r )
+ {
+ CFStringRef str = CFStringCreateWithBytes( NULL, buffer, byteLength, encoding, false );
+ if (!str)
+ return;
+
+ stringLength = CFStringGetLength(str);
+
+ CFMutableDictionaryRef stringAttribs = r.getCTStyle();
+
+ if (mString != NULL)
+ CFRelease(mString);
+ mString = ::CFAttributedStringCreate(NULL, str, stringAttribs);
+
+ if (mLine != NULL)
+ CFRelease(mLine);
+ mLine = ::CTLineCreateWithAttributedString(mString);
+
+ CFRelease( str );
+ }
+
+ /** Draw the text layout into the current CGContext at the specified position.
+ * @param x The x axis position to draw the baseline in the current CGContext.
+ * @param y The y axis position to draw the baseline in the current CGContext. */
+ void draw( float x, float y )
+ {
+ if (mLine == NULL)
+ return;
+
+ ::CGContextSetTextMatrix(gc, CGAffineTransformMakeScale(1.0, -1.0));
+
+ // Set the text drawing position.
+ ::CGContextSetTextPosition(gc, x, y);
+
+ // And finally, draw!
+ ::CTLineDraw(mLine, gc);
+ }
+
+ float MeasureStringWidth()
+ {
+ if (mLine == NULL)
+ return 0.0f;
+
+ return static_cast<float>(::CTLineGetTypographicBounds(mLine, NULL, NULL, NULL));
+ }
+
+ CTLineRef getCTLine() {
+ return mLine;
+ }
+
+ CFIndex getStringLength() {
+ return stringLength;
+ }
+
+ inline void setContext (CGContextRef context)
+ {
+ gc = context;
+ }
+
+private:
+ CGContextRef gc;
+ CFAttributedStringRef mString;
+ CTLineRef mLine;
+ CFIndex stringLength;
+};
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyle.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyle.h
new file mode 100644
index 00000000000..12cc0e0b2ae
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyle.h
@@ -0,0 +1,109 @@
+/*
+ * QuartzTextStyle.h
+ *
+ * Created by Evan Jones on Wed Oct 02 2002.
+ *
+ */
+
+#ifndef _QUARTZ_TEXT_STYLE_H
+#define _QUARTZ_TEXT_STYLE_H
+
+#include "QuartzTextStyleAttribute.h"
+
+class QuartzTextStyle
+{
+public:
+ QuartzTextStyle()
+ {
+ fontRef = NULL;
+ styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ characterSet = 0;
+ }
+
+ QuartzTextStyle(const QuartzTextStyle &other)
+ {
+ // Does not copy font colour attribute
+ fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
+ styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
+ characterSet = other.characterSet;
+ }
+
+ ~QuartzTextStyle()
+ {
+ if (styleDict != NULL)
+ {
+ CFRelease(styleDict);
+ styleDict = NULL;
+ }
+
+ if (fontRef)
+ {
+ CFRelease(fontRef);
+ fontRef = NULL;
+ }
+ }
+
+ CFMutableDictionaryRef getCTStyle() const
+ {
+ return styleDict;
+ }
+
+ void setCTStyleColor(CGColor *inColor)
+ {
+ CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor);
+ }
+
+ float getAscent() const
+ {
+ return static_cast<float>(::CTFontGetAscent(fontRef));
+ }
+
+ float getDescent() const
+ {
+ return static_cast<float>(::CTFontGetDescent(fontRef));
+ }
+
+ float getLeading() const
+ {
+ return static_cast<float>(::CTFontGetLeading(fontRef));
+ }
+
+ void setFontRef(CTFontRef inRef, int characterSet_)
+ {
+ fontRef = inRef;
+ characterSet = characterSet_;
+
+ if (styleDict != NULL)
+ CFRelease(styleDict);
+
+ styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
+ }
+
+ CTFontRef getFontRef()
+ {
+ return fontRef;
+ }
+
+ int getCharacterSet()
+ {
+ return characterSet;
+ }
+
+private:
+ CFMutableDictionaryRef styleDict;
+ CTFontRef fontRef;
+ int characterSet;
+};
+
+#endif
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyleAttribute.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyleAttribute.h
new file mode 100644
index 00000000000..b9698645ed1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/QuartzTextStyleAttribute.h
@@ -0,0 +1,82 @@
+/**
+ * QuartzTextStyleAttribute.h
+ *
+ * Original Code by Evan Jones on Wed Oct 02 2002.
+ * Contributors:
+ * Shane Caraveo, ActiveState
+ * Bernd Paradies, Adobe
+ *
+ */
+
+
+#ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
+#define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H
+
+class QuartzFont
+{
+public:
+ /** Create a font style from a name. */
+ QuartzFont( const char* name, size_t length, float size, int weight, bool italic )
+ {
+ assert( name != NULL && length > 0 && name[length] == '\0' );
+
+ CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman);
+ assert(fontName != NULL);
+ bool bold = weight > SC_WEIGHT_NORMAL;
+
+ if (bold || italic)
+ {
+ CTFontSymbolicTraits desiredTrait = 0;
+ CTFontSymbolicTraits traitMask = 0;
+
+ // if bold was specified, add the trait
+ if (bold) {
+ desiredTrait |= kCTFontBoldTrait;
+ traitMask |= kCTFontBoldTrait;
+ }
+
+ // if italic was specified, add the trait
+ if (italic) {
+ desiredTrait |= kCTFontItalicTrait;
+ traitMask |= kCTFontItalicTrait;
+ }
+
+ // create a font and then a copy of it with the sym traits
+ CTFontRef iFont = ::CTFontCreateWithName(fontName, size, NULL);
+ fontid = ::CTFontCreateCopyWithSymbolicTraits(iFont, size, NULL, desiredTrait, traitMask);
+ if (fontid)
+ {
+ CFRelease(iFont);
+ }
+ else
+ {
+ // Traits failed so use base font
+ fontid = iFont;
+ }
+ }
+ else
+ {
+ // create the font, no traits
+ fontid = ::CTFontCreateWithName(fontName, size, NULL);
+ }
+
+ if (!fontid)
+ {
+ // Failed to create requested font so use font always present
+ fontid = ::CTFontCreateWithName((CFStringRef)@"Monaco", size, NULL);
+ }
+
+ CFRelease(fontName);
+ }
+
+ CTFontRef getFontID()
+ {
+ return fontid;
+ }
+
+private:
+ CTFontRef fontid;
+};
+
+#endif
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.h
new file mode 100644
index 00000000000..0941ac1749f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.h
@@ -0,0 +1,248 @@
+/*
+ * ScintillaCocoa.h
+ *
+ * Mike Lischke <mlischke@sun.com>
+ *
+ * Based on ScintillaMacOSX.h
+ * Original code by Evan Jones on Sun Sep 01 2002.
+ * Contributors:
+ * Shane Caraveo, ActiveState
+ * Bernd Paradies, Adobe
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "ILexer.h"
+
+#ifdef SCI_LEXER
+#include "SciLexer.h"
+#include "PropSetSimple.h"
+#endif
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "CaseConvert.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+
+#include "AutoComplete.h"
+#include "ScintillaBase.h"
+
+extern "C" NSString* ScintillaRecPboardType;
+
+@class SCIContentView;
+@class SCIMarginView;
+@class ScintillaView;
+
+@class FindHighlightLayer;
+
+/**
+ * Helper class to be used as timer target (NSTimer).
+ */
+@interface TimerTarget : NSObject
+{
+ void* mTarget;
+ NSNotificationQueue* notificationQueue;
+}
+- (id) init: (void*) target;
+- (void) timerFired: (NSTimer*) timer;
+- (void) idleTimerFired: (NSTimer*) timer;
+- (void) idleTriggered: (NSNotification*) notification;
+@end
+
+namespace Scintilla {
+
+/**
+ * Main scintilla class, implemented for OS X (Cocoa).
+ */
+class ScintillaCocoa : public ScintillaBase
+{
+private:
+ TimerTarget* timerTarget;
+ NSEvent* lastMouseEvent;
+
+ id<ScintillaNotificationProtocol> delegate;
+
+ SciNotifyFunc notifyProc;
+ intptr_t notifyObj;
+
+ bool capturedMouse;
+
+ bool enteredSetScrollingSize;
+
+ // Private so ScintillaCocoa objects can not be copied
+ ScintillaCocoa(const ScintillaCocoa &) : ScintillaBase() {}
+ ScintillaCocoa &operator=(const ScintillaCocoa &) { return * this; }
+
+ bool GetPasteboardData(NSPasteboard* board, SelectionText* selectedText);
+ void SetPasteboardData(NSPasteboard* board, const SelectionText& selectedText);
+ int TargetAsUTF8(char *text);
+ int EncodedFromUTF8(char *utf8, char *encoded) const;
+
+ int scrollSpeed;
+ int scrollTicks;
+ NSTimer* tickTimer;
+ NSTimer* idleTimer;
+ CFRunLoopObserverRef observer;
+
+ FindHighlightLayer *layerFindIndicator;
+
+protected:
+ Point GetVisibleOriginInMain() const;
+ PRectangle GetClientRectangle() const;
+ virtual PRectangle GetClientDrawingRectangle();
+ Point ConvertPoint(NSPoint point);
+ virtual void RedrawRect(PRectangle rc);
+ virtual void DiscardOverdraw();
+ virtual void Redraw();
+
+ virtual void Initialise();
+ virtual void Finalise();
+ virtual CaseFolder *CaseFolderForEncoding();
+ virtual std::string CaseMapString(const std::string &s, int caseMapping);
+ virtual void CancelModes();
+
+public:
+ ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin);
+ virtual ~ScintillaCocoa();
+
+ void SetDelegate(id<ScintillaNotificationProtocol> delegate_);
+ void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback);
+ sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ NSScrollView* ScrollContainer() const;
+ SCIContentView* ContentView();
+
+ bool SyncPaint(void* gc, PRectangle rc);
+ bool Draw(NSRect rect, CGContextRef gc);
+ void PaintMargin(NSRect aRect);
+
+ virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ void TickFor(TickReason reason);
+ bool FineTickerAvailable();
+ bool FineTickerRunning(TickReason reason);
+ void FineTickerStart(TickReason reason, int millis, int tolerance);
+ void FineTickerCancel(TickReason reason);
+ bool SetIdle(bool on);
+ void SetMouseCapture(bool on);
+ bool HaveMouseCapture();
+ void WillDraw(NSRect rect);
+ void ScrollText(int linesToMove);
+ void SetVerticalScrollPos();
+ void SetHorizontalScrollPos();
+ bool ModifyScrollBars(int nMax, int nPage);
+ bool SetScrollingSize(void);
+ void Resize();
+ void UpdateForScroll();
+
+ // Notifications for the owner.
+ void NotifyChange();
+ void NotifyFocus(bool focus);
+ void NotifyParent(SCNotification scn);
+ void NotifyURIDropped(const char *uri);
+
+ bool HasSelection();
+ bool CanUndo();
+ bool CanRedo();
+ virtual void CopyToClipboard(const SelectionText &selectedText);
+ virtual void Copy();
+ virtual bool CanPaste();
+ virtual void Paste();
+ virtual void Paste(bool rectangular);
+ void CTPaint(void* gc, NSRect rc);
+ void CallTipMouseDown(NSPoint pt);
+ virtual void CreateCallTipWindow(PRectangle rc);
+ virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
+ virtual void ClaimSelection();
+
+ NSPoint GetCaretPosition();
+
+ static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ NSTimer *timers[tickPlatform+1];
+ void TimerFired(NSTimer* timer);
+ void IdleTimerFired();
+ static void UpdateObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *sci);
+ void ObserverAdd();
+ void ObserverRemove();
+ virtual void IdleWork();
+ virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo);
+ int InsertText(NSString* input);
+ NSRange PositionsFromCharacters(NSRange range) const;
+ NSRange CharactersFromPositions(NSRange range) const;
+ void SelectOnlyMainSelection();
+ void ConvertSelectionVirtualSpace();
+ bool ClearAllSelections();
+ void CompositionStart();
+ void CompositionCommit();
+ void CompositionUndo();
+ virtual void SetDocPointer(Document *document);
+
+ bool KeyboardInput(NSEvent* event);
+ void MouseDown(NSEvent* event);
+ void MouseMove(NSEvent* event);
+ void MouseUp(NSEvent* event);
+ void MouseEntered(NSEvent* event);
+ void MouseExited(NSEvent* event);
+ void MouseWheel(NSEvent* event);
+
+ // Drag and drop
+ void StartDrag();
+ bool GetDragData(id <NSDraggingInfo> info, NSPasteboard &pasteBoard, SelectionText* selectedText);
+ NSDragOperation DraggingEntered(id <NSDraggingInfo> info);
+ NSDragOperation DraggingUpdated(id <NSDraggingInfo> info);
+ void DraggingExited(id <NSDraggingInfo> info);
+ bool PerformDragOperation(id <NSDraggingInfo> info);
+ void DragScroll();
+
+ // Promote some methods needed for NSResponder actions.
+ virtual void SelectAll();
+ void DeleteBackward();
+ virtual void Cut();
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual NSMenu* CreateContextMenu(NSEvent* event);
+ void HandleCommand(NSInteger command);
+
+ virtual void ActiveStateChanged(bool isActive);
+
+ // Find indicator
+ void ShowFindIndicatorForRange(NSRange charRange, BOOL retaining);
+ void MoveFindIndicatorWithBounce(BOOL bounce);
+ void HideFindIndicator();
+};
+
+
+}
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.mm b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.mm
new file mode 100644
index 00000000000..e3d0369b663
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaCocoa.mm
@@ -0,0 +1,2540 @@
+
+/**
+ * Scintilla source code edit control
+ * ScintillaCocoa.mm - Cocoa subclass of ScintillaBase
+ *
+ * Written by Mike Lischke <mlischke@sun.com>
+ *
+ * Loosely based on ScintillaMacOSX.cxx.
+ * Copyright 2003 by Evan Jones <ejones@uwaterloo.ca>
+ * Based on ScintillaGTK.cxx Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed.
+ *
+ * Copyright (c) 2009, 2010 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import <Cocoa/Cocoa.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+#import <QuartzCore/CAGradientLayer.h>
+#endif
+#import <QuartzCore/CAAnimation.h>
+#import <QuartzCore/CATransaction.h>
+
+#import "Platform.h"
+#import "ScintillaView.h"
+#import "ScintillaCocoa.h"
+#import "PlatCocoa.h"
+
+using namespace Scintilla;
+
+NSString* ScintillaRecPboardType = @"com.scintilla.utf16-plain-text.rectangular";
+
+//--------------------------------------------------------------------------------------------------
+
+// Define keyboard shortcuts (equivalents) the Mac way.
+#define SCI_CMD ( SCI_CTRL)
+#define SCI_SCMD ( SCI_CMD | SCI_SHIFT)
+#define SCI_SMETA ( SCI_META | SCI_SHIFT)
+
+static const KeyToCommand macMapDefault[] =
+{
+ // OS X specific
+ {SCK_DOWN, SCI_CTRL, SCI_DOCUMENTEND},
+ {SCK_DOWN, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND},
+ {SCK_UP, SCI_CTRL, SCI_DOCUMENTSTART},
+ {SCK_UP, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND},
+ {SCK_LEFT, SCI_CTRL, SCI_VCHOME},
+ {SCK_LEFT, SCI_CSHIFT, SCI_VCHOMEEXTEND},
+ {SCK_RIGHT, SCI_CTRL, SCI_LINEEND},
+ {SCK_RIGHT, SCI_CSHIFT, SCI_LINEENDEXTEND},
+
+ // Similar to Windows and GTK+
+ // Where equivalent clashes with OS X standard, use Meta instead
+ {SCK_DOWN, SCI_NORM, SCI_LINEDOWN},
+ {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
+ {SCK_DOWN, SCI_META, SCI_LINESCROLLDOWN},
+ {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND},
+ {SCK_UP, SCI_NORM, SCI_LINEUP},
+ {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
+ {SCK_UP, SCI_META, SCI_LINESCROLLUP},
+ {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND},
+ {'[', SCI_CTRL, SCI_PARAUP},
+ {'[', SCI_CSHIFT, SCI_PARAUPEXTEND},
+ {']', SCI_CTRL, SCI_PARADOWN},
+ {']', SCI_CSHIFT, SCI_PARADOWNEXTEND},
+ {SCK_LEFT, SCI_NORM, SCI_CHARLEFT},
+ {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
+ {SCK_LEFT, SCI_ALT, SCI_WORDLEFT},
+ {SCK_LEFT, SCI_META, SCI_WORDLEFT},
+ {SCK_LEFT, SCI_SMETA, SCI_WORDLEFTEXTEND},
+ {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND},
+ {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT},
+ {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND},
+ {SCK_RIGHT, SCI_ALT, SCI_WORDRIGHT},
+ {SCK_RIGHT, SCI_META, SCI_WORDRIGHT},
+ {SCK_RIGHT, SCI_SMETA, SCI_WORDRIGHTEXTEND},
+ {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND},
+ {'/', SCI_CTRL, SCI_WORDPARTLEFT},
+ {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND},
+ {'\\', SCI_CTRL, SCI_WORDPARTRIGHT},
+ {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND},
+ {SCK_HOME, SCI_NORM, SCI_VCHOME},
+ {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND},
+ {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART},
+ {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND},
+ {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY},
+ {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND},
+ {SCK_END, SCI_NORM, SCI_LINEEND},
+ {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND},
+ {SCK_END, SCI_CTRL, SCI_DOCUMENTEND},
+ {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND},
+ {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY},
+ {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND},
+ {SCK_PRIOR, SCI_NORM, SCI_PAGEUP},
+ {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND},
+ {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND},
+ {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN},
+ {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND},
+ {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND},
+ {SCK_DELETE, SCI_NORM, SCI_CLEAR},
+ {SCK_DELETE, SCI_SHIFT, SCI_CUT},
+ {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT},
+ {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT},
+ {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE},
+ {SCK_INSERT, SCI_SHIFT, SCI_PASTE},
+ {SCK_INSERT, SCI_CTRL, SCI_COPY},
+ {SCK_ESCAPE, SCI_NORM, SCI_CANCEL},
+ {SCK_BACK, SCI_NORM, SCI_DELETEBACK},
+ {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK},
+ {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT},
+ {SCK_BACK, SCI_ALT, SCI_DELWORDLEFT},
+ {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT},
+ {'z', SCI_CMD, SCI_UNDO},
+ {'z', SCI_SCMD, SCI_REDO},
+ {'x', SCI_CMD, SCI_CUT},
+ {'c', SCI_CMD, SCI_COPY},
+ {'v', SCI_CMD, SCI_PASTE},
+ {'a', SCI_CMD, SCI_SELECTALL},
+ {SCK_TAB, SCI_NORM, SCI_TAB},
+ {SCK_TAB, SCI_SHIFT, SCI_BACKTAB},
+ {SCK_RETURN, SCI_NORM, SCI_NEWLINE},
+ {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE},
+ {SCK_ADD, SCI_CMD, SCI_ZOOMIN},
+ {SCK_SUBTRACT, SCI_CMD, SCI_ZOOMOUT},
+ {SCK_DIVIDE, SCI_CMD, SCI_SETZOOM},
+ {'l', SCI_CMD, SCI_LINECUT},
+ {'l', SCI_CSHIFT, SCI_LINEDELETE},
+ {'t', SCI_CSHIFT, SCI_LINECOPY},
+ {'t', SCI_CTRL, SCI_LINETRANSPOSE},
+ {'d', SCI_CTRL, SCI_SELECTIONDUPLICATE},
+ {'u', SCI_CTRL, SCI_LOWERCASE},
+ {'u', SCI_CSHIFT, SCI_UPPERCASE},
+ {0, 0, 0},
+};
+
+//--------------------------------------------------------------------------------------------------
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+
+// Only implement FindHighlightLayer on OS X 10.6+
+
+/**
+ * Class to display the animated gold roundrect used on OS X for matches.
+ */
+@interface FindHighlightLayer : CAGradientLayer
+{
+@private
+ NSString *sFind;
+ int positionFind;
+ BOOL retaining;
+ CGFloat widthText;
+ CGFloat heightLine;
+ NSString *sFont;
+ CGFloat fontSize;
+}
+
+@property (copy) NSString *sFind;
+@property (assign) int positionFind;
+@property (assign) BOOL retaining;
+@property (assign) CGFloat widthText;
+@property (assign) CGFloat heightLine;
+@property (copy) NSString *sFont;
+@property (assign) CGFloat fontSize;
+
+- (void) animateMatch: (CGPoint)ptText bounce:(BOOL)bounce;
+- (void) hideMatch;
+
+@end
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation FindHighlightLayer
+
+@synthesize sFind, positionFind, retaining, widthText, heightLine, sFont, fontSize;
+
+-(id) init {
+ if (self = [super init]) {
+ [self setNeedsDisplayOnBoundsChange: YES];
+ // A gold to slightly redder gradient to match other applications
+ CGColorRef colGold = CGColorCreateGenericRGB(1.0, 1.0, 0, 1.0);
+ CGColorRef colGoldRed = CGColorCreateGenericRGB(1.0, 0.8, 0, 1.0);
+ self.colors = [NSArray arrayWithObjects:(id)colGoldRed, (id)colGold, nil];
+ CGColorRelease(colGoldRed);
+ CGColorRelease(colGold);
+
+ CGColorRef colGreyBorder = CGColorCreateGenericGray(0.756f, 0.5f);
+ self.borderColor = colGreyBorder;
+ CGColorRelease(colGreyBorder);
+
+ self.borderWidth = 1.0;
+ self.cornerRadius = 5.0f;
+ self.shadowRadius = 1.0f;
+ self.shadowOpacity = 0.9f;
+ self.shadowOffset = CGSizeMake(0.0f, -2.0f);
+ self.anchorPoint = CGPointMake(0.5, 0.5);
+ }
+ return self;
+
+}
+
+const CGFloat paddingHighlightX = 4;
+const CGFloat paddingHighlightY = 2;
+
+-(void) drawInContext:(CGContextRef)context {
+ if (!sFind || !sFont)
+ return;
+
+ CFStringRef str = CFStringRef(sFind);
+
+ CFMutableDictionaryRef styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CGColorRef color = CGColorCreateGenericRGB(0.0, 0.0, 0.0, 1.0);
+ CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, color);
+ CTFontRef fontRef = ::CTFontCreateWithName((CFStringRef)sFont, fontSize, NULL);
+ CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
+
+ CFAttributedStringRef attrString = ::CFAttributedStringCreate(NULL, str, styleDict);
+ CTLineRef textLine = ::CTLineCreateWithAttributedString(attrString);
+ // Indent from corner of bounds
+ CGContextSetTextPosition(context, paddingHighlightX, 3 + paddingHighlightY);
+ CTLineDraw(textLine, context);
+
+ CFRelease(textLine);
+ CFRelease(attrString);
+ CFRelease(fontRef);
+ CGColorRelease(color);
+ CFRelease(styleDict);
+}
+
+- (void) animateMatch: (CGPoint)ptText bounce:(BOOL)bounce {
+ if (!self.sFind || ![self.sFind length]) {
+ [self hideMatch];
+ return;
+ }
+
+ CGFloat width = self.widthText + paddingHighlightX * 2;
+ CGFloat height = self.heightLine + paddingHighlightY * 2;
+
+ CGFloat flipper = self.geometryFlipped ? -1.0 : 1.0;
+
+ // Adjust for padding
+ ptText.x -= paddingHighlightX;
+ ptText.y += flipper * paddingHighlightY;
+
+ // Shift point to centre as expanding about centre
+ ptText.x += width / 2.0;
+ ptText.y -= flipper * height / 2.0;
+
+ [CATransaction begin];
+ [CATransaction setValue:[NSNumber numberWithFloat:0.0] forKey:kCATransactionAnimationDuration];
+ self.bounds = CGRectMake(0,0, width, height);
+ self.position = ptText;
+ if (bounce) {
+ // Do not reset visibility when just moving
+ self.hidden = NO;
+ self.opacity = 1.0;
+ }
+ [self setNeedsDisplay];
+ [CATransaction commit];
+
+ if (bounce) {
+ CABasicAnimation *animBounce = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ animBounce.duration = 0.15;
+ animBounce.autoreverses = YES;
+ animBounce.removedOnCompletion = NO;
+ animBounce.fromValue = [NSNumber numberWithFloat: 1.0];
+ animBounce.toValue = [NSNumber numberWithFloat: 1.25];
+
+ if (self.retaining) {
+
+ [self addAnimation: animBounce forKey:@"animateFound"];
+
+ } else {
+
+ CABasicAnimation *animFade = [CABasicAnimation animationWithKeyPath:@"opacity"];
+ animFade.duration = 0.1;
+ animFade.beginTime = 0.4;
+ animFade.removedOnCompletion = NO;
+ animFade.fromValue = [NSNumber numberWithFloat: 1.0];
+ animFade.toValue = [NSNumber numberWithFloat: 0.0];
+
+ CAAnimationGroup *group = [CAAnimationGroup animation];
+ [group setDuration:0.5];
+ group.removedOnCompletion = NO;
+ group.fillMode = kCAFillModeForwards;
+ [group setAnimations:[NSArray arrayWithObjects:animBounce, animFade, nil]];
+
+ [self addAnimation:group forKey:@"animateFound"];
+ }
+ }
+}
+
+- (void) hideMatch {
+ self.sFind = @"";
+ self.positionFind = INVALID_POSITION;
+ self.hidden = YES;
+}
+
+@end
+
+#endif
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation TimerTarget
+
+- (id) init: (void*) target
+{
+ self = [super init];
+ if (self != nil)
+ {
+ mTarget = target;
+
+ // Get the default notification queue for the thread which created the instance (usually the
+ // main thread). We need that later for idle event processing.
+ NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+ notificationQueue = [[NSNotificationQueue alloc] initWithNotificationCenter: center];
+ [center addObserver: self selector: @selector(idleTriggered:) name: @"Idle" object: nil];
+ }
+ return self;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) dealloc
+{
+ NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+ [center removeObserver:self];
+ [notificationQueue release];
+ [super dealloc];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Method called by a timer installed by ScintillaCocoa. This two step approach is needed because
+ * a native Obj-C class is required as target for the timer.
+ */
+- (void) timerFired: (NSTimer*) timer
+{
+ reinterpret_cast<ScintillaCocoa*>(mTarget)->TimerFired(timer);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Another timer callback for the idle timer.
+ */
+- (void) idleTimerFired: (NSTimer*) timer
+{
+#pragma unused(timer)
+ // Idle timer event.
+ // Post a new idle notification, which gets executed when the run loop is idle.
+ // Since we are coalescing on name and sender there will always be only one actual notification
+ // even for multiple requests.
+ NSNotification *notification = [NSNotification notificationWithName: @"Idle" object: self];
+ [notificationQueue enqueueNotification: notification
+ postingStyle: NSPostWhenIdle
+ coalesceMask: (NSNotificationCoalescingOnName | NSNotificationCoalescingOnSender)
+ forModes: nil];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Another step for idle events. The timer (for idle events) simply requests a notification on
+ * idle time. Only when this notification is send we actually call back the editor.
+ */
+- (void) idleTriggered: (NSNotification*) notification
+{
+#pragma unused(notification)
+ reinterpret_cast<ScintillaCocoa*>(mTarget)->IdleTimerFired();
+}
+
+@end
+
+//----------------- ScintillaCocoa -----------------------------------------------------------------
+
+ScintillaCocoa::ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin)
+{
+ vs.marginInside = false;
+ wMain = view; // Don't retain since we're owned by view, which would cause a cycle
+ wMargin = viewMargin;
+ timerTarget = [[TimerTarget alloc] init: this];
+ lastMouseEvent = NULL;
+ delegate = NULL;
+ notifyObj = NULL;
+ notifyProc = NULL;
+ capturedMouse = false;
+ enteredSetScrollingSize = false;
+ scrollSpeed = 1;
+ scrollTicks = 2000;
+ tickTimer = NULL;
+ idleTimer = NULL;
+ observer = NULL;
+ layerFindIndicator = NULL;
+ imeInteraction = imeInline;
+ for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast<TickReason>(tr+1))
+ {
+ timers[tr] = nil;
+ }
+ Initialise();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+ScintillaCocoa::~ScintillaCocoa()
+{
+ Finalise();
+ [timerTarget release];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Core initialization of the control. Everything that needs to be set up happens here.
+ */
+void ScintillaCocoa::Initialise()
+{
+ Scintilla_LinkLexers();
+
+ // Tell Scintilla not to buffer: Quartz buffers drawing for us.
+ WndProc(SCI_SETBUFFEREDDRAW, 0, 0);
+
+ // We are working with Unicode exclusively.
+ WndProc(SCI_SETCODEPAGE, SC_CP_UTF8, 0);
+
+ // Add Mac specific key bindings.
+ for (int i = 0; macMapDefault[i].key; i++)
+ kmap.AssignCmdKey(macMapDefault[i].key, macMapDefault[i].modifiers, macMapDefault[i].msg);
+
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * We need some clean up. Do it here.
+ */
+void ScintillaCocoa::Finalise()
+{
+ ObserverRemove();
+ for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast<TickReason>(tr+1))
+ {
+ FineTickerCancel(tr);
+ }
+ ScintillaBase::Finalise();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::UpdateObserver(CFRunLoopObserverRef /* observer */, CFRunLoopActivity /* activity */, void *info) {
+ ScintillaCocoa* sci = reinterpret_cast<ScintillaCocoa*>(info);
+ sci->IdleWork();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Add an observer to the run loop to perform styling as high-priority idle task.
+ */
+
+void ScintillaCocoa::ObserverAdd() {
+ if (!observer) {
+ CFRunLoopObserverContext context;
+ context.version = 0;
+ context.info = this;
+ context.retain = NULL;
+ context.release = NULL;
+ context.copyDescription = NULL;
+
+ CFRunLoopRef mainRunLoop = CFRunLoopGetMain();
+ observer = CFRunLoopObserverCreate(NULL, kCFRunLoopEntry | kCFRunLoopBeforeWaiting,
+ true, 0, UpdateObserver, &context);
+ CFRunLoopAddObserver(mainRunLoop, observer, kCFRunLoopCommonModes);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Remove the run loop observer.
+ */
+void ScintillaCocoa::ObserverRemove() {
+ if (observer) {
+ CFRunLoopRef mainRunLoop = CFRunLoopGetMain();
+ CFRunLoopRemoveObserver(mainRunLoop, observer, kCFRunLoopCommonModes);
+ CFRelease(observer);
+ }
+ observer = NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::IdleWork() {
+ Editor::IdleWork();
+ ObserverRemove();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::QueueIdleWork(WorkNeeded::workItems items, int upTo) {
+ Editor::QueueIdleWork(items, upTo);
+ ObserverAdd();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convert a core foundation string into an array of bytes in a particular encoding
+ */
+
+static char *EncodedBytes(CFStringRef cfsRef, CFStringEncoding encoding) {
+ CFRange rangeAll = {0, CFStringGetLength(cfsRef)};
+ CFIndex usedLen = 0;
+ CFStringGetBytes(cfsRef, rangeAll, encoding, '?',
+ false, NULL, 0, &usedLen);
+
+ char *buffer = new char[usedLen+1];
+ CFStringGetBytes(cfsRef, rangeAll, encoding, '?',
+ false, (UInt8 *)buffer,usedLen, NULL);
+ buffer[usedLen] = '\0';
+ return buffer;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convert a core foundation string into a std::string in a particular encoding
+ */
+
+static std::string EncodedBytesString(CFStringRef cfsRef, CFStringEncoding encoding) {
+ const CFRange rangeAll = {0, CFStringGetLength(cfsRef)};
+ CFIndex usedLen = 0;
+ CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false,
+ NULL, 0, &usedLen);
+
+ std::string buffer(usedLen, '\0');
+ if (usedLen > 0) {
+ CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false,
+ reinterpret_cast<UInt8 *>(&buffer[0]), usedLen, NULL);
+ }
+ return buffer;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Case folders.
+ */
+
+class CaseFolderDBCS : public CaseFolderTable {
+ CFStringEncoding encoding;
+public:
+ explicit CaseFolderDBCS(CFStringEncoding encoding_) : encoding(encoding_) {
+ StandardASCII();
+ }
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if ((lenMixed == 1) && (sizeFolded > 0)) {
+ folded[0] = mapping[static_cast<unsigned char>(mixed[0])];
+ return 1;
+ } else {
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(mixed),
+ lenMixed, encoding, false);
+
+ NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch
+ locale:[NSLocale currentLocale]];
+
+ char *encoded = EncodedBytes((CFStringRef)sMapped, encoding);
+
+ size_t lenMapped = strlen(encoded);
+ if (lenMapped < sizeFolded) {
+ memcpy(folded, encoded, lenMapped);
+ } else {
+ folded[0] = '\0';
+ lenMapped = 1;
+ }
+ delete []encoded;
+ CFRelease(cfsVal);
+ return lenMapped;
+ }
+ }
+};
+
+CaseFolder *ScintillaCocoa::CaseFolderForEncoding() {
+ if (pdoc->dbcsCodePage == SC_CP_UTF8) {
+ return new CaseFolderUnicode();
+ } else {
+ CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ if (pdoc->dbcsCodePage == 0) {
+ CaseFolderTable *pcf = new CaseFolderTable();
+ pcf->StandardASCII();
+ // Only for single byte encodings
+ for (int i=0x80; i<0x100; i++) {
+ char sCharacter[2] = "A";
+ sCharacter[0] = static_cast<char>(i);
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(sCharacter),
+ 1, encoding, false);
+ if (!cfsVal)
+ continue;
+
+ NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch
+ locale:[NSLocale currentLocale]];
+
+ char *encoded = EncodedBytes((CFStringRef)sMapped, encoding);
+
+ if (strlen(encoded) == 1) {
+ pcf->SetTranslation(sCharacter[0], encoded[0]);
+ }
+
+ delete []encoded;
+ CFRelease(cfsVal);
+ }
+ return pcf;
+ } else {
+ return new CaseFolderDBCS(encoding);
+ }
+ return 0;
+ }
+}
+
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Case-fold the given string depending on the specified case mapping type.
+ */
+std::string ScintillaCocoa::CaseMapString(const std::string &s, int caseMapping)
+{
+ if ((s.size() == 0) || (caseMapping == cmSame))
+ return s;
+
+ if (IsUnicodeMode()) {
+ std::string retMapped(s.length() * maxExpansionCaseConversion, 0);
+ size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(),
+ (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower);
+ retMapped.resize(lenMapped);
+ return retMapped;
+ }
+
+ CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(s.c_str()),
+ s.length(), encoding, false);
+
+ NSString *sMapped;
+ switch (caseMapping)
+ {
+ case cmUpper:
+ sMapped = [(NSString *)cfsVal uppercaseString];
+ break;
+ case cmLower:
+ sMapped = [(NSString *)cfsVal lowercaseString];
+ break;
+ default:
+ sMapped = (NSString *)cfsVal;
+ }
+
+ // Back to encoding
+ char *encoded = EncodedBytes((CFStringRef)sMapped, encoding);
+ std::string result(encoded);
+ delete []encoded;
+ CFRelease(cfsVal);
+ return result;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Cancel all modes, both for base class and any find indicator.
+ */
+void ScintillaCocoa::CancelModes() {
+ ScintillaBase::CancelModes();
+ HideFindIndicator();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper function to get the scrolling view.
+ */
+NSScrollView* ScintillaCocoa::ScrollContainer() const {
+ NSView* container = static_cast<NSView*>(wMain.GetID());
+ return static_cast<NSScrollView*>([[container superview] superview]);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper function to get the inner container which represents the actual "canvas" we work with.
+ */
+SCIContentView* ScintillaCocoa::ContentView()
+{
+ return static_cast<SCIContentView*>(wMain.GetID());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Return the top left visible point relative to the origin point of the whole document.
+ */
+Scintilla::Point ScintillaCocoa::GetVisibleOriginInMain() const
+{
+ NSScrollView *scrollView = ScrollContainer();
+ NSRect contentRect = [[scrollView contentView] bounds];
+ return Point(static_cast<XYPOSITION>(contentRect.origin.x), static_cast<XYPOSITION>(contentRect.origin.y));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Instead of returning the size of the inner view we have to return the visible part of it
+ * in order to make scrolling working properly.
+ * The returned value is in document coordinates.
+ */
+PRectangle ScintillaCocoa::GetClientRectangle() const
+{
+ NSScrollView *scrollView = ScrollContainer();
+ NSSize size = [[scrollView contentView] bounds].size;
+ Point origin = GetVisibleOriginInMain();
+ return PRectangle(origin.x, origin.y, static_cast<XYPOSITION>(origin.x+size.width),
+ static_cast<XYPOSITION>(origin.y + size.height));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Allow for prepared rectangle
+ */
+PRectangle ScintillaCocoa::GetClientDrawingRectangle() {
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080
+ NSView *content = ContentView();
+ if ([content respondsToSelector: @selector(setPreparedContentRect:)]) {
+ NSRect rcPrepared = [content preparedContentRect];
+ if (!NSIsEmptyRect(rcPrepared))
+ return NSRectToPRectangle(rcPrepared);
+ }
+#endif
+ return ScintillaCocoa::GetClientRectangle();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Converts the given point from base coordinates to local coordinates and at the same time into
+ * a native Point structure. Base coordinates are used for the top window used in the view hierarchy.
+ * Returned value is in view coordinates.
+ */
+Scintilla::Point ScintillaCocoa::ConvertPoint(NSPoint point)
+{
+ NSView* container = ContentView();
+ NSPoint result = [container convertPoint: point fromView: nil];
+ Scintilla::Point ptOrigin = GetVisibleOriginInMain();
+ return Point(static_cast<XYPOSITION>(result.x - ptOrigin.x), static_cast<XYPOSITION>(result.y - ptOrigin.y));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Do not clip like superclass as Cocoa is not reporting all of prepared area.
+ */
+void ScintillaCocoa::RedrawRect(PRectangle rc)
+{
+ if (!rc.Empty())
+ wMain.InvalidateRectangle(rc);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::DiscardOverdraw()
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080
+ // If running on 10.9, reset prepared area to visible area
+ NSView *content = ContentView();
+ if ([content respondsToSelector: @selector(setPreparedContentRect:)]) {
+ content.preparedContentRect = [content visibleRect];
+ }
+#endif
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Ensure all of prepared content is also redrawn.
+ */
+void ScintillaCocoa::Redraw()
+{
+ wMargin.InvalidateAll();
+ DiscardOverdraw();
+ wMain.InvalidateAll();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * A function to directly execute code that would usually go the long way via window messages.
+ * However this is a Windows metaphor and not used here, hence we just call our fake
+ * window proc. The given parameters directly reflect the message parameters used on Windows.
+ *
+ * @param ptr The target which is to be called.
+ * @param iMessage A code that indicates which message was sent.
+ * @param wParam One of the two free parameters for the message. Traditionally a word sized parameter
+ * (hence the w prefix).
+ * @param lParam The other of the two free parameters. A signed long.
+ */
+sptr_t ScintillaCocoa::DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
+ sptr_t lParam)
+{
+ return reinterpret_cast<ScintillaCocoa *>(ptr)->WndProc(iMessage, wParam, lParam);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * This method is very similar to DirectFunction. On Windows it sends a message (not in the Obj-C sense)
+ * to the target window. Here we simply call our fake window proc.
+ */
+sptr_t scintilla_send_message(void* sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+{
+ ScintillaView *control = reinterpret_cast<ScintillaView*>(sci);
+ return [control message:iMessage wParam:wParam lParam:lParam];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * That's our fake window procedure. On Windows each window has a dedicated procedure to handle
+ * commands (also used to synchronize UI and background threads), which is not the case in Cocoa.
+ *
+ * Messages handled here are almost solely for special commands of the backend. Everything which
+ * would be system messages on Windows (e.g. for key down, mouse move etc.) are handled by
+ * directly calling appropriate handlers.
+ */
+sptr_t ScintillaCocoa::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+{
+ switch (iMessage)
+ {
+ case SCI_GETDIRECTFUNCTION:
+ return reinterpret_cast<sptr_t>(DirectFunction);
+
+ case SCI_GETDIRECTPOINTER:
+ return reinterpret_cast<sptr_t>(this);
+
+ case SCI_TARGETASUTF8:
+ return TargetAsUTF8(reinterpret_cast<char*>(lParam));
+
+ case SCI_ENCODEDFROMUTF8:
+ return EncodedFromUTF8(reinterpret_cast<char*>(wParam),
+ reinterpret_cast<char*>(lParam));
+
+ case SCI_SETIMEINTERACTION:
+ // Only inline IME supported on Cocoa
+ break;
+
+ case SCI_GRABFOCUS:
+ [[ContentView() window] makeFirstResponder:ContentView()];
+ break;
+
+ case SCI_SETBUFFEREDDRAW:
+ // Buffered drawing not supported on Cocoa
+ view.bufferedDraw = false;
+ break;
+
+ case SCI_FINDINDICATORSHOW:
+ ShowFindIndicatorForRange(NSMakeRange(wParam, lParam-wParam), YES);
+ return 0;
+
+ case SCI_FINDINDICATORFLASH:
+ ShowFindIndicatorForRange(NSMakeRange(wParam, lParam-wParam), NO);
+ return 0;
+
+ case SCI_FINDINDICATORHIDE:
+ HideFindIndicator();
+ return 0;
+
+ default:
+ sptr_t r = ScintillaBase::WndProc(iMessage, wParam, lParam);
+
+ return r;
+ }
+ return 0l;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * In Windows lingo this is the handler which handles anything that wasn't handled in the normal
+ * window proc which would usually send the message back to generic window proc that Windows uses.
+ */
+sptr_t ScintillaCocoa::DefWndProc(unsigned int, uptr_t, sptr_t)
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Handle any ScintillaCocoa-specific ticking or call superclass.
+ */
+void ScintillaCocoa::TickFor(TickReason reason)
+{
+ if (reason == tickPlatform)
+ {
+ DragScroll();
+ }
+ else
+ {
+ Editor::TickFor(reason);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Report that this Editor subclass has a working implementation of FineTickerStart.
+ */
+bool ScintillaCocoa::FineTickerAvailable()
+{
+ return true;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Is a particular timer currently running?
+ */
+bool ScintillaCocoa::FineTickerRunning(TickReason reason)
+{
+ return timers[reason] != nil;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Start a fine-grained timer.
+ */
+void ScintillaCocoa::FineTickerStart(TickReason reason, int millis, int tolerance)
+{
+ FineTickerCancel(reason);
+ NSTimer *fineTimer = [NSTimer scheduledTimerWithTimeInterval: millis / 1000.0
+ target: timerTarget
+ selector: @selector(timerFired:)
+ userInfo: nil
+ repeats: YES];
+ if (tolerance && [fineTimer respondsToSelector: @selector(setTolerance:)])
+ {
+ [fineTimer setTolerance: tolerance / 1000.0];
+ }
+ timers[reason] = fineTimer;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Cancel a fine-grained timer.
+ */
+void ScintillaCocoa::FineTickerCancel(TickReason reason)
+{
+ if (timers[reason])
+ {
+ [timers[reason] invalidate];
+ timers[reason] = nil;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::SetIdle(bool on)
+{
+ if (idler.state != on)
+ {
+ idler.state = on;
+ if (idler.state)
+ {
+ // Scintilla ticks = milliseconds
+ idleTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0
+ target: timerTarget
+ selector: @selector(idleTimerFired:)
+ userInfo: nil
+ repeats: YES];
+ idler.idlerID = reinterpret_cast<IdlerID>(idleTimer);
+ }
+ else
+ if (idler.idlerID != NULL)
+ {
+ [reinterpret_cast<NSTimer*>(idler.idlerID) invalidate];
+ idler.idlerID = 0;
+ }
+ }
+ return true;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::CopyToClipboard(const SelectionText &selectedText)
+{
+ SetPasteboardData([NSPasteboard generalPasteboard], selectedText);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::Copy()
+{
+ if (!sel.Empty())
+ {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+ CopyToClipboard(selectedText);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::CanPaste()
+{
+ if (!Editor::CanPaste())
+ return false;
+
+ return GetPasteboardData([NSPasteboard generalPasteboard], NULL);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::Paste()
+{
+ Paste(false);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Pastes data from the paste board into the editor.
+ */
+void ScintillaCocoa::Paste(bool forceRectangular)
+{
+ SelectionText selectedText;
+ bool ok = GetPasteboardData([NSPasteboard generalPasteboard], &selectedText);
+ if (forceRectangular)
+ selectedText.rectangular = forceRectangular;
+
+ if (!ok || selectedText.Empty())
+ // No data or no flavor we support.
+ return;
+
+ pdoc->BeginUndoAction();
+ ClearSelection(false);
+ InsertPasteShape(selectedText.Data(), static_cast<int>(selectedText.Length()),
+ selectedText.rectangular ? pasteRectangular : pasteStream);
+ pdoc->EndUndoAction();
+
+ Redraw();
+ EnsureCaretVisible();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::CTPaint(void* gc, NSRect rc) {
+#pragma unused(rc)
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceWindow) {
+ surfaceWindow->Init(gc, wMain.GetID());
+ surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ct.codePage);
+ surfaceWindow->SetDBCSMode(ct.codePage);
+ ct.PaintCT(surfaceWindow);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ }
+}
+
+@interface CallTipView : NSControl {
+ ScintillaCocoa *sci;
+}
+
+@end
+
+@implementation CallTipView
+
+- (NSView*) initWithFrame: (NSRect) frame {
+ self = [super initWithFrame: frame];
+
+ if (self) {
+ sci = NULL;
+ }
+
+ return self;
+}
+
+- (void) dealloc {
+ [super dealloc];
+}
+
+- (BOOL) isFlipped {
+ return YES;
+}
+
+- (void) setSci: (ScintillaCocoa *) sci_ {
+ sci = sci_;
+}
+
+- (void) drawRect: (NSRect) needsDisplayInRect {
+ if (sci) {
+ CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
+ sci->CTPaint(context, needsDisplayInRect);
+ }
+}
+
+- (void) mouseDown: (NSEvent *) event {
+ if (sci) {
+ sci->CallTipMouseDown([event locationInWindow]);
+ }
+}
+
+// On OS X, only the key view should modify the cursor so the calltip can't.
+// This view does not become key so resetCursorRects never called.
+- (void) resetCursorRects {
+ //[super resetCursorRects];
+ //[self addCursorRect: [self bounds] cursor: [NSCursor arrowCursor]];
+}
+
+@end
+
+void ScintillaCocoa::CallTipMouseDown(NSPoint pt) {
+ NSRect rectBounds = [(NSView *)(ct.wDraw.GetID()) bounds];
+ Point location(static_cast<XYPOSITION>(pt.x),
+ static_cast<XYPOSITION>(rectBounds.size.height - pt.y));
+ ct.MouseClick(location);
+ CallTipClick();
+}
+
+static bool HeightDifferent(WindowID wCallTip, PRectangle rc) {
+ NSWindow *callTip = (NSWindow *)wCallTip;
+ CGFloat height = NSHeight([callTip frame]);
+ return height != rc.Height();
+}
+
+void ScintillaCocoa::CreateCallTipWindow(PRectangle rc) {
+ if (ct.wCallTip.Created() && HeightDifferent(ct.wCallTip.GetID(), rc)) {
+ ct.wCallTip.Destroy();
+ }
+ if (!ct.wCallTip.Created()) {
+ NSRect ctRect = NSMakeRect(rc.top,rc.bottom, rc.Width(), rc.Height());
+ NSWindow *callTip = [[NSWindow alloc] initWithContentRect: ctRect
+ styleMask: NSBorderlessWindowMask
+ backing: NSBackingStoreBuffered
+ defer: NO];
+ [callTip setLevel:NSFloatingWindowLevel];
+ [callTip setHasShadow:YES];
+ NSRect ctContent = NSMakeRect(0,0, rc.Width(), rc.Height());
+ CallTipView *caption = [[CallTipView alloc] initWithFrame: ctContent];
+ [caption setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin];
+ [caption setSci: this];
+ [[callTip contentView] addSubview: caption];
+ [callTip orderFront:caption];
+ ct.wCallTip = callTip;
+ ct.wDraw = caption;
+ }
+}
+
+void ScintillaCocoa::AddToPopUp(const char *label, int cmd, bool enabled)
+{
+ NSMenuItem* item;
+ ScintillaContextMenu *menu= reinterpret_cast<ScintillaContextMenu*>(popup.GetID());
+ [menu setOwner: this];
+ [menu setAutoenablesItems: NO];
+
+ if (cmd == 0) {
+ item = [NSMenuItem separatorItem];
+ } else {
+ item = [[[NSMenuItem alloc] init] autorelease];
+ [item setTitle: [NSString stringWithUTF8String: label]];
+ }
+ [item setTarget: menu];
+ [item setAction: @selector(handleCommand:)];
+ [item setTag: cmd];
+ [item setEnabled: enabled];
+
+ [menu addItem: item];
+}
+
+// -------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::ClaimSelection()
+{
+ // Mac OS X does not have a primary selection.
+}
+
+// -------------------------------------------------------------------------------------------------
+
+/**
+ * Returns the current caret position (which is tracked as an offset into the entire text string)
+ * as a row:column pair. The result is zero-based.
+ */
+NSPoint ScintillaCocoa::GetCaretPosition()
+{
+ const int line = pdoc->LineFromPosition(sel.RangeMain().caret.Position());
+ NSPoint result;
+
+ result.y = line;
+ result.x = sel.RangeMain().caret.Position() - pdoc->LineStart(line);
+ return result;
+}
+
+// -------------------------------------------------------------------------------------------------
+
+#pragma mark Drag
+
+/**
+ * Triggered by the tick timer on a regular basis to scroll the content during a drag operation.
+ */
+void ScintillaCocoa::DragScroll()
+{
+ if (!posDrag.IsValid())
+ {
+ scrollSpeed = 1;
+ scrollTicks = 2000;
+ return;
+ }
+
+ // TODO: does not work for wrapped lines, fix it.
+ int line = pdoc->LineFromPosition(posDrag.Position());
+ int currentVisibleLine = cs.DisplayFromDoc(line);
+ int lastVisibleLine = Platform::Minimum(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2;
+
+ if (currentVisibleLine <= topLine && topLine > 0)
+ ScrollTo(topLine - scrollSpeed);
+ else
+ if (currentVisibleLine >= lastVisibleLine)
+ ScrollTo(topLine + scrollSpeed);
+ else
+ {
+ scrollSpeed = 1;
+ scrollTicks = 2000;
+ return;
+ }
+
+ // TODO: also handle horizontal scrolling.
+
+ if (scrollSpeed == 1)
+ {
+ scrollTicks -= timer.tickSize;
+ if (scrollTicks <= 0)
+ {
+ scrollSpeed = 5;
+ scrollTicks = 2000;
+ }
+ }
+
+}
+
+//----------------- DragProviderSource -------------------------------------------------------
+
+@interface DragProviderSource : NSObject <NSPasteboardItemDataProvider>
+{
+ SelectionText selectedText;
+}
+
+@end
+
+@implementation DragProviderSource
+
+- (id)initWithSelectedText:(const SelectionText *)other
+{
+ self = [super init];
+
+ if (self) {
+ selectedText.Copy(*other);
+ }
+
+ return self;
+}
+
+- (void)pasteboard:(NSPasteboard *)pasteboard item:(NSPasteboardItem *)item provideDataForType:(NSString *)type
+{
+ if (selectedText.Length() == 0)
+ return;
+
+ if (([type compare: NSPasteboardTypeString] != NSOrderedSame) &&
+ ([type compare: ScintillaRecPboardType] != NSOrderedSame))
+ return;
+
+ CFStringEncoding encoding = EncodingFromCharacterSet(selectedText.codePage == SC_CP_UTF8,
+ selectedText.characterSet);
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(selectedText.Data()),
+ selectedText.Length(), encoding, false);
+
+ if ([type compare: NSPasteboardTypeString] == NSOrderedSame)
+ {
+ [pasteboard setString:(NSString *)cfsVal forType: NSStringPboardType];
+ }
+ else if ([type compare: ScintillaRecPboardType] == NSOrderedSame)
+ {
+ // This is specific to scintilla, allows us to drag rectangular selections around the document.
+ if (selectedText.rectangular)
+ [pasteboard setString:(NSString *)cfsVal forType: ScintillaRecPboardType];
+ }
+
+ if (cfsVal)
+ CFRelease(cfsVal);
+}
+
+@end
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called when a drag operation was initiated from within Scintilla.
+ */
+void ScintillaCocoa::StartDrag()
+{
+ if (sel.Empty())
+ return;
+
+ inDragDrop = ddDragging;
+
+ FineTickerStart(tickPlatform, timer.tickSize, 0);
+
+ // Put the data to be dragged on the drag pasteboard.
+ SelectionText selectedText;
+ NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName: NSDragPboard];
+ CopySelectionRange(&selectedText);
+ SetPasteboardData(pasteboard, selectedText);
+
+ // calculate the bounds of the selection
+ PRectangle client = GetTextRectangle();
+ int selStart = sel.RangeMain().Start().Position();
+ int selEnd = sel.RangeMain().End().Position();
+ int startLine = pdoc->LineFromPosition(selStart);
+ int endLine = pdoc->LineFromPosition(selEnd);
+ Point pt;
+ long startPos, endPos, ep;
+ PRectangle rcSel;
+
+ if (startLine==endLine && WndProc(SCI_GETWRAPMODE, 0, 0) != SC_WRAP_NONE) {
+ // Komodo bug http://bugs.activestate.com/show_bug.cgi?id=87571
+ // Scintilla bug https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3040200&group_id=2439
+ // If the width on a wrapped-line selection is negative,
+ // find a better bounding rectangle.
+
+ Point ptStart, ptEnd;
+ startPos = WndProc(SCI_GETLINESELSTARTPOSITION, startLine, 0);
+ endPos = WndProc(SCI_GETLINESELENDPOSITION, startLine, 0);
+ // step back a position if we're counting the newline
+ ep = WndProc(SCI_GETLINEENDPOSITION, startLine, 0);
+ if (endPos > ep) endPos = ep;
+ ptStart = LocationFromPosition(static_cast<int>(startPos));
+ ptEnd = LocationFromPosition(static_cast<int>(endPos));
+ if (ptStart.y == ptEnd.y) {
+ // We're just selecting part of one visible line
+ rcSel.left = ptStart.x;
+ rcSel.right = ptEnd.x < client.right ? ptEnd.x : client.right;
+ } else {
+ // Find the bounding box.
+ startPos = WndProc(SCI_POSITIONFROMLINE, startLine, 0);
+ rcSel.left = LocationFromPosition(static_cast<int>(startPos)).x;
+ rcSel.right = client.right;
+ }
+ rcSel.top = ptStart.y;
+ rcSel.bottom = ptEnd.y + vs.lineHeight;
+ if (rcSel.bottom > client.bottom) {
+ rcSel.bottom = client.bottom;
+ }
+ } else {
+ rcSel.top = rcSel.bottom = rcSel.right = rcSel.left = -1;
+ for (int l = startLine; l <= endLine; l++) {
+ startPos = WndProc(SCI_GETLINESELSTARTPOSITION, l, 0);
+ endPos = WndProc(SCI_GETLINESELENDPOSITION, l, 0);
+ if (endPos == startPos) continue;
+ // step back a position if we're counting the newline
+ ep = WndProc(SCI_GETLINEENDPOSITION, l, 0);
+ if (endPos > ep) endPos = ep;
+ pt = LocationFromPosition(static_cast<int>(startPos)); // top left of line selection
+ if (pt.x < rcSel.left || rcSel.left < 0) rcSel.left = pt.x;
+ if (pt.y < rcSel.top || rcSel.top < 0) rcSel.top = pt.y;
+ pt = LocationFromPosition(static_cast<int>(endPos)); // top right of line selection
+ pt.y += vs.lineHeight; // get to the bottom of the line
+ if (pt.x > rcSel.right || rcSel.right < 0) {
+ if (pt.x > client.right)
+ rcSel.right = client.right;
+ else
+ rcSel.right = pt.x;
+ }
+ if (pt.y > rcSel.bottom || rcSel.bottom < 0) {
+ if (pt.y > client.bottom)
+ rcSel.bottom = client.bottom;
+ else
+ rcSel.bottom = pt.y;
+ }
+ }
+ }
+ // must convert to global coordinates for drag regions, but also save the
+ // image rectangle for further calculations and copy operations
+
+ // Prepare drag image.
+ NSRect selectionRectangle = PRectangleToNSRect(rcSel);
+
+ SCIContentView* content = ContentView();
+
+ // To get a bitmap of the text we're dragging, we just use Paint on a pixmap surface.
+ SurfaceImpl *sw = new SurfaceImpl();
+ SurfaceImpl *pixmap = NULL;
+
+ bool lastHideSelection = view.hideSelection;
+ view.hideSelection = true;
+ if (sw)
+ {
+ pixmap = new SurfaceImpl();
+ if (pixmap)
+ {
+ PRectangle imageRect = rcSel;
+ paintState = painting;
+ sw->InitPixMap(static_cast<int>(client.Width()), static_cast<int>(client.Height()), NULL, NULL);
+ paintingAllText = true;
+ // Have to create a new context and make current as text drawing goes
+ // to the current context, not a passed context.
+ CGContextRef gcsw = sw->GetContext();
+ NSGraphicsContext *nsgc = [NSGraphicsContext graphicsContextWithGraphicsPort: gcsw
+ flipped: YES];
+ [NSGraphicsContext setCurrentContext:nsgc];
+ CGContextTranslateCTM(gcsw, -client.left, -client.top);
+ Paint(sw, client);
+ paintState = notPainting;
+
+ pixmap->InitPixMap(static_cast<int>(imageRect.Width()), static_cast<int>(imageRect.Height()), NULL, NULL);
+
+ CGContextRef gc = pixmap->GetContext();
+ // To make Paint() work on a bitmap, we have to flip our coordinates and translate the origin
+ CGContextTranslateCTM(gc, 0, imageRect.Height());
+ CGContextScaleCTM(gc, 1.0, -1.0);
+
+ pixmap->CopyImageRectangle(*sw, imageRect, PRectangle(0.0f, 0.0f, imageRect.Width(), imageRect.Height()));
+ // XXX TODO: overwrite any part of the image that is not part of the
+ // selection to make it transparent. right now we just use
+ // the full rectangle which may include non-selected text.
+ }
+ sw->Release();
+ delete sw;
+ }
+ view.hideSelection = lastHideSelection;
+
+ NSBitmapImageRep* bitmap = NULL;
+ if (pixmap)
+ {
+ CGImageRef imagePixmap = pixmap->GetImage();
+ if (imagePixmap)
+ bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap] autorelease];
+ CGImageRelease(imagePixmap);
+ pixmap->Release();
+ delete pixmap;
+ }
+
+ NSImage* image = [[[NSImage alloc] initWithSize: selectionRectangle.size] autorelease];
+ [image addRepresentation: bitmap];
+
+ NSImage* dragImage = [[[NSImage alloc] initWithSize: selectionRectangle.size] autorelease];
+ [dragImage setBackgroundColor: [NSColor clearColor]];
+ [dragImage lockFocus];
+ [image drawAtPoint: NSZeroPoint fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 0.5];
+ [dragImage unlockFocus];
+
+ NSPoint startPoint;
+ startPoint.x = selectionRectangle.origin.x + client.left;
+ startPoint.y = selectionRectangle.origin.y + selectionRectangle.size.height + client.top;
+
+ NSPasteboardItem *pbItem = [NSPasteboardItem new];
+ DragProviderSource *dps = [[[DragProviderSource alloc] initWithSelectedText:&selectedText] autorelease];
+
+ NSArray *pbTypes = selectedText.rectangular ?
+ @[NSPasteboardTypeString, ScintillaRecPboardType] :
+ @[NSPasteboardTypeString];
+ [pbItem setDataProvider:dps forTypes:pbTypes];
+ NSDraggingItem *dragItem = [[NSDraggingItem alloc ]initWithPasteboardWriter:pbItem];
+ [pbItem release];
+
+ NSScrollView *scrollContainer = ScrollContainer();
+ NSRect contentRect = [[scrollContainer contentView] bounds];
+ NSRect draggingRect = NSOffsetRect(selectionRectangle, contentRect.origin.x, contentRect.origin.y);
+ [dragItem setDraggingFrame:draggingRect contents:dragImage];
+ NSDraggingSession *dragSession =
+ [content beginDraggingSessionWithItems:@[[dragItem autorelease]]
+ event:lastMouseEvent
+ source:content];
+ dragSession.animatesToStartingPositionsOnCancelOrFail = YES;
+ dragSession.draggingFormation = NSDraggingFormationNone;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called when a drag operation reaches the control which was initiated outside.
+ */
+NSDragOperation ScintillaCocoa::DraggingEntered(id <NSDraggingInfo> info)
+{
+ FineTickerStart(tickPlatform, timer.tickSize, 0);
+ return DraggingUpdated(info);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called frequently during a drag operation if we are the target. Keep telling the caller
+ * what drag operation we accept and update the drop caret position to indicate the
+ * potential insertion point of the dragged data.
+ */
+NSDragOperation ScintillaCocoa::DraggingUpdated(id <NSDraggingInfo> info)
+{
+ // Convert the drag location from window coordinates to view coordinates and
+ // from there to a text position to finally set the drag position.
+ Point location = ConvertPoint([info draggingLocation]);
+ SetDragPosition(SPositionFromLocation(location));
+
+ NSDragOperation sourceDragMask = [info draggingSourceOperationMask];
+ if (sourceDragMask == NSDragOperationNone)
+ return sourceDragMask;
+
+ NSPasteboard* pasteboard = [info draggingPasteboard];
+
+ // Return what type of operation we will perform. Prefer move over copy.
+ if ([[pasteboard types] containsObject: NSStringPboardType] ||
+ [[pasteboard types] containsObject: ScintillaRecPboardType])
+ return (sourceDragMask & NSDragOperationMove) ? NSDragOperationMove : NSDragOperationCopy;
+
+ if ([[pasteboard types] containsObject: NSFilenamesPboardType])
+ return (sourceDragMask & NSDragOperationGeneric);
+ return NSDragOperationNone;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Resets the current drag position as we are no longer the drag target.
+ */
+void ScintillaCocoa::DraggingExited(id <NSDraggingInfo> info)
+{
+#pragma unused(info)
+ SetDragPosition(SelectionPosition(invalidPosition));
+ FineTickerCancel(tickPlatform);
+ inDragDrop = ddNone;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Here is where the real work is done. Insert the text from the pasteboard.
+ */
+bool ScintillaCocoa::PerformDragOperation(id <NSDraggingInfo> info)
+{
+ NSPasteboard* pasteboard = [info draggingPasteboard];
+
+ if ([[pasteboard types] containsObject: NSFilenamesPboardType])
+ {
+ NSArray* files = [pasteboard propertyListForType: NSFilenamesPboardType];
+ for (NSString* uri in files)
+ NotifyURIDropped([uri UTF8String]);
+ }
+ else
+ {
+ SelectionText text;
+ GetPasteboardData(pasteboard, &text);
+
+ if (text.Length() > 0)
+ {
+ NSDragOperation operation = [info draggingSourceOperationMask];
+ bool moving = (operation & NSDragOperationMove) != 0;
+
+ DropAt(posDrag, text.Data(), text.Length(), moving, text.rectangular);
+ };
+ }
+
+ return true;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::SetPasteboardData(NSPasteboard* board, const SelectionText &selectedText)
+{
+ if (selectedText.Length() == 0)
+ return;
+
+ CFStringEncoding encoding = EncodingFromCharacterSet(selectedText.codePage == SC_CP_UTF8,
+ selectedText.characterSet);
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(selectedText.Data()),
+ selectedText.Length(), encoding, false);
+
+ NSArray *pbTypes = selectedText.rectangular ?
+ [NSArray arrayWithObjects: NSStringPboardType, ScintillaRecPboardType, nil] :
+ [NSArray arrayWithObjects: NSStringPboardType, nil];
+ [board declareTypes:pbTypes owner:nil];
+
+ if (selectedText.rectangular)
+ {
+ // This is specific to scintilla, allows us to drag rectangular selections around the document.
+ [board setString: (NSString *)cfsVal forType: ScintillaRecPboardType];
+ }
+
+ [board setString: (NSString *)cfsVal forType: NSStringPboardType];
+
+ if (cfsVal)
+ CFRelease(cfsVal);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper method to retrieve the best fitting alternative from the general pasteboard.
+ */
+bool ScintillaCocoa::GetPasteboardData(NSPasteboard* board, SelectionText* selectedText)
+{
+ NSArray* supportedTypes = [NSArray arrayWithObjects: ScintillaRecPboardType,
+ NSStringPboardType,
+ nil];
+ NSString *bestType = [board availableTypeFromArray: supportedTypes];
+ NSString* data = [board stringForType: bestType];
+
+ if (data != nil)
+ {
+ if (selectedText != nil)
+ {
+ CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ CFRange rangeAll = {0, static_cast<CFIndex>([data length])};
+ CFIndex usedLen = 0;
+ CFStringGetBytes((CFStringRef)data, rangeAll, encoding, '?',
+ false, NULL, 0, &usedLen);
+
+ std::vector<UInt8> buffer(usedLen);
+
+ CFStringGetBytes((CFStringRef)data, rangeAll, encoding, '?',
+ false, buffer.data(),usedLen, NULL);
+
+ bool rectangular = bestType == ScintillaRecPboardType;
+
+ std::string dest(reinterpret_cast<const char *>(buffer.data()), usedLen);
+
+ selectedText->Copy(dest, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet , rectangular, false);
+ }
+ return true;
+ }
+
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// Returns the target converted to UTF8.
+// Return the length in bytes.
+int ScintillaCocoa::TargetAsUTF8(char *text)
+{
+ const int targetLength = targetEnd - targetStart;
+ if (IsUnicodeMode())
+ {
+ if (text)
+ pdoc->GetCharRange(text, targetStart, targetLength);
+ }
+ else
+ {
+ // Need to convert
+ const CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ const std::string s = RangeText(targetStart, targetEnd);
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(s.c_str()),
+ s.length(), encoding, false);
+
+ const std::string tmputf = EncodedBytesString(cfsVal, kCFStringEncodingUTF8);
+
+ if (text)
+ memcpy(text, tmputf.c_str(), tmputf.length());
+ CFRelease(cfsVal);
+ return tmputf.length();
+ }
+ return targetLength;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// Translates a UTF8 string into the document encoding.
+// Return the length of the result in bytes.
+int ScintillaCocoa::EncodedFromUTF8(char *utf8, char *encoded) const
+{
+ const int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8);
+ if (IsUnicodeMode())
+ {
+ if (encoded)
+ memcpy(encoded, utf8, inputLength);
+ return inputLength;
+ }
+ else
+ {
+ // Need to convert
+ const CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+
+ CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(utf8),
+ inputLength, kCFStringEncodingUTF8, false);
+ const std::string sEncoded = EncodedBytesString(cfsVal, encoding);
+ if (encoded)
+ memcpy(encoded, sEncoded.c_str(), sEncoded.length());
+ CFRelease(cfsVal);
+ return sEncoded.length();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::SetMouseCapture(bool on)
+{
+ capturedMouse = on;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::HaveMouseCapture()
+{
+ return capturedMouse;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Synchronously paint a rectangle of the window.
+ */
+bool ScintillaCocoa::SyncPaint(void* gc, PRectangle rc)
+{
+ paintState = painting;
+ rcPaint = rc;
+ PRectangle rcText = GetTextRectangle();
+ paintingAllText = rcPaint.Contains(rcText);
+ bool succeeded = true;
+ Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (sw)
+ {
+ CGContextSetAllowsAntialiasing((CGContextRef)gc,
+ vs.extraFontFlag != SC_EFF_QUALITY_NON_ANTIALIASED);
+ CGContextSetAllowsFontSmoothing((CGContextRef)gc,
+ vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED);
+ CGContextSetAllowsFontSubpixelPositioning((CGContextRef)gc,
+ vs.extraFontFlag == SC_EFF_QUALITY_DEFAULT ||
+ vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED);
+ sw->Init(gc, wMain.GetID());
+ Paint(sw, rc);
+ succeeded = paintState != paintAbandoned;
+ sw->Release();
+ delete sw;
+ }
+ paintState = notPainting;
+ if (!succeeded)
+ {
+ NSView *marginView = static_cast<NSView*>(wMargin.GetID());
+ [marginView setNeedsDisplay:YES];
+ }
+ return succeeded;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Paint the margin into the SCIMarginView space.
+ */
+void ScintillaCocoa::PaintMargin(NSRect aRect)
+{
+ CGContextRef gc = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
+
+ PRectangle rc = NSRectToPRectangle(aRect);
+ rcPaint = rc;
+ Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (sw)
+ {
+ CGContextSetAllowsAntialiasing(gc,
+ vs.extraFontFlag != SC_EFF_QUALITY_NON_ANTIALIASED);
+ CGContextSetAllowsFontSmoothing(gc,
+ vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED);
+ CGContextSetAllowsFontSubpixelPositioning(gc,
+ vs.extraFontFlag == SC_EFF_QUALITY_DEFAULT ||
+ vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED);
+ sw->Init(gc, wMargin.GetID());
+ PaintSelMargin(sw, rc);
+ sw->Release();
+ delete sw;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Prepare for drawing.
+ *
+ * @param rect The area that will be drawn, given in the sender's coordinate system.
+ */
+void ScintillaCocoa::WillDraw(NSRect rect)
+{
+ RefreshStyleData();
+ PRectangle rcWillDraw = NSRectToPRectangle(rect);
+ int positionAfterRect = PositionAfterArea(rcWillDraw);
+ pdoc->EnsureStyledTo(positionAfterRect);
+ NotifyUpdateUI();
+ if (WrapLines(wsVisible)) {
+ // Wrap may have reduced number of lines so more lines may need to be styled
+ positionAfterRect = PositionAfterArea(rcWillDraw);
+ pdoc->EnsureStyledTo(positionAfterRect);
+ // The wrapping process has changed the height of some lines so redraw all.
+ Redraw();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * ScrollText is empty because scrolling is handled by the NSScrollView.
+ */
+void ScintillaCocoa::ScrollText(int)
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Modifies the vertical scroll position to make the current top line show up as such.
+ */
+void ScintillaCocoa::SetVerticalScrollPos()
+{
+ NSScrollView *scrollView = ScrollContainer();
+ if (scrollView) {
+ NSClipView *clipView = [scrollView contentView];
+ NSRect contentRect = [clipView bounds];
+ [clipView scrollToPoint: NSMakePoint(contentRect.origin.x, topLine * vs.lineHeight)];
+ [scrollView reflectScrolledClipView:clipView];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Modifies the horizontal scroll position to match xOffset.
+ */
+void ScintillaCocoa::SetHorizontalScrollPos()
+{
+ PRectangle textRect = GetTextRectangle();
+
+ int maxXOffset = scrollWidth - static_cast<int>(textRect.Width());
+ if (maxXOffset < 0)
+ maxXOffset = 0;
+ if (xOffset > maxXOffset)
+ xOffset = maxXOffset;
+ NSScrollView *scrollView = ScrollContainer();
+ if (scrollView) {
+ NSClipView * clipView = [scrollView contentView];
+ NSRect contentRect = [clipView bounds];
+ [clipView scrollToPoint: NSMakePoint(xOffset, contentRect.origin.y)];
+ [scrollView reflectScrolledClipView:clipView];
+ }
+ MoveFindIndicatorWithBounce(NO);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to adjust both scrollers to reflect the current scroll range and position in the editor.
+ * Arguments no longer used as NSScrollView handles details of scroll bar sizes.
+ *
+ * @param nMax Number of lines in the editor.
+ * @param nPage Number of lines per scroll page.
+ * @return True if there was a change, otherwise false.
+ */
+bool ScintillaCocoa::ModifyScrollBars(int nMax, int nPage)
+{
+#pragma unused(nMax, nPage)
+ return SetScrollingSize();
+}
+
+bool ScintillaCocoa::SetScrollingSize(void) {
+ bool changes = false;
+ SCIContentView *inner = ContentView();
+ if (!enteredSetScrollingSize) {
+ enteredSetScrollingSize = true;
+ NSScrollView *scrollView = ScrollContainer();
+ NSClipView *clipView = [ScrollContainer() contentView];
+ NSRect clipRect = [clipView bounds];
+ CGFloat docHeight = cs.LinesDisplayed() * vs.lineHeight;
+ if (!endAtLastLine)
+ docHeight += (int([scrollView bounds].size.height / vs.lineHeight)-3) * vs.lineHeight;
+ // Allow extra space so that last scroll position places whole line at top
+ int clipExtra = int(clipRect.size.height) % vs.lineHeight;
+ docHeight += clipExtra;
+ // Ensure all of clipRect covered by Scintilla drawing
+ if (docHeight < clipRect.size.height)
+ docHeight = clipRect.size.height;
+ CGFloat docWidth = scrollWidth;
+ bool showHorizontalScroll = horizontalScrollBarVisible &&
+ !Wrapping();
+ if (!showHorizontalScroll)
+ docWidth = clipRect.size.width;
+ NSRect contentRect = {{0, 0}, {docWidth, docHeight}};
+ NSRect contentRectNow = [inner frame];
+ changes = (contentRect.size.width != contentRectNow.size.width) ||
+ (contentRect.size.height != contentRectNow.size.height);
+ if (changes) {
+ [inner setFrame: contentRect];
+ }
+ [scrollView setHasVerticalScroller: verticalScrollBarVisible];
+ [scrollView setHasHorizontalScroller: showHorizontalScroll];
+ SetVerticalScrollPos();
+ enteredSetScrollingSize = false;
+ }
+ [inner.owner setMarginWidth: vs.fixedColumnWidth];
+ return changes;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::Resize()
+{
+ SetScrollingSize();
+ ChangeSize();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Update fields to match scroll position after receiving a notification that the user has scrolled.
+ */
+void ScintillaCocoa::UpdateForScroll() {
+ Point ptOrigin = GetVisibleOriginInMain();
+ xOffset = static_cast<int>(ptOrigin.x);
+ int newTop = Platform::Minimum(static_cast<int>(ptOrigin.y / vs.lineHeight), MaxScrollPos());
+ SetTopLine(newTop);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Register a delegate that will be called for notifications and commands.
+ * This provides similar functionality to RegisterNotifyCallback but in an
+ * Objective C way.
+ *
+ * @param delegate_ A pointer to an object that implements ScintillaNotificationProtocol.
+ */
+
+void ScintillaCocoa::SetDelegate(id<ScintillaNotificationProtocol> delegate_)
+{
+ delegate = delegate_;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to register a callback function for a given window. This is used to emulate the way
+ * Windows notifies other controls (mainly up in the view hierarchy) about certain events.
+ *
+ * @param windowid A handle to a window. That value is generic and can be anything. It is passed
+ * through to the callback.
+ * @param callback The callback function to be used for future notifications. If NULL then no
+ * notifications will be sent anymore.
+ */
+void ScintillaCocoa::RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback)
+{
+ notifyObj = windowid;
+ notifyProc = callback;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::NotifyChange()
+{
+ if (notifyProc != NULL)
+ notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(static_cast<short>(GetCtrlID()), SCEN_CHANGE),
+ (uintptr_t) this);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::NotifyFocus(bool focus)
+{
+ if (notifyProc != NULL)
+ notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(static_cast<short>(GetCtrlID()),
+ (focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS)),
+ (uintptr_t) this);
+
+ Editor::NotifyFocus(focus);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to send a notification (as WM_NOTIFY call) to the procedure, which has been set by the call
+ * to RegisterNotifyCallback (so it is not necessarily the parent window).
+ *
+ * @param scn The notification to send.
+ */
+void ScintillaCocoa::NotifyParent(SCNotification scn)
+{
+ scn.nmhdr.hwndFrom = (void*) this;
+ scn.nmhdr.idFrom = GetCtrlID();
+ if (notifyProc != NULL)
+ notifyProc(notifyObj, WM_NOTIFY, GetCtrlID(), (uintptr_t) &scn);
+ if (delegate)
+ [delegate notification:&scn];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::NotifyURIDropped(const char *uri)
+{
+ SCNotification scn;
+ scn.nmhdr.code = SCN_URIDROPPED;
+ scn.text = uri;
+
+ NotifyParent(scn);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::HasSelection()
+{
+ return !sel.Empty();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::CanUndo()
+{
+ return pdoc->CanUndo();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+bool ScintillaCocoa::CanRedo()
+{
+ return pdoc->CanRedo();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::TimerFired(NSTimer* timer)
+{
+ for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast<TickReason>(tr+1))
+ {
+ if (timers[tr] == timer)
+ {
+ TickFor(tr);
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::IdleTimerFired()
+{
+ bool more = Idle();
+ if (!more)
+ SetIdle(false);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Main entry point for drawing the control.
+ *
+ * @param rect The area to paint, given in the sender's coordinate system.
+ * @param gc The context we can use to paint.
+ */
+bool ScintillaCocoa::Draw(NSRect rect, CGContextRef gc)
+{
+ return SyncPaint(gc, NSRectToPRectangle(rect));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper function to translate OS X key codes to Scintilla key codes.
+ */
+static inline UniChar KeyTranslate(UniChar unicodeChar)
+{
+ switch (unicodeChar)
+ {
+ case NSDownArrowFunctionKey:
+ return SCK_DOWN;
+ case NSUpArrowFunctionKey:
+ return SCK_UP;
+ case NSLeftArrowFunctionKey:
+ return SCK_LEFT;
+ case NSRightArrowFunctionKey:
+ return SCK_RIGHT;
+ case NSHomeFunctionKey:
+ return SCK_HOME;
+ case NSEndFunctionKey:
+ return SCK_END;
+ case NSPageUpFunctionKey:
+ return SCK_PRIOR;
+ case NSPageDownFunctionKey:
+ return SCK_NEXT;
+ case NSDeleteFunctionKey:
+ return SCK_DELETE;
+ case NSInsertFunctionKey:
+ return SCK_INSERT;
+ case '\n':
+ case 3:
+ return SCK_RETURN;
+ case 27:
+ return SCK_ESCAPE;
+ case 127:
+ return SCK_BACK;
+ case '\t':
+ case 25: // Shift tab, return to unmodified tab and handle that via modifiers.
+ return SCK_TAB;
+ default:
+ return unicodeChar;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Translate NSEvent modifier flags into SCI_* modifier flags.
+ *
+ * @param modifiers An integer bit set of NSSEvent modifier flags.
+ * @return A set of SCI_* modifier flags.
+ */
+static int TranslateModifierFlags(NSUInteger modifiers)
+{
+ // Signal Control as SCI_META
+ return
+ (((modifiers & NSShiftKeyMask) != 0) ? SCI_SHIFT : 0) |
+ (((modifiers & NSCommandKeyMask) != 0) ? SCI_CTRL : 0) |
+ (((modifiers & NSAlternateKeyMask) != 0) ? SCI_ALT : 0) |
+ (((modifiers & NSControlKeyMask) != 0) ? SCI_META : 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Main keyboard input handling method. It is called for any key down event, including function keys,
+ * numeric keypad input and whatnot.
+ *
+ * @param event The event instance associated with the key down event.
+ * @return True if the input was handled, false otherwise.
+ */
+bool ScintillaCocoa::KeyboardInput(NSEvent* event)
+{
+ // For now filter out function keys.
+ NSString* input = [event characters];
+
+ bool handled = false;
+
+ // Handle each entry individually. Usually we only have one entry anyway.
+ for (size_t i = 0; i < input.length; i++)
+ {
+ const UniChar originalKey = [input characterAtIndex: i];
+ UniChar key = KeyTranslate(originalKey);
+
+ bool consumed = false; // Consumed as command?
+
+ if (KeyDownWithModifiers(key, TranslateModifierFlags([event modifierFlags]), &consumed))
+ handled = true;
+ if (consumed)
+ handled = true;
+ }
+
+ return handled;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to insert already processed text provided by the Cocoa text input system.
+ */
+int ScintillaCocoa::InsertText(NSString* input)
+{
+ CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ std::string encoded = EncodedBytesString((CFStringRef)input, encoding);
+
+ if (encoded.length() > 0)
+ {
+ AddCharUTF((char*) encoded.c_str(), static_cast<unsigned int>(encoded.length()), false);
+ }
+ return static_cast<int>(encoded.length());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convert from a range of characters to a range of bytes.
+ */
+NSRange ScintillaCocoa::PositionsFromCharacters(NSRange range) const
+{
+ long start = pdoc->GetRelativePositionUTF16(0, range.location);
+ if (start == INVALID_POSITION)
+ start = pdoc->Length();
+ long end = pdoc->GetRelativePositionUTF16(start, range.length);
+ if (end == INVALID_POSITION)
+ end = pdoc->Length();
+ return NSMakeRange(start, end - start);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convert from a range of characters from a range of bytes.
+ */
+NSRange ScintillaCocoa::CharactersFromPositions(NSRange range) const
+{
+ const long start = pdoc->CountUTF16(0, range.location);
+ const long len = pdoc->CountUTF16(range.location, NSMaxRange(range));
+ return NSMakeRange(start, len);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to ensure that only one selection is active for input composition as composition
+ * does not support multi-typing.
+ */
+void ScintillaCocoa::SelectOnlyMainSelection()
+{
+ sel.SetSelection(sel.RangeMain());
+ Redraw();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convert virtual space before selection into real space.
+ */
+void ScintillaCocoa::ConvertSelectionVirtualSpace()
+{
+ FillVirtualSpace();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Erase all selected text and return whether the selection is now empty.
+ * The selection may not be empty if the selection contained protected text.
+ */
+bool ScintillaCocoa::ClearAllSelections()
+{
+ ClearSelection(true);
+ return sel.Empty();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Start composing for IME.
+ */
+void ScintillaCocoa::CompositionStart()
+{
+ if (!sel.Empty())
+ {
+ NSLog(@"Selection not empty when starting composition");
+ }
+ pdoc->TentativeStart();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Commit the IME text.
+ */
+void ScintillaCocoa::CompositionCommit()
+{
+ pdoc->TentativeCommit();
+ pdoc->decorations.SetCurrentIndicator(INDIC_IME);
+ pdoc->DecorationFillRange(0, 0, pdoc->Length());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Remove the IME text.
+ */
+void ScintillaCocoa::CompositionUndo()
+{
+ pdoc->TentativeUndo();
+}
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * When switching documents discard any incomplete character composition state as otherwise tries to
+ * act on the new document.
+ */
+void ScintillaCocoa::SetDocPointer(Document *document)
+{
+ // Drop input composition.
+ NSTextInputContext *inctxt = [NSTextInputContext currentInputContext];
+ [inctxt discardMarkedText];
+ SCIContentView *inner = ContentView();
+ [inner unmarkText];
+ Editor::SetDocPointer(document);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by the owning view when the mouse pointer enters the control.
+ */
+void ScintillaCocoa::MouseEntered(NSEvent* event)
+{
+ if (!HaveMouseCapture())
+ {
+ WndProc(SCI_SETCURSOR, (long int)SC_CURSORNORMAL, 0);
+
+ // Mouse location is given in screen coordinates and might also be outside of our bounds.
+ Point location = ConvertPoint([event locationInWindow]);
+ ButtonMove(location);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::MouseExited(NSEvent* /* event */)
+{
+ // Nothing to do here.
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::MouseDown(NSEvent* event)
+{
+ Point location = ConvertPoint([event locationInWindow]);
+ NSTimeInterval time = [event timestamp];
+ bool command = ([event modifierFlags] & NSCommandKeyMask) != 0;
+ bool shift = ([event modifierFlags] & NSShiftKeyMask) != 0;
+ bool alt = ([event modifierFlags] & NSAlternateKeyMask) != 0;
+
+ ButtonDown(Point(location.x, location.y), (int) (time * 1000), shift, command, alt);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::MouseMove(NSEvent* event)
+{
+ lastMouseEvent = event;
+
+ ButtonMoveWithModifiers(ConvertPoint([event locationInWindow]), TranslateModifierFlags([event modifierFlags]));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::MouseUp(NSEvent* event)
+{
+ NSTimeInterval time = [event timestamp];
+ bool control = ([event modifierFlags] & NSControlKeyMask) != 0;
+
+ ButtonUp(ConvertPoint([event locationInWindow]), (int) (time * 1000), control);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::MouseWheel(NSEvent* event)
+{
+ bool command = ([event modifierFlags] & NSCommandKeyMask) != 0;
+ int dY = 0;
+
+ // In order to make scrolling with larger offset smoother we scroll less lines the larger the
+ // delta value is.
+ if ([event deltaY] < 0)
+ dY = -(int) sqrt(-10.0 * [event deltaY]);
+ else
+ dY = (int) sqrt(10.0 * [event deltaY]);
+
+ if (command)
+ {
+ // Zoom! We play with the font sizes in the styles.
+ // Number of steps/line is ignored, we just care if sizing up or down.
+ if (dY > 0.5)
+ KeyCommand(SCI_ZOOMIN);
+ else if (dY < -0.5)
+ KeyCommand(SCI_ZOOMOUT);
+ }
+ else
+ {
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// Helper methods for NSResponder actions.
+
+void ScintillaCocoa::SelectAll()
+{
+ Editor::SelectAll();
+}
+
+void ScintillaCocoa::DeleteBackward()
+{
+ KeyDown(SCK_BACK, false, false, false, nil);
+}
+
+void ScintillaCocoa::Cut()
+{
+ Editor::Cut();
+}
+
+void ScintillaCocoa::Undo()
+{
+ Editor::Undo();
+}
+
+void ScintillaCocoa::Redo()
+{
+ Editor::Redo();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Creates and returns a popup menu, which is then displayed by the Cocoa framework.
+ */
+NSMenu* ScintillaCocoa::CreateContextMenu(NSEvent* /* event */)
+{
+ // Call ScintillaBase to create the context menu.
+ ContextMenu(Point(0, 0));
+
+ return reinterpret_cast<NSMenu*>(popup.GetID());
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * An intermediate function to forward context menu commands from the menu action handler to
+ * scintilla.
+ */
+void ScintillaCocoa::HandleCommand(NSInteger command)
+{
+ Command(static_cast<int>(command));
+}
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::ActiveStateChanged(bool isActive)
+{
+ // If the window is being deactivated, lose the focus and turn off the ticking
+ if (!isActive) {
+ DropCaret();
+ //SetFocusState( false );
+ FineTickerCancel(tickCaret);
+ } else {
+ ShowCaretAtCurrentPosition();
+ }
+}
+
+// If building with old SDK, need to define version number for 10.8
+#ifndef NSAppKitVersionNumber10_8
+#define NSAppKitVersionNumber10_8 1187
+#endif
+
+//--------------------------------------------------------------------------------------------------
+
+void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ NSView *content = ContentView();
+ if (!layerFindIndicator)
+ {
+ layerFindIndicator = [[FindHighlightLayer alloc] init];
+ [content setWantsLayer: YES];
+ layerFindIndicator.geometryFlipped = content.layer.geometryFlipped;
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)
+ {
+ // Content layer is unflipped on 10.9, but the indicator shows wrong unless flipped
+ layerFindIndicator.geometryFlipped = YES;
+ }
+ [[content layer] addSublayer:layerFindIndicator];
+ }
+ [layerFindIndicator removeAnimationForKey:@"animateFound"];
+
+ if (charRange.length)
+ {
+ CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
+ vs.styles[STYLE_DEFAULT].characterSet);
+ std::vector<char> buffer(charRange.length);
+ pdoc->GetCharRange(&buffer[0], static_cast<int>(charRange.location), static_cast<int>(charRange.length));
+
+ CFStringRef cfsFind = CFStringCreateWithBytes(kCFAllocatorDefault,
+ reinterpret_cast<const UInt8 *>(&buffer[0]),
+ charRange.length, encoding, false);
+ layerFindIndicator.sFind = (NSString *)cfsFind;
+ if (cfsFind)
+ CFRelease(cfsFind);
+ layerFindIndicator.retaining = retaining;
+ layerFindIndicator.positionFind = static_cast<int>(charRange.location);
+ long style = WndProc(SCI_GETSTYLEAT, charRange.location, 0);
+ std::vector<char> bufferFontName(WndProc(SCI_STYLEGETFONT, style, 0) + 1);
+ WndProc(SCI_STYLEGETFONT, style, (sptr_t)&bufferFontName[0]);
+ layerFindIndicator.sFont = [NSString stringWithUTF8String: &bufferFontName[0]];
+
+ layerFindIndicator.fontSize = WndProc(SCI_STYLEGETSIZEFRACTIONAL, style, 0) /
+ (float)SC_FONT_SIZE_MULTIPLIER;
+ layerFindIndicator.widthText = WndProc(SCI_POINTXFROMPOSITION, 0, charRange.location + charRange.length) -
+ WndProc(SCI_POINTXFROMPOSITION, 0, charRange.location);
+ layerFindIndicator.heightLine = WndProc(SCI_TEXTHEIGHT, 0, 0);
+ MoveFindIndicatorWithBounce(YES);
+ }
+ else
+ {
+ [layerFindIndicator hideMatch];
+ }
+#endif
+}
+
+void ScintillaCocoa::MoveFindIndicatorWithBounce(BOOL bounce)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ if (layerFindIndicator)
+ {
+ CGPoint ptText = CGPointMake(
+ WndProc(SCI_POINTXFROMPOSITION, 0, layerFindIndicator.positionFind),
+ WndProc(SCI_POINTYFROMPOSITION, 0, layerFindIndicator.positionFind));
+ ptText.x = ptText.x - vs.fixedColumnWidth + xOffset;
+ ptText.y += topLine * vs.lineHeight;
+ if (!layerFindIndicator.geometryFlipped)
+ {
+ NSView *content = ContentView();
+ ptText.y = content.bounds.size.height - ptText.y;
+ }
+ [layerFindIndicator animateMatch:ptText bounce:bounce];
+ }
+#endif
+}
+
+void ScintillaCocoa::HideFindIndicator()
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ if (layerFindIndicator)
+ {
+ [layerFindIndicator hideMatch];
+ }
+#endif
+}
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings
new file mode 100644
index 00000000000..42522ec383c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Info.plist b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Info.plist
new file mode 100644
index 00000000000..13ee4cc2b5d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sun.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
new file mode 100644
index 00000000000..2822fb89fd6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
@@ -0,0 +1,1201 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1100F1EB178E393200105727 /* CaseConvert.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E6178E393200105727 /* CaseConvert.cxx */; };
+ 1100F1EC178E393200105727 /* CaseConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E7178E393200105727 /* CaseConvert.h */; };
+ 1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E8178E393200105727 /* CaseFolder.cxx */; };
+ 1100F1EE178E393200105727 /* CaseFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E9178E393200105727 /* CaseFolder.h */; };
+ 1100F1EF178E393200105727 /* UnicodeFromUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */; };
+ 1102C31C169FB49300DC16AB /* LexLaTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */; };
+ 11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11126B8114CD3A6200803C49 /* LexAVS.cxx */; };
+ 1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1114D6CA1602A951001DC345 /* LexPO.cxx */; };
+ 114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */; };
+ 114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EBF11FA7526004FB6AB /* LexAda.cxx */; };
+ 114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */; };
+ 114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC111FA7526004FB6AB /* LexAsm.cxx */; };
+ 114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */; };
+ 114B6F1211FA7526004FB6AB /* LexASY.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC311FA7526004FB6AB /* LexASY.cxx */; };
+ 114B6F1311FA7526004FB6AB /* LexAU3.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC411FA7526004FB6AB /* LexAU3.cxx */; };
+ 114B6F1411FA7526004FB6AB /* LexAVE.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC511FA7526004FB6AB /* LexAVE.cxx */; };
+ 114B6F1511FA7526004FB6AB /* LexBaan.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC611FA7526004FB6AB /* LexBaan.cxx */; };
+ 114B6F1611FA7526004FB6AB /* LexBash.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC711FA7526004FB6AB /* LexBash.cxx */; };
+ 114B6F1711FA7526004FB6AB /* LexBasic.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC811FA7526004FB6AB /* LexBasic.cxx */; };
+ 114B6F1811FA7526004FB6AB /* LexBullant.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC911FA7526004FB6AB /* LexBullant.cxx */; };
+ 114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */; };
+ 114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */; };
+ 114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */; };
+ 114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */; };
+ 114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECE11FA7526004FB6AB /* LexConf.cxx */; };
+ 114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */; };
+ 114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */; };
+ 114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED111FA7526004FB6AB /* LexCsound.cxx */; };
+ 114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED211FA7526004FB6AB /* LexCSS.cxx */; };
+ 114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED311FA7526004FB6AB /* LexD.cxx */; };
+ 114B6F2311FA7526004FB6AB /* LexEiffel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */; };
+ 114B6F2411FA7526004FB6AB /* LexErlang.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED511FA7526004FB6AB /* LexErlang.cxx */; };
+ 114B6F2511FA7526004FB6AB /* LexEScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED611FA7526004FB6AB /* LexEScript.cxx */; };
+ 114B6F2611FA7526004FB6AB /* LexFlagship.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */; };
+ 114B6F2711FA7526004FB6AB /* LexForth.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED811FA7526004FB6AB /* LexForth.cxx */; };
+ 114B6F2811FA7526004FB6AB /* LexFortran.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED911FA7526004FB6AB /* LexFortran.cxx */; };
+ 114B6F2911FA7526004FB6AB /* LexGAP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */; };
+ 114B6F2A11FA7526004FB6AB /* LexGui4Cli.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */; };
+ 114B6F2B11FA7526004FB6AB /* LexHaskell.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */; };
+ 114B6F2C11FA7526004FB6AB /* LexHTML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */; };
+ 114B6F2D11FA7526004FB6AB /* LexInno.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDE11FA7526004FB6AB /* LexInno.cxx */; };
+ 114B6F2E11FA7526004FB6AB /* LexKix.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDF11FA7526004FB6AB /* LexKix.cxx */; };
+ 114B6F2F11FA7526004FB6AB /* LexLisp.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE011FA7526004FB6AB /* LexLisp.cxx */; };
+ 114B6F3011FA7526004FB6AB /* LexLout.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE111FA7526004FB6AB /* LexLout.cxx */; };
+ 114B6F3111FA7526004FB6AB /* LexLua.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE211FA7526004FB6AB /* LexLua.cxx */; };
+ 114B6F3211FA7526004FB6AB /* LexMagik.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE311FA7526004FB6AB /* LexMagik.cxx */; };
+ 114B6F3311FA7526004FB6AB /* LexMarkdown.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */; };
+ 114B6F3411FA7526004FB6AB /* LexMatlab.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */; };
+ 114B6F3511FA7526004FB6AB /* LexMetapost.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */; };
+ 114B6F3611FA7526004FB6AB /* LexMMIXAL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */; };
+ 114B6F3711FA7526004FB6AB /* LexMPT.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE811FA7526004FB6AB /* LexMPT.cxx */; };
+ 114B6F3811FA7526004FB6AB /* LexMSSQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */; };
+ 114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */; };
+ 114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */; };
+ 114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */; };
+ 114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EED11FA7526004FB6AB /* LexOpal.cxx */; };
+ 114B6F3D11FA7526004FB6AB /* LexOthers.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEE11FA7526004FB6AB /* LexOthers.cxx */; };
+ 114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */; };
+ 114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF011FA7526004FB6AB /* LexPB.cxx */; };
+ 114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF111FA7526004FB6AB /* LexPerl.cxx */; };
+ 114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF211FA7526004FB6AB /* LexPLM.cxx */; };
+ 114B6F4211FA7526004FB6AB /* LexPOV.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF311FA7526004FB6AB /* LexPOV.cxx */; };
+ 114B6F4311FA7526004FB6AB /* LexPowerPro.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */; };
+ 114B6F4411FA7526004FB6AB /* LexPowerShell.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */; };
+ 114B6F4511FA7526004FB6AB /* LexProgress.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF611FA7526004FB6AB /* LexProgress.cxx */; };
+ 114B6F4611FA7526004FB6AB /* LexPS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF711FA7526004FB6AB /* LexPS.cxx */; };
+ 114B6F4711FA7526004FB6AB /* LexPython.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF811FA7526004FB6AB /* LexPython.cxx */; };
+ 114B6F4811FA7526004FB6AB /* LexR.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF911FA7526004FB6AB /* LexR.cxx */; };
+ 114B6F4911FA7526004FB6AB /* LexRebol.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */; };
+ 114B6F4A11FA7526004FB6AB /* LexRuby.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */; };
+ 114B6F4B11FA7526004FB6AB /* LexScriptol.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */; };
+ 114B6F4C11FA7526004FB6AB /* LexSmalltalk.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */; };
+ 114B6F4D11FA7526004FB6AB /* LexSML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFE11FA7526004FB6AB /* LexSML.cxx */; };
+ 114B6F4E11FA7526004FB6AB /* LexSorcus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */; };
+ 114B6F4F11FA7526004FB6AB /* LexSpecman.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */; };
+ 114B6F5011FA7526004FB6AB /* LexSpice.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0111FA7526004FB6AB /* LexSpice.cxx */; };
+ 114B6F5111FA7526004FB6AB /* LexSQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0211FA7526004FB6AB /* LexSQL.cxx */; };
+ 114B6F5211FA7526004FB6AB /* LexTACL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0311FA7526004FB6AB /* LexTACL.cxx */; };
+ 114B6F5311FA7526004FB6AB /* LexTADS3.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */; };
+ 114B6F5411FA7526004FB6AB /* LexTAL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0511FA7526004FB6AB /* LexTAL.cxx */; };
+ 114B6F5511FA7526004FB6AB /* LexTCL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0611FA7526004FB6AB /* LexTCL.cxx */; };
+ 114B6F5611FA7526004FB6AB /* LexTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0711FA7526004FB6AB /* LexTeX.cxx */; };
+ 114B6F5711FA7526004FB6AB /* LexTxt2tags.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */; };
+ 114B6F5811FA7526004FB6AB /* LexVB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0911FA7526004FB6AB /* LexVB.cxx */; };
+ 114B6F5911FA7526004FB6AB /* LexVerilog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */; };
+ 114B6F5A11FA7526004FB6AB /* LexVHDL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */; };
+ 114B6F5B11FA7526004FB6AB /* LexYAML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */; };
+ 114B6F7711FA7598004FB6AB /* AutoComplete.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */; };
+ 114B6F7811FA7598004FB6AB /* CallTip.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6111FA7597004FB6AB /* CallTip.cxx */; };
+ 114B6F7911FA7598004FB6AB /* Catalogue.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6211FA7597004FB6AB /* Catalogue.cxx */; };
+ 114B6F7A11FA7598004FB6AB /* CellBuffer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */; };
+ 114B6F7B11FA7598004FB6AB /* CharClassify.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6411FA7597004FB6AB /* CharClassify.cxx */; };
+ 114B6F7C11FA7598004FB6AB /* ContractionState.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6511FA7597004FB6AB /* ContractionState.cxx */; };
+ 114B6F7D11FA7598004FB6AB /* Decoration.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6611FA7597004FB6AB /* Decoration.cxx */; };
+ 114B6F7E11FA7598004FB6AB /* Document.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6711FA7597004FB6AB /* Document.cxx */; };
+ 114B6F7F11FA7598004FB6AB /* Editor.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6811FA7597004FB6AB /* Editor.cxx */; };
+ 114B6F8011FA7598004FB6AB /* ExternalLexer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */; };
+ 114B6F8111FA7598004FB6AB /* Indicator.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6A11FA7598004FB6AB /* Indicator.cxx */; };
+ 114B6F8211FA7598004FB6AB /* KeyMap.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */; };
+ 114B6F8311FA7598004FB6AB /* LineMarker.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */; };
+ 114B6F8411FA7598004FB6AB /* PerLine.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6D11FA7598004FB6AB /* PerLine.cxx */; };
+ 114B6F8511FA7598004FB6AB /* PositionCache.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */; };
+ 114B6F8611FA7598004FB6AB /* RESearch.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6F11FA7598004FB6AB /* RESearch.cxx */; };
+ 114B6F8711FA7598004FB6AB /* RunStyles.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7011FA7598004FB6AB /* RunStyles.cxx */; };
+ 114B6F8811FA7598004FB6AB /* ScintillaBase.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */; };
+ 114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7211FA7598004FB6AB /* Selection.cxx */; };
+ 114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7311FA7598004FB6AB /* Style.cxx */; };
+ 114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7411FA7598004FB6AB /* UniConversion.cxx */; };
+ 114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */; };
+ 114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7611FA7598004FB6AB /* XPM.cxx */; };
+ 114B6F9711FA75BE004FB6AB /* Accessor.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */; };
+ 114B6F9811FA75BE004FB6AB /* CharacterSet.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */; };
+ 114B6F9911FA75BE004FB6AB /* LexerBase.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */; };
+ 114B6F9A11FA75BE004FB6AB /* LexerModule.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */; };
+ 114B6F9B11FA75BE004FB6AB /* LexerNoExceptions.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */; };
+ 114B6F9C11FA75BE004FB6AB /* LexerSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */; };
+ 114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */; };
+ 114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */; };
+ 114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9611FA75BE004FB6AB /* WordList.cxx */; };
+ 114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA011FA75DB004FB6AB /* ILexer.h */; };
+ 114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA211FA7623004FB6AB /* AutoComplete.h */; };
+ 114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA311FA7623004FB6AB /* CallTip.h */; };
+ 114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA411FA7623004FB6AB /* Catalogue.h */; };
+ 114B6FC011FA7623004FB6AB /* CellBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA511FA7623004FB6AB /* CellBuffer.h */; };
+ 114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA611FA7623004FB6AB /* CharClassify.h */; };
+ 114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA711FA7623004FB6AB /* ContractionState.h */; };
+ 114B6FC311FA7623004FB6AB /* Decoration.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA811FA7623004FB6AB /* Decoration.h */; };
+ 114B6FC411FA7623004FB6AB /* Document.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA911FA7623004FB6AB /* Document.h */; };
+ 114B6FC511FA7623004FB6AB /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAA11FA7623004FB6AB /* Editor.h */; };
+ 114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */; };
+ 114B6FC711FA7623004FB6AB /* FontQuality.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAC11FA7623004FB6AB /* FontQuality.h */; };
+ 114B6FC811FA7623004FB6AB /* Indicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAD11FA7623004FB6AB /* Indicator.h */; };
+ 114B6FC911FA7623004FB6AB /* KeyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAE11FA7623004FB6AB /* KeyMap.h */; };
+ 114B6FCA11FA7623004FB6AB /* LineMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAF11FA7623004FB6AB /* LineMarker.h */; };
+ 114B6FCB11FA7623004FB6AB /* Partitioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB011FA7623004FB6AB /* Partitioning.h */; };
+ 114B6FCC11FA7623004FB6AB /* PerLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB111FA7623004FB6AB /* PerLine.h */; };
+ 114B6FCD11FA7623004FB6AB /* PositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB211FA7623004FB6AB /* PositionCache.h */; };
+ 114B6FCE11FA7623004FB6AB /* RESearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB311FA7623004FB6AB /* RESearch.h */; };
+ 114B6FCF11FA7623004FB6AB /* RunStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB411FA7623004FB6AB /* RunStyles.h */; };
+ 114B6FD011FA7623004FB6AB /* ScintillaBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB511FA7623004FB6AB /* ScintillaBase.h */; };
+ 114B6FD111FA7623004FB6AB /* Selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB611FA7623004FB6AB /* Selection.h */; };
+ 114B6FD211FA7623004FB6AB /* SplitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB711FA7623004FB6AB /* SplitVector.h */; };
+ 114B6FD311FA7623004FB6AB /* Style.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB811FA7623004FB6AB /* Style.h */; };
+ 114B6FD511FA7623004FB6AB /* UniConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBA11FA7623004FB6AB /* UniConversion.h */; };
+ 114B6FD611FA7623004FB6AB /* ViewStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBB11FA7623004FB6AB /* ViewStyle.h */; };
+ 114B6FD711FA7623004FB6AB /* XPM.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBC11FA7623004FB6AB /* XPM.h */; };
+ 114B6FE311FA7645004FB6AB /* Accessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FD811FA7645004FB6AB /* Accessor.h */; };
+ 114B6FE411FA7645004FB6AB /* CharacterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FD911FA7645004FB6AB /* CharacterSet.h */; };
+ 114B6FE511FA7645004FB6AB /* LexAccessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDA11FA7645004FB6AB /* LexAccessor.h */; };
+ 114B6FE611FA7645004FB6AB /* LexerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDB11FA7645004FB6AB /* LexerBase.h */; };
+ 114B6FE711FA7645004FB6AB /* LexerModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDC11FA7645004FB6AB /* LexerModule.h */; };
+ 114B6FE811FA7645004FB6AB /* LexerNoExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */; };
+ 114B6FE911FA7645004FB6AB /* LexerSimple.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDE11FA7645004FB6AB /* LexerSimple.h */; };
+ 114B6FEA11FA7645004FB6AB /* OptionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDF11FA7645004FB6AB /* OptionSet.h */; };
+ 114B6FEB11FA7645004FB6AB /* PropSetSimple.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE011FA7645004FB6AB /* PropSetSimple.h */; };
+ 114B6FEC11FA7645004FB6AB /* StyleContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE111FA7645004FB6AB /* StyleContext.h */; };
+ 114B6FED11FA7645004FB6AB /* WordList.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE211FA7645004FB6AB /* WordList.h */; };
+ 1152A77315313E58000D4E1A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1152A77215313E58000D4E1A /* QuartzCore.framework */; };
+ 11594BE9155B91DF0099E1FA /* LexOScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11594BE7155B91DF0099E1FA /* LexOScript.cxx */; };
+ 11594BEA155B91DF0099E1FA /* LexVisualProlog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */; };
+ 1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1160E0371803651C00BCEBCB /* LexRust.cxx */; };
+ 117ACE9114A29A1E002876F9 /* LexTCMD.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */; };
+ 119FF1BF13C9D1820007CE42 /* QuartzTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */; };
+ 11A0A8A1148602DF0018D143 /* LexCoffeeScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */; };
+ 11BB124D12FF9C1300F6BCF7 /* LexModula.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */; };
+ 11BEB6A214EF189600BDE92A /* LexECL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11BEB6A114EF189600BDE92A /* LexECL.cxx */; };
+ 11F35FDB12AEFAF100F0236D /* LexA68k.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */; };
+ 11FBA39D17817DA00048C071 /* CharacterCategory.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */; };
+ 11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 11FBA39C17817DA00048C071 /* CharacterCategory.h */; };
+ 11FDAEB7174E1A9800FA161B /* LexSTTXT.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */; };
+ 11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */; };
+ 11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */; };
+ 2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59D0FC168A100E85C33 /* InfoBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A30FC168A100E85C33 /* ScintillaView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2744E5B20FC168C500E85C33 /* InfoBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5AD0FC168C500E85C33 /* InfoBar.mm */; };
+ 2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */; };
+ 2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */; };
+ 2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5B10FC168C500E85C33 /* ScintillaView.mm */; };
+ 2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59E0FC168A100E85C33 /* PlatCocoa.h */; };
+ 2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4850FC1678600E85C33 /* Platform.h */; };
+ 2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4870FC1678600E85C33 /* SciLexer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4880FC1678600E85C33 /* Scintilla.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */; };
+ 2791F3E30FC1A3AE009DBCF9 /* QuartzTextLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */; };
+ 2791F3E40FC1A3AE009DBCF9 /* QuartzTextStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */; };
+ 27FEF4540FC1B413005E115A /* info_bar_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4510FC1B413005E115A /* info_bar_bg.png */; };
+ 27FEF4550FC1B413005E115A /* mac_cursor_busy.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */; };
+ 27FEF4560FC1B413005E115A /* mac_cursor_flipped.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */; };
+ 280056FB188DDD2C00F200AE /* SparseState.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F8188DDD2C00F200AE /* SparseState.h */; };
+ 280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; };
+ 280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; };
+ 28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; };
+ 28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; };
+ 28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; };
+ 28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; };
+ 28A1DD53196BE0CA006EFCDD /* MarginView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */; };
+ 28A1DD57196BE0ED006EFCDD /* EditModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD54196BE0ED006EFCDD /* EditModel.h */; };
+ 28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD55196BE0ED006EFCDD /* EditView.h */; };
+ 28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD56196BE0ED006EFCDD /* MarginView.h */; };
+ 28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A7D6041995E47D0062D204 /* LexRegistry.cxx */; };
+ 28D516D81830FFCA0047C93D /* info_bar_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */; };
+ 28D516D91830FFCA0047C93D /* mac_cursor_busy@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */; };
+ 28D516DA1830FFCA0047C93D /* mac_cursor_flipped@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */; };
+ 28FDA42119B6967B00BE27D7 /* LexBibTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */; };
+ 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
+ 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 1100F1E6178E393200105727 /* CaseConvert.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseConvert.cxx; path = ../../src/CaseConvert.cxx; sourceTree = "<group>"; };
+ 1100F1E7178E393200105727 /* CaseConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseConvert.h; path = ../../src/CaseConvert.h; sourceTree = "<group>"; };
+ 1100F1E8178E393200105727 /* CaseFolder.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseFolder.cxx; path = ../../src/CaseFolder.cxx; sourceTree = "<group>"; };
+ 1100F1E9178E393200105727 /* CaseFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseFolder.h; path = ../../src/CaseFolder.h; sourceTree = "<group>"; };
+ 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeFromUTF8.h; path = ../../src/UnicodeFromUTF8.h; sourceTree = "<group>"; };
+ 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLaTeX.cxx; path = ../../lexers/LexLaTeX.cxx; sourceTree = "<group>"; };
+ 11126B8114CD3A6200803C49 /* LexAVS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVS.cxx; path = ../../lexers/LexAVS.cxx; sourceTree = "<group>"; };
+ 1114D6CA1602A951001DC345 /* LexPO.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPO.cxx; path = ../../lexers/LexPO.cxx; sourceTree = "<group>"; };
+ 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAbaqus.cxx; path = ../../lexers/LexAbaqus.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EBF11FA7526004FB6AB /* LexAda.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAda.cxx; path = ../../lexers/LexAda.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAPDL.cxx; path = ../../lexers/LexAPDL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC111FA7526004FB6AB /* LexAsm.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsm.cxx; path = ../../lexers/LexAsm.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsn1.cxx; path = ../../lexers/LexAsn1.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC311FA7526004FB6AB /* LexASY.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexASY.cxx; path = ../../lexers/LexASY.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC411FA7526004FB6AB /* LexAU3.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAU3.cxx; path = ../../lexers/LexAU3.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC511FA7526004FB6AB /* LexAVE.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVE.cxx; path = ../../lexers/LexAVE.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC611FA7526004FB6AB /* LexBaan.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBaan.cxx; path = ../../lexers/LexBaan.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC711FA7526004FB6AB /* LexBash.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBash.cxx; path = ../../lexers/LexBash.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC811FA7526004FB6AB /* LexBasic.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBasic.cxx; path = ../../lexers/LexBasic.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EC911FA7526004FB6AB /* LexBullant.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBullant.cxx; path = ../../lexers/LexBullant.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCaml.cxx; path = ../../lexers/LexCaml.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCLW.cxx; path = ../../lexers/LexCLW.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCmake.cxx; path = ../../lexers/LexCmake.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCOBOL.cxx; path = ../../lexers/LexCOBOL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECE11FA7526004FB6AB /* LexConf.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexConf.cxx; path = ../../lexers/LexConf.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCPP.cxx; path = ../../lexers/LexCPP.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCrontab.cxx; path = ../../lexers/LexCrontab.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED111FA7526004FB6AB /* LexCsound.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCsound.cxx; path = ../../lexers/LexCsound.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED211FA7526004FB6AB /* LexCSS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCSS.cxx; path = ../../lexers/LexCSS.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED311FA7526004FB6AB /* LexD.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexD.cxx; path = ../../lexers/LexD.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexEiffel.cxx; path = ../../lexers/LexEiffel.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED511FA7526004FB6AB /* LexErlang.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexErlang.cxx; path = ../../lexers/LexErlang.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED611FA7526004FB6AB /* LexEScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexEScript.cxx; path = ../../lexers/LexEScript.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFlagship.cxx; path = ../../lexers/LexFlagship.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED811FA7526004FB6AB /* LexForth.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexForth.cxx; path = ../../lexers/LexForth.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6ED911FA7526004FB6AB /* LexFortran.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFortran.cxx; path = ../../lexers/LexFortran.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexGAP.cxx; path = ../../lexers/LexGAP.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexGui4Cli.cxx; path = ../../lexers/LexGui4Cli.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHaskell.cxx; path = ../../lexers/LexHaskell.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHTML.cxx; path = ../../lexers/LexHTML.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDE11FA7526004FB6AB /* LexInno.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexInno.cxx; path = ../../lexers/LexInno.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EDF11FA7526004FB6AB /* LexKix.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKix.cxx; path = ../../lexers/LexKix.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE011FA7526004FB6AB /* LexLisp.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLisp.cxx; path = ../../lexers/LexLisp.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE111FA7526004FB6AB /* LexLout.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLout.cxx; path = ../../lexers/LexLout.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE211FA7526004FB6AB /* LexLua.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLua.cxx; path = ../../lexers/LexLua.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE311FA7526004FB6AB /* LexMagik.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMagik.cxx; path = ../../lexers/LexMagik.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMarkdown.cxx; path = ../../lexers/LexMarkdown.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMatlab.cxx; path = ../../lexers/LexMatlab.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMetapost.cxx; path = ../../lexers/LexMetapost.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMMIXAL.cxx; path = ../../lexers/LexMMIXAL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE811FA7526004FB6AB /* LexMPT.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMPT.cxx; path = ../../lexers/LexMPT.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMSSQL.cxx; path = ../../lexers/LexMSSQL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMySQL.cxx; path = ../../lexers/LexMySQL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNimrod.cxx; path = ../../lexers/LexNimrod.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNsis.cxx; path = ../../lexers/LexNsis.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EED11FA7526004FB6AB /* LexOpal.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOpal.cxx; path = ../../lexers/LexOpal.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EEE11FA7526004FB6AB /* LexOthers.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOthers.cxx; path = ../../lexers/LexOthers.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPascal.cxx; path = ../../lexers/LexPascal.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF011FA7526004FB6AB /* LexPB.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPB.cxx; path = ../../lexers/LexPB.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF111FA7526004FB6AB /* LexPerl.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPerl.cxx; path = ../../lexers/LexPerl.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF211FA7526004FB6AB /* LexPLM.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPLM.cxx; path = ../../lexers/LexPLM.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF311FA7526004FB6AB /* LexPOV.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPOV.cxx; path = ../../lexers/LexPOV.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPowerPro.cxx; path = ../../lexers/LexPowerPro.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPowerShell.cxx; path = ../../lexers/LexPowerShell.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF611FA7526004FB6AB /* LexProgress.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexProgress.cxx; path = ../../lexers/LexProgress.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF711FA7526004FB6AB /* LexPS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPS.cxx; path = ../../lexers/LexPS.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF811FA7526004FB6AB /* LexPython.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPython.cxx; path = ../../lexers/LexPython.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EF911FA7526004FB6AB /* LexR.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexR.cxx; path = ../../lexers/LexR.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRebol.cxx; path = ../../lexers/LexRebol.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRuby.cxx; path = ../../lexers/LexRuby.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexScriptol.cxx; path = ../../lexers/LexScriptol.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSmalltalk.cxx; path = ../../lexers/LexSmalltalk.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFE11FA7526004FB6AB /* LexSML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSML.cxx; path = ../../lexers/LexSML.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSorcus.cxx; path = ../../lexers/LexSorcus.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSpecman.cxx; path = ../../lexers/LexSpecman.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0111FA7526004FB6AB /* LexSpice.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSpice.cxx; path = ../../lexers/LexSpice.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0211FA7526004FB6AB /* LexSQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSQL.cxx; path = ../../lexers/LexSQL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0311FA7526004FB6AB /* LexTACL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTACL.cxx; path = ../../lexers/LexTACL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTADS3.cxx; path = ../../lexers/LexTADS3.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0511FA7526004FB6AB /* LexTAL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTAL.cxx; path = ../../lexers/LexTAL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0611FA7526004FB6AB /* LexTCL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTCL.cxx; path = ../../lexers/LexTCL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0711FA7526004FB6AB /* LexTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTeX.cxx; path = ../../lexers/LexTeX.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTxt2tags.cxx; path = ../../lexers/LexTxt2tags.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0911FA7526004FB6AB /* LexVB.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVB.cxx; path = ../../lexers/LexVB.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVerilog.cxx; path = ../../lexers/LexVerilog.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVHDL.cxx; path = ../../lexers/LexVHDL.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexYAML.cxx; path = ../../lexers/LexYAML.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AutoComplete.cxx; path = ../../src/AutoComplete.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6111FA7597004FB6AB /* CallTip.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CallTip.cxx; path = ../../src/CallTip.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6211FA7597004FB6AB /* Catalogue.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Catalogue.cxx; path = ../../src/Catalogue.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CellBuffer.cxx; path = ../../src/CellBuffer.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6411FA7597004FB6AB /* CharClassify.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharClassify.cxx; path = ../../src/CharClassify.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6511FA7597004FB6AB /* ContractionState.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContractionState.cxx; path = ../../src/ContractionState.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6611FA7597004FB6AB /* Decoration.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Decoration.cxx; path = ../../src/Decoration.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6711FA7597004FB6AB /* Document.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Document.cxx; path = ../../src/Document.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6811FA7597004FB6AB /* Editor.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Editor.cxx; path = ../../src/Editor.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExternalLexer.cxx; path = ../../src/ExternalLexer.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6A11FA7598004FB6AB /* Indicator.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Indicator.cxx; path = ../../src/Indicator.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyMap.cxx; path = ../../src/KeyMap.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineMarker.cxx; path = ../../src/LineMarker.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6D11FA7598004FB6AB /* PerLine.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerLine.cxx; path = ../../src/PerLine.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PositionCache.cxx; path = ../../src/PositionCache.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F6F11FA7598004FB6AB /* RESearch.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RESearch.cxx; path = ../../src/RESearch.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7011FA7598004FB6AB /* RunStyles.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RunStyles.cxx; path = ../../src/RunStyles.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScintillaBase.cxx; path = ../../src/ScintillaBase.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7211FA7598004FB6AB /* Selection.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Selection.cxx; path = ../../src/Selection.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7311FA7598004FB6AB /* Style.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Style.cxx; path = ../../src/Style.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7411FA7598004FB6AB /* UniConversion.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UniConversion.cxx; path = ../../src/UniConversion.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ViewStyle.cxx; path = ../../src/ViewStyle.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F7611FA7598004FB6AB /* XPM.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XPM.cxx; path = ../../src/XPM.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Accessor.cxx; path = ../../lexlib/Accessor.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterSet.cxx; path = ../../lexlib/CharacterSet.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerBase.cxx; path = ../../lexlib/LexerBase.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerModule.cxx; path = ../../lexlib/LexerModule.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerNoExceptions.cxx; path = ../../lexlib/LexerNoExceptions.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerSimple.cxx; path = ../../lexlib/LexerSimple.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PropSetSimple.cxx; path = ../../lexlib/PropSetSimple.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleContext.cxx; path = ../../lexlib/StyleContext.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6F9611FA75BE004FB6AB /* WordList.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WordList.cxx; path = ../../lexlib/WordList.cxx; sourceTree = SOURCE_ROOT; };
+ 114B6FA011FA75DB004FB6AB /* ILexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ILexer.h; path = ../../include/ILexer.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA211FA7623004FB6AB /* AutoComplete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AutoComplete.h; path = ../../src/AutoComplete.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA311FA7623004FB6AB /* CallTip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallTip.h; path = ../../src/CallTip.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA411FA7623004FB6AB /* Catalogue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Catalogue.h; path = ../../src/Catalogue.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA511FA7623004FB6AB /* CellBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CellBuffer.h; path = ../../src/CellBuffer.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA611FA7623004FB6AB /* CharClassify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharClassify.h; path = ../../src/CharClassify.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA711FA7623004FB6AB /* ContractionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContractionState.h; path = ../../src/ContractionState.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA811FA7623004FB6AB /* Decoration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Decoration.h; path = ../../src/Decoration.h; sourceTree = SOURCE_ROOT; };
+ 114B6FA911FA7623004FB6AB /* Document.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Document.h; path = ../../src/Document.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAA11FA7623004FB6AB /* Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Editor.h; path = ../../src/Editor.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalLexer.h; path = ../../src/ExternalLexer.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAC11FA7623004FB6AB /* FontQuality.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontQuality.h; path = ../../src/FontQuality.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAD11FA7623004FB6AB /* Indicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Indicator.h; path = ../../src/Indicator.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAE11FA7623004FB6AB /* KeyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyMap.h; path = ../../src/KeyMap.h; sourceTree = SOURCE_ROOT; };
+ 114B6FAF11FA7623004FB6AB /* LineMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineMarker.h; path = ../../src/LineMarker.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB011FA7623004FB6AB /* Partitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Partitioning.h; path = ../../src/Partitioning.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB111FA7623004FB6AB /* PerLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerLine.h; path = ../../src/PerLine.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB211FA7623004FB6AB /* PositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PositionCache.h; path = ../../src/PositionCache.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB311FA7623004FB6AB /* RESearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RESearch.h; path = ../../src/RESearch.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB411FA7623004FB6AB /* RunStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RunStyles.h; path = ../../src/RunStyles.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB511FA7623004FB6AB /* ScintillaBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaBase.h; path = ../../src/ScintillaBase.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB611FA7623004FB6AB /* Selection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Selection.h; path = ../../src/Selection.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB711FA7623004FB6AB /* SplitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SplitVector.h; path = ../../src/SplitVector.h; sourceTree = SOURCE_ROOT; };
+ 114B6FB811FA7623004FB6AB /* Style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Style.h; path = ../../src/Style.h; sourceTree = SOURCE_ROOT; };
+ 114B6FBA11FA7623004FB6AB /* UniConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UniConversion.h; path = ../../src/UniConversion.h; sourceTree = SOURCE_ROOT; };
+ 114B6FBB11FA7623004FB6AB /* ViewStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewStyle.h; path = ../../src/ViewStyle.h; sourceTree = SOURCE_ROOT; };
+ 114B6FBC11FA7623004FB6AB /* XPM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPM.h; path = ../../src/XPM.h; sourceTree = SOURCE_ROOT; };
+ 114B6FD811FA7645004FB6AB /* Accessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Accessor.h; path = ../../lexlib/Accessor.h; sourceTree = SOURCE_ROOT; };
+ 114B6FD911FA7645004FB6AB /* CharacterSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharacterSet.h; path = ../../lexlib/CharacterSet.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDA11FA7645004FB6AB /* LexAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexAccessor.h; path = ../../lexlib/LexAccessor.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDB11FA7645004FB6AB /* LexerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerBase.h; path = ../../lexlib/LexerBase.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDC11FA7645004FB6AB /* LexerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerModule.h; path = ../../lexlib/LexerModule.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerNoExceptions.h; path = ../../lexlib/LexerNoExceptions.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDE11FA7645004FB6AB /* LexerSimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerSimple.h; path = ../../lexlib/LexerSimple.h; sourceTree = SOURCE_ROOT; };
+ 114B6FDF11FA7645004FB6AB /* OptionSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionSet.h; path = ../../lexlib/OptionSet.h; sourceTree = SOURCE_ROOT; };
+ 114B6FE011FA7645004FB6AB /* PropSetSimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PropSetSimple.h; path = ../../lexlib/PropSetSimple.h; sourceTree = SOURCE_ROOT; };
+ 114B6FE111FA7645004FB6AB /* StyleContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleContext.h; path = ../../lexlib/StyleContext.h; sourceTree = SOURCE_ROOT; };
+ 114B6FE211FA7645004FB6AB /* WordList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WordList.h; path = ../../lexlib/WordList.h; sourceTree = SOURCE_ROOT; };
+ 1152A77215313E58000D4E1A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = ../../../../../../../../System/Library/Frameworks/QuartzCore.framework; sourceTree = "<group>"; };
+ 11594BE7155B91DF0099E1FA /* LexOScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOScript.cxx; path = ../../lexers/LexOScript.cxx; sourceTree = "<group>"; };
+ 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVisualProlog.cxx; path = ../../lexers/LexVisualProlog.cxx; sourceTree = "<group>"; };
+ 1160E0371803651C00BCEBCB /* LexRust.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRust.cxx; path = ../../lexers/LexRust.cxx; sourceTree = "<group>"; };
+ 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTCMD.cxx; path = ../../lexers/LexTCMD.cxx; sourceTree = "<group>"; };
+ 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextStyle.h; path = ../QuartzTextStyle.h; sourceTree = "<group>"; };
+ 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCoffeeScript.cxx; path = ../../lexers/LexCoffeeScript.cxx; sourceTree = "<group>"; };
+ 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexModula.cxx; path = ../../lexers/LexModula.cxx; sourceTree = SOURCE_ROOT; };
+ 11BEB6A114EF189600BDE92A /* LexECL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexECL.cxx; path = ../../lexers/LexECL.cxx; sourceTree = "<group>"; };
+ 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexA68k.cxx; path = ../../lexers/LexA68k.cxx; sourceTree = SOURCE_ROOT; };
+ 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterCategory.cxx; path = ../../lexlib/CharacterCategory.cxx; sourceTree = "<group>"; };
+ 11FBA39C17817DA00048C071 /* CharacterCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharacterCategory.h; path = ../../lexlib/CharacterCategory.h; sourceTree = "<group>"; };
+ 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSTTXT.cxx; path = ../../lexers/LexSTTXT.cxx; sourceTree = "<group>"; };
+ 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKVIrc.cxx; path = ../../lexers/LexKVIrc.cxx; sourceTree = "<group>"; };
+ 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMAP.cxx; path = ../../lexers/LexDMAP.cxx; sourceTree = "<group>"; };
+ 2744E4850FC1678600E85C33 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = ../../include/Platform.h; sourceTree = SOURCE_ROOT; };
+ 2744E4870FC1678600E85C33 /* SciLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SciLexer.h; path = ../../include/SciLexer.h; sourceTree = SOURCE_ROOT; };
+ 2744E4880FC1678600E85C33 /* Scintilla.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scintilla.h; path = ../../include/Scintilla.h; sourceTree = SOURCE_ROOT; };
+ 2744E59D0FC168A100E85C33 /* InfoBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoBar.h; path = ../InfoBar.h; sourceTree = SOURCE_ROOT; };
+ 2744E59E0FC168A100E85C33 /* PlatCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatCocoa.h; path = ../PlatCocoa.h; sourceTree = SOURCE_ROOT; };
+ 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextLayout.h; path = ../QuartzTextLayout.h; sourceTree = SOURCE_ROOT; };
+ 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextStyleAttribute.h; path = ../QuartzTextStyleAttribute.h; sourceTree = SOURCE_ROOT; };
+ 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaCocoa.h; path = ../ScintillaCocoa.h; sourceTree = "<group>"; };
+ 2744E5A30FC168A100E85C33 /* ScintillaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaView.h; path = ../ScintillaView.h; sourceTree = "<group>"; };
+ 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoBarCommunicator.h; path = ../InfoBarCommunicator.h; sourceTree = SOURCE_ROOT; };
+ 2744E5AD0FC168C500E85C33 /* InfoBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InfoBar.mm; path = ../InfoBar.mm; sourceTree = SOURCE_ROOT; };
+ 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatCocoa.mm; path = ../PlatCocoa.mm; sourceTree = SOURCE_ROOT; };
+ 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScintillaCocoa.mm; path = ../ScintillaCocoa.mm; sourceTree = "<group>"; };
+ 2744E5B10FC168C500E85C33 /* ScintillaView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScintillaView.mm; path = ../ScintillaView.mm; sourceTree = "<group>"; };
+ 27FEF4510FC1B413005E115A /* info_bar_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = info_bar_bg.png; sourceTree = "<group>"; };
+ 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mac_cursor_busy.png; sourceTree = "<group>"; };
+ 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mac_cursor_flipped.png; sourceTree = "<group>"; };
+ 280056F8188DDD2C00F200AE /* SparseState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparseState.h; path = ../../lexlib/SparseState.h; sourceTree = "<group>"; };
+ 280056F9188DDD2C00F200AE /* StringCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringCopy.h; path = ../../lexlib/StringCopy.h; sourceTree = "<group>"; };
+ 280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = "<group>"; };
+ 28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = "<group>"; };
+ 28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = "<group>"; };
+ 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = "<group>"; };
+ 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = "<group>"; };
+ 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MarginView.cxx; path = ../../src/MarginView.cxx; sourceTree = "<group>"; };
+ 28A1DD54196BE0ED006EFCDD /* EditModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditModel.h; path = ../../src/EditModel.h; sourceTree = "<group>"; };
+ 28A1DD55196BE0ED006EFCDD /* EditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditView.h; path = ../../src/EditView.h; sourceTree = "<group>"; };
+ 28A1DD56196BE0ED006EFCDD /* MarginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MarginView.h; path = ../../src/MarginView.h; sourceTree = "<group>"; };
+ 28A7D6041995E47D0062D204 /* LexRegistry.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRegistry.cxx; path = ../../lexers/LexRegistry.cxx; sourceTree = "<group>"; };
+ 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info_bar_bg@2x.png"; sourceTree = "<group>"; };
+ 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_busy@2x.png"; sourceTree = "<group>"; };
+ 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_flipped@2x.png"; sourceTree = "<group>"; };
+ 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBibTeX.cxx; path = ../../lexers/LexBibTeX.cxx; sourceTree = "<group>"; };
+ 32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scintilla_Prefix.pch; sourceTree = "<group>"; };
+ 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8DC2EF5B0486A6940098B216 /* Scintilla.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Scintilla.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DC2EF560486A6940098B216 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
+ 1152A77315313E58000D4E1A /* QuartzCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 034768DFFF38A50411DB9C8B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DC2EF5B0486A6940098B216 /* Scintilla.framework */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 0867D691FE84028FC02AAC07 /* Scintilla */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E47D0FC1674E00E85C33 /* Lexers */,
+ 2744E47C0FC1674100E85C33 /* Backend */,
+ 08FB77AEFE84172EC02AAC07 /* Classes */,
+ 32C88DFF0371C24200C91783 /* Other Sources */,
+ 089C1665FE841158C02AAC07 /* Resources */,
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
+ 034768DFFF38A50411DB9C8B /* Products */,
+ );
+ name = Scintilla;
+ sourceTree = "<group>";
+ };
+ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
+ 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+ 089C1665FE841158C02AAC07 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 27FEF4500FC1B413005E115A /* res */,
+ 8DC2EF5A0486A6940098B216 /* Info.plist */,
+ 089C1666FE841158C02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 08FB77AEFE84172EC02AAC07 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E4980FC167ED00E85C33 /* Source Files */,
+ 2744E4970FC167E400E85C33 /* Header Files */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1152A77215313E58000D4E1A /* QuartzCore.framework */,
+ 0867D6A5FE840307C02AAC07 /* AppKit.framework */,
+ D2F7E79907B2D74100F64583 /* CoreData.framework */,
+ 0867D69BFE84028FC02AAC07 /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 2744E47C0FC1674100E85C33 /* Backend */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E47F0FC1676400E85C33 /* Source Files */,
+ 2744E47E0FC1675800E85C33 /* Header Files */,
+ );
+ name = Backend;
+ sourceTree = "<group>";
+ };
+ 2744E47D0FC1674E00E85C33 /* Lexers */ = {
+ isa = PBXGroup;
+ children = (
+ 11126B8114CD3A6200803C49 /* LexAVS.cxx */,
+ 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */,
+ 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */,
+ 114B6EBF11FA7526004FB6AB /* LexAda.cxx */,
+ 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */,
+ 114B6EC111FA7526004FB6AB /* LexAsm.cxx */,
+ 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */,
+ 114B6EC311FA7526004FB6AB /* LexASY.cxx */,
+ 114B6EC411FA7526004FB6AB /* LexAU3.cxx */,
+ 114B6EC511FA7526004FB6AB /* LexAVE.cxx */,
+ 114B6EC611FA7526004FB6AB /* LexBaan.cxx */,
+ 114B6EC711FA7526004FB6AB /* LexBash.cxx */,
+ 114B6EC811FA7526004FB6AB /* LexBasic.cxx */,
+ 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */,
+ 114B6EC911FA7526004FB6AB /* LexBullant.cxx */,
+ 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */,
+ 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */,
+ 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */,
+ 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */,
+ 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */,
+ 114B6ECE11FA7526004FB6AB /* LexConf.cxx */,
+ 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */,
+ 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */,
+ 114B6ED111FA7526004FB6AB /* LexCsound.cxx */,
+ 114B6ED211FA7526004FB6AB /* LexCSS.cxx */,
+ 114B6ED311FA7526004FB6AB /* LexD.cxx */,
+ 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */,
+ 28064A04190F12E100E6E47F /* LexDMIS.cxx */,
+ 11BEB6A114EF189600BDE92A /* LexECL.cxx */,
+ 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */,
+ 114B6ED511FA7526004FB6AB /* LexErlang.cxx */,
+ 114B6ED611FA7526004FB6AB /* LexEScript.cxx */,
+ 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */,
+ 114B6ED811FA7526004FB6AB /* LexForth.cxx */,
+ 114B6ED911FA7526004FB6AB /* LexFortran.cxx */,
+ 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */,
+ 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */,
+ 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */,
+ 28A067101A36B42600B4966A /* LexHex.cxx */,
+ 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */,
+ 114B6EDE11FA7526004FB6AB /* LexInno.cxx */,
+ 114B6EDF11FA7526004FB6AB /* LexKix.cxx */,
+ 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */,
+ 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */,
+ 114B6EE011FA7526004FB6AB /* LexLisp.cxx */,
+ 114B6EE111FA7526004FB6AB /* LexLout.cxx */,
+ 114B6EE211FA7526004FB6AB /* LexLua.cxx */,
+ 114B6EE311FA7526004FB6AB /* LexMagik.cxx */,
+ 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */,
+ 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */,
+ 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */,
+ 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */,
+ 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */,
+ 114B6EE811FA7526004FB6AB /* LexMPT.cxx */,
+ 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */,
+ 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */,
+ 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */,
+ 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */,
+ 114B6EED11FA7526004FB6AB /* LexOpal.cxx */,
+ 11594BE7155B91DF0099E1FA /* LexOScript.cxx */,
+ 114B6EEE11FA7526004FB6AB /* LexOthers.cxx */,
+ 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */,
+ 114B6EF011FA7526004FB6AB /* LexPB.cxx */,
+ 114B6EF111FA7526004FB6AB /* LexPerl.cxx */,
+ 114B6EF211FA7526004FB6AB /* LexPLM.cxx */,
+ 1114D6CA1602A951001DC345 /* LexPO.cxx */,
+ 114B6EF311FA7526004FB6AB /* LexPOV.cxx */,
+ 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */,
+ 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */,
+ 114B6EF611FA7526004FB6AB /* LexProgress.cxx */,
+ 114B6EF711FA7526004FB6AB /* LexPS.cxx */,
+ 114B6EF811FA7526004FB6AB /* LexPython.cxx */,
+ 114B6EF911FA7526004FB6AB /* LexR.cxx */,
+ 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */,
+ 28A7D6041995E47D0062D204 /* LexRegistry.cxx */,
+ 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */,
+ 1160E0371803651C00BCEBCB /* LexRust.cxx */,
+ 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */,
+ 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */,
+ 114B6EFE11FA7526004FB6AB /* LexSML.cxx */,
+ 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */,
+ 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */,
+ 114B6F0111FA7526004FB6AB /* LexSpice.cxx */,
+ 114B6F0211FA7526004FB6AB /* LexSQL.cxx */,
+ 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */,
+ 114B6F0311FA7526004FB6AB /* LexTACL.cxx */,
+ 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */,
+ 114B6F0511FA7526004FB6AB /* LexTAL.cxx */,
+ 114B6F0611FA7526004FB6AB /* LexTCL.cxx */,
+ 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */,
+ 114B6F0711FA7526004FB6AB /* LexTeX.cxx */,
+ 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */,
+ 114B6F0911FA7526004FB6AB /* LexVB.cxx */,
+ 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */,
+ 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */,
+ 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */,
+ 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */,
+ );
+ name = Lexers;
+ sourceTree = "<group>";
+ };
+ 2744E47E0FC1675800E85C33 /* Header Files */ = {
+ isa = PBXGroup;
+ children = (
+ 114B6FD811FA7645004FB6AB /* Accessor.h */,
+ 114B6FA211FA7623004FB6AB /* AutoComplete.h */,
+ 114B6FA311FA7623004FB6AB /* CallTip.h */,
+ 1100F1E7178E393200105727 /* CaseConvert.h */,
+ 1100F1E9178E393200105727 /* CaseFolder.h */,
+ 114B6FA411FA7623004FB6AB /* Catalogue.h */,
+ 114B6FA511FA7623004FB6AB /* CellBuffer.h */,
+ 11FBA39C17817DA00048C071 /* CharacterCategory.h */,
+ 114B6FD911FA7645004FB6AB /* CharacterSet.h */,
+ 114B6FA611FA7623004FB6AB /* CharClassify.h */,
+ 114B6FA711FA7623004FB6AB /* ContractionState.h */,
+ 114B6FA811FA7623004FB6AB /* Decoration.h */,
+ 114B6FA911FA7623004FB6AB /* Document.h */,
+ 28A1DD54196BE0ED006EFCDD /* EditModel.h */,
+ 114B6FAA11FA7623004FB6AB /* Editor.h */,
+ 28A1DD55196BE0ED006EFCDD /* EditView.h */,
+ 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */,
+ 114B6FAC11FA7623004FB6AB /* FontQuality.h */,
+ 114B6FA011FA75DB004FB6AB /* ILexer.h */,
+ 114B6FAD11FA7623004FB6AB /* Indicator.h */,
+ 114B6FAE11FA7623004FB6AB /* KeyMap.h */,
+ 114B6FDA11FA7645004FB6AB /* LexAccessor.h */,
+ 114B6FDB11FA7645004FB6AB /* LexerBase.h */,
+ 114B6FDC11FA7645004FB6AB /* LexerModule.h */,
+ 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */,
+ 114B6FDE11FA7645004FB6AB /* LexerSimple.h */,
+ 114B6FAF11FA7623004FB6AB /* LineMarker.h */,
+ 28A1DD56196BE0ED006EFCDD /* MarginView.h */,
+ 114B6FDF11FA7645004FB6AB /* OptionSet.h */,
+ 114B6FB011FA7623004FB6AB /* Partitioning.h */,
+ 114B6FB111FA7623004FB6AB /* PerLine.h */,
+ 114B6FB211FA7623004FB6AB /* PositionCache.h */,
+ 114B6FE011FA7645004FB6AB /* PropSetSimple.h */,
+ 114B6FB311FA7623004FB6AB /* RESearch.h */,
+ 114B6FB411FA7623004FB6AB /* RunStyles.h */,
+ 114B6FB511FA7623004FB6AB /* ScintillaBase.h */,
+ 114B6FB611FA7623004FB6AB /* Selection.h */,
+ 280056F8188DDD2C00F200AE /* SparseState.h */,
+ 114B6FB711FA7623004FB6AB /* SplitVector.h */,
+ 280056F9188DDD2C00F200AE /* StringCopy.h */,
+ 114B6FB811FA7623004FB6AB /* Style.h */,
+ 114B6FE111FA7645004FB6AB /* StyleContext.h */,
+ 280056FA188DDD2C00F200AE /* SubStyles.h */,
+ 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */,
+ 114B6FBA11FA7623004FB6AB /* UniConversion.h */,
+ 114B6FBB11FA7623004FB6AB /* ViewStyle.h */,
+ 114B6FE211FA7645004FB6AB /* WordList.h */,
+ 114B6FBC11FA7623004FB6AB /* XPM.h */,
+ );
+ name = "Header Files";
+ sourceTree = "<group>";
+ };
+ 2744E47F0FC1676400E85C33 /* Source Files */ = {
+ isa = PBXGroup;
+ children = (
+ 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */,
+ 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */,
+ 114B6F6111FA7597004FB6AB /* CallTip.cxx */,
+ 1100F1E6178E393200105727 /* CaseConvert.cxx */,
+ 1100F1E8178E393200105727 /* CaseFolder.cxx */,
+ 114B6F6211FA7597004FB6AB /* Catalogue.cxx */,
+ 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */,
+ 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */,
+ 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */,
+ 114B6F6411FA7597004FB6AB /* CharClassify.cxx */,
+ 114B6F6511FA7597004FB6AB /* ContractionState.cxx */,
+ 114B6F6611FA7597004FB6AB /* Decoration.cxx */,
+ 114B6F6711FA7597004FB6AB /* Document.cxx */,
+ 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */,
+ 114B6F6811FA7597004FB6AB /* Editor.cxx */,
+ 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */,
+ 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */,
+ 114B6F6A11FA7598004FB6AB /* Indicator.cxx */,
+ 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */,
+ 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */,
+ 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */,
+ 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */,
+ 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */,
+ 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */,
+ 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */,
+ 114B6F6D11FA7598004FB6AB /* PerLine.cxx */,
+ 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */,
+ 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */,
+ 114B6F6F11FA7598004FB6AB /* RESearch.cxx */,
+ 114B6F7011FA7598004FB6AB /* RunStyles.cxx */,
+ 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */,
+ 114B6F7211FA7598004FB6AB /* Selection.cxx */,
+ 114B6F7311FA7598004FB6AB /* Style.cxx */,
+ 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */,
+ 114B6F7411FA7598004FB6AB /* UniConversion.cxx */,
+ 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */,
+ 114B6F9611FA75BE004FB6AB /* WordList.cxx */,
+ 114B6F7611FA7598004FB6AB /* XPM.cxx */,
+ );
+ name = "Source Files";
+ sourceTree = "<group>";
+ };
+ 2744E4970FC167E400E85C33 /* Header Files */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E59D0FC168A100E85C33 /* InfoBar.h */,
+ 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */,
+ 2744E59E0FC168A100E85C33 /* PlatCocoa.h */,
+ 2744E4850FC1678600E85C33 /* Platform.h */,
+ 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */,
+ 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */,
+ 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */,
+ 2744E4870FC1678600E85C33 /* SciLexer.h */,
+ 2744E4880FC1678600E85C33 /* Scintilla.h */,
+ 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */,
+ 2744E5A30FC168A100E85C33 /* ScintillaView.h */,
+ );
+ name = "Header Files";
+ sourceTree = "<group>";
+ };
+ 2744E4980FC167ED00E85C33 /* Source Files */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E5AD0FC168C500E85C33 /* InfoBar.mm */,
+ 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */,
+ 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */,
+ 2744E5B10FC168C500E85C33 /* ScintillaView.mm */,
+ );
+ name = "Source Files";
+ sourceTree = "<group>";
+ };
+ 27FEF4500FC1B413005E115A /* res */ = {
+ isa = PBXGroup;
+ children = (
+ 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */,
+ 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */,
+ 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */,
+ 27FEF4510FC1B413005E115A /* info_bar_bg.png */,
+ 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */,
+ 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */,
+ );
+ name = res;
+ path = ../res;
+ sourceTree = SOURCE_ROOT;
+ };
+ 32C88DFF0371C24200C91783 /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 8DC2EF500486A6940098B216 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */,
+ 2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */,
+ 2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */,
+ 280056FB188DDD2C00F200AE /* SparseState.h in Headers */,
+ 2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */,
+ 2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */,
+ 2791F3E30FC1A3AE009DBCF9 /* QuartzTextLayout.h in Headers */,
+ 2791F3E40FC1A3AE009DBCF9 /* QuartzTextStyleAttribute.h in Headers */,
+ 2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */,
+ 2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */,
+ 2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */,
+ 114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */,
+ 114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */,
+ 114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */,
+ 114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */,
+ 114B6FC011FA7623004FB6AB /* CellBuffer.h in Headers */,
+ 114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */,
+ 114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */,
+ 114B6FC311FA7623004FB6AB /* Decoration.h in Headers */,
+ 114B6FC411FA7623004FB6AB /* Document.h in Headers */,
+ 114B6FC511FA7623004FB6AB /* Editor.h in Headers */,
+ 114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */,
+ 114B6FC711FA7623004FB6AB /* FontQuality.h in Headers */,
+ 28A1DD57196BE0ED006EFCDD /* EditModel.h in Headers */,
+ 114B6FC811FA7623004FB6AB /* Indicator.h in Headers */,
+ 114B6FC911FA7623004FB6AB /* KeyMap.h in Headers */,
+ 114B6FCA11FA7623004FB6AB /* LineMarker.h in Headers */,
+ 114B6FCB11FA7623004FB6AB /* Partitioning.h in Headers */,
+ 114B6FCC11FA7623004FB6AB /* PerLine.h in Headers */,
+ 114B6FCD11FA7623004FB6AB /* PositionCache.h in Headers */,
+ 114B6FCE11FA7623004FB6AB /* RESearch.h in Headers */,
+ 28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */,
+ 114B6FCF11FA7623004FB6AB /* RunStyles.h in Headers */,
+ 280056FD188DDD2C00F200AE /* SubStyles.h in Headers */,
+ 114B6FD011FA7623004FB6AB /* ScintillaBase.h in Headers */,
+ 114B6FD111FA7623004FB6AB /* Selection.h in Headers */,
+ 114B6FD211FA7623004FB6AB /* SplitVector.h in Headers */,
+ 114B6FD311FA7623004FB6AB /* Style.h in Headers */,
+ 280056FC188DDD2C00F200AE /* StringCopy.h in Headers */,
+ 114B6FD511FA7623004FB6AB /* UniConversion.h in Headers */,
+ 114B6FD611FA7623004FB6AB /* ViewStyle.h in Headers */,
+ 114B6FD711FA7623004FB6AB /* XPM.h in Headers */,
+ 114B6FE311FA7645004FB6AB /* Accessor.h in Headers */,
+ 114B6FE411FA7645004FB6AB /* CharacterSet.h in Headers */,
+ 114B6FE511FA7645004FB6AB /* LexAccessor.h in Headers */,
+ 114B6FE611FA7645004FB6AB /* LexerBase.h in Headers */,
+ 114B6FE711FA7645004FB6AB /* LexerModule.h in Headers */,
+ 114B6FE811FA7645004FB6AB /* LexerNoExceptions.h in Headers */,
+ 114B6FE911FA7645004FB6AB /* LexerSimple.h in Headers */,
+ 114B6FEA11FA7645004FB6AB /* OptionSet.h in Headers */,
+ 28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */,
+ 114B6FEB11FA7645004FB6AB /* PropSetSimple.h in Headers */,
+ 114B6FEC11FA7645004FB6AB /* StyleContext.h in Headers */,
+ 114B6FED11FA7645004FB6AB /* WordList.h in Headers */,
+ 119FF1BF13C9D1820007CE42 /* QuartzTextStyle.h in Headers */,
+ 11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */,
+ 1100F1EC178E393200105727 /* CaseConvert.h in Headers */,
+ 1100F1EE178E393200105727 /* CaseFolder.h in Headers */,
+ 1100F1EF178E393200105727 /* UnicodeFromUTF8.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 8DC2EF4F0486A6940098B216 /* Scintilla */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Scintilla" */;
+ buildPhases = (
+ 8DC2EF500486A6940098B216 /* Headers */,
+ 8DC2EF520486A6940098B216 /* Resources */,
+ 8DC2EF540486A6940098B216 /* Sources */,
+ 8DC2EF560486A6940098B216 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Scintilla;
+ productInstallPath = "$(HOME)/Library/Frameworks";
+ productName = Scintilla;
+ productReference = 8DC2EF5B0486A6940098B216 /* Scintilla.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 0867D690FE84028FC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0610;
+ };
+ buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 0867D691FE84028FC02AAC07 /* Scintilla */;
+ productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DC2EF4F0486A6940098B216 /* Scintilla */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8DC2EF520486A6940098B216 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
+ 27FEF4540FC1B413005E115A /* info_bar_bg.png in Resources */,
+ 28D516D81830FFCA0047C93D /* info_bar_bg@2x.png in Resources */,
+ 28D516D91830FFCA0047C93D /* mac_cursor_busy@2x.png in Resources */,
+ 27FEF4550FC1B413005E115A /* mac_cursor_busy.png in Resources */,
+ 27FEF4560FC1B413005E115A /* mac_cursor_flipped.png in Resources */,
+ 28D516DA1830FFCA0047C93D /* mac_cursor_flipped@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DC2EF540486A6940098B216 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2744E5B20FC168C500E85C33 /* InfoBar.mm in Sources */,
+ 2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */,
+ 2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */,
+ 2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */,
+ 114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */,
+ 114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */,
+ 114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */,
+ 114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */,
+ 114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */,
+ 114B6F1211FA7526004FB6AB /* LexASY.cxx in Sources */,
+ 114B6F1311FA7526004FB6AB /* LexAU3.cxx in Sources */,
+ 114B6F1411FA7526004FB6AB /* LexAVE.cxx in Sources */,
+ 114B6F1511FA7526004FB6AB /* LexBaan.cxx in Sources */,
+ 114B6F1611FA7526004FB6AB /* LexBash.cxx in Sources */,
+ 114B6F1711FA7526004FB6AB /* LexBasic.cxx in Sources */,
+ 114B6F1811FA7526004FB6AB /* LexBullant.cxx in Sources */,
+ 114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */,
+ 114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */,
+ 114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */,
+ 114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */,
+ 114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */,
+ 114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */,
+ 114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */,
+ 114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */,
+ 114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */,
+ 114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */,
+ 114B6F2311FA7526004FB6AB /* LexEiffel.cxx in Sources */,
+ 114B6F2411FA7526004FB6AB /* LexErlang.cxx in Sources */,
+ 114B6F2511FA7526004FB6AB /* LexEScript.cxx in Sources */,
+ 114B6F2611FA7526004FB6AB /* LexFlagship.cxx in Sources */,
+ 28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */,
+ 114B6F2711FA7526004FB6AB /* LexForth.cxx in Sources */,
+ 114B6F2811FA7526004FB6AB /* LexFortran.cxx in Sources */,
+ 28FDA42119B6967B00BE27D7 /* LexBibTeX.cxx in Sources */,
+ 114B6F2911FA7526004FB6AB /* LexGAP.cxx in Sources */,
+ 114B6F2A11FA7526004FB6AB /* LexGui4Cli.cxx in Sources */,
+ 114B6F2B11FA7526004FB6AB /* LexHaskell.cxx in Sources */,
+ 114B6F2C11FA7526004FB6AB /* LexHTML.cxx in Sources */,
+ 114B6F2D11FA7526004FB6AB /* LexInno.cxx in Sources */,
+ 114B6F2E11FA7526004FB6AB /* LexKix.cxx in Sources */,
+ 28A067111A36B42600B4966A /* LexHex.cxx in Sources */,
+ 114B6F2F11FA7526004FB6AB /* LexLisp.cxx in Sources */,
+ 114B6F3011FA7526004FB6AB /* LexLout.cxx in Sources */,
+ 114B6F3111FA7526004FB6AB /* LexLua.cxx in Sources */,
+ 114B6F3211FA7526004FB6AB /* LexMagik.cxx in Sources */,
+ 114B6F3311FA7526004FB6AB /* LexMarkdown.cxx in Sources */,
+ 28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */,
+ 114B6F3411FA7526004FB6AB /* LexMatlab.cxx in Sources */,
+ 114B6F3511FA7526004FB6AB /* LexMetapost.cxx in Sources */,
+ 114B6F3611FA7526004FB6AB /* LexMMIXAL.cxx in Sources */,
+ 114B6F3711FA7526004FB6AB /* LexMPT.cxx in Sources */,
+ 114B6F3811FA7526004FB6AB /* LexMSSQL.cxx in Sources */,
+ 114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */,
+ 114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */,
+ 114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */,
+ 114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */,
+ 114B6F3D11FA7526004FB6AB /* LexOthers.cxx in Sources */,
+ 114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */,
+ 114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */,
+ 114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */,
+ 114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */,
+ 114B6F4211FA7526004FB6AB /* LexPOV.cxx in Sources */,
+ 114B6F4311FA7526004FB6AB /* LexPowerPro.cxx in Sources */,
+ 114B6F4411FA7526004FB6AB /* LexPowerShell.cxx in Sources */,
+ 114B6F4511FA7526004FB6AB /* LexProgress.cxx in Sources */,
+ 114B6F4611FA7526004FB6AB /* LexPS.cxx in Sources */,
+ 114B6F4711FA7526004FB6AB /* LexPython.cxx in Sources */,
+ 114B6F4811FA7526004FB6AB /* LexR.cxx in Sources */,
+ 114B6F4911FA7526004FB6AB /* LexRebol.cxx in Sources */,
+ 114B6F4A11FA7526004FB6AB /* LexRuby.cxx in Sources */,
+ 114B6F4B11FA7526004FB6AB /* LexScriptol.cxx in Sources */,
+ 114B6F4C11FA7526004FB6AB /* LexSmalltalk.cxx in Sources */,
+ 114B6F4D11FA7526004FB6AB /* LexSML.cxx in Sources */,
+ 114B6F4E11FA7526004FB6AB /* LexSorcus.cxx in Sources */,
+ 114B6F4F11FA7526004FB6AB /* LexSpecman.cxx in Sources */,
+ 114B6F5011FA7526004FB6AB /* LexSpice.cxx in Sources */,
+ 114B6F5111FA7526004FB6AB /* LexSQL.cxx in Sources */,
+ 114B6F5211FA7526004FB6AB /* LexTACL.cxx in Sources */,
+ 114B6F5311FA7526004FB6AB /* LexTADS3.cxx in Sources */,
+ 114B6F5411FA7526004FB6AB /* LexTAL.cxx in Sources */,
+ 114B6F5511FA7526004FB6AB /* LexTCL.cxx in Sources */,
+ 114B6F5611FA7526004FB6AB /* LexTeX.cxx in Sources */,
+ 28A1DD53196BE0CA006EFCDD /* MarginView.cxx in Sources */,
+ 114B6F5711FA7526004FB6AB /* LexTxt2tags.cxx in Sources */,
+ 114B6F5811FA7526004FB6AB /* LexVB.cxx in Sources */,
+ 114B6F5911FA7526004FB6AB /* LexVerilog.cxx in Sources */,
+ 114B6F5A11FA7526004FB6AB /* LexVHDL.cxx in Sources */,
+ 114B6F5B11FA7526004FB6AB /* LexYAML.cxx in Sources */,
+ 114B6F7711FA7598004FB6AB /* AutoComplete.cxx in Sources */,
+ 114B6F7811FA7598004FB6AB /* CallTip.cxx in Sources */,
+ 114B6F7911FA7598004FB6AB /* Catalogue.cxx in Sources */,
+ 114B6F7A11FA7598004FB6AB /* CellBuffer.cxx in Sources */,
+ 114B6F7B11FA7598004FB6AB /* CharClassify.cxx in Sources */,
+ 28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */,
+ 114B6F7C11FA7598004FB6AB /* ContractionState.cxx in Sources */,
+ 114B6F7D11FA7598004FB6AB /* Decoration.cxx in Sources */,
+ 114B6F7E11FA7598004FB6AB /* Document.cxx in Sources */,
+ 114B6F7F11FA7598004FB6AB /* Editor.cxx in Sources */,
+ 114B6F8011FA7598004FB6AB /* ExternalLexer.cxx in Sources */,
+ 114B6F8111FA7598004FB6AB /* Indicator.cxx in Sources */,
+ 114B6F8211FA7598004FB6AB /* KeyMap.cxx in Sources */,
+ 114B6F8311FA7598004FB6AB /* LineMarker.cxx in Sources */,
+ 114B6F8411FA7598004FB6AB /* PerLine.cxx in Sources */,
+ 114B6F8511FA7598004FB6AB /* PositionCache.cxx in Sources */,
+ 114B6F8611FA7598004FB6AB /* RESearch.cxx in Sources */,
+ 114B6F8711FA7598004FB6AB /* RunStyles.cxx in Sources */,
+ 114B6F8811FA7598004FB6AB /* ScintillaBase.cxx in Sources */,
+ 114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */,
+ 114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */,
+ 28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */,
+ 114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */,
+ 114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */,
+ 114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */,
+ 114B6F9711FA75BE004FB6AB /* Accessor.cxx in Sources */,
+ 114B6F9811FA75BE004FB6AB /* CharacterSet.cxx in Sources */,
+ 114B6F9911FA75BE004FB6AB /* LexerBase.cxx in Sources */,
+ 114B6F9A11FA75BE004FB6AB /* LexerModule.cxx in Sources */,
+ 114B6F9B11FA75BE004FB6AB /* LexerNoExceptions.cxx in Sources */,
+ 114B6F9C11FA75BE004FB6AB /* LexerSimple.cxx in Sources */,
+ 114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */,
+ 114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */,
+ 114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */,
+ 11F35FDB12AEFAF100F0236D /* LexA68k.cxx in Sources */,
+ 11BB124D12FF9C1300F6BCF7 /* LexModula.cxx in Sources */,
+ 11A0A8A1148602DF0018D143 /* LexCoffeeScript.cxx in Sources */,
+ 117ACE9114A29A1E002876F9 /* LexTCMD.cxx in Sources */,
+ 11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */,
+ 11BEB6A214EF189600BDE92A /* LexECL.cxx in Sources */,
+ 11594BE9155B91DF0099E1FA /* LexOScript.cxx in Sources */,
+ 11594BEA155B91DF0099E1FA /* LexVisualProlog.cxx in Sources */,
+ 1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */,
+ 1102C31C169FB49300DC16AB /* LexLaTeX.cxx in Sources */,
+ 11FDAEB7174E1A9800FA161B /* LexSTTXT.cxx in Sources */,
+ 11FBA39D17817DA00048C071 /* CharacterCategory.cxx in Sources */,
+ 1100F1EB178E393200105727 /* CaseConvert.cxx in Sources */,
+ 1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */,
+ 11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */,
+ 1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */,
+ 11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C1667FE841158C02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB91AE08733DA50010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LIBRARY = "libc++";
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ".bzr *.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj";
+ FRAMEWORK_VERSION = A;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ SCI_NAMESPACE,
+ SCI_LEXER,
+ );
+ GCC_WARN_UNINITIALIZED_AUTOS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "@executable_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = Scintilla;
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 1DEB91AF08733DA50010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LIBRARY = "libc++";
+ COMBINE_HIDPI_IMAGES = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Scintilla_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ SCI_NAMESPACE,
+ SCI_LEXER,
+ );
+ GCC_WARN_UNINITIALIZED_AUTOS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "@executable_path/../Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
+ PRODUCT_NAME = Scintilla;
+ SKIP_INSTALL = YES;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ 1DEB91B208733DA50010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ ../../src,
+ ../../lexlib,
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 1DEB91B308733DA50010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ ../../src,
+ ../../lexlib,
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Scintilla" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB91AE08733DA50010E9CD /* Debug */,
+ 1DEB91AF08733DA50010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB91B208733DA50010E9CD /* Debug */,
+ 1DEB91B308733DA50010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch
new file mode 100644
index 00000000000..e987aa4cf44
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'Scintilla' target in the 'Scintilla' project.
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.h
new file mode 100644
index 00000000000..6025f6a50c0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.h
@@ -0,0 +1,24 @@
+/**
+ * AppController.h
+ * SciTest
+ *
+ * Created by Mike Lischke on 01.04.09.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import "Scintilla/ScintillaView.h"
+#import "Scintilla/InfoBar.h"
+
+@interface AppController : NSObject {
+ IBOutlet NSBox *mEditHost;
+ ScintillaView* mEditor;
+}
+
+- (void) awakeFromNib;
+- (void) setupEditor;
+- (IBAction) searchText: (id) sender;
+
+@end
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.mm b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.mm
new file mode 100644
index 00000000000..168a67681fc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/AppController.mm
@@ -0,0 +1,282 @@
+/**
+ * AppController.m
+ * ScintillaTest
+ *
+ * Created by Mike Lischke on 01.04.09.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import "AppController.h"
+
+const char major_keywords[] =
+ "accessible add all alter analyze and as asc asensitive "
+ "before between bigint binary blob both by "
+ "call cascade case change char character check collate column condition connection constraint "
+ "continue convert create cross current_date current_time current_timestamp current_user cursor "
+ "database databases day_hour day_microsecond day_minute day_second dec decimal declare default "
+ "delayed delete desc describe deterministic distinct distinctrow div double drop dual "
+ "each else elseif enclosed escaped exists exit explain "
+ "false fetch float float4 float8 for force foreign from fulltext "
+ "goto grant group "
+ "having high_priority hour_microsecond hour_minute hour_second "
+ "if ignore in index infile inner inout insensitive insert int int1 int2 int3 int4 int8 integer "
+ "interval into is iterate "
+ "join "
+ "key keys kill "
+ "label leading leave left like limit linear lines load localtime localtimestamp lock long "
+ "longblob longtext loop low_priority "
+ "master_ssl_verify_server_cert match mediumblob mediumint mediumtext middleint minute_microsecond "
+ "minute_second mod modifies "
+ "natural not no_write_to_binlog null numeric "
+ "on optimize option optionally or order out outer outfile "
+ "precision primary procedure purge "
+ "range read reads read_only read_write real references regexp release rename repeat replace "
+ "require restrict return revoke right rlike "
+ "schema schemas second_microsecond select sensitive separator set show smallint spatial specific "
+ "sql sqlexception sqlstate sqlwarning sql_big_result sql_calc_found_rows sql_small_result ssl "
+ "starting straight_join "
+ "table terminated then tinyblob tinyint tinytext to trailing trigger true "
+ "undo union unique unlock unsigned update upgrade usage use using utc_date utc_time utc_timestamp "
+ "values varbinary varchar varcharacter varying "
+ "when where while with write "
+ "xor "
+ "year_month "
+ "zerofill";
+
+const char procedure_keywords[] = // Not reserved words but intrinsic part of procedure definitions.
+ "begin comment end";
+
+const char client_keywords[] = // Definition of keywords only used by clients, not the server itself.
+ "delimiter";
+
+const char user_keywords[] = // Definition of own keywords, not used by MySQL.
+ "edit";
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation AppController
+
+- (void) awakeFromNib
+{
+ // Manually set up the scintilla editor. Create an instance and dock it to our edit host.
+ // Leave some free space around the new view to avoid overlapping with the box borders.
+ NSRect newFrame = mEditHost.frame;
+ newFrame.size.width -= 2 * newFrame.origin.x;
+ newFrame.size.height -= 3 * newFrame.origin.y;
+
+ mEditor = [[[ScintillaView alloc] initWithFrame: newFrame] autorelease];
+
+ [mEditHost.contentView addSubview: mEditor];
+ [mEditor setAutoresizesSubviews: YES];
+ [mEditor setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+
+ // Let's load some text for the editor, as initial content.
+ NSError* error = nil;
+
+ NSString* path = [[NSBundle mainBundle] pathForResource: @"TestData"
+ ofType: @"sql" inDirectory: nil];
+
+ NSString* sql = [NSString stringWithContentsOfFile: path
+ encoding: NSUTF8StringEncoding
+ error: &error];
+ if (error && [[error domain] isEqual: NSCocoaErrorDomain])
+ NSLog(@"%@", error);
+
+ [mEditor setString: sql];
+
+ [self setupEditor];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Initialize scintilla editor (styles, colors, markers, folding etc.].
+ */
+- (void) setupEditor
+{
+ // Lexer type is MySQL.
+ [mEditor setGeneralProperty: SCI_SETLEXER parameter: SCLEX_MYSQL value: 0];
+ // alternatively: [mEditor setEditorProperty: SCI_SETLEXERLANGUAGE parameter: nil value: (sptr_t) "mysql"];
+
+ // Number of styles we use with this lexer.
+ [mEditor setGeneralProperty: SCI_SETSTYLEBITS value: [mEditor getGeneralProperty: SCI_GETSTYLEBITSNEEDED]];
+
+ // Keywords to highlight. Indices are:
+ // 0 - Major keywords (reserved keywords)
+ // 1 - Normal keywords (everything not reserved but integral part of the language)
+ // 2 - Database objects
+ // 3 - Function keywords
+ // 4 - System variable keywords
+ // 5 - Procedure keywords (keywords used in procedures like "begin" and "end")
+ // 6..8 - User keywords 1..3
+ [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 0 value: major_keywords];
+ [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 5 value: procedure_keywords];
+ [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 6 value: client_keywords];
+ [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 7 value: user_keywords];
+
+ // Colors and styles for various syntactic elements. First the default style.
+ [mEditor setStringProperty: SCI_STYLESETFONT parameter: STYLE_DEFAULT value: @"Helvetica"];
+ // [mEditor setStringProperty: SCI_STYLESETFONT parameter: STYLE_DEFAULT value: @"Monospac821 BT"]; // Very pleasing programmer's font.
+ [mEditor setGeneralProperty: SCI_STYLESETSIZE parameter: STYLE_DEFAULT value: 14];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: STYLE_DEFAULT value: [NSColor blackColor]];
+
+ [mEditor setGeneralProperty: SCI_STYLECLEARALL parameter: 0 value: 0];
+
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DEFAULT value: [NSColor blackColor]];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_COMMENT fromHTML: @"#097BF7"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_COMMENTLINE fromHTML: @"#097BF7"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_HIDDENCOMMAND fromHTML: @"#097BF7"];
+ [mEditor setColorProperty: SCI_STYLESETBACK parameter: SCE_MYSQL_HIDDENCOMMAND fromHTML: @"#F0F0F0"];
+
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_VARIABLE fromHTML: @"378EA5"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_SYSTEMVARIABLE fromHTML: @"378EA5"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_KNOWNSYSTEMVARIABLE fromHTML: @"#3A37A5"];
+
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_NUMBER fromHTML: @"#7F7F00"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_SQSTRING fromHTML: @"#FFAA3E"];
+
+ // Note: if we were using ANSI quotes we would set the DQSTRING to the same color as the
+ // the back tick string.
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DQSTRING fromHTML: @"#274A6D"];
+
+ // Keyword highlighting.
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_MAJORKEYWORD fromHTML: @"#007F00"];
+ [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_MAJORKEYWORD value: 1];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_KEYWORD fromHTML: @"#007F00"];
+ [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_KEYWORD value: 1];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_PROCEDUREKEYWORD fromHTML: @"#56007F"];
+ [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_PROCEDUREKEYWORD value: 1];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_USER1 fromHTML: @"#808080"];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_USER2 fromHTML: @"#808080"];
+ [mEditor setColorProperty: SCI_STYLESETBACK parameter: SCE_MYSQL_USER2 fromHTML: @"#F0E0E0"];
+
+ // The following 3 styles have no impact as we did not set a keyword list for any of them.
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DATABASEOBJECT value: [NSColor redColor]];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_FUNCTION value: [NSColor redColor]];
+
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_IDENTIFIER value: [NSColor blackColor]];
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_QUOTEDIDENTIFIER fromHTML: @"#274A6D"];
+ [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_SQL_OPERATOR value: 1];
+
+ // Line number style.
+ [mEditor setColorProperty: SCI_STYLESETFORE parameter: STYLE_LINENUMBER fromHTML: @"#F0F0F0"];
+ [mEditor setColorProperty: SCI_STYLESETBACK parameter: STYLE_LINENUMBER fromHTML: @"#808080"];
+
+ [mEditor setGeneralProperty: SCI_SETMARGINTYPEN parameter: 0 value: SC_MARGIN_NUMBER];
+ [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 0 value: 35];
+
+ // Markers.
+ [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 1 value: 16];
+
+ // Some special lexer properties.
+ [mEditor setLexerProperty: @"fold" value: @"1"];
+ [mEditor setLexerProperty: @"fold.compact" value: @"0"];
+ [mEditor setLexerProperty: @"fold.comment" value: @"1"];
+ [mEditor setLexerProperty: @"fold.preprocessor" value: @"1"];
+
+ // Folder setup.
+ [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 2 value: 16];
+ [mEditor setGeneralProperty: SCI_SETMARGINMASKN parameter: 2 value: SC_MASK_FOLDERS];
+ [mEditor setGeneralProperty: SCI_SETMARGINSENSITIVEN parameter: 2 value: 1];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEROPEN value: SC_MARK_BOXMINUS];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDER value: SC_MARK_BOXPLUS];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERSUB value: SC_MARK_VLINE];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERTAIL value: SC_MARK_LCORNER];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEREND value: SC_MARK_BOXPLUSCONNECTED];
+ [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEROPENMID value: SC_MARK_BOXMINUSCONNECTED];
+ [mEditor setGeneralProperty
+ : SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERMIDTAIL value: SC_MARK_TCORNER];
+ for (int n= 25; n < 32; ++n) // Markers 25..31 are reserved for folding.
+ {
+ [mEditor setColorProperty: SCI_MARKERSETFORE parameter: n value: [NSColor whiteColor]];
+ [mEditor setColorProperty: SCI_MARKERSETBACK parameter: n value: [NSColor blackColor]];
+ }
+
+ // Init markers & indicators for highlighting of syntax errors.
+ [mEditor setColorProperty: SCI_INDICSETFORE parameter: 0 value: [NSColor redColor]];
+ [mEditor setGeneralProperty: SCI_INDICSETUNDER parameter: 0 value: 1];
+ [mEditor setGeneralProperty: SCI_INDICSETSTYLE parameter: 0 value: INDIC_SQUIGGLE];
+
+ [mEditor setColorProperty: SCI_MARKERSETBACK parameter: 0 fromHTML: @"#B1151C"];
+
+ [mEditor setColorProperty: SCI_SETSELBACK parameter: 1 value: [NSColor selectedTextBackgroundColor]];
+
+ // Uncomment if you wanna see auto wrapping in action.
+ //[mEditor setGeneralProperty: SCI_SETWRAPMODE parameter: SC_WRAP_WORD value: 0];
+
+ InfoBar* infoBar = [[[InfoBar alloc] initWithFrame: NSMakeRect(0, 0, 400, 0)] autorelease];
+ [infoBar setDisplay: IBShowAll];
+ [mEditor setInfoBar: infoBar top: NO];
+ [mEditor setStatusText: @"Operation complete"];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/* XPM */
+static const char * box_xpm[] = {
+ "12 12 2 1",
+ " c None",
+ ". c #800000",
+ " .........",
+ " . . ..",
+ " . . . .",
+ "......... .",
+ ". . . .",
+ ". . . ..",
+ ". . .. .",
+ "......... .",
+ ". . . .",
+ ". . . . ",
+ ". . .. ",
+ "......... "};
+
+
+- (void) showAutocompletion
+{
+ const char *words = "Babylon-5?1 Battlestar-Galactica Millenium-Falcon?2 Moya?2 Serenity Voyager";
+ [mEditor setGeneralProperty: SCI_AUTOCSETIGNORECASE parameter: 1 value:0];
+ [mEditor setGeneralProperty: SCI_REGISTERIMAGE parameter: 1 value:(sptr_t)box_xpm];
+ const int imSize = 12;
+ [mEditor setGeneralProperty: SCI_RGBAIMAGESETWIDTH parameter: imSize value:0];
+ [mEditor setGeneralProperty: SCI_RGBAIMAGESETHEIGHT parameter: imSize value:0];
+ char image[imSize * imSize * 4];
+ for (size_t y = 0; y < imSize; y++) {
+ for (size_t x = 0; x < imSize; x++) {
+ char *p = image + (y * imSize + x) * 4;
+ p[0] = 0xFF;
+ p[1] = 0xA0;
+ p[2] = 0;
+ p[3] = x * 23;
+ }
+ }
+ [mEditor setGeneralProperty: SCI_REGISTERRGBAIMAGE parameter: 2 value:(sptr_t)image];
+ [mEditor setGeneralProperty: SCI_AUTOCSHOW parameter: 0 value:(sptr_t)words];
+}
+
+- (IBAction) searchText: (id) sender
+{
+ NSSearchField* searchField = (NSSearchField*) sender;
+ [mEditor findAndHighlightText: [searchField stringValue]
+ matchCase: NO
+ wholeWord: NO
+ scrollTo: YES
+ wrap: YES];
+
+ long matchStart = [mEditor getGeneralProperty: SCI_GETSELECTIONSTART parameter: 0];
+ long matchEnd = [mEditor getGeneralProperty: SCI_GETSELECTIONEND parameter: 0];
+ [mEditor setGeneralProperty: SCI_FINDINDICATORFLASH parameter: matchStart value:matchEnd];
+
+ if ([[searchField stringValue] isEqualToString: @"XX"])
+ [self showAutocompletion];
+}
+
+-(IBAction) setFontQuality: (id) sender
+{
+ [ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0];
+}
+
+@end
+
+//--------------------------------------------------------------------------------------------------
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings
new file mode 100644
index 00000000000..42522ec383c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib
new file mode 100644
index 00000000000..e2d93cca317
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib
@@ -0,0 +1,3992 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">10D573</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">762</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="372"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1021">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSCustomObject" id="1014">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1050">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSMenu" id="649796088">
+ <string key="NSTitle">AMainMenu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="694149608">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">NewApplication</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <object class="NSCustomResource" key="NSOnImage" id="35465992">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="502551668">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="110575045">
+ <string key="NSTitle">NewApplication</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="238522557">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">About NewApplication</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="304266470">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="609285721">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Preferences…</string>
+ <string key="NSKeyEquiv">,</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="481834944">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1046388886">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Services</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="752062318">
+ <string key="NSTitle">Services</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <string key="NSName">_NSServicesMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="646227648">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="755159360">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide NewApplication</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="342932134">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide Others</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="908899353">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Show All</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1056857174">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="632727374">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Quit NewApplication</string>
+ <string key="NSKeyEquiv">q</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSAppleMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="379814623">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">File</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="720053764">
+ <string key="NSTitle">File</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="705341025">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">New</string>
+ <string key="NSKeyEquiv">n</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="722745758">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Open…</string>
+ <string key="NSKeyEquiv">o</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1025936716">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Open Recent</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="1065607017">
+ <string key="NSTitle">Open Recent</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="759406840">
+ <reference key="NSMenu" ref="1065607017"/>
+ <string key="NSTitle">Clear Menu</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSRecentDocumentsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="425164168">
+ <reference key="NSMenu" ref="720053764"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="776162233">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Close</string>
+ <string key="NSKeyEquiv">w</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1023925487">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Save</string>
+ <string key="NSKeyEquiv">s</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="117038363">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Save As…</string>
+ <string key="NSKeyEquiv">S</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="579971712">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Revert to Saved</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1010469920">
+ <reference key="NSMenu" ref="720053764"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="294629803">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Page Setup...</string>
+ <string key="NSKeyEquiv">P</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSToolTip"/>
+ </object>
+ <object class="NSMenuItem" id="49223823">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Print…</string>
+ <string key="NSKeyEquiv">p</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="952259628">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Edit</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="789758025">
+ <string key="NSTitle">Edit</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1058277027">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Undo</string>
+ <string key="NSKeyEquiv">z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="790794224">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Redo</string>
+ <string key="NSKeyEquiv">Z</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1040322652">
+ <reference key="NSMenu" ref="789758025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="296257095">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Cut</string>
+ <string key="NSKeyEquiv">x</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="860595796">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Copy</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="29853731">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Paste</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="437104165">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Delete</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="583158037">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Select All</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="212016141">
+ <reference key="NSMenu" ref="789758025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="892235320">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Find</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="963351320">
+ <string key="NSTitle">Find</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="447796847">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find…</string>
+ <string key="NSKeyEquiv">f</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="326711663">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find Next</string>
+ <string key="NSKeyEquiv">g</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="270902937">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find Previous</string>
+ <string key="NSKeyEquiv">G</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ <object class="NSMenuItem" id="159080638">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Use Selection for Find</string>
+ <string key="NSKeyEquiv">e</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">7</int>
+ </object>
+ <object class="NSMenuItem" id="88285865">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Jump to Selection</string>
+ <string key="NSKeyEquiv">j</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="972420730">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Spelling and Grammar</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="769623530">
+ <string key="NSTitle">Spelling and Grammar</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="679648819">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Show Spelling…</string>
+ <string key="NSKeyEquiv">:</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="96193923">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Spelling</string>
+ <string key="NSKeyEquiv">;</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="948374510">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Spelling While Typing</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="967646866">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Grammar With Spelling</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="507821607">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Substitutions</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="698887838">
+ <string key="NSTitle">Substitutions</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="605118523">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Copy/Paste</string>
+ <string key="NSKeyEquiv">f</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="197661976">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Quotes</string>
+ <string key="NSKeyEquiv">g</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="708854459">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Links</string>
+ <string key="NSKeyEquiv">G</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="676164635">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Speech</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="785027613">
+ <string key="NSTitle">Speech</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="731782645">
+ <reference key="NSMenu" ref="785027613"/>
+ <string key="NSTitle">Start Speaking</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="680220178">
+ <reference key="NSMenu" ref="785027613"/>
+ <string key="NSTitle">Stop Speaking</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="302598603">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Format</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="941447902">
+ <string key="NSTitle">Format</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="792887677">
+ <reference key="NSMenu" ref="941447902"/>
+ <string key="NSTitle">Font</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="786677654">
+ <string key="NSTitle">Font</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="159677712">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Show Fonts</string>
+ <string key="NSKeyEquiv">t</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="305399458">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Bold</string>
+ <string key="NSKeyEquiv">b</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="814362025">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Italic</string>
+ <string key="NSKeyEquiv">i</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="330926929">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Underline</string>
+ <string key="NSKeyEquiv">u</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="533507878">
+ <reference key="NSMenu" ref="786677654"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="158063935">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Bigger</string>
+ <string key="NSKeyEquiv">+</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ <object class="NSMenuItem" id="885547335">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Smaller</string>
+ <string key="NSKeyEquiv">-</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">4</int>
+ </object>
+ <object class="NSMenuItem" id="901062459">
+ <reference key="NSMenu" ref="786677654"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="767671776">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Kern</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="175441468">
+ <string key="NSTitle">Kern</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="252969304">
+ <reference key="NSMenu" ref="175441468"/>
+ <string key="NSTitle">Use Default</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="766922938">
+ <reference key="NSMenu" ref="175441468"/>
+ <string key="NSTitle">Use None</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="677519740">
+ <reference key="NSMenu" ref="175441468"/>
+ <string key="NSTitle">Tighten</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="238351151">
+ <reference key="NSMenu" ref="175441468"/>
+ <string key="NSTitle">Loosen</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="691570813">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Ligature</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="1058217995">
+ <string key="NSTitle">Ligature</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="706297211">
+ <reference key="NSMenu" ref="1058217995"/>
+ <string key="NSTitle">Use Default</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="568384683">
+ <reference key="NSMenu" ref="1058217995"/>
+ <string key="NSTitle">Use None</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="663508465">
+ <reference key="NSMenu" ref="1058217995"/>
+ <string key="NSTitle">Use All</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="769124883">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Baseline</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="18263474">
+ <string key="NSTitle">Baseline</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="257962622">
+ <reference key="NSMenu" ref="18263474"/>
+ <string key="NSTitle">Use Default</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="644725453">
+ <reference key="NSMenu" ref="18263474"/>
+ <string key="NSTitle">Superscript</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1037576581">
+ <reference key="NSMenu" ref="18263474"/>
+ <string key="NSTitle">Subscript</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="941806246">
+ <reference key="NSMenu" ref="18263474"/>
+ <string key="NSTitle">Raise</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1045724900">
+ <reference key="NSMenu" ref="18263474"/>
+ <string key="NSTitle">Lower</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="693549040">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Font Quality</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="129955363">
+ <string key="NSTitle">Font Quality</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="746486634">
+ <reference key="NSMenu" ref="129955363"/>
+ <string key="NSTitle">Default</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="693037100">
+ <reference key="NSMenu" ref="129955363"/>
+ <string key="NSTitle">Non-antialiased</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="863119271">
+ <reference key="NSMenu" ref="129955363"/>
+ <string key="NSTitle">Antialiased</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="1060624593">
+ <reference key="NSMenu" ref="129955363"/>
+ <string key="NSTitle">LCD Optimized</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="739652853">
+ <reference key="NSMenu" ref="786677654"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1012600125">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Show Colors</string>
+ <string key="NSKeyEquiv">C</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="214559597">
+ <reference key="NSMenu" ref="786677654"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="596732606">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Copy Style</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="393423671">
+ <reference key="NSMenu" ref="786677654"/>
+ <string key="NSTitle">Paste Style</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSFontMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="15516124">
+ <reference key="NSMenu" ref="941447902"/>
+ <string key="NSTitle">Text</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="23081656">
+ <string key="NSTitle">Text</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="135107054">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Align Left</string>
+ <string key="NSKeyEquiv">{</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="310547522">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Center</string>
+ <string key="NSKeyEquiv">|</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="436088763">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Justify</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="498119243">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Align Right</string>
+ <string key="NSKeyEquiv">}</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="607995063">
+ <reference key="NSMenu" ref="23081656"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="420564933">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Show Ruler</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="479856769">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Copy Ruler</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1310720</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="333628178">
+ <reference key="NSMenu" ref="23081656"/>
+ <string key="NSTitle">Paste Ruler</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1310720</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="586577488">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">View</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="466310130">
+ <string key="NSTitle">View</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="102151532">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Show Toolbar</string>
+ <string key="NSKeyEquiv">t</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="237841660">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Customize Toolbar…</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="713487014">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Window</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="835318025">
+ <string key="NSTitle">Window</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1011231497">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Minimize</string>
+ <string key="NSKeyEquiv">m</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="575023229">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Zoom</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="299356726">
+ <reference key="NSMenu" ref="835318025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="625202149">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Bring All to Front</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSWindowsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="391199113">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="374024848">
+ <string key="NSTitle">Help</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="238773614">
+ <reference key="NSMenu" ref="374024848"/>
+ <string key="NSTitle">NewApplication Help</string>
+ <string key="NSKeyEquiv">?</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName">_NSMainMenu</string>
+ </object>
+ <object class="NSWindowTemplate" id="972006081">
+ <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{335, 58}, {982, 692}}</string>
+ <int key="NSWTFlags">1946157056</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <object class="NSView" key="NSWindowView" id="439893737">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">319</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSBox" id="1016473779">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">18</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSView" id="33804839">
+ <reference key="NSNextResponder" ref="1016473779"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{1, 1}, {842, 590}}</string>
+ <reference key="NSSuperview" ref="1016473779"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{17, 16}, {844, 606}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <string key="NSOffsets">{0, 0}</string>
+ <object class="NSTextFieldCell" key="NSTitleCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Scintilla Editor</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <object class="NSColor" key="NSBackgroundColor" id="561710607">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
+ </object>
+ </object>
+ <reference key="NSContentView" ref="33804839"/>
+ <int key="NSBorderType">1</int>
+ <int key="NSBoxType">0</int>
+ <int key="NSTitlePosition">2</int>
+ <bool key="NSTransparent">NO</bool>
+ </object>
+ <object class="NSButton" id="610247741">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{872, 12}, {96, 32}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1009897894">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Quit</string>
+ <object class="NSFont" key="NSSupport" id="887178038">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="610247741"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSSearchField" id="552917647">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{20, 630}, {287, 22}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSSearchFieldCell" key="NSCell" id="515024530">
+ <int key="NSCellFlags">343014976</int>
+ <int key="NSCellFlags2">268436480</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="887178038"/>
+ <reference key="NSControlView" ref="552917647"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <int key="NSTextBezelStyle">1</int>
+ <reference key="NSBackgroundColor" ref="561710607"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ <object class="NSButtonCell" key="NSSearchButtonCell">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">search</string>
+ <reference key="NSControlView" ref="552917647"/>
+ <string key="NSAction">_searchFieldSearch:</string>
+ <reference key="NSTarget" ref="515024530"/>
+ <int key="NSButtonFlags">138690815</int>
+ <int key="NSButtonFlags2">0</int>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ <object class="NSButtonCell" key="NSCancelButtonCell">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">clear</string>
+ <object class="NSMutableArray" key="NSAccessibilityOverriddenAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>AXDescription</string>
+ <string>NSAccessibilityEncodedAttributesValueType</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancel</string>
+ <integer value="1"/>
+ </object>
+ </object>
+ </object>
+ <reference key="NSControlView" ref="552917647"/>
+ <string key="NSAction">_searchFieldCancel:</string>
+ <reference key="NSTarget" ref="515024530"/>
+ <int key="NSButtonFlags">138690815</int>
+ <int key="NSButtonFlags2">0</int>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ <int key="NSMaximumRecents">255</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{982, 692}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ </object>
+ <object class="NSCustomObject" id="755631768">
+ <string key="NSClassName">NSFontManager</string>
+ </object>
+ <object class="NSCustomObject" id="229445039">
+ <string key="NSClassName">AppController</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performMiniaturize:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1011231497"/>
+ </object>
+ <int key="connectionID">37</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">arrangeInFront:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="625202149"/>
+ </object>
+ <int key="connectionID">39</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">print:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="49223823"/>
+ </object>
+ <int key="connectionID">86</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">runPageLayout:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="294629803"/>
+ </object>
+ <int key="connectionID">87</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">clearRecentDocuments:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="759406840"/>
+ </object>
+ <int key="connectionID">127</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontStandardAboutPanel:</string>
+ <reference key="source" ref="1021"/>
+ <reference key="destination" ref="238522557"/>
+ </object>
+ <int key="connectionID">142</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performClose:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="776162233"/>
+ </object>
+ <int key="connectionID">193</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleContinuousSpellChecking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="948374510"/>
+ </object>
+ <int key="connectionID">222</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">undo:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1058277027"/>
+ </object>
+ <int key="connectionID">223</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copy:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="860595796"/>
+ </object>
+ <int key="connectionID">224</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">checkSpelling:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="96193923"/>
+ </object>
+ <int key="connectionID">225</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">paste:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="29853731"/>
+ </object>
+ <int key="connectionID">226</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">stopSpeaking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="680220178"/>
+ </object>
+ <int key="connectionID">227</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cut:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="296257095"/>
+ </object>
+ <int key="connectionID">228</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showGuessPanel:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="679648819"/>
+ </object>
+ <int key="connectionID">230</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">redo:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="790794224"/>
+ </object>
+ <int key="connectionID">231</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectAll:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="583158037"/>
+ </object>
+ <int key="connectionID">232</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">startSpeaking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="731782645"/>
+ </object>
+ <int key="connectionID">233</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">delete:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="437104165"/>
+ </object>
+ <int key="connectionID">235</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performZoom:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="575023229"/>
+ </object>
+ <int key="connectionID">240</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performFindPanelAction:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="447796847"/>
+ </object>
+ <int key="connectionID">241</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">centerSelectionInVisibleArea:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="88285865"/>
+ </object>
+ <int key="connectionID">245</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleGrammarChecking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="967646866"/>
+ </object>
+ <int key="connectionID">347</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleSmartInsertDelete:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="605118523"/>
+ </object>
+ <int key="connectionID">355</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticQuoteSubstitution:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="197661976"/>
+ </object>
+ <int key="connectionID">356</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticLinkDetection:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="708854459"/>
+ </object>
+ <int key="connectionID">357</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showHelp:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="238773614"/>
+ </object>
+ <int key="connectionID">360</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">saveDocument:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1023925487"/>
+ </object>
+ <int key="connectionID">362</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">saveDocumentAs:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="117038363"/>
+ </object>
+ <int key="connectionID">363</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">revertDocumentToSaved:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="579971712"/>
+ </object>
+ <int key="connectionID">364</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">runToolbarCustomizationPalette:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="237841660"/>
+ </object>
+ <int key="connectionID">365</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleToolbarShown:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="102151532"/>
+ </object>
+ <int key="connectionID">366</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="755159360"/>
+ </object>
+ <int key="connectionID">367</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hideOtherApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="342932134"/>
+ </object>
+ <int key="connectionID">368</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unhideAllApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="908899353"/>
+ </object>
+ <int key="connectionID">370</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">newDocument:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="705341025"/>
+ </object>
+ <int key="connectionID">373</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">openDocument:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="722745758"/>
+ </object>
+ <int key="connectionID">374</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">addFontTrait:</string>
+ <reference key="source" ref="755631768"/>
+ <reference key="destination" ref="305399458"/>
+ </object>
+ <int key="connectionID">421</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">addFontTrait:</string>
+ <reference key="source" ref="755631768"/>
+ <reference key="destination" ref="814362025"/>
+ </object>
+ <int key="connectionID">422</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">modifyFont:</string>
+ <reference key="source" ref="755631768"/>
+ <reference key="destination" ref="885547335"/>
+ </object>
+ <int key="connectionID">423</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontFontPanel:</string>
+ <reference key="source" ref="755631768"/>
+ <reference key="destination" ref="159677712"/>
+ </object>
+ <int key="connectionID">424</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">modifyFont:</string>
+ <reference key="source" ref="755631768"/>
+ <reference key="destination" ref="158063935"/>
+ </object>
+ <int key="connectionID">425</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">raiseBaseline:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="941806246"/>
+ </object>
+ <int key="connectionID">426</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">lowerBaseline:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1045724900"/>
+ </object>
+ <int key="connectionID">427</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copyFont:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="596732606"/>
+ </object>
+ <int key="connectionID">428</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">subscript:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1037576581"/>
+ </object>
+ <int key="connectionID">429</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">superscript:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="644725453"/>
+ </object>
+ <int key="connectionID">430</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">tightenKerning:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="677519740"/>
+ </object>
+ <int key="connectionID">431</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">underline:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="330926929"/>
+ </object>
+ <int key="connectionID">432</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontColorPanel:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1012600125"/>
+ </object>
+ <int key="connectionID">433</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">useAllLigatures:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="663508465"/>
+ </object>
+ <int key="connectionID">434</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">loosenKerning:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="238351151"/>
+ </object>
+ <int key="connectionID">435</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">pasteFont:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="393423671"/>
+ </object>
+ <int key="connectionID">436</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unscript:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="257962622"/>
+ </object>
+ <int key="connectionID">437</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">useStandardKerning:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="252969304"/>
+ </object>
+ <int key="connectionID">438</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">useStandardLigatures:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="706297211"/>
+ </object>
+ <int key="connectionID">439</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">turnOffLigatures:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="568384683"/>
+ </object>
+ <int key="connectionID">440</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">turnOffKerning:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="766922938"/>
+ </object>
+ <int key="connectionID">441</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">alignLeft:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="135107054"/>
+ </object>
+ <int key="connectionID">442</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">alignJustified:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="436088763"/>
+ </object>
+ <int key="connectionID">443</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copyRuler:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="479856769"/>
+ </object>
+ <int key="connectionID">444</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">alignCenter:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="310547522"/>
+ </object>
+ <int key="connectionID">445</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleRuler:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="420564933"/>
+ </object>
+ <int key="connectionID">446</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">alignRight:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="498119243"/>
+ </object>
+ <int key="connectionID">447</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">pasteRuler:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="333628178"/>
+ </object>
+ <int key="connectionID">448</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="1050"/>
+ <reference key="destination" ref="632727374"/>
+ </object>
+ <int key="connectionID">449</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">mEditHost</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="1016473779"/>
+ </object>
+ <int key="connectionID">454</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="1050"/>
+ <reference key="destination" ref="610247741"/>
+ </object>
+ <int key="connectionID">455</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">searchText:</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="552917647"/>
+ </object>
+ <int key="connectionID">468</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setFontQuality:</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="746486634"/>
+ </object>
+ <int key="connectionID">475</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setFontQuality:</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="693037100"/>
+ </object>
+ <int key="connectionID">476</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setFontQuality:</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="863119271"/>
+ </object>
+ <int key="connectionID">477</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setFontQuality:</string>
+ <reference key="source" ref="229445039"/>
+ <reference key="destination" ref="1060624593"/>
+ </object>
+ <int key="connectionID">478</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1048"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1021"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1014"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1050"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="649796088"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="713487014"/>
+ <reference ref="694149608"/>
+ <reference ref="391199113"/>
+ <reference ref="952259628"/>
+ <reference ref="379814623"/>
+ <reference ref="586577488"/>
+ <reference ref="302598603"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">MainMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="713487014"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="835318025"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="694149608"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="110575045"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">103</int>
+ <reference key="object" ref="391199113"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="374024848"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ <string key="objectName">1</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">217</int>
+ <reference key="object" ref="952259628"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="789758025"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">83</int>
+ <reference key="object" ref="379814623"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="720053764"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">81</int>
+ <reference key="object" ref="720053764"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1023925487"/>
+ <reference ref="117038363"/>
+ <reference ref="49223823"/>
+ <reference ref="722745758"/>
+ <reference ref="705341025"/>
+ <reference ref="1025936716"/>
+ <reference ref="294629803"/>
+ <reference ref="776162233"/>
+ <reference ref="425164168"/>
+ <reference ref="579971712"/>
+ <reference ref="1010469920"/>
+ </object>
+ <reference key="parent" ref="379814623"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">75</int>
+ <reference key="object" ref="1023925487"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">3</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">80</int>
+ <reference key="object" ref="117038363"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">8</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">78</int>
+ <reference key="object" ref="49223823"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">6</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">72</int>
+ <reference key="object" ref="722745758"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">82</int>
+ <reference key="object" ref="705341025"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">9</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">124</int>
+ <reference key="object" ref="1025936716"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1065607017"/>
+ </object>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">77</int>
+ <reference key="object" ref="294629803"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">5</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">73</int>
+ <reference key="object" ref="776162233"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">1</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">79</int>
+ <reference key="object" ref="425164168"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">7</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">112</int>
+ <reference key="object" ref="579971712"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">10</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">74</int>
+ <reference key="object" ref="1010469920"/>
+ <reference key="parent" ref="720053764"/>
+ <string key="objectName">2</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">125</int>
+ <reference key="object" ref="1065607017"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="759406840"/>
+ </object>
+ <reference key="parent" ref="1025936716"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">126</int>
+ <reference key="object" ref="759406840"/>
+ <reference key="parent" ref="1065607017"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">205</int>
+ <reference key="object" ref="789758025"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="437104165"/>
+ <reference ref="583158037"/>
+ <reference ref="1058277027"/>
+ <reference ref="212016141"/>
+ <reference ref="296257095"/>
+ <reference ref="29853731"/>
+ <reference ref="860595796"/>
+ <reference ref="1040322652"/>
+ <reference ref="790794224"/>
+ <reference ref="892235320"/>
+ <reference ref="972420730"/>
+ <reference ref="676164635"/>
+ <reference ref="507821607"/>
+ </object>
+ <reference key="parent" ref="952259628"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">202</int>
+ <reference key="object" ref="437104165"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">198</int>
+ <reference key="object" ref="583158037"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">207</int>
+ <reference key="object" ref="1058277027"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">214</int>
+ <reference key="object" ref="212016141"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">199</int>
+ <reference key="object" ref="296257095"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">203</int>
+ <reference key="object" ref="29853731"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">197</int>
+ <reference key="object" ref="860595796"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">206</int>
+ <reference key="object" ref="1040322652"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">215</int>
+ <reference key="object" ref="790794224"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">218</int>
+ <reference key="object" ref="892235320"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="963351320"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">216</int>
+ <reference key="object" ref="972420730"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="769623530"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">200</int>
+ <reference key="object" ref="769623530"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="948374510"/>
+ <reference ref="96193923"/>
+ <reference ref="679648819"/>
+ <reference ref="967646866"/>
+ </object>
+ <reference key="parent" ref="972420730"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">219</int>
+ <reference key="object" ref="948374510"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">201</int>
+ <reference key="object" ref="96193923"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">204</int>
+ <reference key="object" ref="679648819"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">220</int>
+ <reference key="object" ref="963351320"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="270902937"/>
+ <reference ref="88285865"/>
+ <reference ref="159080638"/>
+ <reference ref="326711663"/>
+ <reference ref="447796847"/>
+ </object>
+ <reference key="parent" ref="892235320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">213</int>
+ <reference key="object" ref="270902937"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">210</int>
+ <reference key="object" ref="88285865"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">221</int>
+ <reference key="object" ref="159080638"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">208</int>
+ <reference key="object" ref="326711663"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">209</int>
+ <reference key="object" ref="447796847"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">106</int>
+ <reference key="object" ref="374024848"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="238773614"/>
+ </object>
+ <reference key="parent" ref="391199113"/>
+ <string key="objectName">2</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">111</int>
+ <reference key="object" ref="238773614"/>
+ <reference key="parent" ref="374024848"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="110575045"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="238522557"/>
+ <reference ref="755159360"/>
+ <reference ref="908899353"/>
+ <reference ref="632727374"/>
+ <reference ref="646227648"/>
+ <reference ref="609285721"/>
+ <reference ref="481834944"/>
+ <reference ref="304266470"/>
+ <reference ref="1046388886"/>
+ <reference ref="1056857174"/>
+ <reference ref="342932134"/>
+ </object>
+ <reference key="parent" ref="694149608"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="238522557"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">134</int>
+ <reference key="object" ref="755159360"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">150</int>
+ <reference key="object" ref="908899353"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">136</int>
+ <reference key="object" ref="632727374"/>
+ <reference key="parent" ref="110575045"/>
+ <string key="objectName">1111</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">144</int>
+ <reference key="object" ref="646227648"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">129</int>
+ <reference key="object" ref="609285721"/>
+ <reference key="parent" ref="110575045"/>
+ <string key="objectName">121</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">143</int>
+ <reference key="object" ref="481834944"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">236</int>
+ <reference key="object" ref="304266470"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">131</int>
+ <reference key="object" ref="1046388886"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="752062318"/>
+ </object>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">149</int>
+ <reference key="object" ref="1056857174"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">145</int>
+ <reference key="object" ref="342932134"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">130</int>
+ <reference key="object" ref="752062318"/>
+ <reference key="parent" ref="1046388886"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="835318025"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="299356726"/>
+ <reference ref="625202149"/>
+ <reference ref="575023229"/>
+ <reference ref="1011231497"/>
+ </object>
+ <reference key="parent" ref="713487014"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">92</int>
+ <reference key="object" ref="299356726"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="625202149"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">239</int>
+ <reference key="object" ref="575023229"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="1011231497"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">295</int>
+ <reference key="object" ref="586577488"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="466310130"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">296</int>
+ <reference key="object" ref="466310130"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="102151532"/>
+ <reference ref="237841660"/>
+ </object>
+ <reference key="parent" ref="586577488"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">297</int>
+ <reference key="object" ref="102151532"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">298</int>
+ <reference key="object" ref="237841660"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">211</int>
+ <reference key="object" ref="676164635"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="785027613"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">212</int>
+ <reference key="object" ref="785027613"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="680220178"/>
+ <reference ref="731782645"/>
+ </object>
+ <reference key="parent" ref="676164635"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">195</int>
+ <reference key="object" ref="680220178"/>
+ <reference key="parent" ref="785027613"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">196</int>
+ <reference key="object" ref="731782645"/>
+ <reference key="parent" ref="785027613"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">346</int>
+ <reference key="object" ref="967646866"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">348</int>
+ <reference key="object" ref="507821607"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="698887838"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">349</int>
+ <reference key="object" ref="698887838"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="605118523"/>
+ <reference ref="197661976"/>
+ <reference ref="708854459"/>
+ </object>
+ <reference key="parent" ref="507821607"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">350</int>
+ <reference key="object" ref="605118523"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">351</int>
+ <reference key="object" ref="197661976"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">354</int>
+ <reference key="object" ref="708854459"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">371</int>
+ <reference key="object" ref="972006081"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="439893737"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">372</int>
+ <reference key="object" ref="439893737"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1016473779"/>
+ <reference ref="610247741"/>
+ <reference ref="552917647"/>
+ </object>
+ <reference key="parent" ref="972006081"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">375</int>
+ <reference key="object" ref="302598603"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="941447902"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">376</int>
+ <reference key="object" ref="941447902"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="792887677"/>
+ <reference ref="15516124"/>
+ </object>
+ <reference key="parent" ref="302598603"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">377</int>
+ <reference key="object" ref="792887677"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="786677654"/>
+ </object>
+ <reference key="parent" ref="941447902"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">378</int>
+ <reference key="object" ref="15516124"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="23081656"/>
+ </object>
+ <reference key="parent" ref="941447902"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">379</int>
+ <reference key="object" ref="23081656"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="135107054"/>
+ <reference ref="310547522"/>
+ <reference ref="436088763"/>
+ <reference ref="498119243"/>
+ <reference ref="607995063"/>
+ <reference ref="420564933"/>
+ <reference ref="479856769"/>
+ <reference ref="333628178"/>
+ </object>
+ <reference key="parent" ref="15516124"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">380</int>
+ <reference key="object" ref="135107054"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">381</int>
+ <reference key="object" ref="310547522"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">382</int>
+ <reference key="object" ref="436088763"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">383</int>
+ <reference key="object" ref="498119243"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">384</int>
+ <reference key="object" ref="607995063"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">385</int>
+ <reference key="object" ref="420564933"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">386</int>
+ <reference key="object" ref="479856769"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">387</int>
+ <reference key="object" ref="333628178"/>
+ <reference key="parent" ref="23081656"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">388</int>
+ <reference key="object" ref="786677654"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="159677712"/>
+ <reference ref="305399458"/>
+ <reference ref="814362025"/>
+ <reference ref="330926929"/>
+ <reference ref="533507878"/>
+ <reference ref="158063935"/>
+ <reference ref="885547335"/>
+ <reference ref="901062459"/>
+ <reference ref="767671776"/>
+ <reference ref="691570813"/>
+ <reference ref="769124883"/>
+ <reference ref="739652853"/>
+ <reference ref="1012600125"/>
+ <reference ref="214559597"/>
+ <reference ref="596732606"/>
+ <reference ref="393423671"/>
+ <reference ref="693549040"/>
+ </object>
+ <reference key="parent" ref="792887677"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">389</int>
+ <reference key="object" ref="159677712"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">390</int>
+ <reference key="object" ref="305399458"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">391</int>
+ <reference key="object" ref="814362025"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">392</int>
+ <reference key="object" ref="330926929"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">393</int>
+ <reference key="object" ref="533507878"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">394</int>
+ <reference key="object" ref="158063935"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">395</int>
+ <reference key="object" ref="885547335"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">396</int>
+ <reference key="object" ref="901062459"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">397</int>
+ <reference key="object" ref="767671776"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="175441468"/>
+ </object>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">398</int>
+ <reference key="object" ref="691570813"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1058217995"/>
+ </object>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">399</int>
+ <reference key="object" ref="769124883"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="18263474"/>
+ </object>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">400</int>
+ <reference key="object" ref="739652853"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">401</int>
+ <reference key="object" ref="1012600125"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">402</int>
+ <reference key="object" ref="214559597"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">403</int>
+ <reference key="object" ref="596732606"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">404</int>
+ <reference key="object" ref="393423671"/>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">405</int>
+ <reference key="object" ref="18263474"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="257962622"/>
+ <reference ref="644725453"/>
+ <reference ref="1037576581"/>
+ <reference ref="941806246"/>
+ <reference ref="1045724900"/>
+ </object>
+ <reference key="parent" ref="769124883"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">406</int>
+ <reference key="object" ref="257962622"/>
+ <reference key="parent" ref="18263474"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">407</int>
+ <reference key="object" ref="644725453"/>
+ <reference key="parent" ref="18263474"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">408</int>
+ <reference key="object" ref="1037576581"/>
+ <reference key="parent" ref="18263474"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">409</int>
+ <reference key="object" ref="941806246"/>
+ <reference key="parent" ref="18263474"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">410</int>
+ <reference key="object" ref="1045724900"/>
+ <reference key="parent" ref="18263474"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">411</int>
+ <reference key="object" ref="1058217995"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="706297211"/>
+ <reference ref="568384683"/>
+ <reference ref="663508465"/>
+ </object>
+ <reference key="parent" ref="691570813"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">412</int>
+ <reference key="object" ref="706297211"/>
+ <reference key="parent" ref="1058217995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">413</int>
+ <reference key="object" ref="568384683"/>
+ <reference key="parent" ref="1058217995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">414</int>
+ <reference key="object" ref="663508465"/>
+ <reference key="parent" ref="1058217995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">415</int>
+ <reference key="object" ref="175441468"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="252969304"/>
+ <reference ref="766922938"/>
+ <reference ref="677519740"/>
+ <reference ref="238351151"/>
+ </object>
+ <reference key="parent" ref="767671776"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">416</int>
+ <reference key="object" ref="252969304"/>
+ <reference key="parent" ref="175441468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">417</int>
+ <reference key="object" ref="766922938"/>
+ <reference key="parent" ref="175441468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">418</int>
+ <reference key="object" ref="677519740"/>
+ <reference key="parent" ref="175441468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">419</int>
+ <reference key="object" ref="238351151"/>
+ <reference key="parent" ref="175441468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">420</int>
+ <reference key="object" ref="755631768"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">450</int>
+ <reference key="object" ref="229445039"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">451</int>
+ <reference key="object" ref="1016473779"/>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">452</int>
+ <reference key="object" ref="610247741"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1009897894"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">453</int>
+ <reference key="object" ref="1009897894"/>
+ <reference key="parent" ref="610247741"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">466</int>
+ <reference key="object" ref="552917647"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="515024530"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">467</int>
+ <reference key="object" ref="515024530"/>
+ <reference key="parent" ref="552917647"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">469</int>
+ <reference key="object" ref="693549040"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="129955363"/>
+ </object>
+ <reference key="parent" ref="786677654"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">470</int>
+ <reference key="object" ref="129955363"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="746486634"/>
+ <reference ref="693037100"/>
+ <reference ref="863119271"/>
+ <reference ref="1060624593"/>
+ </object>
+ <reference key="parent" ref="693549040"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">471</int>
+ <reference key="object" ref="746486634"/>
+ <reference key="parent" ref="129955363"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">472</int>
+ <reference key="object" ref="693037100"/>
+ <reference key="parent" ref="129955363"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">473</int>
+ <reference key="object" ref="863119271"/>
+ <reference key="parent" ref="129955363"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">474</int>
+ <reference key="object" ref="1060624593"/>
+ <reference key="parent" ref="129955363"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-3.IBPluginDependency</string>
+ <string>103.IBPluginDependency</string>
+ <string>103.ImportedFromIB2</string>
+ <string>106.IBPluginDependency</string>
+ <string>106.ImportedFromIB2</string>
+ <string>106.editorWindowContentRectSynchronizationRect</string>
+ <string>111.IBPluginDependency</string>
+ <string>111.ImportedFromIB2</string>
+ <string>112.IBPluginDependency</string>
+ <string>112.ImportedFromIB2</string>
+ <string>124.IBPluginDependency</string>
+ <string>124.ImportedFromIB2</string>
+ <string>125.IBPluginDependency</string>
+ <string>125.ImportedFromIB2</string>
+ <string>125.editorWindowContentRectSynchronizationRect</string>
+ <string>126.IBPluginDependency</string>
+ <string>126.ImportedFromIB2</string>
+ <string>129.IBPluginDependency</string>
+ <string>129.ImportedFromIB2</string>
+ <string>130.IBPluginDependency</string>
+ <string>130.ImportedFromIB2</string>
+ <string>130.editorWindowContentRectSynchronizationRect</string>
+ <string>131.IBPluginDependency</string>
+ <string>131.ImportedFromIB2</string>
+ <string>134.IBPluginDependency</string>
+ <string>134.ImportedFromIB2</string>
+ <string>136.IBPluginDependency</string>
+ <string>136.ImportedFromIB2</string>
+ <string>143.IBPluginDependency</string>
+ <string>143.ImportedFromIB2</string>
+ <string>144.IBPluginDependency</string>
+ <string>144.ImportedFromIB2</string>
+ <string>145.IBPluginDependency</string>
+ <string>145.ImportedFromIB2</string>
+ <string>149.IBPluginDependency</string>
+ <string>149.ImportedFromIB2</string>
+ <string>150.IBPluginDependency</string>
+ <string>150.ImportedFromIB2</string>
+ <string>19.IBPluginDependency</string>
+ <string>19.ImportedFromIB2</string>
+ <string>195.IBPluginDependency</string>
+ <string>195.ImportedFromIB2</string>
+ <string>196.IBPluginDependency</string>
+ <string>196.ImportedFromIB2</string>
+ <string>197.IBPluginDependency</string>
+ <string>197.ImportedFromIB2</string>
+ <string>198.IBPluginDependency</string>
+ <string>198.ImportedFromIB2</string>
+ <string>199.IBPluginDependency</string>
+ <string>199.ImportedFromIB2</string>
+ <string>200.IBPluginDependency</string>
+ <string>200.ImportedFromIB2</string>
+ <string>200.editorWindowContentRectSynchronizationRect</string>
+ <string>201.IBPluginDependency</string>
+ <string>201.ImportedFromIB2</string>
+ <string>202.IBPluginDependency</string>
+ <string>202.ImportedFromIB2</string>
+ <string>203.IBPluginDependency</string>
+ <string>203.ImportedFromIB2</string>
+ <string>204.IBPluginDependency</string>
+ <string>204.ImportedFromIB2</string>
+ <string>205.IBPluginDependency</string>
+ <string>205.ImportedFromIB2</string>
+ <string>205.editorWindowContentRectSynchronizationRect</string>
+ <string>206.IBPluginDependency</string>
+ <string>206.ImportedFromIB2</string>
+ <string>207.IBPluginDependency</string>
+ <string>207.ImportedFromIB2</string>
+ <string>208.IBPluginDependency</string>
+ <string>208.ImportedFromIB2</string>
+ <string>209.IBPluginDependency</string>
+ <string>209.ImportedFromIB2</string>
+ <string>210.IBPluginDependency</string>
+ <string>210.ImportedFromIB2</string>
+ <string>211.IBPluginDependency</string>
+ <string>211.ImportedFromIB2</string>
+ <string>212.IBPluginDependency</string>
+ <string>212.ImportedFromIB2</string>
+ <string>212.editorWindowContentRectSynchronizationRect</string>
+ <string>213.IBPluginDependency</string>
+ <string>213.ImportedFromIB2</string>
+ <string>214.IBPluginDependency</string>
+ <string>214.ImportedFromIB2</string>
+ <string>215.IBPluginDependency</string>
+ <string>215.ImportedFromIB2</string>
+ <string>216.IBPluginDependency</string>
+ <string>216.ImportedFromIB2</string>
+ <string>217.IBPluginDependency</string>
+ <string>217.ImportedFromIB2</string>
+ <string>218.IBPluginDependency</string>
+ <string>218.ImportedFromIB2</string>
+ <string>219.IBPluginDependency</string>
+ <string>219.ImportedFromIB2</string>
+ <string>220.IBPluginDependency</string>
+ <string>220.ImportedFromIB2</string>
+ <string>220.editorWindowContentRectSynchronizationRect</string>
+ <string>221.IBPluginDependency</string>
+ <string>221.ImportedFromIB2</string>
+ <string>23.IBPluginDependency</string>
+ <string>23.ImportedFromIB2</string>
+ <string>236.IBPluginDependency</string>
+ <string>236.ImportedFromIB2</string>
+ <string>239.IBPluginDependency</string>
+ <string>239.ImportedFromIB2</string>
+ <string>24.IBPluginDependency</string>
+ <string>24.ImportedFromIB2</string>
+ <string>24.editorWindowContentRectSynchronizationRect</string>
+ <string>29.IBEditorWindowLastContentRect</string>
+ <string>29.IBPluginDependency</string>
+ <string>29.ImportedFromIB2</string>
+ <string>29.WindowOrigin</string>
+ <string>29.editorWindowContentRectSynchronizationRect</string>
+ <string>295.IBPluginDependency</string>
+ <string>296.IBPluginDependency</string>
+ <string>296.editorWindowContentRectSynchronizationRect</string>
+ <string>297.IBPluginDependency</string>
+ <string>298.IBPluginDependency</string>
+ <string>346.IBPluginDependency</string>
+ <string>346.ImportedFromIB2</string>
+ <string>348.IBPluginDependency</string>
+ <string>348.ImportedFromIB2</string>
+ <string>349.IBPluginDependency</string>
+ <string>349.ImportedFromIB2</string>
+ <string>349.editorWindowContentRectSynchronizationRect</string>
+ <string>350.IBPluginDependency</string>
+ <string>350.ImportedFromIB2</string>
+ <string>351.IBPluginDependency</string>
+ <string>351.ImportedFromIB2</string>
+ <string>354.IBPluginDependency</string>
+ <string>354.ImportedFromIB2</string>
+ <string>371.IBEditorWindowLastContentRect</string>
+ <string>371.IBPluginDependency</string>
+ <string>371.IBWindowTemplateEditedContentRect</string>
+ <string>371.NSWindowTemplate.visibleAtLaunch</string>
+ <string>371.editorWindowContentRectSynchronizationRect</string>
+ <string>371.windowTemplate.maxSize</string>
+ <string>372.IBPluginDependency</string>
+ <string>375.IBPluginDependency</string>
+ <string>376.IBEditorWindowLastContentRect</string>
+ <string>376.IBPluginDependency</string>
+ <string>377.IBPluginDependency</string>
+ <string>378.IBPluginDependency</string>
+ <string>379.IBPluginDependency</string>
+ <string>380.IBPluginDependency</string>
+ <string>381.IBPluginDependency</string>
+ <string>382.IBPluginDependency</string>
+ <string>383.IBPluginDependency</string>
+ <string>384.IBPluginDependency</string>
+ <string>385.IBPluginDependency</string>
+ <string>386.IBPluginDependency</string>
+ <string>387.IBPluginDependency</string>
+ <string>388.IBEditorWindowLastContentRect</string>
+ <string>388.IBPluginDependency</string>
+ <string>389.IBPluginDependency</string>
+ <string>390.IBPluginDependency</string>
+ <string>391.IBPluginDependency</string>
+ <string>392.IBPluginDependency</string>
+ <string>393.IBPluginDependency</string>
+ <string>394.IBPluginDependency</string>
+ <string>395.IBPluginDependency</string>
+ <string>396.IBPluginDependency</string>
+ <string>397.IBPluginDependency</string>
+ <string>398.IBPluginDependency</string>
+ <string>399.IBPluginDependency</string>
+ <string>400.IBPluginDependency</string>
+ <string>401.IBPluginDependency</string>
+ <string>402.IBPluginDependency</string>
+ <string>403.IBPluginDependency</string>
+ <string>404.IBPluginDependency</string>
+ <string>405.IBPluginDependency</string>
+ <string>406.IBPluginDependency</string>
+ <string>407.IBPluginDependency</string>
+ <string>408.IBPluginDependency</string>
+ <string>409.IBPluginDependency</string>
+ <string>410.IBPluginDependency</string>
+ <string>411.IBPluginDependency</string>
+ <string>412.IBPluginDependency</string>
+ <string>413.IBPluginDependency</string>
+ <string>414.IBPluginDependency</string>
+ <string>415.IBPluginDependency</string>
+ <string>416.IBPluginDependency</string>
+ <string>417.IBPluginDependency</string>
+ <string>418.IBPluginDependency</string>
+ <string>419.IBPluginDependency</string>
+ <string>451.IBPluginDependency</string>
+ <string>452.IBPluginDependency</string>
+ <string>453.IBPluginDependency</string>
+ <string>466.IBPluginDependency</string>
+ <string>467.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>5.ImportedFromIB2</string>
+ <string>56.IBPluginDependency</string>
+ <string>56.ImportedFromIB2</string>
+ <string>57.IBEditorWindowLastContentRect</string>
+ <string>57.IBPluginDependency</string>
+ <string>57.ImportedFromIB2</string>
+ <string>57.editorWindowContentRectSynchronizationRect</string>
+ <string>58.IBPluginDependency</string>
+ <string>58.ImportedFromIB2</string>
+ <string>72.IBPluginDependency</string>
+ <string>72.ImportedFromIB2</string>
+ <string>73.IBPluginDependency</string>
+ <string>73.ImportedFromIB2</string>
+ <string>74.IBPluginDependency</string>
+ <string>74.ImportedFromIB2</string>
+ <string>75.IBPluginDependency</string>
+ <string>75.ImportedFromIB2</string>
+ <string>77.IBPluginDependency</string>
+ <string>77.ImportedFromIB2</string>
+ <string>78.IBPluginDependency</string>
+ <string>78.ImportedFromIB2</string>
+ <string>79.IBPluginDependency</string>
+ <string>79.ImportedFromIB2</string>
+ <string>80.IBPluginDependency</string>
+ <string>80.ImportedFromIB2</string>
+ <string>81.IBPluginDependency</string>
+ <string>81.ImportedFromIB2</string>
+ <string>81.editorWindowContentRectSynchronizationRect</string>
+ <string>82.IBPluginDependency</string>
+ <string>82.ImportedFromIB2</string>
+ <string>83.IBPluginDependency</string>
+ <string>83.ImportedFromIB2</string>
+ <string>92.IBPluginDependency</string>
+ <string>92.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{596, 852}, {216, 23}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{522, 812}, {146, 23}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{436, 809}, {64, 6}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {275, 83}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{187, 434}, {243, 243}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {167, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {241, 103}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{525, 802}, {197, 73}}</string>
+ <string>{{207, 285}, {478, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{74, 862}</string>
+ <string>{{6, 978}, {478, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{475, 832}, {234, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {215, 63}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{274, 370}, {982, 692}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{274, 370}, {982, 692}}</string>
+ <integer value="1"/>
+ <string>{{33, 99}, {480, 360}}</string>
+ <string>{3.40282e+38, 3.40282e+38}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{437, 242}, {86, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{523, 2}, {178, 283}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{219, 102}, {245, 183}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{23, 794}, {245, 183}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{145, 474}, {199, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">468</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">AppController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">searchText:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">mEditHost</string>
+ <string key="NS.object.0">NSBox</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">AppController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSActionCell</string>
+ <string key="superclassName">NSCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="905531705">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="854027565">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="562071960">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSBox</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSBox.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSBrowser</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButton</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButtonCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSCell</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="10957210">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocumentController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>clearRecentDocuments:</string>
+ <string>newDocument:</string>
+ <string>openDocument:</string>
+ <string>saveAllDocuments:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFontManager</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="60454901">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMatrix</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMatrix.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="687201532">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenuItem</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="283337664">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMovieView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMovieView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="905531705"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="854027565"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="562071960"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="10957210"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="60454901"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="687201532"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1040540259">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="763667182">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSSearchField</string>
+ <string key="superclassName">NSTextField</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSearchField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSSearchFieldCell</string>
+ <string key="superclassName">NSTextFieldCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSearchFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTableView</string>
+ <string key="superclassName">NSControl</string>
+ <reference key="sourceIdentifier" ref="1040540259"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSText</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSText.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextView</string>
+ <string key="superclassName">NSText</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <reference key="sourceIdentifier" ref="283337664"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="763667182"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1050" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1050" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../ScintillaTest.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSMenuCheckmark</string>
+ <string>NSMenuMixedState</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{9, 8}</string>
+ <string>{7, 2}</string>
+ </object>
+ </object>
+ </data>
+</archive>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Info.plist b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Info.plist
new file mode 100644
index 00000000000..6364d76a963
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Info.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sun.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist
new file mode 100644
index 00000000000..2c67ffbf242
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sun.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj
new file mode 100644
index 00000000000..ff962ef69ba
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj
@@ -0,0 +1,410 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
+ 271FA52C0F850BE20033D021 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 271FA52B0F850BE20033D021 /* AppController.mm */; };
+ 2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */ = {isa = PBXBuildFile; fileRef = 2791F4480FC1A8E9009DBCF9 /* TestData.sql */; };
+ 27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; };
+ 27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 2744E5E90FC16BE200E85C33 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 8DC2EF5B0486A6940098B216;
+ remoteInfo = Scintilla;
+ };
+ 27AF7EC60FC2C36A007160EF /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
+ remoteInfo = Scintilla;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 272133C20F973596006BE49A /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 271FA52A0F850BE20033D021 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
+ 271FA52B0F850BE20033D021 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = "<group>"; wrapsLines = 0; };
+ 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ScintillaFramework.xcodeproj; path = ../ScintillaFramework/ScintillaFramework.xcodeproj; sourceTree = SOURCE_ROOT; };
+ 2791F4480FC1A8E9009DBCF9 /* TestData.sql */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestData.sql; sourceTree = "<group>"; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ScintillaTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScintillaTest_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* ScintillaTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScintillaTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 271FA52A0F850BE20033D021 /* AppController.h */,
+ 271FA52B0F850BE20033D021 /* AppController.mm */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ScintillaTest.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 2744E5E30FC16BE200E85C33 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ScintillaTest */ = {
+ isa = PBXGroup;
+ children = (
+ 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */,
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = ScintillaTest;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ScintillaTest_Prefix.pch */,
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 2791F4480FC1A8E9009DBCF9 /* TestData.sql */,
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ScintillaTest */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ScintillaTest" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 272133C20F973596006BE49A /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 27AF7EC70FC2C36A007160EF /* PBXTargetDependency */,
+ );
+ name = ScintillaTest;
+ productInstallPath = "$(HOME)/Applications";
+ productName = ScintillaTest;
+ productReference = 8D1107320486CEB800E47090 /* ScintillaTest.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ };
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ScintillaTest */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 2744E5E30FC16BE200E85C33 /* Products */;
+ ProjectRef = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ScintillaTest */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.framework;
+ path = Scintilla.framework;
+ remoteRef = 2744E5E90FC16BE200E85C33 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+ 2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072D0486CEB800E47090 /* main.m in Sources */,
+ 271FA52C0F850BE20033D021 /* AppController.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 27AF7EC70FC2C36A007160EF /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = Scintilla;
+ targetProxy = 27AF7EC60FC2C36A007160EF /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1DDD58150DA1D0A300B32029 /* English */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ SCI_LEXER,
+ SCI_NAMESPACE,
+ );
+ HEADER_SEARCH_PATHS = "";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = ScintillaTest;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "";
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ COMBINE_HIDPI_IMAGES = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ SCI_LEXER,
+ SCI_NAMESPACE,
+ );
+ HEADER_SEARCH_PATHS = "";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
+ OTHER_LDFLAGS = "";
+ PRODUCT_NAME = ScintillaTest;
+ SDKROOT = macosx;
+ USER_HEADER_SEARCH_PATHS = "";
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "";
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_LDFLAGS = "";
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ScintillaTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch
new file mode 100644
index 00000000000..6c74b525638
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'ScintillaTest' target in the 'ScintillaTest' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/TestData.sql b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/TestData.sql
new file mode 100644
index 00000000000..2e2ebfc8475
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/TestData.sql
@@ -0,0 +1,215 @@
+-- MySQL Administrator dump 1.4
+--
+-- ------------------------------------------------------
+-- Server version 5.0.45
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI_QUOTES' */;
+
+/**
+ * Foldable multiline comment.
+ */
+
+-- {
+-- Create schema sakila
+-- }
+
+CREATE DATABASE IF NOT EXISTS sakila;
+USE sakila;
+DROP TABLE IF EXISTS "sakila"."actor_info";
+DROP VIEW IF EXISTS "sakila"."actor_info";
+CREATE TABLE "sakila"."actor_info" (
+ "actor_id" smallint(5) unsigned,
+ "first_name" varchar(45),
+ "last_name" varchar(45),
+ "film_info" varchar(341)
+);
+DROP TABLE IF EXISTS "sakila"."actor";
+CREATE TABLE "sakila"."actor" (
+ "actor_id" smallint(5) unsigned NOT NULL auto_increment,
+ "first_name" varchar(45) NOT NULL,
+ "last_name" varchar(45) NOT NULL,
+ "last_update" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY ("actor_id"),
+ KEY "idx_actor_last_name" ("last_name")
+) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8;
+INSERT INTO "sakila"."actor" VALUES (1,'PENELOPE','GUINESS','2006-02-15 04:34:33'),
+ (2,'NICK','WAHLBERG','2006-02-15 04:34:33'),
+ (3,'ED','CHASE','2006-02-15 04:34:33'),
+ (4,'JENNIFER','DAVIS','2006-02-15 04:34:33'),
+ (149,'RUSSELL','TEMPLE','2006-02-15 04:34:33'),
+ (150,'JAYNE','NOLTE','2006-02-15 04:34:33'),
+ (151,'GEOFFREY','HESTON','2006-02-15 04:34:33'),
+ (152,'BEN','HARRIS','2006-02-15 04:34:33'),
+ (153,'MINNIE','KILMER','2006-02-15 04:34:33'),
+ (154,'MERYL','GIBSON','2006-02-15 04:34:33'),
+ (155,'IAN','TANDY','2006-02-15 04:34:33'),
+ (156,'FAY','WOOD','2006-02-15 04:34:33'),
+ (157,'GRETA','MALDEN','2006-02-15 04:34:33'),
+ (158,'VIVIEN','BASINGER','2006-02-15 04:34:33'),
+ (159,'LAURA','BRODY','2006-02-15 04:34:33'),
+ (160,'CHRIS','DEPP','2006-02-15 04:34:33'),
+ (161,'HARVEY','HOPE','2006-02-15 04:34:33'),
+ (162,'OPRAH','KILMER','2006-02-15 04:34:33'),
+ (163,'CHRISTOPHER','WEST','2006-02-15 04:34:33'),
+ (164,'HUMPHREY','WILLIS','2006-02-15 04:34:33'),
+ (165,'AL','GARLAND','2006-02-15 04:34:33'),
+ (166,'NICK','DEGENERES','2006-02-15 04:34:33'),
+ (167,'LAURENCE','BULLOCK','2006-02-15 04:34:33'),
+ (168,'WILL','WILSON','2006-02-15 04:34:33'),
+ (169,'KENNETH','HOFFMAN','2006-02-15 04:34:33'),
+ (170,'MENA','HOPPER','2006-02-15 04:34:33'),
+ (171,'OLYMPIA','PFEIFFER','2006-02-15 04:34:33'),
+ (190,'AUDREY','BAILEY','2006-02-15 04:34:33'),
+ (191,'GREGORY','GOODING','2006-02-15 04:34:33'),
+ (192,'JOHN','SUVARI','2006-02-15 04:34:33'),
+ (193,'BURT','TEMPLE','2006-02-15 04:34:33'),
+ (194,'MERYL','ALLEN','2006-02-15 04:34:33'),
+ (195,'JAYNE','SILVERSTONE','2006-02-15 04:34:33'),
+ (196,'BELA','WALKEN','2006-02-15 04:34:33'),
+ (197,'REESE','WEST','2006-02-15 04:34:33'),
+ (198,'MARY','KEITEL','2006-02-15 04:34:33'),
+ (199,'JULIA','FAWCETT','2006-02-15 04:34:33'),
+ (200,'THORA','TEMPLE','2006-02-15 04:34:33');
+
+DROP TRIGGER /*!50030 IF EXISTS */ "sakila"."payment_date";
+
+DELIMITER $$
+
+CREATE DEFINER = "root"@"localhost" TRIGGER "sakila"."payment_date" BEFORE INSERT ON "payment" FOR EACH ROW SET NEW.payment_date = NOW() $$
+
+DELIMITER ;
+
+
+DROP TABLE IF EXISTS "sakila"."sales_by_store";
+DROP VIEW IF EXISTS "sakila"."sales_by_store";
+CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "sakila"."sales_by_store" AS select concat("c"."city",_utf8',',"cy"."country") AS "store",concat("m"."first_name",_utf8' ',"m"."last_name") AS "manager",sum("p"."amount") AS "total_sales" from ((((((("sakila"."payment" "p" join "sakila"."rental" "r" on(("p"."rental_id" = "r"."rental_id"))) join "sakila"."inventory" "i" on(("r"."inventory_id" = "i"."inventory_id"))) join "sakila"."store" "s" on(("i"."store_id" = "s"."store_id"))) join "sakila"."address" "a" on(("s"."address_id" = "a"."address_id"))) join "sakila"."city" "c" on(("a"."city_id" = "c"."city_id"))) join "sakila"."country" "cy" on(("c"."country_id" = "cy"."country_id"))) join "sakila"."staff" "m" on(("s"."manager_staff_id" = "m"."staff_id"))) group by "s"."store_id" order by "cy"."country","c"."city";
+
+--
+-- View structure for view `staff_list`
+--
+
+CREATE VIEW staff_list
+AS
+SELECT s.staff_id AS ID, CONCAT(s.first_name, _utf8' ', s.last_name) AS name, a.address AS address, a.postal_code AS `zip code`, a.phone AS phone,
+ city.city AS city, country.country AS country, s.store_id AS SID
+FROM staff AS s JOIN address AS a ON s.address_id = a.address_id JOIN city ON a.city_id = city.city_id
+ JOIN country ON city.country_id = country.country_id;
+
+--
+-- View structure for view `actor_info`
+--
+
+CREATE DEFINER=CURRENT_USER SQL SECURITY INVOKER VIEW actor_info
+AS
+SELECT
+a.actor_id,
+a.first_name,
+a.last_name,
+GROUP_CONCAT(DISTINCT CONCAT(c.name, ': ',
+ (SELECT GROUP_CONCAT(f.title ORDER BY f.title SEPARATOR ', ')
+ FROM sakila.film f
+ INNER JOIN sakila.film_category fc
+ ON f.film_id = fc.film_id
+ INNER JOIN sakila.film_actor fa
+ ON f.film_id = fa.film_id
+ WHERE fc.category_id = c.category_id
+ AND fa.actor_id = a.actor_id
+ )
+ )
+ ORDER BY c.name SEPARATOR '; ')
+AS film_info
+FROM sakila.actor a
+LEFT JOIN sakila.film_actor fa
+ ON a.actor_id = fa.actor_id
+LEFT JOIN sakila.film_category fc
+ ON fa.film_id = fc.film_id
+LEFT JOIN sakila.category c
+ ON fc.category_id = c.category_id
+GROUP BY a.actor_id, a.first_name, a.last_name;
+
+DELIMITER $$
+
+CREATE FUNCTION get_customer_balance(p_customer_id INT, p_effective_date DATETIME) RETURNS DECIMAL(5,2)
+ DETERMINISTIC
+ READS SQL DATA
+BEGIN
+
+ #OK, WE NEED TO CALCULATE THE CURRENT BALANCE GIVEN A CUSTOMER_ID AND A DATE
+ #THAT WE WANT THE BALANCE TO BE EFFECTIVE FOR. THE BALANCE IS:
+ # 1) RENTAL FEES FOR ALL PREVIOUS RENTALS
+ # 2) ONE DOLLAR FOR EVERY DAY THE PREVIOUS RENTALS ARE OVERDUE
+ # 3) IF A FILM IS MORE THAN RENTAL_DURATION * 2 OVERDUE, CHARGE THE REPLACEMENT_COST
+ # 4) SUBTRACT ALL PAYMENTS MADE BEFORE THE DATE SPECIFIED
+
+ DECLARE v_rentfees DECIMAL(5,2); #FEES PAID TO RENT THE VIDEOS INITIALLY
+ DECLARE v_overfees INTEGER; #LATE FEES FOR PRIOR RENTALS
+ DECLARE v_payments DECIMAL(5,2); #SUM OF PAYMENTS MADE PREVIOUSLY
+
+ SELECT IFNULL(SUM(film.rental_rate),0) INTO v_rentfees
+ FROM film, inventory, rental
+ WHERE film.film_id = inventory.film_id
+ AND inventory.inventory_id = rental.inventory_id
+ AND rental.rental_date <= p_effective_date
+ AND rental.customer_id = p_customer_id;
+
+ SELECT IFNULL(SUM(IF((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) > film.rental_duration,
+ ((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) - film.rental_duration),0)),0) INTO v_overfees
+ FROM rental, inventory, film
+ WHERE film.film_id = inventory.film_id
+ AND inventory.inventory_id = rental.inventory_id
+ AND rental.rental_date <= p_effective_date
+ AND rental.customer_id = p_customer_id;
+
+
+ SELECT IFNULL(SUM(payment.amount),0) INTO v_payments
+ FROM payment
+
+ WHERE payment.payment_date <= p_effective_date
+ AND payment.customer_id = p_customer_id;
+
+ RETURN v_rentfees + v_overfees - v_payments;
+END $$
+
+DELIMITER ;
+
+DELIMITER $$
+
+CREATE FUNCTION inventory_in_stock(p_inventory_id INT) RETURNS BOOLEAN
+READS SQL DATA
+BEGIN
+ DECLARE v_rentals INT;
+ DECLARE v_out INT;
+
+ #AN ITEM IS IN-STOCK IF THERE ARE EITHER NO ROWS IN THE rental TABLE
+ #FOR THE ITEM OR ALL ROWS HAVE return_date POPULATED
+
+ SELECT COUNT(*) INTO v_rentals
+ FROM rental
+ WHERE inventory_id = p_inventory_id;
+
+ IF v_rentals = 0 THEN
+ RETURN TRUE;
+ END IF;
+
+ SELECT COUNT(rental_id) INTO v_out
+ FROM inventory LEFT JOIN rental USING(inventory_id)
+ WHERE inventory.inventory_id = p_inventory_id
+ AND rental.return_date IS NULL;
+
+ IF v_out > 0 THEN
+ RETURN FALSE;
+ ELSE
+ RETURN TRUE;
+ END IF;
+END $$
+
+DELIMITER ;
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/main.m b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/main.m
new file mode 100644
index 00000000000..9b0c5858094
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaTest/main.m
@@ -0,0 +1,15 @@
+/**
+ * main.m
+ * ScintillaTest
+ *
+ * Created by Mike Lischke on 02.04.09.
+ * Copyright Sun Microsystems, Inc 2009. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **) argv);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.h b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.h
new file mode 100644
index 00000000000..ec2c8ee14f2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.h
@@ -0,0 +1,204 @@
+
+/**
+ * Declaration of the native Cocoa View that serves as container for the scintilla parts.
+ *
+ * Created by Mike Lischke.
+ *
+ * Copyright 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2009, 2011 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import "Scintilla.h"
+#import "SciLexer.h"
+
+#import "InfoBarCommunicator.h"
+
+/**
+ * Scintilla sends these two messages to the notify handler. Please refer
+ * to the Windows API doc for details about the message format.
+ */
+#define WM_COMMAND 1001
+#define WM_NOTIFY 1002
+
+namespace Scintilla {
+/**
+ * On the Mac, there is no WM_COMMAND or WM_NOTIFY message that can be sent
+ * back to the parent. Therefore, there must be a callback handler that acts
+ * like a Windows WndProc, where Scintilla can send notifications to. Use
+ * ScintillaView registerNotifyCallback() to register such a handler.
+ * Message format is:
+ * <br>
+ * WM_COMMAND: HIWORD (wParam) = notification code, LOWORD (wParam) = control ID, lParam = ScintillaCocoa*
+ * <br>
+ * WM_NOTIFY: wParam = control ID, lParam = ptr to SCNotification structure, with hwndFrom set to ScintillaCocoa*
+ */
+typedef void(*SciNotifyFunc) (intptr_t windowid, unsigned int iMessage, uintptr_t wParam, uintptr_t lParam);
+
+class ScintillaCocoa;
+}
+
+@class ScintillaView;
+
+extern NSString *const SCIUpdateUINotification;
+
+@protocol ScintillaNotificationProtocol
+- (void)notification: (Scintilla::SCNotification*)notification;
+@end
+
+/**
+ * SCIMarginView draws line numbers and other margins next to the text view.
+ */
+@interface SCIMarginView : NSRulerView
+{
+@private
+ int marginWidth;
+ ScintillaView *owner;
+ NSMutableArray *currentCursors;
+}
+
+@property (assign) int marginWidth;
+@property (assign) ScintillaView *owner;
+
+- (id)initWithScrollView:(NSScrollView *)aScrollView;
+
+@end
+
+/**
+ * SCIContentView is the Cocoa interface to the Scintilla backend. It handles text input and
+ * provides a canvas for painting the output.
+ */
+@interface SCIContentView : NSView <
+ NSTextInputClient,
+ NSUserInterfaceValidations,
+ NSDraggingSource,
+ NSDraggingDestination>
+{
+@private
+ ScintillaView* mOwner;
+ NSCursor* mCurrentCursor;
+ NSTrackingArea *trackingArea;
+
+ // Set when we are in composition mode and partial input is displayed.
+ NSRange mMarkedTextRange;
+}
+
+@property (nonatomic, assign) ScintillaView* owner;
+
+- (void) setCursor: (int) cursor;
+
+- (BOOL) canUndo;
+- (BOOL) canRedo;
+
+@end
+
+@interface ScintillaView : NSView <InfoBarCommunicator, ScintillaNotificationProtocol>
+{
+@private
+ // The back end is kind of a controller and model in one.
+ // It uses the content view for display.
+ Scintilla::ScintillaCocoa* mBackend;
+
+ // This is the actual content to which the backend renders itself.
+ SCIContentView* mContent;
+
+ NSScrollView *scrollView;
+ SCIMarginView *marginView;
+
+ CGFloat zoomDelta;
+
+ // Area to display additional controls (e.g. zoom info, caret position, status info).
+ NSView <InfoBarCommunicator>* mInfoBar;
+ BOOL mInfoBarAtTop;
+
+ id<ScintillaNotificationProtocol> mDelegate;
+}
+
+@property (nonatomic, readonly) Scintilla::ScintillaCocoa* backend;
+@property (nonatomic, assign) id<ScintillaNotificationProtocol> delegate;
+@property (nonatomic, readonly) NSScrollView *scrollView;
+
++ (Class) contentViewClass;
+
+- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
+ value: (float) value;
+- (void) setCallback: (id <InfoBarCommunicator>) callback;
+
+- (void) suspendDrawing: (BOOL) suspend;
+- (void) notification: (Scintilla::SCNotification*) notification;
+
+// Scroller handling
+- (void) setMarginWidth: (int) width;
+- (SCIContentView*) content;
+- (void) updateMarginCursors;
+
+// NSTextView compatibility layer.
+- (NSString*) string;
+- (void) setString: (NSString*) aString;
+- (void) insertText: (id) aString;
+- (void) setEditable: (BOOL) editable;
+- (BOOL) isEditable;
+- (NSRange) selectedRange;
+
+- (NSString*) selectedString;
+
+- (void) deleteRange: (NSRange) range;
+
+- (void)setFontName: (NSString*) font
+ size: (int) size
+ bold: (BOOL) bold
+ italic: (BOOL) italic;
+
+// Native call through to the backend.
++ (sptr_t) directCall: (ScintillaView*) sender message: (unsigned int) message wParam: (uptr_t) wParam
+ lParam: (sptr_t) lParam;
+- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam;
+- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam;
+- (sptr_t) message: (unsigned int) message;
+
+// Back end properties getters and setters.
+- (void) setGeneralProperty: (int) property parameter: (long) parameter value: (long) value;
+- (void) setGeneralProperty: (int) property value: (long) value;
+
+- (long) getGeneralProperty: (int) property;
+- (long) getGeneralProperty: (int) property parameter: (long) parameter;
+- (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra;
+- (long) getGeneralProperty: (int) property ref: (const void*) ref;
+- (void) setColorProperty: (int) property parameter: (long) parameter value: (NSColor*) value;
+- (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString*) fromHTML;
+- (NSColor*) getColorProperty: (int) property parameter: (long) parameter;
+- (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void*) value;
+- (const void*) getReferenceProperty: (int) property parameter: (long) parameter;
+- (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString*) value;
+- (NSString*) getStringProperty: (int) property parameter: (long) parameter;
+- (void) setLexerProperty: (NSString*) name value: (NSString*) value;
+- (NSString*) getLexerProperty: (NSString*) name;
+
+// The delegate property should be used instead of registerNotifyCallback which is deprecated.
+- (void) registerNotifyCallback: (intptr_t) windowid value: (Scintilla::SciNotifyFunc) callback __attribute__((deprecated));
+
+- (void) setInfoBar: (NSView <InfoBarCommunicator>*) aView top: (BOOL) top;
+- (void) setStatusText: (NSString*) text;
+
+- (BOOL) findAndHighlightText: (NSString*) searchText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ scrollTo: (BOOL) scrollTo
+ wrap: (BOOL) wrap;
+
+- (BOOL) findAndHighlightText: (NSString*) searchText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ scrollTo: (BOOL) scrollTo
+ wrap: (BOOL) wrap
+ backwards: (BOOL) backwards;
+
+- (int) findAndReplaceText: (NSString*) searchText
+ byText: (NSString*) newText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ doAll: (BOOL) doAll;
+
+@end
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.mm b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.mm
new file mode 100644
index 00000000000..13dd1d4f937
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/ScintillaView.mm
@@ -0,0 +1,1963 @@
+
+/**
+ * Implementation of the native Cocoa View that serves as container for the scintilla parts.
+ *
+ * Created by Mike Lischke.
+ *
+ * Copyright 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2009, 2011 Sun Microsystems, Inc. All rights reserved.
+ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
+ */
+
+#import "Platform.h"
+#import "ScintillaView.h"
+#import "ScintillaCocoa.h"
+
+using namespace Scintilla;
+
+// Two additional cursors we need, which aren't provided by Cocoa.
+static NSCursor* reverseArrowCursor;
+static NSCursor* waitCursor;
+
+NSString *const SCIUpdateUINotification = @"SCIUpdateUI";
+
+/**
+ * Provide an NSCursor object that matches the Window::Cursor enumeration.
+ */
+static NSCursor *cursorFromEnum(Window::Cursor cursor)
+{
+ switch (cursor)
+ {
+ case Window::cursorText:
+ return [NSCursor IBeamCursor];
+ case Window::cursorArrow:
+ return [NSCursor arrowCursor];
+ case Window::cursorWait:
+ return waitCursor;
+ case Window::cursorHoriz:
+ return [NSCursor resizeLeftRightCursor];
+ case Window::cursorVert:
+ return [NSCursor resizeUpDownCursor];
+ case Window::cursorReverseArrow:
+ return reverseArrowCursor;
+ case Window::cursorUp:
+ default:
+ return [NSCursor arrowCursor];
+ }
+}
+
+
+@implementation SCIMarginView
+
+@synthesize marginWidth, owner;
+
+- (id)initWithScrollView:(NSScrollView *)aScrollView
+{
+ self = [super initWithScrollView:aScrollView orientation:NSVerticalRuler];
+ if (self != nil)
+ {
+ owner = nil;
+ marginWidth = 20;
+ currentCursors = [[NSMutableArray arrayWithCapacity:0] retain];
+ for (size_t i=0; i<=SC_MAX_MARGIN; i++)
+ {
+ [currentCursors addObject: [reverseArrowCursor retain]];
+ }
+ [self setClientView:[aScrollView documentView]];
+ }
+ return self;
+}
+
+- (void) dealloc
+{
+ [currentCursors release];
+ [super dealloc];
+}
+
+- (void) setFrame: (NSRect) frame
+{
+ [super setFrame: frame];
+
+ [[self window] invalidateCursorRectsForView: self];
+}
+
+- (CGFloat)requiredThickness
+{
+ return marginWidth;
+}
+
+- (void)drawHashMarksAndLabelsInRect:(NSRect)aRect
+{
+ if (owner) {
+ NSRect contentRect = [[[self scrollView] contentView] bounds];
+ NSRect marginRect = [self bounds];
+ // Ensure paint to bottom of view to avoid glitches
+ if (marginRect.size.height > contentRect.size.height) {
+ // Legacy scroll bar mode leaves a poorly painted corner
+ aRect = marginRect;
+ }
+ owner.backend->PaintMargin(aRect);
+ }
+}
+
+- (void) mouseDown: (NSEvent *) theEvent
+{
+ NSClipView *textView = [[self scrollView] contentView];
+ [[textView window] makeFirstResponder:textView];
+ owner.backend->MouseDown(theEvent);
+}
+
+- (void) mouseDragged: (NSEvent *) theEvent
+{
+ owner.backend->MouseMove(theEvent);
+}
+
+- (void) mouseMoved: (NSEvent *) theEvent
+{
+ owner.backend->MouseMove(theEvent);
+}
+
+- (void) mouseUp: (NSEvent *) theEvent
+{
+ owner.backend->MouseUp(theEvent);
+}
+
+/**
+ * This method is called to give us the opportunity to define our mouse sensitive rectangle.
+ */
+- (void) resetCursorRects
+{
+ [super resetCursorRects];
+
+ int x = 0;
+ NSRect marginRect = [self bounds];
+ size_t co = [currentCursors count];
+ for (size_t i=0; i<co; i++)
+ {
+ long cursType = owner.backend->WndProc(SCI_GETMARGINCURSORN, i, 0);
+ long width =owner.backend->WndProc(SCI_GETMARGINWIDTHN, i, 0);
+ NSCursor *cc = cursorFromEnum(static_cast<Window::Cursor>(cursType));
+ [currentCursors replaceObjectAtIndex:i withObject: cc];
+ marginRect.origin.x = x;
+ marginRect.size.width = width;
+ [self addCursorRect: marginRect cursor: cc];
+ [cc setOnMouseEntered: YES];
+ x += width;
+ }
+}
+
+@end
+
+@implementation SCIContentView
+
+@synthesize owner = mOwner;
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSView*) initWithFrame: (NSRect) frame
+{
+ self = [super initWithFrame: frame];
+
+ if (self != nil)
+ {
+ // Some initialization for our view.
+ mCurrentCursor = [[NSCursor arrowCursor] retain];
+ trackingArea = nil;
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+
+ [self registerForDraggedTypes: [NSArray arrayWithObjects:
+ NSStringPboardType, ScintillaRecPboardType, NSFilenamesPboardType, nil]];
+ }
+
+ return self;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * When the view is resized or scrolled we need to update our tracking area.
+ */
+- (void) updateTrackingAreas
+{
+ if (trackingArea)
+ [self removeTrackingArea:trackingArea];
+
+ int opts = (NSTrackingActiveAlways | NSTrackingInVisibleRect | NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved);
+ trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds]
+ options:opts
+ owner:self
+ userInfo:nil];
+ [self addTrackingArea: trackingArea];
+ [super updateTrackingAreas];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * When the view is resized we need to let the backend know.
+ */
+- (void) setFrame: (NSRect) frame
+{
+ [super setFrame: frame];
+
+ mOwner.backend->Resize();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by the backend if a new cursor must be set for the view.
+ */
+- (void) setCursor: (int) cursor
+{
+ Window::Cursor eCursor = (Window::Cursor)cursor;
+ [mCurrentCursor autorelease];
+ mCurrentCursor = cursorFromEnum(eCursor);
+ [mCurrentCursor retain];
+
+ // Trigger recreation of the cursor rectangle(s).
+ [[self window] invalidateCursorRectsForView: self];
+ [mOwner updateMarginCursors];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * This method is called to give us the opportunity to define our mouse sensitive rectangle.
+ */
+- (void) resetCursorRects
+{
+ [super resetCursorRects];
+
+ // We only have one cursor rect: our bounds.
+ [self addCursorRect: [self bounds] cursor: mCurrentCursor];
+ [mCurrentCursor setOnMouseEntered: YES];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called before repainting.
+ */
+- (void) viewWillDraw
+{
+ const NSRect *rects;
+ NSInteger nRects = 0;
+ [self getRectsBeingDrawn:&rects count:&nRects];
+ if (nRects > 0) {
+ NSRect rectUnion = rects[0];
+ for (int i=0;i<nRects;i++) {
+ rectUnion = NSUnionRect(rectUnion, rects[i]);
+ }
+ mOwner.backend->WillDraw(rectUnion);
+ }
+ [super viewWillDraw];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called before responsive scrolling overdraw.
+ */
+- (void) prepareContentInRect: (NSRect) rect
+{
+ mOwner.backend->WillDraw(rect);
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080
+ [super prepareContentInRect: rect];
+#endif
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Gets called by the runtime when the view needs repainting.
+ */
+- (void) drawRect: (NSRect) rect
+{
+ CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
+
+ if (!mOwner.backend->Draw(rect, context)) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setNeedsDisplay:YES];
+ });
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Windows uses a client coordinate system where the upper left corner is the origin in a window
+ * (and so does Scintilla). We have to adjust for that. However by returning YES here, we are
+ * already done with that.
+ * Note that because of returning YES here most coordinates we use now (e.g. for painting,
+ * invalidating rectangles etc.) are given with +Y pointing down!
+ */
+- (BOOL) isFlipped
+{
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) isOpaque
+{
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Implement the "click through" behavior by telling the caller we accept the first mouse event too.
+ */
+- (BOOL) acceptsFirstMouse: (NSEvent *) theEvent
+{
+#pragma unused(theEvent)
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Make this view accepting events as first responder.
+ */
+- (BOOL) acceptsFirstResponder
+{
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by the framework if it wants to show a context menu for the editor.
+ */
+- (NSMenu*) menuForEvent: (NSEvent*) theEvent
+{
+ if (![mOwner respondsToSelector: @selector(menuForEvent:)])
+ return mOwner.backend->CreateContextMenu(theEvent);
+ else
+ return [mOwner menuForEvent: theEvent];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// Adoption of NSTextInputClient protocol.
+
+- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
+{
+ const NSRange posRange = mOwner.backend->PositionsFromCharacters(aRange);
+ // The backend validated aRange and may have removed characters beyond the end of the document.
+ const NSRange charRange = mOwner.backend->CharactersFromPositions(posRange);
+ if (!NSEqualRanges(aRange, charRange))
+ {
+ *actualRange = charRange;
+ }
+
+ [mOwner message: SCI_SETTARGETRANGE wParam: posRange.location lParam: NSMaxRange(posRange)];
+ std::string text([mOwner message: SCI_TARGETASUTF8] + 1, 0);
+ [mOwner message: SCI_TARGETASUTF8 wParam: 0 lParam: reinterpret_cast<sptr_t>(&text[0])];
+ NSString *result = [NSString stringWithUTF8String: text.c_str()];
+ NSMutableAttributedString *asResult = [[[NSMutableAttributedString alloc] initWithString:result] autorelease];
+
+ const NSRange rangeAS = NSMakeRange(0, [asResult length]);
+ const long style = [mOwner message: SCI_GETSTYLEAT wParam:posRange.location];
+ std::string fontName([mOwner message: SCI_STYLEGETFONT wParam:style lParam:0] + 1, 0);
+ [mOwner message: SCI_STYLEGETFONT wParam:style lParam:(sptr_t)&fontName[0]];
+ const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam:style] / 100.0f;
+ NSString *sFontName = [NSString stringWithUTF8String: fontName.c_str()];
+ NSFont *font = [NSFont fontWithName:sFontName size:fontSize];
+ [asResult addAttribute:NSFontAttributeName value:font range:rangeAS];
+
+ return asResult;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSUInteger) characterIndexForPoint: (NSPoint) point
+{
+ const NSRect rectPoint = {point, NSZeroSize};
+ const NSRect rectInWindow = [self.window convertRectFromScreen:rectPoint];
+ const NSRect rectLocal = [[[self superview] superview] convertRect:rectInWindow fromView:nil];
+
+ const long position = [mOwner message: SCI_CHARPOSITIONFROMPOINT
+ wParam: rectLocal.origin.x
+ lParam: rectLocal.origin.y];
+ if (position == INVALID_POSITION)
+ {
+ return NSNotFound;
+ }
+ else
+ {
+ const NSRange index = mOwner.backend->CharactersFromPositions(NSMakeRange(position, 0));
+ return index.location;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) doCommandBySelector: (SEL) selector
+{
+ if ([self respondsToSelector: @selector(selector)])
+ [self performSelector: selector withObject: nil];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSRect) firstRectForCharacterRange: (NSRange) aRange actualRange: (NSRangePointer) actualRange
+{
+ const NSRange posRange = mOwner.backend->PositionsFromCharacters(aRange);
+
+ NSRect rect;
+ rect.origin.x = [mOwner message: SCI_POINTXFROMPOSITION wParam: 0 lParam: posRange.location];
+ rect.origin.y = [mOwner message: SCI_POINTYFROMPOSITION wParam: 0 lParam: posRange.location];
+ const NSUInteger rangeEnd = NSMaxRange(posRange);
+ rect.size.width = [mOwner message: SCI_POINTXFROMPOSITION wParam: 0 lParam: rangeEnd] - rect.origin.x;
+ rect.size.height = [mOwner message: SCI_POINTYFROMPOSITION wParam: 0 lParam: rangeEnd] - rect.origin.y;
+ rect.size.height += [mOwner message: SCI_TEXTHEIGHT wParam: 0 lParam: 0];
+ const NSRect rectInWindow = [[[self superview] superview] convertRect:rect toView:nil];
+ const NSRect rectScreen = [self.window convertRectToScreen:rectInWindow];
+
+ return rectScreen;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) hasMarkedText
+{
+ return mMarkedTextRange.length > 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * General text input. Used to insert new text at the current input position, replacing the current
+ * selection if there is any.
+ * First removes the replacementRange.
+ */
+- (void) insertText: (id) aString replacementRange: (NSRange) replacementRange
+{
+ if ((mMarkedTextRange.location != NSNotFound) && (replacementRange.location != NSNotFound))
+ {
+ NSLog(@"Trying to insertText when there is both a marked range and a replacement range");
+ }
+
+ // Remove any previously marked text first.
+ mOwner.backend->CompositionUndo();
+ if (mMarkedTextRange.location != NSNotFound)
+ {
+ const NSRange posRangeMark = mOwner.backend->PositionsFromCharacters(mMarkedTextRange);
+ [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeMark.location];
+ }
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+
+ if (replacementRange.location == (NSNotFound-1))
+ // This occurs when the accent popup is visible and menu selected.
+ // Its replacing a non-existent position so do nothing.
+ return;
+
+ if (replacementRange.location != NSNotFound)
+ {
+ const NSRange posRangeReplacement = mOwner.backend->PositionsFromCharacters(replacementRange);
+ [mOwner message: SCI_DELETERANGE
+ wParam: posRangeReplacement.location
+ lParam: posRangeReplacement.length];
+ [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeReplacement.location];
+ }
+
+ NSString* newText = @"";
+ if ([aString isKindOfClass:[NSString class]])
+ newText = (NSString*) aString;
+ else if ([aString isKindOfClass:[NSAttributedString class]])
+ newText = (NSString*) [aString string];
+
+ mOwner.backend->InsertText(newText);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSRange) markedRange
+{
+ return mMarkedTextRange;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSRange) selectedRange
+{
+ const long positionBegin = [mOwner message: SCI_GETSELECTIONSTART];
+ const long positionEnd = [mOwner message: SCI_GETSELECTIONEND];
+ NSRange posRangeSel = NSMakeRange(positionBegin, positionEnd-positionBegin);
+ return mOwner.backend->CharactersFromPositions(posRangeSel);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by the input manager to set text which might be combined with further input to form
+ * the final text (e.g. composition of ^ and a to â).
+ *
+ * @param aString The text to insert, either what has been marked already or what is selected already
+ * or simply added at the current insertion point. Depending on what is available.
+ * @param range The range of the new text to select (given relative to the insertion point of the new text).
+ * @param replacementRange The range to remove before insertion.
+ */
+- (void) setMarkedText: (id) aString selectedRange: (NSRange)range replacementRange: (NSRange)replacementRange
+{
+ NSString* newText = @"";
+ if ([aString isKindOfClass:[NSString class]])
+ newText = (NSString*) aString;
+ else
+ if ([aString isKindOfClass:[NSAttributedString class]])
+ newText = (NSString*) [aString string];
+
+ // Replace marked text if there is one.
+ if (mMarkedTextRange.length > 0)
+ {
+ mOwner.backend->CompositionUndo();
+ if (replacementRange.location != NSNotFound)
+ {
+ // This situation makes no sense and has not occurred in practice.
+ NSLog(@"Can not handle a replacement range when there is also a marked range");
+ }
+ else
+ {
+ replacementRange = mMarkedTextRange;
+ const NSRange posRangeMark = mOwner.backend->PositionsFromCharacters(mMarkedTextRange);
+ [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeMark.location];
+ }
+ }
+ else
+ {
+ // Must perform deletion before entering composition mode or else
+ // both document and undo history will not contain the deleted text
+ // leading to an inaccurate and unusable undo history.
+
+ // Convert selection virtual space into real space
+ mOwner.backend->ConvertSelectionVirtualSpace();
+
+ if (replacementRange.location != NSNotFound)
+ {
+ const NSRange posRangeReplacement = mOwner.backend->PositionsFromCharacters(replacementRange);
+ [mOwner message: SCI_DELETERANGE
+ wParam: posRangeReplacement.location
+ lParam: posRangeReplacement.length];
+ }
+ else // No marked or replacement range, so replace selection
+ {
+ if (!mOwner.backend->ScintillaCocoa::ClearAllSelections()) {
+ // Some of the selection is protected so can not perform composition here
+ return;
+ }
+ // Ensure only a single selection.
+ mOwner.backend->SelectOnlyMainSelection();
+ replacementRange = [self selectedRange];
+ }
+ }
+
+ // To support IME input to multiple selections, the following code would
+ // need to insert newText at each selection, mark each piece of new text and then
+ // select range relative to each insertion.
+
+ if ([newText length])
+ {
+ // Switching into composition.
+ mOwner.backend->CompositionStart();
+
+ NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0));
+ // Note: Scintilla internally works almost always with bytes instead chars, so we need to take
+ // this into account when determining selection ranges and such.
+ int lengthInserted = mOwner.backend->InsertText(newText);
+ posRangeCurrent.length = lengthInserted;
+ mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent);
+ // Mark the just inserted text. Keep the marked range for later reset.
+ [mOwner setGeneralProperty: SCI_SETINDICATORCURRENT value: INDIC_IME];
+ [mOwner setGeneralProperty: SCI_INDICATORFILLRANGE
+ parameter: posRangeCurrent.location
+ value: posRangeCurrent.length];
+ }
+ else
+ {
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+ // Re-enable undo action collection if composition ended (indicated by an empty mark string).
+ mOwner.backend->CompositionCommit();
+ }
+
+ // Select the part which is indicated in the given range. It does not scroll the caret into view.
+ if (range.length > 0)
+ {
+ // range is in characters so convert to bytes for selection.
+ range.location += replacementRange.location;
+ NSRange posRangeSelect = mOwner.backend->PositionsFromCharacters(range);
+ [mOwner setGeneralProperty: SCI_SETSELECTION parameter: NSMaxRange(posRangeSelect) value: posRangeSelect.location];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) unmarkText
+{
+ if (mMarkedTextRange.length > 0)
+ {
+ mOwner.backend->CompositionCommit();
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSArray*) validAttributesForMarkedText
+{
+ return nil;
+}
+
+// End of the NSTextInputClient protocol adoption.
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Generic input method. It is used to pass on keyboard input to Scintilla. The control itself only
+ * handles shortcuts. The input is then forwarded to the Cocoa text input system, which in turn does
+ * its own input handling (character composition via NSTextInputClient protocol):
+ */
+- (void) keyDown: (NSEvent *) theEvent
+{
+ if (mMarkedTextRange.length == 0)
+ mOwner.backend->KeyboardInput(theEvent);
+ NSArray* events = [NSArray arrayWithObject: theEvent];
+ [self interpretKeyEvents: events];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseDown: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseDown(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseDragged: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseMove(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseUp: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseUp(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseMoved: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseMove(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseEntered: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseEntered(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) mouseExited: (NSEvent *) theEvent
+{
+ mOwner.backend->MouseExited(theEvent);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Mouse wheel with command key magnifies text.
+ * Enabling this code causes visual garbage to appear when scrolling
+ * horizontally on OS X 10.9 with a retina display.
+ * Pinch gestures and key commands can be used for magnification.
+ */
+#ifdef SCROLL_WHEEL_MAGNIFICATION
+- (void) scrollWheel: (NSEvent *) theEvent
+{
+ if (([theEvent modifierFlags] & NSCommandKeyMask) != 0) {
+ mOwner.backend->MouseWheel(theEvent);
+ } else {
+ [super scrollWheel:theEvent];
+ }
+}
+#endif
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Ensure scrolling is aligned to whole lines instead of starting part-way through a line
+ */
+- (NSRect)adjustScroll:(NSRect)proposedVisibleRect
+{
+ NSRect rc = proposedVisibleRect;
+ // Snap to lines
+ NSRect contentRect = [self bounds];
+ if ((rc.origin.y > 0) && (NSMaxY(rc) < contentRect.size.height)) {
+ // Only snap for positions inside the document - allow outside
+ // for overshoot.
+ long lineHeight = mOwner.backend->WndProc(SCI_TEXTHEIGHT, 0, 0);
+ rc.origin.y = roundf(static_cast<XYPOSITION>(rc.origin.y) / lineHeight) * lineHeight;
+ }
+ return rc;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * The editor is getting the foreground control (the one getting the input focus).
+ */
+- (BOOL) becomeFirstResponder
+{
+ mOwner.backend->WndProc(SCI_SETFOCUS, 1, 0);
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * The editor is losing the input focus.
+ */
+- (BOOL) resignFirstResponder
+{
+ mOwner.backend->WndProc(SCI_SETFOCUS, 0, 0);
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Implement NSDraggingSource.
+ */
+
+- (NSDragOperation)draggingSession: (NSDraggingSession *) session
+sourceOperationMaskForDraggingContext: (NSDraggingContext) context
+{
+ switch(context)
+ {
+ case NSDraggingContextOutsideApplication:
+ return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete;
+
+ case NSDraggingContextWithinApplication:
+ default:
+ return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete;
+ }
+}
+
+- (void)draggingSession:(NSDraggingSession *)session
+ movedToPoint:(NSPoint)screenPoint
+{
+}
+
+- (void)draggingSession:(NSDraggingSession *)session
+ endedAtPoint:(NSPoint)screenPoint
+ operation:(NSDragOperation)operation
+{
+ if (operation == NSDragOperationDelete)
+ {
+ mOwner.backend->WndProc(SCI_CLEAR, 0, 0);
+ }
+}
+
+/**
+ * Implement NSDraggingDestination.
+ */
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called when an external drag operation enters the view.
+ */
+- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender
+{
+ return mOwner.backend->DraggingEntered(sender);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called frequently during an external drag operation if we are the target.
+ */
+- (NSDragOperation) draggingUpdated: (id <NSDraggingInfo>) sender
+{
+ return mOwner.backend->DraggingUpdated(sender);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Drag image left the view. Clean up if necessary.
+ */
+- (void) draggingExited: (id <NSDraggingInfo>) sender
+{
+ mOwner.backend->DraggingExited(sender);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) prepareForDragOperation: (id <NSDraggingInfo>) sender
+{
+#pragma unused(sender)
+ return YES;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) performDragOperation: (id <NSDraggingInfo>) sender
+{
+ return mOwner.backend->PerformDragOperation(sender);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Drag operation is done. Notify editor.
+ */
+- (void) concludeDragOperation: (id <NSDraggingInfo>) sender
+{
+ // Clean up is the same as if we are no longer the drag target.
+ mOwner.backend->DraggingExited(sender);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// NSResponder actions.
+
+- (void) selectAll: (id) sender
+{
+#pragma unused(sender)
+ mOwner.backend->SelectAll();
+}
+
+- (void) deleteBackward: (id) sender
+{
+#pragma unused(sender)
+ mOwner.backend->DeleteBackward();
+}
+
+- (void) cut: (id) sender
+{
+#pragma unused(sender)
+ mOwner.backend->Cut();
+}
+
+- (void) copy: (id) sender
+{
+#pragma unused(sender)
+ mOwner.backend->Copy();
+}
+
+- (void) paste: (id) sender
+{
+#pragma unused(sender)
+ if (mMarkedTextRange.location != NSNotFound)
+ {
+ [[NSTextInputContext currentInputContext] discardMarkedText];
+ mOwner.backend->CompositionCommit();
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+ }
+ mOwner.backend->Paste();
+}
+
+- (void) undo: (id) sender
+{
+#pragma unused(sender)
+ if (mMarkedTextRange.location != NSNotFound)
+ {
+ [[NSTextInputContext currentInputContext] discardMarkedText];
+ mOwner.backend->CompositionCommit();
+ mMarkedTextRange = NSMakeRange(NSNotFound, 0);
+ }
+ mOwner.backend->Undo();
+}
+
+- (void) redo: (id) sender
+{
+#pragma unused(sender)
+ mOwner.backend->Redo();
+}
+
+- (BOOL) canUndo
+{
+ return mOwner.backend->CanUndo() && (mMarkedTextRange.location == NSNotFound);
+}
+
+- (BOOL) canRedo
+{
+ return mOwner.backend->CanRedo();
+}
+
+- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>) anItem
+{
+ SEL action = [anItem action];
+ if (action==@selector(undo:)) {
+ return [self canUndo];
+ }
+ else if (action==@selector(redo:)) {
+ return [self canRedo];
+ }
+ else if (action==@selector(cut:) || action==@selector(copy:) || action==@selector(clear:)) {
+ return mOwner.backend->HasSelection();
+ }
+ else if (action==@selector(paste:)) {
+ return mOwner.backend->CanPaste();
+ }
+ return YES;
+}
+
+- (void) clear: (id) sender
+{
+ [self deleteBackward:sender];
+}
+
+- (BOOL) isEditable
+{
+ return mOwner.backend->WndProc(SCI_GETREADONLY, 0, 0) == 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) dealloc
+{
+ [mCurrentCursor release];
+ [super dealloc];
+}
+
+@end
+
+//--------------------------------------------------------------------------------------------------
+
+@implementation ScintillaView
+
+@synthesize backend = mBackend;
+@synthesize delegate = mDelegate;
+@synthesize scrollView;
+
+/**
+ * ScintillaView is a composite control made from an NSView and an embedded NSView that is
+ * used as canvas for the output (by the backend, using its CGContext), plus other elements
+ * (scrollers, info bar).
+ */
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Initialize custom cursor.
+ */
++ (void) initialize
+{
+ if (self == [ScintillaView class])
+ {
+ NSBundle* bundle = [NSBundle bundleForClass: [ScintillaView class]];
+
+ NSString* path = [bundle pathForResource: @"mac_cursor_busy" ofType: @"tiff" inDirectory: nil];
+ NSImage* image = [[[NSImage alloc] initWithContentsOfFile: path] autorelease];
+ waitCursor = [[NSCursor alloc] initWithImage: image hotSpot: NSMakePoint(2, 2)];
+
+ path = [bundle pathForResource: @"mac_cursor_flipped" ofType: @"tiff" inDirectory: nil];
+ image = [[[NSImage alloc] initWithContentsOfFile: path] autorelease];
+ reverseArrowCursor = [[NSCursor alloc] initWithImage: image hotSpot: NSMakePoint(12, 2)];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specify the SCIContentView class. Can be overridden in a subclass to provide an SCIContentView subclass.
+ */
+
++ (Class) contentViewClass
+{
+ return [SCIContentView class];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Receives zoom messages, for example when a "pinch zoom" is performed on the trackpad.
+ */
+- (void) magnifyWithEvent: (NSEvent *) event
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
+ zoomDelta += event.magnification * 10.0;
+
+ if (fabs(zoomDelta)>=1.0) {
+ long zoomFactor = static_cast<long>([self getGeneralProperty: SCI_GETZOOM] + zoomDelta);
+ [self setGeneralProperty: SCI_SETZOOM parameter: zoomFactor value:0];
+ zoomDelta = 0.0;
+ }
+#endif
+}
+
+- (void) beginGestureWithEvent: (NSEvent *) event
+{
+// Scintilla is only interested in this event as the starft of a zoom
+#pragma unused(event)
+ zoomDelta = 0.0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Sends a new notification of the given type to the default notification center.
+ */
+- (void) sendNotification: (NSString*) notificationName
+{
+ NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+ [center postNotificationName: notificationName object: self];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Called by a connected component (usually the info bar) if something changed there.
+ *
+ * @param type The type of the notification.
+ * @param message Carries the new status message if the type is a status message change.
+ * @param location Carries the new location (e.g. caret) if the type is a caret change or similar type.
+ * @param value Carries the new zoom value if the type is a zoom change.
+ */
+- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
+ value: (float) value
+{
+// These parameters are just to conform to the protocol
+#pragma unused(message)
+#pragma unused(location)
+ switch (type)
+ {
+ case IBNZoomChanged:
+ {
+ // Compute point increase/decrease based on default font size.
+ long fontSize = [self getGeneralProperty: SCI_STYLEGETSIZE parameter: STYLE_DEFAULT];
+ int zoom = (int) (fontSize * (value - 1));
+ [self setGeneralProperty: SCI_SETZOOM value: zoom];
+ break;
+ }
+ default:
+ break;
+ };
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) setCallback: (id <InfoBarCommunicator>) callback
+{
+// Not used. Only here to satisfy protocol.
+#pragma unused(callback)
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Prevents drawing of the inner view to avoid flickering when doing many visual updates
+ * (like clearing all marks and setting new ones etc.).
+ */
+- (void) suspendDrawing: (BOOL) suspend
+{
+ if (suspend)
+ [[self window] disableFlushWindow];
+ else
+ [[self window] enableFlushWindow];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Method receives notifications from Scintilla (e.g. for handling clicks on the
+ * folder margin or changes in the editor).
+ * A delegate can be set to receive all notifications. If set no handling takes place here, except
+ * for action pertaining to internal stuff (like the info bar).
+ */
+- (void) notification: (Scintilla::SCNotification*)scn
+{
+ // Parent notification. Details are passed as SCNotification structure.
+
+ if (mDelegate != nil)
+ {
+ [mDelegate notification: scn];
+ if (scn->nmhdr.code != SCN_ZOOM && scn->nmhdr.code != SCN_UPDATEUI)
+ return;
+ }
+
+ switch (scn->nmhdr.code)
+ {
+ case SCN_MARGINCLICK:
+ {
+ if (scn->margin == 2)
+ {
+ // Click on the folder margin. Toggle the current line if possible.
+ long line = [self getGeneralProperty: SCI_LINEFROMPOSITION parameter: scn->position];
+ [self setGeneralProperty: SCI_TOGGLEFOLD value: line];
+ }
+ break;
+ };
+ case SCN_MODIFIED:
+ {
+ // Decide depending on the modification type what to do.
+ // There can be more than one modification carried by one notification.
+ if (scn->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT))
+ [self sendNotification: NSTextDidChangeNotification];
+ break;
+ }
+ case SCN_ZOOM:
+ {
+ // A zoom change happened. Notify info bar if there is one.
+ float zoom = [self getGeneralProperty: SCI_GETZOOM parameter: 0];
+ long fontSize = [self getGeneralProperty: SCI_STYLEGETSIZE parameter: STYLE_DEFAULT];
+ float factor = (zoom / fontSize) + 1;
+ [mInfoBar notify: IBNZoomChanged message: nil location: NSZeroPoint value: factor];
+ break;
+ }
+ case SCN_UPDATEUI:
+ {
+ // Triggered whenever changes in the UI state need to be reflected.
+ // These can be: caret changes, selection changes etc.
+ NSPoint caretPosition = mBackend->GetCaretPosition();
+ [mInfoBar notify: IBNCaretChanged message: nil location: caretPosition value: 0];
+ [self sendNotification: SCIUpdateUINotification];
+ if (scn->updated & (SC_UPDATE_SELECTION | SC_UPDATE_CONTENT))
+ {
+ [self sendNotification: NSTextViewDidChangeSelectionNotification];
+ }
+ break;
+ }
+ case SCN_FOCUSOUT:
+ [self sendNotification: NSTextDidEndEditingNotification];
+ break;
+ case SCN_FOCUSIN: // Nothing to do for now.
+ break;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Initialization of the view. Used to setup a few other things we need.
+ */
+- (id) initWithFrame: (NSRect) frame
+{
+ self = [super initWithFrame:frame];
+ if (self)
+ {
+ mContent = [[[[[self class] contentViewClass] alloc] initWithFrame:NSZeroRect] autorelease];
+ mContent.owner = self;
+
+ // Initialize the scrollers but don't show them yet.
+ // Pick an arbitrary size, just to make NSScroller selecting the proper scroller direction
+ // (horizontal or vertical).
+ NSRect scrollerRect = NSMakeRect(0, 0, 100, 10);
+ scrollView = [[[NSScrollView alloc] initWithFrame: scrollerRect] autorelease];
+ [scrollView setDocumentView: mContent];
+ [scrollView setHasVerticalScroller:YES];
+ [scrollView setHasHorizontalScroller:YES];
+ [scrollView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
+ //[scrollView setScrollerStyle:NSScrollerStyleLegacy];
+ //[scrollView setScrollerKnobStyle:NSScrollerKnobStyleDark];
+ //[scrollView setHorizontalScrollElasticity:NSScrollElasticityNone];
+ [self addSubview: scrollView];
+
+ marginView = [[SCIMarginView alloc] initWithScrollView:scrollView];
+ marginView.owner = self;
+ [marginView setRuleThickness:[marginView requiredThickness]];
+ [scrollView setVerticalRulerView:marginView];
+ [scrollView setHasHorizontalRuler:NO];
+ [scrollView setHasVerticalRuler:YES];
+ [scrollView setRulersVisible:YES];
+
+ mBackend = new ScintillaCocoa(mContent, marginView);
+
+ // Establish a connection from the back end to this container so we can handle situations
+ // which require our attention.
+ mBackend->SetDelegate(self);
+
+ // Setup a special indicator used in the editor to provide visual feedback for
+ // input composition, depending on language, keyboard etc.
+ [self setColorProperty: SCI_INDICSETFORE parameter: INDIC_IME fromHTML: @"#FF0000"];
+ [self setGeneralProperty: SCI_INDICSETUNDER parameter: INDIC_IME value: 1];
+ [self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDIC_IME value: INDIC_PLAIN];
+ [self setGeneralProperty: SCI_INDICSETALPHA parameter: INDIC_IME value: 100];
+
+ NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+ [center addObserver:self
+ selector:@selector(applicationDidResignActive:)
+ name:NSApplicationDidResignActiveNotification
+ object:nil];
+
+ [center addObserver:self
+ selector:@selector(applicationDidBecomeActive:)
+ name:NSApplicationDidBecomeActiveNotification
+ object:nil];
+
+ [[scrollView contentView] setPostsBoundsChangedNotifications:YES];
+ [center addObserver:self
+ selector:@selector(scrollerAction:)
+ name:NSViewBoundsDidChangeNotification
+ object:[scrollView contentView]];
+ }
+ return self;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ delete mBackend;
+ [marginView release];
+ [super dealloc];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) applicationDidResignActive: (NSNotification *)note {
+#pragma unused(note)
+ mBackend->ActiveStateChanged(false);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) applicationDidBecomeActive: (NSNotification *)note {
+#pragma unused(note)
+ mBackend->ActiveStateChanged(true);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) viewDidMoveToWindow
+{
+ [super viewDidMoveToWindow];
+
+ [self positionSubViews];
+
+ // Enable also mouse move events for our window (and so this view).
+ [[self window] setAcceptsMouseMovedEvents: YES];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to position and size the parts of the editor (content, scrollers, info bar).
+ */
+- (void) positionSubViews
+{
+ CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize
+ scrollerStyle:NSScrollerStyleLegacy];
+
+ NSSize size = [self frame].size;
+ NSRect barFrame = {{0, size.height - scrollerWidth}, {size.width, scrollerWidth}};
+ BOOL infoBarVisible = mInfoBar != nil && ![mInfoBar isHidden];
+
+ // Horizontal offset of the content. Almost always 0 unless the vertical scroller
+ // is on the left side.
+ CGFloat contentX = 0;
+ NSRect scrollRect = {{contentX, 0}, {size.width, size.height}};
+
+ // Info bar frame.
+ if (infoBarVisible)
+ {
+ scrollRect.size.height -= scrollerWidth;
+ // Initial value already is as if the bar is at top.
+ if (!mInfoBarAtTop)
+ {
+ scrollRect.origin.y += scrollerWidth;
+ barFrame.origin.y = 0;
+ }
+ }
+
+ if (!NSEqualRects([scrollView frame], scrollRect)) {
+ [scrollView setFrame: scrollRect];
+ }
+
+ if (infoBarVisible)
+ [mInfoBar setFrame: barFrame];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Set the width of the margin.
+ */
+- (void) setMarginWidth: (int) width
+{
+ if (marginView.ruleThickness != width)
+ {
+ marginView.marginWidth = width;
+ [marginView setRuleThickness:[marginView requiredThickness]];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Triggered by one of the scrollers when it gets manipulated by the user. Notify the backend
+ * about the change.
+ */
+- (void) scrollerAction: (id) sender
+{
+ mBackend->UpdateForScroll();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Used to reposition our content depending on the size of the view.
+ */
+- (void) setFrame: (NSRect) newFrame
+{
+ NSRect previousFrame = [self frame];
+ [super setFrame: newFrame];
+ [self positionSubViews];
+ if (!NSEqualRects(previousFrame, newFrame)) {
+ mBackend->Resize();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Getter for the currently selected text in raw form (no formatting information included).
+ * If there is no text available an empty string is returned.
+ */
+- (NSString*) selectedString
+{
+ NSString *result = @"";
+
+ const long length = mBackend->WndProc(SCI_GETSELTEXT, 0, 0);
+ if (length > 0)
+ {
+ std::string buffer(length + 1, '\0');
+ try
+ {
+ mBackend->WndProc(SCI_GETSELTEXT, length + 1, (sptr_t) &buffer[0]);
+
+ result = [NSString stringWithUTF8String: buffer.c_str()];
+ }
+ catch (...)
+ {
+ }
+ }
+
+ return result;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Delete a range from the document.
+ */
+- (void) deleteRange: (NSRange) aRange
+{
+ if (aRange.length > 0)
+ {
+ NSRange posRange = mBackend->PositionsFromCharacters(aRange);
+ [self message: SCI_DELETERANGE wParam: posRange.location lParam: posRange.length];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Getter for the current text in raw form (no formatting information included).
+ * If there is no text available an empty string is returned.
+ */
+- (NSString*) string
+{
+ NSString *result = @"";
+
+ const long length = mBackend->WndProc(SCI_GETLENGTH, 0, 0);
+ if (length > 0)
+ {
+ std::string buffer(length + 1, '\0');
+ try
+ {
+ mBackend->WndProc(SCI_GETTEXT, length + 1, (sptr_t) &buffer[0]);
+
+ result = [NSString stringWithUTF8String: buffer.c_str()];
+ }
+ catch (...)
+ {
+ }
+ }
+
+ return result;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Setter for the current text (no formatting included).
+ */
+- (void) setString: (NSString*) aString
+{
+ const char* text = [aString UTF8String];
+ mBackend->WndProc(SCI_SETTEXT, 0, (long) text);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) insertString: (NSString*) aString atOffset: (int)offset
+{
+ const char* text = [aString UTF8String];
+ mBackend->WndProc(SCI_ADDTEXT, offset, (long) text);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) setEditable: (BOOL) editable
+{
+ mBackend->WndProc(SCI_SETREADONLY, editable ? 0 : 1, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (BOOL) isEditable
+{
+ return mBackend->WndProc(SCI_GETREADONLY, 0, 0) == 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (SCIContentView*) content
+{
+ return mContent;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) updateMarginCursors {
+ [[self window] invalidateCursorRectsForView: marginView];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Direct call into the backend to allow uninterpreted access to it. The values to be passed in and
+ * the result heavily depend on the message that is used for the call. Refer to the Scintilla
+ * documentation to learn what can be used here.
+ */
++ (sptr_t) directCall: (ScintillaView*) sender message: (unsigned int) message wParam: (uptr_t) wParam
+ lParam: (sptr_t) lParam
+{
+ return ScintillaCocoa::DirectFunction(
+ reinterpret_cast<sptr_t>(sender->mBackend), message, wParam, lParam);
+}
+
+- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam
+{
+ return mBackend->WndProc(message, wParam, lParam);
+}
+
+- (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam
+{
+ return mBackend->WndProc(message, wParam, 0);
+}
+
+- (sptr_t) message: (unsigned int) message
+{
+ return mBackend->WndProc(message, 0, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * This is a helper method to set properties in the backend, with native parameters.
+ *
+ * @param property Main property like SCI_STYLESETFORE for which a value is to be set.
+ * @param parameter Additional info for this property like a parameter or index.
+ * @param value The actual value. It depends on the property what this parameter means.
+ */
+- (void) setGeneralProperty: (int) property parameter: (long) parameter value: (long) value
+{
+ mBackend->WndProc(property, parameter, value);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * A simplified version for setting properties which only require one parameter.
+ *
+ * @param property Main property like SCI_STYLESETFORE for which a value is to be set.
+ * @param value The actual value. It depends on the property what this parameter means.
+ */
+- (void) setGeneralProperty: (int) property value: (long) value
+{
+ mBackend->WndProc(property, value, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * This is a helper method to get a property in the backend, with native parameters.
+ *
+ * @param property Main property like SCI_STYLESETFORE for which a value is to get.
+ * @param parameter Additional info for this property like a parameter or index.
+ * @param extra Yet another parameter if needed.
+ * @result A generic value which must be interpreted depending on the property queried.
+ */
+- (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra
+{
+ return mBackend->WndProc(property, parameter, extra);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convenience function to avoid unneeded extra parameter.
+ */
+- (long) getGeneralProperty: (int) property parameter: (long) parameter
+{
+ return mBackend->WndProc(property, parameter, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Convenience function to avoid unneeded parameters.
+ */
+- (long) getGeneralProperty: (int) property
+{
+ return mBackend->WndProc(property, 0, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Use this variant if you have to pass in a reference to something (e.g. a text range).
+ */
+- (long) getGeneralProperty: (int) property ref: (const void*) ref
+{
+ return mBackend->WndProc(property, 0, (sptr_t) ref);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property setter for colors.
+ */
+- (void) setColorProperty: (int) property parameter: (long) parameter value: (NSColor*) value
+{
+ if ([value colorSpaceName] != NSDeviceRGBColorSpace)
+ value = [value colorUsingColorSpaceName: NSDeviceRGBColorSpace];
+ long red = static_cast<long>([value redComponent] * 255);
+ long green = static_cast<long>([value greenComponent] * 255);
+ long blue = static_cast<long>([value blueComponent] * 255);
+
+ long color = (blue << 16) + (green << 8) + red;
+ mBackend->WndProc(property, parameter, color);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Another color property setting, which allows to specify the color as string like in HTML
+ * documents (i.e. with leading # and either 3 hex digits or 6).
+ */
+- (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString*) fromHTML
+{
+ if ([fromHTML length] > 3 && [fromHTML characterAtIndex: 0] == '#')
+ {
+ bool longVersion = [fromHTML length] > 6;
+ int index = 1;
+
+ char value[3] = {0, 0, 0};
+ value[0] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ if (longVersion)
+ value[1] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ else
+ value[1] = value[0];
+
+ unsigned rawRed;
+ [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawRed];
+
+ value[0] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ if (longVersion)
+ value[1] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ else
+ value[1] = value[0];
+
+ unsigned rawGreen;
+ [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawGreen];
+
+ value[0] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ if (longVersion)
+ value[1] = static_cast<char>([fromHTML characterAtIndex: index++]);
+ else
+ value[1] = value[0];
+
+ unsigned rawBlue;
+ [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawBlue];
+
+ long color = (rawBlue << 16) + (rawGreen << 8) + rawRed;
+ mBackend->WndProc(property, parameter, color);
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property getter for colors.
+ */
+- (NSColor*) getColorProperty: (int) property parameter: (long) parameter
+{
+ long color = mBackend->WndProc(property, parameter, 0);
+ CGFloat red = (color & 0xFF) / 255.0;
+ CGFloat green = ((color >> 8) & 0xFF) / 255.0;
+ CGFloat blue = ((color >> 16) & 0xFF) / 255.0;
+ NSColor* result = [NSColor colorWithDeviceRed: red green: green blue: blue alpha: 1];
+ return result;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property setter for references (pointers, addresses).
+ */
+- (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void*) value
+{
+ mBackend->WndProc(property, parameter, (sptr_t) value);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property getter for references (pointers, addresses).
+ */
+- (const void*) getReferenceProperty: (int) property parameter: (long) parameter
+{
+ return (const void*) mBackend->WndProc(property, parameter, 0);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property setter for string values.
+ */
+- (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString*) value
+{
+ const char* rawValue = [value UTF8String];
+ mBackend->WndProc(property, parameter, (sptr_t) rawValue);
+}
+
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property getter for string values.
+ */
+- (NSString*) getStringProperty: (int) property parameter: (long) parameter
+{
+ const char* rawValue = (const char*) mBackend->WndProc(property, parameter, 0);
+ return [NSString stringWithUTF8String: rawValue];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property setter for lexer properties, which are commonly passed as strings.
+ */
+- (void) setLexerProperty: (NSString*) name value: (NSString*) value
+{
+ const char* rawName = [name UTF8String];
+ const char* rawValue = [value UTF8String];
+ mBackend->WndProc(SCI_SETPROPERTY, (sptr_t) rawName, (sptr_t) rawValue);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Specialized property getter for references (pointers, addresses).
+ */
+- (NSString*) getLexerProperty: (NSString*) name
+{
+ const char* rawName = [name UTF8String];
+ const char* result = (const char*) mBackend->WndProc(SCI_SETPROPERTY, (sptr_t) rawName, 0);
+ return [NSString stringWithUTF8String: result];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Sets the notification callback
+ */
+- (void) registerNotifyCallback: (intptr_t) windowid value: (Scintilla::SciNotifyFunc) callback
+{
+ mBackend->RegisterNotifyCallback(windowid, callback);
+}
+
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Sets the new control which is displayed as info bar at the top or bottom of the editor.
+ * Set newBar to nil if you want to hide the bar again.
+ * The info bar's height is set to the height of the scrollbar.
+ */
+- (void) setInfoBar: (NSView <InfoBarCommunicator>*) newBar top: (BOOL) top
+{
+ if (mInfoBar != newBar)
+ {
+ [mInfoBar removeFromSuperview];
+
+ mInfoBar = newBar;
+ mInfoBarAtTop = top;
+ if (mInfoBar != nil)
+ {
+ [self addSubview: mInfoBar];
+ [mInfoBar setCallback: self];
+ }
+
+ [self positionSubViews];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Sets the edit's info bar status message. This call only has an effect if there is an info bar.
+ */
+- (void) setStatusText: (NSString*) text
+{
+ if (mInfoBar != nil)
+ [mInfoBar notify: IBNStatusChanged message: text location: NSZeroPoint value: 0];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (NSRange) selectedRange
+{
+ return [mContent selectedRange];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void)insertText: (id) aString
+{
+ if ([aString isKindOfClass:[NSString class]])
+ mBackend->InsertText(aString);
+ else if ([aString isKindOfClass:[NSAttributedString class]])
+ mBackend->InsertText([aString string]);
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * For backwards compatibility.
+ */
+- (BOOL) findAndHighlightText: (NSString*) searchText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ scrollTo: (BOOL) scrollTo
+ wrap: (BOOL) wrap
+{
+ return [self findAndHighlightText: searchText
+ matchCase: matchCase
+ wholeWord: wholeWord
+ scrollTo: scrollTo
+ wrap: wrap
+ backwards: NO];
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Searches and marks the first occurrence of the given text and optionally scrolls it into view.
+ *
+ * @result YES if something was found, NO otherwise.
+ */
+- (BOOL) findAndHighlightText: (NSString*) searchText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ scrollTo: (BOOL) scrollTo
+ wrap: (BOOL) wrap
+ backwards: (BOOL) backwards
+{
+ int searchFlags= 0;
+ if (matchCase)
+ searchFlags |= SCFIND_MATCHCASE;
+ if (wholeWord)
+ searchFlags |= SCFIND_WHOLEWORD;
+
+ long selectionStart = [self getGeneralProperty: SCI_GETSELECTIONSTART parameter: 0];
+ long selectionEnd = [self getGeneralProperty: SCI_GETSELECTIONEND parameter: 0];
+
+ // Sets the start point for the coming search to the beginning of the current selection.
+ // For forward searches we have therefore to set the selection start to the current selection end
+ // for proper incremental search. This does not harm as we either get a new selection if something
+ // is found or the previous selection is restored.
+ if (!backwards)
+ [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: selectionEnd];
+ [self setGeneralProperty: SCI_SEARCHANCHOR value: 0];
+ sptr_t result;
+ const char* textToSearch = [searchText UTF8String];
+
+ // The following call will also set the selection if something was found.
+ if (backwards)
+ {
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHPREV
+ wParam: searchFlags
+ lParam: (sptr_t) textToSearch];
+ if (result < 0 && wrap)
+ {
+ // Try again from the end of the document if nothing could be found so far and
+ // wrapped search is set.
+ [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: [self getGeneralProperty: SCI_GETTEXTLENGTH parameter: 0]];
+ [self setGeneralProperty: SCI_SEARCHANCHOR value: 0];
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHNEXT
+ wParam: searchFlags
+ lParam: (sptr_t) textToSearch];
+ }
+ }
+ else
+ {
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHNEXT
+ wParam: searchFlags
+ lParam: (sptr_t) textToSearch];
+ if (result < 0 && wrap)
+ {
+ // Try again from the start of the document if nothing could be found so far and
+ // wrapped search is set.
+ [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: 0];
+ [self setGeneralProperty: SCI_SEARCHANCHOR value: 0];
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHNEXT
+ wParam: searchFlags
+ lParam: (sptr_t) textToSearch];
+ }
+ }
+
+ if (result >= 0)
+ {
+ if (scrollTo)
+ [self setGeneralProperty: SCI_SCROLLCARET value: 0];
+ }
+ else
+ {
+ // Restore the former selection if we did not find anything.
+ [self setGeneralProperty: SCI_SETSELECTIONSTART value: selectionStart];
+ [self setGeneralProperty: SCI_SETSELECTIONEND value: selectionEnd];
+ }
+ return (result >= 0) ? YES : NO;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Searches the given text and replaces
+ *
+ * @result Number of entries replaced, 0 if none.
+ */
+- (int) findAndReplaceText: (NSString*) searchText
+ byText: (NSString*) newText
+ matchCase: (BOOL) matchCase
+ wholeWord: (BOOL) wholeWord
+ doAll: (BOOL) doAll
+{
+ // The current position is where we start searching for single occurrences. Otherwise we start at
+ // the beginning of the document.
+ long startPosition;
+ if (doAll)
+ startPosition = 0; // Start at the beginning of the text if we replace all occurrences.
+ else
+ // For a single replacement we start at the current caret position.
+ startPosition = [self getGeneralProperty: SCI_GETCURRENTPOS];
+ long endPosition = [self getGeneralProperty: SCI_GETTEXTLENGTH];
+
+ int searchFlags= 0;
+ if (matchCase)
+ searchFlags |= SCFIND_MATCHCASE;
+ if (wholeWord)
+ searchFlags |= SCFIND_WHOLEWORD;
+ [self setGeneralProperty: SCI_SETSEARCHFLAGS value: searchFlags];
+ [self setGeneralProperty: SCI_SETTARGETSTART value: startPosition];
+ [self setGeneralProperty: SCI_SETTARGETEND value: endPosition];
+
+ const char* textToSearch = [searchText UTF8String];
+ long sourceLength = strlen(textToSearch); // Length in bytes.
+ const char* replacement = [newText UTF8String];
+ long targetLength = strlen(replacement); // Length in bytes.
+ sptr_t result;
+
+ int replaceCount = 0;
+ if (doAll)
+ {
+ while (true)
+ {
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHINTARGET
+ wParam: sourceLength
+ lParam: (sptr_t) textToSearch];
+ if (result < 0)
+ break;
+
+ replaceCount++;
+ [ScintillaView directCall: self
+ message: SCI_REPLACETARGET
+ wParam: targetLength
+ lParam: (sptr_t) replacement];
+
+ // The replacement changes the target range to the replaced text. Continue after that till the end.
+ // The text length might be changed by the replacement so make sure the target end is the actual
+ // text end.
+ [self setGeneralProperty: SCI_SETTARGETSTART value: [self getGeneralProperty: SCI_GETTARGETEND]];
+ [self setGeneralProperty: SCI_SETTARGETEND value: [self getGeneralProperty: SCI_GETTEXTLENGTH]];
+ }
+ }
+ else
+ {
+ result = [ScintillaView directCall: self
+ message: SCI_SEARCHINTARGET
+ wParam: sourceLength
+ lParam: (sptr_t) textToSearch];
+ replaceCount = (result < 0) ? 0 : 1;
+
+ if (replaceCount > 0)
+ {
+ [ScintillaView directCall: self
+ message: SCI_REPLACETARGET
+ wParam: targetLength
+ lParam: (sptr_t) replacement];
+
+ // For a single replace we set the new selection to the replaced text.
+ [self setGeneralProperty: SCI_SETSELECTIONSTART value: [self getGeneralProperty: SCI_GETTARGETSTART]];
+ [self setGeneralProperty: SCI_SETSELECTIONEND value: [self getGeneralProperty: SCI_GETTARGETEND]];
+ }
+ }
+
+ return replaceCount;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+- (void) setFontName: (NSString*) font
+ size: (int) size
+ bold: (BOOL) bold
+ italic: (BOOL) italic
+{
+ for (int i = 0; i < 128; i++)
+ {
+ [self setGeneralProperty: SCI_STYLESETFONT
+ parameter: i
+ value: (sptr_t)[font UTF8String]];
+ [self setGeneralProperty: SCI_STYLESETSIZE
+ parameter: i
+ value: size];
+ [self setGeneralProperty: SCI_STYLESETBOLD
+ parameter: i
+ value: bold];
+ [self setGeneralProperty: SCI_STYLESETITALIC
+ parameter: i
+ value: italic];
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+@end
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/checkbuildosx.sh b/3rdparty/bgfx/3rdparty/scintilla/cocoa/checkbuildosx.sh
new file mode 100644
index 00000000000..45f7ae439fa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/checkbuildosx.sh
@@ -0,0 +1,66 @@
+# Script to build Scintilla for OS X with most supported build files.
+# Current directory should be scintilla/cocoa before running.
+
+cd ../..
+
+# ************************************************************
+# Target 1: Unit tests
+
+echo Unit tests
+
+cd scintilla/test/unit
+make clean
+make test
+cd ../../..
+
+# ************************************************************
+# Target 2: build framework and test app with Xcode targetting OS X 10.n with n from 9 to 5
+# Only SDK versions that are installed will be built
+# Clean both then build both -- if perform clean in ScintillaTest, also cleans ScintillaFramework
+# which can cause double build
+
+echo Building Cocoa-native ScintillaFramework and ScintillaTest
+for sdk in macosx10.9 macosx10.8 macosx10.7 macosx10.6 macosx10.5
+do
+ xcodebuild -showsdks | grep $sdk
+ if [ "$(xcodebuild -showsdks | grep $sdk)" != "" ]
+ then
+ echo Building with $sdk
+ cd scintilla/cocoa/ScintillaFramework
+ xcodebuild clean
+ cd ../ScintillaTest
+ xcodebuild clean
+ cd ../ScintillaFramework
+ xcodebuild -sdk $sdk
+ cd ../ScintillaTest
+ xcodebuild -sdk $sdk
+ cd ../../..
+ else
+ echo Warning $sdk not available
+ fi
+done
+
+# ************************************************************
+# Target 3: Qt builds
+# Requires Qt development libraries and qmake to be installed
+
+echo Building Qt and PySide
+
+cd scintilla/qt
+cd ScintillaEditBase
+qmake -spec macx-xcode
+xcodebuild clean
+xcodebuild
+cd ..
+
+cd ScintillaEdit
+python WidgetGen.py
+qmake -spec macx-xcode
+xcodebuild clean
+xcodebuild
+cd ..
+
+cd ScintillaEditPy
+python sepbuild.py
+cd ..
+cd ../..
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/info_bar_bg.png b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/info_bar_bg.png
new file mode 100644
index 00000000000..79010fa703e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/info_bar_bg.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_busy.png b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_busy.png
new file mode 100644
index 00000000000..93b2a496b0e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_busy.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_flipped.png b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_flipped.png
new file mode 100644
index 00000000000..e1ee68631d7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cocoa/res/mac_cursor_flipped.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/cppcheck.suppress b/3rdparty/bgfx/3rdparty/scintilla/cppcheck.suppress
new file mode 100644
index 00000000000..81146f0b8d1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/cppcheck.suppress
@@ -0,0 +1,42 @@
+// File to suppress cppcheck warnings for files that will not be fixed.
+// Does not suppress warnings where an additional occurrence of the warning may be of interest.
+// Does not suppress false positives from cppcheck.
+
+// Coding style is to use assignments in constructor when there are many
+// members to initialize or the initialization is complex or has comments.
+useInitializationList
+
+// Suppress most lexer warnings since the lexers are maintained by others
+useInitializationList:scintilla/lexers/LexAsm.cxx
+useInitializationList:scintilla/lexers/LexBasic.cxx
+noCopyConstructor:scintilla/lexers/LexBash.cxx
+variableScope:scintilla/lexers/LexBash.cxx
+variableScope:scintilla/lexers/LexCmake.cxx
+variableScope:scintilla/lexers/LexCSS.cxx
+useInitializationList:scintilla/lexers/LexD.cxx
+variableScope:scintilla/lexers/LexErlang.cxx
+variableScope:scintilla/lexers/LexGui4Cli.cxx
+variableScope:scintilla/lexers/LexInno.cxx
+variableScope:scintilla/lexers/LexLaTeX.cxx
+variableScope:scintilla/lexers/LexMetapost.cxx
+variableScope:scintilla/lexers/LexModula.cxx
+variableScope:scintilla/lexers/LexNimrod.cxx
+variableScope:scintilla/lexers/LexNsis.cxx
+variableScope:scintilla/lexers/LexOpal.cxx
+variableScope:scintilla/lexers/LexOthers.cxx
+variableScope:scintilla/lexers/LexPB.cxx
+noCopyConstructor:scintilla/lexers/LexPerl.cxx
+variableScope:scintilla/lexers/LexRuby.cxx
+uninitMemberVar:scintilla/lexers/LexRuby.cxx
+variableScope:scintilla/lexers/LexSpecman.cxx
+unreadVariable:scintilla/lexers/LexSpice.cxx
+clarifyCalculation:scintilla/lexers/LexTADS3.cxx
+invalidscanf:scintilla/lexers/LexTCMD.cxx
+variableScope:scintilla/lexers/LexTeX.cxx
+variableScope:scintilla/lexers/LexVHDL.cxx
+
+// Suppress C-style pointer casting for Qt code as won't be changing
+cstyleCast:scintilla/qt/ScintillaEdit/ScintillaDocument.cpp
+
+// Suppress everything in catch.hpp as won't be changing
+*:scintilla/test/unit/catch.hpp
diff --git a/3rdparty/bgfx/3rdparty/scintilla/delbin.bat b/3rdparty/bgfx/3rdparty/scintilla/delbin.bat
new file mode 100644
index 00000000000..6d4e91a3e00
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/delbin.bat
@@ -0,0 +1 @@
+del /S /Q *.a *.aps *.bsc *.dll *.dsw *.exe *.idb *.ilc *.ild *.ilf *.ilk *.ils *.lib *.map *.ncb *.obj *.o *.opt *.pdb *.plg *.res *.sbr *.tds *.exp *.tlog >NUL:
diff --git a/3rdparty/bgfx/3rdparty/scintilla/delcvs.bat b/3rdparty/bgfx/3rdparty/scintilla/delcvs.bat
new file mode 100644
index 00000000000..6c326531538
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/delcvs.bat
@@ -0,0 +1 @@
+del /S /Q .cvsignore
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Design.html b/3rdparty/bgfx/3rdparty/scintilla/doc/Design.html
new file mode 100644
index 00000000000..0ca231e8eb8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Design.html
@@ -0,0 +1,249 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla and SciTE
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ Component Design</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Top level structure
+ </h2>
+ <p>
+ Scintilla consists of three major layers of C++ code
+ </p>
+ <ul>
+ <li>
+ Portability Library
+ </li>
+ <li>
+ Core Code
+ </li>
+ <li>
+ Platform Events and API
+ </li>
+ </ul>
+ <p>
+ The primary purpose of this structure is to separate the platform dependent code from the
+ platform independent core code. This makes it easier to port Scintilla to a new platform and
+ ensures that most readers of the code do not have to deal with platform details. To minimise
+ portability problems and avoid code bloat, a conservative subset of C++ is used in Scintilla
+ with no exception handling, run time type information or use of the standard C++
+ library and with limited use of templates.
+ </p>
+ <p>
+ The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in
+ many ways.
+ Each has windows, menus and bitmaps. These features generally work in similar ways so each
+ has a way to move a window or draw a red line. Sometimes one platform requires a sequence of
+ calls rather than a single call. At other times, the differences are more profound. Reading
+ the Windows clipboard occurs synchronously but reading the GTK+ clipboard requires a request
+ call that will be asynchronously answered with a message containing the clipboard data.
+ The wxWindows platform is available from the <a href="http://wxwindows.org/">wxWindows site</a>
+ </p>
+ <br />
+ <h3>
+ Portability Library
+ </h3>
+ <p>
+ This is a fairly small and thin layer over the platform's native capabilities.
+ </p>
+ <p>
+ The portability library is defined in Platform.h and is implemented once for each platform.
+ PlatWin.cxx defines the Windows variants of the methods and PlatGTK.cxx the GTK+ variants.
+ </p>
+ <p>
+ Several of the classes here hold platform specific object identifiers and act as proxies to
+ these platform objects. Most client code can thus manipulate the platform objects without
+ caring which is the current platform. Sometimes client code needs access to the underlying
+ object identifiers and this is provided by the GetID method. The underlying types of the
+ platform specific identifiers are typedefed to common names to allow them to be transferred
+ around in client code where needed.
+ </p>
+ <h4>
+ Point, PRectangle
+ </h4>
+ <p>
+ These are simple classes provided to hold the commonly used geometric primitives. A
+ PRectangle follows the Mac / Windows convention of not including its bottom and right sides
+ instead of including all its sides as is normal in GTK+. It is not called Rectangle as this may be
+ the name of a macro on Windows.
+ </p>
+ <h4>
+ Colour, ColourPair, Palette
+ </h4>
+ <p>
+ Colour holds a platform specific colour identifier - COLORREF for Windows and GdkColor for
+ GTK+. The red, green and blue components that make up the colour are limited to the 8 bits of
+ precision available on Windows. ColourPairs are used because not all possible colours are
+ always available. Using an 8 bit colour mode, which is a common setting for both Windows and
+ GTK+, only 256 colours are possible on the display. Thus when an application asks for a dull
+ red, say #400000, it may only be allocated an already available colour such as #800000 or
+ #330000. With 16 or 2 colour modes even less choice is available and the application will
+ have to use the limited set of already available colours.
+ </p>
+ A Palette object holds a set of colour pairs and can make the appropriate calls to ask to
+ allocate these colours and to see what the platform has decided will be allowed.
+ <h4>
+ Font
+ </h4>
+ <p>
+ Font holds a platform specific font identifier - HFONT for Windows, GdkFont* for GTK+. It
+ does not own the identifier and so will not delete the platform font object in its
+ destructor. Client code should call Destroy at appropriate times.
+ </p>
+ <h4>
+ Surface
+ </h4>
+ <p>
+ Surface is an abstraction over each platform's concept of somewhere that graphical drawing
+ operations can be done. It may wrap an already created drawing place such as a window or be
+ used to create a bitmap that can be drawn into and later copied onto another surface. On
+ Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a GdkDrawable* and possibly a
+ GdkPixmap*. Other platform specific objects are created (and correctly destroyed) whenever
+ required to perform drawing actions.
+ </p>
+ <p>
+ Drawing operations provided include drawing filled and unfilled polygons, lines, rectangles,
+ ellipses and text. The height and width of text as well as other details can be measured.
+ Operations can be clipped to a rectangle. Most of the calls are stateless with all parameters
+ being passed at each call. The exception to this is line drawing which is performed by
+ calling MoveTo and then LineTo.
+ </p>
+ <h4>
+ Window
+ </h4>
+ <p>
+ Window acts as a proxy to a platform window allowing operations such as showing, moving,
+ redrawing, and destroying to be performed. It contains a platform specific window identifier
+ - HWND for Windows, GtkWidget* for GTK+.
+ </p>
+ <h4>
+ ListBox
+ </h4>
+ <p>
+ ListBox is a subclass of Window and acts as a proxy to a platform listbox adding methods for
+ operations such as adding, retrieving, and selecting items.
+ </p>
+ <h4>
+ Menu
+ </h4>
+ <p>
+ Menu is a small helper class for constructing popup menus. It contains the platform specific
+ menu identifier - HMENU for Windows, GtkItemFactory* for GTK+. Most of the work in
+ constructing menus requires access to platform events and so is done in the Platform Events
+ and API layer.
+ </p>
+ <h4>
+ Platform
+ </h4>
+ <p>
+ The Platform class is used to access the facilities of the platform. System wide parameters
+ such as double click speed and chrome colour are available from Platform. Utility functions
+ such as DebugPrintf are also available from Platform.
+ </p>
+ <h3>
+ Core Code
+ </h3>
+ <p>
+ The bulk of Scintilla's code is platform independent. This is made up of the CellBuffer,
+ ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap,
+ ScintillaBase, CallTip,
+ and AutoComplete primary classes.
+ </p>
+ <h4>
+ CellBuffer
+ </h4>
+ <p>
+ A CellBuffer holds text and styling information, the undo stack, the assignment of line
+ markers to lines, and the fold structure.
+ </p>
+ <p>
+ A cell contains a character byte and its associated style byte. The current state of the
+ cell buffer is the sequence of cells that make up the text and a sequence of line information
+ containing the starting position of each line and any markers assigned to each line.
+ </p>
+ <p>
+ The undo stack holds a sequence of actions on the cell buffer. Each action is one of a text
+ insertion, a text deletion or an undo start action. The start actions are used to group
+ sequences of text insertions and deletions together so they can be undone together. To
+ perform an undo operation, each insertion or deletion is undone in reverse sequence.
+ Similarly, redo reapplies each action to the buffer in sequence. Whenever a character is
+ inserted in the buffer either directly through a call such as InsertString or through undo or
+ redo, its styling byte is initially set to zero. Client code is responsible for styling each
+ character whenever convenient. Styling information is not stored in undo actions.
+ </p>
+ <h4>
+ Document
+ </h4>
+ <p>
+ A document contains a CellBuffer and deals with some higher level abstractions such as
+ words, DBCS character sequences and line end character sequences. It is responsible for
+ managing the styling process and for notifying other objects when changes occur to the
+ document.
+ </p>
+ <h4>
+ Editor
+ </h4>
+ <p>
+ The Editor object is central to Scintilla. It is responsible for displaying a document and
+ responding to user actions and requests from the container. It uses ContractionState, Indicator,
+ LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to
+ map key presses to functions.
+ The visibility of each line is kept in the ContractionState which is also responsible for mapping
+ from display lines to documents lines and vice versa.
+ </p>
+ <p>
+ There may be multiple Editor objects attached to one Document object. Changes to a
+ document are broadcast to the editors through the DocWatcher mechanism.
+ </p>
+ <h4>
+ ScintillaBase
+ </h4>
+ <p>
+ ScintillaBase is a subclass of Editor and adds extra windowing features including display of
+ calltips, autocompletion lists and context menus. These features use CallTip and AutoComplete
+ objects. This class is optional so a lightweight implementation of Scintilla may bypass it if
+ the added functionality is not required.
+ </p>
+ <h3>
+ Platform Events and API
+ </h3>
+ <p>
+ Each platform uses different mechanisms for receiving events. On Windows, events are
+ received through messages and COM. On GTK+, callback functions are used.
+ </p>
+ <p>
+ For each platform, a class is derived from ScintillaBase (and thus from Editor). This is
+ ScintillaWin on Windows and ScintillaGTK on GTK+. These classes are responsible for
+ connecting to the platforms event mechanism and also to implement some virtual methods in
+ Editor and ScintillaBase which are different on the platforms. For example, this layer has to
+ support this difference between the synchronous Windows clipboard and the asynchronous GTK+
+ clipboard.
+ </p>
+ <p>
+ The external API is defined in this layer as each platform has different preferred styles of
+ API - messages on Windows and function calls on GTK+. This also allows multiple APIs to be
+ defined on a platform. The currently available API on GTK+ is similar to the Windows API and
+ does not follow platform conventions well. A second API could be implemented here that did
+ follow platform conventions.
+ </p>
+ </body>
+</html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Icons.html b/3rdparty/bgfx/3rdparty/scintilla/doc/Icons.html
new file mode 100644
index 00000000000..0bf302d1978
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Icons.html
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla icons
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ and SciTE</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Icons
+ </h2>
+ <p>
+ These images may be used under the same license as Scintilla.
+ </p>
+ <p>
+ Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.
+ </p>
+ <p>
+ <a href="http://prdownloads.sourceforge.net/scintilla/icons1.zip?download">zip format</a> (70K)
+ </p>
+ <table>
+ <tr>
+ <td>For autocompletion lists</td>
+ <td colspan="3">For margin markers</td>
+ </tr>
+ <tr>
+ <td>12x12</td>
+ <td>16x16</td>
+ <td>24x24</td>
+ <td>32x32</td>
+ </tr>
+ <tr>
+ <td valign="top"><img src="12.png" /></td>
+ <td valign="top"><img src="16.png" /></td>
+ <td valign="top"><img src="24.png" /></td>
+ <td valign="top"><img src="32.png" /></td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Indicators.png b/3rdparty/bgfx/3rdparty/scintilla/doc/Indicators.png
new file mode 100644
index 00000000000..33e31f87a31
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Indicators.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Lexer.txt b/3rdparty/bgfx/3rdparty/scintilla/doc/Lexer.txt
new file mode 100644
index 00000000000..0aeb66bae94
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Lexer.txt
@@ -0,0 +1,226 @@
+How to write a scintilla lexer
+
+A lexer for a particular language determines how a specified range of
+text shall be colored. Writing a lexer is relatively straightforward
+because the lexer need only color given text. The harder job of
+determining how much text actually needs to be colored is handled by
+Scintilla itself, that is, the lexer's caller.
+
+
+Parameters
+
+The lexer for language LLL has the following prototype:
+
+ static void ColouriseLLLDoc (
+ unsigned int startPos, int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+The styler parameter is an Accessor object. The lexer must use this
+object to access the text to be colored. The lexer gets the character
+at position i using styler.SafeGetCharAt(i);
+
+The startPos and length parameters indicate the range of text to be
+recolored; the lexer must determine the proper color for all characters
+in positions startPos through startPos+length.
+
+The initStyle parameter indicates the initial state, that is, the state
+at the character before startPos. States also indicate the coloring to
+be used for a particular range of text.
+
+Note: the character at StartPos is assumed to start a line, so if a
+newline terminates the initStyle state the lexer should enter its
+default state (or whatever state should follow initStyle).
+
+The keywordlists parameter specifies the keywords that the lexer must
+recognize. A WordList class object contains methods that simplify
+the recognition of keywords. Present lexers use a helper function
+called classifyWordLLL to recognize keywords. These functions show how
+to use the keywordlists parameter to recognize keywords. This
+documentation will not discuss keywords further.
+
+
+The lexer code
+
+The task of a lexer can be summarized briefly: for each range r of
+characters that are to be colored the same, the lexer should call
+
+ styler.ColourTo(i, state)
+
+where i is the position of the last character of the range r. The lexer
+should set the state variable to the coloring state of the character at
+position i and continue until the entire text has been colored.
+
+Note 1: the styler (Accessor) object remembers the i parameter in the
+previous calls to styler.ColourTo, so the single i parameter suffices to
+indicate a range of characters.
+
+Note 2: As a side effect of calling styler.ColourTo(i,state), the
+coloring states of all characters in the range are remembered so that
+Scintilla may set the initStyle parameter correctly on future calls to
+the
+lexer.
+
+
+Lexer organization
+
+There are at least two ways to organize the code of each lexer. Present
+lexers use what might be called a "character-based" approach: the outer
+loop iterates over characters, like this:
+
+ lengthDoc = startPos + length ;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ chNext = styler.SafeGetCharAt(i + 1);
+ << handle special cases >>
+ switch(state) {
+ // Handlers examine only ch and chNext.
+ // Handlers call styler.ColorTo(i,state) if the state changes.
+ case state_1: << handle ch in state 1 >>
+ case state_2: << handle ch in state 2 >>
+ ...
+ case state_n: << handle ch in state n >>
+ }
+ chPrev = ch;
+ }
+ styler.ColourTo(lengthDoc - 1, state);
+
+
+An alternative would be to use a "state-based" approach. The outer loop
+would iterate over states, like this:
+
+ lengthDoc = startPos+lenth ;
+ for ( unsigned int i = startPos ;; ) {
+ char ch = styler.SafeGetCharAt(i);
+ int new_state = 0 ;
+ switch ( state ) {
+ // scanners set new_state if they set the next state.
+ case state_1: << scan to the end of state 1 >> break ;
+ case state_2: << scan to the end of state 2 >> break ;
+ case default_state:
+ << scan to the next non-default state and set new_state >>
+ }
+ styler.ColourTo(i, state);
+ if ( i >= lengthDoc ) break ;
+ if ( ! new_state ) {
+ ch = styler.SafeGetCharAt(i);
+ << set state based on ch in the default state >>
+ }
+ }
+ styler.ColourTo(lengthDoc - 1, state);
+
+This approach might seem to be more natural. State scanners are simpler
+than character scanners because less needs to be done. For example,
+there is no need to test for the start of a C string inside the scanner
+for a C comment. Also this way makes it natural to define routines that
+could be used by more than one scanner; for example, a scanToEndOfLine
+routine.
+
+However, the special cases handled in the main loop in the
+character-based approach would have to be handled by each state scanner,
+so both approaches have advantages. These special cases are discussed
+below.
+
+Special case: Lead characters
+
+Lead bytes are part of DBCS processing for languages such as Japanese
+using an encoding such as Shift-JIS. In these encodings, extended
+(16-bit) characters are encoded as a lead byte followed by a trail byte.
+
+Lead bytes are rarely of any lexical significance, normally only being
+allowed within strings and comments. In such contexts, lexers should
+ignore ch if styler.IsLeadByte(ch) returns TRUE.
+
+Note: UTF-8 is simpler than Shift-JIS, so no special handling is
+applied for it. All UTF-8 extended characters are >= 128 and none are
+lexically significant in programming languages which, so far, use only
+characters in ASCII for operators, comment markers, etc.
+
+
+Special case: Folding
+
+Folding may be performed in the lexer function. It is better to use a
+separate folder function as that avoids some troublesome interaction
+between styling and folding. The folder function will be run after the
+lexer function if folding is enabled. The rest of this section explains
+how to perform folding within the lexer function.
+
+During initialization, lexers that support folding set
+
+ bool fold = styler.GetPropertyInt("fold");
+
+If folding is enabled in the editor, fold will be TRUE and the lexer
+should call:
+
+ styler.SetLevel(line, level);
+
+at the end of each line and just before exiting.
+
+The line parameter is simply the count of the number of newlines seen.
+It's initial value is styler.GetLine(startPos) and it is incremented
+(after calling styler.SetLevel) whenever a newline is seen.
+
+The level parameter is the desired indentation level in the low 12 bits,
+along with flag bits in the upper four bits. The indentation level
+depends on the language. For C++, it is incremented when the lexer sees
+a '{' and decremented when the lexer sees a '}' (outside of strings and
+comments, of course).
+
+The following flag bits, defined in Scintilla.h, may be set or cleared
+in the flags parameter. The SC_FOLDLEVELWHITEFLAG flag is set if the
+lexer considers that the line contains nothing but whitespace. The
+SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point.
+This normally means that the next line has a greater level than present
+line. However, the lexer may have some other basis for determining a
+fold point. For example, a lexer might create a header line for the
+first line of a function definition rather than the last.
+
+The SC_FOLDLEVELNUMBERMASK mask denotes the level number in the low 12
+bits of the level param. This mask may be used to isolate either flags
+or level numbers.
+
+For example, the C++ lexer contains the following code when a newline is
+seen:
+
+ if (fold) {
+ int lev = levelPrev;
+
+ // Set the "all whitespace" bit if the line is blank.
+ if (visChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+
+ // Set the "header" bit if needed.
+ if ((levelCurrent > levelPrev) && (visChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ styler.SetLevel(lineCurrent, lev);
+
+ // reinitialize the folding vars describing the present line.
+ lineCurrent++;
+ visChars = 0; // Number of non-whitespace characters on the line.
+ levelPrev = levelCurrent;
+ }
+
+The following code appears in the C++ lexer just before exit:
+
+ // Fill in the real level of the next line, keeping the current flags
+ // as they will be filled in later.
+ if (fold) {
+ // Mask off the level number, leaving only the previous flags.
+ int flagsNext = styler.LevelAt(lineCurrent);
+ flagsNext &= ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+ }
+
+
+Don't worry about performance
+
+The writer of a lexer may safely ignore performance considerations: the
+cost of redrawing the screen is several orders of magnitude greater than
+the cost of function calls, etc. Moreover, Scintilla performs all the
+important optimizations; Scintilla ensures that a lexer will be called
+only to recolor text that actually needs to be recolored. Finally, it
+is not necessary to avoid extra calls to styler.ColourTo: the sytler
+object buffers calls to ColourTo to avoid multiple updates of the
+screen.
+
+Page contributed by Edward K. Ream \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Markers.png b/3rdparty/bgfx/3rdparty/scintilla/doc/Markers.png
new file mode 100644
index 00000000000..6eee926eda9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Markers.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/SciBreak.jpg b/3rdparty/bgfx/3rdparty/scintilla/doc/SciBreak.jpg
new file mode 100644
index 00000000000..b63b09f9a7c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/SciBreak.jpg
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/SciCoding.html b/3rdparty/bgfx/3rdparty/scintilla/doc/SciCoding.html
new file mode 100644
index 00000000000..d51e3165bb2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/SciCoding.html
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla and SciTE Code Style Preferences
+ </title>
+ <style>
+ .S0 {
+ color: #808080;
+ }
+ .S1 {
+ font-family: Comic Sans MS;
+ color: #007F00;
+ font-size: 9pt;
+ }
+ .S2 {
+ font-family: Comic Sans MS;
+ color: #007F00;
+ font-size: 9pt;
+ }
+ .S3 {
+ font-family: Comic Sans MS;
+ color: #3F703F;
+ font-size: 9pt;
+ }
+ .S4 {
+ color: #007F7F;
+ }
+ .S5 {
+ font-weight: bold;
+ color: #00007F;
+ }
+ .S6 {
+ color: #7F007F;
+ }
+ .S7 {
+ color: #7F007F;
+ }
+ .S8 {
+ color: #804080;
+ }
+ .S9 {
+ color: #7F7F00;
+ }
+ .S10 {
+ font-weight: bold;
+ color: #000000;
+ }
+ .S12 {
+ font-family: Courier New;
+ color: #000000;
+ background: #E0C0E0;
+ font-size: 10pt;
+ }
+ .S13 {
+ font-family: Courier New;
+ color: #007F00;
+ background: #E0FFE0;
+ font-size: 10pt;
+ }
+ .S14 {
+ font-family: Courier New;
+ color: #3F7F3F;
+ background: #E0F0FF;
+ font-size: 10pt;
+ }
+ .S15 {
+ font-family: Comic Sans MS;
+ color: #3F703F;
+ font-size: 9pt;
+ }
+ SPAN {
+ font-family: Verdana;
+ font-size: 10pt;
+ }
+ </style>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ and SciTE</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Code Style
+ </h2>
+ <h3>
+ Introduction
+ </h3>
+ <p>
+ The source code of Scintilla and SciTE follow my preferences.
+ Some of these decisions are arbitrary and based on my sense of aesthetics
+ but its good to have all the code look the same even if its not exactly how
+ everyone would prefer.
+ </p>
+ <p>
+ Code that does not follow these conventions will be accepted, but will be modified
+ as time goes by to fit the conventions. Scintilla code follows the conventions more
+ closely than SciTE except for lexers which are relatively independent modules.
+ Lexers that are maintained by others are left as they are submitted except that
+ warnings will be fixed so the whole project can compile cleanly.
+ </p>
+ <p>
+ The <a href="http://astyle.sourceforge.net/">AStyle</a> formatting
+ program with '-taOHUKk3 -M8' arguments formats code in much the right way although
+ there are a few bugs in AStyle.
+ </p>
+ <h3>
+ Language features
+ </h3>
+ <p>
+ Design goals for Scintilla and SciTE include portability to currently available C++
+ compilers on diverse platforms with high performance and low resource usage.
+ Scintilla has stricter portability requirements to SciTE as it may be ported to
+ low capability platforms.
+ </p>
+ <p>
+ To achieve portability, only a subset of C++ features are used.
+ Exceptions and templates may be used but, since Scintilla can be used from C as well as
+ C++, exceptions may not be thrown out of Scintilla and all exceptions should be caught
+ before returning from Scintilla.
+ Run-time type information adds to memory use so is turned off.
+ A 'Scintilla' name spaces is optionally used based on the SCI_NAMESPACE
+ definition. This helps with name clashes on OS X.
+ </p>
+ <p>
+ The goto statement is not used because of bad memories from my first job
+ maintaining FORTRAN programs. The union feature is not used as it can lead to
+ non-type-safe value access.
+ </p>
+ <h3>
+ Casting
+ </h3>
+ <p>
+ Do not use old C style casts like (char *)s. Instead use the most strict form of C++
+ cast possible like const_cast&lt;char *&gt;(s). Use static_cast and const_cast
+ where possible rather than reinterpret_cast. Because the code is compiled with
+ run-time type information turned off, dynamic_cast will not work.
+ </p>
+ <p>
+ The benefit to using the new style casts is that they explicitly detail what evil is
+ occurring and act as signals that something potentially unsafe is being done.
+ </p>
+ <p>
+ Code that treats const seriously is easier to reason about both for humans
+ and compilers, so use const parameters and avoid const_cast.
+ </p>
+ <h3>
+ Warnings
+ </h3>
+ <p>
+ To help ensure code is well written and portable, it is compiled with almost all
+ warnings turned on. This sometimes results in warnings about code that is
+ completely good (false positives) but changing the code to avoid the warnings
+ is generally fast and has little impact on readability.
+ </p>
+ <p>
+ Initialise all variables and minimise the scope of variables. If a variable is defined
+ just before its use then it can't be misused by code before that point.
+ Use loop declarations that are compatible with both the C++ standard and currently
+ available compilers.
+ </p>
+ <h3>
+ Allocation
+ </h3>
+ <p>
+ Memory exhaustion can occur in many Scintilla methods.
+ This should be checked for and handled but once it has happened, it is very difficult to do
+ anything as Scintilla's data structures may be in an inconsistent state.
+ Fixed length buffers are often used as these are simple and avoid the need to
+ worry about memory exhaustion but then require that buffer lengths are
+ respected.
+ </p>
+ <p>
+ The C++ new and delete operators are preferred over C's malloc and free
+ as new and delete are type safe.
+ </p>
+ <h3>
+ Bracketing
+ </h3>
+ <p>
+ Start brackets, '{', should be located on the line of the control structure they
+ start and end brackets, '}', should be at the indented start of a line. When there is
+ an else clause, this occurs on the same line as the '}'.
+ This format uses less lines than alternatives, allowing more code to be seen on screen.
+ Fully bracketed control
+ structures are preferred because this makes it more likely that modifications will
+ be correct and it allows Scintilla's folder to work. No braces on returned
+ expressions as return is a keyword, not a function call.
+ </p>
+<SPAN class=S0></SPAN><SPAN class=S5>bool</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>fn</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>t</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>else</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>u</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>!</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
+</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
+</SPAN> <h3>
+ Spacing
+ </h3>
+ <p>
+ Spaces on both sides of '=' and comparison operators and no attempt to line up '='.
+ No space before or after '(', when used in calls, but a space after every ','.
+ No spaces between tokens in short expressions but may be present in
+ longer expressions. Space before '{'. No space before ';'.
+ No space after '*' when used to mean pointer and no space after '[' or ']'.
+ One space between keywords and '('.
+ </p>
+<SPAN class=S0></SPAN><SPAN class=S5>void</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>StoreConditionally</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>c</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>const</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>char</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>c</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>&amp;&amp;</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>==</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>trustSegment</SPAN><SPAN class=S10>[</SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>]))</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>=</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>+</SPAN><SPAN class=S4>1</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
+</SPAN><SPAN class=S10>}</SPAN>
+ <h3>
+ Names
+ </h3>
+ <p>
+ Identifiers use mixed case and no underscores.
+ Class, function and method names start with an uppercase letter and use
+ further upper case letters to distinguish words. Variables start with a lower
+ case letter and use upper case letters to distinguish words.
+ Loop counters and similar variables can have simple names like 'i'.
+ Function calls should be differentiated from method calls with an initial '::'
+ global scope modifier.
+ </p>
+<SPAN class=S0></SPAN><SPAN class=S5>class</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>StorageZone</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+</SPAN><SPAN class=S5>public</SPAN><SPAN class=S10>:</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>void</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>const</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>char</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>Media</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>=</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetBaseMedia</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>zoneDefault</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>for</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>=</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-&gt;</SPAN><SPAN class=S11>cursor</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>],</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>++)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-&gt;</SPAN><SPAN class=S11>Persist</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>]);</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
+</SPAN><SPAN class=S10>};</SPAN>
+ <h3>
+ Submitting a lexer
+ </h3>
+
+ <p>Add a public feature request to the <a href="https://sourceforge.net/tracker/?group_id=2439&atid=352439">Feature Request Tracker</a>.</p>
+ <p>Send all the modified and new files as full text (not patches) in an archive (.zip or .tgz).</p>
+ <p>Define all of the lexical states in a modified Scintilla.iface.</p>
+ <p>Ensure there are no warnings under the compiler you use. Warnings from other compilers
+ will be noted on the feature request.</p>
+ <p>sc.ch is an int: do not pass this around as a char.</p>
+ </body>
+</html>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/SciRest.jpg b/3rdparty/bgfx/3rdparty/scintilla/doc/SciRest.jpg
new file mode 100644
index 00000000000..4b052239cd9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/SciRest.jpg
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/SciTEIco.png b/3rdparty/bgfx/3rdparty/scintilla/doc/SciTEIco.png
new file mode 100644
index 00000000000..d0cc869b8c5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/SciTEIco.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/SciWord.jpg b/3rdparty/bgfx/3rdparty/scintilla/doc/SciWord.jpg
new file mode 100644
index 00000000000..60e70e897b4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/SciWord.jpg
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDoc.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDoc.html
new file mode 100644
index 00000000000..3a51cfb6188
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDoc.html
@@ -0,0 +1,7716 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator"
+ content="HTML Tidy for Windows (vers 1st August 2002), see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+
+ <title>Scintilla Documentation</title>
+
+ <style type="text/css">
+<!--
+/*<![CDATA[*/
+ CODE { font-weight: bold; font-family: Consolas,Bitstream Vera Sans Mono,Courier New,monospace; }
+ A:visited { color: blue; }
+ A:hover { text-decoration: underline ! important; }
+ A.message { text-decoration: none; font-weight: bold; font-family: Consolas,Bitstream Vera Sans Mono,Courier New,monospace; }
+ A.toc { text-decoration: none; }
+ A.jump { text-decoration: none; }
+ .S0 {
+ color: #808080;
+ }
+ .S2 {
+ font-family: 'Comic Sans MS';
+ color: #007F00;
+ font-size: 9pt;
+ }
+ .S3 {
+ font-family: 'Comic Sans MS';
+ color: #3F703F;
+ font-size: 9pt;
+ }
+ .S4 {
+ color: #007F7F;
+ }
+ .S5 {
+ font-weight: bold;
+ color: #00007F;
+ }
+ .S9 {
+ color: #7F7F00;
+ }
+ .S10 {
+ font-weight: bold;
+ color: #000000;
+ }
+ .S17 {
+ font-family: 'Comic Sans MS';
+ color: #3060A0;
+ font-size: 9pt;
+ }
+ DIV.highlighted {
+ background: #F7FCF7;
+ border: 1px solid #C0D7C0;
+ margin: 0.3em 3em;
+ padding: 0.3em 0.6em;
+ font-family: 'Verdana';
+ color: #000000;
+ font-size: 10pt;
+ }
+ .provisional {
+ background: #FFB000;
+ }
+/*]]>*/
+-->
+ </style>
+ </head>
+
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0"
+ summary="Banner">
+ <tr>
+ <td><img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" /></td>
+
+ <td><a href="index.html"
+ style="color:white;text-decoration:none;font-size:200%">Scintilla</a></td>
+ </tr>
+ </table>
+
+ <h1>Scintilla Documentation</h1>
+
+ <p>Last edited 22 February 2015 NH</p>
+
+ <p>There is <a class="jump" href="Design.html">an overview of the internal design of
+ Scintilla</a>.<br />
+ <a class="jump" href="ScintillaUsage.html">Some notes on using Scintilla</a>.<br />
+ <a class="jump" href="Steps.html">How to use the Scintilla Edit Control on Windows</a>.<br />
+ <a class="jump" href="http://www.scintilla.org/dmapp.zip">A simple sample using Scintilla from
+ C++ on Windows</a>.<br />
+ <a class="jump" href="http://www.scintilla.org/SciTry.vb">A simple sample using Scintilla from
+ Visual Basic</a>.<br />
+ <a class="jump" href="http://www.scintilla.org/bait.zip">Bait is a tiny sample using Scintilla
+ on GTK+</a>.<br />
+ <a class="jump" href="Lexer.txt">A detailed description of how to write a lexer, including a
+ discussion of folding</a>.<br />
+ <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html">
+ How to implement a lexer in the container</a>.<br />
+ <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-folding.html">
+ How to implement folding</a>.<br />
+ <a class="jump" href="https://bitbucket.org/StarFire/scintilla-doc/downloads/Scintilla-var'aq-Tutorial.pdf">
+ Beginner's Guide to lexing and folding</a>.<br />
+ The <a class="jump" href="SciCoding.html">coding style</a> used in Scintilla and SciTE is
+ worth following if you want to contribute code to Scintilla but is not compulsory.</p>
+
+ <h2>Introduction</h2>
+
+ <p>The Windows version of Scintilla is a Windows Control. As such, its primary programming
+ interface is through Windows messages. Early versions of Scintilla emulated much of the API
+ defined by the standard Windows Edit and RichEdit controls but those APIs are now deprecated in
+ favour of Scintilla's own, more consistent API. In addition to messages performing the actions
+ of a normal Edit control, Scintilla allows control of syntax styling, folding, markers, autocompletion
+ and call tips.</p>
+
+ <p>The GTK+ version also uses messages in a similar way to the Windows version. This is
+ different to normal GTK+ practice but made it easier to implement rapidly.</p>
+
+ <p>Scintilla also builds with Cocoa on OS X and with Qt, and follows the conventions of
+ those platforms.</p>
+
+ <p>Scintilla does not properly support right-to-left languages like Arabic and Hebrew.
+ While text in these languages may appear correct, it is not possible to interact with this text
+ as is normal with other editing components.</p>
+
+ <p>This documentation describes the individual messages and notifications used by Scintilla. It
+ does not describe how to link them together to form a useful editor. For now, the best way to
+ work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of
+ Scintilla's facilities.</p>
+
+ <p>In the descriptions that follow, the messages are described as function calls with zero, one
+ or two arguments. These two arguments are the standard <code>wParam</code> and
+ <code>lParam</code> familiar to Windows programmers. These parameters are integers that
+ are large enough to hold pointers, and the return value is also an integer large enough to contain a
+ pointer.
+ Although the commands only use the
+ arguments described, because all messages have two arguments whether Scintilla uses them or
+ not, it is strongly recommended that any unused arguments are set to 0. This allows future
+ enhancement of messages without the risk of breaking existing code. Common argument types
+ are:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Common argument types">
+ <tbody valign="top">
+ <tr>
+ <th align="left">bool</th>
+
+ <td>Arguments expect the values 0 for <code>false</code> and 1 for
+ <code>true</code>.</td>
+ </tr>
+
+ <tr>
+ <th align="left">int</th>
+
+ <td>Arguments are 32-bit signed integers.</td>
+ </tr>
+
+ <tr>
+ <th align="left">const&nbsp;char&nbsp;*</th>
+
+ <td>Arguments point at text that is being passed to Scintilla but not modified. The text
+ may be zero terminated or another argument may specify the character count, the
+ description will make this clear.</td>
+ </tr>
+
+ <tr>
+ <th align="left">char *</th>
+
+ <td>Arguments point at text buffers that Scintilla will fill with text. In some cases,
+ another argument will tell Scintilla the buffer size. In others, you must make sure that
+ the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed
+ then, for SCI_* calls, the length that should be allocated, not including any terminating
+ NUL, is returned. Some calls (marked "NUL-terminated") add a NUL character to the result but other calls do
+ not: to generically handle both types, allocate one more byte than indicated and set it to NUL.</td>
+ </tr>
+
+ <tr>
+ <th align="left" id="colour">colour</th>
+
+ <td>Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour
+ is set in the range 0 to 255. If you have three such intensities, they are combined as:
+ red | (green &lt;&lt; 8) | (blue &lt;&lt; 16). If you set all intensities to 255, the
+ colour is white. If you set all intensities to 0, the colour is black. When you set a
+ colour, you are making a request. What you will get depends on the capabilities of the
+ system and the current screen mode.</td>
+ </tr>
+
+ <tr>
+ <th align="left" id="alpha">alpha</th>
+
+ <td>Translucency is set using an alpha value.
+ Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to
+ 255 (SC_ALPHA_OPAQUE) which is opaque. The value 256 (SC_ALPHA_NOALPHA)
+ is opaque and uses code that is not alpha-aware and may be faster. Not all platforms support
+ translucency and only some Scintilla features implement translucency.
+ The default alpha value for most features is SC_ALPHA_NOALPHA.</td>
+ </tr>
+
+ <tr>
+ <th align="left">&lt;unused&gt;</th>
+
+ <td>This is an unused argument. Setting it to 0 will ensure compatibility with future
+ enhancements.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h2 id="MessageCategories">Contents</h2>
+
+ <table cellpadding="4" cellspacing="2" border="0" summary="Message categories">
+ <tbody>
+ <tr>
+ <td>o <a class="toc" href="#TextRetrievalAndModification">Text retrieval and
+ modification</a></td>
+
+ <td>o <a class="toc" href="#Searching">Searching and replacing</a></td>
+
+ <td>o <a class="toc" href="#Overtype">Overtype</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#CutCopyAndPaste">Cut, copy and paste</a></td>
+
+ <td>o <a class="toc" href="#ErrorHandling">Error handling</a></td>
+
+ <td>o <a class="toc" href="#UndoAndRedo">Undo and Redo</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#SelectionAndInformation">Selection and information</a></td>
+
+ <td>o <a class="toc" href="#MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</a></td>
+
+ <td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic
+ scrolling</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#WhiteSpace">White space</a></td>
+
+ <td>o <a class="toc" href="#Cursor">Cursor</a></td>
+
+ <td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#LineEndings">Line endings</a></td>
+
+ <td>o <a class="toc" href="#Styling">Styling</a></td>
+
+ <td>o <a class="toc" href="#StyleDefinition">Style definition</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>
+
+ <td>o <a class="toc" href="#CharacterRepresentations">Character representations</a></td>
+
+ <td>o <a class="toc" href="#Margins">Margins</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#Annotations">Annotations</a></td>
+
+ <td>o <a class="toc" href="#OtherSettings">Other settings</a></td>
+
+ <td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation
+ Guides</a></td>
+
+ <td>o <a class="toc" href="#Markers">Markers</a></td>
+
+ <td>o <a class="toc" href="#Indicators">Indicators</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>
+
+ <td>o <a class="toc" href="#UserLists">User lists</a></td>
+
+ <td>o <a class="toc" href="#CallTips">Call tips</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>
+
+ <td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>
+
+ <td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>
+
+ <td>o <a class="toc" href="#Printing">Printing</a></td>
+
+ <td>o <a class="toc" href="#DirectAccess">Direct access</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>
+
+ <td>o <a class="toc" href="#BackgroundLoadSave">Background loading and saving</a></td>
+
+ <td>o <a class="toc" href="#Folding">Folding</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>
+
+ <td>o <a class="toc" href="#Zooming">Zooming</a></td>
+
+ <td>o <a class="toc" href="#LongLines">Long lines</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#Lexer">Lexer</a></td>
+
+ <td>o <a class="toc" href="#LexerObjects">Lexer objects</a></td>
+
+ <td>o <a class="toc" href="#Notifications">Notifications</a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#Images">Images</a></td>
+
+ <td>o <a class="toc" href="#GTK">GTK+</a></td>
+
+ <td>o <a class="toc" href="#ProvisionalMessages"><span class="provisional">Provisional messages</span></a></td>
+
+ </tr>
+
+ <tr>
+ <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>
+
+ <td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never
+ supported by Scintilla</a></td>
+
+ <td>o <a class="toc" href="#BuildingScintilla">Building Scintilla</a></td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ <p>Messages with names of the form <code>SCI_SETxxxxx</code> often have a companion
+ <code>SCI_GETxxxxx</code>. To save tedious repetition, if the <code>SCI_GETxxxxx</code> message
+ returns the value set by the <code>SCI_SETxxxxx</code> message, the <code>SET</code> routine is
+ described and the <code>GET</code> routine is left to your imagination.</p>
+
+ <h2 id="TextRetrievalAndModification">Text retrieval and modification</h2>
+
+ <p>Each byte in a Scintilla document is associated with a byte of styling
+ information. The combination of a character byte and a style byte is called a cell. Style bytes
+ are interpreted an index into an array of styles.</p>
+
+ <p>In this document, 'character' normally refers to a byte even when multi-byte characters are used.
+ Lengths measure the numbers of bytes, not the amount of characters in those bytes.</p>
+
+ <p>Positions within the Scintilla document refer to a character or the gap before that
+ character. The first character in a document is 0, the second 1 and so on. If a document
+ contains <code>nLen</code> characters, the last character is numbered <code>nLen</code>-1.
+ The caret exists between character positions and can be located from before the first character (0)
+ to after the last character (<code>nLen</code>).</p>
+
+ <p>There are places where the caret can not go where two character bytes make up one character.
+ This occurs when a DBCS character from a language like Japanese is included in the document or
+ when line ends are marked with the CP/M standard of a carriage return followed by a line feed.
+ The <code>INVALID_POSITION</code> constant (-1) represents an invalid position within the
+ document.</p>
+
+ <p>All lines of text in Scintilla are the same height, and this height is calculated from the
+ largest font in any current style. This restriction is for performance; if lines differed in
+ height then calculations involving positioning of text would require the text to be styled
+ first.</p>
+ <code><a class="message" href="#SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</a><br />
+ <a class="message" href="#SCI_SETTEXT">SCI_SETTEXT(&lt;unused&gt;, const char *text)</a><br />
+ <a class="message" href="#SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</a><br />
+ <a class="message" href="#SCI_GETLINE">SCI_GETLINE(int line, char *text)</a><br />
+ <a class="message" href="#SCI_REPLACESEL">SCI_REPLACESEL(&lt;unused&gt;, const char
+ *text)</a><br />
+ <a class="message" href="#SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</a><br />
+ <a class="message" href="#SCI_GETREADONLY">SCI_GETREADONLY</a><br />
+ <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(&lt;unused&gt;, Sci_TextRange
+ *tr)</a><br />
+ <a class="message" href="#SCI_ALLOCATE">SCI_ALLOCATE(int bytes, &lt;unused&gt;)</a><br />
+ <a class="message" href="#SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</a><br />
+ <a class="message" href="#SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</a><br />
+ <a class="message" href="#SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</a><br />
+ <a class="message" href="#SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</a><br />
+ <a class="message" href="#SCI_CHANGEINSERTION">SCI_CHANGEINSERTION(int length, const char *text)</a><br />
+ <a class="message" href="#SCI_CLEARALL">SCI_CLEARALL</a><br />
+ <a class="message" href="#SCI_DELETERANGE">SCI_DELETERANGE(int pos, int deleteLength)</a><br />
+ <a class="message" href="#SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</a><br />
+ <a class="message" href="#SCI_GETCHARAT">SCI_GETCHARAT(int position)</a><br />
+ <a class="message" href="#SCI_GETSTYLEAT">SCI_GETSTYLEAT(int position)</a><br />
+ <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(&lt;unused&gt;, Sci_TextRange
+ *tr)</a><br />
+ <a class="message" href="#SCI_RELEASEALLEXTENDEDSTYLES">SCI_RELEASEALLEXTENDEDSTYLES</a><br />
+ <a class="message" href="#SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)</a><br />
+ <a class="message" href="#SCI_TARGETASUTF8">SCI_TARGETASUTF8(&lt;unused&gt;, char *s)</a><br />
+ <a class="message" href="#SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</a><br />
+ <a class="message" href="#SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</a><br />
+ </code>
+
+ <p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text NUL-terminated)</b><br />
+ This returns <code>length</code>-1 characters of text from the start of the document plus one
+ terminating 0 character. To collect all the text in a document, use <code>SCI_GETLENGTH</code>
+ to get the number of characters in the document (<code>nLen</code>), allocate a character
+ buffer of length <code>nLen+1</code> bytes, then call <code>SCI_GETTEXT(nLen+1, char
+ *text)</code>. If the text argument is 0 then the length that should be allocated to store the
+ entire document is returned.
+ If you then save the text, you should use <code>SCI_SETSAVEPOINT</code> to mark
+ the text as unmodified.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a
+ class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"
+ href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>
+
+ <p><b id="SCI_SETTEXT">SCI_SETTEXT(&lt;unused&gt;, const char *text)</b><br />
+ This replaces all the text in the document with the zero terminated text string you pass
+ in.</p>
+
+ <p><b id="SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</b><br />
+ This message tells Scintilla that the current state of the document is unmodified. This is
+ usually done when the file is saved or loaded, hence the name "save point". As Scintilla
+ performs undo and redo operations, it notifies the container that it has entered or left the
+ save point with <code><a class="message"
+ href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> and <code><a class="message"
+ href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a></code> <a class="jump"
+ href="#Notifications">notification messages</a>, allowing the container to know if the file
+ should be considered dirty or not.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a>, <a
+ class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a></code></p>
+
+ <p><b id="SCI_GETLINE">SCI_GETLINE(int line, char *text)</b><br />
+ This fills the buffer defined by text with the contents of the nominated line (lines start at
+ 0). The buffer is not terminated by a 0 character. It is up to you to make sure that the buffer
+ is long enough for the text, use <a class="message"
+ href="#SCI_LINELENGTH"><code>SCI_LINELENGTH(int line)</code></a>. The returned value is the
+ number of characters copied to the buffer. The returned text includes any end of line
+ characters. If you ask for a line number outside the range of lines in the document, 0
+ characters are copied. If the text argument is 0 then the length that should be allocated
+ to store the entire line is returned.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a
+ class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a class="message"
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>
+
+ <p><b id="SCI_REPLACESEL">SCI_REPLACESEL(&lt;unused&gt;, const char *text)</b><br />
+ The currently selected text between the <a class="jump" href="#SelectionAndInformation">anchor
+ and the current position</a> is replaced by the 0 terminated text string. If the anchor and
+ current position are the same, the text is inserted at the caret position. The caret is
+ positioned after the inserted text and the caret is scrolled into view.</p>
+
+ <p><b id="SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</b><br />
+ <b id="SCI_GETREADONLY">SCI_GETREADONLY</b><br />
+ These messages set and get the read-only flag for the document. If you mark a document as read
+ only, attempts to modify the text cause the <a class="message"
+ href="#SCN_MODIFYATTEMPTRO"><code>SCN_MODIFYATTEMPTRO</code></a> notification.</p>
+
+ <p><b id="SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(&lt;unused&gt;, <a class="jump"
+ href="#Sci_TextRange">Sci_TextRange</a> *tr)</b><br />
+ This collects the text between the positions <code>cpMin</code> and <code>cpMax</code> and
+ copies it to <code>lpstrText</code> (see <code>struct Sci_TextRange</code> in
+ <code>Scintilla.h</code>). If <code>cpMax</code> is -1, text is returned to the end of the
+ document. The text is 0 terminated, so you must supply a buffer that is at least 1 character
+ longer than the number of characters you wish to read. The return value is the length of the
+ returned text not including the terminating 0.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
+ href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>
+
+ <p><b id="SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(&lt;unused&gt;, <a class="jump"
+ href="#Sci_TextRange">Sci_TextRange</a> *tr)</b><br />
+ This collects styled text into a buffer using two bytes for each cell, with the character at
+ the lower address of each pair and the style byte at the upper address. Characters between the
+ positions <code>cpMin</code> and <code>cpMax</code> are copied to <code>lpstrText</code> (see
+ <code>struct Sci_TextRange</code> in <code>Scintilla.h</code>). Two 0 bytes are added to the end of
+ the text, so the buffer that <code>lpstrText</code> points at must be at least
+ <code>2*(cpMax-cpMin)+2</code> bytes long. No check is made for sensible values of
+ <code>cpMin</code> or <code>cpMax</code>. Positions outside the document return character codes
+ and style bytes of 0.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
+ href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>
+
+ <p><b id="SCI_ALLOCATE">SCI_ALLOCATE(int bytes, &lt;unused&gt;)</b><br />
+ Allocate a document buffer large enough to store a given number of bytes.
+ The document will not be made smaller than its current contents.</p>
+
+ <p><b id="SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</b><br />
+ This inserts the first <code>length</code> characters from the string <code>s</code>
+ at the current position. This will include any 0's in the string that you might have expected
+ to stop the insert operation. The current position is set at the end of the inserted text,
+ but it is not scrolled into view.</p>
+
+ <p><b id="SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</b><br />
+ This behaves just like <code>SCI_ADDTEXT</code>, but inserts styled text.</p>
+
+ <p><b id="SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</b><br />
+ This adds the first <code>length</code> characters from the string <code>s</code> to the end
+ of the document. This will include any 0's in the string that you might have expected to stop
+ the operation. The current selection is not changed and the new text is not scrolled into
+ view.</p>
+
+ <p><b id="SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</b><br />
+ This inserts the zero terminated <code>text</code> string at position <code>pos</code> or at
+ the current position if <code>pos</code> is -1. If the current position is after the insertion point
+ then it is moved along with its surrounding text but no scrolling is performed.</p>
+
+ <p><b id="SCI_CHANGEINSERTION">SCI_CHANGEINSERTION(int length, const char *text)</b><br />
+ This may only be called from a <a class="message" href="#SC_MOD_INSERTCHECK">SC_MOD_INSERTCHECK</a>
+ notification handler and will change the text being inserted to that provided.</p>
+
+ <p><b id="SCI_CLEARALL">SCI_CLEARALL</b><br />
+ Unless the document is read-only, this deletes all the text.</p>
+
+ <p><b id="SCI_DELETERANGE">SCI_DELETERANGE(int pos, int deleteLength)</b><br />
+ Deletes a range of text in the document.</p>
+
+ <p><b id="SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</b><br />
+ When wanting to completely restyle the document, for example after choosing a lexer, the
+ <code>SCI_CLEARDOCUMENTSTYLE</code> can be used to clear all styling information and reset the
+ folding state.</p>
+
+ <p><b id="SCI_GETCHARAT">SCI_GETCHARAT(int pos)</b><br />
+ This returns the character at <code>pos</code> in the document or 0 if <code>pos</code> is
+ negative or past the end of the document.</p>
+
+ <p><b id="SCI_GETSTYLEAT">SCI_GETSTYLEAT(int pos)</b><br />
+ This returns the style at <code>pos</code> in the document, or 0 if <code>pos</code> is
+ negative or past the end of the document.</p>
+
+ <p><b id="SCI_RELEASEALLEXTENDEDSTYLES">SCI_RELEASEALLEXTENDEDSTYLES</b><br />
+ <b id="SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)</b><br />
+ Extended styles are used for features like textual margins and annotations as well as internally by Scintilla.
+ They are outside the range 0..255 used for the styles bytes associated with document bytes.
+ These functions manage the use of extended styles to ensures that components cooperate in defining styles.
+ <code>SCI_RELEASEALLEXTENDEDSTYLES</code> releases any extended styles allocated by the container.
+ <code>SCI_ALLOCATEEXTENDEDSTYLES</code> allocates a range of style numbers after the byte style values and returns
+ the number of the first allocated style.
+ Ranges for margin and annotation styles should be allocated before calling
+ <a class="message" href="#SCI_MARGINSETSTYLEOFFSET">SCI_MARGINSETSTYLEOFFSET</a> or
+ <a class="message" href="#SCI_ANNOTATIONSETSTYLEOFFSET">SCI_ANNOTATIONSETSTYLEOFFSET</a>.</p>
+
+ <p><b id="Sci_TextRange">Sci_TextRange</b> and <b id="Sci_CharacterRange">Sci_CharacterRange</b><br />
+ These structures are defined to be exactly the same shape as the Win32 <code>TEXTRANGE</code>
+ and <code>CHARRANGE</code>, so that older code that treats Scintilla as a RichEdit will
+ work.</p>
+<pre>
+struct Sci_CharacterRange {
+ long cpMin;
+ long cpMax;
+};
+
+struct Sci_TextRange {
+ struct Sci_CharacterRange chrg;
+ char *lpstrText;
+};
+</pre>
+
+ <h3 id="EncodedAccess">Specific to GTK+, Cocoa and Windows only: Access to encoded text</h3>
+
+ <p><b id="SCI_TARGETASUTF8">SCI_TARGETASUTF8(&lt;unused&gt;, char *s)</b><br />
+ This method retrieves the value of the target encoded as UTF-8 which is the default
+ encoding of GTK+ so is useful for retrieving text for use in other parts of the user interface,
+ such as find and replace dialogs. The length of the encoded text in bytes is returned.
+ Cocoa uses UTF-16 which is easily converted from UTF-8 so this method can be used to perform the
+ more complex work of transcoding from the various encodings supported.
+ </p>
+
+ <p><b id="SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</b><br />
+ <b id="SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</b><br />
+ <code>SCI_ENCODEDFROMUTF8</code> converts a UTF-8 string into the document's
+ encoding which is useful for taking the results of a find dialog, for example, and receiving
+ a string of bytes that can be searched for in the document. Since the text can contain nul bytes,
+ the <code>SCI_SETLENGTHFORENCODE</code> method can be used to set the
+ length that will be converted. If set to -1, the length is determined by finding a nul byte.
+ The length of the converted string is returned.
+ </p>
+
+
+ <h2 id="Searching">Searching</h2>
+ <p>
+ There are methods to search for text and for regular expressions.
+ Most applications should use
+ <a class="message" href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET</a>
+ as the basis for their search implementations.
+ Other calls augment this or were implemented before <code>SCI_SEARCHINTARGET</code>.
+ </p>
+ <p>
+ The base regular expression support
+ is limited and should only be used for simple cases and initial development.
+ <span class="provisional">When using a C++11 compliant compiler and runtime, it may be possible to use the
+ runtime's implementation of &lt;regex&gt; by compiling Scintilla with <code>CXX11_REGEX</code> defined.</span>
+ A different regular expression
+ library can be <a class="jump" href="#AlternativeRegEx">integrated into Scintilla</a>
+ or can be called from the container using direct access to the buffer contents through
+ <a class="message" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a>.
+ </p>
+
+ <h3 id="SearchAndReplaceUsingTheTarget">Search and replace using the target</h3>
+
+ <p>Searching can be performed within the target range with <code>SCI_SEARCHINTARGET</code>,
+ which uses a counted string to allow searching for null characters. It returns the
+ position of the start of the matching text range or -1 for failure, in which case the target is not moved. The flags used by
+ <code>SCI_SEARCHINTARGET</code> such as <code>SCFIND_MATCHCASE</code>,
+ <code>SCFIND_WHOLEWORD</code>, <code>SCFIND_WORDSTART</code>, and <code>SCFIND_REGEXP</code>
+ can be set with <code>SCI_SETSEARCHFLAGS</code>.</p>
+ <code><a class="message" href="#SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</a><br />
+ <a class="message" href="#SCI_GETTARGETSTART">SCI_GETTARGETSTART</a><br />
+ <a class="message" href="#SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</a><br />
+ <a class="message" href="#SCI_GETTARGETEND">SCI_GETTARGETEND</a><br />
+ <a class="message" href="#SCI_SETTARGETRANGE">SCI_SETTARGETRANGE(int start, int end)</a><br />
+ <a class="message" href="#SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</a><br />
+ <a class="message" href="#SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</a><br />
+ <a class="message" href="#SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</a><br />
+ <a class="message" href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char
+ *text)</a><br />
+ <a class="message" href="#SCI_GETTARGETTEXT">SCI_GETTARGETTEXT(&lt;unused&gt;,
+ char *text)</a><br />
+ <a class="message" href="#SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char
+ *text)</a><br />
+ <a class="message" href="#SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char
+ *text)</a><br />
+ <a class="message" href="#SCI_GETTAG">SCI_GETTAG(int tagNumber, char *tagValue)</a><br />
+ </code>
+
+ <p><b id="SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</b><br />
+ <b id="SCI_GETTARGETSTART">SCI_GETTARGETSTART</b><br />
+ <b id="SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</b><br />
+ <b id="SCI_GETTARGETEND">SCI_GETTARGETEND</b><br />
+ <b id="SCI_SETTARGETRANGE">SCI_SETTARGETRANGE(int start, int end)</b><br />
+ These functions set and return the start and end of the target. When searching
+ you can set start greater than end to find the last matching text in the
+ target rather than the first matching text. The target is also set by a successful
+ <code>SCI_SEARCHINTARGET</code>.</p>
+
+ <p><b id="SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</b><br />
+ Set the target start and end to the start and end positions of the selection.</p>
+
+ <p><b id="SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</b><br />
+ <b id="SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</b><br />
+ These get and set the <a class="jump" href="#searchFlags"><code>searchFlags</code></a> used by
+ <code>SCI_SEARCHINTARGET</code>. There are several option flags including a simple regular
+ expression search.</p>
+
+ <p><b id="SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char *text)</b><br />
+ This searches for the first occurrence of a text string in the target defined by
+ <code>SCI_SETTARGETSTART</code> and <code>SCI_SETTARGETEND</code>. The text string is not zero
+ terminated; the size is set by <code>length</code>. The search is modified by the search flags
+ set by <code>SCI_SETSEARCHFLAGS</code>. If the search succeeds, the target is set to the found
+ text and the return value is the position of the start of the matching text. If the search
+ fails, the result is -1.</p>
+
+ <p><b id="SCI_GETTARGETTEXT">SCI_GETTARGETTEXT(&lt;unused&gt;, char *text)</b><br />
+ Retrieve the value in the target.</p>
+
+ <p><b id="SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char *text)</b><br />
+ If <code>length</code> is -1, <code>text</code> is a zero terminated string, otherwise
+ <code>length</code> sets the number of character to replace the target with.
+ After replacement, the target range refers to the replacement text.
+ The return value
+ is the length of the replacement string.<br />
+ Note that the recommended way to delete text in the document is to set the target to the text to be removed,
+ and to perform a replace target with an empty string.</p>
+
+ <p><b id="SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char *text)</b><br />
+ This replaces the target using regular expressions. If <code>length</code> is -1,
+ <code>text</code> is a zero terminated string, otherwise <code>length</code> is the number of
+ characters to use. The replacement string is formed from the text string with any sequences of
+ <code>\1</code> through <code>\9</code> replaced by tagged matches from the most recent regular
+ expression search. <code>\0</code> is replaced with all the matched text from the most recent search.
+ After replacement, the target range refers to the replacement text.
+ The return value is the length of the replacement string.</p>
+
+ <p><b id="SCI_GETTAG">SCI_GETTAG(int tagNumber, char *tagValue NUL-terminated)</b><br />
+ Discover what text was matched by tagged expressions in a regular expression search.
+ This is useful if the application wants to interpret the replacement string itself.</p>
+
+ <p>See also: <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>
+
+ <p><b id="searchFlags"><code>searchFlags</code></b><br />
+ Several of the search routines use flag options, which include a simple regular expression
+ search. Combine the flag options by adding them:</p>
+
+ <table border="0" summary="Search flags">
+ <tbody>
+ <tr>
+ <td><code>SCFIND_MATCHCASE</code></td>
+
+ <td>A match only occurs with text that matches the case of the search string.</td>
+ </tr>
+
+ <tr>
+ <td><code>SCFIND_WHOLEWORD</code></td>
+
+ <td>A match only occurs if the characters before and after are not word characters.</td>
+ </tr>
+
+ <tr>
+ <td><code>SCFIND_WORDSTART</code></td>
+
+ <td>A match only occurs if the character before is not a word character.</td>
+ </tr>
+
+ <tr>
+ <td><code>SCFIND_REGEXP</code></td>
+
+ <td>The search string should be interpreted as a regular expression.</td>
+ </tr>
+ <tr>
+ <td><code>SCFIND_POSIX</code></td>
+
+ <td>Treat regular expression in a more POSIX compatible manner
+ by interpreting bare ( and ) for tagged sections rather than \( and \).</td>
+ </tr>
+ <tr class="provisional">
+ <td><code>SCFIND_CXX11REGEX</code></td>
+
+ <td>When compiled with <code>CXX11_REGEX</code> this flag
+ may be set to use &lt;regex&gt; instead of Scintilla's basic regular expressions.
+ If the regular expression is invalid then -1 is returned and status is set to
+ <code>SC_STATUS_WARN_REGEX</code>.
+ The ECMAScript flag is set on the regex object and UTF-8 documents will exhibit Unicode-compliant
+ behaviour. For MSVC, where wchar_t is 16-bits, the reular expression ".." will match a single
+ astral-plane character. There may be other differences between compilers.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>In a regular expression, special characters interpreted are:</p>
+
+ <table border="0" summary="Regular expression synopsis">
+ <tbody>
+ <tr>
+ <td><code>.</code></td>
+
+ <td>Matches any character</td>
+ </tr>
+
+ <tr>
+ <td><code>\(</code></td>
+
+ <td>This marks the start of a region for tagging a match.</td>
+ </tr>
+
+ <tr>
+ <td><code>\)</code></td>
+
+ <td>This marks the end of a tagged region.</td>
+ </tr>
+
+ <tr>
+ <td><code>\n</code></td>
+
+ <td>Where <code>n</code> is 1 through 9 refers to the first through ninth tagged region
+ when replacing. For example, if the search string was <code>Fred\([1-9]\)XXX</code> and
+ the replace string was <code>Sam\1YYY</code>, when applied to <code>Fred2XXX</code> this
+ would generate <code>Sam2YYY</code>.
+ <code>\0</code> refers to all of the matching text.</td>
+ </tr>
+
+ <tr>
+ <td><code>\&lt;</code></td>
+
+ <td>This matches the start of a word using Scintilla's definitions of words.</td>
+ </tr>
+
+ <tr>
+ <td><code>\&gt;</code></td>
+
+ <td>This matches the end of a word using Scintilla's definition of words.</td>
+ </tr>
+
+ <tr>
+ <td><code>\x</code></td>
+
+ <td>This allows you to use a character x that would otherwise have a special meaning. For
+ example, \[ would be interpreted as [ and not as the start of a character set.</td>
+ </tr>
+
+ <tr>
+ <td><code>[...]</code></td>
+
+ <td>This indicates a set of characters, for example, [abc] means any of the characters a,
+ b or c. You can also use ranges, for example [a-z] for any lower case character.</td>
+ </tr>
+
+ <tr>
+ <td><code>[^...]</code></td>
+
+ <td>The complement of the characters in the set. For example, [^A-Za-z] means any
+ character except an alphabetic character.</td>
+ </tr>
+
+ <tr>
+ <td><code>^</code></td>
+
+ <td>This matches the start of a line (unless used inside a set, see above).</td>
+ </tr>
+
+ <tr>
+ <td><code>$</code></td>
+
+ <td>This matches the end of a line.</td>
+ </tr>
+
+ <tr>
+ <td><code>*</code></td>
+
+ <td>This matches 0 or more times. For example, <code>Sa*m</code> matches <code>Sm</code>,
+ <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>
+ </tr>
+
+ <tr>
+ <td><code>+</code></td>
+
+ <td>This matches 1 or more times. For example, <code>Sa+m</code> matches
+ <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>Regular expressions will only match ranges within a single line, never matching over multiple lines.</p>
+
+ <code><a class="message" href="#SCI_FINDTEXT">SCI_FINDTEXT(int flags, Sci_TextToFind
+ *ttf)</a><br />
+ <a class="message" href="#SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</a><br />
+ <a class="message" href="#SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char
+ *text)</a><br />
+ <a class="message" href="#SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char
+ *text)</a><br />
+ </code>
+
+ <p><b id="SCI_FINDTEXT">SCI_FINDTEXT(int searchFlags, <a class="jump"
+ href="#Sci_TextToFind">Sci_TextToFind</a> *ttf)</b><br />
+ This message searches for text in the document. It does not use or move the current selection.
+ The <a class="jump" href="#searchFlags"><code>searchFlags</code></a> argument controls the
+ search type, which includes regular expression searches.</p>
+
+ <p>You can
+ search backwards to find the previous occurrence of a search string by setting the end of the
+ search range before the start.</p>
+
+ <p>The <code>Sci_TextToFind</code> structure is defined in <code>Scintilla.h</code>; set
+ <code>chrg.cpMin</code> and <code>chrg.cpMax</code> with the range of positions in the document
+ to search. You can search backwards by
+ setting <code>chrg.cpMax</code> less than <code>chrg.cpMin</code>.
+ Set the <code>lpstrText</code> member of <code>Sci_TextToFind</code> to point at a zero terminated
+ text string holding the search pattern. If your language makes the use of <code>Sci_TextToFind</code>
+ difficult, you should consider using <code>SCI_SEARCHINTARGET</code> instead.</p>
+
+ <p>The return value is -1 if the search fails or the position of the start of the found text if
+ it succeeds. The <code>chrgText.cpMin</code> and <code>chrgText.cpMax</code> members of
+ <code>Sci_TextToFind</code> are filled in with the start and end positions of the found text.</p>
+
+ <p>See also: <code><a class="message"
+ href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET</a></code></p>
+
+ <p><b id="Sci_TextToFind">Sci_TextToFind</b><br />
+ This structure is defined to have exactly the same shape as the Win32 structure
+ <code>FINDTEXTEX</code> for old code that treated Scintilla as a RichEdit control.</p>
+<pre>
+struct Sci_TextToFind {
+ struct <a class="jump" href="#Sci_CharacterRange">Sci_CharacterRange</a> chrg; // range to search
+ const char *lpstrText; // the search pattern (zero terminated)
+ struct Sci_CharacterRange chrgText; // returned as position of matching text
+};
+</pre>
+
+ <p><b id="SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</b><br />
+ <b id="SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char *text)</b><br />
+ <b id="SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char *text)</b><br />
+ These messages provide relocatable search support. This allows multiple incremental
+ interactive searches to be macro recorded while still setting the selection to found text so
+ the find/select operation is self-contained. These three messages send <a class="message"
+ href="#SCN_MACRORECORD"><code>SCN_MACRORECORD</code></a> <a class="jump"
+ href="#Notifications">notifications</a> if macro recording is enabled.</p>
+
+ <p><code>SCI_SEARCHANCHOR</code> sets the search start point used by
+ <code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> to the start of the current
+ selection, that is, the end of the selection that is nearer to the start of the document. You
+ should always call this before calling either of <code>SCI_SEARCHNEXT</code> or
+ <code>SCI_SEARCHPREV</code>.</p>
+
+ <p><code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> search for the next and previous
+ occurrence of the zero terminated search string pointed at by text. The search is modified by
+ the <a class="jump" href="#searchFlags"><code>searchFlags</code></a>. </p>
+
+ <p>The return value is -1 if nothing is found, otherwise the return value is the start position
+ of the matching text. The selection is updated to show the matched text, but is not scrolled
+ into view.</p>
+
+ <p>See also: <a class="message" href="#SCI_SEARCHINTARGET"><code>SCI_SEARCHINTARGET</code></a>,
+ <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>
+
+ <h2 id="Overtype">Overtype</h2>
+
+ <p><b id="SCI_SETOVERTYPE">SCI_SETOVERTYPE(bool overType)</b><br />
+ <b id="SCI_GETOVERTYPE">SCI_GETOVERTYPE</b><br />
+ When overtype is enabled, each typed character replaces the character to the right of the text
+ caret. When overtype is disabled, characters are inserted at the caret.
+ <code>SCI_GETOVERTYPE</code> returns <code>TRUE</code> (1) if overtyping is active, otherwise
+ <code>FALSE</code> (0) will be returned. Use <code>SCI_SETOVERTYPE</code> to set the overtype
+ mode.</p>
+
+ <h2 id="CutCopyAndPaste">Cut, copy and paste</h2>
+
+ <code><a class="message" href="#SCI_CUT">SCI_CUT</a><br />
+ <a class="message" href="#SCI_COPY">SCI_COPY</a><br />
+ <a class="message" href="#SCI_PASTE">SCI_PASTE</a><br />
+ <a class="message" href="#SCI_CLEAR">SCI_CLEAR</a><br />
+ <a class="message" href="#SCI_CANPASTE">SCI_CANPASTE</a><br />
+ <a class="message" href="#SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</a><br />
+ <a class="message" href="#SCI_COPYTEXT">SCI_COPYTEXT(int length,
+ const char *text)</a><br />
+ <a class="message" href="#SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</a><br />
+ <a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br />
+ <a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</a><br />
+ </code>
+
+ <p><b id="SCI_CUT">SCI_CUT</b><br />
+ <b id="SCI_COPY">SCI_COPY</b><br />
+ <b id="SCI_PASTE">SCI_PASTE</b><br />
+ <b id="SCI_CLEAR">SCI_CLEAR</b><br />
+ <b id="SCI_CANPASTE">SCI_CANPASTE</b><br />
+ <b id="SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</b><br />
+ These commands perform the standard tasks of cutting and copying data to the clipboard,
+ pasting from the clipboard into the document, and clearing the document.
+ <code>SCI_CANPASTE</code> returns non-zero if the document isn't read-only and if the selection
+ doesn't contain protected text. If you need a "can copy" or "can cut", use
+ <code>SCI_GETSELECTIONEMPTY()</code>, which will be zero if there are any non-empty
+ selection ranges implying that a copy or cut to the clipboard should work.</p>
+
+ <p>GTK+ does not really support <code>SCI_CANPASTE</code> and always returns <code>TRUE</code>
+ unless the document is read-only.</p>
+
+ <p>On X, the clipboard is asynchronous and may require several messages between
+ the destination and source applications. Data from SCI_PASTE will not arrive in the
+ document immediately.</p>
+
+ <p><code>SCI_COPYALLOWLINE</code> works the same as SCI_COPY except that if the
+ selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker
+ is added to the clipboard which is then used in <code>SCI_PASTE</code> to paste
+ the whole line before the current line.</p>
+
+ <b id="SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</b><br />
+ <b id="SCI_COPYTEXT">SCI_COPYTEXT(int length, const char *text)</b><br />
+ <p><code>SCI_COPYRANGE</code> copies a range of text from the document to
+ the system clipboard and <code>SCI_COPYTEXT</code> copies a supplied piece of
+ text to the system clipboard.</p>
+
+ <p><b id="SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</b><br />
+ <b id="SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</b><br />
+ If this property is set then when text is pasted any line ends are converted to match the document's
+ end of line mode as set with
+ <a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE</a>.
+ Defaults to true.</p>
+
+ <h2 id="ErrorHandling">Error handling</h2>
+
+ <p><b id="SCI_SETSTATUS">SCI_SETSTATUS(int status)</b><br />
+ <b id="SCI_GETSTATUS">SCI_GETSTATUS</b><br />
+ If an error occurs, Scintilla may set an internal error number that can be retrieved with
+ <code>SCI_GETSTATUS</code>.
+ To clear the error status call <code>SCI_SETSTATUS(0)</code>.
+ Status values from 1 to 999 are errors and status <code>SC_STATUS_WARN_START</code> (1000)
+ and above are warnings.
+ The currently defined statuses are:
+ </p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Status values">
+ <tbody valign="top">
+ <tr>
+ <th align="left">SC_STATUS_OK</th>
+ <td>0</td>
+ <td>No failures</td>
+ </tr>
+
+ <tr>
+ <th align="left">SC_STATUS_FAILURE</th>
+ <td>1</td>
+ <td>Generic failure</td>
+ </tr>
+
+ <tr class="provisional">
+ <th align="left">SC_STATUS_BADALLOC</th>
+ <td>2</td>
+ <td>Memory is exhausted</td>
+ </tr>
+
+ <tr>
+ <th align="left">SC_STATUS_WARN_REGEX</th>
+ <td>1001</td>
+ <td>Regular expression is invalid</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h2 id="UndoAndRedo">Undo and Redo</h2>
+
+ <p>Scintilla has multiple level undo and redo. It will continue to collect undoable actions
+ until memory runs out. Scintilla saves actions that change the document. Scintilla does not
+ save caret and selection movements, view scrolling and the like. Sequences of typing or
+ deleting are compressed into single transactions to make it easier to undo and redo at a sensible
+ level of detail. Sequences of actions can be combined into transactions that are undone as a unit.
+ These sequences occur between <code>SCI_BEGINUNDOACTION</code> and
+ <code>SCI_ENDUNDOACTION</code> messages. These transactions can be nested and only the top-level
+ sequences are undone as units.</p>
+ <code><a class="message" href="#SCI_UNDO">SCI_UNDO</a><br />
+ <a class="message" href="#SCI_CANUNDO">SCI_CANUNDO</a><br />
+ <a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a><br />
+ <a class="message" href="#SCI_REDO">SCI_REDO</a><br />
+ <a class="message" href="#SCI_CANREDO">SCI_CANREDO</a><br />
+ <a class="message" href="#SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool
+ collectUndo)</a><br />
+ <a class="message" href="#SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</a><br />
+ <a class="message" href="#SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</a><br />
+ <a class="message" href="#SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</a><br />
+ <a class="message" href="#SCI_ADDUNDOACTION">SCI_ADDUNDOACTION(int token, int flags)</a><br />
+ </code>
+
+ <p><b id="SCI_UNDO">SCI_UNDO</b><br />
+ <b id="SCI_CANUNDO">SCI_CANUNDO</b><br />
+ <code>SCI_UNDO</code> undoes one action, or if the undo buffer has reached a
+ <code>SCI_ENDUNDOACTION</code> point, all the actions back to the corresponding
+ <code>SCI_BEGINUNDOACTION</code>.</p>
+
+ <p><code>SCI_CANUNDO</code> returns 0 if there is nothing to undo, and 1 if there is. You would
+ typically use the result of this message to enable/disable the Edit menu Undo command.</p>
+
+ <p><b id="SCI_REDO">SCI_REDO</b><br />
+ <b id="SCI_CANREDO">SCI_CANREDO</b><br />
+ <code>SCI_REDO</code> undoes the effect of the last <code>SCI_UNDO</code> operation.</p>
+
+ <p><code>SCI_CANREDO</code> returns 0 if there is no action to redo and 1 if there are undo
+ actions to redo. You could typically use the result of this message to enable/disable the Edit
+ menu Redo command.</p>
+
+ <p><b id="SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</b><br />
+ This command tells Scintilla to forget any saved undo or redo history. It also sets the save
+ point to the start of the undo buffer, so the document will appear to be unmodified. This does
+ not cause the <code><a class="message"
+ href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> notification to be sent to the
+ container.</p>
+
+ <p>See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a></p>
+
+ <p><b id="SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool collectUndo)</b><br />
+ <b id="SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</b><br />
+ You can control whether Scintilla collects undo information with
+ <code>SCI_SETUNDOCOLLECTION</code>. Pass in <code>true</code> (1) to collect information and
+ <code>false</code> (0) to stop collecting. If you stop collection, you should also use
+ <code>SCI_EMPTYUNDOBUFFER</code> to avoid the undo buffer being unsynchronized with the data in
+ the buffer.</p>
+
+ <p>You might wish to turn off saving undo information if you use the Scintilla to store text
+ generated by a program (a Log view) or in a display window where text is often deleted and
+ regenerated.</p>
+
+ <p><b id="SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</b><br />
+ <b id="SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</b><br />
+ Send these two messages to Scintilla to mark the beginning and end of a set of operations that
+ you want to undo all as one operation but that you have to generate as several operations.
+ Alternatively, you can use these to mark a set of operations that you do not want to have
+ combined with the preceding or following operations if they are undone.</p>
+
+ <p><b id="SCI_ADDUNDOACTION">SCI_ADDUNDOACTION(int token, int flags)</b><br />
+ The container can add its own actions into the undo stack by calling
+ <code>SCI_ADDUNDOACTION</code> and an <code>SCN_MODIFIED</code>
+ notification will be sent to the container with the
+ <a class="message" href="#SC_MOD_CONTAINER"><code>SC_MOD_CONTAINER</code></a>
+ flag when it is time to undo (<code>SC_PERFORMED_UNDO</code>) or
+ redo (<code>SC_PERFORMED_REDO</code>) the action. The token argument supplied is
+ returned in the <code>token</code> field of the notification.</p>
+ <p>For example, if the container wanted to allow undo and redo of a 'toggle bookmark' command then
+ it could call <code>SCI_ADDUNDOACTION(line, 0)</code> each time the command is performed.
+ Then when it receives a notification to undo or redo it toggles a bookmark on the line given by
+ the token field. If there are different types of commands or parameters that need to be stored into the undo
+ stack then the container should maintain a stack of its own for the document and use the current
+ position in that stack as the argument to <code>SCI_ADDUNDOACTION(line)</code>.
+ <code>SCI_ADDUNDOACTION</code> commands are not combined together
+ into a single undo transaction unless grouped with <code>SCI_BEGINUNDOACTION</code>
+ and <code>SCI_ENDUNDOACTION</code>.</p>
+
+ <p>The flags argument can be <code>UNDO_MAY_COALESCE</code> (1) if the container action may be
+ coalesced along with any insertion and deletion actions into a single compound action, otherwise 0.
+ Coalescing treats coalescible container actions as transparent so will still only group together insertions that
+ look like typing or deletions that look like multiple uses of the Backspace or Delete keys.
+ </p>
+ <h2 id="SelectionAndInformation">Selection and information</h2>
+
+ <p>Scintilla maintains a selection that stretches between two points, the anchor and the
+ current position. If the anchor and the current position are the same, there is no selected
+ text. Positions in the document range from 0 (before the first character), to the document size
+ (after the last character). If you use messages, there is nothing to stop you setting a
+ position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. However,
+ keyboard commands will not move the caret into such positions.</p>
+ <code><a class="message" href="#SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</a><br />
+ <a class="message" href="#SCI_GETLENGTH">SCI_GETLENGTH</a><br />
+ <a class="message" href="#SCI_GETLINECOUNT">SCI_GETLINECOUNT</a><br />
+ <a class="message" href="#SCI_SETFIRSTVISIBLELINE">SCI_SETFIRSTVISIBLELINE(int lineDisplay)</a><br />
+ <a class="message" href="#SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</a><br />
+ <a class="message" href="#SCI_LINESONSCREEN">SCI_LINESONSCREEN</a><br />
+ <a class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a><br />
+ <a class="message" href="#SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</a><br />
+ <a class="message" href="#SCI_GOTOPOS">SCI_GOTOPOS(int position)</a><br />
+ <a class="message" href="#SCI_GOTOLINE">SCI_GOTOLINE(int line)</a><br />
+ <a class="message" href="#SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int position)</a><br />
+ <a class="message" href="#SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</a><br />
+ <a class="message" href="#SCI_SETANCHOR">SCI_SETANCHOR(int position)</a><br />
+ <a class="message" href="#SCI_GETANCHOR">SCI_GETANCHOR</a><br />
+ <a class="message" href="#SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int position)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</a><br />
+ <a class="message" href="#SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int position)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</a><br />
+ <a class="message" href="#SCI_SETEMPTYSELECTION">SCI_SETEMPTYSELECTION(int pos)</a><br />
+ <a class="message" href="#SCI_SELECTALL">SCI_SELECTALL</a><br />
+ <a class="message" href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int position)</a><br />
+ <a class="message" href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</a><br />
+ <a class="message" href="#SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</a><br />
+ <a class="message" href="#SCI_LINELENGTH">SCI_LINELENGTH(int line)</a><br />
+ <a class="message" href="#SCI_GETCOLUMN">SCI_GETCOLUMN(int position)</a><br />
+ <a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br />
+ <a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br />
+ <a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int
+ y)</a><br />
+ <a class="message" href="#SCI_CHARPOSITIONFROMPOINT">SCI_CHARPOSITIONFROMPOINT(int x, int y)</a><br />
+ <a class="message" href="#SCI_CHARPOSITIONFROMPOINTCLOSE">SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int
+ y)</a><br />
+ <a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int
+ position)</a><br />
+ <a class="message" href="#SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int
+ position)</a><br />
+ <a class="message" href="#SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</a><br />
+ <a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text)</a><br />
+ <a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</a><br />
+ <a class="message" href="#SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</a><br />
+ <a class="message" href="#SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</a><br />
+ <a class="message" href="#SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</a><br />
+ <a class="message" href="#SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</a><br />
+ <a class="message" href="#SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</a><br />
+ <a class="message" href="#SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool
+ onlyWordCharacters)</a><br />
+ <a class="message" href="#SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool
+ onlyWordCharacters)</a><br />
+ <a class="message" href="#SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</a><br />
+ <a class="message" href="#SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</a><br />
+ <a class="message" href="#SCI_POSITIONRELATIVE">SCI_POSITIONRELATIVE(int position, int relative)</a><br />
+ <a class="message" href="#SCI_COUNTCHARACTERS">SCI_COUNTCHARACTERS(int startPos, int endPos)</a><br />
+ <a class="message" href="#SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</a><br />
+ <a class="message" href="#SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</a><br />
+ <a class="message" href="#SCI_CHOOSECARETX">SCI_CHOOSECARETX</a><br />
+ <a class="message" href="#SCI_MOVESELECTEDLINESUP">SCI_MOVESELECTEDLINESUP</a><br />
+ <a class="message" href="#SCI_MOVESELECTEDLINESDOWN">SCI_MOVESELECTEDLINESDOWN</a><br />
+ <a class="message" href="#SCI_SETMOUSESELECTIONRECTANGULARSWITCH">SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool
+ mouseSelectionRectangularSwitch)</a><br />
+ <a class="message" href="#SCI_GETMOUSESELECTIONRECTANGULARSWITCH">SCI_GETMOUSESELECTIONRECTANGULARSWITCH</a><br />
+ </code>
+
+ <p><b id="SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</b><br />
+ <b id="SCI_GETLENGTH">SCI_GETLENGTH</b><br />
+ Both these messages return the length of the document in bytes.</p>
+
+ <p><b id="SCI_GETLINECOUNT">SCI_GETLINECOUNT</b><br />
+ This returns the number of lines in the document. An empty document contains 1 line. A
+ document holding only an end of line sequence has 2 lines.</p>
+
+ <p><b id="SCI_SETFIRSTVISIBLELINE">SCI_SETFIRSTVISIBLELINE(int lineDisplay)</b><br />
+ <b id="SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</b><br />
+ These messages retrieve and set the line number of the first visible line in the Scintilla view. The first line
+ in the document is numbered 0. The value is a visible line rather than a document line.</p>
+
+ <p><b id="SCI_LINESONSCREEN">SCI_LINESONSCREEN</b><br />
+ This returns the number of complete lines visible on the screen. With a constant line height,
+ this is the vertical space available divided by the line separation. Unless you arrange to size
+ your window to an integral number of lines, there may be a partial line visible at the bottom
+ of the view.</p>
+
+ <p><b id="SCI_GETMODIFY">SCI_GETMODIFY</b><br />
+ This returns non-zero if the document is modified and 0 if it is unmodified. The modified
+ status of a document is determined by the undo position relative to the save point. The save
+ point is set by <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>,
+ usually when you have saved data to a file.</p>
+
+ <p>If you need to be notified when the document becomes modified, Scintilla notifies the
+ container that it has entered or left the save point with the <a class="message"
+ href="#SCN_SAVEPOINTREACHED"><code>SCN_SAVEPOINTREACHED</code></a> and <a class="message"
+ href="#SCN_SAVEPOINTLEFT"><code>SCN_SAVEPOINTLEFT</code></a> <a class="jump"
+ href="#Notifications">notification messages</a>.</p>
+
+ <p><b id="SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</b><br />
+ This message sets both the anchor and the current position. If <code>currentPos</code> is
+ negative, it means the end of the document. If <code>anchorPos</code> is negative, it means
+ remove any selection (i.e. set the anchor to the same position as <code>currentPos</code>). The
+ caret is scrolled into view after this operation.</p>
+
+ <p><b id="SCI_GOTOPOS">SCI_GOTOPOS(int pos)</b><br />
+ This removes any selection, sets the caret at <code>pos</code> and scrolls the view to make
+ the caret visible, if necessary. It is equivalent to
+ <code>SCI_SETSEL(pos, pos)</code>. The anchor position is set the same as the current
+ position.</p>
+
+ <p><b id="SCI_GOTOLINE">SCI_GOTOLINE(int line)</b><br />
+ This removes any selection and sets the caret at the start of line number <code>line</code>
+ and scrolls the view (if needed) to make it visible. The anchor position is set the same as the
+ current position. If <code>line</code> is outside the lines in the document (first line is 0),
+ the line set is the first or last.</p>
+
+ <p><b id="SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int pos)</b><br />
+ This sets the current position and creates a selection between the anchor and the current
+ position. The caret is not scrolled into view.</p>
+
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
+
+ <p><b id="SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</b><br />
+ This returns the current position.</p>
+
+ <p><b id="SCI_SETANCHOR">SCI_SETANCHOR(int pos)</b><br />
+ This sets the anchor position and creates a selection between the anchor position and the
+ current position. The caret is not scrolled into view.</p>
+
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
+
+ <p><b id="SCI_GETANCHOR">SCI_GETANCHOR</b><br />
+ This returns the current anchor position.</p>
+
+ <p><b id="SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int pos)</b><br />
+ <b id="SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int pos)</b><br />
+ These set the selection based on the assumption that the anchor position is less than the
+ current position. They do not make the caret visible. The table shows the positions of the
+ anchor and the current position after using these messages.</p>
+
+ <table cellpadding="3" cellspacing="0" border="1" summary="SetSelection caret positioning">
+ <thead align="center">
+ <tr>
+ <th>
+ </th>
+
+ <th>anchor</th>
+
+ <th>current</th>
+ </tr>
+ </thead>
+
+ <tbody align="center">
+ <tr>
+ <th><code>SCI_SETSELECTIONSTART</code></th>
+
+ <td><code>pos</code></td>
+
+ <td><code>Max(pos, current)</code></td>
+ </tr>
+
+ <tr>
+ <th><code>SCI_SETSELECTIONEND</code></th>
+
+ <td><code>Min(anchor, pos)</code></td>
+
+ <td><code>pos</code></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
+
+ <p><b id="SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</b><br />
+ <b id="SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</b><br />
+ These return the start and end of the selection without regard to which end is the current
+ position and which is the anchor. <code>SCI_GETSELECTIONSTART</code> returns the smaller of the
+ current position or the anchor position. <code>SCI_GETSELECTIONEND</code> returns the larger of
+ the two values.</p>
+
+ <p><b id="SCI_SETEMPTYSELECTION">SCI_SETEMPTYSELECTION(int pos)</b><br />
+ This removes any selection and sets the caret at <code>pos</code>. The caret is not scrolled into view.</p>
+
+ <p><b id="SCI_SELECTALL">SCI_SELECTALL</b><br />
+ This selects all the text in the document. The current position is not scrolled into view.</p>
+
+ <p><b id="SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int pos)</b><br />
+ This message returns the line that contains the position <code>pos</code> in the document. The
+ return value is 0 if <code>pos</code> &lt;= 0. The return value is the last line if
+ <code>pos</code> is beyond the end of the document.</p>
+
+ <p><b id="SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</b><br />
+ This returns the document position that corresponds with the start of the line. If
+ <code>line</code> is negative, the position of the line holding the start of the selection is
+ returned. If <code>line</code> is greater than the lines in the document, the return value is
+ -1. If <code>line</code> is equal to the number of lines in the document (i.e. 1 line past the
+ last line), the return value is the end of the document.</p>
+
+ <p><b id="SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</b><br />
+ This returns the position at the end of the line, before any line end characters. If <code>line</code>
+ is the last line in the document (which does not have any end of line characters) or greater,
+ the result is the size of the document.
+ If <code>line</code> is negative the result is undefined.</p>
+
+ <p><b id="SCI_LINELENGTH">SCI_LINELENGTH(int line)</b><br />
+ This returns the length of the line, including any line end characters. If <code>line</code>
+ is negative or beyond the last line in the document, the result is 0. If you want the length of
+ the line not including any end of line characters, use <a class="message"
+ href="#SCI_GETLINEENDPOSITION"><code>SCI_GETLINEENDPOSITION(line)</code></a> - <a class="message"
+ href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p>
+
+ <p><b id="SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text NUL-terminated)</b><br />
+ This copies the currently selected text and a terminating 0 byte to the <code>text</code>
+ buffer. The buffer size should be determined by calling with a NULL pointer for the <code>text</code> argument
+ <code>SCI_GETSELTEXT(0,0)</code>.
+ This allows for rectangular and discontiguous selections as well as simple selections.
+ See <a class="toc" href="#MultipleSelectionAndVirtualSpace">Multiple Selection</a> for information on
+ how multiple and rectangular selections and virtual space are copied.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>,
+ <a class="message" href="#SCI_GETLINE">SCI_GETLINE</a>,
+ <a class="message" href="#SCI_GETTEXT">SCI_GETTEXT</a>,
+ <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>,
+ <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>
+ </code></p>
+
+ <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text NUL-terminated)</b><br />
+ This retrieves the text of the line containing the caret and returns the position within the
+ line of the caret. Pass in <code>char* text</code> pointing at a buffer large enough to hold
+ the text you wish to retrieve and a terminating 0 character.
+ Set <code>textLen</code> to the
+ length of the buffer which must be at least 1 to hold the terminating 0 character.
+ If the text argument is 0 then the length that should be allocated
+ to store the entire current line is returned.</p>
+
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
+ href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>
+
+ <p><b id="SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</b><br />
+ This returns 1 if the current selection is in rectangle mode, 0 if not.</p>
+
+ <p><b id="SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</b><br />
+ <b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br />
+ The two functions set and get the selection mode, which can be
+ stream (<code>SC_SEL_STREAM</code>=0) or
+ rectangular (<code>SC_SEL_RECTANGLE</code>=1) or
+ by lines (<code>SC_SEL_LINES</code>=2)
+ or thin rectangular (<code>SC_SEL_THIN</code>=3).
+ When set in these modes, regular caret moves will extend or reduce the selection,
+ until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>.
+ The get function returns the current mode even if the selection was made by mouse
+ or with regular extended moves.
+ <code>SC_SEL_THIN</code> is the mode after a rectangular selection has been typed into and ensures
+ that no characters are selected.</p>
+
+ <p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br />
+ <b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br />
+ Retrieve the position of the start and end of the selection at the given line with
+ <code>INVALID_POSITION</code> returned if no selection on this line.</p>
+
+ <p><b id="SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</b><br />
+ If the caret is off the top or bottom of the view, it is moved to the nearest line that is
+ visible to its current position. Any selection is lost.</p>
+
+ <p><b id="SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool
+ onlyWordCharacters)</b><br />
+ <b id="SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool
+ onlyWordCharacters)</b><br />
+ These messages return the start and end of words using the same definition of words as used
+ internally within Scintilla. You can set your own list of characters that count as words with
+ <a class="message" href="#SCI_SETWORDCHARS"><code>SCI_SETWORDCHARS</code></a>. The position
+ sets the start or the search, which is forwards when searching for the end and backwards when
+ searching for the start.</p>
+
+ <p>Set <code>onlyWordCharacters</code> to <code>true</code> (1) to stop searching at the first
+ non-word character in the search direction. If <code>onlyWordCharacters</code> is
+ <code>false</code> (0), the first character in the search direction sets the type of the search
+ as word or non-word and the search stops at the first non-matching character. Searches are also
+ terminated by the start or end of the document.</p>
+
+ <p>If "w" represents word characters and "." represents non-word characters and "|" represents
+ the position and <code>true</code> or <code>false</code> is the state of
+ <code>onlyWordCharacters</code>:</p>
+
+ <table cellpadding="3" cellspacing="0" border="1" summary="Word start and end positions">
+ <thead align="center">
+ <tr>
+ <th>Initial state</th>
+
+ <th>end, true</th>
+
+ <th>end, false</th>
+
+ <th>start, true</th>
+
+ <th>start, false</th>
+ </tr>
+ </thead>
+
+ <tbody align="center">
+ <tr>
+ <td>..ww..|..ww..</td>
+
+ <td>..ww..|..ww..</td>
+
+ <td>..ww....|ww..</td>
+
+ <td>..ww..|..ww..</td>
+
+ <td>..ww|....ww..</td>
+ </tr>
+
+ <tr>
+ <td>....ww|ww....</td>
+
+ <td>....wwww|....</td>
+
+ <td>....wwww|....</td>
+
+ <td>....|wwww....</td>
+
+ <td>....|wwww....</td>
+ </tr>
+
+ <tr>
+ <td>..ww|....ww..</td>
+
+ <td>..ww|....ww..</td>
+
+ <td>..ww....|ww..</td>
+
+ <td>..|ww....ww..</td>
+
+ <td>..|ww....ww..</td>
+ </tr>
+
+ <tr>
+ <td>..ww....|ww..</td>
+
+ <td>..ww....ww|..</td>
+
+ <td>..ww....ww|..</td>
+
+ <td>..ww....|ww..</td>
+
+ <td>..ww|....ww..</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</b><br />
+ <b id="SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</b><br />
+ These messages return the position before and after another position
+ in the document taking into account the current code page. The minimum
+ position returned is 0 and the maximum is the last position in the document.
+ If called with a position within a multi byte character will return the position
+ of the start/end of that character.</p>
+
+ <p><b id="SCI_POSITIONRELATIVE">SCI_POSITIONRELATIVE(int position, int relative)</b><br />
+ Count a number of whole characters before or after the argument position and return that position.
+ The minimum position returned is 0 and the maximum is the last position in the document.
+ </p>
+
+ <p><b id="SCI_COUNTCHARACTERS">SCI_COUNTCHARACTERS(int startPos, int endPos)</b><br />
+ Returns the number of whole characters between two positions..</p>
+
+ <p><b id="SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</b><br />
+ This returns the pixel width of a string drawn in the given <code>styleNumber</code> which can
+ be used, for example, to decide how wide to make the line number margin in order to display a
+ given number of numerals.</p>
+
+ <p><b id="SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</b><br />
+ This returns the height in pixels of a particular line. Currently all lines are the same
+ height.</p>
+
+ <p><b id="SCI_GETCOLUMN">SCI_GETCOLUMN(int pos)</b><br />
+ This message returns the column number of a position <code>pos</code> within the document
+ taking the width of tabs into account. This returns the column number of the last tab on the
+ line before <code>pos</code>, plus the number of characters between the last tab and
+ <code>pos</code>. If there are no tab characters on the line, the return value is the number of
+ characters up to the position on the line. In both cases, double byte characters count as a
+ single character. This is probably only useful with monospaced fonts.</p>
+
+ <p><b id="SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</b><br />
+ This message returns the position of a <code>column</code> on a <code>line</code>
+ taking the width of tabs into account. It treats a multi-byte character as a single column.
+ Column numbers, like lines start at 0.</p>
+
+ <p><b id="SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</b><br />
+ <b id="SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int y)</b><br />
+ <code>SCI_POSITIONFROMPOINT</code> finds the closest character position to a point and
+ <code>SCI_POSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the
+ window or not close to any characters.</p>
+
+ <p><b id="SCI_CHARPOSITIONFROMPOINT">SCI_CHARPOSITIONFROMPOINT(int x, int y)</b><br />
+ <b id="SCI_CHARPOSITIONFROMPOINTCLOSE">SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y)</b><br />
+ <code>SCI_CHARPOSITIONFROMPOINT</code> finds the closest character to a point and
+ <code>SCI_CHARPOSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the
+ window or not close to any characters. This is similar to the previous methods but finds characters rather than
+ inter-character positions.</p>
+
+ <p><b id="SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int pos)</b><br />
+ <b id="SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int pos)</b><br />
+ These messages return the x and y display pixel location of text at position <code>pos</code>
+ in the document.</p>
+
+ <p><b id="SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</b><br />
+ The normal state is to make the selection visible by drawing it as set by <a class="message"
+ href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a> and <a class="message"
+ href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a>. However, if you hide the selection, it
+ is drawn as normal text.</p>
+
+ <p><b id="SCI_CHOOSECARETX">SCI_CHOOSECARETX</b><br />
+ Scintilla remembers the x value of the last position horizontally moved to explicitly by the
+ user and this value is then used when moving vertically such as by using the up and down keys.
+ This message sets the current x position of the caret as the remembered value.</p>
+
+ <p><b id="SCI_MOVESELECTEDLINESUP">SCI_MOVESELECTEDLINESUP</b><br />
+ Move the selected lines up one line, shifting the line above after the selection.
+ The selection will be automatically extended to the beginning of the selection's first line and the end of the selection's last line.
+ If nothing was selected, the line the cursor is currently at will be selected.</p>
+
+ <p><b id="SCI_MOVESELECTEDLINESDOWN">SCI_MOVESELECTEDLINESDOWN</b><br />
+ Move the selected lines down one line, shifting the line below before the selection.
+ The selection will be automatically extended to the beginning of the selection's first line and the end of the selection's last line.
+ If nothing was selected, the line the cursor is currently at will be selected.</p>
+
+ <p><b id="SCI_SETMOUSESELECTIONRECTANGULARSWITCH">SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool
+ mouseSelectionRectangularSwitch)</b><br />
+ <b id="SCI_GETMOUSESELECTIONRECTANGULARSWITCH">SCI_GETMOUSESELECTIONRECTANGULARSWITCH</b><br />
+ Enable or disable the ability to switch to rectangular selection mode while making a selection with the mouse.
+ When this option is turned on, mouse selections in stream mode can be switched to rectangular mode by pressing
+ the corresponding modifier key. They then stick to rectangular mode even when the modifier key is released again.
+ When this option is turned off, mouse selections will always stick to the mode the selection was started in. It
+ is off by default.</p>
+
+ <h2 id="MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</h2>
+
+ <code>
+ <a class="message" href="#SCI_SETMULTIPLESELECTION">SCI_SETMULTIPLESELECTION(bool multipleSelection)</a><br />
+ <a class="message" href="#SCI_GETMULTIPLESELECTION">SCI_GETMULTIPLESELECTION</a><br />
+ <a class="message" href="#SCI_SETADDITIONALSELECTIONTYPING">SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)</a><br />
+ <a class="message" href="#SCI_GETADDITIONALSELECTIONTYPING">SCI_GETADDITIONALSELECTIONTYPING</a><br />
+ <a class="message" href="#SCI_SETMULTIPASTE">SCI_SETMULTIPASTE(int multiPaste)</a><br />
+ <a class="message" href="#SCI_GETMULTIPASTE">SCI_GETMULTIPASTE</a><br />
+ <a class="message" href="#SCI_SETVIRTUALSPACEOPTIONS">SCI_SETVIRTUALSPACEOPTIONS(int virtualSpaceOptions)</a><br />
+ <a class="message" href="#SCI_GETVIRTUALSPACEOPTIONS">SCI_GETVIRTUALSPACEOPTIONS</a><br />
+ <a class="message" href="#SCI_SETRECTANGULARSELECTIONMODIFIER">SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)</a><br />
+ <a class="message" href="#SCI_GETRECTANGULARSELECTIONMODIFIER">SCI_GETRECTANGULARSELECTIONMODIFIER</a><br />
+ <br />
+
+ <a class="message" href="#SCI_GETSELECTIONS">SCI_GETSELECTIONS</a><br />
+ <a class="message" href="#SCI_GETSELECTIONEMPTY">SCI_GETSELECTIONEMPTY</a><br />
+ <a class="message" href="#SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</a><br />
+ <a class="message" href="#SCI_SETSELECTION">SCI_SETSELECTION(int caret, int anchor)</a><br />
+ <a class="message" href="#SCI_ADDSELECTION">SCI_ADDSELECTION(int caret, int anchor)</a><br />
+ <a class="message" href="#SCI_DROPSELECTIONN">SCI_DROPSELECTIONN(int selection)</a><br />
+ <a class="message" href="#SCI_SETMAINSELECTION">SCI_SETMAINSELECTION(int selection)</a><br />
+ <a class="message" href="#SCI_GETMAINSELECTION">SCI_GETMAINSELECTION</a><br />
+ <br />
+
+ <a class="message" href="#SCI_SETSELECTIONNCARET">SCI_SETSELECTIONNCARET(int selection, int pos)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNCARET">SCI_GETSELECTIONNCARET(int selection)</a><br />
+ <a class="message" href="#SCI_SETSELECTIONNCARETVIRTUALSPACE">SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNCARETVIRTUALSPACE">SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)</a><br />
+ <a class="message" href="#SCI_SETSELECTIONNANCHOR">SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNANCHOR">SCI_GETSELECTIONNANCHOR(int selection)</a><br />
+ <a class="message" href="#SCI_SETSELECTIONNANCHORVIRTUALSPACE">SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNANCHORVIRTUALSPACE">SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)</a><br />
+ <a class="message" href="#SCI_SETSELECTIONNSTART">SCI_SETSELECTIONNSTART(int selection, int pos)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNSTART">SCI_GETSELECTIONNSTART(int selection)</a><br />
+ <a class="message" href="#SCI_SETSELECTIONNEND">SCI_SETSELECTIONNEND(int selection, int pos)</a><br />
+ <a class="message" href="#SCI_GETSELECTIONNEND">SCI_GETSELECTIONNEND(int selection)</a><br />
+ <br />
+
+ <a class="message" href="#SCI_SETRECTANGULARSELECTIONCARET">SCI_SETRECTANGULARSELECTIONCARET(int pos)</a><br />
+ <a class="message" href="#SCI_GETRECTANGULARSELECTIONCARET">SCI_GETRECTANGULARSELECTIONCARET</a><br />
+ <a class="message" href="#SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)</a><br />
+ <a class="message" href="#SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE</a><br />
+ <a class="message" href="#SCI_SETRECTANGULARSELECTIONANCHOR">SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)</a><br />
+ <a class="message" href="#SCI_GETRECTANGULARSELECTIONANCHOR">SCI_GETRECTANGULARSELECTIONANCHOR</a><br />
+ <a class="message" href="#SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)</a><br />
+ <a class="message" href="#SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE</a><br />
+ <br />
+
+ <a class="message" href="#SCI_SETADDITIONALSELALPHA">SCI_SETADDITIONALSELALPHA(int alpha)</a><br />
+ <a class="message" href="#SCI_GETADDITIONALSELALPHA">SCI_GETADDITIONALSELALPHA</a><br />
+ <a class="message" href="#SCI_SETADDITIONALSELFORE">SCI_SETADDITIONALSELFORE(int colour)</a><br />
+ <a class="message" href="#SCI_SETADDITIONALSELBACK">SCI_SETADDITIONALSELBACK(int colour)</a><br />
+ <a class="message" href="#SCI_SETADDITIONALCARETFORE">SCI_SETADDITIONALCARETFORE(int colour)</a><br />
+ <a class="message" href="#SCI_GETADDITIONALCARETFORE">SCI_GETADDITIONALCARETFORE</a><br />
+ <a class="message" href="#SCI_SETADDITIONALCARETSBLINK">SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)</a><br />
+ <a class="message" href="#SCI_GETADDITIONALCARETSBLINK">SCI_GETADDITIONALCARETSBLINK</a><br />
+ <a class="message" href="#SCI_SETADDITIONALCARETSVISIBLE">SCI_SETADDITIONALCARETSVISIBLE(bool additionalCaretsVisible)</a><br />
+ <a class="message" href="#SCI_GETADDITIONALCARETSVISIBLE">SCI_GETADDITIONALCARETSVISIBLE</a><br />
+ <br />
+
+ <a class="message" href="#SCI_SWAPMAINANCHORCARET">SCI_SWAPMAINANCHORCARET</a><br />
+ <a class="message" href="#SCI_ROTATESELECTION">SCI_ROTATESELECTION</a><br />
+ </code>
+
+ <p>
+ There may be multiple selections active at one time.
+ More selections are made by holding down the Ctrl key while dragging with the mouse.
+ The most recent selection is the main selection and determines which part of the document is shown automatically.
+ Any selection apart from the main selection is called an additional selection.
+ The calls in the previous section operate on the main selection.
+ There is always at least one selection.
+ </p>
+
+ <p>
+ Rectangular selections are handled as multiple selections although the original rectangular range is remembered so that
+ subsequent operations may be handled differently for rectangular selections. For example, pasting a rectangular selection
+ places each piece in a vertical column.
+ </p>
+
+ <p>
+ Virtual space is space beyond the end of each line. The caret may be moved into virtual space but no real space will be
+ added to the document until there is some text typed or some other text insertion command is used.
+ </p>
+
+ <p>When discontiguous selections are copied to the clipboard, each selection is added to the clipboard text
+ in order with no delimiting characters.
+ For rectangular selections the document's line end is added after each line's text. Rectangular selections
+ are always copied from top line to bottom, not in the in order of selection.Virtual space is not copied.</p>
+
+ <p>
+ <b id="SCI_SETMULTIPLESELECTION">SCI_SETMULTIPLESELECTION(bool multipleSelection)</b><br />
+ <b id="SCI_GETMULTIPLESELECTION">SCI_GETMULTIPLESELECTION</b><br />
+ Enable or disable multiple selection. When multiple selection is disabled, it is not possible to select
+ multiple ranges by holding down the Ctrl key while dragging with the mouse.</p>
+
+ <p>
+ <b id="SCI_SETADDITIONALSELECTIONTYPING">SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)</b><br />
+ <b id="SCI_GETADDITIONALSELECTIONTYPING">SCI_GETADDITIONALSELECTIONTYPING</b><br />
+ Whether typing, backspace, or delete works with multiple selections simultaneously.</p>
+
+ <p>
+ <b id="SCI_SETMULTIPASTE">SCI_SETMULTIPASTE(int multiPaste)</b><br />
+ <b id="SCI_GETMULTIPASTE">SCI_GETMULTIPASTE</b><br />
+ When pasting into multiple selections, the pasted text can go into just the main selection with <code>SC_MULTIPASTE_ONCE</code>=0
+ or into each selection with <code>SC_MULTIPASTE_EACH</code>=1. <code>SC_MULTIPASTE_ONCE</code> is the default.</p>
+
+ <p>
+ <b id="SCI_SETVIRTUALSPACEOPTIONS">SCI_SETVIRTUALSPACEOPTIONS(int virtualSpace)</b><br />
+ <b id="SCI_GETVIRTUALSPACEOPTIONS">SCI_GETVIRTUALSPACEOPTIONS</b><br />
+ Virtual space can be enabled or disabled for rectangular selections or in other circumstances or in both.
+ There are two bit flags <code>SCVS_RECTANGULARSELECTION</code>=1 and
+ <code>SCVS_USERACCESSIBLE</code>=2 which can be set independently.
+ <code>SCVS_NONE</code>=0, the default, disables all use of virtual space.</p>
+
+ <p>
+ <b id="SCI_SETRECTANGULARSELECTIONMODIFIER">SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)</b><br />
+ <b id="SCI_GETRECTANGULARSELECTIONMODIFIER">SCI_GETRECTANGULARSELECTIONMODIFIER</b><br />
+ On GTK+, the key used to indicate that a rectangular selection should be created when combined with a mouse drag can be set.
+ The three possible values are <code>SCMOD_CTRL</code>=2 (default), <code>SCMOD_ALT</code>=4 or <code>SCMOD_SUPER</code>=8.
+ Since <code>SCMOD_ALT</code> is often already used by a window manager, the window manager may need configuring to allow this choice.
+ <code>SCMOD_SUPER</code> is often a system dependent modifier key such as the Left Windows key on a Windows keyboard or the
+ Command key on a Mac.</p>
+
+ <p>
+ <b id="SCI_GETSELECTIONS">SCI_GETSELECTIONS</b><br />
+ Return the number of selections currently active.</p>
+
+ <p>
+ <b id="SCI_GETSELECTIONEMPTY">SCI_GETSELECTIONEMPTY</b><br />
+ Return 1 if every selected range is empty else 0.</p>
+
+ <p>
+ <b id="SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</b><br />
+ Set a single empty selection at 0 as the only selection.</p>
+
+ <p>
+ <b id="SCI_SETSELECTION">SCI_SETSELECTION(int caret, int anchor)</b><br />
+ Set a single selection from <code>anchor</code> to <code>caret</code> as the only selection.</p>
+
+ <p>
+ <b id="SCI_ADDSELECTION">SCI_ADDSELECTION(int caret, int anchor)</b><br />
+ Add a new selection from <code>anchor</code> to <code>caret</code> as the main selection retaining all other
+ selections as additional selections.
+ Since there is always at least one selection, to set a list of selections, the first selection should be
+ added with <code>SCI_SETSELECTION</code> and later selections added with <code>SCI_ADDSELECTION</code></p>
+
+ <p>
+ <b id="SCI_DROPSELECTIONN">SCI_DROPSELECTIONN(int selection)</b><br />
+ If there are multiple selections, remove the indicated selection.
+ If this was the main selection then make the previous selection the main and if it was the first then the last selection becomes main.
+ If there is only one selection, or there is no selection <code>selection</code>, then there is no effect.</p>
+
+ <p>
+ <b id="SCI_SETMAINSELECTION">SCI_SETMAINSELECTION(int selection)</b><br />
+ <b id="SCI_GETMAINSELECTION">SCI_GETMAINSELECTION</b><br />
+ One of the selections is the main selection which is used to determine what range of text is automatically visible.
+ The main selection may be displayed in different colours or with a differently styled caret.
+ Only an already existing selection can be made main.</p>
+
+ <p>
+ <b id="SCI_SETSELECTIONNCARET">SCI_SETSELECTIONNCARET(int selection, int pos)</b><br />
+ <b id="SCI_GETSELECTIONNCARET">SCI_GETSELECTIONNCARET(int selection)</b><br />
+ <b id="SCI_SETSELECTIONNCARETVIRTUALSPACE">SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)</b><br />
+ <b id="SCI_GETSELECTIONNCARETVIRTUALSPACE">SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)</b><br />
+ <b id="SCI_SETSELECTIONNANCHOR">SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)</b><br />
+ <b id="SCI_GETSELECTIONNANCHOR">SCI_GETSELECTIONNANCHOR(int selection)</b><br />
+ <b id="SCI_SETSELECTIONNANCHORVIRTUALSPACE">SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)</b><br />
+ <b id="SCI_GETSELECTIONNANCHORVIRTUALSPACE">SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)</b><br />
+ Set or query the position and amount of virtual space for the caret and anchor of each already existing selection.</p>
+
+ <p>
+ <b id="SCI_SETSELECTIONNSTART">SCI_SETSELECTIONNSTART(int selection, int pos)</b><br />
+ <b id="SCI_GETSELECTIONNSTART">SCI_GETSELECTIONNSTART(int selection)</b><br />
+ <b id="SCI_SETSELECTIONNEND">SCI_SETSELECTIONNEND(int selection, int pos)</b><br />
+ <b id="SCI_GETSELECTIONNEND">SCI_GETSELECTIONNEND(int selection)</b><br />
+ Set or query the start and end position of each already existing selection.
+ Mostly of use to query each range for its text.</p>
+
+ <p>
+ <b id="SCI_SETRECTANGULARSELECTIONCARET">SCI_SETRECTANGULARSELECTIONCARET(int pos)</b><br />
+ <b id="SCI_GETRECTANGULARSELECTIONCARET">SCI_GETRECTANGULARSELECTIONCARET</b><br />
+ <b id="SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)</b><br />
+ <b id="SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE</b><br />
+ <b id="SCI_SETRECTANGULARSELECTIONANCHOR">SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)</b><br />
+ <b id="SCI_GETRECTANGULARSELECTIONANCHOR">SCI_GETRECTANGULARSELECTIONANCHOR</b><br />
+ <b id="SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)</b><br />
+ <b id="SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE">SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE</b><br />
+ Set or query the position and amount of virtual space for the caret and anchor of the rectangular selection.
+ After setting the rectangular selection, this is broken down into multiple selections, one for each line.</p>
+
+ <p>
+ <b id="SCI_SETADDITIONALSELALPHA">SCI_SETADDITIONALSELALPHA(int alpha)</b><br />
+ <b id="SCI_GETADDITIONALSELALPHA">SCI_GETADDITIONALSELALPHA</b><br />
+ <b id="SCI_SETADDITIONALSELFORE">SCI_SETADDITIONALSELFORE(int <a class="jump" href="#colour">colour</a>)</b><br />
+ <b id="SCI_SETADDITIONALSELBACK">SCI_SETADDITIONALSELBACK(int <a class="jump" href="#colour">colour</a>)</b><br />
+ Modify the appearance of additional selections so that they can be differentiated from the main selection which has its appearance set with
+ <a class="message" href="#SCI_SETSELALPHA"><code>SCI_SETSELALPHA</code></a>,
+ <a class="message" href="#SCI_GETSELALPHA"><code>SCI_GETSELALPHA</code></a>,
+ <a class="message" href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a>, and
+ <a class="message" href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a>.
+ <code>SCI_SETADDITIONALSELFORE</code> and
+ <code>SCI_SETADDITIONALSELBACK</code> calls have no
+ effect until <a class="message" href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a>
+ and <a class="message" href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a> are
+ called with useSelection*Colour value set to true. Subsequent calls to
+ <a class="message" href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a>,
+ and <a class="message" href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a> will
+ overwrite the values set by <code>SCI_SETADDITIONALSEL*</code> functions.</p>
+ <p>
+ <b id="SCI_SETADDITIONALCARETFORE">SCI_SETADDITIONALCARETFORE(int <a class="jump" href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETADDITIONALCARETFORE">SCI_GETADDITIONALCARETFORE</b><br />
+ <b id="SCI_SETADDITIONALCARETSBLINK">SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)</b><br />
+ <b id="SCI_GETADDITIONALCARETSBLINK">SCI_GETADDITIONALCARETSBLINK</b><br />
+ Modify the appearance of additional carets so that they can be differentiated from the main caret which has its appearance set with
+ <a class="message" href="#SCI_SETCARETFORE"><code>SCI_SETCARETFORE</code></a>,
+ <a class="message" href="#SCI_GETCARETFORE"><code>SCI_GETCARETFORE</code></a>,
+ <a class="message" href="#SCI_SETCARETPERIOD"><code>SCI_SETCARETPERIOD</code></a>, and
+ <a class="message" href="#SCI_GETCARETPERIOD"><code>SCI_GETCARETPERIOD</code></a>.</p>
+
+ <p>
+ <b id="SCI_SETADDITIONALCARETSVISIBLE">SCI_SETADDITIONALCARETSVISIBLE(bool additionalCaretsVisible)</b><br />
+ <b id="SCI_GETADDITIONALCARETSVISIBLE">SCI_GETADDITIONALCARETSVISIBLE</b><br />
+ Determine whether to show additional carets (defaults to <code>true</code>).</p>
+
+ <p>
+ <b id="SCI_SWAPMAINANCHORCARET">SCI_SWAPMAINANCHORCARET</b><br />
+ <b id="SCI_ROTATESELECTION">SCI_ROTATESELECTION</b><br />
+ These commands may be assigned to keys to make it possible to manipulate multiple selections.
+ <code>SCI_SWAPMAINANCHORCARET</code> moves the caret to the opposite end of the main selection.
+ <code>SCI_ROTATESELECTION</code> makes the next selection be the main selection.
+ </p>
+
+ <h2 id="ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</h2>
+ <code><a class="message" href="#SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</a><br />
+ <a class="message" href="#SCI_SCROLLCARET">SCI_SCROLLCARET</a><br />
+ <a class="message" href="#SCI_SCROLLRANGE">SCI_SCROLLRANGE(int secondary, int primary)</a><br />
+ <a class="message" href="#SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int
+ caretSlop)</a><br />
+ <a class="message" href="#SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int
+ caretSlop)</a><br />
+ <a class="message" href="#SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int
+ caretSlop)</a><br />
+ <a class="message" href="#SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</a><br />
+ <a class="message" href="#SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</a><br />
+ <a class="message" href="#SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</a><br />
+ <a class="message" href="#SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</a><br />
+ <a class="message" href="#SCI_GETXOFFSET">SCI_GETXOFFSET</a><br />
+ <a class="message" href="#SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</a><br />
+ <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</a><br />
+ <a class="message" href="#SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</a><br />
+ <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</a><br />
+ <a class="message" href="#SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</a><br />
+ <a class="message" href="#SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool
+ endAtLastLine)</a><br />
+ <a class="message" href="#SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</a><br />
+ </code>
+
+ <p><b id="SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</b><br />
+ This will attempt to scroll the display by the number of columns and lines that you specify.
+ Positive line values increase the line number at the top of the screen (i.e. they move the text
+ upwards as far as the user is concerned), Negative line values do the reverse.</p>
+
+ <p>The column measure is the width of a space in the default style. Positive values increase
+ the column at the left edge of the view (i.e. they move the text leftwards as far as the user
+ is concerned). Negative values do the reverse.</p>
+
+ <p>See also: <a class="message" href="#SCI_SETXOFFSET"><code>SCI_SETXOFFSET</code></a></p>
+
+ <p><b id="SCI_SCROLLCARET">SCI_SCROLLCARET</b><br />
+ If the current position (this is the caret if there is no selection) is not visible, the view
+ is scrolled to make it visible according to the current caret policy.</p>
+
+ <p><b id="SCI_SCROLLRANGE">SCI_SCROLLRANGE(int secondary, int primary)</b><br />
+ Scroll the argument positions and the range between them into view giving
+ priority to the primary position then the secondary position.
+ The behaviour is similar to <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a>
+ with the primary position used instead of the caret. An effort is then made to ensure that the secondary
+ position and range between are also visible.
+ This may be used to make a search match visible.</p>
+
+ <p><b id="SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)</b><br />
+ <b id="SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)</b><br />
+ These set the caret policy. The value of <code>caretPolicy</code> is a combination of
+ <code>CARET_SLOP</code>, <code>CARET_STRICT</code>, <code>CARET_JUMPS</code> and
+ <code>CARET_EVEN</code>.</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Caret policy">
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>CARET_SLOP</code></th>
+
+ <td>If set, we can define a slop value: <code>caretSlop</code>. This value defines an
+ unwanted zone (UZ) where the caret is... unwanted. This zone is defined as a number of
+ pixels near the vertical margins, and as a number of lines near the horizontal margins.
+ By keeping the caret away from the edges, it is seen within its context. This makes it
+ likely that the identifier that the caret is on can be completely seen, and that the
+ current line is seen with some of the lines following it, which are often dependent on
+ that line.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>CARET_STRICT</code></th>
+
+ <td>If set, the policy set by <code>CARET_SLOP</code> is enforced... strictly. The caret
+ is centred on the display if <code>caretSlop</code> is not set, and cannot go in the UZ
+ if <code>caretSlop</code> is set.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>CARET_JUMPS</code></th>
+
+ <td>If set, the display is moved more energetically so the caret can move in the same
+ direction longer before the policy is applied again. '3UZ' notation is used to indicate
+ three time the size of the UZ as a distance to the margin.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>CARET_EVEN</code></th>
+
+ <td>If not set, instead of having symmetrical UZs, the left and bottom UZs are extended
+ up to right and top UZs respectively. This way, we favour the displaying of useful
+ information: the beginning of lines, where most code reside, and the lines after the
+ caret, for example, the body of a function.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <table cellpadding="3" cellspacing="0" border="1" summary="Caret positioning">
+ <thead align="center">
+ <tr>
+ <th>slop</th>
+
+ <th>strict</th>
+
+ <th>jumps</th>
+
+ <th>even</th>
+
+ <th>Caret can go to the margin</th>
+
+ <th>On reaching limit (going out of visibility<br />
+ or going into the UZ) display is...</th>
+ </tr>
+ </thead>
+
+ <tbody align="center">
+ <tr>
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret on top/on right</td>
+ </tr>
+
+ <tr>
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>Yes</td>
+
+ <td>moved by one position</td>
+ </tr>
+
+ <tr>
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret on top/on right</td>
+ </tr>
+
+ <tr>
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>Yes</td>
+
+ <td>centred on the caret</td>
+ </tr>
+
+ <tr>
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>-</td>
+
+ <td>0</td>
+
+ <td>Caret is always on top/on right of display</td>
+
+ <td>-</td>
+ </tr>
+
+ <tr>
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>-</td>
+
+ <td>1</td>
+
+ <td>No, caret is always centred</td>
+
+ <td>-</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret out of the asymmetrical UZ</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret out of the UZ</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret at 3UZ of the top or right margin</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>Yes</td>
+
+ <td>moved to put caret at 3UZ of the margin</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>-</td>
+
+ <td>0</td>
+
+ <td>Caret is always at UZ of top/right margin</td>
+
+ <td>-</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>1</td>
+
+ <td>No, kept out of UZ</td>
+
+ <td>moved by one position</td>
+ </tr>
+
+ <tr>
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>1</td>
+
+ <td>0</td>
+
+ <td>No, kept out of UZ</td>
+
+ <td>moved to put caret at 3UZ of the margin</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)</b><br />
+ This determines how the vertical positioning is determined when <a class="message"
+ href="#SCI_ENSUREVISIBLEENFORCEPOLICY"><code>SCI_ENSUREVISIBLEENFORCEPOLICY</code></a> is
+ called. It takes <code>VISIBLE_SLOP</code> and <code>VISIBLE_STRICT</code> flags for the policy
+ parameter. It is similar in operation to <a class="message"
+ href="#SCI_SETYCARETPOLICY"><code>SCI_SETYCARETPOLICY(int caretPolicy, int
+ caretSlop)</code></a>.</p>
+
+ <p><b id="SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</b><br />
+ <b id="SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</b><br />
+ The horizontal scroll bar is only displayed if it is needed for the assumed width.
+ If you never wish to see it, call
+ <code>SCI_SETHSCROLLBAR(0)</code>. Use <code>SCI_SETHSCROLLBAR(1)</code> to enable it again.
+ <code>SCI_GETHSCROLLBAR</code> returns the current state. The default state is to display it
+ when needed.</p>
+ <p>See also: <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH</a>.</p>
+
+ <p><b id="SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</b><br />
+ <b id="SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</b><br />
+ By default, the vertical scroll bar is always displayed when required. You can choose to hide
+ or show it with <code>SCI_SETVSCROLLBAR</code> and get the current state with
+ <code>SCI_GETVSCROLLBAR</code>.</p>
+
+ <p><b id="SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</b><br />
+ <b id="SCI_GETXOFFSET">SCI_GETXOFFSET</b><br />
+ The <code>xOffset</code> is the horizontal scroll position in pixels of the start of the text
+ view. A value of 0 is the normal position with the first text column visible at the left of the
+ view.</p>
+
+ <p>See also: <a class="message" href="#SCI_LINESCROLL"><code>SCI_LINESCROLL</code></a></p>
+
+ <p><b id="SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</b><br />
+ <b id="SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</b><br />
+ For performance, Scintilla does not measure the display width of the document to determine
+ the properties of the horizontal scroll bar. Instead, an assumed width is used.
+ These messages set and get the document width in pixels assumed by Scintilla.
+ The default value is 2000.
+ To ensure the width of the currently visible lines can be scrolled use
+ <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING"><code>SCI_SETSCROLLWIDTHTRACKING</code></a></p>
+
+ <p><b id="SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</b><br />
+ <b id="SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</b><br />
+ If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently
+ displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.</p>
+
+ <p><b id="SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool endAtLastLine)</b><br />
+ <b id="SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</b><br />
+ <code>SCI_SETENDATLASTLINE</code> sets the scroll range so that maximum scroll position has
+ the last line at the bottom of the view (default). Setting this to <code>false</code> allows
+ scrolling one page below the last line.</p>
+
+ <h2 id="WhiteSpace">White space</h2>
+ <code><a class="message" href="#SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</a><br />
+ <a class="message" href="#SCI_GETVIEWWS">SCI_GETVIEWWS</a><br />
+ <a class="message" href="#SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool
+ useWhitespaceForeColour, int colour)</a><br />
+ <a class="message" href="#SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool
+ useWhitespaceBackColour, int colour)</a><br />
+ <a class="message" href="#SCI_SETWHITESPACESIZE">SCI_SETWHITESPACESIZE(int
+ size)</a><br />
+ <a class="message" href="#SCI_GETWHITESPACESIZE">SCI_GETWHITESPACESIZE</a><br />
+ <a class="message" href="#SCI_SETEXTRAASCENT">SCI_SETEXTRAASCENT(int extraAscent)</a><br />
+ <a class="message" href="#SCI_GETEXTRAASCENT">SCI_GETEXTRAASCENT</a><br />
+ <a class="message" href="#SCI_SETEXTRADESCENT">SCI_SETEXTRADESCENT(int extraDescent)</a><br />
+ <a class="message" href="#SCI_GETEXTRADESCENT">SCI_GETEXTRADESCENT</a><br />
+ </code>
+
+ <p><b id="SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</b><br />
+ <b id="SCI_GETVIEWWS">SCI_GETVIEWWS</b><br />
+ White space can be made visible which may be useful for languages in which white space is
+ significant, such as Python. Space characters appear as small centred dots and tab characters
+ as light arrows pointing to the right. There are also ways to control the display of <a
+ class="jump" href="#LineEndings">end of line characters</a>. The two messages set and get the
+ white space display mode. The <code>wsMode</code> argument can be one of:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="White space policy">
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>SCWS_INVISIBLE</code></th>
+
+ <td>0</td>
+
+ <td>The normal display mode with white space displayed as an empty background
+ colour.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>SCWS_VISIBLEALWAYS</code></th>
+
+ <td>1</td>
+
+ <td>White space characters are drawn as dots and arrows,</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>SCWS_VISIBLEAFTERINDENT</code></th>
+
+ <td>2</td>
+
+ <td>White space used for indentation is displayed normally but after the first visible
+ character, it is shown as dots and arrows.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>The effect of using any other <code>wsMode</code> value is undefined.</p>
+
+ <p><b id="SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int <a
+ class="jump" href="#colour">colour</a>)</b><br />
+ <b id="SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int <a
+ class="jump" href="#colour">colour</a>)</b><br />
+ By default, the colour of visible white space is determined by the lexer in use. The
+ foreground and/or background colour of all visible white space can be set globally, overriding
+ the lexer's colours with <code>SCI_SETWHITESPACEFORE</code> and
+ <code>SCI_SETWHITESPACEBACK</code>.</p>
+
+ <p><b id="SCI_SETWHITESPACESIZE">SCI_SETWHITESPACESIZE(int size)</b><br />
+ <b id="SCI_GETWHITESPACESIZE">SCI_GETWHITESPACESIZE</b><br />
+ <code>SCI_SETWHITESPACESIZE</code> sets the size of the dots used for mark space characters.
+ The <code>SCI_GETWHITESPACESIZE</code> message retrieves the current size.
+ </p>
+
+ <p>
+ <b id="SCI_SETEXTRAASCENT">SCI_SETEXTRAASCENT(int extraAscent)</b><br />
+ <b id="SCI_GETEXTRAASCENT">SCI_GETEXTRAASCENT</b><br />
+ <b id="SCI_SETEXTRADESCENT">SCI_SETEXTRADESCENT(int extraDescent)</b><br />
+ <b id="SCI_GETEXTRADESCENT">SCI_GETEXTRADESCENT</b><br />
+ Text is drawn with the base of each character on a 'baseline'. The height of a line is found from the maximum
+ that any style extends above the baseline (its 'ascent'), added to the maximum that any style extends below the
+ baseline (its 'descent').
+ Space may be added to the maximum ascent (<code>SCI_SETEXTRAASCENT</code>) and the
+ maximum descent (<code>SCI_SETEXTRADESCENT</code>) to allow for more space between lines.
+ This may done to make the text easier to read or to accommodate underlines or highlights.
+ </p>
+
+ <h2 id="Cursor">Cursor</h2>
+
+ <p><b id="SCI_SETCURSOR">SCI_SETCURSOR(int curType)</b><br />
+ <b id="SCI_GETCURSOR">SCI_GETCURSOR</b><br />
+ The cursor is normally chosen in a context sensitive way, so it will be different over the
+ margin than when over the text. When performing a slow action, you may wish to change to a wait
+ cursor. You set the cursor type with <code>SCI_SETCURSOR</code>. The <code>curType</code>
+ argument can be:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Mouse cursors">
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>SC_CURSORNORMAL</code></th>
+
+ <td>-1</td>
+
+ <td>The normal cursor is displayed.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>SC_CURSORWAIT</code></th>
+
+ <td>&nbsp;4</td>
+
+ <td>The wait cursor is displayed when the mouse is over or owned by the Scintilla
+ window.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>Cursor values 1 through 7 have defined cursors, but only <code>SC_CURSORWAIT</code> is
+ usefully controllable. Other values of <code>curType</code> cause a pointer to be displayed.
+ The <code>SCI_GETCURSOR</code> message returns the last cursor type you set, or
+ <code>SC_CURSORNORMAL</code> (-1) if you have not set a cursor type.</p>
+
+ <h2 id="MouseCapture">Mouse capture</h2>
+
+ <p><b id="SCI_SETMOUSEDOWNCAPTURES">SCI_SETMOUSEDOWNCAPTURES(bool captures)</b><br />
+ <b id="SCI_GETMOUSEDOWNCAPTURES">SCI_GETMOUSEDOWNCAPTURES</b><br />
+ When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are
+ sent to Scintilla. This behaviour may be turned off with
+ <code>SCI_SETMOUSEDOWNCAPTURES(0)</code>.</p>
+
+ <h2 id="LineEndings">Line endings</h2>
+
+ <p>Scintilla can handle the major line end conventions and, depending on settings and
+ the current lexer also support additional Unicode line ends.</p>
+
+ <p>Scintilla can interpret any of the Macintosh (\r), Unix (\n) and Windows (\r\n)
+ line ends.
+ When the user presses the Enter key, one of these line
+ end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but
+ this can be changed with the <code>SCI_SETEOLMODE</code> message. You can also convert the
+ entire document to one of these line endings with <code>SCI_CONVERTEOLS</code>. Finally, you
+ can choose to display the line endings with <code>SCI_SETVIEWEOL</code>.</p>
+
+ <p>For the UTF-8 encoding, three additional Unicode line ends,
+ Next Line (<code>NEL=U+0085</code>), Line Separator (<code>LS=U+2028</code>), and Paragraph Separator (<code>PS=U+2029</code>)
+ may optionally be interpreted when Unicode line ends is turned on and the current lexer also supports
+ Unicode line ends.</p>
+
+ <a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</a><br />
+ <a class="message" href="#SCI_GETEOLMODE">SCI_GETEOLMODE</a><br />
+ <a class="message" href="#SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</a><br />
+ <a class="message" href="#SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</a><br />
+ <a class="message" href="#SCI_GETVIEWEOL">SCI_GETVIEWEOL</a><br />
+
+ <a class="message" href="#SCI_GETLINEENDTYPESSUPPORTED">SCI_GETLINEENDTYPESSUPPORTED</a><br />
+ <a class="message" href="#SCI_SETLINEENDTYPESALLOWED">SCI_SETLINEENDTYPESALLOWED(int lineEndBitSet)</a><br />
+ <a class="message" href="#SCI_GETLINEENDTYPESALLOWED">SCI_GETLINEENDTYPESALLOWED</a><br />
+ <a class="message" href="#SCI_GETLINEENDTYPESACTIVE">SCI_GETLINEENDTYPESACTIVE</a><br />
+
+ <p><b id="SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</b><br />
+ <b id="SCI_GETEOLMODE">SCI_GETEOLMODE</b><br />
+ <code>SCI_SETEOLMODE</code> sets the characters that are added into the document when the user
+ presses the Enter key. You can set <code>eolMode</code> to one of <code>SC_EOL_CRLF</code> (0),
+ <code>SC_EOL_CR</code> (1), or <code>SC_EOL_LF</code> (2). The <code>SCI_GETEOLMODE</code>
+ message retrieves the current state.</p>
+
+ <p><b id="SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</b><br />
+ This message changes all the end of line characters in the document to match
+ <code>eolMode</code>. Valid values are: <code>SC_EOL_CRLF</code> (0), <code>SC_EOL_CR</code>
+ (1), or <code>SC_EOL_LF</code> (2).</p>
+
+ <p><b id="SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</b><br />
+ <b id="SCI_GETVIEWEOL">SCI_GETVIEWEOL</b><br />
+ Normally, the end of line characters are hidden, but <code>SCI_SETVIEWEOL</code> allows you to
+ display (or hide) them by setting <code>visible</code> <code>true</code> (or
+ <code>false</code>). The visible rendering of the end of line characters is similar to
+ <code>(CR)</code>, <code>(LF)</code>, or <code>(CR)(LF)</code>. <code>SCI_GETVIEWEOL</code>
+ returns the current state.</p>
+
+ <p><b id="SCI_GETLINEENDTYPESSUPPORTED">SCI_GETLINEENDTYPESSUPPORTED</b><br />
+ <code>SCI_GETLINEENDTYPESSUPPORTED</code> reports the different types of line ends supported
+ by the current lexer. This is a bit set although there is currently only a single choice
+ with either <code>SC_LINE_END_TYPE_DEFAULT</code> (0) or <code>SC_LINE_END_TYPE_UNICODE</code> (1).
+ These values are also used by the other messages concerned with Unicode line ends.</p>
+
+ <p><b id="SCI_SETLINEENDTYPESALLOWED">SCI_SETLINEENDTYPESALLOWED(int lineEndBitSet)</b><br />
+ <b id="SCI_GETLINEENDTYPESALLOWED">SCI_GETLINEENDTYPESALLOWED</b><br />
+ By default, only the ASCII line ends are interpreted. Unicode line ends may be requested with
+ <code>SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_UNICODE)</code>
+ but this will be ineffective unless the lexer also allows you Unicode line ends.
+ <code>SCI_GETLINEENDTYPESALLOWED</code> returns the current state.</p>
+
+ <p><b id="SCI_GETLINEENDTYPESACTIVE">SCI_GETLINEENDTYPESACTIVE</b><br />
+ <code>SCI_GETLINEENDTYPESACTIVE</code> reports the set of line ends currently interpreted
+ by Scintilla. It is <code>SCI_GETLINEENDTYPESSUPPORTED &amp; SCI_GETLINEENDTYPESALLOWED</code>.</p>
+
+ <h2 id="Styling">Styling</h2>
+
+ <p>The styling messages allow you to assign styles to text. If your styling needs can be met by
+ one of the standard lexers, or if you can write your own, then a lexer is probably the easiest
+ way to style your document. If you choose to use the container to do the styling you can use
+ the <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a> command to select
+ <code>SCLEX_CONTAINER</code>, in which case the container is sent a <a class="message"
+ href="#SCN_STYLENEEDED"><code>SCN_STYLENEEDED</code></a> <a class="jump"
+ href="#Notifications">notification</a> each time text needs styling for display. As another
+ alternative, you might use idle time to style the document. Even if you use a lexer, you might
+ use the styling commands to mark errors detected by a compiler. The following commands can be
+ used.</p>
+ <code><a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a><br />
+ <a class="message" href="#SCI_STARTSTYLING">SCI_STARTSTYLING(int position, int unused)</a><br />
+ <a class="message" href="#SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</a><br />
+ <a class="message" href="#SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char
+ *styles)</a><br />
+ <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</a><br />
+ <a class="message" href="#SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</a><br />
+ <a class="message" href="#SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</a><br />
+ </code>
+
+ <p><b id="SCI_GETENDSTYLED">SCI_GETENDSTYLED</b><br />
+ Scintilla keeps a record of the last character that is likely to be styled correctly. This is
+ moved forwards when characters after it are styled and moved backwards if changes are made to
+ the text of the document before it. Before drawing text, this position is checked to see if any
+ styling is needed and, if so, a <code><a class="message"
+ href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification message is sent to the
+ container. The container can send <code>SCI_GETENDSTYLED</code> to work out where it needs to
+ start styling. Scintilla will always ask to style whole lines.</p>
+
+ <p><b id="SCI_STARTSTYLING">SCI_STARTSTYLING(int pos, int unused)</b><br />
+ This prepares for styling by setting the styling position <code>pos</code> to start at.
+ The unused argument was used in earlier versions but is now ignored.
+ After
+ <code>SCI_STARTSTYLING</code>, send multiple <code>SCI_SETSTYLING</code> messages for each
+ lexical entity to style.</p>
+
+ <p><b id="SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</b><br />
+ This message sets the style of <code>length</code> characters starting at the styling position
+ and then increases the styling position by <code>length</code>, ready for the next call.<br />
+ </p>
+
+ <p><b id="SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char *styles)</b><br />
+ As an alternative to <code>SCI_SETSTYLING</code>, which applies the same style to each byte,
+ you can use this message which specifies the styles for each of <code>length</code> bytes from
+ the styling position and then increases the styling position by <code>length</code>, ready for
+ the next call.</p>
+
+ <p><b id="SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</b><br />
+ <b id="SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</b><br />
+ As well as the 8 bits of lexical state stored for each character there is also an integer
+ stored for each line. This can be used for longer lived parse states such as what the current
+ scripting language is in an ASP page. Use <code>SCI_SETLINESTATE</code> to set the integer
+ value and <code>SCI_GETLINESTATE</code> to get the value.
+ Changing the value produces a <a class="message" href="#SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</a> notification.
+ </p>
+
+ <p><b id="SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</b><br />
+ This returns the last line that has any line state.</p>
+
+ <h2 id="StyleDefinition">Style definition</h2>
+
+ <p>While the style setting messages mentioned above change the style numbers associated with
+ text, these messages define how those style numbers are interpreted visually. There are 256
+ lexer styles that can be set, numbered 0 to <code>STYLE_MAX</code> (255).
+ There are also some
+ predefined numbered styles starting at 32, The following <code>STYLE_</code>* constants are
+ defined.</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Preset styles">
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>STYLE_DEFAULT</code></th>
+
+ <td>32</td>
+
+ <td>This style defines the attributes that all styles receive when the
+ <code>SCI_STYLECLEARALL</code> message is used.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_LINENUMBER</code></th>
+
+ <td>33</td>
+
+ <td>This style sets the attributes of the text used to display line numbers in a line
+ number margin. The background colour set for this style also sets the background colour
+ for all margins that do not have any folding mask bits set. That is, any margin for which
+ <code>mask &amp; SC_MASK_FOLDERS</code> is 0. See <a class="message"
+ href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a> for more about masks.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_BRACELIGHT</code></th>
+
+ <td>34</td>
+
+ <td>This style sets the attributes used when highlighting braces with the <a
+ class="message" href="#BraceHighlighting"><code>SCI_BRACEHIGHLIGHT</code></a> message and
+ when highlighting the corresponding indentation with <a class="message"
+ href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_BRACEBAD</code></th>
+
+ <td>35</td>
+
+ <td>This style sets the display attributes used when marking an unmatched brace with the
+ <a class="message" href="#BraceHighlighting"><code>SCI_BRACEBADLIGHT</code></a>
+ message.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_CONTROLCHAR</code></th>
+
+ <td>36</td>
+
+ <td>This style sets the font used when drawing control characters.
+ Only the font, size, bold, italics, and character set attributes are used and not
+ the colour attributes. See
+ also: <a class="message"
+ href="#SCI_SETCONTROLCHARSYMBOL"><code>SCI_SETCONTROLCHARSYMBOL</code></a>.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_INDENTGUIDE</code></th>
+
+ <td>37</td>
+
+ <td>This style sets the foreground and background colours used when drawing the
+ indentation guides.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_CALLTIP</code></th>
+
+ <td>38</td>
+
+ <td> Call tips normally use the font attributes defined by <code>STYLE_DEFAULT</code>.
+ Use of <a class="message" href="#SCI_CALLTIPUSESTYLE"><code>SCI_CALLTIPUSESTYLE</code></a>
+ causes call tips to use this style instead. Only the font face name, font size,
+ foreground and background colours and character set attributes are used.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_LASTPREDEFINED</code></th>
+
+ <td>39</td>
+
+ <td>To make it easier for client code to discover the range of styles that are
+ predefined, this is set to the style number of the last predefined style. This is
+ currently set to 39 and the last style with an identifier is 38, which reserves space
+ for one future predefined style.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>STYLE_MAX</code></th>
+
+ <td>255</td>
+
+ <td>This is not a style but is the number of the maximum style that can be set. Styles
+ between <code>STYLE_LASTPREDEFINED</code> and <code>STYLE_MAX</code> may be used.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>For each style you can set the font name, size and use of bold, italic and underline,
+ foreground and background colour and the character set. You can also choose to hide text with a
+ given style, display all characters as upper or lower case and fill from the last character on
+ a line to the end of the line (for embedded languages). There is also an experimental attribute
+ to make text read-only.</p>
+
+ <p>It is entirely up to you how you use styles. If you want to use syntax colouring you might
+ use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings,
+ style 4 for preprocessor, style 5 for operators, and so on.</p>
+ <code><a class="message" href="#SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</a><br />
+ <a class="message" href="#SCI_STYLECLEARALL">SCI_STYLECLEARALL</a><br />
+ <a class="message" href="#SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, char
+ *fontName)</a><br />
+ <a class="message" href="#SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</a><br />
+ <a class="message" href="#SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int
+ sizeInPoints)</a><br />
+ <a class="message" href="#SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETSIZEFRACTIONAL">SCI_STYLESETSIZEFRACTIONAL(int styleNumber, int
+ sizeInHundredthPoints)</a><br />
+ <a class="message" href="#SCI_STYLEGETSIZEFRACTIONAL">SCI_STYLEGETSIZEFRACTIONAL(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool
+ bold)</a><br />
+ <a class="message" href="#SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETWEIGHT">SCI_STYLESETWEIGHT(int styleNumber, int
+ weight)</a><br />
+ <a class="message" href="#SCI_STYLEGETWEIGHT">SCI_STYLEGETWEIGHT(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool
+ italic)</a><br />
+ <a class="message" href="#SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool
+ underline)</a><br />
+ <a class="message" href="#SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_STYLEGETBACK">SCI_STYLEGETBACK(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool
+ eolFilled)</a><br />
+ <a class="message" href="#SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber,
+ int charSet)</a><br />
+ <a class="message" href="#SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int
+ caseMode)</a><br />
+ <a class="message" href="#SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool
+ visible)</a><br />
+ <a class="message" href="#SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool
+ changeable)</a><br />
+ <a class="message" href="#SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</a><br />
+ <a class="message" href="#SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool
+ hotspot)</a><br />
+ <a class="message" href="#SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</a><br />
+ </code>
+
+ <p><b id="SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</b><br />
+ This message resets <code>STYLE_DEFAULT</code> to its state when Scintilla was
+ initialised.</p>
+
+ <p><b id="SCI_STYLECLEARALL">SCI_STYLECLEARALL</b><br />
+ This message sets all styles to have the same attributes as <code>STYLE_DEFAULT</code>. If you
+ are setting up Scintilla for syntax colouring, it is likely that the lexical styles you set
+ will be very similar. One way to set the styles is to:<br />
+ 1. Set <code>STYLE_DEFAULT</code> to the common features of all styles.<br />
+ 2. Use <code>SCI_STYLECLEARALL</code> to copy this to all styles.<br />
+ 3. Set the style attributes that make your lexical styles different.</p>
+
+ <p><b id="SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, const char *fontName)</b><br />
+ <b id="SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName NUL-terminated)</b><br />
+ <b id="SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)</b><br />
+ <b id="SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</b><br />
+ <b id="SCI_STYLESETSIZEFRACTIONAL">SCI_STYLESETSIZEFRACTIONAL(int styleNumber, int sizeInHundredthPoints)</b><br />
+ <b id="SCI_STYLEGETSIZEFRACTIONAL">SCI_STYLEGETSIZEFRACTIONAL(int styleNumber)</b><br />
+ <b id="SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool bold)</b><br />
+ <b id="SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</b><br />
+ <b id="SCI_STYLESETWEIGHT">SCI_STYLESETWEIGHT(int styleNumber, int weight)</b><br />
+ <b id="SCI_STYLEGETWEIGHT">SCI_STYLEGETWEIGHT(int styleNumber)</b><br />
+ <b id="SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool italic)</b><br />
+ <b id="SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</b><br />
+ These messages (plus <a class="message"
+ href="#SCI_STYLESETCHARACTERSET"><code>SCI_STYLESETCHARACTERSET</code></a>) set the font
+ attributes that are used to match the fonts you request to those available.</p>
+ <p>The
+ <code>fontName</code> is a zero terminated string holding the name of a font. Under Windows,
+ only the first 32 characters of the name are used, the name is decoded as UTF-8, and the name is not case sensitive. For
+ internal caching, Scintilla tracks fonts by name and does care about the casing of font names,
+ so please be consistent.
+ On GTK+, Pango is used to display text and the name is sent directly to Pango without transformation.
+ On Qt, the name is decoded as UTF-8.
+ On Cocoa, the name is decoded as MacRoman.</p>
+ <p>Sizes can be set to a whole number of points with <code>SCI_STYLESETSIZE</code>
+ or to a fractional point size in hundredths of a point with <code>SCI_STYLESETSIZEFRACTIONAL</code>
+ by multiplying the size by 100 (<code>SC_FONT_SIZE_MULTIPLIER</code>).
+ For example, a text size of 9.4 points is set with <code>SCI_STYLESETSIZEFRACTIONAL(&lt;style&gt;, 940)</code>.
+ </p>
+ <p>The weight or boldness of a font can be set with <code>SCI_STYLESETBOLD</code>
+ or <code>SCI_STYLESETWEIGHT</code>. The weight is a number between 1 and 999 with 1 being very light
+ and 999 very heavy. While any value can be used, fonts often only support between 2 and 4 weights with three weights
+ being common enough to have symbolic names:
+ <code>SC_WEIGHT_NORMAL</code> (400),
+ <code>SC_WEIGHT_SEMIBOLD</code> (600), and
+ <code>SC_WEIGHT_BOLD</code> (700).
+ The <code>SCI_STYLESETBOLD</code> message takes a boolean argument with 0 choosing <code>SC_WEIGHT_NORMAL</code>
+ and 1 <code>SC_WEIGHT_BOLD</code>.
+ </p>
+
+ <p><b id="SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool
+ underline)</b><br />
+ <b id="SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</b><br />
+ You can set a style to be underlined. The underline is drawn in the foreground colour. All
+ characters with a style that includes the underline attribute are underlined, even if they are
+ white space.</p>
+
+ <p><b id="SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</b><br />
+ <b id="SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_STYLEGETBACK">SCI_STYLEGETBACK(int styleNumber)</b><br />
+ Text is drawn in the foreground colour. The space in each character cell that is not occupied
+ by the character is drawn in the background colour.</p>
+
+ <p><b id="SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool
+ eolFilled)</b><br />
+ <b id="SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</b><br />
+ If the last character in the line has a style with this attribute set, the remainder of the
+ line up to the right edge of the window is filled with the background colour set for the last
+ character. This is useful when a document contains embedded sections in another language such
+ as HTML pages with embedded JavaScript. By setting <code>eolFilled</code> to <code>true</code>
+ and a consistent background colour (different from the background colour set for the HTML
+ styles) to all JavaScript styles then JavaScript sections will be easily distinguished from
+ HTML.</p>
+
+ <p><b id="SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber, int
+ charSet)</b><br />
+ <b id="SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</b><br />
+ You can set a style to use a different character set than the default. The places where such
+ characters sets are likely to be useful are comments and literal strings. For example,
+ <code>SCI_STYLESETCHARACTERSET(SCE_C_STRING, SC_CHARSET_RUSSIAN)</code> would ensure that
+ strings in Russian would display correctly in C and C++ (<code>SCE_C_STRING</code> is the style
+ number used by the C and C++ lexer to display literal strings; it has the value 6). This
+ feature works differently on Windows and GTK+.</p>
+
+ <p>The character sets supported on Windows are:<br />
+ <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_ARABIC</code>, <code>SC_CHARSET_BALTIC</code>,
+ <code>SC_CHARSET_CHINESEBIG5</code>, <code>SC_CHARSET_DEFAULT</code>,
+ <code>SC_CHARSET_EASTEUROPE</code>, <code>SC_CHARSET_GB2312</code>,
+ <code>SC_CHARSET_GREEK</code>, <code>SC_CHARSET_HANGUL</code>, <code>SC_CHARSET_HEBREW</code>,
+ <code>SC_CHARSET_JOHAB</code>, <code>SC_CHARSET_MAC</code>, <code>SC_CHARSET_OEM</code>,
+ <code>SC_CHARSET_RUSSIAN</code> (code page 1251),
+ <code>SC_CHARSET_SHIFTJIS</code>, <code>SC_CHARSET_SYMBOL</code>, <code>SC_CHARSET_THAI</code>,
+ <code>SC_CHARSET_TURKISH</code>, and <code>SC_CHARSET_VIETNAMESE</code>.</p>
+
+ <p>The character sets supported on GTK+ are:<br />
+ <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_CYRILLIC</code> (code page 1251),
+ <code>SC_CHARSET_EASTEUROPE</code>,
+ <code>SC_CHARSET_GB2312</code>, <code>SC_CHARSET_HANGUL</code>,
+ <code>SC_CHARSET_RUSSIAN</code> (KOI8-R), <code>SC_CHARSET_SHIFTJIS</code>, and
+ <code>SC_CHARSET_8859_15</code>.</p>
+
+ <p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int caseMode)</b><br />
+ <b id="SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</b><br />
+ The value of caseMode determines how text is displayed. You can set upper case
+ (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or display
+ normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is
+ displayed.</p>
+
+ <p><b id="SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool visible)</b><br />
+ <b id="SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</b><br />
+ Text is normally visible. However, you can completely hide it by giving it a style with the
+ <code>visible</code> set to 0. This could be used to hide embedded formatting instructions or
+ hypertext keywords in HTML or XML.</p>
+
+ <p><b id="SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool
+ changeable)</b><br />
+ <b id="SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</b><br />
+ This is an experimental and incompletely implemented style attribute. The default setting is
+ <code>changeable</code> set <code>true</code> but when set <code>false</code> it makes text
+ read-only. Currently it only stops the caret from being within not-changeable text and does not
+ yet stop deleting a range that contains not-changeable text.</p>
+
+ <p><b id="SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool
+ hotspot)</b><br />
+ <b id="SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</b><br />
+ This style is used to mark ranges of text that can detect mouse clicks.
+ The cursor changes to a hand over hotspots, and the foreground, and background colours
+ may change and an underline appear to indicate that these areas are sensitive to clicking.
+ This may be used to allow hyperlinks to other documents.</p>
+
+ <h2 id="CaretAndSelectionStyles">Caret, selection, and hotspot styles</h2>
+
+ <p>The selection is shown by changing the foreground and/or background colours. If one of these
+ is not set then that attribute is not changed for the selection. The default is to show the
+ selection by changing the background to light grey and leaving the foreground the same as when
+ it was not selected. When there is no selection, the current insertion point is marked by the
+ text caret. This is a vertical line that is normally blinking on and off to attract the users
+ attention.</p>
+ <code><a class="message" href="#SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour, int colour)</a><br />
+ <a class="message" href="#SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour, int colour)</a><br />
+ <a class="message" href="#SCI_SETSELALPHA">SCI_SETSELALPHA(int alpha)</a><br />
+ <a class="message" href="#SCI_GETSELALPHA">SCI_GETSELALPHA</a><br />
+ <a class="message" href="#SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</a><br />
+ <a class="message" href="#SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</a><br />
+ <a class="message" href="#SCI_SETCARETFORE">SCI_SETCARETFORE(int colour)</a><br />
+ <a class="message" href="#SCI_GETCARETFORE">SCI_GETCARETFORE</a><br />
+ <a class="message" href="#SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool show)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</a><br />
+ <a class="message" href="#SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int colour)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</a><br />
+ <a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int alpha)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</a><br />
+ <a class="message" href="#SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</a><br />
+ <a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</a><br />
+ <a class="message" href="#SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</a><br />
+ <a class="message" href="#SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</a><br />
+ <a class="message" href="#SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</a><br />
+ <a class="message" href="#SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</a><br />
+ <a class="message" href="#SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</a><br />
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useSetting, int colour)</a><br />
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</a><br />
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useSetting, int colour)</a><br />
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</a><br />
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</a><br />
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</a><br />
+ <a class="message" href="#SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</a><br />
+ <a class="message" href="#SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</a><br />
+ <a class="message" href="#SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(int useCaretStickyBehaviour)</a><br />
+ <a class="message" href="#SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</a><br />
+ <a class="message" href="#SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</a><br />
+ </code>
+
+ <p><b id="SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ You can choose to override the default selection colouring with these two messages. The colour
+ you provide is used if you set <code>useSelection*Colour</code> to <code>true</code>. If it is
+ set to <code>false</code>, the default styled colouring is used and the <code>colour</code>
+ argument has no effect.</p>
+ <p><b id="SCI_SETSELALPHA">SCI_SETSELALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />
+ <b id="SCI_GETSELALPHA">SCI_GETSELALPHA</b><br />
+ The selection can be drawn translucently in the selection background colour by
+ setting an alpha value.</p>
+
+ <p><b id="SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</b><br />
+ <b id="SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</b><br />
+ The selection can be drawn up to the right hand border by setting this property.</p>
+
+ <p><b id="SCI_SETCARETFORE">SCI_SETCARETFORE(int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETCARETFORE">SCI_GETCARETFORE</b><br />
+ The colour of the caret can be set with <code>SCI_SETCARETFORE</code> and retrieved with
+ <code>SCI_GETCARETFORE</code>.</p>
+
+ <p><b id="SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool show)</b><br />
+ <b id="SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</b><br />
+ <b id="SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</b><br />
+ <b id="SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />
+ <b id="SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</b><br />
+ You can choose to make the background colour of the line containing the caret different with
+ these messages. To do this, set the desired background colour with
+ <code>SCI_SETCARETLINEBACK</code>, then use <code>SCI_SETCARETLINEVISIBLE(true)</code> to
+ enable the effect. You can cancel the effect with <code>SCI_SETCARETLINEVISIBLE(false)</code>.
+ The two <code>SCI_GETCARET*</code> functions return the state and the colour. This form of
+ background colouring has highest priority when a line has markers that would otherwise change
+ the background colour.
+ The caret line may also be drawn translucently which allows other background colours to show
+ through. This is done by setting the alpha (translucency) value by calling
+ SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA,
+ the caret line is drawn after all other features so will affect the colour of all other features.
+ </p>
+
+ <p><b id="SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</b><br />
+ <b id="SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</b><br />
+ Choose to make the caret line always visible even when the window is not in focus.
+ Default behaviour <code>SCI_SETCARETLINEVISIBLEALWAYS(false)</code> the caret line is only visible when the window is in focus.
+ </p>
+
+ <p><b id="SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</b><br />
+ <b id="SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</b><br />
+ The rate at which the caret blinks can be set with <code>SCI_SETCARETPERIOD</code> which
+ determines the time in milliseconds that the caret is visible or invisible before changing
+ state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds.
+ <code>SCI_GETCARETPERIOD</code> returns the current setting.</p>
+
+ <p><b id="SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</b><br />
+ <b id="SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</b><br />
+ The style of the caret can be set with <code>SCI_SETCARETSTYLE</code> to be a line caret
+ (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all
+ (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1).
+ You can determine the current caret style setting using <code>SCI_GETCARETSTYLE</code>.</p>
+
+ <p>The block character draws most combining and multibyte character sequences successfully,
+ though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when
+ the cursor is positioned at these characters, which may result in only drawing a part of the
+ cursor character sequence. This is most notable on Windows platforms.</p>
+
+ <p><b id="SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</b><br />
+ <b id="SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</b><br />
+ The width of the line caret can be set with <code>SCI_SETCARETWIDTH</code> to a value of
+ 0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with
+ <code>SCI_GETCARETWIDTH</code>. A width of 0 makes the caret invisible (added at version
+ 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangeable).
+ This setting only affects the width of the cursor when the cursor style is set to line caret
+ mode, it does not affect the width for a block caret.</p>
+
+ <p><b id="SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</b><br />
+ <b id="SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useHotSpotBackColour, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</b><br />
+ <b id="SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</b><br />
+ <b id="SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</b><br />
+ <b id="SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</b><br />
+ <b id="SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</b><br />
+ While the cursor hovers over text in a style with the hotspot attribute set,
+ the default colouring can be modified and an underline drawn with these settings.
+ Single line mode stops a hotspot from wrapping onto next line.</p>
+
+ <p><b id="SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(int useCaretStickyBehaviour)</b><br />
+ <b id="SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</b><br />
+ <b id="SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</b><br />
+ These messages set, get or toggle the caretSticky setting which controls when the last position
+ of the caret on the line is saved.</p>
+
+ <p>When set to <code>SC_CARETSTICKY_OFF</code> (0), the sticky flag is off; all text changes
+ (and all caret position changes) will remember the
+ caret's new horizontal position when moving to different lines. This is the default.</p>
+
+ <p>When set to <code>SC_CARETSTICKY_ON</code> (1), the sticky flag is on, and the only thing which will cause the editor to remember the
+ horizontal caret position is moving the caret with mouse or keyboard (left/right arrow keys, home/end keys, etc). </p>
+
+ <p>When set to <code>SC_CARETSTICKY_WHITESPACE</code> (2), the caret acts like mode 0 (sticky off) except under one
+ special case; when space or tab characters are inserted. (Including pasting <b>only space/tabs</b> -- undo, redo,
+ etc. do not exhibit this behaviour..).</p>
+
+ <p><code>SCI_TOGGLECARETSTICKY</code> switches from <code>SC_CARETSTICKY_ON</code> and <code>SC_CARETSTICKY_WHITESPACE</code>
+ to <code>SC_CARETSTICKY_OFF</code> and from <code>SC_CARETSTICKY_OFF</code> to <code>SC_CARETSTICKY_ON</code>.</p>
+
+ <h2 id="CharacterRepresentations">Character representations</h2>
+
+ <p>Some characters, such as control characters and invalid bytes, do not have a visual glyph or use a glyph that is hard to distinguish.</p>
+
+ <p>Control characters (characters with codes less than 32, or between 128 and 159 in some encodings)
+ are displayed by Scintilla using their mnemonics inverted in a rounded rectangle. These mnemonics come from the
+ early days of signalling, though some are still used (LF = Line Feed, BS = Back Space, CR =
+ Carriage Return, for example).</p>
+
+ <p>For the low 'C0' values: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
+ "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US".</p>
+
+ <p>For the high 'C1' values:
+ "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
+ "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3",
+ "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA",
+ "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC".</p>
+
+ <p>Invalid bytes are shown in a similar way with an 'x' followed by their value in hexadecimal, like "xFE".</p>
+
+ <code>
+ <a class="message" href="#SCI_SETREPRESENTATION">SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)</a><br />
+ <a class="message" href="#SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation)</a><br />
+ <a class="message" href="#SCI_CLEARREPRESENTATION">SCI_CLEARREPRESENTATION(const char *encodedCharacter)</a><br />
+ <a class="message" href="#SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</a><br />
+ <a class="message" href="#SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</a><br />
+ </code>
+
+ <p><b id="SCI_SETREPRESENTATION">SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)</b><br />
+ <b id="SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation NUL-terminated)</b><br />
+ <b id="SCI_CLEARREPRESENTATION">SCI_CLEARREPRESENTATION(const char *encodedCharacter)</b><br />
+ Any character, including those normally displayed as mnemonics may be represented by a
+ string inverted in a rounded rectangle.</p>
+
+ <p>For example, the Ohm sign &#x2126; U+2126 looks very similar to the Greek Omega character &#x3a9; U+03C9 so,
+ for the UTF-8 encoding, to distinguish the Ohm sign as "U+2126 &#x2126;" this call could be made:
+ <code>SCI_SETREPRESENTATION("\xe2\x84\xa6", "U+2126 \xe2\x84\xa6")</code></p>
+
+ <p>The encodedCharacter parameter is a NUL-terminated string of the bytes for one character in the
+ current encoding. This can not be used to set a representation for multiple-character strings. </p>
+
+ <p>The NUL (0) character is a special case since the encodedCharacter parameter is NUL terminated, the NUL
+ character is specified as an empty string.</p>
+
+ <p><b id="SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</b><br />
+ <b id="SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</b><br />
+ The mnemonics may be replaced by a nominated symbol with an ASCII code in the
+ range 32 to 255. If you set a symbol value less than 32, all control characters are displayed
+ as mnemonics. The symbol you set is rendered in the font of the style set for the character.
+ You can read back the current symbol with the <code>SCI_GETCONTROLCHARSYMBOL</code> message.
+ The default symbol value is 0.</p>
+
+ <h2 id="Margins">Margins</h2>
+
+ <p>There may be up to five margins, numbered 0 to <code>SC_MAX_MARGIN</code> (4)
+ to the left of the text display, plus a gap either side of
+ the text. Each margin can be set to display only symbols, line numbers, or text with <a
+ class="message" href="#SCI_SETMARGINTYPEN"><code>SCI_SETMARGINTYPEN</code></a>.
+ Textual margins may also display symbols.
+ The markers
+ that can be displayed in each margin are set with <a class="message"
+ href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a>. Any markers not associated with
+ a visible margin will be displayed as changes in background colour in the text. A width in
+ pixels can be set for each margin. Margins with a zero width are ignored completely. You can
+ choose if a mouse click in a margin sends a <a class="message"
+ href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> notification to the container or
+ selects a line of text.</p>
+
+ <p>The margins are numbered 0 to 4. Using a margin number outside the valid range has no
+ effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it
+ is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so
+ it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it
+ is hidden. Of course, you can set the margins to be whatever you wish.</p>
+
+ <p>Styled text margins used to show revision and blame information:</p>
+ <p><img src="styledmargin.png" alt="Styled text margins used to show revision and blame information" /></p>
+
+ <code><a class="message" href="#SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int
+ type)</a><br />
+ <a class="message" href="#SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</a><br />
+ <a class="message" href="#SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int
+ pixelWidth)</a><br />
+ <a class="message" href="#SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</a><br />
+ <a class="message" href="#SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int
+ mask)</a><br />
+ <a class="message" href="#SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</a><br />
+ <a class="message" href="#SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool
+ sensitive)</a><br />
+ <a class="message" href="#SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int
+ margin)</a><br />
+ <a class="message" href="#SCI_SETMARGINCURSORN">SCI_SETMARGINCURSORN(int margin, int
+ cursor)</a><br />
+ <a class="message" href="#SCI_GETMARGINCURSORN">SCI_GETMARGINCURSORN(int
+ margin)</a><br />
+ <a class="message" href="#SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(&lt;unused&gt;, int
+ pixels)</a><br />
+ <a class="message" href="#SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</a><br />
+ <a class="message" href="#SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(&lt;unused&gt;, int
+ pixels)</a><br />
+ <a class="message" href="#SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</a><br />
+ <a class="message" href="#SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</a><br />
+ <a class="message" href="#SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</a><br />
+ <a class="message" href="#SCI_MARGINSETTEXT">SCI_MARGINSETTEXT(int line, char *text)</a><br />
+ <a class="message" href="#SCI_MARGINGETTEXT">SCI_MARGINGETTEXT(int line, char *text)</a><br />
+ <a class="message" href="#SCI_MARGINSETSTYLE">SCI_MARGINSETSTYLE(int line, int style)</a><br />
+ <a class="message" href="#SCI_MARGINGETSTYLE">SCI_MARGINGETSTYLE(int line)</a><br />
+ <a class="message" href="#SCI_MARGINSETSTYLES">SCI_MARGINSETSTYLES(int line, char *styles)</a><br />
+ <a class="message" href="#SCI_MARGINGETSTYLES">SCI_MARGINGETSTYLES(int line, char *styles)</a><br />
+ <a class="message" href="#SCI_MARGINTEXTCLEARALL">SCI_MARGINTEXTCLEARALL</a><br />
+ <a class="message" href="#SCI_MARGINSETSTYLEOFFSET">SCI_MARGINSETSTYLEOFFSET(int style)</a><br />
+ <a class="message" href="#SCI_MARGINGETSTYLEOFFSET">SCI_MARGINGETSTYLEOFFSET</a><br />
+ <a class="message" href="#SCI_SETMARGINOPTIONS">SCI_SETMARGINOPTIONS(int marginOptions)</a><br />
+ <a class="message" href="#SCI_GETMARGINOPTIONS">SCI_GETMARGINOPTIONS</a><br />
+ </code>
+
+ <p><b id="SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int iType)</b><br />
+ <b id="SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</b><br />
+ These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4.
+ You can use the predefined constants <code>SC_MARGIN_SYMBOL</code> (0) and
+ <code>SC_MARGIN_NUMBER</code> (1) to set a margin as either a line number or a symbol margin.
+ A margin with application defined text may use <code>SC_MARGIN_TEXT</code> (4) or
+ <code>SC_MARGIN_RTEXT</code> (5) to right justify the text.
+ By convention, margin 0 is used for line numbers and the next two are used for symbols. You can
+ also use the constants <code>SC_MARGIN_BACK</code> (2) and <code>SC_MARGIN_FORE</code> (3) for
+ symbol margins that set their background colour to match the STYLE_DEFAULT background and
+ foreground colours.</p>
+
+ <p><b id="SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int pixelWidth)</b><br />
+ <b id="SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</b><br />
+ These routines set and get the width of a margin in pixels. A margin with zero width is
+ invisible. By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, so this
+ is a reasonable guess if you are not sure what would be appropriate. Line number margins widths
+ should take into account the number of lines in the document and the line number style. You
+ could use something like <a class="message"
+ href="#SCI_TEXTWIDTH"><code>SCI_TEXTWIDTH(STYLE_LINENUMBER, "_99999")</code></a> to get a
+ suitable width.</p>
+
+ <p><b id="SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int mask)</b><br />
+ <b id="SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</b><br />
+ The mask is a 32-bit value. Each bit corresponds to one of 32 logical symbols that can be
+ displayed in a margin that is enabled for symbols. There is a useful constant,
+ <code>SC_MASK_FOLDERS</code> (0xFE000000 or -33554432), that is a mask for the 7 logical
+ symbols used to denote folding. You can assign a wide range of symbols and colours to each of
+ the 32 logical symbols, see <a href="#Markers">Markers</a> for more information. If <code>(mask
+ &amp; SC_MASK_FOLDERS)==0</code>, the margin background colour is controlled by style 33 (<a
+ class="message" href="#StyleDefinition"><code>STYLE_LINENUMBER</code></a>).</p>
+
+ <p>You add logical markers to a line with <a class="message"
+ href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. If a line has an associated marker that
+ does not appear in the mask of any margin with a non-zero width, the marker changes the
+ background colour of the line. For example, suppose you decide to use logical marker 10 to mark
+ lines with a syntax error and you want to show such lines by changing the background colour.
+ The mask for this marker is 1 shifted left 10 times (1&lt;&lt;10) which is 0x400. If you make
+ sure that no symbol margin includes 0x400 in its mask, any line with the marker gets the
+ background colour changed.</p>
+
+ <p>To set a non-folding margin 1 use <code>SCI_SETMARGINMASKN(1, ~SC_MASK_FOLDERS)</code>
+ which is the default set by Scintilla.
+ To set a folding margin 2 use <code>SCI_SETMARGINMASKN(2, SC_MASK_FOLDERS)</code>.
+ <code>~SC_MASK_FOLDERS</code> is 0x1FFFFFF in hexadecimal or 33554431
+ decimal. Of course, you may need to display all 32 symbols in a margin, in which case use
+ <code>SCI_SETMARGINMASKN(margin, -1)</code>.</p>
+
+ <p><b id="SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool
+ sensitive)</b><br />
+ <b id="SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int margin)</b><br />
+ Each of the five margins can be set sensitive or insensitive to mouse clicks. A click in a
+ sensitive margin sends a <a class="message"
+ href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> <a class="jump"
+ href="#Notifications">notification</a> to the container. Margins that are not sensitive act as
+ selection margins which make it easy to select ranges of lines. By default, all margins are
+ insensitive.</p>
+
+ <p><b id="SCI_SETMARGINCURSORN">SCI_SETMARGINCURSORN(int margin, int
+ cursor)</b><br />
+ <b id="SCI_GETMARGINCURSORN">SCI_GETMARGINCURSORN(int margin)</b><br />
+ A reversed arrow cursor is normally shown over all margins. This may be changed to a normal arrow with
+ <code>SCI_SETMARGINCURSORN(margin, SC_CURSORARROW)</code> or restored to a
+ reversed arrow with
+ <code>SCI_SETMARGINCURSORN(margin, SC_CURSORREVERSEARROW)</code>.</p>
+
+ <p><b id="SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(&lt;unused&gt;, int pixels)</b><br />
+ <b id="SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</b><br />
+ <b id="SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(&lt;unused&gt;, int pixels)</b><br />
+ <b id="SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</b><br />
+ These messages set and get the width of the blank margin on both sides of the text in pixels.
+ The default is to one pixel on each side.</p>
+
+ <p><b id="SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</b><br />
+ <b id="SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</b><br />
+ These messages allow changing the colour of the fold margin and fold margin highlight.
+ On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight
+ colour to ::GetSysColor(COLOR_3DHIGHLIGHT).</p>
+
+ <p>
+ <b id="SCI_MARGINSETTEXT">SCI_MARGINSETTEXT(int line, char *text)</b><br />
+ <b id="SCI_MARGINGETTEXT">SCI_MARGINGETTEXT(int line, char *text)</b><br />
+ <b id="SCI_MARGINSETSTYLE">SCI_MARGINSETSTYLE(int line, int style)</b><br />
+ <b id="SCI_MARGINGETSTYLE">SCI_MARGINGETSTYLE(int line)</b><br />
+ <b id="SCI_MARGINSETSTYLES">SCI_MARGINSETSTYLES(int line, char *styles)</b><br />
+ <b id="SCI_MARGINGETSTYLES">SCI_MARGINGETSTYLES(int line, char *styles)</b><br />
+ <b id="SCI_MARGINTEXTCLEARALL">SCI_MARGINTEXTCLEARALL</b><br />
+ Text margins are created with the type SC_MARGIN_TEXT or SC_MARGIN_RTEXT.
+ A different string may be set for each line with <code>SCI_MARGINSETTEXT</code>.
+ The whole of the text margin on a line may be displayed in a particular style with
+ <code>SCI_MARGINSETSTYLE</code> or each character may be individually styled with
+ <code>SCI_MARGINSETSTYLES</code> which uses an array of bytes with each byte setting the style
+ of the corresponding text byte similar to <code>SCI_SETSTYLINGEX</code>.
+ Setting a text margin will cause a
+ <a class="message" href="#SC_MOD_CHANGEMARGIN"><code>SC_MOD_CHANGEMARGIN</code></a>
+ notification to be sent.
+ </p>
+ <p>
+ Only some style attributes are active in text margins: font, size/sizeFractional, bold/weight, italics, fore, back, and characterSet.
+ </p>
+ <p>
+ <b id="SCI_MARGINSETSTYLEOFFSET">SCI_MARGINSETSTYLEOFFSET(int style)</b><br />
+ <b id="SCI_MARGINGETSTYLEOFFSET">SCI_MARGINGETSTYLEOFFSET</b><br />
+ Margin styles may be completely separated from standard text styles by setting a style offset. For example,
+ <code>SCI_MARGINSETSTYLEOFFSET(256)</code> would allow the margin styles to be numbered from
+ 256 up to 511 so they do not overlap styles set by lexers. Each style number set with <code>SCI_MARGINSETSTYLE</code>
+ or <code>SCI_MARGINSETSTYLES</code> has the offset added before looking up the style.
+ </p>
+ <p>
+ Always call <a class="message" href="#SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES</a>
+ before <code>SCI_MARGINSETSTYLEOFFSET</code> and use the result as the argument to <code>SCI_MARGINSETSTYLEOFFSET</code>.
+ </p>
+ <p>
+ <b id="SCI_SETMARGINOPTIONS">SCI_SETMARGINOPTIONS(int marginOptions)</b><br />
+ <b id="SCI_GETMARGINOPTIONS">SCI_GETMARGINOPTIONS</b><br />
+ Define margin options by enabling appropriate bit flags. At the moment, only one flag is available
+ <code>SC_MARGINOPTION_SUBLINESELECT</code>=1, which controls how wrapped lines are selected when clicking
+ on margin in front of them. If <code>SC_MARGINOPTION_SUBLINESELECT</code> is set only sub line of wrapped
+ line is selected, otherwise whole wrapped line is selected. Margin options are set to
+ <code>SC_MARGINOPTION_NONE</code>=0 by default.
+ </p>
+
+ <h2 id="Annotations">Annotations</h2>
+
+ <p>Annotations are read-only lines of text underneath each line of editable text.
+ An annotation may consist of multiple lines separated by '\n'.
+ Annotations can be used to display an assembler version of code for debugging or to show diagnostic messages inline or to
+ line up different versions of text in a merge tool.</p>
+ <p>Annotations count as display lines for the methods
+ <a class="message" href="#SCI_VISIBLEFROMDOCLINE"><code>SCI_VISIBLEFROMDOCLINE</code></a> and
+ <a class="message" href="#SCI_DOCLINEFROMVISIBLE"><code>SCI_DOCLINEFROMVISIBLE</code></a></p>
+ <p>Annotations used for inline diagnostics:</p>
+ <p><img src="annotations.png" alt="Annotations used for inline diagnostics" /></p>
+
+ <code>
+ <a class="message" href="#SCI_ANNOTATIONSETTEXT">SCI_ANNOTATIONSETTEXT(int line, char *text)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETTEXT">SCI_ANNOTATIONGETTEXT(int line, char *text)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONSETSTYLE">SCI_ANNOTATIONSETSTYLE(int line, int style)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETSTYLE">SCI_ANNOTATIONGETSTYLE(int line)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONSETSTYLES">SCI_ANNOTATIONSETSTYLES(int line, char *styles)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETSTYLES">SCI_ANNOTATIONGETSTYLES(int line, char *styles)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETLINES">SCI_ANNOTATIONGETLINES(int line)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONCLEARALL">SCI_ANNOTATIONCLEARALL</a><br />
+ <a class="message" href="#SCI_ANNOTATIONSETVISIBLE">SCI_ANNOTATIONSETVISIBLE(int visible)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETVISIBLE">SCI_ANNOTATIONGETVISIBLE</a><br />
+ <a class="message" href="#SCI_ANNOTATIONSETSTYLEOFFSET">SCI_ANNOTATIONSETSTYLEOFFSET(int style)</a><br />
+ <a class="message" href="#SCI_ANNOTATIONGETSTYLEOFFSET">SCI_ANNOTATIONGETSTYLEOFFSET</a><br />
+ </code>
+
+ <p>
+ <b id="SCI_ANNOTATIONSETTEXT">SCI_ANNOTATIONSETTEXT(int line, char *text)</b><br />
+ <b id="SCI_ANNOTATIONGETTEXT">SCI_ANNOTATIONGETTEXT(int line, char *text)</b><br />
+ <b id="SCI_ANNOTATIONSETSTYLE">SCI_ANNOTATIONSETSTYLE(int line, int style)</b><br />
+ <b id="SCI_ANNOTATIONGETSTYLE">SCI_ANNOTATIONGETSTYLE(int line)</b><br />
+ <b id="SCI_ANNOTATIONSETSTYLES">SCI_ANNOTATIONSETSTYLES(int line, char *styles)</b><br />
+ <b id="SCI_ANNOTATIONGETSTYLES">SCI_ANNOTATIONGETSTYLES(int line, char *styles)</b><br />
+ <b id="SCI_ANNOTATIONGETLINES">SCI_ANNOTATIONGETLINES(int line)</b><br />
+ <b id="SCI_ANNOTATIONCLEARALL">SCI_ANNOTATIONCLEARALL</b><br />
+ A different string may be set for each line with <code>SCI_ANNOTATIONSETTEXT</code>.
+ To clear annotations call <code>SCI_ANNOTATIONSETTEXT</code> with a NULL pointer.
+ The whole of the text ANNOTATION on a line may be displayed in a particular style with
+ <code>SCI_ANNOTATIONSETSTYLE</code> or each character may be individually styled with
+ <code>SCI_ANNOTATIONSETSTYLES</code> which uses an array of bytes with each byte setting the style
+ of the corresponding text byte similar to <code>SCI_SETSTYLINGEX</code>. The text must be set first as it
+ specifies how long the annotation is so how many bytes of styling to read.
+ Setting an annotation will cause a
+ <a class="message" href="#SC_MOD_CHANGEANNOTATION"><code>SC_MOD_CHANGEANNOTATION</code></a>
+ notification to be sent.
+ </p>
+ <p>
+ The number of lines annotating a line can be retrieved with <code>SCI_ANNOTATIONGETLINES</code>.
+ All the lines can be cleared of annotations with <code>SCI_ANNOTATIONCLEARALL</code>
+ which is equivalent to clearing each line (setting to 0) and then deleting other memory used for this feature.
+ </p>
+ <p>
+ Only some style attributes are active in annotations: font, size/sizeFractional, bold/weight, italics, fore, back, and characterSet.
+ </p>
+ <p>
+ <b id="SCI_ANNOTATIONSETVISIBLE">SCI_ANNOTATIONSETVISIBLE(int visible)</b><br />
+ <b id="SCI_ANNOTATIONGETVISIBLE">SCI_ANNOTATIONGETVISIBLE</b><br />
+ Annotations can be made visible in a view and there is a choice of display style when visible.
+ The two messages set and get the annotation display mode. The <code>visible</code>
+ argument can be one of:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Annotation visibility">
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>ANNOTATION_HIDDEN</code></th>
+
+ <td>0</td>
+
+ <td>Annotations are not displayed.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>ANNOTATION_STANDARD</code></th>
+
+ <td>1</td>
+
+ <td>Annotations are drawn left justified with no adornment.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>ANNOTATION_BOXED</code></th>
+
+ <td>2</td>
+
+ <td>Annotations are indented to match the text and are surrounded by a box.</td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>ANNOTATION_INDENTED</code></th>
+
+ <td>3</td>
+
+ <td>Annotations are indented to match the text.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>
+ <b id="SCI_ANNOTATIONSETSTYLEOFFSET">SCI_ANNOTATIONSETSTYLEOFFSET(int style)</b><br />
+ <b id="SCI_ANNOTATIONGETSTYLEOFFSET">SCI_ANNOTATIONGETSTYLEOFFSET</b><br />
+ Annotation styles may be completely separated from standard text styles by setting a style offset. For example,
+ <code>SCI_ANNOTATIONSETSTYLEOFFSET(512)</code> would allow the annotation styles to be numbered from
+ 512 up to 767 so they do not overlap styles set by lexers (or margins if margins offset is 256).
+ Each style number set with <code>SCI_ANNOTATIONSETSTYLE</code>
+ or <code>SCI_ANNOTATIONSETSTYLES</code> has the offset added before looking up the style.
+ </p>
+ <p>
+ Always call <a class="message" href="#SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES</a>
+ before <code>SCI_ANNOTATIONSETSTYLEOFFSET</code> and use the result as the argument to <code>SCI_ANNOTATIONSETSTYLEOFFSET</code>.
+ </p>
+
+ <h2 id="OtherSettings">Other settings</h2>
+ <code>
+ <a class="message" href="#SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</a><br />
+ <a class="message" href="#SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</a><br />
+ <a class="message" href="#SCI_SETPHASESDRAW">SCI_SETPHASESDRAW(int phases)</a><br />
+ <a class="message" href="#SCI_GETPHASESDRAW">SCI_GETPHASESDRAW</a><br />
+ <a class="message" href="#SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</a><br />
+ <a class="message" href="#SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</a><br />
+ <a class="message" href="#SCI_SETTECHNOLOGY">SCI_SETTECHNOLOGY(int technology)</a><br />
+ <a class="message" href="#SCI_GETTECHNOLOGY">SCI_GETTECHNOLOGY</a><br />
+ <a class="message" href="#SCI_SETFONTQUALITY">SCI_SETFONTQUALITY(int fontQuality)</a><br />
+ <a class="message" href="#SCI_GETFONTQUALITY">SCI_GETFONTQUALITY</a><br />
+ <a class="message" href="#SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</a><br />
+ <a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE</a><br />
+ <a class="message" href="#SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION(int imeInteraction)</a><br />
+ <a class="message" href="#SCI_GETIMEINTERACTION">SCI_GETIMEINTERACTION</a><br />
+ <a class="message" href="#SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETWORDCHARS">SCI_GETWORDCHARS(&lt;unused&gt;, char *characters)</a><br />
+ <a class="message" href="#SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETWHITESPACECHARS">SCI_GETWHITESPACECHARS(&lt;unused&gt;, char *characters)</a><br />
+ <a class="message" href="#SCI_SETPUNCTUATIONCHARS">SCI_SETPUNCTUATIONCHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETPUNCTUATIONCHARS">SCI_GETPUNCTUATIONCHARS(&lt;unused&gt;, char *characters)</a><br />
+ <a class="message" href="#SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</a><br />
+ <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br />
+ <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br />
+ <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS</a><br />
+ </code>
+
+ <p>To forward a message <code>(WM_XXXX, WPARAM, LPARAM)</code> to Scintilla, you can use
+ <code>SendMessage(hScintilla, WM_XXXX, WPARAM, LPARAM)</code> where <code>hScintilla</code> is
+ the handle to the Scintilla window you created as your editor.</p>
+
+ <p>While we are on the subject of forwarding messages in Windows, the top level window should
+ forward any <code>WM_SETTINGCHANGE</code> messages to Scintilla (this is currently used to
+ collect changes to mouse settings, but could be used for other user interface items in the
+ future).</p>
+
+ <p><b id="SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</b><br />
+ <b id="SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</b><br />
+ These messages turn buffered drawing on or off and report the buffered drawing state. Buffered
+ drawing draws each line into a bitmap rather than directly to the screen and then copies the
+ bitmap to the screen. This avoids flickering although it does take longer. The default is for
+ drawing to be buffered.</p>
+
+ <p><b id="SCI_SETPHASESDRAW">SCI_SETPHASESDRAW(int phases)</b><br />
+ <b id="SCI_GETPHASESDRAW">SCI_GETPHASESDRAW</b><br />
+ There are several orders in which the text area may be drawn offering a trade-off between speed
+ and allowing all pixels of text to be seen even when they overlap other elements.</p>
+ <p>In single phase drawing (<code>SC_PHASES_ONE</code>) each
+ run of characters in one style is drawn along with its background.
+ If a character overhangs the end of a run, such as in "<i>V</i>_" where the
+ "<i>V</i>" is in a different style from the "_", then this can cause the right hand
+ side of the "<i>V</i>" to be overdrawn by the background of the "_" which
+ cuts it off.</p>
+ <p>Two phase drawing (<code>SC_PHASES_TWO</code>)
+ fixes this by drawing all the backgrounds of a line first and then drawing the text
+ in transparent mode. Lines are drawn separately and no line will overlap another
+ so any pixels that overlap into another line such as extreme ascenders and
+ descenders on characters will be cut off.
+ Two phase drawing may flicker more than single phase
+ unless buffered drawing is on or the platform is naturally buffered.
+ The default is for drawing to be two phase.</p>
+ <p>Multiple phase drawing (<code>SC_PHASES_MULTIPLE</code>)
+ draws the whole area multiple times, once for each feature, building up the
+ the appearance in layers or phases. The coloured backgrounds for all lines are
+ drawn before any text and then all the text is drawn in transparent mode over this
+ combined background without clipping text to the line boundaries. This allows
+ extreme ascenders and descenders to overflow into the adjacent lines.
+ This mode is incompatible with buffered drawing and will act as <code>SC_PHASES_TWO</code>
+ if buffered drawing is turned on.
+ Multiple phase drawing is slower than two phase drawing.
+ Setting the layout cache to <a class="message" href="#SCI_SETLAYOUTCACHE">SC_CACHE_PAGE</a>
+ or higher can ensure that multiple phase drawing is not significantly slower.</p>
+
+ <p><b id="SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</b><br />
+ <b id="SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</b><br />
+ This property has been replaced with the preceding PHASESDRAW property which is more general,
+ allowing multiple phase drawing as well as one and two phase drawing.</p>
+
+ <p><b id="SCI_SETTECHNOLOGY">SCI_SETTECHNOLOGY(int technology)</b><br />
+ <b id="SCI_GETTECHNOLOGY">SCI_GETTECHNOLOGY</b><br />
+ The technology property allows choosing between different drawing APIs and options.
+ On most platforms, the only choice is <code>SC_TECHNOLOGY_DEFAULT</code> (0).
+ On Windows Vista or later, <code>SC_TECHNOLOGY_DIRECTWRITE</code> (1),
+ <code class="provisional">SC_TECHNOLOGY_DIRECTWRITERETAIN</code> (2), or
+ <code class="provisional">SC_TECHNOLOGY_DIRECTWRITEDC</code> (3)
+ can be chosen to use the Direct2D and DirectWrite APIs for higher quality antialiased drawing.
+ <code class="provisional">SC_TECHNOLOGY_DIRECTWRITERETAIN</code> differs from
+ <code>SC_TECHNOLOGY_DIRECTWRITE</code> by requesting that the frame
+ is retained after being presented which may prevent drawing failures on some cards and drivers.
+ <code class="provisional">SC_TECHNOLOGY_DIRECTWRITEDC</code> differs from
+ <code>SC_TECHNOLOGY_DIRECTWRITE</code> by using DirectWrite to draw into a GDI DC.
+ Since Direct2D buffers drawing, Scintilla's buffering can be turned off with
+ <code>SCI_SETBUFFEREDDRAW(0)</code>.
+ <span class="provisional">Since <code>SC_TECHNOLOGY_DIRECTWRITERETAIN</code> and
+ <code>SC_TECHNOLOGY_DIRECTWRITEDC</code>
+ are provisional, they may be changed or removed in a future release if a better solution is found.</span></p>
+
+ <p><b id="SCI_SETFONTQUALITY">SCI_SETFONTQUALITY(int fontQuality)</b><br />
+ <b id="SCI_GETFONTQUALITY">SCI_GETFONTQUALITY</b><br />
+ Manage font quality (antialiasing method). Currently, the following values are available on Windows:
+ <code>SC_EFF_QUALITY_DEFAULT</code> (backward compatible),
+ <code>SC_EFF_QUALITY_NON_ANTIALIASED</code>,
+ <code>SC_EFF_QUALITY_ANTIALIASED</code>,
+ <code>SC_EFF_QUALITY_LCD_OPTIMIZED</code>.</p>
+ <p>In case it is necessary to squeeze more options into this property, only a limited number of bits defined
+ by SC_EFF_QUALITY_MASK (0xf) will be used for quality.</p>
+
+ <p><b id="SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</b><br />
+ <b id="SCI_GETCODEPAGE">SCI_GETCODEPAGE</b><br />
+ Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with
+ <code>codePage</code> set to the code page number to set Scintilla to use code page information
+ to ensure double byte characters are treated as one character rather than two. This also stops
+ the caret from moving between the two bytes in a double byte character.
+ Do not use this message to choose between different single byte character sets: it doesn't do that.
+ Call with
+ <code>codePage</code> set to zero to disable DBCS support. The default is
+ <code>SCI_SETCODEPAGE(0)</code>.</p>
+
+ <p>Code page <code>SC_CP_UTF8</code> (65001) sets Scintilla into Unicode mode with the document
+ treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's
+ normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic,
+ Cyrillic, and Han characters. Languages which can use two characters stacked vertically in one
+ horizontal space, such as Thai, will mostly work but there are some issues where the characters
+ are drawn separately leading to visual glitches. Bi-directional text is not supported. </p>
+
+ <p>Code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK),
+ 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab)
+ although these may require installation of language specific support.</p>
+
+ <p><b id="SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION(int imeInteraction)</b><br />
+ <b id="SCI_GETIMEINTERACTION">SCI_GETIMEINTERACTION</b><br />
+ When entering text in Chinese, Japanese, or Korean an Input Method Editor (IME) may be displayed.
+ The IME may be an extra window appearing above Scintilla or may be displayed by Scintilla itself
+ as text. On some platforms there is a choice between the two techniques.
+ A windowed IME <code>SC_IME_WINDOWED</code> (0) may be more similar in appearance and
+ behaviour to the IME in other applications.
+ An inline IME <code>SC_IME_INLINE</code> (1) may work better with some Scintilla features such as
+ rectangular and multiple selection.</p>
+ <p>The windowed behaviour can be chosen with <code>SCI_SETIMEINTERACTION(SC_IME_WINDOWED)</code>
+ and the inline behaviour with <code>SCI_SETIMEINTERACTION(SC_IME_INLINE)</code>.
+ Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.</p>
+
+ <p><b id="SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *characters)</b><br />
+ Scintilla has several functions that operate on words, which are defined to be contiguous
+ sequences of characters from a particular set of characters. This message defines which
+ characters are members of that set. The character sets are set to default values before processing this
+ function.
+ For example, if you don't allow '_' in your set of characters
+ use:<br />
+ <code>SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")</code>;</p>
+
+ <p><b id="SCI_GETWORDCHARS">SCI_GETWORDCHARS(&lt;unused&gt;, char *characters)</b><br />
+ This fills the characters parameter with all the characters included in words.
+ The characters parameter must be large enough to hold all of the characters.
+ If the characters parameter is 0 then the length that should be allocated
+ to store the entire set is returned.</p>
+
+ <p><b id="SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *characters)</b><br />
+ <b id="SCI_GETWHITESPACECHARS">SCI_GETWHITESPACECHARS(&lt;unused&gt;, char *characters)</b><br />
+ Similar to <code>SCI_SETWORDCHARS</code>, this message allows the user to define which chars Scintilla considers
+ as whitespace. Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing
+ such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars
+ as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right.
+ This function should be called after <code>SCI_SETWORDCHARS</code> as it will
+ reset the whitespace characters to the default set.
+ <code>SCI_GETWHITESPACECHARS</code> behaves similarly to <code>SCI_GETWORDCHARS</code>.</p>
+
+ <p><b id="SCI_SETPUNCTUATIONCHARS">SCI_SETPUNCTUATIONCHARS(&lt;unused&gt;, const char *characters)</b><br />
+ <b id="SCI_GETPUNCTUATIONCHARS">SCI_GETPUNCTUATIONCHARS(&lt;unused&gt;, char *characters)</b><br />
+ Similar to <code>SCI_SETWORDCHARS</code> and <code>SCI_SETWHITESPACECHARS</code>, this message
+ allows the user to define which chars Scintilla considers as punctuation.
+ <code>SCI_GETPUNCTUATIONCHARS</code> behaves similarly to <code>SCI_GETWORDCHARS</code>.</p>
+
+ <p><b id="SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</b><br />
+ Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other
+ characters with codes less than 0x20, with word characters set to alphanumeric and '_'.
+ </p>
+
+
+ <p><b id="SCI_GRABFOCUS">SCI_GRABFOCUS</b><br />
+ <b id="SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</b><br />
+ <b id="SCI_GETFOCUS">SCI_GETFOCUS</b><br />
+ Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where
+ focus handling is more complicated than on Windows.</p>
+
+ <p>The internal focus flag can be set with <code>SCI_SETFOCUS</code>. This is used by clients
+ that have complex focus requirements such as having their own window that gets the real focus
+ but with the need to indicate that Scintilla has the logical focus.</p>
+
+ <h2 id="BraceHighlighting">Brace highlighting</h2>
+ <code><a class="message" href="#SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int
+ pos2)</a><br />
+ <a class="message" href="#SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</a><br />
+ <a class="message" href="#SCI_BRACEHIGHLIGHTINDICATOR">SCI_BRACEHIGHLIGHTINDICATOR(bool useBraceHighlightIndicator, int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_BRACEBADLIGHTINDICATOR">SCI_BRACEBADLIGHTINDICATOR(bool useBraceBadLightIndicator, int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_BRACEMATCH">SCI_BRACEMATCH(int position, int
+ maxReStyle)</a><br />
+ </code>
+
+ <p><b id="SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int pos2)</b><br />
+ Up to two characters can be highlighted in a 'brace highlighting style', which is defined as
+ style number <a class="message" href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34).
+ If you have enabled indent guides, you may also wish to highlight the indent that corresponds
+ with the brace. You can locate the column with <a class="message"
+ href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> and highlight the indent with <a
+ class="message" href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</p>
+
+ <p><b id="SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</b><br />
+ If there is no matching brace then the <a class="jump" href="#StyleDefinition">brace
+ badlighting style</a>, style <code>STYLE_BRACEBAD</code> (35), can be used to show the brace
+ that is unmatched. Using a position of <code>INVALID_POSITION</code> (-1) removes the
+ highlight.</p>
+
+ <p><b id="SCI_BRACEHIGHLIGHTINDICATOR">SCI_BRACEHIGHLIGHTINDICATOR(bool useBraceHighlightIndicator, int indicatorNumber)</b><br />
+ Use specified indicator to highlight matching braces instead of changing their style.</p>
+
+ <p><b id="SCI_BRACEBADLIGHTINDICATOR">SCI_BRACEBADLIGHTINDICATOR(bool useBraceBadLightIndicator, int indicatorNumber)</b><br />
+ Use specified indicator to highlight non matching brace instead of changing its style.</p>
+
+ <p><b id="SCI_BRACEMATCH">SCI_BRACEMATCH(int pos, int maxReStyle)</b><br />
+ The <code>SCI_BRACEMATCH</code> message finds a corresponding matching brace given
+ <code>pos</code>, the position of one brace. The brace characters handled are '(', ')', '[',
+ ']', '{', '}', '&lt;', and '&gt;'. The search is forwards from an opening brace and backwards
+ from a closing brace. If the character at position is not a brace character, or a matching
+ brace cannot be found, the return value is -1. Otherwise, the return value is the position of
+ the matching brace.</p>
+
+ <p>A match only occurs if the style of the matching brace is the same as the starting brace or
+ the matching brace is beyond the end of styling. Nested braces are handled correctly. The
+ <code>maxReStyle</code> parameter must currently be 0 - it may be used in the future to limit
+ the length of brace searches.</p>
+
+ <h2 id="TabsAndIndentationGuides">Tabs and Indentation Guides</h2>
+
+ <p>Indentation (the white space at the start of a line) is often used by programmers to clarify
+ program structure and in some languages, for example Python, it may be part of the language
+ syntax. Tabs are normally used in editors to insert a tab character or to pad text with spaces
+ up to the next tab.</p>
+
+ <p>When Scintilla is laying out a section of text, text after a tab character will usually be
+ displayed at the next multiple of TABWIDTH columns from the left. However, it is also possible
+ to explicitly set tabstops in pixels for each line.</p>
+
+ <p>Scintilla can be set to treat tab and backspace in the white space at the start of a line in
+ a special way: inserting a tab indents the line to the next indent position rather than just
+ inserting a tab at the current character position and backspace unindents the line rather than
+ deleting a character. Scintilla can also display indentation guides (vertical lines) to help
+ you to generate code.</p>
+ <code><a class="message" href="#SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</a><br />
+ <a class="message" href="#SCI_GETTABWIDTH">SCI_GETTABWIDTH</a><br />
+ <a class="message" href="#SCI_CLEARTABSTOPS">SCI_CLEARTABSTOPS(int line)</a><br />
+ <a class="message" href="#SCI_ADDTABSTOP">SCI_ADDTABSTOP(int line, int x)</a><br />
+ <a class="message" href="#SCI_GETNEXTTABSTOP">SCI_GETNEXTTABSTOP(int line, int x)</a><br />
+ <a class="message" href="#SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</a><br />
+ <a class="message" href="#SCI_GETUSETABS">SCI_GETUSETABS</a><br />
+ <a class="message" href="#SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</a><br />
+ <a class="message" href="#SCI_GETINDENT">SCI_GETINDENT</a><br />
+ <a class="message" href="#SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</a><br />
+ <a class="message" href="#SCI_GETTABINDENTS">SCI_GETTABINDENTS</a><br />
+ <a class="message" href="#SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool
+ bsUnIndents)</a><br />
+ <a class="message" href="#SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</a><br />
+ <a class="message" href="#SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int
+ indentation)</a><br />
+ <a class="message" href="#SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</a><br />
+ <a class="message" href="#SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int
+ line)</a><br />
+ <a class="message" href="#SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(int indentView)</a><br />
+ <a class="message" href="#SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</a><br />
+ <a class="message" href="#SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</a><br />
+ <a class="message" href="#SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</a><br />
+ </code>
+
+ <p><b id="SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</b><br />
+ <b id="SCI_GETTABWIDTH">SCI_GETTABWIDTH</b><br />
+ <code>SCI_SETTABWIDTH</code> sets the size of a tab as a multiple of the size of a space
+ character in <code>STYLE_DEFAULT</code>. The default tab width is 8 characters. There are no
+ limits on tab sizes, but values less than 1 or large values may have undesirable effects.</p>
+
+ <p><b id="SCI_CLEARTABSTOPS">SCI_CLEARTABSTOPS(int line)</b><br />
+ <b id="SCI_ADDTABSTOP">SCI_ADDTABSTOP(int line, int x)</b><br />
+ <b id="SCI_GETNEXTTABSTOP">SCI_GETNEXTTABSTOP(int line, int x)</b><br />
+ <code>SCI_CLEARTABSTOPS</code> clears explicit tabstops on a line. <code>SCI_ADDTABSTOP</code>
+ adds an explicit tabstop at the specified distance from the left (in pixels), and
+ <code>SCI_GETNEXTTABSTOP</code> gets the next explicit tabstop position set after the given x position,
+ or zero if there aren't any.
+ Changing tab stops produces a <a class="message" href="#SC_MOD_CHANGETABSTOPS">SC_MOD_CHANGETABSTOPS</a> notification.
+ </p>
+
+ <p><b id="SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</b><br />
+ <b id="SCI_GETUSETABS">SCI_GETUSETABS</b><br />
+ <code>SCI_SETUSETABS</code> determines whether indentation should be created out of a mixture
+ of tabs and spaces or be based purely on spaces. Set <code>useTabs</code> to <code>false</code>
+ (0) to create all tabs and indents out of spaces. The default is <code>true</code>. You can use
+ <a class="message" href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> to get the column of a
+ position taking the width of a tab into account.</p>
+ <p><b id="SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</b><br />
+ <b id="SCI_GETINDENT">SCI_GETINDENT</b><br />
+ <code>SCI_SETINDENT</code> sets the size of indentation in terms of the width of a space in <a
+ class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. If you set a width of
+ 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values
+ less than 0 or large values may have undesirable effects.
+ </p>
+
+ <p><b id="SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</b><br />
+ <b id="SCI_GETTABINDENTS">SCI_GETTABINDENTS</b><br />
+ <b id="SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)</b><br />
+ <b id="SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</b><br />
+ </p>
+
+ <p>Inside indentation white space, the tab and backspace keys can be made to indent and
+ unindent rather than insert a tab character or delete a character with the
+ <code>SCI_SETTABINDENTS</code> and <code>SCI_SETBACKSPACEUNINDENTS</code> functions.</p>
+
+ <p><b id="SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int indentation)</b><br />
+ <b id="SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</b><br />
+ The amount of indentation on a line can be discovered and set with
+ <code>SCI_GETLINEINDENTATION</code> and <code>SCI_SETLINEINDENTATION</code>. The indentation is
+ measured in character columns, which correspond to the width of space characters.</p>
+
+ <p><b id="SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int line)</b><br />
+ This returns the position at the end of indentation of a line.</p>
+
+ <p><b id="SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(int indentView)</b><br />
+ <b id="SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</b><br />
+ Indentation guides are dotted vertical lines that appear within indentation white space every
+ indent size columns. They make it easy to see which constructs line up especially when they
+ extend over multiple pages. Style <a class="message"
+ href="#StyleDefinition"><code>STYLE_INDENTGUIDE</code></a> (37) is used to specify the
+ foreground and background colour of the indentation guides.</p>
+
+ <p>There are 4 indentation guide views.
+ SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on
+ empty lines. </p>
+ <table border="0" summary="Search flags">
+ <tbody>
+ <tr>
+ <td><code>SC_IV_NONE</code></td>
+ <td>No indentation guides are shown.</td>
+ </tr>
+
+ <tr>
+ <td><code>SC_IV_REAL</code></td>
+ <td>Indentation guides are shown inside real indentation white space.</td>
+ </tr>
+
+ <tr>
+ <td><code>SC_IV_LOOKFORWARD</code></td>
+ <td>Indentation guides are shown beyond the actual indentation up to the level of the
+ next non-empty line.
+ If the previous non-empty line was a fold header then indentation guides are shown for
+ one more level of indent than that line. This setting is good for Python.</td>
+ </tr>
+
+ <tr>
+ <td><code>SC_IV_LOOKBOTH</code></td>
+ <td>Indentation guides are shown beyond the actual indentation up to the level of the
+ next non-empty line or previous non-empty line whichever is the greater.
+ This setting is good for most languages.</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</b><br />
+ <b id="SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</b><br />
+ When brace highlighting occurs, the indentation guide corresponding to the braces may be
+ highlighted with the brace highlighting style, <a class="message"
+ href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34). Set <code>column</code> to 0 to
+ cancel this highlight.</p>
+
+ <h2 id="Markers">Markers</h2>
+
+ <p>There are 32 markers, numbered 0 to <code>MARKER_MAX</code> (31), and you can assign any combination of them to each
+ line in the document. Markers appear in the <a class="jump" href="#Margins">selection
+ margin</a> to the left of the text. If the selection margin is set to zero width, the
+ background colour of the whole line is changed instead. Marker numbers 25 to 31 are used by
+ Scintilla in folding margins, and have symbolic names of the form <code>SC_MARKNUM_</code>*,
+ for example <code>SC_MARKNUM_FOLDEROPEN</code>.</p>
+
+ <p>Marker numbers 0 to 24 have no pre-defined function; you can use them to mark syntax errors
+ or the current point of execution, break points, or whatever you need marking. If you do not
+ need folding, you can use all 32 for any purpose you wish.</p>
+
+ <p>Each marker number has a symbol associated with it. You can also set the foreground and
+ background colour for each marker number, so you can use the same symbol more than once with
+ different colouring for different uses. Scintilla has a set of symbols you can assign
+ (<code>SC_MARK_</code>*) or you can use characters. By default, all 32 markers are set to
+ <code>SC_MARK_CIRCLE</code> with a black foreground and a white background.</p>
+
+ <p>The markers are drawn in the order of their numbers, so higher numbered markers appear on
+ top of lower numbered ones. Markers try to move with their text by tracking where the start of
+ their line moves. When a line is deleted, its markers are combined, by an <code>OR</code>
+ operation, with the markers of the next line.</p>
+ <code><a class="message" href="#SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int
+ markerSymbols)</a><br />
+ <a class="message" href="#SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber,
+ const char *xpm)</a><br />
+ <a class="message" href="#SCI_RGBAIMAGESETWIDTH">SCI_RGBAIMAGESETWIDTH(int width)</a><br />
+ <a class="message" href="#SCI_RGBAIMAGESETHEIGHT">SCI_RGBAIMAGESETHEIGHT(int height)</a><br />
+ <a class="message" href="#SCI_RGBAIMAGESETSCALE">SCI_RGBAIMAGESETSCALE(int scalePercent)</a><br />
+ <a class="message" href="#SCI_MARKERDEFINERGBAIMAGE">SCI_MARKERDEFINERGBAIMAGE(int markerNumber,
+ const char *pixels)</a><br />
+ <a class="message" href="#SCI_MARKERSYMBOLDEFINED">SCI_MARKERSYMBOLDEFINED(int markerNumber)
+ </a><br />
+ <a class="message" href="#SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_MARKERSETBACKSELECTED">SCI_MARKERSETBACKSELECTED(int markerNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_MARKERENABLEHIGHLIGHT">SCI_MARKERENABLEHIGHLIGHT(int enabled)</a><br />
+ <a class="message" href="#SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int
+ alpha)</a><br />
+ <a class="message" href="#SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</a><br />
+ <a class="message" href="#SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</a><br />
+ <a class="message" href="#SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int
+ markerNumber)</a><br />
+ <a class="message" href="#SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</a><br />
+ <a class="message" href="#SCI_MARKERGET">SCI_MARKERGET(int line)</a><br />
+ <a class="message" href="#SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int
+ markerMask)</a><br />
+ <a class="message" href="#SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int
+ markerMask)</a><br />
+ <a class="message" href="#SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int
+ handle)</a><br />
+ <a class="message" href="#SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int handle)</a><br />
+ </code>
+
+ <p><b id="SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int markerSymbols)</b><br />
+ This message associates a marker number in the range 0 to 31 with one of the marker symbols or
+ an ASCII character. The general-purpose marker symbols currently available are:<br />
+ <code>SC_MARK_CIRCLE</code>,
+ <code>SC_MARK_ROUNDRECT</code>,
+ <code>SC_MARK_ARROW</code>,
+ <code>SC_MARK_SMALLRECT</code>,
+ <code>SC_MARK_SHORTARROW</code>,
+ <code>SC_MARK_EMPTY</code>,
+ <code>SC_MARK_ARROWDOWN</code>,
+ <code>SC_MARK_MINUS</code>,
+ <code>SC_MARK_PLUS</code>,
+ <code>SC_MARK_ARROWS</code>,
+ <code>SC_MARK_DOTDOTDOT</code>,
+ <code>SC_MARK_BACKGROUND</code>,
+ <code>SC_MARK_LEFTRECT</code>,
+ <code>SC_MARK_FULLRECT</code>,
+ <code>SC_MARK_BOOKMARK</code>, and
+ <code>SC_MARK_UNDERLINE</code>.
+ </p>
+
+ <p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only.
+ The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour.
+ <code>SC_MARK_UNDERLINE</code> draws an underline across the text.
+ The <code>SC_MARK_EMPTY</code> symbol is invisible, allowing client code to track the movement
+ of lines. You would also use it if you changed the folding style and wanted one or more of the
+ <code>SC_FOLDERNUM_</code>* markers to have no associated symbol.</p>
+
+ <p>Applications may use the marker symbol <code>SC_MARK_AVAILABLE</code> to indicate that
+ plugins may allocate that marker number.
+ </p>
+
+ <p>There are also marker symbols designed for use in the folding margin in a flattened tree
+ style.<br />
+ <code>SC_MARK_BOXMINUS</code>,
+ <code>SC_MARK_BOXMINUSCONNECTED</code>,
+ <code>SC_MARK_BOXPLUS</code>,
+ <code>SC_MARK_BOXPLUSCONNECTED</code>,
+ <code>SC_MARK_CIRCLEMINUS</code>,
+ <code>SC_MARK_CIRCLEMINUSCONNECTED</code>,
+ <code>SC_MARK_CIRCLEPLUS</code>,
+ <code>SC_MARK_CIRCLEPLUSCONNECTED</code>,
+ <code>SC_MARK_LCORNER</code>,
+ <code>SC_MARK_LCORNERCURVE</code>,
+ <code>SC_MARK_TCORNER</code>,
+ <code>SC_MARK_TCORNERCURVE</code>, and
+ <code>SC_MARK_VLINE</code>.</p>
+ Characters can be used as markers by adding the ASCII value of the character to
+ <code>SC_MARK_CHARACTER</code> (10000). For example, to use 'A' (ASCII code 65) as marker
+ number 1 use:<br />
+ <code>SCI_MARKERDEFINE(1, SC_MARK_CHARACTER+65)</code>. <br />
+
+ <p>The marker numbers <code>SC_MARKNUM_FOLDER</code> and <code>SC_MARKNUM_FOLDEROPEN</code> are
+ used for showing that a fold is present and open or closed. Any symbols may be assigned for
+ this purpose although the (<code>SC_MARK_PLUS</code>, <code>SC_MARK_MINUS</code>) pair or the
+ (<code>SC_MARK_ARROW</code>, <code>SC_MARK_ARROWDOWN</code>) pair are good choices. As well as
+ these two, more assignments are needed for the flattened tree style:
+ <code>SC_MARKNUM_FOLDEREND</code>, <code>SC_MARKNUM_FOLDERMIDTAIL</code>,
+ <code>SC_MARKNUM_FOLDEROPENMID</code>, <code>SC_MARKNUM_FOLDERSUB</code>, and
+ <code>SC_MARKNUM_FOLDERTAIL</code>. The bits used for folding are specified by
+ <code>SC_MASK_FOLDERS</code>, which is commonly used as an argument to
+ <code>SCI_SETMARGINMASKN</code> when defining a margin to be used for folding.</p>
+
+ <p>This table shows which <code>SC_MARK_</code>* symbols should be assigned to which
+ <code>SC_MARKNUM_</code>* marker numbers to obtain four folding styles: Arrow (mimics
+ Macintosh), plus/minus shows folded lines as '+' and opened folds as '-', Circle tree, Box
+ tree.</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Markers used for folding">
+ <thead align="left">
+ <tr>
+ <th><code>SC_MARKNUM_</code>*</th>
+
+ <th>Arrow</th>
+
+ <th>Plus/minus</th>
+
+ <th>Circle tree</th>
+
+ <th>Box tree</th>
+ </tr>
+ </thead>
+
+ <tbody valign="top">
+ <tr>
+ <th align="left"><code>FOLDEROPEN</code></th>
+
+ <td><code>ARROWDOWN</code></td>
+
+ <td><code>MINUS</code></td>
+
+ <td><code>CIRCLEMINUS</code></td>
+
+ <td><code>BOXMINUS</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDER</code></th>
+
+ <td><code>ARROW</code></td>
+
+ <td><code>PLUS</code></td>
+
+ <td><code>CIRCLEPLUS</code></td>
+
+ <td><code>BOXPLUS</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDERSUB</code></th>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>VLINE</code></td>
+
+ <td><code>VLINE</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDERTAIL</code></th>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>LCORNERCURVE</code></td>
+
+ <td><code>LCORNER</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDEREND</code></th>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>CIRCLEPLUSCONNECTED</code></td>
+
+ <td><code>BOXPLUSCONNECTED</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDEROPENMID</code></th>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>CIRCLEMINUSCONNECTED</code></td>
+
+ <td><code>BOXMINUSCONNECTED</code></td>
+ </tr>
+
+ <tr>
+ <th align="left"><code>FOLDERMIDTAIL</code></th>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>EMPTY</code></td>
+
+ <td><code>TCORNERCURVE</code></td>
+
+ <td><code>TCORNER</code></td>
+ </tr>
+ </tbody>
+ </table>
+ <p><img src="Markers.png" alt="Marker samples" /></p>
+
+ <p><b id="SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber, const char
+ *xpm)</b><br />
+ Markers can be set to pixmaps with this message. The
+ <a class="jump" href="#XPM">XPM format</a> is used for the pixmap.
+ Pixmaps use the <code>SC_MARK_PIXMAP</code> marker symbol. </p>
+
+ <p>
+ <b id="SCI_RGBAIMAGESETWIDTH">SCI_RGBAIMAGESETWIDTH(int width)</b><br />
+ <b id="SCI_RGBAIMAGESETHEIGHT">SCI_RGBAIMAGESETHEIGHT(int height)</b><br />
+ <b id="SCI_RGBAIMAGESETSCALE">SCI_RGBAIMAGESETSCALE(int scalePercent)</b><br />
+ <b id="SCI_MARKERDEFINERGBAIMAGE">SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)</b><br />
+ Markers can be set to translucent pixmaps with this message. The
+ <a class="jump" href="#RGBA">RGBA format</a> is used for the pixmap.
+ The width and height must previously been set with the <code>SCI_RGBAIMAGESETWIDTH</code> and
+ <code>SCI_RGBAIMAGESETHEIGHT</code> messages.</p>
+ <p>A scale factor in percent may be set with <code>SCI_RGBAIMAGESETSCALE</code>. This is useful on OS X with
+ a retina display where each display unit is 2 pixels: use a factor of 200 so that each image pixel is displayed using a screen pixel.
+ The default scale, 100, will stretch each image pixel to cover 4 screen pixels on a retina display.</p>
+ <p>Pixmaps use the <code>SC_MARK_RGBAIMAGE</code> marker symbol. </p>
+
+ <p><b id="SCI_MARKERSYMBOLDEFINED">SCI_MARKERSYMBOLDEFINED(int markerNumber)</b><br />
+ Returns the symbol defined for a markerNumber with <code>SCI_MARKERDEFINE</code>
+ or <code>SC_MARK_PIXMAP</code> if defined with <code>SCI_MARKERDEFINEPIXMAP</code>
+ or <code>SC_MARK_RGBAIMAGE</code> if defined with <code>SCI_MARKERDEFINERGBAIMAGE</code>.</p>
+
+ <p><b id="SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ These two messages set the foreground and background colour of a marker number.<br />
+ <b id="SCI_MARKERSETBACKSELECTED">SCI_MARKERSETBACKSELECTED(int markerNumber, int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ This message sets the highlight background colour of a marker number when its folding block is selected. The default colour is #FF0000.</p>
+ <p><b id="SCI_MARKERENABLEHIGHLIGHT">SCI_MARKERENABLEHIGHLIGHT(bool enabled)</b><br />
+ This message allows to enable/disable the highlight folding block when it is selected. (i.e. block that contains the caret)</p>
+ <p><b id="SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int <a class="jump"
+ href="#alpha">alpha</a>)</b><br />
+ When markers are drawn in the content area, either because there is no margin for them or
+ they are of <code>SC_MARK_BACKGROUND</code> or <code>SC_MARK_UNDERLINE</code> types, they may be drawn translucently by
+ setting an alpha value.</p>
+
+ <p><b id="SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</b><br />
+ This message adds marker number <code>markerNumber</code> to a line. The message returns -1 if
+ this fails (illegal line number, out of memory) or it returns a marker handle number that
+ identifies the added marker. You can use this returned handle with <a class="message"
+ href="#SCI_MARKERLINEFROMHANDLE"><code>SCI_MARKERLINEFROMHANDLE</code></a> to find where a
+ marker is after moving or combining lines and with <a class="message"
+ href="#SCI_MARKERDELETEHANDLE"><code>SCI_MARKERDELETEHANDLE</code></a> to delete the marker
+ based on its handle. The message does not check the value of markerNumber, nor does it
+ check if the line already contains the marker.</p>
+
+ <p><b id="SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</b><br />
+ This message can add one or more markers to a line with a single call, specified in the same "one-bit-per-marker" 32-bit integer format returned by
+ <a class="message" href="#SCI_MARKERGET"><code>SCI_MARKERGET</code></a>
+ (and used by the mask-based marker search functions
+ <a class="message" href="#SCI_MARKERNEXT"><code>SCI_MARKERNEXT</code></a> and
+ <a class="message" href="#SCI_MARKERPREVIOUS"><code>SCI_MARKERPREVIOUS</code></a>).
+ As with
+ <a class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>, no check is made
+ to see if any of the markers are already present on the targeted line.</p>
+
+ <p><b id="SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int markerNumber)</b><br />
+ This searches the given line number for the given marker number and deletes it if it is
+ present. If you added the same marker more than once to the line, this will delete one copy
+ each time it is used. If you pass in a marker number of -1, all markers are deleted from the
+ line.</p>
+
+ <p><b id="SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</b><br />
+ This removes markers of the given number from all lines. If markerNumber is -1, it deletes all
+ markers from all lines.</p>
+
+ <p><b id="SCI_MARKERGET">SCI_MARKERGET(int line)</b><br />
+ This returns a 32-bit integer that indicates which markers were present on the line. Bit 0 is
+ set if marker 0 is present, bit 1 for marker 1 and so on.</p>
+
+ <p><b id="SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int markerMask)</b><br />
+ <b id="SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int markerMask)</b><br />
+ These messages search efficiently for lines that include a given set of markers. The search
+ starts at line number <code>lineStart</code> and continues forwards to the end of the file
+ (<code>SCI_MARKERNEXT</code>) or backwards to the start of the file
+ (<code>SCI_MARKERPREVIOUS</code>). The <code>markerMask</code> argument should have one bit set
+ for each marker you wish to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on. The
+ message returns the line number of the first line that contains one of the markers in
+ <code>markerMask</code> or -1 if no marker is found.</p>
+
+ <p><b id="SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int markerHandle)</b><br />
+ The <code>markerHandle</code> argument is an identifier for a marker returned by <a
+ class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches
+ the document for the marker with this handle and returns the line number that contains it or -1
+ if it is not found.</p>
+
+ <p><b id="SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int markerHandle)</b><br />
+ The <code>markerHandle</code> argument is an identifier for a marker returned by <a
+ class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches
+ the document for the marker with this handle and deletes the marker if it is found.</p>
+
+ <h2 id="Indicators">Indicators</h2>
+
+ <p>Indicators are used to display additional information over the top of styling.
+ They can be used to show, for example, syntax errors, deprecated names and bad indentation
+ by drawing underlines under text or boxes around text.</p>
+
+ <p>Indicators may have a different "hover" colour and style when the mouse is over them or the caret is moved into them.
+ This may be used, for example, to indicate that a URL can be clicked.</p>
+
+ <p>Indicators may be displayed as simple underlines, squiggly underlines, a
+ line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.
+ They may also be invisible when used to track pieces of content for the application as <code>INDIC_HIDDEN</code>.</p>
+
+ <p>The <code>SCI_INDIC*</code> messages allow you to get and set the visual appearance of the
+ indicators. They all use an <code>indicatorNumber</code> argument in the range 0 to INDIC_MAX(35)
+ to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use
+ by lexers (0..7) a range for use by containers
+ (8=<code>INDIC_CONTAINER</code> .. 31=<code>INDIC_IME-1</code>)
+ and a range for IME indicators (32=<code>INDIC_IME</code> .. 35=<code>INDIC_IME_MAX</code>).</p>
+
+ <p>Indicators are stored in a format similar to run length encoding which is efficient in both
+ speed and storage for sparse information.</p>
+ <p>An indicator may store different values for each range but currently all values are drawn the same.
+ In the future, it may be possible to draw different values in different styles.</p>
+
+ <p>Originally, Scintilla used a different technique for indicators but this
+ has been <a href="#RemovedFeatures">removed</a>
+ and the APIs perform <a href="#StyleByteIndicators">no action</a>.
+ While both techniques were supported, the term "modern indicators" was used for the
+ newer implementation.</p>
+
+ <code><a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int
+ indicatorStyle)</a><br />
+ <a class="message" href="#SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA(int indicatorNumber, int alpha)</a><br />
+ <a class="message" href="#SCI_INDICGETALPHA">SCI_INDICGETALPHA(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETOUTLINEALPHA">SCI_INDICSETOUTLINEALPHA(int indicatorNumber, int alpha)</a><br />
+ <a class="message" href="#SCI_INDICGETOUTLINEALPHA">SCI_INDICGETOUTLINEALPHA(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</a><br />
+ <a class="message" href="#SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETHOVERSTYLE">SCI_INDICSETHOVERSTYLE(int indicatorNumber, int
+ indicatorStyle)</a><br />
+ <a class="message" href="#SCI_INDICGETHOVERSTYLE">SCI_INDICGETHOVERSTYLE(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETHOVERFORE">SCI_INDICSETHOVERFORE(int indicatorNumber, int
+ colour)</a><br />
+ <a class="message" href="#SCI_INDICGETHOVERFORE">SCI_INDICGETHOVERFORE(int indicatorNumber)</a><br />
+ <a class="message" href="#SCI_INDICSETFLAGS">SCI_INDICSETFLAGS(int indicatorNumber, int flags)</a><br />
+ <a class="message" href="#SCI_INDICGETFLAGS">SCI_INDICGETFLAGS(int indicatorNumber)</a><br />
+ <br />
+
+ <a class="message" href="#SCI_SETINDICATORCURRENT">SCI_SETINDICATORCURRENT(int indicator)</a><br />
+ <a class="message" href="#SCI_GETINDICATORCURRENT">SCI_GETINDICATORCURRENT</a><br />
+ <a class="message" href="#SCI_SETINDICATORVALUE">SCI_SETINDICATORVALUE(int value)</a><br />
+ <a class="message" href="#SCI_GETINDICATORVALUE">SCI_GETINDICATORVALUE</a><br />
+ <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE(int position, int fillLength)</a><br />
+ <a class="message" href="#SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE(int position, int clearLength)</a><br />
+ <a class="message" href="#SCI_INDICATORALLONFOR">SCI_INDICATORALLONFOR(int position)</a><br />
+ <a class="message" href="#SCI_INDICATORVALUEAT">SCI_INDICATORVALUEAT(int indicator, int position)</a><br />
+ <a class="message" href="#SCI_INDICATORSTART">SCI_INDICATORSTART(int indicator, int position)</a><br />
+ <a class="message" href="#SCI_INDICATOREND">SCI_INDICATOREND(int indicator, int position)</a><br />
+
+ <a class="message" href="#SCI_FINDINDICATORSHOW">SCI_FINDINDICATORSHOW(int start, int end)</a><br />
+ <a class="message" href="#SCI_FINDINDICATORFLASH">SCI_FINDINDICATORFLASH(int start, int end)</a><br />
+ <a class="message" href="#SCI_FINDINDICATORHIDE">SCI_FINDINDICATORHIDE</a><br />
+ </code>
+
+ <p><b id="SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int
+ indicatorStyle)</b><br />
+ <b id="SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</b><br />
+ These two messages set and get the style for a particular indicator. The indicator styles
+ currently available are:<br />
+
+ <img src="Indicators.png" alt="Indicator samples" /></p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Indicators">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Visual effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>INDIC_PLAIN</code></td>
+
+ <td align="center">0</td>
+
+ <td>Underlined with a single, straight line.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_SQUIGGLE</code></td>
+
+ <td align="center">1</td>
+
+ <td>A squiggly underline. Requires 3 pixels of descender space.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_TT</code></td>
+
+ <td align="center">2</td>
+
+ <td>A line of small T shapes.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_DIAGONAL</code></td>
+
+ <td align="center">3</td>
+
+ <td>Diagonal hatching.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_STRIKE</code></td>
+
+ <td align="center">4</td>
+
+ <td>Strike out.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_HIDDEN</code></td>
+
+ <td align="center">5</td>
+
+ <td>An indicator with no visual effect.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_BOX</code></td>
+
+ <td align="center">6</td>
+
+ <td>A rectangle around the text.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_ROUNDBOX</code></td>
+
+ <td align="center">7</td>
+
+ <td>A rectangle with rounded corners around the text using translucent drawing with the
+ interior usually more transparent than the border. You can use
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA</a> and
+ <a class="message" href="#SCI_INDICSETOUTLINEALPHA">SCI_INDICSETOUTLINEALPHA</a>
+ to control the alpha transparency values. The default alpha values are 30 for fill colour and 50 for outline colour.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_STRAIGHTBOX</code></td>
+
+ <td align="center">8</td>
+
+ <td>A rectangle around the text using translucent drawing with the
+ interior usually more transparent than the border. You can use
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA</a> and
+ <a class="message" href="#SCI_INDICSETOUTLINEALPHA">SCI_INDICSETOUTLINEALPHA</a>
+ to control the alpha transparency values. The default alpha values are 30 for fill colour and 50 for outline colour.
+ This indicator does not colour the top pixel of the line so that indicators on contiguous lines are visually distinct
+ and disconnected.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_FULLBOX</code></td>
+
+ <td align="center">16</td>
+
+ <td>A rectangle around the text using translucent drawing similar to <code>INDIC_STRAIGHTBOX</code>
+ but covering the entire character area.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_DASH</code></td>
+
+ <td align="center">9</td>
+
+ <td>A dashed underline.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_DOTS</code></td>
+
+ <td align="center">10</td>
+
+ <td>A dotted underline.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_SQUIGGLELOW</code></td>
+
+ <td align="center">11</td>
+
+ <td>Similar to <code>INDIC_SQUIGGLE</code> but only using 2 vertical pixels
+ so will fit under small fonts.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_DOTBOX</code></td>
+
+ <td align="center">12</td>
+
+ <td>A dotted rectangle around the text using translucent drawing.
+ Translucency alternates between the alpha and outline alpha settings with the top-left pixel using the alpha setting.
+ <a class="message" href="#SCI_INDICSETALPHA">SCI_INDICSETALPHA</a> and
+ <a class="message" href="#SCI_INDICSETOUTLINEALPHA">SCI_INDICSETOUTLINEALPHA</a>
+ control the alpha transparency values. The default values are 30 for alpha and 50 for outline alpha.
+ To avoid excessive memory allocation the maximum width of a dotted box is 4000 pixels.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_SQUIGGLEPIXMAP</code></td>
+
+ <td align="center">13</td>
+
+ <td>A version of <code>INDIC_SQUIGGLE</code> that draws using a pixmap instead of
+ as a series of line segments for performance.
+ Measured to be between 3 and 6 times faster than <code>INDIC_SQUIGGLE</code> on GTK+.
+ Appearance will not be as good as <code>INDIC_SQUIGGLE</code> on OS X in HiDPI mode.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_COMPOSITIONTHICK</code></td>
+
+ <td align="center">14</td>
+
+ <td>A 2-pixel thick underline located at the bottom of the line to try to avoid touching the character base.
+ Each side is inset 1 pixel so that different indicators in this style covering a range appear isolated.
+ This is similar to an appearance used for the target in Asian language input composition.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_COMPOSITIONTHIN</code></td>
+
+ <td align="center">15</td>
+
+ <td>A 1-pixel thick underline located just before the bottom of the line.
+ Each side is inset 1 pixel so that different indicators in this style covering a range appear isolated.
+ This is similar to an appearance used for non-target ranges in Asian language input composition.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>INDIC_TEXTFORE</code></td>
+
+ <td align="center">17</td>
+
+ <td>Change the colour of the text to the indicator's fore colour.</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <p>The default indicator styles are equivalent to:<br />
+ <code>SCI_INDICSETSTYLE(0, INDIC_SQUIGGLE);</code><br />
+ <code>SCI_INDICSETSTYLE(1, INDIC_TT);</code><br />
+ <code>SCI_INDICSETSTYLE(2, INDIC_PLAIN);</code></p>
+
+ <p><b id="SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int <a class="jump" href="#colour">colour</a>)</b><br />
+ <b id="SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</b><br />
+ These two messages set and get the colour used to draw an indicator. The default indicator
+ colours are equivalent to:<br />
+ <code>SCI_INDICSETFORE(0, 0x007f00);</code> (dark green)<br />
+ <code>SCI_INDICSETFORE(1, 0xff0000);</code> (light blue)<br />
+ <code>SCI_INDICSETFORE(2, 0x0000ff);</code> (light red)</p>
+
+ <p><b id="SCI_INDICSETALPHA">SCI_INDICSETALPHA(int indicatorNumber, int alpha)</b><br />
+ <b id="SCI_INDICGETALPHA">SCI_INDICGETALPHA(int indicatorNumber)</b><br />
+ These two messages set and get the alpha transparency used for drawing the
+ fill colour of the INDIC_ROUNDBOX and INDIC_STRAIGHTBOX rectangle. The alpha value can range from
+ 0 (completely transparent) to 255 (no transparency).
+ </p>
+
+ <p><b id="SCI_INDICSETOUTLINEALPHA">SCI_INDICSETOUTLINEALPHA(int indicatorNumber, int alpha)</b><br />
+ <b id="SCI_INDICGETOUTLINEALPHA">SCI_INDICGETOUTLINEALPHA(int indicatorNumber)</b><br />
+ These two messages set and get the alpha transparency used for drawing the
+ outline colour of the INDIC_ROUNDBOX and INDIC_STRAIGHTBOX rectangle. The alpha value can range from
+ 0 (completely transparent) to 255 (no transparency).
+ </p>
+
+ <p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br />
+ <b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br />
+ These two messages set and get whether an indicator is drawn under text or over(default).
+ Drawing under text works only for indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a>
+ is enabled.</p>
+
+ <p><b id="SCI_INDICSETHOVERSTYLE">SCI_INDICSETHOVERSTYLE(int indicatorNumber, int
+ indicatorStyle)</b><br />
+ <b id="SCI_INDICGETHOVERSTYLE">SCI_INDICGETHOVERSTYLE(int indicatorNumber)</b><br />
+ <b id="SCI_INDICSETHOVERFORE">SCI_INDICSETHOVERFORE(int indicatorNumber, int <a class="jump" href="#colour">colour</a>)</b><br />
+ <b id="SCI_INDICGETHOVERFORE">SCI_INDICGETHOVERFORE(int indicatorNumber)</b><br />
+ These messages set and get the colour and style used to draw indicators when the mouse is over them or the caret moved into them.
+ The mouse cursor also changes when an indicator is drawn in hover style.
+ The default is for the hover appearance to be the same as the normal appearance and calling
+ <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE</a> or
+ <a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE</a> will
+ also reset the hover attribute.</p>
+
+ <p><b id="SCI_INDICSETFLAGS">SCI_INDICSETFLAGS(int indicatorNumber, int flags)</b><br />
+ <b id="SCI_INDICGETFLAGS">SCI_INDICGETFLAGS(int indicatorNumber)</b><br />
+ These messages set and get the flags associated with an indicator.
+ There is currently one flag defined, <code>SC_INDICFLAG_VALUEFORE</code>: when this flag is set
+ the colour used by the indicator is not from the indicator's fore setting but instead from the value of the indicator at
+ that point in the file. This allows many colours to be displayed for a single indicator. The value is an <a class="jump"
+ href="#colour">RGB integer colour</a> that has been ored with <code>SC_INDICVALUEBIT</code>(0x1000000)
+ when calling <a class="message" href="#SCI_SETINDICATORVALUE">SCI_SETINDICATORVALUE</a>.
+ To find the colour from the value, and the value with <code>SC_INDICVALUEMASK</code>(0xFFFFFF).
+ </p>
+
+ <p>
+ <b id="SCI_SETINDICATORCURRENT">SCI_SETINDICATORCURRENT(int indicator)</b><br />
+ <b id="SCI_GETINDICATORCURRENT">SCI_GETINDICATORCURRENT</b><br />
+ These two messages set and get the indicator that will be affected by calls to
+ <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE(int position, int fillLength)</a> and
+ <a class="message" href="#SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE(int position, int clearLength)</a>.
+ </p>
+
+ <p>
+ <b id="SCI_SETINDICATORVALUE">SCI_SETINDICATORVALUE(int value)</b><br />
+ <b id="SCI_GETINDICATORVALUE">SCI_GETINDICATORVALUE</b><br />
+ These two messages set and get the value that will be set by calls to
+ <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a>.
+ </p>
+
+ <p>
+ <b id="SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE(int position, int fillLength)</b><br />
+ <b id="SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE(int position, int clearLength)</b><br />
+ These two messages fill or clear a range for the current indicator.
+ <code>SCI_INDICATORFILLRANGE</code> fills with the
+ the current value.
+ </p>
+
+ <p>
+ <b id="SCI_INDICATORALLONFOR">SCI_INDICATORALLONFOR(int position)</b><br />
+ Retrieve a bitmap value representing which indicators are non-zero at a position.
+ Only the first 32 indicators are represented in the result so no IME indicators are included.
+ </p>
+
+ <p>
+ <b id="SCI_INDICATORVALUEAT">SCI_INDICATORVALUEAT(int indicator, int position)</b><br />
+ Retrieve the value of a particular indicator at a position.
+ </p>
+
+ <p>
+ <b id="SCI_INDICATORSTART">SCI_INDICATORSTART(int indicator, int position)</b><br />
+ <b id="SCI_INDICATOREND">SCI_INDICATOREND(int indicator, int position)</b><br />
+ Find the start or end of a range with one value from a position within the range.
+ Can be used to iterate through the document to discover all the indicator positions.
+ </p>
+
+ <h3 id="FindIndicators">OS X Find Indicator</h3>
+
+ <p>On OS X search matches are highlighted with an animated gold rounded rectangle.
+ The indicator shows, then briefly grows 25% and shrinks to the original size to draw the user's attention.
+ While this feature is currently only implemented on OS X, it may be implemented on other platforms
+ in the future.</p>
+
+ <p><b id="SCI_FINDINDICATORSHOW">SCI_FINDINDICATORSHOW(int start, int end)</b><br />
+ <b id="SCI_FINDINDICATORFLASH">SCI_FINDINDICATORFLASH(int start, int end)</b><br />
+ These two messages show and animate the find indicator. The indicator remains visible with
+ <code>SCI_FINDINDICATORSHOW</code> and fades out after showing for half a second with
+ <code>SCI_FINDINDICATORFLASH</code>.
+ <code>SCI_FINDINDICATORSHOW</code> behaves similarly to the OS X TextEdit and Safari applications
+ and is best suited to editing documentation where the search target is often a word.
+ <code>SCI_FINDINDICATORFLASH</code> is similar to Xcode and is suited to editing source code
+ where the match will often be located next to operators which would otherwise be hidden under the indicator's
+ padding.
+ </p>
+
+ <p><b id="SCI_FINDINDICATORHIDE">SCI_FINDINDICATORHIDE</b><br />
+ This message hides the find indicator.
+ </p>
+
+ <p>Earlier versions of Scintilla allowed <a href="#StyleByteIndicators">partitioning style bytes</a>
+ between style numbers and indicators and provided APIs for setting and querying this.</p>
+
+
+ <h2 id="Autocompletion">Autocompletion</h2>
+
+ <p>Autocompletion displays a list box showing likely identifiers based upon the user's typing.
+ The user chooses the currently selected item by pressing the tab character or another character
+ that is a member of the fillup character set defined with <code>SCI_AUTOCSETFILLUPS</code>.
+ Autocompletion is triggered by your application. For example, in C if you detect that the user
+ has just typed <code>fred.</code> you could look up <code>fred</code>, and if it has a known
+ list of members, you could offer them in an autocompletion list. Alternatively, you could
+ monitor the user's typing and offer a list of likely items once their typing has narrowed down
+ the choice to a reasonable list. As yet another alternative, you could define a key code to
+ activate the list.</p>
+
+ <p>When the user makes a selection from the list the container is sent a <code><a class="message"
+ href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code> <a class="jump"
+ href="#Notifications">notification message</a>. On return from the notification Scintilla will insert
+ the selected text unless the autocompletion list has been cancelled, for example by the container sending
+ <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code>.</p>
+
+ <p>To make use of autocompletion you must monitor each character added to the document. See
+ <code>SciTEBase::CharAdded()</code> in SciTEBase.cxx for an example of autocompletion.</p>
+ <code><a class="message" href="#SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char
+ *list)</a><br />
+ <a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a><br />
+ <a class="message" href="#SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</a><br />
+ <a class="message" href="#SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</a><br />
+ <a class="message" href="#SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</a><br />
+ <a class="message" href="#SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(&lt;unused&gt;, const char
+ *chars)</a><br />
+ <a class="message" href="#SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char
+ separator)</a><br />
+ <a class="message" href="#SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</a><br />
+ <a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char
+ *select)</a><br />
+ <a class="message" href="#SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</a><br />
+ <a class="message" href="#SCI_AUTOCGETCURRENTTEXT">SCI_AUTOCGETCURRENTTEXT(&lt;unused&gt;,
+ char *text)</a><br />
+ <a class="message" href="#SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool
+ cancel)</a><br />
+ <a class="message" href="#SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</a><br />
+ <a class="message" href="#SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(&lt;unused&gt;, const char
+ *chars)</a><br />
+ <a class="message" href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool
+ chooseSingle)</a><br />
+ <a class="message" href="#SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</a><br />
+ <a class="message" href="#SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool
+ ignoreCase)</a><br />
+ <a class="message" href="#SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</a><br />
+ <a class="message" href="#SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR">SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR(int behaviour)</a><br />
+ <a class="message" href="#SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR">SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR</a><br />
+ <a class="message" href="#SCI_AUTOCSETMULTI">SCI_AUTOCSETMULTI(int multi)</a><br />
+ <a class="message" href="#SCI_AUTOCGETMULTI">SCI_AUTOCGETMULTI</a><br />
+ <a class="message" href="#SCI_AUTOCSETORDER">SCI_AUTOCSETORDER(int order)</a><br />
+ <a class="message" href="#SCI_AUTOCGETORDER">SCI_AUTOCGETORDER</a><br />
+ <a class="message" href="#SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</a><br />
+ <a class="message" href="#SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</a><br />
+ <a class="message" href="#SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool
+ dropRestOfWord)</a><br />
+ <a class="message" href="#SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</a><br />
+ <a class="message" href="#SCI_REGISTERIMAGE">SCI_REGISTERIMAGE(int type, const char *xpmData)</a><br />
+ <a class="message" href="#SCI_REGISTERRGBAIMAGE">SCI_REGISTERRGBAIMAGE(int type, const char *pixels)</a><br />
+ <a class="message" href="#SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</a><br />
+ <a class="message" href="#SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</a><br />
+ <a class="message" href="#SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</a><br />
+ <a class="message" href="#SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</a><br />
+ <a class="message" href="#SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</a><br />
+ <a class="message" href="#SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</a><br />
+ <a class="message" href="#SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</a><br />
+ </code>
+
+ <p><b id="SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char *list)</b><br />
+ This message causes a list to be displayed. <code>lenEntered</code> is the number of
+ characters of the word already entered and <code>list</code> is the list of words separated by
+ separator characters. The initial separator character is a space but this can be set or got
+ with <a class="message" href="#SCI_AUTOCSETSEPARATOR"><code>SCI_AUTOCSETSEPARATOR</code></a>
+ and <a class="message"
+ href="#SCI_AUTOCGETSEPARATOR"><code>SCI_AUTOCGETSEPARATOR</code></a>.</p>
+
+ <p>With default settings, the list of words should be in sorted order.
+ If set to ignore case mode with <a class="message" href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>, then
+ strings are matched after being converted to upper case. One result of this is that the list
+ should be sorted with the punctuation characters '[', '\', ']', '^', '_', and '`' sorted after
+ letters.
+ Alternative handling of list order may be specified with <a class="message" href="#SCI_AUTOCSETORDER">SCI_AUTOCSETORDER</a>
+ </p>
+
+ <p><b id="SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</b><br />
+ This message cancels any displayed autocompletion list. When in autocompletion mode, the list
+ should disappear when the user types a character that can not be part of the autocompletion,
+ such as '.', '(' or '[' when typing an identifier. A set of characters that will cancel
+ autocompletion can be specified with <a class="message"
+ href="#SCI_AUTOCSTOPS"><code>SCI_AUTOCSTOPS</code></a>.</p>
+
+ <p><b id="SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</b><br />
+ This message returns non-zero if there is an active autocompletion list and zero if there is
+ not.</p>
+
+ <p><b id="SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</b><br />
+ This returns the value of the current position when <code>SCI_AUTOCSHOW</code> started display
+ of the list.</p>
+
+ <p><b id="SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</b><br />
+ This message triggers autocompletion. This has the same effect as the tab key.</p>
+
+ <p><b id="SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(&lt;unused&gt;, const char *chars)</b><br />
+ The <code>chars</code> argument is a string containing a list of characters that will
+ automatically cancel the autocompletion list. When you start the editor, this list is
+ empty.</p>
+
+ <p><b id="SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char separator)</b><br />
+ <b id="SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</b><br />
+ These two messages set and get the separator character used to separate words in the
+ <code>SCI_AUTOCSHOW</code> list. The default is the space character.</p>
+
+ <p><b id="SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char *select)</b><br />
+ <b id="SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</b><br />
+ This message selects an item in the autocompletion list. It searches the list of words for the
+ first that matches <code>select</code>. By default, comparisons are case sensitive, but you can
+ change this with <a class="message"
+ href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>. The match is character
+ by character for the length of the <code>select</code> string. That is, if select is "Fred" it
+ will match "Frederick" if this is the first item in the list that begins with "Fred". If an
+ item is found, it is selected. If the item is not found, the autocompletion list closes if
+ auto-hide is true (see <a class="message"
+ href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).<br />
+ The current selection index can be retrieved with <code>SCI_AUTOCGETCURRENT</code>.</p>
+
+ <p><b id="SCI_AUTOCGETCURRENTTEXT">SCI_AUTOCGETCURRENTTEXT(&lt;unused&gt;, char *text NUL-terminated)</b><br />
+ This message retrieves the current selected text in the autocompletion list. Normally the
+ <a class="message" href="#SCN_AUTOCSELECTION"><code>SCN_AUTOCSELECTION</code></a> notification
+ is used instead.</p>
+
+ <p>The value is copied to the <code>text</code> buffer, returning the length (not including the
+ terminating 0). If not found, an empty string is copied to the buffer and 0 is returned.</p>
+
+ <p>If the value argument is 0 then the length that should be allocated to store the value is
+ returned; again, the terminating 0 is not included.</p>
+
+ <p><b id="SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool cancel)</b><br />
+ <b id="SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</b><br />
+ The default behaviour is for the list to be cancelled if the caret moves to the location it
+ was at when the list was displayed. By calling this message with a <code>false</code> argument,
+ the list is not cancelled until the caret moves at least one character before the word being
+ completed.</p>
+
+ <p><b id="SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(&lt;unused&gt;, const char *chars)</b><br />
+ If a fillup character is typed with an autocompletion list active, the currently selected item
+ in the list is added into the document, then the fillup character is added. Common fillup
+ characters are '(', '[' and '.' but others are possible depending on the language. By default,
+ no fillup characters are set.</p>
+
+ <p><b id="SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)</b><br />
+ <b id="SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</b><br />
+ If you use <code>SCI_AUTOCSETCHOOSESINGLE(1)</code> and a list has only one item, it is
+ automatically added and no list is displayed. The default is to display the list even if there
+ is only a single item.</p>
+
+ <p><b id="SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool ignoreCase)</b><br />
+ <b id="SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</b><br />
+ By default, matching of characters to list members is case sensitive. These messages let you
+ set and get case sensitivity.</p>
+
+ <p><b id="SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR">SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR(int behaviour)</b><br />
+ <b id="SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR">SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR</b><br />
+ When autocompletion is set to ignore case (<code>SCI_AUTOCSETIGNORECASE</code>), by default it will
+ nonetheless select the first list member that matches in a case sensitive way to entered characters.
+ This corresponds to a behaviour property of <code>SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE</code> (0).
+ If you want autocompletion to ignore case at all, choose <code>SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE</code> (1).</p>
+
+ <p><b id="SCI_AUTOCSETMULTI">SCI_AUTOCSETMULTI(int multi)</b><br />
+ <b id="SCI_AUTOCGETMULTI">SCI_AUTOCGETMULTI</b><br />
+ When autocompleting with multiple selections present, the autocompleted text can go into just the main selection with
+ <code>SC_MULTIAUTOC_ONCE</code> (0) or into each selection with <code>SC_MULTIAUTOC_EACH</code> (1).
+ The default is <code>SC_MULTIAUTOC_ONCE</code>.</p>
+
+ <p><b id="SCI_AUTOCSETORDER">SCI_AUTOCSETORDER(int order)</b><br />
+ <b id="SCI_AUTOCGETORDER">SCI_AUTOCGETORDER</b><br />
+ The default setting <code>SC_ORDER_PRESORTED</code> (0) requires that the list be provided in alphabetical sorted order.
+ </p>
+ <p>Sorting the list can be done by Scintilla instead of the application with <code>SC_ORDER_PERFORMSORT</code> (1).
+ This will take additional time.
+ </p>
+ <p>Applications that wish to prioritize some values and show the list in order of priority instead
+ of alphabetical order can use <code>SC_ORDER_CUSTOM</code> (2).
+ This requires extra processing in <a class="message" href="#SCI_AUTOCSHOW">SCI_AUTOCSHOW</a> to create a sorted index.
+ </p>
+ <p>Setting the order should be done before calling <a class="message" href="#SCI_AUTOCSHOW">SCI_AUTOCSHOW</a>.
+ </p>
+
+ <p><b id="SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</b><br />
+ <b id="SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</b><br />
+ By default, the list is cancelled if there are no viable matches (the user has typed
+ characters that no longer match a list entry). If you want to keep displaying the original
+ list, set <code>autoHide</code> to <code>false</code>. This also effects <a class="message"
+ href="#SCI_AUTOCSELECT"><code>SCI_AUTOCSELECT</code></a>.</p>
+
+ <p><b id="SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)</b><br />
+ <b id="SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</b><br />
+ When an item is selected, any word characters following the caret are first erased if
+ <code>dropRestOfWord</code> is set <code>true</code>. The default is <code>false</code>.</p>
+
+ <p>
+ <b id="SCI_REGISTERIMAGE">SCI_REGISTERIMAGE(int type, const char *xpmData)</b><br />
+ <b id="SCI_REGISTERRGBAIMAGE">SCI_REGISTERRGBAIMAGE(int type, const char *pixels)</b><br />
+ <b id="SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</b><br />
+ <b id="SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</b><br />
+ <b id="SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</b><br />
+
+ Autocompletion list items may display an image as well as text. Each image is first registered with an integer
+ type. Then this integer is included in the text of the list separated by a '?' from the text. For example,
+ "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen".
+ The images are in either the <a class="jump" href="#XPM">XPM format</a> (<code>SCI_REGISTERIMAGE</code>) or
+ <a class="jump" href="#RGBA">RGBA format</a> (<code>SCI_REGISTERRGBAIMAGE</code>).
+ For <code>SCI_REGISTERRGBAIMAGE</code> the width and height must previously been set with
+ the <a class="message" href="#SCI_RGBAIMAGESETWIDTH"><code>SCI_RGBAIMAGESETWIDTH</code></a> and
+ <a class="message" href="#SCI_RGBAIMAGESETHEIGHT"><code>SCI_RGBAIMAGESETHEIGHT</code></a> messages.
+ The set of registered images can be cleared with <code>SCI_CLEARREGISTEREDIMAGES</code> and the '?' separator changed
+ with <code>SCI_AUTOCSETTYPESEPARATOR</code>.
+ </p>
+
+ <p>
+ <b id="SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</b><br />
+ <b id="SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</b><br />
+
+ Get or set the maximum number of rows that will be visible in an autocompletion list. If there are more rows in the list, then a vertical
+ scrollbar is shown. The default is 5.
+ </p>
+
+ <p>
+ <b id="SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</b><br />
+ <b id="SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</b><br />
+
+ Get or set the maximum width of an autocompletion list expressed as the number of characters in the longest item that will be totally visible.
+ If zero (the default) then the list's width is calculated to fit the item with the most characters. Any items that cannot be fully displayed within
+ the available width are indicated by the presence of ellipsis.
+ </p>
+
+ <h2 id="UserLists">User lists</h2>
+
+ <p>User lists use the same internal mechanisms as autocompletion lists, and all the calls
+ listed for autocompletion work on them; you cannot display a user list at the same time as an
+ autocompletion list is active. They differ in the following respects:</p>
+
+ <p>o The <code><a class="message"
+ href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE</a></code> message has no
+ effect.<br />
+ o When the user makes a selection you are sent a <code><a class="message"
+ href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a></code> <a class="jump"
+ href="#Notifications">notification message</a> rather than <code><a class="message"
+ href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code>.</p>
+
+ <p>BEWARE: if you have set fillup characters or stop characters, these will still be active
+ with the user list, and may result in items being selected or the user list cancelled due to
+ the user typing into the editor.</p>
+
+ <p><b id="SCI_USERLISTSHOW">SCI_USERLISTSHOW(int listType, const char *list)</b><br />
+ The <code>listType</code> parameter is returned to the container as the <code>wParam</code>
+ field of the <a class="message" href="#SCNotification"><code>SCNotification</code></a>
+ structure. It must be greater than 0 as this is how Scintilla tells the difference between an
+ autocompletion list and a user list. If you have different types of list, for example a list of
+ buffers and a list of macros, you can use <code>listType</code> to tell which one has returned
+ a selection. </p>
+
+ <h2 id="CallTips">Call tips</h2>
+
+ <p>Call tips are small windows displaying the arguments to a function and are displayed after
+ the user has typed the name of the function. They normally display characters using the font
+ facename, size and character set defined by
+ <code><a class="message" href="#StyleDefinition">STYLE_DEFAULT</a></code>. You can choose to
+ use <code><a class="message" href="#StyleDefinition">STYLE_CALLTIP</a></code> to define the
+ facename, size, foreground and background colours and character set with
+ <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.
+ This also enables support for Tab characters.
+
+ There is some interaction between call tips and autocompletion lists in that showing a
+ call tip cancels any active autocompletion list, and vice versa.</p>
+
+ <p>Call tips are not implemented on Qt.</p>
+
+ <p>Call tips can highlight part of the text within them. You could use this to highlight the
+ current argument to a function by counting the number of commas (or whatever separator your
+ language uses). See <code>SciTEBase::CharAdded()</code> in <code>SciTEBase.cxx</code> for an
+ example of call tip use.</p>
+
+ <p>The mouse may be clicked on call tips and this causes a
+ <code><a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a></code>
+ notification to be sent to the container. Small up and down arrows may be displayed within
+ a call tip by, respectively, including the characters '\001', or '\002'. This is useful
+ for showing that there are overloaded variants of one function name and that the user can
+ click on the arrows to cycle through the overloads.</p>
+
+ <p>Alternatively, call tips can be displayed when you leave the mouse pointer for a while over
+ a word in response to the <code><a class="message"
+ href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> <a class="jump"
+ href="#Notifications">notification</a> and cancelled in response to <code><a class="message"
+ href="#SCN_DWELLEND">SCN_DWELLEND</a></code>. This method could be used in a debugger to give
+ the value of a variable, or during editing to give information about the word under the
+ pointer.</p>
+ <code><a class="message" href="#SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char
+ *definition)</a><br />
+ <a class="message" href="#SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</a><br />
+ <a class="message" href="#SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</a><br />
+ <a class="message" href="#SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</a><br />
+ <a class="message" href="#SCI_CALLTIPSETPOSSTART">SCI_CALLTIPSETPOSSTART(int posStart)</a><br />
+ <a class="message" href="#SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int highlightStart, int
+ highlightEnd)</a><br />
+ <a class="message" href="#SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</a><br />
+ <a class="message" href="#SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</a><br />
+ <a class="message" href="#SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</a><br />
+ <a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</a><br />
+ <a class="message" href="#SCI_CALLTIPSETPOSITION">SCI_CALLTIPSETPOSITION(bool above)</a><br />
+ </code>
+
+ <p><b id="SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char *definition)</b><br />
+ This message starts the process by displaying the call tip window. If a call tip is already
+ active, this has no effect.<br />
+ <code>posStart</code> is the position in the document at which to align the call tip. The call
+ tip text is aligned to start 1 line below this character unless you have included up and/or
+ down arrows in the call tip text in which case the tip is aligned to the right-hand edge of
+ the rightmost arrow. The assumption is that you will start the text with something like
+ "\001 1 of 3 \002".<br />
+ <code>definition</code> is the call tip text. This can contain multiple lines separated by
+ '\n' (Line Feed, ASCII code 10) characters. Do not include '\r' (Carriage Return, ASCII
+ code 13), as this will most likely print as an empty box. '\t' (Tab, ASCII code 9) is
+ supported if you set a tabsize with
+ <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.<br />
+ The position of the caret is remembered here so that the call tip can be cancelled automatically if subsequent deletion
+ moves the caret before this position.</p>
+
+ <p><b id="SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</b><br />
+ This message cancels any displayed call tip. Scintilla will also cancel call tips for you if
+ you use any keyboard commands that are not compatible with editing the argument list of a
+ function.
+ Call tips are cancelled if you delete back past the position where the caret was when the tip was triggered.</p>
+
+ <p><b id="SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</b><br />
+ This returns 1 if a call tip is active and 0 if it is not active.</p>
+
+ <p><b id="SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</b><br />
+ <b id="SCI_CALLTIPSETPOSSTART">SCI_CALLTIPSETPOSSTART(int posStart)</b><br />
+ This message returns or sets the value of the current position when <code>SCI_CALLTIPSHOW</code>
+ started to display the tip.</p>
+
+ <p><b id="SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int hlStart, int hlEnd)</b><br />
+ This sets the region of the call tips text to display in a highlighted style.
+ <code>hlStart</code> is the zero-based index into the string of the first character to
+ highlight and <code>hlEnd</code> is the index of the first character after the highlight.
+ <code>hlEnd</code> must be greater than <code>hlStart</code>; <code>hlEnd-hlStart</code> is the
+ number of characters to highlight. Highlights can extend over line ends if this is
+ required.</p>
+
+ <p>Unhighlighted text is drawn in a mid grey. Selected text is drawn in a dark blue. The
+ background is white. These can be changed with
+ <code>SCI_CALLTIPSETBACK</code>,
+ <code>SCI_CALLTIPSETFORE</code>, and
+ <code>SCI_CALLTIPSETFOREHLT</code>.
+ </p>
+
+ <p><b id="SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</b><br />
+ The background colour of call tips can be set with this message; the default colour is white.
+ It is not a good idea to set a dark colour as the background as the default colour for normal
+ calltip text is mid grey and the default colour for highlighted text is dark blue. This also
+ sets the background colour of <code>STYLE_CALLTIP</code>.</p>
+
+ <p><b id="SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</b><br />
+ The colour of call tip text can be set with this message; the default colour is mid grey.
+ This also sets the foreground colour of <code>STYLE_CALLTIP</code>.</p>
+
+ <p><b id="SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</b><br />
+ The colour of highlighted call tip text can be set with this message; the default colour
+ is dark blue.</p>
+
+ <p><b id="SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</b><br />
+ This message changes the style used for call tips from <code>STYLE_DEFAULT</code> to
+ <code>STYLE_CALLTIP</code> and sets a tab size in screen pixels. If <code>tabsize</code> is
+ less than 1, Tab characters are not treated specially. Once this call has been used, the
+ call tip foreground and background colours are also taken from the style.</p>
+
+ <p><b id="SCI_CALLTIPSETPOSITION">SCI_CALLTIPSETPOSITION(bool above)</b><br />
+ By default the calltip is displayed below the text, setting above to <code>true</code>
+ (1) will display it above the text.</p>
+
+
+ <h2 id="KeyboardCommands">Keyboard commands</h2>
+
+ <p>To allow the container application to perform any of the actions available to the user with
+ keyboard, all the keyboard actions are messages. They do not take any parameters. These
+ commands are also used when redefining the key bindings with the <a class="message"
+ href="#SCI_ASSIGNCMDKEY"><code>SCI_ASSIGNCMDKEY</code></a> message.</p>
+
+ <table border="0" summary="Keyboard commands">
+ <tbody>
+ <tr>
+ <td><code>SCI_LINEDOWN</code></td>
+
+ <td><code>SCI_LINEDOWNEXTEND</code></td>
+
+ <td><code>SCI_LINEDOWNRECTEXTEND</code></td>
+
+ <td><code>SCI_LINESCROLLDOWN</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_LINEUP</code></td>
+
+ <td><code>SCI_LINEUPEXTEND</code></td>
+
+ <td><code>SCI_LINEUPRECTEXTEND</code></td>
+
+ <td><code>SCI_LINESCROLLUP</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_PARADOWN</code></td>
+
+ <td><code>SCI_PARADOWNEXTEND</code></td>
+
+ <td><code>SCI_PARAUP</code></td>
+
+ <td><code>SCI_PARAUPEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_CHARLEFT</code></td>
+
+ <td><code>SCI_CHARLEFTEXTEND</code></td>
+
+ <td><code>SCI_CHARLEFTRECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_CHARRIGHT</code></td>
+
+ <td><code>SCI_CHARRIGHTEXTEND</code></td>
+
+ <td><code>SCI_CHARRIGHTRECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_WORDLEFT</code></td>
+
+ <td><code>SCI_WORDLEFTEXTEND</code></td>
+
+ <td><code>SCI_WORDRIGHT</code></td>
+
+ <td><code>SCI_WORDRIGHTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_WORDLEFTEND</code></td>
+
+ <td><code>SCI_WORDLEFTENDEXTEND</code></td>
+
+ <td><code>SCI_WORDRIGHTEND</code></td>
+
+ <td><code>SCI_WORDRIGHTENDEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_WORDPARTLEFT</code></td>
+
+ <td><code>SCI_WORDPARTLEFTEXTEND</code></td>
+
+ <td><code>SCI_WORDPARTRIGHT</code></td>
+
+ <td><code>SCI_WORDPARTRIGHTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_HOME</code></td>
+
+ <td><code>SCI_HOMEEXTEND</code></td>
+
+ <td><code>SCI_HOMERECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_HOMEDISPLAY</code></td>
+
+ <td><code>SCI_HOMEDISPLAYEXTEND</code></td>
+
+ <td><code>SCI_HOMEWRAP</code></td>
+
+ <td><code>SCI_HOMEWRAPEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_VCHOME</code></td>
+
+ <td><code>SCI_VCHOMEEXTEND</code></td>
+
+ <td><code>SCI_VCHOMERECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_VCHOMEWRAP</code></td>
+
+ <td><code>SCI_VCHOMEWRAPEXTEND</code></td>
+
+ <td><code>SCI_VCHOMEDISPLAY</code></td>
+
+ <td><code>SCI_VCHOMEDISPLAYEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_LINEEND</code></td>
+
+ <td><code>SCI_LINEENDEXTEND</code></td>
+
+ <td><code>SCI_LINEENDRECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_LINEENDDISPLAY</code></td>
+
+ <td><code>SCI_LINEENDDISPLAYEXTEND</code></td>
+
+ <td><code>SCI_LINEENDWRAP</code></td>
+
+ <td><code>SCI_LINEENDWRAPEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_DOCUMENTSTART</code></td>
+
+ <td><code>SCI_DOCUMENTSTARTEXTEND</code></td>
+
+ <td><code>SCI_DOCUMENTEND</code></td>
+
+ <td><code>SCI_DOCUMENTENDEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_PAGEUP</code></td>
+
+ <td><code>SCI_PAGEUPEXTEND</code></td>
+
+ <td><code>SCI_PAGEUPRECTEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_PAGEDOWN</code></td>
+
+ <td><code>SCI_PAGEDOWNEXTEND</code></td>
+
+ <td><code>SCI_PAGEDOWNRECTEXTEND</code></td>
+ </tr>
+
+
+ <tr>
+ <td><code>SCI_STUTTEREDPAGEUP</code></td>
+
+ <td><code>SCI_STUTTEREDPAGEUPEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_STUTTEREDPAGEDOWN</code></td>
+
+ <td><code>SCI_STUTTEREDPAGEDOWNEXTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_DELETEBACK</code></td>
+
+ <td><code>SCI_DELETEBACKNOTLINE</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_DELWORDLEFT</code></td>
+
+ <td><code>SCI_DELWORDRIGHT</code></td>
+
+ <td><code>SCI_DELWORDRIGHTEND</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_DELLINELEFT</code></td>
+
+ <td><code>SCI_DELLINERIGHT</code></td>
+
+ <td><code>SCI_LINEDELETE</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_LINECUT</code></td>
+
+ <td><code>SCI_LINECOPY</code></td>
+
+ <td><code>SCI_LINETRANSPOSE</code></td>
+
+ <td><code>SCI_LINEDUPLICATE</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_LOWERCASE</code></td>
+
+ <td><code>SCI_UPPERCASE</code></td>
+
+ <td><code>SCI_CANCEL</code></td>
+
+ <td><code>SCI_EDITTOGGLEOVERTYPE</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_NEWLINE</code></td>
+
+ <td><code>SCI_FORMFEED</code></td>
+
+ <td><code>SCI_TAB</code></td>
+
+ <td><code>SCI_BACKTAB</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_SELECTIONDUPLICATE</code></td>
+
+ <td><code>SCI_VERTICALCENTRECARET</code></td>
+
+ </tr>
+
+ <tr>
+ <td><code>SCI_MOVESELECTEDLINESUP</code></td>
+
+ <td><code>SCI_MOVESELECTEDLINESDOWN</code></td>
+ </tr>
+
+ <tr>
+ <td><code>SCI_SCROLLTOSTART</code></td>
+
+ <td><code>SCI_SCROLLTOEND</code></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>The <code>SCI_*EXTEND</code> messages extend the selection.</p>
+
+ <p>The <code>SCI_*RECTEXTEND</code> messages extend the rectangular selection
+ (and convert regular selection to rectangular one, if any).</p>
+
+ <p>The <code>SCI_WORDPART*</code> commands are used to move between word segments marked by
+ capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).</p>
+
+ <p>The <code>SCI_HOME*</code> commands move the caret to the start of the line, while the
+ <code>SCI_VCHOME*</code> commands move the caret to the first non-blank character of the line
+ (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.</p>
+
+ <p>The <code>SCI_[HOME|LINEEND]DISPLAY*</code> commands are used when in line wrap mode to
+ allow movement to the start or end of display lines as opposed to the normal
+ <code>SCI_[HOME|LINEEND]</code> commands which move to the start or end of document lines.</p>
+
+ <p>The <code>SCI_[[VC]HOME|LINEEND]WRAP*</code> commands are like their namesakes
+ <code>SCI_[[VC]HOME|LINEEND]*</code> except they behave differently when word-wrap is enabled:
+ They go first to the start / end of the display line, like <code>SCI_[HOME|LINEEND]DISPLAY*</code>,
+ but if the cursor is already at the point, it goes on to the start or end of the document line,
+ as appropriate for <code>SCI_[[VC]HOME|LINEEND]*</code>.
+ </p>
+
+ <p>The <code>SCI_SCROLLTO[START|END]</code> commands scroll the document to the start
+ or end without changing the selection. These commands match OS X platform conventions for the behaviour of the
+ <code>home</code> and <code>end</code> keys. Scintilla can be made to match OS X applications
+ by binding the <code>home</code> and <code>end</code> keys to these commands.
+ </p>
+
+ <h2 id="KeyBindings">Key bindings</h2>
+
+ <p>There is a default binding of keys to commands that is defined in the Scintilla source in
+ the file <code>KeyMap.cxx</code> by the constant <code>KeyMap::MapDefault[]</code>. This table
+ maps key definitions to <code>SCI_*</code> messages with no parameters (mostly the <a
+ class="jump" href="#KeyboardCommands">keyboard commands</a> discussed above, but any Scintilla
+ command that has no arguments can be mapped). You can change the mapping to suit your own
+ requirements.</p>
+ <code><a class="message" href="#SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int keyDefinition, int
+ sciCommand)</a><br />
+ <a class="message" href="#SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int keyDefinition)</a><br />
+ <a class="message" href="#SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</a><br />
+ <a class="message" href="#SCI_NULL">SCI_NULL</a><br />
+ </code>
+
+ <p><b id="keyDefinition">keyDefinition</b><br />
+ A key definition contains the key code in the low 16-bits and the key modifiers in the high
+ 16-bits. To combine <code>keyCode</code> and <code>keyMod</code> set:<br />
+ <br />
+ <code>keyDefinition = keyCode + (keyMod &lt;&lt; 16)</code></p>
+
+ <p>The key code is a visible or control character or a key from the <code>SCK_*</code>
+ enumeration, which contains:<br />
+ <code>SCK_ADD</code>, <code>SCK_BACK</code>, <code>SCK_DELETE</code>, <code>SCK_DIVIDE</code>,
+ <code>SCK_DOWN</code>, <code>SCK_END</code>, <code>SCK_ESCAPE</code>, <code>SCK_HOME</code>,
+ <code>SCK_INSERT</code>, <code>SCK_LEFT</code>, <code>SCK_MENU</code>, <code>SCK_NEXT</code> (Page Down),
+ <code>SCK_PRIOR</code> (Page Up), <code>SCK_RETURN</code>, <code>SCK_RIGHT</code>,
+ <code>SCK_RWIN</code>,
+ <code>SCK_SUBTRACT</code>, <code>SCK_TAB</code>, <code>SCK_UP</code>, and
+ <code>SCK_WIN</code>.</p>
+
+ <p>The modifiers are a combination of zero or more of <code>SCMOD_ALT</code>,
+ <code>SCMOD_CTRL</code>, <code>SCMOD_SHIFT</code>, and <code>SCMOD_META</code>.
+ On OS X, the Command key is mapped to <code>SCMOD_CTRL</code> and the Control key to
+ <code>SCMOD_META</code>.
+ If you are building a table, you might
+ want to use <code>SCMOD_NORM</code>, which has the value 0, to mean no modifiers.</p>
+
+ <p><b id="SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int <a class="jump"
+ href="#keyDefinition">keyDefinition</a>, int sciCommand)</b><br />
+ This assigns the given key definition to a Scintilla command identified by
+ <code>sciCommand</code>. <code>sciCommand</code> can be any <code>SCI_*</code> command that has
+ no arguments.</p>
+
+ <p><b id="SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int <a class="jump"
+ href="#keyDefinition">keyDefinition</a>)</b><br />
+ This makes the given key definition do nothing by assigning the action <code>SCI_NULL</code>
+ to it.</p>
+
+ <p><b id="SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</b><br />
+ This command removes all keyboard command mapping by setting an empty mapping table.</p>
+
+ <p><b id="SCI_NULL">SCI_NULL</b><br />
+ The <code>SCI_NULL</code> does nothing and is the value assigned to keys that perform no
+ action. SCI_NULL ensures that keys do not propagate to the parent window as that may
+ cause focus to move. If you want the standard platform behaviour use the constant 0 instead.</p>
+
+ <h2 id="PopupEditMenu">Popup edit menu</h2>
+
+ <p><b id="SCI_USEPOPUP">SCI_USEPOPUP(bool bEnablePopup)</b><br />
+ Clicking the wrong button on the mouse pops up a short default editing menu. This may be
+ turned off with <code>SCI_USEPOPUP(0)</code>. If you turn it off, context menu commands (in
+ Windows, <code>WM_CONTEXTMENU</code>) will not be handled by Scintilla, so the parent of the
+ Scintilla window will have the opportunity to handle the message.</p>
+
+ <h2 id="MacroRecording">Macro recording</h2>
+
+ <p>Start and stop macro recording mode. In macro recording mode, actions are reported to the
+ container through <code><a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a></code>
+ <a class="jump" href="#Notifications">notifications</a>. It is then up to the container to
+ record these actions for future replay.</p>
+
+ <p><b id="SCI_STARTRECORD">SCI_STARTRECORD</b><br />
+ <b id="SCI_STOPRECORD">SCI_STOPRECORD</b><br />
+ These two messages turn macro recording on and off.</p>
+
+ <h2 id="Printing">Printing</h2>
+
+ <p><code>SCI_FORMATRANGE</code> can be used to draw the text onto a display surface
+ which can include a printer display surface. Printed output shows text styling as on the
+ screen, but it hides all margins except a line number margin. All special marker effects are
+ removed and the selection and caret are hidden.</p>
+
+ <p>Different platforms use different display surface ID types to print on. On Windows, these are
+ <code>HDC</code>s., on GTK+ 3.x <code>cairo_t *</code>,
+ and on Cocoa <code>CGContextRef</code> is used.</p>
+
+ <code><a class="message" href="#SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat
+ *pfr)</a><br />
+ <a class="message" href="#SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int
+ magnification)</a><br />
+ <a class="message" href="#SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</a><br />
+ <a class="message" href="#SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</a><br />
+ <a class="message" href="#SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</a><br />
+ <a class="message" href="#SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE</a><br />
+ <a class="message" href="#SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</a><br />
+ </code>
+
+ <p><b id="SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat *pfr)</b><br />
+ This call renders a range of text into a device context. If you use
+ this for printing, you will probably want to arrange a page header and footer; Scintilla does
+ not do this for you. See <code>SciTEWin::Print()</code> in <code>SciTEWinDlg.cxx</code> for an
+ example. Each use of this message renders a range of text into a rectangular area and returns
+ the position in the document of the next character to print.</p>
+
+ <p><code>bDraw</code> controls if any output is done. Set this to false if you are paginating
+ (for example, if you use this with MFC you will need to paginate in
+ <code>OnBeginPrinting()</code> before you output each page.</p>
+<pre>
+struct Sci_Rectangle { int left; int top; int right; int bottom; };
+
+struct Sci_RangeToFormat {
+ Sci_SurfaceID hdc; // The Surface ID we print to
+ Sci_SurfaceID hdcTarget; // The Surface ID we use for measuring (may be same as hdc)
+ Sci_Rectangle rc; // Rectangle in which to print
+ Sci_Rectangle rcPage; // Physically printable page size
+ Sci_CharacterRange chrg; // Range of characters to print
+};
+</pre>
+
+ <p>On Windows, <code>hdc</code> and <code>hdcTarget</code> should both be set to the device context handle
+ of the output device (usually a printer). If you print to a metafile these will not be the same
+ as Windows metafiles (unlike extended metafiles) do not implement the full API for returning
+ information. In this case, set <code>hdcTarget</code> to the screen DC.<br />
+ <code>rcPage</code> is the rectangle <code>{0, 0, maxX, maxY}</code> where <code>maxX+1</code>
+ and <code>maxY+1</code> are the number of physically printable pixels in x and y.<br />
+ <code>rc</code> is the rectangle to render the text in (which will, of course, fit within the
+ rectangle defined by rcPage).<br />
+ <code>chrg.cpMin</code> and <code>chrg.cpMax</code> define the start position and maximum
+ position of characters to output. All of each line within this character range is drawn.</p>
+
+ <p>On Cocoa, the surface IDs for printing (<code>bDraw=1</code>) should be the graphics port of the current context
+ (<code>(CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]</code>) when the view's drawRect method is called.
+ The Surface IDs are not really used for measurement (<code>bDraw=0</code>) but can be set
+ to a bitmap context (created with <code>CGBitmapContextCreate</code>) to avoid runtime warnings.</p>
+
+ <p>On GTK+, the surface IDs to use can be found from the printing context with
+ <code>gtk_print_context_get_cairo_context(context)</code>.</p>
+
+ <p><code>chrg.cpMin</code> and <code>chrg.cpMax</code> define the start position and maximum
+ position of characters to output. All of each line within this character range is drawn.</p>
+
+ <p>When printing, the most tedious part is always working out what the margins should be to
+ allow for the non-printable area of the paper and printing a header and footer. If you look at
+ the printing code in SciTE, you will find that most of it is taken up with this. The loop that
+ causes Scintilla to render text is quite simple if you strip out all the margin, non-printable
+ area, header and footer code.</p>
+
+ <p><b id="SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int magnification)</b><br />
+ <b id="SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</b><br />
+ <code>SCI_GETPRINTMAGNIFICATION</code> lets you to print at a different size than the screen
+ font. <code>magnification</code> is the number of points to add to the size of each screen
+ font. A value of -3 or -4 gives reasonably small print. You can get this value with
+ <code>SCI_GETPRINTMAGNIFICATION</code>.</p>
+
+ <p><b id="SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</b><br />
+ <b id="SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</b><br />
+ These two messages set and get the method used to render coloured text on a printer that is
+ probably using white paper. It is especially important to consider the treatment of colour if
+ you use a dark or black screen background. Printing white on black uses up toner and ink very
+ many times faster than the other way around. You can set the mode to one of:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Colour printing modes">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Purpose</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_PRINT_NORMAL</code></td>
+
+ <td align="center">0</td>
+
+ <td>Print using the current screen colours. This is the default.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PRINT_INVERTLIGHT</code></td>
+
+ <td align="center">1</td>
+
+ <td>If you use a dark screen background this saves ink by inverting the light value of
+ all colours and printing on a white background.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PRINT_BLACKONWHITE</code></td>
+
+ <td align="center">2</td>
+
+ <td>Print all text as black on a white background.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PRINT_COLOURONWHITE</code></td>
+
+ <td align="center">3</td>
+
+ <td>Everything prints in its own colour on a white background.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PRINT_COLOURONWHITEDEFAULTBG</code></td>
+
+ <td align="center">4</td>
+
+ <td>Everything prints in its own colour on a white background except that line numbers
+ use their own background colour.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE(int wrapMode)</b><br />
+ <b id="SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</b><br />
+ These two functions get and set the printer wrap mode. <code>wrapMode</code> can be
+ set to <code>SC_WRAP_NONE</code> (0), <code>SC_WRAP_WORD</code> (1) or
+ <code>SC_WRAP_CHAR</code> (2). The default is
+ <code>SC_WRAP_WORD</code>, which wraps printed output so that all characters fit
+ into the print rectangle. If you set <code>SC_WRAP_NONE</code>, each line of text
+ generates one line of output and the line is truncated if it is too long to fit
+ into the print area.<br />
+ <code>SC_WRAP_WORD</code> tries to wrap only between words as indicated by
+ white space or style changes although if a word is longer than a line, it will be wrapped before
+ the line end. <code>SC_WRAP_CHAR</code> is preferred to
+ <code>SC_WRAP_WORD</code> for Asian languages where there is no white space
+ between words.</p>
+
+ <h2 id="DirectAccess">Direct access</h2>
+ <code><a class="message" href="#SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</a><br />
+ <a class="message" href="#SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</a><br />
+ <a class="message" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a><br />
+ <a class="message" href="#SCI_GETRANGEPOINTER">SCI_GETRANGEPOINTER(int position, int rangeLength)</a><br />
+ <a class="message" href="#SCI_GETGAPPOSITION">SCI_GETGAPPOSITION</a><br />
+ </code>
+
+ <p>On Windows, the message-passing scheme used to communicate between the container and
+ Scintilla is mediated by the operating system <code>SendMessage</code> function and can lead to
+ bad performance when calling intensively. To avoid this overhead, Scintilla provides messages
+ that allow you to call the Scintilla message function directly. The code to do this in C/C++ is
+ of the form:</p>
+<pre>
+#include "Scintilla.h"
+SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
+sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);
+
+// now a wrapper to call Scintilla directly
+sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
+ return pSciMsg(pSciWndData, iMessage, wParam, lParam);
+}
+</pre>
+
+ <p><code>SciFnDirect</code>, <code>sptr_t</code> and <code>uptr_t</code> are declared in
+ <code>Scintilla.h</code>. <code>hSciWnd</code> is the window handle returned when you created
+ the Scintilla window.</p>
+
+ <p>While faster, this direct calling will cause problems if performed from a different thread
+ to the native thread of the Scintilla window in which case <code>SendMessage(hSciWnd, SCI_*,
+ wParam, lParam)</code> should be used to synchronize with the window's thread.</p>
+
+ <p>This feature also works on GTK+ but has no significant impact on speed.</p>
+
+ <p>From version 1.47 on Windows, Scintilla exports a function called
+ <code>Scintilla_DirectFunction</code> that can be used the same as the function returned by
+ <code>SCI_GETDIRECTFUNCTION</code>. This saves you the call to
+ <code>SCI_GETDIRECTFUNCTION</code> and the need to call Scintilla indirectly via the function
+ pointer.</p>
+
+ <p><b id="SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</b><br />
+ This message returns the address of the function to call to handle Scintilla messages without
+ the overhead of passing through the Windows messaging system. You need only call this once,
+ regardless of the number of Scintilla windows you create.</p>
+
+ <p><b id="SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</b><br />
+ This returns a pointer to data that identifies which Scintilla window is in use. You must call
+ this once for each Scintilla window you create. When you call the direct function, you must
+ pass in the direct pointer associated with the target window.</p>
+
+ <p><b id="SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</b><br />
+ <b id="SCI_GETRANGEPOINTER">SCI_GETRANGEPOINTER(int position, int rangeLength)</b><br />
+ <b id="SCI_GETGAPPOSITION">SCI_GETGAPPOSITION</b><br />
+ Grant temporary direct read-only access to the memory used by Scintilla to store
+ the document.</p>
+ <p><code>SCI_GETCHARACTERPOINTER</code> moves the gap within Scintilla so that the
+ text of the document is stored consecutively
+ and ensure there is a NUL character after the text, then returns a pointer to the first character.
+ Applications may then pass this to a function that accepts a character pointer such as a regular
+ expression search or a parser. The pointer should <em>not</em> be written to as that may desynchronize
+ the internal state of Scintilla.</p>
+ <p>Since any action in Scintilla may change its internal state
+ this pointer becomes invalid after any call or by allowing user interface activity. The application
+ should reacquire the pointer after making any call to Scintilla or performing any user-interface calls such
+ as modifying a progress indicator.</p>
+ <p>This call takes similar time to inserting a character at the end of the document and this may
+ include moving the document contents. Specifically, all the characters after the document gap
+ are moved to before the gap. This compacted state should persist over calls and user interface
+ actions that do not change the document contents so reacquiring the pointer afterwards is very
+ quick. If this call is used to implement a global replace operation, then each replacement will
+ move the gap so if <code>SCI_GETCHARACTERPOINTER</code> is called after
+ each replacement then the operation will become O(n^2) rather than O(n). Instead, all
+ matches should be found and remembered, then all the replacements performed.</p>
+
+ <p><code>SCI_GETRANGEPOINTER</code> provides direct access to just the
+ range requested. The gap is not moved unless it is within the requested range so this call
+ can be faster than <code>SCI_GETCHARACTERPOINTER</code>.
+ This can be used by application code that is able to act on blocks of text or ranges of lines.</p>
+
+ <p><code>SCI_GETGAPPOSITION</code> returns the current gap position.
+ This is a hint that applications can use to avoid calling <code>SCI_GETRANGEPOINTER</code>
+ with a range that contains the gap and consequent costs of moving the gap.</p>
+
+ <h2 id="MultipleViews">Multiple views</h2>
+
+ <p>A Scintilla window and the document that it displays are separate entities. When you create
+ a new window, you also create a new, empty document. Each document has a reference count that
+ is initially set to 1. The document also has a list of the Scintilla windows that are linked to
+ it so when any window changes the document, all other windows in which it appears are notified
+ to cause them to update. The system is arranged in this way so that you can work with many
+ documents in a single Scintilla window and so you can display a single document in multiple
+ windows (for use with splitter windows).</p>
+
+ <p>Although these messages use <code>document *pDoc</code>, to ensure compatibility with future
+ releases of Scintilla you should treat <code>pDoc</code> as an opaque <code>void*</code>. That
+ is, you can use and store the pointer as described in this section but you should not
+ dereference it.</p>
+ <code><a class="message" href="#SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</a><br />
+ <a class="message" href="#SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(&lt;unused&gt;, document
+ *pDoc)</a><br />
+ <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</a><br />
+ <a class="message" href="#SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(&lt;unused&gt;, document
+ *pDoc)</a><br />
+ <a class="message" href="#SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(&lt;unused&gt;, document
+ *pDoc)</a><br />
+ </code>
+
+ <p><b id="SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</b><br />
+ This returns a pointer to the document currently in use by the window. It has no other
+ effect.</p>
+
+ <p><b id="SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(&lt;unused&gt;, document *pDoc)</b><br />
+ This message does the following:<br />
+ 1. It removes the current window from the list held by the current document.<br />
+ 2. It reduces the reference count of the current document by 1.<br />
+ 3. If the reference count reaches 0, the document is deleted.<br />
+ 4. <code>pDoc</code> is set as the new document for the window.<br />
+ 5. If <code>pDoc</code> was 0, a new, empty document is created and attached to the
+ window.<br />
+ 6. If <code>pDoc</code> was not 0, its reference count is increased by 1.</p>
+
+ <p><b id="SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</b><br />
+ This message creates a new, empty document and returns a pointer to it. This document is not
+ selected into the editor and starts with a reference count of 1. This means that you have
+ ownership of it and must either reduce its reference count by 1 after using
+ <code>SCI_SETDOCPOINTER</code> so that the Scintilla window owns it or you must make sure that
+ you reduce the reference count by 1 with <code>SCI_RELEASEDOCUMENT</code> before you close the
+ application to avoid memory leaks.</p>
+
+ <p><b id="SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(&lt;unused&gt;, document *pDoc)</b><br />
+ This increases the reference count of a document by 1. If you want to replace the current
+ document in the Scintilla window and take ownership of the current document, for example if you
+ are editing many documents in one window, do the following:<br />
+ 1. Use <code>SCI_GETDOCPOINTER</code> to get a pointer to the document,
+ <code>pDoc</code>.<br />
+ 2. Use <code>SCI_ADDREFDOCUMENT(0, pDoc)</code> to increment the reference count.<br />
+ 3. Use <code>SCI_SETDOCPOINTER(0, pNewDoc)</code> to set a different document or
+ <code>SCI_SETDOCPOINTER(0, 0)</code> to set a new, empty document.</p>
+
+ <p><b id="SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(&lt;unused&gt;, document *pDoc)</b><br />
+ This message reduces the reference count of the document identified by <code>pDoc</code>. pDoc
+ must be the result of <code>SCI_GETDOCPOINTER</code> or <code>SCI_CREATEDOCUMENT</code> and
+ must point at a document that still exists. If you call this on a document with a reference
+ count of 1 that is still attached to a Scintilla window, bad things will happen. To keep the
+ world spinning in its orbit you must balance each call to <code>SCI_CREATEDOCUMENT</code> or
+ <code>SCI_ADDREFDOCUMENT</code> with a call to <code>SCI_RELEASEDOCUMENT</code>.</p>
+
+ <h2 id="BackgroundLoadSave">Background loading and saving</h2>
+
+ <p>To ensure a responsive user interface, applications may decide to load and save documents using a separate thread
+ from the user interface.</p>
+
+ <h3 id="BackgroundLoad">Loading in the background</h3>
+
+ <p>An application can load all of a file into a buffer it allocates on a background thread and then add the data in that buffer
+ into a Scintilla document on the user interface thread. That technique uses extra memory to store a complete copy of the
+ file and also means that the time that Scintilla takes to perform initial line end discovery blocks the user interface.</p>
+
+ <p>To avoid these issues, a loader object may be created and used to load the file. The loader object supports the ILoader interface.</p>
+
+ <p><b id="SCI_CREATELOADER">SCI_CREATELOADER(int bytes)</b><br />
+ Create an object that supports the <code>ILoader</code> interface which can be used to load data and then
+ be turned into a Scintilla document object for attachment to a view object.
+ The <code>bytes</code> argument determines the initial memory allocation for the document as it is more efficient
+ to allocate once rather than rely on the buffer growing as data is added.
+ If <code>SCI_CREATELOADER</code> fails then 0 is returned.</p>
+
+<h4>ILoader</h4>
+
+<div class="highlighted">
+<span class="S5">class</span><span class="S0"> </span>ILoader<span class="S0"> </span><span class="S10">{</span><br />
+<span class="S5">public</span><span class="S10">:</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>Release<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S2">// Returns a status code from SC_STATUS_*</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>AddData<span class="S10">(</span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>data<span class="S10">,</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>length<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">void</span><span class="S0"> </span><span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>ConvertToDocument<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S10">};</span><br />
+</div>
+
+ <p>The application should call the <code>AddData</code> method with each block of data read from the file.
+ <code>AddData</code> will return SC_STATUS_OK unless a failure, such as memory exhaustion occurs.
+ If a failure occurs in <code>AddData</code> or in a file reading call then loading can be abandoned and the loader released with
+ the <code>Release</code> call.
+ When the whole file has been read, the <code>ConvertToDocument</code> method should be called to produce a Scintilla
+ document pointer which can be used in the same way as a document pointer returned from
+ <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</a>.
+ There is no need to call <code>Release</code> after <code>ConvertToDocument</code>.</p>
+
+ <h3 id="BackgroundSave">Saving in the background</h3>
+
+ <p>An application that wants to save in the background should lock the document with <code>SCI_SETREADONLY(1)</code>
+ to prevent modifications and retrieve a pointer to the unified document contents with
+ <a class="message" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a>.
+ The buffer of a locked document will not move so the pointer is valid until the application calls <code>SCI_SETREADONLY(0)</code>.</p>
+
+ <p>If the user tries to performs a modification while the document is locked then a <code><a class="message"
+ href="#SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</a></code> notification is sent to the application.
+ The application may then decide to ignore the modification or to terminate the background saving thread and reenable
+ modification before returning from the notification.</p>
+
+ <h2 id="Folding">Folding</h2>
+
+ <p>The fundamental operation in folding is making lines invisible or visible. Line visibility
+ is a property of the view rather than the document so each view may be displaying a different
+ set of lines. From the point of view of the user, lines are hidden and displayed using fold
+ points. Generally, the fold points of a document are based on the hierarchical structure of the
+ document contents. In Python, the hierarchy is determined by indentation and in C++ by brace
+ characters. This hierarchy can be represented within a Scintilla document object by attaching a
+ numeric "fold level" to each line. The fold level is most easily set by a lexer, but you can
+ also set it with messages.</p>
+
+ <p>It is up to your code to set the connection between user actions and folding and unfolding.
+ The best way to see how this is done is to search the SciTE source code for the messages used
+ in this section of the documentation and see how they are used. You will also need to use
+ markers and a folding margin to complete your folding implementation.
+ The <code>"fold"</code> property should be set to <code>"1"</code> with
+ <code>SCI_SETPROPERTY("fold", "1")</code> to enable folding. </p>
+ <code><a class="message" href="#SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int
+ docLine)</a><br />
+ <a class="message" href="#SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int
+ displayLine)</a><br />
+ <a class="message" href="#SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</a><br />
+ <a class="message" href="#SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</a><br />
+ <a class="message" href="#SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</a><br />
+ <a class="message" href="#SCI_GETALLLINESVISIBLE">SCI_GETALLLINESVISIBLE</a><br />
+ <a class="message" href="#SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</a><br />
+ <a class="message" href="#SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</a><br />
+ <a class="message" href="#SCI_SETAUTOMATICFOLD">SCI_SETAUTOMATICFOLD(int automaticFold)</a><br />
+ <a class="message" href="#SCI_GETAUTOMATICFOLD">SCI_GETAUTOMATICFOLD</a><br />
+ <a class="message" href="#SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</a><br />
+ <a class="message" href="#SCI_GETLASTCHILD">SCI_GETLASTCHILD(int line, int level)</a><br />
+ <a class="message" href="#SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int line)</a><br />
+ <a class="message" href="#SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool
+ expanded)</a><br />
+ <a class="message" href="#SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</a><br />
+ <a class="message" href="#SCI_CONTRACTEDFOLDNEXT">SCI_CONTRACTEDFOLDNEXT(int lineStart)</a><br />
+ <a class="message" href="#SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</a><br />
+ <a class="message" href="#SCI_FOLDLINE">SCI_FOLDLINE(int line, int action)</a><br />
+ <a class="message" href="#SCI_FOLDCHILDREN">SCI_FOLDCHILDREN(int line, int action)</a><br />
+ <a class="message" href="#SCI_FOLDALL">SCI_FOLDALL(int action)</a><br />
+ <a class="message" href="#SCI_EXPANDCHILDREN">SCI_EXPANDCHILDREN(int line, int level)</a><br />
+ <a class="message" href="#SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</a><br />
+ <a class="message" href="#SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int
+ line)</a><br />
+ </code>
+
+ <p><b id="SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int docLine)</b><br />
+ When some lines are hidden and/or annotations are displayed, then a particular line in the
+ document may be displayed at a
+ different position to its document position. If no lines are hidden and there are no annotations,
+ this message returns
+ <code>docLine</code>. Otherwise, this returns the display line (counting the very first visible
+ line as 0). The display line of an invisible line is the same as the previous visible line. The
+ display line number of the first line in the document is 0. If lines are hidden and
+ <code>docLine</code> is outside the range of lines in the document, the return value is -1.
+ Lines can occupy more than one display line if they wrap.</p>
+
+ <p><b id="SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int displayLine)</b><br />
+ When some lines are hidden and/or annotations are displayed, then a particular line in the
+ document may be displayed at a
+ different position to its document position. This message returns the document line number that
+ corresponds to a display line (counting the display line of the first line in the document as
+ 0). If <code>displayLine</code> is less than or equal to 0, the result is 0. If
+ <code>displayLine</code> is greater than or equal to the number of displayed lines, the result
+ is the number of lines in the document.</p>
+
+ <p><b id="SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</b><br />
+ <b id="SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</b><br />
+ <b id="SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</b><br />
+ <b id="SCI_GETALLLINESVISIBLE">SCI_GETALLLINESVISIBLE</b><br />
+ The first two messages mark a range of lines as visible or invisible and then redraw the
+ display.
+ <code>SCI_GETLINEVISIBLE</code> reports on the visible state of a line and returns 1 if it is
+ visible and 0 if it is not visible.
+ <code>SCI_GETALLLINESVISIBLE</code> returns 1 if all lines are visible and 0
+ if some lines are hidden.
+ These messages have no effect on fold levels or fold
+ flags. The first line can not be hidden.</p>
+
+ <p><b id="SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</b><br />
+ <b id="SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</b><br />
+ These two messages set and get a 32-bit value that contains the fold level of a line and some
+ flags associated with folding. The fold level is a number in the range 0 to
+ <code>SC_FOLDLEVELNUMBERMASK</code> (4095). However, the initial fold level is set to
+ <code>SC_FOLDLEVELBASE</code> (1024) to allow unsigned arithmetic on folding levels. There are
+ two addition flag bits. <code>SC_FOLDLEVELWHITEFLAG</code> indicates that the line is blank and
+ allows it to be treated slightly different then its level may indicate. For example, blank
+ lines should generally not be fold points and will be considered part of the preceding section even though
+ they may have a lesser fold level.
+ <code>SC_FOLDLEVELHEADERFLAG</code> indicates that
+ the line is a header (fold point).</p>
+
+ <p>Use <code>SCI_GETFOLDLEVEL(line) &amp; SC_FOLDLEVELNUMBERMASK</code> to get the fold level
+ of a line. Likewise, use <code>SCI_GETFOLDLEVEL(line) &amp; SC_FOLDLEVEL*FLAG</code> to get the
+ state of the flags. To set the fold level you must or in the associated flags. For instance, to
+ set the level to <code>thisLevel</code> and mark a line as being a fold point use:
+ <code>SCI_SETFOLDLEVEL(line, thisLevel | SC_FOLDLEVELHEADERFLAG)</code>.</p>
+ If you use a lexer, you should not need to use <code>SCI_SETFOLDLEVEL</code> as this is far
+ better handled by the lexer. You will need to use <code>SCI_GETFOLDLEVEL</code> to decide how
+ to handle user folding requests. If you do change the fold levels, the folding margin will
+ update to match your changes.
+
+ <p><b id="SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</b><br />
+ In addition to showing markers in the folding margin, you can indicate folds to the user by
+ drawing lines in the text area. The lines are drawn in the foreground colour set for <a
+ class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. Bits set in
+ <code>flags</code> determine where folding lines are drawn:<br />
+ </p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Fold flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th align="left">Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"></td>
+ <td align="left">1</td>
+ <td align="left">Experimental feature that has been removed.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LINEBEFORE_EXPANDED</td>
+ <td align="left">2</td>
+
+ <td align="left">Draw above if expanded</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LINEBEFORE_CONTRACTED</td>
+ <td align="left">4</td>
+
+ <td align="left">Draw above if not expanded</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LINEAFTER_EXPANDED</td>
+ <td align="left">8</td>
+
+ <td align="left">Draw below if expanded</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LINEAFTER_CONTRACTED</td>
+ <td align="left">16</td>
+
+ <td align="left">Draw below if not expanded</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LEVELNUMBERS</td>
+ <td align="left">64</td>
+
+ <td align="left">display hexadecimal fold levels in line margin to aid debugging of
+ folding. The appearance of this feature may change in the future.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDFLAG_LINESTATE</td>
+ <td align="left">128</td>
+
+ <td align="left">display hexadecimal line state in line margin to aid debugging of lexing and folding.
+ May not be used at the same time as <code>SC_FOLDFLAG_LEVELNUMBERS</code>.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>This message causes the display to redraw.</p>
+
+ <p><b id="SCI_GETLASTCHILD">SCI_GETLASTCHILD(int startLine, int level)</b><br />
+ This message searches for the next line after <code>startLine</code>, that has a folding level
+ that is less than or equal to <code>level</code> and then returns the previous line number. If
+ you set <code>level</code> to -1, <code>level</code> is set to the folding level of line
+ <code>startLine</code>. If <code>from</code> is a fold point, <code>SCI_GETLASTCHILD(from,
+ -1)</code> returns the last line that would be in made visible or hidden by toggling the fold
+ state.</p>
+
+ <p><b id="SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int startLine)</b><br />
+ This message returns the line number of the first line before <code>startLine</code> that is
+ marked as a fold point with <code>SC_FOLDLEVELHEADERFLAG</code> and has a fold level less than
+ the <code>startLine</code>. If no line is found, or if the header flags and fold levels are
+ inconsistent, the return value is -1.</p>
+
+ <p><b id="SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</b><br />
+ Each fold point may be either expanded, displaying all its child lines, or contracted, hiding
+ all the child lines. This message toggles the folding state of the given line as long as it has
+ the <code>SC_FOLDLEVELHEADERFLAG</code> set. This message takes care of folding or expanding
+ all the lines that depend on the line. The display updates after this message.</p>
+
+ <p><b id="SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool expanded)</b><br />
+ <b id="SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</b><br />
+ These messages set and get the expanded state of a single line. The set message has no effect
+ on the visible state of the line or any lines that depend on it. It does change the markers in
+ the folding margin. If you ask for the expansion state of a line that is outside the document,
+ the result is <code>false</code> (0).</p>
+
+ <p>If you just want to toggle the fold state of one line and handle all the lines that are
+ dependent on it, it is much easier to use <code>SCI_TOGGLEFOLD</code>. You would use the
+ <code>SCI_SETFOLDEXPANDED</code> message to process many folds without updating the display
+ until you had finished. See <code>SciTEBase::FoldAll()</code> and
+ <code>SciTEBase::Expand()</code> for examples of the use of these messages.</p>
+
+ <p><b id="SCI_FOLDLINE">SCI_FOLDLINE(int line, int action)</b><br />
+ <b id="SCI_FOLDCHILDREN">SCI_FOLDCHILDREN(int line, int action)</b><br />
+ <b id="SCI_FOLDALL">SCI_FOLDALL(int action)</b><br />
+ These messages provide a higher-level approach to folding instead of setting expanded flags and showing
+ or hiding individual lines.</p>
+ <p>An individual fold can be contracted/expanded/toggled with <code>SCI_FOLDLINE</code>.
+ To affect all child folds as well call <code>SCI_FOLDCHILDREN</code>.</p>
+ <p>To affect the entire document call <code>SCI_FOLDALL</code>. With <code>SC_FOLDACTION_TOGGLE</code>
+ the first fold header in the document is examined to decide whether to expand or contract.
+ </p>
+ <table cellpadding="1" cellspacing="2" border="0" summary="Fold flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th align="left">Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left">SC_FOLDACTION_CONTRACT</td>
+ <td align="left">0</td>
+ <td align="left">Contract.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDACTION_EXPAND</td>
+ <td align="left">1</td>
+ <td align="left">Expand.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_FOLDACTION_TOGGLE</td>
+ <td align="left">2</td>
+ <td align="left">Toggle between contracted and expanded.</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <p><b id="SCI_EXPANDCHILDREN">SCI_EXPANDCHILDREN(int line, int level)</b><br />
+ This is used to respond to a change to a line causing its fold level or whether it is a header to change,
+ perhaps when adding or removing a '{'.</p>
+ <p>By the time the container has received the notification that the line has changed,
+ the fold level has already been set, so the container has to use the previous level in this call
+ so that any range hidden underneath this line can be shown.
+ </p>
+
+ <p><b id="SCI_SETAUTOMATICFOLD">SCI_SETAUTOMATICFOLD(int automaticFold)</b><br />
+ <b id="SCI_GETAUTOMATICFOLD">SCI_GETAUTOMATICFOLD</b><br />
+ Instead of implementing all the logic for handling folding in the container, Scintilla can provide behaviour
+ that is adequate for many applications. The <code>automaticFold</code> argument is a bit set defining
+ which of the 3 pieces of folding implementation should be enabled. Most applications should be able to use the
+ <code>SC_AUTOMATICFOLD_SHOW</code> and <code>SC_AUTOMATICFOLD_CHANGE</code>
+ flags unless they wish to implement quite different behaviour such as defining their own fold structure.
+ <code>SC_AUTOMATICFOLD_CLICK</code> is more likely to be set off when an application would
+ like to add or change click behaviour such as showing method headers only when Shift+Alt is used in
+ conjunction with a click.
+ </p>
+ <table cellpadding="1" cellspacing="2" border="0" summary="Fold flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th align="left">Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left">SC_AUTOMATICFOLD_SHOW</td>
+ <td align="left">1</td>
+ <td align="left">Automatically show lines as needed.
+ This avoids sending the <code>SCN_NEEDSHOWN</code> notification.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_AUTOMATICFOLD_CLICK</td>
+ <td align="left">2</td>
+ <td align="left">Handle clicks in fold margin automatically.
+ This avoids sending the <code>SCN_MARGINCLICK</code> notification for folding margins.</td>
+ </tr>
+
+ <tr>
+ <td align="left">SC_AUTOMATICFOLD_CHANGE</td>
+ <td align="left">4</td>
+ <td align="left">Show lines as needed when fold structure is changed.
+ The <code>SCN_MODIFIED</code> notification is still sent unless it is disabled by the
+ container.</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <p><b id="SCI_CONTRACTEDFOLDNEXT">SCI_CONTRACTEDFOLDNEXT(int lineStart)</b><br />
+ Search efficiently for lines that are contracted fold headers.
+ This is useful when saving the user's folding when switching documents or saving folding with a file.
+ The search starts at line number <code>lineStart</code> and continues forwards to the end of the file.
+ <code>lineStart</code> is returned if it is a contracted fold header otherwise the next contracted
+ fold header is returned. If there are no more contracted fold headers then -1 is returned.</p>
+
+ <p><b id="SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</b><br />
+ <b id="SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int line)</b><br />
+ A line may be hidden because more than one of its parent lines is contracted. Both these
+ message travels up the fold hierarchy, expanding any contracted folds until they reach the top
+ level. The line will then be visible. If you use <code>SCI_ENSUREVISIBLEENFORCEPOLICY</code>,
+ the vertical caret policy set by <a class="message"
+ href="#SCI_SETVISIBLEPOLICY"><code>SCI_SETVISIBLEPOLICY</code></a> is then applied.</p>
+
+ <h2 id="LineWrapping">Line wrapping</h2>
+
+ <code><a class="message" href="#SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</a><br />
+ <a class="message" href="#SCI_GETWRAPMODE">SCI_GETWRAPMODE</a><br />
+ <a class="message" href="#SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</a><br />
+ <a class="message" href="#SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</a><br />
+ <a class="message" href="#SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</a><br />
+ <a class="message" href="#SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</a><br />
+ <a class="message" href="#SCI_SETWRAPINDENTMODE">SCI_SETWRAPINDENTMODE(int indentMode)</a><br />
+ <a class="message" href="#SCI_GETWRAPINDENTMODE">SCI_GETWRAPINDENTMODE</a><br />
+ <a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</a><br />
+ <a class="message" href="#SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</a><br />
+ <a class="message" href="#SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</a><br />
+ <a class="message" href="#SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</a><br />
+ <a class="message" href="#SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</a><br />
+ <a class="message" href="#SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</a><br />
+ <a class="message" href="#SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</a><br />
+ <a class="message" href="#SCI_LINESJOIN">SCI_LINESJOIN</a><br />
+ <a class="message" href="#SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</a><br />
+ </code>
+
+ <p>By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider
+ than the window width are continued on the following lines. Lines are broken after space or tab
+ characters or between runs of different styles. If this is not possible because a word in one
+ style is wider than the window then the break occurs after the last character that completely
+ fits on the line. The horizontal scroll bar does not appear when wrap mode is on.</p>
+
+ <p>For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a
+ wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla
+ draws the visual flag at the beginning of the next subline this subline will be indented by one char.
+ Independent from drawing a visual flag at the begin the subline can have an indention.</p>
+
+ <p>Much of the time used by Scintilla is spent on laying out and drawing text. The same text
+ layout calculations may be performed many times even when the data used in these calculations
+ does not change. To avoid these unnecessary calculations in some circumstances, the line layout
+ cache can store the results of the calculations. The cache is invalidated whenever the
+ underlying data, such as the contents or styling of the document changes. Caching the layout of
+ the whole document has the most effect, making dynamic line wrap as much as 20 times faster but
+ this requires 7 times the memory required by the document contents plus around 80 bytes per
+ line.</p>
+
+ <p>Wrapping is not performed immediately there is a change but is delayed until the display
+ is redrawn. This delay improves performance by allowing a set of changes to be performed
+ and then wrapped and displayed once. Because of this, some operations may not occur as
+ expected. If a file is read and the scroll position moved to a particular line in the text,
+ such as occurs when a container tries to restore a previous editing session, then
+ the scroll position will have been determined before wrapping so an unexpected range
+ of text will be displayed. To scroll to the position correctly, delay the scroll until the
+ wrapping has been performed by waiting for an initial
+ <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a> notification.</p>
+
+ <p><b id="SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</b><br />
+ <b id="SCI_GETWRAPMODE">SCI_GETWRAPMODE</b><br />
+ Set wrapMode to <code>SC_WRAP_WORD</code> (1) to enable wrapping
+ on word or style boundaries, <code>SC_WRAP_CHAR</code> (2) to enable wrapping
+ between any characters, <code>SC_WRAP_WHITESPACE</code> (3) to enable
+ wrapping on whitespace, and <code>SC_WRAP_NONE</code> (0) to disable line
+ wrapping. <code>SC_WRAP_CHAR</code> is preferred for Asian languages where
+ there is no white space between words.
+ </p>
+
+
+ <p><b id="SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</b><br />
+ <b id="SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</b><br />
+ You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in
+ wrapVisualFlags determine which visual flags are drawn.
+ </p>
+ <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th>Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAG_NONE</code></td>
+ <td align="center">0</td>
+ <td>No visual flags</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAG_END</code></td>
+ <td align="center">1</td>
+ <td>Visual flag at end of subline of a wrapped line.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAG_START</code></td>
+ <td align="center">2</td>
+ <td>Visual flag at begin of subline of a wrapped line.<br />
+ Subline is indented by at least 1 to make room for the flag.<br />
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAG_MARGIN</code></td>
+ <td align="center">4</td>
+ <td>Visual flag in line number margin.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</b><br />
+ <b id="SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</b><br />
+ You can set whether the visual flags to indicate a line is wrapped are drawn near the border or near the text.
+ Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.
+ </p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th>Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_DEFAULT</code></td>
+ <td align="center">0</td>
+ <td>Visual flags drawn near border</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_END_BY_TEXT</code></td>
+ <td align="center">1</td>
+ <td>Visual flag at end of subline drawn near text</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_START_BY_TEXT</code></td>
+ <td align="center">2</td>
+ <td>Visual flag at beginning of subline drawn near text</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETWRAPINDENTMODE">SCI_SETWRAPINDENTMODE(int indentMode)</b><br />
+ <b id="SCI_GETWRAPINDENTMODE">SCI_GETWRAPINDENTMODE</b><br />
+ Wrapped sublines can be indented to the position of their first subline or one more indent level.
+ The default is <code>SC_WRAPINDENT_FIXED</code>.
+ The modes are:
+ </p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+ <th>Value</th>
+ <th align="left">Effect</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_WRAPINDENT_FIXED</code></td>
+ <td align="center">0</td>
+ <td>Wrapped sublines aligned to left of window plus amount set by
+ <a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT</a></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPINDENT_SAME</code></td>
+ <td align="center">1</td>
+ <td>Wrapped sublines are aligned to first subline indent</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPINDENT_INDENT</code></td>
+ <td align="center">2</td>
+ <td>Wrapped sublines are aligned to first subline indent plus one more level of indentation</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</b><br />
+ <b id="SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</b><br />
+ <code>SCI_SETWRAPSTARTINDENT</code> sets the size of indentation of sublines for
+ wrapped lines in terms of the average character width in
+ <a class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>.
+ There are no limits on indent sizes, but values less than 0 or large values may have
+ undesirable effects.<br />
+ The indention of sublines is independent of visual flags, but if
+ <code>SC_WRAPVISUALFLAG_START</code> is set an indent of at least 1 is used.
+ </p>
+
+ <p><b id="SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</b><br />
+ <b id="SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</b><br />
+ You can set <code>cacheMode</code> to one of the symbols in the table:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Line caching styles">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Layout cached for these lines</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_CACHE_NONE</code></td>
+
+ <td align="center">0</td>
+
+ <td>No lines are cached.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_CACHE_CARET</code></td>
+
+ <td align="center">1</td>
+
+ <td>The line containing the text caret. This is the default.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_CACHE_PAGE</code></td>
+
+ <td align="center">2</td>
+
+ <td>Visible lines plus the line containing the caret.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_CACHE_DOCUMENT</code></td>
+
+ <td align="center">3</td>
+
+ <td>All lines in the document.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</b><br />
+ <b id="SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</b><br />
+ The position cache stores position information for short runs of text
+ so that their layout can be determined more quickly if the run recurs.
+ The size in entries of this cache can be set with <code>SCI_SETPOSITIONCACHE</code>.</p>
+
+ <p><b id="SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</b><br />
+ Split a range of lines indicated by the target into lines that are at most pixelWidth wide.
+ Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping.
+ When <code>pixelWidth</code> is 0 then the width of the window is used.
+ </p>
+
+ <p><b id="SCI_LINESJOIN">SCI_LINESJOIN</b><br />
+ Join a range of lines indicated by the target into one line by
+ removing line end characters.
+ Where this would lead to no space between words, an extra space is inserted.
+ </p>
+
+ <p><b id="SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</b><br />
+ Document lines can occupy more than one display line if they wrap and this
+ returns the number of display lines needed to wrap a document line.</p>
+
+ <h2 id="Zooming">Zooming</h2>
+
+ <p>Scintilla incorporates a "zoom factor" that lets you make all the text in the document
+ larger or smaller in steps of one point. The displayed point size never goes below 2, whatever
+ zoom factor you set. You can set zoom factors in the range -10 to +20 points.</p>
+ <code><a class="message" href="#SCI_ZOOMIN">SCI_ZOOMIN</a><br />
+ <a class="message" href="#SCI_ZOOMOUT">SCI_ZOOMOUT</a><br />
+ <a class="message" href="#SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</a><br />
+ <a class="message" href="#SCI_GETZOOM">SCI_GETZOOM</a><br />
+ </code>
+
+ <p><b id="SCI_ZOOMIN">SCI_ZOOMIN</b><br />
+ <b id="SCI_ZOOMOUT">SCI_ZOOMOUT</b><br />
+ <code>SCI_ZOOMIN</code> increases the zoom factor by one point if the current zoom factor is
+ less than 20 points. <code>SCI_ZOOMOUT</code> decreases the zoom factor by one point if the
+ current zoom factor is greater than -10 points.</p>
+
+ <p><b id="SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</b><br />
+ <b id="SCI_GETZOOM">SCI_GETZOOM</b><br />
+ These messages let you set and get the zoom factor directly. There is no limit set on the
+ factors you can set, so limiting yourself to -10 to +20 to match the incremental zoom functions
+ is a good idea.</p>
+
+ <h2 id="LongLines">Long lines</h2>
+
+ <p>You can choose to mark lines that exceed a given length by drawing a vertical line or by
+ colouring the background of characters that exceed the set length.</p>
+ <code><a class="message" href="#SCI_SETEDGEMODE">SCI_SETEDGEMODE(int mode)</a><br />
+ <a class="message" href="#SCI_GETEDGEMODE">SCI_GETEDGEMODE</a><br />
+ <a class="message" href="#SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</a><br />
+ <a class="message" href="#SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</a><br />
+ <a class="message" href="#SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int colour)</a><br />
+ <a class="message" href="#SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</a><br />
+ </code>
+
+ <p><b id="SCI_SETEDGEMODE">SCI_SETEDGEMODE(int edgeMode)</b><br />
+ <b id="SCI_GETEDGEMODE">SCI_GETEDGEMODE</b><br />
+ These two messages set and get the mode used to display long lines. You can set one of the
+ values in the table:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Long line styles">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Long line display mode</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>EDGE_NONE</code></td>
+
+ <td align="center">0</td>
+
+ <td>Long lines are not marked. This is the default state.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>EDGE_LINE</code></td>
+
+ <td align="center">1</td>
+
+ <td>A vertical line is drawn at the column number set by <code>SCI_SETEDGECOLUMN</code>.
+ This works well for monospaced fonts. The line is drawn at a position based on the width
+ of a space character in <a class="message"
+ href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>, so it may not work very well if
+ your styles use proportional fonts or if your style have varied font sizes or you use a
+ mixture of bold, italic and normal text.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>EDGE_BACKGROUND</code></td>
+
+ <td align="center">2</td>
+
+ <td>The background colour of characters after the column limit is changed to the colour
+ set by <code>SCI_SETEDGECOLOUR</code>. This is recommended for proportional fonts.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</b><br />
+ <b id="SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</b><br />
+ These messages set and get the column number at which to display the long line marker. When
+ drawing lines, the column sets a position in units of the width of a space character in
+ <code>STYLE_DEFAULT</code>. When setting the background colour, the column is a character count
+ (allowing for tabs) into the line.</p>
+
+ <p><b id="SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int <a class="jump"
+ href="#colour">colour</a>)</b><br />
+ <b id="SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</b><br />
+ These messages set and get the colour of the marker used to show that a line has exceeded the
+ length set by <code>SCI_SETEDGECOLUMN</code>.</p>
+
+ <h2 id="Lexer">Lexer</h2>
+
+ <p>If you define the symbol <code>SCI_LEXER</code> when building Scintilla, (this is sometimes
+ called the SciLexer version of Scintilla), lexing support for a wide range of programming
+ languages is included and the messages in this section are supported. If you want to set
+ styling and fold points for an unsupported language you can either do this in the container or
+ better still, write your own lexer following the pattern of one of the existing ones.</p>
+
+ <p>Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export three
+ functions: <code>GetLexerCount</code>, <code>GetLexerName</code>, and
+ <code>GetLexerFactory</code>. See <code>externalLexer.cxx</code> for more.</p>
+ <a class="message" href="#SCI_SETLEXER">SCI_SETLEXER(int lexer)</a><br />
+ <a class="message" href="#SCI_GETLEXER">SCI_GETLEXER</a><br />
+ <a class="message" href="#SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(&lt;unused&gt;, const char
+ *name)</a><br />
+ <a class="message" href="#SCI_GETLEXERLANGUAGE">SCI_GETLEXERLANGUAGE(&lt;unused&gt;, char
+ *name)</a><br />
+ <a class="message" href="#SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(&lt;unused&gt;, const char
+ *path)</a><br />
+ <a class="message" href="#SCI_COLOURISE">SCI_COLOURISE(int start, int end)</a><br />
+ <a class="message" href="#SCI_CHANGELEXERSTATE">SCI_CHANGELEXERSTATE(int start, int end)</a><br />
+ <a class="message" href="#SCI_PROPERTYNAMES">SCI_PROPERTYNAMES(&lt;unused&gt;, char *names)</a><br />
+ <a class="message" href="#SCI_PROPERTYTYPE">SCI_PROPERTYTYPE(const char *name)</a><br />
+ <a class="message" href="#SCI_DESCRIBEPROPERTY">SCI_DESCRIBEPROPERTY(const char *name, char *description)</a><br />
+ <a class="message" href="#SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</a><br />
+ <a class="message" href="#SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</a><br />
+ <a class="message" href="#SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</a><br />
+ <a class="message" href="#SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</a><br />
+ <a class="message" href="#SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(&lt;unused&gt;, char *descriptions)</a><br />
+ <a class="message" href="#SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char
+ *keyWordList)</a><br />
+
+ <a class="message" href="#SCI_GETSUBSTYLEBASES">SCI_GETSUBSTYLEBASES(&lt;unused&gt;, char *styles)</a><br />
+ <a class="message" href="#SCI_DISTANCETOSECONDARYSTYLES">SCI_DISTANCETOSECONDARYSTYLES</a><br />
+ <a class="message" href="#SCI_ALLOCATESUBSTYLES">SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)</a><br />
+ <a class="message" href="#SCI_FREESUBSTYLES">SCI_FREESUBSTYLES</a><br />
+ <a class="message" href="#SCI_GETSUBSTYLESSTART">SCI_GETSUBSTYLESSTART(int styleBase)</a><br />
+ <a class="message" href="#SCI_GETSUBSTYLESLENGTH">SCI_GETSUBSTYLESLENGTH(int styleBase)</a><br />
+ <a class="message" href="#SCI_GETSTYLEFROMSUBSTYLE">SCI_GETSTYLEFROMSUBSTYLE(int subStyle)</a><br />
+ <a class="message" href="#SCI_GETPRIMARYSTYLEFROMSTYLE">SCI_GETPRIMARYSTYLEFROMSTYLE(int style)</a><br />
+ <a class="message" href="#SCI_SETIDENTIFIERS">SCI_SETIDENTIFIERS(int style, const char *identifiers)</a><br />
+
+ <p><b id="SCI_SETLEXER">SCI_SETLEXER(int lexer)</b><br />
+ <b id="SCI_GETLEXER">SCI_GETLEXER</b><br />
+ You can select the lexer to use with an integer code from the <code>SCLEX_*</code> enumeration
+ in <code>Scintilla.h</code>. There are two codes in this sequence that do not use lexers:
+ <code>SCLEX_NULL</code> to select no lexing action and <code>SCLEX_CONTAINER</code> which sends
+ the <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification to
+ the container whenever a range of text needs to be styled. You cannot use the
+ <code>SCLEX_AUTOMATIC</code> value; this identifies additional external lexers that Scintilla
+ assigns unused lexer numbers to.</p>
+
+ <p><b id="SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(&lt;unused&gt;, const char *name)</b><br />
+ <b id="SCI_GETLEXERLANGUAGE">SCI_GETLEXERLANGUAGE(&lt;unused&gt;, char *name NUL-terminated)</b><br />
+ <code>SCI_SETLEXERLANGUAGE</code> lets you select a lexer by name, and is the only method if you are using an
+ external lexer or if you have written a lexer module for a language of your own and do not wish
+ to assign it an explicit lexer number. To select an existing lexer, set <code>name</code> to
+ match the (case sensitive) name given to the module, for example "ada" or "python", not "Ada"
+ or "Python". To locate the name for the built-in lexers, open the relevant
+ <code>Lex*.cxx</code> file and search for <code>LexerModule</code>. The third argument in the
+ <code>LexerModule</code> constructor is the name to use.</p>
+
+ <p>To test if your lexer assignment worked, use <a class="message"
+ href="#SCI_GETLEXER"><code>SCI_GETLEXER</code></a> before and after setting the new lexer to
+ see if the lexer number changed.</p>
+
+ <p><code>SCI_GETLEXERLANGUAGE</code> retrieves the name of the lexer.</p>
+
+ <p><b id="SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(&lt;unused&gt;, const char *path)</b><br />
+ Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows.
+ </p>
+
+ <p><b id="SCI_COLOURISE">SCI_COLOURISE(int startPos, int endPos)</b><br />
+ This requests the current lexer or the container (if the lexer is set to
+ <code>SCLEX_CONTAINER</code>) to style the document between <code>startPos</code> and
+ <code>endPos</code>. If <code>endPos</code> is -1, the document is styled from
+ <code>startPos</code> to the end. If the <code>"fold"</code> property is set to
+ <code>"1"</code> and your lexer or container supports folding, fold levels are also set. This
+ message causes a redraw.</p>
+
+ <p><b id="SCI_CHANGELEXERSTATE">SCI_CHANGELEXERSTATE(int startPos, int endPos)</b><br />
+ Indicate that the internal state of a lexer has changed over a range and therefore
+ there may be a need to redraw.</p>
+
+ <p><b id="SCI_PROPERTYNAMES">SCI_PROPERTYNAMES(&lt;unused&gt;, char *names NUL-terminated)</b><br />
+ <b id="SCI_PROPERTYTYPE">SCI_PROPERTYTYPE(const char *name)</b><br />
+ <b id="SCI_DESCRIBEPROPERTY">SCI_DESCRIBEPROPERTY(const char *name, char *description NUL-terminated)</b><br />
+ Information may be retrieved about the properties that can be set for the current lexer.
+ This information is only available for newer lexers.
+ <code>SCI_PROPERTYNAMES</code> returns a string with all of the valid properties separated by "\n".
+ If the lexer does not support this call then an empty string is returned.
+ Properties may be boolean (<code>SC_TYPE_BOOLEAN</code>), integer (<code>SC_TYPE_INTEGER</code>),
+ or string (<code>SC_TYPE_STRING</code>) and this is found with <code>SCI_PROPERTYTYPE</code>.
+ A description of a property in English is returned by <code>SCI_DESCRIBEPROPERTY</code>.</p>
+
+ <p><b id="SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</b><br />
+ You can communicate settings to lexers with keyword:value string pairs. There is no limit to
+ the number of keyword pairs you can set, other than available memory. <code>key</code> is a
+ case sensitive keyword, <code>value</code> is a string that is associated with the keyword. If
+ there is already a value string associated with the keyword, it is replaced. If you pass a zero
+ length string, the message does nothing. Both <code>key</code> and <code>value</code> are used
+ without modification; extra spaces at the beginning or end of <code>key</code> are
+ significant.</p>
+
+ <p>The <code>value</code> string can refer to other keywords. For example,
+ <code>SCI_SETPROPERTY("foldTimes10", "$(fold)0")</code> stores the string
+ <code>"$(fold)0"</code>, but when this is accessed, the <code>$(fold)</code> is replaced by the
+ value of the <code>"fold"</code> keyword (or by nothing if this keyword does not exist).</p>
+
+ <p>Currently the "fold" property is defined for most of the lexers to set the fold structure if
+ set to "1". <code>SCLEX_PYTHON</code> understands <code>"tab.timmy.whinge.level"</code> as a
+ setting that determines how to indicate bad indentation. Most keywords have values that are
+ interpreted as integers. Search the lexer sources for <code>GetPropertyInt</code> to see how
+ properties are used.</p>
+
+ <p>There is a convention for naming properties used by lexers so that the set of properties can be found by scripts.
+ Property names should start with "lexer.&lt;lexer&gt;." or "fold.&lt;lexer&gt;." when they apply to one
+ lexer or start with "lexer." or "fold." if they apply to multiple lexers.</p>
+
+ <p>Applications may discover the set of properties used by searching the source code of lexers for lines that contain
+ <code>GetProperty</code> and a double quoted string and extract the value of the double quoted string as the property name.
+ The <code>scintilla/scripts/LexGen.py</code> script does this and can be used as an example.
+ Documentation for the property may be located above the call as a multi-line comment starting with
+ <br/><code>// property &lt;property-name&gt;</code></p>
+
+ <p><b id="SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value NUL-terminated)</b><br />
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied
+ buffer and return the length (not including the terminating 0). If not found, copy an empty string
+ to the buffer and return 0.</p>
+
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">
+ <code>SCI_SETPROPERTY</code></a> will not be performed.</p>
+
+ <p>If the value argument is 0 then the length that should be allocated to store the value is returned;
+ again, the terminating 0 is not included.</p>
+
+ <p><b id="SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</b><br />
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied
+ buffer and return the length (not including the terminating 0). If not found, copy an empty string
+ to the buffer and return 0.</p>
+
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">
+ <code>SCI_SETPROPERTY</code></a> will be performed.</p>
+
+ <p>If the value argument is 0 then the length that should be allocated to store the value (including any indicated keyword replacement)
+ is returned; again, the terminating 0 is not included.</p>
+
+ <p><b id="SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</b><br />
+ Lookup a keyword:value pair using the specified key; if found, interpret the value as an integer and return it.
+ If not found (or the value is an empty string) then return the supplied default. If the keyword:value pair is found but is not
+ a number, then return 0.</p>
+
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">
+ <code>SCI_SETPROPERTY</code></a> will be performed before any numeric interpretation.</p>
+
+ <p><b id="SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)</b><br />
+ You can set up to 9 lists of keywords for use by the current lexer.
+ <code>keyWordSet</code> can be 0 to 8 (actually 0 to <code>KEYWORDSET_MAX</code>)
+ and selects which keyword list to replace. <code>keyWordList</code> is a list of keywords
+ separated by spaces, tabs, <code>"\n"</code> or <code>"\r"</code> or any combination of these.
+ It is expected that the keywords will be composed of standard ASCII printing characters,
+ but there is nothing to stop you using any non-separator character codes from 1 to 255
+ (except common sense).</p>
+
+ <p>How these keywords are used is entirely up to the lexer. Some languages, such as HTML may
+ contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set
+ 0 is for HTML, 1 is for JavaScript and 2 is for VBScript, 3 is for Python, 4 is for PHP and 5
+ is for SGML and DTD keywords. Review the lexer code to see examples of keyword list. A fully
+ conforming lexer sets the fourth argument of the <code>LexerModule</code> constructor to be a
+ list of strings that describe the uses of the keyword lists.</p>
+
+ <p>Alternatively, you might use set 0 for general keywords, set 1 for keywords that cause
+ indentation and set 2 for keywords that cause unindentation. Yet again, you might have a simple
+ lexer that colours keywords and you could change languages by changing the keywords in set 0.
+ There is nothing to stop you building your own keyword lists into the lexer, but this means
+ that the lexer must be rebuilt if more keywords are added.</p>
+
+ <p><b id="SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(&lt;unused&gt;, char *descriptions NUL-terminated)</b><br />
+ A description of all of the keyword sets separated by "\n" is returned by <code>SCI_DESCRIBEKEYWORDSETS</code>.</p>
+
+ <h3 id="Substyles">Substyles</h3>
+ <p>Lexers may support several different sublanguages and each sublanguage may want to style some number of
+ sets of identifiers (or similar lexemes such as documentation keywords) uniquely. Preallocating a large number for each
+ purpose would exhaust the number of allowed styles quickly.
+ This is alleviated by substyles which allow the application to determine how many sets of identifiers to allocate for
+ each purpose.
+ Lexers have to explicitly support this feature by implementing the methods in <code>ILexerWithSubStyles</code>.</p>
+
+ <p><b id="SCI_GETSUBSTYLEBASES">SCI_GETSUBSTYLEBASES(&lt;unused&gt;, char *styles NUL-terminated)</b><br />
+ Fill <code>styles</code> with a byte for each style that can be split into substyles.</p>
+
+ <p><b id="SCI_DISTANCETOSECONDARYSTYLES">SCI_DISTANCETOSECONDARYSTYLES</b><br />
+ Returns the distance between a primary style and its corresponding secondary style.</p>
+
+ <p><b id="SCI_ALLOCATESUBSTYLES">SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)</b><br />
+ Allocate some number of substyles for a particular base style returning the first substyle number allocated.
+ Substyles are allocated contiguously.</p>
+
+ <p><b id="SCI_FREESUBSTYLES">SCI_FREESUBSTYLES</b><br />
+ Free all allocated substyles.</p>
+
+ <p><b id="SCI_GETSUBSTYLESSTART">SCI_GETSUBSTYLESSTART(int styleBase)</b><br />
+ <b id="SCI_GETSUBSTYLESLENGTH">SCI_GETSUBSTYLESLENGTH(int styleBase)</b><br />
+ Return the start and length of the substyles allocated for a base style.</p>
+
+ <p><b id="SCI_GETSTYLEFROMSUBSTYLE">SCI_GETSTYLEFROMSUBSTYLE(int subStyle)</b><br />
+ For a sub style, return the base style, else return the argument.</p>
+
+ <p><b id="SCI_GETPRIMARYSTYLEFROMSTYLE">SCI_GETPRIMARYSTYLEFROMSTYLE(int style)</b><br />
+ For a secondary style, return the primary style, else return the argument.</p>
+
+ <p><b id="SCI_SETIDENTIFIERS">SCI_SETIDENTIFIERS(int style, const char *identifiers)</b><br />
+ Similar to <code>SCI_SETKEYWORDS</code> but for substyles.
+ The prefix feature available with <code>SCI_SETKEYWORDS</code> is not implemented for <code>SCI_SETIDENTIFIERS</code>.</p>
+
+ <h2 id="LexerObjects">Lexer Objects</h2>
+
+ <p>Lexers are programmed as objects that implement the ILexer interface and that interact
+ with the document they are lexing through the IDocument interface.
+ Previously lexers were defined by providing lexing and folding functions but creating an object
+ to handle the interaction of a lexer with a document allows the lexer to store state information that
+ can be used during lexing. For example a C++ lexer may store a set of preprocessor definitions
+ or variable declarations and style these depending on their role.</p>
+
+ <p>A set of helper classes allows older lexers defined by functions to be used in Scintilla.</p>
+<h4>ILexer</h4>
+
+<div class="highlighted">
+<span class="S5">class</span><span class="S0"> </span>ILexer<span class="S0"> </span><span class="S10">{</span><br />
+<span class="S5">public</span><span class="S10">:</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Version<span class="S10">()</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Release<span class="S10">()</span><span class="S0"> </span>
+<span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span>
+<span class="S5">char</span><span class="S0"> </span>
+<span class="S10">*</span><span class="S0"> </span>
+SCI_METHOD<span class="S0"> </span>PropertyNames<span class="S10">()</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>PropertyType<span class="S10">(</span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>name<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>DescribeProperty<span class="S10">(</span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>name<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>PropertySet<span class="S10">(</span><span class="S5">const</span>
+<span class="S0"> </span><span class="S5">char</span>
+<span class="S0"> </span><span class="S10">*</span>key<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>
+<span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>val<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span>
+<span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>DescribeWordListSets<span class="S10">()</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>WordListSet<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>n<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>
+<span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>wl<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Lex<span class="S10">(</span><span class="S5">unsigned</span>
+<span class="S0"> </span><span class="S5">int</span>
+<span class="S0"> </span>startPos<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span>
+<span class="S0"> </span>lengthDoc<span class="S10">,</span><span class="S0">
+</span><span class="S5">int</span><span class="S0"> </span>initStyle<span class="S10">,</span>
+<span class="S0"> </span>IDocument<span class="S0">
+</span><span class="S10">*</span>pAccess<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Fold<span class="S10">(</span><span class="S5">unsigned</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>startPos<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span>
+<span class="S0"> </span>lengthDoc<span class="S10">,</span><span class="S0">
+</span><span class="S5">int</span><span class="S0"> </span>initStyle<span class="S10">,</span>
+<span class="S0"> </span>IDocument<span class="S0">
+</span><span class="S10">*</span>pAccess<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>
+<span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0">
+</span>PrivateCall<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>operation<span class="S10">,</span><span class="S0">
+</span><span class="S5">void</span><span class="S0"> </span>
+<span class="S10">*</span>pointer<span class="S10">)</span><span class="S0"> </span>
+<span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S10">};</span><br />
+</div>
+
+<p>
+The return values from PropertySet and WordListSet are used to indicate whether the change requires
+performing lexing or folding over any of the document. It is the position at which to restart lexing and folding or -1
+if the change does not require any extra work on the document.
+A simple approach is to return 0 if there is any possibility that a change requires lexing the document again while an
+optimisation could be to remember where a setting first affects the document and return that position.
+</p>
+
+<p><code>Version</code> returns an enumerated value specifying which version of the interface is implemented:
+<code>lvOriginal</code> for <code>ILexer</code> and <code>lvSubStyles</code> for <code>ILexerWithSubStyles</code>.</p>
+
+<p><code>Release</code> is called to destroy the lexer object.</p>
+
+<p><code>PrivateCall</code> allows for direct communication between the
+application and a lexer. An example would be where an application
+maintains a single large data structure containing symbolic information
+about system headers (like Windows.h) and provides this to the lexer
+where it can be applied to each document. This avoids the costs of
+constructing the system header information for each document. This is
+invoked with the <code>SCI_PRIVATELEXERCALL</code> API.</p>
+
+<p><code>Fold</code> is called with the exact range that needs folding.
+Previously, lexers were called with a range that started one line before the range that
+needs to be folded as this allowed fixing up the last line from the previous folding.
+The new approach allows the lexer to decide whether to backtrack or to handle this
+more efficiently.</p>
+
+<h4>ILexerWithSubStyles</h4>
+
+<p>
+To allow lexers to report which line ends they support, and to support substyles,
+<code>Ilexer</code> is extended to <code>ILexerWithSubStyles</code>.
+</p>
+
+<div class="highlighted">
+<span class="S5">class</span><span class="S0"> </span>ILexerWithSubStyles<span class="S0"> </span><span class="S10">:</span><span class="S0"> </span><span class="S5">public</span><span class="S0"> </span>ILexer<span class="S0"> </span><span class="S10">{</span><br />
+<span class="S5">public</span><span class="S10">:</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>LineEndTypesSupported<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>AllocateSubStyles<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>styleBase<span class="S10">,</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>numberStyles<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>SubStylesStart<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>styleBase<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>SubStylesLength<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>styleBase<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>StyleFromSubStyle<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>subStyle<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>PrimaryStyleFromStyle<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>style<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>FreeSubStyles<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>SetIdentifiers<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>style<span class="S10">,</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>identifiers<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>DistanceToSecondaryStyles<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>GetSubStyleBases<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S10">};</span><br />
+</div>
+
+<h4>IDocument</h4>
+
+<div class="highlighted">
+<span class="S5">class</span><span class="S0"> </span>IDocument
+<span class="S0"> </span><span class="S10">{</span><br />
+<span class="S5">public</span><span class="S10">:</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Version<span class="S10">()</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>SetErrorStatus<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>status<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>Length<span class="S10">()</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>GetCharRange<span class="S10">(</span><span class="S5">char</span>
+<span class="S0"> </span><span class="S10">*</span>buffer<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>
+position<span class="S10">,</span><span class="S0"> </span>
+<span class="S5">int</span><span class="S0"> </span>lengthRetrieve<span class="S10">)</span>
+<span class="S0"> </span><span class="S5">const</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">char</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>StyleAt<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>position<span class="S10">)</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>LineFromPosition<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>position<span class="S10">)</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span>
+<span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>LineStart<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>line<span class="S10">)</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span>
+<span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>GetLevel<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>line<span class="S10">)</span>
+<span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span>
+<span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>SetLevel<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>line<span class="S10">,</span><span class="S0"> </span>
+<span class="S5">int</span><span class="S0"> </span>level<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>GetLineState<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>line<span class="S10">)</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span>
+<span class="S10">=</span><span class="S0"> </span><span class="S4">0</span>
+<span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>SetLineState<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>line<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>state<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>StartStyling<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>position<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">char</span><span class="S0"> </span>mask<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">bool</span>
+<span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>SetStyleFor<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>length<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">char</span><span class="S0"> </span>style<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span>
+<span class="S10">;</span><br />
+ <span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">bool</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>SetStyles<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>length<span class="S10">,</span><span class="S0"> </span>
+<span class="S5">const</span><span class="S0"> </span><span class="S5">char</span>
+<span class="S0"> </span><span class="S10">*</span>styles<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">void</span>
+<span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>DecorationSetCurrentIndicator<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>indicator<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>DecorationFillRange<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>position<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>value<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>fillLength<span class="S10">)</span>
+<span class="S0">
+ </span><span class="S10">=</span><span class="S0"> </span>
+<span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">void</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>ChangeLexerState<span class="S10">(</span><span class="S5">int</span>
+<span class="S0"> </span>start<span class="S10">,</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>end<span class="S10">)</span>
+<span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span>
+<span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>CodePage<span class="S10">()</span><span class="S0">
+ </span><span class="S5">const</span><span class="S0"> </span>
+<span class="S10">=</span><span class="S0"> </span><span class="S4">0</span>
+<span class="S10">;</span><br />
+<span class="S0">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">bool</span>
+<span class="S0"> </span>SCI_METHOD
+<span class="S0"> </span>IsDBCSLeadByte<span class="S10">(</span><span class="S5">char</span>
+<span class="S0"> </span>ch<span class="S10">)</span>
+<span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span>
+<span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S10">};</span><br />
+</div>
+
+<p>Scintilla tries to minimize the consequences of modifying text to
+only relex and redraw the line of the change where possible. Lexer
+objects contain their own private extra state which can affect later
+lines. For example, if the C++ lexer is greying out inactive code
+segments then changing the statement <code>#define BEOS 0</code> to <code>#define
+ BEOS 1</code> may require restyling and redisplaying later parts of the
+ document. The lexer can call <code>ChangeLexerState</code> to signal to
+ the document that it should relex and display more.</p>
+
+<p>For <code>StartStyling</code> the mask argument has no effect. It was used in version 3.4.2 and earlier.</p>
+
+<p><code>SetErrorStatus</code> is used to notify the document of
+exceptions. Exceptions should not be thrown over build boundaries as the
+ two sides may be built with different compilers or incompatible
+exception options.</p>
+
+<h4>IDocumentWithLineEnd</h4>
+
+<p>
+To allow lexers to determine the end position of a line and thus more easily support Unicode line ends
+<code>IDocument</code> is extended to <code>IDocumentWithLineEnd</code>.</p>
+<p><code>GetRelativePosition</code> navigates the document by whole characters,
+returning <code>INVALID_POSITION</code> for movement beyond the start and end of the document.</p>
+<p><code>GetCharacterAndWidth</code> provides a standard
+conversion from UTF-8 bytes to a UTF-32 character or from DBCS to a 16 bit value.
+Bytes in invalid UTF-8 are reported individually with values 0xDC80+byteValue, which are
+not valid Unicode code points.
+The <code>pWidth</code> argument can be NULL if the caller does not need to know the number of
+bytes in the character.
+</p>
+
+<div class="highlighted">
+<span class="S5">class</span><span class="S0"> </span>IDocumentWithLineEnd<span class="S0"> </span><span class="S10">:</span><span class="S0"> </span><span class="S5">public</span><span class="S0"> </span>IDocument<span class="S0"> </span><span class="S10">{</span><br />
+<span class="S5">public</span><span class="S10">:</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>LineEnd<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>line<span class="S10">)</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>GetRelativePosition<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>positionStart<span class="S10">,</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>characterOffset<span class="S10">)</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S0">&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>GetCharacterAndWidth<span class="S10">(</span><span class="S5">int</span><span class="S0"> </span>position<span class="S10">,</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span><span class="S10">*</span>pWidth<span class="S10">)</span><span class="S0"> </span><span class="S5">const</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br />
+<span class="S10">};</span><br />
+</div>
+
+<p>The <code>ILexer</code>, <code>ILexerWithSubStyles</code>, <code>IDocument</code>, and
+<code>IDocumentWithLineEnd</code> interfaces may be
+expanded in the future with extended versions (<code>ILexer2</code>...).
+ The <code>Version</code> method indicates which interface is
+implemented and thus which methods may be called.</p>
+
+ <h2 id="Notifications">Notifications</h2>
+
+ <p>Notifications are sent (fired) from the Scintilla control to its container when an event has
+ occurred that may interest the container.</p>
+ <p>Notifications are sent using the
+ <code>WM_NOTIFY</code> message on Windows.</p>
+ <p>On GTK+, the "sci-notify" signal is sent and the signal handler should have the signature
+ <code>handler(GtkWidget *, gint, SCNotification *notification, gpointer userData)</code>.</p>
+ <p>On Cocoa, a delegate implementing the <code>ScintillaNotificationProtocol</code>
+ may be set to receive notifications or the <code>ScintillaView</code> class may be subclassed and the
+ <code>notification:</code> method overridden. Overriding <code>notification:</code> allows the
+ subclass to control whether default handling is performed.</p>
+ <p>The container is
+ passed a <code>SCNotification</code> structure containing information about the event.</p>
+<pre id="SCNotification">
+struct NotifyHeader { // This matches the Win32 NMHDR structure
+ void *hwndFrom; // environment specific window handle/pointer
+ uptr_t idFrom; // CtrlID of the window issuing the notification
+ unsigned int code; // The SCN_* notification code
+};
+
+struct SCNotification {
+ struct Sci_NotifyHeader nmhdr;
+ int position;
+ /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
+ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
+ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
+ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+
+ int ch; /* SCN_CHARADDED, SCN_KEY */
+ int modifiers;
+ /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
+ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+
+ int modificationType; /* SCN_MODIFIED */
+ const char *text;
+ /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
+
+ int length; /* SCN_MODIFIED */
+ int linesAdded; /* SCN_MODIFIED */
+ int message; /* SCN_MACRORECORD */
+ uptr_t wParam; /* SCN_MACRORECORD */
+ sptr_t lParam; /* SCN_MACRORECORD */
+ int line; /* SCN_MODIFIED */
+ int foldLevelNow; /* SCN_MODIFIED */
+ int foldLevelPrev; /* SCN_MODIFIED */
+ int margin; /* SCN_MARGINCLICK */
+ int listType; /* SCN_USERLISTSELECTION */
+ int x; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int y; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
+ int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
+ int updated; /* SCN_UPDATEUI */
+};
+</pre>
+
+ <p>The notification messages that your container can choose to handle and the messages
+ associated with them are:</p>
+ <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a><br />
+ <a class="message" href="#SCN_CHARADDED">SCN_CHARADDED</a><br />
+ <a class="message" href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a><br />
+ <a class="message" href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a><br />
+ <a class="message" href="#SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</a><br />
+ <a class="message" href="#SCN_KEY">SCN_KEY</a><br />
+ <a class="message" href="#SCN_DOUBLECLICK">SCN_DOUBLECLICK</a><br />
+ <a class="message" href="#SCN_UPDATEUI">SCN_UPDATEUI</a><br />
+ <a class="message" href="#SCN_MODIFIED">SCN_MODIFIED</a><br />
+ <a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a><br />
+ <a class="message" href="#SCN_MARGINCLICK">SCN_MARGINCLICK</a><br />
+ <a class="message" href="#SCN_NEEDSHOWN">SCN_NEEDSHOWN</a><br />
+ <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a><br />
+ <a class="message" href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a><br />
+ <a class="message" href="#SCN_URIDROPPED">SCN_URIDROPPED</a><br />
+ <a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a><br />
+ <a class="message" href="#SCN_DWELLEND">SCN_DWELLEND</a><br />
+ <a class="message" href="#SCN_ZOOM">SCN_ZOOM</a><br />
+ <a class="message" href="#SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</a><br />
+ <a class="message" href="#SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</a><br />
+ <a class="message" href="#SCN_HOTSPOTRELEASECLICK">SCN_HOTSPOTRELEASECLICK</a><br />
+ <a class="message" href="#SCN_INDICATORCLICK">SCN_INDICATORCLICK</a><br />
+ <a class="message" href="#SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</a><br />
+ <a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a><br />
+ <a class="message" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a><br />
+ <a class="message" href="#SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</a><br />
+ <a class="message" href="#SCN_AUTOCCHARDELETED">SCN_AUTOCCHARDELETED</a><br />
+ <a class="message" href="#SCN_FOCUSIN">SCN_FOCUSIN</a><br />
+ <a class="message" href="#SCN_FOCUSOUT">SCN_FOCUSOUT</a><br />
+ </code>
+
+ <p>The following <code>SCI_*</code> messages are associated with these notifications:</p>
+ <code><a class="message" href="#SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int eventMask)</a><br />
+ <a class="message" href="#SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</a><br />
+ <a class="message" href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME(int milliseconds)</a><br />
+ <a class="message" href="#SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</a><br />
+ <a class="message" href="#SCI_SETIDENTIFIER">SCI_SETIDENTIFIER(int identifier)</a><br />
+ <a class="message" href="#SCI_GETIDENTIFIER">SCI_GETIDENTIFIER</a><br />
+ </code>
+
+ <p>The following additional notifications are sent using a secondary "command" method and should
+ be avoided in new code as the primary "notification" method provides all the same events with richer
+ information.
+ The <code>WM_COMMAND</code> message is used on Windows.
+ This emulates the Windows Edit control. Only the lower
+ 16 bits of the control's ID is passed in these notifications.</p>
+ <p>On GTK+, the "command" signal is sent and the signal handler should have the signature
+ <code>handler(GtkWidget *, gint wParam, gpointer lParam, gpointer userData)</code>.</p>
+ <code><a class="message" href="#SCEN_CHANGE">SCEN_CHANGE</a><br />
+ <a class="message" href="#SCEN_SETFOCUS">SCEN_SETFOCUS</a><br />
+ <a class="message" href="#SCEN_KILLFOCUS">SCEN_KILLFOCUS</a><br />
+ </code>
+
+ <p><b id="SCI_SETIDENTIFIER">SCI_SETIDENTIFIER(int identifier)</b><br />
+ <b id="SCI_GETIDENTIFIER">SCI_GETIDENTIFIER</b><br />
+ These two messages set and get the identifier of the Scintilla instance which is included in notifications as the
+ <code>idFrom</code> field.
+ When an application creates multiple Scintilla widgets, this allows the source of each notification to be found.
+ On Windows, this value is initialised in the <code>CreateWindow</code> call and stored as the
+ <code>GWLP_ID</code> attribute of the window.
+ The value should be small, preferably less than 16 bits,
+ rather than a pointer as some of the functions will only transmit 16 or 32 bits.
+ </p>
+
+ <p><b id="SCN_STYLENEEDED">SCN_STYLENEEDED</b><br />
+ If you used <code><a class="message"
+ href="#SCI_SETLEXER">SCI_SETLEXER</a>(SCLEX_CONTAINER)</code> to make the container act as the
+ lexer, you will receive this notification when Scintilla is about to display or print text that
+ requires styling. You are required to style the text from the line that contains the position
+ returned by <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a> up to
+ the position passed in <code>SCNotification.position</code>. Symbolically, you need code of the
+ form:</p>
+<pre>
+ startPos = <a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a>()
+ lineNumber = <a class="message"
+href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION</a>(startPos);
+ startPos = <a class="message"
+href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
+ MyStyleRoutine(startPos, SCNotification.position);
+</pre>
+
+ <p><b id="SCN_CHARADDED">SCN_CHARADDED</b><br />
+ This is sent when the user types an ordinary text character (as opposed to a command
+ character) that is entered into the text. The container can use this to decide to display a <a
+ class="jump" href="#CallTips">call tip</a> or an <a class="jump" href="#Autocompletion">auto
+ completion list</a>. The character is in <code>SCNotification.ch</code>.
+ This notification is sent before the character has been styled so processing that depends on
+ styling should instead be performed in the SCN_UPDATEUI notification.</p>
+
+ <p><b id="SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</b><br />
+ <b id="SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</b><br />
+ Sent to the container when the save point is entered or left, allowing the container to
+ display a "document dirty" indicator and change its menus.<br />
+ See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>, <a
+ class="message" href="#SCI_GETMODIFY"><code>SCI_GETMODIFY</code></a></p>
+
+ <p><b id="SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</b><br />
+ When in read-only mode, this notification is sent to the container if the user tries to change
+ the text. This can be used to check the document out of a version control system. You can set
+ the read-only state of a document with <code><a class="message"
+ href="#SCI_SETREADONLY">SCI_SETREADONLY</a></code>.</p>
+
+ <p><b id="SCN_KEY">SCN_KEY</b><br />
+ Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of
+ some problems with keyboard focus and is not sent by the Windows version. <code>SCNotification.ch</code> holds the key code and
+ <code>SCNotification.modifiers</code> holds the modifiers. This notification is sent if the
+ modifiers include <code>SCMOD_ALT</code> or <code>SCMOD_CTRL</code> and the key code is less
+ than 256.</p>
+
+ <p><b id="SCN_DOUBLECLICK">SCN_DOUBLECLICK</b><br />
+ The mouse button was double clicked in editor. The <code>position</code> field is set to the text position of the
+ double click, the <code>line</code> field is set to the line of the double click, and
+ the <code>modifiers</code> field is set to the key modifiers
+ held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>
+
+ <p><b id="SCN_UPDATEUI">SCN_UPDATEUI</b><br />
+ Either the text or styling of the document has changed or the selection range or scroll position has changed.
+ Now would be a good time to update any container UI elements that depend on document or view state.
+ The <code>updated</code> field is set to the bit set of things changed since the previous notification.</p>
+ <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification type flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Meaning</th>
+
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_UPDATE_CONTENT</code></td>
+
+ <td align="center">0x01</td>
+
+ <td>Contents, styling or markers have been changed.</td>
+
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_UPDATE_SELECTION</code></td>
+
+ <td align="center">0x02</td>
+
+ <td>Selection has been changed.</td>
+
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_UPDATE_V_SCROLL</code></td>
+
+ <td align="center">0x04</td>
+
+ <td>Scrolled vertically.</td>
+
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_UPDATE_H_SCROLL</code></td>
+
+ <td align="center">0x08</td>
+
+ <td>Scrolled horizontally.</td>
+
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCN_MODIFIED">SCN_MODIFIED</b><br />
+ This notification is sent when the text or styling of the document changes or is about to
+ change. You can set a mask for the notifications that are sent to the container with <a
+ class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>. The
+ notification structure contains information about what changed, how the change occurred and
+ whether this changed the number of lines in the document. No modifications may be performed
+ while in a <code>SCN_MODIFIED</code> event. The <code>SCNotification</code> fields used
+ are:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification types">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>modificationType</code></td>
+
+ <td align="left">A set of flags that identify the change(s) made. See the next
+ table.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>position</code></td>
+
+ <td align="left">Start position of a text or styling change. Set to 0 if not used.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>length</code></td>
+
+ <td align="left">Length of the change in cells or characters when the text or styling
+ changes. Set to 0 if not used.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>linesAdded</code></td>
+
+ <td align="left">Number of added lines. If negative, the number of deleted lines. Set to
+ 0 if not used or no lines added or deleted.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>text</code></td>
+
+ <td align="left">Valid for text changes, not for style changes. If we are collecting undo
+ information this holds a pointer to the text that is handed to the Undo system, otherwise
+ it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>line</code></td>
+
+ <td align="left">The line number at which a fold level or marker change occurred. This is
+ 0 if unused and may be -1 if more than one line changed.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>foldLevelNow</code></td>
+
+ <td align="left">The new fold level applied to the line or 0 if this field is
+ unused.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>foldLevelPrev</code></td>
+
+ <td align="left">The previous folding level of the line or 0 if this field is
+ unused.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p>The <code>SCNotification.modificationType</code> field has bits set to tell you what has
+ been done. The <code>SC_MOD_*</code> bits correspond to actions. The
+ <code>SC_PERFORMED_*</code> bits tell you if the action was done by the user, or the result of
+ Undo or Redo of a previous action.</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification type flags">
+ <tbody>
+ <tr>
+ <th align="left">Symbol</th>
+
+ <th>Value</th>
+
+ <th align="left">Meaning</th>
+
+ <th align="left">SCNotification fields</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>SC_MOD_INSERTTEXT</code></td>
+
+ <td align="right">0x01</td>
+
+ <td>Text has been inserted into the document.</td>
+
+ <td><code>position, length, text, linesAdded</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_DELETETEXT</code></td>
+
+ <td align="right">0x02</td>
+
+ <td>Text has been removed from the document.</td>
+
+ <td><code>position, length, text, linesAdded</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_CHANGESTYLE</code></td>
+
+ <td align="right">0x04</td>
+
+ <td>A style change has occurred.</td>
+
+ <td><code>position, length</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_CHANGEFOLD</code></td>
+
+ <td align="right">0x08</td>
+
+ <td>A folding change has occurred.</td>
+
+ <td><code>line, foldLevelNow, foldLevelPrev</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PERFORMED_USER</code></td>
+
+ <td align="right">0x10</td>
+
+ <td>Information: the operation was done by the user.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PERFORMED_UNDO</code></td>
+
+ <td align="right">0x20</td>
+
+ <td>Information: this was the result of an Undo.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_PERFORMED_REDO</code></td>
+
+ <td align="right">0x40</td>
+
+ <td>Information: this was the result of a Redo.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MULTISTEPUNDOREDO</code></td>
+
+ <td align="right">0x80</td>
+
+ <td>This is part of a multi-step Undo or Redo transaction.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_LASTSTEPINUNDOREDO</code></td>
+
+ <td align="right">0x100</td>
+
+ <td>This is the final step in an Undo or Redo transaction.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_CHANGEMARKER</code></td>
+
+ <td align="right">0x200</td>
+
+ <td>One or more markers has changed in a line.</td>
+
+ <td><code>line</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_BEFOREINSERT</code></td>
+
+ <td align="right">0x400</td>
+
+ <td>Text is about to be inserted into the document.</td>
+
+ <td><code>position, if performed by user then text in cells, length in cells</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_BEFOREDELETE</code></td>
+
+ <td align="right">0x800</td>
+
+ <td>Text is about to be deleted from the document.</td>
+
+ <td><code>position, length</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MOD_CHANGEINDICATOR</code></td>
+
+ <td align="right">0x4000</td>
+
+ <td>An indicator has been added or removed from a range of text.</td>
+
+ <td><code>position, length</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</code></td>
+
+ <td align="right">0x8000</td>
+
+ <td>A line state has changed because <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE</a>
+ was called.</td>
+
+ <td><code>line</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_CHANGETABSTOPS">SC_MOD_CHANGETABSTOPS</code></td>
+
+ <td align="right">0x200000</td>
+
+ <td>The explicit tab stops on a line have changed because <a class="message" href="#SCI_CLEARTABSTOPS">SCI_CLEARTABSTOPS</a> or
+ <a class="message" href="#SCI_ADDTABSTOP">SCI_ADDTABSTOP</a> was called.</td>
+
+ <td><code>line</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_LEXERSTATE">SC_MOD_LEXERSTATE</code></td>
+
+ <td align="right">0x80000</td>
+
+ <td>The internal state of a lexer has changed over a range.</td>
+
+ <td><code>position, length</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_CHANGEMARGIN">SC_MOD_CHANGEMARGIN</code></td>
+
+ <td align="right">0x10000</td>
+
+ <td>A text margin has changed.</td>
+
+ <td><code>line</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_CHANGEANNOTATION">SC_MOD_CHANGEANNOTATION</code></td>
+
+ <td align="right">0x20000</td>
+
+ <td>An annotation has changed.</td>
+
+ <td><code>line</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_INSERTCHECK">SC_MOD_INSERTCHECK</code></td>
+
+ <td align="right">0x100000</td>
+
+ <td>Text is about to be inserted. The handler may change the text being inserted by calling
+ <a class="message" href="#SCI_CHANGEINSERTION">SCI_CHANGEINSERTION</a>.
+ No other modifications may be made in this handler.</td>
+
+ <td><code>position, length, text</code></td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MULTILINEUNDOREDO</code></td>
+
+ <td align="right">0x1000</td>
+
+ <td>This is part of an Undo or Redo with multi-line changes.</td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_STARTACTION</code></td>
+
+ <td align="right">0x2000</td>
+
+ <td>This is set on a SC_PERFORMED_USER action when it is the
+ first or only step in an undo transaction. This can be used to integrate the Scintilla
+ undo stack with an undo stack in the container application by adding a Scintilla
+ action to the container's stack for the currently opened container transaction or
+ to open a new container transaction if there is no open container transaction.
+ </td>
+
+ <td>None</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code id="SC_MOD_CONTAINER">SC_MOD_CONTAINER</code></td>
+
+ <td align="right">0x40000</td>
+
+ <td>This is set on for actions that the container stored into the undo stack with
+ <a class="message" href="#SCI_ADDUNDOACTION"><code>SCI_ADDUNDOACTION</code></a>.
+ </td>
+
+ <td>token</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SC_MODEVENTMASKALL</code></td>
+
+ <td align="right">0x1FFFFF</td>
+
+ <td>This is a mask for all valid flags. This is the default mask state set by <a
+ class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</td>
+
+ <td>None</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCEN_CHANGE">SCEN_CHANGE</b><br />
+ <code>SCEN_CHANGE</code> (768) is fired when the text (not the style) of the document changes.
+ This notification is sent using the <code>WM_COMMAND</code> message on Windows and the
+ "command" signal on GTK+ as this is the behaviour of the standard Edit control
+ (<code>SCEN_CHANGE</code> has the same value as the Windows Edit control
+ <code>EN_CHANGE</code>). No other information is sent. If you need more detailed information
+ use <a class="message" href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a>. You can filter the
+ types of changes you are notified about with <a class="message"
+ href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</p>
+
+ <p><b id="SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int eventMask)</b><br />
+ <b id="SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</b><br />
+ These messages set and get an event mask that determines which document change events are
+ notified to the container with <a class="message"
+ href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a> and <a class="message"
+ href="#SCEN_CHANGE"><code>SCEN_CHANGE</code></a>. For example, a container may decide to see
+ only notifications about changes to text and not styling changes by calling
+ <code>SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)</code>.</p>
+
+ <p>The possible notification types are the same as the <code>modificationType</code> bit flags
+ used by <code>SCN_MODIFIED</code>: <code>SC_MOD_INSERTTEXT</code>,
+ <code>SC_MOD_DELETETEXT</code>, <code>SC_MOD_CHANGESTYLE</code>,
+ <code>SC_MOD_CHANGEFOLD</code>, <code>SC_PERFORMED_USER</code>, <code>SC_PERFORMED_UNDO</code>,
+ <code>SC_PERFORMED_REDO</code>, <code>SC_MULTISTEPUNDOREDO</code>,
+ <code>SC_LASTSTEPINUNDOREDO</code>, <code>SC_MOD_CHANGEMARKER</code>,
+ <code>SC_MOD_BEFOREINSERT</code>, <code>SC_MOD_BEFOREDELETE</code>,
+ <code>SC_MULTILINEUNDOREDO</code>, and <code>SC_MODEVENTMASKALL</code>.</p>
+
+ <p><b id="SCEN_SETFOCUS">SCEN_SETFOCUS</b><br />
+ <b id="SCEN_KILLFOCUS">SCEN_KILLFOCUS</b><br />
+ <code>SCEN_SETFOCUS</code> (512) is fired when Scintilla receives focus and
+ <code>SCEN_KILLFOCUS</code> (256) when it loses focus. These notifications are sent using the
+ <code>WM_COMMAND</code> message on Windows and the "command" signal on GTK+ as this is the
+ behaviour of the standard Edit control. Unfortunately, these codes do not match the Windows Edit
+ notification codes <code>EN_SETFOCUS</code> (256) and <code>EN_KILLFOCUS</code> (512). It is
+ now too late to change the Scintilla codes as clients depend on the current values.</p>
+
+ <p><b id="SCN_MACRORECORD">SCN_MACRORECORD</b><br />
+ The <code><a class="message" href="#SCI_STARTRECORD">SCI_STARTRECORD</a></code> and <a
+ class="message" href="#SCI_STOPRECORD"><code>SCI_STOPRECORD</code></a> messages enable and
+ disable macro recording. When enabled, each time a recordable change occurs, the
+ <code>SCN_MACRORECORD</code> notification is sent to the container. It is up to the container
+ to record the action. To see the complete list of <code>SCI_*</code> messages that are
+ recordable, search the Scintilla source <code>Editor.cxx</code> for
+ <code>Editor::NotifyMacroRecord</code>. The fields of <code>SCNotification</code> set in this
+ notification are:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Macro record notification data">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>message</code></td>
+
+ <td align="left">The <code>SCI_*</code> message that caused the notification.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>wParam</code></td>
+
+ <td align="left">The value of <code>wParam</code> in the <code>SCI_*</code> message.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>lParam</code></td>
+
+ <td align="left">The value of <code>lParam</code> in the <code>SCI_*</code> message.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCN_MARGINCLICK">SCN_MARGINCLICK</b><br />
+ This notification tells the container that the mouse was clicked inside a <a class="jump"
+ href="#Margins">margin</a> that was marked as sensitive (see <a class="message"
+ href="#SCI_SETMARGINSENSITIVEN"><code>SCI_SETMARGINSENSITIVEN</code></a>). This can be used to
+ perform folding or to place breakpoints. The following <code>SCNotification</code> fields are
+ used:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Margin click notification">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>modifiers</code></td>
+
+ <td align="left">The appropriate combination of <code>SCI_SHIFT</code>,
+ <code>SCI_CTRL</code> and <code>SCI_ALT</code> to indicate the keys that were held down
+ at the time of the margin click.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>position</code></td>
+
+ <td align="left">The position of the start of the line in the document that corresponds
+ to the margin click.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>margin</code></td>
+
+ <td align="left">The margin number that was clicked.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCN_NEEDSHOWN">SCN_NEEDSHOWN</b><br />
+ Scintilla has determined that a range of lines that is currently invisible should be made
+ visible. An example of where this may be needed is if the end of line of a contracted fold
+ point is deleted. This message is sent to the container in case it wants to make the line
+ visible in some unusual way such as making the whole document visible. Most containers will
+ just ensure each line in the range is visible by calling <a class="message"
+ href="#SCI_ENSUREVISIBLE"><code>SCI_ENSUREVISIBLE</code></a>. The <code>position</code> and
+ <code>length</code> fields of <code>SCNotification</code> indicate the range of the document
+ that should be made visible. The container code will be similar to the following code
+ skeleton:</p>
+<pre>
+firstLine = SCI_LINEFROMPOSITION(scn.position)
+lastLine = SCI_LINEFROMPOSITION(scn.position+scn.length-1)
+for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
+</pre>
+
+ <p><b id="SCN_PAINTED">SCN_PAINTED</b><br />
+ Painting has just been done. Useful when you want to update some other widgets based on a
+ change in Scintilla, but want to have the paint occur first to appear more responsive. There is
+ no other information in <code>SCNotification</code>.</p>
+
+ <p><b id="SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</b><br />
+ The user has selected an item in a <a class="jump" href="#UserLists">user list</a>. The
+ <code>SCNotification</code> fields used are:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="User list notification">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>listType</code></td>
+
+ <td align="left">This is set to the <code>listType</code> parameter from the <a
+ class="message" href="#SCI_USERLISTSHOW"><code>SCI_USERLISTSHOW</code></a> message that
+ initiated the list.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>text</code></td>
+
+ <td align="left">The text of the selection.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>position</code></td>
+
+ <td align="left">The position the list was displayed at.</td>
+ </tr>
+ </tbody>
+ </table>
+ <br />
+
+
+ <p><b id="SCN_URIDROPPED">SCN_URIDROPPED</b><br />
+ Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web
+ address onto Scintilla. The container could interpret this as a request to open the file. The
+ <code>text</code> field of <code>SCNotification</code> points at the URI text.</p>
+
+ <p><b id="SCN_DWELLSTART">SCN_DWELLSTART</b><br />
+ <b id="SCN_DWELLEND">SCN_DWELLEND</b><br />
+ <code>SCN_DWELLSTART</code> is generated when the user keeps the mouse in one position for the
+ dwell period (see <code><a class="message"
+ href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</a></code>). <code>SCN_DWELLEND</code> is
+ generated after a <code>SCN_DWELLSTART</code> and the mouse is moved or other activity such as
+ key press indicates the dwell is over. Both notifications set the same fields in
+ <code>SCNotification</code>:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Mouse dwell notification">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>position</code></td>
+
+ <td align="left">This is the nearest position in the document to the position where the
+ mouse pointer was lingering.</td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>x, y</code></td>
+
+ <td align="left">Where the pointer lingered. The <code>position</code> field is set to
+ <code><a class="message"
+ href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE</a>(x, y)</code>.</td>
+ </tr>
+ </tbody>
+ </table>
+ <br />
+
+ <p><b id="SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME(int milliseconds)</b><br />
+ <b id="SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</b><br />
+ These two messages set and get the time the mouse must sit still, in milliseconds, to generate
+ a <code><a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> notification. If
+ set to <code>SC_TIME_FOREVER</code>, the default, no dwell events are generated.</p>
+
+ <p><b id="SCN_ZOOM">SCN_ZOOM</b><br />
+ This notification is generated when the user zooms the display using the keyboard or the
+ <code><a class="message" href="#SCI_SETZOOM">SCI_SETZOOM</a></code> method is called. This
+ notification can be used to recalculate positions, such as the width of the line number margin
+ to maintain sizes in terms of characters rather than pixels. <code>SCNotification</code> has no
+ additional information.</p>
+
+ <p>
+ <b id="SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</b><br />
+ <b id="SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</b><br />
+ <b id="SCN_HOTSPOTRELEASECLICK">SCN_HOTSPOTRELEASECLICK</b><br />
+ These notifications are generated when the user clicks or double clicks on
+ text that is in a style with the hotspot attribute set.
+ This notification can be used to link to variable definitions or web pages.
+ In the notification handler, you should avoid calling any function that modifies the current selection or caret position.
+ The <code>position</code> field is set the text position of the click or
+ double click and the <code>modifiers</code> field set to the key modifiers
+ held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.
+ Only the state of the Ctrl key is reported for <code>SCN_HOTSPOTRELEASECLICK</code>.</p>
+
+ <p>
+ <b id="SCN_INDICATORCLICK">SCN_INDICATORCLICK</b><br />
+ <b id="SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</b><br />
+ These notifications are generated when the user clicks or releases the mouse on
+ text that has an indicator.
+ The <code>position</code> field is set the text position of the click or
+ double click and the <code>modifiers</code> field set to the key modifiers
+ held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>
+
+ <p><b id="SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</b><br />
+ This notification is generated when the user clicks on a calltip.
+ This notification can be used to display the next function prototype when a
+ function name is overloaded with different arguments.
+ The <code>position</code> field is set to 1 if the click is in an up arrow,
+ 2 if in a down arrow, and 0 if elsewhere.</p>
+
+ <p><b id="SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</b><br />
+ The user has selected an item in an <a class="jump" href="#Autocompletion">autocompletion list</a>. The
+ notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a
+ <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code> message
+ before returning from the notification. The <code>SCNotification</code> fields used are:</p>
+
+ <table cellpadding="1" cellspacing="2" border="0" summary="Autocompletion list notification">
+ <tbody>
+ <tr>
+ <th align="left">Field</th>
+
+ <th align="left">Usage</th>
+ </tr>
+ </tbody>
+
+ <tbody valign="top">
+ <tr>
+ <td align="left"><code>position</code></td>
+
+ <td align="left">The start position of the word being completed.</td>
+ </tr>
+ <tr>
+ <td align="left"><code>text</code></td>
+
+ <td align="left">The text of the selection.</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p><b id="SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</b><br />
+ The user has cancelled an <a class="jump" href="#Autocompletion">autocompletion list</a>.
+ There is no other information in SCNotification.</p>
+
+ <p><b id="SCN_AUTOCCHARDELETED">SCN_AUTOCCHARDELETED</b><br />
+ The user deleted a character while autocompletion list was active.
+ There is no other information in SCNotification.</p>
+
+ <p><b id="SCN_FOCUSIN">SCN_FOCUSIN</b><br />
+ <b id="SCN_FOCUSOUT">SCN_FOCUSOUT</b><br />
+ <code>SCN_FOCUSIN</code> (2028) is fired when Scintilla receives focus and
+ <code>SCN_FOCUSOUT</code> (2029) when it loses focus.</p>
+
+ <h2 id="Images">Images</h2>
+
+ <p>Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.</p>
+
+ <h3 id="RGBA">RGBA</h3>
+
+ <p>The RGBA format allows translucency with an <a class="jump" href="#alpha">alpha</a>
+ value for each pixel. It is simpler than
+ <code>XPM</code> and more capable.</p>
+
+ <p>The data is a sequence of 4 byte pixel values starting with the pixels for the top line, with the
+ leftmost pixel first, then continuing with the pixels for subsequent lines. There is no gap between
+ lines for alignment reasons.</p>
+
+ <p>Each pixel consists of, in order, a red byte, a green byte, a blue byte and an alpha byte.
+ The colour bytes are not premultiplied by the alpha value. That is, a fully red pixel that is
+ 25% opaque will be [FF, 00, 00, 3F]</p>
+
+ <p>Since the RGBA pixel data does not include any size information the
+ width and height must previously been set with the
+ <a class="message" href="#SCI_RGBAIMAGESETWIDTH"><code>SCI_RGBAIMAGESETWIDTH</code></a> and
+ <a class="message" href="#SCI_RGBAIMAGESETHEIGHT"><code>SCI_RGBAIMAGESETHEIGHT</code></a> messages.</p>
+
+ <p>GUI platforms often include functions for reading image file formats like PNG into memory
+ in the RGBA form or a similar form.
+ If there is no suitable platform support, the <a href="http://lodev.org/lodepng/">LodePNG and picoPNG</a> libraries are small libraries
+ for loading and decoding PNG files available under a BSD-style license.</p>
+
+ <p>RGBA format is supported on Windows, GTK+ and OS X Cocoa.</p>
+
+ <h3 id="XPM">XPM</h3>
+
+ <p>The XPM format is
+ <a class="jump" href="http://en.wikipedia.org/wiki/X_PixMap">described here</a>.
+ Scintilla is only able to handle XPM pixmaps that use one character per pixel with no named colours.
+ There may be a completely transparent colour named "None".</p>
+ <p>There are two forms of data structure used for XPM images, the first "lines form" format is well suited
+ to embedding an image inside C source code and the "text form" is suited to reading from a file.
+ In the lines form, an array of strings is used with the first string indicating the dimensions and number of colours
+ used. This is followed by a string for each colour and that section is followed by the image with one string per line.
+ The text form contains the same data as one null terminated block formatted as C source code starting
+ with a "/* XPM */" comment to mark the format.</p>
+ <p>Either format may be used with Scintilla APIs with the bytes at the location pointed to examined
+ to determine which format: if the bytes start with "/* XPM */" then it is treated as text form,
+ otherwise it is treated as lines form.</p>
+
+ <p>XPM format is supported on on all platforms.</p>
+
+ <h2 id="GTK">GTK+</h2>
+ <p>On GTK+, the following functions create a Scintilla widget, communicate with it and allow
+ resources to be released after all Scintilla widgets have been destroyed.</p>
+ <code><a class="message" href="#scintilla_new">GtkWidget *scintilla_new()</a><br />
+ <a class="message" href="#scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</a><br />
+ <a class="message" href="#scintilla_send_message">sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)</a><br />
+ <a class="message" href="#scintilla_release_resources">void scintilla_release_resources()</a><br />
+ </code>
+
+ <p><b id="scintilla_new">GtkWidget *scintilla_new()</b><br />
+ Create a new Scintilla widget. The returned pointer can be added to a container and displayed in the same way as other
+ widgets.</p>
+
+ <p><b id="scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</b><br />
+ Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all
+ notifications for this instance.
+ This is equivalent to <a class="message" href="#SCI_SETIDENTIFIER">SCI_SETIDENTIFIER</a>.</p>
+
+ <p><b id="scintilla_send_message">sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)</b><br />
+ The main entry point allows sending any of the messages described in this document.</p>
+
+ <p><b id="scintilla_release_resources">void scintilla_release_resources()</b><br />
+ Call this to free any remaining resources after all the Scintilla widgets have been destroyed.</p>
+
+ <h2 id="ProvisionalMessages">Provisional messages</h2>
+
+ <p>Complex new features may be added as 'provisional' to allow further changes to the API.
+ Provisional features may even be removed if experience shows they are a mistake.</p>
+
+ <p>Provisional features are displayed in this document with <span class="provisional">a distinctive background colour</span>.</p>
+
+ <p>There are currently no provisional messages.
+ The <code class="provisional">SC_TECHNOLOGY_DIRECTWRITERETAIN</code> and
+ <code class="provisional">SC_TECHNOLOGY_DIRECTWRITEDC</code> values for
+ <a class="message" href="#SCI_SETTECHNOLOGY">SCI_SETTECHNOLOGY</a> are provisional.</p>
+
+ <p>Using C++11 &lt;regex&gt; is provisional.</p>
+
+ <p>Some developers may want to only use features that are stable and have graduated from
+ provisional status. To avoid using provisional messages compile with the symbol
+ <code>SCI_DISABLE_PROVISIONAL</code> defined.</p>
+
+ <h2 id="DeprecatedMessages">Deprecated messages and notifications</h2>
+
+ <p>The following messages are currently supported to emulate existing Windows controls, but
+ they will be removed in future versions of Scintilla. If you use these messages you should
+ replace them with the Scintilla equivalent.</p>
+<pre>
+WM_GETTEXT(int length, char *text)
+WM_SETTEXT(&lt;unused&gt;, const char *text)
+EM_GETLINE(int line, char *text)
+EM_REPLACESEL(&lt;unused&gt;, const char *text)
+EM_SETREADONLY
+EM_GETTEXTRANGE(&lt;unused&gt;, TEXTRANGE *tr)
+WM_CUT
+WM_COPY
+WM_PASTE
+WM_CLEAR
+WM_UNDO
+EM_CANUNDO
+EM_EMPTYUNDOBUFFER
+WM_GETTEXTLENGTH
+EM_GETFIRSTVISIBLELINE
+EM_GETLINECOUNT
+EM_GETMODIFY
+EM_SETMODIFY(bool isModified)
+EM_GETRECT(RECT *rect)
+EM_GETSEL(int *start, int *end)
+EM_EXGETSEL(&lt;unused&gt;, CHARRANGE *cr)
+EM_SETSEL(int start, int end)
+EM_EXSETSEL(&lt;unused&gt;, CHARRANGE *cr)
+EM_GETSELTEXT(&lt;unused&gt;, char *text)
+EM_LINEFROMCHAR(int position)
+EM_EXLINEFROMCHAR(int position)
+EM_LINEINDEX(int line)
+EM_LINELENGTH(int position)
+EM_SCROLL(int line)
+EM_LINESCROLL(int column, int line)
+EM_SCROLLCARET()
+EM_CANPASTE
+EM_CHARFROMPOS(&lt;unused&gt;, POINT *location)
+EM_POSFROMCHAR(int position, POINT *location)
+EM_SELECTIONTYPE
+EM_HIDESELECTION(bool hide)
+EM_FINDTEXT(int flags, FINDTEXTEX *ft)
+EM_FINDTEXTEX(int flags, FINDTEXTEX *ft)
+EM_GETMARGINS
+EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val)
+EM_FORMATRANGE
+</pre>
+
+ <p>The following are features that are only included if you define
+ <code>INCLUDE_DEPRECATED_FEATURES</code> in <code>Scintilla.h</code>. To ensure future
+ compatibility you should change them as indicated.</p>
+
+ <p><b id="SC_CP_DBCS">SC_CP_DBCS</b> Deprecated<br />
+ This was used to set a DBCS (Double Byte Character Set) mode on GTK+.
+ An explicit DBCS code page should be used when calling <a class="message" href="#SCI_SETCODEPAGE">SCI_SETCODEPAGE</a></p>
+
+ <p><b id="SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool allowPaletteUse)</b> Deprecated<br />
+ <b id="SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</b> Deprecated<br />
+ Scintilla no longer supports palette mode. The last version to support palettes was 2.29.
+ Any calls to these methods should be removed.</p>
+
+ <p><b id="SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</b> Deprecated<br />
+ <b id="SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</b> Deprecated<br />
+ On Windows, Scintilla no longer supports narrow character windows so input is always treated as Unicode.</p>
+
+ <p>The following are features that should be removed from calling code but are still
+ defined to avoid breaking callers.</p>
+
+ <p id="StyleByteIndicators"><b id="SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</b> Deprecated<br />
+ <b id="SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</b> Deprecated<br />
+ <b id="SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</b> Deprecated<br />
+ <code>INDIC0_MASK</code>, <code>INDIC1_MASK</code>, <code>INDIC2_MASK</code>, <code>INDICS_MASK</code> Deprecated<br />
+ Scintilla no longer supports style byte indicators. The last version to support style byte indicators was 3.4.2.
+ Any use of these symbols should be removed and replaced with <a href="#Indicators">standard indicators</a>.
+ <code>SCI_GETSTYLEBITS</code> and <code>SCI_GETSTYLEBITSNEEDED</code> always return 8,
+ indicating that 8 bits are used for styling and there are 256 styles.</p>
+
+ <h2 id="EditMessagesNeverSupportedByScintilla">Edit messages never supported by Scintilla</h2>
+<pre>
+EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX
+EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX
+EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE
+EM_LIMITTEXT EM_EXLIMITTEXT
+EM_SETRECT EM_SETRECTNP
+EM_FMTLINES
+EM_GETHANDLE EM_SETHANDLE
+EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR
+EM_SETTABSTOPS
+EM_FINDWORDBREAK
+EM_GETCHARFORMAT EM_SETCHARFORMAT
+EM_GETOLEINTERFACE EM_SETOLEINTERFACE
+EM_SETOLECALLBACK
+EM_GETPARAFORMAT EM_SETPARAFORMAT
+EM_PASTESPECIAL
+EM_REQUESTRESIZE
+EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR
+EM_STREAMIN EM_STREAMOUT
+EM_GETIMECOLOR EM_SETIMECOLOR
+EM_GETIMEOPTIONS EM_SETIMEOPTIONS
+EM_GETOPTIONS EM_SETOPTIONS
+EM_GETPUNCTUATION EM_SETPUNCTUATION
+EM_GETTHUMB
+EM_GETEVENTMASK
+EM_SETEVENTMASK
+EM_DISPLAYBAND
+EM_SETTARGETDEVICE
+</pre>
+
+ <p>Scintilla tries to be a superset of the standard windows Edit and RichEdit controls wherever
+ that makes sense. As it is not intended for use in a word processor, some edit messages can not
+ be sensibly handled. Unsupported messages have no effect.</p>
+
+ <h2 id="RemovedFeatures">Removed features</h2>
+
+ <p>Previous versions of Scintilla allowed indicators to be stored in bits of each style byte.
+ This was deprecated in 2007 and removed in 2014 with release 3.4.3.
+ All uses of style byte indicators should be replaced with <a href="#Indicators">standard indicators</a>.</p>
+
+ <h2 id="BuildingScintilla">Building Scintilla</h2>
+
+ <p>To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE
+ directories. For Windows, GCC 4.7 or Microsoft Visual C++ 2010 can be used
+ for building. For GTK+, GCC 4.1 or newer should be used. GTK+ 2.8+ and 3.x are
+ supported. The version of GTK+ installed should be detected automatically.
+ When both GTK+ 2 and GTK+ 3 are present, building for GTK+ 3.x requires defining GTK3
+ on the command line.</p>
+
+ <h3>Static linking</h3>
+
+ <p>On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to
+ link Scintilla directly into your application .EXE or .DLL file, then the
+ <code>STATIC_BUILD</code> preprocessor symbol should be defined and
+ <code>Scintilla_RegisterClasses</code> called. <code>STATIC_BUILD</code> prevents compiling the
+ <code>DllMain</code> function which will conflict with any <code>DllMain</code> defined in your
+ code. <code>Scintilla_RegisterClasses</code> takes the <code>HINSTANCE</code> of your
+ application and ensures that the "Scintilla" window class is registered.</p>
+
+ <h3>Ensuring lexers are linked into Scintilla</h3>
+
+ <p>Depending on the compiler and linker used, the lexers may be stripped out. This is most
+ often caused when building a static library. To ensure the lexers are linked in, the
+ <code>Scintilla_LinkLexers()</code> function may be called.</p>
+
+ <h3>Changing set of lexers</h3>
+
+ <p>To change the set of lexers in Scintilla, add and remove lexer source files
+ (<code>Lex*.cxx</code>) from the <code>scintilla/lexers directory</code> and run the
+ <code>scripts/LexGen.py</code> script from the <code>scripts</code> directory to update the make files
+ and <code>Catalogue.cxx</code>. <code>LexGen.py</code> requires Python 2.5 or later. If you do
+ not have access to Python, you can hand edit <code>Catalogue.cxx</code> in a simple-minded way,
+ following the patterns of other lexers. The important thing is to include
+ <code>LINK_LEXER(lmMyLexer);</code> to correspond with the <code>LexerModule
+ lmMyLexer(...);</code> in your lexer source code.</p>
+
+ <h3>Building with an alternative Regular Expression implementation</h3>
+
+ <p id="AlternativeRegEx">A simple interface provides support for switching the Regular Expressions engine at
+ compile time. You must implement <code>RegexSearchBase</code> for your chosen engine,
+ look at the built-in implementation <code>BuiltinRegex</code> to see how this is done.
+ You then need to implement the factory method <code>CreateRegexSearch</code>
+ to create an instance of your class. You must disable the built-in implementation by defining
+ <code>SCI_OWNREGEX</code>.</p>
+
+ </body>
+</html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDownload.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDownload.html
new file mode 100644
index 00000000000..7bcb01c54f4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaDownload.html
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Download Scintilla
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Download
+ Scintilla</font></a>
+ </td>
+ </tr>
+ </table>
+ <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
+ <tr>
+ <td>
+ <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.zip?download">
+ Windows</a>&nbsp;&nbsp;
+ <a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.tgz?download">
+ GTK+/Linux</a>&nbsp;&nbsp;
+ </font>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Download.
+ </h2>
+ <p>
+ The <a href="License.txt">license</a> for using Scintilla or SciTE is similar to that of Python
+ containing very few restrictions.
+ </p>
+ <h3>
+ Release 3.5.6
+ </h3>
+ <h4>
+ Source Code
+ </h4>
+ The source code package contains all of the source code for Scintilla but no binary
+ executable code and is available in
+ <ul>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.zip?download">zip format</a> (1450K) commonly used on Windows</li>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla356.tgz?download">tgz format</a> (1300K) commonly used on Linux and compatible operating systems</li>
+ </ul>
+ Instructions for building on both Windows and Linux are included in the readme file.
+ <h4>
+ Windows Executable Code
+ </h4>
+ There is no download available containing only the Scintilla DLL.
+ However, it is included in the <a href="SciTEDownload.html">SciTE
+ executable full download</a> as SciLexer.DLL.
+ <p>
+ <a href="SciTEDownload.html">SciTE</a> is a good demonstration of Scintilla.
+ </p>
+ <p>
+ Previous versions can be downloaded from the <a href="ScintillaHistory.html">history
+ page</a>.
+ </p>
+ </body>
+</html>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaHistory.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaHistory.html
new file mode 100644
index 00000000000..791acff773e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaHistory.html
@@ -0,0 +1,10504 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>
+ Scintilla and SciTE
+ </title>
+ <style type="text/css">
+ table {
+ border-collapse: collapse;
+ font-size: 80%;
+ }
+ td {
+ xborder: 1px solid #1F1F1F;
+ padding: 0px 4px;
+ }
+ </style>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ and SciTE</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ History of Scintilla and SciTE
+ </h2>
+ <h3>
+ Contributors
+ </h3>
+ <p>
+ Thanks to all the people that have contributed patches, bug reports and suggestions.
+ </p>
+ <p>
+ Source code and documentation have been contributed by
+ </p>
+ <table>
+ <tr>
+ <td>Atsuo Ishimoto</td>
+ <td>Mark Hammond</td>
+ <td>Francois Le Coguiec</td>
+ <td>Dale Nagata</td>
+ </tr><tr>
+ <td>Ralf Reinhardt</td>
+ <td>Philippe Lhoste</td>
+ <td>Andrew McKinlay</td>
+ <td>Stephan R. A. Deibel</td>
+ </tr><tr>
+ <td>Hans Eckardt</td>
+ <td>Vassili Bourdo</td>
+ <td>Maksim Lin</td>
+ <td>Robin Dunn</td>
+ </tr><tr>
+ <td>John Ehresman</td>
+ <td>Steffen Goeldner</td>
+ <td>Deepak S.</td>
+ <td><a href="http://www.develop.com">DevelopMentor</a></td>
+ </tr><tr>
+ <td>Yann Gaillard</td>
+ <td>Aubin Paul</td>
+ <td>Jason Diamond</td>
+ <td>Ahmad Baitalmal</td>
+ </tr><tr>
+ <td>Paul Winwood</td>
+ <td>Maxim Baranov</td>
+ <td>Ragnar Højland</td>
+ <td>Christian Obrecht</td>
+ </tr><tr>
+ <td>Andreas Neukoetter</td>
+ <td>Adam Gates</td>
+ <td>Steve Lhomme</td>
+ <td>Ferdinand Prantl</td>
+ </tr><tr>
+ <td>Jan Dries</td>
+ <td>Markus Gritsch</td>
+ <td>Tahir Karaca</td>
+ <td>Ahmad Zawawi</td>
+ </tr><tr>
+ <td>Laurent le Tynevez</td>
+ <td>Walter Braeu</td>
+ <td>Ashley Cambrell</td>
+ <td>Garrett Serack</td>
+ </tr><tr>
+ <td>Holger Schmidt</td>
+ <td><a href="http://www.activestate.com">ActiveState</a></td>
+ <td>James Larcombe</td>
+ <td>Alexey Yutkin</td>
+ </tr><tr>
+ <td>Jan Hercek</td>
+ <td>Richard Pecl</td>
+ <td>Edward K. Ream</td>
+ <td>Valery Kondakoff</td>
+ </tr><tr>
+ <td>Smári McCarthy</td>
+ <td>Clemens Wyss</td>
+ <td>Simon Steele</td>
+ <td>Serge A. Baranov</td>
+ </tr><tr>
+ <td>Xavier Nodet</td>
+ <td>Willy Devaux</td>
+ <td>David Clain</td>
+ <td>Brendon Yenson</td>
+ </tr><tr>
+ <td><a href="http://www.baanboard.com">Vamsi Potluru</a></td>
+ <td>Praveen Ambekar</td>
+ <td>Alan Knowles</td>
+ <td>Kengo Jinno</td>
+ </tr><tr>
+ <td>Valentin Valchev</td>
+ <td>Marcos E. Wurzius</td>
+ <td>Martin Alderson</td>
+ <td>Robert Gustavsson</td>
+ </tr><tr>
+ <td>José Fonseca</td>
+ <td>Holger Kiemes</td>
+ <td>Francis Irving</td>
+ <td>Scott Kirkwood</td>
+ </tr><tr>
+ <td>Brian Quinlan</td>
+ <td>Ubi</td>
+ <td>Michael R. Duerig</td>
+ <td>Deepak T</td>
+ </tr><tr>
+ <td>Don Paul Beletsky</td>
+ <td>Gerhard Kalab</td>
+ <td>Olivier Dagenais</td>
+ <td>Josh Wingstrom</td>
+ </tr><tr>
+ <td>Bruce Dodson</td>
+ <td>Sergey Koshcheyev</td>
+ <td>Chuan-jian Shen</td>
+ <td>Shane Caraveo</td>
+ </tr><tr>
+ <td>Alexander Scripnik</td>
+ <td>Ryan Christianson</td>
+ <td>Martin Steffensen</td>
+ <td>Jakub Vrána</td>
+ </tr><tr>
+ <td>The Black Horus</td>
+ <td>Bernd Kreuss</td>
+ <td>Thomas Lauer</td>
+ <td>Mike Lansdaal</td>
+ </tr><tr>
+ <td>Yukihiro Nakai</td>
+ <td>Jochen Tucht</td>
+ <td>Greg Smith</td>
+ <td>Steve Schoettler</td>
+ </tr><tr>
+ <td>Mauritius Thinnes</td>
+ <td>Darren Schroeder</td>
+ <td>Pedro Guerreiro</td>
+ <td>Steven te Brinke</td>
+ </tr><tr>
+ <td>Dan Petitt</td>
+ <td>Biswapesh Chattopadhyay</td>
+ <td>Kein-Hong Man</td>
+ <td>Patrizio Bekerle</td>
+ </tr><tr>
+ <td>Nigel Hathaway</td>
+ <td>Hrishikesh Desai</td>
+ <td>Sergey Puljajev</td>
+ <td>Mathias Rauen</td>
+ </tr><tr>
+ <td><a href="http://www.spaceblue.com">Angelo Mandato</a></td>
+ <td>Denis Sureau</td>
+ <td>Kaspar Schiess</td>
+ <td>Christoph Hösler</td>
+ </tr><tr>
+ <td>João Paulo F Farias</td>
+ <td>Ron Schofield</td>
+ <td>Stefan Wosnik</td>
+ <td>Marius Gheorghe</td>
+ </tr><tr>
+ <td>Naba Kumar</td>
+ <td>Sean O'Dell</td>
+ <td>Stefanos Togoulidis</td>
+ <td>Hans Hagen</td>
+ </tr><tr>
+ <td>Jim Cape</td>
+ <td>Roland Walter</td>
+ <td>Brian Mosher</td>
+ <td>Nicholas Nemtsev</td>
+ </tr><tr>
+ <td>Roy Wood</td>
+ <td>Peter-Henry Mander</td>
+ <td>Robert Boucher</td>
+ <td>Christoph Dalitz</td>
+ </tr><tr>
+ <td>April White</td>
+ <td>S. Umar</td>
+ <td>Trent Mick</td>
+ <td>Filip Yaghob</td>
+ </tr><tr>
+ <td>Avi Yegudin</td>
+ <td>Vivi Orunitia</td>
+ <td>Manfred Becker</td>
+ <td>Dimitris Keletsekis</td>
+ </tr><tr>
+ <td>Yuiga</td>
+ <td>Davide Scola</td>
+ <td>Jason Boggs</td>
+ <td>Reinhold Niesner</td>
+ </tr><tr>
+ <td>Jos van der Zande</td>
+ <td>Pescuma</td>
+ <td>Pavol Bosik</td>
+ <td>Johannes Schmid</td>
+ </tr><tr>
+ <td>Blair McGlashan</td>
+ <td>Mikael Hultgren</td>
+ <td>Florian Balmer</td>
+ <td>Hadar Raz</td>
+ </tr><tr>
+ <td>Herr Pfarrer</td>
+ <td>Ben Key</td>
+ <td>Gene Barry</td>
+ <td>Niki Spahiev</td>
+ </tr><tr>
+ <td>Carsten Sperber</td>
+ <td>Phil Reid</td>
+ <td>Iago Rubio</td>
+ <td>Régis Vaquette</td>
+ </tr><tr>
+ <td>Massimo Corà</td>
+ <td>Elias Pschernig</td>
+ <td>Chris Jones</td>
+ <td>Josiah Reynolds</td>
+ </tr><tr>
+ <td>Robert Roessler <a href="http://www.rftp.com">rftp.com</a></td>
+ <td>Steve Donovan</td>
+ <td>Jan Martin Pettersen</td>
+ <td>Sergey Philippov</td>
+ </tr><tr>
+ <td>Borujoa</td>
+ <td>Michael Owens</td>
+ <td>Franck Marcia</td>
+ <td>Massimo Maria Ghisalberti</td>
+ </tr><tr>
+ <td>Frank Wunderlich</td>
+ <td>Josepmaria Roca</td>
+ <td>Tobias Engvall</td>
+ <td>Suzumizaki Kimitaka</td>
+ </tr><tr>
+ <td>Michael Cartmell</td>
+ <td>Pascal Hurni</td>
+ <td>Andre</td>
+ <td>Randy Butler</td>
+ </tr><tr>
+ <td>Georg Ritter</td>
+ <td>Michael Goffioul</td>
+ <td>Ben Harper</td>
+ <td>Adam Strzelecki</td>
+ </tr><tr>
+ <td>Kamen Stanev</td>
+ <td>Steve Menard</td>
+ <td>Oliver Yeoh</td>
+ <td>Eric Promislow</td>
+ </tr><tr>
+ <td>Joseph Galbraith</td>
+ <td>Jeffrey Ren</td>
+ <td>Armel Asselin</td>
+ <td>Jim Pattee</td>
+ </tr><tr>
+ <td>Friedrich Vedder</td>
+ <td>Sebastian Pipping</td>
+ <td>Andre Arpin</td>
+ <td>Stanislav Maslovski</td>
+ </tr><tr>
+ <td>Martin Stone</td>
+ <td>Fabien Proriol</td>
+ <td>mimir</td>
+ <td>Nicola Civran</td>
+ </tr><tr>
+ <td>Snow</td>
+ <td>Mitchell Foral</td>
+ <td>Pieter Holtzhausen</td>
+ <td>Waldemar Augustyn</td>
+ </tr><tr>
+ <td>Jason Haslam</td>
+ <td>Sebastian Steinlechner</td>
+ <td>Chris Rickard</td>
+ <td>Rob McMullen</td>
+ </tr><tr>
+ <td>Stefan Schwendeler</td>
+ <td>Cristian Adam</td>
+ <td>Nicolas Chachereau</td>
+ <td>Istvan Szollosi</td>
+ </tr><tr>
+ <td>Xie Renhui</td>
+ <td>Enrico Tröger</td>
+ <td>Todd Whiteman</td>
+ <td>Yuval Papish</td>
+ </tr><tr>
+ <td>instanton</td>
+ <td>Sergio Lucato</td>
+ <td>VladVRO</td>
+ <td>Dmitry Maslov</td>
+ </tr><tr>
+ <td>chupakabra</td>
+ <td>Juan Carlos Arevalo Baeza</td>
+ <td>Nick Treleaven</td>
+ <td>Stephen Stagg</td>
+ </tr><tr>
+ <td>Jean-Paul Iribarren</td>
+ <td>Tim Gerundt</td>
+ <td>Sam Harwell</td>
+ <td>Boris</td>
+ </tr><tr>
+ <td>Jason Oster</td>
+ <td>Gertjan Kloosterman</td>
+ <td>alexbodn</td>
+ <td>Sergiu Dotenco</td>
+ </tr><tr>
+ <td>Anders Karlsson</td>
+ <td>ozlooper</td>
+ <td>Marko Njezic</td>
+ <td>Eugen Bitter</td>
+ </tr><tr>
+ <td>Christoph Baumann</td>
+ <td>Christopher Bean</td>
+ <td>Sergey Kishchenko</td>
+ <td>Kai Liu</td>
+ </tr><tr>
+ <td>Andreas Rumpf</td>
+ <td>James Moffatt</td>
+ <td>Yuzhou Xin</td>
+ <td>Nic Jansma</td>
+ </tr><tr>
+ <td>Evan Jones</td>
+ <td>Mike Lischke</td>
+ <td>Eric Kidd</td>
+ <td>maXmo</td>
+ </tr><tr>
+ <td>David Severwright</td>
+ <td>Jon Strait</td>
+ <td>Oliver Kiddle</td>
+ <td>Etienne Girondel</td>
+ </tr><tr>
+ <td>Haimag Ren</td>
+ <td>Andrey Moskalyov</td>
+ <td>Xavi</td>
+ <td>Toby Inkster</td>
+ </tr><tr>
+ <td>Eric Forgeot</td>
+ <td>Colomban Wendling</td>
+ <td>Neo</td>
+ <td>Jordan Russell</td>
+ </tr><tr>
+ <td>Farshid Lashkari</td>
+ <td>Sam Rawlins</td>
+ <td>Michael Mullin</td>
+ <td>Carlos SS</td>
+ </tr><tr>
+ <td>vim</td>
+ <td>Martial Demolins</td>
+ <td>Tino Weinkauf</td>
+ <td>Jérôme Laforge</td>
+ </tr><tr>
+ <td>Udo Lechner</td>
+ <td>Marco Falda</td>
+ <td>Dariusz Knociński</td>
+ <td>Ben Fisher</td>
+ </tr><tr>
+ <td>Don Gobin</td>
+ <td>John Yeung</td>
+ <td>Adobe</td>
+ <td>Elizabeth A. Irizarry</td>
+ </tr><tr>
+ <td>Mike Schroeder</td>
+ <td>Morten MacFly</td>
+ <td>Jaime Gimeno</td>
+ <td>Thomas Linder Puls</td>
+ </tr><tr>
+ <td>Artyom Zuikov</td>
+ <td>Gerrit</td>
+ <td>Occam's Razor</td>
+ <td>Ben Bluemel</td>
+ </tr><tr>
+ <td>David Wolfendale</td>
+ <td>Chris Angelico</td>
+ <td>Marat Dukhan</td>
+ <td>Stefan Weil</td>
+ </tr><tr>
+ <td>Rex Conn</td>
+ <td>Ross McKay</td>
+ <td>Bruno Barbieri</td>
+ <td>Gordon Smith</td>
+ </tr><tr>
+ <td>dimitar</td>
+ <td>Sébastien Granjoux</td>
+ <td>zeniko</td>
+ <td>James Ribe</td>
+ </tr><tr>
+ <td>Markus Nißl</td>
+ <td>Martin Panter</td>
+ <td>Mark Yen</td>
+ <td>Philippe Elsass</td>
+ </tr><tr>
+ <td>Dimitar Zhekov</td>
+ <td>Fan Yang</td>
+ <td>Denis Shelomovskij</td>
+ <td>darmar</td>
+ </tr><tr>
+ <td>John Vella</td>
+ <td>Chinh Nguyen</td>
+ <td>Sakshi Verma</td>
+ <td>Joel B. Mohler</td>
+ </tr><tr>
+ <td>Isiledhel</td>
+ <td>Vidya Wasi</td>
+ <td>G. Hu</td>
+ <td>Byron Hawkins</td>
+ </tr><tr>
+ <td>Alpha</td>
+ <td>John Donoghue</td>
+ <td>kudah</td>
+ <td>Igor Shaula</td>
+ </tr><tr>
+ <td>Pavel Bulochkin</td>
+ <td>Yosef Or Boczko</td>
+ <td>Brian Griffin</td>
+ <td>Özgür Emir</td>
+ </tr><tr>
+ <td>Neomi</td>
+ <td>OmegaPhil</td>
+ <td>SiegeLord</td>
+ <td>Erik</td>
+ </tr><tr>
+ <td>TJF</td>
+ <td>Mark Robinson</td>
+ <td>Thomas Martitz</td>
+ <td>felix</td>
+ </tr><tr>
+ <td>Christian Walther</td>
+ <td>Ebben</td>
+ <td>Robert Gieseke</td>
+ <td>Mike M</td>
+ </tr><tr>
+ <td>nkmathew</td>
+ <td>Andreas Tscharner</td>
+ <td>Lee Wilmott</td>
+ <td>johnsonj</td>
+ </tr><tr>
+ <td>Vicente</td>
+ <td>Nick Gravgaard</td>
+ <td>Ian Goldby</td>
+ <td>Holger Stenger</td>
+ </tr><tr>
+ <td>danselmi</td>
+ <td>Mat Berchtold</td>
+ <td>Michael Staszewski</td>
+ <td>Baurzhan Muftakhidinov</td>
+ </tr><tr>
+ <td>Erik Angelin</td>
+ <td>Yusuf Ramazan Karagöz</td>
+ <td>Markus Heidelberg</td>
+ <td>Joe Mueller</td>
+ </tr><tr>
+ <td>Mika Attila</td>
+ <td>JoMazM</td>
+ <td>Markus Moser</td>
+ <td>Stefan Küng</td>
+ </tr><tr>
+ <td>Jiří Techet</td>
+ </tr>
+ </table>
+ <p>
+ Images used in GTK+ version
+ </p>
+ <ul>
+ <li>
+ <a href="http://sourceforge.net/projects/icon-collection/">
+ Icons</a> Copyright(C) 1998 by Dean S. Jones<br />
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite356.zip?download">Release 3.5.6</a>
+ </h3>
+ <ul>
+ <li>
+ Released 26 May 2015.
+ </li>
+ <li>
+ On Qt, use fractional positioning calls and avoid rounding to ensure consistency.
+ </li>
+ <li>
+ SCI_TARGETASUTF8 and SCI_ENCODEDFROMUTF8 implemented on
+ Win32 as well as GTK+ and Cocoa.
+ </li>
+ <li>
+ C++ lexer fixes empty backquoted string.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1711/">Bug #1711</a>.
+ </li>
+ <li>
+ C++ lexer fixes #undef directive.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1719/">Bug #1719</a>.
+ </li>
+ <li>
+ Fortran folder fixes handling of "selecttype" and "selectcase".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1724/">Bug #1724</a>.
+ </li>
+ <li>
+ Verilog folder folds interface definitions.
+ </li>
+ <li>
+ VHDL folder folds units declarations and fixes a case insensitivity bug with not treating "IS" the same as "is".
+ </li>
+ <li>
+ Fix bug when drawing text margins in buffered mode which would use default
+ encoding instead of chosen encoding.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1703/">Bug #1703</a>.
+ </li>
+ <li>
+ Fix bug with Korean Hanja conversions in DBCS encoding on Windows.
+ </li>
+ <li>
+ Fix for reading a UTF-16 file in SciTE where a non-BMP character is split over a read buffer boundary.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1710/">Bug #1710</a>.
+ </li>
+ <li>
+ Fix bug on GTK+ 2.x for Windows where there was an ABI difference between
+ compiler version.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1726/">Bug #1726</a>.
+ </li>
+ <li>
+ Fix undo bug on Cocoa that could lose data..
+ </li>
+ <li>
+ Fix link error on Windows when SCI_NAMESPACE used.
+ </li>
+ <li>
+ Fix exporting from SciTE when using Scintillua for lexing.
+ </li>
+ <li>
+ SciTE does not report twice that a search string can not be found when "Replace" pressed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1716/">Bug #1716</a>.
+ </li>
+ <li>
+ SciTE on GTK+ 3.x disables arrow in search combo when no entries.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1717/">Bug #1717</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite355.zip?download">Release 3.5.5</a>
+ </h3>
+ <ul>
+ <li>
+ Released 17 April 2015.
+ </li>
+ <li>
+ Scintilla on Windows is now always a wide character window so SCI_SETKEYSUNICODE has no effect
+ and SCI_GETKEYSUNICODE always returns true. These APIs are deprecated and should not be called.
+ </li>
+ <li>
+ The wxWidgets-specific ascent member of Font has been removed which breaks
+ compatibility with current wxStyledTextCtrl.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1682/">Bug #1682</a>.
+ </li>
+ <li>
+ IME on Qt supports multiple carets and behaves more like other platforms.
+ </li>
+ <li>
+ Always use inline IME on GTK+ for Korean.
+ </li>
+ <li>
+ SQL lexer fixes handling of '+' and '-' in numbers so the '-' in '1-1' is seen as an operator and for
+ '1--comment' the comment is recognized.
+ </li>
+ <li>
+ TCL lexer reverts change to string handling.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1642/">Bug #1642</a>.
+ </li>
+ <li>
+ Verilog lexer fixes bugs with macro styling.
+ Verilog folder fixes bugs with `end completing an `if* instead of `endif and fold.at.else, and implements
+ folding at preprocessor `else.
+ </li>
+ <li>
+ VHDL lexer supports extended identifiers.
+ </li>
+ <li>
+ Fix bug on Cocoa where the calltip would display incorrectly when
+ switching calltips and the new calltip required a taller window.
+ </li>
+ <li>
+ Fix leak on Cocoa with autocompletion lists.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1706/">Bug #1706</a>.
+ </li>
+ <li>
+ Fix potential crash on Cocoa with drag and drop.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1709/">Bug #1709</a>.
+ </li>
+ <li>
+ Fix bug on Windows when compiling with MinGW-w64 which caused text to not be drawn
+ when in wrap mode.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1705/">Bug #1705</a>.
+ </li>
+ <li>
+ Fix SciTE bug with missing file open filters and add hex to excluded set of properties files so that its
+ settings don't appear.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1707/">Bug #1707</a>.
+ </li>
+ <li>
+ Fix SciTE bug where files without extensions like "makefile" were not highlighted correctly.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite354.zip?download">Release 3.5.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 8 March 2015.
+ </li>
+ <li>
+ Indicators may have a different colour and style when the mouse is over them or the caret is moved into them.
+ </li>
+ <li>
+ An indicator may display in a large variety of colours with the SC_INDICFLAG_VALUEFORE
+ flag taking the colour from the indicator's value, which may differ for every character, instead of its
+ foreground colour attribute.
+ </li>
+ <li>
+ On Cocoa, additional IME methods implemented so that more commands are enabled.
+ For Japanese: Reverse Conversion, Convert to Related Character, and Search Similar Kanji
+ can now be performed.
+ The global definition hotkey Command+Control+D and the equivalent three finger tap gesture
+ can be used.
+ </li>
+ <li>
+ Minimum version of Qt supported is now 4.8 due to the use of QElapsedTimer::nsecsElapsed.
+ </li>
+ <li>
+ On Windows, for Korean, the VK_HANJA key is implemented to choose Hanja for Hangul and
+ to convert from Hanja to Hangul.
+ </li>
+ <li>
+ C++ lexer adds lexer.cpp.verbatim.strings.allow.escapes option that allows verbatim (@") strings
+ to contain escape sequences. This should remain off (0) for C# and be turned on (1) for Objective C.
+ </li>
+ <li>
+ Rust lexer accepts new 'is'/'us' integer suffixes instead of 'i'/'u'.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1098/">Bug #1098</a>.
+ </li>
+ <li>
+ Ruby folder can fold multiline comments.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1697/">Bug #1697</a>.
+ </li>
+ <li>
+ SQL lexer fixes a bug with the q-quote operator.
+ </li>
+ <li>
+ TCL lexer fixes a bug with some strings.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1642/">Bug #1642</a>.
+ </li>
+ <li>
+ Verilog lexer handles escaped identifiers that begin with \ and end with space like \reset* .
+ Verilog folder fixes one bug with inconsistent folding when fold.comment is on and another
+ with typedef class statements creating a fold point, expecting an endclass statement.
+ </li>
+ <li>
+ VHDL folder fixes hang in folding when document starts with "entity".
+ </li>
+ <li>
+ Add new indicators INDIC_COMPOSITIONTHIN, INDIC_FULLBOX, and INDIC_TEXTFORE.
+ INDIC_COMPOSITIONTHIN is a thin underline that mimics the appearance of non-target segments in OS X IME.
+ INDIC_FULLBOX is similar to INDIC_STRAIGHTBOX but covers the entire character area which means that
+ indicators with this style on contiguous lines may touch. INDIC_TEXTFORE changes the text foreground colour.
+ </li>
+ <li>
+ Fix adaptive scrolling speed for GTK+ on OS X with GTK Quartz backend (as opposed to X11 backend).
+ <a href="http://sourceforge.net/p/scintilla/bugs/1696/">Bug #1696</a>.
+ </li>
+ <li>
+ Fix position of autocompletion and calltips on Cocoa when there were two screens stacked vertically.
+ </li>
+ <li>
+ Fix crash in SciTE when saving large files in background when closing application.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1691/">Bug #1691</a>.
+ </li>
+ <li>
+ Fix decoding of MSVC warnings in SciTE so that files in the C:\Program Files (x86)\ directory can be opened.
+ This is a common location of system include files.
+ </li>
+ <li>
+ Fix compilation failure of C++11 &lt;regex&gt; on Windows using gcc.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite353.zip?download">Release 3.5.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 20 January 2015.
+ </li>
+ <li>
+ Support removed for Windows 95, 98, and ME.
+ </li>
+ <li>
+ Lexers added for Motorola S-Record files, Intel hex files, and Tektronix extended hex files with folding for Intel hex files.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1091/">Feature #1091.</a>
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1093/">Feature #1093.</a>
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1095/">Feature #1095.</a>
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1096/">Feature #1096.</a>
+ </li>
+ <li>
+ C++ folder allows folding on square brackets '['.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1087/">Feature #1087.</a>
+ </li>
+ <li>
+ Shell lexer fixes three issues with here-documents.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1672/">Bug #1672</a>.
+ </li>
+ <li>
+ Verilog lexer highlights doc comment keywords; has separate styles for input, output, and inout ports
+ (lexer.verilog.portstyling); fixes a bug in highlighting numbers; can treat upper-case identifiers as
+ keywords (lexer.verilog.allupperkeywords); and can use different styles for code that is inactive due
+ to preprocessor commands (lexer.verilog.track.preprocessor, lexer.verilog.update.preprocessor).
+ </li>
+ <li>
+ When the calltip window is taller than the Scintilla window, leave it in a
+ position that avoids overlapping the Scintilla text.
+ </li>
+ <li>
+ When a text margin is displayed, for annotation lines, use the background colour of the base line.
+ </li>
+ <li>
+ On Windows GDI, assume font names are encoded in UTF-8. This matches the Direct2D code path.
+ </li>
+ <li>
+ Fix paste for GTK+ on OS X.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1677/">Bug #1677</a>.
+ </li>
+ <li>
+ Reverted a fix on Qt where Qt 5.3 has returned to the behaviour of 4.x.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1575/">Bug #1575</a>.
+ </li>
+ <li>
+ When the mouse is on the line between margin and text changed to treat as within text.
+ This makes the PLAT_CURSES character cell platform work better.
+ </li>
+ <li>
+ Fix a crash in SciTE when the command line is just "-close:".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1675/">Bug #1675</a>.
+ </li>
+ <li>
+ Fix unexpected dialog in SciTE on Windows when the command line has a quoted filename then ends with a space.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1673/">Bug #1673</a>.
+ </li>
+ <li>
+ On Windows and GTK+, use indicators for inline IME.
+ </li>
+ <li>
+ SciTE shuts down quicker when there is no user-written OnClose function and no directors are attached.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite352.zip?download">Release 3.5.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released 2 December 2014.
+ </li>
+ <li>
+ For OS X Cocoa switch C++ runtime to libc++ to enable use of features that will never
+ be added to libstdc++ including those part of C++11.
+ Scintilla will now run only on OS X 10.7 or later and only in 64-bit mode.
+ </li>
+ <li>
+ Include support for using C++11 &lt;regex&gt; for regular expression searches.
+ Enabling this requires rebuilding Scintilla with a non-default option.
+ This is a provisional feature and may change API before being made permanent.
+ </li>
+ <li>
+ Allocate indicators used for Input Method Editors after 31 which was the previous limit of indicators to
+ ensure no clash between the use of indicators for IME and for the application.
+ </li>
+ <li>
+ ANNOTATION_INDENTED added which is similar to ANNOTATION_BOXED in terms of positioning
+ but does not show a border.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1086/">Feature #1086.</a>
+ </li>
+ <li>
+ Allow platform overrides for drawing tab arrows, wrap markers, and line markers.
+ Size of double click detection area is a variable.
+ These enable better visuals and behaviour for PLAT_CURSES as it is character cell based.
+ </li>
+ <li>
+ CoffeeScript lexer fixes "/*" to not be a comment.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1420/">Bug #1420</a>.
+ </li>
+ <li>
+ VHDL folder fixes "block" keyword.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1664/">Bug #1664</a>.
+ </li>
+ <li>
+ Prevent caret blinking when holding down Delete key.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1657/">Bug #1657</a>.
+ </li>
+ <li>
+ On Windows, allow right click selection in popup menu.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1080/">Feature #1080.</a>
+ </li>
+ <li>
+ On Windows, only call ShowCaret in GDI mode as it interferes with caret drawing when using Direct2D.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1643/">Bug #1643</a>.
+ </li>
+ <li>
+ On Windows, another DirectWrite mode SC_TECHNOLOGY_DIRECTWRITEDC added
+ which may avoid drawing failures in some circumstances by drawing into a GDI DC.
+ This feature is provisional and may be changed or removed if a better solution is found.
+ </li>
+ <li>
+ On Windows, avoid processing mouse move events where the mouse has not moved as these can
+ cause unexpected dwell start notifications.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1670/">Bug #1670</a>.
+ </li>
+ <li>
+ For GTK+ on Windows, avoid extra space when pasting from external application.
+ </li>
+ <li>
+ On GTK+ 2.x allow Scintilla to be used inside tool tips by changing when preedit window created.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1662/">Bug #1662</a>.
+ </li>
+ <li>
+ Support MinGW compilation under Linux.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1077/">Feature #1077.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite351.zip?download">Release 3.5.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 30 September 2014.
+ </li>
+ <li>
+ BibTeX lexer added.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1071/">Feature #1071.</a>
+ </li>
+ <li>
+ SQL lexer supports the q-quote operator as SCE_SQL_QOPERATOR(24).
+ </li>
+ <li>
+ VHDL lexer supports block comments.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1527/">Bug #1527</a>.
+ </li>
+ <li>
+ VHDL folder fixes case where "component" used before name.
+ <a href="http://sourceforge.net/p/scintilla/bugs/613/">Bug #613</a>.
+ </li>
+ <li>
+ Restore fractional pixel tab positioning which was truncated to whole pixels in 3.5.0.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1652/">Bug #1652</a>.
+ </li>
+ <li>
+ Allow choice between windowed and inline IME on some platforms.
+ </li>
+ <li>
+ On GTK+ cache autocomplete window to avoid platform bug where windows
+ were sometimes lost.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1649/">Bug #1649</a>.
+ </li>
+ <li>
+ On GTK+ size autocomplete window more accurately.
+ </li>
+ <li>
+ On Windows only unregister windows classes registered.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1639/">Bug #1639</a>.
+ </li>
+ <li>
+ On Windows another DirectWrite mode SC_TECHNOLOGY_DIRECTWRITERETAIN added
+ which may avoid drawing failures on some cards and drivers.
+ This feature is provisional and may be changed or removed if a better solution is found.
+ </li>
+ <li>
+ On Windows support the Visual Studio 2010+ clipboard format that indicates a line copy.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1636/">Bug #1636</a>.
+ </li>
+ <li>
+ SciTE session files remember the scroll position.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite350.zip?download">Release 3.5.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 13 August 2014.
+ </li>
+ <li>
+ Text may share space vertically so that extreme ascenders and descenders are
+ not cut off by calling SCI_SETPHASESDRAW(SC_PHASES_MULTIPLE).
+ </li>
+ <li>
+ Separate timers are used for each type of periodic activity and they are turned on and off
+ as required. This saves power as there are fewer wake ups.
+ On recent releases of OS X Cocoa and Windows, coalescing timers are used to further
+ save power.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1086/">Bug #1086</a>.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1532/">Bug #1532</a>.
+ </li>
+ <li>
+ Explicit tab stops may be set for each line.
+ </li>
+ <li>
+ On Windows and GTK+, when using Korean input methods, IME composition is moved from a
+ separate window into the Scintilla window.
+ </li>
+ <li>
+ SciTE adds a "Clean" command to the "Tools" menu which is meant to be bound to a command like
+ "make clean".
+ </li>
+ <li>
+ Lexer added for Windows registry files.
+ </li>
+ <li>
+ HTML lexer fixes a crash with SGML after a Mako comment.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1622/">Bug #1622</a>.
+ </li>
+ <li>
+ KiXtart lexer adds a block comment state.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1053/">Feature #1053.</a>
+ </li>
+ <li>
+ Matlab lexer fixes transpose operations like "X{1}'".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1629/">Bug #1629</a>.
+ </li>
+ <li>
+ Ruby lexer fixes bugs with the syntax of symbols including allowing a symbol to end with '?'.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1627/">Bug #1627</a>.
+ </li>
+ <li>
+ Rust lexer supports byte string literals, naked CR can be escaped in strings, and files starting with
+ "#![" are not treated as starting with a hashbang comment.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1063/">Feature #1063.</a>
+ </li>
+ <li>
+ Bug fixed where style data was stale when deleting a rectangular selection.
+ </li>
+ <li>
+ Bug fixed where annotations disappeared when SCI_CLEARDOCUMENTSTYLE called.
+ </li>
+ <li>
+ Bug fixed where selection not redrawn after SCI_DELWORDRIGHT.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1633/">Bug #1633</a>.
+ </li>
+ <li>
+ Change the function prototypes to be complete for functions exported as "C".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1618/">Bug #1618</a>.
+ </li>
+ <li>
+ Fix a memory leak on GTK+ with autocompletion lists.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1638/">Bug #1638</a>.
+ </li>
+ <li>
+ On GTK+, use the full character width for the overstrike caret for multibyte characters.
+ </li>
+ <li>
+ On Qt, set list icon size to largest icon. Add padding on OS X.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1634/">Bug #1634</a>.
+ </li>
+ <li>
+ On Qt, fix building on FreeBSD 9.2.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1635/">Bug #1635</a>.
+ </li>
+ <li>
+ On Qt, add a get_character method on the document.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1064/">Feature #1064.</a>
+ </li>
+ <li>
+ On Qt, add SCI_* for methods to ScintillaConstants.py.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1065/">Feature #1065.</a>
+ </li>
+ <li>
+ SciTE on GTK+ crash fixed with Insert Abbreviation command.
+ </li>
+ <li>
+ For SciTE with read-only files and are.you.sure=0 reenable choice to save to another
+ location when using Save or Close commands.
+ </li>
+ <li>
+ Fix SciTE bug where toggle bookmark did not work after multiple lines with bookmarks merged.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1617/">Bug #1617</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite344.zip?download">Release 3.4.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 3 July 2014.
+ </li>
+ <li>
+ Style byte indicators removed. They were deprecated in 2007. Standard indicators should be used instead.
+ Some elements used by lexers no longer take number of bits or mask arguments so lexers may need to be
+ updated for LexAccessor::StartAt, LexAccessor::SetFlags (removed), LexerModule::LexerModule.
+ </li>
+ <li>
+ When multiple selections are active, autocompletion text may be inserted at each selection with new
+ SCI_AUTOCSETMULTI method.
+ </li>
+ <li>
+ C++ lexer fixes crash for "#define x(".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1614/">Bug #1614</a>.
+ </li>
+ <li>
+ C++ lexer fixes raw string recognition so that R"xxx(blah)xxx" is styled as SCE_C_STRINGRAW.
+ </li>
+ <li>
+ The Postscript lexer no longer marks token edges with indicators as this used style byte indicators.
+ </li>
+ <li>
+ The Scriptol lexer no longer displays indicators for poor indentation as this used style byte indicators.
+ </li>
+ <li>
+ TCL lexer fixes names of keyword sets.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1615/">Bug #1615</a>.
+ </li>
+ <li>
+ Shell lexer fixes fold matching problem caused by "&lt;&lt;&lt;".
+ <a href="http://sourceforge.net/p/scintilla/bugs/1605/">Bug #1605</a>.
+ </li>
+ <li>
+ Fix bug where indicators were not removed when fold highlighting on.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1604/">Bug #1604</a>.
+ </li>
+ <li>
+ Fix bug on Cocoa where emoji were treated as being zero width.
+ </li>
+ <li>
+ Fix crash on GTK+ with Ubuntu 12.04 and overlay scroll bars.
+ </li>
+ <li>
+ Avoid creating a Cairo context when measuring text on GTK+ as future versions of GTK+
+ may prohibit calling gdk_cairo_create except inside drawing handlers. This prohibition may
+ be required on Wayland.
+ </li>
+ <li>
+ On Cocoa, the registerNotifyCallback method is now marked as deprecated so client code that
+ uses it will display an error message.
+ Client code should use the delegate mechanism or subclassing instead.
+ The method will be removed in the next version.
+ </li>
+ <li>
+ On Cocoa, package Scintilla more in compliance with platform conventions.
+ Only publish public headers in the framework headers directory.
+ Only define the Scintilla namespace in Scintilla.h when compiling as C++.
+ Use the Cocoa NS_ENUM and NS_OPTIONS macros for exposed enumerations.
+ Hide internal methods from public headers.
+ These changes are aimed towards publishing Scintilla as a module which will allow it to
+ be used from the Swift programming language, although more changes will be needed here.
+ </li>
+ <li>
+ Fix crash in SciTE when stream comment performed at line end.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1610/">Bug #1610</a>.
+ </li>
+ <li>
+ For SciTE on Windows, display error message when common dialogs fail.
+ <a href="http://sourceforge.net/p/scintilla/bugs/156/">Bug #156</a>.
+ </li>
+ <li>
+ For SciTE on GTK+ fix bug with initialisation of toggle buttons in find and replace strips.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1612/">Bug #1612</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite343.zip?download">Release 3.4.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 27 May 2014.
+ </li>
+ <li>
+ Fix hangs and crashes in DLL at shutdown on Windows when using Direct2D.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite342.zip?download">Release 3.4.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released 22 May 2014.
+ </li>
+ <li>
+ Insertions can be filtered or modified by calling SCI_CHANGEINSERTION inside a handler for
+ SC_MOD_INSERTCHECK.
+ </li>
+ <li>
+ DMIS lexer added. DMIS is a language for coordinate measuring machines.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1049/">Feature #1049.</a>
+ </li>
+ <li>
+ Line state may be displayed in the line number margin to aid in debugging lexing and folding with
+ SC_FOLDFLAG_LINESTATE (128).
+ </li>
+ <li>
+ C++ lexer understands more preprocessor statements. #if defined SYMBOL is understood.
+ Some macros with arguments can be understood and these may be predefined in keyword set 4
+ (keywords5 for SciTE)
+ with syntax similar to CHECKVERSION(x)=(x&lt;3).
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1051/">Feature #1051.</a>
+ </li>
+ <li>
+ C++ lexer can highlight task marker keywords in comments as SCE_C_TASKMARKER.
+ </li>
+ <li>
+ C++ lexer can optionally highlight escape sequences in strings as SCE_C_ESCAPESEQUENCE.
+ </li>
+ <li>
+ C++ lexer supports Go back quoted raw string literals with lexer.cpp.backquoted.strings option.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1047/">Feature #1047.</a>
+ </li>
+ <li>
+ SciTE performs word and search match highlighting as an idle task to improve interactivity
+ and allow use of these features on large files.
+ </li>
+ <li>
+ Bug fixed on Cocoa where previous caret lines were visible.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1593/">Bug #1593</a>.
+ </li>
+ <li>
+ Bug fixed where caret remained invisible when period set to 0.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1592/">Bug #1592</a>.
+ </li>
+ <li>
+ Fixed display flashing when scrolling with GTK+ 3.10.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1567/">Bug #1567</a>.
+ </li>
+ <li>
+ Fixed calls and constants deprecated in GTK+ 3.10.
+ </li>
+ <li>
+ Fixed bug on Windows where WM_GETTEXT did not provide data in UTF-16 for Unicode window.
+ <a href="http://sourceforge.net/p/scintilla/bugs/685/">Bug #685</a>.
+ </li>
+ <li>
+ For SciTE, protect access to variables used by threads with a mutex to prevent data races.
+ </li>
+ <li>
+ For SciTE on GTK+ fix thread object leaks.
+ Display the version of GTK+ compiled against in the about box.
+ </li>
+ <li>
+ For SciTE on GTK+ 3.10, fix the size of the tab bar's content and use
+ freedesktop.org standard icon names where possible.
+ </li>
+ <li>
+ For SciTE on Windows, fix bug where invoking help resubmitted the
+ running program.
+ <a href="http://sourceforge.net/p/scintilla/bugs/272/">Bug #272</a>.
+ </li>
+ <li>
+ SciTE's highlight current word feature no longer matches the selection when it contains space.
+ </li>
+ <li>
+ For building SciTE in Visual C++, the win\SciTE.vcxproj project file should be used.
+ The boundscheck directory and its project and solution files have been removed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite341.zip?download">Release 3.4.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 April 2014.
+ </li>
+ <li>
+ Display Unicode line ends as [LS], [PS], and [NEL] blobs.
+ </li>
+ <li>
+ Bug fixed where cursor down failed on wrapped lines.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1585/">Bug #1585</a>.
+ </li>
+ <li>
+ Caret positioning changed a little to appear inside characters less often by
+ rounding the caret position to the pixel grid instead of truncating.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1588/">Bug #1588</a>.
+ </li>
+ <li>
+ Bug fixed where automatic indentation wrong when caret in virtual space.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1586/">Bug #1586</a>.
+ </li>
+ <li>
+ Bug fixed on Windows where WM_LBUTTONDBLCLK was no longer sent to window.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1587/">Bug #1587</a>.
+ </li>
+ <li>
+ Bug fixed with SciTE on Windows XP where black stripes appeared inside the find and
+ replace strips.
+ </li>
+ <li>
+ Crash fixed in SciTE with recursive properties files.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1507/">Bug #1507</a>.
+ </li>
+ <li>
+ Bug fixed with SciTE where Ctrl+E before an unmatched end brace jumps to file start.
+ <a href="http://sourceforge.net/p/scintilla/bugs/315/">Bug #315</a>.
+ </li>
+ <li>
+ Fixed scrolling on Cocoa to avoid display glitches and be smoother.
+ </li>
+ <li>
+ Fixed crash on Cocoa when character composition used when autocompletion list active.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite340.zip?download">Release 3.4.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 22 March 2014.
+ </li>
+ <li>
+ The Unicode line ends and substyles features added as provisional in 3.2.5 are now finalised.
+ There are now no provisional features.
+ </li>
+ <li>
+ Added wrap mode SC_WRAP_WHITESPACE which only wraps on whitespace, not on style changes.
+ </li>
+ <li>
+ SciTE find and replace strips can perform incremental searching and temporary highlighting of all
+ matches with the find.strip.incremental, replace.strip.incremental, and find.indicator.incremental settings.
+ </li>
+ <li>
+ SciTE default settings changed to use strips for find and replace and to draw with Direct2D and
+ DirectWrite on Windows.
+ </li>
+ <li>
+ SciTE on Windows scales image buttons on the find and replace strips to match the current system scale factor.
+ </li>
+ <li>
+ Additional assembler lexer variant As(SCLEX_AS) for Unix assembly code which uses '#' for comments and
+ ';' to separate statements.
+ </li>
+ <li>
+ Fix Coffeescript lexer for keyword style extending past end of word.
+ Also fixes styling 0...myArray.length all as a number.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1583/">Bug #1583</a>.
+ </li>
+ <li>
+ Fix crashes and other bugs in Fortran folder by removing folding of do-label constructs.
+ </li>
+ <li>
+ Deleting a whole line deletes the annotations on that line instead of the annotations on the next line.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1577/">Bug #1577</a>.
+ </li>
+ <li>
+ Changed position of tall calltips to prefer lower half of screen to cut off end instead of start.
+ </li>
+ <li>
+ Fix Qt bug where double click treated as triple click.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1575/">Bug #1575</a>.
+ </li>
+ <li>
+ On Qt, selecting an item in an autocompletion list that is not currently visible positions it at the top.
+ </li>
+ <li>
+ Fix bug on Windows when resizing autocompletion list with only short strings caused the list to move.
+ </li>
+ <li>
+ On Cocoa reduce scrollable height by one line to fix bugs with moving caret
+ up or down.
+ </li>
+ <li>
+ On Cocoa fix calltips which did not appear when they were created in an off-screen position.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite339.zip?download">Release 3.3.9</a>
+ </h3>
+ <ul>
+ <li>
+ Released 31 January 2014.
+ </li>
+ <li>
+ Fix 3.3.8 bug where external lexers became inaccessible.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1574/">Bug #1574</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite338.zip?download">Release 3.3.8</a>
+ </h3>
+ <ul>
+ <li>
+ Released 28 January 2014.
+ </li>
+ <li>
+ DropSelectionN API added to drop a selection from a multiple selection.
+ </li>
+ <li>
+ CallTipSetPosStart API added to change the position at which backspacing removes the calltip.
+ </li>
+ <li>
+ SC_MARK_BOOKMARK marker symbol added which looks like bookmark ribbons used in
+ book reading applications.
+ </li>
+ <li>
+ Basic lexer highlights hex, octal, and binary numbers in FreeBASIC which use the prefixes
+ &amp;h, &amp;o and &amp;b respectively.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1041/">Feature #1041.</a>
+ </li>
+ <li>
+ C++ lexer fixes bug where keyword followed immediately by quoted string continued
+ keyword style.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1564/">Bug #1564</a>.
+ </li>
+ <li>
+ Matlab lexer treats '!' differently for Matlab and Octave languages.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1571/">Bug #1571</a>.
+ </li>
+ <li>
+ Rust lexer improved with nested comments, more compliant doc-comment detection,
+ octal literals, NUL characters treated as valid, and highlighting of raw string literals and float literals fixed.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1038/">Feature #1038.</a>
+ <a href="http://sourceforge.net/p/scintilla/bugs/1570/">Bug #1570</a>.
+ </li>
+ <li>
+ On Qt expose the EOLMode on the document object.
+ </li>
+ <li>
+ Fix hotspot clicking where area was off by half a character width.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1562/">Bug #1562</a>.
+ </li>
+ <li>
+ Tweaked scroll positioning by either 2 pixels or 1 pixel when caret is at left or right of view
+ to ensure caret is inside visible area.
+ </li>
+ <li>
+ Send SCN_UPDATEUI with SC_UPDATE_SELECTION for Shift+Tab inside text.
+ </li>
+ <li>
+ On Windows update the system caret position when scrolling to help screen readers
+ see the scroll quickly.
+ </li>
+ <li>
+ On Cocoa, GTK+, and Windows/Direct2D draw circles more accurately so that
+ circular folding margin markers appear circular, of consistent size, and centred.
+ Make SC_MARK_ARROWS drawing more even.
+ Fix corners of SC_MARK_ROUNDRECT with Direct2D to be similar to other platforms.
+ </li>
+ <li>
+ SciTE uses a bookmark ribbon symbol for bookmarks as it scales better to higher resolutions
+ than the previous blue gem bitmap.
+ </li>
+ <li>
+ SciTE will change the width of margins while running when the margin.width and fold.margin.width
+ properties are changed.
+ </li>
+ <li>
+ SciTE on Windows can display a larger tool bar with the toolbar.large property.
+ </li>
+ <li>
+ SciTE displays a warning message when asked to open a directory.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1568/">Bug #1568</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite337.zip?download">Release 3.3.7</a>
+ </h3>
+ <ul>
+ <li>
+ Released 12 December 2013.
+ </li>
+ <li>
+ Lexer added for DMAP language.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1026/">Feature #1026.</a>
+ </li>
+ <li>
+ Basic lexer supports multiline comments in FreeBASIC.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1023/">Feature #1023.</a>
+ </li>
+ <li>
+ Bash lexer allows '#' inside words..
+ <a href="http://sourceforge.net/p/scintilla/bugs/1553/">Bug #1553</a>.
+ </li>
+ <li>
+ C++ lexer recognizes C++11 user-defined literals and applies lexical class SCE_C_USERLITERAL.
+ </li>
+ <li>
+ C++ lexer allows single quote characters as digit separators in numeric literals like 123'456 as this is
+ included in C++14.
+ </li>
+ <li>
+ C++ lexer fixes bug with #include statements without " or &gt; terminating filename.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1538/">Bug #1538</a>.
+ </li>
+ <li>
+ C++ lexer fixes split of Doxygen keywords @code{.fileExtension} and @param[in,out].
+ <a href="http://sourceforge.net/p/scintilla/bugs/1551/">Bug #1551</a>.
+ </li>
+ <li>
+ C++ lexer styles Doxygen keywords at end of document.
+ </li>
+ <li>
+ Cmake lexer fixes bug with empty comments.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1550/">Bug #1550</a>.
+ </li>
+ <li>
+ Fortran folder improved. Treats "else" as fold header.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/962/">Feature #962.</a>
+ </li>
+ <li>
+ Fix bug with adjacent instances of the same indicator with different values where only the first was drawn.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1560/">Bug #1560</a>.
+ </li>
+ <li>
+ For DirectWrite, use the GDI ClearType gamma value for SC_EFF_QUALITY_LCD_OPTIMIZED as
+ this results in text that is similar in colour intensity to GDI.
+ For the duller default DirectWrite ClearType text appearance, use SC_EFF_QUALITY_DEFAULT.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/887/">Feature #887.</a>
+ </li>
+ <li>
+ Fix another problem with drawing on Windows with Direct2D when returning from lock screen.
+ The whole window is redrawn as just redrawing the initially required area left other areas black.
+ </li>
+ <li>
+ When scroll width is tracked, take width of annotation lines into account.
+ </li>
+ <li>
+ For Cocoa on OS X 10.9, responsive scrolling is supported.
+ </li>
+ <li>
+ On Cocoa, apply font quality setting to line numbers.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1544/">Bug #1544</a>.
+ </li>
+ <li>
+ On Cocoa, clicking in margin now sets focus.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1542/">Bug #1542</a>.
+ </li>
+ <li>
+ On Cocoa, correct cursor displayed in margin after showing dialog.
+ </li>
+ <li>
+ On Cocoa, multipaste mode now works.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1541/">Bug #1541</a>.
+ </li>
+ <li>
+ On GTK+, chain up to superclass finalize so that all finalization is performed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1549/">Bug #1549</a>.
+ </li>
+ <li>
+ On GTK+, fix horizontal scroll bar range to not be double the needed width.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1546/">Bug #1546</a>.
+ </li>
+ <li>
+ On OS X GTK+, report control key as SCI_META for mouse down events.
+ </li>
+ <li>
+ On Qt, bug fixed with drawing of scrollbars, where previous contents were not drawn over with some
+ themes.
+ </li>
+ <li>
+ On Qt, bug fixed with finding monitor rectangle which could lead to autocomplete showing at wrong location.
+ </li>
+ <li>
+ SciTE fix for multiple message boxes when failing to save a file with save.on.deactivate.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1540/">Bug #1540</a>.
+ </li>
+ <li>
+ SciTE on GTK+ fixes SIGCHLD handling so that Lua scripts can determine the exit status of processes
+ they start.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1557/">Bug #1557</a>.
+ </li>
+ <li>
+ SciTE on Windows XP fixes bad display of find and replace values when using strips.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite336.zip?download">Release 3.3.6</a>
+ </h3>
+ <ul>
+ <li>
+ Released 15 October 2013.
+ </li>
+ <li>
+ Added functions to help convert between substyles and base styles and between secondary and primary styles.
+ SCI_GETSTYLEFROMSUBSTYLE finds the base style of substyles.
+ Can be used to treat all substyles of a style equivalent to that style.
+ SCI_GETPRIMARYSTYLEFROMSTYLE finds the primary style of secondary styles.
+ StyleFromSubStyle and PrimaryStyleFromStyle methods were added to ILexerWithSubStyles so each lexer can implement these.
+ </li>
+ <li>
+ Lexer added for Rust language.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1024/">Feature #1024.</a>
+ </li>
+ <li>
+ Avoid false matches in errorlist lexer which is used for the SciTE output pane
+ by stricter checking of ctags lines.
+ </li>
+ <li>
+ Perl lexer fixes bugs with multi-byte characters, including in HEREDOCs and PODs.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1528/">Bug #1528</a>.
+ </li>
+ <li>
+ SQL folder folds 'create view' statements.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1020/">Feature #1020.</a>
+ </li>
+ <li>
+ Visual Prolog lexer updated with better support for string literals and Unicode.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1025/">Feature #1025.</a>
+ </li>
+ <li>
+ For SCI_SETIDENTIFIERS, \t, \r, and \n are allowed as well as space between identifiers.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1521/">Bug #1521</a>.
+ </li>
+ <li>
+ Gaining and losing focus is now reported as a notification with the code set to SCN_FOCUSIN
+ or SCN_FOCUSOUT.
+ This allows clients to uniformly use notifications instead of commands.
+ Since there is no longer a need for commands they will be deprecated in a future version.
+ Clients should switch any code that currently uses SCEN_SETFOCUS or SCEN_KILLFOCUS.
+ </li>
+ <li>
+ On Cocoa, clients should use the delegate mechanism or subclass ScintillaView in preference
+ to registerNotifyCallback: which will be deprecated in the future.
+ </li>
+ <li>
+ On Cocoa, the ScintillaView.h header hides internal implementation details from Platform.h and ScintillaCocoa.h.
+ InnerView was renamed to SCIContentView and MarginView was renamed to SCIMarginView.
+ dealloc removed from @interface.
+ </li>
+ <li>
+ On Cocoa, clients may customize SCIContentView by subclassing both SCIContentView and ScintillaView
+ and implementing the contentViewClass class method on the ScintillaView subclass to return the class of
+ the SCIContentView subclass.
+ </li>
+ <li>
+ On Cocoa, fixed appearance of alpha rectangles to use specified alpha and colour for outline as well as corner size.
+ This makes INDIC_STRAIGHTBOX and INDIC_ROUNDBOX look correct.
+ </li>
+ <li>
+ On Cocoa, memory leak fixed for MarginView.
+ </li>
+ <li>
+ On Cocoa, make drag and drop work when destination view is empty.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1534/">Bug #1534</a>.
+ </li>
+ <li>
+ On Cocoa, drag image fixed when view scrolled.
+ </li>
+ <li>
+ On Cocoa, SCI_POSITIONFROMPOINTCLOSE fixed when view scrolled.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1021/">Feature #1021.</a>
+ </li>
+ <li>
+ On Cocoa, don't send selection change notification when scrolling.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1522/">Bug #1522</a>.
+ </li>
+ <li>
+ On Qt, turn off idle events on destruction to prevent repeatedly calling idle.
+ </li>
+ <li>
+ Qt bindings in ScintillaEdit changed to use signed first parameter.
+ </li>
+ <li>
+ Compilation errors fixed on Windows and GTK+ with SCI_NAMESPACE.
+ </li>
+ <li>
+ On Windows, building with gcc will check if Direct2D headers are available and enable Direct2D if they are.
+ </li>
+ <li>
+ Avoid attempts to redraw empty areas when lexing beyond the currently visible lines.
+ </li>
+ <li>
+ Control more attributes of indicators in SciTE with find.mark.indicator and highlight.current.word.indicator
+ properties.
+ </li>
+ <li>
+ Fix SciTE bug with buffers becoming read-only.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1525/">Bug #1525</a>.
+ </li>
+ <li>
+ Fix linking SciTE on non-Linux Unix systems with GNU toolchain by linking to libdl.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1523/">Bug #1523</a>.
+ </li>
+ <li>
+ On Windows, SciTE's Incremental Search displays match failures by changing the background colour
+ instead of not adding the character that caused failure.
+ </li>
+ <li>
+ Fix SciTE on GTK+ 3.x incremental search to change foreground colour when no match as
+ changing background colour is difficult.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite335.zip?download">Release 3.3.5</a>
+ </h3>
+ <ul>
+ <li>
+ Released 31 August 2013.
+ </li>
+ <li>
+ Characters may be represented by strings.
+ In Unicode mode C1 control characters are represented by their mnemonics.
+ </li>
+ <li>
+ Added SCI_POSITIONRELATIVE to optimize navigation by character.
+ </li>
+ <li>
+ Option to allow mouse selection to switch to rectangular by pressing Alt after start of gesture.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1007/">Feature #1007.</a>
+ </li>
+ <li>
+ Lexer added for KVIrc script.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1008/">Feature #1008.</a>
+ </li>
+ <li>
+ Bash lexer fixed quoted HereDoc delimiters.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1500/">Bug #1500</a>.
+ </li>
+ <li>
+ MS SQL lexer fixed ';' to appear as an operator.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1509/">Bug #1509</a>.
+ </li>
+ <li>
+ Structured Text lexer fixed styling of enumeration members.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1508/">Bug #1508</a>.
+ </li>
+ <li>
+ Fixed bug with horizontal caret position when margin changed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1512/">Bug #1512</a>.
+ </li>
+ <li>
+ Fixed bug on Cocoa where coordinates were relative to text subview instead of whole view.
+ </li>
+ <li>
+ Ensure selection redrawn correctly in two cases.
+ When switching from stream to rectangular selection with Alt+Shift+Up.
+ When reducing the range of an additional selection by moving mouse up.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1007/">Feature #1007.</a>
+ </li>
+ <li>
+ Copy and paste of rectangular selections compatible with Borland Delphi IDE on Windows.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1002/">Feature #1002.</a>
+ <a href="http://sourceforge.net/p/scintilla/bugs/1513/">Bug #1513</a>.
+ </li>
+ <li>
+ Initialize extended styles to the default style.
+ </li>
+ <li>
+ On Windows, fix painting on an explicit HDC when first paint attempt abandoned.
+ </li>
+ <li>
+ Qt bindings in ScintillaEdit made to work on 64-bit Unix systems.
+ </li>
+ <li>
+ Easier access to printing on Qt with formatRange method.
+ </li>
+ <li>
+ Fixed SciTE failure to save initial buffer in single buffer mode.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1339/">Bug #1339</a>.
+ </li>
+ <li>
+ Fixed compilation problem with Visual C++ in non-English locales.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1506/">Bug #1506</a>.
+ </li>
+ <li>
+ Disable Direct2D when compiling with MinGW gcc on Windows because of changes in the recent MinGW release.
+ </li>
+ <li>
+ SciTE crash fixed for negative line.margin.width.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1504/">Bug #1504</a>.
+ </li>
+ <li>
+ SciTE fix for infinite dialog boxes when failing to automatically save a file.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1503/">Bug #1503</a>.
+ </li>
+ <li>
+ SciTE settings buffered.draw, two.phase.draw, and technology are applied to the
+ output pane as well as the edit pane.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite334.zip?download">Release 3.3.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 19 July 2013.
+ </li>
+ <li>
+ Handling of UTF-8 and DBCS text in lexers improved with methods ForwardBytes and
+ GetRelativeCharacter added to StyleContext.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1483/">Bug #1483</a>.
+ </li>
+ <li>
+ For Unicode text, case-insensitive searching and making text upper or lower case is now
+ compliant with Unicode standards on all platforms and is much faster for non-ASCII characters.
+ </li>
+ <li>
+ A CategoriseCharacter function was added to return the Unicode general category of a character
+ which can be useful in lexers.
+ </li>
+ <li>
+ On Cocoa, the LCD Optimized font quality level turns font smoothing on.
+ </li>
+ <li>
+ SciTE 'immediate' subsystem added to allow scripts that work while tools are executed.
+ </li>
+ <li>
+ Font quality exposed in SciTE as font.quality setting.
+ </li>
+ <li>
+ On Cocoa, message:... methods simplify direct access to Scintilla and avoid call layers..
+ </li>
+ <li>
+ A68K lexer updated.
+ </li>
+ <li>
+ CoffeeScript lexer fixes a bug with comment blocks.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1495/">Bug #1495</a>
+ </li>
+ <li>
+ ECL lexer regular expression code fixed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1491/">Bug #1491</a>.
+ </li>
+ <li>
+ errorlist lexer only recognises Perl diagnostics when there is a filename between
+ "at" and "line". Had been triggering for MSVC errors containing "at line".
+ </li>
+ <li>
+ Haskell lexer fixed to avoid unnecessary full redraws.
+ Don't highlight CPP inside comments when styling.within.preprocessor is on.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1459/">Bug #1459</a>.
+ </li>
+ <li>
+ Lua lexer fixes bug in labels with UTF-8 text.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1483/">Bug #1483</a>.
+ </li>
+ <li>
+ Perl lexer fixes bug in string interpolation with UTF-8 text.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1483/">Bug #1483</a>.
+ </li>
+ <li>
+ Fixed bugs with case conversion when the result was longer or shorter than the original text.
+ Could access past end of string potentially crashing.
+ Selection now updated to result length.
+ </li>
+ <li>
+ Fixed bug where data being inserted and removed was not being reported in
+ notification messages. Bug was introduced in 3.3.2.
+ </li>
+ <li>
+ Word wrap bug fixed where the last line could be shown twice.
+ </li>
+ <li>
+ Word wrap bug fixed for lines wrapping too short on Windows and GTK+.
+ </li>
+ <li>
+ Word wrap performance improved.
+ </li>
+ <li>
+ Minor memory leak fixed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1487/">Bug #1487</a>.
+ </li>
+ <li>
+ On Cocoa, fixed insertText: method which was broken when implementing a newer protocol.
+ </li>
+ <li>
+ On Cocoa, fixed a crash when performing string folding for bytes that do not represent a character
+ in the current encoding.
+ </li>
+ <li>
+ On Qt, fixed layout problem when QApplication construction delayed.
+ </li>
+ <li>
+ On Qt, find_text reports failure with -1 as first element of return value.
+ </li>
+ <li>
+ Fixed SciTE on GTK+ bug where a tool command could be performed using the keyboard while one was
+ already running leading to confusion and crashes.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1486/">Bug #1486</a>.
+ </li>
+ <li>
+ Fixed SciTE bug in Copy as RTF which was limited to first 32 styles.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1011/">Bug #1011</a>.
+ </li>
+ <li>
+ Fixed SciTE on Windows user strip height when the system text scaling factor is 125% or 150%.
+ </li>
+ <li>
+ Compile time checks for Digital Mars C++ removed.
+ </li>
+ <li>
+ Visual C++ 2013 supported.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1492/">Bug #1492</a>.
+ </li>
+ <li>
+ Python scripts used for building and maintenance improved and moved into scripts directory.
+ </li>
+ <li>
+ Testing scripts now work on Linux using Qt and PySide.
+ </li>
+ <li>
+ Tk platform defined.
+ Implementation for Tk will be available separately from main Scintilla distribution.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite333.zip?download">Release 3.3.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 2 June 2013.
+ </li>
+ <li>
+ Lexer and folder added for Structured Text language.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/959/">Feature #959.</a>
+ </li>
+ <li>
+ Out of bounds access fixed for GTK+.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1480/">Bug #1480</a>.
+ </li>
+ <li>
+ Crash fixed for GTK+ on Windows paste.
+ </li>
+ <li>
+ Bug fixed with incorrect event copying on GTK+ 3.x.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1481/">Bug #1481</a>.
+ </li>
+ <li>
+ Bug fixed with right to left locales, like Hebrew, on GTK+.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1477/">Bug #1477</a>.
+ </li>
+ <li>
+ Bug fixed with undo grouping of tab and backtab commands.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1478/">Bug #1478</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite332.zip?download">Release 3.3.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released 22 May 2013.
+ </li>
+ <li>
+ Basic implementations of common folding methods added to Scintilla to make it
+ easier for containers to implement folding.
+ </li>
+ <li>
+ Add indicator INDIC_COMPOSITIONTHICK, a thick low underline, to mimic an
+ appearance used for Asian language input composition.
+ </li>
+ <li>
+ On Cocoa, implement font quality setting.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/988/">Feature #988.</a>
+ </li>
+ <li>
+ On Cocoa, implement automatic enabling of commands and added clear command.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/987/">Feature #987.</a>
+ </li>
+ <li>
+ C++ lexer adds style for preprocessor doc comment.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/990/">Feature #990.</a>
+ </li>
+ <li>
+ Haskell lexer and folder improved. Separate mode for literate Haskell "literatehaskell" SCLEX_LITERATEHASKELL.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1459/">Bug #1459 </a>.
+ </li>
+ <li>
+ LaTeX lexer bug fixed for Unicode character following '\'.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1468/">Bug #1468 </a>.
+ </li>
+ <li>
+ PowerShell lexer recognises here strings and doccomment keywords.
+ #region folding added.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/985/">Feature #985.</a>
+ </li>
+ <li>
+ Fix multi-typing when two carets are located in virtual space on one line so that spaces
+ are preserved.
+ </li>
+ <li>
+ Fixes to input composition on Cocoa and implementation of accented character input through
+ press and hold. Set selection correctly so that changes to pieces of composition text are easier to perform.
+ Restore undo collection after a sequence of composition actions.
+ Composition popups appear near input.
+ </li>
+ <li>
+ Fix lexer problem where no line end was seen at end of document.
+ </li>
+ <li>
+ Fix crash on Cocoa when view deallocated.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1466/">Bug #1466</a>.
+ </li>
+ <li>
+ Fix Qt window positioning to not assume the top right of a monitor is at 0, 0.
+ </li>
+ <li>
+ Fix Qt to not track mouse when widget is hidden.
+ </li>
+ <li>
+ Qt now supports Qt 5.0.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1448/">Bug #1448</a>.
+ </li>
+ <li>
+ Fix drawing on Windows with Direct2D when returning from lock screen.
+ The render target had to be recreated and an area would be black since the drawing was not retried.
+ </li>
+ <li>
+ Fix display of DBCS documents on Windows Direct2D/DirectWrite with default character set.
+ </li>
+ <li>
+ For SciTE on Windows, fixed most-recently-used menu when files opened through check.if.already.opened.
+ </li>
+ <li>
+ In SciTE, do not call OnSave twice when files saved asynchronously.
+ </li>
+ <li>
+ Scintilla no longer builds with Visual C++ 6.0.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite331.zip?download">Release 3.3.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 11 April 2013.
+ </li>
+ <li>
+ Autocompletion lists can now appear in priority order or be sorted by Scintilla.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/981/">Feature #981.</a>
+ </li>
+ <li>
+ Most lexers now lex an extra NUL byte at the end of the
+ document which makes it more likely they will classify keywords at document end correctly.
+ <a href="http://sourceforge.net/p/scintilla/bugs/574/">Bug #574</a>,
+ <a href="http://sourceforge.net/p/scintilla/bugs/588/">Bug #588.</a>
+ </li>
+ <li>
+ Haskell lexer improved in several ways.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1459/">Bug #1459.</a>
+ </li>
+ <li>
+ Matlab/Octave lexer recognises block comments and ... comments.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1414/">Bug #1414.</a>
+ </li>
+ <li>
+ Ruby lexer crash fixed with keyword at start of document.
+ </li>
+ <li>
+ The PLAT_NCURSES platform now called PLAT_CURSES as may work on other implementations.
+ </li>
+ <li>
+ Bug on Cocoa fixed where input composition with multiple selection or virtual space selection
+ could make undo stop working.
+ </li>
+ <li>
+ Direct2D/DirectWrite mode on Windows now displays documents in non-Latin1 8-bit encodings correctly.
+ </li>
+ <li>
+ Character positioning corrected in Direct2D/DirectWrite mode on Windows to avoid text moving and cutting off
+ lower parts of characters.
+ </li>
+ <li>
+ Position of calltip and autocompletion lists fixed on Cocoa.
+ </li>
+ <li>
+ While regular expression search in DBCS text is still not working, matching partial characters is now avoided
+ by moving end of match to end of character.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite330.zip?download">Release 3.3.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 30 March 2013.
+ </li>
+ <li>
+ Overlay scrollers and kinetic scrolling implemented on Cocoa.
+ </li>
+ <li>
+ To improve display smoothness, styling and UI Update notifications will, when possible, be performed in
+ a high-priority idle task on Cocoa instead of during painting.
+ Performing these jobs inside painting can cause paints to be abandoned and a new paint scheduled.
+ On GTK+, the high-priority idle task is used in more cases.
+ </li>
+ <li>
+ SCI_SCROLLRANGE added to scroll the view to display a range of text.
+ If the whole range can not be displayed, priority is given to one end.
+ </li>
+ <li>
+ C++ lexer no longer recognises raw (R"") strings when the first character after "
+ is invalid.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1454/">Bug #1454.</a>
+ </li>
+ <li>
+ HTML lexer recognises JavaScript RegEx literals in more contexts.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1412/">Bug #1412.</a>
+ </li>
+ <li>
+ Fixed automatic display of folded text when return pressed at end of fold header and
+ first folded line was blank.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1455/">Bug #1455.</a>
+ </li>
+ <li>
+ SCI_VISIBLEFROMDOCLINE fixed to never return a line beyond the document end.
+ </li>
+ <li>
+ SCI_LINESCROLL fixed for a negative column offset.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1450/">Bug #1450.</a>
+ </li>
+ <li>
+ On GTK+, fix tab markers so visible if indent markers are visible.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1453/">Bug #1453.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite325.zip?download">Release 3.2.5</a>
+ </h3>
+ <ul>
+ <li>
+ Released 26 February 2013.
+ </li>
+ <li>
+ To allow cooperation between different uses of extended (beyond 255) styles they should be allocated
+ using SCI_ALLOCATEEXTENDEDSTYLES.
+ </li>
+ <li>
+ For Unicode documents, lexers that use StyleContext will retrieve whole characters
+ instead of bytes.
+ LexAccessor provides a LineEnd method which can be a more efficient way to
+ handle line ends and can enable Unicode line ends.
+ </li>
+ <li>
+ The C++ lexer understands the #undef directive when determining preprocessor definitions.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/978/">Feature #978.</a>
+ </li>
+ <li>
+ The errorlist lexer recognises gcc include path diagnostics that appear before an error.
+ </li>
+ <li>
+ Folding implemented for GetText (PO) translation language.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1437/">Bug #1437.</a>
+ </li>
+ <li>
+ HTML lexer does not interrupt comment style for processing instructions.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1447/">Bug #1447.</a>
+ </li>
+ <li>
+ Fix SciTE forgetting caret x-position when switching documents.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1442/">Bug #1442.</a>
+ </li>
+ <li>
+ Fixed bug where vertical scrollbar thumb appeared at beginning of document when
+ scrollbar shown.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1446/">Bug #1446.</a>
+ </li>
+ <li>
+ Fixed brace-highlighting bug on OS X 10.8 where matching brace is on a different line.
+ </li>
+ <li>
+ <a href="ScintillaDoc.html#ProvisionalMessages">Provisional features</a>
+ are new features that may change or be removed if they cause problems but should become
+ permanent if they work well.
+ For this release <a href="ScintillaDoc.html#SCI_GETLINEENDTYPESSUPPORTED">Unicode line ends</a> and
+ <a href="ScintillaDoc.html#Substyles">substyles</a>
+ are provisional features.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite324.zip?download">Release 3.2.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 17 January 2013.
+ </li>
+ <li>
+ Caret line highlight can optionally remain visible when window does not have focus.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/964/">Feature #964.</a>
+ </li>
+ <li>
+ Delegate mechanism for notifications added on Cocoa.
+ </li>
+ <li>
+ NUL characters in selection are copied to clipboard as spaces to avoid truncating
+ at the NUL.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1289/">Bug #1289.</a>
+ </li>
+ <li>
+ C++ lexer fixes problem with showing inactive sections when preprocessor lines contain trailing comment.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1413/">Bug #1413.</a>
+ </li>
+ <li>
+ C++ lexer fixes problem with JavaScript regular expressions with '/' in character ranges.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1415/">Bug #1415.</a>
+ </li>
+ <li>
+ LaTeX folder added.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/970/">Feature #970.</a>
+ </li>
+ <li>
+ LaTeX lexer improves styling of math environments.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/970/">Feature #970.</a>
+ </li>
+ <li>
+ MySQL lexer implements hidden commands.
+ </li>
+ <li>
+ Only produce a single undo step when autocompleting a single word.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1421/">Bug #1421.</a>
+ </li>
+ <li>
+ Fixed crash when printing lines longer than 8000 characters.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1430/">Bug #1430.</a>
+ </li>
+ <li>
+ Fixed problem in character movement extends selection mode where reversing
+ direction collapsed the selection.
+ </li>
+ <li>
+ Memory issues fixed on Cocoa, involving object ownership,
+ lifetime of timers, and images held by the info bar.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1436/">Bug #1436.</a>
+ </li>
+ <li>
+ Cocoa key binding for Alt+Delete changed to delete previous word to be more compatible with
+ platform standards.
+ </li>
+ <li>
+ Fixed crash on Cocoa with scrollbar when there is no scrolling possible.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1416/">Bug #1416.</a>
+ </li>
+ <li>
+ On Cocoa with retina display fixed positioning of autocompletion lists.
+ </li>
+ <li>
+ Fixed SciTE on Windows failure to run a batch file with a name containing a space by
+ quoting the path in the properties file.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1423/">Bug #1423.</a>
+ </li>
+ <li>
+ Fixed scaling bug when printing on GTK+.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1427/">Bug #1427.</a>
+ </li>
+ <li>
+ SciTE on GTK toolbar.detachable feature removed.
+ </li>
+ <li>
+ Fixed some background saving bugs in SciTE.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1366/">Bug #1366.</a>
+ <a href="http://sourceforge.net/p/scintilla/bugs/1339/">Bug #1339.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite323.zip?download">Release 3.2.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 21 October 2012.
+ </li>
+ <li>
+ Improve speed when performing multiple searches.
+ </li>
+ <li>
+ SciTE adds definition of PLAT_UNIX for both PLAT_GTK and PLAT_MAC to allow consolidation of
+ settings valid on all Unix variants.
+ </li>
+ <li>
+ Signal autoCompleteCancelled added on Qt.
+ </li>
+ <li>
+ Bash lexer supports nested delimiter pairs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3569352&group_id=2439">Feature #3569352.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1515556&group_id=2439">Bug #1515556.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3008483&group_id=2439">Bug #3008483.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3512208&group_id=2439">Bug #3512208.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3515392&group_id=2439">Bug #3515392.</a>
+ </li>
+ <li>
+ For C/C++, recognise exponent in floating point hexadecimal literals.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3576454&group_id=2439">Bug #3576454.</a>
+ </li>
+ <li>
+ For C #include statements, do not treat // in the path as a comment.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3519260&group_id=2439">Bug #3519260.</a>
+ </li>
+ <li>
+ Lexer for GetText translations (PO) improved with additional styles and single instance limitation fixed.
+ </li>
+ <li>
+ Ruby for loop folding fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3240902&group_id=2439">Bug #3240902.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3567391&group_id=2439">Bug #3567391.</a>
+ </li>
+ <li>
+ Ruby recognition of here-doc after class or instance variable fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3567809&group_id=2439">Bug #3567809.</a>
+ </li>
+ <li>
+ SQL folding of loop and case fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3567905&group_id=2439">Bug #3567905.</a>
+ </li>
+ <li>
+ SQL folding of case with assignment fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3571820&group_id=2439">Bug #3571820.</a>
+ </li>
+ <li>
+ Fix hang when removing all characters from indicator at end of document.
+ </li>
+ <li>
+ Fix failure of \xhh in regular expression search for values greater than 0x79.
+ </li>
+ <li>
+ On Cocoa on OS X 10.8, fix inverted drawing of find indicator.
+ </li>
+ <li>
+ On Cocoa, fix double drawing when horizontal scroll range small and user swipes horizontally.
+ </li>
+ <li>
+ On Cocoa, remove incorrect setting of save point when reading information through 'string' and 'selectedString'.
+ </li>
+ <li>
+ On Cocoa, fix incorrect memory management of infoBar.
+ </li>
+ <li>
+ On GTK+ 3 Ubuntu, fix crash when drawing margin.
+ </li>
+ <li>
+ On ncurses, fix excessive spacing with italics line end.
+ </li>
+ <li>
+ On Windows, search for D2D1.DLL and DWRITE.DLL in system directory to avoid loading from earlier
+ in path where could be planted by malware.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite322.zip?download">Release 3.2.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released 31 August 2012.
+ </li>
+ <li>
+ Retina display support for Cocoa. Text size fixed.
+ Scale factor for images implemented so they can be displayed in high definition.
+ </li>
+ <li>
+ Implement INDIC_SQUIGGLEPIXMAP as a faster version of INDIC_SQUIGGLE.
+ Avoid poor drawing at right of INDIC_SQUIGGLE.
+ Align INDIC_DOTBOX to pixel grid for full intensity.
+ </li>
+ <li>
+ Implement SCI_GETSELECTIONEMPTY API.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3543121&group_id=2439">Bug #3543121.</a>
+ </li>
+ <li>
+ Added SCI_VCHOMEDISPLAY and SCI_VCHOMEDISPLAYEXTEND key commands.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3561433&group_id=2439">Feature #3561433.</a>
+ </li>
+ <li>
+ Allow specifying SciTE Find in Files directory with find.in.directory property.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3558594&group_id=2439">Feature #3558594.</a>
+ </li>
+ <li>
+ Override SciTE global strip.trailing.spaces with strip.trailing.spaces by pattern files.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3556320&group_id=2439">Feature #3556320.</a>
+ </li>
+ <li>
+ Fix long XML script tag handling in XML lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3534190&group_id=2439">Bug #3534190.</a>
+ </li>
+ <li>
+ Fix rectangular selection range after backspace.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3543097&group_id=2439">Bug #3543097.</a>
+ </li>
+ <li>
+ Send SCN_UPDATEUI with SC_UPDATE_SELECTION for backspace in virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3543121&group_id=2439">Bug #3543121.</a>
+ </li>
+ <li>
+ Avoid problems when calltip highlight range is negative.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3545938&group_id=2439">Bug #3545938.</a>
+ </li>
+ <li>
+ On Cocoa, fix image drawing code so that image is not accessed after being freed
+ and is drawn in the correct location.
+ </li>
+ <li>
+ On Cocoa, limit horizontal touch scrolling to existing established width.
+ </li>
+ <li>
+ On Cocoa, decrease sensitivity of pinch-zoom.
+ </li>
+ <li>
+ Fix Cocoa drawing where style changes were not immediately visible.
+ </li>
+ <li>
+ Fix Cocoa memory leak due to reference cycle.
+ </li>
+ <li>
+ Fix Cocoa bug where notifications were sent after Scintilla was freed.
+ </li>
+ <li>
+ SciTE on OS X user shortcuts treats "Ctrl+D" as equivalent to "Ctrl+d".
+ </li>
+ <li>
+ On Windows, saving SciTE's Lua startup script causes it to run.
+ </li>
+ <li>
+ Limit time allowed to highlight current word in SciTE to 0.25 seconds to remain responsive.
+ </li>
+ <li>
+ Fixed SciTE read-only mode to stick with buffer.
+ </li>
+ <li>
+ For SciTE on Windows, enable Ctrl+Z, Ctrl+X, and Ctrl+C (Undo, Cut, and Copy) in the
+ editable fields of find and replace strips
+ </li>
+ <li>
+ Remove limit on logical line length in SciTE .properties files.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3544312&group_id=2439">Bug #3544312.</a>
+ </li>
+ <li>
+ Improve performance of SciTE Save As command.
+ </li>
+ <li>
+ Fix SciTE crash with empty .properties files. Bug #3545938.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3555308&group_id=2439">Bug #3555308.</a>
+ </li>
+ <li>
+ Fix repeated letter in SciTE calltips.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3545938&group_id=2439">Bug #3545938.</a>
+ </li>
+ <li>
+ Refine build time checking for Direct2D and DirectWrite.
+ </li>
+ <li>
+ Avoid potential build problems on Windows with MultiMon.h by explicitly checking for multi-monitor APIs.
+ </li>
+ <li>
+ Automatically disable themed drawing in SciTE when building on Windows 2000.
+ Reenable building for Windows NT 4 on NT 4 .
+ </li>
+ <li>
+ Added ncurses platform definitions. Implementation is maintained separately as
+ <a href="http://foicica.com/scinterm/">Scinterm</a>.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite321.zip?download">Release 3.2.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 14 July 2012.
+ </li>
+ <li>
+ In Scintilla.iface, specify features as properties instead of functions where possible and fix some enumerations.
+ </li>
+ <li>
+ In SciTE Lua scripts, string properties in Scintilla API can be retrieved as well as set using property notation.
+ </li>
+ <li>
+ Added character class APIs: SCI_SETPUNCTUATIONCHARS, SCI_GETWORDCHARS, SCI_GETWHITESPACECHARS,
+ and SCI_GETPUNCTUATIONCHARS.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3529805&group_id=2439">Feature #3529805.</a>
+ </li>
+ <li>
+ Less/Hss support added to CSS lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3532413&group_id=2439">Feature #3532413.</a>
+ </li>
+ <li>
+ C++ lexer style SCE_C_PREPROCESSORCOMMENT added for stream comments in preprocessor.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3487406&group_id=2439">Bug #3487406.</a>
+ </li>
+ <li>
+ Fix incorrect styling of inactive code in C++ lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3533036&group_id=2439">Bug #3533036.</a>
+ </li>
+ <li>
+ Fix incorrect styling by C++ lexer after empty lines in preprocessor style.
+ </li>
+ <li>
+ C++ lexer option "lexer.cpp.allow.dollars" fixed so can be turned off after being on.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3541461&group_id=2439">Bug #3541461.</a>
+ </li>
+ <li>
+ Fortran fixed format lexer fixed to style comments from column 73.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540486&group_id=2439">Bug #3540486.</a>
+ </li>
+ <li>
+ Fortran folder folds CRITICAL .. END CRITICAL.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540486&group_id=2439">Bug #3540486.</a>
+ </li>
+ <li>
+ Fortran lexer fixes styling after comment line ending with '&amp;'.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3087226&group_id=2439">Bug #3087226.</a>
+ </li>
+ <li>
+ Fortran lexer styles preprocessor lines so they do not trigger incorrect folding.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2906275&group_id=2439">Bug #2906275.</a>
+ </li>
+ <li>
+ Fortran folder fixes folding of nested ifs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2809176&group_id=2439">Bug #2809176.</a>
+ </li>
+ <li>
+ HTML folder fixes folding of CDATA when fold.html.preprocessor=0.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3540491&group_id=2439">Bug #3540491.</a>
+ </li>
+ <li>
+ On Cocoa, fix autocompletion font lifetime issue and row height computation.
+ </li>
+ <li>
+ In 'choose single' mode, autocompletion will close an existing list if asked to display a single entry list.
+ </li>
+ <li>
+ Fixed SCI_MARKERDELETE to only delete one marker per call.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3535806&group_id=2439">Bug #3535806.</a>
+ </li>
+ <li>
+ Properly position caret after undoing coalesced delete operations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3523326&group_id=2439">Bug #3523326.</a>
+ </li>
+ <li>
+ Ensure margin is redrawn when SCI_MARGINSETSTYLE called.
+ </li>
+ <li>
+ Fix clicks in first pixel of margins to send SCN_MARGINCLICK.
+ </li>
+ <li>
+ Fix infinite loop when drawing block caret for a zero width space character at document start.
+ </li>
+ <li>
+ Crash fixed for deleting negative range.
+ </li>
+ <li>
+ For characters that overlap the beginning of their space such as italics descenders and bold serifs, allow start
+ of text to draw 1 pixel into margin.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=699587&group_id=2439">Bug #699587.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3537799&group_id=2439">Bug #3537799.</a>
+ </li>
+ <li>
+ Fixed problems compiling Scintilla for Qt with GCC 4.7.1 x64.
+ </li>
+ <li>
+ Fixed problem with determining GTK+ sub-platform caused when adding Qt support in 3.2.0.
+ </li>
+ <li>
+ Fix incorrect measurement of untitled file in SciTE on Linux leading to message "File ...' is 2147483647 bytes long".
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3537764&group_id=2439">Bug #3537764.</a>
+ </li>
+ <li>
+ In SciTE, fix open of selected filename with line number to go to that line.
+ </li>
+ <li>
+ Fix problem with last visible buffer closing in SciTE causing invisible buffers to be active.
+ </li>
+ <li>
+ Avoid blinking of SciTE's current word highlight when output pane changes.
+ </li>
+ <li>
+ SciTE properties files can be longer than 60K.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite320.zip?download">Release 3.2.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 June 2012.
+ </li>
+ <li>
+ Platform layer added for the Qt open-source cross-platform application and user interface framework
+ for development in C++ or in Python with the PySide bindings for Qt.
+ </li>
+ <li>
+ Direct access provided to the document bytes for ranges within Scintilla.
+ This is similar to the existing SCI_GETCHARACTERPOINTER API but allows for better performance.
+ </li>
+ <li>
+ Ctrl+Double Click and Ctrl+Triple Click add the word or line to the set of selections.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3520037&group_id=2439">Feature #3520037.</a>
+ </li>
+ <li>
+ A SCI_DELETERANGE API was added for deleting a range of text.
+ </li>
+ <li>
+ Line wrap markers may now be drawn in the line number margin.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3518198&group_id=2439">Feature #3518198.</a>
+ </li>
+ <li>
+ SciTE on OS X adds option to hide hidden files in the open dialog box.
+ </li>
+ <li>
+ Lexer added for OScript language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3523197&group_id=2439">Feature #3523197.</a>
+ </li>
+ <li>
+ Lexer added for Visual Prolog language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3523018&group_id=2439">Feature #3523018.</a>
+ </li>
+ <li>
+ UTF-8 validity is checked more stringently and consistently. All 66 non-characters are now treated as invalid.
+ </li>
+ <li>
+ HTML lexer bug fixed with inconsistent highlighting for PHP when attribute on separate line from tag.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3520027&group_id=2439">Bug #3520027.</a>
+ </li>
+ <li>
+ HTML lexer bug fixed for JavaScript block comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3520032&group_id=2439">Bug #3520032.</a>
+ </li>
+ <li>
+ Annotation drawing bug fixed when box displayed with different colours on different lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3519872&group_id=2439">Bug #3519872.</a>
+ </li>
+ <li>
+ On Windows with Direct2D, fix drawing with 125% and 150% DPI system settings.
+ </li>
+ <li>
+ Virtual space selection bug fixed for rectangular selections.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3519246&group_id=2439">Bug #3519246.</a>
+ </li>
+ <li>
+ Replacing multiple selection with newline changed to only affect main selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3522251&group_id=2439">Bug #3522251.</a>
+ </li>
+ <li>
+ Replacing selection with newline changed to group deletion and insertion as a single undo action.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3522250&group_id=2439">Bug #3522250.</a>
+ </li>
+ <li>
+ Auto-completion lists on GTK+ 3 set height correctly instead of showing too few lines.
+ </li>
+ <li>
+ Mouse wheel scrolling changed to avoid GTK+ bug in recent distributions.
+ </li>
+ <li>
+ IME bug on Windows fixed for horizontal jump.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3529728&group_id=2439">Bug #3529728.</a>
+ </li>
+ <li>
+ SciTE case-insensitive autocompletion filters equal identifiers better.
+ Calltip arrows work with bare word identifiers.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3517810&group_id=2439">Bug #3517810.</a>
+ </li>
+ <li>
+ SciTE bug fixed where shbang lines not setting file type when switching
+ to file loaded in background.
+ </li>
+ <li>
+ SciTE on GTK+ shows open and save dialogs with the directory of the current file displayed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite310.zip?download">Release 3.1.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 20 April 2012.
+ </li>
+ <li>
+ Animated find indicator added on Cocoa.
+ </li>
+ <li>
+ Buttons can be made default in SciTE user strips.
+ </li>
+ <li>
+ SciTE allows find and replace histories to be saved in session.
+ </li>
+ <li>
+ Option added to allow case-insensitive selection in auto-completion lists.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3516538&group_id=2439">Bug #3516538.</a>
+ </li>
+ <li>
+ Replace \0 by complete found text in regular expressions.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3510979&group_id=2439">Feature #3510979.</a>
+ </li>
+ <li>
+ Fixed single quoted strings in bash lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3512208&group_id=2439">Bug #3512208.</a>
+ </li>
+ <li>
+ Incorrect highlighting fixed in C++ lexer for continued lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3509317&group_id=2439">Bug #3509317.</a>
+ </li>
+ <li>
+ Hang fixed in diff lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3508602&group_id=2439">Bug #3508602.</a>
+ </li>
+ <li>
+ Folding improved for SQL CASE/MERGE statement.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3503277&group_id=2439">Bug #3503277.</a>
+ </li>
+ <li>
+ Fix extra drawing of selection inside word wrap indentation.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3515555&group_id=2439">Bug #3515555.</a>
+ </li>
+ <li>
+ Fix problem with determining the last line that needs styling when drawing.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3514882&group_id=2439">Bug #3514882.</a>
+ </li>
+ <li>
+ Fix problems with drawing in margins.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3514882&group_id=2439">Bug #3514882.</a>
+ </li>
+ <li>
+ Fix printing crash when using Direct2D to display on-screen.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3513946&group_id=2439">Bug #3513946.</a>
+ </li>
+ <li>
+ Fix SciTE bug where background.*.size disabled restoration of bookmarks and positions from session.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3514885&group_id=2439">Bug #3514885.</a>
+ </li>
+ <li>
+ Fixed the Move Selected Lines command when last line does not end with a line end character.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3511023&group_id=2439">Bug #3511023.</a>
+ </li>
+ <li>
+ Fix word wrap indentation printing to use printer settings instead of screen settings.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3512961&group_id=2439">Bug #3512961.</a>
+ </li>
+ <li>
+ Fix SciTE bug where executing an empty command prevented executing further commands
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3512976&group_id=2439">Bug #3512976.</a>
+ </li>
+ <li>
+ Fix SciTE bugs with focus in user strips and made strips more robust with invalid definitions.
+ </li>
+ <li>
+ Suppress SciTE regular expression option when searching with find next selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3510985&group_id=2439">Bug #3510985.</a>
+ </li>
+ <li>
+ SciTE Find in Files command matches empty pattern to all files.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3495918&group_id=2439">Feature #3495918.</a>
+ </li>
+ <li>
+ Fix scroll with mouse wheel on GTK+.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3501321&group_id=2439">Bug #3501321.</a>
+ </li>
+ <li>
+ Fix column finding method so that tab is counted correctly.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3483713&group_id=2439">Bug #3483713.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite304.zip?download">Release 3.0.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 8 March 2012.
+ </li>
+ <li>
+ SciTE scripts can create user interfaces as strips.
+ </li>
+ <li>
+ SciTE can save files automatically in the background.
+ </li>
+ <li>
+ Pinch zoom implemented on Cocoa.
+ </li>
+ <li>
+ ECL lexer added.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3488209&group_id=2439">Feature #3488209.</a>
+ </li>
+ <li>
+ CPP lexer fixes styling after document comment keywords.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3495445&group_id=2439">Bug #3495445.</a>
+ </li>
+ <li>
+ Pascal folder improves handling of some constructs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3486385&group_id=2439">Feature #3486385.</a>
+ </li>
+ <li>
+ XML lexer avoids entering a bad mode due to complex preprocessor instructions.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3488060&group_id=2439">Bug #3488060.</a>
+ </li>
+ <li>
+ Duplicate command is always remembered as a distinct command for undo.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3495836&group_id=2439">Bug #3495836.</a>
+ </li>
+ <li>
+ SciTE xml.auto.close.tags no longer closes with PHP code similar to &lt;a $this-&gt;
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3488067&group_id=2439">Bug #3488067.</a>
+ </li>
+ <li>
+ Fix bug where setting an indicator for the whole document would fail.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3487440&group_id=2439">Bug #3487440.</a>
+ </li>
+ <li>
+ Crash fixed for SCI_MOVESELECTEDLINESDOWN with empty vertical selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3496403&group_id=2439">Bug #3496403.</a>
+ </li>
+ <li>
+ Differences between buffered and unbuffered mode on Direct2D eliminated.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3495791&group_id=2439">Bug #3495791.</a>
+ </li>
+ <li>
+ Font leading implemented for Direct2D to improve display of character blobs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3494744&group_id=2439">Bug #3494744.</a>
+ </li>
+ <li>
+ Fractional widths used for line numbers, character markers and other situations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3494492&group_id=2439">Bug #3494492.</a>
+ </li>
+ <li>
+ Translucent rectangles drawn using Direct2D with sharper corners.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3494492&group_id=2439">Bug #3494492.</a>
+ </li>
+ <li>
+ RGBA markers drawn sharper when centred using Direct2D.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3494202&group_id=2439">Bug #3494202.</a>
+ </li>
+ <li>
+ RGBA markers are drawn centred when taller than line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3494184&group_id=2439">Bug #3494184.</a>
+ </li>
+ <li>
+ Image marker drawing problem fixed for markers taller than line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3493503&group_id=2439">Bug #3493503.</a>
+ </li>
+ <li>
+ Markers are drawn horizontally off-centre based on margin type instead of dimensions.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3488696&group_id=2439">Bug #3488696.</a>
+ </li>
+ <li>
+ Fold tail markers drawn vertically centred.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3488289&group_id=2439">Feature #3488289.</a>
+ </li>
+ <li>
+ On Windows, Scintilla is more responsive in wrap mode.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3487397&group_id=2439">Bug #3487397.</a>
+ </li>
+ <li>
+ Unimportant "Gdk-CRITICAL" messages are no longer displayed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3488481&group_id=2439">Bug #3488481.</a>
+ </li>
+ <li>
+ SciTE on Windows Find in Files sets focus to dialog when already created; allows opening dialog when a job is running.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3480635&group_id=2439">Bug #3480635.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3486657&group_id=2439">Bug #3486657.</a>
+ </li>
+ <li>
+ Fixed problems with multiple clicks in margin and with mouse actions combined with virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3484370&group_id=2439">Bug #3484370.</a>
+ </li>
+ <li>
+ Fixed bug with using page up and down and not returning to original line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3485669&group_id=2439">Bug #3485669.</a>
+ </li>
+ <li>
+ Down arrow with wrapped text no longer skips lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1776560&group_id=2439">Bug #1776560.</a>
+ </li>
+ <li>
+ Fix problem with dwell ending immediately due to word wrap.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3484416&group_id=2439">Bug #3484416.</a>
+ </li>
+ <li>
+ Wrapped lines are rewrapped more consistently while resizing window.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3484179&group_id=2439">Bug #3484179.</a>
+ </li>
+ <li>
+ Selected line ends are highlighted more consistently.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3484330&group_id=2439">Bug #3484330.</a>
+ </li>
+ <li>
+ Fix grey background on files that use shbang to choose language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3482777&group_id=2439">Bug #3482777.</a>
+ </li>
+ <li>
+ Fix failure messages from empty commands in SciTE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3480645&group_id=2439">Bug #3480645.</a>
+ </li>
+ <li>
+ Redrawing reduced for some marker calls.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3493530&group_id=2439">Feature #3493530.</a>
+ </li>
+ <li>
+ Match brace and select brace commands work in SciTE output pane.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3486598&group_id=2439">Feature #3486598.</a>
+ </li>
+ <li>
+ Performing SciTE "Show Calltip" command when a calltip is already visible shows the next calltip.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3487017&group_id=2439">Feature #3487017.</a>
+ </li>
+ <li>
+ SciTE allows saving file even when file unchanged.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3486654&group_id=2439">Feature #3486654.</a>
+ </li>
+ <li>
+ SciTE allows optional use of character escapes in calltips.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3495239&group_id=2439">Feature #3495239.</a>
+ </li>
+ <li>
+ SciTE can open file:// URLs with Ctrl+Shift+O.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3495389&group_id=2439">Feature #3495389.</a>
+ </li>
+ <li>
+ Key modifiers updated for GTK+ on OS X to match upstream changes.
+ </li>
+ <li>
+ SciTE hang when marking all occurrences of regular expressions fixed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite303.zip?download">Release 3.0.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 28 January 2012.
+ </li>
+ <li>
+ Printing works on GTK+ version 2.x as well as 3.x.
+ </li>
+ <li>
+ Lexer added for the AviSynth language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3475611&group_id=2439">Feature #3475611.</a>
+ </li>
+ <li>
+ Lexer added for the Take Command / TCC scripting language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3462462&group_id=2439">Feature #3462462.</a>
+ </li>
+ <li>
+ CSS lexer gains support for SCSS.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3268017&group_id=2439">Feature #3268017.</a>
+ </li>
+ <li>
+ CPP lexer fixes problems in the preprocessor structure caused by continuation lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3458508&group_id=2439">Bug #3458508.</a>
+ </li>
+ <li>
+ Errorlist lexer handles column numbers for GCC format diagnostics.
+ In SciTE, Next Message goes to column where this can be decoded from GCC format diagnostics.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3453075&group_id=2439">Feature #3453075.</a>
+ </li>
+ <li>
+ HTML folder fixes spurious folds on some tags.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3459262&group_id=2439">Bug #3459262.</a>
+ </li>
+ <li>
+ Ruby lexer fixes bug where '=' at start of file caused whole file to appear as a comment.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3452488&group_id=2439">Bug #3452488.</a>
+ </li>
+ <li>
+ SQL folder folds blocks of single line comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3467425&group_id=2439">Feature #3467425.</a>
+ </li>
+ <li>
+ On Windows using Direct2D, defer invalidation of render target until completion of painting to avoid failures.
+ </li>
+ <li>
+ Further support of fractional positioning. Spaces, tabs, and single character tokens can take fractional space
+ and wrapped lines are positioned taking fractional positions into account.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3471998&group_id=2439">Bug #3471998.</a>
+ </li>
+ <li>
+ On Windows using Direct2D, fix extra carets appearing.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3471998&group_id=2439">Bug #3471998.</a>
+ </li>
+ <li>
+ For autocompletion lists Page Up and Down move by the list height instead of by 5 lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3455493&group_id=2439">Bug #3455493.</a>
+ </li>
+ <li>
+ For SCI_LINESCROLLDOWN/UP don't select into virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3451681&group_id=2439">Bug #3451681.</a>
+ </li>
+ <li>
+ Fix fold highlight not being fully drawn.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3469936&group_id=2439">Bug #3469936.</a>
+ </li>
+ <li>
+ Fix selection margin appearing black when starting in wrap mode.
+ </li>
+ <li>
+ Fix crash when changing end of document after adding an annotation.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3476637&group_id=2439">Bug #3476637.</a>
+ </li>
+ <li>
+ Fix problems with building to make RPMs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3476149&group_id=2439">Bug #3476149.</a>
+ </li>
+ <li>
+ Fix problem with building on GTK+ where recent distributions could not find gmodule.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3469056&group_id=2439">Bug #3469056.</a>
+ </li>
+ <li>
+ Fix problem with installing SciTE on GTK+ due to icon definition in .desktop file including an extension.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3476117&group_id=2439">Bug #3476117.</a>
+ </li>
+ <li>
+ Fix SciTE bug where new buffers inherited some properties from previously opened file.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3457060&group_id=2439">Bug #3457060.</a>
+ </li>
+ <li>
+ Fix focus when closing tab in SciTE with middle click. Focus moves to edit pane instead of staying on tab bar.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3440142&group_id=2439">Bug #3440142.</a>
+ </li>
+ <li>
+ For SciTE on Windows fix bug where Open Selected Filename for URL would append a file extension.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3459185&group_id=2439">Feature #3459185.</a>
+ </li>
+ <li>
+ For SciTE on Windows fix key handling of control characters in Parameters dialog so normal editing (Ctrl+C, ...) works.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3459345&group_id=2439">Bug #3459345.</a>
+ </li>
+ <li>
+ Fix SciTE bug where files became read-only after saving. Drop the "*" dirty marker after save completes.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3467432&group_id=2439">Bug #3467432.</a>
+ </li>
+ <li>
+ For SciTE handling of diffs with "+++" and "---" lines, also handle case where not followed by tab.
+ Go to correct line for diff "+++" message.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3467143&group_id=2439">Bug #3467143.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3467178&group_id=2439">Bug #3467178.</a>
+ </li>
+ <li>
+ SciTE on GTK+ now performs threaded actions even on GTK+ versions before 2.12.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite302.zip?download">Release 3.0.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released 9 December 2011.
+ </li>
+ <li>
+ SciTE saves files in the background without blocking the user interface.
+ </li>
+ <li>
+ Printing implemented in SciTE on GTK+ 3.x.
+ </li>
+ <li>
+ ILoader interface for background loading finalised and documented.
+ </li>
+ <li>
+ CoffeeScript lexer added.
+ </li>
+ <li>
+ C++ lexer fixes crash with "#if defined( XXX 1".
+ </li>
+ <li>
+ Crash with Direct2D on Windows fixed.
+ </li>
+ <li>
+ Backspace removing protected range fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3445911&group_id=2439">Bug #3445911.</a>
+ </li>
+ <li>
+ Cursor setting failure on Windows when screen saver on fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3438780&group_id=2439">Bug #3438780.</a>
+ </li>
+ <li>
+ SciTE on GTK+ hang fixed with -open:file option.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3441980&group_id=2439">Bug #3441980.</a>
+ </li>
+ <li>
+ Failure to evaluate shbang fixed in SciTE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3441801&group_id=2439">Bug #3441801.</a>
+ </li>
+ <li>
+ SciTE failure to treat files starting with "&lt;?xml" as XML fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3440718&group_id=2439">Bug #3440718.</a>
+ </li>
+ <li>
+ Made untitled tab saveable when created by closing all files.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3440244&group_id=2439">Bug #3440244.</a>
+ </li>
+ <li>
+ SciTE crash fixed when using Scintillua.
+ </li>
+ <li>
+ SciTE revert command fixed so that undo works on individual actions instead of undoing to revert point.
+ </li>
+ <li>
+ Focus loss in SciTE when opening a recent file fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3440142&group_id=2439">Bug #3440142.</a>
+ </li>
+ <li>
+ Fixed SciTE SelLength property to measure characters instead of bytes.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3283519&group_id=2439">Bug #3283519.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite301.zip?download">Release 3.0.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 15 November 2011.
+ </li>
+ <li>
+ SciTE on Windows now runs Lua scripts directly on the main thread instead of starting them on a
+ secondary thread and then moving back to the main thread.
+ </li>
+ <li>
+ Highlight "else" as a keyword for TCL in the same way as other languages.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1836954&group_id=2439">Bug #1836954.</a>
+ </li>
+ <li>
+ Fix problems with setting fonts for autocompletion lists on Windows where
+ font handles were copied and later deleted causing a system default font to be used.
+ </li>
+ <li>
+ Fix font size used on Windows for Asian language input methods which sometimes led to IME not being visible.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3436753&group_id=2439">Bug #3436753.</a>
+ </li>
+ <li>
+ Fixed polygon drawing on Windows so fold symbols are visible again.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3433558&group_id=2439">Bug #3433558.</a>
+ </li>
+ <li>
+ Changed background drawing on GTK+ to allow for fractional character positioning as occurs on OS X
+ as this avoids faint lines at lexeme boundaries.
+ </li>
+ <li>
+ Ensure pixmaps allocated before painting as there was a crash when Scintilla drew without common initialisation calls.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3432354&group_id=2439">Bug #3432354.</a>
+ </li>
+ <li>
+ Fixed SciTE on Windows bug causing wrong caret position after indenting a selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3433433&group_id=2439">Bug #3433433.</a>
+ </li>
+ <li>
+ Fixed SciTE session saving to store buffer position matching buffer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3434372&group_id=2439">Bug #3434372.</a>
+ </li>
+ <li>
+ Fixed leak of document objects in SciTE.
+ </li>
+ <li>
+ Recognise URL characters '?' and '%' for Open Selected command in SciTE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3429409&group_id=2439">Bug #3429409.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite300.zip?download">Release 3.0.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 November 2011.
+ </li>
+ <li>
+ Carbon platform support removed. OS X applications should switch to Cocoa.
+ </li>
+ <li>
+ On Windows Vista or newer, drawing may be performed with Direct2D and DirectWrite instead of GDI.
+ </li>
+ <li>
+ Cairo is now used for all drawing on GTK+. GDK drawing was removed.
+ </li>
+ <li>
+ Paletted display support removed.
+ </li>
+ <li>
+ Fractional font sizes can be specified.
+ </li>
+ <li>
+ Different weights of text supported on some platforms instead of just normal and bold.
+ </li>
+ <li>
+ Sub-pixel character positioning supported.
+ </li>
+ <li>
+ SciTE loads files in the background without blocking the user interface.
+ </li>
+ <li>
+ SciTE can display diagnostic messages interleaved with the text of files immediately after the
+ line referred to by the diagnostic.
+ </li>
+ <li>
+ New API to see if all lines are visible which can be used to optimize processing fold structure notifications.
+ </li>
+ <li>
+ Scrolling optimized by avoiding invalidation of fold margin when redrawing whole window.
+ </li>
+ <li>
+ Optimized SCI_MARKERNEXT.
+ </li>
+ <li>
+ C++ lexer supports Pike hash quoted strings when turned on with lexer.cpp.hashquoted.strings.
+ </li>
+ <li>
+ Fixed incorrect line height with annotations in wrapped mode when there are multiple views.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3388159&group_id=2439">Bug #3388159.</a>
+ </li>
+ <li>
+ Calltips may be displayed above the text as well as below.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3410830&group_id=2439">Bug #3410830.</a>
+ </li>
+ <li>
+ For huge files SciTE only examines the first megabyte for newline discovery.
+ </li>
+ <li>
+ SciTE on GTK+ removes the fileselector.show.hidden property and check box as this was buggy and GTK+ now
+ supports an equivalent feature.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3413630&group_id=2439">Bug #3413630.</a>
+ </li>
+ <li>
+ SciTE on GTK+ supports mnemonics in dynamic menus.
+ </li>
+ <li>
+ SciTE on GTK+ displays the user's home directory as '~' in menus to make them shorter.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite229.zip?download">Release 2.29</a>
+ </h3>
+ <ul>
+ <li>
+ Released 16 September 2011.
+ </li>
+ <li>
+ To automatically discover the encoding of a file when opening it, SciTE can run a program set with command.discover.properties.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3324341&group_id=2439">Feature #3324341.</a>
+ </li>
+ <li>
+ Cairo always used for drawing on GTK+.
+ </li>
+ <li>
+ The set of properties files imported by SciTE can be controlled with the properties imports.include and imports.exclude.
+ The import statement has been extended to allow "import *".
+ The properties files for some languages are no longer automatically loaded by default. The properties files affected are
+ avenue, baan, escript, lot, metapost, and mmixal.
+ </li>
+ <li>
+ C++ lexer fixed a bug with raw strings being recognised too easily.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3388122&group_id=2439">Bug #3388122.</a>
+ </li>
+ <li>
+ LaTeX lexer improved with more states and fixes to most outstanding bugs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1493111&group_id=2439">Bug #1493111.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1856356&group_id=2439">Bug #1856356.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3081692&group_id=2439">Bug #3081692.</a>
+ </li>
+ <li>
+ Lua lexer updates for Lua 5.2 beta with goto labels and "\z" string escape.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3386330&group_id=2439">Feature #3386330.</a>
+ </li>
+ <li>
+ Perl string styling highlights interpolated variables.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3394258&group_id=2439">Feature #3394258.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3076629&group_id=2439">Bug #3076629.</a>
+ </li>
+ <li>
+ Perl lexer updated for Perl 5.14.0 with 0X and 0B numeric literal prefixes, break keyword and "+" supported in subroutine prototypes.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3388802&group_id=2439">Feature #3388802.</a>
+ </li>
+ <li>
+ Perl bug fixed with CRLF line endings.
+ </li>
+ <li>
+ Markdown lexer fixed to not change state with "_" in middle of word.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3398184&group_id=2439">Bug #3398184.</a>
+ </li>
+ <li>
+ Cocoa restores compatibility with OS X 10.5.
+ </li>
+ <li>
+ Mouse pointer changes over selection to an arrow near start when scrolled horizontally.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3389055&group_id=2439">Bug #3389055.</a>
+ </li>
+ <li>
+ Indicators that finish at the end of the document no longer expand when text is appended.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3378718&group_id=2439">Bug #3378718.</a>
+ </li>
+ <li>
+ SparseState merge fixed to check if other range is empty.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3387053&group_id=2439">Bug #3387053.</a>
+ </li>
+ <li>
+ On Windows, autocompletion lists will scroll instead of document when mouse wheel spun.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3403600&group_id=2439">Feature #3403600.</a>
+ </li>
+ <li>
+ SciTE performs more rapid polling for command completion so will return faster and report more accurate times.
+ </li>
+ <li>
+ SciTE resizes panes proportionally when switched between horizontal and vertical layout.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3376784&group_id=2439">Feature #3376784.</a>
+ </li>
+ <li>
+ SciTE on GTK+ opens multiple files into a single instance more reliably.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3363754&group_id=2439">Bug #3363754.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite228.zip?download">Release 2.28</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 August 2011.
+ </li>
+ <li>
+ GTK+ Cairo support works back to GTK+ version 2.8. Requires changing Scintilla source code to enable before GTK+ 2.22.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3322351&group_id=2439">Bug #3322351.</a>
+ </li>
+ <li>
+ Translucent images in RGBA format can be used for margin markers and in autocompletion lists.
+ </li>
+ <li>
+ INDIC_DOTBOX added as a translucent dotted rectangular indicator.
+ </li>
+ <li>
+ Asian text input using IME works for GTK+ 3.x and GTK+ 2.x with Cairo.
+ </li>
+ <li>
+ On GTK+, IME works for Ctrl+Shift+U Unicode input in Scintilla. For SciTE, Ctrl+Shift+U is still Make Selection Uppercase.
+ </li>
+ <li>
+ Key bindings for GTK+ on OS X made compatible with Cocoa port and platform conventions.
+ </li>
+ <li>
+ Cocoa port supports different character encodings, improves scrolling performance and drag image appearance.
+ The control ID is included in WM_COMMAND notifications. Text may be deleted by dragging to the trash.
+ ScrollToStart and ScrollToEnd key commands added to simplify implementation of standard OS X Home and End
+ behaviour.
+ </li>
+ <li>
+ SciTE on GTK+ uses a paned widget to contain the edit and output panes instead of custom code.
+ This allows the divider to be moved easily on GTK+ 3 and its appearance follows GTK+ conventions more closely.
+ </li>
+ <li>
+ SciTE builds and installs on BSD.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3324644&group_id=2439">Bug #3324644.</a>
+ </li>
+ <li>
+ Cobol supports fixed format comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3014850&group_id=2439">Bug #3014850.</a>
+ </li>
+ <li>
+ Mako template language block syntax extended and ## comments recognised.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3325178&group_id=2439">Feature #3325178.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3318818&group_id=2439">Bug #3318818.</a>
+ </li>
+ <li>
+ Folding of Mako template language within HTML fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3324563&group_id=2439">Bug #3324563.</a>
+ </li>
+ <li>
+ Python lexer has lexer.python.keywords2.no.sub.identifiers option to avoid highlighting second set of
+ keywords following '.'.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3325333&group_id=2439">Bug #3325333.</a>
+ </li>
+ <li>
+ Python folder fixes bug where fold would not extend to final line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3349157&group_id=2439">Bug #3349157.</a>
+ </li>
+ <li>
+ SciTE treats LPEG lexers the same as script lexers by setting all 8 style bits.
+ </li>
+ <li>
+ For Cocoa, crashes with unsupported font variants and memory leaks for colour objects fixed.
+ </li>
+ <li>
+ Shift-JIS lead byte ranges modified to match Windows.
+ </li>
+ <li>
+ Mouse pointer changes over selection to an arrow more consistently.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3315756&group_id=2439">Bug #3315756.</a>
+ </li>
+ <li>
+ Bug fixed with annotations beyond end of document.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3347268&group_id=2439">Bug #3347268.</a>
+ </li>
+ <li>
+ Incorrect drawing fixed for combination of background colour change and translucent selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3377116&group_id=2439">Bug #3377116.</a>
+ </li>
+ <li>
+ Lexers initialized correctly when started at position other than start of line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3377148&group_id=2439">Bug #3377148.</a>
+ </li>
+ <li>
+ Fold highlight drawing fixed for some situations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3323015&group_id=2439">Bug #3323015.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3323805&group_id=2439">Bug #3323805.</a>
+ </li>
+ <li>
+ Case insensitive search fixed for cases where folded character uses fewer bytes than base character.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3362038&group_id=2439">Bug #3362038.</a>
+ </li>
+ <li>
+ SciTE bookmark.alpha setting fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3373907&group_id=2439">Bug #3373907.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite227.zip?download">Release 2.27</a>
+ </h3>
+ <ul>
+ <li>
+ Released 20 June 2011.
+ </li>
+ <li>
+ On recent GTK+ 2.x versions when using Cairo, bug fixed where wrong colours were drawn.
+ </li>
+ <li>
+ SciTE on GTK+ slow performance in menu maintenance fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3315233&group_id=2439">Bug #3315233.</a>
+ </li>
+ <li>
+ Cocoa platform supports 64-bit builds and uses only non-deprecated APIs.
+ Asian Input Method Editors are supported.
+ Autocompletion lists and calltips implemented.
+ Control identifier used in notifications.
+ </li>
+ <li>
+ On Cocoa, rectangular selection now uses Option/Alt key to be compatible with Apple Human
+ Interface Guidelines and other applications.
+ The Control key is reported with an SCMOD_META modifier bit.
+ </li>
+ <li>
+ API added for setting and retrieving the identifier number used in notifications.
+ </li>
+ <li>
+ SCI_SETEMPTYSELECTION added to set selection without scrolling or redrawing more than needed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3314877&group_id=2439">Feature #3314877.</a>
+ </li>
+ <li>
+ Added new indicators. INDIC_DASH and INDIC_DOTS are variants of underlines.
+ INDIC_SQUIGGLELOW indicator added as shorter alternative to INDIC_SQUIGGLE for small fonts.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3314591&group_id=2439">Bug #3314591</a>
+ </li>
+ <li>
+ Margin line selection can be changed to select display lines instead of document lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3312763&group_id=2439">Bug #3312763.</a>
+ </li>
+ <li>
+ On Windows, SciTE can perform reverse searches by pressing Shift+Enter
+ in the Find or Replace strips or dialogs.
+ </li>
+ <li>
+ Matlab lexer does not special case '\' in single quoted strings.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=948757&group_id=2439">Bug #948757</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1755950&group_id=2439">Bug #1755950</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1888738&group_id=2439">Bug #1888738</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3316852&group_id=2439">Bug #3316852.</a>
+ </li>
+ <li>
+ Verilog lexer supports SystemVerilog folding and keywords.
+ </li>
+ <li>
+ Font leak fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3306156&group_id=2439">Bug #3306156.</a>
+ </li>
+ <li>
+ Automatic scrolling works for long wrapped lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3312763&group_id=2439">Bug #3312763.</a>
+ </li>
+ <li>
+ Multiple typing works for cases where selections collapse together.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3309906&group_id=2439">Bug #3309906.</a>
+ </li>
+ <li>
+ Fold expanded when needed in word wrap mode.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3291579&group_id=2439">Bug #3291579.</a>
+ </li>
+ <li>
+ Bug fixed with edge drawn in wrong place on wrapped lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3314807&group_id=2439">Bug #3314807.</a>
+ </li>
+ <li>
+ Bug fixed with unnecessary scrolling for SCI_GOTOLINE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3303406&group_id=2439">Bug #3303406.</a>
+ </li>
+ <li>
+ Bug fixed where extra step needed to undo SCI_CLEAR in virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3159691&group_id=2439">Bug #3159691.</a>
+ </li>
+ <li>
+ Regular expression search fixed for \$ on last line of search range.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3313746&group_id=2439">Bug #3313746.</a>
+ </li>
+ <li>
+ SciTE performance improved when switching to a tab with a very large file.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3311421&group_id=2439">Bug #3311421.</a>
+ </li>
+ <li>
+ On Windows, SciTE advanced search remembers the "Search only in this style" setting.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3313344&group_id=2439">Bug #3313344.</a>
+ </li>
+ <li>
+ On GTK+, SciTE opens help using "xdg-open" instead of "netscape" as "netscape" no longer commonly installed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3314377&group_id=2439">Bug #3314377.</a>
+ </li>
+ <li>
+ SciTE script lexers can use 256 styles.
+ </li>
+ <li>
+ SciTE word highlight works for words containing DBCS characters.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3315173&group_id=2439">Bug #3315173.</a>
+ </li>
+ <li>
+ Compilation fixed for wxWidgets.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3306156&group_id=2439">Bug #3306156.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite226.zip?download">Release 2.26</a>
+ </h3>
+ <ul>
+ <li>
+ Released 25 May 2011.
+ </li>
+ <li>
+ Folding margin symbols can be highlighted for the current folding block.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3147069&group_id=2439">Feature #3147069.</a>
+ </li>
+ <li>
+ Selected lines can be moved up or down together.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3304850&group_id=2439">Feature #3304850.</a>
+ </li>
+ <li>
+ SciTE can highlight all occurrences of the current word or selected text.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3291636&group_id=2439">Feature #3291636.</a>
+ </li>
+ <li>
+ Experimental GTK+ 3.0 support: build with "make GTK3=1".
+ </li>
+ <li>
+ INDIC_STRAIGHTBOX added. Is similar to INDIC_ROUNDBOX but without rounded corners.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3290435&group_id=2439">Bug #3290435.</a>
+ </li>
+ <li>
+ Can show brace matching and mismatching with indicators instead of text style.
+ Translucency of outline can be altered for INDIC_ROUNDBOX and INDIC_STRAIGHTBOX.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3290434&group_id=2439">Feature #3290434.</a>
+ </li>
+ <li>
+ SciTE can automatically indent python by examining previous line for scope-starting ':' with indent.python.colon.
+ </li>
+ <li>
+ Batch file lexer allows braces '(' or ')' inside variable names.
+ </li>
+ <li>
+ The cpp lexer only recognises Vala triple quoted strings when lexer.cpp.triplequoted.strings property is set.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3239234&group_id=2439">Bug #3239234.</a>
+ </li>
+ <li>
+ Make file lexer treats a variable with a nested variable like $(f$(qx)b) as one variable.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3298223&group_id=2439">Bug #3298223.</a>
+ </li>
+ <li>
+ Folding bug fixed for JavaScript with nested PHP.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3193530&group_id=2439">Bug #3193530.</a>
+ </li>
+ <li>
+ HTML lexer styles Django's {# #} comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3013798&group_id=2439">Bug #3013798.</a>
+ </li>
+ <li>
+ HTML lexer styles JavaScript regular expression correctly for /abc/i.test('abc');.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3209108&group_id=2439">Bug #3209108.</a>
+ </li>
+ <li>
+ Inno Setup Script lexer now works properly when it restarts from middle of [CODE] section.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3283880&group_id=2439">Bug #3283880.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3129044&group_id=2439">Bug #3129044.</a>
+ </li>
+ <li>
+ Lua lexer updated for Lua 5.2 with hexadecimal floating-point numbers and '\*' whitespace escaping in strings.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3243811&group_id=2439">Feature #3243811.</a>
+ </li>
+ <li>
+ Perl folding folds "here doc"s and adds options fold.perl.at.else and fold.perl.comment.explicit. Fold structure for Perl fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3112671&group_id=2439">Feature #3112671.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3265401&group_id=2439">Bug #3265401.</a>
+ </li>
+ <li>
+ Python lexer supports cpdef keyword for Cython.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3279728&group_id=2439">Bug #3279728.</a>
+ </li>
+ <li>
+ SQL folding option lexer.sql.fold.at.else renamed to fold.sql.at.else.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3271474&group_id=2439">Bug #3271474.</a>
+ </li>
+ <li>
+ SQL lexer no longer treats ';' as terminating a comment.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3196071&group_id=2439">Bug #3196071.</a>
+ </li>
+ <li>
+ Text drawing and measurement segmented into smaller runs to avoid platform bugs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3277449&group_id=2439">Bug #3277449.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3165743&group_id=2439">Bug #3165743.</a>
+ </li>
+ <li>
+ SciTE on Windows adds temp.files.sync.load property to open dropped temporary files synchronously as they may
+ be removed before they can be opened asynchronously.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3072009&group_id=2439">Bug #3072009.</a>
+ </li>
+ <li>
+ Bug fixed with indentation guides ignoring first line in SC_IV_LOOKBOTH mode.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3291317&group_id=2439">Bug #3291317.</a>
+ </li>
+ <li>
+ Bugs fixed in backward regex search.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3292659&group_id=2439">Bug #3292659.</a>
+ </li>
+ <li>
+ Bugs with display of folding structure fixed for wrapped lines and where there is a fold header but no body.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3291579&group_id=2439">Bug #3291579.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3265401&group_id=2439">Bug #3265401.</a>
+ </li>
+ <li>
+ SciTE on Windows cursor changes to an arrow now when over horizontal splitter near top of window.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3286620&group_id=2439">Bug #3286620.</a>
+ </li>
+ <li>
+ Fixed default widget size problem on GTK+.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3267892&group_id=2439">Bug #3267892.</a>
+ </li>
+ <li>
+ Fixed font size when using Cairo on GTK+.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3272662&group_id=2439">Bug #3272662.</a>
+ </li>
+ <li>
+ Fixed primary selection and cursor issues on GTK+ when unrealized then realized.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3256153&group_id=2439">Bug #3256153.</a>
+ </li>
+ <li>
+ Right click now cancels selection on GTK+ like on Windows.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3235190&group_id=2439">Bug #3235190.</a>
+ </li>
+ <li>
+ SciTE on GTK+ implements z-order buffer switching like on Windows.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3228384&group_id=2439">Bug #3228384.</a>
+ </li>
+ <li>
+ Improve selection position after SciTE Insert Abbreviation command when abbreviation expansion includes '|'.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite225.zip?download">Release 2.25</a>
+ </h3>
+ <ul>
+ <li>
+ Released 21 March 2011.
+ </li>
+ <li>
+ SparseState class makes it easier to write lexers which have to remember complex state between lines.
+ </li>
+ <li>
+ Visual Studio project (.dsp) files removed. The make files should be used instead as described in the README.
+ </li>
+ <li>
+ Modula 3 lexer added along with SciTE support.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3173374&group_id=2439">Feature #3173374.</a>
+ </li>
+ <li>
+ Asm, Basic, and D lexers add extra folding properties.
+ </li>
+ <li>
+ Raw string literals for C++0x supported in C++ lexer.
+ </li>
+ <li>
+ Triple-quoted strings used in Vala language supported in C++ lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3177601&group_id=2439">Feature #3177601.</a>
+ </li>
+ <li>
+ The errorlist lexer used in SciTE's output pane colours lines that start with '&lt;' as diff deletions.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3172878&group_id=2439">Feature #3172878.</a>
+ </li>
+ <li>
+ The Fortran lexer correctly folds type-bound procedures from Fortran 2003.
+ </li>
+ <li>
+ LPeg lexer support‎ improved in SciTE.
+ </li>
+ <li>
+ SciTE on Windows-64 fixes for menu localisation and Lua scripts.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3204502&group_id=2439">Bug #3204502.</a>
+ </li>
+ <li>
+ SciTE on Windows avoids locking folders when using the open or save dialogs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1795484&group_id=2439">Bug #1795484.</a>
+ </li>
+ <li>
+ Diff lexer fixes problem where diffs of diffs producing lines that start with "----".
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3197952&group_id=2439">Bug #3197952.</a>
+ </li>
+ <li>
+ Bug fixed when searching upwards in Chinese code page 936.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3176271&group_id=2439">Bug #3176271.</a>
+ </li>
+ <li>
+ On Cocoa, translucent drawing performed as on other platforms instead of 2.5 times less translucent.
+ </li>
+ <li>
+ Performance issue and potential bug fixed on GTK+ with caret line for long lines.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite224.zip?download">Release 2.24</a>
+ </h3>
+ <ul>
+ <li>
+ Released 3 February 2011.
+ </li>
+ <li>
+ Fixed memory leak in GTK+ Cairo code.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3157655&group_id=2439">Feature #3157655.</a>
+ </li>
+ <li>
+ Insert Abbreviation dialog added to SciTE on GTK+.
+ </li>
+ <li>
+ SCN_UPDATEUI notifications received when window scrolled. An 'updated' bit mask indicates which
+ types of update have occurred from SC_UPDATE_SELECTION, SC_UPDATE_CONTENT, SC_UPDATE_H_SCROLL
+ or SC_UPDATE_V_SCROLL.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3125977&group_id=2439">Feature #3125977.</a>
+ </li>
+ <li>
+ On Windows, to ensure reverse arrow cursor matches platform default, it is now generated by
+ reflecting the platform arrow cursor.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3143968&group_id=2439">Feature #3143968.</a>
+ </li>
+ <li>
+ Can choose mouse cursor used in margins.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3161326&group_id=2439">Feature #3161326.</a>
+ </li>
+ <li>
+ On GTK+, SciTE sets a mime type of text/plain in its .desktop file so that it will appear in the shell context menu.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3137126&group_id=2439">Feature #3137126.</a>
+ </li>
+ <li>
+ Bash folder handles here docs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3118223&group_id=2439">Feature #3118223.</a>
+ </li>
+ <li>
+ C++ folder adds fold.cpp.syntax.based, fold.cpp.comment.multiline, fold.cpp.explicit.start, fold.cpp.explicit.end,
+ and fold.cpp.explicit.anywhere properties to allow more control over folding and choice of explicit fold markers.
+ </li>
+ <li>
+ C++ lexer fixed to always handle single quote strings continued past a line end.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3150522&group_id=2439">Bug #3150522.</a>
+ </li>
+ <li>
+ Ruby folder handles here docs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3118224&group_id=2439">Feature #3118224.</a>
+ </li>
+ <li>
+ SQL lexer allows '.' to be part of words.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3103129&group_id=2439">Feature #3103129.</a>
+ </li>
+ <li>
+ SQL folder handles case statements in more situations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3135027&group_id=2439">Feature #3135027.</a>
+ </li>
+ <li>
+ SQL folder adds fold points inside expressions based on bracket structure.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3165488&group_id=2439">Feature #3165488.</a>
+ </li>
+ <li>
+ SQL folder drops fold.sql.exists property as 'exists' is handled automatically.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3164194&group_id=2439">Bug #3164194.</a>
+ </li>
+ <li>
+ SciTE only forwards properties to lexers when they have been explicitly set so the defaults set by lexers are used
+ rather than 0.
+ </li>
+ <li>
+ Mouse double click word selection chooses the word around the character under the mouse rather than
+ the inter-character position under the mouse. This makes double clicking select what the user is pointing
+ at and avoids selecting adjacent non-word characters.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3111174&group_id=2439">Bug #3111174.</a>
+ </li>
+ <li>
+ Fixed mouse double click to always perform word select, not line select.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3143635&group_id=2439">Bug #3143635.</a>
+ </li>
+ <li>
+ Right click cancels autocompletion.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3144531&group_id=2439">Bug #3144531.</a>
+ </li>
+ <li>
+ Fixed multiPaste to work when additionalSelectionTyping off.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3126221&group_id=2439">Bug #3126221.</a>
+ </li>
+ <li>
+ Fixed virtual space problems when text modified at caret.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3154986&group_id=2439">Bug #3154986.</a>
+ </li>
+ <li>
+ Fixed memory leak in lexer object code.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3133672&group_id=2439">Bug #3133672.</a>
+ </li>
+ <li>
+ Fixed SciTE on GTK+ search failure when using regular expression.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3156217&group_id=2439">Bug #3156217.</a>
+ </li>
+ <li>
+ Avoid unnecessary full window redraw for SCI_GOTOPOS.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3146650&group_id=2439">Feature #3146650.</a>
+ </li>
+ <li>
+ Avoid unnecessary redraw when indicator fill range makes no real change.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite223.zip?download">Release 2.23</a>
+ </h3>
+ <ul>
+ <li>
+ Released 7 December 2010.
+ </li>
+ <li>
+ On GTK+ version 2.22 and later, drawing is performed with Cairo rather than GDK.
+ This is in preparation for GTK+ 3.0 which will no longer support GDK drawing.
+ The appearance of some elements will be different with Cairo as it is anti-aliased and uses sub-pixel positioning.
+ Cairo may be turned on for GTK+ versions before 2.22 by defining USE_CAIRO although this has not
+ been extensively tested.
+ </li>
+ <li>
+ New lexer a68k for Motorola 68000 assembler.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3101598&group_id=2439">Feature #3101598.</a>
+ </li>
+ <li>
+ Borland C++ is no longer supported for building Scintilla or SciTE on Windows.
+ </li>
+ <li>
+ Performance improved when creating large rectangular selections.
+ </li>
+ <li>
+ PHP folder recognises #region and #endregion comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3101624&group_id=2439">Feature #3101624.</a>
+ </li>
+ <li>
+ SQL lexer has a lexer.sql.numbersign.comment option to turn off use of '#' comments
+ as these are a non-standard feature only available in some implementations.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3098071&group_id=2439">Feature #3098071.</a>
+ </li>
+ <li>
+ SQL folder recognises case statements and understands the fold.at.else property.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3104091&group_id=2439">Bug #3104091.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3107362&group_id=2439">Bug #3107362.</a>
+ </li>
+ <li>
+ SQL folder fixes bugs with end statements when fold.sql.only.begin=1.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3104091&group_id=2439">Bug #3104091.</a>
+ </li>
+ <li>
+ SciTE on Windows bug fixed with multi-line tab bar not adjusting correctly when maximizing and demaximizing.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3097517&group_id=2439">Bug #3097517.</a>
+ </li>
+ <li>
+ Crash fixed on GTK+ when Scintilla widget destroyed while it still has an outstanding style idle pending.
+ </li>
+ <li>
+ Bug fixed where searching backwards in DBCS text (code page 936 or similar) failed to find occurrences at the start of the line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3103936&group_id=2439">Bug #3103936.</a>
+ </li>
+ <li>
+ SciTE on Windows supports Unicode file names when executing help applications with winhelp and htmlhelp subsystems.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite222.zip?download">Release 2.22</a>
+ </h3>
+ <ul>
+ <li>
+ Released 27 October 2010.
+ </li>
+ <li>
+ SciTE includes support for integrating with Scintillua which allows lexers to be implemented in Lua as a
+ Parsing Expression Grammar (PEG).
+ </li>
+ <li>
+ Regular expressions allow use of '?' for non-greedy matches or to match 0 or 1 instances of an item.
+ </li>
+ <li>
+ SCI_CONTRACTEDFOLDNEXT added to allow rapid retrieval of folding state.
+ </li>
+ <li>
+ SCN_HOTSPOTRELEASECLICK notification added which is similar to SCN_HOTSPOTCLICK but occurs
+ when the mouse is released.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3082409&group_id=2439">Feature #3082409.</a>
+ </li>
+ <li>
+ Command added for centring current line in window.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3064696&group_id=2439">Feature #3064696.</a>
+ </li>
+ <li>
+ SciTE performance improved by not examining document for line ends when switching buffers and not
+ storing folds when folding turned off.
+ </li>
+ <li>
+ Bug fixed where scrolling to ensure the caret is visible did not take into account all pixels of the line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3081721&group_id=2439">Bug #3081721.</a>
+ </li>
+ <li>
+ Bug fixed for autocompletion list overlapping text when WS_EX_CLIENTEDGE used.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3079778&group_id=2439">Bug #3079778.</a>
+ </li>
+ <li>
+ After autocompletion, the caret's X is updated.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3079114&group_id=2439">Bug #3079114.</a>
+ </li>
+ <li>
+ On Windows, default to the system caret blink time.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3079784&group_id=2439">Feature #3079784.</a>
+ </li>
+ <li>
+ PgUp/PgDn fixed to allow virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3077452&group_id=2439">Bug #3077452.</a>
+ </li>
+ <li>
+ Crash fixed when AddMark and AddMarkSet called with negative argument.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3075074&group_id=2439">Bug #3075074.</a>
+ </li>
+ <li>
+ Dwell notifications fixed so that they do not occur when the mouse is outside Scintilla.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3073481&group_id=2439">Bug #3073481.</a>
+ </li>
+ <li>
+ Bash lexer bug fixed for here docs starting with &lt;&lt;-.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3063822&group_id=2439">Bug #3063822.</a>
+ </li>
+ <li>
+ C++ lexer bug fixed for // comments that are continued onto a second line by a \.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3066031&group_id=2439">Bug #3066031.</a>
+ </li>
+ <li>
+ C++ lexer fixes wrong highlighting for float literals containing +/-.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3058924&group_id=2439">Bug #3058924.</a>
+ </li>
+ <li>
+ JavaScript lexer recognise regexes following return keyword.‎
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3062287&group_id=2439">Bug #3062287.</a>
+ </li>
+ <li>
+ Ruby lexer handles % quoting better and treats range dots as operators in 1..2 and 1...2.
+ Ruby folder handles "if" keyword used as a modifier even when it is separated from the modified statement by an escaped new line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2093767&group_id=2439">Bug #2093767.</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3058496&group_id=2439">Bug #3058496.</a>
+ </li>
+ <li>
+ Bug fixed where upwards search failed with DBCS code pages.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3065912&group_id=2439">Bug #3065912.</a>
+ </li>
+ <li>
+ SciTE has a default Lua startup script name distributed in SciTEGlobal.properties.
+ No error message is displayed if this file does not exist.
+ </li>
+ <li>
+ SciTE on Windows tab control height is calculated better.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2635702&group_id=2439">Bug #2635702.</a>
+ </li>
+ <li>
+ SciTE on Windows uses better themed check buttons in find and replace strips.
+ </li>
+ <li>
+ SciTE on Windows fixes bug with Find strip appearing along with Incremental Find strip.
+ </li>
+ <li>
+ SciTE setting find.close.on.find added to allow preventing the Find dialog from closing.
+ </li>
+ <li>
+ SciTE on Windows attempts to rerun commands that fail by prepending them with "cmd.exe /c".
+ This allows commands built in to the command processor like "dir" to run.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite221.zip?download">Release 2.21</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 September 2010.
+ </li>
+ <li>
+ Asian Double Byte Character Set (DBCS) support improved.
+ Case insensitive search works and other operations are much faster.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2999125&group_id=2439">Bug #2999125,</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2774616&group_id=2439">Bug #2774616,</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2991942&group_id=2439">Bug #2991942,</a>
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3005688&group_id=2439">Bug #3005688.</a>
+ </li>
+ <li>
+ Scintilla on GTK+ uses only non-deprecated APIs (for GTK+ 2.20) except for GdkFont and GdkFont use can be disabled
+ with the preprocessor symbol DISABLE_GDK_FONT.
+ </li>
+ <li>
+ IDocument interface used by lexers adds BufferPointer and GetLineIndentation methods.
+ </li>
+ <li>
+ On Windows, clicking sets focus before processing the click or sending notifications.
+ </li>
+ <li>
+ Bug on OS X (macosx platform) fixed where drag/drop overwrote clipboard.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3039732&group_id=2439">Bug #3039732.</a>
+ </li>
+ <li>
+ GTK+ drawing bug when the view was horizontally scrolled more than 32000 pixels fixed.
+ </li>
+ <li>
+ SciTE bug fixed with invoking Complete Symbol from output pane.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3050957&group_id=2439">Bug #3050957.</a>
+ </li>
+ <li>
+ Bug fixed where it was not possible to disable folding.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3040649&group_id=2439">Bug #3040649.</a>
+ </li>
+ <li>
+ Bug fixed with pressing Enter on a folded fold header line not opening the fold.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3043419&group_id=2439">Bug #3043419.</a>
+ </li>
+ <li>
+ SciTE 'Match case' option in find and replace user interfaces changed to 'Case sensitive' to allow use of 'v'
+ rather than 'c' as the mnemonic.
+ </li>
+ <li>
+ SciTE displays stack trace for Lua when error occurs..
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3051397&group_id=2439">Bug #3051397.</a>
+ </li>
+ <li>
+ SciTE on Windows fixes bug where double clicking on error message left focus in output pane.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1264835&group_id=2439">Bug #1264835.</a>
+ </li>
+ <li>
+ SciTE on Windows uses SetDllDirectory to avoid a security problem.
+ </li>
+ <li>
+ C++ lexer crash fixed with preprocessor expression that looked like division by 0.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3056825&group_id=2439">Bug #3056825.</a>
+ </li>
+ <li>
+ Haskell lexer improved.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3039490&group_id=2439">Feature #3039490.</a>
+ </li>
+ <li>
+ HTML lexing fixed around Django {% %} tags.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3034853&group_id=2439">Bug #3034853.</a>
+ </li>
+ <li>
+ HTML JavaScript lexing fixed when line end escaped.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3038381&group_id=2439">Bug #3038381.</a>
+ </li>
+ <li>
+ HTML lexer stores line state produced by a line on that line rather than on the next line.
+ </li>
+ <li>
+ Markdown lexer fixes infinite loop.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3045386&group_id=2439">Bug #3045386.</a>
+ </li>
+ <li>
+ MySQL folding bugs with END statements fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3031742&group_id=2439">Bug #3031742.</a>
+ </li>
+ <li>
+ PowerShell lexer allows '_' as a word character.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3042228&group_id=2439">Feature #3042228.</a>
+ </li>
+ <li>
+ SciTE on GTK+ abandons processing of subsequent commands if a command.go.needs command fails.
+ </li>
+ <li>
+ When SciTE is closed, all buffers now receive an OnClose call.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3033857&group_id=2439">Bug #3033857.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite220.zip?download">Release 2.20</a>
+ </h3>
+ <ul>
+ <li>
+ Released 30 July 2010.
+ </li>
+ <li>
+ Lexers are implemented as objects so that they may retain extra state.
+ The interfaces defined for this are tentative and may change before the next release.
+ Compatibility classes allow current lexers compiled into Scintilla to run with few changes.
+ The interface to external lexers has changed and existing external lexers will need to have changes
+ made and be recompiled.
+ A single lexer object is attached to a document whereas previously lexers were attached to views
+ which could lead to different lexers being used for split views with confusing results.
+ </li>
+ <li>
+ C++ lexer understands the preprocessor enough to grey-out inactive code due to conditional compilation.
+ </li>
+ <li>
+ SciTE can use strips within the main window for find and replace rather than dialogs.
+ On Windows SciTE always uses a strip for incremental search.
+ </li>
+ <li>
+ Lexer added for Txt2Tags language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3018736&group_id=2439">Feature #3018736.</a>
+ </li>
+ <li>
+ Sticky caret feature enhanced with additional SC_CARETSTICKY_WHITESPACE mode .
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3027559&group_id=2439">Feature #3027559.</a>
+ </li>
+ <li>
+ Bash lexer implements basic parsing of compound commands and constructs.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3033135&group_id=2439">Feature #3033135.</a>
+ </li>
+ <li>
+ C++ folder allows disabling explicit fold comments.
+ </li>
+ <li>
+ Perl folder works for array blocks, adjacent package statements, nested PODs, and terminates package folding at __DATA__, ^D and ^Z.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3030887&group_id=2439">Feature #3030887.</a>
+ </li>
+ <li>
+ PowerShell lexer supports multiline &lt;# .. #&gt; comments and adds 2 keyword classes.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3015176&group_id=2439">Feature #3015176.</a>
+ </li>
+ <li>
+ Lexing performed incrementally when needed by wrapping to make user interface more responsive.
+ </li>
+ <li>
+ SciTE setting replaceselection:yes works on GTK+.
+ </li>
+ <li>
+ SciTE Lua scripts calling io.open or io.popen on Windows have arguments treated as UTF-8 and converted to Unicode
+ so that non-ASCII file paths will work. Lua files with non-ASCII paths run.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3016951&group_id=2439">Bug #3016951.</a>
+ </li>
+ <li>
+ Crash fixed when searching for empty string.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3017572&group_id=2439">Bug #3017572.</a>
+ </li>
+ <li>
+ Bugs fixed with folding and lexing when Enter pressed at start of line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3032652&group_id=2439">Bug #3032652.</a>
+ </li>
+ <li>
+ Bug fixed with line selection mode not affecting selection range.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3021480&group_id=2439">Bug #3021480.</a>
+ </li>
+ <li>
+ Bug fixed where indicator alpha was limited to 100 rather than 255.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3021473&group_id=2439">Bug #3021473.</a>
+ </li>
+ <li>
+ Bug fixed where changing annotation did not cause automatic redraw.
+ </li>
+ <li>
+ Regular expression bug fixed when a character range included non-ASCII characters.
+ </li>
+ <li>
+ Compilation failure with recent compilers fixed on GTK+.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3022027&group_id=2439">Bug #3022027.</a>
+ </li>
+ <li>
+ Bug fixed on Windows with multiple monitors where autocomplete pop up would appear off-screen
+ or straddling monitors.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3017512&group_id=2439">Bug #3017512.</a>
+ </li>
+ <li>
+ SciTE on Windows bug fixed where changing directory to a Unicode path failed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3011987&group_id=2439">Bug #3011987.</a>
+ </li>
+ <li>
+ SciTE on Windows bug fixed where combo boxes were not allowing Unicode characters.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3012986&group_id=2439">Bug #3012986.</a>
+ </li>
+ <li>
+ SciTE on GTK+ bug fixed when dragging files into SciTE on KDE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3026555&group_id=2439">Bug #3026555.</a>
+ </li>
+ <li>
+ SciTE bug fixed where closing untitled file could lose data if attempt to name file same as another buffer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3011680&group_id=2439">Bug #3011680.</a>
+ </li>
+ <li>
+ COBOL number masks now correctly highlighted.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3012164&group_id=2439">Bug #3012164.</a>
+ </li>
+ <li>
+ PHP comments can include &lt;?PHP without triggering state change.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2854183&group_id=2439">Bug #2854183.</a>
+ </li>
+ <li>
+ VHDL lexer styles unclosed string correctly.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3029627&group_id=2439">Bug #3029627.</a>
+ </li>
+ <li>
+ Memory leak fixed in list boxes on GTK+.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3007669&group_id=2439">Bug #3007669.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite212.zip?download">Release 2.12</a>
+ </h3>
+ <ul>
+ <li>
+ Released 1 June 2010.
+ </li>
+ <li>
+ Drawing optimizations improve speed and fix some visible flashing when scrolling.
+ </li>
+ <li>
+ Copy Path command added to File menu in SciTE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2986745&group_id=2439">Feature #2986745.</a>
+ </li>
+ <li>
+ Optional warning displayed by SciTE when saving a file which has been modified by another process.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2975041&group_id=2439">Feature #2975041.</a>
+ </li>
+ <li>
+ Flagship lexer for xBase languages updated to follow the language much more closely.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2992689&group_id=2439">Feature #2992689.</a>
+ </li>
+ <li>
+ HTML lexer highlights Django templates in more regions.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3002874&group_id=2439">Feature #3002874.</a>
+ </li>
+ <li>
+ Dropping files on SciTE on Windows, releases the drag object earlier and opens the files asynchronously,
+ leading to smoother user experience.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2986724&group_id=2439">Feature #2986724.</a>
+ </li>
+ <li>
+ SciTE HTML exports take the Use Monospaced Font setting into account.
+ </li>
+ <li>
+ SciTE window title "[n of m]" localised.
+ </li>
+ <li>
+ When new line inserted at start of line, markers are moved down.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2986727&group_id=2439">Bug #2986727.</a>
+ </li>
+ <li>
+ On Windows, dropped text has its line ends converted, similar to pasting.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3005328&group_id=2439">Bug #3005328.</a>
+ </li>
+ <li>
+ Fixed bug with middle-click paste in block select mode where text was pasted next to selection rather than at cursor.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2984460&group_id=2439">Bug #2984460.</a>
+ </li>
+ <li>
+ Fixed SciTE crash where a style had a size parameter without a value.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3003834&group_id=2439">Bug #3003834.</a>
+ </li>
+ <li>
+ Debug assertions in multiple lexers fixed.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3000566&group_id=2439">Bug #3000566.</a>
+ </li>
+ <li>
+ CSS lexer fixed bug where @font-face displayed incorrectly
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2994224&group_id=2439">Bug #2994224.</a>
+ </li>
+ <li>
+ CSS lexer fixed bug where open comment caused highlighting error.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1683672&group_id=2439">Bug #1683672.</a>
+ </li>
+ <li>
+ Shell file lexer fixed highlight glitch with here docs where the first line is a comment.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2830239&group_id=2439">Bug #2830239.</a>
+ </li>
+ <li>
+ Bug fixed in SciTE openpath property that caused Open Selected File to fail to open the selected file.
+ </li>
+ <li>
+ Bug fixed in SciTE FileExt property when file name with no extension evaluated to whole path.
+ </li>
+ <li>
+ Fixed SciTE on Windows printing bug where the $(CurrentTime), $(CurrentPage) variables were not expanded.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2994612&group_id=2439">Bug #2994612.</a>
+ </li>
+ <li>
+ SciTE compiles for 64-bit Windows and runs without crashing.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2986312&group_id=2439">Bug #2986312.</a>
+ </li>
+ <li>
+ Full Screen mode in Windows Vista/7 improved to hide Start button and size borders a little better.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3002813&group_id=2439">Bug #3002813.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite211.zip?download">Release 2.11</a>
+ </h3>
+ <ul>
+ <li>
+ Released 9 April 2010.
+ </li>
+ <li>
+ Fixes compatibility of Scintilla.h with the C language.
+ </li>
+ <li>
+ With a rectangular selection SCI_GETSELECTIONSTART and SCI_GETSELECTIONEND return limits of the
+ rectangular selection rather than the limits of the main selection.
+ </li>
+ <li>
+ When SciTE on Windows is minimized to tray, only takes a single click to restore rather than a double click.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=981917&group_id=2439">Feature #981917.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite210.zip?download">Release 2.10</a>
+ </h3>
+ <ul>
+ <li>
+ Released 4 April 2010.
+ </li>
+ <li>
+ Version 1.x of GTK+ is no longer supported.
+ </li>
+ <li>
+ SciTE is no longer supported on Windows 95, 98 or ME.
+ </li>
+ <li>
+ Case-insensitive search works for non-ASCII characters in UTF-8 and 8-bit encodings.
+ Non-regex search in DBCS encodings is always case-sensitive.
+ </li>
+ <li>
+ Non-ASCII characters may be changed to upper and lower case.
+ </li>
+ <li>
+ SciTE on Windows can access all files including those with names outside the user's preferred character encoding.
+ </li>
+ <li>
+ SciTE may be extended with lexers written in Lua.
+ </li>
+ <li>
+ When there are multiple selections, the paste command can go either to the main selection or to each
+ selection. This is controlled with SCI_SETMULTIPASTE.
+ </li>
+ <li>
+ More forms of bad UTF-8 are detected including overlong sequences, surrogates, and characters outside
+ the valid range. Bad UTF-8 bytes are now displayed as 2 hex digits preceded by 'x'.
+ </li>
+ <li>
+ SCI_GETTAG retrieves the value of captured expressions within regular expression searches.
+ </li>
+ <li>
+ Django template highlighting added to the HTML lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2974889&group_id=2439">Feature #2974889.</a>
+ </li>
+ <li>
+ Verilog line comments can be folded.
+ </li>
+ <li>
+ SciTE on Windows allows specifying a filter for the Save As dialog.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2943445&group_id=2439">Feature #2943445.</a>
+ </li>
+ <li>
+ Bug fixed when multiple selection disabled where rectangular selections could be expanded into multiple selections.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2948260&group_id=2439">Bug #2948260.</a>
+ </li>
+ <li>
+ Bug fixed when document horizontally scrolled and up/down-arrow did not return to the same
+ column after horizontal scroll occurred.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2950799&group_id=2439">Bug #2950799.</a>
+ </li>
+ <li>
+ Bug fixed to remove hotspot highlight when mouse is moved out of the document. Windows only fix.
+ <a href="https://sourceforge.net/tracker/?func=detail&aid=2951353&group_id=2439&atid=102439">Bug #2951353.</a>
+ </li>
+ <li>
+ R lexer now performs case-sensitive check for keywords.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2956543&group_id=2439">Bug #2956543.</a>
+ </li>
+ <li>
+ Bug fixed on GTK+ where text disappeared when a wrap occurred.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2958043&group_id=2439">Bug #2958043.</a>
+ </li>
+ <li>
+ Bug fixed where regular expression replace cannot escape the '\' character by using '\\'.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2959876&group_id=2439">Bug #2959876.</a>
+ </li>
+ <li>
+ Bug fixed on GTK+ when virtual space disabled, middle-click could still paste text beyond end of line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2971618&group_id=2439">Bug #2971618.</a>
+ </li>
+ <li>
+ SciTE crash fixed when double clicking on a malformed error message in the output pane.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2976551&group_id=2439">Bug #2976551.</a>
+ </li>
+ <li>
+ Improved performance on GTK+ when changing parameters associated with scroll bars to the same value.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2964357&group_id=2439">Bug #2964357.</a>
+ </li>
+ <li>
+ Fixed bug with pressing Shift+Tab with a rectangular selection so that it performs an un-indent
+ similar to how Tab performs an indent.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite203.zip?download">Release 2.03</a>
+ </h3>
+ <ul>
+ <li>
+ Released 14 February 2010.
+ </li>
+ <li>
+ Added SCI_SETFIRSTVISIBLELINE to match SCI_GETFIRSTVISIBLELINE.
+ </li>
+ <li>
+ Erlang lexer extended set of numeric bases recognised; separate style for module:function_name; detects
+ built-in functions, known module attributes, and known preprocessor instructions; recognises EDoc and EDoc macros;
+ separates types of comments.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2942448&group_id=2439">Bug #2942448.</a>
+ </li>
+ <li>
+ Python lexer extended with lexer.python.strings.over.newline option that allows non-triple-quoted strings to extend
+ past line ends. This allows use of the Ren'Py language.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2945550&group_id=2439">Feature #2945550.</a>
+ </li>
+ <li>
+ Fixed bugs with cursor movement after deleting a rectangular selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2942131&group_id=2439">Bug #2942131.</a>
+ </li>
+ <li>
+ Fixed bug where calling SCI_SETSEL when there is a rectangular selection left
+ the additional selections selected.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2947064&group_id=2439">Bug #2947064.</a>
+ </li>
+ <li>
+ Fixed macro recording bug where not all bytes in multi-byte character insertions were reported through
+ SCI_REPLACESEL.
+ </li>
+ <li>
+ Fixed SciTE bug where using Ctrl+Enter followed by Ctrl+Space produced an autocompletion list
+ with only a single line containing all the identifiers.
+ </li>
+ <li>
+ Fixed SciTE on GTK+ bug where running a tool made the user interface completely unresponsive.
+ </li>
+ <li>
+ Fixed SciTE on Windows Copy to RTF bug.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2108574&group_id=2439">Bug #2108574.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite202.zip?download">Release 2.02</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 25 January 2010.
+ </li>
+ <li>
+ Markdown lexer added.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2844081&group_id=2439">Feature #2844081.</a>
+ </li>
+ <li>
+ On GTK+, include code that understands the ranges of lead bytes for code pages 932, 936, and 950
+ so that most Chinese and Japanese text can be used on systems that are not set to the corresponding locale.
+ </li>
+ <li>
+ Allow changing the size of dots in visible whitespace using SCI_SETWHITESPACESIZE.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2839427&group_id=2439">Feature #2839427.</a>
+ </li>
+ <li>
+ Additional carets can be hidden with SCI_SETADDITIONALCARETSVISIBLE.
+ </li>
+ <li>
+ Can choose anti-aliased, non-anti-aliased or lcd-optimized text using SCI_SETFONTQUALITY.
+ </li>
+ <li>
+ Retrieve the current selected text in the autocompletion list with SCI_AUTOCGETCURRENTTEXT.
+ </li>
+ <li>
+ Retrieve the name of the current lexer with SCI_GETLEXERLANGUAGE.
+ </li>
+ <li>
+ Progress 4GL lexer improves handling of comments in preprocessor declaration.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2902206&group_id=2439">Feature #2902206.</a>
+ </li>
+ <li>
+ HTML lexer extended to handle Mako template language.
+ </li>
+ <li>
+ SQL folder extended for SQL Anywhere "EXISTS" and "ENDIF" keywords.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2887524&group_id=2439">Feature #2887524.</a>
+ </li>
+ <li>
+ SciTE adds APIPath and AbbrevPath variables.
+ </li>
+ <li>
+ SciTE on GTK+ uses pipes instead of temporary files for running tools. This should be more secure.
+ </li>
+ <li>
+ Fixed crash when calling SCI_STYLEGETFONT for a style which does not have a font set.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2857425&group_id=2439">Bug #2857425.</a>
+ </li>
+ <li>
+ Fixed crash caused by not having sufficient styles allocated after choosing a lexer.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2881279&group_id=2439">Bug #2881279.</a>
+ </li>
+ <li>
+ Fixed crash in SciTE using autocomplete word when word characters includes space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2840141&group_id=2439">Bug #2840141.</a>
+ </li>
+ <li>
+ Fixed bug with handling upper-case file extensions SciTE on GTK+.
+ </li>
+ <li>
+ Fixed SciTE loading files from sessions with folded folds where it would not
+ be scrolled to the correct location.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2882775&group_id=2439">Bug #2882775.</a>
+ </li>
+ <li>
+ Fixed SciTE loading files from sessions when file no longer exists.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2883437&group_id=2439">Bug #2883437.</a>
+ </li>
+ <li>
+ Fixed SciTE export to HTML using the wrong background colour.
+ </li>
+ <li>
+ Fixed crash when adding an annotation and then adding a new line after the annotation.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2929708&group_id=2439">Bug #2929708.</a>
+ </li>
+ <li>
+ Fixed crash in SciTE setting a property to nil from Lua.
+ </li>
+ <li>
+ SCI_GETSELTEXT fixed to return correct length.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2929441&group_id=2439">Bug #2929441.</a>
+ </li>
+ <li>
+ Fixed text positioning problems with selection in some circumstances.
+ </li>
+ <li>
+ Fixed text positioning problems with ligatures on GTK+.
+ </li>
+ <li>
+ Fixed problem pasting into rectangular selection with caret at bottom caused text to go from the caret down
+ rather than replacing the selection.
+ </li>
+ <li>
+ Fixed problem replacing in a rectangular selection where only the final line was changed.
+ </li>
+ <li>
+ Fixed inability to select a rectangular area using Alt+Shift+Click at both corners.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2899746&group_id=2439">Bug #2899746.</a>
+ </li>
+ <li>
+ Fixed problem moving to start/end of a rectangular selection with left/right key.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2871358&group_id=2439">Bug #2871358.</a>
+ </li>
+ <li>
+ Fixed problem with Select All when there's a rectangular selection.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2930488&group_id=2439">Bug #2930488.</a>
+ </li>
+ <li>
+ Fixed SCI_LINEDUPLICATE on a rectangular selection to not produce multiple discontinuous selections.
+ </li>
+ <li>
+ Virtual space removed when performing delete word left or delete line left.
+ Virtual space converted to real space for delete word right.
+ Preserve virtual space when pressing Delete key.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2882566&group_id=2439">Bug #2882566.</a>
+ </li>
+ <li>
+ Fixed problem where Shift+Alt+Down did not move through wrapped lines.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2871749&group_id=2439">Bug #2871749.</a>
+ </li>
+ <li>
+ Fixed incorrect background colour when using coloured lines with virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2914691&group_id=2439">Bug #2914691.</a>
+ </li>
+ <li>
+ Fixed failure to display wrap symbol for SC_WRAPVISUALFLAGLOC_END_BY_TEXT.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2936108&group_id=2439">Bug #2936108.</a>
+ </li>
+ <li>
+ Fixed blank background colour with EOLFilled style on last line.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2890105&group_id=2439">Bug #2890105.</a>
+ </li>
+ <li>
+ Fixed problem in VB lexer with keyword at end of file.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2901239&group_id=2439">Bug #2901239.</a>
+ </li>
+ <li>
+ Fixed SciTE bug where double clicking on a tab closed the file.
+ </li>
+ <li>
+ Fixed SciTE brace matching commands to only work when the caret is next to the brace, not when
+ it is in virtual space.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2885560&group_id=2439">Bug #2885560.</a>
+ </li>
+ <li>
+ Fixed SciTE on Windows Vista to access files in the Program Files directory rather than allow Windows
+ to virtualize access.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2916685&group_id=2439">Bug #2916685.</a>
+ </li>
+ <li>
+ Fixed NSIS folder to handle keywords that start with '!'.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2872157&group_id=2439">Bug #2872157.</a>
+ </li>
+ <li>
+ Changed linkage of Scintilla_LinkLexers to "C" so that it can be used by clients written in C.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2844718&group_id=2439">Bug #2844718.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite201.zip?download">Release 2.01</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 19 August 2009.
+ </li>
+ <li>
+ Fix to positioning rectangular paste when viewing line ends.
+ </li>
+ <li>
+ Don't insert new lines and indentation for line ends at end of rectangular paste.
+ </li>
+ <li>
+ When not in additional selection typing mode, cutting a rectangular selection removes all of the selected text.
+ </li>
+ <li>
+ Rectangular selections are copied to the clipboard in document order, not in the order of selection.
+ </li>
+ <li>
+ SCI_SETCURRENTPOS and SCI_SETANCHOR work in rectangular mode.
+ </li>
+ <li>
+ On GTK+, drag and drop to a later position in the document now drops at the position.
+ </li>
+ <li>
+ Fix bug where missing property did not use default value.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite200.zip?download">Release 2.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 11 August 2009.
+ </li>
+ <li>
+ Multiple pieces of text can be selected simultaneously by holding control while dragging the mouse.
+ Typing, backspace and delete may affect all selections together.
+ </li>
+ <li>
+ Virtual space allows selecting beyond the last character on a line.
+ </li>
+ <li>
+ SciTE on GTK+ path bar is now optional and defaults to off.
+ </li>
+ <li>
+ MagikSF lexer recognises numbers correctly.
+ </li>
+ <li>
+ Folding of Python comments and blank lines improved. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=210240&group_id=2439">Bug #210240.</a>
+ </li>
+ <li>
+ Bug fixed where background colour of last character in document leaked past that character.
+ </li>
+ <li>
+ Crash fixed when adding marker beyond last line in document. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2830307&group_id=2439">Bug #2830307.</a>
+ </li>
+ <li>
+ Resource leak fixed in SciTE for Windows when printing fails. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2816524&group_id=2439">Bug #2816524.</a>
+ </li>
+ <li>
+ Bug fixed on Windows where the system caret was destroyed during destruction when another window
+ was using the system caret. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2830223&group_id=2439">Bug #2830223.</a>
+ </li>
+ <li>
+ Bug fixed where indentation guides were drawn over text when the indentation used a style with a different
+ space width to the default style.
+ </li>
+ <li>
+ SciTE bug fixed where box comment added a bare line feed rather than the chosen line end. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2818104&group_id=2439">Bug #2818104.</a>
+ </li>
+ <li>
+ Reverted fix that led to wrapping whole document when displaying the first line of the document.
+ </li>
+ <li>
+ Export to LaTeX in SciTE fixed to work in more cases and not use as much space. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1286548&group_id=2439">Bug #1286548.</a>
+ </li>
+ <li>
+ Bug fixed where EN_CHANGE notification was sent when performing a paste operation in a
+ read-only document. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2825485&group_id=2439">Bug #2825485.</a>
+ </li>
+ <li>
+ Refactored code so that Scintilla exposes less of its internal implementation and uses the C++ standard
+ library for some basic collections. Projects that linked to Scintilla's SString or PropSet classes
+ should copy this code from a previous version of Scintilla or from SciTE.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite179.zip?download">Release 1.79</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 July 2009.
+ </li>
+ <li>
+ Memory exhaustion and other exceptions handled by placing an error value into the
+ status property rather than crashing.
+ Scintilla now builds with exception handling enabled and requires exception handling to be enabled. <br />
+ This is a major change and application developers should consider how they will deal with Scintilla exhausting
+ memory since Scintilla may not be in a stable state.
+ </li>
+ <li>
+ Deprecated APIs removed. The symbols removed are:
+ <ul>
+ <li>SCI_SETCARETPOLICY</li>
+<li> CARET_CENTER</li>
+<li> CARET_XEVEN</li>
+<li> CARET_XJUMPS</li>
+<li> SC_FOLDFLAG_BOX</li>
+<li> SC_FOLDLEVELBOXHEADERFLAG</li>
+<li> SC_FOLDLEVELBOXFOOTERFLAG</li>
+<li> SC_FOLDLEVELCONTRACTED</li>
+<li> SC_FOLDLEVELUNINDENT</li>
+<li> SCN_POSCHANGED</li>
+<li> SCN_CHECKBRACE</li>
+<li> SCLEX_ASP</li>
+<li> SCLEX_PHP</li>
+</ul>
+ </li>
+ <li>
+ Cocoa platform added.
+ </li>
+ <li>
+ Names of struct types in Scintilla.h now start with "Sci_" to avoid possible clashes with platform
+ definitions. Currently, the old names still work but these will be phased out.
+ </li>
+ <li>
+ When lines are wrapped, subsequent lines may be indented to match the indent of the initial line,
+ or one more indentation level. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2796119&group_id=2439">Feature #2796119.</a>
+ </li>
+ <li>
+ APIs added for finding the character at a point rather than an inter-character position. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2646738&group_id=2439">Feature #2646738.</a>
+ </li>
+ <li>
+ A new marker SC_MARK_BACKGROUND_UNDERLINE is drawn in the text area as an underline
+ the full width of the window.
+ </li>
+ <li>
+ Batch file lexer understands variables surrounded by '!'.
+ </li>
+ <li>
+ CAML lexer also supports SML.
+ </li>
+ <li>
+ D lexer handles string and numeric literals more accurately. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2793782&group_id=2439">Feature #2793782.</a>
+ </li>
+ <li>
+ Forth lexer is now case-insensitive and better supports numbers like $hex and %binary. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2804894&group_id=2439">Feature #2804894.</a>
+ </li>
+ <li>
+ Lisp lexer treats '[', ']', '{', and '}' as balanced delimiters which is common usage. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2794989&group_id=2439">Feature #2794989.</a>
+ <br />
+ It treats keyword argument names as being equivalent to symbols. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2794901&group_id=2439">Feature #2794901.</a>
+ </li>
+ <li>
+ Pascal lexer bug fixed to prevent hang when 'interface' near beginning of file. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2802863&group_id=2439">Bug #2802863.</a>
+ </li>
+ <li>
+ Perl lexer bug fixed where previous lexical states persisted causing "/" special case styling and
+ subroutine prototype styling to not be correct. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2809168&group_id=2439">Bug #2809168.</a>
+ </li>
+ <li>
+ XML lexer fixes bug where Unicode entities like '&amp;—' were broken into fragments. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2804760&group_id=2439">Bug #2804760.</a>
+ </li>
+ <li>
+ SciTE on GTK+ enables scrolling the tab bar on recent versions of GTK+. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2061821&group_id=2439">Feature #2061821.</a>
+ </li>
+ <li>
+ SciTE on Windows allows tab bar tabs to be reordered by drag and drop.
+ </li>
+ <li>
+ Unit test script for Scintilla on Windows included with source code.
+ </li>
+ <li>
+ User defined menu items are now localised when there is a matching translation.
+ </li>
+ <li>
+ Width of icon column of autocompletion lists on GTK+ made more consistent.
+ </li>
+ <li>
+ Bug with slicing UTF-8 text into character fragments when there is a sequence of 100 or more 3 byte characters. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2780566&group_id=2439">Bug #2780566.</a>
+ </li>
+ <li>
+ Folding bugs introduced in 1.78 fixed. Some of the fix was generic and there was also a specific fix for C++.
+ </li>
+ <li>
+ Bug fixed where a rectangular paste was not padding the line with sufficient spaces to align the pasted text.
+ </li>
+ <li>
+ Bug fixed with showing all text on each line of multi-line annotations when styling the whole annotation using SCI_ANNOTATIONSETSTYLE. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2789430&group_id=2439">Bug #2789430.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite178.zip?download">Release 1.78</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 28 April 2009.
+ </li>
+ <li>
+ Annotation lines may be added to each line.
+ </li>
+ <li>
+ A text margin may be defined with different text on each line.
+ </li>
+ <li>
+ Application actions may be added to the undo history.
+ </li>
+ <li>
+ Can query the symbol defined for a marker.
+ An available symbol added for applications to indicate that plugins may allocate a marker.
+ </li>
+ <li>
+ Can increase the amount of font ascent and descent.
+ </li>
+ <li>
+ COBOL lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2127406&group_id=2439">Feature #2127406.</a>
+ </li>
+ <li>
+ Nimrod lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2642620&group_id=2439">Feature #2642620.</a>
+ </li>
+ <li>
+ PowerPro lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2195308&group_id=2439">Feature #2195308.</a>
+ </li>
+ <li>
+ SML lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2710950&group_id=2439">Feature #2710950.</a>
+ </li>
+ <li>
+ SORCUS Installation file lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2343375&group_id=2439">Feature #2343375.</a>
+ </li>
+ <li>
+ TACL lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2127406&group_id=2439">Feature #2127406.</a>
+ </li>
+ <li>
+ TAL lexer added. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2127406&group_id=2439">Feature #2127406.</a>
+ </li>
+ <li>
+ Rewritten Pascal lexer with improved folding and other fixes. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2190650&group_id=2439">Feature #2190650.</a>
+ </li>
+ <li>
+ INDIC_ROUNDBOX translucency level can be modified. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2586290&group_id=2439">Feature #2586290.</a>
+ </li>
+ <li>
+ C++ lexer treats angle brackets in #include directives as quotes when styling.within.preprocessor. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2551033&group_id=2439">Bug #2551033.</a>
+ </li>
+ <li>
+ Inno Setup lexer is sensitive to whether within the [Code] section and handles comments better. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2552973&group_id=2439">Bug #2552973.</a>
+ </li>
+ <li>
+ HTML lexer does not go into script mode when script tag is self-closing.
+ </li>
+ <li>
+ HTML folder fixed where confused by comments when fold.html.preprocessor off. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2532774&group_id=2439">Bug #2532774.</a>
+ </li>
+ <li>
+ Perl lexer fixes problem with string matching caused by line endings. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2648342&group_id=2439">Bug #2648342.</a>
+ </li>
+ <li>
+ Progress lexer fixes problem with "last-event:function" phrase. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2483619&group_id=2439">Bug #2483619.</a>
+ </li>
+ <li>
+ Properties file lexer extended to handle RFC2822 text when lexer.props.allow.initial.spaces on.
+ </li>
+ <li>
+ Python lexer adds options for Python 3 and Cython.
+ </li>
+ <li>
+ Shell lexer fixes heredoc problem caused by line endings. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2635257&group_id=2439">Bug #2635257.</a>
+ </li>
+ <li>
+ TeX lexer handles comment at end of line correctly. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2698766&group_id=2439">Bug #2698766.</a>
+ </li>
+ <li>
+ SciTE retains selection range when performing a replace selection command. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2339160&group_id=2439">Feature #2339160.</a>
+ </li>
+ <li>
+ SciTE definition of word characters fixed to match documentation. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2464531&group_id=2439">Bug #2464531.</a>
+ </li>
+ <li>
+ SciTE on GTK+ performing Search or Replace when dialog already shown now brings dialog to foreground.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2634224&group_id=2439">Bug #2634224.</a>
+ </li>
+ <li>
+ Fixed encoding bug with calltips on GTK+.
+ </li>
+ <li>
+ Block caret drawn in correct place on wrapped lines. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2126144&group_id=2439">Bug #2126144.</a>
+ </li>
+ <li>
+ Compilation for 64 bit Windows works using MinGW. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2515578&group_id=2439">Bug #2515578.</a>
+ </li>
+ <li>
+ Incorrect memory freeing fixed on OS X.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2354098&group_id=2439">Bug #2354098</a>,
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2671749&group_id=2439">Bug #2671749.</a>
+ </li>
+ <li>
+ SciTE on GTK+ crash fixed on startup when child process exits before initialisation complete.
+ <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2716987&group_id=2439">Bug #2716987.</a>
+ </li>
+ <li>
+ Crash fixed when AutoCompleteGetCurrent called with no active autocompletion.
+ </li>
+ <li>
+ Flickering diminished when pressing Tab. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2723006&group_id=2439">Bug #2723006.</a>
+ </li>
+ <li>
+ Namespace compilation issues with GTK+ on OS X fixed.
+ </li>
+ <li>
+ Increased maximum length of SciTE's Language menu on GTK+ to 100 items. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2528241&group_id=2439">Bug #2528241.</a>
+ </li>
+ <li>
+ Fixed incorrect Python lexing for multi-line continued strings. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2450963&group_id=2439">Bug #2450963.</a>
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite177.zip?download">Release 1.77</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 18 October 2008.
+ </li>
+ <li>
+ Direct temporary access to Scintilla's text buffer to allow simple efficient interfacing
+ to libraries like regular expression libraries.
+ </li>
+ <li>
+ Scintilla on Windows can interpret keys as Unicode even when a narrow character
+ window with SCI_SETKEYSUNICODE.
+ </li>
+ <li>
+ Notification sent when autocompletion cancelled.
+ </li>
+ <li>
+ MySQL lexer added.
+ </li>
+ <li>
+ Lexer for gettext .po files added.
+ </li>
+ <li>
+ Abaqus lexer handles program structure more correctly.
+ </li>
+ <li>
+ Assembler lexer works with non-ASCII text.
+ </li>
+ <li>
+ C++ lexer allows mixed case doc comment tags.
+ </li>
+ <li>
+ CSS lexer updated and works with non-ASCII.
+ </li>
+ <li>
+ Diff lexer adds style for changed lines, handles subversion diffs better and
+ fixes styling and folding for lines containing chunk dividers ("---").
+ </li>
+ <li>
+ FORTRAN lexer accepts more styles of compiler directive.
+ </li>
+ <li>
+ Haskell lexer allows hexadecimal literals.
+ </li>
+ <li>
+ HTML lexer improves PHP and JavaScript folding.
+ PHP heredocs, nowdocs, strings and comments processed more accurately.
+ Internet Explorer's non-standard &gt;comment&lt; tag supported.
+ Script recognition in XML can be controlled with lexer.xml.allow.scripts property.
+ </li>
+ <li>
+ Lua lexer styles last character correctly.
+ </li>
+ <li>
+ Perl lexer update.
+ </li>
+ <li>
+ Comment folding implemented for Ruby.
+ </li>
+ <li>
+ Better TeX folding.
+ </li>
+ <li>
+ Verilog lexer updated.
+ </li>
+ <li>
+ Windows Batch file lexer handles %~ and %*.
+ </li>
+ <li>
+ YAML lexer allows non-ASCII text.
+ </li>
+ <li>
+ SciTE on GTK+ implements "Replace in Buffers" in advanced mode.
+ </li>
+ <li>
+ The extender OnBeforeSave method can override the default file saving behaviour by retuning true.
+ </li>
+ <li>
+ Window position and recent files list may be saved into the session file.
+ </li>
+ <li>
+ Right button press outside the selection moves the caret.
+ </li>
+ <li>
+ SciTE load.on.activate works when closing a document reveals a changed document.
+ </li>
+ <li>
+ SciTE bug fixed where eol.mode not used for initial buffer.
+ </li>
+ <li>
+ SciTE bug fixed where a file could be saved as the same name as another
+ buffer leading to confusing behaviour.
+ </li>
+ <li>
+ Fixed display bug for long lines in same style on Windows.
+ </li>
+ <li>
+ Fixed SciTE crash when finding matching preprocessor command used on some files.
+ </li>
+ <li>
+ Drawing performance improved for files with many blank lines.
+ </li>
+ <li>
+ Folding bugs fixed where changing program text produced a decrease in fold level on a fold header line.
+ </li>
+ <li>
+ Clearing document style now clears all indicators.
+ </li>
+ <li>
+ SciTE's embedded Lua updated to 5.1.4.
+ </li>
+ <li>
+ SciTE will compile with versions of GTK+ before 2.8 again.
+ </li>
+ <li>
+ SciTE on GTK+ bug fixed where multiple files not opened.
+ </li>
+ <li>
+ Bug fixed with SCI_VCHOMEWRAP and SCI_VCHOMEWRAPEXTEND on white last line.
+ </li>
+ <li>
+ Regular expression bug fixed where "^[^(]+$" matched empty lines.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite176.zip?download">Release 1.76</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 16 March 2008.
+ </li>
+ <li>
+ Support for PowerShell.
+ </li>
+ <li>
+ Lexer added for Magik.
+ </li>
+ <li>
+ Director extension working on GTK+.
+ </li>
+ <li>
+ Director extension may set focus to SciTE through "focus:" message on GTK+.
+ </li>
+ <li>
+ C++ folder handles final line better in some cases.
+ </li>
+ <li>
+ SCI_COPYALLOWLINE added which is similar to SCI_COPY except that if the selection is empty then
+ the line holding the caret is copied. On Windows an extra clipboard format allows pasting this as a whole
+ line before the current selection. This behaviour is compatible with Visual Studio.
+ </li>
+ <li>
+ On Windows, the horizontal scroll bar can handle wider files.
+ </li>
+ <li>
+ On Windows, a system palette leak was fixed. Should not affect many as palette mode is rarely used.
+ </li>
+ <li>
+ Install command on GTK+ no longer tries to set explicit owner.
+ </li>
+ <li>
+ Perl lexer handles defined-or operator "//".
+ </li>
+ <li>
+ Octave lexer fixes "!=" operator.
+ </li>
+ <li>
+ Optimized selection change drawing to not redraw as much when not needed.
+ </li>
+ <li>
+ SciTE on GTK+ no longer echoes Lua commands so is same as on Windows.
+ </li>
+ <li>
+ Automatic vertical scrolling limited to one line at a time so is not too fast.
+ </li>
+ <li>
+ Crash fixed when line states set beyond end of line states. This occurred when lexers did not
+ set a line state for each line.
+ </li>
+ <li>
+ Crash in SciTE on Windows fixed when search for 513 character string fails.
+ </li>
+ <li>
+ SciTE disables translucent features on Windows 9x due to crashes reported when using translucency.
+ </li>
+ <li>
+ Bug fixed where whitespace background was not seen on wrapped lines.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download">Release 1.75</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 22 November 2007.
+ </li>
+ <li>
+ Some WordList and PropSet functionality moved from Scintilla to SciTE.
+ Projects that link to Scintilla's code for these classes may need to copy
+ code from SciTE.
+ </li>
+ <li>
+ Borland C++ can no longer build Scintilla.
+ </li>
+ <li>
+ Invalid bytes in UTF-8 mode are displayed as hex blobs. This also prevents crashes due to
+ passing invalid UTF-8 to platform calls.
+ </li>
+ <li>
+ Indentation guides enhanced to be visible on completely empty lines when possible.
+ </li>
+ <li>
+ The horizontal scroll bar may grow to match the widest line displayed.
+ </li>
+ <li>
+ Allow autocomplete pop ups to appear outside client rectangle in some cases.
+ </li>
+ <li>
+ When line state changed, SC_MOD_CHANGELINESTATE modification notification sent and
+ margin redrawn.
+ </li>
+ <li>
+ SciTE scripts can access the menu command values IDM_*.
+ </li>
+ <li>
+ SciTE's statement.end property has been implemented again.
+ </li>
+ <li>
+ SciTE shows paths and matches in different styles for Find In Files.
+ </li>
+ <li>
+ Incremental search in SciTE for Windows is modeless to make it easier to exit.
+ </li>
+ <li>
+ Folding performance improved.
+ </li>
+ <li>
+ SciTE for GTK+ now includes a Browse button in the Find In Files dialog.
+ </li>
+ <li>
+ On Windows versions that support Unicode well, Scintilla is a wide character window
+ which allows input for some less common languages like Armenian, Devanagari,
+ Tamil, and Georgian. To fully benefit, applications should use wide character calls.
+ </li>
+ <li>
+ Lua function names are exported from SciTE to allow some extension libraries to work.
+ </li>
+ <li>
+ Lexers added for Abaqus, Ansys APDL, Asymptote, and R.
+ </li>
+ <li>
+ SCI_DELWORDRIGHTEND added for closer compatibility with GTK+ entry widget.
+ </li>
+ <li>
+ The styling buffer may now use all 8 bits in each byte for lexical states with 0 bits for indicators.
+ </li>
+ <li>
+ Multiple characters may be set for SciTE's calltip.&lt;lexer&gt;.parameters.start property.
+ </li>
+ <li>
+ Bash lexer handles octal literals.
+ </li>
+ <li>
+ C++/JavaScript lexer recognises regex literals in more situations.
+ </li>
+ <li>
+ Haskell lexer fixed for quoted strings.
+ </li>
+ <li>
+ HTML/XML lexer does not notice XML indicator if there is
+ non-whitespace between the "&lt;?" and "XML".
+ ASP problem fixed where &lt;/ is used inside a comment.
+ </li>
+ <li>
+ Error messages from Lua 5.1 are recognised.
+ </li>
+ <li>
+ Folding implemented for Metapost.
+ </li>
+ <li>
+ Perl lexer enhanced for handling minus-prefixed barewords,
+ underscores in numeric literals and vector/version strings,
+ ^D and ^Z similar to __END__,
+ subroutine prototypes as a new lexical class,
+ formats and format blocks as new lexical classes, and
+ '/' suffixed keywords and barewords.
+ </li>
+ <li>
+ Python lexer styles all of a decorator in the decorator style rather than just the name.
+ </li>
+ <li>
+ YAML lexer styles colons as operators.
+ </li>
+ <li>
+ Fixed SciTE bug where undo would group together multiple separate modifications.
+ </li>
+ <li>
+ Bug fixed where setting background colour of calltip failed.
+ </li>
+ <li>
+ SciTE allows wildcard suffixes for file pattern based properties.
+ </li>
+ <li>
+ SciTE on GTK+ bug fixed where user not prompted to save untitled buffer.
+ </li>
+ <li>
+ SciTE bug fixed where property values from one file were not seen by lower priority files.
+ </li>
+ <li>
+ Bug fixed when showing selection with a foreground colour change which highlighted
+ an incorrect range in some positions.
+ </li>
+ <li>
+ Cut now invokes SCN_MODIFYATTEMPTRO notification.
+ </li>
+ <li>
+ Bug fixed where caret not shown at beginning of wrapped lines.
+ Caret made visible in some cases after wrapping and scroll bar updated after wrapping.
+ </li>
+ <li>
+ Modern indicators now work on wrapped lines.
+ </li>
+ <li>
+ Some crashes fixed for 64-bit GTK+.
+ </li>
+ <li>
+ On GTK+ clipboard features improved for VMWare tools copy and paste.
+ SciTE exports the clipboard more consistently on shut down.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite174.zip?download">Release 1.74</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 18 June 2007.
+ </li>
+ <li>
+ OS X support.
+ </li>
+ <li>
+ Indicators changed to be a separate data structure allowing more indicators. Storing indicators in high bits
+ of styling bytes is deprecated and will be removed in the next version.
+ </li>
+ <li>
+ Unicode support extended to all Unicode characters not just the Basic Multilingual Plane.
+ </li>
+ <li>
+ Performance improved on wide lines by breaking long runs in a single style into shorter segments.
+ </li>
+ <li>
+ Performance improved by caching layout of short text segments.
+ </li>
+ <li>
+ SciTE includes Lua 5.1.
+ </li>
+ <li>
+ Caret may be displayed as a block.
+ </li>
+ <li>
+ Lexer added for GAP.
+ </li>
+ <li>
+ Lexer added for PL/M.
+ </li>
+ <li>
+ Lexer added for Progress.
+ </li>
+ <li>
+ SciTE session files have changed format to be like other SciTE .properties files
+ and now use the extension .session.
+ Bookmarks and folds may optionally be saved in session files.
+ Session files created with previous versions of SciTE will not load into this version.
+ </li>
+ <li>
+ SciTE's extension and scripting interfaces add OnKey, OnDwellStart, and OnClose methods.
+ </li>
+ <li>
+ On GTK+, copying to the clipboard does not include the text/urilist type since this caused problems when
+ pasting into Open Office.
+ </li>
+ <li>
+ On GTK+, Scintilla defaults caret blink rate to platform preference.
+ </li>
+ <li>
+ Dragging does not start until the mouse has been dragged a certain amount.
+ This stops spurious drags when just clicking inside the selection.
+ </li>
+ <li>
+ Bug fixed where brace highlight not shown when caret line background set.
+ </li>
+ <li>
+ Bug fixed in Ruby lexer where out of bounds access could occur.
+ </li>
+ <li>
+ Bug fixed in XML folding where tags were not being folded because they are singletons in HTML.
+ </li>
+ <li>
+ Bug fixed when many font names used.
+ </li>
+ <li>
+ Layout bug fixed on GTK+ where fonts have ligatures available.
+ </li>
+ <li>
+ Bug fixed with SCI_LINETRANSPOSE on a blank line.
+ </li>
+ <li>
+ SciTE hang fixed when using UNC path with directory properties feature.
+ </li>
+ <li>
+ Bug on Windows fixed by examining dropped text for Unicode even in non-Unicode mode so it
+ can work when source only provides Unicode or when using an encoding different from the
+ system default.
+ </li>
+ <li>
+ SciTE bug on GTK+ fixed where Stop Executing did not work when more than a single process started.
+ </li>
+ <li>
+ SciTE bug on GTK+ fixed where mouse wheel was not switching between buffers.
+ </li>
+ <li>
+ Minor line end fix to PostScript lexer.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite173.zip?download">Release 1.73</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 31 March 2007.
+ </li>
+ <li>
+ SciTE adds a Directory properties file to configure behaviour for files in a directory and its subdirectories.
+ </li>
+ <li>
+ Style changes may be made during text modification events.
+ </li>
+ <li>
+ Regular expressions recognise \d, \D, \s, \S, \w, \W, and \xHH.
+ </li>
+ <li>
+ Support for cmake language added.
+ </li>
+ <li>
+ More Scintilla properties can be queried.
+ </li>
+ <li>
+ Edge line drawn under text.
+ </li>
+ <li>
+ A savesession command added to SciTE director interface.
+ </li>
+ <li>
+ SciTE File | Encoding menu item names changed to be less confusing.
+ </li>
+ <li>
+ SciTE on GTK+ dialog buttons reordered to follow guidelines.
+ </li>
+ <li>
+ SciTE on GTK+ removed GTK+ 1.x compatible file dialog code.
+ </li>
+ <li>
+ SciTE on GTK+ recognises key names KeypadMultiply and KeypadDivide.
+ </li>
+ <li>
+ Background colour of line wrapping visual flag changed to STYLE_DEFAULT.
+ </li>
+ <li>
+ Makefile lexing enhanced for ':=' operator and when lines start with tab.
+ </li>
+ <li>
+ TADS3 lexer and folder improved.
+ </li>
+ <li>
+ SCN_DOUBLECLICK notification may set SCI_SHIFT, SCI_CTRL, and SCI_ALT flags on modifiers field.
+ </li>
+ <li>
+ Slow folding of large constructs in Python fixed.
+ </li>
+ <li>
+ MSSQL folding fixed to be case-insensitive and fold at more keywords.
+ </li>
+ <li>
+ SciTE's brace matching works better for HTML.
+ </li>
+ <li>
+ Determining API list items checks for specified parameters start character before default '('.
+ </li>
+ <li>
+ Hang fixed in HTML lexer.
+ </li>
+ <li>
+ Bug fixed in with LineTranspose command where markers could move to different line.
+ </li>
+ <li>
+ Memory released when buffer completely emptied.
+ </li>
+ <li>
+ If translucency not available on Windows, draw rectangular outline instead.
+ </li>
+ <li>
+ Bash lexer handles "-x" in "--x-includes..." better.
+ </li>
+ <li>
+ AutoIt3 lexer fixes string followed by '+'.
+ </li>
+ <li>
+ LinesJoin fixed where it stopped early due to not adjusting for inserted spaces..
+ </li>
+ <li>
+ StutteredPageDown fixed when lines wrapped.
+ </li>
+ <li>
+ FormatRange fixed to not double count line number width which could lead to a large space.
+ </li>
+ <li>
+ SciTE Export As PDF and Latex commands fixed to format floating point numbers with '.' even in locales
+ that use ','.
+ </li>
+ <li>
+ SciTE bug fixed where File | New could produce buffer with contents of previous file when using read-only mode.
+ </li>
+ <li>
+ SciTE retains current scroll position when switching buffers and fold.on.open set.
+ </li>
+ <li>
+ SciTE crash fixed where '*' used to invoke parameters dialog.
+ </li>
+ <li>
+ SciTE bugs when writing large UCS-2 files fixed.
+ </li>
+ <li>
+ Bug fixed when scrolling inside a SCN_PAINTED event by invalidating window
+ rather than trying to perform synchronous painting.
+ </li>
+ <li>
+ SciTE for GTK+ View | Full Screen works on recent versions of GTK+.
+ </li>
+ <li>
+ SciTE for Windows enables and disables toolbar commands correctly.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite172.zip?download">Release 1.72</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 15 January 2007.
+ </li>
+ <li>
+ Performance of per-line data improved.
+ </li>
+ <li>
+ SC_STARTACTION flag set on the first modification notification in an undo
+ transaction to help synchronize the container's undo stack with Scintilla's.
+ </li>
+ <li>
+ On GTK+ drag and drop defaults to move rather than copy.
+ </li>
+ <li>
+ Scintilla supports extending appearance of selection to right hand margin.
+ </li>
+ <li>
+ Incremental search available on GTK+.
+ </li>
+ <li>
+ SciTE Indentation Settings dialog available on GTK+ and adds a "Convert" button.
+ </li>
+ <li>
+ Find in Files can optionally ignore binary files or directories that start with ".".
+ </li>
+ <li>
+ Lexer added for "D" language.
+ </li>
+ <li>
+ Export as HTML shows folding with underline lines and +/- symbols.
+ </li>
+ <li>
+ Ruby lexer interprets interpolated strings as expressions.
+ </li>
+ <li>
+ Lua lexer fixes some cases of numeric literals.
+ </li>
+ <li>
+ C++ folder fixes bug with "@" in doc comments.
+ </li>
+ <li>
+ NSIS folder handles !if and related commands.
+ </li>
+ <li>
+ Inno setup lexer adds styling for single and double quoted strings.
+ </li>
+ <li>
+ Matlab lexer handles backslashes in string literals correctly.
+ </li>
+ <li>
+ HTML lexer fixed to allow "?&gt;" in comments in Basic script.
+ </li>
+ <li>
+ Added key codes for Windows key and Menu key.
+ </li>
+ <li>
+ Lua script method scite.MenuCommand(x) performs a menu command.
+ </li>
+ <li>
+ SciTE bug fixed with box comment command near start of file setting selection to end of file.
+ </li>
+ <li>
+ SciTE on GTK+, fixed loop that occurred with automatic loading for an unreadable file.
+ </li>
+ <li>
+ SciTE asks whether to save files when Windows shuts down.
+ </li>
+ <li>
+ Save Session on Windows now defaults the extension to "ses".
+ </li>
+ <li>
+ Bug fixed with single character keywords.
+ </li>
+ <li>
+ Fixed infinite loop for SCI_GETCOLUMN for position beyond end of document.
+ </li>
+ <li>
+ Fixed failure to accept typing on Solaris/GTK+ when using default ISO-8859-1 encoding.
+ </li>
+ <li>
+ Fixed warning from Lua in SciTE when creating a new buffer when already have
+ maximum number of buffers open.
+ </li>
+ <li>
+ Crash fixed with "%%" at end of batch file.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite171.zip?download">Release 1.71</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 21 August 2006.
+ </li>
+ <!--li>
+ On GTK+ drag and drop defaults to move rather than copy.
+ </li-->
+ <li>
+ Double click notification includes line and position.
+ </li>
+ <li>
+ VB lexer bugs fixed for preprocessor directive below a comment or some other states and
+ to use string not closed style back to the starting quote when there are internal doubled quotes.
+ </li>
+ <li>
+ C++ lexer allows identifiers to contain '$' and non-ASCII characters such as UTF-8.
+ The '$' character can be disallowed with lexer.cpp.allow.dollars=0.
+ </li>
+ <li>
+ Perl lexer allows UTF-8 identifiers and has some other small improvements.
+ </li>
+ <li>
+ SciTE's $(CurrentWord) uses word.characters.&lt;filepattern&gt; to define the word
+ rather than a hardcoded list of word characters.
+ </li>
+ <li>
+ SciTE Export as HTML adds encoding information for UTF-8 file and fixes DOCTYPE.
+ </li>
+ <li>
+ SciTE session and .recent files default to the user properties directory rather than global
+ properties directory.
+ </li>
+ <li>
+ Left and right scroll events handled correctly on GTK+ and horizontal scroll bar has more sensible
+ distances for page and arrow clicks.
+ </li>
+ <li>
+ SciTE on GTK+ tab bar fixed to work on recent versions of GTK+.
+ </li>
+ <li>
+ On GTK+, if the approximate character set conversion is unavailable, a second attempt is made
+ without approximations. This may allow keyboard input and paste to work on older systems.
+ </li>
+ <li>
+ SciTE on GTK+ can redefine the Insert key.
+ </li>
+ <li>
+ SciTE scripting interface bug fixed where some string properties could not be changed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite170.zip?download">Release 1.70</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 20 June 2006.
+ </li>
+ <li>
+ On GTK+, character set conversion is performed using an option that allows approximate conversions rather
+ than failures when a character can not be converted. This may lead to similar characters being inserted or
+ when no similar character is available a '?' may be inserted.
+ </li>
+ <li>
+ On GTK+, the internationalised IM (Input Method) feature is used for all typed input for all character sets.
+ </li>
+ <li>
+ Scintilla has new margin types SC_MARGIN_BACK and SC_MARGIN_FORE that use the default
+ style's background and foreground colours (normally white and black) as the background to the margin.
+ </li>
+ <li>
+ Scintilla/GTK+ allows file drops on Windows when drop is of type DROPFILES_DND
+ as well as text/uri-list.
+ </li>
+ <li>
+ Code page can only be set to one of the listed valid values.
+ </li>
+ <li>
+ Text wrapping fixed for cases where insertion was not wide enough to trigger
+ wrapping before being styled but was after styling.
+ </li>
+ <li>
+ SciTE find marks are removed before printing or exporting to avoid producing incorrect styles.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite169.zip?download">Release 1.69</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 29 May 2006.
+ </li>
+ <li>
+ SciTE supports z-order based buffer switching on Ctrl+Tab.
+ </li>
+ <li>
+ Translucent support for selection and whole line markers.
+ </li>
+ <li>
+ SciTE may have per-language abbreviations files.
+ </li>
+ <li>
+ Support for Spice language.
+ </li>
+ <li>
+ On GTK+ autocompletion lists are optimised and use correct selection colours.
+ </li>
+ <li>
+ On GTK+ the URI data type is preferred in drag and drop so that applications
+ will see files dragged from the shell rather than dragging the text of the file name
+ into the document.
+ </li>
+ <li>
+ Increased number of margins to 5.
+ </li>
+ <li>
+ Basic lexer allows include directive $include: "file name".
+ </li>
+ <li>
+ SQL lexer no longer bases folding on indentation.
+ </li>
+ <li>
+ Line ends are transformed when copied to clipboard on
+ Windows/GTK+2 as well as Windows/GTK+ 1.
+ </li>
+ <li>
+ Lexing code masks off the indicator bits on the start style before calling the lexer
+ to avoid confusing the lexer when an application has used an indicator.
+ </li>
+ <li>
+ SciTE savebefore:yes only saves the file when it has been changed.
+ </li>
+ <li>
+ SciTE adds output.initial.hide setting to allow setting the size of the output pane
+ without it showing initially.
+ </li>
+ <li>
+ SciTE on Windows Go To dialog allows line number with more digits.
+ </li>
+ <li>
+ Bug in HTML lexer fixed where a segment of PHP could switch scripting language
+ based on earlier text on that line.
+ </li>
+ <li>
+ Memory bug fixed when freeing regions on GTK+.
+ Other minor bugs fixed on GTK+.
+ </li>
+ <li>
+ Deprecated GTK+ calls in Scintilla replaced with current calls.
+ </li>
+ <li>
+ Fixed a SciTE bug where closing the final buffer, if read-only, left the text present in an
+ untitled buffer.
+ </li>
+ <li>
+ Bug fixed in bash lexer that prevented folding.
+ </li>
+ <li>
+ Crash fixed in bash lexer when backslash at end of file.
+ </li>
+ <li>
+ Crash on recent releases of GTK+ 2.x avoided by changing default font from X
+ core font to Pango font "!Sans".
+ </li>
+ <li>
+ Fix for SciTE properties files where multiline properties continued over completely blank lines.
+ </li>
+ <li>
+ Bug fixed in SciTE/GTK+ director interface where more data available than
+ buffer size.
+ </li>
+ <li>
+ Minor visual fixes to SciTE splitter on GTK+.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite168.zip?download">Release 1.68</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 9 March 2006.
+ </li>
+ <li>
+ Translucent drawing implemented for caret line and box indicators.
+ </li>
+ <li>
+ Lexer specifically for TCL is much more accurate than reusing C++ lexer.
+ </li>
+ <li>
+ Support for Inno Setup scripts.
+ </li>
+ <li>
+ Support for Opal language.
+ </li>
+ <li>
+ Calltips may use a new style, STYLE_CALLTIP which allows choosing a
+ different font for calltips.
+ </li>
+ <li>
+ Python lexer styles comments on decorators.
+ </li>
+ <li>
+ HTML lexer refined handling of "?>" and "%>" within server
+ side scripts.
+ </li>
+ <li>
+ Batch file lexer improved.
+ </li>
+ <li>
+ Eiffel lexer doesn't treat '.' as a name character.
+ </li>
+ <li>
+ Lua lexer handles length operator, #, and hex literals.
+ </li>
+ <li>
+ Properties file lexer has separate style for keys.
+ </li>
+ <li>
+ PL/SQL folding improved.
+ </li>
+ <li>
+ SciTE Replace dialog always searches in forwards direction.
+ </li>
+ <li>
+ SciTE can detect language of file from initial #! line.
+ </li>
+ <li>
+ SciTE on GTK+ supports output.scroll=2 setting.
+ </li>
+ <li>
+ SciTE can perform an import a properties file from the command line.
+ </li>
+ <li>
+ Set of word characters used for regular expression \&lt; and \&gt;.
+ </li>
+ <li>
+ Bug fixed with SCI_COPYTEXT stopping too early.
+ </li>
+ <li>
+ Bug fixed with splitting lines so that all lines are split.
+ </li>
+ <li>
+ SciTE calls OnSwitchFile when closing one buffer causes a switch to another.
+ </li>
+ <li>
+ SciTE bug fixed where properties were being reevaluated without good reason
+ after running a macro.
+ </li>
+ <li>
+ Crash fixed when clearing document with some lines contracted in word wrap mode.
+ </li>
+ <li>
+ Palette expands as more entries are needed.
+ </li>
+ <li>
+ SCI_POSITIONFROMPOINT returns more reasonable value when close to
+ last text on a line.
+ </li>
+ <li>
+ On Windows, long pieces of text may be drawn in segments if they fail to draw
+ as a whole.
+ </li>
+ <li>
+ Bug fixed with bad drawing when some visual changes made inside SCN_UPDATEUI
+ notification.
+ </li>
+ <li>
+ SciTE bug fixed with groupundo setting.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite167.zip?download">Release 1.67</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 17 December 2005.
+ </li>
+ <li>
+ Scintilla checks the paint region more accurately when seeing if an area is being
+ repainted. Platform layer implementations may need to change for this to take
+ effect. This fixes some drawing and styling bugs. Also optimized some parts of
+ marker code to only redraw the line of the marker rather than whole of the margin.
+ </li>
+ <li>
+ Quoted identifier style for SQL. SQL folding performed more simply.
+ </li>
+ <li>
+ Ruby lexer improved to better handle here documents and non-ASCII
+ characters.
+ </li>
+ <li>
+ Lua lexer supports long string and block comment syntax from Lua 5.1.
+ </li>
+ <li>
+ Bash lexer handles here documents better.
+ </li>
+ <li>
+ JavaScript lexing recognises regular expressions more accurately and includes flag
+ characters in the regular expression style. This is both in JavaScript files and when
+ JavaScript is embedded in HTML.
+ </li>
+ <li>
+ Scintilla API provided to reveal how many style bits are needed for the
+ current lexer.
+ </li>
+ <li>
+ Selection duplicate added.
+ </li>
+ <li>
+ Scintilla API for adding a set of markers to a line.
+ </li>
+ <li>
+ DBCS encodings work on Windows 9x.
+ </li>
+ <li>
+ Convention defined for property names to be used by lexers and folders
+ so they can be automatically discovered and forwarded from containers.
+ </li>
+ <li>
+ Default bookmark in SciTE changed to a blue sphere image.
+ </li>
+ <li>
+ SciTE stores the time of last asking for a save separately for each buffer
+ which fixes bugs with automatic reloading.
+ </li>
+ <li>
+ On Windows, pasted text has line ends converted to current preference.
+ GTK+ already did this.
+ </li>
+ <li>
+ Kid template language better handled by HTML lexer by finishing ASP Python
+ mode when a ?> is found.
+ </li>
+ <li>
+ SciTE counts number of characters in a rectangular selection correctly.
+ </li>
+ <li>
+ 64-bit compatibility improved. One change that may affect user code is that
+ the notification message header changed to include a pointer-sized id field
+ to match the current Windows definition.
+ </li>
+ <li>
+ Empty ranges can no longer be dragged.
+ </li>
+ <li>
+ Crash fixed when calls made that use layout inside the painted notification.
+ </li>
+ <li>
+ Bug fixed where Scintilla created pixmap buffers that were too large leading
+ to failures when many instances used.
+ </li>
+ <li>
+ SciTE sets the directory of a new file to the directory of the currently
+ active file.
+ </li>
+ <li>
+ SciTE allows choosing a code page for the output pane.
+ </li>
+ <li>
+ SciTE HTML exporter no longer honours monospaced font setting.
+ </li>
+ <li>
+ Line layout cache in page mode caches the line of the caret. An assertion is
+ now used to ensure that the layout reentrancy problem that caused this
+ is easier to find.
+ </li>
+ <li>
+ Speed optimized for long lines and lines containing many control characters.
+ </li>
+ <li>
+ Bug fixed in brace matching in DBCS files where byte inside character
+ is same as brace.
+ </li>
+ <li>
+ Indent command does not indent empty lines.
+ </li>
+ <li>
+ SciTE bug fixed for commands that operate on files with empty extensions.
+ </li>
+ <li>
+ SciTE bug fixed where monospaced option was copied for subsequently opened files.
+ </li>
+ <li>
+ SciTE on Windows bug fixed in the display of a non-ASCII search string
+ which can not be found.
+ </li>
+ <li>
+ Bugs fixed with nested calls displaying a new calltip while one is already
+ displayed.
+ </li>
+ <li>
+ Bug fixed when styling PHP strings.
+ </li>
+ <li>
+ Bug fixed when styling C++ continued preprocessor lines.
+ </li>
+ <li>
+ SciTE bug fixed where opening file from recently used list reset choice of
+ language.
+ </li>
+ <li>
+ SciTE bug fixed when compiled with NO_EXTENSIONS and
+ closing one file closes the application.
+ </li>
+ <li>
+ SciTE crash fixed for error messages that look like Lua messages but aren't
+ in the same order.
+ </li>
+ <li>
+ Remaining fold box support deprecated. The symbols SC_FOLDLEVELBOXHEADERFLAG,
+ SC_FOLDLEVELBOXFOOTERFLAG, SC_FOLDLEVELCONTRACTED,
+ SC_FOLDLEVELUNINDENT, and SC_FOLDFLAG_BOX are deprecated.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite166.zip?download">Release 1.66</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 26 August 2005.
+ </li>
+ <li>
+ New, more ambitious Ruby lexer.
+ </li>
+ <li>
+ SciTE Find in Files dialog has options for matching case and whole words which are
+ enabled when the internal find command is used.
+ </li>
+ <li>
+ SciTE output pane can display automatic completion after "$(" typed.
+ An initial ">" on a line is ignored when Enter pressed.
+ </li>
+ <li>
+ C++ lexer recognises keywords within line doc comments. It continues styles over line
+ end characters more consistently so that eolfilled style can be used for preprocessor lines
+ and line comments.
+ </li>
+ <li>
+ VB lexer improves handling of file numbers and date literals.
+ </li>
+ <li>
+ Lua folder handles repeat until, nested comments and nested strings.
+ </li>
+ <li>
+ POV lexer improves handling of comment lines.
+ </li>
+ <li>
+ AU3 lexer and folder updated. COMOBJ style added.
+ </li>
+ <li>
+ Bug fixed with text display on GTK+ with Pango 1.8.
+ </li>
+ <li>
+ Caret painting avoided when not focused.
+ </li>
+ <li>
+ SciTE on GTK+ handles file names used to reference properties as case-sensitive.
+ </li>
+ <li>
+ SciTE on GTK+ Save As and Export commands set the file name field.
+ On GTK+ the Export commands modify the file name in the same way as on Windows.
+ </li>
+ <li>
+ Fixed SciTE problem where confirmation was not displaying when closing a file where all
+ contents had been deleted.
+ </li>
+ <li>
+ Middle click on SciTE tab now closes correct buffer on Windows when tool bar is visible.
+ </li>
+ <li>
+ SciTE bugs fixed where files contained in directory that includes '.' character.
+ </li>
+ <li>
+ SciTE bug fixed where import in user options was reading file from directory of
+ global options.
+ </li>
+ <li>
+ SciTE calltip bug fixed where single line calltips had arrow displayed incorrectly.
+ </li>
+ <li>
+ SciTE folding bug fixed where empty lines were shown for no reason.
+ </li>
+ <li>
+ Bug fixed where 2 byte per pixel XPM images caused crash although they are still not
+ displayed.
+ </li>
+ <li>
+ Autocompletion list size tweaked.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite165.zip?download">Release 1.65</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 August 2005.
+ </li>
+ <li>
+ FreeBasic support.
+ </li>
+ <li>
+ SciTE on Windows handles command line arguments
+ "-" (read standard input into buffer),
+ "--" (read standard input into output pane) and
+ "-@" (read file names from standard input and open each).
+ </li>
+ <li>
+ SciTE includes a simple implementation of Find in Files which is used if no find.command is set.
+ </li>
+ <li>
+ SciTE can close tabs with a mouse middle click.
+ </li>
+ <li>
+ SciTE includes a save.all.for.build setting.
+ </li>
+ <li>
+ Folder for MSSQL.
+ </li>
+ <li>
+ Batch file lexer understands more of the syntax and the behaviour of built in commands.
+ </li>
+ <li>
+ Perl lexer handles here docs better; disambiguates barewords, quote-like delimiters, and repetition operators;
+ handles Pods after __END__; recognises numbers better; and handles some typeglob special variables.
+ </li>
+ <li>
+ Lisp adds more lexical states.
+ </li>
+ <li>
+ PHP allows spaces after &lt;&lt;&lt;.
+ </li>
+ <li>
+ TADS3 has a simpler set of states and recognises identifiers.
+ </li>
+ <li>
+ Avenue elseif folds better.
+ </li>
+ <li>
+ Errorlist lexer treats lines starting with '+++' and '---' as separate
+ styles from '+' and '-' as they indicate file names in diffs.
+ </li>
+ <li>
+ SciTE error recogniser handles file paths in extra explanatory lines from MSVC
+ and in '+++' and '---' lines from diff.
+ </li>
+ <li>
+ Bugs fixed in SciTE and Scintilla folding behaviour when text pasted before
+ folded text caused unnecessary
+ unfolding and cutting text could lead to text being irretrievably hidden.
+ </li>
+ <li>
+ SciTE on Windows uses correct font for dialogs and better font for tab bar
+ allowing better localisation
+ </li>
+ <li>
+ When Windows is used with a secondary monitor before the primary
+ monitor, autocompletion lists are not forced onto the primary monitor.
+ </li>
+ <li>
+ Scintilla calltip bug fixed where down arrow setting wrong value in notification
+ if not in first line. SciTE bug fixed where second arrow only shown on multiple line
+ calltip and was therefore misinterpreting the notification value.
+ </li>
+ <li>
+ Lexers will no longer be re-entered recursively during, for example, fold level setting.
+ </li>
+ <li>
+ Undo of typing in overwrite mode undoes one character at a time rather than requiring a removal
+ and addition step for each character.
+ </li>
+ <li>
+ EM_EXSETSEL(0,-1) fixed.
+ </li>
+ <li>
+ Bug fixed where part of a rectangular selection was not shown as selected.
+ </li>
+ <li>
+ Autocomplete window size fixed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite164.zip?download">Release 1.64</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 6 June 2005.
+ </li>
+ <li>
+ TADS3 support
+ </li>
+ <li>
+ Smalltalk support.
+ </li>
+ <li>
+ Rebol support.
+ </li>
+ <li>
+ Flagship (Clipper / XBase) support.
+ </li>
+ <li>
+ CSound support.
+ </li>
+ <li>
+ SQL enhanced to support SQL*Plus.
+ </li>
+ <li>
+ SC_MARK_FULLRECT margin marker fills the whole marker margin for marked
+ lines with a colour.
+ </li>
+ <li>
+ Performance improved for some large undo and redo operations and modification flags
+ added in notifications.
+ </li>
+ <li>
+ SciTE adds command equivalents for fold margin mouse actions.
+ </li>
+ <li>
+ SciTE adds OnUpdateUI to set of events that can be handled by a Lua script.
+ </li>
+ <li>
+ Properties set in Scintilla can be read.
+ </li>
+ <li>
+ GTK+ SciTE exit confirmation adds Cancel button.
+ </li>
+ <li>
+ More accurate lexing of numbers in PHP and Caml.
+ </li>
+ <li>
+ Perl can fold POD and package sections. POD verbatim section style.
+ Globbing syntax recognised better.
+ </li>
+ <li>
+ Context menu moved slightly on GTK+ so that it will be under the mouse and will
+ stay open if just clicked rather than held.
+ </li>
+ <li>
+ Rectangular selection paste works the same whichever direction the selection was dragged in.
+ </li>
+ <li>
+ EncodedFromUTF8 handles -1 length argument as documented.
+ </li>
+ <li>
+ Undo and redo can cause SCN_MODIFYATTEMPTRO notifications.
+ </li>
+ <li>
+ Indicators display correctly when they start at the second character on a line.
+ </li>
+ <li>
+ SciTE Export As HTML uses standards compliant CSS.
+ </li>
+ <li>
+ SciTE automatic indentation handles keywords for indentation better.
+ </li>
+ <li>
+ SciTE fold.comment.python property removed as does not work.
+ </li>
+ <li>
+ Fixed problem with character set conversion when pasting on GTK+.
+ </li>
+ <li>
+ SciTE default character set changed from ANSI_CHARSET to DEFAULT_CHARSET.
+ </li>
+ <li>
+ Fixed crash when creating empty autocompletion list.
+ </li>
+ <li>
+ Autocomplete window size made larger under some conditions to make truncation less common.
+ </li>
+ <li>
+ Bug fixed where changing case of a selection did not affect initial character of lines
+ in multi-byte encodings.
+ </li>
+ <li>
+ Bug fixed where rectangular selection not displayed after Alt+Shift+Click.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite163.zip?download">Release 1.63</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 4 April 2005.
+ </li>
+ <li>
+ Autocompletion on Windows changed to use pop up window, be faster,
+ allow choice of maximum width and height, and to highlight only the text of the
+ selected item rather than both the text and icon if any.
+ </li>
+ <li>
+ Extra items can be added to the context menu in SciTE.
+ </li>
+ <li>
+ Character wrap mode in Scintilla helps East Asian languages.
+ </li>
+ <li>
+ Lexer added for Haskell.
+ </li>
+ <li>
+ Objective Caml support.
+ </li>
+ <li>
+ BlitzBasic and PureBasic support.
+ </li>
+ <li>
+ CSS support updated to handle CSS2.
+ </li>
+ <li>
+ C++ lexer is more selective about document comment keywords.
+ </li>
+ <li>
+ AutoIt 3 lexer improved.
+ </li>
+ <li>
+ Lua lexer styles end of line characters on comment and preprocessor
+ lines so that the eolfilled style can be applied to them.
+ </li>
+ <li>
+ NSIS support updated for line continuations, box comments, SectionGroup and
+ PageEx, and with more up-to-date properties.
+ </li>
+ <li>
+ Clarion lexer updated to perform folding and have more styles.
+ </li>
+ <li>
+ SQL lexer gains second set of keywords.
+ </li>
+ <li>
+ Errorlist lexer recognises Borland Delphi error messages.
+ </li>
+ <li>
+ Method added for determining number of visual lines occupied by a document
+ line due to wrapping.
+ </li>
+ <li>
+ Sticky caret mode does not modify the preferred caret x position when typing
+ and may be useful for typing columns of text.
+ </li>
+ <li>
+ Dwell end notification sent when scroll occurs.
+ </li>
+ <li>
+ On GTK+, Scintilla requisition height is screen height rather than large fixed value.
+ </li>
+ <li>
+ Case insensitive autocompletion prefers exact case match.
+ </li>
+ <li>
+ SCI_PARADOWN and SCI_PARAUP treat lines containing only white
+ space as empty and handle text hidden by folding.
+ </li>
+ <li>
+ Scintilla on Windows supports WM_PRINTCLIENT although there are some
+ limitations.
+ </li>
+ <li>
+ SCN_AUTOCSELECTION notification sent when user selects from autoselection list.
+ </li>
+ <li>
+ SciTE's standard properties file sets buffers to 10, uses Pango fonts on GTK+ and
+ has dropped several languages to make the menu fit on screen.
+ </li>
+ <li>
+ SciTE's encoding cookie detection loosened so that common XML files will load
+ in UTF-8 if that is their declared encoding.
+ </li>
+ <li>
+ SciTE on GTK+ changes menus and toolbars to not be detachable unless turned
+ on with a property. Menus no longer tear off. The toolbar may be set to use the
+ default theme icons rather than SciTE's set. Changed key for View | End of Line
+ because of a conflict. Language menu can contain more items.
+ </li>
+ <li>
+ SciTE on GTK+ 2.x allows the height and width of the file open file chooser to
+ be set, for the show hidden files check box to be set from an option and for it
+ to be opened in the directory of the current file explicitly. Enter key works in
+ save chooser.
+ </li>
+ <li>
+ Scintilla lexers should no longer see bits in style bytes that are outside the set
+ they modify so should be able to correctly lex documents where the container
+ has used indicators.
+ </li>
+ <li>
+ SciTE no longer asks to save before performing a revert.
+ </li>
+ <li>
+ SciTE director interface adds a reloadproperties command to reload properties
+ from files.
+ </li>
+ <li>
+ Allow build on CYGWIN platform.
+ </li>
+ <li>
+ Allow use from LccWin compiler.
+ </li>
+ <li>
+ SCI_COLOURISE for SCLEX_CONTAINER causes a
+ SCN_STYLENEEDED notification.
+ </li>
+ <li>
+ Bugs fixed in lexing of HTML/ASP/JScript.
+ </li>
+ <li>
+ Fix for folding becoming confused.
+ </li>
+ <li>
+ On Windows, fixes for Japanese Input Method Editor and for 8 bit Katakana
+ characters.
+ </li>
+ <li>
+ Fixed buffer size bug avoided when typing long words by making buffer bigger.
+ </li>
+ <li>
+ Undo after automatic indentation more sensible.
+ </li>
+ <li>
+ SciTE menus on GTK+ uses Shift and Ctrl rather than old style abbreviations.
+ </li>
+ <li>
+ SciTE full screen mode on Windows calculates size more correctly.
+ </li>
+ <li>
+ SciTE on Windows menus work better with skinning applications.
+ </li>
+ <li>
+ Searching bugs fixed.
+ </li>
+ <li>
+ Colours reallocated when changing image using SCI_REGISTERIMAGE.
+ </li>
+ <li>
+ Caret stays visible when Enter held down.
+ </li>
+ <li>
+ Undo of automatic indentation more reasonable.
+ </li>
+ <li>
+ High processor usage fixed in background wrapping under some
+ circumstances.
+ </li>
+ <li>
+ Crashing bug fixed on AMD64.
+ </li>
+ <li>
+ SciTE crashing bug fixed when position.height or position.width not set.
+ </li>
+ <li>
+ Crashing bug on GTK+ fixed when setting cursor and window is NULL.
+ </li>
+ <li>
+ Crashing bug on GTK+ preedit window fixed.
+ </li>
+ <li>
+ SciTE crashing bug fixed in incremental search on Windows ME.
+ </li>
+ <li>
+ SciTE on Windows has a optional find and replace dialogs that can search through
+ all buffers and search within a particular style number.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite162.zip?download">Release 1.62</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 31 October 2004.
+ </li>
+ <li>
+ Lexer added for ASN.1.
+ </li>
+ <li>
+ Lexer added for VHDL.
+ </li>
+ <li>
+ On Windows, an invisible system caret is used to allow screen readers to determine
+ where the caret is. The visible caret is still drawn by the painting code.
+ </li>
+ <li>
+ On GTK+, Scintilla has methods to read the target as UTF-8 and to convert
+ a string from UTF-8 to the document encoding. This eases integration with
+ containers that use the UTF-8 encoding which is the API encoding for GTK+ 2.
+ </li>
+ <li>
+ SciTE on GTK+2 and Windows NT/2000/XP allows search and replace of Unicode text.
+ </li>
+ <li>
+ SciTE calltips allow setting the characters used to start and end parameter lists and
+ to separate parameters.
+ </li>
+ <li>
+ FindColumn method converts a line and column into a position, taking into account
+ tabs and multi-byte characters.
+ </li>
+ <li>
+ On Windows, when Scintilla copies text to the clipboard as Unicode, it avoids
+ adding an ANSI copy as the system will automatically convert as required in
+ a context-sensitive manner.
+ </li>
+ <li>
+ SciTE indent.auto setting automatically determines indent.size and use.tabs from
+ document contents.
+ </li>
+ <li>
+ SciTE defines a CurrentMessage property that holds the most recently selected
+ output pane message.
+ </li>
+ <li>
+ SciTE Lua scripting enhanced with
+ <ul>
+ <li>A Lua table called 'buffer' is associated with each buffer and can be used to
+ maintain buffer-specific state.</li>
+ <li>A 'scite' object allows interaction with the application such as opening
+ files from script.</li>
+ <li>Dynamic properties can be reset by assigning nil to a given key in
+ the props table.</li>
+ <li>An 'OnClear' event fires whenever properties and extension scripts are
+ about to be reloaded.</li>
+ <li>On Windows, loadlib is enabled and can be used to access Lua
+ binary modules / DLLs.</li></ul>
+ </li>
+ <li>
+ SciTE Find in Files on Windows can be used in a modeless way and gains a '..'
+ button to move up to the parent directory. It is also wider so that longer paths
+ can be seen.
+ </li>
+ <li>
+ Close buttons added to dialogs in SciTE on Windows.
+ </li>
+ <li>
+ SciTE on GTK+ 2 has a "hidden files" check box in file open dialog.
+ </li>
+ <li>
+ SciTE use.monospaced setting removed. More information in the
+ <a href="SciTEFAQ.html">FAQ</a>.
+ </li>
+ <li>
+ APDL lexer updated with more lexical classes
+ </li>
+ <li>
+ AutoIt3 lexer updated.
+ </li>
+ <li>
+ Ada lexer fixed to support non-ASCII text.
+ </li>
+ <li>
+ Cpp lexer now only matches exactly three slashes as starting a doc-comment so that
+ lines of slashes are seen as a normal comment.
+ Line ending characters are appear in default style on preprocessor and single line
+ comment lines.
+ </li>
+ <li>
+ CSS lexer updated to support CSS2 including second set of keywords.
+ </li>
+ <li>
+ Errorlist lexer now understands Java stack trace lines.
+ </li>
+ <li>
+ SciTE's handling of HTML Tidy messages jumps to column as well as line indicated.
+ </li>
+ <li>
+ Lisp lexer allows multiline strings.
+ </li>
+ <li>
+ Lua lexer treats .. as an operator when between identifiers.
+ </li>
+ <li>
+ PHP lexer handles 'e' in numerical literals.
+ </li>
+ <li>
+ PowerBasic lexer updated for macros and optimised.
+ </li>
+ <li>
+ Properties file folder changed to leave lines before a header at the base level
+ and thus avoid a vertical line when using connected folding symbols.
+ </li>
+ <li>
+ GTK+ on Windows version uses Alt for rectangular selection to be compatible with
+ platform convention.
+ </li>
+ <li>
+ SciTE abbreviations file moved from system directory to user directory
+ so each user can have separate abbreviations.
+ </li>
+ <li>
+ SciTE on GTK+ has improved .desktop file and make install support that may
+ lead to better integration with system shell.
+ </li>
+ <li>
+ Disabling of themed background drawing on GTK+ extended to all cases.
+ </li>
+ <li>
+ SciTE date formatting on Windows performed with the user setting rather than the
+ system setting.
+ </li>
+ <li>
+ GTK+ 2 redraw while scrolling fixed.
+ </li>
+ <li>
+ Recursive property definitions are safer, avoiding expansion when detected.
+ </li>
+ <li>
+ SciTE thread synchronization for scripts no longer uses HWND_MESSAGE
+ so is compatible with older versions of Windows.
+ Other Lua scripting bugs fixed.
+ </li>
+ <li>
+ SciTE on Windows localisation of menu accelerators changed to be compatible
+ with alternative UI themes.
+ </li>
+ <li>
+ SciTE on Windows full screen mode now fits better when menu different height
+ to title bar height.
+ </li>
+ <li>
+ SC_MARK_EMPTY marker is now invisible and does not change the background
+ colour.
+ </li>
+ <li>
+ Bug fixed in HTML lexer to allow use of &lt;?xml in strings in scripts without
+ triggering xml mode.
+ </li>
+ <li>
+ Bug fixed in SciTE abbreviation expansion that could break indentation or crash.
+ </li>
+ <li>
+ Bug fixed when searching for a whole word string that ends one character before
+ end of document.
+ </li>
+ <li>
+ Drawing bug fixed when indicators drawn on wrapped lines.
+ </li>
+ <li>
+ Bug fixed when double clicking a hotspot.
+ </li>
+ <li>
+ Bug fixed where autocompletion would remove typed text if no match found.
+ </li>
+ <li>
+ Bug fixed where display does not scroll when inserting in long wrapped line.
+ </li>
+ <li>
+ Bug fixed where SCI_MARKERDELETEALL would only remove one of the markers
+ on a line that contained multiple markers with the same number.
+ </li>
+ <li>
+ Bug fixed where markers would move when converting line endings.
+ </li>
+ <li>
+ Bug fixed where SCI_LINEENDWRAP would move too far when line ends are visible.
+ </li>
+ <li>
+ Bugs fixed where calltips with unicode or other non-ASCII text would display
+ incorrectly.
+ </li>
+ <li>
+ Bug fixed in determining if at save point after undoing from save point and then
+ performing changes.
+ </li>
+ <li>
+ Bug fixed on GTK+ using unsupported code pages where extraneous text could
+ be drawn.
+ </li>
+ <li>
+ Bug fixed in drag and drop code on Windows where dragging from SciTE to
+ Firefox could hang both applications.
+ </li>
+ <li>
+ Crashing bug fixed on GTK+ when no font allocation succeeds.
+ </li>
+ <li>
+ Crashing bug fixed when autocompleting word longer than 1000 characters.
+ </li>
+ <li>
+ SciTE crashing bug fixed when both Find and Replace dialogs shown by disallowing
+ this situation.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite161.zip?download">Release 1.61</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 29 May 2004.
+ </li>
+ <li>
+ Improvements to selection handling on GTK+.
+ </li>
+ <li>
+ SciTE on GTK+ 2.4 uses the improved file chooser which allows
+ file extension filters, multiple selection, and remembers favourite
+ directories.
+ </li>
+ <li>
+ SciTE Load Session and Save Session commands available on GTK+.
+ </li>
+ <li>
+ SciTE lists Lua Startup Script in Options menu when loaded.
+ </li>
+ <li>
+ In SciTE, OnUserListSelection can be implemented in Lua.
+ </li>
+ <li>
+ SciTE on Windows has a context menu on the file tabs.
+ </li>
+ <li>
+ SQL lexer allows '#' comments and optionally '\' quoting inside strings.
+ </li>
+ <li>
+ Mssql lexer improved.
+ </li>
+ <li>
+ AutoIt3 lexer updated.
+ </li>
+ <li>
+ Perl lexer recognises regular expression use better.
+ </li>
+ <li>
+ Errorlist lexer understands Lua tracebacks and copes with findstr
+ output for file names that end with digits.
+ </li>
+ <li>
+ Drawing of lines on GTK+ improved and made more like Windows
+ without final point.
+ </li>
+ <li>
+ SciTE on GTK+ uses a high resolution window icon.
+ </li>
+ <li>
+ SciTE can be set to warn before loading files larger than a particular size.
+ </li>
+ <li>
+ SciTE Lua scripting bugs fixed included a crashing bug when using
+ an undefined function name that would go before first actual name.
+ </li>
+ <li>
+ SciTE bug fixed where a modified buffer was not saved if it was
+ the last buffer and was not current when the New command used.
+ </li>
+ <li>
+ SciTE monofont mode no longer affects line numbers.
+ </li>
+ <li>
+ Crashing bug in SciTE avoided by not allowing both the Find and Replace
+ dialogs to be visible at one time.
+ </li>
+ <li>
+ Crashing bug in SciTE fixed when Lua scripts were being run
+ concurrently.
+ </li>
+ <li>
+ Bug fixed that caused incorrect line number width in SciTE.
+ </li>
+ <li>
+ PHP folding bug fixed.
+ </li>
+ <li>
+ Regression fixed when setting word characters to not include
+ some of the standard word characters.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite160.zip?download">Release 1.60</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 May 2004.
+ </li>
+ <li>
+ SciTE can be scripted using the Lua programming language.
+ </li>
+ <li>
+ command.mode is a better way to specify tool command options in SciTE.
+ </li>
+ <li>
+ Continuation markers can be displayed so that you can see which lines are wrapped.
+ </li>
+ <li>
+ Lexer for Gui4Cli language.
+ </li>
+ <li>
+ Lexer for Kix language.
+ </li>
+ <li>
+ Lexer for Specman E language.
+ </li>
+ <li>
+ Lexer for AutoIt3 language.
+ </li>
+ <li>
+ Lexer for APDL language.
+ </li>
+ <li>
+ Lexer for Bash language. Also reasonable for other Unix shells.
+ </li>
+ <li>
+ SciTE can load lexers implemented in external shared libraries.
+ </li>
+ <li>
+ Perl treats "." not as part of an identifier and interprets '/' and '->'
+ correctly in more circumstances.
+ </li>
+ <li>
+ PHP recognises variables within strings.
+ </li>
+ <li>
+ NSIS has properties "nsis.uservars" and "nsis.ignorecase".
+ </li>
+ <li>
+ MSSQL lexer adds keyword list for operators and stored procedures,
+ defines '(', ')', and ',' as operators and changes some other details.
+ </li>
+ <li>
+ Input method preedit window on GTK+ 2 may support some Asian languages.
+ </li>
+ <li>
+ Platform interface adds an extra platform-specific flag to Font::Create.
+ Used on wxWidgets to choose antialiased text display but may be used for
+ any task that a platform needs.
+ </li>
+ <li>
+ OnBeforeSave method added to Extension interface.
+ </li>
+ <li>
+ Scintilla methods that return strings can be called with a NULL pointer
+ to find out how long the string should be.
+ </li>
+ <li>
+ Visual Studio .NET project file now in VS .NET 2003 format so can not be used
+ directly in VS .NET 2002.
+ </li>
+ <li>
+ Scintilla can be built with GTK+ 2 on Windows.
+ </li>
+ <li>
+ Updated RPM spec for SciTE on GTK+.
+ </li>
+ <li>
+ GTK+ makefile for SciTE allows selection of destination directory, creates destination
+ directories and sets file modes and owners better.
+ </li>
+ <li>
+ Tab indents now go to next tab multiple rather than add tab size.
+ </li>
+ <li>
+ SciTE abbreviations now use the longest possible match rather than the shortest.
+ </li>
+ <li>
+ Autocompletion does not remove prefix when actioned with no choice selected.
+ </li>
+ <li>
+ Autocompletion cancels when moving beyond the start position, not at the start position.
+ </li>
+ <li>
+ SciTE now shows only calltips for functions that match exactly, not
+ those that match as a prefix.
+ </li>
+ <li>
+ SciTE can repair box comment sections where some lines were added without
+ the box comment middle line prefix.
+ </li>
+ <li>
+ Alt+ works in user.shortcuts on Windows.
+ </li>
+ <li>
+ SciTE on GTK+ enables replace in selection for rectangular selections.
+ </li>
+ <li>
+ Key bindings for command.shortcut implemented in a way that doesn't break
+ when the menus are localised.
+ </li>
+ <li>
+ Drawing of background on GTK+ faster as theme drawing disabled.
+ </li>
+ <li>
+ On GTK+, calltips are moved back onto the screen if they extend beyond the screen bounds.
+ </li>
+ <li>
+ On Windows, the Scintilla object is destroyed on WM_NCDESTROY rather than
+ WM_DESTROY which arrives earlier. This fixes some problems when Scintilla was subclassed.
+ </li>
+ <li>
+ The zorder switching feature removed due to number of crashing bugs.
+ </li>
+ <li>
+ Code for XPM images made more robust.
+ </li>
+ <li>
+ Bug fixed with primary selection on GTK+.
+ </li>
+ <li>
+ On GTK+ 2, copied or cut text can still be pasted after the Scintilla widget is destroyed.
+ </li>
+ <li>
+ Styling change not visible problem fixed when line was cached.
+ </li>
+ <li>
+ Bug in SciTE on Windows fixed where clipboard commands stopped working.
+ </li>
+ <li>
+ Crashing bugs in display fixed in line layout cache.
+ </li>
+ <li>
+ Crashing bug may be fixed on AMD64 processor on GTK+.
+ </li>
+ <li>
+ Rare hanging crash fixed in Python lexer.
+ </li>
+ <li>
+ Display bugs fixed with DBCS characters on GTK+.
+ </li>
+ <li>
+ Autocompletion lists on GTK+ 2 are not sorted by the ListModel as the
+ contents are sorted correctly by Scintilla.
+ </li>
+ <li>
+ SciTE fixed to not open extra untitled buffers with check.if.already.open.
+ </li>
+ <li>
+ Sizing bug fixed on GTK+ when window resized while unmapped.
+ </li>
+ <li>
+ Text drawing crashing bug fixed on GTK+ with non-Pango fonts and long strings.
+ </li>
+ <li>
+ Fixed some issues if characters are unsigned.
+ </li>
+ <li>
+ Fixes in NSIS support.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite159.zip?download">Release 1.59</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 19 February 2004.
+ </li>
+ <li>
+ SciTE Options and Language menus reduced in length by commenting
+ out some languages. Languages can be enabled by editing the global
+ properties file.
+ </li>
+ <li>
+ Verilog language supported.
+ </li>
+ <li>
+ Lexer for Microsoft dialect of SQL. SciTE properties file available from extras page.
+ </li>
+ <li>
+ Perl lexer disambiguates '/' better.
+ </li>
+ <li>
+ NSIS lexer improved with a lexical class for numbers, option for ignoring case
+ of keywords, and folds only occurring when folding keyword first on line.
+ </li>
+ <li>
+ PowerBasic lexer improved with styles for constants and assembler and
+ folding improvements.
+ </li>
+ <li>
+ On GTK+, input method support only invoked for Asian languages and not
+ European languages as the old European keyboard code works better.
+ </li>
+ <li>
+ Scintilla can be requested to allocate a certain amount and so avoid repeated
+ reallocations and memory inefficiencies. SciTE uses this and so should require
+ less memory.
+ </li>
+ <li>
+ SciTE's "toggle current fold" works when invoked on child line as well as
+ fold header.
+ </li>
+ <li>
+ SciTE output pane scrolling can be set to not scroll back to start after
+ completion of command.
+ </li>
+ <li>
+ SciTE has a $(SessionPath) property.
+ </li>
+ <li>
+ SciTE on Windows can use VK_* codes for keys in user.shortcuts.
+ </li>
+ <li>
+ Stack overwrite bug fixed in SciTE's command to move to the end of a
+ preprocessor conditional.
+ </li>
+ <li>
+ Bug fixed where vertical selection appeared to select a different set of characters
+ then would be used by, for example, a copy.
+ </li>
+ <li>
+ SciTE memory leak fixed in fold state remembering.
+ </li>
+ <li>
+ Bug fixed where changing the style of some text outside the
+ standard StyleNeeded notification would not be visible.
+ </li>
+ <li>
+ On GTK+ 2 g_iconv is used in preference to iconv, as it is provided by GTK+
+ so should avoid problems finding the iconv library.
+ </li>
+ <li>
+ On GTK+ fixed a style reference count bug.
+ </li>
+ <li>
+ Memory corruption bug fixed with GetSelText.
+ </li>
+ <li>
+ On Windows Scintilla deletes memory on WM_NCDESTROY rather than
+ the earlier WM_DESTROY to avoid problems when the window is subclassed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite158.zip?download">Release 1.58</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 11 January 2004.
+ </li>
+ <li>
+ Method to discover the currently highlighted element in an autocompletion list.
+ </li>
+ <li>
+ On GTK+, the lexers are now included in the scintilla.a library file. This
+ will require changes to the make files of dependent projects.
+ </li>
+ <li>
+ Octave support added alongside related Matlab language and Matlab support improved.
+ </li>
+ <li>
+ VB lexer gains an unterminated string state and 4 sets of keywords.
+ </li>
+ <li>
+ Ruby lexer handles $' correctly.
+ </li>
+ <li>
+ Error line handling improved for FORTRAN compilers from Absoft and Intel.
+ </li>
+ <li>
+ International input enabled on GTK+ 2 although there is no way to choose an
+ input method.
+ </li>
+ <li>
+ MultiplexExtension in SciTE allows multiple extensions to be used at once.
+ </li>
+ <li>
+ Regular expression replace interprets backslash expressions \a, \b, \f, \n, \r, \t,
+ and \v in the replacement value.
+ </li>
+ <li>
+ SciTE Replace dialog displays number of replacements made when Replace All or
+ Replace in Selection performed.
+ </li>
+ <li>
+ Localisation files may contain a translation.encoding setting which is used
+ on GTK+ 2 to automatically reencode the translation to UTF-8 so it will be
+ the localised text will be displayed correctly.
+ </li>
+ <li>
+ SciTE on GTK+ implements check.if.already.open.
+ </li>
+ <li>
+ Make files for Mac OS X made more robust.
+ </li>
+ <li>
+ Performance improved in SciTE when switching buffers when there
+ is a rectangular selection.
+ </li>
+ <li>
+ Fixed failure to display some text when wrapped.
+ </li>
+ <li>
+ SciTE crashes from Ctrl+Tab buffer cycling fixed.
+ May still be some rare bugs here.
+ </li>
+ <li>
+ Crash fixed when decoding an error message that appears similar to a
+ Borland error message.
+ </li>
+ <li>
+ Fix to auto-scrolling allows containers to implement enhanced double click selection.
+ </li>
+ <li>
+ Hang fixed in idle word wrap.
+ </li>
+ <li>
+ Crash fixed in hotspot display code..
+ </li>
+ <li>
+ SciTE on Windows Incremental Search no longer moves caret back.
+ </li>
+ <li>
+ SciTE hang fixed when performing a replace with a find string that
+ matched zero length strings such as ".*".
+ </li>
+ <li>
+ SciTE no longer styles the whole file when saving buffer fold state
+ as that was slow.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite157.zip?download">Release 1.57</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 27 November 2003.
+ </li>
+ <li>
+ SciTE remembers folding of each buffer.
+ </li>
+ <li>
+ Lexer for Erlang language.
+ </li>
+ <li>
+ Scintilla allows setting the set of white space characters.
+ </li>
+ <li>
+ Scintilla has 'stuttered' page movement commands to first move
+ to top or bottom within current visible lines before scrolling.
+ </li>
+ <li>
+ Scintilla commands for moving to end of words.
+ </li>
+ <li>
+ Incremental line wrap enabled on Windows.
+ </li>
+ <li>
+ SciTE PDF exporter produces output that is more compliant with reader
+ applications, is smaller and allows more configuration.
+ HTML exporter optimizes size of output files.
+ </li>
+ <li>
+ SciTE defines properties PLAT_WINNT and PLAT_WIN95 on the
+ corresponding platforms.
+ </li>
+ <li>
+ SciTE can adjust the line margin width to fit the largest line number.
+ The line.numbers property is split between line.margin.visible and
+ line.margin.width.
+ </li>
+ <li>
+ SciTE on GTK+ allows user defined menu accelerators.
+ Alt can be included in user.shortcuts.
+ </li>
+ <li>
+ SciTE Language menu can have items commented out.
+ </li>
+ <li>
+ SciTE on Windows Go to dialog allows choosing a column number as
+ well as a line number.
+ </li>
+ <li>
+ SciTE on GTK+ make file uses prefix setting more consistently.
+ </li>
+ <li>
+ Bug fixed that caused word wrapping to fail to display all text.
+ </li>
+ <li>
+ Crashing bug fixed in GTK+ version of Scintilla when using GDK fonts
+ and opening autocompletion.
+ </li>
+ <li>
+ Bug fixed in Scintilla SCI_GETSELTEXT where an extra NUL
+ was included at end of returned string
+ </li>
+ <li>
+ Crashing bug fixed in SciTE z-order switching implementation.
+ </li>
+ <li>
+ Hanging bug fixed in Perl lexer.
+ </li>
+ <li>
+ SciTE crashing bug fixed for using 'case' without argument in style definition.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite156.zip?download">Release 1.56</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 25 October 2003.
+ </li>
+ <li>
+ Rectangular selection can be performed using the keyboard.
+ Greater programmatic control over rectangular selection.
+ This has caused several changes to key bindings.
+ </li>
+ <li>
+ SciTE Replace In Selection works on rectangular selections.
+ </li>
+ <li>
+ Improved lexer for TeX, new lexer for Metapost and other support for these
+ languages.
+ </li>
+ <li>
+ Lexer for PowerBasic.
+ </li>
+ <li>
+ Lexer for Forth.
+ </li>
+ <li>
+ YAML lexer improved to include error styling.
+ </li>
+ <li>
+ Perl lexer improved to correctly handle more cases.
+ </li>
+ <li>
+ Assembler lexer updated to support single-quote strings and fix some
+ problems.
+ </li>
+ <li>
+ SciTE on Windows can switch between buffers in order of use (z-order) rather
+ than static order.
+ </li>
+ <li>
+ SciTE supports adding an extension for "Open Selected Filename".
+ The openpath setting works on GTK+.
+ </li>
+ <li>
+ SciTE can Export as XML.
+ </li>
+ <li>
+ SciTE $(SelHeight) variable gives a more natural result for empty and whole line
+ selections.
+ </li>
+ <li>
+ Fixes to wrapping problems, such as only first display line being visible in some
+ cases.
+ </li>
+ <li>
+ Fixes to hotspot to only highlight when over the hotspot, only use background
+ colour when set and option to limit hotspots to a single line.
+ </li>
+ <li>
+ Small fixes to FORTRAN lexing and folding.
+ </li>
+ <li>
+ SQL lexer treats single quote strings as a separate class to double quote strings..
+ </li>
+ <li>
+ Scintilla made compatible with expectations of container widget in GTK+ 2.3.
+ </li>
+ <li>
+ Fix to strip out pixmap ID when automatically choosing from an autocompletion
+ list with only one element.
+ </li>
+ <li>
+ SciTE bug fixed where UTF-8 files longer than 128K were gaining more than one
+ BOM.
+ </li>
+ <li>
+ Crashing bug fixed in SciTE on GTK+ where using "Stop Executing" twice leads
+ to all applications exiting.
+ </li>
+ <li>
+ Bug fixed in autocompletion scrolling on GTK+ 2 with a case sensitive list.
+ The ListBox::Sort method is no longer needed or available so platform
+ maintainers should remove it.
+ </li>
+ <li>
+ SciTE check.if.already.open setting removed from GTK+ version as unmaintained.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite155.zip?download">Release 1.55</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 25 September 2003.
+ </li>
+ <li>
+ Fix a crashing bug in indicator display in Scintilla.
+ </li>
+ <li>
+ GTK+ version now defaults to building for GTK+ 2 rather than 1.
+ </li>
+ <li>
+ Mingw make file detects compiler version and avoids options
+ that are cause problems for some versions.
+ </li>
+ <li>
+ Large performance improvement on GTK+ 2 for long lines.
+ </li>
+ <li>
+ Incremental line wrap on GTK+.
+ </li>
+ <li>
+ International text entry works much better on GTK+ with particular
+ improvements for Baltic languages and languages that use 'dead' accents.
+ NUL key events such as those generated by some function keys, ignored.
+ </li>
+ <li>
+ Unicode clipboard support on GTK+.
+ </li>
+ <li>
+ Indicator type INDIC_BOX draws a rectangle around the text.
+ </li>
+ <li>
+ Clarion language support.
+ </li>
+ <li>
+ YAML language support.
+ </li>
+ <li>
+ MPT LOG language support.
+ </li>
+ <li>
+ On Windows, SciTE can switch buffers based on activation order rather
+ than buffer number.
+ </li>
+ <li>
+ SciTE save.on.deactivate saves all buffers rather than just the current buffer.
+ </li>
+ <li>
+ Lua lexer handles non-ASCII characters correctly.
+ </li>
+ <li>
+ Error lexer understands Borland errors with pathnames that contain space.
+ </li>
+ <li>
+ On GTK+ 2, autocompletion uses TreeView rather than deprecated CList.
+ </li>
+ <li>
+ SciTE autocompletion removed when expand abbreviation command used.
+ </li>
+ <li>
+ SciTE calltips support overloaded functions.
+ </li>
+ <li>
+ When Save fails in SciTE, choice offered to Save As.
+ </li>
+ <li>
+ SciTE message boxes on Windows may be moved to front when needed.
+ </li>
+ <li>
+ Indicators drawn correctly on wrapped lines.
+ </li>
+ <li>
+ Regular expression search no longer matches characters with high bit
+ set to characters without high bit set.
+ </li>
+ <li>
+ Hang fixed in backwards search in multi byte character documents.
+ </li>
+ <li>
+ Hang fixed in SciTE Mark All command when wrap around turned off.
+ </li>
+ <li>
+ SciTE Incremental Search no longer uses hot keys on Windows.
+ </li>
+ <li>
+ Calltips draw non-ASCII characters correctly rather than as arrows.
+ </li>
+ <li>
+ SciTE crash fixed when going to an error message with empty file name.
+ </li>
+ <li>
+ Bugs fixed in XPM image handling code.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite154.zip?download">Release 1.54</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 12 August 2003.
+ </li>
+ <li>
+ SciTE on GTK+ 2.x can display a tab bar.
+ </li>
+ <li>
+ SciTE on Windows provides incremental search.
+ </li>
+ <li>
+ Lexer for PostScript.
+ </li>
+ <li>
+ Lexer for the NSIS scripting language.
+ </li>
+ <li>
+ New lexer for POV-Ray Scene Description Language
+ replaces previous implementation.
+ </li>
+ <li>
+ Lexer for the MMIX Assembler language.
+ </li>
+ <li>
+ Lexer for the Scriptol language.
+ </li>
+ <li>
+ Incompatibility: SQL keywords are specified in lower case rather than upper case.
+ SQL lexer allows double quoted strings.
+ </li>
+ <li>
+ Pascal lexer: character constants that start with '#' understood,
+ '@' only allowed within assembler blocks,
+ '$' can be the start of a number,
+ initial '.' in 0..constant not treated as part of a number,
+ and assembler blocks made more distinctive.
+ </li>
+ <li>
+ Lua lexer allows '.' in keywords.
+ Multi-line strings and comments can be folded.
+ </li>
+ <li>
+ CSS lexer handles multiple psuedoclasses.
+ </li>
+ <li>
+ Properties file folder works for INI file format.
+ </li>
+ <li>
+ Hidden indicator style allows the container to mark text within Scintilla
+ without there being any visual effect.
+ </li>
+ <li>
+ SciTE does not prompt to save changes when the buffer is empty and untitled.
+ </li>
+ <li>
+ Modification notifications caused by SCI_INSERTSTYLEDSTRING
+ now include the contents of the insertion.
+ </li>
+ <li>
+ SCI_MARKERDELETEALL deletes all the markers on a line
+ rather than just the first match.
+ </li>
+ <li>
+ Better handling of 'dead' accents on GTK+ 2 for languages
+ that use accented characters.
+ </li>
+ <li>
+ SciTE now uses value of output.vertical.size property.
+ </li>
+ <li>
+ Crash fixed in SciTE autocompletion on long lines.
+ </li>
+ <li>
+ Crash fixed in SciTE comment command on long lines.
+ </li>
+ <li>
+ Bug fixed with backwards regular expression search skipping
+ every second match.
+ </li>
+ <li>
+ Hang fixed with regular expression replace where both target and replacement were empty.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite153.zip?download">Release 1.53</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 16 May 2003.
+ </li>
+ <li>
+ On GTK+ 2, encodings other than ASCII, Latin1, and Unicode are
+ supported for both display and input using iconv.
+ </li>
+ <li>
+ External lexers supported on GTK+/Linux.
+ External lexers must now be explicitly loaded with SCI_LOADLEXERLIBRARY
+ rather than relying upon a naming convention and automatic loading.
+ </li>
+ <li>
+ Support of Lout typesetting language.
+ </li>
+ <li>
+ Support of E-Scripts language used in the POL Ultima Online Emulator.
+ </li>
+ <li>
+ Scrolling and drawing performance on GTK+ enhanced, particularly for GTK+ 2.x
+ with an extra window for the text area avoiding conflicts with the scroll bars.
+ </li>
+ <li>
+ CopyText and CopyRange methods in Scintilla allow container to
+ easily copy to the system clipboard.
+ </li>
+ <li>
+ Line Copy command implemented and bound to Ctrl+Shift+T.
+ </li>
+ <li>
+ Scintilla APIs PositionBefore and PositionAfter can be used to iterate through
+ a document taking into account the encoding and multi-byte characters.
+ </li>
+ <li>
+ C++ folder can fold on the "} else {" line of an if statement by setting
+ fold.at.else property to 1.
+ </li>
+ <li>
+ C++ lexer allows an extra set of keywords.
+ </li>
+ <li>
+ Property names and thus abbreviations may be non-ASCII.
+ </li>
+ <li>
+ Removed attempt to load a file when setting properties that was
+ part of an old scripting experiment.
+ </li>
+ <li>
+ SciTE no longer warns about a file not existing when opening
+ properties files from the Options menu as there is a good chance
+ the user wants to create one.
+ </li>
+ <li>
+ Bug fixed with brace recognition in multi-byte encoded files where a partial
+ character matched a brace byte.
+ </li>
+ <li>
+ More protection against infinite loops or recursion with recursive property definitions.
+ </li>
+ <li>
+ On Windows, cursor will no longer disappear over margins in custom builds when
+ cursor resource not present. The Windows default cursor is displayed instead.
+ </li>
+ <li>
+ load.on.activate fixed in SciTE as was broken in 1.52.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite152.zip?download">Release 1.52</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 17 April 2003.
+ </li>
+ <li>
+ Pango font support on GTK+ 2.
+ Unicode input improved on GTK+ 2.
+ </li>
+ <li>
+ Hotspot style implemented in Scintilla.
+ </li>
+ <li>
+ Small up and down arrows can be displayed in calltips and the container
+ is notified when the mouse is clicked on a calltip.
+ Normal and selected calltip text colours can be set.
+ </li>
+ <li>
+ POSIX compatibility flag in Scintilla regular expression search
+ interprets bare ( and ) as tagged sections.
+ </li>
+ <li>
+ Error message lexer tightened to yield fewer false matches.
+ Recognition of Lahey and Intel FORTRAN error formats.
+ </li>
+ <li>
+ Scintilla keyboard commands for moving to start and end of
+ screen lines rather than document lines, unless already there
+ where these keys move to the start or end of the document line.
+ </li>
+ <li>
+ Line joining command.
+ </li>
+ <li>
+ Lexer for POV-Ray.
+ </li>
+ <li>
+ Calltips on Windows are no longer clipped by the parent window.
+ </li>
+ <li>
+ Autocompletion lists are cancelled when focus leaves their parent window.
+ </li>
+ <li>
+ Move to next/previous empty line delimited paragraph key commands.
+ </li>
+ <li>
+ SciTE hang fixed with recursive property definitions by placing limit
+ on number of substitutions performed.
+ </li>
+ <li>
+ SciTE Export as PDF reenabled and works.
+ </li>
+ <li>
+ Added loadsession: command line command to SciTE.
+ </li>
+ <li>
+ SciTE option to quit application when last document closed.
+ </li>
+ <li>
+ SciTE option to ask user if it is OK to reload a file that has been
+ modified outside SciTE.
+ </li>
+ <li>
+ SciTE option to automatically save before running particular command tools
+ or to ask user or to not save.
+ </li>
+ <li>
+ SciTE on Windows 9x will write a Ctrl+Z to the process input pipe before
+ closing the pipe when running tool commands that take input.
+ </li>
+ <li>
+ Added a manifest resource to SciTE on Windows to enable Windows XP
+ themed UI.
+ </li>
+ <li>
+ SciTE calltips handle nested calls and other situations better.
+ </li>
+ <li>
+ CSS lexer improved.
+ </li>
+ <li>
+ Interface to platform layer changed - Surface initialisation now requires
+ a WindowID parameter.
+ </li>
+ <li>
+ Bug fixed with drawing or measuring long pieces of text on Windows 9x
+ by truncating the pieces.
+ </li>
+ <li>
+ Bug fixed with SciTE on GTK+ where a user shortcut for a visible character
+ inserted the character as well as executing the command.
+ </li>
+ <li>
+ Bug fixed where primary selection on GTK+ was reset by
+ Scintilla during creation.
+ </li>
+ <li>
+ Bug fixed where SciTE would close immediately on startup
+ when using save.session.
+ </li>
+ <li>
+ Crash fixed when entering '\' in LaTeX file.
+ </li>
+ <li>
+ Hang fixed when '#' last character in VB file.
+ </li>
+ <li>
+ Crash fixed in error message lexer.
+ </li>
+ <li>
+ Crash fixed when searching for long regular expressions.
+ </li>
+ <li>
+ Pressing return when nothing selected in user list sends notification with
+ empty text rather than random text.
+ </li>
+ <li>
+ Mouse debouncing disabled on Windows as it interfered with some
+ mouse utilities.
+ </li>
+ <li>
+ Bug fixed where overstrike mode inserted before rather than replaced last
+ character in document.
+ </li>
+ <li>
+ Bug fixed with syntax highlighting of Japanese text.
+ </li>
+ <li>
+ Bug fixed in split lines function.
+ </li>
+ <li>
+ Cosmetic fix to SciTE tab bar on Windows when window resized.
+ Focus sticks to either pane more consistently.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite151.zip?download">Release 1.51</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 16 February 2003.
+ </li>
+ <li>
+ Two phase drawing avoids cutting off text that overlaps runs by drawing
+ all the backgrounds of a line then drawing all the text transparently.
+ Single phase drawing is an option.
+ </li>
+ <li>
+ Scintilla method to split lines at a particular width by adding new line
+ characters.
+ </li>
+ <li>
+ The character used in autocompletion lists to separate the text from the image
+ number can be changed.
+ </li>
+ <li>
+ The scrollbar range will automatically expand when the caret is moved
+ beyond the current range.
+ The scroll bar is updated when SCI_SETXOFFSET is called.
+ </li>
+ <li>
+ Mouse cursors on GTK+ improved to be consistent with other applications
+ and the Windows version.
+ </li>
+ <li>
+ Horizontal scrollbar on GTK+ now disappears in wrapped mode.
+ </li>
+ <li>
+ Scintilla on GTK+ 2: mouse wheel scrolling, cursor over scrollbars, focus,
+ and syntax highlighting now work.
+ gtk_selection_notify avoided for compatibility with GTK+ 2.2.
+ </li>
+ <li>
+ Fold margin colours can now be set.
+ </li>
+ <li>
+ SciTE can be built for GTK+ 2.
+ </li>
+ <li>
+ SciTE can optionally preserve the undo history over an automatic file reload.
+ </li>
+ <li>
+ Tags can optionally be case insensitive in XML and HTML.
+ </li>
+ <li>
+ SciTE on Windows handles input to tool commands in a way that should avoid
+ deadlock. Output from tools can be used to replace the selection.
+ </li>
+ <li>
+ SciTE on GTK+ automatically substitutes '|' for '/' in menu items as '/'
+ is used to define the menu hierarchy.
+ </li>
+ <li>
+ Optional buffer number in SciTE title bar.
+ </li>
+ <li>
+ Crash fixed in SciTE brace matching.
+ </li>
+ <li>
+ Bug fixed where automatic scrolling past end of document
+ flipped back to the beginning.
+ </li>
+ <li>
+ Bug fixed where wrapping caused text to disappear.
+ </li>
+ <li>
+ Bug fixed on Windows where images in autocompletion lists were
+ shown on the wrong item.
+ </li>
+ <li>
+ Crash fixed due to memory bug in autocompletion lists on Windows.
+ </li>
+ <li>
+ Crash fixed when double clicking some error messages.
+ </li>
+ <li>
+ Bug fixed in word part movement where sometimes no movement would occur.
+ </li>
+ <li>
+ Bug fixed on Windows NT where long text runs were truncated by
+ treating NT differently to 9x where there is a limitation.
+ </li>
+ <li>
+ Text in not-changeable style works better but there remain some cases where
+ it is still possible to delete text protected this way.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite150.zip?download">Release 1.50</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 24 January 2003.
+ </li>
+ <li>
+ Autocompletion lists may have a per-item pixmap.
+ </li>
+ <li>
+ Autocompletion lists allow Unicode text on Windows.
+ </li>
+ <li>
+ Scintilla documentation rewritten.
+ </li>
+ <li>
+ Additional DBCS encoding support in Scintilla on GTK+ primarily aimed at
+ Japanese EUC encoding.
+ </li>
+ <li>
+ CSS (Cascading Style Sheets) lexer added.
+ </li>
+ <li>
+ diff lexer understands some more formats.
+ </li>
+ <li>
+ Fold box feature is an alternative way to show the structure of code.
+ </li>
+ <li>
+ Avenue lexer supports multiple keyword lists.
+ </li>
+ <li>
+ The caret may now be made invisible by setting the caret width to 0.
+ </li>
+ <li>
+ Python folder attaches comments before blocks to the next block rather
+ than the previous block.
+ </li>
+ <li>
+ SciTE openpath property on Windows searches a path for files that are
+ the subject of the Open Selected Filename command.
+ </li>
+ <li>
+ The localisation file name can be changed with the locale.properties property.
+ </li>
+ <li>
+ On Windows, SciTE can pipe the result of a string expression into a command line tool.
+ </li>
+ <li>
+ On Windows, SciTE's Find dialog has a Mark All button.
+ </li>
+ <li>
+ On Windows, there is an Insert Abbreviation command that allows a choice from
+ the defined abbreviations and inserts the selection into the abbreviation at the
+ position of a '|'.
+ </li>
+ <li>
+ Minor fixes to Fortran lexer.
+ </li>
+ <li>
+ fold.html.preprocessor decides whether to fold &lt;? and ?&gt;.
+ Minor improvements to PHP folding.
+ </li>
+ <li>
+ Maximum number of keyword lists allowed increased from 6 to 9.
+ </li>
+ <li>
+ Duplicate line command added with default assignment to Ctrl+D.
+ </li>
+ <li>
+ SciTE sets $(Replacements) to the number of replacements made by the
+ Replace All command. $(CurrentWord) is set to the word before the caret if the caret
+ is at the end of a word.
+ </li>
+ <li>
+ Opening a SciTE session now loads files in remembered order, sets the current file
+ as remembered, and moves the caret to the remembered line.
+ </li>
+ <li>
+ Bugs fixed with printing on Windows where line wrapping was causing some text
+ to not print.
+ </li>
+ <li>
+ Bug fixed with Korean Input Method Editor on Windows.
+ </li>
+ <li>
+ Bugs fixed with line wrap which would sometimes choose different break positions
+ after switching focus away and back.
+ </li>
+ <li>
+ Bug fixed where wheel scrolling had no effect on GTK+ after opening a fold.
+ </li>
+ <li>
+ Bug fixed with file paths containing non-ASCII characters on Windows.
+ </li>
+ <li>
+ Crash fixed with printing on Windows after defining pixmap marker.
+ </li>
+ <li>
+ Crash fixed in makefile lexer when first character on line was '='.
+ </li>
+ <li>
+ Bug fixed where local properties were not always being applied.
+ </li>
+ <li>
+ Ctrl+Keypad* fold command works on GTK+.
+ </li>
+ <li>
+ Hangs fixed in SciTE's Replace All command when replacing regular expressions '^'
+ or '$'.
+ </li>
+ <li>
+ SciTE monospace setting behaves more sensibly.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite149.zip?download">Release 1.49</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 November 2002.
+ </li>
+ <li>
+ Unicode supported on GTK+. To perform well, this added a font cache to GTK+
+ and to make that safe, a mutex is used. The mutex requires the application to link in
+ the threading library by evaluating `glib-config --libs gthread`. A Unicode locale
+ should also be set up by a call like setlocale(LC_CTYPE, "en_US.UTF-8").
+ scintilla_release_resources function added to release mutex.
+ </li>
+ <li>
+ FORTRAN and assembler lexers added along with other support for these
+ languages in SciTE.
+ </li>
+ <li>
+ Ada lexer improved handling of based numbers, identifier validity and attributes
+ distinguished from character literals.
+ </li>
+ <li>
+ Lua lexer handles block comments and a deep level of nesting for literal strings
+ and block comments.
+ </li>
+ <li>
+ Errorlist lexer recognises PHP error messages.
+ </li>
+ <li>
+ Variant of the C++ lexer with case insensitive keywords
+ called cppnocase. Whitespace in preprocessor text handled more correctly.
+ </li>
+ <li>
+ Folder added for Perl.
+ </li>
+ <li>
+ Compilation with GCC 3.2 supported.
+ </li>
+ <li>
+ Markers can be pixmaps.
+ </li>
+ <li>
+ Lines are wrapped when printing.
+ Bug fixed which printed line numbers in different styles.
+ </li>
+ <li>
+ Text can be appended to end with AppendText method.
+ </li>
+ <li>
+ ChooseCaretX method added.
+ </li>
+ <li>
+ Vertical scroll bar can be turned off with SetVScrollBar method.
+ </li>
+ <li>
+ SciTE Save All command saves all buffers.
+ </li>
+ <li>
+ SciTE localisation compares keys case insensitively to make translations more flexible.
+ </li>
+ <li>
+ SciTE detects a utf-8 coding cookie "coding: utf-8" in first two
+ lines and goes into Unicode mode.
+ </li>
+ <li>
+ SciTE key bindings are definable.
+ </li>
+ <li>
+ SciTE Find in Files dialog can display directory browser to
+ choose directory to search.
+ </li>
+ <li>
+ SciTE enabling of undo and redo toolbar buttons improved.
+ </li>
+ <li>
+ SciTE on Windows file type filters in open dialog sorted.
+ </li>
+ <li>
+ Fixed crashing bug when using automatic tag closing in XML or HTML.
+ </li>
+ <li>
+ Fixed bug on Windows causing very long (&gt;64K) lines to not display.
+ </li>
+ <li>
+ Fixed bug in backwards regular expression searching.
+ </li>
+ <li>
+ Fixed bug in calltips where wrong argument was highlighted.
+ </li>
+ <li>
+ Fixed bug in tab timmy feature when file has line feed line endings.
+ </li>
+ <li>
+ Fixed bug in compiling without INCLUDE_DEPRECATED_FEATURES
+ defined.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite148.zip?download">Release 1.48</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 9 September 2002.
+ </li>
+ <li>
+ Improved Pascal lexer with context sensitive keywords
+ and separate folder which handles //{ and //} folding comments and
+ {$region} and {$end} folding directives.
+ The "case" statement now folds correctly.
+ </li>
+ <li>
+ C++ lexer correctly handles comments on preprocessor lines.
+ </li>
+ <li>
+ New commands for moving to beginning and end of display lines when in line
+ wrap mode. Key bindings added for these commands.
+ </li>
+ <li>
+ New marker symbols that look like ">>>" and "..." which can be used for
+ interactive shell prompts for Python.
+ </li>
+ <li>
+ The foreground and background colours of visible whitespace can be chosen
+ independent of the colours chosen for the lexical class of that whitespace.
+ </li>
+ <li>
+ Per line data optimised by using an exponential allocation scheme.
+ </li>
+ <li>
+ SciTE API file loading optimised.
+ </li>
+ <li>
+ SciTE for GTK+ subsystem 2 documented. The exit status of commands
+ is decoded into more understandable fields.
+ </li>
+ <li>
+ SciTE find dialog remembers previous find string when there is no selection.
+ Find in Selection button disabled when selection is rectangular as command
+ did not work.
+ </li>
+ <li>
+ Shift+Enter made equivalent to Enter to avoid users having to let go of
+ the shift key when typing. Avoids the possibility of entering single carriage
+ returns in a file that contains CR+LF line ends.
+ </li>
+ <li>
+ Autocompletion does not immediately disappear when the length parameter
+ to SCI_AUTOCSHOW is 0.
+ </li>
+ <li>
+ SciTE focuses on the editor pane when File | New executed and when the
+ output pane is closed with F8. Double clicking on a non-highlighted output
+ pane line selects the word under the cursor rather than seeking the next
+ highlighted line.
+ </li>
+ <li>
+ SciTE director interface implements an "askproperty" command.
+ </li>
+ <li>
+ SciTE's Export as LaTeX output improved.
+ </li>
+ <li>
+ Better choice of autocompletion displaying above the caret rather then
+ below when that is more sensible.
+ </li>
+ <li>
+ Bug fixed where context menu would not be completely visible if invoked
+ when cursor near bottom or left of screen.
+ </li>
+ <li>
+ Crashing bug fixed when displaying long strings on GTK+ caused failure of X server
+ by displaying long text in segments.
+ </li>
+ <li>
+ Crashing bug fixed on GTK+ when a Scintilla window was removed from its parent
+ but was still the selection owner.
+ </li>
+ <li>
+ Bug fixed on Windows in Unicode mode where not all characters on a line
+ were displayed when that line contained some characters not in ASCII.
+ </li>
+ <li>
+ Crashing bug fixed in SciTE on Windows with clearing output while running command.
+ </li>
+ <li>
+ Bug fixed in SciTE for GTK+ with command completion not detected when
+ no output was produced by the command.
+ </li>
+ <li>
+ Bug fixed in SciTE for Windows where menus were not shown translated.
+ </li>
+ <li>
+ Bug fixed where words failed to display in line wrapping mode with visible
+ line ends.
+ </li>
+ <li>
+ Bug fixed in SciTE where files opened from a session file were not closed.
+ </li>
+ <li>
+ Cosmetic flicker fixed when using Ctrl+Up and Ctrl+Down with some caret policies.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite147.zip?download">Release 1.47</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 August 2002.
+ </li>
+ <li>
+ Support for GTK+ 2 in Scintilla. International input methods not supported
+ on GTK+2.
+ </li>
+ <li>
+ Line wrapping performance improved greatly.
+ </li>
+ <li>
+ New caret policy implementation that treats horizontal and vertical
+ positioning equivalently and independently. Old caret policy methods
+ deprecated and not all options work correctly with old methods.
+ </li>
+ <li>
+ Extra fold points for C, C++, Java, ... for fold comments //{ .. //} and
+ #if / #ifdef .. #endif and the #region .. #endregion feature of C#.
+ </li>
+ <li>
+ Scintilla method to find the height in pixels of a line. Currently returns the
+ same result for every line as all lines are same height.
+ </li>
+ <li>
+ Separate make file, scintilla_vc6.mak, for Scintilla to use Visual C++
+ version 6 since main makefile now assumes VS .NET.
+ VS .NET project files available for combined Scintilla and
+ SciTE in scite/boundscheck.
+ </li>
+ <li>
+ SciTE automatically recognises Unicode files based
+ on their Byte Order Marks and switches to Unicode mode.
+ On Windows, where SciTE supports Unicode display, this
+ allows display of non European characters.
+ The file is saved back into the same character encoding unless
+ the user decides to switch using the File | Encoding menu.
+ </li>
+ <li>
+ Handling of character input changed so that a fillup character, typically '('
+ displays a calltip when an autocompletion list was being displayed.
+ </li>
+ <li>
+ Multiline strings lexed better for C++ and Lua.
+ </li>
+ <li>
+ Regular expressions in JavaScript within hypertext files are lexed better.
+ </li>
+ <li>
+ On Windows, Scintilla exports a function called Scintilla_DirectFunction
+ that can be used the same as the function returned by GetDirectFunction.
+ </li>
+ <li>
+ Scintilla converts line endings of text obtained from the clipboard to
+ the current default line endings.
+ </li>
+ <li>
+ New SciTE property ensure.final.line.end can ensure that saved files
+ always end with a new line as this is required by some tools.
+ The ensure.consistent.line.ends property ensures all line ends are the
+ current default when saving files.
+ The strip.trailing.spaces property now works on the buffer so the
+ buffer in memory and the file on disk are the same after a save is performed.
+ </li>
+ <li>
+ The SciTE expand abbreviation command again allows '|' characters
+ in expansions to be quoted by using '||'.
+ </li>
+ <li>
+ SciTE on Windows can send data to the find tool through standard
+ input rather than using a command line argument to avoid problems
+ with quoting command line arguments.
+ </li>
+ <li>
+ The Stop Executing command in SciTE on Windows improved to send
+ a Ctrl+Z character to the tool. Better messages when stopping a tool.
+ </li>
+ <li>
+ Autocompletion can automatically "fill up" when one of a set of characters is
+ type with the autocomplete.&lt;lexer&gt;.fillups property.
+ </li>
+ <li>
+ New predefined properties in SciTE, SelectionStartColumn, SelectionStartLine,
+ SelectionEndColumn, SelectionEndLine can be used to integrate with other
+ applications.
+ </li>
+ <li>
+ Environment variables are available as properties in SciTE.
+ </li>
+ <li>
+ SciTE on Windows keeps status line more current.
+ </li>
+ <li>
+ Abbreviations work in SciTE on Linux when first opened.
+ </li>
+ <li>
+ File saving fixed in SciTE to ensure files are not closed when they can not be
+ saved because of file permissions. Also fixed a problem with buffers that
+ caused files to not be saved.
+ </li>
+ <li>
+ SciTE bug fixed where monospace mode not remembered when saving files.
+ Some searching options now remembered when switching files.
+ </li>
+ <li>
+ SciTE on Linux now waits on child termination when it shuts a child down
+ to avoid zombies.
+ </li>
+ <li>
+ SciTE on Linux has a Print menu command that defaults to invoking a2ps.
+ </li>
+ <li>
+ Fixed incorrect highlighting of indentation guides in SciTE for Python.
+ </li>
+ <li>
+ Crash fixed in Scintilla when calling GetText for 0 characters.
+ </li>
+ <li>
+ Exporting as LaTeX improved when processing backslashes and tabs
+ and setting up font.
+ </li>
+ <li>
+ Crash fixed in SciTE when exporting or copying as RTF.
+ </li>
+ <li>
+ SciTE session loading fixed to handle more than 10 files in session.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite146.zip?download">Release 1.46</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 10 May 2002.
+ </li>
+ <li>
+ Set of lexers compiled into Scintilla can now be changed by adding and
+ removing lexer source files from scintilla/src and running LexGen.py.
+ </li>
+ <li>
+ SCN_ZOOM notification provided by Scintilla when user changes zoom level.
+ Method to determine width of strings in pixels so that elements can be sized
+ relative to text size.
+ SciTE changed to keep line number column displaying a given
+ number of characters.
+ </li>
+ <li>
+ The logical width of the document used to determine scroll bar range can be set.
+ </li>
+ <li>
+ Setting to allow vertical scrolling to display last line at top rather than
+ bottom of window.
+ </li>
+ <li>
+ Read-only mode improved to avoid changing the selection in most cases
+ when a modification is attempted. Drag and drop cursors display correctly
+ for read-only in some cases.
+ </li>
+ <li>
+ Visual C++ options in make files changed to suit Visual Studio .NET.
+ </li>
+ <li>
+ Scintilla.iface includes feature types for enumerations and lexers.
+ </li>
+ <li>
+ Lua lexer improves handling of literal strings and copes with nested literal strings.
+ </li>
+ <li>
+ Diff lexer changed to treat lines starting with "***" similarly to "---".
+ Symbolic names defined for lexical classes.
+ </li>
+ <li>
+ nncrontab lexer improved.
+ </li>
+ <li>
+ Turkish fonts (iso8859-9) supported on GTK+.
+ </li>
+ <li>
+ Automatic close tag feature for XML and HTML in SciTE.
+ </li>
+ <li>
+ Automatic indentation in SciTE improved.
+ </li>
+ <li>
+ Maximum number of buffers available in SciTE increased. May be up to 100
+ although other restrictions on menu length limit the real maximum.
+ </li>
+ <li>
+ Save a Copy command added to SciTE.
+ </li>
+ <li>
+ Export as TeX command added to SciTE.
+ </li>
+ <li>
+ Export as HTML command in SciTE respects Use Monospaced Font and
+ background colour settings.
+ </li>
+ <li>
+ Compilation problem on Solaris fixed.
+ </li>
+ <li>
+ Order of files displayed for SciTE's previous and next menu and key commands
+ are now consistent.
+ </li>
+ <li>
+ Saving of MRU in recent file changed so files open when SciTE quit
+ are remembered.
+ </li>
+ <li>
+ More variants of ctags tags handled by Open Selected Filename in SciTE.
+ </li>
+ <li>
+ JavaScript embedded in XML highlighted again.
+ </li>
+ <li>
+ SciTE status bar updated after changing parameters in case they are being
+ displayed in status bar.
+ </li>
+ <li>
+ Crash fixed when handling some multi-byte languages.
+ </li>
+ <li>
+ Crash fixed when replacing end of line characters.
+ </li>
+ <li>
+ Bug in SciTE fixed in multiple buffer mode where automatic loading
+ turned on could lead to losing file contents.
+ </li>
+ <li>
+ Bug in SciTE on GTK+ fixed where dismissing dialogs with close box led to
+ those dialogs never being shown again.
+ </li>
+ <li>
+ Bug in SciTE on Windows fixed where position.tile with default positions
+ led to SciTE being positioned off-screen.
+ </li>
+ <li>
+ Bug fixed in read-only mode, clearing all deletes contraction state data
+ leading to it not being synchronized with text.
+ </li>
+ <li>
+ Crash fixed in SciTE on Windows when tab bar displayed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite145.zip?download">Release 1.45</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 15 March 2002.
+ </li>
+ <li>
+ Line layout cache implemented to improve performance by maintaining
+ the positioning of characters on lines. Can be set to cache nothing,
+ the line with the caret, the visible page or the whole document.
+ </li>
+ <li>
+ Support, including a new lexer, added for Matlab programs.
+ </li>
+ <li>
+ Lua folder supports folding {} ranges and compact mode.
+ Lua lexer styles floating point numbers in number style instead of
+ setting the '.' in operator style.
+ Up to 6 sets of keywords.
+ Better support for [[ although only works well
+ when all on one line.
+ </li>
+ <li>
+ Python lexer improved to handle floating point numbers that contain negative
+ exponents and that start with '.'.
+ </li>
+ <li>
+ When performing a rectangular paste, the caret now remains at the
+ insertion point.
+ </li>
+ <li>
+ On Windows with a wheel mouse, page-at-a-time mode is recognised.
+ </li>
+ <li>
+ Read-only mode added to SciTE with a property to initialise it and another property,
+ $(ReadOnly) available to show this mode in the status bar.
+ </li>
+ <li>
+ SciTE status bar can show the number of lines in the selection
+ with the $(SelHeight) property.
+ </li>
+ <li>
+ SciTE's "Export as HTML" command uses the current character set to produce
+ correct output for non-Western-European character sets, such as Russian.
+ </li>
+ <li>
+ SciTE's "Export as RTF" fixed to produce correct output when file contains '\'.
+ </li>
+ <li>
+ SciTE goto command accepts a column as well as a line.
+ If given a column, it selects the word at that column.
+ </li>
+ <li>
+ SciTE's Build, Compile and Go commands are now disabled if no
+ action has been assigned to them.
+ </li>
+ <li>
+ The Refresh button in the status bar has been removed from SciTE on Windows.
+ </li>
+ <li>
+ Bug fixed in line wrap mode where cursor up or down command did not work.
+ </li>
+ <li>
+ Some styling bugs fixed that were due to a compilation problem with
+ gcc and inline functions with same name but different code.
+ </li>
+ <li>
+ The way that lexers loop over text was changed to avoid accessing beyond the
+ end or setting beyond the end. May fix some bugs and make the code safer but
+ may also cause new bugs.
+ </li>
+ <li>
+ Bug fixed in HTML lexer's handling of SGML.
+ </li>
+ <li>
+ Bug fixed on GTK+/X where lines wider than 32767 pixels did not display.
+ </li>
+ <li>
+ SciTE bug fixed with file name generation for standard property files.
+ </li>
+ <li>
+ SciTE bug fixed with Open Selected Filename command when used with
+ file name and line number combination.
+ </li>
+ <li>
+ In SciTE, indentation and tab settings stored with buffers so maintained correctly
+ as buffers selected.
+ The properties used to initialise these settings can now be set separately for different
+ file patterns.
+ </li>
+ <li>
+ Thread safety improved on Windows with a critical section protecting the font
+ cache and initialisation of globals performed within Scintilla_RegisterClasses.
+ New Scintilla_ReleaseResources call provided to allow explicit freeing of resources
+ when statically bound into another application. Resources automatically freed
+ in DLL version. The window classes are now unregistered as part of resource
+ freeing which fixes bugs that occurred in some containers such as Internet Explorer.
+ </li>
+ <li>
+ 'make install' fixed on Solaris.
+ </li>
+ <li>
+ Bug fixed that could lead to a file being opened twice in SciTE.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite144.zip?download">Release 1.44</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 4 February 2002.
+ </li>
+ <li>
+ Crashing bug fixed in Editor::Paint.
+ </li>
+ <li>
+ Lua lexer no longer treats '.' as a word character and
+ handles 6 keyword sets.
+ </li>
+ <li>
+ WordStartPosition and WordEndPosition take an onlyWordCharacters
+ argument.
+ </li>
+ <li>
+ SciTE option for simplified automatic indentation which repeats
+ the indentation of the previous line.
+ </li>
+ <li>
+ Compilation fix on Alpha because of 64 bit.
+ </li>
+ <li>
+ Compilation fix for static linking.
+ </li>
+ <li>
+ Limited maximum line length handled to 8000 characters as previous
+ value of 16000 was causing stack exhaustion crashes for some.
+ </li>
+ <li>
+ When whole document line selected, only the last display line gets
+ the extra selected rectangle at the right hand side rather than
+ every display line.
+ </li>
+ <li>
+ Caret disappearing bug fixed for the case that the caret was not on the
+ first display line of a document line.
+ </li>
+ <li>
+ SciTE bug fixed where untitled buffer containing text was sometimes
+ deleted without chance to save.
+ </li>
+ <li>
+ SciTE bug fixed where use.monospaced not working with
+ multiple buffers.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite143.zip?download">Release 1.43</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 19 January 2002.
+ </li>
+ <li>
+ Line wrapping robustness and performance improved in Scintilla.
+ </li>
+ <li>
+ Line wrapping option added to SciTE for both edit and output panes.
+ </li>
+ <li>
+ Static linking on Windows handles cursor resource better.
+ Documentation of static linking improved.
+ </li>
+ <li>
+ Autocompletion has an option to delete any word characters after the caret
+ upon selecting an item.
+ </li>
+ <li>
+ FOX version identified by PLAT_FOX in Platform.h.
+ </li>
+ <li>
+ Calltips in SciTE use the calltip.&lt;lexer&gt;.word.characters setting to
+ correctly find calltips for functions that include characters like '$' which
+ is not normally considered a word character.
+ </li>
+ <li>
+ SciTE has a command to show help on itself which gets hooked up to displaying
+ SciTEDoc.html.
+ </li>
+ <li>
+ SciTE option calltip.&lt;lexer&gt;.end.definition to display help text on a
+ second line of calltip.
+ </li>
+ <li>
+ Fixed the handling of the Buffers menu on GTK+ to ensure current buffer
+ indicated and no warnings occur.
+ Changed some menu items on GTK+ version to be same as Windows version.
+ </li>
+ <li>
+ use.monospaced property for SciTE determines initial state of Use Monospaced Font
+ setting.
+ </li>
+ <li>
+ The SciTE Complete Symbol command now works when there are no word
+ characters before the caret, even though it is slow to display the whole set of
+ symbols.
+ </li>
+ <li>
+ Function names removed from SciTE's list of PHP keywords. The full list of
+ predefined functions is available from another web site mentioned on the
+ Extras page.
+ </li>
+ <li>
+ Crashing bug at startup on GTK+ for some configurations fixed.
+ </li>
+ <li>
+ Crashing bug on GTK+ on 64 bit platforms fixed.
+ </li>
+ <li>
+ Compilation problem with some compilers fixed in GTK+.
+ </li>
+ <li>
+ Japanese text entry improved on Windows 9x.
+ </li>
+ <li>
+ SciTE recent files directory problem on Windows when HOME and SciTE_HOME
+ environment variables not set is now the directory of the executable.
+ </li>
+ <li>
+ Session files no longer include untitled buffers.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite142.zip?download">Release 1.42</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 24 December 2001.
+ </li>
+ <li>
+ Better localisation support including context menus and most messages.
+ Translations of the SciTE user interface available for Bulgarian,
+ French, German, Italian, Russian, and Turkish.
+ </li>
+ <li>
+ Can specify a character to use to indicate control characters
+ rather than having them displayed as mnemonics.
+ </li>
+ <li>
+ Scintilla key command for backspace that will not delete line
+ end characters.
+ </li>
+ <li>
+ Scintilla method to find start and end of words.
+ </li>
+ <li>
+ SciTE on GTK+ now supports the load.on.activate and save.on.deactivate
+ properties in an equivalent way to the Windows version.
+ </li>
+ <li>
+ The output pane of SciTE on Windows is now interactive so command line
+ utilities that prompt for input or confirmation can be used.
+ </li>
+ <li>
+ SciTE on Windows can choose directory for a "Find in Files"
+ command like the GTK+ version could.
+ </li>
+ <li>
+ SciTE can now load a set of API files rather than just one file.
+ </li>
+ <li>
+ ElapsedTime class added to Platform for accurate measurement of durations.
+ Used for debugging and for showing the user how long commands take in SciTE.
+ </li>
+ <li>
+ Baan lexer added.
+ </li>
+ <li>
+ In C++ lexer, document comment keywords no longer have to be at the start
+ of the line.
+ </li>
+ <li>
+ PHP lexer changed to match keywords case insensitively.
+ </li>
+ <li>
+ More shell keywords added.
+ </li>
+ <li>
+ SciTE support for VoiceXML added to xml.properties.
+ </li>
+ <li>
+ In SciTE the selection is not copied to the find field of the Search and Replace
+ dialogs if it contains end of line characters.
+ </li>
+ <li>
+ SciTE on Windows has a menu item to decide whether to respond to other
+ instances which are performing their check.if.already.open check.
+ </li>
+ <li>
+ SciTE accelerator key for Box Comment command changed to avoid problems
+ in non-English locales.
+ </li>
+ <li>
+ SciTE context menu includes Close command for the editor pane and
+ Hide command for the output pane.
+ </li>
+ <li>
+ output: command added to SciTE director interface to add text to the
+ output pane. The director interface can execute commands (such as tool
+ commands with subsystem set to 3) by sending a macro:run message.
+ </li>
+ <li>
+ SciTE on GTK+ will defer to the Window Manager for position if position.left or
+ position.top not set and for size if position.width or position.height not set.
+ </li>
+ <li>
+ SciTE on Windows has a position.tile property to place a second instance
+ to the right of the first.
+ </li>
+ <li>
+ Scintilla on Windows again supports EM_GETSEL and EM_SETSEL.
+ </li>
+ <li>
+ Problem fixed in Scintilla on Windows where control ID is no longer cached
+ as it could be changed by external code.
+ </li>
+ <li>
+ Problems fixed in SciTE on Windows when finding any other open instances at
+ start up when check.if.already.open is true.
+ </li>
+ <li>
+ Bugs fixed in SciTE where command strings were not always having
+ variables evaluated.
+ </li>
+ <li>
+ Bugs fixed with displaying partial double-byte and Unicode characters
+ in rectangular selections and at the edge when edge mode is EDGE_BACKGROUND.
+ Column numbers reported by GetColumn treat multiple byte characters as one column
+ rather than counting bytes.
+ </li>
+ <li>
+ Bug fixed with caret movement over folded lines.
+ </li>
+ <li>
+ Another bug fixed with tracking selection in secondary views when performing
+ modifications.
+ </li>
+ <li>
+ Horizontal scrolling and display of long lines optimised.
+ </li>
+ <li>
+ Cursor setting in Scintilla on GTK+ optimised.
+ </li>
+ <li>
+ Experimental changeable style attribute.
+ Set to false to make text read-only.
+ Currently only stops caret from being within not-changeable
+ text and does not yet stop deleting a range that contains
+ not-changeable text.
+ Can be used from SciTE by adding notchangeable to style entries.
+ </li>
+ <li>
+ Experimental line wrapping.
+ Currently has performance and appearance problems.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite141.zip?download">Release 1.41</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 6 November 2001.
+ </li>
+ <li>
+ Changed Platform.h to not include platform headers. This lessens likelihood and impact of
+ name clashes from system headers and also speeds up compilation.
+ Renamed DrawText to DrawTextNoClip to avoid name clash.
+ </li>
+ <li>
+ Changed way word functions work to treat a sequence of punctuation as
+ a word. This is more sensible and also more compatible with other editors.
+ </li>
+ <li>
+ Cursor changes over the margins and selection on GTK+ platform.
+ </li>
+ <li>
+ SC_MARK_BACKGROUND is a marker that only changes the line's background colour.
+ </li>
+ <li>
+ Enhanced Visual Basic lexer handles character date and octal literals,
+ and bracketed keywords for VB.NET. There are two VB lexers, vb and vbscript
+ with type indication characters like ! and $ allowed at the end of identifiers
+ in vb but not vbscript. Lexer states now separate from those used for C++ and
+ names start with SCE_B.
+ </li>
+ <li>
+ Lexer added for Bullant language.
+ </li>
+ <li>
+ The horizontal scroll position, xOffset, is now exposed through the API.
+ </li>
+ <li>
+ The SCN_POSCHANGED notification is deprecated as it was causing confusion.
+ Use SCN_UPDATEUI instead.
+ </li>
+ <li>
+ Compilation problems fixed for some versions of gcc.
+ </li>
+ <li>
+ Support for WM_GETTEXT restored on Windows.
+ </li>
+ <li>
+ Double clicking on an autocompletion list entry works on GTK+.
+ </li>
+ <li>
+ Bug fixed with case insensitive sorts for autocompletion lists.
+ </li>
+ <li>
+ Bug fixed with tracking selection in secondary views when performing modifications.
+ </li>
+ <li>
+ SciTE's abbreviation expansion feature will now indent expansions to the current
+ indentation level if indent.automatic is on.
+ </li>
+ <li>
+ SciTE allows setting up of parameters to commands from a dialog and can also
+ show this dialog automatically to prompt for arguments when running a command.
+ </li>
+ <li>
+ SciTE's Language menu (formerly Options | Use Lexer) is now defined by the
+ menu.language property rather than being hardcoded.
+ </li>
+ <li>
+ The user interface of SciTE can be localised to a particular language by editing
+ a locale.properties file.
+ </li>
+ <li>
+ On Windows, SciTE will try to move to the front when opening a new file from
+ the shell and using check.if.already.open.
+ </li>
+ <li>
+ SciTE can display the file name and directory in the title bar in the form
+ "file @ directory" when title.full.path=2.
+ </li>
+ <li>
+ The SciTE time.commands property reports the time taken by a command as well
+ as its status when completed.
+ </li>
+ <li>
+ The SciTE find.files property is now a list separated by '|' characters and this list is
+ added into the Files pull down of the Find in Files dialog.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite140.zip?download">Release 1.40</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 23 September 2001.
+ </li>
+ <li>
+ Removal of emulation of Win32 RichEdit control in core of Scintilla.
+ <em>This change may be incompatible with existing client code.</em>
+ Some emulation still done in Windows platform layer.
+ </li>
+ <li>
+ SGML support in the HTML/XML lexer.
+ </li>
+ <li>
+ SciTE's "Stop Executing" command will terminate GUI programs on
+ Windows NT and Windows 2000.
+ </li>
+ <li>
+ StyleContext class helps construct lexers that are simple and accurate.
+ Used in the C++, Eiffel, and Python lexers.
+ </li>
+ <li>
+ Clipboard operations in GTK+ version convert between platform '\n' line endings and
+ currently chosen line endings.
+ </li>
+ <li>
+ Any character in range 0..255 can be used as a marker.
+ This can be used to support numbered bookmarks, for example.
+ </li>
+ <li>
+ The default scripting language for ASP can be set.
+ </li>
+ <li>
+ New lexer and other support for crontab files used with the nncron scheduler.
+ </li>
+ <li>
+ Folding of Python improved.
+ </li>
+ <li>
+ The ` character is treated as a Python operator.
+ </li>
+ <li>
+ Line continuations ("\" at end of line) handled inside Python strings.
+ </li>
+ <li>
+ More consistent handling of line continuation ('\' at end of line) in
+ C++ lexer.
+ This fixes macro definitions that span more than one line.
+ </li>
+ <li>
+ C++ lexer can understand Doxygen keywords in doc comments.
+ </li>
+ <li>
+ SciTE on Windows allows choosing to open the "open" dialog on the directory
+ of the current file rather than in the default directory.
+ </li>
+ <li>
+ SciTE on Windows handles command line arguments in "check.if.already.open"
+ correctly when the current directory of the new instance is different to the
+ already open instance of SciTE.
+ </li>
+ <li>
+ "cwd" command (change working directory) defined for SciTE director interface.
+ </li>
+ <li>
+ SciTE "Export As HTML" produces better, more compliant, and shorter files.
+ </li>
+ <li>
+ SciTE on Windows allows several options for determining default file name
+ for exported files.
+ </li>
+ <li>
+ Automatic indentation of Python in SciTE fixed.
+ </li>
+ <li>
+ Exported HTML can support folding.
+ </li>
+ <li>
+ Bug fixed in SCI_GETTEXT macro command of director interface.
+ </li>
+ <li>
+ Cursor leak fixed on GTK+.
+ </li>
+ <li>
+ During SciTE shutdown, "identity" messages are no longer sent over the director interface.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite139.zip?download">Release 1.39</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 22 August 2001.
+ </li>
+ <li>
+ Windows version requires msvcrt.dll to be available so will not work
+ on original Windows 95 version 1. The msvcrt.dll file is installed
+ by almost everything including Internet Explorer so should be available.
+ </li>
+ <li>
+ Flattened tree control style folding margin. The SciTE fold.plus option is
+ now fold.symbols and has more values for the new styles.
+ </li>
+ <li>
+ Mouse dwell events are generated when the user holds the mouse steady
+ over Scintilla.
+ </li>
+ <li>
+ PositionFromPointClose is like PositionFromPoint but returns
+ INVALID_POSITION when point outside window or after end of line.
+ </li>
+ <li>
+ Input of Hungarian and Russian characters in GTK+ version works by
+ truncating input to 8 bits if in the range of normal characters.
+ </li>
+ <li>
+ Better choices for font descriptors on GTK+ for most character sets.
+ </li>
+ <li>
+ GTK+ Scintilla is destroyed upon receiving destroy signal rather than
+ destroy_event signal.
+ </li>
+ <li>
+ Style setting that force upper or lower case text.
+ </li>
+ <li>
+ Case-insensitive autocompletion lists work correctly.
+ </li>
+ <li>
+ Keywords can be prefix based so ^GTK_ will treat all words that start
+ with GTK_ as keywords.
+ </li>
+ <li>
+ Horizontal scrolling can be jumpy rather than gradual.
+ </li>
+ <li>
+ GetSelText places a '\0' in the buffer if the selection is empty..
+ </li>
+ <li>
+ EnsureVisible split into two methods EnsureVisible which will not scroll to show
+ the line and EnsureVisibleEnforcePolicy which may scroll.
+ </li>
+ <li>
+ Python folder has options to fold multi-line comments and triple quoted strings.
+ </li>
+ <li>
+ C++ lexer handles keywords before '.' like "this.x" in Java as keywords.
+ Compact folding mode option chooses whether blank lines after a structure are
+ folded with that structure. Second set of keywords with separate style supported.
+ </li>
+ <li>
+ Ruby lexer handles multi-line comments.
+ </li>
+ <li>
+ VB has folder.
+ </li>
+ <li>
+ PHP lexer has an operator style, handles "&lt;?" and "?&gt;" inside strings
+ and some comments.
+ </li>
+ <li>
+ TCL lexer which is just an alias for the C++ lexer so does not really
+ understand TCL syntax.
+ </li>
+ <li>
+ Error lines lexer has styles for Lua error messages and .NET stack traces.
+ </li>
+ <li>
+ Makefile lexer has a target style.
+ </li>
+ <li>
+ Lua lexer handles some [[]] string literals.
+ </li>
+ <li>
+ HTML and XML lexer have a SCE_H_SGML state for tags that
+ start with "&lt;!".
+ </li>
+ <li>
+ Fixed Scintilla bugs with folding. When modifications were performed near
+ folded regions sometimes no unfolding occurred when it should have. Deleting a
+ fold causing character sometimes failed to update fold information correctly.
+ </li>
+ <li>
+ Better support for Scintilla on GTK+ for Win32 including separate
+ PLAT_GTK_WIN32 definition and correct handling of rectangular selection
+ with clipboard operations.
+ </li>
+ <li>
+ SciTE has a Tools | Switch Pane (Ctrl+F6) command to switch focus between
+ edit and output panes.
+ </li>
+ <li>
+ SciTE option output.scroll allows automatic scrolling of output pane to
+ be turned off.
+ </li>
+ <li>
+ Commands can be typed into the SciTE output pane similar to a shell window.
+ </li>
+ <li>
+ SciTE properties magnification and output magnification set initial zoom levels.
+ </li>
+ <li>
+ Option for SciTE comment block command to place comments at start of line.
+ </li>
+ <li>
+ SciTE for Win32 has an option to minimize to the tray rather than the task bar.
+ </li>
+ <li>
+ Close button on SciTE tool bar for Win32.
+ </li>
+ <li>
+ SciTE compiles with GCC 3.0.
+ </li>
+ <li>
+ SciTE's automatic indentation of C++ handles braces without preceding keyword
+ correctly.
+ </li>
+ <li>
+ Bug fixed with GetLine method writing past the end of where it should.
+ </li>
+ <li>
+ Bug fixed with mouse drag automatic scrolling when some lines were folded.
+ </li>
+ <li>
+ Bug fixed because caret XEven setting was inverted.
+ </li>
+ <li>
+ Bug fixed where caret was initially visible even though window was not focussed.
+ </li>
+ <li>
+ Bug fixed where some file names could end with "\\" which caused slow
+ downs on Windows 9x.
+ </li>
+ <li>
+ On Win32, SciTE Replace dialog starts with focus on replacement text.
+ </li>
+ <li>
+ SciTE Go to dialog displays correct current line.
+ </li>
+ <li>
+ Fixed bug with SciTE opening multiple files at once.
+ </li>
+ <li>
+ Fixed bug with Unicode key values reported to container truncated.
+ </li>
+ <li>
+ Fixed bug with unnecessary save point notifications.
+ </li>
+ <li>
+ Fixed bugs with indenting and unindenting at start of line.
+ </li>
+ <li>
+ Monospace Font setting behaves more consistently.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite138.zip?download">Release 1.38</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 23 May 2001.
+ </li>
+ <li>
+ Loadable lexer plugins on Windows.
+ </li>
+ <li>
+ Ruby lexer and support.
+ </li>
+ <li>
+ Lisp lexer and support.
+ </li>
+ <li>
+ Eiffel lexer and support.
+ </li>
+ <li>
+ Modes for better handling of Tab and BackSpace keys within
+ indentation. Mode to avoid autocompletion list cancelling when
+ there are no viable matches.
+ </li>
+ <li>
+ ReplaceTarget replaced with two calls ReplaceTarget
+ (which is incompatible with previous ReplaceTarget) and
+ ReplaceTargetRE. Both of these calls have a count first
+ parameter which allows using strings containing nulls.
+ SearchInTarget and SetSearchFlags functions allow
+ specifying a search in several simple steps which helps
+ some clients which can not create structs or pointers easily.
+ </li>
+ <li>
+ Asian language input through an Input Method Editor works
+ on Windows 2000.
+ </li>
+ <li>
+ On Windows, control characters can be entered through use of
+ the numeric keypad in conjunction with the Alt key.
+ </li>
+ <li>
+ Document memory allocation changed to grow exponentially
+ which reduced time to load a 30 Megabyte file from
+ 1000 seconds to 25. Change means more memory may be used.
+ </li>
+ <li>
+ Word part movement keys now handled in Scintilla rather than
+ SciTE.
+ </li>
+ <li>
+ Regular expression '^' and '$' work more often allowing insertion
+ of text at start or end of line with a replace command.
+ Backslash quoted control characters \a, \b, \f, \t, and \v
+ recognised within sets.
+ </li>
+ <li>
+ Session files for SciTE.
+ </li>
+ <li>
+ Export as PDF command hidden in SciTE as it often failed.
+ Code still present so can be turned on by those willing to cope.
+ </li>
+ <li>
+ Bug fixed in HTML lexer handling % before &gt; as end ASP
+ even when no start ASP encountered.
+ Bug fixed when scripts ended with a quoted string and
+ end tag was not seen.
+ </li>
+ <li>
+ Bug fixed on Windows where context menu key caused menu to
+ appear in corner of screen rather than within window.
+ </li>
+ <li>
+ Bug fixed in SciTE's Replace All command not processing
+ whole file when replace string longer than search string.
+ </li>
+ <li>
+ Bug fixed in SciTE's MRU list repeating entries if Ctrl+Tab
+ used when all entries filled.
+ </li>
+ <li>
+ ConvertEOLs call documentation fixed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite137.zip?download">Release 1.37</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 17 April 2001.
+ </li>
+ <li>
+ Bug fixed with scroll bars being invisible on GTK+ 1.2.9.
+ </li>
+ <li>
+ Scintilla and SciTE support find and replace using simple regular
+ expressions with tagged expressions. SciTE supports C '\' escapes
+ in the Find and Replace dialogs.
+ Replace in Selection available in SciTE.
+ </li>
+ <li>
+ Scintilla has a 'target' feature for replacing code rapidly without
+ causing display updates.
+ </li>
+ <li>
+ Scintilla and SciTE on GTK+ support file dropping from file managers
+ such as Nautilus and gmc. Files or other URIs dropped on Scintilla
+ result in a URIDropped notification.
+ </li>
+ <li>
+ Lexers may have separate Lex and Fold functions.
+ </li>
+ <li>
+ Lexer infrastructure improved to allow for plug in lexers and for referring
+ to lexers by name rather than by ID.
+ </li>
+ <li>
+ Ada lexer and support added.
+ </li>
+ <li>
+ Option in both Scintilla and SciTE to treat both left and right margin
+ as equally important when repositioning visible area in response to
+ caret movement. Default is to prefer visible area positioning which
+ minimises the horizontal scroll position thus favouring the left margin.
+ </li>
+ <li>
+ Caret line highlighting.
+ </li>
+ <li>
+ Commands to delete from the caret to the end of line and
+ from the caret to the beginning of line.
+ </li>
+ <li>
+ SciTE has commands for inserting and removing block comments and
+ for inserting stream comments.
+ </li>
+ <li>
+ SciTE Director interface uses C++ '\' escapes to send control characters.
+ </li>
+ <li>
+ SciTE Director interface adds more commands including support for macros.
+ </li>
+ <li>
+ SciTE has menu options for recording and playing macros which are visible
+ when used with a companion program that supports these features.
+ </li>
+ <li>
+ SciTE has an Expand Abbreviation command.
+ Abbreviations are stored in a global abbrev.properties file.
+ </li>
+ <li>
+ SciTE has a Full Screen command to switch between a normal window
+ size and using the full screen. On Windows, the menu bar can be turned
+ off when in full screen mode.
+ </li>
+ <li>
+ SciTE has a Use monospaced font command to switch between the normal
+ set of fonts and one size of a particular fixed width font.
+ </li>
+ <li>
+ SciTE's use of tabs can be controlled for particular file names
+ as well as globally.
+ </li>
+ <li>
+ The contents of SciTE's status bar can be defined by a property and
+ include variables. On Windows, several status bar definitions can be active
+ with a click on the status bar cycling through them.
+ </li>
+ <li>
+ Copy as RTF command in SciTE on Windows to allow pasting
+ styled text into word processors.
+ </li>
+ <li>
+ SciTE can allow the use of non-alphabetic characters in
+ Complete Symbol lists and can automatically display this autocompletion
+ list when a trigger character such as '.' is typed.
+ Complete word can be set to pop up when the user is typing a word and
+ there is only one matching word in the document.
+ </li>
+ <li>
+ SciTE lists the imported properties files on a menu to allow rapid
+ access to them.
+ </li>
+ <li>
+ SciTE on GTK+ improvements to handling accelerator keys and focus
+ in dialogs. Message boxes respond to key presses without the Alt key as
+ they have no text entries to accept normal keystrokes.
+ </li>
+ <li>
+ SciTE on GTK+ sets the application icon.
+ </li>
+ <li>
+ SciTE allows setting the colours used to indicate the current
+ error line.
+ </li>
+ <li>
+ Variables within PHP strings have own style. Keyword list updated.
+ </li>
+ <li>
+ Keyword list for Lua updated for Lua 4.0.
+ </li>
+ <li>
+ Bug fixed in rectangular selection where rectangle still appeared
+ selected after using cursor keys to move caret.
+ </li>
+ <li>
+ Bug fixed in C++ lexer when deleting a '{' controlling a folded range
+ led to that range becoming permanently invisible.
+ </li>
+ <li>
+ Bug fixed in Batch lexer where comments were not recognised.
+ </li>
+ <li>
+ Bug fixed with undo actions coalescing into steps incorrectly.
+ </li>
+ <li>
+ Bug fixed with Scintilla on GTK+ positioning scroll bars 1 pixel
+ over the Scintilla window leading to their sides being chopped off.
+ </li>
+ <li>
+ Bugs fixed in SciTE when doing some actions led to the start
+ or end of the file being displayed rather than the current location.
+ </li>
+ <li>
+ Appearance of calltips fixed to look like document text including
+ any zoom factor. Positioned to be outside current line even when
+ multiple fonts and sizes used.
+ </li>
+ <li>
+ Bug fixed in Scintilla macro support where typing Enter caused both a newline
+ command and newline character insertion to be recorded.
+ </li>
+ <li>
+ Bug fixed in SciTE on GTK+ where focus was moving
+ between widgets incorrectly.
+ </li>
+ <li>
+ Bug fixed with fold symbols sometimes not updating when
+ the text changed.
+ </li>
+ <li>
+ Bugs fixed in SciTE's handling of folding commands.
+ </li>
+ <li>
+ Deprecated undo collection enumeration removed from API.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite136.zip?download">Release 1.36</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 March 2001.
+ </li>
+ <li>
+ Scintilla supports GTK+ on Win32.
+ </li>
+ <li>
+ Some untested work on making Scintilla and SciTE 64 bit compatible.
+ For users on GTK+ this requires including Scintilla.h before
+ ScintillaWidget.h.
+ </li>
+ <li>
+ HTML lexer allows folding HTML.
+ </li>
+ <li>
+ New lexer for Avenue files which are used in the ESRI ArcView GIS.
+ </li>
+ <li>
+ DOS Batch file lexer has states for '@', external commands, variables and
+ operators.
+ </li>
+ <li>
+ C++ lexer can fold comments of /* .. */ form.
+ </li>
+ <li>
+ Better disabling of pop up menu items in Scintilla when in read-only mode.
+ </li>
+ <li>
+ Starting to move to Doxygen compatible commenting.
+ </li>
+ <li>
+ Director interface on Windows enables another application to control SciTE.
+ </li>
+ <li>
+ Opening SciTE on Windows 9x sped up greatly for some cases.
+ </li>
+ <li>
+ The command.build.directory property allows SciTE to run the build
+ command in a different directory to the source files.
+ </li>
+ <li>
+ SciTE on Windows allows setting foreground and background colours
+ for printed headers and footers.
+ </li>
+ <li>
+ Bug fixed in finding calltips in SciTE which led to no calltips for some identifiers.
+ </li>
+ <li>
+ Documentation added for lexers and for the extension and director interfaces.
+ </li>
+ <li>
+ SciTE menus rearranged with new View menu taking over some of the items that
+ were under the Options menu. Clear All Bookmarks command added.
+ </li>
+ <li>
+ Clear Output command in SciTE.
+ </li>
+ <li>
+ SciTE on Windows gains an Always On Top command.
+ </li>
+ <li>
+ Bug fixed in SciTE with attempts to define properties recursively.
+ </li>
+ <li>
+ Bug fixed in SciTE properties where only one level of substitution was done.
+ </li>
+ <li>
+ Bug fixed in SciTE properties where extensions were not being
+ matched in a case insensitive manner.
+ </li>
+ <li>
+ Bug fixed in SciTE on Windows where the Go to dialog displays the correct
+ line number.
+ </li>
+ <li>
+ In SciTE, if fold.on.open set then switching buffers also performs fold.
+ </li>
+ <li>
+ Bug fixed in Scintilla where ensuring a line was visible in the presence of folding
+ operated on the document line instead of the visible line.
+ </li>
+ <li>
+ SciTE command line processing modified to operate on arguments in order and in
+ two phases. First any arguments before the first file name are processed, then the
+ UI is opened, then the remaining arguments are processed. Actions defined for the
+ Director interface (currently only "open") may also be used on the command line.
+ For example, "SciTE -open:x.txt" will start SciTE and open x.txt.
+ </li>
+ <li>
+ Numbered menu items SciTE's Buffers menu and the Most Recently Used portion
+ of the File menu go from 1..0 rather than 0..9.
+ </li>
+ <li>
+ The tab bar in SciTE for Windows has numbers.
+ The tab.hide.one option hides the tab bar until there is more than one buffer open.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite135.zip?download">Release 1.35</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 29 January 2001.
+ </li>
+ <li>
+ Rewritten and simplified widget code for the GTK+ version to enhance
+ solidity and make more fully compliant with platform norms. This includes more
+ normal handling of keystrokes so they are forwarded to containers correctly.
+ </li>
+ <li>
+ User defined lists can be shown.
+ </li>
+ <li>
+ Many fixes to the Perl lexer.
+ </li>
+ <li>
+ Pascal lexer handles comments more correctly.
+ </li>
+ <li>
+ C/C++/Java/JavaScipt lexer has a state for line doc comments.
+ </li>
+ <li>
+ Error output lexer understands Sun CC messages.
+ </li>
+ <li>
+ Make file lexer has variable, preprocessor, and operator states.
+ </li>
+ <li>
+ Wider area given to an italics character that is at the end of a line to prevent it
+ being cut off.
+ </li>
+ <li>
+ Call to move the caret inside the currently visible area.
+ </li>
+ <li>
+ Paste Rectangular will space fill on the left hand side of the pasted text as
+ needed to ensure it is kept rectangular.
+ </li>
+ <li>
+ Cut and Paste Rectangular does nothing in read-only mode.
+ </li>
+ <li>
+ Undo batching changed so that a paste followed by typing creates two undo actions..
+ </li>
+ <li>
+ A "visibility policy" setting for Scintilla determines which range of lines are displayed
+ when a particular line is moved to. Also exposed as a property in SciTE.
+ </li>
+ <li>
+ SciTE command line allows property settings.
+ </li>
+ <li>
+ SciTE has a View Output command to hide or show the output pane.
+ </li>
+ <li>
+ SciTE's Edit menu has been split in two with searching commands moved to a
+ new Search menu. Find Previous and Previous Bookmark are in the Search menu.
+ </li>
+ <li>
+ SciTE on Windows has options for setting print margins, headers and footers.
+ </li>
+ <li>
+ SciTE on Windows has tooltips for toolbar.
+ </li>
+ <li>
+ SciTE on GTK+ has properties for setting size of file selector.
+ </li>
+ <li>
+ Visual and audio cues in SciTE on Windows enhanced.
+ </li>
+ <li>
+ Fixed performance problem in SciTE for GTK+ by dropping the extra 3D
+ effect on the content windows.
+ </li>
+ <li>
+ Fixed problem in SciTE where choosing a specific lexer then meant
+ that no lexer was chosen when files opened.
+ </li>
+ <li>
+ Default selection colour changed to be visible on low colour displays.
+ </li>
+ <li>
+ Fixed problems with automatically reloading changed documents in SciTE on
+ Windows.
+ </li>
+ <li>
+ Fixed problem with uppercase file extensions in SciTE.
+ </li>
+ <li>
+ Fixed some problems when using characters >= 128, some of which were being
+ incorrectly treated as spaces.
+ </li>
+ <li>
+ Fixed handling multiple line tags, non-inline scripts, and XML end tags /&gt; in HTML/XML lexer.
+ </li>
+ <li>
+ Bookmarks in SciTE no longer disappear when switching between buffers.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite134.zip?download">Release 1.34</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 28 November 2000.
+ </li>
+ <li>
+ Pascal lexer.
+ </li>
+ <li>
+ Export as PDF in SciTE.
+ </li>
+ <li>
+ Support for the OpenVMS operating system in SciTE.
+ </li>
+ <li>
+ SciTE for GTK+ can check for another instance of SciTE
+ editing a file and switch to it rather than open a second instance
+ on one file.
+ </li>
+ <li>
+ Fixes to quoting and here documents in the Perl lexer.
+ </li>
+ <li>
+ SciTE on Windows can give extra visual and audio cues when a
+ warning is shown or find restarts from beginning of file.
+ </li>
+ <li>
+ Open Selected Filename command in SciTE. Also understands some
+ warning message formats.
+ </li>
+ <li>
+ Wider area for line numbers when printing.
+ </li>
+ <li>
+ Better scrolling performance on GTK+.
+ </li>
+ <li>
+ Fixed problem where rectangles with negative coordinates were
+ invalidated leading to trouble with platforms that use
+ unsigned coordinates.
+ </li>
+ <li>
+ GTK+ Scintilla uses more compliant signalling code so that keyboard
+ events should propagate to containers.
+ </li>
+ <li>
+ Bug fixed with opening full or partial paths.
+ </li>
+ <li>
+ Improved handling of paths in error messages in SciTE.
+ </li>
+ <li>
+ Better handling of F6 in SciTE.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite133.zip?download">Release 1.33</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 6 November 2000.
+ </li>
+ <li>
+ XIM support for the GTK+ version of Scintilla ensures that more non-English
+ characters can be typed.
+ </li>
+ <li>
+ Caret may be 1, 2, or 3 pixels wide.
+ </li>
+ <li>
+ Cursor may be switched to wait image during lengthy processing.
+ </li>
+ <li>
+ Scintilla's internal focus flag is exposed for clients where focus is handled in
+ complex ways.
+ </li>
+ <li>
+ Error status defined for Scintilla to hold indication that an operation failed and the reason
+ for that failure. No detection yet implemented but clients may start using the interface
+ so as to be ready for when it does.
+ </li>
+ <li>
+ Context sensitive help in SciTE.
+ </li>
+ <li>
+ CurrentWord property available in SciTE holding the value of the word the
+ caret is within or near.
+ </li>
+ <li>
+ Apache CONF file lexer.
+ </li>
+ <li>
+ Changes to Python lexer to allow 'as' as a context sensitive keyword and the
+ string forms starting with u, r, and ur to be recognised.
+ </li>
+ <li>
+ SCN_POSCHANGED notification now working and SCN_PAINTED notification added.
+ </li>
+ <li>
+ Word part movement commands for cursoring between the parts of reallyLongCamelIdentifiers and
+ other_ways_of_making_words.
+ </li>
+ <li>
+ When text on only one line is selected, Shift+Tab moves to the previous tab stop.
+ </li>
+ <li>
+ Tab control available for Windows version of SciTE listing all the buffers
+ and making it easy to switch between them.
+ </li>
+ <li>
+ SciTE can be set to automatically determine the line ending type from the contents of a
+ file when it is opened.
+ </li>
+ <li>
+ Dialogs in GTK+ version of SciTE made more modal and have accelerator keys.
+ </li>
+ <li>
+ Find in Files command in GTK+ version of SciTE allows choice of directory.
+ </li>
+ <li>
+ On Windows, multiple files can be opened at once.
+ </li>
+ <li>
+ SciTE source broken up into more files.
+ </li>
+ <li>
+ Scintilla headers made safe for C language, not just C++.
+ </li>
+ <li>
+ New printing modes - force background to white and force default background to white.
+ </li>
+ <li>
+ Automatic unfolding not occurring when Enter pressed at end of line bug fixed.
+ </li>
+ <li>
+ Bugs fixed in line selection.
+ </li>
+ <li>
+ Bug fixed with escapes in PHP strings in the HTML lexer.
+ </li>
+ <li>
+ Bug fixed in SciTE for GTK+ opening files when given full paths.
+ </li>
+ <li>
+ Bug fixed in autocompletion where user backspaces into existing text.
+ </li>
+ <li>
+ Bugs fixed in opening files and ensuring they are saved before running.
+ A case bug also fixed here.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite132.zip?download">Release 1.32</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 8 September 2000.
+ </li>
+ <li>
+ Fixes bugs in complete word and related code. Protection against a bug when
+ receiving a bad argument.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite131.zip?download">Release 1.31</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 6 September 2000.
+ </li>
+ <li>
+ Scintilla is available as a COM control from the scintillactrl module in CVS.
+ </li>
+ <li>
+ Style setting to underline text. Exposed in SciTE as "underlined".
+ </li>
+ <li>
+ Style setting to make text invisible.
+ </li>
+ <li>
+ SciTE has an extensibility interface that can be used to implement features such as
+ a scripting language or remote control. An example use of this is the extlua module
+ available from CVS which allows SciTE to be scripted in Lua.
+ </li>
+ <li>
+ Many minor fixes to all of the lexers.
+ </li>
+ <li>
+ New lexer for diff and patch files.
+ </li>
+ <li>
+ Error message lexer understands Perl error messages.
+ </li>
+ <li>
+ C/C++/Java lexer now supports C#, specifically verbatim strings and
+ @ quoting of identifiers that are the same as keywords. SciTE has
+ a set of keywords for C# and a build command set up for C#.
+ </li>
+ <li>
+ Scintilla property to see whether in overtype or insert state.
+ </li>
+ <li>
+ PosChanged notification fired when caret moved.
+ </li>
+ <li>
+ Comboboxes in dialogs in SciTE on Windows can be horizontally scrolled.
+ </li>
+ <li>
+ Autocompletion and calltips can treat the document as case sensitive or
+ case insensitive.
+ </li>
+ <li>
+ Autocompletion can be set to automatically choose the only
+ element in a single element list.
+ </li>
+ <li>
+ Set of characters that automatically complete an autocompletion list
+ can be set.
+ </li>
+ <li>
+ SciTE command to display calltip - useful when dropped because of
+ editing.
+ </li>
+ <li>
+ SciTE has a Revert command to go back to the last saved version.
+ </li>
+ <li>
+ SciTE has an Export as RTF command. Save as HTML is renamed
+ to Export as HTML and is located on the Export sub menu.
+ </li>
+ <li>
+ SciTE command "Complete Word" searches document for any
+ words starting with characters before caret.
+ </li>
+ <li>
+ SciTE options for changing aspects of the formatting of files exported
+ as HTML or RTF.
+ </li>
+ <li>
+ SciTE "character.set" option for choosing the character
+ set for all fonts.
+ </li>
+ <li>
+ SciTE has a "Toggle all folds" command.
+ </li>
+ <li>
+ The makefiles have changed. The makefile_vc and
+ makefile_bor files in scintilla/win32 and scite/win32 have been
+ merged into scintilla/win32/scintilla.mak and scite/win32/scite.mak.
+ DEBUG may be defined for all make files and this will turn on
+ assertions and for some make files will choose other debugging
+ options.
+ </li>
+ <li>
+ To make debugging easier and allow good use of BoundsChecker
+ there is a Visual C++ project file in scite/boundscheck that builds
+ all of Scintilla and SciTE into one executable.
+ </li>
+ <li>
+ The size of the SciTE output window can be set with the
+ output.horizontal.size and output.vertical.size settings.
+ </li>
+ <li>
+ SciTE status bar indicator for insert or overwrite mode.
+ </li>
+ <li>
+ Performance improvements to autocompletion and calltips.
+ </li>
+ <li>
+ A caret redraw problem when undoing is fixed.
+ </li>
+ <li>
+ Crash with long lines fixed.
+ </li>
+ <li>
+ Bug fixed with merging markers when lines merged.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite130.zip?download">Release 1.30</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 26 July 2000.
+ </li>
+ <li>
+ Much better support for PHP which is now an integral part of the HTML support.
+ </li>
+ <li>
+ Start replacement of Windows-specific APIs with cross platform APIs.
+ In 1.30, the new APIs are introduced but the old APIs are still available.
+ For the GTK+ version, may have to include "WinDefs.h" explicitly to
+ use the old APIs.
+ </li>
+ <li>
+ "if" and "import" statements in SciTE properties files allows modularisation into
+ language-specific properties files and choices based upon platform.
+ This means that SciTE is delivered with 9 language-specific properties files
+ as well as the standard SciTEGlobal.properties file.
+ </li>
+ <li>
+ Much lower resource usage on Windows 9x.
+ </li>
+ <li>
+ "/p" option in SciTE on Windows for printing a file and then exiting.
+ </li>
+ <li>
+ Options for printing with inverted brightness (when the screen is set to use
+ a dark background) and to force black on white printing.
+ </li>
+ <li>
+ Option for printing magnified or miniaturised from screen settings.
+ </li>
+ <li>
+ In SciTE, Ctrl+F3 and Ctrl+Shift+F3 find the selection in the forwards and backwards
+ directions respectively.
+ </li>
+ <li>
+ Auto-completion lists may be set to cancel when the cursor goes before
+ its start position or before the start of string being completed.
+ </li>
+ <li>
+ Auto-completion lists automatically size more sensibly.
+ </li>
+ <li>
+ SCI_CLEARDOCUMENTSTYLE zeroes all style bytes, ensures all
+ lines are shown and deletes all folding information.
+ </li>
+ <li>
+ On Windows, auto-completion lists are visually outdented rather than indented.
+ </li>
+ <li>
+ Close all command in SciTE.
+ </li>
+ <li>
+ On Windows multiple files can be dragged into SciTE.
+ </li>
+ <li>
+ When saving a file, the SciTE option save.deletes.first deletes it before doing the save.
+ This allows saving with a different capitalisation on Windows.
+ </li>
+ <li>
+ When use tabs option is off pressing the tab key inserts spaces.
+ </li>
+ <li>
+ Bug in indicators leading to extra line drawn fixed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite128.zip?download">Release 1.28</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 27 June 2000.
+ </li>
+ <li>
+ Fixes crash in indentation guides when indent size set to 0.
+ </li>
+ <li>
+ Fixes to installation on GTK+/Linux. User properties file on GTK+ has a dot at front of name:
+ .SciTEUser.properties. Global properties file location configurable at compile time
+ defaulting to $prefix/share/scite. $prefix determined from Gnome if present else its
+ /usr/local and can be overridden by installer. Gnome menu integration performed in
+ make install if Gnome present.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite127.zip?download">Release 1.27</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 23 June 2000.
+ </li>
+ <li>
+ Indentation guides. View whitespace mode may be set to not display whitespace
+ in indentation.
+ </li>
+ <li>
+ Set methods have corresponding gets for UndoCollection, BufferedDraw,
+ CodePage, UsePalette, ReadOnly, CaretFore, and ModEventMask.
+ </li>
+ <li>
+ Caret is continuously on rather than blinking while typing or holding down
+ delete or backspace. And is now always shown if non blinking when focused on GTK+.
+ </li>
+ <li>
+ Bug fixed in SciTE with file extension comparison now done in case insensitive way.
+ </li>
+ <li>
+ Bugs fixed in SciTE's file path handling on Windows.
+ </li>
+ <li>
+ Bug fixed with preprocessor '#' last visible character causing hang.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite126.zip?download">Release 1.26</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 13 June 2000.
+ </li>
+ <li>
+ Support for the Lua language in both Scintilla and SciTE.
+ </li>
+ <li>
+ Multiple buffers may be open in SciTE.
+ </li>
+ <li>
+ Each style may have a character set configured. This may determine
+ the characters that are displayed by the style.
+ </li>
+ <li>
+ In the C++ lexer, lexing of preprocessor source may either treat it all as being in
+ the preprocessor class or only the initial # and preprocessor command word as
+ being in the preprocessor class.
+ </li>
+ <li>
+ Scintilla provides SCI_CREATEDOCUMENT, SCI_ADDREFDOCUMENT, and
+ SCI_RELEASEDOCUMENT to make it easier for a container to deal with multiple
+ documents.
+ </li>
+ <li>
+ GTK+ specific definitions in Scintilla.h were removed to ScintillaWidget.h. All GTK+ clients will need to
+ #include "ScintillaWidget.h".
+ </li>
+ <li>
+ For GTK+, tools can be executed in the background by setting subsystem to 2.
+ </li>
+ <li>
+ Keys in the properties files are now case sensitive. This leads to a performance increase.
+ </li>
+ <li>
+ Menu to choose which lexer to use on a file.
+ </li>
+ <li>
+ Tab size dialog on Windows.
+ </li>
+ <li>
+ File dialogs enlarged on GTK+.
+ </li>
+ <li>
+ Match Brace command bound to Ctrl+E on both platforms with Ctrl+] a synonym on Windows.
+ Ctrl+Shift+E is select to matching brace. Brace matching tries to match to either the inside or the
+ outside, depending on whether the cursor is inside or outside the braces initially.
+ View End of Line bound to Ctrl+Shift+O.
+ </li>
+ <li>
+ The Home key may be bound to move the caret to either the start of the line or the start of the
+ text on the line.
+ </li>
+ <li>
+ Visual C++ project file for SciTE.
+ </li>
+ <li>
+ Bug fixed with current x location after Tab key.
+ </li>
+ <li>
+ Bug fixed with hiding fold margin by setting fold.margin.width to 0.
+ </li>
+ <li>
+ Bugs fixed with file name confusion on Windows when long and short names used, or different capitalisations,
+ or relative paths.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite125.zip?download">Release 1.25</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 9 May 2000.
+ </li>
+ <li>
+ Some Unicode support on Windows. Treats buffer and API as UTF-8 and displays
+ through UCS-2 of Windows.
+ </li>
+ <li>
+ Automatic indentation. Indentation size can be different to tab size.
+ </li>
+ <li>
+ Tool bar.
+ </li>
+ <li>
+ Status bar now on Windows as well as GTK+.
+ </li>
+ <li>
+ Input fields in Find and Replace dialogs now have history on both Windows and
+ GTK+.
+ </li>
+ <li>
+ Auto completion list items may be separated by a chosen character to allow spaces
+ in items. The selected item may be changed through the API.
+ </li>
+ <li>
+ Horizontal scrollbar can be turned off.
+ </li>
+ <li>
+ Property to remove trailing spaces when saving file.
+ </li>
+ <li>
+ On Windows, changed font size calculation to be more compatible with
+ other applications.
+ </li>
+ <li>
+ On GTK+, SciTE's global properties files are looked for in the directory specified in the
+ SCITE_HOME environment variable if it is set. This allows hiding in a dot directory.
+ </li>
+ <li>
+ Keyword lists in SciTE updated for JavaScript to include those destined to be used in
+ the future. IDL includes XPIDL keywords as well as MSIDL keywords.
+ </li>
+ <li>
+ Zoom level can be set and queried through API.
+ </li>
+ <li>
+ New notification sent before insertions and deletions.
+ </li>
+ <li>
+ LaTeX lexer.
+ </li>
+ <li>
+ Fixes to folding including when deletions and additions are performed.
+ </li>
+ <li>
+ Fix for crash with very long lines.
+ </li>
+ <li>
+ Fix to affect all of rectangular selections with deletion and case changing.
+ </li>
+ <li>
+ Removed non-working messages that had been included only for Richedit compatibility.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/scite124.zip">Release 1.24</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 29 March 2000.
+ </li>
+ <li>
+ Added lexing of IDL based on C++ lexer with extra UUID lexical class.
+ </li>
+ <li>
+ Functions and associated keys for Line Delete, Line Cut, Line Transpose,
+ Selection Lower Case and Selection Upper Case.
+ </li>
+ <li>
+ Property setting for SciTE, eol.mode, chooses initial state of line end characters.
+ </li>
+ <li>
+ Fixed bugs in undo history with small almost-contiguous changes being incorrectly coalesced.
+ </li>
+ <li>
+ Fixed bugs with incorrect expansion of ContractionState data structures causing crash.
+ </li>
+ <li>
+ Fixed bugs relating to null fonts.
+ </li>
+ <li>
+ Fixed bugs where recolourisation was not done sometimes when required.
+ </li>
+ <li>
+ Fixed compilation problems with SVector.h.
+ </li>
+ <li>
+ Fixed bad setting of fold points in Python.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite123.zip?download">Release 1.23</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 21 March 2000.
+ </li>
+ <li>
+ Directory structure to separate on basis of product (Scintilla, SciTE, DMApp)
+ and environment (Cross-platform, Win32, GTK+).
+ </li>
+ <li>
+ Download packaging to allow download of the source or platform dependent executables.
+ </li>
+ <li>
+ Source code now available from CVS at SourceForge.
+ </li>
+ <li>
+ Very simple Windows-only demonstration application DMApp is available from cvs as dmapp.
+ </li>
+ <li>
+ Lexing functionality may optionally be included in Scintilla rather than be provided by
+ the container.
+ </li>
+ <li>
+ Set of lexers included is determined at link time by defining which of the Lex* object files
+ are linked in.
+ </li>
+ <li>
+ On Windows, the SciLexer.DLL extends Scintilla.DLL with the standard lexers.
+ </li>
+ <li>
+ Enhanced HTML lexer styles embedded VBScript and Python.
+ ASP segments are styled and ASP scripts in JavaScript, VBScript and Python are styled.
+ </li>
+ <li>
+ PLSQL and PHP supported.
+ </li>
+ <li>
+ Maximum number of lexical states extended to 128.
+ </li>
+ <li>
+ Lexers may store per line parse state for multiple line features such as ASP script language choice.
+ </li>
+ <li>
+ Lexing API simplified.
+ </li>
+ <li>
+ Project file for Visual C++.
+ </li>
+ <li>
+ Can now cycle through all recent files with Ctrl+Tab in SciTE.
+ </li>
+ <li>
+ Bookmarks in SciTE.
+ </li>
+ <li>
+ Drag and drop copy works when dragging to the edge of the selection.
+ </li>
+ <li>
+ Fixed bug with value sizes in properties file.
+ </li>
+ <li>
+ Fixed bug with last line in properties file not being used.
+ </li>
+ <li>
+ Bug with multiple views of one document fixed.
+ </li>
+ <li>
+ Keypad now works on GTK+.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/SciTE122.zip?download">Release 1.22</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 27 February 2000.
+ </li>
+ <li>
+ wxWindows platform defined.
+ Implementation for wxWindows will be available separately
+ from main Scintilla distribution.
+ </li>
+ <li>
+ Line folding in Scintilla.
+ </li>
+ <li>
+ SciTE performs syntax directed folding for C/C++/Java/JavaScript and for Python.
+ </li>
+ <li>
+ Optional macro recording support.
+ </li>
+ <li>
+ User properties file (SciTEUser.properties) allows for customisation by the user
+ that is not overwritten with each installation of SciTE.
+ </li>
+ <li>
+ Python lexer detects and highlights inconsistent indentation.
+ </li>
+ <li>
+ Margin API made more orthogonal. SCI_SETMARGINWIDTH and SCI_SETLINENUMBERWIDTH
+ are deprecated in favour of this new API.
+ </li>
+ <li>
+ Margins may be made sensitive to forward mouse click events to container.
+ </li>
+ <li>
+ SQL lexer and styles included.
+ </li>
+ <li>
+ Perl lexer handles regular expressions better.
+ </li>
+ <li>
+ Caret policy determines how closely caret is tracked by visible area.
+ </li>
+ <li>
+ New marker shapes: arrow pointing down, plus and minus.
+ </li>
+ <li>
+ Optionally display full path in title rather than just file name.
+ </li>
+ <li>
+ Container is notified when Scintilla gains or loses focus.
+ </li>
+ <li>
+ SciTE handles focus in a more standard way and applies the main
+ edit commands to the focused pane.
+ </li>
+ <li>
+ Container is notified when Scintilla determines that a line needs to be made visible.
+ </li>
+ <li>
+ Document watchers receive notification when document about to be deleted.
+ </li>
+ <li>
+ Document interface allows access to list of watchers.
+ </li>
+ <li>
+ Line end determined correctly for lines ending with only a '\n'.
+ </li>
+ <li>
+ Search variant that searches form current selection and sets selection.
+ </li>
+ <li>
+ SciTE understands format of diagnostic messages from WScript.
+ </li>
+ <li>
+ SciTE remembers top line of window for each file in MRU list so switching to a recent file
+ is more likely to show the same text as when the file was previously visible.
+ </li>
+ <li>
+ Document reference count now initialised correctly.
+ </li>
+ <li>
+ Setting a null document pointer creates an empty document.
+ </li>
+ <li>
+ WM_GETTEXT can no longer overrun buffer.
+ </li>
+ <li>
+ Polygon drawing bug fixed on GTK+.
+ </li>
+ <li>
+ Java and JavaScript lexers merged into C++ lexer.
+ </li>
+ <li>
+ C++ lexer indicates unterminated strings by colouring the end of the line
+ rather than changing the rest of the file to string style. This is less
+ obtrusive and helps the folding.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/SciTE121.zip?download">Release 1.21</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 2 February 2000.
+ </li>
+ <li>
+ Blank margins on left and right side of text.
+ </li>
+ <li>
+ SCN_CHECKBRACE renamed SCN_UPDATEUI and made more efficient.
+ </li>
+ <li>
+ SciTE source code refactored into platform independent and platform specific classes.
+ </li>
+ <li>
+ XML and Perl subset lexers in SciTE.
+ </li>
+ <li>
+ Large improvement to lexing speed.
+ </li>
+ <li>
+ A new subsystem, 2, allows use of ShellExec on Windows.
+ </li>
+ <li>
+ Borland compatible makefile.
+ </li>
+ <li>
+ Status bar showing caret position in GTK+ version of SciTE.
+ </li>
+ <li>
+ Bug fixes to selection drawing when part of selection outside window, mouse release over
+ scroll bars, and scroll positioning after deletion.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE120.zip">Release 1.2</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 21 January 2000.
+ </li>
+ <li>
+ Multiple views of one document.
+ </li>
+ <li>
+ Rectangular selection, cut, copy, paste, drag and drop.
+ </li>
+ <li>
+ Long line indication.
+ </li>
+ <li>
+ Reverse searching
+ </li>
+ <li>
+ Line end conversion.
+ </li>
+ <li>
+ Generic autocompletion and calltips in SciTE.
+ </li>
+ <li>
+ Call tip background colour can be set.
+ </li>
+ <li>
+ SCI_MARKERPREV for moving to a previous marker.
+ </li>
+ <li>
+ Caret kept more within window where possible.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE115.zip">Release 1.15</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 15 December 1999.
+ </li>
+ <li>
+ Brace highlighting and badlighting (for mismatched braces).
+ </li>
+ <li>
+ Visible line ends.
+ </li>
+ <li>
+ Multiple line call tips.
+ </li>
+ <li>
+ Printing now works from SciTE on Windows.
+ </li>
+ <li>
+ SciTE has a global "*" lexer style that is used as the basis for all the lexers' styles.
+ </li>
+ <li>
+ Fixes some warnings on GTK+ 1.2.6.
+ </li>
+ <li>
+ Better handling of modal dialogs on GTK+.
+ </li>
+ <li>
+ Resize handle drawn on pane splitter in SciTE on GTK+ so it looks more like a regular GTK+
+ *paned widget.
+ </li>
+ <li>
+ SciTE does not place window origin offscreen if no properties file found on GTK+.
+ </li>
+ <li>
+ File open filter remembered in SciTE on Windows.
+ </li>
+ <li>
+ New mechanism using style numbers 32 to 36 standardises the setting of styles for brace
+ highlighting, brace badlighting, line numbers, control characters and the default style.
+ </li>
+ <li>
+ Old messages SCI_SETFORE .. SCI_SETFONT have been replaced by the default style 32. The old
+ messages are deprecated and will disappear in a future version.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE114.zip">Release 1.14</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 20 November 1999.
+ </li>
+ <li>
+ Fixes a scrolling bug reported on GTK+.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE113.zip">Release 1.13</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 18 November 1999.
+ </li>
+ <li>
+ Fixes compilation problems with the mingw32 GCC 2.95.2 on Windows.
+ </li>
+ <li>
+ Control characters are now visible.
+ </li>
+ <li>
+ Performance has improved, particularly for scrolling.
+ </li>
+ <li>
+ Windows RichEdit emulation is more accurate. This may break client code that uses these
+ messages: EM_GETLINE, EM_GETLINECOUNT, EM_EXGETSEL, EM_EXSETSEL, EM_EXLINEFROMCHAR,
+ EM_LINELENGTH, EM_LINEINDEX, EM_CHARFROMPOS, EM_POSFROMCHAR, and EM_GETTEXTRANGE.
+ </li>
+ <li>
+ Menus rearranged and accelerator keys set for all static items.
+ </li>
+ <li>
+ Placement of space indicators in view whitespace mode is more accurate with some fonts.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE112.zip">Release 1.12</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 9 November 1999.
+ </li>
+ <li>
+ Packaging error in 1.11 meant that the compilation error was not fixed in that release.
+ Linux/GTK+ should compile with GCC 2.95 this time.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE111.zip">Release 1.11</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 7 November 1999.
+ </li>
+ <li>
+ Fixed a compilation bug in ScintillaGTK.cxx.
+ </li>
+ <li>
+ Added a README file to explain how to build.
+ </li>
+ <li>
+ GTK+/Linux downloads now include documentation.
+ </li>
+ <li>
+ Binary only Sc1.EXE one file download for Windows.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE110.zip">Release 1.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 6 November 1999.
+ </li>
+ <li>
+ Major restructuring for better modularity and platform independence.
+ </li>
+ <li>
+ Inter-application drag and drop.
+ </li>
+ <li>
+ Printing support in Scintilla on Windows.
+ </li>
+ <li>
+ Styles can select colouring to end of line. This can be used when a file contains more than
+ one language to differentiate between the areas in each language. An example is the HTML +
+ JavaScript styling in SciTE.
+ </li>
+ <li>
+ Actions can be grouped in the undo stack, so they will be undone together. This grouping is
+ hierarchical so higher level actions such as replace all can be undone in one go. Call to
+ discover whether there are any actions to redo.
+ </li>
+ <li>
+ The set of characters that define words can be changed.
+ </li>
+ <li>
+ Markers now have identifiers and can be found and deleted by their identifier. The empty
+ marker type can be used to make a marker that is invisible and which is only used to trace
+ where a particular line moves to.
+ </li>
+ <li>
+ Double click notification.
+ </li>
+ <li>
+ HTML styling in SciTE also styles embedded JavaScript.
+ </li>
+ <li>
+ Additional tool commands can be added to SciTE.
+ </li>
+ <li>
+ SciTE option to allow reloading if changed upon application activation and saving on
+ application deactivation. Not yet working on GTK+ version.
+ </li>
+ <li>
+ Entry fields in search dialogs remember last 10 user entries. Not working in all cases in
+ Windows version.
+ </li>
+ <li>
+ SciTE can save a styled copy of the current file in HTML format. As SciTE does not yet
+ support printing, this can be used to print a file by then using a browser to print the
+ HTML file.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE102.zip">Release 1.02</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 October 1999.
+ </li>
+ <li>
+ GTK+ version compiles with GCC 2.95.
+ </li>
+ <li>
+ Properly deleting objects when window destroyed under GTK+.
+ </li>
+ <li>
+ If the selection is not empty backspace deletes the selection.
+ </li>
+ <li>
+ Some X style middle mouse button handling for copying the primary selection to and from
+ Scintilla. Does not work in all cases.
+ </li>
+ <li>
+ HTML styling in SciTE.
+ </li>
+ <li>
+ Stopped dirty flag being set in SciTE when results pane modified.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE101.zip">Release 1.01</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 28 September 1999.
+ </li>
+ <li>
+ Better DBCS support on Windows including IME.
+ </li>
+ <li>
+ Wheel mouse support for scrolling and zooming on Windows. Zooming with Ctrl+KeypadPlus and
+ Ctrl+KeypadMinus.
+ </li>
+ <li>
+ Performance improvements especially on GTK+.
+ </li>
+ <li>
+ Caret blinking and settable colour on both GTK+ and Windows.
+ </li>
+ <li>
+ Drag and drop within a Scintilla window. On Windows, files can be dragged into SciTE.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/SciTE100.zip">Release 1.0</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 17 May 1999.
+ </li>
+ <li>
+ Changed name of "Tide" to "SciTE" to avoid clash with a TCL based IDE. "SciTE" is a
+ SCIntilla based Text Editor and is Latin meaning something like "understanding in a neat
+ way" and is also an Old English version of the word "shit".
+ </li>
+ <li>
+ There is a SCI_AUTOCSTOPS message for defining a string of characters that will stop
+ autocompletion mode. Autocompletion mode is cancelled when any cursor movement occurs apart
+ from backspace.
+ </li>
+ <li>
+ GTK+ version now splits horizontally as well as vertically and all dialogs cancel when the
+ escape key is pressed.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide92.zip">Beta release 0.93</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 12 May 1999.
+ </li>
+ <li>
+ A bit more robust than 0.92 and supports SCI_MARKERNEXT message.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide92.zip">Beta release 0.92</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 11 May 1999.
+ </li>
+ <li>
+ GTK+ version now contains all features of Windows version with some very small differences.
+ Executing programs works much better now.
+ </li>
+ <li>
+ New palette code to allow more colours to be displayed in 256 colour screen modes. A line
+ number column can be displayed to the left of the selection margin.
+ </li>
+ <li>
+ The code that maps from line numbers to text positions and back has been completely
+ rewritten to be faster, and to allow markers to move with the text.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide91.zip">Beta release 0.91</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 30 April 1999, containing fixes to text measuring to make Scintilla work better
+ with bitmap fonts. Also some small fixes to make compiling work with Visual C++.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide90.zip">Beta release 0.90</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 29 April 1999, containing working GTK+/Linux version.
+ </li>
+ <li>
+ The Java, C++ and Python lexers recognise operators as distinct from default allowing them
+ to be highlighted.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide82.zip">Beta release 0.82</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 1 April 1999, to fix a problem with handling the Enter key in PythonWin. Also
+ fixes some problems with cmd key mapping.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/Tide81.zip">Beta release 0.81</a>
+ </h3>
+ <ul>
+ <li>
+ Released on 30th March 1999, containing bug fixes and a few more features.
+ </li>
+ <li>
+ Static linking supported and Tidy.EXE, a statically linked version of Tide.EXE. Changes to
+ compiler flags in the makefiles to optimise for size.
+ </li>
+ <li>
+ Scintilla supports a 'savepoint' in the undo stack which can be set by the container when
+ the document is saved. Notifications are sent to the container when the savepoint is
+ entered or left, allowing the container to to display a dirty indicator and change its
+ menus.
+ </li>
+ <li>
+ When Scintilla is set to read-only mode, a notification is sent to the container should the
+ user try to edit the document. This can be used to check the document out of a version
+ control system.
+ </li>
+ <li>
+ There is an API for setting the appearance of indicators.
+ </li>
+ <li>
+ The keyboard mapping can be redefined or removed so it can be implemented completely by the
+ container. All of the keyboard commands are now commands which can be sent by the
+ container.
+ </li>
+ <li>
+ A home command like Visual C++ with one hit going to the start of the text on the line and
+ the next going to the left margin is available. I do not personally like this but my
+ fingers have become trained to it by much repetition.
+ </li>
+ <li>
+ SCI_MARKERDELETEALL has an argument in wParam which is the number of the type marker to
+ delete with -1 performing the old action of removing all marker types.
+ </li>
+ <li>
+ Tide now understands both the file name and line numbers in error messages in most cases.
+ </li>
+ <li>
+ Tide remembers the current lines of files in the recently used list.
+ </li>
+ <li>
+ Tide has a Find in Files command.
+ </li>
+ </ul>
+ <h3>
+ Beta release 0.80
+ </h3>
+ <ul>
+ <li>
+ This was the first public release on 14th March 1999, containing a mostly working Win32
+ Scintilla DLL and Tide EXE.
+ </li>
+ </ul>
+ <h3>
+ Beta releases of SciTE were called Tide
+ </h3>
+ </body>
+</html>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaRelated.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaRelated.html
new file mode 100644
index 00000000000..e0cd4f18b9d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaRelated.html
@@ -0,0 +1,552 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla and SciTE Related Sites
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ and SciTE</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Related Sites
+ </h2>
+ <h3>
+ Ports and Bindings of Scintilla
+ </h3>
+ <p>
+ <a href="http://foicica.com/scinterm/">Scinterm</a>
+ is an implementation of Scintilla for the ncurses platform.
+ </p>
+ <p>
+ <a href="http://www.morphos-team.net/releasenotes/3.0">Scintilla.mcc</a>
+ is a port to MorphOS.
+ </p>
+ <p>
+ <a href="https://metacpan.org/module/Wx::Scintilla">Wx::Scintilla</a>
+ is a Perl Binding for Scintilla on wxWidgets.
+ </p>
+ <p>
+ <a href="http://codebrainz.github.com/GtkScintilla/">GtkScintilla</a>
+ is a GTK+ widget which enables easily adding a powerful
+ source code editor to your applications. Harnessing the abilities
+ of the Scintilla editing component, GtkScintilla adds a familiar
+ GTK+/GObject API, making the widget comfortable to use in
+ these programs, using all the typical GObject conventions.
+ </p>
+ <p>
+ <a href="http://mewsoft.com/cgi-bin/forum/forum.cgi?action=ViewTopic&Topic=1494&Forum=1&Page=1&Period=0a&Lang=English">Editawy</a>
+ is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/jintilla/">Jintilla</a>
+ is a JNI wrapper that allows Scintilla to be used in Java with
+ both SWT and AWT.
+ </p>
+ <p>
+ <a href="http://delphisci.sourceforge.net/">Delphi Scintilla Interface Components</a>
+ is a FREE collection of components that makes it easy to use the
+ Scintilla source code editing control from within Delphi and C++ Builder.
+ </p>
+ <p>
+ <a href="http://wxcode.sourceforge.net/showcomp.php?name=wxStEdit">wxStEdit</a>
+ is a library and sample program that provides extra features over wxStyledTextControl.
+ </p>
+ <p>
+ <a href="http://www.naughter.com/scintilla.html">CScintillaCtrl, CScintillaView &amp; CScintillaDoc</a>
+ are freeware MFC classes to encapsulate Scintilla.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/scide/">ScintillaNet
+ </a> is an encapsulation of Scintilla for use within the .NET framework.
+ </p>
+ <p>
+ <a href="http://www.riverbankcomputing.co.uk/software/qscintilla/intro">QScintilla
+ </a> is a port of Scintilla to the Qt platform. It has a similar license to Qt: GPL for use in
+ free software and commercial for use in close-source applications.
+ </p>
+ <p>
+ <a href="http://www.adapower.com/gwindows/">
+ GWindows</a> is a Win32 RAD GUI Framework for Ada 95 that
+ includes a binding of Scintilla.
+ </p>
+ <p>
+ <a href="http://scintilla.cvs.sourceforge.net/viewvc/scintilla/ScintillaVB/">ScintillaVB</a>
+ is an ActiveX control written in VB that encapsulates Scintilla.
+ </p>
+ <p>
+ <a href="http://savannah.nongnu.org/projects/fxscintilla/">FXScintilla
+ </a> is a port of Scintilla to the FOX platform. FXRuby includes Ruby
+ bindings for FXScintilla.
+ </p>
+ <p>
+ <a href="http://www.pnotepad.org/scintilla/">Delphi wrapper</a> for
+ Scintilla which is also usable from Borland C++ Builder.
+ </p>
+ <p>
+ The wxStyledTextCtrl editor component in the
+ <a href="http://www.wxwidgets.org/">wxWidgets</a> cross platform toolkit is based on Scintilla.<br />
+ A Python binding for wxStyledTextCtrl is part of <a href="http://wxpython.org/">wxPython</a>.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/moleskine/">gtkscintilla</a>
+ is an alternative GTK class implementation for scintilla.
+ This implementation acts more like a Gtk+ object, with many methods rather
+ than just scintilla_send_message() and is available as a shared library.
+ This implementation works with GTK 1.x.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/moleskine/">gtkscintilla2</a>
+ is an alternative GTK class implementation for scintilla
+ similar to the above, but for GTK 2.x.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/moleskine/">pygtkscintilla</a>
+ is a Python binding for gtk1.x scintilla that uses
+ gtkscintilla instead of the default GTK class.
+ </p>
+ <p>
+ <a href="http://scintilla.cvs.sourceforge.net/viewvc/scintilla/scintillactrl/">ScintillaCtrl</a>
+ is an unmaintained ActiveX control wrapper for Scintilla.
+ </p>
+ <h3>
+ Projects using Scintilla
+ </h3>
+ <p>
+ <a href="http://rhaberkorn.github.com/sciteco/">SciTECO</a>
+ is an advanced TECO dialect and interactive screen editor based on Scintilla.
+ </p>
+ <p>
+ <a href="http://www.qgis.org/">Quantum GIS</a>
+ is a user friendly Open Source Geographic Information System (GIS).
+ </p>
+ <p>
+ <a href="https://gitorious.org/qgrinui">QGrinUI</a>
+ searches for a regex within all relevant files in a directory and shows matches using
+ SciTE through the director interface.
+ </p>
+ <p>
+ <a href="http://foicica.com/textadept/">Textadept</a>
+ is a ridiculously extensible cross-platform text editor for programmers written (mostly) in
+ Lua using LPeg to handle the lexers.
+ </p>
+ <p>
+ <a href="http://www.morphos-team.net/releasenotes/3.0">Scribble</a>
+ is a text editor included in MorphOS.
+ </p>
+ <p>
+ <a href="http://mysqlworkbench.org/">MySQL Workbench</a>
+ is a cross-platform, visual database design, sql coding and administration tool.
+ </p>
+ <p>
+ <a href="http://liveditor.com/index.html">LIVEditor</a>
+ is for web front end coders editing html/css/js code.
+ </p>
+ <p>
+ <a href="http://padre.perlide.org/">Padre</a>
+ is a wxWidgets-based Perl IDE.
+ </p>
+ <p>
+ <a href="http://manoscoder.gr/CoderStudio/CoderStudio.asp">CoderStudio</a>
+ is an IDE for Assembly programming similar to Visual Studio 6.0.
+ </p>
+ <p>
+ <a href="http://www.sparxsystems.com/products/ea/index.html">Enterprise Architect</a>
+ is a UML 2.1 analysis and design tool.
+ </p>
+ <p>
+ <a href="https://launchpad.net/codeassistor">The CodeAssistor Editor</a>
+ is a small and simple MacOSX source code editor.
+ </p>
+ <p>
+ <a href="http://www.topwizprogramming.com/freecode_pbeditor.html">PBEditor</a>
+ is a text editor for PowerBuilder.
+ </p>
+ <p>
+ <a href="http://www.cryptool.org/">CrypTool</a>
+ is an application for applying and analyzing cryptographic algorithms.
+ </p>
+ <p>
+ <a href="http://code.google.com/p/fxite/">FXiTe</a>
+ is an advanced cross-platform text editor built with the Fox GUI toolkit
+ and the FXScintilla text widget.
+ </p>
+ <p>
+ <a href="http://www.jabaco.org/">Jabaco</a>
+ is a simple programming language with a Visual Basic like syntax.
+ </p>
+ <p>
+ <a href="http://www.daansystems.com/lispide">LispIDE</a>
+ is a basic Lisp editor for Windows 2000, XP and Vista.
+ </p>
+ <p>
+ <a href="http://www.flexsoft.cc/download.htm">FlexEdit</a>
+ is Free Text/Hex Editor for Windows.
+ </p>
+ <p>
+ <a href="http://www.assembla.com/wiki/show/FileWorkbench">File Workbench:</a>
+ a file manager / text editor environment with Squirrel scripting.
+ </p>
+ <p>
+ <a href="http://kephra.sf.net">Kephra</a>
+ is a free, easy and comfortable cross-platform editor written in Perl.
+ </p>
+ <p>
+ <a href="http://top.gresham-computing.com">TOP</a>
+ is an interface to HP's NonStop servers which run a proprietary OS.
+ </p>
+ <p>
+ <a href="http://universalindent.sourceforge.net/">UniversalIndentGUI</a>
+ is a cross platform GUI for several code formatters, beautifiers and indenters
+ like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.
+ </p>
+ <p>
+ <a href="http://scitools.com/products/trackback/product.php">TrackBack</a>
+ watches and backs up every change made in your source code.
+ </p>
+ <p>
+ <a href="http://elementaryreports.com/">Elementary Reports</a>
+ is designed to reduce the time to compose detailed and professional primary school reports.
+ </p>
+ <p>
+ <a href="http://stepaheadsoftware.com/products/vcw/vcw.htm">Visual Classworks</a>
+ Visual class modeling and coding in C++ via 'live'
+ UML style class diagrams.
+ </p>
+ <p>
+ <a href="http://stepaheadsoftware.com/products/javelin/javelin.htm">Javelin</a>
+ Visual Class modeling and coding in Java via 'live' UML style
+ class diagrams.
+ </p>
+ <p>
+ The <a href="http://www.adobe.com/devnet/bridge/">ExtendScript Toolkit</a>
+ is a development and debugging tool for JavaScript
+ scripts included with Adobe CS3 Suites.
+ </p>
+ <p>
+ <a href="http://tortoisesvn.net/">TortoiseSVN</a>
+ is a Windows GUI client for the Subversion source control software.
+ </p>
+ <p>
+ <a href="http://www.geany.org/">Geany</a>
+ is a small and fast GTK2 based IDE, which has only a few dependencies from other packages.
+ </p>
+ <p>
+ <a href="http://www.elliecomputing.com/products/merge_overview.asp">ECMerge</a>
+ is a commercial graphical and batch diff / merge tool for Windows, Linux and Solaris
+ (aiming to target all major platforms).
+ </p>
+ <p>
+ <a href="http://pype.sourceforge.net/">PyPE</a>
+ is an editor written in Python with the wxPython GUI toolkit.
+ </p>
+ <p>
+ <a href="http://home.mweb.co.za/sd/sdonovan/sciboo.html">Sciboo</a>
+ is an editor based on ScintillaNET.
+ </p>
+ <p>
+ <a href="https://sourceforge.net/projects/tsct/">The Scite Config Tool</a>
+ is a graphical user interface for changing SciTE properties files.
+ </p>
+ <p>
+ <a href="http://www.totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
+ is a plugin for Total Commander allowing viewing all documents with syntax highlighting
+ inside Total Commander.
+ </p>
+ <p>
+ <a href="http://chscite.sourceforge.net">ChSciTE</a>
+ is a free IDE for C/C++ interpreter Ch. It runs cross platform.
+ Ch is for cross-platform scripting, shell
+ programming, 2D/3D plotting, numerical computing, and embedded
+ scripting.
+ </p>
+ <p>
+ <a href="http://codeblocks.org/">
+ Code::Blocks</a> is an open source, cross platform free C++ IDE.
+ </p>
+ <p>
+ <a href="http://notepad-plus.sourceforge.net/uk/site.htm">
+ Notepad++</a> is a free source code editor under Windows.
+ </p>
+ <p>
+ <a href="http://gubed.mccabe.nu/">
+ Gubed</a> is a cross platform program to debug PHP scripts.
+ </p>
+ <p>
+ <a href="http://www.lesser-software.com/lswdnl.htm">
+ LSW DotNet-Lab</a> is a development environment for the .NET platform.
+ </p>
+ <p>
+ <a href="http://glintercept.nutty.org/">
+ GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
+ run-time shader editor.
+ </p>
+ <p>
+ <a href="http://wxguide.sourceforge.net/indexedit.html">
+ wyoEditor</a> is "A nice editor with a well designed and consistent look and feel".
+ </p>
+ <p>
+ <a href="http://www.flos-freeware.ch/notepad2.html">
+ Notepad2</a> is "Yet another Notepad replacement".
+ </p>
+ <p>
+ <a href="http://pycrash.sourceforge.net/index.php?type=3">
+ PyCrash Viewer</a> can examine crash dumps of Python programs.
+ </p>
+ <p>
+ <a href="http://www.cabletest.com/mpt-wa-software-discovery.shtml">
+ MPT series Wire Analyzers</a> use Scintilla and SciTE.
+ </p>
+ <p>
+ <a href="http://www.mygenerationsoftware.com">MyGeneration</a>
+ is a .NET based code generator.
+ </p>
+ <p>
+ <a href="http://cssed.sourceforge.net">CSSED</a>
+ is a tiny GTK2 CSS editor.
+ </p>
+ <p>
+ <a href="http://wxghostscript.sourceforge.net/">
+ IdePS</a>
+ is a free Integrated Development Environment for PostScript
+ </p>
+ <p>
+ <a href="http://cute.sourceforge.net/">
+ CUTE</a>
+ is a user-friendly source code editor easily extended using Python.
+ </p>
+ <p>
+ <a href="http://www.spaceblue.com/venis/">
+ Venis IX</a>,
+ the Visual Environment for NSIS (Nullsoft Scriptable Install System).
+ </p>
+ <p>
+ <a href="http://www.die-offenbachs.de/detlev/eric.html">Eric3</a>
+ is a Python IDE written using PyQt and QScintilla.
+ </p>
+ <p>
+ <a href="http://www.bomberstudios.com/sciteflash/">SciTE|Flash</a>
+ is a free Scintilla-based ActionScript editor for Windows.
+ </p>
+ <p>
+ <a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
+ is part of some commercial high-school oriented programming course software.
+ </p>
+ <p>
+ <a href="http://www.blazingtools.com/is.html">Instant Source</a>
+ is a commercial tool for looking at the HTML on web sites.
+ </p>
+ <p>
+ <a href="http://www.codejoin.com/radon/">RAD.On++</a>
+ is a free C++ Rapid Application Developer for Win32.
+ </p>
+ <p>
+ <a href="http://wxbasic.sourceforge.net/">wxBasic</a> is an open source
+ Basic interpreter that uses the wxWidgets toolkit. A small IDE is under construction.
+ </p>
+ <p>
+ <a href="http://freeride.rubyforge.org/wiki/wiki.pl">FreeRIDE</a> will be a
+ cross-platform IDE for the Ruby programming language.
+ </p>
+ <p>
+ <a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
+ IDE for the MinGW compiler system.This runs on Windows with gcc.
+ </p>
+ <p>
+ The <a href="http://archaeopteryx.com/wingide">Wing IDE</a> is a
+ complete integrated development environment for the Python programming
+ language.
+ Available on Intel based Linux and Windows and on MacOS X through XDarwin.
+ </p>
+ <p>
+ <a href="http://www.gorlice.net.pl/~rybak/luaide/">LuaIDE</a>
+ is an IDE for Lua on Windows.
+ </p>
+ <p>
+ <a href="http://www.aegisknight.org/sphere/">Sphere</a>
+ is 2D RPG engine with a development environment.
+ </p>
+ <p>
+ <a href="http://gaiacrtn.free.fr/practical-ruby/index.html">Practical Ruby</a>
+ is an IDE for Ruby on Windows.
+ </p>
+ <p>
+ <a href="http://www.gnuenterprise.org/">GNUe</a>
+ is a suite of tools and applications for solving the needs of the enterprise.
+ </p>
+ <p>
+ <a href="http://silvercity.sourceforge.net/">SilverCity</a>
+ is a lexing package that can provide lexical analysis for over 20 programming
+ and markup languages.
+ </p>
+ <p>
+ <a href="http://hapdebugger.sourceforge.net/">HAP Python Remote Debugger</a>
+ is a Python debugger that can run on one Windows machine debugging a Python program running
+ on either the same or another machine.
+ </p>
+ <p>
+ <a href="http://www.rexx.com/~dkuhlman/">pyeditor and wxEditor</a>
+ are scriptable editors implemented in Python. pyeditor is based on GTK+ and
+ the pyscintilla wrapper. wxEditor is based on wxWidgets, wxPython and
+ wxStyledTextControl.
+ </p>
+ <p>
+ <a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
+ Python shell based on wxPython.
+ </p>
+ <p>
+ <a href="http://www.thekompany.com/products/blackadder/">Black Adder</a> is a
+ Qt based development environment for Python and Ruby.
+ </p>
+ <p>
+ <a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
+ is a cross-platform multi-language development environment built
+ as an application of Mozilla.
+ </p>
+ <p>
+ <a href="http://llt.chez-alice.fr/">Filerx</a>
+ is a project manager for SciTE on Windows.
+ Open source and includes an implementation of SciTE's Director interface so
+ will be of interest to others wanting to control SciTE.
+ </p>
+ <p>
+ <a href="http://anjuta.sourceforge.net/">Anjuta</a>
+ is an open source C/C++ IDE for Linux/GNOME.
+ </p>
+ <p>
+ A <a href="http://www.burgaud.com">version of SciTE for Win32</a> enhanced
+ with a tab control to allow easy movement between buffers.
+ Go to the "Goodies" area on this site.
+ </p>
+ <p>
+ <a href="http://www.suneido.com">
+ Suneido</a> is an integrated application platform currently available for Win32 that includes an
+ object-oriented language, client-server database, and user interface and reporting frameworks.
+ </p>
+ <p>
+ <a href="http://www.allitis.com/agast/home.html">
+ Agast</a> is an authoring system for adventure games which includes
+ a customised version of SciTE.
+ </p>
+ <p>
+ <a href="http://boa-constructor.sourceforge.net/">Boa Constructor</a> is a RAD GUI
+ Building IDE for the wxWidgets cross platform platform. Written using wxPython with the
+ wxStyledTextCtrl used as its editor.
+ </p>
+ <p>
+ <a href="http://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
+ Scintilla for both its editing and interactive windows.
+ </p>
+ <h3>
+ Editing Components
+ </h3>
+ <p>
+ <a href="http://www.soft-gems.net/index.php/controls/unicodeeditor-formerly-unicode-syntax-editor">UniCodeEditor</a>
+ is a Unicode aware syntax editor control for Delphi and C++ Builder.
+ </p>
+ <p>
+ <a href="http://projects.gnome.org/gtksourceview/">GtkSourceView</a>
+ is a text widget that extends the standard GTK+ 2.x text widget and improves it
+ by implementing syntax highlighting and other features typical of a source editor.
+ </p>
+ <p>
+ <a href="http://aeditor.rubyforge.org/">AEditor</a>
+ is a free source code editing component implemented in Ruby.
+ </p>
+ <p>
+ <a href="http://www.actiprosoftware.com/Products/DotNet/SyntaxEditor/Default.aspx">SyntaxEditor</a>
+ is a commercial native .Net source code editing component.
+ </p>
+ <p>
+ <a href="http://jedit.sourceforge.net/">jEdit</a> is a good Open Source syntax colouring
+ editor written in and for Java.
+ </p>
+ <p>
+ <a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
+ widget.<br />
+ <a href="http://gedit.sourceforge.net/">Gedit</a> is an editor for GTK+/GNOME.<br />
+ <!--
+ <a href="http://www.daimi.au.dk/~mailund/gtk.html">GtkEditor</a> is a source code editing
+ widget based on the GTK+ text widget.<br />
+ <a href="http://gide.gdev.net/">gIDE</a> is an IDE based on GTK+.<br />
+ <a href="http://www.bahnhof.se/~mikeh/linux_software.html">GtkExText</a> is a source code
+ oriented text widget for GTK+.
+ -->
+ </p>
+ <p>
+ <a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
+ editors.
+ </p>
+ <a href="http://synedit.sourceforge.net/">SynEdit</a> is a Win32 edit control written
+ in Delphi.
+ <p>
+ <a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
+ component for Win32.
+ </p>
+ <p>
+ <a href="http://www.winmain.com/">CodeMax</a> is another commercial component for Win32.
+ </p>
+ <h3>
+ Documents
+ </h3>
+ <p>
+ <a href="http://www.finseth.com/craft/">The Craft of Text Editing</a>
+ describes how EMACS works, <i>Craig A. Finseth</i>
+ </p>
+ <p>
+ <a href="http://www.cs.cmu.edu/~wjh/papers/byte.html">Data Structures in a Bit-Mapped Text
+ Editor</a>, <i>Wilfred J. Hanson</i>, Byte January 1987
+ </p>
+ <p>
+ Text Editors: Algorithms and Architectures, <i>Ray Vald&eacute;s</i>, Dr. Dobbs Journal
+ April 1993
+ </p>
+ <p>
+ Macintosh User Interface Guidelines and TextEdit chapters of Inside Macintosh
+ </p>
+ <h3>
+ Development Tools
+ </h3>
+ <p>
+ Scintilla and SciTE were developed using the
+ <a href="http://www.mingw.org/">Mingw version of GCC</a>.
+ </p>
+ <p>
+ <a href="http://astyle.sourceforge.net/">AStyle</a> is a source code formatter for C++ and
+ Java code. SciTE has an Indent command defined for .cxx files that uses AStyle.
+ </p>
+ <p>
+ <a href="http://winmerge.org/">WinMerge</a> is an interactive diff / merge
+ for Windows. I prefer code submissions in the form of source files rather than diffs and then run
+ WinMerge over the files to work out how to merge.
+ </p>
+ <p>
+ <a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
+ was started after I tried to improve the editor built into <a
+ href="http://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
+ the Windows Richedit control which PythonWin used.
+ </p>
+ <p>
+ <a href="http://www.cse.yorku.ca/~oz/">regex</a> is a public domain
+ implementation of regular expression pattern matching used in Scintilla.
+ </p>
+ <p>
+ Inspirational coding soundscapes by <a href="http://www.davidbridie.com.au">David Bridie</a>.
+ </p>
+ </body>
+</html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaToDo.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaToDo.html
new file mode 100644
index 00000000000..3fceb1a25f1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaToDo.html
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla and SciTE To Do
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ and SciTE</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Bugs and To Do List
+ </h2>
+ <h3>
+ Feedback
+ </h3>
+ <p>
+ Issues can be reported on the <a href="http://sourceforge.net/p/scintilla/bugs/">Bug Tracker</a>
+ and features requested on the <a href="http://sourceforge.net/p/scintilla/feature-requests/">Feature Request Tracker</a>.
+ </p>
+ <h3>
+ Scintilla Bugs
+ </h3>
+ <p>
+ Automatic scrolling when text dragged near edge of window.
+ </p>
+ <h3>
+ Scintilla To Do
+ </h3>
+ <p>
+ Folding for languages that don't have it yet and good folding for languages
+ that inherited poor folding from another languages folding code.
+ </p>
+ <p>
+ Simple pattern based styling.
+ </p>
+ <p>
+ Different height lines based upon tallest text on the line rather than on the tallest style
+ possible.
+ </p>
+ <p>
+ Composition of lexing for mixed languages (such as ASP+ over COBOL) by
+ combining lexers.
+ </p>
+ <p>
+ Stream folding which could be used to fold up the contents of HTML elements.
+ </p>
+ <p>
+ Printing of highlight lines and folding margin.
+ </p>
+ <p>
+ Flow diagrams inside editor similar to
+ GRASP.
+ </p>
+ <p>
+ More lexers for other languages.
+ </p>
+ <h3>
+ SciTE To Do
+ </h3>
+ <p>
+ Good regular expression support through a plugin.
+ </p>
+ <p>
+ Allow file name based selection on all properties rather than just a chosen few.
+ </p>
+ <p>
+ Opening from and saving to FTP servers.
+ </p>
+ <p>
+ Setting to fold away comments upon opening.
+ </p>
+ <p>
+ User defined fold ranges.
+ </p>
+ <p>
+ Silent mode that does not display any message boxes.
+ </p>
+ <h3>
+ Features I am unlikely to do
+ </h3>
+ <p>
+ These are features I don't like or don't think are important enough to work on.
+ Implementations are welcome from others though.
+ </p>
+ <p>
+ Mouse wheel panning (press the mouse wheel and then move the mouse) on
+ Windows.
+ </p>
+ <p>
+ Adding options to the save dialog to save in a particular encoding or with a
+ chosen line ending.
+ </p>
+ <h3>
+ Directions
+ </h3>
+ <p>
+ The main point of this development is Scintilla, and this is where most effort will
+ go. SciTE will get new features, but only when they make my life easier - I am
+ not intending to make it grow up to be a huge full-function IDE like Visual
+ Cafe. The lines I've currently decided not to step over in SciTE are any sort of
+ project facility and any configuration dialogs. SciTE for Windows now has a
+ Director interface for communicating with a separate project manager
+ application.
+ </p>
+ <p>
+ If you are interested in contributing code, do not feel any need to make it cross
+ platform.
+ Just code it for your platform and I'll either reimplement for the other platform or
+ ensure that there is no effect on the other platform.
+ </p>
+ </body>
+</html>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaUsage.html b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaUsage.html
new file mode 100644
index 00000000000..e0ffb0bfc40
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/ScintillaUsage.html
@@ -0,0 +1,375 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>
+ Scintilla Usage Notes
+ </title>
+<style type="text/css">
+SPAN {
+ font-family: Verdana, Arial, Helvetica;
+ font-size: 9pt;
+}
+.S0 {
+ color: #808080;
+ font-family: Verdana, Arial, Helvetica;
+}
+.S1 {
+ font-family: Comic Sans MS, Times New Roman, Times;
+ color: #007F00;
+ font-size: 8pt;
+}
+.S2 {
+ font-family: Comic Sans MS, Times New Roman, Times;
+ color: #007F00;
+ font-size: 8pt;
+}
+.S3 {
+ font-family: Verdana, Arial, Helvetica;
+ color: #7F7F7F;
+}
+.S4 {
+ font-family: Verdana, Arial, Helvetica;
+ color: #007F7F;
+}
+.S5 {
+ color: #00007F;
+ font-weight: bold;
+ font-family: Verdana, Arial, Helvetica;
+}
+.S6 {
+ color: #7F007F;
+ font-family: Courier New, Courier;
+}
+.S7 {
+ color: #7F007F;
+ font-family: Courier New, Courier;
+}
+.S8 {
+ color: #007F7F;
+}
+.S9 {
+ color: #7F7F00;
+}
+.S10 {
+ font-weight: bold;
+}
+</style>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>
+ <img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
+ </td>
+ <td>
+ <a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
+ Usage Notes</font></a>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ Implementing Auto-Indent
+ </h2>
+ <p>
+ The key idea is to use the SCN_CHARADDED notification to add indentation after a newline.
+ </p>
+ <p>
+ The lParam on the notification is a pointer to a SCNotification structure whose ch member
+ specifies the character added. If a newline was added, the previous line can be retrieved and
+ the same indentation can be added to the new line.
+ </p>
+ <p>
+ Here is the relevant portion of code from SciTE: (SciTE.cxx SciTEWindow::CharAdded)
+ </p>
+ <span class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
+ class='S11'>ch</span><span class='S0'>&nbsp;</span> <span class='S10'>==</span><span
+ class='S0'>&nbsp;</span> <span class='S7'>'\r'</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>||</span><span class='S0'>&nbsp;</span> <span class='S11'>ch</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>==</span><span class='S0'>&nbsp;</span> <span
+ class='S7'>'\n'</span><span class='S10'>)</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>char</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
+ class='S10'>];</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>GetCurrentLineNumber</span><span
+ class='S10'>();</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>lineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
+ =</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
+ class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span class='S10'>);</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S2'>
+ //Platform::DebugPrintf("[CR]&nbsp;%d&nbsp;len&nbsp;=&nbsp;%d\n",&nbsp;curLine,&nbsp;lineLength);</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>(</span><span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>&gt;</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>lineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
+ &lt;=</span><span class='S0'>&nbsp;</span> <span class='S4'>2</span><span
+ class='S10'>)</span><span class='S0'>&nbsp;</span> <span class='S10'>{</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>prevLineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
+ =</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
+ class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
+ class='S10'>);</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>(</span><span class='S11'>prevLineLength</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>&lt;</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
+ class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>))</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>WORD</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>buflen</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
+ class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>);</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>memcpy</span><span
+ class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>&amp;</span><span class='S11'>buflen</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
+ class='S10'>(</span><span class='S11'>buflen</span><span class='S10'>));</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
+ SendEditor</span><span class='S10'>(</span><span class='S11'>EM_GETLINE</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>-</span><span class='S0'>&nbsp;</span> <span
+ class='S4'>1</span><span class='S10'>,</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S5'>reinterpret_cast</span><span class='S10'>&lt;</span><span
+ class='S11'>LPARAM</span><span class='S10'>&gt;(</span><span class='S5'>static_cast</span><span
+ class='S10'>&lt;</span><span class='S5'>char</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>*&gt;(</span><span class='S11'>linebuf</span><span class='S10'>)));</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>linebuf</span><span
+ class='S10'>[</span><span class='S11'>prevLineLength</span><span class='S10'>]</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>=</span><span class='S0'>&nbsp;</span> <span
+ class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>for</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>(</span><span class='S5'>int</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>pos</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S10'>;</span><span class='S0'>&nbsp;</span> <span class='S11'>linebuf</span><span
+ class='S10'>[</span><span class='S11'>pos</span><span class='S10'>];</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>pos</span><span class='S10'>++)</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span
+ class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
+ class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
+ class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>!=</span><span
+ class='S0'>&nbsp;</span> <span class='S7'>'&nbsp;'</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span> <span class='S11'>
+ linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
+ class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>!=</span><span
+ class='S0'>&nbsp;</span> <span class='S7'>'\t'</span><span class='S10'>)</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
+ class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S7'>'\0'</span><span class='S10'>;</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S10'>}</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
+ SendEditor</span><span class='S10'>(</span><span class='S11'>EM_REPLACESEL</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S5'>
+ reinterpret_cast</span><span class='S10'>&lt;</span><span class='S11'>LPARAM</span><span
+ class='S10'>&gt;(</span><span class='S5'>static_cast</span><span class='S10'>&lt;</span><span
+ class='S5'>char</span><span class='S0'>&nbsp;</span> <span class='S10'>*&gt;(</span><span
+ class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S10'>}</span><span class='S0'><br />
+ </span> <span class='S10'>}</span><br />
+
+ <p style="margin-bottom: 0in">
+ Of course, fancier handling could be implemented. For example, if the previous line was the
+ start of a control construct, the next line could be automatically indented one tab further.
+ (Assuming that is your indenting style.)
+ </p>
+ <h2>
+ Implementing Syntax Styling
+ </h2>
+ <p>
+ Syntax styling is handled by the SCN_STYLENEEDED notification. Scintilla keeps track of the
+ end of the styled text - this is retrieved with SCI_GETENDSTYLED. In response to the
+ SCN_STYLENEEDED notification, you should apply styles to the text from ENDSTYLED to the
+ position specified by the notification.
+ </p>
+ <p>
+ Here is the relevant portion of code from SciTE: (SciTE.cxx)
+ </p>
+ <span class='S5'>void</span><span class='S0'>&nbsp;</span> <span class='S11'>
+ SciTEWindow</span><span class='S10'>::</span><span class='S11'>Notify</span><span
+ class='S10'>(</span><span class='S11'>SCNotification</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>*</span><span class='S11'>notification</span><span class='S10'>)</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>switch</span><span class='S0'>&nbsp;</span>
+ <span class='S10'>(</span><span class='S11'>notification</span><span
+ class='S10'>-&gt;</span><span class='S11'>nmhdr.code</span><span class='S10'>)</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>case</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>SCN_STYLENEEDED</span><span class='S10'>:</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span
+ class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
+ class='S11'>notification</span><span class='S10'>-&gt;</span><span
+ class='S11'>nmhdr.idFrom</span><span class='S0'>&nbsp;</span> <span class='S10'>==</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>IDM_SRCWIN</span><span class='S10'>)</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S5'>int</span><span class='S0'>&nbsp;</span> <span class='S11'>
+ endStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
+ class='S11'>SCI_GETENDSTYLED</span><span class='S10'>);</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S5'>int</span><span class='S0'>&nbsp;</span> <span class='S11'>
+ lineEndStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
+ class='S11'>EM_LINEFROMCHAR</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>endStyled</span><span class='S10'>);</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S11'>endStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>
+ =</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
+ class='S10'>(</span><span class='S11'>EM_LINEINDEX</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>lineEndStyled</span><span class='S10'>);</span><span
+ class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+ <span class='S11'>Colourise</span><span class='S10'>(</span><span
+ class='S11'>endStyled</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>notification</span><span class='S10'>-&gt;</span><span
+ class='S11'>position</span><span class='S10'>);</span><br />
+
+ <p>
+ Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in
+ keywords.cxx. It starts the process by calling:
+ </p>
+ &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessage</span><span class='S10'>(</span><span
+ class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>SCI_STARTSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>startPos</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S4'>31</span><span class='S10'>);</span><br />
+
+ <p>
+ and then for each token of the text, calling:
+ </p>
+ &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessage</span><span class='S10'>(</span><span
+ class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>SCI_SETSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>length</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>style</span><span class='S10'>);</span><br />
+
+ <p>
+ where style is a number from 0 to 31 whose appearance has been defined using the
+ SCI_STYLESET... messages.
+ </p>
+ <h2>
+ Implementing Calltips
+ </h2>
+ <p>
+ Again, the SCN_CHARADDED notification is used to catch when an opening parenthesis is added.
+ The preceding word can then be retrieved from the current line:
+ </p>
+ &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>char</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
+ class='S10'>];</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>current</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
+ class='S11'>SCI_GETCURLINE</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S5'>sizeof</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
+ class='S10'>),</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>
+ reinterpret_cast</span><span class='S10'>&lt;</span><span class='S11'>LPARAM</span><span
+ class='S10'>&gt;(</span><span class='S5'>static_cast</span><span class='S10'>&lt;</span><span
+ class='S5'>char</span><span class='S0'>&nbsp;</span> <span class='S10'>*&gt;(</span><span
+ class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>pos</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
+ class='S11'>SCI_GETCURRENTPOS</span><span class='S10'>);</span><span class='S0'><br />
+ <br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>startword</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>current</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
+ class='S10'>;</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>while</span><span class='S0'>&nbsp;</span>
+ <span class='S10'>(</span><span class='S11'>startword</span><span class='S0'>&nbsp;</span>
+ <span class='S10'>&gt;</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span>
+ <span class='S11'>isalpha</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
+ class='S10'>[</span><span class='S11'>startword</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
+ class='S10'>]))</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
+ startword</span><span class='S10'>--;</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>linebuf</span><span class='S10'>[</span><span
+ class='S11'>current</span><span class='S0'>&nbsp;</span> <span class='S10'>-</span><span
+ class='S0'>&nbsp;</span> <span class='S4'>1</span><span class='S10'>]</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>=</span><span class='S0'>&nbsp;</span> <span
+ class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>char</span><span class='S10'>*</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>word</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S11'>linebuf</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>+</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>startword</span><span class='S10'>;</span><br />
+
+ <p>
+ Then if a calltip is available it can be displayed. The calltip appears immediately below
+ the position specified. The calltip can be multiple lines separated by newlines (\n).
+ </p>
+ &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>pos</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S11'>SendMessage</span><span
+ class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SCI_GETCURRENTPOS</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
+ class='S10'>);</span><span class='S0'><br />
+ </span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessageText</span><span
+ class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>SCI_CALLTIPSHOW</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>pos</span><span
+ class='S0'>&nbsp;</span> <span class='S10'>-</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>wordLen</span><span class='S0'>&nbsp;</span> <span class='S10'>-</span><span
+ class='S0'>&nbsp;</span> <span class='S4'>1</span><span class='S10'>,</span><span
+ class='S0'>&nbsp;</span> <span class='S11'>calltip</span><span class='S10'>);</span><br />
+
+ <p>
+ The calltip can be removed when a closing parenthesis is entered:
+ </p>
+ &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
+ class='S10'>(</span><span class='S11'>SendMessage</span><span class='S10'>(</span><span
+ class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S11'>SCI_CALLTIPACTIVE</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
+ <span class='S4'>0</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S4'>0</span><span class='S10'>))</span><span class='S0'><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
+ SendMessage</span><span class='S10'>(</span><span class='S11'>hwnd</span><span
+ class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>
+ SCI_CALLTIPCANCEL</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
+ class='S4'>0</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>
+ 0</span><span class='S10'>);</span><br />
+
+ <p>
+ Obviously, it is up the application to look after supplying the appropriate calltip text.
+ </p>
+ <p>
+ SciTE goes one step further, counting the commas between arguments and highlighting the
+ corresponding part of the calltip. This code is in ContinueCallTip.
+ </p>
+ <p>
+ <i>Page contributed by Andrew McKinlay.</i>
+ </p>
+ </body>
+</html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/Steps.html b/3rdparty/bgfx/3rdparty/scintilla/doc/Steps.html
new file mode 100644
index 00000000000..ff88e88a08b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/Steps.html
@@ -0,0 +1,142 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"><title>How to use the Scintilla Edit Control in windows?</title></head><body bgcolor="#ffffff">
+ <p><h2>How to use the Scintilla Edit Control in windows?</h2>
+ <p>
+ This should be a little step by step explanation how to use Scintilla in the windows environment.
+ </p>
+ </p>
+ <p><h2>How to create Scintilla Edit Control?</h2>
+ <p>
+ First of all, load the Scintilla DLL with something like:
+ </p>
+ <pre>
+
+ hmod = LoadLibrary(&quot;SciLexer.DLL&quot;);
+ if (hmod==NULL)
+ {
+ MessageBox(hwndParent,
+ &quot;The Scintilla DLL could not be loaded.&quot;,
+ &quot;Error loading Scintilla&quot;,
+ MB_OK | MB_ICONERROR);
+ }
+ </pre>
+ <p>
+ If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new
+ window class. The new class called &quot;Scintilla&quot; is the new scintilla edit control.
+ </p>
+ <p>
+ Now you can use this new control just like any other windows control.
+ </p>
+ <pre>
+
+ hwndScintilla = CreateWindowEx(0,
+ &quot;Scintilla&quot;,&quot;&quot;, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN,
+ 10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL);
+ </pre>
+ <p>
+ Note the new window class name: &quot;Scintilla&quot;. By reaching this point you actually included
+ a Scintilla Edit Control to your windows program.
+ </p>
+ </p>
+ <p><h2>How to control the Scintilla Edit Control?</h2>
+ <p>
+ You can control Scintilla by sending commands to the Edit Control.
+ There a 2 ways of doing this. A simple and fast way.
+ </p>
+ <p><h3>The simple way to control Scintilla</h3>
+ <p>
+ The simple way is just like with any other windows control. You can send messages to the
+ Scintilla Edit Control and receive notifications from the control. (Note that the notifications
+ are sent to the parent window of the Scintilla Edit Control.)
+ </p>
+ <p>
+ The Scintilla Edit Control knows a special message for each command.
+ To send commands to the Scintilla Edit Control you can use the SendMessage function.
+ </p>
+ <pre>
+
+ SendMessage(hwndScintilla,sci_command,wparam,lparam);
+ </pre>
+ <p>
+ like:
+ </p>
+ <pre>
+
+ SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0);
+ </pre>
+ <p>
+ Some of the commands will return a value and unused parameters should be set to NULL.
+ </p>
+ </p>
+ <p><h3>The fast way to control Scintilla</h3>
+ <p>
+ The fast way of controlling the Scintilla Edit Control is to call message handling function by yourself.
+ You can retrieve a pointer to the message handling function of the Scintilla Edit Control and
+ call it directly to execute a command. This way is much more faster than the SendMessage() way.
+ </p>
+ <p>
+ 1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to
+ retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved
+ function pointer.
+ You have to do this with the SendMessage way :)
+ </p>
+ <p>
+ The whole thing has to look like this:
+ </p>
+ <pre>
+
+ int (*fn)(void*,int,int,int);
+ void * ptr;
+ int canundo;
+
+ fn = (int (__cdecl *)(void *,int,int,int))SendMessage(
+ hwndScintilla,SCI_GETDIRECTFUNCTION,0,0);
+ ptr = (void *)SendMessage(hwndScintilla,SCI_GETDIRECTPOINTER,0,0);
+
+ canundo = fn(ptr,SCI_CANUNDO,0,0);
+ </pre>
+ <p>
+ with &quot;fn&quot; as the function pointer to the message handling function of the Scintilla Control
+ and &quot;ptr&quot; as the pointer that must be used as 1st parameter.
+ The next parameters are the Scintilla Command with its two (optional) parameters.
+ </p>
+
+ </p>
+ <p><h3>How will I receive notifications?</h3>
+ <p>
+ Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control
+ will send notification to the parent window. This is done by a WM_NOTITY message.
+ When receiving that message, you have to look in the xxx struct for the actual message.
+ </p>
+ <p>
+ So in Scintillas parent window message handling function you have to include some code like this:
+ </p>
+ <pre>
+ NMHDR *lpnmhdr;
+
+ [...]
+
+ case WM_NOTIFY:
+ lpnmhdr = (LPNMHDR) lParam;
+
+ if(lpnmhdr-&gt;hwndFrom==hwndScintilla)
+ {
+ switch(lpnmhdr-&gt;code)
+ {
+ case SCN_CHARADDED:
+ /* Hey, Scintilla just told me that a new */
+ /* character was added to the Edit Control.*/
+ /* Now i do something cool with that char. */
+ break;
+ }
+ }
+ break;
+ </pre>
+ </p>
+ </p>
+
+ <p>
+ <i>Page contributed by Holger Schmidt.</i>
+ </p>
+</body></html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/annotations.png b/3rdparty/bgfx/3rdparty/scintilla/doc/annotations.png
new file mode 100644
index 00000000000..9d9b2470358
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/annotations.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/index.html b/3rdparty/bgfx/3rdparty/scintilla/doc/index.html
new file mode 100644
index 00000000000..41cc6b8b94a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/index.html
@@ -0,0 +1,184 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta name="generator" content="HTML Tidy, see www.w3.org" />
+ <meta name="generator" content="SciTE" />
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
+ <meta name="Description"
+ content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
+ <meta name="Date.Modified" content="20150526" />
+ <style type="text/css">
+ #versionlist {
+ margin: 0;
+ padding: .5em;
+ list-style-type: none;
+ color: #FFCC99;
+ background: #000000;
+ }
+ #versionlist li {
+ margin-bottom: .5em;
+ }
+ #menu {
+ margin: 0;
+ padding: .5em 0;
+ list-style-type: none;
+ font-size: larger;
+ background: #CCCCCC;
+ }
+ #menu li {
+ margin: 0;
+ padding: 0 .5em;
+ display: inline;
+ }
+ </style>
+ <script type="text/javascript">
+ function IsRemote() {
+ var loc = '' + window.location;
+ return loc.indexOf('http:') != -1;
+ }
+ </script>
+ <title>
+ Scintilla and SciTE
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF" text="#000000">
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td width="256">
+ <img src="SciWord.jpg" height="78" width="256" alt="Scintilla" />
+ </td>
+ <td width="40%" align="left">
+ <font color="#FFCC99" size="4"> A free source code editing component for Win32,
+ GTK+, and OS X</font>
+ </td>
+ <td width="40%" align="right">
+ <font color="#FFCC99" size="3"> Release version 3.5.6<br />
+ Site last modified May 26 2015</font>
+ </td>
+ <td width="20%">
+ &nbsp;
+ </td>
+ </tr>
+ </table>
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td width="100%" style="background: url(http://www.scintilla.org/SciBreak.jpg) no-repeat;height:150px;">
+ &nbsp;
+ </td>
+ </tr>
+ </table>
+ <ul id="versionlist">
+ <li>Version 3.5.6 fixes a bug with undo on Cocoa that could lose data.</li>
+ <li>Version 3.5.5 improves IME on Qt and fixes minor bugs.</li>
+ <li>Version 3.5.4 improves indicators to be able to change appearance on mouse-over and to use a wide variety of colours together.</li>
+ <li>Version 3.5.3 removes support for Windows 95, 98, and ME.</li>
+ <li>Version 3.5.2 only supports 64-bit builds for OS X 10.7+ Cocoa. Provisional support of C++11 &lt;regex&gt;.</li>
+ <li>Version 3.5.1 fixes minor bugs and includes a lexer for BibTeX.</li>
+ <li>Version 3.5.0 can share space vertically so that extreme ascenders and descenders are not cut off.
+ Separate timers are used to minimize wake ups and thus power use.</li>
+ </ul>
+ <ul id="menu">
+ <li id="remote1"><a href="http://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
+ <li id="remote2"><a href="http://www.scintilla.org/ScintillaDownload.html">Download</a></li>
+ <li><a href="http://www.scintilla.org/ScintillaDoc.html">Documentation</a></li>
+ <li><a href="http://www.scintilla.org/ScintillaToDo.html">Bugs</a></li>
+ <li id="remote3"><a href="http://www.scintilla.org/SciTE.html">SciTE</a></li>
+ <li><a href="http://www.scintilla.org/ScintillaHistory.html">History</a></li>
+ <li><a href="http://www.scintilla.org/ScintillaRelated.html">Related</a></li>
+ </ul>
+<script type="text/javascript" language="JavaScript"><!--
+if (!IsRemote()) { //if NOT remote...
+ document.getElementById('remote1').style.display='none';
+ document.getElementById('remote2').style.display='none';
+ document.getElementById('remote3').style.display='none';
+}
+//--></script>
+ <p>
+ <a href="http://www.scintilla.org/ScintillaDoc.html">Scintilla</a> is a free source code editing component.
+ It comes with complete source code and a <a href="http://www.scintilla.org/License.txt">license</a> that
+ permits use in any free project or commercial product.
+ </p>
+ <p>
+ As well as features found in standard text editing components, Scintilla includes features
+ especially useful when editing and debugging source code.
+ These include support for syntax styling, error indicators, code completion and call tips.
+ The selection margin can contain markers like those used in debuggers to indicate
+ breakpoints and the current line. Styling choices are more open than with many editors,
+ allowing the use of proportional fonts, bold and italics, multiple foreground and background
+ colours and multiple fonts.
+ </p>
+ <p>
+ <a href="http://www.scintilla.org/SciTE.html">SciTE</a> is a SCIntilla based Text Editor. Originally built to
+ demonstrate Scintilla, it has grown to be a generally useful editor with facilities for
+ building and running programs. It is best used for jobs with simple configurations - I use it
+ for building test and demonstration programs as well as SciTE and Scintilla, themselves.
+ </p>
+ <p>
+ Development of Scintilla started as an effort to improve the text editor in PythonWin. After
+ being frustrated by problems in the Richedit control used by PythonWin, it looked like the
+ best way forward was to write a new edit control. The biggest problem with Richedit and other
+ similar controls is that they treat styling changes as important persistent changes to the
+ document so they are saved into the undo stack and set the document's dirty flag. For source
+ code, styling should not be persisted as it can be mechanically recreated.
+ </p>
+ <p>
+ Scintilla and SciTE are currently available for Intel Win32, OS X, and Linux compatible operating
+ systems with GTK+. They have been run on Windows XP, Windows 7, OS X 10.6+, and on Ubuntu 10.10
+ with GTK+ 2.20. <a href="http://www.scintilla.org/SciTEImage.html">Here is a screenshot of
+ SciTE.</a><br />
+ </p>
+ <p>
+ You can <a href="http://www.scintilla.org/ScintillaDownload.html">download Scintilla.</a>
+ </p>
+ <p>
+ The source code can be downloaded via Mercurial at the Source Forge
+ <a href="http://sourceforge.net/projects/scintilla/">Scintilla project page</a>.
+ </p>
+ <p>
+ <a href="http://www.scintilla.org/ScintillaRelated.html">Related sites.</a>
+ </p>
+ <p>
+ <a href="http://www.scintilla.org/ScintillaToDo.html">Bugs and To Do list.</a>
+ </p>
+ <p>
+ <a href="http://www.scintilla.org/ScintillaHistory.html">History and contribution credits.</a>
+ </p>
+ <p>
+ <a href="http://www.scintilla.org/Icons.html">Icons that can be used with Scintilla.</a>
+ </p>
+ <p>
+ Questions and comments about Scintilla should be directed to the
+ <a href="http://groups.google.com/group/scintilla-interest">scintilla-interest</a>
+ mailing list,
+ which is for discussion of Scintilla and related projects, their bugs and future features.
+ This is a low traffic list, averaging less than 20 messages per week.
+ To avoid spam, only list members can write to the list.
+ New versions of Scintilla are announced on scintilla-interest and may also be received by SourceForge
+ members by clicking on the Monitor column icon for "scintilla" on
+ <a href="https://sourceforge.net/project/showfiles.php?group_id=2439">the downloads page</a>.
+ Messages sent to my personal email address that could have been sent to the list
+ may receive no response.
+ <br />
+ </p>
+There is a <a href="http://sourceforge.net/projects/scintilla/">Scintilla project page</a>
+hosted on
+<script type="text/javascript" language="JavaScript">
+<!--
+if (IsRemote()) {
+ document.write('<a href="http://sourceforge.net/projects/scintilla/">');
+ document.write('<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=2439&amp;type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> ');
+} else {
+ document.write('<a href="http://sourceforge.net/projects/scintilla/">SourceForge<\/a>');
+}
+//-->
+</script>
+<noscript>
+<a href="http://sourceforge.net/projects/scintilla">
+<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=2439&amp;type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
+</noscript>
+ </body>
+</html>
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/doc/styledmargin.png b/3rdparty/bgfx/3rdparty/scintilla/doc/styledmargin.png
new file mode 100644
index 00000000000..3aaf35b0ad4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/doc/styledmargin.png
Binary files differ
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/Converter.h b/3rdparty/bgfx/3rdparty/scintilla/gtk/Converter.h
new file mode 100644
index 00000000000..be530341f3b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/Converter.h
@@ -0,0 +1,83 @@
+// Scintilla source code edit control
+// Converter.h - Encapsulation of iconv
+// Copyright 2004 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CONVERTER_H
+#define CONVERTER_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+typedef GIConv ConverterHandle;
+const ConverterHandle iconvhBad = (ConverterHandle)(-1);
+// Since various versions of iconv can not agree on whether the src argument
+// is char ** or const char ** provide a templatised adaptor.
+template<typename T>
+size_t iconv_adaptor(size_t(*f_iconv)(ConverterHandle, T, size_t *, char **, size_t *),
+ ConverterHandle cd, char** src, size_t *srcleft,
+ char **dst, size_t *dstleft) {
+ return f_iconv(cd, (T)src, srcleft, dst, dstleft);
+}
+/**
+ * Encapsulate iconv safely and avoid iconv_adaptor complexity in client code.
+ */
+class Converter {
+ ConverterHandle iconvh;
+ void OpenHandle(const char *fullDestination, const char *charSetSource) {
+ iconvh = g_iconv_open(fullDestination, charSetSource);
+ }
+ bool Succeeded() const {
+ return iconvh != iconvhBad;
+ }
+public:
+ Converter() {
+ iconvh = iconvhBad;
+ }
+ Converter(const char *charSetDestination, const char *charSetSource, bool transliterations) {
+ iconvh = iconvhBad;
+ Open(charSetDestination, charSetSource, transliterations);
+ }
+ ~Converter() {
+ Close();
+ }
+ operator bool() const {
+ return Succeeded();
+ }
+ void Open(const char *charSetDestination, const char *charSetSource, bool transliterations=true) {
+ Close();
+ if (*charSetSource) {
+ // Try allowing approximate transliterations
+ if (transliterations) {
+ char fullDest[200];
+ g_strlcpy(fullDest, charSetDestination, sizeof(fullDest));
+ g_strlcat(fullDest, "//TRANSLIT", sizeof(fullDest));
+ OpenHandle(fullDest, charSetSource);
+ }
+ if (!Succeeded()) {
+ // Transliterations failed so try basic name
+ OpenHandle(charSetDestination, charSetSource);
+ }
+ }
+ }
+ void Close() {
+ if (Succeeded()) {
+ g_iconv_close(iconvh);
+ iconvh = iconvhBad;
+ }
+ }
+ size_t Convert(char** src, size_t *srcleft, char **dst, size_t *dstleft) const {
+ if (!Succeeded()) {
+ return (size_t)(-1);
+ } else {
+ return iconv_adaptor(g_iconv, iconvh, src, srcleft, dst, dstleft);
+ }
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/PlatGTK.cxx b/3rdparty/bgfx/3rdparty/scintilla/gtk/PlatGTK.cxx
new file mode 100644
index 00000000000..27c68b93bb4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/PlatGTK.cxx
@@ -0,0 +1,2280 @@
+// Scintilla source code edit control
+// PlatGTK.cxx - implementation of platform facilities on GTK+/Linux
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <math.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include <glib.h>
+#include <gmodule.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "ScintillaWidget.h"
+#include "StringCopy.h"
+#include "XPM.h"
+#include "UniConversion.h"
+
+#if defined(__clang__)
+// Clang 3.0 incorrectly displays sentinel warnings. Fixed by clang 3.1.
+#pragma GCC diagnostic ignored "-Wsentinel"
+#endif
+
+/* GLIB must be compiled with thread support, otherwise we
+ will bail on trying to use locks, and that could lead to
+ problems for someone. `glib-config --libs gthread` needs
+ to be used to get the glib libraries for linking, otherwise
+ g_thread_init will fail */
+#define USE_LOCK defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
+
+#include "Converter.h"
+
+#if GTK_CHECK_VERSION(2,20,0)
+#define IS_WIDGET_FOCUSSED(w) (gtk_widget_has_focus(GTK_WIDGET(w)))
+#else
+#define IS_WIDGET_FOCUSSED(w) (GTK_WIDGET_HAS_FOCUS(w))
+#endif
+
+static const double kPi = 3.14159265358979323846;
+
+// The Pango version guard for pango_units_from_double and pango_units_to_double
+// is more complex than simply implementing these here.
+
+static int pangoUnitsFromDouble(double d) {
+ return static_cast<int>(d * PANGO_SCALE + 0.5);
+}
+
+static double doubleFromPangoUnits(int pu) {
+ return static_cast<double>(pu) / PANGO_SCALE;
+}
+
+static cairo_surface_t *CreateSimilarSurface(GdkWindow *window, cairo_content_t content, int width, int height) {
+#if GTK_CHECK_VERSION(2,22,0)
+ return gdk_window_create_similar_surface(window, content, width, height);
+#else
+ cairo_surface_t *window_surface, *surface;
+
+ g_return_val_if_fail(GDK_IS_WINDOW(window), NULL);
+
+ window_surface = GDK_DRAWABLE_GET_CLASS(window)->ref_cairo_surface(window);
+
+ surface = cairo_surface_create_similar(window_surface, content, width, height);
+
+ cairo_surface_destroy(window_surface);
+
+ return surface;
+#endif
+}
+
+static GdkWindow *WindowFromWidget(GtkWidget *w) {
+#if GTK_CHECK_VERSION(3,0,0)
+ return gtk_widget_get_window(w);
+#else
+ return w->window;
+#endif
+}
+
+#ifdef _MSC_VER
+// Ignore unreferenced local functions in GTK+ headers
+#pragma warning(disable: 4505)
+#endif
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+enum encodingType { singleByte, UTF8, dbcs};
+
+struct LOGFONT {
+ int size;
+ int weight;
+ bool italic;
+ int characterSet;
+ char faceName[300];
+};
+
+#if USE_LOCK
+static GMutex *fontMutex = NULL;
+
+static void InitializeGLIBThreads() {
+#if !GLIB_CHECK_VERSION(2,31,0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+}
+#endif
+
+static void FontMutexAllocate() {
+#if USE_LOCK
+ if (!fontMutex) {
+ InitializeGLIBThreads();
+#if GLIB_CHECK_VERSION(2,31,0)
+ fontMutex = g_new(GMutex, 1);
+ g_mutex_init(fontMutex);
+#else
+ fontMutex = g_mutex_new();
+#endif
+ }
+#endif
+}
+
+static void FontMutexFree() {
+#if USE_LOCK
+ if (fontMutex) {
+#if GLIB_CHECK_VERSION(2,31,0)
+ g_mutex_clear(fontMutex);
+ g_free(fontMutex);
+#else
+ g_mutex_free(fontMutex);
+#endif
+ fontMutex = NULL;
+ }
+#endif
+}
+
+static void FontMutexLock() {
+#if USE_LOCK
+ g_mutex_lock(fontMutex);
+#endif
+}
+
+static void FontMutexUnlock() {
+#if USE_LOCK
+ if (fontMutex) {
+ g_mutex_unlock(fontMutex);
+ }
+#endif
+}
+
+// Holds a PangoFontDescription*.
+class FontHandle {
+ XYPOSITION width[128];
+ encodingType et;
+public:
+ int ascent;
+ PangoFontDescription *pfd;
+ int characterSet;
+ FontHandle() : et(singleByte), ascent(0), pfd(0), characterSet(-1) {
+ ResetWidths(et);
+ }
+ FontHandle(PangoFontDescription *pfd_, int characterSet_) {
+ et = singleByte;
+ ascent = 0;
+ pfd = pfd_;
+ characterSet = characterSet_;
+ ResetWidths(et);
+ }
+ ~FontHandle() {
+ if (pfd)
+ pango_font_description_free(pfd);
+ pfd = 0;
+ }
+ void ResetWidths(encodingType et_) {
+ et = et_;
+ for (int i=0; i<=127; i++) {
+ width[i] = 0;
+ }
+ }
+ XYPOSITION CharWidth(unsigned char ch, encodingType et_) const {
+ XYPOSITION w = 0;
+ FontMutexLock();
+ if ((ch <= 127) && (et == et_)) {
+ w = width[ch];
+ }
+ FontMutexUnlock();
+ return w;
+ }
+ void SetCharWidth(unsigned char ch, XYPOSITION w, encodingType et_) {
+ if (ch <= 127) {
+ FontMutexLock();
+ if (et != et_) {
+ ResetWidths(et_);
+ }
+ width[ch] = w;
+ FontMutexUnlock();
+ }
+ }
+};
+
+// X has a 16 bit coordinate space, so stop drawing here to avoid wrapping
+static const int maxCoordinate = 32000;
+
+static FontHandle *PFont(Font &f) {
+ return reinterpret_cast<FontHandle *>(f.GetID());
+}
+
+static GtkWidget *PWidget(WindowID wid) {
+ return reinterpret_cast<GtkWidget *>(wid);
+}
+
+Point Point::FromLong(long lpoint) {
+ return Point(
+ Platform::LowShortFromLong(lpoint),
+ Platform::HighShortFromLong(lpoint));
+}
+
+static void SetLogFont(LOGFONT &lf, const char *faceName, int characterSet, float size, int weight, bool italic) {
+ lf = LOGFONT();
+ lf.size = size;
+ lf.weight = weight;
+ lf.italic = italic;
+ lf.characterSet = characterSet;
+ StringCopy(lf.faceName, faceName);
+}
+
+/**
+ * Create a hash from the parameters for a font to allow easy checking for identity.
+ * If one font is the same as another, its hash will be the same, but if the hash is the
+ * same then they may still be different.
+ */
+static int HashFont(const FontParameters &fp) {
+ return
+ static_cast<int>(fp.size+0.5) ^
+ (fp.characterSet << 10) ^
+ ((fp.weight / 100) << 12) ^
+ (fp.italic ? 0x20000000 : 0) ^
+ fp.faceName[0];
+}
+
+class FontCached : Font {
+ FontCached *next;
+ int usage;
+ LOGFONT lf;
+ int hash;
+ explicit FontCached(const FontParameters &fp);
+ ~FontCached() {}
+ bool SameAs(const FontParameters &fp);
+ virtual void Release();
+ static FontID CreateNewFont(const FontParameters &fp);
+ static FontCached *first;
+public:
+ static FontID FindOrCreate(const FontParameters &fp);
+ static void ReleaseId(FontID fid_);
+ static void ReleaseAll();
+};
+
+FontCached *FontCached::first = 0;
+
+FontCached::FontCached(const FontParameters &fp) :
+next(0), usage(0), hash(0) {
+ ::SetLogFont(lf, fp.faceName, fp.characterSet, fp.size, fp.weight, fp.italic);
+ hash = HashFont(fp);
+ fid = CreateNewFont(fp);
+ usage = 1;
+}
+
+bool FontCached::SameAs(const FontParameters &fp) {
+ return
+ lf.size == fp.size &&
+ lf.weight == fp.weight &&
+ lf.italic == fp.italic &&
+ lf.characterSet == fp.characterSet &&
+ 0 == strcmp(lf.faceName, fp.faceName);
+}
+
+void FontCached::Release() {
+ if (fid)
+ delete PFont(*this);
+ fid = 0;
+}
+
+FontID FontCached::FindOrCreate(const FontParameters &fp) {
+ FontID ret = 0;
+ FontMutexLock();
+ int hashFind = HashFont(fp);
+ for (FontCached *cur = first; cur; cur = cur->next) {
+ if ((cur->hash == hashFind) &&
+ cur->SameAs(fp)) {
+ cur->usage++;
+ ret = cur->fid;
+ }
+ }
+ if (ret == 0) {
+ FontCached *fc = new FontCached(fp);
+ fc->next = first;
+ first = fc;
+ ret = fc->fid;
+ }
+ FontMutexUnlock();
+ return ret;
+}
+
+void FontCached::ReleaseId(FontID fid_) {
+ FontMutexLock();
+ FontCached **pcur = &first;
+ for (FontCached *cur = first; cur; cur = cur->next) {
+ if (cur->fid == fid_) {
+ cur->usage--;
+ if (cur->usage == 0) {
+ *pcur = cur->next;
+ cur->Release();
+ cur->next = 0;
+ delete cur;
+ }
+ break;
+ }
+ pcur = &cur->next;
+ }
+ FontMutexUnlock();
+}
+
+void FontCached::ReleaseAll() {
+ while (first) {
+ ReleaseId(first->GetID());
+ }
+}
+
+FontID FontCached::CreateNewFont(const FontParameters &fp) {
+ PangoFontDescription *pfd = pango_font_description_new();
+ if (pfd) {
+ pango_font_description_set_family(pfd,
+ (fp.faceName[0] == '!') ? fp.faceName+1 : fp.faceName);
+ pango_font_description_set_size(pfd, pangoUnitsFromDouble(fp.size));
+ pango_font_description_set_weight(pfd, static_cast<PangoWeight>(fp.weight));
+ pango_font_description_set_style(pfd, fp.italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
+ return new FontHandle(pfd, fp.characterSet);
+ }
+
+ return new FontHandle();
+}
+
+Font::Font() : fid(0) {}
+
+Font::~Font() {}
+
+void Font::Create(const FontParameters &fp) {
+ Release();
+ fid = FontCached::FindOrCreate(fp);
+}
+
+void Font::Release() {
+ if (fid)
+ FontCached::ReleaseId(fid);
+ fid = 0;
+}
+
+// Required on OS X
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// SurfaceID is a cairo_t*
+class SurfaceImpl : public Surface {
+ encodingType et;
+ cairo_t *context;
+ cairo_surface_t *psurf;
+ int x;
+ int y;
+ bool inited;
+ bool createdGC;
+ PangoContext *pcontext;
+ PangoLayout *layout;
+ Converter conv;
+ int characterSet;
+ void SetConverter(int characterSet_);
+public:
+ SurfaceImpl();
+ virtual ~SurfaceImpl();
+
+ void Init(WindowID wid);
+ void Init(SurfaceID sid, WindowID wid);
+ void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
+
+ void Release();
+ bool Initialised();
+ void PenColour(ColourDesired fore);
+ int LogPixelsY();
+ int DeviceHeightFont(int points);
+ void MoveTo(int x_, int y_);
+ void LineTo(int x_, int y_);
+ void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back);
+ void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void FillRectangle(PRectangle rc, ColourDesired back);
+ void FillRectangle(PRectangle rc, Surface &surfacePattern);
+ void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags);
+ void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage);
+ void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void Copy(PRectangle rc, Point from, Surface &surfaceSource);
+
+ void DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
+ void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
+ void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
+ XYPOSITION WidthText(Font &font_, const char *s, int len);
+ XYPOSITION WidthChar(Font &font_, char ch);
+ XYPOSITION Ascent(Font &font_);
+ XYPOSITION Descent(Font &font_);
+ XYPOSITION InternalLeading(Font &font_);
+ XYPOSITION ExternalLeading(Font &font_);
+ XYPOSITION Height(Font &font_);
+ XYPOSITION AverageCharWidth(Font &font_);
+
+ void SetClip(PRectangle rc);
+ void FlushCachedState();
+
+ void SetUnicodeMode(bool unicodeMode_);
+ void SetDBCSMode(int codePage);
+};
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+const char *CharacterSetID(int characterSet) {
+ switch (characterSet) {
+ case SC_CHARSET_ANSI:
+ return "";
+ case SC_CHARSET_DEFAULT:
+ return "ISO-8859-1";
+ case SC_CHARSET_BALTIC:
+ return "ISO-8859-13";
+ case SC_CHARSET_CHINESEBIG5:
+ return "BIG-5";
+ case SC_CHARSET_EASTEUROPE:
+ return "ISO-8859-2";
+ case SC_CHARSET_GB2312:
+ return "CP936";
+ case SC_CHARSET_GREEK:
+ return "ISO-8859-7";
+ case SC_CHARSET_HANGUL:
+ return "CP949";
+ case SC_CHARSET_MAC:
+ return "MACINTOSH";
+ case SC_CHARSET_OEM:
+ return "ASCII";
+ case SC_CHARSET_RUSSIAN:
+ return "KOI8-R";
+ case SC_CHARSET_CYRILLIC:
+ return "CP1251";
+ case SC_CHARSET_SHIFTJIS:
+ return "SHIFT-JIS";
+ case SC_CHARSET_SYMBOL:
+ return "";
+ case SC_CHARSET_TURKISH:
+ return "ISO-8859-9";
+ case SC_CHARSET_JOHAB:
+ return "CP1361";
+ case SC_CHARSET_HEBREW:
+ return "ISO-8859-8";
+ case SC_CHARSET_ARABIC:
+ return "ISO-8859-6";
+ case SC_CHARSET_VIETNAMESE:
+ return "";
+ case SC_CHARSET_THAI:
+ return "ISO-8859-11";
+ case SC_CHARSET_8859_15:
+ return "ISO-8859-15";
+ default:
+ return "";
+ }
+}
+
+void SurfaceImpl::SetConverter(int characterSet_) {
+ if (characterSet != characterSet_) {
+ characterSet = characterSet_;
+ conv.Open("UTF-8", CharacterSetID(characterSet), false);
+ }
+}
+
+SurfaceImpl::SurfaceImpl() : et(singleByte),
+context(0),
+psurf(0),
+x(0), y(0), inited(false), createdGC(false)
+, pcontext(0), layout(0), characterSet(-1) {
+}
+
+SurfaceImpl::~SurfaceImpl() {
+ Release();
+}
+
+void SurfaceImpl::Release() {
+ et = singleByte;
+ if (createdGC) {
+ createdGC = false;
+ cairo_destroy(context);
+ }
+ context = 0;
+ if (psurf)
+ cairo_surface_destroy(psurf);
+ psurf = 0;
+ if (layout)
+ g_object_unref(layout);
+ layout = 0;
+ if (pcontext)
+ g_object_unref(pcontext);
+ pcontext = 0;
+ conv.Close();
+ characterSet = -1;
+ x = 0;
+ y = 0;
+ inited = false;
+ createdGC = false;
+}
+
+bool SurfaceImpl::Initialised() {
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0)
+ if (inited && context) {
+ if (cairo_status(context) == CAIRO_STATUS_SUCCESS) {
+ // Even when status is success, the target surface may have been
+ // finished whch may cause an assertion to fail crashing the application.
+ // The cairo_surface_has_show_text_glyphs call checks the finished flag
+ // and when set, sets the status to CAIRO_STATUS_SURFACE_FINISHED
+ // which leads to warning messages instead of crashes.
+ // Performing the check in this method as it is called rarely and has no
+ // other side effects.
+ cairo_surface_t *psurfContext = cairo_get_target(context);
+ if (psurfContext) {
+ cairo_surface_has_show_text_glyphs(psurfContext);
+ }
+ }
+ return cairo_status(context) == CAIRO_STATUS_SUCCESS;
+ }
+#endif
+ return inited;
+}
+
+void SurfaceImpl::Init(WindowID wid) {
+ Release();
+ PLATFORM_ASSERT(wid);
+ // if we are only created from a window ID, we can't perform drawing
+ psurf = 0;
+ context = 0;
+ createdGC = false;
+ pcontext = gtk_widget_create_pango_context(PWidget(wid));
+ PLATFORM_ASSERT(pcontext);
+ layout = pango_layout_new(pcontext);
+ PLATFORM_ASSERT(layout);
+ inited = true;
+}
+
+void SurfaceImpl::Init(SurfaceID sid, WindowID wid) {
+ PLATFORM_ASSERT(sid);
+ Release();
+ PLATFORM_ASSERT(wid);
+ context = cairo_reference(reinterpret_cast<cairo_t *>(sid));
+ pcontext = gtk_widget_create_pango_context(PWidget(wid));
+ // update the Pango context in case sid isn't the widget's surface
+ pango_cairo_update_context(context, pcontext);
+ layout = pango_layout_new(pcontext);
+ cairo_set_line_width(context, 1);
+ createdGC = true;
+ inited = true;
+}
+
+void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID wid) {
+ PLATFORM_ASSERT(surface_);
+ Release();
+ SurfaceImpl *surfImpl = static_cast<SurfaceImpl *>(surface_);
+ PLATFORM_ASSERT(wid);
+ context = cairo_reference(surfImpl->context);
+ pcontext = gtk_widget_create_pango_context(PWidget(wid));
+ // update the Pango context in case surface_ isn't the widget's surface
+ pango_cairo_update_context(context, pcontext);
+ PLATFORM_ASSERT(pcontext);
+ layout = pango_layout_new(pcontext);
+ PLATFORM_ASSERT(layout);
+ if (height > 0 && width > 0)
+ psurf = CreateSimilarSurface(
+ WindowFromWidget(PWidget(wid)),
+ CAIRO_CONTENT_COLOR_ALPHA, width, height);
+ cairo_destroy(context);
+ context = cairo_create(psurf);
+ cairo_rectangle(context, 0, 0, width, height);
+ cairo_set_source_rgb(context, 1.0, 0, 0);
+ cairo_fill(context);
+ // This produces sharp drawing more similar to GDK:
+ //cairo_set_antialias(context, CAIRO_ANTIALIAS_NONE);
+ cairo_set_line_width(context, 1);
+ createdGC = true;
+ inited = true;
+ et = surfImpl->et;
+}
+
+void SurfaceImpl::PenColour(ColourDesired fore) {
+ if (context) {
+ ColourDesired cdFore(fore.AsLong());
+ cairo_set_source_rgb(context,
+ cdFore.GetRed() / 255.0,
+ cdFore.GetGreen() / 255.0,
+ cdFore.GetBlue() / 255.0);
+ }
+}
+
+int SurfaceImpl::LogPixelsY() {
+ return 72;
+}
+
+int SurfaceImpl::DeviceHeightFont(int points) {
+ int logPix = LogPixelsY();
+ return (points * logPix + logPix / 2) / 72;
+}
+
+void SurfaceImpl::MoveTo(int x_, int y_) {
+ x = x_;
+ y = y_;
+}
+
+static int Delta(int difference) {
+ if (difference < 0)
+ return -1;
+ else if (difference > 0)
+ return 1;
+ else
+ return 0;
+}
+
+void SurfaceImpl::LineTo(int x_, int y_) {
+ // cairo_line_to draws the end position, unlike Win32 or GDK with GDK_CAP_NOT_LAST.
+ // For simple cases, move back one pixel from end.
+ if (context) {
+ int xDiff = x_ - x;
+ int xDelta = Delta(xDiff);
+ int yDiff = y_ - y;
+ int yDelta = Delta(yDiff);
+ if ((xDiff == 0) || (yDiff == 0)) {
+ // Horizontal or vertical lines can be more precisely drawn as a filled rectangle
+ int xEnd = x_ - xDelta;
+ int left = Platform::Minimum(x, xEnd);
+ int width = abs(x - xEnd) + 1;
+ int yEnd = y_ - yDelta;
+ int top = Platform::Minimum(y, yEnd);
+ int height = abs(y - yEnd) + 1;
+ cairo_rectangle(context, left, top, width, height);
+ cairo_fill(context);
+ } else if ((abs(xDiff) == abs(yDiff))) {
+ // 45 degree slope
+ cairo_move_to(context, x + 0.5, y + 0.5);
+ cairo_line_to(context, x_ + 0.5 - xDelta, y_ + 0.5 - yDelta);
+ } else {
+ // Line has a different slope so difficult to avoid last pixel
+ cairo_move_to(context, x + 0.5, y + 0.5);
+ cairo_line_to(context, x_ + 0.5, y_ + 0.5);
+ }
+ cairo_stroke(context);
+ }
+ x = x_;
+ y = y_;
+}
+
+void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore,
+ ColourDesired back) {
+ PLATFORM_ASSERT(context);
+ PenColour(back);
+ cairo_move_to(context, pts[0].x + 0.5, pts[0].y + 0.5);
+ for (int i = 1; i < npts; i++) {
+ cairo_line_to(context, pts[i].x + 0.5, pts[i].y + 0.5);
+ }
+ cairo_close_path(context);
+ cairo_fill_preserve(context);
+ PenColour(fore);
+ cairo_stroke(context);
+}
+
+void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ if (context) {
+ cairo_rectangle(context, rc.left + 0.5, rc.top + 0.5,
+ rc.right - rc.left - 1, rc.bottom - rc.top - 1);
+ PenColour(back);
+ cairo_fill_preserve(context);
+ PenColour(fore);
+ cairo_stroke(context);
+ }
+}
+
+void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) {
+ PenColour(back);
+ if (context && (rc.left < maxCoordinate)) { // Protect against out of range
+ rc.left = lround(rc.left);
+ rc.right = lround(rc.right);
+ cairo_rectangle(context, rc.left, rc.top,
+ rc.right - rc.left, rc.bottom - rc.top);
+ cairo_fill(context);
+ }
+}
+
+void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
+ SurfaceImpl &surfi = static_cast<SurfaceImpl &>(surfacePattern);
+ bool canDraw = surfi.psurf != NULL;
+ if (canDraw) {
+ PLATFORM_ASSERT(context);
+ // Tile pattern over rectangle
+ // Currently assumes 8x8 pattern
+ int widthPat = 8;
+ int heightPat = 8;
+ for (int xTile = rc.left; xTile < rc.right; xTile += widthPat) {
+ int widthx = (xTile + widthPat > rc.right) ? rc.right - xTile : widthPat;
+ for (int yTile = rc.top; yTile < rc.bottom; yTile += heightPat) {
+ int heighty = (yTile + heightPat > rc.bottom) ? rc.bottom - yTile : heightPat;
+ cairo_set_source_surface(context, surfi.psurf, xTile, yTile);
+ cairo_rectangle(context, xTile, yTile, widthx, heighty);
+ cairo_fill(context);
+ }
+ }
+ } else {
+ // Something is wrong so try to show anyway
+ // Shows up black because colour not allocated
+ FillRectangle(rc, ColourDesired(0));
+ }
+}
+
+void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ if (((rc.right - rc.left) > 4) && ((rc.bottom - rc.top) > 4)) {
+ // Approximate a round rect with some cut off corners
+ Point pts[] = {
+ Point(rc.left + 2, rc.top),
+ Point(rc.right - 2, rc.top),
+ Point(rc.right, rc.top + 2),
+ Point(rc.right, rc.bottom - 2),
+ Point(rc.right - 2, rc.bottom),
+ Point(rc.left + 2, rc.bottom),
+ Point(rc.left, rc.bottom - 2),
+ Point(rc.left, rc.top + 2),
+ };
+ Polygon(pts, ELEMENTS(pts), fore, back);
+ } else {
+ RectangleDraw(rc, fore, back);
+ }
+}
+
+static void PathRoundRectangle(cairo_t *context, double left, double top, double width, double height, int radius) {
+ double degrees = kPi / 180.0;
+
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
+ cairo_new_sub_path(context);
+#else
+ // First arc is in the top-right corner and starts from a point on the top line
+ cairo_move_to(context, left + width - radius, top);
+#endif
+ cairo_arc(context, left + width - radius, top + radius, radius, -90 * degrees, 0 * degrees);
+ cairo_arc(context, left + width - radius, top + height - radius, radius, 0 * degrees, 90 * degrees);
+ cairo_arc(context, left + radius, top + height - radius, radius, 90 * degrees, 180 * degrees);
+ cairo_arc(context, left + radius, top + radius, radius, 180 * degrees, 270 * degrees);
+ cairo_close_path(context);
+}
+
+void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags) {
+ if (context && rc.Width() > 0) {
+ ColourDesired cdFill(fill.AsLong());
+ cairo_set_source_rgba(context,
+ cdFill.GetRed() / 255.0,
+ cdFill.GetGreen() / 255.0,
+ cdFill.GetBlue() / 255.0,
+ alphaFill / 255.0);
+ if (cornerSize > 0)
+ PathRoundRectangle(context, rc.left + 1.0, rc.top + 1.0, rc.right - rc.left - 2.0, rc.bottom - rc.top - 2.0, cornerSize);
+ else
+ cairo_rectangle(context, rc.left + 1.0, rc.top + 1.0, rc.right - rc.left - 2.0, rc.bottom - rc.top - 2.0);
+ cairo_fill(context);
+
+ ColourDesired cdOutline(outline.AsLong());
+ cairo_set_source_rgba(context,
+ cdOutline.GetRed() / 255.0,
+ cdOutline.GetGreen() / 255.0,
+ cdOutline.GetBlue() / 255.0,
+ alphaOutline / 255.0);
+ if (cornerSize > 0)
+ PathRoundRectangle(context, rc.left + 0.5, rc.top + 0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1, cornerSize);
+ else
+ cairo_rectangle(context, rc.left + 0.5, rc.top + 0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1);
+ cairo_stroke(context);
+ }
+}
+
+void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) {
+ PLATFORM_ASSERT(context);
+ if (rc.Width() > width)
+ rc.left += (rc.Width() - width) / 2;
+ rc.right = rc.left + width;
+ if (rc.Height() > height)
+ rc.top += (rc.Height() - height) / 2;
+ rc.bottom = rc.top + height;
+
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0)
+ int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
+#else
+ int stride = width * 4;
+#endif
+ int ucs = stride * height;
+ std::vector<unsigned char> image(ucs);
+ for (int iy=0; iy<height; iy++) {
+ for (int ix=0; ix<width; ix++) {
+ unsigned char *pixel = &image[0] + iy*stride + ix * 4;
+ unsigned char alpha = pixelsImage[3];
+ pixel[2] = (*pixelsImage++) * alpha / 255;
+ pixel[1] = (*pixelsImage++) * alpha / 255;
+ pixel[0] = (*pixelsImage++) * alpha / 255;
+ pixel[3] = *pixelsImage++;
+ }
+ }
+
+ cairo_surface_t *psurfImage = cairo_image_surface_create_for_data(&image[0], CAIRO_FORMAT_ARGB32, width, height, stride);
+ cairo_set_source_surface(context, psurfImage, rc.left, rc.top);
+ cairo_rectangle(context, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
+ cairo_fill(context);
+
+ cairo_surface_destroy(psurfImage);
+}
+
+void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ PLATFORM_ASSERT(context);
+ PenColour(back);
+ cairo_arc(context, (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2,
+ Platform::Minimum(rc.Width(), rc.Height()) / 2, 0, 2*kPi);
+ cairo_fill_preserve(context);
+ PenColour(fore);
+ cairo_stroke(context);
+}
+
+void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
+ SurfaceImpl &surfi = static_cast<SurfaceImpl &>(surfaceSource);
+ bool canDraw = surfi.psurf != NULL;
+ if (canDraw) {
+ PLATFORM_ASSERT(context);
+ cairo_set_source_surface(context, surfi.psurf,
+ rc.left - from.x, rc.top - from.y);
+ cairo_rectangle(context, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
+ cairo_fill(context);
+ }
+}
+
+std::string UTF8FromLatin1(const char *s, int len) {
+ std::string utfForm(len*2 + 1, '\0');
+ size_t lenU = 0;
+ for (int i=0; i<len; i++) {
+ unsigned int uch = static_cast<unsigned char>(s[i]);
+ if (uch < 0x80) {
+ utfForm[lenU++] = uch;
+ } else {
+ utfForm[lenU++] = static_cast<char>(0xC0 | (uch >> 6));
+ utfForm[lenU++] = static_cast<char>(0x80 | (uch & 0x3f));
+ }
+ }
+ utfForm.resize(lenU);
+ return utfForm;
+}
+
+static std::string UTF8FromIconv(const Converter &conv, const char *s, int len) {
+ if (conv) {
+ std::string utfForm(len*3+1, '\0');
+ char *pin = const_cast<char *>(s);
+ size_t inLeft = len;
+ char *putf = &utfForm[0];
+ char *pout = putf;
+ size_t outLeft = len*3+1;
+ size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft);
+ if (conversions != ((size_t)(-1))) {
+ *pout = '\0';
+ utfForm.resize(pout - putf);
+ return utfForm;
+ }
+ }
+ return std::string();
+}
+
+// Work out how many bytes are in a character by trying to convert using iconv,
+// returning the first length that succeeds.
+static size_t MultiByteLenFromIconv(const Converter &conv, const char *s, size_t len) {
+ for (size_t lenMB=1; (lenMB<4) && (lenMB <= len); lenMB++) {
+ char wcForm[2];
+ char *pin = const_cast<char *>(s);
+ size_t inLeft = lenMB;
+ char *pout = wcForm;
+ size_t outLeft = 2;
+ size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft);
+ if (conversions != ((size_t)(-1))) {
+ return lenMB;
+ }
+ }
+ return 1;
+}
+
+void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore) {
+ PenColour(fore);
+ if (context) {
+ XYPOSITION xText = rc.left;
+ if (PFont(font_)->pfd) {
+ std::string utfForm;
+ if (et == UTF8) {
+ pango_layout_set_text(layout, s, len);
+ } else {
+ SetConverter(PFont(font_)->characterSet);
+ utfForm = UTF8FromIconv(conv, s, len);
+ if (utfForm.empty()) { // iconv failed so treat as Latin1
+ utfForm = UTF8FromLatin1(s, len);
+ }
+ pango_layout_set_text(layout, utfForm.c_str(), utfForm.length());
+ }
+ pango_layout_set_font_description(layout, PFont(font_)->pfd);
+ pango_cairo_update_layout(context, layout);
+#ifdef PANGO_VERSION
+ PangoLayoutLine *pll = pango_layout_get_line_readonly(layout,0);
+#else
+ PangoLayoutLine *pll = pango_layout_get_line(layout,0);
+#endif
+ cairo_move_to(context, xText, ybase);
+ pango_cairo_show_layout_line(context, pll);
+ }
+ }
+}
+
+void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ FillRectangle(rc, back);
+ DrawTextBase(rc, font_, ybase, s, len, fore);
+}
+
+// On GTK+, exactly same as DrawTextNoClip
+void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ FillRectangle(rc, back);
+ DrawTextBase(rc, font_, ybase, s, len, fore);
+}
+
+void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore) {
+ // Avoid drawing spaces in transparent mode
+ for (int i=0; i<len; i++) {
+ if (s[i] != ' ') {
+ DrawTextBase(rc, font_, ybase, s, len, fore);
+ return;
+ }
+ }
+}
+
+class ClusterIterator {
+ PangoLayoutIter *iter;
+ PangoRectangle pos;
+ int lenPositions;
+public:
+ bool finished;
+ XYPOSITION positionStart;
+ XYPOSITION position;
+ XYPOSITION distance;
+ int curIndex;
+ ClusterIterator(PangoLayout *layout, int len) : lenPositions(len), finished(false),
+ positionStart(0), position(0), distance(0), curIndex(0) {
+ iter = pango_layout_get_iter(layout);
+ pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
+ }
+ ~ClusterIterator() {
+ pango_layout_iter_free(iter);
+ }
+
+ void Next() {
+ positionStart = position;
+ if (pango_layout_iter_next_cluster(iter)) {
+ pango_layout_iter_get_cluster_extents(iter, NULL, &pos);
+ position = doubleFromPangoUnits(pos.x);
+ curIndex = pango_layout_iter_get_index(iter);
+ } else {
+ finished = true;
+ position = doubleFromPangoUnits(pos.x + pos.width);
+ curIndex = lenPositions;
+ }
+ distance = position - positionStart;
+ }
+};
+
+void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) {
+ if (font_.GetID()) {
+ const int lenPositions = len;
+ if (PFont(font_)->pfd) {
+ if (len == 1) {
+ int width = PFont(font_)->CharWidth(*s, et);
+ if (width) {
+ positions[0] = width;
+ return;
+ }
+ }
+ pango_layout_set_font_description(layout, PFont(font_)->pfd);
+ if (et == UTF8) {
+ // Simple and direct as UTF-8 is native Pango encoding
+ int i = 0;
+ pango_layout_set_text(layout, s, len);
+ ClusterIterator iti(layout, lenPositions);
+ while (!iti.finished) {
+ iti.Next();
+ int places = iti.curIndex - i;
+ while (i < iti.curIndex) {
+ // Evenly distribute space among bytes of this cluster.
+ // Would be better to find number of characters and then
+ // divide evenly between characters with each byte of a character
+ // being at the same position.
+ positions[i] = iti.position - (iti.curIndex - 1 - i) * iti.distance / places;
+ i++;
+ }
+ }
+ PLATFORM_ASSERT(i == lenPositions);
+ } else {
+ int positionsCalculated = 0;
+ if (et == dbcs) {
+ SetConverter(PFont(font_)->characterSet);
+ std::string utfForm = UTF8FromIconv(conv, s, len);
+ if (!utfForm.empty()) {
+ // Convert to UTF-8 so can ask Pango for widths, then
+ // Loop through UTF-8 and DBCS forms, taking account of different
+ // character byte lengths.
+ Converter convMeasure("UCS-2", CharacterSetID(characterSet), false);
+ pango_layout_set_text(layout, utfForm.c_str(), strlen(utfForm.c_str()));
+ int i = 0;
+ int clusterStart = 0;
+ ClusterIterator iti(layout, strlen(utfForm.c_str()));
+ while (!iti.finished) {
+ iti.Next();
+ int clusterEnd = iti.curIndex;
+ int places = g_utf8_strlen(utfForm.c_str() + clusterStart, clusterEnd - clusterStart);
+ int place = 1;
+ while (clusterStart < clusterEnd) {
+ size_t lenChar = MultiByteLenFromIconv(convMeasure, s+i, len-i);
+ while (lenChar--) {
+ positions[i++] = iti.position - (places - place) * iti.distance / places;
+ positionsCalculated++;
+ }
+ clusterStart += UTF8CharLength(static_cast<unsigned char>(utfForm.c_str()[clusterStart]));
+ place++;
+ }
+ }
+ PLATFORM_ASSERT(i == lenPositions);
+ }
+ }
+ if (positionsCalculated < 1 ) {
+ // Either 8-bit or DBCS conversion failed so treat as 8-bit.
+ SetConverter(PFont(font_)->characterSet);
+ const bool rtlCheck = PFont(font_)->characterSet == SC_CHARSET_HEBREW ||
+ PFont(font_)->characterSet == SC_CHARSET_ARABIC;
+ std::string utfForm = UTF8FromIconv(conv, s, len);
+ if (utfForm.empty()) {
+ utfForm = UTF8FromLatin1(s, len);
+ }
+ pango_layout_set_text(layout, utfForm.c_str(), utfForm.length());
+ int i = 0;
+ int clusterStart = 0;
+ // Each 8-bit input character may take 1 or 2 bytes in UTF-8
+ // and groups of up to 3 may be represented as ligatures.
+ ClusterIterator iti(layout, utfForm.length());
+ while (!iti.finished) {
+ iti.Next();
+ int clusterEnd = iti.curIndex;
+ int ligatureLength = g_utf8_strlen(utfForm.c_str() + clusterStart, clusterEnd - clusterStart);
+ if (rtlCheck && ((clusterEnd <= clusterStart) || (ligatureLength == 0) || (ligatureLength > 3))) {
+ // Something has gone wrong: exit quickly but pretend all the characters are equally spaced:
+ int widthLayout = 0;
+ pango_layout_get_size(layout, &widthLayout, NULL);
+ XYPOSITION widthTotal = doubleFromPangoUnits(widthLayout);
+ for (int bytePos=0; bytePos<lenPositions; bytePos++) {
+ positions[bytePos] = widthTotal / lenPositions * (bytePos + 1);
+ }
+ return;
+ }
+ PLATFORM_ASSERT(ligatureLength > 0 && ligatureLength <= 3);
+ for (int charInLig=0; charInLig<ligatureLength; charInLig++) {
+ positions[i++] = iti.position - (ligatureLength - 1 - charInLig) * iti.distance / ligatureLength;
+ }
+ clusterStart = clusterEnd;
+ }
+ while (i < lenPositions) {
+ // If something failed, fill in rest of the positions
+ positions[i++] = clusterStart;
+ }
+ PLATFORM_ASSERT(i == lenPositions);
+ }
+ }
+ if (len == 1) {
+ PFont(font_)->SetCharWidth(*s, positions[0], et);
+ }
+ return;
+ }
+ } else {
+ // No font so return an ascending range of values
+ for (int i = 0; i < len; i++) {
+ positions[i] = i + 1;
+ }
+ }
+}
+
+XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) {
+ if (font_.GetID()) {
+ if (PFont(font_)->pfd) {
+ std::string utfForm;
+ pango_layout_set_font_description(layout, PFont(font_)->pfd);
+ PangoRectangle pos;
+ if (et == UTF8) {
+ pango_layout_set_text(layout, s, len);
+ } else {
+ SetConverter(PFont(font_)->characterSet);
+ utfForm = UTF8FromIconv(conv, s, len);
+ if (utfForm.empty()) { // iconv failed so treat as Latin1
+ utfForm = UTF8FromLatin1(s, len);
+ }
+ pango_layout_set_text(layout, utfForm.c_str(), utfForm.length());
+ }
+#ifdef PANGO_VERSION
+ PangoLayoutLine *pangoLine = pango_layout_get_line_readonly(layout,0);
+#else
+ PangoLayoutLine *pangoLine = pango_layout_get_line(layout,0);
+#endif
+ pango_layout_line_get_extents(pangoLine, NULL, &pos);
+ return doubleFromPangoUnits(pos.width);
+ }
+ return 1;
+ } else {
+ return 1;
+ }
+}
+
+XYPOSITION SurfaceImpl::WidthChar(Font &font_, char ch) {
+ if (font_.GetID()) {
+ if (PFont(font_)->pfd) {
+ return WidthText(font_, &ch, 1);
+ }
+ return 1;
+ } else {
+ return 1;
+ }
+}
+
+// Ascent and descent determined by Pango font metrics.
+
+XYPOSITION SurfaceImpl::Ascent(Font &font_) {
+ if (!(font_.GetID()))
+ return 1;
+ FontMutexLock();
+ int ascent = PFont(font_)->ascent;
+ if ((ascent == 0) && (PFont(font_)->pfd)) {
+ PangoFontMetrics *metrics = pango_context_get_metrics(pcontext,
+ PFont(font_)->pfd, pango_context_get_language(pcontext));
+ PFont(font_)->ascent =
+ doubleFromPangoUnits(pango_font_metrics_get_ascent(metrics));
+ pango_font_metrics_unref(metrics);
+ ascent = PFont(font_)->ascent;
+ }
+ if (ascent == 0) {
+ ascent = 1;
+ }
+ FontMutexUnlock();
+ return ascent;
+}
+
+XYPOSITION SurfaceImpl::Descent(Font &font_) {
+ if (!(font_.GetID()))
+ return 1;
+ if (PFont(font_)->pfd) {
+ PangoFontMetrics *metrics = pango_context_get_metrics(pcontext,
+ PFont(font_)->pfd, pango_context_get_language(pcontext));
+ int descent = doubleFromPangoUnits(pango_font_metrics_get_descent(metrics));
+ pango_font_metrics_unref(metrics);
+ return descent;
+ }
+ return 0;
+}
+
+XYPOSITION SurfaceImpl::InternalLeading(Font &) {
+ return 0;
+}
+
+XYPOSITION SurfaceImpl::ExternalLeading(Font &) {
+ return 0;
+}
+
+XYPOSITION SurfaceImpl::Height(Font &font_) {
+ return Ascent(font_) + Descent(font_);
+}
+
+XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) {
+ return WidthChar(font_, 'n');
+}
+
+void SurfaceImpl::SetClip(PRectangle rc) {
+ PLATFORM_ASSERT(context);
+ cairo_rectangle(context, rc.left, rc.top, rc.right, rc.bottom);
+ cairo_clip(context);
+}
+
+void SurfaceImpl::FlushCachedState() {}
+
+void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) {
+ if (unicodeMode_)
+ et = UTF8;
+}
+
+void SurfaceImpl::SetDBCSMode(int codePage) {
+ if (codePage && (codePage != SC_CP_UTF8))
+ et = dbcs;
+}
+
+Surface *Surface::Allocate(int) {
+ return new SurfaceImpl();
+}
+
+Window::~Window() {}
+
+void Window::Destroy() {
+ if (wid) {
+ ListBox *listbox = dynamic_cast<ListBox*>(this);
+ if (listbox) {
+ gtk_widget_hide(GTK_WIDGET(wid));
+ // clear up window content
+ listbox->Clear();
+ // resize the window to the smallest possible size for it to adapt
+ // to future content
+ gtk_window_resize(GTK_WINDOW(wid), 1, 1);
+ } else {
+ gtk_widget_destroy(GTK_WIDGET(wid));
+ }
+ wid = 0;
+ }
+}
+
+bool Window::HasFocus() {
+ return IS_WIDGET_FOCUSSED(wid);
+}
+
+PRectangle Window::GetPosition() {
+ // Before any size allocated pretend its 1000 wide so not scrolled
+ PRectangle rc(0, 0, 1000, 1000);
+ if (wid) {
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_allocation(PWidget(wid), &allocation);
+#else
+ allocation = PWidget(wid)->allocation;
+#endif
+ rc.left = allocation.x;
+ rc.top = allocation.y;
+ if (allocation.width > 20) {
+ rc.right = rc.left + allocation.width;
+ rc.bottom = rc.top + allocation.height;
+ }
+ }
+ return rc;
+}
+
+void Window::SetPosition(PRectangle rc) {
+ GtkAllocation alloc;
+ alloc.x = rc.left;
+ alloc.y = rc.top;
+ alloc.width = rc.Width();
+ alloc.height = rc.Height();
+ gtk_widget_size_allocate(PWidget(wid), &alloc);
+}
+
+void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
+ int ox = 0;
+ int oy = 0;
+ gdk_window_get_origin(WindowFromWidget(PWidget(relativeTo.wid)), &ox, &oy);
+ ox += rc.left;
+ if (ox < 0)
+ ox = 0;
+ oy += rc.top;
+ if (oy < 0)
+ oy = 0;
+
+ /* do some corrections to fit into screen */
+ int sizex = rc.right - rc.left;
+ int sizey = rc.bottom - rc.top;
+ int screenWidth = gdk_screen_width();
+ int screenHeight = gdk_screen_height();
+ if (sizex > screenWidth)
+ ox = 0; /* the best we can do */
+ else if (ox + sizex > screenWidth)
+ ox = screenWidth - sizex;
+ if (oy + sizey > screenHeight)
+ oy = screenHeight - sizey;
+
+ gtk_window_move(GTK_WINDOW(PWidget(wid)), ox, oy);
+
+ gtk_window_resize(GTK_WINDOW(wid), sizex, sizey);
+}
+
+PRectangle Window::GetClientPosition() {
+ // On GTK+, the client position is the window position
+ return GetPosition();
+}
+
+void Window::Show(bool show) {
+ if (show)
+ gtk_widget_show(PWidget(wid));
+}
+
+void Window::InvalidateAll() {
+ if (wid) {
+ gtk_widget_queue_draw(PWidget(wid));
+ }
+}
+
+void Window::InvalidateRectangle(PRectangle rc) {
+ if (wid) {
+ gtk_widget_queue_draw_area(PWidget(wid),
+ rc.left, rc.top,
+ rc.right - rc.left, rc.bottom - rc.top);
+ }
+}
+
+void Window::SetFont(Font &) {
+ // Can not be done generically but only needed for ListBox
+}
+
+void Window::SetCursor(Cursor curs) {
+ // We don't set the cursor to same value numerous times under gtk because
+ // it stores the cursor in the window once it's set
+ if (curs == cursorLast)
+ return;
+
+ cursorLast = curs;
+ GdkCursor *gdkCurs;
+ switch (curs) {
+ case cursorText:
+ gdkCurs = gdk_cursor_new(GDK_XTERM);
+ break;
+ case cursorArrow:
+ gdkCurs = gdk_cursor_new(GDK_LEFT_PTR);
+ break;
+ case cursorUp:
+ gdkCurs = gdk_cursor_new(GDK_CENTER_PTR);
+ break;
+ case cursorWait:
+ gdkCurs = gdk_cursor_new(GDK_WATCH);
+ break;
+ case cursorHand:
+ gdkCurs = gdk_cursor_new(GDK_HAND2);
+ break;
+ case cursorReverseArrow:
+ gdkCurs = gdk_cursor_new(GDK_RIGHT_PTR);
+ break;
+ default:
+ gdkCurs = gdk_cursor_new(GDK_LEFT_PTR);
+ cursorLast = cursorArrow;
+ break;
+ }
+
+ if (WindowFromWidget(PWidget(wid)))
+ gdk_window_set_cursor(WindowFromWidget(PWidget(wid)), gdkCurs);
+#if GTK_CHECK_VERSION(3,0,0)
+ g_object_unref(gdkCurs);
+#else
+ gdk_cursor_unref(gdkCurs);
+#endif
+}
+
+void Window::SetTitle(const char *s) {
+ gtk_window_set_title(GTK_WINDOW(wid), s);
+}
+
+/* Returns rectangle of monitor pt is on, both rect and pt are in Window's
+ gdk window coordinates */
+PRectangle Window::GetMonitorRect(Point pt) {
+ gint x_offset, y_offset;
+
+ gdk_window_get_origin(WindowFromWidget(PWidget(wid)), &x_offset, &y_offset);
+
+ GdkScreen* screen;
+ gint monitor_num;
+ GdkRectangle rect;
+
+ screen = gtk_widget_get_screen(PWidget(wid));
+ monitor_num = gdk_screen_get_monitor_at_point(screen, pt.x + x_offset, pt.y + y_offset);
+ gdk_screen_get_monitor_geometry(screen, monitor_num, &rect);
+ rect.x -= x_offset;
+ rect.y -= y_offset;
+ return PRectangle(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
+}
+
+typedef std::map<int, RGBAImage*> ImageMap;
+
+struct ListImage {
+ const RGBAImage *rgba_data;
+ GdkPixbuf *pixbuf;
+};
+
+static void list_image_free(gpointer, gpointer value, gpointer) {
+ ListImage *list_image = static_cast<ListImage *>(value);
+ if (list_image->pixbuf)
+ g_object_unref(list_image->pixbuf);
+ g_free(list_image);
+}
+
+ListBox::ListBox() {
+}
+
+ListBox::~ListBox() {
+}
+
+enum {
+ PIXBUF_COLUMN,
+ TEXT_COLUMN,
+ N_COLUMNS
+};
+
+class ListBoxX : public ListBox {
+ WindowID widCached;
+ WindowID frame;
+ WindowID list;
+ WindowID scroller;
+ void *pixhash;
+ GtkCellRenderer* pixbuf_renderer;
+ RGBAImageSet images;
+ int desiredVisibleRows;
+ unsigned int maxItemCharacters;
+ unsigned int aveCharWidth;
+public:
+ CallBackAction doubleClickAction;
+ void *doubleClickActionData;
+
+ ListBoxX() : widCached(0), frame(0), list(0), scroller(0), pixhash(NULL), pixbuf_renderer(0),
+ desiredVisibleRows(5), maxItemCharacters(0),
+ aveCharWidth(1), doubleClickAction(NULL), doubleClickActionData(NULL) {
+ }
+ virtual ~ListBoxX() {
+ if (pixhash) {
+ g_hash_table_foreach((GHashTable *) pixhash, list_image_free, NULL);
+ g_hash_table_destroy((GHashTable *) pixhash);
+ }
+ if (widCached) {
+ gtk_widget_destroy(GTK_WIDGET(widCached));
+ wid = widCached = 0;
+ }
+ }
+ virtual void SetFont(Font &font);
+ virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int technology_);
+ virtual void SetAverageCharWidth(int width);
+ virtual void SetVisibleRows(int rows);
+ virtual int GetVisibleRows() const;
+ int GetRowHeight();
+ virtual PRectangle GetDesiredRect();
+ virtual int CaretFromEdge();
+ virtual void Clear();
+ virtual void Append(char *s, int type = -1);
+ virtual int Length();
+ virtual void Select(int n);
+ virtual int GetSelection();
+ virtual int Find(const char *prefix);
+ virtual void GetValue(int n, char *value, int len);
+ void RegisterRGBA(int type, RGBAImage *image);
+ virtual void RegisterImage(int type, const char *xpm_data);
+ virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage);
+ virtual void ClearRegisteredImages();
+ virtual void SetDoubleClickAction(CallBackAction action, void *data) {
+ doubleClickAction = action;
+ doubleClickActionData = data;
+ }
+ virtual void SetList(const char *listText, char separator, char typesep);
+};
+
+ListBox *ListBox::Allocate() {
+ ListBoxX *lb = new ListBoxX();
+ return lb;
+}
+
+// SmallScroller, a GtkScrolledWindow that can shrink very small, as
+// gtk_widget_set_size_request() cannot shrink widgets on GTK3
+typedef struct {
+ GtkScrolledWindow parent;
+ /* Workaround ABI issue with Windows GTK2 bundle and GCC > 3.
+ See http://lists.geany.org/pipermail/devel/2015-April/thread.html#9379
+
+ GtkScrolledWindow contains a bitfield, and GCC 3.4 and 4.8 don't agree
+ on the size of the structure (regardless of -mms-bitfields):
+ - GCC 3.4 has sizeof(GtkScrolledWindow)=88
+ - GCC 4.8 has sizeof(GtkScrolledWindow)=84
+ As Windows GTK2 bundle is built with GCC 3, it requires types derived
+ from GtkScrolledWindow to be at least 88 bytes, which means we need to
+ add some fake padding to fill in the extra 4 bytes.
+ There is however no other issue with the layout difference as we never
+ access any GtkScrolledWindow fields ourselves. */
+ int padding;
+} SmallScroller;
+typedef GtkScrolledWindowClass SmallScrollerClass;
+
+G_DEFINE_TYPE(SmallScroller, small_scroller, GTK_TYPE_SCROLLED_WINDOW)
+
+#if GTK_CHECK_VERSION(3,0,0)
+static void small_scroller_get_preferred_height(GtkWidget *widget, gint *min, gint *nat) {
+ GTK_WIDGET_CLASS(small_scroller_parent_class)->get_preferred_height(widget, min, nat);
+ *min = 1;
+}
+#else
+static void small_scroller_size_request(GtkWidget *widget, GtkRequisition *req) {
+ GTK_WIDGET_CLASS(small_scroller_parent_class)->size_request(widget, req);
+ req->height = 1;
+}
+#endif
+
+static void small_scroller_class_init(SmallScrollerClass *klass) {
+#if GTK_CHECK_VERSION(3,0,0)
+ GTK_WIDGET_CLASS(klass)->get_preferred_height = small_scroller_get_preferred_height;
+#else
+ GTK_WIDGET_CLASS(klass)->size_request = small_scroller_size_request;
+#endif
+}
+
+static void small_scroller_init(SmallScroller *){}
+
+static gboolean ButtonPress(GtkWidget *, GdkEventButton* ev, gpointer p) {
+ try {
+ ListBoxX* lb = reinterpret_cast<ListBoxX*>(p);
+ if (ev->type == GDK_2BUTTON_PRESS && lb->doubleClickAction != NULL) {
+ lb->doubleClickAction(lb->doubleClickActionData);
+ return TRUE;
+ }
+
+ } catch (...) {
+ // No pointer back to Scintilla to save status
+ }
+ return FALSE;
+}
+
+/* Change the active color to the selected color so the listbox uses the color
+scheme that it would use if it had the focus. */
+static void StyleSet(GtkWidget *w, GtkStyle*, void*) {
+
+ g_return_if_fail(w != NULL);
+
+ /* Copy the selected color to active. Note that the modify calls will cause
+ recursive calls to this function after the value is updated and w->style to
+ be set to a new object */
+
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *styleContext = gtk_widget_get_style_context(w);
+ if (styleContext == NULL)
+ return;
+
+ GdkRGBA colourForeSelected;
+ gtk_style_context_get_color(styleContext, GTK_STATE_FLAG_SELECTED, &colourForeSelected);
+ GdkRGBA colourForeActive;
+ gtk_style_context_get_color(styleContext, GTK_STATE_FLAG_ACTIVE, &colourForeActive);
+ if (!gdk_rgba_equal(&colourForeSelected, &colourForeActive))
+ gtk_widget_override_color(w, GTK_STATE_FLAG_ACTIVE, &colourForeSelected);
+
+ styleContext = gtk_widget_get_style_context(w);
+ if (styleContext == NULL)
+ return;
+
+ GdkRGBA colourBaseSelected;
+ gtk_style_context_get_background_color(styleContext, GTK_STATE_FLAG_SELECTED, &colourBaseSelected);
+ GdkRGBA colourBaseActive;
+ gtk_style_context_get_background_color(styleContext, GTK_STATE_FLAG_ACTIVE, &colourBaseActive);
+ if (!gdk_rgba_equal(&colourBaseSelected, &colourBaseActive))
+ gtk_widget_override_background_color(w, GTK_STATE_FLAG_ACTIVE, &colourBaseSelected);
+#else
+ GtkStyle *style = gtk_widget_get_style(w);
+ if (style == NULL)
+ return;
+ if (!gdk_color_equal(&style->base[GTK_STATE_SELECTED], &style->base[GTK_STATE_ACTIVE]))
+ gtk_widget_modify_base(w, GTK_STATE_ACTIVE, &style->base[GTK_STATE_SELECTED]);
+ style = gtk_widget_get_style(w);
+ if (style == NULL)
+ return;
+ if (!gdk_color_equal(&style->text[GTK_STATE_SELECTED], &style->text[GTK_STATE_ACTIVE]))
+ gtk_widget_modify_text(w, GTK_STATE_ACTIVE, &style->text[GTK_STATE_SELECTED]);
+#endif
+}
+
+void ListBoxX::Create(Window &, int, Point, int, bool, int) {
+ if (widCached != 0) {
+ wid = widCached;
+ return;
+ }
+
+ wid = widCached = gtk_window_new(GTK_WINDOW_POPUP);
+
+ frame = gtk_frame_new(NULL);
+ gtk_widget_show(PWidget(frame));
+ gtk_container_add(GTK_CONTAINER(GetID()), PWidget(frame));
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 0);
+
+ scroller = g_object_new(small_scroller_get_type(), NULL);
+ gtk_container_set_border_width(GTK_CONTAINER(scroller), 0);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_container_add(GTK_CONTAINER(frame), PWidget(scroller));
+ gtk_widget_show(PWidget(scroller));
+
+ /* Tree and its model */
+ GtkListStore *store =
+ gtk_list_store_new(N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
+
+ list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+ g_signal_connect(G_OBJECT(list), "style-set", G_CALLBACK(StyleSet), NULL);
+
+ GtkTreeSelection *selection =
+ gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
+ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE);
+ gtk_tree_view_set_reorderable(GTK_TREE_VIEW(list), FALSE);
+
+ /* Columns */
+ GtkTreeViewColumn *column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_title(column, "Autocomplete");
+
+ pixbuf_renderer = gtk_cell_renderer_pixbuf_new();
+ gtk_cell_renderer_set_fixed_size(pixbuf_renderer, 0, -1);
+ gtk_tree_view_column_pack_start(column, pixbuf_renderer, FALSE);
+ gtk_tree_view_column_add_attribute(column, pixbuf_renderer,
+ "pixbuf", PIXBUF_COLUMN);
+
+ GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+ gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1);
+ gtk_tree_view_column_pack_start(column, renderer, TRUE);
+ gtk_tree_view_column_add_attribute(column, renderer,
+ "text", TEXT_COLUMN);
+
+ gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(list), "fixed-height-mode"))
+ g_object_set(G_OBJECT(list), "fixed-height-mode", TRUE, NULL);
+
+ GtkWidget *widget = PWidget(list); // No code inside the G_OBJECT macro
+ gtk_container_add(GTK_CONTAINER(PWidget(scroller)), widget);
+ gtk_widget_show(widget);
+ g_signal_connect(G_OBJECT(widget), "button_press_event",
+ G_CALLBACK(ButtonPress), this);
+}
+
+void ListBoxX::SetFont(Font &scint_font) {
+ // Only do for Pango font as there have been crashes for GDK fonts
+ if (Created() && PFont(scint_font)->pfd) {
+ // Current font is Pango font
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_override_font(PWidget(list), PFont(scint_font)->pfd);
+#else
+ gtk_widget_modify_font(PWidget(list), PFont(scint_font)->pfd);
+#endif
+ }
+}
+
+void ListBoxX::SetAverageCharWidth(int width) {
+ aveCharWidth = width;
+}
+
+void ListBoxX::SetVisibleRows(int rows) {
+ desiredVisibleRows = rows;
+}
+
+int ListBoxX::GetVisibleRows() const {
+ return desiredVisibleRows;
+}
+
+int ListBoxX::GetRowHeight()
+{
+#if GTK_CHECK_VERSION(3,0,0)
+ // This version sometimes reports erroneous results on GTK2, but the GTK2
+ // version is inaccurate for GTK 3.14.
+ GdkRectangle rect;
+ GtkTreePath *path = gtk_tree_path_new_first();
+ gtk_tree_view_get_background_area(GTK_TREE_VIEW(list), path, NULL, &rect);
+ return rect.height;
+#else
+ int row_height=0;
+ int vertical_separator=0;
+ int expander_size=0;
+ GtkTreeViewColumn *column = gtk_tree_view_get_column(GTK_TREE_VIEW(list), 0);
+ gtk_tree_view_column_cell_get_size(column, NULL, NULL, NULL, NULL, &row_height);
+ gtk_widget_style_get(PWidget(list),
+ "vertical-separator", &vertical_separator,
+ "expander-size", &expander_size, NULL);
+ row_height += vertical_separator;
+ row_height = Platform::Maximum(row_height, expander_size);
+ return row_height;
+#endif
+}
+
+PRectangle ListBoxX::GetDesiredRect() {
+ // Before any size allocated pretend its 100 wide so not scrolled
+ PRectangle rc(0, 0, 100, 100);
+ if (wid) {
+ int rows = Length();
+ if ((rows == 0) || (rows > desiredVisibleRows))
+ rows = desiredVisibleRows;
+
+ GtkRequisition req;
+ // This, apparently unnecessary call, ensures gtk_tree_view_column_cell_get_size
+ // returns reasonable values.
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_preferred_size(GTK_WIDGET(frame), NULL, &req);
+#else
+ gtk_widget_size_request(GTK_WIDGET(frame), &req);
+#endif
+ int height;
+
+ // First calculate height of the clist for our desired visible
+ // row count otherwise it tries to expand to the total # of rows
+ // Get cell height
+ int row_height = GetRowHeight();
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *styleContextFrame = gtk_widget_get_style_context(PWidget(frame));
+ GtkBorder padding, border;
+ gtk_style_context_get_padding(styleContextFrame, GTK_STATE_FLAG_NORMAL, &padding);
+ gtk_style_context_get_border(styleContextFrame, GTK_STATE_FLAG_NORMAL, &border);
+ height = (rows * row_height
+ + padding.top + padding.bottom
+ + border.top + border.bottom
+ + 2 * gtk_container_get_border_width(GTK_CONTAINER(PWidget(list))));
+#else
+ height = (rows * row_height
+ + 2 * (PWidget(frame)->style->ythickness
+ + GTK_CONTAINER(PWidget(list))->border_width));
+#endif
+ rc.bottom = height;
+
+ int width = maxItemCharacters;
+ if (width < 12)
+ width = 12;
+ rc.right = width * (aveCharWidth + aveCharWidth / 3);
+ // Add horizontal padding and borders
+ int horizontal_separator=0;
+ gtk_widget_style_get(PWidget(list),
+ "horizontal-separator", &horizontal_separator, NULL);
+ rc.right += horizontal_separator;
+#if GTK_CHECK_VERSION(3,0,0)
+ rc.right += (padding.left + padding.right
+ + border.left + border.right
+ + 2 * gtk_container_get_border_width(GTK_CONTAINER(PWidget(list))));
+#else
+ rc.right += 2 * (PWidget(frame)->style->xthickness
+ + GTK_CONTAINER(PWidget(list))->border_width);
+#endif
+ if (Length() > rows) {
+ // Add the width of the scrollbar
+ GtkWidget *vscrollbar =
+ gtk_scrolled_window_get_vscrollbar(GTK_SCROLLED_WINDOW(scroller));
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_preferred_size(vscrollbar, NULL, &req);
+#else
+ gtk_widget_size_request(vscrollbar, &req);
+#endif
+ rc.right += req.width;
+ }
+ }
+ return rc;
+}
+
+int ListBoxX::CaretFromEdge() {
+ gint renderer_width, renderer_height;
+ gtk_cell_renderer_get_fixed_size(pixbuf_renderer, &renderer_width,
+ &renderer_height);
+ return 4 + renderer_width;
+}
+
+void ListBoxX::Clear() {
+ GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
+ gtk_list_store_clear(GTK_LIST_STORE(model));
+ maxItemCharacters = 0;
+}
+
+static void init_pixmap(ListImage *list_image) {
+ if (list_image->rgba_data) {
+ // Drop any existing pixmap/bitmap as data may have changed
+ if (list_image->pixbuf)
+ g_object_unref(list_image->pixbuf);
+ list_image->pixbuf =
+ gdk_pixbuf_new_from_data(list_image->rgba_data->Pixels(),
+ GDK_COLORSPACE_RGB,
+ TRUE,
+ 8,
+ list_image->rgba_data->GetWidth(),
+ list_image->rgba_data->GetHeight(),
+ list_image->rgba_data->GetWidth() * 4,
+ NULL,
+ NULL);
+ }
+}
+
+#define SPACING 5
+
+void ListBoxX::Append(char *s, int type) {
+ ListImage *list_image = NULL;
+ if ((type >= 0) && pixhash) {
+ list_image = static_cast<ListImage *>(g_hash_table_lookup((GHashTable *) pixhash
+ , (gconstpointer) GINT_TO_POINTER(type)));
+ }
+ GtkTreeIter iter;
+ GtkListStore *store =
+ GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(list)));
+ gtk_list_store_append(GTK_LIST_STORE(store), &iter);
+ if (list_image) {
+ if (NULL == list_image->pixbuf)
+ init_pixmap(list_image);
+ if (list_image->pixbuf) {
+ gtk_list_store_set(GTK_LIST_STORE(store), &iter,
+ PIXBUF_COLUMN, list_image->pixbuf,
+ TEXT_COLUMN, s, -1);
+
+ gint pixbuf_width = gdk_pixbuf_get_width(list_image->pixbuf);
+ gint renderer_height, renderer_width;
+ gtk_cell_renderer_get_fixed_size(pixbuf_renderer,
+ &renderer_width, &renderer_height);
+ if (pixbuf_width > renderer_width)
+ gtk_cell_renderer_set_fixed_size(pixbuf_renderer,
+ pixbuf_width, -1);
+ } else {
+ gtk_list_store_set(GTK_LIST_STORE(store), &iter,
+ TEXT_COLUMN, s, -1);
+ }
+ } else {
+ gtk_list_store_set(GTK_LIST_STORE(store), &iter,
+ TEXT_COLUMN, s, -1);
+ }
+ size_t len = strlen(s);
+ if (maxItemCharacters < len)
+ maxItemCharacters = len;
+}
+
+int ListBoxX::Length() {
+ if (wid)
+ return gtk_tree_model_iter_n_children(gtk_tree_view_get_model
+ (GTK_TREE_VIEW(list)), NULL);
+ return 0;
+}
+
+void ListBoxX::Select(int n) {
+ GtkTreeIter iter;
+ GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
+ GtkTreeSelection *selection =
+ gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
+
+ if (n < 0) {
+ gtk_tree_selection_unselect_all(selection);
+ return;
+ }
+
+ bool valid = gtk_tree_model_iter_nth_child(model, &iter, NULL, n) != FALSE;
+ if (valid) {
+ gtk_tree_selection_select_iter(selection, &iter);
+
+ // Move the scrollbar to show the selection.
+ int total = Length();
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkAdjustment *adj =
+ gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(list));
+ gfloat value = ((gfloat)n / total) * (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_lower(adj))
+ + gtk_adjustment_get_lower(adj) - gtk_adjustment_get_page_size(adj) / 2;
+#else
+ GtkAdjustment *adj =
+ gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list));
+ gfloat value = ((gfloat)n / total) * (adj->upper - adj->lower)
+ + adj->lower - adj->page_size / 2;
+#endif
+ // Get cell height
+ int row_height = GetRowHeight();
+
+ int rows = Length();
+ if ((rows == 0) || (rows > desiredVisibleRows))
+ rows = desiredVisibleRows;
+ if (rows & 0x1) {
+ // Odd rows to display -- We are now in the middle.
+ // Align it so that we don't chop off rows.
+ value += (gfloat)row_height / 2.0;
+ }
+ // Clamp it.
+ value = (value < 0)? 0 : value;
+#if GTK_CHECK_VERSION(3,0,0)
+ value = (value > (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj)))?
+ (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj)) : value;
+#else
+ value = (value > (adj->upper - adj->page_size))?
+ (adj->upper - adj->page_size) : value;
+#endif
+
+ // Set it.
+ gtk_adjustment_set_value(adj, value);
+ } else {
+ gtk_tree_selection_unselect_all(selection);
+ }
+}
+
+int ListBoxX::GetSelection() {
+ int index = -1;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
+ if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+ GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
+ int *indices = gtk_tree_path_get_indices(path);
+ // Don't free indices.
+ if (indices)
+ index = indices[0];
+ gtk_tree_path_free(path);
+ }
+ return index;
+}
+
+int ListBoxX::Find(const char *prefix) {
+ GtkTreeIter iter;
+ GtkTreeModel *model =
+ gtk_tree_view_get_model(GTK_TREE_VIEW(list));
+ bool valid = gtk_tree_model_get_iter_first(model, &iter) != FALSE;
+ int i = 0;
+ while(valid) {
+ gchar *s;
+ gtk_tree_model_get(model, &iter, TEXT_COLUMN, &s, -1);
+ if (s && (0 == strncmp(prefix, s, strlen(prefix)))) {
+ g_free(s);
+ return i;
+ }
+ g_free(s);
+ valid = gtk_tree_model_iter_next(model, &iter) != FALSE;
+ i++;
+ }
+ return -1;
+}
+
+void ListBoxX::GetValue(int n, char *value, int len) {
+ char *text = NULL;
+ GtkTreeIter iter;
+ GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list));
+ bool valid = gtk_tree_model_iter_nth_child(model, &iter, NULL, n) != FALSE;
+ if (valid) {
+ gtk_tree_model_get(model, &iter, TEXT_COLUMN, &text, -1);
+ }
+ if (text && len > 0) {
+ g_strlcpy(value, text, len);
+ } else {
+ value[0] = '\0';
+ }
+ g_free(text);
+}
+
+// g_return_if_fail causes unnecessary compiler warning in release compile.
+#ifdef _MSC_VER
+#pragma warning(disable: 4127)
+#endif
+
+void ListBoxX::RegisterRGBA(int type, RGBAImage *image) {
+ images.Add(type, image);
+
+ if (!pixhash) {
+ pixhash = g_hash_table_new(g_direct_hash, g_direct_equal);
+ }
+ ListImage *list_image = static_cast<ListImage *>(g_hash_table_lookup((GHashTable *) pixhash,
+ (gconstpointer) GINT_TO_POINTER(type)));
+ if (list_image) {
+ // Drop icon already registered
+ if (list_image->pixbuf)
+ g_object_unref(list_image->pixbuf);
+ list_image->pixbuf = NULL;
+ list_image->rgba_data = image;
+ } else {
+ list_image = g_new0(ListImage, 1);
+ list_image->rgba_data = image;
+ g_hash_table_insert((GHashTable *) pixhash, GINT_TO_POINTER(type),
+ (gpointer) list_image);
+ }
+}
+
+void ListBoxX::RegisterImage(int type, const char *xpm_data) {
+ g_return_if_fail(xpm_data);
+ XPM xpmImage(xpm_data);
+ RegisterRGBA(type, new RGBAImage(xpmImage));
+}
+
+void ListBoxX::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) {
+ RegisterRGBA(type, new RGBAImage(width, height, 1.0, pixelsImage));
+}
+
+void ListBoxX::ClearRegisteredImages() {
+ images.Clear();
+}
+
+void ListBoxX::SetList(const char *listText, char separator, char typesep) {
+ Clear();
+ int count = strlen(listText) + 1;
+ std::vector<char> words(listText, listText+count);
+ char *startword = &words[0];
+ char *numword = NULL;
+ int i = 0;
+ for (; words[i]; i++) {
+ if (words[i] == separator) {
+ words[i] = '\0';
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ startword = &words[0] + i + 1;
+ numword = NULL;
+ } else if (words[i] == typesep) {
+ numword = &words[0] + i;
+ }
+ }
+ if (startword) {
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ }
+}
+
+Menu::Menu() : mid(0) {}
+
+void Menu::CreatePopUp() {
+ Destroy();
+ mid = gtk_menu_new();
+#if GLIB_CHECK_VERSION(2,10,0)
+ g_object_ref_sink(G_OBJECT(mid));
+#else
+ g_object_ref(G_OBJECT(mid));
+ gtk_object_sink(GTK_OBJECT(G_OBJECT(mid)));
+#endif
+}
+
+void Menu::Destroy() {
+ if (mid)
+ g_object_unref(G_OBJECT(mid));
+ mid = 0;
+}
+
+static void MenuPositionFunc(GtkMenu *, gint *x, gint *y, gboolean *, gpointer userData) {
+ sptr_t intFromPointer = reinterpret_cast<sptr_t>(userData);
+ *x = intFromPointer & 0xffff;
+ *y = intFromPointer >> 16;
+}
+
+void Menu::Show(Point pt, Window &) {
+ int screenHeight = gdk_screen_height();
+ int screenWidth = gdk_screen_width();
+ GtkMenu *widget = reinterpret_cast<GtkMenu *>(mid);
+ gtk_widget_show_all(GTK_WIDGET(widget));
+ GtkRequisition requisition;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_preferred_size(GTK_WIDGET(widget), NULL, &requisition);
+#else
+ gtk_widget_size_request(GTK_WIDGET(widget), &requisition);
+#endif
+ if ((pt.x + requisition.width) > screenWidth) {
+ pt.x = screenWidth - requisition.width;
+ }
+ if ((pt.y + requisition.height) > screenHeight) {
+ pt.y = screenHeight - requisition.height;
+ }
+ gtk_menu_popup(widget, NULL, NULL, MenuPositionFunc,
+ reinterpret_cast<void *>((static_cast<int>(pt.y) << 16) | static_cast<int>(pt.x)), 0,
+ gtk_get_current_event_time());
+}
+
+ElapsedTime::ElapsedTime() {
+ GTimeVal curTime;
+ g_get_current_time(&curTime);
+ bigBit = curTime.tv_sec;
+ littleBit = curTime.tv_usec;
+}
+
+class DynamicLibraryImpl : public DynamicLibrary {
+protected:
+ GModule* m;
+public:
+ explicit DynamicLibraryImpl(const char *modulePath) {
+ m = g_module_open(modulePath, G_MODULE_BIND_LAZY);
+ }
+
+ virtual ~DynamicLibraryImpl() {
+ if (m != NULL)
+ g_module_close(m);
+ }
+
+ // Use g_module_symbol to get a pointer to the relevant function.
+ virtual Function FindFunction(const char *name) {
+ if (m != NULL) {
+ gpointer fn_address = NULL;
+ gboolean status = g_module_symbol(m, name, &fn_address);
+ if (status)
+ return static_cast<Function>(fn_address);
+ else
+ return NULL;
+ } else {
+ return NULL;
+ }
+ }
+
+ virtual bool IsValid() {
+ return m != NULL;
+ }
+};
+
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
+ return static_cast<DynamicLibrary *>( new DynamicLibraryImpl(modulePath) );
+}
+
+double ElapsedTime::Duration(bool reset) {
+ GTimeVal curTime;
+ g_get_current_time(&curTime);
+ long endBigBit = curTime.tv_sec;
+ long endLittleBit = curTime.tv_usec;
+ double result = 1000000.0 * (endBigBit - bigBit);
+ result += endLittleBit - littleBit;
+ result /= 1000000.0;
+ if (reset) {
+ bigBit = endBigBit;
+ littleBit = endLittleBit;
+ }
+ return result;
+}
+
+ColourDesired Platform::Chrome() {
+ return ColourDesired(0xe0, 0xe0, 0xe0);
+}
+
+ColourDesired Platform::ChromeHighlight() {
+ return ColourDesired(0xff, 0xff, 0xff);
+}
+
+const char *Platform::DefaultFont() {
+#ifdef G_OS_WIN32
+ return "Lucida Console";
+#else
+ return "!Sans";
+#endif
+}
+
+int Platform::DefaultFontSize() {
+#ifdef G_OS_WIN32
+ return 10;
+#else
+ return 12;
+#endif
+}
+
+unsigned int Platform::DoubleClickTime() {
+ return 500; // Half a second
+}
+
+bool Platform::MouseButtonBounce() {
+ return true;
+}
+
+void Platform::DebugDisplay(const char *s) {
+ fprintf(stderr, "%s", s);
+}
+
+bool Platform::IsKeyDown(int) {
+ // TODO: discover state of keys in GTK+/X
+ return false;
+}
+
+long Platform::SendScintilla(
+ WindowID w, unsigned int msg, unsigned long wParam, long lParam) {
+ return scintilla_send_message(SCINTILLA(w), msg, wParam, lParam);
+}
+
+long Platform::SendScintillaPointer(
+ WindowID w, unsigned int msg, unsigned long wParam, void *lParam) {
+ return scintilla_send_message(SCINTILLA(w), msg, wParam,
+ reinterpret_cast<sptr_t>(lParam));
+}
+
+bool Platform::IsDBCSLeadByte(int codePage, char ch) {
+ // Byte ranges found in Wikipedia articles with relevant search strings in each case
+ unsigned char uch = static_cast<unsigned char>(ch);
+ switch (codePage) {
+ case 932:
+ // Shift_jis
+ return ((uch >= 0x81) && (uch <= 0x9F)) ||
+ ((uch >= 0xE0) && (uch <= 0xFC));
+ // Lead bytes F0 to FC may be a Microsoft addition.
+ case 936:
+ // GBK
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 950:
+ // Big5
+ return (uch >= 0x81) && (uch <= 0xFE);
+ // Korean EUC-KR may be code page 949.
+ }
+ return false;
+}
+
+int Platform::DBCSCharLength(int codePage, const char *s) {
+ if (codePage == 932 || codePage == 936 || codePage == 950) {
+ return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1;
+ } else {
+ int bytes = mblen(s, MB_CUR_MAX);
+ if (bytes >= 1)
+ return bytes;
+ else
+ return 1;
+ }
+}
+
+int Platform::DBCSCharMaxLength() {
+ return MB_CUR_MAX;
+ //return 2;
+}
+
+// These are utility functions not really tied to a platform
+
+int Platform::Minimum(int a, int b) {
+ if (a < b)
+ return a;
+ else
+ return b;
+}
+
+int Platform::Maximum(int a, int b) {
+ if (a > b)
+ return a;
+ else
+ return b;
+}
+
+//#define TRACE
+
+#ifdef TRACE
+void Platform::DebugPrintf(const char *format, ...) {
+ char buffer[2000];
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsprintf(buffer, format, pArguments);
+ va_end(pArguments);
+ Platform::DebugDisplay(buffer);
+}
+#else
+void Platform::DebugPrintf(const char *, ...) {}
+
+#endif
+
+// Not supported for GTK+
+static bool assertionPopUps = true;
+
+bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
+ bool ret = assertionPopUps;
+ assertionPopUps = assertionPopUps_;
+ return ret;
+}
+
+void Platform::Assert(const char *c, const char *file, int line) {
+ char buffer[2000];
+ g_snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d\r\n", c, file, line);
+ Platform::DebugDisplay(buffer);
+ abort();
+}
+
+int Platform::Clamp(int val, int minVal, int maxVal) {
+ if (val > maxVal)
+ val = maxVal;
+ if (val < minVal)
+ val = minVal;
+ return val;
+}
+
+void Platform_Initialise() {
+ FontMutexAllocate();
+}
+
+void Platform_Finalise() {
+ FontCached::ReleaseAll();
+ FontMutexFree();
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/ScintillaGTK.cxx b/3rdparty/bgfx/3rdparty/scintilla/gtk/ScintillaGTK.cxx
new file mode 100644
index 00000000000..80a2473052b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/ScintillaGTK.cxx
@@ -0,0 +1,3273 @@
+// Scintilla source code edit control
+// ScintillaGTK.cxx - GTK+ specific subclass of ScintillaBase
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <new>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include <glib.h>
+#include <gmodule.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#if defined(__WIN32__) || defined(_MSC_VER)
+#include <windows.h>
+#endif
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "ScintillaWidget.h"
+#ifdef SCI_LEXER
+#include "SciLexer.h"
+#endif
+#include "StringCopy.h"
+#ifdef SCI_LEXER
+#include "LexerModule.h"
+#endif
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "CaseConvert.h"
+#include "UniConversion.h"
+#include "UnicodeFromUTF8.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+#include "AutoComplete.h"
+#include "ScintillaBase.h"
+
+#ifdef SCI_LEXER
+#include "ExternalLexer.h"
+#endif
+
+#include "scintilla-marshal.h"
+
+#include "Converter.h"
+
+#if defined(__clang__)
+// Clang 3.0 incorrectly displays sentinel warnings. Fixed by clang 3.1.
+#pragma GCC diagnostic ignored "-Wsentinel"
+#endif
+
+#if GTK_CHECK_VERSION(2,20,0)
+#define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w)))
+#define IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w)))
+#define IS_WIDGET_VISIBLE(w) (gtk_widget_get_visible(GTK_WIDGET(w)))
+#else
+#define IS_WIDGET_REALIZED(w) (GTK_WIDGET_REALIZED(w))
+#define IS_WIDGET_MAPPED(w) (GTK_WIDGET_MAPPED(w))
+#define IS_WIDGET_VISIBLE(w) (GTK_WIDGET_VISIBLE(w))
+#endif
+
+#define SC_INDICATOR_INPUT INDIC_IME
+#define SC_INDICATOR_TARGET INDIC_IME+1
+#define SC_INDICATOR_CONVERTED INDIC_IME+2
+#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX
+
+static GdkWindow *WindowFromWidget(GtkWidget *w) {
+#if GTK_CHECK_VERSION(3,0,0)
+ return gtk_widget_get_window(w);
+#else
+ return w->window;
+#endif
+}
+
+#ifdef _MSC_VER
+// Constant conditional expressions are because of GTK+ headers
+#pragma warning(disable: 4127)
+// Ignore unreferenced local functions in GTK+ headers
+#pragma warning(disable: 4505)
+#endif
+
+#define OBJECT_CLASS GObjectClass
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static GdkWindow *PWindow(const Window &w) {
+ GtkWidget *widget = reinterpret_cast<GtkWidget *>(w.GetID());
+#if GTK_CHECK_VERSION(3,0,0)
+ return gtk_widget_get_window(widget);
+#else
+ return widget->window;
+#endif
+}
+
+extern std::string UTF8FromLatin1(const char *s, int len);
+
+class ScintillaGTK : public ScintillaBase {
+ _ScintillaObject *sci;
+ Window wText;
+ Window scrollbarv;
+ Window scrollbarh;
+ GtkAdjustment *adjustmentv;
+ GtkAdjustment *adjustmenth;
+ int verticalScrollBarWidth;
+ int horizontalScrollBarHeight;
+
+ SelectionText primary;
+
+ GdkEventButton *evbtn;
+ bool capturedMouse;
+ bool dragWasDropped;
+ int lastKey;
+ int rectangularSelectionModifier;
+
+ GtkWidgetClass *parentClass;
+
+ static GdkAtom atomClipboard;
+ static GdkAtom atomUTF8;
+ static GdkAtom atomString;
+ static GdkAtom atomUriList;
+ static GdkAtom atomDROPFILES_DND;
+ GdkAtom atomSought;
+
+#if PLAT_GTK_WIN32
+ CLIPFORMAT cfColumnSelect;
+#endif
+
+ Window wPreedit;
+ Window wPreeditDraw;
+ GtkIMContext *im_context;
+ PangoScript lastNonCommonScript;
+
+ // Wheel mouse support
+ unsigned int linesPerScroll;
+ GTimeVal lastWheelMouseTime;
+ gint lastWheelMouseDirection;
+ gint wheelMouseIntensity;
+
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_rectangle_list_t *rgnUpdate;
+#else
+ GdkRegion *rgnUpdate;
+#endif
+ bool repaintFullWindow;
+
+ // Private so ScintillaGTK objects can not be copied
+ ScintillaGTK(const ScintillaGTK &);
+ ScintillaGTK &operator=(const ScintillaGTK &);
+
+public:
+ explicit ScintillaGTK(_ScintillaObject *sci_);
+ virtual ~ScintillaGTK();
+ static void ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class);
+private:
+ virtual void Initialise();
+ virtual void Finalise();
+ virtual bool AbandonPaint();
+ virtual void DisplayCursor(Window::Cursor c);
+ virtual bool DragThreshold(Point ptStart, Point ptNow);
+ virtual void StartDrag();
+ int TargetAsUTF8(char *text);
+ int EncodedFromUTF8(char *utf8, char *encoded) const;
+ virtual bool ValidCodePage(int codePage) const;
+public: // Public for scintilla_send_message
+ virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+private:
+ virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ struct TimeThunk {
+ TickReason reason;
+ ScintillaGTK *scintilla;
+ guint timer;
+ TimeThunk() : reason(tickCaret), scintilla(NULL), timer(0) {}
+ };
+ TimeThunk timers[tickDwell+1];
+ virtual bool FineTickerAvailable();
+ virtual bool FineTickerRunning(TickReason reason);
+ virtual void FineTickerStart(TickReason reason, int millis, int tolerance);
+ virtual void FineTickerCancel(TickReason reason);
+ virtual bool SetIdle(bool on);
+ virtual void SetMouseCapture(bool on);
+ virtual bool HaveMouseCapture();
+ virtual bool PaintContains(PRectangle rc);
+ void FullPaint();
+ virtual PRectangle GetClientRectangle() const;
+ virtual void ScrollText(int linesToMove);
+ virtual void SetVerticalScrollPos();
+ virtual void SetHorizontalScrollPos();
+ virtual bool ModifyScrollBars(int nMax, int nPage);
+ void ReconfigureScrollBars();
+ virtual void NotifyChange();
+ virtual void NotifyFocus(bool focus);
+ virtual void NotifyParent(SCNotification scn);
+ void NotifyKey(int key, int modifiers);
+ void NotifyURIDropped(const char *list);
+ const char *CharacterSetID() const;
+ virtual CaseFolder *CaseFolderForEncoding();
+ virtual std::string CaseMapString(const std::string &s, int caseMapping);
+ virtual int KeyDefault(int key, int modifiers);
+ virtual void CopyToClipboard(const SelectionText &selectedText);
+ virtual void Copy();
+ virtual void Paste();
+ virtual void CreateCallTipWindow(PRectangle rc);
+ virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
+ bool OwnPrimarySelection();
+ virtual void ClaimSelection();
+ void GetGtkSelectionText(GtkSelectionData *selectionData, SelectionText &selText);
+ void ReceivedSelection(GtkSelectionData *selection_data);
+ void ReceivedDrop(GtkSelectionData *selection_data);
+ static void GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *selected);
+ void StoreOnClipboard(SelectionText *clipText);
+ static void ClipboardGetSelection(GtkClipboard* clip, GtkSelectionData *selection_data, guint info, void *data);
+ static void ClipboardClearSelection(GtkClipboard* clip, void *data);
+
+ void UnclaimSelection(GdkEventSelection *selection_event);
+ void Resize(int width, int height);
+
+ // Callback functions
+ void RealizeThis(GtkWidget *widget);
+ static void Realize(GtkWidget *widget);
+ void UnRealizeThis(GtkWidget *widget);
+ static void UnRealize(GtkWidget *widget);
+ void MapThis();
+ static void Map(GtkWidget *widget);
+ void UnMapThis();
+ static void UnMap(GtkWidget *widget);
+ gint FocusInThis(GtkWidget *widget);
+ static gint FocusIn(GtkWidget *widget, GdkEventFocus *event);
+ gint FocusOutThis(GtkWidget *widget);
+ static gint FocusOut(GtkWidget *widget, GdkEventFocus *event);
+ static void SizeRequest(GtkWidget *widget, GtkRequisition *requisition);
+#if GTK_CHECK_VERSION(3,0,0)
+ static void GetPreferredWidth(GtkWidget *widget, gint *minimalWidth, gint *naturalWidth);
+ static void GetPreferredHeight(GtkWidget *widget, gint *minimalHeight, gint *naturalHeight);
+#endif
+ static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation);
+#if GTK_CHECK_VERSION(3,0,0)
+ gboolean DrawTextThis(cairo_t *cr);
+ static gboolean DrawText(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis);
+ gboolean DrawThis(cairo_t *cr);
+ static gboolean DrawMain(GtkWidget *widget, cairo_t *cr);
+#else
+ gboolean ExposeTextThis(GtkWidget *widget, GdkEventExpose *ose);
+ static gboolean ExposeText(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis);
+ gboolean Expose(GtkWidget *widget, GdkEventExpose *ose);
+ static gboolean ExposeMain(GtkWidget *widget, GdkEventExpose *ose);
+#endif
+ static void Draw(GtkWidget *widget, GdkRectangle *area);
+ void ForAll(GtkCallback callback, gpointer callback_data);
+ static void MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
+
+ static void ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis);
+ static void ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis);
+ gint PressThis(GdkEventButton *event);
+ static gint Press(GtkWidget *widget, GdkEventButton *event);
+ static gint MouseRelease(GtkWidget *widget, GdkEventButton *event);
+ static gint ScrollEvent(GtkWidget *widget, GdkEventScroll *event);
+ static gint Motion(GtkWidget *widget, GdkEventMotion *event);
+ gboolean KeyThis(GdkEventKey *event);
+ static gboolean KeyPress(GtkWidget *widget, GdkEventKey *event);
+ static gboolean KeyRelease(GtkWidget *widget, GdkEventKey *event);
+#if GTK_CHECK_VERSION(3,0,0)
+ gboolean DrawPreeditThis(GtkWidget *widget, cairo_t *cr);
+ static gboolean DrawPreedit(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis);
+#else
+ gboolean ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose);
+ static gboolean ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis);
+#endif
+
+ bool KoreanIME();
+ void CommitThis(char *str);
+ static void Commit(GtkIMContext *context, char *str, ScintillaGTK *sciThis);
+ void PreeditChangedInlineThis();
+ void PreeditChangedWindowedThis();
+ static void PreeditChanged(GtkIMContext *context, ScintillaGTK *sciThis);
+ void MoveImeCarets(int pos);
+ void DrawImeIndicator(int indicator, int len);
+ static void GetImeUnderlines(PangoAttrList *attrs, bool *normalInput);
+ static void GetImeBackgrounds(PangoAttrList *attrs, bool *targetInput);
+ void SetCandidateWindowPos();
+
+ static void StyleSetText(GtkWidget *widget, GtkStyle *previous, void*);
+ static void RealizeText(GtkWidget *widget, void*);
+ static void Destroy(GObject *object);
+ static void SelectionReceived(GtkWidget *widget, GtkSelectionData *selection_data,
+ guint time);
+ static void ClipboardReceived(GtkClipboard *clipboard, GtkSelectionData *selection_data,
+ gpointer data);
+ static void SelectionGet(GtkWidget *widget, GtkSelectionData *selection_data,
+ guint info, guint time);
+ static gint SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event);
+ gboolean DragMotionThis(GdkDragContext *context, gint x, gint y, guint dragtime);
+ static gboolean DragMotion(GtkWidget *widget, GdkDragContext *context,
+ gint x, gint y, guint dragtime);
+ static void DragLeave(GtkWidget *widget, GdkDragContext *context,
+ guint time);
+ static void DragEnd(GtkWidget *widget, GdkDragContext *context);
+ static gboolean Drop(GtkWidget *widget, GdkDragContext *context,
+ gint x, gint y, guint time);
+ static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
+ gint x, gint y, GtkSelectionData *selection_data, guint info, guint time);
+ static void DragDataGet(GtkWidget *widget, GdkDragContext *context,
+ GtkSelectionData *selection_data, guint info, guint time);
+ static gboolean TimeOut(TimeThunk *tt);
+ static gboolean IdleCallback(ScintillaGTK *sciThis);
+ static gboolean StyleIdle(ScintillaGTK *sciThis);
+ virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo);
+ static void PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis);
+
+#if GTK_CHECK_VERSION(3,0,0)
+ static gboolean DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip);
+#else
+ static gboolean ExposeCT(GtkWidget *widget, GdkEventExpose *ose, CallTip *ct);
+#endif
+ static gboolean PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis);
+
+ static sptr_t DirectFunction(sptr_t ptr,
+ unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+};
+
+enum {
+ COMMAND_SIGNAL,
+ NOTIFY_SIGNAL,
+ LAST_SIGNAL
+};
+
+static gint scintilla_signals[LAST_SIGNAL] = { 0 };
+
+enum {
+ TARGET_STRING,
+ TARGET_TEXT,
+ TARGET_COMPOUND_TEXT,
+ TARGET_UTF8_STRING,
+ TARGET_URI
+};
+
+GdkAtom ScintillaGTK::atomClipboard = 0;
+GdkAtom ScintillaGTK::atomUTF8 = 0;
+GdkAtom ScintillaGTK::atomString = 0;
+GdkAtom ScintillaGTK::atomUriList = 0;
+GdkAtom ScintillaGTK::atomDROPFILES_DND = 0;
+
+static const GtkTargetEntry clipboardCopyTargets[] = {
+ { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING },
+ { (gchar *) "STRING", 0, TARGET_STRING },
+};
+static const gint nClipboardCopyTargets = ELEMENTS(clipboardCopyTargets);
+
+static const GtkTargetEntry clipboardPasteTargets[] = {
+ { (gchar *) "text/uri-list", 0, TARGET_URI },
+ { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING },
+ { (gchar *) "STRING", 0, TARGET_STRING },
+};
+static const gint nClipboardPasteTargets = ELEMENTS(clipboardPasteTargets);
+
+static GtkWidget *PWidget(Window &w) {
+ return reinterpret_cast<GtkWidget *>(w.GetID());
+}
+
+static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) {
+ ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(widget);
+ return reinterpret_cast<ScintillaGTK *>(scio->pscin);
+}
+
+ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) :
+ adjustmentv(0), adjustmenth(0),
+ verticalScrollBarWidth(30), horizontalScrollBarHeight(30),
+ evbtn(0), capturedMouse(false), dragWasDropped(false),
+ lastKey(0), rectangularSelectionModifier(SCMOD_CTRL), parentClass(0),
+ im_context(NULL), lastNonCommonScript(PANGO_SCRIPT_INVALID_CODE),
+ lastWheelMouseDirection(0),
+ wheelMouseIntensity(0),
+ rgnUpdate(0),
+ repaintFullWindow(false) {
+ sci = sci_;
+ wMain = GTK_WIDGET(sci);
+
+#if PLAT_GTK_WIN32
+ rectangularSelectionModifier = SCMOD_ALT;
+#else
+ rectangularSelectionModifier = SCMOD_CTRL;
+#endif
+
+#if PLAT_GTK_WIN32
+ // There does not seem to be a real standard for indicating that the clipboard
+ // contains a rectangular selection, so copy Developer Studio.
+ cfColumnSelect = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat("MSDEVColumnSelect"));
+
+ // Get intellimouse parameters when running on win32; otherwise use
+ // reasonable default
+#ifndef SPI_GETWHEELSCROLLLINES
+#define SPI_GETWHEELSCROLLLINES 104
+#endif
+ ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0);
+#else
+ linesPerScroll = 4;
+#endif
+ lastWheelMouseTime.tv_sec = 0;
+ lastWheelMouseTime.tv_usec = 0;
+
+ Initialise();
+}
+
+ScintillaGTK::~ScintillaGTK() {
+ g_idle_remove_by_data(this);
+ if (evbtn) {
+ gdk_event_free(reinterpret_cast<GdkEvent *>(evbtn));
+ evbtn = 0;
+ }
+ wPreedit.Destroy();
+}
+
+static void UnRefCursor(GdkCursor *cursor) {
+#if GTK_CHECK_VERSION(3,0,0)
+ g_object_unref(cursor);
+#else
+ gdk_cursor_unref(cursor);
+#endif
+}
+
+void ScintillaGTK::RealizeThis(GtkWidget *widget) {
+ //Platform::DebugPrintf("ScintillaGTK::realize this\n");
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_realized(widget, TRUE);
+#else
+ GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
+#endif
+ GdkWindowAttr attrs;
+ attrs.window_type = GDK_WINDOW_CHILD;
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_allocation(widget, &allocation);
+#else
+ allocation = widget->allocation;
+#endif
+ attrs.x = allocation.x;
+ attrs.y = allocation.y;
+ attrs.width = allocation.width;
+ attrs.height = allocation.height;
+ attrs.wclass = GDK_INPUT_OUTPUT;
+ attrs.visual = gtk_widget_get_visual(widget);
+#if !GTK_CHECK_VERSION(3,0,0)
+ attrs.colormap = gtk_widget_get_colormap(widget);
+#endif
+ attrs.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK;
+ GdkCursor *cursor = gdk_cursor_new(GDK_XTERM);
+ attrs.cursor = cursor;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_window(widget, gdk_window_new(gtk_widget_get_parent_window(widget), &attrs,
+ GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_CURSOR));
+ gdk_window_set_user_data(gtk_widget_get_window(widget), widget);
+ GtkStyleContext *styleContext = gtk_widget_get_style_context(widget);
+ if (styleContext) {
+ GdkRGBA colourBackWidget;
+ gtk_style_context_get_background_color(styleContext, GTK_STATE_FLAG_NORMAL, &colourBackWidget);
+ gdk_window_set_background_rgba(gtk_widget_get_window(widget), &colourBackWidget);
+ }
+ gdk_window_show(gtk_widget_get_window(widget));
+ UnRefCursor(cursor);
+#else
+ widget->window = gdk_window_new(gtk_widget_get_parent_window(widget), &attrs,
+ GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP | GDK_WA_CURSOR);
+ gdk_window_set_user_data(widget->window, widget);
+ widget->style = gtk_style_attach(widget->style, widget->window);
+ gdk_window_set_background(widget->window, &widget->style->bg[GTK_STATE_NORMAL]);
+ gdk_window_show(widget->window);
+ UnRefCursor(cursor);
+#endif
+ gtk_widget_realize(PWidget(wPreedit));
+ gtk_widget_realize(PWidget(wPreeditDraw));
+
+ im_context = gtk_im_multicontext_new();
+ g_signal_connect(G_OBJECT(im_context), "commit",
+ G_CALLBACK(Commit), this);
+ g_signal_connect(G_OBJECT(im_context), "preedit_changed",
+ G_CALLBACK(PreeditChanged), this);
+ gtk_im_context_set_client_window(im_context, WindowFromWidget(widget));
+ GtkWidget *widtxt = PWidget(wText); // // No code inside the G_OBJECT macro
+ g_signal_connect_after(G_OBJECT(widtxt), "style_set",
+ G_CALLBACK(ScintillaGTK::StyleSetText), NULL);
+ g_signal_connect_after(G_OBJECT(widtxt), "realize",
+ G_CALLBACK(ScintillaGTK::RealizeText), NULL);
+ gtk_widget_realize(widtxt);
+ gtk_widget_realize(PWidget(scrollbarv));
+ gtk_widget_realize(PWidget(scrollbarh));
+
+ cursor = gdk_cursor_new(GDK_XTERM);
+ gdk_window_set_cursor(PWindow(wText), cursor);
+ UnRefCursor(cursor);
+
+ cursor = gdk_cursor_new(GDK_LEFT_PTR);
+ gdk_window_set_cursor(PWindow(scrollbarv), cursor);
+ UnRefCursor(cursor);
+
+ cursor = gdk_cursor_new(GDK_LEFT_PTR);
+ gdk_window_set_cursor(PWindow(scrollbarh), cursor);
+ UnRefCursor(cursor);
+
+ gtk_selection_add_targets(widget, GDK_SELECTION_PRIMARY,
+ clipboardCopyTargets, nClipboardCopyTargets);
+}
+
+void ScintillaGTK::Realize(GtkWidget *widget) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ sciThis->RealizeThis(widget);
+}
+
+void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
+ try {
+ gtk_selection_clear_targets(widget, GDK_SELECTION_PRIMARY);
+
+ if (IS_WIDGET_MAPPED(widget)) {
+ gtk_widget_unmap(widget);
+ }
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_realized(widget, FALSE);
+#else
+ GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);
+#endif
+ gtk_widget_unrealize(PWidget(wText));
+ gtk_widget_unrealize(PWidget(scrollbarv));
+ gtk_widget_unrealize(PWidget(scrollbarh));
+ gtk_widget_unrealize(PWidget(wPreedit));
+ gtk_widget_unrealize(PWidget(wPreeditDraw));
+ g_object_unref(im_context);
+ im_context = NULL;
+ if (GTK_WIDGET_CLASS(parentClass)->unrealize)
+ GTK_WIDGET_CLASS(parentClass)->unrealize(widget);
+
+ Finalise();
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::UnRealize(GtkWidget *widget) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ sciThis->UnRealizeThis(widget);
+}
+
+static void MapWidget(GtkWidget *widget) {
+ if (widget &&
+ IS_WIDGET_VISIBLE(widget) &&
+ !IS_WIDGET_MAPPED(widget)) {
+ gtk_widget_map(widget);
+ }
+}
+
+void ScintillaGTK::MapThis() {
+ try {
+ //Platform::DebugPrintf("ScintillaGTK::map this\n");
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_mapped(PWidget(wMain), TRUE);
+#else
+ GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_MAPPED);
+#endif
+ MapWidget(PWidget(wText));
+ MapWidget(PWidget(scrollbarh));
+ MapWidget(PWidget(scrollbarv));
+ wMain.SetCursor(Window::cursorArrow);
+ scrollbarv.SetCursor(Window::cursorArrow);
+ scrollbarh.SetCursor(Window::cursorArrow);
+ ChangeSize();
+ gdk_window_show(PWindow(wMain));
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::Map(GtkWidget *widget) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ sciThis->MapThis();
+}
+
+void ScintillaGTK::UnMapThis() {
+ try {
+ //Platform::DebugPrintf("ScintillaGTK::unmap this\n");
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_mapped(PWidget(wMain), FALSE);
+#else
+ GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED);
+#endif
+ DropGraphics(false);
+ gdk_window_hide(PWindow(wMain));
+ gtk_widget_unmap(PWidget(wText));
+ gtk_widget_unmap(PWidget(scrollbarh));
+ gtk_widget_unmap(PWidget(scrollbarv));
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::UnMap(GtkWidget *widget) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ sciThis->UnMapThis();
+}
+
+void ScintillaGTK::ForAll(GtkCallback callback, gpointer callback_data) {
+ try {
+ (*callback) (PWidget(wText), callback_data);
+ (*callback) (PWidget(scrollbarv), callback_data);
+ (*callback) (PWidget(scrollbarh), callback_data);
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) {
+ ScintillaGTK *sciThis = ScintillaFromWidget((GtkWidget *)container);
+
+ if (callback != NULL && include_internals) {
+ sciThis->ForAll(callback, callback_data);
+ }
+}
+
+namespace {
+
+class PreEditString {
+public:
+ gchar *str;
+ gint cursor_pos;
+ PangoAttrList *attrs;
+ gboolean validUTF8;
+ glong uniStrLen;
+ gunichar *uniStr;
+ PangoScript pscript;
+
+ explicit PreEditString(GtkIMContext *im_context) {
+ gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor_pos);
+ validUTF8 = g_utf8_validate(str, strlen(str), NULL);
+ uniStr = g_utf8_to_ucs4_fast(str, strlen(str), &uniStrLen);
+ pscript = pango_script_for_unichar(uniStr[0]);
+ }
+ ~PreEditString() {
+ g_free(str);
+ g_free(uniStr);
+ pango_attr_list_unref(attrs);
+ }
+};
+
+}
+
+gint ScintillaGTK::FocusInThis(GtkWidget *widget) {
+ try {
+ SetFocusState(true);
+ if (im_context != NULL) {
+ PreEditString pes(im_context);
+ if (PWidget(wPreedit) != NULL) {
+ if (strlen(pes.str) > 0) {
+ gtk_widget_show(PWidget(wPreedit));
+ } else {
+ gtk_widget_hide(PWidget(wPreedit));
+ }
+ }
+ gtk_im_context_focus_in(im_context);
+ }
+
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gint ScintillaGTK::FocusIn(GtkWidget *widget, GdkEventFocus * /*event*/) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->FocusInThis(widget);
+}
+
+gint ScintillaGTK::FocusOutThis(GtkWidget *widget) {
+ try {
+ SetFocusState(false);
+
+ if (PWidget(wPreedit) != NULL)
+ gtk_widget_hide(PWidget(wPreedit));
+ if (im_context != NULL)
+ gtk_im_context_focus_out(im_context);
+
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gint ScintillaGTK::FocusOut(GtkWidget *widget, GdkEventFocus * /*event*/) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->FocusOutThis(widget);
+}
+
+void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ requisition->width = 1;
+ requisition->height = 1;
+ GtkRequisition child_requisition;
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_get_preferred_size(PWidget(sciThis->scrollbarh), NULL, &child_requisition);
+ gtk_widget_get_preferred_size(PWidget(sciThis->scrollbarv), NULL, &child_requisition);
+#else
+ gtk_widget_size_request(PWidget(sciThis->scrollbarh), &child_requisition);
+ gtk_widget_size_request(PWidget(sciThis->scrollbarv), &child_requisition);
+#endif
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+
+void ScintillaGTK::GetPreferredWidth(GtkWidget *widget, gint *minimalWidth, gint *naturalWidth) {
+ GtkRequisition requisition;
+ SizeRequest(widget, &requisition);
+ *minimalWidth = *naturalWidth = requisition.width;
+}
+
+void ScintillaGTK::GetPreferredHeight(GtkWidget *widget, gint *minimalHeight, gint *naturalHeight) {
+ GtkRequisition requisition;
+ SizeRequest(widget, &requisition);
+ *minimalHeight = *naturalHeight = requisition.height;
+}
+
+#endif
+
+void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_allocation(widget, allocation);
+#else
+ widget->allocation = *allocation;
+#endif
+ if (IS_WIDGET_REALIZED(widget))
+ gdk_window_move_resize(WindowFromWidget(widget),
+ allocation->x,
+ allocation->y,
+ allocation->width,
+ allocation->height);
+
+ sciThis->Resize(allocation->width, allocation->height);
+
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::Initialise() {
+ //Platform::DebugPrintf("ScintillaGTK::Initialise\n");
+ parentClass = reinterpret_cast<GtkWidgetClass *>(
+ g_type_class_ref(gtk_container_get_type()));
+
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_can_focus(PWidget(wMain), TRUE);
+ gtk_widget_set_sensitive(PWidget(wMain), TRUE);
+#else
+ GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS(GTK_WIDGET(PWidget(wMain)), GTK_SENSITIVE);
+#endif
+ gtk_widget_set_events(PWidget(wMain),
+ GDK_EXPOSURE_MASK
+ | GDK_SCROLL_MASK
+ | GDK_STRUCTURE_MASK
+ | GDK_KEY_PRESS_MASK
+ | GDK_KEY_RELEASE_MASK
+ | GDK_FOCUS_CHANGE_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_BUTTON_RELEASE_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_POINTER_MOTION_HINT_MASK);
+
+ wText = gtk_drawing_area_new();
+ gtk_widget_set_parent(PWidget(wText), PWidget(wMain));
+ GtkWidget *widtxt = PWidget(wText); // No code inside the G_OBJECT macro
+ gtk_widget_show(widtxt);
+#if GTK_CHECK_VERSION(3,0,0)
+ g_signal_connect(G_OBJECT(widtxt), "draw",
+ G_CALLBACK(ScintillaGTK::DrawText), this);
+#else
+ g_signal_connect(G_OBJECT(widtxt), "expose_event",
+ G_CALLBACK(ScintillaGTK::ExposeText), this);
+#endif
+#if GTK_CHECK_VERSION(3,0,0)
+ // we need a runtime check because we don't want double buffering when
+ // running on >= 3.9.2
+ if (gtk_check_version(3,9,2) != NULL /* on < 3.9.2 */)
+#endif
+ {
+#if !GTK_CHECK_VERSION(3,14,0)
+ // Avoid background drawing flash/missing redraws
+ gtk_widget_set_double_buffered(widtxt, FALSE);
+#endif
+ }
+ gtk_widget_set_events(widtxt, GDK_EXPOSURE_MASK);
+ gtk_widget_set_size_request(widtxt, 100, 100);
+ adjustmentv = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 201.0, 1.0, 20.0, 20.0));
+#if GTK_CHECK_VERSION(3,0,0)
+ scrollbarv = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(adjustmentv));
+#else
+ scrollbarv = gtk_vscrollbar_new(GTK_ADJUSTMENT(adjustmentv));
+#endif
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_can_focus(PWidget(scrollbarv), FALSE);
+#else
+ GTK_WIDGET_UNSET_FLAGS(PWidget(scrollbarv), GTK_CAN_FOCUS);
+#endif
+ g_signal_connect(G_OBJECT(adjustmentv), "value_changed",
+ G_CALLBACK(ScrollSignal), this);
+ gtk_widget_set_parent(PWidget(scrollbarv), PWidget(wMain));
+ gtk_widget_show(PWidget(scrollbarv));
+
+ adjustmenth = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 101.0, 1.0, 20.0, 20.0));
+#if GTK_CHECK_VERSION(3,0,0)
+ scrollbarh = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT(adjustmenth));
+#else
+ scrollbarh = gtk_hscrollbar_new(GTK_ADJUSTMENT(adjustmenth));
+#endif
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_can_focus(PWidget(scrollbarh), FALSE);
+#else
+ GTK_WIDGET_UNSET_FLAGS(PWidget(scrollbarh), GTK_CAN_FOCUS);
+#endif
+ g_signal_connect(G_OBJECT(adjustmenth), "value_changed",
+ G_CALLBACK(ScrollHSignal), this);
+ gtk_widget_set_parent(PWidget(scrollbarh), PWidget(wMain));
+ gtk_widget_show(PWidget(scrollbarh));
+
+ gtk_widget_grab_focus(PWidget(wMain));
+
+ gtk_drag_dest_set(GTK_WIDGET(PWidget(wMain)),
+ GTK_DEST_DEFAULT_ALL, clipboardPasteTargets, nClipboardPasteTargets,
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE));
+
+ /* create pre-edit window */
+ wPreedit = gtk_window_new(GTK_WINDOW_POPUP);
+ wPreeditDraw = gtk_drawing_area_new();
+ GtkWidget *predrw = PWidget(wPreeditDraw); // No code inside the G_OBJECT macro
+#if GTK_CHECK_VERSION(3,0,0)
+ g_signal_connect(G_OBJECT(predrw), "draw",
+ G_CALLBACK(DrawPreedit), this);
+#else
+ g_signal_connect(G_OBJECT(predrw), "expose_event",
+ G_CALLBACK(ExposePreedit), this);
+#endif
+ gtk_container_add(GTK_CONTAINER(PWidget(wPreedit)), predrw);
+ gtk_widget_show(predrw);
+
+ // Set caret period based on GTK settings
+ gboolean blinkOn = false;
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(
+ G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink")) {
+ g_object_get(G_OBJECT(
+ gtk_settings_get_default()), "gtk-cursor-blink", &blinkOn, NULL);
+ }
+ if (blinkOn &&
+ g_object_class_find_property(G_OBJECT_GET_CLASS(
+ G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink-time")) {
+ gint value;
+ g_object_get(G_OBJECT(
+ gtk_settings_get_default()), "gtk-cursor-blink-time", &value, NULL);
+ caret.period = gint(value / 1.75);
+ } else {
+ caret.period = 0;
+ }
+
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ timers[tr].reason = tr;
+ timers[tr].scintilla = this;
+ }
+ vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourDesired(0, 0, 0xff));
+}
+
+void ScintillaGTK::Finalise() {
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ FineTickerCancel(tr);
+ }
+ ScintillaBase::Finalise();
+}
+
+bool ScintillaGTK::AbandonPaint() {
+ if ((paintState == painting) && !paintingAllText) {
+ repaintFullWindow = true;
+ }
+ return false;
+}
+
+void ScintillaGTK::DisplayCursor(Window::Cursor c) {
+ if (cursorMode == SC_CURSORNORMAL)
+ wText.SetCursor(c);
+ else
+ wText.SetCursor(static_cast<Window::Cursor>(cursorMode));
+}
+
+bool ScintillaGTK::DragThreshold(Point ptStart, Point ptNow) {
+ return gtk_drag_check_threshold(GTK_WIDGET(PWidget(wMain)),
+ ptStart.x, ptStart.y, ptNow.x, ptNow.y);
+}
+
+void ScintillaGTK::StartDrag() {
+ PLATFORM_ASSERT(evbtn != 0);
+ dragWasDropped = false;
+ inDragDrop = ddDragging;
+ GtkTargetList *tl = gtk_target_list_new(clipboardCopyTargets, nClipboardCopyTargets);
+#if GTK_CHECK_VERSION(3,10,0)
+ gtk_drag_begin_with_coordinates(GTK_WIDGET(PWidget(wMain)),
+ tl,
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE),
+ evbtn->button,
+ reinterpret_cast<GdkEvent *>(evbtn),
+ -1, -1);
+#else
+ gtk_drag_begin(GTK_WIDGET(PWidget(wMain)),
+ tl,
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE),
+ evbtn->button,
+ reinterpret_cast<GdkEvent *>(evbtn));
+#endif
+}
+
+static std::string ConvertText(const char *s, size_t len, const char *charSetDest,
+ const char *charSetSource, bool transliterations, bool silent=false) {
+ // s is not const because of different versions of iconv disagreeing about const
+ std::string destForm;
+ Converter conv(charSetDest, charSetSource, transliterations);
+ if (conv) {
+ size_t outLeft = len*3+1;
+ destForm = std::string(outLeft, '\0');
+ // g_iconv does not actually write to its input argument so safe to cast away const
+ char *pin = const_cast<char *>(s);
+ size_t inLeft = len;
+ char *putf = &destForm[0];
+ char *pout = putf;
+ size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft);
+ if (conversions == ((size_t)(-1))) {
+ if (!silent) {
+ if (len == 1)
+ fprintf(stderr, "iconv %s->%s failed for %0x '%s'\n",
+ charSetSource, charSetDest, (unsigned char)(*s), s);
+ else
+ fprintf(stderr, "iconv %s->%s failed for %s\n",
+ charSetSource, charSetDest, s);
+ }
+ destForm = std::string();
+ } else {
+ destForm.resize(pout - putf);
+ }
+ } else {
+ fprintf(stderr, "Can not iconv %s %s\n", charSetDest, charSetSource);
+ }
+ return destForm;
+}
+
+// Returns the target converted to UTF8.
+// Return the length in bytes.
+int ScintillaGTK::TargetAsUTF8(char *text) {
+ int targetLength = targetEnd - targetStart;
+ if (IsUnicodeMode()) {
+ if (text) {
+ pdoc->GetCharRange(text, targetStart, targetLength);
+ }
+ } else {
+ // Need to convert
+ const char *charSetBuffer = CharacterSetID();
+ if (*charSetBuffer) {
+ std::string s = RangeText(targetStart, targetEnd);
+ std::string tmputf = ConvertText(&s[0], targetLength, "UTF-8", charSetBuffer, false);
+ if (text) {
+ memcpy(text, tmputf.c_str(), tmputf.length());
+ }
+ return tmputf.length();
+ } else {
+ if (text) {
+ pdoc->GetCharRange(text, targetStart, targetLength);
+ }
+ }
+ }
+ return targetLength;
+}
+
+// Translates a nul terminated UTF8 string into the document encoding.
+// Return the length of the result in bytes.
+int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) const {
+ int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8);
+ if (IsUnicodeMode()) {
+ if (encoded) {
+ memcpy(encoded, utf8, inputLength);
+ }
+ return inputLength;
+ } else {
+ // Need to convert
+ const char *charSetBuffer = CharacterSetID();
+ if (*charSetBuffer) {
+ std::string tmpEncoded = ConvertText(utf8, inputLength, charSetBuffer, "UTF-8", true);
+ if (encoded) {
+ memcpy(encoded, tmpEncoded.c_str(), tmpEncoded.length());
+ }
+ return tmpEncoded.length();
+ } else {
+ if (encoded) {
+ memcpy(encoded, utf8, inputLength);
+ }
+ return inputLength;
+ }
+ }
+ // Fail
+ return 0;
+}
+
+bool ScintillaGTK::ValidCodePage(int codePage) const {
+ return codePage == 0
+ || codePage == SC_CP_UTF8
+ || codePage == 932
+ || codePage == 936
+ || codePage == 949
+ || codePage == 950
+ || codePage == 1361;
+}
+
+sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ try {
+ switch (iMessage) {
+
+ case SCI_GRABFOCUS:
+ gtk_widget_grab_focus(PWidget(wMain));
+ break;
+
+ case SCI_GETDIRECTFUNCTION:
+ return reinterpret_cast<sptr_t>(DirectFunction);
+
+ case SCI_GETDIRECTPOINTER:
+ return reinterpret_cast<sptr_t>(this);
+
+#ifdef SCI_LEXER
+ case SCI_LOADLEXERLIBRARY:
+ LexerManager::GetInstance()->Load(reinterpret_cast<const char*>(lParam));
+ break;
+#endif
+ case SCI_TARGETASUTF8:
+ return TargetAsUTF8(reinterpret_cast<char*>(lParam));
+
+ case SCI_ENCODEDFROMUTF8:
+ return EncodedFromUTF8(reinterpret_cast<char*>(wParam),
+ reinterpret_cast<char*>(lParam));
+
+ case SCI_SETRECTANGULARSELECTIONMODIFIER:
+ rectangularSelectionModifier = wParam;
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONMODIFIER:
+ return rectangularSelectionModifier;
+
+ default:
+ return ScintillaBase::WndProc(iMessage, wParam, lParam);
+ }
+ } catch (std::bad_alloc&) {
+ errorStatus = SC_STATUS_BADALLOC;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return 0l;
+}
+
+sptr_t ScintillaGTK::DefWndProc(unsigned int, uptr_t, sptr_t) {
+ return 0;
+}
+
+/**
+* Report that this Editor subclass has a working implementation of FineTickerStart.
+*/
+bool ScintillaGTK::FineTickerAvailable() {
+ return true;
+}
+
+bool ScintillaGTK::FineTickerRunning(TickReason reason) {
+ return timers[reason].timer != 0;
+}
+
+void ScintillaGTK::FineTickerStart(TickReason reason, int millis, int /* tolerance */) {
+ FineTickerCancel(reason);
+ timers[reason].timer = g_timeout_add(millis, reinterpret_cast<GSourceFunc>(TimeOut), &timers[reason]);
+}
+
+void ScintillaGTK::FineTickerCancel(TickReason reason) {
+ if (timers[reason].timer) {
+ g_source_remove(timers[reason].timer);
+ timers[reason].timer = 0;
+ }
+}
+
+bool ScintillaGTK::SetIdle(bool on) {
+ if (on) {
+ // Start idler, if it's not running.
+ if (!idler.state) {
+ idler.state = true;
+ idler.idlerID = reinterpret_cast<IdlerID>(
+ g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
+ reinterpret_cast<GSourceFunc>(IdleCallback), this, NULL));
+ }
+ } else {
+ // Stop idler, if it's running
+ if (idler.state) {
+ idler.state = false;
+ g_source_remove(GPOINTER_TO_UINT(idler.idlerID));
+ }
+ }
+ return true;
+}
+
+void ScintillaGTK::SetMouseCapture(bool on) {
+ if (mouseDownCaptures) {
+ if (on) {
+ gtk_grab_add(GTK_WIDGET(PWidget(wMain)));
+ } else {
+ gtk_grab_remove(GTK_WIDGET(PWidget(wMain)));
+ }
+ }
+ capturedMouse = on;
+}
+
+bool ScintillaGTK::HaveMouseCapture() {
+ return capturedMouse;
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+
+// Is crcTest completely in crcContainer?
+static bool CRectContains(const cairo_rectangle_t &crcContainer, const cairo_rectangle_t &crcTest) {
+ return
+ (crcTest.x >= crcContainer.x) && ((crcTest.x + crcTest.width) <= (crcContainer.x + crcContainer.width)) &&
+ (crcTest.y >= crcContainer.y) && ((crcTest.y + crcTest.height) <= (crcContainer.y + crcContainer.height));
+}
+
+// Is crcTest completely in crcListContainer?
+// May incorrectly return false if complex shape
+static bool CRectListContains(const cairo_rectangle_list_t *crcListContainer, const cairo_rectangle_t &crcTest) {
+ for (int r=0; r<crcListContainer->num_rectangles; r++) {
+ if (CRectContains(crcListContainer->rectangles[r], crcTest))
+ return true;
+ }
+ return false;
+}
+
+#endif
+
+bool ScintillaGTK::PaintContains(PRectangle rc) {
+ // This allows optimization when a rectangle is completely in the update region.
+ // It is OK to return false when too difficult to determine as that just performs extra drawing
+ bool contains = true;
+ if (paintState == painting) {
+ if (!rcPaint.Contains(rc)) {
+ contains = false;
+ } else if (rgnUpdate) {
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_rectangle_t grc = {rc.left, rc.top,
+ rc.right - rc.left, rc.bottom - rc.top};
+ contains = CRectListContains(rgnUpdate, grc);
+#else
+ GdkRectangle grc = {static_cast<gint>(rc.left), static_cast<gint>(rc.top),
+ static_cast<gint>(rc.right - rc.left), static_cast<gint>(rc.bottom - rc.top)};
+ if (gdk_region_rect_in(rgnUpdate, &grc) != GDK_OVERLAP_RECTANGLE_IN) {
+ contains = false;
+ }
+#endif
+ }
+ }
+ return contains;
+}
+
+// Redraw all of text area. This paint will not be abandoned.
+void ScintillaGTK::FullPaint() {
+ wText.InvalidateAll();
+}
+
+PRectangle ScintillaGTK::GetClientRectangle() const {
+ Window &win = const_cast<Window &>(wMain);
+ PRectangle rc = win.GetClientPosition();
+ if (verticalScrollBarVisible)
+ rc.right -= verticalScrollBarWidth;
+ if (horizontalScrollBarVisible && !Wrapping())
+ rc.bottom -= horizontalScrollBarHeight;
+ // Move to origin
+ rc.right -= rc.left;
+ rc.bottom -= rc.top;
+ rc.left = 0;
+ rc.top = 0;
+ return rc;
+}
+
+void ScintillaGTK::ScrollText(int linesToMove) {
+ int diff = vs.lineHeight * -linesToMove;
+ //Platform::DebugPrintf("ScintillaGTK::ScrollText %d %d %0d,%0d %0d,%0d\n", linesToMove, diff,
+ // rc.left, rc.top, rc.right, rc.bottom);
+ GtkWidget *wi = PWidget(wText);
+ NotifyUpdateUI();
+
+ if (IS_WIDGET_REALIZED(wi)) {
+ gdk_window_scroll(WindowFromWidget(wi), 0, -diff);
+ gdk_window_process_updates(WindowFromWidget(wi), FALSE);
+ }
+}
+
+void ScintillaGTK::SetVerticalScrollPos() {
+ DwellEnd(true);
+ gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmentv), topLine);
+}
+
+void ScintillaGTK::SetHorizontalScrollPos() {
+ DwellEnd(true);
+ gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmenth), xOffset);
+}
+
+bool ScintillaGTK::ModifyScrollBars(int nMax, int nPage) {
+ bool modified = false;
+ int pageScroll = LinesToScroll();
+
+#if GTK_CHECK_VERSION(3,0,0)
+ if (gtk_adjustment_get_upper(adjustmentv) != (nMax + 1) ||
+ gtk_adjustment_get_page_size(adjustmentv) != nPage ||
+ gtk_adjustment_get_page_increment(adjustmentv) != pageScroll) {
+ gtk_adjustment_set_upper(adjustmentv, nMax + 1);
+ gtk_adjustment_set_page_size(adjustmentv, nPage);
+ gtk_adjustment_set_page_increment(adjustmentv, pageScroll);
+ gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmentv));
+ modified = true;
+ }
+#else
+ if (GTK_ADJUSTMENT(adjustmentv)->upper != (nMax + 1) ||
+ GTK_ADJUSTMENT(adjustmentv)->page_size != nPage ||
+ GTK_ADJUSTMENT(adjustmentv)->page_increment != pageScroll) {
+ GTK_ADJUSTMENT(adjustmentv)->upper = nMax + 1;
+ GTK_ADJUSTMENT(adjustmentv)->page_size = nPage;
+ GTK_ADJUSTMENT(adjustmentv)->page_increment = pageScroll;
+ gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmentv));
+ modified = true;
+ }
+#endif
+
+ PRectangle rcText = GetTextRectangle();
+ int horizEndPreferred = scrollWidth;
+ if (horizEndPreferred < 0)
+ horizEndPreferred = 0;
+ unsigned int pageWidth = rcText.Width();
+ unsigned int pageIncrement = pageWidth / 3;
+ unsigned int charWidth = vs.styles[STYLE_DEFAULT].aveCharWidth;
+#if GTK_CHECK_VERSION(3,0,0)
+ if (gtk_adjustment_get_upper(adjustmenth) != horizEndPreferred ||
+ gtk_adjustment_get_page_size(adjustmenth) != pageWidth ||
+ gtk_adjustment_get_page_increment(adjustmenth) != pageIncrement ||
+ gtk_adjustment_get_step_increment(adjustmenth) != charWidth) {
+ gtk_adjustment_set_upper(adjustmenth, horizEndPreferred);
+ gtk_adjustment_set_page_size(adjustmenth, pageWidth);
+ gtk_adjustment_set_page_increment(adjustmenth, pageIncrement);
+ gtk_adjustment_set_step_increment(adjustmenth, charWidth);
+ gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth));
+ modified = true;
+ }
+#else
+ if (GTK_ADJUSTMENT(adjustmenth)->upper != horizEndPreferred ||
+ GTK_ADJUSTMENT(adjustmenth)->page_size != pageWidth ||
+ GTK_ADJUSTMENT(adjustmenth)->page_increment != pageIncrement ||
+ GTK_ADJUSTMENT(adjustmenth)->step_increment != charWidth) {
+ GTK_ADJUSTMENT(adjustmenth)->upper = horizEndPreferred;
+ GTK_ADJUSTMENT(adjustmenth)->step_increment = charWidth;
+ GTK_ADJUSTMENT(adjustmenth)->page_size = pageWidth;
+ GTK_ADJUSTMENT(adjustmenth)->page_increment = pageIncrement;
+ gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth));
+ modified = true;
+ }
+#endif
+ if (modified && (paintState == painting)) {
+ repaintFullWindow = true;
+ }
+
+ return modified;
+}
+
+void ScintillaGTK::ReconfigureScrollBars() {
+ PRectangle rc = wMain.GetClientPosition();
+ Resize(rc.Width(), rc.Height());
+}
+
+void ScintillaGTK::NotifyChange() {
+ g_signal_emit(G_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], 0,
+ Platform::LongFromTwoShorts(GetCtrlID(), SCEN_CHANGE), PWidget(wMain));
+}
+
+void ScintillaGTK::NotifyFocus(bool focus) {
+ g_signal_emit(G_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], 0,
+ Platform::LongFromTwoShorts
+ (GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), PWidget(wMain));
+ Editor::NotifyFocus(focus);
+}
+
+void ScintillaGTK::NotifyParent(SCNotification scn) {
+ scn.nmhdr.hwndFrom = PWidget(wMain);
+ scn.nmhdr.idFrom = GetCtrlID();
+ g_signal_emit(G_OBJECT(sci), scintilla_signals[NOTIFY_SIGNAL], 0,
+ GetCtrlID(), &scn);
+}
+
+void ScintillaGTK::NotifyKey(int key, int modifiers) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_KEY;
+ scn.ch = key;
+ scn.modifiers = modifiers;
+
+ NotifyParent(scn);
+}
+
+void ScintillaGTK::NotifyURIDropped(const char *list) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_URIDROPPED;
+ scn.text = list;
+
+ NotifyParent(scn);
+}
+
+const char *CharacterSetID(int characterSet);
+
+const char *ScintillaGTK::CharacterSetID() const {
+ return ::CharacterSetID(vs.styles[STYLE_DEFAULT].characterSet);
+}
+
+class CaseFolderDBCS : public CaseFolderTable {
+ const char *charSet;
+public:
+ explicit CaseFolderDBCS(const char *charSet_) : charSet(charSet_) {
+ StandardASCII();
+ }
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if ((lenMixed == 1) && (sizeFolded > 0)) {
+ folded[0] = mapping[static_cast<unsigned char>(mixed[0])];
+ return 1;
+ } else if (*charSet) {
+ std::string sUTF8 = ConvertText(mixed, lenMixed,
+ "UTF-8", charSet, false);
+ if (!sUTF8.empty()) {
+ gchar *mapped = g_utf8_casefold(sUTF8.c_str(), sUTF8.length());
+ size_t lenMapped = strlen(mapped);
+ if (lenMapped < sizeFolded) {
+ memcpy(folded, mapped, lenMapped);
+ } else {
+ folded[0] = '\0';
+ lenMapped = 1;
+ }
+ g_free(mapped);
+ return lenMapped;
+ }
+ }
+ // Something failed so return a single NUL byte
+ folded[0] = '\0';
+ return 1;
+ }
+};
+
+CaseFolder *ScintillaGTK::CaseFolderForEncoding() {
+ if (pdoc->dbcsCodePage == SC_CP_UTF8) {
+ return new CaseFolderUnicode();
+ } else {
+ const char *charSetBuffer = CharacterSetID();
+ if (charSetBuffer) {
+ if (pdoc->dbcsCodePage == 0) {
+ CaseFolderTable *pcf = new CaseFolderTable();
+ pcf->StandardASCII();
+ // Only for single byte encodings
+ for (int i=0x80; i<0x100; i++) {
+ char sCharacter[2] = "A";
+ sCharacter[0] = i;
+ // Silent as some bytes have no assigned character
+ std::string sUTF8 = ConvertText(sCharacter, 1,
+ "UTF-8", charSetBuffer, false, true);
+ if (!sUTF8.empty()) {
+ gchar *mapped = g_utf8_casefold(sUTF8.c_str(), sUTF8.length());
+ if (mapped) {
+ std::string mappedBack = ConvertText(mapped, strlen(mapped),
+ charSetBuffer, "UTF-8", false, true);
+ if ((mappedBack.length() == 1) && (mappedBack[0] != sCharacter[0])) {
+ pcf->SetTranslation(sCharacter[0], mappedBack[0]);
+ }
+ g_free(mapped);
+ }
+ }
+ }
+ return pcf;
+ } else {
+ return new CaseFolderDBCS(charSetBuffer);
+ }
+ }
+ return 0;
+ }
+}
+
+namespace {
+
+struct CaseMapper {
+ gchar *mapped; // Must be freed with g_free
+ CaseMapper(const std::string &sUTF8, bool toUpperCase) {
+ if (toUpperCase) {
+ mapped = g_utf8_strup(sUTF8.c_str(), sUTF8.length());
+ } else {
+ mapped = g_utf8_strdown(sUTF8.c_str(), sUTF8.length());
+ }
+ }
+ ~CaseMapper() {
+ g_free(mapped);
+ }
+};
+
+}
+
+std::string ScintillaGTK::CaseMapString(const std::string &s, int caseMapping) {
+ if ((s.size() == 0) || (caseMapping == cmSame))
+ return s;
+
+ if (IsUnicodeMode()) {
+ std::string retMapped(s.length() * maxExpansionCaseConversion, 0);
+ size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(),
+ (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower);
+ retMapped.resize(lenMapped);
+ return retMapped;
+ }
+
+ const char *charSetBuffer = CharacterSetID();
+
+ if (!*charSetBuffer) {
+ CaseMapper mapper(s, caseMapping == cmUpper);
+ return std::string(mapper.mapped, strlen(mapper.mapped));
+ } else {
+ // Change text to UTF-8
+ std::string sUTF8 = ConvertText(s.c_str(), s.length(),
+ "UTF-8", charSetBuffer, false);
+ CaseMapper mapper(sUTF8, caseMapping == cmUpper);
+ return ConvertText(mapper.mapped, strlen(mapper.mapped), charSetBuffer, "UTF-8", false);
+ }
+}
+
+int ScintillaGTK::KeyDefault(int key, int modifiers) {
+ // Pass up to container in case it is an accelerator
+ NotifyKey(key, modifiers);
+ return 0;
+}
+
+void ScintillaGTK::CopyToClipboard(const SelectionText &selectedText) {
+ SelectionText *clipText = new SelectionText();
+ clipText->Copy(selectedText);
+ StoreOnClipboard(clipText);
+}
+
+void ScintillaGTK::Copy() {
+ if (!sel.Empty()) {
+ SelectionText *clipText = new SelectionText();
+ CopySelectionRange(clipText);
+ StoreOnClipboard(clipText);
+#if PLAT_GTK_WIN32
+ if (sel.IsRectangular()) {
+ ::OpenClipboard(NULL);
+ ::SetClipboardData(cfColumnSelect, 0);
+ ::CloseClipboard();
+ }
+#endif
+ }
+}
+
+void ScintillaGTK::ClipboardReceived(GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) {
+ ScintillaGTK *sciThis = static_cast<ScintillaGTK *>(data);
+ sciThis->ReceivedSelection(selection_data);
+}
+
+void ScintillaGTK::Paste() {
+ atomSought = atomUTF8;
+ GtkClipboard *clipBoard =
+ gtk_widget_get_clipboard(GTK_WIDGET(PWidget(wMain)), atomClipboard);
+ if (clipBoard == NULL)
+ return;
+ gtk_clipboard_request_contents(clipBoard, atomSought, ClipboardReceived, this);
+}
+
+void ScintillaGTK::CreateCallTipWindow(PRectangle rc) {
+ if (!ct.wCallTip.Created()) {
+ ct.wCallTip = gtk_window_new(GTK_WINDOW_POPUP);
+ ct.wDraw = gtk_drawing_area_new();
+ GtkWidget *widcdrw = PWidget(ct.wDraw); // // No code inside the G_OBJECT macro
+ gtk_container_add(GTK_CONTAINER(PWidget(ct.wCallTip)), widcdrw);
+#if GTK_CHECK_VERSION(3,0,0)
+ g_signal_connect(G_OBJECT(widcdrw), "draw",
+ G_CALLBACK(ScintillaGTK::DrawCT), &ct);
+#else
+ g_signal_connect(G_OBJECT(widcdrw), "expose_event",
+ G_CALLBACK(ScintillaGTK::ExposeCT), &ct);
+#endif
+ g_signal_connect(G_OBJECT(widcdrw), "button_press_event",
+ G_CALLBACK(ScintillaGTK::PressCT), static_cast<void *>(this));
+ gtk_widget_set_events(widcdrw,
+ GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
+ }
+ gtk_widget_set_size_request(PWidget(ct.wDraw), rc.Width(), rc.Height());
+ ct.wDraw.Show();
+ if (PWindow(ct.wCallTip)) {
+ gdk_window_resize(PWindow(ct.wCallTip), rc.Width(), rc.Height());
+ }
+}
+
+void ScintillaGTK::AddToPopUp(const char *label, int cmd, bool enabled) {
+ GtkWidget *menuItem;
+ if (label[0])
+ menuItem = gtk_menu_item_new_with_label(label);
+ else
+ menuItem = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(popup.GetID()), menuItem);
+ g_object_set_data(G_OBJECT(menuItem), "CmdNum", reinterpret_cast<void *>(cmd));
+ g_signal_connect(G_OBJECT(menuItem),"activate", G_CALLBACK(PopUpCB), this);
+
+ if (cmd) {
+ if (menuItem)
+ gtk_widget_set_sensitive(menuItem, enabled);
+ }
+}
+
+bool ScintillaGTK::OwnPrimarySelection() {
+ return ((gdk_selection_owner_get(GDK_SELECTION_PRIMARY)
+ == PWindow(wMain)) &&
+ (PWindow(wMain) != NULL));
+}
+
+void ScintillaGTK::ClaimSelection() {
+ // X Windows has a 'primary selection' as well as the clipboard.
+ // Whenever the user selects some text, we become the primary selection
+ if (!sel.Empty() && IS_WIDGET_REALIZED(GTK_WIDGET(PWidget(wMain)))) {
+ primarySelection = true;
+ gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)),
+ GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME);
+ primary.Clear();
+ } else if (OwnPrimarySelection()) {
+ primarySelection = true;
+ if (primary.Empty())
+ gtk_selection_owner_set(NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME);
+ } else {
+ primarySelection = false;
+ primary.Clear();
+ }
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+static const guchar *DataOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_data(sd); }
+static gint LengthOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_length(sd); }
+static GdkAtom TypeOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_data_type(sd); }
+static GdkAtom SelectionOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_selection(sd); }
+#else
+static const guchar *DataOfGSD(GtkSelectionData *sd) { return sd->data; }
+static gint LengthOfGSD(GtkSelectionData *sd) { return sd->length; }
+static GdkAtom TypeOfGSD(GtkSelectionData *sd) { return sd->type; }
+static GdkAtom SelectionOfGSD(GtkSelectionData *sd) { return sd->selection; }
+#endif
+
+// Detect rectangular text, convert line ends to current mode, convert from or to UTF-8
+void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, SelectionText &selText) {
+ const char *data = reinterpret_cast<const char *>(DataOfGSD(selectionData));
+ int len = LengthOfGSD(selectionData);
+ GdkAtom selectionTypeData = TypeOfGSD(selectionData);
+
+ // Return empty string if selection is not a string
+ if ((selectionTypeData != GDK_TARGET_STRING) && (selectionTypeData != atomUTF8)) {
+ selText.Clear();
+ return;
+ }
+
+ // Check for "\n\0" ending to string indicating that selection is rectangular
+ bool isRectangular;
+#if PLAT_GTK_WIN32
+ isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0;
+#else
+ isRectangular = ((len > 2) && (data[len - 1] == 0 && data[len - 2] == '\n'));
+ if (isRectangular)
+ len--; // Forget the extra '\0'
+#endif
+
+#if PLAT_GTK_WIN32
+ // Win32 includes an ending '\0' byte in 'len' for clipboard text from
+ // external applications; ignore it.
+ if ((len > 0) && (data[len - 1] == '\0'))
+ len--;
+#endif
+
+ std::string dest(data, len);
+ if (selectionTypeData == GDK_TARGET_STRING) {
+ if (IsUnicodeMode()) {
+ // Unknown encoding so assume in Latin1
+ dest = UTF8FromLatin1(dest.c_str(), dest.length());
+ selText.Copy(dest, SC_CP_UTF8, 0, isRectangular, false);
+ } else {
+ // Assume buffer is in same encoding as selection
+ selText.Copy(dest, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false);
+ }
+ } else { // UTF-8
+ const char *charSetBuffer = CharacterSetID();
+ if (!IsUnicodeMode() && *charSetBuffer) {
+ // Convert to locale
+ dest = ConvertText(dest.c_str(), dest.length(), charSetBuffer, "UTF-8", true);
+ selText.Copy(dest, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false);
+ } else {
+ selText.Copy(dest, SC_CP_UTF8, 0, isRectangular, false);
+ }
+ }
+}
+
+void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) {
+ try {
+ if ((SelectionOfGSD(selection_data) == atomClipboard) ||
+ (SelectionOfGSD(selection_data) == GDK_SELECTION_PRIMARY)) {
+ if ((atomSought == atomUTF8) && (LengthOfGSD(selection_data) <= 0)) {
+ atomSought = atomString;
+ gtk_selection_convert(GTK_WIDGET(PWidget(wMain)),
+ SelectionOfGSD(selection_data), atomSought, GDK_CURRENT_TIME);
+ } else if ((LengthOfGSD(selection_data) > 0) &&
+ ((TypeOfGSD(selection_data) == GDK_TARGET_STRING) || (TypeOfGSD(selection_data) == atomUTF8))) {
+ SelectionText selText;
+ GetGtkSelectionText(selection_data, selText);
+
+ UndoGroup ug(pdoc);
+ if (SelectionOfGSD(selection_data) != GDK_SELECTION_PRIMARY) {
+ ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH);
+ }
+
+ InsertPasteShape(selText.Data(), selText.Length(),
+ selText.rectangular ? pasteRectangular : pasteStream);
+ EnsureCaretVisible();
+ }
+ }
+// else fprintf(stderr, "Target non string %d %d\n", (int)(selection_data->type),
+// (int)(atomUTF8));
+ Redraw();
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) {
+ dragWasDropped = true;
+ if (TypeOfGSD(selection_data) == atomUriList || TypeOfGSD(selection_data) == atomDROPFILES_DND) {
+ const char *data = reinterpret_cast<const char *>(DataOfGSD(selection_data));
+ std::vector<char> drop(data, data + LengthOfGSD(selection_data));
+ drop.push_back('\0');
+ NotifyURIDropped(&drop[0]);
+ } else if ((TypeOfGSD(selection_data) == GDK_TARGET_STRING) || (TypeOfGSD(selection_data) == atomUTF8)) {
+ if (LengthOfGSD(selection_data) > 0) {
+ SelectionText selText;
+ GetGtkSelectionText(selection_data, selText);
+ DropAt(posDrop, selText.Data(), selText.Length(), false, selText.rectangular);
+ }
+ } else if (LengthOfGSD(selection_data) > 0) {
+ //~ fprintf(stderr, "ReceivedDrop other %p\n", static_cast<void *>(selection_data->type));
+ }
+ Redraw();
+}
+
+
+
+void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *text) {
+#if PLAT_GTK_WIN32
+ // GDK on Win32 expands any \n into \r\n, so make a copy of
+ // the clip text now with newlines converted to \n. Use { } to hide symbols
+ // from code below
+ SelectionText *newline_normalized = NULL;
+ {
+ std::string tmpstr = Document::TransformLineEnds(text->Data(), text->Length(), SC_EOL_LF);
+ newline_normalized = new SelectionText();
+ newline_normalized->Copy(tmpstr, SC_CP_UTF8, 0, text->rectangular, false);
+ text = newline_normalized;
+ }
+#endif
+
+ // Convert text to utf8 if it isn't already
+ SelectionText *converted = 0;
+ if ((text->codePage != SC_CP_UTF8) && (info == TARGET_UTF8_STRING)) {
+ const char *charSet = ::CharacterSetID(text->characterSet);
+ if (*charSet) {
+ std::string tmputf = ConvertText(text->Data(), text->Length(), "UTF-8", charSet, false);
+ converted = new SelectionText();
+ converted->Copy(tmputf, SC_CP_UTF8, 0, text->rectangular, false);
+ text = converted;
+ }
+ }
+
+ // Here is a somewhat evil kludge.
+ // As I can not work out how to store data on the clipboard in multiple formats
+ // and need some way to mark the clipping as being stream or rectangular,
+ // the terminating \0 is included in the length for rectangular clippings.
+ // All other tested aplications behave benignly by ignoring the \0.
+ // The #if is here because on Windows cfColumnSelect clip entry is used
+ // instead as standard indicator of rectangularness (so no need to kludge)
+ const char *textData = text->Data();
+ int len = text->Length();
+#if PLAT_GTK_WIN32 == 0
+ if (text->rectangular)
+ len++;
+#endif
+
+ if (info == TARGET_UTF8_STRING) {
+ gtk_selection_data_set_text(selection_data, textData, len);
+ } else {
+ gtk_selection_data_set(selection_data,
+ static_cast<GdkAtom>(GDK_SELECTION_TYPE_STRING),
+ 8, reinterpret_cast<const unsigned char *>(textData), len);
+ }
+ delete converted;
+
+#if PLAT_GTK_WIN32
+ delete newline_normalized;
+#endif
+}
+
+void ScintillaGTK::StoreOnClipboard(SelectionText *clipText) {
+ GtkClipboard *clipBoard =
+ gtk_widget_get_clipboard(GTK_WIDGET(PWidget(wMain)), atomClipboard);
+ if (clipBoard == NULL) // Occurs if widget isn't in a toplevel
+ return;
+
+ if (gtk_clipboard_set_with_data(clipBoard, clipboardCopyTargets, nClipboardCopyTargets,
+ ClipboardGetSelection, ClipboardClearSelection, clipText)) {
+ gtk_clipboard_set_can_store(clipBoard, clipboardCopyTargets, nClipboardCopyTargets);
+ }
+}
+
+void ScintillaGTK::ClipboardGetSelection(GtkClipboard *, GtkSelectionData *selection_data, guint info, void *data) {
+ GetSelection(selection_data, info, static_cast<SelectionText*>(data));
+}
+
+void ScintillaGTK::ClipboardClearSelection(GtkClipboard *, void *data) {
+ SelectionText *obj = static_cast<SelectionText*>(data);
+ delete obj;
+}
+
+void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) {
+ try {
+ //Platform::DebugPrintf("UnclaimSelection\n");
+ if (selection_event->selection == GDK_SELECTION_PRIMARY) {
+ //Platform::DebugPrintf("UnclaimPrimarySelection\n");
+ if (!OwnPrimarySelection()) {
+ primary.Clear();
+ primarySelection = false;
+ FullPaint();
+ }
+ }
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::Resize(int width, int height) {
+ //Platform::DebugPrintf("Resize %d %d\n", width, height);
+ //printf("Resize %d %d\n", width, height);
+
+ // Not always needed, but some themes can have different sizes of scrollbars
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkRequisition requisition;
+ gtk_widget_get_preferred_size(PWidget(scrollbarv), NULL, &requisition);
+ verticalScrollBarWidth = requisition.width;
+ gtk_widget_get_preferred_size(PWidget(scrollbarh), NULL, &requisition);
+ horizontalScrollBarHeight = requisition.height;
+#else
+ verticalScrollBarWidth = GTK_WIDGET(PWidget(scrollbarv))->requisition.width;
+ horizontalScrollBarHeight = GTK_WIDGET(PWidget(scrollbarh))->requisition.height;
+#endif
+
+ // These allocations should never produce negative sizes as they would wrap around to huge
+ // unsigned numbers inside GTK+ causing warnings.
+ bool showSBHorizontal = horizontalScrollBarVisible && !Wrapping();
+
+ GtkAllocation alloc;
+ if (showSBHorizontal) {
+ gtk_widget_show(GTK_WIDGET(PWidget(scrollbarh)));
+ alloc.x = 0;
+ alloc.y = height - horizontalScrollBarHeight;
+ alloc.width = Platform::Maximum(1, width - verticalScrollBarWidth);
+ alloc.height = horizontalScrollBarHeight;
+ gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarh)), &alloc);
+ } else {
+ gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarh)));
+ horizontalScrollBarHeight = 0; // in case horizontalScrollBarVisible is true.
+ }
+
+ if (verticalScrollBarVisible) {
+ gtk_widget_show(GTK_WIDGET(PWidget(scrollbarv)));
+ alloc.x = width - verticalScrollBarWidth;
+ alloc.y = 0;
+ alloc.width = verticalScrollBarWidth;
+ alloc.height = Platform::Maximum(1, height - horizontalScrollBarHeight);
+ gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarv)), &alloc);
+ } else {
+ gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarv)));
+ verticalScrollBarWidth = 0;
+ }
+ if (IS_WIDGET_MAPPED(PWidget(wMain))) {
+ ChangeSize();
+ }
+
+ alloc.x = 0;
+ alloc.y = 0;
+ alloc.width = Platform::Maximum(1, width - verticalScrollBarWidth);
+ alloc.height = Platform::Maximum(1, height - horizontalScrollBarHeight);
+ gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc);
+}
+
+static void SetAdjustmentValue(GtkAdjustment *object, int value) {
+ GtkAdjustment *adjustment = GTK_ADJUSTMENT(object);
+#if GTK_CHECK_VERSION(3,0,0)
+ int maxValue = static_cast<int>(
+ gtk_adjustment_get_upper(adjustment) - gtk_adjustment_get_page_size(adjustment));
+#else
+ int maxValue = static_cast<int>(
+ adjustment->upper - adjustment->page_size);
+#endif
+
+ if (value > maxValue)
+ value = maxValue;
+ if (value < 0)
+ value = 0;
+ gtk_adjustment_set_value(adjustment, value);
+}
+
+static int modifierTranslated(int sciModifier) {
+ switch (sciModifier) {
+ case SCMOD_SHIFT:
+ return GDK_SHIFT_MASK;
+ case SCMOD_CTRL:
+ return GDK_CONTROL_MASK;
+ case SCMOD_ALT:
+ return GDK_MOD1_MASK;
+ case SCMOD_SUPER:
+ return GDK_MOD4_MASK;
+ default:
+ return 0;
+ }
+}
+
+gint ScintillaGTK::PressThis(GdkEventButton *event) {
+ try {
+ //Platform::DebugPrintf("Press %x time=%d state = %x button = %x\n",this,event->time, event->state, event->button);
+ // Do not use GTK+ double click events as Scintilla has its own double click detection
+ if (event->type != GDK_BUTTON_PRESS)
+ return FALSE;
+
+ if (evbtn) {
+ gdk_event_free(reinterpret_cast<GdkEvent *>(evbtn));
+ evbtn = 0;
+ }
+ evbtn = reinterpret_cast<GdkEventButton *>(gdk_event_copy(reinterpret_cast<GdkEvent *>(event)));
+ Point pt;
+ pt.x = int(event->x);
+ pt.y = int(event->y);
+ PRectangle rcClient = GetClientRectangle();
+ //Platform::DebugPrintf("Press %0d,%0d in %0d,%0d %0d,%0d\n",
+ // pt.x, pt.y, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
+ if ((pt.x > rcClient.right) || (pt.y > rcClient.bottom)) {
+ Platform::DebugPrintf("Bad location\n");
+ return FALSE;
+ }
+
+ bool shift = (event->state & GDK_SHIFT_MASK) != 0;
+ bool ctrl = (event->state & GDK_CONTROL_MASK) != 0;
+ // On X, instead of sending literal modifiers use the user specified
+ // modifier, defaulting to control instead of alt.
+ // This is because most X window managers grab alt + click for moving
+ bool alt = (event->state & modifierTranslated(rectangularSelectionModifier)) != 0;
+
+ gtk_widget_grab_focus(PWidget(wMain));
+ if (event->button == 1) {
+#if PLAT_GTK_MACOSX
+ bool meta = ctrl;
+ // GDK reports the Command modifer key as GDK_MOD2_MASK for button events,
+ // not GDK_META_MASK like in key events.
+ ctrl = (event->state & GDK_MOD2_MASK) != 0;
+#else
+ bool meta = false;
+#endif
+ ButtonDownWithModifiers(pt, event->time, ModifierFlags(shift, ctrl, alt, meta));
+ } else if (event->button == 2) {
+ // Grab the primary selection if it exists
+ SelectionPosition pos = SPositionFromLocation(pt, false, false, UserVirtualSpace());
+ if (OwnPrimarySelection() && primary.Empty())
+ CopySelectionRange(&primary);
+
+ sel.Clear();
+ SetSelection(pos, pos);
+ atomSought = atomUTF8;
+ gtk_selection_convert(GTK_WIDGET(PWidget(wMain)), GDK_SELECTION_PRIMARY,
+ atomSought, event->time);
+ } else if (event->button == 3) {
+ if (!PointInSelection(pt))
+ SetEmptySelection(PositionFromLocation(pt));
+ if (displayPopupMenu) {
+ // PopUp menu
+ // Convert to screen
+ int ox = 0;
+ int oy = 0;
+ gdk_window_get_origin(PWindow(wMain), &ox, &oy);
+ ContextMenu(Point(pt.x + ox, pt.y + oy));
+ } else {
+ return FALSE;
+ }
+ } else if (event->button == 4) {
+ // Wheel scrolling up (only GTK 1.x does it this way)
+ if (ctrl)
+ SetAdjustmentValue(adjustmenth, xOffset - 6);
+ else
+ SetAdjustmentValue(adjustmentv, topLine - 3);
+ } else if (event->button == 5) {
+ // Wheel scrolling down (only GTK 1.x does it this way)
+ if (ctrl)
+ SetAdjustmentValue(adjustmenth, xOffset + 6);
+ else
+ SetAdjustmentValue(adjustmentv, topLine + 3);
+ }
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return TRUE;
+}
+
+gint ScintillaGTK::Press(GtkWidget *widget, GdkEventButton *event) {
+ if (event->window != WindowFromWidget(widget))
+ return FALSE;
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->PressThis(event);
+}
+
+gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ //Platform::DebugPrintf("Release %x %d %d\n",sciThis,event->time,event->state);
+ if (!sciThis->HaveMouseCapture())
+ return FALSE;
+ if (event->button == 1) {
+ Point pt;
+ pt.x = int(event->x);
+ pt.y = int(event->y);
+ //Platform::DebugPrintf("Up %x %x %d %d %d\n",
+ // sciThis,event->window,event->time, pt.x, pt.y);
+ if (event->window != PWindow(sciThis->wMain))
+ // If mouse released on scroll bar then the position is relative to the
+ // scrollbar, not the drawing window so just repeat the most recent point.
+ pt = sciThis->ptMouseLast;
+ sciThis->ButtonUp(pt, event->time, (event->state & GDK_CONTROL_MASK) != 0);
+ }
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+// win32gtk and GTK >= 2 use SCROLL_* events instead of passing the
+// button4/5/6/7 events to the GTK app
+gint ScintillaGTK::ScrollEvent(GtkWidget *widget, GdkEventScroll *event) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+
+ if (widget == NULL || event == NULL)
+ return FALSE;
+
+ // Compute amount and direction to scroll (even tho on win32 there is
+ // intensity of scrolling info in the native message, gtk doesn't
+ // support this so we simulate similarly adaptive scrolling)
+ // Note that this is disabled on OS X (Darwin) with the X11 backend
+ // where the X11 server already has an adaptive scrolling algorithm
+ // that fights with this one
+ int cLineScroll;
+#if defined(__APPLE__) && !defined(GDK_WINDOWING_QUARTZ)
+ cLineScroll = sciThis->linesPerScroll;
+ if (cLineScroll == 0)
+ cLineScroll = 4;
+ sciThis->wheelMouseIntensity = cLineScroll;
+#else
+ int timeDelta = 1000000;
+ GTimeVal curTime;
+ g_get_current_time(&curTime);
+ if (curTime.tv_sec == sciThis->lastWheelMouseTime.tv_sec)
+ timeDelta = curTime.tv_usec - sciThis->lastWheelMouseTime.tv_usec;
+ else if (curTime.tv_sec == sciThis->lastWheelMouseTime.tv_sec + 1)
+ timeDelta = 1000000 + (curTime.tv_usec - sciThis->lastWheelMouseTime.tv_usec);
+ if ((event->direction == sciThis->lastWheelMouseDirection) && (timeDelta < 250000)) {
+ if (sciThis->wheelMouseIntensity < 12)
+ sciThis->wheelMouseIntensity++;
+ cLineScroll = sciThis->wheelMouseIntensity;
+ } else {
+ cLineScroll = sciThis->linesPerScroll;
+ if (cLineScroll == 0)
+ cLineScroll = 4;
+ sciThis->wheelMouseIntensity = cLineScroll;
+ }
+#endif
+ if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) {
+ cLineScroll *= -1;
+ }
+ g_get_current_time(&sciThis->lastWheelMouseTime);
+ sciThis->lastWheelMouseDirection = event->direction;
+
+ // Note: Unpatched versions of win32gtk don't set the 'state' value so
+ // only regular scrolling is supported there. Also, unpatched win32gtk
+ // issues spurious button 2 mouse events during wheeling, which can cause
+ // problems (a patch for both was submitted by archaeopteryx.com on 13Jun2001)
+
+ // Data zoom not supported
+ if (event->state & GDK_SHIFT_MASK) {
+ return FALSE;
+ }
+
+#if GTK_CHECK_VERSION(3,4,0)
+ // Smooth scrolling not supported
+ if (event->direction == GDK_SCROLL_SMOOTH) {
+ return FALSE;
+ }
+#endif
+
+ // Horizontal scrolling
+ if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT) {
+ sciThis->HorizontalScrollTo(sciThis->xOffset + cLineScroll);
+
+ // Text font size zoom
+ } else if (event->state & GDK_CONTROL_MASK) {
+ if (cLineScroll < 0) {
+ sciThis->KeyCommand(SCI_ZOOMIN);
+ } else {
+ sciThis->KeyCommand(SCI_ZOOMOUT);
+ }
+
+ // Regular scrolling
+ } else {
+ sciThis->ScrollTo(sciThis->topLine + cLineScroll);
+ }
+ return TRUE;
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ //Platform::DebugPrintf("Motion %x %d\n",sciThis,event->time);
+ if (event->window != WindowFromWidget(widget))
+ return FALSE;
+ int x = 0;
+ int y = 0;
+ GdkModifierType state;
+ if (event->is_hint) {
+#if GTK_CHECK_VERSION(3,0,0)
+ gdk_window_get_device_position(event->window,
+ event->device, &x, &y, &state);
+#else
+ gdk_window_get_pointer(event->window, &x, &y, &state);
+#endif
+ } else {
+ x = static_cast<int>(event->x);
+ y = static_cast<int>(event->y);
+ state = static_cast<GdkModifierType>(event->state);
+ }
+ //Platform::DebugPrintf("Move %x %x %d %c %d %d\n",
+ // sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y);
+ Point pt(x, y);
+ int modifiers = ((event->state & GDK_SHIFT_MASK) != 0 ? SCI_SHIFT : 0) |
+ ((event->state & GDK_CONTROL_MASK) != 0 ? SCI_CTRL : 0) |
+ ((event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0 ? SCI_ALT : 0);
+ sciThis->ButtonMoveWithModifiers(pt, modifiers);
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+// Map the keypad keys to their equivalent functions
+static int KeyTranslate(int keyIn) {
+ switch (keyIn) {
+#if GTK_CHECK_VERSION(3,0,0)
+ case GDK_KEY_ISO_Left_Tab:
+ return SCK_TAB;
+ case GDK_KEY_KP_Down:
+ return SCK_DOWN;
+ case GDK_KEY_KP_Up:
+ return SCK_UP;
+ case GDK_KEY_KP_Left:
+ return SCK_LEFT;
+ case GDK_KEY_KP_Right:
+ return SCK_RIGHT;
+ case GDK_KEY_KP_Home:
+ return SCK_HOME;
+ case GDK_KEY_KP_End:
+ return SCK_END;
+ case GDK_KEY_KP_Page_Up:
+ return SCK_PRIOR;
+ case GDK_KEY_KP_Page_Down:
+ return SCK_NEXT;
+ case GDK_KEY_KP_Delete:
+ return SCK_DELETE;
+ case GDK_KEY_KP_Insert:
+ return SCK_INSERT;
+ case GDK_KEY_KP_Enter:
+ return SCK_RETURN;
+
+ case GDK_KEY_Down:
+ return SCK_DOWN;
+ case GDK_KEY_Up:
+ return SCK_UP;
+ case GDK_KEY_Left:
+ return SCK_LEFT;
+ case GDK_KEY_Right:
+ return SCK_RIGHT;
+ case GDK_KEY_Home:
+ return SCK_HOME;
+ case GDK_KEY_End:
+ return SCK_END;
+ case GDK_KEY_Page_Up:
+ return SCK_PRIOR;
+ case GDK_KEY_Page_Down:
+ return SCK_NEXT;
+ case GDK_KEY_Delete:
+ return SCK_DELETE;
+ case GDK_KEY_Insert:
+ return SCK_INSERT;
+ case GDK_KEY_Escape:
+ return SCK_ESCAPE;
+ case GDK_KEY_BackSpace:
+ return SCK_BACK;
+ case GDK_KEY_Tab:
+ return SCK_TAB;
+ case GDK_KEY_Return:
+ return SCK_RETURN;
+ case GDK_KEY_KP_Add:
+ return SCK_ADD;
+ case GDK_KEY_KP_Subtract:
+ return SCK_SUBTRACT;
+ case GDK_KEY_KP_Divide:
+ return SCK_DIVIDE;
+ case GDK_KEY_Super_L:
+ return SCK_WIN;
+ case GDK_KEY_Super_R:
+ return SCK_RWIN;
+ case GDK_KEY_Menu:
+ return SCK_MENU;
+
+#else
+
+ case GDK_ISO_Left_Tab:
+ return SCK_TAB;
+ case GDK_KP_Down:
+ return SCK_DOWN;
+ case GDK_KP_Up:
+ return SCK_UP;
+ case GDK_KP_Left:
+ return SCK_LEFT;
+ case GDK_KP_Right:
+ return SCK_RIGHT;
+ case GDK_KP_Home:
+ return SCK_HOME;
+ case GDK_KP_End:
+ return SCK_END;
+ case GDK_KP_Page_Up:
+ return SCK_PRIOR;
+ case GDK_KP_Page_Down:
+ return SCK_NEXT;
+ case GDK_KP_Delete:
+ return SCK_DELETE;
+ case GDK_KP_Insert:
+ return SCK_INSERT;
+ case GDK_KP_Enter:
+ return SCK_RETURN;
+
+ case GDK_Down:
+ return SCK_DOWN;
+ case GDK_Up:
+ return SCK_UP;
+ case GDK_Left:
+ return SCK_LEFT;
+ case GDK_Right:
+ return SCK_RIGHT;
+ case GDK_Home:
+ return SCK_HOME;
+ case GDK_End:
+ return SCK_END;
+ case GDK_Page_Up:
+ return SCK_PRIOR;
+ case GDK_Page_Down:
+ return SCK_NEXT;
+ case GDK_Delete:
+ return SCK_DELETE;
+ case GDK_Insert:
+ return SCK_INSERT;
+ case GDK_Escape:
+ return SCK_ESCAPE;
+ case GDK_BackSpace:
+ return SCK_BACK;
+ case GDK_Tab:
+ return SCK_TAB;
+ case GDK_Return:
+ return SCK_RETURN;
+ case GDK_KP_Add:
+ return SCK_ADD;
+ case GDK_KP_Subtract:
+ return SCK_SUBTRACT;
+ case GDK_KP_Divide:
+ return SCK_DIVIDE;
+ case GDK_Super_L:
+ return SCK_WIN;
+ case GDK_Super_R:
+ return SCK_RWIN;
+ case GDK_Menu:
+ return SCK_MENU;
+#endif
+ default:
+ return keyIn;
+ }
+}
+
+gboolean ScintillaGTK::KeyThis(GdkEventKey *event) {
+ try {
+ //fprintf(stderr, "SC-key: %d %x [%s]\n",
+ // event->keyval, event->state, (event->length > 0) ? event->string : "empty");
+ if (gtk_im_context_filter_keypress(im_context, event)) {
+ return 1;
+ }
+ if (!event->keyval) {
+ return true;
+ }
+
+ bool shift = (event->state & GDK_SHIFT_MASK) != 0;
+ bool ctrl = (event->state & GDK_CONTROL_MASK) != 0;
+ bool alt = (event->state & GDK_MOD1_MASK) != 0;
+ guint key = event->keyval;
+ if ((ctrl || alt) && (key < 128))
+ key = toupper(key);
+#if GTK_CHECK_VERSION(3,0,0)
+ else if (!ctrl && (key >= GDK_KEY_KP_Multiply && key <= GDK_KEY_KP_9))
+#else
+ else if (!ctrl && (key >= GDK_KP_Multiply && key <= GDK_KP_9))
+#endif
+ key &= 0x7F;
+ // Hack for keys over 256 and below command keys but makes Hungarian work.
+ // This will have to change for Unicode
+ else if (key >= 0xFE00)
+ key = KeyTranslate(key);
+
+ bool consumed = false;
+#if !(PLAT_GTK_MACOSX)
+ bool added = KeyDown(key, shift, ctrl, alt, &consumed) != 0;
+#else
+ bool meta = ctrl;
+ ctrl = (event->state & GDK_META_MASK) != 0;
+ bool added = KeyDownWithModifiers(key, (shift ? SCI_SHIFT : 0) |
+ (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0) |
+ (meta ? SCI_META : 0), &consumed) != 0;
+#endif
+ if (!consumed)
+ consumed = added;
+ //fprintf(stderr, "SK-key: %d %x %x\n",event->keyval, event->state, consumed);
+ if (event->keyval == 0xffffff && event->length > 0) {
+ ClearSelection();
+ const int lengthInserted = pdoc->InsertString(CurrentPosition(), event->string, strlen(event->string));
+ if (lengthInserted > 0) {
+ MovePositionTo(CurrentPosition() + lengthInserted);
+ }
+ }
+ return consumed;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gboolean ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->KeyThis(event);
+}
+
+gboolean ScintillaGTK::KeyRelease(GtkWidget *widget, GdkEventKey *event) {
+ //Platform::DebugPrintf("SC-keyrel: %d %x %3s\n",event->keyval, event->state, event->string);
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ if (gtk_im_context_filter_keypress(sciThis->im_context, event)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+
+gboolean ScintillaGTK::DrawPreeditThis(GtkWidget *widget, cairo_t *cr) {
+ try {
+ PreEditString pes(im_context);
+ PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str);
+ pango_layout_set_attributes(layout, pes.attrs);
+
+ cairo_move_to(cr, 0, 0);
+ pango_cairo_show_layout(cr, layout);
+
+ g_object_unref(layout);
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return TRUE;
+}
+
+gboolean ScintillaGTK::DrawPreedit(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis) {
+ return sciThis->DrawPreeditThis(widget, cr);
+}
+
+#else
+
+gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) {
+ try {
+ PreEditString pes(im_context);
+ PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str);
+ pango_layout_set_attributes(layout, pes.attrs);
+
+ cairo_t *context = gdk_cairo_create(reinterpret_cast<GdkDrawable *>(WindowFromWidget(widget)));
+ cairo_move_to(context, 0, 0);
+ pango_cairo_show_layout(context, layout);
+ cairo_destroy(context);
+ g_object_unref(layout);
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return TRUE;
+}
+
+gboolean ScintillaGTK::ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) {
+ return sciThis->ExposePreeditThis(widget, ose);
+}
+
+#endif
+
+bool ScintillaGTK::KoreanIME() {
+ PreEditString pes(im_context);
+ if (pes.pscript != PANGO_SCRIPT_COMMON)
+ lastNonCommonScript = pes.pscript;
+ return lastNonCommonScript == PANGO_SCRIPT_HANGUL;
+}
+
+void ScintillaGTK::MoveImeCarets(int pos) {
+ // Move carets relatively by bytes
+ for (size_t r=0; r<sel.Count(); r++) {
+ int positionInsert = sel.Range(r).Start().Position();
+ sel.Range(r).caret.SetPosition(positionInsert + pos);
+ sel.Range(r).anchor.SetPosition(positionInsert + pos);
+ }
+}
+
+void ScintillaGTK::DrawImeIndicator(int indicator, int len) {
+ // Emulate the visual style of IME characters with indicators.
+ // Draw an indicator on the character before caret by the character bytes of len
+ // so it should be called after addCharUTF().
+ // It does not affect caret positions.
+ if (indicator < 8 || indicator > INDIC_MAX) {
+ return;
+ }
+ pdoc->decorations.SetCurrentIndicator(indicator);
+ for (size_t r=0; r<sel.Count(); r++) {
+ int positionInsert = sel.Range(r).Start().Position();
+ pdoc->DecorationFillRange(positionInsert - len, 1, len);
+ }
+}
+
+void ScintillaGTK::GetImeUnderlines(PangoAttrList *attrs, bool *normalInput) {
+ // Whether single underlines attribute is or not
+ // attr position is counted by the number of UTF-8 bytes
+ PangoAttrIterator *iterunderline = pango_attr_list_get_iterator(attrs);
+ if (iterunderline) {
+ do {
+ PangoAttribute *attrunderline = pango_attr_iterator_get(iterunderline, PANGO_ATTR_UNDERLINE);
+ if (attrunderline) {
+ glong start = attrunderline->start_index;
+ glong end = attrunderline->end_index;
+ PangoUnderline uline = (PangoUnderline)((PangoAttrInt *)attrunderline)->value;
+ for (glong i=start; i < end; ++i) {
+ switch (uline) {
+ case PANGO_UNDERLINE_NONE:
+ normalInput[i] = false;
+ break;
+ case PANGO_UNDERLINE_SINGLE: // normal input
+ normalInput[i] = true;
+ break;
+ case PANGO_UNDERLINE_DOUBLE:
+ case PANGO_UNDERLINE_LOW:
+ case PANGO_UNDERLINE_ERROR:
+ break;
+ }
+ }
+ }
+ } while (pango_attr_iterator_next(iterunderline));
+ pango_attr_iterator_destroy(iterunderline);
+ }
+}
+
+void ScintillaGTK::GetImeBackgrounds(PangoAttrList *attrs, bool *targetInput) {
+ // Whether background color attribue is or not
+ // attr position is measured in UTF-8 bytes
+ PangoAttrIterator *itercolor = pango_attr_list_get_iterator(attrs);
+ if (itercolor) {
+ do {
+ PangoAttribute *backcolor = pango_attr_iterator_get(itercolor, PANGO_ATTR_BACKGROUND);
+ if (backcolor) {
+ glong start = backcolor->start_index;
+ glong end = backcolor->end_index;
+ for (glong i=start; i < end; ++i) {
+ targetInput[i] = true; // target converted
+ }
+ }
+ } while (pango_attr_iterator_next(itercolor));
+ pango_attr_iterator_destroy(itercolor);
+ }
+}
+
+void ScintillaGTK::SetCandidateWindowPos() {
+ // Composition box accompanies candidate box.
+ Point pt = PointMainCaret();
+ GdkRectangle imeBox = {0}; // No need to set width
+ imeBox.x = pt.x; // Only need positiion
+ imeBox.y = pt.y + vs.lineHeight; // underneath the first charater
+ gtk_im_context_set_cursor_location(im_context, &imeBox);
+}
+
+void ScintillaGTK::CommitThis(char *commitStr) {
+ try {
+ //~ fprintf(stderr, "Commit '%s'\n", commitStr);
+ view.imeCaretBlockOverride = false;
+
+ if (pdoc->TentativeActive()) {
+ pdoc->TentativeUndo();
+ }
+
+ const char *charSetSource = CharacterSetID();
+
+ glong uniStrLen = 0;
+ gunichar *uniStr = g_utf8_to_ucs4_fast(commitStr, strlen(commitStr), &uniStrLen);
+ for (glong i = 0; i < uniStrLen; i++) {
+
+ gunichar uniChar[1] = {0};
+ uniChar[0] = uniStr[i];
+
+ glong oneCharLen = 0;
+ gchar *oneChar = g_ucs4_to_utf8(uniChar, 1, NULL, &oneCharLen, NULL);
+
+ if (IsUnicodeMode()) {
+ // Do nothing ;
+ } else {
+ std::string oneCharSTD = ConvertText(oneChar, oneCharLen, charSetSource, "UTF-8", true);
+ oneCharLen = oneCharSTD.copy(oneChar,oneCharSTD.length(), 0);
+ oneChar[oneCharLen] = '\0';
+ }
+
+ AddCharUTF(oneChar, oneCharLen);
+ g_free(oneChar);
+ }
+ g_free(uniStr);
+ ShowCaretAtCurrentPosition();
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::Commit(GtkIMContext *, char *str, ScintillaGTK *sciThis) {
+ sciThis->CommitThis(str);
+}
+
+void ScintillaGTK::PreeditChangedInlineThis() {
+ // Copy & paste by johnsonj with a lot of helps of Neil
+ // Great thanks for my foreruners, jiniya and BLUEnLIVE
+ try {
+ view.imeCaretBlockOverride = false; // If backspace.
+
+ if (pdoc->TentativeActive()) {
+ pdoc->TentativeUndo();
+ } else {
+ // No tentative undo means start of this composition so
+ // fill in any virtual spaces.
+ FillVirtualSpace();
+ }
+
+ PreEditString preeditStr(im_context);
+ const char *charSetSource = CharacterSetID();
+
+ if (!preeditStr.validUTF8 || (charSetSource == NULL)) {
+ ShowCaretAtCurrentPosition();
+ return;
+ }
+
+ if (preeditStr.uniStrLen == 0 || preeditStr.uniStrLen > maxLenInputIME) {
+ //fprintf(stderr, "Do not allow over 200 chars: %i\n", preeditStr.uniStrLen);
+ ShowCaretAtCurrentPosition();
+ return;
+ }
+
+ pdoc->TentativeStart(); // TentativeActive() from now on
+
+ // Get preedit string attribues
+ bool normalInput[maxLenInputIME*3+1] = {false};
+ bool targetInput[maxLenInputIME*3+1] = {false};
+ GetImeUnderlines(preeditStr.attrs, normalInput);
+ GetImeBackgrounds(preeditStr.attrs, targetInput);
+
+ // Display preedit characters, one by one
+ glong imeCharPos[maxLenInputIME+1] = { 0 };
+ glong attrPos = -1; // Start at -1 to designate the last byte of one character.
+ glong charWidth = 0;
+
+ bool tmpRecordingMacro = recordingMacro;
+ recordingMacro = false;
+ for (glong i = 0; i < preeditStr.uniStrLen; i++) {
+
+ gunichar uniChar[1] = {0};
+ uniChar[0] = preeditStr.uniStr[i];
+
+ glong oneCharLen = 0;
+ gchar *oneChar = g_ucs4_to_utf8(uniChar, 1, NULL, &oneCharLen, NULL);
+
+ // Record attribute positions in UTF-8 bytes
+ attrPos += oneCharLen;
+
+ if (IsUnicodeMode()) {
+ // Do nothing
+ } else {
+ std::string oneCharSTD = ConvertText(oneChar, oneCharLen, charSetSource, "UTF-8", true);
+ oneCharLen = oneCharSTD.copy(oneChar,oneCharSTD.length(), 0);
+ oneChar[oneCharLen] = '\0';
+ }
+
+ // Record character positions in UTF-8 or DBCS bytes
+
+ charWidth += oneCharLen;
+ imeCharPos[i+1] = charWidth;
+
+ // Display one character
+ AddCharUTF(oneChar, oneCharLen);
+
+ // Draw an indicator on the character,
+ // Overlapping allowed
+ if (normalInput[attrPos]) {
+ DrawImeIndicator(SC_INDICATOR_INPUT, oneCharLen);
+ }
+ if (targetInput[attrPos]) {
+ DrawImeIndicator(SC_INDICATOR_TARGET, oneCharLen);
+ }
+ g_free(oneChar);
+ }
+ recordingMacro = tmpRecordingMacro;
+
+ // Move caret to ime cursor position.
+ if (KoreanIME()) {
+ view.imeCaretBlockOverride = true;
+ MoveImeCarets( - (imeCharPos[preeditStr.uniStrLen]));
+
+ } else {
+ MoveImeCarets( - (imeCharPos[preeditStr.uniStrLen]) + imeCharPos[preeditStr.cursor_pos]);
+ }
+
+ SetCandidateWindowPos();
+ ShowCaretAtCurrentPosition();
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::PreeditChangedWindowedThis() {
+ try {
+ PreEditString pes(im_context);
+ if (strlen(pes.str) > 0) {
+ PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str);
+ pango_layout_set_attributes(layout, pes.attrs);
+
+ gint w, h;
+ pango_layout_get_pixel_size(layout, &w, &h);
+ g_object_unref(layout);
+
+ gint x, y;
+ gdk_window_get_origin(PWindow(wText), &x, &y);
+
+ Point pt = PointMainCaret();
+ if (pt.x < 0)
+ pt.x = 0;
+ if (pt.y < 0)
+ pt.y = 0;
+
+ gtk_window_move(GTK_WINDOW(PWidget(wPreedit)), x + pt.x, y + pt.y);
+ gtk_window_resize(GTK_WINDOW(PWidget(wPreedit)), w, h);
+ gtk_widget_show(PWidget(wPreedit));
+ gtk_widget_queue_draw_area(PWidget(wPreeditDraw), 0, 0, w, h);
+ } else {
+ gtk_widget_hide(PWidget(wPreedit));
+ }
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::PreeditChanged(GtkIMContext *, ScintillaGTK *sciThis) {
+ if ((sciThis->imeInteraction == imeInline) || (sciThis->KoreanIME())) {
+ sciThis->PreeditChangedInlineThis();
+ } else {
+ sciThis->PreeditChangedWindowedThis();
+ }
+}
+
+void ScintillaGTK::StyleSetText(GtkWidget *widget, GtkStyle *, void*) {
+ RealizeText(widget, NULL);
+}
+
+void ScintillaGTK::RealizeText(GtkWidget *widget, void*) {
+ // Set NULL background to avoid automatic clearing so Scintilla responsible for all drawing
+ if (WindowFromWidget(widget)) {
+#if GTK_CHECK_VERSION(3,0,0)
+ gdk_window_set_background_pattern(WindowFromWidget(widget), NULL);
+#else
+ gdk_window_set_back_pixmap(WindowFromWidget(widget), NULL, FALSE);
+#endif
+ }
+}
+
+static GObjectClass *scintilla_class_parent_class;
+
+void ScintillaGTK::Destroy(GObject *object) {
+ try {
+ ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(object);
+
+ // This avoids a double destruction
+ if (!scio->pscin)
+ return;
+ ScintillaGTK *sciThis = reinterpret_cast<ScintillaGTK *>(scio->pscin);
+ //Platform::DebugPrintf("Destroying %x %x\n", sciThis, object);
+ sciThis->Finalise();
+
+ delete sciThis;
+ scio->pscin = 0;
+ scintilla_class_parent_class->finalize(object);
+ } catch (...) {
+ // Its dead so nowhere to save the status
+ }
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+
+gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) {
+ try {
+ paintState = painting;
+ repaintFullWindow = false;
+
+ rcPaint = GetClientRectangle();
+
+ PLATFORM_ASSERT(rgnUpdate == NULL);
+ rgnUpdate = cairo_copy_clip_rectangle_list(cr);
+ if (rgnUpdate && rgnUpdate->status != CAIRO_STATUS_SUCCESS) {
+ // If not successful then ignore
+ fprintf(stderr, "DrawTextThis failed to copy update region %d [%d]\n", rgnUpdate->status, rgnUpdate->num_rectangles);
+ cairo_rectangle_list_destroy(rgnUpdate);
+ rgnUpdate = 0;
+ }
+
+ double x1, y1, x2, y2;
+ cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
+ rcPaint.left = x1;
+ rcPaint.top = y1;
+ rcPaint.right = x2;
+ rcPaint.bottom = y2;
+ PRectangle rcClient = GetClientRectangle();
+ paintingAllText = rcPaint.Contains(rcClient);
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceWindow) {
+ surfaceWindow->Init(cr, PWidget(wText));
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ }
+ if ((paintState == paintAbandoned) || repaintFullWindow) {
+ // Painting area was insufficient to cover new styling or brace highlight positions
+ FullPaint();
+ }
+ paintState = notPainting;
+ repaintFullWindow = false;
+
+ if (rgnUpdate) {
+ cairo_rectangle_list_destroy(rgnUpdate);
+ }
+ rgnUpdate = 0;
+ paintState = notPainting;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+
+ return FALSE;
+}
+
+gboolean ScintillaGTK::DrawText(GtkWidget *, cairo_t *cr, ScintillaGTK *sciThis) {
+ return sciThis->DrawTextThis(cr);
+}
+
+gboolean ScintillaGTK::DrawThis(cairo_t *cr) {
+ try {
+ gtk_container_propagate_draw(
+ GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarh), cr);
+ gtk_container_propagate_draw(
+ GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), cr);
+// Starting from the following version, the expose event are not propagated
+// for double buffered non native windows, so we need to call it ourselves
+// or keep the default handler
+#if GTK_CHECK_VERSION(3,0,0)
+ // we want to forward on any >= 3.9.2 runtime
+ if (gtk_check_version(3,9,2) == NULL) {
+ gtk_container_propagate_draw(
+ GTK_CONTAINER(PWidget(wMain)), PWidget(wText), cr);
+ }
+#endif
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gboolean ScintillaGTK::DrawMain(GtkWidget *widget, cairo_t *cr) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->DrawThis(cr);
+}
+
+#else
+
+gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *ose) {
+ try {
+ paintState = painting;
+
+ rcPaint.left = ose->area.x;
+ rcPaint.top = ose->area.y;
+ rcPaint.right = ose->area.x + ose->area.width;
+ rcPaint.bottom = ose->area.y + ose->area.height;
+
+ PLATFORM_ASSERT(rgnUpdate == NULL);
+ rgnUpdate = gdk_region_copy(ose->region);
+ PRectangle rcClient = GetClientRectangle();
+ paintingAllText = rcPaint.Contains(rcClient);
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceWindow) {
+ cairo_t *cr = gdk_cairo_create(PWindow(wText));
+ surfaceWindow->Init(cr, PWidget(wText));
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ cairo_destroy(cr);
+ }
+ if (paintState == paintAbandoned) {
+ // Painting area was insufficient to cover new styling or brace highlight positions
+ FullPaint();
+ }
+ paintState = notPainting;
+
+ if (rgnUpdate) {
+ gdk_region_destroy(rgnUpdate);
+ }
+ rgnUpdate = 0;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+
+ return FALSE;
+}
+
+gboolean ScintillaGTK::ExposeText(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) {
+ return sciThis->ExposeTextThis(widget, ose);
+}
+
+gboolean ScintillaGTK::ExposeMain(GtkWidget *widget, GdkEventExpose *ose) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ //Platform::DebugPrintf("Expose Main %0d,%0d %0d,%0d\n",
+ //ose->area.x, ose->area.y, ose->area.width, ose->area.height);
+ return sciThis->Expose(widget, ose);
+}
+
+gboolean ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) {
+ try {
+ //fprintf(stderr, "Expose %0d,%0d %0d,%0d\n",
+ //ose->area.x, ose->area.y, ose->area.width, ose->area.height);
+
+ // The text is painted in ExposeText
+ gtk_container_propagate_expose(
+ GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarh), ose);
+ gtk_container_propagate_expose(
+ GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), ose);
+
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+#endif
+
+void ScintillaGTK::ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) {
+ try {
+#if GTK_CHECK_VERSION(3,0,0)
+ sciThis->ScrollTo(static_cast<int>(gtk_adjustment_get_value(adj)), false);
+#else
+ sciThis->ScrollTo(static_cast<int>(adj->value), false);
+#endif
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) {
+ try {
+#if GTK_CHECK_VERSION(3,0,0)
+ sciThis->HorizontalScrollTo(static_cast<int>(gtk_adjustment_get_value(adj)));
+#else
+ sciThis->HorizontalScrollTo(static_cast<int>(adj->value));
+#endif
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::SelectionReceived(GtkWidget *widget,
+ GtkSelectionData *selection_data, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ //Platform::DebugPrintf("Selection received\n");
+ sciThis->ReceivedSelection(selection_data);
+}
+
+void ScintillaGTK::SelectionGet(GtkWidget *widget,
+ GtkSelectionData *selection_data, guint info, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ //Platform::DebugPrintf("Selection get\n");
+ if (SelectionOfGSD(selection_data) == GDK_SELECTION_PRIMARY) {
+ if (sciThis->primary.Empty()) {
+ sciThis->CopySelectionRange(&sciThis->primary);
+ }
+ sciThis->GetSelection(selection_data, info, &sciThis->primary);
+ }
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+gint ScintillaGTK::SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ //Platform::DebugPrintf("Selection clear\n");
+ sciThis->UnclaimSelection(selection_event);
+ if (GTK_WIDGET_CLASS(sciThis->parentClass)->selection_clear_event) {
+ return GTK_WIDGET_CLASS(sciThis->parentClass)->selection_clear_event(widget, selection_event);
+ }
+ return TRUE;
+}
+
+gboolean ScintillaGTK::DragMotionThis(GdkDragContext *context,
+ gint x, gint y, guint dragtime) {
+ try {
+ Point npt(x, y);
+ SetDragPosition(SPositionFromLocation(npt, false, false, UserVirtualSpace()));
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkDragAction preferredAction = gdk_drag_context_get_suggested_action(context);
+ GdkDragAction actions = gdk_drag_context_get_actions(context);
+#else
+ GdkDragAction preferredAction = context->suggested_action;
+ GdkDragAction actions = context->actions;
+#endif
+ SelectionPosition pos = SPositionFromLocation(npt);
+ if ((inDragDrop == ddDragging) && (PositionInSelection(pos.Position()))) {
+ // Avoid dragging selection onto itself as that produces a move
+ // with no real effect but which creates undo actions.
+ preferredAction = static_cast<GdkDragAction>(0);
+ } else if (actions == static_cast<GdkDragAction>
+ (GDK_ACTION_COPY | GDK_ACTION_MOVE)) {
+ preferredAction = GDK_ACTION_MOVE;
+ }
+ gdk_drag_status(context, preferredAction, dragtime);
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+gboolean ScintillaGTK::DragMotion(GtkWidget *widget, GdkDragContext *context,
+ gint x, gint y, guint dragtime) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ return sciThis->DragMotionThis(context, x, y, dragtime);
+}
+
+void ScintillaGTK::DragLeave(GtkWidget *widget, GdkDragContext * /*context*/, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ sciThis->SetDragPosition(SelectionPosition(invalidPosition));
+ //Platform::DebugPrintf("DragLeave %x\n", sciThis);
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::DragEnd(GtkWidget *widget, GdkDragContext * /*context*/) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ // If drag did not result in drop here or elsewhere
+ if (!sciThis->dragWasDropped)
+ sciThis->SetEmptySelection(sciThis->posDrag);
+ sciThis->SetDragPosition(SelectionPosition(invalidPosition));
+ //Platform::DebugPrintf("DragEnd %x %d\n", sciThis, sciThis->dragWasDropped);
+ sciThis->inDragDrop = ddNone;
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+gboolean ScintillaGTK::Drop(GtkWidget *widget, GdkDragContext * /*context*/,
+ gint, gint, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ //Platform::DebugPrintf("Drop %x\n", sciThis);
+ sciThis->SetDragPosition(SelectionPosition(invalidPosition));
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+ return FALSE;
+}
+
+void ScintillaGTK::DragDataReceived(GtkWidget *widget, GdkDragContext * /*context*/,
+ gint, gint, GtkSelectionData *selection_data, guint /*info*/, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ sciThis->ReceivedDrop(selection_data);
+ sciThis->SetDragPosition(SelectionPosition(invalidPosition));
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+void ScintillaGTK::DragDataGet(GtkWidget *widget, GdkDragContext *context,
+ GtkSelectionData *selection_data, guint info, guint) {
+ ScintillaGTK *sciThis = ScintillaFromWidget(widget);
+ try {
+ sciThis->dragWasDropped = true;
+ if (!sciThis->sel.Empty()) {
+ sciThis->GetSelection(selection_data, info, &sciThis->drag);
+ }
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkDragAction action = gdk_drag_context_get_selected_action(context);
+#else
+ GdkDragAction action = context->action;
+#endif
+ if (action == GDK_ACTION_MOVE) {
+ for (size_t r=0; r<sciThis->sel.Count(); r++) {
+ if (sciThis->posDrop >= sciThis->sel.Range(r).Start()) {
+ if (sciThis->posDrop > sciThis->sel.Range(r).End()) {
+ sciThis->posDrop.Add(-sciThis->sel.Range(r).Length());
+ } else {
+ sciThis->posDrop.Add(-SelectionRange(sciThis->posDrop, sciThis->sel.Range(r).Start()).Length());
+ }
+ }
+ }
+ sciThis->ClearSelection();
+ }
+ sciThis->SetDragPosition(SelectionPosition(invalidPosition));
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+}
+
+int ScintillaGTK::TimeOut(TimeThunk *tt) {
+ tt->scintilla->TickFor(tt->reason);
+ return 1;
+}
+
+gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) {
+ // Idler will be automatically stopped, if there is nothing
+ // to do while idle.
+#ifndef GDK_VERSION_3_6
+ gdk_threads_enter();
+#endif
+ bool ret = sciThis->Idle();
+ if (ret == false) {
+ // FIXME: This will remove the idler from GTK, we don't want to
+ // remove it as it is removed automatically when this function
+ // returns false (although, it should be harmless).
+ sciThis->SetIdle(false);
+ }
+#ifndef GDK_VERSION_3_6
+ gdk_threads_leave();
+#endif
+ return ret;
+}
+
+gboolean ScintillaGTK::StyleIdle(ScintillaGTK *sciThis) {
+#ifndef GDK_VERSION_3_6
+ gdk_threads_enter();
+#endif
+ sciThis->IdleWork();
+#ifndef GDK_VERSION_3_6
+ gdk_threads_leave();
+#endif
+ // Idler will be automatically stopped
+ return FALSE;
+}
+
+void ScintillaGTK::QueueIdleWork(WorkNeeded::workItems items, int upTo) {
+ Editor::QueueIdleWork(items, upTo);
+ if (!workNeeded.active) {
+ // Only allow one style needed to be queued
+ workNeeded.active = true;
+ g_idle_add_full(G_PRIORITY_HIGH_IDLE,
+ reinterpret_cast<GSourceFunc>(StyleIdle), this, NULL);
+ }
+}
+
+void ScintillaGTK::PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis) {
+ guint action = (sptr_t)(g_object_get_data(G_OBJECT(menuItem), "CmdNum"));
+ if (action) {
+ sciThis->Command(action);
+ }
+}
+
+gboolean ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis) {
+ try {
+ if (event->window != WindowFromWidget(widget))
+ return FALSE;
+ if (event->type != GDK_BUTTON_PRESS)
+ return FALSE;
+ Point pt;
+ pt.x = int(event->x);
+ pt.y = int(event->y);
+ sciThis->ct.MouseClick(pt);
+ sciThis->CallTipClick();
+ } catch (...) {
+ }
+ return TRUE;
+}
+
+#if GTK_CHECK_VERSION(3,0,0)
+
+gboolean ScintillaGTK::DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip) {
+ try {
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceWindow) {
+ surfaceWindow->Init(cr, widget);
+ surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage);
+ surfaceWindow->SetDBCSMode(ctip->codePage);
+ ctip->PaintCT(surfaceWindow);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ }
+ } catch (...) {
+ // No pointer back to Scintilla to save status
+ }
+ return TRUE;
+}
+
+#else
+
+gboolean ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip *ctip) {
+ try {
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
+ if (surfaceWindow) {
+ cairo_t *cr = gdk_cairo_create(WindowFromWidget(widget));
+ surfaceWindow->Init(cr, widget);
+ surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage);
+ surfaceWindow->SetDBCSMode(ctip->codePage);
+ ctip->PaintCT(surfaceWindow);
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ cairo_destroy(cr);
+ }
+ } catch (...) {
+ // No pointer back to Scintilla to save status
+ }
+ return TRUE;
+}
+
+#endif
+
+sptr_t ScintillaGTK::DirectFunction(
+ sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ return reinterpret_cast<ScintillaGTK *>(ptr)->WndProc(iMessage, wParam, lParam);
+}
+
+sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ ScintillaGTK *psci = reinterpret_cast<ScintillaGTK *>(sci->pscin);
+ return psci->WndProc(iMessage, wParam, lParam);
+}
+
+static void scintilla_class_init(ScintillaClass *klass);
+static void scintilla_init(ScintillaObject *sci);
+
+extern void Platform_Initialise();
+extern void Platform_Finalise();
+
+GType scintilla_get_type() {
+ static GType scintilla_type = 0;
+ try {
+
+ if (!scintilla_type) {
+ scintilla_type = g_type_from_name("Scintilla");
+ if (!scintilla_type) {
+ static GTypeInfo scintilla_info = {
+ (guint16) sizeof (ScintillaClass),
+ NULL, //(GBaseInitFunc)
+ NULL, //(GBaseFinalizeFunc)
+ (GClassInitFunc) scintilla_class_init,
+ NULL, //(GClassFinalizeFunc)
+ NULL, //gconstpointer data
+ (guint16) sizeof (ScintillaObject),
+ 0, //n_preallocs
+ (GInstanceInitFunc) scintilla_init,
+ NULL //(GTypeValueTable*)
+ };
+
+ scintilla_type = g_type_register_static(
+ GTK_TYPE_CONTAINER, "Scintilla", &scintilla_info, (GTypeFlags) 0);
+ }
+ }
+
+ } catch (...) {
+ }
+ return scintilla_type;
+}
+
+void ScintillaGTK::ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class) {
+ Platform_Initialise();
+#ifdef SCI_LEXER
+ Scintilla_LinkLexers();
+#endif
+ atomClipboard = gdk_atom_intern("CLIPBOARD", FALSE);
+ atomUTF8 = gdk_atom_intern("UTF8_STRING", FALSE);
+ atomString = GDK_SELECTION_TYPE_STRING;
+ atomUriList = gdk_atom_intern("text/uri-list", FALSE);
+ atomDROPFILES_DND = gdk_atom_intern("DROPFILES_DND", FALSE);
+
+ // Define default signal handlers for the class: Could move more
+ // of the signal handlers here (those that currently attached to wDraw
+ // in Initialise() may require coordinate translation?)
+
+ object_class->finalize = Destroy;
+#if GTK_CHECK_VERSION(3,0,0)
+ widget_class->get_preferred_width = GetPreferredWidth;
+ widget_class->get_preferred_height = GetPreferredHeight;
+#else
+ widget_class->size_request = SizeRequest;
+#endif
+ widget_class->size_allocate = SizeAllocate;
+#if GTK_CHECK_VERSION(3,0,0)
+ widget_class->draw = DrawMain;
+#else
+ widget_class->expose_event = ExposeMain;
+#endif
+ widget_class->motion_notify_event = Motion;
+ widget_class->button_press_event = Press;
+ widget_class->button_release_event = MouseRelease;
+ widget_class->scroll_event = ScrollEvent;
+ widget_class->key_press_event = KeyPress;
+ widget_class->key_release_event = KeyRelease;
+ widget_class->focus_in_event = FocusIn;
+ widget_class->focus_out_event = FocusOut;
+ widget_class->selection_received = SelectionReceived;
+ widget_class->selection_get = SelectionGet;
+ widget_class->selection_clear_event = SelectionClear;
+
+ widget_class->drag_data_received = DragDataReceived;
+ widget_class->drag_motion = DragMotion;
+ widget_class->drag_leave = DragLeave;
+ widget_class->drag_end = DragEnd;
+ widget_class->drag_drop = Drop;
+ widget_class->drag_data_get = DragDataGet;
+
+ widget_class->realize = Realize;
+ widget_class->unrealize = UnRealize;
+ widget_class->map = Map;
+ widget_class->unmap = UnMap;
+
+ container_class->forall = MainForAll;
+}
+
+#define SIG_MARSHAL scintilla_marshal_NONE__INT_POINTER
+#define MARSHAL_ARGUMENTS G_TYPE_INT, G_TYPE_POINTER
+
+static void scintilla_class_init(ScintillaClass *klass) {
+ try {
+ OBJECT_CLASS *object_class = (OBJECT_CLASS*) klass;
+ GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
+ GtkContainerClass *container_class = (GtkContainerClass*) klass;
+
+ GSignalFlags sigflags = GSignalFlags(G_SIGNAL_ACTION | G_SIGNAL_RUN_LAST);
+ scintilla_signals[COMMAND_SIGNAL] = g_signal_new(
+ "command",
+ G_TYPE_FROM_CLASS(object_class),
+ sigflags,
+ G_STRUCT_OFFSET(ScintillaClass, command),
+ NULL, //(GSignalAccumulator)
+ NULL, //(gpointer)
+ SIG_MARSHAL,
+ G_TYPE_NONE,
+ 2, MARSHAL_ARGUMENTS);
+
+ scintilla_signals[NOTIFY_SIGNAL] = g_signal_new(
+ SCINTILLA_NOTIFY,
+ G_TYPE_FROM_CLASS(object_class),
+ sigflags,
+ G_STRUCT_OFFSET(ScintillaClass, notify),
+ NULL,
+ NULL,
+ SIG_MARSHAL,
+ G_TYPE_NONE,
+ 2, MARSHAL_ARGUMENTS);
+
+ klass->command = NULL;
+ klass->notify = NULL;
+ scintilla_class_parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(klass));
+ ScintillaGTK::ClassInit(object_class, widget_class, container_class);
+ } catch (...) {
+ }
+}
+
+static void scintilla_init(ScintillaObject *sci) {
+ try {
+#if GTK_CHECK_VERSION(2,20,0)
+ gtk_widget_set_can_focus(GTK_WIDGET(sci), TRUE);
+#else
+ GTK_WIDGET_SET_FLAGS(sci, GTK_CAN_FOCUS);
+#endif
+ sci->pscin = new ScintillaGTK(sci);
+ } catch (...) {
+ }
+}
+
+GtkWidget* scintilla_new() {
+ GtkWidget *widget = GTK_WIDGET(g_object_new(scintilla_get_type(), NULL));
+ gtk_widget_set_direction(widget, GTK_TEXT_DIR_LTR);
+
+ return widget;
+}
+
+void scintilla_set_id(ScintillaObject *sci, uptr_t id) {
+ ScintillaGTK *psci = reinterpret_cast<ScintillaGTK *>(sci->pscin);
+ psci->ctrlID = id;
+}
+
+void scintilla_release_resources(void) {
+ try {
+ Platform_Finalise();
+ } catch (...) {
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/deps.mak b/3rdparty/bgfx/3rdparty/scintilla/gtk/deps.mak
new file mode 100644
index 00000000000..4b042e9f8f9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/deps.mak
@@ -0,0 +1,538 @@
+PlatGTK.o: PlatGTK.cxx \
+ ../include/Scintilla.h ../include/ScintillaWidget.h \
+ ../lexlib/StringCopy.h ../src/XPM.h ../src/UniConversion.h Converter.h
+ScintillaGTK.o: ScintillaGTK.cxx \
+ ../include/ILexer.h ../include/Scintilla.h ../include/ScintillaWidget.h \
+ ../include/SciLexer.h ../lexlib/StringCopy.h ../lexlib/LexerModule.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \
+ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
+ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \
+ ../src/CaseConvert.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h ../src/Editor.h ../src/AutoComplete.h \
+ ../src/ScintillaBase.h ../src/ExternalLexer.h scintilla-marshal.h \
+ Converter.h
+AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/CharacterSet.h ../src/AutoComplete.h
+CallTip.o: ../src/CallTip.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/CallTip.h
+CaseConvert.o: ../src/CaseConvert.cxx ../lexlib/StringCopy.h \
+ ../src/CaseConvert.h ../src/UniConversion.h ../src/UnicodeFromUTF8.h
+CaseFolder.o: ../src/CaseFolder.cxx ../src/CaseFolder.h \
+ ../src/CaseConvert.h ../src/UniConversion.h
+Catalogue.o: ../src/Catalogue.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/LexerModule.h \
+ ../src/Catalogue.h
+CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/CellBuffer.h ../src/UniConversion.h
+CharClassify.o: ../src/CharClassify.cxx ../src/CharClassify.h
+ContractionState.o: ../src/ContractionState.cxx ../include/Platform.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h
+Decoration.o: ../src/Decoration.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h ../src/Decoration.h
+Document.o: ../src/Document.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/CharacterSet.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
+ ../src/PerLine.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/RESearch.h \
+ ../src/UniConversion.h
+EditModel.o: ../src/EditModel.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/StringCopy.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \
+ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
+ ../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/UniConversion.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h
+EditView.o: ../src/EditView.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h
+Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h ../src/Editor.h
+ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../include/SciLexer.h \
+ ../lexlib/LexerModule.h ../src/Catalogue.h ../src/ExternalLexer.h
+Indicator.o: ../src/Indicator.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/Indicator.h ../src/XPM.h
+KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
+ ../src/KeyMap.h
+LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/XPM.h \
+ ../src/LineMarker.h
+MarginView.o: ../src/MarginView.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/StringCopy.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \
+ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
+ ../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/UniConversion.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h \
+ ../src/MarginView.h ../src/EditView.h
+PerLine.o: ../src/PerLine.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/CellBuffer.h ../src/PerLine.h
+PositionCache.o: ../src/PositionCache.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h
+RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
+RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h
+ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h ../lexlib/LexerModule.h ../src/Catalogue.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \
+ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
+ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h \
+ ../src/MarginView.h ../src/EditView.h ../src/Editor.h \
+ ../src/AutoComplete.h ../src/ScintillaBase.h
+Selection.o: ../src/Selection.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/Selection.h
+Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
+ ../src/Style.h
+UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h
+ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h
+XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h
+Accessor.o: ../lexlib/Accessor.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h
+CharacterCategory.o: ../lexlib/CharacterCategory.cxx \
+ ../lexlib/StringCopy.h ../lexlib/CharacterCategory.h
+CharacterSet.o: ../lexlib/CharacterSet.cxx ../lexlib/CharacterSet.h
+LexerBase.o: ../lexlib/LexerBase.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h
+LexerModule.o: ../lexlib/LexerModule.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h ../lexlib/LexerSimple.h
+LexerNoExceptions.o: ../lexlib/LexerNoExceptions.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h \
+ ../lexlib/LexerNoExceptions.h
+LexerSimple.o: ../lexlib/LexerSimple.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h ../lexlib/LexerSimple.h
+PropSetSimple.o: ../lexlib/PropSetSimple.cxx ../lexlib/PropSetSimple.h
+StyleContext.o: ../lexlib/StyleContext.cxx ../include/ILexer.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h
+WordList.o: ../lexlib/WordList.cxx ../lexlib/StringCopy.h \
+ ../lexlib/WordList.h
+LexA68k.o: ../lexers/LexA68k.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexAPDL.o: ../lexers/LexAPDL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexASY.o: ../lexers/LexASY.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAU3.o: ../lexers/LexAU3.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAVE.o: ../lexers/LexAVE.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAVS.o: ../lexers/LexAVS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAbaqus.o: ../lexers/LexAbaqus.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexAda.o: ../lexers/LexAda.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAsm.o: ../lexers/LexAsm.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexAsn1.o: ../lexers/LexAsn1.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexBaan.o: ../lexers/LexBaan.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexBash.o: ../lexers/LexBash.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexBasic.o: ../lexers/LexBasic.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexBullant.o: ../lexers/LexBullant.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCLW.o: ../lexers/LexCLW.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexCOBOL.o: ../lexers/LexCOBOL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCPP.o: ../lexers/LexCPP.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h \
+ ../lexlib/SubStyles.h
+LexCSS.o: ../lexers/LexCSS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexCaml.o: ../lexers/LexCaml.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexCmake.o: ../lexers/LexCmake.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCoffeeScript.o: ../lexers/LexCoffeeScript.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../include/SciLexer.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexConf.o: ../lexers/LexConf.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCrontab.o: ../lexers/LexCrontab.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCsound.o: ../lexers/LexCsound.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexD.o: ../lexers/LexD.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexDMAP.o: ../lexers/LexDMAP.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexDMIS.o: ../lexers/LexDMIS.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexECL.o: ../lexers/LexECL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/PropSetSimple.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexEScript.o: ../lexers/LexEScript.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexEiffel.o: ../lexers/LexEiffel.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexErlang.o: ../lexers/LexErlang.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexFlagship.o: ../lexers/LexFlagship.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexForth.o: ../lexers/LexForth.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexFortran.o: ../lexers/LexFortran.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexGAP.o: ../lexers/LexGAP.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexGui4Cli.o: ../lexers/LexGui4Cli.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexHTML.o: ../lexers/LexHTML.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/StringCopy.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexHaskell.o: ../lexers/LexHaskell.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/CharacterCategory.h ../lexlib/LexerModule.h \
+ ../lexlib/OptionSet.h
+LexInno.o: ../lexers/LexInno.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexKVIrc.o: ../lexers/LexKVIrc.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexKix.o: ../lexers/LexKix.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexLaTeX.o: ../lexers/LexLaTeX.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h
+LexLisp.o: ../lexers/LexLisp.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexLout.o: ../lexers/LexLout.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexLua.o: ../lexers/LexLua.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMMIXAL.o: ../lexers/LexMMIXAL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMPT.o: ../lexers/LexMPT.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMSSQL.o: ../lexers/LexMSSQL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMagik.o: ../lexers/LexMagik.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMarkdown.o: ../lexers/LexMarkdown.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMatlab.o: ../lexers/LexMatlab.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMetapost.o: ../lexers/LexMetapost.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexModula.o: ../lexers/LexModula.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMySQL.o: ../lexers/LexMySQL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexNimrod.o: ../lexers/LexNimrod.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexNsis.o: ../lexers/LexNsis.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOScript.o: ../lexers/LexOScript.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOpal.o: ../lexers/LexOpal.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOthers.o: ../lexers/LexOthers.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPB.o: ../lexers/LexPB.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPLM.o: ../lexers/LexPLM.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPO.o: ../lexers/LexPO.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPOV.o: ../lexers/LexPOV.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPS.o: ../lexers/LexPS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPascal.o: ../lexers/LexPascal.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPerl.o: ../lexers/LexPerl.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexPowerPro.o: ../lexers/LexPowerPro.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPowerShell.o: ../lexers/LexPowerShell.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexProgress.o: ../lexers/LexProgress.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPython.o: ../lexers/LexPython.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexR.o: ../lexers/LexR.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexRebol.o: ../lexers/LexRebol.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexRuby.o: ../lexers/LexRuby.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexRust.o: ../lexers/LexRust.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexSML.o: ../lexers/LexSML.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexSQL.o: ../lexers/LexSQL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h
+LexSTTXT.o: ../lexers/LexSTTXT.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexScriptol.o: ../lexers/LexScriptol.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSmalltalk.o: ../lexers/LexSmalltalk.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSorcus.o: ../lexers/LexSorcus.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSpecman.o: ../lexers/LexSpecman.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSpice.o: ../lexers/LexSpice.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTACL.o: ../lexers/LexTACL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTADS3.o: ../lexers/LexTADS3.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTAL.o: ../lexers/LexTAL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTCL.o: ../lexers/LexTCL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTCMD.o: ../lexers/LexTCMD.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTeX.o: ../lexers/LexTeX.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTxt2tags.o: ../lexers/LexTxt2tags.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVB.o: ../lexers/LexVB.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexVHDL.o: ../lexers/LexVHDL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVerilog.o: ../lexers/LexVerilog.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVisualProlog.o: ../lexers/LexVisualProlog.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/CharacterCategory.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexYAML.o: ../lexers/LexYAML.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile b/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile
new file mode 100644
index 00000000000..cdf1aa16e4b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile
@@ -0,0 +1,106 @@
+# Make file for Scintilla on Linux or compatible OS
+# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+# The License.txt file describes the conditions under which this software may be distributed.
+# This makefile assumes GCC 4.3 is used and changes will be needed to use other compilers.
+# GNU make does not like \r\n line endings so should be saved to CVS in binary form.
+# Builds for GTK+ 2 and no longer supports GTK+ 1.
+# Also works with ming32-make on Windows.
+
+.SUFFIXES: .cxx .c .o .h .a
+ifdef CLANG
+CXX = clang++ -Wno-deprecated-register
+CC = clang
+# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
+# thread also need to create Position Independent Executable -> search online documentation
+SANITIZE = address
+#SANITIZE = undefined
+endif
+RANLIB = touch
+
+ifdef GTK3
+GTKVERSION=gtk+-3.0
+else
+GTKVERSION=gtk+-2.0
+endif
+
+# Environment variable windir always defined on Win32
+
+ifndef windir
+ifeq ($(shell uname),Darwin)
+RANLIB = ranlib
+endif
+endif
+
+ifdef windir
+DEL = del /q
+COMPLIB=..\bin\scintilla.a
+else
+DEL = rm -f
+COMPLIB=../bin/scintilla.a
+endif
+
+vpath %.h ../src ../include ../lexlib
+vpath %.cxx ../src ../lexlib ../lexers
+
+INCLUDEDIRS=-I ../include -I ../src -I ../lexlib
+ifdef CHECK_DEPRECATED
+DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
+endif
+CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
+
+ifdef NOTHREADS
+THREADFLAGS=-DG_THREADS_IMPL_NONE
+else
+THREADFLAGS=
+endif
+
+ifdef CXX11_REGEX
+REFLAGS=-DCXX11_REGEX
+endif
+
+ifdef DEBUG
+ifdef CLANG
+CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS)
+else
+CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS)
+endif
+else
+CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
+endif
+
+CFLAGS:=$(CTFLAGS)
+CXXTFLAGS:=--std=c++0x $(CTFLAGS) $(REFLAGS)
+
+CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
+MARSHALLER=scintilla-marshal.o
+
+.cxx.o:
+ $(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
+.c.o:
+ $(CC) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
+
+LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
+
+all: $(COMPLIB)
+
+clean:
+ $(DEL) *.o $(COMPLIB) *.plist
+
+analyze:
+ clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
+
+deps:
+ $(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak
+
+$(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \
+ CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \
+ ScintillaBase.o ContractionState.o EditModel.o Editor.o EditView.o ExternalLexer.o MarginView.o \
+ PropSetSimple.o PlatGTK.o \
+ KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \
+ RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
+ $(MARSHALLER) $(LEXOBJS)
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+# Automatically generate header dependencies with "make deps"
+include deps.mak
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile.orig b/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile.orig
new file mode 100644
index 00000000000..ad11a29f4bb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/makefile.orig
@@ -0,0 +1,105 @@
+# Make file for Scintilla on Linux or compatible OS
+# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+# The License.txt file describes the conditions under which this software may be distributed.
+# This makefile assumes GCC 4.3 is used and changes will be needed to use other compilers.
+# GNU make does not like \r\n line endings so should be saved to CVS in binary form.
+# Builds for GTK+ 2 and no longer supports GTK+ 1.
+# Also works with ming32-make on Windows.
+
+.SUFFIXES: .cxx .c .o .h .a
+ifdef CLANG
+CC = clang++
+CCOMP = clang
+# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
+# thread also need to create Position Independent Executable -> search online documentation
+SANITIZE = address
+#SANITIZE = undefined
+else
+CC = g++ -mrecip
+CCOMP = gcc -mrecip
+endif
+AR = ar
+RANLIB = touch
+
+ifdef GTK3
+GTKVERSION=gtk+-3.0
+else
+GTKVERSION=gtk+-2.0
+endif
+
+# Environment variable windir always defined on Win32
+
+ifndef windir
+ifeq ($(shell uname),Darwin)
+RANLIB = ranlib
+endif
+endif
+
+ifdef windir
+DEL = del /q
+COMPLIB=..\bin\scintilla.a
+else
+DEL = rm -f
+COMPLIB=../bin/scintilla.a
+endif
+
+vpath %.h ../src ../include ../lexlib
+vpath %.cxx ../src ../lexlib ../lexers
+
+INCLUDEDIRS=-I ../include -I ../src -I ../lexlib
+ifdef CHECK_DEPRECATED
+DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
+endif
+CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
+
+ifdef NOTHREADS
+THREADFLAGS=-DG_THREADS_IMPL_NONE
+else
+THREADFLAGS=
+endif
+
+ifdef DEBUG
+ifdef CLANG
+CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS)
+else
+CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS)
+endif
+else
+CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
+endif
+
+CFLAGS:=$(CTFLAGS)
+CXXTFLAGS:=--std=c++0x $(CTFLAGS)
+
+CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
+MARSHALLER=scintilla-marshal.o
+
+.cxx.o:
+ $(CC) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
+.c.o:
+ $(CCOMP) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
+
+LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
+
+all: $(COMPLIB)
+
+clean:
+ $(DEL) *.o $(COMPLIB) *.plist
+
+analyze:
+ clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
+
+deps:
+ $(CC) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak
+
+$(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \
+ CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \
+ ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSetSimple.o PlatGTK.o \
+ KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \
+ RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
+ $(MARSHALLER) $(LEXOBJS)
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+# Automatically generate header dependencies with "make deps"
+include deps.mak
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.c b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.c
new file mode 100644
index 00000000000..be57b7c2ed7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.c
@@ -0,0 +1,86 @@
+
+#include <glib-object.h>
+
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v) g_value_get_int (v)
+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+#define g_marshal_value_peek_long(v) g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
+#define g_marshal_value_peek_float(v) g_value_get_float (v)
+#define g_marshal_value_peek_double(v) g_value_get_double (v)
+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v) g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v) g_value_get_object (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ * Do not access GValues directly in your code. Instead, use the
+ * g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_int
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+
+/* NONE:INT,POINTER (scintilla-marshal.list:1) */
+void
+scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
+{
+ typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer data1,
+ gint arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_VOID__INT_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__INT_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ callback (data1,
+ g_marshal_value_peek_int (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.h b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.h
new file mode 100644
index 00000000000..9116a56c9a2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.h
@@ -0,0 +1,21 @@
+
+#ifndef __scintilla_marshal_MARSHAL_H__
+#define __scintilla_marshal_MARSHAL_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* NONE:INT,POINTER (scintilla-marshal.list:1) */
+extern void scintilla_marshal_VOID__INT_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+#define scintilla_marshal_NONE__INT_POINTER scintilla_marshal_VOID__INT_POINTER
+
+G_END_DECLS
+
+#endif /* __scintilla_marshal_MARSHAL_H__ */
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.list b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.list
new file mode 100644
index 00000000000..e5750ecb655
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/gtk/scintilla-marshal.list
@@ -0,0 +1 @@
+NONE:INT,POINTER
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/ILexer.h b/3rdparty/bgfx/3rdparty/scintilla/include/ILexer.h
new file mode 100644
index 00000000000..b900927507f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/ILexer.h
@@ -0,0 +1,98 @@
+// Scintilla source code edit control
+/** @file ILexer.h
+ ** Interface between Scintilla and lexers.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef ILEXER_H
+#define ILEXER_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+#ifdef _WIN32
+ #define SCI_METHOD __stdcall
+#else
+ #define SCI_METHOD
+#endif
+
+enum { dvOriginal=0, dvLineEnd=1 };
+
+class IDocument {
+public:
+ virtual int SCI_METHOD Version() const = 0;
+ virtual void SCI_METHOD SetErrorStatus(int status) = 0;
+ virtual int SCI_METHOD Length() const = 0;
+ virtual void SCI_METHOD GetCharRange(char *buffer, int position, int lengthRetrieve) const = 0;
+ virtual char SCI_METHOD StyleAt(int position) const = 0;
+ virtual int SCI_METHOD LineFromPosition(int position) const = 0;
+ virtual int SCI_METHOD LineStart(int line) const = 0;
+ virtual int SCI_METHOD GetLevel(int line) const = 0;
+ virtual int SCI_METHOD SetLevel(int line, int level) = 0;
+ virtual int SCI_METHOD GetLineState(int line) const = 0;
+ virtual int SCI_METHOD SetLineState(int line, int state) = 0;
+ virtual void SCI_METHOD StartStyling(int position, char mask) = 0;
+ virtual bool SCI_METHOD SetStyleFor(int length, char style) = 0;
+ virtual bool SCI_METHOD SetStyles(int length, const char *styles) = 0;
+ virtual void SCI_METHOD DecorationSetCurrentIndicator(int indicator) = 0;
+ virtual void SCI_METHOD DecorationFillRange(int position, int value, int fillLength) = 0;
+ virtual void SCI_METHOD ChangeLexerState(int start, int end) = 0;
+ virtual int SCI_METHOD CodePage() const = 0;
+ virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0;
+ virtual const char * SCI_METHOD BufferPointer() = 0;
+ virtual int SCI_METHOD GetLineIndentation(int line) = 0;
+};
+
+class IDocumentWithLineEnd : public IDocument {
+public:
+ virtual int SCI_METHOD LineEnd(int line) const = 0;
+ virtual int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const = 0;
+ virtual int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const = 0;
+};
+
+enum { lvOriginal=0, lvSubStyles=1 };
+
+class ILexer {
+public:
+ virtual int SCI_METHOD Version() const = 0;
+ virtual void SCI_METHOD Release() = 0;
+ virtual const char * SCI_METHOD PropertyNames() = 0;
+ virtual int SCI_METHOD PropertyType(const char *name) = 0;
+ virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0;
+ virtual int SCI_METHOD PropertySet(const char *key, const char *val) = 0;
+ virtual const char * SCI_METHOD DescribeWordListSets() = 0;
+ virtual int SCI_METHOD WordListSet(int n, const char *wl) = 0;
+ virtual void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ virtual void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0;
+};
+
+class ILexerWithSubStyles : public ILexer {
+public:
+ virtual int SCI_METHOD LineEndTypesSupported() = 0;
+ virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
+ virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
+ virtual int SCI_METHOD SubStylesLength(int styleBase) = 0;
+ virtual int SCI_METHOD StyleFromSubStyle(int subStyle) = 0;
+ virtual int SCI_METHOD PrimaryStyleFromStyle(int style) = 0;
+ virtual void SCI_METHOD FreeSubStyles() = 0;
+ virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
+ virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
+ virtual const char * SCI_METHOD GetSubStyleBases() = 0;
+};
+
+class ILoader {
+public:
+ virtual int SCI_METHOD Release() = 0;
+ // Returns a status code from SC_STATUS_*
+ virtual int SCI_METHOD AddData(char *data, int length) = 0;
+ virtual void * SCI_METHOD ConvertToDocument() = 0;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/Platform.h b/3rdparty/bgfx/3rdparty/scintilla/include/Platform.h
new file mode 100644
index 00000000000..9da75f4003f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/Platform.h
@@ -0,0 +1,539 @@
+// Scintilla source code edit control
+/** @file Platform.h
+ ** Interface to platform facilities. Also includes some basic utilities.
+ ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows.
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+// PLAT_GTK = GTK+ on Linux or Win32
+// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32
+// PLAT_WIN = Win32 API on Win32 OS
+// PLAT_WX is wxWindows on any supported platform
+// PLAT_TK = Tcl/TK on Linux or Win32
+
+#define PLAT_GTK 0
+#define PLAT_GTK_WIN32 0
+#define PLAT_GTK_MACOSX 0
+#define PLAT_MACOSX 0
+#define PLAT_WIN 0
+#define PLAT_WX 0
+#define PLAT_QT 0
+#define PLAT_FOX 0
+#define PLAT_CURSES 0
+#define PLAT_TK 0
+
+#if defined(FOX)
+#undef PLAT_FOX
+#define PLAT_FOX 1
+
+#elif defined(__WX__)
+#undef PLAT_WX
+#define PLAT_WX 1
+
+#elif defined(CURSES)
+#undef PLAT_CURSES
+#define PLAT_CURSES 1
+
+#elif defined(SCINTILLA_QT)
+#undef PLAT_QT
+#define PLAT_QT 1
+
+#elif defined(TK)
+#undef PLAT_TK
+#define PLAT_TK 1
+
+#elif defined(GTK)
+#undef PLAT_GTK
+#define PLAT_GTK 1
+
+#if defined(__WIN32__) || defined(_MSC_VER)
+#undef PLAT_GTK_WIN32
+#define PLAT_GTK_WIN32 1
+#endif
+
+#if defined(__APPLE__)
+#undef PLAT_GTK_MACOSX
+#define PLAT_GTK_MACOSX 1
+#endif
+
+#elif defined(__APPLE__)
+
+#undef PLAT_MACOSX
+#define PLAT_MACOSX 1
+
+#elif defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
+#undef PLAT_WIN
+#define PLAT_WIN 1
+
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+typedef float XYPOSITION;
+typedef double XYACCUMULATOR;
+inline int RoundXYPosition(XYPOSITION xyPos) {
+ return int(xyPos + 0.5);
+}
+
+// Underlying the implementation of the platform classes are platform specific types.
+// Sometimes these need to be passed around by client code so they are defined here
+
+typedef void *FontID;
+typedef void *SurfaceID;
+typedef void *WindowID;
+typedef void *MenuID;
+typedef void *TickerID;
+typedef void *Function;
+typedef void *IdlerID;
+
+/**
+ * A geometric point class.
+ * Point is similar to the Win32 POINT and GTK+ GdkPoint types.
+ */
+class Point {
+public:
+ XYPOSITION x;
+ XYPOSITION y;
+
+ explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) {
+ }
+
+ static Point FromInts(int x_, int y_) {
+ return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_));
+ }
+
+ // Other automatically defined methods (assignment, copy constructor, destructor) are fine
+
+ static Point FromLong(long lpoint);
+};
+
+/**
+ * A geometric rectangle class.
+ * PRectangle is similar to the Win32 RECT.
+ * PRectangles contain their top and left sides, but not their right and bottom sides.
+ */
+class PRectangle {
+public:
+ XYPOSITION left;
+ XYPOSITION top;
+ XYPOSITION right;
+ XYPOSITION bottom;
+
+ explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
+ left(left_), top(top_), right(right_), bottom(bottom_) {
+ }
+
+ static PRectangle FromInts(int left_, int top_, int right_, int bottom_) {
+ return PRectangle(static_cast<XYPOSITION>(left_), static_cast<XYPOSITION>(top_),
+ static_cast<XYPOSITION>(right_), static_cast<XYPOSITION>(bottom_));
+ }
+
+ // Other automatically defined methods (assignment, copy constructor, destructor) are fine
+
+ bool operator==(PRectangle &rc) const {
+ return (rc.left == left) && (rc.right == right) &&
+ (rc.top == top) && (rc.bottom == bottom);
+ }
+ bool Contains(Point pt) const {
+ return (pt.x >= left) && (pt.x <= right) &&
+ (pt.y >= top) && (pt.y <= bottom);
+ }
+ bool ContainsWholePixel(Point pt) const {
+ // Does the rectangle contain all of the pixel to left/below the point
+ return (pt.x >= left) && ((pt.x+1) <= right) &&
+ (pt.y >= top) && ((pt.y+1) <= bottom);
+ }
+ bool Contains(PRectangle rc) const {
+ return (rc.left >= left) && (rc.right <= right) &&
+ (rc.top >= top) && (rc.bottom <= bottom);
+ }
+ bool Intersects(PRectangle other) const {
+ return (right > other.left) && (left < other.right) &&
+ (bottom > other.top) && (top < other.bottom);
+ }
+ void Move(XYPOSITION xDelta, XYPOSITION yDelta) {
+ left += xDelta;
+ top += yDelta;
+ right += xDelta;
+ bottom += yDelta;
+ }
+ XYPOSITION Width() const { return right - left; }
+ XYPOSITION Height() const { return bottom - top; }
+ bool Empty() const {
+ return (Height() <= 0) || (Width() <= 0);
+ }
+};
+
+/**
+ * Holds a desired RGB colour.
+ */
+class ColourDesired {
+ long co;
+public:
+ ColourDesired(long lcol=0) {
+ co = lcol;
+ }
+
+ ColourDesired(unsigned int red, unsigned int green, unsigned int blue) {
+ Set(red, green, blue);
+ }
+
+ bool operator==(const ColourDesired &other) const {
+ return co == other.co;
+ }
+
+ void Set(long lcol) {
+ co = lcol;
+ }
+
+ void Set(unsigned int red, unsigned int green, unsigned int blue) {
+ co = red | (green << 8) | (blue << 16);
+ }
+
+ static inline unsigned int ValueOfHex(const char ch) {
+ if (ch >= '0' && ch <= '9')
+ return ch - '0';
+ else if (ch >= 'A' && ch <= 'F')
+ return ch - 'A' + 10;
+ else if (ch >= 'a' && ch <= 'f')
+ return ch - 'a' + 10;
+ else
+ return 0;
+ }
+
+ void Set(const char *val) {
+ if (*val == '#') {
+ val++;
+ }
+ unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]);
+ unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]);
+ unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]);
+ Set(r, g, b);
+ }
+
+ long AsLong() const {
+ return co;
+ }
+
+ unsigned int GetRed() const {
+ return co & 0xff;
+ }
+
+ unsigned int GetGreen() const {
+ return (co >> 8) & 0xff;
+ }
+
+ unsigned int GetBlue() const {
+ return (co >> 16) & 0xff;
+ }
+};
+
+/**
+ * Font management.
+ */
+
+struct FontParameters {
+ const char *faceName;
+ float size;
+ int weight;
+ bool italic;
+ int extraFontFlag;
+ int technology;
+ int characterSet;
+
+ FontParameters(
+ const char *faceName_,
+ float size_=10,
+ int weight_=400,
+ bool italic_=false,
+ int extraFontFlag_=0,
+ int technology_=0,
+ int characterSet_=0) :
+
+ faceName(faceName_),
+ size(size_),
+ weight(weight_),
+ italic(italic_),
+ extraFontFlag(extraFontFlag_),
+ technology(technology_),
+ characterSet(characterSet_)
+ {
+ }
+
+};
+
+class Font {
+protected:
+ FontID fid;
+ // Private so Font objects can not be copied
+ Font(const Font &);
+ Font &operator=(const Font &);
+public:
+ Font();
+ virtual ~Font();
+
+ virtual void Create(const FontParameters &fp);
+ virtual void Release();
+
+ FontID GetID() { return fid; }
+ // Alias another font - caller guarantees not to Release
+ void SetID(FontID fid_) { fid = fid_; }
+ friend class Surface;
+ friend class SurfaceImpl;
+};
+
+/**
+ * A surface abstracts a place to draw.
+ */
+class Surface {
+private:
+ // Private so Surface objects can not be copied
+ Surface(const Surface &) {}
+ Surface &operator=(const Surface &) { return *this; }
+public:
+ Surface() {}
+ virtual ~Surface() {}
+ static Surface *Allocate(int technology);
+
+ virtual void Init(WindowID wid)=0;
+ virtual void Init(SurfaceID sid, WindowID wid)=0;
+ virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0;
+
+ virtual void Release()=0;
+ virtual bool Initialised()=0;
+ virtual void PenColour(ColourDesired fore)=0;
+ virtual int LogPixelsY()=0;
+ virtual int DeviceHeightFont(int points)=0;
+ virtual void MoveTo(int x_, int y_)=0;
+ virtual void LineTo(int x_, int y_)=0;
+ virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back)=0;
+ virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void FillRectangle(PRectangle rc, ColourDesired back)=0;
+ virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
+ virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags)=0;
+ virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0;
+ virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;
+
+ virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
+ virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
+ virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0;
+ virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0;
+ virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0;
+ virtual XYPOSITION WidthChar(Font &font_, char ch)=0;
+ virtual XYPOSITION Ascent(Font &font_)=0;
+ virtual XYPOSITION Descent(Font &font_)=0;
+ virtual XYPOSITION InternalLeading(Font &font_)=0;
+ virtual XYPOSITION ExternalLeading(Font &font_)=0;
+ virtual XYPOSITION Height(Font &font_)=0;
+ virtual XYPOSITION AverageCharWidth(Font &font_)=0;
+
+ virtual void SetClip(PRectangle rc)=0;
+ virtual void FlushCachedState()=0;
+
+ virtual void SetUnicodeMode(bool unicodeMode_)=0;
+ virtual void SetDBCSMode(int codePage)=0;
+};
+
+/**
+ * A simple callback action passing one piece of untyped user data.
+ */
+typedef void (*CallBackAction)(void*);
+
+/**
+ * Class to hide the details of window manipulation.
+ * Does not own the window which will normally have a longer life than this object.
+ */
+class Window {
+protected:
+ WindowID wid;
+public:
+ Window() : wid(0), cursorLast(cursorInvalid) {
+ }
+ Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) {
+ }
+ virtual ~Window();
+ Window &operator=(WindowID wid_) {
+ wid = wid_;
+ return *this;
+ }
+ WindowID GetID() const { return wid; }
+ bool Created() const { return wid != 0; }
+ void Destroy();
+ bool HasFocus();
+ PRectangle GetPosition();
+ void SetPosition(PRectangle rc);
+ void SetPositionRelative(PRectangle rc, Window relativeTo);
+ PRectangle GetClientPosition();
+ void Show(bool show=true);
+ void InvalidateAll();
+ void InvalidateRectangle(PRectangle rc);
+ virtual void SetFont(Font &font);
+ enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
+ void SetCursor(Cursor curs);
+ void SetTitle(const char *s);
+ PRectangle GetMonitorRect(Point pt);
+private:
+ Cursor cursorLast;
+};
+
+/**
+ * Listbox management.
+ */
+
+class ListBox : public Window {
+public:
+ ListBox();
+ virtual ~ListBox();
+ static ListBox *Allocate();
+
+ virtual void SetFont(Font &font)=0;
+ virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0;
+ virtual void SetAverageCharWidth(int width)=0;
+ virtual void SetVisibleRows(int rows)=0;
+ virtual int GetVisibleRows() const=0;
+ virtual PRectangle GetDesiredRect()=0;
+ virtual int CaretFromEdge()=0;
+ virtual void Clear()=0;
+ virtual void Append(char *s, int type = -1)=0;
+ virtual int Length()=0;
+ virtual void Select(int n)=0;
+ virtual int GetSelection()=0;
+ virtual int Find(const char *prefix)=0;
+ virtual void GetValue(int n, char *value, int len)=0;
+ virtual void RegisterImage(int type, const char *xpm_data)=0;
+ virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0;
+ virtual void ClearRegisteredImages()=0;
+ virtual void SetDoubleClickAction(CallBackAction, void *)=0;
+ virtual void SetList(const char* list, char separator, char typesep)=0;
+};
+
+/**
+ * Menu management.
+ */
+class Menu {
+ MenuID mid;
+public:
+ Menu();
+ MenuID GetID() { return mid; }
+ void CreatePopUp();
+ void Destroy();
+ void Show(Point pt, Window &w);
+};
+
+class ElapsedTime {
+ long bigBit;
+ long littleBit;
+public:
+ ElapsedTime();
+ double Duration(bool reset=false);
+};
+
+/**
+ * Dynamic Library (DLL/SO/...) loading
+ */
+class DynamicLibrary {
+public:
+ virtual ~DynamicLibrary() {}
+
+ /// @return Pointer to function "name", or NULL on failure.
+ virtual Function FindFunction(const char *name) = 0;
+
+ /// @return true if the library was loaded successfully.
+ virtual bool IsValid() = 0;
+
+ /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded.
+ static DynamicLibrary *Load(const char *modulePath);
+};
+
+#if defined(__clang__)
+# if __has_feature(attribute_analyzer_noreturn)
+# define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
+# else
+# define CLANG_ANALYZER_NORETURN
+# endif
+#else
+# define CLANG_ANALYZER_NORETURN
+#endif
+
+/**
+ * Platform class used to retrieve system wide parameters such as double click speed
+ * and chrome colour. Not a creatable object, more of a module with several functions.
+ */
+class Platform {
+ // Private so Platform objects can not be copied
+ Platform(const Platform &) {}
+ Platform &operator=(const Platform &) { return *this; }
+public:
+ // Should be private because no new Platforms are ever created
+ // but gcc warns about this
+ Platform() {}
+ ~Platform() {}
+ static ColourDesired Chrome();
+ static ColourDesired ChromeHighlight();
+ static const char *DefaultFont();
+ static int DefaultFontSize();
+ static unsigned int DoubleClickTime();
+ static bool MouseButtonBounce();
+ static void DebugDisplay(const char *s);
+ static bool IsKeyDown(int key);
+ static long SendScintilla(
+ WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0);
+ static long SendScintillaPointer(
+ WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0);
+ static bool IsDBCSLeadByte(int codePage, char ch);
+ static int DBCSCharLength(int codePage, const char *s);
+ static int DBCSCharMaxLength();
+
+ // These are utility functions not really tied to a platform
+ static int Minimum(int a, int b);
+ static int Maximum(int a, int b);
+ // Next three assume 16 bit shorts and 32 bit longs
+ static long LongFromTwoShorts(short a,short b) {
+ return (a) | ((b) << 16);
+ }
+ static short HighShortFromLong(long x) {
+ return static_cast<short>(x >> 16);
+ }
+ static short LowShortFromLong(long x) {
+ return static_cast<short>(x & 0xffff);
+ }
+ static void DebugPrintf(const char *format, ...);
+ static bool ShowAssertionPopUps(bool assertionPopUps_);
+ static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN;
+ static int Clamp(int val, int minVal, int maxVal);
+};
+
+#ifdef NDEBUG
+#define PLATFORM_ASSERT(c) ((void)0)
+#else
+#ifdef SCI_NAMESPACE
+#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__))
+#else
+#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__))
+#endif
+#endif
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
+#if defined(__EXCEPTIONS)
+#else
+# define try if (1)
+# define catch(...) else if (0)
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/SciLexer.h b/3rdparty/bgfx/3rdparty/scintilla/include/SciLexer.h
new file mode 100644
index 00000000000..034060a4bb3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/SciLexer.h
@@ -0,0 +1,1773 @@
+/* Scintilla source code edit control */
+/** @file SciLexer.h
+ ** Interface to the added lexer functions in the SciLexer version of the edit control.
+ **/
+/* Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed. */
+
+/* Most of this file is automatically generated from the Scintilla.iface interface definition
+ * file which contains any comments about the definitions. HFacer.py does the generation. */
+
+#ifndef SCILEXER_H
+#define SCILEXER_H
+
+/* SciLexer features - not in standard Scintilla */
+
+/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+#define SCLEX_CONTAINER 0
+#define SCLEX_NULL 1
+#define SCLEX_PYTHON 2
+#define SCLEX_CPP 3
+#define SCLEX_HTML 4
+#define SCLEX_XML 5
+#define SCLEX_PERL 6
+#define SCLEX_SQL 7
+#define SCLEX_VB 8
+#define SCLEX_PROPERTIES 9
+#define SCLEX_ERRORLIST 10
+#define SCLEX_MAKEFILE 11
+#define SCLEX_BATCH 12
+#define SCLEX_XCODE 13
+#define SCLEX_LATEX 14
+#define SCLEX_LUA 15
+#define SCLEX_DIFF 16
+#define SCLEX_CONF 17
+#define SCLEX_PASCAL 18
+#define SCLEX_AVE 19
+#define SCLEX_ADA 20
+#define SCLEX_LISP 21
+#define SCLEX_RUBY 22
+#define SCLEX_EIFFEL 23
+#define SCLEX_EIFFELKW 24
+#define SCLEX_TCL 25
+#define SCLEX_NNCRONTAB 26
+#define SCLEX_BULLANT 27
+#define SCLEX_VBSCRIPT 28
+#define SCLEX_BAAN 31
+#define SCLEX_MATLAB 32
+#define SCLEX_SCRIPTOL 33
+#define SCLEX_ASM 34
+#define SCLEX_CPPNOCASE 35
+#define SCLEX_FORTRAN 36
+#define SCLEX_F77 37
+#define SCLEX_CSS 38
+#define SCLEX_POV 39
+#define SCLEX_LOUT 40
+#define SCLEX_ESCRIPT 41
+#define SCLEX_PS 42
+#define SCLEX_NSIS 43
+#define SCLEX_MMIXAL 44
+#define SCLEX_CLW 45
+#define SCLEX_CLWNOCASE 46
+#define SCLEX_LOT 47
+#define SCLEX_YAML 48
+#define SCLEX_TEX 49
+#define SCLEX_METAPOST 50
+#define SCLEX_POWERBASIC 51
+#define SCLEX_FORTH 52
+#define SCLEX_ERLANG 53
+#define SCLEX_OCTAVE 54
+#define SCLEX_MSSQL 55
+#define SCLEX_VERILOG 56
+#define SCLEX_KIX 57
+#define SCLEX_GUI4CLI 58
+#define SCLEX_SPECMAN 59
+#define SCLEX_AU3 60
+#define SCLEX_APDL 61
+#define SCLEX_BASH 62
+#define SCLEX_ASN1 63
+#define SCLEX_VHDL 64
+#define SCLEX_CAML 65
+#define SCLEX_BLITZBASIC 66
+#define SCLEX_PUREBASIC 67
+#define SCLEX_HASKELL 68
+#define SCLEX_PHPSCRIPT 69
+#define SCLEX_TADS3 70
+#define SCLEX_REBOL 71
+#define SCLEX_SMALLTALK 72
+#define SCLEX_FLAGSHIP 73
+#define SCLEX_CSOUND 74
+#define SCLEX_FREEBASIC 75
+#define SCLEX_INNOSETUP 76
+#define SCLEX_OPAL 77
+#define SCLEX_SPICE 78
+#define SCLEX_D 79
+#define SCLEX_CMAKE 80
+#define SCLEX_GAP 81
+#define SCLEX_PLM 82
+#define SCLEX_PROGRESS 83
+#define SCLEX_ABAQUS 84
+#define SCLEX_ASYMPTOTE 85
+#define SCLEX_R 86
+#define SCLEX_MAGIK 87
+#define SCLEX_POWERSHELL 88
+#define SCLEX_MYSQL 89
+#define SCLEX_PO 90
+#define SCLEX_TAL 91
+#define SCLEX_COBOL 92
+#define SCLEX_TACL 93
+#define SCLEX_SORCUS 94
+#define SCLEX_POWERPRO 95
+#define SCLEX_NIMROD 96
+#define SCLEX_SML 97
+#define SCLEX_MARKDOWN 98
+#define SCLEX_TXT2TAGS 99
+#define SCLEX_A68K 100
+#define SCLEX_MODULA 101
+#define SCLEX_COFFEESCRIPT 102
+#define SCLEX_TCMD 103
+#define SCLEX_AVS 104
+#define SCLEX_ECL 105
+#define SCLEX_OSCRIPT 106
+#define SCLEX_VISUALPROLOG 107
+#define SCLEX_LITERATEHASKELL 108
+#define SCLEX_STTXT 109
+#define SCLEX_KVIRC 110
+#define SCLEX_RUST 111
+#define SCLEX_DMAP 112
+#define SCLEX_AS 113
+#define SCLEX_DMIS 114
+#define SCLEX_REGISTRY 115
+#define SCLEX_BIBTEX 116
+#define SCLEX_SREC 117
+#define SCLEX_IHEX 118
+#define SCLEX_TEHEX 119
+#define SCLEX_AUTOMATIC 1000
+#define SCE_P_DEFAULT 0
+#define SCE_P_COMMENTLINE 1
+#define SCE_P_NUMBER 2
+#define SCE_P_STRING 3
+#define SCE_P_CHARACTER 4
+#define SCE_P_WORD 5
+#define SCE_P_TRIPLE 6
+#define SCE_P_TRIPLEDOUBLE 7
+#define SCE_P_CLASSNAME 8
+#define SCE_P_DEFNAME 9
+#define SCE_P_OPERATOR 10
+#define SCE_P_IDENTIFIER 11
+#define SCE_P_COMMENTBLOCK 12
+#define SCE_P_STRINGEOL 13
+#define SCE_P_WORD2 14
+#define SCE_P_DECORATOR 15
+#define SCE_C_DEFAULT 0
+#define SCE_C_COMMENT 1
+#define SCE_C_COMMENTLINE 2
+#define SCE_C_COMMENTDOC 3
+#define SCE_C_NUMBER 4
+#define SCE_C_WORD 5
+#define SCE_C_STRING 6
+#define SCE_C_CHARACTER 7
+#define SCE_C_UUID 8
+#define SCE_C_PREPROCESSOR 9
+#define SCE_C_OPERATOR 10
+#define SCE_C_IDENTIFIER 11
+#define SCE_C_STRINGEOL 12
+#define SCE_C_VERBATIM 13
+#define SCE_C_REGEX 14
+#define SCE_C_COMMENTLINEDOC 15
+#define SCE_C_WORD2 16
+#define SCE_C_COMMENTDOCKEYWORD 17
+#define SCE_C_COMMENTDOCKEYWORDERROR 18
+#define SCE_C_GLOBALCLASS 19
+#define SCE_C_STRINGRAW 20
+#define SCE_C_TRIPLEVERBATIM 21
+#define SCE_C_HASHQUOTEDSTRING 22
+#define SCE_C_PREPROCESSORCOMMENT 23
+#define SCE_C_PREPROCESSORCOMMENTDOC 24
+#define SCE_C_USERLITERAL 25
+#define SCE_C_TASKMARKER 26
+#define SCE_C_ESCAPESEQUENCE 27
+#define SCE_D_DEFAULT 0
+#define SCE_D_COMMENT 1
+#define SCE_D_COMMENTLINE 2
+#define SCE_D_COMMENTDOC 3
+#define SCE_D_COMMENTNESTED 4
+#define SCE_D_NUMBER 5
+#define SCE_D_WORD 6
+#define SCE_D_WORD2 7
+#define SCE_D_WORD3 8
+#define SCE_D_TYPEDEF 9
+#define SCE_D_STRING 10
+#define SCE_D_STRINGEOL 11
+#define SCE_D_CHARACTER 12
+#define SCE_D_OPERATOR 13
+#define SCE_D_IDENTIFIER 14
+#define SCE_D_COMMENTLINEDOC 15
+#define SCE_D_COMMENTDOCKEYWORD 16
+#define SCE_D_COMMENTDOCKEYWORDERROR 17
+#define SCE_D_STRINGB 18
+#define SCE_D_STRINGR 19
+#define SCE_D_WORD5 20
+#define SCE_D_WORD6 21
+#define SCE_D_WORD7 22
+#define SCE_TCL_DEFAULT 0
+#define SCE_TCL_COMMENT 1
+#define SCE_TCL_COMMENTLINE 2
+#define SCE_TCL_NUMBER 3
+#define SCE_TCL_WORD_IN_QUOTE 4
+#define SCE_TCL_IN_QUOTE 5
+#define SCE_TCL_OPERATOR 6
+#define SCE_TCL_IDENTIFIER 7
+#define SCE_TCL_SUBSTITUTION 8
+#define SCE_TCL_SUB_BRACE 9
+#define SCE_TCL_MODIFIER 10
+#define SCE_TCL_EXPAND 11
+#define SCE_TCL_WORD 12
+#define SCE_TCL_WORD2 13
+#define SCE_TCL_WORD3 14
+#define SCE_TCL_WORD4 15
+#define SCE_TCL_WORD5 16
+#define SCE_TCL_WORD6 17
+#define SCE_TCL_WORD7 18
+#define SCE_TCL_WORD8 19
+#define SCE_TCL_COMMENT_BOX 20
+#define SCE_TCL_BLOCK_COMMENT 21
+#define SCE_H_DEFAULT 0
+#define SCE_H_TAG 1
+#define SCE_H_TAGUNKNOWN 2
+#define SCE_H_ATTRIBUTE 3
+#define SCE_H_ATTRIBUTEUNKNOWN 4
+#define SCE_H_NUMBER 5
+#define SCE_H_DOUBLESTRING 6
+#define SCE_H_SINGLESTRING 7
+#define SCE_H_OTHER 8
+#define SCE_H_COMMENT 9
+#define SCE_H_ENTITY 10
+#define SCE_H_TAGEND 11
+#define SCE_H_XMLSTART 12
+#define SCE_H_XMLEND 13
+#define SCE_H_SCRIPT 14
+#define SCE_H_ASP 15
+#define SCE_H_ASPAT 16
+#define SCE_H_CDATA 17
+#define SCE_H_QUESTION 18
+#define SCE_H_VALUE 19
+#define SCE_H_XCCOMMENT 20
+#define SCE_H_SGML_DEFAULT 21
+#define SCE_H_SGML_COMMAND 22
+#define SCE_H_SGML_1ST_PARAM 23
+#define SCE_H_SGML_DOUBLESTRING 24
+#define SCE_H_SGML_SIMPLESTRING 25
+#define SCE_H_SGML_ERROR 26
+#define SCE_H_SGML_SPECIAL 27
+#define SCE_H_SGML_ENTITY 28
+#define SCE_H_SGML_COMMENT 29
+#define SCE_H_SGML_1ST_PARAM_COMMENT 30
+#define SCE_H_SGML_BLOCK_DEFAULT 31
+#define SCE_HJ_START 40
+#define SCE_HJ_DEFAULT 41
+#define SCE_HJ_COMMENT 42
+#define SCE_HJ_COMMENTLINE 43
+#define SCE_HJ_COMMENTDOC 44
+#define SCE_HJ_NUMBER 45
+#define SCE_HJ_WORD 46
+#define SCE_HJ_KEYWORD 47
+#define SCE_HJ_DOUBLESTRING 48
+#define SCE_HJ_SINGLESTRING 49
+#define SCE_HJ_SYMBOLS 50
+#define SCE_HJ_STRINGEOL 51
+#define SCE_HJ_REGEX 52
+#define SCE_HJA_START 55
+#define SCE_HJA_DEFAULT 56
+#define SCE_HJA_COMMENT 57
+#define SCE_HJA_COMMENTLINE 58
+#define SCE_HJA_COMMENTDOC 59
+#define SCE_HJA_NUMBER 60
+#define SCE_HJA_WORD 61
+#define SCE_HJA_KEYWORD 62
+#define SCE_HJA_DOUBLESTRING 63
+#define SCE_HJA_SINGLESTRING 64
+#define SCE_HJA_SYMBOLS 65
+#define SCE_HJA_STRINGEOL 66
+#define SCE_HJA_REGEX 67
+#define SCE_HB_START 70
+#define SCE_HB_DEFAULT 71
+#define SCE_HB_COMMENTLINE 72
+#define SCE_HB_NUMBER 73
+#define SCE_HB_WORD 74
+#define SCE_HB_STRING 75
+#define SCE_HB_IDENTIFIER 76
+#define SCE_HB_STRINGEOL 77
+#define SCE_HBA_START 80
+#define SCE_HBA_DEFAULT 81
+#define SCE_HBA_COMMENTLINE 82
+#define SCE_HBA_NUMBER 83
+#define SCE_HBA_WORD 84
+#define SCE_HBA_STRING 85
+#define SCE_HBA_IDENTIFIER 86
+#define SCE_HBA_STRINGEOL 87
+#define SCE_HP_START 90
+#define SCE_HP_DEFAULT 91
+#define SCE_HP_COMMENTLINE 92
+#define SCE_HP_NUMBER 93
+#define SCE_HP_STRING 94
+#define SCE_HP_CHARACTER 95
+#define SCE_HP_WORD 96
+#define SCE_HP_TRIPLE 97
+#define SCE_HP_TRIPLEDOUBLE 98
+#define SCE_HP_CLASSNAME 99
+#define SCE_HP_DEFNAME 100
+#define SCE_HP_OPERATOR 101
+#define SCE_HP_IDENTIFIER 102
+#define SCE_HPHP_COMPLEX_VARIABLE 104
+#define SCE_HPA_START 105
+#define SCE_HPA_DEFAULT 106
+#define SCE_HPA_COMMENTLINE 107
+#define SCE_HPA_NUMBER 108
+#define SCE_HPA_STRING 109
+#define SCE_HPA_CHARACTER 110
+#define SCE_HPA_WORD 111
+#define SCE_HPA_TRIPLE 112
+#define SCE_HPA_TRIPLEDOUBLE 113
+#define SCE_HPA_CLASSNAME 114
+#define SCE_HPA_DEFNAME 115
+#define SCE_HPA_OPERATOR 116
+#define SCE_HPA_IDENTIFIER 117
+#define SCE_HPHP_DEFAULT 118
+#define SCE_HPHP_HSTRING 119
+#define SCE_HPHP_SIMPLESTRING 120
+#define SCE_HPHP_WORD 121
+#define SCE_HPHP_NUMBER 122
+#define SCE_HPHP_VARIABLE 123
+#define SCE_HPHP_COMMENT 124
+#define SCE_HPHP_COMMENTLINE 125
+#define SCE_HPHP_HSTRING_VARIABLE 126
+#define SCE_HPHP_OPERATOR 127
+#define SCE_PL_DEFAULT 0
+#define SCE_PL_ERROR 1
+#define SCE_PL_COMMENTLINE 2
+#define SCE_PL_POD 3
+#define SCE_PL_NUMBER 4
+#define SCE_PL_WORD 5
+#define SCE_PL_STRING 6
+#define SCE_PL_CHARACTER 7
+#define SCE_PL_PUNCTUATION 8
+#define SCE_PL_PREPROCESSOR 9
+#define SCE_PL_OPERATOR 10
+#define SCE_PL_IDENTIFIER 11
+#define SCE_PL_SCALAR 12
+#define SCE_PL_ARRAY 13
+#define SCE_PL_HASH 14
+#define SCE_PL_SYMBOLTABLE 15
+#define SCE_PL_VARIABLE_INDEXER 16
+#define SCE_PL_REGEX 17
+#define SCE_PL_REGSUBST 18
+#define SCE_PL_LONGQUOTE 19
+#define SCE_PL_BACKTICKS 20
+#define SCE_PL_DATASECTION 21
+#define SCE_PL_HERE_DELIM 22
+#define SCE_PL_HERE_Q 23
+#define SCE_PL_HERE_QQ 24
+#define SCE_PL_HERE_QX 25
+#define SCE_PL_STRING_Q 26
+#define SCE_PL_STRING_QQ 27
+#define SCE_PL_STRING_QX 28
+#define SCE_PL_STRING_QR 29
+#define SCE_PL_STRING_QW 30
+#define SCE_PL_POD_VERB 31
+#define SCE_PL_SUB_PROTOTYPE 40
+#define SCE_PL_FORMAT_IDENT 41
+#define SCE_PL_FORMAT 42
+#define SCE_PL_STRING_VAR 43
+#define SCE_PL_XLAT 44
+#define SCE_PL_REGEX_VAR 54
+#define SCE_PL_REGSUBST_VAR 55
+#define SCE_PL_BACKTICKS_VAR 57
+#define SCE_PL_HERE_QQ_VAR 61
+#define SCE_PL_HERE_QX_VAR 62
+#define SCE_PL_STRING_QQ_VAR 64
+#define SCE_PL_STRING_QX_VAR 65
+#define SCE_PL_STRING_QR_VAR 66
+#define SCE_RB_DEFAULT 0
+#define SCE_RB_ERROR 1
+#define SCE_RB_COMMENTLINE 2
+#define SCE_RB_POD 3
+#define SCE_RB_NUMBER 4
+#define SCE_RB_WORD 5
+#define SCE_RB_STRING 6
+#define SCE_RB_CHARACTER 7
+#define SCE_RB_CLASSNAME 8
+#define SCE_RB_DEFNAME 9
+#define SCE_RB_OPERATOR 10
+#define SCE_RB_IDENTIFIER 11
+#define SCE_RB_REGEX 12
+#define SCE_RB_GLOBAL 13
+#define SCE_RB_SYMBOL 14
+#define SCE_RB_MODULE_NAME 15
+#define SCE_RB_INSTANCE_VAR 16
+#define SCE_RB_CLASS_VAR 17
+#define SCE_RB_BACKTICKS 18
+#define SCE_RB_DATASECTION 19
+#define SCE_RB_HERE_DELIM 20
+#define SCE_RB_HERE_Q 21
+#define SCE_RB_HERE_QQ 22
+#define SCE_RB_HERE_QX 23
+#define SCE_RB_STRING_Q 24
+#define SCE_RB_STRING_QQ 25
+#define SCE_RB_STRING_QX 26
+#define SCE_RB_STRING_QR 27
+#define SCE_RB_STRING_QW 28
+#define SCE_RB_WORD_DEMOTED 29
+#define SCE_RB_STDIN 30
+#define SCE_RB_STDOUT 31
+#define SCE_RB_STDERR 40
+#define SCE_RB_UPPER_BOUND 41
+#define SCE_B_DEFAULT 0
+#define SCE_B_COMMENT 1
+#define SCE_B_NUMBER 2
+#define SCE_B_KEYWORD 3
+#define SCE_B_STRING 4
+#define SCE_B_PREPROCESSOR 5
+#define SCE_B_OPERATOR 6
+#define SCE_B_IDENTIFIER 7
+#define SCE_B_DATE 8
+#define SCE_B_STRINGEOL 9
+#define SCE_B_KEYWORD2 10
+#define SCE_B_KEYWORD3 11
+#define SCE_B_KEYWORD4 12
+#define SCE_B_CONSTANT 13
+#define SCE_B_ASM 14
+#define SCE_B_LABEL 15
+#define SCE_B_ERROR 16
+#define SCE_B_HEXNUMBER 17
+#define SCE_B_BINNUMBER 18
+#define SCE_B_COMMENTBLOCK 19
+#define SCE_B_DOCLINE 20
+#define SCE_B_DOCBLOCK 21
+#define SCE_B_DOCKEYWORD 22
+#define SCE_PROPS_DEFAULT 0
+#define SCE_PROPS_COMMENT 1
+#define SCE_PROPS_SECTION 2
+#define SCE_PROPS_ASSIGNMENT 3
+#define SCE_PROPS_DEFVAL 4
+#define SCE_PROPS_KEY 5
+#define SCE_L_DEFAULT 0
+#define SCE_L_COMMAND 1
+#define SCE_L_TAG 2
+#define SCE_L_MATH 3
+#define SCE_L_COMMENT 4
+#define SCE_L_TAG2 5
+#define SCE_L_MATH2 6
+#define SCE_L_COMMENT2 7
+#define SCE_L_VERBATIM 8
+#define SCE_L_SHORTCMD 9
+#define SCE_L_SPECIAL 10
+#define SCE_L_CMDOPT 11
+#define SCE_L_ERROR 12
+#define SCE_LUA_DEFAULT 0
+#define SCE_LUA_COMMENT 1
+#define SCE_LUA_COMMENTLINE 2
+#define SCE_LUA_COMMENTDOC 3
+#define SCE_LUA_NUMBER 4
+#define SCE_LUA_WORD 5
+#define SCE_LUA_STRING 6
+#define SCE_LUA_CHARACTER 7
+#define SCE_LUA_LITERALSTRING 8
+#define SCE_LUA_PREPROCESSOR 9
+#define SCE_LUA_OPERATOR 10
+#define SCE_LUA_IDENTIFIER 11
+#define SCE_LUA_STRINGEOL 12
+#define SCE_LUA_WORD2 13
+#define SCE_LUA_WORD3 14
+#define SCE_LUA_WORD4 15
+#define SCE_LUA_WORD5 16
+#define SCE_LUA_WORD6 17
+#define SCE_LUA_WORD7 18
+#define SCE_LUA_WORD8 19
+#define SCE_LUA_LABEL 20
+#define SCE_ERR_DEFAULT 0
+#define SCE_ERR_PYTHON 1
+#define SCE_ERR_GCC 2
+#define SCE_ERR_MS 3
+#define SCE_ERR_CMD 4
+#define SCE_ERR_BORLAND 5
+#define SCE_ERR_PERL 6
+#define SCE_ERR_NET 7
+#define SCE_ERR_LUA 8
+#define SCE_ERR_CTAG 9
+#define SCE_ERR_DIFF_CHANGED 10
+#define SCE_ERR_DIFF_ADDITION 11
+#define SCE_ERR_DIFF_DELETION 12
+#define SCE_ERR_DIFF_MESSAGE 13
+#define SCE_ERR_PHP 14
+#define SCE_ERR_ELF 15
+#define SCE_ERR_IFC 16
+#define SCE_ERR_IFORT 17
+#define SCE_ERR_ABSF 18
+#define SCE_ERR_TIDY 19
+#define SCE_ERR_JAVA_STACK 20
+#define SCE_ERR_VALUE 21
+#define SCE_ERR_GCC_INCLUDED_FROM 22
+#define SCE_BAT_DEFAULT 0
+#define SCE_BAT_COMMENT 1
+#define SCE_BAT_WORD 2
+#define SCE_BAT_LABEL 3
+#define SCE_BAT_HIDE 4
+#define SCE_BAT_COMMAND 5
+#define SCE_BAT_IDENTIFIER 6
+#define SCE_BAT_OPERATOR 7
+#define SCE_TCMD_DEFAULT 0
+#define SCE_TCMD_COMMENT 1
+#define SCE_TCMD_WORD 2
+#define SCE_TCMD_LABEL 3
+#define SCE_TCMD_HIDE 4
+#define SCE_TCMD_COMMAND 5
+#define SCE_TCMD_IDENTIFIER 6
+#define SCE_TCMD_OPERATOR 7
+#define SCE_TCMD_ENVIRONMENT 8
+#define SCE_TCMD_EXPANSION 9
+#define SCE_TCMD_CLABEL 10
+#define SCE_MAKE_DEFAULT 0
+#define SCE_MAKE_COMMENT 1
+#define SCE_MAKE_PREPROCESSOR 2
+#define SCE_MAKE_IDENTIFIER 3
+#define SCE_MAKE_OPERATOR 4
+#define SCE_MAKE_TARGET 5
+#define SCE_MAKE_IDEOL 9
+#define SCE_DIFF_DEFAULT 0
+#define SCE_DIFF_COMMENT 1
+#define SCE_DIFF_COMMAND 2
+#define SCE_DIFF_HEADER 3
+#define SCE_DIFF_POSITION 4
+#define SCE_DIFF_DELETED 5
+#define SCE_DIFF_ADDED 6
+#define SCE_DIFF_CHANGED 7
+#define SCE_CONF_DEFAULT 0
+#define SCE_CONF_COMMENT 1
+#define SCE_CONF_NUMBER 2
+#define SCE_CONF_IDENTIFIER 3
+#define SCE_CONF_EXTENSION 4
+#define SCE_CONF_PARAMETER 5
+#define SCE_CONF_STRING 6
+#define SCE_CONF_OPERATOR 7
+#define SCE_CONF_IP 8
+#define SCE_CONF_DIRECTIVE 9
+#define SCE_AVE_DEFAULT 0
+#define SCE_AVE_COMMENT 1
+#define SCE_AVE_NUMBER 2
+#define SCE_AVE_WORD 3
+#define SCE_AVE_STRING 6
+#define SCE_AVE_ENUM 7
+#define SCE_AVE_STRINGEOL 8
+#define SCE_AVE_IDENTIFIER 9
+#define SCE_AVE_OPERATOR 10
+#define SCE_AVE_WORD1 11
+#define SCE_AVE_WORD2 12
+#define SCE_AVE_WORD3 13
+#define SCE_AVE_WORD4 14
+#define SCE_AVE_WORD5 15
+#define SCE_AVE_WORD6 16
+#define SCE_ADA_DEFAULT 0
+#define SCE_ADA_WORD 1
+#define SCE_ADA_IDENTIFIER 2
+#define SCE_ADA_NUMBER 3
+#define SCE_ADA_DELIMITER 4
+#define SCE_ADA_CHARACTER 5
+#define SCE_ADA_CHARACTEREOL 6
+#define SCE_ADA_STRING 7
+#define SCE_ADA_STRINGEOL 8
+#define SCE_ADA_LABEL 9
+#define SCE_ADA_COMMENTLINE 10
+#define SCE_ADA_ILLEGAL 11
+#define SCE_BAAN_DEFAULT 0
+#define SCE_BAAN_COMMENT 1
+#define SCE_BAAN_COMMENTDOC 2
+#define SCE_BAAN_NUMBER 3
+#define SCE_BAAN_WORD 4
+#define SCE_BAAN_STRING 5
+#define SCE_BAAN_PREPROCESSOR 6
+#define SCE_BAAN_OPERATOR 7
+#define SCE_BAAN_IDENTIFIER 8
+#define SCE_BAAN_STRINGEOL 9
+#define SCE_BAAN_WORD2 10
+#define SCE_LISP_DEFAULT 0
+#define SCE_LISP_COMMENT 1
+#define SCE_LISP_NUMBER 2
+#define SCE_LISP_KEYWORD 3
+#define SCE_LISP_KEYWORD_KW 4
+#define SCE_LISP_SYMBOL 5
+#define SCE_LISP_STRING 6
+#define SCE_LISP_STRINGEOL 8
+#define SCE_LISP_IDENTIFIER 9
+#define SCE_LISP_OPERATOR 10
+#define SCE_LISP_SPECIAL 11
+#define SCE_LISP_MULTI_COMMENT 12
+#define SCE_EIFFEL_DEFAULT 0
+#define SCE_EIFFEL_COMMENTLINE 1
+#define SCE_EIFFEL_NUMBER 2
+#define SCE_EIFFEL_WORD 3
+#define SCE_EIFFEL_STRING 4
+#define SCE_EIFFEL_CHARACTER 5
+#define SCE_EIFFEL_OPERATOR 6
+#define SCE_EIFFEL_IDENTIFIER 7
+#define SCE_EIFFEL_STRINGEOL 8
+#define SCE_NNCRONTAB_DEFAULT 0
+#define SCE_NNCRONTAB_COMMENT 1
+#define SCE_NNCRONTAB_TASK 2
+#define SCE_NNCRONTAB_SECTION 3
+#define SCE_NNCRONTAB_KEYWORD 4
+#define SCE_NNCRONTAB_MODIFIER 5
+#define SCE_NNCRONTAB_ASTERISK 6
+#define SCE_NNCRONTAB_NUMBER 7
+#define SCE_NNCRONTAB_STRING 8
+#define SCE_NNCRONTAB_ENVIRONMENT 9
+#define SCE_NNCRONTAB_IDENTIFIER 10
+#define SCE_FORTH_DEFAULT 0
+#define SCE_FORTH_COMMENT 1
+#define SCE_FORTH_COMMENT_ML 2
+#define SCE_FORTH_IDENTIFIER 3
+#define SCE_FORTH_CONTROL 4
+#define SCE_FORTH_KEYWORD 5
+#define SCE_FORTH_DEFWORD 6
+#define SCE_FORTH_PREWORD1 7
+#define SCE_FORTH_PREWORD2 8
+#define SCE_FORTH_NUMBER 9
+#define SCE_FORTH_STRING 10
+#define SCE_FORTH_LOCALE 11
+#define SCE_MATLAB_DEFAULT 0
+#define SCE_MATLAB_COMMENT 1
+#define SCE_MATLAB_COMMAND 2
+#define SCE_MATLAB_NUMBER 3
+#define SCE_MATLAB_KEYWORD 4
+#define SCE_MATLAB_STRING 5
+#define SCE_MATLAB_OPERATOR 6
+#define SCE_MATLAB_IDENTIFIER 7
+#define SCE_MATLAB_DOUBLEQUOTESTRING 8
+#define SCE_SCRIPTOL_DEFAULT 0
+#define SCE_SCRIPTOL_WHITE 1
+#define SCE_SCRIPTOL_COMMENTLINE 2
+#define SCE_SCRIPTOL_PERSISTENT 3
+#define SCE_SCRIPTOL_CSTYLE 4
+#define SCE_SCRIPTOL_COMMENTBLOCK 5
+#define SCE_SCRIPTOL_NUMBER 6
+#define SCE_SCRIPTOL_STRING 7
+#define SCE_SCRIPTOL_CHARACTER 8
+#define SCE_SCRIPTOL_STRINGEOL 9
+#define SCE_SCRIPTOL_KEYWORD 10
+#define SCE_SCRIPTOL_OPERATOR 11
+#define SCE_SCRIPTOL_IDENTIFIER 12
+#define SCE_SCRIPTOL_TRIPLE 13
+#define SCE_SCRIPTOL_CLASSNAME 14
+#define SCE_SCRIPTOL_PREPROCESSOR 15
+#define SCE_ASM_DEFAULT 0
+#define SCE_ASM_COMMENT 1
+#define SCE_ASM_NUMBER 2
+#define SCE_ASM_STRING 3
+#define SCE_ASM_OPERATOR 4
+#define SCE_ASM_IDENTIFIER 5
+#define SCE_ASM_CPUINSTRUCTION 6
+#define SCE_ASM_MATHINSTRUCTION 7
+#define SCE_ASM_REGISTER 8
+#define SCE_ASM_DIRECTIVE 9
+#define SCE_ASM_DIRECTIVEOPERAND 10
+#define SCE_ASM_COMMENTBLOCK 11
+#define SCE_ASM_CHARACTER 12
+#define SCE_ASM_STRINGEOL 13
+#define SCE_ASM_EXTINSTRUCTION 14
+#define SCE_ASM_COMMENTDIRECTIVE 15
+#define SCE_F_DEFAULT 0
+#define SCE_F_COMMENT 1
+#define SCE_F_NUMBER 2
+#define SCE_F_STRING1 3
+#define SCE_F_STRING2 4
+#define SCE_F_STRINGEOL 5
+#define SCE_F_OPERATOR 6
+#define SCE_F_IDENTIFIER 7
+#define SCE_F_WORD 8
+#define SCE_F_WORD2 9
+#define SCE_F_WORD3 10
+#define SCE_F_PREPROCESSOR 11
+#define SCE_F_OPERATOR2 12
+#define SCE_F_LABEL 13
+#define SCE_F_CONTINUATION 14
+#define SCE_CSS_DEFAULT 0
+#define SCE_CSS_TAG 1
+#define SCE_CSS_CLASS 2
+#define SCE_CSS_PSEUDOCLASS 3
+#define SCE_CSS_UNKNOWN_PSEUDOCLASS 4
+#define SCE_CSS_OPERATOR 5
+#define SCE_CSS_IDENTIFIER 6
+#define SCE_CSS_UNKNOWN_IDENTIFIER 7
+#define SCE_CSS_VALUE 8
+#define SCE_CSS_COMMENT 9
+#define SCE_CSS_ID 10
+#define SCE_CSS_IMPORTANT 11
+#define SCE_CSS_DIRECTIVE 12
+#define SCE_CSS_DOUBLESTRING 13
+#define SCE_CSS_SINGLESTRING 14
+#define SCE_CSS_IDENTIFIER2 15
+#define SCE_CSS_ATTRIBUTE 16
+#define SCE_CSS_IDENTIFIER3 17
+#define SCE_CSS_PSEUDOELEMENT 18
+#define SCE_CSS_EXTENDED_IDENTIFIER 19
+#define SCE_CSS_EXTENDED_PSEUDOCLASS 20
+#define SCE_CSS_EXTENDED_PSEUDOELEMENT 21
+#define SCE_CSS_MEDIA 22
+#define SCE_CSS_VARIABLE 23
+#define SCE_POV_DEFAULT 0
+#define SCE_POV_COMMENT 1
+#define SCE_POV_COMMENTLINE 2
+#define SCE_POV_NUMBER 3
+#define SCE_POV_OPERATOR 4
+#define SCE_POV_IDENTIFIER 5
+#define SCE_POV_STRING 6
+#define SCE_POV_STRINGEOL 7
+#define SCE_POV_DIRECTIVE 8
+#define SCE_POV_BADDIRECTIVE 9
+#define SCE_POV_WORD2 10
+#define SCE_POV_WORD3 11
+#define SCE_POV_WORD4 12
+#define SCE_POV_WORD5 13
+#define SCE_POV_WORD6 14
+#define SCE_POV_WORD7 15
+#define SCE_POV_WORD8 16
+#define SCE_LOUT_DEFAULT 0
+#define SCE_LOUT_COMMENT 1
+#define SCE_LOUT_NUMBER 2
+#define SCE_LOUT_WORD 3
+#define SCE_LOUT_WORD2 4
+#define SCE_LOUT_WORD3 5
+#define SCE_LOUT_WORD4 6
+#define SCE_LOUT_STRING 7
+#define SCE_LOUT_OPERATOR 8
+#define SCE_LOUT_IDENTIFIER 9
+#define SCE_LOUT_STRINGEOL 10
+#define SCE_ESCRIPT_DEFAULT 0
+#define SCE_ESCRIPT_COMMENT 1
+#define SCE_ESCRIPT_COMMENTLINE 2
+#define SCE_ESCRIPT_COMMENTDOC 3
+#define SCE_ESCRIPT_NUMBER 4
+#define SCE_ESCRIPT_WORD 5
+#define SCE_ESCRIPT_STRING 6
+#define SCE_ESCRIPT_OPERATOR 7
+#define SCE_ESCRIPT_IDENTIFIER 8
+#define SCE_ESCRIPT_BRACE 9
+#define SCE_ESCRIPT_WORD2 10
+#define SCE_ESCRIPT_WORD3 11
+#define SCE_PS_DEFAULT 0
+#define SCE_PS_COMMENT 1
+#define SCE_PS_DSC_COMMENT 2
+#define SCE_PS_DSC_VALUE 3
+#define SCE_PS_NUMBER 4
+#define SCE_PS_NAME 5
+#define SCE_PS_KEYWORD 6
+#define SCE_PS_LITERAL 7
+#define SCE_PS_IMMEVAL 8
+#define SCE_PS_PAREN_ARRAY 9
+#define SCE_PS_PAREN_DICT 10
+#define SCE_PS_PAREN_PROC 11
+#define SCE_PS_TEXT 12
+#define SCE_PS_HEXSTRING 13
+#define SCE_PS_BASE85STRING 14
+#define SCE_PS_BADSTRINGCHAR 15
+#define SCE_NSIS_DEFAULT 0
+#define SCE_NSIS_COMMENT 1
+#define SCE_NSIS_STRINGDQ 2
+#define SCE_NSIS_STRINGLQ 3
+#define SCE_NSIS_STRINGRQ 4
+#define SCE_NSIS_FUNCTION 5
+#define SCE_NSIS_VARIABLE 6
+#define SCE_NSIS_LABEL 7
+#define SCE_NSIS_USERDEFINED 8
+#define SCE_NSIS_SECTIONDEF 9
+#define SCE_NSIS_SUBSECTIONDEF 10
+#define SCE_NSIS_IFDEFINEDEF 11
+#define SCE_NSIS_MACRODEF 12
+#define SCE_NSIS_STRINGVAR 13
+#define SCE_NSIS_NUMBER 14
+#define SCE_NSIS_SECTIONGROUP 15
+#define SCE_NSIS_PAGEEX 16
+#define SCE_NSIS_FUNCTIONDEF 17
+#define SCE_NSIS_COMMENTBOX 18
+#define SCE_MMIXAL_LEADWS 0
+#define SCE_MMIXAL_COMMENT 1
+#define SCE_MMIXAL_LABEL 2
+#define SCE_MMIXAL_OPCODE 3
+#define SCE_MMIXAL_OPCODE_PRE 4
+#define SCE_MMIXAL_OPCODE_VALID 5
+#define SCE_MMIXAL_OPCODE_UNKNOWN 6
+#define SCE_MMIXAL_OPCODE_POST 7
+#define SCE_MMIXAL_OPERANDS 8
+#define SCE_MMIXAL_NUMBER 9
+#define SCE_MMIXAL_REF 10
+#define SCE_MMIXAL_CHAR 11
+#define SCE_MMIXAL_STRING 12
+#define SCE_MMIXAL_REGISTER 13
+#define SCE_MMIXAL_HEX 14
+#define SCE_MMIXAL_OPERATOR 15
+#define SCE_MMIXAL_SYMBOL 16
+#define SCE_MMIXAL_INCLUDE 17
+#define SCE_CLW_DEFAULT 0
+#define SCE_CLW_LABEL 1
+#define SCE_CLW_COMMENT 2
+#define SCE_CLW_STRING 3
+#define SCE_CLW_USER_IDENTIFIER 4
+#define SCE_CLW_INTEGER_CONSTANT 5
+#define SCE_CLW_REAL_CONSTANT 6
+#define SCE_CLW_PICTURE_STRING 7
+#define SCE_CLW_KEYWORD 8
+#define SCE_CLW_COMPILER_DIRECTIVE 9
+#define SCE_CLW_RUNTIME_EXPRESSIONS 10
+#define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 11
+#define SCE_CLW_STRUCTURE_DATA_TYPE 12
+#define SCE_CLW_ATTRIBUTE 13
+#define SCE_CLW_STANDARD_EQUATE 14
+#define SCE_CLW_ERROR 15
+#define SCE_CLW_DEPRECATED 16
+#define SCE_LOT_DEFAULT 0
+#define SCE_LOT_HEADER 1
+#define SCE_LOT_BREAK 2
+#define SCE_LOT_SET 3
+#define SCE_LOT_PASS 4
+#define SCE_LOT_FAIL 5
+#define SCE_LOT_ABORT 6
+#define SCE_YAML_DEFAULT 0
+#define SCE_YAML_COMMENT 1
+#define SCE_YAML_IDENTIFIER 2
+#define SCE_YAML_KEYWORD 3
+#define SCE_YAML_NUMBER 4
+#define SCE_YAML_REFERENCE 5
+#define SCE_YAML_DOCUMENT 6
+#define SCE_YAML_TEXT 7
+#define SCE_YAML_ERROR 8
+#define SCE_YAML_OPERATOR 9
+#define SCE_TEX_DEFAULT 0
+#define SCE_TEX_SPECIAL 1
+#define SCE_TEX_GROUP 2
+#define SCE_TEX_SYMBOL 3
+#define SCE_TEX_COMMAND 4
+#define SCE_TEX_TEXT 5
+#define SCE_METAPOST_DEFAULT 0
+#define SCE_METAPOST_SPECIAL 1
+#define SCE_METAPOST_GROUP 2
+#define SCE_METAPOST_SYMBOL 3
+#define SCE_METAPOST_COMMAND 4
+#define SCE_METAPOST_TEXT 5
+#define SCE_METAPOST_EXTRA 6
+#define SCE_ERLANG_DEFAULT 0
+#define SCE_ERLANG_COMMENT 1
+#define SCE_ERLANG_VARIABLE 2
+#define SCE_ERLANG_NUMBER 3
+#define SCE_ERLANG_KEYWORD 4
+#define SCE_ERLANG_STRING 5
+#define SCE_ERLANG_OPERATOR 6
+#define SCE_ERLANG_ATOM 7
+#define SCE_ERLANG_FUNCTION_NAME 8
+#define SCE_ERLANG_CHARACTER 9
+#define SCE_ERLANG_MACRO 10
+#define SCE_ERLANG_RECORD 11
+#define SCE_ERLANG_PREPROC 12
+#define SCE_ERLANG_NODE_NAME 13
+#define SCE_ERLANG_COMMENT_FUNCTION 14
+#define SCE_ERLANG_COMMENT_MODULE 15
+#define SCE_ERLANG_COMMENT_DOC 16
+#define SCE_ERLANG_COMMENT_DOC_MACRO 17
+#define SCE_ERLANG_ATOM_QUOTED 18
+#define SCE_ERLANG_MACRO_QUOTED 19
+#define SCE_ERLANG_RECORD_QUOTED 20
+#define SCE_ERLANG_NODE_NAME_QUOTED 21
+#define SCE_ERLANG_BIFS 22
+#define SCE_ERLANG_MODULES 23
+#define SCE_ERLANG_MODULES_ATT 24
+#define SCE_ERLANG_UNKNOWN 31
+#define SCE_MSSQL_DEFAULT 0
+#define SCE_MSSQL_COMMENT 1
+#define SCE_MSSQL_LINE_COMMENT 2
+#define SCE_MSSQL_NUMBER 3
+#define SCE_MSSQL_STRING 4
+#define SCE_MSSQL_OPERATOR 5
+#define SCE_MSSQL_IDENTIFIER 6
+#define SCE_MSSQL_VARIABLE 7
+#define SCE_MSSQL_COLUMN_NAME 8
+#define SCE_MSSQL_STATEMENT 9
+#define SCE_MSSQL_DATATYPE 10
+#define SCE_MSSQL_SYSTABLE 11
+#define SCE_MSSQL_GLOBAL_VARIABLE 12
+#define SCE_MSSQL_FUNCTION 13
+#define SCE_MSSQL_STORED_PROCEDURE 14
+#define SCE_MSSQL_DEFAULT_PREF_DATATYPE 15
+#define SCE_MSSQL_COLUMN_NAME_2 16
+#define SCE_V_DEFAULT 0
+#define SCE_V_COMMENT 1
+#define SCE_V_COMMENTLINE 2
+#define SCE_V_COMMENTLINEBANG 3
+#define SCE_V_NUMBER 4
+#define SCE_V_WORD 5
+#define SCE_V_STRING 6
+#define SCE_V_WORD2 7
+#define SCE_V_WORD3 8
+#define SCE_V_PREPROCESSOR 9
+#define SCE_V_OPERATOR 10
+#define SCE_V_IDENTIFIER 11
+#define SCE_V_STRINGEOL 12
+#define SCE_V_USER 19
+#define SCE_V_COMMENT_WORD 20
+#define SCE_V_INPUT 21
+#define SCE_V_OUTPUT 22
+#define SCE_V_INOUT 23
+#define SCE_V_PORT_CONNECT 24
+#define SCE_KIX_DEFAULT 0
+#define SCE_KIX_COMMENT 1
+#define SCE_KIX_STRING1 2
+#define SCE_KIX_STRING2 3
+#define SCE_KIX_NUMBER 4
+#define SCE_KIX_VAR 5
+#define SCE_KIX_MACRO 6
+#define SCE_KIX_KEYWORD 7
+#define SCE_KIX_FUNCTIONS 8
+#define SCE_KIX_OPERATOR 9
+#define SCE_KIX_COMMENTSTREAM 10
+#define SCE_KIX_IDENTIFIER 31
+#define SCE_GC_DEFAULT 0
+#define SCE_GC_COMMENTLINE 1
+#define SCE_GC_COMMENTBLOCK 2
+#define SCE_GC_GLOBAL 3
+#define SCE_GC_EVENT 4
+#define SCE_GC_ATTRIBUTE 5
+#define SCE_GC_CONTROL 6
+#define SCE_GC_COMMAND 7
+#define SCE_GC_STRING 8
+#define SCE_GC_OPERATOR 9
+#define SCE_SN_DEFAULT 0
+#define SCE_SN_CODE 1
+#define SCE_SN_COMMENTLINE 2
+#define SCE_SN_COMMENTLINEBANG 3
+#define SCE_SN_NUMBER 4
+#define SCE_SN_WORD 5
+#define SCE_SN_STRING 6
+#define SCE_SN_WORD2 7
+#define SCE_SN_WORD3 8
+#define SCE_SN_PREPROCESSOR 9
+#define SCE_SN_OPERATOR 10
+#define SCE_SN_IDENTIFIER 11
+#define SCE_SN_STRINGEOL 12
+#define SCE_SN_REGEXTAG 13
+#define SCE_SN_SIGNAL 14
+#define SCE_SN_USER 19
+#define SCE_AU3_DEFAULT 0
+#define SCE_AU3_COMMENT 1
+#define SCE_AU3_COMMENTBLOCK 2
+#define SCE_AU3_NUMBER 3
+#define SCE_AU3_FUNCTION 4
+#define SCE_AU3_KEYWORD 5
+#define SCE_AU3_MACRO 6
+#define SCE_AU3_STRING 7
+#define SCE_AU3_OPERATOR 8
+#define SCE_AU3_VARIABLE 9
+#define SCE_AU3_SENT 10
+#define SCE_AU3_PREPROCESSOR 11
+#define SCE_AU3_SPECIAL 12
+#define SCE_AU3_EXPAND 13
+#define SCE_AU3_COMOBJ 14
+#define SCE_AU3_UDF 15
+#define SCE_APDL_DEFAULT 0
+#define SCE_APDL_COMMENT 1
+#define SCE_APDL_COMMENTBLOCK 2
+#define SCE_APDL_NUMBER 3
+#define SCE_APDL_STRING 4
+#define SCE_APDL_OPERATOR 5
+#define SCE_APDL_WORD 6
+#define SCE_APDL_PROCESSOR 7
+#define SCE_APDL_COMMAND 8
+#define SCE_APDL_SLASHCOMMAND 9
+#define SCE_APDL_STARCOMMAND 10
+#define SCE_APDL_ARGUMENT 11
+#define SCE_APDL_FUNCTION 12
+#define SCE_SH_DEFAULT 0
+#define SCE_SH_ERROR 1
+#define SCE_SH_COMMENTLINE 2
+#define SCE_SH_NUMBER 3
+#define SCE_SH_WORD 4
+#define SCE_SH_STRING 5
+#define SCE_SH_CHARACTER 6
+#define SCE_SH_OPERATOR 7
+#define SCE_SH_IDENTIFIER 8
+#define SCE_SH_SCALAR 9
+#define SCE_SH_PARAM 10
+#define SCE_SH_BACKTICKS 11
+#define SCE_SH_HERE_DELIM 12
+#define SCE_SH_HERE_Q 13
+#define SCE_ASN1_DEFAULT 0
+#define SCE_ASN1_COMMENT 1
+#define SCE_ASN1_IDENTIFIER 2
+#define SCE_ASN1_STRING 3
+#define SCE_ASN1_OID 4
+#define SCE_ASN1_SCALAR 5
+#define SCE_ASN1_KEYWORD 6
+#define SCE_ASN1_ATTRIBUTE 7
+#define SCE_ASN1_DESCRIPTOR 8
+#define SCE_ASN1_TYPE 9
+#define SCE_ASN1_OPERATOR 10
+#define SCE_VHDL_DEFAULT 0
+#define SCE_VHDL_COMMENT 1
+#define SCE_VHDL_COMMENTLINEBANG 2
+#define SCE_VHDL_NUMBER 3
+#define SCE_VHDL_STRING 4
+#define SCE_VHDL_OPERATOR 5
+#define SCE_VHDL_IDENTIFIER 6
+#define SCE_VHDL_STRINGEOL 7
+#define SCE_VHDL_KEYWORD 8
+#define SCE_VHDL_STDOPERATOR 9
+#define SCE_VHDL_ATTRIBUTE 10
+#define SCE_VHDL_STDFUNCTION 11
+#define SCE_VHDL_STDPACKAGE 12
+#define SCE_VHDL_STDTYPE 13
+#define SCE_VHDL_USERWORD 14
+#define SCE_VHDL_BLOCK_COMMENT 15
+#define SCE_CAML_DEFAULT 0
+#define SCE_CAML_IDENTIFIER 1
+#define SCE_CAML_TAGNAME 2
+#define SCE_CAML_KEYWORD 3
+#define SCE_CAML_KEYWORD2 4
+#define SCE_CAML_KEYWORD3 5
+#define SCE_CAML_LINENUM 6
+#define SCE_CAML_OPERATOR 7
+#define SCE_CAML_NUMBER 8
+#define SCE_CAML_CHAR 9
+#define SCE_CAML_WHITE 10
+#define SCE_CAML_STRING 11
+#define SCE_CAML_COMMENT 12
+#define SCE_CAML_COMMENT1 13
+#define SCE_CAML_COMMENT2 14
+#define SCE_CAML_COMMENT3 15
+#define SCE_HA_DEFAULT 0
+#define SCE_HA_IDENTIFIER 1
+#define SCE_HA_KEYWORD 2
+#define SCE_HA_NUMBER 3
+#define SCE_HA_STRING 4
+#define SCE_HA_CHARACTER 5
+#define SCE_HA_CLASS 6
+#define SCE_HA_MODULE 7
+#define SCE_HA_CAPITAL 8
+#define SCE_HA_DATA 9
+#define SCE_HA_IMPORT 10
+#define SCE_HA_OPERATOR 11
+#define SCE_HA_INSTANCE 12
+#define SCE_HA_COMMENTLINE 13
+#define SCE_HA_COMMENTBLOCK 14
+#define SCE_HA_COMMENTBLOCK2 15
+#define SCE_HA_COMMENTBLOCK3 16
+#define SCE_HA_PRAGMA 17
+#define SCE_HA_PREPROCESSOR 18
+#define SCE_HA_STRINGEOL 19
+#define SCE_HA_RESERVED_OPERATOR 20
+#define SCE_HA_LITERATE_COMMENT 21
+#define SCE_HA_LITERATE_CODEDELIM 22
+#define SCE_T3_DEFAULT 0
+#define SCE_T3_X_DEFAULT 1
+#define SCE_T3_PREPROCESSOR 2
+#define SCE_T3_BLOCK_COMMENT 3
+#define SCE_T3_LINE_COMMENT 4
+#define SCE_T3_OPERATOR 5
+#define SCE_T3_KEYWORD 6
+#define SCE_T3_NUMBER 7
+#define SCE_T3_IDENTIFIER 8
+#define SCE_T3_S_STRING 9
+#define SCE_T3_D_STRING 10
+#define SCE_T3_X_STRING 11
+#define SCE_T3_LIB_DIRECTIVE 12
+#define SCE_T3_MSG_PARAM 13
+#define SCE_T3_HTML_TAG 14
+#define SCE_T3_HTML_DEFAULT 15
+#define SCE_T3_HTML_STRING 16
+#define SCE_T3_USER1 17
+#define SCE_T3_USER2 18
+#define SCE_T3_USER3 19
+#define SCE_T3_BRACE 20
+#define SCE_REBOL_DEFAULT 0
+#define SCE_REBOL_COMMENTLINE 1
+#define SCE_REBOL_COMMENTBLOCK 2
+#define SCE_REBOL_PREFACE 3
+#define SCE_REBOL_OPERATOR 4
+#define SCE_REBOL_CHARACTER 5
+#define SCE_REBOL_QUOTEDSTRING 6
+#define SCE_REBOL_BRACEDSTRING 7
+#define SCE_REBOL_NUMBER 8
+#define SCE_REBOL_PAIR 9
+#define SCE_REBOL_TUPLE 10
+#define SCE_REBOL_BINARY 11
+#define SCE_REBOL_MONEY 12
+#define SCE_REBOL_ISSUE 13
+#define SCE_REBOL_TAG 14
+#define SCE_REBOL_FILE 15
+#define SCE_REBOL_EMAIL 16
+#define SCE_REBOL_URL 17
+#define SCE_REBOL_DATE 18
+#define SCE_REBOL_TIME 19
+#define SCE_REBOL_IDENTIFIER 20
+#define SCE_REBOL_WORD 21
+#define SCE_REBOL_WORD2 22
+#define SCE_REBOL_WORD3 23
+#define SCE_REBOL_WORD4 24
+#define SCE_REBOL_WORD5 25
+#define SCE_REBOL_WORD6 26
+#define SCE_REBOL_WORD7 27
+#define SCE_REBOL_WORD8 28
+#define SCE_SQL_DEFAULT 0
+#define SCE_SQL_COMMENT 1
+#define SCE_SQL_COMMENTLINE 2
+#define SCE_SQL_COMMENTDOC 3
+#define SCE_SQL_NUMBER 4
+#define SCE_SQL_WORD 5
+#define SCE_SQL_STRING 6
+#define SCE_SQL_CHARACTER 7
+#define SCE_SQL_SQLPLUS 8
+#define SCE_SQL_SQLPLUS_PROMPT 9
+#define SCE_SQL_OPERATOR 10
+#define SCE_SQL_IDENTIFIER 11
+#define SCE_SQL_SQLPLUS_COMMENT 13
+#define SCE_SQL_COMMENTLINEDOC 15
+#define SCE_SQL_WORD2 16
+#define SCE_SQL_COMMENTDOCKEYWORD 17
+#define SCE_SQL_COMMENTDOCKEYWORDERROR 18
+#define SCE_SQL_USER1 19
+#define SCE_SQL_USER2 20
+#define SCE_SQL_USER3 21
+#define SCE_SQL_USER4 22
+#define SCE_SQL_QUOTEDIDENTIFIER 23
+#define SCE_SQL_QOPERATOR 24
+#define SCE_ST_DEFAULT 0
+#define SCE_ST_STRING 1
+#define SCE_ST_NUMBER 2
+#define SCE_ST_COMMENT 3
+#define SCE_ST_SYMBOL 4
+#define SCE_ST_BINARY 5
+#define SCE_ST_BOOL 6
+#define SCE_ST_SELF 7
+#define SCE_ST_SUPER 8
+#define SCE_ST_NIL 9
+#define SCE_ST_GLOBAL 10
+#define SCE_ST_RETURN 11
+#define SCE_ST_SPECIAL 12
+#define SCE_ST_KWSEND 13
+#define SCE_ST_ASSIGN 14
+#define SCE_ST_CHARACTER 15
+#define SCE_ST_SPEC_SEL 16
+#define SCE_FS_DEFAULT 0
+#define SCE_FS_COMMENT 1
+#define SCE_FS_COMMENTLINE 2
+#define SCE_FS_COMMENTDOC 3
+#define SCE_FS_COMMENTLINEDOC 4
+#define SCE_FS_COMMENTDOCKEYWORD 5
+#define SCE_FS_COMMENTDOCKEYWORDERROR 6
+#define SCE_FS_KEYWORD 7
+#define SCE_FS_KEYWORD2 8
+#define SCE_FS_KEYWORD3 9
+#define SCE_FS_KEYWORD4 10
+#define SCE_FS_NUMBER 11
+#define SCE_FS_STRING 12
+#define SCE_FS_PREPROCESSOR 13
+#define SCE_FS_OPERATOR 14
+#define SCE_FS_IDENTIFIER 15
+#define SCE_FS_DATE 16
+#define SCE_FS_STRINGEOL 17
+#define SCE_FS_CONSTANT 18
+#define SCE_FS_WORDOPERATOR 19
+#define SCE_FS_DISABLEDCODE 20
+#define SCE_FS_DEFAULT_C 21
+#define SCE_FS_COMMENTDOC_C 22
+#define SCE_FS_COMMENTLINEDOC_C 23
+#define SCE_FS_KEYWORD_C 24
+#define SCE_FS_KEYWORD2_C 25
+#define SCE_FS_NUMBER_C 26
+#define SCE_FS_STRING_C 27
+#define SCE_FS_PREPROCESSOR_C 28
+#define SCE_FS_OPERATOR_C 29
+#define SCE_FS_IDENTIFIER_C 30
+#define SCE_FS_STRINGEOL_C 31
+#define SCE_CSOUND_DEFAULT 0
+#define SCE_CSOUND_COMMENT 1
+#define SCE_CSOUND_NUMBER 2
+#define SCE_CSOUND_OPERATOR 3
+#define SCE_CSOUND_INSTR 4
+#define SCE_CSOUND_IDENTIFIER 5
+#define SCE_CSOUND_OPCODE 6
+#define SCE_CSOUND_HEADERSTMT 7
+#define SCE_CSOUND_USERKEYWORD 8
+#define SCE_CSOUND_COMMENTBLOCK 9
+#define SCE_CSOUND_PARAM 10
+#define SCE_CSOUND_ARATE_VAR 11
+#define SCE_CSOUND_KRATE_VAR 12
+#define SCE_CSOUND_IRATE_VAR 13
+#define SCE_CSOUND_GLOBAL_VAR 14
+#define SCE_CSOUND_STRINGEOL 15
+#define SCE_INNO_DEFAULT 0
+#define SCE_INNO_COMMENT 1
+#define SCE_INNO_KEYWORD 2
+#define SCE_INNO_PARAMETER 3
+#define SCE_INNO_SECTION 4
+#define SCE_INNO_PREPROC 5
+#define SCE_INNO_INLINE_EXPANSION 6
+#define SCE_INNO_COMMENT_PASCAL 7
+#define SCE_INNO_KEYWORD_PASCAL 8
+#define SCE_INNO_KEYWORD_USER 9
+#define SCE_INNO_STRING_DOUBLE 10
+#define SCE_INNO_STRING_SINGLE 11
+#define SCE_INNO_IDENTIFIER 12
+#define SCE_OPAL_SPACE 0
+#define SCE_OPAL_COMMENT_BLOCK 1
+#define SCE_OPAL_COMMENT_LINE 2
+#define SCE_OPAL_INTEGER 3
+#define SCE_OPAL_KEYWORD 4
+#define SCE_OPAL_SORT 5
+#define SCE_OPAL_STRING 6
+#define SCE_OPAL_PAR 7
+#define SCE_OPAL_BOOL_CONST 8
+#define SCE_OPAL_DEFAULT 32
+#define SCE_SPICE_DEFAULT 0
+#define SCE_SPICE_IDENTIFIER 1
+#define SCE_SPICE_KEYWORD 2
+#define SCE_SPICE_KEYWORD2 3
+#define SCE_SPICE_KEYWORD3 4
+#define SCE_SPICE_NUMBER 5
+#define SCE_SPICE_DELIMITER 6
+#define SCE_SPICE_VALUE 7
+#define SCE_SPICE_COMMENTLINE 8
+#define SCE_CMAKE_DEFAULT 0
+#define SCE_CMAKE_COMMENT 1
+#define SCE_CMAKE_STRINGDQ 2
+#define SCE_CMAKE_STRINGLQ 3
+#define SCE_CMAKE_STRINGRQ 4
+#define SCE_CMAKE_COMMANDS 5
+#define SCE_CMAKE_PARAMETERS 6
+#define SCE_CMAKE_VARIABLE 7
+#define SCE_CMAKE_USERDEFINED 8
+#define SCE_CMAKE_WHILEDEF 9
+#define SCE_CMAKE_FOREACHDEF 10
+#define SCE_CMAKE_IFDEFINEDEF 11
+#define SCE_CMAKE_MACRODEF 12
+#define SCE_CMAKE_STRINGVAR 13
+#define SCE_CMAKE_NUMBER 14
+#define SCE_GAP_DEFAULT 0
+#define SCE_GAP_IDENTIFIER 1
+#define SCE_GAP_KEYWORD 2
+#define SCE_GAP_KEYWORD2 3
+#define SCE_GAP_KEYWORD3 4
+#define SCE_GAP_KEYWORD4 5
+#define SCE_GAP_STRING 6
+#define SCE_GAP_CHAR 7
+#define SCE_GAP_OPERATOR 8
+#define SCE_GAP_COMMENT 9
+#define SCE_GAP_NUMBER 10
+#define SCE_GAP_STRINGEOL 11
+#define SCE_PLM_DEFAULT 0
+#define SCE_PLM_COMMENT 1
+#define SCE_PLM_STRING 2
+#define SCE_PLM_NUMBER 3
+#define SCE_PLM_IDENTIFIER 4
+#define SCE_PLM_OPERATOR 5
+#define SCE_PLM_CONTROL 6
+#define SCE_PLM_KEYWORD 7
+#define SCE_4GL_DEFAULT 0
+#define SCE_4GL_NUMBER 1
+#define SCE_4GL_WORD 2
+#define SCE_4GL_STRING 3
+#define SCE_4GL_CHARACTER 4
+#define SCE_4GL_PREPROCESSOR 5
+#define SCE_4GL_OPERATOR 6
+#define SCE_4GL_IDENTIFIER 7
+#define SCE_4GL_BLOCK 8
+#define SCE_4GL_END 9
+#define SCE_4GL_COMMENT1 10
+#define SCE_4GL_COMMENT2 11
+#define SCE_4GL_COMMENT3 12
+#define SCE_4GL_COMMENT4 13
+#define SCE_4GL_COMMENT5 14
+#define SCE_4GL_COMMENT6 15
+#define SCE_4GL_DEFAULT_ 16
+#define SCE_4GL_NUMBER_ 17
+#define SCE_4GL_WORD_ 18
+#define SCE_4GL_STRING_ 19
+#define SCE_4GL_CHARACTER_ 20
+#define SCE_4GL_PREPROCESSOR_ 21
+#define SCE_4GL_OPERATOR_ 22
+#define SCE_4GL_IDENTIFIER_ 23
+#define SCE_4GL_BLOCK_ 24
+#define SCE_4GL_END_ 25
+#define SCE_4GL_COMMENT1_ 26
+#define SCE_4GL_COMMENT2_ 27
+#define SCE_4GL_COMMENT3_ 28
+#define SCE_4GL_COMMENT4_ 29
+#define SCE_4GL_COMMENT5_ 30
+#define SCE_4GL_COMMENT6_ 31
+#define SCE_ABAQUS_DEFAULT 0
+#define SCE_ABAQUS_COMMENT 1
+#define SCE_ABAQUS_COMMENTBLOCK 2
+#define SCE_ABAQUS_NUMBER 3
+#define SCE_ABAQUS_STRING 4
+#define SCE_ABAQUS_OPERATOR 5
+#define SCE_ABAQUS_WORD 6
+#define SCE_ABAQUS_PROCESSOR 7
+#define SCE_ABAQUS_COMMAND 8
+#define SCE_ABAQUS_SLASHCOMMAND 9
+#define SCE_ABAQUS_STARCOMMAND 10
+#define SCE_ABAQUS_ARGUMENT 11
+#define SCE_ABAQUS_FUNCTION 12
+#define SCE_ASY_DEFAULT 0
+#define SCE_ASY_COMMENT 1
+#define SCE_ASY_COMMENTLINE 2
+#define SCE_ASY_NUMBER 3
+#define SCE_ASY_WORD 4
+#define SCE_ASY_STRING 5
+#define SCE_ASY_CHARACTER 6
+#define SCE_ASY_OPERATOR 7
+#define SCE_ASY_IDENTIFIER 8
+#define SCE_ASY_STRINGEOL 9
+#define SCE_ASY_COMMENTLINEDOC 10
+#define SCE_ASY_WORD2 11
+#define SCE_R_DEFAULT 0
+#define SCE_R_COMMENT 1
+#define SCE_R_KWORD 2
+#define SCE_R_BASEKWORD 3
+#define SCE_R_OTHERKWORD 4
+#define SCE_R_NUMBER 5
+#define SCE_R_STRING 6
+#define SCE_R_STRING2 7
+#define SCE_R_OPERATOR 8
+#define SCE_R_IDENTIFIER 9
+#define SCE_R_INFIX 10
+#define SCE_R_INFIXEOL 11
+#define SCE_MAGIK_DEFAULT 0
+#define SCE_MAGIK_COMMENT 1
+#define SCE_MAGIK_HYPER_COMMENT 16
+#define SCE_MAGIK_STRING 2
+#define SCE_MAGIK_CHARACTER 3
+#define SCE_MAGIK_NUMBER 4
+#define SCE_MAGIK_IDENTIFIER 5
+#define SCE_MAGIK_OPERATOR 6
+#define SCE_MAGIK_FLOW 7
+#define SCE_MAGIK_CONTAINER 8
+#define SCE_MAGIK_BRACKET_BLOCK 9
+#define SCE_MAGIK_BRACE_BLOCK 10
+#define SCE_MAGIK_SQBRACKET_BLOCK 11
+#define SCE_MAGIK_UNKNOWN_KEYWORD 12
+#define SCE_MAGIK_KEYWORD 13
+#define SCE_MAGIK_PRAGMA 14
+#define SCE_MAGIK_SYMBOL 15
+#define SCE_POWERSHELL_DEFAULT 0
+#define SCE_POWERSHELL_COMMENT 1
+#define SCE_POWERSHELL_STRING 2
+#define SCE_POWERSHELL_CHARACTER 3
+#define SCE_POWERSHELL_NUMBER 4
+#define SCE_POWERSHELL_VARIABLE 5
+#define SCE_POWERSHELL_OPERATOR 6
+#define SCE_POWERSHELL_IDENTIFIER 7
+#define SCE_POWERSHELL_KEYWORD 8
+#define SCE_POWERSHELL_CMDLET 9
+#define SCE_POWERSHELL_ALIAS 10
+#define SCE_POWERSHELL_FUNCTION 11
+#define SCE_POWERSHELL_USER1 12
+#define SCE_POWERSHELL_COMMENTSTREAM 13
+#define SCE_POWERSHELL_HERE_STRING 14
+#define SCE_POWERSHELL_HERE_CHARACTER 15
+#define SCE_POWERSHELL_COMMENTDOCKEYWORD 16
+#define SCE_MYSQL_DEFAULT 0
+#define SCE_MYSQL_COMMENT 1
+#define SCE_MYSQL_COMMENTLINE 2
+#define SCE_MYSQL_VARIABLE 3
+#define SCE_MYSQL_SYSTEMVARIABLE 4
+#define SCE_MYSQL_KNOWNSYSTEMVARIABLE 5
+#define SCE_MYSQL_NUMBER 6
+#define SCE_MYSQL_MAJORKEYWORD 7
+#define SCE_MYSQL_KEYWORD 8
+#define SCE_MYSQL_DATABASEOBJECT 9
+#define SCE_MYSQL_PROCEDUREKEYWORD 10
+#define SCE_MYSQL_STRING 11
+#define SCE_MYSQL_SQSTRING 12
+#define SCE_MYSQL_DQSTRING 13
+#define SCE_MYSQL_OPERATOR 14
+#define SCE_MYSQL_FUNCTION 15
+#define SCE_MYSQL_IDENTIFIER 16
+#define SCE_MYSQL_QUOTEDIDENTIFIER 17
+#define SCE_MYSQL_USER1 18
+#define SCE_MYSQL_USER2 19
+#define SCE_MYSQL_USER3 20
+#define SCE_MYSQL_HIDDENCOMMAND 21
+#define SCE_MYSQL_PLACEHOLDER 22
+#define SCE_PO_DEFAULT 0
+#define SCE_PO_COMMENT 1
+#define SCE_PO_MSGID 2
+#define SCE_PO_MSGID_TEXT 3
+#define SCE_PO_MSGSTR 4
+#define SCE_PO_MSGSTR_TEXT 5
+#define SCE_PO_MSGCTXT 6
+#define SCE_PO_MSGCTXT_TEXT 7
+#define SCE_PO_FUZZY 8
+#define SCE_PO_PROGRAMMER_COMMENT 9
+#define SCE_PO_REFERENCE 10
+#define SCE_PO_FLAGS 11
+#define SCE_PO_MSGID_TEXT_EOL 12
+#define SCE_PO_MSGSTR_TEXT_EOL 13
+#define SCE_PO_MSGCTXT_TEXT_EOL 14
+#define SCE_PO_ERROR 15
+#define SCE_PAS_DEFAULT 0
+#define SCE_PAS_IDENTIFIER 1
+#define SCE_PAS_COMMENT 2
+#define SCE_PAS_COMMENT2 3
+#define SCE_PAS_COMMENTLINE 4
+#define SCE_PAS_PREPROCESSOR 5
+#define SCE_PAS_PREPROCESSOR2 6
+#define SCE_PAS_NUMBER 7
+#define SCE_PAS_HEXNUMBER 8
+#define SCE_PAS_WORD 9
+#define SCE_PAS_STRING 10
+#define SCE_PAS_STRINGEOL 11
+#define SCE_PAS_CHARACTER 12
+#define SCE_PAS_OPERATOR 13
+#define SCE_PAS_ASM 14
+#define SCE_SORCUS_DEFAULT 0
+#define SCE_SORCUS_COMMAND 1
+#define SCE_SORCUS_PARAMETER 2
+#define SCE_SORCUS_COMMENTLINE 3
+#define SCE_SORCUS_STRING 4
+#define SCE_SORCUS_STRINGEOL 5
+#define SCE_SORCUS_IDENTIFIER 6
+#define SCE_SORCUS_OPERATOR 7
+#define SCE_SORCUS_NUMBER 8
+#define SCE_SORCUS_CONSTANT 9
+#define SCE_POWERPRO_DEFAULT 0
+#define SCE_POWERPRO_COMMENTBLOCK 1
+#define SCE_POWERPRO_COMMENTLINE 2
+#define SCE_POWERPRO_NUMBER 3
+#define SCE_POWERPRO_WORD 4
+#define SCE_POWERPRO_WORD2 5
+#define SCE_POWERPRO_WORD3 6
+#define SCE_POWERPRO_WORD4 7
+#define SCE_POWERPRO_DOUBLEQUOTEDSTRING 8
+#define SCE_POWERPRO_SINGLEQUOTEDSTRING 9
+#define SCE_POWERPRO_LINECONTINUE 10
+#define SCE_POWERPRO_OPERATOR 11
+#define SCE_POWERPRO_IDENTIFIER 12
+#define SCE_POWERPRO_STRINGEOL 13
+#define SCE_POWERPRO_VERBATIM 14
+#define SCE_POWERPRO_ALTQUOTE 15
+#define SCE_POWERPRO_FUNCTION 16
+#define SCE_SML_DEFAULT 0
+#define SCE_SML_IDENTIFIER 1
+#define SCE_SML_TAGNAME 2
+#define SCE_SML_KEYWORD 3
+#define SCE_SML_KEYWORD2 4
+#define SCE_SML_KEYWORD3 5
+#define SCE_SML_LINENUM 6
+#define SCE_SML_OPERATOR 7
+#define SCE_SML_NUMBER 8
+#define SCE_SML_CHAR 9
+#define SCE_SML_STRING 11
+#define SCE_SML_COMMENT 12
+#define SCE_SML_COMMENT1 13
+#define SCE_SML_COMMENT2 14
+#define SCE_SML_COMMENT3 15
+#define SCE_MARKDOWN_DEFAULT 0
+#define SCE_MARKDOWN_LINE_BEGIN 1
+#define SCE_MARKDOWN_STRONG1 2
+#define SCE_MARKDOWN_STRONG2 3
+#define SCE_MARKDOWN_EM1 4
+#define SCE_MARKDOWN_EM2 5
+#define SCE_MARKDOWN_HEADER1 6
+#define SCE_MARKDOWN_HEADER2 7
+#define SCE_MARKDOWN_HEADER3 8
+#define SCE_MARKDOWN_HEADER4 9
+#define SCE_MARKDOWN_HEADER5 10
+#define SCE_MARKDOWN_HEADER6 11
+#define SCE_MARKDOWN_PRECHAR 12
+#define SCE_MARKDOWN_ULIST_ITEM 13
+#define SCE_MARKDOWN_OLIST_ITEM 14
+#define SCE_MARKDOWN_BLOCKQUOTE 15
+#define SCE_MARKDOWN_STRIKEOUT 16
+#define SCE_MARKDOWN_HRULE 17
+#define SCE_MARKDOWN_LINK 18
+#define SCE_MARKDOWN_CODE 19
+#define SCE_MARKDOWN_CODE2 20
+#define SCE_MARKDOWN_CODEBK 21
+#define SCE_TXT2TAGS_DEFAULT 0
+#define SCE_TXT2TAGS_LINE_BEGIN 1
+#define SCE_TXT2TAGS_STRONG1 2
+#define SCE_TXT2TAGS_STRONG2 3
+#define SCE_TXT2TAGS_EM1 4
+#define SCE_TXT2TAGS_EM2 5
+#define SCE_TXT2TAGS_HEADER1 6
+#define SCE_TXT2TAGS_HEADER2 7
+#define SCE_TXT2TAGS_HEADER3 8
+#define SCE_TXT2TAGS_HEADER4 9
+#define SCE_TXT2TAGS_HEADER5 10
+#define SCE_TXT2TAGS_HEADER6 11
+#define SCE_TXT2TAGS_PRECHAR 12
+#define SCE_TXT2TAGS_ULIST_ITEM 13
+#define SCE_TXT2TAGS_OLIST_ITEM 14
+#define SCE_TXT2TAGS_BLOCKQUOTE 15
+#define SCE_TXT2TAGS_STRIKEOUT 16
+#define SCE_TXT2TAGS_HRULE 17
+#define SCE_TXT2TAGS_LINK 18
+#define SCE_TXT2TAGS_CODE 19
+#define SCE_TXT2TAGS_CODE2 20
+#define SCE_TXT2TAGS_CODEBK 21
+#define SCE_TXT2TAGS_COMMENT 22
+#define SCE_TXT2TAGS_OPTION 23
+#define SCE_TXT2TAGS_PREPROC 24
+#define SCE_TXT2TAGS_POSTPROC 25
+#define SCE_A68K_DEFAULT 0
+#define SCE_A68K_COMMENT 1
+#define SCE_A68K_NUMBER_DEC 2
+#define SCE_A68K_NUMBER_BIN 3
+#define SCE_A68K_NUMBER_HEX 4
+#define SCE_A68K_STRING1 5
+#define SCE_A68K_OPERATOR 6
+#define SCE_A68K_CPUINSTRUCTION 7
+#define SCE_A68K_EXTINSTRUCTION 8
+#define SCE_A68K_REGISTER 9
+#define SCE_A68K_DIRECTIVE 10
+#define SCE_A68K_MACRO_ARG 11
+#define SCE_A68K_LABEL 12
+#define SCE_A68K_STRING2 13
+#define SCE_A68K_IDENTIFIER 14
+#define SCE_A68K_MACRO_DECLARATION 15
+#define SCE_A68K_COMMENT_WORD 16
+#define SCE_A68K_COMMENT_SPECIAL 17
+#define SCE_A68K_COMMENT_DOXYGEN 18
+#define SCE_MODULA_DEFAULT 0
+#define SCE_MODULA_COMMENT 1
+#define SCE_MODULA_DOXYCOMM 2
+#define SCE_MODULA_DOXYKEY 3
+#define SCE_MODULA_KEYWORD 4
+#define SCE_MODULA_RESERVED 5
+#define SCE_MODULA_NUMBER 6
+#define SCE_MODULA_BASENUM 7
+#define SCE_MODULA_FLOAT 8
+#define SCE_MODULA_STRING 9
+#define SCE_MODULA_STRSPEC 10
+#define SCE_MODULA_CHAR 11
+#define SCE_MODULA_CHARSPEC 12
+#define SCE_MODULA_PROC 13
+#define SCE_MODULA_PRAGMA 14
+#define SCE_MODULA_PRGKEY 15
+#define SCE_MODULA_OPERATOR 16
+#define SCE_MODULA_BADSTR 17
+#define SCE_COFFEESCRIPT_DEFAULT 0
+#define SCE_COFFEESCRIPT_COMMENT 1
+#define SCE_COFFEESCRIPT_COMMENTLINE 2
+#define SCE_COFFEESCRIPT_COMMENTDOC 3
+#define SCE_COFFEESCRIPT_NUMBER 4
+#define SCE_COFFEESCRIPT_WORD 5
+#define SCE_COFFEESCRIPT_STRING 6
+#define SCE_COFFEESCRIPT_CHARACTER 7
+#define SCE_COFFEESCRIPT_UUID 8
+#define SCE_COFFEESCRIPT_PREPROCESSOR 9
+#define SCE_COFFEESCRIPT_OPERATOR 10
+#define SCE_COFFEESCRIPT_IDENTIFIER 11
+#define SCE_COFFEESCRIPT_STRINGEOL 12
+#define SCE_COFFEESCRIPT_VERBATIM 13
+#define SCE_COFFEESCRIPT_REGEX 14
+#define SCE_COFFEESCRIPT_COMMENTLINEDOC 15
+#define SCE_COFFEESCRIPT_WORD2 16
+#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORD 17
+#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18
+#define SCE_COFFEESCRIPT_GLOBALCLASS 19
+#define SCE_COFFEESCRIPT_STRINGRAW 20
+#define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21
+#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
+#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
+#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
+#define SCE_AVS_DEFAULT 0
+#define SCE_AVS_COMMENTBLOCK 1
+#define SCE_AVS_COMMENTBLOCKN 2
+#define SCE_AVS_COMMENTLINE 3
+#define SCE_AVS_NUMBER 4
+#define SCE_AVS_OPERATOR 5
+#define SCE_AVS_IDENTIFIER 6
+#define SCE_AVS_STRING 7
+#define SCE_AVS_TRIPLESTRING 8
+#define SCE_AVS_KEYWORD 9
+#define SCE_AVS_FILTER 10
+#define SCE_AVS_PLUGIN 11
+#define SCE_AVS_FUNCTION 12
+#define SCE_AVS_CLIPPROP 13
+#define SCE_AVS_USERDFN 14
+#define SCE_ECL_DEFAULT 0
+#define SCE_ECL_COMMENT 1
+#define SCE_ECL_COMMENTLINE 2
+#define SCE_ECL_NUMBER 3
+#define SCE_ECL_STRING 4
+#define SCE_ECL_WORD0 5
+#define SCE_ECL_OPERATOR 6
+#define SCE_ECL_CHARACTER 7
+#define SCE_ECL_UUID 8
+#define SCE_ECL_PREPROCESSOR 9
+#define SCE_ECL_UNKNOWN 10
+#define SCE_ECL_IDENTIFIER 11
+#define SCE_ECL_STRINGEOL 12
+#define SCE_ECL_VERBATIM 13
+#define SCE_ECL_REGEX 14
+#define SCE_ECL_COMMENTLINEDOC 15
+#define SCE_ECL_WORD1 16
+#define SCE_ECL_COMMENTDOCKEYWORD 17
+#define SCE_ECL_COMMENTDOCKEYWORDERROR 18
+#define SCE_ECL_WORD2 19
+#define SCE_ECL_WORD3 20
+#define SCE_ECL_WORD4 21
+#define SCE_ECL_WORD5 22
+#define SCE_ECL_COMMENTDOC 23
+#define SCE_ECL_ADDED 24
+#define SCE_ECL_DELETED 25
+#define SCE_ECL_CHANGED 26
+#define SCE_ECL_MOVED 27
+#define SCE_OSCRIPT_DEFAULT 0
+#define SCE_OSCRIPT_LINE_COMMENT 1
+#define SCE_OSCRIPT_BLOCK_COMMENT 2
+#define SCE_OSCRIPT_DOC_COMMENT 3
+#define SCE_OSCRIPT_PREPROCESSOR 4
+#define SCE_OSCRIPT_NUMBER 5
+#define SCE_OSCRIPT_SINGLEQUOTE_STRING 6
+#define SCE_OSCRIPT_DOUBLEQUOTE_STRING 7
+#define SCE_OSCRIPT_CONSTANT 8
+#define SCE_OSCRIPT_IDENTIFIER 9
+#define SCE_OSCRIPT_GLOBAL 10
+#define SCE_OSCRIPT_KEYWORD 11
+#define SCE_OSCRIPT_OPERATOR 12
+#define SCE_OSCRIPT_LABEL 13
+#define SCE_OSCRIPT_TYPE 14
+#define SCE_OSCRIPT_FUNCTION 15
+#define SCE_OSCRIPT_OBJECT 16
+#define SCE_OSCRIPT_PROPERTY 17
+#define SCE_OSCRIPT_METHOD 18
+#define SCE_VISUALPROLOG_DEFAULT 0
+#define SCE_VISUALPROLOG_KEY_MAJOR 1
+#define SCE_VISUALPROLOG_KEY_MINOR 2
+#define SCE_VISUALPROLOG_KEY_DIRECTIVE 3
+#define SCE_VISUALPROLOG_COMMENT_BLOCK 4
+#define SCE_VISUALPROLOG_COMMENT_LINE 5
+#define SCE_VISUALPROLOG_COMMENT_KEY 6
+#define SCE_VISUALPROLOG_COMMENT_KEY_ERROR 7
+#define SCE_VISUALPROLOG_IDENTIFIER 8
+#define SCE_VISUALPROLOG_VARIABLE 9
+#define SCE_VISUALPROLOG_ANONYMOUS 10
+#define SCE_VISUALPROLOG_NUMBER 11
+#define SCE_VISUALPROLOG_OPERATOR 12
+#define SCE_VISUALPROLOG_CHARACTER 13
+#define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14
+#define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15
+#define SCE_VISUALPROLOG_STRING 16
+#define SCE_VISUALPROLOG_STRING_ESCAPE 17
+#define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18
+#define SCE_VISUALPROLOG_STRING_EOL_OPEN 19
+#define SCE_VISUALPROLOG_STRING_VERBATIM 20
+#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
+#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22
+#define SCE_STTXT_DEFAULT 0
+#define SCE_STTXT_COMMENT 1
+#define SCE_STTXT_COMMENTLINE 2
+#define SCE_STTXT_KEYWORD 3
+#define SCE_STTXT_TYPE 4
+#define SCE_STTXT_FUNCTION 5
+#define SCE_STTXT_FB 6
+#define SCE_STTXT_NUMBER 7
+#define SCE_STTXT_HEXNUMBER 8
+#define SCE_STTXT_PRAGMA 9
+#define SCE_STTXT_OPERATOR 10
+#define SCE_STTXT_CHARACTER 11
+#define SCE_STTXT_STRING1 12
+#define SCE_STTXT_STRING2 13
+#define SCE_STTXT_STRINGEOL 14
+#define SCE_STTXT_IDENTIFIER 15
+#define SCE_STTXT_DATETIME 16
+#define SCE_STTXT_VARS 17
+#define SCE_STTXT_PRAGMAS 18
+#define SCE_KVIRC_DEFAULT 0
+#define SCE_KVIRC_COMMENT 1
+#define SCE_KVIRC_COMMENTBLOCK 2
+#define SCE_KVIRC_STRING 3
+#define SCE_KVIRC_WORD 4
+#define SCE_KVIRC_KEYWORD 5
+#define SCE_KVIRC_FUNCTION_KEYWORD 6
+#define SCE_KVIRC_FUNCTION 7
+#define SCE_KVIRC_VARIABLE 8
+#define SCE_KVIRC_NUMBER 9
+#define SCE_KVIRC_OPERATOR 10
+#define SCE_KVIRC_STRING_FUNCTION 11
+#define SCE_KVIRC_STRING_VARIABLE 12
+#define SCE_RUST_DEFAULT 0
+#define SCE_RUST_COMMENTBLOCK 1
+#define SCE_RUST_COMMENTLINE 2
+#define SCE_RUST_COMMENTBLOCKDOC 3
+#define SCE_RUST_COMMENTLINEDOC 4
+#define SCE_RUST_NUMBER 5
+#define SCE_RUST_WORD 6
+#define SCE_RUST_WORD2 7
+#define SCE_RUST_WORD3 8
+#define SCE_RUST_WORD4 9
+#define SCE_RUST_WORD5 10
+#define SCE_RUST_WORD6 11
+#define SCE_RUST_WORD7 12
+#define SCE_RUST_STRING 13
+#define SCE_RUST_STRINGR 14
+#define SCE_RUST_CHARACTER 15
+#define SCE_RUST_OPERATOR 16
+#define SCE_RUST_IDENTIFIER 17
+#define SCE_RUST_LIFETIME 18
+#define SCE_RUST_MACRO 19
+#define SCE_RUST_LEXERROR 20
+#define SCE_RUST_BYTESTRING 21
+#define SCE_RUST_BYTESTRINGR 22
+#define SCE_RUST_BYTECHARACTER 23
+#define SCE_DMAP_DEFAULT 0
+#define SCE_DMAP_COMMENT 1
+#define SCE_DMAP_NUMBER 2
+#define SCE_DMAP_STRING1 3
+#define SCE_DMAP_STRING2 4
+#define SCE_DMAP_STRINGEOL 5
+#define SCE_DMAP_OPERATOR 6
+#define SCE_DMAP_IDENTIFIER 7
+#define SCE_DMAP_WORD 8
+#define SCE_DMAP_WORD2 9
+#define SCE_DMAP_WORD3 10
+#define SCE_DMIS_DEFAULT 0
+#define SCE_DMIS_COMMENT 1
+#define SCE_DMIS_STRING 2
+#define SCE_DMIS_NUMBER 3
+#define SCE_DMIS_KEYWORD 4
+#define SCE_DMIS_MAJORWORD 5
+#define SCE_DMIS_MINORWORD 6
+#define SCE_DMIS_UNSUPPORTED_MAJOR 7
+#define SCE_DMIS_UNSUPPORTED_MINOR 8
+#define SCE_DMIS_LABEL 9
+#define SCE_REG_DEFAULT 0
+#define SCE_REG_COMMENT 1
+#define SCE_REG_VALUENAME 2
+#define SCE_REG_STRING 3
+#define SCE_REG_HEXDIGIT 4
+#define SCE_REG_VALUETYPE 5
+#define SCE_REG_ADDEDKEY 6
+#define SCE_REG_DELETEDKEY 7
+#define SCE_REG_ESCAPED 8
+#define SCE_REG_KEYPATH_GUID 9
+#define SCE_REG_STRING_GUID 10
+#define SCE_REG_PARAMETER 11
+#define SCE_REG_OPERATOR 12
+#define SCE_BIBTEX_DEFAULT 0
+#define SCE_BIBTEX_ENTRY 1
+#define SCE_BIBTEX_UNKNOWN_ENTRY 2
+#define SCE_BIBTEX_KEY 3
+#define SCE_BIBTEX_PARAMETER 4
+#define SCE_BIBTEX_VALUE 5
+#define SCE_BIBTEX_COMMENT 6
+#define SCE_HEX_DEFAULT 0
+#define SCE_HEX_RECSTART 1
+#define SCE_HEX_RECTYPE 2
+#define SCE_HEX_RECTYPE_UNKNOWN 3
+#define SCE_HEX_BYTECOUNT 4
+#define SCE_HEX_BYTECOUNT_WRONG 5
+#define SCE_HEX_NOADDRESS 6
+#define SCE_HEX_DATAADDRESS 7
+#define SCE_HEX_RECCOUNT 8
+#define SCE_HEX_STARTADDRESS 9
+#define SCE_HEX_ADDRESSFIELD_UNKNOWN 10
+#define SCE_HEX_EXTENDEDADDRESS 11
+#define SCE_HEX_DATA_ODD 12
+#define SCE_HEX_DATA_EVEN 13
+#define SCE_HEX_DATA_UNKNOWN 14
+#define SCE_HEX_DATA_EMPTY 15
+#define SCE_HEX_CHECKSUM 16
+#define SCE_HEX_CHECKSUM_WRONG 17
+#define SCE_HEX_GARBAGE 18
+/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.h b/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.h
new file mode 100644
index 00000000000..22d36d34d92
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.h
@@ -0,0 +1,1163 @@
+/* Scintilla source code edit control */
+/** @file Scintilla.h
+ ** Interface to the edit control.
+ **/
+/* Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed. */
+
+/* Most of this file is automatically generated from the Scintilla.iface interface definition
+ * file which contains any comments about the definitions. HFacer.py does the generation. */
+
+#ifndef SCINTILLA_H
+#define SCINTILLA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+/* Return false on failure: */
+int Scintilla_RegisterClasses(void *hInstance);
+int Scintilla_ReleaseResources(void);
+#endif
+int Scintilla_LinkLexers(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Here should be placed typedefs for uptr_t, an unsigned integer type large enough to
+ * hold a pointer and sptr_t, a signed integer large enough to hold a pointer.
+ * May need to be changed for 64 bit platforms. */
+#if defined(_WIN32)
+#include <basetsd.h>
+#endif
+#ifdef MAXULONG_PTR
+typedef ULONG_PTR uptr_t;
+typedef LONG_PTR sptr_t;
+#else
+typedef unsigned long uptr_t;
+typedef long sptr_t;
+#endif
+
+typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+#define INVALID_POSITION -1
+#define SCI_START 2000
+#define SCI_OPTIONAL_START 3000
+#define SCI_LEXER_START 4000
+#define SCI_ADDTEXT 2001
+#define SCI_ADDSTYLEDTEXT 2002
+#define SCI_INSERTTEXT 2003
+#define SCI_CHANGEINSERTION 2672
+#define SCI_CLEARALL 2004
+#define SCI_DELETERANGE 2645
+#define SCI_CLEARDOCUMENTSTYLE 2005
+#define SCI_GETLENGTH 2006
+#define SCI_GETCHARAT 2007
+#define SCI_GETCURRENTPOS 2008
+#define SCI_GETANCHOR 2009
+#define SCI_GETSTYLEAT 2010
+#define SCI_REDO 2011
+#define SCI_SETUNDOCOLLECTION 2012
+#define SCI_SELECTALL 2013
+#define SCI_SETSAVEPOINT 2014
+#define SCI_GETSTYLEDTEXT 2015
+#define SCI_CANREDO 2016
+#define SCI_MARKERLINEFROMHANDLE 2017
+#define SCI_MARKERDELETEHANDLE 2018
+#define SCI_GETUNDOCOLLECTION 2019
+#define SCWS_INVISIBLE 0
+#define SCWS_VISIBLEALWAYS 1
+#define SCWS_VISIBLEAFTERINDENT 2
+#define SCI_GETVIEWWS 2020
+#define SCI_SETVIEWWS 2021
+#define SCI_POSITIONFROMPOINT 2022
+#define SCI_POSITIONFROMPOINTCLOSE 2023
+#define SCI_GOTOLINE 2024
+#define SCI_GOTOPOS 2025
+#define SCI_SETANCHOR 2026
+#define SCI_GETCURLINE 2027
+#define SCI_GETENDSTYLED 2028
+#define SC_EOL_CRLF 0
+#define SC_EOL_CR 1
+#define SC_EOL_LF 2
+#define SCI_CONVERTEOLS 2029
+#define SCI_GETEOLMODE 2030
+#define SCI_SETEOLMODE 2031
+#define SCI_STARTSTYLING 2032
+#define SCI_SETSTYLING 2033
+#define SCI_GETBUFFEREDDRAW 2034
+#define SCI_SETBUFFEREDDRAW 2035
+#define SCI_SETTABWIDTH 2036
+#define SCI_GETTABWIDTH 2121
+#define SCI_CLEARTABSTOPS 2675
+#define SCI_ADDTABSTOP 2676
+#define SCI_GETNEXTTABSTOP 2677
+#define SC_CP_UTF8 65001
+#define SCI_SETCODEPAGE 2037
+#define SC_IME_WINDOWED 0
+#define SC_IME_INLINE 1
+#define SCI_GETIMEINTERACTION 2678
+#define SCI_SETIMEINTERACTION 2679
+#define MARKER_MAX 31
+#define SC_MARK_CIRCLE 0
+#define SC_MARK_ROUNDRECT 1
+#define SC_MARK_ARROW 2
+#define SC_MARK_SMALLRECT 3
+#define SC_MARK_SHORTARROW 4
+#define SC_MARK_EMPTY 5
+#define SC_MARK_ARROWDOWN 6
+#define SC_MARK_MINUS 7
+#define SC_MARK_PLUS 8
+#define SC_MARK_VLINE 9
+#define SC_MARK_LCORNER 10
+#define SC_MARK_TCORNER 11
+#define SC_MARK_BOXPLUS 12
+#define SC_MARK_BOXPLUSCONNECTED 13
+#define SC_MARK_BOXMINUS 14
+#define SC_MARK_BOXMINUSCONNECTED 15
+#define SC_MARK_LCORNERCURVE 16
+#define SC_MARK_TCORNERCURVE 17
+#define SC_MARK_CIRCLEPLUS 18
+#define SC_MARK_CIRCLEPLUSCONNECTED 19
+#define SC_MARK_CIRCLEMINUS 20
+#define SC_MARK_CIRCLEMINUSCONNECTED 21
+#define SC_MARK_BACKGROUND 22
+#define SC_MARK_DOTDOTDOT 23
+#define SC_MARK_ARROWS 24
+#define SC_MARK_PIXMAP 25
+#define SC_MARK_FULLRECT 26
+#define SC_MARK_LEFTRECT 27
+#define SC_MARK_AVAILABLE 28
+#define SC_MARK_UNDERLINE 29
+#define SC_MARK_RGBAIMAGE 30
+#define SC_MARK_BOOKMARK 31
+#define SC_MARK_CHARACTER 10000
+#define SC_MARKNUM_FOLDEREND 25
+#define SC_MARKNUM_FOLDEROPENMID 26
+#define SC_MARKNUM_FOLDERMIDTAIL 27
+#define SC_MARKNUM_FOLDERTAIL 28
+#define SC_MARKNUM_FOLDERSUB 29
+#define SC_MARKNUM_FOLDER 30
+#define SC_MARKNUM_FOLDEROPEN 31
+#define SC_MASK_FOLDERS 0xFE000000
+#define SCI_MARKERDEFINE 2040
+#define SCI_MARKERSETFORE 2041
+#define SCI_MARKERSETBACK 2042
+#define SCI_MARKERSETBACKSELECTED 2292
+#define SCI_MARKERENABLEHIGHLIGHT 2293
+#define SCI_MARKERADD 2043
+#define SCI_MARKERDELETE 2044
+#define SCI_MARKERDELETEALL 2045
+#define SCI_MARKERGET 2046
+#define SCI_MARKERNEXT 2047
+#define SCI_MARKERPREVIOUS 2048
+#define SCI_MARKERDEFINEPIXMAP 2049
+#define SCI_MARKERADDSET 2466
+#define SCI_MARKERSETALPHA 2476
+#define SC_MAX_MARGIN 4
+#define SC_MARGIN_SYMBOL 0
+#define SC_MARGIN_NUMBER 1
+#define SC_MARGIN_BACK 2
+#define SC_MARGIN_FORE 3
+#define SC_MARGIN_TEXT 4
+#define SC_MARGIN_RTEXT 5
+#define SCI_SETMARGINTYPEN 2240
+#define SCI_GETMARGINTYPEN 2241
+#define SCI_SETMARGINWIDTHN 2242
+#define SCI_GETMARGINWIDTHN 2243
+#define SCI_SETMARGINMASKN 2244
+#define SCI_GETMARGINMASKN 2245
+#define SCI_SETMARGINSENSITIVEN 2246
+#define SCI_GETMARGINSENSITIVEN 2247
+#define SCI_SETMARGINCURSORN 2248
+#define SCI_GETMARGINCURSORN 2249
+#define STYLE_DEFAULT 32
+#define STYLE_LINENUMBER 33
+#define STYLE_BRACELIGHT 34
+#define STYLE_BRACEBAD 35
+#define STYLE_CONTROLCHAR 36
+#define STYLE_INDENTGUIDE 37
+#define STYLE_CALLTIP 38
+#define STYLE_LASTPREDEFINED 39
+#define STYLE_MAX 255
+#define SC_CHARSET_ANSI 0
+#define SC_CHARSET_DEFAULT 1
+#define SC_CHARSET_BALTIC 186
+#define SC_CHARSET_CHINESEBIG5 136
+#define SC_CHARSET_EASTEUROPE 238
+#define SC_CHARSET_GB2312 134
+#define SC_CHARSET_GREEK 161
+#define SC_CHARSET_HANGUL 129
+#define SC_CHARSET_MAC 77
+#define SC_CHARSET_OEM 255
+#define SC_CHARSET_RUSSIAN 204
+#define SC_CHARSET_CYRILLIC 1251
+#define SC_CHARSET_SHIFTJIS 128
+#define SC_CHARSET_SYMBOL 2
+#define SC_CHARSET_TURKISH 162
+#define SC_CHARSET_JOHAB 130
+#define SC_CHARSET_HEBREW 177
+#define SC_CHARSET_ARABIC 178
+#define SC_CHARSET_VIETNAMESE 163
+#define SC_CHARSET_THAI 222
+#define SC_CHARSET_8859_15 1000
+#define SCI_STYLECLEARALL 2050
+#define SCI_STYLESETFORE 2051
+#define SCI_STYLESETBACK 2052
+#define SCI_STYLESETBOLD 2053
+#define SCI_STYLESETITALIC 2054
+#define SCI_STYLESETSIZE 2055
+#define SCI_STYLESETFONT 2056
+#define SCI_STYLESETEOLFILLED 2057
+#define SCI_STYLERESETDEFAULT 2058
+#define SCI_STYLESETUNDERLINE 2059
+#define SC_CASE_MIXED 0
+#define SC_CASE_UPPER 1
+#define SC_CASE_LOWER 2
+#define SCI_STYLEGETFORE 2481
+#define SCI_STYLEGETBACK 2482
+#define SCI_STYLEGETBOLD 2483
+#define SCI_STYLEGETITALIC 2484
+#define SCI_STYLEGETSIZE 2485
+#define SCI_STYLEGETFONT 2486
+#define SCI_STYLEGETEOLFILLED 2487
+#define SCI_STYLEGETUNDERLINE 2488
+#define SCI_STYLEGETCASE 2489
+#define SCI_STYLEGETCHARACTERSET 2490
+#define SCI_STYLEGETVISIBLE 2491
+#define SCI_STYLEGETCHANGEABLE 2492
+#define SCI_STYLEGETHOTSPOT 2493
+#define SCI_STYLESETCASE 2060
+#define SC_FONT_SIZE_MULTIPLIER 100
+#define SCI_STYLESETSIZEFRACTIONAL 2061
+#define SCI_STYLEGETSIZEFRACTIONAL 2062
+#define SC_WEIGHT_NORMAL 400
+#define SC_WEIGHT_SEMIBOLD 600
+#define SC_WEIGHT_BOLD 700
+#define SCI_STYLESETWEIGHT 2063
+#define SCI_STYLEGETWEIGHT 2064
+#define SCI_STYLESETCHARACTERSET 2066
+#define SCI_STYLESETHOTSPOT 2409
+#define SCI_SETSELFORE 2067
+#define SCI_SETSELBACK 2068
+#define SCI_GETSELALPHA 2477
+#define SCI_SETSELALPHA 2478
+#define SCI_GETSELEOLFILLED 2479
+#define SCI_SETSELEOLFILLED 2480
+#define SCI_SETCARETFORE 2069
+#define SCI_ASSIGNCMDKEY 2070
+#define SCI_CLEARCMDKEY 2071
+#define SCI_CLEARALLCMDKEYS 2072
+#define SCI_SETSTYLINGEX 2073
+#define SCI_STYLESETVISIBLE 2074
+#define SCI_GETCARETPERIOD 2075
+#define SCI_SETCARETPERIOD 2076
+#define SCI_SETWORDCHARS 2077
+#define SCI_GETWORDCHARS 2646
+#define SCI_BEGINUNDOACTION 2078
+#define SCI_ENDUNDOACTION 2079
+#define INDIC_PLAIN 0
+#define INDIC_SQUIGGLE 1
+#define INDIC_TT 2
+#define INDIC_DIAGONAL 3
+#define INDIC_STRIKE 4
+#define INDIC_HIDDEN 5
+#define INDIC_BOX 6
+#define INDIC_ROUNDBOX 7
+#define INDIC_STRAIGHTBOX 8
+#define INDIC_DASH 9
+#define INDIC_DOTS 10
+#define INDIC_SQUIGGLELOW 11
+#define INDIC_DOTBOX 12
+#define INDIC_SQUIGGLEPIXMAP 13
+#define INDIC_COMPOSITIONTHICK 14
+#define INDIC_COMPOSITIONTHIN 15
+#define INDIC_FULLBOX 16
+#define INDIC_TEXTFORE 17
+#define INDIC_IME 32
+#define INDIC_IME_MAX 35
+#define INDIC_MAX 35
+#define INDIC_CONTAINER 8
+#define INDIC0_MASK 0x20
+#define INDIC1_MASK 0x40
+#define INDIC2_MASK 0x80
+#define INDICS_MASK 0xE0
+#define SCI_INDICSETSTYLE 2080
+#define SCI_INDICGETSTYLE 2081
+#define SCI_INDICSETFORE 2082
+#define SCI_INDICGETFORE 2083
+#define SCI_INDICSETUNDER 2510
+#define SCI_INDICGETUNDER 2511
+#define SCI_INDICSETHOVERSTYLE 2680
+#define SCI_INDICGETHOVERSTYLE 2681
+#define SCI_INDICSETHOVERFORE 2682
+#define SCI_INDICGETHOVERFORE 2683
+#define SC_INDICVALUEBIT 0x1000000
+#define SC_INDICVALUEMASK 0xFFFFFF
+#define SC_INDICFLAG_VALUEFORE 1
+#define SCI_INDICSETFLAGS 2684
+#define SCI_INDICGETFLAGS 2685
+#define SCI_SETWHITESPACEFORE 2084
+#define SCI_SETWHITESPACEBACK 2085
+#define SCI_SETWHITESPACESIZE 2086
+#define SCI_GETWHITESPACESIZE 2087
+#define SCI_SETSTYLEBITS 2090
+#define SCI_GETSTYLEBITS 2091
+#define SCI_SETLINESTATE 2092
+#define SCI_GETLINESTATE 2093
+#define SCI_GETMAXLINESTATE 2094
+#define SCI_GETCARETLINEVISIBLE 2095
+#define SCI_SETCARETLINEVISIBLE 2096
+#define SCI_GETCARETLINEBACK 2097
+#define SCI_SETCARETLINEBACK 2098
+#define SCI_STYLESETCHANGEABLE 2099
+#define SCI_AUTOCSHOW 2100
+#define SCI_AUTOCCANCEL 2101
+#define SCI_AUTOCACTIVE 2102
+#define SCI_AUTOCPOSSTART 2103
+#define SCI_AUTOCCOMPLETE 2104
+#define SCI_AUTOCSTOPS 2105
+#define SCI_AUTOCSETSEPARATOR 2106
+#define SCI_AUTOCGETSEPARATOR 2107
+#define SCI_AUTOCSELECT 2108
+#define SCI_AUTOCSETCANCELATSTART 2110
+#define SCI_AUTOCGETCANCELATSTART 2111
+#define SCI_AUTOCSETFILLUPS 2112
+#define SCI_AUTOCSETCHOOSESINGLE 2113
+#define SCI_AUTOCGETCHOOSESINGLE 2114
+#define SCI_AUTOCSETIGNORECASE 2115
+#define SCI_AUTOCGETIGNORECASE 2116
+#define SCI_USERLISTSHOW 2117
+#define SCI_AUTOCSETAUTOHIDE 2118
+#define SCI_AUTOCGETAUTOHIDE 2119
+#define SCI_AUTOCSETDROPRESTOFWORD 2270
+#define SCI_AUTOCGETDROPRESTOFWORD 2271
+#define SCI_REGISTERIMAGE 2405
+#define SCI_CLEARREGISTEREDIMAGES 2408
+#define SCI_AUTOCGETTYPESEPARATOR 2285
+#define SCI_AUTOCSETTYPESEPARATOR 2286
+#define SCI_AUTOCSETMAXWIDTH 2208
+#define SCI_AUTOCGETMAXWIDTH 2209
+#define SCI_AUTOCSETMAXHEIGHT 2210
+#define SCI_AUTOCGETMAXHEIGHT 2211
+#define SCI_SETINDENT 2122
+#define SCI_GETINDENT 2123
+#define SCI_SETUSETABS 2124
+#define SCI_GETUSETABS 2125
+#define SCI_SETLINEINDENTATION 2126
+#define SCI_GETLINEINDENTATION 2127
+#define SCI_GETLINEINDENTPOSITION 2128
+#define SCI_GETCOLUMN 2129
+#define SCI_COUNTCHARACTERS 2633
+#define SCI_SETHSCROLLBAR 2130
+#define SCI_GETHSCROLLBAR 2131
+#define SC_IV_NONE 0
+#define SC_IV_REAL 1
+#define SC_IV_LOOKFORWARD 2
+#define SC_IV_LOOKBOTH 3
+#define SCI_SETINDENTATIONGUIDES 2132
+#define SCI_GETINDENTATIONGUIDES 2133
+#define SCI_SETHIGHLIGHTGUIDE 2134
+#define SCI_GETHIGHLIGHTGUIDE 2135
+#define SCI_GETLINEENDPOSITION 2136
+#define SCI_GETCODEPAGE 2137
+#define SCI_GETCARETFORE 2138
+#define SCI_GETREADONLY 2140
+#define SCI_SETCURRENTPOS 2141
+#define SCI_SETSELECTIONSTART 2142
+#define SCI_GETSELECTIONSTART 2143
+#define SCI_SETSELECTIONEND 2144
+#define SCI_GETSELECTIONEND 2145
+#define SCI_SETEMPTYSELECTION 2556
+#define SCI_SETPRINTMAGNIFICATION 2146
+#define SCI_GETPRINTMAGNIFICATION 2147
+#define SC_PRINT_NORMAL 0
+#define SC_PRINT_INVERTLIGHT 1
+#define SC_PRINT_BLACKONWHITE 2
+#define SC_PRINT_COLOURONWHITE 3
+#define SC_PRINT_COLOURONWHITEDEFAULTBG 4
+#define SCI_SETPRINTCOLOURMODE 2148
+#define SCI_GETPRINTCOLOURMODE 2149
+#define SCFIND_WHOLEWORD 0x2
+#define SCFIND_MATCHCASE 0x4
+#define SCFIND_WORDSTART 0x00100000
+#define SCFIND_REGEXP 0x00200000
+#define SCFIND_POSIX 0x00400000
+#define SCFIND_CXX11REGEX 0x00800000
+#define SCI_FINDTEXT 2150
+#define SCI_FORMATRANGE 2151
+#define SCI_GETFIRSTVISIBLELINE 2152
+#define SCI_GETLINE 2153
+#define SCI_GETLINECOUNT 2154
+#define SCI_SETMARGINLEFT 2155
+#define SCI_GETMARGINLEFT 2156
+#define SCI_SETMARGINRIGHT 2157
+#define SCI_GETMARGINRIGHT 2158
+#define SCI_GETMODIFY 2159
+#define SCI_SETSEL 2160
+#define SCI_GETSELTEXT 2161
+#define SCI_GETTEXTRANGE 2162
+#define SCI_HIDESELECTION 2163
+#define SCI_POINTXFROMPOSITION 2164
+#define SCI_POINTYFROMPOSITION 2165
+#define SCI_LINEFROMPOSITION 2166
+#define SCI_POSITIONFROMLINE 2167
+#define SCI_LINESCROLL 2168
+#define SCI_SCROLLCARET 2169
+#define SCI_SCROLLRANGE 2569
+#define SCI_REPLACESEL 2170
+#define SCI_SETREADONLY 2171
+#define SCI_NULL 2172
+#define SCI_CANPASTE 2173
+#define SCI_CANUNDO 2174
+#define SCI_EMPTYUNDOBUFFER 2175
+#define SCI_UNDO 2176
+#define SCI_CUT 2177
+#define SCI_COPY 2178
+#define SCI_PASTE 2179
+#define SCI_CLEAR 2180
+#define SCI_SETTEXT 2181
+#define SCI_GETTEXT 2182
+#define SCI_GETTEXTLENGTH 2183
+#define SCI_GETDIRECTFUNCTION 2184
+#define SCI_GETDIRECTPOINTER 2185
+#define SCI_SETOVERTYPE 2186
+#define SCI_GETOVERTYPE 2187
+#define SCI_SETCARETWIDTH 2188
+#define SCI_GETCARETWIDTH 2189
+#define SCI_SETTARGETSTART 2190
+#define SCI_GETTARGETSTART 2191
+#define SCI_SETTARGETEND 2192
+#define SCI_GETTARGETEND 2193
+#define SCI_SETTARGETRANGE 2686
+#define SCI_GETTARGETTEXT 2687
+#define SCI_REPLACETARGET 2194
+#define SCI_REPLACETARGETRE 2195
+#define SCI_SEARCHINTARGET 2197
+#define SCI_SETSEARCHFLAGS 2198
+#define SCI_GETSEARCHFLAGS 2199
+#define SCI_CALLTIPSHOW 2200
+#define SCI_CALLTIPCANCEL 2201
+#define SCI_CALLTIPACTIVE 2202
+#define SCI_CALLTIPPOSSTART 2203
+#define SCI_CALLTIPSETPOSSTART 2214
+#define SCI_CALLTIPSETHLT 2204
+#define SCI_CALLTIPSETBACK 2205
+#define SCI_CALLTIPSETFORE 2206
+#define SCI_CALLTIPSETFOREHLT 2207
+#define SCI_CALLTIPUSESTYLE 2212
+#define SCI_CALLTIPSETPOSITION 2213
+#define SCI_VISIBLEFROMDOCLINE 2220
+#define SCI_DOCLINEFROMVISIBLE 2221
+#define SCI_WRAPCOUNT 2235
+#define SC_FOLDLEVELBASE 0x400
+#define SC_FOLDLEVELWHITEFLAG 0x1000
+#define SC_FOLDLEVELHEADERFLAG 0x2000
+#define SC_FOLDLEVELNUMBERMASK 0x0FFF
+#define SCI_SETFOLDLEVEL 2222
+#define SCI_GETFOLDLEVEL 2223
+#define SCI_GETLASTCHILD 2224
+#define SCI_GETFOLDPARENT 2225
+#define SCI_SHOWLINES 2226
+#define SCI_HIDELINES 2227
+#define SCI_GETLINEVISIBLE 2228
+#define SCI_GETALLLINESVISIBLE 2236
+#define SCI_SETFOLDEXPANDED 2229
+#define SCI_GETFOLDEXPANDED 2230
+#define SCI_TOGGLEFOLD 2231
+#define SC_FOLDACTION_CONTRACT 0
+#define SC_FOLDACTION_EXPAND 1
+#define SC_FOLDACTION_TOGGLE 2
+#define SCI_FOLDLINE 2237
+#define SCI_FOLDCHILDREN 2238
+#define SCI_EXPANDCHILDREN 2239
+#define SCI_FOLDALL 2662
+#define SCI_ENSUREVISIBLE 2232
+#define SC_AUTOMATICFOLD_SHOW 0x0001
+#define SC_AUTOMATICFOLD_CLICK 0x0002
+#define SC_AUTOMATICFOLD_CHANGE 0x0004
+#define SCI_SETAUTOMATICFOLD 2663
+#define SCI_GETAUTOMATICFOLD 2664
+#define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
+#define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
+#define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
+#define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
+#define SC_FOLDFLAG_LEVELNUMBERS 0x0040
+#define SC_FOLDFLAG_LINESTATE 0x0080
+#define SCI_SETFOLDFLAGS 2233
+#define SCI_ENSUREVISIBLEENFORCEPOLICY 2234
+#define SCI_SETTABINDENTS 2260
+#define SCI_GETTABINDENTS 2261
+#define SCI_SETBACKSPACEUNINDENTS 2262
+#define SCI_GETBACKSPACEUNINDENTS 2263
+#define SC_TIME_FOREVER 10000000
+#define SCI_SETMOUSEDWELLTIME 2264
+#define SCI_GETMOUSEDWELLTIME 2265
+#define SCI_WORDSTARTPOSITION 2266
+#define SCI_WORDENDPOSITION 2267
+#define SC_WRAP_NONE 0
+#define SC_WRAP_WORD 1
+#define SC_WRAP_CHAR 2
+#define SC_WRAP_WHITESPACE 3
+#define SCI_SETWRAPMODE 2268
+#define SCI_GETWRAPMODE 2269
+#define SC_WRAPVISUALFLAG_NONE 0x0000
+#define SC_WRAPVISUALFLAG_END 0x0001
+#define SC_WRAPVISUALFLAG_START 0x0002
+#define SC_WRAPVISUALFLAG_MARGIN 0x0004
+#define SCI_SETWRAPVISUALFLAGS 2460
+#define SCI_GETWRAPVISUALFLAGS 2461
+#define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
+#define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001
+#define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002
+#define SCI_SETWRAPVISUALFLAGSLOCATION 2462
+#define SCI_GETWRAPVISUALFLAGSLOCATION 2463
+#define SCI_SETWRAPSTARTINDENT 2464
+#define SCI_GETWRAPSTARTINDENT 2465
+#define SC_WRAPINDENT_FIXED 0
+#define SC_WRAPINDENT_SAME 1
+#define SC_WRAPINDENT_INDENT 2
+#define SCI_SETWRAPINDENTMODE 2472
+#define SCI_GETWRAPINDENTMODE 2473
+#define SC_CACHE_NONE 0
+#define SC_CACHE_CARET 1
+#define SC_CACHE_PAGE 2
+#define SC_CACHE_DOCUMENT 3
+#define SCI_SETLAYOUTCACHE 2272
+#define SCI_GETLAYOUTCACHE 2273
+#define SCI_SETSCROLLWIDTH 2274
+#define SCI_GETSCROLLWIDTH 2275
+#define SCI_SETSCROLLWIDTHTRACKING 2516
+#define SCI_GETSCROLLWIDTHTRACKING 2517
+#define SCI_TEXTWIDTH 2276
+#define SCI_SETENDATLASTLINE 2277
+#define SCI_GETENDATLASTLINE 2278
+#define SCI_TEXTHEIGHT 2279
+#define SCI_SETVSCROLLBAR 2280
+#define SCI_GETVSCROLLBAR 2281
+#define SCI_APPENDTEXT 2282
+#define SCI_GETTWOPHASEDRAW 2283
+#define SCI_SETTWOPHASEDRAW 2284
+#define SC_PHASES_ONE 0
+#define SC_PHASES_TWO 1
+#define SC_PHASES_MULTIPLE 2
+#define SCI_GETPHASESDRAW 2673
+#define SCI_SETPHASESDRAW 2674
+#define SC_EFF_QUALITY_MASK 0xF
+#define SC_EFF_QUALITY_DEFAULT 0
+#define SC_EFF_QUALITY_NON_ANTIALIASED 1
+#define SC_EFF_QUALITY_ANTIALIASED 2
+#define SC_EFF_QUALITY_LCD_OPTIMIZED 3
+#define SCI_SETFONTQUALITY 2611
+#define SCI_GETFONTQUALITY 2612
+#define SCI_SETFIRSTVISIBLELINE 2613
+#define SC_MULTIPASTE_ONCE 0
+#define SC_MULTIPASTE_EACH 1
+#define SCI_SETMULTIPASTE 2614
+#define SCI_GETMULTIPASTE 2615
+#define SCI_GETTAG 2616
+#define SCI_TARGETFROMSELECTION 2287
+#define SCI_LINESJOIN 2288
+#define SCI_LINESSPLIT 2289
+#define SCI_SETFOLDMARGINCOLOUR 2290
+#define SCI_SETFOLDMARGINHICOLOUR 2291
+#define SCI_LINEDOWN 2300
+#define SCI_LINEDOWNEXTEND 2301
+#define SCI_LINEUP 2302
+#define SCI_LINEUPEXTEND 2303
+#define SCI_CHARLEFT 2304
+#define SCI_CHARLEFTEXTEND 2305
+#define SCI_CHARRIGHT 2306
+#define SCI_CHARRIGHTEXTEND 2307
+#define SCI_WORDLEFT 2308
+#define SCI_WORDLEFTEXTEND 2309
+#define SCI_WORDRIGHT 2310
+#define SCI_WORDRIGHTEXTEND 2311
+#define SCI_HOME 2312
+#define SCI_HOMEEXTEND 2313
+#define SCI_LINEEND 2314
+#define SCI_LINEENDEXTEND 2315
+#define SCI_DOCUMENTSTART 2316
+#define SCI_DOCUMENTSTARTEXTEND 2317
+#define SCI_DOCUMENTEND 2318
+#define SCI_DOCUMENTENDEXTEND 2319
+#define SCI_PAGEUP 2320
+#define SCI_PAGEUPEXTEND 2321
+#define SCI_PAGEDOWN 2322
+#define SCI_PAGEDOWNEXTEND 2323
+#define SCI_EDITTOGGLEOVERTYPE 2324
+#define SCI_CANCEL 2325
+#define SCI_DELETEBACK 2326
+#define SCI_TAB 2327
+#define SCI_BACKTAB 2328
+#define SCI_NEWLINE 2329
+#define SCI_FORMFEED 2330
+#define SCI_VCHOME 2331
+#define SCI_VCHOMEEXTEND 2332
+#define SCI_ZOOMIN 2333
+#define SCI_ZOOMOUT 2334
+#define SCI_DELWORDLEFT 2335
+#define SCI_DELWORDRIGHT 2336
+#define SCI_DELWORDRIGHTEND 2518
+#define SCI_LINECUT 2337
+#define SCI_LINEDELETE 2338
+#define SCI_LINETRANSPOSE 2339
+#define SCI_LINEDUPLICATE 2404
+#define SCI_LOWERCASE 2340
+#define SCI_UPPERCASE 2341
+#define SCI_LINESCROLLDOWN 2342
+#define SCI_LINESCROLLUP 2343
+#define SCI_DELETEBACKNOTLINE 2344
+#define SCI_HOMEDISPLAY 2345
+#define SCI_HOMEDISPLAYEXTEND 2346
+#define SCI_LINEENDDISPLAY 2347
+#define SCI_LINEENDDISPLAYEXTEND 2348
+#define SCI_HOMEWRAP 2349
+#define SCI_HOMEWRAPEXTEND 2450
+#define SCI_LINEENDWRAP 2451
+#define SCI_LINEENDWRAPEXTEND 2452
+#define SCI_VCHOMEWRAP 2453
+#define SCI_VCHOMEWRAPEXTEND 2454
+#define SCI_LINECOPY 2455
+#define SCI_MOVECARETINSIDEVIEW 2401
+#define SCI_LINELENGTH 2350
+#define SCI_BRACEHIGHLIGHT 2351
+#define SCI_BRACEHIGHLIGHTINDICATOR 2498
+#define SCI_BRACEBADLIGHT 2352
+#define SCI_BRACEBADLIGHTINDICATOR 2499
+#define SCI_BRACEMATCH 2353
+#define SCI_GETVIEWEOL 2355
+#define SCI_SETVIEWEOL 2356
+#define SCI_GETDOCPOINTER 2357
+#define SCI_SETDOCPOINTER 2358
+#define SCI_SETMODEVENTMASK 2359
+#define EDGE_NONE 0
+#define EDGE_LINE 1
+#define EDGE_BACKGROUND 2
+#define SCI_GETEDGECOLUMN 2360
+#define SCI_SETEDGECOLUMN 2361
+#define SCI_GETEDGEMODE 2362
+#define SCI_SETEDGEMODE 2363
+#define SCI_GETEDGECOLOUR 2364
+#define SCI_SETEDGECOLOUR 2365
+#define SCI_SEARCHANCHOR 2366
+#define SCI_SEARCHNEXT 2367
+#define SCI_SEARCHPREV 2368
+#define SCI_LINESONSCREEN 2370
+#define SCI_USEPOPUP 2371
+#define SCI_SELECTIONISRECTANGLE 2372
+#define SCI_SETZOOM 2373
+#define SCI_GETZOOM 2374
+#define SCI_CREATEDOCUMENT 2375
+#define SCI_ADDREFDOCUMENT 2376
+#define SCI_RELEASEDOCUMENT 2377
+#define SCI_GETMODEVENTMASK 2378
+#define SCI_SETFOCUS 2380
+#define SCI_GETFOCUS 2381
+#define SC_STATUS_OK 0
+#define SC_STATUS_FAILURE 1
+#define SC_STATUS_BADALLOC 2
+#define SC_STATUS_WARN_START 1000
+#define SC_STATUS_WARN_REGEX 1001
+#define SCI_SETSTATUS 2382
+#define SCI_GETSTATUS 2383
+#define SCI_SETMOUSEDOWNCAPTURES 2384
+#define SCI_GETMOUSEDOWNCAPTURES 2385
+#define SC_CURSORNORMAL -1
+#define SC_CURSORARROW 2
+#define SC_CURSORWAIT 4
+#define SC_CURSORREVERSEARROW 7
+#define SCI_SETCURSOR 2386
+#define SCI_GETCURSOR 2387
+#define SCI_SETCONTROLCHARSYMBOL 2388
+#define SCI_GETCONTROLCHARSYMBOL 2389
+#define SCI_WORDPARTLEFT 2390
+#define SCI_WORDPARTLEFTEXTEND 2391
+#define SCI_WORDPARTRIGHT 2392
+#define SCI_WORDPARTRIGHTEXTEND 2393
+#define VISIBLE_SLOP 0x01
+#define VISIBLE_STRICT 0x04
+#define SCI_SETVISIBLEPOLICY 2394
+#define SCI_DELLINELEFT 2395
+#define SCI_DELLINERIGHT 2396
+#define SCI_SETXOFFSET 2397
+#define SCI_GETXOFFSET 2398
+#define SCI_CHOOSECARETX 2399
+#define SCI_GRABFOCUS 2400
+#define CARET_SLOP 0x01
+#define CARET_STRICT 0x04
+#define CARET_JUMPS 0x10
+#define CARET_EVEN 0x08
+#define SCI_SETXCARETPOLICY 2402
+#define SCI_SETYCARETPOLICY 2403
+#define SCI_SETPRINTWRAPMODE 2406
+#define SCI_GETPRINTWRAPMODE 2407
+#define SCI_SETHOTSPOTACTIVEFORE 2410
+#define SCI_GETHOTSPOTACTIVEFORE 2494
+#define SCI_SETHOTSPOTACTIVEBACK 2411
+#define SCI_GETHOTSPOTACTIVEBACK 2495
+#define SCI_SETHOTSPOTACTIVEUNDERLINE 2412
+#define SCI_GETHOTSPOTACTIVEUNDERLINE 2496
+#define SCI_SETHOTSPOTSINGLELINE 2421
+#define SCI_GETHOTSPOTSINGLELINE 2497
+#define SCI_PARADOWN 2413
+#define SCI_PARADOWNEXTEND 2414
+#define SCI_PARAUP 2415
+#define SCI_PARAUPEXTEND 2416
+#define SCI_POSITIONBEFORE 2417
+#define SCI_POSITIONAFTER 2418
+#define SCI_POSITIONRELATIVE 2670
+#define SCI_COPYRANGE 2419
+#define SCI_COPYTEXT 2420
+#define SC_SEL_STREAM 0
+#define SC_SEL_RECTANGLE 1
+#define SC_SEL_LINES 2
+#define SC_SEL_THIN 3
+#define SCI_SETSELECTIONMODE 2422
+#define SCI_GETSELECTIONMODE 2423
+#define SCI_GETLINESELSTARTPOSITION 2424
+#define SCI_GETLINESELENDPOSITION 2425
+#define SCI_LINEDOWNRECTEXTEND 2426
+#define SCI_LINEUPRECTEXTEND 2427
+#define SCI_CHARLEFTRECTEXTEND 2428
+#define SCI_CHARRIGHTRECTEXTEND 2429
+#define SCI_HOMERECTEXTEND 2430
+#define SCI_VCHOMERECTEXTEND 2431
+#define SCI_LINEENDRECTEXTEND 2432
+#define SCI_PAGEUPRECTEXTEND 2433
+#define SCI_PAGEDOWNRECTEXTEND 2434
+#define SCI_STUTTEREDPAGEUP 2435
+#define SCI_STUTTEREDPAGEUPEXTEND 2436
+#define SCI_STUTTEREDPAGEDOWN 2437
+#define SCI_STUTTEREDPAGEDOWNEXTEND 2438
+#define SCI_WORDLEFTEND 2439
+#define SCI_WORDLEFTENDEXTEND 2440
+#define SCI_WORDRIGHTEND 2441
+#define SCI_WORDRIGHTENDEXTEND 2442
+#define SCI_SETWHITESPACECHARS 2443
+#define SCI_GETWHITESPACECHARS 2647
+#define SCI_SETPUNCTUATIONCHARS 2648
+#define SCI_GETPUNCTUATIONCHARS 2649
+#define SCI_SETCHARSDEFAULT 2444
+#define SCI_AUTOCGETCURRENT 2445
+#define SCI_AUTOCGETCURRENTTEXT 2610
+#define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
+#define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
+#define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634
+#define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635
+#define SC_MULTIAUTOC_ONCE 0
+#define SC_MULTIAUTOC_EACH 1
+#define SCI_AUTOCSETMULTI 2636
+#define SCI_AUTOCGETMULTI 2637
+#define SC_ORDER_PRESORTED 0
+#define SC_ORDER_PERFORMSORT 1
+#define SC_ORDER_CUSTOM 2
+#define SCI_AUTOCSETORDER 2660
+#define SCI_AUTOCGETORDER 2661
+#define SCI_ALLOCATE 2446
+#define SCI_TARGETASUTF8 2447
+#define SCI_SETLENGTHFORENCODE 2448
+#define SCI_ENCODEDFROMUTF8 2449
+#define SCI_FINDCOLUMN 2456
+#define SCI_GETCARETSTICKY 2457
+#define SCI_SETCARETSTICKY 2458
+#define SC_CARETSTICKY_OFF 0
+#define SC_CARETSTICKY_ON 1
+#define SC_CARETSTICKY_WHITESPACE 2
+#define SCI_TOGGLECARETSTICKY 2459
+#define SCI_SETPASTECONVERTENDINGS 2467
+#define SCI_GETPASTECONVERTENDINGS 2468
+#define SCI_SELECTIONDUPLICATE 2469
+#define SC_ALPHA_TRANSPARENT 0
+#define SC_ALPHA_OPAQUE 255
+#define SC_ALPHA_NOALPHA 256
+#define SCI_SETCARETLINEBACKALPHA 2470
+#define SCI_GETCARETLINEBACKALPHA 2471
+#define CARETSTYLE_INVISIBLE 0
+#define CARETSTYLE_LINE 1
+#define CARETSTYLE_BLOCK 2
+#define SCI_SETCARETSTYLE 2512
+#define SCI_GETCARETSTYLE 2513
+#define SCI_SETINDICATORCURRENT 2500
+#define SCI_GETINDICATORCURRENT 2501
+#define SCI_SETINDICATORVALUE 2502
+#define SCI_GETINDICATORVALUE 2503
+#define SCI_INDICATORFILLRANGE 2504
+#define SCI_INDICATORCLEARRANGE 2505
+#define SCI_INDICATORALLONFOR 2506
+#define SCI_INDICATORVALUEAT 2507
+#define SCI_INDICATORSTART 2508
+#define SCI_INDICATOREND 2509
+#define SCI_SETPOSITIONCACHE 2514
+#define SCI_GETPOSITIONCACHE 2515
+#define SCI_COPYALLOWLINE 2519
+#define SCI_GETCHARACTERPOINTER 2520
+#define SCI_GETRANGEPOINTER 2643
+#define SCI_GETGAPPOSITION 2644
+#define SCI_INDICSETALPHA 2523
+#define SCI_INDICGETALPHA 2524
+#define SCI_INDICSETOUTLINEALPHA 2558
+#define SCI_INDICGETOUTLINEALPHA 2559
+#define SCI_SETEXTRAASCENT 2525
+#define SCI_GETEXTRAASCENT 2526
+#define SCI_SETEXTRADESCENT 2527
+#define SCI_GETEXTRADESCENT 2528
+#define SCI_MARKERSYMBOLDEFINED 2529
+#define SCI_MARGINSETTEXT 2530
+#define SCI_MARGINGETTEXT 2531
+#define SCI_MARGINSETSTYLE 2532
+#define SCI_MARGINGETSTYLE 2533
+#define SCI_MARGINSETSTYLES 2534
+#define SCI_MARGINGETSTYLES 2535
+#define SCI_MARGINTEXTCLEARALL 2536
+#define SCI_MARGINSETSTYLEOFFSET 2537
+#define SCI_MARGINGETSTYLEOFFSET 2538
+#define SC_MARGINOPTION_NONE 0
+#define SC_MARGINOPTION_SUBLINESELECT 1
+#define SCI_SETMARGINOPTIONS 2539
+#define SCI_GETMARGINOPTIONS 2557
+#define SCI_ANNOTATIONSETTEXT 2540
+#define SCI_ANNOTATIONGETTEXT 2541
+#define SCI_ANNOTATIONSETSTYLE 2542
+#define SCI_ANNOTATIONGETSTYLE 2543
+#define SCI_ANNOTATIONSETSTYLES 2544
+#define SCI_ANNOTATIONGETSTYLES 2545
+#define SCI_ANNOTATIONGETLINES 2546
+#define SCI_ANNOTATIONCLEARALL 2547
+#define ANNOTATION_HIDDEN 0
+#define ANNOTATION_STANDARD 1
+#define ANNOTATION_BOXED 2
+#define ANNOTATION_INDENTED 3
+#define SCI_ANNOTATIONSETVISIBLE 2548
+#define SCI_ANNOTATIONGETVISIBLE 2549
+#define SCI_ANNOTATIONSETSTYLEOFFSET 2550
+#define SCI_ANNOTATIONGETSTYLEOFFSET 2551
+#define SCI_RELEASEALLEXTENDEDSTYLES 2552
+#define SCI_ALLOCATEEXTENDEDSTYLES 2553
+#define UNDO_MAY_COALESCE 1
+#define SCI_ADDUNDOACTION 2560
+#define SCI_CHARPOSITIONFROMPOINT 2561
+#define SCI_CHARPOSITIONFROMPOINTCLOSE 2562
+#define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668
+#define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669
+#define SCI_SETMULTIPLESELECTION 2563
+#define SCI_GETMULTIPLESELECTION 2564
+#define SCI_SETADDITIONALSELECTIONTYPING 2565
+#define SCI_GETADDITIONALSELECTIONTYPING 2566
+#define SCI_SETADDITIONALCARETSBLINK 2567
+#define SCI_GETADDITIONALCARETSBLINK 2568
+#define SCI_SETADDITIONALCARETSVISIBLE 2608
+#define SCI_GETADDITIONALCARETSVISIBLE 2609
+#define SCI_GETSELECTIONS 2570
+#define SCI_GETSELECTIONEMPTY 2650
+#define SCI_CLEARSELECTIONS 2571
+#define SCI_SETSELECTION 2572
+#define SCI_ADDSELECTION 2573
+#define SCI_DROPSELECTIONN 2671
+#define SCI_SETMAINSELECTION 2574
+#define SCI_GETMAINSELECTION 2575
+#define SCI_SETSELECTIONNCARET 2576
+#define SCI_GETSELECTIONNCARET 2577
+#define SCI_SETSELECTIONNANCHOR 2578
+#define SCI_GETSELECTIONNANCHOR 2579
+#define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580
+#define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581
+#define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582
+#define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583
+#define SCI_SETSELECTIONNSTART 2584
+#define SCI_GETSELECTIONNSTART 2585
+#define SCI_SETSELECTIONNEND 2586
+#define SCI_GETSELECTIONNEND 2587
+#define SCI_SETRECTANGULARSELECTIONCARET 2588
+#define SCI_GETRECTANGULARSELECTIONCARET 2589
+#define SCI_SETRECTANGULARSELECTIONANCHOR 2590
+#define SCI_GETRECTANGULARSELECTIONANCHOR 2591
+#define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592
+#define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593
+#define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594
+#define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595
+#define SCVS_NONE 0
+#define SCVS_RECTANGULARSELECTION 1
+#define SCVS_USERACCESSIBLE 2
+#define SCI_SETVIRTUALSPACEOPTIONS 2596
+#define SCI_GETVIRTUALSPACEOPTIONS 2597
+#define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
+#define SCI_GETRECTANGULARSELECTIONMODIFIER 2599
+#define SCI_SETADDITIONALSELFORE 2600
+#define SCI_SETADDITIONALSELBACK 2601
+#define SCI_SETADDITIONALSELALPHA 2602
+#define SCI_GETADDITIONALSELALPHA 2603
+#define SCI_SETADDITIONALCARETFORE 2604
+#define SCI_GETADDITIONALCARETFORE 2605
+#define SCI_ROTATESELECTION 2606
+#define SCI_SWAPMAINANCHORCARET 2607
+#define SCI_CHANGELEXERSTATE 2617
+#define SCI_CONTRACTEDFOLDNEXT 2618
+#define SCI_VERTICALCENTRECARET 2619
+#define SCI_MOVESELECTEDLINESUP 2620
+#define SCI_MOVESELECTEDLINESDOWN 2621
+#define SCI_SETIDENTIFIER 2622
+#define SCI_GETIDENTIFIER 2623
+#define SCI_RGBAIMAGESETWIDTH 2624
+#define SCI_RGBAIMAGESETHEIGHT 2625
+#define SCI_RGBAIMAGESETSCALE 2651
+#define SCI_MARKERDEFINERGBAIMAGE 2626
+#define SCI_REGISTERRGBAIMAGE 2627
+#define SCI_SCROLLTOSTART 2628
+#define SCI_SCROLLTOEND 2629
+#define SC_TECHNOLOGY_DEFAULT 0
+#define SC_TECHNOLOGY_DIRECTWRITE 1
+#define SC_TECHNOLOGY_DIRECTWRITERETAIN 2
+#define SC_TECHNOLOGY_DIRECTWRITEDC 3
+#define SCI_SETTECHNOLOGY 2630
+#define SCI_GETTECHNOLOGY 2631
+#define SCI_CREATELOADER 2632
+#define SCI_FINDINDICATORSHOW 2640
+#define SCI_FINDINDICATORFLASH 2641
+#define SCI_FINDINDICATORHIDE 2642
+#define SCI_VCHOMEDISPLAY 2652
+#define SCI_VCHOMEDISPLAYEXTEND 2653
+#define SCI_GETCARETLINEVISIBLEALWAYS 2654
+#define SCI_SETCARETLINEVISIBLEALWAYS 2655
+#define SC_LINE_END_TYPE_DEFAULT 0
+#define SC_LINE_END_TYPE_UNICODE 1
+#define SCI_SETLINEENDTYPESALLOWED 2656
+#define SCI_GETLINEENDTYPESALLOWED 2657
+#define SCI_GETLINEENDTYPESACTIVE 2658
+#define SCI_SETREPRESENTATION 2665
+#define SCI_GETREPRESENTATION 2666
+#define SCI_CLEARREPRESENTATION 2667
+#define SCI_STARTRECORD 3001
+#define SCI_STOPRECORD 3002
+#define SCI_SETLEXER 4001
+#define SCI_GETLEXER 4002
+#define SCI_COLOURISE 4003
+#define SCI_SETPROPERTY 4004
+#define KEYWORDSET_MAX 8
+#define SCI_SETKEYWORDS 4005
+#define SCI_SETLEXERLANGUAGE 4006
+#define SCI_LOADLEXERLIBRARY 4007
+#define SCI_GETPROPERTY 4008
+#define SCI_GETPROPERTYEXPANDED 4009
+#define SCI_GETPROPERTYINT 4010
+#define SCI_GETSTYLEBITSNEEDED 4011
+#define SCI_GETLEXERLANGUAGE 4012
+#define SCI_PRIVATELEXERCALL 4013
+#define SCI_PROPERTYNAMES 4014
+#define SC_TYPE_BOOLEAN 0
+#define SC_TYPE_INTEGER 1
+#define SC_TYPE_STRING 2
+#define SCI_PROPERTYTYPE 4015
+#define SCI_DESCRIBEPROPERTY 4016
+#define SCI_DESCRIBEKEYWORDSETS 4017
+#define SCI_GETLINEENDTYPESSUPPORTED 4018
+#define SCI_ALLOCATESUBSTYLES 4020
+#define SCI_GETSUBSTYLESSTART 4021
+#define SCI_GETSUBSTYLESLENGTH 4022
+#define SCI_GETSTYLEFROMSUBSTYLE 4027
+#define SCI_GETPRIMARYSTYLEFROMSTYLE 4028
+#define SCI_FREESUBSTYLES 4023
+#define SCI_SETIDENTIFIERS 4024
+#define SCI_DISTANCETOSECONDARYSTYLES 4025
+#define SCI_GETSUBSTYLEBASES 4026
+#define SC_MOD_INSERTTEXT 0x1
+#define SC_MOD_DELETETEXT 0x2
+#define SC_MOD_CHANGESTYLE 0x4
+#define SC_MOD_CHANGEFOLD 0x8
+#define SC_PERFORMED_USER 0x10
+#define SC_PERFORMED_UNDO 0x20
+#define SC_PERFORMED_REDO 0x40
+#define SC_MULTISTEPUNDOREDO 0x80
+#define SC_LASTSTEPINUNDOREDO 0x100
+#define SC_MOD_CHANGEMARKER 0x200
+#define SC_MOD_BEFOREINSERT 0x400
+#define SC_MOD_BEFOREDELETE 0x800
+#define SC_MULTILINEUNDOREDO 0x1000
+#define SC_STARTACTION 0x2000
+#define SC_MOD_CHANGEINDICATOR 0x4000
+#define SC_MOD_CHANGELINESTATE 0x8000
+#define SC_MOD_CHANGEMARGIN 0x10000
+#define SC_MOD_CHANGEANNOTATION 0x20000
+#define SC_MOD_CONTAINER 0x40000
+#define SC_MOD_LEXERSTATE 0x80000
+#define SC_MOD_INSERTCHECK 0x100000
+#define SC_MOD_CHANGETABSTOPS 0x200000
+#define SC_MODEVENTMASKALL 0x3FFFFF
+#define SC_UPDATE_CONTENT 0x1
+#define SC_UPDATE_SELECTION 0x2
+#define SC_UPDATE_V_SCROLL 0x4
+#define SC_UPDATE_H_SCROLL 0x8
+#define SCEN_CHANGE 768
+#define SCEN_SETFOCUS 512
+#define SCEN_KILLFOCUS 256
+#define SCK_DOWN 300
+#define SCK_UP 301
+#define SCK_LEFT 302
+#define SCK_RIGHT 303
+#define SCK_HOME 304
+#define SCK_END 305
+#define SCK_PRIOR 306
+#define SCK_NEXT 307
+#define SCK_DELETE 308
+#define SCK_INSERT 309
+#define SCK_ESCAPE 7
+#define SCK_BACK 8
+#define SCK_TAB 9
+#define SCK_RETURN 13
+#define SCK_ADD 310
+#define SCK_SUBTRACT 311
+#define SCK_DIVIDE 312
+#define SCK_WIN 313
+#define SCK_RWIN 314
+#define SCK_MENU 315
+#define SCMOD_NORM 0
+#define SCMOD_SHIFT 1
+#define SCMOD_CTRL 2
+#define SCMOD_ALT 4
+#define SCMOD_SUPER 8
+#define SCMOD_META 16
+#define SCN_STYLENEEDED 2000
+#define SCN_CHARADDED 2001
+#define SCN_SAVEPOINTREACHED 2002
+#define SCN_SAVEPOINTLEFT 2003
+#define SCN_MODIFYATTEMPTRO 2004
+#define SCN_KEY 2005
+#define SCN_DOUBLECLICK 2006
+#define SCN_UPDATEUI 2007
+#define SCN_MODIFIED 2008
+#define SCN_MACRORECORD 2009
+#define SCN_MARGINCLICK 2010
+#define SCN_NEEDSHOWN 2011
+#define SCN_PAINTED 2013
+#define SCN_USERLISTSELECTION 2014
+#define SCN_URIDROPPED 2015
+#define SCN_DWELLSTART 2016
+#define SCN_DWELLEND 2017
+#define SCN_ZOOM 2018
+#define SCN_HOTSPOTCLICK 2019
+#define SCN_HOTSPOTDOUBLECLICK 2020
+#define SCN_CALLTIPCLICK 2021
+#define SCN_AUTOCSELECTION 2022
+#define SCN_INDICATORCLICK 2023
+#define SCN_INDICATORRELEASE 2024
+#define SCN_AUTOCCANCELLED 2025
+#define SCN_AUTOCCHARDELETED 2026
+#define SCN_HOTSPOTRELEASECLICK 2027
+#define SCN_FOCUSIN 2028
+#define SCN_FOCUSOUT 2029
+/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
+
+/* These structures are defined to be exactly the same shape as the Win32
+ * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
+ * So older code that treats Scintilla as a RichEdit will work. */
+
+#if defined(__cplusplus) && defined(SCI_NAMESPACE)
+namespace Scintilla {
+#endif
+
+struct Sci_CharacterRange {
+ long cpMin;
+ long cpMax;
+};
+
+struct Sci_TextRange {
+ struct Sci_CharacterRange chrg;
+ char *lpstrText;
+};
+
+struct Sci_TextToFind {
+ struct Sci_CharacterRange chrg;
+ const char *lpstrText;
+ struct Sci_CharacterRange chrgText;
+};
+
+#define CharacterRange Sci_CharacterRange
+#define TextRange Sci_TextRange
+#define TextToFind Sci_TextToFind
+
+typedef void *Sci_SurfaceID;
+
+struct Sci_Rectangle {
+ int left;
+ int top;
+ int right;
+ int bottom;
+};
+
+/* This structure is used in printing and requires some of the graphics types
+ * from Platform.h. Not needed by most client code. */
+
+struct Sci_RangeToFormat {
+ Sci_SurfaceID hdc;
+ Sci_SurfaceID hdcTarget;
+ struct Sci_Rectangle rc;
+ struct Sci_Rectangle rcPage;
+ struct Sci_CharacterRange chrg;
+};
+
+#define RangeToFormat Sci_RangeToFormat
+
+struct Sci_NotifyHeader {
+ /* Compatible with Windows NMHDR.
+ * hwndFrom is really an environment specific window handle or pointer
+ * but most clients of Scintilla.h do not have this type visible. */
+ void *hwndFrom;
+ uptr_t idFrom;
+ unsigned int code;
+};
+
+#define NotifyHeader Sci_NotifyHeader
+
+struct SCNotification {
+ struct Sci_NotifyHeader nmhdr;
+ int position;
+ /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
+ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
+ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
+ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+
+ int ch; /* SCN_CHARADDED, SCN_KEY */
+ int modifiers;
+ /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
+ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+
+ int modificationType; /* SCN_MODIFIED */
+ const char *text;
+ /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
+
+ int length; /* SCN_MODIFIED */
+ int linesAdded; /* SCN_MODIFIED */
+ int message; /* SCN_MACRORECORD */
+ uptr_t wParam; /* SCN_MACRORECORD */
+ sptr_t lParam; /* SCN_MACRORECORD */
+ int line; /* SCN_MODIFIED */
+ int foldLevelNow; /* SCN_MODIFIED */
+ int foldLevelPrev; /* SCN_MODIFIED */
+ int margin; /* SCN_MARGINCLICK */
+ int listType; /* SCN_USERLISTSELECTION */
+ int x; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int y; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
+ int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
+ int updated; /* SCN_UPDATEUI */
+};
+
+#if defined(__cplusplus) && defined(SCI_NAMESPACE)
+}
+#endif
+
+#ifdef INCLUDE_DEPRECATED_FEATURES
+
+#define SC_CP_DBCS 1
+#define SCI_SETUSEPALETTE 2039
+#define SCI_GETUSEPALETTE 2139
+#define SCI_SETKEYSUNICODE 2521
+#define SCI_GETKEYSUNICODE 2522
+
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.iface b/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.iface
new file mode 100644
index 00000000000..6432d37aa85
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/Scintilla.iface
@@ -0,0 +1,4678 @@
+## First line may be used for shbang
+
+## This file defines the interface to Scintilla
+
+## Copyright 2000-2003 by Neil Hodgson <neilh@scintilla.org>
+## The License.txt file describes the conditions under which this software may be distributed.
+
+## A line starting with ## is a pure comment and should be stripped by readers.
+## A line starting with #! is for future shbang use
+## A line starting with # followed by a space is a documentation comment and refers
+## to the next feature definition.
+
+## Each feature is defined by a line starting with fun, get, set, val or evt.
+## cat -> start a category
+## fun -> a function
+## get -> a property get function
+## set -> a property set function
+## val -> definition of a constant
+## evt -> an event
+## enu -> associate an enumeration with a set of vals with a prefix
+## lex -> associate a lexer with the lexical classes it produces
+##
+## All other feature names should be ignored. They may be defined in the future.
+## A property may have a set function, a get function or both. Each will have
+## "Get" or "Set" in their names and the corresponding name will have the obvious switch.
+## A property may be subscripted, in which case the first parameter is the subscript.
+## fun, get, and set features have a strict syntax:
+## <featureType><ws><returnType><ws><name>[=<number](<param>,<param>)
+## where <ws> stands for white space.
+## param may be empty (null value) or is <paramType><ws><paramName>[=<value>]
+## Additional white space is allowed between elements.
+## The syntax for evt is <featureType><ws><returnType><ws><name>[=<number]([<param>[,<param>]*])
+## Feature names that contain an underscore are defined by Windows, so in these
+## cases, using the Windows definition is preferred where available.
+## The feature numbers are stable so features will not be renumbered.
+## Features may be removed but they will go through a period of deprecation
+## before removal which is signalled by moving them into the Deprecated category.
+##
+## enu has the syntax enu<ws><enumeration>=<prefix>[<ws><prefix>]* where all the val
+## features in this file starting with a given <prefix> are considered part of the
+## enumeration.
+##
+## lex has the syntax lex<ws><name>=<lexerVal><ws><prefix>[<ws><prefix>]*
+## where name is a reasonably capitalised (Python, XML) identifier or UI name,
+## lexerVal is the val used to specify the lexer, and the list of prefixes is similar
+## to enu. The name may not be the same as that used within the lexer so the lexerVal
+## should be used to tie these entities together.
+
+## Types:
+## void
+## int
+## bool -> integer, 1=true, 0=false
+## position -> integer position in a document
+## colour -> colour integer containing red, green and blue bytes.
+## string -> pointer to const character
+## stringresult -> pointer to character, NULL-> return size of result
+## cells -> pointer to array of cells, each cell containing a style byte and character byte
+## textrange -> range of a min and a max position with an output string
+## findtext -> searchrange, text -> foundposition
+## keymod -> integer containing key in low half and modifiers in high half
+## formatrange
+## Types no longer used:
+## findtextex -> searchrange
+## charrange -> range of a min and a max position
+## charrangeresult -> like charrange, but output param
+## countedstring
+## point -> x,y
+## pointresult -> like point, but output param
+## rectangle -> left,top,right,bottom
+## Client code should ignore definitions containing types it does not understand, except
+## for possibly #defining the constants
+
+## Line numbers and positions start at 0.
+## String arguments may contain NUL ('\0') characters where the calls provide a length
+## argument and retrieve NUL characters. APIs marked as NUL-terminated also have a
+## NUL appended but client code should calculate the size that will be returned rather
+## than relying upon the NUL whenever possible. Allow for the extra NUL character when
+## allocating buffers. The size to allocate for a stringresult (not including NUL) can be
+## determined by calling with a NULL (0) pointer.
+
+cat Basics
+
+################################################
+## For Scintilla.h
+val INVALID_POSITION=-1
+# Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages
+# as many EM_ messages can be used although that use is deprecated.
+val SCI_START=2000
+val SCI_OPTIONAL_START=3000
+val SCI_LEXER_START=4000
+
+# Add text to the document at current position.
+fun void AddText=2001(int length, string text)
+
+# Add array of cells to document.
+fun void AddStyledText=2002(int length, cells c)
+
+# Insert string at a position.
+fun void InsertText=2003(position pos, string text)
+
+# Change the text that is being inserted in response to SC_MOD_INSERTCHECK
+fun void ChangeInsertion=2672(int length, string text)
+
+# Delete all text in the document.
+fun void ClearAll=2004(,)
+
+# Delete a range of text in the document.
+fun void DeleteRange=2645(position pos, int deleteLength)
+
+# Set all style bytes to 0, remove all folding information.
+fun void ClearDocumentStyle=2005(,)
+
+# Returns the number of bytes in the document.
+get int GetLength=2006(,)
+
+# Returns the character byte at the position.
+get int GetCharAt=2007(position pos,)
+
+# Returns the position of the caret.
+get position GetCurrentPos=2008(,)
+
+# Returns the position of the opposite end of the selection to the caret.
+get position GetAnchor=2009(,)
+
+# Returns the style byte at the position.
+get int GetStyleAt=2010(position pos,)
+
+# Redoes the next action on the undo history.
+fun void Redo=2011(,)
+
+# Choose between collecting actions into the undo
+# history and discarding them.
+set void SetUndoCollection=2012(bool collectUndo,)
+
+# Select all the text in the document.
+fun void SelectAll=2013(,)
+
+# Remember the current position in the undo history as the position
+# at which the document was saved.
+fun void SetSavePoint=2014(,)
+
+# Retrieve a buffer of cells.
+# Returns the number of bytes in the buffer not including terminating NULs.
+fun int GetStyledText=2015(, textrange tr)
+
+# Are there any redoable actions in the undo history?
+fun bool CanRedo=2016(,)
+
+# Retrieve the line number at which a particular marker is located.
+fun int MarkerLineFromHandle=2017(int handle,)
+
+# Delete a marker.
+fun void MarkerDeleteHandle=2018(int handle,)
+
+# Is undo history being collected?
+get bool GetUndoCollection=2019(,)
+
+enu WhiteSpace=SCWS_
+val SCWS_INVISIBLE=0
+val SCWS_VISIBLEALWAYS=1
+val SCWS_VISIBLEAFTERINDENT=2
+
+# Are white space characters currently visible?
+# Returns one of SCWS_* constants.
+get int GetViewWS=2020(,)
+
+# Make white space characters invisible, always visible or visible outside indentation.
+set void SetViewWS=2021(int viewWS,)
+
+# Find the position from a point within the window.
+fun position PositionFromPoint=2022(int x, int y)
+
+# Find the position from a point within the window but return
+# INVALID_POSITION if not close to text.
+fun position PositionFromPointClose=2023(int x, int y)
+
+# Set caret to start of a line and ensure it is visible.
+fun void GotoLine=2024(int line,)
+
+# Set caret to a position and ensure it is visible.
+fun void GotoPos=2025(position pos,)
+
+# Set the selection anchor to a position. The anchor is the opposite
+# end of the selection from the caret.
+set void SetAnchor=2026(position posAnchor,)
+
+# Retrieve the text of the line containing the caret.
+# Returns the index of the caret on the line.
+# Result is NUL-terminated.
+fun int GetCurLine=2027(int length, stringresult text)
+
+# Retrieve the position of the last correctly styled character.
+get position GetEndStyled=2028(,)
+
+enu EndOfLine=SC_EOL_
+val SC_EOL_CRLF=0
+val SC_EOL_CR=1
+val SC_EOL_LF=2
+
+# Convert all line endings in the document to one mode.
+fun void ConvertEOLs=2029(int eolMode,)
+
+# Retrieve the current end of line mode - one of CRLF, CR, or LF.
+get int GetEOLMode=2030(,)
+
+# Set the current end of line mode.
+set void SetEOLMode=2031(int eolMode,)
+
+# Set the current styling position to pos and the styling mask to mask.
+# The styling mask can be used to protect some bits in each styling byte from modification.
+fun void StartStyling=2032(position pos, int mask)
+
+# Change style from current styling position for length characters to a style
+# and move the current styling position to after this newly styled segment.
+fun void SetStyling=2033(int length, int style)
+
+# Is drawing done first into a buffer or direct to the screen?
+get bool GetBufferedDraw=2034(,)
+
+# If drawing is buffered then each line of text is drawn into a bitmap buffer
+# before drawing it to the screen to avoid flicker.
+set void SetBufferedDraw=2035(bool buffered,)
+
+# Change the visible size of a tab to be a multiple of the width of a space character.
+set void SetTabWidth=2036(int tabWidth,)
+
+# Retrieve the visible size of a tab.
+get int GetTabWidth=2121(,)
+
+# Clear explicit tabstops on a line.
+fun void ClearTabStops=2675(int line,)
+
+# Add an explicit tab stop for a line.
+fun void AddTabStop=2676(int line, int x)
+
+# Find the next explicit tab stop position on a line after a position.
+fun int GetNextTabStop=2677(int line, int x)
+
+# The SC_CP_UTF8 value can be used to enter Unicode mode.
+# This is the same value as CP_UTF8 in Windows
+val SC_CP_UTF8=65001
+
+# Set the code page used to interpret the bytes of the document as characters.
+# The SC_CP_UTF8 value can be used to enter Unicode mode.
+set void SetCodePage=2037(int codePage,)
+
+enu IMEInteraction=SC_IME_
+val SC_IME_WINDOWED=0
+val SC_IME_INLINE=1
+
+# Is the IME displayed in a winow or inline?
+get int GetIMEInteraction=2678(,)
+
+# Choose to display the the IME in a winow or inline.
+set void SetIMEInteraction=2679(int imeInteraction,)
+
+enu MarkerSymbol=SC_MARK_
+val MARKER_MAX=31
+val SC_MARK_CIRCLE=0
+val SC_MARK_ROUNDRECT=1
+val SC_MARK_ARROW=2
+val SC_MARK_SMALLRECT=3
+val SC_MARK_SHORTARROW=4
+val SC_MARK_EMPTY=5
+val SC_MARK_ARROWDOWN=6
+val SC_MARK_MINUS=7
+val SC_MARK_PLUS=8
+
+# Shapes used for outlining column.
+val SC_MARK_VLINE=9
+val SC_MARK_LCORNER=10
+val SC_MARK_TCORNER=11
+val SC_MARK_BOXPLUS=12
+val SC_MARK_BOXPLUSCONNECTED=13
+val SC_MARK_BOXMINUS=14
+val SC_MARK_BOXMINUSCONNECTED=15
+val SC_MARK_LCORNERCURVE=16
+val SC_MARK_TCORNERCURVE=17
+val SC_MARK_CIRCLEPLUS=18
+val SC_MARK_CIRCLEPLUSCONNECTED=19
+val SC_MARK_CIRCLEMINUS=20
+val SC_MARK_CIRCLEMINUSCONNECTED=21
+
+# Invisible mark that only sets the line background colour.
+val SC_MARK_BACKGROUND=22
+val SC_MARK_DOTDOTDOT=23
+val SC_MARK_ARROWS=24
+val SC_MARK_PIXMAP=25
+val SC_MARK_FULLRECT=26
+val SC_MARK_LEFTRECT=27
+val SC_MARK_AVAILABLE=28
+val SC_MARK_UNDERLINE=29
+val SC_MARK_RGBAIMAGE=30
+val SC_MARK_BOOKMARK=31
+
+val SC_MARK_CHARACTER=10000
+
+enu MarkerOutline=SC_MARKNUM_
+# Markers used for outlining column.
+val SC_MARKNUM_FOLDEREND=25
+val SC_MARKNUM_FOLDEROPENMID=26
+val SC_MARKNUM_FOLDERMIDTAIL=27
+val SC_MARKNUM_FOLDERTAIL=28
+val SC_MARKNUM_FOLDERSUB=29
+val SC_MARKNUM_FOLDER=30
+val SC_MARKNUM_FOLDEROPEN=31
+
+val SC_MASK_FOLDERS=0xFE000000
+
+# Set the symbol used for a particular marker number.
+fun void MarkerDefine=2040(int markerNumber, int markerSymbol)
+
+# Set the foreground colour used for a particular marker number.
+set void MarkerSetFore=2041(int markerNumber, colour fore)
+
+# Set the background colour used for a particular marker number.
+set void MarkerSetBack=2042(int markerNumber, colour back)
+
+# Set the background colour used for a particular marker number when its folding block is selected.
+set void MarkerSetBackSelected=2292(int markerNumber, colour back)
+
+# Enable/disable highlight for current folding bloc (smallest one that contains the caret)
+fun void MarkerEnableHighlight=2293(bool enabled,)
+
+# Add a marker to a line, returning an ID which can be used to find or delete the marker.
+fun int MarkerAdd=2043(int line, int markerNumber)
+
+# Delete a marker from a line.
+fun void MarkerDelete=2044(int line, int markerNumber)
+
+# Delete all markers with a particular number from all lines.
+fun void MarkerDeleteAll=2045(int markerNumber,)
+
+# Get a bit mask of all the markers set on a line.
+fun int MarkerGet=2046(int line,)
+
+# Find the next line at or after lineStart that includes a marker in mask.
+# Return -1 when no more lines.
+fun int MarkerNext=2047(int lineStart, int markerMask)
+
+# Find the previous line before lineStart that includes a marker in mask.
+fun int MarkerPrevious=2048(int lineStart, int markerMask)
+
+# Define a marker from a pixmap.
+fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap)
+
+# Add a set of markers to a line.
+fun void MarkerAddSet=2466(int line, int set)
+
+# Set the alpha used for a marker that is drawn in the text area, not the margin.
+set void MarkerSetAlpha=2476(int markerNumber, int alpha)
+
+val SC_MAX_MARGIN=4
+
+enu MarginType=SC_MARGIN_
+val SC_MARGIN_SYMBOL=0
+val SC_MARGIN_NUMBER=1
+val SC_MARGIN_BACK=2
+val SC_MARGIN_FORE=3
+val SC_MARGIN_TEXT=4
+val SC_MARGIN_RTEXT=5
+
+# Set a margin to be either numeric or symbolic.
+set void SetMarginTypeN=2240(int margin, int marginType)
+
+# Retrieve the type of a margin.
+get int GetMarginTypeN=2241(int margin,)
+
+# Set the width of a margin to a width expressed in pixels.
+set void SetMarginWidthN=2242(int margin, int pixelWidth)
+
+# Retrieve the width of a margin in pixels.
+get int GetMarginWidthN=2243(int margin,)
+
+# Set a mask that determines which markers are displayed in a margin.
+set void SetMarginMaskN=2244(int margin, int mask)
+
+# Retrieve the marker mask of a margin.
+get int GetMarginMaskN=2245(int margin,)
+
+# Make a margin sensitive or insensitive to mouse clicks.
+set void SetMarginSensitiveN=2246(int margin, bool sensitive)
+
+# Retrieve the mouse click sensitivity of a margin.
+get bool GetMarginSensitiveN=2247(int margin,)
+
+# Set the cursor shown when the mouse is inside a margin.
+set void SetMarginCursorN=2248(int margin, int cursor)
+
+# Retrieve the cursor shown in a margin.
+get int GetMarginCursorN=2249(int margin,)
+
+# Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
+# Style 39 is for future use.
+enu StylesCommon=STYLE_
+val STYLE_DEFAULT=32
+val STYLE_LINENUMBER=33
+val STYLE_BRACELIGHT=34
+val STYLE_BRACEBAD=35
+val STYLE_CONTROLCHAR=36
+val STYLE_INDENTGUIDE=37
+val STYLE_CALLTIP=38
+val STYLE_LASTPREDEFINED=39
+val STYLE_MAX=255
+
+# Character set identifiers are used in StyleSetCharacterSet.
+# The values are the same as the Windows *_CHARSET values.
+enu CharacterSet=SC_CHARSET_
+val SC_CHARSET_ANSI=0
+val SC_CHARSET_DEFAULT=1
+val SC_CHARSET_BALTIC=186
+val SC_CHARSET_CHINESEBIG5=136
+val SC_CHARSET_EASTEUROPE=238
+val SC_CHARSET_GB2312=134
+val SC_CHARSET_GREEK=161
+val SC_CHARSET_HANGUL=129
+val SC_CHARSET_MAC=77
+val SC_CHARSET_OEM=255
+val SC_CHARSET_RUSSIAN=204
+val SC_CHARSET_CYRILLIC=1251
+val SC_CHARSET_SHIFTJIS=128
+val SC_CHARSET_SYMBOL=2
+val SC_CHARSET_TURKISH=162
+val SC_CHARSET_JOHAB=130
+val SC_CHARSET_HEBREW=177
+val SC_CHARSET_ARABIC=178
+val SC_CHARSET_VIETNAMESE=163
+val SC_CHARSET_THAI=222
+val SC_CHARSET_8859_15=1000
+
+# Clear all the styles and make equivalent to the global default style.
+fun void StyleClearAll=2050(,)
+
+# Set the foreground colour of a style.
+set void StyleSetFore=2051(int style, colour fore)
+
+# Set the background colour of a style.
+set void StyleSetBack=2052(int style, colour back)
+
+# Set a style to be bold or not.
+set void StyleSetBold=2053(int style, bool bold)
+
+# Set a style to be italic or not.
+set void StyleSetItalic=2054(int style, bool italic)
+
+# Set the size of characters of a style.
+set void StyleSetSize=2055(int style, int sizePoints)
+
+# Set the font of a style.
+set void StyleSetFont=2056(int style, string fontName)
+
+# Set a style to have its end of line filled or not.
+set void StyleSetEOLFilled=2057(int style, bool filled)
+
+# Reset the default style to its state at startup
+fun void StyleResetDefault=2058(,)
+
+# Set a style to be underlined or not.
+set void StyleSetUnderline=2059(int style, bool underline)
+
+enu CaseVisible=SC_CASE_
+val SC_CASE_MIXED=0
+val SC_CASE_UPPER=1
+val SC_CASE_LOWER=2
+
+# Get the foreground colour of a style.
+get colour StyleGetFore=2481(int style,)
+
+# Get the background colour of a style.
+get colour StyleGetBack=2482(int style,)
+
+# Get is a style bold or not.
+get bool StyleGetBold=2483(int style,)
+
+# Get is a style italic or not.
+get bool StyleGetItalic=2484(int style,)
+
+# Get the size of characters of a style.
+get int StyleGetSize=2485(int style,)
+
+# Get the font of a style.
+# Returns the length of the fontName
+# Result is NUL-terminated.
+get int StyleGetFont=2486(int style, stringresult fontName)
+
+# Get is a style to have its end of line filled or not.
+get bool StyleGetEOLFilled=2487(int style,)
+
+# Get is a style underlined or not.
+get bool StyleGetUnderline=2488(int style,)
+
+# Get is a style mixed case, or to force upper or lower case.
+get int StyleGetCase=2489(int style,)
+
+# Get the character get of the font in a style.
+get int StyleGetCharacterSet=2490(int style,)
+
+# Get is a style visible or not.
+get bool StyleGetVisible=2491(int style,)
+
+# Get is a style changeable or not (read only).
+# Experimental feature, currently buggy.
+get bool StyleGetChangeable=2492(int style,)
+
+# Get is a style a hotspot or not.
+get bool StyleGetHotSpot=2493(int style,)
+
+# Set a style to be mixed case, or to force upper or lower case.
+set void StyleSetCase=2060(int style, int caseForce)
+
+val SC_FONT_SIZE_MULTIPLIER=100
+
+# Set the size of characters of a style. Size is in points multiplied by 100.
+set void StyleSetSizeFractional=2061(int style, int caseForce)
+
+# Get the size of characters of a style in points multiplied by 100
+get int StyleGetSizeFractional=2062(int style,)
+
+enu FontWeight=SC_WEIGHT_
+val SC_WEIGHT_NORMAL=400
+val SC_WEIGHT_SEMIBOLD=600
+val SC_WEIGHT_BOLD=700
+
+# Set the weight of characters of a style.
+set void StyleSetWeight=2063(int style, int weight)
+
+# Get the weight of characters of a style.
+get int StyleGetWeight=2064(int style,)
+
+# Set the character set of the font in a style.
+set void StyleSetCharacterSet=2066(int style, int characterSet)
+
+# Set a style to be a hotspot or not.
+set void StyleSetHotSpot=2409(int style, bool hotspot)
+
+# Set the foreground colour of the main and additional selections and whether to use this setting.
+fun void SetSelFore=2067(bool useSetting, colour fore)
+
+# Set the background colour of the main and additional selections and whether to use this setting.
+fun void SetSelBack=2068(bool useSetting, colour back)
+
+# Get the alpha of the selection.
+get int GetSelAlpha=2477(,)
+
+# Set the alpha of the selection.
+set void SetSelAlpha=2478(int alpha,)
+
+# Is the selection end of line filled?
+get bool GetSelEOLFilled=2479(,)
+
+# Set the selection to have its end of line filled or not.
+set void SetSelEOLFilled=2480(bool filled,)
+
+# Set the foreground colour of the caret.
+set void SetCaretFore=2069(colour fore,)
+
+# When key+modifier combination km is pressed perform msg.
+fun void AssignCmdKey=2070(keymod km, int msg)
+
+# When key+modifier combination km is pressed do nothing.
+fun void ClearCmdKey=2071(keymod km,)
+
+# Drop all key mappings.
+fun void ClearAllCmdKeys=2072(,)
+
+# Set the styles for a segment of the document.
+fun void SetStylingEx=2073(int length, string styles)
+
+# Set a style to be visible or not.
+set void StyleSetVisible=2074(int style, bool visible)
+
+# Get the time in milliseconds that the caret is on and off.
+get int GetCaretPeriod=2075(,)
+
+# Get the time in milliseconds that the caret is on and off. 0 = steady on.
+set void SetCaretPeriod=2076(int periodMilliseconds,)
+
+# Set the set of characters making up words for when moving or selecting by word.
+# First sets defaults like SetCharsDefault.
+set void SetWordChars=2077(, string characters)
+
+# Get the set of characters making up words for when moving or selecting by word.
+# Returns the number of characters
+get int GetWordChars=2646(, stringresult characters)
+
+# Start a sequence of actions that is undone and redone as a unit.
+# May be nested.
+fun void BeginUndoAction=2078(,)
+
+# End a sequence of actions that is undone and redone as a unit.
+fun void EndUndoAction=2079(,)
+
+# Indicator style enumeration and some constants
+enu IndicatorStyle=INDIC_
+val INDIC_PLAIN=0
+val INDIC_SQUIGGLE=1
+val INDIC_TT=2
+val INDIC_DIAGONAL=3
+val INDIC_STRIKE=4
+val INDIC_HIDDEN=5
+val INDIC_BOX=6
+val INDIC_ROUNDBOX=7
+val INDIC_STRAIGHTBOX=8
+val INDIC_DASH=9
+val INDIC_DOTS=10
+val INDIC_SQUIGGLELOW=11
+val INDIC_DOTBOX=12
+val INDIC_SQUIGGLEPIXMAP=13
+val INDIC_COMPOSITIONTHICK=14
+val INDIC_COMPOSITIONTHIN=15
+val INDIC_FULLBOX=16
+val INDIC_TEXTFORE=17
+val INDIC_IME=32
+val INDIC_IME_MAX=35
+val INDIC_MAX=35
+val INDIC_CONTAINER=8
+val INDIC0_MASK=0x20
+val INDIC1_MASK=0x40
+val INDIC2_MASK=0x80
+val INDICS_MASK=0xE0
+
+# Set an indicator to plain, squiggle or TT.
+set void IndicSetStyle=2080(int indic, int style)
+
+# Retrieve the style of an indicator.
+get int IndicGetStyle=2081(int indic,)
+
+# Set the foreground colour of an indicator.
+set void IndicSetFore=2082(int indic, colour fore)
+
+# Retrieve the foreground colour of an indicator.
+get colour IndicGetFore=2083(int indic,)
+
+# Set an indicator to draw under text or over(default).
+set void IndicSetUnder=2510(int indic, bool under)
+
+# Retrieve whether indicator drawn under or over text.
+get bool IndicGetUnder=2511(int indic,)
+
+# Set a hover indicator to plain, squiggle or TT.
+set void IndicSetHoverStyle=2680(int indic, int style)
+
+# Retrieve the hover style of an indicator.
+get int IndicGetHoverStyle=2681(int indic,)
+
+# Set the foreground hover colour of an indicator.
+set void IndicSetHoverFore=2682(int indic, colour fore)
+
+# Retrieve the foreground hover colour of an indicator.
+get colour IndicGetHoverFore=2683(int indic,)
+
+val SC_INDICVALUEBIT=0x1000000
+val SC_INDICVALUEMASK=0xFFFFFF
+
+enu IndicFlag=SC_INDICFLAG_
+val SC_INDICFLAG_VALUEFORE=1
+
+# Set the attributes of an indicator.
+set void IndicSetFlags=2684(int indic, int flags)
+
+# Retrieve the attributes of an indicator.
+get int IndicGetFlags=2685(int indic,)
+
+# Set the foreground colour of all whitespace and whether to use this setting.
+fun void SetWhitespaceFore=2084(bool useSetting, colour fore)
+
+# Set the background colour of all whitespace and whether to use this setting.
+fun void SetWhitespaceBack=2085(bool useSetting, colour back)
+
+# Set the size of the dots used to mark space characters.
+set void SetWhitespaceSize=2086(int size,)
+
+# Get the size of the dots used to mark space characters.
+get int GetWhitespaceSize=2087(,)
+
+# Divide each styling byte into lexical class bits (default: 5) and indicator
+# bits (default: 3). If a lexer requires more than 32 lexical states, then this
+# is used to expand the possible states.
+set void SetStyleBits=2090(int bits,)
+
+# Retrieve number of bits in style bytes used to hold the lexical state.
+get int GetStyleBits=2091(,)
+
+# Used to hold extra styling information for each line.
+set void SetLineState=2092(int line, int state)
+
+# Retrieve the extra styling information for a line.
+get int GetLineState=2093(int line,)
+
+# Retrieve the last line number that has line state.
+get int GetMaxLineState=2094(,)
+
+# Is the background of the line containing the caret in a different colour?
+get bool GetCaretLineVisible=2095(,)
+
+# Display the background of the line containing the caret in a different colour.
+set void SetCaretLineVisible=2096(bool show,)
+
+# Get the colour of the background of the line containing the caret.
+get colour GetCaretLineBack=2097(,)
+
+# Set the colour of the background of the line containing the caret.
+set void SetCaretLineBack=2098(colour back,)
+
+# Set a style to be changeable or not (read only).
+# Experimental feature, currently buggy.
+set void StyleSetChangeable=2099(int style, bool changeable)
+
+# Display a auto-completion list.
+# The lenEntered parameter indicates how many characters before
+# the caret should be used to provide context.
+fun void AutoCShow=2100(int lenEntered, string itemList)
+
+# Remove the auto-completion list from the screen.
+fun void AutoCCancel=2101(,)
+
+# Is there an auto-completion list visible?
+fun bool AutoCActive=2102(,)
+
+# Retrieve the position of the caret when the auto-completion list was displayed.
+fun position AutoCPosStart=2103(,)
+
+# User has selected an item so remove the list and insert the selection.
+fun void AutoCComplete=2104(,)
+
+# Define a set of character that when typed cancel the auto-completion list.
+fun void AutoCStops=2105(, string characterSet)
+
+# Change the separator character in the string setting up an auto-completion list.
+# Default is space but can be changed if items contain space.
+set void AutoCSetSeparator=2106(int separatorCharacter,)
+
+# Retrieve the auto-completion list separator character.
+get int AutoCGetSeparator=2107(,)
+
+# Select the item in the auto-completion list that starts with a string.
+fun void AutoCSelect=2108(, string text)
+
+# Should the auto-completion list be cancelled if the user backspaces to a
+# position before where the box was created.
+set void AutoCSetCancelAtStart=2110(bool cancel,)
+
+# Retrieve whether auto-completion cancelled by backspacing before start.
+get bool AutoCGetCancelAtStart=2111(,)
+
+# Define a set of characters that when typed will cause the autocompletion to
+# choose the selected item.
+set void AutoCSetFillUps=2112(, string characterSet)
+
+# Should a single item auto-completion list automatically choose the item.
+set void AutoCSetChooseSingle=2113(bool chooseSingle,)
+
+# Retrieve whether a single item auto-completion list automatically choose the item.
+get bool AutoCGetChooseSingle=2114(,)
+
+# Set whether case is significant when performing auto-completion searches.
+set void AutoCSetIgnoreCase=2115(bool ignoreCase,)
+
+# Retrieve state of ignore case flag.
+get bool AutoCGetIgnoreCase=2116(,)
+
+# Display a list of strings and send notification when user chooses one.
+fun void UserListShow=2117(int listType, string itemList)
+
+# Set whether or not autocompletion is hidden automatically when nothing matches.
+set void AutoCSetAutoHide=2118(bool autoHide,)
+
+# Retrieve whether or not autocompletion is hidden automatically when nothing matches.
+get bool AutoCGetAutoHide=2119(,)
+
+# Set whether or not autocompletion deletes any word characters
+# after the inserted text upon completion.
+set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,)
+
+# Retrieve whether or not autocompletion deletes any word characters
+# after the inserted text upon completion.
+get bool AutoCGetDropRestOfWord=2271(,)
+
+# Register an XPM image for use in autocompletion lists.
+fun void RegisterImage=2405(int type, string xpmData)
+
+# Clear all the registered XPM images.
+fun void ClearRegisteredImages=2408(,)
+
+# Retrieve the auto-completion list type-separator character.
+get int AutoCGetTypeSeparator=2285(,)
+
+# Change the type-separator character in the string setting up an auto-completion list.
+# Default is '?' but can be changed if items contain '?'.
+set void AutoCSetTypeSeparator=2286(int separatorCharacter,)
+
+# Set the maximum width, in characters, of auto-completion and user lists.
+# Set to 0 to autosize to fit longest item, which is the default.
+set void AutoCSetMaxWidth=2208(int characterCount,)
+
+# Get the maximum width, in characters, of auto-completion and user lists.
+get int AutoCGetMaxWidth=2209(,)
+
+# Set the maximum height, in rows, of auto-completion and user lists.
+# The default is 5 rows.
+set void AutoCSetMaxHeight=2210(int rowCount,)
+
+# Set the maximum height, in rows, of auto-completion and user lists.
+get int AutoCGetMaxHeight=2211(,)
+
+# Set the number of spaces used for one level of indentation.
+set void SetIndent=2122(int indentSize,)
+
+# Retrieve indentation size.
+get int GetIndent=2123(,)
+
+# Indentation will only use space characters if useTabs is false, otherwise
+# it will use a combination of tabs and spaces.
+set void SetUseTabs=2124(bool useTabs,)
+
+# Retrieve whether tabs will be used in indentation.
+get bool GetUseTabs=2125(,)
+
+# Change the indentation of a line to a number of columns.
+set void SetLineIndentation=2126(int line, int indentSize)
+
+# Retrieve the number of columns that a line is indented.
+get int GetLineIndentation=2127(int line,)
+
+# Retrieve the position before the first non indentation character on a line.
+get position GetLineIndentPosition=2128(int line,)
+
+# Retrieve the column number of a position, taking tab width into account.
+get int GetColumn=2129(position pos,)
+
+# Count characters between two positions.
+fun int CountCharacters=2633(int startPos, int endPos)
+
+# Show or hide the horizontal scroll bar.
+set void SetHScrollBar=2130(bool show,)
+# Is the horizontal scroll bar visible?
+get bool GetHScrollBar=2131(,)
+
+enu IndentView=SC_IV_
+val SC_IV_NONE=0
+val SC_IV_REAL=1
+val SC_IV_LOOKFORWARD=2
+val SC_IV_LOOKBOTH=3
+
+# Show or hide indentation guides.
+set void SetIndentationGuides=2132(int indentView,)
+
+# Are the indentation guides visible?
+get int GetIndentationGuides=2133(,)
+
+# Set the highlighted indentation guide column.
+# 0 = no highlighted guide.
+set void SetHighlightGuide=2134(int column,)
+
+# Get the highlighted indentation guide column.
+get int GetHighlightGuide=2135(,)
+
+# Get the position after the last visible characters on a line.
+get position GetLineEndPosition=2136(int line,)
+
+# Get the code page used to interpret the bytes of the document as characters.
+get int GetCodePage=2137(,)
+
+# Get the foreground colour of the caret.
+get colour GetCaretFore=2138(,)
+
+# In read-only mode?
+get bool GetReadOnly=2140(,)
+
+# Sets the position of the caret.
+set void SetCurrentPos=2141(position pos,)
+
+# Sets the position that starts the selection - this becomes the anchor.
+set void SetSelectionStart=2142(position pos,)
+
+# Returns the position at the start of the selection.
+get position GetSelectionStart=2143(,)
+
+# Sets the position that ends the selection - this becomes the currentPosition.
+set void SetSelectionEnd=2144(position pos,)
+
+# Returns the position at the end of the selection.
+get position GetSelectionEnd=2145(,)
+
+# Set caret to a position, while removing any existing selection.
+fun void SetEmptySelection=2556(position pos,)
+
+# Sets the print magnification added to the point size of each style for printing.
+set void SetPrintMagnification=2146(int magnification,)
+
+# Returns the print magnification.
+get int GetPrintMagnification=2147(,)
+
+enu PrintOption=SC_PRINT_
+# PrintColourMode - use same colours as screen.
+val SC_PRINT_NORMAL=0
+# PrintColourMode - invert the light value of each style for printing.
+val SC_PRINT_INVERTLIGHT=1
+# PrintColourMode - force black text on white background for printing.
+val SC_PRINT_BLACKONWHITE=2
+# PrintColourMode - text stays coloured, but all background is forced to be white for printing.
+val SC_PRINT_COLOURONWHITE=3
+# PrintColourMode - only the default-background is forced to be white for printing.
+val SC_PRINT_COLOURONWHITEDEFAULTBG=4
+
+# Modify colours when printing for clearer printed text.
+set void SetPrintColourMode=2148(int mode,)
+
+# Returns the print colour mode.
+get int GetPrintColourMode=2149(,)
+
+enu FindOption=SCFIND_
+val SCFIND_WHOLEWORD=0x2
+val SCFIND_MATCHCASE=0x4
+val SCFIND_WORDSTART=0x00100000
+val SCFIND_REGEXP=0x00200000
+val SCFIND_POSIX=0x00400000
+val SCFIND_CXX11REGEX=0x00800000
+
+# Find some text in the document.
+fun position FindText=2150(int flags, findtext ft)
+
+# On Windows, will draw the document into a display context such as a printer.
+fun position FormatRange=2151(bool draw, formatrange fr)
+
+# Retrieve the display line at the top of the display.
+get int GetFirstVisibleLine=2152(,)
+
+# Retrieve the contents of a line.
+# Returns the length of the line.
+fun int GetLine=2153(int line, stringresult text)
+
+# Returns the number of lines in the document. There is always at least one.
+get int GetLineCount=2154(,)
+
+# Sets the size in pixels of the left margin.
+set void SetMarginLeft=2155(, int pixelWidth)
+
+# Returns the size in pixels of the left margin.
+get int GetMarginLeft=2156(,)
+
+# Sets the size in pixels of the right margin.
+set void SetMarginRight=2157(, int pixelWidth)
+
+# Returns the size in pixels of the right margin.
+get int GetMarginRight=2158(,)
+
+# Is the document different from when it was last saved?
+get bool GetModify=2159(,)
+
+# Select a range of text.
+fun void SetSel=2160(position start, position end)
+
+# Retrieve the selected text.
+# Return the length of the text.
+# Result is NUL-terminated.
+fun int GetSelText=2161(, stringresult text)
+
+# Retrieve a range of text.
+# Return the length of the text.
+fun int GetTextRange=2162(, textrange tr)
+
+# Draw the selection in normal style or with selection highlighted.
+fun void HideSelection=2163(bool normal,)
+
+# Retrieve the x value of the point in the window where a position is displayed.
+fun int PointXFromPosition=2164(, position pos)
+
+# Retrieve the y value of the point in the window where a position is displayed.
+fun int PointYFromPosition=2165(, position pos)
+
+# Retrieve the line containing a position.
+fun int LineFromPosition=2166(position pos,)
+
+# Retrieve the position at the start of a line.
+fun position PositionFromLine=2167(int line,)
+
+# Scroll horizontally and vertically.
+fun void LineScroll=2168(int columns, int lines)
+
+# Ensure the caret is visible.
+fun void ScrollCaret=2169(,)
+
+# Scroll the argument positions and the range between them into view giving
+# priority to the primary position then the secondary position.
+# This may be used to make a search match visible.
+fun void ScrollRange=2569(position secondary, position primary)
+
+# Replace the selected text with the argument text.
+fun void ReplaceSel=2170(, string text)
+
+# Set to read only or read write.
+set void SetReadOnly=2171(bool readOnly,)
+
+# Null operation.
+fun void Null=2172(,)
+
+# Will a paste succeed?
+fun bool CanPaste=2173(,)
+
+# Are there any undoable actions in the undo history?
+fun bool CanUndo=2174(,)
+
+# Delete the undo history.
+fun void EmptyUndoBuffer=2175(,)
+
+# Undo one action in the undo history.
+fun void Undo=2176(,)
+
+# Cut the selection to the clipboard.
+fun void Cut=2177(,)
+
+# Copy the selection to the clipboard.
+fun void Copy=2178(,)
+
+# Paste the contents of the clipboard into the document replacing the selection.
+fun void Paste=2179(,)
+
+# Clear the selection.
+fun void Clear=2180(,)
+
+# Replace the contents of the document with the argument text.
+fun void SetText=2181(, string text)
+
+# Retrieve all the text in the document.
+# Returns number of characters retrieved.
+# Result is NUL-terminated.
+fun int GetText=2182(int length, stringresult text)
+
+# Retrieve the number of characters in the document.
+get int GetTextLength=2183(,)
+
+# Retrieve a pointer to a function that processes messages for this Scintilla.
+get int GetDirectFunction=2184(,)
+
+# Retrieve a pointer value to use as the first argument when calling
+# the function returned by GetDirectFunction.
+get int GetDirectPointer=2185(,)
+
+# Set to overtype (true) or insert mode.
+set void SetOvertype=2186(bool overtype,)
+
+# Returns true if overtype mode is active otherwise false is returned.
+get bool GetOvertype=2187(,)
+
+# Set the width of the insert mode caret.
+set void SetCaretWidth=2188(int pixelWidth,)
+
+# Returns the width of the insert mode caret.
+get int GetCaretWidth=2189(,)
+
+# Sets the position that starts the target which is used for updating the
+# document without affecting the scroll position.
+set void SetTargetStart=2190(position pos,)
+
+# Get the position that starts the target.
+get position GetTargetStart=2191(,)
+
+# Sets the position that ends the target which is used for updating the
+# document without affecting the scroll position.
+set void SetTargetEnd=2192(position pos,)
+
+# Get the position that ends the target.
+get position GetTargetEnd=2193(,)
+
+# Sets both the start and end of the target in one call.
+fun void SetTargetRange=2686(position start, position end)
+
+# Retrieve the text in the target.
+get int GetTargetText=2687(, stringresult characters)
+
+# Replace the target text with the argument text.
+# Text is counted so it can contain NULs.
+# Returns the length of the replacement text.
+fun int ReplaceTarget=2194(int length, string text)
+
+# Replace the target text with the argument text after \d processing.
+# Text is counted so it can contain NULs.
+# Looks for \d where d is between 1 and 9 and replaces these with the strings
+# matched in the last search operation which were surrounded by \( and \).
+# Returns the length of the replacement text including any change
+# caused by processing the \d patterns.
+fun int ReplaceTargetRE=2195(int length, string text)
+
+# Search for a counted string in the target and set the target to the found
+# range. Text is counted so it can contain NULs.
+# Returns length of range or -1 for failure in which case target is not moved.
+fun int SearchInTarget=2197(int length, string text)
+
+# Set the search flags used by SearchInTarget.
+set void SetSearchFlags=2198(int flags,)
+
+# Get the search flags used by SearchInTarget.
+get int GetSearchFlags=2199(,)
+
+# Show a call tip containing a definition near position pos.
+fun void CallTipShow=2200(position pos, string definition)
+
+# Remove the call tip from the screen.
+fun void CallTipCancel=2201(,)
+
+# Is there an active call tip?
+fun bool CallTipActive=2202(,)
+
+# Retrieve the position where the caret was before displaying the call tip.
+fun position CallTipPosStart=2203(,)
+
+# Set the start position in order to change when backspacing removes the calltip.
+set void CallTipSetPosStart=2214(int posStart,)
+
+# Highlight a segment of the definition.
+fun void CallTipSetHlt=2204(int start, int end)
+
+# Set the background colour for the call tip.
+set void CallTipSetBack=2205(colour back,)
+
+# Set the foreground colour for the call tip.
+set void CallTipSetFore=2206(colour fore,)
+
+# Set the foreground colour for the highlighted part of the call tip.
+set void CallTipSetForeHlt=2207(colour fore,)
+
+# Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
+set void CallTipUseStyle=2212(int tabSize,)
+
+# Set position of calltip, above or below text.
+set void CallTipSetPosition=2213(bool above,)
+
+# Find the display line of a document line taking hidden lines into account.
+fun int VisibleFromDocLine=2220(int line,)
+
+# Find the document line of a display line taking hidden lines into account.
+fun int DocLineFromVisible=2221(int lineDisplay,)
+
+# The number of display lines needed to wrap a document line
+fun int WrapCount=2235(int line,)
+
+enu FoldLevel=SC_FOLDLEVEL
+val SC_FOLDLEVELBASE=0x400
+val SC_FOLDLEVELWHITEFLAG=0x1000
+val SC_FOLDLEVELHEADERFLAG=0x2000
+val SC_FOLDLEVELNUMBERMASK=0x0FFF
+
+# Set the fold level of a line.
+# This encodes an integer level along with flags indicating whether the
+# line is a header and whether it is effectively white space.
+set void SetFoldLevel=2222(int line, int level)
+
+# Retrieve the fold level of a line.
+get int GetFoldLevel=2223(int line,)
+
+# Find the last child line of a header line.
+get int GetLastChild=2224(int line, int level)
+
+# Find the parent line of a child line.
+get int GetFoldParent=2225(int line,)
+
+# Make a range of lines visible.
+fun void ShowLines=2226(int lineStart, int lineEnd)
+
+# Make a range of lines invisible.
+fun void HideLines=2227(int lineStart, int lineEnd)
+
+# Is a line visible?
+get bool GetLineVisible=2228(int line,)
+
+# Are all lines visible?
+get bool GetAllLinesVisible=2236(,)
+
+# Show the children of a header line.
+set void SetFoldExpanded=2229(int line, bool expanded)
+
+# Is a header line expanded?
+get bool GetFoldExpanded=2230(int line,)
+
+# Switch a header line between expanded and contracted.
+fun void ToggleFold=2231(int line,)
+
+enu FoldAction=SC_FOLDACTION
+val SC_FOLDACTION_CONTRACT=0
+val SC_FOLDACTION_EXPAND=1
+val SC_FOLDACTION_TOGGLE=2
+
+# Expand or contract a fold header.
+fun void FoldLine=2237(int line, int action)
+
+# Expand or contract a fold header and its children.
+fun void FoldChildren=2238(int line, int action)
+
+# Expand a fold header and all children. Use the level argument instead of the line's current level.
+fun void ExpandChildren=2239(int line, int level)
+
+# Expand or contract all fold headers.
+fun void FoldAll=2662(int action,)
+
+# Ensure a particular line is visible by expanding any header line hiding it.
+fun void EnsureVisible=2232(int line,)
+
+enu AutomaticFold=SC_AUTOMATICFOLD_
+val SC_AUTOMATICFOLD_SHOW=0x0001
+val SC_AUTOMATICFOLD_CLICK=0x0002
+val SC_AUTOMATICFOLD_CHANGE=0x0004
+
+# Set automatic folding behaviours.
+set void SetAutomaticFold=2663(int automaticFold,)
+
+# Get automatic folding behaviours.
+get int GetAutomaticFold=2664(,)
+
+enu FoldFlag=SC_FOLDFLAG_
+val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002
+val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004
+val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008
+val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010
+val SC_FOLDFLAG_LEVELNUMBERS=0x0040
+val SC_FOLDFLAG_LINESTATE=0x0080
+
+# Set some style options for folding.
+set void SetFoldFlags=2233(int flags,)
+
+# Ensure a particular line is visible by expanding any header line hiding it.
+# Use the currently set visibility policy to determine which range to display.
+fun void EnsureVisibleEnforcePolicy=2234(int line,)
+
+# Sets whether a tab pressed when caret is within indentation indents.
+set void SetTabIndents=2260(bool tabIndents,)
+
+# Does a tab pressed when caret is within indentation indent?
+get bool GetTabIndents=2261(,)
+
+# Sets whether a backspace pressed when caret is within indentation unindents.
+set void SetBackSpaceUnIndents=2262(bool bsUnIndents,)
+
+# Does a backspace pressed when caret is within indentation unindent?
+get bool GetBackSpaceUnIndents=2263(,)
+
+val SC_TIME_FOREVER=10000000
+
+# Sets the time the mouse must sit still to generate a mouse dwell event.
+set void SetMouseDwellTime=2264(int periodMilliseconds,)
+
+# Retrieve the time the mouse must sit still to generate a mouse dwell event.
+get int GetMouseDwellTime=2265(,)
+
+# Get position of start of word.
+fun int WordStartPosition=2266(position pos, bool onlyWordCharacters)
+
+# Get position of end of word.
+fun int WordEndPosition=2267(position pos, bool onlyWordCharacters)
+
+enu Wrap=SC_WRAP_
+val SC_WRAP_NONE=0
+val SC_WRAP_WORD=1
+val SC_WRAP_CHAR=2
+val SC_WRAP_WHITESPACE=3
+
+# Sets whether text is word wrapped.
+set void SetWrapMode=2268(int mode,)
+
+# Retrieve whether text is word wrapped.
+get int GetWrapMode=2269(,)
+
+enu WrapVisualFlag=SC_WRAPVISUALFLAG_
+val SC_WRAPVISUALFLAG_NONE=0x0000
+val SC_WRAPVISUALFLAG_END=0x0001
+val SC_WRAPVISUALFLAG_START=0x0002
+val SC_WRAPVISUALFLAG_MARGIN=0x0004
+
+# Set the display mode of visual flags for wrapped lines.
+set void SetWrapVisualFlags=2460(int wrapVisualFlags,)
+
+# Retrive the display mode of visual flags for wrapped lines.
+get int GetWrapVisualFlags=2461(,)
+
+enu WrapVisualLocation=SC_WRAPVISUALFLAGLOC_
+val SC_WRAPVISUALFLAGLOC_DEFAULT=0x0000
+val SC_WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001
+val SC_WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002
+
+# Set the location of visual flags for wrapped lines.
+set void SetWrapVisualFlagsLocation=2462(int wrapVisualFlagsLocation,)
+
+# Retrive the location of visual flags for wrapped lines.
+get int GetWrapVisualFlagsLocation=2463(,)
+
+# Set the start indent for wrapped lines.
+set void SetWrapStartIndent=2464(int indent,)
+
+# Retrive the start indent for wrapped lines.
+get int GetWrapStartIndent=2465(,)
+
+enu WrapIndentMode=SC_WRAPINDENT_
+val SC_WRAPINDENT_FIXED=0
+val SC_WRAPINDENT_SAME=1
+val SC_WRAPINDENT_INDENT=2
+
+# Sets how wrapped sublines are placed. Default is fixed.
+set void SetWrapIndentMode=2472(int mode,)
+
+# Retrieve how wrapped sublines are placed. Default is fixed.
+get int GetWrapIndentMode=2473(,)
+
+enu LineCache=SC_CACHE_
+val SC_CACHE_NONE=0
+val SC_CACHE_CARET=1
+val SC_CACHE_PAGE=2
+val SC_CACHE_DOCUMENT=3
+
+# Sets the degree of caching of layout information.
+set void SetLayoutCache=2272(int mode,)
+
+# Retrieve the degree of caching of layout information.
+get int GetLayoutCache=2273(,)
+
+# Sets the document width assumed for scrolling.
+set void SetScrollWidth=2274(int pixelWidth,)
+
+# Retrieve the document width assumed for scrolling.
+get int GetScrollWidth=2275(,)
+
+# Sets whether the maximum width line displayed is used to set scroll width.
+set void SetScrollWidthTracking=2516(bool tracking,)
+
+# Retrieve whether the scroll width tracks wide lines.
+get bool GetScrollWidthTracking=2517(,)
+
+# Measure the pixel width of some text in a particular style.
+# NUL terminated text argument.
+# Does not handle tab or control characters.
+fun int TextWidth=2276(int style, string text)
+
+# Sets the scroll range so that maximum scroll position has
+# the last line at the bottom of the view (default).
+# Setting this to false allows scrolling one page below the last line.
+set void SetEndAtLastLine=2277(bool endAtLastLine,)
+
+# Retrieve whether the maximum scroll position has the last
+# line at the bottom of the view.
+get bool GetEndAtLastLine=2278(,)
+
+# Retrieve the height of a particular line of text in pixels.
+fun int TextHeight=2279(int line,)
+
+# Show or hide the vertical scroll bar.
+set void SetVScrollBar=2280(bool show,)
+
+# Is the vertical scroll bar visible?
+get bool GetVScrollBar=2281(,)
+
+# Append a string to the end of the document without changing the selection.
+fun void AppendText=2282(int length, string text)
+
+# Is drawing done in two phases with backgrounds drawn before foregrounds?
+get bool GetTwoPhaseDraw=2283(,)
+
+# In twoPhaseDraw mode, drawing is performed in two phases, first the background
+# and then the foreground. This avoids chopping off characters that overlap the next run.
+set void SetTwoPhaseDraw=2284(bool twoPhase,)
+
+enu FontQuality=SC_PHASES_
+val SC_PHASES_ONE=0
+val SC_PHASES_TWO=1
+val SC_PHASES_MULTIPLE=2
+
+# How many phases is drawing done in?
+get int GetPhasesDraw=2673(,)
+
+# In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
+# In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally.
+# In multiple phase draw, each element is drawn over the whole drawing area, allowing text
+# to overlap from one line to the next.
+set void SetPhasesDraw=2674(int phases,)
+
+# Control font anti-aliasing.
+
+enu FontQuality=SC_EFF_
+val SC_EFF_QUALITY_MASK=0xF
+val SC_EFF_QUALITY_DEFAULT=0
+val SC_EFF_QUALITY_NON_ANTIALIASED=1
+val SC_EFF_QUALITY_ANTIALIASED=2
+val SC_EFF_QUALITY_LCD_OPTIMIZED=3
+
+# Choose the quality level for text from the FontQuality enumeration.
+set void SetFontQuality=2611(int fontQuality,)
+
+# Retrieve the quality level for text.
+get int GetFontQuality=2612(,)
+
+# Scroll so that a display line is at the top of the display.
+set void SetFirstVisibleLine=2613(int lineDisplay,)
+
+enu MultiPaste=SC_MULTIPASTE_
+val SC_MULTIPASTE_ONCE=0
+val SC_MULTIPASTE_EACH=1
+
+# Change the effect of pasting when there are multiple selections.
+set void SetMultiPaste=2614(int multiPaste,)
+
+# Retrieve the effect of pasting when there are multiple selections..
+get int GetMultiPaste=2615(,)
+
+# Retrieve the value of a tag from a regular expression search.
+# Result is NUL-terminated.
+get int GetTag=2616(int tagNumber, stringresult tagValue)
+
+# Make the target range start and end be the same as the selection range start and end.
+fun void TargetFromSelection=2287(,)
+
+# Join the lines in the target.
+fun void LinesJoin=2288(,)
+
+# Split the lines in the target into lines that are less wide than pixelWidth
+# where possible.
+fun void LinesSplit=2289(int pixelWidth,)
+
+# Set the colours used as a chequerboard pattern in the fold margin
+fun void SetFoldMarginColour=2290(bool useSetting, colour back)
+fun void SetFoldMarginHiColour=2291(bool useSetting, colour fore)
+
+## New messages go here
+
+## Start of key messages
+# Move caret down one line.
+fun void LineDown=2300(,)
+
+# Move caret down one line extending selection to new caret position.
+fun void LineDownExtend=2301(,)
+
+# Move caret up one line.
+fun void LineUp=2302(,)
+
+# Move caret up one line extending selection to new caret position.
+fun void LineUpExtend=2303(,)
+
+# Move caret left one character.
+fun void CharLeft=2304(,)
+
+# Move caret left one character extending selection to new caret position.
+fun void CharLeftExtend=2305(,)
+
+# Move caret right one character.
+fun void CharRight=2306(,)
+
+# Move caret right one character extending selection to new caret position.
+fun void CharRightExtend=2307(,)
+
+# Move caret left one word.
+fun void WordLeft=2308(,)
+
+# Move caret left one word extending selection to new caret position.
+fun void WordLeftExtend=2309(,)
+
+# Move caret right one word.
+fun void WordRight=2310(,)
+
+# Move caret right one word extending selection to new caret position.
+fun void WordRightExtend=2311(,)
+
+# Move caret to first position on line.
+fun void Home=2312(,)
+
+# Move caret to first position on line extending selection to new caret position.
+fun void HomeExtend=2313(,)
+
+# Move caret to last position on line.
+fun void LineEnd=2314(,)
+
+# Move caret to last position on line extending selection to new caret position.
+fun void LineEndExtend=2315(,)
+
+# Move caret to first position in document.
+fun void DocumentStart=2316(,)
+
+# Move caret to first position in document extending selection to new caret position.
+fun void DocumentStartExtend=2317(,)
+
+# Move caret to last position in document.
+fun void DocumentEnd=2318(,)
+
+# Move caret to last position in document extending selection to new caret position.
+fun void DocumentEndExtend=2319(,)
+
+# Move caret one page up.
+fun void PageUp=2320(,)
+
+# Move caret one page up extending selection to new caret position.
+fun void PageUpExtend=2321(,)
+
+# Move caret one page down.
+fun void PageDown=2322(,)
+
+# Move caret one page down extending selection to new caret position.
+fun void PageDownExtend=2323(,)
+
+# Switch from insert to overtype mode or the reverse.
+fun void EditToggleOvertype=2324(,)
+
+# Cancel any modes such as call tip or auto-completion list display.
+fun void Cancel=2325(,)
+
+# Delete the selection or if no selection, the character before the caret.
+fun void DeleteBack=2326(,)
+
+# If selection is empty or all on one line replace the selection with a tab character.
+# If more than one line selected, indent the lines.
+fun void Tab=2327(,)
+
+# Dedent the selected lines.
+fun void BackTab=2328(,)
+
+# Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
+fun void NewLine=2329(,)
+
+# Insert a Form Feed character.
+fun void FormFeed=2330(,)
+
+# Move caret to before first visible character on line.
+# If already there move to first character on line.
+fun void VCHome=2331(,)
+
+# Like VCHome but extending selection to new caret position.
+fun void VCHomeExtend=2332(,)
+
+# Magnify the displayed text by increasing the sizes by 1 point.
+fun void ZoomIn=2333(,)
+
+# Make the displayed text smaller by decreasing the sizes by 1 point.
+fun void ZoomOut=2334(,)
+
+# Delete the word to the left of the caret.
+fun void DelWordLeft=2335(,)
+
+# Delete the word to the right of the caret.
+fun void DelWordRight=2336(,)
+
+# Delete the word to the right of the caret, but not the trailing non-word characters.
+fun void DelWordRightEnd=2518(,)
+
+# Cut the line containing the caret.
+fun void LineCut=2337(,)
+
+# Delete the line containing the caret.
+fun void LineDelete=2338(,)
+
+# Switch the current line with the previous.
+fun void LineTranspose=2339(,)
+
+# Duplicate the current line.
+fun void LineDuplicate=2404(,)
+
+# Transform the selection to lower case.
+fun void LowerCase=2340(,)
+
+# Transform the selection to upper case.
+fun void UpperCase=2341(,)
+
+# Scroll the document down, keeping the caret visible.
+fun void LineScrollDown=2342(,)
+
+# Scroll the document up, keeping the caret visible.
+fun void LineScrollUp=2343(,)
+
+# Delete the selection or if no selection, the character before the caret.
+# Will not delete the character before at the start of a line.
+fun void DeleteBackNotLine=2344(,)
+
+# Move caret to first position on display line.
+fun void HomeDisplay=2345(,)
+
+# Move caret to first position on display line extending selection to
+# new caret position.
+fun void HomeDisplayExtend=2346(,)
+
+# Move caret to last position on display line.
+fun void LineEndDisplay=2347(,)
+
+# Move caret to last position on display line extending selection to new
+# caret position.
+fun void LineEndDisplayExtend=2348(,)
+
+# These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
+# except they behave differently when word-wrap is enabled:
+# They go first to the start / end of the display line, like (Home|LineEnd)Display
+# The difference is that, the cursor is already at the point, it goes on to the start
+# or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
+
+fun void HomeWrap=2349(,)
+fun void HomeWrapExtend=2450(,)
+fun void LineEndWrap=2451(,)
+fun void LineEndWrapExtend=2452(,)
+fun void VCHomeWrap=2453(,)
+fun void VCHomeWrapExtend=2454(,)
+
+# Copy the line containing the caret.
+fun void LineCopy=2455(,)
+
+# Move the caret inside current view if it's not there already.
+fun void MoveCaretInsideView=2401(,)
+
+# How many characters are on a line, including end of line characters?
+fun int LineLength=2350(int line,)
+
+# Highlight the characters at two positions.
+fun void BraceHighlight=2351(position pos1, position pos2)
+
+# Use specified indicator to highlight matching braces instead of changing their style.
+fun void BraceHighlightIndicator=2498(bool useBraceHighlightIndicator, int indicator)
+
+# Highlight the character at a position indicating there is no matching brace.
+fun void BraceBadLight=2352(position pos,)
+
+# Use specified indicator to highlight non matching brace instead of changing its style.
+fun void BraceBadLightIndicator=2499(bool useBraceBadLightIndicator, int indicator)
+
+# Find the position of a matching brace or INVALID_POSITION if no match.
+fun position BraceMatch=2353(position pos,)
+
+# Are the end of line characters visible?
+get bool GetViewEOL=2355(,)
+
+# Make the end of line characters visible or invisible.
+set void SetViewEOL=2356(bool visible,)
+
+# Retrieve a pointer to the document object.
+get int GetDocPointer=2357(,)
+
+# Change the document object used.
+set void SetDocPointer=2358(, int pointer)
+
+# Set which document modification events are sent to the container.
+set void SetModEventMask=2359(int mask,)
+
+enu EdgeVisualStyle=EDGE_
+val EDGE_NONE=0
+val EDGE_LINE=1
+val EDGE_BACKGROUND=2
+
+# Retrieve the column number which text should be kept within.
+get int GetEdgeColumn=2360(,)
+
+# Set the column number of the edge.
+# If text goes past the edge then it is highlighted.
+set void SetEdgeColumn=2361(int column,)
+
+# Retrieve the edge highlight mode.
+get int GetEdgeMode=2362(,)
+
+# The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
+# goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
+set void SetEdgeMode=2363(int mode,)
+
+# Retrieve the colour used in edge indication.
+get colour GetEdgeColour=2364(,)
+
+# Change the colour used in edge indication.
+set void SetEdgeColour=2365(colour edgeColour,)
+
+# Sets the current caret position to be the search anchor.
+fun void SearchAnchor=2366(,)
+
+# Find some text starting at the search anchor.
+# Does not ensure the selection is visible.
+fun int SearchNext=2367(int flags, string text)
+
+# Find some text starting at the search anchor and moving backwards.
+# Does not ensure the selection is visible.
+fun int SearchPrev=2368(int flags, string text)
+
+# Retrieves the number of lines completely visible.
+get int LinesOnScreen=2370(,)
+
+# Set whether a pop up menu is displayed automatically when the user presses
+# the wrong mouse button.
+fun void UsePopUp=2371(bool allowPopUp,)
+
+# Is the selection rectangular? The alternative is the more common stream selection.
+get bool SelectionIsRectangle=2372(,)
+
+# Set the zoom level. This number of points is added to the size of all fonts.
+# It may be positive to magnify or negative to reduce.
+set void SetZoom=2373(int zoom,)
+# Retrieve the zoom level.
+get int GetZoom=2374(,)
+
+# Create a new document object.
+# Starts with reference count of 1 and not selected into editor.
+fun int CreateDocument=2375(,)
+# Extend life of document.
+fun void AddRefDocument=2376(, int doc)
+# Release a reference to the document, deleting document if it fades to black.
+fun void ReleaseDocument=2377(, int doc)
+
+# Get which document modification events are sent to the container.
+get int GetModEventMask=2378(,)
+
+# Change internal focus flag.
+set void SetFocus=2380(bool focus,)
+# Get internal focus flag.
+get bool GetFocus=2381(,)
+
+enu Status=SC_STATUS_
+val SC_STATUS_OK=0
+val SC_STATUS_FAILURE=1
+val SC_STATUS_BADALLOC=2
+val SC_STATUS_WARN_START=1000
+val SC_STATUS_WARN_REGEX=1001
+
+# Change error status - 0 = OK.
+set void SetStatus=2382(int statusCode,)
+# Get error status.
+get int GetStatus=2383(,)
+
+# Set whether the mouse is captured when its button is pressed.
+set void SetMouseDownCaptures=2384(bool captures,)
+# Get whether mouse gets captured.
+get bool GetMouseDownCaptures=2385(,)
+
+enu CursorShape=SC_CURSOR
+val SC_CURSORNORMAL=-1
+val SC_CURSORARROW=2
+val SC_CURSORWAIT=4
+val SC_CURSORREVERSEARROW=7
+# Sets the cursor to one of the SC_CURSOR* values.
+set void SetCursor=2386(int cursorType,)
+# Get cursor type.
+get int GetCursor=2387(,)
+
+# Change the way control characters are displayed:
+# If symbol is < 32, keep the drawn way, else, use the given character.
+set void SetControlCharSymbol=2388(int symbol,)
+# Get the way control characters are displayed.
+get int GetControlCharSymbol=2389(,)
+
+# Move to the previous change in capitalisation.
+fun void WordPartLeft=2390(,)
+# Move to the previous change in capitalisation extending selection
+# to new caret position.
+fun void WordPartLeftExtend=2391(,)
+# Move to the change next in capitalisation.
+fun void WordPartRight=2392(,)
+# Move to the next change in capitalisation extending selection
+# to new caret position.
+fun void WordPartRightExtend=2393(,)
+
+# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
+val VISIBLE_SLOP=0x01
+val VISIBLE_STRICT=0x04
+# Set the way the display area is determined when a particular line
+# is to be moved to by Find, FindNext, GotoLine, etc.
+fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop)
+
+# Delete back from the current position to the start of the line.
+fun void DelLineLeft=2395(,)
+
+# Delete forwards from the current position to the end of the line.
+fun void DelLineRight=2396(,)
+
+# Get and Set the xOffset (ie, horizontal scroll position).
+set void SetXOffset=2397(int newOffset,)
+get int GetXOffset=2398(,)
+
+# Set the last x chosen value to be the caret x position.
+fun void ChooseCaretX=2399(,)
+
+# Set the focus to this Scintilla widget.
+fun void GrabFocus=2400(,)
+
+enu CaretPolicy=CARET_
+# Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
+# If CARET_SLOP is set, we can define a slop value: caretSlop.
+# This value defines an unwanted zone (UZ) where the caret is... unwanted.
+# This zone is defined as a number of pixels near the vertical margins,
+# and as a number of lines near the horizontal margins.
+# By keeping the caret away from the edges, it is seen within its context,
+# so it is likely that the identifier that the caret is on can be completely seen,
+# and that the current line is seen with some of the lines following it which are
+# often dependent on that line.
+val CARET_SLOP=0x01
+# If CARET_STRICT is set, the policy is enforced... strictly.
+# The caret is centred on the display if slop is not set,
+# and cannot go in the UZ if slop is set.
+val CARET_STRICT=0x04
+# If CARET_JUMPS is set, the display is moved more energetically
+# so the caret can move in the same direction longer before the policy is applied again.
+val CARET_JUMPS=0x10
+# If CARET_EVEN is not set, instead of having symmetrical UZs,
+# the left and bottom UZs are extended up to right and top UZs respectively.
+# This way, we favour the displaying of useful information: the begining of lines,
+# where most code reside, and the lines after the caret, eg. the body of a function.
+val CARET_EVEN=0x08
+
+# Set the way the caret is kept visible when going sideways.
+# The exclusion zone is given in pixels.
+fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop)
+
+# Set the way the line the caret is on is kept visible.
+# The exclusion zone is given in lines.
+fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop)
+
+# Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
+set void SetPrintWrapMode=2406(int mode,)
+
+# Is printing line wrapped?
+get int GetPrintWrapMode=2407(,)
+
+# Set a fore colour for active hotspots.
+set void SetHotspotActiveFore=2410(bool useSetting, colour fore)
+
+# Get the fore colour for active hotspots.
+get colour GetHotspotActiveFore=2494(,)
+
+# Set a back colour for active hotspots.
+set void SetHotspotActiveBack=2411(bool useSetting, colour back)
+
+# Get the back colour for active hotspots.
+get colour GetHotspotActiveBack=2495(,)
+
+# Enable / Disable underlining active hotspots.
+set void SetHotspotActiveUnderline=2412(bool underline,)
+
+# Get whether underlining for active hotspots.
+get bool GetHotspotActiveUnderline=2496(,)
+
+# Limit hotspots to single line so hotspots on two lines don't merge.
+set void SetHotspotSingleLine=2421(bool singleLine,)
+
+# Get the HotspotSingleLine property
+get bool GetHotspotSingleLine=2497(,)
+
+# Move caret between paragraphs (delimited by empty lines).
+fun void ParaDown=2413(,)
+fun void ParaDownExtend=2414(,)
+fun void ParaUp=2415(,)
+fun void ParaUpExtend=2416(,)
+
+# Given a valid document position, return the previous position taking code
+# page into account. Returns 0 if passed 0.
+fun position PositionBefore=2417(position pos,)
+
+# Given a valid document position, return the next position taking code
+# page into account. Maximum value returned is the last position in the document.
+fun position PositionAfter=2418(position pos,)
+
+# Given a valid document position, return a position that differs in a number
+# of characters. Returned value is always between 0 and last position in document.
+fun position PositionRelative=2670(position pos, int relative)
+
+# Copy a range of text to the clipboard. Positions are clipped into the document.
+fun void CopyRange=2419(position start, position end)
+
+# Copy argument text to the clipboard.
+fun void CopyText=2420(int length, string text)
+
+enu SelectionMode=SC_SEL_
+val SC_SEL_STREAM=0
+val SC_SEL_RECTANGLE=1
+val SC_SEL_LINES=2
+val SC_SEL_THIN=3
+
+# Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
+# by lines (SC_SEL_LINES).
+set void SetSelectionMode=2422(int mode,)
+
+# Get the mode of the current selection.
+get int GetSelectionMode=2423(,)
+
+# Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
+fun position GetLineSelStartPosition=2424(int line,)
+
+# Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
+fun position GetLineSelEndPosition=2425(int line,)
+
+## RectExtended rectangular selection moves
+# Move caret down one line, extending rectangular selection to new caret position.
+fun void LineDownRectExtend=2426(,)
+
+# Move caret up one line, extending rectangular selection to new caret position.
+fun void LineUpRectExtend=2427(,)
+
+# Move caret left one character, extending rectangular selection to new caret position.
+fun void CharLeftRectExtend=2428(,)
+
+# Move caret right one character, extending rectangular selection to new caret position.
+fun void CharRightRectExtend=2429(,)
+
+# Move caret to first position on line, extending rectangular selection to new caret position.
+fun void HomeRectExtend=2430(,)
+
+# Move caret to before first visible character on line.
+# If already there move to first character on line.
+# In either case, extend rectangular selection to new caret position.
+fun void VCHomeRectExtend=2431(,)
+
+# Move caret to last position on line, extending rectangular selection to new caret position.
+fun void LineEndRectExtend=2432(,)
+
+# Move caret one page up, extending rectangular selection to new caret position.
+fun void PageUpRectExtend=2433(,)
+
+# Move caret one page down, extending rectangular selection to new caret position.
+fun void PageDownRectExtend=2434(,)
+
+
+# Move caret to top of page, or one page up if already at top of page.
+fun void StutteredPageUp=2435(,)
+
+# Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
+fun void StutteredPageUpExtend=2436(,)
+
+# Move caret to bottom of page, or one page down if already at bottom of page.
+fun void StutteredPageDown=2437(,)
+
+# Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
+fun void StutteredPageDownExtend=2438(,)
+
+
+# Move caret left one word, position cursor at end of word.
+fun void WordLeftEnd=2439(,)
+
+# Move caret left one word, position cursor at end of word, extending selection to new caret position.
+fun void WordLeftEndExtend=2440(,)
+
+# Move caret right one word, position cursor at end of word.
+fun void WordRightEnd=2441(,)
+
+# Move caret right one word, position cursor at end of word, extending selection to new caret position.
+fun void WordRightEndExtend=2442(,)
+
+# Set the set of characters making up whitespace for when moving or selecting by word.
+# Should be called after SetWordChars.
+set void SetWhitespaceChars=2443(, string characters)
+
+# Get the set of characters making up whitespace for when moving or selecting by word.
+get int GetWhitespaceChars=2647(, stringresult characters)
+
+# Set the set of characters making up punctuation characters
+# Should be called after SetWordChars.
+set void SetPunctuationChars=2648(, string characters)
+
+# Get the set of characters making up punctuation characters
+get int GetPunctuationChars=2649(, stringresult characters)
+
+# Reset the set of characters for whitespace and word characters to the defaults.
+fun void SetCharsDefault=2444(,)
+
+# Get currently selected item position in the auto-completion list
+get int AutoCGetCurrent=2445(,)
+
+# Get currently selected item text in the auto-completion list
+# Returns the length of the item text
+# Result is NUL-terminated.
+get int AutoCGetCurrentText=2610(, stringresult s)
+
+enu CaseInsensitiveBehaviour=SC_CASEINSENSITIVEBEHAVIOUR_
+val SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE=0
+val SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE=1
+
+# Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
+set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,)
+
+# Get auto-completion case insensitive behaviour.
+get int AutoCGetCaseInsensitiveBehaviour=2635(,)
+
+enu MultiAutoComplete=SC_MULTIAUTOC_
+val SC_MULTIAUTOC_ONCE=0
+val SC_MULTIAUTOC_EACH=1
+
+# Change the effect of autocompleting when there are multiple selections.
+set void AutoCSetMulti=2636(int multi,)
+
+# Retrieve the effect of autocompleting when there are multiple selections..
+get int AutoCGetMulti=2637(,)
+
+enu Ordering=SC_ORDER_
+val SC_ORDER_PRESORTED=0
+val SC_ORDER_PERFORMSORT=1
+val SC_ORDER_CUSTOM=2
+
+# Set the way autocompletion lists are ordered.
+set void AutoCSetOrder=2660(int order,)
+
+# Get the way autocompletion lists are ordered.
+get int AutoCGetOrder=2661(,)
+
+# Enlarge the document to a particular size of text bytes.
+fun void Allocate=2446(int bytes,)
+
+# Returns the target converted to UTF8.
+# Return the length in bytes.
+fun int TargetAsUTF8=2447(, stringresult s)
+
+# Set the length of the utf8 argument for calling EncodedFromUTF8.
+# Set to -1 and the string will be measured to the first nul.
+fun void SetLengthForEncode=2448(int bytes,)
+
+# Translates a UTF8 string into the document encoding.
+# Return the length of the result in bytes.
+# On error return 0.
+fun int EncodedFromUTF8=2449(string utf8, stringresult encoded)
+
+# Find the position of a column on a line taking into account tabs and
+# multi-byte characters. If beyond end of line, return line end position.
+fun int FindColumn=2456(int line, int column)
+
+# Can the caret preferred x position only be changed by explicit movement commands?
+get int GetCaretSticky=2457(,)
+
+# Stop the caret preferred x position changing when the user types.
+set void SetCaretSticky=2458(int useCaretStickyBehaviour,)
+
+enu CaretSticky=SC_CARETSTICKY_
+val SC_CARETSTICKY_OFF=0
+val SC_CARETSTICKY_ON=1
+val SC_CARETSTICKY_WHITESPACE=2
+
+# Switch between sticky and non-sticky: meant to be bound to a key.
+fun void ToggleCaretSticky=2459(,)
+
+# Enable/Disable convert-on-paste for line endings
+set void SetPasteConvertEndings=2467(bool convert,)
+
+# Get convert-on-paste setting
+get bool GetPasteConvertEndings=2468(,)
+
+# Duplicate the selection. If selection empty duplicate the line containing the caret.
+fun void SelectionDuplicate=2469(,)
+
+val SC_ALPHA_TRANSPARENT=0
+val SC_ALPHA_OPAQUE=255
+val SC_ALPHA_NOALPHA=256
+
+# Set background alpha of the caret line.
+set void SetCaretLineBackAlpha=2470(int alpha,)
+
+# Get the background alpha of the caret line.
+get int GetCaretLineBackAlpha=2471(,)
+
+enu CaretStyle=CARETSTYLE_
+val CARETSTYLE_INVISIBLE=0
+val CARETSTYLE_LINE=1
+val CARETSTYLE_BLOCK=2
+
+# Set the style of the caret to be drawn.
+set void SetCaretStyle=2512(int caretStyle,)
+
+# Returns the current style of the caret.
+get int GetCaretStyle=2513(,)
+
+# Set the indicator used for IndicatorFillRange and IndicatorClearRange
+set void SetIndicatorCurrent=2500(int indicator,)
+
+# Get the current indicator
+get int GetIndicatorCurrent=2501(,)
+
+# Set the value used for IndicatorFillRange
+set void SetIndicatorValue=2502(int value,)
+
+# Get the current indicator value
+get int GetIndicatorValue=2503(,)
+
+# Turn a indicator on over a range.
+fun void IndicatorFillRange=2504(int position, int fillLength)
+
+# Turn a indicator off over a range.
+fun void IndicatorClearRange=2505(int position, int clearLength)
+
+# Are any indicators present at position?
+fun int IndicatorAllOnFor=2506(int position,)
+
+# What value does a particular indicator have at at a position?
+fun int IndicatorValueAt=2507(int indicator, int position)
+
+# Where does a particular indicator start?
+fun int IndicatorStart=2508(int indicator, int position)
+
+# Where does a particular indicator end?
+fun int IndicatorEnd=2509(int indicator, int position)
+
+# Set number of entries in position cache
+set void SetPositionCache=2514(int size,)
+
+# How many entries are allocated to the position cache?
+get int GetPositionCache=2515(,)
+
+# Copy the selection, if selection empty copy the line with the caret
+fun void CopyAllowLine=2519(,)
+
+# Compact the document buffer and return a read-only pointer to the
+# characters in the document.
+get int GetCharacterPointer=2520(,)
+
+# Return a read-only pointer to a range of characters in the document.
+# May move the gap so that the range is contiguous, but will only move up
+# to rangeLength bytes.
+get int GetRangePointer=2643(int position, int rangeLength)
+
+# Return a position which, to avoid performance costs, should not be within
+# the range of a call to GetRangePointer.
+get position GetGapPosition=2644(,)
+
+# Set the alpha fill colour of the given indicator.
+set void IndicSetAlpha=2523(int indicator, int alpha)
+
+# Get the alpha fill colour of the given indicator.
+get int IndicGetAlpha=2524(int indicator,)
+
+# Set the alpha outline colour of the given indicator.
+set void IndicSetOutlineAlpha=2558(int indicator, int alpha)
+
+# Get the alpha outline colour of the given indicator.
+get int IndicGetOutlineAlpha=2559(int indicator,)
+
+# Set extra ascent for each line
+set void SetExtraAscent=2525(int extraAscent,)
+
+# Get extra ascent for each line
+get int GetExtraAscent=2526(,)
+
+# Set extra descent for each line
+set void SetExtraDescent=2527(int extraDescent,)
+
+# Get extra descent for each line
+get int GetExtraDescent=2528(,)
+
+# Which symbol was defined for markerNumber with MarkerDefine
+fun int MarkerSymbolDefined=2529(int markerNumber,)
+
+# Set the text in the text margin for a line
+set void MarginSetText=2530(int line, string text)
+
+# Get the text in the text margin for a line
+get int MarginGetText=2531(int line, stringresult text)
+
+# Set the style number for the text margin for a line
+set void MarginSetStyle=2532(int line, int style)
+
+# Get the style number for the text margin for a line
+get int MarginGetStyle=2533(int line,)
+
+# Set the style in the text margin for a line
+set void MarginSetStyles=2534(int line, string styles)
+
+# Get the styles in the text margin for a line
+get int MarginGetStyles=2535(int line, stringresult styles)
+
+# Clear the margin text on all lines
+fun void MarginTextClearAll=2536(,)
+
+# Get the start of the range of style numbers used for margin text
+set void MarginSetStyleOffset=2537(int style,)
+
+# Get the start of the range of style numbers used for margin text
+get int MarginGetStyleOffset=2538(,)
+
+enu MarginOption=SC_MARGINOPTION_
+val SC_MARGINOPTION_NONE=0
+val SC_MARGINOPTION_SUBLINESELECT=1
+
+# Set the margin options.
+set void SetMarginOptions=2539(int marginOptions,)
+
+# Get the margin options.
+get int GetMarginOptions=2557(,)
+
+# Set the annotation text for a line
+set void AnnotationSetText=2540(int line, string text)
+
+# Get the annotation text for a line
+get int AnnotationGetText=2541(int line, stringresult text)
+
+# Set the style number for the annotations for a line
+set void AnnotationSetStyle=2542(int line, int style)
+
+# Get the style number for the annotations for a line
+get int AnnotationGetStyle=2543(int line,)
+
+# Set the annotation styles for a line
+set void AnnotationSetStyles=2544(int line, string styles)
+
+# Get the annotation styles for a line
+get int AnnotationGetStyles=2545(int line, stringresult styles)
+
+# Get the number of annotation lines for a line
+get int AnnotationGetLines=2546(int line,)
+
+# Clear the annotations from all lines
+fun void AnnotationClearAll=2547(,)
+
+enu AnnotationVisible=ANNOTATION_
+val ANNOTATION_HIDDEN=0
+val ANNOTATION_STANDARD=1
+val ANNOTATION_BOXED=2
+val ANNOTATION_INDENTED=3
+
+# Set the visibility for the annotations for a view
+set void AnnotationSetVisible=2548(int visible,)
+
+# Get the visibility for the annotations for a view
+get int AnnotationGetVisible=2549(,)
+
+# Get the start of the range of style numbers used for annotations
+set void AnnotationSetStyleOffset=2550(int style,)
+
+# Get the start of the range of style numbers used for annotations
+get int AnnotationGetStyleOffset=2551(,)
+
+# Release all extended (>255) style numbers
+fun void ReleaseAllExtendedStyles=2552(,)
+
+# Allocate some extended (>255) style numbers and return the start of the range
+fun int AllocateExtendedStyles=2553(int numberStyles,)
+
+val UNDO_MAY_COALESCE=1
+
+# Add a container action to the undo stack
+fun void AddUndoAction=2560(int token, int flags)
+
+# Find the position of a character from a point within the window.
+fun position CharPositionFromPoint=2561(int x, int y)
+
+# Find the position of a character from a point within the window.
+# Return INVALID_POSITION if not close to text.
+fun position CharPositionFromPointClose=2562(int x, int y)
+
+# Set whether switching to rectangular mode while selecting with the mouse is allowed.
+set void SetMouseSelectionRectangularSwitch=2668(bool mouseSelectionRectangularSwitch,)
+
+# Whether switching to rectangular mode while selecting with the mouse is allowed.
+get bool GetMouseSelectionRectangularSwitch=2669(,)
+
+# Set whether multiple selections can be made
+set void SetMultipleSelection=2563(bool multipleSelection,)
+
+# Whether multiple selections can be made
+get bool GetMultipleSelection=2564(,)
+
+# Set whether typing can be performed into multiple selections
+set void SetAdditionalSelectionTyping=2565(bool additionalSelectionTyping,)
+
+# Whether typing can be performed into multiple selections
+get bool GetAdditionalSelectionTyping=2566(,)
+
+# Set whether additional carets will blink
+set void SetAdditionalCaretsBlink=2567(bool additionalCaretsBlink,)
+
+# Whether additional carets will blink
+get bool GetAdditionalCaretsBlink=2568(,)
+
+# Set whether additional carets are visible
+set void SetAdditionalCaretsVisible=2608(bool additionalCaretsBlink,)
+
+# Whether additional carets are visible
+get bool GetAdditionalCaretsVisible=2609(,)
+
+# How many selections are there?
+get int GetSelections=2570(,)
+
+# Is every selected range empty?
+get bool GetSelectionEmpty=2650(,)
+
+# Clear selections to a single empty stream selection
+fun void ClearSelections=2571(,)
+
+# Set a simple selection
+fun int SetSelection=2572(int caret, int anchor)
+
+# Add a selection
+fun int AddSelection=2573(int caret, int anchor)
+
+# Drop one selection
+fun void DropSelectionN=2671(int selection,)
+
+# Set the main selection
+set void SetMainSelection=2574(int selection,)
+
+# Which selection is the main selection
+get int GetMainSelection=2575(,)
+
+set void SetSelectionNCaret=2576(int selection, position pos)
+get position GetSelectionNCaret=2577(int selection,)
+set void SetSelectionNAnchor=2578(int selection, position posAnchor)
+get position GetSelectionNAnchor=2579(int selection,)
+set void SetSelectionNCaretVirtualSpace=2580(int selection, int space)
+get int GetSelectionNCaretVirtualSpace=2581(int selection,)
+set void SetSelectionNAnchorVirtualSpace=2582(int selection, int space)
+get int GetSelectionNAnchorVirtualSpace=2583(int selection,)
+
+# Sets the position that starts the selection - this becomes the anchor.
+set void SetSelectionNStart=2584(int selection, position pos)
+
+# Returns the position at the start of the selection.
+get position GetSelectionNStart=2585(int selection,)
+
+# Sets the position that ends the selection - this becomes the currentPosition.
+set void SetSelectionNEnd=2586(int selection, position pos)
+
+# Returns the position at the end of the selection.
+get position GetSelectionNEnd=2587(int selection,)
+
+set void SetRectangularSelectionCaret=2588(position pos,)
+get position GetRectangularSelectionCaret=2589(,)
+set void SetRectangularSelectionAnchor=2590(position posAnchor,)
+get position GetRectangularSelectionAnchor=2591(,)
+set void SetRectangularSelectionCaretVirtualSpace=2592(int space,)
+get int GetRectangularSelectionCaretVirtualSpace=2593(,)
+set void SetRectangularSelectionAnchorVirtualSpace=2594(int space,)
+get int GetRectangularSelectionAnchorVirtualSpace=2595(,)
+
+enu VirtualSpace=SCVS_
+val SCVS_NONE=0
+val SCVS_RECTANGULARSELECTION=1
+val SCVS_USERACCESSIBLE=2
+
+set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,)
+get int GetVirtualSpaceOptions=2597(,)
+
+# On GTK+, allow selecting the modifier key to use for mouse-based
+# rectangular selection. Often the window manager requires Alt+Mouse Drag
+# for moving windows.
+# Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
+
+set void SetRectangularSelectionModifier=2598(int modifier,)
+
+# Get the modifier key used for rectangular selection.
+get int GetRectangularSelectionModifier=2599(,)
+
+# Set the foreground colour of additional selections.
+# Must have previously called SetSelFore with non-zero first argument for this to have an effect.
+set void SetAdditionalSelFore=2600(colour fore,)
+
+# Set the background colour of additional selections.
+# Must have previously called SetSelBack with non-zero first argument for this to have an effect.
+set void SetAdditionalSelBack=2601(colour back,)
+
+# Set the alpha of the selection.
+set void SetAdditionalSelAlpha=2602(int alpha,)
+
+# Get the alpha of the selection.
+get int GetAdditionalSelAlpha=2603(,)
+
+# Set the foreground colour of additional carets.
+set void SetAdditionalCaretFore=2604(colour fore,)
+
+# Get the foreground colour of additional carets.
+get colour GetAdditionalCaretFore=2605(,)
+
+# Set the main selection to the next selection.
+fun void RotateSelection=2606(,)
+
+# Swap that caret and anchor of the main selection.
+fun void SwapMainAnchorCaret=2607(,)
+
+# Indicate that the internal state of a lexer has changed over a range and therefore
+# there may be a need to redraw.
+fun int ChangeLexerState=2617(position start, position end)
+
+# Find the next line at or after lineStart that is a contracted fold header line.
+# Return -1 when no more lines.
+fun int ContractedFoldNext=2618(int lineStart,)
+
+# Centre current line in window.
+fun void VerticalCentreCaret=2619(,)
+
+# Move the selected lines up one line, shifting the line above after the selection
+fun void MoveSelectedLinesUp=2620(,)
+
+# Move the selected lines down one line, shifting the line below before the selection
+fun void MoveSelectedLinesDown=2621(,)
+
+# Set the identifier reported as idFrom in notification messages.
+set void SetIdentifier=2622(int identifier,)
+
+# Get the identifier.
+get int GetIdentifier=2623(,)
+
+# Set the width for future RGBA image data.
+set void RGBAImageSetWidth=2624(int width,)
+
+# Set the height for future RGBA image data.
+set void RGBAImageSetHeight=2625(int height,)
+
+# Set the scale factor in percent for future RGBA image data.
+set void RGBAImageSetScale=2651(int scalePercent,)
+
+# Define a marker from RGBA data.
+# It has the width and height from RGBAImageSetWidth/Height
+fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels)
+
+# Register an RGBA image for use in autocompletion lists.
+# It has the width and height from RGBAImageSetWidth/Height
+fun void RegisterRGBAImage=2627(int type, string pixels)
+
+# Scroll to start of document.
+fun void ScrollToStart=2628(,)
+
+# Scroll to end of document.
+fun void ScrollToEnd=2629(,)
+
+val SC_TECHNOLOGY_DEFAULT=0
+val SC_TECHNOLOGY_DIRECTWRITE=1
+val SC_TECHNOLOGY_DIRECTWRITERETAIN=2
+val SC_TECHNOLOGY_DIRECTWRITEDC=3
+
+# Set the technology used.
+set void SetTechnology=2630(int technology,)
+
+# Get the tech.
+get int GetTechnology=2631(,)
+
+# Create an ILoader*.
+fun int CreateLoader=2632(int bytes,)
+
+# On OS X, show a find indicator.
+fun void FindIndicatorShow=2640(position start, position end)
+
+# On OS X, flash a find indicator, then fade out.
+fun void FindIndicatorFlash=2641(position start, position end)
+
+# On OS X, hide the find indicator.
+fun void FindIndicatorHide=2642(,)
+
+# Move caret to before first visible character on display line.
+# If already there move to first character on display line.
+fun void VCHomeDisplay=2652(,)
+
+# Like VCHomeDisplay but extending selection to new caret position.
+fun void VCHomeDisplayExtend=2653(,)
+
+# Is the caret line always visible?
+get bool GetCaretLineVisibleAlways=2654(,)
+
+# Sets the caret line to always visible.
+set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,)
+
+# Line end types which may be used in addition to LF, CR, and CRLF
+# SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator,
+# U+2029 Paragraph Separator, and U+0085 Next Line
+enu LineEndType=SC_LINE_END_TYPE_
+val SC_LINE_END_TYPE_DEFAULT=0
+val SC_LINE_END_TYPE_UNICODE=1
+
+# Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding.
+set void SetLineEndTypesAllowed=2656(int lineEndBitSet,)
+
+# Get the line end types currently allowed.
+get int GetLineEndTypesAllowed=2657(,)
+
+# Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation.
+get int GetLineEndTypesActive=2658(,)
+
+# Set the way a character is drawn.
+set void SetRepresentation=2665(string encodedCharacter, string representation)
+
+# Set the way a character is drawn.
+# Result is NUL-terminated.
+get int GetRepresentation=2666(string encodedCharacter, stringresult representation)
+
+# Remove a character representation.
+fun void ClearRepresentation=2667(string encodedCharacter,)
+
+# Start notifying the container of all key presses and commands.
+fun void StartRecord=3001(,)
+
+# Stop notifying the container of all key presses and commands.
+fun void StopRecord=3002(,)
+
+# Set the lexing language of the document.
+set void SetLexer=4001(int lexer,)
+
+# Retrieve the lexing language of the document.
+get int GetLexer=4002(,)
+
+# Colourise a segment of the document using the current lexing language.
+fun void Colourise=4003(position start, position end)
+
+# Set up a value that may be used by a lexer for some optional feature.
+set void SetProperty=4004(string key, string value)
+
+# Maximum value of keywordSet parameter of SetKeyWords.
+val KEYWORDSET_MAX=8
+
+# Set up the key words used by the lexer.
+set void SetKeyWords=4005(int keywordSet, string keyWords)
+
+# Set the lexing language of the document based on string name.
+set void SetLexerLanguage=4006(, string language)
+
+# Load a lexer library (dll / so).
+fun void LoadLexerLibrary=4007(, string path)
+
+# Retrieve a "property" value previously set with SetProperty.
+# Result is NUL-terminated.
+get int GetProperty=4008(string key, stringresult buf)
+
+# Retrieve a "property" value previously set with SetProperty,
+# with "$()" variable replacement on returned buffer.
+# Result is NUL-terminated.
+get int GetPropertyExpanded=4009(string key, stringresult buf)
+
+# Retrieve a "property" value previously set with SetProperty,
+# interpreted as an int AFTER any "$()" variable replacement.
+get int GetPropertyInt=4010(string key,)
+
+# Retrieve the number of bits the current lexer needs for styling.
+get int GetStyleBitsNeeded=4011(,)
+
+# Retrieve the name of the lexer.
+# Return the length of the text.
+# Result is NUL-terminated.
+get int GetLexerLanguage=4012(, stringresult text)
+
+# For private communication between an application and a known lexer.
+fun int PrivateLexerCall=4013(int operation, int pointer)
+
+# Retrieve a '\n' separated list of properties understood by the current lexer.
+# Result is NUL-terminated.
+fun int PropertyNames=4014(, stringresult names)
+
+enu TypeProperty=SC_TYPE_
+val SC_TYPE_BOOLEAN=0
+val SC_TYPE_INTEGER=1
+val SC_TYPE_STRING=2
+
+# Retrieve the type of a property.
+fun int PropertyType=4015(string name,)
+
+# Describe a property.
+# Result is NUL-terminated.
+fun int DescribeProperty=4016(string name, stringresult description)
+
+# Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
+# Result is NUL-terminated.
+fun int DescribeKeyWordSets=4017(, stringresult descriptions)
+
+# Bit set of LineEndType enumertion for which line ends beyond the standard
+# LF, CR, and CRLF are supported by the lexer.
+get int GetLineEndTypesSupported=4018(,)
+
+# Allocate a set of sub styles for a particular base style, returning start of range
+fun int AllocateSubStyles=4020(int styleBase, int numberStyles)
+
+# The starting style number for the sub styles associated with a base style
+get int GetSubStylesStart=4021(int styleBase,)
+
+# The number of sub styles associated with a base style
+get int GetSubStylesLength=4022(int styleBase,)
+
+# For a sub style, return the base style, else return the argument.
+get int GetStyleFromSubStyle=4027(int subStyle,)
+
+# For a secondary style, return the primary style, else return the argument.
+get int GetPrimaryStyleFromStyle=4028(int style,)
+
+# Free allocated sub styles
+fun void FreeSubStyles=4023(,)
+
+# Set the identifiers that are shown in a particular style
+set void SetIdentifiers=4024(int style, string identifiers)
+
+# Where styles are duplicated by a feature such as active/inactive code
+# return the distance between the two types.
+get int DistanceToSecondaryStyles=4025(,)
+
+# Get the set of base styles that can be extended with sub styles
+# Result is NUL-terminated.
+get int GetSubStyleBases=4026(, stringresult styles)
+
+# Notifications
+# Type of modification and the action which caused the modification.
+# These are defined as a bit mask to make it easy to specify which notifications are wanted.
+# One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
+enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_MULTISTEPUNDOREDO SC_LASTSTEPINUNDOREDO SC_MULTILINEUNDOREDO SC_STARTACTION SC_MODEVENTMASKALL
+val SC_MOD_INSERTTEXT=0x1
+val SC_MOD_DELETETEXT=0x2
+val SC_MOD_CHANGESTYLE=0x4
+val SC_MOD_CHANGEFOLD=0x8
+val SC_PERFORMED_USER=0x10
+val SC_PERFORMED_UNDO=0x20
+val SC_PERFORMED_REDO=0x40
+val SC_MULTISTEPUNDOREDO=0x80
+val SC_LASTSTEPINUNDOREDO=0x100
+val SC_MOD_CHANGEMARKER=0x200
+val SC_MOD_BEFOREINSERT=0x400
+val SC_MOD_BEFOREDELETE=0x800
+val SC_MULTILINEUNDOREDO=0x1000
+val SC_STARTACTION=0x2000
+val SC_MOD_CHANGEINDICATOR=0x4000
+val SC_MOD_CHANGELINESTATE=0x8000
+val SC_MOD_CHANGEMARGIN=0x10000
+val SC_MOD_CHANGEANNOTATION=0x20000
+val SC_MOD_CONTAINER=0x40000
+val SC_MOD_LEXERSTATE=0x80000
+val SC_MOD_INSERTCHECK=0x100000
+val SC_MOD_CHANGETABSTOPS=0x200000
+val SC_MODEVENTMASKALL=0x3FFFFF
+
+enu Update=SC_UPDATE_
+val SC_UPDATE_CONTENT=0x1
+val SC_UPDATE_SELECTION=0x2
+val SC_UPDATE_V_SCROLL=0x4
+val SC_UPDATE_H_SCROLL=0x8
+
+# For compatibility, these go through the COMMAND notification rather than NOTIFY
+# and should have had exactly the same values as the EN_* constants.
+# Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_*
+# As clients depend on these constants, this will not be changed.
+val SCEN_CHANGE=768
+val SCEN_SETFOCUS=512
+val SCEN_KILLFOCUS=256
+
+# Symbolic key codes and modifier flags.
+# ASCII and other printable characters below 256.
+# Extended keys above 300.
+
+enu Keys=SCK_
+val SCK_DOWN=300
+val SCK_UP=301
+val SCK_LEFT=302
+val SCK_RIGHT=303
+val SCK_HOME=304
+val SCK_END=305
+val SCK_PRIOR=306
+val SCK_NEXT=307
+val SCK_DELETE=308
+val SCK_INSERT=309
+val SCK_ESCAPE=7
+val SCK_BACK=8
+val SCK_TAB=9
+val SCK_RETURN=13
+val SCK_ADD=310
+val SCK_SUBTRACT=311
+val SCK_DIVIDE=312
+val SCK_WIN=313
+val SCK_RWIN=314
+val SCK_MENU=315
+
+enu KeyMod=SCMOD_
+val SCMOD_NORM=0
+val SCMOD_SHIFT=1
+val SCMOD_CTRL=2
+val SCMOD_ALT=4
+val SCMOD_SUPER=8
+val SCMOD_META=16
+
+################################################
+# For SciLexer.h
+enu Lexer=SCLEX_
+val SCLEX_CONTAINER=0
+val SCLEX_NULL=1
+val SCLEX_PYTHON=2
+val SCLEX_CPP=3
+val SCLEX_HTML=4
+val SCLEX_XML=5
+val SCLEX_PERL=6
+val SCLEX_SQL=7
+val SCLEX_VB=8
+val SCLEX_PROPERTIES=9
+val SCLEX_ERRORLIST=10
+val SCLEX_MAKEFILE=11
+val SCLEX_BATCH=12
+val SCLEX_XCODE=13
+val SCLEX_LATEX=14
+val SCLEX_LUA=15
+val SCLEX_DIFF=16
+val SCLEX_CONF=17
+val SCLEX_PASCAL=18
+val SCLEX_AVE=19
+val SCLEX_ADA=20
+val SCLEX_LISP=21
+val SCLEX_RUBY=22
+val SCLEX_EIFFEL=23
+val SCLEX_EIFFELKW=24
+val SCLEX_TCL=25
+val SCLEX_NNCRONTAB=26
+val SCLEX_BULLANT=27
+val SCLEX_VBSCRIPT=28
+val SCLEX_BAAN=31
+val SCLEX_MATLAB=32
+val SCLEX_SCRIPTOL=33
+val SCLEX_ASM=34
+val SCLEX_CPPNOCASE=35
+val SCLEX_FORTRAN=36
+val SCLEX_F77=37
+val SCLEX_CSS=38
+val SCLEX_POV=39
+val SCLEX_LOUT=40
+val SCLEX_ESCRIPT=41
+val SCLEX_PS=42
+val SCLEX_NSIS=43
+val SCLEX_MMIXAL=44
+val SCLEX_CLW=45
+val SCLEX_CLWNOCASE=46
+val SCLEX_LOT=47
+val SCLEX_YAML=48
+val SCLEX_TEX=49
+val SCLEX_METAPOST=50
+val SCLEX_POWERBASIC=51
+val SCLEX_FORTH=52
+val SCLEX_ERLANG=53
+val SCLEX_OCTAVE=54
+val SCLEX_MSSQL=55
+val SCLEX_VERILOG=56
+val SCLEX_KIX=57
+val SCLEX_GUI4CLI=58
+val SCLEX_SPECMAN=59
+val SCLEX_AU3=60
+val SCLEX_APDL=61
+val SCLEX_BASH=62
+val SCLEX_ASN1=63
+val SCLEX_VHDL=64
+val SCLEX_CAML=65
+val SCLEX_BLITZBASIC=66
+val SCLEX_PUREBASIC=67
+val SCLEX_HASKELL=68
+val SCLEX_PHPSCRIPT=69
+val SCLEX_TADS3=70
+val SCLEX_REBOL=71
+val SCLEX_SMALLTALK=72
+val SCLEX_FLAGSHIP=73
+val SCLEX_CSOUND=74
+val SCLEX_FREEBASIC=75
+val SCLEX_INNOSETUP=76
+val SCLEX_OPAL=77
+val SCLEX_SPICE=78
+val SCLEX_D=79
+val SCLEX_CMAKE=80
+val SCLEX_GAP=81
+val SCLEX_PLM=82
+val SCLEX_PROGRESS=83
+val SCLEX_ABAQUS=84
+val SCLEX_ASYMPTOTE=85
+val SCLEX_R=86
+val SCLEX_MAGIK=87
+val SCLEX_POWERSHELL=88
+val SCLEX_MYSQL=89
+val SCLEX_PO=90
+val SCLEX_TAL=91
+val SCLEX_COBOL=92
+val SCLEX_TACL=93
+val SCLEX_SORCUS=94
+val SCLEX_POWERPRO=95
+val SCLEX_NIMROD=96
+val SCLEX_SML=97
+val SCLEX_MARKDOWN=98
+val SCLEX_TXT2TAGS=99
+val SCLEX_A68K=100
+val SCLEX_MODULA=101
+val SCLEX_COFFEESCRIPT=102
+val SCLEX_TCMD=103
+val SCLEX_AVS=104
+val SCLEX_ECL=105
+val SCLEX_OSCRIPT=106
+val SCLEX_VISUALPROLOG=107
+val SCLEX_LITERATEHASKELL=108
+val SCLEX_STTXT=109
+val SCLEX_KVIRC=110
+val SCLEX_RUST=111
+val SCLEX_DMAP=112
+val SCLEX_AS=113
+val SCLEX_DMIS=114
+val SCLEX_REGISTRY=115
+val SCLEX_BIBTEX=116
+val SCLEX_SREC=117
+val SCLEX_IHEX=118
+val SCLEX_TEHEX=119
+
+# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
+# value assigned in sequence from SCLEX_AUTOMATIC+1.
+val SCLEX_AUTOMATIC=1000
+# Lexical states for SCLEX_PYTHON
+lex Python=SCLEX_PYTHON SCE_P_
+lex Nimrod=SCLEX_NIMROD SCE_P_
+val SCE_P_DEFAULT=0
+val SCE_P_COMMENTLINE=1
+val SCE_P_NUMBER=2
+val SCE_P_STRING=3
+val SCE_P_CHARACTER=4
+val SCE_P_WORD=5
+val SCE_P_TRIPLE=6
+val SCE_P_TRIPLEDOUBLE=7
+val SCE_P_CLASSNAME=8
+val SCE_P_DEFNAME=9
+val SCE_P_OPERATOR=10
+val SCE_P_IDENTIFIER=11
+val SCE_P_COMMENTBLOCK=12
+val SCE_P_STRINGEOL=13
+val SCE_P_WORD2=14
+val SCE_P_DECORATOR=15
+# Lexical states for SCLEX_CPP
+lex Cpp=SCLEX_CPP SCE_C_
+lex BullAnt=SCLEX_BULLANT SCE_C_
+val SCE_C_DEFAULT=0
+val SCE_C_COMMENT=1
+val SCE_C_COMMENTLINE=2
+val SCE_C_COMMENTDOC=3
+val SCE_C_NUMBER=4
+val SCE_C_WORD=5
+val SCE_C_STRING=6
+val SCE_C_CHARACTER=7
+val SCE_C_UUID=8
+val SCE_C_PREPROCESSOR=9
+val SCE_C_OPERATOR=10
+val SCE_C_IDENTIFIER=11
+val SCE_C_STRINGEOL=12
+val SCE_C_VERBATIM=13
+val SCE_C_REGEX=14
+val SCE_C_COMMENTLINEDOC=15
+val SCE_C_WORD2=16
+val SCE_C_COMMENTDOCKEYWORD=17
+val SCE_C_COMMENTDOCKEYWORDERROR=18
+val SCE_C_GLOBALCLASS=19
+val SCE_C_STRINGRAW=20
+val SCE_C_TRIPLEVERBATIM=21
+val SCE_C_HASHQUOTEDSTRING=22
+val SCE_C_PREPROCESSORCOMMENT=23
+val SCE_C_PREPROCESSORCOMMENTDOC=24
+val SCE_C_USERLITERAL=25
+val SCE_C_TASKMARKER=26
+val SCE_C_ESCAPESEQUENCE=27
+# Lexical states for SCLEX_D
+lex D=SCLEX_D SCE_D_
+val SCE_D_DEFAULT=0
+val SCE_D_COMMENT=1
+val SCE_D_COMMENTLINE=2
+val SCE_D_COMMENTDOC=3
+val SCE_D_COMMENTNESTED=4
+val SCE_D_NUMBER=5
+val SCE_D_WORD=6
+val SCE_D_WORD2=7
+val SCE_D_WORD3=8
+val SCE_D_TYPEDEF=9
+val SCE_D_STRING=10
+val SCE_D_STRINGEOL=11
+val SCE_D_CHARACTER=12
+val SCE_D_OPERATOR=13
+val SCE_D_IDENTIFIER=14
+val SCE_D_COMMENTLINEDOC=15
+val SCE_D_COMMENTDOCKEYWORD=16
+val SCE_D_COMMENTDOCKEYWORDERROR=17
+val SCE_D_STRINGB=18
+val SCE_D_STRINGR=19
+val SCE_D_WORD5=20
+val SCE_D_WORD6=21
+val SCE_D_WORD7=22
+# Lexical states for SCLEX_TCL
+lex TCL=SCLEX_TCL SCE_TCL_
+val SCE_TCL_DEFAULT=0
+val SCE_TCL_COMMENT=1
+val SCE_TCL_COMMENTLINE=2
+val SCE_TCL_NUMBER=3
+val SCE_TCL_WORD_IN_QUOTE=4
+val SCE_TCL_IN_QUOTE=5
+val SCE_TCL_OPERATOR=6
+val SCE_TCL_IDENTIFIER=7
+val SCE_TCL_SUBSTITUTION=8
+val SCE_TCL_SUB_BRACE=9
+val SCE_TCL_MODIFIER=10
+val SCE_TCL_EXPAND=11
+val SCE_TCL_WORD=12
+val SCE_TCL_WORD2=13
+val SCE_TCL_WORD3=14
+val SCE_TCL_WORD4=15
+val SCE_TCL_WORD5=16
+val SCE_TCL_WORD6=17
+val SCE_TCL_WORD7=18
+val SCE_TCL_WORD8=19
+val SCE_TCL_COMMENT_BOX=20
+val SCE_TCL_BLOCK_COMMENT=21
+# Lexical states for SCLEX_HTML, SCLEX_XML
+lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
+lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
+val SCE_H_DEFAULT=0
+val SCE_H_TAG=1
+val SCE_H_TAGUNKNOWN=2
+val SCE_H_ATTRIBUTE=3
+val SCE_H_ATTRIBUTEUNKNOWN=4
+val SCE_H_NUMBER=5
+val SCE_H_DOUBLESTRING=6
+val SCE_H_SINGLESTRING=7
+val SCE_H_OTHER=8
+val SCE_H_COMMENT=9
+val SCE_H_ENTITY=10
+# XML and ASP
+val SCE_H_TAGEND=11
+val SCE_H_XMLSTART=12
+val SCE_H_XMLEND=13
+val SCE_H_SCRIPT=14
+val SCE_H_ASP=15
+val SCE_H_ASPAT=16
+val SCE_H_CDATA=17
+val SCE_H_QUESTION=18
+# More HTML
+val SCE_H_VALUE=19
+# X-Code
+val SCE_H_XCCOMMENT=20
+# SGML
+val SCE_H_SGML_DEFAULT=21
+val SCE_H_SGML_COMMAND=22
+val SCE_H_SGML_1ST_PARAM=23
+val SCE_H_SGML_DOUBLESTRING=24
+val SCE_H_SGML_SIMPLESTRING=25
+val SCE_H_SGML_ERROR=26
+val SCE_H_SGML_SPECIAL=27
+val SCE_H_SGML_ENTITY=28
+val SCE_H_SGML_COMMENT=29
+val SCE_H_SGML_1ST_PARAM_COMMENT=30
+val SCE_H_SGML_BLOCK_DEFAULT=31
+# Embedded Javascript
+val SCE_HJ_START=40
+val SCE_HJ_DEFAULT=41
+val SCE_HJ_COMMENT=42
+val SCE_HJ_COMMENTLINE=43
+val SCE_HJ_COMMENTDOC=44
+val SCE_HJ_NUMBER=45
+val SCE_HJ_WORD=46
+val SCE_HJ_KEYWORD=47
+val SCE_HJ_DOUBLESTRING=48
+val SCE_HJ_SINGLESTRING=49
+val SCE_HJ_SYMBOLS=50
+val SCE_HJ_STRINGEOL=51
+val SCE_HJ_REGEX=52
+# ASP Javascript
+val SCE_HJA_START=55
+val SCE_HJA_DEFAULT=56
+val SCE_HJA_COMMENT=57
+val SCE_HJA_COMMENTLINE=58
+val SCE_HJA_COMMENTDOC=59
+val SCE_HJA_NUMBER=60
+val SCE_HJA_WORD=61
+val SCE_HJA_KEYWORD=62
+val SCE_HJA_DOUBLESTRING=63
+val SCE_HJA_SINGLESTRING=64
+val SCE_HJA_SYMBOLS=65
+val SCE_HJA_STRINGEOL=66
+val SCE_HJA_REGEX=67
+# Embedded VBScript
+val SCE_HB_START=70
+val SCE_HB_DEFAULT=71
+val SCE_HB_COMMENTLINE=72
+val SCE_HB_NUMBER=73
+val SCE_HB_WORD=74
+val SCE_HB_STRING=75
+val SCE_HB_IDENTIFIER=76
+val SCE_HB_STRINGEOL=77
+# ASP VBScript
+val SCE_HBA_START=80
+val SCE_HBA_DEFAULT=81
+val SCE_HBA_COMMENTLINE=82
+val SCE_HBA_NUMBER=83
+val SCE_HBA_WORD=84
+val SCE_HBA_STRING=85
+val SCE_HBA_IDENTIFIER=86
+val SCE_HBA_STRINGEOL=87
+# Embedded Python
+val SCE_HP_START=90
+val SCE_HP_DEFAULT=91
+val SCE_HP_COMMENTLINE=92
+val SCE_HP_NUMBER=93
+val SCE_HP_STRING=94
+val SCE_HP_CHARACTER=95
+val SCE_HP_WORD=96
+val SCE_HP_TRIPLE=97
+val SCE_HP_TRIPLEDOUBLE=98
+val SCE_HP_CLASSNAME=99
+val SCE_HP_DEFNAME=100
+val SCE_HP_OPERATOR=101
+val SCE_HP_IDENTIFIER=102
+# PHP
+val SCE_HPHP_COMPLEX_VARIABLE=104
+# ASP Python
+val SCE_HPA_START=105
+val SCE_HPA_DEFAULT=106
+val SCE_HPA_COMMENTLINE=107
+val SCE_HPA_NUMBER=108
+val SCE_HPA_STRING=109
+val SCE_HPA_CHARACTER=110
+val SCE_HPA_WORD=111
+val SCE_HPA_TRIPLE=112
+val SCE_HPA_TRIPLEDOUBLE=113
+val SCE_HPA_CLASSNAME=114
+val SCE_HPA_DEFNAME=115
+val SCE_HPA_OPERATOR=116
+val SCE_HPA_IDENTIFIER=117
+# PHP
+val SCE_HPHP_DEFAULT=118
+val SCE_HPHP_HSTRING=119
+val SCE_HPHP_SIMPLESTRING=120
+val SCE_HPHP_WORD=121
+val SCE_HPHP_NUMBER=122
+val SCE_HPHP_VARIABLE=123
+val SCE_HPHP_COMMENT=124
+val SCE_HPHP_COMMENTLINE=125
+val SCE_HPHP_HSTRING_VARIABLE=126
+val SCE_HPHP_OPERATOR=127
+# Lexical states for SCLEX_PERL
+lex Perl=SCLEX_PERL SCE_PL_
+val SCE_PL_DEFAULT=0
+val SCE_PL_ERROR=1
+val SCE_PL_COMMENTLINE=2
+val SCE_PL_POD=3
+val SCE_PL_NUMBER=4
+val SCE_PL_WORD=5
+val SCE_PL_STRING=6
+val SCE_PL_CHARACTER=7
+val SCE_PL_PUNCTUATION=8
+val SCE_PL_PREPROCESSOR=9
+val SCE_PL_OPERATOR=10
+val SCE_PL_IDENTIFIER=11
+val SCE_PL_SCALAR=12
+val SCE_PL_ARRAY=13
+val SCE_PL_HASH=14
+val SCE_PL_SYMBOLTABLE=15
+val SCE_PL_VARIABLE_INDEXER=16
+val SCE_PL_REGEX=17
+val SCE_PL_REGSUBST=18
+val SCE_PL_LONGQUOTE=19
+val SCE_PL_BACKTICKS=20
+val SCE_PL_DATASECTION=21
+val SCE_PL_HERE_DELIM=22
+val SCE_PL_HERE_Q=23
+val SCE_PL_HERE_QQ=24
+val SCE_PL_HERE_QX=25
+val SCE_PL_STRING_Q=26
+val SCE_PL_STRING_QQ=27
+val SCE_PL_STRING_QX=28
+val SCE_PL_STRING_QR=29
+val SCE_PL_STRING_QW=30
+val SCE_PL_POD_VERB=31
+val SCE_PL_SUB_PROTOTYPE=40
+val SCE_PL_FORMAT_IDENT=41
+val SCE_PL_FORMAT=42
+val SCE_PL_STRING_VAR=43
+val SCE_PL_XLAT=44
+val SCE_PL_REGEX_VAR=54
+val SCE_PL_REGSUBST_VAR=55
+val SCE_PL_BACKTICKS_VAR=57
+val SCE_PL_HERE_QQ_VAR=61
+val SCE_PL_HERE_QX_VAR=62
+val SCE_PL_STRING_QQ_VAR=64
+val SCE_PL_STRING_QX_VAR=65
+val SCE_PL_STRING_QR_VAR=66
+# Lexical states for SCLEX_RUBY
+lex Ruby=SCLEX_RUBY SCE_RB_
+val SCE_RB_DEFAULT=0
+val SCE_RB_ERROR=1
+val SCE_RB_COMMENTLINE=2
+val SCE_RB_POD=3
+val SCE_RB_NUMBER=4
+val SCE_RB_WORD=5
+val SCE_RB_STRING=6
+val SCE_RB_CHARACTER=7
+val SCE_RB_CLASSNAME=8
+val SCE_RB_DEFNAME=9
+val SCE_RB_OPERATOR=10
+val SCE_RB_IDENTIFIER=11
+val SCE_RB_REGEX=12
+val SCE_RB_GLOBAL=13
+val SCE_RB_SYMBOL=14
+val SCE_RB_MODULE_NAME=15
+val SCE_RB_INSTANCE_VAR=16
+val SCE_RB_CLASS_VAR=17
+val SCE_RB_BACKTICKS=18
+val SCE_RB_DATASECTION=19
+val SCE_RB_HERE_DELIM=20
+val SCE_RB_HERE_Q=21
+val SCE_RB_HERE_QQ=22
+val SCE_RB_HERE_QX=23
+val SCE_RB_STRING_Q=24
+val SCE_RB_STRING_QQ=25
+val SCE_RB_STRING_QX=26
+val SCE_RB_STRING_QR=27
+val SCE_RB_STRING_QW=28
+val SCE_RB_WORD_DEMOTED=29
+val SCE_RB_STDIN=30
+val SCE_RB_STDOUT=31
+val SCE_RB_STDERR=40
+val SCE_RB_UPPER_BOUND=41
+# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC
+lex VB=SCLEX_VB SCE_B_
+lex VBScript=SCLEX_VBSCRIPT SCE_B_
+lex PowerBasic=SCLEX_POWERBASIC SCE_B_
+val SCE_B_DEFAULT=0
+val SCE_B_COMMENT=1
+val SCE_B_NUMBER=2
+val SCE_B_KEYWORD=3
+val SCE_B_STRING=4
+val SCE_B_PREPROCESSOR=5
+val SCE_B_OPERATOR=6
+val SCE_B_IDENTIFIER=7
+val SCE_B_DATE=8
+val SCE_B_STRINGEOL=9
+val SCE_B_KEYWORD2=10
+val SCE_B_KEYWORD3=11
+val SCE_B_KEYWORD4=12
+val SCE_B_CONSTANT=13
+val SCE_B_ASM=14
+val SCE_B_LABEL=15
+val SCE_B_ERROR=16
+val SCE_B_HEXNUMBER=17
+val SCE_B_BINNUMBER=18
+val SCE_B_COMMENTBLOCK=19
+val SCE_B_DOCLINE=20
+val SCE_B_DOCBLOCK=21
+val SCE_B_DOCKEYWORD=22
+# Lexical states for SCLEX_PROPERTIES
+lex Properties=SCLEX_PROPERTIES SCE_PROPS_
+val SCE_PROPS_DEFAULT=0
+val SCE_PROPS_COMMENT=1
+val SCE_PROPS_SECTION=2
+val SCE_PROPS_ASSIGNMENT=3
+val SCE_PROPS_DEFVAL=4
+val SCE_PROPS_KEY=5
+# Lexical states for SCLEX_LATEX
+lex LaTeX=SCLEX_LATEX SCE_L_
+val SCE_L_DEFAULT=0
+val SCE_L_COMMAND=1
+val SCE_L_TAG=2
+val SCE_L_MATH=3
+val SCE_L_COMMENT=4
+val SCE_L_TAG2=5
+val SCE_L_MATH2=6
+val SCE_L_COMMENT2=7
+val SCE_L_VERBATIM=8
+val SCE_L_SHORTCMD=9
+val SCE_L_SPECIAL=10
+val SCE_L_CMDOPT=11
+val SCE_L_ERROR=12
+# Lexical states for SCLEX_LUA
+lex Lua=SCLEX_LUA SCE_LUA_
+val SCE_LUA_DEFAULT=0
+val SCE_LUA_COMMENT=1
+val SCE_LUA_COMMENTLINE=2
+val SCE_LUA_COMMENTDOC=3
+val SCE_LUA_NUMBER=4
+val SCE_LUA_WORD=5
+val SCE_LUA_STRING=6
+val SCE_LUA_CHARACTER=7
+val SCE_LUA_LITERALSTRING=8
+val SCE_LUA_PREPROCESSOR=9
+val SCE_LUA_OPERATOR=10
+val SCE_LUA_IDENTIFIER=11
+val SCE_LUA_STRINGEOL=12
+val SCE_LUA_WORD2=13
+val SCE_LUA_WORD3=14
+val SCE_LUA_WORD4=15
+val SCE_LUA_WORD5=16
+val SCE_LUA_WORD6=17
+val SCE_LUA_WORD7=18
+val SCE_LUA_WORD8=19
+val SCE_LUA_LABEL=20
+# Lexical states for SCLEX_ERRORLIST
+lex ErrorList=SCLEX_ERRORLIST SCE_ERR_
+val SCE_ERR_DEFAULT=0
+val SCE_ERR_PYTHON=1
+val SCE_ERR_GCC=2
+val SCE_ERR_MS=3
+val SCE_ERR_CMD=4
+val SCE_ERR_BORLAND=5
+val SCE_ERR_PERL=6
+val SCE_ERR_NET=7
+val SCE_ERR_LUA=8
+val SCE_ERR_CTAG=9
+val SCE_ERR_DIFF_CHANGED=10
+val SCE_ERR_DIFF_ADDITION=11
+val SCE_ERR_DIFF_DELETION=12
+val SCE_ERR_DIFF_MESSAGE=13
+val SCE_ERR_PHP=14
+val SCE_ERR_ELF=15
+val SCE_ERR_IFC=16
+val SCE_ERR_IFORT=17
+val SCE_ERR_ABSF=18
+val SCE_ERR_TIDY=19
+val SCE_ERR_JAVA_STACK=20
+val SCE_ERR_VALUE=21
+val SCE_ERR_GCC_INCLUDED_FROM=22
+# Lexical states for SCLEX_BATCH
+lex Batch=SCLEX_BATCH SCE_BAT_
+val SCE_BAT_DEFAULT=0
+val SCE_BAT_COMMENT=1
+val SCE_BAT_WORD=2
+val SCE_BAT_LABEL=3
+val SCE_BAT_HIDE=4
+val SCE_BAT_COMMAND=5
+val SCE_BAT_IDENTIFIER=6
+val SCE_BAT_OPERATOR=7
+# Lexical states for SCLEX_TCMD
+lex TCMD=SCLEX_TCMD SCE_TCMD_
+val SCE_TCMD_DEFAULT=0
+val SCE_TCMD_COMMENT=1
+val SCE_TCMD_WORD=2
+val SCE_TCMD_LABEL=3
+val SCE_TCMD_HIDE=4
+val SCE_TCMD_COMMAND=5
+val SCE_TCMD_IDENTIFIER=6
+val SCE_TCMD_OPERATOR=7
+val SCE_TCMD_ENVIRONMENT=8
+val SCE_TCMD_EXPANSION=9
+val SCE_TCMD_CLABEL=10
+# Lexical states for SCLEX_MAKEFILE
+lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_
+val SCE_MAKE_DEFAULT=0
+val SCE_MAKE_COMMENT=1
+val SCE_MAKE_PREPROCESSOR=2
+val SCE_MAKE_IDENTIFIER=3
+val SCE_MAKE_OPERATOR=4
+val SCE_MAKE_TARGET=5
+val SCE_MAKE_IDEOL=9
+# Lexical states for SCLEX_DIFF
+lex Diff=SCLEX_DIFF SCE_DIFF_
+val SCE_DIFF_DEFAULT=0
+val SCE_DIFF_COMMENT=1
+val SCE_DIFF_COMMAND=2
+val SCE_DIFF_HEADER=3
+val SCE_DIFF_POSITION=4
+val SCE_DIFF_DELETED=5
+val SCE_DIFF_ADDED=6
+val SCE_DIFF_CHANGED=7
+# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
+lex Conf=SCLEX_CONF SCE_CONF_
+val SCE_CONF_DEFAULT=0
+val SCE_CONF_COMMENT=1
+val SCE_CONF_NUMBER=2
+val SCE_CONF_IDENTIFIER=3
+val SCE_CONF_EXTENSION=4
+val SCE_CONF_PARAMETER=5
+val SCE_CONF_STRING=6
+val SCE_CONF_OPERATOR=7
+val SCE_CONF_IP=8
+val SCE_CONF_DIRECTIVE=9
+# Lexical states for SCLEX_AVE, Avenue
+lex Avenue=SCLEX_AVE SCE_AVE_
+val SCE_AVE_DEFAULT=0
+val SCE_AVE_COMMENT=1
+val SCE_AVE_NUMBER=2
+val SCE_AVE_WORD=3
+val SCE_AVE_STRING=6
+val SCE_AVE_ENUM=7
+val SCE_AVE_STRINGEOL=8
+val SCE_AVE_IDENTIFIER=9
+val SCE_AVE_OPERATOR=10
+val SCE_AVE_WORD1=11
+val SCE_AVE_WORD2=12
+val SCE_AVE_WORD3=13
+val SCE_AVE_WORD4=14
+val SCE_AVE_WORD5=15
+val SCE_AVE_WORD6=16
+# Lexical states for SCLEX_ADA
+lex Ada=SCLEX_ADA SCE_ADA_
+val SCE_ADA_DEFAULT=0
+val SCE_ADA_WORD=1
+val SCE_ADA_IDENTIFIER=2
+val SCE_ADA_NUMBER=3
+val SCE_ADA_DELIMITER=4
+val SCE_ADA_CHARACTER=5
+val SCE_ADA_CHARACTEREOL=6
+val SCE_ADA_STRING=7
+val SCE_ADA_STRINGEOL=8
+val SCE_ADA_LABEL=9
+val SCE_ADA_COMMENTLINE=10
+val SCE_ADA_ILLEGAL=11
+# Lexical states for SCLEX_BAAN
+lex Baan=SCLEX_BAAN SCE_BAAN_
+val SCE_BAAN_DEFAULT=0
+val SCE_BAAN_COMMENT=1
+val SCE_BAAN_COMMENTDOC=2
+val SCE_BAAN_NUMBER=3
+val SCE_BAAN_WORD=4
+val SCE_BAAN_STRING=5
+val SCE_BAAN_PREPROCESSOR=6
+val SCE_BAAN_OPERATOR=7
+val SCE_BAAN_IDENTIFIER=8
+val SCE_BAAN_STRINGEOL=9
+val SCE_BAAN_WORD2=10
+# Lexical states for SCLEX_LISP
+lex Lisp=SCLEX_LISP SCE_LISP_
+val SCE_LISP_DEFAULT=0
+val SCE_LISP_COMMENT=1
+val SCE_LISP_NUMBER=2
+val SCE_LISP_KEYWORD=3
+val SCE_LISP_KEYWORD_KW=4
+val SCE_LISP_SYMBOL=5
+val SCE_LISP_STRING=6
+val SCE_LISP_STRINGEOL=8
+val SCE_LISP_IDENTIFIER=9
+val SCE_LISP_OPERATOR=10
+val SCE_LISP_SPECIAL=11
+val SCE_LISP_MULTI_COMMENT=12
+# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
+lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_
+lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_
+val SCE_EIFFEL_DEFAULT=0
+val SCE_EIFFEL_COMMENTLINE=1
+val SCE_EIFFEL_NUMBER=2
+val SCE_EIFFEL_WORD=3
+val SCE_EIFFEL_STRING=4
+val SCE_EIFFEL_CHARACTER=5
+val SCE_EIFFEL_OPERATOR=6
+val SCE_EIFFEL_IDENTIFIER=7
+val SCE_EIFFEL_STRINGEOL=8
+# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
+lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_
+val SCE_NNCRONTAB_DEFAULT=0
+val SCE_NNCRONTAB_COMMENT=1
+val SCE_NNCRONTAB_TASK=2
+val SCE_NNCRONTAB_SECTION=3
+val SCE_NNCRONTAB_KEYWORD=4
+val SCE_NNCRONTAB_MODIFIER=5
+val SCE_NNCRONTAB_ASTERISK=6
+val SCE_NNCRONTAB_NUMBER=7
+val SCE_NNCRONTAB_STRING=8
+val SCE_NNCRONTAB_ENVIRONMENT=9
+val SCE_NNCRONTAB_IDENTIFIER=10
+# Lexical states for SCLEX_FORTH (Forth Lexer)
+lex Forth=SCLEX_FORTH SCE_FORTH_
+val SCE_FORTH_DEFAULT=0
+val SCE_FORTH_COMMENT=1
+val SCE_FORTH_COMMENT_ML=2
+val SCE_FORTH_IDENTIFIER=3
+val SCE_FORTH_CONTROL=4
+val SCE_FORTH_KEYWORD=5
+val SCE_FORTH_DEFWORD=6
+val SCE_FORTH_PREWORD1=7
+val SCE_FORTH_PREWORD2=8
+val SCE_FORTH_NUMBER=9
+val SCE_FORTH_STRING=10
+val SCE_FORTH_LOCALE=11
+# Lexical states for SCLEX_MATLAB
+lex MatLab=SCLEX_MATLAB SCE_MATLAB_
+val SCE_MATLAB_DEFAULT=0
+val SCE_MATLAB_COMMENT=1
+val SCE_MATLAB_COMMAND=2
+val SCE_MATLAB_NUMBER=3
+val SCE_MATLAB_KEYWORD=4
+# single quoted string
+val SCE_MATLAB_STRING=5
+val SCE_MATLAB_OPERATOR=6
+val SCE_MATLAB_IDENTIFIER=7
+val SCE_MATLAB_DOUBLEQUOTESTRING=8
+# Lexical states for SCLEX_SCRIPTOL
+lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_
+val SCE_SCRIPTOL_DEFAULT=0
+val SCE_SCRIPTOL_WHITE=1
+val SCE_SCRIPTOL_COMMENTLINE=2
+val SCE_SCRIPTOL_PERSISTENT=3
+val SCE_SCRIPTOL_CSTYLE=4
+val SCE_SCRIPTOL_COMMENTBLOCK=5
+val SCE_SCRIPTOL_NUMBER=6
+val SCE_SCRIPTOL_STRING=7
+val SCE_SCRIPTOL_CHARACTER=8
+val SCE_SCRIPTOL_STRINGEOL=9
+val SCE_SCRIPTOL_KEYWORD=10
+val SCE_SCRIPTOL_OPERATOR=11
+val SCE_SCRIPTOL_IDENTIFIER=12
+val SCE_SCRIPTOL_TRIPLE=13
+val SCE_SCRIPTOL_CLASSNAME=14
+val SCE_SCRIPTOL_PREPROCESSOR=15
+# Lexical states for SCLEX_ASM, SCLEX_AS
+lex Asm=SCLEX_ASM SCE_ASM_
+lex As=SCLEX_AS SCE_ASM_
+val SCE_ASM_DEFAULT=0
+val SCE_ASM_COMMENT=1
+val SCE_ASM_NUMBER=2
+val SCE_ASM_STRING=3
+val SCE_ASM_OPERATOR=4
+val SCE_ASM_IDENTIFIER=5
+val SCE_ASM_CPUINSTRUCTION=6
+val SCE_ASM_MATHINSTRUCTION=7
+val SCE_ASM_REGISTER=8
+val SCE_ASM_DIRECTIVE=9
+val SCE_ASM_DIRECTIVEOPERAND=10
+val SCE_ASM_COMMENTBLOCK=11
+val SCE_ASM_CHARACTER=12
+val SCE_ASM_STRINGEOL=13
+val SCE_ASM_EXTINSTRUCTION=14
+val SCE_ASM_COMMENTDIRECTIVE=15
+# Lexical states for SCLEX_FORTRAN
+lex Fortran=SCLEX_FORTRAN SCE_F_
+lex F77=SCLEX_F77 SCE_F_
+val SCE_F_DEFAULT=0
+val SCE_F_COMMENT=1
+val SCE_F_NUMBER=2
+val SCE_F_STRING1=3
+val SCE_F_STRING2=4
+val SCE_F_STRINGEOL=5
+val SCE_F_OPERATOR=6
+val SCE_F_IDENTIFIER=7
+val SCE_F_WORD=8
+val SCE_F_WORD2=9
+val SCE_F_WORD3=10
+val SCE_F_PREPROCESSOR=11
+val SCE_F_OPERATOR2=12
+val SCE_F_LABEL=13
+val SCE_F_CONTINUATION=14
+# Lexical states for SCLEX_CSS
+lex CSS=SCLEX_CSS SCE_CSS_
+val SCE_CSS_DEFAULT=0
+val SCE_CSS_TAG=1
+val SCE_CSS_CLASS=2
+val SCE_CSS_PSEUDOCLASS=3
+val SCE_CSS_UNKNOWN_PSEUDOCLASS=4
+val SCE_CSS_OPERATOR=5
+val SCE_CSS_IDENTIFIER=6
+val SCE_CSS_UNKNOWN_IDENTIFIER=7
+val SCE_CSS_VALUE=8
+val SCE_CSS_COMMENT=9
+val SCE_CSS_ID=10
+val SCE_CSS_IMPORTANT=11
+val SCE_CSS_DIRECTIVE=12
+val SCE_CSS_DOUBLESTRING=13
+val SCE_CSS_SINGLESTRING=14
+val SCE_CSS_IDENTIFIER2=15
+val SCE_CSS_ATTRIBUTE=16
+val SCE_CSS_IDENTIFIER3=17
+val SCE_CSS_PSEUDOELEMENT=18
+val SCE_CSS_EXTENDED_IDENTIFIER=19
+val SCE_CSS_EXTENDED_PSEUDOCLASS=20
+val SCE_CSS_EXTENDED_PSEUDOELEMENT=21
+val SCE_CSS_MEDIA=22
+val SCE_CSS_VARIABLE=23
+# Lexical states for SCLEX_POV
+lex POV=SCLEX_POV SCE_POV_
+val SCE_POV_DEFAULT=0
+val SCE_POV_COMMENT=1
+val SCE_POV_COMMENTLINE=2
+val SCE_POV_NUMBER=3
+val SCE_POV_OPERATOR=4
+val SCE_POV_IDENTIFIER=5
+val SCE_POV_STRING=6
+val SCE_POV_STRINGEOL=7
+val SCE_POV_DIRECTIVE=8
+val SCE_POV_BADDIRECTIVE=9
+val SCE_POV_WORD2=10
+val SCE_POV_WORD3=11
+val SCE_POV_WORD4=12
+val SCE_POV_WORD5=13
+val SCE_POV_WORD6=14
+val SCE_POV_WORD7=15
+val SCE_POV_WORD8=16
+# Lexical states for SCLEX_LOUT
+lex LOUT=SCLEX_LOUT SCE_LOUT_
+val SCE_LOUT_DEFAULT=0
+val SCE_LOUT_COMMENT=1
+val SCE_LOUT_NUMBER=2
+val SCE_LOUT_WORD=3
+val SCE_LOUT_WORD2=4
+val SCE_LOUT_WORD3=5
+val SCE_LOUT_WORD4=6
+val SCE_LOUT_STRING=7
+val SCE_LOUT_OPERATOR=8
+val SCE_LOUT_IDENTIFIER=9
+val SCE_LOUT_STRINGEOL=10
+# Lexical states for SCLEX_ESCRIPT
+lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_
+val SCE_ESCRIPT_DEFAULT=0
+val SCE_ESCRIPT_COMMENT=1
+val SCE_ESCRIPT_COMMENTLINE=2
+val SCE_ESCRIPT_COMMENTDOC=3
+val SCE_ESCRIPT_NUMBER=4
+val SCE_ESCRIPT_WORD=5
+val SCE_ESCRIPT_STRING=6
+val SCE_ESCRIPT_OPERATOR=7
+val SCE_ESCRIPT_IDENTIFIER=8
+val SCE_ESCRIPT_BRACE=9
+val SCE_ESCRIPT_WORD2=10
+val SCE_ESCRIPT_WORD3=11
+# Lexical states for SCLEX_PS
+lex PS=SCLEX_PS SCE_PS_
+val SCE_PS_DEFAULT=0
+val SCE_PS_COMMENT=1
+val SCE_PS_DSC_COMMENT=2
+val SCE_PS_DSC_VALUE=3
+val SCE_PS_NUMBER=4
+val SCE_PS_NAME=5
+val SCE_PS_KEYWORD=6
+val SCE_PS_LITERAL=7
+val SCE_PS_IMMEVAL=8
+val SCE_PS_PAREN_ARRAY=9
+val SCE_PS_PAREN_DICT=10
+val SCE_PS_PAREN_PROC=11
+val SCE_PS_TEXT=12
+val SCE_PS_HEXSTRING=13
+val SCE_PS_BASE85STRING=14
+val SCE_PS_BADSTRINGCHAR=15
+# Lexical states for SCLEX_NSIS
+lex NSIS=SCLEX_NSIS SCE_NSIS_
+val SCE_NSIS_DEFAULT=0
+val SCE_NSIS_COMMENT=1
+val SCE_NSIS_STRINGDQ=2
+val SCE_NSIS_STRINGLQ=3
+val SCE_NSIS_STRINGRQ=4
+val SCE_NSIS_FUNCTION=5
+val SCE_NSIS_VARIABLE=6
+val SCE_NSIS_LABEL=7
+val SCE_NSIS_USERDEFINED=8
+val SCE_NSIS_SECTIONDEF=9
+val SCE_NSIS_SUBSECTIONDEF=10
+val SCE_NSIS_IFDEFINEDEF=11
+val SCE_NSIS_MACRODEF=12
+val SCE_NSIS_STRINGVAR=13
+val SCE_NSIS_NUMBER=14
+val SCE_NSIS_SECTIONGROUP=15
+val SCE_NSIS_PAGEEX=16
+val SCE_NSIS_FUNCTIONDEF=17
+val SCE_NSIS_COMMENTBOX=18
+# Lexical states for SCLEX_MMIXAL
+lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_
+val SCE_MMIXAL_LEADWS=0
+val SCE_MMIXAL_COMMENT=1
+val SCE_MMIXAL_LABEL=2
+val SCE_MMIXAL_OPCODE=3
+val SCE_MMIXAL_OPCODE_PRE=4
+val SCE_MMIXAL_OPCODE_VALID=5
+val SCE_MMIXAL_OPCODE_UNKNOWN=6
+val SCE_MMIXAL_OPCODE_POST=7
+val SCE_MMIXAL_OPERANDS=8
+val SCE_MMIXAL_NUMBER=9
+val SCE_MMIXAL_REF=10
+val SCE_MMIXAL_CHAR=11
+val SCE_MMIXAL_STRING=12
+val SCE_MMIXAL_REGISTER=13
+val SCE_MMIXAL_HEX=14
+val SCE_MMIXAL_OPERATOR=15
+val SCE_MMIXAL_SYMBOL=16
+val SCE_MMIXAL_INCLUDE=17
+# Lexical states for SCLEX_CLW
+lex Clarion=SCLEX_CLW SCE_CLW_
+val SCE_CLW_DEFAULT=0
+val SCE_CLW_LABEL=1
+val SCE_CLW_COMMENT=2
+val SCE_CLW_STRING=3
+val SCE_CLW_USER_IDENTIFIER=4
+val SCE_CLW_INTEGER_CONSTANT=5
+val SCE_CLW_REAL_CONSTANT=6
+val SCE_CLW_PICTURE_STRING=7
+val SCE_CLW_KEYWORD=8
+val SCE_CLW_COMPILER_DIRECTIVE=9
+val SCE_CLW_RUNTIME_EXPRESSIONS=10
+val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11
+val SCE_CLW_STRUCTURE_DATA_TYPE=12
+val SCE_CLW_ATTRIBUTE=13
+val SCE_CLW_STANDARD_EQUATE=14
+val SCE_CLW_ERROR=15
+val SCE_CLW_DEPRECATED=16
+# Lexical states for SCLEX_LOT
+lex LOT=SCLEX_LOT SCE_LOT_
+val SCE_LOT_DEFAULT=0
+val SCE_LOT_HEADER=1
+val SCE_LOT_BREAK=2
+val SCE_LOT_SET=3
+val SCE_LOT_PASS=4
+val SCE_LOT_FAIL=5
+val SCE_LOT_ABORT=6
+# Lexical states for SCLEX_YAML
+lex YAML=SCLEX_YAML SCE_YAML_
+val SCE_YAML_DEFAULT=0
+val SCE_YAML_COMMENT=1
+val SCE_YAML_IDENTIFIER=2
+val SCE_YAML_KEYWORD=3
+val SCE_YAML_NUMBER=4
+val SCE_YAML_REFERENCE=5
+val SCE_YAML_DOCUMENT=6
+val SCE_YAML_TEXT=7
+val SCE_YAML_ERROR=8
+val SCE_YAML_OPERATOR=9
+# Lexical states for SCLEX_TEX
+lex TeX=SCLEX_TEX SCE_TEX_
+val SCE_TEX_DEFAULT=0
+val SCE_TEX_SPECIAL=1
+val SCE_TEX_GROUP=2
+val SCE_TEX_SYMBOL=3
+val SCE_TEX_COMMAND=4
+val SCE_TEX_TEXT=5
+lex Metapost=SCLEX_METAPOST SCE_METAPOST_
+val SCE_METAPOST_DEFAULT=0
+val SCE_METAPOST_SPECIAL=1
+val SCE_METAPOST_GROUP=2
+val SCE_METAPOST_SYMBOL=3
+val SCE_METAPOST_COMMAND=4
+val SCE_METAPOST_TEXT=5
+val SCE_METAPOST_EXTRA=6
+# Lexical states for SCLEX_ERLANG
+lex Erlang=SCLEX_ERLANG SCE_ERLANG_
+val SCE_ERLANG_DEFAULT=0
+val SCE_ERLANG_COMMENT=1
+val SCE_ERLANG_VARIABLE=2
+val SCE_ERLANG_NUMBER=3
+val SCE_ERLANG_KEYWORD=4
+val SCE_ERLANG_STRING=5
+val SCE_ERLANG_OPERATOR=6
+val SCE_ERLANG_ATOM=7
+val SCE_ERLANG_FUNCTION_NAME=8
+val SCE_ERLANG_CHARACTER=9
+val SCE_ERLANG_MACRO=10
+val SCE_ERLANG_RECORD=11
+val SCE_ERLANG_PREPROC=12
+val SCE_ERLANG_NODE_NAME=13
+val SCE_ERLANG_COMMENT_FUNCTION=14
+val SCE_ERLANG_COMMENT_MODULE=15
+val SCE_ERLANG_COMMENT_DOC=16
+val SCE_ERLANG_COMMENT_DOC_MACRO=17
+val SCE_ERLANG_ATOM_QUOTED=18
+val SCE_ERLANG_MACRO_QUOTED=19
+val SCE_ERLANG_RECORD_QUOTED=20
+val SCE_ERLANG_NODE_NAME_QUOTED=21
+val SCE_ERLANG_BIFS=22
+val SCE_ERLANG_MODULES=23
+val SCE_ERLANG_MODULES_ATT=24
+val SCE_ERLANG_UNKNOWN=31
+# Lexical states for SCLEX_OCTAVE are identical to MatLab
+lex Octave=SCLEX_OCTAVE SCE_MATLAB_
+# Lexical states for SCLEX_MSSQL
+lex MSSQL=SCLEX_MSSQL SCE_MSSQL_
+val SCE_MSSQL_DEFAULT=0
+val SCE_MSSQL_COMMENT=1
+val SCE_MSSQL_LINE_COMMENT=2
+val SCE_MSSQL_NUMBER=3
+val SCE_MSSQL_STRING=4
+val SCE_MSSQL_OPERATOR=5
+val SCE_MSSQL_IDENTIFIER=6
+val SCE_MSSQL_VARIABLE=7
+val SCE_MSSQL_COLUMN_NAME=8
+val SCE_MSSQL_STATEMENT=9
+val SCE_MSSQL_DATATYPE=10
+val SCE_MSSQL_SYSTABLE=11
+val SCE_MSSQL_GLOBAL_VARIABLE=12
+val SCE_MSSQL_FUNCTION=13
+val SCE_MSSQL_STORED_PROCEDURE=14
+val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15
+val SCE_MSSQL_COLUMN_NAME_2=16
+# Lexical states for SCLEX_VERILOG
+lex Verilog=SCLEX_VERILOG SCE_V_
+val SCE_V_DEFAULT=0
+val SCE_V_COMMENT=1
+val SCE_V_COMMENTLINE=2
+val SCE_V_COMMENTLINEBANG=3
+val SCE_V_NUMBER=4
+val SCE_V_WORD=5
+val SCE_V_STRING=6
+val SCE_V_WORD2=7
+val SCE_V_WORD3=8
+val SCE_V_PREPROCESSOR=9
+val SCE_V_OPERATOR=10
+val SCE_V_IDENTIFIER=11
+val SCE_V_STRINGEOL=12
+val SCE_V_USER=19
+val SCE_V_COMMENT_WORD=20
+val SCE_V_INPUT=21
+val SCE_V_OUTPUT=22
+val SCE_V_INOUT=23
+val SCE_V_PORT_CONNECT=24
+# Lexical states for SCLEX_KIX
+lex Kix=SCLEX_KIX SCE_KIX_
+val SCE_KIX_DEFAULT=0
+val SCE_KIX_COMMENT=1
+val SCE_KIX_STRING1=2
+val SCE_KIX_STRING2=3
+val SCE_KIX_NUMBER=4
+val SCE_KIX_VAR=5
+val SCE_KIX_MACRO=6
+val SCE_KIX_KEYWORD=7
+val SCE_KIX_FUNCTIONS=8
+val SCE_KIX_OPERATOR=9
+val SCE_KIX_COMMENTSTREAM=10
+val SCE_KIX_IDENTIFIER=31
+# Lexical states for SCLEX_GUI4CLI
+lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_
+val SCE_GC_DEFAULT=0
+val SCE_GC_COMMENTLINE=1
+val SCE_GC_COMMENTBLOCK=2
+val SCE_GC_GLOBAL=3
+val SCE_GC_EVENT=4
+val SCE_GC_ATTRIBUTE=5
+val SCE_GC_CONTROL=6
+val SCE_GC_COMMAND=7
+val SCE_GC_STRING=8
+val SCE_GC_OPERATOR=9
+# Lexical states for SCLEX_SPECMAN
+lex Specman=SCLEX_SPECMAN SCE_SN_
+val SCE_SN_DEFAULT=0
+val SCE_SN_CODE=1
+val SCE_SN_COMMENTLINE=2
+val SCE_SN_COMMENTLINEBANG=3
+val SCE_SN_NUMBER=4
+val SCE_SN_WORD=5
+val SCE_SN_STRING=6
+val SCE_SN_WORD2=7
+val SCE_SN_WORD3=8
+val SCE_SN_PREPROCESSOR=9
+val SCE_SN_OPERATOR=10
+val SCE_SN_IDENTIFIER=11
+val SCE_SN_STRINGEOL=12
+val SCE_SN_REGEXTAG=13
+val SCE_SN_SIGNAL=14
+val SCE_SN_USER=19
+# Lexical states for SCLEX_AU3
+lex Au3=SCLEX_AU3 SCE_AU3_
+val SCE_AU3_DEFAULT=0
+val SCE_AU3_COMMENT=1
+val SCE_AU3_COMMENTBLOCK=2
+val SCE_AU3_NUMBER=3
+val SCE_AU3_FUNCTION=4
+val SCE_AU3_KEYWORD=5
+val SCE_AU3_MACRO=6
+val SCE_AU3_STRING=7
+val SCE_AU3_OPERATOR=8
+val SCE_AU3_VARIABLE=9
+val SCE_AU3_SENT=10
+val SCE_AU3_PREPROCESSOR=11
+val SCE_AU3_SPECIAL=12
+val SCE_AU3_EXPAND=13
+val SCE_AU3_COMOBJ=14
+val SCE_AU3_UDF=15
+# Lexical states for SCLEX_APDL
+lex APDL=SCLEX_APDL SCE_APDL_
+val SCE_APDL_DEFAULT=0
+val SCE_APDL_COMMENT=1
+val SCE_APDL_COMMENTBLOCK=2
+val SCE_APDL_NUMBER=3
+val SCE_APDL_STRING=4
+val SCE_APDL_OPERATOR=5
+val SCE_APDL_WORD=6
+val SCE_APDL_PROCESSOR=7
+val SCE_APDL_COMMAND=8
+val SCE_APDL_SLASHCOMMAND=9
+val SCE_APDL_STARCOMMAND=10
+val SCE_APDL_ARGUMENT=11
+val SCE_APDL_FUNCTION=12
+# Lexical states for SCLEX_BASH
+lex Bash=SCLEX_BASH SCE_SH_
+val SCE_SH_DEFAULT=0
+val SCE_SH_ERROR=1
+val SCE_SH_COMMENTLINE=2
+val SCE_SH_NUMBER=3
+val SCE_SH_WORD=4
+val SCE_SH_STRING=5
+val SCE_SH_CHARACTER=6
+val SCE_SH_OPERATOR=7
+val SCE_SH_IDENTIFIER=8
+val SCE_SH_SCALAR=9
+val SCE_SH_PARAM=10
+val SCE_SH_BACKTICKS=11
+val SCE_SH_HERE_DELIM=12
+val SCE_SH_HERE_Q=13
+# Lexical states for SCLEX_ASN1
+lex Asn1=SCLEX_ASN1 SCE_ASN1_
+val SCE_ASN1_DEFAULT=0
+val SCE_ASN1_COMMENT=1
+val SCE_ASN1_IDENTIFIER=2
+val SCE_ASN1_STRING=3
+val SCE_ASN1_OID=4
+val SCE_ASN1_SCALAR=5
+val SCE_ASN1_KEYWORD=6
+val SCE_ASN1_ATTRIBUTE=7
+val SCE_ASN1_DESCRIPTOR=8
+val SCE_ASN1_TYPE=9
+val SCE_ASN1_OPERATOR=10
+# Lexical states for SCLEX_VHDL
+lex VHDL=SCLEX_VHDL SCE_VHDL_
+val SCE_VHDL_DEFAULT=0
+val SCE_VHDL_COMMENT=1
+val SCE_VHDL_COMMENTLINEBANG=2
+val SCE_VHDL_NUMBER=3
+val SCE_VHDL_STRING=4
+val SCE_VHDL_OPERATOR=5
+val SCE_VHDL_IDENTIFIER=6
+val SCE_VHDL_STRINGEOL=7
+val SCE_VHDL_KEYWORD=8
+val SCE_VHDL_STDOPERATOR=9
+val SCE_VHDL_ATTRIBUTE=10
+val SCE_VHDL_STDFUNCTION=11
+val SCE_VHDL_STDPACKAGE=12
+val SCE_VHDL_STDTYPE=13
+val SCE_VHDL_USERWORD=14
+val SCE_VHDL_BLOCK_COMMENT=15
+# Lexical states for SCLEX_CAML
+lex Caml=SCLEX_CAML SCE_CAML_
+val SCE_CAML_DEFAULT=0
+val SCE_CAML_IDENTIFIER=1
+val SCE_CAML_TAGNAME=2
+val SCE_CAML_KEYWORD=3
+val SCE_CAML_KEYWORD2=4
+val SCE_CAML_KEYWORD3=5
+val SCE_CAML_LINENUM=6
+val SCE_CAML_OPERATOR=7
+val SCE_CAML_NUMBER=8
+val SCE_CAML_CHAR=9
+val SCE_CAML_WHITE=10
+val SCE_CAML_STRING=11
+val SCE_CAML_COMMENT=12
+val SCE_CAML_COMMENT1=13
+val SCE_CAML_COMMENT2=14
+val SCE_CAML_COMMENT3=15
+# Lexical states for SCLEX_HASKELL
+lex Haskell=SCLEX_HASKELL SCE_HA_
+val SCE_HA_DEFAULT=0
+val SCE_HA_IDENTIFIER=1
+val SCE_HA_KEYWORD=2
+val SCE_HA_NUMBER=3
+val SCE_HA_STRING=4
+val SCE_HA_CHARACTER=5
+val SCE_HA_CLASS=6
+val SCE_HA_MODULE=7
+val SCE_HA_CAPITAL=8
+val SCE_HA_DATA=9
+val SCE_HA_IMPORT=10
+val SCE_HA_OPERATOR=11
+val SCE_HA_INSTANCE=12
+val SCE_HA_COMMENTLINE=13
+val SCE_HA_COMMENTBLOCK=14
+val SCE_HA_COMMENTBLOCK2=15
+val SCE_HA_COMMENTBLOCK3=16
+val SCE_HA_PRAGMA=17
+val SCE_HA_PREPROCESSOR=18
+val SCE_HA_STRINGEOL=19
+val SCE_HA_RESERVED_OPERATOR=20
+val SCE_HA_LITERATE_COMMENT=21
+val SCE_HA_LITERATE_CODEDELIM=22
+# Lexical states of SCLEX_TADS3
+lex TADS3=SCLEX_TADS3 SCE_T3_
+val SCE_T3_DEFAULT=0
+val SCE_T3_X_DEFAULT=1
+val SCE_T3_PREPROCESSOR=2
+val SCE_T3_BLOCK_COMMENT=3
+val SCE_T3_LINE_COMMENT=4
+val SCE_T3_OPERATOR=5
+val SCE_T3_KEYWORD=6
+val SCE_T3_NUMBER=7
+val SCE_T3_IDENTIFIER=8
+val SCE_T3_S_STRING=9
+val SCE_T3_D_STRING=10
+val SCE_T3_X_STRING=11
+val SCE_T3_LIB_DIRECTIVE=12
+val SCE_T3_MSG_PARAM=13
+val SCE_T3_HTML_TAG=14
+val SCE_T3_HTML_DEFAULT=15
+val SCE_T3_HTML_STRING=16
+val SCE_T3_USER1=17
+val SCE_T3_USER2=18
+val SCE_T3_USER3=19
+val SCE_T3_BRACE=20
+# Lexical states for SCLEX_REBOL
+lex Rebol=SCLEX_REBOL SCE_REBOL_
+val SCE_REBOL_DEFAULT=0
+val SCE_REBOL_COMMENTLINE=1
+val SCE_REBOL_COMMENTBLOCK=2
+val SCE_REBOL_PREFACE=3
+val SCE_REBOL_OPERATOR=4
+val SCE_REBOL_CHARACTER=5
+val SCE_REBOL_QUOTEDSTRING=6
+val SCE_REBOL_BRACEDSTRING=7
+val SCE_REBOL_NUMBER=8
+val SCE_REBOL_PAIR=9
+val SCE_REBOL_TUPLE=10
+val SCE_REBOL_BINARY=11
+val SCE_REBOL_MONEY=12
+val SCE_REBOL_ISSUE=13
+val SCE_REBOL_TAG=14
+val SCE_REBOL_FILE=15
+val SCE_REBOL_EMAIL=16
+val SCE_REBOL_URL=17
+val SCE_REBOL_DATE=18
+val SCE_REBOL_TIME=19
+val SCE_REBOL_IDENTIFIER=20
+val SCE_REBOL_WORD=21
+val SCE_REBOL_WORD2=22
+val SCE_REBOL_WORD3=23
+val SCE_REBOL_WORD4=24
+val SCE_REBOL_WORD5=25
+val SCE_REBOL_WORD6=26
+val SCE_REBOL_WORD7=27
+val SCE_REBOL_WORD8=28
+# Lexical states for SCLEX_SQL
+lex SQL=SCLEX_SQL SCE_SQL_
+val SCE_SQL_DEFAULT=0
+val SCE_SQL_COMMENT=1
+val SCE_SQL_COMMENTLINE=2
+val SCE_SQL_COMMENTDOC=3
+val SCE_SQL_NUMBER=4
+val SCE_SQL_WORD=5
+val SCE_SQL_STRING=6
+val SCE_SQL_CHARACTER=7
+val SCE_SQL_SQLPLUS=8
+val SCE_SQL_SQLPLUS_PROMPT=9
+val SCE_SQL_OPERATOR=10
+val SCE_SQL_IDENTIFIER=11
+val SCE_SQL_SQLPLUS_COMMENT=13
+val SCE_SQL_COMMENTLINEDOC=15
+val SCE_SQL_WORD2=16
+val SCE_SQL_COMMENTDOCKEYWORD=17
+val SCE_SQL_COMMENTDOCKEYWORDERROR=18
+val SCE_SQL_USER1=19
+val SCE_SQL_USER2=20
+val SCE_SQL_USER3=21
+val SCE_SQL_USER4=22
+val SCE_SQL_QUOTEDIDENTIFIER=23
+val SCE_SQL_QOPERATOR=24
+# Lexical states for SCLEX_SMALLTALK
+lex Smalltalk=SCLEX_SMALLTALK SCE_ST_
+val SCE_ST_DEFAULT=0
+val SCE_ST_STRING=1
+val SCE_ST_NUMBER=2
+val SCE_ST_COMMENT=3
+val SCE_ST_SYMBOL=4
+val SCE_ST_BINARY=5
+val SCE_ST_BOOL=6
+val SCE_ST_SELF=7
+val SCE_ST_SUPER=8
+val SCE_ST_NIL=9
+val SCE_ST_GLOBAL=10
+val SCE_ST_RETURN=11
+val SCE_ST_SPECIAL=12
+val SCE_ST_KWSEND=13
+val SCE_ST_ASSIGN=14
+val SCE_ST_CHARACTER=15
+val SCE_ST_SPEC_SEL=16
+# Lexical states for SCLEX_FLAGSHIP (clipper)
+lex FlagShip=SCLEX_FLAGSHIP SCE_FS_
+val SCE_FS_DEFAULT=0
+val SCE_FS_COMMENT=1
+val SCE_FS_COMMENTLINE=2
+val SCE_FS_COMMENTDOC=3
+val SCE_FS_COMMENTLINEDOC=4
+val SCE_FS_COMMENTDOCKEYWORD=5
+val SCE_FS_COMMENTDOCKEYWORDERROR=6
+val SCE_FS_KEYWORD=7
+val SCE_FS_KEYWORD2=8
+val SCE_FS_KEYWORD3=9
+val SCE_FS_KEYWORD4=10
+val SCE_FS_NUMBER=11
+val SCE_FS_STRING=12
+val SCE_FS_PREPROCESSOR=13
+val SCE_FS_OPERATOR=14
+val SCE_FS_IDENTIFIER=15
+val SCE_FS_DATE=16
+val SCE_FS_STRINGEOL=17
+val SCE_FS_CONSTANT=18
+val SCE_FS_WORDOPERATOR=19
+val SCE_FS_DISABLEDCODE=20
+val SCE_FS_DEFAULT_C=21
+val SCE_FS_COMMENTDOC_C=22
+val SCE_FS_COMMENTLINEDOC_C=23
+val SCE_FS_KEYWORD_C=24
+val SCE_FS_KEYWORD2_C=25
+val SCE_FS_NUMBER_C=26
+val SCE_FS_STRING_C=27
+val SCE_FS_PREPROCESSOR_C=28
+val SCE_FS_OPERATOR_C=29
+val SCE_FS_IDENTIFIER_C=30
+val SCE_FS_STRINGEOL_C=31
+# Lexical states for SCLEX_CSOUND
+lex Csound=SCLEX_CSOUND SCE_CSOUND_
+val SCE_CSOUND_DEFAULT=0
+val SCE_CSOUND_COMMENT=1
+val SCE_CSOUND_NUMBER=2
+val SCE_CSOUND_OPERATOR=3
+val SCE_CSOUND_INSTR=4
+val SCE_CSOUND_IDENTIFIER=5
+val SCE_CSOUND_OPCODE=6
+val SCE_CSOUND_HEADERSTMT=7
+val SCE_CSOUND_USERKEYWORD=8
+val SCE_CSOUND_COMMENTBLOCK=9
+val SCE_CSOUND_PARAM=10
+val SCE_CSOUND_ARATE_VAR=11
+val SCE_CSOUND_KRATE_VAR=12
+val SCE_CSOUND_IRATE_VAR=13
+val SCE_CSOUND_GLOBAL_VAR=14
+val SCE_CSOUND_STRINGEOL=15
+# Lexical states for SCLEX_INNOSETUP
+lex Inno=SCLEX_INNOSETUP SCE_INNO_
+val SCE_INNO_DEFAULT=0
+val SCE_INNO_COMMENT=1
+val SCE_INNO_KEYWORD=2
+val SCE_INNO_PARAMETER=3
+val SCE_INNO_SECTION=4
+val SCE_INNO_PREPROC=5
+val SCE_INNO_INLINE_EXPANSION=6
+val SCE_INNO_COMMENT_PASCAL=7
+val SCE_INNO_KEYWORD_PASCAL=8
+val SCE_INNO_KEYWORD_USER=9
+val SCE_INNO_STRING_DOUBLE=10
+val SCE_INNO_STRING_SINGLE=11
+val SCE_INNO_IDENTIFIER=12
+# Lexical states for SCLEX_OPAL
+lex Opal=SCLEX_OPAL SCE_OPAL_
+val SCE_OPAL_SPACE=0
+val SCE_OPAL_COMMENT_BLOCK=1
+val SCE_OPAL_COMMENT_LINE=2
+val SCE_OPAL_INTEGER=3
+val SCE_OPAL_KEYWORD=4
+val SCE_OPAL_SORT=5
+val SCE_OPAL_STRING=6
+val SCE_OPAL_PAR=7
+val SCE_OPAL_BOOL_CONST=8
+val SCE_OPAL_DEFAULT=32
+# Lexical states for SCLEX_SPICE
+lex Spice=SCLEX_SPICE SCE_SPICE_
+val SCE_SPICE_DEFAULT=0
+val SCE_SPICE_IDENTIFIER=1
+val SCE_SPICE_KEYWORD=2
+val SCE_SPICE_KEYWORD2=3
+val SCE_SPICE_KEYWORD3=4
+val SCE_SPICE_NUMBER=5
+val SCE_SPICE_DELIMITER=6
+val SCE_SPICE_VALUE=7
+val SCE_SPICE_COMMENTLINE=8
+# Lexical states for SCLEX_CMAKE
+lex CMAKE=SCLEX_CMAKE SCE_CMAKE_
+val SCE_CMAKE_DEFAULT=0
+val SCE_CMAKE_COMMENT=1
+val SCE_CMAKE_STRINGDQ=2
+val SCE_CMAKE_STRINGLQ=3
+val SCE_CMAKE_STRINGRQ=4
+val SCE_CMAKE_COMMANDS=5
+val SCE_CMAKE_PARAMETERS=6
+val SCE_CMAKE_VARIABLE=7
+val SCE_CMAKE_USERDEFINED=8
+val SCE_CMAKE_WHILEDEF=9
+val SCE_CMAKE_FOREACHDEF=10
+val SCE_CMAKE_IFDEFINEDEF=11
+val SCE_CMAKE_MACRODEF=12
+val SCE_CMAKE_STRINGVAR=13
+val SCE_CMAKE_NUMBER=14
+# Lexical states for SCLEX_GAP
+lex Gap=SCLEX_GAP SCE_GAP_
+val SCE_GAP_DEFAULT=0
+val SCE_GAP_IDENTIFIER=1
+val SCE_GAP_KEYWORD=2
+val SCE_GAP_KEYWORD2=3
+val SCE_GAP_KEYWORD3=4
+val SCE_GAP_KEYWORD4=5
+val SCE_GAP_STRING=6
+val SCE_GAP_CHAR=7
+val SCE_GAP_OPERATOR=8
+val SCE_GAP_COMMENT=9
+val SCE_GAP_NUMBER=10
+val SCE_GAP_STRINGEOL=11
+# Lexical state for SCLEX_PLM
+lex PLM=SCLEX_PLM SCE_PLM_
+val SCE_PLM_DEFAULT=0
+val SCE_PLM_COMMENT=1
+val SCE_PLM_STRING=2
+val SCE_PLM_NUMBER=3
+val SCE_PLM_IDENTIFIER=4
+val SCE_PLM_OPERATOR=5
+val SCE_PLM_CONTROL=6
+val SCE_PLM_KEYWORD=7
+# Lexical state for SCLEX_PROGRESS
+lex Progress=SCLEX_PROGRESS SCE_4GL_
+val SCE_4GL_DEFAULT=0
+val SCE_4GL_NUMBER=1
+val SCE_4GL_WORD=2
+val SCE_4GL_STRING=3
+val SCE_4GL_CHARACTER=4
+val SCE_4GL_PREPROCESSOR=5
+val SCE_4GL_OPERATOR=6
+val SCE_4GL_IDENTIFIER=7
+val SCE_4GL_BLOCK=8
+val SCE_4GL_END=9
+val SCE_4GL_COMMENT1=10
+val SCE_4GL_COMMENT2=11
+val SCE_4GL_COMMENT3=12
+val SCE_4GL_COMMENT4=13
+val SCE_4GL_COMMENT5=14
+val SCE_4GL_COMMENT6=15
+val SCE_4GL_DEFAULT_=16
+val SCE_4GL_NUMBER_=17
+val SCE_4GL_WORD_=18
+val SCE_4GL_STRING_=19
+val SCE_4GL_CHARACTER_=20
+val SCE_4GL_PREPROCESSOR_=21
+val SCE_4GL_OPERATOR_=22
+val SCE_4GL_IDENTIFIER_=23
+val SCE_4GL_BLOCK_=24
+val SCE_4GL_END_=25
+val SCE_4GL_COMMENT1_=26
+val SCE_4GL_COMMENT2_=27
+val SCE_4GL_COMMENT3_=28
+val SCE_4GL_COMMENT4_=29
+val SCE_4GL_COMMENT5_=30
+val SCE_4GL_COMMENT6_=31
+# Lexical states for SCLEX_ABAQUS
+lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_
+val SCE_ABAQUS_DEFAULT=0
+val SCE_ABAQUS_COMMENT=1
+val SCE_ABAQUS_COMMENTBLOCK=2
+val SCE_ABAQUS_NUMBER=3
+val SCE_ABAQUS_STRING=4
+val SCE_ABAQUS_OPERATOR=5
+val SCE_ABAQUS_WORD=6
+val SCE_ABAQUS_PROCESSOR=7
+val SCE_ABAQUS_COMMAND=8
+val SCE_ABAQUS_SLASHCOMMAND=9
+val SCE_ABAQUS_STARCOMMAND=10
+val SCE_ABAQUS_ARGUMENT=11
+val SCE_ABAQUS_FUNCTION=12
+# Lexical states for SCLEX_ASYMPTOTE
+lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_
+val SCE_ASY_DEFAULT=0
+val SCE_ASY_COMMENT=1
+val SCE_ASY_COMMENTLINE=2
+val SCE_ASY_NUMBER=3
+val SCE_ASY_WORD=4
+val SCE_ASY_STRING=5
+val SCE_ASY_CHARACTER=6
+val SCE_ASY_OPERATOR=7
+val SCE_ASY_IDENTIFIER=8
+val SCE_ASY_STRINGEOL=9
+val SCE_ASY_COMMENTLINEDOC=10
+val SCE_ASY_WORD2=11
+# Lexical states for SCLEX_R
+lex R=SCLEX_R SCE_R_
+val SCE_R_DEFAULT=0
+val SCE_R_COMMENT=1
+val SCE_R_KWORD=2
+val SCE_R_BASEKWORD=3
+val SCE_R_OTHERKWORD=4
+val SCE_R_NUMBER=5
+val SCE_R_STRING=6
+val SCE_R_STRING2=7
+val SCE_R_OPERATOR=8
+val SCE_R_IDENTIFIER=9
+val SCE_R_INFIX=10
+val SCE_R_INFIXEOL=11
+# Lexical state for SCLEX_MAGIK
+lex MagikSF=SCLEX_MAGIK SCE_MAGIK_
+val SCE_MAGIK_DEFAULT=0
+val SCE_MAGIK_COMMENT=1
+val SCE_MAGIK_HYPER_COMMENT=16
+val SCE_MAGIK_STRING=2
+val SCE_MAGIK_CHARACTER=3
+val SCE_MAGIK_NUMBER=4
+val SCE_MAGIK_IDENTIFIER=5
+val SCE_MAGIK_OPERATOR=6
+val SCE_MAGIK_FLOW=7
+val SCE_MAGIK_CONTAINER=8
+val SCE_MAGIK_BRACKET_BLOCK=9
+val SCE_MAGIK_BRACE_BLOCK=10
+val SCE_MAGIK_SQBRACKET_BLOCK=11
+val SCE_MAGIK_UNKNOWN_KEYWORD=12
+val SCE_MAGIK_KEYWORD=13
+val SCE_MAGIK_PRAGMA=14
+val SCE_MAGIK_SYMBOL=15
+# Lexical state for SCLEX_POWERSHELL
+lex PowerShell=SCLEX_POWERSHELL SCE_POWERSHELL_
+val SCE_POWERSHELL_DEFAULT=0
+val SCE_POWERSHELL_COMMENT=1
+val SCE_POWERSHELL_STRING=2
+val SCE_POWERSHELL_CHARACTER=3
+val SCE_POWERSHELL_NUMBER=4
+val SCE_POWERSHELL_VARIABLE=5
+val SCE_POWERSHELL_OPERATOR=6
+val SCE_POWERSHELL_IDENTIFIER=7
+val SCE_POWERSHELL_KEYWORD=8
+val SCE_POWERSHELL_CMDLET=9
+val SCE_POWERSHELL_ALIAS=10
+val SCE_POWERSHELL_FUNCTION=11
+val SCE_POWERSHELL_USER1=12
+val SCE_POWERSHELL_COMMENTSTREAM=13
+val SCE_POWERSHELL_HERE_STRING=14
+val SCE_POWERSHELL_HERE_CHARACTER=15
+val SCE_POWERSHELL_COMMENTDOCKEYWORD=16
+# Lexical state for SCLEX_MYSQL
+lex MySQL=SCLEX_MYSQL SCE_MYSQL_
+val SCE_MYSQL_DEFAULT=0
+val SCE_MYSQL_COMMENT=1
+val SCE_MYSQL_COMMENTLINE=2
+val SCE_MYSQL_VARIABLE=3
+val SCE_MYSQL_SYSTEMVARIABLE=4
+val SCE_MYSQL_KNOWNSYSTEMVARIABLE=5
+val SCE_MYSQL_NUMBER=6
+val SCE_MYSQL_MAJORKEYWORD=7
+val SCE_MYSQL_KEYWORD=8
+val SCE_MYSQL_DATABASEOBJECT=9
+val SCE_MYSQL_PROCEDUREKEYWORD=10
+val SCE_MYSQL_STRING=11
+val SCE_MYSQL_SQSTRING=12
+val SCE_MYSQL_DQSTRING=13
+val SCE_MYSQL_OPERATOR=14
+val SCE_MYSQL_FUNCTION=15
+val SCE_MYSQL_IDENTIFIER=16
+val SCE_MYSQL_QUOTEDIDENTIFIER=17
+val SCE_MYSQL_USER1=18
+val SCE_MYSQL_USER2=19
+val SCE_MYSQL_USER3=20
+val SCE_MYSQL_HIDDENCOMMAND=21
+val SCE_MYSQL_PLACEHOLDER=22
+# Lexical state for SCLEX_PO
+lex Po=SCLEX_PO SCE_PO_
+val SCE_PO_DEFAULT=0
+val SCE_PO_COMMENT=1
+val SCE_PO_MSGID=2
+val SCE_PO_MSGID_TEXT=3
+val SCE_PO_MSGSTR=4
+val SCE_PO_MSGSTR_TEXT=5
+val SCE_PO_MSGCTXT=6
+val SCE_PO_MSGCTXT_TEXT=7
+val SCE_PO_FUZZY=8
+val SCE_PO_PROGRAMMER_COMMENT=9
+val SCE_PO_REFERENCE=10
+val SCE_PO_FLAGS=11
+val SCE_PO_MSGID_TEXT_EOL=12
+val SCE_PO_MSGSTR_TEXT_EOL=13
+val SCE_PO_MSGCTXT_TEXT_EOL=14
+val SCE_PO_ERROR=15
+# Lexical states for SCLEX_PASCAL
+lex Pascal=SCLEX_PASCAL SCE_PAS_
+val SCE_PAS_DEFAULT=0
+val SCE_PAS_IDENTIFIER=1
+val SCE_PAS_COMMENT=2
+val SCE_PAS_COMMENT2=3
+val SCE_PAS_COMMENTLINE=4
+val SCE_PAS_PREPROCESSOR=5
+val SCE_PAS_PREPROCESSOR2=6
+val SCE_PAS_NUMBER=7
+val SCE_PAS_HEXNUMBER=8
+val SCE_PAS_WORD=9
+val SCE_PAS_STRING=10
+val SCE_PAS_STRINGEOL=11
+val SCE_PAS_CHARACTER=12
+val SCE_PAS_OPERATOR=13
+val SCE_PAS_ASM=14
+# Lexical state for SCLEX_SORCUS
+lex SORCUS=SCLEX_SORCUS SCE_SORCUS_
+val SCE_SORCUS_DEFAULT=0
+val SCE_SORCUS_COMMAND=1
+val SCE_SORCUS_PARAMETER=2
+val SCE_SORCUS_COMMENTLINE=3
+val SCE_SORCUS_STRING=4
+val SCE_SORCUS_STRINGEOL=5
+val SCE_SORCUS_IDENTIFIER=6
+val SCE_SORCUS_OPERATOR=7
+val SCE_SORCUS_NUMBER=8
+val SCE_SORCUS_CONSTANT=9
+# Lexical state for SCLEX_POWERPRO
+lex PowerPro=SCLEX_POWERPRO SCE_POWERPRO_
+val SCE_POWERPRO_DEFAULT=0
+val SCE_POWERPRO_COMMENTBLOCK=1
+val SCE_POWERPRO_COMMENTLINE=2
+val SCE_POWERPRO_NUMBER=3
+val SCE_POWERPRO_WORD=4
+val SCE_POWERPRO_WORD2=5
+val SCE_POWERPRO_WORD3=6
+val SCE_POWERPRO_WORD4=7
+val SCE_POWERPRO_DOUBLEQUOTEDSTRING=8
+val SCE_POWERPRO_SINGLEQUOTEDSTRING=9
+val SCE_POWERPRO_LINECONTINUE=10
+val SCE_POWERPRO_OPERATOR=11
+val SCE_POWERPRO_IDENTIFIER=12
+val SCE_POWERPRO_STRINGEOL=13
+val SCE_POWERPRO_VERBATIM=14
+val SCE_POWERPRO_ALTQUOTE=15
+val SCE_POWERPRO_FUNCTION=16
+# Lexical states for SCLEX_SML
+lex SML=SCLEX_SML SCE_SML_
+val SCE_SML_DEFAULT=0
+val SCE_SML_IDENTIFIER=1
+val SCE_SML_TAGNAME=2
+val SCE_SML_KEYWORD=3
+val SCE_SML_KEYWORD2=4
+val SCE_SML_KEYWORD3=5
+val SCE_SML_LINENUM=6
+val SCE_SML_OPERATOR=7
+val SCE_SML_NUMBER=8
+val SCE_SML_CHAR=9
+val SCE_SML_STRING=11
+val SCE_SML_COMMENT=12
+val SCE_SML_COMMENT1=13
+val SCE_SML_COMMENT2=14
+val SCE_SML_COMMENT3=15
+# Lexical state for SCLEX_MARKDOWN
+lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_
+val SCE_MARKDOWN_DEFAULT=0
+val SCE_MARKDOWN_LINE_BEGIN=1
+val SCE_MARKDOWN_STRONG1=2
+val SCE_MARKDOWN_STRONG2=3
+val SCE_MARKDOWN_EM1=4
+val SCE_MARKDOWN_EM2=5
+val SCE_MARKDOWN_HEADER1=6
+val SCE_MARKDOWN_HEADER2=7
+val SCE_MARKDOWN_HEADER3=8
+val SCE_MARKDOWN_HEADER4=9
+val SCE_MARKDOWN_HEADER5=10
+val SCE_MARKDOWN_HEADER6=11
+val SCE_MARKDOWN_PRECHAR=12
+val SCE_MARKDOWN_ULIST_ITEM=13
+val SCE_MARKDOWN_OLIST_ITEM=14
+val SCE_MARKDOWN_BLOCKQUOTE=15
+val SCE_MARKDOWN_STRIKEOUT=16
+val SCE_MARKDOWN_HRULE=17
+val SCE_MARKDOWN_LINK=18
+val SCE_MARKDOWN_CODE=19
+val SCE_MARKDOWN_CODE2=20
+val SCE_MARKDOWN_CODEBK=21
+# Lexical state for SCLEX_TXT2TAGS
+lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_
+val SCE_TXT2TAGS_DEFAULT=0
+val SCE_TXT2TAGS_LINE_BEGIN=1
+val SCE_TXT2TAGS_STRONG1=2
+val SCE_TXT2TAGS_STRONG2=3
+val SCE_TXT2TAGS_EM1=4
+val SCE_TXT2TAGS_EM2=5
+val SCE_TXT2TAGS_HEADER1=6
+val SCE_TXT2TAGS_HEADER2=7
+val SCE_TXT2TAGS_HEADER3=8
+val SCE_TXT2TAGS_HEADER4=9
+val SCE_TXT2TAGS_HEADER5=10
+val SCE_TXT2TAGS_HEADER6=11
+val SCE_TXT2TAGS_PRECHAR=12
+val SCE_TXT2TAGS_ULIST_ITEM=13
+val SCE_TXT2TAGS_OLIST_ITEM=14
+val SCE_TXT2TAGS_BLOCKQUOTE=15
+val SCE_TXT2TAGS_STRIKEOUT=16
+val SCE_TXT2TAGS_HRULE=17
+val SCE_TXT2TAGS_LINK=18
+val SCE_TXT2TAGS_CODE=19
+val SCE_TXT2TAGS_CODE2=20
+val SCE_TXT2TAGS_CODEBK=21
+val SCE_TXT2TAGS_COMMENT=22
+val SCE_TXT2TAGS_OPTION=23
+val SCE_TXT2TAGS_PREPROC=24
+val SCE_TXT2TAGS_POSTPROC=25
+# Lexical states for SCLEX_A68K
+lex A68k=SCLEX_A68K SCE_A68K_
+val SCE_A68K_DEFAULT=0
+val SCE_A68K_COMMENT=1
+val SCE_A68K_NUMBER_DEC=2
+val SCE_A68K_NUMBER_BIN=3
+val SCE_A68K_NUMBER_HEX=4
+val SCE_A68K_STRING1=5
+val SCE_A68K_OPERATOR=6
+val SCE_A68K_CPUINSTRUCTION=7
+val SCE_A68K_EXTINSTRUCTION=8
+val SCE_A68K_REGISTER=9
+val SCE_A68K_DIRECTIVE=10
+val SCE_A68K_MACRO_ARG=11
+val SCE_A68K_LABEL=12
+val SCE_A68K_STRING2=13
+val SCE_A68K_IDENTIFIER=14
+val SCE_A68K_MACRO_DECLARATION=15
+val SCE_A68K_COMMENT_WORD=16
+val SCE_A68K_COMMENT_SPECIAL=17
+val SCE_A68K_COMMENT_DOXYGEN=18
+# Lexical states for SCLEX_MODULA
+lex Modula=SCLEX_MODULA SCE_MODULA_
+val SCE_MODULA_DEFAULT=0
+val SCE_MODULA_COMMENT=1
+val SCE_MODULA_DOXYCOMM=2
+val SCE_MODULA_DOXYKEY=3
+val SCE_MODULA_KEYWORD=4
+val SCE_MODULA_RESERVED=5
+val SCE_MODULA_NUMBER=6
+val SCE_MODULA_BASENUM=7
+val SCE_MODULA_FLOAT=8
+val SCE_MODULA_STRING=9
+val SCE_MODULA_STRSPEC=10
+val SCE_MODULA_CHAR=11
+val SCE_MODULA_CHARSPEC=12
+val SCE_MODULA_PROC=13
+val SCE_MODULA_PRAGMA=14
+val SCE_MODULA_PRGKEY=15
+val SCE_MODULA_OPERATOR=16
+val SCE_MODULA_BADSTR=17
+# Lexical states for SCLEX_COFFEESCRIPT
+lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_
+val SCE_COFFEESCRIPT_DEFAULT=0
+val SCE_COFFEESCRIPT_COMMENT=1
+val SCE_COFFEESCRIPT_COMMENTLINE=2
+val SCE_COFFEESCRIPT_COMMENTDOC=3
+val SCE_COFFEESCRIPT_NUMBER=4
+val SCE_COFFEESCRIPT_WORD=5
+val SCE_COFFEESCRIPT_STRING=6
+val SCE_COFFEESCRIPT_CHARACTER=7
+val SCE_COFFEESCRIPT_UUID=8
+val SCE_COFFEESCRIPT_PREPROCESSOR=9
+val SCE_COFFEESCRIPT_OPERATOR=10
+val SCE_COFFEESCRIPT_IDENTIFIER=11
+val SCE_COFFEESCRIPT_STRINGEOL=12
+val SCE_COFFEESCRIPT_VERBATIM=13
+val SCE_COFFEESCRIPT_REGEX=14
+val SCE_COFFEESCRIPT_COMMENTLINEDOC=15
+val SCE_COFFEESCRIPT_WORD2=16
+val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17
+val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18
+val SCE_COFFEESCRIPT_GLOBALCLASS=19
+val SCE_COFFEESCRIPT_STRINGRAW=20
+val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
+val SCE_COFFEESCRIPT_COMMENTBLOCK=22
+val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
+val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
+# Lexical states for SCLEX_AVS
+lex AVS=SCLEX_AVS SCE_AVS_
+val SCE_AVS_DEFAULT=0
+val SCE_AVS_COMMENTBLOCK=1
+val SCE_AVS_COMMENTBLOCKN=2
+val SCE_AVS_COMMENTLINE=3
+val SCE_AVS_NUMBER=4
+val SCE_AVS_OPERATOR=5
+val SCE_AVS_IDENTIFIER=6
+val SCE_AVS_STRING=7
+val SCE_AVS_TRIPLESTRING=8
+val SCE_AVS_KEYWORD=9
+val SCE_AVS_FILTER=10
+val SCE_AVS_PLUGIN=11
+val SCE_AVS_FUNCTION=12
+val SCE_AVS_CLIPPROP=13
+val SCE_AVS_USERDFN=14
+# Lexical states for SCLEX_ECL
+lex ECL=SCLEX_ECL SCE_ECL_
+val SCE_ECL_DEFAULT=0
+val SCE_ECL_COMMENT=1
+val SCE_ECL_COMMENTLINE=2
+val SCE_ECL_NUMBER=3
+val SCE_ECL_STRING=4
+val SCE_ECL_WORD0=5
+val SCE_ECL_OPERATOR=6
+val SCE_ECL_CHARACTER=7
+val SCE_ECL_UUID=8
+val SCE_ECL_PREPROCESSOR=9
+val SCE_ECL_UNKNOWN=10
+val SCE_ECL_IDENTIFIER=11
+val SCE_ECL_STRINGEOL=12
+val SCE_ECL_VERBATIM=13
+val SCE_ECL_REGEX=14
+val SCE_ECL_COMMENTLINEDOC=15
+val SCE_ECL_WORD1=16
+val SCE_ECL_COMMENTDOCKEYWORD=17
+val SCE_ECL_COMMENTDOCKEYWORDERROR=18
+val SCE_ECL_WORD2=19
+val SCE_ECL_WORD3=20
+val SCE_ECL_WORD4=21
+val SCE_ECL_WORD5=22
+val SCE_ECL_COMMENTDOC=23
+val SCE_ECL_ADDED=24
+val SCE_ECL_DELETED=25
+val SCE_ECL_CHANGED=26
+val SCE_ECL_MOVED=27
+# Lexical states for SCLEX_OSCRIPT
+lex OScript=SCLEX_OSCRIPT SCE_OSCRIPT_
+val SCE_OSCRIPT_DEFAULT=0
+val SCE_OSCRIPT_LINE_COMMENT=1
+val SCE_OSCRIPT_BLOCK_COMMENT=2
+val SCE_OSCRIPT_DOC_COMMENT=3
+val SCE_OSCRIPT_PREPROCESSOR=4
+val SCE_OSCRIPT_NUMBER=5
+val SCE_OSCRIPT_SINGLEQUOTE_STRING=6
+val SCE_OSCRIPT_DOUBLEQUOTE_STRING=7
+val SCE_OSCRIPT_CONSTANT=8
+val SCE_OSCRIPT_IDENTIFIER=9
+val SCE_OSCRIPT_GLOBAL=10
+val SCE_OSCRIPT_KEYWORD=11
+val SCE_OSCRIPT_OPERATOR=12
+val SCE_OSCRIPT_LABEL=13
+val SCE_OSCRIPT_TYPE=14
+val SCE_OSCRIPT_FUNCTION=15
+val SCE_OSCRIPT_OBJECT=16
+val SCE_OSCRIPT_PROPERTY=17
+val SCE_OSCRIPT_METHOD=18
+# Lexical states for SCLEX_VISUALPROLOG
+lex VisualProlog=SCLEX_VISUALPROLOG SCE_VISUALPROLOG_
+val SCE_VISUALPROLOG_DEFAULT=0
+val SCE_VISUALPROLOG_KEY_MAJOR=1
+val SCE_VISUALPROLOG_KEY_MINOR=2
+val SCE_VISUALPROLOG_KEY_DIRECTIVE=3
+val SCE_VISUALPROLOG_COMMENT_BLOCK=4
+val SCE_VISUALPROLOG_COMMENT_LINE=5
+val SCE_VISUALPROLOG_COMMENT_KEY=6
+val SCE_VISUALPROLOG_COMMENT_KEY_ERROR=7
+val SCE_VISUALPROLOG_IDENTIFIER=8
+val SCE_VISUALPROLOG_VARIABLE=9
+val SCE_VISUALPROLOG_ANONYMOUS=10
+val SCE_VISUALPROLOG_NUMBER=11
+val SCE_VISUALPROLOG_OPERATOR=12
+val SCE_VISUALPROLOG_CHARACTER=13
+val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14
+val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15
+val SCE_VISUALPROLOG_STRING=16
+val SCE_VISUALPROLOG_STRING_ESCAPE=17
+val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18
+val SCE_VISUALPROLOG_STRING_EOL_OPEN=19
+val SCE_VISUALPROLOG_STRING_VERBATIM=20
+val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21
+val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22
+# Lexical states for SCLEX_STTXT
+lex StructuredText=SCLEX_STTXT SCE_STTXT_
+val SCE_STTXT_DEFAULT=0
+val SCE_STTXT_COMMENT=1
+val SCE_STTXT_COMMENTLINE=2
+val SCE_STTXT_KEYWORD=3
+val SCE_STTXT_TYPE=4
+val SCE_STTXT_FUNCTION=5
+val SCE_STTXT_FB=6
+val SCE_STTXT_NUMBER=7
+val SCE_STTXT_HEXNUMBER=8
+val SCE_STTXT_PRAGMA=9
+val SCE_STTXT_OPERATOR=10
+val SCE_STTXT_CHARACTER=11
+val SCE_STTXT_STRING1=12
+val SCE_STTXT_STRING2=13
+val SCE_STTXT_STRINGEOL=14
+val SCE_STTXT_IDENTIFIER=15
+val SCE_STTXT_DATETIME=16
+val SCE_STTXT_VARS=17
+val SCE_STTXT_PRAGMAS=18
+# Lexical states for SCLEX_KVIRC
+lex KVIrc=SCLEX_KVIRC SCE_KVIRC_
+val SCE_KVIRC_DEFAULT=0
+val SCE_KVIRC_COMMENT=1
+val SCE_KVIRC_COMMENTBLOCK=2
+val SCE_KVIRC_STRING=3
+val SCE_KVIRC_WORD=4
+val SCE_KVIRC_KEYWORD=5
+val SCE_KVIRC_FUNCTION_KEYWORD=6
+val SCE_KVIRC_FUNCTION=7
+val SCE_KVIRC_VARIABLE=8
+val SCE_KVIRC_NUMBER=9
+val SCE_KVIRC_OPERATOR=10
+val SCE_KVIRC_STRING_FUNCTION=11
+val SCE_KVIRC_STRING_VARIABLE=12
+# Lexical states for SCLEX_RUST
+lex Rust=SCLEX_RUST SCE_RUST_
+val SCE_RUST_DEFAULT=0
+val SCE_RUST_COMMENTBLOCK=1
+val SCE_RUST_COMMENTLINE=2
+val SCE_RUST_COMMENTBLOCKDOC=3
+val SCE_RUST_COMMENTLINEDOC=4
+val SCE_RUST_NUMBER=5
+val SCE_RUST_WORD=6
+val SCE_RUST_WORD2=7
+val SCE_RUST_WORD3=8
+val SCE_RUST_WORD4=9
+val SCE_RUST_WORD5=10
+val SCE_RUST_WORD6=11
+val SCE_RUST_WORD7=12
+val SCE_RUST_STRING=13
+val SCE_RUST_STRINGR=14
+val SCE_RUST_CHARACTER=15
+val SCE_RUST_OPERATOR=16
+val SCE_RUST_IDENTIFIER=17
+val SCE_RUST_LIFETIME=18
+val SCE_RUST_MACRO=19
+val SCE_RUST_LEXERROR=20
+val SCE_RUST_BYTESTRING=21
+val SCE_RUST_BYTESTRINGR=22
+val SCE_RUST_BYTECHARACTER=23
+# Lexical states for SCLEX_DMAP
+lex DMAP=SCLEX_DMAP SCE_DMAP_
+val SCE_DMAP_DEFAULT=0
+val SCE_DMAP_COMMENT=1
+val SCE_DMAP_NUMBER=2
+val SCE_DMAP_STRING1=3
+val SCE_DMAP_STRING2=4
+val SCE_DMAP_STRINGEOL=5
+val SCE_DMAP_OPERATOR=6
+val SCE_DMAP_IDENTIFIER=7
+val SCE_DMAP_WORD=8
+val SCE_DMAP_WORD2=9
+val SCE_DMAP_WORD3=10
+# Lexical states for SCLEX_DMIS
+lex DMIS=SCLEX_DMIS SCE_DMIS_
+val SCE_DMIS_DEFAULT=0
+val SCE_DMIS_COMMENT=1
+val SCE_DMIS_STRING=2
+val SCE_DMIS_NUMBER=3
+val SCE_DMIS_KEYWORD=4
+val SCE_DMIS_MAJORWORD=5
+val SCE_DMIS_MINORWORD=6
+val SCE_DMIS_UNSUPPORTED_MAJOR=7
+val SCE_DMIS_UNSUPPORTED_MINOR=8
+val SCE_DMIS_LABEL=9
+# Lexical states for SCLEX_REGISTRY
+lex REG=SCLEX_REGISTRY SCE_REG_
+val SCE_REG_DEFAULT=0
+val SCE_REG_COMMENT=1
+val SCE_REG_VALUENAME=2
+val SCE_REG_STRING=3
+val SCE_REG_HEXDIGIT=4
+val SCE_REG_VALUETYPE=5
+val SCE_REG_ADDEDKEY=6
+val SCE_REG_DELETEDKEY=7
+val SCE_REG_ESCAPED=8
+val SCE_REG_KEYPATH_GUID=9
+val SCE_REG_STRING_GUID=10
+val SCE_REG_PARAMETER=11
+val SCE_REG_OPERATOR=12
+# Lexical state for SCLEX_BIBTEX
+lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_
+val SCE_BIBTEX_DEFAULT=0
+val SCE_BIBTEX_ENTRY=1
+val SCE_BIBTEX_UNKNOWN_ENTRY=2
+val SCE_BIBTEX_KEY=3
+val SCE_BIBTEX_PARAMETER=4
+val SCE_BIBTEX_VALUE=5
+val SCE_BIBTEX_COMMENT=6
+# Lexical state for SCLEX_SREC
+lex Srec=SCLEX_SREC SCE_HEX_
+val SCE_HEX_DEFAULT=0
+val SCE_HEX_RECSTART=1
+val SCE_HEX_RECTYPE=2
+val SCE_HEX_RECTYPE_UNKNOWN=3
+val SCE_HEX_BYTECOUNT=4
+val SCE_HEX_BYTECOUNT_WRONG=5
+val SCE_HEX_NOADDRESS=6
+val SCE_HEX_DATAADDRESS=7
+val SCE_HEX_RECCOUNT=8
+val SCE_HEX_STARTADDRESS=9
+val SCE_HEX_ADDRESSFIELD_UNKNOWN=10
+val SCE_HEX_EXTENDEDADDRESS=11
+val SCE_HEX_DATA_ODD=12
+val SCE_HEX_DATA_EVEN=13
+val SCE_HEX_DATA_UNKNOWN=14
+val SCE_HEX_DATA_EMPTY=15
+val SCE_HEX_CHECKSUM=16
+val SCE_HEX_CHECKSUM_WRONG=17
+val SCE_HEX_GARBAGE=18
+# Lexical state for SCLEX_IHEX (shared with Srec)
+lex IHex=SCLEX_IHEX SCE_HEX_
+# Lexical state for SCLEX_TEHEX (shared with Srec)
+lex TEHex=SCLEX_TEHEX SCE_HEX_
+
+# Events
+
+evt void StyleNeeded=2000(int position)
+evt void CharAdded=2001(int ch)
+evt void SavePointReached=2002(void)
+evt void SavePointLeft=2003(void)
+evt void ModifyAttemptRO=2004(void)
+# GTK+ Specific to work around focus and accelerator problems:
+evt void Key=2005(int ch, int modifiers)
+evt void DoubleClick=2006(int modifiers, int position, int line)
+evt void UpdateUI=2007(int updated)
+evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev, int token, int annotationLinesAdded)
+evt void MacroRecord=2009(int message, int wParam, int lParam)
+evt void MarginClick=2010(int modifiers, int position, int margin)
+evt void NeedShown=2011(int position, int length)
+evt void Painted=2013(void)
+evt void UserListSelection=2014(int listType, string text, int position)
+evt void URIDropped=2015(string text)
+evt void DwellStart=2016(int position, int x, int y)
+evt void DwellEnd=2017(int position, int x, int y)
+evt void Zoom=2018(void)
+evt void HotSpotClick=2019(int modifiers, int position)
+evt void HotSpotDoubleClick=2020(int modifiers, int position)
+evt void CallTipClick=2021(int position)
+evt void AutoCSelection=2022(string text, int position)
+evt void IndicatorClick=2023(int modifiers, int position)
+evt void IndicatorRelease=2024(int modifiers, int position)
+evt void AutoCCancelled=2025(void)
+evt void AutoCCharDeleted=2026(void)
+evt void HotSpotReleaseClick=2027(int modifiers, int position)
+evt void FocusIn=2028(void)
+evt void FocusOut=2029(void)
+
+# There are no provisional features currently
+
+cat Provisional
+
+cat Deprecated
+
+# Deprecated in 2.21
+# The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+.
+val SC_CP_DBCS=1
+
+# Deprecated in 2.30
+
+# In palette mode?
+get bool GetUsePalette=2139(,)
+
+# In palette mode, Scintilla uses the environment's palette calls to display
+# more colours. This may lead to ugly displays.
+set void SetUsePalette=2039(bool usePalette,)
+
+# Deprecated in 3.5.5
+
+# Always interpret keyboard input as Unicode
+set void SetKeysUnicode=2521(bool keysUnicode,)
+
+# Are keys always interpreted as Unicode?
+get bool GetKeysUnicode=2522(,)
diff --git a/3rdparty/bgfx/3rdparty/scintilla/include/ScintillaWidget.h b/3rdparty/bgfx/3rdparty/scintilla/include/ScintillaWidget.h
new file mode 100644
index 00000000000..f8cd212b02a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/include/ScintillaWidget.h
@@ -0,0 +1,51 @@
+/* Scintilla source code edit control */
+/** @file ScintillaWidget.h
+ ** Definition of Scintilla widget for GTK+.
+ ** Only needed by GTK+ code but is harmless on other platforms.
+ **/
+/* Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed. */
+
+#ifndef SCINTILLAWIDGET_H
+#define SCINTILLAWIDGET_H
+
+#if defined(GTK)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject)
+#define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
+#define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ())
+
+typedef struct _ScintillaObject ScintillaObject;
+typedef struct _ScintillaClass ScintillaClass;
+
+struct _ScintillaObject {
+ GtkContainer cont;
+ void *pscin;
+};
+
+struct _ScintillaClass {
+ GtkContainerClass parent_class;
+
+ void (* command) (ScintillaObject *ttt);
+ void (* notify) (ScintillaObject *ttt);
+};
+
+GType scintilla_get_type (void);
+GtkWidget* scintilla_new (void);
+void scintilla_set_id (ScintillaObject *sci, uptr_t id);
+sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+void scintilla_release_resources(void);
+
+#define SCINTILLA_NOTIFY "sci-notify"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexA68k.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexA68k.cxx
new file mode 100644
index 00000000000..0b600195a76
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexA68k.cxx
@@ -0,0 +1,347 @@
+// Scintilla source code edit control
+/** @file LexA68k.cxx
+ ** Lexer for Assembler, just for the MASM syntax
+ ** Written by Martial Demolins AKA Folco
+ **/
+// Copyright 2010 Martial Demolins <mdemolins(a)gmail.com>
+// The License.txt file describes the conditions under which this software
+// may be distributed.
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+// Return values for GetOperatorType
+#define NO_OPERATOR 0
+#define OPERATOR_1CHAR 1
+#define OPERATOR_2CHAR 2
+
+
+/**
+ * IsIdentifierStart
+ *
+ * Return true if the given char is a valid identifier first char
+ */
+
+static inline bool IsIdentifierStart (const int ch)
+{
+ return (isalpha(ch) || (ch == '_') || (ch == '\\'));
+}
+
+
+/**
+ * IsIdentifierChar
+ *
+ * Return true if the given char is a valid identifier char
+ */
+
+static inline bool IsIdentifierChar (const int ch)
+{
+ return (isalnum(ch) || (ch == '_') || (ch == '@') || (ch == ':') || (ch == '.'));
+}
+
+
+/**
+ * GetOperatorType
+ *
+ * Return:
+ * NO_OPERATOR if char is not an operator
+ * OPERATOR_1CHAR if the operator is one char long
+ * OPERATOR_2CHAR if the operator is two chars long
+ */
+
+static inline int GetOperatorType (const int ch1, const int ch2)
+{
+ int OpType = NO_OPERATOR;
+
+ if ((ch1 == '+') || (ch1 == '-') || (ch1 == '*') || (ch1 == '/') || (ch1 == '#') ||
+ (ch1 == '(') || (ch1 == ')') || (ch1 == '~') || (ch1 == '&') || (ch1 == '|') || (ch1 == ','))
+ OpType = OPERATOR_1CHAR;
+
+ else if ((ch1 == ch2) && (ch1 == '<' || ch1 == '>'))
+ OpType = OPERATOR_2CHAR;
+
+ return OpType;
+}
+
+
+/**
+ * IsBin
+ *
+ * Return true if the given char is 0 or 1
+ */
+
+static inline bool IsBin (const int ch)
+{
+ return (ch == '0') || (ch == '1');
+}
+
+
+/**
+ * IsDoxygenChar
+ *
+ * Return true if the char may be part of a Doxygen keyword
+ */
+
+static inline bool IsDoxygenChar (const int ch)
+{
+ return isalpha(ch) || (ch == '$') || (ch == '[') || (ch == ']') || (ch == '{') || (ch == '}');
+}
+
+
+/**
+ * ColouriseA68kDoc
+ *
+ * Main function, which colourises a 68k source
+ */
+
+static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler)
+{
+ // Used to buffer a string, to be able to compare it using built-in functions
+ char Buffer[100];
+
+
+ // Used to know the length of an operator
+ int OpType;
+
+
+ // Get references to keywords lists
+ WordList &cpuInstruction = *keywordlists[0];
+ WordList &registers = *keywordlists[1];
+ WordList &directive = *keywordlists[2];
+ WordList &extInstruction = *keywordlists[3];
+ WordList &alert = *keywordlists[4];
+ WordList &doxygenKeyword = *keywordlists[5];
+
+
+ // Instanciate a context for our source
+ StyleContext sc(startPos, length, initStyle, styler);
+
+
+ /************************************************************
+ *
+ * Parse the source
+ *
+ ************************************************************/
+
+ for ( ; sc.More(); sc.Forward())
+ {
+ /************************************************************
+ *
+ * A style always terminates at the end of a line, even for
+ * comments (no multi-lines comments)
+ *
+ ************************************************************/
+ if (sc.atLineStart) {
+ sc.SetState(SCE_A68K_DEFAULT);
+ }
+
+
+ /************************************************************
+ *
+ * If we are not in "default style", check if the style continues
+ * In this case, we just have to loop
+ *
+ ************************************************************/
+
+ if (sc.state != SCE_A68K_DEFAULT)
+ {
+ if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number
+ || ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number
+ || ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number
+ || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument
+ || ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted
+ || ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted
+ || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point)
+ || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier
+ || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local)
+ || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword
+ || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert
+ || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment
+ {
+ continue;
+ }
+
+ /************************************************************
+ *
+ * Check if current state terminates
+ *
+ ************************************************************/
+
+ // Strings: include terminal ' or " in the current string by skipping it
+ if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) {
+ sc.Forward();
+ }
+
+
+ // If a macro declaration was terminated with ':', it was a label
+ else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) {
+ sc.ChangeState(SCE_A68K_LABEL);
+ }
+
+
+ // If it wasn't a Doxygen keyword, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) {
+ sc.GetCurrent(Buffer, sizeof(Buffer));
+ if (!doxygenKeyword.InList(Buffer)) {
+ sc.ChangeState(SCE_A68K_COMMENT);
+ }
+ sc.SetState(SCE_A68K_COMMENT);
+ continue;
+ }
+
+
+ // If it wasn't an Alert, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_SPECIAL) {
+ sc.GetCurrent(Buffer, sizeof(Buffer));
+ if (!alert.InList(Buffer)) {
+ sc.ChangeState(SCE_A68K_COMMENT);
+ }
+ // Reset style to normal comment, or to Doxygen keyword if it begins with '\'
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
+ sc.SetState(SCE_A68K_COMMENT);
+ }
+ continue;
+ }
+
+
+ // If we are in a comment, it's a Doxygen keyword or an Alert
+ else if (sc.state == SCE_A68K_COMMENT) {
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
+ sc.SetState(SCE_A68K_COMMENT_SPECIAL);
+ }
+ continue;
+ }
+
+
+ // Check if we are at the end of an identifier
+ // In this case, colourise it if was a keyword.
+ else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) {
+ sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context
+ if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list
+ sc.ChangeState(SCE_A68K_CPUINSTRUCTION);
+ }
+ else if (extInstruction.InList(Buffer)) {
+ sc.ChangeState(SCE_A68K_EXTINSTRUCTION);
+ }
+ else if (registers.InList(Buffer)) {
+ sc.ChangeState(SCE_A68K_REGISTER);
+ }
+ else if (directive.InList(Buffer)) {
+ sc.ChangeState(SCE_A68K_DIRECTIVE);
+ }
+ }
+
+ // All special contexts are now handled.Come back to default style
+ sc.SetState(SCE_A68K_DEFAULT);
+ }
+
+
+ /************************************************************
+ *
+ * Check if we must enter a new state
+ *
+ ************************************************************/
+
+ // Something which begins at the beginning of a line, and with
+ // - '\' + an identifier start char, or
+ // - '\\@' + an identifier start char
+ // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration
+ if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) {
+ sc.SetState(SCE_A68K_LABEL);
+ }
+
+ if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) {
+ sc.Forward(2);
+ if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) {
+ sc.ChangeState(SCE_A68K_LABEL);
+ sc.SetState(SCE_A68K_LABEL);
+ }
+ }
+
+ // Label and macro identifiers start at the beginning of a line
+ // We set both as a macro id, but if it wasn't one (':' at the end),
+ // it will be changed as a label.
+ if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) {
+ sc.SetState(SCE_A68K_MACRO_DECLARATION);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match
+ sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment
+ }
+ else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix
+ sc.SetState(SCE_A68K_NUMBER_DEC);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == '%')) { // Binary numbers are prefixed with '%'
+ sc.SetState(SCE_A68K_NUMBER_BIN);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == '$')) { // Hexadecimal numbers are prefixed with '$'
+ sc.SetState(SCE_A68K_NUMBER_HEX);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == '\'')) { // String (single-quoted)
+ sc.SetState(SCE_A68K_STRING1);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted)
+ sc.SetState(SCE_A68K_STRING2);
+ }
+ else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\'
+ sc.SetState(SCE_A68K_MACRO_ARG);
+ }
+ else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc...
+ sc.SetState(SCE_A68K_IDENTIFIER);
+ }
+ else {
+ if (sc.ch < 0x80) {
+ OpType = GetOperatorType(sc.ch, sc.chNext); // Check if current char is an operator
+ if (OpType != NO_OPERATOR) {
+ sc.SetState(SCE_A68K_OPERATOR);
+ if (OpType == OPERATOR_2CHAR) { // Check if the operator is 2 bytes long
+ sc.ForwardSetState(SCE_A68K_OPERATOR); // (>> or <<)
+ }
+ }
+ }
+ }
+ } // End of for()
+ sc.Complete();
+}
+
+
+// Names of the keyword lists
+
+static const char * const a68kWordListDesc[] =
+{
+ "CPU instructions",
+ "Registers",
+ "Directives",
+ "Extended instructions",
+ "Comment special words",
+ "Doxygen keywords",
+ 0
+};
+
+LexerModule lmA68k(SCLEX_A68K, ColouriseA68kDoc, "a68k", 0, a68kWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAPDL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAPDL.cxx
new file mode 100644
index 00000000000..7d65a561534
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAPDL.cxx
@@ -0,0 +1,259 @@
+// Scintilla source code edit control
+/** @file LexAPDL.cxx
+ ** Lexer for APDL. Based on the lexer for Assembler by The Black Horus.
+ ** By Hadar Raz.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80 && (isalnum(ch) || ch == '_'));
+}
+
+static inline bool IsAnOperator(char ch) {
+ // '.' left out as it is used to make up numbers
+ if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' || ch == '^' ||
+ ch == '[' || ch == ']' || ch == '<' || ch == '&' ||
+ ch == '>' || ch == ',' || ch == '|' || ch == '~' ||
+ ch == '$' || ch == ':' || ch == '%')
+ return true;
+ return false;
+}
+
+static void ColouriseAPDLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ int stringStart = ' ';
+
+ WordList &processors = *keywordlists[0];
+ WordList &commands = *keywordlists[1];
+ WordList &slashcommands = *keywordlists[2];
+ WordList &starcommands = *keywordlists[3];
+ WordList &arguments = *keywordlists[4];
+ WordList &functions = *keywordlists[5];
+
+ // Do not leak onto next line
+ initStyle = SCE_APDL_DEFAULT;
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_APDL_NUMBER) {
+ if (!(IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') ||
+ ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) {
+ sc.SetState(SCE_APDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_APDL_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_APDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_APDL_COMMENTBLOCK) {
+ if (sc.atLineEnd) {
+ if (sc.ch == '\r') {
+ sc.Forward();
+ }
+ sc.ForwardSetState(SCE_APDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_APDL_STRING) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_APDL_DEFAULT);
+ } else if ((sc.ch == '\'' && stringStart == '\'') || (sc.ch == '\"' && stringStart == '\"')) {
+ sc.ForwardSetState(SCE_APDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_APDL_WORD) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (processors.InList(s)) {
+ sc.ChangeState(SCE_APDL_PROCESSOR);
+ } else if (slashcommands.InList(s)) {
+ sc.ChangeState(SCE_APDL_SLASHCOMMAND);
+ } else if (starcommands.InList(s)) {
+ sc.ChangeState(SCE_APDL_STARCOMMAND);
+ } else if (commands.InList(s)) {
+ sc.ChangeState(SCE_APDL_COMMAND);
+ } else if (arguments.InList(s)) {
+ sc.ChangeState(SCE_APDL_ARGUMENT);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_APDL_FUNCTION);
+ }
+ sc.SetState(SCE_APDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_APDL_OPERATOR) {
+ if (!IsAnOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_APDL_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_APDL_DEFAULT) {
+ if (sc.ch == '!' && sc.chNext == '!') {
+ sc.SetState(SCE_APDL_COMMENTBLOCK);
+ } else if (sc.ch == '!') {
+ sc.SetState(SCE_APDL_COMMENT);
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_APDL_NUMBER);
+ } else if (sc.ch == '\'' || sc.ch == '\"') {
+ sc.SetState(SCE_APDL_STRING);
+ stringStart = sc.ch;
+ } else if (IsAWordChar(sc.ch) || ((sc.ch == '*' || sc.ch == '/') && !isgraph(sc.chPrev))) {
+ sc.SetState(SCE_APDL_WORD);
+ } else if (IsAnOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_APDL_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+//------------------------------------------------------------------------------
+// 06-27-07 Sergio Lucato
+// - Included code folding for Ansys APDL lexer
+// - Copyied from LexBasic.cxx and modified for APDL
+//------------------------------------------------------------------------------
+
+/* Bits:
+ * 1 - whitespace
+ * 2 - operator
+ * 4 - identifier
+ * 8 - decimal digit
+ * 16 - hex digit
+ * 32 - bin digit
+ */
+static int character_classification[128] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 10, 6,
+ 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2,
+ 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4,
+ 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0
+};
+
+static bool IsSpace(int c) {
+ return c < 128 && (character_classification[c] & 1);
+}
+
+static bool IsIdentifier(int c) {
+ return c < 128 && (character_classification[c] & 4);
+}
+
+static int LowerCase(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return 'a' + c - 'A';
+ return c;
+}
+
+static int CheckAPDLFoldPoint(char const *token, int &level) {
+ if (!strcmp(token, "*if") ||
+ !strcmp(token, "*do") ||
+ !strcmp(token, "*dowhile") ) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ return 1;
+ }
+ if (!strcmp(token, "*endif") ||
+ !strcmp(token, "*enddo") ) {
+ return -1;
+ }
+ return 0;
+}
+
+static void FoldAPDLDoc(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler) {
+
+ int line = styler.GetLine(startPos);
+ int level = styler.LevelAt(line);
+ int go = 0, done = 0;
+ int endPos = startPos + length;
+ char word[256];
+ int wordlen = 0;
+ int i;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ // Scan for tokens at the start of the line (they may include
+ // whitespace, for tokens like "End Function"
+ for (i = startPos; i < endPos; i++) {
+ int c = styler.SafeGetCharAt(i);
+ if (!done && !go) {
+ if (wordlen) { // are we scanning a token already?
+ word[wordlen] = static_cast<char>(LowerCase(c));
+ if (!IsIdentifier(c)) { // done with token
+ word[wordlen] = '\0';
+ go = CheckAPDLFoldPoint(word, level);
+ if (!go) {
+ // Treat any whitespace as single blank, for
+ // things like "End Function".
+ if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) {
+ word[wordlen] = ' ';
+ if (wordlen < 255)
+ wordlen++;
+ }
+ else // done with this line
+ done = 1;
+ }
+ } else if (wordlen < 255) {
+ wordlen++;
+ }
+ } else { // start scanning at first non-whitespace character
+ if (!IsSpace(c)) {
+ if (IsIdentifier(c)) {
+ word[0] = static_cast<char>(LowerCase(c));
+ wordlen = 1;
+ } else // done with this line
+ done = 1;
+ }
+ }
+ }
+ if (c == '\n') { // line end
+ if (!done && wordlen == 0 && foldCompact) // line was only space
+ level |= SC_FOLDLEVELWHITEFLAG;
+ if (level != styler.LevelAt(line))
+ styler.SetLevel(line, level);
+ level += go;
+ line++;
+ // reset state
+ wordlen = 0;
+ level &= ~SC_FOLDLEVELHEADERFLAG;
+ level &= ~SC_FOLDLEVELWHITEFLAG;
+ go = 0;
+ done = 0;
+ }
+ }
+}
+
+static const char * const apdlWordListDesc[] = {
+ "processors",
+ "commands",
+ "slashommands",
+ "starcommands",
+ "arguments",
+ "functions",
+ 0
+};
+
+LexerModule lmAPDL(SCLEX_APDL, ColouriseAPDLDoc, "apdl", FoldAPDLDoc, apdlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexASY.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexASY.cxx
new file mode 100644
index 00000000000..9e3470cda30
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexASY.cxx
@@ -0,0 +1,271 @@
+// Scintilla source code edit control
+//Author: instanton (email: soft_share<at>126<dot>com)
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColouriseAsyDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
+
+ int visibleChars = 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ if (sc.state == SCE_ASY_STRING) {
+ sc.SetState(SCE_ASY_STRING);
+ }
+ visibleChars = 0;
+ }
+
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+// continuationLine = true;
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_ASY_OPERATOR:
+ sc.SetState(SCE_ASY_DEFAULT);
+ break;
+ case SCE_ASY_NUMBER:
+ if (!setWord.Contains(sc.ch)) {
+ sc.SetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ case SCE_ASY_IDENTIFIER:
+ if (!setWord.Contains(sc.ch) || (sc.ch == '.')) {
+ char s[1000];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_ASY_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_ASY_WORD2);
+ }
+ sc.SetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ case SCE_ASY_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ case SCE_ASY_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ case SCE_ASY_STRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ASY_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ case SCE_ASY_CHARACTER:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ASY_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_ASY_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_ASY_DEFAULT) {
+ if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
+ sc.SetState(SCE_ASY_IDENTIFIER);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_ASY_COMMENT);
+ sc.Forward(); //
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_ASY_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_ASY_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_ASY_CHARACTER);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_ASY_DEFAULT);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_ASY_OPERATOR);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+static bool IsAsyCommentStyle(int style) {
+ return style == SCE_ASY_COMMENT;
+}
+
+
+static inline bool isASYidentifier(int ch) {
+ return
+ ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ;
+}
+
+static int ParseASYWord(unsigned int pos, Accessor &styler, char *word)
+{
+ int length=0;
+ char ch=styler.SafeGetCharAt(pos);
+ *word=0;
+
+ while(isASYidentifier(ch) && length<100){
+ word[length]=ch;
+ length++;
+ ch=styler.SafeGetCharAt(pos+length);
+ }
+ word[length]=0;
+ return length;
+}
+
+static bool IsASYDrawingLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+
+ int startpos = pos;
+ char buffer[100]="";
+
+ while (startpos<eol_pos){
+ char ch = styler[startpos];
+ ParseASYWord(startpos,styler,buffer);
+ bool drawcommands = strncmp(buffer,"draw",4)==0||
+ strncmp(buffer,"pair",4)==0||strncmp(buffer,"label",5)==0;
+ if (!drawcommands && ch!=' ') return false;
+ else if (drawcommands) return true;
+ startpos++;
+ }
+ return false;
+}
+
+static void FoldAsyDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && IsAsyCommentStyle(style)) {
+ if (!IsAsyCommentStyle(stylePrev) && (stylePrev != SCE_ASY_COMMENTLINEDOC)) {
+ levelNext++;
+ } else if (!IsAsyCommentStyle(styleNext) && (styleNext != SCE_ASY_COMMENTLINEDOC) && !atEOL) {
+ levelNext--;
+ }
+ }
+ if (style == SCE_ASY_OPERATOR) {
+ if (ch == '{') {
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+
+ if (atEOL && IsASYDrawingLine(lineCurrent, styler)){
+ if (lineCurrent==0 && IsASYDrawingLine(lineCurrent + 1, styler))
+ levelNext++;
+ else if (lineCurrent!=0 && !IsASYDrawingLine(lineCurrent - 1, styler)
+ && IsASYDrawingLine(lineCurrent + 1, styler)
+ )
+ levelNext++;
+ else if (lineCurrent!=0 && IsASYDrawingLine(lineCurrent - 1, styler) &&
+ !IsASYDrawingLine(lineCurrent+1, styler))
+ levelNext--;
+ }
+
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ }
+}
+
+static const char * const asyWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ 0,
+ };
+
+LexerModule lmASY(SCLEX_ASYMPTOTE, ColouriseAsyDoc, "asy", FoldAsyDoc, asyWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAU3.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAU3.cxx
new file mode 100644
index 00000000000..68f1798d335
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAU3.cxx
@@ -0,0 +1,910 @@
+// Scintilla source code edit control
+// @file LexAU3.cxx
+// Lexer for AutoIt3 http://www.hiddensoft.com/autoit3
+// by Jos van der Zande, jvdzande@yahoo.com
+//
+// Changes:
+// March 28, 2004 - Added the standard Folding code
+// April 21, 2004 - Added Preprosessor Table + Syntax Highlighting
+// Fixed Number highlighting
+// Changed default isoperator to IsAOperator to have a better match to AutoIt3
+// Fixed "#comments_start" -> "#comments-start"
+// Fixed "#comments_end" -> "#comments-end"
+// Fixed Sendkeys in Strings when not terminated with }
+// Added support for Sendkey strings that have second parameter e.g. {UP 5} or {a down}
+// April 26, 2004 - Fixed # pre-processor statement inside of comment block would invalidly change the color.
+// Added logic for #include <xyz.au3> to treat the <> as string
+// Added underscore to IsAOperator.
+// May 17, 2004 - Changed the folding logic from indent to keyword folding.
+// Added Folding logic for blocks of single-commentlines or commentblock.
+// triggered by: fold.comment=1
+// Added Folding logic for preprocessor blocks triggered by fold.preprocessor=1
+// Added Special for #region - #endregion syntax highlight and folding.
+// May 30, 2004 - Fixed issue with continuation lines on If statements.
+// June 5, 2004 - Added comma to Operators for better readability.
+// Added fold.compact support set with fold.compact=1
+// Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1
+// it will now only happen when fold.comment=2.
+// Sep 5, 2004 - Added logic to handle colourizing words on the last line.
+// Typed Characters now show as "default" till they match any table.
+// Oct 10, 2004 - Added logic to show Comments in "Special" directives.
+// Nov 1, 2004 - Added better testing for Numbers supporting x and e notation.
+// Nov 28, 2004 - Added logic to handle continuation lines for syntax highlighting.
+// Jan 10, 2005 - Added Abbreviations Keyword used for expansion
+// Mar 24, 2005 - Updated Abbreviations Keywords to fix when followed by Operator.
+// Apr 18, 2005 - Updated #CE/#Comment-End logic to take a linecomment ";" into account
+// - Added folding support for With...EndWith
+// - Added support for a DOT in variable names
+// - Fixed Underscore in CommentBlock
+// May 23, 2005 - Fixed the SentKey lexing in case of a missing }
+// Aug 11, 2005 - Fixed possible bug with s_save length > 100.
+// Aug 23, 2005 - Added Switch/endswitch support to the folding logic.
+// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys.
+// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions.
+// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF)
+// Mar 9, 2007 - Fixed bug with + following a String getting the wrong Color.
+// Jun 20, 2007 - Fixed Commentblock issue when LF's are used as EOL.
+// Jul 26, 2007 - Fixed #endregion undetected bug.
+//
+// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+// Scintilla source code edit control
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsTypeCharacter(const int ch)
+{
+ return ch == '$';
+}
+static inline bool IsAWordChar(const int ch)
+{
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch)
+{
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.');
+}
+
+static inline bool IsAOperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
+ ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' ||
+ ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == ',' )
+ return true;
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// GetSendKey() filters the portion before and after a/multiple space(s)
+// and return the first portion to be looked-up in the table
+// also check if the second portion is valid... (up,down.on.off,toggle or a number)
+///////////////////////////////////////////////////////////////////////////////
+
+static int GetSendKey(const char *szLine, char *szKey)
+{
+ int nFlag = 0;
+ int nStartFound = 0;
+ int nKeyPos = 0;
+ int nSpecPos= 0;
+ int nSpecNum= 1;
+ int nPos = 0;
+ char cTemp;
+ char szSpecial[100];
+
+ // split the portion of the sendkey in the part before and after the spaces
+ while ( ( (cTemp = szLine[nPos]) != '\0'))
+ {
+ // skip leading Ctrl/Shift/Alt state
+ if (cTemp == '{') {
+ nStartFound = 1;
+ }
+ //
+ if (nStartFound == 1) {
+ if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space
+ {
+ nFlag = 1;
+ // Add } to the end of the first bit for table lookup later.
+ szKey[nKeyPos++] = '}';
+ }
+ else if (cTemp == ' ')
+ {
+ // skip other spaces
+ }
+ else if (nFlag == 0)
+ {
+ // save first portion into var till space or } is hit
+ szKey[nKeyPos++] = cTemp;
+ }
+ else if ((nFlag == 1) && (cTemp != '}'))
+ {
+ // Save second portion into var...
+ szSpecial[nSpecPos++] = cTemp;
+ // check if Second portion is all numbers for repeat fuction
+ if (isdigit(cTemp) == false) {nSpecNum = 0;}
+ }
+ }
+ nPos++; // skip to next char
+
+ } // End While
+
+
+ // Check if the second portion is either a number or one of these keywords
+ szKey[nKeyPos] = '\0';
+ szSpecial[nSpecPos] = '\0';
+ if (strcmp(szSpecial,"down")== 0 || strcmp(szSpecial,"up")== 0 ||
+ strcmp(szSpecial,"on")== 0 || strcmp(szSpecial,"off")== 0 ||
+ strcmp(szSpecial,"toggle")== 0 || nSpecNum == 1 )
+ {
+ nFlag = 0;
+ }
+ else
+ {
+ nFlag = 1;
+ }
+ return nFlag; // 1 is bad, 0 is good
+
+} // GetSendKey()
+
+//
+// Routine to check the last "none comment" character on a line to see if its a continuation
+//
+static bool IsContinuationLine(unsigned int szLine, Accessor &styler)
+{
+ int nsPos = styler.LineStart(szLine);
+ int nePos = styler.LineStart(szLine+1) - 2;
+ //int stylech = styler.StyleAt(nsPos);
+ while (nsPos < nePos)
+ {
+ //stylech = styler.StyleAt(nePos);
+ int stylech = styler.StyleAt(nsPos);
+ if (!(stylech == SCE_AU3_COMMENT)) {
+ char ch = styler.SafeGetCharAt(nePos);
+ if (!isspacechar(ch)) {
+ if (ch == '_')
+ return true;
+ else
+ return false;
+ }
+ }
+ nePos--; // skip to next char
+ } // End While
+ return false;
+} // IsContinuationLine()
+
+//
+// syntax highlighting logic
+static void ColouriseAU3Doc(unsigned int startPos,
+ int length, int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+ WordList &keywords7 = *keywordlists[6];
+ WordList &keywords8 = *keywordlists[7];
+ // find the first previous line without continuation character at the end
+ int lineCurrent = styler.GetLine(startPos);
+ int s_startPos = startPos;
+ // When not inside a Block comment: find First line without _
+ if (!(initStyle==SCE_AU3_COMMENTBLOCK)) {
+ while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) ||
+ (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent); // get start position
+ initStyle = 0; // reset the start style to 0
+ }
+ }
+ // Set the new length to include it from the start and set the start position
+ length = length + s_startPos - startPos; // correct the total length to process
+ styler.StartAt(startPos);
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ char si; // string indicator "=1 '=2
+ char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3
+ char ci; // comment indicator 0=not linecomment(;)
+ char s_save[100] = "";
+ si=0;
+ ni=0;
+ ci=0;
+ //$$$
+ for (; sc.More(); sc.Forward()) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ // **********************************************
+ // save the total current word for eof processing
+ if (IsAWordChar(sc.ch) || sc.ch == '}')
+ {
+ strcpy(s_save,s);
+ int tp = static_cast<int>(strlen(s_save));
+ if (tp < 99) {
+ s_save[tp] = static_cast<char>(tolower(sc.ch));
+ s_save[tp+1] = '\0';
+ }
+ }
+ // **********************************************
+ //
+ switch (sc.state)
+ {
+ case SCE_AU3_COMMENTBLOCK:
+ {
+ //Reset at line end
+ if (sc.atLineEnd) {
+ ci=0;
+ if (strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0) {
+ if (sc.atLineEnd)
+ sc.SetState(SCE_AU3_DEFAULT);
+ else
+ sc.SetState(SCE_AU3_COMMENTBLOCK);
+ }
+ break;
+ }
+ //skip rest of line when a ; is encountered
+ if (sc.chPrev == ';') {
+ ci=2;
+ sc.SetState(SCE_AU3_COMMENTBLOCK);
+ }
+ // skip rest of the line
+ if (ci==2)
+ break;
+ // check when first character is detected on the line
+ if (ci==0) {
+ if (IsAWordStart(static_cast<char>(sc.ch)) || IsAOperator(static_cast<char>(sc.ch))) {
+ ci=1;
+ sc.SetState(SCE_AU3_COMMENTBLOCK);
+ }
+ break;
+ }
+ if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) {
+ if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0))
+ sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line
+ else
+ ci=2; // line doesn't begin with #CE so skip the rest of the line
+ }
+ break;
+ }
+ case SCE_AU3_COMMENT:
+ {
+ if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
+ break;
+ }
+ case SCE_AU3_OPERATOR:
+ {
+ // check if its a COMobject
+ if (sc.chPrev == '.' && IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_AU3_COMOBJ);
+ }
+ else {
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ break;
+ }
+ case SCE_AU3_SPECIAL:
+ {
+ if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
+ if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
+ break;
+ }
+ case SCE_AU3_KEYWORD:
+ {
+ if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && (strcmp(s, "#comments") == 0 || strcmp(s, "#include") == 0))))
+ {
+ if (!IsTypeCharacter(sc.ch))
+ {
+ if (strcmp(s, "#cs")== 0 || strcmp(s, "#comments-start")== 0 )
+ {
+ sc.ChangeState(SCE_AU3_COMMENTBLOCK);
+ sc.SetState(SCE_AU3_COMMENTBLOCK);
+ break;
+ }
+ else if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AU3_KEYWORD);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_AU3_FUNCTION);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_AU3_MACRO);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_AU3_PREPROCESSOR);
+ sc.SetState(SCE_AU3_DEFAULT);
+ if (strcmp(s, "#include")== 0)
+ {
+ si = 3; // use to determine string start for #inlude <>
+ }
+ }
+ else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_AU3_SPECIAL);
+ sc.SetState(SCE_AU3_SPECIAL);
+ }
+ else if ((keywords7.InList(s)) && (!IsAOperator(static_cast<char>(sc.ch)))) {
+ sc.ChangeState(SCE_AU3_EXPAND);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_AU3_UDF);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (strcmp(s, "_") == 0) {
+ sc.ChangeState(SCE_AU3_OPERATOR);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ else if (!IsAWordChar(sc.ch)) {
+ sc.ChangeState(SCE_AU3_DEFAULT);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ }
+ }
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_AU3_DEFAULT);}
+ break;
+ }
+ case SCE_AU3_NUMBER:
+ {
+ // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3
+ //
+ // test for Hex notation
+ if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0)
+ {
+ ni = 2;
+ break;
+ }
+ // test for E notation
+ if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1)
+ {
+ ni = 3;
+ break;
+ }
+ // Allow Hex characters inside hex numeric strings
+ if ((ni == 2) &&
+ (sc.ch == 'a' || sc.ch == 'b' || sc.ch == 'c' || sc.ch == 'd' || sc.ch == 'e' || sc.ch == 'f' ||
+ sc.ch == 'A' || sc.ch == 'B' || sc.ch == 'C' || sc.ch == 'D' || sc.ch == 'E' || sc.ch == 'F' ))
+ {
+ break;
+ }
+ // test for 1 dec point only
+ if (sc.ch == '.')
+ {
+ if (ni==0)
+ {
+ ni=1;
+ }
+ else
+ {
+ ni=9;
+ }
+ break;
+ }
+ // end of numeric string ?
+ if (!(IsADigit(sc.ch)))
+ {
+ if (ni==9)
+ {
+ sc.ChangeState(SCE_AU3_DEFAULT);
+ }
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ break;
+ }
+ case SCE_AU3_VARIABLE:
+ {
+ // Check if its a COMObject
+ if (sc.ch == '.' && !IsADigit(sc.chNext)) {
+ sc.SetState(SCE_AU3_OPERATOR);
+ }
+ else if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ break;
+ }
+ case SCE_AU3_COMOBJ:
+ {
+ if (!(IsAWordChar(sc.ch))) {
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ break;
+ }
+ case SCE_AU3_STRING:
+ {
+ // check for " to end a double qouted string or
+ // check for ' to end a single qouted string
+ if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>'))
+ {
+ sc.ForwardSetState(SCE_AU3_DEFAULT);
+ si=0;
+ break;
+ }
+ if (sc.atLineEnd)
+ {
+ si=0;
+ // at line end and not found a continuation char then reset to default
+ int lineCurrent = styler.GetLine(sc.currentPos);
+ if (!IsContinuationLine(lineCurrent,styler))
+ {
+ sc.SetState(SCE_AU3_DEFAULT);
+ break;
+ }
+ }
+ // find Sendkeys in a STRING
+ if (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ) {
+ sc.SetState(SCE_AU3_SENT);}
+ break;
+ }
+
+ case SCE_AU3_SENT:
+ {
+ // Send key string ended
+ if (sc.chPrev == '}' && sc.ch != '}')
+ {
+ // set color to SENDKEY when valid sendkey .. else set back to regular string
+ char sk[100];
+ // split {111 222} and return {111} and check if 222 is valid.
+ // if return code = 1 then invalid 222 so must be string
+ if (GetSendKey(s,sk))
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ }
+ // if single char between {?} then its ok as sendkey for a single character
+ else if (strlen(sk) == 3)
+ {
+ sc.ChangeState(SCE_AU3_SENT);
+ }
+ // if sendkey {111} is in table then ok as sendkey
+ else if (keywords4.InList(sk))
+ {
+ sc.ChangeState(SCE_AU3_SENT);
+ }
+ else
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ }
+ sc.SetState(SCE_AU3_STRING);
+ }
+ else
+ {
+ // check if the start is a valid SendKey start
+ int nPos = 0;
+ int nState = 1;
+ char cTemp;
+ while (!(nState == 2) && ((cTemp = s[nPos]) != '\0'))
+ {
+ if (cTemp == '{' && nState == 1)
+ {
+ nState = 2;
+ }
+ if (nState == 1 && !(cTemp == '+' || cTemp == '!' || cTemp == '^' || cTemp == '#' ))
+ {
+ nState = 0;
+ }
+ nPos++;
+ }
+ //Verify characters infront of { ... if not assume regular string
+ if (nState == 1 && (!(sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ))) {
+ sc.ChangeState(SCE_AU3_STRING);
+ sc.SetState(SCE_AU3_STRING);
+ }
+ // If invalid character found then assume its a regular string
+ if (nState == 0) {
+ sc.ChangeState(SCE_AU3_STRING);
+ sc.SetState(SCE_AU3_STRING);
+ }
+ }
+ // check if next portion is again a sendkey
+ if (sc.atLineEnd)
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ sc.SetState(SCE_AU3_DEFAULT);
+ si = 0; // reset string indicator
+ }
+ //* check in next characters following a sentkey are again a sent key
+ // Need this test incase of 2 sentkeys like {F1}{ENTER} but not detect {{}
+ if (sc.state == SCE_AU3_STRING && (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' )) {
+ sc.SetState(SCE_AU3_SENT);}
+ // check to see if the string ended...
+ // Sendkey string isn't complete but the string ended....
+ if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\''))
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ sc.ForwardSetState(SCE_AU3_DEFAULT);
+ }
+ break;
+ }
+ } //switch (sc.state)
+
+ // Determine if a new state should be entered:
+
+ if (sc.state == SCE_AU3_DEFAULT)
+ {
+ if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);}
+ else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);}
+ else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);}
+ else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);}
+ else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);}
+ //else if (sc.ch == '_') {sc.SetState(SCE_AU3_KEYWORD);}
+ else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include
+ else if (sc.ch == '\"') {
+ sc.SetState(SCE_AU3_STRING);
+ si = 1; }
+ else if (sc.ch == '\'') {
+ sc.SetState(SCE_AU3_STRING);
+ si = 2; }
+ else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)))
+ {
+ sc.SetState(SCE_AU3_NUMBER);
+ ni = 0;
+ }
+ else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);}
+ else if (IsAOperator(static_cast<char>(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);}
+ else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);}
+ }
+ } //for (; sc.More(); sc.Forward())
+
+ //*************************************
+ // Colourize the last word correctly
+ //*************************************
+ if (sc.state == SCE_AU3_KEYWORD)
+ {
+ if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 )
+ {
+ sc.ChangeState(SCE_AU3_COMMENTBLOCK);
+ sc.SetState(SCE_AU3_COMMENTBLOCK);
+ }
+ else if (keywords.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_KEYWORD);
+ sc.SetState(SCE_AU3_KEYWORD);
+ }
+ else if (keywords2.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_FUNCTION);
+ sc.SetState(SCE_AU3_FUNCTION);
+ }
+ else if (keywords3.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_MACRO);
+ sc.SetState(SCE_AU3_MACRO);
+ }
+ else if (keywords5.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_PREPROCESSOR);
+ sc.SetState(SCE_AU3_PREPROCESSOR);
+ }
+ else if (keywords6.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_SPECIAL);
+ sc.SetState(SCE_AU3_SPECIAL);
+ }
+ else if (keywords7.InList(s_save) && sc.atLineEnd) {
+ sc.ChangeState(SCE_AU3_EXPAND);
+ sc.SetState(SCE_AU3_EXPAND);
+ }
+ else if (keywords8.InList(s_save)) {
+ sc.ChangeState(SCE_AU3_UDF);
+ sc.SetState(SCE_AU3_UDF);
+ }
+ else {
+ sc.ChangeState(SCE_AU3_DEFAULT);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ }
+ if (sc.state == SCE_AU3_SENT)
+ {
+ // Send key string ended
+ if (sc.chPrev == '}' && sc.ch != '}')
+ {
+ // set color to SENDKEY when valid sendkey .. else set back to regular string
+ char sk[100];
+ // split {111 222} and return {111} and check if 222 is valid.
+ // if return code = 1 then invalid 222 so must be string
+ if (GetSendKey(s_save,sk))
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ }
+ // if single char between {?} then its ok as sendkey for a single character
+ else if (strlen(sk) == 3)
+ {
+ sc.ChangeState(SCE_AU3_SENT);
+ }
+ // if sendkey {111} is in table then ok as sendkey
+ else if (keywords4.InList(sk))
+ {
+ sc.ChangeState(SCE_AU3_SENT);
+ }
+ else
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ }
+ sc.SetState(SCE_AU3_STRING);
+ }
+ // check if next portion is again a sendkey
+ if (sc.atLineEnd)
+ {
+ sc.ChangeState(SCE_AU3_STRING);
+ sc.SetState(SCE_AU3_DEFAULT);
+ }
+ }
+ //*************************************
+ sc.Complete();
+}
+
+//
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_AU3_COMMENT || style == SCE_AU3_COMMENTBLOCK;
+}
+
+//
+// Routine to find first none space on the current line and return its Style
+// needed for comment lines not starting on pos 1
+static int GetStyleFirstWord(unsigned int szLine, Accessor &styler)
+{
+ int nsPos = styler.LineStart(szLine);
+ int nePos = styler.LineStart(szLine+1) - 1;
+ while (isspacechar(styler.SafeGetCharAt(nsPos)) && nsPos < nePos)
+ {
+ nsPos++; // skip to next char
+
+ } // End While
+ return styler.StyleAt(nsPos);
+
+} // GetStyleFirstWord()
+
+
+//
+static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ int endPos = startPos + length;
+ // get settings from the config files for folding comments and preprocessor lines
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldInComment = styler.GetPropertyInt("fold.comment") == 2;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldpreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+ // vars for style of previous/current/next lines
+ int style = GetStyleFirstWord(lineCurrent,styler);
+ int stylePrev = 0;
+ // find the first previous line without continuation character at the end
+ while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) ||
+ (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ if (lineCurrent > 0) {
+ stylePrev = GetStyleFirstWord(lineCurrent-1,styler);
+ }
+ // vars for getting first word to check for keywords
+ bool FirstWordStart = false;
+ bool FirstWordEnd = false;
+ char szKeyword[11]="";
+ int szKeywordlen = 0;
+ char szThen[5]="";
+ int szThenlen = 0;
+ bool ThenFoundLast = false;
+ // var for indentlevel
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+ //
+ int visibleChars = 0;
+ char chNext = styler.SafeGetCharAt(startPos);
+ char chPrev = ' ';
+ //
+ for (int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (IsAWordChar(ch)) {
+ visibleChars++;
+ }
+ // get the syle for the current character neede to check in comment
+ int stylech = styler.StyleAt(i);
+ // get first word for the line for indent check max 9 characters
+ if (FirstWordStart && (!(FirstWordEnd))) {
+ if (!IsAWordChar(ch)) {
+ FirstWordEnd = true;
+ szKeyword[szKeywordlen] = '\0';
+ }
+ else {
+ if (szKeywordlen < 10) {
+ szKeyword[szKeywordlen++] = static_cast<char>(tolower(ch));
+ }
+ }
+ }
+ // start the capture of the first word
+ if (!(FirstWordStart)) {
+ if (IsAWordChar(ch) || IsAWordStart(ch) || ch == ';') {
+ FirstWordStart = true;
+ szKeyword[szKeywordlen++] = static_cast<char>(tolower(ch));
+ }
+ }
+ // only process this logic when not in comment section
+ if (!(stylech == SCE_AU3_COMMENT)) {
+ if (ThenFoundLast) {
+ if (IsAWordChar(ch)) {
+ ThenFoundLast = false;
+ }
+ }
+ // find out if the word "then" is the last on a "if" line
+ if (FirstWordEnd && strcmp(szKeyword,"if") == 0) {
+ if (szThenlen == 4) {
+ szThen[0] = szThen[1];
+ szThen[1] = szThen[2];
+ szThen[2] = szThen[3];
+ szThen[3] = static_cast<char>(tolower(ch));
+ if (strcmp(szThen,"then") == 0 ) {
+ ThenFoundLast = true;
+ }
+ }
+ else {
+ szThen[szThenlen++] = static_cast<char>(tolower(ch));
+ if (szThenlen == 5) {
+ szThen[4] = '\0';
+ }
+ }
+ }
+ }
+ // End of Line found so process the information
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) {
+ // **************************
+ // Folding logic for Keywords
+ // **************************
+ // if a keyword is found on the current line and the line doesn't end with _ (continuation)
+ // and we are not inside a commentblock.
+ if (szKeywordlen > 0 && (!(chPrev == '_')) &&
+ ((!(IsStreamCommentStyle(style)) || foldInComment)) ) {
+ szKeyword[szKeywordlen] = '\0';
+ // only fold "if" last keyword is "then" (else its a one line if)
+ if (strcmp(szKeyword,"if") == 0 && ThenFoundLast) {
+ levelNext++;
+ }
+ // create new fold for these words
+ if (strcmp(szKeyword,"do") == 0 || strcmp(szKeyword,"for") == 0 ||
+ strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0||
+ strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) {
+ levelNext++;
+ }
+ // create double Fold for select&switch because Case will subtract one of the current level
+ if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) {
+ levelNext++;
+ levelNext++;
+ }
+ // end the fold for these words before the current line
+ if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 ||
+ strcmp(szKeyword,"next") == 0 || strcmp(szKeyword,"until") == 0 ||
+ strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){
+ levelNext--;
+ levelCurrent--;
+ }
+ // end the fold for these words before the current line and Start new fold
+ if (strcmp(szKeyword,"case") == 0 || strcmp(szKeyword,"else") == 0 ||
+ strcmp(szKeyword,"elseif") == 0 ) {
+ levelCurrent--;
+ }
+ // end the double fold for this word before the current line
+ if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) {
+ levelNext--;
+ levelNext--;
+ levelCurrent--;
+ levelCurrent--;
+ }
+ // end the fold for these words on the current line
+ if (strcmp(szKeyword,"#endregion") == 0 ) {
+ levelNext--;
+ }
+ }
+ // Preprocessor and Comment folding
+ int styleNext = GetStyleFirstWord(lineCurrent + 1,styler);
+ // *************************************
+ // Folding logic for preprocessor blocks
+ // *************************************
+ // process preprosessor line
+ if (foldpreprocessor && style == SCE_AU3_PREPROCESSOR) {
+ if (!(stylePrev == SCE_AU3_PREPROCESSOR) && (styleNext == SCE_AU3_PREPROCESSOR)) {
+ levelNext++;
+ }
+ // fold till the last line for normal comment lines
+ else if (stylePrev == SCE_AU3_PREPROCESSOR && !(styleNext == SCE_AU3_PREPROCESSOR)) {
+ levelNext--;
+ }
+ }
+ // *********************************
+ // Folding logic for Comment blocks
+ // *********************************
+ if (foldComment && IsStreamCommentStyle(style)) {
+ // Start of a comment block
+ if (!(stylePrev==style) && IsStreamCommentStyle(styleNext) && styleNext==style) {
+ levelNext++;
+ }
+ // fold till the last line for normal comment lines
+ else if (IsStreamCommentStyle(stylePrev)
+ && !(styleNext == SCE_AU3_COMMENT)
+ && stylePrev == SCE_AU3_COMMENT
+ && style == SCE_AU3_COMMENT) {
+ levelNext--;
+ }
+ // fold till the one but last line for Blockcomment lines
+ else if (IsStreamCommentStyle(stylePrev)
+ && !(styleNext == SCE_AU3_COMMENTBLOCK)
+ && style == SCE_AU3_COMMENTBLOCK) {
+ levelNext--;
+ levelCurrent--;
+ }
+ }
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ // reset values for the next line
+ lineCurrent++;
+ stylePrev = style;
+ style = styleNext;
+ levelCurrent = levelNext;
+ visibleChars = 0;
+ // if the last character is an Underscore then don't reset since the line continues on the next line.
+ if (!(chPrev == '_')) {
+ szKeywordlen = 0;
+ szThenlen = 0;
+ FirstWordStart = false;
+ FirstWordEnd = false;
+ ThenFoundLast = false;
+ }
+ }
+ // save the last processed character
+ if (!isspacechar(ch)) {
+ chPrev = ch;
+ visibleChars++;
+ }
+ }
+}
+
+
+//
+
+static const char * const AU3WordLists[] = {
+ "#autoit keywords",
+ "#autoit functions",
+ "#autoit macros",
+ "#autoit Sent keys",
+ "#autoit Pre-processors",
+ "#autoit Special",
+ "#autoit Expand",
+ "#autoit UDF",
+ 0
+};
+LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVE.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVE.cxx
new file mode 100644
index 00000000000..8f5729e3d8b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVE.cxx
@@ -0,0 +1,231 @@
+// SciTE - Scintilla based Text Editor
+/** @file LexAVE.cxx
+ ** Lexer for Avenue.
+ **
+ ** Written by Alexey Yutkin <yutkin@geol.msu.ru>.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+static inline bool IsEnumChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch)|| ch == '_');
+}
+static inline bool IsANumberChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' );
+}
+
+inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+inline bool isAveOperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' ||
+ ch == '{' || ch == '}' ||
+ ch == '[' || ch == ']' || ch == ';' ||
+ ch == '<' || ch == '>' || ch == ',' ||
+ ch == '.' )
+ return true;
+ return false;
+}
+
+static void ColouriseAveDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+
+ // Do not leak onto next line
+ if (initStyle == SCE_AVE_STRINGEOL) {
+ initStyle = SCE_AVE_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ int currentLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(currentLine, 0);
+ }
+ if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) {
+ // Prevent SCE_AVE_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_AVE_STRING);
+ }
+
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_AVE_OPERATOR) {
+ sc.SetState(SCE_AVE_DEFAULT);
+ } else if (sc.state == SCE_AVE_NUMBER) {
+ if (!IsANumberChar(sc.ch)) {
+ sc.SetState(SCE_AVE_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVE_ENUM) {
+ if (!IsEnumChar(sc.ch)) {
+ sc.SetState(SCE_AVE_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVE_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
+ char s[100];
+ //sc.GetCurrent(s, sizeof(s));
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD4);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD5);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_AVE_WORD6);
+ }
+ sc.SetState(SCE_AVE_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVE_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_AVE_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVE_STRING) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_AVE_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_AVE_STRINGEOL);
+ sc.ForwardSetState(SCE_AVE_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_AVE_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_AVE_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_AVE_IDENTIFIER);
+ } else if (sc.Match('\"')) {
+ sc.SetState(SCE_AVE_STRING);
+ } else if (sc.Match('\'')) {
+ sc.SetState(SCE_AVE_COMMENT);
+ sc.Forward();
+ } else if (isAveOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_AVE_OPERATOR);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_AVE_ENUM);
+ sc.Forward();
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = static_cast<char>(tolower(styler[startPos]));
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ int styleNext = styler.StyleAt(startPos);
+ char s[10] = "";
+
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = static_cast<char>(tolower(chNext));
+ chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1)));
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_AVE_WORD) {
+ if (ch == 't' || ch == 'f' || ch == 'w' || ch == 'e') {
+ for (unsigned int j = 0; j < 6; j++) {
+ if (!iswordchar(styler[i + j])) {
+ break;
+ }
+ s[j] = static_cast<char>(tolower(styler[i + j]));
+ s[j + 1] = '\0';
+ }
+
+ if ((strcmp(s, "then") == 0) || (strcmp(s, "for") == 0) || (strcmp(s, "while") == 0)) {
+ levelCurrent++;
+ }
+ if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) {
+ // Normally "elseif" and "then" will be on the same line and will cancel
+ // each other out. // As implemented, this does not support fold.at.else.
+ levelCurrent--;
+ }
+ }
+ } else if (style == SCE_AVE_OPERATOR) {
+ if (ch == '{' || ch == '(') {
+ levelCurrent++;
+ } else if (ch == '}' || ch == ')') {
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact) {
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ }
+ if ((levelCurrent > levelPrev) && (visibleChars > 0)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch)) {
+ visibleChars++;
+ }
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+LexerModule lmAVE(SCLEX_AVE, ColouriseAveDoc, "ave", FoldAveDoc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVS.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVS.cxx
new file mode 100644
index 00000000000..82e43457902
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAVS.cxx
@@ -0,0 +1,293 @@
+// Scintilla source code edit control
+/** @file LexAVS.cxx
+ ** Lexer for AviSynth.
+ **/
+// Copyright 2012 by Bruno Barbieri <brunorex@gmail.com>
+// Heavily based on LexPOV by Neil Hodgson
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return isalpha(ch) || (ch != ' ' && ch != '\n' && ch != '(' && ch != '.' && ch != ',');
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || ch == '.' || ch == '-' || ch == '+');
+}
+
+static void ColouriseAvsDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &filters = *keywordlists[1];
+ WordList &plugins = *keywordlists[2];
+ WordList &functions = *keywordlists[3];
+ WordList &clipProperties = *keywordlists[4];
+ WordList &userDefined = *keywordlists[5];
+
+ int currentLine = styler.GetLine(startPos);
+ // Initialize the block comment nesting level, if we are inside such a comment.
+ int blockCommentLevel = 0;
+ if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) {
+ blockCommentLevel = styler.GetLineState(currentLine - 1);
+ }
+
+ // Do not leak onto next line
+ if (initStyle == SCE_AVS_COMMENTLINE) {
+ initStyle = SCE_AVS_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ currentLine = styler.GetLine(sc.currentPos);
+ if (sc.state == SCE_AVS_COMMENTBLOCK || sc.state == SCE_AVS_COMMENTBLOCKN) {
+ // Inside a block comment, we set the line state
+ styler.SetLineState(currentLine, blockCommentLevel);
+ } else {
+ // Reset the line state
+ styler.SetLineState(currentLine, 0);
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_AVS_OPERATOR) {
+ sc.SetState(SCE_AVS_DEFAULT);
+ } else if (sc.state == SCE_AVS_NUMBER) {
+ // We stop the number definition on non-numerical non-dot non-sign char
+ if (!IsANumberChar(sc.ch)) {
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AVS_KEYWORD);
+ } else if (filters.InList(s)) {
+ sc.ChangeState(SCE_AVS_FILTER);
+ } else if (plugins.InList(s)) {
+ sc.ChangeState(SCE_AVS_PLUGIN);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_AVS_FUNCTION);
+ } else if (clipProperties.InList(s)) {
+ sc.ChangeState(SCE_AVS_CLIPPROP);
+ } else if (userDefined.InList(s)) {
+ sc.ChangeState(SCE_AVS_USERDFN);
+ }
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_COMMENTBLOCK) {
+ if (sc.Match('/', '*')) {
+ blockCommentLevel++;
+ sc.Forward();
+ } else if (sc.Match('*', '/') && blockCommentLevel > 0) {
+ blockCommentLevel--;
+ sc.Forward();
+ if (blockCommentLevel == 0) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_AVS_COMMENTBLOCKN) {
+ if (sc.Match('[', '*')) {
+ blockCommentLevel++;
+ sc.Forward();
+ } else if (sc.Match('*', ']') && blockCommentLevel > 0) {
+ blockCommentLevel--;
+ sc.Forward();
+ if (blockCommentLevel == 0) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_AVS_COMMENTLINE) {
+ if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_STRING) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_TRIPLESTRING) {
+ if (sc.Match("\"\"\"")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_AVS_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_AVS_NUMBER);
+ } else if (IsADigit(sc.ch) || (sc.ch == ',' && IsADigit(sc.chNext))) {
+ sc.Forward();
+ sc.SetState(SCE_AVS_NUMBER);
+ } else if (sc.Match('/', '*')) {
+ blockCommentLevel = 1;
+ sc.SetState(SCE_AVS_COMMENTBLOCK);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('[', '*')) {
+ blockCommentLevel = 1;
+ sc.SetState(SCE_AVS_COMMENTBLOCKN);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_AVS_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ if (sc.Match("\"\"\"")) {
+ sc.SetState(SCE_AVS_TRIPLESTRING);
+ } else {
+ sc.SetState(SCE_AVS_STRING);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_AVS_OPERATOR);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_AVS_IDENTIFIER);
+ }
+ }
+ }
+
+ // End of file: complete any pending changeState
+ if (sc.state == SCE_AVS_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AVS_KEYWORD);
+ } else if (filters.InList(s)) {
+ sc.ChangeState(SCE_AVS_FILTER);
+ } else if (plugins.InList(s)) {
+ sc.ChangeState(SCE_AVS_PLUGIN);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_AVS_FUNCTION);
+ } else if (clipProperties.InList(s)) {
+ sc.ChangeState(SCE_AVS_CLIPPROP);
+ } else if (userDefined.InList(s)) {
+ sc.ChangeState(SCE_AVS_USERDFN);
+ }
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ }
+
+ sc.Complete();
+}
+
+static void FoldAvsDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *[],
+ Accessor &styler) {
+
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && style == SCE_AVS_COMMENTBLOCK) {
+ if (stylePrev != SCE_AVS_COMMENTBLOCK) {
+ levelCurrent++;
+ } else if ((styleNext != SCE_AVS_COMMENTBLOCK) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (foldComment && style == SCE_AVS_COMMENTBLOCKN) {
+ if (stylePrev != SCE_AVS_COMMENTBLOCKN) {
+ levelCurrent++;
+ } else if ((styleNext != SCE_AVS_COMMENTBLOCKN) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (style == SCE_AVS_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const avsWordLists[] = {
+ "Keywords",
+ "Filters",
+ "Plugins",
+ "Functions",
+ "Clip properties",
+ "User defined functions",
+ 0,
+};
+
+LexerModule lmAVS(SCLEX_AVS, ColouriseAvsDoc, "avs", FoldAvsDoc, avsWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAbaqus.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAbaqus.cxx
new file mode 100644
index 00000000000..d93aa503d92
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAbaqus.cxx
@@ -0,0 +1,605 @@
+// Scintilla source code edit control
+/** @file LexABAQUS.cxx
+ ** Lexer for ABAQUS. Based on the lexer for APDL by Hadar Raz.
+ ** By Sergio Lucato.
+ ** Sort of completely rewritten by Gertjan Kloosterman
+ **/
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// Code folding copyied and modified from LexBasic.cxx
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAKeywordChar(const int ch) {
+ return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' ')));
+}
+
+static inline bool IsASetChar(const int ch) {
+ return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-')));
+}
+
+static void ColouriseABAQUSDoc(unsigned int startPos, int length, int initStyle, WordList*[] /* *keywordlists[] */,
+ Accessor &styler) {
+ enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \
+ DAT_LINE_VAL, DAT_LINE_COMMA,\
+ COMMENT_LINE,\
+ ST_ERROR, LINE_END } state ;
+
+ // Do not leak onto next line
+ state = LINE_END ;
+ initStyle = SCE_ABAQUS_DEFAULT;
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ // Things are actually quite simple
+ // we have commentlines
+ // keywordlines and datalines
+ // On a data line there will only be colouring of numbers
+ // a keyword line is constructed as
+ // *word,[ paramname[=paramvalue]]*
+ // if the line ends with a , the keyword line continues onto the new line
+
+ for (; sc.More(); sc.Forward()) {
+ switch ( state ) {
+ case KW_LINE_KW :
+ if ( sc.atLineEnd ) {
+ // finished the line in keyword state, switch to LINE_END
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ } else if ( IsAKeywordChar(sc.ch) ) {
+ // nothing changes
+ state = KW_LINE_KW ;
+ } else if ( sc.ch == ',' ) {
+ // Well well we say a comma, arguments *MUST* follow
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = KW_LINE_COMMA ;
+ } else {
+ // Flag an error
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ // Done with processing
+ break ;
+ case KW_LINE_COMMA :
+ // acomma on a keywordline was seen
+ if ( IsAKeywordChar(sc.ch)) {
+ sc.SetState(SCE_ABAQUS_ARGUMENT) ;
+ state = KW_LINE_PAR ;
+ } else if ( sc.atLineEnd || (sc.ch == ',') ) {
+ // we remain in keyword mode
+ state = KW_LINE_COMMA ;
+ } else if ( sc.ch == ' ' ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = KW_LINE_COMMA ;
+ } else {
+ // Anything else constitutes an error
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case KW_LINE_PAR :
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ } else if ( IsAKeywordChar(sc.ch) || (sc.ch == '-') ) {
+ // remain in this state
+ state = KW_LINE_PAR ;
+ } else if ( sc.ch == ',' ) {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = KW_LINE_COMMA ;
+ } else if ( sc.ch == '=' ) {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = KW_LINE_EQ ;
+ } else {
+ // Anything else constitutes an error
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case KW_LINE_EQ :
+ if ( sc.ch == ' ' ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ // remain in this state
+ state = KW_LINE_EQ ;
+ } else if ( IsADigit(sc.ch) || (sc.ch == '-') || (sc.ch == '.' && IsADigit(sc.chNext)) ) {
+ sc.SetState(SCE_ABAQUS_NUMBER) ;
+ state = KW_LINE_VAL ;
+ } else if ( IsAKeywordChar(sc.ch) ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = KW_LINE_VAL ;
+ } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) {
+ sc.SetState(SCE_ABAQUS_STRING) ;
+ state = KW_LINE_VAL ;
+ } else {
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case KW_LINE_VAL :
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) {
+ // nothing changes
+ state = KW_LINE_VAL ;
+ } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') ||
+ ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) &&
+ (sc.state == SCE_ABAQUS_NUMBER)) {
+ // remain in number mode
+ state = KW_LINE_VAL ;
+ } else if (sc.state == SCE_ABAQUS_STRING) {
+ // accept everything until a closing quote
+ if ( sc.ch == '\'' || sc.ch == '\"' ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = KW_LINE_VAL ;
+ }
+ } else if ( sc.ch == ',' ) {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = KW_LINE_COMMA ;
+ } else {
+ // anything else is an error
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case DAT_LINE_VAL :
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) {
+ // nothing changes
+ state = DAT_LINE_VAL ;
+ } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') ||
+ ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) &&
+ (sc.state == SCE_ABAQUS_NUMBER)) {
+ // remain in number mode
+ state = DAT_LINE_VAL ;
+ } else if (sc.state == SCE_ABAQUS_STRING) {
+ // accept everything until a closing quote
+ if ( sc.ch == '\'' || sc.ch == '\"' ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = DAT_LINE_VAL ;
+ }
+ } else if ( sc.ch == ',' ) {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = DAT_LINE_COMMA ;
+ } else {
+ // anything else is an error
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case DAT_LINE_COMMA :
+ // a comma on a data line was seen
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ } else if ( sc.ch == ' ' ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = DAT_LINE_COMMA ;
+ } else if (sc.ch == ',') {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = DAT_LINE_COMMA ;
+ } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) {
+ sc.SetState(SCE_ABAQUS_NUMBER) ;
+ state = DAT_LINE_VAL ;
+ } else if ( IsAKeywordChar(sc.ch) ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = DAT_LINE_VAL ;
+ } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) {
+ sc.SetState(SCE_ABAQUS_STRING) ;
+ state = DAT_LINE_VAL ;
+ } else {
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ break ;
+ case COMMENT_LINE :
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ }
+ break ;
+ case ST_ERROR :
+ if ( sc.atLineEnd ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = LINE_END ;
+ }
+ break ;
+ case LINE_END :
+ if ( sc.atLineEnd || sc.ch == ' ' ) {
+ // nothing changes
+ state = LINE_END ;
+ } else if ( sc.ch == '*' ) {
+ if ( sc.chNext == '*' ) {
+ state = COMMENT_LINE ;
+ sc.SetState(SCE_ABAQUS_COMMENT) ;
+ } else {
+ state = KW_LINE_KW ;
+ sc.SetState(SCE_ABAQUS_STARCOMMAND) ;
+ }
+ } else {
+ // it must be a data line, things are as if we are in DAT_LINE_COMMA
+ if ( sc.ch == ',' ) {
+ sc.SetState(SCE_ABAQUS_OPERATOR) ;
+ state = DAT_LINE_COMMA ;
+ } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) {
+ sc.SetState(SCE_ABAQUS_NUMBER) ;
+ state = DAT_LINE_VAL ;
+ } else if ( IsAKeywordChar(sc.ch) ) {
+ sc.SetState(SCE_ABAQUS_DEFAULT) ;
+ state = DAT_LINE_VAL ;
+ } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) {
+ sc.SetState(SCE_ABAQUS_STRING) ;
+ state = DAT_LINE_VAL ;
+ } else {
+ sc.SetState(SCE_ABAQUS_PROCESSOR) ;
+ state = ST_ERROR ;
+ }
+ }
+ break ;
+ }
+ }
+ sc.Complete();
+}
+
+//------------------------------------------------------------------------------
+// This copyied and modified from LexBasic.cxx
+//------------------------------------------------------------------------------
+
+/* Bits:
+ * 1 - whitespace
+ * 2 - operator
+ * 4 - identifier
+ * 8 - decimal digit
+ * 16 - hex digit
+ * 32 - bin digit
+ */
+static int character_classification[128] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 10, 6,
+ 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2,
+ 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4,
+ 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0
+};
+
+static bool IsSpace(int c) {
+ return c < 128 && (character_classification[c] & 1);
+}
+
+static bool IsIdentifier(int c) {
+ return c < 128 && (character_classification[c] & 4);
+}
+
+static int LowerCase(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return 'a' + c - 'A';
+ return c;
+}
+
+static int LineEnd(int line, Accessor &styler)
+{
+ const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
+ int eol_pos ;
+ // if the line is the last line, the eol_pos is styler.Length()
+ // eol will contain a new line, or a virtual new line
+ if ( docLines == line )
+ eol_pos = styler.Length() ;
+ else
+ eol_pos = styler.LineStart(line + 1) - 1;
+ return eol_pos ;
+}
+
+static int LineStart(int line, Accessor &styler)
+{
+ return styler.LineStart(line) ;
+}
+
+// LineType
+//
+// bits determines the line type
+// 1 : data line
+// 2 : only whitespace
+// 3 : data line with only whitespace
+// 4 : keyword line
+// 5 : block open keyword line
+// 6 : block close keyword line
+// 7 : keyword line in error
+// 8 : comment line
+static int LineType(int line, Accessor &styler) {
+ int pos = LineStart(line, styler) ;
+ int eol_pos = LineEnd(line, styler) ;
+
+ int c ;
+ char ch = ' ';
+
+ int i = pos ;
+ while ( i < eol_pos ) {
+ c = styler.SafeGetCharAt(i);
+ ch = static_cast<char>(LowerCase(c));
+ // We can say something as soon as no whitespace
+ // was encountered
+ if ( !IsSpace(c) )
+ break ;
+ i++ ;
+ }
+
+ if ( i >= eol_pos ) {
+ // This is a whitespace line, currently
+ // classifies as data line
+ return 3 ;
+ }
+
+ if ( ch != '*' ) {
+ // This is a data line
+ return 1 ;
+ }
+
+ if ( i == eol_pos - 1 ) {
+ // Only a single *, error but make keyword line
+ return 4+3 ;
+ }
+
+ // This means we can have a second character
+ // if that is also a * this means a comment
+ // otherwise it is a keyword.
+ c = styler.SafeGetCharAt(i+1);
+ ch = static_cast<char>(LowerCase(c));
+ if ( ch == '*' ) {
+ return 8 ;
+ }
+
+ // At this point we know this is a keyword line
+ // the character at position i is a *
+ // it is not a comment line
+ char word[256] ;
+ int wlen = 0;
+
+ word[wlen] = '*' ;
+ wlen++ ;
+
+ i++ ;
+ while ( (i < eol_pos) && (wlen < 255) ) {
+ c = styler.SafeGetCharAt(i);
+ ch = static_cast<char>(LowerCase(c));
+
+ if ( (!IsSpace(c)) && (!IsIdentifier(c)) )
+ break ;
+
+ if ( IsIdentifier(c) ) {
+ word[wlen] = ch ;
+ wlen++ ;
+ }
+
+ i++ ;
+ }
+
+ word[wlen] = 0 ;
+
+ // Make a comparison
+ if ( !strcmp(word, "*step") ||
+ !strcmp(word, "*part") ||
+ !strcmp(word, "*instance") ||
+ !strcmp(word, "*assembly")) {
+ return 4+1 ;
+ }
+
+ if ( !strcmp(word, "*endstep") ||
+ !strcmp(word, "*endpart") ||
+ !strcmp(word, "*endinstance") ||
+ !strcmp(word, "*endassembly")) {
+ return 4+2 ;
+ }
+
+ return 4 ;
+}
+
+static void SafeSetLevel(int line, int level, Accessor &styler)
+{
+ if ( line < 0 )
+ return ;
+
+ int mask = ((~SC_FOLDLEVELHEADERFLAG) | (~SC_FOLDLEVELWHITEFLAG));
+
+ if ( (level & mask) < 0 )
+ return ;
+
+ if ( styler.LevelAt(line) != level )
+ styler.SetLevel(line, level) ;
+}
+
+static void FoldABAQUSDoc(unsigned int startPos, int length, int,
+WordList *[], Accessor &styler) {
+ int startLine = styler.GetLine(startPos) ;
+ int endLine = styler.GetLine(startPos+length-1) ;
+
+ // bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ // We want to deal with all the cases
+ // To know the correct indentlevel, we need to look back to the
+ // previous command line indentation level
+ // order of formatting keyline datalines commentlines
+ int beginData = -1 ;
+ int beginComment = -1 ;
+ int prvKeyLine = startLine ;
+ int prvKeyLineTp = 0 ;
+
+ // Scan until we find the previous keyword line
+ // this will give us the level reference that we need
+ while ( prvKeyLine > 0 ) {
+ prvKeyLine-- ;
+ prvKeyLineTp = LineType(prvKeyLine, styler) ;
+ if ( prvKeyLineTp & 4 )
+ break ;
+ }
+
+ // Determine the base line level of all lines following
+ // the previous keyword
+ // new keyword lines are placed on this level
+ //if ( prvKeyLineTp & 4 ) {
+ int level = styler.LevelAt(prvKeyLine) & ~SC_FOLDLEVELHEADERFLAG ;
+ //}
+
+ // uncomment line below if weird behaviour continues
+ prvKeyLine = -1 ;
+
+ // Now start scanning over the lines.
+ for ( int line = startLine; line <= endLine; line++ ) {
+ int lineType = LineType(line, styler) ;
+
+ // Check for comment line
+ if ( lineType == 8 ) {
+ if ( beginComment < 0 ) {
+ beginComment = line ;
+ }
+ }
+
+ // Check for data line
+ if ( (lineType == 1) || (lineType == 3) ) {
+ if ( beginData < 0 ) {
+ if ( beginComment >= 0 ) {
+ beginData = beginComment ;
+ } else {
+ beginData = line ;
+ }
+ }
+ beginComment = -1 ;
+ }
+
+ // Check for keywordline.
+ // As soon as a keyword line is encountered, we can set the
+ // levels of everything from the previous keyword line to this one
+ if ( lineType & 4 ) {
+ // this is a keyword, we can now place the previous keyword
+ // all its data lines and the remainder
+
+ // Write comments and data line
+ if ( beginComment < 0 ) {
+ beginComment = line ;
+ }
+
+ if ( beginData < 0 ) {
+ beginData = beginComment ;
+ if ( prvKeyLineTp != 5 )
+ SafeSetLevel(prvKeyLine, level, styler) ;
+ else
+ SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ;
+ } else {
+ SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ;
+ }
+
+ int datLevel = level + 1 ;
+ if ( !(prvKeyLineTp & 4) ) {
+ datLevel = level ;
+ }
+
+ for ( int ll = beginData; ll < beginComment; ll++ )
+ SafeSetLevel(ll, datLevel, styler) ;
+
+ // The keyword we just found is going to be written at another level
+ // if we have a type 5 and type 6
+ if ( prvKeyLineTp == 5 ) {
+ level += 1 ;
+ }
+
+ if ( prvKeyLineTp == 6 ) {
+ level -= 1 ;
+ if ( level < 0 ) {
+ level = 0 ;
+ }
+ }
+
+ for ( int lll = beginComment; lll < line; lll++ )
+ SafeSetLevel(lll, level, styler) ;
+
+ // wrap and reset
+ beginComment = -1 ;
+ beginData = -1 ;
+ prvKeyLine = line ;
+ prvKeyLineTp = lineType ;
+ }
+
+ }
+
+ if ( beginComment < 0 ) {
+ beginComment = endLine + 1 ;
+ } else {
+ // We need to find out whether this comment block is followed by
+ // a data line or a keyword line
+ const int docLines = styler.GetLine(styler.Length() - 1);
+
+ for ( int line = endLine + 1; line <= docLines; line++ ) {
+ int lineType = LineType(line, styler) ;
+
+ if ( lineType != 8 ) {
+ if ( !(lineType & 4) ) {
+ beginComment = endLine + 1 ;
+ }
+ break ;
+ }
+ }
+ }
+
+ if ( beginData < 0 ) {
+ beginData = beginComment ;
+ if ( prvKeyLineTp != 5 )
+ SafeSetLevel(prvKeyLine, level, styler) ;
+ else
+ SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ;
+ } else {
+ SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ;
+ }
+
+ int datLevel = level + 1 ;
+ if ( !(prvKeyLineTp & 4) ) {
+ datLevel = level ;
+ }
+
+ for ( int ll = beginData; ll < beginComment; ll++ )
+ SafeSetLevel(ll, datLevel, styler) ;
+
+ if ( prvKeyLineTp == 5 ) {
+ level += 1 ;
+ }
+
+ if ( prvKeyLineTp == 6 ) {
+ level -= 1 ;
+ }
+ for ( int m = beginComment; m <= endLine; m++ )
+ SafeSetLevel(m, level, styler) ;
+}
+
+static const char * const abaqusWordListDesc[] = {
+ "processors",
+ "commands",
+ "slashommands",
+ "starcommands",
+ "arguments",
+ "functions",
+ 0
+};
+
+LexerModule lmAbaqus(SCLEX_ABAQUS, ColouriseABAQUSDoc, "abaqus", FoldABAQUSDoc, abaqusWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAda.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAda.cxx
new file mode 100644
index 00000000000..7a7dea60f6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAda.cxx
@@ -0,0 +1,515 @@
+// Scintilla source code edit control
+/** @file LexAda.cxx
+ ** Lexer for Ada 95
+ **/
+// Copyright 2002 by Sergey Koshcheyev <sergey.k@seznam.cz>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+ * Interface
+ */
+
+static void ColouriseDocument(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+static const char * const adaWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc);
+
+/*
+ * Implementation
+ */
+
+// Functions that have apostropheStartsAttribute as a parameter set it according to whether
+// an apostrophe encountered after processing the current token will start an attribute or
+// a character literal.
+static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL);
+static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute);
+static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute);
+
+static inline bool IsDelimiterCharacter(int ch);
+static inline bool IsSeparatorOrDelimiterCharacter(int ch);
+static bool IsValidIdentifier(const std::string& identifier);
+static bool IsValidNumber(const std::string& number);
+static inline bool IsWordStartCharacter(int ch);
+static inline bool IsWordCharacter(int ch);
+
+static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+
+ sc.SetState(SCE_ADA_CHARACTER);
+
+ // Skip the apostrophe and one more character (so that '' is shown as non-terminated and '''
+ // is handled correctly)
+ sc.Forward();
+ sc.Forward();
+
+ ColouriseContext(sc, '\'', SCE_ADA_CHARACTEREOL);
+}
+
+static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL) {
+ while (!sc.atLineEnd && !sc.Match(chEnd)) {
+ sc.Forward();
+ }
+
+ if (!sc.atLineEnd) {
+ sc.ForwardSetState(SCE_ADA_DEFAULT);
+ } else {
+ sc.ChangeState(stateEOL);
+ }
+}
+
+static void ColouriseComment(StyleContext& sc, bool& /*apostropheStartsAttribute*/) {
+ // Apostrophe meaning is not changed, but the parameter is present for uniformity
+
+ sc.SetState(SCE_ADA_COMMENTLINE);
+
+ while (!sc.atLineEnd) {
+ sc.Forward();
+ }
+}
+
+static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = sc.Match (')');
+ sc.SetState(SCE_ADA_DELIMITER);
+ sc.ForwardSetState(SCE_ADA_DEFAULT);
+}
+
+static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = false;
+
+ sc.SetState(SCE_ADA_LABEL);
+
+ // Skip "<<"
+ sc.Forward();
+ sc.Forward();
+
+ std::string identifier;
+
+ while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
+ identifier += static_cast<char>(tolower(sc.ch));
+ sc.Forward();
+ }
+
+ // Skip ">>"
+ if (sc.Match('>', '>')) {
+ sc.Forward();
+ sc.Forward();
+ } else {
+ sc.ChangeState(SCE_ADA_ILLEGAL);
+ }
+
+ // If the name is an invalid identifier or a keyword, then make it invalid label
+ if (!IsValidIdentifier(identifier) || keywords.InList(identifier.c_str())) {
+ sc.ChangeState(SCE_ADA_ILLEGAL);
+ }
+
+ sc.SetState(SCE_ADA_DEFAULT);
+
+}
+
+static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+
+ std::string number;
+ sc.SetState(SCE_ADA_NUMBER);
+
+ // Get all characters up to a delimiter or a separator, including points, but excluding
+ // double points (ranges).
+ while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward();
+ }
+
+ // Special case: exponent with sign
+ if ((sc.chPrev == 'e' || sc.chPrev == 'E') &&
+ (sc.ch == '+' || sc.ch == '-')) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward ();
+
+ while (!IsSeparatorOrDelimiterCharacter(sc.ch)) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward();
+ }
+ }
+
+ if (!IsValidNumber(number)) {
+ sc.ChangeState(SCE_ADA_ILLEGAL);
+ }
+
+ sc.SetState(SCE_ADA_DEFAULT);
+}
+
+static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+
+ sc.SetState(SCE_ADA_STRING);
+ sc.Forward();
+
+ ColouriseContext(sc, '"', SCE_ADA_STRINGEOL);
+}
+
+static void ColouriseWhiteSpace(StyleContext& sc, bool& /*apostropheStartsAttribute*/) {
+ // Apostrophe meaning is not changed, but the parameter is present for uniformity
+ sc.SetState(SCE_ADA_DEFAULT);
+ sc.ForwardSetState(SCE_ADA_DEFAULT);
+}
+
+static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+ sc.SetState(SCE_ADA_IDENTIFIER);
+
+ std::string word;
+
+ while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
+ word += static_cast<char>(tolower(sc.ch));
+ sc.Forward();
+ }
+
+ if (!IsValidIdentifier(word)) {
+ sc.ChangeState(SCE_ADA_ILLEGAL);
+
+ } else if (keywords.InList(word.c_str())) {
+ sc.ChangeState(SCE_ADA_WORD);
+
+ if (word != "all") {
+ apostropheStartsAttribute = false;
+ }
+ }
+
+ sc.SetState(SCE_ADA_DEFAULT);
+}
+
+//
+// ColouriseDocument
+//
+
+static void ColouriseDocument(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+ WordList &keywords = *keywordlists[0];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int lineCurrent = styler.GetLine(startPos);
+ bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
+
+ while (sc.More()) {
+ if (sc.atLineEnd) {
+ // Go to the next line
+ sc.Forward();
+ lineCurrent++;
+
+ // Remember the line state for future incremental lexing
+ styler.SetLineState(lineCurrent, apostropheStartsAttribute);
+
+ // Don't continue any styles on the next line
+ sc.SetState(SCE_ADA_DEFAULT);
+ }
+
+ // Comments
+ if (sc.Match('-', '-')) {
+ ColouriseComment(sc, apostropheStartsAttribute);
+
+ // Strings
+ } else if (sc.Match('"')) {
+ ColouriseString(sc, apostropheStartsAttribute);
+
+ // Characters
+ } else if (sc.Match('\'') && !apostropheStartsAttribute) {
+ ColouriseCharacter(sc, apostropheStartsAttribute);
+
+ // Labels
+ } else if (sc.Match('<', '<')) {
+ ColouriseLabel(sc, keywords, apostropheStartsAttribute);
+
+ // Whitespace
+ } else if (IsASpace(sc.ch)) {
+ ColouriseWhiteSpace(sc, apostropheStartsAttribute);
+
+ // Delimiters
+ } else if (IsDelimiterCharacter(sc.ch)) {
+ ColouriseDelimiter(sc, apostropheStartsAttribute);
+
+ // Numbers
+ } else if (IsADigit(sc.ch) || sc.ch == '#') {
+ ColouriseNumber(sc, apostropheStartsAttribute);
+
+ // Keywords or identifiers
+ } else {
+ ColouriseWord(sc, keywords, apostropheStartsAttribute);
+ }
+ }
+
+ sc.Complete();
+}
+
+static inline bool IsDelimiterCharacter(int ch) {
+ switch (ch) {
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.':
+ case '/':
+ case ':':
+ case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '|':
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
+ return IsASpace(ch) || IsDelimiterCharacter(ch);
+}
+
+static bool IsValidIdentifier(const std::string& identifier) {
+ // First character can't be '_', so initialize the flag to true
+ bool lastWasUnderscore = true;
+
+ size_t length = identifier.length();
+
+ // Zero-length identifiers are not valid (these can occur inside labels)
+ if (length == 0) {
+ return false;
+ }
+
+ // Check for valid character at the start
+ if (!IsWordStartCharacter(identifier[0])) {
+ return false;
+ }
+
+ // Check for only valid characters and no double underscores
+ for (size_t i = 0; i < length; i++) {
+ if (!IsWordCharacter(identifier[i]) ||
+ (identifier[i] == '_' && lastWasUnderscore)) {
+ return false;
+ }
+ lastWasUnderscore = identifier[i] == '_';
+ }
+
+ // Check for underscore at the end
+ if (lastWasUnderscore == true) {
+ return false;
+ }
+
+ // All checks passed
+ return true;
+}
+
+static bool IsValidNumber(const std::string& number) {
+ size_t hashPos = number.find("#");
+ bool seenDot = false;
+
+ size_t i = 0;
+ size_t length = number.length();
+
+ if (length == 0)
+ return false; // Just in case
+
+ // Decimal number
+ if (hashPos == std::string::npos) {
+ bool canBeSpecial = false;
+
+ for (; i < length; i++) {
+ if (number[i] == '_') {
+ if (!canBeSpecial) {
+ return false;
+ }
+ canBeSpecial = false;
+ } else if (number[i] == '.') {
+ if (!canBeSpecial || seenDot) {
+ return false;
+ }
+ canBeSpecial = false;
+ seenDot = true;
+ } else if (IsADigit(number[i])) {
+ canBeSpecial = true;
+ } else {
+ break;
+ }
+ }
+
+ if (!canBeSpecial)
+ return false;
+ } else {
+ // Based number
+ bool canBeSpecial = false;
+ int base = 0;
+
+ // Parse base
+ for (; i < length; i++) {
+ int ch = number[i];
+ if (ch == '_') {
+ if (!canBeSpecial)
+ return false;
+ canBeSpecial = false;
+ } else if (IsADigit(ch)) {
+ base = base * 10 + (ch - '0');
+ if (base > 16)
+ return false;
+ canBeSpecial = true;
+ } else if (ch == '#' && canBeSpecial) {
+ break;
+ } else {
+ return false;
+ }
+ }
+
+ if (base < 2)
+ return false;
+ if (i == length)
+ return false;
+
+ i++; // Skip over '#'
+
+ // Parse number
+ canBeSpecial = false;
+
+ for (; i < length; i++) {
+ int ch = tolower(number[i]);
+
+ if (ch == '_') {
+ if (!canBeSpecial) {
+ return false;
+ }
+ canBeSpecial = false;
+
+ } else if (ch == '.') {
+ if (!canBeSpecial || seenDot) {
+ return false;
+ }
+ canBeSpecial = false;
+ seenDot = true;
+
+ } else if (IsADigit(ch)) {
+ if (ch - '0' >= base) {
+ return false;
+ }
+ canBeSpecial = true;
+
+ } else if (ch >= 'a' && ch <= 'f') {
+ if (ch - 'a' + 10 >= base) {
+ return false;
+ }
+ canBeSpecial = true;
+
+ } else if (ch == '#' && canBeSpecial) {
+ break;
+
+ } else {
+ return false;
+ }
+ }
+
+ if (i == length) {
+ return false;
+ }
+
+ i++;
+ }
+
+ // Exponent (optional)
+ if (i < length) {
+ if (number[i] != 'e' && number[i] != 'E')
+ return false;
+
+ i++; // Move past 'E'
+
+ if (i == length) {
+ return false;
+ }
+
+ if (number[i] == '+')
+ i++;
+ else if (number[i] == '-') {
+ if (seenDot) {
+ i++;
+ } else {
+ return false; // Integer literals should not have negative exponents
+ }
+ }
+
+ if (i == length) {
+ return false;
+ }
+
+ bool canBeSpecial = false;
+
+ for (; i < length; i++) {
+ if (number[i] == '_') {
+ if (!canBeSpecial) {
+ return false;
+ }
+ canBeSpecial = false;
+ } else if (IsADigit(number[i])) {
+ canBeSpecial = true;
+ } else {
+ return false;
+ }
+ }
+
+ if (!canBeSpecial)
+ return false;
+ }
+
+ // if i == length, number was parsed successfully.
+ return i == length;
+}
+
+static inline bool IsWordCharacter(int ch) {
+ return IsWordStartCharacter(ch) || IsADigit(ch);
+}
+
+static inline bool IsWordStartCharacter(int ch) {
+ return (IsASCII(ch) && isalpha(ch)) || ch == '_';
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsm.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsm.cxx
new file mode 100644
index 00000000000..37a4efe3578
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsm.cxx
@@ -0,0 +1,467 @@
+// Scintilla source code edit control
+/** @file LexAsm.cxx
+ ** Lexer for Assembler, just for the MASM syntax
+ ** Written by The Black Horus
+ ** Enhancements and NASM stuff by Kein-Hong Man, 2003-10
+ ** SCE_ASM_COMMENTBLOCK and SCE_ASM_CHARACTER are for future GNU as colouring
+ ** Converted to lexer object and added further folding features/properties by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+#include <set>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
+ ch == '_' || ch == '?');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' ||
+ ch == '%' || ch == '@' || ch == '$' || ch == '?');
+}
+
+static inline bool IsAsmOperator(const int ch) {
+ if ((ch < 0x80) && (isalnum(ch)))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' || ch == '^' ||
+ ch == '[' || ch == ']' || ch == '<' || ch == '&' ||
+ ch == '>' || ch == ',' || ch == '|' || ch == '~' ||
+ ch == '%' || ch == ':')
+ return true;
+ return false;
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_ASM_COMMENTDIRECTIVE || style == SCE_ASM_COMMENTBLOCK;
+}
+
+static inline int LowerCase(int c) {
+ if (c >= 'A' && c <= 'Z')
+ return 'a' + c - 'A';
+ return c;
+}
+
+// An individual named option for use in an OptionSet
+
+// Options used for LexerAsm
+struct OptionsAsm {
+ std::string delimiter;
+ bool fold;
+ bool foldSyntaxBased;
+ bool foldCommentMultiline;
+ bool foldCommentExplicit;
+ std::string foldExplicitStart;
+ std::string foldExplicitEnd;
+ bool foldExplicitAnywhere;
+ bool foldCompact;
+ OptionsAsm() {
+ delimiter = "";
+ fold = false;
+ foldSyntaxBased = true;
+ foldCommentMultiline = false;
+ foldCommentExplicit = false;
+ foldExplicitStart = "";
+ foldExplicitEnd = "";
+ foldExplicitAnywhere = false;
+ foldCompact = true;
+ }
+};
+
+static const char * const asmWordListDesc[] = {
+ "CPU instructions",
+ "FPU instructions",
+ "Registers",
+ "Directives",
+ "Directive operands",
+ "Extended instructions",
+ "Directives4Foldstart",
+ "Directives4Foldend",
+ 0
+};
+
+struct OptionSetAsm : public OptionSet<OptionsAsm> {
+ OptionSetAsm() {
+ DefineProperty("lexer.asm.comment.delimiter", &OptionsAsm::delimiter,
+ "Character used for COMMENT directive's delimiter, replacing the standard \"~\".");
+
+ DefineProperty("fold", &OptionsAsm::fold);
+
+ DefineProperty("fold.asm.syntax.based", &OptionsAsm::foldSyntaxBased,
+ "Set this property to 0 to disable syntax based folding.");
+
+ DefineProperty("fold.asm.comment.multiline", &OptionsAsm::foldCommentMultiline,
+ "Set this property to 1 to enable folding multi-line comments.");
+
+ DefineProperty("fold.asm.comment.explicit", &OptionsAsm::foldCommentExplicit,
+ "This option enables folding explicit fold points when using the Asm lexer. "
+ "Explicit fold points allows adding extra folding by placing a ;{ comment at the start and a ;} "
+ "at the end of a section that should fold.");
+
+ DefineProperty("fold.asm.explicit.start", &OptionsAsm::foldExplicitStart,
+ "The string to use for explicit fold start points, replacing the standard ;{.");
+
+ DefineProperty("fold.asm.explicit.end", &OptionsAsm::foldExplicitEnd,
+ "The string to use for explicit fold end points, replacing the standard ;}.");
+
+ DefineProperty("fold.asm.explicit.anywhere", &OptionsAsm::foldExplicitAnywhere,
+ "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
+
+ DefineProperty("fold.compact", &OptionsAsm::foldCompact);
+
+ DefineWordListSets(asmWordListDesc);
+ }
+};
+
+class LexerAsm : public ILexer {
+ WordList cpuInstruction;
+ WordList mathInstruction;
+ WordList registers;
+ WordList directive;
+ WordList directiveOperand;
+ WordList extInstruction;
+ WordList directives4foldstart;
+ WordList directives4foldend;
+ OptionsAsm options;
+ OptionSetAsm osAsm;
+ int commentChar;
+public:
+ LexerAsm(int commentChar_) {
+ commentChar = commentChar_;
+ }
+ virtual ~LexerAsm() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osAsm.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osAsm.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osAsm.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osAsm.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactoryAsm() {
+ return new LexerAsm(';');
+ }
+
+ static ILexer *LexerFactoryAs() {
+ return new LexerAsm('#');
+ }
+};
+
+int SCI_METHOD LexerAsm::PropertySet(const char *key, const char *val) {
+ if (osAsm.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &cpuInstruction;
+ break;
+ case 1:
+ wordListN = &mathInstruction;
+ break;
+ case 2:
+ wordListN = &registers;
+ break;
+ case 3:
+ wordListN = &directive;
+ break;
+ case 4:
+ wordListN = &directiveOperand;
+ break;
+ case 5:
+ wordListN = &extInstruction;
+ break;
+ case 6:
+ wordListN = &directives4foldstart;
+ break;
+ case 7:
+ wordListN = &directives4foldend;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ // Do not leak onto next line
+ if (initStyle == SCE_ASM_STRINGEOL)
+ initStyle = SCE_ASM_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward())
+ {
+
+ // Prevent SCE_ASM_STRINGEOL from leaking back to previous line
+ if (sc.atLineStart && (sc.state == SCE_ASM_STRING)) {
+ sc.SetState(SCE_ASM_STRING);
+ } else if (sc.atLineStart && (sc.state == SCE_ASM_CHARACTER)) {
+ sc.SetState(SCE_ASM_CHARACTER);
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_ASM_OPERATOR) {
+ if (!IsAsmOperator(sc.ch)) {
+ sc.SetState(SCE_ASM_DEFAULT);
+ }
+ } else if (sc.state == SCE_ASM_NUMBER) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_ASM_DEFAULT);
+ }
+ } else if (sc.state == SCE_ASM_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) ) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ bool IsDirective = false;
+
+ if (cpuInstruction.InList(s)) {
+ sc.ChangeState(SCE_ASM_CPUINSTRUCTION);
+ } else if (mathInstruction.InList(s)) {
+ sc.ChangeState(SCE_ASM_MATHINSTRUCTION);
+ } else if (registers.InList(s)) {
+ sc.ChangeState(SCE_ASM_REGISTER);
+ } else if (directive.InList(s)) {
+ sc.ChangeState(SCE_ASM_DIRECTIVE);
+ IsDirective = true;
+ } else if (directiveOperand.InList(s)) {
+ sc.ChangeState(SCE_ASM_DIRECTIVEOPERAND);
+ } else if (extInstruction.InList(s)) {
+ sc.ChangeState(SCE_ASM_EXTINSTRUCTION);
+ }
+ sc.SetState(SCE_ASM_DEFAULT);
+ if (IsDirective && !strcmp(s, "comment")) {
+ char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0];
+ while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd) {
+ sc.ForwardSetState(SCE_ASM_DEFAULT);
+ }
+ if (sc.ch == delimiter) {
+ sc.SetState(SCE_ASM_COMMENTDIRECTIVE);
+ }
+ }
+ }
+ } else if (sc.state == SCE_ASM_COMMENTDIRECTIVE) {
+ char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0];
+ if (sc.ch == delimiter) {
+ while (!sc.atLineEnd) {
+ sc.Forward();
+ }
+ sc.SetState(SCE_ASM_DEFAULT);
+ }
+ } else if (sc.state == SCE_ASM_COMMENT ) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_ASM_DEFAULT);
+ }
+ } else if (sc.state == SCE_ASM_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_ASM_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ASM_STRINGEOL);
+ sc.ForwardSetState(SCE_ASM_DEFAULT);
+ }
+ } else if (sc.state == SCE_ASM_CHARACTER) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_ASM_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ASM_STRINGEOL);
+ sc.ForwardSetState(SCE_ASM_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_ASM_DEFAULT) {
+ if (sc.ch == commentChar){
+ sc.SetState(SCE_ASM_COMMENT);
+ } else if (IsASCII(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && IsASCII(sc.chNext) && isdigit(sc.chNext)))) {
+ sc.SetState(SCE_ASM_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_ASM_IDENTIFIER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_ASM_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_ASM_CHARACTER);
+ } else if (IsAsmOperator(sc.ch)) {
+ sc.SetState(SCE_ASM_OPERATOR);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "else".
+
+void SCI_METHOD LexerAsm::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ char word[100];
+ int wordlen = 0;
+ const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (options.foldCommentMultiline && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldCommentExplicit && ((style == SCE_ASM_COMMENT) || options.foldExplicitAnywhere)) {
+ if (userDefinedFoldMarkers) {
+ if (styler.Match(i, options.foldExplicitStart.c_str())) {
+ levelNext++;
+ } else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
+ levelNext--;
+ }
+ } else {
+ if (ch == ';') {
+ if (chNext == '{') {
+ levelNext++;
+ } else if (chNext == '}') {
+ levelNext--;
+ }
+ }
+ }
+ }
+ if (options.foldSyntaxBased && (style == SCE_ASM_DIRECTIVE)) {
+ word[wordlen++] = static_cast<char>(LowerCase(ch));
+ if (wordlen == 100) { // prevent overflow
+ word[0] = '\0';
+ wordlen = 1;
+ }
+ if (styleNext != SCE_ASM_DIRECTIVE) { // reading directive ready
+ word[wordlen] = '\0';
+ wordlen = 0;
+ if (directives4foldstart.InList(word)) {
+ levelNext++;
+ } else if (directives4foldend.InList(word)){
+ levelNext--;
+ }
+ }
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
+ visibleChars = 0;
+ }
+ }
+}
+
+LexerModule lmAsm(SCLEX_ASM, LexerAsm::LexerFactoryAsm, "asm", asmWordListDesc);
+LexerModule lmAs(SCLEX_AS, LexerAsm::LexerFactoryAs, "as", asmWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsn1.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsn1.cxx
new file mode 100644
index 00000000000..120b8954b9a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexAsn1.cxx
@@ -0,0 +1,188 @@
+// Scintilla source code edit control
+/** @file LexAsn1.cxx
+ ** Lexer for ASN.1
+ **/
+// Copyright 2004 by Herr Pfarrer rpfarrer <at> yahoo <dot> de
+// Last Updated: 20/07/2004
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Some char test functions
+static bool isAsn1Number(int ch)
+{
+ return (ch >= '0' && ch <= '9');
+}
+
+static bool isAsn1Letter(int ch)
+{
+ return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
+}
+
+static bool isAsn1Char(int ch)
+{
+ return (ch == '-' ) || isAsn1Number(ch) || isAsn1Letter (ch);
+}
+
+//
+// Function determining the color of a given code portion
+// Based on a "state"
+//
+static void ColouriseAsn1Doc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[], Accessor &styler)
+{
+ // The keywords
+ WordList &Keywords = *keywordLists[0];
+ WordList &Attributes = *keywordLists[1];
+ WordList &Descriptors = *keywordLists[2];
+ WordList &Types = *keywordLists[3];
+
+ // Parse the whole buffer character by character using StyleContext
+ StyleContext sc(startPos, length, initStyle, styler);
+ for (; sc.More(); sc.Forward())
+ {
+ // The state engine
+ switch (sc.state)
+ {
+ case SCE_ASN1_DEFAULT: // Plain characters
+asn1_default:
+ if (sc.ch == '-' && sc.chNext == '-')
+ // A comment begins here
+ sc.SetState(SCE_ASN1_COMMENT);
+ else if (sc.ch == '"')
+ // A string begins here
+ sc.SetState(SCE_ASN1_STRING);
+ else if (isAsn1Number (sc.ch))
+ // A number starts here (identifier should start with a letter in ASN.1)
+ sc.SetState(SCE_ASN1_SCALAR);
+ else if (isAsn1Char (sc.ch))
+ // An identifier starts here (identifier always start with a letter)
+ sc.SetState(SCE_ASN1_IDENTIFIER);
+ else if (sc.ch == ':')
+ // A ::= operator starts here
+ sc.SetState(SCE_ASN1_OPERATOR);
+ break;
+ case SCE_ASN1_COMMENT: // A comment
+ if (sc.ch == '\r' || sc.ch == '\n')
+ // A comment ends here
+ sc.SetState(SCE_ASN1_DEFAULT);
+ break;
+ case SCE_ASN1_IDENTIFIER: // An identifier (keyword, attribute, descriptor or type)
+ if (!isAsn1Char (sc.ch))
+ {
+ // The end of identifier is here: we can look for it in lists by now and change its state
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (Keywords.InList(s))
+ // It's a keyword, change its state
+ sc.ChangeState(SCE_ASN1_KEYWORD);
+ else if (Attributes.InList(s))
+ // It's an attribute, change its state
+ sc.ChangeState(SCE_ASN1_ATTRIBUTE);
+ else if (Descriptors.InList(s))
+ // It's a descriptor, change its state
+ sc.ChangeState(SCE_ASN1_DESCRIPTOR);
+ else if (Types.InList(s))
+ // It's a type, change its state
+ sc.ChangeState(SCE_ASN1_TYPE);
+
+ // Set to default now
+ sc.SetState(SCE_ASN1_DEFAULT);
+ }
+ break;
+ case SCE_ASN1_STRING: // A string delimited by ""
+ if (sc.ch == '"')
+ {
+ // A string ends here
+ sc.ForwardSetState(SCE_ASN1_DEFAULT);
+
+ // To correctly manage a char sticking to the string quote
+ goto asn1_default;
+ }
+ break;
+ case SCE_ASN1_SCALAR: // A plain number
+ if (!isAsn1Number (sc.ch))
+ // A number ends here
+ sc.SetState(SCE_ASN1_DEFAULT);
+ break;
+ case SCE_ASN1_OPERATOR: // The affectation operator ::= and wath follows (eg: ::= { org 6 } OID or ::= 12 trap)
+ if (sc.ch == '{')
+ {
+ // An OID definition starts here: enter the sub loop
+ for (; sc.More(); sc.Forward())
+ {
+ if (isAsn1Number (sc.ch) && (!isAsn1Char (sc.chPrev) || isAsn1Number (sc.chPrev)))
+ // The OID number is highlighted
+ sc.SetState(SCE_ASN1_OID);
+ else if (isAsn1Char (sc.ch))
+ // The OID parent identifier is plain
+ sc.SetState(SCE_ASN1_IDENTIFIER);
+ else
+ sc.SetState(SCE_ASN1_DEFAULT);
+
+ if (sc.ch == '}')
+ // Here ends the OID and the operator sub loop: go back to main loop
+ break;
+ }
+ }
+ else if (isAsn1Number (sc.ch))
+ {
+ // A trap number definition starts here: enter the sub loop
+ for (; sc.More(); sc.Forward())
+ {
+ if (isAsn1Number (sc.ch))
+ // The trap number is highlighted
+ sc.SetState(SCE_ASN1_OID);
+ else
+ {
+ // The number ends here: go back to main loop
+ sc.SetState(SCE_ASN1_DEFAULT);
+ break;
+ }
+ }
+ }
+ else if (sc.ch != ':' && sc.ch != '=' && sc.ch != ' ')
+ // The operator doesn't imply an OID definition nor a trap, back to main loop
+ goto asn1_default; // To be sure to handle actually the state change
+ break;
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldAsn1Doc(unsigned int, int, int, WordList *[], Accessor &styler)
+{
+ // No folding enabled, no reason to continue...
+ if( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ // No folding implemented: doesn't make sense for ASN.1
+}
+
+static const char * const asn1WordLists[] = {
+ "Keywords",
+ "Attributes",
+ "Descriptors",
+ "Types",
+ 0, };
+
+
+LexerModule lmAsn1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBaan.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBaan.cxx
new file mode 100644
index 00000000000..3784f3c3101
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBaan.cxx
@@ -0,0 +1,196 @@
+// Scintilla source code edit control
+/** @file LexBaan.cxx
+ ** Lexer for Baan.
+ ** Based heavily on LexCPP.cxx
+ **/
+// Copyright 2001- by Vamsi Potluru <vamsi@who.net> & Praveen Ambekar <ambekarpraveen@yahoo.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '$' || ch == ':');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static void ColouriseBaanDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
+
+ if (initStyle == SCE_BAAN_STRINGEOL) // Does not leak onto next line
+ initStyle = SCE_BAAN_DEFAULT;
+
+ int visibleChars = 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.state == SCE_BAAN_OPERATOR) {
+ sc.SetState(SCE_BAAN_DEFAULT);
+ } else if (sc.state == SCE_BAAN_NUMBER) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_BAAN_DEFAULT);
+ }
+ } else if (sc.state == SCE_BAAN_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_BAAN_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_BAAN_WORD2);
+ }
+ sc.SetState(SCE_BAAN_DEFAULT);
+ }
+ } else if (sc.state == SCE_BAAN_PREPROCESSOR) {
+ if (stylingWithinPreprocessor) {
+ if (IsASpace(sc.ch)) {
+ sc.SetState(SCE_BAAN_DEFAULT);
+ }
+ } else {
+ if (sc.atLineEnd && (sc.chNext != '^')) {
+ sc.SetState(SCE_BAAN_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_BAAN_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_BAAN_DEFAULT);
+ }
+ } else if (sc.state == SCE_BAAN_COMMENTDOC) {
+ if (sc.MatchIgnoreCase("enddllusage")) {
+ for (unsigned int i = 0; i < 10; i++){
+ sc.Forward();
+ }
+ sc.ForwardSetState(SCE_BAAN_DEFAULT);
+ }
+ } else if (sc.state == SCE_BAAN_STRING) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_BAAN_DEFAULT);
+ } else if ((sc.atLineEnd) && (sc.chNext != '^')) {
+ sc.ChangeState(SCE_BAAN_STRINGEOL);
+ sc.ForwardSetState(SCE_C_DEFAULT);
+ visibleChars = 0;
+ }
+ }
+
+ if (sc.state == SCE_BAAN_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_BAAN_NUMBER);
+ } else if (sc.MatchIgnoreCase("dllusage")){
+ sc.SetState(SCE_BAAN_COMMENTDOC);
+ do {
+ sc.Forward();
+ } while ((!sc.atLineEnd) && sc.More());
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_BAAN_IDENTIFIER);
+ } else if (sc.Match('|')){
+ sc.SetState(SCE_BAAN_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_BAAN_STRING);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ // Preprocessor commands are alone on their line
+ sc.SetState(SCE_BAAN_PREPROCESSOR);
+ // Skip whitespace between # and preprocessor word
+ do {
+ sc.Forward();
+ } while (IsASpace(sc.ch) && sc.More());
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_BAAN_OPERATOR);
+ }
+ }
+ if (sc.atLineEnd) {
+ // Reset states to begining of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ }
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldBaanDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment &&
+ (style == SCE_BAAN_COMMENT || style == SCE_BAAN_COMMENTDOC)) {
+ if (style != stylePrev) {
+ levelCurrent++;
+ } else if ((style != styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+ if (style == SCE_BAAN_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+LexerModule lmBaan(SCLEX_BAAN, ColouriseBaanDoc, "baan", FoldBaanDoc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBash.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBash.cxx
new file mode 100644
index 00000000000..a5f0f6e695f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBash.cxx
@@ -0,0 +1,845 @@
+// Scintilla source code edit control
+/** @file LexBash.cxx
+ ** Lexer for Bash.
+ **/
+// Copyright 2004-2012 by Neil Hodgson <neilh@scintilla.org>
+// Adapted from LexPerl by Kein-Hong Man 2004
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define HERE_DELIM_MAX 256
+
+// define this if you want 'invalid octals' to be marked as errors
+// usually, this is not a good idea, permissive lexing is better
+#undef PEDANTIC_OCTAL
+
+#define BASH_BASE_ERROR 65
+#define BASH_BASE_DECIMAL 66
+#define BASH_BASE_HEX 67
+#ifdef PEDANTIC_OCTAL
+#define BASH_BASE_OCTAL 68
+#define BASH_BASE_OCTAL_ERROR 69
+#endif
+
+// state constants for parts of a bash command segment
+#define BASH_CMD_BODY 0
+#define BASH_CMD_START 1
+#define BASH_CMD_WORD 2
+#define BASH_CMD_TEST 3
+#define BASH_CMD_ARITH 4
+#define BASH_CMD_DELIM 5
+
+// state constants for nested delimiter pairs, used by
+// SCE_SH_STRING and SCE_SH_BACKTICKS processing
+#define BASH_DELIM_LITERAL 0
+#define BASH_DELIM_STRING 1
+#define BASH_DELIM_CSTRING 2
+#define BASH_DELIM_LSTRING 3
+#define BASH_DELIM_COMMAND 4
+#define BASH_DELIM_BACKTICK 5
+
+#define BASH_DELIM_STACK_MAX 7
+
+static inline int translateBashDigit(int ch) {
+ if (ch >= '0' && ch <= '9') {
+ return ch - '0';
+ } else if (ch >= 'a' && ch <= 'z') {
+ return ch - 'a' + 10;
+ } else if (ch >= 'A' && ch <= 'Z') {
+ return ch - 'A' + 36;
+ } else if (ch == '@') {
+ return 62;
+ } else if (ch == '_') {
+ return 63;
+ }
+ return BASH_BASE_ERROR;
+}
+
+static inline int getBashNumberBase(char *s) {
+ int i = 0;
+ int base = 0;
+ while (*s) {
+ base = base * 10 + (*s++ - '0');
+ i++;
+ }
+ if (base > 64 || i > 2) {
+ return BASH_BASE_ERROR;
+ }
+ return base;
+}
+
+static int opposite(int ch) {
+ if (ch == '(') return ')';
+ if (ch == '[') return ']';
+ if (ch == '{') return '}';
+ if (ch == '<') return '>';
+ return ch;
+}
+
+static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList cmdDelimiter, bashStruct, bashStruct_in;
+ cmdDelimiter.Set("| || |& & && ; ;; ( ) { }");
+ bashStruct.Set("if elif fi while until else then do done esac eval");
+ bashStruct_in.Set("for case select");
+
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_");
+ // note that [+-] are often parts of identifiers in shell scripts
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._+-");
+ CharacterSet setMetaCharacter(CharacterSet::setNone, "|&;()<> \t\r\n");
+ setMetaCharacter.Add(0);
+ CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
+ CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
+ CharacterSet setParam(CharacterSet::setAlphaNum, "$_");
+ CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!");
+ CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!");
+ CharacterSet setLeftShift(CharacterSet::setDigits, "=$");
+
+ class HereDocCls { // Class to manage HERE document elements
+ public:
+ int State; // 0: '<<' encountered
+ // 1: collect the delimiter
+ // 2: here doc text (lines after the delimiter)
+ int Quote; // the char after '<<'
+ bool Quoted; // true if Quote in ('\'','"','`')
+ bool Indent; // indented delimiter (for <<-)
+ int DelimiterLength; // strlen(Delimiter)
+ char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf
+ HereDocCls() {
+ State = 0;
+ Quote = 0;
+ Quoted = false;
+ Indent = 0;
+ DelimiterLength = 0;
+ Delimiter = new char[HERE_DELIM_MAX];
+ Delimiter[0] = '\0';
+ }
+ void Append(int ch) {
+ Delimiter[DelimiterLength++] = static_cast<char>(ch);
+ Delimiter[DelimiterLength] = '\0';
+ }
+ ~HereDocCls() {
+ delete []Delimiter;
+ }
+ };
+ HereDocCls HereDoc;
+
+ class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl)
+ public:
+ int Count;
+ int Up, Down;
+ QuoteCls() {
+ Count = 0;
+ Up = '\0';
+ Down = '\0';
+ }
+ void Open(int u) {
+ Count++;
+ Up = u;
+ Down = opposite(Up);
+ }
+ void Start(int u) {
+ Count = 0;
+ Open(u);
+ }
+ };
+ QuoteCls Quote;
+
+ class QuoteStackCls { // Class to manage quote pairs that nest
+ public:
+ int Count;
+ int Up, Down;
+ int Style;
+ int Depth; // levels pushed
+ int *CountStack;
+ int *UpStack;
+ int *StyleStack;
+ QuoteStackCls() {
+ Count = 0;
+ Up = '\0';
+ Down = '\0';
+ Style = 0;
+ Depth = 0;
+ CountStack = new int[BASH_DELIM_STACK_MAX];
+ UpStack = new int[BASH_DELIM_STACK_MAX];
+ StyleStack = new int[BASH_DELIM_STACK_MAX];
+ }
+ void Start(int u, int s) {
+ Count = 1;
+ Up = u;
+ Down = opposite(Up);
+ Style = s;
+ }
+ void Push(int u, int s) {
+ if (Depth >= BASH_DELIM_STACK_MAX)
+ return;
+ CountStack[Depth] = Count;
+ UpStack [Depth] = Up;
+ StyleStack[Depth] = Style;
+ Depth++;
+ Count = 1;
+ Up = u;
+ Down = opposite(Up);
+ Style = s;
+ }
+ void Pop(void) {
+ if (Depth <= 0)
+ return;
+ Depth--;
+ Count = CountStack[Depth];
+ Up = UpStack [Depth];
+ Style = StyleStack[Depth];
+ Down = opposite(Up);
+ }
+ ~QuoteStackCls() {
+ delete []CountStack;
+ delete []UpStack;
+ delete []StyleStack;
+ }
+ };
+ QuoteStackCls QuoteStack;
+
+ int numBase = 0;
+ int digit;
+ unsigned int endPos = startPos + length;
+ int cmdState = BASH_CMD_START;
+ int testExprType = 0;
+
+ // Always backtracks to the start of a line that is not a continuation
+ // of the previous line (i.e. start of a bash command segment)
+ int ln = styler.GetLine(startPos);
+ if (ln > 0 && startPos == static_cast<unsigned int>(styler.LineStart(ln)))
+ ln--;
+ for (;;) {
+ startPos = styler.LineStart(ln);
+ if (ln == 0 || styler.GetLineState(ln) == BASH_CMD_START)
+ break;
+ ln--;
+ }
+ initStyle = SCE_SH_DEFAULT;
+
+ StyleContext sc(startPos, endPos - startPos, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ // handle line continuation, updates per-line stored state
+ if (sc.atLineStart) {
+ ln = styler.GetLine(sc.currentPos);
+ if (sc.state == SCE_SH_STRING
+ || sc.state == SCE_SH_BACKTICKS
+ || sc.state == SCE_SH_CHARACTER
+ || sc.state == SCE_SH_HERE_Q
+ || sc.state == SCE_SH_COMMENTLINE
+ || sc.state == SCE_SH_PARAM) {
+ // force backtrack while retaining cmdState
+ styler.SetLineState(ln, BASH_CMD_BODY);
+ } else {
+ if (ln > 0) {
+ if ((sc.GetRelative(-3) == '\\' && sc.GetRelative(-2) == '\r' && sc.chPrev == '\n')
+ || sc.GetRelative(-2) == '\\') { // handle '\' line continuation
+ // retain last line's state
+ } else
+ cmdState = BASH_CMD_START;
+ }
+ styler.SetLineState(ln, cmdState);
+ }
+ }
+
+ // controls change of cmdState at the end of a non-whitespace element
+ // states BODY|TEST|ARITH persist until the end of a command segment
+ // state WORD persist, but ends with 'in' or 'do' construct keywords
+ int cmdStateNew = BASH_CMD_BODY;
+ if (cmdState == BASH_CMD_TEST || cmdState == BASH_CMD_ARITH || cmdState == BASH_CMD_WORD)
+ cmdStateNew = cmdState;
+ int stylePrev = sc.state;
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_SH_OPERATOR:
+ sc.SetState(SCE_SH_DEFAULT);
+ if (cmdState == BASH_CMD_DELIM) // if command delimiter, start new command
+ cmdStateNew = BASH_CMD_START;
+ else if (sc.chPrev == '\\') // propagate command state if line continued
+ cmdStateNew = cmdState;
+ break;
+ case SCE_SH_WORD:
+ // "." never used in Bash variable names but used in file names
+ if (!setWord.Contains(sc.ch)) {
+ char s[500];
+ char s2[10];
+ sc.GetCurrent(s, sizeof(s));
+ // allow keywords ending in a whitespace or command delimiter
+ s2[0] = static_cast<char>(sc.ch);
+ s2[1] = '\0';
+ bool keywordEnds = IsASpace(sc.ch) || cmdDelimiter.InList(s2);
+ // 'in' or 'do' may be construct keywords
+ if (cmdState == BASH_CMD_WORD) {
+ if (strcmp(s, "in") == 0 && keywordEnds)
+ cmdStateNew = BASH_CMD_BODY;
+ else if (strcmp(s, "do") == 0 && keywordEnds)
+ cmdStateNew = BASH_CMD_START;
+ else
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ sc.SetState(SCE_SH_DEFAULT);
+ break;
+ }
+ // a 'test' keyword starts a test expression
+ if (strcmp(s, "test") == 0) {
+ if (cmdState == BASH_CMD_START && keywordEnds) {
+ cmdStateNew = BASH_CMD_TEST;
+ testExprType = 0;
+ } else
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ }
+ // detect bash construct keywords
+ else if (bashStruct.InList(s)) {
+ if (cmdState == BASH_CMD_START && keywordEnds)
+ cmdStateNew = BASH_CMD_START;
+ else
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ }
+ // 'for'|'case'|'select' needs 'in'|'do' to be highlighted later
+ else if (bashStruct_in.InList(s)) {
+ if (cmdState == BASH_CMD_START && keywordEnds)
+ cmdStateNew = BASH_CMD_WORD;
+ else
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ }
+ // disambiguate option items and file test operators
+ else if (s[0] == '-') {
+ if (cmdState != BASH_CMD_TEST)
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ }
+ // disambiguate keywords and identifiers
+ else if (cmdState != BASH_CMD_START
+ || !(keywords.InList(s) && keywordEnds)) {
+ sc.ChangeState(SCE_SH_IDENTIFIER);
+ }
+ sc.SetState(SCE_SH_DEFAULT);
+ }
+ break;
+ case SCE_SH_IDENTIFIER:
+ if (sc.chPrev == '\\') { // for escaped chars
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ } else if (!setWord.Contains(sc.ch)) {
+ sc.SetState(SCE_SH_DEFAULT);
+ }
+ break;
+ case SCE_SH_NUMBER:
+ digit = translateBashDigit(sc.ch);
+ if (numBase == BASH_BASE_DECIMAL) {
+ if (sc.ch == '#') {
+ char s[10];
+ sc.GetCurrent(s, sizeof(s));
+ numBase = getBashNumberBase(s);
+ if (numBase != BASH_BASE_ERROR)
+ break;
+ } else if (IsADigit(sc.ch))
+ break;
+ } else if (numBase == BASH_BASE_HEX) {
+ if (IsADigit(sc.ch, 16))
+ break;
+#ifdef PEDANTIC_OCTAL
+ } else if (numBase == BASH_BASE_OCTAL ||
+ numBase == BASH_BASE_OCTAL_ERROR) {
+ if (digit <= 7)
+ break;
+ if (digit <= 9) {
+ numBase = BASH_BASE_OCTAL_ERROR;
+ break;
+ }
+#endif
+ } else if (numBase == BASH_BASE_ERROR) {
+ if (digit <= 9)
+ break;
+ } else { // DD#DDDD number style handling
+ if (digit != BASH_BASE_ERROR) {
+ if (numBase <= 36) {
+ // case-insensitive if base<=36
+ if (digit >= 36) digit -= 26;
+ }
+ if (digit < numBase)
+ break;
+ if (digit <= 9) {
+ numBase = BASH_BASE_ERROR;
+ break;
+ }
+ }
+ }
+ // fallthrough when number is at an end or error
+ if (numBase == BASH_BASE_ERROR
+#ifdef PEDANTIC_OCTAL
+ || numBase == BASH_BASE_OCTAL_ERROR
+#endif
+ ) {
+ sc.ChangeState(SCE_SH_ERROR);
+ }
+ sc.SetState(SCE_SH_DEFAULT);
+ break;
+ case SCE_SH_COMMENTLINE:
+ if (sc.atLineEnd && sc.chPrev != '\\') {
+ sc.SetState(SCE_SH_DEFAULT);
+ }
+ break;
+ case SCE_SH_HERE_DELIM:
+ // From Bash info:
+ // ---------------
+ // Specifier format is: <<[-]WORD
+ // Optional '-' is for removal of leading tabs from here-doc.
+ // Whitespace acceptable after <<[-] operator
+ //
+ if (HereDoc.State == 0) { // '<<' encountered
+ HereDoc.Quote = sc.chNext;
+ HereDoc.Quoted = false;
+ HereDoc.DelimiterLength = 0;
+ HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0';
+ if (sc.chNext == '\'' || sc.chNext == '\"') { // a quoted here-doc delimiter (' or ")
+ sc.Forward();
+ HereDoc.Quoted = true;
+ HereDoc.State = 1;
+ } else if (setHereDoc.Contains(sc.chNext)) {
+ // an unquoted here-doc delimiter, no special handling
+ // TODO check what exactly bash considers part of the delim
+ HereDoc.State = 1;
+ } else if (sc.chNext == '<') { // HERE string <<<
+ sc.Forward();
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ } else if (IsASpace(sc.chNext)) {
+ // eat whitespace
+ } else if (setLeftShift.Contains(sc.chNext)) {
+ // left shift << or <<= operator cases
+ sc.ChangeState(SCE_SH_OPERATOR);
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ } else {
+ // symbols terminates; deprecated zero-length delimiter
+ HereDoc.State = 1;
+ }
+ } else if (HereDoc.State == 1) { // collect the delimiter
+ // * if single quoted, there's no escape
+ // * if double quoted, there are \\ and \" escapes
+ if ((HereDoc.Quote == '\'' && sc.ch != HereDoc.Quote) ||
+ (HereDoc.Quoted && sc.ch != HereDoc.Quote && sc.ch != '\\') ||
+ (HereDoc.Quote != '\'' && sc.chPrev == '\\') ||
+ (setHereDoc2.Contains(sc.ch))) {
+ HereDoc.Append(sc.ch);
+ } else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ } else if (sc.ch == '\\') {
+ if (HereDoc.Quoted && sc.chNext != HereDoc.Quote && sc.chNext != '\\') {
+ // in quoted prefixes only \ and the quote eat the escape
+ HereDoc.Append(sc.ch);
+ } else {
+ // skip escape prefix
+ }
+ } else if (!HereDoc.Quoted) {
+ sc.SetState(SCE_SH_DEFAULT);
+ }
+ if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { // force blowup
+ sc.SetState(SCE_SH_ERROR);
+ HereDoc.State = 0;
+ }
+ }
+ break;
+ case SCE_SH_HERE_Q:
+ // HereDoc.State == 2
+ if (sc.atLineStart) {
+ sc.SetState(SCE_SH_HERE_Q);
+ int prefixws = 0;
+ while (sc.ch == '\t' && !sc.atLineEnd) { // tabulation prefix
+ sc.Forward();
+ prefixws++;
+ }
+ if (prefixws > 0)
+ sc.SetState(SCE_SH_HERE_Q);
+ while (!sc.atLineEnd) {
+ sc.Forward();
+ }
+ char s[HERE_DELIM_MAX];
+ sc.GetCurrent(s, sizeof(s));
+ if (sc.LengthCurrent() == 0) { // '' or "" delimiters
+ if ((prefixws == 0 || HereDoc.Indent) &&
+ HereDoc.Quoted && HereDoc.DelimiterLength == 0)
+ sc.SetState(SCE_SH_DEFAULT);
+ break;
+ }
+ if (s[strlen(s) - 1] == '\r')
+ s[strlen(s) - 1] = '\0';
+ if (strcmp(HereDoc.Delimiter, s) == 0) {
+ if ((prefixws == 0) || // indentation rule
+ (prefixws > 0 && HereDoc.Indent)) {
+ sc.SetState(SCE_SH_DEFAULT);
+ break;
+ }
+ }
+ }
+ break;
+ case SCE_SH_SCALAR: // variable names
+ if (!setParam.Contains(sc.ch)) {
+ if (sc.LengthCurrent() == 1) {
+ // Special variable: $(, $_ etc.
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ } else {
+ sc.SetState(SCE_SH_DEFAULT);
+ }
+ }
+ break;
+ case SCE_SH_STRING: // delimited styles, can nest
+ case SCE_SH_BACKTICKS:
+ if (sc.ch == '\\' && QuoteStack.Up != '\\') {
+ if (QuoteStack.Style != BASH_DELIM_LITERAL)
+ sc.Forward();
+ } else if (sc.ch == QuoteStack.Down) {
+ QuoteStack.Count--;
+ if (QuoteStack.Count == 0) {
+ if (QuoteStack.Depth > 0) {
+ QuoteStack.Pop();
+ } else
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ }
+ } else if (sc.ch == QuoteStack.Up) {
+ QuoteStack.Count++;
+ } else {
+ if (QuoteStack.Style == BASH_DELIM_STRING ||
+ QuoteStack.Style == BASH_DELIM_LSTRING
+ ) { // do nesting for "string", $"locale-string"
+ if (sc.ch == '`') {
+ QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK);
+ } else if (sc.ch == '$' && sc.chNext == '(') {
+ sc.Forward();
+ QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND);
+ }
+ } else if (QuoteStack.Style == BASH_DELIM_COMMAND ||
+ QuoteStack.Style == BASH_DELIM_BACKTICK
+ ) { // do nesting for $(command), `command`
+ if (sc.ch == '\'') {
+ QuoteStack.Push(sc.ch, BASH_DELIM_LITERAL);
+ } else if (sc.ch == '\"') {
+ QuoteStack.Push(sc.ch, BASH_DELIM_STRING);
+ } else if (sc.ch == '`') {
+ QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK);
+ } else if (sc.ch == '$') {
+ if (sc.chNext == '\'') {
+ sc.Forward();
+ QuoteStack.Push(sc.ch, BASH_DELIM_CSTRING);
+ } else if (sc.chNext == '\"') {
+ sc.Forward();
+ QuoteStack.Push(sc.ch, BASH_DELIM_LSTRING);
+ } else if (sc.chNext == '(') {
+ sc.Forward();
+ QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND);
+ }
+ }
+ }
+ }
+ break;
+ case SCE_SH_PARAM: // ${parameter}
+ if (sc.ch == '\\' && Quote.Up != '\\') {
+ sc.Forward();
+ } else if (sc.ch == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ }
+ } else if (sc.ch == Quote.Up) {
+ Quote.Count++;
+ }
+ break;
+ case SCE_SH_CHARACTER: // singly-quoted strings
+ if (sc.ch == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ }
+ }
+ break;
+ }
+
+ // Must check end of HereDoc state 1 before default state is handled
+ if (HereDoc.State == 1 && sc.atLineEnd) {
+ // Begin of here-doc (the line after the here-doc delimiter):
+ // Lexically, the here-doc starts from the next line after the >>, but the
+ // first line of here-doc seem to follow the style of the last EOL sequence
+ HereDoc.State = 2;
+ if (HereDoc.Quoted) {
+ if (sc.state == SCE_SH_HERE_DELIM) {
+ // Missing quote at end of string! We are stricter than bash.
+ // Colour here-doc anyway while marking this bit as an error.
+ sc.ChangeState(SCE_SH_ERROR);
+ }
+ // HereDoc.Quote always == '\''
+ sc.SetState(SCE_SH_HERE_Q);
+ } else if (HereDoc.DelimiterLength == 0) {
+ // no delimiter, illegal (but '' and "" are legal)
+ sc.ChangeState(SCE_SH_ERROR);
+ sc.SetState(SCE_SH_DEFAULT);
+ } else {
+ sc.SetState(SCE_SH_HERE_Q);
+ }
+ }
+
+ // update cmdState about the current command segment
+ if (stylePrev != SCE_SH_DEFAULT && sc.state == SCE_SH_DEFAULT) {
+ cmdState = cmdStateNew;
+ }
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_SH_DEFAULT) {
+ if (sc.ch == '\\') {
+ // Bash can escape any non-newline as a literal
+ sc.SetState(SCE_SH_IDENTIFIER);
+ if (sc.chNext == '\r' || sc.chNext == '\n')
+ sc.SetState(SCE_SH_OPERATOR);
+ } else if (IsADigit(sc.ch)) {
+ sc.SetState(SCE_SH_NUMBER);
+ numBase = BASH_BASE_DECIMAL;
+ if (sc.ch == '0') { // hex,octal
+ if (sc.chNext == 'x' || sc.chNext == 'X') {
+ numBase = BASH_BASE_HEX;
+ sc.Forward();
+ } else if (IsADigit(sc.chNext)) {
+#ifdef PEDANTIC_OCTAL
+ numBase = BASH_BASE_OCTAL;
+#else
+ numBase = BASH_BASE_HEX;
+#endif
+ }
+ }
+ } else if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_SH_WORD);
+ } else if (sc.ch == '#') {
+ if (stylePrev != SCE_SH_WORD && stylePrev != SCE_SH_IDENTIFIER &&
+ (sc.currentPos == 0 || setMetaCharacter.Contains(sc.chPrev))) {
+ sc.SetState(SCE_SH_COMMENTLINE);
+ } else {
+ sc.SetState(SCE_SH_WORD);
+ }
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_SH_STRING);
+ QuoteStack.Start(sc.ch, BASH_DELIM_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_SH_CHARACTER);
+ Quote.Start(sc.ch);
+ } else if (sc.ch == '`') {
+ sc.SetState(SCE_SH_BACKTICKS);
+ QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK);
+ } else if (sc.ch == '$') {
+ if (sc.Match("$((")) {
+ sc.SetState(SCE_SH_OPERATOR); // handle '((' later
+ continue;
+ }
+ sc.SetState(SCE_SH_SCALAR);
+ sc.Forward();
+ if (sc.ch == '{') {
+ sc.ChangeState(SCE_SH_PARAM);
+ Quote.Start(sc.ch);
+ } else if (sc.ch == '\'') {
+ sc.ChangeState(SCE_SH_STRING);
+ QuoteStack.Start(sc.ch, BASH_DELIM_CSTRING);
+ } else if (sc.ch == '"') {
+ sc.ChangeState(SCE_SH_STRING);
+ QuoteStack.Start(sc.ch, BASH_DELIM_LSTRING);
+ } else if (sc.ch == '(') {
+ sc.ChangeState(SCE_SH_BACKTICKS);
+ QuoteStack.Start(sc.ch, BASH_DELIM_COMMAND);
+ } else if (sc.ch == '`') { // $` seen in a configure script, valid?
+ sc.ChangeState(SCE_SH_BACKTICKS);
+ QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK);
+ } else {
+ continue; // scalar has no delimiter pair
+ }
+ } else if (sc.Match('<', '<')) {
+ sc.SetState(SCE_SH_HERE_DELIM);
+ HereDoc.State = 0;
+ if (sc.GetRelative(2) == '-') { // <<- indent case
+ HereDoc.Indent = true;
+ sc.Forward();
+ } else {
+ HereDoc.Indent = false;
+ }
+ } else if (sc.ch == '-' && // one-char file test operators
+ setSingleCharOp.Contains(sc.chNext) &&
+ !setWord.Contains(sc.GetRelative(2)) &&
+ IsASpace(sc.chPrev)) {
+ sc.SetState(SCE_SH_WORD);
+ sc.Forward();
+ } else if (setBashOperator.Contains(sc.ch)) {
+ char s[10];
+ bool isCmdDelim = false;
+ sc.SetState(SCE_SH_OPERATOR);
+ // handle opening delimiters for test/arithmetic expressions - ((,[[,[
+ if (cmdState == BASH_CMD_START
+ || cmdState == BASH_CMD_BODY) {
+ if (sc.Match('(', '(')) {
+ cmdState = BASH_CMD_ARITH;
+ sc.Forward();
+ } else if (sc.Match('[', '[') && IsASpace(sc.GetRelative(2))) {
+ cmdState = BASH_CMD_TEST;
+ testExprType = 1;
+ sc.Forward();
+ } else if (sc.ch == '[' && IsASpace(sc.chNext)) {
+ cmdState = BASH_CMD_TEST;
+ testExprType = 2;
+ }
+ }
+ // special state -- for ((x;y;z)) in ... looping
+ if (cmdState == BASH_CMD_WORD && sc.Match('(', '(')) {
+ cmdState = BASH_CMD_ARITH;
+ sc.Forward();
+ continue;
+ }
+ // handle command delimiters in command START|BODY|WORD state, also TEST if 'test'
+ if (cmdState == BASH_CMD_START
+ || cmdState == BASH_CMD_BODY
+ || cmdState == BASH_CMD_WORD
+ || (cmdState == BASH_CMD_TEST && testExprType == 0)) {
+ s[0] = static_cast<char>(sc.ch);
+ if (setBashOperator.Contains(sc.chNext)) {
+ s[1] = static_cast<char>(sc.chNext);
+ s[2] = '\0';
+ isCmdDelim = cmdDelimiter.InList(s);
+ if (isCmdDelim)
+ sc.Forward();
+ }
+ if (!isCmdDelim) {
+ s[1] = '\0';
+ isCmdDelim = cmdDelimiter.InList(s);
+ }
+ if (isCmdDelim) {
+ cmdState = BASH_CMD_DELIM;
+ continue;
+ }
+ }
+ // handle closing delimiters for test/arithmetic expressions - )),]],]
+ if (cmdState == BASH_CMD_ARITH && sc.Match(')', ')')) {
+ cmdState = BASH_CMD_BODY;
+ sc.Forward();
+ } else if (cmdState == BASH_CMD_TEST && IsASpace(sc.chPrev)) {
+ if (sc.Match(']', ']') && testExprType == 1) {
+ sc.Forward();
+ cmdState = BASH_CMD_BODY;
+ } else if (sc.ch == ']' && testExprType == 2) {
+ cmdState = BASH_CMD_BODY;
+ }
+ }
+ }
+ }// sc.state
+ }
+ sc.Complete();
+ if (sc.state == SCE_SH_HERE_Q) {
+ styler.ChangeLexerState(sc.currentPos, styler.Length());
+ }
+ sc.Complete();
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ if (ch == '#')
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+
+static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int skipHereCh = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ // Comment folding
+ if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
+ {
+ if (!IsCommentLine(lineCurrent - 1, styler)
+ && IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent++;
+ else if (IsCommentLine(lineCurrent - 1, styler)
+ && !IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent--;
+ }
+ if (style == SCE_SH_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+ // Here Document folding
+ if (style == SCE_SH_HERE_DELIM) {
+ if (ch == '<' && chNext == '<') {
+ if (styler.SafeGetCharAt(i + 2) == '<') {
+ skipHereCh = 1;
+ } else {
+ if (skipHereCh == 0) {
+ levelCurrent++;
+ } else {
+ skipHereCh = 0;
+ }
+ }
+ }
+ } else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_SH_DEFAULT) {
+ levelCurrent--;
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const bashWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmBash(SCLEX_BASH, ColouriseBashDoc, "bash", FoldBashDoc, bashWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBasic.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBasic.cxx
new file mode 100644
index 00000000000..b73fac8b6e8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBasic.cxx
@@ -0,0 +1,566 @@
+// Scintilla source code edit control
+/** @file LexBasic.cxx
+ ** Lexer for BlitzBasic and PureBasic.
+ ** Converted to lexer object and added further folding features/properties by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// This tries to be a unified Lexer/Folder for all the BlitzBasic/BlitzMax/PurBasic basics
+// and derivatives. Once they diverge enough, might want to split it into multiple
+// lexers for more code clearity.
+//
+// Mail me (elias <at> users <dot> sf <dot> net) for any bugs.
+
+// Folding only works for simple things like functions or types.
+
+// You may want to have a look at my ctags lexer as well, if you additionally to coloring
+// and folding need to extract things like label tags in your editor.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/* Bits:
+ * 1 - whitespace
+ * 2 - operator
+ * 4 - identifier
+ * 8 - decimal digit
+ * 16 - hex digit
+ * 32 - bin digit
+ * 64 - letter
+ */
+static int character_classification[128] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2,
+ 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2,
+ 2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 68,
+ 2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 0
+};
+
+static bool IsSpace(int c) {
+ return c < 128 && (character_classification[c] & 1);
+}
+
+static bool IsOperator(int c) {
+ return c < 128 && (character_classification[c] & 2);
+}
+
+static bool IsIdentifier(int c) {
+ return c < 128 && (character_classification[c] & 4);
+}
+
+static bool IsDigit(int c) {
+ return c < 128 && (character_classification[c] & 8);
+}
+
+static bool IsHexDigit(int c) {
+ return c < 128 && (character_classification[c] & 16);
+}
+
+static bool IsBinDigit(int c) {
+ return c < 128 && (character_classification[c] & 32);
+}
+
+static bool IsLetter(int c) {
+ return c < 128 && (character_classification[c] & 64);
+}
+
+static int LowerCase(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return 'a' + c - 'A';
+ return c;
+}
+
+static int CheckBlitzFoldPoint(char const *token, int &level) {
+ if (!strcmp(token, "function") ||
+ !strcmp(token, "type")) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ return 1;
+ }
+ if (!strcmp(token, "end function") ||
+ !strcmp(token, "end type")) {
+ return -1;
+ }
+ return 0;
+}
+
+static int CheckPureFoldPoint(char const *token, int &level) {
+ if (!strcmp(token, "procedure") ||
+ !strcmp(token, "enumeration") ||
+ !strcmp(token, "interface") ||
+ !strcmp(token, "structure")) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ return 1;
+ }
+ if (!strcmp(token, "endprocedure") ||
+ !strcmp(token, "endenumeration") ||
+ !strcmp(token, "endinterface") ||
+ !strcmp(token, "endstructure")) {
+ return -1;
+ }
+ return 0;
+}
+
+static int CheckFreeFoldPoint(char const *token, int &level) {
+ if (!strcmp(token, "function") ||
+ !strcmp(token, "sub") ||
+ !strcmp(token, "enum") ||
+ !strcmp(token, "type") ||
+ !strcmp(token, "union") ||
+ !strcmp(token, "property") ||
+ !strcmp(token, "destructor") ||
+ !strcmp(token, "constructor")) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ return 1;
+ }
+ if (!strcmp(token, "end function") ||
+ !strcmp(token, "end sub") ||
+ !strcmp(token, "end enum") ||
+ !strcmp(token, "end type") ||
+ !strcmp(token, "end union") ||
+ !strcmp(token, "end property") ||
+ !strcmp(token, "end destructor") ||
+ !strcmp(token, "end constructor")) {
+ return -1;
+ }
+ return 0;
+}
+
+// An individual named option for use in an OptionSet
+
+// Options used for LexerBasic
+struct OptionsBasic {
+ bool fold;
+ bool foldSyntaxBased;
+ bool foldCommentExplicit;
+ std::string foldExplicitStart;
+ std::string foldExplicitEnd;
+ bool foldExplicitAnywhere;
+ bool foldCompact;
+ OptionsBasic() {
+ fold = false;
+ foldSyntaxBased = true;
+ foldCommentExplicit = false;
+ foldExplicitStart = "";
+ foldExplicitEnd = "";
+ foldExplicitAnywhere = false;
+ foldCompact = true;
+ }
+};
+
+static const char * const blitzbasicWordListDesc[] = {
+ "BlitzBasic Keywords",
+ "user1",
+ "user2",
+ "user3",
+ 0
+};
+
+static const char * const purebasicWordListDesc[] = {
+ "PureBasic Keywords",
+ "PureBasic PreProcessor Keywords",
+ "user defined 1",
+ "user defined 2",
+ 0
+};
+
+static const char * const freebasicWordListDesc[] = {
+ "FreeBasic Keywords",
+ "FreeBasic PreProcessor Keywords",
+ "user defined 1",
+ "user defined 2",
+ 0
+};
+
+struct OptionSetBasic : public OptionSet<OptionsBasic> {
+ OptionSetBasic(const char * const wordListDescriptions[]) {
+ DefineProperty("fold", &OptionsBasic::fold);
+
+ DefineProperty("fold.basic.syntax.based", &OptionsBasic::foldSyntaxBased,
+ "Set this property to 0 to disable syntax based folding.");
+
+ DefineProperty("fold.basic.comment.explicit", &OptionsBasic::foldCommentExplicit,
+ "This option enables folding explicit fold points when using the Basic lexer. "
+ "Explicit fold points allows adding extra folding by placing a ;{ (BB/PB) or '{ (FB) comment at the start "
+ "and a ;} (BB/PB) or '} (FB) at the end of a section that should be folded.");
+
+ DefineProperty("fold.basic.explicit.start", &OptionsBasic::foldExplicitStart,
+ "The string to use for explicit fold start points, replacing the standard ;{ (BB/PB) or '{ (FB).");
+
+ DefineProperty("fold.basic.explicit.end", &OptionsBasic::foldExplicitEnd,
+ "The string to use for explicit fold end points, replacing the standard ;} (BB/PB) or '} (FB).");
+
+ DefineProperty("fold.basic.explicit.anywhere", &OptionsBasic::foldExplicitAnywhere,
+ "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
+
+ DefineProperty("fold.compact", &OptionsBasic::foldCompact);
+
+ DefineWordListSets(wordListDescriptions);
+ }
+};
+
+class LexerBasic : public ILexer {
+ char comment_char;
+ int (*CheckFoldPoint)(char const *, int &);
+ WordList keywordlists[4];
+ OptionsBasic options;
+ OptionSetBasic osBasic;
+public:
+ LexerBasic(char comment_char_, int (*CheckFoldPoint_)(char const *, int &), const char * const wordListDescriptions[]) :
+ comment_char(comment_char_),
+ CheckFoldPoint(CheckFoldPoint_),
+ osBasic(wordListDescriptions) {
+ }
+ virtual ~LexerBasic() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osBasic.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osBasic.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osBasic.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osBasic.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+ static ILexer *LexerFactoryBlitzBasic() {
+ return new LexerBasic(';', CheckBlitzFoldPoint, blitzbasicWordListDesc);
+ }
+ static ILexer *LexerFactoryPureBasic() {
+ return new LexerBasic(';', CheckPureFoldPoint, purebasicWordListDesc);
+ }
+ static ILexer *LexerFactoryFreeBasic() {
+ return new LexerBasic('\'', CheckFreeFoldPoint, freebasicWordListDesc );
+ }
+};
+
+int SCI_METHOD LexerBasic::PropertySet(const char *key, const char *val) {
+ if (osBasic.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywordlists[0];
+ break;
+ case 1:
+ wordListN = &keywordlists[1];
+ break;
+ case 2:
+ wordListN = &keywordlists[2];
+ break;
+ case 3:
+ wordListN = &keywordlists[3];
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+void SCI_METHOD LexerBasic::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ bool wasfirst = true, isfirst = true; // true if first token in a line
+ styler.StartAt(startPos);
+ int styleBeforeKeyword = SCE_B_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ // Can't use sc.More() here else we miss the last character
+ for (; ; sc.Forward()) {
+ if (sc.state == SCE_B_IDENTIFIER) {
+ if (!IsIdentifier(sc.ch)) {
+ // Labels
+ if (wasfirst && sc.Match(':')) {
+ sc.ChangeState(SCE_B_LABEL);
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ } else {
+ char s[100];
+ int kstates[4] = {
+ SCE_B_KEYWORD,
+ SCE_B_KEYWORD2,
+ SCE_B_KEYWORD3,
+ SCE_B_KEYWORD4,
+ };
+ sc.GetCurrentLowered(s, sizeof(s));
+ for (int i = 0; i < 4; i++) {
+ if (keywordlists[i].InList(s)) {
+ sc.ChangeState(kstates[i]);
+ }
+ }
+ // Types, must set them as operator else they will be
+ // matched as number/constant
+ if (sc.Match('.') || sc.Match('$') || sc.Match('%') ||
+ sc.Match('#')) {
+ sc.SetState(SCE_B_OPERATOR);
+ } else {
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+ }
+ } else if (sc.state == SCE_B_OPERATOR) {
+ if (!IsOperator(sc.ch) || sc.Match('#'))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_LABEL) {
+ if (!IsIdentifier(sc.ch))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_CONSTANT) {
+ if (!IsIdentifier(sc.ch))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_NUMBER) {
+ if (!IsDigit(sc.ch))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_HEXNUMBER) {
+ if (!IsHexDigit(sc.ch))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_BINNUMBER) {
+ if (!IsBinDigit(sc.ch))
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_STRING) {
+ if (sc.ch == '"') {
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_B_ERROR);
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_COMMENT || sc.state == SCE_B_PREPROCESSOR) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_DOCLINE) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.ch == '\\' || sc.ch == '@') {
+ if (IsLetter(sc.chNext) && sc.chPrev != '\\') {
+ styleBeforeKeyword = sc.state;
+ sc.SetState(SCE_B_DOCKEYWORD);
+ };
+ }
+ } else if (sc.state == SCE_B_DOCKEYWORD) {
+ if (IsSpace(sc.ch)) {
+ sc.SetState(styleBeforeKeyword);
+ } else if (sc.atLineEnd && styleBeforeKeyword == SCE_B_DOCLINE) {
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_COMMENTBLOCK) {
+ if (sc.Match("\'/")) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_DOCBLOCK) {
+ if (sc.Match("\'/")) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ } else if (sc.ch == '\\' || sc.ch == '@') {
+ if (IsLetter(sc.chNext) && sc.chPrev != '\\') {
+ styleBeforeKeyword = sc.state;
+ sc.SetState(SCE_B_DOCKEYWORD);
+ };
+ }
+ }
+
+ if (sc.atLineStart)
+ isfirst = true;
+
+ if (sc.state == SCE_B_DEFAULT || sc.state == SCE_B_ERROR) {
+ if (isfirst && sc.Match('.') && comment_char != '\'') {
+ sc.SetState(SCE_B_LABEL);
+ } else if (isfirst && sc.Match('#')) {
+ wasfirst = isfirst;
+ sc.SetState(SCE_B_IDENTIFIER);
+ } else if (sc.Match(comment_char)) {
+ // Hack to make deprecated QBASIC '$Include show
+ // up in freebasic with SCE_B_PREPROCESSOR.
+ if (comment_char == '\'' && sc.Match(comment_char, '$'))
+ sc.SetState(SCE_B_PREPROCESSOR);
+ else if (sc.Match("\'*") || sc.Match("\'!")) {
+ sc.SetState(SCE_B_DOCLINE);
+ } else {
+ sc.SetState(SCE_B_COMMENT);
+ }
+ } else if (sc.Match("/\'")) {
+ if (sc.Match("/\'*") || sc.Match("/\'!")) { // Support of gtk-doc/Doxygen doc. style
+ sc.SetState(SCE_B_DOCBLOCK);
+ } else {
+ sc.SetState(SCE_B_COMMENTBLOCK);
+ }
+ sc.Forward(); // Eat the ' so it isn't used for the end of the comment
+ } else if (sc.Match('"')) {
+ sc.SetState(SCE_B_STRING);
+ } else if (IsDigit(sc.ch)) {
+ sc.SetState(SCE_B_NUMBER);
+ } else if (sc.Match('$') || sc.Match("&h") || sc.Match("&H") || sc.Match("&o") || sc.Match("&O")) {
+ sc.SetState(SCE_B_HEXNUMBER);
+ } else if (sc.Match('%') || sc.Match("&b") || sc.Match("&B")) {
+ sc.SetState(SCE_B_BINNUMBER);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_B_CONSTANT);
+ } else if (IsOperator(sc.ch)) {
+ sc.SetState(SCE_B_OPERATOR);
+ } else if (IsIdentifier(sc.ch)) {
+ wasfirst = isfirst;
+ sc.SetState(SCE_B_IDENTIFIER);
+ } else if (!IsSpace(sc.ch)) {
+ sc.SetState(SCE_B_ERROR);
+ }
+ }
+
+ if (!IsSpace(sc.ch))
+ isfirst = false;
+
+ if (!sc.More())
+ break;
+ }
+ sc.Complete();
+}
+
+
+void SCI_METHOD LexerBasic::Fold(unsigned int startPos, int length, int /* initStyle */, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ int line = styler.GetLine(startPos);
+ int level = styler.LevelAt(line);
+ int go = 0, done = 0;
+ int endPos = startPos + length;
+ char word[256];
+ int wordlen = 0;
+ const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
+ int cNext = styler[startPos];
+
+ // Scan for tokens at the start of the line (they may include
+ // whitespace, for tokens like "End Function"
+ for (int i = startPos; i < endPos; i++) {
+ int c = cNext;
+ cNext = styler.SafeGetCharAt(i + 1);
+ bool atEOL = (c == '\r' && cNext != '\n') || (c == '\n');
+ if (options.foldSyntaxBased && !done && !go) {
+ if (wordlen) { // are we scanning a token already?
+ word[wordlen] = static_cast<char>(LowerCase(c));
+ if (!IsIdentifier(c)) { // done with token
+ word[wordlen] = '\0';
+ go = CheckFoldPoint(word, level);
+ if (!go) {
+ // Treat any whitespace as single blank, for
+ // things like "End Function".
+ if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) {
+ word[wordlen] = ' ';
+ if (wordlen < 255)
+ wordlen++;
+ }
+ else // done with this line
+ done = 1;
+ }
+ } else if (wordlen < 255) {
+ wordlen++;
+ }
+ } else { // start scanning at first non-whitespace character
+ if (!IsSpace(c)) {
+ if (IsIdentifier(c)) {
+ word[0] = static_cast<char>(LowerCase(c));
+ wordlen = 1;
+ } else // done with this line
+ done = 1;
+ }
+ }
+ }
+ if (options.foldCommentExplicit && ((styler.StyleAt(i) == SCE_B_COMMENT) || options.foldExplicitAnywhere)) {
+ if (userDefinedFoldMarkers) {
+ if (styler.Match(i, options.foldExplicitStart.c_str())) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ go = 1;
+ } else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
+ go = -1;
+ }
+ } else {
+ if (c == comment_char) {
+ if (cNext == '{') {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ go = 1;
+ } else if (cNext == '}') {
+ go = -1;
+ }
+ }
+ }
+ }
+ if (atEOL) { // line end
+ if (!done && wordlen == 0 && options.foldCompact) // line was only space
+ level |= SC_FOLDLEVELWHITEFLAG;
+ if (level != styler.LevelAt(line))
+ styler.SetLevel(line, level);
+ level += go;
+ line++;
+ // reset state
+ wordlen = 0;
+ level &= ~SC_FOLDLEVELHEADERFLAG;
+ level &= ~SC_FOLDLEVELWHITEFLAG;
+ go = 0;
+ done = 0;
+ }
+ }
+}
+
+LexerModule lmBlitzBasic(SCLEX_BLITZBASIC, LexerBasic::LexerFactoryBlitzBasic, "blitzbasic", blitzbasicWordListDesc);
+
+LexerModule lmPureBasic(SCLEX_PUREBASIC, LexerBasic::LexerFactoryPureBasic, "purebasic", purebasicWordListDesc);
+
+LexerModule lmFreeBasic(SCLEX_FREEBASIC, LexerBasic::LexerFactoryFreeBasic, "freebasic", freebasicWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBibTeX.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBibTeX.cxx
new file mode 100644
index 00000000000..cdbce8d4932
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBibTeX.cxx
@@ -0,0 +1,310 @@
+// Copyright 2008-2010 Sergiu Dotenco. The License.txt file describes the
+// conditions under which this software may be distributed.
+
+/**
+ * @file LexBibTeX.cxx
+ * @brief General BibTeX coloring scheme.
+ * @author Sergiu Dotenco
+ * @date April 18, 2009
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <cassert>
+#include <cctype>
+
+#include <string>
+#include <algorithm>
+#include <functional>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+namespace {
+ bool IsAlphabetic(unsigned int ch)
+ {
+ return IsASCII(ch) && std::isalpha(ch) != 0;
+ }
+ bool IsAlphaNumeric(char ch)
+ {
+ return IsASCII(ch) && std::isalnum(ch);
+ }
+
+ bool EqualCaseInsensitive(const char* a, const char* b)
+ {
+ return CompareCaseInsensitive(a, b) == 0;
+ }
+
+ bool EntryWithoutKey(const char* name)
+ {
+ return EqualCaseInsensitive(name,"string");
+ }
+
+ char GetClosingBrace(char openbrace)
+ {
+ char result = openbrace;
+
+ switch (openbrace) {
+ case '(': result = ')'; break;
+ case '{': result = '}'; break;
+ }
+
+ return result;
+ }
+
+ bool IsEntryStart(char prev, char ch)
+ {
+ return prev != '\\' && ch == '@';
+ }
+
+ bool IsEntryStart(const StyleContext& sc)
+ {
+ return IsEntryStart(sc.chPrev, sc.ch);
+ }
+
+ void ColorizeBibTeX(unsigned start_pos, int length, int /*init_style*/, WordList* keywordlists[], Accessor& styler)
+ {
+ WordList &EntryNames = *keywordlists[0];
+ bool fold_compact = styler.GetPropertyInt("fold.compact", 1) != 0;
+
+ std::string buffer;
+ buffer.reserve(25);
+
+ // We always colorize a section from the beginning, so let's
+ // search for the @ character which isn't escaped, i.e. \@
+ while (start_pos > 0 && !IsEntryStart(styler.SafeGetCharAt(start_pos - 1),
+ styler.SafeGetCharAt(start_pos))) {
+ --start_pos; ++length;
+ }
+
+ styler.StartAt(start_pos);
+ styler.StartSegment(start_pos);
+
+ int current_line = styler.GetLine(start_pos);
+ int prev_level = styler.LevelAt(current_line) & SC_FOLDLEVELNUMBERMASK;
+ int current_level = prev_level;
+ int visible_chars = 0;
+
+ bool in_comment = false ;
+ StyleContext sc(start_pos, length, SCE_BIBTEX_DEFAULT, styler);
+
+ bool going = sc.More(); // needed because of a fuzzy end of file state
+ char closing_brace = 0;
+ bool collect_entry_name = false;
+
+ for (; going; sc.Forward()) {
+ if (!sc.More())
+ going = false; // we need to go one behind the end of text
+
+ if (in_comment) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_BIBTEX_DEFAULT);
+ in_comment = false;
+ }
+ }
+ else {
+ // Found @entry
+ if (IsEntryStart(sc)) {
+ sc.SetState(SCE_BIBTEX_UNKNOWN_ENTRY);
+ sc.Forward();
+ ++current_level;
+
+ buffer.clear();
+ collect_entry_name = true;
+ }
+ else if ((sc.state == SCE_BIBTEX_ENTRY || sc.state == SCE_BIBTEX_UNKNOWN_ENTRY)
+ && (sc.ch == '{' || sc.ch == '(')) {
+ // Entry name colorization done
+ // Found either a { or a ( after entry's name, e.g. @entry(...) @entry{...}
+ // Closing counterpart needs to be stored.
+ closing_brace = GetClosingBrace(sc.ch);
+
+ sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize { (
+
+ // @string doesn't have any key
+ if (EntryWithoutKey(buffer.c_str()))
+ sc.ForwardSetState(SCE_BIBTEX_PARAMETER);
+ else
+ sc.ForwardSetState(SCE_BIBTEX_KEY); // Key/label colorization
+ }
+
+ // Need to handle the case where entry's key is empty
+ // e.g. @book{,...}
+ if (sc.state == SCE_BIBTEX_KEY && sc.ch == ',') {
+ // Key/label colorization done
+ sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the ,
+ sc.ForwardSetState(SCE_BIBTEX_PARAMETER); // Parameter colorization
+ }
+ else if (sc.state == SCE_BIBTEX_PARAMETER && sc.ch == '=') {
+ sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the =
+ sc.ForwardSetState(SCE_BIBTEX_VALUE); // Parameter value colorization
+
+ int start = sc.currentPos;
+
+ // We need to handle multiple situations:
+ // 1. name"one two {three}"
+ // 2. name={one {one two {two}} three}
+ // 3. year=2005
+
+ // Skip ", { until we encounter the first alphanumerical character
+ while (sc.More() && !(IsAlphaNumeric(sc.ch) || sc.ch == '"' || sc.ch == '{'))
+ sc.Forward();
+
+ if (sc.More()) {
+ // Store " or {
+ char ch = sc.ch;
+
+ // Not interested in alphanumerical characters
+ if (IsAlphaNumeric(ch))
+ ch = 0;
+
+ int skipped = 0;
+
+ if (ch) {
+ // Skip preceding " or { such as in name={{test}}.
+ // Remember how many characters have been skipped
+ // Make sure that empty values, i.e. "" are also handled correctly
+ while (sc.More() && (sc.ch == ch && (ch != '"' || skipped < 1))) {
+ sc.Forward();
+ ++skipped;
+ }
+ }
+
+ // Closing counterpart for " is the same character
+ if (ch == '{')
+ ch = '}';
+
+ // We have reached the parameter value
+ // In case the open character was a alnum char, skip until , is found
+ // otherwise until skipped == 0
+ while (sc.More() && (skipped > 0 || (!ch && !(sc.ch == ',' || sc.ch == closing_brace)))) {
+ // Make sure the character isn't escaped
+ if (sc.chPrev != '\\') {
+ // Parameter value contains a { which is the 2nd case described above
+ if (sc.ch == '{')
+ ++skipped; // Remember it
+ else if (sc.ch == '}')
+ --skipped;
+ else if (skipped == 1 && sc.ch == ch && ch == '"') // Don't ignore cases like {"o}
+ skipped = 0;
+ }
+
+ sc.Forward();
+ }
+ }
+
+ // Don't colorize the ,
+ sc.SetState(SCE_BIBTEX_DEFAULT);
+
+ // Skip until the , or entry's closing closing_brace is found
+ // since this parameter might be the last one
+ while (sc.More() && !(sc.ch == ',' || sc.ch == closing_brace))
+ sc.Forward();
+
+ int state = SCE_BIBTEX_PARAMETER; // The might be more parameters
+
+ // We've reached the closing closing_brace for the bib entry
+ // in case no " or {} has been used to enclose the value,
+ // as in 3rd case described above
+ if (sc.ch == closing_brace) {
+ --current_level;
+ // Make sure the text between entries is not colored
+ // using parameter's style
+ state = SCE_BIBTEX_DEFAULT;
+ }
+
+ int end = sc.currentPos;
+ current_line = styler.GetLine(end);
+
+ // We have possibly skipped some lines, so the folding levels
+ // have to be adjusted separately
+ for (int i = styler.GetLine(start); i <= styler.GetLine(end); ++i)
+ styler.SetLevel(i, prev_level);
+
+ sc.ForwardSetState(state);
+ }
+
+ if (sc.state == SCE_BIBTEX_PARAMETER && sc.ch == closing_brace) {
+ sc.SetState(SCE_BIBTEX_DEFAULT);
+ --current_level;
+ }
+
+ // Non escaped % found which represents a comment until the end of the line
+ if (sc.chPrev != '\\' && sc.ch == '%') {
+ in_comment = true;
+ sc.SetState(SCE_BIBTEX_COMMENT);
+ }
+ }
+
+ if (sc.state == SCE_BIBTEX_UNKNOWN_ENTRY || sc.state == SCE_BIBTEX_ENTRY) {
+ if (!IsAlphabetic(sc.ch) && collect_entry_name)
+ collect_entry_name = false;
+
+ if (collect_entry_name) {
+ buffer += static_cast<char>(tolower(sc.ch));
+ if (EntryNames.InList(buffer.c_str()))
+ sc.ChangeState(SCE_BIBTEX_ENTRY);
+ else
+ sc.ChangeState(SCE_BIBTEX_UNKNOWN_ENTRY);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ int level = prev_level;
+
+ if (visible_chars == 0 && fold_compact)
+ level |= SC_FOLDLEVELWHITEFLAG;
+
+ if ((current_level > prev_level))
+ level |= SC_FOLDLEVELHEADERFLAG;
+ // else if (current_level < prev_level)
+ // level |= SC_FOLDLEVELBOXFOOTERFLAG; // Deprecated
+
+ if (level != styler.LevelAt(current_line)) {
+ styler.SetLevel(current_line, level);
+ }
+
+ ++current_line;
+ prev_level = current_level;
+ visible_chars = 0;
+ }
+
+ if (!isspacechar(sc.ch))
+ ++visible_chars;
+ }
+
+ sc.Complete();
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(current_line) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(current_line, prev_level | flagsNext);
+ }
+}
+static const char * const BibTeXWordLists[] = {
+ "Entry Names",
+ 0,
+};
+
+
+LexerModule lmBibTeX(SCLEX_BIBTEX, ColorizeBibTeX, "bib", 0, BibTeXWordLists);
+
+// Entry Names
+// article, book, booklet, conference, inbook,
+// incollection, inproceedings, manual, mastersthesis,
+// misc, phdthesis, proceedings, techreport, unpublished,
+// string, url
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBullant.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBullant.cxx
new file mode 100644
index 00000000000..51d6bd8f084
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexBullant.cxx
@@ -0,0 +1,233 @@
+// SciTE - Scintilla based Text Editor
+// LexBullant.cxx - lexer for Bullant
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static int classifyWordBullant(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
+ char s[100];
+ s[0] = '\0';
+ for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ s[i + 1] = '\0';
+ }
+ int lev= 0;
+ char chAttr = SCE_C_IDENTIFIER;
+ if (isdigit(s[0]) || (s[0] == '.')){
+ chAttr = SCE_C_NUMBER;
+ }
+ else {
+ if (keywords.InList(s)) {
+ chAttr = SCE_C_WORD;
+ if (strcmp(s, "end") == 0)
+ lev = -1;
+ else if (strcmp(s, "method") == 0 ||
+ strcmp(s, "case") == 0 ||
+ strcmp(s, "class") == 0 ||
+ strcmp(s, "debug") == 0 ||
+ strcmp(s, "test") == 0 ||
+ strcmp(s, "if") == 0 ||
+ strcmp(s, "lock") == 0 ||
+ strcmp(s, "transaction") == 0 ||
+ strcmp(s, "trap") == 0 ||
+ strcmp(s, "until") == 0 ||
+ strcmp(s, "while") == 0)
+ lev = 1;
+ }
+ }
+ styler.ColourTo(end, chAttr);
+ return lev;
+}
+
+static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ WordList &keywords = *keywordlists[0];
+
+ styler.StartAt(startPos);
+
+ bool fold = styler.GetPropertyInt("fold") != 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+
+ int state = initStyle;
+ if (state == SCE_C_STRINGEOL) // Does not leak onto next line
+ state = SCE_C_DEFAULT;
+ char chPrev = ' ';
+ char chNext = styler[startPos];
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ styler.StartSegment(startPos);
+ int endFoundThisLine = 0;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
+ // Avoid triggering two times on Dos/Win
+ // End of line
+ endFoundThisLine = 0;
+ if (state == SCE_C_STRINGEOL) {
+ styler.ColourTo(i, state);
+ state = SCE_C_DEFAULT;
+ }
+ if (fold) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ }
+ visibleChars = 0;
+
+/* int indentBlock = GetLineIndentation(lineCurrent);
+ if (blockChange==1){
+ lineCurrent++;
+ int pos=SetLineIndentation(lineCurrent, indentBlock + indentSize);
+ } else if (blockChange==-1) {
+ indentBlock -= indentSize;
+ if (indentBlock < 0)
+ indentBlock = 0;
+ SetLineIndentation(lineCurrent, indentBlock);
+ lineCurrent++;
+ }
+ blockChange=0;
+*/ }
+ if (!(IsASCII(ch) && isspace(ch)))
+ visibleChars++;
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_C_DEFAULT) {
+ if (iswordstart(ch)) {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_IDENTIFIER;
+ } else if (ch == '@' && chNext == 'o') {
+ if ((styler.SafeGetCharAt(i+2) =='f') && (styler.SafeGetCharAt(i+3) == 'f')) {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_COMMENT;
+ }
+ } else if (ch == '#') {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '\"') {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_STRING;
+ } else if (ch == '\'') {
+ styler.ColourTo(i-1, state);
+ state = SCE_C_CHARACTER;
+ } else if (isoperator(ch)) {
+ styler.ColourTo(i-1, state);
+ styler.ColourTo(i, SCE_C_OPERATOR);
+ }
+ } else if (state == SCE_C_IDENTIFIER) {
+ if (!iswordchar(ch)) {
+ int levelChange = classifyWordBullant(styler.GetStartSegment(), i - 1, keywords, styler);
+ state = SCE_C_DEFAULT;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (ch == '#') {
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '\"') {
+ state = SCE_C_STRING;
+ } else if (ch == '\'') {
+ state = SCE_C_CHARACTER;
+ } else if (isoperator(ch)) {
+ styler.ColourTo(i, SCE_C_OPERATOR);
+ }
+ if (endFoundThisLine == 0)
+ levelCurrent+=levelChange;
+ if (levelChange == -1)
+ endFoundThisLine=1;
+ }
+ } else if (state == SCE_C_COMMENT) {
+ if (ch == '@' && chNext == 'o') {
+ if (styler.SafeGetCharAt(i+2) == 'n') {
+ styler.ColourTo(i+2, state);
+ state = SCE_C_DEFAULT;
+ i+=2;
+ }
+ }
+ } else if (state == SCE_C_COMMENTLINE) {
+ if (ch == '\r' || ch == '\n') {
+ endFoundThisLine = 0;
+ styler.ColourTo(i-1, state);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_STRING) {
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ } else if (ch == '\"') {
+ styler.ColourTo(i, state);
+ state = SCE_C_DEFAULT;
+ } else if (chNext == '\r' || chNext == '\n') {
+ endFoundThisLine = 0;
+ styler.ColourTo(i-1, SCE_C_STRINGEOL);
+ state = SCE_C_STRINGEOL;
+ }
+ } else if (state == SCE_C_CHARACTER) {
+ if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
+ endFoundThisLine = 0;
+ styler.ColourTo(i-1, SCE_C_STRINGEOL);
+ state = SCE_C_STRINGEOL;
+ } else if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ } else if (ch == '\'') {
+ styler.ColourTo(i, state);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ chPrev = ch;
+ }
+ styler.ColourTo(lengthDoc - 1, state);
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ if (fold) {
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ //styler.SetLevel(lineCurrent, levelCurrent | flagsNext);
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+
+ }
+}
+
+static const char * const bullantWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant", 0, bullantWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCLW.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCLW.cxx
new file mode 100644
index 00000000000..c1dea607c36
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCLW.cxx
@@ -0,0 +1,682 @@
+// Scintilla source code edit control
+/** @file LexClw.cxx
+ ** Lexer for Clarion.
+ ** 2004/12/17 Updated Lexer
+ **/
+// Copyright 2003-2004 by Ron Schofield <ron@schofieldcomputer.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Is an end of line character
+inline bool IsEOL(const int ch) {
+
+ return(ch == '\n');
+}
+
+// Convert character to uppercase
+static char CharacterUpper(char chChar) {
+
+ if (chChar < 'a' || chChar > 'z') {
+ return(chChar);
+ }
+ else {
+ return(static_cast<char>(chChar - 'a' + 'A'));
+ }
+}
+
+// Convert string to uppercase
+static void StringUpper(char *szString) {
+
+ while (*szString) {
+ *szString = CharacterUpper(*szString);
+ szString++;
+ }
+}
+
+// Is a label start character
+inline bool IsALabelStart(const int iChar) {
+
+ return(isalpha(iChar) || iChar == '_');
+}
+
+// Is a label character
+inline bool IsALabelCharacter(const int iChar) {
+
+ return(isalnum(iChar) || iChar == '_' || iChar == ':');
+}
+
+// Is the character is a ! and the the next character is not a !
+inline bool IsACommentStart(const int iChar) {
+
+ return(iChar == '!');
+}
+
+// Is the character a Clarion hex character (ABCDEF)
+inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) {
+
+ // Case insensitive.
+ if (!bCaseSensitive) {
+ if (strchr("ABCDEFabcdef", iChar) != NULL) {
+ return(true);
+ }
+ }
+ // Case sensitive
+ else {
+ if (strchr("ABCDEF", iChar) != NULL) {
+ return(true);
+ }
+ }
+ return(false);
+}
+
+// Is the character a Clarion base character (B=Binary, O=Octal, H=Hex)
+inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) {
+
+ // Case insensitive.
+ if (!bCaseSensitive) {
+ // If character is a numeric base character
+ if (strchr("BOHboh", iChar) != NULL) {
+ return(true);
+ }
+ }
+ // Case sensitive
+ else {
+ // If character is a numeric base character
+ if (strchr("BOH", iChar) != NULL) {
+ return(true);
+ }
+ }
+ return(false);
+}
+
+// Set the correct numeric constant state
+inline bool SetNumericConstantState(StyleContext &scDoc) {
+
+ int iPoints = 0; // Point counter
+ char cNumericString[512]; // Numeric string buffer
+
+ // Buffer the current numberic string
+ scDoc.GetCurrent(cNumericString, sizeof(cNumericString));
+ // Loop through the string until end of string (NULL termination)
+ for (int iIndex = 0; cNumericString[iIndex] != '\0'; iIndex++) {
+ // Depending on the character
+ switch (cNumericString[iIndex]) {
+ // Is a . (point)
+ case '.' :
+ // Increment point counter
+ iPoints++;
+ break;
+ default :
+ break;
+ }
+ }
+ // If points found (can be more than one for improper formatted number
+ if (iPoints > 0) {
+ return(true);
+ }
+ // Else no points found
+ else {
+ return(false);
+ }
+}
+
+// Get the next word in uppercase from the current position (keyword lookahead)
+inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) {
+
+ unsigned int iIndex = 0; // Buffer Index
+
+ // Loop through the remaining string from the current position
+ for (int iOffset = uiStartPos; iOffset < iLength; iOffset++) {
+ // Get the character from the buffer using the offset
+ char cCharacter = styler[iOffset];
+ if (IsEOL(cCharacter)) {
+ break;
+ }
+ // If the character is alphabet character
+ if (isalpha(cCharacter)) {
+ // Add UPPERCASE character to the word buffer
+ cWord[iIndex++] = CharacterUpper(cCharacter);
+ }
+ }
+ // Add null termination
+ cWord[iIndex] = '\0';
+ // If no word was found
+ if (iIndex == 0) {
+ // Return failure
+ return(false);
+ }
+ // Else word was found
+ else {
+ // Return success
+ return(true);
+ }
+}
+
+// Clarion Language Colouring Procedure
+static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) {
+
+ int iParenthesesLevel = 0; // Parenthese Level
+ int iColumn1Label = false; // Label starts in Column 1
+
+ WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords
+ WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives
+ WordList &wlRuntimeExpressions = *wlKeywords[2]; // Runtime Expressions
+ WordList &wlBuiltInProcsFuncs = *wlKeywords[3]; // Builtin Procedures and Functions
+ WordList &wlStructsDataTypes = *wlKeywords[4]; // Structures and Data Types
+ WordList &wlAttributes = *wlKeywords[5]; // Procedure Attributes
+ WordList &wlStandardEquates = *wlKeywords[6]; // Standard Equates
+ WordList &wlLabelReservedWords = *wlKeywords[7]; // Clarion Reserved Keywords (Labels)
+ WordList &wlProcLabelReservedWords = *wlKeywords[8]; // Clarion Reserved Keywords (Procedure Labels)
+
+ const char wlProcReservedKeywordList[] =
+ "PROCEDURE FUNCTION";
+ WordList wlProcReservedKeywords;
+ wlProcReservedKeywords.Set(wlProcReservedKeywordList);
+
+ const char wlCompilerKeywordList[] =
+ "COMPILE OMIT";
+ WordList wlCompilerKeywords;
+ wlCompilerKeywords.Set(wlCompilerKeywordList);
+
+ const char wlLegacyStatementsList[] =
+ "BOF EOF FUNCTION POINTER SHARE";
+ WordList wlLegacyStatements;
+ wlLegacyStatements.Set(wlLegacyStatementsList);
+
+ StyleContext scDoc(uiStartPos, iLength, iInitStyle, accStyler);
+
+ // lex source code
+ for (; scDoc.More(); scDoc.Forward())
+ {
+ //
+ // Determine if the current state should terminate.
+ //
+
+ // Label State Handling
+ if (scDoc.state == SCE_CLW_LABEL) {
+ // If the character is not a valid label
+ if (!IsALabelCharacter(scDoc.ch)) {
+ // If the character is a . (dot syntax)
+ if (scDoc.ch == '.') {
+ // Turn off column 1 label flag as label now cannot be reserved work
+ iColumn1Label = false;
+ // Uncolour the . (dot) to default state, move forward one character,
+ // and change back to the label state.
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ scDoc.Forward();
+ scDoc.SetState(SCE_CLW_LABEL);
+ }
+ // Else check label
+ else {
+ char cLabel[512]; // Label buffer
+ // Buffer the current label string
+ scDoc.GetCurrent(cLabel,sizeof(cLabel));
+ // If case insensitive, convert string to UPPERCASE to match passed keywords.
+ if (!bCaseSensitive) {
+ StringUpper(cLabel);
+ }
+ // Else if UPPERCASE label string is in the Clarion compiler keyword list
+ if (wlCompilerKeywords.InList(cLabel) && iColumn1Label){
+ // change the label to error state
+ scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE);
+ }
+ // Else if UPPERCASE label string is in the Clarion reserved keyword list
+ else if (wlLabelReservedWords.InList(cLabel) && iColumn1Label){
+ // change the label to error state
+ scDoc.ChangeState(SCE_CLW_ERROR);
+ }
+ // Else if UPPERCASE label string is
+ else if (wlProcLabelReservedWords.InList(cLabel) && iColumn1Label) {
+ char cWord[512]; // Word buffer
+ // Get the next word from the current position
+ if (GetNextWordUpper(accStyler,scDoc.currentPos,uiStartPos+iLength,cWord)) {
+ // If the next word is a procedure reserved word
+ if (wlProcReservedKeywords.InList(cWord)) {
+ // Change the label to error state
+ scDoc.ChangeState(SCE_CLW_ERROR);
+ }
+ }
+ }
+ // Else if label string is in the compiler directive keyword list
+ else if (wlCompilerDirectives.InList(cLabel)) {
+ // change the state to compiler directive state
+ scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE);
+ }
+ // Terminate the label state and set to default state
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ }
+ }
+ // Keyword State Handling
+ else if (scDoc.state == SCE_CLW_KEYWORD) {
+ // If character is : (colon)
+ if (scDoc.ch == ':') {
+ char cEquate[512]; // Equate buffer
+ // Move forward to include : (colon) in buffer
+ scDoc.Forward();
+ // Buffer the equate string
+ scDoc.GetCurrent(cEquate,sizeof(cEquate));
+ // If case insensitive, convert string to UPPERCASE to match passed keywords.
+ if (!bCaseSensitive) {
+ StringUpper(cEquate);
+ }
+ // If statement string is in the equate list
+ if (wlStandardEquates.InList(cEquate)) {
+ // Change to equate state
+ scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE);
+ }
+ }
+ // If the character is not a valid label character
+ else if (!IsALabelCharacter(scDoc.ch)) {
+ char cStatement[512]; // Statement buffer
+ // Buffer the statement string
+ scDoc.GetCurrent(cStatement,sizeof(cStatement));
+ // If case insensitive, convert string to UPPERCASE to match passed keywords.
+ if (!bCaseSensitive) {
+ StringUpper(cStatement);
+ }
+ // If statement string is in the Clarion keyword list
+ if (wlClarionKeywords.InList(cStatement)) {
+ // Change the statement string to the Clarion keyword state
+ scDoc.ChangeState(SCE_CLW_KEYWORD);
+ }
+ // Else if statement string is in the compiler directive keyword list
+ else if (wlCompilerDirectives.InList(cStatement)) {
+ // Change the statement string to the compiler directive state
+ scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE);
+ }
+ // Else if statement string is in the runtime expressions keyword list
+ else if (wlRuntimeExpressions.InList(cStatement)) {
+ // Change the statement string to the runtime expressions state
+ scDoc.ChangeState(SCE_CLW_RUNTIME_EXPRESSIONS);
+ }
+ // Else if statement string is in the builtin procedures and functions keyword list
+ else if (wlBuiltInProcsFuncs.InList(cStatement)) {
+ // Change the statement string to the builtin procedures and functions state
+ scDoc.ChangeState(SCE_CLW_BUILTIN_PROCEDURES_FUNCTION);
+ }
+ // Else if statement string is in the tructures and data types keyword list
+ else if (wlStructsDataTypes.InList(cStatement)) {
+ // Change the statement string to the structures and data types state
+ scDoc.ChangeState(SCE_CLW_STRUCTURE_DATA_TYPE);
+ }
+ // Else if statement string is in the procedure attribute keyword list
+ else if (wlAttributes.InList(cStatement)) {
+ // Change the statement string to the procedure attribute state
+ scDoc.ChangeState(SCE_CLW_ATTRIBUTE);
+ }
+ // Else if statement string is in the standard equate keyword list
+ else if (wlStandardEquates.InList(cStatement)) {
+ // Change the statement string to the standard equate state
+ scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE);
+ }
+ // Else if statement string is in the deprecated or legacy keyword list
+ else if (wlLegacyStatements.InList(cStatement)) {
+ // Change the statement string to the standard equate state
+ scDoc.ChangeState(SCE_CLW_DEPRECATED);
+ }
+ // Else the statement string doesn't match any work list
+ else {
+ // Change the statement string to the default state
+ scDoc.ChangeState(SCE_CLW_DEFAULT);
+ }
+ // Terminate the keyword state and set to default state
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ }
+ // String State Handling
+ else if (scDoc.state == SCE_CLW_STRING) {
+ // If the character is an ' (single quote)
+ if (scDoc.ch == '\'') {
+ // Set the state to default and move forward colouring
+ // the ' (single quote) as default state
+ // terminating the string state
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ scDoc.Forward();
+ }
+ // If the next character is an ' (single quote)
+ if (scDoc.chNext == '\'') {
+ // Move forward one character and set to default state
+ // colouring the next ' (single quote) as default state
+ // terminating the string state
+ scDoc.ForwardSetState(SCE_CLW_DEFAULT);
+ scDoc.Forward();
+ }
+ }
+ // Picture String State Handling
+ else if (scDoc.state == SCE_CLW_PICTURE_STRING) {
+ // If the character is an ( (open parenthese)
+ if (scDoc.ch == '(') {
+ // Increment the parenthese level
+ iParenthesesLevel++;
+ }
+ // Else if the character is a ) (close parenthese)
+ else if (scDoc.ch == ')') {
+ // If the parenthese level is set to zero
+ // parentheses matched
+ if (!iParenthesesLevel) {
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ // Else parenthese level is greater than zero
+ // still looking for matching parentheses
+ else {
+ // Decrement the parenthese level
+ iParenthesesLevel--;
+ }
+ }
+ }
+ // Standard Equate State Handling
+ else if (scDoc.state == SCE_CLW_STANDARD_EQUATE) {
+ if (!isalnum(scDoc.ch)) {
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ }
+ // Integer Constant State Handling
+ else if (scDoc.state == SCE_CLW_INTEGER_CONSTANT) {
+ // If the character is not a digit (0-9)
+ // or character is not a hexidecimal character (A-F)
+ // or character is not a . (point)
+ // or character is not a numberic base character (B,O,H)
+ if (!(isdigit(scDoc.ch)
+ || IsAHexCharacter(scDoc.ch, bCaseSensitive)
+ || scDoc.ch == '.'
+ || IsANumericBaseCharacter(scDoc.ch, bCaseSensitive))) {
+ // If the number was a real
+ if (SetNumericConstantState(scDoc)) {
+ // Colour the matched string to the real constant state
+ scDoc.ChangeState(SCE_CLW_REAL_CONSTANT);
+ }
+ // Else the number was an integer
+ else {
+ // Colour the matched string to an integer constant state
+ scDoc.ChangeState(SCE_CLW_INTEGER_CONSTANT);
+ }
+ // Terminate the integer constant state and set to default state
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ }
+
+ //
+ // Determine if a new state should be entered.
+ //
+
+ // Beginning of Line Handling
+ if (scDoc.atLineStart) {
+ // Reset the column 1 label flag
+ iColumn1Label = false;
+ // If column 1 character is a label start character
+ if (IsALabelStart(scDoc.ch)) {
+ // Label character is found in column 1
+ // so set column 1 label flag and clear last column 1 label
+ iColumn1Label = true;
+ // Set the state to label
+ scDoc.SetState(SCE_CLW_LABEL);
+ }
+ // else if character is a space or tab
+ else if (IsASpace(scDoc.ch)){
+ // Set to default state
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ // else if comment start (!) or is an * (asterisk)
+ else if (IsACommentStart(scDoc.ch) || scDoc.ch == '*' ) {
+ // then set the state to comment.
+ scDoc.SetState(SCE_CLW_COMMENT);
+ }
+ // else the character is a ? (question mark)
+ else if (scDoc.ch == '?') {
+ // Change to the compiler directive state, move forward,
+ // colouring the ? (question mark), change back to default state.
+ scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE);
+ scDoc.Forward();
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ // else an invalid character in column 1
+ else {
+ // Set to error state
+ scDoc.SetState(SCE_CLW_ERROR);
+ }
+ }
+ // End of Line Handling
+ else if (scDoc.atLineEnd) {
+ // Reset to the default state at the end of each line.
+ scDoc.SetState(SCE_CLW_DEFAULT);
+ }
+ // Default Handling
+ else {
+ // If in default state
+ if (scDoc.state == SCE_CLW_DEFAULT) {
+ // If is a letter could be a possible statement
+ if (isalpha(scDoc.ch)) {
+ // Set the state to Clarion Keyword and verify later
+ scDoc.SetState(SCE_CLW_KEYWORD);
+ }
+ // else is a number
+ else if (isdigit(scDoc.ch)) {
+ // Set the state to Integer Constant and verify later
+ scDoc.SetState(SCE_CLW_INTEGER_CONSTANT);
+ }
+ // else if the start of a comment or a | (line continuation)
+ else if (IsACommentStart(scDoc.ch) || scDoc.ch == '|') {
+ // then set the state to comment.
+ scDoc.SetState(SCE_CLW_COMMENT);
+ }
+ // else if the character is a ' (single quote)
+ else if (scDoc.ch == '\'') {
+ // If the character is also a ' (single quote)
+ // Embedded Apostrophe
+ if (scDoc.chNext == '\'') {
+ // Move forward colouring it as default state
+ scDoc.ForwardSetState(SCE_CLW_DEFAULT);
+ }
+ else {
+ // move to the next character and then set the state to comment.
+ scDoc.ForwardSetState(SCE_CLW_STRING);
+ }
+ }
+ // else the character is an @ (ampersand)
+ else if (scDoc.ch == '@') {
+ // Case insensitive.
+ if (!bCaseSensitive) {
+ // If character is a valid picture token character
+ if (strchr("DEKNPSTdeknpst", scDoc.chNext) != NULL) {
+ // Set to the picture string state
+ scDoc.SetState(SCE_CLW_PICTURE_STRING);
+ }
+ }
+ // Case sensitive
+ else {
+ // If character is a valid picture token character
+ if (strchr("DEKNPST", scDoc.chNext) != NULL) {
+ // Set the picture string state
+ scDoc.SetState(SCE_CLW_PICTURE_STRING);
+ }
+ }
+ }
+ }
+ }
+ }
+ // lexing complete
+ scDoc.Complete();
+}
+
+// Clarion Language Case Sensitive Colouring Procedure
+static void ColouriseClarionDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
+
+ ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true);
+}
+
+// Clarion Language Case Insensitive Colouring Procedure
+static void ColouriseClarionDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) {
+
+ ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false);
+}
+
+// Fill Buffer
+
+static void FillBuffer(unsigned int uiStart, unsigned int uiEnd, Accessor &accStyler, char *szBuffer, unsigned int uiLength) {
+
+ unsigned int uiPos = 0;
+
+ while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) {
+ szBuffer[uiPos] = static_cast<char>(toupper(accStyler[uiStart + uiPos]));
+ uiPos++;
+ }
+ szBuffer[uiPos] = '\0';
+}
+
+// Classify Clarion Fold Point
+
+static int ClassifyClarionFoldPoint(int iLevel, const char* szString) {
+
+ if (!(isdigit(szString[0]) || (szString[0] == '.'))) {
+ if (strcmp(szString, "PROCEDURE") == 0) {
+ // iLevel = SC_FOLDLEVELBASE + 1;
+ }
+ else if (strcmp(szString, "MAP") == 0 ||
+ strcmp(szString,"ACCEPT") == 0 ||
+ strcmp(szString,"BEGIN") == 0 ||
+ strcmp(szString,"CASE") == 0 ||
+ strcmp(szString,"EXECUTE") == 0 ||
+ strcmp(szString,"IF") == 0 ||
+ strcmp(szString,"ITEMIZE") == 0 ||
+ strcmp(szString,"INTERFACE") == 0 ||
+ strcmp(szString,"JOIN") == 0 ||
+ strcmp(szString,"LOOP") == 0 ||
+ strcmp(szString,"MODULE") == 0 ||
+ strcmp(szString,"RECORD") == 0) {
+ iLevel++;
+ }
+ else if (strcmp(szString, "APPLICATION") == 0 ||
+ strcmp(szString, "CLASS") == 0 ||
+ strcmp(szString, "DETAIL") == 0 ||
+ strcmp(szString, "FILE") == 0 ||
+ strcmp(szString, "FOOTER") == 0 ||
+ strcmp(szString, "FORM") == 0 ||
+ strcmp(szString, "GROUP") == 0 ||
+ strcmp(szString, "HEADER") == 0 ||
+ strcmp(szString, "INTERFACE") == 0 ||
+ strcmp(szString, "MENU") == 0 ||
+ strcmp(szString, "MENUBAR") == 0 ||
+ strcmp(szString, "OLE") == 0 ||
+ strcmp(szString, "OPTION") == 0 ||
+ strcmp(szString, "QUEUE") == 0 ||
+ strcmp(szString, "REPORT") == 0 ||
+ strcmp(szString, "SHEET") == 0 ||
+ strcmp(szString, "TAB") == 0 ||
+ strcmp(szString, "TOOLBAR") == 0 ||
+ strcmp(szString, "VIEW") == 0 ||
+ strcmp(szString, "WINDOW") == 0) {
+ iLevel++;
+ }
+ else if (strcmp(szString, "END") == 0 ||
+ strcmp(szString, "UNTIL") == 0 ||
+ strcmp(szString, "WHILE") == 0) {
+ iLevel--;
+ }
+ }
+ return(iLevel);
+}
+
+// Clarion Language Folding Procedure
+static void FoldClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *[], Accessor &accStyler) {
+
+ unsigned int uiEndPos = uiStartPos + iLength;
+ int iLineCurrent = accStyler.GetLine(uiStartPos);
+ int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int iLevelCurrent = iLevelPrev;
+ char chNext = accStyler[uiStartPos];
+ int iStyle = iInitStyle;
+ int iStyleNext = accStyler.StyleAt(uiStartPos);
+ int iVisibleChars = 0;
+ int iLastStart = 0;
+
+ for (unsigned int uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) {
+
+ char chChar = chNext;
+ chNext = accStyler.SafeGetCharAt(uiPos + 1);
+ int iStylePrev = iStyle;
+ iStyle = iStyleNext;
+ iStyleNext = accStyler.StyleAt(uiPos + 1);
+ bool bEOL = (chChar == '\r' && chNext != '\n') || (chChar == '\n');
+
+ if (iStylePrev == SCE_CLW_DEFAULT) {
+ if (iStyle == SCE_CLW_KEYWORD || iStyle == SCE_CLW_STRUCTURE_DATA_TYPE) {
+ // Store last word start point.
+ iLastStart = uiPos;
+ }
+ }
+
+ if (iStylePrev == SCE_CLW_KEYWORD || iStylePrev == SCE_CLW_STRUCTURE_DATA_TYPE) {
+ if(iswordchar(chChar) && !iswordchar(chNext)) {
+ char chBuffer[100];
+ FillBuffer(iLastStart, uiPos, accStyler, chBuffer, sizeof(chBuffer));
+ iLevelCurrent = ClassifyClarionFoldPoint(iLevelCurrent,chBuffer);
+ // if ((iLevelCurrent == SC_FOLDLEVELBASE + 1) && iLineCurrent > 1) {
+ // accStyler.SetLevel(iLineCurrent-1,SC_FOLDLEVELBASE);
+ // iLevelPrev = SC_FOLDLEVELBASE;
+ // }
+ }
+ }
+
+ if (bEOL) {
+ int iLevel = iLevelPrev;
+ if ((iLevelCurrent > iLevelPrev) && (iVisibleChars > 0))
+ iLevel |= SC_FOLDLEVELHEADERFLAG;
+ if (iLevel != accStyler.LevelAt(iLineCurrent)) {
+ accStyler.SetLevel(iLineCurrent,iLevel);
+ }
+ iLineCurrent++;
+ iLevelPrev = iLevelCurrent;
+ iVisibleChars = 0;
+ }
+
+ if (!isspacechar(chChar))
+ iVisibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags
+ // as they will be filled in later.
+ int iFlagsNext = accStyler.LevelAt(iLineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ accStyler.SetLevel(iLineCurrent, iLevelPrev | iFlagsNext);
+}
+
+// Word List Descriptions
+static const char * const rgWordListDescriptions[] = {
+ "Clarion Keywords",
+ "Compiler Directives",
+ "Built-in Procedures and Functions",
+ "Runtime Expressions",
+ "Structure and Data Types",
+ "Attributes",
+ "Standard Equates",
+ "Reserved Words (Labels)",
+ "Reserved Words (Procedure Labels)",
+ 0,
+};
+
+// Case Sensitive Clarion Language Lexer
+LexerModule lmClw(SCLEX_CLW, ColouriseClarionDocSensitive, "clarion", FoldClarionDoc, rgWordListDescriptions);
+
+// Case Insensitive Clarion Language Lexer
+LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClarionDocInsensitive, "clarionnocase", FoldClarionDoc, rgWordListDescriptions);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCOBOL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCOBOL.cxx
new file mode 100644
index 00000000000..a937690d850
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCOBOL.cxx
@@ -0,0 +1,381 @@
+// Scintilla source code edit control
+/** @file LexCOBOL.cxx
+ ** Lexer for COBOL
+ ** Based on LexPascal.cxx
+ ** Written by Laurent le Tynevez
+ ** Updated by Simon Steele <s.steele@pnotepad.org> September 2002
+ ** Updated by Mathias Rauen <scite@madshi.net> May 2003 (Delphi adjustments)
+ ** Updated by Rod Falck, Aug 2006 Converted to COBOL
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define IN_DIVISION 0x01
+#define IN_DECLARATIVES 0x02
+#define IN_SECTION 0x04
+#define IN_PARAGRAPH 0x08
+#define IN_FLAGS 0xF
+#define NOT_HEADER 0x10
+
+inline bool isCOBOLoperator(char ch)
+ {
+ return isoperator(ch);
+ }
+
+inline bool isCOBOLwordchar(char ch)
+ {
+ return IsASCII(ch) && (isalnum(ch) || ch == '-');
+
+ }
+
+inline bool isCOBOLwordstart(char ch)
+ {
+ return IsASCII(ch) && isalnum(ch);
+ }
+
+static int CountBits(int nBits)
+ {
+ int count = 0;
+ for (int i = 0; i < 32; ++i)
+ {
+ count += nBits & 1;
+ nBits >>= 1;
+ }
+ return count;
+ }
+
+static void getRange(unsigned int start,
+ unsigned int end,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr) {
+ styler.ColourTo(end, attr);
+}
+
+
+static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, int nContainment, bool *bAarea) {
+ int ret = 0;
+
+ WordList& a_keywords = *keywordlists[0];
+ WordList& b_keywords = *keywordlists[1];
+ WordList& c_keywords = *keywordlists[2];
+
+ char s[100];
+ s[0] = '\0';
+ s[1] = '\0';
+ getRange(start, end, styler, s, sizeof(s));
+
+ char chAttr = SCE_C_IDENTIFIER;
+ if (isdigit(s[0]) || (s[0] == '.') || (s[0] == 'v')) {
+ chAttr = SCE_C_NUMBER;
+ char *p = s + 1;
+ while (*p) {
+ if ((!isdigit(*p) && (*p) != 'v') && isCOBOLwordchar(*p)) {
+ chAttr = SCE_C_IDENTIFIER;
+ break;
+ }
+ ++p;
+ }
+ }
+ else {
+ if (a_keywords.InList(s)) {
+ chAttr = SCE_C_WORD;
+ }
+ else if (b_keywords.InList(s)) {
+ chAttr = SCE_C_WORD2;
+ }
+ else if (c_keywords.InList(s)) {
+ chAttr = SCE_C_UUID;
+ }
+ }
+ if (*bAarea) {
+ if (strcmp(s, "division") == 0) {
+ ret = IN_DIVISION;
+ // we've determined the containment, anything else is just ignored for those purposes
+ *bAarea = false;
+ } else if (strcmp(s, "declaratives") == 0) {
+ ret = IN_DIVISION | IN_DECLARATIVES;
+ if (nContainment & IN_DECLARATIVES)
+ ret |= NOT_HEADER | IN_SECTION;
+ // we've determined the containment, anything else is just ignored for those purposes
+ *bAarea = false;
+ } else if (strcmp(s, "section") == 0) {
+ ret = (nContainment &~ IN_PARAGRAPH) | IN_SECTION;
+ // we've determined the containment, anything else is just ignored for those purposes
+ *bAarea = false;
+ } else if (strcmp(s, "end") == 0 && (nContainment & IN_DECLARATIVES)) {
+ ret = IN_DIVISION | IN_DECLARATIVES | IN_SECTION | NOT_HEADER;
+ } else {
+ ret = nContainment | IN_PARAGRAPH;
+ }
+ }
+ ColourTo(styler, end, chAttr);
+ return ret;
+}
+
+static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ styler.StartAt(startPos);
+
+ int state = initStyle;
+ if (state == SCE_C_CHARACTER) // Does not leak onto next line
+ state = SCE_C_DEFAULT;
+ char chPrev = ' ';
+ char chNext = styler[startPos];
+ unsigned int lengthDoc = startPos + length;
+
+ int nContainment;
+
+ int currentLine = styler.GetLine(startPos);
+ if (currentLine > 0) {
+ styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
+ nContainment = styler.GetLineState(currentLine);
+ nContainment &= ~NOT_HEADER;
+ } else {
+ styler.SetLineState(currentLine, 0);
+ nContainment = 0;
+ }
+
+ styler.StartSegment(startPos);
+ bool bNewLine = true;
+ bool bAarea = !isspacechar(chNext);
+ int column = 0;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ ++column;
+
+ if (bNewLine) {
+ column = 0;
+ }
+ if (column <= 1 && !bAarea) {
+ bAarea = !isspacechar(ch);
+ }
+ bool bSetNewLine = false;
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
+ // Avoid triggering two times on Dos/Win
+ // End of line
+ if (state == SCE_C_CHARACTER) {
+ ColourTo(styler, i, state);
+ state = SCE_C_DEFAULT;
+ }
+ styler.SetLineState(currentLine, nContainment);
+ currentLine++;
+ bSetNewLine = true;
+ if (nContainment & NOT_HEADER)
+ nContainment &= ~(NOT_HEADER | IN_DECLARATIVES | IN_SECTION);
+ }
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_C_DEFAULT) {
+ if (isCOBOLwordstart(ch) || (ch == '$' && IsASCII(chNext) && isalpha(chNext))) {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_IDENTIFIER;
+ } else if (column == 6 && ch == '*') {
+ // Cobol comment line: asterisk in column 7.
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '*' && chNext == '>') {
+ // Cobol inline comment: asterisk, followed by greater than.
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTLINE;
+ } else if (column == 0 && ch == '*' && chNext != '*') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTLINE;
+ } else if (column == 0 && ch == '/' && chNext != '*') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTLINE;
+ } else if (column == 0 && ch == '*' && chNext == '*') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTDOC;
+ } else if (column == 0 && ch == '/' && chNext == '*') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_COMMENTDOC;
+ } else if (ch == '"') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_STRING;
+ } else if (ch == '\'') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_CHARACTER;
+ } else if (ch == '?' && column == 0) {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_PREPROCESSOR;
+ } else if (isCOBOLoperator(ch)) {
+ ColourTo(styler, i-1, state);
+ ColourTo(styler, i, SCE_C_OPERATOR);
+ }
+ } else if (state == SCE_C_IDENTIFIER) {
+ if (!isCOBOLwordchar(ch)) {
+ int lStateChange = classifyWordCOBOL(styler.GetStartSegment(), i - 1, keywordlists, styler, nContainment, &bAarea);
+
+ if(lStateChange != 0) {
+ styler.SetLineState(currentLine, lStateChange);
+ nContainment = lStateChange;
+ }
+
+ state = SCE_C_DEFAULT;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (ch == '"') {
+ state = SCE_C_STRING;
+ } else if (ch == '\'') {
+ state = SCE_C_CHARACTER;
+ } else if (isCOBOLoperator(ch)) {
+ ColourTo(styler, i, SCE_C_OPERATOR);
+ }
+ }
+ } else {
+ if (state == SCE_C_PREPROCESSOR) {
+ if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENT) {
+ if (ch == '\r' || ch == '\n') {
+ ColourTo(styler, i, state);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENTDOC) {
+ if (ch == '\r' || ch == '\n') {
+ if (((i > styler.GetStartSegment() + 2) || (
+ (initStyle == SCE_C_COMMENTDOC) &&
+ (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
+ ColourTo(styler, i, state);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ } else if (state == SCE_C_COMMENTLINE) {
+ if (ch == '\r' || ch == '\n') {
+ ColourTo(styler, i-1, state);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_STRING) {
+ if (ch == '"') {
+ ColourTo(styler, i, state);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_CHARACTER) {
+ if (ch == '\'') {
+ ColourTo(styler, i, state);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ }
+ chPrev = ch;
+ bNewLine = bSetNewLine;
+ if (bNewLine)
+ {
+ bAarea = false;
+ }
+ }
+ ColourTo(styler, lengthDoc - 1, state);
+}
+
+static void FoldCOBOLDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK : 0xFFF;
+ char chNext = styler[startPos];
+
+ bool bNewLine = true;
+ bool bAarea = !isspacechar(chNext);
+ int column = 0;
+ bool bComment = false;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ ++column;
+
+ if (bNewLine) {
+ column = 0;
+ bComment = (ch == '*' || ch == '/' || ch == '?');
+ }
+ if (column <= 1 && !bAarea) {
+ bAarea = !isspacechar(ch);
+ }
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (atEOL) {
+ int nContainment = styler.GetLineState(lineCurrent);
+ int lev = CountBits(nContainment & IN_FLAGS) | SC_FOLDLEVELBASE;
+ if (bAarea && !bComment)
+ --lev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((bAarea) && (visibleChars > 0) && !(nContainment & NOT_HEADER) && !bComment)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ if ((lev & SC_FOLDLEVELNUMBERMASK) <= (levelPrev & SC_FOLDLEVELNUMBERMASK)) {
+ // this level is at the same level or less than the previous line
+ // therefore these is nothing for the previous header to collapse, so remove the header
+ styler.SetLevel(lineCurrent - 1, levelPrev & ~SC_FOLDLEVELHEADERFLAG);
+ }
+ levelPrev = lev;
+ visibleChars = 0;
+ bAarea = false;
+ bNewLine = true;
+ lineCurrent++;
+ } else {
+ bNewLine = false;
+ }
+
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const COBOLWordListDesc[] = {
+ "A Keywords",
+ "B Keywords",
+ "Extended Keywords",
+ 0
+};
+
+LexerModule lmCOBOL(SCLEX_COBOL, ColouriseCOBOLDoc, "COBOL", FoldCOBOLDoc, COBOLWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCPP.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCPP.cxx
new file mode 100644
index 00000000000..1d9e40d1761
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCPP.cxx
@@ -0,0 +1,1626 @@
+// Scintilla source code edit control
+/** @file LexCPP.cxx
+ ** Lexer for C++, C, Java, and JavaScript.
+ ** Further folding features and configuration properties added by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+#include "SparseState.h"
+#include "SubStyles.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+namespace {
+ // Use an unnamed namespace to protect the functions and classes from name conflicts
+
+bool IsSpaceEquiv(int state) {
+ return (state <= SCE_C_COMMENTDOC) ||
+ // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE
+ (state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) ||
+ (state == SCE_C_COMMENTDOCKEYWORDERROR);
+}
+
+// Preconditions: sc.currentPos points to a character after '+' or '-'.
+// The test for pos reaching 0 should be redundant,
+// and is in only for safety measures.
+// Limitation: this code will give the incorrect answer for code like
+// a = b+++/ptn/...
+// Putting a space between the '++' post-inc operator and the '+' binary op
+// fixes this, and is highly recommended for readability anyway.
+bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) {
+ int pos = (int) sc.currentPos;
+ while (--pos > 0) {
+ char ch = styler[pos];
+ if (ch == '+' || ch == '-') {
+ return styler[pos - 1] == ch;
+ }
+ }
+ return false;
+}
+
+bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) {
+ // Don't look at styles, so no need to flush.
+ int pos = (int) sc.currentPos;
+ int currentLine = styler.GetLine(pos);
+ int lineStartPos = styler.LineStart(currentLine);
+ while (--pos > lineStartPos) {
+ char ch = styler.SafeGetCharAt(pos);
+ if (ch != ' ' && ch != '\t') {
+ break;
+ }
+ }
+ const char *retBack = "nruter";
+ const char *s = retBack;
+ while (*s
+ && pos >= lineStartPos
+ && styler.SafeGetCharAt(pos) == *s) {
+ s++;
+ pos--;
+ }
+ return !*s;
+}
+
+bool IsSpaceOrTab(int ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+bool OnlySpaceOrTab(const std::string &s) {
+ for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) {
+ if (!IsSpaceOrTab(*it))
+ return false;
+ }
+ return true;
+}
+
+std::vector<std::string> StringSplit(const std::string &text, int separator) {
+ std::vector<std::string> vs(text.empty() ? 0 : 1);
+ for (std::string::const_iterator it = text.begin(); it != text.end(); ++it) {
+ if (*it == separator) {
+ vs.push_back(std::string());
+ } else {
+ vs.back() += *it;
+ }
+ }
+ return vs;
+}
+
+struct BracketPair {
+ std::vector<std::string>::iterator itBracket;
+ std::vector<std::string>::iterator itEndBracket;
+};
+
+BracketPair FindBracketPair(std::vector<std::string> &tokens) {
+ BracketPair bp;
+ std::vector<std::string>::iterator itTok = std::find(tokens.begin(), tokens.end(), "(");
+ bp.itBracket = tokens.end();
+ bp.itEndBracket = tokens.end();
+ if (itTok != tokens.end()) {
+ bp.itBracket = itTok;
+ size_t nest = 0;
+ while (itTok != tokens.end()) {
+ if (*itTok == "(") {
+ nest++;
+ } else if (*itTok == ")") {
+ nest--;
+ if (nest == 0) {
+ bp.itEndBracket = itTok;
+ return bp;
+ }
+ }
+ ++itTok;
+ }
+ }
+ bp.itBracket = tokens.end();
+ return bp;
+}
+
+void highlightTaskMarker(StyleContext &sc, LexAccessor &styler,
+ int activity, WordList &markerList, bool caseSensitive){
+ if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) {
+ const int lengthMarker = 50;
+ char marker[lengthMarker+1];
+ int currPos = (int) sc.currentPos;
+ int i = 0;
+ while (i < lengthMarker) {
+ char ch = styler.SafeGetCharAt(currPos + i);
+ if (IsASpace(ch) || isoperator(ch)) {
+ break;
+ }
+ if (caseSensitive)
+ marker[i] = ch;
+ else
+ marker[i] = static_cast<char>(tolower(ch));
+ i++;
+ }
+ marker[i] = '\0';
+ if (markerList.InList(marker)) {
+ sc.SetState(SCE_C_TASKMARKER|activity);
+ }
+ }
+}
+
+struct EscapeSequence {
+ int digitsLeft;
+ CharacterSet setHexDigits;
+ CharacterSet setOctDigits;
+ CharacterSet setNoneNumeric;
+ CharacterSet *escapeSetValid;
+ EscapeSequence() {
+ digitsLeft = 0;
+ escapeSetValid = 0;
+ setHexDigits = CharacterSet(CharacterSet::setDigits, "ABCDEFabcdef");
+ setOctDigits = CharacterSet(CharacterSet::setNone, "01234567");
+ }
+ void resetEscapeState(int nextChar) {
+ digitsLeft = 0;
+ escapeSetValid = &setNoneNumeric;
+ if (nextChar == 'U') {
+ digitsLeft = 9;
+ escapeSetValid = &setHexDigits;
+ } else if (nextChar == 'u') {
+ digitsLeft = 5;
+ escapeSetValid = &setHexDigits;
+ } else if (nextChar == 'x') {
+ digitsLeft = 5;
+ escapeSetValid = &setHexDigits;
+ } else if (setOctDigits.Contains(nextChar)) {
+ digitsLeft = 3;
+ escapeSetValid = &setOctDigits;
+ }
+ }
+ bool atEscapeEnd(int currChar) const {
+ return (digitsLeft <= 0) || !escapeSetValid->Contains(currChar);
+ }
+};
+
+std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
+ std::string restOfLine;
+ int i =0;
+ char ch = styler.SafeGetCharAt(start, '\n');
+ int endLine = styler.LineEnd(styler.GetLine(start));
+ while (((start+i) < endLine) && (ch != '\r')) {
+ char chNext = styler.SafeGetCharAt(start + i + 1, '\n');
+ if (ch == '/' && (chNext == '/' || chNext == '*'))
+ break;
+ if (allowSpace || (ch != ' '))
+ restOfLine += ch;
+ i++;
+ ch = chNext;
+ }
+ return restOfLine;
+}
+
+bool IsStreamCommentStyle(int style) {
+ return style == SCE_C_COMMENT ||
+ style == SCE_C_COMMENTDOC ||
+ style == SCE_C_COMMENTDOCKEYWORD ||
+ style == SCE_C_COMMENTDOCKEYWORDERROR;
+}
+
+struct PPDefinition {
+ int line;
+ std::string key;
+ std::string value;
+ bool isUndef;
+ std::string arguments;
+ PPDefinition(int line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, std::string arguments_="") :
+ line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) {
+ }
+};
+
+class LinePPState {
+ int state;
+ int ifTaken;
+ int level;
+ bool ValidLevel() const {
+ return level >= 0 && level < 32;
+ }
+ int maskLevel() const {
+ return 1 << level;
+ }
+public:
+ LinePPState() : state(0), ifTaken(0), level(-1) {
+ }
+ bool IsInactive() const {
+ return state != 0;
+ }
+ bool CurrentIfTaken() const {
+ return (ifTaken & maskLevel()) != 0;
+ }
+ void StartSection(bool on) {
+ level++;
+ if (ValidLevel()) {
+ if (on) {
+ state &= ~maskLevel();
+ ifTaken |= maskLevel();
+ } else {
+ state |= maskLevel();
+ ifTaken &= ~maskLevel();
+ }
+ }
+ }
+ void EndSection() {
+ if (ValidLevel()) {
+ state &= ~maskLevel();
+ ifTaken &= ~maskLevel();
+ }
+ level--;
+ }
+ void InvertCurrentLevel() {
+ if (ValidLevel()) {
+ state ^= maskLevel();
+ ifTaken |= maskLevel();
+ }
+ }
+};
+
+// Hold the preprocessor state for each line seen.
+// Currently one entry per line but could become sparse with just one entry per preprocessor line.
+class PPStates {
+ std::vector<LinePPState> vlls;
+public:
+ LinePPState ForLine(int line) const {
+ if ((line > 0) && (vlls.size() > static_cast<size_t>(line))) {
+ return vlls[line];
+ } else {
+ return LinePPState();
+ }
+ }
+ void Add(int line, LinePPState lls) {
+ vlls.resize(line+1);
+ vlls[line] = lls;
+ }
+};
+
+// An individual named option for use in an OptionSet
+
+// Options used for LexerCPP
+struct OptionsCPP {
+ bool stylingWithinPreprocessor;
+ bool identifiersAllowDollars;
+ bool trackPreprocessor;
+ bool updatePreprocessor;
+ bool verbatimStringsAllowEscapes;
+ bool triplequotedStrings;
+ bool hashquotedStrings;
+ bool backQuotedStrings;
+ bool escapeSequence;
+ bool fold;
+ bool foldSyntaxBased;
+ bool foldComment;
+ bool foldCommentMultiline;
+ bool foldCommentExplicit;
+ std::string foldExplicitStart;
+ std::string foldExplicitEnd;
+ bool foldExplicitAnywhere;
+ bool foldPreprocessor;
+ bool foldCompact;
+ bool foldAtElse;
+ OptionsCPP() {
+ stylingWithinPreprocessor = false;
+ identifiersAllowDollars = true;
+ trackPreprocessor = true;
+ updatePreprocessor = true;
+ verbatimStringsAllowEscapes = false;
+ triplequotedStrings = false;
+ hashquotedStrings = false;
+ backQuotedStrings = false;
+ escapeSequence = false;
+ fold = false;
+ foldSyntaxBased = true;
+ foldComment = false;
+ foldCommentMultiline = true;
+ foldCommentExplicit = true;
+ foldExplicitStart = "";
+ foldExplicitEnd = "";
+ foldExplicitAnywhere = false;
+ foldPreprocessor = false;
+ foldCompact = false;
+ foldAtElse = false;
+ }
+};
+
+const char *const cppWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ "Documentation comment keywords",
+ "Global classes and typedefs",
+ "Preprocessor definitions",
+ "Task marker and error marker keywords",
+ 0,
+};
+
+struct OptionSetCPP : public OptionSet<OptionsCPP> {
+ OptionSetCPP() {
+ DefineProperty("styling.within.preprocessor", &OptionsCPP::stylingWithinPreprocessor,
+ "For C++ code, determines whether all preprocessor code is styled in the "
+ "preprocessor style (0, the default) or only from the initial # to the end "
+ "of the command word(1).");
+
+ DefineProperty("lexer.cpp.allow.dollars", &OptionsCPP::identifiersAllowDollars,
+ "Set to 0 to disallow the '$' character in identifiers with the cpp lexer.");
+
+ DefineProperty("lexer.cpp.track.preprocessor", &OptionsCPP::trackPreprocessor,
+ "Set to 1 to interpret #if/#else/#endif to grey out code that is not active.");
+
+ DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor,
+ "Set to 1 to update preprocessor definitions when #define found.");
+
+ DefineProperty("lexer.cpp.verbatim.strings.allow.escapes", &OptionsCPP::verbatimStringsAllowEscapes,
+ "Set to 1 to allow verbatim strings to contain escape sequences.");
+
+ DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings,
+ "Set to 1 to enable highlighting of triple-quoted strings.");
+
+ DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings,
+ "Set to 1 to enable highlighting of hash-quoted strings.");
+
+ DefineProperty("lexer.cpp.backquoted.strings", &OptionsCPP::backQuotedStrings,
+ "Set to 1 to enable highlighting of back-quoted raw strings .");
+
+ DefineProperty("lexer.cpp.escape.sequence", &OptionsCPP::escapeSequence,
+ "Set to 1 to enable highlighting of escape sequences in strings");
+
+ DefineProperty("fold", &OptionsCPP::fold);
+
+ DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
+ "Set this property to 0 to disable syntax based folding.");
+
+ DefineProperty("fold.comment", &OptionsCPP::foldComment,
+ "This option enables folding multi-line comments and explicit fold points when using the C++ lexer. "
+ "Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} "
+ "at the end of a section that should fold.");
+
+ DefineProperty("fold.cpp.comment.multiline", &OptionsCPP::foldCommentMultiline,
+ "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
+
+ DefineProperty("fold.cpp.comment.explicit", &OptionsCPP::foldCommentExplicit,
+ "Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
+
+ DefineProperty("fold.cpp.explicit.start", &OptionsCPP::foldExplicitStart,
+ "The string to use for explicit fold start points, replacing the standard //{.");
+
+ DefineProperty("fold.cpp.explicit.end", &OptionsCPP::foldExplicitEnd,
+ "The string to use for explicit fold end points, replacing the standard //}.");
+
+ DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere,
+ "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
+
+ DefineProperty("fold.preprocessor", &OptionsCPP::foldPreprocessor,
+ "This option enables folding preprocessor directives when using the C++ lexer. "
+ "Includes C#'s explicit #region and #endregion folding directives.");
+
+ DefineProperty("fold.compact", &OptionsCPP::foldCompact);
+
+ DefineProperty("fold.at.else", &OptionsCPP::foldAtElse,
+ "This option enables C++ folding on a \"} else {\" line of an if statement.");
+
+ DefineWordListSets(cppWordLists);
+ }
+};
+
+const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0};
+
+}
+
+class LexerCPP : public ILexerWithSubStyles {
+ bool caseSensitive;
+ CharacterSet setWord;
+ CharacterSet setNegationOp;
+ CharacterSet setArithmethicOp;
+ CharacterSet setRelOp;
+ CharacterSet setLogicalOp;
+ CharacterSet setWordStart;
+ PPStates vlls;
+ std::vector<PPDefinition> ppDefineHistory;
+ WordList keywords;
+ WordList keywords2;
+ WordList keywords3;
+ WordList keywords4;
+ WordList ppDefinitions;
+ WordList markerList;
+ struct SymbolValue {
+ std::string value;
+ std::string arguments;
+ SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) {
+ }
+ SymbolValue &operator = (const std::string &value_) {
+ value = value_;
+ arguments.clear();
+ return *this;
+ }
+ bool IsMacro() const {
+ return !arguments.empty();
+ }
+ };
+ typedef std::map<std::string, SymbolValue> SymbolTable;
+ SymbolTable preprocessorDefinitionsStart;
+ OptionsCPP options;
+ OptionSetCPP osCPP;
+ EscapeSequence escapeSeq;
+ SparseState<std::string> rawStringTerminators;
+ enum { activeFlag = 0x40 };
+ enum { ssIdentifier, ssDocKeyword };
+ SubStyles subStyles;
+public:
+ explicit LexerCPP(bool caseSensitive_) :
+ caseSensitive(caseSensitive_),
+ setWord(CharacterSet::setAlphaNum, "._", 0x80, true),
+ setNegationOp(CharacterSet::setNone, "!"),
+ setArithmethicOp(CharacterSet::setNone, "+-/*%"),
+ setRelOp(CharacterSet::setNone, "=!<>"),
+ setLogicalOp(CharacterSet::setNone, "|&"),
+ subStyles(styleSubable, 0x80, 0x40, activeFlag) {
+ }
+ virtual ~LexerCPP() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvSubStyles;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osCPP.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osCPP.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osCPP.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osCPP.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ int SCI_METHOD LineEndTypesSupported() {
+ return SC_LINE_END_TYPE_UNICODE;
+ }
+
+ int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) {
+ return subStyles.Allocate(styleBase, numberStyles);
+ }
+ int SCI_METHOD SubStylesStart(int styleBase) {
+ return subStyles.Start(styleBase);
+ }
+ int SCI_METHOD SubStylesLength(int styleBase) {
+ return subStyles.Length(styleBase);
+ }
+ int SCI_METHOD StyleFromSubStyle(int subStyle) {
+ int styleBase = subStyles.BaseStyle(MaskActive(subStyle));
+ int active = subStyle & activeFlag;
+ return styleBase | active;
+ }
+ int SCI_METHOD PrimaryStyleFromStyle(int style) {
+ return MaskActive(style);
+ }
+ void SCI_METHOD FreeSubStyles() {
+ subStyles.Free();
+ }
+ void SCI_METHOD SetIdentifiers(int style, const char *identifiers) {
+ subStyles.SetIdentifiers(style, identifiers);
+ }
+ int SCI_METHOD DistanceToSecondaryStyles() {
+ return activeFlag;
+ }
+ const char * SCI_METHOD GetSubStyleBases() {
+ return styleSubable;
+ }
+
+ static ILexer *LexerFactoryCPP() {
+ return new LexerCPP(true);
+ }
+ static ILexer *LexerFactoryCPPInsensitive() {
+ return new LexerCPP(false);
+ }
+ static int MaskActive(int style) {
+ return style & ~activeFlag;
+ }
+ void EvaluateTokens(std::vector<std::string> &tokens, const SymbolTable &preprocessorDefinitions);
+ std::vector<std::string> Tokenize(const std::string &expr) const;
+ bool EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions);
+};
+
+int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) {
+ if (osCPP.PropertySet(&options, key, val)) {
+ if (strcmp(key, "lexer.cpp.allow.dollars") == 0) {
+ setWord = CharacterSet(CharacterSet::setAlphaNum, "._", 0x80, true);
+ if (options.identifiersAllowDollars) {
+ setWord.Add('$');
+ }
+ }
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords;
+ break;
+ case 1:
+ wordListN = &keywords2;
+ break;
+ case 2:
+ wordListN = &keywords3;
+ break;
+ case 3:
+ wordListN = &keywords4;
+ break;
+ case 4:
+ wordListN = &ppDefinitions;
+ break;
+ case 5:
+ wordListN = &markerList;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ if (n == 4) {
+ // Rebuild preprocessorDefinitions
+ preprocessorDefinitionsStart.clear();
+ for (int nDefinition = 0; nDefinition < ppDefinitions.Length(); nDefinition++) {
+ const char *cpDefinition = ppDefinitions.WordAt(nDefinition);
+ const char *cpEquals = strchr(cpDefinition, '=');
+ if (cpEquals) {
+ std::string name(cpDefinition, cpEquals - cpDefinition);
+ std::string val(cpEquals+1);
+ size_t bracket = name.find('(');
+ size_t bracketEnd = name.find(')');
+ if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) {
+ // Macro
+ std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1);
+ name = name.substr(0, bracket);
+ preprocessorDefinitionsStart[name] = SymbolValue(val, args);
+ } else {
+ preprocessorDefinitionsStart[name] = val;
+ }
+ } else {
+ std::string name(cpDefinition);
+ std::string val("1");
+ preprocessorDefinitionsStart[name] = val;
+ }
+ }
+ }
+ }
+ }
+ return firstModification;
+}
+
+// Functor used to truncate history
+struct After {
+ int line;
+ explicit After(int line_) : line(line_) {}
+ bool operator()(PPDefinition &p) const {
+ return p.line > line;
+ }
+};
+
+void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
+ CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-");
+
+ CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]");
+
+ setWordStart = CharacterSet(CharacterSet::setAlpha, "_", 0x80, true);
+
+ CharacterSet setInvalidRawFirst(CharacterSet::setNone, " )\\\t\v\f\n");
+
+ if (options.identifiersAllowDollars) {
+ setWordStart.Add('$');
+ }
+
+ int chPrevNonWhite = ' ';
+ int visibleChars = 0;
+ bool lastWordWasUUID = false;
+ int styleBeforeDCKeyword = SCE_C_DEFAULT;
+ int styleBeforeTaskMarker = SCE_C_DEFAULT;
+ bool continuationLine = false;
+ bool isIncludePreprocessor = false;
+ bool isStringInPreprocessor = false;
+ bool inRERange = false;
+ bool seenDocKeyBrace = false;
+
+ int lineCurrent = styler.GetLine(startPos);
+ if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
+ (MaskActive(initStyle) == SCE_C_COMMENTLINE) ||
+ (MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
+ // Set continuationLine if last character of previous line is '\'
+ if (lineCurrent > 0) {
+ int endLinePrevious = styler.LineEnd(lineCurrent - 1);
+ if (endLinePrevious > 0) {
+ continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
+ }
+ }
+ }
+
+ // look back to set chPrevNonWhite properly for better regex colouring
+ if (startPos > 0) {
+ int back = startPos;
+ while (--back && IsSpaceEquiv(MaskActive(styler.StyleAt(back))))
+ ;
+ if (MaskActive(styler.StyleAt(back)) == SCE_C_OPERATOR) {
+ chPrevNonWhite = styler.SafeGetCharAt(back);
+ }
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler, static_cast<unsigned char>(0xff));
+ LinePPState preproc = vlls.ForLine(lineCurrent);
+
+ bool definitionsChanged = false;
+
+ // Truncate ppDefineHistory before current line
+
+ if (!options.updatePreprocessor)
+ ppDefineHistory.clear();
+
+ std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(lineCurrent-1));
+ if (itInvalid != ppDefineHistory.end()) {
+ ppDefineHistory.erase(itInvalid, ppDefineHistory.end());
+ definitionsChanged = true;
+ }
+
+ SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart;
+ for (std::vector<PPDefinition>::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) {
+ if (itDef->isUndef)
+ preprocessorDefinitions.erase(itDef->key);
+ else
+ preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments);
+ }
+
+ std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1);
+ SparseState<std::string> rawSTNew(lineCurrent);
+
+ int activitySet = preproc.IsInactive() ? activeFlag : 0;
+
+ const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_C_IDENTIFIER);
+ const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD);
+
+ int lineEndNext = styler.LineEnd(lineCurrent);
+
+ for (; sc.More();) {
+
+ if (sc.atLineStart) {
+ // Using MaskActive() is not needed in the following statement.
+ // Inside inactive preprocessor declaration, state will be reset anyway at the end of this block.
+ if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) {
+ // Prevent SCE_C_STRINGEOL from leaking back to previous line which
+ // ends with a line continuation by locking in the state up to this position.
+ sc.SetState(sc.state);
+ }
+ if ((MaskActive(sc.state) == SCE_C_PREPROCESSOR) && (!continuationLine)) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ // Reset states to beginning of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ lastWordWasUUID = false;
+ isIncludePreprocessor = false;
+ inRERange = false;
+ if (preproc.IsInactive()) {
+ activitySet = activeFlag;
+ sc.SetState(sc.state | activitySet);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ lineCurrent++;
+ lineEndNext = styler.LineEnd(lineCurrent);
+ vlls.Add(lineCurrent, preproc);
+ if (rawStringTerminator != "") {
+ rawSTNew.Set(lineCurrent-1, rawStringTerminator);
+ }
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (static_cast<int>((sc.currentPos+1)) >= lineEndNext) {
+ lineCurrent++;
+ lineEndNext = styler.LineEnd(lineCurrent);
+ vlls.Add(lineCurrent, preproc);
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ // Even in UTF-8, \r and \n are separate
+ sc.Forward();
+ }
+ continuationLine = true;
+ sc.Forward();
+ continue;
+ }
+ }
+
+ const bool atLineEndBeforeSwitch = sc.atLineEnd;
+
+ // Determine if the current state should terminate.
+ switch (MaskActive(sc.state)) {
+ case SCE_C_OPERATOR:
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ break;
+ case SCE_C_NUMBER:
+ // We accept almost anything because of hex. and number suffixes
+ if (sc.ch == '_') {
+ sc.ChangeState(SCE_C_USERLITERAL|activitySet);
+ } else if (!(setWord.Contains(sc.ch)
+ || (sc.ch == '\'')
+ || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E' ||
+ sc.chPrev == 'p' || sc.chPrev == 'P')))) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_C_USERLITERAL:
+ if (!(setWord.Contains(sc.ch)))
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ break;
+ case SCE_C_IDENTIFIER:
+ if (sc.atLineStart || sc.atLineEnd || !setWord.Contains(sc.ch) || (sc.ch == '.')) {
+ char s[1000];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+ if (keywords.InList(s)) {
+ lastWordWasUUID = strcmp(s, "uuid") == 0;
+ sc.ChangeState(SCE_C_WORD|activitySet);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_C_WORD2|activitySet);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_C_GLOBALCLASS|activitySet);
+ } else {
+ int subStyle = classifierIdentifiers.ValueFor(s);
+ if (subStyle >= 0) {
+ sc.ChangeState(subStyle|activitySet);
+ }
+ }
+ const bool literalString = sc.ch == '\"';
+ if (literalString || sc.ch == '\'') {
+ size_t lenS = strlen(s);
+ const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext);
+ if (raw)
+ s[lenS--] = '\0';
+ bool valid =
+ (lenS == 0) ||
+ ((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
+ ((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
+ if (valid) {
+ if (literalString) {
+ if (raw) {
+ // Set the style of the string prefix to SCE_C_STRINGRAW but then change to
+ // SCE_C_DEFAULT as that allows the raw string start code to run.
+ sc.ChangeState(SCE_C_STRINGRAW|activitySet);
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ sc.ChangeState(SCE_C_STRING|activitySet);
+ }
+ } else {
+ sc.ChangeState(SCE_C_CHARACTER|activitySet);
+ }
+ } else {
+ sc.SetState(SCE_C_DEFAULT | activitySet);
+ }
+ } else {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ }
+ break;
+ case SCE_C_PREPROCESSOR:
+ if (options.stylingWithinPreprocessor) {
+ if (IsASpace(sc.ch)) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ } else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) {
+ isStringInPreprocessor = false;
+ } else if (!isStringInPreprocessor) {
+ if ((isIncludePreprocessor && sc.Match('<')) || sc.Match('\"')) {
+ isStringInPreprocessor = true;
+ } else if (sc.Match('/', '*')) {
+ if (sc.Match("/**") || sc.Match("/*!")) {
+ sc.SetState(SCE_C_PREPROCESSORCOMMENTDOC|activitySet);
+ } else {
+ sc.SetState(SCE_C_PREPROCESSORCOMMENT|activitySet);
+ }
+ sc.Forward(); // Eat the *
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ }
+ break;
+ case SCE_C_PREPROCESSORCOMMENT:
+ case SCE_C_PREPROCESSORCOMMENTDOC:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_C_PREPROCESSOR|activitySet);
+ continue; // Without advancing in case of '\'.
+ }
+ break;
+ case SCE_C_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ styleBeforeTaskMarker = SCE_C_COMMENT;
+ highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive);
+ }
+ break;
+ case SCE_C_COMMENTDOC:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_C_COMMENTDOC;
+ sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet);
+ }
+ }
+ break;
+ case SCE_C_COMMENTLINE:
+ if (sc.atLineStart && !continuationLine) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ styleBeforeTaskMarker = SCE_C_COMMENTLINE;
+ highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive);
+ }
+ break;
+ case SCE_C_COMMENTLINEDOC:
+ if (sc.atLineStart && !continuationLine) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC;
+ sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet);
+ }
+ }
+ break;
+ case SCE_C_COMMENTDOCKEYWORD:
+ if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) {
+ sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR);
+ sc.Forward();
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ seenDocKeyBrace = false;
+ } else if (sc.ch == '[' || sc.ch == '{') {
+ seenDocKeyBrace = true;
+ } else if (!setDoxygen.Contains(sc.ch)
+ && !(seenDocKeyBrace && (sc.ch == ',' || sc.ch == '.'))) {
+ char s[100];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+ if (!(IsASpace(sc.ch) || (sc.ch == 0))) {
+ sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
+ } else if (!keywords3.InList(s + 1)) {
+ int subStyleCDKW = classifierDocKeyWords.ValueFor(s+1);
+ if (subStyleCDKW >= 0) {
+ sc.ChangeState(subStyleCDKW|activitySet);
+ } else {
+ sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
+ }
+ }
+ sc.SetState(styleBeforeDCKeyword|activitySet);
+ seenDocKeyBrace = false;
+ }
+ break;
+ case SCE_C_STRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_C_STRINGEOL|activitySet);
+ } else if (isIncludePreprocessor) {
+ if (sc.ch == '>') {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ isIncludePreprocessor = false;
+ }
+ } else if (sc.ch == '\\') {
+ if (options.escapeSequence) {
+ sc.SetState(SCE_C_ESCAPESEQUENCE|activitySet);
+ escapeSeq.resetEscapeState(sc.chNext);
+ }
+ sc.Forward(); // Skip all characters after the backslash
+ } else if (sc.ch == '\"') {
+ if (sc.chNext == '_') {
+ sc.ChangeState(SCE_C_USERLITERAL|activitySet);
+ } else {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ }
+ }
+ break;
+ case SCE_C_ESCAPESEQUENCE:
+ escapeSeq.digitsLeft--;
+ if (!escapeSeq.atEscapeEnd(sc.ch)) {
+ break;
+ }
+ if (sc.ch == '"') {
+ sc.SetState(SCE_C_STRING|activitySet);
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.ch == '\\') {
+ escapeSeq.resetEscapeState(sc.chNext);
+ sc.Forward();
+ } else {
+ sc.SetState(SCE_C_STRING|activitySet);
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_C_STRINGEOL|activitySet);
+ }
+ }
+ break;
+ case SCE_C_HASHQUOTEDSTRING:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_C_STRINGRAW:
+ if (sc.Match(rawStringTerminator.c_str())) {
+ for (size_t termPos=rawStringTerminator.size(); termPos; termPos--)
+ sc.Forward();
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ rawStringTerminator = "";
+ }
+ break;
+ case SCE_C_CHARACTER:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_C_STRINGEOL|activitySet);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ if (sc.chNext == '_') {
+ sc.ChangeState(SCE_C_USERLITERAL|activitySet);
+ } else {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ }
+ }
+ break;
+ case SCE_C_REGEX:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else if (! inRERange && sc.ch == '/') {
+ sc.Forward();
+ while ((sc.ch < 0x80) && islower(sc.ch))
+ sc.Forward(); // gobble regex flags
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.ch == '\\' && (static_cast<int>(sc.currentPos+1) < lineEndNext)) {
+ // Gobble up the escaped character
+ sc.Forward();
+ } else if (sc.ch == '[') {
+ inRERange = true;
+ } else if (sc.ch == ']') {
+ inRERange = false;
+ }
+ break;
+ case SCE_C_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_C_VERBATIM:
+ if (options.verbatimStringsAllowEscapes && (sc.ch == '\\')) {
+ sc.Forward(); // Skip all characters after the backslash
+ } else if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ }
+ }
+ break;
+ case SCE_C_TRIPLEVERBATIM:
+ if (sc.Match("\"\"\"")) {
+ while (sc.Match('"')) {
+ sc.Forward();
+ }
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_C_UUID:
+ if (sc.atLineEnd || sc.ch == ')') {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_C_TASKMARKER:
+ if (isoperator(sc.ch) || IsASpace(sc.ch)) {
+ sc.SetState(styleBeforeTaskMarker|activitySet);
+ styleBeforeTaskMarker = SCE_C_DEFAULT;
+ }
+ }
+
+ if (sc.atLineEnd && !atLineEndBeforeSwitch) {
+ // State exit processing consumed characters up to end of line.
+ lineCurrent++;
+ lineEndNext = styler.LineEnd(lineCurrent);
+ vlls.Add(lineCurrent, preproc);
+ }
+
+ // Determine if a new state should be entered.
+ if (MaskActive(sc.state) == SCE_C_DEFAULT) {
+ if (sc.Match('@', '\"')) {
+ sc.SetState(SCE_C_VERBATIM|activitySet);
+ sc.Forward();
+ } else if (options.triplequotedStrings && sc.Match("\"\"\"")) {
+ sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
+ sc.Forward(2);
+ } else if (options.hashquotedStrings && sc.Match('#', '\"')) {
+ sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet);
+ sc.Forward();
+ } else if (options.backQuotedStrings && sc.Match('`')) {
+ sc.SetState(SCE_C_STRINGRAW|activitySet);
+ rawStringTerminator = "`";
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ if (lastWordWasUUID) {
+ sc.SetState(SCE_C_UUID|activitySet);
+ lastWordWasUUID = false;
+ } else {
+ sc.SetState(SCE_C_NUMBER|activitySet);
+ }
+ } else if (!sc.atLineEnd && (setWordStart.Contains(sc.ch) || (sc.ch == '@'))) {
+ if (lastWordWasUUID) {
+ sc.SetState(SCE_C_UUID|activitySet);
+ lastWordWasUUID = false;
+ } else {
+ sc.SetState(SCE_C_IDENTIFIER|activitySet);
+ }
+ } else if (sc.Match('/', '*')) {
+ if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_C_COMMENTDOC|activitySet);
+ } else {
+ sc.SetState(SCE_C_COMMENT|activitySet);
+ }
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!"))
+ // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_C_COMMENTLINEDOC|activitySet);
+ else
+ sc.SetState(SCE_C_COMMENTLINE|activitySet);
+ } else if (sc.ch == '/'
+ && (setOKBeforeRE.Contains(chPrevNonWhite)
+ || followsReturnKeyword(sc, styler))
+ && (!setCouldBePostOp.Contains(chPrevNonWhite)
+ || !FollowsPostfixOperator(sc, styler))) {
+ sc.SetState(SCE_C_REGEX|activitySet); // JavaScript's RegEx
+ inRERange = false;
+ } else if (sc.ch == '\"') {
+ if (sc.chPrev == 'R') {
+ styler.Flush();
+ if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) {
+ sc.SetState(SCE_C_STRINGRAW|activitySet);
+ rawStringTerminator = ")";
+ for (int termPos = sc.currentPos + 1;; termPos++) {
+ char chTerminator = styler.SafeGetCharAt(termPos, '(');
+ if (chTerminator == '(')
+ break;
+ rawStringTerminator += chTerminator;
+ }
+ rawStringTerminator += '\"';
+ } else {
+ sc.SetState(SCE_C_STRING|activitySet);
+ }
+ } else {
+ sc.SetState(SCE_C_STRING|activitySet);
+ }
+ isIncludePreprocessor = false; // ensure that '>' won't end the string
+ } else if (isIncludePreprocessor && sc.ch == '<') {
+ sc.SetState(SCE_C_STRING|activitySet);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_C_CHARACTER|activitySet);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ // Preprocessor commands are alone on their line
+ sc.SetState(SCE_C_PREPROCESSOR|activitySet);
+ // Skip whitespace between # and preprocessor word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else if (sc.Match("include")) {
+ isIncludePreprocessor = true;
+ } else {
+ if (options.trackPreprocessor) {
+ if (sc.Match("ifdef") || sc.Match("ifndef")) {
+ bool isIfDef = sc.Match("ifdef");
+ int i = isIfDef ? 5 : 6;
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false);
+ bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end();
+ preproc.StartSection(isIfDef == foundDef);
+ } else if (sc.Match("if")) {
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
+ bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
+ preproc.StartSection(ifGood);
+ } else if (sc.Match("else")) {
+ if (!preproc.CurrentIfTaken()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_C_PREPROCESSOR|activitySet);
+ } else if (!preproc.IsInactive()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_C_PREPROCESSOR|activitySet);
+ }
+ } else if (sc.Match("elif")) {
+ // Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif
+ if (!preproc.CurrentIfTaken()) {
+ // Similar to #if
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true);
+ bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions);
+ if (ifGood) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_C_PREPROCESSOR|activitySet);
+ }
+ } else if (!preproc.IsInactive()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_C_PREPROCESSOR|activitySet);
+ }
+ } else if (sc.Match("endif")) {
+ preproc.EndSection();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ sc.ChangeState(SCE_C_PREPROCESSOR|activitySet);
+ } else if (sc.Match("define")) {
+ if (options.updatePreprocessor && !preproc.IsInactive()) {
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true);
+ size_t startName = 0;
+ while ((startName < restOfLine.length()) && IsSpaceOrTab(restOfLine[startName]))
+ startName++;
+ size_t endName = startName;
+ while ((endName < restOfLine.length()) && setWord.Contains(static_cast<unsigned char>(restOfLine[endName])))
+ endName++;
+ std::string key = restOfLine.substr(startName, endName-startName);
+ if ((endName < restOfLine.length()) && (restOfLine.at(endName) == '(')) {
+ // Macro
+ size_t endArgs = endName;
+ while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')'))
+ endArgs++;
+ std::string args = restOfLine.substr(endName + 1, endArgs - endName - 1);
+ size_t startValue = endArgs+1;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value;
+ if (startValue < restOfLine.length())
+ value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = SymbolValue(value, args);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value, false, args));
+ definitionsChanged = true;
+ } else {
+ // Value
+ size_t startValue = endName;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = value;
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value));
+ definitionsChanged = true;
+ }
+ }
+ } else if (sc.Match("undef")) {
+ if (options.updatePreprocessor && !preproc.IsInactive()) {
+ const std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, false);
+ std::vector<std::string> tokens = Tokenize(restOfLine);
+ if (tokens.size() >= 1) {
+ const std::string key = tokens[0];
+ preprocessorDefinitions.erase(key);
+ ppDefineHistory.push_back(PPDefinition(lineCurrent, key, "", true));
+ definitionsChanged = true;
+ }
+ }
+ }
+ }
+ }
+ } else if (isoperator(sc.ch)) {
+ sc.SetState(SCE_C_OPERATOR|activitySet);
+ }
+ }
+
+ if (!IsASpace(sc.ch) && !IsSpaceEquiv(MaskActive(sc.state))) {
+ chPrevNonWhite = sc.ch;
+ visibleChars++;
+ }
+ continuationLine = false;
+ sc.Forward();
+ }
+ const bool rawStringsChanged = rawStringTerminators.Merge(rawSTNew, lineCurrent);
+ if (definitionsChanged || rawStringsChanged)
+ styler.ChangeLexerState(startPos, startPos + length);
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+
+void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ bool inLineComment = false;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ unsigned int lineStartNext = styler.LineStart(lineCurrent+1);
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = MaskActive(styler.StyleAt(startPos));
+ int style = MaskActive(initStyle);
+ const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = MaskActive(styler.StyleAt(i + 1));
+ bool atEOL = i == (lineStartNext-1);
+ if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC))
+ inLineComment = true;
+ if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldComment && options.foldCommentExplicit && ((style == SCE_C_COMMENTLINE) || options.foldExplicitAnywhere)) {
+ if (userDefinedFoldMarkers) {
+ if (styler.Match(i, options.foldExplicitStart.c_str())) {
+ levelNext++;
+ } else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
+ levelNext--;
+ }
+ } else {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ }
+ if (options.foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
+ if (ch == '#') {
+ unsigned int j = i + 1;
+ while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "region") || styler.Match(j, "if")) {
+ levelNext++;
+ } else if (styler.Match(j, "end")) {
+ levelNext--;
+ }
+ }
+ }
+ if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) {
+ if (ch == '{' || ch == '[') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}' || ch == ']') {
+ levelNext--;
+ }
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ if (options.foldSyntaxBased && options.foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ lineStartNext = styler.LineStart(lineCurrent+1);
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
+ visibleChars = 0;
+ inLineComment = false;
+ }
+ }
+}
+
+void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTable &preprocessorDefinitions) {
+
+ // Remove whitespace tokens
+ tokens.erase(std::remove_if(tokens.begin(), tokens.end(), OnlySpaceOrTab), tokens.end());
+
+ // Evaluate defined statements to either 0 or 1
+ for (size_t i=0; (i+1)<tokens.size();) {
+ if (tokens[i] == "defined") {
+ const char *val = "0";
+ if (tokens[i+1] == "(") {
+ if (((i + 2)<tokens.size()) && (tokens[i + 2] == ")")) {
+ // defined()
+ tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 3);
+ } else if (((i+3)<tokens.size()) && (tokens[i+3] == ")")) {
+ // defined(<identifier>)
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+2]);
+ if (it != preprocessorDefinitions.end()) {
+ val = "1";
+ }
+ tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4);
+ } else {
+ // Spurious '(' so erase as more likely to result in false
+ tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 2);
+ }
+ } else {
+ // defined <identifier>
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+1]);
+ if (it != preprocessorDefinitions.end()) {
+ val = "1";
+ }
+ }
+ tokens[i] = val;
+ } else {
+ i++;
+ }
+ }
+
+ // Evaluate identifiers
+ const size_t maxIterations = 100;
+ size_t iterations = 0; // Limit number of iterations in case there is a recursive macro.
+ for (size_t i = 0; (i<tokens.size()) && (iterations < maxIterations);) {
+ iterations++;
+ if (setWordStart.Contains(static_cast<unsigned char>(tokens[i][0]))) {
+ SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i]);
+ if (it != preprocessorDefinitions.end()) {
+ // Tokenize value
+ std::vector<std::string> macroTokens = Tokenize(it->second.value);
+ if (it->second.IsMacro()) {
+ if ((i + 1 < tokens.size()) && (tokens.at(i + 1) == "(")) {
+ // Create map of argument name to value
+ std::vector<std::string> argumentNames = StringSplit(it->second.arguments, ',');
+ std::map<std::string, std::string> arguments;
+ size_t arg = 0;
+ size_t tok = i+2;
+ while ((tok < tokens.size()) && (arg < argumentNames.size()) && (tokens.at(tok) != ")")) {
+ if (tokens.at(tok) != ",") {
+ arguments[argumentNames.at(arg)] = tokens.at(tok);
+ arg++;
+ }
+ tok++;
+ }
+
+ // Remove invocation
+ tokens.erase(tokens.begin() + i, tokens.begin() + tok + 1);
+
+ // Substitute values into macro
+ macroTokens.erase(std::remove_if(macroTokens.begin(), macroTokens.end(), OnlySpaceOrTab), macroTokens.end());
+
+ for (size_t iMacro = 0; iMacro < macroTokens.size();) {
+ if (setWordStart.Contains(static_cast<unsigned char>(macroTokens[iMacro][0]))) {
+ std::map<std::string, std::string>::const_iterator itFind = arguments.find(macroTokens[iMacro]);
+ if (itFind != arguments.end()) {
+ // TODO: Possible that value will be expression so should insert tokenized form
+ macroTokens[iMacro] = itFind->second;
+ }
+ }
+ iMacro++;
+ }
+
+ // Insert results back into tokens
+ tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
+
+ } else {
+ i++;
+ }
+ } else {
+ // Remove invocation
+ tokens.erase(tokens.begin() + i);
+ // Insert results back into tokens
+ tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
+ }
+ } else {
+ // Identifier not found
+ tokens.erase(tokens.begin() + i);
+ }
+ } else {
+ i++;
+ }
+ }
+
+ // Find bracketed subexpressions and recurse on them
+ BracketPair bracketPair = FindBracketPair(tokens);
+ while (bracketPair.itBracket != tokens.end()) {
+ std::vector<std::string> inBracket(bracketPair.itBracket + 1, bracketPair.itEndBracket);
+ EvaluateTokens(inBracket, preprocessorDefinitions);
+
+ // The insertion is done before the removal because there were failures with the opposite approach
+ tokens.insert(bracketPair.itBracket, inBracket.begin(), inBracket.end());
+
+ bracketPair = FindBracketPair(tokens);
+ tokens.erase(bracketPair.itBracket, bracketPair.itEndBracket + 1);
+
+ bracketPair = FindBracketPair(tokens);
+ }
+
+ // Evaluate logical negations
+ for (size_t j=0; (j+1)<tokens.size();) {
+ if (setNegationOp.Contains(tokens[j][0])) {
+ int isTrue = atoi(tokens[j+1].c_str());
+ if (tokens[j] == "!")
+ isTrue = !isTrue;
+ std::vector<std::string>::iterator itInsert =
+ tokens.erase(tokens.begin() + j, tokens.begin() + j + 2);
+ tokens.insert(itInsert, isTrue ? "1" : "0");
+ } else {
+ j++;
+ }
+ }
+
+ // Evaluate expressions in precedence order
+ enum precedence { precArithmetic, precRelative, precLogical };
+ for (int prec=precArithmetic; prec <= precLogical; prec++) {
+ // Looking at 3 tokens at a time so end at 2 before end
+ for (size_t k=0; (k+2)<tokens.size();) {
+ char chOp = tokens[k+1][0];
+ if (
+ ((prec==precArithmetic) && setArithmethicOp.Contains(chOp)) ||
+ ((prec==precRelative) && setRelOp.Contains(chOp)) ||
+ ((prec==precLogical) && setLogicalOp.Contains(chOp))
+ ) {
+ int valA = atoi(tokens[k].c_str());
+ int valB = atoi(tokens[k+2].c_str());
+ int result = 0;
+ if (tokens[k+1] == "+")
+ result = valA + valB;
+ else if (tokens[k+1] == "-")
+ result = valA - valB;
+ else if (tokens[k+1] == "*")
+ result = valA * valB;
+ else if (tokens[k+1] == "/")
+ result = valA / (valB ? valB : 1);
+ else if (tokens[k+1] == "%")
+ result = valA % (valB ? valB : 1);
+ else if (tokens[k+1] == "<")
+ result = valA < valB;
+ else if (tokens[k+1] == "<=")
+ result = valA <= valB;
+ else if (tokens[k+1] == ">")
+ result = valA > valB;
+ else if (tokens[k+1] == ">=")
+ result = valA >= valB;
+ else if (tokens[k+1] == "==")
+ result = valA == valB;
+ else if (tokens[k+1] == "!=")
+ result = valA != valB;
+ else if (tokens[k+1] == "||")
+ result = valA || valB;
+ else if (tokens[k+1] == "&&")
+ result = valA && valB;
+ char sResult[30];
+ sprintf(sResult, "%d", result);
+ std::vector<std::string>::iterator itInsert =
+ tokens.erase(tokens.begin() + k, tokens.begin() + k + 3);
+ tokens.insert(itInsert, sResult);
+ } else {
+ k++;
+ }
+ }
+ }
+}
+
+std::vector<std::string> LexerCPP::Tokenize(const std::string &expr) const {
+ // Break into tokens
+ std::vector<std::string> tokens;
+ const char *cp = expr.c_str();
+ while (*cp) {
+ std::string word;
+ if (setWord.Contains(static_cast<unsigned char>(*cp))) {
+ // Identifiers and numbers
+ while (setWord.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else if (IsSpaceOrTab(*cp)) {
+ while (IsSpaceOrTab(*cp)) {
+ word += *cp;
+ cp++;
+ }
+ } else if (setRelOp.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ if (setRelOp.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else if (setLogicalOp.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ if (setLogicalOp.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else {
+ // Should handle strings, characters, and comments here
+ word += *cp;
+ cp++;
+ }
+ tokens.push_back(word);
+ }
+ return tokens;
+}
+
+bool LexerCPP::EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions) {
+ std::vector<std::string> tokens = Tokenize(expr);
+
+ EvaluateTokens(tokens, preprocessorDefinitions);
+
+ // "0" or "" -> false else true
+ bool isFalse = tokens.empty() ||
+ ((tokens.size() == 1) && ((tokens[0] == "") || tokens[0] == "0"));
+ return !isFalse;
+}
+
+LexerModule lmCPP(SCLEX_CPP, LexerCPP::LexerFactoryCPP, "cpp", cppWordLists);
+LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, LexerCPP::LexerFactoryCPPInsensitive, "cppnocase", cppWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCSS.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCSS.cxx
new file mode 100644
index 00000000000..036bb2e0abb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCSS.cxx
@@ -0,0 +1,567 @@
+// Scintilla source code edit control
+/** @file LexCSS.cxx
+ ** Lexer for Cascading Style Sheets
+ ** Written by Jakub Vrána
+ ** Improved by Philippe Lhoste (CSS2)
+ ** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ )
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// TODO: handle SCSS nested properties like font: { weight: bold; size: 1em; }
+// TODO: handle SCSS interpolation: #{}
+// TODO: add features for Less if somebody feels like contributing; http://lesscss.org/
+// TODO: refactor this monster so that the next poor slob can read it!
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static inline bool IsAWordChar(const unsigned int ch) {
+ /* FIXME:
+ * The CSS spec allows "ISO 10646 characters U+00A1 and higher" to be treated as word chars.
+ * Unfortunately, we are only getting string bytes here, and not full unicode characters. We cannot guarantee
+ * that our byte is between U+0080 - U+00A0 (to return false), so we have to allow all characters U+0080 and higher
+ */
+ return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_';
+}
+
+inline bool IsCssOperator(const int ch) {
+ if (!((ch < 0x80) && isalnum(ch)) &&
+ (ch == '{' || ch == '}' || ch == ':' || ch == ',' || ch == ';' ||
+ ch == '.' || ch == '#' || ch == '!' || ch == '@' ||
+ /* CSS2 */
+ ch == '*' || ch == '>' || ch == '+' || ch == '=' || ch == '~' || ch == '|' ||
+ ch == '[' || ch == ']' || ch == '(' || ch == ')')) {
+ return true;
+ }
+ return false;
+}
+
+// look behind (from start of document to our start position) to determine current nesting level
+inline int NestingLevelLookBehind(unsigned int startPos, Accessor &styler) {
+ int ch;
+ int nestingLevel = 0;
+
+ for (unsigned int i = 0; i < startPos; i++) {
+ ch = styler.SafeGetCharAt(i);
+ if (ch == '{')
+ nestingLevel++;
+ else if (ch == '}')
+ nestingLevel--;
+ }
+
+ return nestingLevel;
+}
+
+static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
+ WordList &css1Props = *keywordlists[0];
+ WordList &pseudoClasses = *keywordlists[1];
+ WordList &css2Props = *keywordlists[2];
+ WordList &css3Props = *keywordlists[3];
+ WordList &pseudoElements = *keywordlists[4];
+ WordList &exProps = *keywordlists[5];
+ WordList &exPseudoClasses = *keywordlists[6];
+ WordList &exPseudoElements = *keywordlists[7];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int lastState = -1; // before operator
+ int lastStateC = -1; // before comment
+ int lastStateS = -1; // before single-quoted/double-quoted string
+ int lastStateVar = -1; // before variable (SCSS)
+ int lastStateVal = -1; // before value (SCSS)
+ int op = ' '; // last operator
+ int opPrev = ' '; // last operator
+ bool insideParentheses = false; // true if currently in a CSS url() or similar construct
+
+ // property lexer.css.scss.language
+ // Set to 1 for Sassy CSS (.scss)
+ bool isScssDocument = styler.GetPropertyInt("lexer.css.scss.language") != 0;
+
+ // property lexer.css.less.language
+ // Set to 1 for Less CSS (.less)
+ bool isLessDocument = styler.GetPropertyInt("lexer.css.less.language") != 0;
+
+ // property lexer.css.hss.language
+ // Set to 1 for HSS (.hss)
+ bool isHssDocument = styler.GetPropertyInt("lexer.css.hss.language") != 0;
+
+ // SCSS/LESS/HSS have the concept of variable
+ bool hasVariables = isScssDocument || isLessDocument || isHssDocument;
+ char varPrefix = 0;
+ if (hasVariables)
+ varPrefix = isLessDocument ? '@' : '$';
+
+ // SCSS/LESS/HSS support single-line comments
+ typedef enum _CommentModes { eCommentBlock = 0, eCommentLine = 1} CommentMode;
+ CommentMode comment_mode = eCommentBlock;
+ bool hasSingleLineComments = isScssDocument || isLessDocument || isHssDocument;
+
+ // must keep track of nesting level in document types that support it (SCSS/LESS/HSS)
+ bool hasNesting = false;
+ int nestingLevel = 0;
+ if (isScssDocument || isLessDocument || isHssDocument) {
+ hasNesting = true;
+ nestingLevel = NestingLevelLookBehind(startPos, styler);
+ }
+
+ // "the loop"
+ for (; sc.More(); sc.Forward()) {
+ if (sc.state == SCE_CSS_COMMENT && ((comment_mode == eCommentBlock && sc.Match('*', '/')) || (comment_mode == eCommentLine && sc.atLineEnd))) {
+ if (lastStateC == -1) {
+ // backtrack to get last state:
+ // comments are like whitespace, so we must return to the previous state
+ unsigned int i = startPos;
+ for (; i > 0; i--) {
+ if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) {
+ if (lastStateC == SCE_CSS_OPERATOR) {
+ op = styler.SafeGetCharAt(i-1);
+ opPrev = styler.SafeGetCharAt(i-2);
+ while (--i) {
+ lastState = styler.StyleAt(i-1);
+ if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT)
+ break;
+ }
+ if (i == 0)
+ lastState = SCE_CSS_DEFAULT;
+ }
+ break;
+ }
+ }
+ if (i == 0)
+ lastStateC = SCE_CSS_DEFAULT;
+ }
+ if (comment_mode == eCommentBlock) {
+ sc.Forward();
+ sc.ForwardSetState(lastStateC);
+ } else /* eCommentLine */ {
+ sc.SetState(lastStateC);
+ }
+ }
+
+ if (sc.state == SCE_CSS_COMMENT)
+ continue;
+
+ if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) {
+ if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\''))
+ continue;
+ unsigned int i = sc.currentPos;
+ while (i && styler[i-1] == '\\')
+ i--;
+ if ((sc.currentPos - i) % 2 == 1)
+ continue;
+ sc.ForwardSetState(lastStateS);
+ }
+
+ if (sc.state == SCE_CSS_OPERATOR) {
+ if (op == ' ') {
+ unsigned int i = startPos;
+ op = styler.SafeGetCharAt(i-1);
+ opPrev = styler.SafeGetCharAt(i-2);
+ while (--i) {
+ lastState = styler.StyleAt(i-1);
+ if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT)
+ break;
+ }
+ }
+ switch (op) {
+ case '@':
+ if (lastState == SCE_CSS_DEFAULT || hasNesting)
+ sc.SetState(SCE_CSS_DIRECTIVE);
+ break;
+ case '>':
+ case '+':
+ if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
+ lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_DEFAULT);
+ break;
+ case '[':
+ if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
+ lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_ATTRIBUTE);
+ break;
+ case ']':
+ if (lastState == SCE_CSS_ATTRIBUTE)
+ sc.SetState(SCE_CSS_TAG);
+ break;
+ case '{':
+ nestingLevel++;
+ switch (lastState) {
+ case SCE_CSS_MEDIA:
+ sc.SetState(SCE_CSS_DEFAULT);
+ break;
+ case SCE_CSS_TAG:
+ case SCE_CSS_DIRECTIVE:
+ sc.SetState(SCE_CSS_IDENTIFIER);
+ break;
+ }
+ break;
+ case '}':
+ if (--nestingLevel < 0)
+ nestingLevel = 0;
+ switch (lastState) {
+ case SCE_CSS_DEFAULT:
+ case SCE_CSS_VALUE:
+ case SCE_CSS_IMPORTANT:
+ case SCE_CSS_IDENTIFIER:
+ case SCE_CSS_IDENTIFIER2:
+ case SCE_CSS_IDENTIFIER3:
+ if (hasNesting)
+ sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT);
+ else
+ sc.SetState(SCE_CSS_DEFAULT);
+ break;
+ }
+ break;
+ case '(':
+ if (lastState == SCE_CSS_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_TAG);
+ else if (lastState == SCE_CSS_EXTENDED_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_EXTENDED_PSEUDOCLASS);
+ break;
+ case ')':
+ if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
+ lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS ||
+ lastState == SCE_CSS_PSEUDOELEMENT || lastState == SCE_CSS_EXTENDED_PSEUDOELEMENT)
+ sc.SetState(SCE_CSS_TAG);
+ break;
+ case ':':
+ switch (lastState) {
+ case SCE_CSS_TAG:
+ case SCE_CSS_DEFAULT:
+ case SCE_CSS_CLASS:
+ case SCE_CSS_ID:
+ case SCE_CSS_PSEUDOCLASS:
+ case SCE_CSS_EXTENDED_PSEUDOCLASS:
+ case SCE_CSS_UNKNOWN_PSEUDOCLASS:
+ case SCE_CSS_PSEUDOELEMENT:
+ case SCE_CSS_EXTENDED_PSEUDOELEMENT:
+ sc.SetState(SCE_CSS_PSEUDOCLASS);
+ break;
+ case SCE_CSS_IDENTIFIER:
+ case SCE_CSS_IDENTIFIER2:
+ case SCE_CSS_IDENTIFIER3:
+ case SCE_CSS_EXTENDED_IDENTIFIER:
+ case SCE_CSS_UNKNOWN_IDENTIFIER:
+ case SCE_CSS_VARIABLE:
+ sc.SetState(SCE_CSS_VALUE);
+ lastStateVal = lastState;
+ break;
+ }
+ break;
+ case '.':
+ if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
+ lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_CLASS);
+ break;
+ case '#':
+ if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID ||
+ lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS)
+ sc.SetState(SCE_CSS_ID);
+ break;
+ case ',':
+ case '|':
+ case '~':
+ if (lastState == SCE_CSS_TAG)
+ sc.SetState(SCE_CSS_DEFAULT);
+ break;
+ case ';':
+ switch (lastState) {
+ case SCE_CSS_DIRECTIVE:
+ if (hasNesting) {
+ sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT);
+ } else {
+ sc.SetState(SCE_CSS_DEFAULT);
+ }
+ break;
+ case SCE_CSS_VALUE:
+ case SCE_CSS_IMPORTANT:
+ // data URLs can have semicolons; simplistically check for wrapping parentheses and move along
+ if (insideParentheses) {
+ sc.SetState(lastState);
+ } else {
+ if (lastStateVal == SCE_CSS_VARIABLE) {
+ sc.SetState(SCE_CSS_DEFAULT);
+ } else {
+ sc.SetState(SCE_CSS_IDENTIFIER);
+ }
+ }
+ break;
+ case SCE_CSS_VARIABLE:
+ if (lastStateVar == SCE_CSS_VALUE) {
+ // data URLs can have semicolons; simplistically check for wrapping parentheses and move along
+ if (insideParentheses) {
+ sc.SetState(SCE_CSS_VALUE);
+ } else {
+ sc.SetState(SCE_CSS_IDENTIFIER);
+ }
+ } else {
+ sc.SetState(SCE_CSS_DEFAULT);
+ }
+ break;
+ }
+ break;
+ case '!':
+ if (lastState == SCE_CSS_VALUE)
+ sc.SetState(SCE_CSS_IMPORTANT);
+ break;
+ }
+ }
+
+ if (sc.ch == '*' && sc.state == SCE_CSS_DEFAULT) {
+ sc.SetState(SCE_CSS_TAG);
+ continue;
+ }
+
+ // check for inside parentheses (whether part of an "operator" or not)
+ if (sc.ch == '(')
+ insideParentheses = true;
+ else if (sc.ch == ')')
+ insideParentheses = false;
+
+ // SCSS special modes
+ if (hasVariables) {
+ // variable name
+ if (sc.ch == varPrefix) {
+ switch (sc.state) {
+ case SCE_CSS_DEFAULT:
+ if (isLessDocument) // give priority to pseudo elements
+ break;
+ case SCE_CSS_VALUE:
+ lastStateVar = sc.state;
+ sc.SetState(SCE_CSS_VARIABLE);
+ continue;
+ }
+ }
+ if (sc.state == SCE_CSS_VARIABLE) {
+ if (IsAWordChar(sc.ch)) {
+ // still looking at the variable name
+ continue;
+ }
+ if (lastStateVar == SCE_CSS_VALUE) {
+ // not looking at the variable name any more, and it was part of a value
+ sc.SetState(SCE_CSS_VALUE);
+ }
+ }
+
+ // nested rule parent selector
+ if (sc.ch == '&') {
+ switch (sc.state) {
+ case SCE_CSS_DEFAULT:
+ case SCE_CSS_IDENTIFIER:
+ sc.SetState(SCE_CSS_TAG);
+ continue;
+ }
+ }
+ }
+
+ // nesting rules that apply to SCSS and Less
+ if (hasNesting) {
+ // check for nested rule selector
+ if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) {
+ // look ahead to see whether { comes before next ; and }
+ unsigned int endPos = startPos + length;
+ int ch;
+
+ for (unsigned int i = sc.currentPos; i < endPos; i++) {
+ ch = styler.SafeGetCharAt(i);
+ if (ch == ';' || ch == '}')
+ break;
+ if (ch == '{') {
+ sc.SetState(SCE_CSS_DEFAULT);
+ continue;
+ }
+ }
+ }
+
+ }
+
+ if (IsAWordChar(sc.ch)) {
+ if (sc.state == SCE_CSS_DEFAULT)
+ sc.SetState(SCE_CSS_TAG);
+ continue;
+ }
+
+ if (IsAWordChar(sc.chPrev) && (
+ sc.state == SCE_CSS_IDENTIFIER || sc.state == SCE_CSS_IDENTIFIER2 ||
+ sc.state == SCE_CSS_IDENTIFIER3 || sc.state == SCE_CSS_EXTENDED_IDENTIFIER ||
+ sc.state == SCE_CSS_UNKNOWN_IDENTIFIER ||
+ sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT ||
+ sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT ||
+ sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS ||
+ sc.state == SCE_CSS_IMPORTANT ||
+ sc.state == SCE_CSS_DIRECTIVE
+ )) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ char *s2 = s;
+ while (*s2 && !IsAWordChar(*s2))
+ s2++;
+ switch (sc.state) {
+ case SCE_CSS_IDENTIFIER:
+ case SCE_CSS_IDENTIFIER2:
+ case SCE_CSS_IDENTIFIER3:
+ case SCE_CSS_EXTENDED_IDENTIFIER:
+ case SCE_CSS_UNKNOWN_IDENTIFIER:
+ if (css1Props.InList(s2))
+ sc.ChangeState(SCE_CSS_IDENTIFIER);
+ else if (css2Props.InList(s2))
+ sc.ChangeState(SCE_CSS_IDENTIFIER2);
+ else if (css3Props.InList(s2))
+ sc.ChangeState(SCE_CSS_IDENTIFIER3);
+ else if (exProps.InList(s2))
+ sc.ChangeState(SCE_CSS_EXTENDED_IDENTIFIER);
+ else
+ sc.ChangeState(SCE_CSS_UNKNOWN_IDENTIFIER);
+ break;
+ case SCE_CSS_PSEUDOCLASS:
+ case SCE_CSS_PSEUDOELEMENT:
+ case SCE_CSS_EXTENDED_PSEUDOCLASS:
+ case SCE_CSS_EXTENDED_PSEUDOELEMENT:
+ case SCE_CSS_UNKNOWN_PSEUDOCLASS:
+ if (op == ':' && opPrev != ':' && pseudoClasses.InList(s2))
+ sc.ChangeState(SCE_CSS_PSEUDOCLASS);
+ else if (opPrev == ':' && pseudoElements.InList(s2))
+ sc.ChangeState(SCE_CSS_PSEUDOELEMENT);
+ else if ((op == ':' || (op == '(' && lastState == SCE_CSS_EXTENDED_PSEUDOCLASS)) && opPrev != ':' && exPseudoClasses.InList(s2))
+ sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOCLASS);
+ else if (opPrev == ':' && exPseudoElements.InList(s2))
+ sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOELEMENT);
+ else
+ sc.ChangeState(SCE_CSS_UNKNOWN_PSEUDOCLASS);
+ break;
+ case SCE_CSS_IMPORTANT:
+ if (strcmp(s2, "important") != 0)
+ sc.ChangeState(SCE_CSS_VALUE);
+ break;
+ case SCE_CSS_DIRECTIVE:
+ if (op == '@' && strcmp(s2, "media") == 0)
+ sc.ChangeState(SCE_CSS_MEDIA);
+ break;
+ }
+ }
+
+ if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && (
+ sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_ID ||
+ (sc.ch != '(' && sc.ch != ')' && ( /* This line of the condition makes it possible to extend pseudo-classes with parentheses */
+ sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT ||
+ sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT ||
+ sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS
+ ))
+ ))
+ sc.SetState(SCE_CSS_TAG);
+
+ if (sc.Match('/', '*')) {
+ lastStateC = sc.state;
+ comment_mode = eCommentBlock;
+ sc.SetState(SCE_CSS_COMMENT);
+ sc.Forward();
+ } else if (hasSingleLineComments && sc.Match('/', '/') && !insideParentheses) {
+ // note that we've had to treat ([...]// as the start of a URL not a comment, e.g. url(http://example.com), url(//example.com)
+ lastStateC = sc.state;
+ comment_mode = eCommentLine;
+ sc.SetState(SCE_CSS_COMMENT);
+ sc.Forward();
+ } else if ((sc.state == SCE_CSS_VALUE || sc.state == SCE_CSS_ATTRIBUTE)
+ && (sc.ch == '\"' || sc.ch == '\'')) {
+ lastStateS = sc.state;
+ sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING));
+ } else if (IsCssOperator(sc.ch)
+ && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']')
+ && (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!')
+ && ((sc.state != SCE_CSS_DIRECTIVE && sc.state != SCE_CSS_MEDIA) || sc.ch == ';' || sc.ch == '{')
+ ) {
+ if (sc.state != SCE_CSS_OPERATOR)
+ lastState = sc.state;
+ sc.SetState(SCE_CSS_OPERATOR);
+ op = sc.ch;
+ opPrev = sc.chPrev;
+ }
+ }
+
+ sc.Complete();
+}
+
+static void FoldCSSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT);
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment) {
+ if (!inComment && (style == SCE_CSS_COMMENT))
+ levelCurrent++;
+ else if (inComment && (style != SCE_CSS_COMMENT))
+ levelCurrent--;
+ inComment = (style == SCE_CSS_COMMENT);
+ }
+ if (style == SCE_CSS_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const cssWordListDesc[] = {
+ "CSS1 Properties",
+ "Pseudo-classes",
+ "CSS2 Properties",
+ "CSS3 Properties",
+ "Pseudo-elements",
+ "Browser-Specific CSS Properties",
+ "Browser-Specific Pseudo-classes",
+ "Browser-Specific Pseudo-elements",
+ 0
+};
+
+LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc, cssWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCaml.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCaml.cxx
new file mode 100644
index 00000000000..f576e3e2349
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCaml.cxx
@@ -0,0 +1,456 @@
+// Scintilla source code edit control
+/** @file LexCaml.cxx
+ ** Lexer for Objective Caml.
+ **/
+// Copyright 2005-2009 by Robert Roessler <robertr@rftp.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+/* Release History
+ 20050204 Initial release.
+ 20050205 Quick compiler standards/"cleanliness" adjustment.
+ 20050206 Added cast for IsLeadByte().
+ 20050209 Changes to "external" build support.
+ 20050306 Fix for 1st-char-in-doc "corner" case.
+ 20050502 Fix for [harmless] one-past-the-end coloring.
+ 20050515 Refined numeric token recognition logic.
+ 20051125 Added 2nd "optional" keywords class.
+ 20051129 Support "magic" (read-only) comments for RCaml.
+ 20051204 Swtich to using StyleContext infrastructure.
+ 20090629 Add full Standard ML '97 support.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+// Since the Microsoft __iscsym[f] funcs are not ANSI...
+inline int iscaml(int c) {return isalnum(c) || c == '_';}
+inline int iscamlf(int c) {return isalpha(c) || c == '_';}
+
+static const int baseT[24] = {
+ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */
+ 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */
+};
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef BUILD_AS_EXTERNAL_LEXER
+/*
+ (actually seems to work!)
+*/
+#include <string>
+#include "WindowAccessor.h"
+#include "ExternalLexer.h"
+
+#undef EXT_LEXER_DECL
+#define EXT_LEXER_DECL __declspec( dllexport ) __stdcall
+
+#if PLAT_WIN
+#include <windows.h>
+#endif
+
+static void ColouriseCamlDoc(
+ unsigned int startPos, int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+static void FoldCamlDoc(
+ unsigned int startPos, int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+static void InternalLexOrFold(int lexOrFold, unsigned int startPos, int length,
+ int initStyle, char *words[], WindowID window, char *props);
+
+static const char* LexerName = "caml";
+
+#ifdef TRACE
+void Platform::DebugPrintf(const char *format, ...) {
+ char buffer[2000];
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsprintf(buffer,format,pArguments);
+ va_end(pArguments);
+ Platform::DebugDisplay(buffer);
+}
+#else
+void Platform::DebugPrintf(const char *, ...) {
+}
+#endif
+
+bool Platform::IsDBCSLeadByte(int codePage, char ch) {
+ return ::IsDBCSLeadByteEx(codePage, ch) != 0;
+}
+
+long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) {
+ return ::SendMessage(reinterpret_cast<HWND>(w), msg, wParam, lParam);
+}
+
+long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) {
+ return ::SendMessage(reinterpret_cast<HWND>(w), msg, wParam,
+ reinterpret_cast<LPARAM>(lParam));
+}
+
+void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length,
+ int initStyle, char *words[], WindowID window, char *props)
+{
+ // below useless evaluation(s) to supress "not used" warnings
+ lexer;
+ // build expected data structures and do the Fold
+ InternalLexOrFold(1, startPos, length, initStyle, words, window, props);
+
+}
+
+int EXT_LEXER_DECL GetLexerCount()
+{
+ return 1; // just us [Objective] Caml lexers here!
+}
+
+void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength)
+{
+ // below useless evaluation(s) to supress "not used" warnings
+ Index;
+ // return as much of our lexer name as will fit (what's up with Index?)
+ if (buflength > 0) {
+ buflength--;
+ int n = strlen(LexerName);
+ if (n > buflength)
+ n = buflength;
+ memcpy(name, LexerName, n), name[n] = '\0';
+ }
+}
+
+void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length,
+ int initStyle, char *words[], WindowID window, char *props)
+{
+ // below useless evaluation(s) to supress "not used" warnings
+ lexer;
+ // build expected data structures and do the Lex
+ InternalLexOrFold(0, startPos, length, initStyle, words, window, props);
+}
+
+static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length,
+ int initStyle, char *words[], WindowID window, char *props)
+{
+ // create and initialize a WindowAccessor (including contained PropSet)
+ PropSetSimple ps;
+ ps.SetMultiple(props);
+ WindowAccessor wa(window, ps);
+ // create and initialize WordList(s)
+ int nWL = 0;
+ for (; words[nWL]; nWL++) ; // count # of WordList PTRs needed
+ WordList** wl = new WordList* [nWL + 1];// alloc WordList PTRs
+ int i = 0;
+ for (; i < nWL; i++) {
+ wl[i] = new WordList(); // (works or THROWS bad_alloc EXCEPTION)
+ wl[i]->Set(words[i]);
+ }
+ wl[i] = 0;
+ // call our "internal" folder/lexer (... then do Flush!)
+ if (foldOrLex)
+ FoldCamlDoc(startPos, length, initStyle, wl, wa);
+ else
+ ColouriseCamlDoc(startPos, length, initStyle, wl, wa);
+ wa.Flush();
+ // clean up before leaving
+ for (i = nWL - 1; i >= 0; i--)
+ delete wl[i];
+ delete [] wl;
+}
+
+static
+#endif /* BUILD_AS_EXTERNAL_LEXER */
+
+void ColouriseCamlDoc(
+ unsigned int startPos, int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler)
+{
+ // initialize styler
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int chBase = 0, chToken = 0, chLit = 0;
+ WordList& keywords = *keywordlists[0];
+ WordList& keywords2 = *keywordlists[1];
+ WordList& keywords3 = *keywordlists[2];
+ const bool isSML = keywords.InList("andalso");
+ const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0);
+
+ // set up [initial] state info (terminating states that shouldn't "bleed")
+ const int state_ = sc.state & 0x0f;
+ if (state_ <= SCE_CAML_CHAR
+ || (isSML && state_ == SCE_CAML_STRING))
+ sc.state = SCE_CAML_DEFAULT;
+ int nesting = (state_ >= SCE_CAML_COMMENT)? (state_ - SCE_CAML_COMMENT): 0;
+
+ // foreach char in range...
+ while (sc.More()) {
+ // set up [per-char] state info
+ int state2 = -1; // (ASSUME no state change)
+ int chColor = sc.currentPos - 1;// (ASSUME standard coloring range)
+ bool advance = true; // (ASSUME scanner "eats" 1 char)
+
+ // step state machine
+ switch (sc.state & 0x0f) {
+ case SCE_CAML_DEFAULT:
+ chToken = sc.currentPos; // save [possible] token start (JIC)
+ // it's wide open; what do we have?
+ if (iscamlf(sc.ch))
+ state2 = SCE_CAML_IDENTIFIER;
+ else if (!isSML && sc.Match('`') && iscamlf(sc.chNext))
+ state2 = SCE_CAML_TAGNAME;
+ else if (!isSML && sc.Match('#') && isdigit(sc.chNext))
+ state2 = SCE_CAML_LINENUM;
+ else if (isdigit(sc.ch)) {
+ // it's a number, assume base 10
+ state2 = SCE_CAML_NUMBER, chBase = 10;
+ if (sc.Match('0')) {
+ // there MAY be a base specified...
+ const char* baseC = "bBoOxX";
+ if (isSML) {
+ if (sc.chNext == 'w')
+ sc.Forward(); // (consume SML "word" indicator)
+ baseC = "x";
+ }
+ // ... change to specified base AS REQUIRED
+ if (strchr(baseC, sc.chNext))
+ chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward();
+ }
+ } else if (!isSML && sc.Match('\'')) // (Caml char literal?)
+ state2 = SCE_CAML_CHAR, chLit = 0;
+ else if (isSML && sc.Match('#', '"')) // (SML char literal?)
+ state2 = SCE_CAML_CHAR, sc.Forward();
+ else if (sc.Match('"'))
+ state2 = SCE_CAML_STRING;
+ else if (sc.Match('(', '*'))
+ state2 = SCE_CAML_COMMENT, sc.Forward(), sc.ch = ' '; // (*)...
+ else if (strchr("!?~" /* Caml "prefix-symbol" */
+ "=<>@^|&+-*/$%" /* Caml "infix-symbol" */
+ "()[]{};,:.#", sc.ch) // Caml "bracket" or ;,:.#
+ // SML "extra" ident chars
+ || (isSML && (sc.Match('\\') || sc.Match('`'))))
+ state2 = SCE_CAML_OPERATOR;
+ break;
+
+ case SCE_CAML_IDENTIFIER:
+ // [try to] interpret as [additional] identifier char
+ if (!(iscaml(sc.ch) || sc.Match('\''))) {
+ const int n = sc.currentPos - chToken;
+ if (n < 24) {
+ // length is believable as keyword, [re-]construct token
+ char t[24];
+ for (int i = -n; i < 0; i++)
+ t[n + i] = static_cast<char>(sc.GetRelative(i));
+ t[n] = '\0';
+ // special-case "_" token as KEYWORD
+ if ((n == 1 && sc.chPrev == '_') || keywords.InList(t))
+ sc.ChangeState(SCE_CAML_KEYWORD);
+ else if (keywords2.InList(t))
+ sc.ChangeState(SCE_CAML_KEYWORD2);
+ else if (keywords3.InList(t))
+ sc.ChangeState(SCE_CAML_KEYWORD3);
+ }
+ state2 = SCE_CAML_DEFAULT, advance = false;
+ }
+ break;
+
+ case SCE_CAML_TAGNAME:
+ // [try to] interpret as [additional] tagname char
+ if (!(iscaml(sc.ch) || sc.Match('\'')))
+ state2 = SCE_CAML_DEFAULT, advance = false;
+ break;
+
+ /*case SCE_CAML_KEYWORD:
+ case SCE_CAML_KEYWORD2:
+ case SCE_CAML_KEYWORD3:
+ // [try to] interpret as [additional] keyword char
+ if (!iscaml(ch))
+ state2 = SCE_CAML_DEFAULT, advance = false;
+ break;*/
+
+ case SCE_CAML_LINENUM:
+ // [try to] interpret as [additional] linenum directive char
+ if (!isdigit(sc.ch))
+ state2 = SCE_CAML_DEFAULT, advance = false;
+ break;
+
+ case SCE_CAML_OPERATOR: {
+ // [try to] interpret as [additional] operator char
+ const char* o = 0;
+ if (iscaml(sc.ch) || isspace(sc.ch) // ident or whitespace
+ || (o = strchr(")]};,\'\"#", sc.ch),o) // "termination" chars
+ || (!isSML && sc.Match('`')) // Caml extra term char
+ || (!strchr("!$%&*+-./:<=>?@^|~", sc.ch)// "operator" chars
+ // SML extra ident chars
+ && !(isSML && (sc.Match('\\') || sc.Match('`'))))) {
+ // check for INCLUSIVE termination
+ if (o && strchr(")]};,", sc.ch)) {
+ if ((sc.Match(')') && sc.chPrev == '(')
+ || (sc.Match(']') && sc.chPrev == '['))
+ // special-case "()" and "[]" tokens as KEYWORDS
+ sc.ChangeState(SCE_CAML_KEYWORD);
+ chColor++;
+ } else
+ advance = false;
+ state2 = SCE_CAML_DEFAULT;
+ }
+ break;
+ }
+
+ case SCE_CAML_NUMBER:
+ // [try to] interpret as [additional] numeric literal char
+ if ((!isSML && sc.Match('_')) || IsADigit(sc.ch, chBase))
+ break;
+ // how about an integer suffix?
+ if (!isSML && (sc.Match('l') || sc.Match('L') || sc.Match('n'))
+ && (sc.chPrev == '_' || IsADigit(sc.chPrev, chBase)))
+ break;
+ // or a floating-point literal?
+ if (chBase == 10) {
+ // with a decimal point?
+ if (sc.Match('.')
+ && ((!isSML && sc.chPrev == '_')
+ || IsADigit(sc.chPrev, chBase)))
+ break;
+ // with an exponent? (I)
+ if ((sc.Match('e') || sc.Match('E'))
+ && ((!isSML && (sc.chPrev == '.' || sc.chPrev == '_'))
+ || IsADigit(sc.chPrev, chBase)))
+ break;
+ // with an exponent? (II)
+ if (((!isSML && (sc.Match('+') || sc.Match('-')))
+ || (isSML && sc.Match('~')))
+ && (sc.chPrev == 'e' || sc.chPrev == 'E'))
+ break;
+ }
+ // it looks like we have run out of number
+ state2 = SCE_CAML_DEFAULT, advance = false;
+ break;
+
+ case SCE_CAML_CHAR:
+ if (!isSML) {
+ // [try to] interpret as [additional] char literal char
+ if (sc.Match('\\')) {
+ chLit = 1; // (definitely IS a char literal)
+ if (sc.chPrev == '\\')
+ sc.ch = ' '; // (...\\')
+ // should we be terminating - one way or another?
+ } else if ((sc.Match('\'') && sc.chPrev != '\\')
+ || sc.atLineEnd) {
+ state2 = SCE_CAML_DEFAULT;
+ if (sc.Match('\''))
+ chColor++;
+ else
+ sc.ChangeState(SCE_CAML_IDENTIFIER);
+ // ... maybe a char literal, maybe not
+ } else if (chLit < 1 && sc.currentPos - chToken >= 2)
+ sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false;
+ break;
+ }/* else
+ // fall through for SML char literal (handle like string) */
+
+ case SCE_CAML_STRING:
+ // [try to] interpret as [additional] [SML char/] string literal char
+ if (isSML && sc.Match('\\') && sc.chPrev != '\\' && isspace(sc.chNext))
+ state2 = SCE_CAML_WHITE;
+ else if (sc.Match('\\') && sc.chPrev == '\\')
+ sc.ch = ' '; // (...\\")
+ // should we be terminating - one way or another?
+ else if ((sc.Match('"') && sc.chPrev != '\\')
+ || (isSML && sc.atLineEnd)) {
+ state2 = SCE_CAML_DEFAULT;
+ if (sc.Match('"'))
+ chColor++;
+ }
+ break;
+
+ case SCE_CAML_WHITE:
+ // [try to] interpret as [additional] SML embedded whitespace char
+ if (sc.Match('\\')) {
+ // style this puppy NOW...
+ state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++,
+ styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush();
+ // ... then backtrack to determine original SML literal type
+ int p = chColor - 2;
+ for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ;
+ if (p >= 0)
+ state2 = static_cast<int>(styler.StyleAt(p));
+ // take care of state change NOW
+ sc.ChangeState(state2), state2 = -1;
+ }
+ break;
+
+ case SCE_CAML_COMMENT:
+ case SCE_CAML_COMMENT1:
+ case SCE_CAML_COMMENT2:
+ case SCE_CAML_COMMENT3:
+ // we're IN a comment - does this start a NESTED comment?
+ if (sc.Match('(', '*'))
+ state2 = sc.state + 1, chToken = sc.currentPos,
+ sc.Forward(), sc.ch = ' ' /* (*)... */, nesting++;
+ // [try to] interpret as [additional] comment char
+ else if (sc.Match(')') && sc.chPrev == '*') {
+ if (nesting)
+ state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--;
+ else
+ state2 = SCE_CAML_DEFAULT;
+ chColor++;
+ // enable "magic" (read-only) comment AS REQUIRED
+ } else if (useMagic && sc.currentPos - chToken == 4
+ && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@')
+ sc.state |= 0x10; // (switch to read-only comment style)
+ break;
+ }
+
+ // handle state change and char coloring AS REQUIRED
+ if (state2 >= 0)
+ styler.ColourTo(chColor, sc.state), sc.ChangeState(state2);
+ // move to next char UNLESS re-scanning current char
+ if (advance)
+ sc.Forward();
+ }
+
+ // do any required terminal char coloring (JIC)
+ sc.Complete();
+}
+
+#ifdef BUILD_AS_EXTERNAL_LEXER
+static
+#endif /* BUILD_AS_EXTERNAL_LEXER */
+void FoldCamlDoc(
+ unsigned int, int,
+ int,
+ WordList *[],
+ Accessor &)
+{
+}
+
+static const char * const camlWordListDesc[] = {
+ "Keywords", // primary Objective Caml keywords
+ "Keywords2", // "optional" keywords (typically from Pervasives)
+ "Keywords3", // "optional" keywords (typically typenames)
+ 0
+};
+
+#ifndef BUILD_AS_EXTERNAL_LEXER
+LexerModule lmCaml(SCLEX_CAML, ColouriseCamlDoc, "caml", FoldCamlDoc, camlWordListDesc);
+#endif /* BUILD_AS_EXTERNAL_LEXER */
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCmake.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCmake.cxx
new file mode 100644
index 00000000000..fb79abf2640
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCmake.cxx
@@ -0,0 +1,457 @@
+// Scintilla source code edit control
+/** @file LexCmake.cxx
+ ** Lexer for Cmake
+ **/
+// Copyright 2007 by Cristian Adam <cristian [dot] adam [at] gmx [dot] net>
+// based on the NSIS lexer
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static bool isCmakeNumber(char ch)
+{
+ return(ch >= '0' && ch <= '9');
+}
+
+static bool isCmakeChar(char ch)
+{
+ return(ch == '.' ) || (ch == '_' ) || isCmakeNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
+}
+
+static bool isCmakeLetter(char ch)
+{
+ return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
+}
+
+static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler)
+{
+ int nNextLine = -1;
+ for ( unsigned int i = start; i < end; i++ ) {
+ char cNext = styler.SafeGetCharAt( i );
+ if ( cNext == '\n' ) {
+ nNextLine = i+1;
+ break;
+ }
+ }
+
+ if ( nNextLine == -1 ) // We never foudn the next line...
+ return false;
+
+ for ( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ ) {
+ char cNext = styler.SafeGetCharAt( firstChar );
+ if ( cNext == ' ' )
+ continue;
+ if ( cNext == '\t' )
+ continue;
+ if ( styler.Match(firstChar, "ELSE") || styler.Match(firstChar, "else"))
+ return true;
+ break;
+ }
+
+ return false;
+}
+
+static int calculateFoldCmake(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse)
+{
+ // If the word is too long, it is not what we are looking for
+ if ( end - start > 20 )
+ return foldlevel;
+
+ int newFoldlevel = foldlevel;
+
+ char s[20]; // The key word we are looking for has atmost 13 characters
+ for (unsigned int i = 0; i < end - start + 1 && i < 19; i++) {
+ s[i] = static_cast<char>( styler[ start + i ] );
+ s[i + 1] = '\0';
+ }
+
+ if ( CompareCaseInsensitive(s, "IF") == 0 || CompareCaseInsensitive(s, "WHILE") == 0
+ || CompareCaseInsensitive(s, "MACRO") == 0 || CompareCaseInsensitive(s, "FOREACH") == 0
+ || CompareCaseInsensitive(s, "ELSEIF") == 0 )
+ newFoldlevel++;
+ else if ( CompareCaseInsensitive(s, "ENDIF") == 0 || CompareCaseInsensitive(s, "ENDWHILE") == 0
+ || CompareCaseInsensitive(s, "ENDMACRO") == 0 || CompareCaseInsensitive(s, "ENDFOREACH") == 0)
+ newFoldlevel--;
+ else if ( bElse && CompareCaseInsensitive(s, "ELSEIF") == 0 )
+ newFoldlevel++;
+ else if ( bElse && CompareCaseInsensitive(s, "ELSE") == 0 )
+ newFoldlevel++;
+
+ return newFoldlevel;
+}
+
+static int classifyWordCmake(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler )
+{
+ char word[100] = {0};
+ char lowercaseWord[100] = {0};
+
+ WordList &Commands = *keywordLists[0];
+ WordList &Parameters = *keywordLists[1];
+ WordList &UserDefined = *keywordLists[2];
+
+ for (unsigned int i = 0; i < end - start + 1 && i < 99; i++) {
+ word[i] = static_cast<char>( styler[ start + i ] );
+ lowercaseWord[i] = static_cast<char>(tolower(word[i]));
+ }
+
+ // Check for special words...
+ if ( CompareCaseInsensitive(word, "MACRO") == 0 || CompareCaseInsensitive(word, "ENDMACRO") == 0 )
+ return SCE_CMAKE_MACRODEF;
+
+ if ( CompareCaseInsensitive(word, "IF") == 0 || CompareCaseInsensitive(word, "ENDIF") == 0 )
+ return SCE_CMAKE_IFDEFINEDEF;
+
+ if ( CompareCaseInsensitive(word, "ELSEIF") == 0 || CompareCaseInsensitive(word, "ELSE") == 0 )
+ return SCE_CMAKE_IFDEFINEDEF;
+
+ if ( CompareCaseInsensitive(word, "WHILE") == 0 || CompareCaseInsensitive(word, "ENDWHILE") == 0)
+ return SCE_CMAKE_WHILEDEF;
+
+ if ( CompareCaseInsensitive(word, "FOREACH") == 0 || CompareCaseInsensitive(word, "ENDFOREACH") == 0)
+ return SCE_CMAKE_FOREACHDEF;
+
+ if ( Commands.InList(lowercaseWord) )
+ return SCE_CMAKE_COMMANDS;
+
+ if ( Parameters.InList(word) )
+ return SCE_CMAKE_PARAMETERS;
+
+
+ if ( UserDefined.InList(word) )
+ return SCE_CMAKE_USERDEFINED;
+
+ if ( strlen(word) > 3 ) {
+ if ( word[1] == '{' && word[strlen(word)-1] == '}' )
+ return SCE_CMAKE_VARIABLE;
+ }
+
+ // To check for numbers
+ if ( isCmakeNumber( word[0] ) ) {
+ bool bHasSimpleCmakeNumber = true;
+ for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) {
+ if ( !isCmakeNumber( word[j] ) ) {
+ bHasSimpleCmakeNumber = false;
+ break;
+ }
+ }
+
+ if ( bHasSimpleCmakeNumber )
+ return SCE_CMAKE_NUMBER;
+ }
+
+ return SCE_CMAKE_DEFAULT;
+}
+
+static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
+{
+ int state = SCE_CMAKE_DEFAULT;
+ if ( startPos > 0 )
+ state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox
+
+ styler.StartAt( startPos );
+ styler.GetLine( startPos );
+
+ unsigned int nLengthDoc = startPos + length;
+ styler.StartSegment( startPos );
+
+ char cCurrChar;
+ bool bVarInString = false;
+ bool bClassicVarInString = false;
+
+ unsigned int i;
+ for ( i = startPos; i < nLengthDoc; i++ ) {
+ cCurrChar = styler.SafeGetCharAt( i );
+ char cNextChar = styler.SafeGetCharAt(i+1);
+
+ switch (state) {
+ case SCE_CMAKE_DEFAULT:
+ if ( cCurrChar == '#' ) { // we have a comment line
+ styler.ColourTo(i-1, state );
+ state = SCE_CMAKE_COMMENT;
+ break;
+ }
+ if ( cCurrChar == '"' ) {
+ styler.ColourTo(i-1, state );
+ state = SCE_CMAKE_STRINGDQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+ if ( cCurrChar == '\'' ) {
+ styler.ColourTo(i-1, state );
+ state = SCE_CMAKE_STRINGRQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+ if ( cCurrChar == '`' ) {
+ styler.ColourTo(i-1, state );
+ state = SCE_CMAKE_STRINGLQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+
+ // CMake Variable
+ if ( cCurrChar == '$' || isCmakeChar(cCurrChar)) {
+ styler.ColourTo(i-1,state);
+ state = SCE_CMAKE_VARIABLE;
+
+ // If it is a number, we must check and set style here first...
+ if ( isCmakeNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) )
+ styler.ColourTo( i, SCE_CMAKE_NUMBER);
+
+ break;
+ }
+
+ break;
+ case SCE_CMAKE_COMMENT:
+ if ( cCurrChar == '\n' || cCurrChar == '\r' ) {
+ if ( styler.SafeGetCharAt(i-1) == '\\' ) {
+ styler.ColourTo(i-2,state);
+ styler.ColourTo(i-1,SCE_CMAKE_DEFAULT);
+ }
+ else {
+ styler.ColourTo(i-1,state);
+ state = SCE_CMAKE_DEFAULT;
+ }
+ }
+ break;
+ case SCE_CMAKE_STRINGDQ:
+ case SCE_CMAKE_STRINGLQ:
+ case SCE_CMAKE_STRINGRQ:
+
+ if ( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' )
+ break; // Ignore the next character, even if it is a quote of some sort
+
+ if ( cCurrChar == '"' && state == SCE_CMAKE_STRINGDQ ) {
+ styler.ColourTo(i,state);
+ state = SCE_CMAKE_DEFAULT;
+ break;
+ }
+
+ if ( cCurrChar == '`' && state == SCE_CMAKE_STRINGLQ ) {
+ styler.ColourTo(i,state);
+ state = SCE_CMAKE_DEFAULT;
+ break;
+ }
+
+ if ( cCurrChar == '\'' && state == SCE_CMAKE_STRINGRQ ) {
+ styler.ColourTo(i,state);
+ state = SCE_CMAKE_DEFAULT;
+ break;
+ }
+
+ if ( cNextChar == '\r' || cNextChar == '\n' ) {
+ int nCurLine = styler.GetLine(i+1);
+ int nBack = i;
+ // We need to check if the previous line has a \ in it...
+ bool bNextLine = false;
+
+ while ( nBack > 0 ) {
+ if ( styler.GetLine(nBack) != nCurLine )
+ break;
+
+ char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here
+
+ if ( cTemp == '\\' ) {
+ bNextLine = true;
+ break;
+ }
+ if ( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' )
+ break;
+
+ nBack--;
+ }
+
+ if ( bNextLine ) {
+ styler.ColourTo(i+1,state);
+ }
+ if ( bNextLine == false ) {
+ styler.ColourTo(i,state);
+ state = SCE_CMAKE_DEFAULT;
+ }
+ }
+ break;
+
+ case SCE_CMAKE_VARIABLE:
+
+ // CMake Variable:
+ if ( cCurrChar == '$' )
+ state = SCE_CMAKE_DEFAULT;
+ else if ( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) )
+ state = SCE_CMAKE_DEFAULT;
+ else if ( (isCmakeChar(cCurrChar) && !isCmakeChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) {
+ state = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler );
+ styler.ColourTo( i, state);
+ state = SCE_CMAKE_DEFAULT;
+ }
+ else if ( !isCmakeChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) {
+ if ( classifyWordCmake( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_CMAKE_NUMBER )
+ styler.ColourTo( i-1, SCE_CMAKE_NUMBER );
+
+ state = SCE_CMAKE_DEFAULT;
+
+ if ( cCurrChar == '"' ) {
+ state = SCE_CMAKE_STRINGDQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if ( cCurrChar == '`' ) {
+ state = SCE_CMAKE_STRINGLQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if ( cCurrChar == '\'' ) {
+ state = SCE_CMAKE_STRINGRQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if ( cCurrChar == '#' ) {
+ state = SCE_CMAKE_COMMENT;
+ }
+ }
+ break;
+ }
+
+ if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) {
+ bool bIngoreNextDollarSign = false;
+
+ if ( bVarInString && cCurrChar == '$' ) {
+ bVarInString = false;
+ bIngoreNextDollarSign = true;
+ }
+ else if ( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) ) {
+ styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR);
+ bVarInString = false;
+ bIngoreNextDollarSign = false;
+ }
+
+ else if ( bVarInString && !isCmakeChar(cNextChar) ) {
+ int nWordState = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler);
+ if ( nWordState == SCE_CMAKE_VARIABLE )
+ styler.ColourTo( i, SCE_CMAKE_STRINGVAR);
+ bVarInString = false;
+ }
+ // Covers "${TEST}..."
+ else if ( bClassicVarInString && cNextChar == '}' ) {
+ styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR);
+ bClassicVarInString = false;
+ }
+
+ // Start of var in string
+ if ( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' ) {
+ styler.ColourTo( i-1, state);
+ bClassicVarInString = true;
+ bVarInString = false;
+ }
+ else if ( !bIngoreNextDollarSign && cCurrChar == '$' ) {
+ styler.ColourTo( i-1, state);
+ bVarInString = true;
+ bClassicVarInString = false;
+ }
+ }
+ }
+
+ // Colourise remaining document
+ styler.ColourTo(nLengthDoc-1,state);
+}
+
+static void FoldCmakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ // No folding enabled, no reason to continue...
+ if ( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1;
+
+ int lineCurrent = styler.GetLine(startPos);
+ unsigned int safeStartPos = styler.LineStart( lineCurrent );
+
+ bool bArg1 = true;
+ int nWordStart = -1;
+
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+
+ for (unsigned int i = safeStartPos; i < startPos + length; i++) {
+ char chCurr = styler.SafeGetCharAt(i);
+
+ if ( bArg1 ) {
+ if ( nWordStart == -1 && (isCmakeLetter(chCurr)) ) {
+ nWordStart = i;
+ }
+ else if ( isCmakeLetter(chCurr) == false && nWordStart > -1 ) {
+ int newLevel = calculateFoldCmake( nWordStart, i-1, levelNext, styler, foldAtElse);
+
+ if ( newLevel == levelNext ) {
+ if ( foldAtElse ) {
+ if ( CmakeNextLineHasElse(i, startPos + length, styler) )
+ levelNext--;
+ }
+ }
+ else
+ levelNext = newLevel;
+ bArg1 = false;
+ }
+ }
+
+ if ( chCurr == '\n' ) {
+ if ( bArg1 && foldAtElse) {
+ if ( CmakeNextLineHasElse(i, startPos + length, styler) )
+ levelNext--;
+ }
+
+ // If we are on a new line...
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (levelUse < levelNext )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ levelCurrent = levelNext;
+ bArg1 = true; // New line, lets look at first argument again
+ nWordStart = -1;
+ }
+ }
+
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+}
+
+static const char * const cmakeWordLists[] = {
+ "Commands",
+ "Parameters",
+ "UserDefined",
+ 0,
+ 0,};
+
+LexerModule lmCmake(SCLEX_CMAKE, ColouriseCmakeDoc, "cmake", FoldCmakeDoc, cmakeWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCoffeeScript.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCoffeeScript.cxx
new file mode 100644
index 00000000000..1667683218e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCoffeeScript.cxx
@@ -0,0 +1,415 @@
+// Scintilla source code edit control
+/** @file LexCoffeeScript.cxx
+ ** Lexer for CoffeeScript.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// Based on the Scintilla C++ Lexer
+// Written by Eric Promislow <ericp@activestate.com> in 2011 for the Komodo IDE
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "Platform.h"
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static bool IsSpaceEquiv(int state) {
+ return (state == SCE_COFFEESCRIPT_DEFAULT
+ || state == SCE_COFFEESCRIPT_COMMENTLINE
+ || state == SCE_COFFEESCRIPT_COMMENTBLOCK
+ || state == SCE_COFFEESCRIPT_VERBOSE_REGEX
+ || state == SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT
+ || state == SCE_COFFEESCRIPT_WORD
+ || state == SCE_COFFEESCRIPT_REGEX);
+}
+
+// Preconditions: sc.currentPos points to a character after '+' or '-'.
+// The test for pos reaching 0 should be redundant,
+// and is in only for safety measures.
+// Limitation: this code will give the incorrect answer for code like
+// a = b+++/ptn/...
+// Putting a space between the '++' post-inc operator and the '+' binary op
+// fixes this, and is highly recommended for readability anyway.
+static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
+ int pos = (int) sc.currentPos;
+ while (--pos > 0) {
+ char ch = styler[pos];
+ if (ch == '+' || ch == '-') {
+ return styler[pos - 1] == ch;
+ }
+ }
+ return false;
+}
+
+static bool followsReturnKeyword(StyleContext &sc, Accessor &styler) {
+ // Don't look at styles, so no need to flush.
+ int pos = (int) sc.currentPos;
+ int currentLine = styler.GetLine(pos);
+ int lineStartPos = styler.LineStart(currentLine);
+ while (--pos > lineStartPos) {
+ char ch = styler.SafeGetCharAt(pos);
+ if (ch != ' ' && ch != '\t') {
+ break;
+ }
+ }
+ const char *retBack = "nruter";
+ const char *s = retBack;
+ while (*s
+ && pos >= lineStartPos
+ && styler.SafeGetCharAt(pos) == *s) {
+ s++;
+ pos--;
+ }
+ return !*s;
+}
+
+static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords4 = *keywordlists[3];
+
+ CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
+ CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-");
+
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_$@", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._$", 0x80, true);
+
+ int chPrevNonWhite = ' ';
+ int visibleChars = 0;
+
+ // look back to set chPrevNonWhite properly for better regex colouring
+ int endPos = startPos + length;
+ if (startPos > 0 && IsSpaceEquiv(initStyle)) {
+ unsigned int back = startPos;
+ styler.Flush();
+ while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back)))
+ ;
+ if (styler.StyleAt(back) == SCE_COFFEESCRIPT_OPERATOR) {
+ chPrevNonWhite = styler.SafeGetCharAt(back);
+ }
+ if (startPos != back) {
+ initStyle = styler.StyleAt(back);
+ if (IsSpaceEquiv(initStyle)) {
+ initStyle = SCE_COFFEESCRIPT_DEFAULT;
+ }
+ }
+ startPos = back;
+ }
+
+ StyleContext sc(startPos, endPos - startPos, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ // Reset states to beginning of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_COFFEESCRIPT_OPERATOR:
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ break;
+ case SCE_COFFEESCRIPT_NUMBER:
+ // We accept almost anything because of hex. and number suffixes
+ if (!setWord.Contains(sc.ch) || sc.Match('.', '.')) {
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_IDENTIFIER:
+ if (!setWord.Contains(sc.ch) || (sc.ch == '.') || (sc.ch == '$')) {
+ char s[1000];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_COFFEESCRIPT_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS);
+ }
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_WORD:
+ case SCE_COFFEESCRIPT_WORD2:
+ case SCE_COFFEESCRIPT_GLOBALCLASS:
+ if (!setWord.Contains(sc.ch)) {
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_STRING:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_CHARACTER:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_REGEX:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ } else if (sc.ch == '/') {
+ sc.Forward();
+ while ((sc.ch < 0x80) && islower(sc.ch))
+ sc.Forward(); // gobble regex flags
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ } else if (sc.ch == '\\') {
+ // Gobble up the quoted character
+ if (sc.chNext == '\\' || sc.chNext == '/') {
+ sc.Forward();
+ }
+ }
+ break;
+ case SCE_COFFEESCRIPT_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
+ }
+ break;
+ case SCE_COFFEESCRIPT_COMMENTBLOCK:
+ if (sc.Match("###")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
+ } else if (sc.ch == '\\') {
+ sc.Forward();
+ }
+ break;
+ case SCE_COFFEESCRIPT_VERBOSE_REGEX:
+ if (sc.Match("///")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT);
+ } else if (sc.ch == '\\') {
+ sc.Forward();
+ }
+ break;
+ case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_COFFEESCRIPT_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_COFFEESCRIPT_NUMBER);
+ } else if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_COFFEESCRIPT_IDENTIFIER);
+ } else if (sc.Match("///")) {
+ sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX);
+ sc.Forward();
+ sc.Forward();
+ } else if (sc.ch == '/'
+ && (setOKBeforeRE.Contains(chPrevNonWhite)
+ || followsReturnKeyword(sc, styler))
+ && (!setCouldBePostOp.Contains(chPrevNonWhite)
+ || !FollowsPostfixOperator(sc, styler))) {
+ sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_COFFEESCRIPT_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_COFFEESCRIPT_CHARACTER);
+ } else if (sc.ch == '#') {
+ if (sc.Match("###")) {
+ sc.SetState(SCE_COFFEESCRIPT_COMMENTBLOCK);
+ sc.Forward();
+ sc.Forward();
+ } else {
+ sc.SetState(SCE_COFFEESCRIPT_COMMENTLINE);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_COFFEESCRIPT_OPERATOR);
+ }
+ }
+
+ if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) {
+ chPrevNonWhite = sc.ch;
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ if (ch == '#')
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+
+static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler) {
+ // A simplified version of FoldPyDoc
+ const int maxPos = startPos + length;
+ const int maxLines = styler.GetLine(maxPos - 1); // Requested last line
+ const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
+
+ // property fold.coffeescript.comment
+ const bool foldComment = styler.GetPropertyInt("fold.coffeescript.comment") != 0;
+
+ const bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
+
+ // Backtrack to previous non-blank line so we can determine indent level
+ // for any white space lines
+ // and so we can fix any preceding fold level (which is why we go back
+ // at least one line in all cases)
+ int spaceFlags = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ while (lineCurrent > 0) {
+ lineCurrent--;
+ indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)
+ && !IsCommentLine(lineCurrent, styler))
+ break;
+ }
+ int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+
+ // Set up initial loop state
+ int prevComment = 0;
+ if (lineCurrent >= 1)
+ prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler);
+
+ // Process all characters to end of requested range
+ // or comment that hangs over the end of the range. Cap processing in all cases
+ // to end of document (in case of comment at end).
+ while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevComment)) {
+
+ // Gather info
+ int lev = indentCurrent;
+ int lineNext = lineCurrent + 1;
+ int indentNext = indentCurrent;
+ if (lineNext <= docLines) {
+ // Information about next line is only available if not at end of document
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+ const int comment = foldComment && IsCommentLine(lineCurrent, styler);
+ const int comment_start = (comment && !prevComment && (lineNext <= docLines) &&
+ IsCommentLine(lineNext, styler) && (lev > SC_FOLDLEVELBASE));
+ const int comment_continue = (comment && prevComment);
+ if (!comment)
+ indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+ if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel;
+
+ if (comment_start) {
+ // Place fold point at start of a block of comments
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (comment_continue) {
+ // Add level to rest of lines in the block
+ lev = lev + 1;
+ }
+
+ // Skip past any blank lines for next indent level info; we skip also
+ // comments (all comments, not just those starting in column 0)
+ // which effectively folds them into surrounding code rather
+ // than screwing up folding.
+
+ while ((lineNext < docLines) &&
+ ((indentNext & SC_FOLDLEVELWHITEFLAG) ||
+ (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
+
+ lineNext++;
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+
+ const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
+ const int levelBeforeComments = Platform::Maximum(indentCurrentLevel,levelAfterComments);
+
+ // Now set all the indent levels on the lines we skipped
+ // Do this from end to start. Once we encounter one line
+ // which is indented more than the line after the end of
+ // the comment-block, use the level of the block before
+
+ int skipLine = lineNext;
+ int skipLevel = levelAfterComments;
+
+ while (--skipLine > lineCurrent) {
+ int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+
+ if (foldCompact) {
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
+ skipLevel = levelBeforeComments;
+
+ int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(skipLine, skipLevel | whiteFlag);
+ } else {
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments &&
+ !(skipLineIndent & SC_FOLDLEVELWHITEFLAG) &&
+ !IsCommentLine(skipLine, styler))
+ skipLevel = levelBeforeComments;
+
+ styler.SetLevel(skipLine, skipLevel);
+ }
+ }
+
+ // Set fold header on non-comment line
+ if (!comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+
+ // Keep track of block comment state of previous line
+ prevComment = comment_start || comment_continue;
+
+ // Set fold level for this line and move to next line
+ styler.SetLevel(lineCurrent, lev);
+ indentCurrent = indentNext;
+ lineCurrent = lineNext;
+ }
+}
+
+static const char *const csWordLists[] = {
+ "Keywords",
+ "Secondary keywords",
+ "Unused",
+ "Global classes",
+ 0,
+};
+
+LexerModule lmCoffeeScript(SCLEX_COFFEESCRIPT, ColouriseCoffeeScriptDoc, "coffeescript", FoldCoffeeScriptDoc, csWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexConf.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexConf.cxx
new file mode 100644
index 00000000000..6a1c8c018be
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexConf.cxx
@@ -0,0 +1,192 @@
+// Scintilla source code edit control
+/** @file LexConf.cxx
+ ** Lexer for Apache Configuration Files.
+ **
+ ** First working version contributed by Ahmad Zawawi <ahmad.zawawi@gmail.com> on October 28, 2000.
+ ** i created this lexer because i needed something pretty when dealing
+ ** when Apache Configuration files...
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
+{
+ int state = SCE_CONF_DEFAULT;
+ char chNext = styler[startPos];
+ int lengthDoc = startPos + length;
+ // create a buffer large enough to take the largest chunk...
+ char *buffer = new char[length+1];
+ int bufferCount = 0;
+
+ // this assumes that we have 2 keyword list in conf.properties
+ WordList &directives = *keywordLists[0];
+ WordList &params = *keywordLists[1];
+
+ // go through all provided text segment
+ // using the hand-written state machine shown below
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ for (int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ i++;
+ continue;
+ }
+ switch(state) {
+ case SCE_CONF_DEFAULT:
+ if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') {
+ // whitespace is simply ignored here...
+ styler.ColourTo(i,SCE_CONF_DEFAULT);
+ break;
+ } else if( ch == '#' ) {
+ // signals the start of a comment...
+ state = SCE_CONF_COMMENT;
+ styler.ColourTo(i,SCE_CONF_COMMENT);
+ } else if( ch == '.' /*|| ch == '/'*/) {
+ // signals the start of a file...
+ state = SCE_CONF_EXTENSION;
+ styler.ColourTo(i,SCE_CONF_EXTENSION);
+ } else if( ch == '"') {
+ state = SCE_CONF_STRING;
+ styler.ColourTo(i,SCE_CONF_STRING);
+ } else if( IsASCII(ch) && ispunct(ch) ) {
+ // signals an operator...
+ // no state jump necessary for this
+ // simple case...
+ styler.ColourTo(i,SCE_CONF_OPERATOR);
+ } else if( IsASCII(ch) && isalpha(ch) ) {
+ // signals the start of an identifier
+ bufferCount = 0;
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ state = SCE_CONF_IDENTIFIER;
+ } else if( IsASCII(ch) && isdigit(ch) ) {
+ // signals the start of a number
+ bufferCount = 0;
+ buffer[bufferCount++] = ch;
+ //styler.ColourTo(i,SCE_CONF_NUMBER);
+ state = SCE_CONF_NUMBER;
+ } else {
+ // style it the default style..
+ styler.ColourTo(i,SCE_CONF_DEFAULT);
+ }
+ break;
+
+ case SCE_CONF_COMMENT:
+ // if we find a newline here,
+ // we simply go to default state
+ // else continue to work on it...
+ if( ch == '\n' || ch == '\r' ) {
+ state = SCE_CONF_DEFAULT;
+ } else {
+ styler.ColourTo(i,SCE_CONF_COMMENT);
+ }
+ break;
+
+ case SCE_CONF_EXTENSION:
+ // if we find a non-alphanumeric char,
+ // we simply go to default state
+ // else we're still dealing with an extension...
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') ||
+ (ch == '-') || (ch == '$') ||
+ (ch == '/') || (ch == '.') || (ch == '*') )
+ {
+ styler.ColourTo(i,SCE_CONF_EXTENSION);
+ } else {
+ state = SCE_CONF_DEFAULT;
+ chNext = styler[i--];
+ }
+ break;
+
+ case SCE_CONF_STRING:
+ // if we find the end of a string char, we simply go to default state
+ // else we're still dealing with an string...
+ if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) {
+ state = SCE_CONF_DEFAULT;
+ }
+ styler.ColourTo(i,SCE_CONF_STRING);
+ break;
+
+ case SCE_CONF_IDENTIFIER:
+ // stay in CONF_IDENTIFIER state until we find a non-alphanumeric
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) {
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ } else {
+ state = SCE_CONF_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // check if the buffer contains a keyword, and highlight it if it is a keyword...
+ if(directives.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_CONF_DIRECTIVE );
+ } else if(params.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_CONF_PARAMETER );
+ } else if(strchr(buffer,'/') || strchr(buffer,'.')) {
+ styler.ColourTo(i-1,SCE_CONF_EXTENSION);
+ } else {
+ styler.ColourTo(i-1,SCE_CONF_DEFAULT);
+ }
+
+ // push back the faulty character
+ chNext = styler[i--];
+
+ }
+ break;
+
+ case SCE_CONF_NUMBER:
+ // stay in CONF_NUMBER state until we find a non-numeric
+ if( (IsASCII(ch) && isdigit(ch)) || ch == '.') {
+ buffer[bufferCount++] = ch;
+ } else {
+ state = SCE_CONF_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // Colourize here...
+ if( strchr(buffer,'.') ) {
+ // it is an IP address...
+ styler.ColourTo(i-1,SCE_CONF_IP);
+ } else {
+ // normal number
+ styler.ColourTo(i-1,SCE_CONF_NUMBER);
+ }
+
+ // push back a character
+ chNext = styler[i--];
+ }
+ break;
+
+ }
+ }
+ delete []buffer;
+}
+
+static const char * const confWordListDesc[] = {
+ "Directives",
+ "Parameters",
+ 0
+};
+
+LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCrontab.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCrontab.cxx
new file mode 100644
index 00000000000..ad6668fa7ba
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCrontab.cxx
@@ -0,0 +1,226 @@
+// Scintilla source code edit control
+/** @file LexCrontab.cxx
+ ** Lexer to use with extended crontab files used by a powerful
+ ** Windows scheduler/event monitor/automation manager nnCron.
+ ** (http://nemtsev.eserv.ru/)
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordList
+*keywordLists[], Accessor &styler)
+{
+ int state = SCE_NNCRONTAB_DEFAULT;
+ char chNext = styler[startPos];
+ int lengthDoc = startPos + length;
+ // create a buffer large enough to take the largest chunk...
+ char *buffer = new char[length+1];
+ int bufferCount = 0;
+ // used when highliting environment variables inside quoted string:
+ bool insideString = false;
+
+ // this assumes that we have 3 keyword list in conf.properties
+ WordList &section = *keywordLists[0];
+ WordList &keyword = *keywordLists[1];
+ WordList &modifier = *keywordLists[2];
+
+ // go through all provided text segment
+ // using the hand-written state machine shown below
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ for (int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ i++;
+ continue;
+ }
+ switch(state) {
+ case SCE_NNCRONTAB_DEFAULT:
+ if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') {
+ // whitespace is simply ignored here...
+ styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT);
+ break;
+ } else if( ch == '#' && styler.SafeGetCharAt(i+1) == '(') {
+ // signals the start of a task...
+ state = SCE_NNCRONTAB_TASK;
+ styler.ColourTo(i,SCE_NNCRONTAB_TASK);
+ }
+ else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' ||
+ styler.SafeGetCharAt(i+1) == '\t')) {
+ // signals the start of an extended comment...
+ state = SCE_NNCRONTAB_COMMENT;
+ styler.ColourTo(i,SCE_NNCRONTAB_COMMENT);
+ } else if( ch == '#' ) {
+ // signals the start of a plain comment...
+ state = SCE_NNCRONTAB_COMMENT;
+ styler.ColourTo(i,SCE_NNCRONTAB_COMMENT);
+ } else if( ch == ')' && styler.SafeGetCharAt(i+1) == '#') {
+ // signals the end of a task...
+ state = SCE_NNCRONTAB_TASK;
+ styler.ColourTo(i,SCE_NNCRONTAB_TASK);
+ } else if( ch == '"') {
+ state = SCE_NNCRONTAB_STRING;
+ styler.ColourTo(i,SCE_NNCRONTAB_STRING);
+ } else if( ch == '%') {
+ // signals environment variables
+ state = SCE_NNCRONTAB_ENVIRONMENT;
+ styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
+ } else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') {
+ // signals environment variables
+ state = SCE_NNCRONTAB_ENVIRONMENT;
+ styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
+ } else if( ch == '*' ) {
+ // signals an asterisk
+ // no state jump necessary for this simple case...
+ styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK);
+ } else if( (IsASCII(ch) && isalpha(ch)) || ch == '<' ) {
+ // signals the start of an identifier
+ bufferCount = 0;
+ buffer[bufferCount++] = ch;
+ state = SCE_NNCRONTAB_IDENTIFIER;
+ } else if( IsASCII(ch) && isdigit(ch) ) {
+ // signals the start of a number
+ bufferCount = 0;
+ buffer[bufferCount++] = ch;
+ state = SCE_NNCRONTAB_NUMBER;
+ } else {
+ // style it the default style..
+ styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT);
+ }
+ break;
+
+ case SCE_NNCRONTAB_COMMENT:
+ // if we find a newline here,
+ // we simply go to default state
+ // else continue to work on it...
+ if( ch == '\n' || ch == '\r' ) {
+ state = SCE_NNCRONTAB_DEFAULT;
+ } else {
+ styler.ColourTo(i,SCE_NNCRONTAB_COMMENT);
+ }
+ break;
+
+ case SCE_NNCRONTAB_TASK:
+ // if we find a newline here,
+ // we simply go to default state
+ // else continue to work on it...
+ if( ch == '\n' || ch == '\r' ) {
+ state = SCE_NNCRONTAB_DEFAULT;
+ } else {
+ styler.ColourTo(i,SCE_NNCRONTAB_TASK);
+ }
+ break;
+
+ case SCE_NNCRONTAB_STRING:
+ if( ch == '%' ) {
+ state = SCE_NNCRONTAB_ENVIRONMENT;
+ insideString = true;
+ styler.ColourTo(i-1,SCE_NNCRONTAB_STRING);
+ break;
+ }
+ // if we find the end of a string char, we simply go to default state
+ // else we're still dealing with an string...
+ if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') ||
+ (ch == '\n') || (ch == '\r') ) {
+ state = SCE_NNCRONTAB_DEFAULT;
+ }
+ styler.ColourTo(i,SCE_NNCRONTAB_STRING);
+ break;
+
+ case SCE_NNCRONTAB_ENVIRONMENT:
+ // if we find the end of a string char, we simply go to default state
+ // else we're still dealing with an string...
+ if( ch == '%' && insideString ) {
+ state = SCE_NNCRONTAB_STRING;
+ insideString = false;
+ break;
+ }
+ if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\')
+ || (ch == '\n') || (ch == '\r') || (ch == '>') ) {
+ state = SCE_NNCRONTAB_DEFAULT;
+ styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT);
+ break;
+ }
+ styler.ColourTo(i+1,SCE_NNCRONTAB_ENVIRONMENT);
+ break;
+
+ case SCE_NNCRONTAB_IDENTIFIER:
+ // stay in CONF_IDENTIFIER state until we find a non-alphanumeric
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') ||
+ (ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ||
+ (ch == '@') ) {
+ buffer[bufferCount++] = ch;
+ } else {
+ state = SCE_NNCRONTAB_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // check if the buffer contains a keyword,
+ // and highlight it if it is a keyword...
+ if(section.InList(buffer)) {
+ styler.ColourTo(i,SCE_NNCRONTAB_SECTION );
+ } else if(keyword.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_NNCRONTAB_KEYWORD );
+ } // else if(strchr(buffer,'/') || strchr(buffer,'.')) {
+ // styler.ColourTo(i-1,SCE_NNCRONTAB_EXTENSION);
+ // }
+ else if(modifier.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_NNCRONTAB_MODIFIER );
+ } else {
+ styler.ColourTo(i-1,SCE_NNCRONTAB_DEFAULT);
+ }
+ // push back the faulty character
+ chNext = styler[i--];
+ }
+ break;
+
+ case SCE_NNCRONTAB_NUMBER:
+ // stay in CONF_NUMBER state until we find a non-numeric
+ if( IsASCII(ch) && isdigit(ch) /* || ch == '.' */ ) {
+ buffer[bufferCount++] = ch;
+ } else {
+ state = SCE_NNCRONTAB_DEFAULT;
+ buffer[bufferCount] = '\0';
+ // Colourize here... (normal number)
+ styler.ColourTo(i-1,SCE_NNCRONTAB_NUMBER);
+ // push back a character
+ chNext = styler[i--];
+ }
+ break;
+ }
+ }
+ delete []buffer;
+}
+
+static const char * const cronWordListDesc[] = {
+ "Section keywords and Forth words",
+ "nnCrontab keywords",
+ "Modifiers",
+ 0
+};
+
+LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab", 0, cronWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCsound.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCsound.cxx
new file mode 100644
index 00000000000..da5bfeb8c65
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexCsound.cxx
@@ -0,0 +1,214 @@
+// Scintilla source code edit control
+/** @file LexCsound.cxx
+ ** Lexer for Csound (Orchestra & Score)
+ ** Written by Georg Ritter - <ritterfuture A T gmail D O T com>
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' ||
+ ch == '_' || ch == '?');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' ||
+ ch == '%' || ch == '@' || ch == '$' || ch == '?');
+}
+
+static inline bool IsCsoundOperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' || ch == '^' ||
+ ch == '[' || ch == ']' || ch == '<' || ch == '&' ||
+ ch == '>' || ch == ',' || ch == '|' || ch == '~' ||
+ ch == '%' || ch == ':')
+ return true;
+ return false;
+}
+
+static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &opcode = *keywordlists[0];
+ WordList &headerStmt = *keywordlists[1];
+ WordList &otherKeyword = *keywordlists[2];
+
+ // Do not leak onto next line
+ if (initStyle == SCE_CSOUND_STRINGEOL)
+ initStyle = SCE_CSOUND_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward())
+ {
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_CSOUND_OPERATOR) {
+ if (!IsCsoundOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_CSOUND_DEFAULT);
+ }
+ }else if (sc.state == SCE_CSOUND_NUMBER) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_CSOUND_DEFAULT);
+ }
+ } else if (sc.state == SCE_CSOUND_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) ) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+
+ if (opcode.InList(s)) {
+ sc.ChangeState(SCE_CSOUND_OPCODE);
+ } else if (headerStmt.InList(s)) {
+ sc.ChangeState(SCE_CSOUND_HEADERSTMT);
+ } else if (otherKeyword.InList(s)) {
+ sc.ChangeState(SCE_CSOUND_USERKEYWORD);
+ } else if (s[0] == 'p') {
+ sc.ChangeState(SCE_CSOUND_PARAM);
+ } else if (s[0] == 'a') {
+ sc.ChangeState(SCE_CSOUND_ARATE_VAR);
+ } else if (s[0] == 'k') {
+ sc.ChangeState(SCE_CSOUND_KRATE_VAR);
+ } else if (s[0] == 'i') { // covers both i-rate variables and i-statements
+ sc.ChangeState(SCE_CSOUND_IRATE_VAR);
+ } else if (s[0] == 'g') {
+ sc.ChangeState(SCE_CSOUND_GLOBAL_VAR);
+ }
+ sc.SetState(SCE_CSOUND_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_CSOUND_COMMENT ) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_CSOUND_DEFAULT);
+ }
+ }
+ else if ((sc.state == SCE_CSOUND_ARATE_VAR) ||
+ (sc.state == SCE_CSOUND_KRATE_VAR) ||
+ (sc.state == SCE_CSOUND_IRATE_VAR)) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_CSOUND_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_CSOUND_DEFAULT) {
+ if (sc.ch == ';'){
+ sc.SetState(SCE_CSOUND_COMMENT);
+ } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) {
+ sc.SetState(SCE_CSOUND_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_CSOUND_IDENTIFIER);
+ } else if (IsCsoundOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_CSOUND_OPERATOR);
+ } else if (sc.ch == 'p') {
+ sc.SetState(SCE_CSOUND_PARAM);
+ } else if (sc.ch == 'a') {
+ sc.SetState(SCE_CSOUND_ARATE_VAR);
+ } else if (sc.ch == 'k') {
+ sc.SetState(SCE_CSOUND_KRATE_VAR);
+ } else if (sc.ch == 'i') { // covers both i-rate variables and i-statements
+ sc.SetState(SCE_CSOUND_IRATE_VAR);
+ } else if (sc.ch == 'g') {
+ sc.SetState(SCE_CSOUND_GLOBAL_VAR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldCsoundInstruments(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int stylePrev = 0;
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if ((stylePrev != SCE_CSOUND_OPCODE) && (style == SCE_CSOUND_OPCODE)) {
+ char s[20];
+ unsigned int j = 0;
+ while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) {
+ s[j] = styler[i + j];
+ j++;
+ }
+ s[j] = '\0';
+
+ if (strcmp(s, "instr") == 0)
+ levelCurrent++;
+ if (strcmp(s, "endin") == 0)
+ levelCurrent--;
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ stylePrev = style;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+
+static const char * const csoundWordListDesc[] = {
+ "Opcodes",
+ "Header Statements",
+ "User keywords",
+ 0
+};
+
+LexerModule lmCsound(SCLEX_CSOUND, ColouriseCsoundDoc, "csound", FoldCsoundInstruments, csoundWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexD.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexD.cxx
new file mode 100644
index 00000000000..045c4cb73ed
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexD.cxx
@@ -0,0 +1,568 @@
+/** @file LexD.cxx
+ ** Lexer for D.
+ **
+ ** Copyright (c) 2006 by Waldemar Augustyn <waldemar@wdmsys.com>
+ ** Converted to lexer object and added further folding features/properties by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/* Nested comments require keeping the value of the nesting level for every
+ position in the document. But since scintilla always styles line by line,
+ we only need to store one value per line. The non-negative number indicates
+ nesting level at the end of the line.
+*/
+
+// Underscore, letter, digit and universal alphas from C99 Appendix D.
+
+static bool IsWordStart(int ch) {
+ return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch);
+}
+
+static bool IsWord(int ch) {
+ return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch);
+}
+
+static bool IsDoxygen(int ch) {
+ if (IsASCII(ch) && islower(ch))
+ return true;
+ if (ch == '$' || ch == '@' || ch == '\\' ||
+ ch == '&' || ch == '#' || ch == '<' || ch == '>' ||
+ ch == '{' || ch == '}' || ch == '[' || ch == ']')
+ return true;
+ return false;
+}
+
+static bool IsStringSuffix(int ch) {
+ return ch == 'c' || ch == 'w' || ch == 'd';
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_D_COMMENT ||
+ style == SCE_D_COMMENTDOC ||
+ style == SCE_D_COMMENTDOCKEYWORD ||
+ style == SCE_D_COMMENTDOCKEYWORDERROR;
+}
+
+// An individual named option for use in an OptionSet
+
+// Options used for LexerD
+struct OptionsD {
+ bool fold;
+ bool foldSyntaxBased;
+ bool foldComment;
+ bool foldCommentMultiline;
+ bool foldCommentExplicit;
+ std::string foldExplicitStart;
+ std::string foldExplicitEnd;
+ bool foldExplicitAnywhere;
+ bool foldCompact;
+ int foldAtElseInt;
+ bool foldAtElse;
+ OptionsD() {
+ fold = false;
+ foldSyntaxBased = true;
+ foldComment = false;
+ foldCommentMultiline = true;
+ foldCommentExplicit = true;
+ foldExplicitStart = "";
+ foldExplicitEnd = "";
+ foldExplicitAnywhere = false;
+ foldCompact = true;
+ foldAtElseInt = -1;
+ foldAtElse = false;
+ }
+};
+
+static const char * const dWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ "Documentation comment keywords",
+ "Type definitions and aliases",
+ "Keywords 5",
+ "Keywords 6",
+ "Keywords 7",
+ 0,
+ };
+
+struct OptionSetD : public OptionSet<OptionsD> {
+ OptionSetD() {
+ DefineProperty("fold", &OptionsD::fold);
+
+ DefineProperty("fold.d.syntax.based", &OptionsD::foldSyntaxBased,
+ "Set this property to 0 to disable syntax based folding.");
+
+ DefineProperty("fold.comment", &OptionsD::foldComment);
+
+ DefineProperty("fold.d.comment.multiline", &OptionsD::foldCommentMultiline,
+ "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
+
+ DefineProperty("fold.d.comment.explicit", &OptionsD::foldCommentExplicit,
+ "Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
+
+ DefineProperty("fold.d.explicit.start", &OptionsD::foldExplicitStart,
+ "The string to use for explicit fold start points, replacing the standard //{.");
+
+ DefineProperty("fold.d.explicit.end", &OptionsD::foldExplicitEnd,
+ "The string to use for explicit fold end points, replacing the standard //}.");
+
+ DefineProperty("fold.d.explicit.anywhere", &OptionsD::foldExplicitAnywhere,
+ "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
+
+ DefineProperty("fold.compact", &OptionsD::foldCompact);
+
+ DefineProperty("lexer.d.fold.at.else", &OptionsD::foldAtElseInt,
+ "This option enables D folding on a \"} else {\" line of an if statement.");
+
+ DefineProperty("fold.at.else", &OptionsD::foldAtElse);
+
+ DefineWordListSets(dWordLists);
+ }
+};
+
+class LexerD : public ILexer {
+ bool caseSensitive;
+ WordList keywords;
+ WordList keywords2;
+ WordList keywords3;
+ WordList keywords4;
+ WordList keywords5;
+ WordList keywords6;
+ WordList keywords7;
+ OptionsD options;
+ OptionSetD osD;
+public:
+ LexerD(bool caseSensitive_) :
+ caseSensitive(caseSensitive_) {
+ }
+ virtual ~LexerD() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osD.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osD.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osD.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osD.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactoryD() {
+ return new LexerD(true);
+ }
+ static ILexer *LexerFactoryDInsensitive() {
+ return new LexerD(false);
+ }
+};
+
+int SCI_METHOD LexerD::PropertySet(const char *key, const char *val) {
+ if (osD.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerD::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords;
+ break;
+ case 1:
+ wordListN = &keywords2;
+ break;
+ case 2:
+ wordListN = &keywords3;
+ break;
+ case 3:
+ wordListN = &keywords4;
+ break;
+ case 4:
+ wordListN = &keywords5;
+ break;
+ case 5:
+ wordListN = &keywords6;
+ break;
+ case 6:
+ wordListN = &keywords7;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ int styleBeforeDCKeyword = SCE_D_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int curLine = styler.GetLine(startPos);
+ int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
+ bool numFloat = false; // Float literals have '+' and '-' signs
+ bool numHex = false;
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curNcLevel);
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_D_OPERATOR:
+ sc.SetState(SCE_D_DEFAULT);
+ break;
+ case SCE_D_NUMBER:
+ // We accept almost anything because of hex. and number suffixes
+ if (IsASCII(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
+ continue;
+ } else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) {
+ // Don't parse 0..2 as number.
+ numFloat=true;
+ continue;
+ } else if ( ( sc.ch == '-' || sc.ch == '+' ) && ( /*sign and*/
+ ( !numHex && ( sc.chPrev == 'e' || sc.chPrev == 'E' ) ) || /*decimal or*/
+ ( sc.chPrev == 'p' || sc.chPrev == 'P' ) ) ) { /*hex*/
+ // Parse exponent sign in float literals: 2e+10 0x2e+10
+ continue;
+ } else {
+ sc.SetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_IDENTIFIER:
+ if (!IsWord(sc.ch)) {
+ char s[1000];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_D_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_D_WORD2);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_D_TYPEDEF);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_D_WORD5);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_D_WORD6);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_D_WORD7);
+ }
+ sc.SetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_COMMENTDOC:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_D_COMMENTDOC;
+ sc.SetState(SCE_D_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_D_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_COMMENTLINEDOC:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_D_DEFAULT);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_D_COMMENTLINEDOC;
+ sc.SetState(SCE_D_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_D_COMMENTDOCKEYWORD:
+ if ((styleBeforeDCKeyword == SCE_D_COMMENTDOC) && sc.Match('*', '/')) {
+ sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR);
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ } else if (!IsDoxygen(sc.ch)) {
+ char s[100];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+ if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
+ sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR);
+ }
+ sc.SetState(styleBeforeDCKeyword);
+ }
+ break;
+ case SCE_D_COMMENTNESTED:
+ if (sc.Match('+', '/')) {
+ if (curNcLevel > 0)
+ curNcLevel -= 1;
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curNcLevel);
+ sc.Forward();
+ if (curNcLevel == 0) {
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ } else if (sc.Match('/','+')) {
+ curNcLevel += 1;
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curNcLevel);
+ sc.Forward();
+ }
+ break;
+ case SCE_D_STRING:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '"' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '"') {
+ if(IsStringSuffix(sc.chNext))
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_CHARACTER:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_D_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ // Char has no suffixes
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_STRINGB:
+ if (sc.ch == '`') {
+ if(IsStringSuffix(sc.chNext))
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ break;
+ case SCE_D_STRINGR:
+ if (sc.ch == '"') {
+ if(IsStringSuffix(sc.chNext))
+ sc.Forward();
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_D_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_D_NUMBER);
+ numFloat = sc.ch == '.';
+ // Remember hex literal
+ numHex = sc.ch == '0' && ( sc.chNext == 'x' || sc.chNext == 'X' );
+ } else if ( (sc.ch == 'r' || sc.ch == 'x' || sc.ch == 'q')
+ && sc.chNext == '"' ) {
+ // Limited support for hex and delimited strings: parse as r""
+ sc.SetState(SCE_D_STRINGR);
+ sc.Forward();
+ } else if (IsWordStart(sc.ch) || sc.ch == '$') {
+ sc.SetState(SCE_D_IDENTIFIER);
+ } else if (sc.Match('/','+')) {
+ curNcLevel += 1;
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curNcLevel);
+ sc.SetState(SCE_D_COMMENTNESTED);
+ sc.Forward();
+ } else if (sc.Match('/', '*')) {
+ if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_D_COMMENTDOC);
+ } else {
+ sc.SetState(SCE_D_COMMENT);
+ }
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!"))
+ // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_D_COMMENTLINEDOC);
+ else
+ sc.SetState(SCE_D_COMMENTLINE);
+ } else if (sc.ch == '"') {
+ sc.SetState(SCE_D_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_D_CHARACTER);
+ } else if (sc.ch == '`') {
+ sc.SetState(SCE_D_STRINGB);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_D_OPERATOR);
+ if (sc.ch == '.' && sc.chNext == '.') sc.Forward(); // Range operator
+ }
+ }
+ }
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+
+void SCI_METHOD LexerD::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ bool foldAtElse = options.foldAtElseInt >= 0 ? options.foldAtElseInt != 0 : options.foldAtElse;
+ const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldComment && options.foldCommentExplicit && ((style == SCE_D_COMMENTLINE) || options.foldExplicitAnywhere)) {
+ if (userDefinedFoldMarkers) {
+ if (styler.Match(i, options.foldExplicitStart.c_str())) {
+ levelNext++;
+ } else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
+ levelNext--;
+ }
+ } else {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ }
+ if (options.foldSyntaxBased && (style == SCE_D_OPERATOR)) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (atEOL || (i == endPos-1)) {
+ if (options.foldComment && options.foldCommentMultiline) { // Handle nested comments
+ int nc;
+ nc = styler.GetLineState(lineCurrent);
+ nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0;
+ levelNext += nc;
+ }
+ int levelUse = levelCurrent;
+ if (options.foldSyntaxBased && foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ }
+}
+
+LexerModule lmD(SCLEX_D, LexerD::LexerFactoryD, "d", dWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMAP.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMAP.cxx
new file mode 100644
index 00000000000..431000a4e3f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMAP.cxx
@@ -0,0 +1,228 @@
+// Scintilla source code edit control
+/** @file LexDMAP.cxx
+ ** Lexer for MSC Nastran DMAP.
+ ** Written by Mark Robinson, based on the Fortran lexer by Chuan-jian Shen, Last changed Aug. 2013
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+/***************************************/
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+/***************************************/
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+/***************************************/
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/***********************************************/
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%');
+}
+/**********************************************/
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch));
+}
+/***************************************/
+static void ColouriseDMAPDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ /***************************************/
+ int posLineStart = 0, numNonBlank = 0;
+ int endPos = startPos + length;
+ /***************************************/
+ // backtrack to the nearest keyword
+ while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_DMAP_WORD)) {
+ startPos--;
+ }
+ startPos = styler.LineStart(styler.GetLine(startPos));
+ initStyle = styler.StyleAt(startPos - 1);
+ StyleContext sc(startPos, endPos-startPos, initStyle, styler);
+ /***************************************/
+ for (; sc.More(); sc.Forward()) {
+ // remember the start position of the line
+ if (sc.atLineStart) {
+ posLineStart = sc.currentPos;
+ numNonBlank = 0;
+ sc.SetState(SCE_DMAP_DEFAULT);
+ }
+ if (!IsASpaceOrTab(sc.ch)) numNonBlank ++;
+ /***********************************************/
+ // Handle data appearing after column 72; it is ignored
+ int toLineStart = sc.currentPos - posLineStart;
+ if (toLineStart >= 72 || sc.ch == '$') {
+ sc.SetState(SCE_DMAP_COMMENT);
+ while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
+ continue;
+ }
+ /***************************************/
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_DMAP_OPERATOR) {
+ sc.SetState(SCE_DMAP_DEFAULT);
+ } else if (sc.state == SCE_DMAP_NUMBER) {
+ if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) {
+ sc.SetState(SCE_DMAP_DEFAULT);
+ }
+ } else if (sc.state == SCE_DMAP_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) || (sc.ch == '%')) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_DMAP_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_DMAP_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_DMAP_WORD3);
+ }
+ sc.SetState(SCE_DMAP_DEFAULT);
+ }
+ } else if (sc.state == SCE_DMAP_COMMENT) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_DMAP_DEFAULT);
+ }
+ } else if (sc.state == SCE_DMAP_STRING1) {
+ if (sc.ch == '\'') {
+ if (sc.chNext == '\'') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_DMAP_DEFAULT);
+ }
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_DMAP_STRINGEOL);
+ sc.ForwardSetState(SCE_DMAP_DEFAULT);
+ }
+ } else if (sc.state == SCE_DMAP_STRING2) {
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_DMAP_STRINGEOL);
+ sc.ForwardSetState(SCE_DMAP_DEFAULT);
+ } else if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_DMAP_DEFAULT);
+ }
+ }
+ }
+ /***************************************/
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_DMAP_DEFAULT) {
+ if (sc.ch == '$') {
+ sc.SetState(SCE_DMAP_COMMENT);
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) || (sc.ch == '-' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_F_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_DMAP_IDENTIFIER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_DMAP_STRING2);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_DMAP_STRING1);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_DMAP_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+/***************************************/
+// To determine the folding level depending on keywords
+static int classifyFoldPointDMAP(const char* s, const char* prevWord) {
+ int lev = 0;
+ if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "enddo") == 0 || strcmp(s, "endif") == 0) {
+ lev = -1;
+ } else if ((strcmp(prevWord, "do") == 0 && strcmp(s, "while") == 0) || strcmp(s, "then") == 0) {
+ lev = 1;
+ }
+ return lev;
+}
+// Folding the code
+static void FoldDMAPDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ //
+ // bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ // Do not know how to fold the comment at the moment.
+ //
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ /***************************************/
+ int lastStart = 0;
+ char prevWord[32] = "";
+ /***************************************/
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ //
+ if ((stylePrev == SCE_DMAP_DEFAULT || stylePrev == SCE_DMAP_OPERATOR || stylePrev == SCE_DMAP_COMMENT) && (style == SCE_DMAP_WORD)) {
+ // Store last word and label start point.
+ lastStart = i;
+ }
+ /***************************************/
+ if (style == SCE_DMAP_WORD) {
+ if(iswordchar(ch) && !iswordchar(chNext)) {
+ char s[32];
+ unsigned int k;
+ for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
+ s[k] = static_cast<char>(tolower(styler[lastStart+k]));
+ }
+ s[k] = '\0';
+ levelCurrent += classifyFoldPointDMAP(s, prevWord);
+ strcpy(prevWord, s);
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ strcpy(prevWord, "");
+ }
+ /***************************************/
+ if (!isspacechar(ch)) visibleChars++;
+ }
+ /***************************************/
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+/***************************************/
+static const char * const DMAPWordLists[] = {
+ "Primary keywords and identifiers",
+ "Intrinsic functions",
+ "Extended and user defined functions",
+ 0,
+};
+/***************************************/
+LexerModule lmDMAP(SCLEX_DMAP, ColouriseDMAPDoc, "DMAP", FoldDMAPDoc, DMAPWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMIS.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMIS.cxx
new file mode 100644
index 00000000000..a903e9da654
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexDMIS.cxx
@@ -0,0 +1,355 @@
+// Scintilla source code edit control
+/** @file LexDMIS.cxx
+ ** Lexer for DMIS.
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// Copyright 2013-2014 by Andreas Tscharner <andy@vis.ethz.ch>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+
+#include <cstdlib>
+#include <cassert>
+#include <cstring>
+#include <cctype>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static const char *const DMISWordListDesc[] = {
+ "DMIS Major Words",
+ "DMIS Minor Words",
+ "Unsupported DMIS Major Words",
+ "Unsupported DMIS Minor Words",
+ "Keywords for code folding start",
+ "Corresponding keywords for code folding end",
+ 0
+};
+
+
+class LexerDMIS : public ILexer
+{
+ private:
+ char *m_wordListSets;
+ WordList m_majorWords;
+ WordList m_minorWords;
+ WordList m_unsupportedMajor;
+ WordList m_unsupportedMinor;
+ WordList m_codeFoldingStart;
+ WordList m_codeFoldingEnd;
+
+ char * SCI_METHOD UpperCase(char *item);
+ void SCI_METHOD InitWordListSets(void);
+
+ public:
+ LexerDMIS(void);
+ virtual ~LexerDMIS(void);
+
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+
+ void SCI_METHOD Release() {
+ delete this;
+ }
+
+ const char * SCI_METHOD PropertyNames() {
+ return NULL;
+ }
+
+ int SCI_METHOD PropertyType(const char *) {
+ return -1;
+ }
+
+ const char * SCI_METHOD DescribeProperty(const char *) {
+ return NULL;
+ }
+
+ int SCI_METHOD PropertySet(const char *, const char *) {
+ return -1;
+ }
+
+ int SCI_METHOD WordListSet(int n, const char *wl);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return NULL;
+ }
+
+ static ILexer *LexerFactoryDMIS() {
+ return new LexerDMIS;
+ }
+
+ const char * SCI_METHOD DescribeWordListSets();
+ void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+};
+
+
+char * SCI_METHOD LexerDMIS::UpperCase(char *item)
+{
+ char *itemStart;
+
+
+ itemStart = item;
+ while (item && *item) {
+ *item = toupper(*item);
+ item++;
+ };
+ return itemStart;
+}
+
+void SCI_METHOD LexerDMIS::InitWordListSets(void)
+{
+ size_t totalLen = 0;
+
+
+ for (int i=0; DMISWordListDesc[i]; i++) {
+ totalLen += strlen(DMISWordListDesc[i]);
+ totalLen++;
+ };
+
+ totalLen++;
+ this->m_wordListSets = new char[totalLen];
+ memset(this->m_wordListSets, 0, totalLen);
+
+ for (int i=0; DMISWordListDesc[i]; i++) {
+ strcat(this->m_wordListSets, DMISWordListDesc[i]);
+ strcat(this->m_wordListSets, "\n");
+ };
+}
+
+
+LexerDMIS::LexerDMIS(void) {
+ this->InitWordListSets();
+
+ this->m_majorWords.Clear();
+ this->m_minorWords.Clear();
+ this->m_unsupportedMajor.Clear();
+ this->m_unsupportedMinor.Clear();
+ this->m_codeFoldingStart.Clear();
+ this->m_codeFoldingEnd.Clear();
+}
+
+LexerDMIS::~LexerDMIS(void) {
+ delete[] this->m_wordListSets;
+}
+
+int SCI_METHOD LexerDMIS::WordListSet(int n, const char *wl)
+{
+ switch (n) {
+ case 0:
+ this->m_majorWords.Clear();
+ this->m_majorWords.Set(wl);
+ break;
+ case 1:
+ this->m_minorWords.Clear();
+ this->m_minorWords.Set(wl);
+ break;
+ case 2:
+ this->m_unsupportedMajor.Clear();
+ this->m_unsupportedMajor.Set(wl);
+ break;
+ case 3:
+ this->m_unsupportedMinor.Clear();
+ this->m_unsupportedMinor.Set(wl);
+ break;
+ case 4:
+ this->m_codeFoldingStart.Clear();
+ this->m_codeFoldingStart.Set(wl);
+ break;
+ case 5:
+ this->m_codeFoldingEnd.Clear();
+ this->m_codeFoldingEnd.Set(wl);
+ break;
+ default:
+ return -1;
+ break;
+ }
+
+ return 0;
+}
+
+const char * SCI_METHOD LexerDMIS::DescribeWordListSets()
+{
+ return this->m_wordListSets;
+}
+
+void SCI_METHOD LexerDMIS::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess)
+{
+ const unsigned int MAX_STR_LEN = 100;
+
+ LexAccessor styler(pAccess);
+ StyleContext scCTX(startPos, lengthDoc, initStyle, styler);
+ CharacterSet setDMISNumber(CharacterSet::setDigits, ".-+eE");
+ CharacterSet setDMISWordStart(CharacterSet::setAlpha, "-234", 0x80, true);
+ CharacterSet setDMISWord(CharacterSet::setAlpha);
+
+
+ bool isIFLine = false;
+
+ for (; scCTX.More(); scCTX.Forward()) {
+ if (scCTX.atLineEnd) {
+ isIFLine = false;
+ };
+
+ switch (scCTX.state) {
+ case SCE_DMIS_DEFAULT:
+ if (scCTX.Match('$', '$')) {
+ scCTX.SetState(SCE_DMIS_COMMENT);
+ scCTX.Forward();
+ };
+ if (scCTX.Match('\'')) {
+ scCTX.SetState(SCE_DMIS_STRING);
+ };
+ if (IsADigit(scCTX.ch) || ((scCTX.Match('-') || scCTX.Match('+')) && IsADigit(scCTX.chNext))) {
+ scCTX.SetState(SCE_DMIS_NUMBER);
+ break;
+ };
+ if (setDMISWordStart.Contains(scCTX.ch)) {
+ scCTX.SetState(SCE_DMIS_KEYWORD);
+ };
+ if (scCTX.Match('(') && (!isIFLine)) {
+ scCTX.SetState(SCE_DMIS_LABEL);
+ };
+ break;
+
+ case SCE_DMIS_COMMENT:
+ if (scCTX.atLineEnd) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_STRING:
+ if (scCTX.Match('\'')) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_NUMBER:
+ if (!setDMISNumber.Contains(scCTX.ch)) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+
+ case SCE_DMIS_KEYWORD:
+ if (!setDMISWord.Contains(scCTX.ch)) {
+ char tmpStr[MAX_STR_LEN];
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+ scCTX.GetCurrent(tmpStr, (MAX_STR_LEN-1));
+ strncpy(tmpStr, this->UpperCase(tmpStr), (MAX_STR_LEN-1));
+
+ if (this->m_minorWords.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_MINORWORD);
+ };
+ if (this->m_majorWords.InList(tmpStr)) {
+ isIFLine = (strcmp(tmpStr, "IF") == 0);
+ scCTX.ChangeState(SCE_DMIS_MAJORWORD);
+ };
+ if (this->m_unsupportedMajor.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MAJOR);
+ };
+ if (this->m_unsupportedMinor.InList(tmpStr)) {
+ scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MINOR);
+ };
+
+ if (scCTX.Match('(') && (!isIFLine)) {
+ scCTX.SetState(SCE_DMIS_LABEL);
+ } else {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ };
+ break;
+
+ case SCE_DMIS_LABEL:
+ if (scCTX.Match(')')) {
+ scCTX.SetState(SCE_DMIS_DEFAULT);
+ };
+ break;
+ };
+ };
+ scCTX.Complete();
+}
+
+void SCI_METHOD LexerDMIS::Fold(unsigned int startPos, int lengthDoc, int, IDocument *pAccess)
+{
+ const int MAX_STR_LEN = 100;
+
+ LexAccessor styler(pAccess);
+ unsigned int endPos = startPos + lengthDoc;
+ char chNext = styler[startPos];
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ int strPos = 0;
+ bool foldWordPossible = false;
+ CharacterSet setDMISFoldWord(CharacterSet::setAlpha);
+ char *tmpStr;
+
+
+ tmpStr = new char[MAX_STR_LEN];
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+
+ for (unsigned int i=startPos; i<endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i+1);
+
+ bool atEOL = ((ch == '\r' && chNext != '\n') || (ch == '\n'));
+
+ if (strPos >= (MAX_STR_LEN-1)) {
+ strPos = MAX_STR_LEN-1;
+ };
+
+ int style = styler.StyleAt(i);
+ bool noFoldPos = ((style == SCE_DMIS_COMMENT) || (style == SCE_DMIS_STRING));
+
+ if (foldWordPossible) {
+ if (setDMISFoldWord.Contains(ch)) {
+ tmpStr[strPos++] = ch;
+ } else {
+ tmpStr = this->UpperCase(tmpStr);
+ if (this->m_codeFoldingStart.InList(tmpStr) && (!noFoldPos)) {
+ levelCurrent++;
+ };
+ if (this->m_codeFoldingEnd.InList(tmpStr) && (!noFoldPos)) {
+ levelCurrent--;
+ };
+ memset(tmpStr, 0, MAX_STR_LEN*sizeof(char));
+ strPos = 0;
+ foldWordPossible = false;
+ };
+ } else {
+ if (setDMISFoldWord.Contains(ch)) {
+ tmpStr[strPos++] = ch;
+ foldWordPossible = true;
+ };
+ };
+
+ if (atEOL || (i == (endPos-1))) {
+ int lev = levelPrev;
+
+ if (levelCurrent > levelPrev) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ };
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ };
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ };
+ };
+ delete[] tmpStr;
+}
+
+
+LexerModule lmDMIS(SCLEX_DMIS, LexerDMIS::LexerFactoryDMIS, "DMIS", DMISWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexECL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexECL.cxx
new file mode 100644
index 00000000000..d8065f72265
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexECL.cxx
@@ -0,0 +1,521 @@
+// Scintilla source code edit control
+/** @file LexECL.cxx
+ ** Lexer for ECL.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786)
+#endif
+#ifdef __BORLANDC__
+// Borland C++ displays warnings in vector header without this
+#pragma option -w-ccc -w-rch
+#endif
+
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#define SET_LOWER "abcdefghijklmnopqrstuvwxyz"
+#define SET_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define SET_DIGITS "0123456789"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static bool IsSpaceEquiv(int state) {
+ switch (state) {
+ case SCE_ECL_DEFAULT:
+ case SCE_ECL_COMMENT:
+ case SCE_ECL_COMMENTLINE:
+ case SCE_ECL_COMMENTLINEDOC:
+ case SCE_ECL_COMMENTDOCKEYWORD:
+ case SCE_ECL_COMMENTDOCKEYWORDERROR:
+ case SCE_ECL_COMMENTDOC:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+static void ColouriseEclDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ WordList &keywords0 = *keywordlists[0];
+ WordList &keywords1 = *keywordlists[1];
+ WordList &keywords2 = *keywordlists[2];
+ WordList &keywords3 = *keywordlists[3]; //Value Types
+ WordList &keywords4 = *keywordlists[4];
+ WordList &keywords5 = *keywordlists[5];
+ WordList &keywords6 = *keywordlists[6]; //Javadoc Tags
+ WordList cplusplus;
+ cplusplus.Set("beginc endc");
+
+ bool stylingWithinPreprocessor = false;
+
+ CharacterSet setOKBeforeRE(CharacterSet::setNone, "(=,");
+ CharacterSet setDoxygen(CharacterSet::setLower, "$@\\&<>#{}[]");
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
+ CharacterSet setQualified(CharacterSet::setNone, "uUxX");
+
+ int chPrevNonWhite = ' ';
+ int visibleChars = 0;
+ bool lastWordWasUUID = false;
+ int styleBeforeDCKeyword = SCE_ECL_DEFAULT;
+ bool continuationLine = false;
+
+ if (initStyle == SCE_ECL_PREPROCESSOR) {
+ // Set continuationLine if last character of previous line is '\'
+ int lineCurrent = styler.GetLine(startPos);
+ if (lineCurrent > 0) {
+ int chBack = styler.SafeGetCharAt(startPos-1, 0);
+ int chBack2 = styler.SafeGetCharAt(startPos-2, 0);
+ int lineEndChar = '!';
+ if (chBack2 == '\r' && chBack == '\n') {
+ lineEndChar = styler.SafeGetCharAt(startPos-3, 0);
+ } else if (chBack == '\n' || chBack == '\r') {
+ lineEndChar = chBack2;
+ }
+ continuationLine = lineEndChar == '\\';
+ }
+ }
+
+ // look back to set chPrevNonWhite properly for better regex colouring
+ if (startPos > 0) {
+ int back = startPos;
+ while (--back && IsSpaceEquiv(styler.StyleAt(back)))
+ ;
+ if (styler.StyleAt(back) == SCE_ECL_OPERATOR) {
+ chPrevNonWhite = styler.SafeGetCharAt(back);
+ }
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineStart) {
+ if (sc.state == SCE_ECL_STRING) {
+ // Prevent SCE_ECL_STRINGEOL from leaking back to previous line which
+ // ends with a line continuation by locking in the state upto this position.
+ sc.SetState(SCE_ECL_STRING);
+ }
+ // Reset states to begining of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ lastWordWasUUID = false;
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continuationLine = true;
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_ECL_ADDED:
+ case SCE_ECL_DELETED:
+ case SCE_ECL_CHANGED:
+ case SCE_ECL_MOVED:
+ if (sc.atLineStart)
+ sc.SetState(SCE_ECL_DEFAULT);
+ break;
+ case SCE_ECL_OPERATOR:
+ sc.SetState(SCE_ECL_DEFAULT);
+ break;
+ case SCE_ECL_NUMBER:
+ // We accept almost anything because of hex. and number suffixes
+ if (!setWord.Contains(sc.ch)) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_IDENTIFIER:
+ if (!setWord.Contains(sc.ch) || (sc.ch == '.')) {
+ char s[1000];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords0.InList(s)) {
+ lastWordWasUUID = strcmp(s, "uuid") == 0;
+ sc.ChangeState(SCE_ECL_WORD0);
+ } else if (keywords1.InList(s)) {
+ sc.ChangeState(SCE_ECL_WORD1);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_ECL_WORD2);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_ECL_WORD4);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_ECL_WORD5);
+ }
+ else //Data types are of from KEYWORD##
+ {
+ int i = static_cast<int>(strlen(s)) - 1;
+ while(i >= 0 && (isdigit(s[i]) || s[i] == '_'))
+ --i;
+
+ char s2[1000];
+ strncpy(s2, s, i + 1);
+ s2[i + 1] = 0;
+ if (keywords3.InList(s2)) {
+ sc.ChangeState(SCE_ECL_WORD3);
+ }
+ }
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_PREPROCESSOR:
+ if (sc.atLineStart && !continuationLine) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ } else if (stylingWithinPreprocessor) {
+ if (IsASpace(sc.ch)) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ } else {
+ if (sc.Match('/', '*') || sc.Match('/', '/')) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_ECL_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_COMMENTDOC:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_ECL_COMMENTDOC;
+ sc.SetState(SCE_ECL_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_ECL_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_COMMENTLINEDOC:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_ECL_COMMENTLINEDOC;
+ sc.SetState(SCE_ECL_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_ECL_COMMENTDOCKEYWORD:
+ if ((styleBeforeDCKeyword == SCE_ECL_COMMENTDOC) && sc.Match('*', '/')) {
+ sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR);
+ sc.Forward();
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ } else if (!setDoxygen.Contains(sc.ch)) {
+ char s[1000];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (!IsASpace(sc.ch) || !keywords6.InList(s+1)) {
+ sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR);
+ }
+ sc.SetState(styleBeforeDCKeyword);
+ }
+ break;
+ case SCE_ECL_STRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ECL_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_CHARACTER:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_ECL_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_REGEX:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ } else if (sc.ch == '/') {
+ sc.Forward();
+ while ((sc.ch < 0x80) && islower(sc.ch))
+ sc.Forward(); // gobble regex flags
+ sc.SetState(SCE_ECL_DEFAULT);
+ } else if (sc.ch == '\\') {
+ // Gobble up the quoted character
+ if (sc.chNext == '\\' || sc.chNext == '/') {
+ sc.Forward();
+ }
+ }
+ break;
+ case SCE_ECL_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ case SCE_ECL_VERBATIM:
+ if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_ECL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_ECL_UUID:
+ if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ int lineCurrent = styler.GetLine(sc.currentPos);
+ int lineState = styler.GetLineState(lineCurrent);
+ if (sc.state == SCE_ECL_DEFAULT) {
+ if (lineState) {
+ sc.SetState(lineState);
+ }
+ else if (sc.Match('@', '\"')) {
+ sc.SetState(SCE_ECL_VERBATIM);
+ sc.Forward();
+ } else if (setQualified.Contains(sc.ch) && sc.chNext == '\'') {
+ sc.SetState(SCE_ECL_CHARACTER);
+ sc.Forward();
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ if (lastWordWasUUID) {
+ sc.SetState(SCE_ECL_UUID);
+ lastWordWasUUID = false;
+ } else {
+ sc.SetState(SCE_ECL_NUMBER);
+ }
+ } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
+ if (lastWordWasUUID) {
+ sc.SetState(SCE_ECL_UUID);
+ lastWordWasUUID = false;
+ } else {
+ sc.SetState(SCE_ECL_IDENTIFIER);
+ }
+ } else if (sc.Match('/', '*')) {
+ if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_ECL_COMMENTDOC);
+ } else {
+ sc.SetState(SCE_ECL_COMMENT);
+ }
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!"))
+ // Support of Qt/Doxygen doc. style
+ sc.SetState(SCE_ECL_COMMENTLINEDOC);
+ else
+ sc.SetState(SCE_ECL_COMMENTLINE);
+ } else if (sc.ch == '/' && setOKBeforeRE.Contains(chPrevNonWhite)) {
+ sc.SetState(SCE_ECL_REGEX); // JavaScript's RegEx
+// } else if (sc.ch == '\"') {
+// sc.SetState(SCE_ECL_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_ECL_CHARACTER);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ // Preprocessor commands are alone on their line
+ sc.SetState(SCE_ECL_PREPROCESSOR);
+ // Skip whitespace between # and preprocessor word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_ECL_DEFAULT);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_ECL_OPERATOR);
+ }
+ }
+
+ if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) {
+ chPrevNonWhite = sc.ch;
+ visibleChars++;
+ }
+ continuationLine = false;
+ }
+ sc.Complete();
+
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_ECL_COMMENT ||
+ style == SCE_ECL_COMMENTDOC ||
+ style == SCE_ECL_COMMENTDOCKEYWORD ||
+ style == SCE_ECL_COMMENTDOCKEYWORDERROR;
+}
+
+bool MatchNoCase(Accessor & styler, unsigned int & pos, const char *s) {
+ int i=0;
+ for (; *s; i++) {
+ char compare_char = tolower(*s);
+ char styler_char = tolower(styler.SafeGetCharAt(pos+i));
+ if (compare_char != styler_char)
+ return false;
+ s++;
+ }
+ pos+=i-1;
+ return true;
+}
+
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldEclDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ bool foldComment = true;
+ bool foldPreprocessor = true;
+ bool foldCompact = true;
+ bool foldAtElse = true;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_ECL_COMMENTLINEDOC)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_ECL_COMMENTLINEDOC) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (foldComment && (style == SCE_ECL_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ if (foldPreprocessor && (style == SCE_ECL_PREPROCESSOR)) {
+ if (ch == '#') {
+ unsigned int j = i + 1;
+ while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (MatchNoCase(styler, j, "region") || MatchNoCase(styler, j, "if")) {
+ levelNext++;
+ } else if (MatchNoCase(styler, j, "endregion") || MatchNoCase(styler, j, "end")) {
+ levelNext--;
+ }
+ }
+ }
+ if (style == SCE_ECL_OPERATOR) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (style == SCE_ECL_WORD2) {
+ if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") ||
+ MatchNoCase(styler, i, "module") || MatchNoCase(styler, i, "service") || MatchNoCase(styler, i, "interface") || MatchNoCase(styler, i, "ifblock") ||
+ MatchNoCase(styler, i, "macro") || MatchNoCase(styler, i, "beginc++")) {
+ levelNext++;
+ } else if (MatchNoCase(styler, i, "endmacro") || MatchNoCase(styler, i, "endc++") || MatchNoCase(styler, i, "end")) {
+ levelNext--;
+ }
+ }
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
+ visibleChars = 0;
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ }
+}
+
+static const char * const EclWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmECL(
+ SCLEX_ECL,
+ ColouriseEclDoc,
+ "ecl",
+ FoldEclDoc,
+ EclWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEScript.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEScript.cxx
new file mode 100644
index 00000000000..28466bc8e0b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEScript.cxx
@@ -0,0 +1,276 @@
+// Scintilla source code edit control
+/** @file LexESCRIPT.cxx
+ ** Lexer for ESCRIPT
+ **/
+// Copyright 2003 by Patrizio Bekerle (patrizio@bekerle.com)
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+
+
+static void ColouriseESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+
+ // Do not leak onto next line
+ /*if (initStyle == SCE_ESCRIPT_STRINGEOL)
+ initStyle = SCE_ESCRIPT_DEFAULT;*/
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ bool caseSensitive = styler.GetPropertyInt("escript.case.sensitive", 0) != 0;
+
+ for (; sc.More(); sc.Forward()) {
+
+ /*if (sc.atLineStart && (sc.state == SCE_ESCRIPT_STRING)) {
+ // Prevent SCE_ESCRIPT_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_ESCRIPT_STRING);
+ }*/
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_ESCRIPT_OPERATOR || sc.state == SCE_ESCRIPT_BRACE) {
+ sc.SetState(SCE_ESCRIPT_DEFAULT);
+ } else if (sc.state == SCE_ESCRIPT_NUMBER) {
+ if (!IsADigit(sc.ch) || sc.ch != '.') {
+ sc.SetState(SCE_ESCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_ESCRIPT_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
+ char s[100];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+
+// sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_ESCRIPT_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_ESCRIPT_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_ESCRIPT_WORD3);
+ // sc.state = SCE_ESCRIPT_IDENTIFIER;
+ }
+ sc.SetState(SCE_ESCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_ESCRIPT_COMMENT) {
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_ESCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_ESCRIPT_COMMENTDOC) {
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_ESCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_ESCRIPT_COMMENTLINE) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_ESCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_ESCRIPT_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_ESCRIPT_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_ESCRIPT_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_ESCRIPT_NUMBER);
+ } else if (IsAWordStart(sc.ch) || (sc.ch == '#')) {
+ sc.SetState(SCE_ESCRIPT_IDENTIFIER);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_ESCRIPT_COMMENT);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_ESCRIPT_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_ESCRIPT_STRING);
+ //} else if (isoperator(static_cast<char>(sc.ch))) {
+ } else if (sc.ch == '+' || sc.ch == '-' || sc.ch == '*' || sc.ch == '/' || sc.ch == '=' || sc.ch == '<' || sc.ch == '>' || sc.ch == '&' || sc.ch == '|' || sc.ch == '!' || sc.ch == '?' || sc.ch == ':') {
+ sc.SetState(SCE_ESCRIPT_OPERATOR);
+ } else if (sc.ch == '{' || sc.ch == '}') {
+ sc.SetState(SCE_ESCRIPT_BRACE);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+
+static int classifyFoldPointESCRIPT(const char* s, const char* prevWord) {
+ int lev = 0;
+ if (strcmp(prevWord, "end") == 0) return lev;
+ if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0)
+ return -1;
+
+ if (strcmp(s, "for") == 0 || strcmp(s, "foreach") == 0
+ || strcmp(s, "program") == 0 || strcmp(s, "function") == 0
+ || strcmp(s, "while") == 0 || strcmp(s, "case") == 0
+ || strcmp(s, "if") == 0 ) {
+ lev = 1;
+ } else if ( strcmp(s, "endfor") == 0 || strcmp(s, "endforeach") == 0
+ || strcmp(s, "endprogram") == 0 || strcmp(s, "endfunction") == 0
+ || strcmp(s, "endwhile") == 0 || strcmp(s, "endcase") == 0
+ || strcmp(s, "endif") == 0 ) {
+ lev = -1;
+ }
+
+ return lev;
+}
+
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_ESCRIPT_COMMENT ||
+ style == SCE_ESCRIPT_COMMENTDOC ||
+ style == SCE_ESCRIPT_COMMENTLINE;
+}
+
+static void FoldESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) {
+ //~ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ // Do not know how to fold the comment at the moment.
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldComment = true;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+
+ int lastStart = 0;
+ char prevWord[32] = "";
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelCurrent++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (foldComment && (style == SCE_ESCRIPT_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelCurrent++;
+ } else if (chNext2 == '}') {
+ levelCurrent--;
+ }
+ }
+ }
+
+ if (stylePrev == SCE_ESCRIPT_DEFAULT && style == SCE_ESCRIPT_WORD3)
+ {
+ // Store last word start point.
+ lastStart = i;
+ }
+
+ if (style == SCE_ESCRIPT_WORD3) {
+ if(iswordchar(ch) && !iswordchar(chNext)) {
+ char s[32];
+ unsigned int j;
+ for(j = 0; ( j < 31 ) && ( j < i-lastStart+1 ); j++) {
+ s[j] = static_cast<char>(tolower(styler[lastStart + j]));
+ }
+ s[j] = '\0';
+ levelCurrent += classifyFoldPointESCRIPT(s, prevWord);
+ strcpy(prevWord, s);
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ strcpy(prevWord, "");
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+
+
+static const char * const ESCRIPTWordLists[] = {
+ "Primary keywords and identifiers",
+ "Intrinsic functions",
+ "Extended and user defined functions",
+ 0,
+};
+
+LexerModule lmESCRIPT(SCLEX_ESCRIPT, ColouriseESCRIPTDoc, "escript", FoldESCRIPTDoc, ESCRIPTWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEiffel.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEiffel.cxx
new file mode 100644
index 00000000000..067801ca8d3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexEiffel.cxx
@@ -0,0 +1,241 @@
+// Scintilla source code edit control
+/** @file LexEiffel.cxx
+ ** Lexer for Eiffel.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool isEiffelOperator(unsigned int ch) {
+ // '.' left out as it is used to make up numbers
+ return ch == '*' || ch == '/' || ch == '\\' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' ||
+ ch == '{' || ch == '}' || ch == '~' ||
+ ch == '[' || ch == ']' || ch == ';' ||
+ ch == '<' || ch == '>' || ch == ',' ||
+ ch == '.' || ch == '^' || ch == '%' || ch == ':' ||
+ ch == '!' || ch == '@' || ch == '?';
+}
+
+static inline bool IsAWordChar(unsigned int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(unsigned int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static void ColouriseEiffelDoc(unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.state == SCE_EIFFEL_STRINGEOL) {
+ if (sc.ch != '\r' && sc.ch != '\n') {
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ } else if (sc.state == SCE_EIFFEL_OPERATOR) {
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ } else if (sc.state == SCE_EIFFEL_WORD) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (!keywords.InList(s)) {
+ sc.ChangeState(SCE_EIFFEL_IDENTIFIER);
+ }
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ } else if (sc.state == SCE_EIFFEL_NUMBER) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ } else if (sc.state == SCE_EIFFEL_COMMENTLINE) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ } else if (sc.state == SCE_EIFFEL_STRING) {
+ if (sc.ch == '%') {
+ sc.Forward();
+ } else if (sc.ch == '\"') {
+ sc.Forward();
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ } else if (sc.state == SCE_EIFFEL_CHARACTER) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_EIFFEL_STRINGEOL);
+ } else if (sc.ch == '%') {
+ sc.Forward();
+ } else if (sc.ch == '\'') {
+ sc.Forward();
+ sc.SetState(SCE_EIFFEL_DEFAULT);
+ }
+ }
+
+ if (sc.state == SCE_EIFFEL_DEFAULT) {
+ if (sc.ch == '-' && sc.chNext == '-') {
+ sc.SetState(SCE_EIFFEL_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_EIFFEL_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_EIFFEL_CHARACTER);
+ } else if (IsADigit(sc.ch) || (sc.ch == '.')) {
+ sc.SetState(SCE_EIFFEL_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_EIFFEL_WORD);
+ } else if (isEiffelOperator(sc.ch)) {
+ sc.SetState(SCE_EIFFEL_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static bool IsEiffelComment(Accessor &styler, int pos, int len) {
+ return len>1 && styler[pos]=='-' && styler[pos+1]=='-';
+}
+
+static void FoldEiffelDocIndent(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler) {
+ int lengthDoc = startPos + length;
+
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+ int spaceFlags = 0;
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsEiffelComment);
+ char chNext = styler[startPos];
+ for (int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) {
+ int lev = indentCurrent;
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsEiffelComment);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ // Only non whitespace lines can be headers
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
+ // Line after is blank so check the next - maybe should continue further?
+ int spaceFlags2 = 0;
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsEiffelComment);
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ }
+ indentCurrent = indentNext;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ }
+ }
+}
+
+static void FoldEiffelDocKeyWords(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int stylePrev = 0;
+ int styleNext = styler.StyleAt(startPos);
+ // lastDeferred should be determined by looking back to last keyword in case
+ // the "deferred" is on a line before "class"
+ bool lastDeferred = false;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if ((stylePrev != SCE_EIFFEL_WORD) && (style == SCE_EIFFEL_WORD)) {
+ char s[20];
+ unsigned int j = 0;
+ while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) {
+ s[j] = styler[i + j];
+ j++;
+ }
+ s[j] = '\0';
+
+ if (
+ (strcmp(s, "check") == 0) ||
+ (strcmp(s, "debug") == 0) ||
+ (strcmp(s, "deferred") == 0) ||
+ (strcmp(s, "do") == 0) ||
+ (strcmp(s, "from") == 0) ||
+ (strcmp(s, "if") == 0) ||
+ (strcmp(s, "inspect") == 0) ||
+ (strcmp(s, "once") == 0)
+ )
+ levelCurrent++;
+ if (!lastDeferred && (strcmp(s, "class") == 0))
+ levelCurrent++;
+ if (strcmp(s, "end") == 0)
+ levelCurrent--;
+ lastDeferred = strcmp(s, "deferred") == 0;
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ stylePrev = style;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const eiffelWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent, eiffelWordListDesc);
+LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords, eiffelWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexErlang.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexErlang.cxx
new file mode 100644
index 00000000000..5f52258594f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexErlang.cxx
@@ -0,0 +1,623 @@
+// Scintilla source code edit control
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+/** @file LexErlang.cxx
+ ** Lexer for Erlang.
+ ** Enhanced by Etienne 'Lenain' Girondel (lenaing@gmail.com)
+ ** Originally wrote by Peter-Henry Mander,
+ ** based on Matlab lexer by José Fonseca.
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static int is_radix(int radix, int ch) {
+ int digit;
+
+ if (36 < radix || 2 > radix)
+ return 0;
+
+ if (isdigit(ch)) {
+ digit = ch - '0';
+ } else if (isalnum(ch)) {
+ digit = toupper(ch) - 'A' + 10;
+ } else {
+ return 0;
+ }
+
+ return (digit < radix);
+}
+
+typedef enum {
+ STATE_NULL,
+ COMMENT,
+ COMMENT_FUNCTION,
+ COMMENT_MODULE,
+ COMMENT_DOC,
+ COMMENT_DOC_MACRO,
+ ATOM_UNQUOTED,
+ ATOM_QUOTED,
+ NODE_NAME_UNQUOTED,
+ NODE_NAME_QUOTED,
+ MACRO_START,
+ MACRO_UNQUOTED,
+ MACRO_QUOTED,
+ RECORD_START,
+ RECORD_UNQUOTED,
+ RECORD_QUOTED,
+ NUMERAL_START,
+ NUMERAL_BASE_VALUE,
+ NUMERAL_FLOAT,
+ NUMERAL_EXPONENT,
+ PREPROCESSOR
+} atom_parse_state_t;
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (ch != ' ') && (isalnum(ch) || ch == '_');
+}
+
+static void ColouriseErlangDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ WordList &reservedWords = *keywordlists[0];
+ WordList &erlangBIFs = *keywordlists[1];
+ WordList &erlangPreproc = *keywordlists[2];
+ WordList &erlangModulesAtt = *keywordlists[3];
+ WordList &erlangDoc = *keywordlists[4];
+ WordList &erlangDocMacro = *keywordlists[5];
+ int radix_digits = 0;
+ int exponent_digits = 0;
+ atom_parse_state_t parse_state = STATE_NULL;
+ atom_parse_state_t old_parse_state = STATE_NULL;
+ bool to_late_to_comment = false;
+ char cur[100];
+ int old_style = SCE_ERLANG_DEFAULT;
+
+ styler.StartAt(startPos);
+
+ for (; sc.More(); sc.Forward()) {
+ int style = SCE_ERLANG_DEFAULT;
+ if (STATE_NULL != parse_state) {
+
+ switch (parse_state) {
+
+ case STATE_NULL : sc.SetState(SCE_ERLANG_DEFAULT); break;
+
+ /* COMMENTS ------------------------------------------------------*/
+ case COMMENT : {
+ if (sc.ch != '%') {
+ to_late_to_comment = true;
+ } else if (!to_late_to_comment && sc.ch == '%') {
+ // Switch to comment level 2 (Function)
+ sc.ChangeState(SCE_ERLANG_COMMENT_FUNCTION);
+ old_style = SCE_ERLANG_COMMENT_FUNCTION;
+ parse_state = COMMENT_FUNCTION;
+ sc.Forward();
+ }
+ }
+ // V--- Falling through!
+ case COMMENT_FUNCTION : {
+ if (sc.ch != '%') {
+ to_late_to_comment = true;
+ } else if (!to_late_to_comment && sc.ch == '%') {
+ // Switch to comment level 3 (Module)
+ sc.ChangeState(SCE_ERLANG_COMMENT_MODULE);
+ old_style = SCE_ERLANG_COMMENT_MODULE;
+ parse_state = COMMENT_MODULE;
+ sc.Forward();
+ }
+ }
+ // V--- Falling through!
+ case COMMENT_MODULE : {
+ if (parse_state != COMMENT) {
+ // Search for comment documentation
+ if (sc.chNext == '@') {
+ old_parse_state = parse_state;
+ parse_state = ('{' == sc.ch)
+ ? COMMENT_DOC_MACRO
+ : COMMENT_DOC;
+ sc.ForwardSetState(sc.state);
+ }
+ }
+
+ // All comments types fall here.
+ if (sc.atLineEnd) {
+ to_late_to_comment = false;
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case COMMENT_DOC :
+ // V--- Falling through!
+ case COMMENT_DOC_MACRO : {
+
+ if (!isalnum(sc.ch)) {
+ // Try to match documentation comment
+ sc.GetCurrent(cur, sizeof(cur));
+
+ if (parse_state == COMMENT_DOC_MACRO
+ && erlangDocMacro.InList(cur)) {
+ sc.ChangeState(SCE_ERLANG_COMMENT_DOC_MACRO);
+ while (sc.ch != '}' && !sc.atLineEnd)
+ sc.Forward();
+ } else if (erlangDoc.InList(cur)) {
+ sc.ChangeState(SCE_ERLANG_COMMENT_DOC);
+ } else {
+ sc.ChangeState(old_style);
+ }
+
+ // Switch back to old state
+ sc.SetState(old_style);
+ parse_state = old_parse_state;
+ }
+
+ if (sc.atLineEnd) {
+ to_late_to_comment = false;
+ sc.ChangeState(old_style);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Atoms ---------------------------------------------------------*/
+ case ATOM_UNQUOTED : {
+ if ('@' == sc.ch){
+ parse_state = NODE_NAME_UNQUOTED;
+ } else if (sc.ch == ':') {
+ // Searching for module name
+ if (sc.chNext == ' ') {
+ // error
+ sc.ChangeState(SCE_ERLANG_UNKNOWN);
+ parse_state = STATE_NULL;
+ } else {
+ sc.Forward();
+ if (isalnum(sc.ch)) {
+ sc.GetCurrent(cur, sizeof(cur));
+ sc.ChangeState(SCE_ERLANG_MODULES);
+ sc.SetState(SCE_ERLANG_MODULES);
+ }
+ }
+ } else if (!IsAWordChar(sc.ch)) {
+
+ sc.GetCurrent(cur, sizeof(cur));
+ if (reservedWords.InList(cur)) {
+ style = SCE_ERLANG_KEYWORD;
+ } else if (erlangBIFs.InList(cur)
+ && strcmp(cur,"erlang:")){
+ style = SCE_ERLANG_BIFS;
+ } else if (sc.ch == '(' || '/' == sc.ch){
+ style = SCE_ERLANG_FUNCTION_NAME;
+ } else {
+ style = SCE_ERLANG_ATOM;
+ }
+
+ sc.ChangeState(style);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+
+ } break;
+
+ case ATOM_QUOTED : {
+ if ( '@' == sc.ch ){
+ parse_state = NODE_NAME_QUOTED;
+ } else if ('\'' == sc.ch && '\\' != sc.chPrev) {
+ sc.ChangeState(SCE_ERLANG_ATOM);
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Node names ----------------------------------------------------*/
+ case NODE_NAME_UNQUOTED : {
+ if ('@' == sc.ch) {
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ } else if (!IsAWordChar(sc.ch)) {
+ sc.ChangeState(SCE_ERLANG_NODE_NAME);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case NODE_NAME_QUOTED : {
+ if ('@' == sc.ch) {
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ } else if ('\'' == sc.ch && '\\' != sc.chPrev) {
+ sc.ChangeState(SCE_ERLANG_NODE_NAME_QUOTED);
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Records -------------------------------------------------------*/
+ case RECORD_START : {
+ if ('\'' == sc.ch) {
+ parse_state = RECORD_QUOTED;
+ } else if (isalpha(sc.ch) && islower(sc.ch)) {
+ parse_state = RECORD_UNQUOTED;
+ } else { // error
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case RECORD_UNQUOTED : {
+ if (!IsAWordChar(sc.ch)) {
+ sc.ChangeState(SCE_ERLANG_RECORD);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case RECORD_QUOTED : {
+ if ('\'' == sc.ch && '\\' != sc.chPrev) {
+ sc.ChangeState(SCE_ERLANG_RECORD_QUOTED);
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Macros --------------------------------------------------------*/
+ case MACRO_START : {
+ if ('\'' == sc.ch) {
+ parse_state = MACRO_QUOTED;
+ } else if (isalpha(sc.ch)) {
+ parse_state = MACRO_UNQUOTED;
+ } else { // error
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case MACRO_UNQUOTED : {
+ if (!IsAWordChar(sc.ch)) {
+ sc.ChangeState(SCE_ERLANG_MACRO);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ case MACRO_QUOTED : {
+ if ('\'' == sc.ch && '\\' != sc.chPrev) {
+ sc.ChangeState(SCE_ERLANG_MACRO_QUOTED);
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Numerics ------------------------------------------------------*/
+ /* Simple integer */
+ case NUMERAL_START : {
+ if (isdigit(sc.ch)) {
+ radix_digits *= 10;
+ radix_digits += sc.ch - '0'; // Assuming ASCII here!
+ } else if ('#' == sc.ch) {
+ if (2 > radix_digits || 36 < radix_digits) {
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ } else {
+ parse_state = NUMERAL_BASE_VALUE;
+ }
+ } else if ('.' == sc.ch && isdigit(sc.chNext)) {
+ radix_digits = 0;
+ parse_state = NUMERAL_FLOAT;
+ } else if ('e' == sc.ch || 'E' == sc.ch) {
+ exponent_digits = 0;
+ parse_state = NUMERAL_EXPONENT;
+ } else {
+ radix_digits = 0;
+ sc.ChangeState(SCE_ERLANG_NUMBER);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* Integer in other base than 10 (x#yyy) */
+ case NUMERAL_BASE_VALUE : {
+ if (!is_radix(radix_digits,sc.ch)) {
+ radix_digits = 0;
+
+ if (!isalnum(sc.ch))
+ sc.ChangeState(SCE_ERLANG_NUMBER);
+
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* Float (x.yyy) */
+ case NUMERAL_FLOAT : {
+ if ('e' == sc.ch || 'E' == sc.ch) {
+ exponent_digits = 0;
+ parse_state = NUMERAL_EXPONENT;
+ } else if (!isdigit(sc.ch)) {
+ sc.ChangeState(SCE_ERLANG_NUMBER);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ /* Exponent, either integer or float (xEyy, x.yyEzzz) */
+ case NUMERAL_EXPONENT : {
+ if (('-' == sc.ch || '+' == sc.ch)
+ && (isdigit(sc.chNext))) {
+ sc.Forward();
+ } else if (!isdigit(sc.ch)) {
+ if (0 < exponent_digits)
+ sc.ChangeState(SCE_ERLANG_NUMBER);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ } else {
+ ++exponent_digits;
+ }
+ } break;
+
+ /* -------------------------------------------------------------- */
+ /* Preprocessor --------------------------------------------------*/
+ case PREPROCESSOR : {
+ if (!IsAWordChar(sc.ch)) {
+
+ sc.GetCurrent(cur, sizeof(cur));
+ if (erlangPreproc.InList(cur)) {
+ style = SCE_ERLANG_PREPROC;
+ } else if (erlangModulesAtt.InList(cur)) {
+ style = SCE_ERLANG_MODULES_ATT;
+ }
+
+ sc.ChangeState(style);
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ parse_state = STATE_NULL;
+ }
+ } break;
+
+ }
+
+ } /* End of : STATE_NULL != parse_state */
+ else
+ {
+ switch (sc.state) {
+ case SCE_ERLANG_VARIABLE : {
+ if (!IsAWordChar(sc.ch))
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ } break;
+ case SCE_ERLANG_STRING : {
+ if (sc.ch == '\"' && sc.chPrev != '\\')
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ } break;
+ case SCE_ERLANG_COMMENT : {
+ if (sc.atLineEnd)
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ } break;
+ case SCE_ERLANG_CHARACTER : {
+ if (sc.chPrev == '\\') {
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ } else if (sc.ch != '\\') {
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ }
+ } break;
+ case SCE_ERLANG_OPERATOR : {
+ if (sc.chPrev == '.') {
+ if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\'
+ || sc.ch == '^') {
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_ERLANG_DEFAULT);
+ } else {
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ }
+ } else {
+ sc.SetState(SCE_ERLANG_DEFAULT);
+ }
+ } break;
+ }
+ }
+
+ if (sc.state == SCE_ERLANG_DEFAULT) {
+ bool no_new_state = false;
+
+ switch (sc.ch) {
+ case '\"' : sc.SetState(SCE_ERLANG_STRING); break;
+ case '$' : sc.SetState(SCE_ERLANG_CHARACTER); break;
+ case '%' : {
+ parse_state = COMMENT;
+ sc.SetState(SCE_ERLANG_COMMENT);
+ } break;
+ case '#' : {
+ parse_state = RECORD_START;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } break;
+ case '?' : {
+ parse_state = MACRO_START;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } break;
+ case '\'' : {
+ parse_state = ATOM_QUOTED;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } break;
+ case '+' :
+ case '-' : {
+ if (IsADigit(sc.chNext)) {
+ parse_state = NUMERAL_START;
+ radix_digits = 0;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } else if (sc.ch != '+') {
+ parse_state = PREPROCESSOR;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ }
+ } break;
+ default : no_new_state = true;
+ }
+
+ if (no_new_state) {
+ if (isdigit(sc.ch)) {
+ parse_state = NUMERAL_START;
+ radix_digits = sc.ch - '0';
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } else if (isupper(sc.ch) || '_' == sc.ch) {
+ sc.SetState(SCE_ERLANG_VARIABLE);
+ } else if (isalpha(sc.ch)) {
+ parse_state = ATOM_UNQUOTED;
+ sc.SetState(SCE_ERLANG_UNKNOWN);
+ } else if (isoperator(static_cast<char>(sc.ch))
+ || sc.ch == '\\') {
+ sc.SetState(SCE_ERLANG_OPERATOR);
+ }
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+static int ClassifyErlangFoldPoint(
+ Accessor &styler,
+ int styleNext,
+ int keyword_start
+) {
+ int lev = 0;
+ if (styler.Match(keyword_start,"case")
+ || (
+ styler.Match(keyword_start,"fun")
+ && (SCE_ERLANG_FUNCTION_NAME != styleNext)
+ )
+ || styler.Match(keyword_start,"if")
+ || styler.Match(keyword_start,"query")
+ || styler.Match(keyword_start,"receive")
+ ) {
+ ++lev;
+ } else if (styler.Match(keyword_start,"end")) {
+ --lev;
+ }
+
+ return lev;
+}
+
+static void FoldErlangDoc(
+ unsigned int startPos, int length, int initStyle,
+ WordList** /*keywordlists*/, Accessor &styler
+) {
+ unsigned int endPos = startPos + length;
+ int currentLine = styler.GetLine(startPos);
+ int lev;
+ int previousLevel = styler.LevelAt(currentLine) & SC_FOLDLEVELNUMBERMASK;
+ int currentLevel = previousLevel;
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int stylePrev;
+ int keyword_start = 0;
+ char ch;
+ char chNext = styler.SafeGetCharAt(startPos);
+ bool atEOL;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ // Get styles
+ stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ atEOL = ((ch == '\r') && (chNext != '\n')) || (ch == '\n');
+
+ if (stylePrev != SCE_ERLANG_KEYWORD
+ && style == SCE_ERLANG_KEYWORD) {
+ keyword_start = i;
+ }
+
+ // Fold on keywords
+ if (stylePrev == SCE_ERLANG_KEYWORD
+ && style != SCE_ERLANG_KEYWORD
+ && style != SCE_ERLANG_ATOM
+ ) {
+ currentLevel += ClassifyErlangFoldPoint(styler,
+ styleNext,
+ keyword_start);
+ }
+
+ // Fold on comments
+ if (style == SCE_ERLANG_COMMENT
+ || style == SCE_ERLANG_COMMENT_MODULE
+ || style == SCE_ERLANG_COMMENT_FUNCTION) {
+
+ if (ch == '%' && chNext == '{') {
+ currentLevel++;
+ } else if (ch == '%' && chNext == '}') {
+ currentLevel--;
+ }
+ }
+
+ // Fold on braces
+ if (style == SCE_ERLANG_OPERATOR) {
+ if (ch == '{' || ch == '(' || ch == '[') {
+ currentLevel++;
+ } else if (ch == '}' || ch == ')' || ch == ']') {
+ currentLevel--;
+ }
+ }
+
+
+ if (atEOL) {
+ lev = previousLevel;
+
+ if (currentLevel > previousLevel)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ if (lev != styler.LevelAt(currentLine))
+ styler.SetLevel(currentLine, lev);
+
+ currentLine++;
+ previousLevel = currentLevel;
+ }
+
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ styler.SetLevel(currentLine,
+ previousLevel
+ | (styler.LevelAt(currentLine) & ~SC_FOLDLEVELNUMBERMASK));
+}
+
+static const char * const erlangWordListDesc[] = {
+ "Erlang Reserved words",
+ "Erlang BIFs",
+ "Erlang Preprocessor",
+ "Erlang Module Attributes",
+ "Erlang Documentation",
+ "Erlang Documentation Macro",
+ 0
+};
+
+LexerModule lmErlang(
+ SCLEX_ERLANG,
+ ColouriseErlangDoc,
+ "erlang",
+ FoldErlangDoc,
+ erlangWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFlagship.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFlagship.cxx
new file mode 100644
index 00000000000..b8568b05af7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFlagship.cxx
@@ -0,0 +1,354 @@
+// Scintilla source code edit control
+/** @file LexFlagShip.cxx
+ ** Lexer for Harbour and FlagShip.
+ ** (Syntactically compatible to other xBase dialects, like Clipper, dBase, Clip, FoxPro etc.)
+ **/
+// Copyright 2005 by Randy Butler
+// Copyright 2010 by Xavi <jarabal/at/gmail.com> (Harbour)
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Extended to accept accented characters
+static inline bool IsAWordChar(int ch)
+{
+ return ch >= 0x80 ||
+ (isalnum(ch) || ch == '_');
+}
+
+static void ColouriseFlagShipDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler)
+{
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+
+ // property lexer.flagship.styling.within.preprocessor
+ // For Harbour code, determines whether all preprocessor code is styled in the preprocessor style (0) or only from the
+ // initial # to the end of the command word(1, the default). It also determines how to present text, dump, and disabled code.
+ bool stylingWithinPreprocessor = styler.GetPropertyInt("lexer.flagship.styling.within.preprocessor", 1) != 0;
+
+ CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]");
+
+ int visibleChars = 0;
+ int closeStringChar = 0;
+ int styleBeforeDCKeyword = SCE_FS_DEFAULT;
+ bool bEnableCode = initStyle < SCE_FS_DISABLEDCODE;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_FS_OPERATOR:
+ case SCE_FS_OPERATOR_C:
+ case SCE_FS_WORDOPERATOR:
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ break;
+ case SCE_FS_IDENTIFIER:
+ case SCE_FS_IDENTIFIER_C:
+ if (!IsAWordChar(sc.ch)) {
+ char s[64];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD : SCE_FS_KEYWORD_C);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD2 : SCE_FS_KEYWORD2_C);
+ } else if (bEnableCode && keywords3.InList(s)) {
+ sc.ChangeState(SCE_FS_KEYWORD3);
+ } else if (bEnableCode && keywords4.InList(s)) {
+ sc.ChangeState(SCE_FS_KEYWORD4);
+ }// Else, it is really an identifier...
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ }
+ break;
+ case SCE_FS_NUMBER:
+ if (!IsAWordChar(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_FS_DEFAULT);
+ }
+ break;
+ case SCE_FS_NUMBER_C:
+ if (!IsAWordChar(sc.ch) && sc.ch != '.') {
+ sc.SetState(SCE_FS_DEFAULT_C);
+ }
+ break;
+ case SCE_FS_CONSTANT:
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_FS_DEFAULT);
+ }
+ break;
+ case SCE_FS_STRING:
+ case SCE_FS_STRING_C:
+ if (sc.ch == closeStringChar) {
+ sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(bEnableCode ? SCE_FS_STRINGEOL : SCE_FS_STRINGEOL_C);
+ }
+ break;
+ case SCE_FS_STRINGEOL:
+ case SCE_FS_STRINGEOL_C:
+ if (sc.atLineStart) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ }
+ break;
+ case SCE_FS_COMMENTDOC:
+ case SCE_FS_COMMENTDOC_C:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C;
+ sc.SetState(SCE_FS_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_FS_COMMENT:
+ case SCE_FS_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_FS_DEFAULT);
+ }
+ break;
+ case SCE_FS_COMMENTLINEDOC:
+ case SCE_FS_COMMENTLINEDOC_C:
+ if (sc.atLineStart) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C;
+ sc.SetState(SCE_FS_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_FS_COMMENTDOCKEYWORD:
+ if ((styleBeforeDCKeyword == SCE_FS_COMMENTDOC || styleBeforeDCKeyword == SCE_FS_COMMENTDOC_C) &&
+ sc.Match('*', '/')) {
+ sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR);
+ sc.Forward();
+ sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ } else if (!setDoxygen.Contains(sc.ch)) {
+ char s[64];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (!IsASpace(sc.ch) || !keywords5.InList(s + 1)) {
+ sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR);
+ }
+ sc.SetState(styleBeforeDCKeyword);
+ }
+ break;
+ case SCE_FS_PREPROCESSOR:
+ case SCE_FS_PREPROCESSOR_C:
+ if (sc.atLineEnd) {
+ if (!(sc.chPrev == ';' || sc.GetRelative(-2) == ';')) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ }
+ } else if (stylingWithinPreprocessor) {
+ if (IsASpaceOrTab(sc.ch)) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ }
+ } else if (sc.Match('/', '*') || sc.Match('/', '/') || sc.Match('&', '&')) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ }
+ break;
+ case SCE_FS_DISABLEDCODE:
+ if (sc.ch == '#' && visibleChars == 0) {
+ sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C);
+ do { // Skip whitespace between # and preprocessor word
+ sc.Forward();
+ } while (IsASpaceOrTab(sc.ch) && sc.More());
+ if (sc.MatchIgnoreCase("pragma")) {
+ sc.Forward(6);
+ do { // Skip more whitespace until keyword
+ sc.Forward();
+ } while (IsASpaceOrTab(sc.ch) && sc.More());
+ if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) {
+ bEnableCode = true;
+ sc.SetState(SCE_FS_DISABLEDCODE);
+ sc.Forward(sc.ch == '_' ? 8 : 6);
+ sc.ForwardSetState(SCE_FS_DEFAULT);
+ } else {
+ sc.ChangeState(SCE_FS_DISABLEDCODE);
+ }
+ } else {
+ sc.ChangeState(SCE_FS_DISABLEDCODE);
+ }
+ }
+ break;
+ case SCE_FS_DATE:
+ if (sc.ch == '}') {
+ sc.ForwardSetState(SCE_FS_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_FS_STRINGEOL);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_FS_DEFAULT || sc.state == SCE_FS_DEFAULT_C) {
+ if (bEnableCode &&
+ (sc.MatchIgnoreCase(".and.") || sc.MatchIgnoreCase(".not."))) {
+ sc.SetState(SCE_FS_WORDOPERATOR);
+ sc.Forward(4);
+ } else if (bEnableCode && sc.MatchIgnoreCase(".or.")) {
+ sc.SetState(SCE_FS_WORDOPERATOR);
+ sc.Forward(3);
+ } else if (bEnableCode &&
+ (sc.MatchIgnoreCase(".t.") || sc.MatchIgnoreCase(".f.") ||
+ (!IsAWordChar(sc.GetRelative(3)) && sc.MatchIgnoreCase("nil")))) {
+ sc.SetState(SCE_FS_CONSTANT);
+ sc.Forward(2);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C);
+ sc.Forward();
+ } else if (bEnableCode && sc.Match('&', '&')) {
+ sc.SetState(SCE_FS_COMMENTLINE);
+ sc.Forward();
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C);
+ sc.Forward();
+ } else if (bEnableCode && sc.ch == '*' && visibleChars == 0) {
+ sc.SetState(SCE_FS_COMMENT);
+ } else if (sc.ch == '\"' || sc.ch == '\'') {
+ sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C);
+ closeStringChar = sc.ch;
+ } else if (closeStringChar == '>' && sc.ch == '<') {
+ sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C);
+ do { // Skip whitespace between # and preprocessor word
+ sc.Forward();
+ } while (IsASpaceOrTab(sc.ch) && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C);
+ } else if (sc.MatchIgnoreCase("include")) {
+ if (stylingWithinPreprocessor) {
+ closeStringChar = '>';
+ }
+ } else if (sc.MatchIgnoreCase("pragma")) {
+ sc.Forward(6);
+ do { // Skip more whitespace until keyword
+ sc.Forward();
+ } while (IsASpaceOrTab(sc.ch) && sc.More());
+ if (sc.MatchIgnoreCase("begindump") || sc.MatchIgnoreCase("__cstream")) {
+ bEnableCode = false;
+ if (stylingWithinPreprocessor) {
+ sc.SetState(SCE_FS_DISABLEDCODE);
+ sc.Forward(8);
+ sc.ForwardSetState(SCE_FS_DEFAULT_C);
+ } else {
+ sc.SetState(SCE_FS_DISABLEDCODE);
+ }
+ } else if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) {
+ bEnableCode = true;
+ sc.SetState(SCE_FS_DISABLEDCODE);
+ sc.Forward(sc.ch == '_' ? 8 : 6);
+ sc.ForwardSetState(SCE_FS_DEFAULT);
+ }
+ }
+ } else if (bEnableCode && sc.ch == '{') {
+ int p = 0;
+ int chSeek;
+ unsigned int endPos(startPos + length);
+ do { // Skip whitespace
+ chSeek = sc.GetRelative(++p);
+ } while (IsASpaceOrTab(chSeek) && (sc.currentPos + p < endPos));
+ if (chSeek == '^') {
+ sc.SetState(SCE_FS_DATE);
+ } else {
+ sc.SetState(SCE_FS_OPERATOR);
+ }
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(bEnableCode ? SCE_FS_NUMBER : SCE_FS_NUMBER_C);
+ } else if (IsAWordChar(sc.ch)) {
+ sc.SetState(bEnableCode ? SCE_FS_IDENTIFIER : SCE_FS_IDENTIFIER_C);
+ } else if (isoperator(static_cast<char>(sc.ch)) || (bEnableCode && sc.ch == '@')) {
+ sc.SetState(bEnableCode ? SCE_FS_OPERATOR : SCE_FS_OPERATOR_C);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ visibleChars = 0;
+ closeStringChar = 0;
+ }
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldFlagShipDoc(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler)
+{
+
+ int endPos = startPos + length;
+
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0 && lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ int spaceFlags = 0;
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
+ char chNext = styler[startPos];
+ for (int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos-1)) {
+ int lev = indentCurrent;
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
+ int spaceFlags2 = 0;
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2);
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ }
+ indentCurrent = indentNext;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ }
+ }
+}
+
+static const char * const FSWordListDesc[] = {
+ "Keywords Commands",
+ "Std Library Functions",
+ "Procedure, return, exit",
+ "Class (oop)",
+ "Doxygen keywords",
+ 0
+};
+
+LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexForth.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexForth.cxx
new file mode 100644
index 00000000000..7b41aaf8e76
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexForth.cxx
@@ -0,0 +1,170 @@
+// Scintilla source code edit control
+/** @file LexForth.cxx
+ ** Lexer for FORTH
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordStart(int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
+}
+
+static inline bool IsANumChar(int ch) {
+ return (ch < 0x80) && (isxdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' );
+}
+
+static inline bool IsASpaceChar(int ch) {
+ return (ch < 0x80) && isspace(ch);
+}
+
+static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[],
+ Accessor &styler) {
+
+ WordList &control = *keywordLists[0];
+ WordList &keyword = *keywordLists[1];
+ WordList &defword = *keywordLists[2];
+ WordList &preword1 = *keywordLists[3];
+ WordList &preword2 = *keywordLists[4];
+ WordList &strings = *keywordLists[5];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward())
+ {
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_FORTH_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_FORTH_DEFAULT);
+ }
+ }else if (sc.state == SCE_FORTH_COMMENT_ML) {
+ if (sc.ch == ')') {
+ sc.ForwardSetState(SCE_FORTH_DEFAULT);
+ }
+ }else if (sc.state == SCE_FORTH_IDENTIFIER || sc.state == SCE_FORTH_NUMBER) {
+ // handle numbers here too, because what we thought was a number might
+ // turn out to be a keyword e.g. 2DUP
+ if (IsASpaceChar(sc.ch) ) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ int newState = sc.state == SCE_FORTH_NUMBER ? SCE_FORTH_NUMBER : SCE_FORTH_DEFAULT;
+ if (control.InList(s)) {
+ sc.ChangeState(SCE_FORTH_CONTROL);
+ } else if (keyword.InList(s)) {
+ sc.ChangeState(SCE_FORTH_KEYWORD);
+ } else if (defword.InList(s)) {
+ sc.ChangeState(SCE_FORTH_DEFWORD);
+ } else if (preword1.InList(s)) {
+ sc.ChangeState(SCE_FORTH_PREWORD1);
+ } else if (preword2.InList(s)) {
+ sc.ChangeState(SCE_FORTH_PREWORD2);
+ } else if (strings.InList(s)) {
+ sc.ChangeState(SCE_FORTH_STRING);
+ newState = SCE_FORTH_STRING;
+ }
+ sc.SetState(newState);
+ }
+ if (sc.state == SCE_FORTH_NUMBER) {
+ if (IsASpaceChar(sc.ch)) {
+ sc.SetState(SCE_FORTH_DEFAULT);
+ } else if (!IsANumChar(sc.ch)) {
+ sc.ChangeState(SCE_FORTH_IDENTIFIER);
+ }
+ }
+ }else if (sc.state == SCE_FORTH_STRING) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_FORTH_DEFAULT);
+ }
+ }else if (sc.state == SCE_FORTH_LOCALE) {
+ if (sc.ch == '}') {
+ sc.ForwardSetState(SCE_FORTH_DEFAULT);
+ }
+ }else if (sc.state == SCE_FORTH_DEFWORD) {
+ if (IsASpaceChar(sc.ch)) {
+ sc.SetState(SCE_FORTH_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_FORTH_DEFAULT) {
+ if (sc.ch == '\\'){
+ sc.SetState(SCE_FORTH_COMMENT);
+ } else if (sc.ch == '(' &&
+ (sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
+ (sc.atLineEnd || IsASpaceChar(sc.chNext))) {
+ sc.SetState(SCE_FORTH_COMMENT_ML);
+ } else if ( (sc.ch == '$' && (IsASCII(sc.chNext) && isxdigit(sc.chNext))) ) {
+ // number starting with $ is a hex number
+ sc.SetState(SCE_FORTH_NUMBER);
+ while(sc.More() && IsASCII(sc.chNext) && isxdigit(sc.chNext))
+ sc.Forward();
+ } else if ( (sc.ch == '%' && (IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
+ // number starting with % is binary
+ sc.SetState(SCE_FORTH_NUMBER);
+ while(sc.More() && IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
+ sc.Forward();
+ } else if ( IsASCII(sc.ch) &&
+ (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && IsASCII(sc.chNext) && isxdigit(sc.chNext)) )
+ ){
+ sc.SetState(SCE_FORTH_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_FORTH_IDENTIFIER);
+ } else if (sc.ch == '{') {
+ sc.SetState(SCE_FORTH_LOCALE);
+ } else if (sc.ch == ':' && IsASCII(sc.chNext) && isspace(sc.chNext)) {
+ // highlight word definitions e.g. : GCD ( n n -- n ) ..... ;
+ // ^ ^^^
+ sc.SetState(SCE_FORTH_DEFWORD);
+ while(sc.More() && IsASCII(sc.chNext) && isspace(sc.chNext))
+ sc.Forward();
+ } else if (sc.ch == ';' &&
+ (sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
+ (sc.atLineEnd || IsASpaceChar(sc.chNext)) ) {
+ // mark the ';' that ends a word
+ sc.SetState(SCE_FORTH_DEFWORD);
+ sc.ForwardSetState(SCE_FORTH_DEFAULT);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+static void FoldForthDoc(unsigned int, int, int, WordList *[],
+ Accessor &) {
+}
+
+static const char * const forthWordLists[] = {
+ "control keywords",
+ "keywords",
+ "definition words",
+ "prewords with one argument",
+ "prewords with two arguments",
+ "string definition keywords",
+ 0,
+ };
+
+LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth", FoldForthDoc, forthWordLists);
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFortran.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFortran.cxx
new file mode 100644
index 00000000000..387ed84ed03
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexFortran.cxx
@@ -0,0 +1,514 @@
+// Scintilla source code edit control
+/** @file LexFortran.cxx
+ ** Lexer for Fortran.
+ ** Written by Chuan-jian Shen, Last changed Sep. 2003
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+/***************************************/
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+/***************************************/
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+/***************************************/
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/***********************************************/
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%');
+}
+/**********************************************/
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch));
+}
+/***************************************/
+static inline bool IsABlank(unsigned int ch) {
+ return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ;
+}
+/***************************************/
+static inline bool IsALineEnd(char ch) {
+ return ((ch == '\n') || (ch == '\r')) ;
+}
+/***************************************/
+static unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) {
+ while (!IsALineEnd(styler.SafeGetCharAt(pos++))) continue;
+ if (styler.SafeGetCharAt(pos) == '\n') pos++;
+ while (IsABlank(styler.SafeGetCharAt(pos++))) continue;
+ char chCur = styler.SafeGetCharAt(pos);
+ if (chCur == '&') {
+ while (IsABlank(styler.SafeGetCharAt(++pos))) continue;
+ return pos;
+ } else {
+ return pos;
+ }
+}
+/***************************************/
+static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler, bool isFixFormat) {
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ /***************************************/
+ int posLineStart = 0, numNonBlank = 0, prevState = 0;
+ int endPos = startPos + length;
+ /***************************************/
+ // backtrack to the nearest keyword
+ while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_F_WORD)) {
+ startPos--;
+ }
+ startPos = styler.LineStart(styler.GetLine(startPos));
+ initStyle = styler.StyleAt(startPos - 1);
+ StyleContext sc(startPos, endPos-startPos, initStyle, styler);
+ /***************************************/
+ for (; sc.More(); sc.Forward()) {
+ // remember the start position of the line
+ if (sc.atLineStart) {
+ posLineStart = sc.currentPos;
+ numNonBlank = 0;
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ if (!IsASpaceOrTab(sc.ch)) numNonBlank ++;
+ /***********************************************/
+ // Handle the fix format generically
+ int toLineStart = sc.currentPos - posLineStart;
+ if (isFixFormat && (toLineStart < 6 || toLineStart >= 72)) {
+ if ((toLineStart == 0 && (tolower(sc.ch) == 'c' || sc.ch == '*')) || sc.ch == '!') {
+ if (sc.MatchIgnoreCase("cdec$") || sc.MatchIgnoreCase("*dec$") || sc.MatchIgnoreCase("!dec$") ||
+ sc.MatchIgnoreCase("cdir$") || sc.MatchIgnoreCase("*dir$") || sc.MatchIgnoreCase("!dir$") ||
+ sc.MatchIgnoreCase("cms$") || sc.MatchIgnoreCase("*ms$") || sc.MatchIgnoreCase("!ms$") ||
+ sc.chNext == '$') {
+ sc.SetState(SCE_F_PREPROCESSOR);
+ } else {
+ sc.SetState(SCE_F_COMMENT);
+ }
+
+ while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
+ } else if (toLineStart >= 72) {
+ sc.SetState(SCE_F_COMMENT);
+ while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end
+ } else if (toLineStart < 5) {
+ if (IsADigit(sc.ch))
+ sc.SetState(SCE_F_LABEL);
+ else
+ sc.SetState(SCE_F_DEFAULT);
+ } else if (toLineStart == 5) {
+ //if (!IsASpace(sc.ch) && sc.ch != '0') {
+ if (sc.ch != '\r' && sc.ch != '\n') {
+ sc.SetState(SCE_F_CONTINUATION);
+ if (!IsASpace(sc.ch) && sc.ch != '0')
+ sc.ForwardSetState(prevState);
+ } else
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ continue;
+ }
+ /***************************************/
+ // Hanndle preprocessor directives
+ if (sc.ch == '#' && numNonBlank == 1)
+ {
+ sc.SetState(SCE_F_PREPROCESSOR);
+ while (!sc.atLineEnd && sc.More())
+ sc.Forward(); // Until line end
+ }
+ /***************************************/
+ // Handle line continuation generically.
+ if (!isFixFormat && sc.ch == '&' && sc.state != SCE_F_COMMENT) {
+ char chTemp = ' ';
+ int j = 1;
+ while (IsABlank(chTemp) && j<132) {
+ chTemp = static_cast<char>(sc.GetRelative(j));
+ j++;
+ }
+ if (chTemp == '!') {
+ sc.SetState(SCE_F_CONTINUATION);
+ if (sc.chNext == '!') sc.ForwardSetState(SCE_F_COMMENT);
+ } else if (chTemp == '\r' || chTemp == '\n') {
+ int currentState = sc.state;
+ sc.SetState(SCE_F_CONTINUATION);
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ while (IsASpace(sc.ch) && sc.More()) sc.Forward();
+ if (sc.ch == '&') {
+ sc.SetState(SCE_F_CONTINUATION);
+ sc.Forward();
+ }
+ sc.SetState(currentState);
+ }
+ }
+ /***************************************/
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_F_OPERATOR) {
+ sc.SetState(SCE_F_DEFAULT);
+ } else if (sc.state == SCE_F_NUMBER) {
+ if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) {
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ } else if (sc.state == SCE_F_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) || (sc.ch == '%')) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_F_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_F_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_F_WORD3);
+ }
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ } else if (sc.state == SCE_F_COMMENT || sc.state == SCE_F_PREPROCESSOR) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ } else if (sc.state == SCE_F_STRING1) {
+ prevState = sc.state;
+ if (sc.ch == '\'') {
+ if (sc.chNext == '\'') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ prevState = SCE_F_DEFAULT;
+ }
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_F_STRINGEOL);
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ }
+ } else if (sc.state == SCE_F_STRING2) {
+ prevState = sc.state;
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_F_STRINGEOL);
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ } else if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ prevState = SCE_F_DEFAULT;
+ }
+ }
+ } else if (sc.state == SCE_F_OPERATOR2) {
+ if (sc.ch == '.') {
+ sc.ForwardSetState(SCE_F_DEFAULT);
+ }
+ } else if (sc.state == SCE_F_CONTINUATION) {
+ sc.SetState(SCE_F_DEFAULT);
+ } else if (sc.state == SCE_F_LABEL) {
+ if (!IsADigit(sc.ch)) {
+ sc.SetState(SCE_F_DEFAULT);
+ } else {
+ if (isFixFormat && sc.currentPos-posLineStart > 4)
+ sc.SetState(SCE_F_DEFAULT);
+ else if (numNonBlank > 5)
+ sc.SetState(SCE_F_DEFAULT);
+ }
+ }
+ /***************************************/
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_F_DEFAULT) {
+ if (sc.ch == '!') {
+ if (sc.MatchIgnoreCase("!dec$") || sc.MatchIgnoreCase("!dir$") ||
+ sc.MatchIgnoreCase("!ms$") || sc.chNext == '$') {
+ sc.SetState(SCE_F_PREPROCESSOR);
+ } else {
+ sc.SetState(SCE_F_COMMENT);
+ }
+ } else if ((!isFixFormat) && IsADigit(sc.ch) && numNonBlank == 1) {
+ sc.SetState(SCE_F_LABEL);
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_F_NUMBER);
+ } else if ((tolower(sc.ch) == 'b' || tolower(sc.ch) == 'o' ||
+ tolower(sc.ch) == 'z') && (sc.chNext == '\"' || sc.chNext == '\'')) {
+ sc.SetState(SCE_F_NUMBER);
+ sc.Forward();
+ } else if (sc.ch == '.' && isalpha(sc.chNext)) {
+ sc.SetState(SCE_F_OPERATOR2);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_F_IDENTIFIER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_F_STRING2);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_F_STRING1);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_F_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+/***************************************/
+// To determine the folding level depending on keywords
+static int classifyFoldPointFortran(const char* s, const char* prevWord, const char chNextNonBlank) {
+ int lev = 0;
+
+ if ((strcmp(prevWord, "module") == 0 && strcmp(s, "subroutine") == 0)
+ || (strcmp(prevWord, "module") == 0 && strcmp(s, "function") == 0)) {
+ lev = 0;
+ } else if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0
+ || strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0
+ || strcmp(s, "selecttype") == 0 || strcmp(s, "selectcase") == 0
+ || strcmp(s, "do") == 0 || strcmp(s, "enum") ==0
+ || strcmp(s, "function") == 0 || strcmp(s, "interface") == 0
+ || strcmp(s, "module") == 0 || strcmp(s, "program") == 0
+ || strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0
+ || (strcmp(s, "type") == 0 && chNextNonBlank != '(')
+ || strcmp(s, "critical") == 0 || strcmp(s, "submodule") == 0){
+ if (strcmp(prevWord, "end") == 0)
+ lev = 0;
+ else
+ lev = 1;
+ } else if ((strcmp(s, "end") == 0 && chNextNonBlank != '=')
+ || strcmp(s, "endassociate") == 0 || strcmp(s, "endblock") == 0
+ || strcmp(s, "endblockdata") == 0 || strcmp(s, "endselect") == 0
+ || strcmp(s, "enddo") == 0 || strcmp(s, "endenum") ==0
+ || strcmp(s, "endif") == 0 || strcmp(s, "endforall") == 0
+ || strcmp(s, "endfunction") == 0 || strcmp(s, "endinterface") == 0
+ || strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0
+ || strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0
+ || strcmp(s, "endwhere") == 0 || strcmp(s, "endcritical") == 0
+ || (strcmp(prevWord, "module") == 0 && strcmp(s, "procedure") == 0) // Take care of the "module procedure" statement
+ || strcmp(s, "endsubmodule") == 0) {
+ lev = -1;
+ } else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if
+ lev = 0;
+ } else if (strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0){ // type is
+ lev = -1;
+ } else if ((strcmp(prevWord, "end") == 0 && strcmp(s, "procedure") == 0)
+ || strcmp(s, "endprocedure") == 0) {
+ lev = 1; // level back to 0, because no folding support for "module procedure" in submodule
+ }
+ return lev;
+}
+/***************************************/
+// Folding the code
+static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
+ Accessor &styler, bool isFixFormat) {
+ //
+ // bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ // Do not know how to fold the comment at the moment.
+ //
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent;
+ bool isPrevLine;
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ isPrevLine = true;
+ } else {
+ levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ isPrevLine = false;
+ }
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int levelDeltaNext = 0;
+ /***************************************/
+ int lastStart = 0;
+ char prevWord[32] = "";
+ /***************************************/
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ char chNextNonBlank = chNext;
+ bool nextEOL = false;
+ if (IsALineEnd(chNextNonBlank)) {
+ nextEOL = true;
+ }
+ unsigned int j=i+1;
+ while(IsABlank(chNextNonBlank) && j<endPos) {
+ j ++ ;
+ chNextNonBlank = styler.SafeGetCharAt(j);
+ if (IsALineEnd(chNextNonBlank)) {
+ nextEOL = true;
+ }
+ }
+ if (!nextEOL && j == endPos) {
+ nextEOL = true;
+ }
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ //
+ if (((isFixFormat && stylePrev == SCE_F_CONTINUATION) || stylePrev == SCE_F_DEFAULT
+ || stylePrev == SCE_F_OPERATOR) && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
+ // Store last word and label start point.
+ lastStart = i;
+ }
+ /***************************************/
+ if (style == SCE_F_WORD) {
+ if(iswordchar(ch) && !iswordchar(chNext)) {
+ char s[32];
+ unsigned int k;
+ for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
+ s[k] = static_cast<char>(tolower(styler[lastStart+k]));
+ }
+ s[k] = '\0';
+ // Handle the forall and where statement and structure.
+ if (strcmp(s, "forall") == 0 || (strcmp(s, "where") == 0 && strcmp(prevWord, "else") != 0)) {
+ if (strcmp(prevWord, "end") != 0) {
+ j = i + 1;
+ char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j);
+ // Find the position of the first (
+ while (ch1 != chBrace && j<endPos) {
+ j++;
+ ch1 = styler.SafeGetCharAt(j);
+ }
+ char styBrace = styler.StyleAt(j);
+ int depth = 1;
+ char chAtPos;
+ char styAtPos;
+ while (j<endPos) {
+ j++;
+ chAtPos = styler.SafeGetCharAt(j);
+ styAtPos = styler.StyleAt(j);
+ if (styAtPos == styBrace) {
+ if (chAtPos == chBrace) depth++;
+ if (chAtPos == chSeek) depth--;
+ if (depth == 0) break;
+ }
+ }
+ int tmpLineCurrent = lineCurrent;
+ while (j<endPos) {
+ j++;
+ chAtPos = styler.SafeGetCharAt(j);
+ styAtPos = styler.StyleAt(j);
+ if (!IsALineEnd(chAtPos) && (styAtPos == SCE_F_COMMENT || IsABlank(chAtPos))) continue;
+ if (isFixFormat) {
+ if (!IsALineEnd(chAtPos)) {
+ break;
+ } else {
+ if (tmpLineCurrent < styler.GetLine(styler.Length()-1)) {
+ tmpLineCurrent++;
+ j = styler.LineStart(tmpLineCurrent);
+ if (styler.StyleAt(j+5) == SCE_F_CONTINUATION
+ && !IsABlank(styler.SafeGetCharAt(j+5)) && styler.SafeGetCharAt(j+5) != '0') {
+ j += 5;
+ continue;
+ } else {
+ levelDeltaNext++;
+ break;
+ }
+ }
+ }
+ } else {
+ if (chAtPos == '&' && styler.StyleAt(j) == SCE_F_CONTINUATION) {
+ j = GetContinuedPos(j+1, styler);
+ continue;
+ } else if (IsALineEnd(chAtPos)) {
+ levelDeltaNext++;
+ break;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ int wordLevelDelta = classifyFoldPointFortran(s, prevWord, chNextNonBlank);
+ levelDeltaNext += wordLevelDelta;
+ if (((strcmp(s, "else") == 0) && (nextEOL || chNextNonBlank == '!')) ||
+ (strcmp(prevWord, "else") == 0 && strcmp(s, "where") == 0) || strcmp(s, "elsewhere") == 0) {
+ if (!isPrevLine) {
+ levelCurrent--;
+ }
+ levelDeltaNext++;
+ } else if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) {
+ if (!isPrevLine) {
+ levelCurrent--;
+ }
+ } else if ((strcmp(prevWord, "select") == 0 && strcmp(s, "case") == 0) || strcmp(s, "selectcase") == 0 ||
+ (strcmp(prevWord, "select") == 0 && strcmp(s, "type") == 0) || strcmp(s, "selecttype") == 0) {
+ levelDeltaNext += 2;
+ } else if ((strcmp(s, "case") == 0 && chNextNonBlank == '(') || (strcmp(prevWord, "case") == 0 && strcmp(s, "default") == 0) ||
+ (strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0) ||
+ (strcmp(prevWord, "class") == 0 && strcmp(s, "is") == 0) ||
+ (strcmp(prevWord, "class") == 0 && strcmp(s, "default") == 0) ) {
+ if (!isPrevLine) {
+ levelCurrent--;
+ }
+ levelDeltaNext++;
+ } else if ((strcmp(prevWord, "end") == 0 && strcmp(s, "select") == 0) || strcmp(s, "endselect") == 0) {
+ levelDeltaNext -= 2;
+ }
+
+ // There are multiple forms of "do" loop. The older form with a label "do 100 i=1,10" would require matching
+ // labels to ensure the folding level does not decrease too far when labels are used for other purposes.
+ // Since this is difficult, do-label constructs are not folded.
+ if (strcmp(s, "do") == 0 && IsADigit(chNextNonBlank)) {
+ // Remove delta for do-label
+ levelDeltaNext -= wordLevelDelta;
+ }
+ }
+ strcpy(prevWord, s);
+ }
+ }
+ if (atEOL) {
+ int lev = levelCurrent;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelDeltaNext > 0) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ levelCurrent += levelDeltaNext;
+ levelDeltaNext = 0;
+ visibleChars = 0;
+ strcpy(prevWord, "");
+ isPrevLine = false;
+ }
+ /***************************************/
+ if (!isspacechar(ch)) visibleChars++;
+ }
+ /***************************************/
+}
+/***************************************/
+static const char * const FortranWordLists[] = {
+ "Primary keywords and identifiers",
+ "Intrinsic functions",
+ "Extended and user defined functions",
+ 0,
+};
+/***************************************/
+static void ColouriseFortranDocFreeFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, false);
+}
+/***************************************/
+static void ColouriseFortranDocFixFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, true);
+}
+/***************************************/
+static void FoldFortranDocFreeFormat(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ FoldFortranDoc(startPos, length, initStyle,styler, false);
+}
+/***************************************/
+static void FoldFortranDocFixFormat(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ FoldFortranDoc(startPos, length, initStyle,styler, true);
+}
+/***************************************/
+LexerModule lmFortran(SCLEX_FORTRAN, ColouriseFortranDocFreeFormat, "fortran", FoldFortranDocFreeFormat, FortranWordLists);
+LexerModule lmF77(SCLEX_F77, ColouriseFortranDocFixFormat, "f77", FoldFortranDocFixFormat, FortranWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGAP.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGAP.cxx
new file mode 100644
index 00000000000..bc0bc2144b3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGAP.cxx
@@ -0,0 +1,266 @@
+// Scintilla source code edit control
+/** @file LexGAP.cxx
+ ** Lexer for the GAP language. (The GAP System for Computational Discrete Algebra)
+ ** http://www.gap-system.org
+ **/
+// Copyright 2007 by Istvan Szollosi ( szteven <at> gmail <dot> com )
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsGAPOperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch)) return false;
+ if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
+ ch == '^' || ch == ',' || ch == '!' || ch == '.' ||
+ ch == '=' || ch == '<' || ch == '>' || ch == '(' ||
+ ch == ')' || ch == ';' || ch == '[' || ch == ']' ||
+ ch == '{' || ch == '}' || ch == ':' )
+ return true;
+ return false;
+}
+
+static void GetRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(styler[start + i]);
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void ColouriseGAPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords1 = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+
+ // Do not leak onto next line
+ if (initStyle == SCE_GAP_STRINGEOL) initStyle = SCE_GAP_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ // Prevent SCE_GAP_STRINGEOL from leaking back to previous line
+ if ( sc.atLineStart ) {
+ if (sc.state == SCE_GAP_STRING) sc.SetState(SCE_GAP_STRING);
+ if (sc.state == SCE_GAP_CHAR) sc.SetState(SCE_GAP_CHAR);
+ }
+
+ // Handle line continuation generically
+ if (sc.ch == '\\' ) {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate
+ switch (sc.state) {
+ case SCE_GAP_OPERATOR :
+ sc.SetState(SCE_GAP_DEFAULT);
+ break;
+
+ case SCE_GAP_NUMBER :
+ if (!IsADigit(sc.ch)) {
+ if (sc.ch == '\\') {
+ if (!sc.atLineEnd) {
+ if (!IsADigit(sc.chNext)) {
+ sc.Forward();
+ sc.ChangeState(SCE_GAP_IDENTIFIER);
+ }
+ }
+ } else if (isalpha(sc.ch) || sc.ch == '_') {
+ sc.ChangeState(SCE_GAP_IDENTIFIER);
+ }
+ else sc.SetState(SCE_GAP_DEFAULT);
+ }
+ break;
+
+ case SCE_GAP_IDENTIFIER :
+ if (!(iswordstart(static_cast<char>(sc.ch)) || sc.ch == '$')) {
+ if (sc.ch == '\\') sc.Forward();
+ else {
+ char s[1000];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords1.InList(s)) {
+ sc.ChangeState(SCE_GAP_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_GAP_KEYWORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_GAP_KEYWORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_GAP_KEYWORD4);
+ }
+ sc.SetState(SCE_GAP_DEFAULT);
+ }
+ }
+ break;
+
+ case SCE_GAP_COMMENT :
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_GAP_DEFAULT);
+ }
+ break;
+
+ case SCE_GAP_STRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_GAP_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_GAP_DEFAULT);
+ }
+ break;
+
+ case SCE_GAP_CHAR:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_GAP_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_GAP_DEFAULT);
+ }
+ break;
+
+ case SCE_GAP_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_GAP_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered
+ if (sc.state == SCE_GAP_DEFAULT) {
+ if (IsGAPOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_GAP_OPERATOR);
+ }
+ else if (IsADigit(sc.ch)) {
+ sc.SetState(SCE_GAP_NUMBER);
+ } else if (isalpha(sc.ch) || sc.ch == '_' || sc.ch == '\\' || sc.ch == '$' || sc.ch == '~') {
+ sc.SetState(SCE_GAP_IDENTIFIER);
+ if (sc.ch == '\\') sc.Forward();
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_GAP_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_GAP_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_GAP_CHAR);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+static int ClassifyFoldPointGAP(const char* s) {
+ int level = 0;
+ if (strcmp(s, "function") == 0 ||
+ strcmp(s, "do") == 0 ||
+ strcmp(s, "if") == 0 ||
+ strcmp(s, "repeat") == 0 ) {
+ level = 1;
+ } else if (strcmp(s, "end") == 0 ||
+ strcmp(s, "od") == 0 ||
+ strcmp(s, "fi") == 0 ||
+ strcmp(s, "until") == 0 ) {
+ level = -1;
+ }
+ return level;
+}
+
+static void FoldGAPDoc( unsigned int startPos, int length, int initStyle, WordList** , Accessor &styler) {
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+
+ int lastStart = 0;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (stylePrev != SCE_GAP_KEYWORD && style == SCE_GAP_KEYWORD) {
+ // Store last word start point.
+ lastStart = i;
+ }
+
+ if (stylePrev == SCE_GAP_KEYWORD) {
+ if(iswordchar(ch) && !iswordchar(chNext)) {
+ char s[100];
+ GetRange(lastStart, i, styler, s, sizeof(s));
+ levelCurrent += ClassifyFoldPointGAP(s);
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const GAPWordListDesc[] = {
+ "Keywords 1",
+ "Keywords 2",
+ "Keywords 3 (unused)",
+ "Keywords 4 (unused)",
+ 0
+};
+
+LexerModule lmGAP(
+ SCLEX_GAP,
+ ColouriseGAPDoc,
+ "gap",
+ FoldGAPDoc,
+ GAPWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGui4Cli.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGui4Cli.cxx
new file mode 100644
index 00000000000..0b33d2d7c8c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexGui4Cli.cxx
@@ -0,0 +1,312 @@
+// Scintilla source code edit control
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+/*
+This is the Lexer for Gui4Cli, included in SciLexer.dll
+- by d. Keletsekis, 2/10/2003
+
+To add to SciLexer.dll:
+1. Add the values below to INCLUDE\Scintilla.iface
+2. Run the scripts/HFacer.py script
+3. Run the scripts/LexGen.py script
+
+val SCE_GC_DEFAULT=0
+val SCE_GC_COMMENTLINE=1
+val SCE_GC_COMMENTBLOCK=2
+val SCE_GC_GLOBAL=3
+val SCE_GC_EVENT=4
+val SCE_GC_ATTRIBUTE=5
+val SCE_GC_CONTROL=6
+val SCE_GC_COMMAND=7
+val SCE_GC_STRING=8
+val SCE_GC_OPERATOR=9
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define debug Platform::DebugPrintf
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\');
+}
+
+inline bool isGCOperator(int ch)
+{ if (isalnum(ch))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
+ ch == '(' || ch == ')' || ch == '=' || ch == '%' ||
+ ch == '[' || ch == ']' || ch == '<' || ch == '>' ||
+ ch == ',' || ch == ';' || ch == ':')
+ return true;
+ return false;
+}
+
+#define isSpace(x) ((x)==' ' || (x)=='\t')
+#define isNL(x) ((x)=='\n' || (x)=='\r')
+#define isSpaceOrNL(x) (isSpace(x) || isNL(x))
+#define BUFFSIZE 500
+#define isFoldPoint(x) ((styler.LevelAt(x) & SC_FOLDLEVELNUMBERMASK) == 1024)
+
+static void colorFirstWord(WordList *keywordlists[], Accessor &styler,
+ StyleContext *sc, char *buff, int length, int)
+{
+ int c = 0;
+ while (sc->More() && isSpaceOrNL(sc->ch))
+ { sc->Forward();
+ }
+ styler.ColourTo(sc->currentPos - 1, sc->state);
+
+ if (!IsAWordChar(sc->ch)) // comment, marker, etc..
+ return;
+
+ while (sc->More() && !isSpaceOrNL(sc->ch) && (c < length-1) && !isGCOperator(sc->ch))
+ { buff[c] = static_cast<char>(sc->ch);
+ ++c; sc->Forward();
+ }
+ buff[c] = '\0';
+ char *p = buff;
+ while (*p) // capitalize..
+ { if (islower(*p)) *p = static_cast<char>(toupper(*p));
+ ++p;
+ }
+
+ WordList &kGlobal = *keywordlists[0]; // keyword lists set by the user
+ WordList &kEvent = *keywordlists[1];
+ WordList &kAttribute = *keywordlists[2];
+ WordList &kControl = *keywordlists[3];
+ WordList &kCommand = *keywordlists[4];
+
+ int state = 0;
+ // int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK;
+ // debug ("line = %d, level = %d", line, level);
+
+ if (kGlobal.InList(buff)) state = SCE_GC_GLOBAL;
+ else if (kAttribute.InList(buff)) state = SCE_GC_ATTRIBUTE;
+ else if (kControl.InList(buff)) state = SCE_GC_CONTROL;
+ else if (kCommand.InList(buff)) state = SCE_GC_COMMAND;
+ else if (kEvent.InList(buff)) state = SCE_GC_EVENT;
+
+ if (state)
+ { sc->ChangeState(state);
+ styler.ColourTo(sc->currentPos - 1, sc->state);
+ sc->ChangeState(SCE_GC_DEFAULT);
+ }
+ else
+ { sc->ChangeState(SCE_GC_DEFAULT);
+ styler.ColourTo(sc->currentPos - 1, sc->state);
+ }
+}
+
+// Main colorizing function called by Scintilla
+static void
+ColouriseGui4CliDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler)
+{
+ styler.StartAt(startPos);
+
+ int quotestart = 0, oldstate, currentline = styler.GetLine(startPos);
+ styler.StartSegment(startPos);
+ bool noforward;
+ char buff[BUFFSIZE+1]; // buffer for command name
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ buff[0] = '\0'; // cbuff = 0;
+
+ if (sc.state != SCE_GC_COMMENTBLOCK) // colorize 1st word..
+ colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline);
+
+ while (sc.More())
+ { noforward = 0;
+
+ switch (sc.ch)
+ {
+ case '/':
+ if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_STRING)
+ break;
+ if (sc.chNext == '/') // line comment
+ { sc.SetState (SCE_GC_COMMENTLINE);
+ sc.Forward();
+ styler.ColourTo(sc.currentPos, sc.state);
+ }
+ else if (sc.chNext == '*') // block comment
+ { sc.SetState(SCE_GC_COMMENTBLOCK);
+ sc.Forward();
+ styler.ColourTo(sc.currentPos, sc.state);
+ }
+ else
+ styler.ColourTo(sc.currentPos, sc.state);
+ break;
+
+ case '*': // end of comment block, or operator..
+ if (sc.state == SCE_GC_STRING)
+ break;
+ if (sc.state == SCE_GC_COMMENTBLOCK && sc.chNext == '/')
+ { sc.Forward();
+ styler.ColourTo(sc.currentPos, sc.state);
+ sc.ChangeState (SCE_GC_DEFAULT);
+ }
+ else
+ styler.ColourTo(sc.currentPos, sc.state);
+ break;
+
+ case '\'': case '\"': // strings..
+ if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_COMMENTLINE)
+ break;
+ if (sc.state == SCE_GC_STRING)
+ { if (sc.ch == quotestart) // match same quote char..
+ { styler.ColourTo(sc.currentPos, sc.state);
+ sc.ChangeState(SCE_GC_DEFAULT);
+ quotestart = 0;
+ } }
+ else
+ { styler.ColourTo(sc.currentPos - 1, sc.state);
+ sc.ChangeState(SCE_GC_STRING);
+ quotestart = sc.ch;
+ }
+ break;
+
+ case ';': // end of commandline character
+ if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE &&
+ sc.state != SCE_GC_STRING)
+ {
+ styler.ColourTo(sc.currentPos - 1, sc.state);
+ styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR);
+ sc.ChangeState(SCE_GC_DEFAULT);
+ sc.Forward();
+ colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline);
+ noforward = 1; // don't move forward - already positioned at next char..
+ }
+ break;
+
+ case '+': case '-': case '=': case '!': // operators..
+ case '<': case '>': case '&': case '|': case '$':
+ if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE &&
+ sc.state != SCE_GC_STRING)
+ {
+ styler.ColourTo(sc.currentPos - 1, sc.state);
+ styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR);
+ sc.ChangeState(SCE_GC_DEFAULT);
+ }
+ break;
+
+ case '\\': // escape - same as operator, but also mark in strings..
+ if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE)
+ {
+ oldstate = sc.state;
+ styler.ColourTo(sc.currentPos - 1, sc.state);
+ sc.Forward(); // mark also the next char..
+ styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR);
+ sc.ChangeState(oldstate);
+ }
+ break;
+
+ case '\n': case '\r':
+ ++currentline;
+ if (sc.state == SCE_GC_COMMENTLINE)
+ { styler.ColourTo(sc.currentPos, sc.state);
+ sc.ChangeState (SCE_GC_DEFAULT);
+ }
+ else if (sc.state != SCE_GC_COMMENTBLOCK)
+ { colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline);
+ noforward = 1; // don't move forward - already positioned at next char..
+ }
+ break;
+
+// case ' ': case '\t':
+// default :
+ }
+
+ if (!noforward) sc.Forward();
+
+ }
+ sc.Complete();
+}
+
+// Main folding function called by Scintilla - (based on props (.ini) files function)
+static void FoldGui4Cli(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler)
+{
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ bool headerPoint = false;
+
+ for (unsigned int i = startPos; i < endPos; i++)
+ {
+ char ch = chNext;
+ chNext = styler[i+1];
+
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (style == SCE_GC_EVENT || style == SCE_GC_GLOBAL)
+ { headerPoint = true; // fold at events and globals
+ }
+
+ if (atEOL)
+ { int lev = SC_FOLDLEVELBASE+1;
+
+ if (headerPoint)
+ lev = SC_FOLDLEVELBASE;
+
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+
+ if (headerPoint)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ if (lev != styler.LevelAt(lineCurrent)) // set level, if not already correct
+ { styler.SetLevel(lineCurrent, lev);
+ }
+
+ lineCurrent++; // re-initialize our flags
+ visibleChars = 0;
+ headerPoint = false;
+ }
+
+ if (!(isspacechar(ch))) // || (style == SCE_GC_COMMENTLINE) || (style != SCE_GC_COMMENTBLOCK)))
+ visibleChars++;
+ }
+
+ int lev = headerPoint ? SC_FOLDLEVELBASE : SC_FOLDLEVELBASE+1;
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, lev | flagsNext);
+}
+
+// I have no idea what these are for.. probably accessible by some message.
+static const char * const gui4cliWordListDesc[] = {
+ "Globals", "Events", "Attributes", "Control", "Commands",
+ 0
+};
+
+// Declare language & pass our function pointers to Scintilla
+LexerModule lmGui4Cli(SCLEX_GUI4CLI, ColouriseGui4CliDoc, "gui4cli", FoldGui4Cli, gui4cliWordListDesc);
+
+#undef debug
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHTML.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHTML.cxx
new file mode 100644
index 00000000000..02047930ce1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHTML.cxx
@@ -0,0 +1,2192 @@
+// Scintilla source code edit control
+/** @file LexHTML.cxx
+ ** Lexer for HTML.
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "StringCopy.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define SCE_HA_JS (SCE_HJA_START - SCE_HJ_START)
+#define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START)
+#define SCE_HA_PYTHON (SCE_HPA_START - SCE_HP_START)
+
+enum script_type { eScriptNone = 0, eScriptJS, eScriptVBS, eScriptPython, eScriptPHP, eScriptXML, eScriptSGML, eScriptSGMLblock, eScriptComment };
+enum script_mode { eHtml = 0, eNonHtmlScript, eNonHtmlPreProc, eNonHtmlScriptPreProc };
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+inline bool IsOperator(int ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
+ ch == '(' || ch == ')' || ch == '-' || ch == '+' ||
+ ch == '=' || ch == '|' || ch == '{' || ch == '}' ||
+ ch == '[' || ch == ']' || ch == ':' || ch == ';' ||
+ ch == '<' || ch == '>' || ch == ',' || ch == '/' ||
+ ch == '?' || ch == '!' || ch == '.' || ch == '~')
+ return true;
+ return false;
+}
+
+static void GetTextSegment(Accessor &styler, unsigned int start, unsigned int end, char *s, size_t len) {
+ unsigned int i = 0;
+ for (; (i < end - start + 1) && (i < len-1); i++) {
+ s[i] = static_cast<char>(MakeLowerCase(styler[start + i]));
+ }
+ s[i] = '\0';
+}
+
+static const char *GetNextWord(Accessor &styler, unsigned int start, char *s, size_t sLen) {
+
+ unsigned int i = 0;
+ for (; i < sLen-1; i++) {
+ char ch = static_cast<char>(styler.SafeGetCharAt(start + i));
+ if ((i == 0) && !IsAWordStart(ch))
+ break;
+ if ((i > 0) && !IsAWordChar(ch))
+ break;
+ s[i] = ch;
+ }
+ s[i] = '\0';
+
+ return s;
+}
+
+static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) {
+ char s[100];
+ GetTextSegment(styler, start, end, s, sizeof(s));
+ //Platform::DebugPrintf("Scripting indicator [%s]\n", s);
+ if (strstr(s, "src")) // External script
+ return eScriptNone;
+ if (strstr(s, "vbs"))
+ return eScriptVBS;
+ if (strstr(s, "pyth"))
+ return eScriptPython;
+ if (strstr(s, "javas"))
+ return eScriptJS;
+ if (strstr(s, "jscr"))
+ return eScriptJS;
+ if (strstr(s, "php"))
+ return eScriptPHP;
+ if (strstr(s, "xml")) {
+ const char *xml = strstr(s, "xml");
+ for (const char *t=s; t<xml; t++) {
+ if (!IsASpace(*t)) {
+ return prevValue;
+ }
+ }
+ return eScriptXML;
+ }
+
+ return prevValue;
+}
+
+static int PrintScriptingIndicatorOffset(Accessor &styler, unsigned int start, unsigned int end) {
+ int iResult = 0;
+ char s[100];
+ GetTextSegment(styler, start, end, s, sizeof(s));
+ if (0 == strncmp(s, "php", 3)) {
+ iResult = 3;
+ }
+
+ return iResult;
+}
+
+static script_type ScriptOfState(int state) {
+ if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) {
+ return eScriptPython;
+ } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
+ return eScriptVBS;
+ } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
+ return eScriptJS;
+ } else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) {
+ return eScriptPHP;
+ } else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) {
+ return eScriptSGML;
+ } else if (state == SCE_H_SGML_BLOCK_DEFAULT) {
+ return eScriptSGMLblock;
+ } else {
+ return eScriptNone;
+ }
+}
+
+static int statePrintForState(int state, script_mode inScriptType) {
+ int StateToPrint = state;
+
+ if (state >= SCE_HJ_START) {
+ if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) {
+ StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
+ } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
+ StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
+ } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
+ StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
+ }
+ }
+
+ return StateToPrint;
+}
+
+static int stateForPrintState(int StateToPrint) {
+ int state;
+
+ if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) {
+ state = StateToPrint - SCE_HA_PYTHON;
+ } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) {
+ state = StateToPrint - SCE_HA_VBS;
+ } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) {
+ state = StateToPrint - SCE_HA_JS;
+ } else {
+ state = StateToPrint;
+ }
+
+ return state;
+}
+
+static inline bool IsNumber(unsigned int start, Accessor &styler) {
+ return IsADigit(styler[start]) || (styler[start] == '.') ||
+ (styler[start] == '-') || (styler[start] == '#');
+}
+
+static inline bool isStringState(int state) {
+ bool bResult;
+
+ switch (state) {
+ case SCE_HJ_DOUBLESTRING:
+ case SCE_HJ_SINGLESTRING:
+ case SCE_HJA_DOUBLESTRING:
+ case SCE_HJA_SINGLESTRING:
+ case SCE_HB_STRING:
+ case SCE_HBA_STRING:
+ case SCE_HP_STRING:
+ case SCE_HP_CHARACTER:
+ case SCE_HP_TRIPLE:
+ case SCE_HP_TRIPLEDOUBLE:
+ case SCE_HPA_STRING:
+ case SCE_HPA_CHARACTER:
+ case SCE_HPA_TRIPLE:
+ case SCE_HPA_TRIPLEDOUBLE:
+ case SCE_HPHP_HSTRING:
+ case SCE_HPHP_SIMPLESTRING:
+ case SCE_HPHP_HSTRING_VARIABLE:
+ case SCE_HPHP_COMPLEX_VARIABLE:
+ bResult = true;
+ break;
+ default :
+ bResult = false;
+ break;
+ }
+ return bResult;
+}
+
+static inline bool stateAllowsTermination(int state) {
+ bool allowTermination = !isStringState(state);
+ if (allowTermination) {
+ switch (state) {
+ case SCE_HB_COMMENTLINE:
+ case SCE_HPHP_COMMENT:
+ case SCE_HP_COMMENTLINE:
+ case SCE_HPA_COMMENTLINE:
+ allowTermination = false;
+ }
+ }
+ return allowTermination;
+}
+
+// not really well done, since it's only comments that should lex the %> and <%
+static inline bool isCommentASPState(int state) {
+ bool bResult;
+
+ switch (state) {
+ case SCE_HJ_COMMENT:
+ case SCE_HJ_COMMENTLINE:
+ case SCE_HJ_COMMENTDOC:
+ case SCE_HB_COMMENTLINE:
+ case SCE_HP_COMMENTLINE:
+ case SCE_HPHP_COMMENT:
+ case SCE_HPHP_COMMENTLINE:
+ bResult = true;
+ break;
+ default :
+ bResult = false;
+ break;
+ }
+ return bResult;
+}
+
+static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
+ bool wordIsNumber = IsNumber(start, styler);
+ char chAttr = SCE_H_ATTRIBUTEUNKNOWN;
+ if (wordIsNumber) {
+ chAttr = SCE_H_NUMBER;
+ } else {
+ char s[100];
+ GetTextSegment(styler, start, end, s, sizeof(s));
+ if (keywords.InList(s))
+ chAttr = SCE_H_ATTRIBUTE;
+ }
+ if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords)
+ // No keywords -> all are known
+ chAttr = SCE_H_ATTRIBUTE;
+ styler.ColourTo(end, chAttr);
+}
+
+static int classifyTagHTML(unsigned int start, unsigned int end,
+ WordList &keywords, Accessor &styler, bool &tagDontFold,
+ bool caseSensitive, bool isXml, bool allowScripts) {
+ char withSpace[30 + 2] = " ";
+ const char *s = withSpace + 1;
+ // Copy after the '<'
+ unsigned int i = 1;
+ for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) {
+ char ch = styler[cPos];
+ if ((ch != '<') && (ch != '/')) {
+ withSpace[i++] = caseSensitive ? ch : static_cast<char>(MakeLowerCase(ch));
+ }
+ }
+
+ //The following is only a quick hack, to see if this whole thing would work
+ //we first need the tagname with a trailing space...
+ withSpace[i] = ' ';
+ withSpace[i+1] = '\0';
+
+ // if the current language is XML, I can fold any tag
+ // if the current language is HTML, I don't want to fold certain tags (input, meta, etc.)
+ //...to find it in the list of no-container-tags
+ tagDontFold = (!isXml) && (NULL != strstr(" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr ", withSpace));
+
+ //now we can remove the trailing space
+ withSpace[i] = '\0';
+
+ // No keywords -> all are known
+ char chAttr = SCE_H_TAGUNKNOWN;
+ if (s[0] == '!') {
+ chAttr = SCE_H_SGML_DEFAULT;
+ } else if (!keywords || keywords.InList(s)) {
+ chAttr = SCE_H_TAG;
+ }
+ styler.ColourTo(end, chAttr);
+ if (chAttr == SCE_H_TAG) {
+ if (allowScripts && 0 == strcmp(s, "script")) {
+ // check to see if this is a self-closing tag by sniffing ahead
+ bool isSelfClose = false;
+ for (unsigned int cPos = end; cPos <= end + 200; cPos++) {
+ char ch = styler.SafeGetCharAt(cPos, '\0');
+ if (ch == '\0' || ch == '>')
+ break;
+ else if (ch == '/' && styler.SafeGetCharAt(cPos + 1, '\0') == '>') {
+ isSelfClose = true;
+ break;
+ }
+ }
+
+ // do not enter a script state if the tag self-closed
+ if (!isSelfClose)
+ chAttr = SCE_H_SCRIPT;
+ } else if (!isXml && 0 == strcmp(s, "comment")) {
+ chAttr = SCE_H_COMMENT;
+ }
+ }
+ return chAttr;
+}
+
+static void classifyWordHTJS(unsigned int start, unsigned int end,
+ WordList &keywords, Accessor &styler, script_mode inScriptType) {
+ char s[30 + 1];
+ unsigned int i = 0;
+ for (; i < end - start + 1 && i < 30; i++) {
+ s[i] = styler[start + i];
+ }
+ s[i] = '\0';
+
+ char chAttr = SCE_HJ_WORD;
+ bool wordIsNumber = IsADigit(s[0]) || ((s[0] == '.') && IsADigit(s[1]));
+ if (wordIsNumber) {
+ chAttr = SCE_HJ_NUMBER;
+ } else if (keywords.InList(s)) {
+ chAttr = SCE_HJ_KEYWORD;
+ }
+ styler.ColourTo(end, statePrintForState(chAttr, inScriptType));
+}
+
+static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) {
+ char chAttr = SCE_HB_IDENTIFIER;
+ bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.');
+ if (wordIsNumber) {
+ chAttr = SCE_HB_NUMBER;
+ } else {
+ char s[100];
+ GetTextSegment(styler, start, end, s, sizeof(s));
+ if (keywords.InList(s)) {
+ chAttr = SCE_HB_WORD;
+ if (strcmp(s, "rem") == 0)
+ chAttr = SCE_HB_COMMENTLINE;
+ }
+ }
+ styler.ColourTo(end, statePrintForState(chAttr, inScriptType));
+ if (chAttr == SCE_HB_COMMENTLINE)
+ return SCE_HB_COMMENTLINE;
+ else
+ return SCE_HB_DEFAULT;
+}
+
+static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType, bool isMako) {
+ bool wordIsNumber = IsADigit(styler[start]);
+ char s[30 + 1];
+ unsigned int i = 0;
+ for (; i < end - start + 1 && i < 30; i++) {
+ s[i] = styler[start + i];
+ }
+ s[i] = '\0';
+ char chAttr = SCE_HP_IDENTIFIER;
+ if (0 == strcmp(prevWord, "class"))
+ chAttr = SCE_HP_CLASSNAME;
+ else if (0 == strcmp(prevWord, "def"))
+ chAttr = SCE_HP_DEFNAME;
+ else if (wordIsNumber)
+ chAttr = SCE_HP_NUMBER;
+ else if (keywords.InList(s))
+ chAttr = SCE_HP_WORD;
+ else if (isMako && 0 == strcmp(s, "block"))
+ chAttr = SCE_HP_WORD;
+ styler.ColourTo(end, statePrintForState(chAttr, inScriptType));
+ strcpy(prevWord, s);
+}
+
+// Update the word colour to default or keyword
+// Called when in a PHP word
+static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
+ char chAttr = SCE_HPHP_DEFAULT;
+ bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1]));
+ if (wordIsNumber) {
+ chAttr = SCE_HPHP_NUMBER;
+ } else {
+ char s[100];
+ GetTextSegment(styler, start, end, s, sizeof(s));
+ if (keywords.InList(s))
+ chAttr = SCE_HPHP_WORD;
+ }
+ styler.ColourTo(end, chAttr);
+}
+
+static bool isWordHSGML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
+ char s[30 + 1];
+ unsigned int i = 0;
+ for (; i < end - start + 1 && i < 30; i++) {
+ s[i] = styler[start + i];
+ }
+ s[i] = '\0';
+ return keywords.InList(s);
+}
+
+static bool isWordCdata(unsigned int start, unsigned int end, Accessor &styler) {
+ char s[30 + 1];
+ unsigned int i = 0;
+ for (; i < end - start + 1 && i < 30; i++) {
+ s[i] = styler[start + i];
+ }
+ s[i] = '\0';
+ return (0 == strcmp(s, "[CDATA["));
+}
+
+// Return the first state to reach when entering a scripting language
+static int StateForScript(script_type scriptLanguage) {
+ int Result;
+ switch (scriptLanguage) {
+ case eScriptVBS:
+ Result = SCE_HB_START;
+ break;
+ case eScriptPython:
+ Result = SCE_HP_START;
+ break;
+ case eScriptPHP:
+ Result = SCE_HPHP_DEFAULT;
+ break;
+ case eScriptXML:
+ Result = SCE_H_TAGUNKNOWN;
+ break;
+ case eScriptSGML:
+ Result = SCE_H_SGML_DEFAULT;
+ break;
+ case eScriptComment:
+ Result = SCE_H_COMMENT;
+ break;
+ default :
+ Result = SCE_HJ_START;
+ break;
+ }
+ return Result;
+}
+
+static inline bool issgmlwordchar(int ch) {
+ return !IsASCII(ch) ||
+ (isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '[');
+}
+
+static inline bool IsPhpWordStart(int ch) {
+ return (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
+}
+
+static inline bool IsPhpWordChar(int ch) {
+ return IsADigit(ch) || IsPhpWordStart(ch);
+}
+
+static bool InTagState(int state) {
+ return state == SCE_H_TAG || state == SCE_H_TAGUNKNOWN ||
+ state == SCE_H_SCRIPT ||
+ state == SCE_H_ATTRIBUTE || state == SCE_H_ATTRIBUTEUNKNOWN ||
+ state == SCE_H_NUMBER || state == SCE_H_OTHER ||
+ state == SCE_H_DOUBLESTRING || state == SCE_H_SINGLESTRING;
+}
+
+static bool IsCommentState(const int state) {
+ return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT;
+}
+
+static bool IsScriptCommentState(const int state) {
+ return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT ||
+ state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE;
+}
+
+static bool isLineEnd(int ch) {
+ return ch == '\r' || ch == '\n';
+}
+
+static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) {
+ if (strlen(blockType) == 0) {
+ return ((ch == '%') && (chNext == '>'));
+ } else if ((0 == strcmp(blockType, "inherit")) ||
+ (0 == strcmp(blockType, "namespace")) ||
+ (0 == strcmp(blockType, "include")) ||
+ (0 == strcmp(blockType, "page"))) {
+ return ((ch == '/') && (chNext == '>'));
+ } else if (0 == strcmp(blockType, "%")) {
+ if (ch == '/' && isLineEnd(chNext))
+ return 1;
+ else
+ return isLineEnd(ch);
+ } else if (0 == strcmp(blockType, "{")) {
+ return ch == '}';
+ } else {
+ return (ch == '>');
+ }
+}
+
+static bool isDjangoBlockEnd(const int ch, const int chNext, const char *blockType) {
+ if (strlen(blockType) == 0) {
+ return 0;
+ } else if (0 == strcmp(blockType, "%")) {
+ return ((ch == '%') && (chNext == '}'));
+ } else if (0 == strcmp(blockType, "{")) {
+ return ((ch == '}') && (chNext == '}'));
+ } else {
+ return 0;
+ }
+}
+
+static bool isPHPStringState(int state) {
+ return
+ (state == SCE_HPHP_HSTRING) ||
+ (state == SCE_HPHP_SIMPLESTRING) ||
+ (state == SCE_HPHP_HSTRING_VARIABLE) ||
+ (state == SCE_HPHP_COMPLEX_VARIABLE);
+}
+
+static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler, bool &isSimpleString) {
+ int j;
+ const int beginning = i - 1;
+ bool isValidSimpleString = false;
+
+ while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t'))
+ i++;
+
+ char ch = styler.SafeGetCharAt(i);
+ const char chNext = styler.SafeGetCharAt(i + 1);
+ if (!IsPhpWordStart(ch)) {
+ if (ch == '\'' && IsPhpWordStart(chNext)) {
+ i++;
+ ch = chNext;
+ isSimpleString = true;
+ } else {
+ phpStringDelimiter[0] = '\0';
+ return beginning;
+ }
+ }
+ phpStringDelimiter[0] = ch;
+ i++;
+
+ for (j = i; j < lengthDoc && !isLineEnd(styler[j]); j++) {
+ if (!IsPhpWordChar(styler[j])) {
+ if (isSimpleString && (styler[j] == '\'') && isLineEnd(styler.SafeGetCharAt(j + 1))) {
+ isValidSimpleString = true;
+ j++;
+ break;
+ } else {
+ phpStringDelimiter[0] = '\0';
+ return beginning;
+ }
+ }
+ if (j - i < phpStringDelimiterSize - 2)
+ phpStringDelimiter[j-i+1] = styler[j];
+ else
+ i++;
+ }
+ if (isSimpleString && !isValidSimpleString) {
+ phpStringDelimiter[0] = '\0';
+ return beginning;
+ }
+ phpStringDelimiter[j-i+1 - (isSimpleString ? 1 : 0)] = '\0';
+ return j - 1;
+}
+
+static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler, bool isXml) {
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords
+
+ styler.StartAt(startPos);
+ char prevWord[200];
+ prevWord[0] = '\0';
+ char phpStringDelimiter[200]; // PHP is not limited in length, we are
+ phpStringDelimiter[0] = '\0';
+ int StateToPrint = initStyle;
+ int state = stateForPrintState(StateToPrint);
+ char makoBlockType[200];
+ makoBlockType[0] = '\0';
+ int makoComment = 0;
+ char djangoBlockType[2];
+ djangoBlockType[0] = '\0';
+
+ // If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen
+ if (InTagState(state)) {
+ while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) {
+ int backLineStart = styler.LineStart(styler.GetLine(startPos-1));
+ length += startPos - backLineStart;
+ startPos = backLineStart;
+ }
+ state = SCE_H_DEFAULT;
+ }
+ // String can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState
+ if (isPHPStringState(state)) {
+ while (startPos > 0 && (isPHPStringState(state) || !isLineEnd(styler[startPos - 1]))) {
+ startPos--;
+ length++;
+ state = styler.StyleAt(startPos);
+ }
+ if (startPos == 0)
+ state = SCE_H_DEFAULT;
+ }
+ styler.StartAt(startPos);
+
+ int lineCurrent = styler.GetLine(startPos);
+ int lineState;
+ if (lineCurrent > 0) {
+ lineState = styler.GetLineState(lineCurrent-1);
+ } else {
+ // Default client and ASP scripting language is JavaScript
+ lineState = eScriptJS << 8;
+
+ // property asp.default.language
+ // Script in ASP code is initially assumed to be in JavaScript.
+ // To change this to VBScript set asp.default.language to 2. Python is 3.
+ lineState |= styler.GetPropertyInt("asp.default.language", eScriptJS) << 4;
+ }
+ script_mode inScriptType = script_mode((lineState >> 0) & 0x03); // 2 bits of scripting mode
+ bool tagOpened = (lineState >> 2) & 0x01; // 1 bit to know if we are in an opened tag
+ bool tagClosing = (lineState >> 3) & 0x01; // 1 bit to know if we are in a closing tag
+ bool tagDontFold = false; //some HTML tags should not be folded
+ script_type aspScript = script_type((lineState >> 4) & 0x0F); // 4 bits of script name
+ script_type clientScript = script_type((lineState >> 8) & 0x0F); // 4 bits of script name
+ int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state
+
+ script_type scriptLanguage = ScriptOfState(state);
+ // If eNonHtmlScript coincides with SCE_H_COMMENT, assume eScriptComment
+ if (inScriptType == eNonHtmlScript && state == SCE_H_COMMENT) {
+ scriptLanguage = eScriptComment;
+ }
+ script_type beforeLanguage = ScriptOfState(beforePreProc);
+
+ // property fold.html
+ // Folding is turned on or off for HTML and XML files with this option.
+ // The fold option must also be on for folding to occur.
+ const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0;
+
+ const bool fold = foldHTML && styler.GetPropertyInt("fold", 0);
+
+ // property fold.html.preprocessor
+ // Folding is turned on or off for scripts embedded in HTML files with this option.
+ // The default is on.
+ const bool foldHTMLPreprocessor = foldHTML && styler.GetPropertyInt("fold.html.preprocessor", 1);
+
+ const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+
+ // property fold.hypertext.comment
+ // Allow folding for comments in scripts embedded in HTML.
+ // The default is off.
+ const bool foldComment = fold && styler.GetPropertyInt("fold.hypertext.comment", 0) != 0;
+
+ // property fold.hypertext.heredoc
+ // Allow folding for heredocs in scripts embedded in HTML.
+ // The default is off.
+ const bool foldHeredoc = fold && styler.GetPropertyInt("fold.hypertext.heredoc", 0) != 0;
+
+ // property html.tags.case.sensitive
+ // For XML and HTML, setting this property to 1 will make tags match in a case
+ // sensitive way which is the expected behaviour for XML and XHTML.
+ const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0;
+
+ // property lexer.xml.allow.scripts
+ // Set to 0 to disable scripts in XML.
+ const bool allowScripts = styler.GetPropertyInt("lexer.xml.allow.scripts", 1) != 0;
+
+ // property lexer.html.mako
+ // Set to 1 to enable the mako template language.
+ const bool isMako = styler.GetPropertyInt("lexer.html.mako", 0) != 0;
+
+ // property lexer.html.django
+ // Set to 1 to enable the django template language.
+ const bool isDjango = styler.GetPropertyInt("lexer.html.django", 0) != 0;
+
+ const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
+ const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
+ const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
+ // TODO: also handle + and - (except if they're part of ++ or --) and return keywords
+ const CharacterSet setOKBeforeJSRE(CharacterSet::setNone, "([{=,:;!%^&*|?~");
+
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ int visibleChars = 0;
+ int lineStartVisibleChars = 0;
+
+ int chPrev = ' ';
+ int ch = ' ';
+ int chPrevNonWhite = ' ';
+ // look back to set chPrevNonWhite properly for better regex colouring
+ if (scriptLanguage == eScriptJS && startPos > 0) {
+ int back = startPos;
+ int style = 0;
+ while (--back) {
+ style = styler.StyleAt(back);
+ if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC)
+ // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE
+ break;
+ }
+ if (style == SCE_HJ_SYMBOLS) {
+ chPrevNonWhite = static_cast<unsigned char>(styler.SafeGetCharAt(back));
+ }
+ }
+
+ styler.StartSegment(startPos);
+ const int lengthDoc = startPos + length;
+ for (int i = startPos; i < lengthDoc; i++) {
+ const int chPrev2 = chPrev;
+ chPrev = ch;
+ if (!IsASpace(ch) && state != SCE_HJ_COMMENT &&
+ state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC)
+ chPrevNonWhite = ch;
+ ch = static_cast<unsigned char>(styler[i]);
+ int chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ const int chNext2 = static_cast<unsigned char>(styler.SafeGetCharAt(i + 2));
+
+ // Handle DBCS codepages
+ if (styler.IsLeadByte(static_cast<char>(ch))) {
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ if ((!IsASpace(ch) || !foldCompact) && fold)
+ visibleChars++;
+ if (!IsASpace(ch))
+ lineStartVisibleChars++;
+
+ // decide what is the current state to print (depending of the script tag)
+ StateToPrint = statePrintForState(state, inScriptType);
+
+ // handle script folding
+ if (fold) {
+ switch (scriptLanguage) {
+ case eScriptJS:
+ case eScriptPHP:
+ //not currently supported case eScriptVBS:
+
+ if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) {
+ //Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle);
+ //if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) {
+ if (ch == '#') {
+ int j = i + 1;
+ while ((j < lengthDoc) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "region") || styler.Match(j, "if")) {
+ levelCurrent++;
+ } else if (styler.Match(j, "end")) {
+ levelCurrent--;
+ }
+ } else if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*'))) {
+ levelCurrent += (((ch == '{') || (ch == '/')) ? 1 : -1);
+ }
+ } else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT)) && foldComment && (ch == '*') && (chNext == '/')) {
+ levelCurrent--;
+ }
+ break;
+ case eScriptPython:
+ if (state != SCE_HP_COMMENTLINE && !isMako) {
+ if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) {
+ levelCurrent++;
+ } else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) {
+ // check if the number of tabs is lower than the level
+ int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8;
+ for (int j = 0; Findlevel > 0; j++) {
+ char chTmp = styler.SafeGetCharAt(i + j + 1);
+ if (chTmp == '\t') {
+ Findlevel -= 8;
+ } else if (chTmp == ' ') {
+ Findlevel--;
+ } else {
+ break;
+ }
+ }
+
+ if (Findlevel > 0) {
+ levelCurrent -= Findlevel / 8;
+ if (Findlevel % 8)
+ levelCurrent--;
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
+ // Avoid triggering two times on Dos/Win
+ // New line -> record any line state onto /next/ line
+ if (fold) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ styler.SetLevel(lineCurrent, lev);
+ visibleChars = 0;
+ levelPrev = levelCurrent;
+ }
+ styler.SetLineState(lineCurrent,
+ ((inScriptType & 0x03) << 0) |
+ ((tagOpened ? 1 : 0) << 2) |
+ ((tagClosing ? 1 : 0) << 3) |
+ ((aspScript & 0x0F) << 4) |
+ ((clientScript & 0x0F) << 8) |
+ ((beforePreProc & 0xFF) << 12));
+ lineCurrent++;
+ lineStartVisibleChars = 0;
+ }
+
+ // handle start of Mako comment line
+ if (isMako && ch == '#' && chNext == '#') {
+ makoComment = 1;
+ state = SCE_HP_COMMENTLINE;
+ }
+
+ // handle end of Mako comment line
+ else if (isMako && makoComment && (ch == '\r' || ch == '\n')) {
+ makoComment = 0;
+ styler.ColourTo(i, StateToPrint);
+ if (scriptLanguage == eScriptPython) {
+ state = SCE_HP_DEFAULT;
+ } else {
+ state = SCE_H_DEFAULT;
+ }
+ }
+
+ // Allow falling through to mako handling code if newline is going to end a block
+ if (((ch == '\r' && chNext != '\n') || (ch == '\n')) &&
+ (!isMako || (0 != strcmp(makoBlockType, "%")))) {
+ }
+ // Ignore everything in mako comment until the line ends
+ else if (isMako && makoComment) {
+ }
+
+ // generic end of script processing
+ else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) {
+ // Check if it's the end of the script tag (or any other HTML tag)
+ switch (state) {
+ // in these cases, you can embed HTML tags (to confirm !!!!!!!!!!!!!!!!!!!!!!)
+ case SCE_H_DOUBLESTRING:
+ case SCE_H_SINGLESTRING:
+ case SCE_HJ_COMMENT:
+ case SCE_HJ_COMMENTDOC:
+ //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide
+ // the end of script marker from some JS interpreters.
+ case SCE_HB_COMMENTLINE:
+ case SCE_HBA_COMMENTLINE:
+ case SCE_HJ_DOUBLESTRING:
+ case SCE_HJ_SINGLESTRING:
+ case SCE_HJ_REGEX:
+ case SCE_HB_STRING:
+ case SCE_HBA_STRING:
+ case SCE_HP_STRING:
+ case SCE_HP_TRIPLE:
+ case SCE_HP_TRIPLEDOUBLE:
+ case SCE_HPHP_HSTRING:
+ case SCE_HPHP_SIMPLESTRING:
+ case SCE_HPHP_COMMENT:
+ case SCE_HPHP_COMMENTLINE:
+ break;
+ default :
+ // check if the closing tag is a script tag
+ if (const char *tag =
+ state == SCE_HJ_COMMENTLINE || isXml ? "script" :
+ state == SCE_H_COMMENT ? "comment" : 0) {
+ int j = i + 2;
+ int chr;
+ do {
+ chr = static_cast<int>(*tag++);
+ } while (chr != 0 && chr == MakeLowerCase(styler.SafeGetCharAt(j++)));
+ if (chr != 0) break;
+ }
+ // closing tag of the script (it's a closing HTML tag anyway)
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_TAGUNKNOWN;
+ inScriptType = eHtml;
+ scriptLanguage = eScriptNone;
+ clientScript = eScriptJS;
+ i += 2;
+ visibleChars += 2;
+ tagClosing = true;
+ continue;
+ }
+ }
+
+ /////////////////////////////////////
+ // handle the start of PHP pre-processor = Non-HTML
+ else if ((state != SCE_H_ASPAT) &&
+ !isPHPStringState(state) &&
+ (state != SCE_HPHP_COMMENT) &&
+ (state != SCE_HPHP_COMMENTLINE) &&
+ (ch == '<') &&
+ (chNext == '?') &&
+ !IsScriptCommentState(state)) {
+ beforeLanguage = scriptLanguage;
+ scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
+ if ((scriptLanguage != eScriptPHP) && (isStringState(state) || (state==SCE_H_COMMENT))) continue;
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ i++;
+ visibleChars++;
+ i += PrintScriptingIndicatorOffset(styler, styler.GetStartSegment() + 2, i + 6);
+ if (scriptLanguage == eScriptXML)
+ styler.ColourTo(i, SCE_H_XMLSTART);
+ else
+ styler.ColourTo(i, SCE_H_QUESTION);
+ state = StateForScript(scriptLanguage);
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+ // Fold whole script, but not if the XML first tag (all XML-like tags in this case)
+ if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
+ levelCurrent++;
+ }
+ // should be better
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ }
+
+ // handle the start Mako template Python code
+ else if (isMako && scriptLanguage == eScriptNone && ((ch == '<' && chNext == '%') ||
+ (lineStartVisibleChars == 1 && ch == '%') ||
+ (lineStartVisibleChars == 1 && ch == '/' && chNext == '%') ||
+ (ch == '$' && chNext == '{') ||
+ (ch == '<' && chNext == '/' && chNext2 == '%'))) {
+ if (ch == '%' || ch == '/')
+ StringCopy(makoBlockType, "%");
+ else if (ch == '$')
+ StringCopy(makoBlockType, "{");
+ else if (chNext == '/')
+ GetNextWord(styler, i+3, makoBlockType, sizeof(makoBlockType));
+ else
+ GetNextWord(styler, i+2, makoBlockType, sizeof(makoBlockType));
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+
+ if (chNext == '/') {
+ i += 2;
+ visibleChars += 2;
+ } else if (ch != '%') {
+ i++;
+ visibleChars++;
+ }
+ state = SCE_HP_START;
+ scriptLanguage = eScriptPython;
+ styler.ColourTo(i, SCE_H_ASP);
+
+ if (ch != '%' && ch != '$' && ch != '/') {
+ i += static_cast<int>(strlen(makoBlockType));
+ visibleChars += static_cast<int>(strlen(makoBlockType));
+ if (keywords4.InList(makoBlockType))
+ styler.ColourTo(i, SCE_HP_WORD);
+ else
+ styler.ColourTo(i, SCE_H_TAGUNKNOWN);
+ }
+
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ }
+
+ // handle the start/end of Django comment
+ else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ beforeLanguage = scriptLanguage;
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+ i += 1;
+ visibleChars += 1;
+ scriptLanguage = eScriptComment;
+ state = SCE_H_COMMENT;
+ styler.ColourTo(i, SCE_H_ASP);
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ } else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ i += 1;
+ visibleChars += 1;
+ styler.ColourTo(i, SCE_H_ASP);
+ state = beforePreProc;
+ if (inScriptType == eNonHtmlScriptPreProc)
+ inScriptType = eNonHtmlScript;
+ else
+ inScriptType = eHtml;
+ scriptLanguage = beforeLanguage;
+ continue;
+ }
+
+ // handle the start Django template code
+ else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) {
+ if (chNext == '%')
+ StringCopy(djangoBlockType, "%");
+ else
+ StringCopy(djangoBlockType, "{");
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+
+ i += 1;
+ visibleChars += 1;
+ state = SCE_HP_START;
+ beforeLanguage = scriptLanguage;
+ scriptLanguage = eScriptPython;
+ styler.ColourTo(i, SCE_H_ASP);
+
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ }
+
+ // handle the start of ASP pre-processor = Non-HTML
+ else if (!isMako && !isDjango && !isCommentASPState(state) && (ch == '<') && (chNext == '%') && !isPHPStringState(state)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+
+ if (chNext2 == '@') {
+ i += 2; // place as if it was the second next char treated
+ visibleChars += 2;
+ state = SCE_H_ASPAT;
+ } else if ((chNext2 == '-') && (styler.SafeGetCharAt(i + 3) == '-')) {
+ styler.ColourTo(i + 3, SCE_H_ASP);
+ state = SCE_H_XCCOMMENT;
+ scriptLanguage = eScriptVBS;
+ continue;
+ } else {
+ if (chNext2 == '=') {
+ i += 2; // place as if it was the second next char treated
+ visibleChars += 2;
+ } else {
+ i++; // place as if it was the next char treated
+ visibleChars++;
+ }
+
+ state = StateForScript(aspScript);
+ }
+ scriptLanguage = eScriptVBS;
+ styler.ColourTo(i, SCE_H_ASP);
+ // fold whole script
+ if (foldHTMLPreprocessor)
+ levelCurrent++;
+ // should be better
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ }
+
+ /////////////////////////////////////
+ // handle the start of SGML language (DTD)
+ else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) &&
+ (chPrev == '<') &&
+ (ch == '!') &&
+ (StateToPrint != SCE_H_CDATA) &&
+ (!IsCommentState(StateToPrint)) &&
+ (!IsScriptCommentState(StateToPrint))) {
+ beforePreProc = state;
+ styler.ColourTo(i - 2, StateToPrint);
+ if ((chNext == '-') && (chNext2 == '-')) {
+ state = SCE_H_COMMENT; // wait for a pending command
+ styler.ColourTo(i + 2, SCE_H_COMMENT);
+ i += 2; // follow styling after the --
+ } else if (isWordCdata(i + 1, i + 7, styler)) {
+ state = SCE_H_CDATA;
+ } else {
+ styler.ColourTo(i, SCE_H_SGML_DEFAULT); // <! is default
+ scriptLanguage = eScriptSGML;
+ state = SCE_H_SGML_COMMAND; // wait for a pending command
+ }
+ // fold whole tag (-- when closing the tag)
+ if (foldHTMLPreprocessor || state == SCE_H_COMMENT || state == SCE_H_CDATA)
+ levelCurrent++;
+ continue;
+ }
+
+ // handle the end of Mako Python code
+ else if (isMako &&
+ ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) &&
+ (scriptLanguage != eScriptNone) && stateAllowsTermination(state) &&
+ isMakoBlockEnd(ch, chNext, makoBlockType)) {
+ if (state == SCE_H_ASPAT) {
+ aspScript = segIsScriptingIndicator(styler,
+ styler.GetStartSegment(), i - 1, aspScript);
+ }
+ if (state == SCE_HP_WORD) {
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako);
+ } else {
+ styler.ColourTo(i - 1, StateToPrint);
+ }
+ if (0 != strcmp(makoBlockType, "%") && (0 != strcmp(makoBlockType, "{")) && ch != '>') {
+ i++;
+ visibleChars++;
+ }
+ else if (0 == strcmp(makoBlockType, "%") && ch == '/') {
+ i++;
+ visibleChars++;
+ }
+ if (0 != strcmp(makoBlockType, "%") || ch == '/') {
+ styler.ColourTo(i, SCE_H_ASP);
+ }
+ state = beforePreProc;
+ if (inScriptType == eNonHtmlScriptPreProc)
+ inScriptType = eNonHtmlScript;
+ else
+ inScriptType = eHtml;
+ scriptLanguage = eScriptNone;
+ continue;
+ }
+
+ // handle the end of Django template code
+ else if (isDjango &&
+ ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) &&
+ (scriptLanguage != eScriptNone) && stateAllowsTermination(state) &&
+ isDjangoBlockEnd(ch, chNext, djangoBlockType)) {
+ if (state == SCE_H_ASPAT) {
+ aspScript = segIsScriptingIndicator(styler,
+ styler.GetStartSegment(), i - 1, aspScript);
+ }
+ if (state == SCE_HP_WORD) {
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako);
+ } else {
+ styler.ColourTo(i - 1, StateToPrint);
+ }
+ i += 1;
+ visibleChars += 1;
+ styler.ColourTo(i, SCE_H_ASP);
+ state = beforePreProc;
+ if (inScriptType == eNonHtmlScriptPreProc)
+ inScriptType = eNonHtmlScript;
+ else
+ inScriptType = eHtml;
+ scriptLanguage = beforeLanguage;
+ continue;
+ }
+
+ // handle the end of a pre-processor = Non-HTML
+ else if ((!isMako && !isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) &&
+ (((scriptLanguage != eScriptNone) && stateAllowsTermination(state))) &&
+ (((ch == '%') || (ch == '?')) && (chNext == '>'))) ||
+ ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) {
+ if (state == SCE_H_ASPAT) {
+ aspScript = segIsScriptingIndicator(styler,
+ styler.GetStartSegment(), i - 1, aspScript);
+ }
+ // Bounce out of any ASP mode
+ switch (state) {
+ case SCE_HJ_WORD:
+ classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType);
+ break;
+ case SCE_HB_WORD:
+ classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType);
+ break;
+ case SCE_HP_WORD:
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako);
+ break;
+ case SCE_HPHP_WORD:
+ classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler);
+ break;
+ case SCE_H_XCCOMMENT:
+ styler.ColourTo(i - 1, state);
+ break;
+ default :
+ styler.ColourTo(i - 1, StateToPrint);
+ break;
+ }
+ if (scriptLanguage != eScriptSGML) {
+ i++;
+ visibleChars++;
+ }
+ if (ch == '%')
+ styler.ColourTo(i, SCE_H_ASP);
+ else if (scriptLanguage == eScriptXML)
+ styler.ColourTo(i, SCE_H_XMLEND);
+ else if (scriptLanguage == eScriptSGML)
+ styler.ColourTo(i, SCE_H_SGML_DEFAULT);
+ else
+ styler.ColourTo(i, SCE_H_QUESTION);
+ state = beforePreProc;
+ if (inScriptType == eNonHtmlScriptPreProc)
+ inScriptType = eNonHtmlScript;
+ else
+ inScriptType = eHtml;
+ // Unfold all scripting languages, except for XML tag
+ if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
+ levelCurrent--;
+ }
+ scriptLanguage = beforeLanguage;
+ continue;
+ }
+ /////////////////////////////////////
+
+ switch (state) {
+ case SCE_H_DEFAULT:
+ if (ch == '<') {
+ // in HTML, fold on tag open and unfold on tag close
+ tagOpened = true;
+ tagClosing = (chNext == '/');
+ styler.ColourTo(i - 1, StateToPrint);
+ if (chNext != '!')
+ state = SCE_H_TAGUNKNOWN;
+ } else if (ch == '&') {
+ styler.ColourTo(i - 1, SCE_H_DEFAULT);
+ state = SCE_H_ENTITY;
+ }
+ break;
+ case SCE_H_SGML_DEFAULT:
+ case SCE_H_SGML_BLOCK_DEFAULT:
+// if (scriptLanguage == eScriptSGMLblock)
+// StateToPrint = SCE_H_SGML_BLOCK_DEFAULT;
+
+ if (ch == '\"') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_SGML_DOUBLESTRING;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_SGML_SIMPLESTRING;
+ } else if ((ch == '-') && (chPrev == '-')) {
+ if (static_cast<int>(styler.GetStartSegment()) <= (i - 2)) {
+ styler.ColourTo(i - 2, StateToPrint);
+ }
+ state = SCE_H_SGML_COMMENT;
+ } else if (IsASCII(ch) && isalpha(ch) && (chPrev == '%')) {
+ styler.ColourTo(i - 2, StateToPrint);
+ state = SCE_H_SGML_ENTITY;
+ } else if (ch == '#') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_SGML_SPECIAL;
+ } else if (ch == '[') {
+ styler.ColourTo(i - 1, StateToPrint);
+ scriptLanguage = eScriptSGMLblock;
+ state = SCE_H_SGML_BLOCK_DEFAULT;
+ } else if (ch == ']') {
+ if (scriptLanguage == eScriptSGMLblock) {
+ styler.ColourTo(i, StateToPrint);
+ scriptLanguage = eScriptSGML;
+ } else {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, SCE_H_SGML_ERROR);
+ }
+ state = SCE_H_SGML_DEFAULT;
+ } else if (scriptLanguage == eScriptSGMLblock) {
+ if ((ch == '!') && (chPrev == '<')) {
+ styler.ColourTo(i - 2, StateToPrint);
+ styler.ColourTo(i, SCE_H_SGML_DEFAULT);
+ state = SCE_H_SGML_COMMAND;
+ } else if (ch == '>') {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, SCE_H_SGML_DEFAULT);
+ }
+ }
+ break;
+ case SCE_H_SGML_COMMAND:
+ if ((ch == '-') && (chPrev == '-')) {
+ styler.ColourTo(i - 2, StateToPrint);
+ state = SCE_H_SGML_COMMENT;
+ } else if (!issgmlwordchar(ch)) {
+ if (isWordHSGML(styler.GetStartSegment(), i - 1, keywords6, styler)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_SGML_1ST_PARAM;
+ } else {
+ state = SCE_H_SGML_ERROR;
+ }
+ }
+ break;
+ case SCE_H_SGML_1ST_PARAM:
+ // wait for the beginning of the word
+ if ((ch == '-') && (chPrev == '-')) {
+ if (scriptLanguage == eScriptSGMLblock) {
+ styler.ColourTo(i - 2, SCE_H_SGML_BLOCK_DEFAULT);
+ } else {
+ styler.ColourTo(i - 2, SCE_H_SGML_DEFAULT);
+ }
+ state = SCE_H_SGML_1ST_PARAM_COMMENT;
+ } else if (issgmlwordchar(ch)) {
+ if (scriptLanguage == eScriptSGMLblock) {
+ styler.ColourTo(i - 1, SCE_H_SGML_BLOCK_DEFAULT);
+ } else {
+ styler.ColourTo(i - 1, SCE_H_SGML_DEFAULT);
+ }
+ // find the length of the word
+ int size = 1;
+ while (setHTMLWord.Contains(static_cast<unsigned char>(styler.SafeGetCharAt(i + size))))
+ size++;
+ styler.ColourTo(i + size - 1, StateToPrint);
+ i += size - 1;
+ visibleChars += size - 1;
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ if (scriptLanguage == eScriptSGMLblock) {
+ state = SCE_H_SGML_BLOCK_DEFAULT;
+ } else {
+ state = SCE_H_SGML_DEFAULT;
+ }
+ continue;
+ }
+ break;
+ case SCE_H_SGML_ERROR:
+ if ((ch == '-') && (chPrev == '-')) {
+ styler.ColourTo(i - 2, StateToPrint);
+ state = SCE_H_SGML_COMMENT;
+ }
+ break;
+ case SCE_H_SGML_DOUBLESTRING:
+ if (ch == '\"') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_SGML_DEFAULT;
+ }
+ break;
+ case SCE_H_SGML_SIMPLESTRING:
+ if (ch == '\'') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_SGML_DEFAULT;
+ }
+ break;
+ case SCE_H_SGML_COMMENT:
+ if ((ch == '-') && (chPrev == '-')) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_SGML_DEFAULT;
+ }
+ break;
+ case SCE_H_CDATA:
+ if ((chPrev2 == ']') && (chPrev == ']') && (ch == '>')) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_DEFAULT;
+ levelCurrent--;
+ }
+ break;
+ case SCE_H_COMMENT:
+ if ((scriptLanguage != eScriptComment) && (chPrev2 == '-') && (chPrev == '-') && (ch == '>')) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_DEFAULT;
+ levelCurrent--;
+ }
+ break;
+ case SCE_H_SGML_1ST_PARAM_COMMENT:
+ if ((ch == '-') && (chPrev == '-')) {
+ styler.ColourTo(i, SCE_H_SGML_COMMENT);
+ state = SCE_H_SGML_1ST_PARAM;
+ }
+ break;
+ case SCE_H_SGML_SPECIAL:
+ if (!(IsASCII(ch) && isupper(ch))) {
+ styler.ColourTo(i - 1, StateToPrint);
+ if (isalnum(ch)) {
+ state = SCE_H_SGML_ERROR;
+ } else {
+ state = SCE_H_SGML_DEFAULT;
+ }
+ }
+ break;
+ case SCE_H_SGML_ENTITY:
+ if (ch == ';') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_SGML_DEFAULT;
+ } else if (!(IsASCII(ch) && isalnum(ch)) && ch != '-' && ch != '.') {
+ styler.ColourTo(i, SCE_H_SGML_ERROR);
+ state = SCE_H_SGML_DEFAULT;
+ }
+ break;
+ case SCE_H_ENTITY:
+ if (ch == ';') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_DEFAULT;
+ }
+ if (ch != '#' && !(IsASCII(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
+ && ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML
+ if (!IsASCII(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
+ styler.ColourTo(i-1, SCE_H_TAGUNKNOWN);
+ else
+ styler.ColourTo(i, SCE_H_TAGUNKNOWN);
+ state = SCE_H_DEFAULT;
+ }
+ break;
+ case SCE_H_TAGUNKNOWN:
+ if (!setTagContinue.Contains(ch) && !((ch == '/') && (chPrev == '<'))) {
+ int eClass = classifyTagHTML(styler.GetStartSegment(),
+ i - 1, keywords, styler, tagDontFold, caseSensitive, isXml, allowScripts);
+ if (eClass == SCE_H_SCRIPT || eClass == SCE_H_COMMENT) {
+ if (!tagClosing) {
+ inScriptType = eNonHtmlScript;
+ scriptLanguage = eClass == SCE_H_SCRIPT ? clientScript : eScriptComment;
+ } else {
+ scriptLanguage = eScriptNone;
+ }
+ eClass = SCE_H_TAG;
+ }
+ if (ch == '>') {
+ styler.ColourTo(i, eClass);
+ if (inScriptType == eNonHtmlScript) {
+ state = StateForScript(scriptLanguage);
+ } else {
+ state = SCE_H_DEFAULT;
+ }
+ tagOpened = false;
+ if (!tagDontFold) {
+ if (tagClosing) {
+ levelCurrent--;
+ } else {
+ levelCurrent++;
+ }
+ }
+ tagClosing = false;
+ } else if (ch == '/' && chNext == '>') {
+ if (eClass == SCE_H_TAGUNKNOWN) {
+ styler.ColourTo(i + 1, SCE_H_TAGUNKNOWN);
+ } else {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i + 1, SCE_H_TAGEND);
+ }
+ i++;
+ ch = chNext;
+ state = SCE_H_DEFAULT;
+ tagOpened = false;
+ } else {
+ if (eClass != SCE_H_TAGUNKNOWN) {
+ if (eClass == SCE_H_SGML_DEFAULT) {
+ state = SCE_H_SGML_DEFAULT;
+ } else {
+ state = SCE_H_OTHER;
+ }
+ }
+ }
+ }
+ break;
+ case SCE_H_ATTRIBUTE:
+ if (!setAttributeContinue.Contains(ch)) {
+ if (inScriptType == eNonHtmlScript) {
+ int scriptLanguagePrev = scriptLanguage;
+ clientScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, scriptLanguage);
+ scriptLanguage = clientScript;
+ if ((scriptLanguagePrev != scriptLanguage) && (scriptLanguage == eScriptNone))
+ inScriptType = eHtml;
+ }
+ classifyAttribHTML(styler.GetStartSegment(), i - 1, keywords, styler);
+ if (ch == '>') {
+ styler.ColourTo(i, SCE_H_TAG);
+ if (inScriptType == eNonHtmlScript) {
+ state = StateForScript(scriptLanguage);
+ } else {
+ state = SCE_H_DEFAULT;
+ }
+ tagOpened = false;
+ if (!tagDontFold) {
+ if (tagClosing) {
+ levelCurrent--;
+ } else {
+ levelCurrent++;
+ }
+ }
+ tagClosing = false;
+ } else if (ch == '=') {
+ styler.ColourTo(i, SCE_H_OTHER);
+ state = SCE_H_VALUE;
+ } else {
+ state = SCE_H_OTHER;
+ }
+ }
+ break;
+ case SCE_H_OTHER:
+ if (ch == '>') {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, SCE_H_TAG);
+ if (inScriptType == eNonHtmlScript) {
+ state = StateForScript(scriptLanguage);
+ } else {
+ state = SCE_H_DEFAULT;
+ }
+ tagOpened = false;
+ if (!tagDontFold) {
+ if (tagClosing) {
+ levelCurrent--;
+ } else {
+ levelCurrent++;
+ }
+ }
+ tagClosing = false;
+ } else if (ch == '\"') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_DOUBLESTRING;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_SINGLESTRING;
+ } else if (ch == '=') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_H_VALUE;
+ } else if (ch == '/' && chNext == '>') {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i + 1, SCE_H_TAGEND);
+ i++;
+ ch = chNext;
+ state = SCE_H_DEFAULT;
+ tagOpened = false;
+ } else if (ch == '?' && chNext == '>') {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i + 1, SCE_H_XMLEND);
+ i++;
+ ch = chNext;
+ state = SCE_H_DEFAULT;
+ } else if (setHTMLWord.Contains(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_H_ATTRIBUTE;
+ }
+ break;
+ case SCE_H_DOUBLESTRING:
+ if (ch == '\"') {
+ if (inScriptType == eNonHtmlScript) {
+ scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage);
+ }
+ styler.ColourTo(i, SCE_H_DOUBLESTRING);
+ state = SCE_H_OTHER;
+ }
+ break;
+ case SCE_H_SINGLESTRING:
+ if (ch == '\'') {
+ if (inScriptType == eNonHtmlScript) {
+ scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage);
+ }
+ styler.ColourTo(i, SCE_H_SINGLESTRING);
+ state = SCE_H_OTHER;
+ }
+ break;
+ case SCE_H_VALUE:
+ if (!setHTMLWord.Contains(ch)) {
+ if (ch == '\"' && chPrev == '=') {
+ // Should really test for being first character
+ state = SCE_H_DOUBLESTRING;
+ } else if (ch == '\'' && chPrev == '=') {
+ state = SCE_H_SINGLESTRING;
+ } else {
+ if (IsNumber(styler.GetStartSegment(), styler)) {
+ styler.ColourTo(i - 1, SCE_H_NUMBER);
+ } else {
+ styler.ColourTo(i - 1, StateToPrint);
+ }
+ if (ch == '>') {
+ styler.ColourTo(i, SCE_H_TAG);
+ if (inScriptType == eNonHtmlScript) {
+ state = StateForScript(scriptLanguage);
+ } else {
+ state = SCE_H_DEFAULT;
+ }
+ tagOpened = false;
+ if (!tagDontFold) {
+ if (tagClosing) {
+ levelCurrent--;
+ } else {
+ levelCurrent++;
+ }
+ }
+ tagClosing = false;
+ } else {
+ state = SCE_H_OTHER;
+ }
+ }
+ }
+ break;
+ case SCE_HJ_DEFAULT:
+ case SCE_HJ_START:
+ case SCE_HJ_SYMBOLS:
+ if (IsAWordStart(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_WORD;
+ } else if (ch == '/' && chNext == '*') {
+ styler.ColourTo(i - 1, StateToPrint);
+ if (chNext2 == '*')
+ state = SCE_HJ_COMMENTDOC;
+ else
+ state = SCE_HJ_COMMENT;
+ if (chNext2 == '/') {
+ // Eat the * so it isn't used for the end of the comment
+ i++;
+ }
+ } else if (ch == '/' && chNext == '/') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ } else if (ch == '/' && setOKBeforeJSRE.Contains(chPrevNonWhite)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_REGEX;
+ } else if (ch == '\"') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_DOUBLESTRING;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_SINGLESTRING;
+ } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') &&
+ styler.SafeGetCharAt(i + 3) == '-') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ i += 2;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
+ state = SCE_HJ_DEFAULT;
+ } else if ((ch == ' ') || (ch == '\t')) {
+ if (state == SCE_HJ_START) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_DEFAULT;
+ }
+ }
+ break;
+ case SCE_HJ_WORD:
+ if (!IsAWordChar(ch)) {
+ classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType);
+ //styler.ColourTo(i - 1, eHTJSKeyword);
+ state = SCE_HJ_DEFAULT;
+ if (ch == '/' && chNext == '*') {
+ if (chNext2 == '*')
+ state = SCE_HJ_COMMENTDOC;
+ else
+ state = SCE_HJ_COMMENT;
+ } else if (ch == '/' && chNext == '/') {
+ state = SCE_HJ_COMMENTLINE;
+ } else if (ch == '\"') {
+ state = SCE_HJ_DOUBLESTRING;
+ } else if (ch == '\'') {
+ state = SCE_HJ_SINGLESTRING;
+ } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ i += 2;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
+ state = SCE_HJ_DEFAULT;
+ }
+ }
+ break;
+ case SCE_HJ_COMMENT:
+ case SCE_HJ_COMMENTDOC:
+ if (ch == '/' && chPrev == '*') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HJ_DEFAULT;
+ ch = ' ';
+ }
+ break;
+ case SCE_HJ_COMMENTLINE:
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, statePrintForState(SCE_HJ_COMMENTLINE, inScriptType));
+ state = SCE_HJ_DEFAULT;
+ ch = ' ';
+ }
+ break;
+ case SCE_HJ_DOUBLESTRING:
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ }
+ } else if (ch == '\"') {
+ styler.ColourTo(i, statePrintForState(SCE_HJ_DOUBLESTRING, inScriptType));
+ state = SCE_HJ_DEFAULT;
+ } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ i += 2;
+ } else if (isLineEnd(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_STRINGEOL;
+ }
+ break;
+ case SCE_HJ_SINGLESTRING:
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ }
+ } else if (ch == '\'') {
+ styler.ColourTo(i, statePrintForState(SCE_HJ_SINGLESTRING, inScriptType));
+ state = SCE_HJ_DEFAULT;
+ } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_COMMENTLINE;
+ i += 2;
+ } else if (isLineEnd(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) {
+ state = SCE_HJ_STRINGEOL;
+ }
+ }
+ break;
+ case SCE_HJ_STRINGEOL:
+ if (!isLineEnd(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HJ_DEFAULT;
+ } else if (!isLineEnd(chNext)) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HJ_DEFAULT;
+ }
+ break;
+ case SCE_HJ_REGEX:
+ if (ch == '\r' || ch == '\n' || ch == '/') {
+ if (ch == '/') {
+ while (IsASCII(chNext) && islower(chNext)) { // gobble regex flags
+ i++;
+ ch = chNext;
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ }
+ }
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HJ_DEFAULT;
+ } else if (ch == '\\') {
+ // Gobble up the quoted character
+ if (chNext == '\\' || chNext == '/') {
+ i++;
+ ch = chNext;
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ }
+ }
+ break;
+ case SCE_HB_DEFAULT:
+ case SCE_HB_START:
+ if (IsAWordStart(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_WORD;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_COMMENTLINE;
+ } else if (ch == '\"') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_STRING;
+ } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') &&
+ styler.SafeGetCharAt(i + 3) == '-') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_COMMENTLINE;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType));
+ state = SCE_HB_DEFAULT;
+ } else if ((ch == ' ') || (ch == '\t')) {
+ if (state == SCE_HB_START) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_DEFAULT;
+ }
+ }
+ break;
+ case SCE_HB_WORD:
+ if (!IsAWordChar(ch)) {
+ state = classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType);
+ if (state == SCE_HB_DEFAULT) {
+ if (ch == '\"') {
+ state = SCE_HB_STRING;
+ } else if (ch == '\'') {
+ state = SCE_HB_COMMENTLINE;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType));
+ state = SCE_HB_DEFAULT;
+ }
+ }
+ }
+ break;
+ case SCE_HB_STRING:
+ if (ch == '\"') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HB_DEFAULT;
+ } else if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_STRINGEOL;
+ }
+ break;
+ case SCE_HB_COMMENTLINE:
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_DEFAULT;
+ }
+ break;
+ case SCE_HB_STRINGEOL:
+ if (!isLineEnd(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HB_DEFAULT;
+ } else if (!isLineEnd(chNext)) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HB_DEFAULT;
+ }
+ break;
+ case SCE_HP_DEFAULT:
+ case SCE_HP_START:
+ if (IsAWordStart(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HP_WORD;
+ } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') &&
+ styler.SafeGetCharAt(i + 3) == '-') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HP_COMMENTLINE;
+ } else if (ch == '#') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HP_COMMENTLINE;
+ } else if (ch == '\"') {
+ styler.ColourTo(i - 1, StateToPrint);
+ if (chNext == '\"' && chNext2 == '\"') {
+ i += 2;
+ state = SCE_HP_TRIPLEDOUBLE;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ } else {
+ // state = statePrintForState(SCE_HP_STRING,inScriptType);
+ state = SCE_HP_STRING;
+ }
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, StateToPrint);
+ if (chNext == '\'' && chNext2 == '\'') {
+ i += 2;
+ state = SCE_HP_TRIPLE;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ } else {
+ state = SCE_HP_CHARACTER;
+ }
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType));
+ } else if ((ch == ' ') || (ch == '\t')) {
+ if (state == SCE_HP_START) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ }
+ break;
+ case SCE_HP_WORD:
+ if (!IsAWordChar(ch)) {
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako);
+ state = SCE_HP_DEFAULT;
+ if (ch == '#') {
+ state = SCE_HP_COMMENTLINE;
+ } else if (ch == '\"') {
+ if (chNext == '\"' && chNext2 == '\"') {
+ i += 2;
+ state = SCE_HP_TRIPLEDOUBLE;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ } else {
+ state = SCE_HP_STRING;
+ }
+ } else if (ch == '\'') {
+ if (chNext == '\'' && chNext2 == '\'') {
+ i += 2;
+ state = SCE_HP_TRIPLE;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ } else {
+ state = SCE_HP_CHARACTER;
+ }
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType));
+ }
+ }
+ break;
+ case SCE_HP_COMMENTLINE:
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ break;
+ case SCE_HP_STRING:
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ ch = chNext;
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ }
+ } else if (ch == '\"') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ break;
+ case SCE_HP_CHARACTER:
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ ch = chNext;
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
+ }
+ } else if (ch == '\'') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ break;
+ case SCE_HP_TRIPLE:
+ if (ch == '\'' && chPrev == '\'' && chPrev2 == '\'') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ break;
+ case SCE_HP_TRIPLEDOUBLE:
+ if (ch == '\"' && chPrev == '\"' && chPrev2 == '\"') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HP_DEFAULT;
+ }
+ break;
+ ///////////// start - PHP state handling
+ case SCE_HPHP_WORD:
+ if (!IsAWordChar(ch)) {
+ classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler);
+ if (ch == '/' && chNext == '*') {
+ i++;
+ state = SCE_HPHP_COMMENT;
+ } else if (ch == '/' && chNext == '/') {
+ i++;
+ state = SCE_HPHP_COMMENTLINE;
+ } else if (ch == '#') {
+ state = SCE_HPHP_COMMENTLINE;
+ } else if (ch == '\"') {
+ state = SCE_HPHP_HSTRING;
+ StringCopy(phpStringDelimiter, "\"");
+ } else if (styler.Match(i, "<<<")) {
+ bool isSimpleString = false;
+ i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString);
+ if (strlen(phpStringDelimiter)) {
+ state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING);
+ if (foldHeredoc) levelCurrent++;
+ }
+ } else if (ch == '\'') {
+ state = SCE_HPHP_SIMPLESTRING;
+ StringCopy(phpStringDelimiter, "\'");
+ } else if (ch == '$' && IsPhpWordStart(chNext)) {
+ state = SCE_HPHP_VARIABLE;
+ } else if (IsOperator(ch)) {
+ state = SCE_HPHP_OPERATOR;
+ } else {
+ state = SCE_HPHP_DEFAULT;
+ }
+ }
+ break;
+ case SCE_HPHP_NUMBER:
+ // recognize bases 8,10 or 16 integers OR floating-point numbers
+ if (!IsADigit(ch)
+ && strchr(".xXabcdefABCDEF", ch) == NULL
+ && ((ch != '-' && ch != '+') || (chPrev != 'e' && chPrev != 'E'))) {
+ styler.ColourTo(i - 1, SCE_HPHP_NUMBER);
+ if (IsOperator(ch))
+ state = SCE_HPHP_OPERATOR;
+ else
+ state = SCE_HPHP_DEFAULT;
+ }
+ break;
+ case SCE_HPHP_VARIABLE:
+ if (!IsPhpWordChar(chNext)) {
+ styler.ColourTo(i, SCE_HPHP_VARIABLE);
+ state = SCE_HPHP_DEFAULT;
+ }
+ break;
+ case SCE_HPHP_COMMENT:
+ if (ch == '/' && chPrev == '*') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ }
+ break;
+ case SCE_HPHP_COMMENTLINE:
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ }
+ break;
+ case SCE_HPHP_HSTRING:
+ if (ch == '\\' && (phpStringDelimiter[0] == '\"' || chNext == '$' || chNext == '{')) {
+ // skip the next char
+ i++;
+ } else if (((ch == '{' && chNext == '$') || (ch == '$' && chNext == '{'))
+ && IsPhpWordStart(chNext2)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HPHP_COMPLEX_VARIABLE;
+ } else if (ch == '$' && IsPhpWordStart(chNext)) {
+ styler.ColourTo(i - 1, StateToPrint);
+ state = SCE_HPHP_HSTRING_VARIABLE;
+ } else if (styler.Match(i, phpStringDelimiter)) {
+ if (phpStringDelimiter[0] == '\"') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ } else if (isLineEnd(chPrev)) {
+ const int psdLength = static_cast<int>(strlen(phpStringDelimiter));
+ const char chAfterPsd = styler.SafeGetCharAt(i + psdLength);
+ const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1);
+ if (isLineEnd(chAfterPsd) ||
+ (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) {
+ i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1;
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ if (foldHeredoc) levelCurrent--;
+ }
+ }
+ }
+ break;
+ case SCE_HPHP_SIMPLESTRING:
+ if (phpStringDelimiter[0] == '\'') {
+ if (ch == '\\') {
+ // skip the next char
+ i++;
+ } else if (ch == '\'') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ }
+ } else if (isLineEnd(chPrev) && styler.Match(i, phpStringDelimiter)) {
+ const int psdLength = static_cast<int>(strlen(phpStringDelimiter));
+ const char chAfterPsd = styler.SafeGetCharAt(i + psdLength);
+ const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1);
+ if (isLineEnd(chAfterPsd) ||
+ (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) {
+ i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1;
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_DEFAULT;
+ if (foldHeredoc) levelCurrent--;
+ }
+ }
+ break;
+ case SCE_HPHP_HSTRING_VARIABLE:
+ if (!IsPhpWordChar(chNext)) {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_HSTRING;
+ }
+ break;
+ case SCE_HPHP_COMPLEX_VARIABLE:
+ if (ch == '}') {
+ styler.ColourTo(i, StateToPrint);
+ state = SCE_HPHP_HSTRING;
+ }
+ break;
+ case SCE_HPHP_OPERATOR:
+ case SCE_HPHP_DEFAULT:
+ styler.ColourTo(i - 1, StateToPrint);
+ if (IsADigit(ch) || (ch == '.' && IsADigit(chNext))) {
+ state = SCE_HPHP_NUMBER;
+ } else if (IsAWordStart(ch)) {
+ state = SCE_HPHP_WORD;
+ } else if (ch == '/' && chNext == '*') {
+ i++;
+ state = SCE_HPHP_COMMENT;
+ } else if (ch == '/' && chNext == '/') {
+ i++;
+ state = SCE_HPHP_COMMENTLINE;
+ } else if (ch == '#') {
+ state = SCE_HPHP_COMMENTLINE;
+ } else if (ch == '\"') {
+ state = SCE_HPHP_HSTRING;
+ StringCopy(phpStringDelimiter, "\"");
+ } else if (styler.Match(i, "<<<")) {
+ bool isSimpleString = false;
+ i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString);
+ if (strlen(phpStringDelimiter)) {
+ state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING);
+ if (foldHeredoc) levelCurrent++;
+ }
+ } else if (ch == '\'') {
+ state = SCE_HPHP_SIMPLESTRING;
+ StringCopy(phpStringDelimiter, "\'");
+ } else if (ch == '$' && IsPhpWordStart(chNext)) {
+ state = SCE_HPHP_VARIABLE;
+ } else if (IsOperator(ch)) {
+ state = SCE_HPHP_OPERATOR;
+ } else if ((state == SCE_HPHP_OPERATOR) && (IsASpace(ch))) {
+ state = SCE_HPHP_DEFAULT;
+ }
+ break;
+ ///////////// end - PHP state handling
+ }
+
+ // Some of the above terminated their lexeme but since the same character starts
+ // the same class again, only reenter if non empty segment.
+
+ bool nonEmptySegment = i >= static_cast<int>(styler.GetStartSegment());
+ if (state == SCE_HB_DEFAULT) { // One of the above succeeded
+ if ((ch == '\"') && (nonEmptySegment)) {
+ state = SCE_HB_STRING;
+ } else if (ch == '\'') {
+ state = SCE_HB_COMMENTLINE;
+ } else if (IsAWordStart(ch)) {
+ state = SCE_HB_WORD;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, SCE_HB_DEFAULT);
+ }
+ } else if (state == SCE_HBA_DEFAULT) { // One of the above succeeded
+ if ((ch == '\"') && (nonEmptySegment)) {
+ state = SCE_HBA_STRING;
+ } else if (ch == '\'') {
+ state = SCE_HBA_COMMENTLINE;
+ } else if (IsAWordStart(ch)) {
+ state = SCE_HBA_WORD;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, SCE_HBA_DEFAULT);
+ }
+ } else if (state == SCE_HJ_DEFAULT) { // One of the above succeeded
+ if (ch == '/' && chNext == '*') {
+ if (styler.SafeGetCharAt(i + 2) == '*')
+ state = SCE_HJ_COMMENTDOC;
+ else
+ state = SCE_HJ_COMMENT;
+ } else if (ch == '/' && chNext == '/') {
+ state = SCE_HJ_COMMENTLINE;
+ } else if ((ch == '\"') && (nonEmptySegment)) {
+ state = SCE_HJ_DOUBLESTRING;
+ } else if ((ch == '\'') && (nonEmptySegment)) {
+ state = SCE_HJ_SINGLESTRING;
+ } else if (IsAWordStart(ch)) {
+ state = SCE_HJ_WORD;
+ } else if (IsOperator(ch)) {
+ styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType));
+ }
+ }
+ }
+
+ switch (state) {
+ case SCE_HJ_WORD:
+ classifyWordHTJS(styler.GetStartSegment(), lengthDoc - 1, keywords2, styler, inScriptType);
+ break;
+ case SCE_HB_WORD:
+ classifyWordHTVB(styler.GetStartSegment(), lengthDoc - 1, keywords3, styler, inScriptType);
+ break;
+ case SCE_HP_WORD:
+ classifyWordHTPy(styler.GetStartSegment(), lengthDoc - 1, keywords4, styler, prevWord, inScriptType, isMako);
+ break;
+ case SCE_HPHP_WORD:
+ classifyWordHTPHP(styler.GetStartSegment(), lengthDoc - 1, keywords5, styler);
+ break;
+ default:
+ StateToPrint = statePrintForState(state, inScriptType);
+ if (static_cast<int>(styler.GetStartSegment()) < lengthDoc)
+ styler.ColourTo(lengthDoc - 1, StateToPrint);
+ break;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ if (fold) {
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+ }
+}
+
+static void ColouriseXMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ // Passing in true because we're lexing XML
+ ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, true);
+}
+
+static void ColouriseHTMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ // Passing in false because we're notlexing XML
+ ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, false);
+}
+
+static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ if (startPos == 0)
+ initStyle = SCE_HPHP_DEFAULT;
+ ColouriseHTMLDoc(startPos, length, initStyle, keywordlists, styler);
+}
+
+static const char * const htmlWordListDesc[] = {
+ "HTML elements and attributes",
+ "JavaScript keywords",
+ "VBScript keywords",
+ "Python keywords",
+ "PHP keywords",
+ "SGML and DTD keywords",
+ 0,
+};
+
+static const char * const phpscriptWordListDesc[] = {
+ "", //Unused
+ "", //Unused
+ "", //Unused
+ "", //Unused
+ "PHP keywords",
+ "", //Unused
+ 0,
+};
+
+LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc);
+LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc);
+LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHaskell.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHaskell.cxx
new file mode 100644
index 00000000000..24355fa4e44
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHaskell.cxx
@@ -0,0 +1,1111 @@
+/******************************************************************
+ * LexHaskell.cxx
+ *
+ * A haskell lexer for the scintilla code control.
+ * Some stuff "lended" from LexPython.cxx and LexCPP.cxx.
+ * External lexer stuff inspired from the caml external lexer.
+ * Folder copied from Python's.
+ *
+ * Written by Tobias Engvall - tumm at dtek dot chalmers dot se
+ *
+ * Several bug fixes by Krasimir Angelov - kr.angelov at gmail.com
+ *
+ * Improved by kudah <kudahkukarek@gmail.com>
+ *
+ * TODO:
+ * * A proper lexical folder to fold group declarations, comments, pragmas,
+ * #ifdefs, explicit layout, lists, tuples, quasi-quotes, splces, etc, etc,
+ * etc.
+ *
+ *****************************************************************/
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "CharacterCategory.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// See https://github.com/ghc/ghc/blob/master/compiler/parser/Lexer.x#L1682
+// Note, letter modifiers are prohibited.
+
+static int u_iswupper (int ch) {
+ CharacterCategory c = CategoriseCharacter(ch);
+ return c == ccLu || c == ccLt;
+}
+
+static int u_iswalpha (int ch) {
+ CharacterCategory c = CategoriseCharacter(ch);
+ return c == ccLl || c == ccLu || c == ccLt || c == ccLo;
+}
+
+static int u_iswalnum (int ch) {
+ CharacterCategory c = CategoriseCharacter(ch);
+ return c == ccLl || c == ccLu || c == ccLt || c == ccLo
+ || c == ccNd || c == ccNo;
+}
+
+static int u_IsHaskellSymbol(int ch) {
+ CharacterCategory c = CategoriseCharacter(ch);
+ return c == ccPc || c == ccPd || c == ccPo
+ || c == ccSm || c == ccSc || c == ccSk || c == ccSo;
+}
+
+static inline bool IsHaskellLetter(const int ch) {
+ if (IsASCII(ch)) {
+ return (ch >= 'a' && ch <= 'z')
+ || (ch >= 'A' && ch <= 'Z');
+ } else {
+ return u_iswalpha(ch) != 0;
+ }
+}
+
+static inline bool IsHaskellAlphaNumeric(const int ch) {
+ if (IsASCII(ch)) {
+ return IsAlphaNumeric(ch);
+ } else {
+ return u_iswalnum(ch) != 0;
+ }
+}
+
+static inline bool IsHaskellUpperCase(const int ch) {
+ if (IsASCII(ch)) {
+ return ch >= 'A' && ch <= 'Z';
+ } else {
+ return u_iswupper(ch) != 0;
+ }
+}
+
+static inline bool IsAnHaskellOperatorChar(const int ch) {
+ if (IsASCII(ch)) {
+ return
+ ( ch == '!' || ch == '#' || ch == '$' || ch == '%'
+ || ch == '&' || ch == '*' || ch == '+' || ch == '-'
+ || ch == '.' || ch == '/' || ch == ':' || ch == '<'
+ || ch == '=' || ch == '>' || ch == '?' || ch == '@'
+ || ch == '^' || ch == '|' || ch == '~' || ch == '\\');
+ } else {
+ return u_IsHaskellSymbol(ch) != 0;
+ }
+}
+
+static inline bool IsAHaskellWordStart(const int ch) {
+ return IsHaskellLetter(ch) || ch == '_';
+}
+
+static inline bool IsAHaskellWordChar(const int ch) {
+ return ( IsHaskellAlphaNumeric(ch)
+ || ch == '_'
+ || ch == '\'');
+}
+
+static inline bool IsCommentBlockStyle(int style) {
+ return (style >= SCE_HA_COMMENTBLOCK && style <= SCE_HA_COMMENTBLOCK3);
+}
+
+static inline bool IsCommentStyle(int style) {
+ return (style >= SCE_HA_COMMENTLINE && style <= SCE_HA_COMMENTBLOCK3)
+ || ( style == SCE_HA_LITERATE_COMMENT
+ || style == SCE_HA_LITERATE_CODEDELIM);
+}
+
+// styles which do not belong to Haskell, but to external tools
+static inline bool IsExternalStyle(int style) {
+ return ( style == SCE_HA_PREPROCESSOR
+ || style == SCE_HA_LITERATE_COMMENT
+ || style == SCE_HA_LITERATE_CODEDELIM);
+}
+
+static inline int CommentBlockStyleFromNestLevel(const unsigned int nestLevel) {
+ return SCE_HA_COMMENTBLOCK + (nestLevel % 3);
+}
+
+// Mangled version of lexlib/Accessor.cxx IndentAmount.
+// Modified to treat comment blocks as whitespace
+// plus special case for commentline/preprocessor.
+static int HaskellIndentAmount(Accessor &styler, const int line) {
+
+ // Determines the indentation level of the current line
+ // Comment blocks are treated as whitespace
+
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+
+ char ch = styler[pos];
+ int style = styler.StyleAt(pos);
+
+ int indent = 0;
+ bool inPrevPrefix = line > 0;
+
+ int posPrev = inPrevPrefix ? styler.LineStart(line-1) : 0;
+
+ while (( ch == ' ' || ch == '\t'
+ || IsCommentBlockStyle(style)
+ || style == SCE_HA_LITERATE_CODEDELIM)
+ && (pos < eol_pos)) {
+ if (inPrevPrefix) {
+ char chPrev = styler[posPrev++];
+ if (chPrev != ' ' && chPrev != '\t') {
+ inPrevPrefix = false;
+ }
+ }
+ if (ch == '\t') {
+ indent = (indent / 8 + 1) * 8;
+ } else { // Space or comment block
+ indent++;
+ }
+ pos++;
+ ch = styler[pos];
+ style = styler.StyleAt(pos);
+ }
+
+ indent += SC_FOLDLEVELBASE;
+ // if completely empty line or the start of a comment or preprocessor...
+ if ( styler.LineStart(line) == styler.Length()
+ || ch == ' '
+ || ch == '\t'
+ || ch == '\n'
+ || ch == '\r'
+ || IsCommentStyle(style)
+ || style == SCE_HA_PREPROCESSOR)
+ return indent | SC_FOLDLEVELWHITEFLAG;
+ else
+ return indent;
+}
+
+struct OptionsHaskell {
+ bool magicHash;
+ bool allowQuotes;
+ bool implicitParams;
+ bool highlightSafe;
+ bool cpp;
+ bool stylingWithinPreprocessor;
+ bool fold;
+ bool foldComment;
+ bool foldCompact;
+ bool foldImports;
+ OptionsHaskell() {
+ magicHash = true; // Widespread use, enabled by default.
+ allowQuotes = true; // Widespread use, enabled by default.
+ implicitParams = false; // Fell out of favor, seldom used, disabled.
+ highlightSafe = true; // Moderately used, doesn't hurt to enable.
+ cpp = true; // Widespread use, enabled by default;
+ stylingWithinPreprocessor = false;
+ fold = false;
+ foldComment = false;
+ foldCompact = false;
+ foldImports = false;
+ }
+};
+
+static const char * const haskellWordListDesc[] = {
+ "Keywords",
+ "FFI",
+ "Reserved operators",
+ 0
+};
+
+struct OptionSetHaskell : public OptionSet<OptionsHaskell> {
+ OptionSetHaskell() {
+ DefineProperty("lexer.haskell.allow.hash", &OptionsHaskell::magicHash,
+ "Set to 0 to disallow the '#' character at the end of identifiers and "
+ "literals with the haskell lexer "
+ "(GHC -XMagicHash extension)");
+
+ DefineProperty("lexer.haskell.allow.quotes", &OptionsHaskell::allowQuotes,
+ "Set to 0 to disable highlighting of Template Haskell name quotations "
+ "and promoted constructors "
+ "(GHC -XTemplateHaskell and -XDataKinds extensions)");
+
+ DefineProperty("lexer.haskell.allow.questionmark", &OptionsHaskell::implicitParams,
+ "Set to 1 to allow the '?' character at the start of identifiers "
+ "with the haskell lexer "
+ "(GHC & Hugs -XImplicitParams extension)");
+
+ DefineProperty("lexer.haskell.import.safe", &OptionsHaskell::highlightSafe,
+ "Set to 0 to disallow \"safe\" keyword in imports "
+ "(GHC -XSafe, -XTrustworthy, -XUnsafe extensions)");
+
+ DefineProperty("lexer.haskell.cpp", &OptionsHaskell::cpp,
+ "Set to 0 to disable C-preprocessor highlighting "
+ "(-XCPP extension)");
+
+ DefineProperty("styling.within.preprocessor", &OptionsHaskell::stylingWithinPreprocessor,
+ "For Haskell code, determines whether all preprocessor code is styled in the "
+ "preprocessor style (0, the default) or only from the initial # to the end "
+ "of the command word(1)."
+ );
+
+ DefineProperty("fold", &OptionsHaskell::fold);
+
+ DefineProperty("fold.comment", &OptionsHaskell::foldComment);
+
+ DefineProperty("fold.compact", &OptionsHaskell::foldCompact);
+
+ DefineProperty("fold.haskell.imports", &OptionsHaskell::foldImports,
+ "Set to 1 to enable folding of import declarations");
+
+ DefineWordListSets(haskellWordListDesc);
+ }
+};
+
+class LexerHaskell : public ILexer {
+ bool literate;
+ int firstImportLine;
+ int firstImportIndent;
+ WordList keywords;
+ WordList ffi;
+ WordList reserved_operators;
+ OptionsHaskell options;
+ OptionSetHaskell osHaskell;
+
+ enum HashCount {
+ oneHash
+ ,twoHashes
+ ,unlimitedHashes
+ };
+
+ enum KeywordMode {
+ HA_MODE_DEFAULT = 0
+ ,HA_MODE_IMPORT1 = 1 // after "import", before "qualified" or "safe" or package name or module name.
+ ,HA_MODE_IMPORT2 = 2 // after module name, before "as" or "hiding".
+ ,HA_MODE_IMPORT3 = 3 // after "as", before "hiding"
+ ,HA_MODE_MODULE = 4 // after "module", before module name.
+ ,HA_MODE_FFI = 5 // after "foreign", before FFI keywords
+ ,HA_MODE_TYPE = 6 // after "type" or "data", before "family"
+ };
+
+ enum LiterateMode {
+ LITERATE_BIRD = 0 // if '>' is the first character on the line,
+ // color '>' as a codedelim and the rest of
+ // the line as code.
+ // else if "\begin{code}" is the only word on the
+ // line except whitespace, switch to LITERATE_BLOCK
+ // otherwise color the line as a literate comment.
+ ,LITERATE_BLOCK = 1 // if the string "\end{code}" is encountered at column
+ // 0 ignoring all later characters, color the line
+ // as a codedelim and switch to LITERATE_BIRD
+ // otherwise color the line as code.
+ };
+
+ struct HaskellLineInfo {
+ unsigned int nestLevel; // 22 bits ought to be enough for anybody
+ unsigned int nonexternalStyle; // 5 bits, widen if number of styles goes
+ // beyond 31.
+ bool pragma;
+ LiterateMode lmode;
+ KeywordMode mode;
+
+ HaskellLineInfo(int state) :
+ nestLevel (state >> 10)
+ , nonexternalStyle ((state >> 5) & 0x1F)
+ , pragma ((state >> 4) & 0x1)
+ , lmode (static_cast<LiterateMode>((state >> 3) & 0x1))
+ , mode (static_cast<KeywordMode>(state & 0x7))
+ {}
+
+ int ToLineState() {
+ return
+ (nestLevel << 10)
+ | (nonexternalStyle << 5)
+ | (pragma << 4)
+ | (lmode << 3)
+ | mode;
+ }
+ };
+
+ inline void skipMagicHash(StyleContext &sc, const HashCount hashes) const {
+ if (options.magicHash && sc.ch == '#') {
+ sc.Forward();
+ if (hashes == twoHashes && sc.ch == '#') {
+ sc.Forward();
+ } else if (hashes == unlimitedHashes) {
+ while (sc.ch == '#') {
+ sc.Forward();
+ }
+ }
+ }
+ }
+
+ bool LineContainsImport(const int line, Accessor &styler) const {
+ if (options.foldImports) {
+ int currentPos = styler.LineStart(line);
+ int style = styler.StyleAt(currentPos);
+
+ int eol_pos = styler.LineStart(line + 1) - 1;
+
+ while (currentPos < eol_pos) {
+ int ch = styler[currentPos];
+ style = styler.StyleAt(currentPos);
+
+ if (ch == ' ' || ch == '\t'
+ || IsCommentBlockStyle(style)
+ || style == SCE_HA_LITERATE_CODEDELIM) {
+ currentPos++;
+ } else {
+ break;
+ }
+ }
+
+ return (style == SCE_HA_KEYWORD
+ && styler.Match(currentPos, "import"));
+ } else {
+ return false;
+ }
+ }
+
+ inline int IndentAmountWithOffset(Accessor &styler, const int line) const {
+ const int indent = HaskellIndentAmount(styler, line);
+ const int indentLevel = indent & SC_FOLDLEVELNUMBERMASK;
+ return indentLevel <= ((firstImportIndent - 1) + SC_FOLDLEVELBASE)
+ ? indent
+ : (indentLevel + firstImportIndent) | (indent & ~SC_FOLDLEVELNUMBERMASK);
+ }
+
+ inline int IndentLevelRemoveIndentOffset(const int indentLevel) const {
+ return indentLevel <= ((firstImportIndent - 1) + SC_FOLDLEVELBASE)
+ ? indentLevel
+ : indentLevel - firstImportIndent;
+ }
+
+public:
+ LexerHaskell(bool literate_)
+ : literate(literate_)
+ , firstImportLine(-1)
+ , firstImportIndent(0)
+ {}
+ virtual ~LexerHaskell() {}
+
+ void SCI_METHOD Release() {
+ delete this;
+ }
+
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+
+ const char * SCI_METHOD PropertyNames() {
+ return osHaskell.PropertyNames();
+ }
+
+ int SCI_METHOD PropertyType(const char *name) {
+ return osHaskell.PropertyType(name);
+ }
+
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osHaskell.DescribeProperty(name);
+ }
+
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osHaskell.DescribeWordListSets();
+ }
+
+ int SCI_METHOD WordListSet(int n, const char *wl);
+
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactoryHaskell() {
+ return new LexerHaskell(false);
+ }
+
+ static ILexer *LexerFactoryLiterateHaskell() {
+ return new LexerHaskell(true);
+ }
+};
+
+int SCI_METHOD LexerHaskell::PropertySet(const char *key, const char *val) {
+ if (osHaskell.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerHaskell::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords;
+ break;
+ case 1:
+ wordListN = &ffi;
+ break;
+ case 2:
+ wordListN = &reserved_operators;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+void SCI_METHOD LexerHaskell::Lex(unsigned int startPos, int length, int initStyle
+ ,IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ int lineCurrent = styler.GetLine(startPos);
+
+ HaskellLineInfo hs = HaskellLineInfo(lineCurrent ? styler.GetLineState(lineCurrent-1) : 0);
+
+ // Do not leak onto next line
+ if (initStyle == SCE_HA_STRINGEOL)
+ initStyle = SCE_HA_DEFAULT;
+ else if (initStyle == SCE_HA_LITERATE_CODEDELIM)
+ initStyle = hs.nonexternalStyle;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int base = 10;
+ bool dot = false;
+
+ bool inDashes = false;
+ bool alreadyInTheMiddleOfOperator = false;
+
+ assert(!(IsCommentBlockStyle(initStyle) && hs.nestLevel == 0));
+
+ while (sc.More()) {
+ // Check for state end
+
+ if (!IsExternalStyle(sc.state)) {
+ hs.nonexternalStyle = sc.state;
+ }
+
+ // For lexer to work, states should unconditionally forward at least one
+ // character.
+ // If they don't, they should still check if they are at line end and
+ // forward if so.
+ // If a state forwards more than one character, it should check every time
+ // that it is not a line end and cease forwarding otherwise.
+ if (sc.atLineEnd) {
+ // Remember the line state for future incremental lexing
+ styler.SetLineState(lineCurrent, hs.ToLineState());
+ lineCurrent++;
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\' && (sc.chNext == '\n' || sc.chNext == '\r')
+ && ( sc.state == SCE_HA_STRING
+ || sc.state == SCE_HA_PREPROCESSOR)) {
+ // Remember the line state for future incremental lexing
+ styler.SetLineState(lineCurrent, hs.ToLineState());
+ lineCurrent++;
+
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ sc.Forward();
+
+ continue;
+ }
+
+ if (sc.atLineStart) {
+
+ if (sc.state == SCE_HA_STRING || sc.state == SCE_HA_CHARACTER) {
+ // Prevent SCE_HA_STRINGEOL from leaking back to previous line
+ sc.SetState(sc.state);
+ }
+
+ if (literate && hs.lmode == LITERATE_BIRD) {
+ if (!IsExternalStyle(sc.state)) {
+ sc.SetState(SCE_HA_LITERATE_COMMENT);
+ }
+ }
+ }
+
+ // External
+ // Literate
+ if ( literate && hs.lmode == LITERATE_BIRD && sc.atLineStart
+ && sc.ch == '>') {
+ sc.SetState(SCE_HA_LITERATE_CODEDELIM);
+ sc.ForwardSetState(hs.nonexternalStyle);
+ }
+ else if (literate && hs.lmode == LITERATE_BIRD && sc.atLineStart
+ && ( sc.ch == ' ' || sc.ch == '\t'
+ || sc.Match("\\begin{code}"))) {
+ sc.SetState(sc.state);
+
+ while ((sc.ch == ' ' || sc.ch == '\t') && sc.More())
+ sc.Forward();
+
+ if (sc.Match("\\begin{code}")) {
+ sc.Forward(static_cast<int>(strlen("\\begin{code}")));
+
+ bool correct = true;
+
+ while (!sc.atLineEnd && sc.More()) {
+ if (sc.ch != ' ' && sc.ch != '\t') {
+ correct = false;
+ }
+ sc.Forward();
+ }
+
+ if (correct) {
+ sc.ChangeState(SCE_HA_LITERATE_CODEDELIM); // color the line end
+ hs.lmode = LITERATE_BLOCK;
+ }
+ }
+ }
+ else if (literate && hs.lmode == LITERATE_BLOCK && sc.atLineStart
+ && sc.Match("\\end{code}")) {
+ sc.SetState(SCE_HA_LITERATE_CODEDELIM);
+
+ sc.Forward(static_cast<int>(strlen("\\end{code}")));
+
+ while (!sc.atLineEnd && sc.More()) {
+ sc.Forward();
+ }
+
+ sc.SetState(SCE_HA_LITERATE_COMMENT);
+ hs.lmode = LITERATE_BIRD;
+ }
+ // Preprocessor
+ else if (sc.atLineStart && sc.ch == '#' && options.cpp
+ && (!options.stylingWithinPreprocessor || sc.state == SCE_HA_DEFAULT)) {
+ sc.SetState(SCE_HA_PREPROCESSOR);
+ sc.Forward();
+ }
+ // Literate
+ else if (sc.state == SCE_HA_LITERATE_COMMENT) {
+ sc.Forward();
+ }
+ else if (sc.state == SCE_HA_LITERATE_CODEDELIM) {
+ sc.ForwardSetState(hs.nonexternalStyle);
+ }
+ // Preprocessor
+ else if (sc.state == SCE_HA_PREPROCESSOR) {
+ if (sc.atLineEnd) {
+ sc.SetState(options.stylingWithinPreprocessor
+ ? SCE_HA_DEFAULT
+ : hs.nonexternalStyle);
+ sc.Forward(); // prevent double counting a line
+ } else if (options.stylingWithinPreprocessor && !IsHaskellLetter(sc.ch)) {
+ sc.SetState(SCE_HA_DEFAULT);
+ } else {
+ sc.Forward();
+ }
+ }
+ // Haskell
+ // Operator
+ else if (sc.state == SCE_HA_OPERATOR) {
+ int style = SCE_HA_OPERATOR;
+
+ if ( sc.ch == ':'
+ && !alreadyInTheMiddleOfOperator
+ // except "::"
+ && !( sc.chNext == ':'
+ && !IsAnHaskellOperatorChar(sc.GetRelative(2)))) {
+ style = SCE_HA_CAPITAL;
+ }
+
+ alreadyInTheMiddleOfOperator = false;
+
+ while (IsAnHaskellOperatorChar(sc.ch))
+ sc.Forward();
+
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+
+ if (reserved_operators.InList(s))
+ style = SCE_HA_RESERVED_OPERATOR;
+
+ sc.ChangeState(style);
+ sc.SetState(SCE_HA_DEFAULT);
+ }
+ // String
+ else if (sc.state == SCE_HA_STRING) {
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_HA_STRINGEOL);
+ sc.ForwardSetState(SCE_HA_DEFAULT);
+ } else if (sc.ch == '\"') {
+ sc.Forward();
+ skipMagicHash(sc, oneHash);
+ sc.SetState(SCE_HA_DEFAULT);
+ } else if (sc.ch == '\\') {
+ sc.Forward(2);
+ } else {
+ sc.Forward();
+ }
+ }
+ // Char
+ else if (sc.state == SCE_HA_CHARACTER) {
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_HA_STRINGEOL);
+ sc.ForwardSetState(SCE_HA_DEFAULT);
+ } else if (sc.ch == '\'') {
+ sc.Forward();
+ skipMagicHash(sc, oneHash);
+ sc.SetState(SCE_HA_DEFAULT);
+ } else if (sc.ch == '\\') {
+ sc.Forward(2);
+ } else {
+ sc.Forward();
+ }
+ }
+ // Number
+ else if (sc.state == SCE_HA_NUMBER) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_HA_DEFAULT);
+ sc.Forward(); // prevent double counting a line
+ } else if (IsADigit(sc.ch, base)) {
+ sc.Forward();
+ } else if (sc.ch=='.' && dot && IsADigit(sc.chNext, base)) {
+ sc.Forward(2);
+ dot = false;
+ } else if ((base == 10) &&
+ (sc.ch == 'e' || sc.ch == 'E') &&
+ (IsADigit(sc.chNext) || sc.chNext == '+' || sc.chNext == '-')) {
+ sc.Forward();
+ if (sc.ch == '+' || sc.ch == '-')
+ sc.Forward();
+ } else {
+ skipMagicHash(sc, twoHashes);
+ sc.SetState(SCE_HA_DEFAULT);
+ }
+ }
+ // Keyword or Identifier
+ else if (sc.state == SCE_HA_IDENTIFIER) {
+ int style = IsHaskellUpperCase(sc.ch) ? SCE_HA_CAPITAL : SCE_HA_IDENTIFIER;
+
+ assert(IsAHaskellWordStart(sc.ch));
+
+ sc.Forward();
+
+ while (sc.More()) {
+ if (IsAHaskellWordChar(sc.ch)) {
+ sc.Forward();
+ } else if (sc.ch == '.' && style == SCE_HA_CAPITAL) {
+ if (IsHaskellUpperCase(sc.chNext)) {
+ sc.Forward();
+ style = SCE_HA_CAPITAL;
+ } else if (IsAHaskellWordStart(sc.chNext)) {
+ sc.Forward();
+ style = SCE_HA_IDENTIFIER;
+ } else if (IsAnHaskellOperatorChar(sc.chNext)) {
+ sc.Forward();
+ style = sc.ch == ':' ? SCE_HA_CAPITAL : SCE_HA_OPERATOR;
+ while (IsAnHaskellOperatorChar(sc.ch))
+ sc.Forward();
+ break;
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+
+ skipMagicHash(sc, unlimitedHashes);
+
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+
+ KeywordMode new_mode = HA_MODE_DEFAULT;
+
+ if (keywords.InList(s)) {
+ style = SCE_HA_KEYWORD;
+ } else if (style == SCE_HA_CAPITAL) {
+ if (hs.mode == HA_MODE_IMPORT1 || hs.mode == HA_MODE_IMPORT3) {
+ style = SCE_HA_MODULE;
+ new_mode = HA_MODE_IMPORT2;
+ } else if (hs.mode == HA_MODE_MODULE) {
+ style = SCE_HA_MODULE;
+ }
+ } else if (hs.mode == HA_MODE_IMPORT1 &&
+ strcmp(s,"qualified") == 0) {
+ style = SCE_HA_KEYWORD;
+ new_mode = HA_MODE_IMPORT1;
+ } else if (options.highlightSafe &&
+ hs.mode == HA_MODE_IMPORT1 &&
+ strcmp(s,"safe") == 0) {
+ style = SCE_HA_KEYWORD;
+ new_mode = HA_MODE_IMPORT1;
+ } else if (hs.mode == HA_MODE_IMPORT2) {
+ if (strcmp(s,"as") == 0) {
+ style = SCE_HA_KEYWORD;
+ new_mode = HA_MODE_IMPORT3;
+ } else if (strcmp(s,"hiding") == 0) {
+ style = SCE_HA_KEYWORD;
+ }
+ } else if (hs.mode == HA_MODE_TYPE) {
+ if (strcmp(s,"family") == 0)
+ style = SCE_HA_KEYWORD;
+ }
+
+ if (hs.mode == HA_MODE_FFI) {
+ if (ffi.InList(s)) {
+ style = SCE_HA_KEYWORD;
+ new_mode = HA_MODE_FFI;
+ }
+ }
+
+ sc.ChangeState(style);
+ sc.SetState(SCE_HA_DEFAULT);
+
+ if (strcmp(s,"import") == 0 && hs.mode != HA_MODE_FFI)
+ new_mode = HA_MODE_IMPORT1;
+ else if (strcmp(s,"module") == 0)
+ new_mode = HA_MODE_MODULE;
+ else if (strcmp(s,"foreign") == 0)
+ new_mode = HA_MODE_FFI;
+ else if (strcmp(s,"type") == 0
+ || strcmp(s,"data") == 0)
+ new_mode = HA_MODE_TYPE;
+
+ hs.mode = new_mode;
+ }
+
+ // Comments
+ // Oneliner
+ else if (sc.state == SCE_HA_COMMENTLINE) {
+ if (sc.atLineEnd) {
+ sc.SetState(hs.pragma ? SCE_HA_PRAGMA : SCE_HA_DEFAULT);
+ sc.Forward(); // prevent double counting a line
+ } else if (inDashes && sc.ch != '-' && !hs.pragma) {
+ inDashes = false;
+ if (IsAnHaskellOperatorChar(sc.ch)) {
+ alreadyInTheMiddleOfOperator = true;
+ sc.ChangeState(SCE_HA_OPERATOR);
+ }
+ } else {
+ sc.Forward();
+ }
+ }
+ // Nested
+ else if (IsCommentBlockStyle(sc.state)) {
+ if (sc.Match('{','-')) {
+ sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel));
+ sc.Forward(2);
+ hs.nestLevel++;
+ } else if (sc.Match('-','}')) {
+ sc.Forward(2);
+ assert(hs.nestLevel > 0);
+ if (hs.nestLevel > 0)
+ hs.nestLevel--;
+ sc.SetState(
+ hs.nestLevel == 0
+ ? (hs.pragma ? SCE_HA_PRAGMA : SCE_HA_DEFAULT)
+ : CommentBlockStyleFromNestLevel(hs.nestLevel - 1));
+ } else {
+ sc.Forward();
+ }
+ }
+ // Pragma
+ else if (sc.state == SCE_HA_PRAGMA) {
+ if (sc.Match("#-}")) {
+ hs.pragma = false;
+ sc.Forward(3);
+ sc.SetState(SCE_HA_DEFAULT);
+ } else if (sc.Match('-','-')) {
+ sc.SetState(SCE_HA_COMMENTLINE);
+ sc.Forward(2);
+ inDashes = false;
+ } else if (sc.Match('{','-')) {
+ sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel));
+ sc.Forward(2);
+ hs.nestLevel = 1;
+ } else {
+ sc.Forward();
+ }
+ }
+ // New state?
+ else if (sc.state == SCE_HA_DEFAULT) {
+ // Digit
+ if (IsADigit(sc.ch)) {
+ hs.mode = HA_MODE_DEFAULT;
+
+ sc.SetState(SCE_HA_NUMBER);
+ if (sc.ch == '0' && (sc.chNext == 'X' || sc.chNext == 'x')) {
+ // Match anything starting with "0x" or "0X", too
+ sc.Forward(2);
+ base = 16;
+ dot = false;
+ } else if (sc.ch == '0' && (sc.chNext == 'O' || sc.chNext == 'o')) {
+ // Match anything starting with "0o" or "0O", too
+ sc.Forward(2);
+ base = 8;
+ dot = false;
+ } else {
+ sc.Forward();
+ base = 10;
+ dot = true;
+ }
+ }
+ // Pragma
+ else if (sc.Match("{-#")) {
+ hs.pragma = true;
+ sc.SetState(SCE_HA_PRAGMA);
+ sc.Forward(3);
+ }
+ // Comment line
+ else if (sc.Match('-','-')) {
+ sc.SetState(SCE_HA_COMMENTLINE);
+ sc.Forward(2);
+ inDashes = true;
+ }
+ // Comment block
+ else if (sc.Match('{','-')) {
+ sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel));
+ sc.Forward(2);
+ hs.nestLevel = 1;
+ }
+ // String
+ else if (sc.ch == '\"') {
+ sc.SetState(SCE_HA_STRING);
+ sc.Forward();
+ }
+ // Character or quoted name or promoted term
+ else if (sc.ch == '\'') {
+ hs.mode = HA_MODE_DEFAULT;
+
+ sc.SetState(SCE_HA_CHARACTER);
+ sc.Forward();
+
+ if (options.allowQuotes) {
+ // Quoted type ''T
+ if (sc.ch=='\'' && IsAHaskellWordStart(sc.chNext)) {
+ sc.Forward();
+ sc.ChangeState(SCE_HA_IDENTIFIER);
+ } else if (sc.chNext != '\'') {
+ // Quoted name 'n or promoted constructor 'N
+ if (IsAHaskellWordStart(sc.ch)) {
+ sc.ChangeState(SCE_HA_IDENTIFIER);
+ // Promoted constructor operator ':~>
+ } else if (sc.ch == ':') {
+ alreadyInTheMiddleOfOperator = false;
+ sc.ChangeState(SCE_HA_OPERATOR);
+ // Promoted list or tuple '[T]
+ } else if (sc.ch == '[' || sc.ch== '(') {
+ sc.ChangeState(SCE_HA_OPERATOR);
+ sc.ForwardSetState(SCE_HA_DEFAULT);
+ }
+ }
+ }
+ }
+ // Operator starting with '?' or an implicit parameter
+ else if (sc.ch == '?') {
+ hs.mode = HA_MODE_DEFAULT;
+
+ alreadyInTheMiddleOfOperator = false;
+ sc.SetState(SCE_HA_OPERATOR);
+
+ if ( options.implicitParams
+ && IsAHaskellWordStart(sc.chNext)
+ && !IsHaskellUpperCase(sc.chNext)) {
+ sc.Forward();
+ sc.ChangeState(SCE_HA_IDENTIFIER);
+ }
+ }
+ // Operator
+ else if (IsAnHaskellOperatorChar(sc.ch)) {
+ hs.mode = HA_MODE_DEFAULT;
+
+ sc.SetState(SCE_HA_OPERATOR);
+ }
+ // Braces and punctuation
+ else if (sc.ch == ',' || sc.ch == ';'
+ || sc.ch == '(' || sc.ch == ')'
+ || sc.ch == '[' || sc.ch == ']'
+ || sc.ch == '{' || sc.ch == '}') {
+ sc.SetState(SCE_HA_OPERATOR);
+ sc.ForwardSetState(SCE_HA_DEFAULT);
+ }
+ // Keyword or Identifier
+ else if (IsAHaskellWordStart(sc.ch)) {
+ sc.SetState(SCE_HA_IDENTIFIER);
+ // Something we don't care about
+ } else {
+ sc.Forward();
+ }
+ }
+ // This branch should never be reached.
+ else {
+ assert(false);
+ sc.Forward();
+ }
+ }
+ sc.Complete();
+}
+
+void SCI_METHOD LexerHaskell::Fold(unsigned int startPos, int length, int // initStyle
+ ,IDocument *pAccess) {
+ if (!options.fold)
+ return;
+
+ Accessor styler(pAccess, NULL);
+
+ int lineCurrent = styler.GetLine(startPos);
+
+ if (lineCurrent <= firstImportLine) {
+ firstImportLine = -1; // readjust first import position
+ firstImportIndent = 0;
+ }
+
+ const int maxPos = startPos + length;
+ const int maxLines =
+ maxPos == styler.Length()
+ ? styler.GetLine(maxPos)
+ : styler.GetLine(maxPos - 1); // Requested last line
+ const int docLines = styler.GetLine(styler.Length()); // Available last line
+
+ // Backtrack to previous non-blank line so we can determine indent level
+ // for any white space lines
+ // and so we can fix any preceding fold level (which is why we go back
+ // at least one line in all cases)
+ bool importHere = LineContainsImport(lineCurrent, styler);
+ int indentCurrent = IndentAmountWithOffset(styler, lineCurrent);
+
+ while (lineCurrent > 0) {
+ lineCurrent--;
+ importHere = LineContainsImport(lineCurrent, styler);
+ indentCurrent = IndentAmountWithOffset(styler, lineCurrent);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG))
+ break;
+ }
+
+ int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+
+ if (importHere) {
+ indentCurrentLevel = IndentLevelRemoveIndentOffset(indentCurrentLevel);
+ if (firstImportLine == -1) {
+ firstImportLine = lineCurrent;
+ firstImportIndent = (1 + indentCurrentLevel) - SC_FOLDLEVELBASE;
+ }
+ if (firstImportLine != lineCurrent) {
+ indentCurrentLevel++;
+ }
+ }
+
+ indentCurrent = indentCurrentLevel | (indentCurrent & ~SC_FOLDLEVELNUMBERMASK);
+
+ // Process all characters to end of requested range
+ //that hangs over the end of the range. Cap processing in all cases
+ // to end of document.
+ while (lineCurrent <= docLines && lineCurrent <= maxLines) {
+
+ // Gather info
+ int lineNext = lineCurrent + 1;
+ importHere = false;
+ int indentNext = indentCurrent;
+
+ if (lineNext <= docLines) {
+ // Information about next line is only available if not at end of document
+ importHere = LineContainsImport(lineNext, styler);
+ indentNext = IndentAmountWithOffset(styler, lineNext);
+ }
+ if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel;
+
+ // Skip past any blank lines for next indent level info; we skip also
+ // comments (all comments, not just those starting in column 0)
+ // which effectively folds them into surrounding code rather
+ // than screwing up folding.
+
+ while (lineNext < docLines && (indentNext & SC_FOLDLEVELWHITEFLAG)) {
+ lineNext++;
+ importHere = LineContainsImport(lineNext, styler);
+ indentNext = IndentAmountWithOffset(styler, lineNext);
+ }
+
+ int indentNextLevel = indentNext & SC_FOLDLEVELNUMBERMASK;
+
+ if (importHere) {
+ indentNextLevel = IndentLevelRemoveIndentOffset(indentNextLevel);
+ if (firstImportLine == -1) {
+ firstImportLine = lineNext;
+ firstImportIndent = (1 + indentNextLevel) - SC_FOLDLEVELBASE;
+ }
+ if (firstImportLine != lineNext) {
+ indentNextLevel++;
+ }
+ }
+
+ indentNext = indentNextLevel | (indentNext & ~SC_FOLDLEVELNUMBERMASK);
+
+ const int levelBeforeComments = Maximum(indentCurrentLevel,indentNextLevel);
+
+ // Now set all the indent levels on the lines we skipped
+ // Do this from end to start. Once we encounter one line
+ // which is indented more than the line after the end of
+ // the comment-block, use the level of the block before
+
+ int skipLine = lineNext;
+ int skipLevel = indentNextLevel;
+
+ while (--skipLine > lineCurrent) {
+ int skipLineIndent = IndentAmountWithOffset(styler, skipLine);
+
+ if (options.foldCompact) {
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > indentNextLevel) {
+ skipLevel = levelBeforeComments;
+ }
+
+ int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(skipLine, skipLevel | whiteFlag);
+ } else {
+ if ( (skipLineIndent & SC_FOLDLEVELNUMBERMASK) > indentNextLevel
+ && !(skipLineIndent & SC_FOLDLEVELWHITEFLAG)) {
+ skipLevel = levelBeforeComments;
+ }
+
+ styler.SetLevel(skipLine, skipLevel);
+ }
+ }
+
+ int lev = indentCurrent;
+
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+
+ // Set fold level for this line and move to next line
+ styler.SetLevel(lineCurrent, options.foldCompact ? lev : lev & ~SC_FOLDLEVELWHITEFLAG);
+
+ indentCurrent = indentNext;
+ indentCurrentLevel = indentNextLevel;
+ lineCurrent = lineNext;
+ }
+
+ // NOTE: Cannot set level of last line here because indentCurrent doesn't have
+ // header flag set; the loop above is crafted to take care of this case!
+ //styler.SetLevel(lineCurrent, indentCurrent);
+}
+
+LexerModule lmHaskell(SCLEX_HASKELL, LexerHaskell::LexerFactoryHaskell, "haskell", haskellWordListDesc);
+LexerModule lmLiterateHaskell(SCLEX_LITERATEHASKELL, LexerHaskell::LexerFactoryLiterateHaskell, "literatehaskell", haskellWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHex.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHex.cxx
new file mode 100644
index 00000000000..fe972ffe828
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexHex.cxx
@@ -0,0 +1,1045 @@
+// Scintilla source code edit control
+/** @file LexHex.cxx
+ ** Lexers for Motorola S-Record, Intel HEX and Tektronix extended HEX.
+ **
+ ** Written by Markus Heidelberg
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+/*
+ * Motorola S-Record
+ * ===============================
+ *
+ * Each record (line) is built as follows:
+ *
+ * field digits states
+ *
+ * +----------+
+ * | start | 1 ('S') SCE_HEX_RECSTART
+ * +----------+
+ * | type | 1 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN)
+ * +----------+
+ * | count | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG
+ * +----------+
+ * | address | 4/6/8 SCE_HEX_NOADDRESS, SCE_HEX_DATAADDRESS, SCE_HEX_RECCOUNT, SCE_HEX_STARTADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN)
+ * +----------+
+ * | data | 0..504/502/500 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN, SCE_HEX_DATA_EMPTY, (SCE_HEX_DATA_UNKNOWN)
+ * +----------+
+ * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG
+ * +----------+
+ *
+ *
+ * Intel HEX
+ * ===============================
+ *
+ * Each record (line) is built as follows:
+ *
+ * field digits states
+ *
+ * +----------+
+ * | start | 1 (':') SCE_HEX_RECSTART
+ * +----------+
+ * | count | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG
+ * +----------+
+ * | address | 4 SCE_HEX_NOADDRESS, SCE_HEX_DATAADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN)
+ * +----------+
+ * | type | 2 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN)
+ * +----------+
+ * | data | 0..510 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN, SCE_HEX_DATA_EMPTY, SCE_HEX_EXTENDEDADDRESS, SCE_HEX_STARTADDRESS, (SCE_HEX_DATA_UNKNOWN)
+ * +----------+
+ * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG
+ * +----------+
+ *
+ *
+ * Folding:
+ *
+ * Data records (type 0x00), which follow an extended address record (type
+ * 0x02 or 0x04), can be folded. The extended address record is the fold
+ * point at fold level 0, the corresponding data records are set to level 1.
+ *
+ * Any record, which is not a data record, sets the fold level back to 0.
+ * Any line, which is not a record (blank lines and lines starting with a
+ * character other than ':'), leaves the fold level unchanged.
+ *
+ *
+ * Tektronix extended HEX
+ * ===============================
+ *
+ * Each record (line) is built as follows:
+ *
+ * field digits states
+ *
+ * +----------+
+ * | start | 1 ('%') SCE_HEX_RECSTART
+ * +----------+
+ * | length | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG
+ * +----------+
+ * | type | 1 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN)
+ * +----------+
+ * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG
+ * +----------+
+ * | address | 9 SCE_HEX_DATAADDRESS, SCE_HEX_STARTADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN)
+ * +----------+
+ * | data | 0..241 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN
+ * +----------+
+ *
+ *
+ * General notes for all lexers
+ * ===============================
+ *
+ * - Depending on where the helper functions are invoked, some of them have to
+ * read beyond the current position. In case of malformed data (record too
+ * short), it has to be ensured that this either does not have bad influence
+ * or will be captured deliberately.
+ *
+ * - States in parentheses in the upper format descriptions indicate that they
+ * should not appear in a valid hex file.
+ *
+ * - State SCE_HEX_GARBAGE means garbage data after the intended end of the
+ * record, the line is too long then. This state is used in all lexers.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// prototypes for general helper functions
+static inline bool IsNewline(const int ch);
+static int GetHexaNibble(char hd);
+static int GetHexaChar(char hd1, char hd2);
+static int GetHexaChar(unsigned int pos, Accessor &styler);
+static bool ForwardWithinLine(StyleContext &sc, int nb = 1);
+static bool PosInSameRecord(unsigned int pos1, unsigned int pos2, Accessor &styler);
+static int CountByteCount(unsigned int startPos, int uncountedDigits, Accessor &styler);
+static int CalcChecksum(unsigned int startPos, int cnt, bool twosCompl, Accessor &styler);
+
+// prototypes for file format specific helper functions
+static unsigned int GetSrecRecStartPosition(unsigned int pos, Accessor &styler);
+static int GetSrecByteCount(unsigned int recStartPos, Accessor &styler);
+static int CountSrecByteCount(unsigned int recStartPos, Accessor &styler);
+static int GetSrecAddressFieldSize(unsigned int recStartPos, Accessor &styler);
+static int GetSrecAddressFieldType(unsigned int recStartPos, Accessor &styler);
+static int GetSrecDataFieldType(unsigned int recStartPos, Accessor &styler);
+static int GetSrecRequiredDataFieldSize(unsigned int recStartPos, Accessor &styler);
+static int GetSrecChecksum(unsigned int recStartPos, Accessor &styler);
+static int CalcSrecChecksum(unsigned int recStartPos, Accessor &styler);
+
+static unsigned int GetIHexRecStartPosition(unsigned int pos, Accessor &styler);
+static int GetIHexByteCount(unsigned int recStartPos, Accessor &styler);
+static int CountIHexByteCount(unsigned int recStartPos, Accessor &styler);
+static int GetIHexAddressFieldType(unsigned int recStartPos, Accessor &styler);
+static int GetIHexDataFieldType(unsigned int recStartPos, Accessor &styler);
+static int GetIHexRequiredDataFieldSize(unsigned int recStartPos, Accessor &styler);
+static int GetIHexChecksum(unsigned int recStartPos, Accessor &styler);
+static int CalcIHexChecksum(unsigned int recStartPos, Accessor &styler);
+
+static int GetTEHexDigitCount(unsigned int recStartPos, Accessor &styler);
+static int CountTEHexDigitCount(unsigned int recStartPos, Accessor &styler);
+static int GetTEHexAddressFieldType(unsigned int recStartPos, Accessor &styler);
+static int GetTEHexChecksum(unsigned int recStartPos, Accessor &styler);
+static int CalcTEHexChecksum(unsigned int recStartPos, Accessor &styler);
+
+static inline bool IsNewline(const int ch)
+{
+ return (ch == '\n' || ch == '\r');
+}
+
+static int GetHexaNibble(char hd)
+{
+ int hexValue = 0;
+
+ if (hd >= '0' && hd <= '9') {
+ hexValue += hd - '0';
+ } else if (hd >= 'A' && hd <= 'F') {
+ hexValue += hd - 'A' + 10;
+ } else if (hd >= 'a' && hd <= 'f') {
+ hexValue += hd - 'a' + 10;
+ } else {
+ return -1;
+ }
+
+ return hexValue;
+}
+
+static int GetHexaChar(char hd1, char hd2)
+{
+ int hexValue = 0;
+
+ if (hd1 >= '0' && hd1 <= '9') {
+ hexValue += 16 * (hd1 - '0');
+ } else if (hd1 >= 'A' && hd1 <= 'F') {
+ hexValue += 16 * (hd1 - 'A' + 10);
+ } else if (hd1 >= 'a' && hd1 <= 'f') {
+ hexValue += 16 * (hd1 - 'a' + 10);
+ } else {
+ return -1;
+ }
+
+ if (hd2 >= '0' && hd2 <= '9') {
+ hexValue += hd2 - '0';
+ } else if (hd2 >= 'A' && hd2 <= 'F') {
+ hexValue += hd2 - 'A' + 10;
+ } else if (hd2 >= 'a' && hd2 <= 'f') {
+ hexValue += hd2 - 'a' + 10;
+ } else {
+ return -1;
+ }
+
+ return hexValue;
+}
+
+static int GetHexaChar(unsigned int pos, Accessor &styler)
+{
+ char highNibble, lowNibble;
+
+ highNibble = styler.SafeGetCharAt(pos);
+ lowNibble = styler.SafeGetCharAt(pos + 1);
+
+ return GetHexaChar(highNibble, lowNibble);
+}
+
+// Forward <nb> characters, but abort (and return false) if hitting the line
+// end. Return true if forwarding within the line was possible.
+// Avoids influence on highlighting of the subsequent line if the current line
+// is malformed (too short).
+static bool ForwardWithinLine(StyleContext &sc, int nb)
+{
+ for (int i = 0; i < nb; i++) {
+ if (sc.atLineEnd) {
+ // line is too short
+ sc.SetState(SCE_HEX_DEFAULT);
+ sc.Forward();
+ return false;
+ } else {
+ sc.Forward();
+ }
+ }
+
+ return true;
+}
+
+// Checks whether the given positions are in the same record.
+static bool PosInSameRecord(unsigned int pos1, unsigned int pos2, Accessor &styler)
+{
+ return styler.GetLine(pos1) == styler.GetLine(pos2);
+}
+
+// Count the number of digit pairs from <startPos> till end of record, ignoring
+// <uncountedDigits> digits.
+// If the record is too short, a negative count may be returned.
+static int CountByteCount(unsigned int startPos, int uncountedDigits, Accessor &styler)
+{
+ int cnt;
+ unsigned int pos;
+
+ pos = startPos;
+
+ while (!IsNewline(styler.SafeGetCharAt(pos, '\n'))) {
+ pos++;
+ }
+
+ // number of digits in this line minus number of digits of uncounted fields
+ cnt = static_cast<int>(pos - startPos) - uncountedDigits;
+
+ // Prepare round up if odd (digit pair incomplete), this way the byte
+ // count is considered to be valid if the checksum is incomplete.
+ if (cnt >= 0) {
+ cnt++;
+ }
+
+ // digit pairs
+ cnt /= 2;
+
+ return cnt;
+}
+
+// Calculate the checksum of the record.
+// <startPos> is the position of the first character of the starting digit
+// pair, <cnt> is the number of digit pairs.
+static int CalcChecksum(unsigned int startPos, int cnt, bool twosCompl, Accessor &styler)
+{
+ int cs = 0;
+
+ for (unsigned int pos = startPos; pos < startPos + cnt; pos += 2) {
+ int val = GetHexaChar(pos, styler);
+
+ if (val < 0) {
+ return val;
+ }
+
+ // overflow does not matter
+ cs += val;
+ }
+
+ if (twosCompl) {
+ // low byte of two's complement
+ return -cs & 0xFF;
+ } else {
+ // low byte of one's complement
+ return ~cs & 0xFF;
+ }
+}
+
+// Get the position of the record "start" field (first character in line) in
+// the record around position <pos>.
+static unsigned int GetSrecRecStartPosition(unsigned int pos, Accessor &styler)
+{
+ while (styler.SafeGetCharAt(pos) != 'S') {
+ pos--;
+ }
+
+ return pos;
+}
+
+// Get the value of the "byte count" field, it counts the number of bytes in
+// the subsequent fields ("address", "data" and "checksum" fields).
+static int GetSrecByteCount(unsigned int recStartPos, Accessor &styler)
+{
+ int val;
+
+ val = GetHexaChar(recStartPos + 2, styler);
+ if (val < 0) {
+ val = 0;
+ }
+
+ return val;
+}
+
+// Count the number of digit pairs for the "address", "data" and "checksum"
+// fields in this record. Has to be equal to the "byte count" field value.
+// If the record is too short, a negative count may be returned.
+static int CountSrecByteCount(unsigned int recStartPos, Accessor &styler)
+{
+ return CountByteCount(recStartPos, 4, styler);
+}
+
+// Get the size of the "address" field.
+static int GetSrecAddressFieldSize(unsigned int recStartPos, Accessor &styler)
+{
+ switch (styler.SafeGetCharAt(recStartPos + 1)) {
+ case '0':
+ case '1':
+ case '5':
+ case '9':
+ return 2; // 16 bit
+
+ case '2':
+ case '6':
+ case '8':
+ return 3; // 24 bit
+
+ case '3':
+ case '7':
+ return 4; // 32 bit
+
+ default:
+ return 0;
+ }
+}
+
+// Get the type of the "address" field content.
+static int GetSrecAddressFieldType(unsigned int recStartPos, Accessor &styler)
+{
+ switch (styler.SafeGetCharAt(recStartPos + 1)) {
+ case '0':
+ return SCE_HEX_NOADDRESS;
+
+ case '1':
+ case '2':
+ case '3':
+ return SCE_HEX_DATAADDRESS;
+
+ case '5':
+ case '6':
+ return SCE_HEX_RECCOUNT;
+
+ case '7':
+ case '8':
+ case '9':
+ return SCE_HEX_STARTADDRESS;
+
+ default: // handle possible format extension in the future
+ return SCE_HEX_ADDRESSFIELD_UNKNOWN;
+ }
+}
+
+// Get the type of the "data" field content.
+static int GetSrecDataFieldType(unsigned int recStartPos, Accessor &styler)
+{
+ switch (styler.SafeGetCharAt(recStartPos + 1)) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ return SCE_HEX_DATA_ODD;
+
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ return SCE_HEX_DATA_EMPTY;
+
+ default: // handle possible format extension in the future
+ return SCE_HEX_DATA_UNKNOWN;
+ }
+}
+
+// Get the required size of the "data" field. Useless for block header and
+// ordinary data records (type S0, S1, S2, S3), return the value calculated
+// from the "byte count" and "address field" size in this case.
+static int GetSrecRequiredDataFieldSize(unsigned int recStartPos, Accessor &styler)
+{
+ switch (styler.SafeGetCharAt(recStartPos + 1)) {
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ return 0;
+
+ default:
+ return GetSrecByteCount(recStartPos, styler)
+ - GetSrecAddressFieldSize(recStartPos, styler)
+ - 1; // -1 for checksum field
+ }
+}
+
+// Get the value of the "checksum" field.
+static int GetSrecChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ int byteCount;
+
+ byteCount = GetSrecByteCount(recStartPos, styler);
+
+ return GetHexaChar(recStartPos + 2 + byteCount * 2, styler);
+}
+
+// Calculate the checksum of the record.
+static int CalcSrecChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ int byteCount;
+
+ byteCount = GetSrecByteCount(recStartPos, styler);
+
+ // sum over "byte count", "address" and "data" fields (6..510 digits)
+ return CalcChecksum(recStartPos + 2, byteCount * 2, false, styler);
+}
+
+// Get the position of the record "start" field (first character in line) in
+// the record around position <pos>.
+static unsigned int GetIHexRecStartPosition(unsigned int pos, Accessor &styler)
+{
+ while (styler.SafeGetCharAt(pos) != ':') {
+ pos--;
+ }
+
+ return pos;
+}
+
+// Get the value of the "byte count" field, it counts the number of bytes in
+// the "data" field.
+static int GetIHexByteCount(unsigned int recStartPos, Accessor &styler)
+{
+ int val;
+
+ val = GetHexaChar(recStartPos + 1, styler);
+ if (val < 0) {
+ val = 0;
+ }
+
+ return val;
+}
+
+// Count the number of digit pairs for the "data" field in this record. Has to
+// be equal to the "byte count" field value.
+// If the record is too short, a negative count may be returned.
+static int CountIHexByteCount(unsigned int recStartPos, Accessor &styler)
+{
+ return CountByteCount(recStartPos, 11, styler);
+}
+
+// Get the type of the "address" field content.
+static int GetIHexAddressFieldType(unsigned int recStartPos, Accessor &styler)
+{
+ if (!PosInSameRecord(recStartPos, recStartPos + 7, styler)) {
+ // malformed (record too short)
+ // type cannot be determined
+ return SCE_HEX_ADDRESSFIELD_UNKNOWN;
+ }
+
+ switch (GetHexaChar(recStartPos + 7, styler)) {
+ case 0x00:
+ return SCE_HEX_DATAADDRESS;
+
+ case 0x01:
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ return SCE_HEX_NOADDRESS;
+
+ default: // handle possible format extension in the future
+ return SCE_HEX_ADDRESSFIELD_UNKNOWN;
+ }
+}
+
+// Get the type of the "data" field content.
+static int GetIHexDataFieldType(unsigned int recStartPos, Accessor &styler)
+{
+ switch (GetHexaChar(recStartPos + 7, styler)) {
+ case 0x00:
+ return SCE_HEX_DATA_ODD;
+
+ case 0x01:
+ return SCE_HEX_DATA_EMPTY;
+
+ case 0x02:
+ case 0x04:
+ return SCE_HEX_EXTENDEDADDRESS;
+
+ case 0x03:
+ case 0x05:
+ return SCE_HEX_STARTADDRESS;
+
+ default: // handle possible format extension in the future
+ return SCE_HEX_DATA_UNKNOWN;
+ }
+}
+
+// Get the required size of the "data" field. Useless for an ordinary data
+// record (type 00), return the "byte count" in this case.
+static int GetIHexRequiredDataFieldSize(unsigned int recStartPos, Accessor &styler)
+{
+ switch (GetHexaChar(recStartPos + 7, styler)) {
+ case 0x01:
+ return 0;
+
+ case 0x02:
+ case 0x04:
+ return 2;
+
+ case 0x03:
+ case 0x05:
+ return 4;
+
+ default:
+ return GetIHexByteCount(recStartPos, styler);
+ }
+}
+
+// Get the value of the "checksum" field.
+static int GetIHexChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ int byteCount;
+
+ byteCount = GetIHexByteCount(recStartPos, styler);
+
+ return GetHexaChar(recStartPos + 9 + byteCount * 2, styler);
+}
+
+// Calculate the checksum of the record.
+static int CalcIHexChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ int byteCount;
+
+ byteCount = GetIHexByteCount(recStartPos, styler);
+
+ // sum over "byte count", "address", "type" and "data" fields (8..518 digits)
+ return CalcChecksum(recStartPos + 1, 8 + byteCount * 2, true, styler);
+}
+
+
+// Get the value of the "record length" field, it counts the number of digits in
+// the record excluding the percent.
+static int GetTEHexDigitCount(unsigned int recStartPos, Accessor &styler)
+{
+ int val = GetHexaChar(recStartPos + 1, styler);
+ if (val < 0)
+ val = 0;
+
+ return val;
+}
+
+// Count the number of digits in this record. Has to
+// be equal to the "record length" field value.
+static int CountTEHexDigitCount(unsigned int recStartPos, Accessor &styler)
+{
+ unsigned int pos;
+
+ pos = recStartPos+1;
+
+ while (!IsNewline(styler.SafeGetCharAt(pos, '\n'))) {
+ pos++;
+ }
+
+ return static_cast<int>(pos - (recStartPos+1));
+}
+
+// Get the type of the "address" field content.
+static int GetTEHexAddressFieldType(unsigned int recStartPos, Accessor &styler)
+{
+ switch (styler.SafeGetCharAt(recStartPos + 3)) {
+ case '6':
+ return SCE_HEX_DATAADDRESS;
+
+ case '8':
+ return SCE_HEX_STARTADDRESS;
+
+ default: // handle possible format extension in the future
+ return SCE_HEX_ADDRESSFIELD_UNKNOWN;
+ }
+}
+
+// Get the value of the "checksum" field.
+static int GetTEHexChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ return GetHexaChar(recStartPos+4, styler);
+}
+
+// Calculate the checksum of the record (excluding the checksum field).
+static int CalcTEHexChecksum(unsigned int recStartPos, Accessor &styler)
+{
+ unsigned int pos = recStartPos +1;
+ unsigned int length = GetTEHexDigitCount(recStartPos, styler);
+
+ int cs = GetHexaNibble(styler.SafeGetCharAt(pos++));//length
+ cs += GetHexaNibble(styler.SafeGetCharAt(pos++));//length
+
+ cs += GetHexaNibble(styler.SafeGetCharAt(pos++));//type
+
+ pos += 2;// jump over CS field
+
+ for (; pos <= recStartPos + length; ++pos) {
+ int val = GetHexaNibble(styler.SafeGetCharAt(pos));
+
+ if (val < 0) {
+ return val;
+ }
+
+ // overflow does not matter
+ cs += val;
+ }
+
+ // low byte
+ return cs & 0xFF;
+
+}
+
+static void ColouriseSrecDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+ unsigned int recStartPos;
+ int byteCount, reqByteCount, addrFieldSize, addrFieldType, dataFieldSize, dataFieldType;
+ int cs1, cs2;
+
+ switch (sc.state) {
+ case SCE_HEX_DEFAULT:
+ if (sc.atLineStart && sc.Match('S')) {
+ sc.SetState(SCE_HEX_RECSTART);
+ }
+ ForwardWithinLine(sc);
+ break;
+
+ case SCE_HEX_RECSTART:
+ recStartPos = sc.currentPos - 1;
+ addrFieldType = GetSrecAddressFieldType(recStartPos, styler);
+
+ if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) {
+ sc.SetState(SCE_HEX_RECTYPE_UNKNOWN);
+ } else {
+ sc.SetState(SCE_HEX_RECTYPE);
+ }
+
+ ForwardWithinLine(sc);
+ break;
+
+ case SCE_HEX_RECTYPE:
+ case SCE_HEX_RECTYPE_UNKNOWN:
+ recStartPos = sc.currentPos - 2;
+ byteCount = GetSrecByteCount(recStartPos, styler);
+ reqByteCount = GetSrecAddressFieldSize(recStartPos, styler)
+ + GetSrecRequiredDataFieldSize(recStartPos, styler)
+ + 1; // +1 for checksum field
+
+ if (byteCount == CountSrecByteCount(recStartPos, styler)
+ && byteCount == reqByteCount) {
+ sc.SetState(SCE_HEX_BYTECOUNT);
+ } else {
+ sc.SetState(SCE_HEX_BYTECOUNT_WRONG);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_BYTECOUNT:
+ case SCE_HEX_BYTECOUNT_WRONG:
+ recStartPos = sc.currentPos - 4;
+ addrFieldSize = GetSrecAddressFieldSize(recStartPos, styler);
+ addrFieldType = GetSrecAddressFieldType(recStartPos, styler);
+
+ sc.SetState(addrFieldType);
+ ForwardWithinLine(sc, addrFieldSize * 2);
+ break;
+
+ case SCE_HEX_NOADDRESS:
+ case SCE_HEX_DATAADDRESS:
+ case SCE_HEX_RECCOUNT:
+ case SCE_HEX_STARTADDRESS:
+ case SCE_HEX_ADDRESSFIELD_UNKNOWN:
+ recStartPos = GetSrecRecStartPosition(sc.currentPos, styler);
+ dataFieldType = GetSrecDataFieldType(recStartPos, styler);
+
+ // Using the required size here if possible has the effect that the
+ // checksum is highlighted at a fixed position after this field for
+ // specific record types, independent on the "byte count" value.
+ dataFieldSize = GetSrecRequiredDataFieldSize(recStartPos, styler);
+
+ sc.SetState(dataFieldType);
+
+ if (dataFieldType == SCE_HEX_DATA_ODD) {
+ for (int i = 0; i < dataFieldSize * 2; i++) {
+ if ((i & 0x3) == 0) {
+ sc.SetState(SCE_HEX_DATA_ODD);
+ } else if ((i & 0x3) == 2) {
+ sc.SetState(SCE_HEX_DATA_EVEN);
+ }
+
+ if (!ForwardWithinLine(sc)) {
+ break;
+ }
+ }
+ } else {
+ ForwardWithinLine(sc, dataFieldSize * 2);
+ }
+ break;
+
+ case SCE_HEX_DATA_ODD:
+ case SCE_HEX_DATA_EVEN:
+ case SCE_HEX_DATA_EMPTY:
+ case SCE_HEX_DATA_UNKNOWN:
+ recStartPos = GetSrecRecStartPosition(sc.currentPos, styler);
+ cs1 = CalcSrecChecksum(recStartPos, styler);
+ cs2 = GetSrecChecksum(recStartPos, styler);
+
+ if (cs1 != cs2 || cs1 < 0 || cs2 < 0) {
+ sc.SetState(SCE_HEX_CHECKSUM_WRONG);
+ } else {
+ sc.SetState(SCE_HEX_CHECKSUM);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_CHECKSUM:
+ case SCE_HEX_CHECKSUM_WRONG:
+ case SCE_HEX_GARBAGE:
+ // record finished or line too long
+ sc.SetState(SCE_HEX_GARBAGE);
+ ForwardWithinLine(sc);
+ break;
+
+ default:
+ // prevent endless loop in faulty state
+ sc.SetState(SCE_HEX_DEFAULT);
+ break;
+ }
+ }
+ sc.Complete();
+}
+
+static void ColouriseIHexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+ unsigned int recStartPos;
+ int byteCount, addrFieldType, dataFieldSize, dataFieldType;
+ int cs1, cs2;
+
+ switch (sc.state) {
+ case SCE_HEX_DEFAULT:
+ if (sc.atLineStart && sc.Match(':')) {
+ sc.SetState(SCE_HEX_RECSTART);
+ }
+ ForwardWithinLine(sc);
+ break;
+
+ case SCE_HEX_RECSTART:
+ recStartPos = sc.currentPos - 1;
+ byteCount = GetIHexByteCount(recStartPos, styler);
+ dataFieldSize = GetIHexRequiredDataFieldSize(recStartPos, styler);
+
+ if (byteCount == CountIHexByteCount(recStartPos, styler)
+ && byteCount == dataFieldSize) {
+ sc.SetState(SCE_HEX_BYTECOUNT);
+ } else {
+ sc.SetState(SCE_HEX_BYTECOUNT_WRONG);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_BYTECOUNT:
+ case SCE_HEX_BYTECOUNT_WRONG:
+ recStartPos = sc.currentPos - 3;
+ addrFieldType = GetIHexAddressFieldType(recStartPos, styler);
+
+ sc.SetState(addrFieldType);
+ ForwardWithinLine(sc, 4);
+ break;
+
+ case SCE_HEX_NOADDRESS:
+ case SCE_HEX_DATAADDRESS:
+ case SCE_HEX_ADDRESSFIELD_UNKNOWN:
+ recStartPos = sc.currentPos - 7;
+ addrFieldType = GetIHexAddressFieldType(recStartPos, styler);
+
+ if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) {
+ sc.SetState(SCE_HEX_RECTYPE_UNKNOWN);
+ } else {
+ sc.SetState(SCE_HEX_RECTYPE);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_RECTYPE:
+ case SCE_HEX_RECTYPE_UNKNOWN:
+ recStartPos = sc.currentPos - 9;
+ dataFieldType = GetIHexDataFieldType(recStartPos, styler);
+
+ // Using the required size here if possible has the effect that the
+ // checksum is highlighted at a fixed position after this field for
+ // specific record types, independent on the "byte count" value.
+ dataFieldSize = GetIHexRequiredDataFieldSize(recStartPos, styler);
+
+ sc.SetState(dataFieldType);
+
+ if (dataFieldType == SCE_HEX_DATA_ODD) {
+ for (int i = 0; i < dataFieldSize * 2; i++) {
+ if ((i & 0x3) == 0) {
+ sc.SetState(SCE_HEX_DATA_ODD);
+ } else if ((i & 0x3) == 2) {
+ sc.SetState(SCE_HEX_DATA_EVEN);
+ }
+
+ if (!ForwardWithinLine(sc)) {
+ break;
+ }
+ }
+ } else {
+ ForwardWithinLine(sc, dataFieldSize * 2);
+ }
+ break;
+
+ case SCE_HEX_DATA_ODD:
+ case SCE_HEX_DATA_EVEN:
+ case SCE_HEX_DATA_EMPTY:
+ case SCE_HEX_EXTENDEDADDRESS:
+ case SCE_HEX_STARTADDRESS:
+ case SCE_HEX_DATA_UNKNOWN:
+ recStartPos = GetIHexRecStartPosition(sc.currentPos, styler);
+ cs1 = CalcIHexChecksum(recStartPos, styler);
+ cs2 = GetIHexChecksum(recStartPos, styler);
+
+ if (cs1 != cs2 || cs1 < 0 || cs2 < 0) {
+ sc.SetState(SCE_HEX_CHECKSUM_WRONG);
+ } else {
+ sc.SetState(SCE_HEX_CHECKSUM);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_CHECKSUM:
+ case SCE_HEX_CHECKSUM_WRONG:
+ case SCE_HEX_GARBAGE:
+ // record finished or line too long
+ sc.SetState(SCE_HEX_GARBAGE);
+ ForwardWithinLine(sc);
+ break;
+
+ default:
+ // prevent endless loop in faulty state
+ sc.SetState(SCE_HEX_DEFAULT);
+ break;
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldIHexDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ unsigned int endPos = startPos + length;
+
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent - 1);
+
+ unsigned int lineStartNext = styler.LineStart(lineCurrent + 1);
+ int levelNext = SC_FOLDLEVELBASE; // default if no specific line found
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ bool atEOL = i == (lineStartNext - 1);
+ int style = styler.StyleAt(i);
+
+ // search for specific lines
+ if (style == SCE_HEX_EXTENDEDADDRESS) {
+ // extended addres record
+ levelNext = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ } else if (style == SCE_HEX_DATAADDRESS
+ || (style == SCE_HEX_DEFAULT
+ && i == (unsigned int)styler.LineStart(lineCurrent))) {
+ // data record or no record start code at all
+ if (levelCurrent & SC_FOLDLEVELHEADERFLAG) {
+ levelNext = SC_FOLDLEVELBASE + 1;
+ } else {
+ // continue level 0 or 1, no fold point
+ levelNext = levelCurrent;
+ }
+ }
+
+ if (atEOL || (i == endPos - 1)) {
+ styler.SetLevel(lineCurrent, levelNext);
+
+ lineCurrent++;
+ lineStartNext = styler.LineStart(lineCurrent + 1);
+ levelCurrent = levelNext;
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+static void ColouriseTEHexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+ unsigned int recStartPos;
+ int digitCount, addrFieldType;
+ int cs1, cs2;
+
+ switch (sc.state) {
+ case SCE_HEX_DEFAULT:
+ if (sc.atLineStart && sc.Match('%')) {
+ sc.SetState(SCE_HEX_RECSTART);
+ }
+ ForwardWithinLine(sc);
+ break;
+
+ case SCE_HEX_RECSTART:
+
+ recStartPos = sc.currentPos - 1;
+
+ if (GetTEHexDigitCount(recStartPos, styler) == CountTEHexDigitCount(recStartPos, styler)) {
+ sc.SetState(SCE_HEX_BYTECOUNT);
+ } else {
+ sc.SetState(SCE_HEX_BYTECOUNT_WRONG);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+ case SCE_HEX_BYTECOUNT:
+ case SCE_HEX_BYTECOUNT_WRONG:
+ recStartPos = sc.currentPos - 3;
+ addrFieldType = GetTEHexAddressFieldType(recStartPos, styler);
+
+ if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) {
+ sc.SetState(SCE_HEX_RECTYPE_UNKNOWN);
+ } else {
+ sc.SetState(SCE_HEX_RECTYPE);
+ }
+
+ ForwardWithinLine(sc);
+ break;
+
+ case SCE_HEX_RECTYPE:
+ case SCE_HEX_RECTYPE_UNKNOWN:
+ recStartPos = sc.currentPos - 4;
+ cs1 = CalcTEHexChecksum(recStartPos, styler);
+ cs2 = GetTEHexChecksum(recStartPos, styler);
+
+ if (cs1 != cs2 || cs1 < 0 || cs2 < 0) {
+ sc.SetState(SCE_HEX_CHECKSUM_WRONG);
+ } else {
+ sc.SetState(SCE_HEX_CHECKSUM);
+ }
+
+ ForwardWithinLine(sc, 2);
+ break;
+
+
+ case SCE_HEX_CHECKSUM:
+ case SCE_HEX_CHECKSUM_WRONG:
+ recStartPos = sc.currentPos - 6;
+ addrFieldType = GetTEHexAddressFieldType(recStartPos, styler);
+
+ sc.SetState(addrFieldType);
+ ForwardWithinLine(sc, 9);
+ break;
+
+ case SCE_HEX_DATAADDRESS:
+ case SCE_HEX_STARTADDRESS:
+ case SCE_HEX_ADDRESSFIELD_UNKNOWN:
+ recStartPos = sc.currentPos - 15;
+ digitCount = GetTEHexDigitCount(recStartPos, styler) - 14;
+
+ sc.SetState(SCE_HEX_DATA_ODD);
+
+ for (int i = 0; i < digitCount; i++) {
+ if ((i & 0x3) == 0) {
+ sc.SetState(SCE_HEX_DATA_ODD);
+ } else if ((i & 0x3) == 2) {
+ sc.SetState(SCE_HEX_DATA_EVEN);
+ }
+
+ if (!ForwardWithinLine(sc)) {
+ break;
+ }
+ }
+ break;
+
+ case SCE_HEX_DATA_ODD:
+ case SCE_HEX_DATA_EVEN:
+ case SCE_HEX_GARBAGE:
+ // record finished or line too long
+ sc.SetState(SCE_HEX_GARBAGE);
+ ForwardWithinLine(sc);
+ break;
+
+ default:
+ // prevent endless loop in faulty state
+ sc.SetState(SCE_HEX_DEFAULT);
+ break;
+ }
+ }
+ sc.Complete();
+}
+
+LexerModule lmSrec(SCLEX_SREC, ColouriseSrecDoc, "srec", 0, NULL);
+LexerModule lmIHex(SCLEX_IHEX, ColouriseIHexDoc, "ihex", FoldIHexDoc, NULL);
+LexerModule lmTEHex(SCLEX_TEHEX, ColouriseTEHexDoc, "tehex", 0, NULL);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexInno.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexInno.cxx
new file mode 100644
index 00000000000..63fadf0ba6e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexInno.cxx
@@ -0,0 +1,290 @@
+// Scintilla source code edit control
+/** @file LexInno.cxx
+ ** Lexer for Inno Setup scripts.
+ **/
+// Written by Friedrich Vedder <fvedd@t-online.de>, using code from LexOthers.cxx.
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
+ int state = SCE_INNO_DEFAULT;
+ char chPrev;
+ char ch = 0;
+ char chNext = styler[startPos];
+ int lengthDoc = startPos + length;
+ char *buffer = new char[length];
+ int bufferCount = 0;
+ bool isBOL, isEOL, isWS, isBOLWS = 0;
+ bool isCStyleComment = false;
+
+ WordList &sectionKeywords = *keywordLists[0];
+ WordList &standardKeywords = *keywordLists[1];
+ WordList &parameterKeywords = *keywordLists[2];
+ WordList &preprocessorKeywords = *keywordLists[3];
+ WordList &pascalKeywords = *keywordLists[4];
+ WordList &userKeywords = *keywordLists[5];
+
+ int curLine = styler.GetLine(startPos);
+ int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : 0;
+ bool isCode = (curLineState == 1);
+
+ // Go through all provided text segment
+ // using the hand-written state machine shown below
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ for (int i = startPos; i < lengthDoc; i++) {
+ chPrev = ch;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ i++;
+ continue;
+ }
+
+ isBOL = (chPrev == 0) || (chPrev == '\n') || (chPrev == '\r' && ch != '\n');
+ isBOLWS = (isBOL) ? 1 : (isBOLWS && (chPrev == ' ' || chPrev == '\t'));
+ isEOL = (ch == '\n' || ch == '\r');
+ isWS = (ch == ' ' || ch == '\t');
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Remember the line state for future incremental lexing
+ curLine = styler.GetLine(i);
+ styler.SetLineState(curLine, (isCode ? 1 : 0));
+ }
+
+ switch(state) {
+ case SCE_INNO_DEFAULT:
+ if (!isCode && ch == ';' && isBOLWS) {
+ // Start of a comment
+ state = SCE_INNO_COMMENT;
+ } else if (ch == '[' && isBOLWS) {
+ // Start of a section name
+ bufferCount = 0;
+ state = SCE_INNO_SECTION;
+ } else if (ch == '#' && isBOLWS) {
+ // Start of a preprocessor directive
+ state = SCE_INNO_PREPROC;
+ } else if (!isCode && ch == '{' && chNext != '{' && chPrev != '{') {
+ // Start of an inline expansion
+ state = SCE_INNO_INLINE_EXPANSION;
+ } else if (isCode && (ch == '{' || (ch == '(' && chNext == '*'))) {
+ // Start of a Pascal comment
+ state = SCE_INNO_COMMENT_PASCAL;
+ isCStyleComment = false;
+ } else if (isCode && ch == '/' && chNext == '/') {
+ // Apparently, C-style comments are legal, too
+ state = SCE_INNO_COMMENT_PASCAL;
+ isCStyleComment = true;
+ } else if (ch == '"') {
+ // Start of a double-quote string
+ state = SCE_INNO_STRING_DOUBLE;
+ } else if (ch == '\'') {
+ // Start of a single-quote string
+ state = SCE_INNO_STRING_SINGLE;
+ } else if (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) {
+ // Start of an identifier
+ bufferCount = 0;
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ state = SCE_INNO_IDENTIFIER;
+ } else {
+ // Style it the default style
+ styler.ColourTo(i,SCE_INNO_DEFAULT);
+ }
+ break;
+
+ case SCE_INNO_COMMENT:
+ if (isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_COMMENT);
+ }
+ break;
+
+ case SCE_INNO_IDENTIFIER:
+ if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ } else {
+ state = SCE_INNO_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // Check if the buffer contains a keyword
+ if (!isCode && standardKeywords.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_INNO_KEYWORD);
+ } else if (!isCode && parameterKeywords.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_INNO_PARAMETER);
+ } else if (isCode && pascalKeywords.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_INNO_KEYWORD_PASCAL);
+ } else if (!isCode && userKeywords.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_INNO_KEYWORD_USER);
+ } else {
+ styler.ColourTo(i-1,SCE_INNO_DEFAULT);
+ }
+
+ // Push back the faulty character
+ chNext = styler[i--];
+ ch = chPrev;
+ }
+ break;
+
+ case SCE_INNO_SECTION:
+ if (ch == ']') {
+ state = SCE_INNO_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // Check if the buffer contains a section name
+ if (sectionKeywords.InList(buffer)) {
+ styler.ColourTo(i,SCE_INNO_SECTION);
+ isCode = !CompareCaseInsensitive(buffer, "code");
+ } else {
+ styler.ColourTo(i,SCE_INNO_DEFAULT);
+ }
+ } else if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ } else {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_DEFAULT);
+ }
+ break;
+
+ case SCE_INNO_PREPROC:
+ if (isWS || isEOL) {
+ if (IsASCII(chPrev) && isalpha(chPrev)) {
+ state = SCE_INNO_DEFAULT;
+ buffer[bufferCount] = '\0';
+
+ // Check if the buffer contains a preprocessor directive
+ if (preprocessorKeywords.InList(buffer)) {
+ styler.ColourTo(i-1,SCE_INNO_PREPROC);
+ } else {
+ styler.ColourTo(i-1,SCE_INNO_DEFAULT);
+ }
+
+ // Push back the faulty character
+ chNext = styler[i--];
+ ch = chPrev;
+ }
+ } else if (IsASCII(ch) && isalpha(ch)) {
+ if (chPrev == '#' || chPrev == ' ' || chPrev == '\t')
+ bufferCount = 0;
+ buffer[bufferCount++] = static_cast<char>(tolower(ch));
+ }
+ break;
+
+ case SCE_INNO_STRING_DOUBLE:
+ if (ch == '"' || isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_STRING_DOUBLE);
+ }
+ break;
+
+ case SCE_INNO_STRING_SINGLE:
+ if (ch == '\'' || isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_STRING_SINGLE);
+ }
+ break;
+
+ case SCE_INNO_INLINE_EXPANSION:
+ if (ch == '}') {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_INLINE_EXPANSION);
+ } else if (isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_DEFAULT);
+ }
+ break;
+
+ case SCE_INNO_COMMENT_PASCAL:
+ if (isCStyleComment) {
+ if (isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_COMMENT_PASCAL);
+ }
+ } else {
+ if (ch == '}' || (ch == ')' && chPrev == '*')) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_COMMENT_PASCAL);
+ } else if (isEOL) {
+ state = SCE_INNO_DEFAULT;
+ styler.ColourTo(i,SCE_INNO_DEFAULT);
+ }
+ }
+ break;
+
+ }
+ }
+ delete []buffer;
+}
+
+static const char * const innoWordListDesc[] = {
+ "Sections",
+ "Keywords",
+ "Parameters",
+ "Preprocessor directives",
+ "Pascal keywords",
+ "User defined keywords",
+ 0
+};
+
+static void FoldInnoDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ unsigned int endPos = startPos + length;
+ char chNext = styler[startPos];
+
+ int lineCurrent = styler.GetLine(startPos);
+
+ bool sectionFlag = false;
+ int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) : SC_FOLDLEVELBASE;
+ int level;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler[i+1];
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ int style = styler.StyleAt(i);
+
+ if (style == SCE_INNO_SECTION)
+ sectionFlag = true;
+
+ if (atEOL || i == endPos - 1) {
+ if (sectionFlag) {
+ level = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ if (level == levelPrev)
+ styler.SetLevel(lineCurrent - 1, levelPrev & ~SC_FOLDLEVELHEADERFLAG);
+ } else {
+ level = levelPrev & SC_FOLDLEVELNUMBERMASK;
+ if (levelPrev & SC_FOLDLEVELHEADERFLAG)
+ level++;
+ }
+
+ styler.SetLevel(lineCurrent, level);
+
+ levelPrev = level;
+ lineCurrent++;
+ sectionFlag = false;
+ }
+ }
+}
+
+LexerModule lmInno(SCLEX_INNOSETUP, ColouriseInnoDoc, "inno", FoldInnoDoc, innoWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKVIrc.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKVIrc.cxx
new file mode 100644
index 00000000000..958a2cf67c0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKVIrc.cxx
@@ -0,0 +1,473 @@
+// Scintilla source code edit control
+/** @file LexKVIrc.cxx
+ ** Lexer for KVIrc script.
+ **/
+// Copyright 2013 by OmegaPhil <OmegaPhil+scintilla@gmail.com>, based in
+// part from LexPython Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// and LexCmake Copyright 2007 by Cristian Adam <cristian [dot] adam [at] gmx [dot] net>
+
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+/* KVIrc Script syntactic rules: http://www.kvirc.net/doc/doc_syntactic_rules.html */
+
+/* Utility functions */
+static inline bool IsAWordChar(int ch) {
+
+ /* Keyword list includes modules, i.e. words including '.', and
+ * alias namespaces include ':' */
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'
+ || ch == ':');
+}
+static inline bool IsAWordStart(int ch) {
+
+ /* Functions (start with '$') are treated separately to keywords */
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' );
+}
+
+/* Interface function called by Scintilla to request some text to be
+ syntax highlighted */
+static void ColouriseKVIrcDoc(unsigned int startPos, int length,
+ int initStyle, WordList *keywordlists[],
+ Accessor &styler)
+{
+ /* Fetching style context */
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ /* Accessing keywords and function-marking keywords */
+ WordList &keywords = *keywordlists[0];
+ WordList &functionKeywords = *keywordlists[1];
+
+ /* Looping for all characters - only automatically moving forward
+ * when asked for (transitions leaving strings and keywords do this
+ * already) */
+ bool next = true;
+ for( ; sc.More(); next ? sc.Forward() : (void)0 )
+ {
+ /* Resetting next */
+ next = true;
+
+ /* Dealing with different states */
+ switch (sc.state)
+ {
+ case SCE_KVIRC_DEFAULT:
+
+ /* Detecting single-line comments
+ * Unfortunately KVIrc script allows raw '#<channel
+ * name>' to be used, and appending # to an array returns
+ * its length...
+ * Going for a compromise where single line comments not
+ * starting on a newline are allowed in all cases except
+ * when they are preceeded with an opening bracket or comma
+ * (this will probably be the most common style a valid
+ * string-less channel name will be used with), with the
+ * array length case included
+ */
+ if (
+ (sc.ch == '#' && sc.atLineStart) ||
+ (sc.ch == '#' && (
+ sc.chPrev != '(' && sc.chPrev != ',' &&
+ sc.chPrev != ']')
+ )
+ )
+ {
+ sc.SetState(SCE_KVIRC_COMMENT);
+ break;
+ }
+
+ /* Detecting multi-line comments */
+ if (sc.Match('/', '*'))
+ {
+ sc.SetState(SCE_KVIRC_COMMENTBLOCK);
+ break;
+ }
+
+ /* Detecting strings */
+ if (sc.ch == '"')
+ {
+ sc.SetState(SCE_KVIRC_STRING);
+ break;
+ }
+
+ /* Detecting functions */
+ if (sc.ch == '$')
+ {
+ sc.SetState(SCE_KVIRC_FUNCTION);
+ break;
+ }
+
+ /* Detecting variables */
+ if (sc.ch == '%')
+ {
+ sc.SetState(SCE_KVIRC_VARIABLE);
+ break;
+ }
+
+ /* Detecting numbers - isdigit is unsafe as it does not
+ * validate, use CharacterSet.h functions */
+ if (IsADigit(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_NUMBER);
+ break;
+ }
+
+ /* Detecting words */
+ if (IsAWordStart(sc.ch) && IsAWordChar(sc.chNext))
+ {
+ sc.SetState(SCE_KVIRC_WORD);
+ sc.Forward();
+ break;
+ }
+
+ /* Detecting operators */
+ if (isoperator(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_OPERATOR);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_COMMENT:
+
+ /* Breaking out of single line comment when a newline
+ * is introduced */
+ if (sc.ch == '\r' || sc.ch == '\n')
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_COMMENTBLOCK:
+
+ /* Detecting end of multi-line comment */
+ if (sc.Match('*', '/'))
+ {
+ // Moving the current position forward two characters
+ // so that '*/' is included in the comment
+ sc.Forward(2);
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Comment has been exited and the current position
+ * moved forward, yet the new current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_STRING:
+
+ /* Detecting end of string - closing speechmarks */
+ if (sc.ch == '"')
+ {
+ /* Allowing escaped speechmarks to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ /* Moving the current position forward to capture the
+ * terminating speechmarks, and ending string */
+ sc.ForwardSetState(SCE_KVIRC_DEFAULT);
+
+ /* String has been exited and the current position
+ * moved forward, yet the new current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ /* Functions and variables are now highlighted in strings
+ * Detecting functions */
+ if (sc.ch == '$')
+ {
+ /* Allowing escaped functions to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_STRING_FUNCTION);
+ break;
+ }
+
+ /* Detecting variables */
+ if (sc.ch == '%')
+ {
+ /* Allowing escaped variables to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_STRING_VARIABLE);
+ break;
+ }
+
+ /* Breaking out of a string when a newline is introduced */
+ if (sc.ch == '\r' || sc.ch == '\n')
+ {
+ /* Allowing escaped newlines */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_DEFAULT);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_FUNCTION:
+ case SCE_KVIRC_VARIABLE:
+
+ /* Detecting the end of a function/variable (word) */
+ if (!IsAWordChar(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_STRING_FUNCTION:
+ case SCE_KVIRC_STRING_VARIABLE:
+
+ /* A function or variable in a string
+ * Detecting the end of a function/variable (word) */
+ if (!IsAWordChar(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_STRING);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_NUMBER:
+
+ /* Detecting the end of a number */
+ if (!IsADigit(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Number has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_OPERATOR:
+
+ /* Because '%' is an operator but is also the marker for
+ * a variable, I need to always treat operators as single
+ * character strings and therefore redo their detection
+ * after every character */
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Operator has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward */
+ next = false;
+ break;
+
+ case SCE_KVIRC_WORD:
+
+ /* Detecting the end of a word */
+ if (!IsAWordChar(sc.ch))
+ {
+ /* Checking if the word was actually a keyword -
+ * fetching the current word, NULL-terminated like
+ * the keyword list */
+ char s[100];
+ int wordLen = sc.currentPos - styler.GetStartSegment();
+ if (wordLen > 99)
+ wordLen = 99; /* Include '\0' in buffer */
+ int i;
+ for( i = 0; i < wordLen; ++i )
+ {
+ s[i] = styler.SafeGetCharAt( styler.GetStartSegment() + i );
+ }
+ s[wordLen] = '\0';
+
+ /* Actually detecting keywords and fixing the state */
+ if (keywords.InList(s))
+ {
+ /* The SetState call actually commits the
+ * previous keyword state */
+ sc.ChangeState(SCE_KVIRC_KEYWORD);
+ }
+ else if (functionKeywords.InList(s))
+ {
+ // Detecting function keywords and fixing the state
+ sc.ChangeState(SCE_KVIRC_FUNCTION_KEYWORD);
+ }
+
+ /* Transitioning to default and committing the previous
+ * word state */
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+ }
+ }
+
+ /* Indicating processing is complete */
+ sc.Complete();
+}
+
+static void FoldKVIrcDoc(unsigned int startPos, int length, int /*initStyle - unused*/,
+ WordList *[], Accessor &styler)
+{
+ /* Based on CMake's folder */
+
+ /* Exiting if folding isnt enabled */
+ if ( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ /* Obtaining current line number*/
+ int currentLine = styler.GetLine(startPos);
+
+ /* Obtaining starting character - indentation is done on a line basis,
+ * not character */
+ unsigned int safeStartPos = styler.LineStart( currentLine );
+
+ /* Initialising current level - this is defined as indentation level
+ * in the low 12 bits, with flag bits in the upper four bits.
+ * It looks like two indentation states are maintained in the returned
+ * 32bit value - 'nextLevel' in the most-significant bits, 'currentLevel'
+ * in the least-significant bits. Since the next level is the most
+ * up to date, this must refer to the current state of indentation.
+ * So the code bitshifts the old current level out of existence to
+ * get at the actual current state of indentation
+ * Based on the LexerCPP.cxx line 958 comment */
+ int currentLevel = SC_FOLDLEVELBASE;
+ if (currentLine > 0)
+ currentLevel = styler.LevelAt(currentLine - 1) >> 16;
+ int nextLevel = currentLevel;
+
+ // Looping for characters in range
+ for (unsigned int i = safeStartPos; i < startPos + length; ++i)
+ {
+ /* Folding occurs after syntax highlighting, meaning Scintilla
+ * already knows where the comments are
+ * Fetching the current state */
+ int state = styler.StyleAt(i) & 31;
+
+ switch( styler.SafeGetCharAt(i) )
+ {
+ case '{':
+
+ /* Indenting only when the braces are not contained in
+ * a comment */
+ if (state != SCE_KVIRC_COMMENT &&
+ state != SCE_KVIRC_COMMENTBLOCK)
+ ++nextLevel;
+ break;
+
+ case '}':
+
+ /* Outdenting only when the braces are not contained in
+ * a comment */
+ if (state != SCE_KVIRC_COMMENT &&
+ state != SCE_KVIRC_COMMENTBLOCK)
+ --nextLevel;
+ break;
+
+ case '\n':
+ case '\r':
+
+ /* Preparing indentation information to return - combining
+ * current and next level data */
+ int lev = currentLevel | nextLevel << 16;
+
+ /* If the next level increases the indent level, mark the
+ * current line as a fold point - current level data is
+ * in the least significant bits */
+ if (nextLevel > currentLevel )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ /* Updating indentation level if needed */
+ if (lev != styler.LevelAt(currentLine))
+ styler.SetLevel(currentLine, lev);
+
+ /* Updating variables */
+ ++currentLine;
+ currentLevel = nextLevel;
+
+ /* Dealing with problematic Windows newlines -
+ * incrementing to avoid the extra newline breaking the
+ * fold point */
+ if (styler.SafeGetCharAt(i) == '\r' &&
+ styler.SafeGetCharAt(i + 1) == '\n')
+ ++i;
+ break;
+ }
+ }
+
+ /* At this point the data has ended, so presumably the end of the line?
+ * Preparing indentation information to return - combining current
+ * and next level data */
+ int lev = currentLevel | nextLevel << 16;
+
+ /* If the next level increases the indent level, mark the current
+ * line as a fold point - current level data is in the least
+ * significant bits */
+ if (nextLevel > currentLevel )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ /* Updating indentation level if needed */
+ if (lev != styler.LevelAt(currentLine))
+ styler.SetLevel(currentLine, lev);
+}
+
+/* Registering wordlists */
+static const char *const kvircWordListDesc[] = {
+ "primary",
+ "function_keywords",
+ 0
+};
+
+
+/* Registering functions and wordlists */
+LexerModule lmKVIrc(SCLEX_KVIRC, ColouriseKVIrcDoc, "kvirc", FoldKVIrcDoc,
+ kvircWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKix.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKix.cxx
new file mode 100644
index 00000000000..dc509e4caa9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexKix.cxx
@@ -0,0 +1,136 @@
+// Scintilla source code edit control
+/** @file LexKix.cxx
+ ** Lexer for KIX-Scripts.
+ **/
+// Copyright 2004 by Manfred Becker <manfred@becker-trdf.de>
+// The License.txt file describes the conditions under which this software may be distributed.
+// Edited by Lee Wilmott (24-Jun-2014) added support for block comments
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Extended to accept accented characters
+static inline bool IsAWordChar(int ch) {
+ return ch >= 0x80 || isalnum(ch) || ch == '_';
+}
+
+static inline bool IsOperator(const int ch) {
+ return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '&' || ch == '|' || ch == '<' || ch == '>' || ch == '=');
+}
+
+static void ColouriseKixDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+// WordList &keywords4 = *keywordlists[3];
+
+ styler.StartAt(startPos);
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.state == SCE_KIX_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_COMMENTSTREAM) {
+ if (sc.ch == '/' && sc.chPrev == '*') {
+ sc.ForwardSetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_STRING1) {
+ // This is a doubles quotes string
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_STRING2) {
+ // This is a single quote string
+ if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_NUMBER) {
+ if (!IsADigit(sc.ch)) {
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_VAR) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_MACRO) {
+ if (!IsAWordChar(sc.ch) && !IsADigit(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (!keywords3.InList(&s[1])) {
+ sc.ChangeState(SCE_KIX_DEFAULT);
+ }
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_OPERATOR) {
+ if (!IsOperator(sc.ch)) {
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ } else if (sc.state == SCE_KIX_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_KIX_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_KIX_FUNCTIONS);
+ }
+ sc.SetState(SCE_KIX_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_KIX_DEFAULT) {
+ if (sc.ch == ';') {
+ sc.SetState(SCE_KIX_COMMENT);
+ } else if (sc.ch == '/' && sc.chNext == '*') {
+ sc.SetState(SCE_KIX_COMMENTSTREAM);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_KIX_STRING1);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_KIX_STRING2);
+ } else if (sc.ch == '$') {
+ sc.SetState(SCE_KIX_VAR);
+ } else if (sc.ch == '@') {
+ sc.SetState(SCE_KIX_MACRO);
+ } else if (IsADigit(sc.ch) || ((sc.ch == '.' || sc.ch == '&') && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_KIX_NUMBER);
+ } else if (IsOperator(sc.ch)) {
+ sc.SetState(SCE_KIX_OPERATOR);
+ } else if (IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_KIX_IDENTIFIER);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+
+LexerModule lmKix(SCLEX_KIX, ColouriseKixDoc, "kix");
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLaTeX.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLaTeX.cxx
new file mode 100644
index 00000000000..f8af1e7dcc9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLaTeX.cxx
@@ -0,0 +1,539 @@
+// Scintilla source code edit control
+/** @file LexLaTeX.cxx
+ ** Lexer for LaTeX2e.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// Modified by G. HU in 2013. Added folding, syntax highting inside math environments, and changed some minor behaviors.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+#include <vector>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+using namespace std;
+
+struct latexFoldSave {
+ latexFoldSave() : structLev(0) {
+ for (int i = 0; i < 8; ++i) openBegins[i] = 0;
+ }
+ latexFoldSave(const latexFoldSave &save) : structLev(save.structLev) {
+ for (int i = 0; i < 8; ++i) openBegins[i] = save.openBegins[i];
+ }
+ int openBegins[8];
+ int structLev;
+};
+
+class LexerLaTeX : public LexerBase {
+private:
+ vector<int> modes;
+ void setMode(int line, int mode) {
+ if (line >= static_cast<int>(modes.size())) modes.resize(line + 1, 0);
+ modes[line] = mode;
+ }
+ int getMode(int line) {
+ if (line >= 0 && line < static_cast<int>(modes.size())) return modes[line];
+ return 0;
+ }
+ void truncModes(int numLines) {
+ if (static_cast<int>(modes.size()) > numLines * 2 + 256)
+ modes.resize(numLines + 128);
+ }
+
+ vector<latexFoldSave> saves;
+ void setSave(int line, const latexFoldSave &save) {
+ if (line >= static_cast<int>(saves.size())) saves.resize(line + 1);
+ saves[line] = save;
+ }
+ void getSave(int line, latexFoldSave &save) {
+ if (line >= 0 && line < static_cast<int>(saves.size())) save = saves[line];
+ else {
+ save.structLev = 0;
+ for (int i = 0; i < 8; ++i) save.openBegins[i] = 0;
+ }
+ }
+ void truncSaves(int numLines) {
+ if (static_cast<int>(saves.size()) > numLines * 2 + 256)
+ saves.resize(numLines + 128);
+ }
+public:
+ static ILexer *LexerFactoryLaTeX() {
+ return new LexerLaTeX();
+ }
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+};
+
+static bool latexIsSpecial(int ch) {
+ return (ch == '#') || (ch == '$') || (ch == '%') || (ch == '&') || (ch == '_') ||
+ (ch == '{') || (ch == '}') || (ch == ' ');
+}
+
+static bool latexIsBlank(int ch) {
+ return (ch == ' ') || (ch == '\t');
+}
+
+static bool latexIsBlankAndNL(int ch) {
+ return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n');
+}
+
+static bool latexIsLetter(int ch) {
+ return IsASCII(ch) && isalpha(ch);
+}
+
+static bool latexIsTagValid(int &i, int l, Accessor &styler) {
+ while (i < l) {
+ if (styler.SafeGetCharAt(i) == '{') {
+ while (i < l) {
+ i++;
+ if (styler.SafeGetCharAt(i) == '}') {
+ return true;
+ } else if (!latexIsLetter(styler.SafeGetCharAt(i)) &&
+ styler.SafeGetCharAt(i)!='*') {
+ return false;
+ }
+ }
+ } else if (!latexIsBlank(styler.SafeGetCharAt(i))) {
+ return false;
+ }
+ i++;
+ }
+ return false;
+}
+
+static bool latexNextNotBlankIs(int i, Accessor &styler, char needle) {
+ char ch;
+ while (i < styler.Length()) {
+ ch = styler.SafeGetCharAt(i);
+ if (!latexIsBlankAndNL(ch) && ch != '*') {
+ if (ch == needle)
+ return true;
+ else
+ return false;
+ }
+ i++;
+ }
+ return false;
+}
+
+static bool latexLastWordIs(int start, Accessor &styler, const char *needle) {
+ unsigned int i = 0;
+ unsigned int l = static_cast<unsigned int>(strlen(needle));
+ int ini = start-l+1;
+ char s[32];
+
+ while (i < l && i < 31) {
+ s[i] = styler.SafeGetCharAt(ini + i);
+ i++;
+ }
+ s[i] = '\0';
+
+ return (strcmp(s, needle) == 0);
+}
+
+static bool latexLastWordIsMathEnv(int pos, Accessor &styler) {
+ int i, j;
+ char s[32];
+ const char *mathEnvs[] = { "align", "alignat", "flalign", "gather",
+ "multiline", "displaymath", "eqnarray", "equation" };
+ if (styler.SafeGetCharAt(pos) != '}') return false;
+ for (i = pos - 1; i >= 0; --i) {
+ if (styler.SafeGetCharAt(i) == '{') break;
+ if (pos - i >= 20) return false;
+ }
+ if (i < 0 || i == pos - 1) return false;
+ ++i;
+ for (j = 0; i + j < pos; ++j)
+ s[j] = styler.SafeGetCharAt(i + j);
+ s[j] = '\0';
+ if (j == 0) return false;
+ if (s[j - 1] == '*') s[--j] = '\0';
+ for (i = 0; i < static_cast<int>(sizeof(mathEnvs) / sizeof(const char *)); ++i)
+ if (strcmp(s, mathEnvs[i]) == 0) return true;
+ return false;
+}
+
+static inline void latexStateReset(int &mode, int &state) {
+ switch (mode) {
+ case 1: state = SCE_L_MATH; break;
+ case 2: state = SCE_L_MATH2; break;
+ default: state = SCE_L_DEFAULT; break;
+ }
+}
+
+// There are cases not handled correctly, like $abcd\textrm{what is $x+y$}z+w$.
+// But I think it's already good enough.
+void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ // startPos is assumed to be the first character of a line
+ Accessor styler(pAccess, &props);
+ styler.StartAt(startPos);
+ int mode = getMode(styler.GetLine(startPos) - 1);
+ int state = initStyle;
+ if (state == SCE_L_ERROR || state == SCE_L_SHORTCMD || state == SCE_L_SPECIAL) // should not happen
+ latexStateReset(mode, state);
+
+ char chNext = styler.SafeGetCharAt(startPos);
+ char chVerbatimDelim = '\0';
+ styler.StartSegment(startPos);
+ int lengthDoc = startPos + length;
+
+ for (int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (styler.IsLeadByte(ch)) {
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ continue;
+ }
+
+ if (ch == '\r' || ch == '\n')
+ setMode(styler.GetLine(i), mode);
+
+ switch (state) {
+ case SCE_L_DEFAULT :
+ switch (ch) {
+ case '\\' :
+ styler.ColourTo(i - 1, state);
+ if (latexIsLetter(chNext)) {
+ state = SCE_L_COMMAND;
+ } else if (latexIsSpecial(chNext)) {
+ styler.ColourTo(i + 1, SCE_L_SPECIAL);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (chNext == '\r' || chNext == '\n') {
+ styler.ColourTo(i, SCE_L_ERROR);
+ } else if (IsASCII(chNext)) {
+ styler.ColourTo(i + 1, SCE_L_SHORTCMD);
+ if (chNext == '(') {
+ mode = 1;
+ state = SCE_L_MATH;
+ } else if (chNext == '[') {
+ mode = 2;
+ state = SCE_L_MATH2;
+ }
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ break;
+ case '$' :
+ styler.ColourTo(i - 1, state);
+ if (chNext == '$') {
+ styler.ColourTo(i + 1, SCE_L_SHORTCMD);
+ mode = 2;
+ state = SCE_L_MATH2;
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ styler.ColourTo(i, SCE_L_SHORTCMD);
+ mode = 1;
+ state = SCE_L_MATH;
+ }
+ break;
+ case '%' :
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMENT;
+ break;
+ }
+ break;
+ // These 3 will never be reached.
+ case SCE_L_ERROR:
+ case SCE_L_SPECIAL:
+ case SCE_L_SHORTCMD:
+ break;
+ case SCE_L_COMMAND :
+ if (!latexIsLetter(chNext)) {
+ styler.ColourTo(i, state);
+ if (latexNextNotBlankIs(i + 1, styler, '[' )) {
+ state = SCE_L_CMDOPT;
+ } else if (latexLastWordIs(i, styler, "\\begin")) {
+ state = SCE_L_TAG;
+ } else if (latexLastWordIs(i, styler, "\\end")) {
+ state = SCE_L_TAG2;
+ } else if (latexLastWordIs(i, styler, "\\verb") && chNext != '*' && chNext != ' ') {
+ chVerbatimDelim = chNext;
+ state = SCE_L_VERBATIM;
+ } else {
+ latexStateReset(mode, state);
+ }
+ }
+ break;
+ case SCE_L_CMDOPT :
+ if (ch == ']') {
+ styler.ColourTo(i, state);
+ latexStateReset(mode, state);
+ }
+ break;
+ case SCE_L_TAG :
+ if (latexIsTagValid(i, lengthDoc, styler)) {
+ styler.ColourTo(i, state);
+ latexStateReset(mode, state);
+ if (latexLastWordIs(i, styler, "{verbatim}")) {
+ state = SCE_L_VERBATIM;
+ } else if (latexLastWordIs(i, styler, "{comment}")) {
+ state = SCE_L_COMMENT2;
+ } else if (latexLastWordIs(i, styler, "{math}") && mode == 0) {
+ mode = 1;
+ state = SCE_L_MATH;
+ } else if (latexLastWordIsMathEnv(i, styler) && mode == 0) {
+ mode = 2;
+ state = SCE_L_MATH2;
+ }
+ } else {
+ styler.ColourTo(i, SCE_L_ERROR);
+ latexStateReset(mode, state);
+ ch = styler.SafeGetCharAt(i);
+ if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode);
+ }
+ chNext = styler.SafeGetCharAt(i+1);
+ break;
+ case SCE_L_TAG2 :
+ if (latexIsTagValid(i, lengthDoc, styler)) {
+ styler.ColourTo(i, state);
+ latexStateReset(mode, state);
+ } else {
+ styler.ColourTo(i, SCE_L_ERROR);
+ latexStateReset(mode, state);
+ ch = styler.SafeGetCharAt(i);
+ if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode);
+ }
+ chNext = styler.SafeGetCharAt(i+1);
+ break;
+ case SCE_L_MATH :
+ switch (ch) {
+ case '\\' :
+ styler.ColourTo(i - 1, state);
+ if (latexIsLetter(chNext)) {
+ int match = i + 3;
+ if (latexLastWordIs(match, styler, "\\end")) {
+ match++;
+ if (latexIsTagValid(match, lengthDoc, styler)) {
+ if (latexLastWordIs(match, styler, "{math}"))
+ mode = 0;
+ }
+ }
+ state = SCE_L_COMMAND;
+ } else if (latexIsSpecial(chNext)) {
+ styler.ColourTo(i + 1, SCE_L_SPECIAL);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (chNext == '\r' || chNext == '\n') {
+ styler.ColourTo(i, SCE_L_ERROR);
+ } else if (IsASCII(chNext)) {
+ if (chNext == ')') {
+ mode = 0;
+ state = SCE_L_DEFAULT;
+ }
+ styler.ColourTo(i + 1, SCE_L_SHORTCMD);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ break;
+ case '$' :
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_L_SHORTCMD);
+ mode = 0;
+ state = SCE_L_DEFAULT;
+ break;
+ case '%' :
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMENT;
+ break;
+ }
+ break;
+ case SCE_L_MATH2 :
+ switch (ch) {
+ case '\\' :
+ styler.ColourTo(i - 1, state);
+ if (latexIsLetter(chNext)) {
+ int match = i + 3;
+ if (latexLastWordIs(match, styler, "\\end")) {
+ match++;
+ if (latexIsTagValid(match, lengthDoc, styler)) {
+ if (latexLastWordIsMathEnv(match, styler))
+ mode = 0;
+ }
+ }
+ state = SCE_L_COMMAND;
+ } else if (latexIsSpecial(chNext)) {
+ styler.ColourTo(i + 1, SCE_L_SPECIAL);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (chNext == '\r' || chNext == '\n') {
+ styler.ColourTo(i, SCE_L_ERROR);
+ } else if (IsASCII(chNext)) {
+ if (chNext == ']') {
+ mode = 0;
+ state = SCE_L_DEFAULT;
+ }
+ styler.ColourTo(i + 1, SCE_L_SHORTCMD);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ break;
+ case '$' :
+ styler.ColourTo(i - 1, state);
+ if (chNext == '$') {
+ styler.ColourTo(i + 1, SCE_L_SHORTCMD);
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ mode = 0;
+ state = SCE_L_DEFAULT;
+ } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation}
+ styler.ColourTo(i, SCE_L_SHORTCMD);
+ }
+ break;
+ case '%' :
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMENT;
+ break;
+ }
+ break;
+ case SCE_L_COMMENT :
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, state);
+ latexStateReset(mode, state);
+ }
+ break;
+ case SCE_L_COMMENT2 :
+ if (ch == '\\') {
+ int match = i + 3;
+ if (latexLastWordIs(match, styler, "\\end")) {
+ match++;
+ if (latexIsTagValid(match, lengthDoc, styler)) {
+ if (latexLastWordIs(match, styler, "{comment}")) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMAND;
+ }
+ }
+ }
+ }
+ break;
+ case SCE_L_VERBATIM :
+ if (ch == '\\') {
+ int match = i + 3;
+ if (latexLastWordIs(match, styler, "\\end")) {
+ match++;
+ if (latexIsTagValid(match, lengthDoc, styler)) {
+ if (latexLastWordIs(match, styler, "{verbatim}")) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMAND;
+ }
+ }
+ }
+ } else if (chNext == chVerbatimDelim) {
+ styler.ColourTo(i + 1, state);
+ latexStateReset(mode, state);
+ chVerbatimDelim = '\0';
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (chVerbatimDelim != '\0' && (ch == '\n' || ch == '\r')) {
+ styler.ColourTo(i, SCE_L_ERROR);
+ latexStateReset(mode, state);
+ chVerbatimDelim = '\0';
+ }
+ break;
+ }
+ }
+ if (lengthDoc == styler.Length()) truncModes(styler.GetLine(lengthDoc - 1));
+ styler.ColourTo(lengthDoc - 1, state);
+ styler.Flush();
+}
+
+static int latexFoldSaveToInt(const latexFoldSave &save) {
+ int sum = 0;
+ for (int i = 0; i <= save.structLev; ++i)
+ sum += save.openBegins[i];
+ return ((sum + save.structLev + SC_FOLDLEVELBASE) & SC_FOLDLEVELNUMBERMASK);
+}
+
+// Change folding state while processing a line
+// Return the level before the first relevant command
+void SCI_METHOD LexerLaTeX::Fold(unsigned int startPos, int length, int, IDocument *pAccess) {
+ const char *structWords[7] = {"part", "chapter", "section", "subsection",
+ "subsubsection", "paragraph", "subparagraph"};
+ Accessor styler(pAccess, &props);
+ unsigned int endPos = startPos + length;
+ int curLine = styler.GetLine(startPos);
+ latexFoldSave save;
+ getSave(curLine - 1, save);
+ do {
+ char ch, buf[16];
+ int i, j, lev = -1;
+ bool needFold = false;
+ for (i = static_cast<int>(startPos); i < static_cast<int>(endPos); ++i) {
+ ch = styler.SafeGetCharAt(i);
+ if (ch == '\r' || ch == '\n') break;
+ if (ch != '\\' || styler.StyleAt(i) != SCE_L_COMMAND) continue;
+ for (j = 0; j < 15 && i + 1 < static_cast<int>(endPos); ++j, ++i) {
+ buf[j] = styler.SafeGetCharAt(i + 1);
+ if (!latexIsLetter(buf[j])) break;
+ }
+ buf[j] = '\0';
+ if (strcmp(buf, "begin") == 0) {
+ if (lev < 0) lev = latexFoldSaveToInt(save);
+ ++save.openBegins[save.structLev];
+ needFold = true;
+ }
+ else if (strcmp(buf, "end") == 0) {
+ while (save.structLev > 0 && save.openBegins[save.structLev] == 0)
+ --save.structLev;
+ if (lev < 0) lev = latexFoldSaveToInt(save);
+ if (save.openBegins[save.structLev] > 0) --save.openBegins[save.structLev];
+ }
+ else {
+ for (j = 0; j < 7; ++j)
+ if (strcmp(buf, structWords[j]) == 0) break;
+ if (j >= 7) continue;
+ save.structLev = j; // level before the command
+ for (j = save.structLev + 1; j < 8; ++j) {
+ save.openBegins[save.structLev] += save.openBegins[j];
+ save.openBegins[j] = 0;
+ }
+ if (lev < 0) lev = latexFoldSaveToInt(save);
+ ++save.structLev; // level after the command
+ needFold = true;
+ }
+ }
+ if (lev < 0) lev = latexFoldSaveToInt(save);
+ if (needFold) lev |= SC_FOLDLEVELHEADERFLAG;
+ styler.SetLevel(curLine, lev);
+ setSave(curLine, save);
+ ++curLine;
+ startPos = styler.LineStart(curLine);
+ if (static_cast<int>(startPos) == styler.Length()) {
+ lev = latexFoldSaveToInt(save);
+ styler.SetLevel(curLine, lev);
+ setSave(curLine, save);
+ truncSaves(curLine);
+ }
+ } while (startPos < endPos);
+ styler.Flush();
+}
+
+static const char *const emptyWordListDesc[] = {
+ 0
+};
+
+LexerModule lmLatex(SCLEX_LATEX, LexerLaTeX::LexerFactoryLaTeX, "latex", emptyWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLisp.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLisp.cxx
new file mode 100644
index 00000000000..8dd6bd9c435
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLisp.cxx
@@ -0,0 +1,285 @@
+// Scintilla source code edit control
+/** @file LexLisp.cxx
+ ** Lexer for Lisp.
+ ** Written by Alexey Yutkin.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define SCE_LISP_CHARACTER 29
+#define SCE_LISP_MACRO 30
+#define SCE_LISP_MACRO_DISPATCH 31
+
+static inline bool isLispoperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}')
+ return true;
+ return false;
+}
+
+static inline bool isLispwordstart(char ch) {
+ return IsASCII(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
+ ch != '\n' && ch != '\r' && ch != '\"';
+}
+
+
+static void classifyWordLisp(unsigned int start, unsigned int end, WordList &keywords, WordList &keywords_kw, Accessor &styler) {
+ assert(end >= start);
+ char s[100];
+ unsigned int i;
+ bool digit_flag = true;
+ for (i = 0; (i < end - start + 1) && (i < 99); i++) {
+ s[i] = styler[start + i];
+ s[i + 1] = '\0';
+ if (!isdigit(s[i]) && (s[i] != '.')) digit_flag = false;
+ }
+ char chAttr = SCE_LISP_IDENTIFIER;
+
+ if(digit_flag) chAttr = SCE_LISP_NUMBER;
+ else {
+ if (keywords.InList(s)) {
+ chAttr = SCE_LISP_KEYWORD;
+ } else if (keywords_kw.InList(s)) {
+ chAttr = SCE_LISP_KEYWORD_KW;
+ } else if ((s[0] == '*' && s[i-1] == '*') ||
+ (s[0] == '+' && s[i-1] == '+')) {
+ chAttr = SCE_LISP_SPECIAL;
+ }
+ }
+ styler.ColourTo(end, chAttr);
+ return;
+}
+
+
+static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords_kw = *keywordlists[1];
+
+ styler.StartAt(startPos);
+
+ int state = initStyle, radix = -1;
+ char chNext = styler[startPos];
+ unsigned int lengthDoc = startPos + length;
+ styler.StartSegment(startPos);
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_LISP_DEFAULT) {
+ if (ch == '#') {
+ styler.ColourTo(i - 1, state);
+ radix = -1;
+ state = SCE_LISP_MACRO_DISPATCH;
+ } else if (ch == ':' && isLispwordstart(chNext)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_SYMBOL;
+ } else if (isLispwordstart(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_IDENTIFIER;
+ }
+ else if (ch == ';') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_COMMENT;
+ }
+ else if (isLispoperator(ch) || ch=='\'') {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_LISP_OPERATOR);
+ if (ch=='\'' && isLispwordstart(chNext)) {
+ state = SCE_LISP_SYMBOL;
+ }
+ }
+ else if (ch == '\"') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_STRING;
+ }
+ } else if (state == SCE_LISP_IDENTIFIER || state == SCE_LISP_SYMBOL) {
+ if (!isLispwordstart(ch)) {
+ if (state == SCE_LISP_IDENTIFIER) {
+ classifyWordLisp(styler.GetStartSegment(), i - 1, keywords, keywords_kw, styler);
+ } else {
+ styler.ColourTo(i - 1, state);
+ }
+ state = SCE_LISP_DEFAULT;
+ } /*else*/
+ if (isLispoperator(ch) || ch=='\'') {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_LISP_OPERATOR);
+ if (ch=='\'' && isLispwordstart(chNext)) {
+ state = SCE_LISP_SYMBOL;
+ }
+ }
+ } else if (state == SCE_LISP_MACRO_DISPATCH) {
+ if (!(IsASCII(ch) && isdigit(ch))) {
+ if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) {
+ state = SCE_LISP_DEFAULT;
+ } else {
+ switch (ch) {
+ case '|': state = SCE_LISP_MULTI_COMMENT; break;
+ case 'o':
+ case 'O': radix = 8; state = SCE_LISP_MACRO; break;
+ case 'x':
+ case 'X': radix = 16; state = SCE_LISP_MACRO; break;
+ case 'b':
+ case 'B': radix = 2; state = SCE_LISP_MACRO; break;
+ case '\\': state = SCE_LISP_CHARACTER; break;
+ case ':':
+ case '-':
+ case '+': state = SCE_LISP_MACRO; break;
+ case '\'': if (isLispwordstart(chNext)) {
+ state = SCE_LISP_SPECIAL;
+ } else {
+ styler.ColourTo(i - 1, SCE_LISP_DEFAULT);
+ styler.ColourTo(i, SCE_LISP_OPERATOR);
+ state = SCE_LISP_DEFAULT;
+ }
+ break;
+ default: if (isLispoperator(ch)) {
+ styler.ColourTo(i - 1, SCE_LISP_DEFAULT);
+ styler.ColourTo(i, SCE_LISP_OPERATOR);
+ }
+ state = SCE_LISP_DEFAULT;
+ break;
+ }
+ }
+ }
+ } else if (state == SCE_LISP_MACRO) {
+ if (isLispwordstart(ch) && (radix == -1 || IsADigit(ch, radix))) {
+ state = SCE_LISP_SPECIAL;
+ } else {
+ state = SCE_LISP_DEFAULT;
+ }
+ } else if (state == SCE_LISP_CHARACTER) {
+ if (isLispoperator(ch)) {
+ styler.ColourTo(i, SCE_LISP_SPECIAL);
+ state = SCE_LISP_DEFAULT;
+ } else if (isLispwordstart(ch)) {
+ styler.ColourTo(i, SCE_LISP_SPECIAL);
+ state = SCE_LISP_SPECIAL;
+ } else {
+ state = SCE_LISP_DEFAULT;
+ }
+ } else if (state == SCE_LISP_SPECIAL) {
+ if (!isLispwordstart(ch) || (radix != -1 && !IsADigit(ch, radix))) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_DEFAULT;
+ }
+ if (isLispoperator(ch) || ch=='\'') {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_LISP_OPERATOR);
+ if (ch=='\'' && isLispwordstart(chNext)) {
+ state = SCE_LISP_SYMBOL;
+ }
+ }
+ } else {
+ if (state == SCE_LISP_COMMENT) {
+ if (atEOL) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_LISP_DEFAULT;
+ }
+ } else if (state == SCE_LISP_MULTI_COMMENT) {
+ if (ch == '|' && chNext == '#') {
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ styler.ColourTo(i, state);
+ state = SCE_LISP_DEFAULT;
+ }
+ } else if (state == SCE_LISP_STRING) {
+ if (ch == '\\') {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
+ i++;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ } else if (ch == '\"') {
+ styler.ColourTo(i, state);
+ state = SCE_LISP_DEFAULT;
+ }
+ }
+ }
+
+ }
+ styler.ColourTo(lengthDoc - 1, state);
+}
+
+static void FoldLispDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_LISP_OPERATOR) {
+ if (ch == '(' || ch == '[' || ch == '{') {
+ levelCurrent++;
+ } else if (ch == ')' || ch == ']' || ch == '}') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const lispWordListDesc[] = {
+ "Functions and special operators",
+ "Keywords",
+ 0
+};
+
+LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLout.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLout.cxx
new file mode 100644
index 00000000000..83eb97ec891
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLout.cxx
@@ -0,0 +1,215 @@
+// Scintilla source code edit control
+/** @file LexLout.cxx
+ ** Lexer for the Basser Lout (>= version 3) typesetting language
+ **/
+// Copyright 2003 by Kein-Hong Man <mkh@pl.jaring.my>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalpha(ch) || ch == '@' || ch == '_');
+}
+
+static inline bool IsAnOther(const int ch) {
+ return (ch < 0x80) && (ch == '{' || ch == '}' ||
+ ch == '!' || ch == '$' || ch == '%' || ch == '&' || ch == '\'' ||
+ ch == '(' || ch == ')' || ch == '*' || ch == '+' || ch == ',' ||
+ ch == '-' || ch == '.' || ch == '/' || ch == ':' || ch == ';' ||
+ ch == '<' || ch == '=' || ch == '>' || ch == '?' || ch == '[' ||
+ ch == ']' || ch == '^' || ch == '`' || ch == '|' || ch == '~');
+}
+
+static void ColouriseLoutDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+
+ int visibleChars = 0;
+ int firstWordInLine = 0;
+ int leadingAtSign = 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart && (sc.state == SCE_LOUT_STRING)) {
+ // Prevent SCE_LOUT_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_LOUT_STRING);
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_LOUT_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_LOUT_DEFAULT);
+ visibleChars = 0;
+ }
+ } else if (sc.state == SCE_LOUT_NUMBER) {
+ if (!IsADigit(sc.ch) && sc.ch != '.') {
+ sc.SetState(SCE_LOUT_DEFAULT);
+ }
+ } else if (sc.state == SCE_LOUT_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_LOUT_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_LOUT_STRINGEOL);
+ sc.ForwardSetState(SCE_LOUT_DEFAULT);
+ visibleChars = 0;
+ }
+ } else if (sc.state == SCE_LOUT_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+
+ if (leadingAtSign) {
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_LOUT_WORD);
+ } else {
+ sc.ChangeState(SCE_LOUT_WORD4);
+ }
+ } else if (firstWordInLine && keywords3.InList(s)) {
+ sc.ChangeState(SCE_LOUT_WORD3);
+ }
+ sc.SetState(SCE_LOUT_DEFAULT);
+ }
+ } else if (sc.state == SCE_LOUT_OPERATOR) {
+ if (!IsAnOther(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+
+ if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_LOUT_WORD2);
+ }
+ sc.SetState(SCE_LOUT_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_LOUT_DEFAULT) {
+ if (sc.ch == '#') {
+ sc.SetState(SCE_LOUT_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_LOUT_STRING);
+ } else if (IsADigit(sc.ch) ||
+ (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_LOUT_NUMBER);
+ } else if (IsAWordChar(sc.ch)) {
+ firstWordInLine = (visibleChars == 0);
+ leadingAtSign = (sc.ch == '@');
+ sc.SetState(SCE_LOUT_IDENTIFIER);
+ } else if (IsAnOther(sc.ch)) {
+ sc.SetState(SCE_LOUT_OPERATOR);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ // Reset states to begining of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ }
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldLoutDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ int styleNext = styler.StyleAt(startPos);
+ char s[10] = "";
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (style == SCE_LOUT_WORD) {
+ if (ch == '@') {
+ for (unsigned int j = 0; j < 8; j++) {
+ if (!IsAWordChar(styler[i + j])) {
+ break;
+ }
+ s[j] = styler[i + j];
+ s[j + 1] = '\0';
+ }
+ if (strcmp(s, "@Begin") == 0) {
+ levelCurrent++;
+ } else if (strcmp(s, "@End") == 0) {
+ levelCurrent--;
+ }
+ }
+ } else if (style == SCE_LOUT_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact) {
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ }
+ if ((levelCurrent > levelPrev) && (visibleChars > 0)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const loutWordLists[] = {
+ "Predefined identifiers",
+ "Predefined delimiters",
+ "Predefined keywords",
+ 0,
+ };
+
+LexerModule lmLout(SCLEX_LOUT, ColouriseLoutDoc, "lout", FoldLoutDoc, loutWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLua.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLua.cxx
new file mode 100644
index 00000000000..fd0d70fd4d9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexLua.cxx
@@ -0,0 +1,436 @@
+// Scintilla source code edit control
+/** @file LexLua.cxx
+ ** Lexer for Lua language.
+ **
+ ** Written by Paul Winwood.
+ ** Folder by Alexey Yutkin.
+ ** Modified by Marcos E. Wurzius & Philippe Lhoste
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Test for [=[ ... ]=] delimiters, returns 0 if it's only a [ or ],
+// return 1 for [[ or ]], returns >=2 for [=[ or ]=] and so on.
+// The maximum number of '=' characters allowed is 254.
+static int LongDelimCheck(StyleContext &sc) {
+ int sep = 1;
+ while (sc.GetRelative(sep) == '=' && sep < 0xFF)
+ sep++;
+ if (sc.GetRelative(sep) == sc.ch)
+ return sep;
+ return 0;
+}
+
+static void ColouriseLuaDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+ WordList &keywords7 = *keywordlists[6];
+ WordList &keywords8 = *keywordlists[7];
+
+ // Accepts accented characters
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases. [pP] is for hex floats.
+ CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP");
+ CharacterSet setExponent(CharacterSet::setNone, "eEpP");
+ CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#");
+ CharacterSet setEscapeSkip(CharacterSet::setNone, "\"'\\");
+
+ int currentLine = styler.GetLine(startPos);
+ // Initialize long string [[ ... ]] or block comment --[[ ... ]] nesting level,
+ // if we are inside such a string. Block comment was introduced in Lua 5.0,
+ // blocks with separators [=[ ... ]=] in Lua 5.1.
+ // Continuation of a string (\z whitespace escaping) is controlled by stringWs.
+ int nestLevel = 0;
+ int sepCount = 0;
+ int stringWs = 0;
+ if (initStyle == SCE_LUA_LITERALSTRING || initStyle == SCE_LUA_COMMENT ||
+ initStyle == SCE_LUA_STRING || initStyle == SCE_LUA_CHARACTER) {
+ int lineState = styler.GetLineState(currentLine - 1);
+ nestLevel = lineState >> 9;
+ sepCount = lineState & 0xFF;
+ stringWs = lineState & 0x100;
+ }
+
+ // Do not leak onto next line
+ if (initStyle == SCE_LUA_STRINGEOL || initStyle == SCE_LUA_COMMENTLINE || initStyle == SCE_LUA_PREPROCESSOR) {
+ initStyle = SCE_LUA_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ if (startPos == 0 && sc.ch == '#') {
+ // shbang line: # is a comment only if first char of the script
+ sc.SetState(SCE_LUA_COMMENTLINE);
+ }
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ currentLine = styler.GetLine(sc.currentPos);
+ switch (sc.state) {
+ case SCE_LUA_LITERALSTRING:
+ case SCE_LUA_COMMENT:
+ case SCE_LUA_STRING:
+ case SCE_LUA_CHARACTER:
+ // Inside a literal string, block comment or string, we set the line state
+ styler.SetLineState(currentLine, (nestLevel << 9) | stringWs | sepCount);
+ break;
+ default:
+ // Reset the line state
+ styler.SetLineState(currentLine, 0);
+ break;
+ }
+ }
+ if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) {
+ // Prevent SCE_LUA_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_LUA_STRING);
+ }
+
+ // Handle string line continuation
+ if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) &&
+ sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_LUA_OPERATOR) {
+ if (sc.ch == ':' && sc.chPrev == ':') { // :: <label> :: forward scan
+ sc.Forward();
+ int ln = 0;
+ while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
+ ln++;
+ int ws1 = ln;
+ if (setWordStart.Contains(sc.GetRelative(ln))) {
+ int c, i = 0;
+ char s[100];
+ while (setWord.Contains(c = sc.GetRelative(ln))) { // get potential label
+ if (i < 90)
+ s[i++] = static_cast<char>(c);
+ ln++;
+ }
+ s[i] = '\0'; int lbl = ln;
+ if (!keywords.InList(s)) {
+ while (IsASpaceOrTab(sc.GetRelative(ln))) // skip over spaces/tabs
+ ln++;
+ int ws2 = ln - lbl;
+ if (sc.GetRelative(ln) == ':' && sc.GetRelative(ln + 1) == ':') {
+ // final :: found, complete valid label construct
+ sc.ChangeState(SCE_LUA_LABEL);
+ if (ws1) {
+ sc.SetState(SCE_LUA_DEFAULT);
+ sc.ForwardBytes(ws1);
+ }
+ sc.SetState(SCE_LUA_LABEL);
+ sc.ForwardBytes(lbl - ws1);
+ if (ws2) {
+ sc.SetState(SCE_LUA_DEFAULT);
+ sc.ForwardBytes(ws2);
+ }
+ sc.SetState(SCE_LUA_LABEL);
+ sc.ForwardBytes(2);
+ }
+ }
+ }
+ }
+ sc.SetState(SCE_LUA_DEFAULT);
+ } else if (sc.state == SCE_LUA_NUMBER) {
+ // We stop the number definition on non-numerical non-dot non-eEpP non-sign non-hexdigit char
+ if (!setNumber.Contains(sc.ch)) {
+ sc.SetState(SCE_LUA_DEFAULT);
+ } else if (sc.ch == '-' || sc.ch == '+') {
+ if (!setExponent.Contains(sc.chPrev))
+ sc.SetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sc.state == SCE_LUA_IDENTIFIER) {
+ if (!(setWord.Contains(sc.ch) || sc.ch == '.') || sc.Match('.', '.')) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD);
+ if (strcmp(s, "goto") == 0) { // goto <label> forward scan
+ sc.SetState(SCE_LUA_DEFAULT);
+ while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd)
+ sc.Forward();
+ if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_LUA_LABEL);
+ sc.Forward();
+ while (setWord.Contains(sc.ch))
+ sc.Forward();
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s))
+ sc.ChangeState(SCE_LUA_WORD);
+ }
+ sc.SetState(SCE_LUA_DEFAULT);
+ }
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD4);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD5);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD6);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD7);
+ } else if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD8);
+ }
+ sc.SetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sc.state == SCE_LUA_COMMENTLINE || sc.state == SCE_LUA_PREPROCESSOR) {
+ if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sc.state == SCE_LUA_STRING) {
+ if (stringWs) {
+ if (!IsASpace(sc.ch))
+ stringWs = 0;
+ }
+ if (sc.ch == '\\') {
+ if (setEscapeSkip.Contains(sc.chNext)) {
+ sc.Forward();
+ } else if (sc.chNext == 'z') {
+ sc.Forward();
+ stringWs = 0x100;
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ } else if (stringWs == 0 && sc.atLineEnd) {
+ sc.ChangeState(SCE_LUA_STRINGEOL);
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sc.state == SCE_LUA_CHARACTER) {
+ if (stringWs) {
+ if (!IsASpace(sc.ch))
+ stringWs = 0;
+ }
+ if (sc.ch == '\\') {
+ if (setEscapeSkip.Contains(sc.chNext)) {
+ sc.Forward();
+ } else if (sc.chNext == 'z') {
+ sc.Forward();
+ stringWs = 0x100;
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ } else if (stringWs == 0 && sc.atLineEnd) {
+ sc.ChangeState(SCE_LUA_STRINGEOL);
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sc.state == SCE_LUA_LITERALSTRING || sc.state == SCE_LUA_COMMENT) {
+ if (sc.ch == '[') {
+ int sep = LongDelimCheck(sc);
+ if (sep == 1 && sepCount == 1) { // [[-only allowed to nest
+ nestLevel++;
+ sc.Forward();
+ }
+ } else if (sc.ch == ']') {
+ int sep = LongDelimCheck(sc);
+ if (sep == 1 && sepCount == 1) { // un-nest with ]]-only
+ nestLevel--;
+ sc.Forward();
+ if (nestLevel == 0) {
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ }
+ } else if (sep > 1 && sep == sepCount) { // ]=]-style delim
+ sc.Forward(sep);
+ sc.ForwardSetState(SCE_LUA_DEFAULT);
+ }
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_LUA_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_LUA_NUMBER);
+ if (sc.ch == '0' && toupper(sc.chNext) == 'X') {
+ sc.Forward();
+ }
+ } else if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_LUA_IDENTIFIER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_LUA_STRING);
+ stringWs = 0;
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_LUA_CHARACTER);
+ stringWs = 0;
+ } else if (sc.ch == '[') {
+ sepCount = LongDelimCheck(sc);
+ if (sepCount == 0) {
+ sc.SetState(SCE_LUA_OPERATOR);
+ } else {
+ nestLevel = 1;
+ sc.SetState(SCE_LUA_LITERALSTRING);
+ sc.Forward(sepCount);
+ }
+ } else if (sc.Match('-', '-')) {
+ sc.SetState(SCE_LUA_COMMENTLINE);
+ if (sc.Match("--[")) {
+ sc.Forward(2);
+ sepCount = LongDelimCheck(sc);
+ if (sepCount > 0) {
+ nestLevel = 1;
+ sc.ChangeState(SCE_LUA_COMMENT);
+ sc.Forward(sepCount);
+ }
+ } else {
+ sc.Forward();
+ }
+ } else if (sc.atLineStart && sc.Match('$')) {
+ sc.SetState(SCE_LUA_PREPROCESSOR); // Obsolete since Lua 4.0, but still in old code
+ } else if (setLuaOperator.Contains(sc.ch)) {
+ sc.SetState(SCE_LUA_OPERATOR);
+ }
+ }
+ }
+
+ if (setWord.Contains(sc.chPrev) || sc.chPrev == '.') {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD4);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD5);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD6);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD7);
+ } else if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_LUA_WORD8);
+ }
+ }
+
+ sc.Complete();
+}
+
+static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ int styleNext = styler.StyleAt(startPos);
+
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_LUA_WORD) {
+ if (ch == 'i' || ch == 'd' || ch == 'f' || ch == 'e' || ch == 'r' || ch == 'u') {
+ char s[10] = "";
+ for (unsigned int j = 0; j < 8; j++) {
+ if (!iswordchar(styler[i + j])) {
+ break;
+ }
+ s[j] = styler[i + j];
+ s[j + 1] = '\0';
+ }
+
+ if ((strcmp(s, "if") == 0) || (strcmp(s, "do") == 0) || (strcmp(s, "function") == 0) || (strcmp(s, "repeat") == 0)) {
+ levelCurrent++;
+ }
+ if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0) || (strcmp(s, "until") == 0)) {
+ levelCurrent--;
+ }
+ }
+ } else if (style == SCE_LUA_OPERATOR) {
+ if (ch == '{' || ch == '(') {
+ levelCurrent++;
+ } else if (ch == '}' || ch == ')') {
+ levelCurrent--;
+ }
+ } else if (style == SCE_LUA_LITERALSTRING || style == SCE_LUA_COMMENT) {
+ if (ch == '[') {
+ levelCurrent++;
+ } else if (ch == ']') {
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact) {
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ }
+ if ((levelCurrent > levelPrev) && (visibleChars > 0)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch)) {
+ visibleChars++;
+ }
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const luaWordListDesc[] = {
+ "Keywords",
+ "Basic functions",
+ "String, (table) & math functions",
+ "(coroutines), I/O & system facilities",
+ "user1",
+ "user2",
+ "user3",
+ "user4",
+ 0
+};
+
+LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc, "lua", FoldLuaDoc, luaWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMMIXAL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMMIXAL.cxx
new file mode 100644
index 00000000000..a766d5aadec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMMIXAL.cxx
@@ -0,0 +1,189 @@
+// Scintilla source code edit control
+/** @file LexMMIXAL.cxx
+ ** Lexer for MMIX Assembler Language.
+ ** Written by Christoph Hösler <christoph.hoesler@student.uni-tuebingen.de>
+ ** For information about MMIX visit http://www-cs-faculty.stanford.edu/~knuth/mmix.html
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == ':' || ch == '_');
+}
+
+inline bool isMMIXALOperator(char ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ if (ch == '+' || ch == '-' || ch == '|' || ch == '^' ||
+ ch == '*' || ch == '/' ||
+ ch == '%' || ch == '<' || ch == '>' || ch == '&' ||
+ ch == '~' || ch == '$' ||
+ ch == ',' || ch == '(' || ch == ')' ||
+ ch == '[' || ch == ']')
+ return true;
+ return false;
+}
+
+static void ColouriseMMIXALDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &opcodes = *keywordlists[0];
+ WordList &special_register = *keywordlists[1];
+ WordList &predef_symbols = *keywordlists[2];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward())
+ {
+ // No EOL continuation
+ if (sc.atLineStart) {
+ if (sc.ch == '@' && sc.chNext == 'i') {
+ sc.SetState(SCE_MMIXAL_INCLUDE);
+ } else {
+ sc.SetState(SCE_MMIXAL_LEADWS);
+ }
+ }
+
+ // Check if first non whitespace character in line is alphanumeric
+ if (sc.state == SCE_MMIXAL_LEADWS && !isspace(sc.ch)) { // LEADWS
+ if(!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_MMIXAL_COMMENT);
+ } else {
+ if(sc.atLineStart) {
+ sc.SetState(SCE_MMIXAL_LABEL);
+ } else {
+ sc.SetState(SCE_MMIXAL_OPCODE_PRE);
+ }
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_MMIXAL_OPERATOR) { // OPERATOR
+ sc.SetState(SCE_MMIXAL_OPERANDS);
+ } else if (sc.state == SCE_MMIXAL_NUMBER) { // NUMBER
+ if (!isdigit(sc.ch)) {
+ if (IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ sc.ChangeState(SCE_MMIXAL_REF);
+ sc.SetState(SCE_MMIXAL_REF);
+ } else {
+ sc.SetState(SCE_MMIXAL_OPERANDS);
+ }
+ }
+ } else if (sc.state == SCE_MMIXAL_LABEL) { // LABEL
+ if (!IsAWordChar(sc.ch) ) {
+ sc.SetState(SCE_MMIXAL_OPCODE_PRE);
+ }
+ } else if (sc.state == SCE_MMIXAL_REF) { // REF
+ if (!IsAWordChar(sc.ch) ) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (*s == ':') { // ignore base prefix for match
+ for (size_t i = 0; i != sizeof(s); ++i) {
+ *(s+i) = *(s+i+1);
+ }
+ }
+ if (special_register.InList(s)) {
+ sc.ChangeState(SCE_MMIXAL_REGISTER);
+ } else if (predef_symbols.InList(s)) {
+ sc.ChangeState(SCE_MMIXAL_SYMBOL);
+ }
+ sc.SetState(SCE_MMIXAL_OPERANDS);
+ }
+ } else if (sc.state == SCE_MMIXAL_OPCODE_PRE) { // OPCODE_PRE
+ if (!isspace(sc.ch)) {
+ sc.SetState(SCE_MMIXAL_OPCODE);
+ }
+ } else if (sc.state == SCE_MMIXAL_OPCODE) { // OPCODE
+ if (!IsAWordChar(sc.ch) ) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (opcodes.InList(s)) {
+ sc.ChangeState(SCE_MMIXAL_OPCODE_VALID);
+ } else {
+ sc.ChangeState(SCE_MMIXAL_OPCODE_UNKNOWN);
+ }
+ sc.SetState(SCE_MMIXAL_OPCODE_POST);
+ }
+ } else if (sc.state == SCE_MMIXAL_STRING) { // STRING
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_MMIXAL_OPERANDS);
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_MMIXAL_OPERANDS);
+ }
+ } else if (sc.state == SCE_MMIXAL_CHAR) { // CHAR
+ if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_MMIXAL_OPERANDS);
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_MMIXAL_OPERANDS);
+ }
+ } else if (sc.state == SCE_MMIXAL_REGISTER) { // REGISTER
+ if (!isdigit(sc.ch)) {
+ sc.SetState(SCE_MMIXAL_OPERANDS);
+ }
+ } else if (sc.state == SCE_MMIXAL_HEX) { // HEX
+ if (!isxdigit(sc.ch)) {
+ sc.SetState(SCE_MMIXAL_OPERANDS);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_MMIXAL_OPCODE_POST || // OPCODE_POST
+ sc.state == SCE_MMIXAL_OPERANDS) { // OPERANDS
+ if (sc.state == SCE_MMIXAL_OPERANDS && isspace(sc.ch)) {
+ if (!sc.atLineEnd) {
+ sc.SetState(SCE_MMIXAL_COMMENT);
+ }
+ } else if (isdigit(sc.ch)) {
+ sc.SetState(SCE_MMIXAL_NUMBER);
+ } else if (IsAWordChar(sc.ch) || sc.Match('@')) {
+ sc.SetState(SCE_MMIXAL_REF);
+ } else if (sc.Match('\"')) {
+ sc.SetState(SCE_MMIXAL_STRING);
+ } else if (sc.Match('\'')) {
+ sc.SetState(SCE_MMIXAL_CHAR);
+ } else if (sc.Match('$')) {
+ sc.SetState(SCE_MMIXAL_REGISTER);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_MMIXAL_HEX);
+ } else if (isMMIXALOperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_MMIXAL_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static const char * const MMIXALWordListDesc[] = {
+ "Operation Codes",
+ "Special Register",
+ "Predefined Symbols",
+ 0
+};
+
+LexerModule lmMMIXAL(SCLEX_MMIXAL, ColouriseMMIXALDoc, "mmixal", 0, MMIXALWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMPT.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMPT.cxx
new file mode 100644
index 00000000000..f3443e1ecab
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMPT.cxx
@@ -0,0 +1,193 @@
+// Scintilla source code edit control
+/** @file LexMPT.cxx
+ ** Lexer for MPT specific files. Based on LexOthers.cxx
+ ** LOT = the text log file created by the MPT application while running a test program
+ ** Other MPT specific files to be added later.
+ **/
+// Copyright 2003 by Marius Gheorghe <mgheorghe@cabletest.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static int GetLotLineState(std::string &line) {
+ if (line.length()) {
+ // Most of the time the first non-blank character in line determines that line's type
+ // Now finds the first non-blank character
+ unsigned i; // Declares counter here to make it persistent after the for loop
+ for (i = 0; i < line.length(); ++i) {
+ if (!(IsASCII(line[i]) && isspace(line[i])))
+ break;
+ }
+
+ // Checks if it was a blank line
+ if (i == line.length())
+ return SCE_LOT_DEFAULT;
+
+ switch (line[i]) {
+ case '*': // Fail measurement
+ return SCE_LOT_FAIL;
+
+ case '+': // Header
+ case '|': // Header
+ return SCE_LOT_HEADER;
+
+ case ':': // Set test limits
+ return SCE_LOT_SET;
+
+ case '-': // Section break
+ return SCE_LOT_BREAK;
+
+ default: // Any other line
+ // Checks for message at the end of lot file
+ if (line.find("PASSED") != std::string::npos) {
+ return SCE_LOT_PASS;
+ }
+ else if (line.find("FAILED") != std::string::npos) {
+ return SCE_LOT_FAIL;
+ }
+ else if (line.find("ABORTED") != std::string::npos) {
+ return SCE_LOT_ABORT;
+ }
+ else {
+ return i ? SCE_LOT_PASS : SCE_LOT_DEFAULT;
+ }
+ }
+ }
+ else {
+ return SCE_LOT_DEFAULT;
+ }
+}
+
+static void ColourizeLotDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ bool atLineStart = true;// Arms the 'at line start' flag
+ char chNext = styler.SafeGetCharAt(startPos);
+ std::string line("");
+ line.reserve(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations
+
+ // Styles LOT document
+ unsigned int i; // Declared here because it's used after the for loop
+ for (i = startPos; i < startPos + length; ++i) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ line += ch;
+ atLineStart = false;
+
+ // LOT files are only used on the Win32 platform, thus EOL == CR+LF
+ // Searches for the end of line
+ if (ch == '\r' && chNext == '\n') {
+ line += chNext; // Gets the '\n'
+ ++i; // Advances past the '\n'
+ chNext = styler.SafeGetCharAt(i + 1); // Gets character of next line
+ styler.ColourTo(i, GetLotLineState(line));
+ line = "";
+ atLineStart = true; // Arms flag for next line
+ }
+ }
+
+ // Last line may not have a line ending
+ if (!atLineStart) {
+ styler.ColourTo(i - 1, GetLotLineState(line));
+ }
+}
+
+// Folds an MPT LOT file: the blocks that can be folded are:
+// sections (headed by a set line)
+// passes (contiguous pass results within a section)
+// fails (contiguous fail results within a section)
+static void FoldLotDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+
+ char chNext = styler.SafeGetCharAt(startPos);
+ int style = SCE_LOT_DEFAULT;
+ int styleNext = styler.StyleAt(startPos);
+ int lev = SC_FOLDLEVELBASE;
+
+ // Gets style of previous line if not at the beginning of the document
+ if (startPos > 1)
+ style = styler.StyleAt(startPos - 2);
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (ch == '\r' && chNext == '\n') {
+ // TO DO:
+ // Should really get the state of the previous line from the styler
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 2);
+
+ switch (style) {
+/*
+ case SCE_LOT_SET:
+ lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ break;
+*/
+ case SCE_LOT_FAIL:
+/*
+ if (stylePrev != SCE_LOT_FAIL)
+ lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ else
+ lev = SC_FOLDLEVELBASE + 1;
+*/
+ lev = SC_FOLDLEVELBASE;
+ break;
+
+ default:
+ if (lineCurrent == 0 || stylePrev == SCE_LOT_FAIL)
+ lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ else
+ lev = SC_FOLDLEVELBASE + 1;
+
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ break;
+ }
+
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, lev | flagsNext);
+}
+
+static const char * const emptyWordListDesc[] = {
+ 0
+};
+
+LexerModule lmLot(SCLEX_LOT, ColourizeLotDoc, "lot", FoldLotDoc, emptyWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMSSQL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMSSQL.cxx
new file mode 100644
index 00000000000..f5b87a0a082
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMSSQL.cxx
@@ -0,0 +1,354 @@
+// Scintilla source code edit control
+/** @file LexMSSQL.cxx
+ ** Lexer for MSSQL.
+ **/
+// By Filip Yaghob <fyaghob@gmail.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define KW_MSSQL_STATEMENTS 0
+#define KW_MSSQL_DATA_TYPES 1
+#define KW_MSSQL_SYSTEM_TABLES 2
+#define KW_MSSQL_GLOBAL_VARIABLES 3
+#define KW_MSSQL_FUNCTIONS 4
+#define KW_MSSQL_STORED_PROCEDURES 5
+#define KW_MSSQL_OPERATORS 6
+
+static char classifyWordSQL(unsigned int start,
+ unsigned int end,
+ WordList *keywordlists[],
+ Accessor &styler,
+ unsigned int actualState,
+ unsigned int prevState) {
+ char s[256];
+ bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.');
+
+ WordList &kwStatements = *keywordlists[KW_MSSQL_STATEMENTS];
+ WordList &kwDataTypes = *keywordlists[KW_MSSQL_DATA_TYPES];
+ WordList &kwSystemTables = *keywordlists[KW_MSSQL_SYSTEM_TABLES];
+ WordList &kwGlobalVariables = *keywordlists[KW_MSSQL_GLOBAL_VARIABLES];
+ WordList &kwFunctions = *keywordlists[KW_MSSQL_FUNCTIONS];
+ WordList &kwStoredProcedures = *keywordlists[KW_MSSQL_STORED_PROCEDURES];
+ WordList &kwOperators = *keywordlists[KW_MSSQL_OPERATORS];
+
+ for (unsigned int i = 0; i < end - start + 1 && i < 128; i++) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ s[i + 1] = '\0';
+ }
+ char chAttr = SCE_MSSQL_IDENTIFIER;
+
+ if (actualState == SCE_MSSQL_GLOBAL_VARIABLE) {
+
+ if (kwGlobalVariables.InList(&s[2]))
+ chAttr = SCE_MSSQL_GLOBAL_VARIABLE;
+
+ } else if (wordIsNumber) {
+ chAttr = SCE_MSSQL_NUMBER;
+
+ } else if (prevState == SCE_MSSQL_DEFAULT_PREF_DATATYPE) {
+ // Look first in datatypes
+ if (kwDataTypes.InList(s))
+ chAttr = SCE_MSSQL_DATATYPE;
+ else if (kwOperators.InList(s))
+ chAttr = SCE_MSSQL_OPERATOR;
+ else if (kwStatements.InList(s))
+ chAttr = SCE_MSSQL_STATEMENT;
+ else if (kwSystemTables.InList(s))
+ chAttr = SCE_MSSQL_SYSTABLE;
+ else if (kwFunctions.InList(s))
+ chAttr = SCE_MSSQL_FUNCTION;
+ else if (kwStoredProcedures.InList(s))
+ chAttr = SCE_MSSQL_STORED_PROCEDURE;
+
+ } else {
+ if (kwOperators.InList(s))
+ chAttr = SCE_MSSQL_OPERATOR;
+ else if (kwStatements.InList(s))
+ chAttr = SCE_MSSQL_STATEMENT;
+ else if (kwSystemTables.InList(s))
+ chAttr = SCE_MSSQL_SYSTABLE;
+ else if (kwFunctions.InList(s))
+ chAttr = SCE_MSSQL_FUNCTION;
+ else if (kwStoredProcedures.InList(s))
+ chAttr = SCE_MSSQL_STORED_PROCEDURE;
+ else if (kwDataTypes.InList(s))
+ chAttr = SCE_MSSQL_DATATYPE;
+ }
+
+ styler.ColourTo(end, chAttr);
+
+ return chAttr;
+}
+
+static void ColouriseMSSQLDoc(unsigned int startPos, int length,
+ int initStyle, WordList *keywordlists[], Accessor &styler) {
+
+
+ styler.StartAt(startPos);
+
+ bool fold = styler.GetPropertyInt("fold") != 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int spaceFlags = 0;
+
+ int state = initStyle;
+ int prevState = initStyle;
+ char chPrev = ' ';
+ char chNext = styler[startPos];
+ styler.StartSegment(startPos);
+ unsigned int lengthDoc = startPos + length;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
+ int lev = indentCurrent;
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ // Only non whitespace lines can be headers
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
+ if (indentCurrent < (indentNext & ~SC_FOLDLEVELWHITEFLAG)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ if (fold) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ }
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ // When the last char isn't part of the state (have to deal with it too)...
+ if ( (state == SCE_MSSQL_IDENTIFIER) ||
+ (state == SCE_MSSQL_STORED_PROCEDURE) ||
+ (state == SCE_MSSQL_DATATYPE) ||
+ //~ (state == SCE_MSSQL_COLUMN_NAME) ||
+ (state == SCE_MSSQL_FUNCTION) ||
+ //~ (state == SCE_MSSQL_GLOBAL_VARIABLE) ||
+ (state == SCE_MSSQL_VARIABLE)) {
+ if (!iswordchar(ch)) {
+ int stateTmp;
+
+ if ((state == SCE_MSSQL_VARIABLE) || (state == SCE_MSSQL_COLUMN_NAME)) {
+ styler.ColourTo(i - 1, state);
+ stateTmp = state;
+ } else
+ stateTmp = classifyWordSQL(styler.GetStartSegment(), i - 1, keywordlists, styler, state, prevState);
+
+ prevState = state;
+
+ if (stateTmp == SCE_MSSQL_IDENTIFIER || stateTmp == SCE_MSSQL_VARIABLE)
+ state = SCE_MSSQL_DEFAULT_PREF_DATATYPE;
+ else
+ state = SCE_MSSQL_DEFAULT;
+ }
+ } else if (state == SCE_MSSQL_LINE_COMMENT) {
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, state);
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT;
+ }
+ } else if (state == SCE_MSSQL_GLOBAL_VARIABLE) {
+ if ((ch != '@') && !iswordchar(ch)) {
+ classifyWordSQL(styler.GetStartSegment(), i - 1, keywordlists, styler, state, prevState);
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT;
+ }
+ }
+
+ // If is the default or one of the above succeeded
+ if (state == SCE_MSSQL_DEFAULT || state == SCE_MSSQL_DEFAULT_PREF_DATATYPE) {
+ if (iswordstart(ch)) {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_IDENTIFIER;
+ } else if (ch == '/' && chNext == '*') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_COMMENT;
+ } else if (ch == '-' && chNext == '-') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_LINE_COMMENT;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_STRING;
+ } else if (ch == '"') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_COLUMN_NAME;
+ } else if (ch == '[') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ state = SCE_MSSQL_COLUMN_NAME_2;
+ } else if (isoperator(ch)) {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ styler.ColourTo(i, SCE_MSSQL_OPERATOR);
+ //~ style = SCE_MSSQL_DEFAULT;
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT;
+ } else if (ch == '@') {
+ styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
+ prevState = state;
+ if (chNext == '@') {
+ state = SCE_MSSQL_GLOBAL_VARIABLE;
+// i += 2;
+ } else
+ state = SCE_MSSQL_VARIABLE;
+ }
+
+
+ // When the last char is part of the state...
+ } else if (state == SCE_MSSQL_COMMENT) {
+ if (ch == '/' && chPrev == '*') {
+ if (((i > (styler.GetStartSegment() + 2)) || ((initStyle == SCE_MSSQL_COMMENT) &&
+ (styler.GetStartSegment() == startPos)))) {
+ styler.ColourTo(i, state);
+ //~ state = SCE_MSSQL_COMMENT;
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT;
+ }
+ }
+ } else if (state == SCE_MSSQL_STRING) {
+ if (ch == '\'') {
+ if ( chNext == '\'' ) {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ styler.ColourTo(i, state);
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT;
+ //i++;
+ }
+ //ch = chNext;
+ //chNext = styler.SafeGetCharAt(i + 1);
+ }
+ } else if (state == SCE_MSSQL_COLUMN_NAME) {
+ if (ch == '"') {
+ if (chNext == '"') {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ styler.ColourTo(i, state);
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT_PREF_DATATYPE;
+ //i++;
+ }
+ }
+ } else if (state == SCE_MSSQL_COLUMN_NAME_2) {
+ if (ch == ']') {
+ styler.ColourTo(i, state);
+ prevState = state;
+ state = SCE_MSSQL_DEFAULT_PREF_DATATYPE;
+ //i++;
+ }
+ }
+
+ chPrev = ch;
+ }
+ styler.ColourTo(lengthDoc - 1, state);
+}
+
+static void FoldMSSQLDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ bool inComment = (styler.StyleAt(startPos-1) == SCE_MSSQL_COMMENT);
+ char s[10] = "";
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ // Comment folding
+ if (foldComment) {
+ if (!inComment && (style == SCE_MSSQL_COMMENT))
+ levelCurrent++;
+ else if (inComment && (style != SCE_MSSQL_COMMENT))
+ levelCurrent--;
+ inComment = (style == SCE_MSSQL_COMMENT);
+ }
+ if (style == SCE_MSSQL_STATEMENT) {
+ // Folding between begin or case and end
+ if (ch == 'b' || ch == 'B' || ch == 'c' || ch == 'C' || ch == 'e' || ch == 'E') {
+ for (unsigned int j = 0; j < 5; j++) {
+ if (!iswordchar(styler[i + j])) {
+ break;
+ }
+ s[j] = static_cast<char>(tolower(styler[i + j]));
+ s[j + 1] = '\0';
+ }
+ if ((strcmp(s, "begin") == 0) || (strcmp(s, "case") == 0)) {
+ levelCurrent++;
+ }
+ if (strcmp(s, "end") == 0) {
+ levelCurrent--;
+ }
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const sqlWordListDesc[] = {
+ "Statements",
+ "Data Types",
+ "System tables",
+ "Global variables",
+ "Functions",
+ "System Stored Procedures",
+ "Operators",
+ 0,
+};
+
+LexerModule lmMSSQL(SCLEX_MSSQL, ColouriseMSSQLDoc, "mssql", FoldMSSQLDoc, sqlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMagik.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMagik.cxx
new file mode 100644
index 00000000000..992080dd8a7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMagik.cxx
@@ -0,0 +1,448 @@
+// Scintilla source code edit control
+/**
+ * @file LexMagik.cxx
+ * Lexer for GE(r) Smallworld(tm) MagikSF
+ */
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/**
+ * Is it a core character (C isalpha(), exclamation and question mark)
+ *
+ * \param ch The character
+ * \return True if ch is a character, False otherwise
+ */
+static inline bool IsAlphaCore(int ch) {
+ return (isalpha(ch) || ch == '!' || ch == '?');
+}
+
+/**
+ * Is it a character (IsAlphaCore() and underscore)
+ *
+ * \param ch The character
+ * \return True if ch is a character, False otherwise
+ */
+static inline bool IsAlpha(int ch) {
+ return (IsAlphaCore(ch) || ch == '_');
+}
+
+/**
+ * Is it a symbolic character (IsAlpha() and colon)
+ *
+ * \param ch The character
+ * \return True if ch is a character, False otherwise
+ */
+static inline bool IsAlphaSym(int ch) {
+ return (IsAlpha(ch) || ch == ':');
+}
+
+/**
+ * Is it a numerical character (IsAlpha() and 0 - 9)
+ *
+ * \param ch The character
+ * \return True if ch is a character, False otherwise
+ */
+static inline bool IsAlNum(int ch) {
+ return ((ch >= '0' && ch <= '9') || IsAlpha(ch));
+}
+
+/**
+ * Is it a symbolic numerical character (IsAlNum() and colon)
+ *
+ * \param ch The character
+ * \return True if ch is a character, False otherwise
+ */
+static inline bool IsAlNumSym(int ch) {
+ return (IsAlNum(ch) || ch == ':');
+}
+
+/**
+ * The lexer function
+ *
+ * \param startPos Where to start scanning
+ * \param length Where to scan to
+ * \param initStyle The style at the initial point, not used in this folder
+ * \param keywordslists The keywordslists, currently, number 5 is used
+ * \param styler The styler
+ */
+static void ColouriseMagikDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ styler.StartAt(startPos);
+
+ WordList &keywords = *keywordlists[0];
+ WordList &pragmatics = *keywordlists[1];
+ WordList &containers = *keywordlists[2];
+ WordList &flow = *keywordlists[3];
+ WordList &characters = *keywordlists[4];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+
+ for (; sc.More(); sc.Forward()) {
+
+ repeat:
+
+ if(sc.ch == '#') {
+ if (sc.chNext == '#') sc.SetState(SCE_MAGIK_HYPER_COMMENT);
+ else sc.SetState(SCE_MAGIK_COMMENT);
+ for(; sc.More() && !(sc.atLineEnd); sc.Forward());
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ if(sc.ch == '"') {
+ sc.SetState(SCE_MAGIK_STRING);
+
+ if(sc.More())
+ {
+ sc.Forward();
+ for(; sc.More() && sc.ch != '"'; sc.Forward());
+ }
+
+ sc.ForwardSetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ // The default state
+ if(sc.state == SCE_MAGIK_DEFAULT) {
+
+ // A certain keyword has been detected
+ if (sc.ch == '_' && (
+ sc.currentPos == 0 || !IsAlNum(sc.chPrev))) {
+ char keyword[50];
+ memset(keyword, '\0', 50);
+
+ for(
+ int scanPosition = 0;
+ scanPosition < 50;
+ scanPosition++) {
+ char keywordChar = static_cast<char>(
+ tolower(styler.SafeGetCharAt(
+ scanPosition +
+ static_cast<int>(sc.currentPos+1), ' ')));
+ if(IsAlpha(keywordChar)) {
+ keyword[scanPosition] = keywordChar;
+ } else {
+ break;
+ }
+ }
+
+ // It is a pragma
+ if(pragmatics.InList(keyword)) {
+ sc.SetState(SCE_MAGIK_PRAGMA);
+ }
+
+ // it is a normal keyword like _local, _self, etc.
+ else if(keywords.InList(keyword)) {
+ sc.SetState(SCE_MAGIK_KEYWORD);
+ }
+
+ // It is a container keyword, such as _method, _proc, etc.
+ else if(containers.InList(keyword)) {
+ sc.SetState(SCE_MAGIK_CONTAINER);
+ }
+
+ // It is a flow keyword, such as _for, _if, _try, etc.
+ else if(flow.InList(keyword)) {
+ sc.SetState(SCE_MAGIK_FLOW);
+ }
+
+ // Interpret as unknown keyword
+ else {
+ sc.SetState(SCE_MAGIK_UNKNOWN_KEYWORD);
+ }
+ }
+
+ // Symbolic expression
+ else if(sc.ch == ':' && !IsAlNum(sc.chPrev)) {
+ sc.SetState(SCE_MAGIK_SYMBOL);
+ bool firstTrip = true;
+ for(sc.Forward(); sc.More(); sc.Forward()) {
+ if(firstTrip && IsAlphaSym(sc.ch));
+ else if(!firstTrip && IsAlNumSym(sc.ch));
+ else if(sc.ch == '|') {
+ for(sc.Forward();
+ sc.More() && sc.ch != '|';
+ sc.Forward());
+ }
+ else break;
+
+ firstTrip = false;
+ }
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ // Identifier (label) expression
+ else if(sc.ch == '@') {
+ sc.SetState(SCE_MAGIK_IDENTIFIER);
+ bool firstTrip = true;
+ for(sc.Forward(); sc.More(); sc.Forward()) {
+ if(firstTrip && IsAlphaCore(sc.ch)) {
+ firstTrip = false;
+ }
+ else if(!firstTrip && IsAlpha(sc.ch));
+ else break;
+ }
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ // Start of a character
+ else if(sc.ch == '%') {
+ sc.SetState(SCE_MAGIK_CHARACTER);
+ sc.Forward();
+ char keyword[50];
+ memset(keyword, '\0', 50);
+
+ for(
+ int scanPosition = 0;
+ scanPosition < 50;
+ scanPosition++) {
+ char keywordChar = static_cast<char>(
+ tolower(styler.SafeGetCharAt(
+ scanPosition +
+ static_cast<int>(sc.currentPos), ' ')));
+ if(IsAlpha(keywordChar)) {
+ keyword[scanPosition] = keywordChar;
+ } else {
+ break;
+ }
+ }
+
+ if(characters.InList(keyword)) {
+ sc.Forward(static_cast<int>(strlen(keyword)));
+ } else {
+ sc.Forward();
+ }
+
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ // Operators
+ else if(
+ sc.ch == '>' ||
+ sc.ch == '<' ||
+ sc.ch == '.' ||
+ sc.ch == ',' ||
+ sc.ch == '+' ||
+ sc.ch == '-' ||
+ sc.ch == '/' ||
+ sc.ch == '*' ||
+ sc.ch == '~' ||
+ sc.ch == '$' ||
+ sc.ch == '=') {
+ sc.SetState(SCE_MAGIK_OPERATOR);
+ }
+
+ // Braces
+ else if(sc.ch == '(' || sc.ch == ')') {
+ sc.SetState(SCE_MAGIK_BRACE_BLOCK);
+ }
+
+ // Brackets
+ else if(sc.ch == '{' || sc.ch == '}') {
+ sc.SetState(SCE_MAGIK_BRACKET_BLOCK);
+ }
+
+ // Square Brackets
+ else if(sc.ch == '[' || sc.ch == ']') {
+ sc.SetState(SCE_MAGIK_SQBRACKET_BLOCK);
+ }
+
+
+ }
+
+ // It is an operator
+ else if(
+ sc.state == SCE_MAGIK_OPERATOR ||
+ sc.state == SCE_MAGIK_BRACE_BLOCK ||
+ sc.state == SCE_MAGIK_BRACKET_BLOCK ||
+ sc.state == SCE_MAGIK_SQBRACKET_BLOCK) {
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+
+ // It is the pragma state
+ else if(sc.state == SCE_MAGIK_PRAGMA) {
+ if(!IsAlpha(sc.ch)) {
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+ }
+
+ // It is the keyword state
+ else if(
+ sc.state == SCE_MAGIK_KEYWORD ||
+ sc.state == SCE_MAGIK_CONTAINER ||
+ sc.state == SCE_MAGIK_FLOW ||
+ sc.state == SCE_MAGIK_UNKNOWN_KEYWORD) {
+ if(!IsAlpha(sc.ch)) {
+ sc.SetState(SCE_MAGIK_DEFAULT);
+ goto repeat;
+ }
+ }
+ }
+
+ sc.Complete();
+}
+
+/**
+ * The word list description
+ */
+static const char * const magikWordListDesc[] = {
+ "Accessors (local, global, self, super, thisthread)",
+ "Pragmatic (pragma, private)",
+ "Containers (method, block, proc)",
+ "Flow (if, then, elif, else)",
+ "Characters (space, tab, newline, return)",
+ "Fold Containers (method, proc, block, if, loop)",
+ 0};
+
+/**
+ * This function detects keywords which are able to have a body. Note that it
+ * uses the Fold Containers word description, not the containers description. It
+ * only works when the style at that particular position is set on Containers
+ * or Flow (number 3 or 4).
+ *
+ * \param keywordslist The list of keywords that are scanned, they should only
+ * contain the start keywords, not the end keywords
+ * \param The actual keyword
+ * \return 1 if it is a folding start-keyword, -1 if it is a folding end-keyword
+ * 0 otherwise
+ */
+static inline int IsFoldingContainer(WordList &keywordslist, char * keyword) {
+ if(
+ strlen(keyword) > 3 &&
+ keyword[0] == 'e' && keyword[1] == 'n' && keyword[2] == 'd') {
+ if (keywordslist.InList(keyword + 3)) {
+ return -1;
+ }
+
+ } else {
+ if(keywordslist.InList(keyword)) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * The folding function
+ *
+ * \param startPos Where to start scanning
+ * \param length Where to scan to
+ * \param keywordslists The keywordslists, currently, number 5 is used
+ * \param styler The styler
+ */
+static void FoldMagikDoc(unsigned int startPos, int length, int,
+ WordList *keywordslists[], Accessor &styler) {
+
+ bool compact = styler.GetPropertyInt("fold.compact") != 0;
+
+ WordList &foldingElements = *keywordslists[5];
+ int endPos = startPos + length;
+ int line = styler.GetLine(startPos);
+ int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK;
+ int flags = styler.LevelAt(line) & ~SC_FOLDLEVELNUMBERMASK;
+
+ for(
+ int currentPos = startPos;
+ currentPos < endPos;
+ currentPos++) {
+ char currentState = styler.StyleAt(currentPos);
+ char c = styler.SafeGetCharAt(currentPos, ' ');
+ int prevLine = styler.GetLine(currentPos - 1);
+ line = styler.GetLine(currentPos);
+
+ // Default situation
+ if(prevLine < line) {
+ styler.SetLevel(line, (level|flags) & ~SC_FOLDLEVELHEADERFLAG);
+ flags = styler.LevelAt(line) & ~SC_FOLDLEVELNUMBERMASK;
+ }
+
+ if(
+ (
+ currentState == SCE_MAGIK_CONTAINER ||
+ currentState == SCE_MAGIK_FLOW
+ ) &&
+ c == '_') {
+
+ char keyword[50];
+ memset(keyword, '\0', 50);
+
+ for(
+ int scanPosition = 0;
+ scanPosition < 50;
+ scanPosition++) {
+ char keywordChar = static_cast<char>(
+ tolower(styler.SafeGetCharAt(
+ scanPosition +
+ currentPos + 1, ' ')));
+ if(IsAlpha(keywordChar)) {
+ keyword[scanPosition] = keywordChar;
+ } else {
+ break;
+ }
+ }
+
+ if(IsFoldingContainer(foldingElements, keyword) > 0) {
+ styler.SetLevel(
+ line,
+ styler.LevelAt(line) | SC_FOLDLEVELHEADERFLAG);
+ level++;
+ } else if(IsFoldingContainer(foldingElements, keyword) < 0) {
+ styler.SetLevel(line, styler.LevelAt(line));
+ level--;
+ }
+ }
+
+ if(
+ compact && (
+ currentState == SCE_MAGIK_BRACE_BLOCK ||
+ currentState == SCE_MAGIK_BRACKET_BLOCK ||
+ currentState == SCE_MAGIK_SQBRACKET_BLOCK)) {
+ if(c == '{' || c == '[' || c == '(') {
+ styler.SetLevel(
+ line,
+ styler.LevelAt(line) | SC_FOLDLEVELHEADERFLAG);
+ level++;
+ } else if(c == '}' || c == ']' || c == ')') {
+ styler.SetLevel(line, styler.LevelAt(line));
+ level--;
+ }
+ }
+ }
+
+}
+
+/**
+ * Injecting the module
+ */
+LexerModule lmMagikSF(
+ SCLEX_MAGIK, ColouriseMagikDoc, "magiksf", FoldMagikDoc, magikWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMarkdown.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMarkdown.cxx
new file mode 100644
index 00000000000..c774b736fce
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMarkdown.cxx
@@ -0,0 +1,421 @@
+/******************************************************************
+ * LexMarkdown.cxx
+ *
+ * A simple Markdown lexer for scintilla.
+ *
+ * Includes highlighting for some extra features from the
+ * Pandoc implementation; strikeout, using '#.' as a default
+ * ordered list item marker, and delimited code blocks.
+ *
+ * Limitations:
+ *
+ * Standard indented code blocks are not highlighted at all,
+ * as it would conflict with other indentation schemes. Use
+ * delimited code blocks for blanket highlighting of an
+ * entire code block. Embedded HTML is not highlighted either.
+ * Blanket HTML highlighting has issues, because some Markdown
+ * implementations allow Markdown markup inside of the HTML. Also,
+ * there is a following blank line issue that can't be ignored,
+ * explained in the next paragraph. Embedded HTML and code
+ * blocks would be better supported with language specific
+ * highlighting.
+ *
+ * The highlighting aims to accurately reflect correct syntax,
+ * but a few restrictions are relaxed. Delimited code blocks are
+ * highlighted, even if the line following the code block is not blank.
+ * Requiring a blank line after a block, breaks the highlighting
+ * in certain cases, because of the way Scintilla ends up calling
+ * the lexer.
+ *
+ * Written by Jon Strait - jstrait@moonloop.net
+ *
+ * The License.txt file describes the conditions under which this
+ * software may be distributed.
+ *
+ *****************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsNewline(const int ch) {
+ return (ch == '\n' || ch == '\r');
+}
+
+// True if can follow ch down to the end with possibly trailing whitespace
+static bool FollowToLineEnd(const int ch, const int state, const unsigned int endPos, StyleContext &sc) {
+ unsigned int i = 0;
+ while (sc.GetRelative(++i) == ch)
+ ;
+ // Skip over whitespace
+ while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos)
+ ++i;
+ if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) {
+ sc.Forward(i);
+ sc.ChangeState(state);
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ return true;
+ }
+ else return false;
+}
+
+// Set the state on text section from current to length characters,
+// then set the rest until the newline to default, except for any characters matching token
+static void SetStateAndZoom(const int state, const int length, const int token, StyleContext &sc) {
+ sc.SetState(state);
+ sc.Forward(length);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ sc.Forward();
+ bool started = false;
+ while (sc.More() && !IsNewline(sc.ch)) {
+ if (sc.ch == token && !started) {
+ sc.SetState(state);
+ started = true;
+ }
+ else if (sc.ch != token) {
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ started = false;
+ }
+ sc.Forward();
+ }
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+}
+
+// Does the previous line have more than spaces and tabs?
+static bool HasPrevLineContent(StyleContext &sc) {
+ int i = 0;
+ // Go back to the previous newline
+ while ((--i + (int)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i)))
+ ;
+ while ((--i + (int)sc.currentPos) >= 0) {
+ if (IsNewline(sc.GetRelative(i)))
+ break;
+ if (!IsASpaceOrTab(sc.GetRelative(i)))
+ return true;
+ }
+ return false;
+}
+
+static bool AtTermStart(StyleContext &sc) {
+ return sc.currentPos == 0 || isspacechar(sc.chPrev);
+}
+
+static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
+ int count = 1;
+ unsigned int i = 0;
+ for (;;) {
+ ++i;
+ int c = sc.GetRelative(i);
+ if (c == sc.ch)
+ ++count;
+ // hit a terminating character
+ else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) {
+ // Are we a valid HRULE
+ if ((IsNewline(c) || sc.currentPos + i == endPos) &&
+ count >= 3 && !HasPrevLineContent(sc)) {
+ sc.SetState(SCE_MARKDOWN_HRULE);
+ sc.Forward(i);
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ return true;
+ }
+ else {
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ return false;
+ }
+ }
+ }
+}
+
+static void ColorizeMarkdownDoc(unsigned int startPos, int length, int initStyle,
+ WordList **, Accessor &styler) {
+ unsigned int endPos = startPos + length;
+ int precharCount = 0;
+ // Don't advance on a new loop iteration and retry at the same position.
+ // Useful in the corner case of having to start at the beginning file position
+ // in the default state.
+ bool freezeCursor = false;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+ // Skip past escaped characters
+ if (sc.ch == '\\') {
+ sc.Forward();
+ continue;
+ }
+
+ // A blockquotes resets the line semantics
+ if (sc.state == SCE_MARKDOWN_BLOCKQUOTE)
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+
+ // Conditional state-based actions
+ if (sc.state == SCE_MARKDOWN_CODE2) {
+ if (sc.Match("``") && sc.GetRelative(-2) != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_MARKDOWN_CODE) {
+ if (sc.ch == '`' && sc.chPrev != ' ')
+ sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
+ }
+ /* De-activated because it gets in the way of other valid indentation
+ * schemes, for example multiple paragraphs inside a list item.
+ // Code block
+ else if (sc.state == SCE_MARKDOWN_CODEBK) {
+ bool d = true;
+ if (IsNewline(sc.ch)) {
+ if (sc.chNext != '\t') {
+ for (int c = 1; c < 5; ++c) {
+ if (sc.GetRelative(c) != ' ')
+ d = false;
+ }
+ }
+ }
+ else if (sc.atLineStart) {
+ if (sc.ch != '\t' ) {
+ for (int i = 0; i < 4; ++i) {
+ if (sc.GetRelative(i) != ' ')
+ d = false;
+ }
+ }
+ }
+ if (!d)
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ }
+ */
+ // Strong
+ else if (sc.state == SCE_MARKDOWN_STRONG1) {
+ if (sc.Match("**") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_MARKDOWN_STRONG2) {
+ if (sc.Match("__") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ // Emphasis
+ else if (sc.state == SCE_MARKDOWN_EM1) {
+ if (sc.ch == '*' && sc.chPrev != ' ')
+ sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
+ }
+ else if (sc.state == SCE_MARKDOWN_EM2) {
+ if (sc.ch == '_' && sc.chPrev != ' ')
+ sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
+ }
+ else if (sc.state == SCE_MARKDOWN_CODEBK) {
+ if (sc.atLineStart && sc.Match("~~~")) {
+ int i = 1;
+ while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)
+ i++;
+ sc.Forward(i);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_MARKDOWN_STRIKEOUT) {
+ if (sc.Match("~~") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_MARKDOWN_LINE_BEGIN) {
+ // Header
+ if (sc.Match("######"))
+ SetStateAndZoom(SCE_MARKDOWN_HEADER6, 6, '#', sc);
+ else if (sc.Match("#####"))
+ SetStateAndZoom(SCE_MARKDOWN_HEADER5, 5, '#', sc);
+ else if (sc.Match("####"))
+ SetStateAndZoom(SCE_MARKDOWN_HEADER4, 4, '#', sc);
+ else if (sc.Match("###"))
+ SetStateAndZoom(SCE_MARKDOWN_HEADER3, 3, '#', sc);
+ else if (sc.Match("##"))
+ SetStateAndZoom(SCE_MARKDOWN_HEADER2, 2, '#', sc);
+ else if (sc.Match("#")) {
+ // Catch the special case of an unordered list
+ if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
+ precharCount = 0;
+ sc.SetState(SCE_MARKDOWN_PRECHAR);
+ }
+ else
+ SetStateAndZoom(SCE_MARKDOWN_HEADER1, 1, '#', sc);
+ }
+ // Code block
+ else if (sc.Match("~~~")) {
+ if (!HasPrevLineContent(sc))
+ sc.SetState(SCE_MARKDOWN_CODEBK);
+ else
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ else if (sc.ch == '=') {
+ if (HasPrevLineContent(sc) && FollowToLineEnd('=', SCE_MARKDOWN_HEADER1, endPos, sc))
+ ;
+ else
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ else if (sc.ch == '-') {
+ if (HasPrevLineContent(sc) && FollowToLineEnd('-', SCE_MARKDOWN_HEADER2, endPos, sc))
+ ;
+ else {
+ precharCount = 0;
+ sc.SetState(SCE_MARKDOWN_PRECHAR);
+ }
+ }
+ else if (IsNewline(sc.ch))
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ else {
+ precharCount = 0;
+ sc.SetState(SCE_MARKDOWN_PRECHAR);
+ }
+ }
+
+ // The header lasts until the newline
+ else if (sc.state == SCE_MARKDOWN_HEADER1 || sc.state == SCE_MARKDOWN_HEADER2 ||
+ sc.state == SCE_MARKDOWN_HEADER3 || sc.state == SCE_MARKDOWN_HEADER4 ||
+ sc.state == SCE_MARKDOWN_HEADER5 || sc.state == SCE_MARKDOWN_HEADER6) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ }
+
+ // New state only within the initial whitespace
+ if (sc.state == SCE_MARKDOWN_PRECHAR) {
+ // Blockquote
+ if (sc.ch == '>' && precharCount < 5)
+ sc.SetState(SCE_MARKDOWN_BLOCKQUOTE);
+ /*
+ // Begin of code block
+ else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4))
+ sc.SetState(SCE_MARKDOWN_CODEBK);
+ */
+ // HRule - Total of three or more hyphens, asterisks, or underscores
+ // on a line by themselves
+ else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '_') && IsValidHrule(endPos, sc))
+ ;
+ // Unordered list
+ else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '+') && IsASpaceOrTab(sc.chNext)) {
+ sc.SetState(SCE_MARKDOWN_ULIST_ITEM);
+ sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
+ }
+ // Ordered list
+ else if (IsADigit(sc.ch)) {
+ int digitCount = 0;
+ while (IsADigit(sc.GetRelative(++digitCount)))
+ ;
+ if (sc.GetRelative(digitCount) == '.' &&
+ IsASpaceOrTab(sc.GetRelative(digitCount + 1))) {
+ sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
+ sc.Forward(digitCount + 1);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ // Alternate Ordered list
+ else if (sc.ch == '#' && sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
+ sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
+ sc.Forward(2);
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ }
+ else if (sc.ch != ' ' || precharCount > 2)
+ sc.SetState(SCE_MARKDOWN_DEFAULT);
+ else
+ ++precharCount;
+ }
+
+ // New state anywhere in doc
+ if (sc.state == SCE_MARKDOWN_DEFAULT) {
+ if (sc.atLineStart && sc.ch == '#') {
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ freezeCursor = true;
+ }
+ // Links and Images
+ if (sc.Match("![") || sc.ch == '[') {
+ int i = 0, j = 0, k = 0;
+ int len = endPos - sc.currentPos;
+ while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == ']') {
+ j = i;
+ if (sc.GetRelative(++i) == '(') {
+ while (i < len && (sc.GetRelative(++i) != ')' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == ')')
+ k = i;
+ }
+ else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') {
+ while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == ']')
+ k = i;
+ }
+ }
+ // At least a link text
+ if (j) {
+ sc.SetState(SCE_MARKDOWN_LINK);
+ sc.Forward(j);
+ // Also has a URL or reference portion
+ if (k)
+ sc.Forward(k - j);
+ sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
+ }
+ }
+ // Code - also a special case for alternate inside spacing
+ if (sc.Match("``") && sc.GetRelative(3) != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_CODE2);
+ sc.Forward();
+ }
+ else if (sc.ch == '`' && sc.chNext != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_CODE);
+ }
+ // Strong
+ else if (sc.Match("**") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_STRONG1);
+ sc.Forward();
+ }
+ else if (sc.Match("__") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_STRONG2);
+ sc.Forward();
+ }
+ // Emphasis
+ else if (sc.ch == '*' && sc.chNext != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_EM1);
+ }
+ else if (sc.ch == '_' && sc.chNext != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_EM2);
+ }
+ // Strikeout
+ else if (sc.Match("~~") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
+ sc.SetState(SCE_MARKDOWN_STRIKEOUT);
+ sc.Forward();
+ }
+ // Beginning of line
+ else if (IsNewline(sc.ch)) {
+ sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
+ }
+ }
+ // Advance if not holding back the cursor for this iteration.
+ if (!freezeCursor)
+ sc.Forward();
+ freezeCursor = false;
+ }
+ sc.Complete();
+}
+
+LexerModule lmMarkdown(SCLEX_MARKDOWN, ColorizeMarkdownDoc, "markdown");
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMatlab.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMatlab.cxx
new file mode 100644
index 00000000000..4dfd512c838
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMatlab.cxx
@@ -0,0 +1,314 @@
+// Scintilla source code edit control
+/** @file LexMatlab.cxx
+ ** Lexer for Matlab.
+ ** Written by José Fonseca
+ **
+ ** Changes by Christoph Dalitz 2003/12/04:
+ ** - added support for Octave
+ ** - Strings can now be included both in single or double quotes
+ **
+ ** Changes by John Donoghue 2012/04/02
+ ** - added block comment (and nested block comments)
+ ** - added ... displayed as a comment
+ ** - removed unused IsAWord functions
+ ** - added some comments
+ **
+ ** Changes by John Donoghue 2014/08/01
+ ** - fix allowed transpose ' after {} operator
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static bool IsMatlabCommentChar(int c) {
+ return (c == '%') ;
+}
+
+static bool IsOctaveCommentChar(int c) {
+ return (c == '%' || c == '#') ;
+}
+
+static bool IsMatlabComment(Accessor &styler, int pos, int len) {
+ return len > 0 && IsMatlabCommentChar(styler[pos]) ;
+}
+
+static bool IsOctaveComment(Accessor &styler, int pos, int len) {
+ return len > 0 && IsOctaveCommentChar(styler[pos]) ;
+}
+
+static void ColouriseMatlabOctaveDoc(
+ unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler,
+ bool (*IsCommentChar)(int),
+ bool ismatlab) {
+
+ WordList &keywords = *keywordlists[0];
+
+ styler.StartAt(startPos);
+
+ // boolean for when the ' is allowed to be transpose vs the start/end
+ // of a string
+ bool transpose = false;
+
+ // approximate position of first non space character in a line
+ int nonSpaceColumn = -1;
+ // approximate column position of the current character in a line
+ int column = 0;
+
+ // use the line state of each line to store the block comment depth
+ int curLine = styler.GetLine(startPos);
+ int commentDepth = curLine > 0 ? styler.GetLineState(curLine-1) : 0;
+
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward(), column++) {
+
+ if(sc.atLineStart) {
+ // set the line state to the current commentDepth
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, commentDepth);
+
+ // reset the column to 0, nonSpace to -1 (not set)
+ column = 0;
+ nonSpaceColumn = -1;
+ }
+
+ // save the column position of first non space character in a line
+ if((nonSpaceColumn == -1) && (! IsASpace(sc.ch)))
+ {
+ nonSpaceColumn = column;
+ }
+
+ // check for end of states
+ if (sc.state == SCE_MATLAB_OPERATOR) {
+ if (sc.chPrev == '.') {
+ if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') {
+ sc.ForwardSetState(SCE_MATLAB_DEFAULT);
+ transpose = false;
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_MATLAB_DEFAULT);
+ transpose = true;
+ } else if(sc.ch == '.' && sc.chNext == '.') {
+ // we werent an operator, but a '...'
+ sc.ChangeState(SCE_MATLAB_COMMENT);
+ transpose = false;
+ } else {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ }
+ } else {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ }
+ } else if (sc.state == SCE_MATLAB_KEYWORD) {
+ if (!isalnum(sc.ch) && sc.ch != '_') {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ transpose = false;
+ } else {
+ sc.ChangeState(SCE_MATLAB_IDENTIFIER);
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ transpose = true;
+ }
+ }
+ } else if (sc.state == SCE_MATLAB_NUMBER) {
+ if (!isdigit(sc.ch) && sc.ch != '.'
+ && !(sc.ch == 'e' || sc.ch == 'E')
+ && !((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E'))) {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ transpose = true;
+ }
+ } else if (sc.state == SCE_MATLAB_STRING) {
+ if (sc.ch == '\'') {
+ if (sc.chNext == '\'') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_MATLAB_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_MATLAB_DEFAULT);
+ }
+ } else if (sc.state == SCE_MATLAB_COMMAND) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ transpose = false;
+ }
+ } else if (sc.state == SCE_MATLAB_COMMENT) {
+ // end or start of a nested a block comment?
+ if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column) {
+ if(commentDepth > 0) commentDepth --;
+
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, commentDepth);
+ sc.Forward();
+
+ if (commentDepth == 0) {
+ sc.ForwardSetState(SCE_D_DEFAULT);
+ transpose = false;
+ }
+ }
+ else if( IsCommentChar(sc.ch) && sc.chNext == '{' && nonSpaceColumn == column)
+ {
+ commentDepth ++;
+
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, commentDepth);
+ sc.Forward();
+ transpose = false;
+
+ } else if(commentDepth == 0) {
+ // single line comment
+ if (sc.atLineEnd || sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_MATLAB_DEFAULT);
+ transpose = false;
+ }
+ }
+ }
+
+ // check start of a new state
+ if (sc.state == SCE_MATLAB_DEFAULT) {
+ if (IsCommentChar(sc.ch)) {
+ // ncrement depth if we are a block comment
+ if(sc.chNext == '{' && nonSpaceColumn == column)
+ commentDepth ++;
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, commentDepth);
+ sc.SetState(SCE_MATLAB_COMMENT);
+ } else if (sc.ch == '!' && sc.chNext != '=' ) {
+ if(ismatlab) {
+ sc.SetState(SCE_MATLAB_COMMAND);
+ } else {
+ sc.SetState(SCE_MATLAB_OPERATOR);
+ }
+ } else if (sc.ch == '\'') {
+ if (transpose) {
+ sc.SetState(SCE_MATLAB_OPERATOR);
+ } else {
+ sc.SetState(SCE_MATLAB_STRING);
+ }
+ } else if (sc.ch == '"') {
+ sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING);
+ } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) {
+ sc.SetState(SCE_MATLAB_NUMBER);
+ } else if (isalpha(sc.ch)) {
+ sc.SetState(SCE_MATLAB_KEYWORD);
+ } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '\\') {
+ if (sc.ch == ')' || sc.ch == ']' || sc.ch == '}') {
+ transpose = true;
+ } else {
+ transpose = false;
+ }
+ sc.SetState(SCE_MATLAB_OPERATOR);
+ } else {
+ transpose = false;
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar, true);
+}
+
+static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar, false);
+}
+
+static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler,
+ bool (*IsComment)(Accessor&, int, int)) {
+
+ int endPos = startPos + length;
+
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+ int spaceFlags = 0;
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsComment);
+ char chNext = styler[startPos];
+ for (int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) {
+ int lev = indentCurrent;
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsComment);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ // Only non whitespace lines can be headers
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
+ // Line after is blank so check the next - maybe should continue further?
+ int spaceFlags2 = 0;
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsComment);
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ }
+ indentCurrent = indentNext;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ }
+ }
+}
+
+static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
+}
+
+static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
+}
+
+static const char * const matlabWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+static const char * const octaveWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc);
+
+LexerModule lmOctave(SCLEX_OCTAVE, ColouriseOctaveDoc, "octave", FoldOctaveDoc, octaveWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMetapost.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMetapost.cxx
new file mode 100644
index 00000000000..d049521cf87
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMetapost.cxx
@@ -0,0 +1,402 @@
+// Scintilla source code edit control
+
+// File: LexMetapost.cxx - general context conformant metapost coloring scheme
+// Author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com
+// Version: September 28, 2003
+// Modified by instanton: July 10, 2007
+// Folding based on keywordlists[]
+
+// Copyright: 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// This lexer is derived from the one written for the texwork environment (1999++) which in
+// turn is inspired on texedit (1991++) which finds its roots in wdt (1986).
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// val SCE_METAPOST_DEFAULT = 0
+// val SCE_METAPOST_SPECIAL = 1
+// val SCE_METAPOST_GROUP = 2
+// val SCE_METAPOST_SYMBOL = 3
+// val SCE_METAPOST_COMMAND = 4
+// val SCE_METAPOST_TEXT = 5
+
+// Definitions in SciTEGlobal.properties:
+//
+// Metapost Highlighting
+//
+// # Default
+// style.metapost.0=fore:#7F7F00
+// # Special
+// style.metapost.1=fore:#007F7F
+// # Group
+// style.metapost.2=fore:#880000
+// # Symbol
+// style.metapost.3=fore:#7F7F00
+// # Command
+// style.metapost.4=fore:#008800
+// # Text
+// style.metapost.5=fore:#000000
+
+// lexer.tex.comment.process=0
+
+// Auxiliary functions:
+
+static inline bool endOfLine(Accessor &styler, unsigned int i) {
+ return
+ (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')) ;
+}
+
+static inline bool isMETAPOSTcomment(int ch) {
+ return
+ (ch == '%') ;
+}
+
+static inline bool isMETAPOSTone(int ch) {
+ return
+ (ch == '[') || (ch == ']') || (ch == '(') || (ch == ')') ||
+ (ch == ':') || (ch == '=') || (ch == '<') || (ch == '>') ||
+ (ch == '{') || (ch == '}') || (ch == '\'') || (ch == '\"') ;
+}
+
+static inline bool isMETAPOSTtwo(int ch) {
+ return
+ (ch == ';') || (ch == '$') || (ch == '@') || (ch == '#');
+}
+
+static inline bool isMETAPOSTthree(int ch) {
+ return
+ (ch == '.') || (ch == '-') || (ch == '+') || (ch == '/') ||
+ (ch == '*') || (ch == ',') || (ch == '|') || (ch == '`') ||
+ (ch == '!') || (ch == '?') || (ch == '^') || (ch == '&') ||
+ (ch == '%') ;
+}
+
+static inline bool isMETAPOSTidentifier(int ch) {
+ return
+ ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ||
+ (ch == '_') ;
+}
+
+static inline bool isMETAPOSTnumber(int ch) {
+ return
+ (ch >= '0') && (ch <= '9') ;
+}
+
+static inline bool isMETAPOSTstring(int ch) {
+ return
+ (ch == '\"') ;
+}
+
+static inline bool isMETAPOSTcolon(int ch) {
+ return
+ (ch == ':') ;
+}
+
+static inline bool isMETAPOSTequal(int ch) {
+ return
+ (ch == '=') ;
+}
+
+static int CheckMETAPOSTInterface(
+ unsigned int startPos,
+ int length,
+ Accessor &styler,
+ int defaultInterface) {
+
+ char lineBuffer[1024] ;
+ unsigned int linePos = 0 ;
+
+ // some day we can make something lexer.metapost.mapping=(none,0)(metapost,1)(mp,1)(metafun,2)...
+
+ if (styler.SafeGetCharAt(0) == '%') {
+ for (unsigned int i = 0; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler.SafeGetCharAt(i) ;
+ if (endOfLine(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ lineBuffer[linePos] = '\0';
+ if (strstr(lineBuffer, "interface=none")) {
+ return 0 ;
+ } else if (strstr(lineBuffer, "interface=metapost") || strstr(lineBuffer, "interface=mp")) {
+ return 1 ;
+ } else if (strstr(lineBuffer, "interface=metafun")) {
+ return 2 ;
+ } else if (styler.SafeGetCharAt(1) == 'D' && strstr(lineBuffer, "%D \\module")) {
+ // better would be to limit the search to just one line
+ return 2 ;
+ } else {
+ return defaultInterface ;
+ }
+ }
+ }
+ }
+
+ return defaultInterface ;
+}
+
+static void ColouriseMETAPOSTDoc(
+ unsigned int startPos,
+ int length,
+ int,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ styler.StartAt(startPos) ;
+ styler.StartSegment(startPos) ;
+
+ bool processComment = styler.GetPropertyInt("lexer.metapost.comment.process", 0) == 1 ;
+ int defaultInterface = styler.GetPropertyInt("lexer.metapost.interface.default", 1) ;
+
+ int currentInterface = CheckMETAPOSTInterface(startPos,length,styler,defaultInterface) ;
+
+ // 0 no keyword highlighting
+ // 1 metapost keyword hightlighting
+ // 2+ metafun keyword hightlighting
+
+ int extraInterface = 0 ;
+
+ if (currentInterface != 0) {
+ extraInterface = currentInterface ;
+ }
+
+ WordList &keywords = *keywordlists[0] ;
+ WordList &keywords2 = *keywordlists[extraInterface-1] ;
+
+ StyleContext sc(startPos, length, SCE_METAPOST_TEXT, styler) ;
+
+ char key[100] ;
+
+ bool inTeX = false ;
+ bool inComment = false ;
+ bool inString = false ;
+ bool inClause = false ;
+
+ bool going = sc.More() ; // needed because of a fuzzy end of file state
+
+ for (; going; sc.Forward()) {
+
+ if (! sc.More()) { going = false ; } // we need to go one behind the end of text
+
+ if (inClause) {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ inClause = false ;
+ }
+
+ if (inComment) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ inTeX = false ;
+ inComment = false ;
+ inClause = false ;
+ inString = false ; // not correct but we want to stimulate one-lines
+ }
+ } else if (inString) {
+ if (isMETAPOSTstring(sc.ch)) {
+ sc.SetState(SCE_METAPOST_SPECIAL) ;
+ sc.ForwardSetState(SCE_METAPOST_TEXT) ;
+ inString = false ;
+ } else if (sc.atLineEnd) {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ inTeX = false ;
+ inComment = false ;
+ inClause = false ;
+ inString = false ; // not correct but we want to stimulate one-lines
+ }
+ } else {
+ if ((! isMETAPOSTidentifier(sc.ch)) && (sc.LengthCurrent() > 0)) {
+ if (sc.state == SCE_METAPOST_COMMAND) {
+ sc.GetCurrent(key, sizeof(key)) ;
+ if ((strcmp(key,"btex") == 0) || (strcmp(key,"verbatimtex") == 0)) {
+ sc.ChangeState(SCE_METAPOST_GROUP) ;
+ inTeX = true ;
+ } else if (inTeX) {
+ if (strcmp(key,"etex") == 0) {
+ sc.ChangeState(SCE_METAPOST_GROUP) ;
+ inTeX = false ;
+ } else {
+ sc.ChangeState(SCE_METAPOST_TEXT) ;
+ }
+ } else {
+ if (keywords && keywords.InList(key)) {
+ sc.ChangeState(SCE_METAPOST_COMMAND) ;
+ } else if (keywords2 && keywords2.InList(key)) {
+ sc.ChangeState(SCE_METAPOST_EXTRA) ;
+ } else {
+ sc.ChangeState(SCE_METAPOST_TEXT) ;
+ }
+ }
+ }
+ }
+ if (isMETAPOSTcomment(sc.ch)) {
+ if (! inTeX) {
+ sc.SetState(SCE_METAPOST_SYMBOL) ;
+ sc.ForwardSetState(SCE_METAPOST_DEFAULT) ;
+ inComment = ! processComment ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTstring(sc.ch)) {
+ if (! inTeX) {
+ sc.SetState(SCE_METAPOST_SPECIAL) ;
+ if (! isMETAPOSTstring(sc.chNext)) {
+ sc.ForwardSetState(SCE_METAPOST_TEXT) ;
+ }
+ inString = true ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTcolon(sc.ch)) {
+ if (! inTeX) {
+ if (! isMETAPOSTequal(sc.chNext)) {
+ sc.SetState(SCE_METAPOST_COMMAND) ;
+ inClause = true ;
+ } else {
+ sc.SetState(SCE_METAPOST_SPECIAL) ;
+ }
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTone(sc.ch)) {
+ if (! inTeX) {
+ sc.SetState(SCE_METAPOST_SPECIAL) ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTtwo(sc.ch)) {
+ if (! inTeX) {
+ sc.SetState(SCE_METAPOST_GROUP) ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTthree(sc.ch)) {
+ if (! inTeX) {
+ sc.SetState(SCE_METAPOST_SYMBOL) ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ } else if (isMETAPOSTidentifier(sc.ch)) {
+ if (sc.state != SCE_METAPOST_COMMAND) {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ sc.ChangeState(SCE_METAPOST_COMMAND) ;
+ }
+ } else if (isMETAPOSTnumber(sc.ch)) {
+ // rather redundant since for the moment we don't handle numbers
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ } else if (sc.atLineEnd) {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ inTeX = false ;
+ inComment = false ;
+ inClause = false ;
+ inString = false ;
+ } else {
+ sc.SetState(SCE_METAPOST_TEXT) ;
+ }
+ }
+
+ }
+
+ sc.Complete();
+
+}
+
+// Hooks info the system:
+
+static const char * const metapostWordListDesc[] = {
+ "MetaPost",
+ "MetaFun",
+ 0
+} ;
+
+static int classifyFoldPointMetapost(const char* s,WordList *keywordlists[]) {
+ WordList& keywordsStart=*keywordlists[3];
+ WordList& keywordsStop1=*keywordlists[4];
+
+ if (keywordsStart.InList(s)) {return 1;}
+ else if (keywordsStop1.InList(s)) {return -1;}
+ return 0;
+
+}
+
+static int ParseMetapostWord(unsigned int pos, Accessor &styler, char *word)
+{
+ int length=0;
+ char ch=styler.SafeGetCharAt(pos);
+ *word=0;
+
+ while(isMETAPOSTidentifier(ch) && isalpha(ch) && length<100){
+ word[length]=ch;
+ length++;
+ ch=styler.SafeGetCharAt(pos+length);
+ }
+ word[length]=0;
+ return length;
+}
+
+static void FoldMetapostDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler)
+{
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos+length;
+ int visibleChars=0;
+ int lineCurrent=styler.GetLine(startPos);
+ int levelPrev=styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent=levelPrev;
+ char chNext=styler[startPos];
+
+ char buffer[100]="";
+
+ for (unsigned int i=startPos; i < endPos; i++) {
+ char ch=chNext;
+ chNext=styler.SafeGetCharAt(i+1);
+ char chPrev=styler.SafeGetCharAt(i-1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if(i==0 || chPrev == '\r' || chPrev=='\n'|| chPrev==' '|| chPrev=='(' || chPrev=='$')
+ {
+ ParseMetapostWord(i, styler, buffer);
+ levelCurrent += classifyFoldPointMetapost(buffer,keywordlists);
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+
+}
+
+
+LexerModule lmMETAPOST(SCLEX_METAPOST, ColouriseMETAPOSTDoc, "metapost", FoldMetapostDoc, metapostWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexModula.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexModula.cxx
new file mode 100644
index 00000000000..c14d40d9093
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexModula.cxx
@@ -0,0 +1,743 @@
+// -*- coding: utf-8 -*-
+// Scintilla source code edit control
+/**
+ * @file LexModula.cxx
+ * @author Dariusz "DKnoto" Knociński
+ * @date 2011/02/03
+ * @brief Lexer for Modula-2/3 documents.
+ */
+// The License.txt file describes the conditions under which this software may
+// be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef DEBUG_LEX_MODULA
+#define DEBUG_STATE( p, c )\
+ fprintf( stderr, "Unknown state: currentPos = %ud, char = '%c'\n", p, c );
+#else
+#define DEBUG_STATE( p, c )
+#endif
+
+static inline bool IsDigitOfBase( unsigned ch, unsigned base ) {
+ if( ch < '0' || ch > 'f' ) return false;
+ if( base <= 10 ) {
+ if( ch >= ( '0' + base ) ) return false;
+ } else {
+ if( ch > '9' ) {
+ unsigned nb = base - 10;
+ if( ( ch < 'A' ) || ( ch >= ( 'A' + nb ) ) ) {
+ if( ( ch < 'a' ) || ( ch >= ( 'a' + nb ) ) ) {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+static inline unsigned IsOperator( StyleContext & sc, WordList & op ) {
+ int i;
+ char s[3];
+
+ s[0] = sc.ch;
+ s[1] = sc.chNext;
+ s[2] = 0;
+ for( i = 0; i < op.Length(); i++ ) {
+ if( ( strlen( op.WordAt(i) ) == 2 ) &&
+ ( s[0] == op.WordAt(i)[0] && s[1] == op.WordAt(i)[1] ) ) {
+ return 2;
+ }
+ }
+ s[1] = 0;
+ for( i = 0; i < op.Length(); i++ ) {
+ if( ( strlen( op.WordAt(i) ) == 1 ) &&
+ ( s[0] == op.WordAt(i)[0] ) ) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static inline bool IsEOL( Accessor &styler, unsigned curPos ) {
+ unsigned ch = styler.SafeGetCharAt( curPos );
+ if( ( ch == '\r' && styler.SafeGetCharAt( curPos + 1 ) == '\n' ) ||
+ ( ch == '\n' ) ) {
+ return true;
+ }
+ return false;
+}
+
+static inline bool checkStatement(
+ Accessor &styler,
+ int &curPos,
+ const char *stt, bool spaceAfter = true ) {
+ int len = static_cast<int>(strlen( stt ));
+ int i;
+ for( i = 0; i < len; i++ ) {
+ if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) {
+ return false;
+ }
+ }
+ if( spaceAfter ) {
+ if( ! isspace( styler.SafeGetCharAt( curPos + i ) ) ) {
+ return false;
+ }
+ }
+ curPos += ( len - 1 );
+ return true;
+}
+
+static inline bool checkEndSemicolon(
+ Accessor &styler,
+ int &curPos, int endPos )
+{
+ const char *stt = "END";
+ int len = static_cast<int>(strlen( stt ));
+ int i;
+ for( i = 0; i < len; i++ ) {
+ if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) {
+ return false;
+ }
+ }
+ while( isspace( styler.SafeGetCharAt( curPos + i ) ) ) {
+ i++;
+ if( ( curPos + i ) >= endPos ) return false;
+ }
+ if( styler.SafeGetCharAt( curPos + i ) != ';' ) {
+ return false;
+ }
+ curPos += ( i - 1 );
+ return true;
+}
+
+static inline bool checkKeyIdentOper(
+
+ Accessor &styler,
+ int &curPos, int endPos,
+ const char *stt, const char etk ) {
+ int newPos = curPos;
+ if( ! checkStatement( styler, newPos, stt ) )
+ return false;
+ newPos++;
+ if( newPos >= endPos )
+ return false;
+ if( ! isspace( styler.SafeGetCharAt( newPos ) ) )
+ return false;
+ newPos++;
+ if( newPos >= endPos )
+ return false;
+ while( isspace( styler.SafeGetCharAt( newPos ) ) ) {
+ newPos++;
+ if( newPos >= endPos )
+ return false;
+ }
+ if( ! isalpha( styler.SafeGetCharAt( newPos ) ) )
+ return false;
+ newPos++;
+ if( newPos >= endPos )
+ return false;
+ char ch;
+ ch = styler.SafeGetCharAt( newPos );
+ while( isalpha( ch ) || isdigit( ch ) || ch == '_' ) {
+ newPos++;
+ if( newPos >= endPos ) return false;
+ ch = styler.SafeGetCharAt( newPos );
+ }
+ while( isspace( styler.SafeGetCharAt( newPos ) ) ) {
+ newPos++;
+ if( newPos >= endPos ) return false;
+ }
+ if( styler.SafeGetCharAt( newPos ) != etk )
+ return false;
+ curPos = newPos;
+ return true;
+}
+
+static void FoldModulaDoc( unsigned int startPos,
+ int length,
+ int , WordList *[],
+ Accessor &styler)
+{
+ int curLine = styler.GetLine(startPos);
+ int curLevel = SC_FOLDLEVELBASE;
+ int endPos = startPos + length;
+ if( curLine > 0 )
+ curLevel = styler.LevelAt( curLine - 1 ) >> 16;
+ int curPos = startPos;
+ int style = styler.StyleAt( curPos );
+ int visChars = 0;
+ int nextLevel = curLevel;
+
+ while( curPos < endPos ) {
+ if( ! isspace( styler.SafeGetCharAt( curPos ) ) ) visChars++;
+
+ switch( style ) {
+ case SCE_MODULA_COMMENT:
+ if( checkStatement( styler, curPos, "(*" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "*)" ) )
+ nextLevel--;
+ break;
+
+ case SCE_MODULA_DOXYCOMM:
+ if( checkStatement( styler, curPos, "(**", false ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "*)" ) )
+ nextLevel--;
+ break;
+
+ case SCE_MODULA_KEYWORD:
+ if( checkStatement( styler, curPos, "IF" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "BEGIN" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "TRY" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "LOOP" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "FOR" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "WHILE" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "REPEAT" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "UNTIL" ) )
+ nextLevel--;
+ else
+ if( checkStatement( styler, curPos, "WITH" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "CASE" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "TYPECASE" ) )
+ nextLevel++;
+ else
+ if( checkStatement( styler, curPos, "LOCK" ) )
+ nextLevel++;
+ else
+ if( checkKeyIdentOper( styler, curPos, endPos, "PROCEDURE", '(' ) )
+ nextLevel++;
+ else
+ if( checkKeyIdentOper( styler, curPos, endPos, "END", ';' ) ) {
+ int cln = curLine;
+ int clv_old = curLevel;
+ int pos;
+ char ch;
+ int clv_new;
+ while( cln > 0 ) {
+ clv_new = styler.LevelAt( cln - 1 ) >> 16;
+ if( clv_new < clv_old ) {
+ nextLevel--;
+ pos = styler.LineStart( cln );
+ while( ( ch = styler.SafeGetCharAt( pos ) ) != '\n' ) {
+ if( ch == 'P' ) {
+ if( styler.StyleAt(pos) == SCE_MODULA_KEYWORD ) {
+ if( checkKeyIdentOper( styler, pos, endPos,
+ "PROCEDURE", '(' ) ) {
+ break;
+ }
+ }
+ }
+ pos++;
+ }
+ clv_old = clv_new;
+ }
+ cln--;
+ }
+ }
+ else
+ if( checkKeyIdentOper( styler, curPos, endPos, "END", '.' ) )
+ nextLevel--;
+ else
+ if( checkEndSemicolon( styler, curPos, endPos ) )
+ nextLevel--;
+ else {
+ while( styler.StyleAt( curPos + 1 ) == SCE_MODULA_KEYWORD )
+ curPos++;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if( IsEOL( styler, curPos ) || ( curPos == endPos - 1 ) ) {
+ int efectiveLevel = curLevel | nextLevel << 16;
+ if( visChars == 0 )
+ efectiveLevel |= SC_FOLDLEVELWHITEFLAG;
+ if( curLevel < nextLevel )
+ efectiveLevel |= SC_FOLDLEVELHEADERFLAG;
+ if( efectiveLevel != styler.LevelAt(curLine) ) {
+ styler.SetLevel(curLine, efectiveLevel );
+ }
+ curLine++;
+ curLevel = nextLevel;
+ if( IsEOL( styler, curPos ) && ( curPos == endPos - 1 ) ) {
+ styler.SetLevel( curLine, ( curLevel | curLevel << 16)
+ | SC_FOLDLEVELWHITEFLAG);
+ }
+ visChars = 0;
+ }
+ curPos++;
+ style = styler.StyleAt( curPos );
+ }
+}
+
+static inline bool skipWhiteSpaces( StyleContext & sc ) {
+ while( isspace( sc.ch ) ) {
+ sc.SetState( SCE_MODULA_DEFAULT );
+ if( sc.More() )
+ sc.Forward();
+ else
+ return false;
+ }
+ return true;
+}
+
+static void ColouriseModulaDoc( unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *wl[],
+ Accessor &styler ) {
+ WordList& keyWords = *wl[0];
+ WordList& reservedWords = *wl[1];
+ WordList& operators = *wl[2];
+ WordList& pragmaWords = *wl[3];
+ WordList& escapeCodes = *wl[4];
+ WordList& doxyKeys = *wl[5];
+
+ const int BUFLEN = 128;
+
+ char buf[BUFLEN];
+ int i, kl;
+
+ int charPos = 0;
+
+ StyleContext sc( startPos, length, initStyle, styler );
+
+ while( sc.More() ) {
+ switch( sc.state ) {
+ case SCE_MODULA_DEFAULT:
+ if( ! skipWhiteSpaces( sc ) ) break;
+
+ if( sc.ch == '(' && sc.chNext == '*' ) {
+ if( sc.GetRelative(2) == '*' ) {
+ sc.SetState( SCE_MODULA_DOXYCOMM );
+ sc.Forward();
+ } else {
+ sc.SetState( SCE_MODULA_COMMENT );
+ }
+ sc.Forward();
+ }
+ else
+ if( isalpha( sc.ch ) ) {
+ if( isupper( sc.ch ) && isupper( sc.chNext ) ) {
+ for( i = 0; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(i);
+ if( !isalpha( buf[i] ) && !(buf[i] == '_') )
+ break;
+ }
+ kl = i;
+ buf[kl] = 0;
+
+ if( keyWords.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_KEYWORD );
+ sc.Forward( kl );
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ else
+ if( reservedWords.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_RESERVED );
+ sc.Forward( kl );
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ } else {
+ /** check procedure identifier */
+ }
+ } else {
+ for( i = 0; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(i);
+ if( !isalpha( buf[i] ) &&
+ !isdigit( buf[i] ) &&
+ !(buf[i] == '_') )
+ break;
+ }
+ kl = i;
+ buf[kl] = 0;
+
+ sc.SetState( SCE_MODULA_DEFAULT );
+ sc.Forward( kl );
+ continue;
+ }
+ }
+ else
+ if( isdigit( sc.ch ) ) {
+ sc.SetState( SCE_MODULA_NUMBER );
+ continue;
+ }
+ else
+ if( sc.ch == '\"' ) {
+ sc.SetState( SCE_MODULA_STRING );
+ }
+ else
+ if( sc.ch == '\'' ) {
+ charPos = sc.currentPos;
+ sc.SetState( SCE_MODULA_CHAR );
+ }
+ else
+ if( sc.ch == '<' && sc.chNext == '*' ) {
+ sc.SetState( SCE_MODULA_PRAGMA );
+ sc.Forward();
+ } else {
+ unsigned len = IsOperator( sc, operators );
+ if( len > 0 ) {
+ sc.SetState( SCE_MODULA_OPERATOR );
+ sc.Forward( len );
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ } else {
+ DEBUG_STATE( sc.currentPos, sc.ch );
+ }
+ }
+ break;
+
+ case SCE_MODULA_COMMENT:
+ if( sc.ch == '*' && sc.chNext == ')' ) {
+ sc.Forward( 2 );
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ break;
+
+ case SCE_MODULA_DOXYCOMM:
+ switch( sc.ch ) {
+ case '*':
+ if( sc.chNext == ')' ) {
+ sc.Forward( 2 );
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ break;
+
+ case '@':
+ if( islower( sc.chNext ) ) {
+ for( i = 0; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(i+1);
+ if( isspace( buf[i] ) ) break;
+ }
+ buf[i] = 0;
+ kl = i;
+
+ if( doxyKeys.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_DOXYKEY );
+ sc.Forward( kl + 1 );
+ sc.SetState( SCE_MODULA_DOXYCOMM );
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case SCE_MODULA_NUMBER:
+ {
+ buf[0] = sc.ch;
+ for( i = 1; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(i);
+ if( ! isdigit( buf[i] ) )
+ break;
+ }
+ kl = i;
+ buf[kl] = 0;
+
+ switch( sc.GetRelative(kl) ) {
+ case '_':
+ {
+ int base = atoi( buf );
+ if( base < 2 || base > 16 ) {
+ sc.SetState( SCE_MODULA_BADSTR );
+ } else {
+ int imax;
+
+ kl++;
+ for( i = 0; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(kl+i);
+ if( ! IsDigitOfBase( buf[i], 16 ) ) {
+ break;
+ }
+ }
+ imax = i;
+ for( i = 0; i < imax; i++ ) {
+ if( ! IsDigitOfBase( buf[i], base ) ) {
+ sc.SetState( SCE_MODULA_BADSTR );
+ break;
+ }
+ }
+ kl += imax;
+ }
+ sc.SetState( SCE_MODULA_BASENUM );
+ for( i = 0; i < kl; i++ ) {
+ sc.Forward();
+ }
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ break;
+
+ case '.':
+ if( sc.GetRelative(kl+1) == '.' ) {
+ kl--;
+ for( i = 0; i < kl; i++ ) {
+ sc.Forward();
+ }
+ sc.Forward();
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ } else {
+ bool doNext = false;
+
+ kl++;
+
+ buf[0] = sc.GetRelative(kl);
+ if( isdigit( buf[0] ) ) {
+ for( i = 0;; i++ ) {
+ if( !isdigit(sc.GetRelative(kl+i)) )
+ break;
+ }
+ kl += i;
+ buf[0] = sc.GetRelative(kl);
+
+ switch( buf[0] )
+ {
+ case 'E':
+ case 'e':
+ case 'D':
+ case 'd':
+ case 'X':
+ case 'x':
+ kl++;
+ buf[0] = sc.GetRelative(kl);
+ if( buf[0] == '-' || buf[0] == '+' ) {
+ kl++;
+ }
+ buf[0] = sc.GetRelative(kl);
+ if( isdigit( buf[0] ) ) {
+ for( i = 0;; i++ ) {
+ if( !isdigit(sc.GetRelative(kl+i)) ) {
+ buf[0] = sc.GetRelative(kl+i);
+ break;
+ }
+ }
+ kl += i;
+ doNext = true;
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+ break;
+
+ default:
+ doNext = true;
+ break;
+ }
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+
+ if( doNext ) {
+ if( ! isspace( buf[0] ) &&
+ buf[0] != ')' &&
+ buf[0] != '>' &&
+ buf[0] != '<' &&
+ buf[0] != '=' &&
+ buf[0] != '#' &&
+ buf[0] != '+' &&
+ buf[0] != '-' &&
+ buf[0] != '*' &&
+ buf[0] != '/' &&
+ buf[0] != ',' &&
+ buf[0] != ';'
+ ) {
+ sc.SetState( SCE_MODULA_BADSTR );
+ } else {
+ kl--;
+ }
+ }
+ }
+ sc.SetState( SCE_MODULA_FLOAT );
+ for( i = 0; i < kl; i++ ) {
+ sc.Forward();
+ }
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ break;
+
+ default:
+ for( i = 0; i < kl; i++ ) {
+ sc.Forward();
+ }
+ break;
+ }
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ break;
+
+ case SCE_MODULA_STRING:
+ if( sc.ch == '\"' ) {
+ sc.Forward();
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ } else {
+ if( sc.ch == '\\' ) {
+ i = 1;
+ if( IsDigitOfBase( sc.chNext, 8 ) ) {
+ for( i = 1; i < BUFLEN - 1; i++ ) {
+ if( ! IsDigitOfBase(sc.GetRelative(i+1), 8 ) )
+ break;
+ }
+ if( i == 3 ) {
+ sc.SetState( SCE_MODULA_STRSPEC );
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+ } else {
+ buf[0] = sc.chNext;
+ buf[1] = 0;
+
+ if( escapeCodes.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_STRSPEC );
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+ }
+ sc.Forward(i+1);
+ sc.SetState( SCE_MODULA_STRING );
+ continue;
+ }
+ }
+ break;
+
+ case SCE_MODULA_CHAR:
+ if( sc.ch == '\'' ) {
+ sc.Forward();
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ else
+ if( ( sc.currentPos - charPos ) == 1 ) {
+ if( sc.ch == '\\' ) {
+ i = 1;
+ if( IsDigitOfBase( sc.chNext, 8 ) ) {
+ for( i = 1; i < BUFLEN - 1; i++ ) {
+ if( ! IsDigitOfBase(sc.GetRelative(i+1), 8 ) )
+ break;
+ }
+ if( i == 3 ) {
+ sc.SetState( SCE_MODULA_CHARSPEC );
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+ } else {
+ buf[0] = sc.chNext;
+ buf[1] = 0;
+
+ if( escapeCodes.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_CHARSPEC );
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ }
+ }
+ sc.Forward(i+1);
+ sc.SetState( SCE_MODULA_CHAR );
+ continue;
+ }
+ } else {
+ sc.SetState( SCE_MODULA_BADSTR );
+ sc.Forward();
+ sc.SetState( SCE_MODULA_CHAR );
+ continue;
+ }
+ break;
+
+ case SCE_MODULA_PRAGMA:
+ if( sc.ch == '*' && sc.chNext == '>' ) {
+ sc.Forward();
+ sc.Forward();
+ sc.SetState( SCE_MODULA_DEFAULT );
+ continue;
+ }
+ else
+ if( isupper( sc.ch ) && isupper( sc.chNext ) ) {
+ buf[0] = sc.ch;
+ buf[1] = sc.chNext;
+ for( i = 2; i < BUFLEN - 1; i++ ) {
+ buf[i] = sc.GetRelative(i);
+ if( !isupper( buf[i] ) )
+ break;
+ }
+ kl = i;
+ buf[kl] = 0;
+ if( pragmaWords.InList( buf ) ) {
+ sc.SetState( SCE_MODULA_PRGKEY );
+ sc.Forward( kl );
+ sc.SetState( SCE_MODULA_PRAGMA );
+ continue;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ sc.Forward();
+ }
+ sc.Complete();
+}
+
+static const char *const modulaWordListDesc[] =
+{
+ "Keywords",
+ "ReservedKeywords",
+ "Operators",
+ "PragmaKeyswords",
+ "EscapeCodes",
+ "DoxygeneKeywords",
+ 0
+};
+
+LexerModule lmModula( SCLEX_MODULA, ColouriseModulaDoc, "modula", FoldModulaDoc,
+ modulaWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMySQL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMySQL.cxx
new file mode 100644
index 00000000000..b873ccda1f1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexMySQL.cxx
@@ -0,0 +1,573 @@
+/**
+ * Scintilla source code edit control
+ * @file LexMySQL.cxx
+ * Lexer for MySQL
+ *
+ * Improved by Mike Lischke <mike.lischke@oracle.com>
+ * Adopted from LexSQL.cxx by Anders Karlsson <anders@mysql.com>
+ * Original work by Neil Hodgson <neilh@scintilla.org>
+ * Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+ * The License.txt file describes the conditions under which this software may be distributed.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return (ch < 0x80) && (isalpha(ch) || ch == '_');
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || toupper(ch) == 'E' ||
+ ch == '.' || ch == '-' || ch == '+');
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Check if the current content context represent a keyword and set the context state if so.
+ */
+static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[], int activeState)
+{
+ int length = sc.LengthCurrent() + 1; // +1 for the next char
+ char* s = new char[length];
+ sc.GetCurrentLowered(s, length);
+ if (keywordlists[0]->InList(s))
+ sc.ChangeState(SCE_MYSQL_MAJORKEYWORD | activeState);
+ else
+ if (keywordlists[1]->InList(s))
+ sc.ChangeState(SCE_MYSQL_KEYWORD | activeState);
+ else
+ if (keywordlists[2]->InList(s))
+ sc.ChangeState(SCE_MYSQL_DATABASEOBJECT | activeState);
+ else
+ if (keywordlists[3]->InList(s))
+ sc.ChangeState(SCE_MYSQL_FUNCTION | activeState);
+ else
+ if (keywordlists[5]->InList(s))
+ sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD | activeState);
+ else
+ if (keywordlists[6]->InList(s))
+ sc.ChangeState(SCE_MYSQL_USER1 | activeState);
+ else
+ if (keywordlists[7]->InList(s))
+ sc.ChangeState(SCE_MYSQL_USER2 | activeState);
+ else
+ if (keywordlists[8]->InList(s))
+ sc.ChangeState(SCE_MYSQL_USER3 | activeState);
+ delete [] s;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+#define HIDDENCOMMAND_STATE 0x40 // Offset for states within a hidden command.
+#define MASKACTIVE(style) (style & ~HIDDENCOMMAND_STATE)
+
+static void SetDefaultState(StyleContext& sc, int activeState)
+{
+ if (activeState == 0)
+ sc.SetState(SCE_MYSQL_DEFAULT);
+ else
+ sc.SetState(SCE_MYSQL_HIDDENCOMMAND);
+}
+
+static void ForwardDefaultState(StyleContext& sc, int activeState)
+{
+ if (activeState == 0)
+ sc.ForwardSetState(SCE_MYSQL_DEFAULT);
+ else
+ sc.ForwardSetState(SCE_MYSQL_HIDDENCOMMAND);
+}
+
+static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler, 127);
+ int activeState = (initStyle == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : initStyle & HIDDENCOMMAND_STATE;
+
+ for (; sc.More(); sc.Forward())
+ {
+ // Determine if the current state should terminate.
+ switch (MASKACTIVE(sc.state))
+ {
+ case SCE_MYSQL_OPERATOR:
+ SetDefaultState(sc, activeState);
+ break;
+ case SCE_MYSQL_NUMBER:
+ // We stop the number definition on non-numerical non-dot non-eE non-sign char.
+ if (!IsANumberChar(sc.ch))
+ SetDefaultState(sc, activeState);
+ break;
+ case SCE_MYSQL_IDENTIFIER:
+ // Switch from identifier to keyword state and open a new state for the new char.
+ if (!IsAWordChar(sc.ch))
+ {
+ CheckForKeyword(sc, keywordlists, activeState);
+
+ // Additional check for function keywords needed.
+ // A function name must be followed by an opening parenthesis.
+ if (MASKACTIVE(sc.state) == SCE_MYSQL_FUNCTION && sc.ch != '(')
+ {
+ if (activeState > 0)
+ sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
+ else
+ sc.ChangeState(SCE_MYSQL_DEFAULT);
+ }
+
+ SetDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_VARIABLE:
+ if (!IsAWordChar(sc.ch))
+ SetDefaultState(sc, activeState);
+ break;
+ case SCE_MYSQL_SYSTEMVARIABLE:
+ if (!IsAWordChar(sc.ch))
+ {
+ int length = sc.LengthCurrent() + 1;
+ char* s = new char[length];
+ sc.GetCurrentLowered(s, length);
+
+ // Check for known system variables here.
+ if (keywordlists[4]->InList(&s[2]))
+ sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE | activeState);
+ delete [] s;
+
+ SetDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_QUOTEDIDENTIFIER:
+ if (sc.ch == '`')
+ {
+ if (sc.chNext == '`')
+ sc.Forward(); // Ignore it
+ else
+ ForwardDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_COMMENT:
+ if (sc.Match('*', '/'))
+ {
+ sc.Forward();
+ ForwardDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_COMMENTLINE:
+ if (sc.atLineStart)
+ SetDefaultState(sc, activeState);
+ break;
+ case SCE_MYSQL_SQSTRING:
+ if (sc.ch == '\\')
+ sc.Forward(); // Escape sequence
+ else
+ if (sc.ch == '\'')
+ {
+ // End of single quoted string reached?
+ if (sc.chNext == '\'')
+ sc.Forward();
+ else
+ ForwardDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_DQSTRING:
+ if (sc.ch == '\\')
+ sc.Forward(); // Escape sequence
+ else
+ if (sc.ch == '\"')
+ {
+ // End of single quoted string reached?
+ if (sc.chNext == '\"')
+ sc.Forward();
+ else
+ ForwardDefaultState(sc, activeState);
+ }
+ break;
+ case SCE_MYSQL_PLACEHOLDER:
+ if (sc.Match('}', '>'))
+ {
+ sc.Forward();
+ ForwardDefaultState(sc, activeState);
+ }
+ break;
+ }
+
+ if (sc.state == SCE_MYSQL_HIDDENCOMMAND && sc.Match('*', '/'))
+ {
+ activeState = 0;
+ sc.Forward();
+ ForwardDefaultState(sc, activeState);
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_MYSQL_DEFAULT || sc.state == SCE_MYSQL_HIDDENCOMMAND)
+ {
+ switch (sc.ch)
+ {
+ case '@':
+ if (sc.chNext == '@')
+ {
+ sc.SetState(SCE_MYSQL_SYSTEMVARIABLE | activeState);
+ sc.Forward(2); // Skip past @@.
+ }
+ else
+ if (IsAWordStart(sc.ch))
+ {
+ sc.SetState(SCE_MYSQL_VARIABLE | activeState);
+ sc.Forward(); // Skip past @.
+ }
+ else
+ sc.SetState(SCE_MYSQL_OPERATOR | activeState);
+ break;
+ case '`':
+ sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER | activeState);
+ break;
+ case '#':
+ sc.SetState(SCE_MYSQL_COMMENTLINE | activeState);
+ break;
+ case '\'':
+ sc.SetState(SCE_MYSQL_SQSTRING | activeState);
+ break;
+ case '\"':
+ sc.SetState(SCE_MYSQL_DQSTRING | activeState);
+ break;
+ default:
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)))
+ sc.SetState(SCE_MYSQL_NUMBER | activeState);
+ else
+ if (IsAWordStart(sc.ch))
+ sc.SetState(SCE_MYSQL_IDENTIFIER | activeState);
+ else
+ if (sc.Match('/', '*'))
+ {
+ sc.SetState(SCE_MYSQL_COMMENT | activeState);
+
+ // Skip comment introducer and check for hidden command.
+ sc.Forward(2);
+ if (sc.ch == '!')
+ {
+ activeState = HIDDENCOMMAND_STATE;
+ sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
+ }
+ }
+ else if (sc.Match('<', '{'))
+ {
+ sc.SetState(SCE_MYSQL_PLACEHOLDER | activeState);
+ }
+ else
+ if (sc.Match("--"))
+ {
+ // Special MySQL single line comment.
+ sc.SetState(SCE_MYSQL_COMMENTLINE | activeState);
+ sc.Forward(2);
+
+ // Check the third character too. It must be a space or EOL.
+ if (sc.ch != ' ' && sc.ch != '\n' && sc.ch != '\r')
+ sc.ChangeState(SCE_MYSQL_OPERATOR | activeState);
+ }
+ else
+ if (isoperator(static_cast<char>(sc.ch)))
+ sc.SetState(SCE_MYSQL_OPERATOR | activeState);
+ }
+ }
+ }
+
+ // Do a final check for keywords if we currently have an identifier, to highlight them
+ // also at the end of a line.
+ if (sc.state == SCE_MYSQL_IDENTIFIER)
+ {
+ CheckForKeyword(sc, keywordlists, activeState);
+
+ // Additional check for function keywords needed.
+ // A function name must be followed by an opening parenthesis.
+ if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(')
+ SetDefaultState(sc, activeState);
+ }
+
+ sc.Complete();
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Helper function to determine if we have a foldable comment currently.
+ */
+static bool IsStreamCommentStyle(int style)
+{
+ return MASKACTIVE(style) == SCE_MYSQL_COMMENT;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
+ * Code copied from StyleContext and modified to work here. Should go into Accessor as a
+ * companion to Match()...
+ */
+bool MatchIgnoreCase(Accessor &styler, int currentPos, const char *s)
+{
+ for (int n = 0; *s; n++)
+ {
+ if (*s != tolower(styler.SafeGetCharAt(currentPos + n)))
+ return false;
+ s++;
+ }
+ return true;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment.
+static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
+{
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0;
+
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
+ int levelNext = levelCurrent;
+
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
+
+ bool endPending = false;
+ bool whenPending = false;
+ bool elseIfPending = false;
+
+ char nextChar = styler.SafeGetCharAt(startPos);
+ for (unsigned int i = startPos; length > 0; i++, length--)
+ {
+ int stylePrev = style;
+ int lastActiveState = activeState;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
+
+ char currentChar = nextChar;
+ nextChar = styler.SafeGetCharAt(i + 1);
+ bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n');
+
+ switch (MASKACTIVE(style))
+ {
+ case SCE_MYSQL_COMMENT:
+ if (foldComment)
+ {
+ // Multiline comment style /* .. */ just started or is still in progress.
+ if (IsStreamCommentStyle(style) && !IsStreamCommentStyle(stylePrev))
+ levelNext++;
+ }
+ break;
+ case SCE_MYSQL_COMMENTLINE:
+ if (foldComment)
+ {
+ // Not really a standard, but we add support for single line comments
+ // with special curly braces syntax as foldable comments too.
+ // MySQL needs -- comments to be followed by space or control char
+ if (styler.Match(i, "--"))
+ {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ char chNext3 = styler.SafeGetCharAt(i + 3);
+ if (chNext2 == '{' || chNext3 == '{')
+ levelNext++;
+ else
+ if (chNext2 == '}' || chNext3 == '}')
+ levelNext--;
+ }
+ }
+ break;
+ case SCE_MYSQL_HIDDENCOMMAND:
+ /*
+ if (endPending)
+ {
+ // A conditional command is not a white space so it should end the current block
+ // before opening a new one.
+ endPending = false;
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ }*/
+ if (activeState != lastActiveState)
+ levelNext++;
+ break;
+ case SCE_MYSQL_OPERATOR:
+ if (endPending)
+ {
+ endPending = false;
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ if (currentChar == '(')
+ levelNext++;
+ else
+ if (currentChar == ')')
+ {
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ break;
+ case SCE_MYSQL_MAJORKEYWORD:
+ case SCE_MYSQL_KEYWORD:
+ case SCE_MYSQL_FUNCTION:
+ case SCE_MYSQL_PROCEDUREKEYWORD:
+ // Reserved and other keywords.
+ if (style != stylePrev)
+ {
+ // END decreases the folding level, regardless which keyword follows.
+ bool endFound = MatchIgnoreCase(styler, i, "end");
+ if (endPending)
+ {
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ else
+ if (!endFound)
+ {
+ if (MatchIgnoreCase(styler, i, "begin"))
+ levelNext++;
+ else
+ {
+ if (!foldOnlyBegin)
+ {
+ bool whileFound = MatchIgnoreCase(styler, i, "while");
+ bool loopFound = MatchIgnoreCase(styler, i, "loop");
+ bool repeatFound = MatchIgnoreCase(styler, i, "repeat");
+ bool caseFound = MatchIgnoreCase(styler, i, "case");
+
+ if (whileFound || loopFound || repeatFound || caseFound)
+ levelNext++;
+ else
+ {
+ // IF alone does not increase the fold level as it is also used in non-block'ed
+ // code like DROP PROCEDURE blah IF EXISTS.
+ // Instead THEN opens the new level (if not part of an ELSEIF or WHEN (case) branch).
+ if (MatchIgnoreCase(styler, i, "then"))
+ {
+ if (!elseIfPending && !whenPending)
+ levelNext++;
+ else
+ {
+ elseIfPending = false;
+ whenPending = false;
+ }
+ }
+ else
+ {
+ // Neither of if/then/while/loop/repeat/case, so check for
+ // sub parts of IF and CASE.
+ if (MatchIgnoreCase(styler, i, "elseif"))
+ elseIfPending = true;
+ if (MatchIgnoreCase(styler, i, "when"))
+ whenPending = true;
+ }
+ }
+ }
+ }
+ }
+
+ // Keep the current end state for the next round.
+ endPending = endFound;
+ }
+ break;
+
+ default:
+ if (!isspacechar(currentChar) && endPending)
+ {
+ // END followed by a non-whitespace character (not covered by other cases like identifiers)
+ // also should end a folding block. Typical case: END followed by self defined delimiter.
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+ break;
+ }
+
+ // Go up one level if we just ended a multi line comment.
+ if (IsStreamCommentStyle(stylePrev) && !IsStreamCommentStyle(style))
+ {
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+
+ if (activeState == 0 && lastActiveState != 0)
+ {
+ // Decrease fold level when we left a hidden command.
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE)
+ levelNext = SC_FOLDLEVELBASE;
+ }
+
+ if (atEOL)
+ {
+ // Apply the new folding level to this line.
+ // Leave pending states as they are otherwise a line break will de-sync
+ // code folding and valid syntax.
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ levelCurrent = levelNext;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(currentChar))
+ visibleChars++;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+
+static const char * const mysqlWordListDesc[] = {
+ "Major Keywords",
+ "Keywords",
+ "Database Objects",
+ "Functions",
+ "System Variables",
+ "Procedure keywords",
+ "User Keywords 1",
+ "User Keywords 2",
+ "User Keywords 3",
+ 0
+};
+
+LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNimrod.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNimrod.cxx
new file mode 100644
index 00000000000..08b76fe6947
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNimrod.cxx
@@ -0,0 +1,433 @@
+// Scintilla source code edit control
+// Nimrod lexer
+// (c) 2009 Andreas Rumpf
+/** @file LexNimrod.cxx
+ ** Lexer for Nimrod.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(int ch) {
+ return (ch >= 0x80) || isalnum(ch) || ch == '_';
+}
+
+static int tillEndOfTripleQuote(Accessor &styler, int pos, int max) {
+ /* search for """ */
+ for (;;) {
+ if (styler.SafeGetCharAt(pos, '\0') == '\0') return pos;
+ if (pos >= max) return pos;
+ if (styler.Match(pos, "\"\"\"")) {
+ return pos + 2;
+ }
+ pos++;
+ }
+}
+
+#define CR 13 /* use both because Scite allows changing the line ending */
+#define LF 10
+
+static bool inline isNewLine(int ch) {
+ return ch == CR || ch == LF;
+}
+
+static int scanString(Accessor &styler, int pos, int max, bool rawMode) {
+ for (;;) {
+ if (pos >= max) return pos;
+ char ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == CR || ch == LF || ch == '\0') return pos;
+ if (ch == '"') return pos;
+ if (ch == '\\' && !rawMode) {
+ pos += 2;
+ } else {
+ pos++;
+ }
+ }
+}
+
+static int scanChar(Accessor &styler, int pos, int max) {
+ for (;;) {
+ if (pos >= max) return pos;
+ char ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == CR || ch == LF || ch == '\0') return pos;
+ if (ch == '\'' && !isalnum(styler.SafeGetCharAt(pos+1, '\0')) )
+ return pos;
+ if (ch == '\\') {
+ pos += 2;
+ } else {
+ pos++;
+ }
+ }
+}
+
+static int scanIdent(Accessor &styler, int pos, WordList &keywords) {
+ char buf[100]; /* copy to lowercase and ignore underscores */
+ int i = 0;
+
+ for (;;) {
+ char ch = styler.SafeGetCharAt(pos, '\0');
+ if (!IsAWordChar(ch)) break;
+ if (ch != '_' && i < ((int)sizeof(buf))-1) {
+ buf[i] = static_cast<char>(tolower(ch));
+ i++;
+ }
+ pos++;
+ }
+ buf[i] = '\0';
+ /* look for keyword */
+ if (keywords.InList(buf)) {
+ styler.ColourTo(pos-1, SCE_P_WORD);
+ } else {
+ styler.ColourTo(pos-1, SCE_P_IDENTIFIER);
+ }
+ return pos;
+}
+
+static int scanNumber(Accessor &styler, int pos) {
+ char ch, ch2;
+ ch = styler.SafeGetCharAt(pos, '\0');
+ ch2 = styler.SafeGetCharAt(pos+1, '\0');
+ if (ch == '0' && (ch2 == 'b' || ch2 == 'B')) {
+ /* binary number: */
+ pos += 2;
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '1')) ++pos;
+ else break;
+ }
+ } else if (ch == '0' &&
+ (ch2 == 'o' || ch2 == 'O' || ch2 == 'c' || ch2 == 'C')) {
+ /* octal number: */
+ pos += 2;
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '7')) ++pos;
+ else break;
+ }
+ } else if (ch == '0' && (ch2 == 'x' || ch2 == 'X')) {
+ /* hexadecimal number: */
+ pos += 2;
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '9')
+ || (ch >= 'a' && ch <= 'f')
+ || (ch >= 'A' && ch <= 'F')) ++pos;
+ else break;
+ }
+ } else {
+ // skip decimal part:
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '9')) ++pos;
+ else break;
+ }
+ ch2 = styler.SafeGetCharAt(pos+1, '\0');
+ if (ch == '.' && ch2 >= '0' && ch2 <= '9') {
+ ++pos; // skip '.'
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '9')) ++pos;
+ else break;
+ }
+ }
+ if (ch == 'e' || ch == 'E') {
+ ++pos;
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '-' || ch == '+') ++pos;
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ if (ch == '_' || (ch >= '0' && ch <= '9')) ++pos;
+ else break;
+ }
+ }
+ }
+ if (ch == '\'') {
+ /* a type suffix: */
+ pos++;
+ for (;;) {
+ ch = styler.SafeGetCharAt(pos);
+ if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z')
+ || (ch >= 'a' && ch <= 'z') || ch == '_') ++pos;
+ else break;
+ }
+ }
+ styler.ColourTo(pos-1, SCE_P_NUMBER);
+ return pos;
+}
+
+/* rewritten from scratch, because I couldn't get rid of the bugs...
+ (A character based approach sucks!)
+*/
+static void ColouriseNimrodDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ int pos = startPos;
+ int max = startPos + length;
+ char ch;
+ WordList &keywords = *keywordlists[0];
+
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+
+ switch (initStyle) {
+ /* check where we are: */
+ case SCE_P_TRIPLEDOUBLE:
+ pos = tillEndOfTripleQuote(styler, pos, max);
+ styler.ColourTo(pos, SCE_P_TRIPLEDOUBLE);
+ pos++;
+ break;
+ default: /* nothing to do: */
+ break;
+ }
+ while (pos < max) {
+ ch = styler.SafeGetCharAt(pos, '\0');
+ switch (ch) {
+ case '\0': return;
+ case '#': {
+ bool doccomment = (styler.SafeGetCharAt(pos+1) == '#');
+ while (pos < max && !isNewLine(styler.SafeGetCharAt(pos, LF))) pos++;
+ if (doccomment)
+ styler.ColourTo(pos, SCE_C_COMMENTLINEDOC);
+ else
+ styler.ColourTo(pos, SCE_P_COMMENTLINE);
+ } break;
+ case 'r': case 'R': {
+ if (styler.SafeGetCharAt(pos+1) == '"') {
+ pos = scanString(styler, pos+2, max, true);
+ styler.ColourTo(pos, SCE_P_STRING);
+ pos++;
+ } else {
+ pos = scanIdent(styler, pos, keywords);
+ }
+ } break;
+ case '"':
+ if (styler.Match(pos+1, "\"\"")) {
+ pos = tillEndOfTripleQuote(styler, pos+3, max);
+ styler.ColourTo(pos, SCE_P_TRIPLEDOUBLE);
+ } else {
+ pos = scanString(styler, pos+1, max, false);
+ styler.ColourTo(pos, SCE_P_STRING);
+ }
+ pos++;
+ break;
+ case '\'':
+ pos = scanChar(styler, pos+1, max);
+ styler.ColourTo(pos, SCE_P_CHARACTER);
+ pos++;
+ break;
+ default: // identifers, numbers, operators, whitespace
+ if (ch >= '0' && ch <= '9') {
+ pos = scanNumber(styler, pos);
+ } else if (IsAWordChar(ch)) {
+ pos = scanIdent(styler, pos, keywords);
+ } else if (ch == '`') {
+ pos++;
+ while (pos < max) {
+ ch = styler.SafeGetCharAt(pos, LF);
+ if (ch == '`') {
+ ++pos;
+ break;
+ }
+ if (ch == CR || ch == LF) break;
+ ++pos;
+ }
+ styler.ColourTo(pos, SCE_P_IDENTIFIER);
+ } else if (strchr("()[]{}:=;-\\/&%$!+<>|^?,.*~@", ch)) {
+ styler.ColourTo(pos, SCE_P_OPERATOR);
+ pos++;
+ } else {
+ styler.ColourTo(pos, SCE_P_DEFAULT);
+ pos++;
+ }
+ break;
+ }
+ }
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ if (ch == '#')
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+
+static bool IsQuoteLine(int line, Accessor &styler) {
+ int style = styler.StyleAt(styler.LineStart(line)) & 31;
+ return ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
+}
+
+
+static void FoldNimrodDoc(unsigned int startPos, int length,
+ int /*initStyle - unused*/,
+ WordList *[], Accessor &styler) {
+ const int maxPos = startPos + length;
+ const int maxLines = styler.GetLine(maxPos - 1); // Requested last line
+ const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
+ const bool foldComment = styler.GetPropertyInt("fold.comment.nimrod") != 0;
+ const bool foldQuotes = styler.GetPropertyInt("fold.quotes.nimrod") != 0;
+
+ // Backtrack to previous non-blank line so we can determine indent level
+ // for any white space lines (needed esp. within triple quoted strings)
+ // and so we can fix any preceding fold level (which is why we go back
+ // at least one line in all cases)
+ int spaceFlags = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ while (lineCurrent > 0) {
+ lineCurrent--;
+ indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) &&
+ (!IsCommentLine(lineCurrent, styler)) &&
+ (!IsQuoteLine(lineCurrent, styler)))
+ break;
+ }
+ int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+
+ // Set up initial loop state
+ startPos = styler.LineStart(lineCurrent);
+ int prev_state = SCE_P_DEFAULT & 31;
+ if (lineCurrent >= 1)
+ prev_state = styler.StyleAt(startPos - 1) & 31;
+ int prevQuote = foldQuotes && ((prev_state == SCE_P_TRIPLE) ||
+ (prev_state == SCE_P_TRIPLEDOUBLE));
+ int prevComment = 0;
+ if (lineCurrent >= 1)
+ prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler);
+
+ // Process all characters to end of requested range or end of any triple quote
+ // or comment that hangs over the end of the range. Cap processing in all cases
+ // to end of document (in case of unclosed quote or comment at end).
+ while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) ||
+ prevQuote || prevComment)) {
+
+ // Gather info
+ int lev = indentCurrent;
+ int lineNext = lineCurrent + 1;
+ int indentNext = indentCurrent;
+ int quote = false;
+ if (lineNext <= docLines) {
+ // Information about next line is only available if not at end of document
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ int style = styler.StyleAt(styler.LineStart(lineNext)) & 31;
+ quote = foldQuotes && ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
+ }
+ const int quote_start = (quote && !prevQuote);
+ const int quote_continue = (quote && prevQuote);
+ const int comment = foldComment && IsCommentLine(lineCurrent, styler);
+ const int comment_start = (comment && !prevComment && (lineNext <= docLines) &&
+ IsCommentLine(lineNext, styler) &&
+ (lev > SC_FOLDLEVELBASE));
+ const int comment_continue = (comment && prevComment);
+ if ((!quote || !prevQuote) && !comment)
+ indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+ if (quote)
+ indentNext = indentCurrentLevel;
+ if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel;
+
+ if (quote_start) {
+ // Place fold point at start of triple quoted string
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (quote_continue || prevQuote) {
+ // Add level to rest of lines in the string
+ lev = lev + 1;
+ } else if (comment_start) {
+ // Place fold point at start of a block of comments
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (comment_continue) {
+ // Add level to rest of lines in the block
+ lev = lev + 1;
+ }
+
+ // Skip past any blank lines for next indent level info; we skip also
+ // comments (all comments, not just those starting in column 0)
+ // which effectively folds them into surrounding code rather
+ // than screwing up folding.
+
+ while (!quote &&
+ (lineNext < docLines) &&
+ ((indentNext & SC_FOLDLEVELWHITEFLAG) ||
+ (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
+
+ lineNext++;
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+
+ const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
+ const int levelBeforeComments =
+ Maximum(indentCurrentLevel,levelAfterComments);
+
+ // Now set all the indent levels on the lines we skipped
+ // Do this from end to start. Once we encounter one line
+ // which is indented more than the line after the end of
+ // the comment-block, use the level of the block before
+
+ int skipLine = lineNext;
+ int skipLevel = levelAfterComments;
+
+ while (--skipLine > lineCurrent) {
+ int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
+ skipLevel = levelBeforeComments;
+
+ int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(skipLine, skipLevel | whiteFlag);
+ }
+
+ // Set fold header on non-quote/non-comment line
+ if (!quote && !comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG) ) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) <
+ (indentNext & SC_FOLDLEVELNUMBERMASK))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+
+ // Keep track of triple quote and block comment state of previous line
+ prevQuote = quote;
+ prevComment = comment_start || comment_continue;
+
+ // Set fold level for this line and move to next line
+ styler.SetLevel(lineCurrent, lev);
+ indentCurrent = indentNext;
+ lineCurrent = lineNext;
+ }
+
+ // NOTE: Cannot set level of last line here because indentCurrent doesn't have
+ // header flag set; the loop above is crafted to take care of this case!
+ //styler.SetLevel(lineCurrent, indentCurrent);
+}
+
+static const char * const nimrodWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmNimrod(SCLEX_NIMROD, ColouriseNimrodDoc, "nimrod", FoldNimrodDoc,
+ nimrodWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNsis.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNsis.cxx
new file mode 100644
index 00000000000..970851475c9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexNsis.cxx
@@ -0,0 +1,662 @@
+// Scintilla source code edit control
+/** @file LexNsis.cxx
+ ** Lexer for NSIS
+ **/
+// Copyright 2003 - 2005 by Angelo Mandato <angelo [at] spaceblue [dot] com>
+// Last Updated: 03/13/2005
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+// located in SciLexer.h
+#define SCLEX_NSIS 43
+
+#define SCE_NSIS_DEFAULT 0
+#define SCE_NSIS_COMMENT 1
+#define SCE_NSIS_STRINGDQ 2
+#define SCE_NSIS_STRINGLQ 3
+#define SCE_NSIS_STRINGRQ 4
+#define SCE_NSIS_FUNCTION 5
+#define SCE_NSIS_VARIABLE 6
+#define SCE_NSIS_LABEL 7
+#define SCE_NSIS_USERDEFINED 8
+#define SCE_NSIS_SECTIONDEF 9
+#define SCE_NSIS_SUBSECTIONDEF 10
+#define SCE_NSIS_IFDEFINEDEF 11
+#define SCE_NSIS_MACRODEF 12
+#define SCE_NSIS_STRINGVAR 13
+#define SCE_NSIS_NUMBER 14
+// ADDED for Scintilla v1.63
+#define SCE_NSIS_SECTIONGROUP 15
+#define SCE_NSIS_PAGEEX 16
+#define SCE_NSIS_FUNCTIONDEF 17
+#define SCE_NSIS_COMMENTBOX 18
+*/
+
+static bool isNsisNumber(char ch)
+{
+ return (ch >= '0' && ch <= '9');
+}
+
+static bool isNsisChar(char ch)
+{
+ return (ch == '.' ) || (ch == '_' ) || isNsisNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
+}
+
+static bool isNsisLetter(char ch)
+{
+ return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
+}
+
+static bool NsisNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler)
+{
+ int nNextLine = -1;
+ for( unsigned int i = start; i < end; i++ )
+ {
+ char cNext = styler.SafeGetCharAt( i );
+ if( cNext == '\n' )
+ {
+ nNextLine = i+1;
+ break;
+ }
+ }
+
+ if( nNextLine == -1 ) // We never found the next line...
+ return false;
+
+ for( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ )
+ {
+ char cNext = styler.SafeGetCharAt( firstChar );
+ if( cNext == ' ' )
+ continue;
+ if( cNext == '\t' )
+ continue;
+ if( cNext == '!' )
+ {
+ if( styler.Match(firstChar, "!else") )
+ return true;
+ }
+ break;
+ }
+
+ return false;
+}
+
+static int NsisCmp( const char *s1, const char *s2, bool bIgnoreCase )
+{
+ if( bIgnoreCase )
+ return CompareCaseInsensitive( s1, s2);
+
+ return strcmp( s1, s2 );
+}
+
+static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse, bool foldUtilityCmd )
+{
+ int style = styler.StyleAt(end);
+
+ // If the word is too long, it is not what we are looking for
+ if( end - start > 20 )
+ return foldlevel;
+
+ if( foldUtilityCmd )
+ {
+ // Check the style at this point, if it is not valid, then return zero
+ if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF &&
+ style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_IFDEFINEDEF &&
+ style != SCE_NSIS_MACRODEF && style != SCE_NSIS_SECTIONGROUP &&
+ style != SCE_NSIS_PAGEEX )
+ return foldlevel;
+ }
+ else
+ {
+ if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF &&
+ style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_SECTIONGROUP &&
+ style != SCE_NSIS_PAGEEX )
+ return foldlevel;
+ }
+
+ int newFoldlevel = foldlevel;
+ bool bIgnoreCase = false;
+ if( styler.GetPropertyInt("nsis.ignorecase") == 1 )
+ bIgnoreCase = true;
+
+ char s[20]; // The key word we are looking for has atmost 13 characters
+ s[0] = '\0';
+ for (unsigned int i = 0; i < end - start + 1 && i < 19; i++)
+ {
+ s[i] = static_cast<char>( styler[ start + i ] );
+ s[i + 1] = '\0';
+ }
+
+ if( s[0] == '!' )
+ {
+ if( NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 || NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!macro", bIgnoreCase ) == 0 )
+ newFoldlevel++;
+ else if( NsisCmp(s, "!endif", bIgnoreCase) == 0 || NsisCmp(s, "!macroend", bIgnoreCase ) == 0 )
+ newFoldlevel--;
+ else if( bElse && NsisCmp(s, "!else", bIgnoreCase) == 0 )
+ newFoldlevel++;
+ }
+ else
+ {
+ if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionGroup", bIgnoreCase ) == 0 || NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "SubSection", bIgnoreCase ) == 0 || NsisCmp(s, "PageEx", bIgnoreCase ) == 0 )
+ newFoldlevel++;
+ else if( NsisCmp(s, "SectionGroupEnd", bIgnoreCase ) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase ) == 0 )
+ newFoldlevel--;
+ }
+
+ return newFoldlevel;
+}
+
+static int classifyWordNsis(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler )
+{
+ bool bIgnoreCase = false;
+ if( styler.GetPropertyInt("nsis.ignorecase") == 1 )
+ bIgnoreCase = true;
+
+ bool bUserVars = false;
+ if( styler.GetPropertyInt("nsis.uservars") == 1 )
+ bUserVars = true;
+
+ char s[100];
+ s[0] = '\0';
+ s[1] = '\0';
+
+ WordList &Functions = *keywordLists[0];
+ WordList &Variables = *keywordLists[1];
+ WordList &Lables = *keywordLists[2];
+ WordList &UserDefined = *keywordLists[3];
+
+ for (unsigned int i = 0; i < end - start + 1 && i < 99; i++)
+ {
+ if( bIgnoreCase )
+ s[i] = static_cast<char>( tolower(styler[ start + i ] ) );
+ else
+ s[i] = static_cast<char>( styler[ start + i ] );
+ s[i + 1] = '\0';
+ }
+
+ // Check for special words...
+ if( NsisCmp(s, "!macro", bIgnoreCase ) == 0 || NsisCmp(s, "!macroend", bIgnoreCase) == 0 ) // Covers !macro and !macroend
+ return SCE_NSIS_MACRODEF;
+
+ if( NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!endif", bIgnoreCase) == 0 ) // Covers !ifdef, !ifndef and !endif
+ return SCE_NSIS_IFDEFINEDEF;
+
+ if( NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!else", bIgnoreCase ) == 0 ) // Covers !if and else
+ return SCE_NSIS_IFDEFINEDEF;
+
+ if (NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 ) // Covers !ifmacrodef and !ifnmacrodef
+ return SCE_NSIS_IFDEFINEDEF;
+
+ if( NsisCmp(s, "SectionGroup", bIgnoreCase) == 0 || NsisCmp(s, "SectionGroupEnd", bIgnoreCase) == 0 ) // Covers SectionGroup and SectionGroupEnd
+ return SCE_NSIS_SECTIONGROUP;
+
+ if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase) == 0 ) // Covers Section and SectionEnd
+ return SCE_NSIS_SECTIONDEF;
+
+ if( NsisCmp(s, "SubSection", bIgnoreCase) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase) == 0 ) // Covers SubSection and SubSectionEnd
+ return SCE_NSIS_SUBSECTIONDEF;
+
+ if( NsisCmp(s, "PageEx", bIgnoreCase) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase) == 0 ) // Covers PageEx and PageExEnd
+ return SCE_NSIS_PAGEEX;
+
+ if( NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 ) // Covers Function and FunctionEnd
+ return SCE_NSIS_FUNCTIONDEF;
+
+ if ( Functions.InList(s) )
+ return SCE_NSIS_FUNCTION;
+
+ if ( Variables.InList(s) )
+ return SCE_NSIS_VARIABLE;
+
+ if ( Lables.InList(s) )
+ return SCE_NSIS_LABEL;
+
+ if( UserDefined.InList(s) )
+ return SCE_NSIS_USERDEFINED;
+
+ if( strlen(s) > 3 )
+ {
+ if( s[1] == '{' && s[strlen(s)-1] == '}' )
+ return SCE_NSIS_VARIABLE;
+ }
+
+ // See if the variable is a user defined variable
+ if( s[0] == '$' && bUserVars )
+ {
+ bool bHasSimpleNsisChars = true;
+ for (unsigned int j = 1; j < end - start + 1 && j < 99; j++)
+ {
+ if( !isNsisChar( s[j] ) )
+ {
+ bHasSimpleNsisChars = false;
+ break;
+ }
+ }
+
+ if( bHasSimpleNsisChars )
+ return SCE_NSIS_VARIABLE;
+ }
+
+ // To check for numbers
+ if( isNsisNumber( s[0] ) )
+ {
+ bool bHasSimpleNsisNumber = true;
+ for (unsigned int j = 1; j < end - start + 1 && j < 99; j++)
+ {
+ if( !isNsisNumber( s[j] ) )
+ {
+ bHasSimpleNsisNumber = false;
+ break;
+ }
+ }
+
+ if( bHasSimpleNsisNumber )
+ return SCE_NSIS_NUMBER;
+ }
+
+ return SCE_NSIS_DEFAULT;
+}
+
+static void ColouriseNsisDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)
+{
+ int state = SCE_NSIS_DEFAULT;
+ if( startPos > 0 )
+ state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox
+
+ styler.StartAt( startPos );
+ styler.GetLine( startPos );
+
+ unsigned int nLengthDoc = startPos + length;
+ styler.StartSegment( startPos );
+
+ char cCurrChar;
+ bool bVarInString = false;
+ bool bClassicVarInString = false;
+
+ unsigned int i;
+ for( i = startPos; i < nLengthDoc; i++ )
+ {
+ cCurrChar = styler.SafeGetCharAt( i );
+ char cNextChar = styler.SafeGetCharAt(i+1);
+
+ switch(state)
+ {
+ case SCE_NSIS_DEFAULT:
+ if( cCurrChar == ';' || cCurrChar == '#' ) // we have a comment line
+ {
+ styler.ColourTo(i-1, state );
+ state = SCE_NSIS_COMMENT;
+ break;
+ }
+ if( cCurrChar == '"' )
+ {
+ styler.ColourTo(i-1, state );
+ state = SCE_NSIS_STRINGDQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+ if( cCurrChar == '\'' )
+ {
+ styler.ColourTo(i-1, state );
+ state = SCE_NSIS_STRINGRQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+ if( cCurrChar == '`' )
+ {
+ styler.ColourTo(i-1, state );
+ state = SCE_NSIS_STRINGLQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ break;
+ }
+
+ // NSIS KeyWord,Function, Variable, UserDefined:
+ if( cCurrChar == '$' || isNsisChar(cCurrChar) || cCurrChar == '!' )
+ {
+ styler.ColourTo(i-1,state);
+ state = SCE_NSIS_FUNCTION;
+
+ // If it is a number, we must check and set style here first...
+ if( isNsisNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) )
+ styler.ColourTo( i, SCE_NSIS_NUMBER);
+
+ break;
+ }
+
+ if( cCurrChar == '/' && cNextChar == '*' )
+ {
+ styler.ColourTo(i-1,state);
+ state = SCE_NSIS_COMMENTBOX;
+ break;
+ }
+
+ break;
+ case SCE_NSIS_COMMENT:
+ if( cNextChar == '\n' || cNextChar == '\r' )
+ {
+ // Special case:
+ if( cCurrChar == '\\' )
+ {
+ styler.ColourTo(i-2,state);
+ styler.ColourTo(i,SCE_NSIS_DEFAULT);
+ }
+ else
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ }
+ }
+ break;
+ case SCE_NSIS_STRINGDQ:
+ case SCE_NSIS_STRINGLQ:
+ case SCE_NSIS_STRINGRQ:
+
+ if( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' )
+ break; // Ignore the next character, even if it is a quote of some sort
+
+ if( cCurrChar == '"' && state == SCE_NSIS_STRINGDQ )
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ break;
+ }
+
+ if( cCurrChar == '`' && state == SCE_NSIS_STRINGLQ )
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ break;
+ }
+
+ if( cCurrChar == '\'' && state == SCE_NSIS_STRINGRQ )
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ break;
+ }
+
+ if( cNextChar == '\r' || cNextChar == '\n' )
+ {
+ int nCurLine = styler.GetLine(i+1);
+ int nBack = i;
+ // We need to check if the previous line has a \ in it...
+ bool bNextLine = false;
+
+ while( nBack > 0 )
+ {
+ if( styler.GetLine(nBack) != nCurLine )
+ break;
+
+ char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here
+
+ if( cTemp == '\\' )
+ {
+ bNextLine = true;
+ break;
+ }
+ if( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' )
+ break;
+
+ nBack--;
+ }
+
+ if( bNextLine )
+ {
+ styler.ColourTo(i+1,state);
+ }
+ if( bNextLine == false )
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ }
+ }
+ break;
+
+ case SCE_NSIS_FUNCTION:
+
+ // NSIS KeyWord:
+ if( cCurrChar == '$' )
+ state = SCE_NSIS_DEFAULT;
+ else if( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) )
+ state = SCE_NSIS_DEFAULT;
+ else if( (isNsisChar(cCurrChar) && !isNsisChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' )
+ {
+ state = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler );
+ styler.ColourTo( i, state);
+ state = SCE_NSIS_DEFAULT;
+ }
+ else if( !isNsisChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' )
+ {
+ if( classifyWordNsis( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_NSIS_NUMBER )
+ styler.ColourTo( i-1, SCE_NSIS_NUMBER );
+
+ state = SCE_NSIS_DEFAULT;
+
+ if( cCurrChar == '"' )
+ {
+ state = SCE_NSIS_STRINGDQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if( cCurrChar == '`' )
+ {
+ state = SCE_NSIS_STRINGLQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if( cCurrChar == '\'' )
+ {
+ state = SCE_NSIS_STRINGRQ;
+ bVarInString = false;
+ bClassicVarInString = false;
+ }
+ else if( cCurrChar == '#' || cCurrChar == ';' )
+ {
+ state = SCE_NSIS_COMMENT;
+ }
+ }
+ break;
+ case SCE_NSIS_COMMENTBOX:
+
+ if( styler.SafeGetCharAt(i-1) == '*' && cCurrChar == '/' )
+ {
+ styler.ColourTo(i,state);
+ state = SCE_NSIS_DEFAULT;
+ }
+ break;
+ }
+
+ if( state == SCE_NSIS_COMMENT || state == SCE_NSIS_COMMENTBOX )
+ {
+ styler.ColourTo(i,state);
+ }
+ else if( state == SCE_NSIS_STRINGDQ || state == SCE_NSIS_STRINGLQ || state == SCE_NSIS_STRINGRQ )
+ {
+ bool bIngoreNextDollarSign = false;
+ bool bUserVars = false;
+ if( styler.GetPropertyInt("nsis.uservars") == 1 )
+ bUserVars = true;
+
+ if( bVarInString && cCurrChar == '$' )
+ {
+ bVarInString = false;
+ bIngoreNextDollarSign = true;
+ }
+ else if( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) )
+ {
+ styler.ColourTo( i+1, SCE_NSIS_STRINGVAR);
+ bVarInString = false;
+ bIngoreNextDollarSign = false;
+ }
+
+ // Covers "$INSTDIR and user vars like $MYVAR"
+ else if( bVarInString && !isNsisChar(cNextChar) )
+ {
+ int nWordState = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler);
+ if( nWordState == SCE_NSIS_VARIABLE )
+ styler.ColourTo( i, SCE_NSIS_STRINGVAR);
+ else if( bUserVars )
+ styler.ColourTo( i, SCE_NSIS_STRINGVAR);
+ bVarInString = false;
+ }
+ // Covers "${TEST}..."
+ else if( bClassicVarInString && cNextChar == '}' )
+ {
+ styler.ColourTo( i+1, SCE_NSIS_STRINGVAR);
+ bClassicVarInString = false;
+ }
+
+ // Start of var in string
+ if( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' )
+ {
+ styler.ColourTo( i-1, state);
+ bClassicVarInString = true;
+ bVarInString = false;
+ }
+ else if( !bIngoreNextDollarSign && cCurrChar == '$' )
+ {
+ styler.ColourTo( i-1, state);
+ bVarInString = true;
+ bClassicVarInString = false;
+ }
+ }
+ }
+
+ // Colourise remaining document
+ styler.ColourTo(nLengthDoc-1,state);
+}
+
+static void FoldNsisDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ // No folding enabled, no reason to continue...
+ if( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1;
+ bool foldUtilityCmd = styler.GetPropertyInt("nsis.foldutilcmd", 1) == 1;
+ bool blockComment = false;
+
+ int lineCurrent = styler.GetLine(startPos);
+ unsigned int safeStartPos = styler.LineStart( lineCurrent );
+
+ bool bArg1 = true;
+ int nWordStart = -1;
+
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+ int style = styler.StyleAt(safeStartPos);
+ if( style == SCE_NSIS_COMMENTBOX )
+ {
+ if( styler.SafeGetCharAt(safeStartPos) == '/' && styler.SafeGetCharAt(safeStartPos+1) == '*' )
+ levelNext++;
+ blockComment = true;
+ }
+
+ for (unsigned int i = safeStartPos; i < startPos + length; i++)
+ {
+ char chCurr = styler.SafeGetCharAt(i);
+ style = styler.StyleAt(i);
+ if( blockComment && style != SCE_NSIS_COMMENTBOX )
+ {
+ levelNext--;
+ blockComment = false;
+ }
+ else if( !blockComment && style == SCE_NSIS_COMMENTBOX )
+ {
+ levelNext++;
+ blockComment = true;
+ }
+
+ if( bArg1 && !blockComment)
+ {
+ if( nWordStart == -1 && (isNsisLetter(chCurr) || chCurr == '!') )
+ {
+ nWordStart = i;
+ }
+ else if( isNsisLetter(chCurr) == false && nWordStart > -1 )
+ {
+ int newLevel = calculateFoldNsis( nWordStart, i-1, levelNext, styler, foldAtElse, foldUtilityCmd );
+
+ if( newLevel == levelNext )
+ {
+ if( foldAtElse && foldUtilityCmd )
+ {
+ if( NsisNextLineHasElse(i, startPos + length, styler) )
+ levelNext--;
+ }
+ }
+ else
+ levelNext = newLevel;
+ bArg1 = false;
+ }
+ }
+
+ if( chCurr == '\n' )
+ {
+ if( bArg1 && foldAtElse && foldUtilityCmd && !blockComment )
+ {
+ if( NsisNextLineHasElse(i, startPos + length, styler) )
+ levelNext--;
+ }
+
+ // If we are on a new line...
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (levelUse < levelNext )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ levelCurrent = levelNext;
+ bArg1 = true; // New line, lets look at first argument again
+ nWordStart = -1;
+ }
+ }
+
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+}
+
+static const char * const nsisWordLists[] = {
+ "Functions",
+ "Variables",
+ "Lables",
+ "UserDefined",
+ 0, };
+
+
+LexerModule lmNsis(SCLEX_NSIS, ColouriseNsisDoc, "nsis", FoldNsisDoc, nsisWordLists);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOScript.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOScript.cxx
new file mode 100644
index 00000000000..9daff34d5af
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOScript.cxx
@@ -0,0 +1,548 @@
+// Scintilla source code edit control
+/** @file LexOScript.cxx
+ ** Lexer for OScript sources; ocx files and/or OSpace dumps.
+ ** OScript is a programming language used to develop applications for the
+ ** Livelink server platform.
+ **/
+// Written by Ferdinand Prantl <prantlf@gmail.com>, inspired by the code from
+// LexVB.cxx and LexPascal.cxx. The License.txt file describes the conditions
+// under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// -----------------------------------------
+// Functions classifying a single character.
+
+// This function is generic and should be probably moved to CharSet.h where
+// IsAlphaNumeric the others reside.
+inline bool IsAlpha(int ch) {
+ return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
+}
+
+static inline bool IsIdentifierChar(int ch) {
+ // Identifiers cannot contain non-ASCII letters; a word with non-English
+ // language-specific characters cannot be an identifier.
+ return IsAlphaNumeric(ch) || ch == '_';
+}
+
+static inline bool IsIdentifierStart(int ch) {
+ // Identifiers cannot contain non-ASCII letters; a word with non-English
+ // language-specific characters cannot be an identifier.
+ return IsAlpha(ch) || ch == '_';
+}
+
+static inline bool IsNumberChar(int ch, int chNext) {
+ // Numeric constructs are not checked for lexical correctness. They are
+ // expected to look like +1.23-E9 but actually any bunch of the following
+ // characters will be styled as number.
+ // KNOWN PROBLEM: if you put + or - operators immediately after a number
+ // and the next operand starts with the letter E, the operator will not be
+ // recognized and it will be styled together with the preceding number.
+ // This should not occur; at least not often. The coding style recommends
+ // putting spaces around operators.
+ return IsADigit(ch) || toupper(ch) == 'E' || ch == '.' ||
+ ((ch == '-' || ch == '+') && toupper(chNext) == 'E');
+}
+
+// This function checks for the start or a natural number without any symbols
+// or operators as a prefix; the IsPrefixedNumberStart should be called
+// immediately after this one to cover all possible numeric constructs.
+static inline bool IsNaturalNumberStart(int ch) {
+ return IsADigit(ch) != 0;
+}
+
+static inline bool IsPrefixedNumberStart(int ch, int chNext) {
+ // KNOWN PROBLEM: if you put + or - operators immediately before a number
+ // the operator will not be recognized and it will be styled together with
+ // the succeeding number. This should not occur; at least not often. The
+ // coding style recommends putting spaces around operators.
+ return (ch == '.' || ch == '-' || ch == '+') && IsADigit(chNext);
+}
+
+static inline bool IsOperator(int ch) {
+ return strchr("%^&*()-+={}[]:;<>,/?!.~|\\", ch) != NULL;
+}
+
+// ---------------------------------------------------------------
+// Functions classifying a token currently processed in the lexer.
+
+// Checks if the current line starts with the preprocessor directive used
+// usually to introduce documentation comments: #ifdef DOC. This method is
+// supposed to be called if the line has been recognized as a preprocessor
+// directive already.
+static bool IsDocCommentStart(StyleContext &sc) {
+ // Check the line back to its start only if the end looks promising.
+ if (sc.LengthCurrent() == 10 && !IsAlphaNumeric(sc.ch)) {
+ char s[11];
+ sc.GetCurrentLowered(s, sizeof(s));
+ return strcmp(s, "#ifdef doc") == 0;
+ }
+ return false;
+}
+
+// Checks if the current line starts with the preprocessor directive that
+// is complementary to the #ifdef DOC start: #endif. This method is supposed
+// to be called if the current state point to the documentation comment.
+// QUESTIONAL ASSUMPTION: The complete #endif directive is not checked; just
+// the starting #e. However, there is no other preprocessor directive with
+// the same starting letter and thus this optimization should always work.
+static bool IsDocCommentEnd(StyleContext &sc) {
+ return sc.ch == '#' && sc.chNext == 'e';
+}
+
+class IdentifierClassifier {
+ WordList &keywords; // Passed from keywords property.
+ WordList &constants; // Passed from keywords2 property.
+ WordList &operators; // Passed from keywords3 property.
+ WordList &types; // Passed from keywords4 property.
+ WordList &functions; // Passed from keywords5 property.
+ WordList &objects; // Passed from keywords6 property.
+
+ IdentifierClassifier(IdentifierClassifier const&);
+ IdentifierClassifier& operator=(IdentifierClassifier const&);
+
+public:
+ IdentifierClassifier(WordList *keywordlists[]) :
+ keywords(*keywordlists[0]), constants(*keywordlists[1]),
+ operators(*keywordlists[2]), types(*keywordlists[3]),
+ functions(*keywordlists[4]), objects(*keywordlists[5])
+ {}
+
+ void ClassifyIdentifier(StyleContext &sc) {
+ // Opening parenthesis following an identifier makes it a possible
+ // function call.
+ // KNOWN PROBLEM: If some whitespace is inserted between the
+ // identifier and the parenthesis they will not be able to be
+ // recognized as a function call. This should not occur; at
+ // least not often. Such coding style would be weird.
+ if (sc.Match('(')) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ // Before an opening brace can be control statements and
+ // operators too; function call is the last option.
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_KEYWORD);
+ } else if (operators.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_OPERATOR);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_FUNCTION);
+ } else {
+ sc.ChangeState(SCE_OSCRIPT_METHOD);
+ }
+ sc.SetState(SCE_OSCRIPT_OPERATOR);
+ } else {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ // A dot following an identifier means an access to an object
+ // member. The related object identifier can be special.
+ // KNOWN PROBLEM: If there is whitespace between the identifier
+ // and the following dot, the identifier will not be recognized
+ // as an object in an object member access. If it is one of the
+ // listed static objects it will not be styled.
+ if (sc.Match('.') && objects.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_OBJECT);
+ sc.SetState(SCE_OSCRIPT_OPERATOR);
+ } else {
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_KEYWORD);
+ } else if (constants.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_CONSTANT);
+ } else if (operators.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_OPERATOR);
+ } else if (types.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_TYPE);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_OSCRIPT_FUNCTION);
+ }
+ sc.SetState(SCE_OSCRIPT_DEFAULT);
+ }
+ }
+ }
+};
+
+// ------------------------------------------------
+// Function colourising an excerpt of OScript code.
+
+static void ColouriseOScriptDoc(unsigned int startPos, int length,
+ int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ // I wonder how whole-line styles ended by EOLN can escape the resetting
+ // code in the loop below and overflow to the next line. Let us make sure
+ // that a new line does not start with them carried from the previous one.
+ // NOTE: An overflowing string is intentionally not checked; it reminds
+ // the developer that the string must be ended on the same line.
+ if (initStyle == SCE_OSCRIPT_LINE_COMMENT ||
+ initStyle == SCE_OSCRIPT_PREPROCESSOR) {
+ initStyle = SCE_OSCRIPT_DEFAULT;
+ }
+
+ styler.StartAt(startPos);
+ StyleContext sc(startPos, length, initStyle, styler);
+ IdentifierClassifier identifierClassifier(keywordlists);
+
+ // It starts with true at the beginning of a line and changes to false as
+ // soon as the first non-whitespace character has been processed.
+ bool isFirstToken = true;
+ // It starts with true at the beginning of a line and changes to false as
+ // soon as the first identifier on the line is passed by.
+ bool isFirstIdentifier = true;
+ // It becomes false when #ifdef DOC (the preprocessor directive often
+ // used to start a documentation comment) is encountered and remain false
+ // until the end of the documentation block is not detected. This is done
+ // by checking for the complementary #endif preprocessor directive.
+ bool endDocComment = false;
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ isFirstToken = true;
+ isFirstIdentifier = true;
+ // Detect the current state is neither whitespace nor identifier. It
+ // means that no next identifier can be the first token on the line.
+ } else if (isFirstIdentifier && sc.state != SCE_OSCRIPT_DEFAULT &&
+ sc.state != SCE_OSCRIPT_IDENTIFIER) {
+ isFirstIdentifier = false;
+ }
+
+ // Check if the current state should be changed.
+ if (sc.state == SCE_OSCRIPT_OPERATOR) {
+ // Multiple-symbol operators are marked by single characters.
+ sc.SetState(SCE_OSCRIPT_DEFAULT);
+ } else if (sc.state == SCE_OSCRIPT_IDENTIFIER) {
+ if (!IsIdentifierChar(sc.ch)) {
+ // Colon after an identifier makes it a label if it is the
+ // first token on the line.
+ // KNOWN PROBLEM: If some whitespace is inserted between the
+ // identifier and the colon they will not be recognized as a
+ // label. This should not occur; at least not often. It would
+ // make the code structure less legible and examples in the
+ // Livelink documentation do not show it.
+ if (sc.Match(':') && isFirstIdentifier) {
+ sc.ChangeState(SCE_OSCRIPT_LABEL);
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ } else {
+ identifierClassifier.ClassifyIdentifier(sc);
+ }
+ // Avoid a sequence of two words be mistaken for a label. A
+ // switch case would be an example.
+ isFirstIdentifier = false;
+ }
+ } else if (sc.state == SCE_OSCRIPT_GLOBAL) {
+ if (!IsIdentifierChar(sc.ch)) {
+ sc.SetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_PROPERTY) {
+ if (!IsIdentifierChar(sc.ch)) {
+ // Any member access introduced by the dot operator is
+ // initially marked as a property access. If an opening
+ // parenthesis is detected later it is changed to method call.
+ // KNOWN PROBLEM: The same as at the function call recognition
+ // for SCE_OSCRIPT_IDENTIFIER above.
+ if (sc.Match('(')) {
+ sc.ChangeState(SCE_OSCRIPT_METHOD);
+ }
+ sc.SetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_NUMBER) {
+ if (!IsNumberChar(sc.ch, sc.chNext)) {
+ sc.SetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_SINGLEQUOTE_STRING) {
+ if (sc.ch == '\'') {
+ // Two consequential apostrophes convert to a single one.
+ if (sc.chNext == '\'') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_DOUBLEQUOTE_STRING) {
+ if (sc.ch == '\"') {
+ // Two consequential quotation marks convert to a single one.
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_BLOCK_COMMENT) {
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_LINE_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_PREPROCESSOR) {
+ if (IsDocCommentStart(sc)) {
+ sc.ChangeState(SCE_OSCRIPT_DOC_COMMENT);
+ endDocComment = false;
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ } else if (sc.state == SCE_OSCRIPT_DOC_COMMENT) {
+ // KNOWN PROBLEM: The first line detected that would close a
+ // conditional preprocessor block (#endif) the documentation
+ // comment block will end. (Nested #if-#endif blocks are not
+ // supported. Hopefully it will not occur often that a line
+ // within the text block would stat with #endif.
+ if (isFirstToken && IsDocCommentEnd(sc)) {
+ endDocComment = true;
+ } else if (sc.atLineEnd && endDocComment) {
+ sc.ForwardSetState(SCE_OSCRIPT_DEFAULT);
+ }
+ }
+
+ // Check what state starts with the current character.
+ if (sc.state == SCE_OSCRIPT_DEFAULT) {
+ if (sc.Match('\'')) {
+ sc.SetState(SCE_OSCRIPT_SINGLEQUOTE_STRING);
+ } else if (sc.Match('\"')) {
+ sc.SetState(SCE_OSCRIPT_DOUBLEQUOTE_STRING);
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_OSCRIPT_LINE_COMMENT);
+ sc.Forward();
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_OSCRIPT_BLOCK_COMMENT);
+ sc.Forward();
+ } else if (isFirstToken && sc.Match('#')) {
+ sc.SetState(SCE_OSCRIPT_PREPROCESSOR);
+ } else if (sc.Match('$')) {
+ // Both process-global ($xxx) and thread-global ($$xxx)
+ // variables are handled as one global.
+ sc.SetState(SCE_OSCRIPT_GLOBAL);
+ } else if (IsNaturalNumberStart(sc.ch)) {
+ sc.SetState(SCE_OSCRIPT_NUMBER);
+ } else if (IsPrefixedNumberStart(sc.ch, sc.chNext)) {
+ sc.SetState(SCE_OSCRIPT_NUMBER);
+ sc.Forward();
+ } else if (sc.Match('.') && IsIdentifierStart(sc.chNext)) {
+ // Every object member access is marked as a property access
+ // initially. The decision between property and method is made
+ // after parsing the identifier and looking what comes then.
+ // KNOWN PROBLEM: If there is whitespace between the following
+ // identifier and the dot, the dot will not be recognized
+ // as a member accessing operator. In turn, the identifier
+ // will not be recognizable as a property or a method too.
+ sc.SetState(SCE_OSCRIPT_OPERATOR);
+ sc.Forward();
+ sc.SetState(SCE_OSCRIPT_PROPERTY);
+ } else if (IsIdentifierStart(sc.ch)) {
+ sc.SetState(SCE_OSCRIPT_IDENTIFIER);
+ } else if (IsOperator(sc.ch)) {
+ sc.SetState(SCE_OSCRIPT_OPERATOR);
+ }
+ }
+
+ if (isFirstToken && !IsASpaceOrTab(sc.ch)) {
+ isFirstToken = false;
+ }
+ }
+
+ sc.Complete();
+}
+
+// ------------------------------------------
+// Functions supporting OScript code folding.
+
+static inline bool IsBlockComment(int style) {
+ return style == SCE_OSCRIPT_BLOCK_COMMENT;
+}
+
+static bool IsLineComment(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eolPos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eolPos; i++) {
+ char ch = styler[i];
+ char chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+ if (ch == '/' && chNext == '/' && style == SCE_OSCRIPT_LINE_COMMENT) {
+ return true;
+ } else if (!IsASpaceOrTab(ch)) {
+ return false;
+ }
+ }
+ return false;
+}
+
+static inline bool IsPreprocessor(int style) {
+ return style == SCE_OSCRIPT_PREPROCESSOR ||
+ style == SCE_OSCRIPT_DOC_COMMENT;
+}
+
+static void GetRangeLowered(unsigned int start, unsigned int end,
+ Accessor &styler, char *s, unsigned int len) {
+ unsigned int i = 0;
+ while (i < end - start + 1 && i < len - 1) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void GetForwardWordLowered(unsigned int start, Accessor &styler,
+ char *s, unsigned int len) {
+ unsigned int i = 0;
+ while (i < len - 1 && IsAlpha(styler.SafeGetCharAt(start + i))) {
+ s[i] = static_cast<char>(tolower(styler.SafeGetCharAt(start + i)));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void UpdatePreprocessorFoldLevel(int &levelCurrent,
+ unsigned int startPos, Accessor &styler) {
+ char s[7]; // Size of the longest possible keyword + null.
+ GetForwardWordLowered(startPos, styler, s, sizeof(s));
+
+ if (strcmp(s, "ifdef") == 0 ||
+ strcmp(s, "ifndef") == 0) {
+ levelCurrent++;
+ } else if (strcmp(s, "endif") == 0) {
+ levelCurrent--;
+ if (levelCurrent < SC_FOLDLEVELBASE) {
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+static void UpdateKeywordFoldLevel(int &levelCurrent, unsigned int lastStart,
+ unsigned int currentPos, Accessor &styler) {
+ char s[9];
+ GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s));
+
+ if (strcmp(s, "if") == 0 || strcmp(s, "for") == 0 ||
+ strcmp(s, "switch") == 0 || strcmp(s, "function") == 0 ||
+ strcmp(s, "while") == 0 || strcmp(s, "repeat") == 0) {
+ levelCurrent++;
+ } else if (strcmp(s, "end") == 0 || strcmp(s, "until") == 0) {
+ levelCurrent--;
+ if (levelCurrent < SC_FOLDLEVELBASE) {
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+// ------------------------------
+// Function folding OScript code.
+
+static void FoldOScriptDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int lastStart = 0;
+
+ for (int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atLineEnd = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (foldComment && IsBlockComment(style)) {
+ if (!IsBlockComment(stylePrev)) {
+ levelCurrent++;
+ } else if (!IsBlockComment(styleNext) && !atLineEnd) {
+ // Comments do not end at end of line and the next character
+ // may not be styled.
+ levelCurrent--;
+ }
+ }
+ if (foldComment && atLineEnd && IsLineComment(lineCurrent, styler)) {
+ if (!IsLineComment(lineCurrent - 1, styler) &&
+ IsLineComment(lineCurrent + 1, styler))
+ levelCurrent++;
+ else if (IsLineComment(lineCurrent - 1, styler) &&
+ !IsLineComment(lineCurrent+1, styler))
+ levelCurrent--;
+ }
+ if (foldPreprocessor) {
+ if (ch == '#' && IsPreprocessor(style)) {
+ UpdatePreprocessorFoldLevel(levelCurrent, i + 1, styler);
+ }
+ }
+
+ if (stylePrev != SCE_OSCRIPT_KEYWORD && style == SCE_OSCRIPT_KEYWORD) {
+ lastStart = i;
+ }
+ if (stylePrev == SCE_OSCRIPT_KEYWORD) {
+ if(IsIdentifierChar(ch) && !IsIdentifierChar(chNext)) {
+ UpdateKeywordFoldLevel(levelCurrent, lastStart, i, styler);
+ }
+ }
+
+ if (!IsASpace(ch))
+ visibleChars++;
+
+ if (atLineEnd) {
+ int level = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ level |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ level |= SC_FOLDLEVELHEADERFLAG;
+ if (level != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, level);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ }
+
+ // If we did not reach EOLN in the previous loop, store the line level and
+ // whitespace information. The rest will be filled in later.
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ styler.SetLevel(lineCurrent, lev);
+}
+
+// --------------------------------------------
+// Declaration of the OScript lexer descriptor.
+
+static const char * const oscriptWordListDesc[] = {
+ "Keywords and reserved words",
+ "Literal constants",
+ "Literal operators",
+ "Built-in value and reference types",
+ "Built-in global functions",
+ "Built-in static objects",
+ 0
+};
+
+LexerModule lmOScript(SCLEX_OSCRIPT, ColouriseOScriptDoc, "oscript", FoldOScriptDoc, oscriptWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOpal.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOpal.cxx
new file mode 100644
index 00000000000..df487e63a50
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOpal.cxx
@@ -0,0 +1,525 @@
+// Scintilla source code edit control
+/** @file LexOpal.cxx
+ ** Lexer for OPAL (functional language similar to Haskell)
+ ** Written by Sebastian Pipping <webmaster@hartwork.org>
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+inline static void getRange( unsigned int start, unsigned int end, Accessor & styler, char * s, unsigned int len )
+{
+ unsigned int i = 0;
+ while( ( i < end - start + 1 ) && ( i < len - 1 ) )
+ {
+ s[i] = static_cast<char>( styler[ start + i ] );
+ i++;
+ }
+ s[ i ] = '\0';
+}
+
+inline bool HandleString( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
+{
+ char ch;
+
+ // Wait for string to close
+ bool even_backslash_count = true; // Without gaps in between
+ cur++; // Skip initial quote
+ for( ; ; )
+ {
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_STRING );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( ( ch == '\015' ) || ( ch == '\012' ) ) // Deny multi-line strings
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_STRING );
+ styler.StartSegment( cur );
+ return true;
+ }
+ else
+ {
+ if( even_backslash_count )
+ {
+ if( ch == '"' )
+ {
+ styler.ColourTo( cur, SCE_OPAL_STRING );
+ cur++;
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ else if( ch == '\\' )
+ {
+ even_backslash_count = false;
+ }
+ }
+ else
+ {
+ even_backslash_count = true;
+ }
+ }
+
+ cur++;
+ }
+}
+
+inline bool HandleCommentBlock( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
+{
+ char ch;
+
+ if( could_fail )
+ {
+ cur++;
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( ch != '*' )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+
+ // Wait for comment close
+ cur++;
+ bool star_found = false;
+ for( ; ; )
+ {
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_BLOCK );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( star_found )
+ {
+ if( ch == '/' )
+ {
+ styler.ColourTo( cur, SCE_OPAL_COMMENT_BLOCK );
+ cur++;
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ else if( ch != '*' )
+ {
+ star_found = false;
+ }
+ }
+ else if( ch == '*' )
+ {
+ star_found = true;
+ }
+ cur++;
+ }
+}
+
+inline bool HandleCommentLine( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
+{
+ char ch;
+
+ if( could_fail )
+ {
+ cur++;
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( ch != '-' )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ styler.StartSegment( cur );
+ return true;
+ }
+
+ cur++;
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( ( ch != ' ' ) && ( ch != '\t' ) )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+
+ // Wait for end of line
+ bool fifteen_found = false;
+
+ for( ; ; )
+ {
+ cur++;
+
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( fifteen_found )
+ {
+/*
+ if( ch == '\012' )
+ {
+ // One newline on Windows (015, 012)
+ }
+ else
+ {
+ // One newline on MAC (015) and another char
+ }
+*/
+ cur--;
+ styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
+ styler.StartSegment( cur );
+ return true;
+ }
+ else
+ {
+ if( ch == '\015' )
+ {
+ fifteen_found = true;
+ }
+ else if( ch == '\012' )
+ {
+ // One newline on Linux (012)
+ styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ }
+}
+
+inline bool HandlePar( unsigned int & cur, Accessor & styler )
+{
+ styler.ColourTo( cur, SCE_OPAL_PAR );
+
+ cur++;
+
+ styler.StartSegment( cur );
+ return true;
+}
+
+inline bool HandleSpace( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
+{
+ char ch;
+
+ cur++;
+ for( ; ; )
+ {
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
+ return false;
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ switch( ch )
+ {
+ case ' ':
+ case '\t':
+ case '\015':
+ case '\012':
+ cur++;
+ break;
+
+ default:
+ styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+}
+
+inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
+{
+ char ch;
+
+ for( ; ; )
+ {
+ cur++;
+ if( cur >= one_too_much )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
+ return false; // STOP
+ }
+
+ ch = styler.SafeGetCharAt( cur );
+ if( !( IsASCII( ch ) && isdigit( ch ) ) )
+ {
+ styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+}
+
+inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor & styler, WordList * keywordlists[] )
+{
+ char ch;
+ const unsigned int beg = cur;
+
+ cur++;
+ for( ; ; )
+ {
+ ch = styler.SafeGetCharAt( cur );
+ if( ( ch != '_' ) && ( ch != '-' ) &&
+ !( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break;
+
+ cur++;
+ if( cur >= one_too_much )
+ {
+ break;
+ }
+ }
+
+ const int ide_len = cur - beg + 1;
+ char * ide = new char[ ide_len ];
+ getRange( beg, cur, styler, ide, ide_len );
+
+ WordList & keywords = *keywordlists[ 0 ];
+ WordList & classwords = *keywordlists[ 1 ];
+
+ if( keywords.InList( ide ) ) // Keyword
+ {
+ delete [] ide;
+
+ styler.ColourTo( cur - 1, SCE_OPAL_KEYWORD );
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ else if( classwords.InList( ide ) ) // Sort
+ {
+ delete [] ide;
+
+ styler.ColourTo( cur - 1, SCE_OPAL_SORT );
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ else if( !strcmp( ide, "true" ) || !strcmp( ide, "false" ) ) // Bool const
+ {
+ delete [] ide;
+
+ styler.ColourTo( cur - 1, SCE_OPAL_BOOL_CONST );
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+ else // Unknown keyword
+ {
+ delete [] ide;
+
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+ }
+
+}
+
+inline bool HandleSkip( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
+{
+ cur++;
+ styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
+ if( cur >= one_too_much )
+ {
+ return false; // STOP
+ }
+ else
+ {
+ styler.StartSegment( cur );
+ return true;
+ }
+}
+
+static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor & styler )
+{
+ styler.StartAt( startPos );
+ styler.StartSegment( startPos );
+
+ unsigned int & cur = startPos;
+ const unsigned int one_too_much = startPos + length;
+
+ int state = initStyle;
+
+ for( ; ; )
+ {
+ switch( state )
+ {
+ case SCE_OPAL_KEYWORD:
+ case SCE_OPAL_SORT:
+ if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
+ state = SCE_OPAL_DEFAULT;
+ break;
+
+ case SCE_OPAL_INTEGER:
+ if( !HandleInteger( cur, one_too_much, styler ) ) return;
+ state = SCE_OPAL_DEFAULT;
+ break;
+
+ case SCE_OPAL_COMMENT_BLOCK:
+ if( !HandleCommentBlock( cur, one_too_much, styler, false ) ) return;
+ state = SCE_OPAL_DEFAULT;
+ break;
+
+ case SCE_OPAL_COMMENT_LINE:
+ if( !HandleCommentLine( cur, one_too_much, styler, false ) ) return;
+ state = SCE_OPAL_DEFAULT;
+ break;
+
+ case SCE_OPAL_STRING:
+ if( !HandleString( cur, one_too_much, styler ) ) return;
+ state = SCE_OPAL_DEFAULT;
+ break;
+
+ default: // SCE_OPAL_DEFAULT:
+ {
+ char ch = styler.SafeGetCharAt( cur );
+
+ switch( ch )
+ {
+ // String
+ case '"':
+ if( !HandleString( cur, one_too_much, styler ) ) return;
+ break;
+
+ // Comment block
+ case '/':
+ if( !HandleCommentBlock( cur, one_too_much, styler, true ) ) return;
+ break;
+
+ // Comment line
+ case '-':
+ if( !HandleCommentLine( cur, one_too_much, styler, true ) ) return;
+ break;
+
+ // Par
+ case '(':
+ case ')':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ if( !HandlePar( cur, styler ) ) return;
+ break;
+
+ // Whitespace
+ case ' ':
+ case '\t':
+ case '\015':
+ case '\012':
+ if( !HandleSpace( cur, one_too_much, styler ) ) return;
+ break;
+
+ default:
+ {
+ // Integer
+ if( IsASCII( ch ) && isdigit( ch ) )
+ {
+ if( !HandleInteger( cur, one_too_much, styler ) ) return;
+ }
+
+ // Keyword
+ else if( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) ) )
+ {
+ if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
+
+ }
+
+ // Skip
+ else
+ {
+ if( !HandleSkip( cur, one_too_much, styler ) ) return;
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+static const char * const opalWordListDesc[] = {
+ "Keywords",
+ "Sorts",
+ 0
+};
+
+LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", NULL, opalWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOthers.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOthers.cxx
new file mode 100644
index 00000000000..f1e828dc87d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexOthers.cxx
@@ -0,0 +1,1149 @@
+// Scintilla source code edit control
+/** @file LexOthers.cxx
+ ** Lexers for batch files, diff results, properties files, make files and error lists.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static bool strstart(const char *haystack, const char *needle) {
+ return strncmp(haystack, needle, strlen(needle)) == 0;
+}
+
+static bool Is0To9(char ch) {
+ return (ch >= '0') && (ch <= '9');
+}
+
+static bool Is1To9(char ch) {
+ return (ch >= '1') && (ch <= '9');
+}
+
+static bool IsAlphabetic(int ch) {
+ return IsASCII(ch) && isalpha(ch);
+}
+
+static inline bool AtEOL(Accessor &styler, unsigned int i) {
+ return (styler[i] == '\n') ||
+ ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n'));
+}
+
+// Tests for BATCH Operators
+static bool IsBOperator(char ch) {
+ return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') ||
+ (ch == '|') || (ch == '?') || (ch == '*');
+}
+
+// Tests for BATCH Separators
+static bool IsBSeparator(char ch) {
+ return (ch == '\\') || (ch == '.') || (ch == ';') ||
+ (ch == '\"') || (ch == '\'') || (ch == '/');
+}
+
+static void ColouriseBatchLine(
+ char *lineBuffer,
+ unsigned int lengthLine,
+ unsigned int startLine,
+ unsigned int endPos,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ unsigned int offset = 0; // Line Buffer Offset
+ unsigned int cmdLoc; // External Command / Program Location
+ char wordBuffer[81]; // Word Buffer - large to catch long paths
+ unsigned int wbl; // Word Buffer Length
+ unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length
+ WordList &keywords = *keywordlists[0]; // Internal Commands
+ WordList &keywords2 = *keywordlists[1]; // External Commands (optional)
+
+ // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords
+ // Toggling Regular Keyword Checking off improves readability
+ // Other Regular Keywords and External Commands / Programs might also benefit from toggling
+ // Need a more robust algorithm to properly toggle Regular Keyword Checking
+ bool continueProcessing = true; // Used to toggle Regular Keyword Checking
+ // Special Keywords are those that allow certain characters without whitespace after the command
+ // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path=
+ // Special Keyword Buffer used to determine if the first n characters is a Keyword
+ char sKeywordBuffer[10]; // Special Keyword Buffer
+ bool sKeywordFound; // Exit Special Keyword for-loop if found
+
+ // Skip initial spaces
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+ // Set External Command / Program Location
+ cmdLoc = offset;
+
+ // Check for Fake Label (Comment) or Real Label - return if found
+ if (lineBuffer[offset] == ':') {
+ if (lineBuffer[offset + 1] == ':') {
+ // Colorize Fake Label (Comment) - :: is similar to REM, see http://content.techweb.com/winmag/columns/explorer/2000/21.htm
+ styler.ColourTo(endPos, SCE_BAT_COMMENT);
+ } else {
+ // Colorize Real Label
+ styler.ColourTo(endPos, SCE_BAT_LABEL);
+ }
+ return;
+ // Check for Drive Change (Drive Change is internal command) - return if found
+ } else if ((IsAlphabetic(lineBuffer[offset])) &&
+ (lineBuffer[offset + 1] == ':') &&
+ ((isspacechar(lineBuffer[offset + 2])) ||
+ (((lineBuffer[offset + 2] == '\\')) &&
+ (isspacechar(lineBuffer[offset + 3]))))) {
+ // Colorize Regular Keyword
+ styler.ColourTo(endPos, SCE_BAT_WORD);
+ return;
+ }
+
+ // Check for Hide Command (@ECHO OFF/ON)
+ if (lineBuffer[offset] == '@') {
+ styler.ColourTo(startLine + offset, SCE_BAT_HIDE);
+ offset++;
+ }
+ // Skip next spaces
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+
+ // Read remainder of line word-at-a-time or remainder-of-word-at-a-time
+ while (offset < lengthLine) {
+ if (offset > startLine) {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+ }
+ // Copy word from Line Buffer into Word Buffer
+ wbl = 0;
+ for (; offset < lengthLine && wbl < 80 &&
+ !isspacechar(lineBuffer[offset]); wbl++, offset++) {
+ wordBuffer[wbl] = static_cast<char>(tolower(lineBuffer[offset]));
+ }
+ wordBuffer[wbl] = '\0';
+ wbo = 0;
+
+ // Check for Comment - return if found
+ if (CompareCaseInsensitive(wordBuffer, "rem") == 0) {
+ styler.ColourTo(endPos, SCE_BAT_COMMENT);
+ return;
+ }
+ // Check for Separator
+ if (IsBSeparator(wordBuffer[0])) {
+ // Check for External Command / Program
+ if ((cmdLoc == offset - wbl) &&
+ ((wordBuffer[0] == ':') ||
+ (wordBuffer[0] == '\\') ||
+ (wordBuffer[0] == '.'))) {
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ // Colorize External Command / Program
+ if (!keywords2) {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
+ } else if (keywords2.InList(wordBuffer)) {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
+ } else {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+ }
+ // Reset External Command / Program Location
+ cmdLoc = offset;
+ } else {
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+ }
+ // Check for Regular Keyword in list
+ } else if ((keywords.InList(wordBuffer)) &&
+ (continueProcessing)) {
+ // ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking
+ if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "goto") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "prompt") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "set") == 0)) {
+ continueProcessing = false;
+ }
+ // Identify External Command / Program Location for ERRORLEVEL, and EXIST
+ if ((CompareCaseInsensitive(wordBuffer, "errorlevel") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "exist") == 0)) {
+ // Reset External Command / Program Location
+ cmdLoc = offset;
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Skip comparison
+ while ((cmdLoc < lengthLine) &&
+ (!isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Identify External Command / Program Location for CALL, DO, LOADHIGH and LH
+ } else if ((CompareCaseInsensitive(wordBuffer, "call") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "do") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "loadhigh") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "lh") == 0)) {
+ // Reset External Command / Program Location
+ cmdLoc = offset;
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ }
+ // Colorize Regular keyword
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_WORD);
+ // No need to Reset Offset
+ // Check for Special Keyword in list, External Command / Program, or Default Text
+ } else if ((wordBuffer[0] != '%') &&
+ (wordBuffer[0] != '!') &&
+ (!IsBOperator(wordBuffer[0])) &&
+ (continueProcessing)) {
+ // Check for Special Keyword
+ // Affected Commands are in Length range 2-6
+ // Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected
+ sKeywordFound = false;
+ for (unsigned int keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) {
+ wbo = 0;
+ // Copy Keyword Length from Word Buffer into Special Keyword Buffer
+ for (; wbo < keywordLength; wbo++) {
+ sKeywordBuffer[wbo] = static_cast<char>(wordBuffer[wbo]);
+ }
+ sKeywordBuffer[wbo] = '\0';
+ // Check for Special Keyword in list
+ if ((keywords.InList(sKeywordBuffer)) &&
+ ((IsBOperator(wordBuffer[wbo])) ||
+ (IsBSeparator(wordBuffer[wbo])))) {
+ sKeywordFound = true;
+ // ECHO requires no further Regular Keyword Checking
+ if (CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) {
+ continueProcessing = false;
+ }
+ // Colorize Special Keyword as Regular Keyword
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+ }
+ // Check for External Command / Program or Default Text
+ if (!sKeywordFound) {
+ wbo = 0;
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ // Read up to %, Operator or Separator
+ while ((wbo < wbl) &&
+ (wordBuffer[wbo] != '%') &&
+ (wordBuffer[wbo] != '!') &&
+ (!IsBOperator(wordBuffer[wbo])) &&
+ (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Reset External Command / Program Location
+ cmdLoc = offset - (wbl - wbo);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ // CHOICE requires no further Regular Keyword Checking
+ if (CompareCaseInsensitive(wordBuffer, "choice") == 0) {
+ continueProcessing = false;
+ }
+ // Check for START (and its switches) - What follows is External Command \ Program
+ if (CompareCaseInsensitive(wordBuffer, "start") == 0) {
+ // Reset External Command / Program Location
+ cmdLoc = offset;
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Reset External Command / Program Location if command switch detected
+ if (lineBuffer[cmdLoc] == '/') {
+ // Skip command switch
+ while ((cmdLoc < lengthLine) &&
+ (!isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ }
+ }
+ // Colorize External Command / Program
+ if (!keywords2) {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
+ } else if (keywords2.InList(wordBuffer)) {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
+ } else {
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+ }
+ // No need to Reset Offset
+ // Check for Default Text
+ } else {
+ // Read up to %, Operator or Separator
+ while ((wbo < wbl) &&
+ (wordBuffer[wbo] != '%') &&
+ (wordBuffer[wbo] != '!') &&
+ (!IsBOperator(wordBuffer[wbo])) &&
+ (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+ }
+ // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a)
+ } else if (wordBuffer[0] == '%') {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT);
+ wbo++;
+ // Search to end of word for second % (can be a long path)
+ while ((wbo < wbl) &&
+ (wordBuffer[wbo] != '%') &&
+ (!IsBOperator(wordBuffer[wbo])) &&
+ (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Check for Argument (%n) or (%*)
+ if (((Is0To9(wordBuffer[1])) || (wordBuffer[1] == '*')) &&
+ (wordBuffer[wbo] != '%')) {
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ cmdLoc = offset - (wbl - 2);
+ }
+ // Colorize Argument
+ styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 2);
+ // Check for Expanded Argument (%~...) / Variable (%%~...)
+ } else if (((wbl > 1) && (wordBuffer[1] == '~')) ||
+ ((wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] == '~'))) {
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ cmdLoc = offset - (wbl - wbo);
+ }
+ // Colorize Expanded Argument / Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ // Check for Environment Variable (%x...%)
+ } else if ((wordBuffer[1] != '%') &&
+ (wordBuffer[wbo] == '%')) {
+ wbo++;
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ cmdLoc = offset - (wbl - wbo);
+ }
+ // Colorize Environment Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ // Check for Local Variable (%%a)
+ } else if (
+ (wbl > 2) &&
+ (wordBuffer[1] == '%') &&
+ (wordBuffer[2] != '%') &&
+ (!IsBOperator(wordBuffer[2])) &&
+ (!IsBSeparator(wordBuffer[2]))) {
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ cmdLoc = offset - (wbl - 3);
+ }
+ // Colorize Local Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - 3), SCE_BAT_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 3);
+ }
+ // Check for Environment Variable (!x...!)
+ } else if (wordBuffer[0] == '!') {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT);
+ wbo++;
+ // Search to end of word for second ! (can be a long path)
+ while ((wbo < wbl) &&
+ (wordBuffer[wbo] != '!') &&
+ (!IsBOperator(wordBuffer[wbo])) &&
+ (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ if (wordBuffer[wbo] == '!') {
+ wbo++;
+ // Check for External Command / Program
+ if (cmdLoc == offset - wbl) {
+ cmdLoc = offset - (wbl - wbo);
+ }
+ // Colorize Environment Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+ // Check for Operator
+ } else if (IsBOperator(wordBuffer[0])) {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT);
+ // Check for Comparison Operator
+ if ((wordBuffer[0] == '=') && (wordBuffer[1] == '=')) {
+ // Identify External Command / Program Location for IF
+ cmdLoc = offset;
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Colorize Comparison Operator
+ styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_OPERATOR);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 2);
+ // Check for Pipe Operator
+ } else if (wordBuffer[0] == '|') {
+ // Reset External Command / Program Location
+ cmdLoc = offset - wbl + 1;
+ // Skip next spaces
+ while ((cmdLoc < lengthLine) &&
+ (isspacechar(lineBuffer[cmdLoc]))) {
+ cmdLoc++;
+ }
+ // Colorize Pipe Operator
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ // Check for Other Operator
+ } else {
+ // Check for > Operator
+ if (wordBuffer[0] == '>') {
+ // Turn Keyword and External Command / Program checking back on
+ continueProcessing = true;
+ }
+ // Colorize Other Operator
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ }
+ // Check for Default Text
+ } else {
+ // Read up to %, Operator or Separator
+ while ((wbo < wbl) &&
+ (wordBuffer[wbo] != '%') &&
+ (wordBuffer[wbo] != '!') &&
+ (!IsBOperator(wordBuffer[wbo])) &&
+ (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+ // Skip next spaces - nothing happens if Offset was Reset
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+ }
+ // Colorize Default Text for remainder of line - currently not lexed
+ styler.ColourTo(endPos, SCE_BAT_DEFAULT);
+}
+
+static void ColouriseBatchDoc(
+ unsigned int startPos,
+ int length,
+ int /*initStyle*/,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ char lineBuffer[1024];
+
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ unsigned int startLine = startPos;
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywordlists, styler);
+ linePos = 0;
+ startLine = i + 1;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ lineBuffer[linePos] = '\0';
+ ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1,
+ keywordlists, styler);
+ }
+}
+
+#define DIFF_BUFFER_START_SIZE 16
+// Note that ColouriseDiffLine analyzes only the first DIFF_BUFFER_START_SIZE
+// characters of each line to classify the line.
+
+static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) {
+ // It is needed to remember the current state to recognize starting
+ // comment lines before the first "diff " or "--- ". If a real
+ // difference starts then each line starting with ' ' is a whitespace
+ // otherwise it is considered a comment (Only in..., Binary file...)
+ if (0 == strncmp(lineBuffer, "diff ", 5)) {
+ styler.ColourTo(endLine, SCE_DIFF_COMMAND);
+ } else if (0 == strncmp(lineBuffer, "Index: ", 7)) { // For subversion's diff
+ styler.ColourTo(endLine, SCE_DIFF_COMMAND);
+ } else if (0 == strncmp(lineBuffer, "---", 3) && lineBuffer[3] != '-') {
+ // In a context diff, --- appears in both the header and the position markers
+ if (lineBuffer[3] == ' ' && atoi(lineBuffer + 4) && !strchr(lineBuffer, '/'))
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ else if (lineBuffer[3] == '\r' || lineBuffer[3] == '\n')
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ else
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (0 == strncmp(lineBuffer, "+++ ", 4)) {
+ // I don't know of any diff where "+++ " is a position marker, but for
+ // consistency, do the same as with "--- " and "*** ".
+ if (atoi(lineBuffer+4) && !strchr(lineBuffer, '/'))
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ else
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (0 == strncmp(lineBuffer, "====", 4)) { // For p4's diff
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (0 == strncmp(lineBuffer, "***", 3)) {
+ // In a context diff, *** appears in both the header and the position markers.
+ // Also ******** is a chunk header, but here it's treated as part of the
+ // position marker since there is no separate style for a chunk header.
+ if (lineBuffer[3] == ' ' && atoi(lineBuffer+4) && !strchr(lineBuffer, '/'))
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ else if (lineBuffer[3] == '*')
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ else
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (0 == strncmp(lineBuffer, "? ", 2)) { // For difflib
+ styler.ColourTo(endLine, SCE_DIFF_HEADER);
+ } else if (lineBuffer[0] == '@') {
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ } else if (lineBuffer[0] >= '0' && lineBuffer[0] <= '9') {
+ styler.ColourTo(endLine, SCE_DIFF_POSITION);
+ } else if (lineBuffer[0] == '-' || lineBuffer[0] == '<') {
+ styler.ColourTo(endLine, SCE_DIFF_DELETED);
+ } else if (lineBuffer[0] == '+' || lineBuffer[0] == '>') {
+ styler.ColourTo(endLine, SCE_DIFF_ADDED);
+ } else if (lineBuffer[0] == '!') {
+ styler.ColourTo(endLine, SCE_DIFF_CHANGED);
+ } else if (lineBuffer[0] != ' ') {
+ styler.ColourTo(endLine, SCE_DIFF_COMMENT);
+ } else {
+ styler.ColourTo(endLine, SCE_DIFF_DEFAULT);
+ }
+}
+
+static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ char lineBuffer[DIFF_BUFFER_START_SIZE] = "";
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ if (AtEOL(styler, i)) {
+ if (linePos < DIFF_BUFFER_START_SIZE) {
+ lineBuffer[linePos] = 0;
+ }
+ ColouriseDiffLine(lineBuffer, i, styler);
+ linePos = 0;
+ } else if (linePos < DIFF_BUFFER_START_SIZE - 1) {
+ lineBuffer[linePos++] = styler[i];
+ } else if (linePos == DIFF_BUFFER_START_SIZE - 1) {
+ lineBuffer[linePos++] = 0;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ if (linePos < DIFF_BUFFER_START_SIZE) {
+ lineBuffer[linePos] = 0;
+ }
+ ColouriseDiffLine(lineBuffer, startPos + length - 1, styler);
+ }
+}
+
+static void FoldDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ int curLine = styler.GetLine(startPos);
+ int curLineStart = styler.LineStart(curLine);
+ int prevLevel = curLine > 0 ? styler.LevelAt(curLine - 1) : SC_FOLDLEVELBASE;
+ int nextLevel;
+
+ do {
+ int lineType = styler.StyleAt(curLineStart);
+ if (lineType == SCE_DIFF_COMMAND)
+ nextLevel = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ else if (lineType == SCE_DIFF_HEADER)
+ nextLevel = (SC_FOLDLEVELBASE + 1) | SC_FOLDLEVELHEADERFLAG;
+ else if (lineType == SCE_DIFF_POSITION && styler[curLineStart] != '-')
+ nextLevel = (SC_FOLDLEVELBASE + 2) | SC_FOLDLEVELHEADERFLAG;
+ else if (prevLevel & SC_FOLDLEVELHEADERFLAG)
+ nextLevel = (prevLevel & SC_FOLDLEVELNUMBERMASK) + 1;
+ else
+ nextLevel = prevLevel;
+
+ if ((nextLevel & SC_FOLDLEVELHEADERFLAG) && (nextLevel == prevLevel))
+ styler.SetLevel(curLine-1, prevLevel & ~SC_FOLDLEVELHEADERFLAG);
+
+ styler.SetLevel(curLine, nextLevel);
+ prevLevel = nextLevel;
+
+ curLineStart = styler.LineStart(++curLine);
+ } while (static_cast<int>(startPos) + length > curLineStart);
+}
+
+static inline bool isassignchar(unsigned char ch) {
+ return (ch == '=') || (ch == ':');
+}
+
+static void ColourisePropsLine(
+ char *lineBuffer,
+ unsigned int lengthLine,
+ unsigned int startLine,
+ unsigned int endPos,
+ Accessor &styler,
+ bool allowInitialSpaces) {
+
+ unsigned int i = 0;
+ if (allowInitialSpaces) {
+ while ((i < lengthLine) && isspacechar(lineBuffer[i])) // Skip initial spaces
+ i++;
+ } else {
+ if (isspacechar(lineBuffer[i])) // don't allow initial spaces
+ i = lengthLine;
+ }
+
+ if (i < lengthLine) {
+ if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') {
+ styler.ColourTo(endPos, SCE_PROPS_COMMENT);
+ } else if (lineBuffer[i] == '[') {
+ styler.ColourTo(endPos, SCE_PROPS_SECTION);
+ } else if (lineBuffer[i] == '@') {
+ styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL);
+ if (isassignchar(lineBuffer[i++]))
+ styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
+ styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
+ } else {
+ // Search for the '=' character
+ while ((i < lengthLine) && !isassignchar(lineBuffer[i]))
+ i++;
+ if ((i < lengthLine) && isassignchar(lineBuffer[i])) {
+ styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY);
+ styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
+ styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
+ } else {
+ styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
+ }
+ }
+ } else {
+ styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
+ }
+}
+
+static void ColourisePropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ char lineBuffer[1024];
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ unsigned int startLine = startPos;
+
+ // property lexer.props.allow.initial.spaces
+ // For properties files, set to 0 to style all lines that start with whitespace in the default style.
+ // This is not suitable for SciTE .properties files which use indentation for flow control but
+ // can be used for RFC2822 text where indentation is used for continuation lines.
+ bool allowInitialSpaces = styler.GetPropertyInt("lexer.props.allow.initial.spaces", 1) != 0;
+
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColourisePropsLine(lineBuffer, linePos, startLine, i, styler, allowInitialSpaces);
+ linePos = 0;
+ startLine = i + 1;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length - 1, styler, allowInitialSpaces);
+ }
+}
+
+// adaption by ksc, using the "} else {" trick of 1.53
+// 030721
+static void FoldPropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ bool headerPoint = false;
+ int lev;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler[i+1];
+
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (style == SCE_PROPS_SECTION) {
+ headerPoint = true;
+ }
+
+ if (atEOL) {
+ lev = SC_FOLDLEVELBASE;
+
+ if (lineCurrent > 0) {
+ int levelPrevious = styler.LevelAt(lineCurrent - 1);
+
+ if (levelPrevious & SC_FOLDLEVELHEADERFLAG) {
+ lev = SC_FOLDLEVELBASE + 1;
+ } else {
+ lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
+ }
+ }
+
+ if (headerPoint) {
+ lev = SC_FOLDLEVELBASE;
+ }
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+
+ if (headerPoint) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+
+ lineCurrent++;
+ visibleChars = 0;
+ headerPoint = false;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ if (lineCurrent > 0) {
+ int levelPrevious = styler.LevelAt(lineCurrent - 1);
+ if (levelPrevious & SC_FOLDLEVELHEADERFLAG) {
+ lev = SC_FOLDLEVELBASE + 1;
+ } else {
+ lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
+ }
+ } else {
+ lev = SC_FOLDLEVELBASE;
+ }
+ int flagsNext = styler.LevelAt(lineCurrent);
+ styler.SetLevel(lineCurrent, lev | (flagsNext & ~SC_FOLDLEVELNUMBERMASK));
+}
+
+static void ColouriseMakeLine(
+ char *lineBuffer,
+ unsigned int lengthLine,
+ unsigned int startLine,
+ unsigned int endPos,
+ Accessor &styler) {
+
+ unsigned int i = 0;
+ int lastNonSpace = -1;
+ unsigned int state = SCE_MAKE_DEFAULT;
+ bool bSpecial = false;
+
+ // check for a tab character in column 0 indicating a command
+ bool bCommand = false;
+ if ((lengthLine > 0) && (lineBuffer[0] == '\t'))
+ bCommand = true;
+
+ // Skip initial spaces
+ while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
+ i++;
+ }
+ if (i < lengthLine) {
+ if (lineBuffer[i] == '#') { // Comment
+ styler.ColourTo(endPos, SCE_MAKE_COMMENT);
+ return;
+ }
+ if (lineBuffer[i] == '!') { // Special directive
+ styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
+ return;
+ }
+ }
+ int varCount = 0;
+ while (i < lengthLine) {
+ if (((i + 1) < lengthLine) && (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(')) {
+ styler.ColourTo(startLine + i - 1, state);
+ state = SCE_MAKE_IDENTIFIER;
+ varCount++;
+ } else if (state == SCE_MAKE_IDENTIFIER && lineBuffer[i] == ')') {
+ if (--varCount == 0) {
+ styler.ColourTo(startLine + i, state);
+ state = SCE_MAKE_DEFAULT;
+ }
+ }
+
+ // skip identifier and target styling if this is a command line
+ if (!bSpecial && !bCommand) {
+ if (lineBuffer[i] == ':') {
+ if (((i + 1) < lengthLine) && (lineBuffer[i + 1] == '=')) {
+ // it's a ':=', so style as an identifier
+ if (lastNonSpace >= 0)
+ styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER);
+ styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
+ styler.ColourTo(startLine + i + 1, SCE_MAKE_OPERATOR);
+ } else {
+ // We should check that no colouring was made since the beginning of the line,
+ // to avoid colouring stuff like /OUT:file
+ if (lastNonSpace >= 0)
+ styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET);
+ styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
+ styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR);
+ }
+ bSpecial = true; // Only react to the first ':' of the line
+ state = SCE_MAKE_DEFAULT;
+ } else if (lineBuffer[i] == '=') {
+ if (lastNonSpace >= 0)
+ styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER);
+ styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT);
+ styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR);
+ bSpecial = true; // Only react to the first '=' of the line
+ state = SCE_MAKE_DEFAULT;
+ }
+ }
+ if (!isspacechar(lineBuffer[i])) {
+ lastNonSpace = i;
+ }
+ i++;
+ }
+ if (state == SCE_MAKE_IDENTIFIER) {
+ styler.ColourTo(endPos, SCE_MAKE_IDEOL); // Error, variable reference not ended
+ } else {
+ styler.ColourTo(endPos, SCE_MAKE_DEFAULT);
+ }
+}
+
+static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ char lineBuffer[1024];
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ unsigned int startLine = startPos;
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColouriseMakeLine(lineBuffer, linePos, startLine, i, styler);
+ linePos = 0;
+ startLine = i + 1;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ ColouriseMakeLine(lineBuffer, linePos, startLine, startPos + length - 1, styler);
+ }
+}
+
+static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine, int &startValue) {
+ if (lineBuffer[0] == '>') {
+ // Command or return status
+ return SCE_ERR_CMD;
+ } else if (lineBuffer[0] == '<') {
+ // Diff removal.
+ return SCE_ERR_DIFF_DELETION;
+ } else if (lineBuffer[0] == '!') {
+ return SCE_ERR_DIFF_CHANGED;
+ } else if (lineBuffer[0] == '+') {
+ if (strstart(lineBuffer, "+++ ")) {
+ return SCE_ERR_DIFF_MESSAGE;
+ } else {
+ return SCE_ERR_DIFF_ADDITION;
+ }
+ } else if (lineBuffer[0] == '-') {
+ if (strstart(lineBuffer, "--- ")) {
+ return SCE_ERR_DIFF_MESSAGE;
+ } else {
+ return SCE_ERR_DIFF_DELETION;
+ }
+ } else if (strstart(lineBuffer, "cf90-")) {
+ // Absoft Pro Fortran 90/95 v8.2 error and/or warning message
+ return SCE_ERR_ABSF;
+ } else if (strstart(lineBuffer, "fortcom:")) {
+ // Intel Fortran Compiler v8.0 error/warning message
+ return SCE_ERR_IFORT;
+ } else if (strstr(lineBuffer, "File \"") && strstr(lineBuffer, ", line ")) {
+ return SCE_ERR_PYTHON;
+ } else if (strstr(lineBuffer, " in ") && strstr(lineBuffer, " on line ")) {
+ return SCE_ERR_PHP;
+ } else if ((strstart(lineBuffer, "Error ") ||
+ strstart(lineBuffer, "Warning ")) &&
+ strstr(lineBuffer, " at (") &&
+ strstr(lineBuffer, ") : ") &&
+ (strstr(lineBuffer, " at (") < strstr(lineBuffer, ") : "))) {
+ // Intel Fortran Compiler error/warning message
+ return SCE_ERR_IFC;
+ } else if (strstart(lineBuffer, "Error ")) {
+ // Borland error message
+ return SCE_ERR_BORLAND;
+ } else if (strstart(lineBuffer, "Warning ")) {
+ // Borland warning message
+ return SCE_ERR_BORLAND;
+ } else if (strstr(lineBuffer, "at line ") &&
+ (strstr(lineBuffer, "at line ") < (lineBuffer + lengthLine)) &&
+ strstr(lineBuffer, "file ") &&
+ (strstr(lineBuffer, "file ") < (lineBuffer + lengthLine))) {
+ // Lua 4 error message
+ return SCE_ERR_LUA;
+ } else if (strstr(lineBuffer, " at ") &&
+ (strstr(lineBuffer, " at ") < (lineBuffer + lengthLine)) &&
+ strstr(lineBuffer, " line ") &&
+ (strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) &&
+ (strstr(lineBuffer, " at ") + 4 < (strstr(lineBuffer, " line ")))) {
+ // perl error message:
+ // <message> at <file> line <line>
+ return SCE_ERR_PERL;
+ } else if ((memcmp(lineBuffer, " at ", 6) == 0) &&
+ strstr(lineBuffer, ":line ")) {
+ // A .NET traceback
+ return SCE_ERR_NET;
+ } else if (strstart(lineBuffer, "Line ") &&
+ strstr(lineBuffer, ", file ")) {
+ // Essential Lahey Fortran error message
+ return SCE_ERR_ELF;
+ } else if (strstart(lineBuffer, "line ") &&
+ strstr(lineBuffer, " column ")) {
+ // HTML tidy style: line 42 column 1
+ return SCE_ERR_TIDY;
+ } else if (strstart(lineBuffer, "\tat ") &&
+ strstr(lineBuffer, "(") &&
+ strstr(lineBuffer, ".java:")) {
+ // Java stack back trace
+ return SCE_ERR_JAVA_STACK;
+ } else if (strstart(lineBuffer, "In file included from ") ||
+ strstart(lineBuffer, " from ")) {
+ // GCC showing include path to following error
+ return SCE_ERR_GCC_INCLUDED_FROM;
+ } else {
+ // Look for one of the following formats:
+ // GCC: <filename>:<line>:<message>
+ // Microsoft: <filename>(<line>) :<message>
+ // Common: <filename>(<line>): warning|error|note|remark|catastrophic|fatal
+ // Common: <filename>(<line>) warning|error|note|remark|catastrophic|fatal
+ // Microsoft: <filename>(<line>,<column>)<message>
+ // CTags: <identifier>\t<filename>\t<message>
+ // Lua 5 traceback: \t<filename>:<line>:<message>
+ // Lua 5.1: <exe>: <filename>:<line>:<message>
+ bool initialTab = (lineBuffer[0] == '\t');
+ bool initialColonPart = false;
+ bool canBeCtags = !initialTab; // For ctags must have an identifier with no spaces then a tab
+ enum { stInitial,
+ stGccStart, stGccDigit, stGccColumn, stGcc,
+ stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
+ stCtagsStart, stCtagsFile, stCtagsStartString, stCtagsStringDollar, stCtags,
+ stUnrecognized
+ } state = stInitial;
+ for (unsigned int i = 0; i < lengthLine; i++) {
+ char ch = lineBuffer[i];
+ char chNext = ' ';
+ if ((i + 1) < lengthLine)
+ chNext = lineBuffer[i + 1];
+ if (state == stInitial) {
+ if (ch == ':') {
+ // May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix)
+ if ((chNext != '\\') && (chNext != '/') && (chNext != ' ')) {
+ // This check is not completely accurate as may be on
+ // GTK+ with a file name that includes ':'.
+ state = stGccStart;
+ } else if (chNext == ' ') { // indicates a Lua 5.1 error message
+ initialColonPart = true;
+ }
+ } else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) {
+ // May be Microsoft
+ // Check against '0' often removes phone numbers
+ state = stMsStart;
+ } else if ((ch == '\t') && canBeCtags) {
+ // May be CTags
+ state = stCtagsStart;
+ } else if (ch == ' ') {
+ canBeCtags = false;
+ }
+ } else if (state == stGccStart) { // <filename>:
+ state = Is1To9(ch) ? stGccDigit : stUnrecognized;
+ } else if (state == stGccDigit) { // <filename>:<line>
+ if (ch == ':') {
+ state = stGccColumn; // :9.*: is GCC
+ startValue = i + 1;
+ } else if (!Is0To9(ch)) {
+ state = stUnrecognized;
+ }
+ } else if (state == stGccColumn) { // <filename>:<line>:<column>
+ if (!Is0To9(ch)) {
+ state = stGcc;
+ if (ch == ':')
+ startValue = i + 1;
+ break;
+ }
+ } else if (state == stMsStart) { // <filename>(
+ state = Is0To9(ch) ? stMsDigit : stUnrecognized;
+ } else if (state == stMsDigit) { // <filename>(<line>
+ if (ch == ',') {
+ state = stMsDigitComma;
+ } else if (ch == ')') {
+ state = stMsBracket;
+ } else if ((ch != ' ') && !Is0To9(ch)) {
+ state = stUnrecognized;
+ }
+ } else if (state == stMsBracket) { // <filename>(<line>)
+ if ((ch == ' ') && (chNext == ':')) {
+ state = stMsVc;
+ } else if ((ch == ':' && chNext == ' ') || (ch == ' ')) {
+ // Possibly Delphi.. don't test against chNext as it's one of the strings below.
+ char word[512];
+ unsigned int j, chPos;
+ unsigned numstep;
+ chPos = 0;
+ if (ch == ' ')
+ numstep = 1; // ch was ' ', handle as if it's a delphi errorline, only add 1 to i.
+ else
+ numstep = 2; // otherwise add 2.
+ for (j = i + numstep; j < lengthLine && IsAlphabetic(lineBuffer[j]) && chPos < sizeof(word) - 1; j++)
+ word[chPos++] = lineBuffer[j];
+ word[chPos] = 0;
+ if (!CompareCaseInsensitive(word, "error") || !CompareCaseInsensitive(word, "warning") ||
+ !CompareCaseInsensitive(word, "fatal") || !CompareCaseInsensitive(word, "catastrophic") ||
+ !CompareCaseInsensitive(word, "note") || !CompareCaseInsensitive(word, "remark")) {
+ state = stMsVc;
+ } else {
+ state = stUnrecognized;
+ }
+ } else {
+ state = stUnrecognized;
+ }
+ } else if (state == stMsDigitComma) { // <filename>(<line>,
+ if (ch == ')') {
+ state = stMsDotNet;
+ break;
+ } else if ((ch != ' ') && !Is0To9(ch)) {
+ state = stUnrecognized;
+ }
+ } else if (state == stCtagsStart) {
+ if (ch == '\t') {
+ state = stCtagsFile;
+ }
+ } else if (state == stCtagsFile) {
+ if ((lineBuffer[i - 1] == '\t') &&
+ ((ch == '/' && chNext == '^') || Is0To9(ch))) {
+ state = stCtags;
+ break;
+ } else if ((ch == '/') && (chNext == '^')) {
+ state = stCtagsStartString;
+ }
+ } else if ((state == stCtagsStartString) && ((lineBuffer[i] == '$') && (lineBuffer[i + 1] == '/'))) {
+ state = stCtagsStringDollar;
+ break;
+ }
+ }
+ if (state == stGcc) {
+ return initialColonPart ? SCE_ERR_LUA : SCE_ERR_GCC;
+ } else if ((state == stMsVc) || (state == stMsDotNet)) {
+ return SCE_ERR_MS;
+ } else if ((state == stCtagsStringDollar) || (state == stCtags)) {
+ return SCE_ERR_CTAG;
+ } else {
+ return SCE_ERR_DEFAULT;
+ }
+ }
+}
+
+static void ColouriseErrorListLine(
+ char *lineBuffer,
+ unsigned int lengthLine,
+ unsigned int endPos,
+ Accessor &styler,
+ bool valueSeparate) {
+ int startValue = -1;
+ int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue);
+ if (valueSeparate && (startValue >= 0)) {
+ styler.ColourTo(endPos - (lengthLine - startValue), style);
+ styler.ColourTo(endPos, SCE_ERR_VALUE);
+ } else {
+ styler.ColourTo(endPos, style);
+ }
+}
+
+static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ char lineBuffer[10000];
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+
+ // property lexer.errorlist.value.separate
+ // For lines in the output pane that are matches from Find in Files or GCC-style
+ // diagnostics, style the path and line number separately from the rest of the
+ // line with style 21 used for the rest of the line.
+ // This allows matched text to be more easily distinguished from its location.
+ bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0;
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate);
+ linePos = 0;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate);
+ }
+}
+
+static const char *const batchWordListDesc[] = {
+ "Internal Commands",
+ "External Commands",
+ 0
+};
+
+static const char *const emptyWordListDesc[] = {
+ 0
+};
+
+static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+ // Null language means all style bytes are 0 so just mark the end - no need to fill in.
+ if (length > 0) {
+ styler.StartAt(startPos + length - 1);
+ styler.StartSegment(startPos + length - 1);
+ styler.ColourTo(startPos + length - 1, 0);
+ }
+}
+
+LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
+LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc);
+LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc);
+LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
+LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
+LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPB.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPB.cxx
new file mode 100644
index 00000000000..a7b5690ebb3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPB.cxx
@@ -0,0 +1,365 @@
+// Scintilla source code edit control
+// @file LexPB.cxx
+// Lexer for PowerBasic by Roland Walter, roland@rowalt.de (for PowerBasic see www.powerbasic.com)
+//
+// Changes:
+// 17.10.2003: Toggling of subs/functions now until next sub/function - this gives better results
+// 29.10.2003: 1. Bug: Toggling didn't work for subs/functions added in editor
+// 2. Own colors for PB constants and Inline Assembler SCE_B_CONSTANT and SCE_B_ASM
+// 3. Several smaller syntax coloring improvements and speed optimizations
+// 12.07.2004: 1. Toggling for macros added
+// 2. Further folding speed optimitations (for people dealing with very large listings)
+//
+// Necessary changes for the PB lexer in Scintilla project:
+// - In SciLexer.h and Scintilla.iface:
+//
+// #define SCLEX_POWERBASIC 51 //ID for PowerBasic lexer
+// (...)
+// #define SCE_B_DEFAULT 0 //in both VB and PB lexer
+// #define SCE_B_COMMENT 1 //in both VB and PB lexer
+// #define SCE_B_NUMBER 2 //in both VB and PB lexer
+// #define SCE_B_KEYWORD 3 //in both VB and PB lexer
+// #define SCE_B_STRING 4 //in both VB and PB lexer
+// #define SCE_B_PREPROCESSOR 5 //VB lexer only, not in PB lexer
+// #define SCE_B_OPERATOR 6 //in both VB and PB lexer
+// #define SCE_B_IDENTIFIER 7 //in both VB and PB lexer
+// #define SCE_B_DATE 8 //VB lexer only, not in PB lexer
+// #define SCE_B_CONSTANT 13 //PB lexer only, not in VB lexer
+// #define SCE_B_ASM 14 //PB lexer only, not in VB lexer
+
+// - Statement added to KeyWords.cxx: 'LINK_LEXER(lmPB);'
+// - Statement added to scintilla_vc6.mak: '$(DIR_O)\LexPB.obj: ...\src\LexPB.cxx $(LEX_HEADERS)'
+//
+// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsTypeCharacter(const int ch)
+{
+ return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$' || ch == '?';
+}
+
+static inline bool IsAWordChar(const int ch)
+{
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch)
+{
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+bool MatchUpperCase(Accessor &styler, int pos, const char *s) //Same as styler.Match() but uppercase comparison (a-z,A-Z and space only)
+{
+ char ch;
+ for (int i=0; *s; i++)
+ {
+ ch=styler.SafeGetCharAt(pos+i);
+ if (ch > 0x60) ch -= '\x20';
+ if (*s != ch) return false;
+ s++;
+ }
+ return true;
+}
+
+static void ColourisePBDoc(unsigned int startPos, int length, int initStyle,WordList *keywordlists[],Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+
+ styler.StartAt(startPos);
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ switch (sc.state)
+ {
+ case SCE_B_OPERATOR:
+ {
+ sc.SetState(SCE_B_DEFAULT);
+ break;
+ }
+ case SCE_B_KEYWORD:
+ {
+ if (!IsAWordChar(sc.ch))
+ {
+ if (!IsTypeCharacter(sc.ch))
+ {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s))
+ {
+ if (strcmp(s, "rem") == 0)
+ {
+ sc.ChangeState(SCE_B_COMMENT);
+ if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);}
+ }
+ else if (strcmp(s, "asm") == 0)
+ {
+ sc.ChangeState(SCE_B_ASM);
+ if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);}
+ }
+ else
+ {
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+ else
+ {
+ sc.ChangeState(SCE_B_IDENTIFIER);
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+ }
+ break;
+ }
+ case SCE_B_NUMBER:
+ {
+ if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);}
+ break;
+ }
+ case SCE_B_STRING:
+ {
+ if (sc.ch == '\"'){sc.ForwardSetState(SCE_B_DEFAULT);}
+ break;
+ }
+ case SCE_B_CONSTANT:
+ {
+ if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);}
+ break;
+ }
+ case SCE_B_COMMENT:
+ {
+ if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);}
+ break;
+ }
+ case SCE_B_ASM:
+ {
+ if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);}
+ break;
+ }
+ } //switch (sc.state)
+
+ // Determine if a new state should be entered:
+ if (sc.state == SCE_B_DEFAULT)
+ {
+ if (sc.ch == '\'') {sc.SetState(SCE_B_COMMENT);}
+ else if (sc.ch == '\"') {sc.SetState(SCE_B_STRING);}
+ else if (sc.ch == '&' && tolower(sc.chNext) == 'h') {sc.SetState(SCE_B_NUMBER);}
+ else if (sc.ch == '&' && tolower(sc.chNext) == 'b') {sc.SetState(SCE_B_NUMBER);}
+ else if (sc.ch == '&' && tolower(sc.chNext) == 'o') {sc.SetState(SCE_B_NUMBER);}
+ else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_B_NUMBER);}
+ else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_B_KEYWORD);}
+ else if (sc.ch == '%') {sc.SetState(SCE_B_CONSTANT);}
+ else if (sc.ch == '$') {sc.SetState(SCE_B_CONSTANT);}
+ else if (sc.ch == '#') {sc.SetState(SCE_B_KEYWORD);}
+ else if (sc.ch == '!') {sc.SetState(SCE_B_ASM);}
+ else if (isoperator(static_cast<char>(sc.ch)) || (sc.ch == '\\')) {sc.SetState(SCE_B_OPERATOR);}
+ }
+ } //for (; sc.More(); sc.Forward())
+ sc.Complete();
+}
+
+//The folding routine for PowerBasic toggles SUBs and FUNCTIONs only. This was exactly what I wanted,
+//nothing more. I had worked with this kind of toggling for several years when I used the great good old
+//GFA Basic which is dead now. After testing the feature of toggling FOR-NEXT loops, WHILE-WEND loops
+//and so on too I found this is more disturbing then helping (for me). So if You think in another way
+//you can (or must) write Your own toggling routine ;-)
+static void FoldPBDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ // No folding enabled, no reason to continue...
+ if( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ unsigned int endPos = startPos + length;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+
+ bool fNewLine=true;
+ bool fMightBeMultiLineMacro=false;
+ bool fBeginOfCommentFound=false;
+ for (unsigned int i = startPos; i < endPos; i++)
+ {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if (fNewLine) //Begin of a new line (The Sub/Function/Macro keywords may occur at begin of line only)
+ {
+ fNewLine=false;
+ fBeginOfCommentFound=false;
+ switch (ch)
+ {
+ case ' ': //Most lines start with space - so check this first, the code is the same as for 'default:'
+ case '\t': //Handle tab too
+ {
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ styler.SetLevel(lineCurrent, lev);
+ break;
+ }
+ case 'F':
+ case 'f':
+ {
+ switch (chNext)
+ {
+ case 'U':
+ case 'u':
+ {
+ if( MatchUpperCase(styler,i,"FUNCTION") )
+ {
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case 'S':
+ case 's':
+ {
+ switch (chNext)
+ {
+ case 'U':
+ case 'u':
+ {
+ if( MatchUpperCase(styler,i,"SUB") )
+ {
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ break;
+ }
+ case 'T':
+ case 't':
+ {
+ if( MatchUpperCase(styler,i,"STATIC FUNCTION") )
+ {
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ else if( MatchUpperCase(styler,i,"STATIC SUB") )
+ {
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case 'C':
+ case 'c':
+ {
+ switch (chNext)
+ {
+ case 'A':
+ case 'a':
+ {
+ if( MatchUpperCase(styler,i,"CALLBACK FUNCTION") )
+ {
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case 'M':
+ case 'm':
+ {
+ switch (chNext)
+ {
+ case 'A':
+ case 'a':
+ {
+ if( MatchUpperCase(styler,i,"MACRO") )
+ {
+ fMightBeMultiLineMacro=true; //Set folder level at end of line, we have to check for single line macro
+ }
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ styler.SetLevel(lineCurrent, lev);
+ break;
+ }
+ } //switch (ch)
+ } //if( fNewLine )
+
+ switch (ch)
+ {
+ case '=': //To test single line macros
+ {
+ if (fBeginOfCommentFound==false)
+ fMightBeMultiLineMacro=false; //The found macro is a single line macro only;
+ break;
+ }
+ case '\'': //A comment starts
+ {
+ fBeginOfCommentFound=true;
+ break;
+ }
+ case '\n':
+ {
+ if (fMightBeMultiLineMacro) //The current line is the begin of a multi line macro
+ {
+ fMightBeMultiLineMacro=false;
+ styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG);
+ levelNext=SC_FOLDLEVELBASE+1;
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ fNewLine=true;
+ break;
+ }
+ case '\r':
+ {
+ if (chNext != '\n')
+ {
+ lineCurrent++;
+ levelCurrent = levelNext;
+ fNewLine=true;
+ }
+ break;
+ }
+ } //switch (ch)
+ } //for (unsigned int i = startPos; i < endPos; i++)
+}
+
+static const char * const pbWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmPB(SCLEX_POWERBASIC, ColourisePBDoc, "powerbasic", FoldPBDoc, pbWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPLM.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPLM.cxx
new file mode 100644
index 00000000000..747d1589440
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPLM.cxx
@@ -0,0 +1,201 @@
+// Copyright (c) 1990-2007, Scientific Toolworks, Inc.
+// Author: Jason Haslam
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void GetRange(unsigned int start,
+ unsigned int end,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void ColourisePlmDoc(unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler)
+{
+ unsigned int endPos = startPos + length;
+ int state = initStyle;
+
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = styler.SafeGetCharAt(i);
+ char chNext = styler.SafeGetCharAt(i + 1);
+
+ if (state == SCE_PLM_DEFAULT) {
+ if (ch == '/' && chNext == '*') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_COMMENT;
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_STRING;
+ } else if (isdigit(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_NUMBER;
+ } else if (isalpha(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_IDENTIFIER;
+ } else if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
+ ch == '=' || ch == '<' || ch == '>' || ch == ':') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_OPERATOR;
+ } else if (ch == '$') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_CONTROL;
+ }
+ } else if (state == SCE_PLM_COMMENT) {
+ if (ch == '*' && chNext == '/') {
+ i++;
+ styler.ColourTo(i, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ } else if (state == SCE_PLM_STRING) {
+ if (ch == '\'') {
+ if (chNext == '\'') {
+ i++;
+ } else {
+ styler.ColourTo(i, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ }
+ } else if (state == SCE_PLM_NUMBER) {
+ if (!isdigit(ch) && !isalpha(ch) && ch != '$') {
+ i--;
+ styler.ColourTo(i, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ } else if (state == SCE_PLM_IDENTIFIER) {
+ if (!isdigit(ch) && !isalpha(ch) && ch != '$') {
+ // Get the entire identifier.
+ char word[1024];
+ int segmentStart = styler.GetStartSegment();
+ GetRange(segmentStart, i - 1, styler, word, sizeof(word));
+
+ i--;
+ if (keywordlists[0]->InList(word))
+ styler.ColourTo(i, SCE_PLM_KEYWORD);
+ else
+ styler.ColourTo(i, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ } else if (state == SCE_PLM_OPERATOR) {
+ if (ch != '=' && ch != '>') {
+ i--;
+ styler.ColourTo(i, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ } else if (state == SCE_PLM_CONTROL) {
+ if (ch == '\r' || ch == '\n') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_PLM_DEFAULT;
+ }
+ }
+ }
+ styler.ColourTo(endPos - 1, state);
+}
+
+static void FoldPlmDoc(unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *[],
+ Accessor &styler)
+{
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int startKeyword = 0;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (stylePrev != SCE_PLM_KEYWORD && style == SCE_PLM_KEYWORD)
+ startKeyword = i;
+
+ if (style == SCE_PLM_KEYWORD && styleNext != SCE_PLM_KEYWORD) {
+ char word[1024];
+ GetRange(startKeyword, i, styler, word, sizeof(word));
+
+ if (strcmp(word, "procedure") == 0 || strcmp(word, "do") == 0)
+ levelCurrent++;
+ else if (strcmp(word, "end") == 0)
+ levelCurrent--;
+ }
+
+ if (foldComment) {
+ if (stylePrev != SCE_PLM_COMMENT && style == SCE_PLM_COMMENT)
+ levelCurrent++;
+ else if (stylePrev == SCE_PLM_COMMENT && style != SCE_PLM_COMMENT)
+ levelCurrent--;
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char *const plmWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmPLM(SCLEX_PLM, ColourisePlmDoc, "PL/M", FoldPlmDoc, plmWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPO.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPO.cxx
new file mode 100644
index 00000000000..7b44107cfad
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPO.cxx
@@ -0,0 +1,213 @@
+// Scintilla source code edit control
+/** @file LexPO.cxx
+ ** Lexer for GetText Translation (PO) files.
+ **/
+// Copyright 2012 by Colomban Wendling <ban@herbesfolles.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// see https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files for the syntax reference
+// some details are taken from the GNU msgfmt behavior (like that indent is allows in front of lines)
+
+// TODO:
+// * add keywords for flags (fuzzy, c-format, ...)
+// * highlight formats inside c-format strings (%s, %d, etc.)
+// * style for previous untranslated string? ("#|" comment)
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColourisePODoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) {
+ StyleContext sc(startPos, length, initStyle, styler);
+ bool escaped = false;
+ int curLine = styler.GetLine(startPos);
+ // the line state holds the last state on or before the line that isn't the default style
+ int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : SCE_PO_DEFAULT;
+
+ for (; sc.More(); sc.Forward()) {
+ // whether we should leave a state
+ switch (sc.state) {
+ case SCE_PO_COMMENT:
+ case SCE_PO_PROGRAMMER_COMMENT:
+ case SCE_PO_REFERENCE:
+ case SCE_PO_FLAGS:
+ case SCE_PO_FUZZY:
+ if (sc.atLineEnd)
+ sc.SetState(SCE_PO_DEFAULT);
+ else if (sc.state == SCE_PO_FLAGS && sc.Match("fuzzy"))
+ // here we behave like the previous parser, but this should probably be highlighted
+ // on its own like a keyword rather than changing the whole flags style
+ sc.ChangeState(SCE_PO_FUZZY);
+ break;
+
+ case SCE_PO_MSGCTXT:
+ case SCE_PO_MSGID:
+ case SCE_PO_MSGSTR:
+ if (isspacechar(sc.ch))
+ sc.SetState(SCE_PO_DEFAULT);
+ break;
+
+ case SCE_PO_ERROR:
+ if (sc.atLineEnd)
+ sc.SetState(SCE_PO_DEFAULT);
+ break;
+
+ case SCE_PO_MSGCTXT_TEXT:
+ case SCE_PO_MSGID_TEXT:
+ case SCE_PO_MSGSTR_TEXT:
+ if (sc.atLineEnd) { // invalid inside a string
+ if (sc.state == SCE_PO_MSGCTXT_TEXT)
+ sc.ChangeState(SCE_PO_MSGCTXT_TEXT_EOL);
+ else if (sc.state == SCE_PO_MSGID_TEXT)
+ sc.ChangeState(SCE_PO_MSGID_TEXT_EOL);
+ else if (sc.state == SCE_PO_MSGSTR_TEXT)
+ sc.ChangeState(SCE_PO_MSGSTR_TEXT_EOL);
+ sc.SetState(SCE_PO_DEFAULT);
+ escaped = false;
+ } else {
+ if (escaped)
+ escaped = false;
+ else if (sc.ch == '\\')
+ escaped = true;
+ else if (sc.ch == '"')
+ sc.ForwardSetState(SCE_PO_DEFAULT);
+ }
+ break;
+ }
+
+ // whether we should enter a new state
+ if (sc.state == SCE_PO_DEFAULT) {
+ // forward to the first non-white character on the line
+ bool atLineStart = sc.atLineStart;
+ if (atLineStart) {
+ // reset line state if it is set to comment state so empty lines don't get
+ // comment line state, and the folding code folds comments separately,
+ // and anyway the styling don't use line state for comments
+ if (curLineState == SCE_PO_COMMENT)
+ curLineState = SCE_PO_DEFAULT;
+
+ while (sc.More() && ! sc.atLineEnd && isspacechar(sc.ch))
+ sc.Forward();
+ }
+
+ if (atLineStart && sc.ch == '#') {
+ if (sc.chNext == '.')
+ sc.SetState(SCE_PO_PROGRAMMER_COMMENT);
+ else if (sc.chNext == ':')
+ sc.SetState(SCE_PO_REFERENCE);
+ else if (sc.chNext == ',')
+ sc.SetState(SCE_PO_FLAGS);
+ else
+ sc.SetState(SCE_PO_COMMENT);
+ } else if (atLineStart && sc.Match("msgid")) { // includes msgid_plural
+ sc.SetState(SCE_PO_MSGID);
+ } else if (atLineStart && sc.Match("msgstr")) { // includes [] suffixes
+ sc.SetState(SCE_PO_MSGSTR);
+ } else if (atLineStart && sc.Match("msgctxt")) {
+ sc.SetState(SCE_PO_MSGCTXT);
+ } else if (sc.ch == '"') {
+ if (curLineState == SCE_PO_MSGCTXT || curLineState == SCE_PO_MSGCTXT_TEXT)
+ sc.SetState(SCE_PO_MSGCTXT_TEXT);
+ else if (curLineState == SCE_PO_MSGID || curLineState == SCE_PO_MSGID_TEXT)
+ sc.SetState(SCE_PO_MSGID_TEXT);
+ else if (curLineState == SCE_PO_MSGSTR || curLineState == SCE_PO_MSGSTR_TEXT)
+ sc.SetState(SCE_PO_MSGSTR_TEXT);
+ else
+ sc.SetState(SCE_PO_ERROR);
+ } else if (! isspacechar(sc.ch))
+ sc.SetState(SCE_PO_ERROR);
+
+ if (sc.state != SCE_PO_DEFAULT)
+ curLineState = sc.state;
+ }
+
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curLineState);
+ }
+ }
+ sc.Complete();
+}
+
+static int FindNextNonEmptyLineState(unsigned int startPos, Accessor &styler) {
+ unsigned int length = styler.Length();
+ for (unsigned int i = startPos; i < length; i++) {
+ if (! isspacechar(styler[i])) {
+ return styler.GetLineState(styler.GetLine(i));
+ }
+ }
+ return 0;
+}
+
+static void FoldPODoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) {
+ if (! styler.GetPropertyInt("fold"))
+ return;
+ bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+
+ unsigned int endPos = startPos + length;
+ int curLine = styler.GetLine(startPos);
+ int lineState = styler.GetLineState(curLine);
+ int nextLineState;
+ int level = styler.LevelAt(curLine) & SC_FOLDLEVELNUMBERMASK;
+ int nextLevel;
+ int visible = 0;
+ int chNext = styler[startPos];
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ int ch = chNext;
+ chNext = styler.SafeGetCharAt(i+1);
+
+ if (! isspacechar(ch)) {
+ visible++;
+ } else if ((ch == '\r' && chNext != '\n') || ch == '\n' || i+1 >= endPos) {
+ int lvl = level;
+ int nextLine = curLine + 1;
+
+ nextLineState = styler.GetLineState(nextLine);
+ if ((lineState != SCE_PO_COMMENT || foldComment) &&
+ nextLineState == lineState &&
+ FindNextNonEmptyLineState(i, styler) == lineState)
+ nextLevel = SC_FOLDLEVELBASE + 1;
+ else
+ nextLevel = SC_FOLDLEVELBASE;
+
+ if (nextLevel > level)
+ lvl |= SC_FOLDLEVELHEADERFLAG;
+ if (visible == 0 && foldCompact)
+ lvl |= SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(curLine, lvl);
+
+ lineState = nextLineState;
+ curLine = nextLine;
+ level = nextLevel;
+ visible = 0;
+ }
+ }
+}
+
+static const char *const poWordListDesc[] = {
+ 0
+};
+
+LexerModule lmPO(SCLEX_PO, ColourisePODoc, "po", FoldPODoc, poWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPOV.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPOV.cxx
new file mode 100644
index 00000000000..353fbbe0fa3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPOV.cxx
@@ -0,0 +1,319 @@
+// Scintilla source code edit control
+/** @file LexPOV.cxx
+ ** Lexer for POV-Ray SDL (Persistance of Vision Raytracer, Scene Description Language).
+ ** Written by Philippe Lhoste but this is mostly a derivative of LexCPP...
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// Some points that distinguish from a simple C lexer:
+// Identifiers start only by a character.
+// No line continuation character.
+// Strings are limited to 256 characters.
+// Directives are similar to preprocessor commands,
+// but we match directive keywords and colorize incorrect ones.
+// Block comments can be nested (code stolen from my code in LexLua).
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(int ch) {
+ return ch < 0x80 && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return ch < 0x80 && isalpha(ch);
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || toupper(ch) == 'E' ||
+ ch == '.' || ch == '-' || ch == '+');
+}
+
+static void ColourisePovDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords1 = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+ WordList &keywords7 = *keywordlists[6];
+ WordList &keywords8 = *keywordlists[7];
+
+ int currentLine = styler.GetLine(startPos);
+ // Initialize the block comment /* */ nesting level, if we are inside such a comment.
+ int blockCommentLevel = 0;
+ if (initStyle == SCE_POV_COMMENT) {
+ blockCommentLevel = styler.GetLineState(currentLine - 1);
+ }
+
+ // Do not leak onto next line
+ if (initStyle == SCE_POV_STRINGEOL || initStyle == SCE_POV_COMMENTLINE) {
+ initStyle = SCE_POV_DEFAULT;
+ }
+
+ short stringLen = 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ currentLine = styler.GetLine(sc.currentPos);
+ if (sc.state == SCE_POV_COMMENT) {
+ // Inside a block comment, we set the line state
+ styler.SetLineState(currentLine, blockCommentLevel);
+ } else {
+ // Reset the line state
+ styler.SetLineState(currentLine, 0);
+ }
+ }
+
+ if (sc.atLineStart && (sc.state == SCE_POV_STRING)) {
+ // Prevent SCE_POV_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_POV_STRING);
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_POV_OPERATOR) {
+ sc.SetState(SCE_POV_DEFAULT);
+ } else if (sc.state == SCE_POV_NUMBER) {
+ // We stop the number definition on non-numerical non-dot non-eE non-sign char
+ if (!IsANumberChar(sc.ch)) {
+ sc.SetState(SCE_POV_DEFAULT);
+ }
+ } else if (sc.state == SCE_POV_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD4);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD5);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD6);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD7);
+ } else if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_POV_WORD8);
+ }
+ sc.SetState(SCE_POV_DEFAULT);
+ }
+ } else if (sc.state == SCE_POV_DIRECTIVE) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ char *p;
+ sc.GetCurrent(s, sizeof(s));
+ p = s;
+ // Skip # and whitespace between # and directive word
+ do {
+ p++;
+ } while ((*p == ' ' || *p == '\t') && *p != '\0');
+ if (!keywords1.InList(p)) {
+ sc.ChangeState(SCE_POV_BADDIRECTIVE);
+ }
+ sc.SetState(SCE_POV_DEFAULT);
+ }
+ } else if (sc.state == SCE_POV_COMMENT) {
+ if (sc.Match('/', '*')) {
+ blockCommentLevel++;
+ sc.Forward();
+ } else if (sc.Match('*', '/') && blockCommentLevel > 0) {
+ blockCommentLevel--;
+ sc.Forward();
+ if (blockCommentLevel == 0) {
+ sc.ForwardSetState(SCE_POV_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_POV_COMMENTLINE) {
+ if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_POV_DEFAULT);
+ }
+ } else if (sc.state == SCE_POV_STRING) {
+ if (sc.ch == '\\') {
+ stringLen++;
+ if (strchr("abfnrtuv0'\"", sc.chNext)) {
+ // Compound characters are counted as one.
+ // Note: for Unicode chars \u, we shouldn't count the next 4 digits...
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_POV_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_POV_STRINGEOL);
+ sc.ForwardSetState(SCE_POV_DEFAULT);
+ } else {
+ stringLen++;
+ }
+ if (stringLen > 256) {
+ // Strings are limited to 256 chars
+ sc.SetState(SCE_POV_STRINGEOL);
+ }
+ } else if (sc.state == SCE_POV_STRINGEOL) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_C_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_POV_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_POV_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_POV_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_POV_IDENTIFIER);
+ } else if (sc.Match('/', '*')) {
+ blockCommentLevel = 1;
+ sc.SetState(SCE_POV_COMMENT);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_POV_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_POV_STRING);
+ stringLen = 0;
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_POV_DIRECTIVE);
+ // Skip whitespace between # and directive word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_POV_DEFAULT);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_POV_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldPovDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *[],
+ Accessor &styler) {
+
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldDirective = styler.GetPropertyInt("fold.directive") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && (style == SCE_POV_COMMENT)) {
+ if (stylePrev != SCE_POV_COMMENT) {
+ levelCurrent++;
+ } else if ((styleNext != SCE_POV_COMMENT) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+ if (foldComment && (style == SCE_POV_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelCurrent++;
+ } else if (chNext2 == '}') {
+ levelCurrent--;
+ }
+ }
+ }
+ if (foldDirective && (style == SCE_POV_DIRECTIVE)) {
+ if (ch == '#') {
+ unsigned int j=i+1;
+ while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ }
+ }
+ if (style == SCE_POV_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const povWordLists[] = {
+ "Language directives",
+ "Objects & CSG & Appearance",
+ "Types & Modifiers & Items",
+ "Predefined Identifiers",
+ "Predefined Functions",
+ "User defined 1",
+ "User defined 2",
+ "User defined 3",
+ 0,
+};
+
+LexerModule lmPOV(SCLEX_POV, ColourisePovDoc, "pov", FoldPovDoc, povWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPS.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPS.cxx
new file mode 100644
index 00000000000..2c8917daeae
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPS.cxx
@@ -0,0 +1,333 @@
+// Scintilla source code edit control
+/** @file LexPS.cxx
+ ** Lexer for PostScript
+ **
+ ** Written by Nigel Hathaway <nigel@bprj.co.uk>.
+ ** The License.txt file describes the conditions under which this software may be distributed.
+ **/
+
+// Previous releases of this lexer included support for marking token starts with
+// a style byte indicator. This was used by the wxGhostscript IDE/debugger.
+// Style byte indicators were removed in version 3.4.3.
+// Anyone wanting to restore this functionality for wxGhostscript using 'modern'
+// indicators can examine the earlier source in the Mercurial repository.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsASelfDelimitingChar(const int ch) {
+ return (ch == '[' || ch == ']' || ch == '{' || ch == '}' ||
+ ch == '/' || ch == '<' || ch == '>' ||
+ ch == '(' || ch == ')' || ch == '%');
+}
+
+static inline bool IsAWhitespaceChar(const int ch) {
+ return (ch == ' ' || ch == '\t' || ch == '\r' ||
+ ch == '\n' || ch == '\f' || ch == '\0');
+}
+
+static bool IsABaseNDigit(const int ch, const int base) {
+ int maxdig = '9';
+ int letterext = -1;
+
+ if (base <= 10)
+ maxdig = '0' + base - 1;
+ else
+ letterext = base - 11;
+
+ return ((ch >= '0' && ch <= maxdig) ||
+ (ch >= 'A' && ch <= ('A' + letterext)) ||
+ (ch >= 'a' && ch <= ('a' + letterext)));
+}
+
+static inline bool IsABase85Char(const int ch) {
+ return ((ch >= '!' && ch <= 'u') || ch == 'z');
+}
+
+static void ColourisePSDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords1 = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ int pslevel = styler.GetPropertyInt("ps.level", 3);
+ int lineCurrent = styler.GetLine(startPos);
+ int nestTextCurrent = 0;
+ if (lineCurrent > 0 && initStyle == SCE_PS_TEXT)
+ nestTextCurrent = styler.GetLineState(lineCurrent - 1);
+ int numRadix = 0;
+ bool numHasPoint = false;
+ bool numHasExponent = false;
+ bool numHasSign = false;
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineStart)
+ lineCurrent = styler.GetLine(sc.currentPos);
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_PS_COMMENT || sc.state == SCE_PS_DSC_VALUE) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_C_DEFAULT);
+ }
+ } else if (sc.state == SCE_PS_DSC_COMMENT) {
+ if (sc.ch == ':') {
+ sc.Forward();
+ if (!sc.atLineEnd)
+ sc.SetState(SCE_PS_DSC_VALUE);
+ else
+ sc.SetState(SCE_C_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.SetState(SCE_C_DEFAULT);
+ } else if (IsAWhitespaceChar(sc.ch) && sc.ch != '\r') {
+ sc.ChangeState(SCE_PS_COMMENT);
+ }
+ } else if (sc.state == SCE_PS_NUMBER) {
+ if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) {
+ if ((sc.chPrev == '+' || sc.chPrev == '-' ||
+ sc.chPrev == 'E' || sc.chPrev == 'e') && numRadix == 0)
+ sc.ChangeState(SCE_PS_NAME);
+ sc.SetState(SCE_C_DEFAULT);
+ } else if (sc.ch == '#') {
+ if (numHasPoint || numHasExponent || numHasSign || numRadix != 0) {
+ sc.ChangeState(SCE_PS_NAME);
+ } else {
+ char szradix[5];
+ sc.GetCurrent(szradix, 4);
+ numRadix = atoi(szradix);
+ if (numRadix < 2 || numRadix > 36)
+ sc.ChangeState(SCE_PS_NAME);
+ }
+ } else if ((sc.ch == 'E' || sc.ch == 'e') && numRadix == 0) {
+ if (numHasExponent) {
+ sc.ChangeState(SCE_PS_NAME);
+ } else {
+ numHasExponent = true;
+ if (sc.chNext == '+' || sc.chNext == '-')
+ sc.Forward();
+ }
+ } else if (sc.ch == '.') {
+ if (numHasPoint || numHasExponent || numRadix != 0) {
+ sc.ChangeState(SCE_PS_NAME);
+ } else {
+ numHasPoint = true;
+ }
+ } else if (numRadix == 0) {
+ if (!IsABaseNDigit(sc.ch, 10))
+ sc.ChangeState(SCE_PS_NAME);
+ } else {
+ if (!IsABaseNDigit(sc.ch, numRadix))
+ sc.ChangeState(SCE_PS_NAME);
+ }
+ } else if (sc.state == SCE_PS_NAME || sc.state == SCE_PS_KEYWORD) {
+ if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if ((pslevel >= 1 && keywords1.InList(s)) ||
+ (pslevel >= 2 && keywords2.InList(s)) ||
+ (pslevel >= 3 && keywords3.InList(s)) ||
+ keywords4.InList(s) || keywords5.InList(s)) {
+ sc.ChangeState(SCE_PS_KEYWORD);
+ }
+ sc.SetState(SCE_C_DEFAULT);
+ }
+ } else if (sc.state == SCE_PS_LITERAL || sc.state == SCE_PS_IMMEVAL) {
+ if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch))
+ sc.SetState(SCE_C_DEFAULT);
+ } else if (sc.state == SCE_PS_PAREN_ARRAY || sc.state == SCE_PS_PAREN_DICT ||
+ sc.state == SCE_PS_PAREN_PROC) {
+ sc.SetState(SCE_C_DEFAULT);
+ } else if (sc.state == SCE_PS_TEXT) {
+ if (sc.ch == '(') {
+ nestTextCurrent++;
+ } else if (sc.ch == ')') {
+ if (--nestTextCurrent == 0)
+ sc.ForwardSetState(SCE_PS_DEFAULT);
+ } else if (sc.ch == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.state == SCE_PS_HEXSTRING) {
+ if (sc.ch == '>') {
+ sc.ForwardSetState(SCE_PS_DEFAULT);
+ } else if (!IsABaseNDigit(sc.ch, 16) && !IsAWhitespaceChar(sc.ch)) {
+ sc.SetState(SCE_PS_HEXSTRING);
+ styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR);
+ }
+ } else if (sc.state == SCE_PS_BASE85STRING) {
+ if (sc.Match('~', '>')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_PS_DEFAULT);
+ } else if (!IsABase85Char(sc.ch) && !IsAWhitespaceChar(sc.ch)) {
+ sc.SetState(SCE_PS_BASE85STRING);
+ styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_C_DEFAULT) {
+
+ if (sc.ch == '[' || sc.ch == ']') {
+ sc.SetState(SCE_PS_PAREN_ARRAY);
+ } else if (sc.ch == '{' || sc.ch == '}') {
+ sc.SetState(SCE_PS_PAREN_PROC);
+ } else if (sc.ch == '/') {
+ if (sc.chNext == '/') {
+ sc.SetState(SCE_PS_IMMEVAL);
+ sc.Forward();
+ } else {
+ sc.SetState(SCE_PS_LITERAL);
+ }
+ } else if (sc.ch == '<') {
+ if (sc.chNext == '<') {
+ sc.SetState(SCE_PS_PAREN_DICT);
+ sc.Forward();
+ } else if (sc.chNext == '~') {
+ sc.SetState(SCE_PS_BASE85STRING);
+ sc.Forward();
+ } else {
+ sc.SetState(SCE_PS_HEXSTRING);
+ }
+ } else if (sc.ch == '>' && sc.chNext == '>') {
+ sc.SetState(SCE_PS_PAREN_DICT);
+ sc.Forward();
+ } else if (sc.ch == '>' || sc.ch == ')') {
+ sc.SetState(SCE_C_DEFAULT);
+ styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR);
+ } else if (sc.ch == '(') {
+ sc.SetState(SCE_PS_TEXT);
+ nestTextCurrent = 1;
+ } else if (sc.ch == '%') {
+ if (sc.chNext == '%' && sc.atLineStart) {
+ sc.SetState(SCE_PS_DSC_COMMENT);
+ sc.Forward();
+ if (sc.chNext == '+') {
+ sc.Forward();
+ sc.ForwardSetState(SCE_PS_DSC_VALUE);
+ }
+ } else {
+ sc.SetState(SCE_PS_COMMENT);
+ }
+ } else if ((sc.ch == '+' || sc.ch == '-' || sc.ch == '.') &&
+ IsABaseNDigit(sc.chNext, 10)) {
+ sc.SetState(SCE_PS_NUMBER);
+ numRadix = 0;
+ numHasPoint = (sc.ch == '.');
+ numHasExponent = false;
+ numHasSign = (sc.ch == '+' || sc.ch == '-');
+ } else if ((sc.ch == '+' || sc.ch == '-') && sc.chNext == '.' &&
+ IsABaseNDigit(sc.GetRelative(2), 10)) {
+ sc.SetState(SCE_PS_NUMBER);
+ numRadix = 0;
+ numHasPoint = false;
+ numHasExponent = false;
+ numHasSign = true;
+ } else if (IsABaseNDigit(sc.ch, 10)) {
+ sc.SetState(SCE_PS_NUMBER);
+ numRadix = 0;
+ numHasPoint = false;
+ numHasExponent = false;
+ numHasSign = false;
+ } else if (!IsAWhitespaceChar(sc.ch)) {
+ sc.SetState(SCE_PS_NAME);
+ }
+ }
+
+ if (sc.atLineEnd)
+ styler.SetLineState(lineCurrent, nestTextCurrent);
+ }
+
+ sc.Complete();
+}
+
+static void FoldPSDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); //mac??
+ if ((style & 31) == SCE_PS_PAREN_PROC) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+}
+
+static const char * const psWordListDesc[] = {
+ "PS Level 1 operators",
+ "PS Level 2 operators",
+ "PS Level 3 operators",
+ "RIP-specific operators",
+ "User-defined operators",
+ 0
+};
+
+LexerModule lmPS(SCLEX_PS, ColourisePSDoc, "ps", FoldPSDoc, psWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPascal.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPascal.cxx
new file mode 100644
index 00000000000..3d39f5f4473
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPascal.cxx
@@ -0,0 +1,615 @@
+// Scintilla source code edit control
+/** @file LexPascal.cxx
+ ** Lexer for Pascal.
+ ** Written by Laurent le Tynevez
+ ** Updated by Simon Steele <s.steele@pnotepad.org> September 2002
+ ** Updated by Mathias Rauen <scite@madshi.net> May 2003 (Delphi adjustments)
+ ** Completely rewritten by Marko Njezic <sf@maxempire.com> October 2008
+ **/
+
+/*
+
+A few words about features of the new completely rewritten LexPascal...
+
+Generally speaking LexPascal tries to support all available Delphi features (up
+to Delphi XE4 at this time).
+
+~ HIGHLIGHTING:
+
+If you enable "lexer.pascal.smart.highlighting" property, some keywords will
+only be highlighted in appropriate context. As implemented those are keywords
+related to property and DLL exports declarations (similar to how Delphi IDE
+works).
+
+For example, keywords "read" and "write" will only be highlighted if they are in
+property declaration:
+
+property MyProperty: boolean read FMyProperty write FMyProperty;
+
+~ FOLDING:
+
+Folding is supported in the following cases:
+
+- Folding of stream-like comments
+- Folding of groups of consecutive line comments
+- Folding of preprocessor blocks (the following preprocessor blocks are
+supported: IF / IFEND; IFDEF, IFNDEF, IFOPT / ENDIF and REGION / ENDREGION
+blocks), including nesting of preprocessor blocks up to 255 levels
+- Folding of code blocks on appropriate keywords (the following code blocks are
+supported: "begin, asm, record, try, case / end" blocks, class & object
+declarations and interface declarations)
+
+Remarks:
+
+- Folding of code blocks tries to handle all special cases in which folding
+should not occur. As implemented those are:
+
+1. Structure "record case / end" (there's only one "end" statement and "case" is
+ignored as fold point)
+2. Forward class declarations ("type TMyClass = class;") and object method
+declarations ("TNotifyEvent = procedure(Sender: TObject) of object;") are
+ignored as fold points
+3. Simplified complete class declarations ("type TMyClass = class(TObject);")
+are ignored as fold points
+4. Every other situation when class keyword doesn't actually start class
+declaration ("class procedure", "class function", "class of", "class var",
+"class property" and "class operator")
+5. Forward (disp)interface declarations ("type IMyInterface = interface;") are
+ignored as fold points
+
+- Folding of code blocks inside preprocessor blocks is disabled (any comments
+inside them will be folded fine) because there is no guarantee that complete
+code block will be contained inside folded preprocessor block in which case
+folded code block could end prematurely at the end of preprocessor block if
+there is no closing statement inside. This was done in order to properly process
+document that may contain something like this:
+
+type
+{$IFDEF UNICODE}
+ TMyClass = class(UnicodeAncestor)
+{$ELSE}
+ TMyClass = class(AnsiAncestor)
+{$ENDIF}
+ private
+ ...
+ public
+ ...
+ published
+ ...
+end;
+
+If class declarations were folded, then the second class declaration would end
+at "$ENDIF" statement, first class statement would end at "end;" statement and
+preprocessor "$IFDEF" block would go all the way to the end of document.
+However, having in mind all this, if you want to enable folding of code blocks
+inside preprocessor blocks, you can disable folding of preprocessor blocks by
+changing "fold.preprocessor" property, in which case everything inside them
+would be folded.
+
+~ KEYWORDS:
+
+The list of keywords that can be used in pascal.properties file (up to Delphi
+XE4):
+
+- Keywords: absolute abstract and array as asm assembler automated begin case
+cdecl class const constructor delayed deprecated destructor dispid dispinterface
+div do downto dynamic else end except experimental export exports external far
+file final finalization finally for forward function goto helper if
+implementation in inherited initialization inline interface is label library
+message mod near nil not object of on operator or out overload override packed
+pascal platform private procedure program property protected public published
+raise record reference register reintroduce repeat resourcestring safecall
+sealed set shl shr static stdcall strict string then threadvar to try type unit
+unsafe until uses var varargs virtual while winapi with xor
+
+- Keywords related to the "smart highlithing" feature: add default implements
+index name nodefault read readonly remove stored write writeonly
+
+- Keywords related to Delphi packages (in addition to all above): package
+contains requires
+
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void GetRangeLowered(unsigned int start,
+ unsigned int end,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void GetForwardRangeLowered(unsigned int start,
+ CharacterSet &charSet,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < len-1) && charSet.Contains(styler.SafeGetCharAt(start + i))) {
+ s[i] = static_cast<char>(tolower(styler.SafeGetCharAt(start + i)));
+ i++;
+ }
+ s[i] = '\0';
+
+}
+
+enum {
+ stateInAsm = 0x1000,
+ stateInProperty = 0x2000,
+ stateInExport = 0x4000,
+ stateFoldInPreprocessor = 0x0100,
+ stateFoldInRecord = 0x0200,
+ stateFoldInPreprocessorLevelMask = 0x00FF,
+ stateFoldMaskAll = 0x0FFF
+};
+
+static void ClassifyPascalWord(WordList *keywordlists[], StyleContext &sc, int &curLineState, bool bSmartHighlighting) {
+ WordList& keywords = *keywordlists[0];
+
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords.InList(s)) {
+ if (curLineState & stateInAsm) {
+ if (strcmp(s, "end") == 0 && sc.GetRelative(-4) != '@') {
+ curLineState &= ~stateInAsm;
+ sc.ChangeState(SCE_PAS_WORD);
+ } else {
+ sc.ChangeState(SCE_PAS_ASM);
+ }
+ } else {
+ bool ignoreKeyword = false;
+ if (strcmp(s, "asm") == 0) {
+ curLineState |= stateInAsm;
+ } else if (bSmartHighlighting) {
+ if (strcmp(s, "property") == 0) {
+ curLineState |= stateInProperty;
+ } else if (strcmp(s, "exports") == 0) {
+ curLineState |= stateInExport;
+ } else if (!(curLineState & (stateInProperty | stateInExport)) && strcmp(s, "index") == 0) {
+ ignoreKeyword = true;
+ } else if (!(curLineState & stateInExport) && strcmp(s, "name") == 0) {
+ ignoreKeyword = true;
+ } else if (!(curLineState & stateInProperty) &&
+ (strcmp(s, "read") == 0 || strcmp(s, "write") == 0 ||
+ strcmp(s, "default") == 0 || strcmp(s, "nodefault") == 0 ||
+ strcmp(s, "stored") == 0 || strcmp(s, "implements") == 0 ||
+ strcmp(s, "readonly") == 0 || strcmp(s, "writeonly") == 0 ||
+ strcmp(s, "add") == 0 || strcmp(s, "remove") == 0)) {
+ ignoreKeyword = true;
+ }
+ }
+ if (!ignoreKeyword) {
+ sc.ChangeState(SCE_PAS_WORD);
+ }
+ }
+ } else if (curLineState & stateInAsm) {
+ sc.ChangeState(SCE_PAS_ASM);
+ }
+ sc.SetState(SCE_PAS_DEFAULT);
+}
+
+static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ bool bSmartHighlighting = styler.GetPropertyInt("lexer.pascal.smart.highlighting", 1) != 0;
+
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
+ CharacterSet setNumber(CharacterSet::setDigits, ".-+eE");
+ CharacterSet setHexNumber(CharacterSet::setDigits, "abcdefABCDEF");
+ CharacterSet setOperator(CharacterSet::setNone, "#$&'()*+,-./:;<=>@[]^{}");
+
+ int curLine = styler.GetLine(startPos);
+ int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ curLine = styler.GetLine(sc.currentPos);
+ styler.SetLineState(curLine, curLineState);
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_PAS_NUMBER:
+ if (!setNumber.Contains(sc.ch) || (sc.ch == '.' && sc.chNext == '.')) {
+ sc.SetState(SCE_PAS_DEFAULT);
+ } else if (sc.ch == '-' || sc.ch == '+') {
+ if (sc.chPrev != 'E' && sc.chPrev != 'e') {
+ sc.SetState(SCE_PAS_DEFAULT);
+ }
+ }
+ break;
+ case SCE_PAS_IDENTIFIER:
+ if (!setWord.Contains(sc.ch)) {
+ ClassifyPascalWord(keywordlists, sc, curLineState, bSmartHighlighting);
+ }
+ break;
+ case SCE_PAS_HEXNUMBER:
+ if (!setHexNumber.Contains(sc.ch)) {
+ sc.SetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_COMMENT:
+ case SCE_PAS_PREPROCESSOR:
+ if (sc.ch == '}') {
+ sc.ForwardSetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_COMMENT2:
+ case SCE_PAS_PREPROCESSOR2:
+ if (sc.Match('*', ')')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_STRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_PAS_STRINGEOL);
+ } else if (sc.ch == '\'' && sc.chNext == '\'') {
+ sc.Forward();
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_CHARACTER:
+ if (!setHexNumber.Contains(sc.ch) && sc.ch != '$') {
+ sc.SetState(SCE_PAS_DEFAULT);
+ }
+ break;
+ case SCE_PAS_OPERATOR:
+ if (bSmartHighlighting && sc.chPrev == ';') {
+ curLineState &= ~(stateInProperty | stateInExport);
+ }
+ sc.SetState(SCE_PAS_DEFAULT);
+ break;
+ case SCE_PAS_ASM:
+ sc.SetState(SCE_PAS_DEFAULT);
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_PAS_DEFAULT) {
+ if (IsADigit(sc.ch) && !(curLineState & stateInAsm)) {
+ sc.SetState(SCE_PAS_NUMBER);
+ } else if (setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_PAS_IDENTIFIER);
+ } else if (sc.ch == '$' && !(curLineState & stateInAsm)) {
+ sc.SetState(SCE_PAS_HEXNUMBER);
+ } else if (sc.Match('{', '$')) {
+ sc.SetState(SCE_PAS_PREPROCESSOR);
+ } else if (sc.ch == '{') {
+ sc.SetState(SCE_PAS_COMMENT);
+ } else if (sc.Match("(*$")) {
+ sc.SetState(SCE_PAS_PREPROCESSOR2);
+ } else if (sc.Match('(', '*')) {
+ sc.SetState(SCE_PAS_COMMENT2);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_PAS_COMMENTLINE);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_PAS_STRING);
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_PAS_CHARACTER);
+ } else if (setOperator.Contains(sc.ch) && !(curLineState & stateInAsm)) {
+ sc.SetState(SCE_PAS_OPERATOR);
+ } else if (curLineState & stateInAsm) {
+ sc.SetState(SCE_PAS_ASM);
+ }
+ }
+ }
+
+ if (sc.state == SCE_PAS_IDENTIFIER && setWord.Contains(sc.chPrev)) {
+ ClassifyPascalWord(keywordlists, sc, curLineState, bSmartHighlighting);
+ }
+
+ sc.Complete();
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_PAS_COMMENT || style == SCE_PAS_COMMENT2;
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eolPos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eolPos; i++) {
+ char ch = styler[i];
+ char chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+ if (ch == '/' && chNext == '/' && style == SCE_PAS_COMMENTLINE) {
+ return true;
+ } else if (!IsASpaceOrTab(ch)) {
+ return false;
+ }
+ }
+ return false;
+}
+
+static unsigned int GetFoldInPreprocessorLevelFlag(int lineFoldStateCurrent) {
+ return lineFoldStateCurrent & stateFoldInPreprocessorLevelMask;
+}
+
+static void SetFoldInPreprocessorLevelFlag(int &lineFoldStateCurrent, unsigned int nestLevel) {
+ lineFoldStateCurrent &= ~stateFoldInPreprocessorLevelMask;
+ lineFoldStateCurrent |= nestLevel & stateFoldInPreprocessorLevelMask;
+}
+
+static void ClassifyPascalPreprocessorFoldPoint(int &levelCurrent, int &lineFoldStateCurrent,
+ unsigned int startPos, Accessor &styler) {
+ CharacterSet setWord(CharacterSet::setAlpha);
+
+ char s[11]; // Size of the longest possible keyword + one additional character + null
+ GetForwardRangeLowered(startPos, setWord, styler, s, sizeof(s));
+
+ unsigned int nestLevel = GetFoldInPreprocessorLevelFlag(lineFoldStateCurrent);
+
+ if (strcmp(s, "if") == 0 ||
+ strcmp(s, "ifdef") == 0 ||
+ strcmp(s, "ifndef") == 0 ||
+ strcmp(s, "ifopt") == 0 ||
+ strcmp(s, "region") == 0) {
+ nestLevel++;
+ SetFoldInPreprocessorLevelFlag(lineFoldStateCurrent, nestLevel);
+ lineFoldStateCurrent |= stateFoldInPreprocessor;
+ levelCurrent++;
+ } else if (strcmp(s, "endif") == 0 ||
+ strcmp(s, "ifend") == 0 ||
+ strcmp(s, "endregion") == 0) {
+ nestLevel--;
+ SetFoldInPreprocessorLevelFlag(lineFoldStateCurrent, nestLevel);
+ if (nestLevel == 0) {
+ lineFoldStateCurrent &= ~stateFoldInPreprocessor;
+ }
+ levelCurrent--;
+ if (levelCurrent < SC_FOLDLEVELBASE) {
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+static unsigned int SkipWhiteSpace(unsigned int currentPos, unsigned int endPos,
+ Accessor &styler, bool includeChars = false) {
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_");
+ unsigned int j = currentPos + 1;
+ char ch = styler.SafeGetCharAt(j);
+ while ((j < endPos) && (IsASpaceOrTab(ch) || ch == '\r' || ch == '\n' ||
+ IsStreamCommentStyle(styler.StyleAt(j)) || (includeChars && setWord.Contains(ch)))) {
+ j++;
+ ch = styler.SafeGetCharAt(j);
+ }
+ return j;
+}
+
+static void ClassifyPascalWordFoldPoint(int &levelCurrent, int &lineFoldStateCurrent,
+ int startPos, unsigned int endPos,
+ unsigned int lastStart, unsigned int currentPos, Accessor &styler) {
+ char s[100];
+ GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s));
+
+ if (strcmp(s, "record") == 0) {
+ lineFoldStateCurrent |= stateFoldInRecord;
+ levelCurrent++;
+ } else if (strcmp(s, "begin") == 0 ||
+ strcmp(s, "asm") == 0 ||
+ strcmp(s, "try") == 0 ||
+ (strcmp(s, "case") == 0 && !(lineFoldStateCurrent & stateFoldInRecord))) {
+ levelCurrent++;
+ } else if (strcmp(s, "class") == 0 || strcmp(s, "object") == 0) {
+ // "class" & "object" keywords require special handling...
+ bool ignoreKeyword = false;
+ unsigned int j = SkipWhiteSpace(currentPos, endPos, styler);
+ if (j < endPos) {
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_");
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_");
+
+ if (styler.SafeGetCharAt(j) == ';') {
+ // Handle forward class declarations ("type TMyClass = class;")
+ // and object method declarations ("TNotifyEvent = procedure(Sender: TObject) of object;")
+ ignoreKeyword = true;
+ } else if (strcmp(s, "class") == 0) {
+ // "class" keyword has a few more special cases...
+ if (styler.SafeGetCharAt(j) == '(') {
+ // Handle simplified complete class declarations ("type TMyClass = class(TObject);")
+ j = SkipWhiteSpace(j, endPos, styler, true);
+ if (j < endPos && styler.SafeGetCharAt(j) == ')') {
+ j = SkipWhiteSpace(j, endPos, styler);
+ if (j < endPos && styler.SafeGetCharAt(j) == ';') {
+ ignoreKeyword = true;
+ }
+ }
+ } else if (setWordStart.Contains(styler.SafeGetCharAt(j))) {
+ char s2[11]; // Size of the longest possible keyword + one additional character + null
+ GetForwardRangeLowered(j, setWord, styler, s2, sizeof(s2));
+
+ if (strcmp(s2, "procedure") == 0 ||
+ strcmp(s2, "function") == 0 ||
+ strcmp(s2, "of") == 0 ||
+ strcmp(s2, "var") == 0 ||
+ strcmp(s2, "property") == 0 ||
+ strcmp(s2, "operator") == 0) {
+ ignoreKeyword = true;
+ }
+ }
+ }
+ }
+ if (!ignoreKeyword) {
+ levelCurrent++;
+ }
+ } else if (strcmp(s, "interface") == 0) {
+ // "interface" keyword requires special handling...
+ bool ignoreKeyword = true;
+ int j = lastStart - 1;
+ char ch = styler.SafeGetCharAt(j);
+ while ((j >= startPos) && (IsASpaceOrTab(ch) || ch == '\r' || ch == '\n' ||
+ IsStreamCommentStyle(styler.StyleAt(j)))) {
+ j--;
+ ch = styler.SafeGetCharAt(j);
+ }
+ if (j >= startPos && styler.SafeGetCharAt(j) == '=') {
+ ignoreKeyword = false;
+ }
+ if (!ignoreKeyword) {
+ unsigned int k = SkipWhiteSpace(currentPos, endPos, styler);
+ if (k < endPos && styler.SafeGetCharAt(k) == ';') {
+ // Handle forward interface declarations ("type IMyInterface = interface;")
+ ignoreKeyword = true;
+ }
+ }
+ if (!ignoreKeyword) {
+ levelCurrent++;
+ }
+ } else if (strcmp(s, "dispinterface") == 0) {
+ // "dispinterface" keyword requires special handling...
+ bool ignoreKeyword = false;
+ unsigned int j = SkipWhiteSpace(currentPos, endPos, styler);
+ if (j < endPos && styler.SafeGetCharAt(j) == ';') {
+ // Handle forward dispinterface declarations ("type IMyInterface = dispinterface;")
+ ignoreKeyword = true;
+ }
+ if (!ignoreKeyword) {
+ levelCurrent++;
+ }
+ } else if (strcmp(s, "end") == 0) {
+ lineFoldStateCurrent &= ~stateFoldInRecord;
+ levelCurrent--;
+ if (levelCurrent < SC_FOLDLEVELBASE) {
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ int lineFoldStateCurrent = lineCurrent > 0 ? styler.GetLineState(lineCurrent - 1) & stateFoldMaskAll : 0;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+
+ int lastStart = 0;
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelCurrent++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+ if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
+ {
+ if (!IsCommentLine(lineCurrent - 1, styler)
+ && IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent++;
+ else if (IsCommentLine(lineCurrent - 1, styler)
+ && !IsCommentLine(lineCurrent+1, styler))
+ levelCurrent--;
+ }
+ if (foldPreprocessor) {
+ if (style == SCE_PAS_PREPROCESSOR && ch == '{' && chNext == '$') {
+ ClassifyPascalPreprocessorFoldPoint(levelCurrent, lineFoldStateCurrent, i + 2, styler);
+ } else if (style == SCE_PAS_PREPROCESSOR2 && ch == '(' && chNext == '*'
+ && styler.SafeGetCharAt(i + 2) == '$') {
+ ClassifyPascalPreprocessorFoldPoint(levelCurrent, lineFoldStateCurrent, i + 3, styler);
+ }
+ }
+
+ if (stylePrev != SCE_PAS_WORD && style == SCE_PAS_WORD)
+ {
+ // Store last word start point.
+ lastStart = i;
+ }
+ if (stylePrev == SCE_PAS_WORD && !(lineFoldStateCurrent & stateFoldInPreprocessor)) {
+ if(setWord.Contains(ch) && !setWord.Contains(chNext)) {
+ ClassifyPascalWordFoldPoint(levelCurrent, lineFoldStateCurrent, startPos, endPos, lastStart, i, styler);
+ }
+ }
+
+ if (!IsASpace(ch))
+ visibleChars++;
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ int newLineState = (styler.GetLineState(lineCurrent) & ~stateFoldMaskAll) | lineFoldStateCurrent;
+ styler.SetLineState(lineCurrent, newLineState);
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ }
+
+ // If we didn't reach the EOL in previous loop, store line level and whitespace information.
+ // The rest will be filled in later...
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ styler.SetLevel(lineCurrent, lev);
+}
+
+static const char * const pascalWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc, pascalWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPerl.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPerl.cxx
new file mode 100644
index 00000000000..b4a2dd12ebe
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPerl.cxx
@@ -0,0 +1,1729 @@
+// Scintilla source code edit control
+/** @file LexPerl.cxx
+ ** Lexer for Perl.
+ ** Converted to lexer object by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2008 by Neil Hodgson <neilh@scintilla.org>
+// Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Info for HERE document handling from perldata.pod (reformatted):
+// ----------------------------------------------------------------
+// A line-oriented form of quoting is based on the shell ``here-doc'' syntax.
+// Following a << you specify a string to terminate the quoted material, and
+// all lines following the current line down to the terminating string are
+// the value of the item.
+// * The terminating string may be either an identifier (a word), or some
+// quoted text.
+// * If quoted, the type of quotes you use determines the treatment of the
+// text, just as in regular quoting.
+// * An unquoted identifier works like double quotes.
+// * There must be no space between the << and the identifier.
+// (If you put a space it will be treated as a null identifier,
+// which is valid, and matches the first empty line.)
+// (This is deprecated, -w warns of this syntax)
+// * The terminating string must appear by itself (unquoted and
+// with no surrounding whitespace) on the terminating line.
+
+#define HERE_DELIM_MAX 256 // maximum length of HERE doc delimiter
+
+#define PERLNUM_BINARY 1 // order is significant: 1-4 cannot have a dot
+#define PERLNUM_HEX 2
+#define PERLNUM_OCTAL 3
+#define PERLNUM_FLOAT_EXP 4 // exponent part only
+#define PERLNUM_DECIMAL 5 // 1-5 are numbers; 6-7 are strings
+#define PERLNUM_VECTOR 6
+#define PERLNUM_V_VECTOR 7
+#define PERLNUM_BAD 8
+
+#define BACK_NONE 0 // lookback state for bareword disambiguation:
+#define BACK_OPERATOR 1 // whitespace/comments are insignificant
+#define BACK_KEYWORD 2 // operators/keywords are needed for disambiguation
+
+// all interpolated styles are different from their parent styles by a constant difference
+// we also assume SCE_PL_STRING_VAR is the interpolated style with the smallest value
+#define INTERPOLATE_SHIFT (SCE_PL_STRING_VAR - SCE_PL_STRING)
+
+static bool isPerlKeyword(unsigned int start, unsigned int end, WordList &keywords, LexAccessor &styler) {
+ // old-style keyword matcher; needed because GetCurrent() needs
+ // current segment to be committed, but we may abandon early...
+ char s[100];
+ unsigned int i, len = end - start;
+ if (len > 30) { len = 30; }
+ for (i = 0; i < len; i++, start++) s[i] = styler[start];
+ s[i] = '\0';
+ return keywords.InList(s);
+}
+
+static int disambiguateBareword(LexAccessor &styler, unsigned int bk, unsigned int fw,
+ int backFlag, unsigned int backPos, unsigned int endPos) {
+ // identifiers are recognized by Perl as barewords under some
+ // conditions, the following attempts to do the disambiguation
+ // by looking backward and forward; result in 2 LSB
+ int result = 0;
+ bool moreback = false; // true if passed newline/comments
+ bool brace = false; // true if opening brace found
+ // if BACK_NONE, neither operator nor keyword, so skip test
+ if (backFlag == BACK_NONE)
+ return result;
+ // first look backwards past whitespace/comments to set EOL flag
+ // (some disambiguation patterns must be on a single line)
+ if (backPos <= static_cast<unsigned int>(styler.LineStart(styler.GetLine(bk))))
+ moreback = true;
+ // look backwards at last significant lexed item for disambiguation
+ bk = backPos - 1;
+ int ch = static_cast<unsigned char>(styler.SafeGetCharAt(bk));
+ if (ch == '{' && !moreback) {
+ // {bareword: possible variable spec
+ brace = true;
+ } else if ((ch == '&' && styler.SafeGetCharAt(bk - 1) != '&')
+ // &bareword: subroutine call
+ || styler.Match(bk - 1, "->")
+ // ->bareword: part of variable spec
+ || styler.Match(bk - 2, "sub")) {
+ // sub bareword: subroutine declaration
+ // (implied BACK_KEYWORD, no keywords end in 'sub'!)
+ result |= 1;
+ }
+ // next, scan forward after word past tab/spaces only;
+ // if ch isn't one of '[{(,' we can skip the test
+ if ((ch == '{' || ch == '(' || ch == '['|| ch == ',')
+ && fw < endPos) {
+ while (ch = static_cast<unsigned char>(styler.SafeGetCharAt(fw)),
+ IsASpaceOrTab(ch) && fw < endPos) {
+ fw++;
+ }
+ if ((ch == '}' && brace)
+ // {bareword}: variable spec
+ || styler.Match(fw, "=>")) {
+ // [{(, bareword=>: hash literal
+ result |= 2;
+ }
+ }
+ return result;
+}
+
+static void skipWhitespaceComment(LexAccessor &styler, unsigned int &p) {
+ // when backtracking, we need to skip whitespace and comments
+ int style;
+ while ((p > 0) && (style = styler.StyleAt(p),
+ style == SCE_PL_DEFAULT || style == SCE_PL_COMMENTLINE))
+ p--;
+}
+
+static int styleBeforeBracePair(LexAccessor &styler, unsigned int bk) {
+ // backtrack to find open '{' corresponding to a '}', balanced
+ // return significant style to be tested for '/' disambiguation
+ int braceCount = 1;
+ if (bk == 0)
+ return SCE_PL_DEFAULT;
+ while (--bk > 0) {
+ if (styler.StyleAt(bk) == SCE_PL_OPERATOR) {
+ int bkch = static_cast<unsigned char>(styler.SafeGetCharAt(bk));
+ if (bkch == ';') { // early out
+ break;
+ } else if (bkch == '}') {
+ braceCount++;
+ } else if (bkch == '{') {
+ if (--braceCount == 0) break;
+ }
+ }
+ }
+ if (bk > 0 && braceCount == 0) {
+ // balanced { found, bk > 0, skip more whitespace/comments
+ bk--;
+ skipWhitespaceComment(styler, bk);
+ return styler.StyleAt(bk);
+ }
+ return SCE_PL_DEFAULT;
+}
+
+static int styleCheckIdentifier(LexAccessor &styler, unsigned int bk) {
+ // backtrack to classify sub-styles of identifier under test
+ // return sub-style to be tested for '/' disambiguation
+ if (styler.SafeGetCharAt(bk) == '>') // inputsymbol, like <foo>
+ return 1;
+ // backtrack to check for possible "->" or "::" before identifier
+ while (bk > 0 && styler.StyleAt(bk) == SCE_PL_IDENTIFIER) {
+ bk--;
+ }
+ while (bk > 0) {
+ int bkstyle = styler.StyleAt(bk);
+ if (bkstyle == SCE_PL_DEFAULT
+ || bkstyle == SCE_PL_COMMENTLINE) {
+ // skip whitespace, comments
+ } else if (bkstyle == SCE_PL_OPERATOR) {
+ // test for "->" and "::"
+ if (styler.Match(bk - 1, "->") || styler.Match(bk - 1, "::"))
+ return 2;
+ } else
+ return 3; // bare identifier
+ bk--;
+ }
+ return 0;
+}
+
+static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) {
+ // forward scan the current line to classify line for POD style
+ int state = -1;
+ while (pos < endPos) {
+ int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos));
+ if (ch == '\n' || ch == '\r') {
+ if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++;
+ break;
+ }
+ if (IsASpaceOrTab(ch)) { // whitespace, take note
+ if (state == -1)
+ state = SCE_PL_DEFAULT;
+ } else if (state == SCE_PL_DEFAULT) { // verbatim POD line
+ state = SCE_PL_POD_VERB;
+ } else if (state != SCE_PL_POD_VERB) { // regular POD line
+ state = SCE_PL_POD;
+ }
+ pos++;
+ }
+ if (state == -1)
+ state = SCE_PL_DEFAULT;
+ return state;
+}
+
+static bool styleCheckSubPrototype(LexAccessor &styler, unsigned int bk) {
+ // backtrack to identify if we're starting a subroutine prototype
+ // we also need to ignore whitespace/comments:
+ // 'sub' [whitespace|comment] <identifier> [whitespace|comment]
+ styler.Flush();
+ skipWhitespaceComment(styler, bk);
+ if (bk == 0 || styler.StyleAt(bk) != SCE_PL_IDENTIFIER) // check identifier
+ return false;
+ while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_IDENTIFIER)) {
+ bk--;
+ }
+ skipWhitespaceComment(styler, bk);
+ if (bk < 2 || styler.StyleAt(bk) != SCE_PL_WORD // check "sub" keyword
+ || !styler.Match(bk - 2, "sub")) // assume suffix is unique!
+ return false;
+ return true;
+}
+
+static int actualNumStyle(int numberStyle) {
+ if (numberStyle == PERLNUM_VECTOR || numberStyle == PERLNUM_V_VECTOR) {
+ return SCE_PL_STRING;
+ } else if (numberStyle == PERLNUM_BAD) {
+ return SCE_PL_ERROR;
+ }
+ return SCE_PL_NUMBER;
+}
+
+static int opposite(int ch) {
+ if (ch == '(') return ')';
+ if (ch == '[') return ']';
+ if (ch == '{') return '}';
+ if (ch == '<') return '>';
+ return ch;
+}
+
+static bool IsCommentLine(int line, LexAccessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ int style = styler.StyleAt(i);
+ if (ch == '#' && style == SCE_PL_COMMENTLINE)
+ return true;
+ else if (!IsASpaceOrTab(ch))
+ return false;
+ }
+ return false;
+}
+
+static bool IsPackageLine(int line, LexAccessor &styler) {
+ int pos = styler.LineStart(line);
+ int style = styler.StyleAt(pos);
+ if (style == SCE_PL_WORD && styler.Match(pos, "package")) {
+ return true;
+ }
+ return false;
+}
+
+static int PodHeadingLevel(int pos, LexAccessor &styler) {
+ int lvl = static_cast<unsigned char>(styler.SafeGetCharAt(pos + 5));
+ if (lvl >= '1' && lvl <= '4') {
+ return lvl - '0';
+ }
+ return 0;
+}
+
+// An individual named option for use in an OptionSet
+
+// Options used for LexerPerl
+struct OptionsPerl {
+ bool fold;
+ bool foldComment;
+ bool foldCompact;
+ // Custom folding of POD and packages
+ bool foldPOD; // fold.perl.pod
+ // Enable folding Pod blocks when using the Perl lexer.
+ bool foldPackage; // fold.perl.package
+ // Enable folding packages when using the Perl lexer.
+
+ bool foldCommentExplicit;
+
+ bool foldAtElse;
+
+ OptionsPerl() {
+ fold = false;
+ foldComment = false;
+ foldCompact = true;
+ foldPOD = true;
+ foldPackage = true;
+ foldCommentExplicit = true;
+ foldAtElse = false;
+ }
+};
+
+static const char *const perlWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+struct OptionSetPerl : public OptionSet<OptionsPerl> {
+ OptionSetPerl() {
+ DefineProperty("fold", &OptionsPerl::fold);
+
+ DefineProperty("fold.comment", &OptionsPerl::foldComment);
+
+ DefineProperty("fold.compact", &OptionsPerl::foldCompact);
+
+ DefineProperty("fold.perl.pod", &OptionsPerl::foldPOD,
+ "Set to 0 to disable folding Pod blocks when using the Perl lexer.");
+
+ DefineProperty("fold.perl.package", &OptionsPerl::foldPackage,
+ "Set to 0 to disable folding packages when using the Perl lexer.");
+
+ DefineProperty("fold.perl.comment.explicit", &OptionsPerl::foldCommentExplicit,
+ "Set to 0 to disable explicit folding.");
+
+ DefineProperty("fold.perl.at.else", &OptionsPerl::foldAtElse,
+ "This option enables Perl folding on a \"} else {\" line of an if statement.");
+
+ DefineWordListSets(perlWordListDesc);
+ }
+};
+
+class LexerPerl : public ILexer {
+ CharacterSet setWordStart;
+ CharacterSet setWord;
+ CharacterSet setSpecialVar;
+ CharacterSet setControlVar;
+ WordList keywords;
+ OptionsPerl options;
+ OptionSetPerl osPerl;
+public:
+ LexerPerl() :
+ setWordStart(CharacterSet::setAlpha, "_", 0x80, true),
+ setWord(CharacterSet::setAlphaNum, "_", 0x80, true),
+ setSpecialVar(CharacterSet::setNone, "\"$;<>&`'+,./\\%:=~!?@[]"),
+ setControlVar(CharacterSet::setNone, "ACDEFHILMNOPRSTVWX") {
+ }
+ virtual ~LexerPerl() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char *SCI_METHOD PropertyNames() {
+ return osPerl.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osPerl.PropertyType(name);
+ }
+ const char *SCI_METHOD DescribeProperty(const char *name) {
+ return osPerl.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char *SCI_METHOD DescribeWordListSets() {
+ return osPerl.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void *SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactoryPerl() {
+ return new LexerPerl();
+ }
+ int InputSymbolScan(StyleContext &sc);
+ void InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern=false);
+};
+
+int SCI_METHOD LexerPerl::PropertySet(const char *key, const char *val) {
+ if (osPerl.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerPerl::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+int LexerPerl::InputSymbolScan(StyleContext &sc) {
+ // forward scan for matching > on same line; file handles
+ int c, sLen = 0;
+ while ((c = sc.GetRelativeCharacter(++sLen)) != 0) {
+ if (c == '\r' || c == '\n') {
+ return 0;
+ } else if (c == '>') {
+ if (sc.Match("<=>")) // '<=>' case
+ return 0;
+ return sLen;
+ }
+ }
+ return 0;
+}
+
+void LexerPerl::InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern) {
+ // interpolate a segment (with no active backslashes or delimiters within)
+ // switch in or out of an interpolation style or continue current style
+ // commit variable patterns if found, trim segment, repeat until done
+ while (maxSeg > 0) {
+ bool isVar = false;
+ int sLen = 0;
+ if ((maxSeg > 1) && (sc.ch == '$' || sc.ch == '@')) {
+ // $#[$]*word [$@][$]*word (where word or {word} is always present)
+ bool braces = false;
+ sLen = 1;
+ if (sc.ch == '$' && sc.chNext == '#') { // starts with $#
+ sLen++;
+ }
+ while ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '$')) // >0 $ dereference within
+ sLen++;
+ if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '{')) { // { start for {word}
+ sLen++;
+ braces = true;
+ }
+ if (maxSeg > sLen) {
+ int c = sc.GetRelativeCharacter(sLen);
+ if (setWordStart.Contains(c)) { // word (various)
+ sLen++;
+ isVar = true;
+ while (maxSeg > sLen) {
+ if (!setWord.Contains(sc.GetRelativeCharacter(sLen)))
+ break;
+ sLen++;
+ }
+ } else if (braces && IsADigit(c) && (sLen == 2)) { // digit for ${digit}
+ sLen++;
+ isVar = true;
+ }
+ }
+ if (braces) {
+ if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '}')) { // } end for {word}
+ sLen++;
+ } else
+ isVar = false;
+ }
+ }
+ if (!isVar && (maxSeg > 1)) { // $- or @-specific variable patterns
+ int c = sc.chNext;
+ if (sc.ch == '$') {
+ sLen = 1;
+ if (IsADigit(c)) { // $[0-9] and slurp trailing digits
+ sLen++;
+ isVar = true;
+ while ((maxSeg > sLen) && IsADigit(sc.GetRelativeCharacter(sLen)))
+ sLen++;
+ } else if (setSpecialVar.Contains(c)) { // $ special variables
+ sLen++;
+ isVar = true;
+ } else if (!isPattern && ((c == '(') || (c == ')') || (c == '|'))) { // $ additional
+ sLen++;
+ isVar = true;
+ } else if (c == '^') { // $^A control-char style
+ sLen++;
+ if ((maxSeg > sLen) && setControlVar.Contains(sc.GetRelativeCharacter(sLen))) {
+ sLen++;
+ isVar = true;
+ }
+ }
+ } else if (sc.ch == '@') {
+ sLen = 1;
+ if (!isPattern && ((c == '+') || (c == '-'))) { // @ specials non-pattern
+ sLen++;
+ isVar = true;
+ }
+ }
+ }
+ if (isVar) { // commit as interpolated variable or normal character
+ if (sc.state < SCE_PL_STRING_VAR)
+ sc.SetState(sc.state + INTERPOLATE_SHIFT);
+ sc.Forward(sLen);
+ maxSeg -= sLen;
+ } else {
+ if (sc.state >= SCE_PL_STRING_VAR)
+ sc.SetState(sc.state - INTERPOLATE_SHIFT);
+ sc.Forward();
+ maxSeg--;
+ }
+ }
+ if (sc.state >= SCE_PL_STRING_VAR)
+ sc.SetState(sc.state - INTERPOLATE_SHIFT);
+}
+
+void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+
+ // keywords that forces /PATTERN/ at all times; should track vim's behaviour
+ WordList reWords;
+ reWords.Set("elsif if split while");
+
+ // charset classes
+ CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMAC");
+ // lexing of "%*</" operators is non-trivial; these are missing in the set below
+ CharacterSet setPerlOperator(CharacterSet::setNone, "^&\\()-+=|{}[]:;>,?!.~");
+ CharacterSet setQDelim(CharacterSet::setNone, "qrwx");
+ CharacterSet setModifiers(CharacterSet::setAlpha);
+ CharacterSet setPreferRE(CharacterSet::setNone, "*/<%");
+ // setArray and setHash also accepts chars for special vars like $_,
+ // which are then truncated when the next char does not match setVar
+ CharacterSet setVar(CharacterSet::setAlphaNum, "#$_'", 0x80, true);
+ CharacterSet setArray(CharacterSet::setAlpha, "#$_+-", 0x80, true);
+ CharacterSet setHash(CharacterSet::setAlpha, "#$_!^+-", 0x80, true);
+ CharacterSet &setPOD = setModifiers;
+ CharacterSet setNonHereDoc(CharacterSet::setDigits, "=$@");
+ CharacterSet setHereDocDelim(CharacterSet::setAlphaNum, "_");
+ CharacterSet setSubPrototype(CharacterSet::setNone, "\\[$@%&*+];");
+ // for format identifiers
+ CharacterSet setFormatStart(CharacterSet::setAlpha, "_=");
+ CharacterSet &setFormat = setHereDocDelim;
+
+ // Lexer for perl often has to backtrack to start of current style to determine
+ // which characters are being used as quotes, how deeply nested is the
+ // start position and what the termination string is for HERE documents.
+
+ class HereDocCls { // Class to manage HERE doc sequence
+ public:
+ int State;
+ // 0: '<<' encountered
+ // 1: collect the delimiter
+ // 2: here doc text (lines after the delimiter)
+ int Quote; // the char after '<<'
+ bool Quoted; // true if Quote in ('\'','"','`')
+ int DelimiterLength; // strlen(Delimiter)
+ char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf
+ HereDocCls() {
+ State = 0;
+ Quote = 0;
+ Quoted = false;
+ DelimiterLength = 0;
+ Delimiter = new char[HERE_DELIM_MAX];
+ Delimiter[0] = '\0';
+ }
+ void Append(int ch) {
+ Delimiter[DelimiterLength++] = static_cast<char>(ch);
+ Delimiter[DelimiterLength] = '\0';
+ }
+ ~HereDocCls() {
+ delete []Delimiter;
+ }
+ };
+ HereDocCls HereDoc; // TODO: FIFO for stacked here-docs
+
+ class QuoteCls { // Class to manage quote pairs
+ public:
+ int Rep;
+ int Count;
+ int Up, Down;
+ QuoteCls() {
+ New(1);
+ }
+ void New(int r = 1) {
+ Rep = r;
+ Count = 0;
+ Up = '\0';
+ Down = '\0';
+ }
+ void Open(int u) {
+ Count++;
+ Up = u;
+ Down = opposite(Up);
+ }
+ };
+ QuoteCls Quote;
+
+ // additional state for number lexing
+ int numState = PERLNUM_DECIMAL;
+ int dotCount = 0;
+
+ unsigned int endPos = startPos + length;
+
+ // Backtrack to beginning of style if required...
+ // If in a long distance lexical state, backtrack to find quote characters.
+ // Includes strings (may be multi-line), numbers (additional state), format
+ // bodies, as well as POD sections.
+ if (initStyle == SCE_PL_HERE_Q
+ || initStyle == SCE_PL_HERE_QQ
+ || initStyle == SCE_PL_HERE_QX
+ || initStyle == SCE_PL_FORMAT
+ || initStyle == SCE_PL_HERE_QQ_VAR
+ || initStyle == SCE_PL_HERE_QX_VAR
+ ) {
+ // backtrack through multiple styles to reach the delimiter start
+ int delim = (initStyle == SCE_PL_FORMAT) ? SCE_PL_FORMAT_IDENT:SCE_PL_HERE_DELIM;
+ while ((startPos > 1) && (styler.StyleAt(startPos) != delim)) {
+ startPos--;
+ }
+ startPos = styler.LineStart(styler.GetLine(startPos));
+ initStyle = styler.StyleAt(startPos - 1);
+ }
+ if (initStyle == SCE_PL_STRING
+ || initStyle == SCE_PL_STRING_QQ
+ || initStyle == SCE_PL_BACKTICKS
+ || initStyle == SCE_PL_STRING_QX
+ || initStyle == SCE_PL_REGEX
+ || initStyle == SCE_PL_STRING_QR
+ || initStyle == SCE_PL_REGSUBST
+ || initStyle == SCE_PL_STRING_VAR
+ || initStyle == SCE_PL_STRING_QQ_VAR
+ || initStyle == SCE_PL_BACKTICKS_VAR
+ || initStyle == SCE_PL_STRING_QX_VAR
+ || initStyle == SCE_PL_REGEX_VAR
+ || initStyle == SCE_PL_STRING_QR_VAR
+ || initStyle == SCE_PL_REGSUBST_VAR
+ ) {
+ // for interpolation, must backtrack through a mix of two different styles
+ int otherStyle = (initStyle >= SCE_PL_STRING_VAR) ?
+ initStyle - INTERPOLATE_SHIFT : initStyle + INTERPOLATE_SHIFT;
+ while (startPos > 1) {
+ int st = styler.StyleAt(startPos - 1);
+ if ((st != initStyle) && (st != otherStyle))
+ break;
+ startPos--;
+ }
+ initStyle = SCE_PL_DEFAULT;
+ } else if (initStyle == SCE_PL_STRING_Q
+ || initStyle == SCE_PL_STRING_QW
+ || initStyle == SCE_PL_XLAT
+ || initStyle == SCE_PL_CHARACTER
+ || initStyle == SCE_PL_NUMBER
+ || initStyle == SCE_PL_IDENTIFIER
+ || initStyle == SCE_PL_ERROR
+ || initStyle == SCE_PL_SUB_PROTOTYPE
+ ) {
+ while ((startPos > 1) && (styler.StyleAt(startPos - 1) == initStyle)) {
+ startPos--;
+ }
+ initStyle = SCE_PL_DEFAULT;
+ } else if (initStyle == SCE_PL_POD
+ || initStyle == SCE_PL_POD_VERB
+ ) {
+ // POD backtracking finds preceding blank lines and goes back past them
+ int ln = styler.GetLine(startPos);
+ if (ln > 0) {
+ initStyle = styler.StyleAt(styler.LineStart(--ln));
+ if (initStyle == SCE_PL_POD || initStyle == SCE_PL_POD_VERB) {
+ while (ln > 0 && styler.GetLineState(ln) == SCE_PL_DEFAULT)
+ ln--;
+ }
+ startPos = styler.LineStart(++ln);
+ initStyle = styler.StyleAt(startPos - 1);
+ } else {
+ startPos = 0;
+ initStyle = SCE_PL_DEFAULT;
+ }
+ }
+
+ // backFlag, backPos are additional state to aid identifier corner cases.
+ // Look backwards past whitespace and comments in order to detect either
+ // operator or keyword. Later updated as we go along.
+ int backFlag = BACK_NONE;
+ unsigned int backPos = startPos;
+ if (backPos > 0) {
+ backPos--;
+ skipWhitespaceComment(styler, backPos);
+ if (styler.StyleAt(backPos) == SCE_PL_OPERATOR)
+ backFlag = BACK_OPERATOR;
+ else if (styler.StyleAt(backPos) == SCE_PL_WORD)
+ backFlag = BACK_KEYWORD;
+ backPos++;
+ }
+
+ StyleContext sc(startPos, endPos - startPos, initStyle, styler, static_cast<char>(STYLE_MAX));
+
+ for (; sc.More(); sc.Forward()) {
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_PL_OPERATOR:
+ sc.SetState(SCE_PL_DEFAULT);
+ backFlag = BACK_OPERATOR;
+ backPos = sc.currentPos;
+ break;
+ case SCE_PL_IDENTIFIER: // identifier, bareword, inputsymbol
+ if ((!setWord.Contains(sc.ch) && sc.ch != '\'')
+ || sc.Match('.', '.')
+ || sc.chPrev == '>') { // end of inputsymbol
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ break;
+ case SCE_PL_WORD: // keyword, plus special cases
+ if (!setWord.Contains(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if ((strcmp(s, "__DATA__") == 0) || (strcmp(s, "__END__") == 0)) {
+ sc.ChangeState(SCE_PL_DATASECTION);
+ } else {
+ if ((strcmp(s, "format") == 0)) {
+ sc.SetState(SCE_PL_FORMAT_IDENT);
+ HereDoc.State = 0;
+ } else {
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ backFlag = BACK_KEYWORD;
+ backPos = sc.currentPos;
+ }
+ }
+ break;
+ case SCE_PL_SCALAR:
+ case SCE_PL_ARRAY:
+ case SCE_PL_HASH:
+ case SCE_PL_SYMBOLTABLE:
+ if (sc.Match(':', ':')) { // skip ::
+ sc.Forward();
+ } else if (!setVar.Contains(sc.ch)) {
+ if (sc.LengthCurrent() == 1) {
+ // Special variable: $(, $_ etc.
+ sc.Forward();
+ }
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ break;
+ case SCE_PL_NUMBER:
+ // if no early break, number style is terminated at "(go through)"
+ if (sc.ch == '.') {
+ if (sc.chNext == '.') {
+ // double dot is always an operator (go through)
+ } else if (numState <= PERLNUM_FLOAT_EXP) {
+ // non-decimal number or float exponent, consume next dot
+ sc.SetState(SCE_PL_OPERATOR);
+ break;
+ } else { // decimal or vectors allows dots
+ dotCount++;
+ if (numState == PERLNUM_DECIMAL) {
+ if (dotCount <= 1) // number with one dot in it
+ break;
+ if (IsADigit(sc.chNext)) { // really a vector
+ numState = PERLNUM_VECTOR;
+ break;
+ }
+ // number then dot (go through)
+ } else if (IsADigit(sc.chNext)) // vectors
+ break;
+ // vector then dot (go through)
+ }
+ } else if (sc.ch == '_') {
+ // permissive underscoring for number and vector literals
+ break;
+ } else if (numState == PERLNUM_DECIMAL) {
+ if (sc.ch == 'E' || sc.ch == 'e') { // exponent, sign
+ numState = PERLNUM_FLOAT_EXP;
+ if (sc.chNext == '+' || sc.chNext == '-') {
+ sc.Forward();
+ }
+ break;
+ } else if (IsADigit(sc.ch))
+ break;
+ // number then word (go through)
+ } else if (numState == PERLNUM_HEX) {
+ if (IsADigit(sc.ch, 16))
+ break;
+ } else if (numState == PERLNUM_VECTOR || numState == PERLNUM_V_VECTOR) {
+ if (IsADigit(sc.ch)) // vector
+ break;
+ if (setWord.Contains(sc.ch) && dotCount == 0) { // change to word
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ break;
+ }
+ // vector then word (go through)
+ } else if (IsADigit(sc.ch)) {
+ if (numState == PERLNUM_FLOAT_EXP) {
+ break;
+ } else if (numState == PERLNUM_OCTAL) {
+ if (sc.ch <= '7') break;
+ } else if (numState == PERLNUM_BINARY) {
+ if (sc.ch <= '1') break;
+ }
+ // mark invalid octal, binary numbers (go through)
+ numState = PERLNUM_BAD;
+ break;
+ }
+ // complete current number or vector
+ sc.ChangeState(actualNumStyle(numState));
+ sc.SetState(SCE_PL_DEFAULT);
+ break;
+ case SCE_PL_COMMENTLINE:
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ break;
+ case SCE_PL_HERE_DELIM:
+ if (HereDoc.State == 0) { // '<<' encountered
+ int delim_ch = sc.chNext;
+ int ws_skip = 0;
+ HereDoc.State = 1; // pre-init HERE doc class
+ HereDoc.Quote = sc.chNext;
+ HereDoc.Quoted = false;
+ HereDoc.DelimiterLength = 0;
+ HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0';
+ if (IsASpaceOrTab(delim_ch)) {
+ // skip whitespace; legal only for quoted delimiters
+ unsigned int i = sc.currentPos + 1;
+ while ((i < endPos) && IsASpaceOrTab(delim_ch)) {
+ i++;
+ delim_ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ }
+ ws_skip = i - sc.currentPos - 1;
+ }
+ if (delim_ch == '\'' || delim_ch == '"' || delim_ch == '`') {
+ // a quoted here-doc delimiter; skip any whitespace
+ sc.Forward(ws_skip + 1);
+ HereDoc.Quote = delim_ch;
+ HereDoc.Quoted = true;
+ } else if ((ws_skip == 0 && setNonHereDoc.Contains(sc.chNext))
+ || ws_skip > 0) {
+ // left shift << or <<= operator cases
+ // restore position if operator
+ sc.ChangeState(SCE_PL_OPERATOR);
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ backFlag = BACK_OPERATOR;
+ backPos = sc.currentPos;
+ HereDoc.State = 0;
+ } else {
+ // specially handle initial '\' for identifier
+ if (ws_skip == 0 && HereDoc.Quote == '\\')
+ sc.Forward();
+ // an unquoted here-doc delimiter, no special handling
+ // (cannot be prefixed by spaces/tabs), or
+ // symbols terminates; deprecated zero-length delimiter
+ }
+ } else if (HereDoc.State == 1) { // collect the delimiter
+ backFlag = BACK_NONE;
+ if (HereDoc.Quoted) { // a quoted here-doc delimiter
+ if (sc.ch == HereDoc.Quote) { // closing quote => end of delimiter
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ } else if (!sc.atLineEnd) {
+ if (sc.Match('\\', static_cast<char>(HereDoc.Quote))) { // escaped quote
+ sc.Forward();
+ }
+ if (sc.ch != '\r') { // skip CR if CRLF
+ int i = 0; // else append char, possibly an extended char
+ while (i < sc.width) {
+ HereDoc.Append(static_cast<unsigned char>(styler.SafeGetCharAt(sc.currentPos + i)));
+ i++;
+ }
+ }
+ }
+ } else { // an unquoted here-doc delimiter, no extended charsets
+ if (setHereDocDelim.Contains(sc.ch)) {
+ HereDoc.Append(sc.ch);
+ } else {
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ }
+ if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) {
+ sc.SetState(SCE_PL_ERROR);
+ HereDoc.State = 0;
+ }
+ }
+ break;
+ case SCE_PL_HERE_Q:
+ case SCE_PL_HERE_QQ:
+ case SCE_PL_HERE_QX:
+ // also implies HereDoc.State == 2
+ sc.Complete();
+ if (HereDoc.DelimiterLength == 0 || sc.Match(HereDoc.Delimiter)) {
+ int c = sc.GetRelative(HereDoc.DelimiterLength);
+ if (c == '\r' || c == '\n') { // peek first, do not consume match
+ sc.ForwardBytes(HereDoc.DelimiterLength);
+ sc.SetState(SCE_PL_DEFAULT);
+ backFlag = BACK_NONE;
+ HereDoc.State = 0;
+ if (!sc.atLineEnd)
+ sc.Forward();
+ break;
+ }
+ }
+ if (sc.state == SCE_PL_HERE_Q) { // \EOF and 'EOF' non-interpolated
+ while (!sc.atLineEnd)
+ sc.Forward();
+ break;
+ }
+ while (!sc.atLineEnd) { // "EOF" and `EOF` interpolated
+ int c, sLen = 0, endType = 0;
+ while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
+ // scan to break string into segments
+ if (c == '\\') {
+ endType = 1; break;
+ } else if (c == '\r' || c == '\n') {
+ endType = 2; break;
+ }
+ sLen++;
+ }
+ if (sLen > 0) // process non-empty segments
+ InterpolateSegment(sc, sLen);
+ if (endType == 1) {
+ sc.Forward();
+ // \ at end-of-line does not appear to have any effect, skip
+ if (sc.ch != '\r' && sc.ch != '\n')
+ sc.Forward();
+ } else if (endType == 2) {
+ if (!sc.atLineEnd)
+ sc.Forward();
+ }
+ }
+ break;
+ case SCE_PL_POD:
+ case SCE_PL_POD_VERB: {
+ unsigned int fw = sc.currentPos;
+ int ln = styler.GetLine(fw);
+ if (sc.atLineStart && sc.Match("=cut")) { // end of POD
+ sc.SetState(SCE_PL_POD);
+ sc.Forward(4);
+ sc.SetState(SCE_PL_DEFAULT);
+ styler.SetLineState(ln, SCE_PL_POD);
+ break;
+ }
+ int pod = podLineScan(styler, fw, endPos); // classify POD line
+ styler.SetLineState(ln, pod);
+ if (pod == SCE_PL_DEFAULT) {
+ if (sc.state == SCE_PL_POD_VERB) {
+ unsigned int fw2 = fw;
+ while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) {
+ fw = fw2++; // penultimate line (last blank line)
+ pod = podLineScan(styler, fw2, endPos);
+ styler.SetLineState(styler.GetLine(fw2), pod);
+ }
+ if (pod == SCE_PL_POD) { // truncate verbatim POD early
+ sc.SetState(SCE_PL_POD);
+ } else
+ fw = fw2;
+ }
+ } else {
+ if (pod == SCE_PL_POD_VERB // still part of current paragraph
+ && (styler.GetLineState(ln - 1) == SCE_PL_POD)) {
+ pod = SCE_PL_POD;
+ styler.SetLineState(ln, pod);
+ } else if (pod == SCE_PL_POD
+ && (styler.GetLineState(ln - 1) == SCE_PL_POD_VERB)) {
+ pod = SCE_PL_POD_VERB;
+ styler.SetLineState(ln, pod);
+ }
+ sc.SetState(pod);
+ }
+ sc.ForwardBytes(fw - sc.currentPos); // commit style
+ }
+ break;
+ case SCE_PL_REGEX:
+ case SCE_PL_STRING_QR:
+ if (Quote.Rep <= 0) {
+ if (!setModifiers.Contains(sc.ch))
+ sc.SetState(SCE_PL_DEFAULT);
+ } else if (!Quote.Up && !IsASpace(sc.ch)) {
+ Quote.Open(sc.ch);
+ } else {
+ int c, sLen = 0, endType = 0;
+ while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
+ // scan to break string into segments
+ if (IsASpace(c)) {
+ break;
+ } else if (c == '\\' && Quote.Up != '\\') {
+ endType = 1; break;
+ } else if (c == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ Quote.Rep--;
+ break;
+ }
+ } else if (c == Quote.Up)
+ Quote.Count++;
+ sLen++;
+ }
+ if (sLen > 0) { // process non-empty segments
+ if (Quote.Up != '\'') {
+ InterpolateSegment(sc, sLen, true);
+ } else // non-interpolated path
+ sc.Forward(sLen);
+ }
+ if (endType == 1)
+ sc.Forward();
+ }
+ break;
+ case SCE_PL_REGSUBST:
+ case SCE_PL_XLAT:
+ if (Quote.Rep <= 0) {
+ if (!setModifiers.Contains(sc.ch))
+ sc.SetState(SCE_PL_DEFAULT);
+ } else if (!Quote.Up && !IsASpace(sc.ch)) {
+ Quote.Open(sc.ch);
+ } else {
+ int c, sLen = 0, endType = 0;
+ bool isPattern = (Quote.Rep == 2);
+ while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
+ // scan to break string into segments
+ if (c == '\\' && Quote.Up != '\\') {
+ endType = 2; break;
+ } else if (Quote.Count == 0 && Quote.Rep == 1) {
+ // We matched something like s(...) or tr{...}, Perl 5.10
+ // appears to allow almost any character for use as the
+ // next delimiters. Whitespace and comments are accepted in
+ // between, but we'll limit to whitespace here.
+ // For '#', if no whitespace in between, it's a delimiter.
+ if (IsASpace(c)) {
+ // Keep going
+ } else if (c == '#' && IsASpaceOrTab(sc.GetRelativeCharacter(sLen - 1))) {
+ endType = 3;
+ } else
+ Quote.Open(c);
+ break;
+ } else if (c == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ Quote.Rep--;
+ endType = 1;
+ }
+ if (Quote.Up == Quote.Down)
+ Quote.Count++;
+ if (endType == 1)
+ break;
+ } else if (c == Quote.Up) {
+ Quote.Count++;
+ } else if (IsASpace(c))
+ break;
+ sLen++;
+ }
+ if (sLen > 0) { // process non-empty segments
+ if (sc.state == SCE_PL_REGSUBST && Quote.Up != '\'') {
+ InterpolateSegment(sc, sLen, isPattern);
+ } else // non-interpolated path
+ sc.Forward(sLen);
+ }
+ if (endType == 2) {
+ sc.Forward();
+ } else if (endType == 3)
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ break;
+ case SCE_PL_STRING_Q:
+ case SCE_PL_STRING_QQ:
+ case SCE_PL_STRING_QX:
+ case SCE_PL_STRING_QW:
+ case SCE_PL_STRING:
+ case SCE_PL_CHARACTER:
+ case SCE_PL_BACKTICKS:
+ if (!Quote.Down && !IsASpace(sc.ch)) {
+ Quote.Open(sc.ch);
+ } else {
+ int c, sLen = 0, endType = 0;
+ while ((c = sc.GetRelativeCharacter(sLen)) != 0) {
+ // scan to break string into segments
+ if (IsASpace(c)) {
+ break;
+ } else if (c == '\\' && Quote.Up != '\\') {
+ endType = 2; break;
+ } else if (c == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ endType = 3; break;
+ }
+ } else if (c == Quote.Up)
+ Quote.Count++;
+ sLen++;
+ }
+ if (sLen > 0) { // process non-empty segments
+ switch (sc.state) {
+ case SCE_PL_STRING:
+ case SCE_PL_STRING_QQ:
+ case SCE_PL_BACKTICKS:
+ InterpolateSegment(sc, sLen);
+ break;
+ case SCE_PL_STRING_QX:
+ if (Quote.Up != '\'') {
+ InterpolateSegment(sc, sLen);
+ break;
+ }
+ // (continued for ' delim)
+ default: // non-interpolated path
+ sc.Forward(sLen);
+ }
+ }
+ if (endType == 2) {
+ sc.Forward();
+ } else if (endType == 3)
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ }
+ break;
+ case SCE_PL_SUB_PROTOTYPE: {
+ int i = 0;
+ // forward scan; must all be valid proto characters
+ while (setSubPrototype.Contains(sc.GetRelative(i)))
+ i++;
+ if (sc.GetRelative(i) == ')') { // valid sub prototype
+ sc.ForwardBytes(i);
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ } else {
+ // abandon prototype, restart from '('
+ sc.ChangeState(SCE_PL_OPERATOR);
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_PL_FORMAT: {
+ sc.Complete();
+ if (sc.Match('.')) {
+ sc.Forward();
+ if (sc.atLineEnd || ((sc.ch == '\r' && sc.chNext == '\n')))
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ while (!sc.atLineEnd)
+ sc.Forward();
+ }
+ break;
+ case SCE_PL_ERROR:
+ break;
+ }
+ // Needed for specific continuation styles (one follows the other)
+ switch (sc.state) {
+ // continued from SCE_PL_WORD
+ case SCE_PL_FORMAT_IDENT:
+ // occupies HereDoc state 3 to avoid clashing with HERE docs
+ if (IsASpaceOrTab(sc.ch)) { // skip whitespace
+ sc.ChangeState(SCE_PL_DEFAULT);
+ while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd)
+ sc.Forward();
+ sc.SetState(SCE_PL_FORMAT_IDENT);
+ }
+ if (setFormatStart.Contains(sc.ch)) { // identifier or '='
+ if (sc.ch != '=') {
+ do {
+ sc.Forward();
+ } while (setFormat.Contains(sc.ch));
+ }
+ while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd)
+ sc.Forward();
+ if (sc.ch == '=') {
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ HereDoc.State = 3;
+ } else {
+ // invalid identifier; inexact fallback, but hey
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ sc.SetState(SCE_PL_DEFAULT);
+ }
+ } else {
+ sc.ChangeState(SCE_PL_DEFAULT); // invalid identifier
+ }
+ backFlag = BACK_NONE;
+ break;
+ }
+
+ // Must check end of HereDoc states here before default state is handled
+ if (HereDoc.State == 1 && sc.atLineEnd) {
+ // Begin of here-doc (the line after the here-doc delimiter):
+ // Lexically, the here-doc starts from the next line after the >>, but the
+ // first line of here-doc seem to follow the style of the last EOL sequence
+ int st_new = SCE_PL_HERE_QQ;
+ HereDoc.State = 2;
+ if (HereDoc.Quoted) {
+ if (sc.state == SCE_PL_HERE_DELIM) {
+ // Missing quote at end of string! We are stricter than perl.
+ // Colour here-doc anyway while marking this bit as an error.
+ sc.ChangeState(SCE_PL_ERROR);
+ }
+ switch (HereDoc.Quote) {
+ case '\'':
+ st_new = SCE_PL_HERE_Q;
+ break;
+ case '"' :
+ st_new = SCE_PL_HERE_QQ;
+ break;
+ case '`' :
+ st_new = SCE_PL_HERE_QX;
+ break;
+ }
+ } else {
+ if (HereDoc.Quote == '\\')
+ st_new = SCE_PL_HERE_Q;
+ }
+ sc.SetState(st_new);
+ }
+ if (HereDoc.State == 3 && sc.atLineEnd) {
+ // Start of format body.
+ HereDoc.State = 0;
+ sc.SetState(SCE_PL_FORMAT);
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_PL_DEFAULT) {
+ if (IsADigit(sc.ch) ||
+ (IsADigit(sc.chNext) && (sc.ch == '.' || sc.ch == 'v'))) {
+ sc.SetState(SCE_PL_NUMBER);
+ backFlag = BACK_NONE;
+ numState = PERLNUM_DECIMAL;
+ dotCount = 0;
+ if (sc.ch == '0') { // hex,bin,octal
+ if (sc.chNext == 'x' || sc.chNext == 'X') {
+ numState = PERLNUM_HEX;
+ } else if (sc.chNext == 'b' || sc.chNext == 'B') {
+ numState = PERLNUM_BINARY;
+ } else if (IsADigit(sc.chNext)) {
+ numState = PERLNUM_OCTAL;
+ }
+ if (numState != PERLNUM_DECIMAL) {
+ sc.Forward();
+ }
+ } else if (sc.ch == 'v') { // vector
+ numState = PERLNUM_V_VECTOR;
+ }
+ } else if (setWord.Contains(sc.ch)) {
+ // if immediately prefixed by '::', always a bareword
+ sc.SetState(SCE_PL_WORD);
+ if (sc.chPrev == ':' && sc.GetRelative(-2) == ':') {
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ }
+ unsigned int bk = sc.currentPos;
+ unsigned int fw = sc.currentPos + 1;
+ // first check for possible quote-like delimiter
+ if (sc.ch == 's' && !setWord.Contains(sc.chNext)) {
+ sc.ChangeState(SCE_PL_REGSUBST);
+ Quote.New(2);
+ } else if (sc.ch == 'm' && !setWord.Contains(sc.chNext)) {
+ sc.ChangeState(SCE_PL_REGEX);
+ Quote.New();
+ } else if (sc.ch == 'q' && !setWord.Contains(sc.chNext)) {
+ sc.ChangeState(SCE_PL_STRING_Q);
+ Quote.New();
+ } else if (sc.ch == 'y' && !setWord.Contains(sc.chNext)) {
+ sc.ChangeState(SCE_PL_XLAT);
+ Quote.New(2);
+ } else if (sc.Match('t', 'r') && !setWord.Contains(sc.GetRelative(2))) {
+ sc.ChangeState(SCE_PL_XLAT);
+ Quote.New(2);
+ sc.Forward();
+ fw++;
+ } else if (sc.ch == 'q' && setQDelim.Contains(sc.chNext)
+ && !setWord.Contains(sc.GetRelative(2))) {
+ if (sc.chNext == 'q') sc.ChangeState(SCE_PL_STRING_QQ);
+ else if (sc.chNext == 'x') sc.ChangeState(SCE_PL_STRING_QX);
+ else if (sc.chNext == 'r') sc.ChangeState(SCE_PL_STRING_QR);
+ else sc.ChangeState(SCE_PL_STRING_QW); // sc.chNext == 'w'
+ Quote.New();
+ sc.Forward();
+ fw++;
+ } else if (sc.ch == 'x' && (sc.chNext == '=' || // repetition
+ !setWord.Contains(sc.chNext) ||
+ (IsADigit(sc.chPrev) && IsADigit(sc.chNext)))) {
+ sc.ChangeState(SCE_PL_OPERATOR);
+ }
+ // if potentially a keyword, scan forward and grab word, then check
+ // if it's really one; if yes, disambiguation test is performed
+ // otherwise it is always a bareword and we skip a lot of scanning
+ if (sc.state == SCE_PL_WORD) {
+ while (setWord.Contains(static_cast<unsigned char>(styler.SafeGetCharAt(fw))))
+ fw++;
+ if (!isPerlKeyword(styler.GetStartSegment(), fw, keywords, styler)) {
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ }
+ }
+ // if already SCE_PL_IDENTIFIER, then no ambiguity, skip this
+ // for quote-like delimiters/keywords, attempt to disambiguate
+ // to select for bareword, change state -> SCE_PL_IDENTIFIER
+ if (sc.state != SCE_PL_IDENTIFIER && bk > 0) {
+ if (disambiguateBareword(styler, bk, fw, backFlag, backPos, endPos))
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ }
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_PL_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_PL_STRING);
+ Quote.New();
+ Quote.Open(sc.ch);
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '\'') {
+ if (sc.chPrev == '&' && setWordStart.Contains(sc.chNext)) {
+ // Archaic call
+ sc.SetState(SCE_PL_IDENTIFIER);
+ } else {
+ sc.SetState(SCE_PL_CHARACTER);
+ Quote.New();
+ Quote.Open(sc.ch);
+ }
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '`') {
+ sc.SetState(SCE_PL_BACKTICKS);
+ Quote.New();
+ Quote.Open(sc.ch);
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '$') {
+ sc.SetState(SCE_PL_SCALAR);
+ if (sc.chNext == '{') {
+ sc.ForwardSetState(SCE_PL_OPERATOR);
+ } else if (IsASpace(sc.chNext)) {
+ sc.ForwardSetState(SCE_PL_DEFAULT);
+ } else {
+ sc.Forward();
+ if (sc.Match('`', '`') || sc.Match(':', ':')) {
+ sc.Forward();
+ }
+ }
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '@') {
+ sc.SetState(SCE_PL_ARRAY);
+ if (setArray.Contains(sc.chNext)) {
+ // no special treatment
+ } else if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
+ sc.ForwardBytes(2);
+ } else if (sc.chNext == '{' || sc.chNext == '[') {
+ sc.ForwardSetState(SCE_PL_OPERATOR);
+ } else {
+ sc.ChangeState(SCE_PL_OPERATOR);
+ }
+ backFlag = BACK_NONE;
+ } else if (setPreferRE.Contains(sc.ch)) {
+ // Explicit backward peeking to set a consistent preferRE for
+ // any slash found, so no longer need to track preferRE state.
+ // Find first previous significant lexed element and interpret.
+ // A few symbols shares this code for disambiguation.
+ bool preferRE = false;
+ bool isHereDoc = sc.Match('<', '<');
+ bool hereDocSpace = false; // for: SCALAR [whitespace] '<<'
+ unsigned int bk = (sc.currentPos > 0) ? sc.currentPos - 1: 0;
+ sc.Complete();
+ styler.Flush();
+ if (styler.StyleAt(bk) == SCE_PL_DEFAULT)
+ hereDocSpace = true;
+ skipWhitespaceComment(styler, bk);
+ if (bk == 0) {
+ // avoid backward scanning breakage
+ preferRE = true;
+ } else {
+ int bkstyle = styler.StyleAt(bk);
+ int bkch = static_cast<unsigned char>(styler.SafeGetCharAt(bk));
+ switch (bkstyle) {
+ case SCE_PL_OPERATOR:
+ preferRE = true;
+ if (bkch == ')' || bkch == ']') {
+ preferRE = false;
+ } else if (bkch == '}') {
+ // backtrack by counting balanced brace pairs
+ // needed to test for variables like ${}, @{} etc.
+ bkstyle = styleBeforeBracePair(styler, bk);
+ if (bkstyle == SCE_PL_SCALAR
+ || bkstyle == SCE_PL_ARRAY
+ || bkstyle == SCE_PL_HASH
+ || bkstyle == SCE_PL_SYMBOLTABLE
+ || bkstyle == SCE_PL_OPERATOR) {
+ preferRE = false;
+ }
+ } else if (bkch == '+' || bkch == '-') {
+ if (bkch == static_cast<unsigned char>(styler.SafeGetCharAt(bk - 1))
+ && bkch != static_cast<unsigned char>(styler.SafeGetCharAt(bk - 2)))
+ // exceptions for operators: unary suffixes ++, --
+ preferRE = false;
+ }
+ break;
+ case SCE_PL_IDENTIFIER:
+ preferRE = true;
+ bkstyle = styleCheckIdentifier(styler, bk);
+ if ((bkstyle == 1) || (bkstyle == 2)) {
+ // inputsymbol or var with "->" or "::" before identifier
+ preferRE = false;
+ } else if (bkstyle == 3) {
+ // bare identifier, test cases follows:
+ if (sc.ch == '/') {
+ // if '/', /PATTERN/ unless digit/space immediately after '/'
+ // if '//', always expect defined-or operator to follow identifier
+ if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.chNext == '/')
+ preferRE = false;
+ } else if (sc.ch == '*' || sc.ch == '%') {
+ if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.Match('*', '*'))
+ preferRE = false;
+ } else if (sc.ch == '<') {
+ if (IsASpace(sc.chNext) || sc.chNext == '=')
+ preferRE = false;
+ }
+ }
+ break;
+ case SCE_PL_SCALAR: // for $var<< case:
+ if (isHereDoc && hereDocSpace) // if SCALAR whitespace '<<', *always* a HERE doc
+ preferRE = true;
+ break;
+ case SCE_PL_WORD:
+ preferRE = true;
+ // for HERE docs, always true
+ if (sc.ch == '/') {
+ // adopt heuristics similar to vim-style rules:
+ // keywords always forced as /PATTERN/: split, if, elsif, while
+ // everything else /PATTERN/ unless digit/space immediately after '/'
+ // for '//', defined-or favoured unless special keywords
+ unsigned int bkend = bk + 1;
+ while (bk > 0 && styler.StyleAt(bk - 1) == SCE_PL_WORD) {
+ bk--;
+ }
+ if (isPerlKeyword(bk, bkend, reWords, styler))
+ break;
+ if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.chNext == '/')
+ preferRE = false;
+ } else if (sc.ch == '*' || sc.ch == '%') {
+ if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.Match('*', '*'))
+ preferRE = false;
+ } else if (sc.ch == '<') {
+ if (IsASpace(sc.chNext) || sc.chNext == '=')
+ preferRE = false;
+ }
+ break;
+
+ // other styles uses the default, preferRE=false
+ case SCE_PL_POD:
+ case SCE_PL_HERE_Q:
+ case SCE_PL_HERE_QQ:
+ case SCE_PL_HERE_QX:
+ preferRE = true;
+ break;
+ }
+ }
+ backFlag = BACK_NONE;
+ if (isHereDoc) { // handle '<<', HERE doc
+ if (preferRE) {
+ sc.SetState(SCE_PL_HERE_DELIM);
+ HereDoc.State = 0;
+ } else { // << operator
+ sc.SetState(SCE_PL_OPERATOR);
+ sc.Forward();
+ }
+ } else if (sc.ch == '*') { // handle '*', typeglob
+ if (preferRE) {
+ sc.SetState(SCE_PL_SYMBOLTABLE);
+ if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
+ sc.ForwardBytes(2);
+ } else if (sc.chNext == '{') {
+ sc.ForwardSetState(SCE_PL_OPERATOR);
+ } else {
+ sc.Forward();
+ }
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ if (sc.chNext == '*') // exponentiation
+ sc.Forward();
+ }
+ } else if (sc.ch == '%') { // handle '%', hash
+ if (preferRE) {
+ sc.SetState(SCE_PL_HASH);
+ if (setHash.Contains(sc.chNext)) {
+ sc.Forward();
+ } else if (sc.chNext == ':' && sc.GetRelative(2) == ':') {
+ sc.ForwardBytes(2);
+ } else if (sc.chNext == '{') {
+ sc.ForwardSetState(SCE_PL_OPERATOR);
+ } else {
+ sc.ChangeState(SCE_PL_OPERATOR);
+ }
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ }
+ } else if (sc.ch == '<') { // handle '<', inputsymbol
+ if (preferRE) {
+ // forward scan
+ int i = InputSymbolScan(sc);
+ if (i > 0) {
+ sc.SetState(SCE_PL_IDENTIFIER);
+ sc.Forward(i);
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ }
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ }
+ } else { // handle '/', regexp
+ if (preferRE) {
+ sc.SetState(SCE_PL_REGEX);
+ Quote.New();
+ Quote.Open(sc.ch);
+ } else { // / and // operators
+ sc.SetState(SCE_PL_OPERATOR);
+ if (sc.chNext == '/') {
+ sc.Forward();
+ }
+ }
+ }
+ } else if (sc.ch == '=' // POD
+ && setPOD.Contains(sc.chNext)
+ && sc.atLineStart) {
+ sc.SetState(SCE_PL_POD);
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '-' && setWordStart.Contains(sc.chNext)) { // extended '-' cases
+ unsigned int bk = sc.currentPos;
+ unsigned int fw = 2;
+ if (setSingleCharOp.Contains(sc.chNext) && // file test operators
+ !setWord.Contains(sc.GetRelative(2))) {
+ sc.SetState(SCE_PL_WORD);
+ } else {
+ // nominally a minus and bareword; find extent of bareword
+ while (setWord.Contains(sc.GetRelative(fw)))
+ fw++;
+ sc.SetState(SCE_PL_OPERATOR);
+ }
+ // force to bareword for hash key => or {variable literal} cases
+ if (disambiguateBareword(styler, bk, bk + fw, backFlag, backPos, endPos) & 2) {
+ sc.ChangeState(SCE_PL_IDENTIFIER);
+ }
+ backFlag = BACK_NONE;
+ } else if (sc.ch == '(' && sc.currentPos > 0) { // '(' or subroutine prototype
+ sc.Complete();
+ if (styleCheckSubPrototype(styler, sc.currentPos - 1)) {
+ sc.SetState(SCE_PL_SUB_PROTOTYPE);
+ backFlag = BACK_NONE;
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ }
+ } else if (setPerlOperator.Contains(sc.ch)) { // operators
+ sc.SetState(SCE_PL_OPERATOR);
+ if (sc.Match('.', '.')) { // .. and ...
+ sc.Forward();
+ if (sc.chNext == '.') sc.Forward();
+ }
+ } else if (sc.ch == 4 || sc.ch == 26) { // ^D and ^Z ends valid perl source
+ sc.SetState(SCE_PL_DATASECTION);
+ } else {
+ // keep colouring defaults
+ sc.Complete();
+ }
+ }
+ }
+ sc.Complete();
+ if (sc.state == SCE_PL_HERE_Q
+ || sc.state == SCE_PL_HERE_QQ
+ || sc.state == SCE_PL_HERE_QX
+ || sc.state == SCE_PL_FORMAT) {
+ styler.ChangeLexerState(sc.currentPos, styler.Length());
+ }
+ sc.Complete();
+}
+
+#define PERL_HEADFOLD_SHIFT 4
+#define PERL_HEADFOLD_MASK 0xF0
+
+void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initStyle */, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+
+ // Backtrack to previous line in case need to fix its fold status
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+
+ int levelPrev = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelPrev = styler.LevelAt(lineCurrent - 1) >> 16;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ char chPrev = styler.SafeGetCharAt(startPos - 1);
+ int styleNext = styler.StyleAt(startPos);
+ // Used at end of line to determine if the line was a package definition
+ bool isPackageLine = false;
+ int podHeading = 0;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ int stylePrevCh = (i) ? styler.StyleAt(i - 1):SCE_PL_DEFAULT;
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ bool atLineStart = ((chPrev == '\r') || (chPrev == '\n')) || i == 0;
+ // Comment folding
+ if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler)) {
+ if (!IsCommentLine(lineCurrent - 1, styler)
+ && IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent++;
+ else if (IsCommentLine(lineCurrent - 1, styler)
+ && !IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent--;
+ }
+ // {} [] block folding
+ if (style == SCE_PL_OPERATOR) {
+ if (ch == '{') {
+ if (options.foldAtElse && levelCurrent < levelPrev)
+ --levelPrev;
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ if (ch == '[') {
+ if (options.foldAtElse && levelCurrent < levelPrev)
+ --levelPrev;
+ levelCurrent++;
+ } else if (ch == ']') {
+ levelCurrent--;
+ }
+ }
+ // POD folding
+ if (options.foldPOD && atLineStart) {
+ if (style == SCE_PL_POD) {
+ if (stylePrevCh != SCE_PL_POD && stylePrevCh != SCE_PL_POD_VERB)
+ levelCurrent++;
+ else if (styler.Match(i, "=cut"))
+ levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1;
+ else if (styler.Match(i, "=head"))
+ podHeading = PodHeadingLevel(i, styler);
+ } else if (style == SCE_PL_DATASECTION) {
+ if (ch == '=' && IsASCII(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE)
+ levelCurrent++;
+ else if (styler.Match(i, "=cut") && levelCurrent > SC_FOLDLEVELBASE)
+ levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1;
+ else if (styler.Match(i, "=head"))
+ podHeading = PodHeadingLevel(i, styler);
+ // if package used or unclosed brace, level > SC_FOLDLEVELBASE!
+ // reset needed as level test is vs. SC_FOLDLEVELBASE
+ else if (stylePrevCh != SCE_PL_DATASECTION)
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+ // package folding
+ if (options.foldPackage && atLineStart) {
+ if (IsPackageLine(lineCurrent, styler)
+ && !IsPackageLine(lineCurrent + 1, styler))
+ isPackageLine = true;
+ }
+
+ //heredoc folding
+ switch (style) {
+ case SCE_PL_HERE_QQ :
+ case SCE_PL_HERE_Q :
+ case SCE_PL_HERE_QX :
+ switch (stylePrevCh) {
+ case SCE_PL_HERE_QQ :
+ case SCE_PL_HERE_Q :
+ case SCE_PL_HERE_QX :
+ //do nothing;
+ break;
+ default :
+ levelCurrent++;
+ break;
+ }
+ break;
+ default:
+ switch (stylePrevCh) {
+ case SCE_PL_HERE_QQ :
+ case SCE_PL_HERE_Q :
+ case SCE_PL_HERE_QX :
+ levelCurrent--;
+ break;
+ default :
+ //do nothing;
+ break;
+ }
+ break;
+ }
+
+ //explicit folding
+ if (options.foldCommentExplicit && style == SCE_PL_COMMENTLINE && ch == '#') {
+ if (chNext == '{') {
+ levelCurrent++;
+ } else if (levelCurrent > SC_FOLDLEVELBASE && chNext == '}') {
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ // POD headings occupy bits 7-4, leaving some breathing room for
+ // non-standard practice -- POD sections stuck in blocks, etc.
+ if (podHeading > 0) {
+ levelCurrent = (lev & ~PERL_HEADFOLD_MASK) | (podHeading << PERL_HEADFOLD_SHIFT);
+ lev = levelCurrent - 1;
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ podHeading = 0;
+ }
+ // Check if line was a package declaration
+ // because packages need "special" treatment
+ if (isPackageLine) {
+ lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ levelCurrent = SC_FOLDLEVELBASE + 1;
+ isPackageLine = false;
+ }
+ lev |= levelCurrent << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ chPrev = ch;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerPro.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerPro.cxx
new file mode 100644
index 00000000000..e8a7a6689b0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerPro.cxx
@@ -0,0 +1,630 @@
+// Scintilla source code edit control
+// @file LexPowerPro.cxx
+// PowerPro utility, written by Bruce Switzer, is available from http://powerpro.webeddie.com
+// PowerPro lexer is written by Christopher Bean (cbean@cb-software.net)
+//
+// Lexer code heavily borrowed from:
+// LexAU3.cxx by Jos van der Zande
+// LexCPP.cxx by Neil Hodgson
+// LexVB.cxx by Neil Hodgson
+//
+// Changes:
+// 2008-10-25 - Initial release
+// 2008-10-26 - Changed how <name> is hilighted in 'function <name>' so that
+// local isFunction = "" and local functions = "" don't get falsely highlighted
+// 2008-12-14 - Added bounds checking for szFirstWord and szDo
+// - Replaced SetOfCharacters with CharacterSet
+// - Made sure that CharacterSet::Contains is passed only positive values
+// - Made sure that the return value of Accessor::SafeGetCharAt is positive before
+// passing to functions that require positive values like isspacechar()
+// - Removed unused visibleChars processing from ColourisePowerProDoc()
+// - Fixed bug with folding logic where line continuations didn't end where
+// they were supposed to
+// - Moved all helper functions to the top of the file
+// 2010-06-03 - Added onlySpaces variable to allow the @function and ;comment styles to be indented
+// - Modified HasFunction function to be a bit more robust
+// - Renamed HasFunction function to IsFunction
+// - Cleanup
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsStreamCommentStyle(int style) {
+ return style == SCE_POWERPRO_COMMENTBLOCK;
+}
+
+static inline bool IsLineEndChar(unsigned char ch) {
+ return ch == 0x0a //LF
+ || ch == 0x0c //FF
+ || ch == 0x0d; //CR
+}
+
+static bool IsContinuationLine(unsigned int szLine, Accessor &styler)
+{
+ int startPos = styler.LineStart(szLine);
+ int endPos = styler.LineStart(szLine + 1) - 2;
+ while (startPos < endPos)
+ {
+ char stylech = styler.StyleAt(startPos);
+ if (!(stylech == SCE_POWERPRO_COMMENTBLOCK)) {
+ char ch = styler.SafeGetCharAt(endPos);
+ char chPrev = styler.SafeGetCharAt(endPos - 1);
+ char chPrevPrev = styler.SafeGetCharAt(endPos - 2);
+ if (ch > 0 && chPrev > 0 && chPrevPrev > 0 && !isspacechar(ch) && !isspacechar(chPrev) && !isspacechar(chPrevPrev) )
+ return (chPrevPrev == ';' && chPrev == ';' && ch == '+');
+ }
+ endPos--; // skip to next char
+ }
+ return false;
+}
+
+// Routine to find first none space on the current line and return its Style
+// needed for comment lines not starting on pos 1
+static int GetStyleFirstWord(int szLine, Accessor &styler)
+{
+ int startPos = styler.LineStart(szLine);
+ int endPos = styler.LineStart(szLine + 1) - 1;
+ char ch = styler.SafeGetCharAt(startPos);
+
+ while (ch > 0 && isspacechar(ch) && startPos < endPos)
+ {
+ startPos++; // skip to next char
+ ch = styler.SafeGetCharAt(startPos);
+ }
+ return styler.StyleAt(startPos);
+}
+
+//returns true if there is a function to highlight
+//used to highlight <name> in 'function <name>'
+//note:
+// sample line (without quotes): "\tfunction asdf()
+// currentPos will be the position of 'a'
+static bool IsFunction(Accessor &styler, unsigned int currentPos) {
+
+ const char function[10] = "function "; //10 includes \0
+ unsigned int numberOfCharacters = sizeof(function) - 1;
+ unsigned int position = currentPos - numberOfCharacters;
+
+ //compare each character with the letters in the function array
+ //return false if ALL don't match
+ for (unsigned int i = 0; i < numberOfCharacters; i++) {
+ char c = styler.SafeGetCharAt(position++);
+ if (c != function[i])
+ return false;
+ }
+
+ //make sure that there are only spaces (or tabs) between the beginning
+ //of the line and the function declaration
+ position = currentPos - numberOfCharacters - 1; //-1 to move to char before 'function'
+ for (unsigned int j = 0; j < 16; j++) { //check up to 16 preceeding characters
+ char c = styler.SafeGetCharAt(position--, '\0'); //if can't read char, return NUL (past beginning of document)
+ if (c <= 0) //reached beginning of document
+ return true;
+ if (c > 0 && IsLineEndChar(c))
+ return true;
+ else if (c > 0 && !IsASpaceOrTab(c))
+ return false;
+ }
+
+ //fall-through
+ return false;
+}
+
+static void ColourisePowerProDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler, bool caseSensitive) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+
+ //define the character sets
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_@", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ char s_save[100]; //for last line highlighting
+
+ //are there only spaces between the first letter of the line and the beginning of the line
+ bool onlySpaces = true;
+
+ for (; sc.More(); sc.Forward()) {
+
+ // save the total current word for eof processing
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if ((sc.ch > 0) && setWord.Contains(sc.ch))
+ {
+ strcpy(s_save,s);
+ int tp = static_cast<int>(strlen(s_save));
+ if (tp < 99) {
+ s_save[tp] = static_cast<char>(tolower(sc.ch));
+ s_save[tp+1] = '\0';
+ }
+ }
+
+ if (sc.atLineStart) {
+ if (sc.state == SCE_POWERPRO_DOUBLEQUOTEDSTRING) {
+ // Prevent SCE_POWERPRO_STRINGEOL from leaking back to previous line which
+ // ends with a line continuation by locking in the state upto this position.
+ sc.SetState(SCE_POWERPRO_DOUBLEQUOTEDSTRING);
+ }
+ }
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_POWERPRO_OPERATOR:
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ break;
+
+ case SCE_POWERPRO_NUMBER:
+
+ if (!IsADigit(sc.ch))
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+
+ break;
+
+ case SCE_POWERPRO_IDENTIFIER:
+ //if ((sc.ch > 0) && !setWord.Contains(sc.ch) || (sc.ch == '.')) { // use this line if don't want to match keywords with . in them. ie: win.debug will match both win and debug so win debug will also be colorized
+ if ((sc.ch > 0) && !setWord.Contains(sc.ch)){ // || (sc.ch == '.')) { // use this line if you want to match keywords with a . ie: win.debug will only match win.debug neither win nor debug will be colorized separately
+ char s[1000];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_POWERPRO_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_POWERPRO_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_POWERPRO_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_POWERPRO_WORD4);
+ }
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_LINECONTINUE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ } else if (sc.Match('/', '*') || sc.Match('/', '/')) {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_COMMENTBLOCK:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_DOUBLEQUOTEDSTRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_POWERPRO_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_SINGLEQUOTEDSTRING:
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_POWERPRO_STRINGEOL);
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_STRINGEOL:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+
+ case SCE_POWERPRO_VERBATIM:
+ if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_POWERPRO_DEFAULT);
+ }
+ }
+ break;
+
+ case SCE_POWERPRO_ALTQUOTE:
+ if (sc.ch == '#') {
+ if (sc.chNext == '#') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_POWERPRO_DEFAULT);
+ }
+ }
+ break;
+
+ case SCE_POWERPRO_FUNCTION:
+ if (isspacechar(sc.ch) || sc.ch == '(') {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_POWERPRO_DEFAULT) {
+ if (sc.Match('?', '\"')) {
+ sc.SetState(SCE_POWERPRO_VERBATIM);
+ sc.Forward();
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_POWERPRO_NUMBER);
+ }else if (sc.Match('?','#')) {
+ if (sc.ch == '?' && sc.chNext == '#') {
+ sc.SetState(SCE_POWERPRO_ALTQUOTE);
+ sc.Forward();
+ }
+ } else if (IsFunction(styler, sc.currentPos)) { //highlight <name> in 'function <name>'
+ sc.SetState(SCE_POWERPRO_FUNCTION);
+ } else if (onlySpaces && sc.ch == '@') { //alternate function definition [label]
+ sc.SetState(SCE_POWERPRO_FUNCTION);
+ } else if ((sc.ch > 0) && (setWordStart.Contains(sc.ch) || (sc.ch == '?'))) {
+ sc.SetState(SCE_POWERPRO_IDENTIFIER);
+ } else if (sc.Match(";;+")) {
+ sc.SetState(SCE_POWERPRO_LINECONTINUE);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_POWERPRO_COMMENTBLOCK);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ sc.SetState(SCE_POWERPRO_COMMENTLINE);
+ } else if (onlySpaces && sc.ch == ';') { //legacy comment that can only have blank space in front of it
+ sc.SetState(SCE_POWERPRO_COMMENTLINE);
+ } else if (sc.Match(";;")) {
+ sc.SetState(SCE_POWERPRO_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_POWERPRO_DOUBLEQUOTEDSTRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_POWERPRO_SINGLEQUOTEDSTRING);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_POWERPRO_OPERATOR);
+ }
+ }
+
+ //maintain a record of whether or not all the preceding characters on
+ //a line are space characters
+ if (onlySpaces && !IsASpaceOrTab(sc.ch))
+ onlySpaces = false;
+
+ //reset when starting a new line
+ if (sc.atLineEnd)
+ onlySpaces = true;
+ }
+
+ //*************************************
+ // Colourize the last word correctly
+ //*************************************
+ if (sc.state == SCE_POWERPRO_IDENTIFIER)
+ {
+ if (keywords.InList(s_save)) {
+ sc.ChangeState(SCE_POWERPRO_WORD);
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ else if (keywords2.InList(s_save)) {
+ sc.ChangeState(SCE_POWERPRO_WORD2);
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ else if (keywords3.InList(s_save)) {
+ sc.ChangeState(SCE_POWERPRO_WORD3);
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ else if (keywords4.InList(s_save)) {
+ sc.ChangeState(SCE_POWERPRO_WORD4);
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ else {
+ sc.SetState(SCE_POWERPRO_DEFAULT);
+ }
+ }
+ sc.Complete();
+}
+
+static void FoldPowerProDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ //define the character sets
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_@", 0x80, true);
+ CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
+
+ //used to tell if we're recursively folding the whole document, or just a small piece (ie: if statement or 1 function)
+ bool isFoldingAll = true;
+
+ int endPos = startPos + length;
+ int lastLine = styler.GetLine(styler.Length()); //used to help fold the last line correctly
+
+ // get settings from the config files for folding comments and preprocessor lines
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldInComment = styler.GetPropertyInt("fold.comment") == 2;
+ bool foldCompact = true;
+
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ isFoldingAll = false;
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+ // vars for style of previous/current/next lines
+ int style = GetStyleFirstWord(lineCurrent,styler);
+ int stylePrev = 0;
+
+ // find the first previous line without continuation character at the end
+ while ((lineCurrent > 0 && IsContinuationLine(lineCurrent, styler))
+ || (lineCurrent > 1 && IsContinuationLine(lineCurrent - 1, styler))) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+
+ if (lineCurrent > 0) {
+ stylePrev = GetStyleFirstWord(lineCurrent-1,styler);
+ }
+
+ // vars for getting first word to check for keywords
+ bool isFirstWordStarted = false;
+ bool isFirstWordEnded = false;
+
+ const unsigned int FIRST_WORD_MAX_LEN = 10;
+ char szFirstWord[FIRST_WORD_MAX_LEN] = "";
+ unsigned int firstWordLen = 0;
+
+ char szDo[3]="";
+ int szDolen = 0;
+ bool isDoLastWord = false;
+
+ // var for indentlevel
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelNext = levelCurrent;
+
+ int visibleChars = 0;
+ int functionCount = 0;
+
+ char chNext = styler.SafeGetCharAt(startPos);
+ char chPrev = '\0';
+ char chPrevPrev = '\0';
+ char chPrevPrevPrev = '\0';
+
+ for (int i = startPos; i < endPos; i++) {
+
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch > 0) && setWord.Contains(ch))
+ visibleChars++;
+
+ // get the syle for the current character neede to check in comment
+ int stylech = styler.StyleAt(i);
+
+ // start the capture of the first word
+ if (!isFirstWordStarted && (ch > 0)) {
+ if (setWord.Contains(ch) || setWordStart.Contains(ch) || ch == ';' || ch == '/') {
+ isFirstWordStarted = true;
+ if (firstWordLen < FIRST_WORD_MAX_LEN - 1) {
+ szFirstWord[firstWordLen++] = static_cast<char>(tolower(ch));
+ szFirstWord[firstWordLen] = '\0';
+ }
+ }
+ } // continue capture of the first word on the line
+ else if (isFirstWordStarted && !isFirstWordEnded && (ch > 0)) {
+ if (!setWord.Contains(ch)) {
+ isFirstWordEnded = true;
+ }
+ else if (firstWordLen < (FIRST_WORD_MAX_LEN - 1)) {
+ szFirstWord[firstWordLen++] = static_cast<char>(tolower(ch));
+ szFirstWord[firstWordLen] = '\0';
+ }
+ }
+
+ if (stylech != SCE_POWERPRO_COMMENTLINE) {
+
+ //reset isDoLastWord if we find a character(ignoring spaces) after 'do'
+ if (isDoLastWord && (ch > 0) && setWord.Contains(ch))
+ isDoLastWord = false;
+
+ // --find out if the word "do" is the last on a "if" line--
+ // collect each letter and put it into a buffer 2 chars long
+ // if we end up with "do" in the buffer when we reach the end of
+ // the line, "do" was the last word on the line
+ if ((ch > 0) && isFirstWordEnded && strcmp(szFirstWord, "if") == 0) {
+ if (szDolen == 2) {
+ szDo[0] = szDo[1];
+ szDo[1] = static_cast<char>(tolower(ch));
+ szDo[2] = '\0';
+
+ if (strcmp(szDo, "do") == 0)
+ isDoLastWord = true;
+
+ } else if (szDolen < 2) {
+ szDo[szDolen++] = static_cast<char>(tolower(ch));
+ szDo[szDolen] = '\0';
+ }
+ }
+ }
+
+ // End of Line found so process the information
+ if ((ch == '\r' && chNext != '\n') // \r\n
+ || ch == '\n' // \n
+ || i == endPos) { // end of selection
+
+ // **************************
+ // Folding logic for Keywords
+ // **************************
+
+ // if a keyword is found on the current line and the line doesn't end with ;;+ (continuation)
+ // and we are not inside a commentblock.
+ if (firstWordLen > 0
+ && chPrev != '+' && chPrevPrev != ';' && chPrevPrevPrev !=';'
+ && (!IsStreamCommentStyle(style) || foldInComment) ) {
+
+ // only fold "if" last keyword is "then" (else its a one line if)
+ if (strcmp(szFirstWord, "if") == 0 && isDoLastWord)
+ levelNext++;
+
+ // create new fold for these words
+ if (strcmp(szFirstWord, "for") == 0)
+ levelNext++;
+
+ //handle folding for functions/labels
+ //Note: Functions and labels don't have an explicit end like [end function]
+ // 1. functions/labels end at the start of another function
+ // 2. functions/labels end at the end of the file
+ if ((strcmp(szFirstWord, "function") == 0) || (firstWordLen > 0 && szFirstWord[0] == '@')) {
+ if (isFoldingAll) { //if we're folding the whole document (recursivly by lua script)
+
+ if (functionCount > 0) {
+ levelCurrent--;
+ } else {
+ levelNext++;
+ }
+ functionCount++;
+
+ } else { //if just folding a small piece (by clicking on the minus sign next to the word)
+ levelCurrent--;
+ }
+ }
+
+ // end the fold for these words before the current line
+ if (strcmp(szFirstWord, "endif") == 0 || strcmp(szFirstWord, "endfor") == 0) {
+ levelNext--;
+ levelCurrent--;
+ }
+
+ // end the fold for these words before the current line and Start new fold
+ if (strcmp(szFirstWord, "else") == 0 || strcmp(szFirstWord, "elseif") == 0 )
+ levelCurrent--;
+
+ }
+ // Preprocessor and Comment folding
+ int styleNext = GetStyleFirstWord(lineCurrent + 1,styler);
+
+ // *********************************
+ // Folding logic for Comment blocks
+ // *********************************
+ if (foldComment && IsStreamCommentStyle(style)) {
+
+ // Start of a comment block
+ if (stylePrev != style && IsStreamCommentStyle(styleNext) && styleNext == style) {
+ levelNext++;
+ } // fold till the last line for normal comment lines
+ else if (IsStreamCommentStyle(stylePrev)
+ && styleNext != SCE_POWERPRO_COMMENTLINE
+ && stylePrev == SCE_POWERPRO_COMMENTLINE
+ && style == SCE_POWERPRO_COMMENTLINE) {
+ levelNext--;
+ } // fold till the one but last line for Blockcomment lines
+ else if (IsStreamCommentStyle(stylePrev)
+ && styleNext != SCE_POWERPRO_COMMENTBLOCK
+ && style == SCE_POWERPRO_COMMENTBLOCK) {
+ levelNext--;
+ levelCurrent--;
+ }
+ }
+
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ // reset values for the next line
+ lineCurrent++;
+ stylePrev = style;
+ style = styleNext;
+ levelCurrent = levelNext;
+ visibleChars = 0;
+
+ // if the last characters are ;;+ then don't reset since the line continues on the next line.
+ if (chPrev != '+' && chPrevPrev != ';' && chPrevPrevPrev != ';') {
+ firstWordLen = 0;
+ szDolen = 0;
+ isFirstWordStarted = false;
+ isFirstWordEnded = false;
+ isDoLastWord = false;
+
+ //blank out first word
+ for (unsigned int i = 0; i < FIRST_WORD_MAX_LEN; i++)
+ szFirstWord[i] = '\0';
+ }
+ }
+
+ // save the last processed characters
+ if ((ch > 0) && !isspacechar(ch)) {
+ chPrevPrevPrev = chPrevPrev;
+ chPrevPrev = chPrev;
+ chPrev = ch;
+ }
+ }
+
+ //close folds on the last line - without this a 'phantom'
+ //fold can appear when an open fold is on the last line
+ //this can occur because functions and labels don't have an explicit end
+ if (lineCurrent >= lastLine) {
+ int lev = 0;
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ styler.SetLevel(lineCurrent, lev);
+ }
+
+}
+
+static const char * const powerProWordLists[] = {
+ "Keyword list 1",
+ "Keyword list 2",
+ "Keyword list 3",
+ "Keyword list 4",
+ 0,
+ };
+
+static void ColourisePowerProDocWrapper(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ ColourisePowerProDoc(startPos, length, initStyle, keywordlists, styler, false);
+}
+
+LexerModule lmPowerPro(SCLEX_POWERPRO, ColourisePowerProDocWrapper, "powerpro", FoldPowerProDoc, powerProWordLists);
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerShell.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerShell.cxx
new file mode 100644
index 00000000000..1b568c08721
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPowerShell.cxx
@@ -0,0 +1,248 @@
+// Scintilla source code edit control
+/** @file LexPowerShell.cxx
+ ** Lexer for PowerShell scripts.
+ **/
+// Copyright 2008 by Tim Gerundt <tim@gerundt.de>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Extended to accept accented characters
+static inline bool IsAWordChar(int ch) {
+ return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_';
+}
+
+static void ColourisePowerShellDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+
+ styler.StartAt(startPos);
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.state == SCE_POWERSHELL_COMMENT) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_COMMENTSTREAM) {
+ if(sc.atLineStart) {
+ while(IsASpaceOrTab(sc.ch)) {
+ sc.Forward();
+ }
+ if (sc.ch == '.' && IsAWordChar(sc.chNext)) {
+ sc.SetState(SCE_POWERSHELL_COMMENTDOCKEYWORD);
+ }
+ }
+ if (sc.ch == '>' && sc.chPrev == '#') {
+ sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_COMMENTDOCKEYWORD) {
+ if(!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (!keywords6.InList(s + 1)) {
+ sc.ChangeState(SCE_POWERSHELL_COMMENTSTREAM);
+ }
+ sc.SetState(SCE_POWERSHELL_COMMENTSTREAM);
+ }
+ } else if (sc.state == SCE_POWERSHELL_STRING) {
+ // This is a doubles quotes string
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_CHARACTER) {
+ // This is a single quote string
+ if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_HERE_STRING) {
+ // This is a doubles quotes here-string
+ if (sc.atLineStart && sc.ch == '\"' && sc.chNext == '@') {
+ sc.Forward(2);
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_HERE_CHARACTER) {
+ // This is a single quote here-string
+ if (sc.atLineStart && sc.ch == '\'' && sc.chNext == '@') {
+ sc.Forward(2);
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_NUMBER) {
+ if (!IsADigit(sc.ch)) {
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_VARIABLE) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_OPERATOR) {
+ if (!isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ } else if (sc.state == SCE_POWERSHELL_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_POWERSHELL_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_POWERSHELL_CMDLET);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_POWERSHELL_ALIAS);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_POWERSHELL_FUNCTION);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_POWERSHELL_USER1);
+ }
+ sc.SetState(SCE_POWERSHELL_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_POWERSHELL_DEFAULT) {
+ if (sc.ch == '#') {
+ sc.SetState(SCE_POWERSHELL_COMMENT);
+ } else if (sc.ch == '<' && sc.chNext == '#') {
+ sc.SetState(SCE_POWERSHELL_COMMENTSTREAM);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_POWERSHELL_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_POWERSHELL_CHARACTER);
+ } else if (sc.ch == '@' && sc.chNext == '\"') {
+ sc.SetState(SCE_POWERSHELL_HERE_STRING);
+ } else if (sc.ch == '@' && sc.chNext == '\'') {
+ sc.SetState(SCE_POWERSHELL_HERE_CHARACTER);
+ } else if (sc.ch == '$') {
+ sc.SetState(SCE_POWERSHELL_VARIABLE);
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_POWERSHELL_NUMBER);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_POWERSHELL_OPERATOR);
+ } else if (IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_POWERSHELL_IDENTIFIER);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldPowerShellDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_POWERSHELL_OPERATOR) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ } else if (foldComment && style == SCE_POWERSHELL_COMMENTSTREAM) {
+ if (stylePrev != SCE_POWERSHELL_COMMENTSTREAM && stylePrev != SCE_POWERSHELL_COMMENTDOCKEYWORD) {
+ levelNext++;
+ } else if (styleNext != SCE_POWERSHELL_COMMENTSTREAM && styleNext != SCE_POWERSHELL_COMMENTDOCKEYWORD) {
+ levelNext--;
+ }
+ } else if (foldComment && style == SCE_POWERSHELL_COMMENT) {
+ if (ch == '#') {
+ unsigned int j = i + 1;
+ while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "region")) {
+ levelNext++;
+ } else if (styler.Match(j, "endregion")) {
+ levelNext--;
+ }
+ }
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ }
+}
+
+static const char * const powershellWordLists[] = {
+ "Commands",
+ "Cmdlets",
+ "Aliases",
+ "Functions",
+ "User1",
+ "DocComment",
+ 0
+};
+
+LexerModule lmPowerShell(SCLEX_POWERSHELL, ColourisePowerShellDoc, "powershell", FoldPowerShellDoc, powershellWordLists);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexProgress.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexProgress.cxx
new file mode 100644
index 00000000000..2031720a2fa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexProgress.cxx
@@ -0,0 +1,282 @@
+// Scintilla source code edit control
+/** @file LexProgress.cxx
+ ** Lexer for Progress 4GL.
+ ** Based on LexCPP.cxx of Neil Hodgson <neilh@scintilla.org>
+ **/
+// Copyright 2006-2007 by Yuval Papish <Yuval@YuvCom.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+/** TODO:
+WebSpeed support in html lexer
+Support "end triggers" expression of the triggers phrase
+Support more than 6 comments levels
+**/
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return (ch < 0x80) && (isalpha(ch) || ch == '_');
+}
+
+enum SentenceStart { SetSentenceStart = 0xf, ResetSentenceStart = 0x10}; // true -> bit = 0
+
+static void Colourise4glDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords1 = *keywordlists[0]; // regular keywords
+ WordList &keywords2 = *keywordlists[1]; // block opening keywords, only when SentenceStart
+ WordList &keywords3 = *keywordlists[2]; // block opening keywords
+ //WordList &keywords4 = *keywordlists[3]; // preprocessor keywords. Not implemented
+
+
+ int visibleChars = 0;
+ int mask;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ // Reset states to begining of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ }
+
+ // Handle line continuation generically.
+ if ((sc.state & 0xf) < SCE_4GL_COMMENT1) {
+ if (sc.ch == '~') {
+ if (sc.chNext > ' ') {
+ // skip special char after ~
+ sc.Forward();
+ continue;
+ }
+ else {
+ // Skip whitespace between ~ and EOL
+ while (sc.More() && (sc.chNext == ' ' || sc.chNext == '\t') ) {
+ sc.Forward();
+ }
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ sc.Forward();
+ continue;
+ }
+ }
+ }
+ }
+ // Determine if a new state should be terminated.
+ mask = sc.state & 0x10;
+ switch (sc.state & 0xf) {
+ case SCE_4GL_OPERATOR:
+ sc.SetState(SCE_4GL_DEFAULT | mask);
+ break;
+ case SCE_4GL_NUMBER:
+ if (!(IsADigit(sc.ch))) {
+ sc.SetState(SCE_4GL_DEFAULT | mask);
+ }
+ break;
+ case SCE_4GL_IDENTIFIER:
+ if (!IsAWordChar(sc.ch) && sc.ch != '-') {
+ char s[1000];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if ((((sc.state & 0x10) == 0) && keywords2.InList(s)) || keywords3.InList(s)) {
+ sc.ChangeState(SCE_4GL_BLOCK | ResetSentenceStart);
+ }
+ else if (keywords1.InList(s)) {
+ if ((s[0] == 'e' && s[1] =='n' && s[2] == 'd' && !isalnum(s[3]) && s[3] != '-') ||
+ (s[0] == 'f' && s[1] =='o' && s[2] == 'r' && s[3] == 'w' && s[4] =='a' && s[5] == 'r' && s[6] == 'd'&& !isalnum(s[7]))) {
+ sc.ChangeState(SCE_4GL_END | ResetSentenceStart);
+ }
+ else if ((s[0] == 'e' && s[1] =='l' && s[2] == 's' && s[3] == 'e') ||
+ (s[0] == 't' && s[1] =='h' && s[2] == 'e' && s[3] == 'n')) {
+ sc.ChangeState(SCE_4GL_WORD & SetSentenceStart);
+ }
+ else {
+ sc.ChangeState(SCE_4GL_WORD | ResetSentenceStart);
+ }
+ }
+ sc.SetState(SCE_4GL_DEFAULT | (sc.state & 0x10));
+ }
+ break;
+ case SCE_4GL_PREPROCESSOR:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_4GL_DEFAULT & SetSentenceStart);
+ }
+ /* code removed to allow comments inside preprocessor
+ else if (sc.ch == '*' && sc.chNext == '/') {
+ sc.ForwardSetState(SCE_4GL_DEFAULT | sentenceStartState); } */
+ break;
+ case SCE_4GL_STRING:
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
+ }
+ break;
+ case SCE_4GL_CHARACTER:
+ if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
+ }
+ break;
+ default:
+ if ((sc.state & 0xf) >= SCE_4GL_COMMENT1) {
+ if (sc.ch == '*' && sc.chNext == '/') {
+ sc.Forward();
+ if ((sc.state & 0xf) == SCE_4GL_COMMENT1) {
+ sc.ForwardSetState(SCE_4GL_DEFAULT | mask);
+ }
+ else
+ sc.SetState((sc.state & 0x1f) - 1);
+ } else if (sc.ch == '/' && sc.chNext == '*') {
+ sc.Forward();
+ sc.SetState((sc.state & 0x1f) + 1);
+ }
+ }
+ }
+
+ // Determine if a new state should be entered.
+ mask = sc.state & 0x10;
+ if ((sc.state & 0xf) == SCE_4GL_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_4GL_NUMBER | ResetSentenceStart);
+ } else if (IsAWordStart(sc.ch) || (sc.ch == '@')) {
+ sc.SetState(SCE_4GL_IDENTIFIER | mask);
+ } else if (sc.ch == '/' && sc.chNext == '*') {
+ sc.SetState(SCE_4GL_COMMENT1 | mask);
+ sc.Forward();
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_4GL_STRING | ResetSentenceStart);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_4GL_CHARACTER | ResetSentenceStart);
+ } else if (sc.ch == '&' && visibleChars == 0 && ((sc.state & 0x10) == 0)) {
+ sc.SetState(SCE_4GL_PREPROCESSOR | ResetSentenceStart);
+ // Skip whitespace between & and preprocessor word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ // Handle syntactical line termination
+ } else if ((sc.ch == '.' || sc.ch == ':' || sc.ch == '}') && (sc.chNext == ' ' || sc.chNext == '\t' || sc.chNext == '\n' || sc.chNext == '\r')) {
+ sc.SetState(sc.state & SetSentenceStart);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ /* This code allows highlight of handles. Alas, it would cause the phrase "last-event:function"
+ to be recognized as a BlockBegin */
+
+ if (sc.ch == ':')
+ sc.SetState(SCE_4GL_OPERATOR & SetSentenceStart);
+ /* else */
+ sc.SetState(SCE_4GL_OPERATOR | ResetSentenceStart);
+ }
+ }
+
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return (style & 0xf) >= SCE_4GL_COMMENT1 ;
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldNoBox4glDoc(unsigned int startPos, int length, int initStyle,
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = static_cast<char>(tolower(styler[startPos]));
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = static_cast<char>(tolower(styler.SafeGetCharAt(i + 1)));
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext)) { // && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ else if ((style & 0xf) == SCE_4GL_BLOCK && !isalnum(chNext)) {
+ levelNext++;
+ }
+ else if ((style & 0xf) == SCE_4GL_END && (ch == 'e' || ch == 'f')) {
+ levelNext--;
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+}
+
+static void Fold4glDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ FoldNoBox4glDoc(startPos, length, initStyle, styler);
+}
+
+static const char * const FglWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ "Documentation comment keywords",
+ "Unused",
+ "Global classes and typedefs",
+ 0,
+ };
+
+LexerModule lmProgress(SCLEX_PROGRESS, Colourise4glDoc, "progress", Fold4glDoc, FglWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPython.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPython.cxx
new file mode 100644
index 00000000000..7ab3e084cb7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexPython.cxx
@@ -0,0 +1,571 @@
+// Scintilla source code edit control
+/** @file LexPython.cxx
+ ** Lexer for Python.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/* kwCDef, kwCTypeName only used for Cython */
+enum kwType { kwOther, kwClass, kwDef, kwImport, kwCDef, kwCTypeName, kwCPDef };
+
+static const int indicatorWhitespace = 1;
+
+static bool IsPyComment(Accessor &styler, int pos, int len) {
+ return len > 0 && styler[pos] == '#';
+}
+
+enum literalsAllowed { litNone=0, litU=1, litB=2};
+
+static bool IsPyStringTypeChar(int ch, literalsAllowed allowed) {
+ return
+ ((allowed & litB) && (ch == 'b' || ch == 'B')) ||
+ ((allowed & litU) && (ch == 'u' || ch == 'U'));
+}
+
+static bool IsPyStringStart(int ch, int chNext, int chNext2, literalsAllowed allowed) {
+ if (ch == '\'' || ch == '"')
+ return true;
+ if (IsPyStringTypeChar(ch, allowed)) {
+ if (chNext == '"' || chNext == '\'')
+ return true;
+ if ((chNext == 'r' || chNext == 'R') && (chNext2 == '"' || chNext2 == '\''))
+ return true;
+ }
+ if ((ch == 'r' || ch == 'R') && (chNext == '"' || chNext == '\''))
+ return true;
+
+ return false;
+}
+
+/* Return the state to use for the string starting at i; *nextIndex will be set to the first index following the quote(s) */
+static int GetPyStringState(Accessor &styler, int i, unsigned int *nextIndex, literalsAllowed allowed) {
+ char ch = styler.SafeGetCharAt(i);
+ char chNext = styler.SafeGetCharAt(i + 1);
+
+ // Advance beyond r, u, or ur prefix (or r, b, or br in Python 3.0), but bail if there are any unexpected chars
+ if (ch == 'r' || ch == 'R') {
+ i++;
+ ch = styler.SafeGetCharAt(i);
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (IsPyStringTypeChar(ch, allowed)) {
+ if (chNext == 'r' || chNext == 'R')
+ i += 2;
+ else
+ i += 1;
+ ch = styler.SafeGetCharAt(i);
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+
+ if (ch != '"' && ch != '\'') {
+ *nextIndex = i + 1;
+ return SCE_P_DEFAULT;
+ }
+
+ if (ch == chNext && ch == styler.SafeGetCharAt(i + 2)) {
+ *nextIndex = i + 3;
+
+ if (ch == '"')
+ return SCE_P_TRIPLEDOUBLE;
+ else
+ return SCE_P_TRIPLE;
+ } else {
+ *nextIndex = i + 1;
+
+ if (ch == '"')
+ return SCE_P_STRING;
+ else
+ return SCE_P_CHARACTER;
+ }
+}
+
+static inline bool IsAWordChar(int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ int endPos = startPos + length;
+
+ // Backtrack to previous line in case need to fix its tab whinging
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ // Look for backslash-continued lines
+ while (lineCurrent > 0) {
+ int eolPos = styler.LineStart(lineCurrent) - 1;
+ int eolStyle = styler.StyleAt(eolPos);
+ if (eolStyle == SCE_P_STRING
+ || eolStyle == SCE_P_CHARACTER
+ || eolStyle == SCE_P_STRINGEOL) {
+ lineCurrent -= 1;
+ } else {
+ break;
+ }
+ }
+ startPos = styler.LineStart(lineCurrent);
+ }
+ initStyle = startPos == 0 ? SCE_P_DEFAULT : styler.StyleAt(startPos - 1);
+ }
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+
+ // property tab.timmy.whinge.level
+ // For Python code, checks whether indenting is consistent.
+ // The default, 0 turns off indentation checking,
+ // 1 checks whether each line is potentially inconsistent with the previous line,
+ // 2 checks whether any space characters occur before a tab character in the indentation,
+ // 3 checks whether any spaces are in the indentation, and
+ // 4 checks for any tab characters in the indentation.
+ // 1 is a good level to use.
+ const int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");
+
+ // property lexer.python.literals.binary
+ // Set to 0 to not recognise Python 3 binary and octal literals: 0b1011 0o712.
+ bool base2or8Literals = styler.GetPropertyInt("lexer.python.literals.binary", 1) != 0;
+
+ // property lexer.python.strings.u
+ // Set to 0 to not recognise Python Unicode literals u"x" as used before Python 3.
+ literalsAllowed allowedLiterals = (styler.GetPropertyInt("lexer.python.strings.u", 1)) ? litU : litNone;
+
+ // property lexer.python.strings.b
+ // Set to 0 to not recognise Python 3 bytes literals b"x".
+ if (styler.GetPropertyInt("lexer.python.strings.b", 1))
+ allowedLiterals = static_cast<literalsAllowed>(allowedLiterals | litB);
+
+ // property lexer.python.strings.over.newline
+ // Set to 1 to allow strings to span newline characters.
+ bool stringsOverNewline = styler.GetPropertyInt("lexer.python.strings.over.newline") != 0;
+
+ // property lexer.python.keywords2.no.sub.identifiers
+ // When enabled, it will not style keywords2 items that are used as a sub-identifier.
+ // Example: when set, will not highlight "foo.open" when "open" is a keywords2 item.
+ const bool keywords2NoSubIdentifiers = styler.GetPropertyInt("lexer.python.keywords2.no.sub.identifiers") != 0;
+
+ initStyle = initStyle & 31;
+ if (initStyle == SCE_P_STRINGEOL) {
+ initStyle = SCE_P_DEFAULT;
+ }
+
+ kwType kwLast = kwOther;
+ int spaceFlags = 0;
+ styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
+ bool base_n_number = false;
+
+ StyleContext sc(startPos, endPos - startPos, initStyle, styler);
+
+ bool indentGood = true;
+ int startIndicator = sc.currentPos;
+ bool inContinuedString = false;
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart) {
+ styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
+ indentGood = true;
+ if (whingeLevel == 1) {
+ indentGood = (spaceFlags & wsInconsistent) == 0;
+ } else if (whingeLevel == 2) {
+ indentGood = (spaceFlags & wsSpaceTab) == 0;
+ } else if (whingeLevel == 3) {
+ indentGood = (spaceFlags & wsSpace) == 0;
+ } else if (whingeLevel == 4) {
+ indentGood = (spaceFlags & wsTab) == 0;
+ }
+ if (!indentGood) {
+ styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0);
+ startIndicator = sc.currentPos;
+ }
+ }
+
+ if (sc.atLineEnd) {
+ if ((sc.state == SCE_P_DEFAULT) ||
+ (sc.state == SCE_P_TRIPLE) ||
+ (sc.state == SCE_P_TRIPLEDOUBLE)) {
+ // Perform colourisation of white space and triple quoted strings at end of each line to allow
+ // tab marking to work inside white space and triple quoted strings
+ sc.SetState(sc.state);
+ }
+ lineCurrent++;
+ if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
+ if (inContinuedString || stringsOverNewline) {
+ inContinuedString = false;
+ } else {
+ sc.ChangeState(SCE_P_STRINGEOL);
+ sc.ForwardSetState(SCE_P_DEFAULT);
+ }
+ }
+ if (!sc.More())
+ break;
+ }
+
+ bool needEOLCheck = false;
+
+ // Check for a state end
+ if (sc.state == SCE_P_OPERATOR) {
+ kwLast = kwOther;
+ sc.SetState(SCE_P_DEFAULT);
+ } else if (sc.state == SCE_P_NUMBER) {
+ if (!IsAWordChar(sc.ch) &&
+ !(!base_n_number && ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) {
+ sc.SetState(SCE_P_DEFAULT);
+ }
+ } else if (sc.state == SCE_P_IDENTIFIER) {
+ if ((sc.ch == '.') || (!IsAWordChar(sc.ch))) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ int style = SCE_P_IDENTIFIER;
+ if ((kwLast == kwImport) && (strcmp(s, "as") == 0)) {
+ style = SCE_P_WORD;
+ } else if (keywords.InList(s)) {
+ style = SCE_P_WORD;
+ } else if (kwLast == kwClass) {
+ style = SCE_P_CLASSNAME;
+ } else if (kwLast == kwDef) {
+ style = SCE_P_DEFNAME;
+ } else if (kwLast == kwCDef || kwLast == kwCPDef) {
+ int pos = sc.currentPos;
+ unsigned char ch = styler.SafeGetCharAt(pos, '\0');
+ while (ch != '\0') {
+ if (ch == '(') {
+ style = SCE_P_DEFNAME;
+ break;
+ } else if (ch == ':') {
+ style = SCE_P_CLASSNAME;
+ break;
+ } else if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') {
+ pos++;
+ ch = styler.SafeGetCharAt(pos, '\0');
+ } else {
+ break;
+ }
+ }
+ } else if (keywords2.InList(s)) {
+ if (keywords2NoSubIdentifiers) {
+ // We don't want to highlight keywords2
+ // that are used as a sub-identifier,
+ // i.e. not open in "foo.open".
+ int pos = styler.GetStartSegment() - 1;
+ if (pos < 0 || (styler.SafeGetCharAt(pos, '\0') != '.'))
+ style = SCE_P_WORD2;
+ } else {
+ style = SCE_P_WORD2;
+ }
+ }
+ sc.ChangeState(style);
+ sc.SetState(SCE_P_DEFAULT);
+ if (style == SCE_P_WORD) {
+ if (0 == strcmp(s, "class"))
+ kwLast = kwClass;
+ else if (0 == strcmp(s, "def"))
+ kwLast = kwDef;
+ else if (0 == strcmp(s, "import"))
+ kwLast = kwImport;
+ else if (0 == strcmp(s, "cdef"))
+ kwLast = kwCDef;
+ else if (0 == strcmp(s, "cpdef"))
+ kwLast = kwCPDef;
+ else if (0 == strcmp(s, "cimport"))
+ kwLast = kwImport;
+ else if (kwLast != kwCDef && kwLast != kwCPDef)
+ kwLast = kwOther;
+ } else if (kwLast != kwCDef && kwLast != kwCPDef) {
+ kwLast = kwOther;
+ }
+ }
+ } else if ((sc.state == SCE_P_COMMENTLINE) || (sc.state == SCE_P_COMMENTBLOCK)) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_P_DEFAULT);
+ }
+ } else if (sc.state == SCE_P_DECORATOR) {
+ if (!IsAWordChar(sc.ch)) {
+ sc.SetState(SCE_P_DEFAULT);
+ }
+ } else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
+ if (sc.ch == '\\') {
+ if ((sc.chNext == '\r') && (sc.GetRelative(2) == '\n')) {
+ sc.Forward();
+ }
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ inContinuedString = true;
+ } else {
+ // Don't roll over the newline.
+ sc.Forward();
+ }
+ } else if ((sc.state == SCE_P_STRING) && (sc.ch == '\"')) {
+ sc.ForwardSetState(SCE_P_DEFAULT);
+ needEOLCheck = true;
+ } else if ((sc.state == SCE_P_CHARACTER) && (sc.ch == '\'')) {
+ sc.ForwardSetState(SCE_P_DEFAULT);
+ needEOLCheck = true;
+ }
+ } else if (sc.state == SCE_P_TRIPLE) {
+ if (sc.ch == '\\') {
+ sc.Forward();
+ } else if (sc.Match("\'\'\'")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_P_DEFAULT);
+ needEOLCheck = true;
+ }
+ } else if (sc.state == SCE_P_TRIPLEDOUBLE) {
+ if (sc.ch == '\\') {
+ sc.Forward();
+ } else if (sc.Match("\"\"\"")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_P_DEFAULT);
+ needEOLCheck = true;
+ }
+ }
+
+ if (!indentGood && !IsASpaceOrTab(sc.ch)) {
+ styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 1);
+ startIndicator = sc.currentPos;
+ indentGood = true;
+ }
+
+ // One cdef or cpdef line, clear kwLast only at end of line
+ if ((kwLast == kwCDef || kwLast == kwCPDef) && sc.atLineEnd) {
+ kwLast = kwOther;
+ }
+
+ // State exit code may have moved on to end of line
+ if (needEOLCheck && sc.atLineEnd) {
+ lineCurrent++;
+ styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment);
+ if (!sc.More())
+ break;
+ }
+
+ // Check for a new state starting character
+ if (sc.state == SCE_P_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ if (sc.ch == '0' && (sc.chNext == 'x' || sc.chNext == 'X')) {
+ base_n_number = true;
+ sc.SetState(SCE_P_NUMBER);
+ } else if (sc.ch == '0' &&
+ (sc.chNext == 'o' || sc.chNext == 'O' || sc.chNext == 'b' || sc.chNext == 'B')) {
+ if (base2or8Literals) {
+ base_n_number = true;
+ sc.SetState(SCE_P_NUMBER);
+ } else {
+ sc.SetState(SCE_P_NUMBER);
+ sc.ForwardSetState(SCE_P_IDENTIFIER);
+ }
+ } else {
+ base_n_number = false;
+ sc.SetState(SCE_P_NUMBER);
+ }
+ } else if ((IsASCII(sc.ch) && isoperator(static_cast<char>(sc.ch))) || sc.ch == '`') {
+ sc.SetState(SCE_P_OPERATOR);
+ } else if (sc.ch == '#') {
+ sc.SetState(sc.chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);
+ } else if (sc.ch == '@') {
+ sc.SetState(SCE_P_DECORATOR);
+ } else if (IsPyStringStart(sc.ch, sc.chNext, sc.GetRelative(2), allowedLiterals)) {
+ unsigned int nextIndex = 0;
+ sc.SetState(GetPyStringState(styler, sc.currentPos, &nextIndex, allowedLiterals));
+ while (nextIndex > (sc.currentPos + 1) && sc.More()) {
+ sc.Forward();
+ }
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_P_IDENTIFIER);
+ }
+ }
+ }
+ styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0);
+ sc.Complete();
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ if (ch == '#')
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+
+static bool IsQuoteLine(int line, Accessor &styler) {
+ int style = styler.StyleAt(styler.LineStart(line)) & 31;
+ return ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
+}
+
+
+static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unused*/,
+ WordList *[], Accessor &styler) {
+ const int maxPos = startPos + length;
+ const int maxLines = (maxPos == styler.Length()) ? styler.GetLine(maxPos) : styler.GetLine(maxPos - 1); // Requested last line
+ const int docLines = styler.GetLine(styler.Length()); // Available last line
+
+ // property fold.quotes.python
+ // This option enables folding multi-line quoted strings when using the Python lexer.
+ const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python") != 0;
+
+ const bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
+
+ // Backtrack to previous non-blank line so we can determine indent level
+ // for any white space lines (needed esp. within triple quoted strings)
+ // and so we can fix any preceding fold level (which is why we go back
+ // at least one line in all cases)
+ int spaceFlags = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ while (lineCurrent > 0) {
+ lineCurrent--;
+ indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) &&
+ (!IsCommentLine(lineCurrent, styler)) &&
+ (!IsQuoteLine(lineCurrent, styler)))
+ break;
+ }
+ int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+
+ // Set up initial loop state
+ startPos = styler.LineStart(lineCurrent);
+ int prev_state = SCE_P_DEFAULT & 31;
+ if (lineCurrent >= 1)
+ prev_state = styler.StyleAt(startPos - 1) & 31;
+ int prevQuote = foldQuotes && ((prev_state == SCE_P_TRIPLE) || (prev_state == SCE_P_TRIPLEDOUBLE));
+
+ // Process all characters to end of requested range or end of any triple quote
+ //that hangs over the end of the range. Cap processing in all cases
+ // to end of document (in case of unclosed quote at end).
+ while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevQuote)) {
+
+ // Gather info
+ int lev = indentCurrent;
+ int lineNext = lineCurrent + 1;
+ int indentNext = indentCurrent;
+ int quote = false;
+ if (lineNext <= docLines) {
+ // Information about next line is only available if not at end of document
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ int lookAtPos = (styler.LineStart(lineNext) == styler.Length()) ? styler.Length() - 1 : styler.LineStart(lineNext);
+ int style = styler.StyleAt(lookAtPos) & 31;
+ quote = foldQuotes && ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE));
+ }
+ const int quote_start = (quote && !prevQuote);
+ const int quote_continue = (quote && prevQuote);
+ if (!quote || !prevQuote)
+ indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+ if (quote)
+ indentNext = indentCurrentLevel;
+ if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel;
+
+ if (quote_start) {
+ // Place fold point at start of triple quoted string
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (quote_continue || prevQuote) {
+ // Add level to rest of lines in the string
+ lev = lev + 1;
+ }
+
+ // Skip past any blank lines for next indent level info; we skip also
+ // comments (all comments, not just those starting in column 0)
+ // which effectively folds them into surrounding code rather
+ // than screwing up folding.
+
+ while (!quote &&
+ (lineNext < docLines) &&
+ ((indentNext & SC_FOLDLEVELWHITEFLAG) ||
+ (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
+
+ lineNext++;
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+
+ const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
+ const int levelBeforeComments = Maximum(indentCurrentLevel,levelAfterComments);
+
+ // Now set all the indent levels on the lines we skipped
+ // Do this from end to start. Once we encounter one line
+ // which is indented more than the line after the end of
+ // the comment-block, use the level of the block before
+
+ int skipLine = lineNext;
+ int skipLevel = levelAfterComments;
+
+ while (--skipLine > lineCurrent) {
+ int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+
+ if (foldCompact) {
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
+ skipLevel = levelBeforeComments;
+
+ int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(skipLine, skipLevel | whiteFlag);
+ } else {
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments &&
+ !(skipLineIndent & SC_FOLDLEVELWHITEFLAG) &&
+ !IsCommentLine(skipLine, styler))
+ skipLevel = levelBeforeComments;
+
+ styler.SetLevel(skipLine, skipLevel);
+ }
+ }
+
+ // Set fold header on non-quote line
+ if (!quote && !(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+
+ // Keep track of triple quote state of previous line
+ prevQuote = quote;
+
+ // Set fold level for this line and move to next line
+ styler.SetLevel(lineCurrent, foldCompact ? lev : lev & ~SC_FOLDLEVELWHITEFLAG);
+ indentCurrent = indentNext;
+ lineCurrent = lineNext;
+ }
+
+ // NOTE: Cannot set level of last line here because indentCurrent doesn't have
+ // header flag set; the loop above is crafted to take care of this case!
+ //styler.SetLevel(lineCurrent, indentCurrent);
+}
+
+static const char *const pythonWordListDesc[] = {
+ "Keywords",
+ "Highlighted identifiers",
+ 0
+};
+
+LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc,
+ pythonWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexR.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexR.cxx
new file mode 100644
index 00000000000..f4b451b258f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexR.cxx
@@ -0,0 +1,216 @@
+// Scintilla source code edit control
+/** @file Lexr.cxx
+ ** Lexer for R, S, SPlus Statistics Program (Heavily derived from CPP Lexer).
+ **
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAnOperator(const int ch) {
+ if (IsASCII(ch) && isalnum(ch))
+ return false;
+ // '.' left out as it is used to make up numbers
+ if (ch == '-' || ch == '+' || ch == '!' || ch == '~' ||
+ ch == '?' || ch == ':' || ch == '*' || ch == '/' ||
+ ch == '^' || ch == '<' || ch == '>' || ch == '=' ||
+ ch == '&' || ch == '|' || ch == '$' || ch == '(' ||
+ ch == ')' || ch == '}' || ch == '{' || ch == '[' ||
+ ch == ']')
+ return true;
+ return false;
+}
+
+static void ColouriseRDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+
+
+ // Do not leak onto next line
+ if (initStyle == SCE_R_INFIXEOL)
+ initStyle = SCE_R_DEFAULT;
+
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart && (sc.state == SCE_R_STRING)) {
+ // Prevent SCE_R_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_R_STRING);
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_R_OPERATOR) {
+ sc.SetState(SCE_R_DEFAULT);
+ } else if (sc.state == SCE_R_NUMBER) {
+ if (!IsADigit(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_R_DEFAULT);
+ }
+ } else if (sc.state == SCE_R_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_R_KWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_R_BASEKWORD);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_R_OTHERKWORD);
+ }
+ sc.SetState(SCE_R_DEFAULT);
+ }
+ } else if (sc.state == SCE_R_COMMENT) {
+ if (sc.ch == '\r' || sc.ch == '\n') {
+ sc.SetState(SCE_R_DEFAULT);
+ }
+ } else if (sc.state == SCE_R_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_R_DEFAULT);
+ }
+ } else if (sc.state == SCE_R_INFIX) {
+ if (sc.ch == '%') {
+ sc.ForwardSetState(SCE_R_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_R_INFIXEOL);
+ sc.ForwardSetState(SCE_R_DEFAULT);
+ }
+ }else if (sc.state == SCE_R_STRING2) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_R_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_R_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_R_NUMBER);
+ } else if (IsAWordStart(sc.ch) ) {
+ sc.SetState(SCE_R_IDENTIFIER);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_R_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_R_STRING);
+ } else if (sc.ch == '%') {
+ sc.SetState(SCE_R_INFIX);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_R_STRING2);
+ } else if (IsAnOperator(sc.ch)) {
+ sc.SetState(SCE_R_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldRDoc(unsigned int startPos, int length, int, WordList *[],
+ Accessor &styler) {
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_R_OPERATOR) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+}
+
+
+static const char * const RWordLists[] = {
+ "Language Keywords",
+ "Base / Default package function",
+ "Other Package Functions",
+ "Unused",
+ "Unused",
+ 0,
+ };
+
+
+
+LexerModule lmR(SCLEX_R, ColouriseRDoc, "r", FoldRDoc, RWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRebol.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRebol.cxx
new file mode 100644
index 00000000000..7d000df0427
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRebol.cxx
@@ -0,0 +1,325 @@
+// Scintilla source code edit control
+/** @file LexRebol.cxx
+ ** Lexer for REBOL.
+ ** Written by Pascal Hurni, inspired from LexLua by Paul Winwood & Marcos E. Wurzius & Philippe Lhoste
+ **
+ ** History:
+ ** 2005-04-07 First release.
+ ** 2005-04-10 Closing parens and brackets go now in default style
+ ** String and comment nesting should be more safe
+ **/
+// Copyright 2005 by Pascal Hurni <pascal_hurni@fastmail.fm>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (isalnum(ch) || ch == '?' || ch == '!' || ch == '.' || ch == '\'' || ch == '+' || ch == '-' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~');
+}
+
+static inline bool IsAWordStart(const int ch, const int ch2) {
+ return ((ch == '+' || ch == '-' || ch == '.') && !isdigit(ch2)) ||
+ (isalpha(ch) || ch == '?' || ch == '!' || ch == '\'' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~');
+}
+
+static inline bool IsAnOperator(const int ch, const int ch2, const int ch3) {
+ // One char operators
+ if (IsASpaceOrTab(ch2)) {
+ return ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '<' || ch == '>' || ch == '=' || ch == '?';
+ }
+
+ // Two char operators
+ if (IsASpaceOrTab(ch3)) {
+ return (ch == '*' && ch2 == '*') ||
+ (ch == '/' && ch2 == '/') ||
+ (ch == '<' && (ch2 == '=' || ch2 == '>')) ||
+ (ch == '>' && ch2 == '=') ||
+ (ch == '=' && (ch2 == '=' || ch2 == '?')) ||
+ (ch == '?' && ch2 == '?');
+ }
+
+ return false;
+}
+
+static inline bool IsBinaryStart(const int ch, const int ch2, const int ch3, const int ch4) {
+ return (ch == '#' && ch2 == '{') ||
+ (IsADigit(ch) && ch2 == '#' && ch3 == '{' ) ||
+ (IsADigit(ch) && IsADigit(ch2) && ch3 == '#' && ch4 == '{' );
+}
+
+
+static void ColouriseRebolDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+ WordList &keywords7 = *keywordlists[6];
+ WordList &keywords8 = *keywordlists[7];
+
+ int currentLine = styler.GetLine(startPos);
+ // Initialize the braced string {.. { ... } ..} nesting level, if we are inside such a string.
+ int stringLevel = 0;
+ if (initStyle == SCE_REBOL_BRACEDSTRING || initStyle == SCE_REBOL_COMMENTBLOCK) {
+ stringLevel = styler.GetLineState(currentLine - 1);
+ }
+
+ bool blockComment = initStyle == SCE_REBOL_COMMENTBLOCK;
+ int dotCount = 0;
+
+ // Do not leak onto next line
+ if (initStyle == SCE_REBOL_COMMENTLINE) {
+ initStyle = SCE_REBOL_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ if (startPos == 0) {
+ sc.SetState(SCE_REBOL_PREFACE);
+ }
+ for (; sc.More(); sc.Forward()) {
+
+ //--- What to do at line end ?
+ if (sc.atLineEnd) {
+ // Can be either inside a {} string or simply at eol
+ if (sc.state != SCE_REBOL_BRACEDSTRING && sc.state != SCE_REBOL_COMMENTBLOCK &&
+ sc.state != SCE_REBOL_BINARY && sc.state != SCE_REBOL_PREFACE)
+ sc.SetState(SCE_REBOL_DEFAULT);
+
+ // Update the line state, so it can be seen by next line
+ currentLine = styler.GetLine(sc.currentPos);
+ switch (sc.state) {
+ case SCE_REBOL_BRACEDSTRING:
+ case SCE_REBOL_COMMENTBLOCK:
+ // Inside a braced string, we set the line state
+ styler.SetLineState(currentLine, stringLevel);
+ break;
+ default:
+ // Reset the line state
+ styler.SetLineState(currentLine, 0);
+ break;
+ }
+
+ // continue with next char
+ continue;
+ }
+
+ //--- What to do on white-space ?
+ if (IsASpaceOrTab(sc.ch))
+ {
+ // Return to default if any of these states
+ if (sc.state == SCE_REBOL_OPERATOR || sc.state == SCE_REBOL_CHARACTER ||
+ sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR ||
+ sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_FILE ||
+ sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME ||
+ sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE ||
+ sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_EMAIL) {
+ sc.SetState(SCE_REBOL_DEFAULT);
+ }
+ }
+
+ //--- Specialize state ?
+ // URL, Email look like identifier
+ if (sc.state == SCE_REBOL_IDENTIFIER)
+ {
+ if (sc.ch == ':' && !IsASpace(sc.chNext)) {
+ sc.ChangeState(SCE_REBOL_URL);
+ } else if (sc.ch == '@') {
+ sc.ChangeState(SCE_REBOL_EMAIL);
+ } else if (sc.ch == '$') {
+ sc.ChangeState(SCE_REBOL_MONEY);
+ }
+ }
+ // Words look like identifiers
+ if (sc.state == SCE_REBOL_IDENTIFIER || (sc.state >= SCE_REBOL_WORD && sc.state <= SCE_REBOL_WORD8)) {
+ // Keywords ?
+ if (!IsAWordChar(sc.ch) || sc.Match('/')) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ blockComment = strcmp(s, "comment") == 0;
+ if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD8);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD7);
+ } else if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD6);
+ } else if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD5);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD4);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD3);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD2);
+ } else if (keywords.InList(s)) {
+ sc.ChangeState(SCE_REBOL_WORD);
+ }
+ // Keep same style if there are refinements
+ if (!sc.Match('/')) {
+ sc.SetState(SCE_REBOL_DEFAULT);
+ }
+ }
+ // special numbers
+ } else if (sc.state == SCE_REBOL_NUMBER) {
+ switch (sc.ch) {
+ case 'x': sc.ChangeState(SCE_REBOL_PAIR);
+ break;
+ case ':': sc.ChangeState(SCE_REBOL_TIME);
+ break;
+ case '-':
+ case '/': sc.ChangeState(SCE_REBOL_DATE);
+ break;
+ case '.': if (++dotCount >= 2) sc.ChangeState(SCE_REBOL_TUPLE);
+ break;
+ }
+ }
+
+ //--- Determine if the current state should terminate
+ if (sc.state == SCE_REBOL_QUOTEDSTRING || sc.state == SCE_REBOL_CHARACTER) {
+ if (sc.ch == '^' && sc.chNext == '\"') {
+ sc.Forward();
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_REBOL_DEFAULT);
+ }
+ } else if (sc.state == SCE_REBOL_BRACEDSTRING || sc.state == SCE_REBOL_COMMENTBLOCK) {
+ if (sc.ch == '}') {
+ if (--stringLevel == 0) {
+ sc.ForwardSetState(SCE_REBOL_DEFAULT);
+ }
+ } else if (sc.ch == '{') {
+ stringLevel++;
+ }
+ } else if (sc.state == SCE_REBOL_BINARY) {
+ if (sc.ch == '}') {
+ sc.ForwardSetState(SCE_REBOL_DEFAULT);
+ }
+ } else if (sc.state == SCE_REBOL_TAG) {
+ if (sc.ch == '>') {
+ sc.ForwardSetState(SCE_REBOL_DEFAULT);
+ }
+ } else if (sc.state == SCE_REBOL_PREFACE) {
+ if (sc.MatchIgnoreCase("rebol"))
+ {
+ int i;
+ for (i=5; IsASpaceOrTab(styler.SafeGetCharAt(sc.currentPos+i, 0)); i++);
+ if (sc.GetRelative(i) == '[')
+ sc.SetState(SCE_REBOL_DEFAULT);
+ }
+ }
+
+ //--- Parens and bracket changes to default style when the current is a number
+ if (sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR || sc.state == SCE_REBOL_TUPLE ||
+ sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE || sc.state == SCE_REBOL_EMAIL ||
+ sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME) {
+ if (sc.ch == '(' || sc.ch == '[' || sc.ch == ')' || sc.ch == ']') {
+ sc.SetState(SCE_REBOL_DEFAULT);
+ }
+ }
+
+ //--- Determine if a new state should be entered.
+ if (sc.state == SCE_REBOL_DEFAULT) {
+ if (IsAnOperator(sc.ch, sc.chNext, sc.GetRelative(2))) {
+ sc.SetState(SCE_REBOL_OPERATOR);
+ } else if (IsBinaryStart(sc.ch, sc.chNext, sc.GetRelative(2), sc.GetRelative(3))) {
+ sc.SetState(SCE_REBOL_BINARY);
+ } else if (IsAWordStart(sc.ch, sc.chNext)) {
+ sc.SetState(SCE_REBOL_IDENTIFIER);
+ } else if (IsADigit(sc.ch) || sc.ch == '+' || sc.ch == '-' || /*Decimal*/ sc.ch == '.' || sc.ch == ',') {
+ dotCount = 0;
+ sc.SetState(SCE_REBOL_NUMBER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_REBOL_QUOTEDSTRING);
+ } else if (sc.ch == '{') {
+ sc.SetState(blockComment ? SCE_REBOL_COMMENTBLOCK : SCE_REBOL_BRACEDSTRING);
+ ++stringLevel;
+ } else if (sc.ch == ';') {
+ sc.SetState(SCE_REBOL_COMMENTLINE);
+ } else if (sc.ch == '$') {
+ sc.SetState(SCE_REBOL_MONEY);
+ } else if (sc.ch == '%') {
+ sc.SetState(SCE_REBOL_FILE);
+ } else if (sc.ch == '<') {
+ sc.SetState(SCE_REBOL_TAG);
+ } else if (sc.ch == '#' && sc.chNext == '"') {
+ sc.SetState(SCE_REBOL_CHARACTER);
+ sc.Forward();
+ } else if (sc.ch == '#' && sc.chNext != '"' && sc.chNext != '{' ) {
+ sc.SetState(SCE_REBOL_ISSUE);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+
+static void FoldRebolDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[],
+ Accessor &styler) {
+ unsigned int lengthDoc = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_REBOL_DEFAULT) {
+ if (ch == '[') {
+ levelCurrent++;
+ } else if (ch == ']') {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const rebolWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmREBOL(SCLEX_REBOL, ColouriseRebolDoc, "rebol", FoldRebolDoc, rebolWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRegistry.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRegistry.cxx
new file mode 100644
index 00000000000..0f401fa4b5f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRegistry.cxx
@@ -0,0 +1,416 @@
+// Scintilla source code edit control
+/**
+ * @file LexRegistry.cxx
+ * @date July 26 2014
+ * @brief Lexer for Windows registration files(.reg)
+ * @author nkmathew
+ *
+ * The License.txt file describes the conditions under which this software may be
+ * distributed.
+ *
+ */
+
+#include <cstdlib>
+#include <cassert>
+#include <cctype>
+#include <cstdio>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static const char *const RegistryWordListDesc[] = {
+ 0
+};
+
+struct OptionsRegistry {
+ bool foldCompact;
+ bool fold;
+ OptionsRegistry() {
+ foldCompact = false;
+ fold = false;
+ }
+};
+
+struct OptionSetRegistry : public OptionSet<OptionsRegistry> {
+ OptionSetRegistry() {
+ DefineProperty("fold.compact", &OptionsRegistry::foldCompact);
+ DefineProperty("fold", &OptionsRegistry::fold);
+ DefineWordListSets(RegistryWordListDesc);
+ }
+};
+
+class LexerRegistry : public ILexer {
+ OptionsRegistry options;
+ OptionSetRegistry optSetRegistry;
+
+ static bool IsStringState(int state) {
+ return (state == SCE_REG_VALUENAME || state == SCE_REG_STRING);
+ }
+
+ static bool IsKeyPathState(int state) {
+ return (state == SCE_REG_ADDEDKEY || state == SCE_REG_DELETEDKEY);
+ }
+
+ static bool AtValueType(LexAccessor &styler, int start) {
+ int i = 0;
+ while (i < 10) {
+ i++;
+ char curr = styler.SafeGetCharAt(start+i, '\0');
+ if (curr == ':') {
+ return true;
+ } else if (!curr) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ static bool IsNextNonWhitespace(LexAccessor &styler, int start, char ch) {
+ int i = 0;
+ while (i < 100) {
+ i++;
+ char curr = styler.SafeGetCharAt(start+i, '\0');
+ char next = styler.SafeGetCharAt(start+i+1, '\0');
+ bool atEOL = (curr == '\r' && next != '\n') || (curr == '\n');
+ if (curr == ch) {
+ return true;
+ } else if (!isspacechar(curr) || atEOL) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ // Looks for the equal sign at the end of the string
+ static bool AtValueName(LexAccessor &styler, int start) {
+ bool atEOL = false;
+ int i = 0;
+ bool escaped = false;
+ while (!atEOL) {
+ i++;
+ char curr = styler.SafeGetCharAt(start+i, '\0');
+ char next = styler.SafeGetCharAt(start+i+1, '\0');
+ atEOL = (curr == '\r' && next != '\n') || (curr == '\n');
+ if (escaped) {
+ escaped = false;
+ continue;
+ }
+ escaped = curr == '\\';
+ if (curr == '"') {
+ return IsNextNonWhitespace(styler, start+i, '=');
+ } else if (!curr) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ static bool AtKeyPathEnd(LexAccessor &styler, int start) {
+ bool atEOL = false;
+ int i = 0;
+ while (!atEOL) {
+ i++;
+ char curr = styler.SafeGetCharAt(start+i, '\0');
+ char next = styler.SafeGetCharAt(start+i+1, '\0');
+ atEOL = (curr == '\r' && next != '\n') || (curr == '\n');
+ if (curr == ']' || !curr) {
+ // There's still at least one or more square brackets ahead
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static bool AtGUID(LexAccessor &styler, int start) {
+ int count = 8;
+ int portion = 0;
+ int offset = 1;
+ char digit = '\0';
+ while (portion < 5) {
+ int i = 0;
+ while (i < count) {
+ digit = styler.SafeGetCharAt(start+offset);
+ if (!(isxdigit(digit) || digit == '-')) {
+ return false;
+ }
+ offset++;
+ i++;
+ }
+ portion++;
+ count = (portion == 4) ? 13 : 5;
+ }
+ digit = styler.SafeGetCharAt(start+offset);
+ if (digit == '}') {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+public:
+ LexerRegistry() {}
+ virtual ~LexerRegistry() {}
+ virtual int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ virtual void SCI_METHOD Release() {
+ delete this;
+ }
+ virtual const char *SCI_METHOD PropertyNames() {
+ return optSetRegistry.PropertyNames();
+ }
+ virtual int SCI_METHOD PropertyType(const char *name) {
+ return optSetRegistry.PropertyType(name);
+ }
+ virtual const char *SCI_METHOD DescribeProperty(const char *name) {
+ return optSetRegistry.DescribeProperty(name);
+ }
+ virtual int SCI_METHOD PropertySet(const char *key, const char *val) {
+ if (optSetRegistry.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+ }
+ virtual int SCI_METHOD WordListSet(int, const char *) {
+ return -1;
+ }
+ virtual void *SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+ static ILexer *LexerFactoryRegistry() {
+ return new LexerRegistry;
+ }
+ virtual const char *SCI_METHOD DescribeWordListSets() {
+ return optSetRegistry.DescribeWordListSets();
+ }
+ virtual void SCI_METHOD Lex(unsigned startPos,
+ int length,
+ int initStyle,
+ IDocument *pAccess);
+ virtual void SCI_METHOD Fold(unsigned startPos,
+ int length,
+ int initStyle,
+ IDocument *pAccess);
+};
+
+void SCI_METHOD LexerRegistry::Lex(unsigned startPos,
+ int length,
+ int initStyle,
+ IDocument *pAccess) {
+ int beforeGUID = SCE_REG_DEFAULT;
+ int beforeEscape = SCE_REG_DEFAULT;
+ CharacterSet setOperators = CharacterSet(CharacterSet::setNone, "-,.=:\\@()");
+ LexAccessor styler(pAccess);
+ StyleContext context(startPos, length, initStyle, styler);
+ bool highlight = true;
+ bool afterEqualSign = false;
+ while (context.More()) {
+ if (context.atLineStart) {
+ int currPos = static_cast<int>(context.currentPos);
+ bool continued = styler[currPos-3] == '\\';
+ highlight = continued ? true : false;
+ }
+ switch (context.state) {
+ case SCE_REG_COMMENT:
+ if (context.atLineEnd) {
+ context.SetState(SCE_REG_DEFAULT);
+ }
+ break;
+ case SCE_REG_VALUENAME:
+ case SCE_REG_STRING: {
+ int currPos = static_cast<int>(context.currentPos);
+ if (context.ch == '"') {
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ } else if (context.ch == '\\') {
+ beforeEscape = context.state;
+ context.SetState(SCE_REG_ESCAPED);
+ context.Forward();
+ } else if (context.ch == '{') {
+ if (AtGUID(styler, currPos)) {
+ beforeGUID = context.state;
+ context.SetState(SCE_REG_STRING_GUID);
+ }
+ }
+ if (context.state == SCE_REG_STRING &&
+ context.ch == '%' &&
+ (isdigit(context.chNext) || context.chNext == '*')) {
+ context.SetState(SCE_REG_PARAMETER);
+ }
+ }
+ break;
+ case SCE_REG_PARAMETER:
+ context.ForwardSetState(SCE_REG_STRING);
+ if (context.ch == '"') {
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ }
+ break;
+ case SCE_REG_VALUETYPE:
+ if (context.ch == ':') {
+ context.SetState(SCE_REG_DEFAULT);
+ afterEqualSign = false;
+ }
+ break;
+ case SCE_REG_HEXDIGIT:
+ case SCE_REG_OPERATOR:
+ context.SetState(SCE_REG_DEFAULT);
+ break;
+ case SCE_REG_DELETEDKEY:
+ case SCE_REG_ADDEDKEY: {
+ int currPos = static_cast<int>(context.currentPos);
+ if (context.ch == ']' && AtKeyPathEnd(styler, currPos)) {
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ } else if (context.ch == '{') {
+ if (AtGUID(styler, currPos)) {
+ beforeGUID = context.state;
+ context.SetState(SCE_REG_KEYPATH_GUID);
+ }
+ }
+ }
+ break;
+ case SCE_REG_ESCAPED:
+ if (context.ch == '"') {
+ context.SetState(beforeEscape);
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ } else if (context.ch == '\\') {
+ context.Forward();
+ } else {
+ context.SetState(beforeEscape);
+ beforeEscape = SCE_REG_DEFAULT;
+ }
+ break;
+ case SCE_REG_STRING_GUID:
+ case SCE_REG_KEYPATH_GUID: {
+ if (context.ch == '}') {
+ context.ForwardSetState(beforeGUID);
+ beforeGUID = SCE_REG_DEFAULT;
+ }
+ int currPos = static_cast<int>(context.currentPos);
+ if (context.ch == '"' && IsStringState(context.state)) {
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ } else if (context.ch == ']' &&
+ AtKeyPathEnd(styler, currPos) &&
+ IsKeyPathState(context.state)) {
+ context.ForwardSetState(SCE_REG_DEFAULT);
+ } else if (context.ch == '\\' && IsStringState(context.state)) {
+ beforeEscape = context.state;
+ context.SetState(SCE_REG_ESCAPED);
+ context.Forward();
+ }
+ }
+ break;
+ }
+ // Determine if a new state should be entered.
+ if (context.state == SCE_REG_DEFAULT) {
+ int currPos = static_cast<int>(context.currentPos);
+ if (context.ch == ';') {
+ context.SetState(SCE_REG_COMMENT);
+ } else if (context.ch == '"') {
+ if (AtValueName(styler, currPos)) {
+ context.SetState(SCE_REG_VALUENAME);
+ } else {
+ context.SetState(SCE_REG_STRING);
+ }
+ } else if (context.ch == '[') {
+ if (IsNextNonWhitespace(styler, currPos, '-')) {
+ context.SetState(SCE_REG_DELETEDKEY);
+ } else {
+ context.SetState(SCE_REG_ADDEDKEY);
+ }
+ } else if (context.ch == '=') {
+ afterEqualSign = true;
+ highlight = true;
+ } else if (afterEqualSign) {
+ bool wordStart = isalpha(context.ch) && !isalpha(context.chPrev);
+ if (wordStart && AtValueType(styler, currPos)) {
+ context.SetState(SCE_REG_VALUETYPE);
+ }
+ } else if (isxdigit(context.ch) && highlight) {
+ context.SetState(SCE_REG_HEXDIGIT);
+ }
+ highlight = (context.ch == '@') ? true : highlight;
+ if (setOperators.Contains(context.ch) && highlight) {
+ context.SetState(SCE_REG_OPERATOR);
+ }
+ }
+ context.Forward();
+ }
+ context.Complete();
+}
+
+// Folding similar to that of FoldPropsDoc in LexOthers
+void SCI_METHOD LexerRegistry::Fold(unsigned startPos,
+ int length,
+ int,
+ IDocument *pAccess) {
+ if (!options.fold) {
+ return;
+ }
+ LexAccessor styler(pAccess);
+ int currLine = styler.GetLine(startPos);
+ int visibleChars = 0;
+ unsigned endPos = startPos + length;
+ bool atKeyPath = false;
+ for (unsigned i = startPos; i < endPos; i++) {
+ atKeyPath = IsKeyPathState(styler.StyleAt(i)) ? true : atKeyPath;
+ char curr = styler.SafeGetCharAt(i);
+ char next = styler.SafeGetCharAt(i+1);
+ bool atEOL = (curr == '\r' && next != '\n') || (curr == '\n');
+ if (atEOL || i == (endPos-1)) {
+ int level = SC_FOLDLEVELBASE;
+ if (currLine > 0) {
+ int prevLevel = styler.LevelAt(currLine-1);
+ if (prevLevel & SC_FOLDLEVELHEADERFLAG) {
+ level += 1;
+ } else {
+ level = prevLevel;
+ }
+ }
+ if (!visibleChars && options.foldCompact) {
+ level |= SC_FOLDLEVELWHITEFLAG;
+ } else if (atKeyPath) {
+ level = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
+ }
+ if (level != styler.LevelAt(currLine)) {
+ styler.SetLevel(currLine, level);
+ }
+ currLine++;
+ visibleChars = 0;
+ atKeyPath = false;
+ }
+ if (!isspacechar(curr)) {
+ visibleChars++;
+ }
+ }
+
+ // Make the folding reach the last line in the file
+ int level = SC_FOLDLEVELBASE;
+ if (currLine > 0) {
+ int prevLevel = styler.LevelAt(currLine-1);
+ if (prevLevel & SC_FOLDLEVELHEADERFLAG) {
+ level += 1;
+ } else {
+ level = prevLevel;
+ }
+ }
+ styler.SetLevel(currLine, level);
+}
+
+LexerModule lmRegistry(SCLEX_REGISTRY,
+ LexerRegistry::LexerFactoryRegistry,
+ "registry",
+ RegistryWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRuby.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRuby.cxx
new file mode 100644
index 00000000000..9529ac24e93
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRuby.cxx
@@ -0,0 +1,1837 @@
+// Scintilla source code edit control
+/** @file LexRuby.cxx
+ ** Lexer for Ruby.
+ **/
+// Copyright 2001- by Clemens Wyss <wys@helbling.ch>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+//XXX Identical to Perl, put in common area
+static inline bool isEOLChar(char ch) {
+ return (ch == '\r') || (ch == '\n');
+}
+
+#define isSafeASCII(ch) ((unsigned int)(ch) <= 127)
+// This one's redundant, but makes for more readable code
+#define isHighBitChar(ch) ((unsigned int)(ch) > 127)
+
+static inline bool isSafeAlpha(char ch) {
+ return (isSafeASCII(ch) && isalpha(ch)) || ch == '_';
+}
+
+static inline bool isSafeAlnum(char ch) {
+ return (isSafeASCII(ch) && isalnum(ch)) || ch == '_';
+}
+
+static inline bool isSafeAlnumOrHigh(char ch) {
+ return isHighBitChar(ch) || isalnum(ch) || ch == '_';
+}
+
+static inline bool isSafeDigit(char ch) {
+ return isSafeASCII(ch) && isdigit(ch);
+}
+
+static inline bool isSafeWordcharOrHigh(char ch) {
+ // Error: scintilla's KeyWords.h includes '.' as a word-char
+ // we want to separate things that can take methods from the
+ // methods.
+ return isHighBitChar(ch) || isalnum(ch) || ch == '_';
+}
+
+static bool inline iswhitespace(char ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+#define MAX_KEYWORD_LENGTH 200
+
+#define STYLE_MASK 63
+#define actual_style(style) (style & STYLE_MASK)
+
+static bool followsDot(unsigned int pos, Accessor &styler) {
+ styler.Flush();
+ for (; pos >= 1; --pos) {
+ int style = actual_style(styler.StyleAt(pos));
+ char ch;
+ switch (style) {
+ case SCE_RB_DEFAULT:
+ ch = styler[pos];
+ if (ch == ' ' || ch == '\t') {
+ //continue
+ } else {
+ return false;
+ }
+ break;
+
+ case SCE_RB_OPERATOR:
+ return styler[pos] == '.';
+
+ default:
+ return false;
+ }
+ }
+ return false;
+}
+
+// Forward declarations
+static bool keywordIsAmbiguous(const char *prevWord);
+static bool keywordDoStartsLoop(int pos,
+ Accessor &styler);
+static bool keywordIsModifier(const char *word,
+ int pos,
+ Accessor &styler);
+
+static int ClassifyWordRb(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord) {
+ char s[MAX_KEYWORD_LENGTH];
+ unsigned int i, j;
+ unsigned int lim = end - start + 1; // num chars to copy
+ if (lim >= MAX_KEYWORD_LENGTH) {
+ lim = MAX_KEYWORD_LENGTH - 1;
+ }
+ for (i = start, j = 0; j < lim; i++, j++) {
+ s[j] = styler[i];
+ }
+ s[j] = '\0';
+ int chAttr;
+ if (0 == strcmp(prevWord, "class"))
+ chAttr = SCE_RB_CLASSNAME;
+ else if (0 == strcmp(prevWord, "module"))
+ chAttr = SCE_RB_MODULE_NAME;
+ else if (0 == strcmp(prevWord, "def"))
+ chAttr = SCE_RB_DEFNAME;
+ else if (keywords.InList(s) && ((start == 0) || !followsDot(start - 1, styler))) {
+ if (keywordIsAmbiguous(s)
+ && keywordIsModifier(s, start, styler)) {
+
+ // Demoted keywords are colored as keywords,
+ // but do not affect changes in indentation.
+ //
+ // Consider the word 'if':
+ // 1. <<if test ...>> : normal
+ // 2. <<stmt if test>> : demoted
+ // 3. <<lhs = if ...>> : normal: start a new indent level
+ // 4. <<obj.if = 10>> : color as identifer, since it follows '.'
+
+ chAttr = SCE_RB_WORD_DEMOTED;
+ } else {
+ chAttr = SCE_RB_WORD;
+ }
+ } else
+ chAttr = SCE_RB_IDENTIFIER;
+ styler.ColourTo(end, chAttr);
+ if (chAttr == SCE_RB_WORD) {
+ strcpy(prevWord, s);
+ } else {
+ prevWord[0] = 0;
+ }
+ return chAttr;
+}
+
+
+//XXX Identical to Perl, put in common area
+static bool isMatch(Accessor &styler, int lengthDoc, int pos, const char *val) {
+ if ((pos + static_cast<int>(strlen(val))) >= lengthDoc) {
+ return false;
+ }
+ while (*val) {
+ if (*val != styler[pos++]) {
+ return false;
+ }
+ val++;
+ }
+ return true;
+}
+
+// Do Ruby better -- find the end of the line, work back,
+// and then check for leading white space
+
+// Precondition: the here-doc target can be indented
+static bool lookingAtHereDocDelim(Accessor &styler,
+ int pos,
+ int lengthDoc,
+ const char *HereDocDelim)
+{
+ if (!isMatch(styler, lengthDoc, pos, HereDocDelim)) {
+ return false;
+ }
+ while (--pos > 0) {
+ char ch = styler[pos];
+ if (isEOLChar(ch)) {
+ return true;
+ } else if (ch != ' ' && ch != '\t') {
+ return false;
+ }
+ }
+ return false;
+}
+
+//XXX Identical to Perl, put in common area
+static char opposite(char ch) {
+ if (ch == '(')
+ return ')';
+ if (ch == '[')
+ return ']';
+ if (ch == '{')
+ return '}';
+ if (ch == '<')
+ return '>';
+ return ch;
+}
+
+// Null transitions when we see we've reached the end
+// and need to relex the curr char.
+
+static void redo_char(int &i, char &ch, char &chNext, char &chNext2,
+ int &state) {
+ i--;
+ chNext2 = chNext;
+ chNext = ch;
+ state = SCE_RB_DEFAULT;
+}
+
+static void advance_char(int &i, char &ch, char &chNext, char &chNext2) {
+ i++;
+ ch = chNext;
+ chNext = chNext2;
+}
+
+// precondition: startPos points to one after the EOL char
+static bool currLineContainsHereDelims(int &startPos,
+ Accessor &styler) {
+ if (startPos <= 1)
+ return false;
+
+ int pos;
+ for (pos = startPos - 1; pos > 0; pos--) {
+ char ch = styler.SafeGetCharAt(pos);
+ if (isEOLChar(ch)) {
+ // Leave the pointers where they are -- there are no
+ // here doc delims on the current line, even if
+ // the EOL isn't default style
+
+ return false;
+ } else {
+ styler.Flush();
+ if (actual_style(styler.StyleAt(pos)) == SCE_RB_HERE_DELIM) {
+ break;
+ }
+ }
+ }
+ if (pos == 0) {
+ return false;
+ }
+ // Update the pointers so we don't have to re-analyze the string
+ startPos = pos;
+ return true;
+}
+
+// This class is used by the enter and exit methods, so it needs
+// to be hoisted out of the function.
+
+class QuoteCls {
+public:
+ int Count;
+ char Up;
+ char Down;
+ QuoteCls() {
+ New();
+ }
+ void New() {
+ Count = 0;
+ Up = '\0';
+ Down = '\0';
+ }
+ void Open(char u) {
+ Count++;
+ Up = u;
+ Down = opposite(Up);
+ }
+ QuoteCls(const QuoteCls &q) {
+ // copy constructor -- use this for copying in
+ Count = q.Count;
+ Up = q.Up;
+ Down = q.Down;
+ }
+ QuoteCls &operator=(const QuoteCls &q) { // assignment constructor
+ if (this != &q) {
+ Count = q.Count;
+ Up = q.Up;
+ Down = q.Down;
+ }
+ return *this;
+ }
+
+};
+
+
+static void enterInnerExpression(int *p_inner_string_types,
+ int *p_inner_expn_brace_counts,
+ QuoteCls *p_inner_quotes,
+ int &inner_string_count,
+ int &state,
+ int &brace_counts,
+ QuoteCls curr_quote
+ ) {
+ p_inner_string_types[inner_string_count] = state;
+ state = SCE_RB_DEFAULT;
+ p_inner_expn_brace_counts[inner_string_count] = brace_counts;
+ brace_counts = 0;
+ p_inner_quotes[inner_string_count] = curr_quote;
+ ++inner_string_count;
+}
+
+static void exitInnerExpression(int *p_inner_string_types,
+ int *p_inner_expn_brace_counts,
+ QuoteCls *p_inner_quotes,
+ int &inner_string_count,
+ int &state,
+ int &brace_counts,
+ QuoteCls &curr_quote
+ ) {
+ --inner_string_count;
+ state = p_inner_string_types[inner_string_count];
+ brace_counts = p_inner_expn_brace_counts[inner_string_count];
+ curr_quote = p_inner_quotes[inner_string_count];
+}
+
+static bool isEmptyLine(int pos,
+ Accessor &styler) {
+ int spaceFlags = 0;
+ int lineCurrent = styler.GetLine(pos);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ return (indentCurrent & SC_FOLDLEVELWHITEFLAG) != 0;
+}
+
+static bool RE_CanFollowKeyword(const char *keyword) {
+ if (!strcmp(keyword, "and")
+ || !strcmp(keyword, "begin")
+ || !strcmp(keyword, "break")
+ || !strcmp(keyword, "case")
+ || !strcmp(keyword, "do")
+ || !strcmp(keyword, "else")
+ || !strcmp(keyword, "elsif")
+ || !strcmp(keyword, "if")
+ || !strcmp(keyword, "next")
+ || !strcmp(keyword, "return")
+ || !strcmp(keyword, "when")
+ || !strcmp(keyword, "unless")
+ || !strcmp(keyword, "until")
+ || !strcmp(keyword, "not")
+ || !strcmp(keyword, "or")) {
+ return true;
+ }
+ return false;
+}
+
+// Look at chars up to but not including endPos
+// Don't look at styles in case we're looking forward
+
+static int skipWhitespace(int startPos,
+ int endPos,
+ Accessor &styler) {
+ for (int i = startPos; i < endPos; i++) {
+ if (!iswhitespace(styler[i])) {
+ return i;
+ }
+ }
+ return endPos;
+}
+
+// This routine looks for false positives like
+// undef foo, <<
+// There aren't too many.
+//
+// iPrev points to the start of <<
+
+static bool sureThisIsHeredoc(int iPrev,
+ Accessor &styler,
+ char *prevWord) {
+
+ // Not so fast, since Ruby's so dynamic. Check the context
+ // to make sure we're OK.
+ int prevStyle;
+ int lineStart = styler.GetLine(iPrev);
+ int lineStartPosn = styler.LineStart(lineStart);
+ styler.Flush();
+
+ // Find the first word after some whitespace
+ int firstWordPosn = skipWhitespace(lineStartPosn, iPrev, styler);
+ if (firstWordPosn >= iPrev) {
+ // Have something like {^ <<}
+ //XXX Look at the first previous non-comment non-white line
+ // to establish the context. Not too likely though.
+ return true;
+ } else {
+ switch (prevStyle = styler.StyleAt(firstWordPosn)) {
+ case SCE_RB_WORD:
+ case SCE_RB_WORD_DEMOTED:
+ case SCE_RB_IDENTIFIER:
+ break;
+ default:
+ return true;
+ }
+ }
+ int firstWordEndPosn = firstWordPosn;
+ char *dst = prevWord;
+ for (;;) {
+ if (firstWordEndPosn >= iPrev ||
+ styler.StyleAt(firstWordEndPosn) != prevStyle) {
+ *dst = 0;
+ break;
+ }
+ *dst++ = styler[firstWordEndPosn];
+ firstWordEndPosn += 1;
+ }
+ //XXX Write a style-aware thing to regex scintilla buffer objects
+ if (!strcmp(prevWord, "undef")
+ || !strcmp(prevWord, "def")
+ || !strcmp(prevWord, "alias")) {
+ // These keywords are what we were looking for
+ return false;
+ }
+ return true;
+}
+
+// Routine that saves us from allocating a buffer for the here-doc target
+// targetEndPos points one past the end of the current target
+static bool haveTargetMatch(int currPos,
+ int lengthDoc,
+ int targetStartPos,
+ int targetEndPos,
+ Accessor &styler) {
+ if (lengthDoc - currPos < targetEndPos - targetStartPos) {
+ return false;
+ }
+ int i, j;
+ for (i = targetStartPos, j = currPos;
+ i < targetEndPos && j < lengthDoc;
+ i++, j++) {
+ if (styler[i] != styler[j]) {
+ return false;
+ }
+ }
+ return true;
+}
+
+// We need a check because the form
+// [identifier] <<[target]
+// is ambiguous. The Ruby lexer/parser resolves it by
+// looking to see if [identifier] names a variable or a
+// function. If it's the first, it's the start of a here-doc.
+// If it's a var, it's an operator. This lexer doesn't
+// maintain a symbol table, so it looks ahead to see what's
+// going on, in cases where we have
+// ^[white-space]*[identifier([.|::]identifier)*][white-space]*<<[target]
+//
+// If there's no occurrence of [target] on a line, assume we don't.
+
+// return true == yes, we have no heredocs
+
+static bool sureThisIsNotHeredoc(int lt2StartPos,
+ Accessor &styler) {
+ int prevStyle;
+ // Use full document, not just part we're styling
+ int lengthDoc = styler.Length();
+ int lineStart = styler.GetLine(lt2StartPos);
+ int lineStartPosn = styler.LineStart(lineStart);
+ styler.Flush();
+ const bool definitely_not_a_here_doc = true;
+ const bool looks_like_a_here_doc = false;
+
+ // Find the first word after some whitespace
+ int firstWordPosn = skipWhitespace(lineStartPosn, lt2StartPos, styler);
+ if (firstWordPosn >= lt2StartPos) {
+ return definitely_not_a_here_doc;
+ }
+ prevStyle = styler.StyleAt(firstWordPosn);
+ // If we have '<<' following a keyword, it's not a heredoc
+ if (prevStyle != SCE_RB_IDENTIFIER
+ && prevStyle != SCE_RB_INSTANCE_VAR
+ && prevStyle != SCE_RB_CLASS_VAR) {
+ return definitely_not_a_here_doc;
+ }
+ int newStyle = prevStyle;
+ // Some compilers incorrectly warn about uninit newStyle
+ for (firstWordPosn += 1; firstWordPosn <= lt2StartPos; firstWordPosn += 1) {
+ // Inner loop looks at the name
+ for (; firstWordPosn <= lt2StartPos; firstWordPosn += 1) {
+ newStyle = styler.StyleAt(firstWordPosn);
+ if (newStyle != prevStyle) {
+ break;
+ }
+ }
+ // Do we have '::' or '.'?
+ if (firstWordPosn < lt2StartPos && newStyle == SCE_RB_OPERATOR) {
+ char ch = styler[firstWordPosn];
+ if (ch == '.') {
+ // yes
+ } else if (ch == ':') {
+ if (styler.StyleAt(++firstWordPosn) != SCE_RB_OPERATOR) {
+ return definitely_not_a_here_doc;
+ } else if (styler[firstWordPosn] != ':') {
+ return definitely_not_a_here_doc;
+ }
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ // on second and next passes, only identifiers may appear since
+ // class and instance variable are private
+ prevStyle = SCE_RB_IDENTIFIER;
+ }
+ // Skip next batch of white-space
+ firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler);
+ if (firstWordPosn != lt2StartPos) {
+ // Have [[^ws[identifier]ws[*something_else*]ws<<
+ return definitely_not_a_here_doc;
+ }
+ // OK, now 'j' will point to the current spot moving ahead
+ int j = firstWordPosn + 1;
+ if (styler.StyleAt(j) != SCE_RB_OPERATOR || styler[j] != '<') {
+ // This shouldn't happen
+ return definitely_not_a_here_doc;
+ }
+ int nextLineStartPosn = styler.LineStart(lineStart + 1);
+ if (nextLineStartPosn >= lengthDoc) {
+ return definitely_not_a_here_doc;
+ }
+ j = skipWhitespace(j + 1, nextLineStartPosn, styler);
+ if (j >= lengthDoc) {
+ return definitely_not_a_here_doc;
+ }
+ bool allow_indent;
+ int target_start, target_end;
+ // From this point on no more styling, since we're looking ahead
+ if (styler[j] == '-') {
+ allow_indent = true;
+ j++;
+ } else {
+ allow_indent = false;
+ }
+
+ // Allow for quoted targets.
+ char target_quote = 0;
+ switch (styler[j]) {
+ case '\'':
+ case '"':
+ case '`':
+ target_quote = styler[j];
+ j += 1;
+ }
+
+ if (isSafeAlnum(styler[j])) {
+ // Init target_end because some compilers think it won't
+ // be initialized by the time it's used
+ target_start = target_end = j;
+ j++;
+ } else {
+ return definitely_not_a_here_doc;
+ }
+ for (; j < lengthDoc; j++) {
+ if (!isSafeAlnum(styler[j])) {
+ if (target_quote && styler[j] != target_quote) {
+ // unquoted end
+ return definitely_not_a_here_doc;
+ }
+
+ // And for now make sure that it's a newline
+ // don't handle arbitrary expressions yet
+
+ target_end = j;
+ if (target_quote) {
+ // Now we can move to the character after the string delimiter.
+ j += 1;
+ }
+ j = skipWhitespace(j, lengthDoc, styler);
+ if (j >= lengthDoc) {
+ return definitely_not_a_here_doc;
+ } else {
+ char ch = styler[j];
+ if (ch == '#' || isEOLChar(ch)) {
+ // This is OK, so break and continue;
+ break;
+ } else {
+ return definitely_not_a_here_doc;
+ }
+ }
+ }
+ }
+
+ // Just look at the start of each line
+ int last_line = styler.GetLine(lengthDoc - 1);
+ // But don't go too far
+ if (last_line > lineStart + 50) {
+ last_line = lineStart + 50;
+ }
+ for (int line_num = lineStart + 1; line_num <= last_line; line_num++) {
+ if (allow_indent) {
+ j = skipWhitespace(styler.LineStart(line_num), lengthDoc, styler);
+ } else {
+ j = styler.LineStart(line_num);
+ }
+ // target_end is one past the end
+ if (haveTargetMatch(j, lengthDoc, target_start, target_end, styler)) {
+ // We got it
+ return looks_like_a_here_doc;
+ }
+ }
+ return definitely_not_a_here_doc;
+}
+
+//todo: if we aren't looking at a stdio character,
+// move to the start of the first line that is not in a
+// multi-line construct
+
+static void synchronizeDocStart(unsigned int &startPos,
+ int &length,
+ int &initStyle,
+ Accessor &styler,
+ bool skipWhiteSpace=false) {
+
+ styler.Flush();
+ int style = actual_style(styler.StyleAt(startPos));
+ switch (style) {
+ case SCE_RB_STDIN:
+ case SCE_RB_STDOUT:
+ case SCE_RB_STDERR:
+ // Don't do anything else with these.
+ return;
+ }
+
+ int pos = startPos;
+ // Quick way to characterize each line
+ int lineStart;
+ for (lineStart = styler.GetLine(pos); lineStart > 0; lineStart--) {
+ // Now look at the style before the previous line's EOL
+ pos = styler.LineStart(lineStart) - 1;
+ if (pos <= 10) {
+ lineStart = 0;
+ break;
+ }
+ char ch = styler.SafeGetCharAt(pos);
+ char chPrev = styler.SafeGetCharAt(pos - 1);
+ if (ch == '\n' && chPrev == '\r') {
+ pos--;
+ }
+ if (styler.SafeGetCharAt(pos - 1) == '\\') {
+ // Continuation line -- keep going
+ } else if (actual_style(styler.StyleAt(pos)) != SCE_RB_DEFAULT) {
+ // Part of multi-line construct -- keep going
+ } else if (currLineContainsHereDelims(pos, styler)) {
+ // Keep going, with pos and length now pointing
+ // at the end of the here-doc delimiter
+ } else if (skipWhiteSpace && isEmptyLine(pos, styler)) {
+ // Keep going
+ } else {
+ break;
+ }
+ }
+ pos = styler.LineStart(lineStart);
+ length += (startPos - pos);
+ startPos = pos;
+ initStyle = SCE_RB_DEFAULT;
+}
+
+static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+
+ // Lexer for Ruby often has to backtrack to start of current style to determine
+ // which characters are being used as quotes, how deeply nested is the
+ // start position and what the termination string is for here documents
+
+ WordList &keywords = *keywordlists[0];
+
+ class HereDocCls {
+ public:
+ int State;
+ // States
+ // 0: '<<' encountered
+ // 1: collect the delimiter
+ // 1b: text between the end of the delimiter and the EOL
+ // 2: here doc text (lines after the delimiter)
+ char Quote; // the char after '<<'
+ bool Quoted; // true if Quote in ('\'','"','`')
+ int DelimiterLength; // strlen(Delimiter)
+ char Delimiter[256]; // the Delimiter, limit of 256: from Perl
+ bool CanBeIndented;
+ HereDocCls() {
+ State = 0;
+ DelimiterLength = 0;
+ Delimiter[0] = '\0';
+ CanBeIndented = false;
+ }
+ };
+ HereDocCls HereDoc;
+
+ QuoteCls Quote;
+
+ int numDots = 0; // For numbers --
+ // Don't start lexing in the middle of a num
+
+ synchronizeDocStart(startPos, length, initStyle, styler, // ref args
+ false);
+
+ bool preferRE = true;
+ int state = initStyle;
+ int lengthDoc = startPos + length;
+
+ char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero
+ prevWord[0] = '\0';
+ if (length == 0)
+ return;
+
+ char chPrev = styler.SafeGetCharAt(startPos - 1);
+ char chNext = styler.SafeGetCharAt(startPos);
+ bool is_real_number = true; // Differentiate between constants and ?-sequences.
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+
+ static int q_states[] = {SCE_RB_STRING_Q,
+ SCE_RB_STRING_QQ,
+ SCE_RB_STRING_QR,
+ SCE_RB_STRING_QW,
+ SCE_RB_STRING_QW,
+ SCE_RB_STRING_QX
+ };
+ static const char *q_chars = "qQrwWx";
+
+ // In most cases a value of 2 should be ample for the code in the
+ // Ruby library, and the code the user is likely to enter.
+ // For example,
+ // fu_output_message "mkdir #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}"
+ // if options[:verbose]
+ // from fileutils.rb nests to a level of 2
+ // If the user actually hits a 6th occurrence of '#{' in a double-quoted
+ // string (including regex'es, %Q, %<sym>, %w, and other strings
+ // that interpolate), it will stay as a string. The problem with this
+ // is that quotes might flip, a 7th '#{' will look like a comment,
+ // and code-folding might be wrong.
+
+ // If anyone runs into this problem, I recommend raising this
+ // value slightly higher to replacing the fixed array with a linked
+ // list. Keep in mind this code will be called every time the lexer
+ // is invoked.
+
+#define INNER_STRINGS_MAX_COUNT 5
+ // These vars track our instances of "...#{,,,%Q<..#{,,,}...>,,,}..."
+ int inner_string_types[INNER_STRINGS_MAX_COUNT];
+ // Track # braces when we push a new #{ thing
+ int inner_expn_brace_counts[INNER_STRINGS_MAX_COUNT];
+ QuoteCls inner_quotes[INNER_STRINGS_MAX_COUNT];
+ int inner_string_count = 0;
+ int brace_counts = 0; // Number of #{ ... } things within an expression
+
+ int i;
+ for (i = 0; i < INNER_STRINGS_MAX_COUNT; i++) {
+ inner_string_types[i] = 0;
+ inner_expn_brace_counts[i] = 0;
+ }
+ for (i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = chNext2;
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ // skip on DOS/Windows
+ //No, don't, because some things will get tagged on,
+ // so we won't recognize keywords, for example
+#if 0
+ if (ch == '\r' && chNext == '\n') {
+ continue;
+ }
+#endif
+
+ if (HereDoc.State == 1 && isEOLChar(ch)) {
+ // Begin of here-doc (the line after the here-doc delimiter):
+ HereDoc.State = 2;
+ styler.ColourTo(i-1, state);
+ // Don't check for a missing quote, just jump into
+ // the here-doc state
+ state = SCE_RB_HERE_Q;
+ }
+
+ // Regular transitions
+ if (state == SCE_RB_DEFAULT) {
+ if (isSafeDigit(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_NUMBER;
+ is_real_number = true;
+ numDots = 0;
+ } else if (isHighBitChar(ch) || iswordstart(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_WORD;
+ } else if (ch == '#') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_COMMENTLINE;
+ } else if (ch == '=') {
+ // =begin indicates the start of a comment (doc) block
+ if ((i == 0 || isEOLChar(chPrev))
+ && chNext == 'b'
+ && styler.SafeGetCharAt(i + 2) == 'e'
+ && styler.SafeGetCharAt(i + 3) == 'g'
+ && styler.SafeGetCharAt(i + 4) == 'i'
+ && styler.SafeGetCharAt(i + 5) == 'n'
+ && !isSafeWordcharOrHigh(styler.SafeGetCharAt(i + 6))) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_POD;
+ } else {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ preferRE = true;
+ }
+ } else if (ch == '"') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_STRING;
+ Quote.New();
+ Quote.Open(ch);
+ } else if (ch == '\'') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_CHARACTER;
+ Quote.New();
+ Quote.Open(ch);
+ } else if (ch == '`') {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_BACKTICKS;
+ Quote.New();
+ Quote.Open(ch);
+ } else if (ch == '@') {
+ // Instance or class var
+ styler.ColourTo(i - 1, state);
+ if (chNext == '@') {
+ state = SCE_RB_CLASS_VAR;
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ } else {
+ state = SCE_RB_INSTANCE_VAR;
+ }
+ } else if (ch == '$') {
+ // Check for a builtin global
+ styler.ColourTo(i - 1, state);
+ // Recognize it bit by bit
+ state = SCE_RB_GLOBAL;
+ } else if (ch == '/' && preferRE) {
+ // Ambigous operator
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_REGEX;
+ Quote.New();
+ Quote.Open(ch);
+ } else if (ch == '<' && chNext == '<' && chNext2 != '=') {
+
+ // Recognise the '<<' symbol - either a here document or a binary op
+ styler.ColourTo(i - 1, state);
+ i++;
+ chNext = chNext2;
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+
+ if (!(strchr("\"\'`_-", chNext2) || isSafeAlpha(chNext2))) {
+ // It's definitely not a here-doc,
+ // based on Ruby's lexer/parser in the
+ // heredoc_identifier routine.
+ // Nothing else to do.
+ } else if (preferRE) {
+ if (sureThisIsHeredoc(i - 1, styler, prevWord)) {
+ state = SCE_RB_HERE_DELIM;
+ HereDoc.State = 0;
+ }
+ // else leave it in default state
+ } else {
+ if (sureThisIsNotHeredoc(i - 1, styler)) {
+ // leave state as default
+ // We don't have all the heuristics Perl has for indications
+ // of a here-doc, because '<<' is overloadable and used
+ // for so many other classes.
+ } else {
+ state = SCE_RB_HERE_DELIM;
+ HereDoc.State = 0;
+ }
+ }
+ preferRE = (state != SCE_RB_HERE_DELIM);
+ } else if (ch == ':') {
+ styler.ColourTo(i - 1, state);
+ if (chNext == ':') {
+ // Mark "::" as an operator, not symbol start
+ styler.ColourTo(i + 1, SCE_RB_OPERATOR);
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ } else if (isSafeWordcharOrHigh(chNext)) {
+ state = SCE_RB_SYMBOL;
+ } else if ((chNext == '@' || chNext == '$') &&
+ isSafeWordcharOrHigh(chNext2)) {
+ // instance and global variable followed by an identifier
+ advance_char(i, ch, chNext, chNext2);
+ state = SCE_RB_SYMBOL;
+ } else if (((chNext == '@' && chNext2 == '@') ||
+ (chNext == '$' && chNext2 == '-')) &&
+ isSafeWordcharOrHigh(styler.SafeGetCharAt(i+3))) {
+ // class variables and special global variable "$-IDENTCHAR"
+ state = SCE_RB_SYMBOL;
+ // $-IDENTCHAR doesn't continue past the IDENTCHAR
+ if (chNext == '$') {
+ styler.ColourTo(i+3, SCE_RB_SYMBOL);
+ state = SCE_RB_DEFAULT;
+ }
+ i += 3;
+ ch = styler.SafeGetCharAt(i);
+ chNext = styler.SafeGetCharAt(i+1);
+ } else if (chNext == '$' && strchr("_~*$?!@/\\;,.=:<>\"&`'+", chNext2)) {
+ // single-character special global variables
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i+1);
+ styler.ColourTo(i, SCE_RB_SYMBOL);
+ state = SCE_RB_DEFAULT;
+ } else if (strchr("[*!~+-*/%=<>&^|", chNext)) {
+ // Do the operator analysis in-line, looking ahead
+ // Based on the table in pickaxe 2nd ed., page 339
+ bool doColoring = true;
+ switch (chNext) {
+ case '[':
+ if (chNext2 == ']') {
+ char ch_tmp = styler.SafeGetCharAt(i + 3);
+ if (ch_tmp == '=') {
+ i += 3;
+ ch = ch_tmp;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ i += 2;
+ ch = chNext2;
+ chNext = ch_tmp;
+ }
+ } else {
+ doColoring = false;
+ }
+ break;
+
+ case '*':
+ if (chNext2 == '*') {
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ advance_char(i, ch, chNext, chNext2);
+ }
+ break;
+
+ case '!':
+ if (chNext2 == '=' || chNext2 == '~') {
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ advance_char(i, ch, chNext, chNext2);
+ }
+ break;
+
+ case '<':
+ if (chNext2 == '<') {
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else if (chNext2 == '=') {
+ char ch_tmp = styler.SafeGetCharAt(i + 3);
+ if (ch_tmp == '>') { // <=> operator
+ i += 3;
+ ch = ch_tmp;
+ chNext = styler.SafeGetCharAt(i + 1);
+ } else {
+ i += 2;
+ ch = chNext2;
+ chNext = ch_tmp;
+ }
+ } else {
+ advance_char(i, ch, chNext, chNext2);
+ }
+ break;
+
+ default:
+ // Simple one-character operators
+ advance_char(i, ch, chNext, chNext2);
+ break;
+ }
+ if (doColoring) {
+ styler.ColourTo(i, SCE_RB_SYMBOL);
+ state = SCE_RB_DEFAULT;
+ }
+ } else if (!preferRE) {
+ // Don't color symbol strings (yet)
+ // Just color the ":" and color rest as string
+ styler.ColourTo(i, SCE_RB_SYMBOL);
+ state = SCE_RB_DEFAULT;
+ } else {
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ state = SCE_RB_DEFAULT;
+ preferRE = true;
+ }
+ } else if (ch == '%') {
+ styler.ColourTo(i - 1, state);
+ bool have_string = false;
+ if (strchr(q_chars, chNext) && !isSafeWordcharOrHigh(chNext2)) {
+ Quote.New();
+ const char *hit = strchr(q_chars, chNext);
+ if (hit != NULL) {
+ state = q_states[hit - q_chars];
+ Quote.Open(chNext2);
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i + 1);
+ have_string = true;
+ }
+ } else if (preferRE && !isSafeWordcharOrHigh(chNext)) {
+ // Ruby doesn't allow high bit chars here,
+ // but the editor host might
+ Quote.New();
+ state = SCE_RB_STRING_QQ;
+ Quote.Open(chNext);
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ have_string = true;
+ } else if (!isSafeWordcharOrHigh(chNext) && !iswhitespace(chNext) && !isEOLChar(chNext)) {
+ // Ruby doesn't allow high bit chars here,
+ // but the editor host might
+ Quote.New();
+ state = SCE_RB_STRING_QQ;
+ Quote.Open(chNext);
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ have_string = true;
+ }
+ if (!have_string) {
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ // stay in default
+ preferRE = true;
+ }
+ } else if (ch == '?') {
+ styler.ColourTo(i - 1, state);
+ if (iswhitespace(chNext) || chNext == '\n' || chNext == '\r') {
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ } else {
+ // It's the start of a character code escape sequence
+ // Color it as a number.
+ state = SCE_RB_NUMBER;
+ is_real_number = false;
+ }
+ } else if (isoperator(ch) || ch == '.') {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ // If we're ending an expression or block,
+ // assume it ends an object, and the ambivalent
+ // constructs are binary operators
+ //
+ // So if we don't have one of these chars,
+ // we aren't ending an object exp'n, and ops
+ // like : << / are unary operators.
+
+ if (ch == '{') {
+ ++brace_counts;
+ preferRE = true;
+ } else if (ch == '}' && --brace_counts < 0
+ && inner_string_count > 0) {
+ styler.ColourTo(i, SCE_RB_OPERATOR);
+ exitInnerExpression(inner_string_types,
+ inner_expn_brace_counts,
+ inner_quotes,
+ inner_string_count,
+ state, brace_counts, Quote);
+ } else {
+ preferRE = (strchr(")}].", ch) == NULL);
+ }
+ // Stay in default state
+ } else if (isEOLChar(ch)) {
+ // Make sure it's a true line-end, with no backslash
+ if ((ch == '\r' || (ch == '\n' && chPrev != '\r'))
+ && chPrev != '\\') {
+ // Assume we've hit the end of the statement.
+ preferRE = true;
+ }
+ }
+ } else if (state == SCE_RB_WORD) {
+ if (ch == '.' || !isSafeWordcharOrHigh(ch)) {
+ // Words include x? in all contexts,
+ // and <letters>= after either 'def' or a dot
+ // Move along until a complete word is on our left
+
+ // Default accessor treats '.' as word-chars,
+ // but we don't for now.
+
+ if (ch == '='
+ && isSafeWordcharOrHigh(chPrev)
+ && (chNext == '('
+ || strchr(" \t\n\r", chNext) != NULL)
+ && (!strcmp(prevWord, "def")
+ || followsDot(styler.GetStartSegment(), styler))) {
+ // <name>= is a name only when being def'd -- Get it the next time
+ // This means that <name>=<name> is always lexed as
+ // <name>, (op, =), <name>
+ } else if ((ch == '?' || ch == '!')
+ && isSafeWordcharOrHigh(chPrev)
+ && !isSafeWordcharOrHigh(chNext)) {
+ // <name>? is a name -- Get it the next time
+ // But <name>?<name> is always lexed as
+ // <name>, (op, ?), <name>
+ // Same with <name>! to indicate a method that
+ // modifies its target
+ } else if (isEOLChar(ch)
+ && isMatch(styler, lengthDoc, i - 7, "__END__")) {
+ styler.ColourTo(i, SCE_RB_DATASECTION);
+ state = SCE_RB_DATASECTION;
+ // No need to handle this state -- we'll just move to the end
+ preferRE = false;
+ } else {
+ int wordStartPos = styler.GetStartSegment();
+ int word_style = ClassifyWordRb(wordStartPos, i - 1, keywords, styler, prevWord);
+ switch (word_style) {
+ case SCE_RB_WORD:
+ preferRE = RE_CanFollowKeyword(prevWord);
+ break;
+
+ case SCE_RB_WORD_DEMOTED:
+ preferRE = true;
+ break;
+
+ case SCE_RB_IDENTIFIER:
+ if (isMatch(styler, lengthDoc, wordStartPos, "print")) {
+ preferRE = true;
+ } else if (isEOLChar(ch)) {
+ preferRE = true;
+ } else {
+ preferRE = false;
+ }
+ break;
+ default:
+ preferRE = false;
+ }
+ if (ch == '.') {
+ // We might be redefining an operator-method
+ preferRE = false;
+ }
+ // And if it's the first
+ redo_char(i, ch, chNext, chNext2, state); // pass by ref
+ }
+ }
+ } else if (state == SCE_RB_NUMBER) {
+ if (!is_real_number) {
+ if (ch != '\\') {
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ } else if (strchr("\\ntrfvaebs", chNext)) {
+ // Terminal escape sequence -- handle it next time
+ // Nothing more to do this time through the loop
+ } else if (chNext == 'C' || chNext == 'M') {
+ if (chNext2 != '-') {
+ // \C or \M ends the sequence -- handle it next time
+ } else {
+ // Move from abc?\C-x
+ // ^
+ // to
+ // ^
+ i += 2;
+ ch = chNext2;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ } else if (chNext == 'c') {
+ // Stay here, \c is a combining sequence
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ } else {
+ // ?\x, including ?\\ is final.
+ styler.ColourTo(i + 1, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ advance_char(i, ch, chNext, chNext2);
+ }
+ } else if (isSafeAlnumOrHigh(ch) || ch == '_') {
+ // Keep going
+ } else if (ch == '.' && chNext == '.') {
+ ++numDots;
+ styler.ColourTo(i - 1, state);
+ redo_char(i, ch, chNext, chNext2, state); // pass by ref
+ } else if (ch == '.' && ++numDots == 1) {
+ // Keep going
+ } else {
+ styler.ColourTo(i - 1, state);
+ redo_char(i, ch, chNext, chNext2, state); // pass by ref
+ preferRE = false;
+ }
+ } else if (state == SCE_RB_COMMENTLINE) {
+ if (isEOLChar(ch)) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_DEFAULT;
+ // Use whatever setting we had going into the comment
+ }
+ } else if (state == SCE_RB_HERE_DELIM) {
+ // See the comment for SCE_RB_HERE_DELIM in LexPerl.cxx
+ // Slightly different: if we find an immediate '-',
+ // the target can appear indented.
+
+ if (HereDoc.State == 0) { // '<<' encountered
+ HereDoc.State = 1;
+ HereDoc.DelimiterLength = 0;
+ if (ch == '-') {
+ HereDoc.CanBeIndented = true;
+ advance_char(i, ch, chNext, chNext2); // pass by ref
+ } else {
+ HereDoc.CanBeIndented = false;
+ }
+ if (isEOLChar(ch)) {
+ // Bail out of doing a here doc if there's no target
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ } else {
+ HereDoc.Quote = ch;
+
+ if (ch == '\'' || ch == '"' || ch == '`') {
+ HereDoc.Quoted = true;
+ HereDoc.Delimiter[0] = '\0';
+ } else {
+ HereDoc.Quoted = false;
+ HereDoc.Delimiter[0] = ch;
+ HereDoc.Delimiter[1] = '\0';
+ HereDoc.DelimiterLength = 1;
+ }
+ }
+ } else if (HereDoc.State == 1) { // collect the delimiter
+ if (isEOLChar(ch)) {
+ // End the quote now, and go back for more
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_DEFAULT;
+ i--;
+ chNext = ch;
+ preferRE = false;
+ } else if (HereDoc.Quoted) {
+ if (ch == HereDoc.Quote) { // closing quote => end of delimiter
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ } else {
+ if (ch == '\\' && !isEOLChar(chNext)) {
+ advance_char(i, ch, chNext, chNext2);
+ }
+ HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch;
+ HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0';
+ }
+ } else { // an unquoted here-doc delimiter
+ if (isSafeAlnumOrHigh(ch) || ch == '_') {
+ HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch;
+ HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0';
+ } else {
+ styler.ColourTo(i - 1, state);
+ redo_char(i, ch, chNext, chNext2, state);
+ preferRE = false;
+ }
+ }
+ if (HereDoc.DelimiterLength >= static_cast<int>(sizeof(HereDoc.Delimiter)) - 1) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_ERROR;
+ preferRE = false;
+ }
+ }
+ } else if (state == SCE_RB_HERE_Q) {
+ // Not needed: HereDoc.State == 2
+ // Indentable here docs: look backwards
+ // Non-indentable: look forwards, like in Perl
+ //
+ // Why: so we can quickly resolve things like <<-" abc"
+
+ if (!HereDoc.CanBeIndented) {
+ if (isEOLChar(chPrev)
+ && isMatch(styler, lengthDoc, i, HereDoc.Delimiter)) {
+ styler.ColourTo(i - 1, state);
+ i += HereDoc.DelimiterLength - 1;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (isEOLChar(chNext)) {
+ styler.ColourTo(i, SCE_RB_HERE_DELIM);
+ state = SCE_RB_DEFAULT;
+ HereDoc.State = 0;
+ preferRE = false;
+ }
+ // Otherwise we skipped through the here doc faster.
+ }
+ } else if (isEOLChar(chNext)
+ && lookingAtHereDocDelim(styler,
+ i - HereDoc.DelimiterLength + 1,
+ lengthDoc,
+ HereDoc.Delimiter)) {
+ styler.ColourTo(i - 1 - HereDoc.DelimiterLength, state);
+ styler.ColourTo(i, SCE_RB_HERE_DELIM);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ HereDoc.State = 0;
+ }
+ } else if (state == SCE_RB_CLASS_VAR
+ || state == SCE_RB_INSTANCE_VAR
+ || state == SCE_RB_SYMBOL) {
+ if (state == SCE_RB_SYMBOL &&
+ // FIDs suffices '?' and '!'
+ (((ch == '!' || ch == '?') && chNext != '=') ||
+ // identifier suffix '='
+ (ch == '=' && (chNext != '~' && chNext != '>' &&
+ (chNext != '=' || chNext2 == '>'))))) {
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ } else if (!isSafeWordcharOrHigh(ch)) {
+ styler.ColourTo(i - 1, state);
+ redo_char(i, ch, chNext, chNext2, state); // pass by ref
+ preferRE = false;
+ }
+ } else if (state == SCE_RB_GLOBAL) {
+ if (!isSafeWordcharOrHigh(ch)) {
+ // handle special globals here as well
+ if (chPrev == '$') {
+ if (ch == '-') {
+ // Include the next char, like $-a
+ advance_char(i, ch, chNext, chNext2);
+ }
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ } else {
+ styler.ColourTo(i - 1, state);
+ redo_char(i, ch, chNext, chNext2, state); // pass by ref
+ }
+ preferRE = false;
+ }
+ } else if (state == SCE_RB_POD) {
+ // PODs end with ^=end\s, -- any whitespace can follow =end
+ if (strchr(" \t\n\r", ch) != NULL
+ && i > 5
+ && isEOLChar(styler[i - 5])
+ && isMatch(styler, lengthDoc, i - 4, "=end")) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ }
+ } else if (state == SCE_RB_REGEX || state == SCE_RB_STRING_QR) {
+ if (ch == '\\' && Quote.Up != '\\') {
+ // Skip one
+ advance_char(i, ch, chNext, chNext2);
+ } else if (ch == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ // Include the options
+ while (isSafeAlpha(chNext)) {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ }
+ } else if (ch == Quote.Up) {
+ // Only if close quoter != open quoter
+ Quote.Count++;
+
+ } else if (ch == '#') {
+ if (chNext == '{'
+ && inner_string_count < INNER_STRINGS_MAX_COUNT) {
+ // process #{ ... }
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i + 1, SCE_RB_OPERATOR);
+ enterInnerExpression(inner_string_types,
+ inner_expn_brace_counts,
+ inner_quotes,
+ inner_string_count,
+ state,
+ brace_counts,
+ Quote);
+ preferRE = true;
+ // Skip one
+ advance_char(i, ch, chNext, chNext2);
+ } else {
+ //todo: distinguish comments from pound chars
+ // for now, handle as comment
+ styler.ColourTo(i - 1, state);
+ bool inEscape = false;
+ while (++i < lengthDoc) {
+ ch = styler.SafeGetCharAt(i);
+ if (ch == '\\') {
+ inEscape = true;
+ } else if (isEOLChar(ch)) {
+ // Comment inside a regex
+ styler.ColourTo(i - 1, SCE_RB_COMMENTLINE);
+ break;
+ } else if (inEscape) {
+ inEscape = false; // don't look at char
+ } else if (ch == Quote.Down) {
+ // Have the regular handler deal with this
+ // to get trailing modifiers.
+ i--;
+ ch = styler[i];
+ break;
+ }
+ }
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ }
+ // Quotes of all kinds...
+ } else if (state == SCE_RB_STRING_Q || state == SCE_RB_STRING_QQ ||
+ state == SCE_RB_STRING_QX || state == SCE_RB_STRING_QW ||
+ state == SCE_RB_STRING || state == SCE_RB_CHARACTER ||
+ state == SCE_RB_BACKTICKS) {
+ if (!Quote.Down && !isspacechar(ch)) {
+ Quote.Open(ch);
+ } else if (ch == '\\' && Quote.Up != '\\') {
+ //Riddle me this: Is it safe to skip *every* escaped char?
+ advance_char(i, ch, chNext, chNext2);
+ } else if (ch == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ styler.ColourTo(i, state);
+ state = SCE_RB_DEFAULT;
+ preferRE = false;
+ }
+ } else if (ch == Quote.Up) {
+ Quote.Count++;
+ } else if (ch == '#' && chNext == '{'
+ && inner_string_count < INNER_STRINGS_MAX_COUNT
+ && state != SCE_RB_CHARACTER
+ && state != SCE_RB_STRING_Q) {
+ // process #{ ... }
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i + 1, SCE_RB_OPERATOR);
+ enterInnerExpression(inner_string_types,
+ inner_expn_brace_counts,
+ inner_quotes,
+ inner_string_count,
+ state,
+ brace_counts,
+ Quote);
+ preferRE = true;
+ // Skip one
+ advance_char(i, ch, chNext, chNext2);
+ }
+ }
+
+ if (state == SCE_RB_ERROR) {
+ break;
+ }
+ chPrev = ch;
+ }
+ if (state == SCE_RB_WORD) {
+ // We've ended on a word, possibly at EOF, and need to
+ // classify it.
+ (void) ClassifyWordRb(styler.GetStartSegment(), lengthDoc - 1, keywords, styler, prevWord);
+ } else {
+ styler.ColourTo(lengthDoc - 1, state);
+ }
+}
+
+// Helper functions for folding, disambiguation keywords
+// Assert that there are no high-bit chars
+
+static void getPrevWord(int pos,
+ char *prevWord,
+ Accessor &styler,
+ int word_state)
+{
+ int i;
+ styler.Flush();
+ for (i = pos - 1; i > 0; i--) {
+ if (actual_style(styler.StyleAt(i)) != word_state) {
+ i++;
+ break;
+ }
+ }
+ if (i < pos - MAX_KEYWORD_LENGTH) // overflow
+ i = pos - MAX_KEYWORD_LENGTH;
+ char *dst = prevWord;
+ for (; i <= pos; i++) {
+ *dst++ = styler[i];
+ }
+ *dst = 0;
+}
+
+static bool keywordIsAmbiguous(const char *prevWord)
+{
+ // Order from most likely used to least likely
+ // Lots of ways to do a loop in Ruby besides 'while/until'
+ if (!strcmp(prevWord, "if")
+ || !strcmp(prevWord, "do")
+ || !strcmp(prevWord, "while")
+ || !strcmp(prevWord, "unless")
+ || !strcmp(prevWord, "until")
+ || !strcmp(prevWord, "for")) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+// Demote keywords in the following conditions:
+// if, while, unless, until modify a statement
+// do after a while or until, as a noise word (like then after if)
+
+static bool keywordIsModifier(const char *word,
+ int pos,
+ Accessor &styler)
+{
+ if (word[0] == 'd' && word[1] == 'o' && !word[2]) {
+ return keywordDoStartsLoop(pos, styler);
+ }
+ char ch, chPrev, chPrev2;
+ int style = SCE_RB_DEFAULT;
+ int lineStart = styler.GetLine(pos);
+ int lineStartPosn = styler.LineStart(lineStart);
+ // We want to step backwards until we don't care about the current
+ // position. But first move lineStartPosn back behind any
+ // continuations immediately above word.
+ while (lineStartPosn > 0) {
+ ch = styler[lineStartPosn-1];
+ if (ch == '\n' || ch == '\r') {
+ chPrev = styler.SafeGetCharAt(lineStartPosn-2);
+ chPrev2 = styler.SafeGetCharAt(lineStartPosn-3);
+ lineStart = styler.GetLine(lineStartPosn-1);
+ // If we find a continuation line, include it in our analysis.
+ if (chPrev == '\\') {
+ lineStartPosn = styler.LineStart(lineStart);
+ } else if (ch == '\n' && chPrev == '\r' && chPrev2 == '\\') {
+ lineStartPosn = styler.LineStart(lineStart);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+
+ styler.Flush();
+ while (--pos >= lineStartPosn) {
+ style = actual_style(styler.StyleAt(pos));
+ if (style == SCE_RB_DEFAULT) {
+ if (iswhitespace(ch = styler[pos])) {
+ //continue
+ } else if (ch == '\r' || ch == '\n') {
+ // Scintilla's LineStart() and GetLine() routines aren't
+ // platform-independent, so if we have text prepared with
+ // a different system we can't rely on it.
+
+ // Also, lineStartPosn may have been moved to more than one
+ // line above word's line while pushing past continuations.
+ chPrev = styler.SafeGetCharAt(pos - 1);
+ chPrev2 = styler.SafeGetCharAt(pos - 2);
+ if (chPrev == '\\') {
+ pos-=1; // gloss over the "\\"
+ //continue
+ } else if (ch == '\n' && chPrev == '\r' && chPrev2 == '\\') {
+ pos-=2; // gloss over the "\\\r"
+ //continue
+ } else {
+ return false;
+ }
+ }
+ } else {
+ break;
+ }
+ }
+ if (pos < lineStartPosn) {
+ return false;
+ }
+ // First things where the action is unambiguous
+ switch (style) {
+ case SCE_RB_DEFAULT:
+ case SCE_RB_COMMENTLINE:
+ case SCE_RB_POD:
+ case SCE_RB_CLASSNAME:
+ case SCE_RB_DEFNAME:
+ case SCE_RB_MODULE_NAME:
+ return false;
+ case SCE_RB_OPERATOR:
+ break;
+ case SCE_RB_WORD:
+ // Watch out for uses of 'else if'
+ //XXX: Make a list of other keywords where 'if' isn't a modifier
+ // and can appear legitimately
+ // Formulate this to avoid warnings from most compilers
+ if (strcmp(word, "if") == 0) {
+ char prevWord[MAX_KEYWORD_LENGTH + 1];
+ getPrevWord(pos, prevWord, styler, SCE_RB_WORD);
+ return strcmp(prevWord, "else") != 0;
+ }
+ return true;
+ default:
+ return true;
+ }
+ // Assume that if the keyword follows an operator,
+ // usually it's a block assignment, like
+ // a << if x then y else z
+
+ ch = styler[pos];
+ switch (ch) {
+ case ')':
+ case ']':
+ case '}':
+ return true;
+ default:
+ return false;
+ }
+}
+
+#define WHILE_BACKWARDS "elihw"
+#define UNTIL_BACKWARDS "litnu"
+#define FOR_BACKWARDS "rof"
+
+// Nothing fancy -- look to see if we follow a while/until somewhere
+// on the current line
+
+static bool keywordDoStartsLoop(int pos,
+ Accessor &styler)
+{
+ char ch;
+ int style;
+ int lineStart = styler.GetLine(pos);
+ int lineStartPosn = styler.LineStart(lineStart);
+ styler.Flush();
+ while (--pos >= lineStartPosn) {
+ style = actual_style(styler.StyleAt(pos));
+ if (style == SCE_RB_DEFAULT) {
+ if ((ch = styler[pos]) == '\r' || ch == '\n') {
+ // Scintilla's LineStart() and GetLine() routines aren't
+ // platform-independent, so if we have text prepared with
+ // a different system we can't rely on it.
+ return false;
+ }
+ } else if (style == SCE_RB_WORD) {
+ // Check for while or until, but write the word in backwards
+ char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero
+ char *dst = prevWord;
+ int wordLen = 0;
+ int start_word;
+ for (start_word = pos;
+ start_word >= lineStartPosn && actual_style(styler.StyleAt(start_word)) == SCE_RB_WORD;
+ start_word--) {
+ if (++wordLen < MAX_KEYWORD_LENGTH) {
+ *dst++ = styler[start_word];
+ }
+ }
+ *dst = 0;
+ // Did we see our keyword?
+ if (!strcmp(prevWord, WHILE_BACKWARDS)
+ || !strcmp(prevWord, UNTIL_BACKWARDS)
+ || !strcmp(prevWord, FOR_BACKWARDS)) {
+ return true;
+ }
+ // We can move pos to the beginning of the keyword, and then
+ // accept another decrement, as we can never have two contiguous
+ // keywords:
+ // word1 word2
+ // ^
+ // <- move to start_word
+ // ^
+ // <- loop decrement
+ // ^ # pointing to end of word1 is fine
+ pos = start_word;
+ }
+ }
+ return false;
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ if (ch == '#')
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+
+/*
+ * Folding Ruby
+ *
+ * The language is quite complex to analyze without a full parse.
+ * For example, this line shouldn't affect fold level:
+ *
+ * print "hello" if feeling_friendly?
+ *
+ * Neither should this:
+ *
+ * print "hello" \
+ * if feeling_friendly?
+ *
+ *
+ * But this should:
+ *
+ * if feeling_friendly? #++
+ * print "hello" \
+ * print "goodbye"
+ * end #--
+ *
+ * So we cheat, by actually looking at the existing indentation
+ * levels for each line, and just echoing it back. Like Python.
+ * Then if we get better at it, we'll take braces into consideration,
+ * which always affect folding levels.
+
+ * How the keywords should work:
+ * No effect:
+ * __FILE__ __LINE__ BEGIN END alias and
+ * defined? false in nil not or self super then
+ * true undef
+
+ * Always increment:
+ * begin class def do for module when {
+ *
+ * Always decrement:
+ * end }
+ *
+ * Increment if these start a statement
+ * if unless until while -- do nothing if they're modifiers
+
+ * These end a block if there's no modifier, but don't bother
+ * break next redo retry return yield
+ *
+ * These temporarily de-indent, but re-indent
+ * case else elsif ensure rescue
+ *
+ * This means that the folder reflects indentation rather
+ * than setting it. The language-service updates indentation
+ * when users type return and finishes entering de-denters.
+ *
+ * Later offer to fold POD, here-docs, strings, and blocks of comments
+ */
+
+static void FoldRbDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+
+ synchronizeDocStart(startPos, length, initStyle, styler, // ref args
+ false);
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = startPos == 0 ? 0 : (styler.LevelAt(lineCurrent)
+ & SC_FOLDLEVELNUMBERMASK
+ & ~SC_FOLDLEVELBASE);
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int stylePrev = startPos <= 1 ? SCE_RB_DEFAULT : styler.StyleAt(startPos - 1);
+ bool buffer_ends_with_eol = false;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ /*Mutiline comment patch*/
+ if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) {
+ if (!IsCommentLine(lineCurrent - 1, styler)
+ && IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent++;
+ else if (IsCommentLine(lineCurrent - 1, styler)
+ && !IsCommentLine(lineCurrent + 1, styler))
+ levelCurrent--;
+ }
+
+ if (style == SCE_RB_COMMENTLINE) {
+ if (foldComment && stylePrev != SCE_RB_COMMENTLINE) {
+ if (chNext == '{') {
+ levelCurrent++;
+ } else if (chNext == '}' && levelCurrent > 0) {
+ levelCurrent--;
+ }
+ }
+ } else if (style == SCE_RB_OPERATOR) {
+ if (strchr("[{(", ch)) {
+ levelCurrent++;
+ } else if (strchr(")}]", ch)) {
+ // Don't decrement below 0
+ if (levelCurrent > 0)
+ levelCurrent--;
+ }
+ } else if (style == SCE_RB_WORD && styleNext != SCE_RB_WORD) {
+ // Look at the keyword on the left and decide what to do
+ char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero
+ prevWord[0] = 0;
+ getPrevWord(i, prevWord, styler, SCE_RB_WORD);
+ if (!strcmp(prevWord, "end")) {
+ // Don't decrement below 0
+ if (levelCurrent > 0)
+ levelCurrent--;
+ } else if (!strcmp(prevWord, "if")
+ || !strcmp(prevWord, "def")
+ || !strcmp(prevWord, "class")
+ || !strcmp(prevWord, "module")
+ || !strcmp(prevWord, "begin")
+ || !strcmp(prevWord, "case")
+ || !strcmp(prevWord, "do")
+ || !strcmp(prevWord, "while")
+ || !strcmp(prevWord, "unless")
+ || !strcmp(prevWord, "until")
+ || !strcmp(prevWord, "for")
+ ) {
+ levelCurrent++;
+ }
+ } else if (style == SCE_RB_HERE_DELIM) {
+ if (styler.SafeGetCharAt(i-2) == '<' && styler.SafeGetCharAt(i-1) == '<') {
+ levelCurrent++;
+ } else if (styleNext == SCE_RB_DEFAULT) {
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ styler.SetLevel(lineCurrent, lev|SC_FOLDLEVELBASE);
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ buffer_ends_with_eol = true;
+ } else if (!isspacechar(ch)) {
+ visibleChars++;
+ buffer_ends_with_eol = false;
+ }
+ stylePrev = style;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ if (!buffer_ends_with_eol) {
+ lineCurrent++;
+ int new_lev = levelCurrent;
+ if (visibleChars == 0 && foldCompact)
+ new_lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ new_lev |= SC_FOLDLEVELHEADERFLAG;
+ levelCurrent = new_lev;
+ }
+ styler.SetLevel(lineCurrent, levelCurrent|SC_FOLDLEVELBASE);
+}
+
+static const char *const rubyWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRust.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRust.cxx
new file mode 100644
index 00000000000..80ec014caca
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexRust.cxx
@@ -0,0 +1,816 @@
+/** @file LexRust.cxx
+ ** Lexer for Rust.
+ **
+ ** Copyright (c) 2013 by SiegeLord <slabode@aim.com>
+ ** Converted to lexer object and added further folding features/properties by "Udo Lechner" <dlchnr(at)gmx(dot)net>
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <map>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static const int NUM_RUST_KEYWORD_LISTS = 7;
+static const int MAX_RUST_IDENT_CHARS = 1023;
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_RUST_COMMENTBLOCK ||
+ style == SCE_RUST_COMMENTBLOCKDOC;
+}
+
+// Options used for LexerRust
+struct OptionsRust {
+ bool fold;
+ bool foldSyntaxBased;
+ bool foldComment;
+ bool foldCommentMultiline;
+ bool foldCommentExplicit;
+ std::string foldExplicitStart;
+ std::string foldExplicitEnd;
+ bool foldExplicitAnywhere;
+ bool foldCompact;
+ int foldAtElseInt;
+ bool foldAtElse;
+ OptionsRust() {
+ fold = false;
+ foldSyntaxBased = true;
+ foldComment = false;
+ foldCommentMultiline = true;
+ foldCommentExplicit = true;
+ foldExplicitStart = "";
+ foldExplicitEnd = "";
+ foldExplicitAnywhere = false;
+ foldCompact = true;
+ foldAtElseInt = -1;
+ foldAtElse = false;
+ }
+};
+
+static const char * const rustWordLists[NUM_RUST_KEYWORD_LISTS + 1] = {
+ "Primary keywords and identifiers",
+ "Built in types",
+ "Other keywords",
+ "Keywords 4",
+ "Keywords 5",
+ "Keywords 6",
+ "Keywords 7",
+ 0,
+ };
+
+struct OptionSetRust : public OptionSet<OptionsRust> {
+ OptionSetRust() {
+ DefineProperty("fold", &OptionsRust::fold);
+
+ DefineProperty("fold.comment", &OptionsRust::foldComment);
+
+ DefineProperty("fold.compact", &OptionsRust::foldCompact);
+
+ DefineProperty("fold.at.else", &OptionsRust::foldAtElse);
+
+ DefineProperty("fold.rust.syntax.based", &OptionsRust::foldSyntaxBased,
+ "Set this property to 0 to disable syntax based folding.");
+
+ DefineProperty("fold.rust.comment.multiline", &OptionsRust::foldCommentMultiline,
+ "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
+
+ DefineProperty("fold.rust.comment.explicit", &OptionsRust::foldCommentExplicit,
+ "Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
+
+ DefineProperty("fold.rust.explicit.start", &OptionsRust::foldExplicitStart,
+ "The string to use for explicit fold start points, replacing the standard //{.");
+
+ DefineProperty("fold.rust.explicit.end", &OptionsRust::foldExplicitEnd,
+ "The string to use for explicit fold end points, replacing the standard //}.");
+
+ DefineProperty("fold.rust.explicit.anywhere", &OptionsRust::foldExplicitAnywhere,
+ "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
+
+ DefineProperty("lexer.rust.fold.at.else", &OptionsRust::foldAtElseInt,
+ "This option enables Rust folding on a \"} else {\" line of an if statement.");
+
+ DefineWordListSets(rustWordLists);
+ }
+};
+
+class LexerRust : public ILexer {
+ WordList keywords[NUM_RUST_KEYWORD_LISTS];
+ OptionsRust options;
+ OptionSetRust osRust;
+public:
+ virtual ~LexerRust() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osRust.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osRust.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osRust.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osRust.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+ static ILexer *LexerFactoryRust() {
+ return new LexerRust();
+ }
+};
+
+int SCI_METHOD LexerRust::PropertySet(const char *key, const char *val) {
+ if (osRust.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerRust::WordListSet(int n, const char *wl) {
+ int firstModification = -1;
+ if (n < NUM_RUST_KEYWORD_LISTS) {
+ WordList *wordListN = &keywords[n];
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+static bool IsWhitespace(int c) {
+ return c == ' ' || c == '\t' || c == '\r' || c == '\n';
+}
+
+/* This isn't quite right for Unicode identifiers */
+static bool IsIdentifierStart(int ch) {
+ return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch);
+}
+
+/* This isn't quite right for Unicode identifiers */
+static bool IsIdentifierContinue(int ch) {
+ return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch);
+}
+
+static void ScanWhitespace(Accessor& styler, int& pos, int max) {
+ while (IsWhitespace(styler.SafeGetCharAt(pos, '\0')) && pos < max) {
+ if (pos == styler.LineEnd(styler.GetLine(pos)))
+ styler.SetLineState(styler.GetLine(pos), 0);
+ pos++;
+ }
+ styler.ColourTo(pos-1, SCE_RUST_DEFAULT);
+}
+
+static void GrabString(char* s, Accessor& styler, int start, int len) {
+ for (int ii = 0; ii < len; ii++)
+ s[ii] = styler[ii + start];
+ s[len] = '\0';
+}
+
+static void ScanIdentifier(Accessor& styler, int& pos, WordList *keywords) {
+ int start = pos;
+ while (IsIdentifierContinue(styler.SafeGetCharAt(pos, '\0')))
+ pos++;
+
+ if (styler.SafeGetCharAt(pos, '\0') == '!') {
+ pos++;
+ styler.ColourTo(pos - 1, SCE_RUST_MACRO);
+ } else {
+ char s[MAX_RUST_IDENT_CHARS + 1];
+ int len = pos - start;
+ len = len > MAX_RUST_IDENT_CHARS ? MAX_RUST_IDENT_CHARS : len;
+ GrabString(s, styler, start, len);
+ bool keyword = false;
+ for (int ii = 0; ii < NUM_RUST_KEYWORD_LISTS; ii++) {
+ if (keywords[ii].InList(s)) {
+ styler.ColourTo(pos - 1, SCE_RUST_WORD + ii);
+ keyword = true;
+ break;
+ }
+ }
+ if (!keyword) {
+ styler.ColourTo(pos - 1, SCE_RUST_IDENTIFIER);
+ }
+ }
+}
+
+/* Scans a sequence of digits, returning true if it found any. */
+static bool ScanDigits(Accessor& styler, int& pos, int base) {
+ int old_pos = pos;
+ for (;;) {
+ int c = styler.SafeGetCharAt(pos, '\0');
+ if (IsADigit(c, base) || c == '_')
+ pos++;
+ else
+ break;
+ }
+ return old_pos != pos;
+}
+
+/* Scans an integer and floating point literals. */
+static void ScanNumber(Accessor& styler, int& pos) {
+ int base = 10;
+ int c = styler.SafeGetCharAt(pos, '\0');
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ bool error = false;
+ /* Scan the prefix, thus determining the base.
+ * 10 is default if there's no prefix. */
+ if (c == '0' && n == 'x') {
+ pos += 2;
+ base = 16;
+ } else if (c == '0' && n == 'b') {
+ pos += 2;
+ base = 2;
+ } else if (c == '0' && n == 'o') {
+ pos += 2;
+ base = 8;
+ }
+
+ /* Scan initial digits. The literal is malformed if there are none. */
+ error |= !ScanDigits(styler, pos, base);
+ /* See if there's an integer suffix. We mimic the Rust's lexer
+ * and munch it even if there was an error above. */
+ c = styler.SafeGetCharAt(pos, '\0');
+ if (c == 'u' || c == 'i') {
+ pos++;
+ c = styler.SafeGetCharAt(pos, '\0');
+ n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (c == '8' || c == 's') {
+ pos++;
+ } else if (c == '1' && n == '6') {
+ pos += 2;
+ } else if (c == '3' && n == '2') {
+ pos += 2;
+ } else if (c == '6' && n == '4') {
+ pos += 2;
+ } else {
+ error = true;
+ }
+ /* See if it's a floating point literal. These literals have to be base 10.
+ */
+ } else if (!error) {
+ /* If there's a period, it's a floating point literal unless it's
+ * followed by an identifier (meaning this is a method call, e.g.
+ * `1.foo()`) or another period, in which case it's a range (e.g. 1..2)
+ */
+ n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (c == '.' && !(IsIdentifierStart(n) || n == '.')) {
+ error |= base != 10;
+ pos++;
+ /* It's ok to have no digits after the period. */
+ ScanDigits(styler, pos, 10);
+ }
+
+ /* Look for the exponentiation. */
+ c = styler.SafeGetCharAt(pos, '\0');
+ if (c == 'e' || c == 'E') {
+ error |= base != 10;
+ pos++;
+ c = styler.SafeGetCharAt(pos, '\0');
+ if (c == '-' || c == '+')
+ pos++;
+ /* It is invalid to have no digits in the exponent. */
+ error |= !ScanDigits(styler, pos, 10);
+ }
+
+ /* Scan the floating point suffix. */
+ c = styler.SafeGetCharAt(pos, '\0');
+ if (c == 'f') {
+ error |= base != 10;
+ pos++;
+ c = styler.SafeGetCharAt(pos, '\0');
+ n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (c == '3' && n == '2') {
+ pos += 2;
+ } else if (c == '6' && n == '4') {
+ pos += 2;
+ } else {
+ error = true;
+ }
+ }
+ }
+
+ if (error)
+ styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
+ else
+ styler.ColourTo(pos - 1, SCE_RUST_NUMBER);
+}
+
+static bool IsOneCharOperator(int c) {
+ return c == ';' || c == ',' || c == '(' || c == ')'
+ || c == '{' || c == '}' || c == '[' || c == ']'
+ || c == '@' || c == '#' || c == '~' || c == '+'
+ || c == '*' || c == '/' || c == '^' || c == '%'
+ || c == '.' || c == ':' || c == '!' || c == '<'
+ || c == '>' || c == '=' || c == '-' || c == '&'
+ || c == '|' || c == '$';
+}
+
+static bool IsTwoCharOperator(int c, int n) {
+ return (c == '.' && n == '.') || (c == ':' && n == ':')
+ || (c == '!' && n == '=') || (c == '<' && n == '<')
+ || (c == '<' && n == '=') || (c == '>' && n == '>')
+ || (c == '>' && n == '=') || (c == '=' && n == '=')
+ || (c == '=' && n == '>') || (c == '-' && n == '>')
+ || (c == '&' && n == '&') || (c == '|' && n == '|')
+ || (c == '-' && n == '=') || (c == '&' && n == '=')
+ || (c == '|' && n == '=') || (c == '+' && n == '=')
+ || (c == '*' && n == '=') || (c == '/' && n == '=')
+ || (c == '^' && n == '=') || (c == '%' && n == '=');
+}
+
+static bool IsThreeCharOperator(int c, int n, int n2) {
+ return (c == '<' && n == '<' && n2 == '=')
+ || (c == '>' && n == '>' && n2 == '=');
+}
+
+static bool IsValidCharacterEscape(int c) {
+ return c == 'n' || c == 'r' || c == 't' || c == '\\'
+ || c == '\'' || c == '"' || c == '0';
+}
+
+static bool IsValidStringEscape(int c) {
+ return IsValidCharacterEscape(c) || c == '\n' || c == '\r';
+}
+
+static bool ScanNumericEscape(Accessor &styler, int& pos, int num_digits, bool stop_asap) {
+ for (;;) {
+ int c = styler.SafeGetCharAt(pos, '\0');
+ if (!IsADigit(c, 16))
+ break;
+ num_digits--;
+ pos++;
+ if (num_digits == 0 && stop_asap)
+ return true;
+ }
+ if (num_digits == 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+/* This is overly permissive for character literals in order to accept UTF-8 encoded
+ * character literals. */
+static void ScanCharacterLiteralOrLifetime(Accessor &styler, int& pos, bool ascii_only) {
+ pos++;
+ int c = styler.SafeGetCharAt(pos, '\0');
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ bool done = false;
+ bool valid_lifetime = !ascii_only && IsIdentifierStart(c);
+ bool valid_char = true;
+ bool first = true;
+ while (!done) {
+ switch (c) {
+ case '\\':
+ done = true;
+ if (IsValidCharacterEscape(n)) {
+ pos += 2;
+ } else if (n == 'x') {
+ pos += 2;
+ valid_char = ScanNumericEscape(styler, pos, 2, false);
+ } else if (n == 'u' && !ascii_only) {
+ pos += 2;
+ valid_char = ScanNumericEscape(styler, pos, 4, false);
+ } else if (n == 'U' && !ascii_only) {
+ pos += 2;
+ valid_char = ScanNumericEscape(styler, pos, 8, false);
+ } else {
+ valid_char = false;
+ }
+ break;
+ case '\'':
+ valid_char = !first;
+ done = true;
+ break;
+ case '\t':
+ case '\n':
+ case '\r':
+ case '\0':
+ valid_char = false;
+ done = true;
+ break;
+ default:
+ if (ascii_only && !IsASCII((char)c)) {
+ done = true;
+ valid_char = false;
+ } else if (!IsIdentifierContinue(c) && !first) {
+ done = true;
+ } else {
+ pos++;
+ }
+ break;
+ }
+ c = styler.SafeGetCharAt(pos, '\0');
+ n = styler.SafeGetCharAt(pos + 1, '\0');
+
+ first = false;
+ }
+ if (styler.SafeGetCharAt(pos, '\0') == '\'') {
+ valid_lifetime = false;
+ } else {
+ valid_char = false;
+ }
+ if (valid_lifetime) {
+ styler.ColourTo(pos - 1, SCE_RUST_LIFETIME);
+ } else if (valid_char) {
+ pos++;
+ styler.ColourTo(pos - 1, ascii_only ? SCE_RUST_BYTECHARACTER : SCE_RUST_CHARACTER);
+ } else {
+ styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
+ }
+}
+
+enum CommentState {
+ UnknownComment,
+ DocComment,
+ NotDocComment
+};
+
+/*
+ * The rule for block-doc comments is as follows: /xxN and /x! (where x is an asterisk, N is a non-asterisk) start doc comments.
+ * Otherwise it's a regular comment.
+ */
+static void ResumeBlockComment(Accessor &styler, int& pos, int max, CommentState state, int level) {
+ int c = styler.SafeGetCharAt(pos, '\0');
+ bool maybe_doc_comment = false;
+ if (c == '*') {
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (n != '*' && n != '/') {
+ maybe_doc_comment = true;
+ }
+ } else if (c == '!') {
+ maybe_doc_comment = true;
+ }
+
+ for (;;) {
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (pos == styler.LineEnd(styler.GetLine(pos)))
+ styler.SetLineState(styler.GetLine(pos), level);
+ if (c == '*') {
+ pos++;
+ if (n == '/') {
+ pos++;
+ level--;
+ if (level == 0) {
+ styler.SetLineState(styler.GetLine(pos), 0);
+ if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
+ else
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK);
+ break;
+ }
+ }
+ } else if (c == '/') {
+ pos++;
+ if (n == '*') {
+ pos++;
+ level++;
+ }
+ }
+ else {
+ pos++;
+ }
+ if (pos >= max) {
+ if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
+ else
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK);
+ break;
+ }
+ c = styler.SafeGetCharAt(pos, '\0');
+ }
+}
+
+/*
+ * The rule for line-doc comments is as follows... ///N and //! (where N is a non slash) start doc comments.
+ * Otherwise it's a normal line comment.
+ */
+static void ResumeLineComment(Accessor &styler, int& pos, int max, CommentState state) {
+ bool maybe_doc_comment = false;
+ int c = styler.SafeGetCharAt(pos, '\0');
+ if (c == '/') {
+ if (pos < max) {
+ pos++;
+ c = styler.SafeGetCharAt(pos, '\0');
+ if (c != '/') {
+ maybe_doc_comment = true;
+ }
+ }
+ } else if (c == '!') {
+ maybe_doc_comment = true;
+ }
+
+ while (pos < max && c != '\n') {
+ if (pos == styler.LineEnd(styler.GetLine(pos)))
+ styler.SetLineState(styler.GetLine(pos), 0);
+ pos++;
+ c = styler.SafeGetCharAt(pos, '\0');
+ }
+
+ if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTLINEDOC);
+ else
+ styler.ColourTo(pos - 1, SCE_RUST_COMMENTLINE);
+}
+
+static void ScanComments(Accessor &styler, int& pos, int max) {
+ pos++;
+ int c = styler.SafeGetCharAt(pos, '\0');
+ pos++;
+ if (c == '/')
+ ResumeLineComment(styler, pos, max, UnknownComment);
+ else if (c == '*')
+ ResumeBlockComment(styler, pos, max, UnknownComment, 1);
+}
+
+static void ResumeString(Accessor &styler, int& pos, int max, bool ascii_only) {
+ int c = styler.SafeGetCharAt(pos, '\0');
+ bool error = false;
+ while (c != '"' && !error) {
+ if (pos >= max) {
+ error = true;
+ break;
+ }
+ if (pos == styler.LineEnd(styler.GetLine(pos)))
+ styler.SetLineState(styler.GetLine(pos), 0);
+ if (c == '\\') {
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ if (IsValidStringEscape(n)) {
+ pos += 2;
+ } else if (n == 'x') {
+ pos += 2;
+ error = !ScanNumericEscape(styler, pos, 2, true);
+ } else if (n == 'u' && !ascii_only) {
+ pos += 2;
+ error = !ScanNumericEscape(styler, pos, 4, true);
+ } else if (n == 'U' && !ascii_only) {
+ pos += 2;
+ error = !ScanNumericEscape(styler, pos, 8, true);
+ } else {
+ pos += 1;
+ error = true;
+ }
+ } else {
+ if (ascii_only && !IsASCII((char)c))
+ error = true;
+ else
+ pos++;
+ }
+ c = styler.SafeGetCharAt(pos, '\0');
+ }
+ if (!error)
+ pos++;
+ styler.ColourTo(pos - 1, ascii_only ? SCE_RUST_BYTESTRING : SCE_RUST_STRING);
+}
+
+static void ResumeRawString(Accessor &styler, int& pos, int max, int num_hashes, bool ascii_only) {
+ for (;;) {
+ if (pos == styler.LineEnd(styler.GetLine(pos)))
+ styler.SetLineState(styler.GetLine(pos), num_hashes);
+
+ int c = styler.SafeGetCharAt(pos, '\0');
+ if (c == '"') {
+ pos++;
+ int trailing_num_hashes = 0;
+ while (styler.SafeGetCharAt(pos, '\0') == '#' && trailing_num_hashes < num_hashes) {
+ trailing_num_hashes++;
+ pos++;
+ }
+ if (trailing_num_hashes == num_hashes) {
+ styler.SetLineState(styler.GetLine(pos), 0);
+ break;
+ }
+ } else if (pos >= max) {
+ break;
+ } else {
+ if (ascii_only && !IsASCII((char)c))
+ break;
+ pos++;
+ }
+ }
+ styler.ColourTo(pos - 1, ascii_only ? SCE_RUST_BYTESTRINGR : SCE_RUST_STRINGR);
+}
+
+static void ScanRawString(Accessor &styler, int& pos, int max, bool ascii_only) {
+ pos++;
+ int num_hashes = 0;
+ while (styler.SafeGetCharAt(pos, '\0') == '#') {
+ num_hashes++;
+ pos++;
+ }
+ if (styler.SafeGetCharAt(pos, '\0') != '"') {
+ styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
+ } else {
+ pos++;
+ ResumeRawString(styler, pos, max, num_hashes, ascii_only);
+ }
+}
+
+void SCI_METHOD LexerRust::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ PropSetSimple props;
+ Accessor styler(pAccess, &props);
+ int pos = startPos;
+ int max = pos + length;
+
+ styler.StartAt(pos);
+ styler.StartSegment(pos);
+
+ if (initStyle == SCE_RUST_COMMENTBLOCK || initStyle == SCE_RUST_COMMENTBLOCKDOC) {
+ ResumeBlockComment(styler, pos, max, initStyle == SCE_RUST_COMMENTBLOCKDOC ? DocComment : NotDocComment, styler.GetLineState(styler.GetLine(pos) - 1));
+ } else if (initStyle == SCE_RUST_COMMENTLINE || initStyle == SCE_RUST_COMMENTLINEDOC) {
+ ResumeLineComment(styler, pos, max, initStyle == SCE_RUST_COMMENTLINEDOC ? DocComment : NotDocComment);
+ } else if (initStyle == SCE_RUST_STRING) {
+ ResumeString(styler, pos, max, false);
+ } else if (initStyle == SCE_RUST_BYTESTRING) {
+ ResumeString(styler, pos, max, true);
+ } else if (initStyle == SCE_RUST_STRINGR) {
+ ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), false);
+ } else if (initStyle == SCE_RUST_BYTESTRINGR) {
+ ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), true);
+ }
+
+ while (pos < max) {
+ int c = styler.SafeGetCharAt(pos, '\0');
+ int n = styler.SafeGetCharAt(pos + 1, '\0');
+ int n2 = styler.SafeGetCharAt(pos + 2, '\0');
+
+ if (pos == 0 && c == '#' && n == '!' && n2 != '[') {
+ pos += 2;
+ ResumeLineComment(styler, pos, max, NotDocComment);
+ } else if (IsWhitespace(c)) {
+ ScanWhitespace(styler, pos, max);
+ } else if (c == '/' && (n == '/' || n == '*')) {
+ ScanComments(styler, pos, max);
+ } else if (c == 'r' && (n == '#' || n == '"')) {
+ ScanRawString(styler, pos, max, false);
+ } else if (c == 'b' && n == 'r' && (n2 == '#' || n2 == '"')) {
+ pos++;
+ ScanRawString(styler, pos, max, true);
+ } else if (c == 'b' && n == '"') {
+ pos += 2;
+ ResumeString(styler, pos, max, true);
+ } else if (c == 'b' && n == '\'') {
+ pos++;
+ ScanCharacterLiteralOrLifetime(styler, pos, true);
+ } else if (IsIdentifierStart(c)) {
+ ScanIdentifier(styler, pos, keywords);
+ } else if (IsADigit(c)) {
+ ScanNumber(styler, pos);
+ } else if (IsThreeCharOperator(c, n, n2)) {
+ pos += 3;
+ styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
+ } else if (IsTwoCharOperator(c, n)) {
+ pos += 2;
+ styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
+ } else if (IsOneCharOperator(c)) {
+ pos++;
+ styler.ColourTo(pos - 1, SCE_RUST_OPERATOR);
+ } else if (c == '\'') {
+ ScanCharacterLiteralOrLifetime(styler, pos, false);
+ } else if (c == '"') {
+ pos++;
+ ResumeString(styler, pos, max, false);
+ } else {
+ pos++;
+ styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
+ }
+ }
+ styler.ColourTo(pos - 1, SCE_RUST_DEFAULT);
+ styler.Flush();
+}
+
+void SCI_METHOD LexerRust::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+
+ if (!options.fold)
+ return;
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ bool inLineComment = false;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ unsigned int lineStartNext = styler.LineStart(lineCurrent+1);
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = i == (lineStartNext-1);
+ if ((style == SCE_RUST_COMMENTLINE) || (style == SCE_RUST_COMMENTLINEDOC))
+ inLineComment = true;
+ if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldComment && options.foldCommentExplicit && ((style == SCE_RUST_COMMENTLINE) || options.foldExplicitAnywhere)) {
+ if (userDefinedFoldMarkers) {
+ if (styler.Match(i, options.foldExplicitStart.c_str())) {
+ levelNext++;
+ } else if (styler.Match(i, options.foldExplicitEnd.c_str())) {
+ levelNext--;
+ }
+ } else {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ }
+ if (options.foldSyntaxBased && (style == SCE_RUST_OPERATOR)) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ if (options.foldSyntaxBased && options.foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ lineStartNext = styler.LineStart(lineCurrent+1);
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
+ visibleChars = 0;
+ inLineComment = false;
+ }
+ }
+}
+
+LexerModule lmRust(SCLEX_RUST, LexerRust::LexerFactoryRust, "rust", rustWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSML.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSML.cxx
new file mode 100644
index 00000000000..6ab902dc5d3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSML.cxx
@@ -0,0 +1,223 @@
+// Scintilla source code edit control
+/** @file LexSML.cxx
+ ** Lexer for SML.
+ **/
+// Copyright 2009 by James Moffatt and Yuzhou Xin
+// Modified from LexCaml.cxx by Robert Roessler <robertr@rftp.com> Copyright 2005
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+inline int issml(int c) {return isalnum(c) || c == '_';}
+inline int issmlf(int c) {return isalpha(c) || c == '_';}
+inline int issmld(int c) {return isdigit(c) || c == '_';}
+
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+void ColouriseSMLDoc(
+ unsigned int startPos, int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+ int nesting = 0;
+ if (sc.state < SCE_SML_STRING)
+ sc.state = SCE_SML_DEFAULT;
+ if (sc.state >= SCE_SML_COMMENT)
+ nesting = (sc.state & 0x0f) - SCE_SML_COMMENT;
+
+ int chBase = 0, chToken = 0, chLit = 0;
+ WordList& keywords = *keywordlists[0];
+ WordList& keywords2 = *keywordlists[1];
+ WordList& keywords3 = *keywordlists[2];
+ const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0);
+
+ while (sc.More()) {
+ int state2 = -1;
+ int chColor = sc.currentPos - 1;
+ bool advance = true;
+
+ switch (sc.state & 0x0f) {
+ case SCE_SML_DEFAULT:
+ chToken = sc.currentPos;
+ if (issmlf(sc.ch))
+ state2 = SCE_SML_IDENTIFIER;
+ else if (sc.Match('`') && issmlf(sc.chNext))
+ state2 = SCE_SML_TAGNAME;
+ else if (sc.Match('#')&&isdigit(sc.chNext))
+ state2 = SCE_SML_LINENUM;
+ else if (sc.Match('#','\"')){
+ state2 = SCE_SML_CHAR,chLit = 0;
+ sc.Forward();
+
+ }
+ else if (isdigit(sc.ch)) {
+ state2 = SCE_SML_NUMBER, chBase = 10;
+ if (sc.Match('0') && strchr("xX", sc.chNext))
+ chBase = 16, sc.Forward();}
+ else if (sc.Match('\"')&&sc.chPrev!='#')
+ state2 = SCE_SML_STRING;
+ else if (sc.Match('(', '*')){
+ state2 = SCE_SML_COMMENT,
+ sc.ch = ' ',
+ sc.Forward();}
+ else if (strchr("!~"
+ "=<>@^+-*/"
+ "()[];,:.#", sc.ch))
+ state2 = SCE_SML_OPERATOR;
+ break;
+
+ case SCE_SML_IDENTIFIER:
+ if (!(issml(sc.ch) || sc.Match('\''))) {
+ const int n = sc.currentPos - chToken;
+ if (n < 24) {
+ char t[24];
+ for (int i = -n; i < 0; i++)
+ t[n + i] = static_cast<char>(sc.GetRelative(i));
+ t[n] = '\0';
+ if ((n == 1 && sc.chPrev == '_') || keywords.InList(t))
+ sc.ChangeState(SCE_SML_KEYWORD);
+ else if (keywords2.InList(t))
+ sc.ChangeState(SCE_SML_KEYWORD2);
+ else if (keywords3.InList(t))
+ sc.ChangeState(SCE_SML_KEYWORD3);
+ }
+ state2 = SCE_SML_DEFAULT, advance = false;
+ }
+ break;
+
+ case SCE_SML_TAGNAME:
+ if (!(issml(sc.ch) || sc.Match('\'')))
+ state2 = SCE_SML_DEFAULT, advance = false;
+ break;
+
+ case SCE_SML_LINENUM:
+ if (!isdigit(sc.ch))
+ state2 = SCE_SML_DEFAULT, advance = false;
+ break;
+
+ case SCE_SML_OPERATOR: {
+ const char* o = 0;
+ if (issml(sc.ch) || isspace(sc.ch)
+ || (o = strchr(")]};,\'\"`#", sc.ch),o)
+ || !strchr("!$%&*+-./:<=>?@^|~", sc.ch)) {
+ if (o && strchr(")]};,", sc.ch)) {
+ if ((sc.Match(')') && sc.chPrev == '(')
+ || (sc.Match(']') && sc.chPrev == '['))
+ sc.ChangeState(SCE_SML_KEYWORD);
+ chColor++;
+ } else
+ advance = false;
+ state2 = SCE_SML_DEFAULT;
+ }
+ break;
+ }
+
+ case SCE_SML_NUMBER:
+ if (issmld(sc.ch) || IsADigit(sc.ch, chBase))
+ break;
+ if ((sc.Match('l') || sc.Match('L') || sc.Match('n'))
+ && (issmld(sc.chPrev) || IsADigit(sc.chPrev, chBase)))
+ break;
+ if (chBase == 10) {
+ if (sc.Match('.') && issmld(sc.chPrev))
+ break;
+ if ((sc.Match('e') || sc.Match('E'))
+ && (issmld(sc.chPrev) || sc.chPrev == '.'))
+ break;
+ if ((sc.Match('+') || sc.Match('-'))
+ && (sc.chPrev == 'e' || sc.chPrev == 'E'))
+ break;
+ }
+ state2 = SCE_SML_DEFAULT, advance = false;
+ break;
+
+ case SCE_SML_CHAR:
+ if (sc.Match('\\')) {
+ chLit = 1;
+ if (sc.chPrev == '\\')
+ sc.ch = ' ';
+ } else if ((sc.Match('\"') && sc.chPrev != '\\') || sc.atLineEnd) {
+ state2 = SCE_SML_DEFAULT;
+ chLit = 1;
+ if (sc.Match('\"'))
+ chColor++;
+ else
+ sc.ChangeState(SCE_SML_IDENTIFIER);
+ } else if (chLit < 1 && sc.currentPos - chToken >= 3)
+ sc.ChangeState(SCE_SML_IDENTIFIER), advance = false;
+ break;
+
+ case SCE_SML_STRING:
+ if (sc.Match('\\') && sc.chPrev == '\\')
+ sc.ch = ' ';
+ else if (sc.Match('\"') && sc.chPrev != '\\')
+ state2 = SCE_SML_DEFAULT, chColor++;
+ break;
+
+ case SCE_SML_COMMENT:
+ case SCE_SML_COMMENT1:
+ case SCE_SML_COMMENT2:
+ case SCE_SML_COMMENT3:
+ if (sc.Match('(', '*'))
+ state2 = sc.state + 1, chToken = sc.currentPos,
+ sc.ch = ' ',
+ sc.Forward(), nesting++;
+ else if (sc.Match(')') && sc.chPrev == '*') {
+ if (nesting)
+ state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--;
+ else
+ state2 = SCE_SML_DEFAULT;
+ chColor++;
+ } else if (useMagic && sc.currentPos - chToken == 4
+ && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@')
+ sc.state |= 0x10;
+ break;
+ }
+
+ if (state2 >= 0)
+ styler.ColourTo(chColor, sc.state), sc.ChangeState(state2);
+ if (advance)
+ sc.Forward();
+ }
+
+ sc.Complete();
+}
+
+void FoldSMLDoc(
+ unsigned int, int,
+ int,
+ WordList *[],
+ Accessor &)
+{
+}
+
+static const char * const SMLWordListDesc[] = {
+ "Keywords",
+ "Keywords2",
+ "Keywords3",
+ 0
+};
+
+LexerModule lmSML(SCLEX_SML, ColouriseSMLDoc, "SML", FoldSMLDoc, SMLWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSQL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSQL.cxx
new file mode 100644
index 00000000000..176c92c320b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSQL.cxx
@@ -0,0 +1,968 @@
+//-*- coding: utf-8 -*-
+// Scintilla source code edit control
+/** @file LexSQL.cxx
+ ** Lexer for SQL, including PL/SQL and SQL*Plus.
+ ** Improved by Jérôme LAFORGE <jerome.laforge_AT_gmail_DOT_com> from 2010 to 2012.
+ **/
+// Copyright 1998-2012 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+#include "SparseState.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(int ch, bool sqlAllowDottedWord) {
+ if (!sqlAllowDottedWord)
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+ else
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return (ch < 0x80) && (isalpha(ch) || ch == '_');
+}
+
+static inline bool IsADoxygenChar(int ch) {
+ return (islower(ch) || ch == '$' || ch == '@' ||
+ ch == '\\' || ch == '&' || ch == '<' ||
+ ch == '>' || ch == '#' || ch == '{' ||
+ ch == '}' || ch == '[' || ch == ']');
+}
+
+static inline bool IsANumberChar(int ch, int chPrev) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || toupper(ch) == 'E' ||
+ ch == '.' || ((ch == '-' || ch == '+') && chPrev < 0x80 && toupper(chPrev) == 'E'));
+}
+
+typedef unsigned int sql_state_t;
+
+class SQLStates {
+public :
+ void Set(int lineNumber, unsigned short int sqlStatesLine) {
+ sqlStatement.Set(lineNumber, sqlStatesLine);
+ }
+
+ sql_state_t IgnoreWhen (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_IGNORE_WHEN;
+ else
+ sqlStatesLine &= ~MASK_IGNORE_WHEN;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoCondition (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_CONDITION;
+ else
+ sqlStatesLine &= ~MASK_INTO_CONDITION;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoExceptionBlock (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_EXCEPTION;
+ else
+ sqlStatesLine &= ~MASK_INTO_EXCEPTION;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoDeclareBlock (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_DECLARE;
+ else
+ sqlStatesLine &= ~MASK_INTO_DECLARE;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoMergeStatement (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_MERGE_STATEMENT;
+ else
+ sqlStatesLine &= ~MASK_MERGE_STATEMENT;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t CaseMergeWithoutWhenFound (sql_state_t sqlStatesLine, bool found) {
+ if (found)
+ sqlStatesLine |= MASK_CASE_MERGE_WITHOUT_WHEN_FOUND;
+ else
+ sqlStatesLine &= ~MASK_CASE_MERGE_WITHOUT_WHEN_FOUND;
+
+ return sqlStatesLine;
+ }
+ sql_state_t IntoSelectStatementOrAssignment (sql_state_t sqlStatesLine, bool found) {
+ if (found)
+ sqlStatesLine |= MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT;
+ else
+ sqlStatesLine &= ~MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT;
+ return sqlStatesLine;
+ }
+
+ sql_state_t BeginCaseBlock (sql_state_t sqlStatesLine) {
+ if ((sqlStatesLine & MASK_NESTED_CASES) < MASK_NESTED_CASES) {
+ sqlStatesLine++;
+ }
+ return sqlStatesLine;
+ }
+
+ sql_state_t EndCaseBlock (sql_state_t sqlStatesLine) {
+ if ((sqlStatesLine & MASK_NESTED_CASES) > 0) {
+ sqlStatesLine--;
+ }
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoCreateStatement (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_CREATE;
+ else
+ sqlStatesLine &= ~MASK_INTO_CREATE;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoCreateViewStatement (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_CREATE_VIEW;
+ else
+ sqlStatesLine &= ~MASK_INTO_CREATE_VIEW;
+
+ return sqlStatesLine;
+ }
+
+ sql_state_t IntoCreateViewAsStatement (sql_state_t sqlStatesLine, bool enable) {
+ if (enable)
+ sqlStatesLine |= MASK_INTO_CREATE_VIEW_AS_STATEMENT;
+ else
+ sqlStatesLine &= ~MASK_INTO_CREATE_VIEW_AS_STATEMENT;
+
+ return sqlStatesLine;
+ }
+
+ bool IsIgnoreWhen (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_IGNORE_WHEN) != 0;
+ }
+
+ bool IsIntoCondition (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_CONDITION) != 0;
+ }
+
+ bool IsIntoCaseBlock (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_NESTED_CASES) != 0;
+ }
+
+ bool IsIntoExceptionBlock (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_EXCEPTION) != 0;
+ }
+ bool IsIntoSelectStatementOrAssignment (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT) != 0;
+ }
+ bool IsCaseMergeWithoutWhenFound (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_CASE_MERGE_WITHOUT_WHEN_FOUND) != 0;
+ }
+
+ bool IsIntoDeclareBlock (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_DECLARE) != 0;
+ }
+
+ bool IsIntoMergeStatement (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_MERGE_STATEMENT) != 0;
+ }
+
+ bool IsIntoCreateStatement (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_CREATE) != 0;
+ }
+
+ bool IsIntoCreateViewStatement (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_CREATE_VIEW) != 0;
+ }
+
+ bool IsIntoCreateViewAsStatement (sql_state_t sqlStatesLine) {
+ return (sqlStatesLine & MASK_INTO_CREATE_VIEW_AS_STATEMENT) != 0;
+ }
+
+ sql_state_t ForLine(int lineNumber) {
+ return sqlStatement.ValueAt(lineNumber);
+ }
+
+ SQLStates() {}
+
+private :
+ SparseState <sql_state_t> sqlStatement;
+ enum {
+ MASK_NESTED_CASES = 0x0001FF,
+ MASK_INTO_SELECT_STATEMENT_OR_ASSIGNEMENT = 0x000200,
+ MASK_CASE_MERGE_WITHOUT_WHEN_FOUND = 0x000400,
+ MASK_MERGE_STATEMENT = 0x000800,
+ MASK_INTO_DECLARE = 0x001000,
+ MASK_INTO_EXCEPTION = 0x002000,
+ MASK_INTO_CONDITION = 0x004000,
+ MASK_IGNORE_WHEN = 0x008000,
+ MASK_INTO_CREATE = 0x010000,
+ MASK_INTO_CREATE_VIEW = 0x020000,
+ MASK_INTO_CREATE_VIEW_AS_STATEMENT = 0x040000
+ };
+};
+
+// Options used for LexerSQL
+struct OptionsSQL {
+ bool fold;
+ bool foldAtElse;
+ bool foldComment;
+ bool foldCompact;
+ bool foldOnlyBegin;
+ bool sqlBackticksIdentifier;
+ bool sqlNumbersignComment;
+ bool sqlBackslashEscapes;
+ bool sqlAllowDottedWord;
+ OptionsSQL() {
+ fold = false;
+ foldAtElse = false;
+ foldComment = false;
+ foldCompact = false;
+ foldOnlyBegin = false;
+ sqlBackticksIdentifier = false;
+ sqlNumbersignComment = false;
+ sqlBackslashEscapes = false;
+ sqlAllowDottedWord = false;
+ }
+};
+
+static const char * const sqlWordListDesc[] = {
+ "Keywords",
+ "Database Objects",
+ "PLDoc",
+ "SQL*Plus",
+ "User Keywords 1",
+ "User Keywords 2",
+ "User Keywords 3",
+ "User Keywords 4",
+ 0
+};
+
+struct OptionSetSQL : public OptionSet<OptionsSQL> {
+ OptionSetSQL() {
+ DefineProperty("fold", &OptionsSQL::fold);
+
+ DefineProperty("fold.sql.at.else", &OptionsSQL::foldAtElse,
+ "This option enables SQL folding on a \"ELSE\" and \"ELSIF\" line of an IF statement.");
+
+ DefineProperty("fold.comment", &OptionsSQL::foldComment);
+
+ DefineProperty("fold.compact", &OptionsSQL::foldCompact);
+
+ DefineProperty("fold.sql.only.begin", &OptionsSQL::foldOnlyBegin);
+
+ DefineProperty("lexer.sql.backticks.identifier", &OptionsSQL::sqlBackticksIdentifier);
+
+ DefineProperty("lexer.sql.numbersign.comment", &OptionsSQL::sqlNumbersignComment,
+ "If \"lexer.sql.numbersign.comment\" property is set to 0 a line beginning with '#' will not be a comment.");
+
+ DefineProperty("sql.backslash.escapes", &OptionsSQL::sqlBackslashEscapes,
+ "Enables backslash as an escape character in SQL.");
+
+ DefineProperty("lexer.sql.allow.dotted.word", &OptionsSQL::sqlAllowDottedWord,
+ "Set to 1 to colourise recognized words with dots "
+ "(recommended for Oracle PL/SQL objects).");
+
+ DefineWordListSets(sqlWordListDesc);
+ }
+};
+
+class LexerSQL : public ILexer {
+public :
+ LexerSQL() {}
+
+ virtual ~LexerSQL() {}
+
+ int SCI_METHOD Version () const {
+ return lvOriginal;
+ }
+
+ void SCI_METHOD Release() {
+ delete this;
+ }
+
+ const char * SCI_METHOD PropertyNames() {
+ return osSQL.PropertyNames();
+ }
+
+ int SCI_METHOD PropertyType(const char *name) {
+ return osSQL.PropertyType(name);
+ }
+
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osSQL.DescribeProperty(name);
+ }
+
+ int SCI_METHOD PropertySet(const char *key, const char *val) {
+ if (osSQL.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+ }
+
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osSQL.DescribeWordListSets();
+ }
+
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex (unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactorySQL() {
+ return new LexerSQL();
+ }
+private:
+ bool IsStreamCommentStyle(int style) {
+ return style == SCE_SQL_COMMENT ||
+ style == SCE_SQL_COMMENTDOC ||
+ style == SCE_SQL_COMMENTDOCKEYWORD ||
+ style == SCE_SQL_COMMENTDOCKEYWORDERROR;
+ }
+
+ bool IsCommentStyle (int style) {
+ switch (style) {
+ case SCE_SQL_COMMENT :
+ case SCE_SQL_COMMENTDOC :
+ case SCE_SQL_COMMENTLINE :
+ case SCE_SQL_COMMENTLINEDOC :
+ case SCE_SQL_COMMENTDOCKEYWORD :
+ case SCE_SQL_COMMENTDOCKEYWORDERROR :
+ return true;
+ default :
+ return false;
+ }
+ }
+
+ bool IsCommentLine (int line, LexAccessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i + 1 < eol_pos; i++) {
+ int style = styler.StyleAt(i);
+ // MySQL needs -- comments to be followed by space or control char
+ if (style == SCE_SQL_COMMENTLINE && styler.Match(i, "--"))
+ return true;
+ else if (!IsASpaceOrTab(styler[i]))
+ return false;
+ }
+ return false;
+ }
+
+ OptionsSQL options;
+ OptionSetSQL osSQL;
+ SQLStates sqlStates;
+
+ WordList keywords1;
+ WordList keywords2;
+ WordList kw_pldoc;
+ WordList kw_sqlplus;
+ WordList kw_user1;
+ WordList kw_user2;
+ WordList kw_user3;
+ WordList kw_user4;
+};
+
+int SCI_METHOD LexerSQL::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords1;
+ break;
+ case 1:
+ wordListN = &keywords2;
+ break;
+ case 2:
+ wordListN = &kw_pldoc;
+ break;
+ case 3:
+ wordListN = &kw_sqlplus;
+ break;
+ case 4:
+ wordListN = &kw_user1;
+ break;
+ case 5:
+ wordListN = &kw_user2;
+ break;
+ case 6:
+ wordListN = &kw_user3;
+ break;
+ case 7:
+ wordListN = &kw_user4;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+void SCI_METHOD LexerSQL::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+ StyleContext sc(startPos, length, initStyle, styler);
+ int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
+ int offset = 0;
+
+ for (; sc.More(); sc.Forward(), offset++) {
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_SQL_OPERATOR:
+ sc.SetState(SCE_SQL_DEFAULT);
+ break;
+ case SCE_SQL_NUMBER:
+ // We stop the number definition on non-numerical non-dot non-eE non-sign char
+ if (!IsANumberChar(sc.ch, sc.chPrev)) {
+ sc.SetState(SCE_SQL_DEFAULT);
+ }
+ break;
+ case SCE_SQL_IDENTIFIER:
+ if (!IsAWordChar(sc.ch, options.sqlAllowDottedWord)) {
+ int nextState = SCE_SQL_DEFAULT;
+ char s[1000];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (keywords1.InList(s)) {
+ sc.ChangeState(SCE_SQL_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_SQL_WORD2);
+ } else if (kw_sqlplus.InListAbbreviated(s, '~')) {
+ sc.ChangeState(SCE_SQL_SQLPLUS);
+ if (strncmp(s, "rem", 3) == 0) {
+ nextState = SCE_SQL_SQLPLUS_COMMENT;
+ } else if (strncmp(s, "pro", 3) == 0) {
+ nextState = SCE_SQL_SQLPLUS_PROMPT;
+ }
+ } else if (kw_user1.InList(s)) {
+ sc.ChangeState(SCE_SQL_USER1);
+ } else if (kw_user2.InList(s)) {
+ sc.ChangeState(SCE_SQL_USER2);
+ } else if (kw_user3.InList(s)) {
+ sc.ChangeState(SCE_SQL_USER3);
+ } else if (kw_user4.InList(s)) {
+ sc.ChangeState(SCE_SQL_USER4);
+ }
+ sc.SetState(nextState);
+ }
+ break;
+ case SCE_SQL_QUOTEDIDENTIFIER:
+ if (sc.ch == 0x60) {
+ if (sc.chNext == 0x60) {
+ sc.Forward(); // Ignore it
+ } else {
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_SQL_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ }
+ break;
+ case SCE_SQL_COMMENTDOC:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ } else if (sc.ch == '@' || sc.ch == '\\') { // Doxygen support
+ // Verify that we have the conditions to mark a comment-doc-keyword
+ if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
+ styleBeforeDCKeyword = SCE_SQL_COMMENTDOC;
+ sc.SetState(SCE_SQL_COMMENTDOCKEYWORD);
+ }
+ }
+ break;
+ case SCE_SQL_COMMENTLINE:
+ case SCE_SQL_COMMENTLINEDOC:
+ case SCE_SQL_SQLPLUS_COMMENT:
+ case SCE_SQL_SQLPLUS_PROMPT:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_SQL_DEFAULT);
+ }
+ break;
+ case SCE_SQL_COMMENTDOCKEYWORD:
+ if ((styleBeforeDCKeyword == SCE_SQL_COMMENTDOC) && sc.Match('*', '/')) {
+ sc.ChangeState(SCE_SQL_COMMENTDOCKEYWORDERROR);
+ sc.Forward();
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ } else if (!IsADoxygenChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (!isspace(sc.ch) || !kw_pldoc.InList(s + 1)) {
+ sc.ChangeState(SCE_SQL_COMMENTDOCKEYWORDERROR);
+ }
+ sc.SetState(styleBeforeDCKeyword);
+ }
+ break;
+ case SCE_SQL_CHARACTER:
+ if (options.sqlBackslashEscapes && sc.ch == '\\') {
+ sc.Forward();
+ } else if (sc.ch == '\'') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_SQL_STRING:
+ if (sc.ch == '\\') {
+ // Escape sequence
+ sc.Forward();
+ } else if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ }
+ }
+ break;
+ case SCE_SQL_QOPERATOR:
+ // Locate the unique Q operator character
+ sc.Complete();
+ char qOperator = 0x00;
+ for (int styleStartPos = sc.currentPos; styleStartPos > 0; --styleStartPos) {
+ if (styler.StyleAt(styleStartPos - 1) != SCE_SQL_QOPERATOR) {
+ qOperator = styler.SafeGetCharAt(styleStartPos + 2);
+ break;
+ }
+ }
+
+ char qComplement = 0x00;
+
+ if (qOperator == '<') {
+ qComplement = '>';
+ } else if (qOperator == '(') {
+ qComplement = ')';
+ } else if (qOperator == '{') {
+ qComplement = '}';
+ } else if (qOperator == '[') {
+ qComplement = ']';
+ } else {
+ qComplement = qOperator;
+ }
+
+ if (sc.Match(qComplement, '\'')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_SQL_DEFAULT);
+ }
+ break;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_SQL_DEFAULT) {
+ if (sc.Match('q', '\'') || sc.Match('Q', '\'')) {
+ sc.SetState(SCE_SQL_QOPERATOR);
+ sc.Forward();
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) ||
+ ((sc.ch == '-' || sc.ch == '+') && IsADigit(sc.chNext) && !IsADigit(sc.chPrev))) {
+ sc.SetState(SCE_SQL_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_SQL_IDENTIFIER);
+ } else if (sc.ch == 0x60 && options.sqlBackticksIdentifier) {
+ sc.SetState(SCE_SQL_QUOTEDIDENTIFIER);
+ } else if (sc.Match('/', '*')) {
+ if (sc.Match("/**") || sc.Match("/*!")) { // Support of Doxygen doc. style
+ sc.SetState(SCE_SQL_COMMENTDOC);
+ } else {
+ sc.SetState(SCE_SQL_COMMENT);
+ }
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('-', '-')) {
+ // MySQL requires a space or control char after --
+ // http://dev.mysql.com/doc/mysql/en/ansi-diff-comments.html
+ // Perhaps we should enforce that with proper property:
+ //~ } else if (sc.Match("-- ")) {
+ sc.SetState(SCE_SQL_COMMENTLINE);
+ } else if (sc.ch == '#' && options.sqlNumbersignComment) {
+ sc.SetState(SCE_SQL_COMMENTLINEDOC);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_SQL_CHARACTER);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_SQL_STRING);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_SQL_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+
+void SCI_METHOD LexerSQL::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ if (!options.fold)
+ return;
+ LexAccessor styler(pAccess);
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+
+ if (lineCurrent > 0) {
+ // Backtrack to previous line in case need to fix its fold status for folding block of single-line comments (i.e. '--').
+ int lastNLPos = -1;
+ // And keep going back until we find an operator ';' followed
+ // by white-space and/or comments. This will improve folding.
+ while (--startPos > 0) {
+ char ch = styler[startPos];
+ if (ch == '\n' || (ch == '\r' && styler[startPos + 1] != '\n')) {
+ lastNLPos = startPos;
+ } else if (ch == ';' &&
+ styler.StyleAt(startPos) == SCE_SQL_OPERATOR) {
+ bool isAllClear = true;
+ for (int tempPos = startPos + 1;
+ tempPos < lastNLPos;
+ ++tempPos) {
+ int tempStyle = styler.StyleAt(tempPos);
+ if (!IsCommentStyle(tempStyle)
+ && tempStyle != SCE_SQL_DEFAULT) {
+ isAllClear = false;
+ break;
+ }
+ }
+ if (isAllClear) {
+ startPos = lastNLPos + 1;
+ break;
+ }
+ }
+ }
+ lineCurrent = styler.GetLine(startPos);
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
+ }
+ // And because folding ends at ';', keep going until we find one
+ // Otherwise if create ... view ... as is split over multiple
+ // lines the folding won't always update immediately.
+ unsigned int docLength = styler.Length();
+ for (; endPos < docLength; ++endPos) {
+ if (styler.SafeGetCharAt(endPos) == ';') {
+ break;
+ }
+ }
+
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ bool endFound = false;
+ bool isUnfoldingIgnored = false;
+ // this statementFound flag avoids to fold when the statement is on only one line by ignoring ELSE or ELSIF
+ // eg. "IF condition1 THEN ... ELSIF condition2 THEN ... ELSE ... END IF;"
+ bool statementFound = false;
+ sql_state_t sqlStatesCurrentLine = 0;
+ if (!options.foldOnlyBegin) {
+ sqlStatesCurrentLine = sqlStates.ForLine(lineCurrent);
+ }
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (atEOL || (!IsCommentStyle(style) && ch == ';')) {
+ if (endFound) {
+ //Maybe this is the end of "EXCEPTION" BLOCK (eg. "BEGIN ... EXCEPTION ... END;")
+ sqlStatesCurrentLine = sqlStates.IntoExceptionBlock(sqlStatesCurrentLine, false);
+ }
+ // set endFound and isUnfoldingIgnored to false if EOL is reached or ';' is found
+ endFound = false;
+ isUnfoldingIgnored = false;
+ }
+ if ((!IsCommentStyle(style) && ch == ';')) {
+ if (sqlStates.IsIntoMergeStatement(sqlStatesCurrentLine)) {
+ // This is the end of "MERGE" statement.
+ if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
+ levelNext--;
+ sqlStatesCurrentLine = sqlStates.IntoMergeStatement(sqlStatesCurrentLine, false);
+ levelNext--;
+ }
+ if (sqlStates.IsIntoSelectStatementOrAssignment(sqlStatesCurrentLine))
+ sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, false);
+ if (sqlStates.IsIntoCreateStatement(sqlStatesCurrentLine)) {
+ if (sqlStates.IsIntoCreateViewStatement(sqlStatesCurrentLine)) {
+ if (sqlStates.IsIntoCreateViewAsStatement(sqlStatesCurrentLine)) {
+ levelNext--;
+ sqlStatesCurrentLine = sqlStates.IntoCreateViewAsStatement(sqlStatesCurrentLine, false);
+ }
+ sqlStatesCurrentLine = sqlStates.IntoCreateViewStatement(sqlStatesCurrentLine, false);
+ }
+ sqlStatesCurrentLine = sqlStates.IntoCreateStatement(sqlStatesCurrentLine, false);
+ }
+ }
+ if (ch == ':' && chNext == '=' && !IsCommentStyle(style))
+ sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, true);
+
+ if (options.foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldComment && (style == SCE_SQL_COMMENTLINE)) {
+ // MySQL needs -- comments to be followed by space or control char
+ if ((ch == '-') && (chNext == '-')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ char chNext3 = styler.SafeGetCharAt(i + 3);
+ if (chNext2 == '{' || chNext3 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}' || chNext3 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ // Fold block of single-line comments (i.e. '--').
+ if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler)) {
+ if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler))
+ levelNext++;
+ else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent + 1, styler))
+ levelNext--;
+ }
+ if (style == SCE_SQL_OPERATOR) {
+ if (ch == '(') {
+ if (levelCurrent > levelNext)
+ levelCurrent--;
+ levelNext++;
+ } else if (ch == ')') {
+ levelNext--;
+ } else if ((!options.foldOnlyBegin) && ch == ';') {
+ sqlStatesCurrentLine = sqlStates.IgnoreWhen(sqlStatesCurrentLine, false);
+ }
+ }
+ // If new keyword (cannot trigger on elseif or nullif, does less tests)
+ if (style == SCE_SQL_WORD && stylePrev != SCE_SQL_WORD) {
+ const int MAX_KW_LEN = 9; // Maximum length of folding keywords
+ char s[MAX_KW_LEN + 2];
+ unsigned int j = 0;
+ for (; j < MAX_KW_LEN + 1; j++) {
+ if (!iswordchar(styler[i + j])) {
+ break;
+ }
+ s[j] = static_cast<char>(tolower(styler[i + j]));
+ }
+ if (j == MAX_KW_LEN + 1) {
+ // Keyword too long, don't test it
+ s[0] = '\0';
+ } else {
+ s[j] = '\0';
+ }
+ if (!options.foldOnlyBegin &&
+ strcmp(s, "select") == 0) {
+ sqlStatesCurrentLine = sqlStates.IntoSelectStatementOrAssignment(sqlStatesCurrentLine, true);
+ } else if (strcmp(s, "if") == 0) {
+ if (endFound) {
+ endFound = false;
+ if (options.foldOnlyBegin && !isUnfoldingIgnored) {
+ // this end isn't for begin block, but for if block ("end if;")
+ // so ignore previous "end" by increment levelNext.
+ levelNext++;
+ }
+ } else {
+ if (!options.foldOnlyBegin)
+ sqlStatesCurrentLine = sqlStates.IntoCondition(sqlStatesCurrentLine, true);
+ if (levelCurrent > levelNext) {
+ // doesn't include this line into the folding block
+ // because doesn't hide IF (eg "END; IF")
+ levelCurrent = levelNext;
+ }
+ }
+ } else if (!options.foldOnlyBegin &&
+ strcmp(s, "then") == 0 &&
+ sqlStates.IsIntoCondition(sqlStatesCurrentLine)) {
+ sqlStatesCurrentLine = sqlStates.IntoCondition(sqlStatesCurrentLine, false);
+ if (!options.foldOnlyBegin) {
+ if (levelCurrent > levelNext) {
+ levelCurrent = levelNext;
+ }
+ if (!statementFound)
+ levelNext++;
+
+ statementFound = true;
+ } else if (levelCurrent > levelNext) {
+ // doesn't include this line into the folding block
+ // because doesn't hide LOOP or CASE (eg "END; LOOP" or "END; CASE")
+ levelCurrent = levelNext;
+ }
+ } else if (strcmp(s, "loop") == 0 ||
+ strcmp(s, "case") == 0) {
+ if (endFound) {
+ endFound = false;
+ if (options.foldOnlyBegin && !isUnfoldingIgnored) {
+ // this end isn't for begin block, but for loop block ("end loop;") or case block ("end case;")
+ // so ignore previous "end" by increment levelNext.
+ levelNext++;
+ }
+ if ((!options.foldOnlyBegin) && strcmp(s, "case") == 0) {
+ sqlStatesCurrentLine = sqlStates.EndCaseBlock(sqlStatesCurrentLine);
+ if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
+ levelNext--; //again for the "end case;" and block when
+ }
+ } else if (!options.foldOnlyBegin) {
+ if (strcmp(s, "case") == 0) {
+ sqlStatesCurrentLine = sqlStates.BeginCaseBlock(sqlStatesCurrentLine);
+ sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
+ }
+
+ if (levelCurrent > levelNext)
+ levelCurrent = levelNext;
+
+ if (!statementFound)
+ levelNext++;
+
+ statementFound = true;
+ } else if (levelCurrent > levelNext) {
+ // doesn't include this line into the folding block
+ // because doesn't hide LOOP or CASE (eg "END; LOOP" or "END; CASE")
+ levelCurrent = levelNext;
+ }
+ } else if ((!options.foldOnlyBegin) && (
+ // folding for ELSE and ELSIF block only if foldAtElse is set
+ // and IF or CASE aren't on only one line with ELSE or ELSIF (with flag statementFound)
+ options.foldAtElse && !statementFound) && strcmp(s, "elsif") == 0) {
+ sqlStatesCurrentLine = sqlStates.IntoCondition(sqlStatesCurrentLine, true);
+ levelCurrent--;
+ levelNext--;
+ } else if ((!options.foldOnlyBegin) && (
+ // folding for ELSE and ELSIF block only if foldAtElse is set
+ // and IF or CASE aren't on only one line with ELSE or ELSIF (with flag statementFound)
+ options.foldAtElse && !statementFound) && strcmp(s, "else") == 0) {
+ // prevent also ELSE is on the same line (eg. "ELSE ... END IF;")
+ statementFound = true;
+ if (sqlStates.IsIntoCaseBlock(sqlStatesCurrentLine) && sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine)) {
+ sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, false);
+ levelNext++;
+ } else {
+ // we are in same case "} ELSE {" in C language
+ levelCurrent--;
+ }
+ } else if (strcmp(s, "begin") == 0) {
+ levelNext++;
+ sqlStatesCurrentLine = sqlStates.IntoDeclareBlock(sqlStatesCurrentLine, false);
+ } else if ((strcmp(s, "end") == 0) ||
+ // SQL Anywhere permits IF ... ELSE ... ENDIF
+ // will only be active if "endif" appears in the
+ // keyword list.
+ (strcmp(s, "endif") == 0)) {
+ endFound = true;
+ levelNext--;
+ if (sqlStates.IsIntoSelectStatementOrAssignment(sqlStatesCurrentLine) && !sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine))
+ levelNext--;
+ if (levelNext < SC_FOLDLEVELBASE) {
+ levelNext = SC_FOLDLEVELBASE;
+ isUnfoldingIgnored = true;
+ }
+ } else if ((!options.foldOnlyBegin) &&
+ strcmp(s, "when") == 0 &&
+ !sqlStates.IsIgnoreWhen(sqlStatesCurrentLine) &&
+ !sqlStates.IsIntoExceptionBlock(sqlStatesCurrentLine) && (
+ sqlStates.IsIntoCaseBlock(sqlStatesCurrentLine) ||
+ sqlStates.IsIntoMergeStatement(sqlStatesCurrentLine)
+ )
+ ) {
+ sqlStatesCurrentLine = sqlStates.IntoCondition(sqlStatesCurrentLine, true);
+
+ // Don't foldind when CASE and WHEN are on the same line (with flag statementFound) (eg. "CASE selector WHEN expression1 THEN sequence_of_statements1;\n")
+ // and same way for MERGE statement.
+ if (!statementFound) {
+ if (!sqlStates.IsCaseMergeWithoutWhenFound(sqlStatesCurrentLine)) {
+ levelCurrent--;
+ levelNext--;
+ }
+ sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, false);
+ }
+ } else if ((!options.foldOnlyBegin) && strcmp(s, "exit") == 0) {
+ sqlStatesCurrentLine = sqlStates.IgnoreWhen(sqlStatesCurrentLine, true);
+ } else if ((!options.foldOnlyBegin) && !sqlStates.IsIntoDeclareBlock(sqlStatesCurrentLine) && strcmp(s, "exception") == 0) {
+ sqlStatesCurrentLine = sqlStates.IntoExceptionBlock(sqlStatesCurrentLine, true);
+ } else if ((!options.foldOnlyBegin) &&
+ (strcmp(s, "declare") == 0 ||
+ strcmp(s, "function") == 0 ||
+ strcmp(s, "procedure") == 0 ||
+ strcmp(s, "package") == 0)) {
+ sqlStatesCurrentLine = sqlStates.IntoDeclareBlock(sqlStatesCurrentLine, true);
+ } else if ((!options.foldOnlyBegin) &&
+ strcmp(s, "merge") == 0) {
+ sqlStatesCurrentLine = sqlStates.IntoMergeStatement(sqlStatesCurrentLine, true);
+ sqlStatesCurrentLine = sqlStates.CaseMergeWithoutWhenFound(sqlStatesCurrentLine, true);
+ levelNext++;
+ statementFound = true;
+ } else if ((!options.foldOnlyBegin) &&
+ strcmp(s, "create") == 0) {
+ sqlStatesCurrentLine = sqlStates.IntoCreateStatement(sqlStatesCurrentLine, true);
+ } else if ((!options.foldOnlyBegin) &&
+ strcmp(s, "view") == 0 &&
+ sqlStates.IsIntoCreateStatement(sqlStatesCurrentLine)) {
+ sqlStatesCurrentLine = sqlStates.IntoCreateViewStatement(sqlStatesCurrentLine, true);
+ } else if ((!options.foldOnlyBegin) &&
+ strcmp(s, "as") == 0 &&
+ sqlStates.IsIntoCreateViewStatement(sqlStatesCurrentLine) &&
+ ! sqlStates.IsIntoCreateViewAsStatement(sqlStatesCurrentLine)) {
+ sqlStatesCurrentLine = sqlStates.IntoCreateViewAsStatement(sqlStatesCurrentLine, true);
+ levelNext++;
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ visibleChars = 0;
+ statementFound = false;
+ if (!options.foldOnlyBegin)
+ sqlStates.Set(lineCurrent, sqlStatesCurrentLine);
+ }
+ if (!isspacechar(ch)) {
+ visibleChars++;
+ }
+ }
+}
+
+LexerModule lmSQL(SCLEX_SQL, LexerSQL::LexerFactorySQL, "sql", sqlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSTTXT.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSTTXT.cxx
new file mode 100644
index 00000000000..e1d2d371fe8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSTTXT.cxx
@@ -0,0 +1,406 @@
+// Scintilla source code edit control
+/** @file LexSTTXT.cxx
+ ** Lexer for Structured Text language.
+ ** Written by Pavel Bulochkin
+ **/
+// The License.txt file describes the conditions under which this software may be distributed.
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ClassifySTTXTWord(WordList *keywordlists[], StyleContext &sc)
+{
+ char s[256] = { 0 };
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if ((*keywordlists[0]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_KEYWORD);
+ }
+
+ else if ((*keywordlists[1]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_TYPE);
+ }
+
+ else if ((*keywordlists[2]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_FUNCTION);
+ }
+
+ else if ((*keywordlists[3]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_FB);
+ }
+
+ else if ((*keywordlists[4]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_VARS);
+ }
+
+ else if ((*keywordlists[5]).InList(s)) {
+ sc.ChangeState(SCE_STTXT_PRAGMAS);
+ }
+
+ sc.SetState(SCE_STTXT_DEFAULT);
+}
+
+static void ColouriseSTTXTDoc (unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
+ CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
+ CharacterSet setNumber(CharacterSet::setDigits, "_.eE");
+ CharacterSet setHexNumber(CharacterSet::setDigits, "_abcdefABCDEF");
+ CharacterSet setOperator(CharacterSet::setNone,",.+-*/:;<=>[]()%&");
+ CharacterSet setDataTime(CharacterSet::setDigits,"_.-:dmshDMSH");
+
+ for ( ; sc.More() ; sc.Forward())
+ {
+ if(sc.atLineStart && sc.state != SCE_STTXT_COMMENT)
+ sc.SetState(SCE_STTXT_DEFAULT);
+
+ switch(sc.state)
+ {
+ case SCE_STTXT_NUMBER: {
+ if(!setNumber.Contains(sc.ch))
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_HEXNUMBER: {
+ if (setHexNumber.Contains(sc.ch))
+ continue;
+ else if(setDataTime.Contains(sc.ch))
+ sc.ChangeState(SCE_STTXT_DATETIME);
+ else if(setWord.Contains(sc.ch))
+ sc.ChangeState(SCE_STTXT_DEFAULT);
+ else
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_DATETIME: {
+ if (setDataTime.Contains(sc.ch))
+ continue;
+ else if(setWord.Contains(sc.ch))
+ sc.ChangeState(SCE_STTXT_DEFAULT);
+ else
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_OPERATOR: {
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_PRAGMA: {
+ if (sc.ch == '}')
+ sc.ForwardSetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_COMMENTLINE: {
+ if (sc.atLineStart)
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_COMMENT: {
+ if(sc.Match('*',')'))
+ {
+ sc.Forward();
+ sc.ForwardSetState(SCE_STTXT_DEFAULT);
+ }
+ break;
+ }
+ case SCE_STTXT_STRING1: {
+ if(sc.atLineEnd)
+ sc.SetState(SCE_STTXT_STRINGEOL);
+ else if(sc.ch == '\'' && sc.chPrev != '$')
+ sc.ForwardSetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_STRING2: {
+ if (sc.atLineEnd)
+ sc.SetState(SCE_STTXT_STRINGEOL);
+ else if(sc.ch == '\"' && sc.chPrev != '$')
+ sc.ForwardSetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_STRINGEOL: {
+ if(sc.atLineStart)
+ sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_CHARACTER: {
+ if(setHexNumber.Contains(sc.ch))
+ sc.SetState(SCE_STTXT_HEXNUMBER);
+ else if(setDataTime.Contains(sc.ch))
+ sc.SetState(SCE_STTXT_DATETIME);
+ else sc.SetState(SCE_STTXT_DEFAULT);
+ break;
+ }
+ case SCE_STTXT_IDENTIFIER: {
+ if(!setWord.Contains(sc.ch))
+ ClassifySTTXTWord(keywordlists, sc);
+ break;
+ }
+ }
+
+ if(sc.state == SCE_STTXT_DEFAULT)
+ {
+ if(IsADigit(sc.ch))
+ sc.SetState(SCE_STTXT_NUMBER);
+ else if (setWordStart.Contains(sc.ch))
+ sc.SetState(SCE_STTXT_IDENTIFIER);
+ else if (sc.Match('/', '/'))
+ sc.SetState(SCE_STTXT_COMMENTLINE);
+ else if(sc.Match('(', '*'))
+ sc.SetState(SCE_STTXT_COMMENT);
+ else if (sc.ch == '{')
+ sc.SetState(SCE_STTXT_PRAGMA);
+ else if (sc.ch == '\'')
+ sc.SetState(SCE_STTXT_STRING1);
+ else if (sc.ch == '\"')
+ sc.SetState(SCE_STTXT_STRING2);
+ else if(sc.ch == '#')
+ sc.SetState(SCE_STTXT_CHARACTER);
+ else if (setOperator.Contains(sc.ch))
+ sc.SetState(SCE_STTXT_OPERATOR);
+ }
+ }
+
+ if (sc.state == SCE_STTXT_IDENTIFIER && setWord.Contains(sc.chPrev))
+ ClassifySTTXTWord(keywordlists, sc);
+
+ sc.Complete();
+}
+
+static const char * const STTXTWordListDesc[] = {
+ "Keywords",
+ "Types",
+ "Functions",
+ "FB",
+ "Local_Var",
+ "Local_Pragma",
+ 0
+};
+
+static bool IsCommentLine(int line, Accessor &styler, bool type)
+{
+ int pos = styler.LineStart(line);
+ int eolPos = styler.LineStart(line + 1) - 1;
+
+ for (int i = pos; i < eolPos; i++)
+ {
+ char ch = styler[i];
+ char chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+
+ if(type) {
+ if (ch == '/' && chNext == '/' && style == SCE_STTXT_COMMENTLINE)
+ return true;
+ }
+ else if (ch == '(' && chNext == '*' && style == SCE_STTXT_COMMENT)
+ break;
+
+ if (!IsASpaceOrTab(ch))
+ return false;
+ }
+
+ for (int i = eolPos-2; i>pos; i--)
+ {
+ char ch = styler[i];
+ char chPrev = styler.SafeGetCharAt(i-1);
+ int style = styler.StyleAt(i);
+
+ if(ch == ')' && chPrev == '*' && style == SCE_STTXT_COMMENT)
+ return true;
+ if(!IsASpaceOrTab(ch))
+ return false;
+ }
+
+ return false;
+}
+
+static bool IsPragmaLine(int line, Accessor &styler)
+{
+ int pos = styler.LineStart(line);
+ int eolPos = styler.LineStart(line+1) - 1;
+
+ for (int i = pos ; i < eolPos ; i++)
+ {
+ char ch = styler[i];
+ int style = styler.StyleAt(i);
+
+ if(ch == '{' && style == SCE_STTXT_PRAGMA)
+ return true;
+ else if (!IsASpaceOrTab(ch))
+ return false;
+ }
+ return false;
+}
+
+static void GetRangeUpper(unsigned int start,unsigned int end,Accessor &styler,char *s,unsigned int len)
+{
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(toupper(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static void ClassifySTTXTWordFoldPoint(int &levelCurrent,unsigned int lastStart,
+ unsigned int currentPos, Accessor &styler)
+{
+ char s[256];
+ GetRangeUpper(lastStart, currentPos, styler, s, sizeof(s));
+
+ // See Table C.2 - Keywords
+ if (!strcmp(s, "ACTION") ||
+ !strcmp(s, "CASE") ||
+ !strcmp(s, "CONFIGURATION") ||
+ !strcmp(s, "FOR") ||
+ !strcmp(s, "FUNCTION") ||
+ !strcmp(s, "FUNCTION_BLOCK") ||
+ !strcmp(s, "IF") ||
+ !strcmp(s, "INITIAL_STEP") ||
+ !strcmp(s, "REPEAT") ||
+ !strcmp(s, "RESOURCE") ||
+ !strcmp(s, "STEP") ||
+ !strcmp(s, "STRUCT") ||
+ !strcmp(s, "TRANSITION") ||
+ !strcmp(s, "TYPE") ||
+ !strcmp(s, "VAR") ||
+ !strcmp(s, "VAR_INPUT") ||
+ !strcmp(s, "VAR_OUTPUT") ||
+ !strcmp(s, "VAR_IN_OUT") ||
+ !strcmp(s, "VAR_TEMP") ||
+ !strcmp(s, "VAR_EXTERNAL") ||
+ !strcmp(s, "VAR_ACCESS") ||
+ !strcmp(s, "VAR_CONFIG") ||
+ !strcmp(s, "VAR_GLOBAL") ||
+ !strcmp(s, "WHILE"))
+ {
+ levelCurrent++;
+ }
+ else if (!strcmp(s, "END_ACTION") ||
+ !strcmp(s, "END_CASE") ||
+ !strcmp(s, "END_CONFIGURATION") ||
+ !strcmp(s, "END_FOR") ||
+ !strcmp(s, "END_FUNCTION") ||
+ !strcmp(s, "END_FUNCTION_BLOCK") ||
+ !strcmp(s, "END_IF") ||
+ !strcmp(s, "END_REPEAT") ||
+ !strcmp(s, "END_RESOURCE") ||
+ !strcmp(s, "END_STEP") ||
+ !strcmp(s, "END_STRUCT") ||
+ !strcmp(s, "END_TRANSITION") ||
+ !strcmp(s, "END_TYPE") ||
+ !strcmp(s, "END_VAR") ||
+ !strcmp(s, "END_WHILE"))
+ {
+ levelCurrent--;
+ if (levelCurrent < SC_FOLDLEVELBASE) {
+ levelCurrent = SC_FOLDLEVELBASE;
+ }
+ }
+}
+
+static void FoldSTTXTDoc(unsigned int startPos, int length, int initStyle, WordList *[],Accessor &styler)
+{
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ int lastStart = 0;
+
+ CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
+
+ for (unsigned int i = startPos; i < endPos; i++)
+ {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (foldComment && style == SCE_STTXT_COMMENT) {
+ if(stylePrev != SCE_STTXT_COMMENT)
+ levelCurrent++;
+ else if(styleNext != SCE_STTXT_COMMENT && !atEOL)
+ levelCurrent--;
+ }
+ if ( foldComment && atEOL && ( IsCommentLine(lineCurrent, styler,false)
+ || IsCommentLine(lineCurrent,styler,true))) {
+ if(!IsCommentLine(lineCurrent-1, styler,true) && IsCommentLine(lineCurrent+1, styler,true))
+ levelCurrent++;
+ if (IsCommentLine(lineCurrent-1, styler,true) && !IsCommentLine(lineCurrent+1, styler,true))
+ levelCurrent--;
+ if (!IsCommentLine(lineCurrent-1, styler,false) && IsCommentLine(lineCurrent+1, styler,false))
+ levelCurrent++;
+ if (IsCommentLine(lineCurrent-1, styler,false) && !IsCommentLine(lineCurrent+1, styler,false))
+ levelCurrent--;
+ }
+ if(foldPreprocessor && atEOL && IsPragmaLine(lineCurrent, styler)) {
+ if(!IsPragmaLine(lineCurrent-1, styler) && IsPragmaLine(lineCurrent+1, styler ))
+ levelCurrent++;
+ else if(IsPragmaLine(lineCurrent-1, styler) && !IsPragmaLine(lineCurrent+1, styler))
+ levelCurrent--;
+ }
+ if (stylePrev != SCE_STTXT_KEYWORD && style == SCE_STTXT_KEYWORD) {
+ lastStart = i;
+ }
+ if(stylePrev == SCE_STTXT_KEYWORD) {
+ if(setWord.Contains(ch) && !setWord.Contains(chNext))
+ ClassifySTTXTWordFoldPoint(levelCurrent,lastStart, i, styler);
+ }
+ if (!IsASpace(ch)) {
+ visibleChars++;
+ }
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent))
+ styler.SetLevel(lineCurrent, lev);
+
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ // If we didn't reach the EOL in previous loop, store line level and whitespace information.
+ // The rest will be filled in later...
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ styler.SetLevel(lineCurrent, lev);
+ }
+}
+
+LexerModule lmSTTXT(SCLEX_STTXT, ColouriseSTTXTDoc, "fcST", FoldSTTXTDoc, STTXTWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexScriptol.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexScriptol.cxx
new file mode 100644
index 00000000000..40ef0de580c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexScriptol.cxx
@@ -0,0 +1,381 @@
+// Scintilla source code edit control
+/** @file LexScriptol.cxx
+ ** Lexer for Scriptol.
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ClassifyWordSol(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord)
+{
+ char s[100] = "";
+ bool wordIsNumber = isdigit(styler[start]) != 0;
+ for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
+ {
+ s[i] = styler[start + i];
+ s[i + 1] = '\0';
+ }
+ char chAttr = SCE_SCRIPTOL_IDENTIFIER;
+ if (0 == strcmp(prevWord, "class")) chAttr = SCE_SCRIPTOL_CLASSNAME;
+ else if (wordIsNumber) chAttr = SCE_SCRIPTOL_NUMBER;
+ else if (keywords.InList(s)) chAttr = SCE_SCRIPTOL_KEYWORD;
+ else for (unsigned int i = 0; i < end - start + 1; i++) // test dotted idents
+ {
+ if (styler[start + i] == '.')
+ {
+ styler.ColourTo(start + i - 1, chAttr);
+ styler.ColourTo(start + i, SCE_SCRIPTOL_OPERATOR);
+ }
+ }
+ styler.ColourTo(end, chAttr);
+ strcpy(prevWord, s);
+}
+
+static bool IsSolComment(Accessor &styler, int pos, int len)
+{
+ if(len > 0)
+ {
+ char c = styler[pos];
+ if(c == '`') return true;
+ if(len > 1)
+ {
+ if(c == '/')
+ {
+ c = styler[pos + 1];
+ if(c == '/') return true;
+ if(c == '*') return true;
+ }
+ }
+ }
+ return false;
+}
+
+static bool IsSolStringStart(char ch)
+{
+ if (ch == '\'' || ch == '"') return true;
+ return false;
+}
+
+static bool IsSolWordStart(char ch)
+{
+ return (iswordchar(ch) && !IsSolStringStart(ch));
+}
+
+
+static int GetSolStringState(Accessor &styler, int i, int *nextIndex)
+{
+ char ch = styler.SafeGetCharAt(i);
+ char chNext = styler.SafeGetCharAt(i + 1);
+
+ if (ch != '\"' && ch != '\'')
+ {
+ *nextIndex = i + 1;
+ return SCE_SCRIPTOL_DEFAULT;
+ }
+ // ch is either single or double quotes in string
+ // code below seem non-sense but is here for future extensions
+ if (ch == chNext && ch == styler.SafeGetCharAt(i + 2))
+ {
+ *nextIndex = i + 3;
+ if(ch == '\"') return SCE_SCRIPTOL_TRIPLE;
+ if(ch == '\'') return SCE_SCRIPTOL_TRIPLE;
+ return SCE_SCRIPTOL_STRING;
+ }
+ else
+ {
+ *nextIndex = i + 1;
+ if (ch == '"') return SCE_SCRIPTOL_STRING;
+ else return SCE_SCRIPTOL_STRING;
+ }
+}
+
+
+static void ColouriseSolDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler)
+ {
+
+ int lengthDoc = startPos + length;
+ char stringType = '\"';
+
+ if (startPos > 0)
+ {
+ int lineCurrent = styler.GetLine(startPos);
+ if (lineCurrent > 0)
+ {
+ startPos = styler.LineStart(lineCurrent-1);
+ if (startPos == 0) initStyle = SCE_SCRIPTOL_DEFAULT;
+ else initStyle = styler.StyleAt(startPos-1);
+ }
+ }
+
+ styler.StartAt(startPos);
+
+ WordList &keywords = *keywordlists[0];
+
+ char prevWord[200];
+ prevWord[0] = '\0';
+ if (length == 0) return;
+
+ int state = initStyle & 31;
+
+ int nextIndex = 0;
+ char chPrev = ' ';
+ char chPrev2 = ' ';
+ char chNext = styler[startPos];
+ styler.StartSegment(startPos);
+ for (int i = startPos; i < lengthDoc; i++)
+ {
+
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc))
+ {
+ if ((state == SCE_SCRIPTOL_DEFAULT) ||
+ (state == SCE_SCRIPTOL_TRIPLE) ||
+ (state == SCE_SCRIPTOL_COMMENTBLOCK))
+ {
+ styler.ColourTo(i, state);
+ }
+ }
+
+ if (styler.IsLeadByte(ch))
+ {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ chPrev2 = ' ';
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_SCRIPTOL_STRINGEOL)
+ {
+ if (ch != '\r' && ch != '\n')
+ {
+ styler.ColourTo(i - 1, state);
+ state = SCE_SCRIPTOL_DEFAULT;
+ }
+ }
+
+ if (state == SCE_SCRIPTOL_DEFAULT)
+ {
+ if (IsSolWordStart(ch))
+ {
+ styler.ColourTo(i - 1, state);
+ state = SCE_SCRIPTOL_KEYWORD;
+ }
+ else if (ch == '`')
+ {
+ styler.ColourTo(i - 1, state);
+ state = SCE_SCRIPTOL_COMMENTLINE;
+ }
+ else if (ch == '/')
+ {
+ styler.ColourTo(i - 1, state);
+ if(chNext == '/') state = SCE_SCRIPTOL_CSTYLE;
+ if(chNext == '*') state = SCE_SCRIPTOL_COMMENTBLOCK;
+ }
+
+ else if (IsSolStringStart(ch))
+ {
+ styler.ColourTo(i - 1, state);
+ state = GetSolStringState(styler, i, &nextIndex);
+ if(state == SCE_SCRIPTOL_STRING)
+ {
+ stringType = ch;
+ }
+ if (nextIndex != i + 1)
+ {
+ i = nextIndex - 1;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ }
+ else if (isoperator(ch))
+ {
+ styler.ColourTo(i - 1, state);
+ styler.ColourTo(i, SCE_SCRIPTOL_OPERATOR);
+ }
+ }
+ else if (state == SCE_SCRIPTOL_KEYWORD)
+ {
+ if (!iswordchar(ch))
+ {
+ ClassifyWordSol(styler.GetStartSegment(), i - 1, keywords, styler, prevWord);
+ state = SCE_SCRIPTOL_DEFAULT;
+ if (ch == '`')
+ {
+ state = chNext == '`' ? SCE_SCRIPTOL_PERSISTENT : SCE_SCRIPTOL_COMMENTLINE;
+ }
+ else if (IsSolStringStart(ch))
+ {
+ styler.ColourTo(i - 1, state);
+ state = GetSolStringState(styler, i, &nextIndex);
+ if (nextIndex != i + 1)
+ {
+ i = nextIndex - 1;
+ ch = ' ';
+ chPrev = ' ';
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ }
+ else if (isoperator(ch))
+ {
+ styler.ColourTo(i, SCE_SCRIPTOL_OPERATOR);
+ }
+ }
+ }
+ else
+ {
+ if (state == SCE_SCRIPTOL_COMMENTLINE ||
+ state == SCE_SCRIPTOL_PERSISTENT ||
+ state == SCE_SCRIPTOL_CSTYLE)
+ {
+ if (ch == '\r' || ch == '\n')
+ {
+ styler.ColourTo(i - 1, state);
+ state = SCE_SCRIPTOL_DEFAULT;
+ }
+ }
+ else if(state == SCE_SCRIPTOL_COMMENTBLOCK)
+ {
+ if(chPrev == '*' && ch == '/')
+ {
+ styler.ColourTo(i, state);
+ state = SCE_SCRIPTOL_DEFAULT;
+ }
+ }
+ else if ((state == SCE_SCRIPTOL_STRING) ||
+ (state == SCE_SCRIPTOL_CHARACTER))
+ {
+ if ((ch == '\r' || ch == '\n') && (chPrev != '\\'))
+ {
+ styler.ColourTo(i - 1, state);
+ state = SCE_SCRIPTOL_STRINGEOL;
+ }
+ else if (ch == '\\')
+ {
+ if (chNext == '\"' || chNext == '\'' || chNext == '\\')
+ {
+ i++;
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ }
+ }
+ else if ((ch == '\"') || (ch == '\''))
+ {
+ // must match the entered quote type
+ if(ch == stringType)
+ {
+ styler.ColourTo(i, state);
+ state = SCE_SCRIPTOL_DEFAULT;
+ }
+ }
+ }
+ else if (state == SCE_SCRIPTOL_TRIPLE)
+ {
+ if ((ch == '\'' && chPrev == '\'' && chPrev2 == '\'') ||
+ (ch == '\"' && chPrev == '\"' && chPrev2 == '\"'))
+ {
+ styler.ColourTo(i, state);
+ state = SCE_SCRIPTOL_DEFAULT;
+ }
+ }
+
+ }
+ chPrev2 = chPrev;
+ chPrev = ch;
+ }
+ if (state == SCE_SCRIPTOL_KEYWORD)
+ {
+ ClassifyWordSol(styler.GetStartSegment(),
+ lengthDoc-1, keywords, styler, prevWord);
+ }
+ else
+ {
+ styler.ColourTo(lengthDoc-1, state);
+ }
+}
+
+static void FoldSolDoc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler)
+ {
+ int lengthDoc = startPos + length;
+
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0)
+ {
+ if (lineCurrent > 0)
+ {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ if (startPos == 0)
+ initStyle = SCE_SCRIPTOL_DEFAULT;
+ else
+ initStyle = styler.StyleAt(startPos-1);
+ }
+ }
+ int state = initStyle & 31;
+ int spaceFlags = 0;
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsSolComment);
+ if (state == SCE_SCRIPTOL_TRIPLE)
+ indentCurrent |= SC_FOLDLEVELWHITEFLAG;
+ char chNext = styler[startPos];
+ for (int i = startPos; i < lengthDoc; i++)
+ {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i) & 31;
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc))
+ {
+ int lev = indentCurrent;
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsSolComment);
+ if (style == SCE_SCRIPTOL_TRIPLE)
+ indentNext |= SC_FOLDLEVELWHITEFLAG;
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG))
+ {
+ // Only non whitespace lines can be headers
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK))
+ {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ else if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ {
+ // Line after is blank so check the next - maybe should continue further?
+ int spaceFlags2 = 0;
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsSolComment);
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK))
+ {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ }
+ indentCurrent = indentNext;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ }
+ }
+}
+
+LexerModule lmScriptol(SCLEX_SCRIPTOL, ColouriseSolDoc, "scriptol", FoldSolDoc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSmalltalk.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSmalltalk.cxx
new file mode 100644
index 00000000000..7c7c06769dd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSmalltalk.cxx
@@ -0,0 +1,326 @@
+// Scintilla source code edit control
+/** @file LexSmalltalk.cxx
+ ** Lexer for Smalltalk language.
+ ** Written by Sergey Philippov, sphilippov-at-gmail-dot-com
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+| lexTable classificationBlock charClasses |
+charClasses := #(#DecDigit #Letter #Special #Upper #BinSel).
+lexTable := ByteArray new: 128.
+classificationBlock := [ :charClass :chars |
+ | flag |
+ flag := 1 bitShift: (charClasses indexOf: charClass) - 1.
+ chars do: [ :char | lexTable at: char codePoint + 1 put: ((lexTable at: char codePoint + 1) bitOr: flag)]].
+
+classificationBlock
+ value: #DecDigit value: '0123456789';
+ value: #Letter value: '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ value: #Special value: '()[]{};.^:';
+ value: #BinSel value: '~@%&*-+=|\/,<>?!';
+ value: #Upper value: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
+
+((String new: 500) streamContents: [ :stream |
+ stream crLf; nextPutAll: 'static int ClassificationTable[256] = {'.
+ lexTable keysAndValuesDo: [ :index :value |
+ ((index - 1) rem: 16) == 0 ifTrue: [
+ stream crLf; tab]
+ ifFalse: [
+ stream space].
+ stream print: value.
+ index ~= 256 ifTrue: [
+ stream nextPut: $,]].
+ stream crLf; nextPutAll: '};'; crLf.
+
+ charClasses keysAndValuesDo: [ :index :name |
+ stream
+ crLf;
+ nextPutAll: (
+ ('static inline bool is<1s>(int ch) {return (ch > 0) && (ch %< 0x80) && ((ClassificationTable[ch] & <2p>) != 0);}')
+ expandMacrosWith: name with: (1 bitShift: (index - 1)))
+ ]]) edit
+*/
+
+// autogenerated {{{{
+
+static int ClassificationTable[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 16, 0, 0, 0, 16, 16, 0, 4, 4, 16, 16, 16, 16, 4, 16,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 16, 16, 16, 16,
+ 16, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 16, 4, 4, 2,
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 16, 4, 16, 0,
+};
+
+static inline bool isDecDigit(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 1) != 0);}
+static inline bool isLetter(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 2) != 0);}
+static inline bool isSpecial(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 4) != 0);}
+static inline bool isUpper(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 8) != 0);}
+static inline bool isBinSel(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 16) != 0);}
+// autogenerated }}}}
+
+static inline bool isAlphaNumeric(int ch) {
+ return isDecDigit(ch) || isLetter(ch);
+}
+
+static inline bool isDigitOfRadix(int ch, int radix)
+{
+ if (isDecDigit(ch))
+ return (ch - '0') < radix;
+ else if (!isUpper(ch))
+ return false;
+ else
+ return (ch - 'A' + 10) < radix;
+}
+
+static inline void skipComment(StyleContext& sc)
+{
+ while (sc.More() && sc.ch != '\"')
+ sc.Forward();
+}
+
+static inline void skipString(StyleContext& sc)
+{
+ while (sc.More()) {
+ if (sc.ch == '\'') {
+ if (sc.chNext != '\'')
+ return;
+ sc.Forward();
+ }
+ sc.Forward();
+ }
+}
+
+static void handleHash(StyleContext& sc)
+{
+ if (isSpecial(sc.chNext)) {
+ sc.SetState(SCE_ST_SPECIAL);
+ return;
+ }
+
+ sc.SetState(SCE_ST_SYMBOL);
+ sc.Forward();
+ if (sc.ch == '\'') {
+ sc.Forward();
+ skipString(sc);
+ }
+ else {
+ if (isLetter(sc.ch)) {
+ while (isAlphaNumeric(sc.chNext) || sc.chNext == ':')
+ sc.Forward();
+ }
+ else if (isBinSel(sc.ch)) {
+ while (isBinSel(sc.chNext))
+ sc.Forward();
+ }
+ }
+}
+
+static inline void handleSpecial(StyleContext& sc)
+{
+ if (sc.ch == ':' && sc.chNext == '=') {
+ sc.SetState(SCE_ST_ASSIGN);
+ sc.Forward();
+ }
+ else {
+ if (sc.ch == '^')
+ sc.SetState(SCE_ST_RETURN);
+ else
+ sc.SetState(SCE_ST_SPECIAL);
+ }
+}
+
+static inline void skipInt(StyleContext& sc, int radix)
+{
+ while (isDigitOfRadix(sc.chNext, radix))
+ sc.Forward();
+}
+
+static void handleNumeric(StyleContext& sc)
+{
+ char num[256];
+ int nl;
+ int radix;
+
+ sc.SetState(SCE_ST_NUMBER);
+ num[0] = static_cast<char>(sc.ch);
+ nl = 1;
+ while (isDecDigit(sc.chNext)) {
+ num[nl++] = static_cast<char>(sc.chNext);
+ sc.Forward();
+ if (nl+1 == sizeof(num)/sizeof(num[0])) // overrun check
+ break;
+ }
+ if (sc.chNext == 'r') {
+ num[nl] = 0;
+ if (num[0] == '-')
+ radix = atoi(num + 1);
+ else
+ radix = atoi(num);
+ sc.Forward();
+ if (sc.chNext == '-')
+ sc.Forward();
+ skipInt(sc, radix);
+ }
+ else
+ radix = 10;
+ if (sc.chNext != '.' || !isDigitOfRadix(sc.GetRelative(2), radix))
+ return;
+ sc.Forward();
+ skipInt(sc, radix);
+ if (sc.chNext == 's') {
+ // ScaledDecimal
+ sc.Forward();
+ while (isDecDigit(sc.chNext))
+ sc.Forward();
+ return;
+ }
+ else if (sc.chNext != 'e' && sc.chNext != 'd' && sc.chNext != 'q')
+ return;
+ sc.Forward();
+ if (sc.chNext == '+' || sc.chNext == '-')
+ sc.Forward();
+ skipInt(sc, radix);
+}
+
+static inline void handleBinSel(StyleContext& sc)
+{
+ sc.SetState(SCE_ST_BINARY);
+ while (isBinSel(sc.chNext))
+ sc.Forward();
+}
+
+static void handleLetter(StyleContext& sc, WordList* specialSelectorList)
+{
+ char ident[256];
+ int il;
+ int state;
+ bool doubleColonPresent;
+
+ sc.SetState(SCE_ST_DEFAULT);
+
+ ident[0] = static_cast<char>(sc.ch);
+ il = 1;
+ while (isAlphaNumeric(sc.chNext)) {
+ ident[il++] = static_cast<char>(sc.chNext);
+ sc.Forward();
+ if (il+2 == sizeof(ident)/sizeof(ident[0])) // overrun check
+ break;
+ }
+
+ if (sc.chNext == ':') {
+ doubleColonPresent = true;
+ ident[il++] = ':';
+ sc.Forward();
+ }
+ else
+ doubleColonPresent = false;
+ ident[il] = 0;
+
+ if (specialSelectorList->InList(ident))
+ state = SCE_ST_SPEC_SEL;
+ else if (doubleColonPresent)
+ state = SCE_ST_KWSEND;
+ else if (isUpper(ident[0]))
+ state = SCE_ST_GLOBAL;
+ else {
+ if (!strcmp(ident, "self"))
+ state = SCE_ST_SELF;
+ else if (!strcmp(ident, "super"))
+ state = SCE_ST_SUPER;
+ else if (!strcmp(ident, "nil"))
+ state = SCE_ST_NIL;
+ else if (!strcmp(ident, "true") || !strcmp(ident, "false"))
+ state = SCE_ST_BOOL;
+ else
+ state = SCE_ST_DEFAULT;
+ }
+
+ sc.ChangeState(state);
+}
+
+static void colorizeSmalltalkDoc(unsigned int startPos, int length, int initStyle, WordList *wordLists[], Accessor &styler)
+{
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ if (initStyle == SCE_ST_COMMENT) {
+ skipComment(sc);
+ if (sc.More())
+ sc.Forward();
+ }
+ else if (initStyle == SCE_ST_STRING) {
+ skipString(sc);
+ if (sc.More())
+ sc.Forward();
+ }
+
+ for (; sc.More(); sc.Forward()) {
+ int ch;
+
+ ch = sc.ch;
+ if (ch == '\"') {
+ sc.SetState(SCE_ST_COMMENT);
+ sc.Forward();
+ skipComment(sc);
+ }
+ else if (ch == '\'') {
+ sc.SetState(SCE_ST_STRING);
+ sc.Forward();
+ skipString(sc);
+ }
+ else if (ch == '#')
+ handleHash(sc);
+ else if (ch == '$') {
+ sc.SetState(SCE_ST_CHARACTER);
+ sc.Forward();
+ }
+ else if (isSpecial(ch))
+ handleSpecial(sc);
+ else if (isDecDigit(ch))
+ handleNumeric(sc);
+ else if (isLetter(ch))
+ handleLetter(sc, wordLists[0]);
+ else if (isBinSel(ch)) {
+ if (ch == '-' && isDecDigit(sc.chNext))
+ handleNumeric(sc);
+ else
+ handleBinSel(sc);
+ }
+ else
+ sc.SetState(SCE_ST_DEFAULT);
+ }
+ sc.Complete();
+}
+
+static const char* const smalltalkWordListDesc[] = {
+ "Special selectors",
+ 0
+};
+
+LexerModule lmSmalltalk(SCLEX_SMALLTALK, colorizeSmalltalkDoc, "smalltalk", NULL, smalltalkWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSorcus.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSorcus.cxx
new file mode 100644
index 00000000000..ba5588b3117
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSorcus.cxx
@@ -0,0 +1,208 @@
+// Scintilla source code edit control
+/** @file LexSorcus.cxx
+** Lexer for SORCUS installation files
+** Written by Eugen Bitter and Christoph Baumann at SORCUS Computer, Heidelberg Germany
+** Based on the ASM Lexer by The Black Horus
+**/
+
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+//each character a..z and A..Z + '_' can be part of a keyword
+//additionally numbers that follow 'M' can be contained in a keyword
+static inline bool IsSWordStart(const int ch, const int prev_ch)
+{
+ if (isalpha(ch) || (ch == '_') || ((isdigit(ch)) && (prev_ch == 'M')))
+ return true;
+
+ return false;
+}
+
+
+//only digits that are not preceded by 'M' count as a number
+static inline bool IsSorcusNumber(const int ch, const int prev_ch)
+{
+ if ((isdigit(ch)) && (prev_ch != 'M'))
+ return true;
+
+ return false;
+}
+
+
+//only = is a valid operator
+static inline bool IsSorcusOperator(const int ch)
+{
+ if (ch == '=')
+ return true;
+
+ return false;
+}
+
+
+static void ColouriseSorcusDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler)
+{
+
+ WordList &Command = *keywordlists[0];
+ WordList &Parameter = *keywordlists[1];
+ WordList &Constant = *keywordlists[2];
+
+ // Do not leak onto next line
+ if (initStyle == SCE_SORCUS_STRINGEOL)
+ initStyle = SCE_SORCUS_DEFAULT;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward())
+ {
+
+ // Prevent SCE_SORCUS_STRINGEOL from leaking back to previous line
+ if (sc.atLineStart && (sc.state == SCE_SORCUS_STRING))
+ {
+ sc.SetState(SCE_SORCUS_STRING);
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_SORCUS_OPERATOR)
+ {
+ if (!IsSorcusOperator(sc.ch))
+ {
+ sc.SetState(SCE_SORCUS_DEFAULT);
+ }
+ }
+ else if(sc.state == SCE_SORCUS_NUMBER)
+ {
+ if(!IsSorcusNumber(sc.ch, sc.chPrev))
+ {
+ sc.SetState(SCE_SORCUS_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_SORCUS_IDENTIFIER)
+ {
+ if (!IsSWordStart(sc.ch, sc.chPrev))
+ {
+ char s[100];
+
+ sc.GetCurrent(s, sizeof(s));
+
+ if (Command.InList(s))
+ {
+ sc.ChangeState(SCE_SORCUS_COMMAND);
+ }
+ else if (Parameter.InList(s))
+ {
+ sc.ChangeState(SCE_SORCUS_PARAMETER);
+ }
+ else if (Constant.InList(s))
+ {
+ sc.ChangeState(SCE_SORCUS_CONSTANT);
+ }
+
+ sc.SetState(SCE_SORCUS_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_SORCUS_COMMENTLINE )
+ {
+ if (sc.atLineEnd)
+ {
+ sc.SetState(SCE_SORCUS_DEFAULT);
+ }
+ }
+ else if (sc.state == SCE_SORCUS_STRING)
+ {
+ if (sc.ch == '\"')
+ {
+ sc.ForwardSetState(SCE_SORCUS_DEFAULT);
+ }
+ else if (sc.atLineEnd)
+ {
+ sc.ChangeState(SCE_SORCUS_STRINGEOL);
+ sc.ForwardSetState(SCE_SORCUS_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_SORCUS_DEFAULT)
+ {
+ if ((sc.ch == ';') || (sc.ch == '\''))
+ {
+ sc.SetState(SCE_SORCUS_COMMENTLINE);
+ }
+ else if (IsSWordStart(sc.ch, sc.chPrev))
+ {
+ sc.SetState(SCE_SORCUS_IDENTIFIER);
+ }
+ else if (sc.ch == '\"')
+ {
+ sc.SetState(SCE_SORCUS_STRING);
+ }
+ else if (IsSorcusOperator(sc.ch))
+ {
+ sc.SetState(SCE_SORCUS_OPERATOR);
+ }
+ else if (IsSorcusNumber(sc.ch, sc.chPrev))
+ {
+ sc.SetState(SCE_SORCUS_NUMBER);
+ }
+ }
+
+ }
+ sc.Complete();
+}
+
+
+static const char* const SorcusWordListDesc[] = {"Command","Parameter", "Constant", 0};
+
+LexerModule lmSorc(SCLEX_SORCUS, ColouriseSorcusDoc, "sorcins", 0, SorcusWordListDesc);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpecman.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpecman.cxx
new file mode 100644
index 00000000000..918edaf9878
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpecman.cxx
@@ -0,0 +1,292 @@
+// Scintilla source code edit control
+/** @file LexSpecman.cxx
+ ** Lexer for Specman E language.
+ ** Written by Avi Yegudin, based on C++ lexer by Neil Hodgson
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '\'');
+}
+
+static inline bool IsANumberChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '\'');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '`');
+}
+
+static void ColouriseSpecmanDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler, bool caseSensitive) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+
+ // Do not leak onto next line
+ if (initStyle == SCE_SN_STRINGEOL)
+ initStyle = SCE_SN_CODE;
+
+ int visibleChars = 0;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.atLineStart && (sc.state == SCE_SN_STRING)) {
+ // Prevent SCE_SN_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_SN_STRING);
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
+ continue;
+ }
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_SN_OPERATOR) {
+ sc.SetState(SCE_SN_CODE);
+ } else if (sc.state == SCE_SN_NUMBER) {
+ if (!IsANumberChar(sc.ch)) {
+ sc.SetState(SCE_SN_CODE);
+ }
+ } else if (sc.state == SCE_SN_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
+ char s[100];
+ if (caseSensitive) {
+ sc.GetCurrent(s, sizeof(s));
+ } else {
+ sc.GetCurrentLowered(s, sizeof(s));
+ }
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_SN_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_SN_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_SN_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_SN_USER);
+ }
+ sc.SetState(SCE_SN_CODE);
+ }
+ } else if (sc.state == SCE_SN_PREPROCESSOR) {
+ if (IsASpace(sc.ch)) {
+ sc.SetState(SCE_SN_CODE);
+ }
+ } else if (sc.state == SCE_SN_DEFAULT) {
+ if (sc.Match('<', '\'')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_SN_CODE);
+ }
+ } else if (sc.state == SCE_SN_COMMENTLINE || sc.state == SCE_SN_COMMENTLINEBANG) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_SN_CODE);
+ visibleChars = 0;
+ }
+ } else if (sc.state == SCE_SN_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_SN_CODE);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_SN_STRINGEOL);
+ sc.ForwardSetState(SCE_SN_CODE);
+ visibleChars = 0;
+ }
+ } else if (sc.state == SCE_SN_SIGNAL) {
+ if (sc.atLineEnd) {
+ sc.ChangeState(SCE_SN_STRINGEOL);
+ sc.ForwardSetState(SCE_SN_CODE);
+ visibleChars = 0;
+ } else if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\'') {
+ sc.ForwardSetState(SCE_SN_CODE);
+ }
+ } else if (sc.state == SCE_SN_REGEXTAG) {
+ if (!IsADigit(sc.ch)) {
+ sc.SetState(SCE_SN_CODE);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_SN_CODE) {
+ if (sc.ch == '$' && IsADigit(sc.chNext)) {
+ sc.SetState(SCE_SN_REGEXTAG);
+ sc.Forward();
+ } else if (IsADigit(sc.ch)) {
+ sc.SetState(SCE_SN_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_SN_IDENTIFIER);
+ } else if (sc.Match('\'', '>')) {
+ sc.SetState(SCE_SN_DEFAULT);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ if (sc.Match("//!")) // Nice to have a different comment style
+ sc.SetState(SCE_SN_COMMENTLINEBANG);
+ else
+ sc.SetState(SCE_SN_COMMENTLINE);
+ } else if (sc.Match('-', '-')) {
+ if (sc.Match("--!")) // Nice to have a different comment style
+ sc.SetState(SCE_SN_COMMENTLINEBANG);
+ else
+ sc.SetState(SCE_SN_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_SN_STRING);
+ } else if (sc.ch == '\'') {
+ sc.SetState(SCE_SN_SIGNAL);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ // Preprocessor commands are alone on their line
+ sc.SetState(SCE_SN_PREPROCESSOR);
+ // Skip whitespace between # and preprocessor word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_SN_CODE);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@') {
+ sc.SetState(SCE_SN_OPERATOR);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ // Reset states to begining of colourise so no surprises
+ // if different sets of lines lexed.
+ visibleChars = 0;
+ }
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+ sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldNoBoxSpecmanDoc(unsigned int startPos, int length, int,
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ //int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && (style == SCE_SN_COMMENTLINE)) {
+ if (((ch == '/') && (chNext == '/')) ||
+ ((ch == '-') && (chNext == '-'))) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ if (style == SCE_SN_OPERATOR) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (foldAtElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+}
+
+static void FoldSpecmanDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ FoldNoBoxSpecmanDoc(startPos, length, initStyle, styler);
+}
+
+static const char * const specmanWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ "Sequence keywords and identifiers",
+ "User defined keywords and identifiers",
+ "Unused",
+ 0,
+ };
+
+static void ColouriseSpecmanDocSensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+ ColouriseSpecmanDoc(startPos, length, initStyle, keywordlists, styler, true);
+}
+
+
+LexerModule lmSpecman(SCLEX_SPECMAN, ColouriseSpecmanDocSensitive, "specman", FoldSpecmanDoc, specmanWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpice.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpice.cxx
new file mode 100644
index 00000000000..ccc9f6da46f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexSpice.cxx
@@ -0,0 +1,206 @@
+// Scintilla source code edit control
+/** @file LexSpice.cxx
+ ** Lexer for Spice
+ **/
+// Copyright 2006 by Fabien Proriol
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+ * Interface
+ */
+
+static void ColouriseDocument(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+static const char * const spiceWordListDesc[] = {
+ "Keywords", // SPICE command
+ "Keywords2", // SPICE functions
+ "Keywords3", // SPICE params
+ 0
+};
+
+LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", NULL, spiceWordListDesc);
+
+/*
+ * Implementation
+ */
+
+static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute);
+static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute);
+
+static inline bool IsDelimiterCharacter(int ch);
+static inline bool IsSeparatorOrDelimiterCharacter(int ch);
+
+static void ColouriseComment(StyleContext& sc, bool&) {
+ sc.SetState(SCE_SPICE_COMMENTLINE);
+ while (!sc.atLineEnd) {
+ sc.Forward();
+ }
+}
+
+static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = sc.Match (')');
+ sc.SetState(SCE_SPICE_DELIMITER);
+ sc.ForwardSetState(SCE_SPICE_DEFAULT);
+}
+
+static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+ std::string number;
+ sc.SetState(SCE_SPICE_NUMBER);
+ // Get all characters up to a delimiter or a separator, including points, but excluding
+ // double points (ranges).
+ while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward();
+ }
+ // Special case: exponent with sign
+ if ((sc.chPrev == 'e' || sc.chPrev == 'E') &&
+ (sc.ch == '+' || sc.ch == '-')) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward ();
+ while (!IsSeparatorOrDelimiterCharacter(sc.ch)) {
+ number += static_cast<char>(sc.ch);
+ sc.Forward();
+ }
+ }
+ sc.SetState(SCE_SPICE_DEFAULT);
+}
+
+static void ColouriseWhiteSpace(StyleContext& sc, bool& ) {
+ sc.SetState(SCE_SPICE_DEFAULT);
+ sc.ForwardSetState(SCE_SPICE_DEFAULT);
+}
+
+static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) {
+ apostropheStartsAttribute = true;
+ sc.SetState(SCE_SPICE_IDENTIFIER);
+ std::string word;
+ while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
+ word += static_cast<char>(tolower(sc.ch));
+ sc.Forward();
+ }
+ if (keywords.InList(word.c_str())) {
+ sc.ChangeState(SCE_SPICE_KEYWORD);
+ if (word != "all") {
+ apostropheStartsAttribute = false;
+ }
+ }
+ else if (keywords2.InList(word.c_str())) {
+ sc.ChangeState(SCE_SPICE_KEYWORD2);
+ if (word != "all") {
+ apostropheStartsAttribute = false;
+ }
+ }
+ else if (keywords3.InList(word.c_str())) {
+ sc.ChangeState(SCE_SPICE_KEYWORD3);
+ if (word != "all") {
+ apostropheStartsAttribute = false;
+ }
+ }
+ sc.SetState(SCE_SPICE_DEFAULT);
+}
+
+//
+// ColouriseDocument
+//
+static void ColouriseDocument(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ StyleContext sc(startPos, length, initStyle, styler);
+ int lineCurrent = styler.GetLine(startPos);
+ bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
+ while (sc.More()) {
+ if (sc.atLineEnd) {
+ // Go to the next line
+ sc.Forward();
+ lineCurrent++;
+ // Remember the line state for future incremental lexing
+ styler.SetLineState(lineCurrent, apostropheStartsAttribute);
+ // Don't continue any styles on the next line
+ sc.SetState(SCE_SPICE_DEFAULT);
+ }
+ // Comments
+ if ((sc.Match('*') && sc.atLineStart) || sc.Match('*','~')) {
+ ColouriseComment(sc, apostropheStartsAttribute);
+ // Whitespace
+ } else if (IsASpace(sc.ch)) {
+ ColouriseWhiteSpace(sc, apostropheStartsAttribute);
+ // Delimiters
+ } else if (IsDelimiterCharacter(sc.ch)) {
+ ColouriseDelimiter(sc, apostropheStartsAttribute);
+ // Numbers
+ } else if (IsADigit(sc.ch) || sc.ch == '#') {
+ ColouriseNumber(sc, apostropheStartsAttribute);
+ // Keywords or identifiers
+ } else {
+ ColouriseWord(sc, keywords, keywords2, keywords3, apostropheStartsAttribute);
+ }
+ }
+ sc.Complete();
+}
+
+static inline bool IsDelimiterCharacter(int ch) {
+ switch (ch) {
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.':
+ case '/':
+ case ':':
+ case ';':
+ case '<':
+ case '=':
+ case '>':
+ case '|':
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
+ return IsASpace(ch) || IsDelimiterCharacter(ch);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTACL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTACL.cxx
new file mode 100644
index 00000000000..fb7d695fdf1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTACL.cxx
@@ -0,0 +1,400 @@
+// Scintilla source code edit control
+/** @file LexTAL.cxx
+ ** Lexer for TAL
+ ** Based on LexPascal.cxx
+ ** Written by Laurent le Tynevez
+ ** Updated by Simon Steele <s.steele@pnotepad.org> September 2002
+ ** Updated by Mathias Rauen <scite@madshi.net> May 2003 (Delphi adjustments)
+ ** Updated by Rod Falck, Aug 2006 Converted to TACL
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+inline bool isTACLoperator(char ch)
+ {
+ return ch == '\'' || isoperator(ch);
+ }
+
+inline bool isTACLwordchar(char ch)
+ {
+ return ch == '#' || ch == '^' || ch == '|' || ch == '_' || iswordchar(ch);
+ }
+
+inline bool isTACLwordstart(char ch)
+ {
+ return ch == '#' || ch == '|' || ch == '_' || iswordstart(ch);
+ }
+
+static void getRange(unsigned int start,
+ unsigned int end,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_C_COMMENT ||
+ style == SCE_C_COMMENTDOC ||
+ style == SCE_C_COMMENTDOCKEYWORD ||
+ style == SCE_C_COMMENTDOCKEYWORDERROR;
+}
+
+static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) {
+ if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) {
+ styler.ColourTo(end, SCE_C_REGEX);
+ } else
+ styler.ColourTo(end, attr);
+}
+
+// returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm"
+static int classifyWordTACL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInAsm) {
+ int ret = 0;
+
+ WordList& keywords = *keywordlists[0];
+ WordList& builtins = *keywordlists[1];
+ WordList& commands = *keywordlists[2];
+
+ char s[100];
+ getRange(start, end, styler, s, sizeof(s));
+
+ char chAttr = SCE_C_IDENTIFIER;
+ if (isdigit(s[0]) || (s[0] == '.')) {
+ chAttr = SCE_C_NUMBER;
+ }
+ else {
+ if (s[0] == '#' || keywords.InList(s)) {
+ chAttr = SCE_C_WORD;
+
+ if (strcmp(s, "asm") == 0) {
+ ret = 2;
+ }
+ else if (strcmp(s, "end") == 0) {
+ ret = -1;
+ }
+ }
+ else if (s[0] == '|' || builtins.InList(s)) {
+ chAttr = SCE_C_WORD2;
+ }
+ else if (commands.InList(s)) {
+ chAttr = SCE_C_UUID;
+ }
+ else if (strcmp(s, "comment") == 0) {
+ chAttr = SCE_C_COMMENTLINE;
+ ret = 3;
+ }
+ }
+ ColourTo(styler, end, chAttr, (bInAsm && ret != -1));
+ return ret;
+}
+
+static int classifyFoldPointTACL(const char* s) {
+ int lev = 0;
+ if (s[0] == '[')
+ lev=1;
+ else if (s[0] == ']')
+ lev=-1;
+ return lev;
+}
+
+static void ColouriseTACLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ styler.StartAt(startPos);
+
+ int state = initStyle;
+ if (state == SCE_C_CHARACTER) // Does not leak onto next line
+ state = SCE_C_DEFAULT;
+ char chPrev = ' ';
+ char chNext = styler[startPos];
+ unsigned int lengthDoc = startPos + length;
+
+ bool bInClassDefinition;
+
+ int currentLine = styler.GetLine(startPos);
+ if (currentLine > 0) {
+ styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
+ bInClassDefinition = (styler.GetLineState(currentLine) == 1);
+ } else {
+ styler.SetLineState(currentLine, 0);
+ bInClassDefinition = false;
+ }
+
+ bool bInAsm = (state == SCE_C_REGEX);
+ if (bInAsm)
+ state = SCE_C_DEFAULT;
+
+ styler.StartSegment(startPos);
+ int visibleChars = 0;
+ unsigned int i;
+ for (i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
+ // Avoid triggering two times on Dos/Win
+ // End of line
+ if (state == SCE_C_CHARACTER) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ visibleChars = 0;
+ currentLine++;
+ styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0));
+ }
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_C_DEFAULT) {
+ if (isTACLwordstart(ch)) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_IDENTIFIER;
+ } else if (ch == '{') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENT;
+ } else if (ch == '{' && chNext == '*') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTDOC;
+ } else if (ch == '=' && chNext == '=') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '"') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_STRING;
+ } else if (ch == '?' && visibleChars == 0) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_PREPROCESSOR;
+ } else if (isTACLoperator(ch)) {
+ ColourTo(styler, i-1, state, bInAsm);
+ ColourTo(styler, i, SCE_C_OPERATOR, bInAsm);
+ }
+ } else if (state == SCE_C_IDENTIFIER) {
+ if (!isTACLwordchar(ch)) {
+ int lStateChange = classifyWordTACL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm);
+
+ if(lStateChange == 1) {
+ styler.SetLineState(currentLine, 1);
+ bInClassDefinition = true;
+ } else if(lStateChange == 2) {
+ bInAsm = true;
+ } else if(lStateChange == -1) {
+ styler.SetLineState(currentLine, 0);
+ bInClassDefinition = false;
+ bInAsm = false;
+ }
+
+ if (lStateChange == 3) {
+ state = SCE_C_COMMENTLINE;
+ }
+ else {
+ state = SCE_C_DEFAULT;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (ch == '{') {
+ state = SCE_C_COMMENT;
+ } else if (ch == '{' && chNext == '*') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTDOC;
+ } else if (ch == '=' && chNext == '=') {
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '"') {
+ state = SCE_C_STRING;
+ } else if (isTACLoperator(ch)) {
+ ColourTo(styler, i, SCE_C_OPERATOR, bInAsm);
+ }
+ }
+ }
+ } else {
+ if (state == SCE_C_PREPROCESSOR) {
+ if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENT) {
+ if (ch == '}' || (ch == '\r' || ch == '\n') ) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENTDOC) {
+ if (ch == '}' || (ch == '\r' || ch == '\n')) {
+ if (((i > styler.GetStartSegment() + 2) || (
+ (initStyle == SCE_C_COMMENTDOC) &&
+ (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ } else if (state == SCE_C_COMMENTLINE) {
+ if (ch == '\r' || ch == '\n') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_STRING) {
+ if (ch == '"' || ch == '\r' || ch == '\n') {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ chPrev = ch;
+ }
+
+ // Process to end of document
+ if (state == SCE_C_IDENTIFIER) {
+ classifyWordTACL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm);
+ }
+ else
+ ColourTo(styler, lengthDoc - 1, state, bInAsm);
+}
+
+static void FoldTACLDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ bool section = false;
+
+ int lastStart = 0;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (stylePrev == SCE_C_DEFAULT && (style == SCE_C_WORD || style == SCE_C_PREPROCESSOR))
+ {
+ // Store last word start point.
+ lastStart = i;
+ }
+
+ if (stylePrev == SCE_C_WORD || stylePrev == SCE_C_PREPROCESSOR) {
+ if(isTACLwordchar(ch) && !isTACLwordchar(chNext)) {
+ char s[100];
+ getRange(lastStart, i, styler, s, sizeof(s));
+ if (stylePrev == SCE_C_PREPROCESSOR && strcmp(s, "?section") == 0)
+ {
+ section = true;
+ levelCurrent = 1;
+ levelPrev = 0;
+ }
+ else if (stylePrev == SCE_C_WORD)
+ levelCurrent += classifyFoldPointTACL(s);
+ }
+ }
+
+ if (style == SCE_C_OPERATOR) {
+ if (ch == '[') {
+ levelCurrent++;
+ } else if (ch == ']') {
+ levelCurrent--;
+ }
+ }
+ if (foldComment && (style == SCE_C_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelCurrent++;
+ } else if (chNext2 == '}') {
+ levelCurrent--;
+ }
+ }
+ }
+
+ if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
+ if (ch == '{' && chNext == '$') {
+ unsigned int j=i+2; // skip {$
+ while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "region") || styler.Match(j, "if")) {
+ levelCurrent++;
+ } else if (styler.Match(j, "end")) {
+ levelCurrent--;
+ }
+ }
+ }
+
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelCurrent++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+ if (atEOL) {
+ int lev = levelPrev | SC_FOLDLEVELBASE;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev || section) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ section = false;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const TACLWordListDesc[] = {
+ "Builtins",
+ "Labels",
+ "Commands",
+ 0
+};
+
+LexerModule lmTACL(SCLEX_TACL, ColouriseTACLDoc, "TACL", FoldTACLDoc, TACLWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTADS3.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTADS3.cxx
new file mode 100644
index 00000000000..54cb88ad68a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTADS3.cxx
@@ -0,0 +1,903 @@
+// Scintilla source code edit control
+/** @file LexTADS3.cxx
+ ** Lexer for TADS3.
+ **/
+// Copyright 1998-2006 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+/*
+ * TADS3 is a language designed by Michael J. Roberts for the writing of text
+ * based games. TADS comes from Text Adventure Development System. It has good
+ * support for the processing and outputting of formatted text and much of a
+ * TADS program listing consists of strings.
+ *
+ * TADS has two types of strings, those enclosed in single quotes (') and those
+ * enclosed in double quotes ("). These strings have different symantics and
+ * can be given different highlighting if desired.
+ *
+ * There can be embedded within both types of strings html tags
+ * ( <tag key=value> ), library directives ( <.directive> ), and message
+ * parameters ( {The doctor's/his} ).
+ *
+ * Double quoted strings can also contain interpolated expressions
+ * ( << rug.moved ? ' and a hole in the floor. ' : nil >> ). These expressions
+ * may themselves contain single or double quoted strings, although the double
+ * quoted strings may not contain interpolated expressions.
+ *
+ * These embedded constructs influence the output and formatting and are an
+ * important part of a program and require highlighting.
+ *
+ * LINKS
+ * http://www.tads.org/
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static const int T3_SINGLE_QUOTE = 1;
+static const int T3_INT_EXPRESSION = 2;
+static const int T3_INT_EXPRESSION_IN_TAG = 4;
+static const int T3_HTML_SQUOTE = 8;
+
+static inline bool IsEOL(const int ch, const int chNext) {
+ return (ch == '\r' && chNext != '\n') || (ch == '\n');
+}
+
+/*
+ * Test the current character to see if it's the START of an EOL sequence;
+ * if so, skip ahead to the last character of the sequence and return true,
+ * and if not just return false. There are a few places where we want to
+ * check to see if a newline sequence occurs at a particular point, but
+ * where a caller expects a subroutine to stop only upon reaching the END
+ * of a newline sequence (in particular, CR-LF on Windows). That's why
+ * IsEOL() above only returns true on CR if the CR isn't followed by an LF
+ * - it doesn't want to admit that there's a newline until reaching the END
+ * of the sequence. We meet both needs by saying that there's a newline
+ * when we see the CR in a CR-LF, but skipping the CR before returning so
+ * that the caller's caller will see that we've stopped at the LF.
+ */
+static inline bool IsEOLSkip(StyleContext &sc)
+{
+ /* test for CR-LF */
+ if (sc.ch == '\r' && sc.chNext == '\n')
+ {
+ /* got CR-LF - skip the CR and indicate that we're at a newline */
+ sc.Forward();
+ return true;
+ }
+
+ /*
+ * in other cases, we have at most a 1-character newline, so do the
+ * normal IsEOL test
+ */
+ return IsEOL(sc.ch, sc.chNext);
+}
+
+static inline bool IsATADS3Operator(const int ch) {
+ return ch == '=' || ch == '{' || ch == '}' || ch == '(' || ch == ')'
+ || ch == '[' || ch == ']' || ch == ',' || ch == ':' || ch == ';'
+ || ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%'
+ || ch == '?' || ch == '!' || ch == '<' || ch == '>' || ch == '|'
+ || ch == '@' || ch == '&' || ch == '~';
+}
+
+static inline bool IsAWordChar(const int ch) {
+ return isalnum(ch) || ch == '_';
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return isalpha(ch) || ch == '_';
+}
+
+static inline bool IsAHexDigit(const int ch) {
+ int lch = tolower(ch);
+ return isdigit(lch) || lch == 'a' || lch == 'b' || lch == 'c'
+ || lch == 'd' || lch == 'e' || lch == 'f';
+}
+
+static inline bool IsAnHTMLChar(int ch) {
+ return isalnum(ch) || ch == '-' || ch == '_' || ch == '.';
+}
+
+static inline bool IsADirectiveChar(int ch) {
+ return isalnum(ch) || isspace(ch) || ch == '-' || ch == '/';
+}
+
+static inline bool IsANumberStart(StyleContext &sc) {
+ return isdigit(sc.ch)
+ || (!isdigit(sc.chPrev) && sc.ch == '.' && isdigit(sc.chNext));
+}
+
+inline static void ColouriseTADS3Operator(StyleContext &sc) {
+ int initState = sc.state;
+ int c = sc.ch;
+ sc.SetState(c == '{' || c == '}' ? SCE_T3_BRACE : SCE_T3_OPERATOR);
+ sc.ForwardSetState(initState);
+}
+
+static void ColouriseTADSHTMLString(StyleContext &sc, int &lineState) {
+ int endState = sc.state;
+ int chQuote = sc.ch;
+ int chString = (lineState & T3_SINGLE_QUOTE) ? '\'' : '"';
+ if (endState == SCE_T3_HTML_STRING) {
+ if (lineState&T3_SINGLE_QUOTE) {
+ endState = SCE_T3_S_STRING;
+ chString = '\'';
+ } else if (lineState&T3_INT_EXPRESSION) {
+ endState = SCE_T3_X_STRING;
+ chString = '"';
+ } else {
+ endState = SCE_T3_HTML_DEFAULT;
+ chString = '"';
+ }
+ chQuote = (lineState & T3_HTML_SQUOTE) ? '\'' : '"';
+ } else {
+ sc.SetState(SCE_T3_HTML_STRING);
+ sc.Forward();
+ }
+ if (chQuote == '"')
+ lineState &= ~T3_HTML_SQUOTE;
+ else
+ lineState |= T3_HTML_SQUOTE;
+
+ while (sc.More()) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ if (sc.ch == chQuote) {
+ sc.ForwardSetState(endState);
+ return;
+ }
+ if (sc.Match('\\', static_cast<char>(chQuote))) {
+ sc.Forward(2);
+ sc.SetState(endState);
+ return;
+ }
+ if (sc.ch == chString) {
+ sc.SetState(SCE_T3_DEFAULT);
+ return;
+ }
+
+ if (sc.Match('<', '<')) {
+ lineState |= T3_INT_EXPRESSION | T3_INT_EXPRESSION_IN_TAG;
+ sc.SetState(SCE_T3_X_DEFAULT);
+ sc.Forward(2);
+ return;
+ }
+
+ if (sc.Match('\\', static_cast<char>(chQuote))
+ || sc.Match('\\', static_cast<char>(chString))
+ || sc.Match('\\', '\\')) {
+ sc.Forward(2);
+ } else {
+ sc.Forward();
+ }
+ }
+}
+
+static void ColouriseTADS3HTMLTagStart(StyleContext &sc) {
+ sc.SetState(SCE_T3_HTML_TAG);
+ sc.Forward();
+ if (sc.ch == '/') {
+ sc.Forward();
+ }
+ while (IsAnHTMLChar(sc.ch)) {
+ sc.Forward();
+ }
+}
+
+static void ColouriseTADS3HTMLTag(StyleContext &sc, int &lineState) {
+ int endState = sc.state;
+ int chQuote = '"';
+ int chString = '\'';
+ switch (endState) {
+ case SCE_T3_S_STRING:
+ ColouriseTADS3HTMLTagStart(sc);
+ sc.SetState(SCE_T3_HTML_DEFAULT);
+ chQuote = '\'';
+ chString = '"';
+ break;
+ case SCE_T3_D_STRING:
+ case SCE_T3_X_STRING:
+ ColouriseTADS3HTMLTagStart(sc);
+ sc.SetState(SCE_T3_HTML_DEFAULT);
+ break;
+ case SCE_T3_HTML_DEFAULT:
+ if (lineState&T3_SINGLE_QUOTE) {
+ endState = SCE_T3_S_STRING;
+ chQuote = '\'';
+ chString = '"';
+ } else if (lineState&T3_INT_EXPRESSION) {
+ endState = SCE_T3_X_STRING;
+ } else {
+ endState = SCE_T3_D_STRING;
+ }
+ break;
+ }
+
+ while (sc.More()) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ if (sc.Match('/', '>')) {
+ sc.SetState(SCE_T3_HTML_TAG);
+ sc.Forward(2);
+ sc.SetState(endState);
+ return;
+ }
+ if (sc.ch == '>') {
+ sc.SetState(SCE_T3_HTML_TAG);
+ sc.ForwardSetState(endState);
+ return;
+ }
+ if (sc.ch == chQuote) {
+ sc.SetState(endState);
+ return;
+ }
+ if (sc.Match('\\', static_cast<char>(chQuote))) {
+ sc.Forward();
+ ColouriseTADSHTMLString(sc, lineState);
+ if (sc.state == SCE_T3_X_DEFAULT)
+ break;
+ } else if (sc.ch == chString) {
+ ColouriseTADSHTMLString(sc, lineState);
+ } else if (sc.ch == '=') {
+ ColouriseTADS3Operator(sc);
+ } else {
+ sc.Forward();
+ }
+ }
+}
+
+static void ColouriseTADS3Keyword(StyleContext &sc,
+ WordList *keywordlists[], unsigned int endPos) {
+ char s[250];
+ WordList &keywords = *keywordlists[0];
+ WordList &userwords1 = *keywordlists[1];
+ WordList &userwords2 = *keywordlists[2];
+ WordList &userwords3 = *keywordlists[3];
+ int initState = sc.state;
+ sc.SetState(SCE_T3_IDENTIFIER);
+ while (sc.More() && (IsAWordChar(sc.ch))) {
+ sc.Forward();
+ }
+ sc.GetCurrent(s, sizeof(s));
+ if ( strcmp(s, "is") == 0 || strcmp(s, "not") == 0) {
+ // have to find if "in" is next
+ int n = 1;
+ while (n + sc.currentPos < endPos && IsASpaceOrTab(sc.GetRelative(n)))
+ n++;
+ if (sc.GetRelative(n) == 'i' && sc.GetRelative(n+1) == 'n') {
+ sc.Forward(n+2);
+ sc.ChangeState(SCE_T3_KEYWORD);
+ }
+ } else if (keywords.InList(s)) {
+ sc.ChangeState(SCE_T3_KEYWORD);
+ } else if (userwords3.InList(s)) {
+ sc.ChangeState(SCE_T3_USER3);
+ } else if (userwords2.InList(s)) {
+ sc.ChangeState(SCE_T3_USER2);
+ } else if (userwords1.InList(s)) {
+ sc.ChangeState(SCE_T3_USER1);
+ }
+ sc.SetState(initState);
+}
+
+static void ColouriseTADS3MsgParam(StyleContext &sc, int &lineState) {
+ int endState = sc.state;
+ int chQuote = '"';
+ switch (endState) {
+ case SCE_T3_S_STRING:
+ sc.SetState(SCE_T3_MSG_PARAM);
+ sc.Forward();
+ chQuote = '\'';
+ break;
+ case SCE_T3_D_STRING:
+ case SCE_T3_X_STRING:
+ sc.SetState(SCE_T3_MSG_PARAM);
+ sc.Forward();
+ break;
+ case SCE_T3_MSG_PARAM:
+ if (lineState&T3_SINGLE_QUOTE) {
+ endState = SCE_T3_S_STRING;
+ chQuote = '\'';
+ } else if (lineState&T3_INT_EXPRESSION) {
+ endState = SCE_T3_X_STRING;
+ } else {
+ endState = SCE_T3_D_STRING;
+ }
+ break;
+ }
+ while (sc.More() && sc.ch != '}' && sc.ch != chQuote) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ if (sc.ch == '\\') {
+ sc.Forward();
+ }
+ sc.Forward();
+ }
+ if (sc.ch == chQuote) {
+ sc.SetState(endState);
+ } else {
+ sc.ForwardSetState(endState);
+ }
+}
+
+static void ColouriseTADS3LibDirective(StyleContext &sc, int &lineState) {
+ int initState = sc.state;
+ int chQuote = '"';
+ switch (initState) {
+ case SCE_T3_S_STRING:
+ sc.SetState(SCE_T3_LIB_DIRECTIVE);
+ sc.Forward(2);
+ chQuote = '\'';
+ break;
+ case SCE_T3_D_STRING:
+ sc.SetState(SCE_T3_LIB_DIRECTIVE);
+ sc.Forward(2);
+ break;
+ case SCE_T3_LIB_DIRECTIVE:
+ if (lineState&T3_SINGLE_QUOTE) {
+ initState = SCE_T3_S_STRING;
+ chQuote = '\'';
+ } else {
+ initState = SCE_T3_D_STRING;
+ }
+ break;
+ }
+ while (sc.More() && IsADirectiveChar(sc.ch)) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ sc.Forward();
+ };
+ if (sc.ch == '>' || !sc.More()) {
+ sc.ForwardSetState(initState);
+ } else if (sc.ch == chQuote) {
+ sc.SetState(initState);
+ } else {
+ sc.ChangeState(initState);
+ sc.Forward();
+ }
+}
+
+static void ColouriseTADS3String(StyleContext &sc, int &lineState) {
+ int chQuote = sc.ch;
+ int endState = sc.state;
+ switch (sc.state) {
+ case SCE_T3_DEFAULT:
+ case SCE_T3_X_DEFAULT:
+ if (chQuote == '"') {
+ if (sc.state == SCE_T3_DEFAULT) {
+ sc.SetState(SCE_T3_D_STRING);
+ } else {
+ sc.SetState(SCE_T3_X_STRING);
+ }
+ lineState &= ~T3_SINGLE_QUOTE;
+ } else {
+ sc.SetState(SCE_T3_S_STRING);
+ lineState |= T3_SINGLE_QUOTE;
+ }
+ sc.Forward();
+ break;
+ case SCE_T3_S_STRING:
+ chQuote = '\'';
+ endState = lineState&T3_INT_EXPRESSION ?
+ SCE_T3_X_DEFAULT : SCE_T3_DEFAULT;
+ break;
+ case SCE_T3_D_STRING:
+ chQuote = '"';
+ endState = SCE_T3_DEFAULT;
+ break;
+ case SCE_T3_X_STRING:
+ chQuote = '"';
+ endState = SCE_T3_X_DEFAULT;
+ break;
+ }
+ while (sc.More()) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ if (sc.ch == chQuote) {
+ sc.ForwardSetState(endState);
+ return;
+ }
+ if (sc.state == SCE_T3_D_STRING && sc.Match('<', '<')) {
+ lineState |= T3_INT_EXPRESSION;
+ sc.SetState(SCE_T3_X_DEFAULT);
+ sc.Forward(2);
+ return;
+ }
+ if (sc.Match('\\', static_cast<char>(chQuote))
+ || sc.Match('\\', '\\')) {
+ sc.Forward(2);
+ } else if (sc.ch == '{') {
+ ColouriseTADS3MsgParam(sc, lineState);
+ } else if (sc.Match('<', '.')) {
+ ColouriseTADS3LibDirective(sc, lineState);
+ } else if (sc.ch == '<') {
+ ColouriseTADS3HTMLTag(sc, lineState);
+ if (sc.state == SCE_T3_X_DEFAULT)
+ return;
+ } else {
+ sc.Forward();
+ }
+ }
+}
+
+static void ColouriseTADS3Comment(StyleContext &sc, int endState) {
+ sc.SetState(SCE_T3_BLOCK_COMMENT);
+ while (sc.More()) {
+ if (IsEOL(sc.ch, sc.chNext)) {
+ return;
+ }
+ if (sc.Match('*', '/')) {
+ sc.Forward(2);
+ sc.SetState(endState);
+ return;
+ }
+ sc.Forward();
+ }
+}
+
+static void ColouriseToEndOfLine(StyleContext &sc, int initState, int endState) {
+ sc.SetState(initState);
+ while (sc.More()) {
+ if (sc.ch == '\\') {
+ sc.Forward();
+ if (IsEOLSkip(sc)) {
+ return;
+ }
+ }
+ if (IsEOL(sc.ch, sc.chNext)) {
+ sc.SetState(endState);
+ return;
+ }
+ sc.Forward();
+ }
+}
+
+static void ColouriseTADS3Number(StyleContext &sc) {
+ int endState = sc.state;
+ bool inHexNumber = false;
+ bool seenE = false;
+ bool seenDot = sc.ch == '.';
+ sc.SetState(SCE_T3_NUMBER);
+ if (sc.More()) {
+ sc.Forward();
+ }
+ if (sc.chPrev == '0' && tolower(sc.ch) == 'x') {
+ inHexNumber = true;
+ sc.Forward();
+ }
+ while (sc.More()) {
+ if (inHexNumber) {
+ if (!IsAHexDigit(sc.ch)) {
+ break;
+ }
+ } else if (!isdigit(sc.ch)) {
+ if (!seenE && tolower(sc.ch) == 'e') {
+ seenE = true;
+ seenDot = true;
+ if (sc.chNext == '+' || sc.chNext == '-') {
+ sc.Forward();
+ }
+ } else if (!seenDot && sc.ch == '.') {
+ seenDot = true;
+ } else {
+ break;
+ }
+ }
+ sc.Forward();
+ }
+ sc.SetState(endState);
+}
+
+static void ColouriseTADS3Doc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ int visibleChars = 0;
+ int bracketLevel = 0;
+ int lineState = 0;
+ unsigned int endPos = startPos + length;
+ int lineCurrent = styler.GetLine(startPos);
+ if (lineCurrent > 0) {
+ lineState = styler.GetLineState(lineCurrent-1);
+ }
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+
+ if (IsEOL(sc.ch, sc.chNext)) {
+ styler.SetLineState(lineCurrent, lineState);
+ lineCurrent++;
+ visibleChars = 0;
+ sc.Forward();
+ if (sc.ch == '\n') {
+ sc.Forward();
+ }
+ }
+
+ switch(sc.state) {
+ case SCE_T3_PREPROCESSOR:
+ case SCE_T3_LINE_COMMENT:
+ ColouriseToEndOfLine(sc, sc.state, lineState&T3_INT_EXPRESSION ?
+ SCE_T3_X_DEFAULT : SCE_T3_DEFAULT);
+ break;
+ case SCE_T3_S_STRING:
+ case SCE_T3_D_STRING:
+ case SCE_T3_X_STRING:
+ ColouriseTADS3String(sc, lineState);
+ visibleChars++;
+ break;
+ case SCE_T3_MSG_PARAM:
+ ColouriseTADS3MsgParam(sc, lineState);
+ break;
+ case SCE_T3_LIB_DIRECTIVE:
+ ColouriseTADS3LibDirective(sc, lineState);
+ break;
+ case SCE_T3_HTML_DEFAULT:
+ ColouriseTADS3HTMLTag(sc, lineState);
+ break;
+ case SCE_T3_HTML_STRING:
+ ColouriseTADSHTMLString(sc, lineState);
+ break;
+ case SCE_T3_BLOCK_COMMENT:
+ ColouriseTADS3Comment(sc, lineState&T3_INT_EXPRESSION ?
+ SCE_T3_X_DEFAULT : SCE_T3_DEFAULT);
+ break;
+ case SCE_T3_DEFAULT:
+ case SCE_T3_X_DEFAULT:
+ if (IsASpaceOrTab(sc.ch)) {
+ sc.Forward();
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ ColouriseToEndOfLine(sc, SCE_T3_PREPROCESSOR, sc.state);
+ } else if (sc.Match('/', '*')) {
+ ColouriseTADS3Comment(sc, sc.state);
+ visibleChars++;
+ } else if (sc.Match('/', '/')) {
+ ColouriseToEndOfLine(sc, SCE_T3_LINE_COMMENT, sc.state);
+ } else if (sc.ch == '"') {
+ bracketLevel = 0;
+ ColouriseTADS3String(sc, lineState);
+ visibleChars++;
+ } else if (sc.ch == '\'') {
+ ColouriseTADS3String(sc, lineState);
+ visibleChars++;
+ } else if (sc.state == SCE_T3_X_DEFAULT && bracketLevel == 0
+ && sc.Match('>', '>')) {
+ sc.Forward(2);
+ sc.SetState(SCE_T3_D_STRING);
+ if (lineState & T3_INT_EXPRESSION_IN_TAG)
+ sc.SetState(SCE_T3_HTML_STRING);
+ lineState &= ~(T3_SINGLE_QUOTE|T3_INT_EXPRESSION
+ |T3_INT_EXPRESSION_IN_TAG);
+ } else if (IsATADS3Operator(sc.ch)) {
+ if (sc.state == SCE_T3_X_DEFAULT) {
+ if (sc.ch == '(') {
+ bracketLevel++;
+ } else if (sc.ch == ')' && bracketLevel > 0) {
+ bracketLevel--;
+ }
+ }
+ ColouriseTADS3Operator(sc);
+ visibleChars++;
+ } else if (IsANumberStart(sc)) {
+ ColouriseTADS3Number(sc);
+ visibleChars++;
+ } else if (IsAWordStart(sc.ch)) {
+ ColouriseTADS3Keyword(sc, keywordlists, endPos);
+ visibleChars++;
+ } else if (sc.Match("...")) {
+ sc.SetState(SCE_T3_IDENTIFIER);
+ sc.Forward(3);
+ sc.SetState(SCE_T3_DEFAULT);
+ } else {
+ sc.Forward();
+ visibleChars++;
+ }
+ break;
+ default:
+ sc.SetState(SCE_T3_DEFAULT);
+ sc.Forward();
+ }
+ }
+ sc.Complete();
+}
+
+/*
+ TADS3 has two styles of top level block (TLB). Eg
+
+ // default style
+ silverKey : Key 'small silver key' 'small silver key'
+ "A small key glints in the sunlight. "
+ ;
+
+ and
+
+ silverKey : Key {
+ 'small silver key'
+ 'small silver key'
+ "A small key glints in the sunlight. "
+ }
+
+ Some constructs mandate one or the other, but usually the author has may choose
+ either.
+
+ T3_SEENSTART is used to indicate that a braceless TLB has been (potentially)
+ seen and is also used to match the closing ';' of the default style.
+
+ T3_EXPECTINGIDENTIFIER and T3_EXPECTINGPUNCTUATION are used to keep track of
+ what characters may be seen without incrementing the block level. The general
+ pattern is identifier <punc> identifier, acceptable punctuation characters
+ are ':', ',', '(' and ')'. No attempt is made to ensure that punctuation
+ characters are syntactically correct, eg parentheses match. A ')' always
+ signifies the start of a block. We just need to check if it is followed by a
+ '{', in which case we let the brace handling code handle the folding level.
+
+ expectingIdentifier == false && expectingIdentifier == false
+ Before the start of a TLB.
+
+ expectingIdentifier == true && expectingIdentifier == true
+ Currently in an identifier. Will accept identifier or punctuation.
+
+ expectingIdentifier == true && expectingIdentifier == false
+ Just seen a punctuation character & now waiting for an identifier to start.
+
+ expectingIdentifier == false && expectingIdentifier == truee
+ We were in an identifier and have seen space. Now waiting to see a punctuation
+ character
+
+ Space, comments & preprocessor directives are always acceptable and are
+ equivalent.
+*/
+
+static const int T3_SEENSTART = 1 << 12;
+static const int T3_EXPECTINGIDENTIFIER = 1 << 13;
+static const int T3_EXPECTINGPUNCTUATION = 1 << 14;
+
+static inline bool IsStringTransition(int s1, int s2) {
+ return s1 != s2
+ && (s1 == SCE_T3_S_STRING || s1 == SCE_T3_X_STRING
+ || (s1 == SCE_T3_D_STRING && s2 != SCE_T3_X_DEFAULT))
+ && s2 != SCE_T3_LIB_DIRECTIVE
+ && s2 != SCE_T3_MSG_PARAM
+ && s2 != SCE_T3_HTML_TAG
+ && s2 != SCE_T3_HTML_STRING;
+}
+
+static inline bool IsATADS3Punctuation(const int ch) {
+ return ch == ':' || ch == ',' || ch == '(' || ch == ')';
+}
+
+static inline bool IsAnIdentifier(const int style) {
+ return style == SCE_T3_IDENTIFIER
+ || style == SCE_T3_USER1
+ || style == SCE_T3_USER2
+ || style == SCE_T3_USER3;
+}
+
+static inline bool IsAnOperator(const int style) {
+ return style == SCE_T3_OPERATOR || style == SCE_T3_BRACE;
+}
+
+static inline bool IsSpaceEquivalent(const int ch, const int style) {
+ return isspace(ch)
+ || style == SCE_T3_BLOCK_COMMENT
+ || style == SCE_T3_LINE_COMMENT
+ || style == SCE_T3_PREPROCESSOR;
+}
+
+static char peekAhead(unsigned int startPos, unsigned int endPos,
+ Accessor &styler) {
+ for (unsigned int i = startPos; i < endPos; i++) {
+ int style = styler.StyleAt(i);
+ char ch = styler[i];
+ if (!IsSpaceEquivalent(ch, style)) {
+ if (IsAnIdentifier(style)) {
+ return 'a';
+ }
+ if (IsATADS3Punctuation(ch)) {
+ return ':';
+ }
+ if (ch == '{') {
+ return '{';
+ }
+ return '*';
+ }
+ }
+ return ' ';
+}
+
+static void FoldTADS3Doc(unsigned int startPos, int length, int initStyle,
+ WordList *[], Accessor &styler) {
+ unsigned int endPos = startPos + length;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int seenStart = levelCurrent & T3_SEENSTART;
+ int expectingIdentifier = levelCurrent & T3_EXPECTINGIDENTIFIER;
+ int expectingPunctuation = levelCurrent & T3_EXPECTINGPUNCTUATION;
+ levelCurrent &= SC_FOLDLEVELNUMBERMASK;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ char ch = chNext;
+ int stylePrev = style;
+ bool redo = false;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ if (redo) {
+ redo = false;
+ i--;
+ } else {
+ ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ }
+ bool atEOL = IsEOL(ch, chNext);
+
+ if (levelNext == SC_FOLDLEVELBASE) {
+ if (IsSpaceEquivalent(ch, style)) {
+ if (expectingPunctuation) {
+ expectingIdentifier = 0;
+ }
+ if (style == SCE_T3_BLOCK_COMMENT) {
+ levelNext++;
+ }
+ } else if (ch == '{') {
+ levelNext++;
+ seenStart = 0;
+ } else if (ch == '\'' || ch == '"' || ch == '[') {
+ levelNext++;
+ if (seenStart) {
+ redo = true;
+ }
+ } else if (ch == ';') {
+ seenStart = 0;
+ expectingIdentifier = 0;
+ expectingPunctuation = 0;
+ } else if (expectingIdentifier && expectingPunctuation) {
+ if (IsATADS3Punctuation(ch)) {
+ if (ch == ')' && peekAhead(i+1, endPos, styler) != '{') {
+ levelNext++;
+ } else {
+ expectingPunctuation = 0;
+ }
+ } else if (!IsAnIdentifier(style)) {
+ levelNext++;
+ }
+ } else if (expectingIdentifier && !expectingPunctuation) {
+ if (!IsAnIdentifier(style)) {
+ levelNext++;
+ } else {
+ expectingPunctuation = T3_EXPECTINGPUNCTUATION;
+ }
+ } else if (!expectingIdentifier && expectingPunctuation) {
+ if (!IsATADS3Punctuation(ch)) {
+ levelNext++;
+ } else {
+ if (ch == ')' && peekAhead(i+1, endPos, styler) != '{') {
+ levelNext++;
+ } else {
+ expectingIdentifier = T3_EXPECTINGIDENTIFIER;
+ expectingPunctuation = 0;
+ }
+ }
+ } else if (!expectingIdentifier && !expectingPunctuation) {
+ if (IsAnIdentifier(style)) {
+ seenStart = T3_SEENSTART;
+ expectingIdentifier = T3_EXPECTINGIDENTIFIER;
+ expectingPunctuation = T3_EXPECTINGPUNCTUATION;
+ }
+ }
+
+ if (levelNext != SC_FOLDLEVELBASE && style != SCE_T3_BLOCK_COMMENT) {
+ expectingIdentifier = 0;
+ expectingPunctuation = 0;
+ }
+
+ } else if (levelNext == SC_FOLDLEVELBASE+1 && seenStart
+ && ch == ';' && IsAnOperator(style)) {
+ levelNext--;
+ seenStart = 0;
+ } else if (style == SCE_T3_BLOCK_COMMENT) {
+ if (stylePrev != SCE_T3_BLOCK_COMMENT) {
+ levelNext++;
+ } else if (styleNext != SCE_T3_BLOCK_COMMENT && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ } else if (ch == '\'' || ch == '"') {
+ if (IsStringTransition(style, stylePrev)) {
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (IsStringTransition(style, styleNext)) {
+ levelNext--;
+ }
+ } else if (IsAnOperator(style)) {
+ if (ch == '{' || ch == '[') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}' || ch == ']') {
+ levelNext--;
+ }
+ }
+
+ if (atEOL) {
+ if (seenStart && levelNext == SC_FOLDLEVELBASE) {
+ switch (peekAhead(i+1, endPos, styler)) {
+ case ' ':
+ case '{':
+ break;
+ case '*':
+ levelNext++;
+ break;
+ case 'a':
+ if (expectingPunctuation) {
+ levelNext++;
+ }
+ break;
+ case ':':
+ if (expectingIdentifier) {
+ levelNext++;
+ }
+ break;
+ }
+ if (levelNext != SC_FOLDLEVELBASE) {
+ expectingIdentifier = 0;
+ expectingPunctuation = 0;
+ }
+ }
+ int lev = levelMinCurrent | (levelNext | expectingIdentifier
+ | expectingPunctuation | seenStart) << 16;
+ if (levelMinCurrent < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ }
+ }
+}
+
+static const char * const tads3WordList[] = {
+ "TADS3 Keywords",
+ "User defined 1",
+ "User defined 2",
+ "User defined 3",
+ 0
+};
+
+LexerModule lmTADS3(SCLEX_TADS3, ColouriseTADS3Doc, "tads3", FoldTADS3Doc, tads3WordList);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTAL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTAL.cxx
new file mode 100644
index 00000000000..15dc7410ce1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTAL.cxx
@@ -0,0 +1,399 @@
+// Scintilla source code edit control
+/** @file LexTAL.cxx
+ ** Lexer for TAL
+ ** Based on LexPascal.cxx
+ ** Written by Laurent le Tynevez
+ ** Updated by Simon Steele <s.steele@pnotepad.org> September 2002
+ ** Updated by Mathias Rauen <scite@madshi.net> May 2003 (Delphi adjustments)
+ ** Updated by Rod Falck, Aug 2006 Converted to TAL
+ **/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+inline bool isTALoperator(char ch)
+ {
+ return ch == '\'' || ch == '@' || ch == '#' || isoperator(ch);
+ }
+
+inline bool isTALwordchar(char ch)
+ {
+ return ch == '$' || ch == '^' || iswordchar(ch);
+ }
+
+inline bool isTALwordstart(char ch)
+ {
+ return ch == '$' || ch == '^' || iswordstart(ch);
+ }
+
+static void getRange(unsigned int start,
+ unsigned int end,
+ Accessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_C_COMMENT ||
+ style == SCE_C_COMMENTDOC ||
+ style == SCE_C_COMMENTDOCKEYWORD ||
+ style == SCE_C_COMMENTDOCKEYWORDERROR;
+}
+
+static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) {
+ if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) {
+ styler.ColourTo(end, SCE_C_REGEX);
+ } else
+ styler.ColourTo(end, attr);
+}
+
+// returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm"
+static int classifyWordTAL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInAsm) {
+ int ret = 0;
+
+ WordList& keywords = *keywordlists[0];
+ WordList& builtins = *keywordlists[1];
+ WordList& nonreserved_keywords = *keywordlists[2];
+
+ char s[100];
+ getRange(start, end, styler, s, sizeof(s));
+
+ char chAttr = SCE_C_IDENTIFIER;
+ if (isdigit(s[0]) || (s[0] == '.')) {
+ chAttr = SCE_C_NUMBER;
+ }
+ else {
+ if (keywords.InList(s)) {
+ chAttr = SCE_C_WORD;
+
+ if (strcmp(s, "asm") == 0) {
+ ret = 2;
+ }
+ else if (strcmp(s, "end") == 0) {
+ ret = -1;
+ }
+ }
+ else if (s[0] == '$' || builtins.InList(s)) {
+ chAttr = SCE_C_WORD2;
+ }
+ else if (nonreserved_keywords.InList(s)) {
+ chAttr = SCE_C_UUID;
+ }
+ }
+ ColourTo(styler, end, chAttr, (bInAsm && ret != -1));
+ return ret;
+}
+
+static int classifyFoldPointTAL(const char* s) {
+ int lev = 0;
+ if (!(isdigit(s[0]) || (s[0] == '.'))) {
+ if (strcmp(s, "begin") == 0 ||
+ strcmp(s, "block") == 0) {
+ lev=1;
+ } else if (strcmp(s, "end") == 0) {
+ lev=-1;
+ }
+ }
+ return lev;
+}
+
+static void ColouriseTALDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+ Accessor &styler) {
+
+ styler.StartAt(startPos);
+
+ int state = initStyle;
+ if (state == SCE_C_CHARACTER) // Does not leak onto next line
+ state = SCE_C_DEFAULT;
+ char chPrev = ' ';
+ char chNext = styler[startPos];
+ unsigned int lengthDoc = startPos + length;
+
+ bool bInClassDefinition;
+
+ int currentLine = styler.GetLine(startPos);
+ if (currentLine > 0) {
+ styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
+ bInClassDefinition = (styler.GetLineState(currentLine) == 1);
+ } else {
+ styler.SetLineState(currentLine, 0);
+ bInClassDefinition = false;
+ }
+
+ bool bInAsm = (state == SCE_C_REGEX);
+ if (bInAsm)
+ state = SCE_C_DEFAULT;
+
+ styler.StartSegment(startPos);
+ int visibleChars = 0;
+ for (unsigned int i = startPos; i < lengthDoc; i++) {
+ char ch = chNext;
+
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
+ // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
+ // Avoid triggering two times on Dos/Win
+ // End of line
+ if (state == SCE_C_CHARACTER) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ visibleChars = 0;
+ currentLine++;
+ styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0));
+ }
+
+ if (styler.IsLeadByte(ch)) {
+ chNext = styler.SafeGetCharAt(i + 2);
+ chPrev = ' ';
+ i += 1;
+ continue;
+ }
+
+ if (state == SCE_C_DEFAULT) {
+ if (isTALwordstart(ch)) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_IDENTIFIER;
+ } else if (ch == '!' && chNext != '*') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENT;
+ } else if (ch == '!' && chNext == '*') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTDOC;
+ } else if (ch == '-' && chNext == '-') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '"') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_STRING;
+ } else if (ch == '?' && visibleChars == 0) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_PREPROCESSOR;
+ } else if (isTALoperator(ch)) {
+ ColourTo(styler, i-1, state, bInAsm);
+ ColourTo(styler, i, SCE_C_OPERATOR, bInAsm);
+ }
+ } else if (state == SCE_C_IDENTIFIER) {
+ if (!isTALwordchar(ch)) {
+ int lStateChange = classifyWordTAL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm);
+
+ if(lStateChange == 1) {
+ styler.SetLineState(currentLine, 1);
+ bInClassDefinition = true;
+ } else if(lStateChange == 2) {
+ bInAsm = true;
+ } else if(lStateChange == -1) {
+ styler.SetLineState(currentLine, 0);
+ bInClassDefinition = false;
+ bInAsm = false;
+ }
+
+ state = SCE_C_DEFAULT;
+ chNext = styler.SafeGetCharAt(i + 1);
+ if (ch == '!' && chNext != '*') {
+ state = SCE_C_COMMENT;
+ } else if (ch == '!' && chNext == '*') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_COMMENTDOC;
+ } else if (ch == '-' && chNext == '-') {
+ state = SCE_C_COMMENTLINE;
+ } else if (ch == '"') {
+ state = SCE_C_STRING;
+ } else if (isTALoperator(ch)) {
+ ColourTo(styler, i, SCE_C_OPERATOR, bInAsm);
+ }
+ }
+ } else {
+ if (state == SCE_C_PREPROCESSOR) {
+ if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENT) {
+ if (ch == '!' || (ch == '\r' || ch == '\n') ) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_COMMENTDOC) {
+ if (ch == '!' || (ch == '\r' || ch == '\n')) {
+ if (((i > styler.GetStartSegment() + 2) || (
+ (initStyle == SCE_C_COMMENTDOC) &&
+ (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ } else if (state == SCE_C_COMMENTLINE) {
+ if (ch == '\r' || ch == '\n') {
+ ColourTo(styler, i-1, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ } else if (state == SCE_C_STRING) {
+ if (ch == '"') {
+ ColourTo(styler, i, state, bInAsm);
+ state = SCE_C_DEFAULT;
+ }
+ }
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ chPrev = ch;
+ }
+ ColourTo(styler, lengthDoc - 1, state, bInAsm);
+}
+
+static void FoldTALDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ bool was_end = false;
+ bool section = false;
+
+ int lastStart = 0;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (stylePrev == SCE_C_DEFAULT && (style == SCE_C_WORD || style == SCE_C_UUID || style == SCE_C_PREPROCESSOR))
+ {
+ // Store last word start point.
+ lastStart = i;
+ }
+
+ if (stylePrev == SCE_C_WORD || style == SCE_C_UUID || stylePrev == SCE_C_PREPROCESSOR) {
+ if(isTALwordchar(ch) && !isTALwordchar(chNext)) {
+ char s[100];
+ getRange(lastStart, i, styler, s, sizeof(s));
+ if (stylePrev == SCE_C_PREPROCESSOR && strcmp(s, "?section") == 0)
+ {
+ section = true;
+ levelCurrent = 1;
+ levelPrev = 0;
+ }
+ else if (stylePrev == SCE_C_WORD || stylePrev == SCE_C_UUID)
+ {
+ if (strcmp(s, "block") == 0)
+ {
+ // block keyword is ignored immediately after end keyword
+ if (!was_end)
+ levelCurrent++;
+ }
+ else
+ levelCurrent += classifyFoldPointTAL(s);
+ if (strcmp(s, "end") == 0)
+ {
+ was_end = true;
+ }
+ else
+ {
+ was_end = false;
+ }
+ }
+ }
+ }
+
+ if (foldComment && (style == SCE_C_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelCurrent++;
+ } else if (chNext2 == '}') {
+ levelCurrent--;
+ }
+ }
+ }
+
+ if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) {
+ if (ch == '{' && chNext == '$') {
+ unsigned int j=i+2; // skip {$
+ while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "region") || styler.Match(j, "if")) {
+ levelCurrent++;
+ } else if (styler.Match(j, "end")) {
+ levelCurrent--;
+ }
+ }
+ }
+
+ if (foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelCurrent++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev | SC_FOLDLEVELBASE;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev || section) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ section = false;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const TALWordListDesc[] = {
+ "Keywords",
+ "Builtins",
+ 0
+};
+
+LexerModule lmTAL(SCLEX_TAL, ColouriseTALDoc, "TAL", FoldTALDoc, TALWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCL.cxx
new file mode 100644
index 00000000000..dfcab54ea6b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCL.cxx
@@ -0,0 +1,369 @@
+// Scintilla source code edit control
+/** @file LexTCL.cxx
+ ** Lexer for TCL language.
+ **/
+// Copyright 1998-2001 by Andre Arpin <arpin@kingston.net>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Extended to accept accented characters
+static inline bool IsAWordChar(int ch) {
+ return ch >= 0x80 ||
+ (isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator
+}
+
+static inline bool IsAWordStart(int ch) {
+ return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_');
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (IsADigit(ch, 0x10) || toupper(ch) == 'E' ||
+ ch == '.' || ch == '-' || ch == '+');
+}
+
+static void ColouriseTCLDoc(unsigned int startPos, int length, int , WordList *keywordlists[], Accessor &styler) {
+#define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT)
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool commentLevel = false;
+ bool subBrace = false; // substitution begin with a brace ${.....}
+ enum tLineState {LS_DEFAULT, LS_OPEN_COMMENT, LS_OPEN_DOUBLE_QUOTE, LS_COMMENT_BOX, LS_MASK_STATE = 0xf,
+ LS_COMMAND_EXPECTED = 16, LS_BRACE_ONLY = 32
+ } lineState = LS_DEFAULT;
+ bool prevSlash = false;
+ int currentLevel = 0;
+ bool expected = 0;
+ bool subParen = 0;
+
+ int currentLine = styler.GetLine(startPos);
+ if (currentLine > 0)
+ currentLine--;
+ length += startPos - styler.LineStart(currentLine);
+ // make sure lines overlap
+ startPos = styler.LineStart(currentLine);
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+ WordList &keywords5 = *keywordlists[4];
+ WordList &keywords6 = *keywordlists[5];
+ WordList &keywords7 = *keywordlists[6];
+ WordList &keywords8 = *keywordlists[7];
+ WordList &keywords9 = *keywordlists[8];
+
+ if (currentLine > 0) {
+ int ls = styler.GetLineState(currentLine - 1);
+ lineState = tLineState(ls & LS_MASK_STATE);
+ expected = LS_COMMAND_EXPECTED == tLineState(ls & LS_COMMAND_EXPECTED);
+ subBrace = LS_BRACE_ONLY == tLineState(ls & LS_BRACE_ONLY);
+ currentLevel = styler.LevelAt(currentLine - 1) >> 17;
+ commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1;
+ } else
+ styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG);
+ bool visibleChars = false;
+
+ int previousLevel = currentLevel;
+ StyleContext sc(startPos, length, SCE_TCL_DEFAULT, styler);
+ for (; ; sc.Forward()) {
+next:
+ if (sc.ch=='\r' && sc.chNext == '\n') // only ignore \r on PC process on the mac
+ continue;
+ bool atEnd = !sc.More(); // make sure we coloured the last word
+ if (lineState != LS_DEFAULT) {
+ sc.SetState(SCE_TCL_DEFAULT);
+ if (lineState == LS_OPEN_COMMENT)
+ sc.SetState(SCE_TCL_COMMENTLINE);
+ else if (lineState == LS_OPEN_DOUBLE_QUOTE)
+ sc.SetState(SCE_TCL_IN_QUOTE);
+ else if (lineState == LS_COMMENT_BOX && (sc.ch == '#' || (sc.ch == ' ' && sc.chNext=='#')))
+ sc.SetState(SCE_TCL_COMMENT_BOX);
+ lineState = LS_DEFAULT;
+ }
+ if (subBrace) { // ${ overrides every thing even \ except }
+ if (sc.ch == '}') {
+ subBrace = false;
+ sc.SetState(SCE_TCL_OPERATOR);
+ sc.ForwardSetState(SCE_TCL_DEFAULT);
+ goto next;
+ } else
+ sc.SetState(SCE_TCL_SUB_BRACE);
+ if (!sc.atLineEnd)
+ continue;
+ } else if (sc.state == SCE_TCL_DEFAULT || sc.state ==SCE_TCL_OPERATOR) {
+ expected &= isspacechar(static_cast<unsigned char>(sc.ch)) || IsAWordStart(sc.ch) || sc.ch =='#';
+ } else if (sc.state == SCE_TCL_SUBSTITUTION) {
+ switch (sc.ch) {
+ case '(':
+ subParen=true;
+ sc.SetState(SCE_TCL_OPERATOR);
+ sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
+ continue;
+ case ')':
+ sc.SetState(SCE_TCL_OPERATOR);
+ subParen=false;
+ continue;
+ case '$':
+ continue;
+ case ',':
+ sc.SetState(SCE_TCL_OPERATOR);
+ if (subParen)
+ sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
+ continue;
+ default :
+ // maybe spaces should be allowed ???
+ if (!IsAWordChar(sc.ch)) { // probably the code is wrong
+ sc.SetState(SCE_TCL_DEFAULT);
+ subParen = 0;
+ }
+ break;
+ }
+ } else if (isComment(sc.state)) {
+ } else if (!IsAWordChar(sc.ch)) {
+ if ((sc.state == SCE_TCL_IDENTIFIER && expected) || sc.state == SCE_TCL_MODIFIER) {
+ char w[100];
+ char *s=w;
+ sc.GetCurrent(w, sizeof(w));
+ if (w[strlen(w)-1]=='\r')
+ w[strlen(w)-1]=0;
+ while (*s == ':') // ignore leading : like in ::set a 10
+ ++s;
+ bool quote = sc.state == SCE_TCL_IN_QUOTE;
+ if (commentLevel || expected) {
+ if (keywords.InList(s)) {
+ sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD4);
+ } else if (sc.GetRelative(-static_cast<int>(strlen(s))-1) == '{' &&
+ keywords5.InList(s) && sc.ch == '}') { // {keyword} exactly no spaces
+ sc.ChangeState(SCE_TCL_EXPAND);
+ }
+ if (keywords6.InList(s)) {
+ sc.ChangeState(SCE_TCL_WORD5);
+ } else if (keywords7.InList(s)) {
+ sc.ChangeState(SCE_TCL_WORD6);
+ } else if (keywords8.InList(s)) {
+ sc.ChangeState(SCE_TCL_WORD7);
+ } else if (keywords9.InList(s)) {
+ sc.ChangeState(SCE_TCL_WORD8);
+ }
+ }
+ expected = false;
+ sc.SetState(quote ? SCE_TCL_IN_QUOTE : SCE_TCL_DEFAULT);
+ } else if (sc.state == SCE_TCL_MODIFIER || sc.state == SCE_TCL_IDENTIFIER) {
+ sc.SetState(SCE_TCL_DEFAULT);
+ }
+ }
+ if (atEnd)
+ break;
+ if (sc.atLineEnd) {
+ lineState = LS_DEFAULT;
+ currentLine = styler.GetLine(sc.currentPos);
+ if (foldComment && sc.state!=SCE_TCL_COMMENT && isComment(sc.state)) {
+ if (currentLevel == 0) {
+ ++currentLevel;
+ commentLevel = true;
+ }
+ } else {
+ if (visibleChars && commentLevel) {
+ --currentLevel;
+ --previousLevel;
+ commentLevel = false;
+ }
+ }
+ int flag = 0;
+ if (!visibleChars)
+ flag = SC_FOLDLEVELWHITEFLAG;
+ if (currentLevel > previousLevel)
+ flag = SC_FOLDLEVELHEADERFLAG;
+ styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16));
+
+ // Update the line state, so it can be seen by next line
+ if (sc.state == SCE_TCL_IN_QUOTE) {
+ lineState = LS_OPEN_DOUBLE_QUOTE;
+ } else {
+ if (prevSlash) {
+ if (isComment(sc.state))
+ lineState = LS_OPEN_COMMENT;
+ } else if (sc.state == SCE_TCL_COMMENT_BOX)
+ lineState = LS_COMMENT_BOX;
+ }
+ styler.SetLineState(currentLine,
+ (subBrace ? LS_BRACE_ONLY : 0) |
+ (expected ? LS_COMMAND_EXPECTED : 0) | lineState);
+ if (lineState == LS_COMMENT_BOX)
+ sc.ForwardSetState(SCE_TCL_COMMENT_BOX);
+ else if (lineState == LS_OPEN_DOUBLE_QUOTE)
+ sc.ForwardSetState(SCE_TCL_IN_QUOTE);
+ else
+ sc.ForwardSetState(SCE_TCL_DEFAULT);
+ prevSlash = false;
+ previousLevel = currentLevel;
+ goto next;
+ }
+
+ if (prevSlash) {
+ prevSlash = false;
+ if (sc.ch == '#' && IsANumberChar(sc.chNext))
+ sc.ForwardSetState(SCE_TCL_NUMBER);
+ continue;
+ }
+ prevSlash = sc.ch == '\\';
+ if (isComment(sc.state))
+ continue;
+ if (sc.atLineStart) {
+ visibleChars = false;
+ if (sc.state!=SCE_TCL_IN_QUOTE && !isComment(sc.state))
+ {
+ sc.SetState(SCE_TCL_DEFAULT);
+ expected = IsAWordStart(sc.ch)|| isspacechar(static_cast<unsigned char>(sc.ch));
+ }
+ }
+
+ switch (sc.state) {
+ case SCE_TCL_NUMBER:
+ if (!IsANumberChar(sc.ch))
+ sc.SetState(SCE_TCL_DEFAULT);
+ break;
+ case SCE_TCL_IN_QUOTE:
+ if (sc.ch == '"') {
+ sc.ForwardSetState(SCE_TCL_DEFAULT);
+ visibleChars = true; // necessary if a " is the first and only character on a line
+ goto next;
+ } else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$') {
+ sc.SetState(SCE_TCL_OPERATOR);
+ expected = sc.ch == '[';
+ sc.ForwardSetState(SCE_TCL_IN_QUOTE);
+ goto next;
+ }
+ continue;
+ case SCE_TCL_OPERATOR:
+ sc.SetState(SCE_TCL_DEFAULT);
+ break;
+ }
+
+ if (sc.ch == '#') {
+ if (visibleChars) {
+ if (sc.state != SCE_TCL_IN_QUOTE && expected)
+ sc.SetState(SCE_TCL_COMMENT);
+ } else {
+ sc.SetState(SCE_TCL_COMMENTLINE);
+ if (sc.chNext == '~')
+ sc.SetState(SCE_TCL_BLOCK_COMMENT);
+ if (sc.atLineStart && (sc.chNext == '#' || sc.chNext == '-'))
+ sc.SetState(SCE_TCL_COMMENT_BOX);
+ }
+ }
+
+ if (!isspacechar(static_cast<unsigned char>(sc.ch))) {
+ visibleChars = true;
+ }
+
+ if (sc.ch == '\\') {
+ prevSlash = true;
+ continue;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_TCL_DEFAULT) {
+ if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_TCL_IDENTIFIER);
+ } else if (IsADigit(sc.ch) && !IsAWordChar(sc.chPrev)) {
+ sc.SetState(SCE_TCL_NUMBER);
+ } else {
+ switch (sc.ch) {
+ case '\"':
+ sc.SetState(SCE_TCL_IN_QUOTE);
+ break;
+ case '{':
+ sc.SetState(SCE_TCL_OPERATOR);
+ expected = true;
+ ++currentLevel;
+ break;
+ case '}':
+ sc.SetState(SCE_TCL_OPERATOR);
+ expected = true;
+ --currentLevel;
+ break;
+ case '[':
+ expected = true;
+ case ']':
+ case '(':
+ case ')':
+ sc.SetState(SCE_TCL_OPERATOR);
+ break;
+ case ';':
+ expected = true;
+ break;
+ case '$':
+ subParen = 0;
+ if (sc.chNext != '{') {
+ sc.SetState(SCE_TCL_SUBSTITUTION);
+ } else {
+ sc.SetState(SCE_TCL_OPERATOR); // $
+ sc.Forward(); // {
+ sc.ForwardSetState(SCE_TCL_SUB_BRACE);
+ subBrace = true;
+ }
+ break;
+ case '#':
+ if ((isspacechar(static_cast<unsigned char>(sc.chPrev))||
+ isoperator(static_cast<char>(sc.chPrev))) && IsADigit(sc.chNext,0x10))
+ sc.SetState(SCE_TCL_NUMBER);
+ break;
+ case '-':
+ sc.SetState(IsADigit(sc.chNext)? SCE_TCL_NUMBER: SCE_TCL_MODIFIER);
+ break;
+ default:
+ if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_TCL_OPERATOR);
+ }
+ }
+ }
+ }
+ }
+ sc.Complete();
+}
+
+static const char *const tclWordListDesc[] = {
+ "TCL Keywords",
+ "TK Keywords",
+ "iTCL Keywords",
+ "tkCommands",
+ "expand",
+ "user1",
+ "user2",
+ "user3",
+ "user4",
+ 0
+};
+
+// this code supports folding in the colourizer
+LexerModule lmTCL(SCLEX_TCL, ColouriseTCLDoc, "tcl", 0, tclWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCMD.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCMD.cxx
new file mode 100644
index 00000000000..9da76054212
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTCMD.cxx
@@ -0,0 +1,506 @@
+// Scintilla\ source code edit control
+/** @file LexTCMD.cxx
+ ** Lexer for Take Command / TCC batch scripts (.bat, .btm, .cmd).
+ **/
+// Written by Rex Conn (rconn [at] jpsoft [dot] com)
+// based on the CMD lexer
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+static bool IsAlphabetic(int ch) {
+ return IsASCII(ch) && isalpha(ch);
+}
+
+static inline bool AtEOL(Accessor &styler, unsigned int i) {
+ return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n'));
+}
+
+// Tests for BATCH Operators
+static bool IsBOperator(char ch) {
+ return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '&') || (ch == '!') || (ch == '?') || (ch == '*') || (ch == '(') || (ch == ')');
+}
+
+// Tests for BATCH Separators
+static bool IsBSeparator(char ch) {
+ return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == ' ') || (ch == '\t') || (ch == '[') || (ch == ']') || (ch == '\"') || (ch == '\'') || (ch == '/');
+}
+
+// Find length of CMD FOR variable with modifier (%~...) or return 0
+static unsigned int GetBatchVarLen( char *wordBuffer )
+{
+ int nLength = 0;
+ if ( wordBuffer[0] == '%' ) {
+
+ if ( wordBuffer[1] == '~' )
+ nLength = 2;
+ else if (( wordBuffer[1] == '%' ) && ( wordBuffer[2] == '~' ))
+ nLength++;
+ else
+ return 0;
+
+ for ( ; ( wordBuffer[nLength] ); nLength++ ) {
+
+ switch ( toupper(wordBuffer[nLength]) ) {
+ case 'A':
+ // file attributes
+ case 'D':
+ // drive letter only
+ case 'F':
+ // fully qualified path name
+ case 'N':
+ // filename only
+ case 'P':
+ // path only
+ case 'S':
+ // short name
+ case 'T':
+ // date / time of file
+ case 'X':
+ // file extension only
+ case 'Z':
+ // file size
+ break;
+ default:
+ return nLength;
+ }
+ }
+ }
+
+ return nLength;
+}
+
+
+static void ColouriseTCMDLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList *keywordlists[], Accessor &styler)
+{
+ unsigned int offset = 0; // Line Buffer Offset
+ char wordBuffer[260]; // Word Buffer - large to catch long paths
+ unsigned int wbl; // Word Buffer Length
+ unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length
+ WordList &keywords = *keywordlists[0]; // Internal Commands
+// WordList &keywords2 = *keywordlists[1]; // Aliases (optional)
+ bool isDelayedExpansion = 1; // !var!
+
+ bool continueProcessing = true; // Used to toggle Regular Keyword Checking
+ // Special Keywords are those that allow certain characters without whitespace after the command
+ // Examples are: cd. cd\ echo: echo. path=
+ bool inString = false; // Used for processing while ""
+ // Special Keyword Buffer used to determine if the first n characters is a Keyword
+ char sKeywordBuffer[260] = ""; // Special Keyword Buffer
+ bool sKeywordFound; // Exit Special Keyword for-loop if found
+
+ // Skip leading whitespace
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT);
+
+ if ( offset >= lengthLine )
+ return;
+
+ // Check for Fake Label (Comment) or Real Label - return if found
+ if (lineBuffer[offset] == ':') {
+ if (lineBuffer[offset + 1] == ':') {
+ // Colorize Fake Label (Comment) - :: is the same as REM
+ styler.ColourTo(endPos, SCE_TCMD_COMMENT);
+ } else {
+ // Colorize Real Label
+ styler.ColourTo(endPos, SCE_TCMD_LABEL);
+ }
+ return;
+
+ // Check for Comment - return if found
+ } else if (( CompareNCaseInsensitive(lineBuffer+offset, "rem", 3) == 0 ) && (( lineBuffer[offset+3] == 0 ) || ( isspace(lineBuffer[offset+3] )))) {
+ styler.ColourTo(endPos, SCE_TCMD_COMMENT);
+ return;
+
+ // Check for Drive Change (Drive Change is internal command) - return if found
+ } else if ((IsAlphabetic(lineBuffer[offset])) &&
+ (lineBuffer[offset + 1] == ':') &&
+ ((isspacechar(lineBuffer[offset + 2])) ||
+ (((lineBuffer[offset + 2] == '\\')) &&
+ (isspacechar(lineBuffer[offset + 3]))))) {
+ // Colorize Regular Keyword
+ styler.ColourTo(endPos, SCE_TCMD_WORD);
+ return;
+ }
+
+ // Check for Hide Command (@ECHO OFF/ON)
+ if (lineBuffer[offset] == '@') {
+ styler.ColourTo(startLine + offset, SCE_TCMD_HIDE);
+ offset++;
+ }
+ // Skip whitespace
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+
+ // Read remainder of line word-at-a-time or remainder-of-word-at-a-time
+ while (offset < lengthLine) {
+ if (offset > startLine) {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT);
+ }
+ // Copy word from Line Buffer into Word Buffer
+ wbl = 0;
+ for (; offset < lengthLine && ( wbl < 260 ) && !isspacechar(lineBuffer[offset]); wbl++, offset++) {
+ wordBuffer[wbl] = static_cast<char>(tolower(lineBuffer[offset]));
+ }
+ wordBuffer[wbl] = '\0';
+ wbo = 0;
+
+ // Check for Separator
+ if (IsBSeparator(wordBuffer[0])) {
+
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
+
+ if (wordBuffer[0] == '"')
+ inString = !inString;
+
+ // Check for Regular expression
+ } else if (( wordBuffer[0] == ':' ) && ( wordBuffer[1] == ':' ) && (continueProcessing)) {
+
+ // Colorize Regular exoressuin
+ styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT);
+ // No need to Reset Offset
+
+ // Check for Labels in text (... :label)
+ } else if (wordBuffer[0] == ':' && isspacechar(lineBuffer[offset - wbl - 1])) {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT);
+ // Colorize Label
+ styler.ColourTo(startLine + offset - 1, SCE_TCMD_CLABEL);
+ // No need to Reset Offset
+ // Check for delayed expansion Variable (!x...!)
+ } else if (isDelayedExpansion && wordBuffer[0] == '!') {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT);
+ wbo++;
+ // Search to end of word for second !
+ while ((wbo < wbl) && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ if (wordBuffer[wbo] == '!') {
+ wbo++;
+ // Colorize Environment Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_EXPANSION);
+ } else {
+ wbo = 1;
+ // Colorize Symbol
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT);
+ }
+
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+
+ // Check for Regular Keyword in list
+ } else if ((keywords.InList(wordBuffer)) && (!inString) && (continueProcessing)) {
+
+ // ECHO, PATH, and PROMPT require no further Regular Keyword Checking
+ if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "path") == 0) ||
+ (CompareCaseInsensitive(wordBuffer, "prompt") == 0)) {
+ continueProcessing = false;
+ }
+
+ // Colorize Regular keyword
+ styler.ColourTo(startLine + offset - 1, SCE_TCMD_WORD);
+ // No need to Reset Offset
+
+ } else if ((wordBuffer[0] != '%') && (wordBuffer[0] != '!') && (!IsBOperator(wordBuffer[0])) && (!inString) && (continueProcessing)) {
+
+ // a few commands accept "illegal" syntax -- cd\, echo., etc.
+ sscanf( wordBuffer, "%[^.<>|&=\\/]", sKeywordBuffer );
+ sKeywordFound = false;
+
+ if ((CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "cd") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "path") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "prompt") == 0)) {
+
+ // no further Regular Keyword Checking
+ continueProcessing = false;
+ sKeywordFound = true;
+ wbo = (unsigned int)strlen( sKeywordBuffer );
+
+ // Colorize Special Keyword as Regular Keyword
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_WORD);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+
+ // Check for Default Text
+ if (!sKeywordFound) {
+ wbo = 0;
+ // Read up to %, Operator or Separator
+ while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+
+ // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a)
+ } else if (wordBuffer[0] == '%') {
+ unsigned int varlen;
+ unsigned int n = 1;
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT);
+ wbo++;
+
+ // check for %[nn] syntax
+ if ( wordBuffer[1] == '[' ) {
+ n++;
+ while ((n < wbl) && (wordBuffer[n] != ']')) {
+ n++;
+ }
+ if ( wordBuffer[n] == ']' )
+ n++;
+ goto ColorizeArg;
+ }
+
+ // Search to end of word for second % or to the first terminator (can be a long path)
+ while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+
+ // Check for Argument (%n) or (%*)
+ if (((isdigit(wordBuffer[1])) || (wordBuffer[1] == '*')) && (wordBuffer[wbo] != '%')) {
+ while (( wordBuffer[n] ) && ( strchr( "%0123456789*#$", wordBuffer[n] ) != NULL ))
+ n++;
+ColorizeArg:
+ // Colorize Argument
+ styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - n);
+
+ // Check for Variable with modifiers (%~...)
+ } else if ((varlen = GetBatchVarLen(wordBuffer)) != 0) {
+
+ // Colorize Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - varlen), SCE_TCMD_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - varlen);
+
+ // Check for Environment Variable (%x...%)
+ } else if (( wordBuffer[1] ) && ( wordBuffer[1] != '%')) {
+ if ( wordBuffer[wbo] == '%' )
+ wbo++;
+
+ // Colorize Environment Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_ENVIRONMENT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+
+ // Check for Local Variable (%%a)
+ } else if ( (wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] != '%') && (!IsBOperator(wordBuffer[2])) && (!IsBSeparator(wordBuffer[2]))) {
+
+ n = 2;
+ while (( wordBuffer[n] ) && (!IsBOperator(wordBuffer[n])) && (!IsBSeparator(wordBuffer[n])))
+ n++;
+
+ // Colorize Local Variable
+ styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - n);
+
+ // Check for %%
+ } else if ((wbl > 1) && (wordBuffer[1] == '%')) {
+
+ // Colorize Symbols
+ styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_TCMD_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 2);
+ } else {
+
+ // Colorize Symbol
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ }
+
+ // Check for Operator
+ } else if (IsBOperator(wordBuffer[0])) {
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT);
+
+ // Check for Pipe, compound, or conditional Operator
+ if ((wordBuffer[0] == '|') || (wordBuffer[0] == '&')) {
+
+ // Colorize Pipe Operator
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ continueProcessing = true;
+
+ // Check for Other Operator
+ } else {
+ // Check for > Operator
+ if ((wordBuffer[0] == '>') || (wordBuffer[0] == '<')) {
+ // Turn Keyword and External Command / Program checking back on
+ continueProcessing = true;
+ }
+ // Colorize Other Operator
+ if (!inString || !(wordBuffer[0] == '(' || wordBuffer[0] == ')'))
+ styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - 1);
+ }
+
+ // Check for Default Text
+ } else {
+ // Read up to %, Operator or Separator
+ while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) {
+ wbo++;
+ }
+ // Colorize Default Text
+ styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT);
+ // Reset Offset to re-process remainder of word
+ offset -= (wbl - wbo);
+ }
+
+ // Skip whitespace - nothing happens if Offset was Reset
+ while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
+ offset++;
+ }
+ }
+ // Colorize Default Text for remainder of line - currently not lexed
+ styler.ColourTo(endPos, SCE_TCMD_DEFAULT);
+}
+
+static void ColouriseTCMDDoc( unsigned int startPos, int length, int /*initStyle*/, WordList *keywordlists[], Accessor &styler )
+{
+ char lineBuffer[16384];
+
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ unsigned int startLine = startPos;
+ for (unsigned int i = startPos; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColouriseTCMDLine(lineBuffer, linePos, startLine, i, keywordlists, styler);
+ linePos = 0;
+ startLine = i + 1;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ lineBuffer[linePos] = '\0';
+ ColouriseTCMDLine(lineBuffer, linePos, startLine, startPos + length - 1, keywordlists, styler);
+ }
+}
+
+// Convert string to upper case
+static void StrUpr(char *s) {
+ while (*s) {
+ *s = MakeUpperCase(*s);
+ s++;
+ }
+}
+
+// Folding support (for DO, IFF, SWITCH, TEXT, and command groups)
+static void FoldTCMDDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ int line = styler.GetLine(startPos);
+ int level = styler.LevelAt(line);
+ int levelIndent = 0;
+ unsigned int endPos = startPos + length;
+ char s[16] = "";
+
+ char chPrev = styler.SafeGetCharAt(startPos - 1);
+
+ // Scan for ( and )
+ for (unsigned int i = startPos; i < endPos; i++) {
+
+ int c = styler.SafeGetCharAt(i, '\n');
+ int style = styler.StyleAt(i);
+ bool bLineStart = ((chPrev == '\r') || (chPrev == '\n')) || i == 0;
+
+ if (style == SCE_TCMD_OPERATOR) {
+ // CheckFoldPoint
+ if (c == '(') {
+ levelIndent += 1;
+ } else if (c == ')') {
+ levelIndent -= 1;
+ }
+ }
+
+ if (( bLineStart ) && ( style == SCE_TCMD_WORD )) {
+ for (unsigned int j = 0; j < 10; j++) {
+ if (!iswordchar(styler[i + j])) {
+ break;
+ }
+ s[j] = styler[i + j];
+ s[j + 1] = '\0';
+ }
+
+ StrUpr( s );
+ if ((strcmp(s, "DO") == 0) || (strcmp(s, "IFF") == 0) || (strcmp(s, "SWITCH") == 0) || (strcmp(s, "TEXT") == 0)) {
+ levelIndent++;
+ } else if ((strcmp(s, "ENDDO") == 0) || (strcmp(s, "ENDIFF") == 0) || (strcmp(s, "ENDSWITCH") == 0) || (strcmp(s, "ENDTEXT") == 0)) {
+ levelIndent--;
+ }
+ }
+
+ if (c == '\n') { // line end
+ if (levelIndent > 0) {
+ level |= SC_FOLDLEVELHEADERFLAG;
+ }
+ if (level != styler.LevelAt(line))
+ styler.SetLevel(line, level);
+ level += levelIndent;
+ if ((level & SC_FOLDLEVELNUMBERMASK) < SC_FOLDLEVELBASE)
+ level = SC_FOLDLEVELBASE;
+ line++;
+ // reset state
+ levelIndent = 0;
+ level &= ~SC_FOLDLEVELHEADERFLAG;
+ level &= ~SC_FOLDLEVELWHITEFLAG;
+ }
+
+ chPrev = c;
+ }
+}
+
+static const char *const tcmdWordListDesc[] = {
+ "Internal Commands",
+ "Aliases",
+ 0
+};
+
+LexerModule lmTCMD(SCLEX_TCMD, ColouriseTCMDDoc, "tcmd", FoldTCMDDoc, tcmdWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTeX.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTeX.cxx
new file mode 100644
index 00000000000..062c7abb9b3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTeX.cxx
@@ -0,0 +1,497 @@
+// Scintilla source code edit control
+
+// File: LexTeX.cxx - general context conformant tex coloring scheme
+// Author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com
+// Version: September 28, 2003
+
+// Copyright: 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// This lexer is derived from the one written for the texwork environment (1999++) which in
+// turn is inspired on texedit (1991++) which finds its roots in wdt (1986).
+
+// If you run into strange boundary cases, just tell me and I'll look into it.
+
+
+// TeX Folding code added by instanton (soft_share@126.com) with borrowed code from VisualTeX source by Alex Romanenko.
+// Version: June 22, 2007
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// val SCE_TEX_DEFAULT = 0
+// val SCE_TEX_SPECIAL = 1
+// val SCE_TEX_GROUP = 2
+// val SCE_TEX_SYMBOL = 3
+// val SCE_TEX_COMMAND = 4
+// val SCE_TEX_TEXT = 5
+
+// Definitions in SciTEGlobal.properties:
+//
+// TeX Highlighting
+//
+// # Default
+// style.tex.0=fore:#7F7F00
+// # Special
+// style.tex.1=fore:#007F7F
+// # Group
+// style.tex.2=fore:#880000
+// # Symbol
+// style.tex.3=fore:#7F7F00
+// # Command
+// style.tex.4=fore:#008800
+// # Text
+// style.tex.5=fore:#000000
+
+// lexer.tex.interface.default=0
+// lexer.tex.comment.process=0
+
+// todo: lexer.tex.auto.if
+
+// Auxiliary functions:
+
+static inline bool endOfLine(Accessor &styler, unsigned int i) {
+ return
+ (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')) ;
+}
+
+static inline bool isTeXzero(int ch) {
+ return
+ (ch == '%') ;
+}
+
+static inline bool isTeXone(int ch) {
+ return
+ (ch == '[') || (ch == ']') || (ch == '=') || (ch == '#') ||
+ (ch == '(') || (ch == ')') || (ch == '<') || (ch == '>') ||
+ (ch == '"') ;
+}
+
+static inline bool isTeXtwo(int ch) {
+ return
+ (ch == '{') || (ch == '}') || (ch == '$') ;
+}
+
+static inline bool isTeXthree(int ch) {
+ return
+ (ch == '~') || (ch == '^') || (ch == '_') || (ch == '&') ||
+ (ch == '-') || (ch == '+') || (ch == '\"') || (ch == '`') ||
+ (ch == '/') || (ch == '|') || (ch == '%') ;
+}
+
+static inline bool isTeXfour(int ch) {
+ return
+ (ch == '\\') ;
+}
+
+static inline bool isTeXfive(int ch) {
+ return
+ ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ||
+ (ch == '@') || (ch == '!') || (ch == '?') ;
+}
+
+static inline bool isTeXsix(int ch) {
+ return
+ (ch == ' ') ;
+}
+
+static inline bool isTeXseven(int ch) {
+ return
+ (ch == '^') ;
+}
+
+// Interface determination
+
+static int CheckTeXInterface(
+ unsigned int startPos,
+ int length,
+ Accessor &styler,
+ int defaultInterface) {
+
+ char lineBuffer[1024] ;
+ unsigned int linePos = 0 ;
+
+ // some day we can make something lexer.tex.mapping=(all,0)(nl,1)(en,2)...
+
+ if (styler.SafeGetCharAt(0) == '%') {
+ for (unsigned int i = 0; i < startPos + length; i++) {
+ lineBuffer[linePos++] = styler.SafeGetCharAt(i) ;
+ if (endOfLine(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ lineBuffer[linePos] = '\0';
+ if (strstr(lineBuffer, "interface=all")) {
+ return 0 ;
+ } else if (strstr(lineBuffer, "interface=tex")) {
+ return 1 ;
+ } else if (strstr(lineBuffer, "interface=nl")) {
+ return 2 ;
+ } else if (strstr(lineBuffer, "interface=en")) {
+ return 3 ;
+ } else if (strstr(lineBuffer, "interface=de")) {
+ return 4 ;
+ } else if (strstr(lineBuffer, "interface=cz")) {
+ return 5 ;
+ } else if (strstr(lineBuffer, "interface=it")) {
+ return 6 ;
+ } else if (strstr(lineBuffer, "interface=ro")) {
+ return 7 ;
+ } else if (strstr(lineBuffer, "interface=latex")) {
+ // we will move latex cum suis up to 91+ when more keyword lists are supported
+ return 8 ;
+ } else if (styler.SafeGetCharAt(1) == 'D' && strstr(lineBuffer, "%D \\module")) {
+ // better would be to limit the search to just one line
+ return 3 ;
+ } else {
+ return defaultInterface ;
+ }
+ }
+ }
+ }
+
+ return defaultInterface ;
+}
+
+static void ColouriseTeXDoc(
+ unsigned int startPos,
+ int length,
+ int,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ styler.StartAt(startPos) ;
+ styler.StartSegment(startPos) ;
+
+ bool processComment = styler.GetPropertyInt("lexer.tex.comment.process", 0) == 1 ;
+ bool useKeywords = styler.GetPropertyInt("lexer.tex.use.keywords", 1) == 1 ;
+ bool autoIf = styler.GetPropertyInt("lexer.tex.auto.if", 1) == 1 ;
+ int defaultInterface = styler.GetPropertyInt("lexer.tex.interface.default", 1) ;
+
+ char key[100] ;
+ int k ;
+ bool newifDone = false ;
+ bool inComment = false ;
+
+ int currentInterface = CheckTeXInterface(startPos,length,styler,defaultInterface) ;
+
+ if (currentInterface == 0) {
+ useKeywords = false ;
+ currentInterface = 1 ;
+ }
+
+ WordList &keywords = *keywordlists[currentInterface-1] ;
+
+ StyleContext sc(startPos, length, SCE_TEX_TEXT, styler);
+
+ bool going = sc.More() ; // needed because of a fuzzy end of file state
+
+ for (; going; sc.Forward()) {
+
+ if (! sc.More()) { going = false ; } // we need to go one behind the end of text
+
+ if (inComment) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_TEX_TEXT) ;
+ newifDone = false ;
+ inComment = false ;
+ }
+ } else {
+ if (! isTeXfive(sc.ch)) {
+ if (sc.state == SCE_TEX_COMMAND) {
+ if (sc.LengthCurrent() == 1) { // \<noncstoken>
+ if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) {
+ sc.Forward(2) ; // \^^ and \^^<token>
+ }
+ sc.ForwardSetState(SCE_TEX_TEXT) ;
+ } else {
+ sc.GetCurrent(key, sizeof(key)-1) ;
+ k = static_cast<int>(strlen(key)) ;
+ memmove(key,key+1,k) ; // shift left over escape token
+ key[k] = '\0' ;
+ k-- ;
+ if (! keywords || ! useKeywords) {
+ sc.SetState(SCE_TEX_COMMAND) ;
+ newifDone = false ;
+ } else if (k == 1) { //\<cstoken>
+ sc.SetState(SCE_TEX_COMMAND) ;
+ newifDone = false ;
+ } else if (keywords.InList(key)) {
+ sc.SetState(SCE_TEX_COMMAND) ;
+ newifDone = autoIf && (strcmp(key,"newif") == 0) ;
+ } else if (autoIf && ! newifDone && (key[0] == 'i') && (key[1] == 'f') && keywords.InList("if")) {
+ sc.SetState(SCE_TEX_COMMAND) ;
+ } else {
+ sc.ChangeState(SCE_TEX_TEXT) ;
+ sc.SetState(SCE_TEX_TEXT) ;
+ newifDone = false ;
+ }
+ }
+ }
+ if (isTeXzero(sc.ch)) {
+ sc.SetState(SCE_TEX_SYMBOL);
+
+ if (!endOfLine(styler,sc.currentPos + 1))
+ sc.ForwardSetState(SCE_TEX_DEFAULT) ;
+
+ inComment = ! processComment ;
+ newifDone = false ;
+ } else if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) {
+ sc.SetState(SCE_TEX_TEXT) ;
+ sc.ForwardSetState(SCE_TEX_TEXT) ;
+ } else if (isTeXone(sc.ch)) {
+ sc.SetState(SCE_TEX_SPECIAL) ;
+ newifDone = false ;
+ } else if (isTeXtwo(sc.ch)) {
+ sc.SetState(SCE_TEX_GROUP) ;
+ newifDone = false ;
+ } else if (isTeXthree(sc.ch)) {
+ sc.SetState(SCE_TEX_SYMBOL) ;
+ newifDone = false ;
+ } else if (isTeXfour(sc.ch)) {
+ sc.SetState(SCE_TEX_COMMAND) ;
+ } else if (isTeXsix(sc.ch)) {
+ sc.SetState(SCE_TEX_TEXT) ;
+ } else if (sc.atLineEnd) {
+ sc.SetState(SCE_TEX_TEXT) ;
+ newifDone = false ;
+ inComment = false ;
+ } else {
+ sc.SetState(SCE_TEX_TEXT) ;
+ }
+ } else if (sc.state != SCE_TEX_COMMAND) {
+ sc.SetState(SCE_TEX_TEXT) ;
+ }
+ }
+ }
+ sc.ChangeState(SCE_TEX_TEXT) ;
+ sc.Complete();
+
+}
+
+
+static inline bool isNumber(int ch) {
+ return
+ (ch == '0') || (ch == '1') || (ch == '2') ||
+ (ch == '3') || (ch == '4') || (ch == '5') ||
+ (ch == '6') || (ch == '7') || (ch == '8') || (ch == '9');
+}
+
+static inline bool isWordChar(int ch) {
+ return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'));
+}
+
+static int ParseTeXCommand(unsigned int pos, Accessor &styler, char *command)
+{
+ int length=0;
+ char ch=styler.SafeGetCharAt(pos+1);
+
+ if(ch==',' || ch==':' || ch==';' || ch=='%'){
+ command[0]=ch;
+ command[1]=0;
+ return 1;
+ }
+
+ // find end
+ while(isWordChar(ch) && !isNumber(ch) && ch!='_' && ch!='.' && length<100){
+ command[length]=ch;
+ length++;
+ ch=styler.SafeGetCharAt(pos+length+1);
+ }
+
+ command[length]='\0';
+ if(!length) return 0;
+ return length+1;
+}
+
+static int classifyFoldPointTeXPaired(const char* s) {
+ int lev=0;
+ if (!(isdigit(s[0]) || (s[0] == '.'))){
+ if (strcmp(s, "begin")==0||strcmp(s,"FoldStart")==0||
+ strcmp(s,"abstract")==0||strcmp(s,"unprotect")==0||
+ strcmp(s,"title")==0||strncmp(s,"start",5)==0||strncmp(s,"Start",5)==0||
+ strcmp(s,"documentclass")==0||strncmp(s,"if",2)==0
+ )
+ lev=1;
+ if (strcmp(s, "end")==0||strcmp(s,"FoldStop")==0||
+ strcmp(s,"maketitle")==0||strcmp(s,"protect")==0||
+ strncmp(s,"stop",4)==0||strncmp(s,"Stop",4)==0||
+ strcmp(s,"fi")==0
+ )
+ lev=-1;
+ }
+ return lev;
+}
+
+static int classifyFoldPointTeXUnpaired(const char* s) {
+ int lev=0;
+ if (!(isdigit(s[0]) || (s[0] == '.'))){
+ if (strcmp(s,"part")==0||
+ strcmp(s,"chapter")==0||
+ strcmp(s,"section")==0||
+ strcmp(s,"subsection")==0||
+ strcmp(s,"subsubsection")==0||
+ strcmp(s,"CJKfamily")==0||
+ strcmp(s,"appendix")==0||
+ strcmp(s,"Topic")==0||strcmp(s,"topic")==0||
+ strcmp(s,"subject")==0||strcmp(s,"subsubject")==0||
+ strcmp(s,"def")==0||strcmp(s,"gdef")==0||strcmp(s,"edef")==0||
+ strcmp(s,"xdef")==0||strcmp(s,"framed")==0||
+ strcmp(s,"frame")==0||
+ strcmp(s,"foilhead")==0||strcmp(s,"overlays")==0||strcmp(s,"slide")==0
+ ){
+ lev=1;
+ }
+ }
+ return lev;
+}
+
+static bool IsTeXCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+
+ int startpos = pos;
+
+ while (startpos<eol_pos){
+ char ch = styler[startpos];
+ if (ch!='%' && ch!=' ') return false;
+ else if (ch=='%') return true;
+ startpos++;
+ }
+
+ return false;
+}
+
+// FoldTeXDoc: borrowed from VisualTeX with modifications
+
+static void FoldTexDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
+{
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos+length;
+ int visibleChars=0;
+ int lineCurrent=styler.GetLine(startPos);
+ int levelPrev=styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent=levelPrev;
+ char chNext=styler[startPos];
+ char buffer[100]="";
+
+ for (unsigned int i=startPos; i < endPos; i++) {
+ char ch=chNext;
+ chNext=styler.SafeGetCharAt(i+1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if(ch=='\\') {
+ ParseTeXCommand(i, styler, buffer);
+ levelCurrent += classifyFoldPointTeXPaired(buffer)+classifyFoldPointTeXUnpaired(buffer);
+ }
+
+ if (levelCurrent > SC_FOLDLEVELBASE && ((ch == '\r' || ch=='\n') && (chNext == '\\'))) {
+ ParseTeXCommand(i+1, styler, buffer);
+ levelCurrent -= classifyFoldPointTeXUnpaired(buffer);
+ }
+
+ char chNext2;
+ char chNext3;
+ char chNext4;
+ char chNext5;
+ chNext2=styler.SafeGetCharAt(i+2);
+ chNext3=styler.SafeGetCharAt(i+3);
+ chNext4=styler.SafeGetCharAt(i+4);
+ chNext5=styler.SafeGetCharAt(i+5);
+
+ bool atEOfold = (ch == '%') &&
+ (chNext == '%') && (chNext2=='}') &&
+ (chNext3=='}')&& (chNext4=='-')&& (chNext5=='-');
+
+ bool atBOfold = (ch == '%') &&
+ (chNext == '%') && (chNext2=='-') &&
+ (chNext3=='-')&& (chNext4=='{')&& (chNext5=='{');
+
+ if(atBOfold){
+ levelCurrent+=1;
+ }
+
+ if(atEOfold){
+ levelCurrent-=1;
+ }
+
+ if(ch=='\\' && chNext=='['){
+ levelCurrent+=1;
+ }
+
+ if(ch=='\\' && chNext==']'){
+ levelCurrent-=1;
+ }
+
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+
+ if (foldComment && atEOL && IsTeXCommentLine(lineCurrent, styler))
+ {
+ if (lineCurrent==0 && IsTeXCommentLine(lineCurrent + 1, styler)
+ )
+ levelCurrent++;
+ else if (lineCurrent!=0 && !IsTeXCommentLine(lineCurrent - 1, styler)
+ && IsTeXCommentLine(lineCurrent + 1, styler)
+ )
+ levelCurrent++;
+ else if (lineCurrent!=0 && IsTeXCommentLine(lineCurrent - 1, styler) &&
+ !IsTeXCommentLine(lineCurrent+1, styler))
+ levelCurrent--;
+ }
+
+//---------------------------------------------------------------------------------------------
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+
+
+
+static const char * const texWordListDesc[] = {
+ "TeX, eTeX, pdfTeX, Omega",
+ "ConTeXt Dutch",
+ "ConTeXt English",
+ "ConTeXt German",
+ "ConTeXt Czech",
+ "ConTeXt Italian",
+ "ConTeXt Romanian",
+ 0,
+} ;
+
+LexerModule lmTeX(SCLEX_TEX, ColouriseTeXDoc, "tex", FoldTexDoc, texWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTxt2tags.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTxt2tags.cxx
new file mode 100644
index 00000000000..fd4a96c33b7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexTxt2tags.cxx
@@ -0,0 +1,480 @@
+/******************************************************************
+ * LexTxt2tags.cxx
+ *
+ * A simple Txt2tags lexer for scintilla.
+ *
+ *
+ * Adapted by Eric Forgeot
+ * Based on the LexMarkdown.cxx by Jon Strait - jstrait@moonloop.net
+ *
+ * What could be improved:
+ * - Verbatim lines could be like for raw lines : when there is no space between the ``` and the following text, the first letter should be colored so the user would understand there must be a space for a valid tag.
+ * - marks such as bold, italic, strikeout, underline should begin to be highlighted only when they are closed and valid.
+ * - verbatim and raw area should be highlighted too.
+ *
+ * The License.txt file describes the conditions under which this
+ * software may be distributed.
+ *
+ *****************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+
+static inline bool IsNewline(const int ch) {
+ return (ch == '\n' || ch == '\r');
+}
+
+// True if can follow ch down to the end with possibly trailing whitespace
+static bool FollowToLineEnd(const int ch, const int state, const unsigned int endPos, StyleContext &sc) {
+ unsigned int i = 0;
+ while (sc.GetRelative(++i) == ch)
+ ;
+ // Skip over whitespace
+ while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos)
+ ++i;
+ if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) {
+ sc.Forward(i);
+ sc.ChangeState(state);
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ return true;
+ }
+ else return false;
+}
+
+// Does the previous line have more than spaces and tabs?
+static bool HasPrevLineContent(StyleContext &sc) {
+ int i = 0;
+ // Go back to the previous newline
+ while ((--i + sc.currentPos) && !IsNewline(sc.GetRelative(i)))
+ ;
+ while (--i + sc.currentPos) {
+ if (IsNewline(sc.GetRelative(i)))
+ break;
+ if (!IsASpaceOrTab(sc.GetRelative(i)))
+ return true;
+ }
+ return false;
+}
+
+// Separator line
+static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
+ int count = 1;
+ unsigned int i = 0;
+ for (;;) {
+ ++i;
+ int c = sc.GetRelative(i);
+ if (c == sc.ch)
+ ++count;
+ // hit a terminating character
+ else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) {
+ // Are we a valid HRULE
+ if ((IsNewline(c) || sc.currentPos + i == endPos) &&
+ count >= 20 && !HasPrevLineContent(sc)) {
+ sc.SetState(SCE_TXT2TAGS_HRULE);
+ sc.Forward(i);
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ return true;
+ }
+ else {
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ return false;
+ }
+ }
+ }
+}
+
+static void ColorizeTxt2tagsDoc(unsigned int startPos, int length, int initStyle,
+ WordList **, Accessor &styler) {
+ unsigned int endPos = startPos + length;
+ int precharCount = 0;
+ // Don't advance on a new loop iteration and retry at the same position.
+ // Useful in the corner case of having to start at the beginning file position
+ // in the default state.
+ bool freezeCursor = false;
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ while (sc.More()) {
+ // Skip past escaped characters
+ if (sc.ch == '\\') {
+ sc.Forward();
+ continue;
+ }
+
+ // A blockquotes resets the line semantics
+ if (sc.state == SCE_TXT2TAGS_BLOCKQUOTE){
+ sc.Forward(2);
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ }
+ // An option colors the whole line
+ if (sc.state == SCE_TXT2TAGS_OPTION){
+ FollowToLineEnd('%', SCE_TXT2TAGS_OPTION, endPos, sc);
+ }
+ if (sc.state == SCE_TXT2TAGS_POSTPROC){
+ FollowToLineEnd('%', SCE_TXT2TAGS_POSTPROC, endPos, sc);
+ }
+ if (sc.state == SCE_TXT2TAGS_PREPROC){
+ FollowToLineEnd('%', SCE_TXT2TAGS_PREPROC, endPos, sc);
+ }
+ // A comment colors the whole line
+ if (sc.state == SCE_TXT2TAGS_COMMENT){
+ FollowToLineEnd('%', SCE_TXT2TAGS_COMMENT, endPos, sc);
+ }
+ // Conditional state-based actions
+ if (sc.state == SCE_TXT2TAGS_CODE2) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.Match("``") && sc.GetRelative(-2) != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Table
+ else if (sc.state == SCE_TXT2TAGS_CODE) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.ch == '|' && sc.chPrev != ' ')
+ sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ // Strong
+ else if (sc.state == SCE_TXT2TAGS_STRONG1) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.Match("**") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Emphasis
+ else if (sc.state == SCE_TXT2TAGS_EM1) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.Match("//") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Underline
+ else if (sc.state == SCE_TXT2TAGS_EM2) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.Match("__") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // codeblock
+ else if (sc.state == SCE_TXT2TAGS_CODEBK) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.atLineStart && sc.Match("```")) {
+ int i = 1;
+ while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)
+ i++;
+ sc.Forward(i);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // strikeout
+ else if (sc.state == SCE_TXT2TAGS_STRIKEOUT) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ if (sc.Match("--") && sc.chPrev != ' ') {
+ sc.Forward(2);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Headers
+ else if (sc.state == SCE_TXT2TAGS_LINE_BEGIN) {
+ if (sc.Match("======"))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER6);
+ sc.Forward();
+ }
+ else if (sc.Match("====="))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER5);
+ sc.Forward();
+ }
+ else if (sc.Match("===="))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER4);
+ sc.Forward();
+ }
+ else if (sc.Match("==="))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER3);
+ sc.Forward();
+ }
+ //SetStateAndZoom(SCE_TXT2TAGS_HEADER3, 3, '=', sc);
+ else if (sc.Match("==")) {
+ sc.SetState(SCE_TXT2TAGS_HEADER2);
+ sc.Forward();
+ }
+ //SetStateAndZoom(SCE_TXT2TAGS_HEADER2, 2, '=', sc);
+ else if (sc.Match("=")) {
+ // Catch the special case of an unordered list
+ if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
+ precharCount = 0;
+ sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ }
+ else
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER1);
+ sc.Forward();
+ }
+ //SetStateAndZoom(SCE_TXT2TAGS_HEADER1, 1, '=', sc);
+ }
+
+ // Numbered title
+ else if (sc.Match("++++++"))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER6);
+ sc.Forward();
+ }
+ else if (sc.Match("+++++"))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER5);
+ sc.Forward();
+ }
+ else if (sc.Match("++++"))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER4);
+ sc.Forward();
+ }
+ else if (sc.Match("+++"))
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER3);
+ sc.Forward();
+ }
+ //SetStateAndZoom(SCE_TXT2TAGS_HEADER3, 3, '+', sc);
+ else if (sc.Match("++")) {
+ sc.SetState(SCE_TXT2TAGS_HEADER2);
+ sc.Forward();
+ }
+ //SetStateAndZoom(SCE_TXT2TAGS_HEADER2, 2, '+', sc);
+ else if (sc.Match("+")) {
+ // Catch the special case of an unordered list
+ if (sc.chNext == ' ' && IsASpaceOrTab(sc.GetRelative(1))) {
+ // if (IsNewline(sc.ch)) {
+ //precharCount = 0;
+ // sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ //sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ // }
+ // else {
+ // precharCount = 0;
+ sc.SetState(SCE_TXT2TAGS_OLIST_ITEM);
+ sc.Forward(2);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ // sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ // }
+ }
+ else
+ {
+ sc.SetState(SCE_TXT2TAGS_HEADER1);
+ sc.Forward();
+ }
+ }
+
+
+ // Codeblock
+ else if (sc.Match("```")) {
+ if (!HasPrevLineContent(sc))
+ // if (!FollowToLineEnd(sc))
+ sc.SetState(SCE_TXT2TAGS_CODEBK);
+ else
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+
+ // Preproc
+ else if (sc.Match("%!preproc")) {
+ sc.SetState(SCE_TXT2TAGS_PREPROC);
+ }
+ // Postproc
+ else if (sc.Match("%!postproc")) {
+ sc.SetState(SCE_TXT2TAGS_POSTPROC);
+ }
+ // Option
+ else if (sc.Match("%!")) {
+ sc.SetState(SCE_TXT2TAGS_OPTION);
+ }
+
+ // Comment
+ else if (sc.ch == '%') {
+ sc.SetState(SCE_TXT2TAGS_COMMENT);
+ }
+ // list
+ else if (sc.ch == '-') {
+ precharCount = 0;
+ sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ }
+ // def list
+ else if (sc.ch == ':') {
+ precharCount = 0;
+ sc.SetState(SCE_TXT2TAGS_OLIST_ITEM);
+ sc.Forward(1);
+ sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ }
+ else if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ else {
+ precharCount = 0;
+ sc.SetState(SCE_TXT2TAGS_PRECHAR);
+ }
+ }
+
+ // The header lasts until the newline
+ else if (sc.state == SCE_TXT2TAGS_HEADER1 || sc.state == SCE_TXT2TAGS_HEADER2 ||
+ sc.state == SCE_TXT2TAGS_HEADER3 || sc.state == SCE_TXT2TAGS_HEADER4 ||
+ sc.state == SCE_TXT2TAGS_HEADER5 || sc.state == SCE_TXT2TAGS_HEADER6) {
+ if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ }
+
+ // New state only within the initial whitespace
+ if (sc.state == SCE_TXT2TAGS_PRECHAR) {
+ // Blockquote
+ if (sc.Match("\"\"\"") && precharCount < 5){
+
+ sc.SetState(SCE_TXT2TAGS_BLOCKQUOTE);
+ sc.Forward(1);
+ }
+ /*
+ // Begin of code block
+ else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4))
+ sc.SetState(SCE_TXT2TAGS_CODEBK);
+ */
+ // HRule - Total of 20 or more hyphens, asterisks, or underscores
+ // on a line by themselves
+ else if ((sc.ch == '-' ) && IsValidHrule(endPos, sc))
+ ;
+ // Unordered list
+ else if ((sc.ch == '-') && IsASpaceOrTab(sc.chNext)) {
+ sc.SetState(SCE_TXT2TAGS_ULIST_ITEM);
+ sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ // Ordered list
+ else if (IsADigit(sc.ch)) {
+ int digitCount = 0;
+ while (IsADigit(sc.GetRelative(++digitCount)))
+ ;
+ if (sc.GetRelative(digitCount) == '.' &&
+ IsASpaceOrTab(sc.GetRelative(digitCount + 1))) {
+ sc.SetState(SCE_TXT2TAGS_OLIST_ITEM);
+ sc.Forward(digitCount + 1);
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Alternate Ordered list
+ else if (sc.ch == '+' && sc.chNext == ' ' && IsASpaceOrTab(sc.GetRelative(2))) {
+ // sc.SetState(SCE_TXT2TAGS_OLIST_ITEM);
+ // sc.Forward(2);
+ // sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ else if (sc.ch != ' ' || precharCount > 2)
+ sc.SetState(SCE_TXT2TAGS_DEFAULT);
+ else
+ ++precharCount;
+ }
+
+ // New state anywhere in doc
+ if (sc.state == SCE_TXT2TAGS_DEFAULT) {
+ // if (sc.atLineStart && sc.ch == '#') {
+ // sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ // freezeCursor = true;
+ // }
+ // Links and Images
+ if (sc.Match("![") || sc.ch == '[') {
+ int i = 0, j = 0, k = 0;
+ int len = endPos - sc.currentPos;
+ while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == ']') {
+ j = i;
+ if (sc.GetRelative(++i) == '(') {
+ while (i < len && (sc.GetRelative(++i) != '(' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == '(')
+ k = i;
+ }
+
+ else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') {
+ while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))
+ ;
+ if (sc.GetRelative(i) == ']')
+ k = i;
+ }
+ }
+ // At least a link text
+ if (j) {
+ sc.SetState(SCE_TXT2TAGS_LINK);
+ sc.Forward(j);
+ // Also has a URL or reference portion
+ if (k)
+ sc.Forward(k - j);
+ sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT);
+ }
+ }
+ // Code - also a special case for alternate inside spacing
+ if (sc.Match("``") && sc.GetRelative(3) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_CODE2);
+ sc.Forward();
+ }
+ else if (sc.ch == '|' && sc.GetRelative(3) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_CODE);
+ }
+ // Strong
+ else if (sc.Match("**") && sc.GetRelative(2) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_STRONG1);
+ sc.Forward();
+ }
+ // Emphasis
+ else if (sc.Match("//") && sc.GetRelative(2) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_EM1);
+ sc.Forward();
+ }
+ else if (sc.Match("__") && sc.GetRelative(2) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_EM2);
+ sc.Forward();
+ }
+ // Strikeout
+ else if (sc.Match("--") && sc.GetRelative(2) != ' ') {
+ sc.SetState(SCE_TXT2TAGS_STRIKEOUT);
+ sc.Forward();
+ }
+
+ // Beginning of line
+ else if (IsNewline(sc.ch))
+ sc.SetState(SCE_TXT2TAGS_LINE_BEGIN);
+ }
+ // Advance if not holding back the cursor for this iteration.
+ if (!freezeCursor)
+ sc.Forward();
+ freezeCursor = false;
+ }
+ sc.Complete();
+}
+
+LexerModule lmTxt2tags(SCLEX_TXT2TAGS, ColorizeTxt2tagsDoc, "txt2tags");
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVB.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVB.cxx
new file mode 100644
index 00000000000..54050c7bcef
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVB.cxx
@@ -0,0 +1,319 @@
+// Scintilla source code edit control
+/** @file LexVB.cxx
+ ** Lexer for Visual Basic and VBScript.
+ **/
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Internal state, highlighted as number
+#define SCE_B_FILENUMBER SCE_B_DEFAULT+100
+
+
+static bool IsVBComment(Accessor &styler, int pos, int len) {
+ return len > 0 && styler[pos] == '\'';
+}
+
+static inline bool IsTypeCharacter(int ch) {
+ return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$';
+}
+
+// Extended to accept accented characters
+static inline bool IsAWordChar(int ch) {
+ return ch >= 0x80 ||
+ (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return ch >= 0x80 ||
+ (isalpha(ch) || ch == '_');
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || toupper(ch) == 'E' ||
+ ch == '.' || ch == '-' || ch == '+');
+}
+
+static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler, bool vbScriptSyntax) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &keywords2 = *keywordlists[1];
+ WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
+
+ styler.StartAt(startPos);
+
+ int visibleChars = 0;
+ int fileNbDigits = 0;
+
+ // Do not leak onto next line
+ if (initStyle == SCE_B_STRINGEOL || initStyle == SCE_B_COMMENT || initStyle == SCE_B_PREPROCESSOR) {
+ initStyle = SCE_B_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+
+ if (sc.state == SCE_B_OPERATOR) {
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.state == SCE_B_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ // In Basic (except VBScript), a variable name or a function name
+ // can end with a special character indicating the type of the value
+ // held or returned.
+ bool skipType = false;
+ if (!vbScriptSyntax && IsTypeCharacter(sc.ch)) {
+ sc.Forward(); // Skip it
+ skipType = true;
+ }
+ if (sc.ch == ']') {
+ sc.Forward();
+ }
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (skipType) {
+ s[strlen(s) - 1] = '\0';
+ }
+ if (strcmp(s, "rem") == 0) {
+ sc.ChangeState(SCE_B_COMMENT);
+ } else {
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD4);
+ } // Else, it is really an identifier...
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_B_NUMBER) {
+ // We stop the number definition on non-numerical non-dot non-eE non-sign char
+ // Also accepts A-F for hex. numbers
+ if (!IsANumberChar(sc.ch) && !(tolower(sc.ch) >= 'a' && tolower(sc.ch) <= 'f')) {
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_STRING) {
+ // VB doubles quotes to preserve them, so just end this string
+ // state now as a following quote will start again
+ if (sc.ch == '\"') {
+ if (sc.chNext == '\"') {
+ sc.Forward();
+ } else {
+ if (tolower(sc.chNext) == 'c') {
+ sc.Forward();
+ }
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.atLineEnd) {
+ visibleChars = 0;
+ sc.ChangeState(SCE_B_STRINGEOL);
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_COMMENT) {
+ if (sc.atLineEnd) {
+ visibleChars = 0;
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_PREPROCESSOR) {
+ if (sc.atLineEnd) {
+ visibleChars = 0;
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ } else if (sc.state == SCE_B_FILENUMBER) {
+ if (IsADigit(sc.ch)) {
+ fileNbDigits++;
+ if (fileNbDigits > 3) {
+ sc.ChangeState(SCE_B_DATE);
+ }
+ } else if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ',') {
+ // Regular uses: Close #1; Put #1, ...; Get #1, ... etc.
+ // Too bad if date is format #27, Oct, 2003# or something like that...
+ // Use regular number state
+ sc.ChangeState(SCE_B_NUMBER);
+ sc.SetState(SCE_B_DEFAULT);
+ } else if (sc.ch == '#') {
+ sc.ChangeState(SCE_B_DATE);
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ } else {
+ sc.ChangeState(SCE_B_DATE);
+ }
+ if (sc.state != SCE_B_FILENUMBER) {
+ fileNbDigits = 0;
+ }
+ } else if (sc.state == SCE_B_DATE) {
+ if (sc.atLineEnd) {
+ visibleChars = 0;
+ sc.ChangeState(SCE_B_STRINGEOL);
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ } else if (sc.ch == '#') {
+ sc.ForwardSetState(SCE_B_DEFAULT);
+ }
+ }
+
+ if (sc.state == SCE_B_DEFAULT) {
+ if (sc.ch == '\'') {
+ sc.SetState(SCE_B_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_B_STRING);
+ } else if (sc.ch == '#' && visibleChars == 0) {
+ // Preprocessor commands are alone on their line
+ sc.SetState(SCE_B_PREPROCESSOR);
+ } else if (sc.ch == '#') {
+ // It can be a date literal, ending with #, or a file number, from 1 to 511
+ // The date literal depends on the locale, so anything can go between #'s.
+ // Can be #January 1, 1993# or #1 Jan 93# or #05/11/2003#, etc.
+ // So we set the FILENUMBER state, and switch to DATE if it isn't a file number
+ sc.SetState(SCE_B_FILENUMBER);
+ } else if (sc.ch == '&' && tolower(sc.chNext) == 'h') {
+ // Hexadecimal number
+ sc.SetState(SCE_B_NUMBER);
+ sc.Forward();
+ } else if (sc.ch == '&' && tolower(sc.chNext) == 'o') {
+ // Octal number
+ sc.SetState(SCE_B_NUMBER);
+ sc.Forward();
+ } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_B_NUMBER);
+ } else if (IsAWordStart(sc.ch) || (sc.ch == '[')) {
+ sc.SetState(SCE_B_IDENTIFIER);
+ } else if (isoperator(static_cast<char>(sc.ch)) || (sc.ch == '\\')) { // Integer division
+ sc.SetState(SCE_B_OPERATOR);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ visibleChars = 0;
+ }
+ if (!IsASpace(sc.ch)) {
+ visibleChars++;
+ }
+ }
+
+ if (sc.state == SCE_B_IDENTIFIER && !IsAWordChar(sc.ch)) {
+ // In Basic (except VBScript), a variable name or a function name
+ // can end with a special character indicating the type of the value
+ // held or returned.
+ bool skipType = false;
+ if (!vbScriptSyntax && IsTypeCharacter(sc.ch)) {
+ sc.Forward(); // Skip it
+ skipType = true;
+ }
+ if (sc.ch == ']') {
+ sc.Forward();
+ }
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (skipType) {
+ s[strlen(s) - 1] = '\0';
+ }
+ if (strcmp(s, "rem") == 0) {
+ sc.ChangeState(SCE_B_COMMENT);
+ } else {
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD2);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD3);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_B_KEYWORD4);
+ } // Else, it is really an identifier...
+ sc.SetState(SCE_B_DEFAULT);
+ }
+ }
+
+ sc.Complete();
+}
+
+static void FoldVBDoc(unsigned int startPos, int length, int,
+ WordList *[], Accessor &styler) {
+ int endPos = startPos + length;
+
+ // Backtrack to previous line in case need to fix its fold status
+ int lineCurrent = styler.GetLine(startPos);
+ if (startPos > 0) {
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
+ }
+ int spaceFlags = 0;
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsVBComment);
+ char chNext = styler[startPos];
+ for (int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) {
+ int lev = indentCurrent;
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsVBComment);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
+ // Only non whitespace lines can be headers
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
+ // Line after is blank so check the next - maybe should continue further?
+ int spaceFlags2 = 0;
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsVBComment);
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+ }
+ }
+ indentCurrent = indentNext;
+ styler.SetLevel(lineCurrent, lev);
+ lineCurrent++;
+ }
+ }
+}
+
+static void ColouriseVBNetDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ ColouriseVBDoc(startPos, length, initStyle, keywordlists, styler, false);
+}
+
+static void ColouriseVBScriptDoc(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) {
+ ColouriseVBDoc(startPos, length, initStyle, keywordlists, styler, true);
+}
+
+static const char * const vbWordListDesc[] = {
+ "Keywords",
+ "user1",
+ "user2",
+ "user3",
+ 0
+};
+
+LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc, vbWordListDesc);
+LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc, vbWordListDesc);
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVHDL.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVHDL.cxx
new file mode 100644
index 00000000000..56426e43fda
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVHDL.cxx
@@ -0,0 +1,565 @@
+// Scintilla source code edit control
+/** @file LexVHDL.cxx
+ ** Lexer for VHDL
+ ** Written by Phil Reid,
+ ** Based on:
+ ** - The Verilog Lexer by Avi Yegudin
+ ** - The Fortran Lexer by Chuan-jian Shen
+ ** - The C++ lexer by Neil Hodgson
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void ColouriseVHDLDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler);
+
+
+/***************************************/
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' );
+}
+
+/***************************************/
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+/***************************************/
+static inline bool IsABlank(unsigned int ch) {
+ return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ;
+}
+
+/***************************************/
+static void ColouriseVHDLDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler)
+{
+ WordList &Keywords = *keywordlists[0];
+ WordList &Operators = *keywordlists[1];
+ WordList &Attributes = *keywordlists[2];
+ WordList &Functions = *keywordlists[3];
+ WordList &Packages = *keywordlists[4];
+ WordList &Types = *keywordlists[5];
+ WordList &User = *keywordlists[6];
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ bool isExtendedId = false; // true when parsing an extended identifier
+
+ for (; sc.More(); sc.Forward())
+ {
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_VHDL_OPERATOR) {
+ sc.SetState(SCE_VHDL_DEFAULT);
+ } else if (sc.state == SCE_VHDL_NUMBER) {
+ if (!IsAWordChar(sc.ch) && (sc.ch != '#')) {
+ sc.SetState(SCE_VHDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_VHDL_IDENTIFIER) {
+ if (!isExtendedId && (!IsAWordChar(sc.ch) || (sc.ch == '.'))) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+ if (Keywords.InList(s)) {
+ sc.ChangeState(SCE_VHDL_KEYWORD);
+ } else if (Operators.InList(s)) {
+ sc.ChangeState(SCE_VHDL_STDOPERATOR);
+ } else if (Attributes.InList(s)) {
+ sc.ChangeState(SCE_VHDL_ATTRIBUTE);
+ } else if (Functions.InList(s)) {
+ sc.ChangeState(SCE_VHDL_STDFUNCTION);
+ } else if (Packages.InList(s)) {
+ sc.ChangeState(SCE_VHDL_STDPACKAGE);
+ } else if (Types.InList(s)) {
+ sc.ChangeState(SCE_VHDL_STDTYPE);
+ } else if (User.InList(s)) {
+ sc.ChangeState(SCE_VHDL_USERWORD);
+ }
+ sc.SetState(SCE_VHDL_DEFAULT);
+ } else if (isExtendedId && ((sc.ch == '\\') || sc.atLineEnd)) {
+ // extended identifiers are terminated by backslash, check for end of line in case we have invalid syntax
+ isExtendedId = false;
+ sc.ForwardSetState(SCE_VHDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_VHDL_COMMENT || sc.state == SCE_VHDL_COMMENTLINEBANG) {
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_VHDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_VHDL_STRING) {
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_VHDL_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_VHDL_STRINGEOL);
+ sc.ForwardSetState(SCE_VHDL_DEFAULT);
+ }
+ } else if (sc.state == SCE_VHDL_BLOCK_COMMENT){
+ if(sc.ch == '*' && sc.chNext == '/'){
+ sc.Forward();
+ sc.ForwardSetState(SCE_VHDL_DEFAULT);
+ }
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_VHDL_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_VHDL_NUMBER);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_VHDL_IDENTIFIER);
+ } else if (sc.Match('-', '-')) {
+ if (sc.Match("--!")) // Nice to have a different comment style
+ sc.SetState(SCE_VHDL_COMMENTLINEBANG);
+ else
+ sc.SetState(SCE_VHDL_COMMENT);
+ } else if (sc.Match('/', '*')){
+ sc.SetState(SCE_VHDL_BLOCK_COMMENT);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_VHDL_STRING);
+ } else if (sc.ch == '\\') {
+ isExtendedId = true;
+ sc.SetState(SCE_VHDL_IDENTIFIER);
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_VHDL_OPERATOR);
+ }
+ }
+ }
+ sc.Complete();
+}
+//=============================================================================
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ char chNext = styler[i+1];
+ if ((ch == '-') && (chNext == '-'))
+ return true;
+ else if (ch != ' ' && ch != '\t')
+ return false;
+ }
+ return false;
+}
+static bool IsCommentBlockStart(int line, Accessor &styler)
+{
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ char chNext = styler[i+1];
+ char style = styler.StyleAt(i);
+ if ((style == SCE_VHDL_BLOCK_COMMENT) && (ch == '/') && (chNext == '*'))
+ return true;
+ }
+ return false;
+}
+
+static bool IsCommentBlockEnd(int line, Accessor &styler)
+{
+ int pos = styler.LineStart(line);
+ int eol_pos = styler.LineStart(line + 1) - 1;
+
+ for (int i = pos; i < eol_pos; i++) {
+ char ch = styler[i];
+ char chNext = styler[i+1];
+ char style = styler.StyleAt(i);
+ if ((style == SCE_VHDL_BLOCK_COMMENT) && (ch == '*') && (chNext == '/'))
+ return true;
+ }
+ return false;
+}
+
+static bool IsCommentStyle(char style)
+{
+ return style == SCE_VHDL_BLOCK_COMMENT || style == SCE_VHDL_COMMENT || style == SCE_VHDL_COMMENTLINEBANG;
+}
+
+//=============================================================================
+// Folding the code
+static void FoldNoBoxVHDLDoc(
+ unsigned int startPos,
+ int length,
+ int,
+ Accessor &styler)
+{
+ // Decided it would be smarter to have the lexer have all keywords included. Therefore I
+ // don't check if the style for the keywords that I use to adjust the levels.
+ char words[] =
+ "architecture begin block case component else elsif end entity generate loop package process record then "
+ "procedure function when units";
+ WordList keywords;
+ keywords.Set(words);
+
+ bool foldComment = styler.GetPropertyInt("fold.comment", 1) != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 1) != 0;
+ bool foldAtBegin = styler.GetPropertyInt("fold.at.Begin", 1) != 0;
+ bool foldAtParenthese = styler.GetPropertyInt("fold.at.Parenthese", 1) != 0;
+ //bool foldAtWhen = styler.GetPropertyInt("fold.at.When", 1) != 0; //< fold at when in case statements
+
+ int visibleChars = 0;
+ unsigned int endPos = startPos + length;
+
+ int lineCurrent = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if(lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ //int levelMinCurrent = levelCurrent;
+ int levelMinCurrentElse = levelCurrent; //< Used for folding at 'else'
+ int levelMinCurrentBegin = levelCurrent; //< Used for folding at 'begin'
+ int levelNext = levelCurrent;
+
+ /***************************************/
+ int lastStart = 0;
+ char prevWord[32] = "";
+
+ /***************************************/
+ // Find prev word
+ // The logic for going up or down a level depends on a the previous keyword
+ // This code could be cleaned up.
+ int end = 0;
+ unsigned int j;
+ for(j = startPos; j>0; j--)
+ {
+ char ch = styler.SafeGetCharAt(j);
+ char chPrev = styler.SafeGetCharAt(j-1);
+ int style = styler.StyleAt(j);
+ int stylePrev = styler.StyleAt(j-1);
+ if ((!IsCommentStyle(style)) && (stylePrev != SCE_VHDL_STRING))
+ {
+ if(IsAWordChar(chPrev) && !IsAWordChar(ch))
+ {
+ end = j-1;
+ }
+ }
+ if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
+ {
+ if(!IsAWordChar(chPrev) && IsAWordStart(ch) && (end != 0))
+ {
+ char s[32];
+ unsigned int k;
+ for(k=0; (k<31 ) && (k<end-j+1 ); k++) {
+ s[k] = static_cast<char>(tolower(styler[j+k]));
+ }
+ s[k] = '\0';
+
+ if(keywords.InList(s)) {
+ strcpy(prevWord, s);
+ break;
+ }
+ }
+ }
+ }
+ for(j=j+static_cast<unsigned int>(strlen(prevWord)); j<endPos; j++)
+ {
+ char ch = styler.SafeGetCharAt(j);
+ int style = styler.StyleAt(j);
+ if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
+ {
+ if((ch == ';') && (strcmp(prevWord, "end") == 0))
+ {
+ strcpy(prevWord, ";");
+ }
+ }
+ }
+
+ char chNext = styler[startPos];
+ char chPrev = '\0';
+ char chNextNonBlank;
+ int styleNext = styler.StyleAt(startPos);
+ //Platform::DebugPrintf("Line[%04d] Prev[%20s] ************************* Level[%x]\n", lineCurrent+1, prevWord, levelCurrent);
+
+ /***************************************/
+ for (unsigned int i = startPos; i < endPos; i++)
+ {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ chPrev = styler.SafeGetCharAt(i - 1);
+ chNextNonBlank = chNext;
+ unsigned int j = i+1;
+ while(IsABlank(chNextNonBlank) && j<endPos)
+ {
+ j ++ ;
+ chNextNonBlank = styler.SafeGetCharAt(j);
+ }
+ int style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+
+ if (foldComment && atEOL)
+ {
+ if(IsCommentLine(lineCurrent, styler))
+ {
+ if(!IsCommentLine(lineCurrent-1, styler) && IsCommentLine(lineCurrent+1, styler))
+ {
+ levelNext++;
+ }
+ else if(IsCommentLine(lineCurrent-1, styler) && !IsCommentLine(lineCurrent+1, styler))
+ {
+ levelNext--;
+ }
+ }
+ else
+ {
+ if (IsCommentBlockStart(lineCurrent, styler) && !IsCommentBlockEnd(lineCurrent, styler))
+ {
+ levelNext++;
+ }
+ else if (IsCommentBlockEnd(lineCurrent, styler) && !IsCommentBlockStart(lineCurrent, styler))
+ {
+ levelNext--;
+ }
+ }
+ }
+
+ if ((style == SCE_VHDL_OPERATOR) && foldAtParenthese)
+ {
+ if(ch == '(') {
+ levelNext++;
+ } else if (ch == ')') {
+ levelNext--;
+ }
+ }
+
+ if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
+ {
+ if((ch == ';') && (strcmp(prevWord, "end") == 0))
+ {
+ strcpy(prevWord, ";");
+ }
+
+ if(!IsAWordChar(chPrev) && IsAWordStart(ch))
+ {
+ lastStart = i;
+ }
+
+ if(IsAWordChar(ch) && !IsAWordChar(chNext)) {
+ char s[32];
+ unsigned int k;
+ for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
+ s[k] = static_cast<char>(tolower(styler[lastStart+k]));
+ }
+ s[k] = '\0';
+
+ if(keywords.InList(s))
+ {
+ if (
+ strcmp(s, "architecture") == 0 ||
+ strcmp(s, "case") == 0 ||
+ strcmp(s, "generate") == 0 ||
+ strcmp(s, "block") == 0 ||
+ strcmp(s, "loop") == 0 ||
+ strcmp(s, "package") ==0 ||
+ strcmp(s, "process") == 0 ||
+ strcmp(s, "record") == 0 ||
+ strcmp(s, "then") == 0 ||
+ strcmp(s, "units") == 0)
+ {
+ if (strcmp(prevWord, "end") != 0)
+ {
+ if (levelMinCurrentElse > levelNext) {
+ levelMinCurrentElse = levelNext;
+ }
+ levelNext++;
+ }
+ } else if (
+ strcmp(s, "component") == 0 ||
+ strcmp(s, "entity") == 0 ||
+ strcmp(s, "configuration") == 0 )
+ {
+ if (strcmp(prevWord, "end") != 0 && lastStart)
+ { // check for instantiated unit by backward searching for the colon.
+ unsigned pos = lastStart;
+ char chAtPos, styleAtPos;
+ do{// skip white spaces
+ pos--;
+ styleAtPos = styler.StyleAt(pos);
+ chAtPos = styler.SafeGetCharAt(pos);
+ }while(pos>0 &&
+ (chAtPos == ' ' || chAtPos == '\t' ||
+ chAtPos == '\n' || chAtPos == '\r' ||
+ IsCommentStyle(styleAtPos)));
+
+ // check for a colon (':') before the instantiated units "entity", "component" or "configuration". Don't fold thereafter.
+ if (chAtPos != ':')
+ {
+ if (levelMinCurrentElse > levelNext) {
+ levelMinCurrentElse = levelNext;
+ }
+ levelNext++;
+ }
+ }
+ } else if (
+ strcmp(s, "procedure") == 0 ||
+ strcmp(s, "function") == 0)
+ {
+ if (strcmp(prevWord, "end") != 0) // check for "end procedure" etc.
+ { // This code checks to see if the procedure / function is a definition within a "package"
+ // rather than the actual code in the body.
+ int BracketLevel = 0;
+ for(int pos=i+1; pos<styler.Length(); pos++)
+ {
+ int styleAtPos = styler.StyleAt(pos);
+ char chAtPos = styler.SafeGetCharAt(pos);
+ if(chAtPos == '(') BracketLevel++;
+ if(chAtPos == ')') BracketLevel--;
+ if(
+ (BracketLevel == 0) &&
+ (!IsCommentStyle(styleAtPos)) &&
+ (styleAtPos != SCE_VHDL_STRING) &&
+ !iswordchar(styler.SafeGetCharAt(pos-1)) &&
+ (chAtPos|' ')=='i' && (styler.SafeGetCharAt(pos+1)|' ')=='s' &&
+ !iswordchar(styler.SafeGetCharAt(pos+2)))
+ {
+ if (levelMinCurrentElse > levelNext) {
+ levelMinCurrentElse = levelNext;
+ }
+ levelNext++;
+ break;
+ }
+ if((BracketLevel == 0) && (chAtPos == ';'))
+ {
+ break;
+ }
+ }
+ }
+
+ } else if (strcmp(s, "end") == 0) {
+ levelNext--;
+ } else if(strcmp(s, "elsif") == 0) { // elsif is followed by then so folding occurs correctly
+ levelNext--;
+ } else if (strcmp(s, "else") == 0) {
+ if(strcmp(prevWord, "when") != 0) // ignore a <= x when y else z;
+ {
+ levelMinCurrentElse = levelNext - 1; // VHDL else is all on its own so just dec. the min level
+ }
+ } else if(
+ ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "architecture") == 0)) ||
+ ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "function") == 0)) ||
+ ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "procedure") == 0)))
+ {
+ levelMinCurrentBegin = levelNext - 1;
+ }
+ //Platform::DebugPrintf("Line[%04d] Prev[%20s] Cur[%20s] Level[%x]\n", lineCurrent+1, prevWord, s, levelCurrent);
+ strcpy(prevWord, s);
+ }
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+
+ if (foldAtElse && (levelMinCurrentElse < levelUse)) {
+ levelUse = levelMinCurrentElse;
+ }
+ if (foldAtBegin && (levelMinCurrentBegin < levelUse)) {
+ levelUse = levelMinCurrentBegin;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ //Platform::DebugPrintf("Line[%04d] ---------------------------------------------------- Level[%x]\n", lineCurrent+1, levelCurrent);
+ lineCurrent++;
+ levelCurrent = levelNext;
+ //levelMinCurrent = levelCurrent;
+ levelMinCurrentElse = levelCurrent;
+ levelMinCurrentBegin = levelCurrent;
+ visibleChars = 0;
+ }
+ /***************************************/
+ if (!isspacechar(ch)) visibleChars++;
+ }
+
+ /***************************************/
+// Platform::DebugPrintf("Line[%04d] ---------------------------------------------------- Level[%x]\n", lineCurrent+1, levelCurrent);
+}
+
+//=============================================================================
+static void FoldVHDLDoc(unsigned int startPos, int length, int initStyle, WordList *[],
+ Accessor &styler) {
+ FoldNoBoxVHDLDoc(startPos, length, initStyle, styler);
+}
+
+//=============================================================================
+static const char * const VHDLWordLists[] = {
+ "Keywords",
+ "Operators",
+ "Attributes",
+ "Standard Functions",
+ "Standard Packages",
+ "Standard Types",
+ "User Words",
+ 0,
+ };
+
+
+LexerModule lmVHDL(SCLEX_VHDL, ColouriseVHDLDoc, "vhdl", FoldVHDLDoc, VHDLWordLists);
+
+
+// Keyword:
+// access after alias all architecture array assert attribute begin block body buffer bus case component
+// configuration constant disconnect downto else elsif end entity exit file for function generate generic
+// group guarded if impure in inertial inout is label library linkage literal loop map new next null of
+// on open others out package port postponed procedure process pure range record register reject report
+// return select severity shared signal subtype then to transport type unaffected units until use variable
+// wait when while with
+//
+// Operators:
+// abs and mod nand nor not or rem rol ror sla sll sra srl xnor xor
+//
+// Attributes:
+// left right low high ascending image value pos val succ pred leftof rightof base range reverse_range
+// length delayed stable quiet transaction event active last_event last_active last_value driving
+// driving_value simple_name path_name instance_name
+//
+// Std Functions:
+// now readline read writeline write endfile resolved to_bit to_bitvector to_stdulogic to_stdlogicvector
+// to_stdulogicvector to_x01 to_x01z to_UX01 rising_edge falling_edge is_x shift_left shift_right rotate_left
+// rotate_right resize to_integer to_unsigned to_signed std_match to_01
+//
+// Std Packages:
+// std ieee work standard textio std_logic_1164 std_logic_arith std_logic_misc std_logic_signed
+// std_logic_textio std_logic_unsigned numeric_bit numeric_std math_complex math_real vital_primitives
+// vital_timing
+//
+// Std Types:
+// boolean bit character severity_level integer real time delay_length natural positive string bit_vector
+// file_open_kind file_open_status line text side width std_ulogic std_ulogic_vector std_logic
+// std_logic_vector X01 X01Z UX01 UX01Z unsigned signed
+//
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVerilog.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVerilog.cxx
new file mode 100644
index 00000000000..82b75844fba
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVerilog.cxx
@@ -0,0 +1,1055 @@
+// Scintilla source code edit control
+/** @file LexVerilog.cxx
+ ** Lexer for Verilog.
+ ** Written by Avi Yegudin, based on C++ lexer by Neil Hodgson
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#include "OptionSet.h"
+#include "SubStyles.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+namespace {
+ // Use an unnamed namespace to protect the functions and classes from name conflicts
+
+struct PPDefinition {
+ int line;
+ std::string key;
+ std::string value;
+ bool isUndef;
+ std::string arguments;
+ PPDefinition(int line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, std::string arguments_="") :
+ line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) {
+ }
+};
+
+class LinePPState {
+ int state;
+ int ifTaken;
+ int level;
+ bool ValidLevel() const {
+ return level >= 0 && level < 32;
+ }
+ int maskLevel() const {
+ return 1 << level;
+ }
+public:
+ LinePPState() : state(0), ifTaken(0), level(-1) {
+ }
+ bool IsInactive() const {
+ return state != 0;
+ }
+ bool CurrentIfTaken() const {
+ return (ifTaken & maskLevel()) != 0;
+ }
+ void StartSection(bool on) {
+ level++;
+ if (ValidLevel()) {
+ if (on) {
+ state &= ~maskLevel();
+ ifTaken |= maskLevel();
+ } else {
+ state |= maskLevel();
+ ifTaken &= ~maskLevel();
+ }
+ }
+ }
+ void EndSection() {
+ if (ValidLevel()) {
+ state &= ~maskLevel();
+ ifTaken &= ~maskLevel();
+ }
+ level--;
+ }
+ void InvertCurrentLevel() {
+ if (ValidLevel()) {
+ state ^= maskLevel();
+ ifTaken |= maskLevel();
+ }
+ }
+};
+
+// Hold the preprocessor state for each line seen.
+// Currently one entry per line but could become sparse with just one entry per preprocessor line.
+class PPStates {
+ std::vector<LinePPState> vlls;
+public:
+ LinePPState ForLine(int line) const {
+ if ((line > 0) && (vlls.size() > static_cast<size_t>(line))) {
+ return vlls[line];
+ } else {
+ return LinePPState();
+ }
+ }
+ void Add(int line, LinePPState lls) {
+ vlls.resize(line+1);
+ vlls[line] = lls;
+ }
+};
+
+// Options used for LexerVerilog
+struct OptionsVerilog {
+ bool foldComment;
+ bool foldPreprocessor;
+ bool foldPreprocessorElse;
+ bool foldCompact;
+ bool foldAtElse;
+ bool foldAtModule;
+ bool trackPreprocessor;
+ bool updatePreprocessor;
+ bool portStyling;
+ bool allUppercaseDocKeyword;
+ OptionsVerilog() {
+ foldComment = false;
+ foldPreprocessor = false;
+ foldPreprocessorElse = false;
+ foldCompact = false;
+ foldAtElse = false;
+ foldAtModule = false;
+ // for backwards compatibility, preprocessor functionality is disabled by default
+ trackPreprocessor = false;
+ updatePreprocessor = false;
+ // for backwards compatibility, treat input/output/inout as regular keywords
+ portStyling = false;
+ // for backwards compatibility, don't treat all uppercase identifiers as documentation keywords
+ allUppercaseDocKeyword = false;
+ }
+};
+
+struct OptionSetVerilog : public OptionSet<OptionsVerilog> {
+ OptionSetVerilog() {
+ DefineProperty("fold.comment", &OptionsVerilog::foldComment,
+ "This option enables folding multi-line comments when using the Verilog lexer.");
+ DefineProperty("fold.preprocessor", &OptionsVerilog::foldPreprocessor,
+ "This option enables folding preprocessor directives when using the Verilog lexer.");
+ DefineProperty("fold.compact", &OptionsVerilog::foldCompact);
+ DefineProperty("fold.at.else", &OptionsVerilog::foldAtElse,
+ "This option enables folding on the else line of an if statement.");
+ DefineProperty("fold.verilog.flags", &OptionsVerilog::foldAtModule,
+ "This option enables folding module definitions. Typically source files "
+ "contain only one module definition so this option is somewhat useless.");
+ DefineProperty("lexer.verilog.track.preprocessor", &OptionsVerilog::trackPreprocessor,
+ "Set to 1 to interpret `if/`else/`endif to grey out code that is not active.");
+ DefineProperty("lexer.verilog.update.preprocessor", &OptionsVerilog::updatePreprocessor,
+ "Set to 1 to update preprocessor definitions when `define, `undef, or `undefineall found.");
+ DefineProperty("lexer.verilog.portstyling", &OptionsVerilog::portStyling,
+ "Set to 1 to style input, output, and inout ports differently from regular keywords.");
+ DefineProperty("lexer.verilog.allupperkeywords", &OptionsVerilog::allUppercaseDocKeyword,
+ "Set to 1 to style identifiers that are all uppercase as documentation keyword.");
+ DefineProperty("lexer.verilog.fold.preprocessor.else", &OptionsVerilog::foldPreprocessorElse,
+ "This option enables folding on `else and `elsif preprocessor directives.");
+ }
+};
+
+const char styleSubable[] = {0};
+
+}
+
+class LexerVerilog : public ILexerWithSubStyles {
+ CharacterSet setWord;
+ WordList keywords;
+ WordList keywords2;
+ WordList keywords3;
+ WordList keywords4;
+ WordList keywords5;
+ WordList ppDefinitions;
+ PPStates vlls;
+ std::vector<PPDefinition> ppDefineHistory;
+ struct SymbolValue {
+ std::string value;
+ std::string arguments;
+ SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) {
+ }
+ SymbolValue &operator = (const std::string &value_) {
+ value = value_;
+ arguments.clear();
+ return *this;
+ }
+ bool IsMacro() const {
+ return !arguments.empty();
+ }
+ };
+ typedef std::map<std::string, SymbolValue> SymbolTable;
+ SymbolTable preprocessorDefinitionsStart;
+ OptionsVerilog options;
+ OptionSetVerilog osVerilog;
+ enum { activeFlag = 0x40 };
+ SubStyles subStyles;
+
+ // states at end of line (EOL) during fold operations:
+ // foldExternFlag: EOL while parsing an extern function/task declaration terminated by ';'
+ // foldWaitDisableFlag: EOL while parsing wait or disable statement, terminated by "fork" or '('
+ // typdefFlag: EOL while parsing typedef statement, terminated by ';'
+ enum {foldExternFlag = 0x01, foldWaitDisableFlag = 0x02, typedefFlag = 0x04};
+ // map using line number as key to store fold state information
+ std::map<int, int> foldState;
+
+public:
+ LexerVerilog() :
+ setWord(CharacterSet::setAlphaNum, "._", 0x80, true),
+ subStyles(styleSubable, 0x80, 0x40, activeFlag) {
+ }
+ virtual ~LexerVerilog() {}
+ int SCI_METHOD Version() const {
+ return lvSubStyles;
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ const char* SCI_METHOD PropertyNames() {
+ return osVerilog.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char* name) {
+ return osVerilog.PropertyType(name);
+ }
+ const char* SCI_METHOD DescribeProperty(const char* name) {
+ return osVerilog.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char* key, const char* val) {
+ return osVerilog.PropertySet(&options, key, val);
+ }
+ const char* SCI_METHOD DescribeWordListSets() {
+ return osVerilog.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char* wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void* SCI_METHOD PrivateCall(int, void*) {
+ return 0;
+ }
+ int SCI_METHOD LineEndTypesSupported() {
+ return SC_LINE_END_TYPE_UNICODE;
+ }
+ int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) {
+ return subStyles.Allocate(styleBase, numberStyles);
+ }
+ int SCI_METHOD SubStylesStart(int styleBase) {
+ return subStyles.Start(styleBase);
+ }
+ int SCI_METHOD SubStylesLength(int styleBase) {
+ return subStyles.Length(styleBase);
+ }
+ int SCI_METHOD StyleFromSubStyle(int subStyle) {
+ int styleBase = subStyles.BaseStyle(MaskActive(subStyle));
+ int active = subStyle & activeFlag;
+ return styleBase | active;
+ }
+ int SCI_METHOD PrimaryStyleFromStyle(int style) {
+ return MaskActive(style);
+ }
+ void SCI_METHOD FreeSubStyles() {
+ subStyles.Free();
+ }
+ void SCI_METHOD SetIdentifiers(int style, const char *identifiers) {
+ subStyles.SetIdentifiers(style, identifiers);
+ }
+ int SCI_METHOD DistanceToSecondaryStyles() {
+ return activeFlag;
+ }
+ const char * SCI_METHOD GetSubStyleBases() {
+ return styleSubable;
+ }
+ static ILexer* LexerFactoryVerilog() {
+ return new LexerVerilog();
+ }
+ static int MaskActive(int style) {
+ return style & ~activeFlag;
+ }
+ std::vector<std::string> Tokenize(const std::string &expr) const;
+};
+
+int SCI_METHOD LexerVerilog::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &keywords;
+ break;
+ case 1:
+ wordListN = &keywords2;
+ break;
+ case 2:
+ wordListN = &keywords3;
+ break;
+ case 3:
+ wordListN = &keywords4;
+ break;
+ case 4:
+ wordListN = &keywords5;
+ break;
+ case 5:
+ wordListN = &ppDefinitions;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ if (n == 5) {
+ // Rebuild preprocessorDefinitions
+ preprocessorDefinitionsStart.clear();
+ for (int nDefinition = 0; nDefinition < ppDefinitions.Length(); nDefinition++) {
+ const char *cpDefinition = ppDefinitions.WordAt(nDefinition);
+ const char *cpEquals = strchr(cpDefinition, '=');
+ if (cpEquals) {
+ std::string name(cpDefinition, cpEquals - cpDefinition);
+ std::string val(cpEquals+1);
+ size_t bracket = name.find('(');
+ size_t bracketEnd = name.find(')');
+ if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) {
+ // Macro
+ std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1);
+ name = name.substr(0, bracket);
+ preprocessorDefinitionsStart[name] = SymbolValue(val, args);
+ } else {
+ preprocessorDefinitionsStart[name] = val;
+ }
+ } else {
+ std::string name(cpDefinition);
+ std::string val("1");
+ preprocessorDefinitionsStart[name] = val;
+ }
+ }
+ }
+ }
+ }
+ return firstModification;
+}
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '\''|| ch == '$');
+}
+
+static inline bool IsAWordStart(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '$');
+}
+
+static inline bool AllUpperCase(const char *a) {
+ while (*a) {
+ if (*a >= 'a' && *a <= 'z') return false;
+ a++;
+ }
+ return true;
+}
+
+// Functor used to truncate history
+struct After {
+ int line;
+ explicit After(int line_) : line(line_) {}
+ bool operator()(PPDefinition &p) const {
+ return p.line > line;
+ }
+};
+
+static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) {
+ std::string restOfLine;
+ int i =0;
+ char ch = styler.SafeGetCharAt(start, '\n');
+ int endLine = styler.LineEnd(styler.GetLine(start));
+ while (((start+i) < endLine) && (ch != '\r')) {
+ char chNext = styler.SafeGetCharAt(start + i + 1, '\n');
+ if (ch == '/' && (chNext == '/' || chNext == '*'))
+ break;
+ if (allowSpace || (ch != ' '))
+ restOfLine += ch;
+ i++;
+ ch = chNext;
+ }
+ return restOfLine;
+}
+
+static bool IsSpaceOrTab(int ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+void SCI_METHOD LexerVerilog::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
+{
+ LexAccessor styler(pAccess);
+
+ const int kwOther=0, kwDot=0x100, kwInput=0x200, kwOutput=0x300, kwInout=0x400;
+ int lineState = kwOther;
+ bool continuationLine = false;
+
+ int curLine = styler.GetLine(startPos);
+ if (curLine > 0) lineState = styler.GetLineState(curLine - 1);
+
+ // Do not leak onto next line
+ if (initStyle == SCE_V_STRINGEOL)
+ initStyle = SCE_V_DEFAULT;
+
+ if ((MaskActive(initStyle) == SCE_V_PREPROCESSOR) ||
+ (MaskActive(initStyle) == SCE_V_COMMENTLINE) ||
+ (MaskActive(initStyle) == SCE_V_COMMENTLINEBANG)) {
+ // Set continuationLine if last character of previous line is '\'
+ if (curLine > 0) {
+ int endLinePrevious = styler.LineEnd(curLine - 1);
+ if (endLinePrevious > 0) {
+ continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
+ }
+ }
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+ LinePPState preproc = vlls.ForLine(curLine);
+
+ bool definitionsChanged = false;
+
+ // Truncate ppDefineHistory before current line
+
+ if (!options.updatePreprocessor)
+ ppDefineHistory.clear();
+
+ std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(curLine-1));
+ if (itInvalid != ppDefineHistory.end()) {
+ ppDefineHistory.erase(itInvalid, ppDefineHistory.end());
+ definitionsChanged = true;
+ }
+
+ SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart;
+ for (std::vector<PPDefinition>::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) {
+ if (itDef->isUndef)
+ preprocessorDefinitions.erase(itDef->key);
+ else
+ preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments);
+ }
+
+ int activitySet = preproc.IsInactive() ? activeFlag : 0;
+ int lineEndNext = styler.LineEnd(curLine);
+ bool isEscapedId = false; // true when parsing an escaped Identifier
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineStart) {
+ if (sc.state == SCE_V_STRING) {
+ // Prevent SCE_V_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_V_STRING);
+ }
+ if ((MaskActive(sc.state) == SCE_V_PREPROCESSOR) && (!continuationLine)) {
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ }
+ if (preproc.IsInactive()) {
+ activitySet = activeFlag;
+ sc.SetState(sc.state | activitySet);
+ }
+ }
+
+ if (sc.atLineEnd) {
+ curLine++;
+ lineEndNext = styler.LineEnd(curLine);
+ vlls.Add(curLine, preproc);
+ // Update the line state, so it can be seen by next line
+ styler.SetLineState(curLine, lineState);
+ isEscapedId = false; // EOL terminates an escaped Identifier
+ }
+
+ // Handle line continuation generically.
+ if (sc.ch == '\\') {
+ if (static_cast<int>((sc.currentPos+1)) >= lineEndNext) {
+ curLine++;
+ lineEndNext = styler.LineEnd(curLine);
+ vlls.Add(curLine, preproc);
+ // Update the line state, so it can be seen by next line
+ styler.SetLineState(curLine, lineState);
+ sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ // Even in UTF-8, \r and \n are separate
+ sc.Forward();
+ }
+ continuationLine = true;
+ sc.Forward();
+ continue;
+ }
+ }
+
+ // for comment keyword
+ if (MaskActive(sc.state) == SCE_V_COMMENT_WORD && !IsAWordChar(sc.ch)) {
+ char s[100];
+ int state = lineState & 0xff;
+ sc.GetCurrent(s, sizeof(s));
+ if (keywords5.InList(s)) {
+ sc.ChangeState(SCE_V_COMMENT_WORD|activitySet);
+ } else {
+ sc.ChangeState(state|activitySet);
+ }
+ sc.SetState(state|activitySet);
+ }
+
+ const bool atLineEndBeforeSwitch = sc.atLineEnd;
+
+ // Determine if the current state should terminate.
+ switch (MaskActive(sc.state)) {
+ case SCE_V_OPERATOR:
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ break;
+ case SCE_V_NUMBER:
+ if (!(IsAWordChar(sc.ch) || (sc.ch == '?'))) {
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_V_IDENTIFIER:
+ if (!isEscapedId &&(!IsAWordChar(sc.ch) || (sc.ch == '.'))) {
+ char s[100];
+ lineState &= 0xff00;
+ sc.GetCurrent(s, sizeof(s));
+ if (options.portStyling && (strcmp(s, "input") == 0)) {
+ lineState = kwInput;
+ sc.ChangeState(SCE_V_INPUT|activitySet);
+ } else if (options.portStyling && (strcmp(s, "output") == 0)) {
+ lineState = kwOutput;
+ sc.ChangeState(SCE_V_OUTPUT|activitySet);
+ } else if (options.portStyling && (strcmp(s, "inout") == 0)) {
+ lineState = kwInout;
+ sc.ChangeState(SCE_V_INOUT|activitySet);
+ } else if (lineState == kwInput) {
+ sc.ChangeState(SCE_V_INPUT|activitySet);
+ } else if (lineState == kwOutput) {
+ sc.ChangeState(SCE_V_OUTPUT|activitySet);
+ } else if (lineState == kwInout) {
+ sc.ChangeState(SCE_V_INOUT|activitySet);
+ } else if (lineState == kwDot) {
+ lineState = kwOther;
+ if (options.portStyling)
+ sc.ChangeState(SCE_V_PORT_CONNECT|activitySet);
+ } else if (keywords.InList(s)) {
+ sc.ChangeState(SCE_V_WORD|activitySet);
+ } else if (keywords2.InList(s)) {
+ sc.ChangeState(SCE_V_WORD2|activitySet);
+ } else if (keywords3.InList(s)) {
+ sc.ChangeState(SCE_V_WORD3|activitySet);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_V_USER|activitySet);
+ } else if (options.allUppercaseDocKeyword && AllUpperCase(s)) {
+ sc.ChangeState(SCE_V_USER|activitySet);
+ }
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_V_PREPROCESSOR:
+ if (!IsAWordChar(sc.ch) || sc.atLineEnd) {
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ }
+ break;
+ case SCE_V_COMMENT:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ sc.ForwardSetState(SCE_V_DEFAULT|activitySet);
+ } else if (IsAWordStart(sc.ch)) {
+ lineState = sc.state | (lineState & 0xff00);
+ sc.SetState(SCE_V_COMMENT_WORD|activitySet);
+ }
+ break;
+ case SCE_V_COMMENTLINE:
+ case SCE_V_COMMENTLINEBANG:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ } else if (IsAWordStart(sc.ch)) {
+ lineState = sc.state | (lineState & 0xff00);
+ sc.SetState(SCE_V_COMMENT_WORD|activitySet);
+ }
+ break;
+ case SCE_V_STRING:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_V_DEFAULT|activitySet);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_V_STRINGEOL|activitySet);
+ sc.ForwardSetState(SCE_V_DEFAULT|activitySet);
+ }
+ break;
+ }
+
+ if (sc.atLineEnd && !atLineEndBeforeSwitch) {
+ // State exit processing consumed characters up to end of line.
+ curLine++;
+ lineEndNext = styler.LineEnd(curLine);
+ vlls.Add(curLine, preproc);
+ // Update the line state, so it can be seen by next line
+ styler.SetLineState(curLine, lineState);
+ isEscapedId = false; // EOL terminates an escaped Identifier
+ }
+
+ // Determine if a new state should be entered.
+ if (MaskActive(sc.state) == SCE_V_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '\'') || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_V_NUMBER|activitySet);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_V_IDENTIFIER|activitySet);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_V_COMMENT|activitySet);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('/', '/')) {
+ if (sc.Match("//!")) // Nice to have a different comment style
+ sc.SetState(SCE_V_COMMENTLINEBANG|activitySet);
+ else
+ sc.SetState(SCE_V_COMMENTLINE|activitySet);
+ } else if (sc.ch == '\"') {
+ sc.SetState(SCE_V_STRING|activitySet);
+ } else if (sc.ch == '`') {
+ sc.SetState(SCE_V_PREPROCESSOR|activitySet);
+ // Skip whitespace between ` and preprocessor word
+ do {
+ sc.Forward();
+ } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More());
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_V_DEFAULT|activitySet);
+ styler.SetLineState(curLine, lineState);
+ } else {
+ if (options.trackPreprocessor) {
+ if (sc.Match("ifdef") || sc.Match("ifndef")) {
+ bool isIfDef = sc.Match("ifdef");
+ int i = isIfDef ? 5 : 6;
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false);
+ bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end();
+ preproc.StartSection(isIfDef == foundDef);
+ } else if (sc.Match("else")) {
+ if (!preproc.CurrentIfTaken()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet) {
+ sc.ChangeState(SCE_V_PREPROCESSOR|activitySet);
+ }
+ } else if (!preproc.IsInactive()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet) {
+ sc.ChangeState(SCE_V_PREPROCESSOR|activitySet);
+ }
+ }
+ } else if (sc.Match("elsif")) {
+ // Ensure only one chosen out of `if .. `elsif .. `elsif .. `else .. `endif
+ if (!preproc.CurrentIfTaken()) {
+ // Similar to `ifdef
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true);
+ bool ifGood = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end();
+ if (ifGood) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_V_PREPROCESSOR|activitySet);
+ }
+ } else if (!preproc.IsInactive()) {
+ preproc.InvertCurrentLevel();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ if (!activitySet)
+ sc.ChangeState(SCE_V_PREPROCESSOR|activitySet);
+ }
+ } else if (sc.Match("endif")) {
+ preproc.EndSection();
+ activitySet = preproc.IsInactive() ? activeFlag : 0;
+ sc.ChangeState(SCE_V_PREPROCESSOR|activitySet);
+ } else if (sc.Match("define")) {
+ if (options.updatePreprocessor && !preproc.IsInactive()) {
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true);
+ size_t startName = 0;
+ while ((startName < restOfLine.length()) && IsSpaceOrTab(restOfLine[startName]))
+ startName++;
+ size_t endName = startName;
+ while ((endName < restOfLine.length()) && setWord.Contains(static_cast<unsigned char>(restOfLine[endName])))
+ endName++;
+ std::string key = restOfLine.substr(startName, endName-startName);
+ if ((endName < restOfLine.length()) && (restOfLine.at(endName) == '(')) {
+ // Macro
+ size_t endArgs = endName;
+ while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')'))
+ endArgs++;
+ std::string args = restOfLine.substr(endName + 1, endArgs - endName - 1);
+ size_t startValue = endArgs+1;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value;
+ if (startValue < restOfLine.length())
+ value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = SymbolValue(value, args);
+ ppDefineHistory.push_back(PPDefinition(curLine, key, value, false, args));
+ definitionsChanged = true;
+ } else {
+ // Value
+ size_t startValue = endName;
+ while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue]))
+ startValue++;
+ std::string value = restOfLine.substr(startValue);
+ preprocessorDefinitions[key] = value;
+ ppDefineHistory.push_back(PPDefinition(curLine, key, value));
+ definitionsChanged = true;
+ }
+ }
+ } else if (sc.Match("undefineall")) {
+ if (options.updatePreprocessor && !preproc.IsInactive()) {
+ // remove all preprocessor definitions
+ std::map<std::string, SymbolValue>::iterator itDef;
+ for(itDef = preprocessorDefinitions.begin(); itDef != preprocessorDefinitions.end(); ++itDef) {
+ ppDefineHistory.push_back(PPDefinition(curLine, itDef->first, "", true));
+ }
+ preprocessorDefinitions.clear();
+ definitionsChanged = true;
+ }
+ } else if (sc.Match("undef")) {
+ if (options.updatePreprocessor && !preproc.IsInactive()) {
+ std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, true);
+ std::vector<std::string> tokens = Tokenize(restOfLine);
+ std::string key;
+ if (tokens.size() >= 1) {
+ key = tokens[0];
+ preprocessorDefinitions.erase(key);
+ ppDefineHistory.push_back(PPDefinition(curLine, key, "", true));
+ definitionsChanged = true;
+ }
+ }
+ }
+ }
+ }
+ } else if (sc.ch == '\\') {
+ // escaped identifier, everything is ok up to whitespace
+ isEscapedId = true;
+ sc.SetState(SCE_V_IDENTIFIER|activitySet);
+ } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '#') {
+ sc.SetState(SCE_V_OPERATOR|activitySet);
+ if (sc.ch == '.') lineState = kwDot;
+ if (sc.ch == ';') lineState = kwOther;
+ }
+ }
+ if (isEscapedId && isspacechar(sc.ch)) {
+ isEscapedId = false;
+ }
+ }
+ if (definitionsChanged) {
+ styler.ChangeLexerState(startPos, startPos + length);
+ }
+ sc.Complete();
+}
+
+static bool IsStreamCommentStyle(int style) {
+ return style == SCE_V_COMMENT;
+}
+
+static bool IsCommentLine(int line, LexAccessor &styler) {
+ int pos = styler.LineStart(line);
+ int eolPos = styler.LineStart(line + 1) - 1;
+ for (int i = pos; i < eolPos; i++) {
+ char ch = styler[i];
+ char chNext = styler.SafeGetCharAt(i + 1);
+ int style = styler.StyleAt(i);
+ if (ch == '/' && chNext == '/' &&
+ (style == SCE_V_COMMENTLINE || style == SCE_V_COMMENTLINEBANG)) {
+ return true;
+ } else if (!IsASpaceOrTab(ch)) {
+ return false;
+ }
+ }
+ return false;
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+void SCI_METHOD LexerVerilog::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
+{
+ LexAccessor styler(pAccess);
+ bool foldAtBrace = 1;
+ bool foldAtParenthese = 1;
+
+ int lineCurrent = styler.GetLine(startPos);
+ // Move back one line to be compatible with LexerModule::Fold behavior, fixes problem with foldComment behavior
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ int newStartPos = styler.LineStart(lineCurrent);
+ length += startPos - newStartPos;
+ startPos = newStartPos;
+ initStyle = 0;
+ if (startPos > 0) {
+ initStyle = styler.StyleAt(startPos - 1);
+ }
+ }
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (lineCurrent > 0)
+ levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = MaskActive(styler.StyleAt(startPos));
+ int style = MaskActive(initStyle);
+
+ // restore fold state (if it exists) for prior line
+ int stateCurrent = 0;
+ std::map<int,int>::iterator foldStateIterator = foldState.find(lineCurrent-1);
+ if (foldStateIterator != foldState.end()) {
+ stateCurrent = foldStateIterator->second;
+ }
+
+ // remove all foldState entries after lineCurrent-1
+ foldStateIterator = foldState.upper_bound(lineCurrent-1);
+ if (foldStateIterator != foldState.end()) {
+ foldState.erase(foldStateIterator, foldState.end());
+ }
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = MaskActive(styler.StyleAt(i + 1));
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (options.foldComment && IsStreamCommentStyle(style)) {
+ if (!IsStreamCommentStyle(stylePrev)) {
+ levelNext++;
+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelNext--;
+ }
+ }
+ if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler))
+ {
+ if (!IsCommentLine(lineCurrent - 1, styler)
+ && IsCommentLine(lineCurrent + 1, styler))
+ levelNext++;
+ else if (IsCommentLine(lineCurrent - 1, styler)
+ && !IsCommentLine(lineCurrent+1, styler))
+ levelNext--;
+ }
+ if (options.foldComment && (style == SCE_V_COMMENTLINE)) {
+ if ((ch == '/') && (chNext == '/')) {
+ char chNext2 = styler.SafeGetCharAt(i + 2);
+ if (chNext2 == '{') {
+ levelNext++;
+ } else if (chNext2 == '}') {
+ levelNext--;
+ }
+ }
+ }
+ if (options.foldPreprocessor && (style == SCE_V_PREPROCESSOR)) {
+ if (ch == '`') {
+ unsigned int j = i + 1;
+ while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) {
+ j++;
+ }
+ if (styler.Match(j, "if")) {
+ if (options.foldPreprocessorElse) {
+ // Measure the minimum before a begin to allow
+ // folding on "end else begin"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ }
+ levelNext++;
+ } else if (options.foldPreprocessorElse && styler.Match(j, "else")) {
+ levelNext--;
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (options.foldPreprocessorElse && styler.Match(j, "elsif")) {
+ levelNext--;
+ // Measure the minimum before a begin to allow
+ // folding on "end else begin"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (styler.Match(j, "endif")) {
+ levelNext--;
+ }
+ }
+ }
+ if (style == SCE_V_OPERATOR) {
+ if (foldAtParenthese) {
+ if (ch == '(') {
+ levelNext++;
+ } else if (ch == ')') {
+ levelNext--;
+ }
+ }
+ // semicolons terminate external declarations
+ if (ch == ';') {
+ // extern and pure virtual declarations terminated by semicolon
+ if (stateCurrent & foldExternFlag) {
+ levelNext--;
+ stateCurrent &= ~foldExternFlag;
+ }
+ // wait and disable statements terminated by semicolon
+ if (stateCurrent & foldWaitDisableFlag) {
+ stateCurrent &= ~foldWaitDisableFlag;
+ }
+ // typedef statements terminated by semicolon
+ if (stateCurrent & typedefFlag) {
+ stateCurrent &= ~typedefFlag;
+ }
+ }
+ // wait and disable statements containing '(' will not contain "fork" keyword, special processing is not needed
+ if (ch == '(') {
+ if (stateCurrent & foldWaitDisableFlag) {
+ stateCurrent &= ~foldWaitDisableFlag;
+ }
+ }
+ }
+ if (style == SCE_V_OPERATOR) {
+ if (foldAtBrace) {
+ if (ch == '{') {
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ }
+ if (style == SCE_V_WORD && stylePrev != SCE_V_WORD) {
+ unsigned int j = i;
+ if (styler.Match(j, "case") ||
+ styler.Match(j, "casex") ||
+ styler.Match(j, "casez") ||
+ styler.Match(j, "covergroup") ||
+ styler.Match(j, "function") ||
+ styler.Match(j, "generate") ||
+ styler.Match(j, "interface") ||
+ styler.Match(j, "package") ||
+ styler.Match(j, "primitive") ||
+ styler.Match(j, "program") ||
+ styler.Match(j, "sequence") ||
+ styler.Match(j, "specify") ||
+ styler.Match(j, "table") ||
+ styler.Match(j, "task") ||
+ (styler.Match(j, "module") && options.foldAtModule)) {
+ levelNext++;
+ } else if (styler.Match(j, "begin")) {
+ // Measure the minimum before a begin to allow
+ // folding on "end else begin"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (styler.Match(j, "class")) {
+ // class does not introduce a block when used in a typedef statement
+ if (!(stateCurrent & typedefFlag))
+ levelNext++;
+ } else if (styler.Match(j, "fork")) {
+ // fork does not introduce a block when used in a wait or disable statement
+ if (stateCurrent & foldWaitDisableFlag) {
+ stateCurrent &= ~foldWaitDisableFlag;
+ } else
+ levelNext++;
+ } else if (styler.Match(j, "endcase") ||
+ styler.Match(j, "endclass") ||
+ styler.Match(j, "endfunction") ||
+ styler.Match(j, "endgenerate") ||
+ styler.Match(j, "endgroup") ||
+ styler.Match(j, "endinterface") ||
+ styler.Match(j, "endpackage") ||
+ styler.Match(j, "endprimitive") ||
+ styler.Match(j, "endprogram") ||
+ styler.Match(j, "endsequence") ||
+ styler.Match(j, "endspecify") ||
+ styler.Match(j, "endtable") ||
+ styler.Match(j, "endtask") ||
+ styler.Match(j, "join") ||
+ styler.Match(j, "join_any") ||
+ styler.Match(j, "join_none") ||
+ (styler.Match(j, "endmodule") && options.foldAtModule) ||
+ (styler.Match(j, "end") && !IsAWordChar(styler.SafeGetCharAt(j + 3)))) {
+ levelNext--;
+ } else if (styler.Match(j, "extern") ||
+ styler.Match(j, "pure")) {
+ // extern and pure virtual functions/tasks are terminated by ';' not endfunction/endtask
+ stateCurrent |= foldExternFlag;
+ } else if (styler.Match(j, "disable") ||
+ styler.Match(j, "wait")) {
+ // fork does not introduce a block when used in a wait or disable statement
+ stateCurrent |= foldWaitDisableFlag;
+ } else if (styler.Match(j, "typedef")) {
+ stateCurrent |= typedefFlag;
+ }
+ }
+ if (atEOL) {
+ int levelUse = levelCurrent;
+ if (options.foldAtElse||options.foldPreprocessorElse) {
+ levelUse = levelMinCurrent;
+ }
+ int lev = levelUse | levelNext << 16;
+ if (visibleChars == 0 && options.foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (stateCurrent) {
+ foldState[lineCurrent] = stateCurrent;
+ }
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ visibleChars = 0;
+ }
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+}
+
+std::vector<std::string> LexerVerilog::Tokenize(const std::string &expr) const {
+ // Break into tokens
+ std::vector<std::string> tokens;
+ const char *cp = expr.c_str();
+ while (*cp) {
+ std::string word;
+ if (setWord.Contains(static_cast<unsigned char>(*cp))) {
+ // Identifiers and numbers
+ while (setWord.Contains(static_cast<unsigned char>(*cp))) {
+ word += *cp;
+ cp++;
+ }
+ } else if (IsSpaceOrTab(*cp)) {
+ while (IsSpaceOrTab(*cp)) {
+ cp++;
+ }
+ continue;
+ } else {
+ // Should handle strings, characters, and comments here
+ word += *cp;
+ cp++;
+ }
+ tokens.push_back(word);
+ }
+ return tokens;
+}
+
+static const char * const verilogWordLists[] = {
+ "Primary keywords and identifiers",
+ "Secondary keywords and identifiers",
+ "System Tasks",
+ "User defined tasks and identifiers",
+ "Documentation comment keywords",
+ "Preprocessor definitions",
+ 0,
+ };
+
+LexerModule lmVerilog(SCLEX_VERILOG, LexerVerilog::LexerFactoryVerilog, "verilog", verilogWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVisualProlog.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVisualProlog.cxx
new file mode 100644
index 00000000000..24e19e24ea3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexVisualProlog.cxx
@@ -0,0 +1,504 @@
+// Scintilla source code edit control
+/** @file LexVisualProlog.cxx
+** Lexer for Visual Prolog.
+**/
+// Author Thomas Linder Puls, Prolog Development Denter A/S, http://www.visual-prolog.com
+// Based on Lexer for C++, C, Java, and JavaScript.
+// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// The line state contains:
+// In SCE_VISUALPROLOG_STRING_VERBATIM_EOL (i.e. multiline string literal): The closingQuote.
+// else (for SCE_VISUALPROLOG_COMMENT_BLOCK): The comment nesting level
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4786)
+#endif
+
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "CharacterCategory.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Options used for LexerVisualProlog
+struct OptionsVisualProlog {
+ OptionsVisualProlog() {
+ }
+};
+
+static const char *const visualPrologWordLists[] = {
+ "Major keywords (class, predicates, ...)",
+ "Minor keywords (if, then, try, ...)",
+ "Directive keywords without the '#' (include, requires, ...)",
+ "Documentation keywords without the '@' (short, detail, ...)",
+ 0,
+};
+
+struct OptionSetVisualProlog : public OptionSet<OptionsVisualProlog> {
+ OptionSetVisualProlog() {
+ DefineWordListSets(visualPrologWordLists);
+ }
+};
+
+class LexerVisualProlog : public ILexer {
+ WordList majorKeywords;
+ WordList minorKeywords;
+ WordList directiveKeywords;
+ WordList docKeywords;
+ OptionsVisualProlog options;
+ OptionSetVisualProlog osVisualProlog;
+public:
+ LexerVisualProlog() {
+ }
+ virtual ~LexerVisualProlog() {
+ }
+ void SCI_METHOD Release() {
+ delete this;
+ }
+ int SCI_METHOD Version() const {
+ return lvOriginal;
+ }
+ const char * SCI_METHOD PropertyNames() {
+ return osVisualProlog.PropertyNames();
+ }
+ int SCI_METHOD PropertyType(const char *name) {
+ return osVisualProlog.PropertyType(name);
+ }
+ const char * SCI_METHOD DescribeProperty(const char *name) {
+ return osVisualProlog.DescribeProperty(name);
+ }
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets() {
+ return osVisualProlog.DescribeWordListSets();
+ }
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess);
+
+ void * SCI_METHOD PrivateCall(int, void *) {
+ return 0;
+ }
+
+ static ILexer *LexerFactoryVisualProlog() {
+ return new LexerVisualProlog();
+ }
+};
+
+int SCI_METHOD LexerVisualProlog::PropertySet(const char *key, const char *val) {
+ if (osVisualProlog.PropertySet(&options, key, val)) {
+ return 0;
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerVisualProlog::WordListSet(int n, const char *wl) {
+ WordList *wordListN = 0;
+ switch (n) {
+ case 0:
+ wordListN = &majorKeywords;
+ break;
+ case 1:
+ wordListN = &minorKeywords;
+ break;
+ case 2:
+ wordListN = &directiveKeywords;
+ break;
+ case 3:
+ wordListN = &docKeywords;
+ break;
+ }
+ int firstModification = -1;
+ if (wordListN) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*wordListN != wlNew) {
+ wordListN->Set(wl);
+ firstModification = 0;
+ }
+ }
+ return firstModification;
+}
+
+// Functor used to truncate history
+struct After {
+ int line;
+ After(int line_) : line(line_) {}
+};
+
+static bool isLowerLetter(int ch){
+ return ccLl == CategoriseCharacter(ch);
+}
+
+static bool isUpperLetter(int ch){
+ return ccLu == CategoriseCharacter(ch);
+}
+
+static bool isAlphaNum(int ch){
+ CharacterCategory cc = CategoriseCharacter(ch);
+ return (ccLu == cc || ccLl == cc || ccLt == cc || ccLm == cc || ccLo == cc || ccNd == cc || ccNl == cc || ccNo == cc);
+}
+
+static bool isIdChar(int ch){
+ return ('_') == ch || isAlphaNum(ch);
+}
+
+static bool isOpenStringVerbatim(int next, int &closingQuote){
+ switch (next) {
+ case L'<':
+ closingQuote = L'>';
+ return true;
+ case L'>':
+ closingQuote = L'<';
+ return true;
+ case L'(':
+ closingQuote = L')';
+ return true;
+ case L')':
+ closingQuote = L'(';
+ return true;
+ case L'[':
+ closingQuote = L']';
+ return true;
+ case L']':
+ closingQuote = L'[';
+ return true;
+ case L'{':
+ closingQuote = L'}';
+ return true;
+ case L'}':
+ closingQuote = L'{';
+ return true;
+ case L'_':
+ case L'.':
+ case L',':
+ case L';':
+ return false;
+ default:
+ if (isAlphaNum(next)) {
+ return false;
+ } else {
+ closingQuote = next;
+ return true;
+ }
+ }
+}
+
+// Look ahead to see which colour "end" should have (takes colour after the following keyword)
+static void endLookAhead(char s[], LexAccessor &styler, int start) {
+ char ch = styler.SafeGetCharAt(start, '\n');
+ while (' ' == ch) {
+ start++;
+ ch = styler.SafeGetCharAt(start, '\n');
+ }
+ int i = 0;
+ while (i < 100 && isLowerLetter(ch)){
+ s[i] = ch;
+ i++;
+ ch = styler.SafeGetCharAt(start + i, '\n');
+ }
+ s[i] = '\0';
+}
+
+static void forwardEscapeLiteral(StyleContext &sc, int EscapeState) {
+ sc.Forward();
+ if (sc.Match('"') || sc.Match('\'') || sc.Match('\\') || sc.Match('n') || sc.Match('l') || sc.Match('r') || sc.Match('t')) {
+ sc.ChangeState(EscapeState);
+ } else if (sc.Match('u')) {
+ if (IsADigit(sc.chNext, 16)) {
+ sc.Forward();
+ if (IsADigit(sc.chNext, 16)) {
+ sc.Forward();
+ if (IsADigit(sc.chNext, 16)) {
+ sc.Forward();
+ if (IsADigit(sc.chNext, 16)) {
+ sc.Forward();
+ sc.ChangeState(EscapeState);
+ }
+ }
+ }
+ }
+ }
+}
+
+void SCI_METHOD LexerVisualProlog::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ LexAccessor styler(pAccess);
+ CharacterSet setDoxygen(CharacterSet::setAlpha, "");
+ CharacterSet setNumber(CharacterSet::setNone, "+-.0123456789abcdefABCDEFxoXO");
+
+ StyleContext sc(startPos, length, initStyle, styler, 0x7f);
+
+ int styleBeforeDocKeyword = SCE_VISUALPROLOG_DEFAULT;
+ int currentLine = styler.GetLine(startPos);
+
+ int closingQuote = '"';
+ int nestLevel = 0;
+ if (currentLine >= 1)
+ {
+ nestLevel = styler.GetLineState(currentLine - 1);
+ closingQuote = nestLevel;
+ }
+
+ // Truncate ppDefineHistory before current line
+
+ for (; sc.More(); sc.Forward()) {
+
+ // Determine if the current state should terminate.
+ switch (sc.state) {
+ case SCE_VISUALPROLOG_OPERATOR:
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ break;
+ case SCE_VISUALPROLOG_NUMBER:
+ // We accept almost anything because of hex. and number suffixes
+ if (!(setNumber.Contains(sc.ch))) {
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ break;
+ case SCE_VISUALPROLOG_IDENTIFIER:
+ if (!isIdChar(sc.ch)) {
+ char s[1000];
+ sc.GetCurrent(s, sizeof(s));
+ if (0 == strcmp(s, "end")) {
+ endLookAhead(s, styler, sc.currentPos);
+ }
+ if (majorKeywords.InList(s)) {
+ sc.ChangeState(SCE_VISUALPROLOG_KEY_MAJOR);
+ } else if (minorKeywords.InList(s)) {
+ sc.ChangeState(SCE_VISUALPROLOG_KEY_MINOR);
+ }
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ break;
+ case SCE_VISUALPROLOG_VARIABLE:
+ case SCE_VISUALPROLOG_ANONYMOUS:
+ if (!isIdChar(sc.ch)) {
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ break;
+ case SCE_VISUALPROLOG_KEY_DIRECTIVE:
+ if (!isLowerLetter(sc.ch)) {
+ char s[1000];
+ sc.GetCurrent(s, sizeof(s));
+ if (!directiveKeywords.InList(s+1)) {
+ sc.ChangeState(SCE_VISUALPROLOG_IDENTIFIER);
+ }
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ break;
+ case SCE_VISUALPROLOG_COMMENT_BLOCK:
+ if (sc.Match('*', '/')) {
+ sc.Forward();
+ nestLevel--;
+ int nextState = (nestLevel == 0) ? SCE_VISUALPROLOG_DEFAULT : SCE_VISUALPROLOG_COMMENT_BLOCK;
+ sc.ForwardSetState(nextState);
+ } else if (sc.Match('/', '*')) {
+ sc.Forward();
+ nestLevel++;
+ } else if (sc.Match('@')) {
+ styleBeforeDocKeyword = sc.state;
+ sc.SetState(SCE_VISUALPROLOG_COMMENT_KEY_ERROR);
+ }
+ break;
+ case SCE_VISUALPROLOG_COMMENT_LINE:
+ if (sc.atLineEnd) {
+ int nextState = (nestLevel == 0) ? SCE_VISUALPROLOG_DEFAULT : SCE_VISUALPROLOG_COMMENT_BLOCK;
+ sc.SetState(nextState);
+ } else if (sc.Match('@')) {
+ styleBeforeDocKeyword = sc.state;
+ sc.SetState(SCE_VISUALPROLOG_COMMENT_KEY_ERROR);
+ }
+ break;
+ case SCE_VISUALPROLOG_COMMENT_KEY_ERROR:
+ if (!setDoxygen.Contains(sc.ch) || sc.atLineEnd) {
+ char s[1000];
+ sc.GetCurrent(s, sizeof(s));
+ if (docKeywords.InList(s+1)) {
+ sc.ChangeState(SCE_VISUALPROLOG_COMMENT_KEY);
+ }
+ if (SCE_VISUALPROLOG_COMMENT_LINE == styleBeforeDocKeyword && sc.atLineEnd) {
+ // end line comment
+ int nextState = (nestLevel == 0) ? SCE_VISUALPROLOG_DEFAULT : SCE_VISUALPROLOG_COMMENT_BLOCK;
+ sc.SetState(nextState);
+ } else {
+ sc.SetState(styleBeforeDocKeyword);
+ if (SCE_VISUALPROLOG_COMMENT_BLOCK == styleBeforeDocKeyword && sc.Match('*', '/')) {
+ // we have consumed the '*' if it comes immediately after the docKeyword
+ sc.Forward();
+ sc.Forward();
+ nestLevel--;
+ if (0 == nestLevel) {
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ }
+ }
+ }
+ break;
+ case SCE_VISUALPROLOG_STRING_ESCAPE:
+ case SCE_VISUALPROLOG_STRING_ESCAPE_ERROR:
+ // return to SCE_VISUALPROLOG_STRING and treat as such (fall-through)
+ sc.SetState(SCE_VISUALPROLOG_STRING);
+ case SCE_VISUALPROLOG_STRING:
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_VISUALPROLOG_STRING_EOL_OPEN);
+ } else if (sc.Match(closingQuote)) {
+ sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
+ } else if (sc.Match('\\')) {
+ sc.SetState(SCE_VISUALPROLOG_STRING_ESCAPE_ERROR);
+ forwardEscapeLiteral(sc, SCE_VISUALPROLOG_STRING_ESCAPE);
+ }
+ break;
+ case SCE_VISUALPROLOG_STRING_EOL_OPEN:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ break;
+ case SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL:
+ case SCE_VISUALPROLOG_STRING_VERBATIM_EOL:
+ // return to SCE_VISUALPROLOG_STRING_VERBATIM and treat as such (fall-through)
+ sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM);
+ case SCE_VISUALPROLOG_STRING_VERBATIM:
+ if (sc.atLineEnd) {
+ sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM_EOL);
+ } else if (sc.Match(closingQuote)) {
+ if (closingQuote == sc.chNext) {
+ sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL);
+ sc.Forward();
+ } else {
+ sc.ForwardSetState(SCE_VISUALPROLOG_DEFAULT);
+ }
+ }
+ break;
+ }
+
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ int lineState = 0;
+ if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) {
+ lineState = closingQuote;
+ } else if (SCE_VISUALPROLOG_COMMENT_BLOCK == sc.state) {
+ lineState = nestLevel;
+ }
+ styler.SetLineState(currentLine, lineState);
+ currentLine++;
+ }
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_VISUALPROLOG_DEFAULT) {
+ if (sc.Match('@') && isOpenStringVerbatim(sc.chNext, closingQuote)) {
+ sc.SetState(SCE_VISUALPROLOG_STRING_VERBATIM);
+ sc.Forward();
+ } else if (IsADigit(sc.ch) || (sc.Match('.') && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_VISUALPROLOG_NUMBER);
+ } else if (isLowerLetter(sc.ch)) {
+ sc.SetState(SCE_VISUALPROLOG_IDENTIFIER);
+ } else if (isUpperLetter(sc.ch)) {
+ sc.SetState(SCE_VISUALPROLOG_VARIABLE);
+ } else if (sc.Match('_')) {
+ sc.SetState(SCE_VISUALPROLOG_ANONYMOUS);
+ } else if (sc.Match('/', '*')) {
+ sc.SetState(SCE_VISUALPROLOG_COMMENT_BLOCK);
+ nestLevel = 1;
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('%')) {
+ sc.SetState(SCE_VISUALPROLOG_COMMENT_LINE);
+ } else if (sc.Match('\'')) {
+ closingQuote = '\'';
+ sc.SetState(SCE_VISUALPROLOG_STRING);
+ } else if (sc.Match('"')) {
+ closingQuote = '"';
+ sc.SetState(SCE_VISUALPROLOG_STRING);
+ } else if (sc.Match('#')) {
+ sc.SetState(SCE_VISUALPROLOG_KEY_DIRECTIVE);
+ } else if (isoperator(static_cast<char>(sc.ch)) || sc.Match('\\')) {
+ sc.SetState(SCE_VISUALPROLOG_OPERATOR);
+ }
+ }
+
+ }
+ sc.Complete();
+ styler.Flush();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+
+void SCI_METHOD LexerVisualProlog::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+
+ LexAccessor styler(pAccess);
+
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int currentLine = styler.GetLine(startPos);
+ int levelCurrent = SC_FOLDLEVELBASE;
+ if (currentLine > 0)
+ levelCurrent = styler.LevelAt(currentLine-1) >> 16;
+ int levelMinCurrent = levelCurrent;
+ int levelNext = levelCurrent;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (style == SCE_VISUALPROLOG_OPERATOR) {
+ if (ch == '{') {
+ // Measure the minimum before a '{' to allow
+ // folding on "} else {"
+ if (levelMinCurrent > levelNext) {
+ levelMinCurrent = levelNext;
+ }
+ levelNext++;
+ } else if (ch == '}') {
+ levelNext--;
+ }
+ }
+ if (!IsASpace(ch))
+ visibleChars++;
+ if (atEOL || (i == endPos-1)) {
+ int levelUse = levelCurrent;
+ int lev = levelUse | levelNext << 16;
+ if (levelUse < levelNext)
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(currentLine)) {
+ styler.SetLevel(currentLine, lev);
+ }
+ currentLine++;
+ levelCurrent = levelNext;
+ levelMinCurrent = levelCurrent;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(currentLine, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
+ visibleChars = 0;
+ }
+ }
+}
+
+LexerModule lmVisualProlog(SCLEX_VISUALPROLOG, LexerVisualProlog::LexerFactoryVisualProlog, "visualprolog", visualPrologWordLists);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexers/LexYAML.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexYAML.cxx
new file mode 100644
index 00000000000..7752d86e3f4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexers/LexYAML.cxx
@@ -0,0 +1,317 @@
+// Scintilla source code edit control
+/** @file LexYAML.cxx
+ ** Lexer for YAML.
+ **/
+// Copyright 2003- by Sean O'Dell <sean@celsoft.com>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static const char * const yamlWordListDesc[] = {
+ "Keywords",
+ 0
+};
+
+static inline bool AtEOL(Accessor &styler, unsigned int i) {
+ return (styler[i] == '\n') ||
+ ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n'));
+}
+
+static unsigned int SpaceCount(char* lineBuffer) {
+ if (lineBuffer == NULL)
+ return 0;
+
+ char* headBuffer = lineBuffer;
+
+ while (*headBuffer == ' ')
+ headBuffer++;
+
+ return headBuffer - lineBuffer;
+}
+
+#define YAML_STATE_BITSIZE 16
+#define YAML_STATE_MASK (0xFFFF0000)
+#define YAML_STATE_DOCUMENT (1 << YAML_STATE_BITSIZE)
+#define YAML_STATE_VALUE (2 << YAML_STATE_BITSIZE)
+#define YAML_STATE_COMMENT (3 << YAML_STATE_BITSIZE)
+#define YAML_STATE_TEXT_PARENT (4 << YAML_STATE_BITSIZE)
+#define YAML_STATE_TEXT (5 << YAML_STATE_BITSIZE)
+
+static void ColouriseYAMLLine(
+ char *lineBuffer,
+ unsigned int currentLine,
+ unsigned int lengthLine,
+ unsigned int startLine,
+ unsigned int endPos,
+ WordList &keywords,
+ Accessor &styler) {
+
+ unsigned int i = 0;
+ bool bInQuotes = false;
+ unsigned int indentAmount = SpaceCount(lineBuffer);
+
+ if (currentLine > 0) {
+ int parentLineState = styler.GetLineState(currentLine - 1);
+
+ if ((parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT || (parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT_PARENT) {
+ unsigned int parentIndentAmount = parentLineState&(~YAML_STATE_MASK);
+ if (indentAmount > parentIndentAmount) {
+ styler.SetLineState(currentLine, YAML_STATE_TEXT | parentIndentAmount);
+ styler.ColourTo(endPos, SCE_YAML_TEXT);
+ return;
+ }
+ }
+ }
+ styler.SetLineState(currentLine, 0);
+ if (strncmp(lineBuffer, "---", 3) == 0) { // Document marker
+ styler.SetLineState(currentLine, YAML_STATE_DOCUMENT);
+ styler.ColourTo(endPos, SCE_YAML_DOCUMENT);
+ return;
+ }
+ // Skip initial spaces
+ while ((i < lengthLine) && lineBuffer[i] == ' ') { // YAML always uses space, never TABS or anything else
+ i++;
+ }
+ if (lineBuffer[i] == '\t') { // if we skipped all spaces, and we are NOT inside a text block, this is wrong
+ styler.ColourTo(endPos, SCE_YAML_ERROR);
+ return;
+ }
+ if (lineBuffer[i] == '#') { // Comment
+ styler.SetLineState(currentLine, YAML_STATE_COMMENT);
+ styler.ColourTo(endPos, SCE_YAML_COMMENT);
+ return;
+ }
+ while (i < lengthLine) {
+ if (lineBuffer[i] == '\'' || lineBuffer[i] == '\"') {
+ bInQuotes = !bInQuotes;
+ } else if (lineBuffer[i] == ':' && !bInQuotes) {
+ styler.ColourTo(startLine + i - 1, SCE_YAML_IDENTIFIER);
+ styler.ColourTo(startLine + i, SCE_YAML_OPERATOR);
+ // Non-folding scalar
+ i++;
+ while ((i < lengthLine) && isspacechar(lineBuffer[i]))
+ i++;
+ unsigned int endValue = lengthLine - 1;
+ while ((endValue >= i) && isspacechar(lineBuffer[endValue]))
+ endValue--;
+ lineBuffer[endValue + 1] = '\0';
+ if (lineBuffer[i] == '|' || lineBuffer[i] == '>') {
+ i++;
+ if (lineBuffer[i] == '+' || lineBuffer[i] == '-')
+ i++;
+ while ((i < lengthLine) && isspacechar(lineBuffer[i]))
+ i++;
+ if (lineBuffer[i] == '\0') {
+ styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount);
+ styler.ColourTo(endPos, SCE_YAML_DEFAULT);
+ return;
+ } else if (lineBuffer[i] == '#') {
+ styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount);
+ styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT);
+ styler.ColourTo(endPos, SCE_YAML_COMMENT);
+ return;
+ } else {
+ styler.ColourTo(endPos, SCE_YAML_ERROR);
+ return;
+ }
+ } else if (lineBuffer[i] == '#') {
+ styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT);
+ styler.ColourTo(endPos, SCE_YAML_COMMENT);
+ return;
+ }
+ styler.SetLineState(currentLine, YAML_STATE_VALUE);
+ if (lineBuffer[i] == '&' || lineBuffer[i] == '*') {
+ styler.ColourTo(endPos, SCE_YAML_REFERENCE);
+ return;
+ }
+ if (keywords.InList(&lineBuffer[i])) { // Convertible value (true/false, etc.)
+ styler.ColourTo(endPos, SCE_YAML_KEYWORD);
+ return;
+ } else {
+ unsigned int i2 = i;
+ while ((i < lengthLine) && lineBuffer[i]) {
+ if (!(IsASCII(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
+ styler.ColourTo(endPos, SCE_YAML_DEFAULT);
+ return;
+ }
+ i++;
+ }
+ if (i > i2) {
+ styler.ColourTo(endPos, SCE_YAML_NUMBER);
+ return;
+ }
+ }
+ break; // shouldn't get here, but just in case, the rest of the line is coloured the default
+ }
+ i++;
+ }
+ styler.ColourTo(endPos, SCE_YAML_DEFAULT);
+}
+
+static void ColouriseYAMLDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
+ char lineBuffer[1024] = "";
+ styler.StartAt(startPos);
+ styler.StartSegment(startPos);
+ unsigned int linePos = 0;
+ unsigned int startLine = startPos;
+ unsigned int endPos = startPos + length;
+ unsigned int maxPos = styler.Length();
+ unsigned int lineCurrent = styler.GetLine(startPos);
+
+ for (unsigned int i = startPos; i < maxPos && i < endPos; i++) {
+ lineBuffer[linePos++] = styler[i];
+ if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
+ // End of line (or of line buffer) met, colourise it
+ lineBuffer[linePos] = '\0';
+ ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, i, *keywordLists[0], styler);
+ linePos = 0;
+ startLine = i + 1;
+ lineCurrent++;
+ }
+ }
+ if (linePos > 0) { // Last line does not have ending characters
+ ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, startPos + length - 1, *keywordLists[0], styler);
+ }
+}
+
+static bool IsCommentLine(int line, Accessor &styler) {
+ int pos = styler.LineStart(line);
+ if (styler[pos] == '#')
+ return true;
+ return false;
+}
+
+static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unused*/,
+ WordList *[], Accessor &styler) {
+ const int maxPos = startPos + length;
+ const int maxLines = styler.GetLine(maxPos - 1); // Requested last line
+ const int docLines = styler.GetLine(styler.Length() - 1); // Available last line
+ const bool foldComment = styler.GetPropertyInt("fold.comment.yaml") != 0;
+
+ // Backtrack to previous non-blank line so we can determine indent level
+ // for any white space lines
+ // and so we can fix any preceding fold level (which is why we go back
+ // at least one line in all cases)
+ int spaceFlags = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ while (lineCurrent > 0) {
+ lineCurrent--;
+ indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL);
+ if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) &&
+ (!IsCommentLine(lineCurrent, styler)))
+ break;
+ }
+ int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+
+ // Set up initial loop state
+ int prevComment = 0;
+ if (lineCurrent >= 1)
+ prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler);
+
+ // Process all characters to end of requested range
+ // or comment that hangs over the end of the range. Cap processing in all cases
+ // to end of document (in case of unclosed comment at end).
+ while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevComment)) {
+
+ // Gather info
+ int lev = indentCurrent;
+ int lineNext = lineCurrent + 1;
+ int indentNext = indentCurrent;
+ if (lineNext <= docLines) {
+ // Information about next line is only available if not at end of document
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+ const int comment = foldComment && IsCommentLine(lineCurrent, styler);
+ const int comment_start = (comment && !prevComment && (lineNext <= docLines) &&
+ IsCommentLine(lineNext, styler) && (lev > SC_FOLDLEVELBASE));
+ const int comment_continue = (comment && prevComment);
+ if (!comment)
+ indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK;
+ if (indentNext & SC_FOLDLEVELWHITEFLAG)
+ indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel;
+
+ if (comment_start) {
+ // Place fold point at start of a block of comments
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ } else if (comment_continue) {
+ // Add level to rest of lines in the block
+ lev = lev + 1;
+ }
+
+ // Skip past any blank lines for next indent level info; we skip also
+ // comments (all comments, not just those starting in column 0)
+ // which effectively folds them into surrounding code rather
+ // than screwing up folding.
+
+ while ((lineNext < docLines) &&
+ ((indentNext & SC_FOLDLEVELWHITEFLAG) ||
+ (lineNext <= docLines && IsCommentLine(lineNext, styler)))) {
+
+ lineNext++;
+ indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL);
+ }
+
+ const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK;
+ const int levelBeforeComments = Maximum(indentCurrentLevel,levelAfterComments);
+
+ // Now set all the indent levels on the lines we skipped
+ // Do this from end to start. Once we encounter one line
+ // which is indented more than the line after the end of
+ // the comment-block, use the level of the block before
+
+ int skipLine = lineNext;
+ int skipLevel = levelAfterComments;
+
+ while (--skipLine > lineCurrent) {
+ int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL);
+
+ if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments)
+ skipLevel = levelBeforeComments;
+
+ int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG;
+
+ styler.SetLevel(skipLine, skipLevel | whiteFlag);
+ }
+
+ // Set fold header on non-comment line
+ if (!comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG) ) {
+ if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ }
+
+ // Keep track of block comment state of previous line
+ prevComment = comment_start || comment_continue;
+
+ // Set fold level for this line and move to next line
+ styler.SetLevel(lineCurrent, lev);
+ indentCurrent = indentNext;
+ lineCurrent = lineNext;
+ }
+
+ // NOTE: Cannot set level of last line here because indentCurrent doesn't have
+ // header flag set; the loop above is crafted to take care of this case!
+ //styler.SetLevel(lineCurrent, indentCurrent);
+}
+
+LexerModule lmYAML(SCLEX_YAML, ColouriseYAMLDoc, "yaml", FoldYAMLDoc, yamlWordListDesc);
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.cxx
new file mode 100644
index 00000000000..f67737d4d64
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.cxx
@@ -0,0 +1,79 @@
+// Scintilla source code edit control
+/** @file KeyWords.cxx
+ ** Colourise for particular languages.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+Accessor::Accessor(IDocument *pAccess_, PropSetSimple *pprops_) : LexAccessor(pAccess_), pprops(pprops_) {
+}
+
+int Accessor::GetPropertyInt(const char *key, int defaultValue) const {
+ return pprops->GetInt(key, defaultValue);
+}
+
+int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {
+ int end = Length();
+ int spaceFlags = 0;
+
+ // Determines the indentation level of the current line and also checks for consistent
+ // indentation compared to the previous line.
+ // Indentation is judged consistent when the indentation whitespace of each line lines
+ // the same or the indentation of one line is a prefix of the other.
+
+ int pos = LineStart(line);
+ char ch = (*this)[pos];
+ int indent = 0;
+ bool inPrevPrefix = line > 0;
+ int posPrev = inPrevPrefix ? LineStart(line-1) : 0;
+ while ((ch == ' ' || ch == '\t') && (pos < end)) {
+ if (inPrevPrefix) {
+ char chPrev = (*this)[posPrev++];
+ if (chPrev == ' ' || chPrev == '\t') {
+ if (chPrev != ch)
+ spaceFlags |= wsInconsistent;
+ } else {
+ inPrevPrefix = false;
+ }
+ }
+ if (ch == ' ') {
+ spaceFlags |= wsSpace;
+ indent++;
+ } else { // Tab
+ spaceFlags |= wsTab;
+ if (spaceFlags & wsSpace)
+ spaceFlags |= wsSpaceTab;
+ indent = (indent / 8 + 1) * 8;
+ }
+ ch = (*this)[++pos];
+ }
+
+ *flags = spaceFlags;
+ indent += SC_FOLDLEVELBASE;
+ // if completely empty line or the start of a comment...
+ if ((LineStart(line) == Length()) || (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') ||
+ (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)))
+ return indent | SC_FOLDLEVELWHITEFLAG;
+ else
+ return indent;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.h
new file mode 100644
index 00000000000..1bb86c53b4a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/Accessor.h
@@ -0,0 +1,35 @@
+// Scintilla source code edit control
+/** @file Accessor.h
+ ** Interfaces between Scintilla and lexers.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef ACCESSOR_H
+#define ACCESSOR_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+enum { wsSpace=1, wsTab=2, wsSpaceTab=4, wsInconsistent=8 };
+
+class Accessor;
+class WordList;
+class PropSetSimple;
+
+typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len);
+
+class Accessor : public LexAccessor {
+public:
+ PropSetSimple *pprops;
+ Accessor(IDocument *pAccess_, PropSetSimple *pprops_);
+ int GetPropertyInt(const char *, int defaultValue=0) const;
+ int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.cxx
new file mode 100644
index 00000000000..2be46c0130d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.cxx
@@ -0,0 +1,3304 @@
+// Scintilla source code edit control
+/** @file CharacterCategory.cxx
+ ** Returns the Unicode general category of a character.
+ ** Table automatically regenerated by scripts/GenerateCharacterCategory.py
+ ** Should only be rarely regenerated for new versions of Unicode.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <algorithm>
+
+#include "StringCopy.h"
+#include "CharacterCategory.h"
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+namespace {
+ // Use an unnamed namespace to protect the declarations from name conflicts
+
+const int catRanges[] = {
+//++Autogenerated -- start of section automatically generated
+// Created with Python 3.3.0, Unicode 6.1.0
+25,
+1046,
+1073,
+1171,
+1201,
+1293,
+1326,
+1361,
+1394,
+1425,
+1452,
+1489,
+1544,
+1873,
+1938,
+2033,
+2080,
+2925,
+2961,
+2990,
+3028,
+3051,
+3092,
+3105,
+3949,
+3986,
+4014,
+4050,
+4089,
+5142,
+5169,
+5203,
+5333,
+5361,
+5396,
+5429,
+5444,
+5487,
+5522,
+5562,
+5589,
+5620,
+5653,
+5682,
+5706,
+5780,
+5793,
+5841,
+5908,
+5930,
+5956,
+6000,
+6026,
+6129,
+6144,
+6898,
+6912,
+7137,
+7922,
+7937,
+8192,
+8225,
+8256,
+8289,
+8320,
+8353,
+8384,
+8417,
+8448,
+8481,
+8512,
+8545,
+8576,
+8609,
+8640,
+8673,
+8704,
+8737,
+8768,
+8801,
+8832,
+8865,
+8896,
+8929,
+8960,
+8993,
+9024,
+9057,
+9088,
+9121,
+9152,
+9185,
+9216,
+9249,
+9280,
+9313,
+9344,
+9377,
+9408,
+9441,
+9472,
+9505,
+9536,
+9569,
+9600,
+9633,
+9664,
+9697,
+9728,
+9761,
+9792,
+9825,
+9856,
+9889,
+9920,
+9953,
+10016,
+10049,
+10080,
+10113,
+10144,
+10177,
+10208,
+10241,
+10272,
+10305,
+10336,
+10369,
+10400,
+10433,
+10464,
+10497,
+10560,
+10593,
+10624,
+10657,
+10688,
+10721,
+10752,
+10785,
+10816,
+10849,
+10880,
+10913,
+10944,
+10977,
+11008,
+11041,
+11072,
+11105,
+11136,
+11169,
+11200,
+11233,
+11264,
+11297,
+11328,
+11361,
+11392,
+11425,
+11456,
+11489,
+11520,
+11553,
+11584,
+11617,
+11648,
+11681,
+11712,
+11745,
+11776,
+11809,
+11840,
+11873,
+11904,
+11937,
+11968,
+12001,
+12032,
+12097,
+12128,
+12161,
+12192,
+12225,
+12320,
+12385,
+12416,
+12449,
+12480,
+12545,
+12576,
+12673,
+12736,
+12865,
+12896,
+12961,
+12992,
+13089,
+13184,
+13249,
+13280,
+13345,
+13376,
+13409,
+13440,
+13473,
+13504,
+13569,
+13600,
+13633,
+13696,
+13729,
+13760,
+13825,
+13856,
+13953,
+13984,
+14017,
+14048,
+14113,
+14180,
+14208,
+14241,
+14340,
+14464,
+14498,
+14529,
+14560,
+14594,
+14625,
+14656,
+14690,
+14721,
+14752,
+14785,
+14816,
+14849,
+14880,
+14913,
+14944,
+14977,
+15008,
+15041,
+15072,
+15105,
+15136,
+15169,
+15200,
+15233,
+15296,
+15329,
+15360,
+15393,
+15424,
+15457,
+15488,
+15521,
+15552,
+15585,
+15616,
+15649,
+15680,
+15713,
+15744,
+15777,
+15808,
+15841,
+15904,
+15938,
+15969,
+16000,
+16033,
+16064,
+16161,
+16192,
+16225,
+16256,
+16289,
+16320,
+16353,
+16384,
+16417,
+16448,
+16481,
+16512,
+16545,
+16576,
+16609,
+16640,
+16673,
+16704,
+16737,
+16768,
+16801,
+16832,
+16865,
+16896,
+16929,
+16960,
+16993,
+17024,
+17057,
+17088,
+17121,
+17152,
+17185,
+17216,
+17249,
+17280,
+17313,
+17344,
+17377,
+17408,
+17441,
+17472,
+17505,
+17536,
+17569,
+17600,
+17633,
+17664,
+17697,
+17728,
+17761,
+17792,
+17825,
+17856,
+17889,
+17920,
+17953,
+17984,
+18017,
+18240,
+18305,
+18336,
+18401,
+18464,
+18497,
+18528,
+18657,
+18688,
+18721,
+18752,
+18785,
+18816,
+18849,
+18880,
+18913,
+21124,
+21153,
+22019,
+22612,
+22723,
+23124,
+23555,
+23732,
+23939,
+23988,
+24003,
+24052,
+24581,
+28160,
+28193,
+28224,
+28257,
+28291,
+28340,
+28352,
+28385,
+28445,
+28483,
+28513,
+28625,
+28669,
+28820,
+28864,
+28913,
+28928,
+29053,
+29056,
+29117,
+29120,
+29185,
+29216,
+29789,
+29792,
+30081,
+31200,
+31233,
+31296,
+31393,
+31488,
+31521,
+31552,
+31585,
+31616,
+31649,
+31680,
+31713,
+31744,
+31777,
+31808,
+31841,
+31872,
+31905,
+31936,
+31969,
+32000,
+32033,
+32064,
+32097,
+32128,
+32161,
+32192,
+32225,
+32384,
+32417,
+32466,
+32480,
+32513,
+32544,
+32609,
+32672,
+34305,
+35840,
+35873,
+35904,
+35937,
+35968,
+36001,
+36032,
+36065,
+36096,
+36129,
+36160,
+36193,
+36224,
+36257,
+36288,
+36321,
+36352,
+36385,
+36416,
+36449,
+36480,
+36513,
+36544,
+36577,
+36608,
+36641,
+36672,
+36705,
+36736,
+36769,
+36800,
+36833,
+36864,
+36897,
+36949,
+36965,
+37127,
+37184,
+37217,
+37248,
+37281,
+37312,
+37345,
+37376,
+37409,
+37440,
+37473,
+37504,
+37537,
+37568,
+37601,
+37632,
+37665,
+37696,
+37729,
+37760,
+37793,
+37824,
+37857,
+37888,
+37921,
+37952,
+37985,
+38016,
+38049,
+38080,
+38113,
+38144,
+38177,
+38208,
+38241,
+38272,
+38305,
+38336,
+38369,
+38400,
+38433,
+38464,
+38497,
+38528,
+38561,
+38592,
+38625,
+38656,
+38689,
+38720,
+38753,
+38784,
+38817,
+38848,
+38881,
+38912,
+38977,
+39008,
+39041,
+39072,
+39105,
+39136,
+39169,
+39200,
+39233,
+39264,
+39297,
+39328,
+39361,
+39424,
+39457,
+39488,
+39521,
+39552,
+39585,
+39616,
+39649,
+39680,
+39713,
+39744,
+39777,
+39808,
+39841,
+39872,
+39905,
+39936,
+39969,
+40000,
+40033,
+40064,
+40097,
+40128,
+40161,
+40192,
+40225,
+40256,
+40289,
+40320,
+40353,
+40384,
+40417,
+40448,
+40481,
+40512,
+40545,
+40576,
+40609,
+40640,
+40673,
+40704,
+40737,
+40768,
+40801,
+40832,
+40865,
+40896,
+40929,
+40960,
+40993,
+41024,
+41057,
+41088,
+41121,
+41152,
+41185,
+41216,
+41249,
+41280,
+41313,
+41344,
+41377,
+41408,
+41441,
+41472,
+41505,
+41536,
+41569,
+41600,
+41633,
+41664,
+41697,
+41728,
+41761,
+41792,
+41825,
+41856,
+41889,
+41920,
+41953,
+41984,
+42017,
+42048,
+42081,
+42112,
+42145,
+42176,
+42209,
+42269,
+42528,
+43773,
+43811,
+43857,
+44061,
+44065,
+45341,
+45361,
+45388,
+45437,
+45555,
+45597,
+45605,
+47052,
+47077,
+47121,
+47141,
+47217,
+47237,
+47313,
+47333,
+47389,
+47620,
+48509,
+48644,
+48753,
+48829,
+49178,
+49341,
+49362,
+49457,
+49523,
+49553,
+49621,
+49669,
+50033,
+50077,
+50129,
+50180,
+51203,
+51236,
+51557,
+52232,
+52561,
+52676,
+52741,
+52772,
+55953,
+55972,
+56005,
+56250,
+56277,
+56293,
+56483,
+56549,
+56629,
+56645,
+56772,
+56840,
+57156,
+57269,
+57316,
+57361,
+57821,
+57850,
+57860,
+57893,
+57924,
+58885,
+59773,
+59812,
+62661,
+63012,
+63069,
+63496,
+63812,
+64869,
+65155,
+65237,
+65265,
+65347,
+65405,
+65540,
+66245,
+66371,
+66405,
+66691,
+66725,
+66819,
+66853,
+67037,
+67089,
+67581,
+67588,
+68389,
+68509,
+68561,
+68605,
+70660,
+70717,
+70724,
+71101,
+72837,
+73725,
+73733,
+73830,
+73860,
+75589,
+75622,
+75653,
+75684,
+75718,
+75813,
+76070,
+76197,
+76230,
+76292,
+76325,
+76548,
+76869,
+76945,
+77000,
+77329,
+77347,
+77380,
+77597,
+77604,
+77853,
+77861,
+77894,
+77981,
+77988,
+78269,
+78308,
+78397,
+78436,
+79165,
+79172,
+79421,
+79428,
+79485,
+79556,
+79709,
+79749,
+79780,
+79814,
+79909,
+80061,
+80102,
+80189,
+80230,
+80293,
+80324,
+80381,
+80614,
+80669,
+80772,
+80861,
+80868,
+80965,
+81053,
+81096,
+81412,
+81491,
+81546,
+81749,
+81779,
+81821,
+81957,
+82022,
+82077,
+82084,
+82301,
+82404,
+82493,
+82532,
+83261,
+83268,
+83517,
+83524,
+83613,
+83620,
+83709,
+83716,
+83805,
+83845,
+83901,
+83910,
+84005,
+84093,
+84197,
+84285,
+84325,
+84445,
+84517,
+84573,
+84772,
+84925,
+84932,
+84989,
+85192,
+85509,
+85572,
+85669,
+85725,
+86053,
+86118,
+86173,
+86180,
+86493,
+86500,
+86621,
+86628,
+87357,
+87364,
+87613,
+87620,
+87709,
+87716,
+87901,
+87941,
+87972,
+88006,
+88101,
+88285,
+88293,
+88358,
+88413,
+88422,
+88485,
+88541,
+88580,
+88637,
+89092,
+89157,
+89245,
+89288,
+89617,
+89651,
+89693,
+90149,
+90182,
+90269,
+90276,
+90557,
+90596,
+90685,
+90724,
+91453,
+91460,
+91709,
+91716,
+91805,
+91812,
+91997,
+92037,
+92068,
+92102,
+92133,
+92166,
+92197,
+92349,
+92390,
+92477,
+92518,
+92581,
+92637,
+92869,
+92902,
+92957,
+93060,
+93149,
+93156,
+93253,
+93341,
+93384,
+93717,
+93732,
+93770,
+93981,
+94277,
+94308,
+94365,
+94372,
+94589,
+94660,
+94781,
+94788,
+94941,
+95012,
+95101,
+95108,
+95165,
+95172,
+95261,
+95332,
+95421,
+95492,
+95613,
+95684,
+96093,
+96198,
+96261,
+96294,
+96381,
+96454,
+96573,
+96582,
+96677,
+96733,
+96772,
+96829,
+96998,
+97053,
+97480,
+97802,
+97909,
+98099,
+98133,
+98173,
+98342,
+98461,
+98468,
+98749,
+98756,
+98877,
+98884,
+99645,
+99652,
+99997,
+100004,
+100189,
+100260,
+100293,
+100390,
+100541,
+100549,
+100669,
+100677,
+100829,
+101029,
+101117,
+101124,
+101213,
+101380,
+101445,
+101533,
+101576,
+101917,
+102154,
+102389,
+102429,
+102470,
+102557,
+102564,
+102845,
+102852,
+102973,
+102980,
+103741,
+103748,
+104093,
+104100,
+104285,
+104325,
+104356,
+104390,
+104421,
+104454,
+104637,
+104645,
+104678,
+104765,
+104774,
+104837,
+104925,
+105126,
+105213,
+105412,
+105469,
+105476,
+105541,
+105629,
+105672,
+106013,
+106020,
+106109,
+106566,
+106653,
+106660,
+106941,
+106948,
+107069,
+107076,
+108413,
+108452,
+108486,
+108581,
+108733,
+108742,
+108861,
+108870,
+108965,
+108996,
+109053,
+109286,
+109341,
+109572,
+109637,
+109725,
+109768,
+110090,
+110301,
+110389,
+110404,
+110621,
+110662,
+110749,
+110756,
+111357,
+111428,
+112221,
+112228,
+112541,
+112548,
+112605,
+112644,
+112893,
+112965,
+113021,
+113126,
+113221,
+113341,
+113349,
+113405,
+113414,
+113693,
+114246,
+114321,
+114365,
+114724,
+116261,
+116292,
+116357,
+116605,
+116723,
+116740,
+116931,
+116965,
+117233,
+117256,
+117585,
+117661,
+118820,
+118909,
+118916,
+118973,
+119012,
+119101,
+119108,
+119165,
+119204,
+119261,
+119428,
+119581,
+119588,
+119837,
+119844,
+119965,
+119972,
+120029,
+120036,
+120093,
+120132,
+120221,
+120228,
+120357,
+120388,
+120453,
+120669,
+120677,
+120740,
+120797,
+120836,
+121021,
+121027,
+121085,
+121093,
+121309,
+121352,
+121693,
+121732,
+121885,
+122884,
+122933,
+123025,
+123509,
+123537,
+123573,
+123653,
+123733,
+123912,
+124234,
+124565,
+124581,
+124629,
+124645,
+124693,
+124709,
+124749,
+124782,
+124813,
+124846,
+124870,
+124932,
+125213,
+125220,
+126397,
+126501,
+126950,
+126981,
+127153,
+127173,
+127236,
+127397,
+127773,
+127781,
+128957,
+128981,
+129221,
+129269,
+129469,
+129493,
+129553,
+129717,
+129841,
+129917,
+131076,
+132454,
+132517,
+132646,
+132677,
+132870,
+132901,
+132966,
+133029,
+133092,
+133128,
+133457,
+133636,
+133830,
+133893,
+133956,
+134085,
+134180,
+134214,
+134308,
+134374,
+134596,
+134693,
+134820,
+135237,
+135270,
+135333,
+135398,
+135589,
+135620,
+135654,
+135688,
+136006,
+136101,
+136149,
+136192,
+137437,
+137440,
+137501,
+137632,
+137693,
+137732,
+139121,
+139139,
+139172,
+149821,
+149828,
+149981,
+150020,
+150269,
+150276,
+150333,
+150340,
+150493,
+150532,
+151869,
+151876,
+152029,
+152068,
+153149,
+153156,
+153309,
+153348,
+153597,
+153604,
+153661,
+153668,
+153821,
+153860,
+154365,
+154372,
+156221,
+156228,
+156381,
+156420,
+158589,
+158629,
+158737,
+159018,
+159677,
+159748,
+160277,
+160605,
+160772,
+163517,
+163852,
+163876,
+183729,
+183780,
+184342,
+184356,
+185197,
+185230,
+185277,
+185348,
+187761,
+187849,
+187965,
+188420,
+188861,
+188868,
+188997,
+189117,
+189444,
+190021,
+190129,
+190205,
+190468,
+191045,
+191133,
+191492,
+191933,
+191940,
+192061,
+192069,
+192157,
+192516,
+194181,
+194246,
+194277,
+194502,
+194757,
+194790,
+194853,
+195217,
+195299,
+195345,
+195443,
+195460,
+195493,
+195549,
+195592,
+195933,
+196106,
+196445,
+196625,
+196812,
+196849,
+196965,
+197078,
+197117,
+197128,
+197469,
+197636,
+198755,
+198788,
+200477,
+200708,
+202021,
+202052,
+202109,
+202244,
+204509,
+204804,
+205757,
+205829,
+205926,
+206053,
+206118,
+206237,
+206342,
+206405,
+206438,
+206629,
+206749,
+206869,
+206909,
+206993,
+207048,
+207364,
+208349,
+208388,
+208573,
+208900,
+210333,
+210438,
+210980,
+211206,
+211293,
+211464,
+211786,
+211837,
+211925,
+212996,
+213733,
+213798,
+213917,
+213969,
+214020,
+215718,
+215749,
+215782,
+215813,
+216061,
+216069,
+216102,
+216133,
+216166,
+216229,
+216486,
+216677,
+217021,
+217061,
+217096,
+217437,
+217608,
+217949,
+218129,
+218339,
+218385,
+218589,
+221189,
+221318,
+221348,
+222853,
+222886,
+222917,
+223078,
+223109,
+223142,
+223301,
+223334,
+223396,
+223645,
+223752,
+224081,
+224309,
+224613,
+224917,
+225213,
+225285,
+225350,
+225380,
+226342,
+226373,
+226502,
+226565,
+226630,
+226661,
+226694,
+226756,
+226824,
+227140,
+228549,
+228582,
+228613,
+228678,
+228773,
+228806,
+228837,
+228934,
+229021,
+229265,
+229380,
+230534,
+230789,
+231046,
+231109,
+231197,
+231281,
+231432,
+231773,
+231844,
+231944,
+232260,
+233219,
+233425,
+233501,
+235537,
+235805,
+236037,
+236145,
+236165,
+236582,
+236613,
+236836,
+236965,
+236996,
+237126,
+237189,
+237220,
+237309,
+237569,
+238979,
+240993,
+241411,
+241441,
+242531,
+243717,
+244989,
+245637,
+245760,
+245793,
+245824,
+245857,
+245888,
+245921,
+245952,
+245985,
+246016,
+246049,
+246080,
+246113,
+246144,
+246177,
+246208,
+246241,
+246272,
+246305,
+246336,
+246369,
+246400,
+246433,
+246464,
+246497,
+246528,
+246561,
+246592,
+246625,
+246656,
+246689,
+246720,
+246753,
+246784,
+246817,
+246848,
+246881,
+246912,
+246945,
+246976,
+247009,
+247040,
+247073,
+247104,
+247137,
+247168,
+247201,
+247232,
+247265,
+247296,
+247329,
+247360,
+247393,
+247424,
+247457,
+247488,
+247521,
+247552,
+247585,
+247616,
+247649,
+247680,
+247713,
+247744,
+247777,
+247808,
+247841,
+247872,
+247905,
+247936,
+247969,
+248000,
+248033,
+248064,
+248097,
+248128,
+248161,
+248192,
+248225,
+248256,
+248289,
+248320,
+248353,
+248384,
+248417,
+248448,
+248481,
+248512,
+248545,
+248576,
+248609,
+248640,
+248673,
+248704,
+248737,
+248768,
+248801,
+248832,
+248865,
+248896,
+248929,
+248960,
+248993,
+249024,
+249057,
+249088,
+249121,
+249152,
+249185,
+249216,
+249249,
+249280,
+249313,
+249344,
+249377,
+249408,
+249441,
+249472,
+249505,
+249536,
+249569,
+249600,
+249633,
+249664,
+249697,
+249728,
+249761,
+249792,
+249825,
+249856,
+249889,
+249920,
+249953,
+249984,
+250017,
+250048,
+250081,
+250112,
+250145,
+250176,
+250209,
+250240,
+250273,
+250304,
+250337,
+250368,
+250401,
+250432,
+250465,
+250496,
+250529,
+250816,
+250849,
+250880,
+250913,
+250944,
+250977,
+251008,
+251041,
+251072,
+251105,
+251136,
+251169,
+251200,
+251233,
+251264,
+251297,
+251328,
+251361,
+251392,
+251425,
+251456,
+251489,
+251520,
+251553,
+251584,
+251617,
+251648,
+251681,
+251712,
+251745,
+251776,
+251809,
+251840,
+251873,
+251904,
+251937,
+251968,
+252001,
+252032,
+252065,
+252096,
+252129,
+252160,
+252193,
+252224,
+252257,
+252288,
+252321,
+252352,
+252385,
+252416,
+252449,
+252480,
+252513,
+252544,
+252577,
+252608,
+252641,
+252672,
+252705,
+252736,
+252769,
+252800,
+252833,
+252864,
+252897,
+252928,
+252961,
+252992,
+253025,
+253056,
+253089,
+253120,
+253153,
+253184,
+253217,
+253248,
+253281,
+253312,
+253345,
+253376,
+253409,
+253440,
+253473,
+253504,
+253537,
+253568,
+253601,
+253632,
+253665,
+253696,
+253729,
+253760,
+253793,
+253824,
+253857,
+253888,
+253921,
+254208,
+254465,
+254685,
+254720,
+254941,
+254977,
+255232,
+255489,
+255744,
+256001,
+256221,
+256256,
+256477,
+256513,
+256797,
+256800,
+256861,
+256864,
+256925,
+256928,
+256989,
+256992,
+257025,
+257280,
+257537,
+258013,
+258049,
+258306,
+258561,
+258818,
+259073,
+259330,
+259585,
+259773,
+259777,
+259840,
+259970,
+260020,
+260033,
+260084,
+260161,
+260285,
+260289,
+260352,
+260482,
+260532,
+260609,
+260765,
+260801,
+260864,
+261021,
+261044,
+261121,
+261376,
+261556,
+261661,
+261697,
+261821,
+261825,
+261888,
+262018,
+262068,
+262141,
+262166,
+262522,
+262668,
+262865,
+262927,
+262960,
+262989,
+263023,
+263088,
+263117,
+263151,
+263185,
+263447,
+263480,
+263514,
+263670,
+263697,
+263983,
+264016,
+264049,
+264171,
+264241,
+264338,
+264365,
+264398,
+264433,
+264786,
+264817,
+264843,
+264881,
+265206,
+265242,
+265405,
+265562,
+265738,
+265763,
+265821,
+265866,
+266066,
+266157,
+266190,
+266211,
+266250,
+266578,
+266669,
+266702,
+266749,
+266755,
+267197,
+267283,
+268125,
+268805,
+269223,
+269349,
+269383,
+269477,
+269885,
+270357,
+270400,
+270453,
+270560,
+270613,
+270657,
+270688,
+270785,
+270848,
+270945,
+270997,
+271008,
+271061,
+271122,
+271136,
+271317,
+271488,
+271541,
+271552,
+271605,
+271616,
+271669,
+271680,
+271829,
+271841,
+271872,
+272001,
+272036,
+272161,
+272213,
+272257,
+272320,
+272402,
+272544,
+272577,
+272725,
+272754,
+272789,
+272833,
+272885,
+272906,
+273417,
+274528,
+274561,
+274601,
+274730,
+274781,
+274962,
+275125,
+275282,
+275349,
+275474,
+275509,
+275570,
+275605,
+275666,
+275701,
+275922,
+275957,
+276946,
+277013,
+277074,
+277109,
+277138,
+277173,
+278162,
+286741,
+286994,
+287125,
+287762,
+287829,
+288045,
+288078,
+288117,
+290706,
+290741,
+291698,
+292501,
+293778,
+293973,
+294557,
+294933,
+296189,
+296981,
+297341,
+297994,
+299925,
+302410,
+303125,
+308978,
+309013,
+309298,
+309333,
+311058,
+311317,
+314866,
+314901,
+319517,
+319541,
+322829,
+322862,
+322893,
+322926,
+322957,
+322990,
+323021,
+323054,
+323085,
+323118,
+323149,
+323182,
+323213,
+323246,
+323274,
+324245,
+325650,
+325805,
+325838,
+325874,
+326861,
+326894,
+326925,
+326958,
+326989,
+327022,
+327053,
+327086,
+327117,
+327150,
+327186,
+327701,
+335890,
+340077,
+340110,
+340141,
+340174,
+340205,
+340238,
+340269,
+340302,
+340333,
+340366,
+340397,
+340430,
+340461,
+340494,
+340525,
+340558,
+340589,
+340622,
+340653,
+340686,
+340717,
+340750,
+340786,
+342797,
+342830,
+342861,
+342894,
+342930,
+343949,
+343982,
+344018,
+352277,
+353810,
+354485,
+354546,
+354749,
+354837,
+355165,
+360448,
+361981,
+361985,
+363517,
+363520,
+363553,
+363584,
+363681,
+363744,
+363777,
+363808,
+363841,
+363872,
+363905,
+363936,
+364065,
+364096,
+364129,
+364192,
+364225,
+364419,
+364480,
+364577,
+364608,
+364641,
+364672,
+364705,
+364736,
+364769,
+364800,
+364833,
+364864,
+364897,
+364928,
+364961,
+364992,
+365025,
+365056,
+365089,
+365120,
+365153,
+365184,
+365217,
+365248,
+365281,
+365312,
+365345,
+365376,
+365409,
+365440,
+365473,
+365504,
+365537,
+365568,
+365601,
+365632,
+365665,
+365696,
+365729,
+365760,
+365793,
+365824,
+365857,
+365888,
+365921,
+365952,
+365985,
+366016,
+366049,
+366080,
+366113,
+366144,
+366177,
+366208,
+366241,
+366272,
+366305,
+366336,
+366369,
+366400,
+366433,
+366464,
+366497,
+366528,
+366561,
+366592,
+366625,
+366656,
+366689,
+366720,
+366753,
+366784,
+366817,
+366848,
+366881,
+366912,
+366945,
+366976,
+367009,
+367040,
+367073,
+367104,
+367137,
+367168,
+367201,
+367232,
+367265,
+367296,
+367329,
+367360,
+367393,
+367424,
+367457,
+367488,
+367521,
+367552,
+367585,
+367616,
+367649,
+367680,
+367713,
+367797,
+367968,
+368001,
+368032,
+368065,
+368101,
+368192,
+368225,
+368285,
+368433,
+368554,
+368593,
+368641,
+369885,
+369889,
+369949,
+370081,
+370141,
+370180,
+371997,
+372195,
+372241,
+372285,
+372709,
+372740,
+373501,
+373764,
+374013,
+374020,
+374269,
+374276,
+374525,
+374532,
+374781,
+374788,
+375037,
+375044,
+375293,
+375300,
+375549,
+375556,
+375805,
+375813,
+376849,
+376911,
+376944,
+376975,
+377008,
+377041,
+377135,
+377168,
+377201,
+377231,
+377264,
+377297,
+377580,
+377617,
+377676,
+377713,
+377743,
+377776,
+377809,
+377871,
+377904,
+377933,
+377966,
+377997,
+378030,
+378061,
+378094,
+378125,
+378158,
+378193,
+378339,
+378385,
+378700,
+378781,
+380949,
+381789,
+381813,
+384669,
+385045,
+391901,
+392725,
+393117,
+393238,
+393265,
+393365,
+393379,
+393412,
+393449,
+393485,
+393518,
+393549,
+393582,
+393613,
+393646,
+393677,
+393710,
+393741,
+393774,
+393813,
+393869,
+393902,
+393933,
+393966,
+393997,
+394030,
+394061,
+394094,
+394124,
+394157,
+394190,
+394261,
+394281,
+394565,
+394694,
+394764,
+394787,
+394965,
+395017,
+395107,
+395140,
+395185,
+395221,
+395293,
+395300,
+398077,
+398117,
+398196,
+398243,
+398308,
+398348,
+398372,
+401265,
+401283,
+401380,
+401437,
+401572,
+402909,
+402980,
+406013,
+406037,
+406090,
+406229,
+406532,
+407421,
+407573,
+408733,
+409092,
+409621,
+410621,
+410634,
+410965,
+411914,
+412181,
+412202,
+412693,
+413706,
+414037,
+415274,
+415765,
+417789,
+417813,
+425988,
+636637,
+636949,
+638980,
+1309117,
+1310724,
+1311395,
+1311428,
+1348029,
+1348117,
+1349885,
+1350148,
+1351427,
+1351633,
+1351684,
+1360259,
+1360305,
+1360388,
+1360904,
+1361220,
+1361309,
+1361920,
+1361953,
+1361984,
+1362017,
+1362048,
+1362081,
+1362112,
+1362145,
+1362176,
+1362209,
+1362240,
+1362273,
+1362304,
+1362337,
+1362368,
+1362401,
+1362432,
+1362465,
+1362496,
+1362529,
+1362560,
+1362593,
+1362624,
+1362657,
+1362688,
+1362721,
+1362752,
+1362785,
+1362816,
+1362849,
+1362880,
+1362913,
+1362944,
+1362977,
+1363008,
+1363041,
+1363072,
+1363105,
+1363136,
+1363169,
+1363200,
+1363233,
+1363264,
+1363297,
+1363328,
+1363361,
+1363396,
+1363429,
+1363463,
+1363569,
+1363589,
+1363921,
+1363939,
+1363968,
+1364001,
+1364032,
+1364065,
+1364096,
+1364129,
+1364160,
+1364193,
+1364224,
+1364257,
+1364288,
+1364321,
+1364352,
+1364385,
+1364416,
+1364449,
+1364480,
+1364513,
+1364544,
+1364577,
+1364608,
+1364641,
+1364672,
+1364705,
+1364765,
+1364965,
+1364996,
+1367241,
+1367557,
+1367633,
+1367837,
+1368084,
+1368803,
+1369108,
+1369152,
+1369185,
+1369216,
+1369249,
+1369280,
+1369313,
+1369344,
+1369377,
+1369408,
+1369441,
+1369472,
+1369505,
+1369536,
+1369569,
+1369664,
+1369697,
+1369728,
+1369761,
+1369792,
+1369825,
+1369856,
+1369889,
+1369920,
+1369953,
+1369984,
+1370017,
+1370048,
+1370081,
+1370112,
+1370145,
+1370176,
+1370209,
+1370240,
+1370273,
+1370304,
+1370337,
+1370368,
+1370401,
+1370432,
+1370465,
+1370496,
+1370529,
+1370560,
+1370593,
+1370624,
+1370657,
+1370688,
+1370721,
+1370752,
+1370785,
+1370816,
+1370849,
+1370880,
+1370913,
+1370944,
+1370977,
+1371008,
+1371041,
+1371072,
+1371105,
+1371136,
+1371169,
+1371200,
+1371233,
+1371264,
+1371297,
+1371328,
+1371361,
+1371392,
+1371425,
+1371456,
+1371489,
+1371520,
+1371553,
+1371584,
+1371617,
+1371651,
+1371681,
+1371936,
+1371969,
+1372000,
+1372033,
+1372064,
+1372129,
+1372160,
+1372193,
+1372224,
+1372257,
+1372288,
+1372321,
+1372352,
+1372385,
+1372419,
+1372468,
+1372512,
+1372545,
+1372576,
+1372609,
+1372669,
+1372672,
+1372705,
+1372736,
+1372769,
+1372829,
+1373184,
+1373217,
+1373248,
+1373281,
+1373312,
+1373345,
+1373376,
+1373409,
+1373440,
+1373473,
+1373504,
+1373565,
+1376003,
+1376065,
+1376100,
+1376325,
+1376356,
+1376453,
+1376484,
+1376613,
+1376644,
+1377382,
+1377445,
+1377510,
+1377557,
+1377693,
+1377802,
+1378005,
+1378067,
+1378101,
+1378141,
+1378308,
+1379985,
+1380125,
+1380358,
+1380420,
+1382022,
+1382533,
+1382589,
+1382865,
+1382920,
+1383261,
+1383429,
+1384004,
+1384209,
+1384292,
+1384349,
+1384456,
+1384772,
+1385669,
+1385937,
+1385988,
+1386725,
+1387078,
+1387165,
+1387505,
+1387524,
+1388477,
+1388549,
+1388646,
+1388676,
+1390181,
+1390214,
+1390277,
+1390406,
+1390469,
+1390502,
+1390641,
+1391069,
+1391075,
+1391112,
+1391453,
+1391569,
+1391645,
+1392644,
+1393957,
+1394150,
+1394213,
+1394278,
+1394341,
+1394429,
+1394692,
+1394789,
+1394820,
+1395077,
+1395110,
+1395165,
+1395208,
+1395549,
+1395601,
+1395716,
+1396227,
+1396260,
+1396469,
+1396548,
+1396582,
+1396637,
+1396740,
+1398277,
+1398308,
+1398341,
+1398436,
+1398501,
+1398564,
+1398725,
+1398788,
+1398821,
+1398852,
+1398909,
+1399652,
+1399715,
+1399761,
+1399812,
+1400166,
+1400197,
+1400262,
+1400337,
+1400388,
+1400419,
+1400486,
+1400517,
+1400573,
+1400868,
+1401085,
+1401124,
+1401341,
+1401380,
+1401597,
+1401860,
+1402109,
+1402116,
+1402365,
+1406980,
+1408102,
+1408165,
+1408198,
+1408261,
+1408294,
+1408369,
+1408390,
+1408421,
+1408477,
+1408520,
+1408861,
+1409028,
+1766557,
+1766916,
+1767677,
+1767780,
+1769373,
+1769499,
+1835036,
+2039812,
+2051549,
+2051588,
+2055005,
+2056193,
+2056445,
+2056801,
+2056989,
+2057124,
+2057157,
+2057188,
+2057522,
+2057540,
+2057981,
+2057988,
+2058173,
+2058180,
+2058237,
+2058244,
+2058333,
+2058340,
+2058429,
+2058436,
+2061908,
+2062429,
+2062948,
+2074573,
+2074606,
+2074653,
+2075140,
+2077213,
+2077252,
+2079005,
+2080260,
+2080659,
+2080693,
+2080733,
+2080773,
+2081297,
+2081517,
+2081550,
+2081585,
+2081629,
+2081797,
+2082045,
+2082321,
+2082348,
+2082411,
+2082477,
+2082510,
+2082541,
+2082574,
+2082605,
+2082638,
+2082669,
+2082702,
+2082733,
+2082766,
+2082797,
+2082830,
+2082861,
+2082894,
+2082925,
+2082958,
+2082993,
+2083053,
+2083086,
+2083121,
+2083243,
+2083345,
+2083453,
+2083473,
+2083596,
+2083629,
+2083662,
+2083693,
+2083726,
+2083757,
+2083790,
+2083825,
+2083922,
+2083948,
+2083986,
+2084093,
+2084113,
+2084147,
+2084177,
+2084253,
+2084356,
+2084541,
+2084548,
+2088893,
+2088954,
+2088989,
+2089009,
+2089107,
+2089137,
+2089229,
+2089262,
+2089297,
+2089330,
+2089361,
+2089388,
+2089425,
+2089480,
+2089809,
+2089874,
+2089969,
+2090016,
+2090861,
+2090897,
+2090926,
+2090964,
+2090987,
+2091028,
+2091041,
+2091885,
+2091922,
+2091950,
+2091986,
+2092013,
+2092046,
+2092081,
+2092109,
+2092142,
+2092177,
+2092228,
+2092547,
+2092580,
+2094019,
+2094084,
+2095101,
+2095172,
+2095389,
+2095428,
+2095645,
+2095684,
+2095901,
+2095940,
+2096061,
+2096147,
+2096210,
+2096244,
+2096277,
+2096307,
+2096381,
+2096405,
+2096434,
+2096565,
+2096637,
+2096954,
+2097045,
+2097117,
+2097156,
+2097565,
+2097572,
+2098429,
+2098436,
+2099069,
+2099076,
+2099165,
+2099172,
+2099677,
+2099716,
+2100189,
+2101252,
+2105213,
+2105361,
+2105469,
+2105578,
+2107037,
+2107125,
+2107401,
+2109098,
+2109237,
+2109770,
+2109821,
+2109973,
+2110365,
+2112021,
+2113445,
+2113501,
+2117636,
+2118589,
+2118660,
+2120253,
+2121732,
+2122749,
+2122762,
+2122909,
+2123268,
+2123817,
+2123844,
+2124105,
+2124157,
+2125828,
+2126813,
+2126833,
+2126852,
+2128029,
+2128132,
+2128401,
+2128425,
+2128605,
+2129920,
+2131201,
+2132484,
+2135005,
+2135048,
+2135389,
+2162692,
+2162909,
+2162948,
+2163005,
+2163012,
+2164445,
+2164452,
+2164541,
+2164612,
+2164669,
+2164708,
+2165469,
+2165489,
+2165514,
+2165789,
+2170884,
+2171594,
+2171805,
+2171889,
+2171908,
+2172765,
+2172913,
+2172957,
+2174980,
+2176797,
+2176964,
+2177053,
+2179076,
+2179109,
+2179229,
+2179237,
+2179325,
+2179461,
+2179588,
+2179741,
+2179748,
+2179869,
+2179876,
+2180765,
+2180869,
+2180989,
+2181093,
+2181130,
+2181405,
+2181649,
+2181949,
+2182148,
+2183082,
+2183153,
+2183197,
+2187268,
+2189021,
+2189105,
+2189316,
+2190045,
+2190090,
+2190340,
+2190973,
+2191114,
+2191389,
+2195460,
+2197821,
+2214922,
+2215933,
+2228230,
+2228261,
+2228294,
+2228324,
+2230021,
+2230513,
+2230749,
+2230858,
+2231496,
+2231837,
+2232325,
+2232390,
+2232420,
+2233862,
+2233957,
+2234086,
+2234149,
+2234225,
+2234298,
+2234321,
+2234461,
+2234884,
+2235709,
+2235912,
+2236253,
+2236421,
+2236516,
+2237669,
+2237830,
+2237861,
+2238141,
+2238152,
+2238481,
+2238621,
+2240517,
+2240582,
+2240612,
+2242150,
+2242245,
+2242534,
+2242596,
+2242737,
+2242877,
+2243080,
+2243421,
+2281476,
+2282853,
+2282886,
+2282917,
+2282950,
+2283013,
+2283206,
+2283237,
+2283293,
+2283528,
+2283869,
+2359300,
+2387453,
+2392073,
+2395261,
+2395665,
+2395805,
+2490372,
+2524669,
+2949124,
+2967357,
+3006468,
+3008701,
+3009028,
+3009062,
+3010557,
+3011045,
+3011171,
+3011613,
+3538948,
+3539037,
+3801109,
+3808989,
+3809301,
+3810557,
+3810613,
+3812518,
+3812581,
+3812693,
+3812774,
+3812986,
+3813221,
+3813493,
+3813541,
+3813781,
+3814725,
+3814869,
+3816413,
+3817493,
+3819589,
+3819701,
+3819741,
+3825685,
+3828477,
+3828746,
+3829341,
+3833856,
+3834689,
+3835520,
+3836353,
+3836605,
+3836609,
+3837184,
+3838017,
+3838848,
+3838909,
+3838912,
+3839005,
+3839040,
+3839101,
+3839136,
+3839229,
+3839264,
+3839421,
+3839424,
+3839681,
+3839837,
+3839841,
+3839901,
+3839905,
+3840157,
+3840161,
+3840512,
+3841345,
+3842176,
+3842269,
+3842272,
+3842429,
+3842464,
+3842749,
+3842752,
+3843005,
+3843009,
+3843840,
+3843933,
+3843936,
+3844093,
+3844096,
+3844285,
+3844288,
+3844349,
+3844416,
+3844669,
+3844673,
+3845504,
+3846337,
+3847168,
+3848001,
+3848832,
+3849665,
+3850496,
+3851329,
+3852160,
+3852993,
+3853824,
+3854657,
+3855581,
+3855616,
+3856434,
+3856449,
+3857266,
+3857281,
+3857472,
+3858290,
+3858305,
+3859122,
+3859137,
+3859328,
+3860146,
+3860161,
+3860978,
+3860993,
+3861184,
+3862002,
+3862017,
+3862834,
+3862849,
+3863040,
+3863858,
+3863873,
+3864690,
+3864705,
+3864896,
+3864929,
+3864989,
+3865032,
+3866653,
+4046852,
+4047005,
+4047012,
+4047901,
+4047908,
+4047997,
+4048004,
+4048061,
+4048100,
+4048157,
+4048164,
+4048509,
+4048516,
+4048669,
+4048676,
+4048733,
+4048740,
+4048797,
+4048964,
+4049021,
+4049124,
+4049181,
+4049188,
+4049245,
+4049252,
+4049309,
+4049316,
+4049437,
+4049444,
+4049533,
+4049540,
+4049597,
+4049636,
+4049693,
+4049700,
+4049757,
+4049764,
+4049821,
+4049828,
+4049885,
+4049892,
+4049949,
+4049956,
+4050045,
+4050052,
+4050109,
+4050148,
+4050301,
+4050308,
+4050557,
+4050564,
+4050717,
+4050724,
+4050877,
+4050884,
+4050941,
+4050948,
+4051293,
+4051300,
+4051869,
+4052004,
+4052125,
+4052132,
+4052317,
+4052324,
+4052893,
+4054546,
+4054621,
+4063253,
+4064669,
+4064789,
+4067997,
+4068373,
+4068861,
+4068917,
+4069373,
+4069429,
+4069917,
+4069941,
+4070429,
+4071434,
+4071805,
+4071957,
+4072957,
+4072981,
+4074909,
+4075029,
+4076413,
+4078805,
+4079741,
+4080149,
+4081533,
+4081685,
+4081981,
+4082197,
+4082269,
+4087829,
+4088893,
+4089365,
+4089565,
+4089589,
+4091837,
+4091925,
+4092573,
+4092949,
+4094141,
+4094165,
+4094333,
+4094997,
+4095549,
+4096021,
+4098045,
+4098069,
+4098109,
+4098133,
+4103965,
+4103989,
+4104125,
+4104213,
+4106205,
+4106261,
+4106397,
+4106773,
+4107549,
+4112245,
+4114493,
+4114613,
+4114973,
+4116501,
+4118749,
+4120597,
+4124317,
+4194308,
+5561085,
+5562372,
+5695165,
+5695492,
+5702621,
+6225924,
+6243293,
+29360186,
+29360221,
+29361178,
+29364253,
+29368325,
+29376029,
+31457308,
+33554397,
+33554460,
+35651549,
+//--Autogenerated -- end of section automatically generated
+};
+
+const int maxUnicode = 0x10ffff;
+const int maskCategory = 0x1F;
+const int nRanges = ELEMENTS(catRanges);
+
+}
+
+// Each element in catRanges is the start of a range of Unicode characters in
+// one general category.
+// The value is comprised of a 21-bit character value shifted 5 bits and a 5 bit
+// category matching the CharacterCategory enumeration.
+// Initial version has 3249 entries and adds about 13K to the executable.
+// The array is in ascending order so can be searched using binary search.
+// Therefore the average call takes log2(3249) = 12 comparisons.
+// For speed, it may be useful to make a linear table for the common values,
+// possibly for 0..0xff for most Western European text or 0..0xfff for most
+// alphabetic languages.
+
+CharacterCategory CategoriseCharacter(int character) {
+ if (character < 0 || character > maxUnicode)
+ return ccCn;
+ const int baseValue = character * (maskCategory+1) + maskCategory;
+ const int *placeAfter = std::lower_bound(catRanges, catRanges+nRanges, baseValue);
+ return static_cast<CharacterCategory>(*(placeAfter-1) & maskCategory);
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.h
new file mode 100644
index 00000000000..c8600504bb4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterCategory.h
@@ -0,0 +1,31 @@
+// Scintilla source code edit control
+/** @file CharacterCategory.h
+ ** Returns the Unicode general category of a character.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CHARACTERCATEGORY_H
+#define CHARACTERCATEGORY_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+enum CharacterCategory {
+ ccLu, ccLl, ccLt, ccLm, ccLo,
+ ccMn, ccMc, ccMe,
+ ccNd, ccNl, ccNo,
+ ccPc, ccPd, ccPs, ccPe, ccPi, ccPf, ccPo,
+ ccSm, ccSc, ccSk, ccSo,
+ ccZs, ccZl, ccZp,
+ ccCc, ccCf, ccCs, ccCo, ccCn
+};
+
+CharacterCategory CategoriseCharacter(int character);
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.cxx
new file mode 100644
index 00000000000..0ab2cc0cc9d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.cxx
@@ -0,0 +1,61 @@
+// Scintilla source code edit control
+/** @file CharacterSet.cxx
+ ** Simple case functions for ASCII.
+ ** Lexer infrastructure.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "CharacterSet.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+int CompareCaseInsensitive(const char *a, const char *b) {
+ while (*a && *b) {
+ if (*a != *b) {
+ char upperA = MakeUpperCase(*a);
+ char upperB = MakeUpperCase(*b);
+ if (upperA != upperB)
+ return upperA - upperB;
+ }
+ a++;
+ b++;
+ }
+ // Either *a or *b is nul
+ return *a - *b;
+}
+
+int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
+ while (*a && *b && len) {
+ if (*a != *b) {
+ char upperA = MakeUpperCase(*a);
+ char upperB = MakeUpperCase(*b);
+ if (upperA != upperB)
+ return upperA - upperB;
+ }
+ a++;
+ b++;
+ len--;
+ }
+ if (len == 0)
+ return 0;
+ else
+ // Either *a or *b is nul
+ return *a - *b;
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.h
new file mode 100644
index 00000000000..a0c45b2fbcc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/CharacterSet.h
@@ -0,0 +1,177 @@
+// Scintilla source code edit control
+/** @file CharacterSet.h
+ ** Encapsulates a set of characters. Used to test if a character is within a set.
+ **/
+// Copyright 2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CHARACTERSET_H
+#define CHARACTERSET_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class CharacterSet {
+ int size;
+ bool valueAfter;
+ bool *bset;
+public:
+ enum setBase {
+ setNone=0,
+ setLower=1,
+ setUpper=2,
+ setDigits=4,
+ setAlpha=setLower|setUpper,
+ setAlphaNum=setAlpha|setDigits
+ };
+ CharacterSet(setBase base=setNone, const char *initialSet="", int size_=0x80, bool valueAfter_=false) {
+ size = size_;
+ valueAfter = valueAfter_;
+ bset = new bool[size];
+ for (int i=0; i < size; i++) {
+ bset[i] = false;
+ }
+ AddString(initialSet);
+ if (base & setLower)
+ AddString("abcdefghijklmnopqrstuvwxyz");
+ if (base & setUpper)
+ AddString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ if (base & setDigits)
+ AddString("0123456789");
+ }
+ CharacterSet(const CharacterSet &other) {
+ size = other.size;
+ valueAfter = other.valueAfter;
+ bset = new bool[size];
+ for (int i=0; i < size; i++) {
+ bset[i] = other.bset[i];
+ }
+ }
+ ~CharacterSet() {
+ delete []bset;
+ bset = 0;
+ size = 0;
+ }
+ CharacterSet &operator=(const CharacterSet &other) {
+ if (this != &other) {
+ bool *bsetNew = new bool[other.size];
+ for (int i=0; i < other.size; i++) {
+ bsetNew[i] = other.bset[i];
+ }
+ delete []bset;
+ size = other.size;
+ valueAfter = other.valueAfter;
+ bset = bsetNew;
+ }
+ return *this;
+ }
+ void Add(int val) {
+ assert(val >= 0);
+ assert(val < size);
+ bset[val] = true;
+ }
+ void AddString(const char *setToAdd) {
+ for (const char *cp=setToAdd; *cp; cp++) {
+ int val = static_cast<unsigned char>(*cp);
+ assert(val >= 0);
+ assert(val < size);
+ bset[val] = true;
+ }
+ }
+ bool Contains(int val) const {
+ assert(val >= 0);
+ if (val < 0) return false;
+ return (val < size) ? bset[val] : valueAfter;
+ }
+};
+
+// Functions for classifying characters
+
+inline bool IsASpace(int ch) {
+ return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
+}
+
+inline bool IsASpaceOrTab(int ch) {
+ return (ch == ' ') || (ch == '\t');
+}
+
+inline bool IsADigit(int ch) {
+ return (ch >= '0') && (ch <= '9');
+}
+
+inline bool IsADigit(int ch, int base) {
+ if (base <= 10) {
+ return (ch >= '0') && (ch < '0' + base);
+ } else {
+ return ((ch >= '0') && (ch <= '9')) ||
+ ((ch >= 'A') && (ch < 'A' + base - 10)) ||
+ ((ch >= 'a') && (ch < 'a' + base - 10));
+ }
+}
+
+inline bool IsASCII(int ch) {
+ return (ch >= 0) && (ch < 0x80);
+}
+
+inline bool IsLowerCase(int ch) {
+ return (ch >= 'a') && (ch <= 'z');
+}
+
+inline bool IsUpperCase(int ch) {
+ return (ch >= 'A') && (ch <= 'Z');
+}
+
+inline bool IsAlphaNumeric(int ch) {
+ return
+ ((ch >= '0') && (ch <= '9')) ||
+ ((ch >= 'a') && (ch <= 'z')) ||
+ ((ch >= 'A') && (ch <= 'Z'));
+}
+
+/**
+ * Check if a character is a space.
+ * This is ASCII specific but is safe with chars >= 0x80.
+ */
+inline bool isspacechar(int ch) {
+ return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
+}
+
+inline bool iswordchar(int ch) {
+ return IsAlphaNumeric(ch) || ch == '.' || ch == '_';
+}
+
+inline bool iswordstart(int ch) {
+ return IsAlphaNumeric(ch) || ch == '_';
+}
+
+inline bool isoperator(int ch) {
+ if (IsAlphaNumeric(ch))
+ return false;
+ if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
+ ch == '(' || ch == ')' || ch == '-' || ch == '+' ||
+ ch == '=' || ch == '|' || ch == '{' || ch == '}' ||
+ ch == '[' || ch == ']' || ch == ':' || ch == ';' ||
+ ch == '<' || ch == '>' || ch == ',' || ch == '/' ||
+ ch == '?' || ch == '!' || ch == '.' || ch == '~')
+ return true;
+ return false;
+}
+
+// Simple case functions for ASCII.
+
+inline char MakeUpperCase(char ch) {
+ if (ch < 'a' || ch > 'z')
+ return ch;
+ else
+ return static_cast<char>(ch - 'a' + 'A');
+}
+
+int CompareCaseInsensitive(const char *a, const char *b);
+int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexAccessor.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexAccessor.h
new file mode 100644
index 00000000000..8e3455d0c35
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexAccessor.h
@@ -0,0 +1,204 @@
+// Scintilla source code edit control
+/** @file LexAccessor.h
+ ** Interfaces between Scintilla and lexers.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LEXACCESSOR_H
+#define LEXACCESSOR_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+enum EncodingType { enc8bit, encUnicode, encDBCS };
+
+class LexAccessor {
+private:
+ IDocument *pAccess;
+ enum {extremePosition=0x7FFFFFFF};
+ /** @a bufferSize is a trade off between time taken to copy the characters
+ * and retrieval overhead.
+ * @a slopSize positions the buffer before the desired position
+ * in case there is some backtracking. */
+ enum {bufferSize=4000, slopSize=bufferSize/8};
+ char buf[bufferSize+1];
+ int startPos;
+ int endPos;
+ int codePage;
+ enum EncodingType encodingType;
+ int lenDoc;
+ char styleBuf[bufferSize];
+ int validLen;
+ unsigned int startSeg;
+ int startPosStyling;
+ int documentVersion;
+
+ void Fill(int position) {
+ startPos = position - slopSize;
+ if (startPos + bufferSize > lenDoc)
+ startPos = lenDoc - bufferSize;
+ if (startPos < 0)
+ startPos = 0;
+ endPos = startPos + bufferSize;
+ if (endPos > lenDoc)
+ endPos = lenDoc;
+
+ pAccess->GetCharRange(buf, startPos, endPos-startPos);
+ buf[endPos-startPos] = '\0';
+ }
+
+public:
+ explicit LexAccessor(IDocument *pAccess_) :
+ pAccess(pAccess_), startPos(extremePosition), endPos(0),
+ codePage(pAccess->CodePage()),
+ encodingType(enc8bit),
+ lenDoc(pAccess->Length()),
+ validLen(0),
+ startSeg(0), startPosStyling(0),
+ documentVersion(pAccess->Version()) {
+ // Prevent warnings by static analyzers about uninitialized buf and styleBuf.
+ buf[0] = 0;
+ styleBuf[0] = 0;
+ switch (codePage) {
+ case 65001:
+ encodingType = encUnicode;
+ break;
+ case 932:
+ case 936:
+ case 949:
+ case 950:
+ case 1361:
+ encodingType = encDBCS;
+ }
+ }
+ char operator[](int position) {
+ if (position < startPos || position >= endPos) {
+ Fill(position);
+ }
+ return buf[position - startPos];
+ }
+ IDocumentWithLineEnd *MultiByteAccess() const {
+ if (documentVersion >= dvLineEnd) {
+ return static_cast<IDocumentWithLineEnd *>(pAccess);
+ }
+ return 0;
+ }
+ /** Safe version of operator[], returning a defined value for invalid position. */
+ char SafeGetCharAt(int position, char chDefault=' ') {
+ if (position < startPos || position >= endPos) {
+ Fill(position);
+ if (position < startPos || position >= endPos) {
+ // Position is outside range of document
+ return chDefault;
+ }
+ }
+ return buf[position - startPos];
+ }
+ bool IsLeadByte(char ch) const {
+ return pAccess->IsDBCSLeadByte(ch);
+ }
+ EncodingType Encoding() const {
+ return encodingType;
+ }
+ bool Match(int pos, const char *s) {
+ for (int i=0; *s; i++) {
+ if (*s != SafeGetCharAt(pos+i))
+ return false;
+ s++;
+ }
+ return true;
+ }
+ char StyleAt(int position) const {
+ return static_cast<char>(pAccess->StyleAt(position));
+ }
+ int GetLine(int position) const {
+ return pAccess->LineFromPosition(position);
+ }
+ int LineStart(int line) const {
+ return pAccess->LineStart(line);
+ }
+ int LineEnd(int line) {
+ if (documentVersion >= dvLineEnd) {
+ return (static_cast<IDocumentWithLineEnd *>(pAccess))->LineEnd(line);
+ } else {
+ // Old interface means only '\r', '\n' and '\r\n' line ends.
+ int startNext = pAccess->LineStart(line+1);
+ char chLineEnd = SafeGetCharAt(startNext-1);
+ if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2) == '\r'))
+ return startNext - 2;
+ else
+ return startNext - 1;
+ }
+ }
+ int LevelAt(int line) const {
+ return pAccess->GetLevel(line);
+ }
+ int Length() const {
+ return lenDoc;
+ }
+ void Flush() {
+ if (validLen > 0) {
+ pAccess->SetStyles(validLen, styleBuf);
+ startPosStyling += validLen;
+ validLen = 0;
+ }
+ }
+ int GetLineState(int line) const {
+ return pAccess->GetLineState(line);
+ }
+ int SetLineState(int line, int state) {
+ return pAccess->SetLineState(line, state);
+ }
+ // Style setting
+ void StartAt(unsigned int start) {
+ pAccess->StartStyling(start, '\377');
+ startPosStyling = start;
+ }
+ unsigned int GetStartSegment() const {
+ return startSeg;
+ }
+ void StartSegment(unsigned int pos) {
+ startSeg = pos;
+ }
+ void ColourTo(unsigned int pos, int chAttr) {
+ // Only perform styling if non empty range
+ if (pos != startSeg - 1) {
+ assert(pos >= startSeg);
+ if (pos < startSeg) {
+ return;
+ }
+
+ if (validLen + (pos - startSeg + 1) >= bufferSize)
+ Flush();
+ if (validLen + (pos - startSeg + 1) >= bufferSize) {
+ // Too big for buffer so send directly
+ pAccess->SetStyleFor(pos - startSeg + 1, static_cast<char>(chAttr));
+ } else {
+ for (unsigned int i = startSeg; i <= pos; i++) {
+ assert((startPosStyling + validLen) < Length());
+ styleBuf[validLen++] = static_cast<char>(chAttr);
+ }
+ }
+ }
+ startSeg = pos+1;
+ }
+ void SetLevel(int line, int level) {
+ pAccess->SetLevel(line, level);
+ }
+ void IndicatorFill(int start, int end, int indicator, int value) {
+ pAccess->DecorationSetCurrentIndicator(indicator);
+ pAccess->DecorationFillRange(start, value, end - start);
+ }
+
+ void ChangeLexerState(int start, int end) {
+ pAccess->ChangeLexerState(start, end);
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.cxx
new file mode 100644
index 00000000000..bbef3f15939
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.cxx
@@ -0,0 +1,92 @@
+// Scintilla source code edit control
+/** @file LexerBase.cxx
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LexerBase::LexerBase() {
+ for (int wl = 0; wl < numWordLists; wl++)
+ keyWordLists[wl] = new WordList;
+ keyWordLists[numWordLists] = 0;
+}
+
+LexerBase::~LexerBase() {
+ for (int wl = 0; wl < numWordLists; wl++) {
+ delete keyWordLists[wl];
+ keyWordLists[wl] = 0;
+ }
+ keyWordLists[numWordLists] = 0;
+}
+
+void SCI_METHOD LexerBase::Release() {
+ delete this;
+}
+
+int SCI_METHOD LexerBase::Version() const {
+ return lvOriginal;
+}
+
+const char * SCI_METHOD LexerBase::PropertyNames() {
+ return "";
+}
+
+int SCI_METHOD LexerBase::PropertyType(const char *) {
+ return SC_TYPE_BOOLEAN;
+}
+
+const char * SCI_METHOD LexerBase::DescribeProperty(const char *) {
+ return "";
+}
+
+int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) {
+ const char *valOld = props.Get(key);
+ if (strcmp(val, valOld) != 0) {
+ props.Set(key, val);
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+const char * SCI_METHOD LexerBase::DescribeWordListSets() {
+ return "";
+}
+
+int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) {
+ if (n < numWordLists) {
+ WordList wlNew;
+ wlNew.Set(wl);
+ if (*keyWordLists[n] != wlNew) {
+ keyWordLists[n]->Set(wl);
+ return 0;
+ }
+ }
+ return -1;
+}
+
+void * SCI_METHOD LexerBase::PrivateCall(int, void *) {
+ return 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.h
new file mode 100644
index 00000000000..2998d2449f9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerBase.h
@@ -0,0 +1,41 @@
+// Scintilla source code edit control
+/** @file LexerBase.h
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LEXERBASE_H
+#define LEXERBASE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// A simple lexer with no state
+class LexerBase : public ILexer {
+protected:
+ PropSetSimple props;
+ enum {numWordLists=KEYWORDSET_MAX+1};
+ WordList *keyWordLists[numWordLists+1];
+public:
+ LexerBase();
+ virtual ~LexerBase();
+ void SCI_METHOD Release();
+ int SCI_METHOD Version() const;
+ const char * SCI_METHOD PropertyNames();
+ int SCI_METHOD PropertyType(const char *name);
+ const char * SCI_METHOD DescribeProperty(const char *name);
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ const char * SCI_METHOD DescribeWordListSets();
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0;
+ void * SCI_METHOD PrivateCall(int operation, void *pointer);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.cxx
new file mode 100644
index 00000000000..6cefbee7786
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.cxx
@@ -0,0 +1,111 @@
+// Scintilla source code edit control
+/** @file LexerModule.cxx
+ ** Colourise for particular languages.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+#include "LexerSimple.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LexerModule::LexerModule(int language_,
+ LexerFunction fnLexer_,
+ const char *languageName_,
+ LexerFunction fnFolder_,
+ const char *const wordListDescriptions_[]) :
+ language(language_),
+ fnLexer(fnLexer_),
+ fnFolder(fnFolder_),
+ fnFactory(0),
+ wordListDescriptions(wordListDescriptions_),
+ languageName(languageName_) {
+}
+
+LexerModule::LexerModule(int language_,
+ LexerFactoryFunction fnFactory_,
+ const char *languageName_,
+ const char * const wordListDescriptions_[]) :
+ language(language_),
+ fnLexer(0),
+ fnFolder(0),
+ fnFactory(fnFactory_),
+ wordListDescriptions(wordListDescriptions_),
+ languageName(languageName_) {
+}
+
+int LexerModule::GetNumWordLists() const {
+ if (wordListDescriptions == NULL) {
+ return -1;
+ } else {
+ int numWordLists = 0;
+
+ while (wordListDescriptions[numWordLists]) {
+ ++numWordLists;
+ }
+
+ return numWordLists;
+ }
+}
+
+const char *LexerModule::GetWordListDescription(int index) const {
+ assert(index < GetNumWordLists());
+ if (!wordListDescriptions || (index >= GetNumWordLists())) {
+ return "";
+ } else {
+ return wordListDescriptions[index];
+ }
+}
+
+ILexer *LexerModule::Create() const {
+ if (fnFactory)
+ return fnFactory();
+ else
+ return new LexerSimple(this);
+}
+
+void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle,
+ WordList *keywordlists[], Accessor &styler) const {
+ if (fnLexer)
+ fnLexer(startPos, lengthDoc, initStyle, keywordlists, styler);
+}
+
+void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
+ WordList *keywordlists[], Accessor &styler) const {
+ if (fnFolder) {
+ int lineCurrent = styler.GetLine(startPos);
+ // Move back one line in case deletion wrecked current line fold state
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ int newStartPos = styler.LineStart(lineCurrent);
+ lengthDoc += startPos - newStartPos;
+ startPos = newStartPos;
+ initStyle = 0;
+ if (startPos > 0) {
+ initStyle = styler.StyleAt(startPos - 1);
+ }
+ }
+ fnFolder(startPos, lengthDoc, initStyle, keywordlists, styler);
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.h
new file mode 100644
index 00000000000..5993c0fe972
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerModule.h
@@ -0,0 +1,82 @@
+// Scintilla source code edit control
+/** @file LexerModule.h
+ ** Colourise for particular languages.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LEXERMODULE_H
+#define LEXERMODULE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class Accessor;
+class WordList;
+
+typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,
+ WordList *keywordlists[], Accessor &styler);
+typedef ILexer *(*LexerFactoryFunction)();
+
+/**
+ * A LexerModule is responsible for lexing and folding a particular language.
+ * The class maintains a list of LexerModules which can be searched to find a
+ * module appropriate to a particular language.
+ */
+class LexerModule {
+protected:
+ int language;
+ LexerFunction fnLexer;
+ LexerFunction fnFolder;
+ LexerFactoryFunction fnFactory;
+ const char * const * wordListDescriptions;
+
+public:
+ const char *languageName;
+ LexerModule(int language_,
+ LexerFunction fnLexer_,
+ const char *languageName_=0,
+ LexerFunction fnFolder_=0,
+ const char * const wordListDescriptions_[] = NULL);
+ LexerModule(int language_,
+ LexerFactoryFunction fnFactory_,
+ const char *languageName_,
+ const char * const wordListDescriptions_[] = NULL);
+ virtual ~LexerModule() {
+ }
+ int GetLanguage() const { return language; }
+
+ // -1 is returned if no WordList information is available
+ int GetNumWordLists() const;
+ const char *GetWordListDescription(int index) const;
+
+ ILexer *Create() const;
+
+ virtual void Lex(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) const;
+ virtual void Fold(unsigned int startPos, int length, int initStyle,
+ WordList *keywordlists[], Accessor &styler) const;
+
+ friend class Catalogue;
+};
+
+inline int Maximum(int a, int b) {
+ return (a > b) ? a : b;
+}
+
+// Shut up annoying Visual C++ warnings:
+#ifdef _MSC_VER
+#pragma warning(disable: 4244 4309 4456 4457)
+#endif
+
+// Turn off shadow warnings for lexers as may be maintained by others
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx
new file mode 100644
index 00000000000..84c4fd26b38
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx
@@ -0,0 +1,70 @@
+// Scintilla source code edit control
+/** @file LexerNoExceptions.cxx
+ ** A simple lexer with no state which does not throw exceptions so can be used in an external lexer.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+#include "LexerNoExceptions.h"
+
+#include "Platform.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+int SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val) {
+ try {
+ return LexerBase::PropertySet(key, val);
+ } catch (...) {
+ // Should not throw into caller as may be compiled with different compiler or options
+ }
+ return -1;
+}
+
+int SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) {
+ try {
+ return LexerBase::WordListSet(n, wl);
+ } catch (...) {
+ // Should not throw into caller as may be compiled with different compiler or options
+ }
+ return -1;
+}
+
+void SCI_METHOD LexerNoExceptions::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ try {
+ Accessor astyler(pAccess, &props);
+ Lexer(startPos, length, initStyle, pAccess, astyler);
+ astyler.Flush();
+ } catch (...) {
+ // Should not throw into caller as may be compiled with different compiler or options
+ pAccess->SetErrorStatus(SC_STATUS_FAILURE);
+ }
+}
+void SCI_METHOD LexerNoExceptions::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) {
+ try {
+ Accessor astyler(pAccess, &props);
+ Folder(startPos, length, initStyle, pAccess, astyler);
+ astyler.Flush();
+ } catch (...) {
+ // Should not throw into caller as may be compiled with different compiler or options
+ pAccess->SetErrorStatus(SC_STATUS_FAILURE);
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.h
new file mode 100644
index 00000000000..70ff3c13821
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerNoExceptions.h
@@ -0,0 +1,32 @@
+// Scintilla source code edit control
+/** @file LexerNoExceptions.h
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LEXERNOEXCEPTIONS_H
+#define LEXERNOEXCEPTIONS_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// A simple lexer with no state
+class LexerNoExceptions : public LexerBase {
+public:
+ // TODO Also need to prevent exceptions in constructor and destructor
+ int SCI_METHOD PropertySet(const char *key, const char *val);
+ int SCI_METHOD WordListSet(int n, const char *wl);
+ void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *);
+
+ virtual void Lexer(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
+ virtual void Folder(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.cxx
new file mode 100644
index 00000000000..4d0e178ca96
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.cxx
@@ -0,0 +1,57 @@
+// Scintilla source code edit control
+/** @file LexerSimple.cxx
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+#include "LexerSimple.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) {
+ for (int wl = 0; wl < module->GetNumWordLists(); wl++) {
+ if (!wordLists.empty())
+ wordLists += "\n";
+ wordLists += module->GetWordListDescription(wl);
+ }
+}
+
+const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
+ return wordLists.c_str();
+}
+
+void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+ Accessor astyler(pAccess, &props);
+ module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
+ astyler.Flush();
+}
+
+void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+ if (props.GetInt("fold")) {
+ Accessor astyler(pAccess, &props);
+ module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
+ astyler.Flush();
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.h
new file mode 100644
index 00000000000..e9fa9003ff2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/LexerSimple.h
@@ -0,0 +1,30 @@
+// Scintilla source code edit control
+/** @file LexerSimple.h
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LEXERSIMPLE_H
+#define LEXERSIMPLE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// A simple lexer with no state
+class LexerSimple : public LexerBase {
+ const LexerModule *module;
+ std::string wordLists;
+public:
+ explicit LexerSimple(const LexerModule *module_);
+ const char * SCI_METHOD DescribeWordListSets();
+ void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+ void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/OptionSet.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/OptionSet.h
new file mode 100644
index 00000000000..2935a20897e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/OptionSet.h
@@ -0,0 +1,142 @@
+// Scintilla source code edit control
+/** @file OptionSet.h
+ ** Manage descriptive information about an options struct for a lexer.
+ ** Hold the names, positions, and descriptions of boolean, integer and string options and
+ ** allow setting options and retrieving metadata about the options.
+ **/
+// Copyright 2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef OPTIONSET_H
+#define OPTIONSET_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+template <typename T>
+class OptionSet {
+ typedef T Target;
+ typedef bool T::*plcob;
+ typedef int T::*plcoi;
+ typedef std::string T::*plcos;
+ struct Option {
+ int opType;
+ union {
+ plcob pb;
+ plcoi pi;
+ plcos ps;
+ };
+ std::string description;
+ Option() :
+ opType(SC_TYPE_BOOLEAN), pb(0), description("") {
+ }
+ Option(plcob pb_, std::string description_="") :
+ opType(SC_TYPE_BOOLEAN), pb(pb_), description(description_) {
+ }
+ Option(plcoi pi_, std::string description_) :
+ opType(SC_TYPE_INTEGER), pi(pi_), description(description_) {
+ }
+ Option(plcos ps_, std::string description_) :
+ opType(SC_TYPE_STRING), ps(ps_), description(description_) {
+ }
+ bool Set(T *base, const char *val) const {
+ switch (opType) {
+ case SC_TYPE_BOOLEAN: {
+ bool option = atoi(val) != 0;
+ if ((*base).*pb != option) {
+ (*base).*pb = option;
+ return true;
+ }
+ break;
+ }
+ case SC_TYPE_INTEGER: {
+ int option = atoi(val);
+ if ((*base).*pi != option) {
+ (*base).*pi = option;
+ return true;
+ }
+ break;
+ }
+ case SC_TYPE_STRING: {
+ if ((*base).*ps != val) {
+ (*base).*ps = val;
+ return true;
+ }
+ break;
+ }
+ }
+ return false;
+ }
+ };
+ typedef std::map<std::string, Option> OptionMap;
+ OptionMap nameToDef;
+ std::string names;
+ std::string wordLists;
+
+ void AppendName(const char *name) {
+ if (!names.empty())
+ names += "\n";
+ names += name;
+ }
+public:
+ virtual ~OptionSet() {
+ }
+ void DefineProperty(const char *name, plcob pb, std::string description="") {
+ nameToDef[name] = Option(pb, description);
+ AppendName(name);
+ }
+ void DefineProperty(const char *name, plcoi pi, std::string description="") {
+ nameToDef[name] = Option(pi, description);
+ AppendName(name);
+ }
+ void DefineProperty(const char *name, plcos ps, std::string description="") {
+ nameToDef[name] = Option(ps, description);
+ AppendName(name);
+ }
+ const char *PropertyNames() const {
+ return names.c_str();
+ }
+ int PropertyType(const char *name) {
+ typename OptionMap::iterator it = nameToDef.find(name);
+ if (it != nameToDef.end()) {
+ return it->second.opType;
+ }
+ return SC_TYPE_BOOLEAN;
+ }
+ const char *DescribeProperty(const char *name) {
+ typename OptionMap::iterator it = nameToDef.find(name);
+ if (it != nameToDef.end()) {
+ return it->second.description.c_str();
+ }
+ return "";
+ }
+
+ bool PropertySet(T *base, const char *name, const char *val) {
+ typename OptionMap::iterator it = nameToDef.find(name);
+ if (it != nameToDef.end()) {
+ return it->second.Set(base, val);
+ }
+ return false;
+ }
+
+ void DefineWordListSets(const char * const wordListDescriptions[]) {
+ if (wordListDescriptions) {
+ for (size_t wl = 0; wordListDescriptions[wl]; wl++) {
+ if (!wordLists.empty())
+ wordLists += "\n";
+ wordLists += wordListDescriptions[wl];
+ }
+ }
+ }
+
+ const char *DescribeWordListSets() const {
+ return wordLists.c_str();
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.cxx
new file mode 100644
index 00000000000..6592d70eb39
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.cxx
@@ -0,0 +1,156 @@
+// SciTE - Scintilla based Text Editor
+/** @file PropSetSimple.cxx
+ ** A Java style properties file module.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+// Maintain a dictionary of properties
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <string>
+#include <map>
+
+#include "PropSetSimple.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+typedef std::map<std::string, std::string> mapss;
+
+PropSetSimple::PropSetSimple() {
+ mapss *props = new mapss;
+ impl = static_cast<void *>(props);
+}
+
+PropSetSimple::~PropSetSimple() {
+ mapss *props = static_cast<mapss *>(impl);
+ delete props;
+ impl = 0;
+}
+
+void PropSetSimple::Set(const char *key, const char *val, int lenKey, int lenVal) {
+ mapss *props = static_cast<mapss *>(impl);
+ if (!*key) // Empty keys are not supported
+ return;
+ if (lenKey == -1)
+ lenKey = static_cast<int>(strlen(key));
+ if (lenVal == -1)
+ lenVal = static_cast<int>(strlen(val));
+ (*props)[std::string(key, lenKey)] = std::string(val, lenVal);
+}
+
+static bool IsASpaceCharacter(unsigned int ch) {
+ return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
+}
+
+void PropSetSimple::Set(const char *keyVal) {
+ while (IsASpaceCharacter(*keyVal))
+ keyVal++;
+ const char *endVal = keyVal;
+ while (*endVal && (*endVal != '\n'))
+ endVal++;
+ const char *eqAt = strchr(keyVal, '=');
+ if (eqAt) {
+ Set(keyVal, eqAt + 1, static_cast<int>(eqAt-keyVal),
+ static_cast<int>(endVal - eqAt - 1));
+ } else if (*keyVal) { // No '=' so assume '=1'
+ Set(keyVal, "1", static_cast<int>(endVal-keyVal), 1);
+ }
+}
+
+void PropSetSimple::SetMultiple(const char *s) {
+ const char *eol = strchr(s, '\n');
+ while (eol) {
+ Set(s);
+ s = eol + 1;
+ eol = strchr(s, '\n');
+ }
+ Set(s);
+}
+
+const char *PropSetSimple::Get(const char *key) const {
+ mapss *props = static_cast<mapss *>(impl);
+ mapss::const_iterator keyPos = props->find(std::string(key));
+ if (keyPos != props->end()) {
+ return keyPos->second.c_str();
+ } else {
+ return "";
+ }
+}
+
+// There is some inconsistency between GetExpanded("foo") and Expand("$(foo)").
+// A solution is to keep a stack of variables that have been expanded, so that
+// recursive expansions can be skipped. For now I'll just use the C++ stack
+// for that, through a recursive function and a simple chain of pointers.
+
+struct VarChain {
+ VarChain(const char *var_=NULL, const VarChain *link_=NULL): var(var_), link(link_) {}
+
+ bool contains(const char *testVar) const {
+ return (var && (0 == strcmp(var, testVar)))
+ || (link && link->contains(testVar));
+ }
+
+ const char *var;
+ const VarChain *link;
+};
+
+static int ExpandAllInPlace(const PropSetSimple &props, std::string &withVars, int maxExpands, const VarChain &blankVars) {
+ size_t varStart = withVars.find("$(");
+ while ((varStart != std::string::npos) && (maxExpands > 0)) {
+ size_t varEnd = withVars.find(")", varStart+2);
+ if (varEnd == std::string::npos) {
+ break;
+ }
+
+ // For consistency, when we see '$(ab$(cde))', expand the inner variable first,
+ // regardless whether there is actually a degenerate variable named 'ab$(cde'.
+ size_t innerVarStart = withVars.find("$(", varStart+2);
+ while ((innerVarStart != std::string::npos) && (innerVarStart > varStart) && (innerVarStart < varEnd)) {
+ varStart = innerVarStart;
+ innerVarStart = withVars.find("$(", varStart+2);
+ }
+
+ std::string var(withVars.c_str(), varStart + 2, varEnd - varStart - 2);
+ std::string val = props.Get(var.c_str());
+
+ if (blankVars.contains(var.c_str())) {
+ val = ""; // treat blankVar as an empty string (e.g. to block self-reference)
+ }
+
+ if (--maxExpands >= 0) {
+ maxExpands = ExpandAllInPlace(props, val, maxExpands, VarChain(var.c_str(), &blankVars));
+ }
+
+ withVars.erase(varStart, varEnd-varStart+1);
+ withVars.insert(varStart, val.c_str(), val.length());
+
+ varStart = withVars.find("$(");
+ }
+
+ return maxExpands;
+}
+
+int PropSetSimple::GetExpanded(const char *key, char *result) const {
+ std::string val = Get(key);
+ ExpandAllInPlace(*this, val, 100, VarChain(key));
+ const int n = static_cast<int>(val.size());
+ if (result) {
+ memcpy(result, val.c_str(), n+1);
+ }
+ return n; // Not including NUL
+}
+
+int PropSetSimple::GetInt(const char *key, int defaultValue) const {
+ std::string val = Get(key);
+ ExpandAllInPlace(*this, val, 100, VarChain(key));
+ if (!val.empty()) {
+ return atoi(val.c_str());
+ }
+ return defaultValue;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.h
new file mode 100644
index 00000000000..8ca741f03e0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/PropSetSimple.h
@@ -0,0 +1,32 @@
+// Scintilla source code edit control
+/** @file PropSetSimple.h
+ ** A basic string to string map.
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef PROPSETSIMPLE_H
+#define PROPSETSIMPLE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class PropSetSimple {
+ void *impl;
+ void Set(const char *keyVal);
+public:
+ PropSetSimple();
+ virtual ~PropSetSimple();
+ void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1);
+ void SetMultiple(const char *);
+ const char *Get(const char *key) const;
+ int GetExpanded(const char *key, char *result) const;
+ int GetInt(const char *key, int defaultValue=0) const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/SparseState.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/SparseState.h
new file mode 100644
index 00000000000..e767d67101d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/SparseState.h
@@ -0,0 +1,110 @@
+// Scintilla source code edit control
+/** @file SparseState.h
+ ** Hold lexer state that may change rarely.
+ ** This is often per-line state such as whether a particular type of section has been entered.
+ ** A state continues until it is changed.
+ **/
+// Copyright 2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef SPARSESTATE_H
+#define SPARSESTATE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+template <typename T>
+class SparseState {
+ struct State {
+ int position;
+ T value;
+ State(int position_, T value_) : position(position_), value(value_) {
+ }
+ inline bool operator<(const State &other) const {
+ return position < other.position;
+ }
+ inline bool operator==(const State &other) const {
+ return (position == other.position) && (value == other.value);
+ }
+ };
+ int positionFirst;
+ typedef std::vector<State> stateVector;
+ stateVector states;
+
+ typename stateVector::iterator Find(int position) {
+ State searchValue(position, T());
+ return std::lower_bound(states.begin(), states.end(), searchValue);
+ }
+
+public:
+ explicit SparseState(int positionFirst_=-1) {
+ positionFirst = positionFirst_;
+ }
+ void Set(int position, T value) {
+ Delete(position);
+ if (states.empty() || (value != states[states.size()-1].value)) {
+ states.push_back(State(position, value));
+ }
+ }
+ T ValueAt(int position) {
+ if (states.empty())
+ return T();
+ if (position < states[0].position)
+ return T();
+ typename stateVector::iterator low = Find(position);
+ if (low == states.end()) {
+ return states[states.size()-1].value;
+ } else {
+ if (low->position > position) {
+ --low;
+ }
+ return low->value;
+ }
+ }
+ bool Delete(int position) {
+ typename stateVector::iterator low = Find(position);
+ if (low != states.end()) {
+ states.erase(low, states.end());
+ return true;
+ }
+ return false;
+ }
+ size_t size() const {
+ return states.size();
+ }
+
+ // Returns true if Merge caused a significant change
+ bool Merge(const SparseState<T> &other, int ignoreAfter) {
+ // Changes caused beyond ignoreAfter are not significant
+ Delete(ignoreAfter+1);
+
+ bool different = true;
+ bool changed = false;
+ typename stateVector::iterator low = Find(other.positionFirst);
+ if (static_cast<size_t>(states.end() - low) == other.states.size()) {
+ // Same number in other as after positionFirst in this
+ different = !std::equal(low, states.end(), other.states.begin());
+ }
+ if (different) {
+ if (low != states.end()) {
+ states.erase(low, states.end());
+ changed = true;
+ }
+ typename stateVector::const_iterator startOther = other.states.begin();
+ if (!states.empty() && !other.states.empty() && states.back().value == startOther->value)
+ ++startOther;
+ if (startOther != other.states.end()) {
+ states.insert(states.end(), startOther, other.states.end());
+ changed = true;
+ }
+ }
+ return changed;
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/StringCopy.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StringCopy.h
new file mode 100644
index 00000000000..1812b4e35ec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StringCopy.h
@@ -0,0 +1,36 @@
+// Scintilla source code edit control
+/** @file StringCopy.h
+ ** Safe string copy function which always NUL terminates.
+ ** ELEMENTS macro for determining array sizes.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef STRINGCOPY_H
+#define STRINGCOPY_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// Safer version of string copy functions like strcpy, wcsncpy, etc.
+// Instantiate over fixed length strings of both char and wchar_t.
+// May truncate if source doesn't fit into dest with room for NUL.
+
+template <typename T, size_t count>
+void StringCopy(T (&dest)[count], const T* source) {
+ for (size_t i=0; i<count; i++) {
+ dest[i] = source[i];
+ if (!source[i])
+ break;
+ }
+ dest[count-1] = 0;
+}
+
+#define ELEMENTS(a) (sizeof(a) / sizeof(a[0]))
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.cxx
new file mode 100644
index 00000000000..9429c5ba879
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.cxx
@@ -0,0 +1,56 @@
+// Scintilla source code edit control
+/** @file StyleContext.cxx
+ ** Lexer infrastructure.
+ **/
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// This file is in the public domain.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void getRange(unsigned int start,
+ unsigned int end,
+ LexAccessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = styler[start + i];
+ i++;
+ }
+ s[i] = '\0';
+}
+
+void StyleContext::GetCurrent(char *s, unsigned int len) {
+ getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len);
+}
+
+static void getRangeLowered(unsigned int start,
+ unsigned int end,
+ LexAccessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+void StyleContext::GetCurrentLowered(char *s, unsigned int len) {
+ getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.h
new file mode 100644
index 00000000000..837386cef92
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/StyleContext.h
@@ -0,0 +1,231 @@
+// Scintilla source code edit control
+/** @file StyleContext.h
+ ** Lexer infrastructure.
+ **/
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// This file is in the public domain.
+
+#ifndef STYLECONTEXT_H
+#define STYLECONTEXT_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+static inline int MakeLowerCase(int ch) {
+ if (ch < 'A' || ch > 'Z')
+ return ch;
+ else
+ return ch - 'A' + 'a';
+}
+
+// All languages handled so far can treat all characters >= 0x80 as one class
+// which just continues the current token or starts an identifier if in default.
+// DBCS treated specially as the second character can be < 0x80 and hence
+// syntactically significant. UTF-8 avoids this as all trail bytes are >= 0x80
+class StyleContext {
+ LexAccessor &styler;
+ IDocumentWithLineEnd *multiByteAccess;
+ unsigned int endPos;
+ unsigned int lengthDocument;
+
+ // Used for optimizing GetRelativeCharacter
+ unsigned int posRelative;
+ unsigned int currentPosLastRelative;
+ int offsetRelative;
+
+ StyleContext &operator=(const StyleContext &);
+
+ void GetNextChar() {
+ if (multiByteAccess) {
+ chNext = multiByteAccess->GetCharacterAndWidth(currentPos+width, &widthNext);
+ } else {
+ chNext = static_cast<unsigned char>(styler.SafeGetCharAt(currentPos+width, 0));
+ widthNext = 1;
+ }
+ // End of line determined from line end position, allowing CR, LF,
+ // CRLF and Unicode line ends as set by document.
+ if (currentLine < lineDocEnd)
+ atLineEnd = static_cast<int>(currentPos) >= (lineStartNext-1);
+ else // Last line
+ atLineEnd = static_cast<int>(currentPos) >= lineStartNext;
+ }
+
+public:
+ unsigned int currentPos;
+ int currentLine;
+ int lineDocEnd;
+ int lineStartNext;
+ bool atLineStart;
+ bool atLineEnd;
+ int state;
+ int chPrev;
+ int ch;
+ int width;
+ int chNext;
+ int widthNext;
+
+ StyleContext(unsigned int startPos, unsigned int length,
+ int initStyle, LexAccessor &styler_, char chMask='\377') :
+ styler(styler_),
+ multiByteAccess(0),
+ endPos(startPos + length),
+ posRelative(0),
+ currentPosLastRelative(0x7FFFFFFF),
+ offsetRelative(0),
+ currentPos(startPos),
+ currentLine(-1),
+ lineStartNext(-1),
+ atLineEnd(false),
+ state(initStyle & chMask), // Mask off all bits which aren't in the chMask.
+ chPrev(0),
+ ch(0),
+ width(0),
+ chNext(0),
+ widthNext(1) {
+ if (styler.Encoding() != enc8bit) {
+ multiByteAccess = styler.MultiByteAccess();
+ }
+ styler.StartAt(startPos /*, chMask*/);
+ styler.StartSegment(startPos);
+ currentLine = styler.GetLine(startPos);
+ lineStartNext = styler.LineStart(currentLine+1);
+ lengthDocument = static_cast<unsigned int>(styler.Length());
+ if (endPos == lengthDocument)
+ endPos++;
+ lineDocEnd = styler.GetLine(lengthDocument);
+ atLineStart = static_cast<unsigned int>(styler.LineStart(currentLine)) == startPos;
+
+ // Variable width is now 0 so GetNextChar gets the char at currentPos into chNext/widthNext
+ width = 0;
+ GetNextChar();
+ ch = chNext;
+ width = widthNext;
+
+ GetNextChar();
+ }
+ void Complete() {
+ styler.ColourTo(currentPos - ((currentPos > lengthDocument) ? 2 : 1), state);
+ styler.Flush();
+ }
+ bool More() const {
+ return currentPos < endPos;
+ }
+ void Forward() {
+ if (currentPos < endPos) {
+ atLineStart = atLineEnd;
+ if (atLineStart) {
+ currentLine++;
+ lineStartNext = styler.LineStart(currentLine+1);
+ }
+ chPrev = ch;
+ currentPos += width;
+ ch = chNext;
+ width = widthNext;
+ GetNextChar();
+ } else {
+ atLineStart = false;
+ chPrev = ' ';
+ ch = ' ';
+ chNext = ' ';
+ atLineEnd = true;
+ }
+ }
+ void Forward(int nb) {
+ for (int i = 0; i < nb; i++) {
+ Forward();
+ }
+ }
+ void ForwardBytes(int nb) {
+ size_t forwardPos = currentPos + nb;
+ while (forwardPos > currentPos) {
+ Forward();
+ }
+ }
+ void ChangeState(int state_) {
+ state = state_;
+ }
+ void SetState(int state_) {
+ styler.ColourTo(currentPos - ((currentPos > lengthDocument) ? 2 : 1), state);
+ state = state_;
+ }
+ void ForwardSetState(int state_) {
+ Forward();
+ styler.ColourTo(currentPos - ((currentPos > lengthDocument) ? 2 : 1), state);
+ state = state_;
+ }
+ int LengthCurrent() const {
+ return currentPos - styler.GetStartSegment();
+ }
+ int GetRelative(int n) {
+ return static_cast<unsigned char>(styler.SafeGetCharAt(currentPos+n, 0));
+ }
+ int GetRelativeCharacter(int n) {
+ if (n == 0)
+ return ch;
+ if (multiByteAccess) {
+ if ((currentPosLastRelative != currentPos) ||
+ ((n > 0) && ((offsetRelative < 0) || (n < offsetRelative))) ||
+ ((n < 0) && ((offsetRelative > 0) || (n > offsetRelative)))) {
+ posRelative = currentPos;
+ offsetRelative = 0;
+ }
+ int diffRelative = n - offsetRelative;
+ int posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative);
+ int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0);
+ posRelative = posNew;
+ currentPosLastRelative = currentPos;
+ offsetRelative = n;
+ return chReturn;
+ } else {
+ // fast version for single byte encodings
+ return static_cast<unsigned char>(styler.SafeGetCharAt(currentPos + n, 0));
+ }
+ }
+ bool Match(char ch0) const {
+ return ch == static_cast<unsigned char>(ch0);
+ }
+ bool Match(char ch0, char ch1) const {
+ return (ch == static_cast<unsigned char>(ch0)) && (chNext == static_cast<unsigned char>(ch1));
+ }
+ bool Match(const char *s) {
+ if (ch != static_cast<unsigned char>(*s))
+ return false;
+ s++;
+ if (!*s)
+ return true;
+ if (chNext != static_cast<unsigned char>(*s))
+ return false;
+ s++;
+ for (int n=2; *s; n++) {
+ if (*s != styler.SafeGetCharAt(currentPos+n, 0))
+ return false;
+ s++;
+ }
+ return true;
+ }
+ bool MatchIgnoreCase(const char *s) {
+ if (MakeLowerCase(ch) != static_cast<unsigned char>(*s))
+ return false;
+ s++;
+ if (MakeLowerCase(chNext) != static_cast<unsigned char>(*s))
+ return false;
+ s++;
+ for (int n=2; *s; n++) {
+ if (static_cast<unsigned char>(*s) !=
+ MakeLowerCase(static_cast<unsigned char>(styler.SafeGetCharAt(currentPos+n, 0))))
+ return false;
+ s++;
+ }
+ return true;
+ }
+ // Non-inline
+ void GetCurrent(char *s, unsigned int len);
+ void GetCurrentLowered(char *s, unsigned int len);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/SubStyles.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/SubStyles.h
new file mode 100644
index 00000000000..f5b15e9cfa7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/SubStyles.h
@@ -0,0 +1,178 @@
+// Scintilla source code edit control
+/** @file SubStyles.h
+ ** Manage substyles for a lexer.
+ **/
+// Copyright 2012 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef SUBSTYLES_H
+#define SUBSTYLES_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class WordClassifier {
+ int baseStyle;
+ int firstStyle;
+ int lenStyles;
+ std::map<std::string, int> wordToStyle;
+
+public:
+
+ explicit WordClassifier(int baseStyle_) : baseStyle(baseStyle_), firstStyle(0), lenStyles(0) {
+ }
+
+ void Allocate(int firstStyle_, int lenStyles_) {
+ firstStyle = firstStyle_;
+ lenStyles = lenStyles_;
+ wordToStyle.clear();
+ }
+
+ int Base() const {
+ return baseStyle;
+ }
+
+ int Start() const {
+ return firstStyle;
+ }
+
+ int Length() const {
+ return lenStyles;
+ }
+
+ void Clear() {
+ firstStyle = 0;
+ lenStyles = 0;
+ wordToStyle.clear();
+ }
+
+ int ValueFor(const std::string &s) const {
+ std::map<std::string, int>::const_iterator it = wordToStyle.find(s);
+ if (it != wordToStyle.end())
+ return it->second;
+ else
+ return -1;
+ }
+
+ bool IncludesStyle(int style) const {
+ return (style >= firstStyle) && (style < (firstStyle + lenStyles));
+ }
+
+ void SetIdentifiers(int style, const char *identifiers) {
+ while (*identifiers) {
+ const char *cpSpace = identifiers;
+ while (*cpSpace && !(*cpSpace == ' ' || *cpSpace == '\t' || *cpSpace == '\r' || *cpSpace == '\n'))
+ cpSpace++;
+ if (cpSpace > identifiers) {
+ std::string word(identifiers, cpSpace - identifiers);
+ wordToStyle[word] = style;
+ }
+ identifiers = cpSpace;
+ if (*identifiers)
+ identifiers++;
+ }
+ }
+};
+
+class SubStyles {
+ int classifications;
+ const char *baseStyles;
+ int styleFirst;
+ int stylesAvailable;
+ int secondaryDistance;
+ int allocated;
+ std::vector<WordClassifier> classifiers;
+
+ int BlockFromBaseStyle(int baseStyle) const {
+ for (int b=0; b < classifications; b++) {
+ if (baseStyle == baseStyles[b])
+ return b;
+ }
+ return -1;
+ }
+
+ int BlockFromStyle(int style) const {
+ int b = 0;
+ for (std::vector<WordClassifier>::const_iterator it=classifiers.begin(); it != classifiers.end(); ++it) {
+ if (it->IncludesStyle(style))
+ return b;
+ b++;
+ }
+ return -1;
+ }
+
+public:
+
+ SubStyles(const char *baseStyles_, int styleFirst_, int stylesAvailable_, int secondaryDistance_) :
+ classifications(0),
+ baseStyles(baseStyles_),
+ styleFirst(styleFirst_),
+ stylesAvailable(stylesAvailable_),
+ secondaryDistance(secondaryDistance_),
+ allocated(0) {
+ while (baseStyles[classifications]) {
+ classifiers.push_back(WordClassifier(baseStyles[classifications]));
+ classifications++;
+ }
+ }
+
+ int Allocate(int styleBase, int numberStyles) {
+ int block = BlockFromBaseStyle(styleBase);
+ if (block >= 0) {
+ if ((allocated + numberStyles) > stylesAvailable)
+ return -1;
+ int startBlock = styleFirst + allocated;
+ allocated += numberStyles;
+ classifiers[block].Allocate(startBlock, numberStyles);
+ return startBlock;
+ } else {
+ return -1;
+ }
+ }
+
+ int Start(int styleBase) {
+ int block = BlockFromBaseStyle(styleBase);
+ return (block >= 0) ? classifiers[block].Start() : -1;
+ }
+
+ int Length(int styleBase) {
+ int block = BlockFromBaseStyle(styleBase);
+ return (block >= 0) ? classifiers[block].Length() : 0;
+ }
+
+ int BaseStyle(int subStyle) const {
+ int block = BlockFromStyle(subStyle);
+ if (block >= 0)
+ return classifiers[block].Base();
+ else
+ return subStyle;
+ }
+
+ int DistanceToSecondaryStyles() const {
+ return secondaryDistance;
+ }
+
+ void SetIdentifiers(int style, const char *identifiers) {
+ int block = BlockFromStyle(style);
+ if (block >= 0)
+ classifiers[block].SetIdentifiers(style, identifiers);
+ }
+
+ void Free() {
+ allocated = 0;
+ for (std::vector<WordClassifier>::iterator it=classifiers.begin(); it != classifiers.end(); ++it)
+ it->Clear();
+ }
+
+ const WordClassifier &Classifier(int baseStyle) const {
+ const int block = BlockFromBaseStyle(baseStyle);
+ return classifiers[block >= 0 ? block : 0];
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.cxx b/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.cxx
new file mode 100644
index 00000000000..be7fda50563
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.cxx
@@ -0,0 +1,242 @@
+// Scintilla source code edit control
+/** @file KeyWords.cxx
+ ** Colourise for particular languages.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+
+#include <algorithm>
+
+#include "StringCopy.h"
+#include "WordList.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/**
+ * Creates an array that points into each word in the string and puts \0 terminators
+ * after each word.
+ */
+static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = false) {
+ int prev = '\n';
+ int words = 0;
+ // For rapid determination of whether a character is a separator, build
+ // a look up table.
+ bool wordSeparator[256];
+ for (int i=0; i<256; i++) {
+ wordSeparator[i] = false;
+ }
+ wordSeparator[static_cast<unsigned int>('\r')] = true;
+ wordSeparator[static_cast<unsigned int>('\n')] = true;
+ if (!onlyLineEnds) {
+ wordSeparator[static_cast<unsigned int>(' ')] = true;
+ wordSeparator[static_cast<unsigned int>('\t')] = true;
+ }
+ for (int j = 0; wordlist[j]; j++) {
+ int curr = static_cast<unsigned char>(wordlist[j]);
+ if (!wordSeparator[curr] && wordSeparator[prev])
+ words++;
+ prev = curr;
+ }
+ char **keywords = new char *[words + 1];
+ int wordsStore = 0;
+ const size_t slen = strlen(wordlist);
+ if (words) {
+ prev = '\0';
+ for (size_t k = 0; k < slen; k++) {
+ if (!wordSeparator[static_cast<unsigned char>(wordlist[k])]) {
+ if (!prev) {
+ keywords[wordsStore] = &wordlist[k];
+ wordsStore++;
+ }
+ } else {
+ wordlist[k] = '\0';
+ }
+ prev = wordlist[k];
+ }
+ }
+ keywords[wordsStore] = &wordlist[slen];
+ *len = wordsStore;
+ return keywords;
+}
+
+WordList::WordList(bool onlyLineEnds_) :
+ words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_) {
+ // Prevent warnings by static analyzers about uninitialized starts.
+ starts[0] = -1;
+}
+
+WordList::~WordList() {
+ Clear();
+}
+
+WordList::operator bool() const {
+ return len ? true : false;
+}
+
+bool WordList::operator!=(const WordList &other) const {
+ if (len != other.len)
+ return true;
+ for (int i=0; i<len; i++) {
+ if (strcmp(words[i], other.words[i]) != 0)
+ return true;
+ }
+ return false;
+}
+
+int WordList::Length() const {
+ return len;
+}
+
+void WordList::Clear() {
+ if (words) {
+ delete []list;
+ delete []words;
+ }
+ words = 0;
+ list = 0;
+ len = 0;
+}
+
+#ifdef _MSC_VER
+
+static bool cmpWords(const char *a, const char *b) {
+ return strcmp(a, b) < 0;
+}
+
+#else
+
+static int cmpWords(const void *a, const void *b) {
+ return strcmp(*static_cast<const char * const *>(a), *static_cast<const char * const *>(b));
+}
+
+static void SortWordList(char **words, unsigned int len) {
+ qsort(reinterpret_cast<void *>(words), len, sizeof(*words), cmpWords);
+}
+
+#endif
+
+void WordList::Set(const char *s) {
+ Clear();
+ const size_t lenS = strlen(s) + 1;
+ list = new char[lenS];
+ memcpy(list, s, lenS);
+ words = ArrayFromWordList(list, &len, onlyLineEnds);
+#ifdef _MSC_VER
+ std::sort(words, words + len, cmpWords);
+#else
+ SortWordList(words, len);
+#endif
+ for (unsigned int k = 0; k < ELEMENTS(starts); k++)
+ starts[k] = -1;
+ for (int l = len - 1; l >= 0; l--) {
+ unsigned char indexChar = words[l][0];
+ starts[indexChar] = l;
+ }
+}
+
+/** Check whether a string is in the list.
+ * List elements are either exact matches or prefixes.
+ * Prefix elements start with '^' and match all strings that start with the rest of the element
+ * so '^GTK_' matches 'GTK_X', 'GTK_MAJOR_VERSION', and 'GTK_'.
+ */
+bool WordList::InList(const char *s) const {
+ if (0 == words)
+ return false;
+ unsigned char firstChar = s[0];
+ int j = starts[firstChar];
+ if (j >= 0) {
+ while (static_cast<unsigned char>(words[j][0]) == firstChar) {
+ if (s[1] == words[j][1]) {
+ const char *a = words[j] + 1;
+ const char *b = s + 1;
+ while (*a && *a == *b) {
+ a++;
+ b++;
+ }
+ if (!*a && !*b)
+ return true;
+ }
+ j++;
+ }
+ }
+ j = starts[static_cast<unsigned int>('^')];
+ if (j >= 0) {
+ while (words[j][0] == '^') {
+ const char *a = words[j] + 1;
+ const char *b = s;
+ while (*a && *a == *b) {
+ a++;
+ b++;
+ }
+ if (!*a)
+ return true;
+ j++;
+ }
+ }
+ return false;
+}
+
+/** similar to InList, but word s can be a substring of keyword.
+ * eg. the keyword define is defined as def~ine. This means the word must start
+ * with def to be a keyword, but also defi, defin and define are valid.
+ * The marker is ~ in this case.
+ */
+bool WordList::InListAbbreviated(const char *s, const char marker) const {
+ if (0 == words)
+ return false;
+ unsigned char firstChar = s[0];
+ int j = starts[firstChar];
+ if (j >= 0) {
+ while (static_cast<unsigned char>(words[j][0]) == firstChar) {
+ bool isSubword = false;
+ int start = 1;
+ if (words[j][1] == marker) {
+ isSubword = true;
+ start++;
+ }
+ if (s[1] == words[j][start]) {
+ const char *a = words[j] + start;
+ const char *b = s + 1;
+ while (*a && *a == *b) {
+ a++;
+ if (*a == marker) {
+ isSubword = true;
+ a++;
+ }
+ b++;
+ }
+ if ((!*a || isSubword) && !*b)
+ return true;
+ }
+ j++;
+ }
+ }
+ j = starts[static_cast<unsigned int>('^')];
+ if (j >= 0) {
+ while (words[j][0] == '^') {
+ const char *a = words[j] + 1;
+ const char *b = s;
+ while (*a && *a == *b) {
+ a++;
+ b++;
+ }
+ if (!*a)
+ return true;
+ j++;
+ }
+ }
+ return false;
+}
+
+const char *WordList::WordAt(int n) const {
+ return words[n];
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.h b/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.h
new file mode 100644
index 00000000000..382be2812be
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/lexlib/WordList.h
@@ -0,0 +1,41 @@
+// Scintilla source code edit control
+/** @file WordList.h
+ ** Hold a list of words.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef WORDLIST_H
+#define WORDLIST_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class WordList {
+ // Each word contains at least one character - a empty word acts as sentinel at the end.
+ char **words;
+ char *list;
+ int len;
+ bool onlyLineEnds; ///< Delimited by any white space or only line ends
+ int starts[256];
+public:
+ explicit WordList(bool onlyLineEnds_ = false);
+ ~WordList();
+ operator bool() const;
+ bool operator!=(const WordList &other) const;
+ int Length() const;
+ void Clear();
+ void Set(const char *s);
+ bool InList(const char *s) const;
+ bool InListAbbreviated(const char *s, const char marker) const;
+ const char *WordAt(int n) const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/README b/3rdparty/bgfx/3rdparty/scintilla/qt/README
new file mode 100644
index 00000000000..e6d490fb689
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/README
@@ -0,0 +1,36 @@
+README for building of Scintilla on Qt
+
+There are three different Scintilla libraries that can be produced:
+
+ ScintillaEditBase
+A basic widget callable from C++ which is small and can be used just as is
+or with higher level functionality added.
+
+ ScintillaEdit
+A more complete C++ widget with a method for every Scintilla API and a
+secondary API allowing direct access to document objects.
+
+ ScintillaEditPy
+A Python callable version of ScintillaEdit using the PySide bindings.
+
+ Building a library
+
+ScintillaEditBase can be built without performing any generation steps.
+The ScintillaEditBase/ScintillaEditBase.pro project can be loaded into
+Qt Creator and the "Build All" command performed.
+Alternatively, run "qmake" to build make files and then use the platform
+make to build. Most commonly, use "make" on Unix and "nmake"
+on Windows.
+
+ScintillaEdit requires a generation command be run first. From the
+ScintillaEdit directory:
+
+python WidgetGen.py
+
+After the generation command has run, the ScintillaEdit.h and
+ScintillaEdit.cpp files will have been populated with the Scintilla API
+methods.
+To build, use Qt Creator or qmake and make as for ScintillaEditBase.
+
+ScintillaEditPy is more complex and instructions are found in
+ScintillaEditPy/README.
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp
new file mode 100644
index 00000000000..58f4f6a24d5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp
@@ -0,0 +1,304 @@
+// ScintillaDocument.cpp
+// Wrapper for Scintilla document object so it can be manipulated independently.
+// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+
+#include <stdexcept>
+#include <vector>
+#include <map>
+
+#include "ScintillaDocument.h"
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+class WatcherHelper : public DocWatcher {
+ ScintillaDocument *owner;
+public:
+ explicit WatcherHelper(ScintillaDocument *owner_);
+ virtual ~WatcherHelper();
+
+ void NotifyModifyAttempt(Document *doc, void *userData);
+ void NotifySavePoint(Document *doc, void *userData, bool atSavePoint);
+ void NotifyModified(Document *doc, DocModification mh, void *userData);
+ void NotifyDeleted(Document *doc, void *userData);
+ void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
+ void NotifyLexerChanged(Document *doc, void *userData);
+ void NotifyErrorOccurred(Document *doc, void *userData, int status);
+};
+
+WatcherHelper::WatcherHelper(ScintillaDocument *owner_) : owner(owner_) {
+}
+
+WatcherHelper::~WatcherHelper() {
+}
+
+void WatcherHelper::NotifyModifyAttempt(Document *, void *) {
+ owner->emit_modify_attempt();
+}
+
+void WatcherHelper::NotifySavePoint(Document *, void *, bool atSavePoint) {
+ owner->emit_save_point(atSavePoint);
+}
+
+void WatcherHelper::NotifyModified(Document *, DocModification mh, void *) {
+ int length = mh.length;
+ if (!mh.text)
+ length = 0;
+ QByteArray ba = QByteArray::fromRawData(mh.text, length);
+ owner->emit_modified(mh.position, mh.modificationType, ba, length,
+ mh.linesAdded, mh.line, mh.foldLevelNow, mh.foldLevelPrev);
+}
+
+void WatcherHelper::NotifyDeleted(Document *, void *) {
+}
+
+void WatcherHelper::NotifyStyleNeeded(Document *, void *, int endPos) {
+ owner->emit_style_needed(endPos);
+}
+
+void WatcherHelper::NotifyLexerChanged(Document *, void *) {
+ owner->emit_lexer_changed();
+}
+
+void WatcherHelper::NotifyErrorOccurred(Document *, void *, int status) {
+ owner->emit_error_occurred(status);
+}
+
+ScintillaDocument::ScintillaDocument(QObject *parent, void *pdoc_) :
+ QObject(parent), pdoc(pdoc_), docWatcher(0) {
+ if (!pdoc) {
+ pdoc = new Document();
+ }
+ docWatcher = new WatcherHelper(this);
+ ((Document *)pdoc)->AddRef();
+ ((Document *)pdoc)->AddWatcher(docWatcher, pdoc);
+}
+
+ScintillaDocument::~ScintillaDocument() {
+ Document *doc = static_cast<Document *>(pdoc);
+ if (doc) {
+ doc->RemoveWatcher(docWatcher, doc);
+ doc->Release();
+ }
+ pdoc = NULL;
+ delete docWatcher;
+ docWatcher = NULL;
+}
+
+void *ScintillaDocument::pointer() {
+ return pdoc;
+}
+
+int ScintillaDocument::line_from_position(int pos) {
+ return ((Document *)pdoc)->LineFromPosition(pos);
+}
+
+bool ScintillaDocument::is_cr_lf(int pos) {
+ return ((Document *)pdoc)->IsCrLf(pos);
+}
+
+bool ScintillaDocument::delete_chars(int pos, int len) {
+ return ((Document *)pdoc)->DeleteChars(pos, len);
+}
+
+int ScintillaDocument::undo() {
+ return ((Document *)pdoc)->Undo();
+}
+
+int ScintillaDocument::redo() {
+ return ((Document *)pdoc)->Redo();
+}
+
+bool ScintillaDocument::can_undo() {
+ return ((Document *)pdoc)->CanUndo();
+}
+
+bool ScintillaDocument::can_redo() {
+ return ((Document *)pdoc)->CanRedo();
+}
+
+void ScintillaDocument::delete_undo_history() {
+ ((Document *)pdoc)->DeleteUndoHistory();
+}
+
+bool ScintillaDocument::set_undo_collection(bool collect_undo) {
+ return ((Document *)pdoc)->SetUndoCollection(collect_undo);
+}
+
+bool ScintillaDocument::is_collecting_undo() {
+ return ((Document *)pdoc)->IsCollectingUndo();
+}
+
+void ScintillaDocument::begin_undo_action() {
+ ((Document *)pdoc)->BeginUndoAction();
+}
+
+void ScintillaDocument::end_undo_action() {
+ ((Document *)pdoc)->EndUndoAction();
+}
+
+void ScintillaDocument::set_save_point() {
+ ((Document *)pdoc)->SetSavePoint();
+}
+
+bool ScintillaDocument::is_save_point() {
+ return ((Document *)pdoc)->IsSavePoint();
+}
+
+void ScintillaDocument::set_read_only(bool read_only) {
+ ((Document *)pdoc)->SetReadOnly(read_only);
+}
+
+bool ScintillaDocument::is_read_only() {
+ return ((Document *)pdoc)->IsReadOnly();
+}
+
+void ScintillaDocument::insert_string(int position, QByteArray &str) {
+ ((Document *)pdoc)->InsertString(position, str.data(), str.size());
+}
+
+QByteArray ScintillaDocument::get_char_range(int position, int length) {
+ Document *doc = (Document *)pdoc;
+
+ if (position < 0 || length <= 0 || position + length > doc->Length())
+ return QByteArray();
+
+ QByteArray ba(length, '\0');
+ doc->GetCharRange(ba.data(), position, length);
+ return ba;
+}
+
+char ScintillaDocument::style_at(int position) {
+ return ((Document *)pdoc)->StyleAt(position);
+}
+
+int ScintillaDocument::line_start(int lineno) {
+ return ((Document *)pdoc)->LineStart(lineno);
+}
+
+int ScintillaDocument::line_end(int lineno) {
+ return ((Document *)pdoc)->LineEnd(lineno);
+}
+
+int ScintillaDocument::line_end_position(int pos) {
+ return ((Document *)pdoc)->LineEndPosition(pos);
+}
+
+int ScintillaDocument::length() {
+ return ((Document *)pdoc)->Length();
+}
+
+int ScintillaDocument::lines_total() {
+ return ((Document *)pdoc)->LinesTotal();
+}
+
+void ScintillaDocument::start_styling(int position, char flags) {
+ ((Document *)pdoc)->StartStyling(position, flags);
+}
+
+bool ScintillaDocument::set_style_for(int length, char style) {
+ return ((Document *)pdoc)->SetStyleFor(length, style);
+}
+
+int ScintillaDocument::get_end_styled() {
+ return ((Document *)pdoc)->GetEndStyled();
+}
+
+void ScintillaDocument::ensure_styled_to(int position) {
+ ((Document *)pdoc)->EnsureStyledTo(position);
+}
+
+void ScintillaDocument::set_current_indicator(int indic) {
+ ((Document *)pdoc)->decorations.SetCurrentIndicator(indic);
+}
+
+void ScintillaDocument::decoration_fill_range(int position, int value, int fillLength) {
+ ((Document *)pdoc)->DecorationFillRange(position, value, fillLength);
+}
+
+int ScintillaDocument::decorations_value_at(int indic, int position) {
+ return ((Document *)pdoc)->decorations.ValueAt(indic, position);
+}
+
+int ScintillaDocument::decorations_start(int indic, int position) {
+ return ((Document *)pdoc)->decorations.Start(indic, position);
+}
+
+int ScintillaDocument::decorations_end(int indic, int position) {
+ return ((Document *)pdoc)->decorations.End(indic, position);
+}
+
+int ScintillaDocument::get_code_page() {
+ return ((Document *)pdoc)->CodePage();
+}
+
+void ScintillaDocument::set_code_page(int code_page) {
+ ((Document *)pdoc)->dbcsCodePage = code_page;
+}
+
+int ScintillaDocument::get_eol_mode() {
+ return ((Document *)pdoc)->eolMode;
+}
+
+void ScintillaDocument::set_eol_mode(int eol_mode) {
+ ((Document *)pdoc)->eolMode = eol_mode;
+}
+
+int ScintillaDocument::move_position_outside_char(int pos, int move_dir, bool check_line_end) {
+ return ((Document *)pdoc)->MovePositionOutsideChar(pos, move_dir, check_line_end);
+}
+
+int ScintillaDocument::get_character(int pos) {
+ return ((Document *)pdoc)->GetCharacterAndWidth(pos, NULL);
+}
+
+// Signal emitters
+
+void ScintillaDocument::emit_modify_attempt() {
+ emit modify_attempt();
+}
+
+void ScintillaDocument::emit_save_point(bool atSavePoint) {
+ emit save_point(atSavePoint);
+}
+
+void ScintillaDocument::emit_modified(int position, int modification_type, const QByteArray& text, int length,
+ int linesAdded, int line, int foldLevelNow, int foldLevelPrev) {
+ emit modified(position, modification_type, text, length,
+ linesAdded, line, foldLevelNow, foldLevelPrev);
+}
+
+void ScintillaDocument::emit_style_needed(int pos) {
+ emit style_needed(pos);
+}
+
+void ScintillaDocument::emit_lexer_changed() {
+ emit lexer_changed();
+}
+
+void ScintillaDocument::emit_error_occurred(int status) {
+ emit error_occurred(status);
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.h b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.h
new file mode 100644
index 00000000000..1d571a73c27
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaDocument.h
@@ -0,0 +1,109 @@
+// ScintillaDocument.h
+// Wrapper for Scintilla document object so it can be manipulated independently.
+// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+
+#ifndef SCINTILLADOCUMENT_H
+#define SCINTILLADOCUMENT_H
+
+#include <QObject>
+
+class WatcherHelper;
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+#ifndef EXPORT_IMPORT_API
+#ifdef WIN32
+#ifdef MAKING_LIBRARY
+#define EXPORT_IMPORT_API __declspec(dllexport)
+#else
+// Defining dllimport upsets moc
+#define EXPORT_IMPORT_API __declspec(dllimport)
+//#define EXPORT_IMPORT_API
+#endif
+#else
+#define EXPORT_IMPORT_API
+#endif
+#endif
+
+class EXPORT_IMPORT_API ScintillaDocument : public QObject
+{
+ Q_OBJECT
+
+ void *pdoc;
+ WatcherHelper *docWatcher;
+
+public:
+ explicit ScintillaDocument(QObject *parent = 0, void *pdoc_=0);
+ virtual ~ScintillaDocument();
+ void *pointer();
+
+ int line_from_position(int pos);
+ bool is_cr_lf(int pos);
+ bool delete_chars(int pos, int len);
+ int undo();
+ int redo();
+ bool can_undo();
+ bool can_redo();
+ void delete_undo_history();
+ bool set_undo_collection(bool collect_undo);
+ bool is_collecting_undo();
+ void begin_undo_action();
+ void end_undo_action();
+ void set_save_point();
+ bool is_save_point();
+ void set_read_only(bool read_only);
+ bool is_read_only();
+ void insert_string(int position, QByteArray &str);
+ QByteArray get_char_range(int position, int length);
+ char style_at(int position);
+ int line_start(int lineno);
+ int line_end(int lineno);
+ int line_end_position(int pos);
+ int length();
+ int lines_total();
+ void start_styling(int position, char flags);
+ bool set_style_for(int length, char style);
+ int get_end_styled();
+ void ensure_styled_to(int position);
+ void set_current_indicator(int indic);
+ void decoration_fill_range(int position, int value, int fillLength);
+ int decorations_value_at(int indic, int position);
+ int decorations_start(int indic, int position);
+ int decorations_end(int indic, int position);
+ int get_code_page();
+ void set_code_page(int code_page);
+ int get_eol_mode();
+ void set_eol_mode(int eol_mode);
+ int move_position_outside_char(int pos, int move_dir, bool check_line_end);
+
+ int get_character(int pos); // Calls GetCharacterAndWidth(pos, NULL)
+
+private:
+ void emit_modify_attempt();
+ void emit_save_point(bool atSavePoint);
+ void emit_modified(int position, int modification_type, const QByteArray& text, int length,
+ int linesAdded, int line, int foldLevelNow, int foldLevelPrev);
+ void emit_style_needed(int pos);
+ void emit_lexer_changed();
+ void emit_error_occurred(int status);
+
+signals:
+ void modify_attempt();
+ void save_point(bool atSavePoint);
+ void modified(int position, int modification_type, const QByteArray& text, int length,
+ int linesAdded, int line, int foldLevelNow, int foldLevelPrev);
+ void style_needed(int pos);
+ void lexer_changed();
+ void error_occurred(int status);
+
+ friend class ::WatcherHelper;
+
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif // SCINTILLADOCUMENT_H
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp.template b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp.template
new file mode 100644
index 00000000000..3aca02600da
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.cpp.template
@@ -0,0 +1,88 @@
+// ScintillaEdit.cpp
+// Extended version of ScintillaEditBase with a method for each API
+// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+
+#include "ScintillaEdit.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+ScintillaEdit::ScintillaEdit(QWidget *parent) : ScintillaEditBase(parent) {
+}
+
+ScintillaEdit::~ScintillaEdit() {
+}
+
+QByteArray ScintillaEdit::TextReturner(int message, uptr_t wParam) const {
+ int length = send(message, wParam, 0);
+ QByteArray ba(length, '\0');
+ send(message, wParam, (sptr_t)ba.data());
+ // Remove extra NULs
+ if (ba.size() > 0 && ba.at(ba.size()-1) == 0)
+ ba.chop(1);
+ return ba;
+}
+
+QPair<int, int>ScintillaEdit::find_text(int flags, const char *text, int cpMin, int cpMax) {
+ struct TextToFind ft = {{0, 0}, 0, {0, 0}};
+ ft.chrg.cpMin = cpMin;
+ ft.chrg.cpMax = cpMax;
+ ft.chrgText.cpMin = cpMin;
+ ft.chrgText.cpMax = cpMax;
+ ft.lpstrText = const_cast<char *>(text);
+
+ int start = send(SCI_FINDTEXT, flags, (uptr_t) (&ft));
+
+ return QPair<int,int>(start, ft.chrgText.cpMax);
+}
+
+QByteArray ScintillaEdit::get_text_range(int start, int end) {
+ if (start > end)
+ start = end;
+
+ int length = end-start;
+ QByteArray ba(length+1, '\0');
+ struct TextRange tr = {{start, end}, ba.data()};
+
+ send(SCI_GETTEXTRANGE, 0, (sptr_t)&tr);
+ ba.chop(1); // Remove extra NUL
+
+ return ba;
+}
+
+ScintillaDocument *ScintillaEdit::get_doc() {
+ return new ScintillaDocument(0, (void *)send(SCI_GETDOCPOINTER, 0, 0));
+}
+
+void ScintillaEdit::set_doc(ScintillaDocument *pdoc_) {
+ send(SCI_SETDOCPOINTER, 0, (sptr_t)(pdoc_->pointer()));
+}
+
+long ScintillaEdit::format_range(bool draw, QPaintDevice* target, QPaintDevice* measure,
+ const QRect& print_rect, const QRect& page_rect,
+ long range_start, long range_end)
+{
+ Sci_RangeToFormat to_format;
+
+ to_format.hdc = target;
+ to_format.hdcTarget = measure;
+
+ to_format.rc.left = print_rect.left();
+ to_format.rc.top = print_rect.top();
+ to_format.rc.right = print_rect.right();
+ to_format.rc.bottom = print_rect.bottom();
+
+ to_format.rcPage.left = page_rect.left();
+ to_format.rcPage.top = page_rect.top();
+ to_format.rcPage.right = page_rect.right();
+ to_format.rcPage.bottom = page_rect.bottom();
+
+ to_format.chrg.cpMin = range_start;
+ to_format.chrg.cpMax = range_end;
+
+ return send(SCI_FORMATRANGE, draw, reinterpret_cast<sptr_t>(&to_format));
+}
+
+/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h.template b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h.template
new file mode 100644
index 00000000000..052d87c74d7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.h.template
@@ -0,0 +1,74 @@
+// ScintillaEdit.h
+// Extended version of ScintillaEditBase with a method for each API
+// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+
+#ifndef SCINTILLAEDIT_H
+#define SCINTILLAEDIT_H
+
+#include <QPair>
+
+#include "ScintillaEditBase.h"
+#include "ScintillaDocument.h"
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+#ifndef EXPORT_IMPORT_API
+#ifdef WIN32
+#ifdef MAKING_LIBRARY
+#define EXPORT_IMPORT_API __declspec(dllexport)
+#else
+// Defining dllimport upsets moc
+#define EXPORT_IMPORT_API __declspec(dllimport)
+//#define EXPORT_IMPORT_API
+#endif
+#else
+#define EXPORT_IMPORT_API
+#endif
+#endif
+
+class EXPORT_IMPORT_API ScintillaEdit : public ScintillaEditBase {
+ Q_OBJECT
+
+public:
+ ScintillaEdit(QWidget *parent = 0);
+ virtual ~ScintillaEdit();
+
+ QByteArray TextReturner(int message, uptr_t wParam) const;
+
+ QPair<int, int>find_text(int flags, const char *text, int cpMin, int cpMax);
+ QByteArray get_text_range(int start, int end);
+ ScintillaDocument *get_doc();
+ void set_doc(ScintillaDocument *pdoc_);
+
+ // Same as previous two methods but with Qt style names
+ QPair<int, int>findText(int flags, const char *text, int cpMin, int cpMax) {
+ return find_text(flags, text, cpMin, cpMax);
+ }
+
+ QByteArray textRange(int start, int end) {
+ return get_text_range(start, end);
+ }
+
+ // Exposing the FORMATRANGE api with both underscore & qt style names
+ long format_range(bool draw, QPaintDevice* target, QPaintDevice* measure,
+ const QRect& print_rect, const QRect& page_rect,
+ long range_start, long range_end);
+ long formatRange(bool draw, QPaintDevice* target, QPaintDevice* measure,
+ const QRect& print_rect, const QRect& page_rect,
+ long range_start, long range_end) {
+ return format_range(draw, target, measure, print_rect, page_rect,
+ range_start, range_end);
+ }
+
+/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
+
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif /* SCINTILLAEDIT_H */
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.pro b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.pro
new file mode 100644
index 00000000000..1fe61cffb3d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/ScintillaEdit.pro
@@ -0,0 +1,79 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2011-05-05T12:41:23
+#
+#-------------------------------------------------
+
+QT += core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = ScintillaEdit
+TEMPLATE = lib
+CONFIG += lib_bundle
+
+VERSION = 3.5.6
+
+SOURCES += \
+ ScintillaEdit.cpp \
+ ScintillaDocument.cpp \
+ ../ScintillaEditBase/PlatQt.cpp \
+ ../ScintillaEditBase/ScintillaQt.cpp \
+ ../ScintillaEditBase/ScintillaEditBase.cpp \
+ ../../src/XPM.cxx \
+ ../../src/ViewStyle.cxx \
+ ../../src/UniConversion.cxx \
+ ../../src/Style.cxx \
+ ../../src/Selection.cxx \
+ ../../src/ScintillaBase.cxx \
+ ../../src/RunStyles.cxx \
+ ../../src/RESearch.cxx \
+ ../../src/PositionCache.cxx \
+ ../../src/PerLine.cxx \
+ ../../src/MarginView.cxx \
+ ../../src/LineMarker.cxx \
+ ../../src/KeyMap.cxx \
+ ../../src/Indicator.cxx \
+ ../../src/ExternalLexer.cxx \
+ ../../src/EditView.cxx \
+ ../../src/Editor.cxx \
+ ../../src/EditModel.cxx \
+ ../../src/Document.cxx \
+ ../../src/Decoration.cxx \
+ ../../src/ContractionState.cxx \
+ ../../src/CharClassify.cxx \
+ ../../src/CellBuffer.cxx \
+ ../../src/Catalogue.cxx \
+ ../../src/CaseFolder.cxx \
+ ../../src/CaseConvert.cxx \
+ ../../src/CallTip.cxx \
+ ../../src/AutoComplete.cxx \
+ ../../lexlib/WordList.cxx \
+ ../../lexlib/StyleContext.cxx \
+ ../../lexlib/PropSetSimple.cxx \
+ ../../lexlib/LexerSimple.cxx \
+ ../../lexlib/LexerNoExceptions.cxx \
+ ../../lexlib/LexerModule.cxx \
+ ../../lexlib/LexerBase.cxx \
+ ../../lexlib/CharacterSet.cxx \
+ ../../lexlib/CharacterCategory.cxx \
+ ../../lexlib/Accessor.cxx \
+ ../../lexers/*.cxx
+
+HEADERS += \
+ ScintillaEdit.h \
+ ScintillaDocument.h \
+ ../ScintillaEditBase/ScintillaEditBase.h \
+ ../ScintillaEditBase/ScintillaQt.h
+
+OTHER_FILES +=
+
+INCLUDEPATH += ../ScintillaEditBase ../../include ../../src ../../lexlib
+
+DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1
+
+DESTDIR = ../../bin
+DLLDESTDIR = ../../bin
+
+macx {
+ QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/WidgetGen.py b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/WidgetGen.py
new file mode 100644
index 00000000000..92ebfd68799
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEdit/WidgetGen.py
@@ -0,0 +1,261 @@
+#!/usr/bin/env python
+# WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files
+# Check that API includes all gtkscintilla2 functions
+
+import sys
+import os
+import getopt
+
+scintillaDirectory = "../.."
+scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
+sys.path.append(scintillaScriptsDirectory)
+import Face
+from FileGenerator import GenerateFile
+
+def underscoreName(s):
+ # Name conversion fixes to match gtkscintilla2
+ irregular = ['WS', 'EOL', 'AutoC', 'KeyWords', 'BackSpace', 'UnIndents', 'RE', 'RGBA']
+ for word in irregular:
+ replacement = word[0] + word[1:].lower()
+ s = s.replace(word, replacement)
+
+ out = ""
+ for c in s:
+ if c.isupper():
+ if out:
+ out += "_"
+ out += c.lower()
+ else:
+ out += c
+ return out
+
+def normalisedName(s, options, role=None):
+ if options["qtStyle"]:
+ if role == "get":
+ s = s.replace("Get", "")
+ return s[0].lower() + s[1:]
+ else:
+ return underscoreName(s)
+
+typeAliases = {
+ "position": "int",
+ "colour": "int",
+ "keymod": "int",
+ "string": "const char *",
+ "stringresult": "const char *",
+ "cells": "const char *",
+}
+
+def cppAlias(s):
+ if s in typeAliases:
+ return typeAliases[s]
+ else:
+ return s
+
+understoodTypes = ["", "void", "int", "bool", "position",
+ "colour", "keymod", "string", "stringresult", "cells"]
+
+def checkTypes(name, v):
+ understandAllTypes = True
+ if v["ReturnType"] not in understoodTypes:
+ #~ print("Do not understand", v["ReturnType"], "for", name)
+ understandAllTypes = False
+ if v["Param1Type"] not in understoodTypes:
+ #~ print("Do not understand", v["Param1Type"], "for", name)
+ understandAllTypes = False
+ if v["Param2Type"] not in understoodTypes:
+ #~ print("Do not understand", v["Param2Type"], "for", name)
+ understandAllTypes = False
+ return understandAllTypes
+
+def arguments(v, stringResult, options):
+ ret = ""
+ p1Type = cppAlias(v["Param1Type"])
+ if p1Type == "int":
+ p1Type = "sptr_t"
+ if p1Type:
+ ret = ret + p1Type + " " + normalisedName(v["Param1Name"], options)
+ p2Type = cppAlias(v["Param2Type"])
+ if p2Type == "int":
+ p2Type = "sptr_t"
+ if p2Type and not stringResult:
+ if p1Type:
+ ret = ret + ", "
+ ret = ret + p2Type + " " + normalisedName(v["Param2Name"], options)
+ return ret
+
+def printPyFile(f, options):
+ out = []
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ feat = v["FeatureType"]
+ if feat in ["val"]:
+ out.append(name + "=" + v["Value"])
+ if feat in ["evt"]:
+ out.append("SCN_" + name.upper() + "=" + v["Value"])
+ if feat in ["fun"]:
+ out.append("SCI_" + name.upper() + "=" + v["Value"])
+ return out
+
+def printHFile(f, options):
+ out = []
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ feat = v["FeatureType"]
+ if feat in ["fun", "get", "set"]:
+ if checkTypes(name, v):
+ constDeclarator = " const" if feat == "get" else ""
+ returnType = cppAlias(v["ReturnType"])
+ if returnType == "int":
+ returnType = "sptr_t"
+ stringResult = v["Param2Type"] == "stringresult"
+ if stringResult:
+ returnType = "QByteArray"
+ out.append("\t" + returnType + " " + normalisedName(name, options, feat) + "(" +
+ arguments(v, stringResult, options)+
+ ")" + constDeclarator + ";")
+ return out
+
+def methodNames(f, options):
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ feat = v["FeatureType"]
+ if feat in ["fun", "get", "set"]:
+ if checkTypes(name, v):
+ yield normalisedName(name, options)
+
+def printCPPFile(f, options):
+ out = []
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ feat = v["FeatureType"]
+ if feat in ["fun", "get", "set"]:
+ if checkTypes(name, v):
+ constDeclarator = " const" if feat == "get" else ""
+ featureDefineName = "SCI_" + name.upper()
+ returnType = cppAlias(v["ReturnType"])
+ if returnType == "int":
+ returnType = "sptr_t"
+ stringResult = v["Param2Type"] == "stringresult"
+ if stringResult:
+ returnType = "QByteArray"
+ returnStatement = ""
+ if returnType != "void":
+ returnStatement = "return "
+ out.append(returnType + " ScintillaEdit::" + normalisedName(name, options, feat) + "(" +
+ arguments(v, stringResult, options) +
+ ")" + constDeclarator + " {")
+ returns = ""
+ if stringResult:
+ returns += " " + returnStatement + "TextReturner(" + featureDefineName + ", "
+ if "*" in cppAlias(v["Param1Type"]):
+ returns += "(sptr_t)"
+ if v["Param1Name"]:
+ returns += normalisedName(v["Param1Name"], options)
+ else:
+ returns += "0"
+ returns += ");"
+ else:
+ returns += " " + returnStatement + "send(" + featureDefineName + ", "
+ if "*" in cppAlias(v["Param1Type"]):
+ returns += "(sptr_t)"
+ if v["Param1Name"]:
+ returns += normalisedName(v["Param1Name"], options)
+ else:
+ returns += "0"
+ returns += ", "
+ if "*" in cppAlias(v["Param2Type"]):
+ returns += "(sptr_t)"
+ if v["Param2Name"]:
+ returns += normalisedName(v["Param2Name"], options)
+ else:
+ returns += "0"
+ returns += ");"
+ out.append(returns)
+ out.append("}")
+ out.append("")
+ return out
+
+def gtkNames():
+ # The full path on my machine: should be altered for anyone else
+ p = "C:/Users/Neil/Downloads/wingide-source-4.0.1-1/wingide-source-4.0.1-1/external/gtkscintilla2/gtkscintilla.c"
+ with open(p) as f:
+ for l in f.readlines():
+ if "gtk_scintilla_" in l:
+ name = l.split()[1][14:]
+ if '(' in name:
+ name = name.split('(')[0]
+ yield name
+
+def usage():
+ print("WidgetGen.py [-c|--clean][-h|--help][-u|--underscore-names]")
+ print("")
+ print("Generate full APIs for ScintillaEdit class and ScintillaConstants.py.")
+ print("")
+ print("options:")
+ print("")
+ print("-c --clean remove all generated code from files")
+ print("-h --help display this text")
+ print("-u --underscore-names use method_names consistent with GTK+ standards")
+
+def readInterface(cleanGenerated):
+ f = Face.Face()
+ if not cleanGenerated:
+ f.ReadFromFile("../../include/Scintilla.iface")
+ return f
+
+def main(argv):
+ # Using local path for gtkscintilla2 so don't default to checking
+ checkGTK = False
+ cleanGenerated = False
+ qtStyleInterface = True
+ # The --gtk-check option checks for full coverage of the gtkscintilla2 API but
+ # depends on a particular directory so is not mentioned in --help.
+ opts, args = getopt.getopt(argv, "hcgu", ["help", "clean", "gtk-check", "underscore-names"])
+ for opt, arg in opts:
+ if opt in ("-h", "--help"):
+ usage()
+ sys.exit()
+ elif opt in ("-c", "--clean"):
+ cleanGenerated = True
+ elif opt in ("-g", "--gtk-check"):
+ checkGTK = True
+ elif opt in ("-u", "--underscore-names"):
+ qtStyleInterface = False
+
+ options = {"qtStyle": qtStyleInterface}
+ f = readInterface(cleanGenerated)
+ try:
+ GenerateFile("ScintillaEdit.cpp.template", "ScintillaEdit.cpp",
+ "/* ", True, printCPPFile(f, options))
+ GenerateFile("ScintillaEdit.h.template", "ScintillaEdit.h",
+ "/* ", True, printHFile(f, options))
+ GenerateFile("../ScintillaEditPy/ScintillaConstants.py.template",
+ "../ScintillaEditPy/ScintillaConstants.py",
+ "# ", True, printPyFile(f, options))
+ if checkGTK:
+ names = set(methodNames(f))
+ #~ print("\n".join(names))
+ namesGtk = set(gtkNames())
+ for name in namesGtk:
+ if name not in names:
+ print(name, "not found in Qt version")
+ for name in names:
+ if name not in namesGtk:
+ print(name, "not found in GTK+ version")
+ except:
+ raise
+
+ if cleanGenerated:
+ for file in ["ScintillaEdit.cpp", "ScintillaEdit.h", "../ScintillaEditPy/ScintillaConstants.py"]:
+ try:
+ os.remove(file)
+ except OSError:
+ pass
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/Notes.txt b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/Notes.txt
new file mode 100644
index 00000000000..4abc9bb78a1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/Notes.txt
@@ -0,0 +1,18 @@
+
+Issues with Scintilla for Qt
+
+Qt reports character descenders are 1 pixel shorter than they really are.
+There is a tweak in the code to add a pixel in. This may have to be reviewed for Qt 5.
+There's a comment in the Qt code for Windows:
+ // ### we subtract 1 to even out the historical +1 in QFontMetrics's
+ // ### height=asc+desc+1 equation. Fix in Qt5.
+
+The clocks used aren't great. QTime is a time since midnight clock so wraps around and
+is only accurate to, at best, milliseconds.
+
+On OS X drawing text into a pixmap moves it around 1 pixel to the right compared to drawing
+it directly onto a window. Buffered drawing turned off by default to avoid this.
+Reported as QTBUG-19483.
+
+Only one QPainter can be active on any widget at a time. Scintilla only draws into one
+widget but reenters for measurement.
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp
new file mode 100644
index 00000000000..35e4aee78b3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp
@@ -0,0 +1,1335 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// Scintilla platform layer for Qt
+
+#include "PlatQt.h"
+#include "Scintilla.h"
+#include "FontQuality.h"
+
+#include <QApplication>
+#include <QFont>
+#include <QColor>
+#include <QRect>
+#include <QPaintDevice>
+#include <QPaintEngine>
+#include <QWidget>
+#include <QPixmap>
+#include <QPainter>
+#include <QMenu>
+#include <QAction>
+#include <QTime>
+#include <QMessageBox>
+#include <QTextCodec>
+#include <QListWidget>
+#include <QVarLengthArray>
+#include <QScrollBar>
+#include <QDesktopWidget>
+#include <QTextLayout>
+#include <QTextLine>
+#include <QLibrary>
+#include <QElapsedTimer>
+#include <cstdio>
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+//----------------------------------------------------------------------
+
+// Convert from a Scintilla characterSet value to a Qt codec name.
+const char *CharacterSetID(int characterSet)
+{
+ switch (characterSet) {
+ //case SC_CHARSET_ANSI:
+ // return "";
+ case SC_CHARSET_DEFAULT:
+ return "ISO 8859-1";
+ case SC_CHARSET_BALTIC:
+ return "ISO 8859-13";
+ case SC_CHARSET_CHINESEBIG5:
+ return "Big5";
+ case SC_CHARSET_EASTEUROPE:
+ return "ISO 8859-2";
+ case SC_CHARSET_GB2312:
+ return "GB18030-0";
+ case SC_CHARSET_GREEK:
+ return "ISO 8859-7";
+ case SC_CHARSET_HANGUL:
+ return "CP949";
+ case SC_CHARSET_MAC:
+ return "Apple Roman";
+ //case SC_CHARSET_OEM:
+ // return "ASCII";
+ case SC_CHARSET_RUSSIAN:
+ return "KOI8-R";
+ case SC_CHARSET_CYRILLIC:
+ return "Windows-1251";
+ case SC_CHARSET_SHIFTJIS:
+ return "Shift-JIS";
+ //case SC_CHARSET_SYMBOL:
+ // return "";
+ case SC_CHARSET_TURKISH:
+ return "ISO 8859-9";
+ //case SC_CHARSET_JOHAB:
+ // return "CP1361";
+ case SC_CHARSET_HEBREW:
+ return "ISO 8859-8";
+ case SC_CHARSET_ARABIC:
+ return "ISO 8859-6";
+ case SC_CHARSET_VIETNAMESE:
+ return "Windows-1258";
+ case SC_CHARSET_THAI:
+ return "TIS-620";
+ case SC_CHARSET_8859_15:
+ return "ISO 8859-15";
+ default:
+ return "ISO 8859-1";
+ }
+}
+
+class FontAndCharacterSet {
+public:
+ int characterSet;
+ QFont *pfont;
+ FontAndCharacterSet(int characterSet_, QFont *pfont):
+ characterSet(characterSet_), pfont(pfont) {
+ }
+ ~FontAndCharacterSet() {
+ delete pfont;
+ pfont = 0;
+ }
+};
+
+static int FontCharacterSet(Font &f)
+{
+ return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->characterSet;
+}
+
+static QFont *FontPointer(Font &f)
+{
+ return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->pfont;
+}
+
+Font::Font() : fid(0) {}
+
+Font::~Font()
+{
+ delete reinterpret_cast<FontAndCharacterSet *>(fid);
+ fid = 0;
+}
+
+static QFont::StyleStrategy ChooseStrategy(int eff)
+{
+ switch (eff) {
+ case SC_EFF_QUALITY_DEFAULT: return QFont::PreferDefault;
+ case SC_EFF_QUALITY_NON_ANTIALIASED: return QFont::NoAntialias;
+ case SC_EFF_QUALITY_ANTIALIASED: return QFont::PreferAntialias;
+ case SC_EFF_QUALITY_LCD_OPTIMIZED: return QFont::PreferAntialias;
+ default: return QFont::PreferDefault;
+ }
+}
+
+void Font::Create(const FontParameters &fp)
+{
+ Release();
+
+ QFont *font = new QFont;
+ font->setStyleStrategy(ChooseStrategy(fp.extraFontFlag));
+ font->setFamily(QString::fromUtf8(fp.faceName));
+ font->setPointSize(fp.size);
+ font->setBold(fp.weight > 500);
+ font->setItalic(fp.italic);
+
+ fid = new FontAndCharacterSet(fp.characterSet, font);
+}
+
+void Font::Release()
+{
+ if (fid)
+ delete reinterpret_cast<FontAndCharacterSet *>(fid);
+
+ fid = 0;
+}
+
+
+SurfaceImpl::SurfaceImpl()
+: device(0), painter(0), deviceOwned(false), painterOwned(false), x(0), y(0),
+ unicodeMode(false), codePage(0), codecName(0), codec(0)
+{}
+
+SurfaceImpl::~SurfaceImpl()
+{
+ Release();
+}
+
+void SurfaceImpl::Init(WindowID wid)
+{
+ Release();
+ device = static_cast<QWidget *>(wid);
+}
+
+void SurfaceImpl::Init(SurfaceID sid, WindowID /*wid*/)
+{
+ Release();
+ device = static_cast<QPaintDevice *>(sid);
+}
+
+void SurfaceImpl::InitPixMap(int width,
+ int height,
+ Surface *surface,
+ WindowID /*wid*/)
+{
+ Release();
+ if (width < 1) width = 1;
+ if (height < 1) height = 1;
+ deviceOwned = true;
+ device = new QPixmap(width, height);
+ SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface);
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
+}
+
+void SurfaceImpl::Release()
+{
+ if (painterOwned && painter) {
+ delete painter;
+ }
+
+ if (deviceOwned && device) {
+ delete device;
+ }
+
+ device = 0;
+ painter = 0;
+ deviceOwned = false;
+ painterOwned = false;
+}
+
+bool SurfaceImpl::Initialised()
+{
+ return device != 0;
+}
+
+void SurfaceImpl::PenColour(ColourDesired fore)
+{
+ QPen penOutline(QColorFromCA(fore));
+ penOutline.setCapStyle(Qt::FlatCap);
+ GetPainter()->setPen(penOutline);
+}
+
+void SurfaceImpl::BrushColour(ColourDesired back)
+{
+ GetPainter()->setBrush(QBrush(QColorFromCA(back)));
+}
+
+void SurfaceImpl::SetCodec(Font &font)
+{
+ if (font.GetID()) {
+ const char *csid = "UTF-8";
+ if (!unicodeMode)
+ csid = CharacterSetID(FontCharacterSet(font));
+ if (csid != codecName) {
+ codecName = csid;
+ codec = QTextCodec::codecForName(csid);
+ }
+ }
+}
+
+void SurfaceImpl::SetFont(Font &font)
+{
+ if (font.GetID()) {
+ GetPainter()->setFont(*FontPointer(font));
+ SetCodec(font);
+ }
+}
+
+int SurfaceImpl::LogPixelsY()
+{
+ return device->logicalDpiY();
+}
+
+int SurfaceImpl::DeviceHeightFont(int points)
+{
+ return points;
+}
+
+void SurfaceImpl::MoveTo(int x_, int y_)
+{
+ x = x_;
+ y = y_;
+}
+
+void SurfaceImpl::LineTo(int x_, int y_)
+{
+ QLineF line(x, y, x_, y_);
+ GetPainter()->drawLine(line);
+ x = x_;
+ y = y_;
+}
+
+void SurfaceImpl::Polygon(Point *pts,
+ int npts,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ PenColour(fore);
+ BrushColour(back);
+
+ QPoint *qpts = new QPoint[npts];
+ for (int i = 0; i < npts; i++) {
+ qpts[i] = QPoint(pts[i].x, pts[i].y);
+ }
+
+ GetPainter()->drawPolygon(qpts, npts);
+ delete [] qpts;
+}
+
+void SurfaceImpl::RectangleDraw(PRectangle rc,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ PenColour(fore);
+ BrushColour(back);
+ QRectF rect(rc.left, rc.top, rc.Width() - 1, rc.Height() - 1);
+ GetPainter()->drawRect(rect);
+}
+
+void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back)
+{
+ GetPainter()->fillRect(QRectFFromPRect(rc), QColorFromCA(back));
+}
+
+void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern)
+{
+ // Tile pattern over rectangle
+ SurfaceImpl *surface = static_cast<SurfaceImpl *>(&surfacePattern);
+ // Currently assumes 8x8 pattern
+ int widthPat = 8;
+ int heightPat = 8;
+ for (int xTile = rc.left; xTile < rc.right; xTile += widthPat) {
+ int widthx = (xTile + widthPat > rc.right) ? rc.right - xTile : widthPat;
+ for (int yTile = rc.top; yTile < rc.bottom; yTile += heightPat) {
+ int heighty = (yTile + heightPat > rc.bottom) ? rc.bottom - yTile : heightPat;
+ QRect source(0, 0, widthx, heighty);
+ QRect target(xTile, yTile, widthx, heighty);
+ QPixmap *pixmap = static_cast<QPixmap *>(surface->GetPaintDevice());
+ GetPainter()->drawPixmap(target, *pixmap, source);
+ }
+ }
+}
+
+void SurfaceImpl::RoundedRectangle(PRectangle rc,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ PenColour(fore);
+ BrushColour(back);
+ GetPainter()->drawRoundRect(QRectFFromPRect(rc));
+}
+
+void SurfaceImpl::AlphaRectangle(PRectangle rc,
+ int cornerSize,
+ ColourDesired fill,
+ int alphaFill,
+ ColourDesired outline,
+ int alphaOutline,
+ int /*flags*/)
+{
+ QColor qOutline = QColorFromCA(outline);
+ qOutline.setAlpha(alphaOutline);
+ GetPainter()->setPen(QPen(qOutline));
+
+ QColor qFill = QColorFromCA(fill);
+ qFill.setAlpha(alphaFill);
+ GetPainter()->setBrush(QBrush(qFill));
+
+ // A radius of 1 shows no curve so add 1
+ qreal radius = cornerSize+1;
+ QRectF rect(rc.left, rc.top, rc.Width() - 1, rc.Height() - 1);
+ GetPainter()->drawRoundedRect(rect, radius, radius);
+}
+
+static std::vector<unsigned char> ImageByteSwapped(int width, int height, const unsigned char *pixelsImage)
+{
+ // Input is RGBA, but Format_ARGB32 is BGRA, so swap the red bytes and blue bytes
+ size_t bytes = width * height * 4;
+ std::vector<unsigned char> imageBytes(pixelsImage, pixelsImage+bytes);
+ for (size_t i=0; i<bytes; i+=4)
+ std::swap(imageBytes[i], imageBytes[i+2]);
+ return imageBytes;
+}
+
+void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage)
+{
+ std::vector<unsigned char> imageBytes = ImageByteSwapped(width, height, pixelsImage);
+ QImage image(&imageBytes[0], width, height, QImage::Format_ARGB32);
+ QPoint pt(rc.left, rc.top);
+ GetPainter()->drawImage(pt, image);
+}
+
+void SurfaceImpl::Ellipse(PRectangle rc,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ PenColour(fore);
+ BrushColour(back);
+ GetPainter()->drawEllipse(QRectFFromPRect(rc));
+}
+
+void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource)
+{
+ SurfaceImpl *source = static_cast<SurfaceImpl *>(&surfaceSource);
+ QPixmap *pixmap = static_cast<QPixmap *>(source->GetPaintDevice());
+
+ GetPainter()->drawPixmap(rc.left, rc.top, *pixmap, from.x, from.y, -1, -1);
+}
+
+void SurfaceImpl::DrawTextNoClip(PRectangle rc,
+ Font &font,
+ XYPOSITION ybase,
+ const char *s,
+ int len,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ SetFont(font);
+ PenColour(fore);
+
+ GetPainter()->setBackground(QColorFromCA(back));
+ GetPainter()->setBackgroundMode(Qt::OpaqueMode);
+ QString su = codec->toUnicode(s, len);
+ GetPainter()->drawText(QPointF(rc.left, ybase), su);
+}
+
+void SurfaceImpl::DrawTextClipped(PRectangle rc,
+ Font &font,
+ XYPOSITION ybase,
+ const char *s,
+ int len,
+ ColourDesired fore,
+ ColourDesired back)
+{
+ SetClip(rc);
+ DrawTextNoClip(rc, font, ybase, s, len, fore, back);
+ GetPainter()->setClipping(false);
+}
+
+void SurfaceImpl::DrawTextTransparent(PRectangle rc,
+ Font &font,
+ XYPOSITION ybase,
+ const char *s,
+ int len,
+ ColourDesired fore)
+{
+ SetFont(font);
+ PenColour(fore);
+
+ GetPainter()->setBackgroundMode(Qt::TransparentMode);
+ QString su = codec->toUnicode(s, len);
+ GetPainter()->drawText(QPointF(rc.left, ybase), su);
+}
+
+void SurfaceImpl::SetClip(PRectangle rc)
+{
+ GetPainter()->setClipRect(QRectFFromPRect(rc));
+}
+
+static size_t utf8LengthFromLead(unsigned char uch)
+{
+ if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) {
+ return 4;
+ } else if (uch >= (0x80 + 0x40 + 0x20)) {
+ return 3;
+ } else if (uch >= (0x80)) {
+ return 2;
+ } else {
+ return 1;
+ }
+}
+
+void SurfaceImpl::MeasureWidths(Font &font,
+ const char *s,
+ int len,
+ XYPOSITION *positions)
+{
+ if (!font.GetID())
+ return;
+ SetCodec(font);
+ QString su = codec->toUnicode(s, len);
+ QTextLayout tlay(su, *FontPointer(font), GetPaintDevice());
+ tlay.beginLayout();
+ QTextLine tl = tlay.createLine();
+ tlay.endLayout();
+ if (unicodeMode) {
+ int fit = su.size();
+ int ui=0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ int i=0;
+ while (ui<fit) {
+ size_t lenChar = utf8LengthFromLead(us[i]);
+ int codeUnits = (lenChar < 4) ? 1 : 2;
+ qreal xPosition = tl.cursorToX(ui+codeUnits);
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = xPosition;
+ }
+ ui += codeUnits;
+ }
+ XYPOSITION lastPos = 0;
+ if (i > 0)
+ lastPos = positions[i-1];
+ while (i<len) {
+ positions[i++] = lastPos;
+ }
+ } else if (codePage) {
+ // DBCS
+ int ui = 0;
+ for (int i=0; i<len;) {
+ size_t lenChar = Platform::IsDBCSLeadByte(codePage, s[i]) ? 2 : 1;
+ qreal xPosition = tl.cursorToX(ui+1);
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = xPosition;
+ }
+ ui++;
+ }
+ } else {
+ // Single byte encoding
+ for (int i=0; i<len; i++) {
+ positions[i] = tl.cursorToX(i+1);
+ }
+ }
+}
+
+XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ SetCodec(font);
+ QString string = codec->toUnicode(s, len);
+ return metrics.width(string);
+}
+
+XYPOSITION SurfaceImpl::WidthChar(Font &font, char ch)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ return metrics.width(ch);
+}
+
+XYPOSITION SurfaceImpl::Ascent(Font &font)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ return metrics.ascent();
+}
+
+XYPOSITION SurfaceImpl::Descent(Font &font)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ // Qt returns 1 less than true descent
+ // See: QFontEngineWin::descent which says:
+ // ### we subtract 1 to even out the historical +1 in QFontMetrics's
+ // ### height=asc+desc+1 equation. Fix in Qt5.
+ return metrics.descent() + 1;
+}
+
+XYPOSITION SurfaceImpl::InternalLeading(Font & /* font */)
+{
+ return 0;
+}
+
+XYPOSITION SurfaceImpl::ExternalLeading(Font &font)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ return metrics.leading();
+}
+
+XYPOSITION SurfaceImpl::Height(Font &font)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ return metrics.height();
+}
+
+XYPOSITION SurfaceImpl::AverageCharWidth(Font &font)
+{
+ QFontMetricsF metrics(*FontPointer(font), device);
+ return metrics.averageCharWidth();
+}
+
+void SurfaceImpl::FlushCachedState()
+{
+ if (device->paintingActive()) {
+ GetPainter()->setPen(QPen());
+ GetPainter()->setBrush(QBrush());
+ }
+}
+
+void SurfaceImpl::SetUnicodeMode(bool unicodeMode_)
+{
+ unicodeMode=unicodeMode_;
+}
+
+void SurfaceImpl::SetDBCSMode(int codePage_)
+{
+ codePage = codePage_;
+}
+
+QPaintDevice *SurfaceImpl::GetPaintDevice()
+{
+ return device;
+}
+
+QPainter *SurfaceImpl::GetPainter()
+{
+ Q_ASSERT(device);
+
+ if (painter == 0) {
+ if (device->paintingActive()) {
+ painter = device->paintEngine()->painter();
+ } else {
+ painterOwned = true;
+ painter = new QPainter(device);
+ }
+
+ // Set text antialiasing unconditionally.
+ // The font's style strategy will override.
+ painter->setRenderHint(QPainter::TextAntialiasing, true);
+ }
+
+ return painter;
+}
+
+Surface *Surface::Allocate(int)
+{
+ return new SurfaceImpl;
+}
+
+
+//----------------------------------------------------------------------
+
+namespace {
+QWidget *window(WindowID wid)
+{
+ return static_cast<QWidget *>(wid);
+}
+}
+
+Window::~Window() {}
+
+void Window::Destroy()
+{
+ if (wid)
+ delete window(wid);
+
+ wid = 0;
+}
+
+bool Window::HasFocus()
+{
+ return wid ? window(wid)->hasFocus() : false;
+}
+
+PRectangle Window::GetPosition()
+{
+ // Before any size allocated pretend its 1000 wide so not scrolled
+ return wid ? PRectFromQRect(window(wid)->frameGeometry()) : PRectangle(0, 0, 1000, 1000);
+}
+
+void Window::SetPosition(PRectangle rc)
+{
+ if (wid)
+ window(wid)->setGeometry(QRectFromPRect(rc));
+}
+
+void Window::SetPositionRelative(PRectangle rc, Window relativeTo)
+{
+ QPoint oPos = window(relativeTo.wid)->mapToGlobal(QPoint(0,0));
+ int ox = oPos.x();
+ int oy = oPos.y();
+ ox += rc.left;
+ oy += rc.top;
+
+ QDesktopWidget *desktop = QApplication::desktop();
+ QRect rectDesk = desktop->availableGeometry(QPoint(ox, oy));
+ /* do some corrections to fit into screen */
+ int sizex = rc.right - rc.left;
+ int sizey = rc.bottom - rc.top;
+ int screenWidth = rectDesk.width();
+ if (ox < rectDesk.x())
+ ox = rectDesk.x();
+ if (sizex > screenWidth)
+ ox = rectDesk.x(); /* the best we can do */
+ else if (ox + sizex > rectDesk.right())
+ ox = rectDesk.right() - sizex;
+ if (oy + sizey > rectDesk.bottom())
+ oy = rectDesk.bottom() - sizey;
+
+ Q_ASSERT(wid);
+ window(wid)->move(ox, oy);
+ window(wid)->resize(sizex, sizey);
+}
+
+PRectangle Window::GetClientPosition()
+{
+ // The client position is the window position
+ return GetPosition();
+}
+
+void Window::Show(bool show)
+{
+ if (wid)
+ window(wid)->setVisible(show);
+}
+
+void Window::InvalidateAll()
+{
+ if (wid)
+ window(wid)->update();
+}
+
+void Window::InvalidateRectangle(PRectangle rc)
+{
+ if (wid)
+ window(wid)->update(QRectFromPRect(rc));
+}
+
+void Window::SetFont(Font &font)
+{
+ if (wid)
+ window(wid)->setFont(*FontPointer(font));
+}
+
+void Window::SetCursor(Cursor curs)
+{
+ if (wid) {
+ Qt::CursorShape shape;
+
+ switch (curs) {
+ case cursorText: shape = Qt::IBeamCursor; break;
+ case cursorArrow: shape = Qt::ArrowCursor; break;
+ case cursorUp: shape = Qt::UpArrowCursor; break;
+ case cursorWait: shape = Qt::WaitCursor; break;
+ case cursorHoriz: shape = Qt::SizeHorCursor; break;
+ case cursorVert: shape = Qt::SizeVerCursor; break;
+ case cursorHand: shape = Qt::PointingHandCursor; break;
+ default: shape = Qt::ArrowCursor; break;
+ }
+
+ QCursor cursor = QCursor(shape);
+
+ if (curs != cursorLast) {
+ window(wid)->setCursor(cursor);
+ cursorLast = curs;
+ }
+ }
+}
+
+void Window::SetTitle(const char *s)
+{
+ if (wid)
+ window(wid)->setWindowTitle(s);
+}
+
+/* Returns rectangle of monitor pt is on, both rect and pt are in Window's
+ window coordinates */
+PRectangle Window::GetMonitorRect(Point pt)
+{
+ QPoint originGlobal = window(wid)->mapToGlobal(QPoint(0, 0));
+ QPoint posGlobal = window(wid)->mapToGlobal(QPoint(pt.x, pt.y));
+ QDesktopWidget *desktop = QApplication::desktop();
+ QRect rectScreen = desktop->availableGeometry(posGlobal);
+ rectScreen.translate(-originGlobal.x(), -originGlobal.y());
+ return PRectangle(rectScreen.left(), rectScreen.top(),
+ rectScreen.right(), rectScreen.bottom());
+}
+
+
+//----------------------------------------------------------------------
+
+class ListBoxImpl : public ListBox {
+public:
+ ListBoxImpl();
+ ~ListBoxImpl();
+
+ virtual void SetFont(Font &font);
+ virtual void Create(Window &parent, int ctrlID, Point location,
+ int lineHeight, bool unicodeMode, int technology);
+ virtual void SetAverageCharWidth(int width);
+ virtual void SetVisibleRows(int rows);
+ virtual int GetVisibleRows() const;
+ virtual PRectangle GetDesiredRect();
+ virtual int CaretFromEdge();
+ virtual void Clear();
+ virtual void Append(char *s, int type = -1);
+ virtual int Length();
+ virtual void Select(int n);
+ virtual int GetSelection();
+ virtual int Find(const char *prefix);
+ virtual void GetValue(int n, char *value, int len);
+ virtual void RegisterImage(int type, const char *xpmData);
+ virtual void RegisterRGBAImage(int type, int width, int height,
+ const unsigned char *pixelsImage);
+ virtual void RegisterQPixmapImage(int type, const QPixmap& pm);
+ virtual void ClearRegisteredImages();
+ virtual void SetDoubleClickAction(CallBackAction action, void *data);
+ virtual void SetList(const char *list, char separator, char typesep);
+private:
+ bool unicodeMode;
+ int visibleRows;
+ QMap<int,QPixmap> images;
+};
+
+class ListWidget : public QListWidget {
+public:
+ explicit ListWidget(QWidget *parent);
+ virtual ~ListWidget();
+
+ void setDoubleClickAction(CallBackAction action, void *data);
+
+protected:
+ virtual void mouseDoubleClickEvent(QMouseEvent *event);
+ virtual QStyleOptionViewItem viewOptions() const;
+
+private:
+ CallBackAction doubleClickAction;
+ void *doubleClickActionData;
+};
+
+
+ListBoxImpl::ListBoxImpl()
+: unicodeMode(false), visibleRows(5)
+{}
+
+ListBoxImpl::~ListBoxImpl() {}
+
+void ListBoxImpl::Create(Window &parent,
+ int /*ctrlID*/,
+ Point location,
+ int /*lineHeight*/,
+ bool unicodeMode_,
+ int)
+{
+ unicodeMode = unicodeMode_;
+
+ QWidget *qparent = static_cast<QWidget *>(parent.GetID());
+ ListWidget *list = new ListWidget(qparent);
+
+#if defined(Q_OS_WIN)
+ // On Windows, Qt::ToolTip causes a crash when the list is clicked on
+ // so Qt::Tool is used.
+ list->setParent(0, Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
+#else
+ // On OS X, Qt::Tool takes focus so main window loses focus so
+ // keyboard stops working. Qt::ToolTip works but its only really
+ // documented for tooltips.
+ // On Linux / X this setting allows clicking on list items.
+ list->setParent(0, Qt::ToolTip | Qt::FramelessWindowHint);
+#endif
+ list->setAttribute(Qt::WA_ShowWithoutActivating);
+ list->setFocusPolicy(Qt::NoFocus);
+ list->setUniformItemSizes(true);
+ list->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ list->move(location.x, location.y);
+
+ int maxIconWidth = 0;
+ int maxIconHeight = 0;
+ foreach (QPixmap im, images) {
+ if (maxIconWidth < im.width())
+ maxIconWidth = im.width();
+ if (maxIconHeight < im.height())
+ maxIconHeight = im.height();
+ }
+ list->setIconSize(QSize(maxIconWidth, maxIconHeight));
+
+ wid = list;
+}
+
+void ListBoxImpl::SetFont(Font &font)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ list->setFont(*FontPointer(font));
+}
+
+void ListBoxImpl::SetAverageCharWidth(int /*width*/) {}
+
+void ListBoxImpl::SetVisibleRows(int rows)
+{
+ visibleRows = rows;
+}
+
+int ListBoxImpl::GetVisibleRows() const
+{
+ return visibleRows;
+}
+
+PRectangle ListBoxImpl::GetDesiredRect()
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+
+ int rows = Length();
+ if (rows == 0 || rows > visibleRows) {
+ rows = visibleRows;
+ }
+ int rowHeight = list->sizeHintForRow(0);
+ int height = (rows * rowHeight) + (2 * list->frameWidth());
+
+ QStyle *style = QApplication::style();
+ int width = list->sizeHintForColumn(0) + (2 * list->frameWidth());
+ if (Length() > rows) {
+ width += style->pixelMetric(QStyle::PM_ScrollBarExtent);
+ }
+
+ return PRectangle(0, 0, width, height);
+}
+
+int ListBoxImpl::CaretFromEdge()
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+
+ int maxIconWidth = 0;
+ foreach (QPixmap im, images) {
+ if (maxIconWidth < im.width())
+ maxIconWidth = im.width();
+ }
+
+ int extra;
+ // The 12 is from trial and error on OS X and the 7
+ // is from trial and error on Windows - there may be
+ // a better programmatic way to find any padding factors.
+#ifdef Q_OS_DARWIN
+ extra = 12;
+#else
+ extra = 7;
+#endif
+ return maxIconWidth + (2 * list->frameWidth()) + extra;
+}
+
+void ListBoxImpl::Clear()
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ list->clear();
+}
+
+void ListBoxImpl::Append(char *s, int type)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+
+ QString str = unicodeMode ? QString::fromUtf8(s) : QString::fromLocal8Bit(s);
+ QIcon icon;
+ if (type >= 0) {
+ Q_ASSERT(images.contains(type));
+ icon = images.value(type);
+ }
+ new QListWidgetItem(icon, str, list);
+}
+
+int ListBoxImpl::Length()
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ return list->count();
+}
+
+void ListBoxImpl::Select(int n)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ QModelIndex index = list->model()->index(n, 0);
+ if (index.isValid()) {
+ QRect row_rect = list->visualRect(index);
+ if (!list->viewport()->rect().contains(row_rect)) {
+ list->scrollTo(index, QAbstractItemView::PositionAtTop);
+ }
+ }
+ list->setCurrentRow(n);
+}
+
+int ListBoxImpl::GetSelection()
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ return list->currentRow();
+}
+
+int ListBoxImpl::Find(const char *prefix)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ QString sPrefix = unicodeMode ? QString::fromUtf8(prefix) : QString::fromLocal8Bit(prefix);
+ QList<QListWidgetItem *> ms = list->findItems(sPrefix, Qt::MatchStartsWith);
+
+ int result = -1;
+ if (!ms.isEmpty()) {
+ result = list->row(ms.first());
+ }
+
+ return result;
+}
+
+void ListBoxImpl::GetValue(int n, char *value, int len)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ QListWidgetItem *item = list->item(n);
+ QString str = item->data(Qt::DisplayRole).toString();
+ QByteArray bytes = unicodeMode ? str.toUtf8() : str.toLocal8Bit();
+
+ strncpy(value, bytes.constData(), len);
+ value[len-1] = '\0';
+}
+
+void ListBoxImpl::RegisterQPixmapImage(int type, const QPixmap& pm)
+{
+ images[type] = pm;
+
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ if (list != NULL) {
+ QSize iconSize = list->iconSize();
+ if (pm.width() > iconSize.width() || pm.height() > iconSize.height())
+ list->setIconSize(QSize(qMax(pm.width(), iconSize.width()),
+ qMax(pm.height(), iconSize.height())));
+ }
+
+}
+
+void ListBoxImpl::RegisterImage(int type, const char *xpmData)
+{
+ RegisterQPixmapImage(type, QPixmap(reinterpret_cast<const char * const *>(xpmData)));
+}
+
+void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage)
+{
+ std::vector<unsigned char> imageBytes = ImageByteSwapped(width, height, pixelsImage);
+ QImage image(&imageBytes[0], width, height, QImage::Format_ARGB32);
+ RegisterQPixmapImage(type, QPixmap::fromImage(image));
+}
+
+void ListBoxImpl::ClearRegisteredImages()
+{
+ images.clear();
+
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ if (list != NULL)
+ list->setIconSize(QSize(0, 0));
+}
+
+void ListBoxImpl::SetDoubleClickAction(CallBackAction action, void *data)
+{
+ ListWidget *list = static_cast<ListWidget *>(wid);
+ list->setDoubleClickAction(action, data);
+}
+
+void ListBoxImpl::SetList(const char *list, char separator, char typesep)
+{
+ // This method is *not* platform dependent.
+ // It is borrowed from the GTK implementation.
+ Clear();
+ size_t count = strlen(list) + 1;
+ std::vector<char> words(list, list+count);
+ char *startword = &words[0];
+ char *numword = NULL;
+ int i = 0;
+ for (; words[i]; i++) {
+ if (words[i] == separator) {
+ words[i] = '\0';
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ startword = &words[0] + i + 1;
+ numword = NULL;
+ } else if (words[i] == typesep) {
+ numword = &words[0] + i;
+ }
+ }
+ if (startword) {
+ if (numword)
+ *numword = '\0';
+ Append(startword, numword?atoi(numword + 1):-1);
+ }
+}
+
+ListBox::ListBox() {}
+
+ListBox::~ListBox() {}
+
+ListBox *ListBox::Allocate()
+{
+ return new ListBoxImpl();
+}
+
+ListWidget::ListWidget(QWidget *parent)
+: QListWidget(parent), doubleClickAction(0), doubleClickActionData(0)
+{}
+
+ListWidget::~ListWidget() {}
+
+void ListWidget::setDoubleClickAction(CallBackAction action, void *data)
+{
+ doubleClickAction = action;
+ doubleClickActionData = data;
+}
+
+void ListWidget::mouseDoubleClickEvent(QMouseEvent * /* event */)
+{
+ if (doubleClickAction != 0) {
+ doubleClickAction(doubleClickActionData);
+ }
+}
+
+QStyleOptionViewItem ListWidget::viewOptions() const
+{
+ QStyleOptionViewItem result = QListWidget::viewOptions();
+ result.state |= QStyle::State_Active;
+ return result;
+}
+
+//----------------------------------------------------------------------
+
+Menu::Menu() : mid(0) {}
+
+void Menu::CreatePopUp()
+{
+ Destroy();
+ mid = new QMenu();
+}
+
+void Menu::Destroy()
+{
+ if (mid) {
+ QMenu *menu = static_cast<QMenu *>(mid);
+ delete menu;
+ }
+ mid = 0;
+}
+
+void Menu::Show(Point pt, Window & /*w*/)
+{
+ QMenu *menu = static_cast<QMenu *>(mid);
+ menu->exec(QPoint(pt.x, pt.y));
+ Destroy();
+}
+
+//----------------------------------------------------------------------
+
+class DynamicLibraryImpl : public DynamicLibrary {
+protected:
+ QLibrary *lib;
+public:
+ explicit DynamicLibraryImpl(const char *modulePath) {
+ QString path = QString::fromUtf8(modulePath);
+ lib = new QLibrary(path);
+ }
+
+ virtual ~DynamicLibraryImpl() {
+ if (lib)
+ lib->unload();
+ lib = 0;
+ }
+
+ virtual Function FindFunction(const char *name) {
+ if (lib) {
+ // C++ standard doesn't like casts between function pointers and void pointers so use a union
+ union {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ QFunctionPointer fp;
+#else
+ void *fp;
+#endif
+ Function f;
+ } fnConv;
+ fnConv.fp = lib->resolve(name);
+ return fnConv.f;
+ }
+ return NULL;
+ }
+
+ virtual bool IsValid() {
+ return lib != NULL;
+ }
+};
+
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath)
+{
+ return static_cast<DynamicLibrary *>(new DynamicLibraryImpl(modulePath));
+}
+
+ColourDesired Platform::Chrome()
+{
+ QColor c(Qt::gray);
+ return ColourDesired(c.red(), c.green(), c.blue());
+}
+
+ColourDesired Platform::ChromeHighlight()
+{
+ QColor c(Qt::lightGray);
+ return ColourDesired(c.red(), c.green(), c.blue());
+}
+
+const char *Platform::DefaultFont()
+{
+ static char fontNameDefault[200] = "";
+ if (!fontNameDefault[0]) {
+ QFont font = QApplication::font();
+ strcpy(fontNameDefault, font.family().toUtf8());
+ }
+ return fontNameDefault;
+}
+
+int Platform::DefaultFontSize()
+{
+ QFont font = QApplication::font();
+ return font.pointSize();
+}
+
+unsigned int Platform::DoubleClickTime()
+{
+ return QApplication::doubleClickInterval();
+}
+
+bool Platform::MouseButtonBounce()
+{
+ return false;
+}
+
+bool Platform::IsKeyDown(int /*key*/)
+{
+ return false;
+}
+
+long Platform::SendScintilla(WindowID /*w*/,
+ unsigned int /*msg*/,
+ unsigned long /*wParam*/,
+ long /*lParam*/)
+{
+ return 0;
+}
+
+long Platform::SendScintillaPointer(WindowID /*w*/,
+ unsigned int /*msg*/,
+ unsigned long /*wParam*/,
+ void * /*lParam*/)
+{
+ return 0;
+}
+
+int Platform::Minimum(int a, int b)
+{
+ return qMin(a, b);
+}
+
+int Platform::Maximum(int a, int b)
+{
+ return qMax(a, b);
+}
+
+int Platform::Clamp(int val, int minVal, int maxVal)
+{
+ return qBound(minVal, val, maxVal);
+}
+
+void Platform::DebugDisplay(const char *s)
+{
+ qWarning("Scintilla: %s", s);
+}
+
+void Platform::DebugPrintf(const char *format, ...)
+{
+ char buffer[2000];
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsprintf(buffer, format, pArguments);
+ va_end(pArguments);
+ Platform::DebugDisplay(buffer);
+}
+
+bool Platform::ShowAssertionPopUps(bool /*assertionPopUps*/)
+{
+ return false;
+}
+
+void Platform::Assert(const char *c, const char *file, int line)
+{
+ char buffer[2000];
+ sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
+ if (Platform::ShowAssertionPopUps(false)) {
+ QMessageBox mb("Assertion Failure", buffer, QMessageBox::NoIcon,
+ QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
+ mb.exec();
+ } else {
+ strcat(buffer, "\n");
+ Platform::DebugDisplay(buffer);
+ }
+}
+
+
+bool Platform::IsDBCSLeadByte(int codePage, char ch)
+{
+ // Byte ranges found in Wikipedia articles with relevant search strings in each case
+ unsigned char uch = static_cast<unsigned char>(ch);
+ switch (codePage) {
+ case 932:
+ // Shift_jis
+ return ((uch >= 0x81) && (uch <= 0x9F)) ||
+ ((uch >= 0xE0) && (uch <= 0xEF));
+ case 936:
+ // GBK
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 949:
+ // Korean Wansung KS C-5601-1987
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 950:
+ // Big5
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 1361:
+ // Korean Johab KS C-5601-1992
+ return
+ ((uch >= 0x84) && (uch <= 0xD3)) ||
+ ((uch >= 0xD8) && (uch <= 0xDE)) ||
+ ((uch >= 0xE0) && (uch <= 0xF9));
+ }
+ return false;
+}
+
+int Platform::DBCSCharLength(int codePage, const char *s)
+{
+ if (codePage == 932 || codePage == 936 || codePage == 949 ||
+ codePage == 950 || codePage == 1361) {
+ return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1;
+ } else {
+ return 1;
+ }
+}
+
+int Platform::DBCSCharMaxLength()
+{
+ return 2;
+}
+
+
+//----------------------------------------------------------------------
+
+static QElapsedTimer timer;
+
+ElapsedTime::ElapsedTime() : bigBit(0), littleBit(0)
+{
+ if (!timer.isValid()) {
+ timer.start();
+ }
+ qint64 ns64Now = timer.nsecsElapsed();
+ bigBit = static_cast<unsigned long>(ns64Now >> 32);
+ littleBit = static_cast<unsigned long>(ns64Now & 0xFFFFFFFF);
+}
+
+double ElapsedTime::Duration(bool reset)
+{
+ qint64 ns64Now = timer.nsecsElapsed();
+ qint64 ns64Start = (static_cast<qint64>(static_cast<unsigned long>(bigBit)) << 32) + static_cast<unsigned long>(littleBit);
+ double result = ns64Now - ns64Start;
+ if (reset) {
+ bigBit = static_cast<unsigned long>(ns64Now >> 32);
+ littleBit = static_cast<unsigned long>(ns64Now & 0xFFFFFFFF);
+ }
+ return result / 1000000000.0; // 1 billion nanoseconds in a second
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.h b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.h
new file mode 100644
index 00000000000..be35d818b6a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.h
@@ -0,0 +1,132 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// Scintilla platform layer for Qt
+
+#ifndef PLATQT_H
+#define PLATQT_H
+
+#include "Platform.h"
+
+#include <QPaintDevice>
+#include <QPainter>
+#include <QHash>
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+const char *CharacterSetID(int characterSet);
+
+inline QColor QColorFromCA(ColourDesired ca)
+{
+ long c = ca.AsLong();
+ return QColor(c & 0xff, (c >> 8) & 0xff, (c >> 16) & 0xff);
+}
+
+inline QRect QRectFromPRect(PRectangle pr)
+{
+ return QRect(pr.left, pr.top, pr.Width(), pr.Height());
+}
+
+inline QRectF QRectFFromPRect(PRectangle pr)
+{
+ return QRectF(pr.left, pr.top, pr.Width(), pr.Height());
+}
+
+inline PRectangle PRectFromQRect(QRect qr)
+{
+ return PRectangle(qr.x(), qr.y(), qr.x() + qr.width(), qr.y() + qr.height());
+}
+
+inline Point PointFromQPoint(QPoint qp)
+{
+ return Point(qp.x(), qp.y());
+}
+
+class SurfaceImpl : public Surface {
+private:
+ QPaintDevice *device;
+ QPainter *painter;
+ bool deviceOwned;
+ bool painterOwned;
+ float x, y;
+ bool unicodeMode;
+ int codePage;
+ const char *codecName;
+ QTextCodec *codec;
+
+public:
+ SurfaceImpl();
+ virtual ~SurfaceImpl();
+
+ virtual void Init(WindowID wid);
+ virtual void Init(SurfaceID sid, WindowID wid);
+ virtual void InitPixMap(int width, int height,
+ Surface *surface, WindowID wid);
+
+ virtual void Release();
+ virtual bool Initialised();
+ virtual void PenColour(ColourDesired fore);
+ virtual int LogPixelsY();
+ virtual int DeviceHeightFont(int points);
+ virtual void MoveTo(int x, int y);
+ virtual void LineTo(int x, int y);
+ virtual void Polygon(Point *pts, int npts, ColourDesired fore,
+ ColourDesired back);
+ virtual void RectangleDraw(PRectangle rc, ColourDesired fore,
+ ColourDesired back);
+ virtual void FillRectangle(PRectangle rc, ColourDesired back);
+ virtual void FillRectangle(PRectangle rc, Surface &surfacePattern);
+ virtual void RoundedRectangle(PRectangle rc, ColourDesired fore,
+ ColourDesired back);
+ virtual void AlphaRectangle(PRectangle rc, int corner, ColourDesired fill,
+ int alphaFill, ColourDesired outline, int alphaOutline, int flags);
+ virtual void DrawRGBAImage(PRectangle rc, int width, int height,
+ const unsigned char *pixelsImage);
+ virtual void Ellipse(PRectangle rc, ColourDesired fore,
+ ColourDesired back);
+ virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource);
+
+ virtual void DrawTextNoClip(PRectangle rc, Font &font, XYPOSITION ybase,
+ const char *s, int len, ColourDesired fore, ColourDesired back);
+ virtual void DrawTextClipped(PRectangle rc, Font &font, XYPOSITION ybase,
+ const char *s, int len, ColourDesired fore, ColourDesired back);
+ virtual void DrawTextTransparent(PRectangle rc, Font &font, XYPOSITION ybase,
+ const char *s, int len, ColourDesired fore);
+ virtual void MeasureWidths(Font &font, const char *s, int len,
+ XYPOSITION *positions);
+ virtual XYPOSITION WidthText(Font &font, const char *s, int len);
+ virtual XYPOSITION WidthChar(Font &font, char ch);
+ virtual XYPOSITION Ascent(Font &font);
+ virtual XYPOSITION Descent(Font &font);
+ virtual XYPOSITION InternalLeading(Font &font);
+ virtual XYPOSITION ExternalLeading(Font &font);
+ virtual XYPOSITION Height(Font &font);
+ virtual XYPOSITION AverageCharWidth(Font &font);
+
+ virtual void SetClip(PRectangle rc);
+ virtual void FlushCachedState();
+
+ virtual void SetUnicodeMode(bool unicodeMode);
+ virtual void SetDBCSMode(int codePage);
+
+ void BrushColour(ColourDesired back);
+ void SetCodec(Font &font);
+ void SetFont(Font &font);
+
+ QPaintDevice *GetPaintDevice();
+ void SetPainter(QPainter *painter);
+ QPainter *GetPainter();
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp
new file mode 100644
index 00000000000..a99e06d811d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -0,0 +1,762 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// ScintillaEditBase.cpp - Qt widget that wraps ScintillaQt and provides events and scrolling
+
+#include "ScintillaEditBase.h"
+#include "ScintillaQt.h"
+#include "PlatQt.h"
+
+#include <QApplication>
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QInputContext>
+#endif
+#include <QPainter>
+#include <QScrollBar>
+#include <QTextFormat>
+#include <QVarLengthArray>
+
+#define INDIC_INPUTMETHOD 24
+
+#define MAXLENINPUTIME 200
+#define SC_INDICATOR_INPUT INDIC_IME
+#define SC_INDICATOR_TARGET INDIC_IME+1
+#define SC_INDICATOR_CONVERTED INDIC_IME+2
+#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+ScintillaEditBase::ScintillaEditBase(QWidget *parent)
+: QAbstractScrollArea(parent), sqt(0), preeditPos(-1), wheelDelta(0)
+{
+ sqt = new ScintillaQt(this);
+
+ time.start();
+
+ // Set Qt defaults.
+ setAcceptDrops(true);
+ setMouseTracking(true);
+ setAutoFillBackground(false);
+ setFrameStyle(QFrame::NoFrame);
+ setFocusPolicy(Qt::StrongFocus);
+ setAttribute(Qt::WA_StaticContents);
+ viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+ setAttribute(Qt::WA_KeyCompression);
+ setAttribute(Qt::WA_InputMethodEnabled);
+
+ sqt->vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff));
+ sqt->vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff));
+ sqt->vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourDesired(0, 0, 0xff));
+ sqt->vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourDesired(0, 0, 0xff));
+
+ connect(sqt, SIGNAL(notifyParent(SCNotification)),
+ this, SLOT(notifyParent(SCNotification)));
+
+ // Connect scroll bars.
+ connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(scrollVertical(int)));
+ connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(scrollHorizontal(int)));
+
+ // Connect pass-through signals.
+ connect(sqt, SIGNAL(horizontalRangeChanged(int,int)),
+ this, SIGNAL(horizontalRangeChanged(int,int)));
+ connect(sqt, SIGNAL(verticalRangeChanged(int,int)),
+ this, SIGNAL(verticalRangeChanged(int,int)));
+ connect(sqt, SIGNAL(horizontalScrolled(int)),
+ this, SIGNAL(horizontalScrolled(int)));
+ connect(sqt, SIGNAL(verticalScrolled(int)),
+ this, SIGNAL(verticalScrolled(int)));
+
+ connect(sqt, SIGNAL(notifyChange()),
+ this, SIGNAL(notifyChange()));
+
+ connect(sqt, SIGNAL(command(uptr_t, sptr_t)),
+ this, SLOT(event_command(uptr_t, sptr_t)));
+
+ connect(sqt, SIGNAL(aboutToCopy(QMimeData *)),
+ this, SIGNAL(aboutToCopy(QMimeData *)));
+}
+
+ScintillaEditBase::~ScintillaEditBase() {}
+
+sptr_t ScintillaEditBase::send(
+ unsigned int iMessage,
+ uptr_t wParam,
+ sptr_t lParam) const
+{
+ return sqt->WndProc(iMessage, wParam, lParam);
+}
+
+sptr_t ScintillaEditBase::sends(
+ unsigned int iMessage,
+ uptr_t wParam,
+ const char *s) const
+{
+ return sqt->WndProc(iMessage, wParam, (sptr_t)s);
+}
+
+void ScintillaEditBase::scrollHorizontal(int value)
+{
+ sqt->HorizontalScrollTo(value);
+}
+
+void ScintillaEditBase::scrollVertical(int value)
+{
+ sqt->ScrollTo(value);
+}
+
+bool ScintillaEditBase::event(QEvent *event)
+{
+ bool result = false;
+
+ if (event->type() == QEvent::KeyPress) {
+ // Circumvent the tab focus convention.
+ keyPressEvent(static_cast<QKeyEvent *>(event));
+ result = event->isAccepted();
+ } else if (event->type() == QEvent::Hide) {
+ setMouseTracking(false);
+ result = QAbstractScrollArea::event(event);
+ } else {
+ result = QAbstractScrollArea::event(event);
+ }
+
+ return result;
+}
+
+void ScintillaEditBase::paintEvent(QPaintEvent *event)
+{
+ sqt->PartialPaint(PRectFromQRect(event->rect()));
+}
+
+void ScintillaEditBase::wheelEvent(QWheelEvent *event)
+{
+ if (event->orientation() == Qt::Horizontal) {
+ if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff)
+ event->ignore();
+ else
+ QAbstractScrollArea::wheelEvent(event);
+ } else {
+ if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
+ // Zoom! We play with the font sizes in the styles.
+ // Number of steps/line is ignored, we just care if sizing up or down
+ if (event->delta() > 0) {
+ sqt->KeyCommand(SCI_ZOOMIN);
+ } else {
+ sqt->KeyCommand(SCI_ZOOMOUT);
+ }
+ } else {
+ // Ignore wheel events when the scroll bars are disabled.
+ if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
+ event->ignore();
+ } else {
+ // Scroll
+ QAbstractScrollArea::wheelEvent(event);
+ }
+ }
+ }
+}
+
+void ScintillaEditBase::focusInEvent(QFocusEvent *event)
+{
+ sqt->SetFocusState(true);
+ emit updateUi();
+
+ QAbstractScrollArea::focusInEvent(event);
+}
+
+void ScintillaEditBase::focusOutEvent(QFocusEvent *event)
+{
+ sqt->SetFocusState(false);
+
+ QAbstractScrollArea::focusOutEvent(event);
+}
+
+void ScintillaEditBase::resizeEvent(QResizeEvent *)
+{
+ sqt->ChangeSize();
+ emit resized();
+}
+
+void ScintillaEditBase::keyPressEvent(QKeyEvent *event)
+{
+ // All keystrokes containing the meta modifier are
+ // assumed to be shortcuts not handled by scintilla.
+ if (QApplication::keyboardModifiers() & Qt::MetaModifier) {
+ QAbstractScrollArea::keyPressEvent(event);
+ emit keyPressed(event);
+ return;
+ }
+
+ int key = 0;
+ switch (event->key()) {
+ case Qt::Key_Down: key = SCK_DOWN; break;
+ case Qt::Key_Up: key = SCK_UP; break;
+ case Qt::Key_Left: key = SCK_LEFT; break;
+ case Qt::Key_Right: key = SCK_RIGHT; break;
+ case Qt::Key_Home: key = SCK_HOME; break;
+ case Qt::Key_End: key = SCK_END; break;
+ case Qt::Key_PageUp: key = SCK_PRIOR; break;
+ case Qt::Key_PageDown: key = SCK_NEXT; break;
+ case Qt::Key_Delete: key = SCK_DELETE; break;
+ case Qt::Key_Insert: key = SCK_INSERT; break;
+ case Qt::Key_Escape: key = SCK_ESCAPE; break;
+ case Qt::Key_Backspace: key = SCK_BACK; break;
+ case Qt::Key_Plus: key = SCK_ADD; break;
+ case Qt::Key_Minus: key = SCK_SUBTRACT; break;
+ case Qt::Key_Backtab: // fall through
+ case Qt::Key_Tab: key = SCK_TAB; break;
+ case Qt::Key_Enter: // fall through
+ case Qt::Key_Return: key = SCK_RETURN; break;
+ case Qt::Key_Control: key = 0; break;
+ case Qt::Key_Alt: key = 0; break;
+ case Qt::Key_Shift: key = 0; break;
+ case Qt::Key_Meta: key = 0; break;
+ default: key = event->key(); break;
+ }
+
+ bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
+ bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier;
+ bool alt = QApplication::keyboardModifiers() & Qt::AltModifier;
+
+ bool consumed = false;
+ bool added = sqt->KeyDown(key, shift, ctrl, alt, &consumed) != 0;
+ if (!consumed)
+ consumed = added;
+
+ if (!consumed) {
+ // Don't insert text if the control key was pressed unless
+ // it was pressed in conjunction with alt for AltGr emulation.
+ bool input = (!ctrl || alt);
+
+ // Additionally, on non-mac platforms, don't insert text
+ // if the alt key was pressed unless control is also present.
+ // On mac alt can be used to insert special characters.
+#ifndef Q_WS_MAC
+ input &= (!alt || ctrl);
+#endif
+
+ QString text = event->text();
+ if (input && !text.isEmpty() && text[0].isPrint()) {
+ QByteArray utext = sqt->BytesForDocument(text);
+ sqt->AddCharUTF(utext.data(), utext.size());
+ } else {
+ event->ignore();
+ }
+ }
+
+ emit keyPressed(event);
+}
+
+#ifdef Q_WS_X11
+static int modifierTranslated(int sciModifier)
+{
+ switch (sciModifier) {
+ case SCMOD_SHIFT:
+ return Qt::ShiftModifier;
+ case SCMOD_CTRL:
+ return Qt::ControlModifier;
+ case SCMOD_ALT:
+ return Qt::AltModifier;
+ case SCMOD_SUPER:
+ return Qt::MetaModifier;
+ default:
+ return 0;
+ }
+}
+#endif
+
+void ScintillaEditBase::mousePressEvent(QMouseEvent *event)
+{
+ Point pos = PointFromQPoint(event->pos());
+
+ emit buttonPressed(event);
+
+ if (event->button() == Qt::MidButton &&
+ QApplication::clipboard()->supportsSelection()) {
+ SelectionPosition selPos = sqt->SPositionFromLocation(
+ pos, false, false, sqt->UserVirtualSpace());
+ sqt->sel.Clear();
+ sqt->SetSelection(selPos, selPos);
+ sqt->PasteFromMode(QClipboard::Selection);
+ return;
+ }
+
+ bool button = event->button() == Qt::LeftButton;
+
+ if (button) {
+ bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
+ bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier;
+#ifdef Q_WS_X11
+ // On X allow choice of rectangular modifier since most window
+ // managers grab alt + click for moving windows.
+ bool alt = QApplication::keyboardModifiers() & modifierTranslated(sqt->rectangularSelectionModifier);
+#else
+ bool alt = QApplication::keyboardModifiers() & Qt::AltModifier;
+#endif
+
+ sqt->ButtonDown(pos, time.elapsed(), shift, ctrl, alt);
+ }
+}
+
+void ScintillaEditBase::mouseReleaseEvent(QMouseEvent *event)
+{
+ Point point = PointFromQPoint(event->pos());
+ bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier;
+ if (event->button() == Qt::LeftButton)
+ sqt->ButtonUp(point, time.elapsed(), ctrl);
+
+ int pos = send(SCI_POSITIONFROMPOINT, point.x, point.y);
+ int line = send(SCI_LINEFROMPOSITION, pos);
+ int modifiers = QApplication::keyboardModifiers();
+
+ emit textAreaClicked(line, modifiers);
+ emit buttonReleased(event);
+}
+
+void ScintillaEditBase::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ // Scintilla does its own double-click detection.
+ mousePressEvent(event);
+}
+
+void ScintillaEditBase::mouseMoveEvent(QMouseEvent *event)
+{
+ Point pos = PointFromQPoint(event->pos());
+
+ bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
+ bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier;
+#ifdef Q_WS_X11
+ // On X allow choice of rectangular modifier since most window
+ // managers grab alt + click for moving windows.
+ bool alt = QApplication::keyboardModifiers() & modifierTranslated(sqt->rectangularSelectionModifier);
+#else
+ bool alt = QApplication::keyboardModifiers() & Qt::AltModifier;
+#endif
+
+ int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0);
+
+ sqt->ButtonMoveWithModifiers(pos, modifiers);
+}
+
+void ScintillaEditBase::contextMenuEvent(QContextMenuEvent *event)
+{
+ Point pos = PointFromQPoint(event->globalPos());
+ Point pt = PointFromQPoint(event->pos());
+ if (!sqt->PointInSelection(pt))
+ sqt->SetEmptySelection(sqt->PositionFromLocation(pt));
+ sqt->ContextMenu(pos);
+}
+
+void ScintillaEditBase::dragEnterEvent(QDragEnterEvent *event)
+{
+ if (event->mimeData()->hasText()) {
+ event->acceptProposedAction();
+
+ Point point = PointFromQPoint(event->pos());
+ sqt->DragEnter(point);
+ } else {
+ event->ignore();
+ }
+}
+
+void ScintillaEditBase::dragLeaveEvent(QDragLeaveEvent * /* event */)
+{
+ sqt->DragLeave();
+}
+
+void ScintillaEditBase::dragMoveEvent(QDragMoveEvent *event)
+{
+ if (event->mimeData()->hasText()) {
+ event->acceptProposedAction();
+
+ Point point = PointFromQPoint(event->pos());
+ sqt->DragMove(point);
+ } else {
+ event->ignore();
+ }
+}
+
+void ScintillaEditBase::dropEvent(QDropEvent *event)
+{
+ if (event->mimeData()->hasText()) {
+ event->acceptProposedAction();
+
+ Point point = PointFromQPoint(event->pos());
+ bool move = (event->source() == this &&
+ event->proposedAction() == Qt::MoveAction);
+ sqt->Drop(point, event->mimeData(), move);
+ } else {
+ event->ignore();
+ }
+}
+
+bool ScintillaEditBase::IsHangul(const QChar qchar)
+{
+ int unicode = (int)qchar.unicode();
+ // Korean character ranges used for preedit chars.
+ // http://www.programminginkorean.com/programming/hangul-in-unicode/
+ const bool HangulJamo = (0x1100 <= unicode && unicode <= 0x11FF);
+ const bool HangulCompatibleJamo = (0x3130 <= unicode && unicode <= 0x318F);
+ const bool HangulJamoExtendedA = (0xA960 <= unicode && unicode <= 0xA97F);
+ const bool HangulJamoExtendedB = (0xD7B0 <= unicode && unicode <= 0xD7FF);
+ const bool HangulSyllable = (0xAC00 <= unicode && unicode <= 0xD7A3);
+ return HangulJamo || HangulCompatibleJamo || HangulSyllable ||
+ HangulJamoExtendedA || HangulJamoExtendedB;
+}
+
+void ScintillaEditBase::MoveImeCarets(int offset)
+{
+ // Move carets relatively by bytes
+ for (size_t r=0; r < sqt->sel.Count(); r++) {
+ int positionInsert = sqt->sel.Range(r).Start().Position();
+ sqt->sel.Range(r).caret.SetPosition(positionInsert + offset);
+ sqt->sel.Range(r).anchor.SetPosition(positionInsert + offset);
+ }
+}
+
+void ScintillaEditBase::DrawImeIndicator(int indicator, int len)
+{
+ // Emulate the visual style of IME characters with indicators.
+ // Draw an indicator on the character before caret by the character bytes of len
+ // so it should be called after AddCharUTF().
+ // It does not affect caret positions.
+ if (indicator < 8 || indicator > INDIC_MAX) {
+ return;
+ }
+ sqt->pdoc->decorations.SetCurrentIndicator(indicator);
+ for (size_t r=0; r< sqt-> sel.Count(); r++) {
+ int positionInsert = sqt->sel.Range(r).Start().Position();
+ sqt->pdoc->DecorationFillRange(positionInsert - len, 1, len);
+ }
+}
+
+void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
+{
+ // Copy & paste by johnsonj with a lot of helps of Neil
+ // Great thanks for my forerunners, jiniya and BLUEnLIVE
+
+ if (sqt->pdoc->TentativeActive()) {
+ sqt->pdoc->TentativeUndo();
+ } else {
+ // No tentative undo means start of this composition so
+ // Fill in any virtual spaces.
+ sqt->FillVirtualSpace();
+ }
+
+ sqt->view.imeCaretBlockOverride = false;
+
+ if (!event->commitString().isEmpty()) {
+ const QString commitStr = event->commitString();
+ const unsigned int commitStrLen = commitStr.length();
+
+ for (unsigned int i = 0; i < commitStrLen;) {
+ const unsigned int ucWidth = commitStr.at(i).isHighSurrogate() ? 2 : 1;
+ const QString oneCharUTF16 = commitStr.mid(i, ucWidth);
+ const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
+ const int oneCharLen = oneChar.length();
+
+ sqt->AddCharUTF(oneChar.data(), oneCharLen);
+ i += ucWidth;
+ }
+
+ } else if (!event->preeditString().isEmpty()) {
+ const QString preeditStr = event->preeditString();
+ const unsigned int preeditStrLen = preeditStr.length();
+ if ((preeditStrLen == 0) || (preeditStrLen > MAXLENINPUTIME)) {
+ sqt->ShowCaretAtCurrentPosition();
+ return;
+ }
+
+ sqt->pdoc->TentativeStart(); // TentativeActive() from now on.
+
+ // Mark segments and get ime caret position.
+ unsigned int imeCaretPos = 0;
+ unsigned int imeIndicator[MAXLENINPUTIME] = {0};
+#ifdef Q_OS_LINUX
+ // ibus-qt has a bug to return only one underline style.
+ // Q_OS_LINUX blocks are temporary work around to cope with it.
+ unsigned int attrSegment = 0;
+#endif
+
+ foreach (QInputMethodEvent::Attribute attr, event->attributes()) {
+ if (attr.type == QInputMethodEvent::TextFormat) {
+ QTextFormat format = attr.value.value<QTextFormat>();
+ QTextCharFormat charFormat = format.toCharFormat();
+
+ unsigned int indicator = SC_INDICATOR_UNKNOWN;
+ switch (charFormat.underlineStyle()) {
+ case QTextCharFormat::NoUnderline:
+ indicator = SC_INDICATOR_TARGET; //target input
+ break;
+ case QTextCharFormat::SingleUnderline:
+ case QTextCharFormat::DashUnderline:
+ indicator = SC_INDICATOR_INPUT; //normal input
+ break;
+ case QTextCharFormat::DotLine:
+ case QTextCharFormat::DashDotLine:
+ case QTextCharFormat::WaveUnderline:
+ case QTextCharFormat::SpellCheckUnderline:
+ indicator = SC_INDICATOR_CONVERTED;
+ break;
+
+ default:
+ indicator = SC_INDICATOR_UNKNOWN;
+ }
+
+#ifdef Q_OS_LINUX
+ attrSegment++;
+ indicator = attr.start;
+#endif
+ for (int i = attr.start; i < attr.start+attr.length; i++) {
+ imeIndicator[i] = indicator;
+ }
+ } else if (attr.type == QInputMethodEvent::Cursor) {
+ imeCaretPos = attr.start;
+ }
+ }
+#ifdef Q_OS_LINUX
+ const bool targetInput = (attrSegment > 1) || ((imeCaretPos == 0) && (preeditStr != preeditString));
+ preeditString = preeditStr;
+#endif
+ // Display preedit characters one by one.
+ int imeCharPos[MAXLENINPUTIME] = {0};
+ int numBytes = 0;
+
+ const bool recording = sqt->recordingMacro;
+ sqt->recordingMacro = false;
+ for (unsigned int i = 0; i < preeditStrLen;) {
+ const unsigned int ucWidth = preeditStr.at(i).isHighSurrogate() ? 2 : 1;
+ const QString oneCharUTF16 = preeditStr.mid(i, ucWidth);
+ const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
+ const int oneCharLen = oneChar.length();
+
+ // Record character positions for moving ime caret.
+ numBytes += oneCharLen;
+ imeCharPos[i+1] = numBytes;
+
+ sqt->AddCharUTF(oneChar.data(), oneCharLen);
+
+#ifdef Q_OS_LINUX
+ // Segment marked with imeCaretPos is for target input.
+ if ((imeIndicator[i] == imeCaretPos) && (targetInput)) {
+ DrawImeIndicator(SC_INDICATOR_TARGET, oneCharLen);
+ } else {
+ DrawImeIndicator(SC_INDICATOR_INPUT, oneCharLen);
+ }
+#else
+ DrawImeIndicator(imeIndicator[i], oneCharLen);
+#endif
+ i += ucWidth;
+ }
+ sqt->recordingMacro = recording;
+
+ // Move IME carets.
+ if (IsHangul(preeditStr.at(0))) {
+ sqt->view.imeCaretBlockOverride = true;
+ MoveImeCarets(- imeCharPos[preeditStrLen]);
+ } else {
+ MoveImeCarets(- imeCharPos[preeditStrLen] + imeCharPos[imeCaretPos]);
+ }
+
+ // Set candidate box position for Qt::ImMicroFocus.
+ preeditPos = sqt->CurrentPosition();
+ updateMicroFocus();
+ }
+ sqt->ShowCaretAtCurrentPosition();
+}
+
+QVariant ScintillaEditBase::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ int pos = send(SCI_GETCURRENTPOS);
+ int line = send(SCI_LINEFROMPOSITION, pos);
+
+ switch (query) {
+ case Qt::ImMicroFocus:
+ {
+ int startPos = (preeditPos >= 0) ? preeditPos : pos;
+ Point pt = sqt->LocationFromPosition(startPos);
+ int width = send(SCI_GETCARETWIDTH);
+ int height = send(SCI_TEXTHEIGHT, line);
+ return QRect(pt.x, pt.y, width, height);
+ }
+
+ case Qt::ImFont:
+ {
+ char fontName[64];
+ int style = send(SCI_GETSTYLEAT, pos);
+ int len = send(SCI_STYLEGETFONT, style, (sptr_t)fontName);
+ int size = send(SCI_STYLEGETSIZE, style);
+ bool italic = send(SCI_STYLEGETITALIC, style);
+ int weight = send(SCI_STYLEGETBOLD, style) ? QFont::Bold : -1;
+ return QFont(QString::fromUtf8(fontName, len), size, weight, italic);
+ }
+
+ case Qt::ImCursorPosition:
+ {
+ int paraStart = sqt->pdoc->ParaUp(pos);
+ return pos - paraStart;
+ }
+
+ case Qt::ImSurroundingText:
+ {
+ int paraStart = sqt->pdoc->ParaUp(pos);
+ int paraEnd = sqt->pdoc->ParaDown(pos);
+ QVarLengthArray<char,1024> buffer(paraEnd - paraStart + 1);
+
+ Sci_CharacterRange charRange;
+ charRange.cpMin = paraStart;
+ charRange.cpMax = paraEnd;
+
+ Sci_TextRange textRange;
+ textRange.chrg = charRange;
+ textRange.lpstrText = buffer.data();
+
+ send(SCI_GETTEXTRANGE, 0, (sptr_t)&textRange);
+
+ return sqt->StringFromDocument(buffer.constData());
+ }
+
+ case Qt::ImCurrentSelection:
+ {
+ QVarLengthArray<char,1024> buffer(send(SCI_GETSELTEXT));
+ send(SCI_GETSELTEXT, 0, (sptr_t)buffer.data());
+
+ return sqt->StringFromDocument(buffer.constData());
+ }
+
+ default:
+ return QVariant();
+ }
+}
+
+void ScintillaEditBase::notifyParent(SCNotification scn)
+{
+ emit notify(&scn);
+ switch (scn.nmhdr.code) {
+ case SCN_STYLENEEDED:
+ emit styleNeeded(scn.position);
+ break;
+
+ case SCN_CHARADDED:
+ emit charAdded(scn.ch);
+ break;
+
+ case SCN_SAVEPOINTREACHED:
+ emit savePointChanged(false);
+ break;
+
+ case SCN_SAVEPOINTLEFT:
+ emit savePointChanged(true);
+ break;
+
+ case SCN_MODIFYATTEMPTRO:
+ emit modifyAttemptReadOnly();
+ break;
+
+ case SCN_KEY:
+ emit key(scn.ch);
+ break;
+
+ case SCN_DOUBLECLICK:
+ emit doubleClick(scn.position, scn.line);
+ break;
+
+ case SCN_UPDATEUI:
+ emit updateUi();
+ break;
+
+ case SCN_MODIFIED:
+ {
+ bool added = scn.modificationType & SC_MOD_INSERTTEXT;
+ bool deleted = scn.modificationType & SC_MOD_DELETETEXT;
+
+ int length = send(SCI_GETTEXTLENGTH);
+ bool firstLineAdded = (added && length == 1) ||
+ (deleted && length == 0);
+
+ if (scn.linesAdded != 0) {
+ emit linesAdded(scn.linesAdded);
+ } else if (firstLineAdded) {
+ emit linesAdded(added ? 1 : -1);
+ }
+
+ const QByteArray bytes = QByteArray::fromRawData(scn.text, scn.length);
+ emit modified(scn.modificationType, scn.position, scn.length,
+ scn.linesAdded, bytes, scn.line,
+ scn.foldLevelNow, scn.foldLevelPrev);
+ break;
+ }
+
+ case SCN_MACRORECORD:
+ emit macroRecord(scn.message, scn.wParam, scn.lParam);
+ break;
+
+ case SCN_MARGINCLICK:
+ emit marginClicked(scn.position, scn.modifiers, scn.margin);
+ break;
+
+ case SCN_NEEDSHOWN:
+ emit needShown(scn.position, scn.length);
+ break;
+
+ case SCN_PAINTED:
+ emit painted();
+ break;
+
+ case SCN_USERLISTSELECTION:
+ emit userListSelection();
+ break;
+
+ case SCN_URIDROPPED:
+ emit uriDropped();
+ break;
+
+ case SCN_DWELLSTART:
+ emit dwellStart(scn.x, scn.y);
+ break;
+
+ case SCN_DWELLEND:
+ emit dwellEnd(scn.x, scn.y);
+ break;
+
+ case SCN_ZOOM:
+ emit zoom(send(SCI_GETZOOM));
+ break;
+
+ case SCN_HOTSPOTCLICK:
+ emit hotSpotClick(scn.position, scn.modifiers);
+ break;
+
+ case SCN_HOTSPOTDOUBLECLICK:
+ emit hotSpotDoubleClick(scn.position, scn.modifiers);
+ break;
+
+ case SCN_CALLTIPCLICK:
+ emit callTipClick();
+ break;
+
+ case SCN_AUTOCSELECTION:
+ emit autoCompleteSelection(scn.lParam, QString::fromUtf8(scn.text));
+ break;
+
+ case SCN_AUTOCCANCELLED:
+ emit autoCompleteCancelled();
+ break;
+
+ default:
+ return;
+ }
+}
+
+void ScintillaEditBase::event_command(uptr_t wParam, sptr_t lParam)
+{
+ emit command(wParam, lParam);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.h b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.h
new file mode 100644
index 00000000000..c4453334c4c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.h
@@ -0,0 +1,156 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// ScintillaWidget.h - Qt widget that wraps ScintillaQt and provides events and scrolling
+
+
+#ifndef SCINTILLAEDITBASE_H
+#define SCINTILLAEDITBASE_H
+
+#include "Platform.h"
+#include "Scintilla.h"
+
+#include <QAbstractScrollArea>
+#include <QMimeData>
+#include <QTime>
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class ScintillaQt;
+class SurfaceImpl;
+struct SCNotification;
+
+#ifdef WIN32
+#ifdef MAKING_LIBRARY
+#define EXPORT_IMPORT_API __declspec(dllexport)
+#else
+// Defining dllimport upsets moc
+#define EXPORT_IMPORT_API __declspec(dllimport)
+//#define EXPORT_IMPORT_API
+#endif
+#else
+#define EXPORT_IMPORT_API
+#endif
+
+class EXPORT_IMPORT_API ScintillaEditBase : public QAbstractScrollArea {
+ Q_OBJECT
+
+public:
+ explicit ScintillaEditBase(QWidget *parent = 0);
+ virtual ~ScintillaEditBase();
+
+ virtual sptr_t send(
+ unsigned int iMessage,
+ uptr_t wParam = 0,
+ sptr_t lParam = 0) const;
+
+ virtual sptr_t sends(
+ unsigned int iMessage,
+ uptr_t wParam = 0,
+ const char *s = 0) const;
+
+public slots:
+ // Scroll events coming from GUI to be sent to Scintilla.
+ void scrollHorizontal(int value);
+ void scrollVertical(int value);
+
+ // Emit Scintilla notifications as signals.
+ void notifyParent(SCNotification scn);
+ void event_command(uptr_t wParam, sptr_t lParam);
+
+signals:
+ void horizontalScrolled(int value);
+ void verticalScrolled(int value);
+ void horizontalRangeChanged(int max, int page);
+ void verticalRangeChanged(int max, int page);
+ void notifyChange();
+ void linesAdded(int linesAdded);
+
+ // Clients can use this hook to add additional
+ // formats (e.g. rich text) to the MIME data.
+ void aboutToCopy(QMimeData *data);
+
+ // Scintilla Notifications
+ void styleNeeded(int position);
+ void charAdded(int ch);
+ void savePointChanged(bool dirty);
+ void modifyAttemptReadOnly();
+ void key(int key);
+ void doubleClick(int position, int line);
+ void updateUi();
+ void modified(int type, int position, int length, int linesAdded,
+ const QByteArray &text, int line, int foldNow, int foldPrev);
+ void macroRecord(int message, uptr_t wParam, sptr_t lParam);
+ void marginClicked(int position, int modifiers, int margin);
+ void textAreaClicked(int line, int modifiers);
+ void needShown(int position, int length);
+ void painted();
+ void userListSelection(); // Wants some args.
+ void uriDropped(); // Wants some args.
+ void dwellStart(int x, int y);
+ void dwellEnd(int x, int y);
+ void zoom(int zoom);
+ void hotSpotClick(int position, int modifiers);
+ void hotSpotDoubleClick(int position, int modifiers);
+ void callTipClick();
+ void autoCompleteSelection(int position, const QString &text);
+ void autoCompleteCancelled();
+
+ // Base notifications for compatibility with other Scintilla implementations
+ void notify(SCNotification *pscn);
+ void command(uptr_t wParam, sptr_t lParam);
+
+ // GUI event notifications needed under Qt
+ void buttonPressed(QMouseEvent *event);
+ void buttonReleased(QMouseEvent *event);
+ void keyPressed(QKeyEvent *event);
+ void resized();
+
+protected:
+ virtual bool event(QEvent *event);
+ virtual void paintEvent(QPaintEvent *event);
+ virtual void wheelEvent(QWheelEvent *event);
+ virtual void focusInEvent(QFocusEvent *event);
+ virtual void focusOutEvent(QFocusEvent *event);
+ virtual void resizeEvent(QResizeEvent *event);
+ virtual void keyPressEvent(QKeyEvent *event);
+ virtual void mousePressEvent(QMouseEvent *event);
+ virtual void mouseReleaseEvent(QMouseEvent *event);
+ virtual void mouseDoubleClickEvent(QMouseEvent *event);
+ virtual void mouseMoveEvent(QMouseEvent *event);
+ virtual void contextMenuEvent(QContextMenuEvent *event);
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dragLeaveEvent(QDragLeaveEvent *event);
+ virtual void dragMoveEvent(QDragMoveEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+ virtual void inputMethodEvent(QInputMethodEvent *event);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ virtual void scrollContentsBy(int, int) {}
+
+private:
+ ScintillaQt *sqt;
+
+ QTime time;
+
+ int preeditPos;
+ QString preeditString;
+
+ int wheelDelta;
+
+ static bool IsHangul(const QChar qchar);
+ void MoveImeCarets(int offset);
+ void DrawImeIndicator(int indicator, int len);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif /* SCINTILLAEDITBASE_H */
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro
new file mode 100644
index 00000000000..93dda6e793d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro
@@ -0,0 +1,121 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2011-05-05T12:41:23
+#
+#-------------------------------------------------
+
+QT += core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = ScintillaEditBase
+TEMPLATE = lib
+CONFIG += lib_bundle
+
+VERSION = 3.5.6
+
+SOURCES += \
+ PlatQt.cpp \
+ ScintillaQt.cpp \
+ ScintillaEditBase.cpp \
+ ../../src/XPM.cxx \
+ ../../src/ViewStyle.cxx \
+ ../../src/UniConversion.cxx \
+ ../../src/Style.cxx \
+ ../../src/Selection.cxx \
+ ../../src/ScintillaBase.cxx \
+ ../../src/RunStyles.cxx \
+ ../../src/RESearch.cxx \
+ ../../src/PositionCache.cxx \
+ ../../src/PerLine.cxx \
+ ../../src/MarginView.cxx \
+ ../../src/LineMarker.cxx \
+ ../../src/KeyMap.cxx \
+ ../../src/Indicator.cxx \
+ ../../src/ExternalLexer.cxx \
+ ../../src/EditView.cxx \
+ ../../src/Editor.cxx \
+ ../../src/EditModel.cxx \
+ ../../src/Document.cxx \
+ ../../src/Decoration.cxx \
+ ../../src/ContractionState.cxx \
+ ../../src/CharClassify.cxx \
+ ../../src/CellBuffer.cxx \
+ ../../src/Catalogue.cxx \
+ ../../src/CaseFolder.cxx \
+ ../../src/CaseConvert.cxx \
+ ../../src/CallTip.cxx \
+ ../../src/AutoComplete.cxx \
+ ../../lexlib/WordList.cxx \
+ ../../lexlib/StyleContext.cxx \
+ ../../lexlib/PropSetSimple.cxx \
+ ../../lexlib/LexerSimple.cxx \
+ ../../lexlib/LexerNoExceptions.cxx \
+ ../../lexlib/LexerModule.cxx \
+ ../../lexlib/LexerBase.cxx \
+ ../../lexlib/CharacterSet.cxx \
+ ../../lexlib/Accessor.cxx \
+ ../../lexlib/CharacterCategory.cxx \
+ ../../lexers/*.cxx
+
+HEADERS += \
+ PlatQt.h \
+ ScintillaQt.h \
+ ScintillaEditBase.h \
+ ../../src/XPM.h \
+ ../../src/ViewStyle.h \
+ ../../src/UniConversion.h \
+ ../../src/UnicodeFromUTF8.h \
+ ../../src/Style.h \
+ ../../src/SplitVector.h \
+ ../../src/Selection.h \
+ ../../src/ScintillaBase.h \
+ ../../src/RunStyles.h \
+ ../../src/RESearch.h \
+ ../../src/PositionCache.h \
+ ../../src/PerLine.h \
+ ../../src/Partitioning.h \
+ ../../src/LineMarker.h \
+ ../../src/KeyMap.h \
+ ../../src/Indicator.h \
+ ../../src/FontQuality.h \
+ ../../src/ExternalLexer.h \
+ ../../src/Editor.h \
+ ../../src/Document.h \
+ ../../src/Decoration.h \
+ ../../src/ContractionState.h \
+ ../../src/CharClassify.h \
+ ../../src/CellBuffer.h \
+ ../../src/Catalogue.h \
+ ../../src/CaseFolder.h \
+ ../../src/CaseConvert.h \
+ ../../src/CallTip.h \
+ ../../src/AutoComplete.h \
+ ../../include/Scintilla.h \
+ ../../include/SciLexer.h \
+ ../../include/Platform.h \
+ ../../include/ILexer.h \
+ ../../lexlib/WordList.h \
+ ../../lexlib/StyleContext.h \
+ ../../lexlib/SparseState.h \
+ ../../lexlib/PropSetSimple.h \
+ ../../lexlib/OptionSet.h \
+ ../../lexlib/LexerSimple.h \
+ ../../lexlib/LexerNoExceptions.h \
+ ../../lexlib/LexerModule.h \
+ ../../lexlib/LexerBase.h \
+ ../../lexlib/LexAccessor.h \
+ ../../lexlib/CharacterSet.h \
+ ../../lexlib/CharacterCategory.h \
+ ../../lexlib/Accessor.h
+
+OTHER_FILES +=
+
+INCLUDEPATH += ../../include ../../src ../../lexlib
+
+DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1
+
+DESTDIR = ../../bin
+
+macx {
+ QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp
new file mode 100644
index 00000000000..3b7db80023f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp
@@ -0,0 +1,766 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// ScintillaQt.cpp - Qt specific subclass of ScintillaBase
+
+#include "PlatQt.h"
+#include "ScintillaQt.h"
+#ifdef SCI_LEXER
+#include "LexerModule.h"
+#include "ExternalLexer.h"
+#endif
+
+#include <QApplication>
+#include <QDrag>
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QInputContext>
+#endif
+#include <QMimeData>
+#include <QMenu>
+#include <QScrollBar>
+#include <QTimer>
+#include <QTextCodec>
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+ScintillaQt::ScintillaQt(QAbstractScrollArea *parent)
+: QObject(parent), scrollArea(parent), vMax(0), hMax(0), vPage(0), hPage(0),
+ haveMouseCapture(false), dragWasDropped(false)
+{
+
+ wMain = scrollArea->viewport();
+
+ imeInteraction = imeInline;
+
+ // On OS X drawing text into a pixmap moves it around 1 pixel to
+ // the right compared to drawing it directly onto a window.
+ // Buffered drawing turned off by default to avoid this.
+ WndProc(SCI_SETBUFFEREDDRAW, false, 0);
+
+ Initialise();
+
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ timers[tr] = 0;
+ }
+}
+
+ScintillaQt::~ScintillaQt()
+{
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ FineTickerCancel(tr);
+ }
+ SetIdle(false);
+}
+
+void ScintillaQt::execCommand(QAction *action)
+{
+ int command = action->data().toInt();
+ Command(command);
+}
+
+#if defined(Q_OS_WIN)
+static const QString sMSDEVColumnSelect("MSDEVColumnSelect");
+static const QString sWrappedMSDEVColumnSelect("application/x-qt-windows-mime;value=\"MSDEVColumnSelect\"");
+#elif defined(Q_OS_MAC)
+static const QString sScintillaRecPboardType("com.scintilla.utf16-plain-text.rectangular");
+static const QString sScintillaRecMimeType("text/x-scintilla.utf16-plain-text.rectangular");
+#else
+// Linux
+static const QString sMimeRectangularMarker("text/x-rectangular-marker");
+#endif
+
+#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+
+class ScintillaRectangularMime : public QMacPasteboardMime {
+public:
+ ScintillaRectangularMime() : QMacPasteboardMime(MIME_ALL) {
+ }
+
+ QString convertorName() {
+ return QString("ScintillaRectangularMime");
+ }
+
+ bool canConvert(const QString &mime, QString flav) {
+ return mimeFor(flav) == mime;
+ }
+
+ QString mimeFor(QString flav) {
+ if (flav == sScintillaRecPboardType)
+ return sScintillaRecMimeType;
+ return QString();
+ }
+
+ QString flavorFor(const QString &mime) {
+ if (mime == sScintillaRecMimeType)
+ return sScintillaRecPboardType;
+ return QString();
+ }
+
+ QVariant convertToMime(const QString & /* mime */, QList<QByteArray> data, QString /* flav */) {
+ QByteArray all;
+ foreach (QByteArray i, data) {
+ all += i;
+ }
+ return QVariant(all);
+ }
+
+ QList<QByteArray> convertFromMime(const QString & /* mime */, QVariant data, QString /* flav */) {
+ QByteArray a = data.toByteArray();
+ QList<QByteArray> l;
+ l.append(a);
+ return l;
+ }
+
+};
+
+// The Mime object registers itself but only want one for all Scintilla instances.
+// Should delete at exit to help memory leak detection but that would be extra work
+// and, since the clipboard exists after last Scintilla instance, may be complex.
+static ScintillaRectangularMime *singletonMime = 0;
+
+#endif
+
+void ScintillaQt::Initialise()
+{
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
+ rectangularSelectionModifier = SCMOD_ALT;
+#else
+ rectangularSelectionModifier = SCMOD_CTRL;
+#endif
+
+#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ if (!singletonMime) {
+ singletonMime = new ScintillaRectangularMime();
+
+ QStringList slTypes(sScintillaRecPboardType);
+ qRegisterDraggedTypes(slTypes);
+ }
+#endif
+
+ connect(QApplication::clipboard(), SIGNAL(selectionChanged()),
+ this, SLOT(SelectionChanged()));
+}
+
+void ScintillaQt::Finalise()
+{
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ FineTickerCancel(tr);
+ }
+ ScintillaBase::Finalise();
+}
+
+void ScintillaQt::SelectionChanged()
+{
+ bool nowPrimary = QApplication::clipboard()->ownsSelection();
+ if (nowPrimary != primarySelection) {
+ primarySelection = nowPrimary;
+ Redraw();
+ }
+}
+
+bool ScintillaQt::DragThreshold(Point ptStart, Point ptNow)
+{
+ int xMove = std::abs(ptStart.x - ptNow.x);
+ int yMove = std::abs(ptStart.y - ptNow.y);
+ return (xMove > QApplication::startDragDistance()) ||
+ (yMove > QApplication::startDragDistance());
+}
+
+static QString StringFromSelectedText(const SelectionText &selectedText)
+{
+ if (selectedText.codePage == SC_CP_UTF8) {
+ return QString::fromUtf8(selectedText.Data(), static_cast<int>(selectedText.Length()));
+ } else {
+ QTextCodec *codec = QTextCodec::codecForName(
+ CharacterSetID(selectedText.characterSet));
+ return codec->toUnicode(selectedText.Data(), static_cast<int>(selectedText.Length()));
+ }
+}
+
+static void AddRectangularToMime(QMimeData *mimeData, QString su)
+{
+#if defined(Q_OS_WIN)
+ // Add an empty marker
+ mimeData->setData(sMSDEVColumnSelect, QByteArray());
+#elif defined(Q_OS_MAC)
+ // OS X gets marker + data to work with other implementations.
+ // Don't understand how this works but it does - the
+ // clipboard format is supposed to be UTF-16, not UTF-8.
+ mimeData->setData(sScintillaRecMimeType, su.toUtf8());
+#else
+ Q_UNUSED(su);
+ // Linux
+ // Add an empty marker
+ mimeData->setData(sMimeRectangularMarker, QByteArray());
+#endif
+}
+
+static bool IsRectangularInMime(const QMimeData *mimeData)
+{
+ QStringList formats = mimeData->formats();
+ for (int i = 0; i < formats.size(); ++i) {
+#if defined(Q_OS_WIN)
+ // Windows rectangular markers
+ // If rectangular copies made by this application, see base name.
+ if (formats[i] == sMSDEVColumnSelect)
+ return true;
+ // Otherwise see wrapped name.
+ if (formats[i] == sWrappedMSDEVColumnSelect)
+ return true;
+#elif defined(Q_OS_MAC)
+ if (formats[i] == sScintillaRecMimeType)
+ return true;
+#else
+ // Linux
+ if (formats[i] == sMimeRectangularMarker)
+ return true;
+#endif
+ }
+ return false;
+}
+
+bool ScintillaQt::ValidCodePage(int codePage) const
+{
+ return codePage == 0
+ || codePage == SC_CP_UTF8
+ || codePage == 932
+ || codePage == 936
+ || codePage == 949
+ || codePage == 950
+ || codePage == 1361;
+}
+
+
+void ScintillaQt::ScrollText(int linesToMove)
+{
+ int dy = vs.lineHeight * (linesToMove);
+ scrollArea->viewport()->scroll(0, dy);
+}
+
+void ScintillaQt::SetVerticalScrollPos()
+{
+ scrollArea->verticalScrollBar()->setValue(topLine);
+ emit verticalScrolled(topLine);
+}
+
+void ScintillaQt::SetHorizontalScrollPos()
+{
+ scrollArea->horizontalScrollBar()->setValue(xOffset);
+ emit horizontalScrolled(xOffset);
+}
+
+bool ScintillaQt::ModifyScrollBars(int nMax, int nPage)
+{
+ bool modified = false;
+
+ int vNewPage = nPage;
+ int vNewMax = nMax - vNewPage + 1;
+ if (vMax != vNewMax || vPage != vNewPage) {
+ vMax = vNewMax;
+ vPage = vNewPage;
+ modified = true;
+
+ scrollArea->verticalScrollBar()->setMaximum(vMax);
+ scrollArea->verticalScrollBar()->setPageStep(vPage);
+ emit verticalRangeChanged(vMax, vPage);
+ }
+
+ int hNewPage = GetTextRectangle().Width();
+ int hNewMax = (scrollWidth > hNewPage) ? scrollWidth - hNewPage : 0;
+ int charWidth = vs.styles[STYLE_DEFAULT].aveCharWidth;
+ if (hMax != hNewMax || hPage != hNewPage ||
+ scrollArea->horizontalScrollBar()->singleStep() != charWidth) {
+ hMax = hNewMax;
+ hPage = hNewPage;
+ modified = true;
+
+ scrollArea->horizontalScrollBar()->setMaximum(hMax);
+ scrollArea->horizontalScrollBar()->setPageStep(hPage);
+ scrollArea->horizontalScrollBar()->setSingleStep(charWidth);
+ emit horizontalRangeChanged(hMax, hPage);
+ }
+
+ return modified;
+}
+
+void ScintillaQt::ReconfigureScrollBars()
+{
+ if (verticalScrollBarVisible) {
+ scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ } else {
+ scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ }
+
+ if (horizontalScrollBarVisible && !Wrapping()) {
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ } else {
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ }
+}
+
+void ScintillaQt::CopyToModeClipboard(const SelectionText &selectedText, QClipboard::Mode clipboardMode_)
+{
+ QClipboard *clipboard = QApplication::clipboard();
+ clipboard->clear(clipboardMode_);
+ QString su = StringFromSelectedText(selectedText);
+ QMimeData *mimeData = new QMimeData();
+ mimeData->setText(su);
+ if (selectedText.rectangular) {
+ AddRectangularToMime(mimeData, su);
+ }
+
+ // Allow client code to add additional data (e.g rich text).
+ emit aboutToCopy(mimeData);
+
+ clipboard->setMimeData(mimeData, clipboardMode_);
+}
+
+void ScintillaQt::Copy()
+{
+ if (!sel.Empty()) {
+ SelectionText st;
+ CopySelectionRange(&st);
+ CopyToClipboard(st);
+ }
+}
+
+void ScintillaQt::CopyToClipboard(const SelectionText &selectedText)
+{
+ CopyToModeClipboard(selectedText, QClipboard::Clipboard);
+}
+
+void ScintillaQt::PasteFromMode(QClipboard::Mode clipboardMode_)
+{
+ QClipboard *clipboard = QApplication::clipboard();
+ const QMimeData *mimeData = clipboard->mimeData(clipboardMode_);
+ bool isRectangular = IsRectangularInMime(mimeData);
+ QString text = clipboard->text(clipboardMode_);
+ QByteArray utext = BytesForDocument(text);
+ std::string dest(utext.constData(), utext.length());
+ SelectionText selText;
+ selText.Copy(dest, pdoc->dbcsCodePage, CharacterSetOfDocument(), isRectangular, false);
+
+ UndoGroup ug(pdoc);
+ ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH);
+ InsertPasteShape(selText.Data(), static_cast<int>(selText.Length()),
+ selText.rectangular ? pasteRectangular : pasteStream);
+ EnsureCaretVisible();
+}
+
+void ScintillaQt::Paste()
+{
+ PasteFromMode(QClipboard::Clipboard);
+}
+
+void ScintillaQt::ClaimSelection()
+{
+ if (QApplication::clipboard()->supportsSelection()) {
+ // X Windows has a 'primary selection' as well as the clipboard.
+ // Whenever the user selects some text, we become the primary selection
+ if (!sel.Empty()) {
+ primarySelection = true;
+ SelectionText st;
+ CopySelectionRange(&st);
+ CopyToModeClipboard(st, QClipboard::Selection);
+ } else {
+ primarySelection = false;
+ }
+ }
+}
+
+void ScintillaQt::NotifyChange()
+{
+ emit notifyChange();
+ emit command(
+ Platform::LongFromTwoShorts(GetCtrlID(), SCEN_CHANGE),
+ reinterpret_cast<sptr_t>(wMain.GetID()));
+}
+
+void ScintillaQt::NotifyFocus(bool focus)
+{
+ emit command(
+ Platform::LongFromTwoShorts
+ (GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),
+ reinterpret_cast<sptr_t>(wMain.GetID()));
+
+ Editor::NotifyFocus(focus);
+}
+
+void ScintillaQt::NotifyParent(SCNotification scn)
+{
+ scn.nmhdr.hwndFrom = wMain.GetID();
+ scn.nmhdr.idFrom = GetCtrlID();
+ emit notifyParent(scn);
+}
+
+/**
+* Report that this Editor subclass has a working implementation of FineTickerStart.
+*/
+bool ScintillaQt::FineTickerAvailable()
+{
+ return true;
+}
+
+bool ScintillaQt::FineTickerRunning(TickReason reason)
+{
+ return timers[reason] != 0;
+}
+
+void ScintillaQt::FineTickerStart(TickReason reason, int millis, int /* tolerance */)
+{
+ FineTickerCancel(reason);
+ timers[reason] = startTimer(millis);
+}
+
+void ScintillaQt::FineTickerCancel(TickReason reason)
+{
+ if (timers[reason]) {
+ killTimer(timers[reason]);
+ timers[reason] = 0;
+ }
+}
+
+void ScintillaQt::onIdle()
+{
+ bool continueIdling = Idle();
+ if (!continueIdling) {
+ SetIdle(false);
+ }
+}
+
+bool ScintillaQt::SetIdle(bool on)
+{
+ QTimer *qIdle;
+ if (on) {
+ // Start idler, if it's not running.
+ if (!idler.state) {
+ idler.state = true;
+ qIdle = new QTimer;
+ connect(qIdle, SIGNAL(timeout()), this, SLOT(onIdle()));
+ qIdle->start(0);
+ idler.idlerID = qIdle;
+ }
+ } else {
+ // Stop idler, if it's running
+ if (idler.state) {
+ idler.state = false;
+ qIdle = static_cast<QTimer *>(idler.idlerID);
+ qIdle->stop();
+ disconnect(qIdle, SIGNAL(timeout()), 0, 0);
+ delete qIdle;
+ idler.idlerID = 0;
+ }
+ }
+ return true;
+}
+
+int ScintillaQt::CharacterSetOfDocument() const
+{
+ return vs.styles[STYLE_DEFAULT].characterSet;
+}
+
+const char *ScintillaQt::CharacterSetIDOfDocument() const
+{
+ return CharacterSetID(CharacterSetOfDocument());
+}
+
+QString ScintillaQt::StringFromDocument(const char *s) const
+{
+ if (IsUnicodeMode()) {
+ return QString::fromUtf8(s);
+ } else {
+ QTextCodec *codec = QTextCodec::codecForName(
+ CharacterSetID(CharacterSetOfDocument()));
+ return codec->toUnicode(s);
+ }
+}
+
+QByteArray ScintillaQt::BytesForDocument(const QString &text) const
+{
+ if (IsUnicodeMode()) {
+ return text.toUtf8();
+ } else {
+ QTextCodec *codec = QTextCodec::codecForName(
+ CharacterSetID(CharacterSetOfDocument()));
+ return codec->fromUnicode(text);
+ }
+}
+
+
+class CaseFolderDBCS : public CaseFolderTable {
+ QTextCodec *codec;
+public:
+ explicit CaseFolderDBCS(QTextCodec *codec_) : codec(codec_) {
+ StandardASCII();
+ }
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if ((lenMixed == 1) && (sizeFolded > 0)) {
+ folded[0] = mapping[static_cast<unsigned char>(mixed[0])];
+ return 1;
+ } else if (codec) {
+ QString su = codec->toUnicode(mixed, static_cast<int>(lenMixed));
+ QString suFolded = su.toCaseFolded();
+ QByteArray bytesFolded = codec->fromUnicode(suFolded);
+
+ if (bytesFolded.length() < static_cast<int>(sizeFolded)) {
+ memcpy(folded, bytesFolded, bytesFolded.length());
+ return bytesFolded.length();
+ }
+ }
+ // Something failed so return a single NUL byte
+ folded[0] = '\0';
+ return 1;
+ }
+};
+
+CaseFolder *ScintillaQt::CaseFolderForEncoding()
+{
+ if (pdoc->dbcsCodePage == SC_CP_UTF8) {
+ return new CaseFolderUnicode();
+ } else {
+ const char *charSetBuffer = CharacterSetIDOfDocument();
+ if (charSetBuffer) {
+ if (pdoc->dbcsCodePage == 0) {
+ CaseFolderTable *pcf = new CaseFolderTable();
+ pcf->StandardASCII();
+ QTextCodec *codec = QTextCodec::codecForName(charSetBuffer);
+ // Only for single byte encodings
+ for (int i=0x80; i<0x100; i++) {
+ char sCharacter[2] = "A";
+ sCharacter[0] = i;
+ QString su = codec->toUnicode(sCharacter, 1);
+ QString suFolded = su.toCaseFolded();
+ QByteArray bytesFolded = codec->fromUnicode(suFolded);
+ if (bytesFolded.length() == 1) {
+ pcf->SetTranslation(sCharacter[0], bytesFolded[0]);
+ }
+ }
+ return pcf;
+ } else {
+ return new CaseFolderDBCS(QTextCodec::codecForName(charSetBuffer));
+ }
+ }
+ return 0;
+ }
+}
+
+std::string ScintillaQt::CaseMapString(const std::string &s, int caseMapping)
+{
+ if ((s.size() == 0) || (caseMapping == cmSame))
+ return s;
+
+ if (IsUnicodeMode()) {
+ std::string retMapped(s.length() * maxExpansionCaseConversion, 0);
+ size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(),
+ (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower);
+ retMapped.resize(lenMapped);
+ return retMapped;
+ }
+
+ QTextCodec *codec = QTextCodec::codecForName(CharacterSetIDOfDocument());
+ QString text = codec->toUnicode(s.c_str(), static_cast<int>(s.length()));
+
+ if (caseMapping == cmUpper) {
+ text = text.toUpper();
+ } else {
+ text = text.toLower();
+ }
+
+ QByteArray bytes = BytesForDocument(text);
+ return std::string(bytes.data(), bytes.length());
+}
+
+void ScintillaQt::SetMouseCapture(bool on)
+{
+ // This is handled automatically by Qt
+ if (mouseDownCaptures) {
+ haveMouseCapture = on;
+ }
+}
+
+bool ScintillaQt::HaveMouseCapture()
+{
+ return haveMouseCapture;
+}
+
+void ScintillaQt::StartDrag()
+{
+ inDragDrop = ddDragging;
+ dropWentOutside = true;
+ if (drag.Length()) {
+ QMimeData *mimeData = new QMimeData;
+ QString sText = StringFromSelectedText(drag);
+ mimeData->setText(sText);
+ if (drag.rectangular) {
+ AddRectangularToMime(mimeData, sText);
+ }
+ // This QDrag is not freed as that causes a crash on Linux
+ QDrag *dragon = new QDrag(scrollArea);
+ dragon->setMimeData(mimeData);
+
+ Qt::DropAction dropAction = dragon->exec(Qt::CopyAction|Qt::MoveAction);
+ if ((dropAction == Qt::MoveAction) && dropWentOutside) {
+ // Remove dragged out text
+ ClearSelection();
+ }
+ }
+ inDragDrop = ddNone;
+ SetDragPosition(SelectionPosition(invalidPosition));
+}
+
+void ScintillaQt::CreateCallTipWindow(PRectangle rc)
+{
+
+ if (!ct.wCallTip.Created()) {
+ QWidget *pCallTip = new QWidget(0, Qt::ToolTip);
+ ct.wCallTip = pCallTip;
+ pCallTip->move(rc.left, rc.top);
+ pCallTip->resize(rc.Width(), rc.Height());
+ }
+}
+
+void ScintillaQt::AddToPopUp(const char *label,
+ int cmd,
+ bool enabled)
+{
+ QMenu *menu = static_cast<QMenu *>(popup.GetID());
+ QString text(label);
+
+ if (text.isEmpty()) {
+ menu->addSeparator();
+ } else {
+ QAction *action = menu->addAction(text);
+ action->setData(cmd);
+ action->setEnabled(enabled);
+ }
+
+ // Make sure the menu's signal is connected only once.
+ menu->disconnect();
+ connect(menu, SIGNAL(triggered(QAction *)),
+ this, SLOT(execCommand(QAction *)));
+}
+
+sptr_t ScintillaQt::WndProc(unsigned int message, uptr_t wParam, sptr_t lParam)
+{
+ try {
+ switch (message) {
+
+ case SCI_SETIMEINTERACTION:
+ // Only inline IME supported on Qt
+ break;
+
+ case SCI_GRABFOCUS:
+ scrollArea->setFocus(Qt::OtherFocusReason);
+ break;
+
+ case SCI_GETDIRECTFUNCTION:
+ return reinterpret_cast<sptr_t>(DirectFunction);
+
+ case SCI_GETDIRECTPOINTER:
+ return reinterpret_cast<sptr_t>(this);
+
+#ifdef SCI_LEXER
+ case SCI_LOADLEXERLIBRARY:
+ LexerManager::GetInstance()->Load(reinterpret_cast<const char *>(lParam));
+ break;
+#endif
+
+ default:
+ return ScintillaBase::WndProc(message, wParam, lParam);
+ }
+ } catch (std::bad_alloc &) {
+ errorStatus = SC_STATUS_BADALLOC;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return 0l;
+}
+
+sptr_t ScintillaQt::DefWndProc(unsigned int, uptr_t, sptr_t)
+{
+ return 0;
+}
+
+sptr_t ScintillaQt::DirectFunction(
+ sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+{
+ return reinterpret_cast<ScintillaQt *>(ptr)->WndProc(iMessage, wParam, lParam);
+}
+
+// Additions to merge in Scientific Toolworks widget structure
+
+void ScintillaQt::PartialPaint(const PRectangle &rect)
+{
+ rcPaint = rect;
+ paintState = painting;
+ PRectangle rcClient = GetClientRectangle();
+ paintingAllText = rcPaint.Contains(rcClient);
+
+ AutoSurface surface(this);
+ Paint(surface, rcPaint);
+ surface->Release();
+
+ if (paintState == paintAbandoned) {
+ // FIXME: Failure to paint the requested rectangle in each
+ // paint event causes flicker on some platforms (Mac?)
+ // Paint rect immediately.
+ paintState = painting;
+ paintingAllText = true;
+
+ AutoSurface surface(this);
+ Paint(surface, rcPaint);
+ surface->Release();
+
+ // Queue a full repaint.
+ scrollArea->viewport()->update();
+ }
+
+ paintState = notPainting;
+}
+
+void ScintillaQt::DragEnter(const Point &point)
+{
+ SetDragPosition(SPositionFromLocation(point,
+ false, false, UserVirtualSpace()));
+}
+
+void ScintillaQt::DragMove(const Point &point)
+{
+ SetDragPosition(SPositionFromLocation(point,
+ false, false, UserVirtualSpace()));
+}
+
+void ScintillaQt::DragLeave()
+{
+ SetDragPosition(SelectionPosition(invalidPosition));
+}
+
+void ScintillaQt::Drop(const Point &point, const QMimeData *data, bool move)
+{
+ QString text = data->text();
+ bool rectangular = IsRectangularInMime(data);
+ QByteArray bytes = BytesForDocument(text);
+ int len = bytes.length();
+
+ SelectionPosition movePos = SPositionFromLocation(point,
+ false, false, UserVirtualSpace());
+
+ DropAt(movePos, bytes, len, move, rectangular);
+}
+
+void ScintillaQt::timerEvent(QTimerEvent *event)
+{
+ for (TickReason tr=tickCaret; tr<=tickDwell; tr = static_cast<TickReason>(tr+1)) {
+ if (timers[tr] == event->timerId()) {
+ TickFor(tr);
+ }
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.h b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.h
new file mode 100644
index 00000000000..c83411edf41
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.h
@@ -0,0 +1,171 @@
+//
+// Copyright (c) 1990-2011, Scientific Toolworks, Inc.
+//
+// The License.txt file describes the conditions under which this software may be distributed.
+//
+// Author: Jason Haslam
+//
+// Additions Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+// ScintillaQt.h - Qt specific subclass of ScintillaBase
+
+#ifndef SCINTILLAQT_H
+#define SCINTILLAQT_H
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+#include <time.h>
+#include <cmath>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "Scintilla.h"
+#include "Platform.h"
+#include "ILexer.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "AutoComplete.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+#include "ScintillaBase.h"
+#include "CaseConvert.h"
+
+#ifdef SCI_LEXER
+#include "SciLexer.h"
+#include "PropSetSimple.h"
+#endif
+
+#include <QObject>
+#include <QAbstractScrollArea>
+#include <QAction>
+#include <QClipboard>
+#include <QPaintEvent>
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class ScintillaQt : public QObject, public ScintillaBase {
+ Q_OBJECT
+
+public:
+ explicit ScintillaQt(QAbstractScrollArea *parent);
+ virtual ~ScintillaQt();
+
+signals:
+ void horizontalScrolled(int value);
+ void verticalScrolled(int value);
+ void horizontalRangeChanged(int max, int page);
+ void verticalRangeChanged(int max, int page);
+
+ void notifyParent(SCNotification scn);
+ void notifyChange();
+
+ // Clients can use this hook to add additional
+ // formats (e.g. rich text) to the MIME data.
+ void aboutToCopy(QMimeData *data);
+
+ void command(uptr_t wParam, sptr_t lParam);
+
+private slots:
+ void onIdle();
+ void execCommand(QAction *action);
+ void SelectionChanged();
+
+private:
+ virtual void Initialise();
+ virtual void Finalise();
+ virtual bool DragThreshold(Point ptStart, Point ptNow);
+ virtual bool ValidCodePage(int codePage) const;
+
+private:
+ virtual void ScrollText(int linesToMove);
+ virtual void SetVerticalScrollPos();
+ virtual void SetHorizontalScrollPos();
+ virtual bool ModifyScrollBars(int nMax, int nPage);
+ virtual void ReconfigureScrollBars();
+ void CopyToModeClipboard(const SelectionText &selectedText, QClipboard::Mode clipboardMode_);
+ virtual void Copy();
+ virtual void CopyToClipboard(const SelectionText &selectedText);
+ void PasteFromMode(QClipboard::Mode clipboardMode_);
+ virtual void Paste();
+ virtual void ClaimSelection();
+ virtual void NotifyChange();
+ virtual void NotifyFocus(bool focus);
+ virtual void NotifyParent(SCNotification scn);
+ int timers[tickDwell+1];
+ virtual bool FineTickerAvailable();
+ virtual bool FineTickerRunning(TickReason reason);
+ virtual void FineTickerStart(TickReason reason, int millis, int tolerance);
+ virtual void FineTickerCancel(TickReason reason);
+ virtual bool SetIdle(bool on);
+ virtual void SetMouseCapture(bool on);
+ virtual bool HaveMouseCapture();
+ virtual void StartDrag();
+ int CharacterSetOfDocument() const;
+ const char *CharacterSetIDOfDocument() const;
+ QString StringFromDocument(const char *s) const;
+ QByteArray BytesForDocument(const QString &text) const;
+ virtual CaseFolder *CaseFolderForEncoding();
+ virtual std::string CaseMapString(const std::string &s, int caseMapping);
+
+ virtual void CreateCallTipWindow(PRectangle rc);
+ virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
+ virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ static sptr_t DirectFunction(sptr_t ptr,
+ unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+protected:
+
+ void PartialPaint(const PRectangle &rect);
+
+ void DragEnter(const Point &point);
+ void DragMove(const Point &point);
+ void DragLeave();
+ void Drop(const Point &point, const QMimeData *data, bool move);
+
+ void timerEvent(QTimerEvent *event);
+
+private:
+ QAbstractScrollArea *scrollArea;
+
+ int vMax, hMax; // Scroll bar maximums.
+ int vPage, hPage; // Scroll bar page sizes.
+
+ bool haveMouseCapture;
+ bool dragWasDropped;
+ int rectangularSelectionModifier;
+
+ friend class ScintillaEditBase;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif // SCINTILLAQT_H
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/README b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/README
new file mode 100644
index 00000000000..4e4a63d8d79
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/README
@@ -0,0 +1,86 @@
+README for building of ScintillaEditPy on Qt with PySide
+
+This directory is for building a Python encapsulation of Scintilla for use
+with PySide. For C++ libraries see the README in the parent directory.
+
+ Prerequisites
+
+PySide and ScintillaEditPy currently only support Python 2.x.
+
+CMake may be used to rebuild PySide and is required on Windows.
+It can be downloaded from
+http://www.cmake.org/cmake/resources/software.html
+
+On Windows, PySide only supports Visual C++ 2008. The "Visual Studio 2008
+Command Prompt" should be used to run all build commands.
+Visual C++ 2008 Express Edition can be downloaded from
+http://msdn.microsoft.com/en-us/express/future/bb421473
+
+Download and install PySide. Instructions are on the PySide web site
+http://developer.qt.nokia.com/wiki/Category:LanguageBindings::PySide::Downloads
+
+For Linux, there may be both PySide library packages and PySide development
+files. Both should be installed as ScintillaEditPy needs the headers and
+libraries from the development package and runs with the normal library package.
+On apt-based systems, the packages are libshiboken-dev, shiboken, libpyside-dev,
+and python-pyside. python-dev is also needed for Python language headers.
+On yum-based systems the packages are shiboken-devel, python-pyside-devel,
+and python-devel.
+The qmake program may not be in the path and can be found with
+"find /usr -name qmake".
+
+On Windows, the PySide library packages can be downloaded from
+http://developer.qt.nokia.com/wiki/PySide_Binaries_Windows
+The PySide development files must be built from source using CMake as
+described on the PySide site. This will create a Unix-style set of [bin, include,
+lib, and share] directories in packaging\setuptools\install-py<ver>-qt<qver>.
+There is no standard place for the PySide development files so copy them
+to "\usr", creating it if needed.
+
+On OS X, a combined package with PySide libraries and PySide development
+files can be downloaded from
+http://developer.qt.nokia.com/wiki/PySide_Binaries_MacOSX
+This package works best in combination with the Qt libraries for Mac from
+http://qt.nokia.com/downloads/downloads#qt-lib
+
+The path should be modified so that a Python 2.x interpreter and Qt's "qmake"
+program can be run by typing "python" or "qmake".
+
+ Building
+
+There are several steps to building and they are encapsulated in the sepbuild.py
+script which is run:
+
+python sepbuild.py
+
+This script first runs the WidgetGen.py script to fill out the ScintillaEdit.h,
+ScintillaEdit.cpp and ScintillaConstants.py files.
+
+A short file "sepbuild.pri" is written out which contains a series of version and
+path properties discovered by sepbuild.py which are used by qmake.
+
+Then it runs PySide's "shiboken" program to create C++ code that will act as a
+bridge between Python and the C++ libraries. This code goes into the
+ScintillaEditPy/ScintillaEditPy directory. Several log files are produced which can
+help uncover problems in the bridge if it fails to build.
+
+The qmake program is run to produce make files from ScintillaEditPy.pro.
+
+The system make program is then run to build the library. The library is located in
+the scintilla/bin directory as ScintillaEditPy.so for Unix systems and
+ScintillaEditPy.pyd for Windows.
+
+A demonstration program can be run:
+
+python testsepq.py
+
+The individual steps in the script can be run manually if wanted although the
+shiboken program has complex arguments and differs between systems so run
+sepbuild.py and copy the section starting with a line containing "generatorrunner"
+and continuing to "typesystem_ScintillaEdit.xml".
+
+On Windows, it is more difficult to set up an environment to debug ScintillaEditPy
+since all the libraries have to be debug or all have to be release. The easy path
+is to always build for release with "nmake release".
+
+To remove generated code, run "python sepbuild.py --clean".
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaConstants.py.template b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaConstants.py.template
new file mode 100644
index 00000000000..31b82398d3a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaConstants.py.template
@@ -0,0 +1,6 @@
+# ScintillaConstants.py
+# Define all the symbolic constants from Scintilla.iface so Python code can use them
+# Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
+
+# ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+# --Autogenerated -- end of section automatically generated from Scintilla.iface */
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaEditPy.pro b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaEditPy.pro
new file mode 100644
index 00000000000..4eb968c0316
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/ScintillaEditPy.pro
@@ -0,0 +1,121 @@
+TEMPLATE = lib
+QT += core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = ScintillaEditPy
+
+# Clear debug & release so that sepbuild.pri can set one or the other
+CONFIG -= debug release
+
+include(sepbuild.pri)
+
+VERSION = $$SCINTILLA_VERSION
+
+win32 {
+ DebugBuild {
+ TARGET_EXT = _d.pyd
+ }
+ else {
+ TARGET_EXT = .pyd
+ }
+}
+
+INCLUDEPATH += ../ScintillaEdit
+INCLUDEPATH += ../ScintillaEditBase
+INCLUDEPATH += ../../include ../../lexlib ../../src
+
+INCLUDEPATH += $$PY_INCLUDES
+
+INCLUDEPATH += $$SHIBOKEN_INCLUDES
+INCLUDEPATH += $$PYSIDE_INCLUDES
+INCLUDEPATH += $$PYSIDE_INCLUDES/QtCore
+INCLUDEPATH += $$PYSIDE_INCLUDES/QtGui
+
+unix:!mac {
+ LIBS += `pkg-config pyside --libs`
+}
+unix:linux-* {
+ # gcc on freebsd 9.2, at least, doesn't support -Wno-empty-body
+ QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-empty-body
+ LIBS += -ldl
+}
+
+macx {
+ # Only build for x64 for now
+ # QMAKE_CFLAGS = -arch i386 -arch x86_64
+ # QMAKE_CXXFLAGS = -arch i386 -arch x86_64
+ # QMAKE_LFLAGS = -arch i386 -arch x86_64
+ LIBS += -L$$PY_LIBDIR -lpython$$PY_VERSION_SUFFIX
+ LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB
+ debug {
+ LIBS += -lshiboken-python$$PY_VERSION_SUFFIX-dbg
+ LIBS += -lpyside-python$$PY_VERSION_SUFFIX-dbg
+ }
+ else {
+ LIBS += -lshiboken-python$$PY_VERSION_SUFFIX
+ LIBS += -lpyside-python$$PY_VERSION_SUFFIX
+ }
+}
+
+win32 {
+ DebugBuild {
+ DEFINES += DEBUG
+ LIBS += -lQtCored4
+ }
+ else {
+ LIBS += -lQtCore
+ }
+ LIBS += -L$$PY_PREFIX/libs # Note python lib is pulled in via a #pragma
+ LIBS += -L$$PYSIDE_LIB -L$$SHIBOKEN_LIB
+ # PySide uses x.y suffix on Windows even though Python uses xy
+ DebugBuild {
+ LIBS += -lshiboken-python$${PY_VERSION}_d
+ LIBS += -lpyside-python$${PY_VERSION}_d
+ }
+ else {
+ LIBS += -lshiboken-python$${PY_VERSION}
+ LIBS += -lpyside-python$${PY_VERSION}
+ }
+}
+
+# Wrapper sources; notifyheader commented out due to shiboken bug
+SOURCES += \
+ ScintillaEditPy/scintillaeditpy_module_wrapper.cpp \
+ ScintillaEditPy/sci_notifyheader_wrapper.cpp \
+ ScintillaEditPy/scnotification_wrapper.cpp \
+ ScintillaEditPy/scintillaeditbase_wrapper.cpp \
+ ScintillaEditPy/scintillaedit_wrapper.cpp \
+ ScintillaEditPy/scintilladocument_wrapper.cpp
+
+# ScintillaEdit sources
+
+SOURCES += \
+ ../ScintillaEdit/ScintillaEdit.cpp \
+ ../ScintillaEdit/ScintillaDocument.cpp \
+ ../ScintillaEditBase/PlatQt.cpp \
+ ../ScintillaEditBase/ScintillaQt.cpp \
+ ../ScintillaEditBase/ScintillaEditBase.cpp \
+ ../../src/*.cxx \
+ ../../lexlib/*.cxx \
+ ../../lexers/*.cxx
+
+# HEADERS is used to find what needs to be run through moc
+HEADERS += \
+ ../ScintillaEdit/ScintillaEdit.h \
+ ../ScintillaEdit/ScintillaDocument.h \
+ ../ScintillaEditBase/ScintillaQt.h \
+ ../ScintillaEditBase/ScintillaEditBase.h
+
+DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1
+
+DESTDIR = ../../bin
+
+unix:!mac {
+ # Rename to not have 'lib' at start
+ QMAKE_POST_LINK += rm -rf ../../bin/ScintillaEditPy.so && ln -s libScintillaEditPy.so ../../bin/ScintillaEditPy.so
+}
+
+macx {
+ # Rename to .so and not have 'lib' at start
+ QMAKE_POST_LINK += rm -rf ../../bin/ScintillaEditPy.so && ln -s libScintillaEditPy.dylib ../../bin/ScintillaEditPy.so
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/global.h b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/global.h
new file mode 100644
index 00000000000..8b4be843a9e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/global.h
@@ -0,0 +1,4 @@
+#include "pyside_global.h"
+
+#include "ScintillaEditBase.h"
+#include "ScintillaEdit.h"
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/sepbuild.py b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/sepbuild.py
new file mode 100644
index 00000000000..c399eb3e9fd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/sepbuild.py
@@ -0,0 +1,340 @@
+import distutils.sysconfig
+import getopt
+import glob
+import os
+import platform
+import shutil
+import subprocess
+import stat
+import sys
+
+sys.path.append(os.path.join("..", "ScintillaEdit"))
+import WidgetGen
+
+scintillaDirectory = "../.."
+scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
+sys.path.append(scintillaScriptsDirectory)
+from FileGenerator import GenerateFile
+
+# Decide up front which platform, treat anything other than Windows or OS X as Linux
+PLAT_WINDOWS = platform.system() == "Windows"
+PLAT_DARWIN = platform.system() == "Darwin"
+PLAT_LINUX = not (PLAT_DARWIN or PLAT_WINDOWS)
+
+def IsFileNewer(name1, name2):
+ """ Returns whether file with name1 is newer than file with name2. Returns 1
+ if name2 doesn't exist. """
+
+ if not os.path.exists(name1):
+ return 0
+
+ if not os.path.exists(name2):
+ return 1
+
+ mod_time1 = os.stat(name1)[stat.ST_MTIME]
+ mod_time2 = os.stat(name2)[stat.ST_MTIME]
+ return (mod_time1 > mod_time2)
+
+def textFromRun(args):
+ proc = subprocess.Popen(args, shell=isinstance(args, str), stdout=subprocess.PIPE)
+ (stdoutdata, stderrdata) = proc.communicate()
+ if proc.returncode:
+ raise OSError(proc.returncode)
+ return stdoutdata
+
+def runProgram(args, exitOnFailure):
+ print(" ".join(args))
+ retcode = subprocess.call(" ".join(args), shell=True, stderr=subprocess.STDOUT)
+ if retcode:
+ print("Failed in " + " ".join(args) + " return code = " + str(retcode))
+ if exitOnFailure:
+ sys.exit()
+
+def usage():
+ print("sepbuild.py [-h|--help][-c|--clean][-u|--underscore-names]")
+ print("")
+ print("Generate PySide wappers and build them.")
+ print("")
+ print("options:")
+ print("")
+ print("-c --clean remove all object and generated files")
+ print("-b --pyside-base Location of the PySide+Qt4 sandbox to use")
+ print("-h --help display this text")
+ print("-d --debug=yes|no force debug build (or non-debug build)")
+ print("-u --underscore-names use method_names consistent with GTK+ standards")
+
+modifyFunctionElement = """ <modify-function signature="%s">%s
+ </modify-function>"""
+
+injectCode = """
+ <inject-code class="target" position="beginning">%s
+ </inject-code>"""
+
+injectCheckN = """
+ if (!cppArg%d) {
+ PyErr_SetString(PyExc_ValueError, "Null string argument");
+ return 0;
+ }"""
+
+def methodSignature(name, v, options):
+ argTypes = ""
+ p1Type = WidgetGen.cppAlias(v["Param1Type"])
+ if p1Type == "int":
+ p1Type = "sptr_t"
+ if p1Type:
+ argTypes = argTypes + p1Type
+ p2Type = WidgetGen.cppAlias(v["Param2Type"])
+ if p2Type == "int":
+ p2Type = "sptr_t"
+ if p2Type and v["Param2Type"] != "stringresult":
+ if p1Type:
+ argTypes = argTypes + ", "
+ argTypes = argTypes + p2Type
+ methodName = WidgetGen.normalisedName(name, options, v["FeatureType"])
+ constDeclarator = " const" if v["FeatureType"] == "get" else ""
+ return methodName + "(" + argTypes + ")" + constDeclarator
+
+def printTypeSystemFile(f, options):
+ out = []
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ feat = v["FeatureType"]
+ if feat in ["fun", "get", "set"]:
+ checks = ""
+ if v["Param1Type"] == "string":
+ checks = checks + (injectCheckN % 0)
+ if v["Param2Type"] == "string":
+ if v["Param1Type"] == "": # Only arg 2 -> treat as first
+ checks = checks + (injectCheckN % 0)
+ else:
+ checks = checks + (injectCheckN % 1)
+ if checks:
+ inject = injectCode % checks
+ out.append(modifyFunctionElement % (methodSignature(name, v, options), inject))
+ #if v["Param1Type"] == "string":
+ # out.append("<string-xml>" + name + "</string-xml>\n")
+ return out
+
+def doubleBackSlashes(s):
+ # Quote backslashes so qmake does not produce warnings
+ return s.replace("\\", "\\\\")
+
+class SepBuilder:
+ def __init__(self):
+ # Discover configuration parameters
+ self.ScintillaEditIncludes = [".", "../ScintillaEdit", "../ScintillaEditBase", "../../include"]
+ if PLAT_WINDOWS:
+ self.MakeCommand = "nmake"
+ self.MakeTarget = "release"
+ else:
+ self.MakeCommand = "make"
+ self.MakeTarget = ""
+
+ if PLAT_DARWIN:
+ self.QMakeOptions = "-spec macx-g++"
+ else:
+ self.QMakeOptions = ""
+
+ # Default to debug build if running in a debug build interpreter
+ self.DebugBuild = hasattr(sys, 'getobjects')
+
+ # Python
+ self.PyVersion = "%d.%d" % sys.version_info[:2]
+ self.PyVersionSuffix = distutils.sysconfig.get_config_var("VERSION")
+ self.PyIncludes = distutils.sysconfig.get_python_inc()
+ self.PyPrefix = distutils.sysconfig.get_config_var("prefix")
+ self.PyLibDir = distutils.sysconfig.get_config_var(
+ ("LIBDEST" if sys.platform == 'win32' else "LIBDIR"))
+
+ # Scintilla
+ with open("../../version.txt") as f:
+ version = f.read()
+ self.ScintillaVersion = version[0] + '.' + version[1] + '.' + version[2]
+
+ # Find out what qmake is called
+ self.QMakeCommand = "qmake"
+ if not PLAT_WINDOWS:
+ # On Unix qmake may not be present but qmake-qt4 may be so check
+ pathToQMake = textFromRun("which qmake-qt4 || which qmake").rstrip()
+ self.QMakeCommand = os.path.basename(pathToQMake)
+
+ # Qt default location from qmake
+ self._SetQtIncludeBase(textFromRun(self.QMakeCommand + " -query QT_INSTALL_HEADERS").rstrip())
+
+ # PySide default location
+ # No standard for installing PySide development headers and libs on Windows so
+ # choose /usr to be like Linux
+ self._setPySideBase('\\usr' if PLAT_WINDOWS else '/usr')
+
+ self.ProInclude = "sepbuild.pri"
+
+ self.qtStyleInterface = True
+
+ def _setPySideBase(self, base):
+
+ self.PySideBase = base
+ def _try_pkgconfig(var, package, *relpath):
+ try:
+ return textFromRun(["pkg-config", "--variable=" + var, package]).rstrip()
+ except OSError:
+ return os.path.join(self.PySideBase, *relpath)
+ self.PySideTypeSystem = _try_pkgconfig("typesystemdir", "pyside",
+ "share", "PySide", "typesystems")
+ self.PySideIncludeBase = _try_pkgconfig("includedir", "pyside",
+ "include", "PySide")
+ self.ShibokenIncludeBase = _try_pkgconfig("includedir", "shiboken",
+ "include", "shiboken")
+ self.PySideIncludes = [
+ self.ShibokenIncludeBase,
+ self.PySideIncludeBase,
+ os.path.join(self.PySideIncludeBase, "QtCore"),
+ os.path.join(self.PySideIncludeBase, "QtGui")]
+
+ self.PySideLibDir = _try_pkgconfig("libdir", "pyside", "lib")
+ self.ShibokenLibDir = _try_pkgconfig("libdir", "shiboken", "lib")
+ self.AllIncludes = os.pathsep.join(self.QtIncludes + self.ScintillaEditIncludes + self.PySideIncludes)
+
+ self.ShibokenGenerator = "shiboken"
+ # Is this still needed? It doesn't work with latest shiboken sources
+ #if PLAT_DARWIN:
+ # # On OS X, can not automatically find Shiboken dylib so provide a full path
+ # self.ShibokenGenerator = os.path.join(self.PySideLibDir, "generatorrunner", "shiboken")
+
+ def generateAPI(self, args):
+ os.chdir(os.path.join("..", "ScintillaEdit"))
+ if not self.qtStyleInterface:
+ args.insert(0, '--underscore-names')
+ WidgetGen.main(args)
+ f = WidgetGen.readInterface(False)
+ os.chdir(os.path.join("..", "ScintillaEditPy"))
+ options = {"qtStyle": self.qtStyleInterface}
+ GenerateFile("typesystem_ScintillaEdit.xml.template", "typesystem_ScintillaEdit.xml",
+ "<!-- ", True, printTypeSystemFile(f, options))
+
+ def runGenerator(self):
+ generatorrunner = "shiboken"
+ for name in ('shiboken', 'generatorrunner'):
+ if PLAT_WINDOWS:
+ name += '.exe'
+ name = os.path.join(self.PySideBase, "bin", name)
+ if os.path.exists(name):
+ generatorrunner = name
+ break
+
+ args = [
+ generatorrunner,
+ "--generator-set=" + self.ShibokenGenerator,
+ "global.h ",
+ "--avoid-protected-hack",
+ "--enable-pyside-extensions",
+ "--include-paths=" + self.AllIncludes,
+ "--typesystem-paths=" + self.PySideTypeSystem,
+ "--output-directory=.",
+ "typesystem_ScintillaEdit.xml"]
+ print(" ".join(args))
+ retcode = subprocess.call(" ".join(args), shell=True, stderr=subprocess.STDOUT)
+ if retcode:
+ print("Failed in generatorrunner", retcode)
+ sys.exit()
+
+ def writeVariables(self):
+ # Write variables needed into file to be included from project so it does not have to discover much
+ with open(self.ProInclude, "w") as f:
+ f.write("SCINTILLA_VERSION=" + self.ScintillaVersion + "\n")
+ f.write("PY_VERSION=" + self.PyVersion + "\n")
+ f.write("PY_VERSION_SUFFIX=" + self.PyVersionSuffix + "\n")
+ f.write("PY_PREFIX=" + doubleBackSlashes(self.PyPrefix) + "\n")
+ f.write("PY_INCLUDES=" + doubleBackSlashes(self.PyIncludes) + "\n")
+ f.write("PY_LIBDIR=" + doubleBackSlashes(self.PyLibDir) + "\n")
+ f.write("PYSIDE_INCLUDES=" + doubleBackSlashes(self.PySideIncludeBase) + "\n")
+ f.write("PYSIDE_LIB=" + doubleBackSlashes(self.PySideLibDir) + "\n")
+ f.write("SHIBOKEN_INCLUDES=" + doubleBackSlashes(self.ShibokenIncludeBase) + "\n")
+ f.write("SHIBOKEN_LIB=" + doubleBackSlashes(self.ShibokenLibDir) + "\n")
+ if self.DebugBuild:
+ f.write("CONFIG += debug\n")
+ else:
+ f.write("CONFIG += release\n")
+
+ def make(self):
+ runProgram([self.QMakeCommand, self.QMakeOptions], exitOnFailure=True)
+ runProgram([self.MakeCommand, self.MakeTarget], exitOnFailure=True)
+
+ def cleanEverything(self):
+ self.generateAPI(["--clean"])
+ runProgram([self.MakeCommand, "distclean"], exitOnFailure=False)
+ filesToRemove = [self.ProInclude, "typesystem_ScintillaEdit.xml",
+ "../../bin/ScintillaEditPy.so", "../../bin/ScintillaConstants.py"]
+ for file in filesToRemove:
+ try:
+ os.remove(file)
+ except OSError:
+ pass
+ for logFile in glob.glob("*.log"):
+ try:
+ os.remove(logFile)
+ except OSError:
+ pass
+ shutil.rmtree("debug", ignore_errors=True)
+ shutil.rmtree("release", ignore_errors=True)
+ shutil.rmtree("ScintillaEditPy", ignore_errors=True)
+
+ def buildEverything(self):
+ cleanGenerated = False
+ opts, args = getopt.getopt(sys.argv[1:], "hcdub",
+ ["help", "clean", "debug=",
+ "underscore-names", "pyside-base="])
+ for opt, arg in opts:
+ if opt in ("-h", "--help"):
+ usage()
+ sys.exit()
+ elif opt in ("-c", "--clean"):
+ cleanGenerated = True
+ elif opt in ("-d", "--debug"):
+ self.DebugBuild = (arg == '' or arg.lower() == 'yes')
+ if self.DebugBuild and sys.platform == 'win32':
+ self.MakeTarget = 'debug'
+ elif opt in ("-b", '--pyside-base'):
+ self._SetQtIncludeBase(os.path.join(os.path.normpath(arg), 'include'))
+ self._setPySideBase(os.path.normpath(arg))
+ elif opt in ("-u", "--underscore-names"):
+ self.qtStyleInterface = False
+
+ if cleanGenerated:
+ self.cleanEverything()
+ else:
+ self.writeVariables()
+ self.generateAPI([""])
+ self.runGenerator()
+ self.make()
+ self.copyScintillaConstants()
+
+ def copyScintillaConstants(self):
+
+ orig = 'ScintillaConstants.py'
+ dest = '../../bin/' + orig
+ if IsFileNewer(dest, orig):
+ return
+
+ f = open(orig, 'r')
+ contents = f.read()
+ f.close()
+
+ f = open(dest, 'w')
+ f.write(contents)
+ f.close()
+
+ def _SetQtIncludeBase(self, base):
+
+ self.QtIncludeBase = base
+ self.QtIncludes = [self.QtIncludeBase] + [os.path.join(self.QtIncludeBase, sub) for sub in ["QtCore", "QtGui"]]
+ # Set path so correct qmake is found
+ path = os.environ.get('PATH', '').split(os.pathsep)
+ qt_bin_dir = os.path.join(os.path.dirname(base), 'bin')
+ if qt_bin_dir not in path:
+ path.insert(0, qt_bin_dir)
+ os.environ['PATH'] = os.pathsep.join(path)
+
+if __name__ == "__main__":
+ sepBuild = SepBuilder()
+ sepBuild.buildEverything()
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/testsepq.py b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/testsepq.py
new file mode 100644
index 00000000000..840562a11d8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/testsepq.py
@@ -0,0 +1,157 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import sys
+
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+import ScintillaConstants as sci
+
+sys.path.append("../..")
+from bin import ScintillaEditPy
+
+txtInit = "int main(int argc, char **argv) {\n" \
+ " // Start up the gnome\n" \
+ " gnome_init(\"stest\", \"1.0\", argc, argv);\n}\n";
+
+keywords = \
+ "and and_eq asm auto bitand bitor bool break " \
+ "case catch char class compl const const_cast continue " \
+ "default delete do double dynamic_cast else enum explicit export extern false float for " \
+ "friend goto if inline int long mutable namespace new not not_eq " \
+ "operator or or_eq private protected public " \
+ "register reinterpret_cast return short signed sizeof static static_cast struct switch " \
+ "template this throw true try typedef typeid typename union unsigned using " \
+ "virtual void volatile wchar_t while xor xor_eq";
+
+def uriDropped():
+ print "uriDropped"
+
+class Form(QDialog):
+
+ def __init__(self, parent=None):
+ super(Form, self).__init__(parent)
+ self.resize(460,300)
+ # Create widgets
+ self.edit = ScintillaEditPy.ScintillaEdit(self)
+ self.edit.uriDropped.connect(uriDropped)
+ self.edit.command.connect(self.receive_command)
+ self.edit.notify.connect(self.receive_notification)
+
+ self.edit.styleClearAll()
+ self.edit.setMarginWidthN(0, 35)
+ self.edit.setScrollWidth(200)
+ self.edit.setScrollWidthTracking(1)
+ self.edit.setLexer(sci.SCLEX_CPP)
+ self.edit.styleSetFore(sci.SCE_C_COMMENT, 0x008000)
+ self.edit.styleSetFore(sci.SCE_C_COMMENTLINE, 0x008000)
+ self.edit.styleSetFore(sci.SCE_C_COMMENTDOC, 0x008040)
+ self.edit.styleSetItalic(sci.SCE_C_COMMENTDOC, 1)
+ self.edit.styleSetFore(sci.SCE_C_NUMBER, 0x808000)
+ self.edit.styleSetFore(sci.SCE_C_WORD, 0x800000)
+ self.edit.styleSetBold(sci.SCE_C_WORD, True)
+ self.edit.styleSetFore(sci.SCE_C_STRING, 0x800080)
+ self.edit.styleSetFore(sci.SCE_C_PREPROCESSOR, 0x008080)
+ self.edit.styleSetBold(sci.SCE_C_OPERATOR, True)
+ self.edit.setMultipleSelection(1)
+ self.edit.setVirtualSpaceOptions(
+ sci.SCVS_RECTANGULARSELECTION | sci.SCVS_USERACCESSIBLE)
+ self.edit.setAdditionalSelectionTyping(1)
+
+ self.edit.styleSetFore(sci.STYLE_INDENTGUIDE, 0x808080)
+ self.edit.setIndentationGuides(sci.SC_IV_LOOKBOTH)
+
+ self.edit.setKeyWords(0, keywords)
+ self.edit.addText(len(txtInit), txtInit)
+ self.edit.setSel(1,10)
+ retriever = str(self.edit.getLine(1))
+ print(type(retriever), len(retriever))
+ print('[' + retriever + ']')
+ someText = str(self.edit.textRange(2,5))
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.getCurLine(100)
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.styleFont(1)
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.getSelText()
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.tag(1)
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.autoCCurrentText()
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.annotationText(1)
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.annotationStyles(1)
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.describeKeyWordSets()
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.propertyNames()
+ print(len(someText), '[' + someText + ']')
+ self.edit.setProperty("fold", "1")
+ someText = self.edit.property("fold")
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.propertyExpanded("fold")
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.lexerLanguage()
+ print(len(someText), '[' + someText + ']')
+ someText = self.edit.describeProperty("styling.within.preprocessor")
+ print(len(someText), '[' + someText + ']')
+
+ xx = self.edit.findText(0, "main", 0, 25)
+ print(type(xx), xx)
+ print("isBold", self.edit.styleBold(sci.SCE_C_WORD))
+
+ # Retrieve the document and write into it
+ doc = self.edit.get_doc()
+ doc.insert_string(40, "***")
+ stars = doc.get_char_range(40,3)
+ assert stars == "***"
+
+ # Create a new independent document and attach it to the editor
+ doc = ScintillaEditPy.ScintillaDocument()
+ doc.insert_string(0, "/***/\nif(a)\n")
+ self.edit.set_doc(doc)
+ self.edit.setLexer(sci.SCLEX_CPP)
+
+ def Call(self, message, wParam=0, lParam=0):
+ return self.edit.send(message, wParam, lParam)
+
+ def resizeEvent(self, e):
+ self.edit.resize(e.size().width(), e.size().height())
+
+ def receive_command(self, wParam, lParam):
+ # Show underline at start when focussed
+ notifyCode = wParam >> 16
+ if (notifyCode == sci.SCEN_SETFOCUS) or (notifyCode == sci.SCEN_KILLFOCUS):
+ self.edit.setIndicatorCurrent(sci.INDIC_CONTAINER);
+ self.edit.indicatorClearRange(0, self.edit.length())
+ if notifyCode == sci.SCEN_SETFOCUS:
+ self.edit.indicatorFillRange(0, 2);
+
+ def receive_notification(self, scn):
+ if scn.nmhdr.code == sci.SCN_CHARADDED:
+ print "Char %02X" % scn.ch
+ elif scn.nmhdr.code == sci.SCN_SAVEPOINTREACHED:
+ print "Saved"
+ elif scn.nmhdr.code == sci.SCN_SAVEPOINTLEFT:
+ print "Unsaved"
+ elif scn.nmhdr.code == sci.SCN_MODIFIED:
+ print "Modified"
+ elif scn.nmhdr.code == sci.SCN_UPDATEUI:
+ print "Update UI"
+ elif scn.nmhdr.code == sci.SCN_PAINTED:
+ #print "Painted"
+ pass
+ else:
+ print "Notification", scn.nmhdr.code
+ pass
+
+if __name__ == '__main__':
+ # Create the Qt Application
+ app = QApplication(sys.argv)
+ # Create and show the form
+ form = Form()
+ form.show()
+ # Run the main Qt loop
+ sys.exit(app.exec_())
diff --git a/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template
new file mode 100644
index 00000000000..f9f166e56dc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/typesystem_ScintillaEdit.xml.template
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<typesystem package="ScintillaEditPy">
+ <load-typesystem name="typesystem_core.xml" generate="no" />
+ <load-typesystem name="typesystem_gui_common.xml" generate="no"/>
+ <primitive-type name="sptr_t"/>
+ <primitive-type name="uptr_t"/>
+ <value-type name="Sci_NotifyHeader" />
+ <rejection class="Sci_NotifyHeader" field-name="hwndFrom" />
+ <value-type name="SCNotification" />
+ <object-type name="ScintillaEditBase" />
+ <object-type name="ScintillaEdit">
+ <!-- ++Autogenerated start of section automatically generated from Scintilla.iface -->
+ <!-- ~~Autogenerated end of section automatically generated from Scintilla.iface -->
+
+ <!-- Custom implementation of get and set_margin_mask_n: mask is defined
+ as an int but is really a bitfield and the numeric value can be
+ greater than max value of an int -->
+ <modify-function signature="set_margin_mask_n(sptr_t, sptr_t)">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned long mask = PyInt_AsUnsignedLongMask(%PYARG_2);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+
+ %CPPSELF-&gt;set_margin_mask_n(margin, static_cast&lt;int&gt;(mask));
+ Py_RETURN_NONE;
+ </inject-code>
+ </modify-function>
+ <modify-function signature="get_margin_mask_n(sptr_t) const">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned int mask = (unsigned int)%CPPSELF-&gt;get_margin_mask_n(margin);
+ %PYARG_0 = PyInt_FromSize_t(mask);
+ </inject-code>
+ </modify-function>
+ <modify-function signature="setMarginMaskN(sptr_t, sptr_t)">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned long mask = PyInt_AsUnsignedLongMask(%PYARG_2);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+
+ %CPPSELF-&gt;setMarginMaskN(margin, static_cast&lt;int&gt;(mask));
+ Py_RETURN_NONE;
+ </inject-code>
+ </modify-function>
+ <modify-function signature="marginMaskN(sptr_t) const">
+ <inject-code>
+ int margin = PyInt_AsLong(%PYARG_1);
+ if (margin == -1 &amp;&amp; PyErr_Occurred())
+ return NULL;
+ unsigned int mask = (unsigned int)%CPPSELF-&gt;marginMaskN(margin);
+ %PYARG_0 = PyInt_FromSize_t(mask);
+ </inject-code>
+ </modify-function>
+
+ </object-type>
+ <object-type name="ScintillaDocument" />
+</typesystem>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/Face.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/Face.py
new file mode 100644
index 00000000000..17d161fd79d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/Face.py
@@ -0,0 +1,117 @@
+# Face.py - module for reading and parsing Scintilla.iface file
+# Implemented 2000 by Neil Hodgson neilh@scintilla.org
+# Released to the public domain.
+# Requires Python 2.5 or later
+
+def sanitiseLine(line):
+ if line[-1:] == '\n': line = line[:-1]
+ if line.find("##") != -1:
+ line = line[:line.find("##")]
+ line = line.strip()
+ return line
+
+def decodeFunction(featureVal):
+ retType, rest = featureVal.split(" ", 1)
+ nameIdent, params = rest.split("(")
+ name, value = nameIdent.split("=")
+ params, rest = params.split(")")
+ param1, param2 = params.split(",")
+ return retType, name, value, param1, param2
+
+def decodeEvent(featureVal):
+ retType, rest = featureVal.split(" ", 1)
+ nameIdent, params = rest.split("(")
+ name, value = nameIdent.split("=")
+ return retType, name, value
+
+def decodeParam(p):
+ param = p.strip()
+ type = ""
+ name = ""
+ value = ""
+ if " " in param:
+ type, nv = param.split(" ")
+ if "=" in nv:
+ name, value = nv.split("=")
+ else:
+ name = nv
+ return type, name, value
+
+class Face:
+
+ def __init__(self):
+ self.order = []
+ self.features = {}
+ self.values = {}
+ self.events = {}
+
+ def ReadFromFile(self, name):
+ currentCategory = ""
+ currentComment = []
+ currentCommentFinished = 0
+ file = open(name)
+ for line in file.readlines():
+ line = sanitiseLine(line)
+ if line:
+ if line[0] == "#":
+ if line[1] == " ":
+ if currentCommentFinished:
+ currentComment = []
+ currentCommentFinished = 0
+ currentComment.append(line[2:])
+ else:
+ currentCommentFinished = 1
+ featureType, featureVal = line.split(" ", 1)
+ if featureType in ["fun", "get", "set"]:
+ try:
+ retType, name, value, param1, param2 = decodeFunction(featureVal)
+ except ValueError:
+ print("Failed to decode %s" % line)
+ raise
+ p1 = decodeParam(param1)
+ p2 = decodeParam(param2)
+ self.features[name] = {
+ "FeatureType": featureType,
+ "ReturnType": retType,
+ "Value": value,
+ "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2],
+ "Param2Type": p2[0], "Param2Name": p2[1], "Param2Value": p2[2],
+ "Category": currentCategory, "Comment": currentComment
+ }
+ if value in self.values:
+ raise Exception("Duplicate value " + value + " " + name)
+ self.values[value] = 1
+ self.order.append(name)
+ elif featureType == "evt":
+ retType, name, value = decodeEvent(featureVal)
+ self.features[name] = {
+ "FeatureType": featureType,
+ "ReturnType": retType,
+ "Value": value,
+ "Category": currentCategory, "Comment": currentComment
+ }
+ if value in self.events:
+ raise Exception("Duplicate event " + value + " " + name)
+ self.events[value] = 1
+ self.order.append(name)
+ elif featureType == "cat":
+ currentCategory = featureVal
+ elif featureType == "val":
+ try:
+ name, value = featureVal.split("=", 1)
+ except ValueError:
+ print("Failure %s" % featureVal)
+ raise Exception()
+ self.features[name] = {
+ "FeatureType": featureType,
+ "Category": currentCategory,
+ "Value": value }
+ self.order.append(name)
+ elif featureType == "enu" or featureType == "lex":
+ name, value = featureVal.split("=", 1)
+ self.features[name] = {
+ "FeatureType": featureType,
+ "Category": currentCategory,
+ "Value": value }
+ self.order.append(name)
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/FileGenerator.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/FileGenerator.py
new file mode 100644
index 00000000000..01a79bf99be
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/FileGenerator.py
@@ -0,0 +1,158 @@
+#!/usr/bin/env python
+# FileGenerator.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
+# Released to the public domain.
+
+# Generate or regenerate source files based on comments in those files.
+# May be modified in-place or a template may be generated into a complete file.
+# Requires Python 2.5 or later
+# The files are copied to a string apart from sections between a
+# ++Autogenerated comment and a --Autogenerated comment which is
+# generated by the CopyWithInsertion function. After the whole string is
+# instantiated, it is compared with the target file and if different the file
+# is rewritten.
+
+from __future__ import with_statement
+
+import codecs, os, re, string, sys
+
+lineEnd = "\r\n" if sys.platform == "win32" else "\n"
+
+def UpdateFile(filename, updated):
+ """ If the file contents are different to updated then copy updated into the
+ file else leave alone so Mercurial and make don't treat it as modified. """
+ newOrChanged = "Changed"
+ try:
+ with codecs.open(filename, "r", "utf-8") as infile:
+ original = infile.read()
+ if updated == original:
+ # Same as before so don't write
+ return
+ os.unlink(filename)
+ except IOError: # File is not there yet
+ newOrChanged = "New"
+ with codecs.open(filename, "w", "utf-8") as outfile:
+ outfile.write(updated)
+ print("%s %s" % (newOrChanged, filename))
+
+# Automatically generated sections contain start and end comments,
+# a definition line and the results.
+# The results are replaced by regenerating based on the definition line.
+# The definition line is a comment prefix followed by "**".
+# If there is a digit after the ** then this indicates which list to use
+# and the digit and next character are not part of the definition
+# Backslash is used as an escape within the definition line.
+# The part between \( and \) is repeated for each item in the list.
+# \* is replaced by each list item. \t, and \n are tab and newline.
+# If there is no definition line than the first list is copied verbatim.
+# If retainDefs then the comments controlling generation are copied.
+def CopyWithInsertion(input, commentPrefix, retainDefs, lists):
+ copying = 1
+ generated = False
+ listid = 0
+ output = []
+ for line in input.splitlines(0):
+ isStartGenerated = line.lstrip().startswith(commentPrefix + "++Autogenerated")
+ if copying and not isStartGenerated:
+ output.append(line)
+ if isStartGenerated:
+ if retainDefs:
+ output.append(line)
+ copying = 0
+ generated = False
+ elif not copying and not generated:
+ # Generating
+ if line.startswith(commentPrefix + "**"):
+ # Pattern to transform input data
+ if retainDefs:
+ output.append(line)
+ definition = line[len(commentPrefix + "**"):]
+ if (commentPrefix == "<!--") and (" -->" in definition):
+ definition = definition.replace(" -->", "")
+ listid = 0
+ if definition[0] in string.digits:
+ listid = int(definition[:1])
+ definition = definition[2:]
+ # Hide double slashes as a control character
+ definition = definition.replace("\\\\", "\001")
+ # Do some normal C style transforms
+ definition = definition.replace("\\n", "\n")
+ definition = definition.replace("\\t", "\t")
+ # Get the doubled backslashes back as single backslashes
+ definition = definition.replace("\001", "\\")
+ startRepeat = definition.find("\\(")
+ endRepeat = definition.find("\\)")
+ intro = definition[:startRepeat]
+ out = ""
+ if intro.endswith("\n"):
+ pos = 0
+ else:
+ pos = len(intro)
+ out += intro
+ middle = definition[startRepeat+2:endRepeat]
+ for i in lists[listid]:
+ item = middle.replace("\\*", i)
+ if pos and (pos + len(item) >= 80):
+ out += "\\\n"
+ pos = 0
+ out += item
+ pos += len(item)
+ if item.endswith("\n"):
+ pos = 0
+ outro = definition[endRepeat+2:]
+ out += outro
+ out = out.replace("\n", lineEnd) # correct EOLs in generated content
+ output.append(out)
+ else:
+ # Simple form with no rule to transform input
+ output.extend(lists[0])
+ generated = True
+ if line.lstrip().startswith(commentPrefix + "--Autogenerated") or \
+ line.lstrip().startswith(commentPrefix + "~~Autogenerated"):
+ copying = 1
+ if retainDefs:
+ output.append(line)
+ output = [line.rstrip(" \t") for line in output] # trim trailing whitespace
+ return lineEnd.join(output) + lineEnd
+
+def GenerateFile(inpath, outpath, commentPrefix, retainDefs, *lists):
+ """Generate 'outpath' from 'inpath'.
+ """
+
+ try:
+ with codecs.open(inpath, "r", "UTF-8") as infile:
+ original = infile.read()
+ updated = CopyWithInsertion(original, commentPrefix,
+ retainDefs, lists)
+ UpdateFile(outpath, updated)
+ except IOError:
+ print("Can not open %s" % inpath)
+
+def Generate(inpath, outpath, commentPrefix, *lists):
+ """Generate 'outpath' from 'inpath'.
+ """
+ GenerateFile(inpath, outpath, commentPrefix, inpath == outpath, *lists)
+
+def Regenerate(filename, commentPrefix, *lists):
+ """Regenerate the given file.
+ """
+ Generate(filename, filename, commentPrefix, *lists)
+
+def UpdateLineInFile(path, linePrefix, lineReplace):
+ lines = []
+ updated = False
+ with codecs.open(path, "r", "utf-8") as f:
+ for l in f.readlines():
+ l = l.rstrip()
+ if not updated and l.startswith(linePrefix):
+ lines.append(lineReplace)
+ updated = True
+ else:
+ lines.append(l)
+ contents = lineEnd.join(lines) + lineEnd
+ UpdateFile(path, contents)
+
+def ReplaceREInFile(path, match, replace):
+ with codecs.open(path, "r", "utf-8") as f:
+ contents = f.read()
+ contents = re.sub(match, replace, contents)
+ UpdateFile(path, contents)
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCaseConvert.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCaseConvert.py
new file mode 100644
index 00000000000..37506b7b953
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCaseConvert.py
@@ -0,0 +1,126 @@
+# Script to generate CaseConvert.cxx from Python's Unicode data
+# Should be run rarely when a Python with a new version of Unicode data is available.
+# Requires Python 3.3 or later
+# Should not be run with old versions of Python.
+
+# Current best approach divides case conversions into two cases:
+# simple symmetric and complex.
+# Simple symmetric is where a lower and upper case pair convert to each
+# other and the folded form is the same as the lower case.
+# There are 1006 symmetric pairs.
+# These are further divided into ranges (stored as lower, upper, range length,
+# range pitch and singletons (stored as lower, upper).
+# Complex is for cases that don't fit the above: where there are multiple
+# characters in one of the forms or fold is different to lower or
+# lower(upper(x)) or upper(lower(x)) are not x. These are represented as UTF-8
+# strings with original, folded, upper, and lower separated by '|'.
+# There are 126 complex cases.
+
+import codecs, itertools, os, string, sys, unicodedata
+
+from FileGenerator import Regenerate
+
+def contiguousRanges(l, diff):
+ # l is s list of lists
+ # group into lists where first element of each element differs by diff
+ out = [[l[0]]]
+ for s in l[1:]:
+ if s[0] != out[-1][-1][0] + diff:
+ out.append([])
+ out[-1].append(s)
+ return out
+
+def flatten(listOfLists):
+ "Flatten one level of nesting"
+ return itertools.chain.from_iterable(listOfLists)
+
+def conversionSets():
+ # For all Unicode characters, see whether they have case conversions
+ # Return 2 sets: one of simple symmetric conversion cases and another
+ # with complex cases.
+ complexes = []
+ symmetrics = []
+ for ch in range(sys.maxunicode):
+ if ch >= 0xd800 and ch <= 0xDBFF:
+ continue
+ if ch >= 0xdc00 and ch <= 0xDFFF:
+ continue
+ uch = chr(ch)
+
+ fold = uch.casefold()
+ upper = uch.upper()
+ lower = uch.lower()
+ symmetric = False
+ if uch != upper and len(upper) == 1 and uch == lower and uch == fold:
+ lowerUpper = upper.lower()
+ foldUpper = upper.casefold()
+ if lowerUpper == foldUpper and lowerUpper == uch:
+ symmetric = True
+ symmetrics.append((ch, ord(upper), ch - ord(upper)))
+ if uch != lower and len(lower) == 1 and uch == upper and lower == fold:
+ upperLower = lower.upper()
+ if upperLower == uch:
+ symmetric = True
+
+ if fold == uch:
+ fold = ""
+ if upper == uch:
+ upper = ""
+ if lower == uch:
+ lower = ""
+
+ if (fold or upper or lower) and not symmetric:
+ complexes.append((uch, fold, upper, lower))
+
+ return symmetrics, complexes
+
+def groupRanges(symmetrics):
+ # Group the symmetrics into groups where possible, returning a list
+ # of ranges and a list of symmetrics that didn't fit into a range
+
+ def distance(s):
+ return s[2]
+
+ groups = []
+ uniquekeys = []
+ for k, g in itertools.groupby(symmetrics, distance):
+ groups.append(list(g)) # Store group iterator as a list
+ uniquekeys.append(k)
+
+ contiguousGroups = flatten([contiguousRanges(g, 1) for g in groups])
+ longGroups = [(x[0][0], x[0][1], len(x), 1) for x in contiguousGroups if len(x) > 4]
+
+ oneDiffs = [s for s in symmetrics if s[2] == 1]
+ contiguousOnes = flatten([contiguousRanges(g, 2) for g in [oneDiffs]])
+ longOneGroups = [(x[0][0], x[0][1], len(x), 2) for x in contiguousOnes if len(x) > 4]
+
+ rangeGroups = sorted(longGroups+longOneGroups, key=lambda s: s[0])
+
+ rangeCoverage = list(flatten([range(r[0], r[0]+r[2]*r[3], r[3]) for r in rangeGroups]))
+
+ nonRanges = [(l, u) for l, u, d in symmetrics if l not in rangeCoverage]
+
+ return rangeGroups, nonRanges
+
+def escape(s):
+ return "".join((chr(c) if chr(c) in string.ascii_letters else "\\x%x" % c) for c in s.encode('utf-8'))
+
+def updateCaseConvert():
+ symmetrics, complexes = conversionSets()
+
+ rangeGroups, nonRanges = groupRanges(symmetrics)
+
+ print(len(rangeGroups), "ranges")
+ rangeLines = ["%d,%d,%d,%d, " % x for x in rangeGroups]
+
+ print(len(nonRanges), "non ranges")
+ nonRangeLines = ["%d,%d, " % x for x in nonRanges]
+
+ print(len(symmetrics), "symmetric")
+
+ complexLines = ['"%s|%s|%s|%s|"' % tuple(escape(t) for t in x) for x in complexes]
+ print(len(complexLines), "complex")
+
+ Regenerate("../src/CaseConvert.cxx", "//", rangeLines, nonRangeLines, complexLines)
+
+updateCaseConvert()
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCharacterCategory.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCharacterCategory.py
new file mode 100644
index 00000000000..4596eec6af2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/GenerateCharacterCategory.py
@@ -0,0 +1,36 @@
+# Script to generate CharacterCategory.cxx from Python's Unicode data
+# Should be run rarely when a Python with a new version of Unicode data is available.
+# Requires Python 3.3 or later
+# Should not be run with old versions of Python.
+
+import codecs, os, platform, sys, unicodedata
+
+from FileGenerator import Regenerate
+
+def findCategories(filename):
+ with codecs.open(filename, "r", "UTF-8") as infile:
+ lines = [x.strip() for x in infile.readlines() if "\tcc" in x]
+ values = "".join(lines).replace(" ","").split(",")
+ print(values)
+ return [v[2:] for v in values]
+
+def updateCharacterCategory(filename):
+ values = ["// Created with Python %s, Unicode %s" % (
+ platform.python_version(), unicodedata.unidata_version)]
+ category = unicodedata.category(chr(0))
+ startRange = 0
+ for ch in range(sys.maxunicode):
+ uch = chr(ch)
+ if unicodedata.category(uch) != category:
+ value = startRange * 32 + categories.index(category)
+ values.append("%d," % value)
+ category = unicodedata.category(uch)
+ startRange = ch
+ value = startRange * 32 + categories.index(category)
+ values.append("%d," % value)
+
+ Regenerate(filename, "//", values)
+
+categories = findCategories("../lexlib/CharacterCategory.h")
+
+updateCharacterCategory("../lexlib/CharacterCategory.cxx")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/HFacer.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/HFacer.py
new file mode 100644
index 00000000000..ed36df4ea56
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/HFacer.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
+# definition file.
+# Implemented 2000 by Neil Hodgson neilh@scintilla.org
+# Requires Python 2.5 or later
+
+import sys
+import os
+import Face
+
+from FileGenerator import UpdateFile, Generate, Regenerate, UpdateLineInFile, lineEnd
+
+def printLexHFile(f):
+ out = []
+ for name in f.order:
+ v = f.features[name]
+ if v["FeatureType"] in ["val"]:
+ if "SCE_" in name or "SCLEX_" in name:
+ out.append("#define " + name + " " + v["Value"])
+ return out
+
+def printHFile(f):
+ out = []
+ previousCategory = ""
+ anyProvisional = False
+ for name in f.order:
+ v = f.features[name]
+ if v["Category"] != "Deprecated":
+ if v["Category"] == "Provisional" and previousCategory != "Provisional":
+ out.append("#ifndef SCI_DISABLE_PROVISIONAL")
+ anyProvisional = True
+ previousCategory = v["Category"]
+ if v["FeatureType"] in ["fun", "get", "set"]:
+ featureDefineName = "SCI_" + name.upper()
+ out.append("#define " + featureDefineName + " " + v["Value"])
+ elif v["FeatureType"] in ["evt"]:
+ featureDefineName = "SCN_" + name.upper()
+ out.append("#define " + featureDefineName + " " + v["Value"])
+ elif v["FeatureType"] in ["val"]:
+ if not ("SCE_" in name or "SCLEX_" in name):
+ out.append("#define " + name + " " + v["Value"])
+ if anyProvisional:
+ out.append("#endif")
+ return out
+
+def RegenerateAll(root, showMaxID):
+ f = Face.Face()
+ f.ReadFromFile(root + "include/Scintilla.iface")
+ Regenerate(root + "include/Scintilla.h", "/* ", printHFile(f))
+ Regenerate(root + "include/SciLexer.h", "/* ", printLexHFile(f))
+ if showMaxID:
+ valueSet = set(int(x) for x in f.values if int(x) < 3000)
+ maximumID = max(valueSet)
+ print("Maximum ID is %d" % maximumID)
+ #~ valuesUnused = sorted(x for x in range(2001,maximumID) if x not in valueSet)
+ #~ print("\nUnused values")
+ #~ for v in valuesUnused:
+ #~ print(v)
+
+if __name__ == "__main__":
+ RegenerateAll("../", True)
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/HeaderOrder.txt b/3rdparty/bgfx/3rdparty/scintilla/scripts/HeaderOrder.txt
new file mode 100644
index 00000000000..67854c5c198
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/HeaderOrder.txt
@@ -0,0 +1,136 @@
+// Define the standard order in which to include header files
+// All platform headers should be included before Scintilla headers
+// and each of these groups are then divided into directory groups.
+
+// C standard library
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <stdarg.h>
+#include <time.h>
+#include <math.h>
+#include <assert.h>
+#include <ctype.h>
+#include <limits.h>
+
+// C++ wrappers of C standard library
+#include <cstdlib>
+#include <cassert>
+#include <cstring>
+#include <cctype>
+#include <cstdio>
+#include <cmath>
+
+// C++ standard library
+#include <stdexcept>
+#include <new>
+#include <string>
+#include <vector>
+#include <deque>
+#include <map>
+#include <set>
+#include <algorithm>
+#include <memory>
+#include <regex>
+
+// GTK+ headers
+#include <glib.h>
+#include <gmodule.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+// Windows headers
+#include <windows.h>
+#include <commctrl.h>
+#include <richedit.h>
+#include <windowsx.h>
+#include <zmouse.h>
+#include <ole2.h>
+#include <d2d1.h>
+#include <dwrite.h>
+
+// Cocoa headers
+#include <Cocoa/Cocoa.h>
+
+// Scintilla headers
+
+// Non-platform-specific headers
+
+// include
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "ScintillaWidget.h"
+
+#include "SciLexer.h"
+
+// lexlib
+#include "StringCopy.h"
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "CharacterCategory.h"
+#include "LexerModule.h"
+#include "OptionSet.h"
+#include "SparseState.h"
+#include "SubStyles.h"
+#include "LexerBase.h"
+#include "LexerSimple.h"
+#include "LexerNoExceptions.h"
+
+// src
+#include "Catalogue.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "PerLine.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "CaseConvert.h"
+#include "UniConversion.h"
+#include "UnicodeFromUTF8.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "FontQuality.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+
+#include "AutoComplete.h"
+#include "ScintillaBase.h"
+
+#include "ExternalLexer.h"
+
+// Platform-specific headers
+
+// win32
+#include "PlatWin.h"
+#include "HanjaDic.h"
+
+// gtk
+#include "Converter.h"
+
+// cocoa
+#include "QuartzTextStyle.h"
+#include "QuartzTextStyleAttribute.h"
+#import "InfoBarCommunicator.h"
+#include "InfoBar.h"
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/LexGen.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/LexGen.py
new file mode 100644
index 00000000000..b181da77592
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/LexGen.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
+# Released to the public domain.
+
+# Regenerate the Scintilla source files that list all the lexers.
+# Should be run whenever a new lexer is added or removed.
+# Requires Python 2.5 or later
+# Files are regenerated in place with templates stored in comments.
+# The format of generation comments is documented in FileGenerator.py.
+
+from FileGenerator import Regenerate, UpdateLineInFile, ReplaceREInFile
+import ScintillaData
+import HFacer
+
+def UpdateVersionNumbers(sci, root):
+ UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_SCINTILLA",
+ "#define VERSION_SCINTILLA \"" + sci.versionDotted + "\"")
+ UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_WORDS",
+ "#define VERSION_WORDS " + sci.versionCommad)
+ UpdateLineInFile(root + "qt/ScintillaEditBase/ScintillaEditBase.pro",
+ "VERSION =",
+ "VERSION = " + sci.versionDotted)
+ UpdateLineInFile(root + "qt/ScintillaEdit/ScintillaEdit.pro",
+ "VERSION =",
+ "VERSION = " + sci.versionDotted)
+ UpdateLineInFile(root + "doc/ScintillaDownload.html", " Release",
+ " Release " + sci.versionDotted)
+ ReplaceREInFile(root + "doc/ScintillaDownload.html",
+ r"/scintilla/([a-zA-Z]+)\d\d\d",
+ r"/scintilla/\g<1>" + sci.version)
+ UpdateLineInFile(root + "doc/index.html",
+ ' <font color="#FFCC99" size="3"> Release version',
+ ' <font color="#FFCC99" size="3"> Release version ' +\
+ sci.versionDotted + '<br />')
+ UpdateLineInFile(root + "doc/index.html",
+ ' Site last modified',
+ ' Site last modified ' + sci.mdyModified + '</font>')
+ UpdateLineInFile(root + "doc/ScintillaHistory.html",
+ ' Released ',
+ ' Released ' + sci.dmyModified + '.')
+
+def RegenerateAll(root):
+
+ sci = ScintillaData.ScintillaData(root)
+
+ Regenerate(root + "src/Catalogue.cxx", "//", sci.lexerModules)
+ Regenerate(root + "win32/scintilla.mak", "#", sci.lexFiles)
+
+ UpdateVersionNumbers(sci, root)
+
+ HFacer.RegenerateAll(root, False)
+
+if __name__=="__main__":
+ RegenerateAll("../")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/scripts/ScintillaData.py b/3rdparty/bgfx/3rdparty/scintilla/scripts/ScintillaData.py
new file mode 100644
index 00000000000..f9c7718bf4f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/scripts/ScintillaData.py
@@ -0,0 +1,225 @@
+# ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
+# Released to the public domain.
+
+# Common code used by Scintilla and SciTE for source file regeneration.
+# The ScintillaData object exposes information about Scintilla as properties:
+# Version properties
+# version
+# versionDotted
+# versionCommad
+#
+# Date last modified
+# dateModified
+# yearModified
+# mdyModified
+# dmyModified
+# myModified
+#
+# Information about lexers and properties defined in lexers
+# lexFiles
+# sorted list of lexer files
+# lexerModules
+# sorted list of module names
+# lexerProperties
+# sorted list of lexer properties
+# propertyDocuments
+# dictionary of property documentation { name: document string }
+
+# This file can be run to see the data it provides.
+# Requires Python 2.5 or later
+
+from __future__ import with_statement
+
+import codecs, datetime, glob, os, sys, textwrap
+
+import FileGenerator
+
+def FindModules(lexFile):
+ modules = []
+ with open(lexFile) as f:
+ for l in f.readlines():
+ if l.startswith("LexerModule"):
+ l = l.replace("(", " ")
+ modules.append(l.split()[1])
+ return modules
+
+# Properties that start with lexer. or fold. are automatically found but there are some
+# older properties that don't follow this pattern so must be explicitly listed.
+knownIrregularProperties = [
+ "fold",
+ "styling.within.preprocessor",
+ "tab.timmy.whinge.level",
+ "asp.default.language",
+ "html.tags.case.sensitive",
+ "ps.level",
+ "ps.tokenize",
+ "sql.backslash.escapes",
+ "nsis.uservars",
+ "nsis.ignorecase"
+]
+
+def FindProperties(lexFile):
+ properties = {}
+ with open(lexFile) as f:
+ for l in f.readlines():
+ if ("GetProperty" in l or "DefineProperty" in l) and "\"" in l:
+ l = l.strip()
+ if not l.startswith("//"): # Drop comments
+ propertyName = l.split("\"")[1]
+ if propertyName.lower() == propertyName:
+ # Only allow lower case property names
+ if propertyName in knownIrregularProperties or \
+ propertyName.startswith("fold.") or \
+ propertyName.startswith("lexer."):
+ properties[propertyName] = 1
+ return properties
+
+def FindPropertyDocumentation(lexFile):
+ documents = {}
+ with open(lexFile) as f:
+ name = ""
+ for l in f.readlines():
+ l = l.strip()
+ if "// property " in l:
+ propertyName = l.split()[2]
+ if propertyName.lower() == propertyName:
+ # Only allow lower case property names
+ name = propertyName
+ documents[name] = ""
+ elif "DefineProperty" in l and "\"" in l:
+ propertyName = l.split("\"")[1]
+ if propertyName.lower() == propertyName:
+ # Only allow lower case property names
+ name = propertyName
+ documents[name] = ""
+ elif name:
+ if l.startswith("//"):
+ if documents[name]:
+ documents[name] += " "
+ documents[name] += l[2:].strip()
+ elif l.startswith("\""):
+ l = l[1:].strip()
+ if l.endswith(";"):
+ l = l[:-1].strip()
+ if l.endswith(")"):
+ l = l[:-1].strip()
+ if l.endswith("\""):
+ l = l[:-1]
+ # Fix escaped double quotes
+ l = l.replace("\\\"", "\"")
+ documents[name] += l
+ else:
+ name = ""
+ for name in list(documents.keys()):
+ if documents[name] == "":
+ del documents[name]
+ return documents
+
+def FindCredits(historyFile):
+ credits = []
+ stage = 0
+ with codecs.open(historyFile, "r", "utf-8") as f:
+ for l in f.readlines():
+ l = l.strip()
+ if stage == 0 and l == "<table>":
+ stage = 1
+ elif stage == 1 and l == "</table>":
+ stage = 2
+ if stage == 1 and l.startswith("<td>"):
+ credit = l[4:-5]
+ if "<a" in l:
+ title, a, rest = credit.partition("<a href=")
+ urlplus, bracket, end = rest.partition(">")
+ name = end.split("<")[0]
+ url = urlplus[1:-1]
+ credit = title.strip()
+ if credit:
+ credit += " "
+ credit += name + " " + url
+ credits.append(credit)
+ return credits
+
+def ciCompare(a,b):
+ return cmp(a.lower(), b.lower())
+
+def ciKey(a):
+ return a.lower()
+
+def SortListInsensitive(l):
+ try: # Try key function
+ l.sort(key=ciKey)
+ except TypeError: # Earlier version of Python, so use comparison function
+ l.sort(ciCompare)
+
+class ScintillaData:
+ def __init__(self, scintillaRoot):
+ # Discover verion information
+ with open(scintillaRoot + "version.txt") as f:
+ self.version = f.read().strip()
+ self.versionDotted = self.version[0] + '.' + self.version[1] + '.' + \
+ self.version[2]
+ self.versionCommad = self.version[0] + ', ' + self.version[1] + ', ' + \
+ self.version[2] + ', 0'
+
+ with open(scintillaRoot + "doc/index.html") as f:
+ self.dateModified = [l for l in f.readlines() if "Date.Modified" in l]\
+ [0].split('\"')[3]
+ # 20130602
+ # index.html, SciTE.html
+ dtModified = datetime.datetime.strptime(self.dateModified, "%Y%m%d")
+ self.yearModified = self.dateModified[0:4]
+ monthModified = dtModified.strftime("%B")
+ dayModified = "%d" % dtModified.day
+ self.mdyModified = monthModified + " " + dayModified + " " + self.yearModified
+ # May 22 2013
+ # index.html, SciTE.html
+ self.dmyModified = dayModified + " " + monthModified + " " + self.yearModified
+ # 22 May 2013
+ # ScintillaHistory.html -- only first should change
+ self.myModified = monthModified + " " + self.yearModified
+
+ # Find all the lexer source code files
+ lexFilePaths = glob.glob(scintillaRoot + "lexers/Lex*.cxx")
+ SortListInsensitive(lexFilePaths)
+ self.lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths]
+ self.lexerModules = []
+ lexerProperties = set()
+ self.propertyDocuments = {}
+ for lexFile in lexFilePaths:
+ self.lexerModules.extend(FindModules(lexFile))
+ for k in FindProperties(lexFile).keys():
+ lexerProperties.add(k)
+ documents = FindPropertyDocumentation(lexFile)
+ for k in documents.keys():
+ if k not in self.propertyDocuments:
+ self.propertyDocuments[k] = documents[k]
+ SortListInsensitive(self.lexerModules)
+ self.lexerProperties = list(lexerProperties)
+ SortListInsensitive(self.lexerProperties)
+
+ self.credits = FindCredits(scintillaRoot + "doc/ScintillaHistory.html")
+
+def printWrapped(text):
+ print(textwrap.fill(text, subsequent_indent=" "))
+
+if __name__=="__main__":
+ sci = ScintillaData("../")
+ print("Version %s %s %s" % (sci.version, sci.versionDotted, sci.versionCommad))
+ print("Date last modified %s %s %s %s %s" % (
+ sci.dateModified, sci.yearModified, sci.mdyModified, sci.dmyModified, sci.myModified))
+ printWrapped(str(len(sci.lexFiles)) + " lexer files: " + ", ".join(sci.lexFiles))
+ printWrapped(str(len(sci.lexerModules)) + " lexer modules: " + ", ".join(sci.lexerModules))
+ printWrapped("Lexer properties: " + ", ".join(sci.lexerProperties))
+ print("Lexer property documentation:")
+ documentProperties = list(sci.propertyDocuments.keys())
+ SortListInsensitive(documentProperties)
+ for k in documentProperties:
+ print(" " + k)
+ print(textwrap.fill(sci.propertyDocuments[k], initial_indent=" ",
+ subsequent_indent=" "))
+ print("Credits:")
+ for c in sci.credits:
+ if sys.version_info[0] == 2:
+ print(" " + c.encode("utf-8"))
+ else:
+ sys.stdout.buffer.write(b" " + c.encode("utf-8") + b"\n")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.cxx
new file mode 100644
index 00000000000..27eed53b997
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.cxx
@@ -0,0 +1,294 @@
+// Scintilla source code edit control
+/** @file AutoComplete.cxx
+ ** Defines the auto completion list box.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+
+#include <string>
+#include <vector>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "CharacterSet.h"
+#include "AutoComplete.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+AutoComplete::AutoComplete() :
+ active(false),
+ separator(' '),
+ typesep('?'),
+ ignoreCase(false),
+ chooseSingle(false),
+ lb(0),
+ posStart(0),
+ startLen(0),
+ cancelAtStartPos(true),
+ autoHide(true),
+ dropRestOfWord(false),
+ ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE),
+ widthLBDefault(100),
+ heightLBDefault(100),
+ autoSort(SC_ORDER_PRESORTED) {
+ lb = ListBox::Allocate();
+}
+
+AutoComplete::~AutoComplete() {
+ if (lb) {
+ lb->Destroy();
+ delete lb;
+ lb = 0;
+ }
+}
+
+bool AutoComplete::Active() const {
+ return active;
+}
+
+void AutoComplete::Start(Window &parent, int ctrlID,
+ int position, Point location, int startLen_,
+ int lineHeight, bool unicodeMode, int technology) {
+ if (active) {
+ Cancel();
+ }
+ lb->Create(parent, ctrlID, location, lineHeight, unicodeMode, technology);
+ lb->Clear();
+ active = true;
+ startLen = startLen_;
+ posStart = position;
+}
+
+void AutoComplete::SetStopChars(const char *stopChars_) {
+ stopChars = stopChars_;
+}
+
+bool AutoComplete::IsStopChar(char ch) {
+ return ch && (stopChars.find(ch) != std::string::npos);
+}
+
+void AutoComplete::SetFillUpChars(const char *fillUpChars_) {
+ fillUpChars = fillUpChars_;
+}
+
+bool AutoComplete::IsFillUpChar(char ch) {
+ return ch && (fillUpChars.find(ch) != std::string::npos);
+}
+
+void AutoComplete::SetSeparator(char separator_) {
+ separator = separator_;
+}
+
+char AutoComplete::GetSeparator() const {
+ return separator;
+}
+
+void AutoComplete::SetTypesep(char separator_) {
+ typesep = separator_;
+}
+
+char AutoComplete::GetTypesep() const {
+ return typesep;
+}
+
+struct Sorter {
+ AutoComplete *ac;
+ const char *list;
+ std::vector<int> indices;
+
+ Sorter(AutoComplete *ac_, const char *list_) : ac(ac_), list(list_) {
+ int i = 0;
+ while (list[i]) {
+ indices.push_back(i); // word start
+ while (list[i] != ac->GetTypesep() && list[i] != ac->GetSeparator() && list[i])
+ ++i;
+ indices.push_back(i); // word end
+ if (list[i] == ac->GetTypesep()) {
+ while (list[i] != ac->GetSeparator() && list[i])
+ ++i;
+ }
+ if (list[i] == ac->GetSeparator()) {
+ ++i;
+ // preserve trailing separator as blank entry
+ if (!list[i]) {
+ indices.push_back(i);
+ indices.push_back(i);
+ }
+ }
+ }
+ indices.push_back(i); // index of last position
+ }
+
+ bool operator()(int a, int b) {
+ int lenA = indices[a * 2 + 1] - indices[a * 2];
+ int lenB = indices[b * 2 + 1] - indices[b * 2];
+ int len = std::min(lenA, lenB);
+ int cmp;
+ if (ac->ignoreCase)
+ cmp = CompareNCaseInsensitive(list + indices[a * 2], list + indices[b * 2], len);
+ else
+ cmp = strncmp(list + indices[a * 2], list + indices[b * 2], len);
+ if (cmp == 0)
+ cmp = lenA - lenB;
+ return cmp < 0;
+ }
+};
+
+void AutoComplete::SetList(const char *list) {
+ if (autoSort == SC_ORDER_PRESORTED) {
+ lb->SetList(list, separator, typesep);
+ sortMatrix.clear();
+ for (int i = 0; i < lb->Length(); ++i)
+ sortMatrix.push_back(i);
+ return;
+ }
+
+ Sorter IndexSort(this, list);
+ sortMatrix.clear();
+ for (int i = 0; i < (int)IndexSort.indices.size() / 2; ++i)
+ sortMatrix.push_back(i);
+ std::sort(sortMatrix.begin(), sortMatrix.end(), IndexSort);
+ if (autoSort == SC_ORDER_CUSTOM || sortMatrix.size() < 2) {
+ lb->SetList(list, separator, typesep);
+ PLATFORM_ASSERT(lb->Length() == static_cast<int>(sortMatrix.size()));
+ return;
+ }
+
+ std::string sortedList;
+ char item[maxItemLen];
+ for (size_t i = 0; i < sortMatrix.size(); ++i) {
+ int wordLen = IndexSort.indices[sortMatrix[i] * 2 + 2] - IndexSort.indices[sortMatrix[i] * 2];
+ if (wordLen > maxItemLen-2)
+ wordLen = maxItemLen - 2;
+ memcpy(item, list + IndexSort.indices[sortMatrix[i] * 2], wordLen);
+ if ((i+1) == sortMatrix.size()) {
+ // Last item so remove separator if present
+ if ((wordLen > 0) && (item[wordLen-1] == separator))
+ wordLen--;
+ } else {
+ // Item before last needs a separator
+ if ((wordLen == 0) || (item[wordLen-1] != separator)) {
+ item[wordLen] = separator;
+ wordLen++;
+ }
+ }
+ item[wordLen] = '\0';
+ sortedList += item;
+ }
+ for (int i = 0; i < (int)sortMatrix.size(); ++i)
+ sortMatrix[i] = i;
+ lb->SetList(sortedList.c_str(), separator, typesep);
+}
+
+int AutoComplete::GetSelection() const {
+ return lb->GetSelection();
+}
+
+std::string AutoComplete::GetValue(int item) const {
+ char value[maxItemLen];
+ lb->GetValue(item, value, sizeof(value));
+ return std::string(value);
+}
+
+void AutoComplete::Show(bool show) {
+ lb->Show(show);
+ if (show)
+ lb->Select(0);
+}
+
+void AutoComplete::Cancel() {
+ if (lb->Created()) {
+ lb->Clear();
+ lb->Destroy();
+ active = false;
+ }
+}
+
+
+void AutoComplete::Move(int delta) {
+ int count = lb->Length();
+ int current = lb->GetSelection();
+ current += delta;
+ if (current >= count)
+ current = count - 1;
+ if (current < 0)
+ current = 0;
+ lb->Select(current);
+}
+
+void AutoComplete::Select(const char *word) {
+ size_t lenWord = strlen(word);
+ int location = -1;
+ int start = 0; // lower bound of the api array block to search
+ int end = lb->Length() - 1; // upper bound of the api array block to search
+ while ((start <= end) && (location == -1)) { // Binary searching loop
+ int pivot = (start + end) / 2;
+ char item[maxItemLen];
+ lb->GetValue(sortMatrix[pivot], item, maxItemLen);
+ int cond;
+ if (ignoreCase)
+ cond = CompareNCaseInsensitive(word, item, lenWord);
+ else
+ cond = strncmp(word, item, lenWord);
+ if (!cond) {
+ // Find first match
+ while (pivot > start) {
+ lb->GetValue(sortMatrix[pivot-1], item, maxItemLen);
+ if (ignoreCase)
+ cond = CompareNCaseInsensitive(word, item, lenWord);
+ else
+ cond = strncmp(word, item, lenWord);
+ if (0 != cond)
+ break;
+ --pivot;
+ }
+ location = pivot;
+ if (ignoreCase
+ && ignoreCaseBehaviour == SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) {
+ // Check for exact-case match
+ for (; pivot <= end; pivot++) {
+ lb->GetValue(sortMatrix[pivot], item, maxItemLen);
+ if (!strncmp(word, item, lenWord)) {
+ location = pivot;
+ break;
+ }
+ if (CompareNCaseInsensitive(word, item, lenWord))
+ break;
+ }
+ }
+ } else if (cond < 0) {
+ end = pivot - 1;
+ } else if (cond > 0) {
+ start = pivot + 1;
+ }
+ }
+ if (location == -1) {
+ if (autoHide)
+ Cancel();
+ else
+ lb->Select(-1);
+ } else {
+ if (autoSort == SC_ORDER_CUSTOM) {
+ // Check for a logically earlier match
+ char item[maxItemLen];
+ for (int i = location + 1; i <= end; ++i) {
+ lb->GetValue(sortMatrix[i], item, maxItemLen);
+ if (CompareNCaseInsensitive(word, item, lenWord))
+ break;
+ if (sortMatrix[i] < sortMatrix[location] && !strncmp(word, item, lenWord))
+ location = i;
+ }
+ }
+ lb->Select(sortMatrix[location]);
+ }
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.h b/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.h
new file mode 100644
index 00000000000..c35fa1a0eeb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/AutoComplete.h
@@ -0,0 +1,95 @@
+// Scintilla source code edit control
+/** @file AutoComplete.h
+ ** Defines the auto completion list box.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef AUTOCOMPLETE_H
+#define AUTOCOMPLETE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class AutoComplete {
+ bool active;
+ std::string stopChars;
+ std::string fillUpChars;
+ char separator;
+ char typesep; // Type seperator
+ enum { maxItemLen=1000 };
+ std::vector<int> sortMatrix;
+
+public:
+
+ bool ignoreCase;
+ bool chooseSingle;
+ ListBox *lb;
+ int posStart;
+ int startLen;
+ /// Should autocompletion be canceled if editor's currentPos <= startPos?
+ bool cancelAtStartPos;
+ bool autoHide;
+ bool dropRestOfWord;
+ unsigned int ignoreCaseBehaviour;
+ int widthLBDefault;
+ int heightLBDefault;
+ /** SC_ORDER_PRESORTED: Assume the list is presorted; selection will fail if it is not alphabetical<br />
+ * SC_ORDER_PERFORMSORT: Sort the list alphabetically; start up performance cost for sorting<br />
+ * SC_ORDER_CUSTOM: Handle non-alphabetical entries; start up performance cost for generating a sorted lookup table
+ */
+ int autoSort;
+
+ AutoComplete();
+ ~AutoComplete();
+
+ /// Is the auto completion list displayed?
+ bool Active() const;
+
+ /// Display the auto completion list positioned to be near a character position
+ void Start(Window &parent, int ctrlID, int position, Point location,
+ int startLen_, int lineHeight, bool unicodeMode, int technology);
+
+ /// The stop chars are characters which, when typed, cause the auto completion list to disappear
+ void SetStopChars(const char *stopChars_);
+ bool IsStopChar(char ch);
+
+ /// The fillup chars are characters which, when typed, fill up the selected word
+ void SetFillUpChars(const char *fillUpChars_);
+ bool IsFillUpChar(char ch);
+
+ /// The separator character is used when interpreting the list in SetList
+ void SetSeparator(char separator_);
+ char GetSeparator() const;
+
+ /// The typesep character is used for separating the word from the type
+ void SetTypesep(char separator_);
+ char GetTypesep() const;
+
+ /// The list string contains a sequence of words separated by the separator character
+ void SetList(const char *list);
+
+ /// Return the position of the currently selected list item
+ int GetSelection() const;
+
+ /// Return the value of an item in the list
+ std::string GetValue(int item) const;
+
+ void Show(bool show);
+ void Cancel();
+
+ /// Move the current list element by delta, scrolling appropriately
+ void Move(int delta);
+
+ /// Select a list element that starts with word as the current element
+ void Select(const char *word);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.cxx
new file mode 100644
index 00000000000..f6f3f10ea07
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.cxx
@@ -0,0 +1,334 @@
+// Scintilla source code edit control
+/** @file CallTip.cxx
+ ** Code for displaying call tips.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <string>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "CallTip.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+CallTip::CallTip() {
+ wCallTip = 0;
+ inCallTipMode = false;
+ posStartCallTip = 0;
+ rectUp = PRectangle(0,0,0,0);
+ rectDown = PRectangle(0,0,0,0);
+ lineHeight = 1;
+ offsetMain = 0;
+ startHighlight = 0;
+ endHighlight = 0;
+ tabSize = 0;
+ above = false;
+ useStyleCallTip = false; // for backwards compatibility
+
+ insetX = 5;
+ widthArrow = 14;
+ borderHeight = 2; // Extra line for border and an empty line at top and bottom.
+ verticalOffset = 1;
+
+#ifdef __APPLE__
+ // proper apple colours for the default
+ colourBG = ColourDesired(0xff, 0xff, 0xc6);
+ colourUnSel = ColourDesired(0, 0, 0);
+#else
+ colourBG = ColourDesired(0xff, 0xff, 0xff);
+ colourUnSel = ColourDesired(0x80, 0x80, 0x80);
+#endif
+ colourSel = ColourDesired(0, 0, 0x80);
+ colourShade = ColourDesired(0, 0, 0);
+ colourLight = ColourDesired(0xc0, 0xc0, 0xc0);
+ codePage = 0;
+ clickPlace = 0;
+}
+
+CallTip::~CallTip() {
+ font.Release();
+ wCallTip.Destroy();
+}
+
+// Although this test includes 0, we should never see a \0 character.
+static bool IsArrowCharacter(char ch) {
+ return (ch == 0) || (ch == '\001') || (ch == '\002');
+}
+
+// We ignore tabs unless a tab width has been set.
+bool CallTip::IsTabCharacter(char ch) const {
+ return (tabSize > 0) && (ch == '\t');
+}
+
+int CallTip::NextTabPos(int x) const {
+ if (tabSize > 0) { // paranoia... not called unless this is true
+ x -= insetX; // position relative to text
+ x = (x + tabSize) / tabSize; // tab "number"
+ return tabSize*x + insetX; // position of next tab
+ } else {
+ return x + 1; // arbitrary
+ }
+}
+
+// Draw a section of the call tip that does not include \n in one colour.
+// The text may include up to numEnds tabs or arrow characters.
+void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
+ int posStart, int posEnd, int ytext, PRectangle rcClient,
+ bool highlight, bool draw) {
+ s += posStart;
+ int len = posEnd - posStart;
+
+ // Divide the text into sections that are all text, or that are
+ // single arrows or single tab characters (if tabSize > 0).
+ int maxEnd = 0;
+ const int numEnds = 10;
+ int ends[numEnds + 2];
+ for (int i=0; i<len; i++) {
+ if ((maxEnd < numEnds) &&
+ (IsArrowCharacter(s[i]) || IsTabCharacter(s[i]))) {
+ if (i > 0)
+ ends[maxEnd++] = i;
+ ends[maxEnd++] = i+1;
+ }
+ }
+ ends[maxEnd++] = len;
+ int startSeg = 0;
+ int xEnd;
+ for (int seg = 0; seg<maxEnd; seg++) {
+ int endSeg = ends[seg];
+ if (endSeg > startSeg) {
+ if (IsArrowCharacter(s[startSeg])) {
+ xEnd = x + widthArrow;
+ bool upArrow = s[startSeg] == '\001';
+ rcClient.left = static_cast<XYPOSITION>(x);
+ rcClient.right = static_cast<XYPOSITION>(xEnd);
+ if (draw) {
+ const int halfWidth = widthArrow / 2 - 3;
+ const int quarterWidth = halfWidth / 2;
+ const int centreX = x + widthArrow / 2 - 1;
+ const int centreY = static_cast<int>(rcClient.top + rcClient.bottom) / 2;
+ surface->FillRectangle(rcClient, colourBG);
+ PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1,
+ rcClient.right - 2, rcClient.bottom - 1);
+ surface->FillRectangle(rcClientInner, colourUnSel);
+
+ if (upArrow) { // Up arrow
+ Point pts[] = {
+ Point::FromInts(centreX - halfWidth, centreY + quarterWidth),
+ Point::FromInts(centreX + halfWidth, centreY + quarterWidth),
+ Point::FromInts(centreX, centreY - halfWidth + quarterWidth),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), colourBG, colourBG);
+ } else { // Down arrow
+ Point pts[] = {
+ Point::FromInts(centreX - halfWidth, centreY - quarterWidth),
+ Point::FromInts(centreX + halfWidth, centreY - quarterWidth),
+ Point::FromInts(centreX, centreY + halfWidth - quarterWidth),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), colourBG, colourBG);
+ }
+ }
+ offsetMain = xEnd;
+ if (upArrow) {
+ rectUp = rcClient;
+ } else {
+ rectDown = rcClient;
+ }
+ } else if (IsTabCharacter(s[startSeg])) {
+ xEnd = NextTabPos(x);
+ } else {
+ xEnd = x + RoundXYPosition(surface->WidthText(font, s + startSeg, endSeg - startSeg));
+ if (draw) {
+ rcClient.left = static_cast<XYPOSITION>(x);
+ rcClient.right = static_cast<XYPOSITION>(xEnd);
+ surface->DrawTextTransparent(rcClient, font, static_cast<XYPOSITION>(ytext),
+ s+startSeg, endSeg - startSeg,
+ highlight ? colourSel : colourUnSel);
+ }
+ }
+ x = xEnd;
+ startSeg = endSeg;
+ }
+ }
+}
+
+int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
+ PRectangle rcClientPos = wCallTip.GetClientPosition();
+ PRectangle rcClientSize(0.0f, 0.0f, rcClientPos.right - rcClientPos.left,
+ rcClientPos.bottom - rcClientPos.top);
+ PRectangle rcClient(1.0f, 1.0f, rcClientSize.right - 1, rcClientSize.bottom - 1);
+
+ // To make a nice small call tip window, it is only sized to fit most normal characters without accents
+ int ascent = RoundXYPosition(surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font));
+
+ // For each line...
+ // Draw the definition in three parts: before highlight, highlighted, after highlight
+ int ytext = static_cast<int>(rcClient.top) + ascent + 1;
+ rcClient.bottom = ytext + surfaceWindow->Descent(font) + 1;
+ const char *chunkVal = val.c_str();
+ bool moreChunks = true;
+ int maxWidth = 0;
+
+ while (moreChunks) {
+ const char *chunkEnd = strchr(chunkVal, '\n');
+ if (chunkEnd == NULL) {
+ chunkEnd = chunkVal + strlen(chunkVal);
+ moreChunks = false;
+ }
+ int chunkOffset = static_cast<int>(chunkVal - val.c_str());
+ int chunkLength = static_cast<int>(chunkEnd - chunkVal);
+ int chunkEndOffset = chunkOffset + chunkLength;
+ int thisStartHighlight = Platform::Maximum(startHighlight, chunkOffset);
+ thisStartHighlight = Platform::Minimum(thisStartHighlight, chunkEndOffset);
+ thisStartHighlight -= chunkOffset;
+ int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset);
+ thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset);
+ thisEndHighlight -= chunkOffset;
+ rcClient.top = static_cast<XYPOSITION>(ytext - ascent - 1);
+
+ int x = insetX; // start each line at this inset
+
+ DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight,
+ ytext, rcClient, false, draw);
+ DrawChunk(surfaceWindow, x, chunkVal, thisStartHighlight, thisEndHighlight,
+ ytext, rcClient, true, draw);
+ DrawChunk(surfaceWindow, x, chunkVal, thisEndHighlight, chunkLength,
+ ytext, rcClient, false, draw);
+
+ chunkVal = chunkEnd + 1;
+ ytext += lineHeight;
+ rcClient.bottom += lineHeight;
+ maxWidth = Platform::Maximum(maxWidth, x);
+ }
+ return maxWidth;
+}
+
+void CallTip::PaintCT(Surface *surfaceWindow) {
+ if (val.empty())
+ return;
+ PRectangle rcClientPos = wCallTip.GetClientPosition();
+ PRectangle rcClientSize(0.0f, 0.0f, rcClientPos.right - rcClientPos.left,
+ rcClientPos.bottom - rcClientPos.top);
+ PRectangle rcClient(1.0f, 1.0f, rcClientSize.right - 1, rcClientSize.bottom - 1);
+
+ surfaceWindow->FillRectangle(rcClient, colourBG);
+
+ offsetMain = insetX; // initial alignment assuming no arrows
+ PaintContents(surfaceWindow, true);
+
+#ifndef __APPLE__
+ // OSX doesn't put borders on "help tags"
+ // Draw a raised border around the edges of the window
+ surfaceWindow->MoveTo(0, static_cast<int>(rcClientSize.bottom) - 1);
+ surfaceWindow->PenColour(colourShade);
+ surfaceWindow->LineTo(static_cast<int>(rcClientSize.right) - 1, static_cast<int>(rcClientSize.bottom) - 1);
+ surfaceWindow->LineTo(static_cast<int>(rcClientSize.right) - 1, 0);
+ surfaceWindow->PenColour(colourLight);
+ surfaceWindow->LineTo(0, 0);
+ surfaceWindow->LineTo(0, static_cast<int>(rcClientSize.bottom) - 1);
+#endif
+}
+
+void CallTip::MouseClick(Point pt) {
+ clickPlace = 0;
+ if (rectUp.Contains(pt))
+ clickPlace = 1;
+ if (rectDown.Contains(pt))
+ clickPlace = 2;
+}
+
+PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *defn,
+ const char *faceName, int size,
+ int codePage_, int characterSet,
+ int technology, Window &wParent) {
+ clickPlace = 0;
+ val = defn;
+ codePage = codePage_;
+ Surface *surfaceMeasure = Surface::Allocate(technology);
+ if (!surfaceMeasure)
+ return PRectangle();
+ surfaceMeasure->Init(wParent.GetID());
+ surfaceMeasure->SetUnicodeMode(SC_CP_UTF8 == codePage);
+ surfaceMeasure->SetDBCSMode(codePage);
+ startHighlight = 0;
+ endHighlight = 0;
+ inCallTipMode = true;
+ posStartCallTip = pos;
+ XYPOSITION deviceHeight = static_cast<XYPOSITION>(surfaceMeasure->DeviceHeightFont(size));
+ FontParameters fp(faceName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, SC_WEIGHT_NORMAL, false, 0, technology, characterSet);
+ font.Create(fp);
+ // Look for multiple lines in the text
+ // Only support \n here - simply means container must avoid \r!
+ int numLines = 1;
+ const char *newline;
+ const char *look = val.c_str();
+ rectUp = PRectangle(0,0,0,0);
+ rectDown = PRectangle(0,0,0,0);
+ offsetMain = insetX; // changed to right edge of any arrows
+ int width = PaintContents(surfaceMeasure, false) + insetX;
+ while ((newline = strchr(look, '\n')) != NULL) {
+ look = newline + 1;
+ numLines++;
+ }
+ lineHeight = RoundXYPosition(surfaceMeasure->Height(font));
+
+ // The returned
+ // rectangle is aligned to the right edge of the last arrow encountered in
+ // the tip text, else to the tip text left edge.
+ int height = lineHeight * numLines - static_cast<int>(surfaceMeasure->InternalLeading(font)) + borderHeight * 2;
+ delete surfaceMeasure;
+ if (above) {
+ return PRectangle(pt.x - offsetMain, pt.y - verticalOffset - height, pt.x + width - offsetMain, pt.y - verticalOffset);
+ } else {
+ return PRectangle(pt.x - offsetMain, pt.y + verticalOffset + textHeight, pt.x + width - offsetMain, pt.y + verticalOffset + textHeight + height);
+ }
+}
+
+void CallTip::CallTipCancel() {
+ inCallTipMode = false;
+ if (wCallTip.Created()) {
+ wCallTip.Destroy();
+ }
+}
+
+void CallTip::SetHighlight(int start, int end) {
+ // Avoid flashing by checking something has really changed
+ if ((start != startHighlight) || (end != endHighlight)) {
+ startHighlight = start;
+ endHighlight = (end > start) ? end : start;
+ if (wCallTip.Created()) {
+ wCallTip.InvalidateAll();
+ }
+ }
+}
+
+// Set the tab size (sizes > 0 enable the use of tabs). This also enables the
+// use of the STYLE_CALLTIP.
+void CallTip::SetTabSize(int tabSz) {
+ tabSize = tabSz;
+ useStyleCallTip = true;
+}
+
+// Set the calltip position, below the text by default or if above is false
+// else above the text.
+void CallTip::SetPosition(bool aboveText) {
+ above = aboveText;
+}
+
+// It might be better to have two access functions for this and to use
+// them for all settings of colours.
+void CallTip::SetForeBack(const ColourDesired &fore, const ColourDesired &back) {
+ colourBG = back;
+ colourUnSel = fore;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.h b/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.h
new file mode 100644
index 00000000000..840aa26acc4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CallTip.h
@@ -0,0 +1,93 @@
+// Scintilla source code edit control
+/** @file CallTip.h
+ ** Interface to the call tip control.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CALLTIP_H
+#define CALLTIP_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class CallTip {
+ int startHighlight; // character offset to start and...
+ int endHighlight; // ...end of highlighted text
+ std::string val;
+ Font font;
+ PRectangle rectUp; // rectangle of last up angle in the tip
+ PRectangle rectDown; // rectangle of last down arrow in the tip
+ int lineHeight; // vertical line spacing
+ int offsetMain; // The alignment point of the call tip
+ int tabSize; // Tab size in pixels, <=0 no TAB expand
+ bool useStyleCallTip; // if true, STYLE_CALLTIP should be used
+ bool above; // if true, display calltip above text
+
+ // Private so CallTip objects can not be copied
+ CallTip(const CallTip &);
+ CallTip &operator=(const CallTip &);
+ void DrawChunk(Surface *surface, int &x, const char *s,
+ int posStart, int posEnd, int ytext, PRectangle rcClient,
+ bool highlight, bool draw);
+ int PaintContents(Surface *surfaceWindow, bool draw);
+ bool IsTabCharacter(char c) const;
+ int NextTabPos(int x) const;
+
+public:
+ Window wCallTip;
+ Window wDraw;
+ bool inCallTipMode;
+ int posStartCallTip;
+ ColourDesired colourBG;
+ ColourDesired colourUnSel;
+ ColourDesired colourSel;
+ ColourDesired colourShade;
+ ColourDesired colourLight;
+ int codePage;
+ int clickPlace;
+
+ int insetX; // text inset in x from calltip border
+ int widthArrow;
+ int borderHeight;
+ int verticalOffset; // pixel offset up or down of the calltip with respect to the line
+
+ CallTip();
+ ~CallTip();
+
+ void PaintCT(Surface *surfaceWindow);
+
+ void MouseClick(Point pt);
+
+ /// Setup the calltip and return a rectangle of the area required.
+ PRectangle CallTipStart(int pos, Point pt, int textHeight, const char *defn,
+ const char *faceName, int size, int codePage_,
+ int characterSet, int technology, Window &wParent);
+
+ void CallTipCancel();
+
+ /// Set a range of characters to be displayed in a highlight style.
+ /// Commonly used to highlight the current parameter.
+ void SetHighlight(int start, int end);
+
+ /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand.
+ void SetTabSize(int tabSz);
+
+ /// Set calltip position.
+ void SetPosition(bool aboveText);
+
+ /// Used to determine which STYLE_xxxx to use for call tip information
+ bool UseStyleCallTip() const { return useStyleCallTip;}
+
+ // Modify foreground and background colours
+ void SetForeBack(const ColourDesired &fore, const ColourDesired &back);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.cxx
new file mode 100644
index 00000000000..e8f533d5cc3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.cxx
@@ -0,0 +1,634 @@
+// Scintilla source code edit control
+// Encoding: UTF-8
+/** @file CaseConvert.cxx
+ ** Case fold characters and convert them to upper or lower case.
+ ** Tables automatically regenerated by scripts/GenerateCaseConvert.py
+ ** Should only be rarely regenerated for new versions of Unicode.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <cstring>
+
+#include <vector>
+#include <algorithm>
+
+#include "StringCopy.h"
+#include "CaseConvert.h"
+#include "UniConversion.h"
+#include "UnicodeFromUTF8.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+namespace {
+ // Use an unnamed namespace to protect the declarations from name conflicts
+
+// Unicode code points are ordered by groups and follow patterns.
+// Most characters (pitch==1) are in ranges for a particular alphabet and their
+// upper case forms are a fixed distance away.
+// Another pattern (pitch==2) is where each lower case letter is preceded by
+// the upper case form. These are also grouped into ranges.
+
+int symmetricCaseConversionRanges[] = {
+//lower, upper, range length, range pitch
+//++Autogenerated -- start of section automatically generated
+//**\(\*\n\)
+97,65,26,1,
+224,192,23,1,
+248,216,7,1,
+257,256,24,2,
+314,313,8,2,
+331,330,23,2,
+462,461,8,2,
+479,478,9,2,
+505,504,20,2,
+547,546,9,2,
+583,582,5,2,
+945,913,17,1,
+963,931,9,1,
+985,984,12,2,
+1072,1040,32,1,
+1104,1024,16,1,
+1121,1120,17,2,
+1163,1162,27,2,
+1218,1217,7,2,
+1233,1232,44,2,
+1377,1329,38,1,
+7681,7680,75,2,
+7841,7840,48,2,
+7936,7944,8,1,
+7952,7960,6,1,
+7968,7976,8,1,
+7984,7992,8,1,
+8000,8008,6,1,
+8032,8040,8,1,
+8560,8544,16,1,
+9424,9398,26,1,
+11312,11264,47,1,
+11393,11392,50,2,
+11520,4256,38,1,
+42561,42560,23,2,
+42625,42624,12,2,
+42787,42786,7,2,
+42803,42802,31,2,
+42879,42878,5,2,
+42913,42912,5,2,
+65345,65313,26,1,
+66600,66560,40,1,
+
+//--Autogenerated -- end of section automatically generated
+};
+
+// Code points that are symmetric but don't fit into a range of similar characters
+// are listed here.
+
+int symmetricCaseConversions[] = {
+//lower, upper
+//++Autogenerated -- start of section automatically generated
+//**1 \(\*\n\)
+255,376,
+307,306,
+309,308,
+311,310,
+378,377,
+380,379,
+382,381,
+384,579,
+387,386,
+389,388,
+392,391,
+396,395,
+402,401,
+405,502,
+409,408,
+410,573,
+414,544,
+417,416,
+419,418,
+421,420,
+424,423,
+429,428,
+432,431,
+436,435,
+438,437,
+441,440,
+445,444,
+447,503,
+454,452,
+457,455,
+460,458,
+477,398,
+499,497,
+501,500,
+572,571,
+575,11390,
+576,11391,
+578,577,
+592,11375,
+593,11373,
+594,11376,
+595,385,
+596,390,
+598,393,
+599,394,
+601,399,
+603,400,
+608,403,
+611,404,
+613,42893,
+614,42922,
+616,407,
+617,406,
+619,11362,
+623,412,
+625,11374,
+626,413,
+629,415,
+637,11364,
+640,422,
+643,425,
+648,430,
+649,580,
+650,433,
+651,434,
+652,581,
+658,439,
+881,880,
+883,882,
+887,886,
+891,1021,
+892,1022,
+893,1023,
+940,902,
+941,904,
+942,905,
+943,906,
+972,908,
+973,910,
+974,911,
+983,975,
+1010,1017,
+1016,1015,
+1019,1018,
+1231,1216,
+7545,42877,
+7549,11363,
+8017,8025,
+8019,8027,
+8021,8029,
+8023,8031,
+8048,8122,
+8049,8123,
+8050,8136,
+8051,8137,
+8052,8138,
+8053,8139,
+8054,8154,
+8055,8155,
+8056,8184,
+8057,8185,
+8058,8170,
+8059,8171,
+8060,8186,
+8061,8187,
+8112,8120,
+8113,8121,
+8144,8152,
+8145,8153,
+8160,8168,
+8161,8169,
+8165,8172,
+8526,8498,
+8580,8579,
+11361,11360,
+11365,570,
+11366,574,
+11368,11367,
+11370,11369,
+11372,11371,
+11379,11378,
+11382,11381,
+11500,11499,
+11502,11501,
+11507,11506,
+11559,4295,
+11565,4301,
+42874,42873,
+42876,42875,
+42892,42891,
+42897,42896,
+42899,42898,
+
+//--Autogenerated -- end of section automatically generated
+};
+
+// Characters that have complex case conversions are listed here.
+// This includes cases where more than one character is needed for a conversion,
+// folding is different to lowering, or (as appropriate) upper(lower(x)) != x or
+// lower(upper(x)) != x.
+
+const char *complexCaseConversions =
+// Original | Folded | Upper | Lower |
+//++Autogenerated -- start of section automatically generated
+//**2 \(\*\n\)
+"\xc2\xb5|\xce\xbc|\xce\x9c||"
+"\xc3\x9f|ss|SS||"
+"\xc4\xb0|i\xcc\x87||i\xcc\x87|"
+"\xc4\xb1||I||"
+"\xc5\x89|\xca\xbcn|\xca\xbcN||"
+"\xc5\xbf|s|S||"
+"\xc7\x85|\xc7\x86|\xc7\x84|\xc7\x86|"
+"\xc7\x88|\xc7\x89|\xc7\x87|\xc7\x89|"
+"\xc7\x8b|\xc7\x8c|\xc7\x8a|\xc7\x8c|"
+"\xc7\xb0|j\xcc\x8c|J\xcc\x8c||"
+"\xc7\xb2|\xc7\xb3|\xc7\xb1|\xc7\xb3|"
+"\xcd\x85|\xce\xb9|\xce\x99||"
+"\xce\x90|\xce\xb9\xcc\x88\xcc\x81|\xce\x99\xcc\x88\xcc\x81||"
+"\xce\xb0|\xcf\x85\xcc\x88\xcc\x81|\xce\xa5\xcc\x88\xcc\x81||"
+"\xcf\x82|\xcf\x83|\xce\xa3||"
+"\xcf\x90|\xce\xb2|\xce\x92||"
+"\xcf\x91|\xce\xb8|\xce\x98||"
+"\xcf\x95|\xcf\x86|\xce\xa6||"
+"\xcf\x96|\xcf\x80|\xce\xa0||"
+"\xcf\xb0|\xce\xba|\xce\x9a||"
+"\xcf\xb1|\xcf\x81|\xce\xa1||"
+"\xcf\xb4|\xce\xb8||\xce\xb8|"
+"\xcf\xb5|\xce\xb5|\xce\x95||"
+"\xd6\x87|\xd5\xa5\xd6\x82|\xd4\xb5\xd5\x92||"
+"\xe1\xba\x96|h\xcc\xb1|H\xcc\xb1||"
+"\xe1\xba\x97|t\xcc\x88|T\xcc\x88||"
+"\xe1\xba\x98|w\xcc\x8a|W\xcc\x8a||"
+"\xe1\xba\x99|y\xcc\x8a|Y\xcc\x8a||"
+"\xe1\xba\x9a|a\xca\xbe|A\xca\xbe||"
+"\xe1\xba\x9b|\xe1\xb9\xa1|\xe1\xb9\xa0||"
+"\xe1\xba\x9e|ss||\xc3\x9f|"
+"\xe1\xbd\x90|\xcf\x85\xcc\x93|\xce\xa5\xcc\x93||"
+"\xe1\xbd\x92|\xcf\x85\xcc\x93\xcc\x80|\xce\xa5\xcc\x93\xcc\x80||"
+"\xe1\xbd\x94|\xcf\x85\xcc\x93\xcc\x81|\xce\xa5\xcc\x93\xcc\x81||"
+"\xe1\xbd\x96|\xcf\x85\xcc\x93\xcd\x82|\xce\xa5\xcc\x93\xcd\x82||"
+"\xe1\xbe\x80|\xe1\xbc\x80\xce\xb9|\xe1\xbc\x88\xce\x99||"
+"\xe1\xbe\x81|\xe1\xbc\x81\xce\xb9|\xe1\xbc\x89\xce\x99||"
+"\xe1\xbe\x82|\xe1\xbc\x82\xce\xb9|\xe1\xbc\x8a\xce\x99||"
+"\xe1\xbe\x83|\xe1\xbc\x83\xce\xb9|\xe1\xbc\x8b\xce\x99||"
+"\xe1\xbe\x84|\xe1\xbc\x84\xce\xb9|\xe1\xbc\x8c\xce\x99||"
+"\xe1\xbe\x85|\xe1\xbc\x85\xce\xb9|\xe1\xbc\x8d\xce\x99||"
+"\xe1\xbe\x86|\xe1\xbc\x86\xce\xb9|\xe1\xbc\x8e\xce\x99||"
+"\xe1\xbe\x87|\xe1\xbc\x87\xce\xb9|\xe1\xbc\x8f\xce\x99||"
+"\xe1\xbe\x88|\xe1\xbc\x80\xce\xb9|\xe1\xbc\x88\xce\x99|\xe1\xbe\x80|"
+"\xe1\xbe\x89|\xe1\xbc\x81\xce\xb9|\xe1\xbc\x89\xce\x99|\xe1\xbe\x81|"
+"\xe1\xbe\x8a|\xe1\xbc\x82\xce\xb9|\xe1\xbc\x8a\xce\x99|\xe1\xbe\x82|"
+"\xe1\xbe\x8b|\xe1\xbc\x83\xce\xb9|\xe1\xbc\x8b\xce\x99|\xe1\xbe\x83|"
+"\xe1\xbe\x8c|\xe1\xbc\x84\xce\xb9|\xe1\xbc\x8c\xce\x99|\xe1\xbe\x84|"
+"\xe1\xbe\x8d|\xe1\xbc\x85\xce\xb9|\xe1\xbc\x8d\xce\x99|\xe1\xbe\x85|"
+"\xe1\xbe\x8e|\xe1\xbc\x86\xce\xb9|\xe1\xbc\x8e\xce\x99|\xe1\xbe\x86|"
+"\xe1\xbe\x8f|\xe1\xbc\x87\xce\xb9|\xe1\xbc\x8f\xce\x99|\xe1\xbe\x87|"
+"\xe1\xbe\x90|\xe1\xbc\xa0\xce\xb9|\xe1\xbc\xa8\xce\x99||"
+"\xe1\xbe\x91|\xe1\xbc\xa1\xce\xb9|\xe1\xbc\xa9\xce\x99||"
+"\xe1\xbe\x92|\xe1\xbc\xa2\xce\xb9|\xe1\xbc\xaa\xce\x99||"
+"\xe1\xbe\x93|\xe1\xbc\xa3\xce\xb9|\xe1\xbc\xab\xce\x99||"
+"\xe1\xbe\x94|\xe1\xbc\xa4\xce\xb9|\xe1\xbc\xac\xce\x99||"
+"\xe1\xbe\x95|\xe1\xbc\xa5\xce\xb9|\xe1\xbc\xad\xce\x99||"
+"\xe1\xbe\x96|\xe1\xbc\xa6\xce\xb9|\xe1\xbc\xae\xce\x99||"
+"\xe1\xbe\x97|\xe1\xbc\xa7\xce\xb9|\xe1\xbc\xaf\xce\x99||"
+"\xe1\xbe\x98|\xe1\xbc\xa0\xce\xb9|\xe1\xbc\xa8\xce\x99|\xe1\xbe\x90|"
+"\xe1\xbe\x99|\xe1\xbc\xa1\xce\xb9|\xe1\xbc\xa9\xce\x99|\xe1\xbe\x91|"
+"\xe1\xbe\x9a|\xe1\xbc\xa2\xce\xb9|\xe1\xbc\xaa\xce\x99|\xe1\xbe\x92|"
+"\xe1\xbe\x9b|\xe1\xbc\xa3\xce\xb9|\xe1\xbc\xab\xce\x99|\xe1\xbe\x93|"
+"\xe1\xbe\x9c|\xe1\xbc\xa4\xce\xb9|\xe1\xbc\xac\xce\x99|\xe1\xbe\x94|"
+"\xe1\xbe\x9d|\xe1\xbc\xa5\xce\xb9|\xe1\xbc\xad\xce\x99|\xe1\xbe\x95|"
+"\xe1\xbe\x9e|\xe1\xbc\xa6\xce\xb9|\xe1\xbc\xae\xce\x99|\xe1\xbe\x96|"
+"\xe1\xbe\x9f|\xe1\xbc\xa7\xce\xb9|\xe1\xbc\xaf\xce\x99|\xe1\xbe\x97|"
+"\xe1\xbe\xa0|\xe1\xbd\xa0\xce\xb9|\xe1\xbd\xa8\xce\x99||"
+"\xe1\xbe\xa1|\xe1\xbd\xa1\xce\xb9|\xe1\xbd\xa9\xce\x99||"
+"\xe1\xbe\xa2|\xe1\xbd\xa2\xce\xb9|\xe1\xbd\xaa\xce\x99||"
+"\xe1\xbe\xa3|\xe1\xbd\xa3\xce\xb9|\xe1\xbd\xab\xce\x99||"
+"\xe1\xbe\xa4|\xe1\xbd\xa4\xce\xb9|\xe1\xbd\xac\xce\x99||"
+"\xe1\xbe\xa5|\xe1\xbd\xa5\xce\xb9|\xe1\xbd\xad\xce\x99||"
+"\xe1\xbe\xa6|\xe1\xbd\xa6\xce\xb9|\xe1\xbd\xae\xce\x99||"
+"\xe1\xbe\xa7|\xe1\xbd\xa7\xce\xb9|\xe1\xbd\xaf\xce\x99||"
+"\xe1\xbe\xa8|\xe1\xbd\xa0\xce\xb9|\xe1\xbd\xa8\xce\x99|\xe1\xbe\xa0|"
+"\xe1\xbe\xa9|\xe1\xbd\xa1\xce\xb9|\xe1\xbd\xa9\xce\x99|\xe1\xbe\xa1|"
+"\xe1\xbe\xaa|\xe1\xbd\xa2\xce\xb9|\xe1\xbd\xaa\xce\x99|\xe1\xbe\xa2|"
+"\xe1\xbe\xab|\xe1\xbd\xa3\xce\xb9|\xe1\xbd\xab\xce\x99|\xe1\xbe\xa3|"
+"\xe1\xbe\xac|\xe1\xbd\xa4\xce\xb9|\xe1\xbd\xac\xce\x99|\xe1\xbe\xa4|"
+"\xe1\xbe\xad|\xe1\xbd\xa5\xce\xb9|\xe1\xbd\xad\xce\x99|\xe1\xbe\xa5|"
+"\xe1\xbe\xae|\xe1\xbd\xa6\xce\xb9|\xe1\xbd\xae\xce\x99|\xe1\xbe\xa6|"
+"\xe1\xbe\xaf|\xe1\xbd\xa7\xce\xb9|\xe1\xbd\xaf\xce\x99|\xe1\xbe\xa7|"
+"\xe1\xbe\xb2|\xe1\xbd\xb0\xce\xb9|\xe1\xbe\xba\xce\x99||"
+"\xe1\xbe\xb3|\xce\xb1\xce\xb9|\xce\x91\xce\x99||"
+"\xe1\xbe\xb4|\xce\xac\xce\xb9|\xce\x86\xce\x99||"
+"\xe1\xbe\xb6|\xce\xb1\xcd\x82|\xce\x91\xcd\x82||"
+"\xe1\xbe\xb7|\xce\xb1\xcd\x82\xce\xb9|\xce\x91\xcd\x82\xce\x99||"
+"\xe1\xbe\xbc|\xce\xb1\xce\xb9|\xce\x91\xce\x99|\xe1\xbe\xb3|"
+"\xe1\xbe\xbe|\xce\xb9|\xce\x99||"
+"\xe1\xbf\x82|\xe1\xbd\xb4\xce\xb9|\xe1\xbf\x8a\xce\x99||"
+"\xe1\xbf\x83|\xce\xb7\xce\xb9|\xce\x97\xce\x99||"
+"\xe1\xbf\x84|\xce\xae\xce\xb9|\xce\x89\xce\x99||"
+"\xe1\xbf\x86|\xce\xb7\xcd\x82|\xce\x97\xcd\x82||"
+"\xe1\xbf\x87|\xce\xb7\xcd\x82\xce\xb9|\xce\x97\xcd\x82\xce\x99||"
+"\xe1\xbf\x8c|\xce\xb7\xce\xb9|\xce\x97\xce\x99|\xe1\xbf\x83|"
+"\xe1\xbf\x92|\xce\xb9\xcc\x88\xcc\x80|\xce\x99\xcc\x88\xcc\x80||"
+"\xe1\xbf\x93|\xce\xb9\xcc\x88\xcc\x81|\xce\x99\xcc\x88\xcc\x81||"
+"\xe1\xbf\x96|\xce\xb9\xcd\x82|\xce\x99\xcd\x82||"
+"\xe1\xbf\x97|\xce\xb9\xcc\x88\xcd\x82|\xce\x99\xcc\x88\xcd\x82||"
+"\xe1\xbf\xa2|\xcf\x85\xcc\x88\xcc\x80|\xce\xa5\xcc\x88\xcc\x80||"
+"\xe1\xbf\xa3|\xcf\x85\xcc\x88\xcc\x81|\xce\xa5\xcc\x88\xcc\x81||"
+"\xe1\xbf\xa4|\xcf\x81\xcc\x93|\xce\xa1\xcc\x93||"
+"\xe1\xbf\xa6|\xcf\x85\xcd\x82|\xce\xa5\xcd\x82||"
+"\xe1\xbf\xa7|\xcf\x85\xcc\x88\xcd\x82|\xce\xa5\xcc\x88\xcd\x82||"
+"\xe1\xbf\xb2|\xe1\xbd\xbc\xce\xb9|\xe1\xbf\xba\xce\x99||"
+"\xe1\xbf\xb3|\xcf\x89\xce\xb9|\xce\xa9\xce\x99||"
+"\xe1\xbf\xb4|\xcf\x8e\xce\xb9|\xce\x8f\xce\x99||"
+"\xe1\xbf\xb6|\xcf\x89\xcd\x82|\xce\xa9\xcd\x82||"
+"\xe1\xbf\xb7|\xcf\x89\xcd\x82\xce\xb9|\xce\xa9\xcd\x82\xce\x99||"
+"\xe1\xbf\xbc|\xcf\x89\xce\xb9|\xce\xa9\xce\x99|\xe1\xbf\xb3|"
+"\xe2\x84\xa6|\xcf\x89||\xcf\x89|"
+"\xe2\x84\xaa|k||k|"
+"\xe2\x84\xab|\xc3\xa5||\xc3\xa5|"
+"\xef\xac\x80|ff|FF||"
+"\xef\xac\x81|fi|FI||"
+"\xef\xac\x82|fl|FL||"
+"\xef\xac\x83|ffi|FFI||"
+"\xef\xac\x84|ffl|FFL||"
+"\xef\xac\x85|st|ST||"
+"\xef\xac\x86|st|ST||"
+"\xef\xac\x93|\xd5\xb4\xd5\xb6|\xd5\x84\xd5\x86||"
+"\xef\xac\x94|\xd5\xb4\xd5\xa5|\xd5\x84\xd4\xb5||"
+"\xef\xac\x95|\xd5\xb4\xd5\xab|\xd5\x84\xd4\xbb||"
+"\xef\xac\x96|\xd5\xbe\xd5\xb6|\xd5\x8e\xd5\x86||"
+"\xef\xac\x97|\xd5\xb4\xd5\xad|\xd5\x84\xd4\xbd||"
+
+//--Autogenerated -- end of section automatically generated
+;
+
+class CaseConverter : public ICaseConverter {
+ // Maximum length of a case conversion result is 6 bytes in UTF-8
+ enum { maxConversionLength=6 };
+ struct ConversionString {
+ char conversion[maxConversionLength+1];
+ ConversionString() {
+ conversion[0] = '\0';
+ }
+ };
+ // Conversions are initially store in a vector of structs but then decomposed into
+ // parallel arrays as that is about 10% faster to search.
+ struct CharacterConversion {
+ int character;
+ ConversionString conversion;
+ CharacterConversion(int character_=0, const char *conversion_="") : character(character_) {
+ StringCopy(conversion.conversion, conversion_);
+ }
+ bool operator<(const CharacterConversion &other) const {
+ return character < other.character;
+ }
+ };
+ typedef std::vector<CharacterConversion> CharacterToConversion;
+ CharacterToConversion characterToConversion;
+ // The parallel arrays
+ std::vector<int> characters;
+ std::vector<ConversionString> conversions;
+
+public:
+ CaseConverter() {
+ }
+ bool Initialised() const {
+ return characters.size() > 0;
+ }
+ void Add(int character, const char *conversion) {
+ characterToConversion.push_back(CharacterConversion(character, conversion));
+ }
+ const char *Find(int character) {
+ const std::vector<int>::iterator it = std::lower_bound(characters.begin(), characters.end(), character);
+ if (it == characters.end())
+ return 0;
+ else if (*it == character)
+ return conversions[it - characters.begin()].conversion;
+ else
+ return 0;
+ }
+ size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) {
+ size_t lenConverted = 0;
+ size_t mixedPos = 0;
+ unsigned char bytes[UTF8MaxBytes + 1];
+ while (mixedPos < lenMixed) {
+ const unsigned char leadByte = static_cast<unsigned char>(mixed[mixedPos]);
+ const char *caseConverted = 0;
+ size_t lenMixedChar = 1;
+ if (UTF8IsAscii(leadByte)) {
+ caseConverted = Find(leadByte);
+ } else {
+ bytes[0] = leadByte;
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ for (int b=1; b<widthCharBytes; b++) {
+ bytes[b] = (mixedPos+b < lenMixed) ? mixed[mixedPos+b] : 0;
+ }
+ int classified = UTF8Classify(bytes, widthCharBytes);
+ if (!(classified & UTF8MaskInvalid)) {
+ // valid UTF-8
+ lenMixedChar = classified & UTF8MaskWidth;
+ int character = UnicodeFromUTF8(bytes);
+ caseConverted = Find(character);
+ }
+ }
+ if (caseConverted) {
+ // Character has a conversion so copy that conversion in
+ while (*caseConverted) {
+ converted[lenConverted++] = *caseConverted++;
+ if (lenConverted >= sizeConverted)
+ return 0;
+ }
+ } else {
+ // Character has no conversion so copy the input to output
+ for (size_t i=0; i<lenMixedChar; i++) {
+ converted[lenConverted++] = mixed[mixedPos+i];
+ if (lenConverted >= sizeConverted)
+ return 0;
+ }
+ }
+ mixedPos += lenMixedChar;
+ }
+ return lenConverted;
+ }
+ void FinishedAdding() {
+ std::sort(characterToConversion.begin(), characterToConversion.end());
+ characters.reserve(characterToConversion.size());
+ conversions.reserve(characterToConversion.size());
+ for (CharacterToConversion::iterator it = characterToConversion.begin(); it != characterToConversion.end(); ++it) {
+ characters.push_back(it->character);
+ conversions.push_back(it->conversion);
+ }
+ // Empty the original calculated data completely
+ CharacterToConversion().swap(characterToConversion);
+ }
+};
+
+CaseConverter caseConvFold;
+CaseConverter caseConvUp;
+CaseConverter caseConvLow;
+
+void UTF8FromUTF32Character(int uch, char *putf) {
+ size_t k = 0;
+ if (uch < 0x80) {
+ putf[k++] = static_cast<char>(uch);
+ } else if (uch < 0x800) {
+ putf[k++] = static_cast<char>(0xC0 | (uch >> 6));
+ putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
+ } else if (uch < 0x10000) {
+ putf[k++] = static_cast<char>(0xE0 | (uch >> 12));
+ putf[k++] = static_cast<char>(0x80 | ((uch >> 6) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
+ } else {
+ putf[k++] = static_cast<char>(0xF0 | (uch >> 18));
+ putf[k++] = static_cast<char>(0x80 | ((uch >> 12) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | ((uch >> 6) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
+ }
+ putf[k] = 0;
+}
+
+void AddSymmetric(enum CaseConversion conversion, int lower,int upper) {
+ char lowerUTF8[UTF8MaxBytes+1];
+ UTF8FromUTF32Character(lower, lowerUTF8);
+ char upperUTF8[UTF8MaxBytes+1];
+ UTF8FromUTF32Character(upper, upperUTF8);
+
+ switch (conversion) {
+ case CaseConversionFold:
+ caseConvFold.Add(upper, lowerUTF8);
+ break;
+ case CaseConversionUpper:
+ caseConvUp.Add(lower, upperUTF8);
+ break;
+ case CaseConversionLower:
+ caseConvLow.Add(upper, lowerUTF8);
+ break;
+ }
+}
+
+void SetupConversions(enum CaseConversion conversion) {
+ // First initialize for the symmetric ranges
+ for (size_t i=0; i<ELEMENTS(symmetricCaseConversionRanges);) {
+ int lower = symmetricCaseConversionRanges[i++];
+ int upper = symmetricCaseConversionRanges[i++];
+ int length = symmetricCaseConversionRanges[i++];
+ int pitch = symmetricCaseConversionRanges[i++];
+ for (int j=0; j<length*pitch; j+=pitch) {
+ AddSymmetric(conversion, lower+j, upper+j);
+ }
+ }
+ // Add the symmetric singletons
+ for (size_t i=0; i<ELEMENTS(symmetricCaseConversions);) {
+ int lower = symmetricCaseConversions[i++];
+ int upper = symmetricCaseConversions[i++];
+ AddSymmetric(conversion, lower, upper);
+ }
+ // Add the complex cases
+ const char *sComplex = complexCaseConversions;
+ while (*sComplex) {
+ // Longest ligature is 3 character so 5 for safety
+ const size_t lenUTF8 = 5*UTF8MaxBytes+1;
+ char originUTF8[lenUTF8];
+ char foldedUTF8[lenUTF8];
+ char lowerUTF8[lenUTF8];
+ char upperUTF8[lenUTF8];
+ size_t i = 0;
+ while (*sComplex && *sComplex != '|') {
+ originUTF8[i++] = *sComplex;
+ sComplex++;
+ }
+ sComplex++;
+ originUTF8[i] = 0;
+ i = 0;
+ while (*sComplex && *sComplex != '|') {
+ foldedUTF8[i++] = *sComplex;
+ sComplex++;
+ }
+ sComplex++;
+ foldedUTF8[i] = 0;
+ i = 0;
+ while (*sComplex && *sComplex != '|') {
+ upperUTF8[i++] = *sComplex;
+ sComplex++;
+ }
+ sComplex++;
+ upperUTF8[i] = 0;
+ i = 0;
+ while (*sComplex && *sComplex != '|') {
+ lowerUTF8[i++] = *sComplex;
+ sComplex++;
+ }
+ sComplex++;
+ lowerUTF8[i] = 0;
+
+ int character = UnicodeFromUTF8(reinterpret_cast<unsigned char *>(originUTF8));
+
+ if (conversion == CaseConversionFold && foldedUTF8[0]) {
+ caseConvFold.Add(character, foldedUTF8);
+ }
+
+ if (conversion == CaseConversionUpper && upperUTF8[0]) {
+ caseConvUp.Add(character, upperUTF8);
+ }
+
+ if (conversion == CaseConversionLower && lowerUTF8[0]) {
+ caseConvLow.Add(character, lowerUTF8);
+ }
+ }
+
+ switch (conversion) {
+ case CaseConversionFold:
+ caseConvFold.FinishedAdding();
+ break;
+ case CaseConversionUpper:
+ caseConvUp.FinishedAdding();
+ break;
+ case CaseConversionLower:
+ caseConvLow.FinishedAdding();
+ break;
+ }
+}
+
+CaseConverter *ConverterForConversion(enum CaseConversion conversion) {
+ switch (conversion) {
+ case CaseConversionFold:
+ return &caseConvFold;
+ case CaseConversionUpper:
+ return &caseConvUp;
+ case CaseConversionLower:
+ return &caseConvLow;
+ }
+ return 0;
+}
+
+}
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+ICaseConverter *ConverterFor(enum CaseConversion conversion) {
+ CaseConverter *pCaseConv = ConverterForConversion(conversion);
+ if (!pCaseConv->Initialised())
+ SetupConversions(conversion);
+ return pCaseConv;
+}
+
+const char *CaseConvert(int character, enum CaseConversion conversion) {
+ CaseConverter *pCaseConv = ConverterForConversion(conversion);
+ if (!pCaseConv->Initialised())
+ SetupConversions(conversion);
+ return pCaseConv->Find(character);
+}
+
+size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed, enum CaseConversion conversion) {
+ CaseConverter *pCaseConv = ConverterForConversion(conversion);
+ if (!pCaseConv->Initialised())
+ SetupConversions(conversion);
+ return pCaseConv->CaseConvertString(converted, sizeConverted, mixed, lenMixed);
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.h b/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.h
new file mode 100644
index 00000000000..60de227995b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CaseConvert.h
@@ -0,0 +1,47 @@
+// Scintilla source code edit control
+// Encoding: UTF-8
+/** @file CaseConvert.h
+ ** Performs Unicode case conversions.
+ ** Does not handle locale-sensitive case conversion.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CASECONVERT_H
+#define CASECONVERT_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+enum CaseConversion {
+ CaseConversionFold,
+ CaseConversionUpper,
+ CaseConversionLower
+};
+
+class ICaseConverter {
+public:
+ virtual size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) = 0;
+};
+
+ICaseConverter *ConverterFor(enum CaseConversion conversion);
+
+// Returns a UTF-8 string. Empty when no conversion
+const char *CaseConvert(int character, enum CaseConversion conversion);
+
+// When performing CaseConvertString, the converted value may be up to 3 times longer than the input.
+// Ligatures are often decomposed into multiple characters and long cases include:
+// Î "\xce\x90" folds to Î¹ÌˆÌ "\xce\xb9\xcc\x88\xcc\x81"
+const int maxExpansionCaseConversion=3;
+
+// Converts a mixed case string using a particular conversion.
+// Result may be a different length to input and the length is the return value.
+// If there is not enough space then 0 is returned.
+size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed, enum CaseConversion conversion);
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.cxx
new file mode 100644
index 00000000000..200ac99b8e9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.cxx
@@ -0,0 +1,68 @@
+// Scintilla source code edit control
+/** @file CaseFolder.cxx
+ ** Classes for case folding.
+ **/
+// Copyright 1998-2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <vector>
+#include <algorithm>
+
+#include "CaseFolder.h"
+#include "CaseConvert.h"
+#include "UniConversion.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+CaseFolder::~CaseFolder() {
+}
+
+CaseFolderTable::CaseFolderTable() {
+ for (size_t iChar=0; iChar<sizeof(mapping); iChar++) {
+ mapping[iChar] = static_cast<char>(iChar);
+ }
+}
+
+CaseFolderTable::~CaseFolderTable() {
+}
+
+size_t CaseFolderTable::Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if (lenMixed > sizeFolded) {
+ return 0;
+ } else {
+ for (size_t i=0; i<lenMixed; i++) {
+ folded[i] = mapping[static_cast<unsigned char>(mixed[i])];
+ }
+ return lenMixed;
+ }
+}
+
+void CaseFolderTable::SetTranslation(char ch, char chTranslation) {
+ mapping[static_cast<unsigned char>(ch)] = chTranslation;
+}
+
+void CaseFolderTable::StandardASCII() {
+ for (size_t iChar=0; iChar<sizeof(mapping); iChar++) {
+ if (iChar >= 'A' && iChar <= 'Z') {
+ mapping[iChar] = static_cast<char>(iChar - 'A' + 'a');
+ } else {
+ mapping[iChar] = static_cast<char>(iChar);
+ }
+ }
+}
+
+CaseFolderUnicode::CaseFolderUnicode() {
+ StandardASCII();
+ converter = ConverterFor(CaseConversionFold);
+}
+
+size_t CaseFolderUnicode::Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if ((lenMixed == 1) && (sizeFolded > 0)) {
+ folded[0] = mapping[static_cast<unsigned char>(mixed[0])];
+ return 1;
+ } else {
+ return converter->CaseConvertString(folded, sizeFolded, mixed, lenMixed);
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.h b/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.h
new file mode 100644
index 00000000000..2d754d4f38a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CaseFolder.h
@@ -0,0 +1,45 @@
+// Scintilla source code edit control
+/** @file CaseFolder.h
+ ** Classes for case folding.
+ **/
+// Copyright 1998-2013 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CASEFOLDER_H
+#define CASEFOLDER_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class CaseFolder {
+public:
+ virtual ~CaseFolder();
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) = 0;
+};
+
+class CaseFolderTable : public CaseFolder {
+protected:
+ char mapping[256];
+public:
+ CaseFolderTable();
+ virtual ~CaseFolderTable();
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed);
+ void SetTranslation(char ch, char chTranslation);
+ void StandardASCII();
+};
+
+class ICaseConverter;
+
+class CaseFolderUnicode : public CaseFolderTable {
+ ICaseConverter *converter;
+public:
+ CaseFolderUnicode();
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.cxx
new file mode 100644
index 00000000000..b02a0108ce1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.cxx
@@ -0,0 +1,199 @@
+// Scintilla source code edit control
+/** @file Catalogue.cxx
+ ** Colourise for particular languages.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <vector>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "LexerModule.h"
+#include "Catalogue.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static std::vector<LexerModule *> lexerCatalogue;
+static int nextLanguage = SCLEX_AUTOMATIC+1;
+
+const LexerModule *Catalogue::Find(int language) {
+ Scintilla_LinkLexers();
+ for (std::vector<LexerModule *>::iterator it=lexerCatalogue.begin();
+ it != lexerCatalogue.end(); ++it) {
+ if ((*it)->GetLanguage() == language) {
+ return *it;
+ }
+ }
+ return 0;
+}
+
+const LexerModule *Catalogue::Find(const char *languageName) {
+ Scintilla_LinkLexers();
+ if (languageName) {
+ for (std::vector<LexerModule *>::iterator it=lexerCatalogue.begin();
+ it != lexerCatalogue.end(); ++it) {
+ if ((*it)->languageName && (0 == strcmp((*it)->languageName, languageName))) {
+ return *it;
+ }
+ }
+ }
+ return 0;
+}
+
+void Catalogue::AddLexerModule(LexerModule *plm) {
+ if (plm->GetLanguage() == SCLEX_AUTOMATIC) {
+ plm->language = nextLanguage;
+ nextLanguage++;
+ }
+ lexerCatalogue.push_back(plm);
+}
+
+// To add or remove a lexer, add or remove its file and run LexGen.py.
+
+// Force a reference to all of the Scintilla lexers so that the linker will
+// not remove the code of the lexers.
+int Scintilla_LinkLexers() {
+
+ static int initialised = 0;
+ if (initialised)
+ return 0;
+ initialised = 1;
+
+// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
+#define LINK_LEXER(lexer) extern LexerModule lexer; Catalogue::AddLexerModule(&lexer);
+
+//++Autogenerated -- run scripts/LexGen.py to regenerate
+//**\(\tLINK_LEXER(\*);\n\)
+ LINK_LEXER(lmA68k);
+ LINK_LEXER(lmAbaqus);
+ LINK_LEXER(lmAda);
+ LINK_LEXER(lmAPDL);
+ LINK_LEXER(lmAs);
+ LINK_LEXER(lmAsm);
+ LINK_LEXER(lmAsn1);
+ LINK_LEXER(lmASY);
+ LINK_LEXER(lmAU3);
+ LINK_LEXER(lmAVE);
+ LINK_LEXER(lmAVS);
+ LINK_LEXER(lmBaan);
+ LINK_LEXER(lmBash);
+ LINK_LEXER(lmBatch);
+ LINK_LEXER(lmBibTeX);
+ LINK_LEXER(lmBlitzBasic);
+ LINK_LEXER(lmBullant);
+ LINK_LEXER(lmCaml);
+ LINK_LEXER(lmClw);
+ LINK_LEXER(lmClwNoCase);
+ LINK_LEXER(lmCmake);
+ LINK_LEXER(lmCOBOL);
+ LINK_LEXER(lmCoffeeScript);
+ LINK_LEXER(lmConf);
+ LINK_LEXER(lmCPP);
+ LINK_LEXER(lmCPPNoCase);
+ LINK_LEXER(lmCsound);
+ LINK_LEXER(lmCss);
+ LINK_LEXER(lmD);
+ LINK_LEXER(lmDiff);
+ LINK_LEXER(lmDMAP);
+ LINK_LEXER(lmDMIS);
+ LINK_LEXER(lmECL);
+ LINK_LEXER(lmEiffel);
+ LINK_LEXER(lmEiffelkw);
+ LINK_LEXER(lmErlang);
+ LINK_LEXER(lmErrorList);
+ LINK_LEXER(lmESCRIPT);
+ LINK_LEXER(lmF77);
+ LINK_LEXER(lmFlagShip);
+ LINK_LEXER(lmForth);
+ LINK_LEXER(lmFortran);
+ LINK_LEXER(lmFreeBasic);
+ LINK_LEXER(lmGAP);
+ LINK_LEXER(lmGui4Cli);
+ LINK_LEXER(lmHaskell);
+ LINK_LEXER(lmHTML);
+ LINK_LEXER(lmIHex);
+ LINK_LEXER(lmInno);
+ LINK_LEXER(lmKix);
+ LINK_LEXER(lmKVIrc);
+ LINK_LEXER(lmLatex);
+ LINK_LEXER(lmLISP);
+ LINK_LEXER(lmLiterateHaskell);
+ LINK_LEXER(lmLot);
+ LINK_LEXER(lmLout);
+ LINK_LEXER(lmLua);
+ LINK_LEXER(lmMagikSF);
+ LINK_LEXER(lmMake);
+ LINK_LEXER(lmMarkdown);
+ LINK_LEXER(lmMatlab);
+ LINK_LEXER(lmMETAPOST);
+ LINK_LEXER(lmMMIXAL);
+ LINK_LEXER(lmModula);
+ LINK_LEXER(lmMSSQL);
+ LINK_LEXER(lmMySQL);
+ LINK_LEXER(lmNimrod);
+ LINK_LEXER(lmNncrontab);
+ LINK_LEXER(lmNsis);
+ LINK_LEXER(lmNull);
+ LINK_LEXER(lmOctave);
+ LINK_LEXER(lmOpal);
+ LINK_LEXER(lmOScript);
+ LINK_LEXER(lmPascal);
+ LINK_LEXER(lmPB);
+ LINK_LEXER(lmPerl);
+ LINK_LEXER(lmPHPSCRIPT);
+ LINK_LEXER(lmPLM);
+ LINK_LEXER(lmPO);
+ LINK_LEXER(lmPOV);
+ LINK_LEXER(lmPowerPro);
+ LINK_LEXER(lmPowerShell);
+ LINK_LEXER(lmProgress);
+ LINK_LEXER(lmProps);
+ LINK_LEXER(lmPS);
+ LINK_LEXER(lmPureBasic);
+ LINK_LEXER(lmPython);
+ LINK_LEXER(lmR);
+ LINK_LEXER(lmREBOL);
+ LINK_LEXER(lmRegistry);
+ LINK_LEXER(lmRuby);
+ LINK_LEXER(lmRust);
+ LINK_LEXER(lmScriptol);
+ LINK_LEXER(lmSmalltalk);
+ LINK_LEXER(lmSML);
+ LINK_LEXER(lmSorc);
+ LINK_LEXER(lmSpecman);
+ LINK_LEXER(lmSpice);
+ LINK_LEXER(lmSQL);
+ LINK_LEXER(lmSrec);
+ LINK_LEXER(lmSTTXT);
+ LINK_LEXER(lmTACL);
+ LINK_LEXER(lmTADS3);
+ LINK_LEXER(lmTAL);
+ LINK_LEXER(lmTCL);
+ LINK_LEXER(lmTCMD);
+ LINK_LEXER(lmTEHex);
+ LINK_LEXER(lmTeX);
+ LINK_LEXER(lmTxt2tags);
+ LINK_LEXER(lmVB);
+ LINK_LEXER(lmVBScript);
+ LINK_LEXER(lmVerilog);
+ LINK_LEXER(lmVHDL);
+ LINK_LEXER(lmVisualProlog);
+ LINK_LEXER(lmXML);
+ LINK_LEXER(lmYAML);
+
+//--Autogenerated -- end of automatically generated section
+
+ return 1;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.h b/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.h
new file mode 100644
index 00000000000..7fea37da802
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Catalogue.h
@@ -0,0 +1,26 @@
+// Scintilla source code edit control
+/** @file Catalogue.h
+ ** Lexer infrastructure.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CATALOGUE_H
+#define CATALOGUE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class Catalogue {
+public:
+ static const LexerModule *Find(int language);
+ static const LexerModule *Find(const char *languageName);
+ static void AddLexerModule(LexerModule *plm);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.cxx
new file mode 100644
index 00000000000..b5b3f17e9dc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.cxx
@@ -0,0 +1,824 @@
+// Scintilla source code edit control
+/** @file CellBuffer.cxx
+ ** Manages a buffer of cells.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <stdexcept>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "CellBuffer.h"
+#include "UniConversion.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LineVector::LineVector() : starts(256), perLine(0) {
+ Init();
+}
+
+LineVector::~LineVector() {
+ starts.DeleteAll();
+}
+
+void LineVector::Init() {
+ starts.DeleteAll();
+ if (perLine) {
+ perLine->Init();
+ }
+}
+
+void LineVector::SetPerLine(PerLine *pl) {
+ perLine = pl;
+}
+
+void LineVector::InsertText(int line, int delta) {
+ starts.InsertText(line, delta);
+}
+
+void LineVector::InsertLine(int line, int position, bool lineStart) {
+ starts.InsertPartition(line, position);
+ if (perLine) {
+ if ((line > 0) && lineStart)
+ line--;
+ perLine->InsertLine(line);
+ }
+}
+
+void LineVector::SetLineStart(int line, int position) {
+ starts.SetPartitionStartPosition(line, position);
+}
+
+void LineVector::RemoveLine(int line) {
+ starts.RemovePartition(line);
+ if (perLine) {
+ perLine->RemoveLine(line);
+ }
+}
+
+int LineVector::LineFromPosition(int pos) const {
+ return starts.PartitionFromPosition(pos);
+}
+
+Action::Action() {
+ at = startAction;
+ position = 0;
+ data = 0;
+ lenData = 0;
+ mayCoalesce = false;
+}
+
+Action::~Action() {
+ Destroy();
+}
+
+void Action::Create(actionType at_, int position_, const char *data_, int lenData_, bool mayCoalesce_) {
+ delete []data;
+ data = NULL;
+ position = position_;
+ at = at_;
+ if (lenData_) {
+ data = new char[lenData_];
+ memcpy(data, data_, lenData_);
+ }
+ lenData = lenData_;
+ mayCoalesce = mayCoalesce_;
+}
+
+void Action::Destroy() {
+ delete []data;
+ data = 0;
+}
+
+void Action::Grab(Action *source) {
+ delete []data;
+
+ position = source->position;
+ at = source->at;
+ data = source->data;
+ lenData = source->lenData;
+ mayCoalesce = source->mayCoalesce;
+
+ // Ownership of source data transferred to this
+ source->position = 0;
+ source->at = startAction;
+ source->data = 0;
+ source->lenData = 0;
+ source->mayCoalesce = true;
+}
+
+// The undo history stores a sequence of user operations that represent the user's view of the
+// commands executed on the text.
+// Each user operation contains a sequence of text insertion and text deletion actions.
+// All the user operations are stored in a list of individual actions with 'start' actions used
+// as delimiters between user operations.
+// Initially there is one start action in the history.
+// As each action is performed, it is recorded in the history. The action may either become
+// part of the current user operation or may start a new user operation. If it is to be part of the
+// current operation, then it overwrites the current last action. If it is to be part of a new
+// operation, it is appended after the current last action.
+// After writing the new action, a new start action is appended at the end of the history.
+// The decision of whether to start a new user operation is based upon two factors. If a
+// compound operation has been explicitly started by calling BeginUndoAction and no matching
+// EndUndoAction (these calls nest) has been called, then the action is coalesced into the current
+// operation. If there is no outstanding BeginUndoAction call then a new operation is started
+// unless it looks as if the new action is caused by the user typing or deleting a stream of text.
+// Sequences that look like typing or deletion are coalesced into a single user operation.
+
+UndoHistory::UndoHistory() {
+
+ lenActions = 100;
+ actions = new Action[lenActions];
+ maxAction = 0;
+ currentAction = 0;
+ undoSequenceDepth = 0;
+ savePoint = 0;
+ tentativePoint = -1;
+
+ actions[currentAction].Create(startAction);
+}
+
+UndoHistory::~UndoHistory() {
+ delete []actions;
+ actions = 0;
+}
+
+void UndoHistory::EnsureUndoRoom() {
+ // Have to test that there is room for 2 more actions in the array
+ // as two actions may be created by the calling function
+ if (currentAction >= (lenActions - 2)) {
+ // Run out of undo nodes so extend the array
+ int lenActionsNew = lenActions * 2;
+ Action *actionsNew = new Action[lenActionsNew];
+ for (int act = 0; act <= currentAction; act++)
+ actionsNew[act].Grab(&actions[act]);
+ delete []actions;
+ lenActions = lenActionsNew;
+ actions = actionsNew;
+ }
+}
+
+const char *UndoHistory::AppendAction(actionType at, int position, const char *data, int lengthData,
+ bool &startSequence, bool mayCoalesce) {
+ EnsureUndoRoom();
+ //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction);
+ //Platform::DebugPrintf("^ %d action %d %d\n", actions[currentAction - 1].at,
+ // actions[currentAction - 1].position, actions[currentAction - 1].lenData);
+ if (currentAction < savePoint) {
+ savePoint = -1;
+ }
+ int oldCurrentAction = currentAction;
+ if (currentAction >= 1) {
+ if (0 == undoSequenceDepth) {
+ // Top level actions may not always be coalesced
+ int targetAct = -1;
+ const Action *actPrevious = &(actions[currentAction + targetAct]);
+ // Container actions may forward the coalesce state of Scintilla Actions.
+ while ((actPrevious->at == containerAction) && actPrevious->mayCoalesce) {
+ targetAct--;
+ actPrevious = &(actions[currentAction + targetAct]);
+ }
+ // See if current action can be coalesced into previous action
+ // Will work if both are inserts or deletes and position is same
+#if defined(_MSC_VER) && defined(_PREFAST_)
+ // Visual Studio 2013 Code Analysis wrongly believes actions can be NULL at its next reference
+ __analysis_assume(actions);
+#endif
+ if ((currentAction == savePoint) || (currentAction == tentativePoint)) {
+ currentAction++;
+ } else if (!actions[currentAction].mayCoalesce) {
+ // Not allowed to coalesce if this set
+ currentAction++;
+ } else if (!mayCoalesce || !actPrevious->mayCoalesce) {
+ currentAction++;
+ } else if (at == containerAction || actions[currentAction].at == containerAction) {
+ ; // A coalescible containerAction
+ } else if ((at != actPrevious->at) && (actPrevious->at != startAction)) {
+ currentAction++;
+ } else if ((at == insertAction) &&
+ (position != (actPrevious->position + actPrevious->lenData))) {
+ // Insertions must be immediately after to coalesce
+ currentAction++;
+ } else if (at == removeAction) {
+ if ((lengthData == 1) || (lengthData == 2)) {
+ if ((position + lengthData) == actPrevious->position) {
+ ; // Backspace -> OK
+ } else if (position == actPrevious->position) {
+ ; // Delete -> OK
+ } else {
+ // Removals must be at same position to coalesce
+ currentAction++;
+ }
+ } else {
+ // Removals must be of one character to coalesce
+ currentAction++;
+ }
+ } else {
+ // Action coalesced.
+ }
+
+ } else {
+ // Actions not at top level are always coalesced unless this is after return to top level
+ if (!actions[currentAction].mayCoalesce)
+ currentAction++;
+ }
+ } else {
+ currentAction++;
+ }
+ startSequence = oldCurrentAction != currentAction;
+ int actionWithData = currentAction;
+ actions[currentAction].Create(at, position, data, lengthData, mayCoalesce);
+ currentAction++;
+ actions[currentAction].Create(startAction);
+ maxAction = currentAction;
+ return actions[actionWithData].data;
+}
+
+void UndoHistory::BeginUndoAction() {
+ EnsureUndoRoom();
+ if (undoSequenceDepth == 0) {
+ if (actions[currentAction].at != startAction) {
+ currentAction++;
+ actions[currentAction].Create(startAction);
+ maxAction = currentAction;
+ }
+ actions[currentAction].mayCoalesce = false;
+ }
+ undoSequenceDepth++;
+}
+
+void UndoHistory::EndUndoAction() {
+ PLATFORM_ASSERT(undoSequenceDepth > 0);
+ EnsureUndoRoom();
+ undoSequenceDepth--;
+ if (0 == undoSequenceDepth) {
+ if (actions[currentAction].at != startAction) {
+ currentAction++;
+ actions[currentAction].Create(startAction);
+ maxAction = currentAction;
+ }
+ actions[currentAction].mayCoalesce = false;
+ }
+}
+
+void UndoHistory::DropUndoSequence() {
+ undoSequenceDepth = 0;
+}
+
+void UndoHistory::DeleteUndoHistory() {
+ for (int i = 1; i < maxAction; i++)
+ actions[i].Destroy();
+ maxAction = 0;
+ currentAction = 0;
+ actions[currentAction].Create(startAction);
+ savePoint = 0;
+ tentativePoint = -1;
+}
+
+void UndoHistory::SetSavePoint() {
+ savePoint = currentAction;
+}
+
+bool UndoHistory::IsSavePoint() const {
+ return savePoint == currentAction;
+}
+
+void UndoHistory::TentativeStart() {
+ tentativePoint = currentAction;
+}
+
+void UndoHistory::TentativeCommit() {
+ tentativePoint = -1;
+ // Truncate undo history
+ maxAction = currentAction;
+}
+
+int UndoHistory::TentativeSteps() {
+ // Drop any trailing startAction
+ if (actions[currentAction].at == startAction && currentAction > 0)
+ currentAction--;
+ if (tentativePoint >= 0)
+ return currentAction - tentativePoint;
+ else
+ return -1;
+}
+
+bool UndoHistory::CanUndo() const {
+ return (currentAction > 0) && (maxAction > 0);
+}
+
+int UndoHistory::StartUndo() {
+ // Drop any trailing startAction
+ if (actions[currentAction].at == startAction && currentAction > 0)
+ currentAction--;
+
+ // Count the steps in this action
+ int act = currentAction;
+ while (actions[act].at != startAction && act > 0) {
+ act--;
+ }
+ return currentAction - act;
+}
+
+const Action &UndoHistory::GetUndoStep() const {
+ return actions[currentAction];
+}
+
+void UndoHistory::CompletedUndoStep() {
+ currentAction--;
+}
+
+bool UndoHistory::CanRedo() const {
+ return maxAction > currentAction;
+}
+
+int UndoHistory::StartRedo() {
+ // Drop any leading startAction
+ if (actions[currentAction].at == startAction && currentAction < maxAction)
+ currentAction++;
+
+ // Count the steps in this action
+ int act = currentAction;
+ while (actions[act].at != startAction && act < maxAction) {
+ act++;
+ }
+ return act - currentAction;
+}
+
+const Action &UndoHistory::GetRedoStep() const {
+ return actions[currentAction];
+}
+
+void UndoHistory::CompletedRedoStep() {
+ currentAction++;
+}
+
+CellBuffer::CellBuffer() {
+ readOnly = false;
+ utf8LineEnds = 0;
+ collectingUndo = true;
+}
+
+CellBuffer::~CellBuffer() {
+}
+
+char CellBuffer::CharAt(int position) const {
+ return substance.ValueAt(position);
+}
+
+void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) const {
+ if (lengthRetrieve <= 0)
+ return;
+ if (position < 0)
+ return;
+ if ((position + lengthRetrieve) > substance.Length()) {
+ Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", position,
+ lengthRetrieve, substance.Length());
+ return;
+ }
+ substance.GetRange(buffer, position, lengthRetrieve);
+}
+
+char CellBuffer::StyleAt(int position) const {
+ return style.ValueAt(position);
+}
+
+void CellBuffer::GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const {
+ if (lengthRetrieve < 0)
+ return;
+ if (position < 0)
+ return;
+ if ((position + lengthRetrieve) > style.Length()) {
+ Platform::DebugPrintf("Bad GetStyleRange %d for %d of %d\n", position,
+ lengthRetrieve, style.Length());
+ return;
+ }
+ style.GetRange(reinterpret_cast<char *>(buffer), position, lengthRetrieve);
+}
+
+const char *CellBuffer::BufferPointer() {
+ return substance.BufferPointer();
+}
+
+const char *CellBuffer::RangePointer(int position, int rangeLength) {
+ return substance.RangePointer(position, rangeLength);
+}
+
+int CellBuffer::GapPosition() const {
+ return substance.GapPosition();
+}
+
+// The char* returned is to an allocation owned by the undo history
+const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) {
+ // InsertString and DeleteChars are the bottleneck though which all changes occur
+ const char *data = s;
+ if (!readOnly) {
+ if (collectingUndo) {
+ // Save into the undo/redo stack, but only the characters - not the formatting
+ // This takes up about half load time
+ data = uh.AppendAction(insertAction, position, s, insertLength, startSequence);
+ }
+
+ BasicInsertString(position, s, insertLength);
+ }
+ return data;
+}
+
+bool CellBuffer::SetStyleAt(int position, char styleValue) {
+ char curVal = style.ValueAt(position);
+ if (curVal != styleValue) {
+ style.SetValueAt(position, styleValue);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue) {
+ bool changed = false;
+ PLATFORM_ASSERT(lengthStyle == 0 ||
+ (lengthStyle > 0 && lengthStyle + position <= style.Length()));
+ while (lengthStyle--) {
+ char curVal = style.ValueAt(position);
+ if (curVal != styleValue) {
+ style.SetValueAt(position, styleValue);
+ changed = true;
+ }
+ position++;
+ }
+ return changed;
+}
+
+// The char* returned is to an allocation owned by the undo history
+const char *CellBuffer::DeleteChars(int position, int deleteLength, bool &startSequence) {
+ // InsertString and DeleteChars are the bottleneck though which all changes occur
+ PLATFORM_ASSERT(deleteLength > 0);
+ const char *data = 0;
+ if (!readOnly) {
+ if (collectingUndo) {
+ // Save into the undo/redo stack, but only the characters - not the formatting
+ // The gap would be moved to position anyway for the deletion so this doesn't cost extra
+ data = substance.RangePointer(position, deleteLength);
+ data = uh.AppendAction(removeAction, position, data, deleteLength, startSequence);
+ }
+
+ BasicDeleteChars(position, deleteLength);
+ }
+ return data;
+}
+
+int CellBuffer::Length() const {
+ return substance.Length();
+}
+
+void CellBuffer::Allocate(int newSize) {
+ substance.ReAllocate(newSize);
+ style.ReAllocate(newSize);
+}
+
+void CellBuffer::SetLineEndTypes(int utf8LineEnds_) {
+ if (utf8LineEnds != utf8LineEnds_) {
+ utf8LineEnds = utf8LineEnds_;
+ ResetLineEnds();
+ }
+}
+
+void CellBuffer::SetPerLine(PerLine *pl) {
+ lv.SetPerLine(pl);
+}
+
+int CellBuffer::Lines() const {
+ return lv.Lines();
+}
+
+int CellBuffer::LineStart(int line) const {
+ if (line < 0)
+ return 0;
+ else if (line >= Lines())
+ return Length();
+ else
+ return lv.LineStart(line);
+}
+
+bool CellBuffer::IsReadOnly() const {
+ return readOnly;
+}
+
+void CellBuffer::SetReadOnly(bool set) {
+ readOnly = set;
+}
+
+void CellBuffer::SetSavePoint() {
+ uh.SetSavePoint();
+}
+
+bool CellBuffer::IsSavePoint() const {
+ return uh.IsSavePoint();
+}
+
+void CellBuffer::TentativeStart() {
+ uh.TentativeStart();
+}
+
+void CellBuffer::TentativeCommit() {
+ uh.TentativeCommit();
+}
+
+int CellBuffer::TentativeSteps() {
+ return uh.TentativeSteps();
+}
+
+bool CellBuffer::TentativeActive() const {
+ return uh.TentativeActive();
+}
+
+// Without undo
+
+void CellBuffer::InsertLine(int line, int position, bool lineStart) {
+ lv.InsertLine(line, position, lineStart);
+}
+
+void CellBuffer::RemoveLine(int line) {
+ lv.RemoveLine(line);
+}
+
+bool CellBuffer::UTF8LineEndOverlaps(int position) const {
+ unsigned char bytes[] = {
+ static_cast<unsigned char>(substance.ValueAt(position-2)),
+ static_cast<unsigned char>(substance.ValueAt(position-1)),
+ static_cast<unsigned char>(substance.ValueAt(position)),
+ static_cast<unsigned char>(substance.ValueAt(position+1)),
+ };
+ return UTF8IsSeparator(bytes) || UTF8IsSeparator(bytes+1) || UTF8IsNEL(bytes+1);
+}
+
+void CellBuffer::ResetLineEnds() {
+ // Reinitialize line data -- too much work to preserve
+ lv.Init();
+
+ int position = 0;
+ int length = Length();
+ int lineInsert = 1;
+ bool atLineStart = true;
+ lv.InsertText(lineInsert-1, length);
+ unsigned char chBeforePrev = 0;
+ unsigned char chPrev = 0;
+ for (int i = 0; i < length; i++) {
+ unsigned char ch = substance.ValueAt(position + i);
+ if (ch == '\r') {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ } else if (ch == '\n') {
+ if (chPrev == '\r') {
+ // Patch up what was end of line
+ lv.SetLineStart(lineInsert - 1, (position + i) + 1);
+ } else {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ }
+ } else if (utf8LineEnds) {
+ unsigned char back3[3] = {chBeforePrev, chPrev, ch};
+ if (UTF8IsSeparator(back3) || UTF8IsNEL(back3+1)) {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ }
+ }
+ chBeforePrev = chPrev;
+ chPrev = ch;
+ }
+}
+
+void CellBuffer::BasicInsertString(int position, const char *s, int insertLength) {
+ if (insertLength == 0)
+ return;
+ PLATFORM_ASSERT(insertLength > 0);
+
+ unsigned char chAfter = substance.ValueAt(position);
+ bool breakingUTF8LineEnd = false;
+ if (utf8LineEnds && UTF8IsTrailByte(chAfter)) {
+ breakingUTF8LineEnd = UTF8LineEndOverlaps(position);
+ }
+
+ substance.InsertFromArray(position, s, 0, insertLength);
+ style.InsertValue(position, insertLength, 0);
+
+ int lineInsert = lv.LineFromPosition(position) + 1;
+ bool atLineStart = lv.LineStart(lineInsert-1) == position;
+ // Point all the lines after the insertion point further along in the buffer
+ lv.InsertText(lineInsert-1, insertLength);
+ unsigned char chBeforePrev = substance.ValueAt(position - 2);
+ unsigned char chPrev = substance.ValueAt(position - 1);
+ if (chPrev == '\r' && chAfter == '\n') {
+ // Splitting up a crlf pair at position
+ InsertLine(lineInsert, position, false);
+ lineInsert++;
+ }
+ if (breakingUTF8LineEnd) {
+ RemoveLine(lineInsert);
+ }
+ unsigned char ch = ' ';
+ for (int i = 0; i < insertLength; i++) {
+ ch = s[i];
+ if (ch == '\r') {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ } else if (ch == '\n') {
+ if (chPrev == '\r') {
+ // Patch up what was end of line
+ lv.SetLineStart(lineInsert - 1, (position + i) + 1);
+ } else {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ }
+ } else if (utf8LineEnds) {
+ unsigned char back3[3] = {chBeforePrev, chPrev, ch};
+ if (UTF8IsSeparator(back3) || UTF8IsNEL(back3+1)) {
+ InsertLine(lineInsert, (position + i) + 1, atLineStart);
+ lineInsert++;
+ }
+ }
+ chBeforePrev = chPrev;
+ chPrev = ch;
+ }
+ // Joining two lines where last insertion is cr and following substance starts with lf
+ if (chAfter == '\n') {
+ if (ch == '\r') {
+ // End of line already in buffer so drop the newly created one
+ RemoveLine(lineInsert - 1);
+ }
+ } else if (utf8LineEnds && !UTF8IsAscii(chAfter)) {
+ // May have end of UTF-8 line end in buffer and start in insertion
+ for (int j = 0; j < UTF8SeparatorLength-1; j++) {
+ unsigned char chAt = substance.ValueAt(position + insertLength + j);
+ unsigned char back3[3] = {chBeforePrev, chPrev, chAt};
+ if (UTF8IsSeparator(back3)) {
+ InsertLine(lineInsert, (position + insertLength + j) + 1, atLineStart);
+ lineInsert++;
+ }
+ if ((j == 0) && UTF8IsNEL(back3+1)) {
+ InsertLine(lineInsert, (position + insertLength + j) + 1, atLineStart);
+ lineInsert++;
+ }
+ chBeforePrev = chPrev;
+ chPrev = chAt;
+ }
+ }
+}
+
+void CellBuffer::BasicDeleteChars(int position, int deleteLength) {
+ if (deleteLength == 0)
+ return;
+
+ if ((position == 0) && (deleteLength == substance.Length())) {
+ // If whole buffer is being deleted, faster to reinitialise lines data
+ // than to delete each line.
+ lv.Init();
+ } else {
+ // Have to fix up line positions before doing deletion as looking at text in buffer
+ // to work out which lines have been removed
+
+ int lineRemove = lv.LineFromPosition(position) + 1;
+ lv.InsertText(lineRemove-1, - (deleteLength));
+ unsigned char chPrev = substance.ValueAt(position - 1);
+ unsigned char chBefore = chPrev;
+ unsigned char chNext = substance.ValueAt(position);
+ bool ignoreNL = false;
+ if (chPrev == '\r' && chNext == '\n') {
+ // Move back one
+ lv.SetLineStart(lineRemove, position);
+ lineRemove++;
+ ignoreNL = true; // First \n is not real deletion
+ }
+ if (utf8LineEnds && UTF8IsTrailByte(chNext)) {
+ if (UTF8LineEndOverlaps(position)) {
+ RemoveLine(lineRemove);
+ }
+ }
+
+ unsigned char ch = chNext;
+ for (int i = 0; i < deleteLength; i++) {
+ chNext = substance.ValueAt(position + i + 1);
+ if (ch == '\r') {
+ if (chNext != '\n') {
+ RemoveLine(lineRemove);
+ }
+ } else if (ch == '\n') {
+ if (ignoreNL) {
+ ignoreNL = false; // Further \n are real deletions
+ } else {
+ RemoveLine(lineRemove);
+ }
+ } else if (utf8LineEnds) {
+ if (!UTF8IsAscii(ch)) {
+ unsigned char next3[3] = {ch, chNext,
+ static_cast<unsigned char>(substance.ValueAt(position + i + 2))};
+ if (UTF8IsSeparator(next3) || UTF8IsNEL(next3)) {
+ RemoveLine(lineRemove);
+ }
+ }
+ }
+
+ ch = chNext;
+ }
+ // May have to fix up end if last deletion causes cr to be next to lf
+ // or removes one of a crlf pair
+ char chAfter = substance.ValueAt(position + deleteLength);
+ if (chBefore == '\r' && chAfter == '\n') {
+ // Using lineRemove-1 as cr ended line before start of deletion
+ RemoveLine(lineRemove - 1);
+ lv.SetLineStart(lineRemove - 1, position + 1);
+ }
+ }
+ substance.DeleteRange(position, deleteLength);
+ style.DeleteRange(position, deleteLength);
+}
+
+bool CellBuffer::SetUndoCollection(bool collectUndo) {
+ collectingUndo = collectUndo;
+ uh.DropUndoSequence();
+ return collectingUndo;
+}
+
+bool CellBuffer::IsCollectingUndo() const {
+ return collectingUndo;
+}
+
+void CellBuffer::BeginUndoAction() {
+ uh.BeginUndoAction();
+}
+
+void CellBuffer::EndUndoAction() {
+ uh.EndUndoAction();
+}
+
+void CellBuffer::AddUndoAction(int token, bool mayCoalesce) {
+ bool startSequence;
+ uh.AppendAction(containerAction, token, 0, 0, startSequence, mayCoalesce);
+}
+
+void CellBuffer::DeleteUndoHistory() {
+ uh.DeleteUndoHistory();
+}
+
+bool CellBuffer::CanUndo() const {
+ return uh.CanUndo();
+}
+
+int CellBuffer::StartUndo() {
+ return uh.StartUndo();
+}
+
+const Action &CellBuffer::GetUndoStep() const {
+ return uh.GetUndoStep();
+}
+
+void CellBuffer::PerformUndoStep() {
+ const Action &actionStep = uh.GetUndoStep();
+ if (actionStep.at == insertAction) {
+#if defined(__EXCEPTIONS)
+ if (substance.Length() < actionStep.lenData) {
+ throw std::runtime_error(
+ "CellBuffer::PerformUndoStep: deletion must be less than document length.");
+ }
+#endif // defined(__EXCEPTIONS)
+ BasicDeleteChars(actionStep.position, actionStep.lenData);
+ } else if (actionStep.at == removeAction) {
+ BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);
+ }
+ uh.CompletedUndoStep();
+}
+
+bool CellBuffer::CanRedo() const {
+ return uh.CanRedo();
+}
+
+int CellBuffer::StartRedo() {
+ return uh.StartRedo();
+}
+
+const Action &CellBuffer::GetRedoStep() const {
+ return uh.GetRedoStep();
+}
+
+void CellBuffer::PerformRedoStep() {
+ const Action &actionStep = uh.GetRedoStep();
+ if (actionStep.at == insertAction) {
+ BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);
+ } else if (actionStep.at == removeAction) {
+ BasicDeleteChars(actionStep.position, actionStep.lenData);
+ }
+ uh.CompletedRedoStep();
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.h b/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.h
new file mode 100644
index 00000000000..5e4fc7c8caa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CellBuffer.h
@@ -0,0 +1,231 @@
+// Scintilla source code edit control
+/** @file CellBuffer.h
+ ** Manages the text of the document.
+ **/
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CELLBUFFER_H
+#define CELLBUFFER_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// Interface to per-line data that wants to see each line insertion and deletion
+class PerLine {
+public:
+ virtual ~PerLine() {}
+ virtual void Init()=0;
+ virtual void InsertLine(int line)=0;
+ virtual void RemoveLine(int line)=0;
+};
+
+/**
+ * The line vector contains information about each of the lines in a cell buffer.
+ */
+class LineVector {
+
+ Partitioning starts;
+ PerLine *perLine;
+
+public:
+
+ LineVector();
+ ~LineVector();
+ void Init();
+ void SetPerLine(PerLine *pl);
+
+ void InsertText(int line, int delta);
+ void InsertLine(int line, int position, bool lineStart);
+ void SetLineStart(int line, int position);
+ void RemoveLine(int line);
+ int Lines() const {
+ return starts.Partitions();
+ }
+ int LineFromPosition(int pos) const;
+ int LineStart(int line) const {
+ return starts.PositionFromPartition(line);
+ }
+
+ int MarkValue(int line);
+ int AddMark(int line, int marker);
+ void MergeMarkers(int pos);
+ void DeleteMark(int line, int markerNum, bool all);
+ void DeleteMarkFromHandle(int markerHandle);
+ int LineFromHandle(int markerHandle);
+
+ void ClearLevels();
+ int SetLevel(int line, int level);
+ int GetLevel(int line);
+
+ int SetLineState(int line, int state);
+ int GetLineState(int line);
+ int GetMaxLineState();
+
+};
+
+enum actionType { insertAction, removeAction, startAction, containerAction };
+
+/**
+ * Actions are used to store all the information required to perform one undo/redo step.
+ */
+class Action {
+public:
+ actionType at;
+ int position;
+ char *data;
+ int lenData;
+ bool mayCoalesce;
+
+ Action();
+ ~Action();
+ void Create(actionType at_, int position_=0, const char *data_=0, int lenData_=0, bool mayCoalesce_=true);
+ void Destroy();
+ void Grab(Action *source);
+};
+
+/**
+ *
+ */
+class UndoHistory {
+ Action *actions;
+ int lenActions;
+ int maxAction;
+ int currentAction;
+ int undoSequenceDepth;
+ int savePoint;
+ int tentativePoint;
+
+ void EnsureUndoRoom();
+
+ // Private so UndoHistory objects can not be copied
+ UndoHistory(const UndoHistory &);
+
+public:
+ UndoHistory();
+ ~UndoHistory();
+
+ const char *AppendAction(actionType at, int position, const char *data, int length, bool &startSequence, bool mayCoalesce=true);
+
+ void BeginUndoAction();
+ void EndUndoAction();
+ void DropUndoSequence();
+ void DeleteUndoHistory();
+
+ /// The save point is a marker in the undo stack where the container has stated that
+ /// the buffer was saved. Undo and redo can move over the save point.
+ void SetSavePoint();
+ bool IsSavePoint() const;
+
+ // Tentative actions are used for input composition so that it can be undone cleanly
+ void TentativeStart();
+ void TentativeCommit();
+ bool TentativeActive() const { return tentativePoint >= 0; }
+ int TentativeSteps();
+
+ /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
+ /// called that many times. Similarly for redo.
+ bool CanUndo() const;
+ int StartUndo();
+ const Action &GetUndoStep() const;
+ void CompletedUndoStep();
+ bool CanRedo() const;
+ int StartRedo();
+ const Action &GetRedoStep() const;
+ void CompletedRedoStep();
+};
+
+/**
+ * Holder for an expandable array of characters that supports undo and line markers.
+ * Based on article "Data Structures in a Bit-Mapped Text Editor"
+ * by Wilfred J. Hansen, Byte January 1987, page 183.
+ */
+class CellBuffer {
+private:
+ SplitVector<char> substance;
+ SplitVector<char> style;
+ bool readOnly;
+ int utf8LineEnds;
+
+ bool collectingUndo;
+ UndoHistory uh;
+
+ LineVector lv;
+
+ bool UTF8LineEndOverlaps(int position) const;
+ void ResetLineEnds();
+ /// Actions without undo
+ void BasicInsertString(int position, const char *s, int insertLength);
+ void BasicDeleteChars(int position, int deleteLength);
+
+public:
+
+ CellBuffer();
+ ~CellBuffer();
+
+ /// Retrieving positions outside the range of the buffer works and returns 0
+ char CharAt(int position) const;
+ void GetCharRange(char *buffer, int position, int lengthRetrieve) const;
+ char StyleAt(int position) const;
+ void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const;
+ const char *BufferPointer();
+ const char *RangePointer(int position, int rangeLength);
+ int GapPosition() const;
+
+ int Length() const;
+ void Allocate(int newSize);
+ int GetLineEndTypes() const { return utf8LineEnds; }
+ void SetLineEndTypes(int utf8LineEnds_);
+ void SetPerLine(PerLine *pl);
+ int Lines() const;
+ int LineStart(int line) const;
+ int LineFromPosition(int pos) const { return lv.LineFromPosition(pos); }
+ void InsertLine(int line, int position, bool lineStart);
+ void RemoveLine(int line);
+ const char *InsertString(int position, const char *s, int insertLength, bool &startSequence);
+
+ /// Setting styles for positions outside the range of the buffer is safe and has no effect.
+ /// @return true if the style of a character is changed.
+ bool SetStyleAt(int position, char styleValue);
+ bool SetStyleFor(int position, int length, char styleValue);
+
+ const char *DeleteChars(int position, int deleteLength, bool &startSequence);
+
+ bool IsReadOnly() const;
+ void SetReadOnly(bool set);
+
+ /// The save point is a marker in the undo stack where the container has stated that
+ /// the buffer was saved. Undo and redo can move over the save point.
+ void SetSavePoint();
+ bool IsSavePoint() const;
+
+ void TentativeStart();
+ void TentativeCommit();
+ bool TentativeActive() const;
+ int TentativeSteps();
+
+ bool SetUndoCollection(bool collectUndo);
+ bool IsCollectingUndo() const;
+ void BeginUndoAction();
+ void EndUndoAction();
+ void AddUndoAction(int token, bool mayCoalesce);
+ void DeleteUndoHistory();
+
+ /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is
+ /// called that many times. Similarly for redo.
+ bool CanUndo() const;
+ int StartUndo();
+ const Action &GetUndoStep() const;
+ void PerformUndoStep();
+ bool CanRedo() const;
+ int StartRedo();
+ const Action &GetRedoStep() const;
+ void PerformRedoStep();
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.cxx
new file mode 100644
index 00000000000..cc431630d80
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.cxx
@@ -0,0 +1,59 @@
+// Scintilla source code edit control
+/** @file CharClassify.cxx
+ ** Character classifications used by Document and RESearch.
+ **/
+// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "CharClassify.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+CharClassify::CharClassify() {
+ SetDefaultCharClasses(true);
+}
+
+void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
+ // Initialize all char classes to default values
+ for (int ch = 0; ch < 256; ch++) {
+ if (ch == '\r' || ch == '\n')
+ charClass[ch] = ccNewLine;
+ else if (ch < 0x20 || ch == ' ')
+ charClass[ch] = ccSpace;
+ else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
+ charClass[ch] = ccWord;
+ else
+ charClass[ch] = ccPunctuation;
+ }
+}
+
+void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
+ // Apply the newCharClass to the specifed chars
+ if (chars) {
+ while (*chars) {
+ charClass[*chars] = static_cast<unsigned char>(newCharClass);
+ chars++;
+ }
+ }
+}
+
+int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) {
+ // Get characters belonging to the given char class; return the number
+ // of characters (if the buffer is NULL, don't write to it).
+ int count = 0;
+ for (int ch = maxChar - 1; ch >= 0; --ch) {
+ if (charClass[ch] == characterClass) {
+ ++count;
+ if (buffer) {
+ *buffer = static_cast<unsigned char>(ch);
+ buffer++;
+ }
+ }
+ }
+ return count;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.h b/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.h
new file mode 100644
index 00000000000..5d2734c0067
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/CharClassify.h
@@ -0,0 +1,35 @@
+// Scintilla source code edit control
+/** @file CharClassify.h
+ ** Character classifications used by Document and RESearch.
+ **/
+// Copyright 2006-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CHARCLASSIFY_H
+#define CHARCLASSIFY_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class CharClassify {
+public:
+ CharClassify();
+
+ enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
+ void SetDefaultCharClasses(bool includeWordClass);
+ void SetCharClasses(const unsigned char *chars, cc newCharClass);
+ int GetCharsOfClass(cc charClass, unsigned char *buffer);
+ cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
+ bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
+
+private:
+ enum { maxChar=256 };
+ unsigned char charClass[maxChar]; // not type cc to save space
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.cxx
new file mode 100644
index 00000000000..7b765542098
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.cxx
@@ -0,0 +1,284 @@
+// Scintilla source code edit control
+/** @file ContractionState.cxx
+ ** Manages visibility of lines for folding and wrapping.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+ContractionState::ContractionState() : visible(0), expanded(0), heights(0), displayLines(0), linesInDocument(1) {
+ //InsertLine(0);
+}
+
+ContractionState::~ContractionState() {
+ Clear();
+}
+
+void ContractionState::EnsureData() {
+ if (OneToOne()) {
+ visible = new RunStyles();
+ expanded = new RunStyles();
+ heights = new RunStyles();
+ displayLines = new Partitioning(4);
+ InsertLines(0, linesInDocument);
+ }
+}
+
+void ContractionState::Clear() {
+ delete visible;
+ visible = 0;
+ delete expanded;
+ expanded = 0;
+ delete heights;
+ heights = 0;
+ delete displayLines;
+ displayLines = 0;
+ linesInDocument = 1;
+}
+
+int ContractionState::LinesInDoc() const {
+ if (OneToOne()) {
+ return linesInDocument;
+ } else {
+ return displayLines->Partitions() - 1;
+ }
+}
+
+int ContractionState::LinesDisplayed() const {
+ if (OneToOne()) {
+ return linesInDocument;
+ } else {
+ return displayLines->PositionFromPartition(LinesInDoc());
+ }
+}
+
+int ContractionState::DisplayFromDoc(int lineDoc) const {
+ if (OneToOne()) {
+ return (lineDoc <= linesInDocument) ? lineDoc : linesInDocument;
+ } else {
+ if (lineDoc > displayLines->Partitions())
+ lineDoc = displayLines->Partitions();
+ return displayLines->PositionFromPartition(lineDoc);
+ }
+}
+
+int ContractionState::DisplayLastFromDoc(int lineDoc) const {
+ return DisplayFromDoc(lineDoc) + GetHeight(lineDoc) - 1;
+}
+
+int ContractionState::DocFromDisplay(int lineDisplay) const {
+ if (OneToOne()) {
+ return lineDisplay;
+ } else {
+ if (lineDisplay <= 0) {
+ return 0;
+ }
+ if (lineDisplay > LinesDisplayed()) {
+ return displayLines->PartitionFromPosition(LinesDisplayed());
+ }
+ int lineDoc = displayLines->PartitionFromPosition(lineDisplay);
+ PLATFORM_ASSERT(GetVisible(lineDoc));
+ return lineDoc;
+ }
+}
+
+void ContractionState::InsertLine(int lineDoc) {
+ if (OneToOne()) {
+ linesInDocument++;
+ } else {
+ visible->InsertSpace(lineDoc, 1);
+ visible->SetValueAt(lineDoc, 1);
+ expanded->InsertSpace(lineDoc, 1);
+ expanded->SetValueAt(lineDoc, 1);
+ heights->InsertSpace(lineDoc, 1);
+ heights->SetValueAt(lineDoc, 1);
+ int lineDisplay = DisplayFromDoc(lineDoc);
+ displayLines->InsertPartition(lineDoc, lineDisplay);
+ displayLines->InsertText(lineDoc, 1);
+ }
+}
+
+void ContractionState::InsertLines(int lineDoc, int lineCount) {
+ for (int l = 0; l < lineCount; l++) {
+ InsertLine(lineDoc + l);
+ }
+ Check();
+}
+
+void ContractionState::DeleteLine(int lineDoc) {
+ if (OneToOne()) {
+ linesInDocument--;
+ } else {
+ if (GetVisible(lineDoc)) {
+ displayLines->InsertText(lineDoc, -heights->ValueAt(lineDoc));
+ }
+ displayLines->RemovePartition(lineDoc);
+ visible->DeleteRange(lineDoc, 1);
+ expanded->DeleteRange(lineDoc, 1);
+ heights->DeleteRange(lineDoc, 1);
+ }
+}
+
+void ContractionState::DeleteLines(int lineDoc, int lineCount) {
+ for (int l = 0; l < lineCount; l++) {
+ DeleteLine(lineDoc);
+ }
+ Check();
+}
+
+bool ContractionState::GetVisible(int lineDoc) const {
+ if (OneToOne()) {
+ return true;
+ } else {
+ if (lineDoc >= visible->Length())
+ return true;
+ return visible->ValueAt(lineDoc) == 1;
+ }
+}
+
+bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool isVisible) {
+ if (OneToOne() && isVisible) {
+ return false;
+ } else {
+ EnsureData();
+ int delta = 0;
+ Check();
+ if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < LinesInDoc())) {
+ for (int line = lineDocStart; line <= lineDocEnd; line++) {
+ if (GetVisible(line) != isVisible) {
+ int difference = isVisible ? heights->ValueAt(line) : -heights->ValueAt(line);
+ visible->SetValueAt(line, isVisible ? 1 : 0);
+ displayLines->InsertText(line, difference);
+ delta += difference;
+ }
+ }
+ } else {
+ return false;
+ }
+ Check();
+ return delta != 0;
+ }
+}
+
+bool ContractionState::HiddenLines() const {
+ if (OneToOne()) {
+ return false;
+ } else {
+ return !visible->AllSameAs(1);
+ }
+}
+
+bool ContractionState::GetExpanded(int lineDoc) const {
+ if (OneToOne()) {
+ return true;
+ } else {
+ Check();
+ return expanded->ValueAt(lineDoc) == 1;
+ }
+}
+
+bool ContractionState::SetExpanded(int lineDoc, bool isExpanded) {
+ if (OneToOne() && isExpanded) {
+ return false;
+ } else {
+ EnsureData();
+ if (isExpanded != (expanded->ValueAt(lineDoc) == 1)) {
+ expanded->SetValueAt(lineDoc, isExpanded ? 1 : 0);
+ Check();
+ return true;
+ } else {
+ Check();
+ return false;
+ }
+ }
+}
+
+int ContractionState::ContractedNext(int lineDocStart) const {
+ if (OneToOne()) {
+ return -1;
+ } else {
+ Check();
+ if (!expanded->ValueAt(lineDocStart)) {
+ return lineDocStart;
+ } else {
+ int lineDocNextChange = expanded->EndRun(lineDocStart);
+ if (lineDocNextChange < LinesInDoc())
+ return lineDocNextChange;
+ else
+ return -1;
+ }
+ }
+}
+
+int ContractionState::GetHeight(int lineDoc) const {
+ if (OneToOne()) {
+ return 1;
+ } else {
+ return heights->ValueAt(lineDoc);
+ }
+}
+
+// Set the number of display lines needed for this line.
+// Return true if this is a change.
+bool ContractionState::SetHeight(int lineDoc, int height) {
+ if (OneToOne() && (height == 1)) {
+ return false;
+ } else if (lineDoc < LinesInDoc()) {
+ EnsureData();
+ if (GetHeight(lineDoc) != height) {
+ if (GetVisible(lineDoc)) {
+ displayLines->InsertText(lineDoc, height - GetHeight(lineDoc));
+ }
+ heights->SetValueAt(lineDoc, height);
+ Check();
+ return true;
+ } else {
+ Check();
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
+
+void ContractionState::ShowAll() {
+ int lines = LinesInDoc();
+ Clear();
+ linesInDocument = lines;
+}
+
+// Debugging checks
+
+void ContractionState::Check() const {
+#ifdef CHECK_CORRECTNESS
+ for (int vline = 0; vline < LinesDisplayed(); vline++) {
+ const int lineDoc = DocFromDisplay(vline);
+ PLATFORM_ASSERT(GetVisible(lineDoc));
+ }
+ for (int lineDoc = 0; lineDoc < LinesInDoc(); lineDoc++) {
+ const int displayThis = DisplayFromDoc(lineDoc);
+ const int displayNext = DisplayFromDoc(lineDoc + 1);
+ const int height = displayNext - displayThis;
+ PLATFORM_ASSERT(height >= 0);
+ if (GetVisible(lineDoc)) {
+ PLATFORM_ASSERT(GetHeight(lineDoc) == height);
+ } else {
+ PLATFORM_ASSERT(0 == height);
+ }
+ }
+#endif
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.h b/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.h
new file mode 100644
index 00000000000..96cbf07638f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ContractionState.h
@@ -0,0 +1,69 @@
+// Scintilla source code edit control
+/** @file ContractionState.h
+ ** Manages visibility of lines for folding and wrapping.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef CONTRACTIONSTATE_H
+#define CONTRACTIONSTATE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class ContractionState {
+ // These contain 1 element for every document line.
+ RunStyles *visible;
+ RunStyles *expanded;
+ RunStyles *heights;
+ Partitioning *displayLines;
+ int linesInDocument;
+
+ void EnsureData();
+
+ bool OneToOne() const {
+ // True when each document line is exactly one display line so need for
+ // complex data structures.
+ return visible == 0;
+ }
+
+public:
+ ContractionState();
+ virtual ~ContractionState();
+
+ void Clear();
+
+ int LinesInDoc() const;
+ int LinesDisplayed() const;
+ int DisplayFromDoc(int lineDoc) const;
+ int DisplayLastFromDoc(int lineDoc) const;
+ int DocFromDisplay(int lineDisplay) const;
+
+ void InsertLine(int lineDoc);
+ void InsertLines(int lineDoc, int lineCount);
+ void DeleteLine(int lineDoc);
+ void DeleteLines(int lineDoc, int lineCount);
+
+ bool GetVisible(int lineDoc) const;
+ bool SetVisible(int lineDocStart, int lineDocEnd, bool isVisible);
+ bool HiddenLines() const;
+
+ bool GetExpanded(int lineDoc) const;
+ bool SetExpanded(int lineDoc, bool isExpanded);
+ int ContractedNext(int lineDocStart) const;
+
+ int GetHeight(int lineDoc) const;
+ bool SetHeight(int lineDoc, int height);
+
+ void ShowAll();
+ void Check() const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.cxx
new file mode 100644
index 00000000000..e7610e0b6b4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.cxx
@@ -0,0 +1,196 @@
+/** @file Decoration.cxx
+ ** Visual elements added over text.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "Decoration.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+Decoration::Decoration(int indicator_) : next(0), indicator(indicator_) {
+}
+
+Decoration::~Decoration() {
+}
+
+bool Decoration::Empty() const {
+ return (rs.Runs() == 1) && (rs.AllSameAs(0));
+}
+
+DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0),
+ lengthDocument(0), root(0), clickNotified(false) {
+}
+
+DecorationList::~DecorationList() {
+ Decoration *deco = root;
+ while (deco) {
+ Decoration *decoNext = deco->next;
+ delete deco;
+ deco = decoNext;
+ }
+ root = 0;
+ current = 0;
+}
+
+Decoration *DecorationList::DecorationFromIndicator(int indicator) {
+ for (Decoration *deco=root; deco; deco = deco->next) {
+ if (deco->indicator == indicator) {
+ return deco;
+ }
+ }
+ return 0;
+}
+
+Decoration *DecorationList::Create(int indicator, int length) {
+ currentIndicator = indicator;
+ Decoration *decoNew = new Decoration(indicator);
+ decoNew->rs.InsertSpace(0, length);
+
+ Decoration *decoPrev = 0;
+ Decoration *deco = root;
+
+ while (deco && (deco->indicator < indicator)) {
+ decoPrev = deco;
+ deco = deco->next;
+ }
+ if (decoPrev == 0) {
+ decoNew->next = root;
+ root = decoNew;
+ } else {
+ decoNew->next = deco;
+ decoPrev->next = decoNew;
+ }
+ return decoNew;
+}
+
+void DecorationList::Delete(int indicator) {
+ Decoration *decoToDelete = 0;
+ if (root) {
+ if (root->indicator == indicator) {
+ decoToDelete = root;
+ root = root->next;
+ } else {
+ Decoration *deco=root;
+ while (deco->next && !decoToDelete) {
+ if (deco->next && deco->next->indicator == indicator) {
+ decoToDelete = deco->next;
+ deco->next = decoToDelete->next;
+ } else {
+ deco = deco->next;
+ }
+ }
+ }
+ }
+ if (decoToDelete) {
+ delete decoToDelete;
+ current = 0;
+ }
+}
+
+void DecorationList::SetCurrentIndicator(int indicator) {
+ currentIndicator = indicator;
+ current = DecorationFromIndicator(indicator);
+ currentValue = 1;
+}
+
+void DecorationList::SetCurrentValue(int value) {
+ currentValue = value ? value : 1;
+}
+
+bool DecorationList::FillRange(int &position, int value, int &fillLength) {
+ if (!current) {
+ current = DecorationFromIndicator(currentIndicator);
+ if (!current) {
+ current = Create(currentIndicator, lengthDocument);
+ }
+ }
+ bool changed = current->rs.FillRange(position, value, fillLength);
+ if (current->Empty()) {
+ Delete(currentIndicator);
+ }
+ return changed;
+}
+
+void DecorationList::InsertSpace(int position, int insertLength) {
+ const bool atEnd = position == lengthDocument;
+ lengthDocument += insertLength;
+ for (Decoration *deco=root; deco; deco = deco->next) {
+ deco->rs.InsertSpace(position, insertLength);
+ if (atEnd) {
+ deco->rs.FillRange(position, 0, insertLength);
+ }
+ }
+}
+
+void DecorationList::DeleteRange(int position, int deleteLength) {
+ lengthDocument -= deleteLength;
+ Decoration *deco;
+ for (deco=root; deco; deco = deco->next) {
+ deco->rs.DeleteRange(position, deleteLength);
+ }
+ DeleteAnyEmpty();
+}
+
+void DecorationList::DeleteAnyEmpty() {
+ Decoration *deco = root;
+ while (deco) {
+ if ((lengthDocument == 0) || deco->Empty()) {
+ Delete(deco->indicator);
+ deco = root;
+ } else {
+ deco = deco->next;
+ }
+ }
+}
+
+int DecorationList::AllOnFor(int position) const {
+ int mask = 0;
+ for (Decoration *deco=root; deco; deco = deco->next) {
+ if (deco->rs.ValueAt(position)) {
+ if (deco->indicator < INDIC_IME) {
+ mask |= 1 << deco->indicator;
+ }
+ }
+ }
+ return mask;
+}
+
+int DecorationList::ValueAt(int indicator, int position) {
+ Decoration *deco = DecorationFromIndicator(indicator);
+ if (deco) {
+ return deco->rs.ValueAt(position);
+ }
+ return 0;
+}
+
+int DecorationList::Start(int indicator, int position) {
+ Decoration *deco = DecorationFromIndicator(indicator);
+ if (deco) {
+ return deco->rs.StartRun(position);
+ }
+ return 0;
+}
+
+int DecorationList::End(int indicator, int position) {
+ Decoration *deco = DecorationFromIndicator(indicator);
+ if (deco) {
+ return deco->rs.EndRun(position);
+ }
+ return 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.h b/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.h
new file mode 100644
index 00000000000..a0c434af8d1
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Decoration.h
@@ -0,0 +1,64 @@
+/** @file Decoration.h
+ ** Visual elements added over text.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef DECORATION_H
+#define DECORATION_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class Decoration {
+public:
+ Decoration *next;
+ RunStyles rs;
+ int indicator;
+
+ explicit Decoration(int indicator_);
+ ~Decoration();
+
+ bool Empty() const;
+};
+
+class DecorationList {
+ int currentIndicator;
+ int currentValue;
+ Decoration *current;
+ int lengthDocument;
+ Decoration *DecorationFromIndicator(int indicator);
+ Decoration *Create(int indicator, int length);
+ void Delete(int indicator);
+ void DeleteAnyEmpty();
+public:
+ Decoration *root;
+ bool clickNotified;
+
+ DecorationList();
+ ~DecorationList();
+
+ void SetCurrentIndicator(int indicator);
+ int GetCurrentIndicator() const { return currentIndicator; }
+
+ void SetCurrentValue(int value);
+ int GetCurrentValue() const { return currentValue; }
+
+ // Returns true if some values may have changed
+ bool FillRange(int &position, int value, int &fillLength);
+
+ void InsertSpace(int position, int insertLength);
+ void DeleteRange(int position, int deleteLength);
+
+ int AllOnFor(int position) const;
+ int ValueAt(int indicator, int position);
+ int Start(int indicator, int position);
+ int End(int indicator, int position);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Document.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Document.cxx
new file mode 100644
index 00000000000..3f365fdf453
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Document.cxx
@@ -0,0 +1,2817 @@
+// Scintilla source code edit control
+/** @file Document.cxx
+ ** Text document that handles notifications, DBCS, styling, words and end of line.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <algorithm>
+
+#ifdef CXX11_REGEX
+#include <regex>
+#endif
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "CharacterSet.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "CellBuffer.h"
+#include "PerLine.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "RESearch.h"
+#include "UniConversion.h"
+#include "UnicodeFromUTF8.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsPunctuation(char ch) {
+ return IsASCII(ch) && ispunct(ch);
+}
+
+void LexInterface::Colourise(int start, int end) {
+ if (pdoc && instance && !performingStyle) {
+ // Protect against reentrance, which may occur, for example, when
+ // fold points are discovered while performing styling and the folding
+ // code looks for child lines which may trigger styling.
+ performingStyle = true;
+
+ int lengthDoc = pdoc->Length();
+ if (end == -1)
+ end = lengthDoc;
+ int len = end - start;
+
+ PLATFORM_ASSERT(len >= 0);
+ PLATFORM_ASSERT(start + len <= lengthDoc);
+
+ int styleStart = 0;
+ if (start > 0)
+ styleStart = pdoc->StyleAt(start - 1);
+
+ if (len > 0) {
+ instance->Lex(start, len, styleStart, pdoc);
+ instance->Fold(start, len, styleStart, pdoc);
+ }
+
+ performingStyle = false;
+ }
+}
+
+int LexInterface::LineEndTypesSupported() {
+ if (instance) {
+ int interfaceVersion = instance->Version();
+ if (interfaceVersion >= lvSubStyles) {
+ ILexerWithSubStyles *ssinstance = static_cast<ILexerWithSubStyles *>(instance);
+ return ssinstance->LineEndTypesSupported();
+ }
+ }
+ return 0;
+}
+
+Document::Document() {
+ refCount = 0;
+ pcf = NULL;
+#ifdef _WIN32
+ eolMode = SC_EOL_CRLF;
+#else
+ eolMode = SC_EOL_LF;
+#endif
+ dbcsCodePage = 0;
+ lineEndBitSet = SC_LINE_END_TYPE_DEFAULT;
+ endStyled = 0;
+ styleClock = 0;
+ enteredModification = 0;
+ enteredStyling = 0;
+ enteredReadOnlyCount = 0;
+ insertionSet = false;
+ tabInChars = 8;
+ indentInChars = 0;
+ actualIndentInChars = 8;
+ useTabs = true;
+ tabIndents = true;
+ backspaceUnindents = false;
+
+ matchesValid = false;
+ regex = 0;
+
+ UTF8BytesOfLeadInitialise();
+
+ perLineData[ldMarkers] = new LineMarkers();
+ perLineData[ldLevels] = new LineLevels();
+ perLineData[ldState] = new LineState();
+ perLineData[ldMargin] = new LineAnnotation();
+ perLineData[ldAnnotation] = new LineAnnotation();
+
+ cb.SetPerLine(this);
+
+ pli = 0;
+}
+
+Document::~Document() {
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifyDeleted(this, it->userData);
+ }
+ for (int j=0; j<ldSize; j++) {
+ delete perLineData[j];
+ perLineData[j] = 0;
+ }
+ delete regex;
+ regex = 0;
+ delete pli;
+ pli = 0;
+ delete pcf;
+ pcf = 0;
+}
+
+void Document::Init() {
+ for (int j=0; j<ldSize; j++) {
+ if (perLineData[j])
+ perLineData[j]->Init();
+ }
+}
+
+int Document::LineEndTypesSupported() const {
+ if ((SC_CP_UTF8 == dbcsCodePage) && pli)
+ return pli->LineEndTypesSupported();
+ else
+ return 0;
+}
+
+bool Document::SetDBCSCodePage(int dbcsCodePage_) {
+ if (dbcsCodePage != dbcsCodePage_) {
+ dbcsCodePage = dbcsCodePage_;
+ SetCaseFolder(NULL);
+ cb.SetLineEndTypes(lineEndBitSet & LineEndTypesSupported());
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool Document::SetLineEndTypesAllowed(int lineEndBitSet_) {
+ if (lineEndBitSet != lineEndBitSet_) {
+ lineEndBitSet = lineEndBitSet_;
+ int lineEndBitSetActive = lineEndBitSet & LineEndTypesSupported();
+ if (lineEndBitSetActive != cb.GetLineEndTypes()) {
+ ModifiedAt(0);
+ cb.SetLineEndTypes(lineEndBitSetActive);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
+
+void Document::InsertLine(int line) {
+ for (int j=0; j<ldSize; j++) {
+ if (perLineData[j])
+ perLineData[j]->InsertLine(line);
+ }
+}
+
+void Document::RemoveLine(int line) {
+ for (int j=0; j<ldSize; j++) {
+ if (perLineData[j])
+ perLineData[j]->RemoveLine(line);
+ }
+}
+
+// Increase reference count and return its previous value.
+int Document::AddRef() {
+ return refCount++;
+}
+
+// Decrease reference count and return its previous value.
+// Delete the document if reference count reaches zero.
+int SCI_METHOD Document::Release() {
+ int curRefCount = --refCount;
+ if (curRefCount == 0)
+ delete this;
+ return curRefCount;
+}
+
+void Document::SetSavePoint() {
+ cb.SetSavePoint();
+ NotifySavePoint(true);
+}
+
+void Document::TentativeUndo() {
+ if (!TentativeActive())
+ return;
+ CheckReadOnly();
+ if (enteredModification == 0) {
+ enteredModification++;
+ if (!cb.IsReadOnly()) {
+ bool startSavePoint = cb.IsSavePoint();
+ bool multiLine = false;
+ int steps = cb.TentativeSteps();
+ //Platform::DebugPrintf("Steps=%d\n", steps);
+ for (int step = 0; step < steps; step++) {
+ const int prevLinesTotal = LinesTotal();
+ const Action &action = cb.GetUndoStep();
+ if (action.at == removeAction) {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action));
+ } else if (action.at == containerAction) {
+ DocModification dm(SC_MOD_CONTAINER | SC_PERFORMED_UNDO);
+ dm.token = action.position;
+ NotifyModified(dm);
+ } else {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action));
+ }
+ cb.PerformUndoStep();
+ if (action.at != containerAction) {
+ ModifiedAt(action.position);
+ }
+
+ int modFlags = SC_PERFORMED_UNDO;
+ // With undo, an insertion action becomes a deletion notification
+ if (action.at == removeAction) {
+ modFlags |= SC_MOD_INSERTTEXT;
+ } else if (action.at == insertAction) {
+ modFlags |= SC_MOD_DELETETEXT;
+ }
+ if (steps > 1)
+ modFlags |= SC_MULTISTEPUNDOREDO;
+ const int linesAdded = LinesTotal() - prevLinesTotal;
+ if (linesAdded != 0)
+ multiLine = true;
+ if (step == steps - 1) {
+ modFlags |= SC_LASTSTEPINUNDOREDO;
+ if (multiLine)
+ modFlags |= SC_MULTILINEUNDOREDO;
+ }
+ NotifyModified(DocModification(modFlags, action.position, action.lenData,
+ linesAdded, action.data));
+ }
+
+ bool endSavePoint = cb.IsSavePoint();
+ if (startSavePoint != endSavePoint)
+ NotifySavePoint(endSavePoint);
+
+ cb.TentativeCommit();
+ }
+ enteredModification--;
+ }
+}
+
+int Document::GetMark(int line) {
+ return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkValue(line);
+}
+
+int Document::MarkerNext(int lineStart, int mask) const {
+ return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkerNext(lineStart, mask);
+}
+
+int Document::AddMark(int line, int markerNum) {
+ if (line >= 0 && line <= LinesTotal()) {
+ int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])->
+ AddMark(line, markerNum, LinesTotal());
+ DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+ return prev;
+ } else {
+ return 0;
+ }
+}
+
+void Document::AddMarkSet(int line, int valueSet) {
+ if (line < 0 || line > LinesTotal()) {
+ return;
+ }
+ unsigned int m = valueSet;
+ for (int i = 0; m; i++, m >>= 1)
+ if (m & 1)
+ static_cast<LineMarkers *>(perLineData[ldMarkers])->
+ AddMark(line, i, LinesTotal());
+ DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+}
+
+void Document::DeleteMark(int line, int markerNum) {
+ static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, false);
+ DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+}
+
+void Document::DeleteMarkFromHandle(int markerHandle) {
+ static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMarkFromHandle(markerHandle);
+ DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0);
+ mh.line = -1;
+ NotifyModified(mh);
+}
+
+void Document::DeleteAllMarks(int markerNum) {
+ bool someChanges = false;
+ for (int line = 0; line < LinesTotal(); line++) {
+ if (static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, true))
+ someChanges = true;
+ }
+ if (someChanges) {
+ DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0);
+ mh.line = -1;
+ NotifyModified(mh);
+ }
+}
+
+int Document::LineFromHandle(int markerHandle) {
+ return static_cast<LineMarkers *>(perLineData[ldMarkers])->LineFromHandle(markerHandle);
+}
+
+int SCI_METHOD Document::LineStart(int line) const {
+ return cb.LineStart(line);
+}
+
+bool Document::IsLineStartPosition(int position) const {
+ return LineStart(LineFromPosition(position)) == position;
+}
+
+int SCI_METHOD Document::LineEnd(int line) const {
+ if (line >= LinesTotal() - 1) {
+ return LineStart(line + 1);
+ } else {
+ int position = LineStart(line + 1);
+ if (SC_CP_UTF8 == dbcsCodePage) {
+ unsigned char bytes[] = {
+ static_cast<unsigned char>(cb.CharAt(position-3)),
+ static_cast<unsigned char>(cb.CharAt(position-2)),
+ static_cast<unsigned char>(cb.CharAt(position-1)),
+ };
+ if (UTF8IsSeparator(bytes)) {
+ return position - UTF8SeparatorLength;
+ }
+ if (UTF8IsNEL(bytes+1)) {
+ return position - UTF8NELLength;
+ }
+ }
+ position--; // Back over CR or LF
+ // When line terminator is CR+LF, may need to go back one more
+ if ((position > LineStart(line)) && (cb.CharAt(position - 1) == '\r')) {
+ position--;
+ }
+ return position;
+ }
+}
+
+void SCI_METHOD Document::SetErrorStatus(int status) {
+ // Tell the watchers an error has occurred.
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifyErrorOccurred(this, it->userData, status);
+ }
+}
+
+int SCI_METHOD Document::LineFromPosition(int pos) const {
+ return cb.LineFromPosition(pos);
+}
+
+int Document::LineEndPosition(int position) const {
+ return LineEnd(LineFromPosition(position));
+}
+
+bool Document::IsLineEndPosition(int position) const {
+ return LineEnd(LineFromPosition(position)) == position;
+}
+
+bool Document::IsPositionInLineEnd(int position) const {
+ return position >= LineEnd(LineFromPosition(position));
+}
+
+int Document::VCHomePosition(int position) const {
+ int line = LineFromPosition(position);
+ int startPosition = LineStart(line);
+ int endLine = LineEnd(line);
+ int startText = startPosition;
+ while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t'))
+ startText++;
+ if (position == startText)
+ return startPosition;
+ else
+ return startText;
+}
+
+int SCI_METHOD Document::SetLevel(int line, int level) {
+ int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(line, level, LinesTotal());
+ if (prev != level) {
+ DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER,
+ LineStart(line), 0, 0, 0, line);
+ mh.foldLevelNow = level;
+ mh.foldLevelPrev = prev;
+ NotifyModified(mh);
+ }
+ return prev;
+}
+
+int SCI_METHOD Document::GetLevel(int line) const {
+ return static_cast<LineLevels *>(perLineData[ldLevels])->GetLevel(line);
+}
+
+void Document::ClearLevels() {
+ static_cast<LineLevels *>(perLineData[ldLevels])->ClearLevels();
+}
+
+static bool IsSubordinate(int levelStart, int levelTry) {
+ if (levelTry & SC_FOLDLEVELWHITEFLAG)
+ return true;
+ else
+ return (levelStart & SC_FOLDLEVELNUMBERMASK) < (levelTry & SC_FOLDLEVELNUMBERMASK);
+}
+
+int Document::GetLastChild(int lineParent, int level, int lastLine) {
+ if (level == -1)
+ level = GetLevel(lineParent) & SC_FOLDLEVELNUMBERMASK;
+ int maxLine = LinesTotal();
+ int lookLastLine = (lastLine != -1) ? Platform::Minimum(LinesTotal() - 1, lastLine) : -1;
+ int lineMaxSubord = lineParent;
+ while (lineMaxSubord < maxLine - 1) {
+ EnsureStyledTo(LineStart(lineMaxSubord + 2));
+ if (!IsSubordinate(level, GetLevel(lineMaxSubord + 1)))
+ break;
+ if ((lookLastLine != -1) && (lineMaxSubord >= lookLastLine) && !(GetLevel(lineMaxSubord) & SC_FOLDLEVELWHITEFLAG))
+ break;
+ lineMaxSubord++;
+ }
+ if (lineMaxSubord > lineParent) {
+ if (level > (GetLevel(lineMaxSubord + 1) & SC_FOLDLEVELNUMBERMASK)) {
+ // Have chewed up some whitespace that belongs to a parent so seek back
+ if (GetLevel(lineMaxSubord) & SC_FOLDLEVELWHITEFLAG) {
+ lineMaxSubord--;
+ }
+ }
+ }
+ return lineMaxSubord;
+}
+
+int Document::GetFoldParent(int line) const {
+ int level = GetLevel(line) & SC_FOLDLEVELNUMBERMASK;
+ int lineLook = line - 1;
+ while ((lineLook > 0) && (
+ (!(GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG)) ||
+ ((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) >= level))
+ ) {
+ lineLook--;
+ }
+ if ((GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG) &&
+ ((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) < level)) {
+ return lineLook;
+ } else {
+ return -1;
+ }
+}
+
+void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, int line, int lastLine) {
+ int level = GetLevel(line);
+ int lookLastLine = Platform::Maximum(line, lastLine) + 1;
+
+ int lookLine = line;
+ int lookLineLevel = level;
+ int lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ while ((lookLine > 0) && ((lookLineLevel & SC_FOLDLEVELWHITEFLAG) ||
+ ((lookLineLevel & SC_FOLDLEVELHEADERFLAG) && (lookLineLevelNum >= (GetLevel(lookLine + 1) & SC_FOLDLEVELNUMBERMASK))))) {
+ lookLineLevel = GetLevel(--lookLine);
+ lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ }
+
+ int beginFoldBlock = (lookLineLevel & SC_FOLDLEVELHEADERFLAG) ? lookLine : GetFoldParent(lookLine);
+ if (beginFoldBlock == -1) {
+ highlightDelimiter.Clear();
+ return;
+ }
+
+ int endFoldBlock = GetLastChild(beginFoldBlock, -1, lookLastLine);
+ int firstChangeableLineBefore = -1;
+ if (endFoldBlock < line) {
+ lookLine = beginFoldBlock - 1;
+ lookLineLevel = GetLevel(lookLine);
+ lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ while ((lookLine >= 0) && (lookLineLevelNum >= SC_FOLDLEVELBASE)) {
+ if (lookLineLevel & SC_FOLDLEVELHEADERFLAG) {
+ if (GetLastChild(lookLine, -1, lookLastLine) == line) {
+ beginFoldBlock = lookLine;
+ endFoldBlock = line;
+ firstChangeableLineBefore = line - 1;
+ }
+ }
+ if ((lookLine > 0) && (lookLineLevelNum == SC_FOLDLEVELBASE) && ((GetLevel(lookLine - 1) & SC_FOLDLEVELNUMBERMASK) > lookLineLevelNum))
+ break;
+ lookLineLevel = GetLevel(--lookLine);
+ lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ }
+ }
+ if (firstChangeableLineBefore == -1) {
+ for (lookLine = line - 1, lookLineLevel = GetLevel(lookLine), lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ lookLine >= beginFoldBlock;
+ lookLineLevel = GetLevel(--lookLine), lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK) {
+ if ((lookLineLevel & SC_FOLDLEVELWHITEFLAG) || (lookLineLevelNum > (level & SC_FOLDLEVELNUMBERMASK))) {
+ firstChangeableLineBefore = lookLine;
+ break;
+ }
+ }
+ }
+ if (firstChangeableLineBefore == -1)
+ firstChangeableLineBefore = beginFoldBlock - 1;
+
+ int firstChangeableLineAfter = -1;
+ for (lookLine = line + 1, lookLineLevel = GetLevel(lookLine), lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK;
+ lookLine <= endFoldBlock;
+ lookLineLevel = GetLevel(++lookLine), lookLineLevelNum = lookLineLevel & SC_FOLDLEVELNUMBERMASK) {
+ if ((lookLineLevel & SC_FOLDLEVELHEADERFLAG) && (lookLineLevelNum < (GetLevel(lookLine + 1) & SC_FOLDLEVELNUMBERMASK))) {
+ firstChangeableLineAfter = lookLine;
+ break;
+ }
+ }
+ if (firstChangeableLineAfter == -1)
+ firstChangeableLineAfter = endFoldBlock + 1;
+
+ highlightDelimiter.beginFoldBlock = beginFoldBlock;
+ highlightDelimiter.endFoldBlock = endFoldBlock;
+ highlightDelimiter.firstChangeableLineBefore = firstChangeableLineBefore;
+ highlightDelimiter.firstChangeableLineAfter = firstChangeableLineAfter;
+}
+
+int Document::ClampPositionIntoDocument(int pos) const {
+ return Platform::Clamp(pos, 0, Length());
+}
+
+bool Document::IsCrLf(int pos) const {
+ if (pos < 0)
+ return false;
+ if (pos >= (Length() - 1))
+ return false;
+ return (cb.CharAt(pos) == '\r') && (cb.CharAt(pos + 1) == '\n');
+}
+
+int Document::LenChar(int pos) {
+ if (pos < 0) {
+ return 1;
+ } else if (IsCrLf(pos)) {
+ return 2;
+ } else if (SC_CP_UTF8 == dbcsCodePage) {
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos));
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ int lengthDoc = Length();
+ if ((pos + widthCharBytes) > lengthDoc)
+ return lengthDoc - pos;
+ else
+ return widthCharBytes;
+ } else if (dbcsCodePage) {
+ return IsDBCSLeadByte(cb.CharAt(pos)) ? 2 : 1;
+ } else {
+ return 1;
+ }
+}
+
+bool Document::InGoodUTF8(int pos, int &start, int &end) const {
+ int trail = pos;
+ while ((trail>0) && (pos-trail < UTF8MaxBytes) && UTF8IsTrailByte(static_cast<unsigned char>(cb.CharAt(trail-1))))
+ trail--;
+ start = (trail > 0) ? trail-1 : trail;
+
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(start));
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ if (widthCharBytes == 1) {
+ return false;
+ } else {
+ int trailBytes = widthCharBytes - 1;
+ int len = pos - start;
+ if (len > trailBytes)
+ // pos too far from lead
+ return false;
+ char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0};
+ for (int b=1; b<widthCharBytes && ((start+b) < Length()); b++)
+ charBytes[b] = cb.CharAt(static_cast<int>(start+b));
+ int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes);
+ if (utf8status & UTF8MaskInvalid)
+ return false;
+ end = start + widthCharBytes;
+ return true;
+ }
+}
+
+// Normalise a position so that it is not halfway through a two byte character.
+// This can occur in two situations -
+// When lines are terminated with \r\n pairs which should be treated as one character.
+// When displaying DBCS text such as Japanese.
+// If moving, move the position in the indicated direction.
+int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const {
+ //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
+ // If out of range, just return minimum/maximum value.
+ if (pos <= 0)
+ return 0;
+ if (pos >= Length())
+ return Length();
+
+ // PLATFORM_ASSERT(pos > 0 && pos < Length());
+ if (checkLineEnd && IsCrLf(pos - 1)) {
+ if (moveDir > 0)
+ return pos + 1;
+ else
+ return pos - 1;
+ }
+
+ if (dbcsCodePage) {
+ if (SC_CP_UTF8 == dbcsCodePage) {
+ unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
+ // If ch is not a trail byte then pos is valid intercharacter position
+ if (UTF8IsTrailByte(ch)) {
+ int startUTF = pos;
+ int endUTF = pos;
+ if (InGoodUTF8(pos, startUTF, endUTF)) {
+ // ch is a trail byte within a UTF-8 character
+ if (moveDir > 0)
+ pos = endUTF;
+ else
+ pos = startUTF;
+ }
+ // Else invalid UTF-8 so return position of isolated trail byte
+ }
+ } else {
+ // Anchor DBCS calculations at start of line because start of line can
+ // not be a DBCS trail byte.
+ int posStartLine = LineStart(LineFromPosition(pos));
+ if (pos == posStartLine)
+ return pos;
+
+ // Step back until a non-lead-byte is found.
+ int posCheck = pos;
+ while ((posCheck > posStartLine) && IsDBCSLeadByte(cb.CharAt(posCheck-1)))
+ posCheck--;
+
+ // Check from known start of character.
+ while (posCheck < pos) {
+ int mbsize = IsDBCSLeadByte(cb.CharAt(posCheck)) ? 2 : 1;
+ if (posCheck + mbsize == pos) {
+ return pos;
+ } else if (posCheck + mbsize > pos) {
+ if (moveDir > 0) {
+ return posCheck + mbsize;
+ } else {
+ return posCheck;
+ }
+ }
+ posCheck += mbsize;
+ }
+ }
+ }
+
+ return pos;
+}
+
+// NextPosition moves between valid positions - it can not handle a position in the middle of a
+// multi-byte character. It is used to iterate through text more efficiently than MovePositionOutsideChar.
+// A \r\n pair is treated as two characters.
+int Document::NextPosition(int pos, int moveDir) const {
+ // If out of range, just return minimum/maximum value.
+ int increment = (moveDir > 0) ? 1 : -1;
+ if (pos + increment <= 0)
+ return 0;
+ if (pos + increment >= Length())
+ return Length();
+
+ if (dbcsCodePage) {
+ if (SC_CP_UTF8 == dbcsCodePage) {
+ if (increment == 1) {
+ // Simple forward movement case so can avoid some checks
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos));
+ if (UTF8IsAscii(leadByte)) {
+ // Single byte character or invalid
+ pos++;
+ } else {
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0};
+ for (int b=1; b<widthCharBytes; b++)
+ charBytes[b] = cb.CharAt(static_cast<int>(pos+b));
+ int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes);
+ if (utf8status & UTF8MaskInvalid)
+ pos++;
+ else
+ pos += utf8status & UTF8MaskWidth;
+ }
+ } else {
+ // Examine byte before position
+ pos--;
+ unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos));
+ // If ch is not a trail byte then pos is valid intercharacter position
+ if (UTF8IsTrailByte(ch)) {
+ // If ch is a trail byte in a valid UTF-8 character then return start of character
+ int startUTF = pos;
+ int endUTF = pos;
+ if (InGoodUTF8(pos, startUTF, endUTF)) {
+ pos = startUTF;
+ }
+ // Else invalid UTF-8 so return position of isolated trail byte
+ }
+ }
+ } else {
+ if (moveDir > 0) {
+ int mbsize = IsDBCSLeadByte(cb.CharAt(pos)) ? 2 : 1;
+ pos += mbsize;
+ if (pos > Length())
+ pos = Length();
+ } else {
+ // Anchor DBCS calculations at start of line because start of line can
+ // not be a DBCS trail byte.
+ int posStartLine = LineStart(LineFromPosition(pos));
+ // See http://msdn.microsoft.com/en-us/library/cc194792%28v=MSDN.10%29.aspx
+ // http://msdn.microsoft.com/en-us/library/cc194790.aspx
+ if ((pos - 1) <= posStartLine) {
+ return pos - 1;
+ } else if (IsDBCSLeadByte(cb.CharAt(pos - 1))) {
+ // Must actually be trail byte
+ return pos - 2;
+ } else {
+ // Otherwise, step back until a non-lead-byte is found.
+ int posTemp = pos - 1;
+ while (posStartLine <= --posTemp && IsDBCSLeadByte(cb.CharAt(posTemp)))
+ ;
+ // Now posTemp+1 must point to the beginning of a character,
+ // so figure out whether we went back an even or an odd
+ // number of bytes and go back 1 or 2 bytes, respectively.
+ return (pos - 1 - ((pos - posTemp) & 1));
+ }
+ }
+ }
+ } else {
+ pos += increment;
+ }
+
+ return pos;
+}
+
+bool Document::NextCharacter(int &pos, int moveDir) const {
+ // Returns true if pos changed
+ int posNext = NextPosition(pos, moveDir);
+ if (posNext == pos) {
+ return false;
+ } else {
+ pos = posNext;
+ return true;
+ }
+}
+
+// Return -1 on out-of-bounds
+int SCI_METHOD Document::GetRelativePosition(int positionStart, int characterOffset) const {
+ int pos = positionStart;
+ if (dbcsCodePage) {
+ const int increment = (characterOffset > 0) ? 1 : -1;
+ while (characterOffset != 0) {
+ const int posNext = NextPosition(pos, increment);
+ if (posNext == pos)
+ return INVALID_POSITION;
+ pos = posNext;
+ characterOffset -= increment;
+ }
+ } else {
+ pos = positionStart + characterOffset;
+ if ((pos < 0) || (pos > Length()))
+ return INVALID_POSITION;
+ }
+ return pos;
+}
+
+int Document::GetRelativePositionUTF16(int positionStart, int characterOffset) const {
+ int pos = positionStart;
+ if (dbcsCodePage) {
+ const int increment = (characterOffset > 0) ? 1 : -1;
+ while (characterOffset != 0) {
+ const int posNext = NextPosition(pos, increment);
+ if (posNext == pos)
+ return INVALID_POSITION;
+ if (abs(pos-posNext) > 3) // 4 byte character = 2*UTF16.
+ characterOffset -= increment;
+ pos = posNext;
+ characterOffset -= increment;
+ }
+ } else {
+ pos = positionStart + characterOffset;
+ if ((pos < 0) || (pos > Length()))
+ return INVALID_POSITION;
+ }
+ return pos;
+}
+
+int SCI_METHOD Document::GetCharacterAndWidth(int position, int *pWidth) const {
+ int character;
+ int bytesInCharacter = 1;
+ if (dbcsCodePage) {
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(position));
+ if (SC_CP_UTF8 == dbcsCodePage) {
+ if (UTF8IsAscii(leadByte)) {
+ // Single byte character or invalid
+ character = leadByte;
+ } else {
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ unsigned char charBytes[UTF8MaxBytes] = {leadByte,0,0,0};
+ for (int b=1; b<widthCharBytes; b++)
+ charBytes[b] = static_cast<unsigned char>(cb.CharAt(position+b));
+ int utf8status = UTF8Classify(charBytes, widthCharBytes);
+ if (utf8status & UTF8MaskInvalid) {
+ // Report as singleton surrogate values which are invalid Unicode
+ character = 0xDC80 + leadByte;
+ } else {
+ bytesInCharacter = utf8status & UTF8MaskWidth;
+ character = UnicodeFromUTF8(charBytes);
+ }
+ }
+ } else {
+ if (IsDBCSLeadByte(leadByte)) {
+ bytesInCharacter = 2;
+ character = (leadByte << 8) | static_cast<unsigned char>(cb.CharAt(position+1));
+ } else {
+ character = leadByte;
+ }
+ }
+ } else {
+ character = cb.CharAt(position);
+ }
+ if (pWidth) {
+ *pWidth = bytesInCharacter;
+ }
+ return character;
+}
+
+int SCI_METHOD Document::CodePage() const {
+ return dbcsCodePage;
+}
+
+bool SCI_METHOD Document::IsDBCSLeadByte(char ch) const {
+ // Byte ranges found in Wikipedia articles with relevant search strings in each case
+ unsigned char uch = static_cast<unsigned char>(ch);
+ switch (dbcsCodePage) {
+ case 932:
+ // Shift_jis
+ return ((uch >= 0x81) && (uch <= 0x9F)) ||
+ ((uch >= 0xE0) && (uch <= 0xFC));
+ // Lead bytes F0 to FC may be a Microsoft addition.
+ case 936:
+ // GBK
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 949:
+ // Korean Wansung KS C-5601-1987
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 950:
+ // Big5
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 1361:
+ // Korean Johab KS C-5601-1992
+ return
+ ((uch >= 0x84) && (uch <= 0xD3)) ||
+ ((uch >= 0xD8) && (uch <= 0xDE)) ||
+ ((uch >= 0xE0) && (uch <= 0xF9));
+ }
+ return false;
+}
+
+static inline bool IsSpaceOrTab(int ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+// Need to break text into segments near lengthSegment but taking into
+// account the encoding to not break inside a UTF-8 or DBCS character
+// and also trying to avoid breaking inside a pair of combining characters.
+// The segment length must always be long enough (more than 4 bytes)
+// so that there will be at least one whole character to make a segment.
+// For UTF-8, text must consist only of valid whole characters.
+// In preference order from best to worst:
+// 1) Break after space
+// 2) Break before punctuation
+// 3) Break after whole character
+
+int Document::SafeSegment(const char *text, int length, int lengthSegment) const {
+ if (length <= lengthSegment)
+ return length;
+ int lastSpaceBreak = -1;
+ int lastPunctuationBreak = -1;
+ int lastEncodingAllowedBreak = 0;
+ for (int j=0; j < lengthSegment;) {
+ unsigned char ch = static_cast<unsigned char>(text[j]);
+ if (j > 0) {
+ if (IsSpaceOrTab(text[j - 1]) && !IsSpaceOrTab(text[j])) {
+ lastSpaceBreak = j;
+ }
+ if (ch < 'A') {
+ lastPunctuationBreak = j;
+ }
+ }
+ lastEncodingAllowedBreak = j;
+
+ if (dbcsCodePage == SC_CP_UTF8) {
+ j += UTF8BytesOfLead[ch];
+ } else if (dbcsCodePage) {
+ j += IsDBCSLeadByte(ch) ? 2 : 1;
+ } else {
+ j++;
+ }
+ }
+ if (lastSpaceBreak >= 0) {
+ return lastSpaceBreak;
+ } else if (lastPunctuationBreak >= 0) {
+ return lastPunctuationBreak;
+ }
+ return lastEncodingAllowedBreak;
+}
+
+EncodingFamily Document::CodePageFamily() const {
+ if (SC_CP_UTF8 == dbcsCodePage)
+ return efUnicode;
+ else if (dbcsCodePage)
+ return efDBCS;
+ else
+ return efEightBit;
+}
+
+void Document::ModifiedAt(int pos) {
+ if (endStyled > pos)
+ endStyled = pos;
+}
+
+void Document::CheckReadOnly() {
+ if (cb.IsReadOnly() && enteredReadOnlyCount == 0) {
+ enteredReadOnlyCount++;
+ NotifyModifyAttempt();
+ enteredReadOnlyCount--;
+ }
+}
+
+// Document only modified by gateways DeleteChars, InsertString, Undo, Redo, and SetStyleAt.
+// SetStyleAt does not change the persistent state of a document
+
+bool Document::DeleteChars(int pos, int len) {
+ if (pos < 0)
+ return false;
+ if (len <= 0)
+ return false;
+ if ((pos + len) > Length())
+ return false;
+ CheckReadOnly();
+ if (enteredModification != 0) {
+ return false;
+ } else {
+ enteredModification++;
+ if (!cb.IsReadOnly()) {
+ NotifyModified(
+ DocModification(
+ SC_MOD_BEFOREDELETE | SC_PERFORMED_USER,
+ pos, len,
+ 0, 0));
+ int prevLinesTotal = LinesTotal();
+ bool startSavePoint = cb.IsSavePoint();
+ bool startSequence = false;
+ const char *text = cb.DeleteChars(pos, len, startSequence);
+ if (startSavePoint && cb.IsCollectingUndo())
+ NotifySavePoint(!startSavePoint);
+ if ((pos < Length()) || (pos == 0))
+ ModifiedAt(pos);
+ else
+ ModifiedAt(pos-1);
+ NotifyModified(
+ DocModification(
+ SC_MOD_DELETETEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0),
+ pos, len,
+ LinesTotal() - prevLinesTotal, text));
+ }
+ enteredModification--;
+ }
+ return !cb.IsReadOnly();
+}
+
+/**
+ * Insert a string with a length.
+ */
+int Document::InsertString(int position, const char *s, int insertLength) {
+ if (insertLength <= 0) {
+ return 0;
+ }
+ CheckReadOnly(); // Application may change read only state here
+ if (cb.IsReadOnly()) {
+ return 0;
+ }
+ if (enteredModification != 0) {
+ return 0;
+ }
+ enteredModification++;
+ insertionSet = false;
+ insertion.clear();
+ NotifyModified(
+ DocModification(
+ SC_MOD_INSERTCHECK,
+ position, insertLength,
+ 0, s));
+ if (insertionSet) {
+ s = insertion.c_str();
+ insertLength = static_cast<int>(insertion.length());
+ }
+ NotifyModified(
+ DocModification(
+ SC_MOD_BEFOREINSERT | SC_PERFORMED_USER,
+ position, insertLength,
+ 0, s));
+ int prevLinesTotal = LinesTotal();
+ bool startSavePoint = cb.IsSavePoint();
+ bool startSequence = false;
+ const char *text = cb.InsertString(position, s, insertLength, startSequence);
+ if (startSavePoint && cb.IsCollectingUndo())
+ NotifySavePoint(!startSavePoint);
+ ModifiedAt(position);
+ NotifyModified(
+ DocModification(
+ SC_MOD_INSERTTEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0),
+ position, insertLength,
+ LinesTotal() - prevLinesTotal, text));
+ if (insertionSet) { // Free memory as could be large
+ std::string().swap(insertion);
+ }
+ enteredModification--;
+ return insertLength;
+}
+
+void Document::ChangeInsertion(const char *s, int length) {
+ insertionSet = true;
+ insertion.assign(s, length);
+}
+
+int SCI_METHOD Document::AddData(char *data, int length) {
+ try {
+ int position = Length();
+ InsertString(position, data, length);
+ } catch (std::bad_alloc &) {
+ return SC_STATUS_BADALLOC;
+ } catch (...) {
+ return SC_STATUS_FAILURE;
+ }
+ return 0;
+}
+
+void * SCI_METHOD Document::ConvertToDocument() {
+ return this;
+}
+
+int Document::Undo() {
+ int newPos = -1;
+ CheckReadOnly();
+ if ((enteredModification == 0) && (cb.IsCollectingUndo())) {
+ enteredModification++;
+ if (!cb.IsReadOnly()) {
+ bool startSavePoint = cb.IsSavePoint();
+ bool multiLine = false;
+ int steps = cb.StartUndo();
+ //Platform::DebugPrintf("Steps=%d\n", steps);
+ int coalescedRemovePos = -1;
+ int coalescedRemoveLen = 0;
+ int prevRemoveActionPos = -1;
+ int prevRemoveActionLen = 0;
+ for (int step = 0; step < steps; step++) {
+ const int prevLinesTotal = LinesTotal();
+ const Action &action = cb.GetUndoStep();
+ if (action.at == removeAction) {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action));
+ } else if (action.at == containerAction) {
+ DocModification dm(SC_MOD_CONTAINER | SC_PERFORMED_UNDO);
+ dm.token = action.position;
+ NotifyModified(dm);
+ if (!action.mayCoalesce) {
+ coalescedRemovePos = -1;
+ coalescedRemoveLen = 0;
+ prevRemoveActionPos = -1;
+ prevRemoveActionLen = 0;
+ }
+ } else {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action));
+ }
+ cb.PerformUndoStep();
+ if (action.at != containerAction) {
+ ModifiedAt(action.position);
+ newPos = action.position;
+ }
+
+ int modFlags = SC_PERFORMED_UNDO;
+ // With undo, an insertion action becomes a deletion notification
+ if (action.at == removeAction) {
+ newPos += action.lenData;
+ modFlags |= SC_MOD_INSERTTEXT;
+ if ((coalescedRemoveLen > 0) &&
+ (action.position == prevRemoveActionPos || action.position == (prevRemoveActionPos + prevRemoveActionLen))) {
+ coalescedRemoveLen += action.lenData;
+ newPos = coalescedRemovePos + coalescedRemoveLen;
+ } else {
+ coalescedRemovePos = action.position;
+ coalescedRemoveLen = action.lenData;
+ }
+ prevRemoveActionPos = action.position;
+ prevRemoveActionLen = action.lenData;
+ } else if (action.at == insertAction) {
+ modFlags |= SC_MOD_DELETETEXT;
+ coalescedRemovePos = -1;
+ coalescedRemoveLen = 0;
+ prevRemoveActionPos = -1;
+ prevRemoveActionLen = 0;
+ }
+ if (steps > 1)
+ modFlags |= SC_MULTISTEPUNDOREDO;
+ const int linesAdded = LinesTotal() - prevLinesTotal;
+ if (linesAdded != 0)
+ multiLine = true;
+ if (step == steps - 1) {
+ modFlags |= SC_LASTSTEPINUNDOREDO;
+ if (multiLine)
+ modFlags |= SC_MULTILINEUNDOREDO;
+ }
+ NotifyModified(DocModification(modFlags, action.position, action.lenData,
+ linesAdded, action.data));
+ }
+
+ bool endSavePoint = cb.IsSavePoint();
+ if (startSavePoint != endSavePoint)
+ NotifySavePoint(endSavePoint);
+ }
+ enteredModification--;
+ }
+ return newPos;
+}
+
+int Document::Redo() {
+ int newPos = -1;
+ CheckReadOnly();
+ if ((enteredModification == 0) && (cb.IsCollectingUndo())) {
+ enteredModification++;
+ if (!cb.IsReadOnly()) {
+ bool startSavePoint = cb.IsSavePoint();
+ bool multiLine = false;
+ int steps = cb.StartRedo();
+ for (int step = 0; step < steps; step++) {
+ const int prevLinesTotal = LinesTotal();
+ const Action &action = cb.GetRedoStep();
+ if (action.at == insertAction) {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREINSERT | SC_PERFORMED_REDO, action));
+ } else if (action.at == containerAction) {
+ DocModification dm(SC_MOD_CONTAINER | SC_PERFORMED_REDO);
+ dm.token = action.position;
+ NotifyModified(dm);
+ } else {
+ NotifyModified(DocModification(
+ SC_MOD_BEFOREDELETE | SC_PERFORMED_REDO, action));
+ }
+ cb.PerformRedoStep();
+ if (action.at != containerAction) {
+ ModifiedAt(action.position);
+ newPos = action.position;
+ }
+
+ int modFlags = SC_PERFORMED_REDO;
+ if (action.at == insertAction) {
+ newPos += action.lenData;
+ modFlags |= SC_MOD_INSERTTEXT;
+ } else if (action.at == removeAction) {
+ modFlags |= SC_MOD_DELETETEXT;
+ }
+ if (steps > 1)
+ modFlags |= SC_MULTISTEPUNDOREDO;
+ const int linesAdded = LinesTotal() - prevLinesTotal;
+ if (linesAdded != 0)
+ multiLine = true;
+ if (step == steps - 1) {
+ modFlags |= SC_LASTSTEPINUNDOREDO;
+ if (multiLine)
+ modFlags |= SC_MULTILINEUNDOREDO;
+ }
+ NotifyModified(
+ DocModification(modFlags, action.position, action.lenData,
+ linesAdded, action.data));
+ }
+
+ bool endSavePoint = cb.IsSavePoint();
+ if (startSavePoint != endSavePoint)
+ NotifySavePoint(endSavePoint);
+ }
+ enteredModification--;
+ }
+ return newPos;
+}
+
+void Document::DelChar(int pos) {
+ DeleteChars(pos, LenChar(pos));
+}
+
+void Document::DelCharBack(int pos) {
+ if (pos <= 0) {
+ return;
+ } else if (IsCrLf(pos - 2)) {
+ DeleteChars(pos - 2, 2);
+ } else if (dbcsCodePage) {
+ int startChar = NextPosition(pos, -1);
+ DeleteChars(startChar, pos - startChar);
+ } else {
+ DeleteChars(pos - 1, 1);
+ }
+}
+
+static int NextTab(int pos, int tabSize) {
+ return ((pos / tabSize) + 1) * tabSize;
+}
+
+static std::string CreateIndentation(int indent, int tabSize, bool insertSpaces) {
+ std::string indentation;
+ if (!insertSpaces) {
+ while (indent >= tabSize) {
+ indentation += '\t';
+ indent -= tabSize;
+ }
+ }
+ while (indent > 0) {
+ indentation += ' ';
+ indent--;
+ }
+ return indentation;
+}
+
+int SCI_METHOD Document::GetLineIndentation(int line) {
+ int indent = 0;
+ if ((line >= 0) && (line < LinesTotal())) {
+ int lineStart = LineStart(line);
+ int length = Length();
+ for (int i = lineStart; i < length; i++) {
+ char ch = cb.CharAt(i);
+ if (ch == ' ')
+ indent++;
+ else if (ch == '\t')
+ indent = NextTab(indent, tabInChars);
+ else
+ return indent;
+ }
+ }
+ return indent;
+}
+
+int Document::SetLineIndentation(int line, int indent) {
+ int indentOfLine = GetLineIndentation(line);
+ if (indent < 0)
+ indent = 0;
+ if (indent != indentOfLine) {
+ std::string linebuf = CreateIndentation(indent, tabInChars, !useTabs);
+ int thisLineStart = LineStart(line);
+ int indentPos = GetLineIndentPosition(line);
+ UndoGroup ug(this);
+ DeleteChars(thisLineStart, indentPos - thisLineStart);
+ return thisLineStart + InsertString(thisLineStart, linebuf.c_str(),
+ static_cast<int>(linebuf.length()));
+ } else {
+ return GetLineIndentPosition(line);
+ }
+}
+
+int Document::GetLineIndentPosition(int line) const {
+ if (line < 0)
+ return 0;
+ int pos = LineStart(line);
+ int length = Length();
+ while ((pos < length) && IsSpaceOrTab(cb.CharAt(pos))) {
+ pos++;
+ }
+ return pos;
+}
+
+int Document::GetColumn(int pos) {
+ int column = 0;
+ int line = LineFromPosition(pos);
+ if ((line >= 0) && (line < LinesTotal())) {
+ for (int i = LineStart(line); i < pos;) {
+ char ch = cb.CharAt(i);
+ if (ch == '\t') {
+ column = NextTab(column, tabInChars);
+ i++;
+ } else if (ch == '\r') {
+ return column;
+ } else if (ch == '\n') {
+ return column;
+ } else if (i >= Length()) {
+ return column;
+ } else {
+ column++;
+ i = NextPosition(i, 1);
+ }
+ }
+ }
+ return column;
+}
+
+int Document::CountCharacters(int startPos, int endPos) const {
+ startPos = MovePositionOutsideChar(startPos, 1, false);
+ endPos = MovePositionOutsideChar(endPos, -1, false);
+ int count = 0;
+ int i = startPos;
+ while (i < endPos) {
+ count++;
+ if (IsCrLf(i))
+ i++;
+ i = NextPosition(i, 1);
+ }
+ return count;
+}
+
+int Document::CountUTF16(int startPos, int endPos) const {
+ startPos = MovePositionOutsideChar(startPos, 1, false);
+ endPos = MovePositionOutsideChar(endPos, -1, false);
+ int count = 0;
+ int i = startPos;
+ while (i < endPos) {
+ count++;
+ const int next = NextPosition(i, 1);
+ if ((next - i) > 3)
+ count++;
+ i = next;
+ }
+ return count;
+}
+
+int Document::FindColumn(int line, int column) {
+ int position = LineStart(line);
+ if ((line >= 0) && (line < LinesTotal())) {
+ int columnCurrent = 0;
+ while ((columnCurrent < column) && (position < Length())) {
+ char ch = cb.CharAt(position);
+ if (ch == '\t') {
+ columnCurrent = NextTab(columnCurrent, tabInChars);
+ if (columnCurrent > column)
+ return position;
+ position++;
+ } else if (ch == '\r') {
+ return position;
+ } else if (ch == '\n') {
+ return position;
+ } else {
+ columnCurrent++;
+ position = NextPosition(position, 1);
+ }
+ }
+ }
+ return position;
+}
+
+void Document::Indent(bool forwards, int lineBottom, int lineTop) {
+ // Dedent - suck white space off the front of the line to dedent by equivalent of a tab
+ for (int line = lineBottom; line >= lineTop; line--) {
+ int indentOfLine = GetLineIndentation(line);
+ if (forwards) {
+ if (LineStart(line) < LineEnd(line)) {
+ SetLineIndentation(line, indentOfLine + IndentSize());
+ }
+ } else {
+ SetLineIndentation(line, indentOfLine - IndentSize());
+ }
+ }
+}
+
+// Convert line endings for a piece of text to a particular mode.
+// Stop at len or when a NUL is found.
+std::string Document::TransformLineEnds(const char *s, size_t len, int eolModeWanted) {
+ std::string dest;
+ for (size_t i = 0; (i < len) && (s[i]); i++) {
+ if (s[i] == '\n' || s[i] == '\r') {
+ if (eolModeWanted == SC_EOL_CR) {
+ dest.push_back('\r');
+ } else if (eolModeWanted == SC_EOL_LF) {
+ dest.push_back('\n');
+ } else { // eolModeWanted == SC_EOL_CRLF
+ dest.push_back('\r');
+ dest.push_back('\n');
+ }
+ if ((s[i] == '\r') && (i+1 < len) && (s[i+1] == '\n')) {
+ i++;
+ }
+ } else {
+ dest.push_back(s[i]);
+ }
+ }
+ return dest;
+}
+
+void Document::ConvertLineEnds(int eolModeSet) {
+ UndoGroup ug(this);
+
+ for (int pos = 0; pos < Length(); pos++) {
+ if (cb.CharAt(pos) == '\r') {
+ if (cb.CharAt(pos + 1) == '\n') {
+ // CRLF
+ if (eolModeSet == SC_EOL_CR) {
+ DeleteChars(pos + 1, 1); // Delete the LF
+ } else if (eolModeSet == SC_EOL_LF) {
+ DeleteChars(pos, 1); // Delete the CR
+ } else {
+ pos++;
+ }
+ } else {
+ // CR
+ if (eolModeSet == SC_EOL_CRLF) {
+ pos += InsertString(pos + 1, "\n", 1); // Insert LF
+ } else if (eolModeSet == SC_EOL_LF) {
+ pos += InsertString(pos, "\n", 1); // Insert LF
+ DeleteChars(pos, 1); // Delete CR
+ pos--;
+ }
+ }
+ } else if (cb.CharAt(pos) == '\n') {
+ // LF
+ if (eolModeSet == SC_EOL_CRLF) {
+ pos += InsertString(pos, "\r", 1); // Insert CR
+ } else if (eolModeSet == SC_EOL_CR) {
+ pos += InsertString(pos, "\r", 1); // Insert CR
+ DeleteChars(pos, 1); // Delete LF
+ pos--;
+ }
+ }
+ }
+
+}
+
+bool Document::IsWhiteLine(int line) const {
+ int currentChar = LineStart(line);
+ int endLine = LineEnd(line);
+ while (currentChar < endLine) {
+ if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') {
+ return false;
+ }
+ ++currentChar;
+ }
+ return true;
+}
+
+int Document::ParaUp(int pos) const {
+ int line = LineFromPosition(pos);
+ line--;
+ while (line >= 0 && IsWhiteLine(line)) { // skip empty lines
+ line--;
+ }
+ while (line >= 0 && !IsWhiteLine(line)) { // skip non-empty lines
+ line--;
+ }
+ line++;
+ return LineStart(line);
+}
+
+int Document::ParaDown(int pos) const {
+ int line = LineFromPosition(pos);
+ while (line < LinesTotal() && !IsWhiteLine(line)) { // skip non-empty lines
+ line++;
+ }
+ while (line < LinesTotal() && IsWhiteLine(line)) { // skip empty lines
+ line++;
+ }
+ if (line < LinesTotal())
+ return LineStart(line);
+ else // end of a document
+ return LineEnd(line-1);
+}
+
+CharClassify::cc Document::WordCharClass(unsigned char ch) const {
+ if ((SC_CP_UTF8 == dbcsCodePage) && (!UTF8IsAscii(ch)))
+ return CharClassify::ccWord;
+ return charClass.GetClass(ch);
+}
+
+/**
+ * Used by commmands that want to select whole words.
+ * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0.
+ */
+int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
+ CharClassify::cc ccStart = CharClassify::ccWord;
+ if (delta < 0) {
+ if (!onlyWordCharacters)
+ ccStart = WordCharClass(cb.CharAt(pos-1));
+ while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart))
+ pos--;
+ } else {
+ if (!onlyWordCharacters && pos < Length())
+ ccStart = WordCharClass(cb.CharAt(pos));
+ while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart))
+ pos++;
+ }
+ return MovePositionOutsideChar(pos, delta, true);
+}
+
+/**
+ * Find the start of the next word in either a forward (delta >= 0) or backwards direction
+ * (delta < 0).
+ * This is looking for a transition between character classes although there is also some
+ * additional movement to transit white space.
+ * Used by cursor movement by word commands.
+ */
+int Document::NextWordStart(int pos, int delta) {
+ if (delta < 0) {
+ while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace))
+ pos--;
+ if (pos > 0) {
+ CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
+ while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) {
+ pos--;
+ }
+ }
+ } else {
+ CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
+ while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart))
+ pos++;
+ while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace))
+ pos++;
+ }
+ return pos;
+}
+
+/**
+ * Find the end of the next word in either a forward (delta >= 0) or backwards direction
+ * (delta < 0).
+ * This is looking for a transition between character classes although there is also some
+ * additional movement to transit white space.
+ * Used by cursor movement by word commands.
+ */
+int Document::NextWordEnd(int pos, int delta) {
+ if (delta < 0) {
+ if (pos > 0) {
+ CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
+ if (ccStart != CharClassify::ccSpace) {
+ while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) {
+ pos--;
+ }
+ }
+ while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace) {
+ pos--;
+ }
+ }
+ } else {
+ while (pos < Length() && WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace) {
+ pos++;
+ }
+ if (pos < Length()) {
+ CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
+ while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) {
+ pos++;
+ }
+ }
+ }
+ return pos;
+}
+
+/**
+ * Check that the character at the given position is a word or punctuation character and that
+ * the previous character is of a different character class.
+ */
+bool Document::IsWordStartAt(int pos) const {
+ if (pos > 0) {
+ CharClassify::cc ccPos = WordCharClass(CharAt(pos));
+ return (ccPos == CharClassify::ccWord || ccPos == CharClassify::ccPunctuation) &&
+ (ccPos != WordCharClass(CharAt(pos - 1)));
+ }
+ return true;
+}
+
+/**
+ * Check that the character at the given position is a word or punctuation character and that
+ * the next character is of a different character class.
+ */
+bool Document::IsWordEndAt(int pos) const {
+ if (pos < Length()) {
+ CharClassify::cc ccPrev = WordCharClass(CharAt(pos-1));
+ return (ccPrev == CharClassify::ccWord || ccPrev == CharClassify::ccPunctuation) &&
+ (ccPrev != WordCharClass(CharAt(pos)));
+ }
+ return true;
+}
+
+/**
+ * Check that the given range is has transitions between character classes at both
+ * ends and where the characters on the inside are word or punctuation characters.
+ */
+bool Document::IsWordAt(int start, int end) const {
+ return IsWordStartAt(start) && IsWordEndAt(end);
+}
+
+bool Document::MatchesWordOptions(bool word, bool wordStart, int pos, int length) const {
+ return (!word && !wordStart) ||
+ (word && IsWordAt(pos, pos + length)) ||
+ (wordStart && IsWordStartAt(pos));
+}
+
+bool Document::HasCaseFolder(void) const {
+ return pcf != 0;
+}
+
+void Document::SetCaseFolder(CaseFolder *pcf_) {
+ delete pcf;
+ pcf = pcf_;
+}
+
+Document::CharacterExtracted Document::ExtractCharacter(int position) const {
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(position));
+ if (UTF8IsAscii(leadByte)) {
+ // Common case: ASCII character
+ return CharacterExtracted(leadByte, 1);
+ }
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ unsigned char charBytes[UTF8MaxBytes] = { leadByte, 0, 0, 0 };
+ for (int b=1; b<widthCharBytes; b++)
+ charBytes[b] = static_cast<unsigned char>(cb.CharAt(position + b));
+ int utf8status = UTF8Classify(charBytes, widthCharBytes);
+ if (utf8status & UTF8MaskInvalid) {
+ // Treat as invalid and use up just one byte
+ return CharacterExtracted(unicodeReplacementChar, 1);
+ } else {
+ return CharacterExtracted(UnicodeFromUTF8(charBytes), utf8status & UTF8MaskWidth);
+ }
+}
+
+/**
+ * Find text in document, supporting both forward and backward
+ * searches (just pass minPos > maxPos to do a backward search)
+ * Has not been tested with backwards DBCS searches yet.
+ */
+long Document::FindText(int minPos, int maxPos, const char *search,
+ bool caseSensitive, bool word, bool wordStart, bool regExp, int flags,
+ int *length) {
+ if (*length <= 0)
+ return minPos;
+ if (regExp) {
+ if (!regex)
+ regex = CreateRegexSearch(&charClass);
+ return regex->FindText(this, minPos, maxPos, search, caseSensitive, word, wordStart, flags, length);
+ } else {
+
+ const bool forward = minPos <= maxPos;
+ const int increment = forward ? 1 : -1;
+
+ // Range endpoints should not be inside DBCS characters, but just in case, move them.
+ const int startPos = MovePositionOutsideChar(minPos, increment, false);
+ const int endPos = MovePositionOutsideChar(maxPos, increment, false);
+
+ // Compute actual search ranges needed
+ const int lengthFind = *length;
+
+ //Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
+ const int limitPos = Platform::Maximum(startPos, endPos);
+ int pos = startPos;
+ if (!forward) {
+ // Back all of a character
+ pos = NextPosition(pos, increment);
+ }
+ if (caseSensitive) {
+ const int endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos;
+ const char charStartSearch = search[0];
+ while (forward ? (pos < endSearch) : (pos >= endSearch)) {
+ if (CharAt(pos) == charStartSearch) {
+ bool found = (pos + lengthFind) <= limitPos;
+ for (int indexSearch = 1; (indexSearch < lengthFind) && found; indexSearch++) {
+ found = CharAt(pos + indexSearch) == search[indexSearch];
+ }
+ if (found && MatchesWordOptions(word, wordStart, pos, lengthFind)) {
+ return pos;
+ }
+ }
+ if (!NextCharacter(pos, increment))
+ break;
+ }
+ } else if (SC_CP_UTF8 == dbcsCodePage) {
+ const size_t maxFoldingExpansion = 4;
+ std::vector<char> searchThing(lengthFind * UTF8MaxBytes * maxFoldingExpansion + 1);
+ const int lenSearch = static_cast<int>(
+ pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind));
+ char bytes[UTF8MaxBytes + 1];
+ char folded[UTF8MaxBytes * maxFoldingExpansion + 1];
+ while (forward ? (pos < endPos) : (pos >= endPos)) {
+ int widthFirstCharacter = 0;
+ int posIndexDocument = pos;
+ int indexSearch = 0;
+ bool characterMatches = true;
+ for (;;) {
+ const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(posIndexDocument));
+ bytes[0] = leadByte;
+ int widthChar = 1;
+ if (!UTF8IsAscii(leadByte)) {
+ const int widthCharBytes = UTF8BytesOfLead[leadByte];
+ for (int b=1; b<widthCharBytes; b++) {
+ bytes[b] = cb.CharAt(posIndexDocument+b);
+ }
+ widthChar = UTF8Classify(reinterpret_cast<const unsigned char *>(bytes), widthCharBytes) & UTF8MaskWidth;
+ }
+ if (!widthFirstCharacter)
+ widthFirstCharacter = widthChar;
+ if ((posIndexDocument + widthChar) > limitPos)
+ break;
+ const int lenFlat = static_cast<int>(pcf->Fold(folded, sizeof(folded), bytes, widthChar));
+ folded[lenFlat] = 0;
+ // Does folded match the buffer
+ characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat);
+ if (!characterMatches)
+ break;
+ posIndexDocument += widthChar;
+ indexSearch += lenFlat;
+ if (indexSearch >= lenSearch)
+ break;
+ }
+ if (characterMatches && (indexSearch == static_cast<int>(lenSearch))) {
+ if (MatchesWordOptions(word, wordStart, pos, posIndexDocument - pos)) {
+ *length = posIndexDocument - pos;
+ return pos;
+ }
+ }
+ if (forward) {
+ pos += widthFirstCharacter;
+ } else {
+ if (!NextCharacter(pos, increment))
+ break;
+ }
+ }
+ } else if (dbcsCodePage) {
+ const size_t maxBytesCharacter = 2;
+ const size_t maxFoldingExpansion = 4;
+ std::vector<char> searchThing(lengthFind * maxBytesCharacter * maxFoldingExpansion + 1);
+ const int lenSearch = static_cast<int>(
+ pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind));
+ while (forward ? (pos < endPos) : (pos >= endPos)) {
+ int indexDocument = 0;
+ int indexSearch = 0;
+ bool characterMatches = true;
+ while (characterMatches &&
+ ((pos + indexDocument) < limitPos) &&
+ (indexSearch < lenSearch)) {
+ char bytes[maxBytesCharacter + 1];
+ bytes[0] = cb.CharAt(pos + indexDocument);
+ const int widthChar = IsDBCSLeadByte(bytes[0]) ? 2 : 1;
+ if (widthChar == 2)
+ bytes[1] = cb.CharAt(pos + indexDocument + 1);
+ if ((pos + indexDocument + widthChar) > limitPos)
+ break;
+ char folded[maxBytesCharacter * maxFoldingExpansion + 1];
+ const int lenFlat = static_cast<int>(pcf->Fold(folded, sizeof(folded), bytes, widthChar));
+ folded[lenFlat] = 0;
+ // Does folded match the buffer
+ characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat);
+ indexDocument += widthChar;
+ indexSearch += lenFlat;
+ }
+ if (characterMatches && (indexSearch == static_cast<int>(lenSearch))) {
+ if (MatchesWordOptions(word, wordStart, pos, indexDocument)) {
+ *length = indexDocument;
+ return pos;
+ }
+ }
+ if (!NextCharacter(pos, increment))
+ break;
+ }
+ } else {
+ const int endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos;
+ std::vector<char> searchThing(lengthFind + 1);
+ pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind);
+ while (forward ? (pos < endSearch) : (pos >= endSearch)) {
+ bool found = (pos + lengthFind) <= limitPos;
+ for (int indexSearch = 0; (indexSearch < lengthFind) && found; indexSearch++) {
+ char ch = CharAt(pos + indexSearch);
+ char folded[2];
+ pcf->Fold(folded, sizeof(folded), &ch, 1);
+ found = folded[0] == searchThing[indexSearch];
+ }
+ if (found && MatchesWordOptions(word, wordStart, pos, lengthFind)) {
+ return pos;
+ }
+ if (!NextCharacter(pos, increment))
+ break;
+ }
+ }
+ }
+ //Platform::DebugPrintf("Not found\n");
+ return -1;
+}
+
+const char *Document::SubstituteByPosition(const char *text, int *length) {
+ if (regex)
+ return regex->SubstituteByPosition(this, text, length);
+ else
+ return 0;
+}
+
+int Document::LinesTotal() const {
+ return cb.Lines();
+}
+
+void Document::SetDefaultCharClasses(bool includeWordClass) {
+ charClass.SetDefaultCharClasses(includeWordClass);
+}
+
+void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass) {
+ charClass.SetCharClasses(chars, newCharClass);
+}
+
+int Document::GetCharsOfClass(CharClassify::cc characterClass, unsigned char *buffer) {
+ return charClass.GetCharsOfClass(characterClass, buffer);
+}
+
+void SCI_METHOD Document::StartStyling(int position, char) {
+ endStyled = position;
+}
+
+bool SCI_METHOD Document::SetStyleFor(int length, char style) {
+ if (enteredStyling != 0) {
+ return false;
+ } else {
+ enteredStyling++;
+ int prevEndStyled = endStyled;
+ if (cb.SetStyleFor(endStyled, length, style)) {
+ DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
+ prevEndStyled, length);
+ NotifyModified(mh);
+ }
+ endStyled += length;
+ enteredStyling--;
+ return true;
+ }
+}
+
+bool SCI_METHOD Document::SetStyles(int length, const char *styles) {
+ if (enteredStyling != 0) {
+ return false;
+ } else {
+ enteredStyling++;
+ bool didChange = false;
+ int startMod = 0;
+ int endMod = 0;
+ for (int iPos = 0; iPos < length; iPos++, endStyled++) {
+ PLATFORM_ASSERT(endStyled < Length());
+ if (cb.SetStyleAt(endStyled, styles[iPos])) {
+ if (!didChange) {
+ startMod = endStyled;
+ }
+ didChange = true;
+ endMod = endStyled;
+ }
+ }
+ if (didChange) {
+ DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
+ startMod, endMod - startMod + 1);
+ NotifyModified(mh);
+ }
+ enteredStyling--;
+ return true;
+ }
+}
+
+void Document::EnsureStyledTo(int pos) {
+ if ((enteredStyling == 0) && (pos > GetEndStyled())) {
+ IncrementStyleClock();
+ if (pli && !pli->UseContainerLexing()) {
+ int lineEndStyled = LineFromPosition(GetEndStyled());
+ int endStyledTo = LineStart(lineEndStyled);
+ pli->Colourise(endStyledTo, pos);
+ } else {
+ // Ask the watchers to style, and stop as soon as one responds.
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin();
+ (pos > GetEndStyled()) && (it != watchers.end()); ++it) {
+ it->watcher->NotifyStyleNeeded(this, it->userData, pos);
+ }
+ }
+ }
+}
+
+void Document::LexerChanged() {
+ // Tell the watchers the lexer has changed.
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifyLexerChanged(this, it->userData);
+ }
+}
+
+int SCI_METHOD Document::SetLineState(int line, int state) {
+ int statePrevious = static_cast<LineState *>(perLineData[ldState])->SetLineState(line, state);
+ if (state != statePrevious) {
+ DocModification mh(SC_MOD_CHANGELINESTATE, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+ }
+ return statePrevious;
+}
+
+int SCI_METHOD Document::GetLineState(int line) const {
+ return static_cast<LineState *>(perLineData[ldState])->GetLineState(line);
+}
+
+int Document::GetMaxLineState() {
+ return static_cast<LineState *>(perLineData[ldState])->GetMaxLineState();
+}
+
+void SCI_METHOD Document::ChangeLexerState(int start, int end) {
+ DocModification mh(SC_MOD_LEXERSTATE, start, end-start, 0, 0, 0);
+ NotifyModified(mh);
+}
+
+StyledText Document::MarginStyledText(int line) const {
+ LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldMargin]);
+ return StyledText(pla->Length(line), pla->Text(line),
+ pla->MultipleStyles(line), pla->Style(line), pla->Styles(line));
+}
+
+void Document::MarginSetText(int line, const char *text) {
+ static_cast<LineAnnotation *>(perLineData[ldMargin])->SetText(line, text);
+ DocModification mh(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+}
+
+void Document::MarginSetStyle(int line, int style) {
+ static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyle(line, style);
+ NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line));
+}
+
+void Document::MarginSetStyles(int line, const unsigned char *styles) {
+ static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyles(line, styles);
+ NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line));
+}
+
+void Document::MarginClearAll() {
+ int maxEditorLine = LinesTotal();
+ for (int l=0; l<maxEditorLine; l++)
+ MarginSetText(l, 0);
+ // Free remaining data
+ static_cast<LineAnnotation *>(perLineData[ldMargin])->ClearAll();
+}
+
+StyledText Document::AnnotationStyledText(int line) const {
+ LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldAnnotation]);
+ return StyledText(pla->Length(line), pla->Text(line),
+ pla->MultipleStyles(line), pla->Style(line), pla->Styles(line));
+}
+
+void Document::AnnotationSetText(int line, const char *text) {
+ if (line >= 0 && line < LinesTotal()) {
+ const int linesBefore = AnnotationLines(line);
+ static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetText(line, text);
+ const int linesAfter = AnnotationLines(line);
+ DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line);
+ mh.annotationLinesAdded = linesAfter - linesBefore;
+ NotifyModified(mh);
+ }
+}
+
+void Document::AnnotationSetStyle(int line, int style) {
+ static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyle(line, style);
+ DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line);
+ NotifyModified(mh);
+}
+
+void Document::AnnotationSetStyles(int line, const unsigned char *styles) {
+ if (line >= 0 && line < LinesTotal()) {
+ static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyles(line, styles);
+ }
+}
+
+int Document::AnnotationLines(int line) const {
+ return static_cast<LineAnnotation *>(perLineData[ldAnnotation])->Lines(line);
+}
+
+void Document::AnnotationClearAll() {
+ int maxEditorLine = LinesTotal();
+ for (int l=0; l<maxEditorLine; l++)
+ AnnotationSetText(l, 0);
+ // Free remaining data
+ static_cast<LineAnnotation *>(perLineData[ldAnnotation])->ClearAll();
+}
+
+void Document::IncrementStyleClock() {
+ styleClock = (styleClock + 1) % 0x100000;
+}
+
+void SCI_METHOD Document::DecorationFillRange(int position, int value, int fillLength) {
+ if (decorations.FillRange(position, value, fillLength)) {
+ DocModification mh(SC_MOD_CHANGEINDICATOR | SC_PERFORMED_USER,
+ position, fillLength);
+ NotifyModified(mh);
+ }
+}
+
+bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
+ WatcherWithUserData wwud(watcher, userData);
+ std::vector<WatcherWithUserData>::iterator it =
+ std::find(watchers.begin(), watchers.end(), wwud);
+ if (it != watchers.end())
+ return false;
+ watchers.push_back(wwud);
+ return true;
+}
+
+bool Document::RemoveWatcher(DocWatcher *watcher, void *userData) {
+ std::vector<WatcherWithUserData>::iterator it =
+ std::find(watchers.begin(), watchers.end(), WatcherWithUserData(watcher, userData));
+ if (it != watchers.end()) {
+ watchers.erase(it);
+ return true;
+ }
+ return false;
+}
+
+void Document::NotifyModifyAttempt() {
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifyModifyAttempt(this, it->userData);
+ }
+}
+
+void Document::NotifySavePoint(bool atSavePoint) {
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifySavePoint(this, it->userData, atSavePoint);
+ }
+}
+
+void Document::NotifyModified(DocModification mh) {
+ if (mh.modificationType & SC_MOD_INSERTTEXT) {
+ decorations.InsertSpace(mh.position, mh.length);
+ } else if (mh.modificationType & SC_MOD_DELETETEXT) {
+ decorations.DeleteRange(mh.position, mh.length);
+ }
+ for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
+ it->watcher->NotifyModified(this, mh, it->userData);
+ }
+}
+
+bool Document::IsWordPartSeparator(char ch) const {
+ return (WordCharClass(ch) == CharClassify::ccWord) && IsPunctuation(ch);
+}
+
+int Document::WordPartLeft(int pos) {
+ if (pos > 0) {
+ --pos;
+ char startChar = cb.CharAt(pos);
+ if (IsWordPartSeparator(startChar)) {
+ while (pos > 0 && IsWordPartSeparator(cb.CharAt(pos))) {
+ --pos;
+ }
+ }
+ if (pos > 0) {
+ startChar = cb.CharAt(pos);
+ --pos;
+ if (IsLowerCase(startChar)) {
+ while (pos > 0 && IsLowerCase(cb.CharAt(pos)))
+ --pos;
+ if (!IsUpperCase(cb.CharAt(pos)) && !IsLowerCase(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsUpperCase(startChar)) {
+ while (pos > 0 && IsUpperCase(cb.CharAt(pos)))
+ --pos;
+ if (!IsUpperCase(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsADigit(startChar)) {
+ while (pos > 0 && IsADigit(cb.CharAt(pos)))
+ --pos;
+ if (!IsADigit(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsPunctuation(startChar)) {
+ while (pos > 0 && IsPunctuation(cb.CharAt(pos)))
+ --pos;
+ if (!IsPunctuation(cb.CharAt(pos)))
+ ++pos;
+ } else if (isspacechar(startChar)) {
+ while (pos > 0 && isspacechar(cb.CharAt(pos)))
+ --pos;
+ if (!isspacechar(cb.CharAt(pos)))
+ ++pos;
+ } else if (!IsASCII(startChar)) {
+ while (pos > 0 && !IsASCII(cb.CharAt(pos)))
+ --pos;
+ if (IsASCII(cb.CharAt(pos)))
+ ++pos;
+ } else {
+ ++pos;
+ }
+ }
+ }
+ return pos;
+}
+
+int Document::WordPartRight(int pos) {
+ char startChar = cb.CharAt(pos);
+ int length = Length();
+ if (IsWordPartSeparator(startChar)) {
+ while (pos < length && IsWordPartSeparator(cb.CharAt(pos)))
+ ++pos;
+ startChar = cb.CharAt(pos);
+ }
+ if (!IsASCII(startChar)) {
+ while (pos < length && !IsASCII(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsLowerCase(startChar)) {
+ while (pos < length && IsLowerCase(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsUpperCase(startChar)) {
+ if (IsLowerCase(cb.CharAt(pos + 1))) {
+ ++pos;
+ while (pos < length && IsLowerCase(cb.CharAt(pos)))
+ ++pos;
+ } else {
+ while (pos < length && IsUpperCase(cb.CharAt(pos)))
+ ++pos;
+ }
+ if (IsLowerCase(cb.CharAt(pos)) && IsUpperCase(cb.CharAt(pos - 1)))
+ --pos;
+ } else if (IsADigit(startChar)) {
+ while (pos < length && IsADigit(cb.CharAt(pos)))
+ ++pos;
+ } else if (IsPunctuation(startChar)) {
+ while (pos < length && IsPunctuation(cb.CharAt(pos)))
+ ++pos;
+ } else if (isspacechar(startChar)) {
+ while (pos < length && isspacechar(cb.CharAt(pos)))
+ ++pos;
+ } else {
+ ++pos;
+ }
+ return pos;
+}
+
+bool IsLineEndChar(char c) {
+ return (c == '\n' || c == '\r');
+}
+
+int Document::ExtendStyleRange(int pos, int delta, bool singleLine) {
+ int sStart = cb.StyleAt(pos);
+ if (delta < 0) {
+ while (pos > 0 && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))))
+ pos--;
+ pos++;
+ } else {
+ while (pos < (Length()) && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))))
+ pos++;
+ }
+ return pos;
+}
+
+static char BraceOpposite(char ch) {
+ switch (ch) {
+ case '(':
+ return ')';
+ case ')':
+ return '(';
+ case '[':
+ return ']';
+ case ']':
+ return '[';
+ case '{':
+ return '}';
+ case '}':
+ return '{';
+ case '<':
+ return '>';
+ case '>':
+ return '<';
+ default:
+ return '\0';
+ }
+}
+
+// TODO: should be able to extend styled region to find matching brace
+int Document::BraceMatch(int position, int /*maxReStyle*/) {
+ char chBrace = CharAt(position);
+ char chSeek = BraceOpposite(chBrace);
+ if (chSeek == '\0')
+ return - 1;
+ char styBrace = static_cast<char>(StyleAt(position));
+ int direction = -1;
+ if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<')
+ direction = 1;
+ int depth = 1;
+ position = NextPosition(position, direction);
+ while ((position >= 0) && (position < Length())) {
+ char chAtPos = CharAt(position);
+ char styAtPos = static_cast<char>(StyleAt(position));
+ if ((position > GetEndStyled()) || (styAtPos == styBrace)) {
+ if (chAtPos == chBrace)
+ depth++;
+ if (chAtPos == chSeek)
+ depth--;
+ if (depth == 0)
+ return position;
+ }
+ int positionBeforeMove = position;
+ position = NextPosition(position, direction);
+ if (position == positionBeforeMove)
+ break;
+ }
+ return - 1;
+}
+
+/**
+ * Implementation of RegexSearchBase for the default built-in regular expression engine
+ */
+class BuiltinRegex : public RegexSearchBase {
+public:
+ explicit BuiltinRegex(CharClassify *charClassTable) : search(charClassTable) {}
+
+ virtual ~BuiltinRegex() {
+ }
+
+ virtual long FindText(Document *doc, int minPos, int maxPos, const char *s,
+ bool caseSensitive, bool word, bool wordStart, int flags,
+ int *length);
+
+ virtual const char *SubstituteByPosition(Document *doc, const char *text, int *length);
+
+private:
+ RESearch search;
+ std::string substituted;
+};
+
+namespace {
+
+/**
+* RESearchRange keeps track of search range.
+*/
+class RESearchRange {
+public:
+ const Document *doc;
+ int increment;
+ int startPos;
+ int endPos;
+ int lineRangeStart;
+ int lineRangeEnd;
+ int lineRangeBreak;
+ RESearchRange(const Document *doc_, int minPos, int maxPos) : doc(doc_) {
+ increment = (minPos <= maxPos) ? 1 : -1;
+
+ // Range endpoints should not be inside DBCS characters, but just in case, move them.
+ startPos = doc->MovePositionOutsideChar(minPos, 1, false);
+ endPos = doc->MovePositionOutsideChar(maxPos, 1, false);
+
+ lineRangeStart = doc->LineFromPosition(startPos);
+ lineRangeEnd = doc->LineFromPosition(endPos);
+ if ((increment == 1) &&
+ (startPos >= doc->LineEnd(lineRangeStart)) &&
+ (lineRangeStart < lineRangeEnd)) {
+ // the start position is at end of line or between line end characters.
+ lineRangeStart++;
+ startPos = doc->LineStart(lineRangeStart);
+ } else if ((increment == -1) &&
+ (startPos <= doc->LineStart(lineRangeStart)) &&
+ (lineRangeStart > lineRangeEnd)) {
+ // the start position is at beginning of line.
+ lineRangeStart--;
+ startPos = doc->LineEnd(lineRangeStart);
+ }
+ lineRangeBreak = lineRangeEnd + increment;
+ }
+ Range LineRange(int line) const {
+ Range range(doc->LineStart(line), doc->LineEnd(line));
+ if (increment == 1) {
+ if (line == lineRangeStart)
+ range.start = startPos;
+ if (line == lineRangeEnd)
+ range.end = endPos;
+ } else {
+ if (line == lineRangeEnd)
+ range.start = endPos;
+ if (line == lineRangeStart)
+ range.end = startPos;
+ }
+ return range;
+ }
+};
+
+// Define a way for the Regular Expression code to access the document
+class DocumentIndexer : public CharacterIndexer {
+ Document *pdoc;
+ int end;
+public:
+ DocumentIndexer(Document *pdoc_, int end_) :
+ pdoc(pdoc_), end(end_) {
+ }
+
+ virtual ~DocumentIndexer() {
+ }
+
+ virtual char CharAt(int index) {
+ if (index < 0 || index >= end)
+ return 0;
+ else
+ return pdoc->CharAt(index);
+ }
+};
+
+#ifdef CXX11_REGEX
+
+class ByteIterator : public std::iterator<std::bidirectional_iterator_tag, char> {
+public:
+ const Document *doc;
+ Position position;
+ ByteIterator(const Document *doc_ = 0, Position position_ = 0) : doc(doc_), position(position_) {
+ }
+ ByteIterator(const ByteIterator &other) {
+ doc = other.doc;
+ position = other.position;
+ }
+ ByteIterator &operator=(const ByteIterator &other) {
+ if (this != &other) {
+ doc = other.doc;
+ position = other.position;
+ }
+ return *this;
+ }
+ char operator*() const {
+ return doc->CharAt(position);
+ }
+ ByteIterator &operator++() {
+ position++;
+ return *this;
+ }
+ ByteIterator operator++(int) {
+ ByteIterator retVal(*this);
+ position++;
+ return retVal;
+ }
+ ByteIterator &operator--() {
+ position--;
+ return *this;
+ }
+ bool operator==(const ByteIterator &other) const {
+ return doc == other.doc && position == other.position;
+ }
+ bool operator!=(const ByteIterator &other) const {
+ return doc != other.doc || position != other.position;
+ }
+ int Pos() const {
+ return position;
+ }
+ int PosRoundUp() const {
+ return position;
+ }
+};
+
+// On Windows, wchar_t is 16 bits wide and on Unix it is 32 bits wide.
+// Would be better to use sizeof(wchar_t) or similar to differentiate
+// but easier for now to hard-code platforms.
+// C++11 has char16_t and char32_t but neither Clang nor Visual C++
+// appear to allow specializing basic_regex over these.
+
+#ifdef _WIN32
+#define WCHAR_T_IS_16 1
+#else
+#define WCHAR_T_IS_16 0
+#endif
+
+#if WCHAR_T_IS_16
+
+// On Windows, report non-BMP characters as 2 separate surrogates as that
+// matches wregex since it is based on wchar_t.
+class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> {
+ // These 3 fields determine the iterator position and are used for comparisons
+ const Document *doc;
+ Position position;
+ size_t characterIndex;
+ // Remaining fields are derived from the determining fields so are excluded in comparisons
+ unsigned int lenBytes;
+ size_t lenCharacters;
+ wchar_t buffered[2];
+public:
+ UTF8Iterator(const Document *doc_ = 0, Position position_ = 0) :
+ doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0) {
+ buffered[0] = 0;
+ buffered[1] = 0;
+ if (doc) {
+ ReadCharacter();
+ }
+ }
+ UTF8Iterator(const UTF8Iterator &other) {
+ doc = other.doc;
+ position = other.position;
+ characterIndex = other.characterIndex;
+ lenBytes = other.lenBytes;
+ lenCharacters = other.lenCharacters;
+ buffered[0] = other.buffered[0];
+ buffered[1] = other.buffered[1];
+ }
+ UTF8Iterator &operator=(const UTF8Iterator &other) {
+ if (this != &other) {
+ doc = other.doc;
+ position = other.position;
+ characterIndex = other.characterIndex;
+ lenBytes = other.lenBytes;
+ lenCharacters = other.lenCharacters;
+ buffered[0] = other.buffered[0];
+ buffered[1] = other.buffered[1];
+ }
+ return *this;
+ }
+ wchar_t operator*() const {
+ assert(lenCharacters != 0);
+ return buffered[characterIndex];
+ }
+ UTF8Iterator &operator++() {
+ if ((characterIndex + 1) < (lenCharacters)) {
+ characterIndex++;
+ } else {
+ position += lenBytes;
+ ReadCharacter();
+ characterIndex = 0;
+ }
+ return *this;
+ }
+ UTF8Iterator operator++(int) {
+ UTF8Iterator retVal(*this);
+ if ((characterIndex + 1) < (lenCharacters)) {
+ characterIndex++;
+ } else {
+ position += lenBytes;
+ ReadCharacter();
+ characterIndex = 0;
+ }
+ return retVal;
+ }
+ UTF8Iterator &operator--() {
+ if (characterIndex) {
+ characterIndex--;
+ } else {
+ position = doc->NextPosition(position, -1);
+ ReadCharacter();
+ characterIndex = lenCharacters - 1;
+ }
+ return *this;
+ }
+ bool operator==(const UTF8Iterator &other) const {
+ // Only test the determining fields, not the character widths and values derived from this
+ return doc == other.doc &&
+ position == other.position &&
+ characterIndex == other.characterIndex;
+ }
+ bool operator!=(const UTF8Iterator &other) const {
+ // Only test the determining fields, not the character widths and values derived from this
+ return doc != other.doc ||
+ position != other.position ||
+ characterIndex != other.characterIndex;
+ }
+ int Pos() const {
+ return position;
+ }
+ int PosRoundUp() const {
+ if (characterIndex)
+ return position + lenBytes; // Force to end of character
+ else
+ return position;
+ }
+private:
+ void ReadCharacter() {
+ Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position);
+ lenBytes = charExtracted.widthBytes;
+ if (charExtracted.character == unicodeReplacementChar) {
+ lenCharacters = 1;
+ buffered[0] = static_cast<wchar_t>(charExtracted.character);
+ } else {
+ lenCharacters = UTF16FromUTF32Character(charExtracted.character, buffered);
+ }
+ }
+};
+
+#else
+
+// On Unix, report non-BMP characters as single characters
+
+class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> {
+ const Document *doc;
+ Position position;
+public:
+ UTF8Iterator(const Document *doc_=0, Position position_=0) : doc(doc_), position(position_) {
+ }
+ UTF8Iterator(const UTF8Iterator &other) {
+ doc = other.doc;
+ position = other.position;
+ }
+ UTF8Iterator &operator=(const UTF8Iterator &other) {
+ if (this != &other) {
+ doc = other.doc;
+ position = other.position;
+ }
+ return *this;
+ }
+ wchar_t operator*() const {
+ Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position);
+ return charExtracted.character;
+ }
+ UTF8Iterator &operator++() {
+ position = doc->NextPosition(position, 1);
+ return *this;
+ }
+ UTF8Iterator operator++(int) {
+ UTF8Iterator retVal(*this);
+ position = doc->NextPosition(position, 1);
+ return retVal;
+ }
+ UTF8Iterator &operator--() {
+ position = doc->NextPosition(position, -1);
+ return *this;
+ }
+ bool operator==(const UTF8Iterator &other) const {
+ return doc == other.doc && position == other.position;
+ }
+ bool operator!=(const UTF8Iterator &other) const {
+ return doc != other.doc || position != other.position;
+ }
+ int Pos() const {
+ return position;
+ }
+ int PosRoundUp() const {
+ return position;
+ }
+};
+
+#endif
+
+std::regex_constants::match_flag_type MatchFlags(const Document *doc, int startPos, int endPos) {
+ std::regex_constants::match_flag_type flagsMatch = std::regex_constants::match_default;
+ if (!doc->IsLineStartPosition(startPos))
+ flagsMatch |= std::regex_constants::match_not_bol;
+ if (!doc->IsLineEndPosition(endPos))
+ flagsMatch |= std::regex_constants::match_not_eol;
+ return flagsMatch;
+}
+
+template<typename Iterator, typename Regex>
+bool MatchOnLines(const Document *doc, const Regex &regexp, const RESearchRange &resr, RESearch &search) {
+ bool matched = false;
+ std::match_results<Iterator> match;
+
+ // MSVC and libc++ have problems with ^ and $ matching line ends inside a range
+ // If they didn't then the line by line iteration could be removed for the forwards
+ // case and replaced with the following 4 lines:
+ // Iterator uiStart(doc, startPos);
+ // Iterator uiEnd(doc, endPos);
+ // flagsMatch = MatchFlags(doc, startPos, endPos);
+ // matched = std::regex_search(uiStart, uiEnd, match, regexp, flagsMatch);
+
+ // Line by line.
+ for (int line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) {
+ const Range lineRange = resr.LineRange(line);
+ Iterator itStart(doc, lineRange.start);
+ Iterator itEnd(doc, lineRange.end);
+ std::regex_constants::match_flag_type flagsMatch = MatchFlags(doc, lineRange.start, lineRange.end);
+ matched = std::regex_search(itStart, itEnd, match, regexp, flagsMatch);
+ // Check for the last match on this line.
+ if (matched) {
+ if (resr.increment == -1) {
+ while (matched) {
+ Iterator itNext(doc, match[0].second.PosRoundUp());
+ flagsMatch = MatchFlags(doc, itNext.Pos(), lineRange.end);
+ std::match_results<Iterator> matchNext;
+ matched = std::regex_search(itNext, itEnd, matchNext, regexp, flagsMatch);
+ if (matched) {
+ if (match[0].first == match[0].second) {
+ // Empty match means failure so exit
+ return false;
+ }
+ match = matchNext;
+ }
+ }
+ matched = true;
+ }
+ break;
+ }
+ }
+ if (matched) {
+ for (size_t co = 0; co < match.size(); co++) {
+ search.bopat[co] = match[co].first.Pos();
+ search.eopat[co] = match[co].second.PosRoundUp();
+ size_t lenMatch = search.eopat[co] - search.bopat[co];
+ search.pat[co].resize(lenMatch);
+ for (size_t iPos = 0; iPos < lenMatch; iPos++) {
+ search.pat[co][iPos] = doc->CharAt(iPos + search.bopat[co]);
+ }
+ }
+ }
+ return matched;
+}
+
+long Cxx11RegexFindText(Document *doc, int minPos, int maxPos, const char *s,
+ bool caseSensitive, int *length, RESearch &search) {
+ const RESearchRange resr(doc, minPos, maxPos);
+ try {
+ //ElapsedTime et;
+ std::regex::flag_type flagsRe = std::regex::ECMAScript;
+ // Flags that apper to have no effect:
+ // | std::regex::collate | std::regex::extended;
+ if (!caseSensitive)
+ flagsRe = flagsRe | std::regex::icase;
+
+ // Clear the RESearch so can fill in matches
+ search.Clear();
+
+ bool matched = false;
+ if (SC_CP_UTF8 == doc->dbcsCodePage) {
+ unsigned int lenS = static_cast<unsigned int>(strlen(s));
+ std::vector<wchar_t> ws(lenS + 1);
+#if WCHAR_T_IS_16
+ size_t outLen = UTF16FromUTF8(s, lenS, &ws[0], lenS);
+#else
+ size_t outLen = UTF32FromUTF8(s, lenS, reinterpret_cast<unsigned int *>(&ws[0]), lenS);
+#endif
+ ws[outLen] = 0;
+ std::wregex regexp;
+#if defined(__APPLE__)
+ // Using a UTF-8 locale doesn't change to Unicode over a byte buffer so '.'
+ // is one byte not one character.
+ // However, on OS X this makes wregex act as Unicode
+ std::locale localeU("en_US.UTF-8");
+ regexp.imbue(localeU);
+#endif
+ regexp.assign(&ws[0], flagsRe);
+ matched = MatchOnLines<UTF8Iterator>(doc, regexp, resr, search);
+
+ } else {
+ std::regex regexp;
+ regexp.assign(s, flagsRe);
+ matched = MatchOnLines<ByteIterator>(doc, regexp, resr, search);
+ }
+
+ int posMatch = -1;
+ if (matched) {
+ posMatch = search.bopat[0];
+ *length = search.eopat[0] - search.bopat[0];
+ }
+ // Example - search in doc/ScintillaHistory.html for
+ // [[:upper:]]eta[[:space:]]
+ // On MacBook, normally around 1 second but with locale imbued -> 14 seconds.
+ //double durSearch = et.Duration(true);
+ //Platform::DebugPrintf("Search:%9.6g \n", durSearch);
+ return posMatch;
+ } catch (std::regex_error &) {
+ // Failed to create regular expression
+ throw RegexError();
+ } catch (...) {
+ // Failed in some other way
+ return -1;
+ }
+}
+
+#endif
+
+}
+
+long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s,
+ bool caseSensitive, bool, bool, int flags,
+ int *length) {
+
+#ifdef CXX11_REGEX
+ if (flags & SCFIND_CXX11REGEX) {
+ return Cxx11RegexFindText(doc, minPos, maxPos, s,
+ caseSensitive, length, search);
+ }
+#endif
+
+ const RESearchRange resr(doc, minPos, maxPos);
+
+ const bool posix = (flags & SCFIND_POSIX) != 0;
+
+ const char *errmsg = search.Compile(s, *length, caseSensitive, posix);
+ if (errmsg) {
+ return -1;
+ }
+ // Find a variable in a property file: \$(\([A-Za-z0-9_.]+\))
+ // Replace first '.' with '-' in each property file variable reference:
+ // Search: \$(\([A-Za-z0-9_-]+\)\.\([A-Za-z0-9_.]+\))
+ // Replace: $(\1-\2)
+ int pos = -1;
+ int lenRet = 0;
+ const char searchEnd = s[*length - 1];
+ const char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0';
+ for (int line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) {
+ int startOfLine = doc->LineStart(line);
+ int endOfLine = doc->LineEnd(line);
+ if (resr.increment == 1) {
+ if (line == resr.lineRangeStart) {
+ if ((resr.startPos != startOfLine) && (s[0] == '^'))
+ continue; // Can't match start of line if start position after start of line
+ startOfLine = resr.startPos;
+ }
+ if (line == resr.lineRangeEnd) {
+ if ((resr.endPos != endOfLine) && (searchEnd == '$') && (searchEndPrev != '\\'))
+ continue; // Can't match end of line if end position before end of line
+ endOfLine = resr.endPos;
+ }
+ } else {
+ if (line == resr.lineRangeEnd) {
+ if ((resr.endPos != startOfLine) && (s[0] == '^'))
+ continue; // Can't match start of line if end position after start of line
+ startOfLine = resr.endPos;
+ }
+ if (line == resr.lineRangeStart) {
+ if ((resr.startPos != endOfLine) && (searchEnd == '$') && (searchEndPrev != '\\'))
+ continue; // Can't match end of line if start position before end of line
+ endOfLine = resr.startPos;
+ }
+ }
+
+ DocumentIndexer di(doc, endOfLine);
+ int success = search.Execute(di, startOfLine, endOfLine);
+ if (success) {
+ pos = search.bopat[0];
+ // Ensure only whole characters selected
+ search.eopat[0] = doc->MovePositionOutsideChar(search.eopat[0], 1, false);
+ lenRet = search.eopat[0] - search.bopat[0];
+ // There can be only one start of a line, so no need to look for last match in line
+ if ((resr.increment == -1) && (s[0] != '^')) {
+ // Check for the last match on this line.
+ int repetitions = 1000; // Break out of infinite loop
+ while (success && (search.eopat[0] <= endOfLine) && (repetitions--)) {
+ success = search.Execute(di, pos+1, endOfLine);
+ if (success) {
+ if (search.eopat[0] <= minPos) {
+ pos = search.bopat[0];
+ lenRet = search.eopat[0] - search.bopat[0];
+ } else {
+ success = 0;
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ *length = lenRet;
+ return pos;
+}
+
+const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, int *length) {
+ substituted.clear();
+ DocumentIndexer di(doc, doc->Length());
+ search.GrabMatches(di);
+ for (int j = 0; j < *length; j++) {
+ if (text[j] == '\\') {
+ if (text[j + 1] >= '0' && text[j + 1] <= '9') {
+ unsigned int patNum = text[j + 1] - '0';
+ unsigned int len = search.eopat[patNum] - search.bopat[patNum];
+ if (!search.pat[patNum].empty()) // Will be null if try for a match that did not occur
+ substituted.append(search.pat[patNum].c_str(), len);
+ j++;
+ } else {
+ j++;
+ switch (text[j]) {
+ case 'a':
+ substituted.push_back('\a');
+ break;
+ case 'b':
+ substituted.push_back('\b');
+ break;
+ case 'f':
+ substituted.push_back('\f');
+ break;
+ case 'n':
+ substituted.push_back('\n');
+ break;
+ case 'r':
+ substituted.push_back('\r');
+ break;
+ case 't':
+ substituted.push_back('\t');
+ break;
+ case 'v':
+ substituted.push_back('\v');
+ break;
+ case '\\':
+ substituted.push_back('\\');
+ break;
+ default:
+ substituted.push_back('\\');
+ j--;
+ }
+ }
+ } else {
+ substituted.push_back(text[j]);
+ }
+ }
+ *length = static_cast<int>(substituted.length());
+ return substituted.c_str();
+}
+
+#ifndef SCI_OWNREGEX
+
+#ifdef SCI_NAMESPACE
+
+RegexSearchBase *Scintilla::CreateRegexSearch(CharClassify *charClassTable) {
+ return new BuiltinRegex(charClassTable);
+}
+
+#else
+
+RegexSearchBase *CreateRegexSearch(CharClassify *charClassTable) {
+ return new BuiltinRegex(charClassTable);
+}
+
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Document.h b/3rdparty/bgfx/3rdparty/scintilla/src/Document.h
new file mode 100644
index 00000000000..5e66dc2b625
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Document.h
@@ -0,0 +1,536 @@
+// Scintilla source code edit control
+/** @file Document.h
+ ** Text document that handles notifications, DBCS, styling, words and end of line.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef DOCUMENT_H
+#define DOCUMENT_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ * A Position is a position within a document between two characters or at the beginning or end.
+ * Sometimes used as a character index where it identifies the character after the position.
+ */
+typedef int Position;
+const Position invalidPosition = -1;
+
+enum EncodingFamily { efEightBit, efUnicode, efDBCS };
+
+/**
+ * The range class represents a range of text in a document.
+ * The two values are not sorted as one end may be more significant than the other
+ * as is the case for the selection where the end position is the position of the caret.
+ * If either position is invalidPosition then the range is invalid and most operations will fail.
+ */
+class Range {
+public:
+ Position start;
+ Position end;
+
+ explicit Range(Position pos=0) :
+ start(pos), end(pos) {
+ }
+ Range(Position start_, Position end_) :
+ start(start_), end(end_) {
+ }
+
+ bool operator==(const Range &other) const {
+ return (start == other.start) && (end == other.end);
+ }
+
+ bool Valid() const {
+ return (start != invalidPosition) && (end != invalidPosition);
+ }
+
+ Position First() const {
+ return (start <= end) ? start : end;
+ }
+
+ Position Last() const {
+ return (start > end) ? start : end;
+ }
+
+ // Is the position within the range?
+ bool Contains(Position pos) const {
+ if (start < end) {
+ return (pos >= start && pos <= end);
+ } else {
+ return (pos <= start && pos >= end);
+ }
+ }
+
+ // Is the character after pos within the range?
+ bool ContainsCharacter(Position pos) const {
+ if (start < end) {
+ return (pos >= start && pos < end);
+ } else {
+ return (pos < start && pos >= end);
+ }
+ }
+
+ bool Contains(Range other) const {
+ return Contains(other.start) && Contains(other.end);
+ }
+
+ bool Overlaps(Range other) const {
+ return
+ Contains(other.start) ||
+ Contains(other.end) ||
+ other.Contains(start) ||
+ other.Contains(end);
+ }
+};
+
+class DocWatcher;
+class DocModification;
+class Document;
+
+/**
+ * Interface class for regular expression searching
+ */
+class RegexSearchBase {
+public:
+ virtual ~RegexSearchBase() {}
+
+ virtual long FindText(Document *doc, int minPos, int maxPos, const char *s,
+ bool caseSensitive, bool word, bool wordStart, int flags, int *length) = 0;
+
+ ///@return String with the substitutions, must remain valid until the next call or destruction
+ virtual const char *SubstituteByPosition(Document *doc, const char *text, int *length) = 0;
+};
+
+/// Factory function for RegexSearchBase
+extern RegexSearchBase *CreateRegexSearch(CharClassify *charClassTable);
+
+struct StyledText {
+ size_t length;
+ const char *text;
+ bool multipleStyles;
+ size_t style;
+ const unsigned char *styles;
+ StyledText(size_t length_, const char *text_, bool multipleStyles_, int style_, const unsigned char *styles_) :
+ length(length_), text(text_), multipleStyles(multipleStyles_), style(style_), styles(styles_) {
+ }
+ // Return number of bytes from start to before '\n' or end of text.
+ // Return 1 when start is outside text
+ size_t LineLength(size_t start) const {
+ size_t cur = start;
+ while ((cur < length) && (text[cur] != '\n'))
+ cur++;
+ return cur-start;
+ }
+ size_t StyleAt(size_t i) const {
+ return multipleStyles ? styles[i] : style;
+ }
+};
+
+class HighlightDelimiter {
+public:
+ HighlightDelimiter() : isEnabled(false) {
+ Clear();
+ }
+
+ void Clear() {
+ beginFoldBlock = -1;
+ endFoldBlock = -1;
+ firstChangeableLineBefore = -1;
+ firstChangeableLineAfter = -1;
+ }
+
+ bool NeedsDrawing(int line) const {
+ return isEnabled && (line <= firstChangeableLineBefore || line >= firstChangeableLineAfter);
+ }
+
+ bool IsFoldBlockHighlighted(int line) const {
+ return isEnabled && beginFoldBlock != -1 && beginFoldBlock <= line && line <= endFoldBlock;
+ }
+
+ bool IsHeadOfFoldBlock(int line) const {
+ return beginFoldBlock == line && line < endFoldBlock;
+ }
+
+ bool IsBodyOfFoldBlock(int line) const {
+ return beginFoldBlock != -1 && beginFoldBlock < line && line < endFoldBlock;
+ }
+
+ bool IsTailOfFoldBlock(int line) const {
+ return beginFoldBlock != -1 && beginFoldBlock < line && line == endFoldBlock;
+ }
+
+ int beginFoldBlock; // Begin of current fold block
+ int endFoldBlock; // End of current fold block
+ int firstChangeableLineBefore; // First line that triggers repaint before starting line that determined current fold block
+ int firstChangeableLineAfter; // First line that triggers repaint after starting line that determined current fold block
+ bool isEnabled;
+};
+
+class Document;
+
+class LexInterface {
+protected:
+ Document *pdoc;
+ ILexer *instance;
+ bool performingStyle; ///< Prevent reentrance
+public:
+ explicit LexInterface(Document *pdoc_) : pdoc(pdoc_), instance(0), performingStyle(false) {
+ }
+ virtual ~LexInterface() {
+ }
+ void Colourise(int start, int end);
+ int LineEndTypesSupported();
+ bool UseContainerLexing() const {
+ return instance == 0;
+ }
+};
+
+struct RegexError : public std::runtime_error {
+ RegexError() : std::runtime_error("regex failure") {}
+};
+
+/**
+ */
+class Document : PerLine, public IDocumentWithLineEnd, public ILoader {
+
+public:
+ /** Used to pair watcher pointer with user data. */
+ struct WatcherWithUserData {
+ DocWatcher *watcher;
+ void *userData;
+ WatcherWithUserData(DocWatcher *watcher_=0, void *userData_=0) :
+ watcher(watcher_), userData(userData_) {
+ }
+ bool operator==(const WatcherWithUserData &other) const {
+ return (watcher == other.watcher) && (userData == other.userData);
+ }
+ };
+
+private:
+ int refCount;
+ CellBuffer cb;
+ CharClassify charClass;
+ CaseFolder *pcf;
+ int endStyled;
+ int styleClock;
+ int enteredModification;
+ int enteredStyling;
+ int enteredReadOnlyCount;
+
+ bool insertionSet;
+ std::string insertion;
+
+ std::vector<WatcherWithUserData> watchers;
+
+ // ldSize is not real data - it is for dimensions and loops
+ enum lineData { ldMarkers, ldLevels, ldState, ldMargin, ldAnnotation, ldSize };
+ PerLine *perLineData[ldSize];
+
+ bool matchesValid;
+ RegexSearchBase *regex;
+
+public:
+
+ LexInterface *pli;
+
+ int eolMode;
+ /// Can also be SC_CP_UTF8 to enable UTF-8 mode
+ int dbcsCodePage;
+ int lineEndBitSet;
+ int tabInChars;
+ int indentInChars;
+ int actualIndentInChars;
+ bool useTabs;
+ bool tabIndents;
+ bool backspaceUnindents;
+
+ DecorationList decorations;
+
+ Document();
+ virtual ~Document();
+
+ int AddRef();
+ int SCI_METHOD Release();
+
+ virtual void Init();
+ int LineEndTypesSupported() const;
+ bool SetDBCSCodePage(int dbcsCodePage_);
+ int GetLineEndTypesAllowed() const { return cb.GetLineEndTypes(); }
+ bool SetLineEndTypesAllowed(int lineEndBitSet_);
+ int GetLineEndTypesActive() const { return cb.GetLineEndTypes(); }
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ int SCI_METHOD Version() const {
+ return dvLineEnd;
+ }
+
+ void SCI_METHOD SetErrorStatus(int status);
+
+ int SCI_METHOD LineFromPosition(int pos) const;
+ int ClampPositionIntoDocument(int pos) const;
+ bool IsCrLf(int pos) const;
+ int LenChar(int pos);
+ bool InGoodUTF8(int pos, int &start, int &end) const;
+ int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const;
+ int NextPosition(int pos, int moveDir) const;
+ bool NextCharacter(int &pos, int moveDir) const; // Returns true if pos changed
+ int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const;
+ int GetRelativePositionUTF16(int positionStart, int characterOffset) const;
+ int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const;
+ int SCI_METHOD CodePage() const;
+ bool SCI_METHOD IsDBCSLeadByte(char ch) const;
+ int SafeSegment(const char *text, int length, int lengthSegment) const;
+ EncodingFamily CodePageFamily() const;
+
+ // Gateways to modifying document
+ void ModifiedAt(int pos);
+ void CheckReadOnly();
+ bool DeleteChars(int pos, int len);
+ int InsertString(int position, const char *s, int insertLength);
+ void ChangeInsertion(const char *s, int length);
+ int SCI_METHOD AddData(char *data, int length);
+ void * SCI_METHOD ConvertToDocument();
+ int Undo();
+ int Redo();
+ bool CanUndo() const { return cb.CanUndo(); }
+ bool CanRedo() const { return cb.CanRedo(); }
+ void DeleteUndoHistory() { cb.DeleteUndoHistory(); }
+ bool SetUndoCollection(bool collectUndo) {
+ return cb.SetUndoCollection(collectUndo);
+ }
+ bool IsCollectingUndo() const { return cb.IsCollectingUndo(); }
+ void BeginUndoAction() { cb.BeginUndoAction(); }
+ void EndUndoAction() { cb.EndUndoAction(); }
+ void AddUndoAction(int token, bool mayCoalesce) { cb.AddUndoAction(token, mayCoalesce); }
+ void SetSavePoint();
+ bool IsSavePoint() const { return cb.IsSavePoint(); }
+
+ void TentativeStart() { cb.TentativeStart(); }
+ void TentativeCommit() { cb.TentativeCommit(); }
+ void TentativeUndo();
+ bool TentativeActive() const { return cb.TentativeActive(); }
+
+ const char * SCI_METHOD BufferPointer() { return cb.BufferPointer(); }
+ const char *RangePointer(int position, int rangeLength) { return cb.RangePointer(position, rangeLength); }
+ int GapPosition() const { return cb.GapPosition(); }
+
+ int SCI_METHOD GetLineIndentation(int line);
+ int SetLineIndentation(int line, int indent);
+ int GetLineIndentPosition(int line) const;
+ int GetColumn(int position);
+ int CountCharacters(int startPos, int endPos) const;
+ int CountUTF16(int startPos, int endPos) const;
+ int FindColumn(int line, int column);
+ void Indent(bool forwards, int lineBottom, int lineTop);
+ static std::string TransformLineEnds(const char *s, size_t len, int eolModeWanted);
+ void ConvertLineEnds(int eolModeSet);
+ void SetReadOnly(bool set) { cb.SetReadOnly(set); }
+ bool IsReadOnly() const { return cb.IsReadOnly(); }
+
+ void DelChar(int pos);
+ void DelCharBack(int pos);
+
+ char CharAt(int position) const { return cb.CharAt(position); }
+ void SCI_METHOD GetCharRange(char *buffer, int position, int lengthRetrieve) const {
+ cb.GetCharRange(buffer, position, lengthRetrieve);
+ }
+ char SCI_METHOD StyleAt(int position) const { return cb.StyleAt(position); }
+ void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const {
+ cb.GetStyleRange(buffer, position, lengthRetrieve);
+ }
+ int GetMark(int line);
+ int MarkerNext(int lineStart, int mask) const;
+ int AddMark(int line, int markerNum);
+ void AddMarkSet(int line, int valueSet);
+ void DeleteMark(int line, int markerNum);
+ void DeleteMarkFromHandle(int markerHandle);
+ void DeleteAllMarks(int markerNum);
+ int LineFromHandle(int markerHandle);
+ int SCI_METHOD LineStart(int line) const;
+ bool IsLineStartPosition(int position) const;
+ int SCI_METHOD LineEnd(int line) const;
+ int LineEndPosition(int position) const;
+ bool IsLineEndPosition(int position) const;
+ bool IsPositionInLineEnd(int position) const;
+ int VCHomePosition(int position) const;
+
+ int SCI_METHOD SetLevel(int line, int level);
+ int SCI_METHOD GetLevel(int line) const;
+ void ClearLevels();
+ int GetLastChild(int lineParent, int level=-1, int lastLine=-1);
+ int GetFoldParent(int line) const;
+ void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, int line, int lastLine);
+
+ void Indent(bool forwards);
+ int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false);
+ int NextWordStart(int pos, int delta);
+ int NextWordEnd(int pos, int delta);
+ int SCI_METHOD Length() const { return cb.Length(); }
+ void Allocate(int newSize) { cb.Allocate(newSize); }
+
+ struct CharacterExtracted {
+ unsigned int character;
+ unsigned int widthBytes;
+ CharacterExtracted(unsigned int character_, unsigned int widthBytes_) :
+ character(character_), widthBytes(widthBytes_) {
+ }
+ };
+ CharacterExtracted ExtractCharacter(int position) const;
+
+ bool MatchesWordOptions(bool word, bool wordStart, int pos, int length) const;
+ bool HasCaseFolder(void) const;
+ void SetCaseFolder(CaseFolder *pcf_);
+ long FindText(int minPos, int maxPos, const char *search, bool caseSensitive, bool word,
+ bool wordStart, bool regExp, int flags, int *length);
+ const char *SubstituteByPosition(const char *text, int *length);
+ int LinesTotal() const;
+
+ void SetDefaultCharClasses(bool includeWordClass);
+ void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass);
+ int GetCharsOfClass(CharClassify::cc characterClass, unsigned char *buffer);
+ void SCI_METHOD StartStyling(int position, char mask);
+ bool SCI_METHOD SetStyleFor(int length, char style);
+ bool SCI_METHOD SetStyles(int length, const char *styles);
+ int GetEndStyled() const { return endStyled; }
+ void EnsureStyledTo(int pos);
+ void LexerChanged();
+ int GetStyleClock() const { return styleClock; }
+ void IncrementStyleClock();
+ void SCI_METHOD DecorationSetCurrentIndicator(int indicator) {
+ decorations.SetCurrentIndicator(indicator);
+ }
+ void SCI_METHOD DecorationFillRange(int position, int value, int fillLength);
+
+ int SCI_METHOD SetLineState(int line, int state);
+ int SCI_METHOD GetLineState(int line) const;
+ int GetMaxLineState();
+ void SCI_METHOD ChangeLexerState(int start, int end);
+
+ StyledText MarginStyledText(int line) const;
+ void MarginSetStyle(int line, int style);
+ void MarginSetStyles(int line, const unsigned char *styles);
+ void MarginSetText(int line, const char *text);
+ void MarginClearAll();
+
+ StyledText AnnotationStyledText(int line) const;
+ void AnnotationSetText(int line, const char *text);
+ void AnnotationSetStyle(int line, int style);
+ void AnnotationSetStyles(int line, const unsigned char *styles);
+ int AnnotationLines(int line) const;
+ void AnnotationClearAll();
+
+ bool AddWatcher(DocWatcher *watcher, void *userData);
+ bool RemoveWatcher(DocWatcher *watcher, void *userData);
+
+ CharClassify::cc WordCharClass(unsigned char ch) const;
+ bool IsWordPartSeparator(char ch) const;
+ int WordPartLeft(int pos);
+ int WordPartRight(int pos);
+ int ExtendStyleRange(int pos, int delta, bool singleLine = false);
+ bool IsWhiteLine(int line) const;
+ int ParaUp(int pos) const;
+ int ParaDown(int pos) const;
+ int IndentSize() const { return actualIndentInChars; }
+ int BraceMatch(int position, int maxReStyle);
+
+private:
+ bool IsWordStartAt(int pos) const;
+ bool IsWordEndAt(int pos) const;
+ bool IsWordAt(int start, int end) const;
+
+ void NotifyModifyAttempt();
+ void NotifySavePoint(bool atSavePoint);
+ void NotifyModified(DocModification mh);
+};
+
+class UndoGroup {
+ Document *pdoc;
+ bool groupNeeded;
+public:
+ UndoGroup(Document *pdoc_, bool groupNeeded_=true) :
+ pdoc(pdoc_), groupNeeded(groupNeeded_) {
+ if (groupNeeded) {
+ pdoc->BeginUndoAction();
+ }
+ }
+ ~UndoGroup() {
+ if (groupNeeded) {
+ pdoc->EndUndoAction();
+ }
+ }
+ bool Needed() const {
+ return groupNeeded;
+ }
+};
+
+
+/**
+ * To optimise processing of document modifications by DocWatchers, a hint is passed indicating the
+ * scope of the change.
+ * If the DocWatcher is a document view then this can be used to optimise screen updating.
+ */
+class DocModification {
+public:
+ int modificationType;
+ int position;
+ int length;
+ int linesAdded; /**< Negative if lines deleted. */
+ const char *text; /**< Only valid for changes to text, not for changes to style. */
+ int line;
+ int foldLevelNow;
+ int foldLevelPrev;
+ int annotationLinesAdded;
+ int token;
+
+ DocModification(int modificationType_, int position_=0, int length_=0,
+ int linesAdded_=0, const char *text_=0, int line_=0) :
+ modificationType(modificationType_),
+ position(position_),
+ length(length_),
+ linesAdded(linesAdded_),
+ text(text_),
+ line(line_),
+ foldLevelNow(0),
+ foldLevelPrev(0),
+ annotationLinesAdded(0),
+ token(0) {}
+
+ DocModification(int modificationType_, const Action &act, int linesAdded_=0) :
+ modificationType(modificationType_),
+ position(act.position),
+ length(act.lenData),
+ linesAdded(linesAdded_),
+ text(act.data),
+ line(0),
+ foldLevelNow(0),
+ foldLevelPrev(0),
+ annotationLinesAdded(0),
+ token(0) {}
+};
+
+/**
+ * A class that wants to receive notifications from a Document must be derived from DocWatcher
+ * and implement the notification methods. It can then be added to the watcher list with AddWatcher.
+ */
+class DocWatcher {
+public:
+ virtual ~DocWatcher() {}
+
+ virtual void NotifyModifyAttempt(Document *doc, void *userData) = 0;
+ virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0;
+ virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0;
+ virtual void NotifyDeleted(Document *doc, void *userData) = 0;
+ virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0;
+ virtual void NotifyLexerChanged(Document *doc, void *userData) = 0;
+ virtual void NotifyErrorOccurred(Document *doc, void *userData, int status) = 0;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.cxx
new file mode 100644
index 00000000000..b50ade258fb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.cxx
@@ -0,0 +1,77 @@
+// Scintilla source code edit control
+/** @file EditModel.cxx
+ ** Defines the editor state that must be visible to EditorView.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+#include <memory>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+Caret::Caret() :
+ active(false), on(false), period(500) {}
+
+EditModel::EditModel() {
+ inOverstrike = false;
+ xOffset = 0;
+ trackLineWidth = false;
+ posDrag = SelectionPosition(invalidPosition);
+ braces[0] = invalidPosition;
+ braces[1] = invalidPosition;
+ bracesMatchStyle = STYLE_BRACEBAD;
+ highlightGuideColumn = 0;
+ primarySelection = true;
+ imeInteraction = imeWindowed;
+ foldFlags = 0;
+ hotspot = Range(invalidPosition);
+ hoverIndicatorPos = invalidPosition;
+ wrapWidth = LineLayout::wrapWidthInfinite;
+ pdoc = new Document();
+ pdoc->AddRef();
+}
+
+EditModel::~EditModel() {
+ pdoc->Release();
+ pdoc = 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.h b/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.h
new file mode 100644
index 00000000000..33c1ac0df41
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/EditModel.h
@@ -0,0 +1,70 @@
+// Scintilla source code edit control
+/** @file EditModel.h
+ ** Defines the editor state that must be visible to EditorView.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef EDITMODEL_H
+#define EDITMODEL_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+*/
+class Caret {
+public:
+ bool active;
+ bool on;
+ int period;
+
+ Caret();
+};
+
+class EditModel {
+ // Private so EditModel objects can not be copied
+ explicit EditModel(const EditModel &);
+ EditModel &operator=(const EditModel &);
+
+public:
+ bool inOverstrike;
+ int xOffset; ///< Horizontal scrolled amount in pixels
+ bool trackLineWidth;
+
+ SpecialRepresentations reprs;
+ Caret caret;
+ SelectionPosition posDrag;
+ Position braces[2];
+ int bracesMatchStyle;
+ int highlightGuideColumn;
+ Selection sel;
+ bool primarySelection;
+
+ enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
+
+ int foldFlags;
+ ContractionState cs;
+ // Hotspot support
+ Range hotspot;
+ int hoverIndicatorPos;
+
+ // Wrapping support
+ int wrapWidth;
+
+ Document *pdoc;
+
+ EditModel();
+ virtual ~EditModel();
+ virtual int TopLineOfMain() const = 0;
+ virtual Point GetVisibleOriginInMain() const = 0;
+ virtual int LinesOnScreen() const = 0;
+ virtual Range GetHotSpotRange() const = 0;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/EditView.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/EditView.cxx
new file mode 100644
index 00000000000..5372e3abd42
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/EditView.cxx
@@ -0,0 +1,2117 @@
+// Scintilla source code edit control
+/** @file Editor.cxx
+ ** Defines the appearance of the main text area of the editor window.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+#include <memory>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "PerLine.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsControlCharacter(int ch) {
+ // iscntrl returns true for lots of chars > 127 which are displayable
+ return ch >= 0 && ch < ' ';
+}
+
+PrintParameters::PrintParameters() {
+ magnification = 0;
+ colourMode = SC_PRINT_NORMAL;
+ wrapState = eWrapWord;
+}
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+bool ValidStyledText(const ViewStyle &vs, size_t styleOffset, const StyledText &st) {
+ if (st.multipleStyles) {
+ for (size_t iStyle = 0; iStyle<st.length; iStyle++) {
+ if (!vs.ValidStyle(styleOffset + st.styles[iStyle]))
+ return false;
+ }
+ } else {
+ if (!vs.ValidStyle(styleOffset + st.style))
+ return false;
+ }
+ return true;
+}
+
+static int WidthStyledText(Surface *surface, const ViewStyle &vs, int styleOffset,
+ const char *text, const unsigned char *styles, size_t len) {
+ int width = 0;
+ size_t start = 0;
+ while (start < len) {
+ size_t style = styles[start];
+ size_t endSegment = start;
+ while ((endSegment + 1 < len) && (static_cast<size_t>(styles[endSegment + 1]) == style))
+ endSegment++;
+ FontAlias fontText = vs.styles[style + styleOffset].font;
+ width += static_cast<int>(surface->WidthText(fontText, text + start,
+ static_cast<int>(endSegment - start + 1)));
+ start = endSegment + 1;
+ }
+ return width;
+}
+
+int WidestLineWidth(Surface *surface, const ViewStyle &vs, int styleOffset, const StyledText &st) {
+ int widthMax = 0;
+ size_t start = 0;
+ while (start < st.length) {
+ size_t lenLine = st.LineLength(start);
+ int widthSubLine;
+ if (st.multipleStyles) {
+ widthSubLine = WidthStyledText(surface, vs, styleOffset, st.text + start, st.styles + start, lenLine);
+ } else {
+ FontAlias fontText = vs.styles[styleOffset + st.style].font;
+ widthSubLine = static_cast<int>(surface->WidthText(fontText,
+ st.text + start, static_cast<int>(lenLine)));
+ }
+ if (widthSubLine > widthMax)
+ widthMax = widthSubLine;
+ start += lenLine + 1;
+ }
+ return widthMax;
+}
+
+void DrawTextNoClipPhase(Surface *surface, PRectangle rc, const Style &style, XYPOSITION ybase,
+ const char *s, int len, DrawPhase phase) {
+ FontAlias fontText = style.font;
+ if (phase & drawBack) {
+ if (phase & drawText) {
+ // Drawing both
+ surface->DrawTextNoClip(rc, fontText, ybase, s, len,
+ style.fore, style.back);
+ } else {
+ surface->FillRectangle(rc, style.back);
+ }
+ } else if (phase & drawText) {
+ surface->DrawTextTransparent(rc, fontText, ybase, s, len, style.fore);
+ }
+}
+
+void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText,
+ const StyledText &st, size_t start, size_t length, DrawPhase phase) {
+
+ if (st.multipleStyles) {
+ int x = static_cast<int>(rcText.left);
+ size_t i = 0;
+ while (i < length) {
+ size_t end = i;
+ size_t style = st.styles[i + start];
+ while (end < length - 1 && st.styles[start + end + 1] == style)
+ end++;
+ style += styleOffset;
+ FontAlias fontText = vs.styles[style].font;
+ const int width = static_cast<int>(surface->WidthText(fontText,
+ st.text + start + i, static_cast<int>(end - i + 1)));
+ PRectangle rcSegment = rcText;
+ rcSegment.left = static_cast<XYPOSITION>(x);
+ rcSegment.right = static_cast<XYPOSITION>(x + width + 1);
+ DrawTextNoClipPhase(surface, rcSegment, vs.styles[style],
+ rcText.top + vs.maxAscent, st.text + start + i,
+ static_cast<int>(end - i + 1), phase);
+ x += width;
+ i = end + 1;
+ }
+ } else {
+ const size_t style = st.style + styleOffset;
+ DrawTextNoClipPhase(surface, rcText, vs.styles[style],
+ rcText.top + vs.maxAscent, st.text + start,
+ static_cast<int>(length), phase);
+ }
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+const XYPOSITION epsilon = 0.0001f; // A small nudge to avoid floating point precision issues
+
+EditView::EditView() {
+ ldTabstops = NULL;
+ tabWidthMinimumPixels = 2; // needed for calculating tab stops for fractional proportional fonts
+ hideSelection = false;
+ drawOverstrikeCaret = true;
+ bufferedDraw = true;
+ phasesDraw = phasesTwo;
+ lineWidthMaxSeen = 0;
+ additionalCaretsBlink = true;
+ additionalCaretsVisible = true;
+ imeCaretBlockOverride = false;
+ pixmapLine = 0;
+ pixmapIndentGuide = 0;
+ pixmapIndentGuideHighlight = 0;
+ llc.SetLevel(LineLayoutCache::llcCaret);
+ posCache.SetSize(0x400);
+ tabArrowHeight = 4;
+ customDrawTabArrow = NULL;
+ customDrawWrapMarker = NULL;
+}
+
+EditView::~EditView() {
+ delete ldTabstops;
+ ldTabstops = NULL;
+}
+
+bool EditView::SetTwoPhaseDraw(bool twoPhaseDraw) {
+ const PhasesDraw phasesDrawNew = twoPhaseDraw ? phasesTwo : phasesOne;
+ const bool redraw = phasesDraw != phasesDrawNew;
+ phasesDraw = phasesDrawNew;
+ return redraw;
+}
+
+bool EditView::SetPhasesDraw(int phases) {
+ const PhasesDraw phasesDrawNew = static_cast<PhasesDraw>(phases);
+ const bool redraw = phasesDraw != phasesDrawNew;
+ phasesDraw = phasesDrawNew;
+ return redraw;
+}
+
+bool EditView::LinesOverlap() const {
+ return phasesDraw == phasesMultiple;
+}
+
+void EditView::ClearAllTabstops() {
+ delete ldTabstops;
+ ldTabstops = 0;
+}
+
+XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const {
+ int next = GetNextTabstop(line, static_cast<int>(x + tabWidthMinimumPixels));
+ if (next > 0)
+ return static_cast<XYPOSITION>(next);
+ return (static_cast<int>((x + tabWidthMinimumPixels) / tabWidth) + 1) * tabWidth;
+}
+
+bool EditView::ClearTabstops(int line) {
+ LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops);
+ return lt && lt->ClearTabstops(line);
+}
+
+bool EditView::AddTabstop(int line, int x) {
+ if (!ldTabstops) {
+ ldTabstops = new LineTabstops();
+ }
+ LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops);
+ return lt && lt->AddTabstop(line, x);
+}
+
+int EditView::GetNextTabstop(int line, int x) const {
+ LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops);
+ if (lt) {
+ return lt->GetNextTabstop(line, x);
+ } else {
+ return 0;
+ }
+}
+
+void EditView::LinesAddedOrRemoved(int lineOfPos, int linesAdded) {
+ if (ldTabstops) {
+ if (linesAdded > 0) {
+ for (int line = lineOfPos; line < lineOfPos + linesAdded; line++) {
+ ldTabstops->InsertLine(line);
+ }
+ } else {
+ for (int line = (lineOfPos + -linesAdded) - 1; line >= lineOfPos; line--) {
+ ldTabstops->RemoveLine(line);
+ }
+ }
+ }
+}
+
+void EditView::DropGraphics(bool freeObjects) {
+ if (freeObjects) {
+ delete pixmapLine;
+ pixmapLine = 0;
+ delete pixmapIndentGuide;
+ pixmapIndentGuide = 0;
+ delete pixmapIndentGuideHighlight;
+ pixmapIndentGuideHighlight = 0;
+ } else {
+ if (pixmapLine)
+ pixmapLine->Release();
+ if (pixmapIndentGuide)
+ pixmapIndentGuide->Release();
+ if (pixmapIndentGuideHighlight)
+ pixmapIndentGuideHighlight->Release();
+ }
+}
+
+void EditView::AllocateGraphics(const ViewStyle &vsDraw) {
+ if (!pixmapLine)
+ pixmapLine = Surface::Allocate(vsDraw.technology);
+ if (!pixmapIndentGuide)
+ pixmapIndentGuide = Surface::Allocate(vsDraw.technology);
+ if (!pixmapIndentGuideHighlight)
+ pixmapIndentGuideHighlight = Surface::Allocate(vsDraw.technology);
+}
+
+const char *ControlCharacterString(unsigned char ch) {
+ const char *reps[] = {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
+ };
+ if (ch < ELEMENTS(reps)) {
+ return reps[ch];
+ } else {
+ return "BAD";
+ }
+}
+
+void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid) {
+ int ydiff = static_cast<int>(rcTab.bottom - rcTab.top) / 2;
+ int xhead = static_cast<int>(rcTab.right) - 1 - ydiff;
+ if (xhead <= rcTab.left) {
+ ydiff -= static_cast<int>(rcTab.left) - xhead - 1;
+ xhead = static_cast<int>(rcTab.left) - 1;
+ }
+ if ((rcTab.left + 2) < (rcTab.right - 1))
+ surface->MoveTo(static_cast<int>(rcTab.left) + 2, ymid);
+ else
+ surface->MoveTo(static_cast<int>(rcTab.right) - 1, ymid);
+ surface->LineTo(static_cast<int>(rcTab.right) - 1, ymid);
+ surface->LineTo(xhead, ymid - ydiff);
+ surface->MoveTo(static_cast<int>(rcTab.right) - 1, ymid);
+ surface->LineTo(xhead, ymid + ydiff);
+}
+
+void EditView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw) {
+ if (!pixmapIndentGuide->Initialised()) {
+ // 1 extra pixel in height so can handle odd/even positions and so produce a continuous line
+ pixmapIndentGuide->InitPixMap(1, vsDraw.lineHeight + 1, surfaceWindow, wid);
+ pixmapIndentGuideHighlight->InitPixMap(1, vsDraw.lineHeight + 1, surfaceWindow, wid);
+ PRectangle rcIG = PRectangle::FromInts(0, 0, 1, vsDraw.lineHeight);
+ pixmapIndentGuide->FillRectangle(rcIG, vsDraw.styles[STYLE_INDENTGUIDE].back);
+ pixmapIndentGuide->PenColour(vsDraw.styles[STYLE_INDENTGUIDE].fore);
+ pixmapIndentGuideHighlight->FillRectangle(rcIG, vsDraw.styles[STYLE_BRACELIGHT].back);
+ pixmapIndentGuideHighlight->PenColour(vsDraw.styles[STYLE_BRACELIGHT].fore);
+ for (int stripe = 1; stripe < vsDraw.lineHeight + 1; stripe += 2) {
+ PRectangle rcPixel = PRectangle::FromInts(0, stripe, 1, stripe + 1);
+ pixmapIndentGuide->FillRectangle(rcPixel, vsDraw.styles[STYLE_INDENTGUIDE].fore);
+ pixmapIndentGuideHighlight->FillRectangle(rcPixel, vsDraw.styles[STYLE_BRACELIGHT].fore);
+ }
+ }
+}
+
+LineLayout *EditView::RetrieveLineLayout(int lineNumber, const EditModel &model) {
+ int posLineStart = model.pdoc->LineStart(lineNumber);
+ int posLineEnd = model.pdoc->LineStart(lineNumber + 1);
+ PLATFORM_ASSERT(posLineEnd >= posLineStart);
+ int lineCaret = model.pdoc->LineFromPosition(model.sel.MainCaret());
+ return llc.Retrieve(lineNumber, lineCaret,
+ posLineEnd - posLineStart, model.pdoc->GetStyleClock(),
+ model.LinesOnScreen() + 1, model.pdoc->LinesTotal());
+}
+
+/**
+* Fill in the LineLayout data for the given line.
+* Copy the given @a line and its styles from the document into local arrays.
+* Also determine the x position at which each character starts.
+*/
+void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, const ViewStyle &vstyle, LineLayout *ll, int width) {
+ if (!ll)
+ return;
+
+ PLATFORM_ASSERT(line < model.pdoc->LinesTotal());
+ PLATFORM_ASSERT(ll->chars != NULL);
+ int posLineStart = model.pdoc->LineStart(line);
+ int posLineEnd = model.pdoc->LineStart(line + 1);
+ // If the line is very long, limit the treatment to a length that should fit in the viewport
+ if (posLineEnd >(posLineStart + ll->maxLineLength)) {
+ posLineEnd = posLineStart + ll->maxLineLength;
+ }
+ if (ll->validity == LineLayout::llCheckTextAndStyle) {
+ int lineLength = posLineEnd - posLineStart;
+ if (!vstyle.viewEOL) {
+ lineLength = model.pdoc->LineEnd(line) - posLineStart;
+ }
+ if (lineLength == ll->numCharsInLine) {
+ // See if chars, styles, indicators, are all the same
+ bool allSame = true;
+ // Check base line layout
+ char styleByte = 0;
+ int numCharsInLine = 0;
+ while (numCharsInLine < lineLength) {
+ int charInDoc = numCharsInLine + posLineStart;
+ char chDoc = model.pdoc->CharAt(charInDoc);
+ styleByte = model.pdoc->StyleAt(charInDoc);
+ allSame = allSame &&
+ (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte));
+ if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed)
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == chDoc);
+ else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower)
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc)));
+ else // Style::caseUpper
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
+ numCharsInLine++;
+ }
+ allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled
+ if (allSame) {
+ ll->validity = LineLayout::llPositions;
+ } else {
+ ll->validity = LineLayout::llInvalid;
+ }
+ } else {
+ ll->validity = LineLayout::llInvalid;
+ }
+ }
+ if (ll->validity == LineLayout::llInvalid) {
+ ll->widthLine = LineLayout::wrapWidthInfinite;
+ ll->lines = 1;
+ if (vstyle.edgeState == EDGE_BACKGROUND) {
+ ll->edgeColumn = model.pdoc->FindColumn(line, vstyle.theEdge);
+ if (ll->edgeColumn >= posLineStart) {
+ ll->edgeColumn -= posLineStart;
+ }
+ } else {
+ ll->edgeColumn = -1;
+ }
+
+ // Fill base line layout
+ const int lineLength = posLineEnd - posLineStart;
+ model.pdoc->GetCharRange(ll->chars, posLineStart, lineLength);
+ model.pdoc->GetStyleRange(ll->styles, posLineStart, lineLength);
+ int numCharsBeforeEOL = model.pdoc->LineEnd(line) - posLineStart;
+ const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL;
+ for (int styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) {
+ const unsigned char styleByte = ll->styles[styleInLine];
+ ll->styles[styleInLine] = styleByte;
+ }
+ const unsigned char styleByteLast = (lineLength > 0) ? ll->styles[lineLength - 1] : 0;
+ if (vstyle.someStylesForceCase) {
+ for (int charInLine = 0; charInLine<lineLength; charInLine++) {
+ char chDoc = ll->chars[charInLine];
+ if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseUpper)
+ ll->chars[charInLine] = static_cast<char>(toupper(chDoc));
+ else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower)
+ ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
+ }
+ }
+ ll->xHighlightGuide = 0;
+ // Extra element at the end of the line to hold end x position and act as
+ ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character
+ ll->styles[numCharsInLine] = styleByteLast; // For eolFilled
+
+ // Layout the line, determining the position of each character,
+ // with an extra element at the end for the end of the line.
+ ll->positions[0] = 0;
+ bool lastSegItalics = false;
+
+ BreakFinder bfLayout(ll, NULL, Range(0, numCharsInLine), posLineStart, 0, false, model.pdoc, &model.reprs, NULL);
+ while (bfLayout.More()) {
+
+ const TextSegment ts = bfLayout.Next();
+
+ std::fill(&ll->positions[ts.start + 1], &ll->positions[ts.end() + 1], 0.0f);
+ if (vstyle.styles[ll->styles[ts.start]].visible) {
+ if (ts.representation) {
+ XYPOSITION representationWidth = vstyle.controlCharWidth;
+ if (ll->chars[ts.start] == '\t') {
+ // Tab is a special case of representation, taking a variable amount of space
+ const XYPOSITION x = ll->positions[ts.start];
+ representationWidth = NextTabstopPos(line, x, vstyle.tabWidth) - ll->positions[ts.start];
+ } else {
+ if (representationWidth <= 0.0) {
+ XYPOSITION positionsRepr[256]; // Should expand when needed
+ posCache.MeasureWidths(surface, vstyle, STYLE_CONTROLCHAR, ts.representation->stringRep.c_str(),
+ static_cast<unsigned int>(ts.representation->stringRep.length()), positionsRepr, model.pdoc);
+ representationWidth = positionsRepr[ts.representation->stringRep.length() - 1] + vstyle.ctrlCharPadding;
+ }
+ }
+ for (int ii = 0; ii < ts.length; ii++)
+ ll->positions[ts.start + 1 + ii] = representationWidth;
+ } else {
+ if ((ts.length == 1) && (' ' == ll->chars[ts.start])) {
+ // Over half the segments are single characters and of these about half are space characters.
+ ll->positions[ts.start + 1] = vstyle.styles[ll->styles[ts.start]].spaceWidth;
+ } else {
+ posCache.MeasureWidths(surface, vstyle, ll->styles[ts.start], ll->chars + ts.start,
+ ts.length, ll->positions + ts.start + 1, model.pdoc);
+ }
+ }
+ lastSegItalics = (!ts.representation) && ((ll->chars[ts.end() - 1] != ' ') && vstyle.styles[ll->styles[ts.start]].italic);
+ }
+
+ for (int posToIncrease = ts.start + 1; posToIncrease <= ts.end(); posToIncrease++) {
+ ll->positions[posToIncrease] += ll->positions[ts.start];
+ }
+ }
+
+ // Small hack to make lines that end with italics not cut off the edge of the last character
+ if (lastSegItalics) {
+ ll->positions[numCharsInLine] += vstyle.lastSegItalicsOffset;
+ }
+ ll->numCharsInLine = numCharsInLine;
+ ll->numCharsBeforeEOL = numCharsBeforeEOL;
+ ll->validity = LineLayout::llPositions;
+ }
+ // Hard to cope when too narrow, so just assume there is space
+ if (width < 20) {
+ width = 20;
+ }
+ if ((ll->validity == LineLayout::llPositions) || (ll->widthLine != width)) {
+ ll->widthLine = width;
+ if (width == LineLayout::wrapWidthInfinite) {
+ ll->lines = 1;
+ } else if (width > ll->positions[ll->numCharsInLine]) {
+ // Simple common case where line does not need wrapping.
+ ll->lines = 1;
+ } else {
+ if (vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ width -= static_cast<int>(vstyle.aveCharWidth); // take into account the space for end wrap mark
+ }
+ XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line
+ if (vstyle.wrapIndentMode == SC_WRAPINDENT_INDENT) {
+ wrapAddIndent = model.pdoc->IndentSize() * vstyle.spaceWidth;
+ } else if (vstyle.wrapIndentMode == SC_WRAPINDENT_FIXED) {
+ wrapAddIndent = vstyle.wrapVisualStartIndent * vstyle.aveCharWidth;
+ }
+ ll->wrapIndent = wrapAddIndent;
+ if (vstyle.wrapIndentMode != SC_WRAPINDENT_FIXED)
+ for (int i = 0; i < ll->numCharsInLine; i++) {
+ if (!IsSpaceOrTab(ll->chars[i])) {
+ ll->wrapIndent += ll->positions[i]; // Add line indent
+ break;
+ }
+ }
+ // Check for text width minimum
+ if (ll->wrapIndent > width - static_cast<int>(vstyle.aveCharWidth) * 15)
+ ll->wrapIndent = wrapAddIndent;
+ // Check for wrapIndent minimum
+ if ((vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (ll->wrapIndent < vstyle.aveCharWidth))
+ ll->wrapIndent = vstyle.aveCharWidth; // Indent to show start visual
+ ll->lines = 0;
+ // Calculate line start positions based upon width.
+ int lastGoodBreak = 0;
+ int lastLineStart = 0;
+ XYACCUMULATOR startOffset = 0;
+ int p = 0;
+ while (p < ll->numCharsInLine) {
+ if ((ll->positions[p + 1] - startOffset) >= width) {
+ if (lastGoodBreak == lastLineStart) {
+ // Try moving to start of last character
+ if (p > 0) {
+ lastGoodBreak = model.pdoc->MovePositionOutsideChar(p + posLineStart, -1)
+ - posLineStart;
+ }
+ if (lastGoodBreak == lastLineStart) {
+ // Ensure at least one character on line.
+ lastGoodBreak = model.pdoc->MovePositionOutsideChar(lastGoodBreak + posLineStart + 1, 1)
+ - posLineStart;
+ }
+ }
+ lastLineStart = lastGoodBreak;
+ ll->lines++;
+ ll->SetLineStart(ll->lines, lastGoodBreak);
+ startOffset = ll->positions[lastGoodBreak];
+ // take into account the space for start wrap mark and indent
+ startOffset -= ll->wrapIndent;
+ p = lastGoodBreak + 1;
+ continue;
+ }
+ if (p > 0) {
+ if (vstyle.wrapState == eWrapChar) {
+ lastGoodBreak = model.pdoc->MovePositionOutsideChar(p + posLineStart, -1)
+ - posLineStart;
+ p = model.pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
+ continue;
+ } else if ((vstyle.wrapState == eWrapWord) && (ll->styles[p] != ll->styles[p - 1])) {
+ lastGoodBreak = p;
+ } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) {
+ lastGoodBreak = p;
+ }
+ }
+ p++;
+ }
+ ll->lines++;
+ }
+ ll->validity = LineLayout::llLines;
+ }
+}
+
+Point EditView::LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, int topLine, const ViewStyle &vs) {
+ Point pt;
+ if (pos.Position() == INVALID_POSITION)
+ return pt;
+ const int line = model.pdoc->LineFromPosition(pos.Position());
+ const int lineVisible = model.cs.DisplayFromDoc(line);
+ //Platform::DebugPrintf("line=%d\n", line);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line, model));
+ if (surface && ll) {
+ const int posLineStart = model.pdoc->LineStart(line);
+ LayoutLine(model, line, surface, vs, ll, model.wrapWidth);
+ const int posInLine = pos.Position() - posLineStart;
+ pt = ll->PointFromPosition(posInLine, vs.lineHeight);
+ pt.y += (lineVisible - topLine) * vs.lineHeight;
+ pt.x += vs.textStart - model.xOffset;
+ }
+ pt.x += pos.VirtualSpace() * vs.styles[ll->EndLineStyle()].spaceWidth;
+ return pt;
+}
+
+SelectionPosition EditView::SPositionFromLocation(Surface *surface, const EditModel &model, Point pt, bool canReturnInvalid, bool charPosition, bool virtualSpace, const ViewStyle &vs) {
+ pt.x = pt.x - vs.textStart;
+ int visibleLine = static_cast<int>(floor(pt.y / vs.lineHeight));
+ if (!canReturnInvalid && (visibleLine < 0))
+ visibleLine = 0;
+ const int lineDoc = model.cs.DocFromDisplay(visibleLine);
+ if (canReturnInvalid && (lineDoc < 0))
+ return SelectionPosition(INVALID_POSITION);
+ if (lineDoc >= model.pdoc->LinesTotal())
+ return SelectionPosition(canReturnInvalid ? INVALID_POSITION : model.pdoc->Length());
+ const int posLineStart = model.pdoc->LineStart(lineDoc);
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model));
+ if (surface && ll) {
+ LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth);
+ const int lineStartSet = model.cs.DisplayFromDoc(lineDoc);
+ const int subLine = visibleLine - lineStartSet;
+ if (subLine < ll->lines) {
+ const Range rangeSubLine = ll->SubLineRange(subLine);
+ const XYPOSITION subLineStart = ll->positions[rangeSubLine.start];
+ if (subLine > 0) // Wrapped
+ pt.x -= ll->wrapIndent;
+ const int positionInLine = ll->FindPositionFromX(pt.x + subLineStart, rangeSubLine, charPosition);
+ if (positionInLine < rangeSubLine.end) {
+ return SelectionPosition(model.pdoc->MovePositionOutsideChar(positionInLine + posLineStart, 1));
+ }
+ if (virtualSpace) {
+ const XYPOSITION spaceWidth = vs.styles[ll->EndLineStyle()].spaceWidth;
+ const int spaceOffset = static_cast<int>(
+ (pt.x + subLineStart - ll->positions[rangeSubLine.end] + spaceWidth / 2) / spaceWidth);
+ return SelectionPosition(rangeSubLine.end + posLineStart, spaceOffset);
+ } else if (canReturnInvalid) {
+ if (pt.x < (ll->positions[rangeSubLine.end] - subLineStart)) {
+ return SelectionPosition(model.pdoc->MovePositionOutsideChar(rangeSubLine.end + posLineStart, 1));
+ }
+ } else {
+ return SelectionPosition(rangeSubLine.end + posLineStart);
+ }
+ }
+ if (!canReturnInvalid)
+ return SelectionPosition(ll->numCharsInLine + posLineStart);
+ }
+ return SelectionPosition(canReturnInvalid ? INVALID_POSITION : posLineStart);
+}
+
+/**
+* Find the document position corresponding to an x coordinate on a particular document line.
+* Ensure is between whole characters when document is in multi-byte or UTF-8 mode.
+* This method is used for rectangular selections and does not work on wrapped lines.
+*/
+SelectionPosition EditView::SPositionFromLineX(Surface *surface, const EditModel &model, int lineDoc, int x, const ViewStyle &vs) {
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model));
+ if (surface && ll) {
+ const int posLineStart = model.pdoc->LineStart(lineDoc);
+ LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth);
+ const Range rangeSubLine = ll->SubLineRange(0);
+ const XYPOSITION subLineStart = ll->positions[rangeSubLine.start];
+ const int positionInLine = ll->FindPositionFromX(x + subLineStart, rangeSubLine, false);
+ if (positionInLine < rangeSubLine.end) {
+ return SelectionPosition(model.pdoc->MovePositionOutsideChar(positionInLine + posLineStart, 1));
+ }
+ const XYPOSITION spaceWidth = vs.styles[ll->EndLineStyle()].spaceWidth;
+ const int spaceOffset = static_cast<int>(
+ (x + subLineStart - ll->positions[rangeSubLine.end] + spaceWidth / 2) / spaceWidth);
+ return SelectionPosition(rangeSubLine.end + posLineStart, spaceOffset);
+ }
+ return SelectionPosition(0);
+}
+
+int EditView::DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs) {
+ int lineDoc = model.pdoc->LineFromPosition(pos);
+ int lineDisplay = model.cs.DisplayFromDoc(lineDoc);
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model));
+ if (surface && ll) {
+ LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth);
+ unsigned int posLineStart = model.pdoc->LineStart(lineDoc);
+ int posInLine = pos - posLineStart;
+ lineDisplay--; // To make up for first increment ahead.
+ for (int subLine = 0; subLine < ll->lines; subLine++) {
+ if (posInLine >= ll->LineStart(subLine)) {
+ lineDisplay++;
+ }
+ }
+ }
+ return lineDisplay;
+}
+
+int EditView::StartEndDisplayLine(Surface *surface, const EditModel &model, int pos, bool start, const ViewStyle &vs) {
+ int line = model.pdoc->LineFromPosition(pos);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line, model));
+ int posRet = INVALID_POSITION;
+ if (surface && ll) {
+ unsigned int posLineStart = model.pdoc->LineStart(line);
+ LayoutLine(model, line, surface, vs, ll, model.wrapWidth);
+ int posInLine = pos - posLineStart;
+ if (posInLine <= ll->maxLineLength) {
+ for (int subLine = 0; subLine < ll->lines; subLine++) {
+ if ((posInLine >= ll->LineStart(subLine)) && (posInLine <= ll->LineStart(subLine + 1))) {
+ if (start) {
+ posRet = ll->LineStart(subLine) + posLineStart;
+ } else {
+ if (subLine == ll->lines - 1)
+ posRet = ll->LineStart(subLine + 1) + posLineStart;
+ else
+ posRet = ll->LineStart(subLine + 1) + posLineStart - 1;
+ }
+ }
+ }
+ }
+ }
+ return posRet;
+}
+
+static ColourDesired SelectionBackground(const ViewStyle &vsDraw, bool main, bool primarySelection) {
+ return main ?
+ (primarySelection ? vsDraw.selColours.back : vsDraw.selBackground2) :
+ vsDraw.selAdditionalBackground;
+}
+
+static ColourDesired TextBackground(const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ ColourOptional background, int inSelection, bool inHotspot, int styleMain, int i) {
+ if (inSelection == 1) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
+ return SelectionBackground(vsDraw, true, model.primarySelection);
+ }
+ } else if (inSelection == 2) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA)) {
+ return SelectionBackground(vsDraw, false, model.primarySelection);
+ }
+ } else {
+ if ((vsDraw.edgeState == EDGE_BACKGROUND) &&
+ (i >= ll->edgeColumn) &&
+ (i < ll->numCharsBeforeEOL))
+ return vsDraw.edgecolour;
+ if (inHotspot && vsDraw.hotspotColours.back.isSet)
+ return vsDraw.hotspotColours.back;
+ }
+ if (background.isSet && (styleMain != STYLE_BRACELIGHT) && (styleMain != STYLE_BRACEBAD)) {
+ return background;
+ } else {
+ return vsDraw.styles[styleMain].back;
+ }
+}
+
+void EditView::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight) {
+ Point from = Point::FromInts(0, ((lineVisible & 1) && (lineHeight & 1)) ? 1 : 0);
+ PRectangle rcCopyArea = PRectangle::FromInts(start + 1, static_cast<int>(rcSegment.top), start + 2, static_cast<int>(rcSegment.bottom));
+ surface->Copy(rcCopyArea, from,
+ highlight ? *pixmapIndentGuideHighlight : *pixmapIndentGuide);
+}
+
+static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourDesired fill, int alpha) {
+ if (alpha != SC_ALPHA_NOALPHA) {
+ surface->AlphaRectangle(rc, 0, fill, alpha, fill, alpha, 0);
+ }
+}
+
+static void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle rcSegment,
+ const char *s, ColourDesired textBack, ColourDesired textFore, bool fillBackground) {
+ if (fillBackground) {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
+ int normalCharHeight = static_cast<int>(surface->Ascent(ctrlCharsFont) -
+ surface->InternalLeading(ctrlCharsFont));
+ PRectangle rcCChar = rcSegment;
+ rcCChar.left = rcCChar.left + 1;
+ rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight;
+ rcCChar.bottom = rcSegment.top + vsDraw.maxAscent + 1;
+ PRectangle rcCentral = rcCChar;
+ rcCentral.top++;
+ rcCentral.bottom--;
+ surface->FillRectangle(rcCentral, textFore);
+ PRectangle rcChar = rcCChar;
+ rcChar.left++;
+ rcChar.right--;
+ surface->DrawTextClipped(rcChar, ctrlCharsFont,
+ rcSegment.top + vsDraw.maxAscent, s, static_cast<int>(s ? strlen(s) : 0),
+ textBack, textFore);
+}
+
+void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ PRectangle rcLine, int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart,
+ ColourOptional background) {
+
+ const int posLineStart = model.pdoc->LineStart(line);
+ PRectangle rcSegment = rcLine;
+
+ const bool lastSubLine = subLine == (ll->lines - 1);
+ XYPOSITION virtualSpace = 0;
+ if (lastSubLine) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ virtualSpace = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)) * spaceWidth;
+ }
+ XYPOSITION xEol = static_cast<XYPOSITION>(ll->positions[lineEnd] - subLineStart);
+
+ // Fill the virtual space and show selections within it
+ if (virtualSpace > 0.0f) {
+ rcSegment.left = xEol + xStart;
+ rcSegment.right = xEol + xStart + virtualSpace;
+ surface->FillRectangle(rcSegment, background.isSet ? background : vsDraw.styles[ll->styles[ll->numCharsInLine]].back);
+ if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) {
+ SelectionSegment virtualSpaceRange(SelectionPosition(model.pdoc->LineEnd(line)), SelectionPosition(model.pdoc->LineEnd(line), model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line))));
+ for (size_t r = 0; r<model.sel.Count(); r++) {
+ int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ if (alpha == SC_ALPHA_NOALPHA) {
+ SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange);
+ if (!portion.Empty()) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] -
+ static_cast<XYPOSITION>(subLineStart)+portion.start.VirtualSpace() * spaceWidth;
+ rcSegment.right = xStart + ll->positions[portion.end.Position() - posLineStart] -
+ static_cast<XYPOSITION>(subLineStart)+portion.end.VirtualSpace() * spaceWidth;
+ rcSegment.left = (rcSegment.left > rcLine.left) ? rcSegment.left : rcLine.left;
+ rcSegment.right = (rcSegment.right < rcLine.right) ? rcSegment.right : rcLine.right;
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, r == model.sel.Main(), model.primarySelection));
+ }
+ }
+ }
+ }
+ }
+
+ int eolInSelection = 0;
+ int alpha = SC_ALPHA_NOALPHA;
+ if (!hideSelection) {
+ int posAfterLineEnd = model.pdoc->LineStart(line + 1);
+ eolInSelection = (subLine == (ll->lines - 1)) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0;
+ alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ }
+
+ // Draw the [CR], [LF], or [CR][LF] blobs if visible line ends are on
+ XYPOSITION blobsWidth = 0;
+ if (lastSubLine) {
+ for (int eolPos = ll->numCharsBeforeEOL; eolPos<ll->numCharsInLine; eolPos++) {
+ rcSegment.left = xStart + ll->positions[eolPos] - static_cast<XYPOSITION>(subLineStart)+virtualSpace;
+ rcSegment.right = xStart + ll->positions[eolPos + 1] - static_cast<XYPOSITION>(subLineStart)+virtualSpace;
+ blobsWidth += rcSegment.Width();
+ char hexits[4];
+ const char *ctrlChar;
+ unsigned char chEOL = ll->chars[eolPos];
+ int styleMain = ll->styles[eolPos];
+ ColourDesired textBack = TextBackground(model, vsDraw, ll, background, eolInSelection, false, styleMain, eolPos);
+ if (UTF8IsAscii(chEOL)) {
+ ctrlChar = ControlCharacterString(chEOL);
+ } else {
+ const Representation *repr = model.reprs.RepresentationFromCharacter(ll->chars + eolPos, ll->numCharsInLine - eolPos);
+ if (repr) {
+ ctrlChar = repr->stringRep.c_str();
+ eolPos = ll->numCharsInLine;
+ } else {
+ sprintf(hexits, "x%2X", chEOL);
+ ctrlChar = hexits;
+ }
+ }
+ ColourDesired textFore = vsDraw.styles[styleMain].fore;
+ if (eolInSelection && vsDraw.selColours.fore.isSet) {
+ textFore = (eolInSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
+ }
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1)) {
+ if (alpha == SC_ALPHA_NOALPHA) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection));
+ } else {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ } else {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ DrawTextBlob(surface, vsDraw, rcSegment, ctrlChar, textBack, textFore, phasesDraw == phasesOne);
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection), alpha);
+ }
+ }
+ }
+
+ // Draw the eol-is-selected rectangle
+ rcSegment.left = xEol + xStart + virtualSpace + blobsWidth;
+ rcSegment.right = rcSegment.left + vsDraw.aveCharWidth;
+
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection));
+ } else {
+ if (background.isSet) {
+ surface->FillRectangle(rcSegment, background);
+ } else if (line < model.pdoc->LinesTotal() - 1) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back);
+ } else if (vsDraw.styles[ll->styles[ll->numCharsInLine]].eolFilled) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
+ }
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection), alpha);
+ }
+ }
+
+ // Fill the remainder of the line
+ rcSegment.left = rcSegment.right;
+ if (rcSegment.left < rcLine.left)
+ rcSegment.left = rcLine.left;
+ rcSegment.right = rcLine.right;
+
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection));
+ } else {
+ if (background.isSet) {
+ surface->FillRectangle(rcSegment, background);
+ } else if (vsDraw.styles[ll->styles[ll->numCharsInLine]].eolFilled) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
+ }
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection), alpha);
+ }
+ }
+
+ bool drawWrapMarkEnd = false;
+
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ if (subLine + 1 < ll->lines) {
+ drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0;
+ }
+ }
+
+ if (drawWrapMarkEnd) {
+ PRectangle rcPlace = rcSegment;
+
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_END_BY_TEXT) {
+ rcPlace.left = xEol + xStart + virtualSpace;
+ rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
+ } else {
+ // rcLine is clipped to text area
+ rcPlace.right = rcLine.right;
+ rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
+ }
+ if (customDrawWrapMarker == NULL) {
+ DrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour());
+ } else {
+ customDrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour());
+ }
+ }
+}
+
+static void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, const ViewStyle &vsDraw,
+ const LineLayout *ll, int xStart, PRectangle rcLine, int subLine, Indicator::DrawState drawState, int value) {
+ const XYPOSITION subLineStart = ll->positions[ll->LineStart(subLine)];
+ PRectangle rcIndic(
+ ll->positions[startPos] + xStart - subLineStart,
+ rcLine.top + vsDraw.maxAscent,
+ ll->positions[endPos] + xStart - subLineStart,
+ rcLine.top + vsDraw.maxAscent + 3);
+ vsDraw.indicators[indicNum].Draw(surface, rcIndic, rcLine, drawState, value);
+}
+
+static void DrawIndicators(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int xStart, PRectangle rcLine, int subLine, int lineEnd, bool under, int hoverIndicatorPos) {
+ // Draw decorators
+ const int posLineStart = model.pdoc->LineStart(line);
+ const int lineStart = ll->LineStart(subLine);
+ const int posLineEnd = posLineStart + lineEnd;
+
+ for (Decoration *deco = model.pdoc->decorations.root; deco; deco = deco->next) {
+ if (under == vsDraw.indicators[deco->indicator].under) {
+ int startPos = posLineStart + lineStart;
+ if (!deco->rs.ValueAt(startPos)) {
+ startPos = deco->rs.EndRun(startPos);
+ }
+ while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) {
+ int endPos = deco->rs.EndRun(startPos);
+ if (endPos > posLineEnd)
+ endPos = posLineEnd;
+ const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() &&
+ ((hoverIndicatorPos >= startPos) && (hoverIndicatorPos <= endPos));
+ const int value = deco->rs.ValueAt(startPos);
+ Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal;
+ DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart,
+ surface, vsDraw, ll, xStart, rcLine, subLine, drawState, value);
+ startPos = endPos;
+ if (!deco->rs.ValueAt(startPos)) {
+ startPos = deco->rs.EndRun(startPos);
+ }
+ }
+ }
+ }
+
+ // Use indicators to highlight matching braces
+ if ((vsDraw.braceHighlightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACELIGHT)) ||
+ (vsDraw.braceBadLightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACEBAD))) {
+ int braceIndicator = (model.bracesMatchStyle == STYLE_BRACELIGHT) ? vsDraw.braceHighlightIndicator : vsDraw.braceBadLightIndicator;
+ if (under == vsDraw.indicators[braceIndicator].under) {
+ Range rangeLine(posLineStart + lineStart, posLineEnd);
+ if (rangeLine.ContainsCharacter(model.braces[0])) {
+ int braceOffset = model.braces[0] - posLineStart;
+ if (braceOffset < ll->numCharsInLine) {
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, subLine, Indicator::drawNormal, 1);
+ }
+ }
+ if (rangeLine.ContainsCharacter(model.braces[1])) {
+ int braceOffset = model.braces[1] - posLineStart;
+ if (braceOffset < ll->numCharsInLine) {
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, subLine, Indicator::drawNormal, 1);
+ }
+ }
+ }
+ }
+}
+
+static bool AnnotationBoxedOrIndented(int annotationVisible) {
+ return annotationVisible == ANNOTATION_BOXED || annotationVisible == ANNOTATION_INDENTED;
+}
+
+void EditView::DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) {
+ int indent = static_cast<int>(model.pdoc->GetLineIndentation(line) * vsDraw.spaceWidth);
+ PRectangle rcSegment = rcLine;
+ int annotationLine = subLine - ll->lines;
+ const StyledText stAnnotation = model.pdoc->AnnotationStyledText(line);
+ if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) {
+ if (phase & drawBack) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[0].back);
+ }
+ rcSegment.left = static_cast<XYPOSITION>(xStart);
+ if (model.trackLineWidth || AnnotationBoxedOrIndented(vsDraw.annotationVisible)) {
+ // Only care about calculating width if tracking or need to draw indented box
+ int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation);
+ if (AnnotationBoxedOrIndented(vsDraw.annotationVisible)) {
+ widthAnnotation += static_cast<int>(vsDraw.spaceWidth * 2); // Margins
+ rcSegment.left = static_cast<XYPOSITION>(xStart + indent);
+ rcSegment.right = rcSegment.left + widthAnnotation;
+ }
+ if (widthAnnotation > lineWidthMaxSeen)
+ lineWidthMaxSeen = widthAnnotation;
+ }
+ const int annotationLines = model.pdoc->AnnotationLines(line);
+ size_t start = 0;
+ size_t lengthAnnotation = stAnnotation.LineLength(start);
+ int lineInAnnotation = 0;
+ while ((lineInAnnotation < annotationLine) && (start < stAnnotation.length)) {
+ start += lengthAnnotation + 1;
+ lengthAnnotation = stAnnotation.LineLength(start);
+ lineInAnnotation++;
+ }
+ PRectangle rcText = rcSegment;
+ if ((phase & drawBack) && AnnotationBoxedOrIndented(vsDraw.annotationVisible)) {
+ surface->FillRectangle(rcText,
+ vsDraw.styles[stAnnotation.StyleAt(start) + vsDraw.annotationStyleOffset].back);
+ rcText.left += vsDraw.spaceWidth;
+ }
+ DrawStyledText(surface, vsDraw, vsDraw.annotationStyleOffset, rcText,
+ stAnnotation, start, lengthAnnotation, phase);
+ if ((phase & drawBack) && (vsDraw.annotationVisible == ANNOTATION_BOXED)) {
+ surface->PenColour(vsDraw.styles[vsDraw.annotationStyleOffset].fore);
+ surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.top));
+ surface->LineTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.bottom));
+ surface->MoveTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.top));
+ surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.bottom));
+ if (subLine == ll->lines) {
+ surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.top));
+ surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.top));
+ }
+ if (subLine == ll->lines + annotationLines - 1) {
+ surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.bottom - 1));
+ surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.bottom - 1));
+ }
+ }
+ }
+}
+
+static void DrawBlockCaret(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int subLine, int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour) {
+
+ int lineStart = ll->LineStart(subLine);
+ int posBefore = posCaret;
+ int posAfter = model.pdoc->MovePositionOutsideChar(posCaret + 1, 1);
+ int numCharsToDraw = posAfter - posCaret;
+
+ // Work out where the starting and ending offsets are. We need to
+ // see if the previous character shares horizontal space, such as a
+ // glyph / combining character. If so we'll need to draw that too.
+ int offsetFirstChar = offset;
+ int offsetLastChar = offset + (posAfter - posCaret);
+ while ((posBefore > 0) && ((offsetLastChar - numCharsToDraw) >= lineStart)) {
+ if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - numCharsToDraw]) > 0) {
+ // The char does not share horizontal space
+ break;
+ }
+ // Char shares horizontal space, update the numChars to draw
+ // Update posBefore to point to the prev char
+ posBefore = model.pdoc->MovePositionOutsideChar(posBefore - 1, -1);
+ numCharsToDraw = posAfter - posBefore;
+ offsetFirstChar = offset - (posCaret - posBefore);
+ }
+
+ // See if the next character shares horizontal space, if so we'll
+ // need to draw that too.
+ if (offsetFirstChar < 0)
+ offsetFirstChar = 0;
+ numCharsToDraw = offsetLastChar - offsetFirstChar;
+ while ((offsetLastChar < ll->LineStart(subLine + 1)) && (offsetLastChar <= ll->numCharsInLine)) {
+ // Update posAfter to point to the 2nd next char, this is where
+ // the next character ends, and 2nd next begins. We'll need
+ // to compare these two
+ posBefore = posAfter;
+ posAfter = model.pdoc->MovePositionOutsideChar(posAfter + 1, 1);
+ offsetLastChar = offset + (posAfter - posCaret);
+ if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - (posAfter - posBefore)]) > 0) {
+ // The char does not share horizontal space
+ break;
+ }
+ // Char shares horizontal space, update the numChars to draw
+ numCharsToDraw = offsetLastChar - offsetFirstChar;
+ }
+
+ // We now know what to draw, update the caret drawing rectangle
+ rcCaret.left = ll->positions[offsetFirstChar] - ll->positions[lineStart] + xStart;
+ rcCaret.right = ll->positions[offsetFirstChar + numCharsToDraw] - ll->positions[lineStart] + xStart;
+
+ // Adjust caret position to take into account any word wrapping symbols.
+ if ((ll->wrapIndent != 0) && (lineStart != 0)) {
+ XYPOSITION wordWrapCharWidth = ll->wrapIndent;
+ rcCaret.left += wordWrapCharWidth;
+ rcCaret.right += wordWrapCharWidth;
+ }
+
+ // This character is where the caret block is, we override the colours
+ // (inversed) for drawing the caret here.
+ int styleMain = ll->styles[offsetFirstChar];
+ FontAlias fontText = vsDraw.styles[styleMain].font;
+ surface->DrawTextClipped(rcCaret, fontText,
+ rcCaret.top + vsDraw.maxAscent, ll->chars + offsetFirstChar,
+ numCharsToDraw, vsDraw.styles[styleMain].back,
+ caretColour);
+}
+
+void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int lineDoc, int xStart, PRectangle rcLine, int subLine) const {
+ // When drag is active it is the only caret drawn
+ bool drawDrag = model.posDrag.IsValid();
+ if (hideSelection && !drawDrag)
+ return;
+ const int posLineStart = model.pdoc->LineStart(lineDoc);
+ // For each selection draw
+ for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) {
+ const bool mainCaret = r == model.sel.Main();
+ const SelectionPosition posCaret = (drawDrag ? model.posDrag : model.sel.Range(r).caret);
+ const int offset = posCaret.Position() - posLineStart;
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ const XYPOSITION virtualOffset = posCaret.VirtualSpace() * spaceWidth;
+ if (ll->InLine(offset, subLine) && offset <= ll->numCharsBeforeEOL) {
+ XYPOSITION xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)];
+ if (ll->wrapIndent != 0) {
+ int lineStart = ll->LineStart(subLine);
+ if (lineStart != 0) // Wrapped
+ xposCaret += ll->wrapIndent;
+ }
+ bool caretBlinkState = (model.caret.active && model.caret.on) || (!additionalCaretsBlink && !mainCaret);
+ bool caretVisibleState = additionalCaretsVisible || mainCaret;
+ if ((xposCaret >= 0) && (vsDraw.caretWidth > 0) && (vsDraw.caretStyle != CARETSTYLE_INVISIBLE) &&
+ ((model.posDrag.IsValid()) || (caretBlinkState && caretVisibleState))) {
+ bool caretAtEOF = false;
+ bool caretAtEOL = false;
+ bool drawBlockCaret = false;
+ XYPOSITION widthOverstrikeCaret;
+ XYPOSITION caretWidthOffset = 0;
+ PRectangle rcCaret = rcLine;
+
+ if (posCaret.Position() == model.pdoc->Length()) { // At end of document
+ caretAtEOF = true;
+ widthOverstrikeCaret = vsDraw.aveCharWidth;
+ } else if ((posCaret.Position() - posLineStart) >= ll->numCharsInLine) { // At end of line
+ caretAtEOL = true;
+ widthOverstrikeCaret = vsDraw.aveCharWidth;
+ } else {
+ const int widthChar = model.pdoc->LenChar(posCaret.Position());
+ widthOverstrikeCaret = ll->positions[offset + widthChar] - ll->positions[offset];
+ }
+ if (widthOverstrikeCaret < 3) // Make sure its visible
+ widthOverstrikeCaret = 3;
+
+ if (xposCaret > 0)
+ caretWidthOffset = 0.51f; // Move back so overlaps both character cells.
+ xposCaret += xStart;
+ if (model.posDrag.IsValid()) {
+ /* Dragging text, use a line caret */
+ rcCaret.left = static_cast<XYPOSITION>(RoundXYPosition(xposCaret - caretWidthOffset));
+ rcCaret.right = rcCaret.left + vsDraw.caretWidth;
+ } else if (model.inOverstrike && drawOverstrikeCaret) {
+ /* Overstrike (insert mode), use a modified bar caret */
+ rcCaret.top = rcCaret.bottom - 2;
+ rcCaret.left = xposCaret + 1;
+ rcCaret.right = rcCaret.left + widthOverstrikeCaret - 1;
+ } else if ((vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride) {
+ /* Block caret */
+ rcCaret.left = xposCaret;
+ if (!caretAtEOL && !caretAtEOF && (ll->chars[offset] != '\t') && !(IsControlCharacter(ll->chars[offset]))) {
+ drawBlockCaret = true;
+ rcCaret.right = xposCaret + widthOverstrikeCaret;
+ } else {
+ rcCaret.right = xposCaret + vsDraw.aveCharWidth;
+ }
+ } else {
+ /* Line caret */
+ rcCaret.left = static_cast<XYPOSITION>(RoundXYPosition(xposCaret - caretWidthOffset));
+ rcCaret.right = rcCaret.left + vsDraw.caretWidth;
+ }
+ ColourDesired caretColour = mainCaret ? vsDraw.caretcolour : vsDraw.additionalCaretColour;
+ if (drawBlockCaret) {
+ DrawBlockCaret(surface, model, vsDraw, ll, subLine, xStart, offset, posCaret.Position(), rcCaret, caretColour);
+ } else {
+ surface->FillRectangle(rcCaret, caretColour);
+ }
+ }
+ }
+ if (drawDrag)
+ break;
+ }
+}
+
+static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll,
+ int xStart, PRectangle rcLine, ColourOptional background, DrawWrapMarkerFn customDrawWrapMarker) {
+ // default bgnd here..
+ surface->FillRectangle(rcLine, background.isSet ? background :
+ vsDraw.styles[STYLE_DEFAULT].back);
+
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_START) {
+
+ // draw continuation rect
+ PRectangle rcPlace = rcLine;
+
+ rcPlace.left = static_cast<XYPOSITION>(xStart);
+ rcPlace.right = rcPlace.left + ll->wrapIndent;
+
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_START_BY_TEXT)
+ rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
+ else
+ rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
+
+ if (customDrawWrapMarker == NULL) {
+ DrawWrapMarker(surface, rcPlace, false, vsDraw.WrapColour());
+ } else {
+ customDrawWrapMarker(surface, rcPlace, false, vsDraw.WrapColour());
+ }
+ }
+}
+
+void EditView::DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ PRectangle rcLine, Range lineRange, int posLineStart, int xStart,
+ int subLine, ColourOptional background) const {
+
+ const bool selBackDrawn = vsDraw.SelectionBackgroundDrawn();
+ bool inIndentation = subLine == 0; // Do not handle indentation except on first subline.
+ const XYACCUMULATOR subLineStart = ll->positions[lineRange.start];
+ // Does not take margin into account but not significant
+ const int xStartVisible = static_cast<int>(subLineStart)-xStart;
+
+ BreakFinder bfBack(ll, &model.sel, lineRange, posLineStart, xStartVisible, selBackDrawn, model.pdoc, &model.reprs, NULL);
+
+ const bool drawWhitespaceBackground = vsDraw.WhitespaceBackgroundDrawn() && !background.isSet;
+
+ // Background drawing loop
+ while (bfBack.More()) {
+
+ const TextSegment ts = bfBack.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
+
+ PRectangle rcSegment = rcLine;
+ rcSegment.left = ll->positions[ts.start] + xStart - static_cast<XYPOSITION>(subLineStart);
+ rcSegment.right = ll->positions[ts.end()] + xStart - static_cast<XYPOSITION>(subLineStart);
+ // Only try to draw if really visible - enhances performance by not calling environment to
+ // draw strings that are completely past the right side of the window.
+ if (rcSegment.Intersects(rcLine)) {
+ // Clip to line rectangle, since may have a huge position which will not work with some platforms
+ if (rcSegment.left < rcLine.left)
+ rcSegment.left = rcLine.left;
+ if (rcSegment.right > rcLine.right)
+ rcSegment.right = rcLine.right;
+
+ const int inSelection = hideSelection ? 0 : model.sel.CharacterInSelection(iDoc);
+ const bool inHotspot = (ll->hotspot.Valid()) && ll->hotspot.ContainsCharacter(iDoc);
+ ColourDesired textBack = TextBackground(model, vsDraw, ll, background, inSelection,
+ inHotspot, ll->styles[i], i);
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ } else {
+ // Blob display
+ inIndentation = false;
+ }
+ surface->FillRectangle(rcSegment, textBack);
+ } else {
+ // Normal text display
+ surface->FillRectangle(rcSegment, textBack);
+ if (vsDraw.viewWhitespace != wsInvisible ||
+ (inIndentation && vsDraw.viewIndentationGuides == ivReal)) {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ PRectangle rcSpace(
+ ll->positions[cpos + ts.start] + xStart - static_cast<XYPOSITION>(subLineStart),
+ rcSegment.top,
+ ll->positions[cpos + ts.start + 1] + xStart - static_cast<XYPOSITION>(subLineStart),
+ rcSegment.bottom);
+ surface->FillRectangle(rcSpace, vsDraw.whitespaceColours.back);
+ }
+ } else {
+ inIndentation = false;
+ }
+ }
+ }
+ }
+ } else if (rcSegment.left > rcLine.right) {
+ break;
+ }
+ }
+}
+
+static void DrawEdgeLine(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine,
+ Range lineRange, int xStart) {
+ if (vsDraw.edgeState == EDGE_LINE) {
+ PRectangle rcSegment = rcLine;
+ int edgeX = static_cast<int>(vsDraw.theEdge * vsDraw.spaceWidth);
+ rcSegment.left = static_cast<XYPOSITION>(edgeX + xStart);
+ if ((ll->wrapIndent != 0) && (lineRange.start != 0))
+ rcSegment.left -= ll->wrapIndent;
+ rcSegment.right = rcSegment.left + 1;
+ surface->FillRectangle(rcSegment, vsDraw.edgecolour);
+ }
+}
+
+// Draw underline mark as part of background if not transparent
+static void DrawMarkUnderline(Surface *surface, const EditModel &model, const ViewStyle &vsDraw,
+ int line, PRectangle rcLine) {
+ int marks = model.pdoc->GetMark(line);
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE) &&
+ (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ PRectangle rcUnderline = rcLine;
+ rcUnderline.top = rcUnderline.bottom - 2;
+ surface->FillRectangle(rcUnderline, vsDraw.markers[markBit].back);
+ }
+ marks >>= 1;
+ }
+}
+static void DrawTranslucentSelection(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, PRectangle rcLine, int subLine, Range lineRange, int xStart) {
+ if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA)) {
+ const int posLineStart = model.pdoc->LineStart(line);
+ const XYACCUMULATOR subLineStart = ll->positions[lineRange.start];
+ // For each selection draw
+ int virtualSpaces = 0;
+ if (subLine == (ll->lines - 1)) {
+ virtualSpaces = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line));
+ }
+ SelectionPosition posStart(posLineStart + lineRange.start);
+ SelectionPosition posEnd(posLineStart + lineRange.end, virtualSpaces);
+ SelectionSegment virtualSpaceRange(posStart, posEnd);
+ for (size_t r = 0; r < model.sel.Count(); r++) {
+ int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ if (alpha != SC_ALPHA_NOALPHA) {
+ SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange);
+ if (!portion.Empty()) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ PRectangle rcSegment = rcLine;
+ rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] -
+ static_cast<XYPOSITION>(subLineStart)+portion.start.VirtualSpace() * spaceWidth;
+ rcSegment.right = xStart + ll->positions[portion.end.Position() - posLineStart] -
+ static_cast<XYPOSITION>(subLineStart)+portion.end.VirtualSpace() * spaceWidth;
+ if ((ll->wrapIndent != 0) && (lineRange.start != 0)) {
+ if ((portion.start.Position() - posLineStart) == lineRange.start && model.sel.Range(r).ContainsCharacter(portion.start.Position() - 1))
+ rcSegment.left -= static_cast<int>(ll->wrapIndent); // indentation added to xStart was truncated to int, so we do the same here
+ }
+ rcSegment.left = (rcSegment.left > rcLine.left) ? rcSegment.left : rcLine.left;
+ rcSegment.right = (rcSegment.right < rcLine.right) ? rcSegment.right : rcLine.right;
+ if (rcSegment.right > rcLine.left)
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, r == model.sel.Main(), model.primarySelection), alpha);
+ }
+ }
+ }
+ }
+}
+
+// Draw any translucent whole line states
+static void DrawTranslucentLineState(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, PRectangle rcLine) {
+ if ((model.caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) {
+ SimpleAlphaRectangle(surface, rcLine, vsDraw.caretLineBackground, vsDraw.caretLineAlpha);
+ }
+ int marks = model.pdoc->GetMark(line);
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) {
+ SimpleAlphaRectangle(surface, rcLine, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ } else if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE)) {
+ PRectangle rcUnderline = rcLine;
+ rcUnderline.top = rcUnderline.bottom - 2;
+ SimpleAlphaRectangle(surface, rcUnderline, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ }
+ marks >>= 1;
+ }
+ if (vsDraw.maskInLine) {
+ int marksMasked = model.pdoc->GetMark(line) & vsDraw.maskInLine;
+ if (marksMasked) {
+ for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
+ if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) {
+ SimpleAlphaRectangle(surface, rcLine, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ }
+ marksMasked >>= 1;
+ }
+ }
+ }
+}
+
+void EditView::DrawForeground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int lineVisible, PRectangle rcLine, Range lineRange, int posLineStart, int xStart,
+ int subLine, ColourOptional background) {
+
+ const bool selBackDrawn = vsDraw.SelectionBackgroundDrawn();
+ const bool drawWhitespaceBackground = vsDraw.WhitespaceBackgroundDrawn() && !background.isSet;
+ bool inIndentation = subLine == 0; // Do not handle indentation except on first subline.
+
+ const XYACCUMULATOR subLineStart = ll->positions[lineRange.start];
+ const XYPOSITION indentWidth = model.pdoc->IndentSize() * vsDraw.spaceWidth;
+
+ // Does not take margin into account but not significant
+ const int xStartVisible = static_cast<int>(subLineStart)-xStart;
+
+ // Foreground drawing loop
+ BreakFinder bfFore(ll, &model.sel, lineRange, posLineStart, xStartVisible,
+ (((phasesDraw == phasesOne) && selBackDrawn) || vsDraw.selColours.fore.isSet), model.pdoc, &model.reprs, &vsDraw);
+
+ while (bfFore.More()) {
+
+ const TextSegment ts = bfFore.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
+
+ PRectangle rcSegment = rcLine;
+ rcSegment.left = ll->positions[ts.start] + xStart - static_cast<XYPOSITION>(subLineStart);
+ rcSegment.right = ll->positions[ts.end()] + xStart - static_cast<XYPOSITION>(subLineStart);
+ // Only try to draw if really visible - enhances performance by not calling environment to
+ // draw strings that are completely past the right side of the window.
+ if (rcSegment.Intersects(rcLine)) {
+ int styleMain = ll->styles[i];
+ ColourDesired textFore = vsDraw.styles[styleMain].fore;
+ FontAlias textFont = vsDraw.styles[styleMain].font;
+ //hotspot foreground
+ const bool inHotspot = (ll->hotspot.Valid()) && ll->hotspot.ContainsCharacter(iDoc);
+ if (inHotspot) {
+ if (vsDraw.hotspotColours.fore.isSet)
+ textFore = vsDraw.hotspotColours.fore;
+ }
+ if (vsDraw.indicatorsSetFore > 0) {
+ // At least one indicator sets the text colour so see if it applies to this segment
+ for (Decoration *deco = model.pdoc->decorations.root; deco; deco = deco->next) {
+ const int indicatorValue = deco->rs.ValueAt(ts.start + posLineStart);
+ if (indicatorValue) {
+ const Indicator &indicator = vsDraw.indicators[deco->indicator];
+ const bool hover = indicator.IsDynamic() &&
+ ((model.hoverIndicatorPos >= ts.start + posLineStart) &&
+ (model.hoverIndicatorPos <= ts.end() + posLineStart));
+ if (hover) {
+ if (indicator.sacHover.style == INDIC_TEXTFORE) {
+ textFore = indicator.sacHover.fore;
+ }
+ } else {
+ if (indicator.sacNormal.style == INDIC_TEXTFORE) {
+ if (indicator.Flags() & SC_INDICFLAG_VALUEFORE)
+ textFore = indicatorValue & SC_INDICVALUEMASK;
+ else
+ textFore = indicator.sacNormal.fore;
+ }
+ }
+ }
+ }
+ }
+ const int inSelection = hideSelection ? 0 : model.sel.CharacterInSelection(iDoc);
+ if (inSelection && (vsDraw.selColours.fore.isSet)) {
+ textFore = (inSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
+ }
+ ColourDesired textBack = TextBackground(model, vsDraw, ll, background, inSelection, inHotspot, styleMain, i);
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (phasesDraw == phasesOne) {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ for (int indentCount = static_cast<int>((ll->positions[i] + epsilon) / indentWidth);
+ indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
+ indentCount++) {
+ if (indentCount > 0) {
+ int xIndent = static_cast<int>(indentCount * indentWidth);
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+ if (vsDraw.viewWhitespace != wsInvisible) {
+ if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
+ surface->PenColour(textFore);
+ PRectangle rcTab(rcSegment.left + 1, rcSegment.top + tabArrowHeight,
+ rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent);
+ if (customDrawTabArrow == NULL)
+ DrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2));
+ else
+ customDrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2));
+ }
+ }
+ } else {
+ inIndentation = false;
+ if (vsDraw.controlCharSymbol >= 32) {
+ // Using one font for all control characters so it can be controlled independently to ensure
+ // the box goes around the characters tightly. Seems to be no way to work out what height
+ // is taken by an individual character - internal leading gives varying results.
+ FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
+ char cc[2] = { static_cast<char>(vsDraw.controlCharSymbol), '\0' };
+ surface->DrawTextNoClip(rcSegment, ctrlCharsFont,
+ rcSegment.top + vsDraw.maxAscent,
+ cc, 1, textBack, textFore);
+ } else {
+ DrawTextBlob(surface, vsDraw, rcSegment, ts.representation->stringRep.c_str(),
+ textBack, textFore, phasesDraw == phasesOne);
+ }
+ }
+ } else {
+ // Normal text display
+ if (vsDraw.styles[styleMain].visible) {
+ if (phasesDraw != phasesOne) {
+ surface->DrawTextTransparent(rcSegment, textFont,
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore);
+ } else {
+ surface->DrawTextNoClip(rcSegment, textFont,
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore, textBack);
+ }
+ }
+ if (vsDraw.viewWhitespace != wsInvisible ||
+ (inIndentation && vsDraw.viewIndentationGuides != ivNone)) {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
+ if (vsDraw.viewWhitespace != wsInvisible) {
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
+ if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ XYPOSITION xmid = (ll->positions[cpos + ts.start] + ll->positions[cpos + ts.start + 1]) / 2;
+ if ((phasesDraw == phasesOne) && drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ textBack = vsDraw.whitespaceColours.back;
+ PRectangle rcSpace(
+ ll->positions[cpos + ts.start] + xStart - static_cast<XYPOSITION>(subLineStart),
+ rcSegment.top,
+ ll->positions[cpos + ts.start + 1] + xStart - static_cast<XYPOSITION>(subLineStart),
+ rcSegment.bottom);
+ surface->FillRectangle(rcSpace, textBack);
+ }
+ PRectangle rcDot(xmid + xStart - static_cast<XYPOSITION>(subLineStart),
+ rcSegment.top + vsDraw.lineHeight / 2, 0.0f, 0.0f);
+ rcDot.right = rcDot.left + vsDraw.whitespaceSize;
+ rcDot.bottom = rcDot.top + vsDraw.whitespaceSize;
+ surface->FillRectangle(rcDot, textFore);
+ }
+ }
+ if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ for (int indentCount = static_cast<int>((ll->positions[cpos + ts.start] + epsilon) / indentWidth);
+ indentCount <= (ll->positions[cpos + ts.start + 1] - epsilon) / indentWidth;
+ indentCount++) {
+ if (indentCount > 0) {
+ int xIndent = static_cast<int>(indentCount * indentWidth);
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+ } else {
+ inIndentation = false;
+ }
+ }
+ }
+ }
+ if (ll->hotspot.Valid() && vsDraw.hotspotUnderline && ll->hotspot.ContainsCharacter(iDoc)) {
+ PRectangle rcUL = rcSegment;
+ rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
+ rcUL.bottom = rcUL.top + 1;
+ if (vsDraw.hotspotColours.fore.isSet)
+ surface->FillRectangle(rcUL, vsDraw.hotspotColours.fore);
+ else
+ surface->FillRectangle(rcUL, textFore);
+ } else if (vsDraw.styles[styleMain].underline) {
+ PRectangle rcUL = rcSegment;
+ rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
+ rcUL.bottom = rcUL.top + 1;
+ surface->FillRectangle(rcUL, textFore);
+ }
+ } else if (rcSegment.left > rcLine.right) {
+ break;
+ }
+ }
+}
+
+void EditView::DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int lineVisible, PRectangle rcLine, int xStart, int subLine) {
+ if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth)
+ && (subLine == 0)) {
+ const int posLineStart = model.pdoc->LineStart(line);
+ int indentSpace = model.pdoc->GetLineIndentation(line);
+ int xStartText = static_cast<int>(ll->positions[model.pdoc->GetLineIndentPosition(line) - posLineStart]);
+
+ // Find the most recent line with some text
+
+ int lineLastWithText = line;
+ while (lineLastWithText > Platform::Maximum(line - 20, 0) && model.pdoc->IsWhiteLine(lineLastWithText)) {
+ lineLastWithText--;
+ }
+ if (lineLastWithText < line) {
+ xStartText = 100000; // Don't limit to visible indentation on empty line
+ // This line is empty, so use indentation of last line with text
+ int indentLastWithText = model.pdoc->GetLineIndentation(lineLastWithText);
+ int isFoldHeader = model.pdoc->GetLevel(lineLastWithText) & SC_FOLDLEVELHEADERFLAG;
+ if (isFoldHeader) {
+ // Level is one more level than parent
+ indentLastWithText += model.pdoc->IndentSize();
+ }
+ if (vsDraw.viewIndentationGuides == ivLookForward) {
+ // In viLookForward mode, previous line only used if it is a fold header
+ if (isFoldHeader) {
+ indentSpace = Platform::Maximum(indentSpace, indentLastWithText);
+ }
+ } else { // viLookBoth
+ indentSpace = Platform::Maximum(indentSpace, indentLastWithText);
+ }
+ }
+
+ int lineNextWithText = line;
+ while (lineNextWithText < Platform::Minimum(line + 20, model.pdoc->LinesTotal()) && model.pdoc->IsWhiteLine(lineNextWithText)) {
+ lineNextWithText++;
+ }
+ if (lineNextWithText > line) {
+ xStartText = 100000; // Don't limit to visible indentation on empty line
+ // This line is empty, so use indentation of first next line with text
+ indentSpace = Platform::Maximum(indentSpace,
+ model.pdoc->GetLineIndentation(lineNextWithText));
+ }
+
+ for (int indentPos = model.pdoc->IndentSize(); indentPos < indentSpace; indentPos += model.pdoc->IndentSize()) {
+ int xIndent = static_cast<int>(indentPos * vsDraw.spaceWidth);
+ if (xIndent < xStartText) {
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcLine,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+}
+
+void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) {
+
+ if (subLine >= ll->lines) {
+ DrawAnnotation(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, phase);
+ return; // No further drawing
+ }
+
+ // See if something overrides the line background color.
+ const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
+
+ const int posLineStart = model.pdoc->LineStart(line);
+
+ const Range lineRange = ll->SubLineRange(subLine);
+ const XYACCUMULATOR subLineStart = ll->positions[lineRange.start];
+
+ if ((ll->wrapIndent != 0) && (subLine > 0)) {
+ if (phase & drawBack) {
+ DrawWrapIndentAndMarker(surface, vsDraw, ll, xStart, rcLine, background, customDrawWrapMarker);
+ }
+ xStart += static_cast<int>(ll->wrapIndent);
+ }
+
+ if ((phasesDraw != phasesOne) && (phase & drawBack)) {
+ DrawBackground(surface, model, vsDraw, ll, rcLine, lineRange, posLineStart, xStart,
+ subLine, background);
+ DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end,
+ xStart, subLine, subLineStart, background);
+ }
+
+ if (phase & drawIndicatorsBack) {
+ DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, true, model.hoverIndicatorPos);
+ DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart);
+ DrawMarkUnderline(surface, model, vsDraw, line, rcLine);
+ }
+
+ if (phase & drawText) {
+ DrawForeground(surface, model, vsDraw, ll, lineVisible, rcLine, lineRange, posLineStart, xStart,
+ subLine, background);
+ }
+
+ if (phase & drawIndentationGuides) {
+ DrawIndentGuidesOverEmpty(surface, model, vsDraw, ll, line, lineVisible, rcLine, xStart, subLine);
+ }
+
+ if (phase & drawIndicatorsFore) {
+ DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, false, model.hoverIndicatorPos);
+ }
+
+ // End of the drawing of the current line
+ if (phasesDraw == phasesOne) {
+ DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end,
+ xStart, subLine, subLineStart, background);
+ }
+
+ if (!hideSelection && (phase & drawSelectionTranslucent)) {
+ DrawTranslucentSelection(surface, model, vsDraw, ll, line, rcLine, subLine, lineRange, xStart);
+ }
+
+ if (phase & drawLineTranslucent) {
+ DrawTranslucentLineState(surface, model, vsDraw, ll, line, rcLine);
+ }
+}
+
+static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, int line, PRectangle rcLine) {
+ bool expanded = model.cs.GetExpanded(line);
+ const int level = model.pdoc->GetLevel(line);
+ const int levelNext = model.pdoc->GetLevel(line + 1);
+ if ((level & SC_FOLDLEVELHEADERFLAG) &&
+ ((level & SC_FOLDLEVELNUMBERMASK) < (levelNext & SC_FOLDLEVELNUMBERMASK))) {
+ // Paint the line above the fold
+ if ((expanded && (model.foldFlags & SC_FOLDFLAG_LINEBEFORE_EXPANDED))
+ ||
+ (!expanded && (model.foldFlags & SC_FOLDFLAG_LINEBEFORE_CONTRACTED))) {
+ PRectangle rcFoldLine = rcLine;
+ rcFoldLine.bottom = rcFoldLine.top + 1;
+ surface->FillRectangle(rcFoldLine, vsDraw.styles[STYLE_DEFAULT].fore);
+ }
+ // Paint the line below the fold
+ if ((expanded && (model.foldFlags & SC_FOLDFLAG_LINEAFTER_EXPANDED))
+ ||
+ (!expanded && (model.foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) {
+ PRectangle rcFoldLine = rcLine;
+ rcFoldLine.top = rcFoldLine.bottom - 1;
+ surface->FillRectangle(rcFoldLine, vsDraw.styles[STYLE_DEFAULT].fore);
+ }
+ }
+}
+
+void EditView::PaintText(Surface *surfaceWindow, const EditModel &model, PRectangle rcArea,
+ PRectangle rcClient, const ViewStyle &vsDraw) {
+ // Allow text at start of line to overlap 1 pixel into the margin as this displays
+ // serifs and italic stems for aliased text.
+ const int leftTextOverlap = ((model.xOffset == 0) && (vsDraw.leftMarginWidth > 0)) ? 1 : 0;
+
+ // Do the painting
+ if (rcArea.right > vsDraw.textStart - leftTextOverlap) {
+
+ Surface *surface = surfaceWindow;
+ if (bufferedDraw) {
+ surface = pixmapLine;
+ PLATFORM_ASSERT(pixmapLine->Initialised());
+ }
+ surface->SetUnicodeMode(SC_CP_UTF8 == model.pdoc->dbcsCodePage);
+ surface->SetDBCSMode(model.pdoc->dbcsCodePage);
+
+ const Point ptOrigin = model.GetVisibleOriginInMain();
+
+ const int screenLinePaintFirst = static_cast<int>(rcArea.top) / vsDraw.lineHeight;
+ const int xStart = vsDraw.textStart - model.xOffset + static_cast<int>(ptOrigin.x);
+
+ SelectionPosition posCaret = model.sel.RangeMain().caret;
+ if (model.posDrag.IsValid())
+ posCaret = model.posDrag;
+ const int lineCaret = model.pdoc->LineFromPosition(posCaret.Position());
+
+ PRectangle rcTextArea = rcClient;
+ if (vsDraw.marginInside) {
+ rcTextArea.left += vsDraw.textStart;
+ rcTextArea.right -= vsDraw.rightMarginWidth;
+ } else {
+ rcTextArea = rcArea;
+ }
+
+ // Remove selection margin from drawing area so text will not be drawn
+ // on it in unbuffered mode.
+ if (!bufferedDraw && vsDraw.marginInside) {
+ PRectangle rcClipText = rcTextArea;
+ rcClipText.left -= leftTextOverlap;
+ surfaceWindow->SetClip(rcClipText);
+ }
+
+ // Loop on visible lines
+ //double durLayout = 0.0;
+ //double durPaint = 0.0;
+ //double durCopy = 0.0;
+ //ElapsedTime etWhole;
+
+ const bool bracesIgnoreStyle = ((vsDraw.braceHighlightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACELIGHT)) ||
+ (vsDraw.braceBadLightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACEBAD)));
+
+ int lineDocPrevious = -1; // Used to avoid laying out one document line multiple times
+ AutoLineLayout ll(llc, 0);
+ std::vector<DrawPhase> phases;
+ if ((phasesDraw == phasesMultiple) && !bufferedDraw) {
+ for (DrawPhase phase = drawBack; phase <= drawCarets; phase = static_cast<DrawPhase>(phase * 2)) {
+ phases.push_back(phase);
+ }
+ } else {
+ phases.push_back(drawAll);
+ }
+ for (std::vector<DrawPhase>::iterator it = phases.begin(); it != phases.end(); ++it) {
+ int ypos = 0;
+ if (!bufferedDraw)
+ ypos += screenLinePaintFirst * vsDraw.lineHeight;
+ int yposScreen = screenLinePaintFirst * vsDraw.lineHeight;
+ int visibleLine = model.TopLineOfMain() + screenLinePaintFirst;
+ while (visibleLine < model.cs.LinesDisplayed() && yposScreen < rcArea.bottom) {
+
+ const int lineDoc = model.cs.DocFromDisplay(visibleLine);
+ // Only visible lines should be handled by the code within the loop
+ PLATFORM_ASSERT(model.cs.GetVisible(lineDoc));
+ const int lineStartSet = model.cs.DisplayFromDoc(lineDoc);
+ const int subLine = visibleLine - lineStartSet;
+
+ // Copy this line and its styles from the document into local arrays
+ // and determine the x position at which each character starts.
+ //ElapsedTime et;
+ if (lineDoc != lineDocPrevious) {
+ ll.Set(0);
+ ll.Set(RetrieveLineLayout(lineDoc, model));
+ LayoutLine(model, lineDoc, surface, vsDraw, ll, model.wrapWidth);
+ lineDocPrevious = lineDoc;
+ }
+ //durLayout += et.Duration(true);
+
+ if (ll) {
+ ll->containsCaret = !hideSelection && (lineDoc == lineCaret);
+ ll->hotspot = model.GetHotSpotRange();
+
+ PRectangle rcLine = rcTextArea;
+ rcLine.top = static_cast<XYPOSITION>(ypos);
+ rcLine.bottom = static_cast<XYPOSITION>(ypos + vsDraw.lineHeight);
+
+ Range rangeLine(model.pdoc->LineStart(lineDoc), model.pdoc->LineStart(lineDoc + 1));
+
+ // Highlight the current braces if any
+ ll->SetBracesHighlight(rangeLine, model.braces, static_cast<char>(model.bracesMatchStyle),
+ static_cast<int>(model.highlightGuideColumn * vsDraw.spaceWidth), bracesIgnoreStyle);
+
+ if (leftTextOverlap && bufferedDraw) {
+ PRectangle rcSpacer = rcLine;
+ rcSpacer.right = rcSpacer.left;
+ rcSpacer.left -= 1;
+ surface->FillRectangle(rcSpacer, vsDraw.styles[STYLE_DEFAULT].back);
+ }
+
+ DrawLine(surface, model, vsDraw, ll, lineDoc, visibleLine, xStart, rcLine, subLine, *it);
+ //durPaint += et.Duration(true);
+
+ // Restore the previous styles for the brace highlights in case layout is in cache.
+ ll->RestoreBracesHighlight(rangeLine, model.braces, bracesIgnoreStyle);
+
+ if (*it & drawFoldLines) {
+ DrawFoldLines(surface, model, vsDraw, lineDoc, rcLine);
+ }
+
+ if (*it & drawCarets) {
+ DrawCarets(surface, model, vsDraw, ll, lineDoc, xStart, rcLine, subLine);
+ }
+
+ if (bufferedDraw) {
+ Point from = Point::FromInts(vsDraw.textStart - leftTextOverlap, 0);
+ PRectangle rcCopyArea = PRectangle::FromInts(vsDraw.textStart - leftTextOverlap, yposScreen,
+ static_cast<int>(rcClient.right - vsDraw.rightMarginWidth),
+ yposScreen + vsDraw.lineHeight);
+ surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
+ }
+
+ lineWidthMaxSeen = Platform::Maximum(
+ lineWidthMaxSeen, static_cast<int>(ll->positions[ll->numCharsInLine]));
+ //durCopy += et.Duration(true);
+ }
+
+ if (!bufferedDraw) {
+ ypos += vsDraw.lineHeight;
+ }
+
+ yposScreen += vsDraw.lineHeight;
+ visibleLine++;
+ }
+ }
+ ll.Set(0);
+ //if (durPaint < 0.00000001)
+ // durPaint = 0.00000001;
+
+ // Right column limit indicator
+ PRectangle rcBeyondEOF = (vsDraw.marginInside) ? rcClient : rcArea;
+ rcBeyondEOF.left = static_cast<XYPOSITION>(vsDraw.textStart);
+ rcBeyondEOF.right = rcBeyondEOF.right - ((vsDraw.marginInside) ? vsDraw.rightMarginWidth : 0);
+ rcBeyondEOF.top = static_cast<XYPOSITION>((model.cs.LinesDisplayed() - model.TopLineOfMain()) * vsDraw.lineHeight);
+ if (rcBeyondEOF.top < rcBeyondEOF.bottom) {
+ surfaceWindow->FillRectangle(rcBeyondEOF, vsDraw.styles[STYLE_DEFAULT].back);
+ if (vsDraw.edgeState == EDGE_LINE) {
+ int edgeX = static_cast<int>(vsDraw.theEdge * vsDraw.spaceWidth);
+ rcBeyondEOF.left = static_cast<XYPOSITION>(edgeX + xStart);
+ rcBeyondEOF.right = rcBeyondEOF.left + 1;
+ surfaceWindow->FillRectangle(rcBeyondEOF, vsDraw.edgecolour);
+ }
+ }
+ //Platform::DebugPrintf("start display %d, offset = %d\n", pdoc->Length(), xOffset);
+
+ //Platform::DebugPrintf(
+ //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
+ //durLayout, durPaint, durLayout / durPaint, durCopy, etWhole.Duration());
+ }
+}
+
+// Space (3 space characters) between line numbers and text when printing.
+#define lineNumberPrintSpace " "
+
+ColourDesired InvertedLight(ColourDesired orig) {
+ unsigned int r = orig.GetRed();
+ unsigned int g = orig.GetGreen();
+ unsigned int b = orig.GetBlue();
+ unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye
+ unsigned int il = 0xff - l;
+ if (l == 0)
+ return ColourDesired(0xff, 0xff, 0xff);
+ r = r * il / l;
+ g = g * il / l;
+ b = b * il / l;
+ return ColourDesired(Platform::Minimum(r, 0xff), Platform::Minimum(g, 0xff), Platform::Minimum(b, 0xff));
+}
+
+long EditView::FormatRange(bool draw, Sci_RangeToFormat *pfr, Surface *surface, Surface *surfaceMeasure,
+ const EditModel &model, const ViewStyle &vs) {
+ // Can't use measurements cached for screen
+ posCache.Clear();
+
+ ViewStyle vsPrint(vs);
+ vsPrint.technology = SC_TECHNOLOGY_DEFAULT;
+
+ // Modify the view style for printing as do not normally want any of the transient features to be printed
+ // Printing supports only the line number margin.
+ int lineNumberIndex = -1;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) {
+ lineNumberIndex = margin;
+ } else {
+ vsPrint.ms[margin].width = 0;
+ }
+ }
+ vsPrint.fixedColumnWidth = 0;
+ vsPrint.zoomLevel = printParameters.magnification;
+ // Don't show indentation guides
+ // If this ever gets changed, cached pixmap would need to be recreated if technology != SC_TECHNOLOGY_DEFAULT
+ vsPrint.viewIndentationGuides = ivNone;
+ // Don't show the selection when printing
+ vsPrint.selColours.back.isSet = false;
+ vsPrint.selColours.fore.isSet = false;
+ vsPrint.selAlpha = SC_ALPHA_NOALPHA;
+ vsPrint.selAdditionalAlpha = SC_ALPHA_NOALPHA;
+ vsPrint.whitespaceColours.back.isSet = false;
+ vsPrint.whitespaceColours.fore.isSet = false;
+ vsPrint.showCaretLineBackground = false;
+ vsPrint.alwaysShowCaretLineBackground = false;
+ // Don't highlight matching braces using indicators
+ vsPrint.braceHighlightIndicatorSet = false;
+ vsPrint.braceBadLightIndicatorSet = false;
+
+ // Set colours for printing according to users settings
+ for (size_t sty = 0; sty < vsPrint.styles.size(); sty++) {
+ if (printParameters.colourMode == SC_PRINT_INVERTLIGHT) {
+ vsPrint.styles[sty].fore = InvertedLight(vsPrint.styles[sty].fore);
+ vsPrint.styles[sty].back = InvertedLight(vsPrint.styles[sty].back);
+ } else if (printParameters.colourMode == SC_PRINT_BLACKONWHITE) {
+ vsPrint.styles[sty].fore = ColourDesired(0, 0, 0);
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITE) {
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) {
+ if (sty <= STYLE_DEFAULT) {
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ }
+ }
+ }
+ // White background for the line numbers
+ vsPrint.styles[STYLE_LINENUMBER].back = ColourDesired(0xff, 0xff, 0xff);
+
+ // Printing uses different margins, so reset screen margins
+ vsPrint.leftMarginWidth = 0;
+ vsPrint.rightMarginWidth = 0;
+
+ vsPrint.Refresh(*surfaceMeasure, model.pdoc->tabInChars);
+ // Determining width must happen after fonts have been realised in Refresh
+ int lineNumberWidth = 0;
+ if (lineNumberIndex >= 0) {
+ lineNumberWidth = static_cast<int>(surfaceMeasure->WidthText(vsPrint.styles[STYLE_LINENUMBER].font,
+ "99999" lineNumberPrintSpace, 5 + static_cast<int>(strlen(lineNumberPrintSpace))));
+ vsPrint.ms[lineNumberIndex].width = lineNumberWidth;
+ vsPrint.Refresh(*surfaceMeasure, model.pdoc->tabInChars); // Recalculate fixedColumnWidth
+ }
+
+ int linePrintStart = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMin));
+ int linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1;
+ if (linePrintLast < linePrintStart)
+ linePrintLast = linePrintStart;
+ int linePrintMax = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMax));
+ if (linePrintLast > linePrintMax)
+ linePrintLast = linePrintMax;
+ //Platform::DebugPrintf("Formatting lines=[%0d,%0d,%0d] top=%0d bottom=%0d line=%0d %0d\n",
+ // linePrintStart, linePrintLast, linePrintMax, pfr->rc.top, pfr->rc.bottom, vsPrint.lineHeight,
+ // surfaceMeasure->Height(vsPrint.styles[STYLE_LINENUMBER].font));
+ int endPosPrint = model.pdoc->Length();
+ if (linePrintLast < model.pdoc->LinesTotal())
+ endPosPrint = model.pdoc->LineStart(linePrintLast + 1);
+
+ // Ensure we are styled to where we are formatting.
+ model.pdoc->EnsureStyledTo(endPosPrint);
+
+ int xStart = vsPrint.fixedColumnWidth + pfr->rc.left;
+ int ypos = pfr->rc.top;
+
+ int lineDoc = linePrintStart;
+
+ int nPrintPos = static_cast<int>(pfr->chrg.cpMin);
+ int visibleLine = 0;
+ int widthPrint = pfr->rc.right - pfr->rc.left - vsPrint.fixedColumnWidth;
+ if (printParameters.wrapState == eWrapNone)
+ widthPrint = LineLayout::wrapWidthInfinite;
+
+ while (lineDoc <= linePrintLast && ypos < pfr->rc.bottom) {
+
+ // When printing, the hdc and hdcTarget may be the same, so
+ // changing the state of surfaceMeasure may change the underlying
+ // state of surface. Therefore, any cached state is discarded before
+ // using each surface.
+ surfaceMeasure->FlushCachedState();
+
+ // Copy this line and its styles from the document into local arrays
+ // and determine the x position at which each character starts.
+ LineLayout ll(model.pdoc->LineStart(lineDoc + 1) - model.pdoc->LineStart(lineDoc) + 1);
+ LayoutLine(model, lineDoc, surfaceMeasure, vsPrint, &ll, widthPrint);
+
+ ll.containsCaret = false;
+
+ PRectangle rcLine = PRectangle::FromInts(
+ pfr->rc.left,
+ ypos,
+ pfr->rc.right - 1,
+ ypos + vsPrint.lineHeight);
+
+ // When document line is wrapped over multiple display lines, find where
+ // to start printing from to ensure a particular position is on the first
+ // line of the page.
+ if (visibleLine == 0) {
+ int startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc);
+ for (int iwl = 0; iwl < ll.lines - 1; iwl++) {
+ if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) {
+ visibleLine = -iwl;
+ }
+ }
+
+ if (ll.lines > 1 && startWithinLine >= ll.LineStart(ll.lines - 1)) {
+ visibleLine = -(ll.lines - 1);
+ }
+ }
+
+ if (draw && lineNumberWidth &&
+ (ypos + vsPrint.lineHeight <= pfr->rc.bottom) &&
+ (visibleLine >= 0)) {
+ char number[100];
+ sprintf(number, "%d" lineNumberPrintSpace, lineDoc + 1);
+ PRectangle rcNumber = rcLine;
+ rcNumber.right = rcNumber.left + lineNumberWidth;
+ // Right justify
+ rcNumber.left = rcNumber.right - surfaceMeasure->WidthText(
+ vsPrint.styles[STYLE_LINENUMBER].font, number, static_cast<int>(strlen(number)));
+ surface->FlushCachedState();
+ surface->DrawTextNoClip(rcNumber, vsPrint.styles[STYLE_LINENUMBER].font,
+ static_cast<XYPOSITION>(ypos + vsPrint.maxAscent), number, static_cast<int>(strlen(number)),
+ vsPrint.styles[STYLE_LINENUMBER].fore,
+ vsPrint.styles[STYLE_LINENUMBER].back);
+ }
+
+ // Draw the line
+ surface->FlushCachedState();
+
+ for (int iwl = 0; iwl < ll.lines; iwl++) {
+ if (ypos + vsPrint.lineHeight <= pfr->rc.bottom) {
+ if (visibleLine >= 0) {
+ if (draw) {
+ rcLine.top = static_cast<XYPOSITION>(ypos);
+ rcLine.bottom = static_cast<XYPOSITION>(ypos + vsPrint.lineHeight);
+ DrawLine(surface, model, vsPrint, &ll, lineDoc, visibleLine, xStart, rcLine, iwl, drawAll);
+ }
+ ypos += vsPrint.lineHeight;
+ }
+ visibleLine++;
+ if (iwl == ll.lines - 1)
+ nPrintPos = model.pdoc->LineStart(lineDoc + 1);
+ else
+ nPrintPos += ll.LineStart(iwl + 1) - ll.LineStart(iwl);
+ }
+ }
+
+ ++lineDoc;
+ }
+
+ // Clear cache so measurements are not used for screen
+ posCache.Clear();
+
+ return nPrintPos;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/EditView.h b/3rdparty/bgfx/3rdparty/scintilla/src/EditView.h
new file mode 100644
index 00000000000..79a88657aeb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/EditView.h
@@ -0,0 +1,174 @@
+// Scintilla source code edit control
+/** @file EditView.h
+ ** Defines the appearance of the main text area of the editor window.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef EDITVIEW_H
+#define EDITVIEW_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+struct PrintParameters {
+ int magnification;
+ int colourMode;
+ WrapMode wrapState;
+ PrintParameters();
+};
+
+/**
+* The view may be drawn in separate phases.
+*/
+enum DrawPhase {
+ drawBack = 0x1,
+ drawIndicatorsBack = 0x2,
+ drawText = 0x4,
+ drawIndentationGuides = 0x8,
+ drawIndicatorsFore = 0x10,
+ drawSelectionTranslucent = 0x20,
+ drawLineTranslucent = 0x40,
+ drawFoldLines = 0x80,
+ drawCarets = 0x100,
+ drawAll = 0x1FF
+};
+
+bool ValidStyledText(const ViewStyle &vs, size_t styleOffset, const StyledText &st);
+int WidestLineWidth(Surface *surface, const ViewStyle &vs, int styleOffset, const StyledText &st);
+void DrawTextNoClipPhase(Surface *surface, PRectangle rc, const Style &style, XYPOSITION ybase,
+ const char *s, int len, DrawPhase phase);
+void DrawStyledText(Surface *surface, const ViewStyle &vs, int styleOffset, PRectangle rcText,
+ const StyledText &st, size_t start, size_t length, DrawPhase phase);
+
+typedef void (*DrawTabArrowFn)(Surface *surface, PRectangle rcTab, int ymid);
+
+/**
+* EditView draws the main text area.
+*/
+class EditView {
+public:
+ PrintParameters printParameters;
+ PerLine *ldTabstops;
+ int tabWidthMinimumPixels;
+
+ bool hideSelection;
+ bool drawOverstrikeCaret;
+
+ /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to
+ * the screen. This avoids flashing but is about 30% slower. */
+ bool bufferedDraw;
+ /** In phasesTwo mode, drawing is performed in two phases, first the background
+ * and then the foreground. This avoids chopping off characters that overlap the next run.
+ * In multiPhaseDraw mode, drawing is performed in multiple phases with each phase drawing
+ * one feature over the whole drawing area, instead of within one line. This allows text to
+ * overlap from one line to the next. */
+ enum PhasesDraw { phasesOne, phasesTwo, phasesMultiple };
+ PhasesDraw phasesDraw;
+
+ int lineWidthMaxSeen;
+
+ bool additionalCaretsBlink;
+ bool additionalCaretsVisible;
+
+ bool imeCaretBlockOverride;
+
+ Surface *pixmapLine;
+ Surface *pixmapIndentGuide;
+ Surface *pixmapIndentGuideHighlight;
+
+ LineLayoutCache llc;
+ PositionCache posCache;
+
+ int tabArrowHeight; // draw arrow heads this many pixels above/below line midpoint
+ /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
+ * DrawTabArrow function for drawing tab characters. Allow those platforms to
+ * override it instead of creating a new method in the Surface class that
+ * existing platforms must implement as empty. */
+ DrawTabArrowFn customDrawTabArrow;
+ DrawWrapMarkerFn customDrawWrapMarker;
+
+ EditView();
+ virtual ~EditView();
+
+ bool SetTwoPhaseDraw(bool twoPhaseDraw);
+ bool SetPhasesDraw(int phases);
+ bool LinesOverlap() const;
+
+ void ClearAllTabstops();
+ XYPOSITION NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const;
+ bool ClearTabstops(int line);
+ bool AddTabstop(int line, int x);
+ int GetNextTabstop(int line, int x) const;
+ void LinesAddedOrRemoved(int lineOfPos, int linesAdded);
+
+ void DropGraphics(bool freeObjects);
+ void AllocateGraphics(const ViewStyle &vsDraw);
+ void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw);
+
+ LineLayout *RetrieveLineLayout(int lineNumber, const EditModel &model);
+ void LayoutLine(const EditModel &model, int line, Surface *surface, const ViewStyle &vstyle,
+ LineLayout *ll, int width = LineLayout::wrapWidthInfinite);
+
+ Point LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, int topLine, const ViewStyle &vs);
+ SelectionPosition SPositionFromLocation(Surface *surface, const EditModel &model, Point pt, bool canReturnInvalid,
+ bool charPosition, bool virtualSpace, const ViewStyle &vs);
+ SelectionPosition SPositionFromLineX(Surface *surface, const EditModel &model, int lineDoc, int x, const ViewStyle &vs);
+ int DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs);
+ int StartEndDisplayLine(Surface *surface, const EditModel &model, int pos, bool start, const ViewStyle &vs);
+
+ void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
+ void DrawEOL(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine,
+ int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart,
+ ColourOptional background);
+ void DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase);
+ void DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int line,
+ int xStart, PRectangle rcLine, int subLine) const;
+ void DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine,
+ Range lineRange, int posLineStart, int xStart,
+ int subLine, ColourOptional background) const;
+ void DrawForeground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int lineVisible,
+ PRectangle rcLine, Range lineRange, int posLineStart, int xStart,
+ int subLine, ColourOptional background);
+ void DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll,
+ int line, int lineVisible, PRectangle rcLine, int xStart, int subLine);
+ void DrawLine(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int line,
+ int lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase);
+ void PaintText(Surface *surfaceWindow, const EditModel &model, PRectangle rcArea, PRectangle rcClient,
+ const ViewStyle &vsDraw);
+ long FormatRange(bool draw, Sci_RangeToFormat *pfr, Surface *surface, Surface *surfaceMeasure,
+ const EditModel &model, const ViewStyle &vs);
+};
+
+/**
+* Convenience class to ensure LineLayout objects are always disposed.
+*/
+class AutoLineLayout {
+ LineLayoutCache &llc;
+ LineLayout *ll;
+ AutoLineLayout &operator=(const AutoLineLayout &);
+public:
+ AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {}
+ ~AutoLineLayout() {
+ llc.Dispose(ll);
+ ll = 0;
+ }
+ LineLayout *operator->() const {
+ return ll;
+ }
+ operator LineLayout *() const {
+ return ll;
+ }
+ void Set(LineLayout *ll_) {
+ llc.Dispose(ll);
+ ll = ll_;
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx
new file mode 100644
index 00000000000..348419ac13d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx
@@ -0,0 +1,7681 @@
+// Scintilla source code edit control
+/** @file Editor.cxx
+ ** Main code for the edit control.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <cmath>
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+#include <memory>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "PerLine.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+ return whether this modification represents an operation that
+ may reasonably be deferred (not done now OR [possibly] at all)
+*/
+static bool CanDeferToLastStep(const DocModification &mh) {
+ if (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE))
+ return true; // CAN skip
+ if (!(mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)))
+ return false; // MUST do
+ if (mh.modificationType & SC_MULTISTEPUNDOREDO)
+ return true; // CAN skip
+ return false; // PRESUMABLY must do
+}
+
+static bool CanEliminate(const DocModification &mh) {
+ return
+ (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) != 0;
+}
+
+/*
+ return whether this modification represents the FINAL step
+ in a [possibly lengthy] multi-step Undo/Redo sequence
+*/
+static bool IsLastStep(const DocModification &mh) {
+ return
+ (mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)) != 0
+ && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0
+ && (mh.modificationType & SC_LASTSTEPINUNDOREDO) != 0
+ && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0;
+}
+
+Timer::Timer() :
+ ticking(false), ticksToWait(0), tickerID(0) {}
+
+Idler::Idler() :
+ state(false), idlerID(0) {}
+
+static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) {
+ for (unsigned int i = 0; i < len; i++) {
+ // This is safe because IsSpaceOrTab() will return false for null terminators
+ if (!IsSpaceOrTab(s[i]))
+ return false;
+ }
+ return true;
+}
+
+Editor::Editor() {
+ ctrlID = 0;
+
+ stylesValid = false;
+ technology = SC_TECHNOLOGY_DEFAULT;
+ scaleRGBAImage = 100.0f;
+
+ cursorMode = SC_CURSORNORMAL;
+
+ hasFocus = false;
+ errorStatus = 0;
+ mouseDownCaptures = true;
+
+ lastClickTime = 0;
+ doubleClickCloseThreshold = Point(3, 3);
+ dwellDelay = SC_TIME_FOREVER;
+ ticksToDwell = SC_TIME_FOREVER;
+ dwelling = false;
+ ptMouseLast.x = 0;
+ ptMouseLast.y = 0;
+ inDragDrop = ddNone;
+ dropWentOutside = false;
+ posDrop = SelectionPosition(invalidPosition);
+ hotSpotClickPos = INVALID_POSITION;
+ selectionType = selChar;
+
+ lastXChosen = 0;
+ lineAnchorPos = 0;
+ originalAnchorPos = 0;
+ wordSelectAnchorStartPos = 0;
+ wordSelectAnchorEndPos = 0;
+ wordSelectInitialCaretPos = -1;
+
+ caretXPolicy = CARET_SLOP | CARET_EVEN;
+ caretXSlop = 50;
+
+ caretYPolicy = CARET_EVEN;
+ caretYSlop = 0;
+
+ visiblePolicy = 0;
+ visibleSlop = 0;
+
+ searchAnchor = 0;
+
+ xCaretMargin = 50;
+ horizontalScrollBarVisible = true;
+ scrollWidth = 2000;
+ verticalScrollBarVisible = true;
+ endAtLastLine = true;
+ caretSticky = SC_CARETSTICKY_OFF;
+ marginOptions = SC_MARGINOPTION_NONE;
+ mouseSelectionRectangularSwitch = false;
+ multipleSelection = false;
+ additionalSelectionTyping = false;
+ multiPasteMode = SC_MULTIPASTE_ONCE;
+ virtualSpaceOptions = SCVS_NONE;
+
+ targetStart = 0;
+ targetEnd = 0;
+ searchFlags = 0;
+
+ topLine = 0;
+ posTopLine = 0;
+
+ lengthForEncode = -1;
+
+ needUpdateUI = 0;
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+
+ paintState = notPainting;
+ paintAbandonedByStyling = false;
+ paintingAllText = false;
+ willRedrawAll = false;
+
+ modEventMask = SC_MODEVENTMASKALL;
+
+ pdoc->AddWatcher(this, 0);
+
+ recordingMacro = false;
+ foldAutomatic = 0;
+
+ convertPastes = true;
+
+ SetRepresentations();
+}
+
+Editor::~Editor() {
+ pdoc->RemoveWatcher(this, 0);
+ DropGraphics(true);
+}
+
+void Editor::Finalise() {
+ SetIdle(false);
+ CancelModes();
+}
+
+void Editor::SetRepresentations() {
+ reprs.Clear();
+
+ // C0 control set
+ const char *reps[] = {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
+ };
+ for (size_t j=0; j < ELEMENTS(reps); j++) {
+ char c[2] = { static_cast<char>(j), 0 };
+ reprs.SetRepresentation(c, reps[j]);
+ }
+
+ // C1 control set
+ // As well as Unicode mode, ISO-8859-1 should use these
+ if (IsUnicodeMode()) {
+ const char *repsC1[] = {
+ "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
+ "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3",
+ "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA",
+ "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC"
+ };
+ for (size_t j=0; j < ELEMENTS(repsC1); j++) {
+ char c1[3] = { '\xc2', static_cast<char>(0x80+j), 0 };
+ reprs.SetRepresentation(c1, repsC1[j]);
+ }
+ reprs.SetRepresentation("\xe2\x80\xa8", "LS");
+ reprs.SetRepresentation("\xe2\x80\xa9", "PS");
+ }
+
+ // UTF-8 invalid bytes
+ if (IsUnicodeMode()) {
+ for (int k=0x80; k < 0x100; k++) {
+ char hiByte[2] = { static_cast<char>(k), 0 };
+ char hexits[4];
+ sprintf(hexits, "x%2X", k);
+ reprs.SetRepresentation(hiByte, hexits);
+ }
+ }
+}
+
+void Editor::DropGraphics(bool freeObjects) {
+ marginView.DropGraphics(freeObjects);
+ view.DropGraphics(freeObjects);
+}
+
+void Editor::AllocateGraphics() {
+ marginView.AllocateGraphics(vs);
+ view.AllocateGraphics(vs);
+}
+
+void Editor::InvalidateStyleData() {
+ stylesValid = false;
+ vs.technology = technology;
+ DropGraphics(false);
+ AllocateGraphics();
+ view.llc.Invalidate(LineLayout::llInvalid);
+ view.posCache.Clear();
+}
+
+void Editor::InvalidateStyleRedraw() {
+ NeedWrapping();
+ InvalidateStyleData();
+ Redraw();
+}
+
+void Editor::RefreshStyleData() {
+ if (!stylesValid) {
+ stylesValid = true;
+ AutoSurface surface(this);
+ if (surface) {
+ vs.Refresh(*surface, pdoc->tabInChars);
+ }
+ SetScrollBars();
+ SetRectangularRange();
+ }
+}
+
+Point Editor::GetVisibleOriginInMain() const {
+ return Point(0,0);
+}
+
+Point Editor::DocumentPointFromView(Point ptView) const {
+ Point ptDocument = ptView;
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ ptDocument.x += ptOrigin.x;
+ ptDocument.y += ptOrigin.y;
+ } else {
+ ptDocument.x += xOffset;
+ ptDocument.y += topLine * vs.lineHeight;
+ }
+ return ptDocument;
+}
+
+int Editor::TopLineOfMain() const {
+ if (wMargin.GetID())
+ return 0;
+ else
+ return topLine;
+}
+
+PRectangle Editor::GetClientRectangle() const {
+ Window &win = const_cast<Window &>(wMain);
+ return win.GetClientPosition();
+}
+
+PRectangle Editor::GetClientDrawingRectangle() {
+ return GetClientRectangle();
+}
+
+PRectangle Editor::GetTextRectangle() const {
+ PRectangle rc = GetClientRectangle();
+ rc.left += vs.textStart;
+ rc.right -= vs.rightMarginWidth;
+ return rc;
+}
+
+int Editor::LinesOnScreen() const {
+ PRectangle rcClient = GetClientRectangle();
+ int htClient = static_cast<int>(rcClient.bottom - rcClient.top);
+ //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1);
+ return htClient / vs.lineHeight;
+}
+
+int Editor::LinesToScroll() const {
+ int retVal = LinesOnScreen() - 1;
+ if (retVal < 1)
+ return 1;
+ else
+ return retVal;
+}
+
+int Editor::MaxScrollPos() const {
+ //Platform::DebugPrintf("Lines %d screen = %d maxScroll = %d\n",
+ //LinesTotal(), LinesOnScreen(), LinesTotal() - LinesOnScreen() + 1);
+ int retVal = cs.LinesDisplayed();
+ if (endAtLastLine) {
+ retVal -= LinesOnScreen();
+ } else {
+ retVal--;
+ }
+ if (retVal < 0) {
+ return 0;
+ } else {
+ return retVal;
+ }
+}
+
+SelectionPosition Editor::ClampPositionIntoDocument(SelectionPosition sp) const {
+ if (sp.Position() < 0) {
+ return SelectionPosition(0);
+ } else if (sp.Position() > pdoc->Length()) {
+ return SelectionPosition(pdoc->Length());
+ } else {
+ // If not at end of line then set offset to 0
+ if (!pdoc->IsLineEndPosition(sp.Position()))
+ sp.SetVirtualSpace(0);
+ return sp;
+ }
+}
+
+Point Editor::LocationFromPosition(SelectionPosition pos) {
+ RefreshStyleData();
+ AutoSurface surface(this);
+ return view.LocationFromPosition(surface, *this, pos, topLine, vs);
+}
+
+Point Editor::LocationFromPosition(int pos) {
+ return LocationFromPosition(SelectionPosition(pos));
+}
+
+int Editor::XFromPosition(int pos) {
+ Point pt = LocationFromPosition(pos);
+ return static_cast<int>(pt.x) - vs.textStart + xOffset;
+}
+
+int Editor::XFromPosition(SelectionPosition sp) {
+ Point pt = LocationFromPosition(sp);
+ return static_cast<int>(pt.x) - vs.textStart + xOffset;
+}
+
+SelectionPosition Editor::SPositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition, bool virtualSpace) {
+ RefreshStyleData();
+ AutoSurface surface(this);
+
+ if (canReturnInvalid) {
+ PRectangle rcClient = GetTextRectangle();
+ // May be in scroll view coordinates so translate back to main view
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcClient.Move(-ptOrigin.x, -ptOrigin.y);
+ if (!rcClient.Contains(pt))
+ return SelectionPosition(INVALID_POSITION);
+ if (pt.x < vs.textStart)
+ return SelectionPosition(INVALID_POSITION);
+ if (pt.y < 0)
+ return SelectionPosition(INVALID_POSITION);
+ }
+ pt = DocumentPointFromView(pt);
+ return view.SPositionFromLocation(surface, *this, pt, canReturnInvalid, charPosition, virtualSpace, vs);
+}
+
+int Editor::PositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition) {
+ return SPositionFromLocation(pt, canReturnInvalid, charPosition, false).Position();
+}
+
+/**
+* Find the document position corresponding to an x coordinate on a particular document line.
+* Ensure is between whole characters when document is in multi-byte or UTF-8 mode.
+* This method is used for rectangular selections and does not work on wrapped lines.
+*/
+SelectionPosition Editor::SPositionFromLineX(int lineDoc, int x) {
+ RefreshStyleData();
+ if (lineDoc >= pdoc->LinesTotal())
+ return SelectionPosition(pdoc->Length());
+ //Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine);
+ AutoSurface surface(this);
+ return view.SPositionFromLineX(surface, *this, lineDoc, x, vs);
+}
+
+int Editor::PositionFromLineX(int lineDoc, int x) {
+ return SPositionFromLineX(lineDoc, x).Position();
+}
+
+int Editor::LineFromLocation(Point pt) const {
+ return cs.DocFromDisplay(static_cast<int>(pt.y) / vs.lineHeight + topLine);
+}
+
+void Editor::SetTopLine(int topLineNew) {
+ if ((topLine != topLineNew) && (topLineNew >= 0)) {
+ topLine = topLineNew;
+ ContainerNeedsUpdate(SC_UPDATE_V_SCROLL);
+ }
+ posTopLine = pdoc->LineStart(cs.DocFromDisplay(topLine));
+}
+
+/**
+ * If painting then abandon the painting because a wider redraw is needed.
+ * @return true if calling code should stop drawing.
+ */
+bool Editor::AbandonPaint() {
+ if ((paintState == painting) && !paintingAllText) {
+ paintState = paintAbandoned;
+ }
+ return paintState == paintAbandoned;
+}
+
+void Editor::RedrawRect(PRectangle rc) {
+ //Platform::DebugPrintf("Redraw %0d,%0d - %0d,%0d\n", rc.left, rc.top, rc.right, rc.bottom);
+
+ // Clip the redraw rectangle into the client area
+ PRectangle rcClient = GetClientRectangle();
+ if (rc.top < rcClient.top)
+ rc.top = rcClient.top;
+ if (rc.bottom > rcClient.bottom)
+ rc.bottom = rcClient.bottom;
+ if (rc.left < rcClient.left)
+ rc.left = rcClient.left;
+ if (rc.right > rcClient.right)
+ rc.right = rcClient.right;
+
+ if ((rc.bottom > rc.top) && (rc.right > rc.left)) {
+ wMain.InvalidateRectangle(rc);
+ }
+}
+
+void Editor::DiscardOverdraw() {
+ // Overridden on platforms that may draw outside visible area.
+}
+
+void Editor::Redraw() {
+ //Platform::DebugPrintf("Redraw all\n");
+ PRectangle rcClient = GetClientRectangle();
+ wMain.InvalidateRectangle(rcClient);
+ if (wMargin.GetID())
+ wMargin.InvalidateAll();
+ //wMain.InvalidateAll();
+}
+
+void Editor::RedrawSelMargin(int line, bool allAfter) {
+ bool abandonDraw = false;
+ if (!wMargin.GetID()) // Margin in main window so may need to abandon and retry
+ abandonDraw = AbandonPaint();
+ if (!abandonDraw) {
+ if (vs.maskInLine) {
+ Redraw();
+ } else {
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = rcSelMargin.left + vs.fixedColumnWidth;
+ if (line != -1) {
+ PRectangle rcLine = RectangleFromRange(Range(pdoc->LineStart(line)), 0);
+
+ // Inflate line rectangle if there are image markers with height larger than line height
+ if (vs.largestMarkerHeight > vs.lineHeight) {
+ int delta = (vs.largestMarkerHeight - vs.lineHeight + 1) / 2;
+ rcLine.top -= delta;
+ rcLine.bottom += delta;
+ if (rcLine.top < rcSelMargin.top)
+ rcLine.top = rcSelMargin.top;
+ if (rcLine.bottom > rcSelMargin.bottom)
+ rcLine.bottom = rcSelMargin.bottom;
+ }
+
+ rcSelMargin.top = rcLine.top;
+ if (!allAfter)
+ rcSelMargin.bottom = rcLine.bottom;
+ if (rcSelMargin.Empty())
+ return;
+ }
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcSelMargin.Move(-ptOrigin.x, -ptOrigin.y);
+ wMargin.InvalidateRectangle(rcSelMargin);
+ } else {
+ wMain.InvalidateRectangle(rcSelMargin);
+ }
+ }
+ }
+}
+
+PRectangle Editor::RectangleFromRange(Range r, int overlap) {
+ const int minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(r.First()));
+ const int maxLine = cs.DisplayLastFromDoc(pdoc->LineFromPosition(r.Last()));
+ const PRectangle rcClientDrawing = GetClientDrawingRectangle();
+ PRectangle rc;
+ const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0;
+ rc.left = static_cast<XYPOSITION>(vs.textStart - leftTextOverlap);
+ rc.top = static_cast<XYPOSITION>((minLine - TopLineOfMain()) * vs.lineHeight - overlap);
+ if (rc.top < rcClientDrawing.top)
+ rc.top = rcClientDrawing.top;
+ // Extend to right of prepared area if any to prevent artifacts from caret line highlight
+ rc.right = rcClientDrawing.right;
+ rc.bottom = static_cast<XYPOSITION>((maxLine - TopLineOfMain() + 1) * vs.lineHeight + overlap);
+
+ return rc;
+}
+
+void Editor::InvalidateRange(int start, int end) {
+ RedrawRect(RectangleFromRange(Range(start, end), view.LinesOverlap() ? vs.lineOverlap : 0));
+}
+
+int Editor::CurrentPosition() const {
+ return sel.MainCaret();
+}
+
+bool Editor::SelectionEmpty() const {
+ return sel.Empty();
+}
+
+SelectionPosition Editor::SelectionStart() {
+ return sel.RangeMain().Start();
+}
+
+SelectionPosition Editor::SelectionEnd() {
+ return sel.RangeMain().End();
+}
+
+void Editor::SetRectangularRange() {
+ if (sel.IsRectangular()) {
+ int xAnchor = XFromPosition(sel.Rectangular().anchor);
+ int xCaret = XFromPosition(sel.Rectangular().caret);
+ if (sel.selType == Selection::selThin) {
+ xCaret = xAnchor;
+ }
+ int lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position());
+ int lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position());
+ int increment = (lineCaret > lineAnchorRect) ? 1 : -1;
+ for (int line=lineAnchorRect; line != lineCaret+increment; line += increment) {
+ SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor));
+ if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) == 0)
+ range.ClearVirtualSpace();
+ if (line == lineAnchorRect)
+ sel.SetSelection(range);
+ else
+ sel.AddSelectionWithoutTrim(range);
+ }
+ }
+}
+
+void Editor::ThinRectangularRange() {
+ if (sel.IsRectangular()) {
+ sel.selType = Selection::selThin;
+ if (sel.Rectangular().caret < sel.Rectangular().anchor) {
+ sel.Rectangular() = SelectionRange(sel.Range(sel.Count()-1).caret, sel.Range(0).anchor);
+ } else {
+ sel.Rectangular() = SelectionRange(sel.Range(sel.Count()-1).anchor, sel.Range(0).caret);
+ }
+ SetRectangularRange();
+ }
+}
+
+void Editor::InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection) {
+ if (sel.Count() > 1 || !(sel.RangeMain().anchor == newMain.anchor) || sel.IsRectangular()) {
+ invalidateWholeSelection = true;
+ }
+ int firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position());
+ // +1 for lastAffected ensures caret repainted
+ int lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position());
+ lastAffected = Platform::Maximum(lastAffected, sel.RangeMain().End().Position());
+ if (invalidateWholeSelection) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ firstAffected = Platform::Minimum(firstAffected, sel.Range(r).caret.Position());
+ firstAffected = Platform::Minimum(firstAffected, sel.Range(r).anchor.Position());
+ lastAffected = Platform::Maximum(lastAffected, sel.Range(r).caret.Position()+1);
+ lastAffected = Platform::Maximum(lastAffected, sel.Range(r).anchor.Position());
+ }
+ }
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
+ InvalidateRange(firstAffected, lastAffected);
+}
+
+void Editor::SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_) {
+ currentPos_ = ClampPositionIntoDocument(currentPos_);
+ anchor_ = ClampPositionIntoDocument(anchor_);
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ /* For Line selection - ensure the anchor and caret are always
+ at the beginning and end of the region lines. */
+ if (sel.selType == Selection::selLines) {
+ if (currentPos_ > anchor_) {
+ anchor_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())));
+ currentPos_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())));
+ } else {
+ currentPos_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())));
+ anchor_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())));
+ }
+ }
+ SelectionRange rangeNew(currentPos_, anchor_);
+ if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) {
+ InvalidateSelection(rangeNew);
+ }
+ sel.RangeMain() = rangeNew;
+ SetRectangularRange();
+ ClaimSelection();
+ SetHoverIndicatorPosition(sel.MainCaret());
+
+ if (marginView.highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetSelection(int currentPos_, int anchor_) {
+ SetSelection(SelectionPosition(currentPos_), SelectionPosition(anchor_));
+}
+
+// Just move the caret on the main selection
+void Editor::SetSelection(SelectionPosition currentPos_) {
+ currentPos_ = ClampPositionIntoDocument(currentPos_);
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ if (sel.Count() > 1 || !(sel.RangeMain().caret == currentPos_)) {
+ InvalidateSelection(SelectionRange(currentPos_));
+ }
+ if (sel.IsRectangular()) {
+ sel.Rectangular() =
+ SelectionRange(SelectionPosition(currentPos_), sel.Rectangular().anchor);
+ SetRectangularRange();
+ } else {
+ sel.RangeMain() =
+ SelectionRange(SelectionPosition(currentPos_), sel.RangeMain().anchor);
+ }
+ ClaimSelection();
+ SetHoverIndicatorPosition(sel.MainCaret());
+
+ if (marginView.highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetSelection(int currentPos_) {
+ SetSelection(SelectionPosition(currentPos_));
+}
+
+void Editor::SetEmptySelection(SelectionPosition currentPos_) {
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ SelectionRange rangeNew(ClampPositionIntoDocument(currentPos_));
+ if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) {
+ InvalidateSelection(rangeNew);
+ }
+ sel.Clear();
+ sel.RangeMain() = rangeNew;
+ SetRectangularRange();
+ ClaimSelection();
+ SetHoverIndicatorPosition(sel.MainCaret());
+
+ if (marginView.highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetEmptySelection(int currentPos_) {
+ SetEmptySelection(SelectionPosition(currentPos_));
+}
+
+bool Editor::RangeContainsProtected(int start, int end) const {
+ if (vs.ProtectionActive()) {
+ if (start > end) {
+ int t = start;
+ start = end;
+ end = t;
+ }
+ for (int pos = start; pos < end; pos++) {
+ if (vs.styles[pdoc->StyleAt(pos)].IsProtected())
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Editor::SelectionContainsProtected() {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Asks document to find a good position and then moves out of any invisible positions.
+ */
+int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const {
+ return MovePositionOutsideChar(SelectionPosition(pos), moveDir, checkLineEnd).Position();
+}
+
+SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd) const {
+ int posMoved = pdoc->MovePositionOutsideChar(pos.Position(), moveDir, checkLineEnd);
+ if (posMoved != pos.Position())
+ pos.SetPosition(posMoved);
+ if (vs.ProtectionActive()) {
+ if (moveDir > 0) {
+ if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()) {
+ while ((pos.Position() < pdoc->Length()) &&
+ (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()))
+ pos.Add(1);
+ }
+ } else if (moveDir < 0) {
+ if (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()) {
+ while ((pos.Position() > 0) &&
+ (vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()))
+ pos.Add(-1);
+ }
+ }
+ }
+ return pos;
+}
+
+int Editor::MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, bool ensureVisible) {
+ bool simpleCaret = (sel.Count() == 1) && sel.Empty();
+ SelectionPosition spCaret = sel.Last();
+
+ int delta = newPos.Position() - sel.MainCaret();
+ newPos = ClampPositionIntoDocument(newPos);
+ newPos = MovePositionOutsideChar(newPos, delta);
+ if (!multipleSelection && sel.IsRectangular() && (selt == Selection::selStream)) {
+ // Can't turn into multiple selection so clear additional selections
+ InvalidateSelection(SelectionRange(newPos), true);
+ SelectionRange rangeMain = sel.RangeMain();
+ sel.SetSelection(rangeMain);
+ }
+ if (!sel.IsRectangular() && (selt == Selection::selRectangle)) {
+ // Switching to rectangular
+ InvalidateSelection(sel.RangeMain(), false);
+ SelectionRange rangeMain = sel.RangeMain();
+ sel.Clear();
+ sel.Rectangular() = rangeMain;
+ }
+ if (selt != Selection::noSel) {
+ sel.selType = selt;
+ }
+ if (selt != Selection::noSel || sel.MoveExtends()) {
+ SetSelection(newPos);
+ } else {
+ SetEmptySelection(newPos);
+ }
+ ShowCaretAtCurrentPosition();
+
+ int currentLine = pdoc->LineFromPosition(newPos.Position());
+ if (ensureVisible) {
+ // In case in need of wrapping to ensure DisplayFromDoc works.
+ if (currentLine >= wrapPending.start)
+ WrapLines(wsAll);
+ XYScrollPosition newXY = XYScrollToMakeVisible(
+ SelectionRange(posDrag.IsValid() ? posDrag : sel.RangeMain().caret), xysDefault);
+ if (simpleCaret && (newXY.xOffset == xOffset)) {
+ // simple vertical scroll then invalidate
+ ScrollTo(newXY.topLine);
+ InvalidateSelection(SelectionRange(spCaret), true);
+ } else {
+ SetXYScroll(newXY);
+ }
+ }
+
+ if (marginView.highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ return 0;
+}
+
+int Editor::MovePositionTo(int newPos, Selection::selTypes selt, bool ensureVisible) {
+ return MovePositionTo(SelectionPosition(newPos), selt, ensureVisible);
+}
+
+SelectionPosition Editor::MovePositionSoVisible(SelectionPosition pos, int moveDir) {
+ pos = ClampPositionIntoDocument(pos);
+ pos = MovePositionOutsideChar(pos, moveDir);
+ int lineDoc = pdoc->LineFromPosition(pos.Position());
+ if (cs.GetVisible(lineDoc)) {
+ return pos;
+ } else {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (moveDir > 0) {
+ // lineDisplay is already line before fold as lines in fold use display line of line after fold
+ lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed());
+ return SelectionPosition(pdoc->LineStart(cs.DocFromDisplay(lineDisplay)));
+ } else {
+ lineDisplay = Platform::Clamp(lineDisplay - 1, 0, cs.LinesDisplayed());
+ return SelectionPosition(pdoc->LineEnd(cs.DocFromDisplay(lineDisplay)));
+ }
+ }
+}
+
+SelectionPosition Editor::MovePositionSoVisible(int pos, int moveDir) {
+ return MovePositionSoVisible(SelectionPosition(pos), moveDir);
+}
+
+Point Editor::PointMainCaret() {
+ return LocationFromPosition(sel.Range(sel.Main()).caret);
+}
+
+/**
+ * Choose the x position that the caret will try to stick to
+ * as it moves up and down.
+ */
+void Editor::SetLastXChosen() {
+ Point pt = PointMainCaret();
+ lastXChosen = static_cast<int>(pt.x) + xOffset;
+}
+
+void Editor::ScrollTo(int line, bool moveThumb) {
+ int topLineNew = Platform::Clamp(line, 0, MaxScrollPos());
+ if (topLineNew != topLine) {
+ // Try to optimise small scrolls
+#ifndef UNDER_CE
+ int linesToMove = topLine - topLineNew;
+ bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting);
+ willRedrawAll = !performBlit;
+#endif
+ SetTopLine(topLineNew);
+ // Optimize by styling the view as this will invalidate any needed area
+ // which could abort the initial paint if discovered later.
+ StyleToPositionInView(PositionAfterArea(GetClientRectangle()));
+#ifndef UNDER_CE
+ // Perform redraw rather than scroll if many lines would be redrawn anyway.
+ if (performBlit) {
+ ScrollText(linesToMove);
+ } else {
+ Redraw();
+ }
+ willRedrawAll = false;
+#else
+ Redraw();
+#endif
+ if (moveThumb) {
+ SetVerticalScrollPos();
+ }
+ }
+}
+
+void Editor::ScrollText(int /* linesToMove */) {
+ //Platform::DebugPrintf("Editor::ScrollText %d\n", linesToMove);
+ Redraw();
+}
+
+void Editor::HorizontalScrollTo(int xPos) {
+ //Platform::DebugPrintf("HorizontalScroll %d\n", xPos);
+ if (xPos < 0)
+ xPos = 0;
+ if (!Wrapping() && (xOffset != xPos)) {
+ xOffset = xPos;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ SetHorizontalScrollPos();
+ RedrawRect(GetClientRectangle());
+ }
+}
+
+void Editor::VerticalCentreCaret() {
+ int lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret());
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ int newTop = lineDisplay - (LinesOnScreen() / 2);
+ if (topLine != newTop) {
+ SetTopLine(newTop > 0 ? newTop : 0);
+ RedrawRect(GetClientRectangle());
+ }
+}
+
+// Avoid 64 bit compiler warnings.
+// Scintilla does not support text buffers larger than 2**31
+static int istrlen(const char *s) {
+ return static_cast<int>(s ? strlen(s) : 0);
+}
+
+void Editor::MoveSelectedLines(int lineDelta) {
+
+ // if selection doesn't start at the beginning of the line, set the new start
+ int selectionStart = SelectionStart().Position();
+ int startLine = pdoc->LineFromPosition(selectionStart);
+ int beginningOfStartLine = pdoc->LineStart(startLine);
+ selectionStart = beginningOfStartLine;
+
+ // if selection doesn't end at the beginning of a line greater than that of the start,
+ // then set it at the beginning of the next one
+ int selectionEnd = SelectionEnd().Position();
+ int endLine = pdoc->LineFromPosition(selectionEnd);
+ int beginningOfEndLine = pdoc->LineStart(endLine);
+ bool appendEol = false;
+ if (selectionEnd > beginningOfEndLine
+ || selectionStart == selectionEnd) {
+ selectionEnd = pdoc->LineStart(endLine + 1);
+ appendEol = (selectionEnd == pdoc->Length() && pdoc->LineFromPosition(selectionEnd) == endLine);
+ }
+
+ // if there's nowhere for the selection to move
+ // (i.e. at the beginning going up or at the end going down),
+ // stop it right there!
+ if ((selectionStart == 0 && lineDelta < 0)
+ || (selectionEnd == pdoc->Length() && lineDelta > 0)
+ || selectionStart == selectionEnd) {
+ return;
+ }
+
+ UndoGroup ug(pdoc);
+
+ if (lineDelta > 0 && selectionEnd == pdoc->LineStart(pdoc->LinesTotal() - 1)) {
+ SetSelection(pdoc->MovePositionOutsideChar(selectionEnd - 1, -1), selectionEnd);
+ ClearSelection();
+ selectionEnd = CurrentPosition();
+ }
+ SetSelection(selectionStart, selectionEnd);
+
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+
+ int selectionLength = SelectionRange(selectionStart, selectionEnd).Length();
+ Point currentLocation = LocationFromPosition(CurrentPosition());
+ int currentLine = LineFromLocation(currentLocation);
+
+ if (appendEol)
+ SetSelection(pdoc->MovePositionOutsideChar(selectionStart - 1, -1), selectionEnd);
+ ClearSelection();
+
+ const char *eol = StringFromEOLMode(pdoc->eolMode);
+ if (currentLine + lineDelta >= pdoc->LinesTotal())
+ pdoc->InsertString(pdoc->Length(), eol, istrlen(eol));
+ GoToLine(currentLine + lineDelta);
+
+ selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectionLength);
+ if (appendEol) {
+ const int lengthInserted = pdoc->InsertString(CurrentPosition() + selectionLength, eol, istrlen(eol));
+ selectionLength += lengthInserted;
+ }
+ SetSelection(CurrentPosition(), CurrentPosition() + selectionLength);
+}
+
+void Editor::MoveSelectedLinesUp() {
+ MoveSelectedLines(-1);
+}
+
+void Editor::MoveSelectedLinesDown() {
+ MoveSelectedLines(1);
+}
+
+void Editor::MoveCaretInsideView(bool ensureVisible) {
+ PRectangle rcClient = GetTextRectangle();
+ Point pt = PointMainCaret();
+ if (pt.y < rcClient.top) {
+ MovePositionTo(SPositionFromLocation(
+ Point::FromInts(lastXChosen - xOffset, static_cast<int>(rcClient.top)),
+ false, false, UserVirtualSpace()),
+ Selection::noSel, ensureVisible);
+ } else if ((pt.y + vs.lineHeight - 1) > rcClient.bottom) {
+ int yOfLastLineFullyDisplayed = static_cast<int>(rcClient.top) + (LinesOnScreen() - 1) * vs.lineHeight;
+ MovePositionTo(SPositionFromLocation(
+ Point::FromInts(lastXChosen - xOffset, static_cast<int>(rcClient.top) + yOfLastLineFullyDisplayed),
+ false, false, UserVirtualSpace()),
+ Selection::noSel, ensureVisible);
+ }
+}
+
+int Editor::DisplayFromPosition(int pos) {
+ AutoSurface surface(this);
+ return view.DisplayFromPosition(surface, *this, pos, vs);
+}
+
+/**
+ * Ensure the caret is reasonably visible in context.
+ *
+Caret policy in SciTE
+
+If slop is set, we can define a slop value.
+This value defines an unwanted zone (UZ) where the caret is... unwanted.
+This zone is defined as a number of pixels near the vertical margins,
+and as a number of lines near the horizontal margins.
+By keeping the caret away from the edges, it is seen within its context,
+so it is likely that the identifier that the caret is on can be completely seen,
+and that the current line is seen with some of the lines following it which are
+often dependent on that line.
+
+If strict is set, the policy is enforced... strictly.
+The caret is centred on the display if slop is not set,
+and cannot go in the UZ if slop is set.
+
+If jumps is set, the display is moved more energetically
+so the caret can move in the same direction longer before the policy is applied again.
+'3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin.
+
+If even is not set, instead of having symmetrical UZs,
+the left and bottom UZs are extended up to right and top UZs respectively.
+This way, we favour the displaying of useful information: the beginning of lines,
+where most code reside, and the lines after the caret, eg. the body of a function.
+
+ | | | | |
+slop | strict | jumps | even | Caret can go to the margin | When reaching limit (caret going out of
+ | | | | | visibility or going into the UZ) display is...
+-----+--------+-------+------+--------------------------------------------+--------------------------------------------------------------
+ 0 | 0 | 0 | 0 | Yes | moved to put caret on top/on right
+ 0 | 0 | 0 | 1 | Yes | moved by one position
+ 0 | 0 | 1 | 0 | Yes | moved to put caret on top/on right
+ 0 | 0 | 1 | 1 | Yes | centred on the caret
+ 0 | 1 | - | 0 | Caret is always on top/on right of display | -
+ 0 | 1 | - | 1 | No, caret is always centred | -
+ 1 | 0 | 0 | 0 | Yes | moved to put caret out of the asymmetrical UZ
+ 1 | 0 | 0 | 1 | Yes | moved to put caret out of the UZ
+ 1 | 0 | 1 | 0 | Yes | moved to put caret at 3UZ of the top or right margin
+ 1 | 0 | 1 | 1 | Yes | moved to put caret at 3UZ of the margin
+ 1 | 1 | - | 0 | Caret is always at UZ of top/right margin | -
+ 1 | 1 | 0 | 1 | No, kept out of UZ | moved by one position
+ 1 | 1 | 1 | 1 | No, kept out of UZ | moved to put caret at 3UZ of the margin
+*/
+
+Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange &range, const XYScrollOptions options) {
+ PRectangle rcClient = GetTextRectangle();
+ Point pt = LocationFromPosition(range.caret);
+ Point ptAnchor = LocationFromPosition(range.anchor);
+ const Point ptOrigin = GetVisibleOriginInMain();
+ pt.x += ptOrigin.x;
+ pt.y += ptOrigin.y;
+ ptAnchor.x += ptOrigin.x;
+ ptAnchor.y += ptOrigin.y;
+ const Point ptBottomCaret(pt.x, pt.y + vs.lineHeight - 1);
+
+ XYScrollPosition newXY(xOffset, topLine);
+ if (rcClient.Empty()) {
+ return newXY;
+ }
+
+ // Vertical positioning
+ if ((options & xysVertical) && (pt.y < rcClient.top || ptBottomCaret.y >= rcClient.bottom || (caretYPolicy & CARET_STRICT) != 0)) {
+ const int lineCaret = DisplayFromPosition(range.caret.Position());
+ const int linesOnScreen = LinesOnScreen();
+ const int halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2;
+ const bool bSlop = (caretYPolicy & CARET_SLOP) != 0;
+ const bool bStrict = (caretYPolicy & CARET_STRICT) != 0;
+ const bool bJump = (caretYPolicy & CARET_JUMPS) != 0;
+ const bool bEven = (caretYPolicy & CARET_EVEN) != 0;
+
+ // It should be possible to scroll the window to show the caret,
+ // but this fails to remove the caret on GTK+
+ if (bSlop) { // A margin is defined
+ int yMoveT, yMoveB;
+ if (bStrict) {
+ int yMarginT, yMarginB;
+ if (!(options & xysUseMargin)) {
+ // In drag mode, avoid moves
+ // otherwise, a double click will select several lines.
+ yMarginT = yMarginB = 0;
+ } else {
+ // yMarginT must equal to caretYSlop, with a minimum of 1 and
+ // a maximum of slightly less than half the heigth of the text area.
+ yMarginT = Platform::Clamp(caretYSlop, 1, halfScreen);
+ if (bEven) {
+ yMarginB = yMarginT;
+ } else {
+ yMarginB = linesOnScreen - yMarginT - 1;
+ }
+ }
+ yMoveT = yMarginT;
+ if (bEven) {
+ if (bJump) {
+ yMoveT = Platform::Clamp(caretYSlop * 3, 1, halfScreen);
+ }
+ yMoveB = yMoveT;
+ } else {
+ yMoveB = linesOnScreen - yMoveT - 1;
+ }
+ if (lineCaret < topLine + yMarginT) {
+ // Caret goes too high
+ newXY.topLine = lineCaret - yMoveT;
+ } else if (lineCaret > topLine + linesOnScreen - 1 - yMarginB) {
+ // Caret goes too low
+ newXY.topLine = lineCaret - linesOnScreen + 1 + yMoveB;
+ }
+ } else { // Not strict
+ yMoveT = bJump ? caretYSlop * 3 : caretYSlop;
+ yMoveT = Platform::Clamp(yMoveT, 1, halfScreen);
+ if (bEven) {
+ yMoveB = yMoveT;
+ } else {
+ yMoveB = linesOnScreen - yMoveT - 1;
+ }
+ if (lineCaret < topLine) {
+ // Caret goes too high
+ newXY.topLine = lineCaret - yMoveT;
+ } else if (lineCaret > topLine + linesOnScreen - 1) {
+ // Caret goes too low
+ newXY.topLine = lineCaret - linesOnScreen + 1 + yMoveB;
+ }
+ }
+ } else { // No slop
+ if (!bStrict && !bJump) {
+ // Minimal move
+ if (lineCaret < topLine) {
+ // Caret goes too high
+ newXY.topLine = lineCaret;
+ } else if (lineCaret > topLine + linesOnScreen - 1) {
+ // Caret goes too low
+ if (bEven) {
+ newXY.topLine = lineCaret - linesOnScreen + 1;
+ } else {
+ newXY.topLine = lineCaret;
+ }
+ }
+ } else { // Strict or going out of display
+ if (bEven) {
+ // Always center caret
+ newXY.topLine = lineCaret - halfScreen;
+ } else {
+ // Always put caret on top of display
+ newXY.topLine = lineCaret;
+ }
+ }
+ }
+ if (!(range.caret == range.anchor)) {
+ const int lineAnchor = DisplayFromPosition(range.anchor.Position());
+ if (lineAnchor < lineCaret) {
+ // Shift up to show anchor or as much of range as possible
+ newXY.topLine = std::min(newXY.topLine, lineAnchor);
+ newXY.topLine = std::max(newXY.topLine, lineCaret - LinesOnScreen());
+ } else {
+ // Shift down to show anchor or as much of range as possible
+ newXY.topLine = std::max(newXY.topLine, lineAnchor - LinesOnScreen());
+ newXY.topLine = std::min(newXY.topLine, lineCaret);
+ }
+ }
+ newXY.topLine = Platform::Clamp(newXY.topLine, 0, MaxScrollPos());
+ }
+
+ // Horizontal positioning
+ if ((options & xysHorizontal) && !Wrapping()) {
+ const int halfScreen = Platform::Maximum(static_cast<int>(rcClient.Width()) - 4, 4) / 2;
+ const bool bSlop = (caretXPolicy & CARET_SLOP) != 0;
+ const bool bStrict = (caretXPolicy & CARET_STRICT) != 0;
+ const bool bJump = (caretXPolicy & CARET_JUMPS) != 0;
+ const bool bEven = (caretXPolicy & CARET_EVEN) != 0;
+
+ if (bSlop) { // A margin is defined
+ int xMoveL, xMoveR;
+ if (bStrict) {
+ int xMarginL, xMarginR;
+ if (!(options & xysUseMargin)) {
+ // In drag mode, avoid moves unless very near of the margin
+ // otherwise, a simple click will select text.
+ xMarginL = xMarginR = 2;
+ } else {
+ // xMargin must equal to caretXSlop, with a minimum of 2 and
+ // a maximum of slightly less than half the width of the text area.
+ xMarginR = Platform::Clamp(caretXSlop, 2, halfScreen);
+ if (bEven) {
+ xMarginL = xMarginR;
+ } else {
+ xMarginL = static_cast<int>(rcClient.Width()) - xMarginR - 4;
+ }
+ }
+ if (bJump && bEven) {
+ // Jump is used only in even mode
+ xMoveL = xMoveR = Platform::Clamp(caretXSlop * 3, 1, halfScreen);
+ } else {
+ xMoveL = xMoveR = 0; // Not used, avoid a warning
+ }
+ if (pt.x < rcClient.left + xMarginL) {
+ // Caret is on the left of the display
+ if (bJump && bEven) {
+ newXY.xOffset -= xMoveL;
+ } else {
+ // Move just enough to allow to display the caret
+ newXY.xOffset -= static_cast<int>((rcClient.left + xMarginL) - pt.x);
+ }
+ } else if (pt.x >= rcClient.right - xMarginR) {
+ // Caret is on the right of the display
+ if (bJump && bEven) {
+ newXY.xOffset += xMoveR;
+ } else {
+ // Move just enough to allow to display the caret
+ newXY.xOffset += static_cast<int>(pt.x - (rcClient.right - xMarginR) + 1);
+ }
+ }
+ } else { // Not strict
+ xMoveR = bJump ? caretXSlop * 3 : caretXSlop;
+ xMoveR = Platform::Clamp(xMoveR, 1, halfScreen);
+ if (bEven) {
+ xMoveL = xMoveR;
+ } else {
+ xMoveL = static_cast<int>(rcClient.Width()) - xMoveR - 4;
+ }
+ if (pt.x < rcClient.left) {
+ // Caret is on the left of the display
+ newXY.xOffset -= xMoveL;
+ } else if (pt.x >= rcClient.right) {
+ // Caret is on the right of the display
+ newXY.xOffset += xMoveR;
+ }
+ }
+ } else { // No slop
+ if (bStrict ||
+ (bJump && (pt.x < rcClient.left || pt.x >= rcClient.right))) {
+ // Strict or going out of display
+ if (bEven) {
+ // Center caret
+ newXY.xOffset += static_cast<int>(pt.x - rcClient.left - halfScreen);
+ } else {
+ // Put caret on right
+ newXY.xOffset += static_cast<int>(pt.x - rcClient.right + 1);
+ }
+ } else {
+ // Move just enough to allow to display the caret
+ if (pt.x < rcClient.left) {
+ // Caret is on the left of the display
+ if (bEven) {
+ newXY.xOffset -= static_cast<int>(rcClient.left - pt.x);
+ } else {
+ newXY.xOffset += static_cast<int>(pt.x - rcClient.right) + 1;
+ }
+ } else if (pt.x >= rcClient.right) {
+ // Caret is on the right of the display
+ newXY.xOffset += static_cast<int>(pt.x - rcClient.right) + 1;
+ }
+ }
+ }
+ // In case of a jump (find result) largely out of display, adjust the offset to display the caret
+ if (pt.x + xOffset < rcClient.left + newXY.xOffset) {
+ newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.left) - 2;
+ } else if (pt.x + xOffset >= rcClient.right + newXY.xOffset) {
+ newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 2;
+ if ((vs.caretStyle == CARETSTYLE_BLOCK) || view.imeCaretBlockOverride) {
+ // Ensure we can see a good portion of the block caret
+ newXY.xOffset += static_cast<int>(vs.aveCharWidth);
+ }
+ }
+ if (!(range.caret == range.anchor)) {
+ if (ptAnchor.x < pt.x) {
+ // Shift to left to show anchor or as much of range as possible
+ int maxOffset = static_cast<int>(ptAnchor.x + xOffset - rcClient.left) - 1;
+ int minOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 1;
+ newXY.xOffset = std::min(newXY.xOffset, maxOffset);
+ newXY.xOffset = std::max(newXY.xOffset, minOffset);
+ } else {
+ // Shift to right to show anchor or as much of range as possible
+ int minOffset = static_cast<int>(ptAnchor.x + xOffset - rcClient.right) + 1;
+ int maxOffset = static_cast<int>(pt.x + xOffset - rcClient.left) - 1;
+ newXY.xOffset = std::max(newXY.xOffset, minOffset);
+ newXY.xOffset = std::min(newXY.xOffset, maxOffset);
+ }
+ }
+ if (newXY.xOffset < 0) {
+ newXY.xOffset = 0;
+ }
+ }
+
+ return newXY;
+}
+
+void Editor::SetXYScroll(XYScrollPosition newXY) {
+ if ((newXY.topLine != topLine) || (newXY.xOffset != xOffset)) {
+ if (newXY.topLine != topLine) {
+ SetTopLine(newXY.topLine);
+ SetVerticalScrollPos();
+ }
+ if (newXY.xOffset != xOffset) {
+ xOffset = newXY.xOffset;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ if (newXY.xOffset > 0) {
+ PRectangle rcText = GetTextRectangle();
+ if (horizontalScrollBarVisible &&
+ rcText.Width() + xOffset > scrollWidth) {
+ scrollWidth = xOffset + static_cast<int>(rcText.Width());
+ SetScrollBars();
+ }
+ }
+ SetHorizontalScrollPos();
+ }
+ Redraw();
+ UpdateSystemCaret();
+ }
+}
+
+void Editor::ScrollRange(SelectionRange range) {
+ SetXYScroll(XYScrollToMakeVisible(range, xysDefault));
+}
+
+void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {
+ SetXYScroll(XYScrollToMakeVisible(SelectionRange(posDrag.IsValid() ? posDrag : sel.RangeMain().caret),
+ static_cast<XYScrollOptions>((useMargin?xysUseMargin:0)|(vert?xysVertical:0)|(horiz?xysHorizontal:0))));
+}
+
+void Editor::ShowCaretAtCurrentPosition() {
+ if (hasFocus) {
+ caret.active = true;
+ caret.on = true;
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ if (caret.period > 0)
+ FineTickerStart(tickCaret, caret.period, caret.period/10);
+ } else {
+ SetTicking(true);
+ }
+ } else {
+ caret.active = false;
+ caret.on = false;
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ }
+ }
+ InvalidateCaret();
+}
+
+void Editor::DropCaret() {
+ caret.active = false;
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ }
+ InvalidateCaret();
+}
+
+void Editor::CaretSetPeriod(int period) {
+ if (caret.period != period) {
+ caret.period = period;
+ caret.on = true;
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ if ((caret.active) && (caret.period > 0))
+ FineTickerStart(tickCaret, caret.period, caret.period/10);
+ }
+ InvalidateCaret();
+ }
+}
+
+void Editor::InvalidateCaret() {
+ if (posDrag.IsValid()) {
+ InvalidateRange(posDrag.Position(), posDrag.Position() + 1);
+ } else {
+ for (size_t r=0; r<sel.Count(); r++) {
+ InvalidateRange(sel.Range(r).caret.Position(), sel.Range(r).caret.Position() + 1);
+ }
+ }
+ UpdateSystemCaret();
+}
+
+void Editor::UpdateSystemCaret() {
+}
+
+bool Editor::Wrapping() const {
+ return vs.wrapState != eWrapNone;
+}
+
+void Editor::NeedWrapping(int docLineStart, int docLineEnd) {
+//Platform::DebugPrintf("\nNeedWrapping: %0d..%0d\n", docLineStart, docLineEnd);
+ if (wrapPending.AddRange(docLineStart, docLineEnd)) {
+ view.llc.Invalidate(LineLayout::llPositions);
+ }
+ // Wrap lines during idle.
+ if (Wrapping() && wrapPending.NeedsWrap()) {
+ SetIdle(true);
+ }
+}
+
+bool Editor::WrapOneLine(Surface *surface, int lineToWrap) {
+ AutoLineLayout ll(view.llc, view.RetrieveLineLayout(lineToWrap, *this));
+ int linesWrapped = 1;
+ if (ll) {
+ view.LayoutLine(*this, lineToWrap, surface, vs, ll, wrapWidth);
+ linesWrapped = ll->lines;
+ }
+ return cs.SetHeight(lineToWrap, linesWrapped +
+ (vs.annotationVisible ? pdoc->AnnotationLines(lineToWrap) : 0));
+}
+
+// Perform wrapping for a subset of the lines needing wrapping.
+// wsAll: wrap all lines which need wrapping in this single call
+// wsVisible: wrap currently visible lines
+// wsIdle: wrap one page + 100 lines
+// Return true if wrapping occurred.
+bool Editor::WrapLines(enum wrapScope ws) {
+ int goodTopLine = topLine;
+ bool wrapOccurred = false;
+ if (!Wrapping()) {
+ if (wrapWidth != LineLayout::wrapWidthInfinite) {
+ wrapWidth = LineLayout::wrapWidthInfinite;
+ for (int lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) {
+ cs.SetHeight(lineDoc, 1 +
+ (vs.annotationVisible ? pdoc->AnnotationLines(lineDoc) : 0));
+ }
+ wrapOccurred = true;
+ }
+ wrapPending.Reset();
+
+ } else if (wrapPending.NeedsWrap()) {
+ wrapPending.start = std::min(wrapPending.start, pdoc->LinesTotal());
+ if (!SetIdle(true)) {
+ // Idle processing not supported so full wrap required.
+ ws = wsAll;
+ }
+ // Decide where to start wrapping
+ int lineToWrap = wrapPending.start;
+ int lineToWrapEnd = std::min(wrapPending.end, pdoc->LinesTotal());
+ const int lineDocTop = cs.DocFromDisplay(topLine);
+ const int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop);
+ if (ws == wsVisible) {
+ lineToWrap = Platform::Clamp(lineDocTop-5, wrapPending.start, pdoc->LinesTotal());
+ // Priority wrap to just after visible area.
+ // Since wrapping could reduce display lines, treat each
+ // as taking only one display line.
+ lineToWrapEnd = lineDocTop;
+ int lines = LinesOnScreen() + 1;
+ while ((lineToWrapEnd < cs.LinesInDoc()) && (lines>0)) {
+ if (cs.GetVisible(lineToWrapEnd))
+ lines--;
+ lineToWrapEnd++;
+ }
+ // .. and if the paint window is outside pending wraps
+ if ((lineToWrap > wrapPending.end) || (lineToWrapEnd < wrapPending.start)) {
+ // Currently visible text does not need wrapping
+ return false;
+ }
+ } else if (ws == wsIdle) {
+ lineToWrapEnd = lineToWrap + LinesOnScreen() + 100;
+ }
+ const int lineEndNeedWrap = std::min(wrapPending.end, pdoc->LinesTotal());
+ lineToWrapEnd = std::min(lineToWrapEnd, lineEndNeedWrap);
+
+ // Ensure all lines being wrapped are styled.
+ pdoc->EnsureStyledTo(pdoc->LineStart(lineToWrapEnd));
+
+ if (lineToWrap < lineToWrapEnd) {
+
+ PRectangle rcTextArea = GetClientRectangle();
+ rcTextArea.left = static_cast<XYPOSITION>(vs.textStart);
+ rcTextArea.right -= vs.rightMarginWidth;
+ wrapWidth = static_cast<int>(rcTextArea.Width());
+ RefreshStyleData();
+ AutoSurface surface(this);
+ if (surface) {
+//Platform::DebugPrintf("Wraplines: scope=%0d need=%0d..%0d perform=%0d..%0d\n", ws, wrapPending.start, wrapPending.end, lineToWrap, lineToWrapEnd);
+
+ while (lineToWrap < lineToWrapEnd) {
+ if (WrapOneLine(surface, lineToWrap)) {
+ wrapOccurred = true;
+ }
+ wrapPending.Wrapped(lineToWrap);
+ lineToWrap++;
+ }
+
+ goodTopLine = cs.DisplayFromDoc(lineDocTop) + std::min(subLineTop, cs.GetHeight(lineDocTop)-1);
+ }
+ }
+
+ // If wrapping is done, bring it to resting position
+ if (wrapPending.start >= lineEndNeedWrap) {
+ wrapPending.Reset();
+ }
+ }
+
+ if (wrapOccurred) {
+ SetScrollBars();
+ SetTopLine(Platform::Clamp(goodTopLine, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ }
+
+ return wrapOccurred;
+}
+
+void Editor::LinesJoin() {
+ if (!RangeContainsProtected(targetStart, targetEnd)) {
+ UndoGroup ug(pdoc);
+ bool prevNonWS = true;
+ for (int pos = targetStart; pos < targetEnd; pos++) {
+ if (pdoc->IsPositionInLineEnd(pos)) {
+ targetEnd -= pdoc->LenChar(pos);
+ pdoc->DelChar(pos);
+ if (prevNonWS) {
+ // Ensure at least one space separating previous lines
+ const int lengthInserted = pdoc->InsertString(pos, " ", 1);
+ targetEnd += lengthInserted;
+ }
+ } else {
+ prevNonWS = pdoc->CharAt(pos) != ' ';
+ }
+ }
+ }
+}
+
+const char *Editor::StringFromEOLMode(int eolMode) {
+ if (eolMode == SC_EOL_CRLF) {
+ return "\r\n";
+ } else if (eolMode == SC_EOL_CR) {
+ return "\r";
+ } else {
+ return "\n";
+ }
+}
+
+void Editor::LinesSplit(int pixelWidth) {
+ if (!RangeContainsProtected(targetStart, targetEnd)) {
+ if (pixelWidth == 0) {
+ PRectangle rcText = GetTextRectangle();
+ pixelWidth = static_cast<int>(rcText.Width());
+ }
+ int lineStart = pdoc->LineFromPosition(targetStart);
+ int lineEnd = pdoc->LineFromPosition(targetEnd);
+ const char *eol = StringFromEOLMode(pdoc->eolMode);
+ UndoGroup ug(pdoc);
+ for (int line = lineStart; line <= lineEnd; line++) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this));
+ if (surface && ll) {
+ unsigned int posLineStart = pdoc->LineStart(line);
+ view.LayoutLine(*this, line, surface, vs, ll, pixelWidth);
+ int lengthInsertedTotal = 0;
+ for (int subLine = 1; subLine < ll->lines; subLine++) {
+ const int lengthInserted = pdoc->InsertString(
+ static_cast<int>(posLineStart + lengthInsertedTotal +
+ ll->LineStart(subLine)),
+ eol, istrlen(eol));
+ targetEnd += lengthInserted;
+ lengthInsertedTotal += lengthInserted;
+ }
+ }
+ lineEnd = pdoc->LineFromPosition(targetEnd);
+ }
+ }
+}
+
+void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
+ if (vs.fixedColumnWidth == 0)
+ return;
+
+ AllocateGraphics();
+ RefreshStyleData();
+ RefreshPixMaps(surfWindow);
+
+ // On GTK+ with Ubuntu overlay scroll bars, the surface may have been finished
+ // at this point. The Initialised call checks for this case and sets the status
+ // to be bad which avoids crashes in following calls.
+ if (!surfWindow->Initialised()) {
+ return;
+ }
+
+ PRectangle rcMargin = GetClientRectangle();
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcMargin.Move(0, -ptOrigin.y);
+ rcMargin.left = 0;
+ rcMargin.right = static_cast<XYPOSITION>(vs.fixedColumnWidth);
+
+ if (!rc.Intersects(rcMargin))
+ return;
+
+ Surface *surface;
+ if (view.bufferedDraw) {
+ surface = marginView.pixmapSelMargin;
+ } else {
+ surface = surfWindow;
+ }
+
+ // Clip vertically to paint area to avoid drawing line numbers
+ if (rcMargin.bottom > rc.bottom)
+ rcMargin.bottom = rc.bottom;
+ if (rcMargin.top < rc.top)
+ rcMargin.top = rc.top;
+
+ marginView.PaintMargin(surface, topLine, rc, rcMargin, *this, vs);
+
+ if (view.bufferedDraw) {
+ surfWindow->Copy(rcMargin, Point(rcMargin.left, rcMargin.top), *marginView.pixmapSelMargin);
+ }
+}
+
+void Editor::RefreshPixMaps(Surface *surfaceWindow) {
+ view.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs);
+ marginView.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs);
+ if (view.bufferedDraw) {
+ PRectangle rcClient = GetClientRectangle();
+ if (!view.pixmapLine->Initialised()) {
+
+ view.pixmapLine->InitPixMap(static_cast<int>(rcClient.Width()), vs.lineHeight,
+ surfaceWindow, wMain.GetID());
+ }
+ if (!marginView.pixmapSelMargin->Initialised()) {
+ marginView.pixmapSelMargin->InitPixMap(vs.fixedColumnWidth,
+ static_cast<int>(rcClient.Height()), surfaceWindow, wMain.GetID());
+ }
+ }
+}
+
+void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
+ //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n",
+ // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
+ AllocateGraphics();
+
+ RefreshStyleData();
+ if (paintState == paintAbandoned)
+ return; // Scroll bars may have changed so need redraw
+ RefreshPixMaps(surfaceWindow);
+
+ paintAbandonedByStyling = false;
+
+ StyleToPositionInView(PositionAfterArea(rcArea));
+
+ PRectangle rcClient = GetClientRectangle();
+ //Platform::DebugPrintf("Client: (%3d,%3d) ... (%3d,%3d) %d\n",
+ // rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
+
+ if (NotifyUpdateUI()) {
+ RefreshStyleData();
+ RefreshPixMaps(surfaceWindow);
+ }
+
+ // Wrap the visible lines if needed.
+ if (WrapLines(wsVisible)) {
+ // The wrapping process has changed the height of some lines so
+ // abandon this paint for a complete repaint.
+ if (AbandonPaint()) {
+ return;
+ }
+ RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change
+ }
+ PLATFORM_ASSERT(marginView.pixmapSelPattern->Initialised());
+
+ if (!view.bufferedDraw)
+ surfaceWindow->SetClip(rcArea);
+
+ if (paintState != paintAbandoned) {
+ if (vs.marginInside) {
+ PaintSelMargin(surfaceWindow, rcArea);
+ PRectangle rcRightMargin = rcClient;
+ rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
+ if (rcArea.Intersects(rcRightMargin)) {
+ surfaceWindow->FillRectangle(rcRightMargin, vs.styles[STYLE_DEFAULT].back);
+ }
+ } else { // Else separate view so separate paint event but leftMargin included to allow overlap
+ PRectangle rcLeftMargin = rcArea;
+ rcLeftMargin.left = 0;
+ rcLeftMargin.right = rcLeftMargin.left + vs.leftMarginWidth;
+ if (rcArea.Intersects(rcLeftMargin)) {
+ surfaceWindow->FillRectangle(rcLeftMargin, vs.styles[STYLE_DEFAULT].back);
+ }
+ }
+ }
+
+ if (paintState == paintAbandoned) {
+ // Either styling or NotifyUpdateUI noticed that painting is needed
+ // outside the current painting rectangle
+ //Platform::DebugPrintf("Abandoning paint\n");
+ if (Wrapping()) {
+ if (paintAbandonedByStyling) {
+ // Styling has spilled over a line end, such as occurs by starting a multiline
+ // comment. The width of subsequent text may have changed, so rewrap.
+ NeedWrapping(cs.DocFromDisplay(topLine));
+ }
+ }
+ return;
+ }
+
+ view.PaintText(surfaceWindow, *this, rcArea, rcClient, vs);
+
+ if (horizontalScrollBarVisible && trackLineWidth && (view.lineWidthMaxSeen > scrollWidth)) {
+ if (FineTickerAvailable()) {
+ scrollWidth = view.lineWidthMaxSeen;
+ if (!FineTickerRunning(tickWiden)) {
+ FineTickerStart(tickWiden, 50, 5);
+ }
+ }
+ }
+
+ NotifyPainted();
+}
+
+// This is mostly copied from the Paint method but with some things omitted
+// such as the margin markers, line numbers, selection and caret
+// Should be merged back into a combined Draw method.
+long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
+ if (!pfr)
+ return 0;
+
+ AutoSurface surface(pfr->hdc, this, SC_TECHNOLOGY_DEFAULT);
+ if (!surface)
+ return 0;
+ AutoSurface surfaceMeasure(pfr->hdcTarget, this, SC_TECHNOLOGY_DEFAULT);
+ if (!surfaceMeasure) {
+ return 0;
+ }
+ return view.FormatRange(draw, pfr, surface, surfaceMeasure, *this, vs);
+}
+
+int Editor::TextWidth(int style, const char *text) {
+ RefreshStyleData();
+ AutoSurface surface(this);
+ if (surface) {
+ return static_cast<int>(surface->WidthText(vs.styles[style].font, text, istrlen(text)));
+ } else {
+ return 1;
+ }
+}
+
+// Empty method is overridden on GTK+ to show / hide scrollbars
+void Editor::ReconfigureScrollBars() {}
+
+void Editor::SetScrollBars() {
+ RefreshStyleData();
+
+ int nMax = MaxScrollPos();
+ int nPage = LinesOnScreen();
+ bool modified = ModifyScrollBars(nMax + nPage - 1, nPage);
+ if (modified) {
+ DwellEnd(true);
+ }
+
+ // TODO: ensure always showing as many lines as possible
+ // May not be, if, for example, window made larger
+ if (topLine > MaxScrollPos()) {
+ SetTopLine(Platform::Clamp(topLine, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ if (modified) {
+ if (!AbandonPaint())
+ Redraw();
+ }
+ //Platform::DebugPrintf("end max = %d page = %d\n", nMax, nPage);
+}
+
+void Editor::ChangeSize() {
+ DropGraphics(false);
+ SetScrollBars();
+ if (Wrapping()) {
+ PRectangle rcTextArea = GetClientRectangle();
+ rcTextArea.left = static_cast<XYPOSITION>(vs.textStart);
+ rcTextArea.right -= vs.rightMarginWidth;
+ if (wrapWidth != rcTextArea.Width()) {
+ NeedWrapping();
+ Redraw();
+ }
+ }
+}
+
+int Editor::InsertSpace(int position, unsigned int spaces) {
+ if (spaces > 0) {
+ std::string spaceText(spaces, ' ');
+ const int lengthInserted = pdoc->InsertString(position, spaceText.c_str(), spaces);
+ position += lengthInserted;
+ }
+ return position;
+}
+
+void Editor::AddChar(char ch) {
+ char s[2];
+ s[0] = ch;
+ s[1] = '\0';
+ AddCharUTF(s, 1);
+}
+
+void Editor::FilterSelections() {
+ if (!additionalSelectionTyping && (sel.Count() > 1)) {
+ SelectionRange rangeOnly = sel.RangeMain();
+ InvalidateSelection(rangeOnly, true);
+ sel.SetSelection(rangeOnly);
+ }
+}
+
+static bool cmpSelPtrs(const SelectionRange *a, const SelectionRange *b) {
+ return *a < *b;
+}
+
+// AddCharUTF inserts an array of bytes which may or may not be in UTF-8.
+void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
+ FilterSelections();
+ {
+ UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty() || inOverstrike);
+
+ // Vector elements point into selection in order to change selection.
+ std::vector<SelectionRange *> selPtrs;
+ for (size_t r = 0; r < sel.Count(); r++) {
+ selPtrs.push_back(&sel.Range(r));
+ }
+ // Order selections by position in document.
+ std::sort(selPtrs.begin(), selPtrs.end(), cmpSelPtrs);
+
+ // Loop in reverse to avoid disturbing positions of selections yet to be processed.
+ for (std::vector<SelectionRange *>::reverse_iterator rit = selPtrs.rbegin();
+ rit != selPtrs.rend(); ++rit) {
+ SelectionRange *currentSel = *rit;
+ if (!RangeContainsProtected(currentSel->Start().Position(),
+ currentSel->End().Position())) {
+ int positionInsert = currentSel->Start().Position();
+ if (!currentSel->Empty()) {
+ if (currentSel->Length()) {
+ pdoc->DeleteChars(positionInsert, currentSel->Length());
+ currentSel->ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ currentSel->MinimizeVirtualSpace();
+ }
+ } else if (inOverstrike) {
+ if (positionInsert < pdoc->Length()) {
+ if (!pdoc->IsPositionInLineEnd(positionInsert)) {
+ pdoc->DelChar(positionInsert);
+ currentSel->ClearVirtualSpace();
+ }
+ }
+ }
+ positionInsert = InsertSpace(positionInsert, currentSel->caret.VirtualSpace());
+ const int lengthInserted = pdoc->InsertString(positionInsert, s, len);
+ if (lengthInserted > 0) {
+ currentSel->caret.SetPosition(positionInsert + lengthInserted);
+ currentSel->anchor.SetPosition(positionInsert + lengthInserted);
+ }
+ currentSel->ClearVirtualSpace();
+ // If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
+ if (Wrapping()) {
+ AutoSurface surface(this);
+ if (surface) {
+ if (WrapOneLine(surface, pdoc->LineFromPosition(positionInsert))) {
+ SetScrollBars();
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ }
+ }
+ }
+ }
+ }
+ if (Wrapping()) {
+ SetScrollBars();
+ }
+ ThinRectangularRange();
+ // If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
+ EnsureCaretVisible();
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+ if ((caretSticky == SC_CARETSTICKY_OFF) ||
+ ((caretSticky == SC_CARETSTICKY_WHITESPACE) && !IsAllSpacesOrTabs(s, len))) {
+ SetLastXChosen();
+ }
+
+ if (treatAsDBCS) {
+ NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
+ static_cast<unsigned char>(s[1]));
+ } else if (len > 0) {
+ int byte = static_cast<unsigned char>(s[0]);
+ if ((byte < 0xC0) || (1 == len)) {
+ // Handles UTF-8 characters between 0x01 and 0x7F and single byte
+ // characters when not in UTF-8 mode.
+ // Also treats \0 and naked trail bytes 0x80 to 0xBF as valid
+ // characters representing themselves.
+ } else {
+ unsigned int utf32[1] = { 0 };
+ UTF32FromUTF8(s, len, utf32, ELEMENTS(utf32));
+ byte = utf32[0];
+ }
+ NotifyChar(byte);
+ }
+
+ if (recordingMacro) {
+ NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(s));
+ }
+}
+
+void Editor::FillVirtualSpace() {
+ const bool tmpOverstrike = inOverstrike;
+ inOverstrike = false; // not allow to be deleted twice.
+ AddCharUTF("", 0);
+ inOverstrike = tmpOverstrike;
+}
+
+void Editor::InsertPaste(const char *text, int len) {
+ if (multiPasteMode == SC_MULTIPASTE_ONCE) {
+ SelectionPosition selStart = sel.Start();
+ selStart = SelectionPosition(InsertSpace(selStart.Position(), selStart.VirtualSpace()));
+ const int lengthInserted = pdoc->InsertString(selStart.Position(), text, len);
+ if (lengthInserted > 0) {
+ SetEmptySelection(selStart.Position() + lengthInserted);
+ }
+ } else {
+ // SC_MULTIPASTE_EACH
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ int positionInsert = sel.Range(r).Start().Position();
+ if (!sel.Range(r).Empty()) {
+ if (sel.Range(r).Length()) {
+ pdoc->DeleteChars(positionInsert, sel.Range(r).Length());
+ sel.Range(r).ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ sel.Range(r).MinimizeVirtualSpace();
+ }
+ }
+ positionInsert = InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace());
+ const int lengthInserted = pdoc->InsertString(positionInsert, text, len);
+ if (lengthInserted > 0) {
+ sel.Range(r).caret.SetPosition(positionInsert + lengthInserted);
+ sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted);
+ }
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ }
+}
+
+void Editor::InsertPasteShape(const char *text, int len, PasteShape shape) {
+ std::string convertedText;
+ if (convertPastes) {
+ // Convert line endings of the paste into our local line-endings mode
+ convertedText = Document::TransformLineEnds(text, len, pdoc->eolMode);
+ len = static_cast<int>(convertedText.length());
+ text = convertedText.c_str();
+ }
+ if (shape == pasteRectangular) {
+ PasteRectangular(sel.Start(), text, len);
+ } else {
+ if (shape == pasteLine) {
+ int insertPos = pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret()));
+ int lengthInserted = pdoc->InsertString(insertPos, text, len);
+ // add the newline if necessary
+ if ((len > 0) && (text[len - 1] != '\n' && text[len - 1] != '\r')) {
+ const char *endline = StringFromEOLMode(pdoc->eolMode);
+ int length = static_cast<int>(strlen(endline));
+ lengthInserted += pdoc->InsertString(insertPos + lengthInserted, endline, length);
+ }
+ if (sel.MainCaret() == insertPos) {
+ SetEmptySelection(sel.MainCaret() + lengthInserted);
+ }
+ } else {
+ InsertPaste(text, len);
+ }
+ }
+}
+
+void Editor::ClearSelection(bool retainMultipleSelections) {
+ if (!sel.IsRectangular() && !retainMultipleSelections)
+ FilterSelections();
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!sel.Range(r).Empty()) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ pdoc->DeleteChars(sel.Range(r).Start().Position(),
+ sel.Range(r).Length());
+ sel.Range(r) = SelectionRange(sel.Range(r).Start());
+ }
+ }
+ }
+ ThinRectangularRange();
+ sel.RemoveDuplicates();
+ ClaimSelection();
+ SetHoverIndicatorPosition(sel.MainCaret());
+}
+
+void Editor::ClearAll() {
+ {
+ UndoGroup ug(pdoc);
+ if (0 != pdoc->Length()) {
+ pdoc->DeleteChars(0, pdoc->Length());
+ }
+ if (!pdoc->IsReadOnly()) {
+ cs.Clear();
+ pdoc->AnnotationClearAll();
+ pdoc->MarginClearAll();
+ }
+ }
+
+ view.ClearAllTabstops();
+
+ sel.Clear();
+ SetTopLine(0);
+ SetVerticalScrollPos();
+ InvalidateStyleRedraw();
+}
+
+void Editor::ClearDocumentStyle() {
+ Decoration *deco = pdoc->decorations.root;
+ while (deco) {
+ // Save next in case deco deleted
+ Decoration *decoNext = deco->next;
+ if (deco->indicator < INDIC_CONTAINER) {
+ pdoc->decorations.SetCurrentIndicator(deco->indicator);
+ pdoc->DecorationFillRange(0, 0, pdoc->Length());
+ }
+ deco = decoNext;
+ }
+ pdoc->StartStyling(0, '\377');
+ pdoc->SetStyleFor(pdoc->Length(), 0);
+ cs.ShowAll();
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ pdoc->ClearLevels();
+}
+
+void Editor::CopyAllowLine() {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText, true);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::Cut() {
+ pdoc->CheckReadOnly();
+ if (!pdoc->IsReadOnly() && !SelectionContainsProtected()) {
+ Copy();
+ ClearSelection();
+ }
+}
+
+void Editor::PasteRectangular(SelectionPosition pos, const char *ptr, int len) {
+ if (pdoc->IsReadOnly() || SelectionContainsProtected()) {
+ return;
+ }
+ sel.Clear();
+ sel.RangeMain() = SelectionRange(pos);
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ UndoGroup ug(pdoc);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ int xInsert = XFromPosition(sel.RangeMain().caret);
+ bool prevCr = false;
+ while ((len > 0) && IsEOLChar(ptr[len-1]))
+ len--;
+ for (int i = 0; i < len; i++) {
+ if (IsEOLChar(ptr[i])) {
+ if ((ptr[i] == '\r') || (!prevCr))
+ line++;
+ if (line >= pdoc->LinesTotal()) {
+ if (pdoc->eolMode != SC_EOL_LF)
+ pdoc->InsertString(pdoc->Length(), "\r", 1);
+ if (pdoc->eolMode != SC_EOL_CR)
+ pdoc->InsertString(pdoc->Length(), "\n", 1);
+ }
+ // Pad the end of lines with spaces if required
+ sel.RangeMain().caret.SetPosition(PositionFromLineX(line, xInsert));
+ if ((XFromPosition(sel.MainCaret()) < xInsert) && (i + 1 < len)) {
+ while (XFromPosition(sel.MainCaret()) < xInsert) {
+ assert(pdoc);
+ const int lengthInserted = pdoc->InsertString(sel.MainCaret(), " ", 1);
+ sel.RangeMain().caret.Add(lengthInserted);
+ }
+ }
+ prevCr = ptr[i] == '\r';
+ } else {
+ const int lengthInserted = pdoc->InsertString(sel.MainCaret(), ptr + i, 1);
+ sel.RangeMain().caret.Add(lengthInserted);
+ prevCr = false;
+ }
+ }
+ SetEmptySelection(pos);
+}
+
+bool Editor::CanPaste() {
+ return !pdoc->IsReadOnly() && !SelectionContainsProtected();
+}
+
+void Editor::Clear() {
+ // If multiple selections, don't delete EOLS
+ if (sel.Empty()) {
+ bool singleVirtual = false;
+ if ((sel.Count() == 1) &&
+ !RangeContainsProtected(sel.MainCaret(), sel.MainCaret() + 1) &&
+ sel.RangeMain().Start().VirtualSpace()) {
+ singleVirtual = true;
+ }
+ UndoGroup ug(pdoc, (sel.Count() > 1) || singleVirtual);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).caret.Position(), sel.Range(r).caret.Position() + 1)) {
+ if (sel.Range(r).Start().VirtualSpace()) {
+ if (sel.Range(r).anchor < sel.Range(r).caret)
+ sel.Range(r) = SelectionRange(InsertSpace(sel.Range(r).anchor.Position(), sel.Range(r).anchor.VirtualSpace()));
+ else
+ sel.Range(r) = SelectionRange(InsertSpace(sel.Range(r).caret.Position(), sel.Range(r).caret.VirtualSpace()));
+ }
+ if ((sel.Count() == 1) || !pdoc->IsPositionInLineEnd(sel.Range(r).caret.Position())) {
+ pdoc->DelChar(sel.Range(r).caret.Position());
+ sel.Range(r).ClearVirtualSpace();
+ } // else multiple selection so don't eat line ends
+ } else {
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ } else {
+ ClearSelection();
+ }
+ sel.RemoveDuplicates();
+ ShowCaretAtCurrentPosition(); // Avoid blinking
+}
+
+void Editor::SelectAll() {
+ sel.Clear();
+ SetSelection(0, pdoc->Length());
+ Redraw();
+}
+
+void Editor::Undo() {
+ if (pdoc->CanUndo()) {
+ InvalidateCaret();
+ int newPos = pdoc->Undo();
+ if (newPos >= 0)
+ SetEmptySelection(newPos);
+ EnsureCaretVisible();
+ }
+}
+
+void Editor::Redo() {
+ if (pdoc->CanRedo()) {
+ int newPos = pdoc->Redo();
+ if (newPos >= 0)
+ SetEmptySelection(newPos);
+ EnsureCaretVisible();
+ }
+}
+
+void Editor::DelCharBack(bool allowLineStartDeletion) {
+ RefreshStyleData();
+ if (!sel.IsRectangular())
+ FilterSelections();
+ if (sel.IsRectangular())
+ allowLineStartDeletion = false;
+ UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty());
+ if (sel.Empty()) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).caret.Position() - 1, sel.Range(r).caret.Position())) {
+ if (sel.Range(r).caret.VirtualSpace()) {
+ sel.Range(r).caret.SetVirtualSpace(sel.Range(r).caret.VirtualSpace() - 1);
+ sel.Range(r).anchor.SetVirtualSpace(sel.Range(r).caret.VirtualSpace());
+ } else {
+ int lineCurrentPos = pdoc->LineFromPosition(sel.Range(r).caret.Position());
+ if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.Range(r).caret.Position())) {
+ if (pdoc->GetColumn(sel.Range(r).caret.Position()) <= pdoc->GetLineIndentation(lineCurrentPos) &&
+ pdoc->GetColumn(sel.Range(r).caret.Position()) > 0 && pdoc->backspaceUnindents) {
+ UndoGroup ugInner(pdoc, !ug.Needed());
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ int indentationChange = indentation % indentationStep;
+ if (indentationChange == 0)
+ indentationChange = indentationStep;
+ const int posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationChange);
+ // SetEmptySelection
+ sel.Range(r) = SelectionRange(posSelect);
+ } else {
+ pdoc->DelCharBack(sel.Range(r).caret.Position());
+ }
+ }
+ }
+ } else {
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ ThinRectangularRange();
+ } else {
+ ClearSelection();
+ }
+ sel.RemoveDuplicates();
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+}
+
+int Editor::ModifierFlags(bool shift, bool ctrl, bool alt, bool meta) {
+ return
+ (shift ? SCI_SHIFT : 0) |
+ (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0) |
+ (meta ? SCI_META : 0);
+}
+
+void Editor::NotifyFocus(bool focus) {
+ SCNotification scn = {};
+ scn.nmhdr.code = focus ? SCN_FOCUSIN : SCN_FOCUSOUT;
+ NotifyParent(scn);
+}
+
+void Editor::SetCtrlID(int identifier) {
+ ctrlID = identifier;
+}
+
+void Editor::NotifyStyleToNeeded(int endStyleNeeded) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_STYLENEEDED;
+ scn.position = endStyleNeeded;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyStyleNeeded(Document *, void *, int endStyleNeeded) {
+ NotifyStyleToNeeded(endStyleNeeded);
+}
+
+void Editor::NotifyLexerChanged(Document *, void *) {
+}
+
+void Editor::NotifyErrorOccurred(Document *, void *, int status) {
+ errorStatus = status;
+}
+
+void Editor::NotifyChar(int ch) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_CHARADDED;
+ scn.ch = ch;
+ NotifyParent(scn);
+}
+
+void Editor::NotifySavePoint(bool isSavePoint) {
+ SCNotification scn = {};
+ if (isSavePoint) {
+ scn.nmhdr.code = SCN_SAVEPOINTREACHED;
+ } else {
+ scn.nmhdr.code = SCN_SAVEPOINTLEFT;
+ }
+ NotifyParent(scn);
+}
+
+void Editor::NotifyModifyAttempt() {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_MODIFYATTEMPTRO;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyDoubleClick(Point pt, int modifiers) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_DOUBLECLICK;
+ scn.line = LineFromLocation(pt);
+ scn.position = PositionFromLocation(pt, true);
+ scn.modifiers = modifiers;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
+ NotifyDoubleClick(pt, ModifierFlags(shift, ctrl, alt));
+}
+
+void Editor::NotifyHotSpotDoubleClicked(int position, int modifiers) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
+ scn.position = position;
+ scn.modifiers = modifiers;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
+ NotifyHotSpotDoubleClicked(position, ModifierFlags(shift, ctrl, alt));
+}
+
+void Editor::NotifyHotSpotClicked(int position, int modifiers) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_HOTSPOTCLICK;
+ scn.position = position;
+ scn.modifiers = modifiers;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
+ NotifyHotSpotClicked(position, ModifierFlags(shift, ctrl, alt));
+}
+
+void Editor::NotifyHotSpotReleaseClick(int position, int modifiers) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_HOTSPOTRELEASECLICK;
+ scn.position = position;
+ scn.modifiers = modifiers;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt) {
+ NotifyHotSpotReleaseClick(position, ModifierFlags(shift, ctrl, alt));
+}
+
+bool Editor::NotifyUpdateUI() {
+ if (needUpdateUI) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_UPDATEUI;
+ scn.updated = needUpdateUI;
+ NotifyParent(scn);
+ needUpdateUI = 0;
+ return true;
+ }
+ return false;
+}
+
+void Editor::NotifyPainted() {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_PAINTED;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyIndicatorClick(bool click, int position, int modifiers) {
+ int mask = pdoc->decorations.AllOnFor(position);
+ if ((click && mask) || pdoc->decorations.clickNotified) {
+ SCNotification scn = {};
+ pdoc->decorations.clickNotified = click;
+ scn.nmhdr.code = click ? SCN_INDICATORCLICK : SCN_INDICATORRELEASE;
+ scn.modifiers = modifiers;
+ scn.position = position;
+ NotifyParent(scn);
+ }
+}
+
+void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt) {
+ NotifyIndicatorClick(click, position, ModifierFlags(shift, ctrl, alt));
+}
+
+bool Editor::NotifyMarginClick(Point pt, int modifiers) {
+ int marginClicked = -1;
+ int x = vs.textStart - vs.fixedColumnWidth;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width))
+ marginClicked = margin;
+ x += vs.ms[margin].width;
+ }
+ if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) {
+ int position = pdoc->LineStart(LineFromLocation(pt));
+ if ((vs.ms[marginClicked].mask & SC_MASK_FOLDERS) && (foldAutomatic & SC_AUTOMATICFOLD_CLICK)) {
+ const bool ctrl = (modifiers & SCI_CTRL) != 0;
+ const bool shift = (modifiers & SCI_SHIFT) != 0;
+ int lineClick = pdoc->LineFromPosition(position);
+ if (shift && ctrl) {
+ FoldAll(SC_FOLDACTION_TOGGLE);
+ } else {
+ int levelClick = pdoc->GetLevel(lineClick);
+ if (levelClick & SC_FOLDLEVELHEADERFLAG) {
+ if (shift) {
+ // Ensure all children visible
+ FoldExpand(lineClick, SC_FOLDACTION_EXPAND, levelClick);
+ } else if (ctrl) {
+ FoldExpand(lineClick, SC_FOLDACTION_TOGGLE, levelClick);
+ } else {
+ // Toggle this line
+ FoldLine(lineClick, SC_FOLDACTION_TOGGLE);
+ }
+ }
+ }
+ return true;
+ }
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_MARGINCLICK;
+ scn.modifiers = modifiers;
+ scn.position = position;
+ scn.margin = marginClicked;
+ NotifyParent(scn);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) {
+ return NotifyMarginClick(pt, ModifierFlags(shift, ctrl, alt));
+}
+
+void Editor::NotifyNeedShown(int pos, int len) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_NEEDSHOWN;
+ scn.position = pos;
+ scn.length = len;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyDwelling(Point pt, bool state) {
+ SCNotification scn = {};
+ scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND;
+ scn.position = PositionFromLocation(pt, true);
+ scn.x = static_cast<int>(pt.x + vs.ExternalMarginWidth());
+ scn.y = static_cast<int>(pt.y);
+ NotifyParent(scn);
+}
+
+void Editor::NotifyZoom() {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_ZOOM;
+ NotifyParent(scn);
+}
+
+// Notifications from document
+void Editor::NotifyModifyAttempt(Document *, void *) {
+ //Platform::DebugPrintf("** Modify Attempt\n");
+ NotifyModifyAttempt();
+}
+
+void Editor::NotifySavePoint(Document *, void *, bool atSavePoint) {
+ //Platform::DebugPrintf("** Save Point %s\n", atSavePoint ? "On" : "Off");
+ NotifySavePoint(atSavePoint);
+}
+
+void Editor::CheckModificationForWrap(DocModification mh) {
+ if (mh.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) {
+ view.llc.Invalidate(LineLayout::llCheckTextAndStyle);
+ int lineDoc = pdoc->LineFromPosition(mh.position);
+ int lines = Platform::Maximum(0, mh.linesAdded);
+ if (Wrapping()) {
+ NeedWrapping(lineDoc, lineDoc + lines + 1);
+ }
+ RefreshStyleData();
+ // Fix up annotation heights
+ SetAnnotationHeights(lineDoc, lineDoc + lines + 2);
+ }
+}
+
+// Move a position so it is still after the same character as before the insertion.
+static inline int MovePositionForInsertion(int position, int startInsertion, int length) {
+ if (position > startInsertion) {
+ return position + length;
+ }
+ return position;
+}
+
+// Move a position so it is still after the same character as before the deletion if that
+// character is still present else after the previous surviving character.
+static inline int MovePositionForDeletion(int position, int startDeletion, int length) {
+ if (position > startDeletion) {
+ int endDeletion = startDeletion + length;
+ if (position > endDeletion) {
+ return position - length;
+ } else {
+ return startDeletion;
+ }
+ } else {
+ return position;
+ }
+}
+
+void Editor::NotifyModified(Document *, DocModification mh, void *) {
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(Range(mh.position, mh.position + mh.length));
+ }
+ if (mh.modificationType & SC_MOD_CHANGELINESTATE) {
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(
+ Range(pdoc->LineStart(mh.line), pdoc->LineStart(mh.line + 1)));
+ } else {
+ // Could check that change is before last visible line.
+ Redraw();
+ }
+ }
+ if (mh.modificationType & SC_MOD_CHANGETABSTOPS) {
+ Redraw();
+ }
+ if (mh.modificationType & SC_MOD_LEXERSTATE) {
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(
+ Range(mh.position, mh.position + mh.length));
+ } else {
+ Redraw();
+ }
+ }
+ if (mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) {
+ if (mh.modificationType & SC_MOD_CHANGESTYLE) {
+ pdoc->IncrementStyleClock();
+ }
+ if (paintState == notPainting) {
+ if (mh.position < pdoc->LineStart(topLine)) {
+ // Styling performed before this view
+ Redraw();
+ } else {
+ InvalidateRange(mh.position, mh.position + mh.length);
+ }
+ }
+ if (mh.modificationType & SC_MOD_CHANGESTYLE) {
+ view.llc.Invalidate(LineLayout::llCheckTextAndStyle);
+ }
+ } else {
+ // Move selection and brace highlights
+ if (mh.modificationType & SC_MOD_INSERTTEXT) {
+ sel.MovePositions(true, mh.position, mh.length);
+ braces[0] = MovePositionForInsertion(braces[0], mh.position, mh.length);
+ braces[1] = MovePositionForInsertion(braces[1], mh.position, mh.length);
+ } else if (mh.modificationType & SC_MOD_DELETETEXT) {
+ sel.MovePositions(false, mh.position, mh.length);
+ braces[0] = MovePositionForDeletion(braces[0], mh.position, mh.length);
+ braces[1] = MovePositionForDeletion(braces[1], mh.position, mh.length);
+ }
+ if ((mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) && cs.HiddenLines()) {
+ // Some lines are hidden so may need shown.
+ // TODO: check if the modified area is hidden.
+ if (mh.modificationType & SC_MOD_BEFOREINSERT) {
+ int lineOfPos = pdoc->LineFromPosition(mh.position);
+ bool insertingNewLine = false;
+ for (int i=0; i < mh.length; i++) {
+ if ((mh.text[i] == '\n') || (mh.text[i] == '\r'))
+ insertingNewLine = true;
+ }
+ if (insertingNewLine && (mh.position != pdoc->LineStart(lineOfPos)))
+ NeedShown(mh.position, pdoc->LineStart(lineOfPos+1) - mh.position);
+ else
+ NeedShown(mh.position, 0);
+ } else if (mh.modificationType & SC_MOD_BEFOREDELETE) {
+ NeedShown(mh.position, mh.length);
+ }
+ }
+ if (mh.linesAdded != 0) {
+ // Update contraction state for inserted and removed lines
+ // lineOfPos should be calculated in context of state before modification, shouldn't it
+ int lineOfPos = pdoc->LineFromPosition(mh.position);
+ if (mh.position > pdoc->LineStart(lineOfPos))
+ lineOfPos++; // Affecting subsequent lines
+ if (mh.linesAdded > 0) {
+ cs.InsertLines(lineOfPos, mh.linesAdded);
+ } else {
+ cs.DeleteLines(lineOfPos, -mh.linesAdded);
+ }
+ view.LinesAddedOrRemoved(lineOfPos, mh.linesAdded);
+ }
+ if (mh.modificationType & SC_MOD_CHANGEANNOTATION) {
+ int lineDoc = pdoc->LineFromPosition(mh.position);
+ if (vs.annotationVisible) {
+ cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded);
+ Redraw();
+ }
+ }
+ CheckModificationForWrap(mh);
+ if (mh.linesAdded != 0) {
+ // Avoid scrolling of display if change before current display
+ if (mh.position < posTopLine && !CanDeferToLastStep(mh)) {
+ int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos());
+ if (newTop != topLine) {
+ SetTopLine(newTop);
+ SetVerticalScrollPos();
+ }
+ }
+
+ if (paintState == notPainting && !CanDeferToLastStep(mh)) {
+ QueueIdleWork(WorkNeeded::workStyle, pdoc->Length());
+ Redraw();
+ }
+ } else {
+ if (paintState == notPainting && mh.length && !CanEliminate(mh)) {
+ QueueIdleWork(WorkNeeded::workStyle, mh.position + mh.length);
+ InvalidateRange(mh.position, mh.position + mh.length);
+ }
+ }
+ }
+
+ if (mh.linesAdded != 0 && !CanDeferToLastStep(mh)) {
+ SetScrollBars();
+ }
+
+ if ((mh.modificationType & SC_MOD_CHANGEMARKER) || (mh.modificationType & SC_MOD_CHANGEMARGIN)) {
+ if ((!willRedrawAll) && ((paintState == notPainting) || !PaintContainsMargin())) {
+ if (mh.modificationType & SC_MOD_CHANGEFOLD) {
+ // Fold changes can affect the drawing of following lines so redraw whole margin
+ RedrawSelMargin(marginView.highlightDelimiter.isEnabled ? -1 : mh.line - 1, true);
+ } else {
+ RedrawSelMargin(mh.line);
+ }
+ }
+ }
+ if ((mh.modificationType & SC_MOD_CHANGEFOLD) && (foldAutomatic & SC_AUTOMATICFOLD_CHANGE)) {
+ FoldChanged(mh.line, mh.foldLevelNow, mh.foldLevelPrev);
+ }
+
+ // NOW pay the piper WRT "deferred" visual updates
+ if (IsLastStep(mh)) {
+ SetScrollBars();
+ Redraw();
+ }
+
+ // If client wants to see this modification
+ if (mh.modificationType & modEventMask) {
+ if ((mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) == 0) {
+ // Real modification made to text of document.
+ NotifyChange(); // Send EN_CHANGE
+ }
+
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_MODIFIED;
+ scn.position = mh.position;
+ scn.modificationType = mh.modificationType;
+ scn.text = mh.text;
+ scn.length = mh.length;
+ scn.linesAdded = mh.linesAdded;
+ scn.line = mh.line;
+ scn.foldLevelNow = mh.foldLevelNow;
+ scn.foldLevelPrev = mh.foldLevelPrev;
+ scn.token = mh.token;
+ scn.annotationLinesAdded = mh.annotationLinesAdded;
+ NotifyParent(scn);
+ }
+}
+
+void Editor::NotifyDeleted(Document *, void *) {
+ /* Do nothing */
+}
+
+void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+
+ // Enumerates all macroable messages
+ switch (iMessage) {
+ case SCI_CUT:
+ case SCI_COPY:
+ case SCI_PASTE:
+ case SCI_CLEAR:
+ case SCI_REPLACESEL:
+ case SCI_ADDTEXT:
+ case SCI_INSERTTEXT:
+ case SCI_APPENDTEXT:
+ case SCI_CLEARALL:
+ case SCI_SELECTALL:
+ case SCI_GOTOLINE:
+ case SCI_GOTOPOS:
+ case SCI_SEARCHANCHOR:
+ case SCI_SEARCHNEXT:
+ case SCI_SEARCHPREV:
+ case SCI_LINEDOWN:
+ case SCI_LINEDOWNEXTEND:
+ case SCI_PARADOWN:
+ case SCI_PARADOWNEXTEND:
+ case SCI_LINEUP:
+ case SCI_LINEUPEXTEND:
+ case SCI_PARAUP:
+ case SCI_PARAUPEXTEND:
+ case SCI_CHARLEFT:
+ case SCI_CHARLEFTEXTEND:
+ case SCI_CHARRIGHT:
+ case SCI_CHARRIGHTEXTEND:
+ case SCI_WORDLEFT:
+ case SCI_WORDLEFTEXTEND:
+ case SCI_WORDRIGHT:
+ case SCI_WORDRIGHTEXTEND:
+ case SCI_WORDPARTLEFT:
+ case SCI_WORDPARTLEFTEXTEND:
+ case SCI_WORDPARTRIGHT:
+ case SCI_WORDPARTRIGHTEXTEND:
+ case SCI_WORDLEFTEND:
+ case SCI_WORDLEFTENDEXTEND:
+ case SCI_WORDRIGHTEND:
+ case SCI_WORDRIGHTENDEXTEND:
+ case SCI_HOME:
+ case SCI_HOMEEXTEND:
+ case SCI_LINEEND:
+ case SCI_LINEENDEXTEND:
+ case SCI_HOMEWRAP:
+ case SCI_HOMEWRAPEXTEND:
+ case SCI_LINEENDWRAP:
+ case SCI_LINEENDWRAPEXTEND:
+ case SCI_DOCUMENTSTART:
+ case SCI_DOCUMENTSTARTEXTEND:
+ case SCI_DOCUMENTEND:
+ case SCI_DOCUMENTENDEXTEND:
+ case SCI_STUTTEREDPAGEUP:
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ case SCI_STUTTEREDPAGEDOWN:
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+ case SCI_PAGEUP:
+ case SCI_PAGEUPEXTEND:
+ case SCI_PAGEDOWN:
+ case SCI_PAGEDOWNEXTEND:
+ case SCI_EDITTOGGLEOVERTYPE:
+ case SCI_CANCEL:
+ case SCI_DELETEBACK:
+ case SCI_TAB:
+ case SCI_BACKTAB:
+ case SCI_FORMFEED:
+ case SCI_VCHOME:
+ case SCI_VCHOMEEXTEND:
+ case SCI_VCHOMEWRAP:
+ case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
+ case SCI_DELWORDLEFT:
+ case SCI_DELWORDRIGHT:
+ case SCI_DELWORDRIGHTEND:
+ case SCI_DELLINELEFT:
+ case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
+ case SCI_LINECUT:
+ case SCI_LINEDELETE:
+ case SCI_LINETRANSPOSE:
+ case SCI_LINEDUPLICATE:
+ case SCI_LOWERCASE:
+ case SCI_UPPERCASE:
+ case SCI_LINESCROLLDOWN:
+ case SCI_LINESCROLLUP:
+ case SCI_DELETEBACKNOTLINE:
+ case SCI_HOMEDISPLAY:
+ case SCI_HOMEDISPLAYEXTEND:
+ case SCI_LINEENDDISPLAY:
+ case SCI_LINEENDDISPLAYEXTEND:
+ case SCI_SETSELECTIONMODE:
+ case SCI_LINEDOWNRECTEXTEND:
+ case SCI_LINEUPRECTEXTEND:
+ case SCI_CHARLEFTRECTEXTEND:
+ case SCI_CHARRIGHTRECTEXTEND:
+ case SCI_HOMERECTEXTEND:
+ case SCI_VCHOMERECTEXTEND:
+ case SCI_LINEENDRECTEXTEND:
+ case SCI_PAGEUPRECTEXTEND:
+ case SCI_PAGEDOWNRECTEXTEND:
+ case SCI_SELECTIONDUPLICATE:
+ case SCI_COPYALLOWLINE:
+ case SCI_VERTICALCENTRECARET:
+ case SCI_MOVESELECTEDLINESUP:
+ case SCI_MOVESELECTEDLINESDOWN:
+ case SCI_SCROLLTOSTART:
+ case SCI_SCROLLTOEND:
+ break;
+
+ // Filter out all others like display changes. Also, newlines are redundant
+ // with char insert messages.
+ case SCI_NEWLINE:
+ default:
+ // printf("Filtered out %ld of macro recording\n", iMessage);
+ return;
+ }
+
+ // Send notification
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_MACRORECORD;
+ scn.message = iMessage;
+ scn.wParam = wParam;
+ scn.lParam = lParam;
+ NotifyParent(scn);
+}
+
+// Something has changed that the container should know about
+void Editor::ContainerNeedsUpdate(int flags) {
+ needUpdateUI |= flags;
+}
+
+/**
+ * Force scroll and keep position relative to top of window.
+ *
+ * If stuttered = true and not already at first/last row, move to first/last row of window.
+ * If stuttered = true and already at first/last row, scroll as normal.
+ */
+void Editor::PageMove(int direction, Selection::selTypes selt, bool stuttered) {
+ int topLineNew;
+ SelectionPosition newPos;
+
+ int currentLine = pdoc->LineFromPosition(sel.MainCaret());
+ int topStutterLine = topLine + caretYSlop;
+ int bottomStutterLine =
+ pdoc->LineFromPosition(PositionFromLocation(
+ Point::FromInts(lastXChosen - xOffset, direction * vs.lineHeight * LinesToScroll())))
+ - caretYSlop - 1;
+
+ if (stuttered && (direction < 0 && currentLine > topStutterLine)) {
+ topLineNew = topLine;
+ newPos = SPositionFromLocation(Point::FromInts(lastXChosen - xOffset, vs.lineHeight * caretYSlop),
+ false, false, UserVirtualSpace());
+
+ } else if (stuttered && (direction > 0 && currentLine < bottomStutterLine)) {
+ topLineNew = topLine;
+ newPos = SPositionFromLocation(Point::FromInts(lastXChosen - xOffset, vs.lineHeight * (LinesToScroll() - caretYSlop)),
+ false, false, UserVirtualSpace());
+
+ } else {
+ Point pt = LocationFromPosition(sel.MainCaret());
+
+ topLineNew = Platform::Clamp(
+ topLine + direction * LinesToScroll(), 0, MaxScrollPos());
+ newPos = SPositionFromLocation(
+ Point::FromInts(lastXChosen - xOffset, static_cast<int>(pt.y) + direction * (vs.lineHeight * LinesToScroll())),
+ false, false, UserVirtualSpace());
+ }
+
+ if (topLineNew != topLine) {
+ SetTopLine(topLineNew);
+ MovePositionTo(newPos, selt);
+ Redraw();
+ SetVerticalScrollPos();
+ } else {
+ MovePositionTo(newPos, selt);
+ }
+}
+
+void Editor::ChangeCaseOfSelection(int caseMapping) {
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionRange current = sel.Range(r);
+ SelectionRange currentNoVS = current;
+ currentNoVS.ClearVirtualSpace();
+ size_t rangeBytes = currentNoVS.Length();
+ if (rangeBytes > 0) {
+ std::string sText = RangeText(currentNoVS.Start().Position(), currentNoVS.End().Position());
+
+ std::string sMapped = CaseMapString(sText, caseMapping);
+
+ if (sMapped != sText) {
+ size_t firstDifference = 0;
+ while (sMapped[firstDifference] == sText[firstDifference])
+ firstDifference++;
+ size_t lastDifferenceText = sText.size() - 1;
+ size_t lastDifferenceMapped = sMapped.size() - 1;
+ while (sMapped[lastDifferenceMapped] == sText[lastDifferenceText]) {
+ lastDifferenceText--;
+ lastDifferenceMapped--;
+ }
+ size_t endDifferenceText = sText.size() - 1 - lastDifferenceText;
+ pdoc->DeleteChars(
+ static_cast<int>(currentNoVS.Start().Position() + firstDifference),
+ static_cast<int>(rangeBytes - firstDifference - endDifferenceText));
+ const int lengthChange = static_cast<int>(lastDifferenceMapped - firstDifference + 1);
+ const int lengthInserted = pdoc->InsertString(
+ static_cast<int>(currentNoVS.Start().Position() + firstDifference),
+ sMapped.c_str() + firstDifference,
+ lengthChange);
+ // Automatic movement changes selection so reset to exactly the same as it was.
+ int diffSizes = static_cast<int>(sMapped.size() - sText.size()) + lengthInserted - lengthChange;
+ if (diffSizes != 0) {
+ if (current.anchor > current.caret)
+ current.anchor.Add(diffSizes);
+ else
+ current.caret.Add(diffSizes);
+ }
+ sel.Range(r) = current;
+ }
+ }
+ }
+}
+
+void Editor::LineTranspose() {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ if (line > 0) {
+ UndoGroup ug(pdoc);
+
+ const int startPrevious = pdoc->LineStart(line - 1);
+ const std::string linePrevious = RangeText(startPrevious, pdoc->LineEnd(line - 1));
+
+ int startCurrent = pdoc->LineStart(line);
+ const std::string lineCurrent = RangeText(startCurrent, pdoc->LineEnd(line));
+
+ pdoc->DeleteChars(startCurrent, static_cast<int>(lineCurrent.length()));
+ pdoc->DeleteChars(startPrevious, static_cast<int>(linePrevious.length()));
+ startCurrent -= static_cast<int>(linePrevious.length());
+
+ startCurrent += pdoc->InsertString(startPrevious, lineCurrent.c_str(),
+ static_cast<int>(lineCurrent.length()));
+ pdoc->InsertString(startCurrent, linePrevious.c_str(),
+ static_cast<int>(linePrevious.length()));
+ // Move caret to start of current line
+ MovePositionTo(SelectionPosition(startCurrent));
+ }
+}
+
+void Editor::Duplicate(bool forLine) {
+ if (sel.Empty()) {
+ forLine = true;
+ }
+ UndoGroup ug(pdoc);
+ const char *eol = "";
+ int eolLen = 0;
+ if (forLine) {
+ eol = StringFromEOLMode(pdoc->eolMode);
+ eolLen = istrlen(eol);
+ }
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionPosition start = sel.Range(r).Start();
+ SelectionPosition end = sel.Range(r).End();
+ if (forLine) {
+ int line = pdoc->LineFromPosition(sel.Range(r).caret.Position());
+ start = SelectionPosition(pdoc->LineStart(line));
+ end = SelectionPosition(pdoc->LineEnd(line));
+ }
+ std::string text = RangeText(start.Position(), end.Position());
+ int lengthInserted = eolLen;
+ if (forLine)
+ lengthInserted = pdoc->InsertString(end.Position(), eol, eolLen);
+ pdoc->InsertString(end.Position() + lengthInserted, text.c_str(), static_cast<int>(text.length()));
+ }
+ if (sel.Count() && sel.IsRectangular()) {
+ SelectionPosition last = sel.Last();
+ if (forLine) {
+ int line = pdoc->LineFromPosition(last.Position());
+ last = SelectionPosition(last.Position() + pdoc->LineStart(line+1) - pdoc->LineStart(line));
+ }
+ if (sel.Rectangular().anchor > sel.Rectangular().caret)
+ sel.Rectangular().anchor = last;
+ else
+ sel.Rectangular().caret = last;
+ SetRectangularRange();
+ }
+}
+
+void Editor::CancelModes() {
+ sel.SetMoveExtends(false);
+}
+
+void Editor::NewLine() {
+ // Remove non-main ranges
+ InvalidateSelection(sel.RangeMain(), true);
+ sel.SetSelection(sel.RangeMain());
+ sel.RangeMain().ClearVirtualSpace();
+
+ // Clear main range and insert line end
+ bool needGroupUndo = !sel.Empty();
+ if (needGroupUndo)
+ pdoc->BeginUndoAction();
+
+ if (!sel.Empty())
+ ClearSelection();
+ const char *eol = "\n";
+ if (pdoc->eolMode == SC_EOL_CRLF) {
+ eol = "\r\n";
+ } else if (pdoc->eolMode == SC_EOL_CR) {
+ eol = "\r";
+ } // else SC_EOL_LF -> "\n" already set
+ const int insertLength = pdoc->InsertString(sel.MainCaret(), eol, istrlen(eol));
+ // Want to end undo group before NotifyChar as applications often modify text here
+ if (needGroupUndo)
+ pdoc->EndUndoAction();
+ if (insertLength > 0) {
+ SetEmptySelection(sel.MainCaret() + insertLength);
+ while (*eol) {
+ NotifyChar(*eol);
+ if (recordingMacro) {
+ char txt[2];
+ txt[0] = *eol;
+ txt[1] = '\0';
+ NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(txt));
+ }
+ eol++;
+ }
+ }
+ SetLastXChosen();
+ SetScrollBars();
+ EnsureCaretVisible();
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+}
+
+void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) {
+ SelectionPosition caretToUse = sel.Range(sel.Main()).caret;
+ if (sel.IsRectangular()) {
+ if (selt == Selection::noSel) {
+ caretToUse = (direction > 0) ? sel.Limits().end : sel.Limits().start;
+ } else {
+ caretToUse = sel.Rectangular().caret;
+ }
+ }
+
+ Point pt = LocationFromPosition(caretToUse);
+ int skipLines = 0;
+
+ if (vs.annotationVisible) {
+ int lineDoc = pdoc->LineFromPosition(caretToUse.Position());
+ Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc));
+ int subLine = static_cast<int>(pt.y - ptStartLine.y) / vs.lineHeight;
+
+ if (direction < 0 && subLine == 0) {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (lineDisplay > 0) {
+ skipLines = pdoc->AnnotationLines(cs.DocFromDisplay(lineDisplay - 1));
+ }
+ } else if (direction > 0 && subLine >= (cs.GetHeight(lineDoc) - 1 - pdoc->AnnotationLines(lineDoc))) {
+ skipLines = pdoc->AnnotationLines(lineDoc);
+ }
+ }
+
+ int newY = static_cast<int>(pt.y) + (1 + skipLines) * direction * vs.lineHeight;
+ SelectionPosition posNew = SPositionFromLocation(
+ Point::FromInts(lastXChosen - xOffset, newY), false, false, UserVirtualSpace());
+
+ if (direction < 0) {
+ // Line wrapping may lead to a location on the same line, so
+ // seek back if that is the case.
+ Point ptNew = LocationFromPosition(posNew.Position());
+ while ((posNew.Position() > 0) && (pt.y == ptNew.y)) {
+ posNew.Add(-1);
+ posNew.SetVirtualSpace(0);
+ ptNew = LocationFromPosition(posNew.Position());
+ }
+ } else if (direction > 0 && posNew.Position() != pdoc->Length()) {
+ // There is an equivalent case when moving down which skips
+ // over a line.
+ Point ptNew = LocationFromPosition(posNew.Position());
+ while ((posNew.Position() > caretToUse.Position()) && (ptNew.y > newY)) {
+ posNew.Add(-1);
+ posNew.SetVirtualSpace(0);
+ ptNew = LocationFromPosition(posNew.Position());
+ }
+ }
+
+ MovePositionTo(MovePositionSoVisible(posNew, direction), selt);
+}
+
+void Editor::ParaUpOrDown(int direction, Selection::selTypes selt) {
+ int lineDoc, savedPos = sel.MainCaret();
+ do {
+ MovePositionTo(SelectionPosition(direction > 0 ? pdoc->ParaDown(sel.MainCaret()) : pdoc->ParaUp(sel.MainCaret())), selt);
+ lineDoc = pdoc->LineFromPosition(sel.MainCaret());
+ if (direction > 0) {
+ if (sel.MainCaret() >= pdoc->Length() && !cs.GetVisible(lineDoc)) {
+ if (selt == Selection::noSel) {
+ MovePositionTo(SelectionPosition(pdoc->LineEndPosition(savedPos)));
+ }
+ break;
+ }
+ }
+ } while (!cs.GetVisible(lineDoc));
+}
+
+int Editor::StartEndDisplayLine(int pos, bool start) {
+ RefreshStyleData();
+ AutoSurface surface(this);
+ int posRet = view.StartEndDisplayLine(surface, *this, pos, start, vs);
+ if (posRet == INVALID_POSITION) {
+ return pos;
+ } else {
+ return posRet;
+ }
+}
+
+int Editor::KeyCommand(unsigned int iMessage) {
+ switch (iMessage) {
+ case SCI_LINEDOWN:
+ CursorUpOrDown(1);
+ break;
+ case SCI_LINEDOWNEXTEND:
+ CursorUpOrDown(1, Selection::selStream);
+ break;
+ case SCI_LINEDOWNRECTEXTEND:
+ CursorUpOrDown(1, Selection::selRectangle);
+ break;
+ case SCI_PARADOWN:
+ ParaUpOrDown(1);
+ break;
+ case SCI_PARADOWNEXTEND:
+ ParaUpOrDown(1, Selection::selStream);
+ break;
+ case SCI_LINESCROLLDOWN:
+ ScrollTo(topLine + 1);
+ MoveCaretInsideView(false);
+ break;
+ case SCI_LINEUP:
+ CursorUpOrDown(-1);
+ break;
+ case SCI_LINEUPEXTEND:
+ CursorUpOrDown(-1, Selection::selStream);
+ break;
+ case SCI_LINEUPRECTEXTEND:
+ CursorUpOrDown(-1, Selection::selRectangle);
+ break;
+ case SCI_PARAUP:
+ ParaUpOrDown(-1);
+ break;
+ case SCI_PARAUPEXTEND:
+ ParaUpOrDown(-1, Selection::selStream);
+ break;
+ case SCI_LINESCROLLUP:
+ ScrollTo(topLine - 1);
+ MoveCaretInsideView(false);
+ break;
+ case SCI_CHARLEFT:
+ if (SelectionEmpty() || sel.MoveExtends()) {
+ if ((sel.Count() == 1) && pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret);
+ } else if (sel.MoveExtends() && sel.selType == Selection::selStream) {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1));
+ } else {
+ MovePositionTo(MovePositionSoVisible(
+ SelectionPosition((sel.LimitsForRectangularElseMain().start).Position() - 1), -1));
+ }
+ } else {
+ MovePositionTo(sel.LimitsForRectangularElseMain().start);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARLEFTEXTEND:
+ if (pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret, Selection::selStream);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1), Selection::selStream);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARLEFTRECTEXTEND:
+ if (pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret, Selection::selRectangle);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1), Selection::selRectangle);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHT:
+ if (SelectionEmpty() || sel.MoveExtends()) {
+ if ((virtualSpaceOptions & SCVS_USERACCESSIBLE) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret);
+ } else if (sel.MoveExtends() && sel.selType == Selection::selStream) {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1));
+ } else {
+ MovePositionTo(MovePositionSoVisible(
+ SelectionPosition((sel.LimitsForRectangularElseMain().end).Position() + 1), 1));
+ }
+ } else {
+ MovePositionTo(sel.LimitsForRectangularElseMain().end);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHTEXTEND:
+ if ((virtualSpaceOptions & SCVS_USERACCESSIBLE) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret, Selection::selStream);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1), Selection::selStream);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHTRECTEXTEND:
+ if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret, Selection::selRectangle);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1), Selection::selRectangle);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFT:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), -1), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), -1), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHT:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), 1), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), 1), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+
+ case SCI_WORDLEFTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), -1), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFTENDEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), -1), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), 1), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTENDEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), 1), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+
+ case SCI_HOME:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ SetLastXChosen();
+ break;
+ case SCI_HOMEEXTEND:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_HOMERECTEXTEND:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_LINEEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()));
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDEXTEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDRECTEXTEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_HOMEWRAP: {
+ SelectionPosition homePos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (sel.RangeMain().caret <= homePos)
+ homePos = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_HOMEWRAPEXTEND: {
+ SelectionPosition homePos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (sel.RangeMain().caret <= homePos)
+ homePos = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDWRAP: {
+ SelectionPosition endPos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), false), 1);
+ SelectionPosition realEndPos = SelectionPosition(pdoc->LineEndPosition(sel.MainCaret()));
+ if (endPos > realEndPos // if moved past visible EOLs
+ || sel.RangeMain().caret >= endPos) // if at end of display line already
+ endPos = realEndPos;
+ MovePositionTo(endPos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDWRAPEXTEND: {
+ SelectionPosition endPos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), false), 1);
+ SelectionPosition realEndPos = SelectionPosition(pdoc->LineEndPosition(sel.MainCaret()));
+ if (endPos > realEndPos // if moved past visible EOLs
+ || sel.RangeMain().caret >= endPos) // if at end of display line already
+ endPos = realEndPos;
+ MovePositionTo(endPos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DOCUMENTSTART:
+ MovePositionTo(0);
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTSTARTEXTEND:
+ MovePositionTo(0, Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTEND:
+ MovePositionTo(pdoc->Length());
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTENDEXTEND:
+ MovePositionTo(pdoc->Length(), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_STUTTEREDPAGEUP:
+ PageMove(-1, Selection::noSel, true);
+ break;
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ PageMove(-1, Selection::selStream, true);
+ break;
+ case SCI_STUTTEREDPAGEDOWN:
+ PageMove(1, Selection::noSel, true);
+ break;
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+ PageMove(1, Selection::selStream, true);
+ break;
+ case SCI_PAGEUP:
+ PageMove(-1);
+ break;
+ case SCI_PAGEUPEXTEND:
+ PageMove(-1, Selection::selStream);
+ break;
+ case SCI_PAGEUPRECTEXTEND:
+ PageMove(-1, Selection::selRectangle);
+ break;
+ case SCI_PAGEDOWN:
+ PageMove(1);
+ break;
+ case SCI_PAGEDOWNEXTEND:
+ PageMove(1, Selection::selStream);
+ break;
+ case SCI_PAGEDOWNRECTEXTEND:
+ PageMove(1, Selection::selRectangle);
+ break;
+ case SCI_EDITTOGGLEOVERTYPE:
+ inOverstrike = !inOverstrike;
+ ShowCaretAtCurrentPosition();
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+ NotifyUpdateUI();
+ break;
+ case SCI_CANCEL: // Cancel any modes - handled in subclass
+ // Also unselect text
+ CancelModes();
+ break;
+ case SCI_DELETEBACK:
+ DelCharBack(true);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+ case SCI_DELETEBACKNOTLINE:
+ DelCharBack(false);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+ case SCI_TAB:
+ Indent(true);
+ if (caretSticky == SC_CARETSTICKY_OFF) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ ShowCaretAtCurrentPosition(); // Avoid blinking
+ break;
+ case SCI_BACKTAB:
+ Indent(false);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ ShowCaretAtCurrentPosition(); // Avoid blinking
+ break;
+ case SCI_NEWLINE:
+ NewLine();
+ break;
+ case SCI_FORMFEED:
+ AddChar('\f');
+ break;
+ case SCI_VCHOME:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()));
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEEXTEND:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMERECTEXTEND:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEWRAP: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if ((viewLineStart < sel.RangeMain().caret) && (viewLineStart > homePos))
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_VCHOMEWRAPEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if ((viewLineStart < sel.RangeMain().caret) && (viewLineStart > homePos))
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_ZOOMIN:
+ if (vs.zoomLevel < 20) {
+ vs.zoomLevel++;
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ }
+ break;
+ case SCI_ZOOMOUT:
+ if (vs.zoomLevel > -10) {
+ vs.zoomLevel--;
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ }
+ break;
+ case SCI_DELWORDLEFT: {
+ int startWord = pdoc->NextWordStart(sel.MainCaret(), -1);
+ pdoc->DeleteChars(startWord, sel.MainCaret() - startWord);
+ sel.RangeMain().ClearVirtualSpace();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DELWORDRIGHT: {
+ UndoGroup ug(pdoc);
+ InvalidateSelection(sel.RangeMain(), true);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ sel.RangeMain().anchor = sel.RangeMain().caret;
+ int endWord = pdoc->NextWordStart(sel.MainCaret(), 1);
+ pdoc->DeleteChars(sel.MainCaret(), endWord - sel.MainCaret());
+ }
+ break;
+ case SCI_DELWORDRIGHTEND: {
+ UndoGroup ug(pdoc);
+ InvalidateSelection(sel.RangeMain(), true);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ int endWord = pdoc->NextWordEnd(sel.MainCaret(), 1);
+ pdoc->DeleteChars(sel.MainCaret(), endWord - sel.MainCaret());
+ }
+ break;
+ case SCI_DELLINELEFT: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(line);
+ pdoc->DeleteChars(start, sel.MainCaret() - start);
+ sel.RangeMain().ClearVirtualSpace();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DELLINERIGHT: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int end = pdoc->LineEnd(line);
+ pdoc->DeleteChars(sel.MainCaret(), end - sel.MainCaret());
+ }
+ break;
+ case SCI_LINECOPY: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart().Position());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position());
+ CopyRangeToClipboard(pdoc->LineStart(lineStart),
+ pdoc->LineStart(lineEnd + 1));
+ }
+ break;
+ case SCI_LINECUT: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart().Position());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position());
+ int start = pdoc->LineStart(lineStart);
+ int end = pdoc->LineStart(lineEnd + 1);
+ SetSelection(start, end);
+ Cut();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEDELETE: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(line);
+ int end = pdoc->LineStart(line + 1);
+ pdoc->DeleteChars(start, end - start);
+ }
+ break;
+ case SCI_LINETRANSPOSE:
+ LineTranspose();
+ break;
+ case SCI_LINEDUPLICATE:
+ Duplicate(true);
+ break;
+ case SCI_SELECTIONDUPLICATE:
+ Duplicate(false);
+ break;
+ case SCI_LOWERCASE:
+ ChangeCaseOfSelection(cmLower);
+ break;
+ case SCI_UPPERCASE:
+ ChangeCaseOfSelection(cmUpper);
+ break;
+ case SCI_WORDPARTLEFT:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(sel.MainCaret()), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTLEFTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(sel.MainCaret()), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTRIGHT:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(sel.MainCaret()), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTRIGHTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(sel.MainCaret()), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_HOMEDISPLAY:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), true), -1));
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEDISPLAY: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_HOMEDISPLAYEXTEND:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), true), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEDISPLAYEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDDISPLAY:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), false), 1));
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDDISPLAYEXTEND:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), false), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_SCROLLTOSTART:
+ ScrollTo(0);
+ break;
+ case SCI_SCROLLTOEND:
+ ScrollTo(MaxScrollPos());
+ break;
+ }
+ return 0;
+}
+
+int Editor::KeyDefault(int, int) {
+ return 0;
+}
+
+int Editor::KeyDownWithModifiers(int key, int modifiers, bool *consumed) {
+ DwellEnd(false);
+ int msg = kmap.Find(key, modifiers);
+ if (msg) {
+ if (consumed)
+ *consumed = true;
+ return static_cast<int>(WndProc(msg, 0, 0));
+ } else {
+ if (consumed)
+ *consumed = false;
+ return KeyDefault(key, modifiers);
+ }
+}
+
+int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
+ return KeyDownWithModifiers(key, ModifierFlags(shift, ctrl, alt), consumed);
+}
+
+void Editor::Indent(bool forwards) {
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ int lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position());
+ int caretPosition = sel.Range(r).caret.Position();
+ int lineCurrentPos = pdoc->LineFromPosition(caretPosition);
+ if (lineOfAnchor == lineCurrentPos) {
+ if (forwards) {
+ pdoc->DeleteChars(sel.Range(r).Start().Position(), sel.Range(r).Length());
+ caretPosition = sel.Range(r).caret.Position();
+ if (pdoc->GetColumn(caretPosition) <= pdoc->GetColumn(pdoc->GetLineIndentPosition(lineCurrentPos)) &&
+ pdoc->tabIndents) {
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ const int posSelect = pdoc->SetLineIndentation(
+ lineCurrentPos, indentation + indentationStep - indentation % indentationStep);
+ sel.Range(r) = SelectionRange(posSelect);
+ } else {
+ if (pdoc->useTabs) {
+ const int lengthInserted = pdoc->InsertString(caretPosition, "\t", 1);
+ sel.Range(r) = SelectionRange(caretPosition + lengthInserted);
+ } else {
+ int numSpaces = (pdoc->tabInChars) -
+ (pdoc->GetColumn(caretPosition) % (pdoc->tabInChars));
+ if (numSpaces < 1)
+ numSpaces = pdoc->tabInChars;
+ const std::string spaceText(numSpaces, ' ');
+ const int lengthInserted = pdoc->InsertString(caretPosition, spaceText.c_str(),
+ static_cast<int>(spaceText.length()));
+ sel.Range(r) = SelectionRange(caretPosition + lengthInserted);
+ }
+ }
+ } else {
+ if (pdoc->GetColumn(caretPosition) <= pdoc->GetLineIndentation(lineCurrentPos) &&
+ pdoc->tabIndents) {
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ const int posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
+ sel.Range(r) = SelectionRange(posSelect);
+ } else {
+ int newColumn = ((pdoc->GetColumn(caretPosition) - 1) / pdoc->tabInChars) *
+ pdoc->tabInChars;
+ if (newColumn < 0)
+ newColumn = 0;
+ int newPos = caretPosition;
+ while (pdoc->GetColumn(newPos) > newColumn)
+ newPos--;
+ sel.Range(r) = SelectionRange(newPos);
+ }
+ }
+ } else { // Multiline
+ int anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor);
+ int currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos);
+ // Multiple lines selected so indent / dedent
+ int lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos);
+ int lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos);
+ if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition)
+ lineBottomSel--; // If not selecting any characters on a line, do not indent
+ pdoc->Indent(forwards, lineBottomSel, lineTopSel);
+ if (lineOfAnchor < lineCurrentPos) {
+ if (currentPosPosOnLine == 0)
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor));
+ else
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos + 1), pdoc->LineStart(lineOfAnchor));
+ } else {
+ if (anchorPosOnLine == 0)
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor));
+ else
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor + 1));
+ }
+ }
+ }
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
+}
+
+class CaseFolderASCII : public CaseFolderTable {
+public:
+ CaseFolderASCII() {
+ StandardASCII();
+ }
+ ~CaseFolderASCII() {
+ }
+};
+
+
+CaseFolder *Editor::CaseFolderForEncoding() {
+ // Simple default that only maps ASCII upper case to lower case.
+ return new CaseFolderASCII();
+}
+
+/**
+ * Search of a text in the document, in the given range.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::FindText(
+ uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
+ ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX.
+ sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range.
+
+ Sci_TextToFind *ft = reinterpret_cast<Sci_TextToFind *>(lParam);
+ int lengthFound = istrlen(ft->lpstrText);
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ try {
+ long pos = pdoc->FindText(
+ static_cast<int>(ft->chrg.cpMin),
+ static_cast<int>(ft->chrg.cpMax),
+ ft->lpstrText,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ static_cast<int>(wParam),
+ &lengthFound);
+ if (pos != -1) {
+ ft->chrgText.cpMin = pos;
+ ft->chrgText.cpMax = pos + lengthFound;
+ }
+ return static_cast<int>(pos);
+ } catch (RegexError &) {
+ errorStatus = SC_STATUS_WARN_REGEX;
+ return -1;
+ }
+}
+
+/**
+ * Relocatable search support : Searches relative to current selection
+ * point and sets the selection to the found text range with
+ * each search.
+ */
+/**
+ * Anchor following searches at current selection start: This allows
+ * multiple incremental interactive searches to be macro recorded
+ * while still setting the selection to found text so the find/select
+ * operation is self-contained.
+ */
+void Editor::SearchAnchor() {
+ searchAnchor = SelectionStart().Position();
+}
+
+/**
+ * Find text from current search anchor: Must call @c SearchAnchor first.
+ * Used for next text and previous text requests.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::SearchText(
+ unsigned int iMessage, ///< Accepts both @c SCI_SEARCHNEXT and @c SCI_SEARCHPREV.
+ uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
+ ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX.
+ sptr_t lParam) { ///< The text to search for.
+
+ const char *txt = reinterpret_cast<char *>(lParam);
+ long pos;
+ int lengthFound = istrlen(txt);
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ try {
+ if (iMessage == SCI_SEARCHNEXT) {
+ pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ static_cast<int>(wParam),
+ &lengthFound);
+ } else {
+ pos = pdoc->FindText(searchAnchor, 0, txt,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ static_cast<int>(wParam),
+ &lengthFound);
+ }
+ } catch (RegexError &) {
+ errorStatus = SC_STATUS_WARN_REGEX;
+ return -1;
+ }
+ if (pos != -1) {
+ SetSelection(static_cast<int>(pos), static_cast<int>(pos + lengthFound));
+ }
+
+ return pos;
+}
+
+std::string Editor::CaseMapString(const std::string &s, int caseMapping) {
+ std::string ret(s);
+ for (size_t i=0; i<ret.size(); i++) {
+ switch (caseMapping) {
+ case cmUpper:
+ if (ret[i] >= 'a' && ret[i] <= 'z')
+ ret[i] = static_cast<char>(ret[i] - 'a' + 'A');
+ break;
+ case cmLower:
+ if (ret[i] >= 'A' && ret[i] <= 'Z')
+ ret[i] = static_cast<char>(ret[i] - 'A' + 'a');
+ break;
+ }
+ }
+ return ret;
+}
+
+/**
+ * Search for text in the target range of the document.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::SearchInTarget(const char *text, int length) {
+ int lengthFound = length;
+
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ try {
+ long pos = pdoc->FindText(targetStart, targetEnd, text,
+ (searchFlags & SCFIND_MATCHCASE) != 0,
+ (searchFlags & SCFIND_WHOLEWORD) != 0,
+ (searchFlags & SCFIND_WORDSTART) != 0,
+ (searchFlags & SCFIND_REGEXP) != 0,
+ searchFlags,
+ &lengthFound);
+ if (pos != -1) {
+ targetStart = static_cast<int>(pos);
+ targetEnd = static_cast<int>(pos + lengthFound);
+ }
+ return pos;
+ } catch (RegexError &) {
+ errorStatus = SC_STATUS_WARN_REGEX;
+ return -1;
+ }
+}
+
+void Editor::GoToLine(int lineNo) {
+ if (lineNo > pdoc->LinesTotal())
+ lineNo = pdoc->LinesTotal();
+ if (lineNo < 0)
+ lineNo = 0;
+ SetEmptySelection(pdoc->LineStart(lineNo));
+ ShowCaretAtCurrentPosition();
+ EnsureCaretVisible();
+}
+
+static bool Close(Point pt1, Point pt2, Point threshold) {
+ if (std::abs(pt1.x - pt2.x) > threshold.x)
+ return false;
+ if (std::abs(pt1.y - pt2.y) > threshold.y)
+ return false;
+ return true;
+}
+
+std::string Editor::RangeText(int start, int end) const {
+ if (start < end) {
+ int len = end - start;
+ std::string ret(len, '\0');
+ for (int i = 0; i < len; i++) {
+ ret[i] = pdoc->CharAt(start + i);
+ }
+ return ret;
+ }
+ return std::string();
+}
+
+void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
+ if (sel.Empty()) {
+ if (allowLineCopy) {
+ int currentLine = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(currentLine);
+ int end = pdoc->LineEnd(currentLine);
+
+ std::string text = RangeText(start, end);
+ if (pdoc->eolMode != SC_EOL_LF)
+ text.push_back('\r');
+ if (pdoc->eolMode != SC_EOL_CR)
+ text.push_back('\n');
+ ss->Copy(text, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, false, true);
+ }
+ } else {
+ std::string text;
+ std::vector<SelectionRange> rangesInOrder = sel.RangesCopy();
+ if (sel.selType == Selection::selRectangle)
+ std::sort(rangesInOrder.begin(), rangesInOrder.end());
+ for (size_t r=0; r<rangesInOrder.size(); r++) {
+ SelectionRange current = rangesInOrder[r];
+ text.append(RangeText(current.Start().Position(), current.End().Position()));
+ if (sel.selType == Selection::selRectangle) {
+ if (pdoc->eolMode != SC_EOL_LF)
+ text.push_back('\r');
+ if (pdoc->eolMode != SC_EOL_CR)
+ text.push_back('\n');
+ }
+ }
+ ss->Copy(text, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, sel.IsRectangular(), sel.selType == Selection::selLines);
+ }
+}
+
+void Editor::CopyRangeToClipboard(int start, int end) {
+ start = pdoc->ClampPositionIntoDocument(start);
+ end = pdoc->ClampPositionIntoDocument(end);
+ SelectionText selectedText;
+ std::string text = RangeText(start, end);
+ selectedText.Copy(text,
+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::CopyText(int length, const char *text) {
+ SelectionText selectedText;
+ selectedText.Copy(std::string(text, length),
+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::SetDragPosition(SelectionPosition newPos) {
+ if (newPos.Position() >= 0) {
+ newPos = MovePositionOutsideChar(newPos, 1);
+ posDrop = newPos;
+ }
+ if (!(posDrag == newPos)) {
+ caret.on = true;
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ if ((caret.active) && (caret.period > 0) && (newPos.Position() < 0))
+ FineTickerStart(tickCaret, caret.period, caret.period/10);
+ } else {
+ SetTicking(true);
+ }
+ InvalidateCaret();
+ posDrag = newPos;
+ InvalidateCaret();
+ }
+}
+
+void Editor::DisplayCursor(Window::Cursor c) {
+ if (cursorMode == SC_CURSORNORMAL)
+ wMain.SetCursor(c);
+ else
+ wMain.SetCursor(static_cast<Window::Cursor>(cursorMode));
+}
+
+bool Editor::DragThreshold(Point ptStart, Point ptNow) {
+ int xMove = static_cast<int>(ptStart.x - ptNow.x);
+ int yMove = static_cast<int>(ptStart.y - ptNow.y);
+ int distanceSquared = xMove * xMove + yMove * yMove;
+ return distanceSquared > 16;
+}
+
+void Editor::StartDrag() {
+ // Always handled by subclasses
+ //SetMouseCapture(true);
+ //DisplayCursor(Window::cursorArrow);
+}
+
+void Editor::DropAt(SelectionPosition position, const char *value, size_t lengthValue, bool moving, bool rectangular) {
+ //Platform::DebugPrintf("DropAt %d %d\n", inDragDrop, position);
+ if (inDragDrop == ddDragging)
+ dropWentOutside = false;
+
+ bool positionWasInSelection = PositionInSelection(position.Position());
+
+ bool positionOnEdgeOfSelection =
+ (position == SelectionStart()) || (position == SelectionEnd());
+
+ if ((inDragDrop != ddDragging) || !(positionWasInSelection) ||
+ (positionOnEdgeOfSelection && !moving)) {
+
+ SelectionPosition selStart = SelectionStart();
+ SelectionPosition selEnd = SelectionEnd();
+
+ UndoGroup ug(pdoc);
+
+ SelectionPosition positionAfterDeletion = position;
+ if ((inDragDrop == ddDragging) && moving) {
+ // Remove dragged out text
+ if (rectangular || sel.selType == Selection::selLines) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (position >= sel.Range(r).Start()) {
+ if (position > sel.Range(r).End()) {
+ positionAfterDeletion.Add(-sel.Range(r).Length());
+ } else {
+ positionAfterDeletion.Add(-SelectionRange(position, sel.Range(r).Start()).Length());
+ }
+ }
+ }
+ } else {
+ if (position > selStart) {
+ positionAfterDeletion.Add(-SelectionRange(selEnd, selStart).Length());
+ }
+ }
+ ClearSelection();
+ }
+ position = positionAfterDeletion;
+
+ std::string convertedText = Document::TransformLineEnds(value, lengthValue, pdoc->eolMode);
+
+ if (rectangular) {
+ PasteRectangular(position, convertedText.c_str(), static_cast<int>(convertedText.length()));
+ // Should try to select new rectangle but it may not be a rectangle now so just select the drop position
+ SetEmptySelection(position);
+ } else {
+ position = MovePositionOutsideChar(position, sel.MainCaret() - position.Position());
+ position = SelectionPosition(InsertSpace(position.Position(), position.VirtualSpace()));
+ const int lengthInserted = pdoc->InsertString(
+ position.Position(), convertedText.c_str(), static_cast<int>(convertedText.length()));
+ if (lengthInserted > 0) {
+ SelectionPosition posAfterInsertion = position;
+ posAfterInsertion.Add(lengthInserted);
+ SetSelection(posAfterInsertion, position);
+ }
+ }
+ } else if (inDragDrop == ddDragging) {
+ SetEmptySelection(position);
+ }
+}
+
+void Editor::DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular) {
+ DropAt(position, value, strlen(value), moving, rectangular);
+}
+
+/**
+ * @return true if given position is inside the selection,
+ */
+bool Editor::PositionInSelection(int pos) {
+ pos = MovePositionOutsideChar(pos, sel.MainCaret() - pos);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (sel.Range(r).Contains(pos))
+ return true;
+ }
+ return false;
+}
+
+bool Editor::PointInSelection(Point pt) {
+ SelectionPosition pos = SPositionFromLocation(pt, false, true);
+ Point ptPos = LocationFromPosition(pos);
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionRange range = sel.Range(r);
+ if (range.Contains(pos)) {
+ bool hit = true;
+ if (pos == range.Start()) {
+ // see if just before selection
+ if (pt.x < ptPos.x) {
+ hit = false;
+ }
+ }
+ if (pos == range.End()) {
+ // see if just after selection
+ if (pt.x > ptPos.x) {
+ hit = false;
+ }
+ }
+ if (hit)
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Editor::PointInSelMargin(Point pt) const {
+ // Really means: "Point in a margin"
+ if (vs.fixedColumnWidth > 0) { // There is a margin
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart - vs.leftMarginWidth);
+ rcSelMargin.left = static_cast<XYPOSITION>(vs.textStart - vs.fixedColumnWidth);
+ return rcSelMargin.ContainsWholePixel(pt);
+ } else {
+ return false;
+ }
+}
+
+Window::Cursor Editor::GetMarginCursor(Point pt) const {
+ int x = 0;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width))
+ return static_cast<Window::Cursor>(vs.ms[margin].cursor);
+ x += vs.ms[margin].width;
+ }
+ return Window::cursorReverseArrow;
+}
+
+void Editor::TrimAndSetSelection(int currentPos_, int anchor_) {
+ sel.TrimSelection(SelectionRange(currentPos_, anchor_));
+ SetSelection(currentPos_, anchor_);
+}
+
+void Editor::LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine) {
+ int selCurrentPos, selAnchorPos;
+ if (wholeLine) {
+ int lineCurrent_ = pdoc->LineFromPosition(lineCurrentPos_);
+ int lineAnchor_ = pdoc->LineFromPosition(lineAnchorPos_);
+ if (lineAnchorPos_ < lineCurrentPos_) {
+ selCurrentPos = pdoc->LineStart(lineCurrent_ + 1);
+ selAnchorPos = pdoc->LineStart(lineAnchor_);
+ } else if (lineAnchorPos_ > lineCurrentPos_) {
+ selCurrentPos = pdoc->LineStart(lineCurrent_);
+ selAnchorPos = pdoc->LineStart(lineAnchor_ + 1);
+ } else { // Same line, select it
+ selCurrentPos = pdoc->LineStart(lineAnchor_ + 1);
+ selAnchorPos = pdoc->LineStart(lineAnchor_);
+ }
+ } else {
+ if (lineAnchorPos_ < lineCurrentPos_) {
+ selCurrentPos = StartEndDisplayLine(lineCurrentPos_, false) + 1;
+ selCurrentPos = pdoc->MovePositionOutsideChar(selCurrentPos, 1);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, true);
+ } else if (lineAnchorPos_ > lineCurrentPos_) {
+ selCurrentPos = StartEndDisplayLine(lineCurrentPos_, true);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, false) + 1;
+ selAnchorPos = pdoc->MovePositionOutsideChar(selAnchorPos, 1);
+ } else { // Same line, select it
+ selCurrentPos = StartEndDisplayLine(lineAnchorPos_, false) + 1;
+ selCurrentPos = pdoc->MovePositionOutsideChar(selCurrentPos, 1);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, true);
+ }
+ }
+ TrimAndSetSelection(selCurrentPos, selAnchorPos);
+}
+
+void Editor::WordSelection(int pos) {
+ if (pos < wordSelectAnchorStartPos) {
+ // Extend backward to the word containing pos.
+ // Skip ExtendWordSelect if the line is empty or if pos is after the last character.
+ // This ensures that a series of empty lines isn't counted as a single "word".
+ if (!pdoc->IsLineEndPosition(pos))
+ pos = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(pos + 1, 1), -1);
+ TrimAndSetSelection(pos, wordSelectAnchorEndPos);
+ } else if (pos > wordSelectAnchorEndPos) {
+ // Extend forward to the word containing the character to the left of pos.
+ // Skip ExtendWordSelect if the line is empty or if pos is the first position on the line.
+ // This ensures that a series of empty lines isn't counted as a single "word".
+ if (pos > pdoc->LineStart(pdoc->LineFromPosition(pos)))
+ pos = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(pos - 1, -1), 1);
+ TrimAndSetSelection(pos, wordSelectAnchorStartPos);
+ } else {
+ // Select only the anchored word
+ if (pos >= originalAnchorPos)
+ TrimAndSetSelection(wordSelectAnchorEndPos, wordSelectAnchorStartPos);
+ else
+ TrimAndSetSelection(wordSelectAnchorStartPos, wordSelectAnchorEndPos);
+ }
+}
+
+void Editor::DwellEnd(bool mouseMoved) {
+ if (mouseMoved)
+ ticksToDwell = dwellDelay;
+ else
+ ticksToDwell = SC_TIME_FOREVER;
+ if (dwelling && (dwellDelay < SC_TIME_FOREVER)) {
+ dwelling = false;
+ NotifyDwelling(ptMouseLast, dwelling);
+ }
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickDwell);
+ if (mouseMoved && (dwellDelay < SC_TIME_FOREVER)) {
+ //FineTickerStart(tickDwell, dwellDelay, dwellDelay/10);
+ }
+ }
+}
+
+void Editor::MouseLeave() {
+ SetHotSpotRange(NULL);
+ if (!HaveMouseCapture()) {
+ ptMouseLast = Point(-1,-1);
+ DwellEnd(true);
+ }
+}
+
+static bool AllowVirtualSpace(int virtualSpaceOptions, bool rectangular) {
+ return (!rectangular && ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0))
+ || (rectangular && ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) != 0));
+}
+
+void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers) {
+ SetHoverIndicatorPoint(pt);
+ //Platform::DebugPrintf("ButtonDown %d %d = %d alt=%d %d\n", curTime, lastClickTime, curTime - lastClickTime, alt, inDragDrop);
+ ptMouseLast = pt;
+ const bool ctrl = (modifiers & SCI_CTRL) != 0;
+ const bool shift = (modifiers & SCI_SHIFT) != 0;
+ const bool alt = (modifiers & SCI_ALT) != 0;
+ SelectionPosition newPos = SPositionFromLocation(pt, false, false, AllowVirtualSpace(virtualSpaceOptions, alt));
+ newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
+ SelectionPosition newCharPos = SPositionFromLocation(pt, false, true, false);
+ newCharPos = MovePositionOutsideChar(newCharPos, -1);
+ inDragDrop = ddNone;
+ sel.SetMoveExtends(false);
+
+ if (NotifyMarginClick(pt, modifiers))
+ return;
+
+ NotifyIndicatorClick(true, newPos.Position(), modifiers);
+
+ bool inSelMargin = PointInSelMargin(pt);
+ // In margin ctrl+(double)click should always select everything
+ if (ctrl && inSelMargin) {
+ SelectAll();
+ lastClickTime = curTime;
+ lastClick = pt;
+ return;
+ }
+ if (shift && !inSelMargin) {
+ SetSelection(newPos);
+ }
+ if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick, doubleClickCloseThreshold)) {
+ //Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
+ SetMouseCapture(true);
+ if (FineTickerAvailable()) {
+ FineTickerStart(tickScroll, 100, 10);
+ }
+ if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))
+ SetEmptySelection(newPos.Position());
+ bool doubleClick = false;
+ // Stop mouse button bounce changing selection type
+ if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
+ if (inSelMargin) {
+ // Inside margin selection type should be either selSubLine or selWholeLine.
+ if (selectionType == selSubLine) {
+ // If it is selSubLine, we're inside a *double* click and word wrap is enabled,
+ // so we switch to selWholeLine in order to select whole line.
+ selectionType = selWholeLine;
+ } else if (selectionType != selSubLine && selectionType != selWholeLine) {
+ // If it is neither, reset selection type to line selection.
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ }
+ } else {
+ if (selectionType == selChar) {
+ selectionType = selWord;
+ doubleClick = true;
+ } else if (selectionType == selWord) {
+ // Since we ended up here, we're inside a *triple* click, which should always select
+ // whole line regardless of word wrap being enabled or not.
+ selectionType = selWholeLine;
+ } else {
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ }
+ }
+ }
+
+ if (selectionType == selWord) {
+ int charPos = originalAnchorPos;
+ if (sel.MainCaret() == originalAnchorPos) {
+ charPos = PositionFromLocation(pt, false, true);
+ charPos = MovePositionOutsideChar(charPos, -1);
+ }
+
+ int startWord, endWord;
+ if ((sel.MainCaret() >= originalAnchorPos) && !pdoc->IsLineEndPosition(charPos)) {
+ startWord = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(charPos + 1, 1), -1);
+ endWord = pdoc->ExtendWordSelect(charPos, 1);
+ } else {
+ // Selecting backwards, or anchor beyond last character on line. In these cases,
+ // we select the word containing the character to the *left* of the anchor.
+ if (charPos > pdoc->LineStart(pdoc->LineFromPosition(charPos))) {
+ startWord = pdoc->ExtendWordSelect(charPos, -1);
+ endWord = pdoc->ExtendWordSelect(startWord, 1);
+ } else {
+ // Anchor at start of line; select nothing to begin with.
+ startWord = charPos;
+ endWord = charPos;
+ }
+ }
+
+ wordSelectAnchorStartPos = startWord;
+ wordSelectAnchorEndPos = endWord;
+ wordSelectInitialCaretPos = sel.MainCaret();
+ WordSelection(wordSelectInitialCaretPos);
+ } else if (selectionType == selSubLine || selectionType == selWholeLine) {
+ lineAnchorPos = newPos.Position();
+ LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine);
+ //Platform::DebugPrintf("Triple click: %d - %d\n", anchor, currentPos);
+ } else {
+ SetEmptySelection(sel.MainCaret());
+ }
+ //Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos);
+ if (doubleClick) {
+ NotifyDoubleClick(pt, modifiers);
+ if (PositionIsHotspot(newCharPos.Position()))
+ NotifyHotSpotDoubleClicked(newCharPos.Position(), modifiers);
+ }
+ } else { // Single click
+ if (inSelMargin) {
+ sel.selType = Selection::selStream;
+ if (!shift) {
+ // Single click in margin: select whole line or only subline if word wrap is enabled
+ lineAnchorPos = newPos.Position();
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine);
+ } else {
+ // Single shift+click in margin: select from line anchor to clicked line
+ if (sel.MainAnchor() > sel.MainCaret())
+ lineAnchorPos = sel.MainAnchor() - 1;
+ else
+ lineAnchorPos = sel.MainAnchor();
+ // Reset selection type if there is an empty selection.
+ // This ensures that we don't end up stuck in previous selection mode, which is no longer valid.
+ // Otherwise, if there's a non empty selection, reset selection type only if it differs from selSubLine and selWholeLine.
+ // This ensures that we continue selecting in the same selection mode.
+ if (sel.Empty() || (selectionType != selSubLine && selectionType != selWholeLine))
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine);
+ }
+
+ SetDragPosition(SelectionPosition(invalidPosition));
+ SetMouseCapture(true);
+ if (FineTickerAvailable()) {
+ FineTickerStart(tickScroll, 100, 10);
+ }
+ } else {
+ if (PointIsHotspot(pt)) {
+ NotifyHotSpotClicked(newCharPos.Position(), modifiers);
+ hotSpotClickPos = newCharPos.Position();
+ }
+ if (!shift) {
+ if (PointInSelection(pt) && !SelectionEmpty())
+ inDragDrop = ddInitial;
+ else
+ inDragDrop = ddNone;
+ }
+ SetMouseCapture(true);
+ if (FineTickerAvailable()) {
+ FineTickerStart(tickScroll, 100, 10);
+ }
+ if (inDragDrop != ddInitial) {
+ SetDragPosition(SelectionPosition(invalidPosition));
+ if (!shift) {
+ if (ctrl && multipleSelection) {
+ SelectionRange range(newPos);
+ sel.TentativeSelection(range);
+ InvalidateSelection(range, true);
+ } else {
+ InvalidateSelection(SelectionRange(newPos), true);
+ if (sel.Count() > 1)
+ Redraw();
+ if ((sel.Count() > 1) || (sel.selType != Selection::selStream))
+ sel.Clear();
+ sel.selType = alt ? Selection::selRectangle : Selection::selStream;
+ SetSelection(newPos, newPos);
+ }
+ }
+ SelectionPosition anchorCurrent = newPos;
+ if (shift)
+ anchorCurrent = sel.IsRectangular() ?
+ sel.Rectangular().anchor : sel.RangeMain().anchor;
+ sel.selType = alt ? Selection::selRectangle : Selection::selStream;
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ sel.Rectangular() = SelectionRange(newPos, anchorCurrent);
+ SetRectangularRange();
+ }
+ }
+ }
+ lastClickTime = curTime;
+ lastClick = pt;
+ lastXChosen = static_cast<int>(pt.x) + xOffset;
+ ShowCaretAtCurrentPosition();
+}
+
+void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
+ return ButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt));
+}
+
+bool Editor::PositionIsHotspot(int position) const {
+ return vs.styles[static_cast<unsigned char>(pdoc->StyleAt(position))].hotspot;
+}
+
+bool Editor::PointIsHotspot(Point pt) {
+ int pos = PositionFromLocation(pt, true, true);
+ if (pos == INVALID_POSITION)
+ return false;
+ return PositionIsHotspot(pos);
+}
+
+void Editor::SetHoverIndicatorPosition(int position) {
+ int hoverIndicatorPosPrev = hoverIndicatorPos;
+ hoverIndicatorPos = INVALID_POSITION;
+ if (vs.indicatorsDynamic == 0)
+ return;
+ if (position != INVALID_POSITION) {
+ for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) {
+ if (vs.indicators[deco->indicator].IsDynamic()) {
+ if (pdoc->decorations.ValueAt(deco->indicator, position)) {
+ hoverIndicatorPos = position;
+ }
+ }
+ }
+ }
+ if (hoverIndicatorPosPrev != hoverIndicatorPos) {
+ if (hoverIndicatorPosPrev != INVALID_POSITION)
+ InvalidateRange(hoverIndicatorPosPrev, hoverIndicatorPosPrev + 1);
+ if (hoverIndicatorPos != INVALID_POSITION)
+ InvalidateRange(hoverIndicatorPos, hoverIndicatorPos + 1);
+ }
+}
+
+void Editor::SetHoverIndicatorPoint(Point pt) {
+ if (vs.indicatorsDynamic == 0) {
+ SetHoverIndicatorPosition(INVALID_POSITION);
+ } else {
+ SetHoverIndicatorPosition(PositionFromLocation(pt, true, true));
+ }
+}
+
+void Editor::SetHotSpotRange(Point *pt) {
+ if (pt) {
+ int pos = PositionFromLocation(*pt, false, true);
+
+ // If we don't limit this to word characters then the
+ // range can encompass more than the run range and then
+ // the underline will not be drawn properly.
+ Range hsNew;
+ hsNew.start = pdoc->ExtendStyleRange(pos, -1, vs.hotspotSingleLine);
+ hsNew.end = pdoc->ExtendStyleRange(pos, 1, vs.hotspotSingleLine);
+
+ // Only invalidate the range if the hotspot range has changed...
+ if (!(hsNew == hotspot)) {
+ if (hotspot.Valid()) {
+ InvalidateRange(hotspot.start, hotspot.end);
+ }
+ hotspot = hsNew;
+ InvalidateRange(hotspot.start, hotspot.end);
+ }
+ } else {
+ if (hotspot.Valid()) {
+ InvalidateRange(hotspot.start, hotspot.end);
+ }
+ hotspot = Range(invalidPosition);
+ }
+}
+
+Range Editor::GetHotSpotRange() const {
+ return hotspot;
+}
+
+void Editor::ButtonMoveWithModifiers(Point pt, int modifiers) {
+ if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
+ DwellEnd(true);
+ }
+
+ SelectionPosition movePos = SPositionFromLocation(pt, false, false,
+ AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular()));
+ movePos = MovePositionOutsideChar(movePos, sel.MainCaret() - movePos.Position());
+
+ if (inDragDrop == ddInitial) {
+ if (DragThreshold(ptMouseLast, pt)) {
+ SetMouseCapture(false);
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickScroll);
+ }
+ SetDragPosition(movePos);
+ CopySelectionRange(&drag);
+ StartDrag();
+ }
+ return;
+ }
+
+ ptMouseLast = pt;
+ PRectangle rcClient = GetClientRectangle();
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcClient.Move(0, -ptOrigin.y);
+ if (FineTickerAvailable() && (dwellDelay < SC_TIME_FOREVER) && rcClient.Contains(pt)) {
+ FineTickerStart(tickDwell, dwellDelay, dwellDelay/10);
+ }
+ //Platform::DebugPrintf("Move %d %d\n", pt.x, pt.y);
+ if (HaveMouseCapture()) {
+
+ // Slow down autoscrolling/selection
+ autoScrollTimer.ticksToWait -= timer.tickSize;
+ if (autoScrollTimer.ticksToWait > 0)
+ return;
+ autoScrollTimer.ticksToWait = autoScrollDelay;
+
+ // Adjust selection
+ if (posDrag.IsValid()) {
+ SetDragPosition(movePos);
+ } else {
+ if (selectionType == selChar) {
+ if (sel.selType == Selection::selStream && (modifiers & SCI_ALT) && mouseSelectionRectangularSwitch) {
+ sel.selType = Selection::selRectangle;
+ }
+ if (sel.IsRectangular()) {
+ sel.Rectangular() = SelectionRange(movePos, sel.Rectangular().anchor);
+ SetSelection(movePos, sel.RangeMain().anchor);
+ } else if (sel.Count() > 1) {
+ InvalidateSelection(sel.RangeMain(), false);
+ SelectionRange range(movePos, sel.RangeMain().anchor);
+ sel.TentativeSelection(range);
+ InvalidateSelection(range, true);
+ } else {
+ SetSelection(movePos, sel.RangeMain().anchor);
+ }
+ } else if (selectionType == selWord) {
+ // Continue selecting by word
+ if (movePos.Position() == wordSelectInitialCaretPos) { // Didn't move
+ // No need to do anything. Previously this case was lumped
+ // in with "Moved forward", but that can be harmful in this
+ // case: a handler for the NotifyDoubleClick re-adjusts
+ // the selection for a fancier definition of "word" (for
+ // example, in Perl it is useful to include the leading
+ // '$', '%' or '@' on variables for word selection). In this
+ // the ButtonMove() called via Tick() for auto-scrolling
+ // could result in the fancier word selection adjustment
+ // being unmade.
+ } else {
+ wordSelectInitialCaretPos = -1;
+ WordSelection(movePos.Position());
+ }
+ } else {
+ // Continue selecting by line
+ LineSelection(movePos.Position(), lineAnchorPos, selectionType == selWholeLine);
+ }
+ }
+
+ // Autoscroll
+ int lineMove = DisplayFromPosition(movePos.Position());
+ if (pt.y > rcClient.bottom) {
+ ScrollTo(lineMove - LinesOnScreen() + 1);
+ Redraw();
+ } else if (pt.y < rcClient.top) {
+ ScrollTo(lineMove);
+ Redraw();
+ }
+ EnsureCaretVisible(false, false, true);
+
+ if (hotspot.Valid() && !PointIsHotspot(pt))
+ SetHotSpotRange(NULL);
+
+ if (hotSpotClickPos != INVALID_POSITION && PositionFromLocation(pt,true,true) != hotSpotClickPos) {
+ if (inDragDrop == ddNone) {
+ DisplayCursor(Window::cursorText);
+ }
+ hotSpotClickPos = INVALID_POSITION;
+ }
+
+ } else {
+ if (vs.fixedColumnWidth > 0) { // There is a margin
+ if (PointInSelMargin(pt)) {
+ DisplayCursor(GetMarginCursor(pt));
+ SetHotSpotRange(NULL);
+ return; // No need to test for selection
+ }
+ }
+ // Display regular (drag) cursor over selection
+ if (PointInSelection(pt) && !SelectionEmpty()) {
+ DisplayCursor(Window::cursorArrow);
+ } else {
+ SetHoverIndicatorPoint(pt);
+ if (PointIsHotspot(pt)) {
+ DisplayCursor(Window::cursorHand);
+ SetHotSpotRange(&pt);
+ } else {
+ if (hoverIndicatorPos != invalidPosition)
+ DisplayCursor(Window::cursorHand);
+ else
+ DisplayCursor(Window::cursorText);
+ SetHotSpotRange(NULL);
+ }
+ }
+ }
+}
+
+void Editor::ButtonMove(Point pt) {
+ ButtonMoveWithModifiers(pt, 0);
+}
+
+void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
+ //Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop);
+ SelectionPosition newPos = SPositionFromLocation(pt, false, false,
+ AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular()));
+ if (hoverIndicatorPos != INVALID_POSITION)
+ InvalidateRange(newPos.Position(), newPos.Position() + 1);
+ newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
+ if (inDragDrop == ddInitial) {
+ inDragDrop = ddNone;
+ SetEmptySelection(newPos);
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ }
+ if (hotSpotClickPos != INVALID_POSITION && PointIsHotspot(pt)) {
+ hotSpotClickPos = INVALID_POSITION;
+ SelectionPosition newCharPos = SPositionFromLocation(pt, false, true, false);
+ newCharPos = MovePositionOutsideChar(newCharPos, -1);
+ NotifyHotSpotReleaseClick(newCharPos.Position(), ctrl ? SCI_CTRL : 0);
+ }
+ if (HaveMouseCapture()) {
+ if (PointInSelMargin(pt)) {
+ DisplayCursor(GetMarginCursor(pt));
+ } else {
+ DisplayCursor(Window::cursorText);
+ SetHotSpotRange(NULL);
+ }
+ ptMouseLast = pt;
+ SetMouseCapture(false);
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickScroll);
+ }
+ NotifyIndicatorClick(false, newPos.Position(), 0);
+ if (inDragDrop == ddDragging) {
+ SelectionPosition selStart = SelectionStart();
+ SelectionPosition selEnd = SelectionEnd();
+ if (selStart < selEnd) {
+ if (drag.Length()) {
+ const int length = static_cast<int>(drag.Length());
+ if (ctrl) {
+ const int lengthInserted = pdoc->InsertString(
+ newPos.Position(), drag.Data(), length);
+ if (lengthInserted > 0) {
+ SetSelection(newPos.Position(), newPos.Position() + lengthInserted);
+ }
+ } else if (newPos < selStart) {
+ pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length()));
+ const int lengthInserted = pdoc->InsertString(
+ newPos.Position(), drag.Data(), length);
+ if (lengthInserted > 0) {
+ SetSelection(newPos.Position(), newPos.Position() + lengthInserted);
+ }
+ } else if (newPos > selEnd) {
+ pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length()));
+ newPos.Add(-static_cast<int>(drag.Length()));
+ const int lengthInserted = pdoc->InsertString(
+ newPos.Position(), drag.Data(), length);
+ if (lengthInserted > 0) {
+ SetSelection(newPos.Position(), newPos.Position() + lengthInserted);
+ }
+ } else {
+ SetEmptySelection(newPos.Position());
+ }
+ drag.Clear();
+ }
+ selectionType = selChar;
+ }
+ } else {
+ if (selectionType == selChar) {
+ if (sel.Count() > 1) {
+ sel.RangeMain() =
+ SelectionRange(newPos, sel.Range(sel.Count() - 1).anchor);
+ InvalidateSelection(sel.RangeMain(), true);
+ } else {
+ SetSelection(newPos, sel.RangeMain().anchor);
+ }
+ }
+ sel.CommitTentative();
+ }
+ SetRectangularRange();
+ lastClickTime = curTime;
+ lastClick = pt;
+ lastXChosen = static_cast<int>(pt.x) + xOffset;
+ if (sel.selType == Selection::selStream) {
+ SetLastXChosen();
+ }
+ inDragDrop = ddNone;
+ EnsureCaretVisible(false);
+ }
+}
+
+// Called frequently to perform background UI including
+// caret blinking and automatic scrolling.
+void Editor::Tick() {
+ if (HaveMouseCapture()) {
+ // Auto scroll
+ ButtonMove(ptMouseLast);
+ }
+ if (caret.period > 0) {
+ timer.ticksToWait -= timer.tickSize;
+ if (timer.ticksToWait <= 0) {
+ caret.on = !caret.on;
+ timer.ticksToWait = caret.period;
+ if (caret.active) {
+ InvalidateCaret();
+ }
+ }
+ }
+ if (horizontalScrollBarVisible && trackLineWidth && (view.lineWidthMaxSeen > scrollWidth)) {
+ scrollWidth = view.lineWidthMaxSeen;
+ SetScrollBars();
+ }
+ if ((dwellDelay < SC_TIME_FOREVER) &&
+ (ticksToDwell > 0) &&
+ (!HaveMouseCapture()) &&
+ (ptMouseLast.y >= 0)) {
+ ticksToDwell -= timer.tickSize;
+ if (ticksToDwell <= 0) {
+ dwelling = true;
+ NotifyDwelling(ptMouseLast, dwelling);
+ }
+ }
+}
+
+bool Editor::Idle() {
+
+ bool idleDone;
+
+ bool wrappingDone = !Wrapping();
+
+ if (!wrappingDone) {
+ // Wrap lines during idle.
+ WrapLines(wsIdle);
+ // No more wrapping
+ if (!wrapPending.NeedsWrap())
+ wrappingDone = true;
+ }
+
+ // Add more idle things to do here, but make sure idleDone is
+ // set correctly before the function returns. returning
+ // false will stop calling this idle function until SetIdle() is
+ // called again.
+
+ idleDone = wrappingDone; // && thatDone && theOtherThingDone...
+
+ return !idleDone;
+}
+
+void Editor::SetTicking(bool) {
+ // SetTicking is deprecated. In the past it was pure virtual and was overridden in each
+ // derived platform class but fine grained timers should now be implemented.
+ // Either way, execution should not arrive here so assert failure.
+// BK - removed // assert(false);
+}
+
+void Editor::TickFor(TickReason reason) {
+ switch (reason) {
+ case tickCaret:
+ caret.on = !caret.on;
+ if (caret.active) {
+ InvalidateCaret();
+ }
+ break;
+ case tickScroll:
+ // Auto scroll
+ ButtonMove(ptMouseLast);
+ break;
+ case tickWiden:
+ SetScrollBars();
+ FineTickerCancel(tickWiden);
+ break;
+ case tickDwell:
+ if ((!HaveMouseCapture()) &&
+ (ptMouseLast.y >= 0)) {
+ dwelling = true;
+ NotifyDwelling(ptMouseLast, dwelling);
+ }
+ FineTickerCancel(tickDwell);
+ break;
+ default:
+ // tickPlatform handled by subclass
+ break;
+ }
+}
+
+bool Editor::FineTickerAvailable() {
+ return false;
+}
+
+// FineTickerStart is be overridden by subclasses that support fine ticking so
+// this method should never be called.
+bool Editor::FineTickerRunning(TickReason) {
+ assert(false);
+ return false;
+}
+
+// FineTickerStart is be overridden by subclasses that support fine ticking so
+// this method should never be called.
+void Editor::FineTickerStart(TickReason, int, int) {
+ assert(false);
+}
+
+// FineTickerCancel is be overridden by subclasses that support fine ticking so
+// this method should never be called.
+void Editor::FineTickerCancel(TickReason) {
+ assert(false);
+}
+
+void Editor::SetFocusState(bool focusState) {
+ hasFocus = focusState;
+ NotifyFocus(hasFocus);
+ if (!hasFocus) {
+ CancelModes();
+ }
+ ShowCaretAtCurrentPosition();
+}
+
+int Editor::PositionAfterArea(PRectangle rcArea) const {
+ // The start of the document line after the display line after the area
+ // This often means that the line after a modification is restyled which helps
+ // detect multiline comment additions and heals single line comments
+ int lineAfter = TopLineOfMain() + static_cast<int>(rcArea.bottom - 1) / vs.lineHeight + 1;
+ if (lineAfter < cs.LinesDisplayed())
+ return pdoc->LineStart(cs.DocFromDisplay(lineAfter) + 1);
+ else
+ return pdoc->Length();
+}
+
+// Style to a position within the view. If this causes a change at end of last line then
+// affects later lines so style all the viewed text.
+void Editor::StyleToPositionInView(Position pos) {
+ int endWindow = PositionAfterArea(GetClientDrawingRectangle());
+ if (pos > endWindow)
+ pos = endWindow;
+ int styleAtEnd = pdoc->StyleAt(pos-1);
+ pdoc->EnsureStyledTo(pos);
+ if ((endWindow > pos) && (styleAtEnd != pdoc->StyleAt(pos-1))) {
+ // Style at end of line changed so is multi-line change like starting a comment
+ // so require rest of window to be styled.
+ DiscardOverdraw(); // Prepared bitmaps may be invalid
+ // DiscardOverdraw may have truncated client drawing area so recalculate endWindow
+ endWindow = PositionAfterArea(GetClientDrawingRectangle());
+ pdoc->EnsureStyledTo(endWindow);
+ }
+}
+
+void Editor::IdleWork() {
+ // Style the line after the modification as this allows modifications that change just the
+ // line of the modification to heal instead of propagating to the rest of the window.
+ if (workNeeded.items & WorkNeeded::workStyle)
+ StyleToPositionInView(pdoc->LineStart(pdoc->LineFromPosition(workNeeded.upTo) + 2));
+
+ NotifyUpdateUI();
+ workNeeded.Reset();
+}
+
+void Editor::QueueIdleWork(WorkNeeded::workItems items, int upTo) {
+ workNeeded.Need(items, upTo);
+}
+
+bool Editor::PaintContains(PRectangle rc) {
+ if (rc.Empty()) {
+ return true;
+ } else {
+ return rcPaint.Contains(rc);
+ }
+}
+
+bool Editor::PaintContainsMargin() {
+ if (wMargin.GetID()) {
+ // With separate margin view, paint of text view
+ // never contains margin.
+ return false;
+ }
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart);
+ return PaintContains(rcSelMargin);
+}
+
+void Editor::CheckForChangeOutsidePaint(Range r) {
+ if (paintState == painting && !paintingAllText) {
+ //Platform::DebugPrintf("Checking range in paint %d-%d\n", r.start, r.end);
+ if (!r.Valid())
+ return;
+
+ PRectangle rcRange = RectangleFromRange(r, 0);
+ PRectangle rcText = GetTextRectangle();
+ if (rcRange.top < rcText.top) {
+ rcRange.top = rcText.top;
+ }
+ if (rcRange.bottom > rcText.bottom) {
+ rcRange.bottom = rcText.bottom;
+ }
+
+ if (!PaintContains(rcRange)) {
+ AbandonPaint();
+ paintAbandonedByStyling = true;
+ }
+ }
+}
+
+void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {
+ if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) {
+ if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) {
+ CheckForChangeOutsidePaint(Range(braces[0]));
+ CheckForChangeOutsidePaint(Range(pos0));
+ braces[0] = pos0;
+ }
+ if ((braces[1] != pos1) || (matchStyle != bracesMatchStyle)) {
+ CheckForChangeOutsidePaint(Range(braces[1]));
+ CheckForChangeOutsidePaint(Range(pos1));
+ braces[1] = pos1;
+ }
+ bracesMatchStyle = matchStyle;
+ if (paintState == notPainting) {
+ Redraw();
+ }
+ }
+}
+
+void Editor::SetAnnotationHeights(int start, int end) {
+ if (vs.annotationVisible) {
+ RefreshStyleData();
+ bool changedHeight = false;
+ for (int line=start; line<end && line<pdoc->LinesTotal(); line++) {
+ int linesWrapped = 1;
+ if (Wrapping()) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this));
+ if (surface && ll) {
+ view.LayoutLine(*this, line, surface, vs, ll, wrapWidth);
+ linesWrapped = ll->lines;
+ }
+ }
+ if (cs.SetHeight(line, pdoc->AnnotationLines(line) + linesWrapped))
+ changedHeight = true;
+ }
+ if (changedHeight) {
+ Redraw();
+ }
+ }
+}
+
+void Editor::SetDocPointer(Document *document) {
+ //Platform::DebugPrintf("** %x setdoc to %x\n", pdoc, document);
+ pdoc->RemoveWatcher(this, 0);
+ pdoc->Release();
+ if (document == NULL) {
+ pdoc = new Document();
+ } else {
+ pdoc = document;
+ }
+ pdoc->AddRef();
+
+ // Ensure all positions within document
+ sel.Clear();
+ targetStart = 0;
+ targetEnd = 0;
+
+ braces[0] = invalidPosition;
+ braces[1] = invalidPosition;
+
+ vs.ReleaseAllExtendedStyles();
+
+ SetRepresentations();
+
+ // Reset the contraction state to fully shown.
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ view.llc.Deallocate();
+ NeedWrapping();
+
+ hotspot = Range(invalidPosition);
+ hoverIndicatorPos = invalidPosition;
+
+ view.ClearAllTabstops();
+
+ pdoc->AddWatcher(this, 0);
+ SetScrollBars();
+ Redraw();
+}
+
+void Editor::SetAnnotationVisible(int visible) {
+ if (vs.annotationVisible != visible) {
+ bool changedFromOrToHidden = ((vs.annotationVisible != 0) != (visible != 0));
+ vs.annotationVisible = visible;
+ if (changedFromOrToHidden) {
+ int dir = vs.annotationVisible ? 1 : -1;
+ for (int line=0; line<pdoc->LinesTotal(); line++) {
+ int annotationLines = pdoc->AnnotationLines(line);
+ if (annotationLines > 0) {
+ cs.SetHeight(line, cs.GetHeight(line) + annotationLines * dir);
+ }
+ }
+ }
+ Redraw();
+ }
+}
+
+/**
+ * Recursively expand a fold, making lines visible except where they have an unexpanded parent.
+ */
+int Editor::ExpandLine(int line) {
+ int lineMaxSubord = pdoc->GetLastChild(line);
+ line++;
+ while (line <= lineMaxSubord) {
+ cs.SetVisible(line, line, true);
+ int level = pdoc->GetLevel(line);
+ if (level & SC_FOLDLEVELHEADERFLAG) {
+ if (cs.GetExpanded(line)) {
+ line = ExpandLine(line);
+ } else {
+ line = pdoc->GetLastChild(line);
+ }
+ }
+ line++;
+ }
+ return lineMaxSubord;
+}
+
+void Editor::SetFoldExpanded(int lineDoc, bool expanded) {
+ if (cs.SetExpanded(lineDoc, expanded)) {
+ RedrawSelMargin();
+ }
+}
+
+void Editor::FoldLine(int line, int action) {
+ if (line >= 0) {
+ if (action == SC_FOLDACTION_TOGGLE) {
+ if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) {
+ line = pdoc->GetFoldParent(line);
+ if (line < 0)
+ return;
+ }
+ action = (cs.GetExpanded(line)) ? SC_FOLDACTION_CONTRACT : SC_FOLDACTION_EXPAND;
+ }
+
+ if (action == SC_FOLDACTION_CONTRACT) {
+ int lineMaxSubord = pdoc->GetLastChild(line);
+ if (lineMaxSubord > line) {
+ cs.SetExpanded(line, 0);
+ cs.SetVisible(line + 1, lineMaxSubord, false);
+
+ int lineCurrent = pdoc->LineFromPosition(sel.MainCaret());
+ if (lineCurrent > line && lineCurrent <= lineMaxSubord) {
+ // This does not re-expand the fold
+ EnsureCaretVisible();
+ }
+ }
+
+ } else {
+ if (!(cs.GetVisible(line))) {
+ EnsureLineVisible(line, false);
+ GoToLine(line);
+ }
+ cs.SetExpanded(line, 1);
+ ExpandLine(line);
+ }
+
+ SetScrollBars();
+ Redraw();
+ }
+}
+
+void Editor::FoldExpand(int line, int action, int level) {
+ bool expanding = action == SC_FOLDACTION_EXPAND;
+ if (action == SC_FOLDACTION_TOGGLE) {
+ expanding = !cs.GetExpanded(line);
+ }
+ SetFoldExpanded(line, expanding);
+ if (expanding && (cs.HiddenLines() == 0))
+ // Nothing to do
+ return;
+ int lineMaxSubord = pdoc->GetLastChild(line, level & SC_FOLDLEVELNUMBERMASK);
+ line++;
+ cs.SetVisible(line, lineMaxSubord, expanding);
+ while (line <= lineMaxSubord) {
+ int levelLine = pdoc->GetLevel(line);
+ if (levelLine & SC_FOLDLEVELHEADERFLAG) {
+ SetFoldExpanded(line, expanding);
+ }
+ line++;
+ }
+ SetScrollBars();
+ Redraw();
+}
+
+int Editor::ContractedFoldNext(int lineStart) const {
+ for (int line = lineStart; line<pdoc->LinesTotal();) {
+ if (!cs.GetExpanded(line) && (pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG))
+ return line;
+ line = cs.ContractedNext(line+1);
+ if (line < 0)
+ return -1;
+ }
+
+ return -1;
+}
+
+/**
+ * Recurse up from this line to find any folds that prevent this line from being visible
+ * and unfold them all.
+ */
+void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) {
+
+ // In case in need of wrapping to ensure DisplayFromDoc works.
+ if (lineDoc >= wrapPending.start)
+ WrapLines(wsAll);
+
+ if (!cs.GetVisible(lineDoc)) {
+ // Back up to find a non-blank line
+ int lookLine = lineDoc;
+ int lookLineLevel = pdoc->GetLevel(lookLine);
+ while ((lookLine > 0) && (lookLineLevel & SC_FOLDLEVELWHITEFLAG)) {
+ lookLineLevel = pdoc->GetLevel(--lookLine);
+ }
+ int lineParent = pdoc->GetFoldParent(lookLine);
+ if (lineParent < 0) {
+ // Backed up to a top level line, so try to find parent of initial line
+ lineParent = pdoc->GetFoldParent(lineDoc);
+ }
+ if (lineParent >= 0) {
+ if (lineDoc != lineParent)
+ EnsureLineVisible(lineParent, enforcePolicy);
+ if (!cs.GetExpanded(lineParent)) {
+ cs.SetExpanded(lineParent, 1);
+ ExpandLine(lineParent);
+ }
+ }
+ SetScrollBars();
+ Redraw();
+ }
+ if (enforcePolicy) {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (visiblePolicy & VISIBLE_SLOP) {
+ if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) {
+ SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ } else if ((lineDisplay > topLine + LinesOnScreen() - 1) ||
+ ((visiblePolicy & VISIBLE_STRICT) && (lineDisplay > topLine + LinesOnScreen() - 1 - visibleSlop))) {
+ SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() + 1 + visibleSlop, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ } else {
+ if ((topLine > lineDisplay) || (lineDisplay > topLine + LinesOnScreen() - 1) || (visiblePolicy & VISIBLE_STRICT)) {
+ SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() / 2 + 1, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ }
+ }
+}
+
+void Editor::FoldAll(int action) {
+ pdoc->EnsureStyledTo(pdoc->Length());
+ int maxLine = pdoc->LinesTotal();
+ bool expanding = action == SC_FOLDACTION_EXPAND;
+ if (action == SC_FOLDACTION_TOGGLE) {
+ // Discover current state
+ for (int lineSeek = 0; lineSeek < maxLine; lineSeek++) {
+ if (pdoc->GetLevel(lineSeek) & SC_FOLDLEVELHEADERFLAG) {
+ expanding = !cs.GetExpanded(lineSeek);
+ break;
+ }
+ }
+ }
+ if (expanding) {
+ cs.SetVisible(0, maxLine-1, true);
+ for (int line = 0; line < maxLine; line++) {
+ int levelLine = pdoc->GetLevel(line);
+ if (levelLine & SC_FOLDLEVELHEADERFLAG) {
+ SetFoldExpanded(line, true);
+ }
+ }
+ } else {
+ for (int line = 0; line < maxLine; line++) {
+ int level = pdoc->GetLevel(line);
+ if ((level & SC_FOLDLEVELHEADERFLAG) &&
+ (SC_FOLDLEVELBASE == (level & SC_FOLDLEVELNUMBERMASK))) {
+ SetFoldExpanded(line, false);
+ int lineMaxSubord = pdoc->GetLastChild(line, -1);
+ if (lineMaxSubord > line) {
+ cs.SetVisible(line + 1, lineMaxSubord, false);
+ }
+ }
+ }
+ }
+ SetScrollBars();
+ Redraw();
+}
+
+void Editor::FoldChanged(int line, int levelNow, int levelPrev) {
+ if (levelNow & SC_FOLDLEVELHEADERFLAG) {
+ if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
+ // Adding a fold point.
+ if (cs.SetExpanded(line, true)) {
+ RedrawSelMargin();
+ }
+ FoldExpand(line, SC_FOLDACTION_EXPAND, levelPrev);
+ }
+ } else if (levelPrev & SC_FOLDLEVELHEADERFLAG) {
+ if (!cs.GetExpanded(line)) {
+ // Removing the fold from one that has been contracted so should expand
+ // otherwise lines are left invisible with no way to make them visible
+ if (cs.SetExpanded(line, true)) {
+ RedrawSelMargin();
+ }
+ FoldExpand(line, SC_FOLDACTION_EXPAND, levelPrev);
+ }
+ }
+ if (!(levelNow & SC_FOLDLEVELWHITEFLAG) &&
+ ((levelPrev & SC_FOLDLEVELNUMBERMASK) > (levelNow & SC_FOLDLEVELNUMBERMASK))) {
+ if (cs.HiddenLines()) {
+ // See if should still be hidden
+ int parentLine = pdoc->GetFoldParent(line);
+ if ((parentLine < 0) || (cs.GetExpanded(parentLine) && cs.GetVisible(parentLine))) {
+ cs.SetVisible(line, line, true);
+ SetScrollBars();
+ Redraw();
+ }
+ }
+ }
+}
+
+void Editor::NeedShown(int pos, int len) {
+ if (foldAutomatic & SC_AUTOMATICFOLD_SHOW) {
+ int lineStart = pdoc->LineFromPosition(pos);
+ int lineEnd = pdoc->LineFromPosition(pos+len);
+ for (int line = lineStart; line <= lineEnd; line++) {
+ EnsureLineVisible(line, false);
+ }
+ } else {
+ NotifyNeedShown(pos, len);
+ }
+}
+
+int Editor::GetTag(char *tagValue, int tagNumber) {
+ const char *text = 0;
+ int length = 0;
+ if ((tagNumber >= 1) && (tagNumber <= 9)) {
+ char name[3] = "\\?";
+ name[1] = static_cast<char>(tagNumber + '0');
+ length = 2;
+ text = pdoc->SubstituteByPosition(name, &length);
+ }
+ if (tagValue) {
+ if (text)
+ memcpy(tagValue, text, length + 1);
+ else
+ *tagValue = '\0';
+ }
+ return length;
+}
+
+int Editor::ReplaceTarget(bool replacePatterns, const char *text, int length) {
+ UndoGroup ug(pdoc);
+ if (length == -1)
+ length = istrlen(text);
+ if (replacePatterns) {
+ text = pdoc->SubstituteByPosition(text, &length);
+ if (!text) {
+ return 0;
+ }
+ }
+ if (targetStart != targetEnd)
+ pdoc->DeleteChars(targetStart, targetEnd - targetStart);
+ targetEnd = targetStart;
+ const int lengthInserted = pdoc->InsertString(targetStart, text, length);
+ targetEnd = targetStart + lengthInserted;
+ return length;
+}
+
+bool Editor::IsUnicodeMode() const {
+ return pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage);
+}
+
+int Editor::CodePage() const {
+ if (pdoc)
+ return pdoc->dbcsCodePage;
+ else
+ return 0;
+}
+
+int Editor::WrapCount(int line) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this));
+
+ if (surface && ll) {
+ view.LayoutLine(*this, line, surface, vs, ll, wrapWidth);
+ return ll->lines;
+ } else {
+ return 1;
+ }
+}
+
+void Editor::AddStyledText(char *buffer, int appendLength) {
+ // The buffer consists of alternating character bytes and style bytes
+ int textLength = appendLength / 2;
+ std::string text(textLength, '\0');
+ int i;
+ for (i = 0; i < textLength; i++) {
+ text[i] = buffer[i*2];
+ }
+ const int lengthInserted = pdoc->InsertString(CurrentPosition(), text.c_str(), textLength);
+ for (i = 0; i < textLength; i++) {
+ text[i] = buffer[i*2+1];
+ }
+ pdoc->StartStyling(CurrentPosition(), static_cast<unsigned char>(0xff));
+ pdoc->SetStyles(textLength, text.c_str());
+ SetEmptySelection(sel.MainCaret() + lengthInserted);
+}
+
+static bool ValidMargin(uptr_t wParam) {
+ return wParam <= SC_MAX_MARGIN;
+}
+
+static char *CharPtrFromSPtr(sptr_t lParam) {
+ return reinterpret_cast<char *>(lParam);
+}
+
+void Editor::StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ vs.EnsureStyle(wParam);
+ switch (iMessage) {
+ case SCI_STYLESETFORE:
+ vs.styles[wParam].fore = ColourDesired(static_cast<long>(lParam));
+ break;
+ case SCI_STYLESETBACK:
+ vs.styles[wParam].back = ColourDesired(static_cast<long>(lParam));
+ break;
+ case SCI_STYLESETBOLD:
+ vs.styles[wParam].weight = lParam != 0 ? SC_WEIGHT_BOLD : SC_WEIGHT_NORMAL;
+ break;
+ case SCI_STYLESETWEIGHT:
+ vs.styles[wParam].weight = static_cast<int>(lParam);
+ break;
+ case SCI_STYLESETITALIC:
+ vs.styles[wParam].italic = lParam != 0;
+ break;
+ case SCI_STYLESETEOLFILLED:
+ vs.styles[wParam].eolFilled = lParam != 0;
+ break;
+ case SCI_STYLESETSIZE:
+ vs.styles[wParam].size = static_cast<int>(lParam * SC_FONT_SIZE_MULTIPLIER);
+ break;
+ case SCI_STYLESETSIZEFRACTIONAL:
+ vs.styles[wParam].size = static_cast<int>(lParam);
+ break;
+ case SCI_STYLESETFONT:
+ if (lParam != 0) {
+ vs.SetStyleFontName(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ }
+ break;
+ case SCI_STYLESETUNDERLINE:
+ vs.styles[wParam].underline = lParam != 0;
+ break;
+ case SCI_STYLESETCASE:
+ vs.styles[wParam].caseForce = static_cast<Style::ecaseForced>(lParam);
+ break;
+ case SCI_STYLESETCHARACTERSET:
+ vs.styles[wParam].characterSet = static_cast<int>(lParam);
+ pdoc->SetCaseFolder(NULL);
+ break;
+ case SCI_STYLESETVISIBLE:
+ vs.styles[wParam].visible = lParam != 0;
+ break;
+ case SCI_STYLESETCHANGEABLE:
+ vs.styles[wParam].changeable = lParam != 0;
+ break;
+ case SCI_STYLESETHOTSPOT:
+ vs.styles[wParam].hotspot = lParam != 0;
+ break;
+ }
+ InvalidateStyleRedraw();
+}
+
+sptr_t Editor::StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ vs.EnsureStyle(wParam);
+ switch (iMessage) {
+ case SCI_STYLEGETFORE:
+ return vs.styles[wParam].fore.AsLong();
+ case SCI_STYLEGETBACK:
+ return vs.styles[wParam].back.AsLong();
+ case SCI_STYLEGETBOLD:
+ return vs.styles[wParam].weight > SC_WEIGHT_NORMAL;
+ case SCI_STYLEGETWEIGHT:
+ return vs.styles[wParam].weight;
+ case SCI_STYLEGETITALIC:
+ return vs.styles[wParam].italic ? 1 : 0;
+ case SCI_STYLEGETEOLFILLED:
+ return vs.styles[wParam].eolFilled ? 1 : 0;
+ case SCI_STYLEGETSIZE:
+ return vs.styles[wParam].size / SC_FONT_SIZE_MULTIPLIER;
+ case SCI_STYLEGETSIZEFRACTIONAL:
+ return vs.styles[wParam].size;
+ case SCI_STYLEGETFONT:
+ return StringResult(lParam, vs.styles[wParam].fontName);
+ case SCI_STYLEGETUNDERLINE:
+ return vs.styles[wParam].underline ? 1 : 0;
+ case SCI_STYLEGETCASE:
+ return static_cast<int>(vs.styles[wParam].caseForce);
+ case SCI_STYLEGETCHARACTERSET:
+ return vs.styles[wParam].characterSet;
+ case SCI_STYLEGETVISIBLE:
+ return vs.styles[wParam].visible ? 1 : 0;
+ case SCI_STYLEGETCHANGEABLE:
+ return vs.styles[wParam].changeable ? 1 : 0;
+ case SCI_STYLEGETHOTSPOT:
+ return vs.styles[wParam].hotspot ? 1 : 0;
+ }
+ return 0;
+}
+
+sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
+ const size_t len = val ? strlen(val) : 0;
+ if (lParam) {
+ char *ptr = CharPtrFromSPtr(lParam);
+ if (val)
+ memcpy(ptr, val, len+1);
+ else
+ *ptr = 0;
+ }
+ return len; // Not including NUL
+}
+
+sptr_t Editor::BytesResult(sptr_t lParam, const unsigned char *val, size_t len) {
+ // No NUL termination: len is number of valid/displayed bytes
+ if ((lParam) && (len > 0)) {
+ char *ptr = CharPtrFromSPtr(lParam);
+ if (val)
+ memcpy(ptr, val, len);
+ else
+ *ptr = 0;
+ }
+ return val ? len : 0;
+}
+
+sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ //Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam);
+
+ // Optional macro recording hook
+ if (recordingMacro)
+ NotifyMacroRecord(iMessage, wParam, lParam);
+
+ switch (iMessage) {
+
+ case SCI_GETTEXT: {
+ if (lParam == 0)
+ return pdoc->Length() + 1;
+ if (wParam == 0)
+ return 0;
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iChar = 0;
+ for (; iChar < wParam - 1; iChar++)
+ ptr[iChar] = pdoc->CharAt(iChar);
+ ptr[iChar] = '\0';
+ return iChar;
+ }
+
+ case SCI_SETTEXT: {
+ if (lParam == 0)
+ return 0;
+ UndoGroup ug(pdoc);
+ pdoc->DeleteChars(0, pdoc->Length());
+ SetEmptySelection(0);
+ const char *text = CharPtrFromSPtr(lParam);
+ pdoc->InsertString(0, text, istrlen(text));
+ return 1;
+ }
+
+ case SCI_GETTEXTLENGTH:
+ return pdoc->Length();
+
+ case SCI_CUT:
+ Cut();
+ SetLastXChosen();
+ break;
+
+ case SCI_COPY:
+ Copy();
+ break;
+
+ case SCI_COPYALLOWLINE:
+ CopyAllowLine();
+ break;
+
+ case SCI_VERTICALCENTRECARET:
+ VerticalCentreCaret();
+ break;
+
+ case SCI_MOVESELECTEDLINESUP:
+ MoveSelectedLinesUp();
+ break;
+
+ case SCI_MOVESELECTEDLINESDOWN:
+ MoveSelectedLinesDown();
+ break;
+
+ case SCI_COPYRANGE:
+ CopyRangeToClipboard(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_COPYTEXT:
+ CopyText(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_PASTE:
+ Paste();
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+
+ case SCI_CLEAR:
+ Clear();
+ SetLastXChosen();
+ EnsureCaretVisible();
+ break;
+
+ case SCI_UNDO:
+ Undo();
+ SetLastXChosen();
+ break;
+
+ case SCI_CANUNDO:
+ return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0;
+
+ case SCI_EMPTYUNDOBUFFER:
+ pdoc->DeleteUndoHistory();
+ return 0;
+
+ case SCI_GETFIRSTVISIBLELINE:
+ return topLine;
+
+ case SCI_SETFIRSTVISIBLELINE:
+ ScrollTo(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETLINE: { // Risk of overwriting the end of the buffer
+ int lineStart = pdoc->LineStart(static_cast<int>(wParam));
+ int lineEnd = pdoc->LineStart(static_cast<int>(wParam + 1));
+ if (lParam == 0) {
+ return lineEnd - lineStart;
+ }
+ char *ptr = CharPtrFromSPtr(lParam);
+ int iPlace = 0;
+ for (int iChar = lineStart; iChar < lineEnd; iChar++) {
+ ptr[iPlace++] = pdoc->CharAt(iChar);
+ }
+ return iPlace;
+ }
+
+ case SCI_GETLINECOUNT:
+ if (pdoc->LinesTotal() == 0)
+ return 1;
+ else
+ return pdoc->LinesTotal();
+
+ case SCI_GETMODIFY:
+ return !pdoc->IsSavePoint();
+
+ case SCI_SETSEL: {
+ int nStart = static_cast<int>(wParam);
+ int nEnd = static_cast<int>(lParam);
+ if (nEnd < 0)
+ nEnd = pdoc->Length();
+ if (nStart < 0)
+ nStart = nEnd; // Remove selection
+ InvalidateSelection(SelectionRange(nStart, nEnd));
+ sel.Clear();
+ sel.selType = Selection::selStream;
+ SetSelection(nEnd, nStart);
+ EnsureCaretVisible();
+ }
+ break;
+
+ case SCI_GETSELTEXT: {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+ if (lParam == 0) {
+ return selectedText.LengthWithTerminator();
+ } else {
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iChar = 0;
+ if (selectedText.Length()) {
+ for (; iChar < selectedText.LengthWithTerminator(); iChar++)
+ ptr[iChar] = selectedText.Data()[iChar];
+ } else {
+ ptr[0] = '\0';
+ }
+ return iChar;
+ }
+ }
+
+ case SCI_LINEFROMPOSITION:
+ if (static_cast<int>(wParam) < 0)
+ return 0;
+ return pdoc->LineFromPosition(static_cast<int>(wParam));
+
+ case SCI_POSITIONFROMLINE:
+ if (static_cast<int>(wParam) < 0)
+ wParam = pdoc->LineFromPosition(SelectionStart().Position());
+ if (wParam == 0)
+ return 0; // Even if there is no text, there is a first line that starts at 0
+ if (static_cast<int>(wParam) > pdoc->LinesTotal())
+ return -1;
+ //if (wParam > pdoc->LineFromPosition(pdoc->Length())) // Useful test, anyway...
+ // return -1;
+ return pdoc->LineStart(static_cast<int>(wParam));
+
+ // Replacement of the old Scintilla interpretation of EM_LINELENGTH
+ case SCI_LINELENGTH:
+ if ((static_cast<int>(wParam) < 0) ||
+ (static_cast<int>(wParam) > pdoc->LineFromPosition(pdoc->Length())))
+ return 0;
+ return pdoc->LineStart(static_cast<int>(wParam) + 1) - pdoc->LineStart(static_cast<int>(wParam));
+
+ case SCI_REPLACESEL: {
+ if (lParam == 0)
+ return 0;
+ UndoGroup ug(pdoc);
+ ClearSelection();
+ char *replacement = CharPtrFromSPtr(lParam);
+ const int lengthInserted = pdoc->InsertString(
+ sel.MainCaret(), replacement, istrlen(replacement));
+ SetEmptySelection(sel.MainCaret() + lengthInserted);
+ EnsureCaretVisible();
+ }
+ break;
+
+ case SCI_SETTARGETSTART:
+ targetStart = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETTARGETSTART:
+ return targetStart;
+
+ case SCI_SETTARGETEND:
+ targetEnd = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETTARGETEND:
+ return targetEnd;
+
+ case SCI_SETTARGETRANGE:
+ targetStart = static_cast<int>(wParam);
+ targetEnd = static_cast<int>(lParam);
+ break;
+
+ case SCI_TARGETFROMSELECTION:
+ if (sel.MainCaret() < sel.MainAnchor()) {
+ targetStart = sel.MainCaret();
+ targetEnd = sel.MainAnchor();
+ } else {
+ targetStart = sel.MainAnchor();
+ targetEnd = sel.MainCaret();
+ }
+ break;
+
+ case SCI_GETTARGETTEXT: {
+ std::string text = RangeText(targetStart, targetEnd);
+ return BytesResult(lParam, reinterpret_cast<const unsigned char *>(text.c_str()), text.length());
+ }
+
+ case SCI_REPLACETARGET:
+ PLATFORM_ASSERT(lParam);
+ return ReplaceTarget(false, CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+
+ case SCI_REPLACETARGETRE:
+ PLATFORM_ASSERT(lParam);
+ return ReplaceTarget(true, CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+
+ case SCI_SEARCHINTARGET:
+ PLATFORM_ASSERT(lParam);
+ return SearchInTarget(CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+
+ case SCI_SETSEARCHFLAGS:
+ searchFlags = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETSEARCHFLAGS:
+ return searchFlags;
+
+ case SCI_GETTAG:
+ return GetTag(CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+
+ case SCI_POSITIONBEFORE:
+ return pdoc->MovePositionOutsideChar(static_cast<int>(wParam) - 1, -1, true);
+
+ case SCI_POSITIONAFTER:
+ return pdoc->MovePositionOutsideChar(static_cast<int>(wParam) + 1, 1, true);
+
+ case SCI_POSITIONRELATIVE:
+ return Platform::Clamp(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam)), 0, pdoc->Length());
+
+ case SCI_LINESCROLL:
+ ScrollTo(topLine + static_cast<int>(lParam));
+ HorizontalScrollTo(xOffset + static_cast<int>(wParam)* static_cast<int>(vs.spaceWidth));
+ return 1;
+
+ case SCI_SETXOFFSET:
+ xOffset = static_cast<int>(wParam);
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ SetHorizontalScrollPos();
+ Redraw();
+ break;
+
+ case SCI_GETXOFFSET:
+ return xOffset;
+
+ case SCI_CHOOSECARETX:
+ SetLastXChosen();
+ break;
+
+ case SCI_SCROLLCARET:
+ EnsureCaretVisible();
+ break;
+
+ case SCI_SETREADONLY:
+ pdoc->SetReadOnly(wParam != 0);
+ return 1;
+
+ case SCI_GETREADONLY:
+ return pdoc->IsReadOnly();
+
+ case SCI_CANPASTE:
+ return CanPaste();
+
+ case SCI_POINTXFROMPOSITION:
+ if (lParam < 0) {
+ return 0;
+ } else {
+ Point pt = LocationFromPosition(static_cast<int>(lParam));
+ // Convert to view-relative
+ return static_cast<int>(pt.x) - vs.textStart + vs.fixedColumnWidth;
+ }
+
+ case SCI_POINTYFROMPOSITION:
+ if (lParam < 0) {
+ return 0;
+ } else {
+ Point pt = LocationFromPosition(static_cast<int>(lParam));
+ return static_cast<int>(pt.y);
+ }
+
+ case SCI_FINDTEXT:
+ return FindText(wParam, lParam);
+
+ case SCI_GETTEXTRANGE: {
+ if (lParam == 0)
+ return 0;
+ Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam);
+ int cpMax = static_cast<int>(tr->chrg.cpMax);
+ if (cpMax == -1)
+ cpMax = pdoc->Length();
+ PLATFORM_ASSERT(cpMax <= pdoc->Length());
+ int len = static_cast<int>(cpMax - tr->chrg.cpMin); // No -1 as cpMin and cpMax are referring to inter character positions
+ pdoc->GetCharRange(tr->lpstrText, static_cast<int>(tr->chrg.cpMin), len);
+ // Spec says copied text is terminated with a NUL
+ tr->lpstrText[len] = '\0';
+ return len; // Not including NUL
+ }
+
+ case SCI_HIDESELECTION:
+ view.hideSelection = wParam != 0;
+ Redraw();
+ break;
+
+ case SCI_FORMATRANGE:
+ return FormatRange(wParam != 0, reinterpret_cast<Sci_RangeToFormat *>(lParam));
+
+ case SCI_GETMARGINLEFT:
+ return vs.leftMarginWidth;
+
+ case SCI_GETMARGINRIGHT:
+ return vs.rightMarginWidth;
+
+ case SCI_SETMARGINLEFT:
+ lastXChosen += static_cast<int>(lParam) - vs.leftMarginWidth;
+ vs.leftMarginWidth = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETMARGINRIGHT:
+ vs.rightMarginWidth = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ // Control specific mesages
+
+ case SCI_ADDTEXT: {
+ if (lParam == 0)
+ return 0;
+ const int lengthInserted = pdoc->InsertString(
+ CurrentPosition(), CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+ SetEmptySelection(sel.MainCaret() + lengthInserted);
+ return 0;
+ }
+
+ case SCI_ADDSTYLEDTEXT:
+ if (lParam)
+ AddStyledText(CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+ return 0;
+
+ case SCI_INSERTTEXT: {
+ if (lParam == 0)
+ return 0;
+ int insertPos = static_cast<int>(wParam);
+ if (static_cast<int>(wParam) == -1)
+ insertPos = CurrentPosition();
+ int newCurrent = CurrentPosition();
+ char *sz = CharPtrFromSPtr(lParam);
+ const int lengthInserted = pdoc->InsertString(insertPos, sz, istrlen(sz));
+ if (newCurrent > insertPos)
+ newCurrent += lengthInserted;
+ SetEmptySelection(newCurrent);
+ return 0;
+ }
+
+ case SCI_CHANGEINSERTION:
+ PLATFORM_ASSERT(lParam);
+ pdoc->ChangeInsertion(CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+ return 0;
+
+ case SCI_APPENDTEXT:
+ pdoc->InsertString(pdoc->Length(), CharPtrFromSPtr(lParam), static_cast<int>(wParam));
+ return 0;
+
+ case SCI_CLEARALL:
+ ClearAll();
+ return 0;
+
+ case SCI_DELETERANGE:
+ pdoc->DeleteChars(static_cast<int>(wParam), static_cast<int>(lParam));
+ return 0;
+
+ case SCI_CLEARDOCUMENTSTYLE:
+ ClearDocumentStyle();
+ return 0;
+
+ case SCI_SETUNDOCOLLECTION:
+ pdoc->SetUndoCollection(wParam != 0);
+ return 0;
+
+ case SCI_GETUNDOCOLLECTION:
+ return pdoc->IsCollectingUndo();
+
+ case SCI_BEGINUNDOACTION:
+ pdoc->BeginUndoAction();
+ return 0;
+
+ case SCI_ENDUNDOACTION:
+ pdoc->EndUndoAction();
+ return 0;
+
+ case SCI_GETCARETPERIOD:
+ return caret.period;
+
+ case SCI_SETCARETPERIOD:
+ CaretSetPeriod(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETWORDCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccWord, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETWORDCHARS: {
+ pdoc->SetDefaultCharClasses(false);
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccWord);
+ }
+ break;
+
+ case SCI_GETWHITESPACECHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccSpace, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETWHITESPACECHARS: {
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccSpace);
+ }
+ break;
+
+ case SCI_GETPUNCTUATIONCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccPunctuation, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETPUNCTUATIONCHARS: {
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccPunctuation);
+ }
+ break;
+
+ case SCI_SETCHARSDEFAULT:
+ pdoc->SetDefaultCharClasses(true);
+ break;
+
+ case SCI_GETLENGTH:
+ return pdoc->Length();
+
+ case SCI_ALLOCATE:
+ pdoc->Allocate(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETCHARAT:
+ return pdoc->CharAt(static_cast<int>(wParam));
+
+ case SCI_SETCURRENTPOS:
+ if (sel.IsRectangular()) {
+ sel.Rectangular().caret.SetPosition(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ } else {
+ SetSelection(static_cast<int>(wParam), sel.MainAnchor());
+ }
+ break;
+
+ case SCI_GETCURRENTPOS:
+ return sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret();
+
+ case SCI_SETANCHOR:
+ if (sel.IsRectangular()) {
+ sel.Rectangular().anchor.SetPosition(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ } else {
+ SetSelection(sel.MainCaret(), static_cast<int>(wParam));
+ }
+ break;
+
+ case SCI_GETANCHOR:
+ return sel.IsRectangular() ? sel.Rectangular().anchor.Position() : sel.MainAnchor();
+
+ case SCI_SETSELECTIONSTART:
+ SetSelection(Platform::Maximum(sel.MainCaret(), static_cast<int>(wParam)), static_cast<int>(wParam));
+ break;
+
+ case SCI_GETSELECTIONSTART:
+ return sel.LimitsForRectangularElseMain().start.Position();
+
+ case SCI_SETSELECTIONEND:
+ SetSelection(static_cast<int>(wParam), Platform::Minimum(sel.MainAnchor(), static_cast<int>(wParam)));
+ break;
+
+ case SCI_GETSELECTIONEND:
+ return sel.LimitsForRectangularElseMain().end.Position();
+
+ case SCI_SETEMPTYSELECTION:
+ SetEmptySelection(static_cast<int>(wParam));
+ break;
+
+ case SCI_SETPRINTMAGNIFICATION:
+ view.printParameters.magnification = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETPRINTMAGNIFICATION:
+ return view.printParameters.magnification;
+
+ case SCI_SETPRINTCOLOURMODE:
+ view.printParameters.colourMode = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETPRINTCOLOURMODE:
+ return view.printParameters.colourMode;
+
+ case SCI_SETPRINTWRAPMODE:
+ view.printParameters.wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone;
+ break;
+
+ case SCI_GETPRINTWRAPMODE:
+ return view.printParameters.wrapState;
+
+ case SCI_GETSTYLEAT:
+ if (static_cast<int>(wParam) >= pdoc->Length())
+ return 0;
+ else
+ return pdoc->StyleAt(static_cast<int>(wParam));
+
+ case SCI_REDO:
+ Redo();
+ break;
+
+ case SCI_SELECTALL:
+ SelectAll();
+ break;
+
+ case SCI_SETSAVEPOINT:
+ pdoc->SetSavePoint();
+ break;
+
+ case SCI_GETSTYLEDTEXT: {
+ if (lParam == 0)
+ return 0;
+ Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam);
+ int iPlace = 0;
+ for (long iChar = tr->chrg.cpMin; iChar < tr->chrg.cpMax; iChar++) {
+ tr->lpstrText[iPlace++] = pdoc->CharAt(static_cast<int>(iChar));
+ tr->lpstrText[iPlace++] = pdoc->StyleAt(static_cast<int>(iChar));
+ }
+ tr->lpstrText[iPlace] = '\0';
+ tr->lpstrText[iPlace + 1] = '\0';
+ return iPlace;
+ }
+
+ case SCI_CANREDO:
+ return (pdoc->CanRedo() && !pdoc->IsReadOnly()) ? 1 : 0;
+
+ case SCI_MARKERLINEFROMHANDLE:
+ return pdoc->LineFromHandle(static_cast<int>(wParam));
+
+ case SCI_MARKERDELETEHANDLE:
+ pdoc->DeleteMarkFromHandle(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETVIEWWS:
+ return vs.viewWhitespace;
+
+ case SCI_SETVIEWWS:
+ vs.viewWhitespace = static_cast<WhiteSpaceVisibility>(wParam);
+ Redraw();
+ break;
+
+ case SCI_GETWHITESPACESIZE:
+ return vs.whitespaceSize;
+
+ case SCI_SETWHITESPACESIZE:
+ vs.whitespaceSize = static_cast<int>(wParam);
+ Redraw();
+ break;
+
+ case SCI_POSITIONFROMPOINT:
+ return PositionFromLocation(Point::FromInts(static_cast<int>(wParam) - vs.ExternalMarginWidth(), static_cast<int>(lParam)),
+ false, false);
+
+ case SCI_POSITIONFROMPOINTCLOSE:
+ return PositionFromLocation(Point::FromInts(static_cast<int>(wParam) - vs.ExternalMarginWidth(), static_cast<int>(lParam)),
+ true, false);
+
+ case SCI_CHARPOSITIONFROMPOINT:
+ return PositionFromLocation(Point::FromInts(static_cast<int>(wParam) - vs.ExternalMarginWidth(), static_cast<int>(lParam)),
+ false, true);
+
+ case SCI_CHARPOSITIONFROMPOINTCLOSE:
+ return PositionFromLocation(Point::FromInts(static_cast<int>(wParam) - vs.ExternalMarginWidth(), static_cast<int>(lParam)),
+ true, true);
+
+ case SCI_GOTOLINE:
+ GoToLine(static_cast<int>(wParam));
+ break;
+
+ case SCI_GOTOPOS:
+ SetEmptySelection(static_cast<int>(wParam));
+ EnsureCaretVisible();
+ break;
+
+ case SCI_GETCURLINE: {
+ int lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret());
+ int lineStart = pdoc->LineStart(lineCurrentPos);
+ unsigned int lineEnd = pdoc->LineStart(lineCurrentPos + 1);
+ if (lParam == 0) {
+ return 1 + lineEnd - lineStart;
+ }
+ PLATFORM_ASSERT(wParam > 0);
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iPlace = 0;
+ for (unsigned int iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) {
+ ptr[iPlace++] = pdoc->CharAt(iChar);
+ }
+ ptr[iPlace] = '\0';
+ return sel.MainCaret() - lineStart;
+ }
+
+ case SCI_GETENDSTYLED:
+ return pdoc->GetEndStyled();
+
+ case SCI_GETEOLMODE:
+ return pdoc->eolMode;
+
+ case SCI_SETEOLMODE:
+ pdoc->eolMode = static_cast<int>(wParam);
+ break;
+
+ case SCI_SETLINEENDTYPESALLOWED:
+ if (pdoc->SetLineEndTypesAllowed(static_cast<int>(wParam))) {
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETLINEENDTYPESALLOWED:
+ return pdoc->GetLineEndTypesAllowed();
+
+ case SCI_GETLINEENDTYPESACTIVE:
+ return pdoc->GetLineEndTypesActive();
+
+ case SCI_STARTSTYLING:
+ pdoc->StartStyling(static_cast<int>(wParam), static_cast<char>(lParam));
+ break;
+
+ case SCI_SETSTYLING:
+ pdoc->SetStyleFor(static_cast<int>(wParam), static_cast<char>(lParam));
+ break;
+
+ case SCI_SETSTYLINGEX: // Specify a complete styling buffer
+ if (lParam == 0)
+ return 0;
+ pdoc->SetStyles(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_SETBUFFEREDDRAW:
+ view.bufferedDraw = wParam != 0;
+ break;
+
+ case SCI_GETBUFFEREDDRAW:
+ return view.bufferedDraw;
+
+ case SCI_GETTWOPHASEDRAW:
+ return view.phasesDraw == EditView::phasesTwo;
+
+ case SCI_SETTWOPHASEDRAW:
+ if (view.SetTwoPhaseDraw(wParam != 0))
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETPHASESDRAW:
+ return view.phasesDraw;
+
+ case SCI_SETPHASESDRAW:
+ if (view.SetPhasesDraw(static_cast<int>(wParam)))
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETFONTQUALITY:
+ vs.extraFontFlag &= ~SC_EFF_QUALITY_MASK;
+ vs.extraFontFlag |= (wParam & SC_EFF_QUALITY_MASK);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETFONTQUALITY:
+ return (vs.extraFontFlag & SC_EFF_QUALITY_MASK);
+
+ case SCI_SETTABWIDTH:
+ if (wParam > 0) {
+ pdoc->tabInChars = static_cast<int>(wParam);
+ if (pdoc->indentInChars == 0)
+ pdoc->actualIndentInChars = pdoc->tabInChars;
+ }
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETTABWIDTH:
+ return pdoc->tabInChars;
+
+ case SCI_CLEARTABSTOPS:
+ if (view.ClearTabstops(static_cast<int>(wParam))) {
+ DocModification mh(SC_MOD_CHANGETABSTOPS, 0, 0, 0, 0, static_cast<int>(wParam));
+ NotifyModified(pdoc, mh, NULL);
+ }
+ break;
+
+ case SCI_ADDTABSTOP:
+ if (view.AddTabstop(static_cast<int>(wParam), static_cast<int>(lParam))) {
+ DocModification mh(SC_MOD_CHANGETABSTOPS, 0, 0, 0, 0, static_cast<int>(wParam));
+ NotifyModified(pdoc, mh, NULL);
+ }
+ break;
+
+ case SCI_GETNEXTTABSTOP:
+ return view.GetNextTabstop(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_SETINDENT:
+ pdoc->indentInChars = static_cast<int>(wParam);
+ if (pdoc->indentInChars != 0)
+ pdoc->actualIndentInChars = pdoc->indentInChars;
+ else
+ pdoc->actualIndentInChars = pdoc->tabInChars;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETINDENT:
+ return pdoc->indentInChars;
+
+ case SCI_SETUSETABS:
+ pdoc->useTabs = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETUSETABS:
+ return pdoc->useTabs;
+
+ case SCI_SETLINEINDENTATION:
+ pdoc->SetLineIndentation(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_GETLINEINDENTATION:
+ return pdoc->GetLineIndentation(static_cast<int>(wParam));
+
+ case SCI_GETLINEINDENTPOSITION:
+ return pdoc->GetLineIndentPosition(static_cast<int>(wParam));
+
+ case SCI_SETTABINDENTS:
+ pdoc->tabIndents = wParam != 0;
+ break;
+
+ case SCI_GETTABINDENTS:
+ return pdoc->tabIndents;
+
+ case SCI_SETBACKSPACEUNINDENTS:
+ pdoc->backspaceUnindents = wParam != 0;
+ break;
+
+ case SCI_GETBACKSPACEUNINDENTS:
+ return pdoc->backspaceUnindents;
+
+ case SCI_SETMOUSEDWELLTIME:
+ dwellDelay = static_cast<int>(wParam);
+ ticksToDwell = dwellDelay;
+ break;
+
+ case SCI_GETMOUSEDWELLTIME:
+ return dwellDelay;
+
+ case SCI_WORDSTARTPOSITION:
+ return pdoc->ExtendWordSelect(static_cast<int>(wParam), -1, lParam != 0);
+
+ case SCI_WORDENDPOSITION:
+ return pdoc->ExtendWordSelect(static_cast<int>(wParam), 1, lParam != 0);
+
+ case SCI_SETWRAPMODE:
+ if (vs.SetWrapState(static_cast<int>(wParam))) {
+ xOffset = 0;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPMODE:
+ return vs.wrapState;
+
+ case SCI_SETWRAPVISUALFLAGS:
+ if (vs.SetWrapVisualFlags(static_cast<int>(wParam))) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPVISUALFLAGS:
+ return vs.wrapVisualFlags;
+
+ case SCI_SETWRAPVISUALFLAGSLOCATION:
+ if (vs.SetWrapVisualFlagsLocation(static_cast<int>(wParam))) {
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETWRAPVISUALFLAGSLOCATION:
+ return vs.wrapVisualFlagsLocation;
+
+ case SCI_SETWRAPSTARTINDENT:
+ if (vs.SetWrapVisualStartIndent(static_cast<int>(wParam))) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPSTARTINDENT:
+ return vs.wrapVisualStartIndent;
+
+ case SCI_SETWRAPINDENTMODE:
+ if (vs.SetWrapIndentMode(static_cast<int>(wParam))) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPINDENTMODE:
+ return vs.wrapIndentMode;
+
+ case SCI_SETLAYOUTCACHE:
+ view.llc.SetLevel(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETLAYOUTCACHE:
+ return view.llc.GetLevel();
+
+ case SCI_SETPOSITIONCACHE:
+ view.posCache.SetSize(wParam);
+ break;
+
+ case SCI_GETPOSITIONCACHE:
+ return view.posCache.GetSize();
+
+ case SCI_SETSCROLLWIDTH:
+ PLATFORM_ASSERT(wParam > 0);
+ if ((wParam > 0) && (wParam != static_cast<unsigned int >(scrollWidth))) {
+ view.lineWidthMaxSeen = 0;
+ scrollWidth = static_cast<int>(wParam);
+ SetScrollBars();
+ }
+ break;
+
+ case SCI_GETSCROLLWIDTH:
+ return scrollWidth;
+
+ case SCI_SETSCROLLWIDTHTRACKING:
+ trackLineWidth = wParam != 0;
+ break;
+
+ case SCI_GETSCROLLWIDTHTRACKING:
+ return trackLineWidth;
+
+ case SCI_LINESJOIN:
+ LinesJoin();
+ break;
+
+ case SCI_LINESSPLIT:
+ LinesSplit(static_cast<int>(wParam));
+ break;
+
+ case SCI_TEXTWIDTH:
+ PLATFORM_ASSERT(wParam < vs.styles.size());
+ PLATFORM_ASSERT(lParam);
+ return TextWidth(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+
+ case SCI_TEXTHEIGHT:
+ RefreshStyleData();
+ return vs.lineHeight;
+
+ case SCI_SETENDATLASTLINE:
+ PLATFORM_ASSERT((wParam == 0) || (wParam == 1));
+ if (endAtLastLine != (wParam != 0)) {
+ endAtLastLine = wParam != 0;
+ SetScrollBars();
+ }
+ break;
+
+ case SCI_GETENDATLASTLINE:
+ return endAtLastLine;
+
+ case SCI_SETCARETSTICKY:
+ PLATFORM_ASSERT(wParam <= SC_CARETSTICKY_WHITESPACE);
+ if (wParam <= SC_CARETSTICKY_WHITESPACE) {
+ caretSticky = static_cast<int>(wParam);
+ }
+ break;
+
+ case SCI_GETCARETSTICKY:
+ return caretSticky;
+
+ case SCI_TOGGLECARETSTICKY:
+ caretSticky = !caretSticky;
+ break;
+
+ case SCI_GETCOLUMN:
+ return pdoc->GetColumn(static_cast<int>(wParam));
+
+ case SCI_FINDCOLUMN:
+ return pdoc->FindColumn(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_SETHSCROLLBAR :
+ if (horizontalScrollBarVisible != (wParam != 0)) {
+ horizontalScrollBarVisible = wParam != 0;
+ SetScrollBars();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETHSCROLLBAR:
+ return horizontalScrollBarVisible;
+
+ case SCI_SETVSCROLLBAR:
+ if (verticalScrollBarVisible != (wParam != 0)) {
+ verticalScrollBarVisible = wParam != 0;
+ SetScrollBars();
+ ReconfigureScrollBars();
+ if (verticalScrollBarVisible)
+ SetVerticalScrollPos();
+ }
+ break;
+
+ case SCI_GETVSCROLLBAR:
+ return verticalScrollBarVisible;
+
+ case SCI_SETINDENTATIONGUIDES:
+ vs.viewIndentationGuides = IndentView(wParam);
+ Redraw();
+ break;
+
+ case SCI_GETINDENTATIONGUIDES:
+ return vs.viewIndentationGuides;
+
+ case SCI_SETHIGHLIGHTGUIDE:
+ if ((highlightGuideColumn != static_cast<int>(wParam)) || (wParam > 0)) {
+ highlightGuideColumn = static_cast<int>(wParam);
+ Redraw();
+ }
+ break;
+
+ case SCI_GETHIGHLIGHTGUIDE:
+ return highlightGuideColumn;
+
+ case SCI_GETLINEENDPOSITION:
+ return pdoc->LineEnd(static_cast<int>(wParam));
+
+ case SCI_SETCODEPAGE:
+ if (ValidCodePage(static_cast<int>(wParam))) {
+ if (pdoc->SetDBCSCodePage(static_cast<int>(wParam))) {
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ InvalidateStyleRedraw();
+ SetRepresentations();
+ }
+ }
+ break;
+
+ case SCI_GETCODEPAGE:
+ return pdoc->dbcsCodePage;
+
+ case SCI_SETIMEINTERACTION:
+ imeInteraction = static_cast<EditModel::IMEInteraction>(wParam);
+ break;
+
+ case SCI_GETIMEINTERACTION:
+ return imeInteraction;
+
+#ifdef INCLUDE_DEPRECATED_FEATURES
+ case SCI_SETUSEPALETTE:
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETUSEPALETTE:
+ return 0;
+#endif
+
+ // Marker definition and setting
+ case SCI_MARKERDEFINE:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].markType = static_cast<int>(lParam);
+ vs.CalcLargestMarkerHeight();
+ }
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_MARKERSYMBOLDEFINED:
+ if (wParam <= MARKER_MAX)
+ return vs.markers[wParam].markType;
+ else
+ return 0;
+
+ case SCI_MARKERSETFORE:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].fore = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETBACKSELECTED:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].backSelected = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERENABLEHIGHLIGHT:
+ marginView.highlightDelimiter.isEnabled = wParam == 1;
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETBACK:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].back = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETALPHA:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].alpha = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ break;
+ case SCI_MARKERADD: {
+ int markerID = pdoc->AddMark(static_cast<int>(wParam), static_cast<int>(lParam));
+ return markerID;
+ }
+ case SCI_MARKERADDSET:
+ if (lParam != 0)
+ pdoc->AddMarkSet(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_MARKERDELETE:
+ pdoc->DeleteMark(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_MARKERDELETEALL:
+ pdoc->DeleteAllMarks(static_cast<int>(wParam));
+ break;
+
+ case SCI_MARKERGET:
+ return pdoc->GetMark(static_cast<int>(wParam));
+
+ case SCI_MARKERNEXT:
+ return pdoc->MarkerNext(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_MARKERPREVIOUS: {
+ for (int iLine = static_cast<int>(wParam); iLine >= 0; iLine--) {
+ if ((pdoc->GetMark(iLine) & lParam) != 0)
+ return iLine;
+ }
+ }
+ return -1;
+
+ case SCI_MARKERDEFINEPIXMAP:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam));
+ vs.CalcLargestMarkerHeight();
+ }
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_RGBAIMAGESETWIDTH:
+ sizeRGBAImage.x = static_cast<XYPOSITION>(wParam);
+ break;
+
+ case SCI_RGBAIMAGESETHEIGHT:
+ sizeRGBAImage.y = static_cast<XYPOSITION>(wParam);
+ break;
+
+ case SCI_RGBAIMAGESETSCALE:
+ scaleRGBAImage = static_cast<float>(wParam);
+ break;
+
+ case SCI_MARKERDEFINERGBAIMAGE:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].SetRGBAImage(sizeRGBAImage, scaleRGBAImage / 100.0f, reinterpret_cast<unsigned char *>(lParam));
+ vs.CalcLargestMarkerHeight();
+ }
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_SETMARGINTYPEN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].style = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINTYPEN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].style;
+ else
+ return 0;
+
+ case SCI_SETMARGINWIDTHN:
+ if (ValidMargin(wParam)) {
+ // Short-circuit if the width is unchanged, to avoid unnecessary redraw.
+ if (vs.ms[wParam].width != lParam) {
+ lastXChosen += static_cast<int>(lParam) - vs.ms[wParam].width;
+ vs.ms[wParam].width = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ }
+ break;
+
+ case SCI_GETMARGINWIDTHN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].width;
+ else
+ return 0;
+
+ case SCI_SETMARGINMASKN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].mask = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINMASKN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].mask;
+ else
+ return 0;
+
+ case SCI_SETMARGINSENSITIVEN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].sensitive = lParam != 0;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINSENSITIVEN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].sensitive ? 1 : 0;
+ else
+ return 0;
+
+ case SCI_SETMARGINCURSORN:
+ if (ValidMargin(wParam))
+ vs.ms[wParam].cursor = static_cast<int>(lParam);
+ break;
+
+ case SCI_GETMARGINCURSORN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].cursor;
+ else
+ return 0;
+
+ case SCI_STYLECLEARALL:
+ vs.ClearStyles();
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_STYLESETFORE:
+ case SCI_STYLESETBACK:
+ case SCI_STYLESETBOLD:
+ case SCI_STYLESETWEIGHT:
+ case SCI_STYLESETITALIC:
+ case SCI_STYLESETEOLFILLED:
+ case SCI_STYLESETSIZE:
+ case SCI_STYLESETSIZEFRACTIONAL:
+ case SCI_STYLESETFONT:
+ case SCI_STYLESETUNDERLINE:
+ case SCI_STYLESETCASE:
+ case SCI_STYLESETCHARACTERSET:
+ case SCI_STYLESETVISIBLE:
+ case SCI_STYLESETCHANGEABLE:
+ case SCI_STYLESETHOTSPOT:
+ StyleSetMessage(iMessage, wParam, lParam);
+ break;
+
+ case SCI_STYLEGETFORE:
+ case SCI_STYLEGETBACK:
+ case SCI_STYLEGETBOLD:
+ case SCI_STYLEGETWEIGHT:
+ case SCI_STYLEGETITALIC:
+ case SCI_STYLEGETEOLFILLED:
+ case SCI_STYLEGETSIZE:
+ case SCI_STYLEGETSIZEFRACTIONAL:
+ case SCI_STYLEGETFONT:
+ case SCI_STYLEGETUNDERLINE:
+ case SCI_STYLEGETCASE:
+ case SCI_STYLEGETCHARACTERSET:
+ case SCI_STYLEGETVISIBLE:
+ case SCI_STYLEGETCHANGEABLE:
+ case SCI_STYLEGETHOTSPOT:
+ return StyleGetMessage(iMessage, wParam, lParam);
+
+ case SCI_STYLERESETDEFAULT:
+ vs.ResetDefaultStyle();
+ InvalidateStyleRedraw();
+ break;
+ case SCI_SETSTYLEBITS:
+ vs.EnsureStyle(0xff);
+ break;
+
+ case SCI_GETSTYLEBITS:
+ return 8;
+
+ case SCI_SETLINESTATE:
+ return pdoc->SetLineState(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_GETLINESTATE:
+ return pdoc->GetLineState(static_cast<int>(wParam));
+
+ case SCI_GETMAXLINESTATE:
+ return pdoc->GetMaxLineState();
+
+ case SCI_GETCARETLINEVISIBLE:
+ return vs.showCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLE:
+ vs.showCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+ case SCI_GETCARETLINEVISIBLEALWAYS:
+ return vs.alwaysShowCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLEALWAYS:
+ vs.alwaysShowCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETLINEBACK:
+ return vs.caretLineBackground.AsLong();
+ case SCI_SETCARETLINEBACK:
+ vs.caretLineBackground = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+ case SCI_GETCARETLINEBACKALPHA:
+ return vs.caretLineAlpha;
+ case SCI_SETCARETLINEBACKALPHA:
+ vs.caretLineAlpha = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ // Folding messages
+
+ case SCI_VISIBLEFROMDOCLINE:
+ return cs.DisplayFromDoc(static_cast<int>(wParam));
+
+ case SCI_DOCLINEFROMVISIBLE:
+ return cs.DocFromDisplay(static_cast<int>(wParam));
+
+ case SCI_WRAPCOUNT:
+ return WrapCount(static_cast<int>(wParam));
+
+ case SCI_SETFOLDLEVEL: {
+ int prev = pdoc->SetLevel(static_cast<int>(wParam), static_cast<int>(lParam));
+ if (prev != static_cast<int>(lParam))
+ RedrawSelMargin();
+ return prev;
+ }
+
+ case SCI_GETFOLDLEVEL:
+ return pdoc->GetLevel(static_cast<int>(wParam));
+
+ case SCI_GETLASTCHILD:
+ return pdoc->GetLastChild(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_GETFOLDPARENT:
+ return pdoc->GetFoldParent(static_cast<int>(wParam));
+
+ case SCI_SHOWLINES:
+ cs.SetVisible(static_cast<int>(wParam), static_cast<int>(lParam), true);
+ SetScrollBars();
+ Redraw();
+ break;
+
+ case SCI_HIDELINES:
+ if (wParam > 0)
+ cs.SetVisible(static_cast<int>(wParam), static_cast<int>(lParam), false);
+ SetScrollBars();
+ Redraw();
+ break;
+
+ case SCI_GETLINEVISIBLE:
+ return cs.GetVisible(static_cast<int>(wParam));
+
+ case SCI_GETALLLINESVISIBLE:
+ return cs.HiddenLines() ? 0 : 1;
+
+ case SCI_SETFOLDEXPANDED:
+ SetFoldExpanded(static_cast<int>(wParam), lParam != 0);
+ break;
+
+ case SCI_GETFOLDEXPANDED:
+ return cs.GetExpanded(static_cast<int>(wParam));
+
+ case SCI_SETAUTOMATICFOLD:
+ foldAutomatic = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETAUTOMATICFOLD:
+ return foldAutomatic;
+
+ case SCI_SETFOLDFLAGS:
+ foldFlags = static_cast<int>(wParam);
+ Redraw();
+ break;
+
+ case SCI_TOGGLEFOLD:
+ FoldLine(static_cast<int>(wParam), SC_FOLDACTION_TOGGLE);
+ break;
+
+ case SCI_FOLDLINE:
+ FoldLine(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_FOLDCHILDREN:
+ FoldExpand(static_cast<int>(wParam), static_cast<int>(lParam), pdoc->GetLevel(static_cast<int>(wParam)));
+ break;
+
+ case SCI_FOLDALL:
+ FoldAll(static_cast<int>(wParam));
+ break;
+
+ case SCI_EXPANDCHILDREN:
+ FoldExpand(static_cast<int>(wParam), SC_FOLDACTION_EXPAND, static_cast<int>(lParam));
+ break;
+
+ case SCI_CONTRACTEDFOLDNEXT:
+ return ContractedFoldNext(static_cast<int>(wParam));
+
+ case SCI_ENSUREVISIBLE:
+ EnsureLineVisible(static_cast<int>(wParam), false);
+ break;
+
+ case SCI_ENSUREVISIBLEENFORCEPOLICY:
+ EnsureLineVisible(static_cast<int>(wParam), true);
+ break;
+
+ case SCI_SCROLLRANGE:
+ ScrollRange(SelectionRange(static_cast<int>(wParam), static_cast<int>(lParam)));
+ break;
+
+ case SCI_SEARCHANCHOR:
+ SearchAnchor();
+ break;
+
+ case SCI_SEARCHNEXT:
+ case SCI_SEARCHPREV:
+ return SearchText(iMessage, wParam, lParam);
+
+ case SCI_SETXCARETPOLICY:
+ caretXPolicy = static_cast<int>(wParam);
+ caretXSlop = static_cast<int>(lParam);
+ break;
+
+ case SCI_SETYCARETPOLICY:
+ caretYPolicy = static_cast<int>(wParam);
+ caretYSlop = static_cast<int>(lParam);
+ break;
+
+ case SCI_SETVISIBLEPOLICY:
+ visiblePolicy = static_cast<int>(wParam);
+ visibleSlop = static_cast<int>(lParam);
+ break;
+
+ case SCI_LINESONSCREEN:
+ return LinesOnScreen();
+
+ case SCI_SETSELFORE:
+ vs.selColours.fore = ColourOptional(wParam, lParam);
+ vs.selAdditionalForeground = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETSELBACK:
+ vs.selColours.back = ColourOptional(wParam, lParam);
+ vs.selAdditionalBackground = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETSELALPHA:
+ vs.selAlpha = static_cast<int>(wParam);
+ vs.selAdditionalAlpha = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETSELALPHA:
+ return vs.selAlpha;
+
+ case SCI_GETSELEOLFILLED:
+ return vs.selEOLFilled;
+
+ case SCI_SETSELEOLFILLED:
+ vs.selEOLFilled = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETWHITESPACEFORE:
+ vs.whitespaceColours.fore = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETWHITESPACEBACK:
+ vs.whitespaceColours.back = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETCARETFORE:
+ vs.caretcolour = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETFORE:
+ return vs.caretcolour.AsLong();
+
+ case SCI_SETCARETSTYLE:
+ if (wParam <= CARETSTYLE_BLOCK)
+ vs.caretStyle = static_cast<int>(wParam);
+ else
+ /* Default to the line caret */
+ vs.caretStyle = CARETSTYLE_LINE;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETSTYLE:
+ return vs.caretStyle;
+
+ case SCI_SETCARETWIDTH:
+ if (static_cast<int>(wParam) <= 0)
+ vs.caretWidth = 0;
+ else if (wParam >= 3)
+ vs.caretWidth = 3;
+ else
+ vs.caretWidth = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETWIDTH:
+ return vs.caretWidth;
+
+ case SCI_ASSIGNCMDKEY:
+ kmap.AssignCmdKey(Platform::LowShortFromLong(static_cast<long>(wParam)),
+ Platform::HighShortFromLong(static_cast<long>(wParam)), static_cast<unsigned int>(lParam));
+ break;
+
+ case SCI_CLEARCMDKEY:
+ kmap.AssignCmdKey(Platform::LowShortFromLong(static_cast<long>(wParam)),
+ Platform::HighShortFromLong(static_cast<long>(wParam)), SCI_NULL);
+ break;
+
+ case SCI_CLEARALLCMDKEYS:
+ kmap.Clear();
+ break;
+
+ case SCI_INDICSETSTYLE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].sacNormal.style = static_cast<int>(lParam);
+ vs.indicators[wParam].sacHover.style = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETSTYLE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].sacNormal.style : 0;
+
+ case SCI_INDICSETFORE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].sacNormal.fore = ColourDesired(static_cast<long>(lParam));
+ vs.indicators[wParam].sacHover.fore = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETFORE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].sacNormal.fore.AsLong() : 0;
+
+ case SCI_INDICSETHOVERSTYLE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].sacHover.style = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETHOVERSTYLE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].sacHover.style : 0;
+
+ case SCI_INDICSETHOVERFORE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].sacHover.fore = ColourDesired(static_cast<long>(lParam));
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETHOVERFORE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].sacHover.fore.AsLong() : 0;
+
+ case SCI_INDICSETFLAGS:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].SetFlags(static_cast<int>(lParam));
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETFLAGS:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].Flags() : 0;
+
+ case SCI_INDICSETUNDER:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].under = lParam != 0;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETUNDER:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].under : 0;
+
+ case SCI_INDICSETALPHA:
+ if (wParam <= INDIC_MAX && lParam >=0 && lParam <= 255) {
+ vs.indicators[wParam].fillAlpha = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETALPHA:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fillAlpha : 0;
+
+ case SCI_INDICSETOUTLINEALPHA:
+ if (wParam <= INDIC_MAX && lParam >=0 && lParam <= 255) {
+ vs.indicators[wParam].outlineAlpha = static_cast<int>(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETOUTLINEALPHA:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].outlineAlpha : 0;
+
+ case SCI_SETINDICATORCURRENT:
+ pdoc->decorations.SetCurrentIndicator(static_cast<int>(wParam));
+ break;
+ case SCI_GETINDICATORCURRENT:
+ return pdoc->decorations.GetCurrentIndicator();
+ case SCI_SETINDICATORVALUE:
+ pdoc->decorations.SetCurrentValue(static_cast<int>(wParam));
+ break;
+ case SCI_GETINDICATORVALUE:
+ return pdoc->decorations.GetCurrentValue();
+
+ case SCI_INDICATORFILLRANGE:
+ pdoc->DecorationFillRange(static_cast<int>(wParam), pdoc->decorations.GetCurrentValue(), static_cast<int>(lParam));
+ break;
+
+ case SCI_INDICATORCLEARRANGE:
+ pdoc->DecorationFillRange(static_cast<int>(wParam), 0, static_cast<int>(lParam));
+ break;
+
+ case SCI_INDICATORALLONFOR:
+ return pdoc->decorations.AllOnFor(static_cast<int>(wParam));
+
+ case SCI_INDICATORVALUEAT:
+ return pdoc->decorations.ValueAt(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_INDICATORSTART:
+ return pdoc->decorations.Start(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_INDICATOREND:
+ return pdoc->decorations.End(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_LINEDOWN:
+ case SCI_LINEDOWNEXTEND:
+ case SCI_PARADOWN:
+ case SCI_PARADOWNEXTEND:
+ case SCI_LINEUP:
+ case SCI_LINEUPEXTEND:
+ case SCI_PARAUP:
+ case SCI_PARAUPEXTEND:
+ case SCI_CHARLEFT:
+ case SCI_CHARLEFTEXTEND:
+ case SCI_CHARRIGHT:
+ case SCI_CHARRIGHTEXTEND:
+ case SCI_WORDLEFT:
+ case SCI_WORDLEFTEXTEND:
+ case SCI_WORDRIGHT:
+ case SCI_WORDRIGHTEXTEND:
+ case SCI_WORDLEFTEND:
+ case SCI_WORDLEFTENDEXTEND:
+ case SCI_WORDRIGHTEND:
+ case SCI_WORDRIGHTENDEXTEND:
+ case SCI_HOME:
+ case SCI_HOMEEXTEND:
+ case SCI_LINEEND:
+ case SCI_LINEENDEXTEND:
+ case SCI_HOMEWRAP:
+ case SCI_HOMEWRAPEXTEND:
+ case SCI_LINEENDWRAP:
+ case SCI_LINEENDWRAPEXTEND:
+ case SCI_DOCUMENTSTART:
+ case SCI_DOCUMENTSTARTEXTEND:
+ case SCI_DOCUMENTEND:
+ case SCI_DOCUMENTENDEXTEND:
+ case SCI_SCROLLTOSTART:
+ case SCI_SCROLLTOEND:
+
+ case SCI_STUTTEREDPAGEUP:
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ case SCI_STUTTEREDPAGEDOWN:
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+
+ case SCI_PAGEUP:
+ case SCI_PAGEUPEXTEND:
+ case SCI_PAGEDOWN:
+ case SCI_PAGEDOWNEXTEND:
+ case SCI_EDITTOGGLEOVERTYPE:
+ case SCI_CANCEL:
+ case SCI_DELETEBACK:
+ case SCI_TAB:
+ case SCI_BACKTAB:
+ case SCI_NEWLINE:
+ case SCI_FORMFEED:
+ case SCI_VCHOME:
+ case SCI_VCHOMEEXTEND:
+ case SCI_VCHOMEWRAP:
+ case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
+ case SCI_ZOOMIN:
+ case SCI_ZOOMOUT:
+ case SCI_DELWORDLEFT:
+ case SCI_DELWORDRIGHT:
+ case SCI_DELWORDRIGHTEND:
+ case SCI_DELLINELEFT:
+ case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
+ case SCI_LINECUT:
+ case SCI_LINEDELETE:
+ case SCI_LINETRANSPOSE:
+ case SCI_LINEDUPLICATE:
+ case SCI_LOWERCASE:
+ case SCI_UPPERCASE:
+ case SCI_LINESCROLLDOWN:
+ case SCI_LINESCROLLUP:
+ case SCI_WORDPARTLEFT:
+ case SCI_WORDPARTLEFTEXTEND:
+ case SCI_WORDPARTRIGHT:
+ case SCI_WORDPARTRIGHTEXTEND:
+ case SCI_DELETEBACKNOTLINE:
+ case SCI_HOMEDISPLAY:
+ case SCI_HOMEDISPLAYEXTEND:
+ case SCI_LINEENDDISPLAY:
+ case SCI_LINEENDDISPLAYEXTEND:
+ case SCI_LINEDOWNRECTEXTEND:
+ case SCI_LINEUPRECTEXTEND:
+ case SCI_CHARLEFTRECTEXTEND:
+ case SCI_CHARRIGHTRECTEXTEND:
+ case SCI_HOMERECTEXTEND:
+ case SCI_VCHOMERECTEXTEND:
+ case SCI_LINEENDRECTEXTEND:
+ case SCI_PAGEUPRECTEXTEND:
+ case SCI_PAGEDOWNRECTEXTEND:
+ case SCI_SELECTIONDUPLICATE:
+ return KeyCommand(iMessage);
+
+ case SCI_BRACEHIGHLIGHT:
+ SetBraceHighlight(static_cast<int>(wParam), static_cast<int>(lParam), STYLE_BRACELIGHT);
+ break;
+
+ case SCI_BRACEHIGHLIGHTINDICATOR:
+ if (lParam >= 0 && lParam <= INDIC_MAX) {
+ vs.braceHighlightIndicatorSet = wParam != 0;
+ vs.braceHighlightIndicator = static_cast<int>(lParam);
+ }
+ break;
+
+ case SCI_BRACEBADLIGHT:
+ SetBraceHighlight(static_cast<int>(wParam), -1, STYLE_BRACEBAD);
+ break;
+
+ case SCI_BRACEBADLIGHTINDICATOR:
+ if (lParam >= 0 && lParam <= INDIC_MAX) {
+ vs.braceBadLightIndicatorSet = wParam != 0;
+ vs.braceBadLightIndicator = static_cast<int>(lParam);
+ }
+ break;
+
+ case SCI_BRACEMATCH:
+ // wParam is position of char to find brace for,
+ // lParam is maximum amount of text to restyle to find it
+ return pdoc->BraceMatch(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_GETVIEWEOL:
+ return vs.viewEOL;
+
+ case SCI_SETVIEWEOL:
+ vs.viewEOL = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETZOOM:
+ vs.zoomLevel = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ break;
+
+ case SCI_GETZOOM:
+ return vs.zoomLevel;
+
+ case SCI_GETEDGECOLUMN:
+ return vs.theEdge;
+
+ case SCI_SETEDGECOLUMN:
+ vs.theEdge = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEDGEMODE:
+ return vs.edgeState;
+
+ case SCI_SETEDGEMODE:
+ vs.edgeState = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEDGECOLOUR:
+ return vs.edgecolour.AsLong();
+
+ case SCI_SETEDGECOLOUR:
+ vs.edgecolour = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETDOCPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc);
+
+ case SCI_SETDOCPOINTER:
+ CancelModes();
+ SetDocPointer(reinterpret_cast<Document *>(lParam));
+ return 0;
+
+ case SCI_CREATEDOCUMENT: {
+ Document *doc = new Document();
+ doc->AddRef();
+ return reinterpret_cast<sptr_t>(doc);
+ }
+
+ case SCI_ADDREFDOCUMENT:
+ (reinterpret_cast<Document *>(lParam))->AddRef();
+ break;
+
+ case SCI_RELEASEDOCUMENT:
+ (reinterpret_cast<Document *>(lParam))->Release();
+ break;
+
+ case SCI_CREATELOADER: {
+ Document *doc = new Document();
+ doc->AddRef();
+ doc->Allocate(static_cast<int>(wParam));
+ doc->SetUndoCollection(false);
+ return reinterpret_cast<sptr_t>(static_cast<ILoader *>(doc));
+ }
+
+ case SCI_SETMODEVENTMASK:
+ modEventMask = static_cast<int>(wParam);
+ return 0;
+
+ case SCI_GETMODEVENTMASK:
+ return modEventMask;
+
+ case SCI_CONVERTEOLS:
+ pdoc->ConvertLineEnds(static_cast<int>(wParam));
+ SetSelection(sel.MainCaret(), sel.MainAnchor()); // Ensure selection inside document
+ return 0;
+
+ case SCI_SETLENGTHFORENCODE:
+ lengthForEncode = static_cast<int>(wParam);
+ return 0;
+
+ case SCI_SELECTIONISRECTANGLE:
+ return sel.selType == Selection::selRectangle ? 1 : 0;
+
+ case SCI_SETSELECTIONMODE: {
+ switch (wParam) {
+ case SC_SEL_STREAM:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selStream));
+ sel.selType = Selection::selStream;
+ break;
+ case SC_SEL_RECTANGLE:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selRectangle));
+ sel.selType = Selection::selRectangle;
+ break;
+ case SC_SEL_LINES:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selLines));
+ sel.selType = Selection::selLines;
+ break;
+ case SC_SEL_THIN:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selThin));
+ sel.selType = Selection::selThin;
+ break;
+ default:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selStream));
+ sel.selType = Selection::selStream;
+ }
+ InvalidateSelection(sel.RangeMain(), true);
+ break;
+ }
+ case SCI_GETSELECTIONMODE:
+ switch (sel.selType) {
+ case Selection::selStream:
+ return SC_SEL_STREAM;
+ case Selection::selRectangle:
+ return SC_SEL_RECTANGLE;
+ case Selection::selLines:
+ return SC_SEL_LINES;
+ case Selection::selThin:
+ return SC_SEL_THIN;
+ default: // ?!
+ return SC_SEL_STREAM;
+ }
+ case SCI_GETLINESELSTARTPOSITION:
+ case SCI_GETLINESELENDPOSITION: {
+ SelectionSegment segmentLine(SelectionPosition(pdoc->LineStart(static_cast<int>(wParam))),
+ SelectionPosition(pdoc->LineEnd(static_cast<int>(wParam))));
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionSegment portion = sel.Range(r).Intersect(segmentLine);
+ if (portion.start.IsValid()) {
+ return (iMessage == SCI_GETLINESELSTARTPOSITION) ? portion.start.Position() : portion.end.Position();
+ }
+ }
+ return INVALID_POSITION;
+ }
+
+ case SCI_SETOVERTYPE:
+ inOverstrike = wParam != 0;
+ break;
+
+ case SCI_GETOVERTYPE:
+ return inOverstrike ? 1 : 0;
+
+ case SCI_SETFOCUS:
+ SetFocusState(wParam != 0);
+ break;
+
+ case SCI_GETFOCUS:
+ return hasFocus;
+
+ case SCI_SETSTATUS:
+ errorStatus = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETSTATUS:
+ return errorStatus;
+
+ case SCI_SETMOUSEDOWNCAPTURES:
+ mouseDownCaptures = wParam != 0;
+ break;
+
+ case SCI_GETMOUSEDOWNCAPTURES:
+ return mouseDownCaptures;
+
+ case SCI_SETCURSOR:
+ cursorMode = static_cast<int>(wParam);
+ DisplayCursor(Window::cursorText);
+ break;
+
+ case SCI_GETCURSOR:
+ return cursorMode;
+
+ case SCI_SETCONTROLCHARSYMBOL:
+ vs.controlCharSymbol = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCONTROLCHARSYMBOL:
+ return vs.controlCharSymbol;
+
+ case SCI_SETREPRESENTATION:
+ reprs.SetRepresentation(reinterpret_cast<const char *>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_GETREPRESENTATION: {
+ const Representation *repr = reprs.RepresentationFromCharacter(
+ reinterpret_cast<const char *>(wParam), UTF8MaxBytes);
+ if (repr) {
+ return StringResult(lParam, repr->stringRep.c_str());
+ }
+ return 0;
+ }
+
+ case SCI_CLEARREPRESENTATION:
+ reprs.ClearRepresentation(reinterpret_cast<const char *>(wParam));
+ break;
+
+ case SCI_STARTRECORD:
+ recordingMacro = true;
+ return 0;
+
+ case SCI_STOPRECORD:
+ recordingMacro = false;
+ return 0;
+
+ case SCI_MOVECARETINSIDEVIEW:
+ MoveCaretInsideView();
+ break;
+
+ case SCI_SETFOLDMARGINCOLOUR:
+ vs.foldmarginColour = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETFOLDMARGINHICOLOUR:
+ vs.foldmarginHighlightColour = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETHOTSPOTACTIVEFORE:
+ vs.hotspotColours.fore = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEFORE:
+ return vs.hotspotColours.fore.AsLong();
+
+ case SCI_SETHOTSPOTACTIVEBACK:
+ vs.hotspotColours.back = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEBACK:
+ return vs.hotspotColours.back.AsLong();
+
+ case SCI_SETHOTSPOTACTIVEUNDERLINE:
+ vs.hotspotUnderline = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEUNDERLINE:
+ return vs.hotspotUnderline ? 1 : 0;
+
+ case SCI_SETHOTSPOTSINGLELINE:
+ vs.hotspotSingleLine = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTSINGLELINE:
+ return vs.hotspotSingleLine ? 1 : 0;
+
+ case SCI_SETPASTECONVERTENDINGS:
+ convertPastes = wParam != 0;
+ break;
+
+ case SCI_GETPASTECONVERTENDINGS:
+ return convertPastes ? 1 : 0;
+
+ case SCI_GETCHARACTERPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc->BufferPointer());
+
+ case SCI_GETRANGEPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc->RangePointer(static_cast<int>(wParam), static_cast<int>(lParam)));
+
+ case SCI_GETGAPPOSITION:
+ return pdoc->GapPosition();
+
+ case SCI_SETEXTRAASCENT:
+ vs.extraAscent = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEXTRAASCENT:
+ return vs.extraAscent;
+
+ case SCI_SETEXTRADESCENT:
+ vs.extraDescent = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEXTRADESCENT:
+ return vs.extraDescent;
+
+ case SCI_MARGINSETSTYLEOFFSET:
+ vs.marginStyleOffset = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_MARGINGETSTYLEOFFSET:
+ return vs.marginStyleOffset;
+
+ case SCI_SETMARGINOPTIONS:
+ marginOptions = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETMARGINOPTIONS:
+ return marginOptions;
+
+ case SCI_MARGINSETTEXT:
+ pdoc->MarginSetText(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_MARGINGETTEXT: {
+ const StyledText st = pdoc->MarginStyledText(static_cast<int>(wParam));
+ return BytesResult(lParam, reinterpret_cast<const unsigned char *>(st.text), st.length);
+ }
+
+ case SCI_MARGINSETSTYLE:
+ pdoc->MarginSetStyle(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_MARGINGETSTYLE: {
+ const StyledText st = pdoc->MarginStyledText(static_cast<int>(wParam));
+ return st.style;
+ }
+
+ case SCI_MARGINSETSTYLES:
+ pdoc->MarginSetStyles(static_cast<int>(wParam), reinterpret_cast<const unsigned char *>(lParam));
+ break;
+
+ case SCI_MARGINGETSTYLES: {
+ const StyledText st = pdoc->MarginStyledText(static_cast<int>(wParam));
+ return BytesResult(lParam, st.styles, st.length);
+ }
+
+ case SCI_MARGINTEXTCLEARALL:
+ pdoc->MarginClearAll();
+ break;
+
+ case SCI_ANNOTATIONSETTEXT:
+ pdoc->AnnotationSetText(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_ANNOTATIONGETTEXT: {
+ const StyledText st = pdoc->AnnotationStyledText(static_cast<int>(wParam));
+ return BytesResult(lParam, reinterpret_cast<const unsigned char *>(st.text), st.length);
+ }
+
+ case SCI_ANNOTATIONGETSTYLE: {
+ const StyledText st = pdoc->AnnotationStyledText(static_cast<int>(wParam));
+ return st.style;
+ }
+
+ case SCI_ANNOTATIONSETSTYLE:
+ pdoc->AnnotationSetStyle(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_ANNOTATIONSETSTYLES:
+ pdoc->AnnotationSetStyles(static_cast<int>(wParam), reinterpret_cast<const unsigned char *>(lParam));
+ break;
+
+ case SCI_ANNOTATIONGETSTYLES: {
+ const StyledText st = pdoc->AnnotationStyledText(static_cast<int>(wParam));
+ return BytesResult(lParam, st.styles, st.length);
+ }
+
+ case SCI_ANNOTATIONGETLINES:
+ return pdoc->AnnotationLines(static_cast<int>(wParam));
+
+ case SCI_ANNOTATIONCLEARALL:
+ pdoc->AnnotationClearAll();
+ break;
+
+ case SCI_ANNOTATIONSETVISIBLE:
+ SetAnnotationVisible(static_cast<int>(wParam));
+ break;
+
+ case SCI_ANNOTATIONGETVISIBLE:
+ return vs.annotationVisible;
+
+ case SCI_ANNOTATIONSETSTYLEOFFSET:
+ vs.annotationStyleOffset = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_ANNOTATIONGETSTYLEOFFSET:
+ return vs.annotationStyleOffset;
+
+ case SCI_RELEASEALLEXTENDEDSTYLES:
+ vs.ReleaseAllExtendedStyles();
+ break;
+
+ case SCI_ALLOCATEEXTENDEDSTYLES:
+ return vs.AllocateExtendedStyles(static_cast<int>(wParam));
+
+ case SCI_ADDUNDOACTION:
+ pdoc->AddUndoAction(static_cast<int>(wParam), lParam & UNDO_MAY_COALESCE);
+ break;
+
+ case SCI_SETMOUSESELECTIONRECTANGULARSWITCH:
+ mouseSelectionRectangularSwitch = wParam != 0;
+ break;
+
+ case SCI_GETMOUSESELECTIONRECTANGULARSWITCH:
+ return mouseSelectionRectangularSwitch;
+
+ case SCI_SETMULTIPLESELECTION:
+ multipleSelection = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETMULTIPLESELECTION:
+ return multipleSelection;
+
+ case SCI_SETADDITIONALSELECTIONTYPING:
+ additionalSelectionTyping = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALSELECTIONTYPING:
+ return additionalSelectionTyping;
+
+ case SCI_SETMULTIPASTE:
+ multiPasteMode = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETMULTIPASTE:
+ return multiPasteMode;
+
+ case SCI_SETADDITIONALCARETSBLINK:
+ view.additionalCaretsBlink = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALCARETSBLINK:
+ return view.additionalCaretsBlink;
+
+ case SCI_SETADDITIONALCARETSVISIBLE:
+ view.additionalCaretsVisible = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALCARETSVISIBLE:
+ return view.additionalCaretsVisible;
+
+ case SCI_GETSELECTIONS:
+ return sel.Count();
+
+ case SCI_GETSELECTIONEMPTY:
+ return sel.Empty();
+
+ case SCI_CLEARSELECTIONS:
+ sel.Clear();
+ Redraw();
+ break;
+
+ case SCI_SETSELECTION:
+ sel.SetSelection(SelectionRange(static_cast<int>(wParam), static_cast<int>(lParam)));
+ Redraw();
+ break;
+
+ case SCI_ADDSELECTION:
+ sel.AddSelection(SelectionRange(static_cast<int>(wParam), static_cast<int>(lParam)));
+ Redraw();
+ break;
+
+ case SCI_DROPSELECTIONN:
+ sel.DropSelection(static_cast<int>(wParam));
+ Redraw();
+ break;
+
+ case SCI_SETMAINSELECTION:
+ sel.SetMain(static_cast<int>(wParam));
+ Redraw();
+ break;
+
+ case SCI_GETMAINSELECTION:
+ return sel.Main();
+
+ case SCI_SETSELECTIONNCARET:
+ sel.Range(wParam).caret.SetPosition(static_cast<int>(lParam));
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNCARET:
+ return sel.Range(wParam).caret.Position();
+
+ case SCI_SETSELECTIONNANCHOR:
+ sel.Range(wParam).anchor.SetPosition(static_cast<int>(lParam));
+ Redraw();
+ break;
+ case SCI_GETSELECTIONNANCHOR:
+ return sel.Range(wParam).anchor.Position();
+
+ case SCI_SETSELECTIONNCARETVIRTUALSPACE:
+ sel.Range(wParam).caret.SetVirtualSpace(static_cast<int>(lParam));
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNCARETVIRTUALSPACE:
+ return sel.Range(wParam).caret.VirtualSpace();
+
+ case SCI_SETSELECTIONNANCHORVIRTUALSPACE:
+ sel.Range(wParam).anchor.SetVirtualSpace(static_cast<int>(lParam));
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNANCHORVIRTUALSPACE:
+ return sel.Range(wParam).anchor.VirtualSpace();
+
+ case SCI_SETSELECTIONNSTART:
+ sel.Range(wParam).anchor.SetPosition(static_cast<int>(lParam));
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNSTART:
+ return sel.Range(wParam).Start().Position();
+
+ case SCI_SETSELECTIONNEND:
+ sel.Range(wParam).caret.SetPosition(static_cast<int>(lParam));
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNEND:
+ return sel.Range(wParam).End().Position();
+
+ case SCI_SETRECTANGULARSELECTIONCARET:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().caret.SetPosition(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONCARET:
+ return sel.Rectangular().caret.Position();
+
+ case SCI_SETRECTANGULARSELECTIONANCHOR:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().anchor.SetPosition(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONANCHOR:
+ return sel.Rectangular().anchor.Position();
+
+ case SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().caret.SetVirtualSpace(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE:
+ return sel.Rectangular().caret.VirtualSpace();
+
+ case SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().anchor.SetVirtualSpace(static_cast<int>(wParam));
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE:
+ return sel.Rectangular().anchor.VirtualSpace();
+
+ case SCI_SETVIRTUALSPACEOPTIONS:
+ virtualSpaceOptions = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETVIRTUALSPACEOPTIONS:
+ return virtualSpaceOptions;
+
+ case SCI_SETADDITIONALSELFORE:
+ vs.selAdditionalForeground = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETADDITIONALSELBACK:
+ vs.selAdditionalBackground = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETADDITIONALSELALPHA:
+ vs.selAdditionalAlpha = static_cast<int>(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETADDITIONALSELALPHA:
+ return vs.selAdditionalAlpha;
+
+ case SCI_SETADDITIONALCARETFORE:
+ vs.additionalCaretColour = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETADDITIONALCARETFORE:
+ return vs.additionalCaretColour.AsLong();
+
+ case SCI_ROTATESELECTION:
+ sel.RotateMain();
+ InvalidateSelection(sel.RangeMain(), true);
+ break;
+
+ case SCI_SWAPMAINANCHORCARET:
+ InvalidateSelection(sel.RangeMain());
+ sel.RangeMain() = SelectionRange(sel.RangeMain().anchor, sel.RangeMain().caret);
+ break;
+
+ case SCI_CHANGELEXERSTATE:
+ pdoc->ChangeLexerState(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_SETIDENTIFIER:
+ SetCtrlID(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETIDENTIFIER:
+ return GetCtrlID();
+
+ case SCI_SETTECHNOLOGY:
+ // No action by default
+ break;
+
+ case SCI_GETTECHNOLOGY:
+ return technology;
+
+ case SCI_COUNTCHARACTERS:
+ return pdoc->CountCharacters(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ default:
+ return DefWndProc(iMessage, wParam, lParam);
+ }
+ //Platform::DebugPrintf("end wnd proc\n");
+ return 0l;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx.orig b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx.orig
new file mode 100644
index 00000000000..c17eb21bcee
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.cxx.orig
@@ -0,0 +1,9647 @@
+// Scintilla source code edit control
+/** @file Editor.cxx
+ ** Main code for the edit control.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#include <assert.h>
+
+#include <string>
+#include <vector>
+#include <map>
+#include <unordered_map>
+#include <algorithm>
+#include <memory>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "Editor.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+/*
+ return whether this modification represents an operation that
+ may reasonably be deferred (not done now OR [possibly] at all)
+*/
+static bool CanDeferToLastStep(const DocModification &mh) {
+ if (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE))
+ return true; // CAN skip
+ if (!(mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)))
+ return false; // MUST do
+ if (mh.modificationType & SC_MULTISTEPUNDOREDO)
+ return true; // CAN skip
+ return false; // PRESUMABLY must do
+}
+
+static bool CanEliminate(const DocModification &mh) {
+ return
+ (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) != 0;
+}
+
+/*
+ return whether this modification represents the FINAL step
+ in a [possibly lengthy] multi-step Undo/Redo sequence
+*/
+static bool IsLastStep(const DocModification &mh) {
+ return
+ (mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)) != 0
+ && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0
+ && (mh.modificationType & SC_LASTSTEPINUNDOREDO) != 0
+ && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0;
+}
+
+Caret::Caret() :
+ active(false), on(false), period(500) {}
+
+Timer::Timer() :
+ ticking(false), ticksToWait(0), tickerID(0) {}
+
+Idler::Idler() :
+ state(false), idlerID(0) {}
+
+static inline bool IsControlCharacter(int ch) {
+ // iscntrl returns true for lots of chars > 127 which are displayable
+ return ch >= 0 && ch < ' ';
+}
+
+static inline bool IsAllSpacesOrTabs(char *s, unsigned int len) {
+ for (unsigned int i = 0; i < len; i++) {
+ // This is safe because IsSpaceOrTab() will return false for null terminators
+ if (!IsSpaceOrTab(s[i]))
+ return false;
+ }
+ return true;
+}
+
+PrintParameters::PrintParameters() {
+ magnification = 0;
+ colourMode = SC_PRINT_NORMAL;
+ wrapState = eWrapWord;
+}
+
+Editor::Editor() {
+ ctrlID = 0;
+
+ stylesValid = false;
+ technology = SC_TECHNOLOGY_DEFAULT;
+ scaleRGBAImage = 100;
+
+ cursorMode = SC_CURSORNORMAL;
+
+ hasFocus = false;
+ hideSelection = false;
+ inOverstrike = false;
+ drawOverstrikeCaret = true;
+ errorStatus = 0;
+ mouseDownCaptures = true;
+
+ bufferedDraw = true;
+ twoPhaseDraw = true;
+
+ lastClickTime = 0;
+ dwellDelay = SC_TIME_FOREVER;
+ ticksToDwell = SC_TIME_FOREVER;
+ dwelling = false;
+ ptMouseLast.x = 0;
+ ptMouseLast.y = 0;
+ inDragDrop = ddNone;
+ dropWentOutside = false;
+ posDrag = SelectionPosition(invalidPosition);
+ posDrop = SelectionPosition(invalidPosition);
+ hotSpotClickPos = INVALID_POSITION;
+ selectionType = selChar;
+
+ lastXChosen = 0;
+ lineAnchorPos = 0;
+ originalAnchorPos = 0;
+ wordSelectAnchorStartPos = 0;
+ wordSelectAnchorEndPos = 0;
+ wordSelectInitialCaretPos = -1;
+
+ primarySelection = true;
+
+ caretXPolicy = CARET_SLOP | CARET_EVEN;
+ caretXSlop = 50;
+
+ caretYPolicy = CARET_EVEN;
+ caretYSlop = 0;
+
+ visiblePolicy = 0;
+ visibleSlop = 0;
+
+ searchAnchor = 0;
+
+ xOffset = 0;
+ xCaretMargin = 50;
+ horizontalScrollBarVisible = true;
+ scrollWidth = 2000;
+ trackLineWidth = false;
+ lineWidthMaxSeen = 0;
+ verticalScrollBarVisible = true;
+ endAtLastLine = true;
+ caretSticky = SC_CARETSTICKY_OFF;
+ marginOptions = SC_MARGINOPTION_NONE;
+ mouseSelectionRectangularSwitch = false;
+ multipleSelection = false;
+ additionalSelectionTyping = false;
+ multiPasteMode = SC_MULTIPASTE_ONCE;
+ additionalCaretsBlink = true;
+ additionalCaretsVisible = true;
+ virtualSpaceOptions = SCVS_NONE;
+
+ pixmapLine = 0;
+ pixmapSelMargin = 0;
+ pixmapSelPattern = 0;
+ pixmapSelPatternOffset1 = 0;
+ pixmapIndentGuide = 0;
+ pixmapIndentGuideHighlight = 0;
+
+ targetStart = 0;
+ targetEnd = 0;
+ searchFlags = 0;
+
+ topLine = 0;
+ posTopLine = 0;
+
+ lengthForEncode = -1;
+
+ needUpdateUI = 0;
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+ braces[0] = invalidPosition;
+ braces[1] = invalidPosition;
+ bracesMatchStyle = STYLE_BRACEBAD;
+ highlightGuideColumn = 0;
+
+ paintState = notPainting;
+ paintAbandonedByStyling = false;
+ paintingAllText = false;
+ willRedrawAll = false;
+
+ modEventMask = SC_MODEVENTMASKALL;
+
+ pdoc = new Document();
+ pdoc->AddRef();
+ pdoc->AddWatcher(this, 0);
+
+ recordingMacro = false;
+ foldFlags = 0;
+ foldAutomatic = 0;
+
+ wrapWidth = LineLayout::wrapWidthInfinite;
+
+ convertPastes = true;
+
+ hsStart = -1;
+ hsEnd = -1;
+
+ llc.SetLevel(LineLayoutCache::llcCaret);
+ posCache.SetSize(0x400);
+
+ SetRepresentations();
+}
+
+Editor::~Editor() {
+ pdoc->RemoveWatcher(this, 0);
+ pdoc->Release();
+ pdoc = 0;
+ DropGraphics(true);
+}
+
+void Editor::Finalise() {
+ SetIdle(false);
+ CancelModes();
+}
+
+void Editor::SetRepresentations() {
+ reprs.Clear();
+
+ // C0 control set
+ const char *reps[] = {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
+ };
+ for (size_t j=0; j < (sizeof(reps) / sizeof(reps[0])); j++) {
+ char c[2] = { static_cast<char>(j), 0 };
+ reprs.SetRepresentation(c, reps[j]);
+ }
+
+ // C1 control set
+ // As well as Unicode mode, ISO-8859-1 should use these
+ if (IsUnicodeMode()) {
+ const char *repsC1[] = {
+ "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
+ "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3",
+ "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA",
+ "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC"
+ };
+ for (size_t j=0; j < (sizeof(repsC1) / sizeof(repsC1[0])); j++) {
+ char c1[3] = { '\xc2', static_cast<char>(0x80+j), 0 };
+ reprs.SetRepresentation(c1, repsC1[j]);
+ }
+ }
+
+ // UTF-8 invalid bytes
+ if (IsUnicodeMode()) {
+ for (int k=0x80; k < 0x100; k++) {
+ char hiByte[2] = { static_cast<char>(k), 0 };
+ char hexits[4];
+ sprintf(hexits, "x%2X", k);
+ reprs.SetRepresentation(hiByte, hexits);
+ }
+ }
+}
+
+void Editor::DropGraphics(bool freeObjects) {
+ if (freeObjects) {
+ delete pixmapLine;
+ pixmapLine = 0;
+ delete pixmapSelMargin;
+ pixmapSelMargin = 0;
+ delete pixmapSelPattern;
+ pixmapSelPattern = 0;
+ delete pixmapSelPatternOffset1;
+ pixmapSelPatternOffset1 = 0;
+ delete pixmapIndentGuide;
+ pixmapIndentGuide = 0;
+ delete pixmapIndentGuideHighlight;
+ pixmapIndentGuideHighlight = 0;
+ } else {
+ if (pixmapLine)
+ pixmapLine->Release();
+ if (pixmapSelMargin)
+ pixmapSelMargin->Release();
+ if (pixmapSelPattern)
+ pixmapSelPattern->Release();
+ if (pixmapSelPatternOffset1)
+ pixmapSelPatternOffset1->Release();
+ if (pixmapIndentGuide)
+ pixmapIndentGuide->Release();
+ if (pixmapIndentGuideHighlight)
+ pixmapIndentGuideHighlight->Release();
+ }
+}
+
+void Editor::AllocateGraphics() {
+ if (!pixmapLine)
+ pixmapLine = Surface::Allocate(technology);
+ if (!pixmapSelMargin)
+ pixmapSelMargin = Surface::Allocate(technology);
+ if (!pixmapSelPattern)
+ pixmapSelPattern = Surface::Allocate(technology);
+ if (!pixmapSelPatternOffset1)
+ pixmapSelPatternOffset1 = Surface::Allocate(technology);
+ if (!pixmapIndentGuide)
+ pixmapIndentGuide = Surface::Allocate(technology);
+ if (!pixmapIndentGuideHighlight)
+ pixmapIndentGuideHighlight = Surface::Allocate(technology);
+}
+
+void Editor::InvalidateStyleData() {
+ stylesValid = false;
+ vs.technology = technology;
+ DropGraphics(false);
+ AllocateGraphics();
+ llc.Invalidate(LineLayout::llInvalid);
+ posCache.Clear();
+}
+
+void Editor::InvalidateStyleRedraw() {
+ NeedWrapping();
+ InvalidateStyleData();
+ Redraw();
+}
+
+void Editor::RefreshStyleData() {
+ if (!stylesValid) {
+ stylesValid = true;
+ AutoSurface surface(this);
+ if (surface) {
+ vs.Refresh(*surface, pdoc->tabInChars);
+ }
+ SetScrollBars();
+ SetRectangularRange();
+ }
+}
+
+Point Editor::GetVisibleOriginInMain() {
+ return Point(0,0);
+}
+
+Point Editor::DocumentPointFromView(Point ptView) {
+ Point ptDocument = ptView;
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ ptDocument.x += ptOrigin.x;
+ ptDocument.y += ptOrigin.y;
+ } else {
+ ptDocument.x += xOffset;
+ ptDocument.y += topLine * vs.lineHeight;
+ }
+ return ptDocument;
+}
+
+int Editor::TopLineOfMain() const {
+ if (wMargin.GetID())
+ return 0;
+ else
+ return topLine;
+}
+
+PRectangle Editor::GetClientRectangle() {
+ return wMain.GetClientPosition();
+}
+
+PRectangle Editor::GetTextRectangle() {
+ PRectangle rc = GetClientRectangle();
+ rc.left += vs.textStart;
+ rc.right -= vs.rightMarginWidth;
+ return rc;
+}
+
+int Editor::LinesOnScreen() {
+ PRectangle rcClient = GetClientRectangle();
+ int htClient = rcClient.bottom - rcClient.top;
+ //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1);
+ return htClient / vs.lineHeight;
+}
+
+int Editor::LinesToScroll() {
+ int retVal = LinesOnScreen() - 1;
+ if (retVal < 1)
+ return 1;
+ else
+ return retVal;
+}
+
+int Editor::MaxScrollPos() {
+ //Platform::DebugPrintf("Lines %d screen = %d maxScroll = %d\n",
+ //LinesTotal(), LinesOnScreen(), LinesTotal() - LinesOnScreen() + 1);
+ int retVal = cs.LinesDisplayed();
+ if (endAtLastLine) {
+ retVal -= LinesOnScreen();
+ } else {
+ retVal--;
+ }
+ if (retVal < 0) {
+ return 0;
+ } else {
+ return retVal;
+ }
+}
+
+const char *ControlCharacterString(unsigned char ch) {
+ const char *reps[] = {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
+ };
+ if (ch < (sizeof(reps) / sizeof(reps[0]))) {
+ return reps[ch];
+ } else {
+ return "BAD";
+ }
+}
+
+/**
+ * Convenience class to ensure LineLayout objects are always disposed.
+ */
+class AutoLineLayout {
+ LineLayoutCache &llc;
+ LineLayout *ll;
+ AutoLineLayout &operator=(const AutoLineLayout &);
+public:
+ AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {}
+ ~AutoLineLayout() {
+ llc.Dispose(ll);
+ ll = 0;
+ }
+ LineLayout *operator->() const {
+ return ll;
+ }
+ operator LineLayout *() const {
+ return ll;
+ }
+ void Set(LineLayout *ll_) {
+ llc.Dispose(ll);
+ ll = ll_;
+ }
+};
+
+SelectionPosition Editor::ClampPositionIntoDocument(SelectionPosition sp) const {
+ if (sp.Position() < 0) {
+ return SelectionPosition(0);
+ } else if (sp.Position() > pdoc->Length()) {
+ return SelectionPosition(pdoc->Length());
+ } else {
+ // If not at end of line then set offset to 0
+ if (!pdoc->IsLineEndPosition(sp.Position()))
+ sp.SetVirtualSpace(0);
+ return sp;
+ }
+}
+
+Point Editor::LocationFromPosition(SelectionPosition pos) {
+ Point pt;
+ RefreshStyleData();
+ if (pos.Position() == INVALID_POSITION)
+ return pt;
+ int line = pdoc->LineFromPosition(pos.Position());
+ int lineVisible = cs.DisplayFromDoc(line);
+ //Platform::DebugPrintf("line=%d\n", line);
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+ if (surface && ll) {
+ // -1 because of adding in for visible lines in following loop.
+ pt.y = (lineVisible - topLine - 1) * vs.lineHeight;
+ pt.x = 0;
+ unsigned int posLineStart = pdoc->LineStart(line);
+ LayoutLine(line, surface, vs, ll, wrapWidth);
+ int posInLine = pos.Position() - posLineStart;
+ // In case of very long line put x at arbitrary large position
+ if (posInLine > ll->maxLineLength) {
+ pt.x = ll->positions[ll->maxLineLength] - ll->positions[ll->LineStart(ll->lines)];
+ }
+
+ for (int subLine = 0; subLine < ll->lines; subLine++) {
+ if ((posInLine >= ll->LineStart(subLine)) && (posInLine <= ll->LineStart(subLine + 1))) {
+ pt.x = ll->positions[posInLine] - ll->positions[ll->LineStart(subLine)];
+ if (ll->wrapIndent != 0) {
+ int lineStart = ll->LineStart(subLine);
+ if (lineStart != 0) // Wrapped
+ pt.x += ll->wrapIndent;
+ }
+ }
+ if (posInLine >= ll->LineStart(subLine)) {
+ pt.y += vs.lineHeight;
+ }
+ }
+ pt.x += vs.textStart - xOffset;
+ }
+ pt.x += pos.VirtualSpace() * vs.styles[ll->EndLineStyle()].spaceWidth;
+ return pt;
+}
+
+Point Editor::LocationFromPosition(int pos) {
+ return LocationFromPosition(SelectionPosition(pos));
+}
+
+int Editor::XFromPosition(int pos) {
+ Point pt = LocationFromPosition(pos);
+ return pt.x - vs.textStart + xOffset;
+}
+
+int Editor::XFromPosition(SelectionPosition sp) {
+ Point pt = LocationFromPosition(sp);
+ return pt.x - vs.textStart + xOffset;
+}
+
+int Editor::LineFromLocation(Point pt) const {
+ return cs.DocFromDisplay(pt.y / vs.lineHeight + topLine);
+}
+
+void Editor::SetTopLine(int topLineNew) {
+ if ((topLine != topLineNew) && (topLineNew >= 0)) {
+ topLine = topLineNew;
+ ContainerNeedsUpdate(SC_UPDATE_V_SCROLL);
+ }
+ posTopLine = pdoc->LineStart(cs.DocFromDisplay(topLine));
+}
+
+SelectionPosition Editor::SPositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition, bool virtualSpace) {
+ RefreshStyleData();
+ if (canReturnInvalid) {
+ PRectangle rcClient = GetTextRectangle();
+ if (!rcClient.Contains(pt))
+ return SelectionPosition(INVALID_POSITION);
+ if (pt.x < vs.textStart)
+ return SelectionPosition(INVALID_POSITION);
+ if (pt.y < 0)
+ return SelectionPosition(INVALID_POSITION);
+ }
+ pt = DocumentPointFromView(pt);
+ pt.x = pt.x - vs.textStart;
+ int visibleLine = floor(pt.y / vs.lineHeight);
+ if (!canReturnInvalid && (visibleLine < 0))
+ visibleLine = 0;
+ int lineDoc = cs.DocFromDisplay(visibleLine);
+ if (canReturnInvalid && (lineDoc < 0))
+ return SelectionPosition(INVALID_POSITION);
+ if (lineDoc >= pdoc->LinesTotal())
+ return SelectionPosition(canReturnInvalid ? INVALID_POSITION : pdoc->Length());
+ unsigned int posLineStart = pdoc->LineStart(lineDoc);
+ SelectionPosition retVal(canReturnInvalid ? INVALID_POSITION : static_cast<int>(posLineStart));
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
+ if (surface && ll) {
+ LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
+ int lineStartSet = cs.DisplayFromDoc(lineDoc);
+ int subLine = visibleLine - lineStartSet;
+ if (subLine < ll->lines) {
+ int lineStart = ll->LineStart(subLine);
+ int lineEnd = ll->LineLastVisible(subLine);
+ XYPOSITION subLineStart = ll->positions[lineStart];
+
+ if (ll->wrapIndent != 0) {
+ if (lineStart != 0) // Wrapped
+ pt.x -= ll->wrapIndent;
+ }
+ int i = ll->FindBefore(pt.x + subLineStart, lineStart, lineEnd);
+ while (i < lineEnd) {
+ if (charPosition) {
+ if ((pt.x + subLineStart) < (ll->positions[i + 1])) {
+ return SelectionPosition(pdoc->MovePositionOutsideChar(i + posLineStart, 1));
+ }
+ } else {
+ if ((pt.x + subLineStart) < ((ll->positions[i] + ll->positions[i + 1]) / 2)) {
+ return SelectionPosition(pdoc->MovePositionOutsideChar(i + posLineStart, 1));
+ }
+ }
+ i++;
+ }
+ if (virtualSpace) {
+ const XYPOSITION spaceWidth = vs.styles[ll->EndLineStyle()].spaceWidth;
+ int spaceOffset = (pt.x + subLineStart - ll->positions[lineEnd] + spaceWidth / 2) /
+ spaceWidth;
+ return SelectionPosition(lineEnd + posLineStart, spaceOffset);
+ } else if (canReturnInvalid) {
+ if (pt.x < (ll->positions[lineEnd] - subLineStart)) {
+ return SelectionPosition(pdoc->MovePositionOutsideChar(lineEnd + posLineStart, 1));
+ }
+ } else {
+ return SelectionPosition(lineEnd + posLineStart);
+ }
+ }
+ if (!canReturnInvalid)
+ return SelectionPosition(ll->numCharsInLine + posLineStart);
+ }
+ return retVal;
+}
+
+int Editor::PositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition) {
+ return SPositionFromLocation(pt, canReturnInvalid, charPosition, false).Position();
+}
+
+/**
+ * Find the document position corresponding to an x coordinate on a particular document line.
+ * Ensure is between whole characters when document is in multi-byte or UTF-8 mode.
+ */
+SelectionPosition Editor::SPositionFromLineX(int lineDoc, int x) {
+ RefreshStyleData();
+ if (lineDoc >= pdoc->LinesTotal())
+ return SelectionPosition(pdoc->Length());
+ //Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine);
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
+ int retVal = 0;
+ if (surface && ll) {
+ unsigned int posLineStart = pdoc->LineStart(lineDoc);
+ LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
+ int subLine = 0;
+ int lineStart = ll->LineStart(subLine);
+ int lineEnd = ll->LineLastVisible(subLine);
+ XYPOSITION subLineStart = ll->positions[lineStart];
+ XYPOSITION newX = x;
+
+ if (ll->wrapIndent != 0) {
+ if (lineStart != 0) // Wrapped
+ newX -= ll->wrapIndent;
+ }
+ int i = ll->FindBefore(newX + subLineStart, lineStart, lineEnd);
+ while (i < lineEnd) {
+ if ((newX + subLineStart) < ((ll->positions[i] + ll->positions[i + 1]) / 2)) {
+ retVal = pdoc->MovePositionOutsideChar(i + posLineStart, 1);
+ return SelectionPosition(retVal);
+ }
+ i++;
+ }
+ const XYPOSITION spaceWidth = vs.styles[ll->EndLineStyle()].spaceWidth;
+ int spaceOffset = (newX + subLineStart - ll->positions[lineEnd] + spaceWidth / 2) / spaceWidth;
+ return SelectionPosition(lineEnd + posLineStart, spaceOffset);
+ }
+ return SelectionPosition(retVal);
+}
+
+int Editor::PositionFromLineX(int lineDoc, int x) {
+ return SPositionFromLineX(lineDoc, x).Position();
+}
+
+/**
+ * If painting then abandon the painting because a wider redraw is needed.
+ * @return true if calling code should stop drawing.
+ */
+bool Editor::AbandonPaint() {
+ if ((paintState == painting) && !paintingAllText) {
+ paintState = paintAbandoned;
+ }
+ return paintState == paintAbandoned;
+}
+
+void Editor::RedrawRect(PRectangle rc) {
+ //Platform::DebugPrintf("Redraw %0d,%0d - %0d,%0d\n", rc.left, rc.top, rc.right, rc.bottom);
+
+ // Clip the redraw rectangle into the client area
+ PRectangle rcClient = GetClientRectangle();
+ if (rc.top < rcClient.top)
+ rc.top = rcClient.top;
+ if (rc.bottom > rcClient.bottom)
+ rc.bottom = rcClient.bottom;
+ if (rc.left < rcClient.left)
+ rc.left = rcClient.left;
+ if (rc.right > rcClient.right)
+ rc.right = rcClient.right;
+
+ if ((rc.bottom > rc.top) && (rc.right > rc.left)) {
+ wMain.InvalidateRectangle(rc);
+ }
+}
+
+void Editor::Redraw() {
+ //Platform::DebugPrintf("Redraw all\n");
+ PRectangle rcClient = GetClientRectangle();
+ wMain.InvalidateRectangle(rcClient);
+ if (wMargin.GetID())
+ wMargin.InvalidateAll();
+ //wMain.InvalidateAll();
+}
+
+void Editor::RedrawSelMargin(int line, bool allAfter) {
+ if (!AbandonPaint()) {
+ if (vs.maskInLine) {
+ Redraw();
+ } else {
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = rcSelMargin.left + vs.fixedColumnWidth;
+ if (line != -1) {
+ int position = pdoc->LineStart(line);
+ PRectangle rcLine = RectangleFromRange(position, position);
+
+ // Inflate line rectangle if there are image markers with height larger than line height
+ if (vs.largestMarkerHeight > vs.lineHeight) {
+ int delta = (vs.largestMarkerHeight - vs.lineHeight + 1) / 2;
+ rcLine.top -= delta;
+ rcLine.bottom += delta;
+ if (rcLine.top < rcSelMargin.top)
+ rcLine.top = rcSelMargin.top;
+ if (rcLine.bottom > rcSelMargin.bottom)
+ rcLine.bottom = rcSelMargin.bottom;
+ }
+
+ rcSelMargin.top = rcLine.top;
+ if (!allAfter)
+ rcSelMargin.bottom = rcLine.bottom;
+ }
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcSelMargin.Move(-ptOrigin.x, -ptOrigin.y);
+ wMargin.InvalidateRectangle(rcSelMargin);
+ } else {
+ wMain.InvalidateRectangle(rcSelMargin);
+ }
+ }
+ }
+}
+
+PRectangle Editor::RectangleFromRange(int start, int end) {
+ int minPos = start;
+ if (minPos > end)
+ minPos = end;
+ int maxPos = start;
+ if (maxPos < end)
+ maxPos = end;
+ int minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(minPos));
+ int lineDocMax = pdoc->LineFromPosition(maxPos);
+ int maxLine = cs.DisplayFromDoc(lineDocMax) + cs.GetHeight(lineDocMax) - 1;
+ PRectangle rcClient = GetTextRectangle();
+ PRectangle rc;
+ const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0;
+ rc.left = vs.textStart - leftTextOverlap;
+ rc.top = (minLine - TopLineOfMain()) * vs.lineHeight;
+ if (rc.top < rcClient.top)
+ rc.top = rcClient.top;
+ rc.right = rcClient.right;
+ rc.bottom = (maxLine - TopLineOfMain() + 1) * vs.lineHeight;
+
+ return rc;
+}
+
+void Editor::InvalidateRange(int start, int end) {
+ RedrawRect(RectangleFromRange(start, end));
+}
+
+int Editor::CurrentPosition() const {
+ return sel.MainCaret();
+}
+
+bool Editor::SelectionEmpty() const {
+ return sel.Empty();
+}
+
+SelectionPosition Editor::SelectionStart() {
+ return sel.RangeMain().Start();
+}
+
+SelectionPosition Editor::SelectionEnd() {
+ return sel.RangeMain().End();
+}
+
+void Editor::SetRectangularRange() {
+ if (sel.IsRectangular()) {
+ int xAnchor = XFromPosition(sel.Rectangular().anchor);
+ int xCaret = XFromPosition(sel.Rectangular().caret);
+ if (sel.selType == Selection::selThin) {
+ xCaret = xAnchor;
+ }
+ int lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position());
+ int lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position());
+ int increment = (lineCaret > lineAnchorRect) ? 1 : -1;
+ for (int line=lineAnchorRect; line != lineCaret+increment; line += increment) {
+ SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor));
+ if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) == 0)
+ range.ClearVirtualSpace();
+ if (line == lineAnchorRect)
+ sel.SetSelection(range);
+ else
+ sel.AddSelectionWithoutTrim(range);
+ }
+ }
+}
+
+void Editor::ThinRectangularRange() {
+ if (sel.IsRectangular()) {
+ sel.selType = Selection::selThin;
+ if (sel.Rectangular().caret < sel.Rectangular().anchor) {
+ sel.Rectangular() = SelectionRange(sel.Range(sel.Count()-1).caret, sel.Range(0).anchor);
+ } else {
+ sel.Rectangular() = SelectionRange(sel.Range(sel.Count()-1).anchor, sel.Range(0).caret);
+ }
+ SetRectangularRange();
+ }
+}
+
+void Editor::InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection) {
+ if (sel.Count() > 1 || !(sel.RangeMain().anchor == newMain.anchor) || sel.IsRectangular()) {
+ invalidateWholeSelection = true;
+ }
+ int firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position());
+ // +1 for lastAffected ensures caret repainted
+ int lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position());
+ lastAffected = Platform::Maximum(lastAffected, sel.RangeMain().End().Position());
+ if (invalidateWholeSelection) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ firstAffected = Platform::Minimum(firstAffected, sel.Range(r).caret.Position());
+ firstAffected = Platform::Minimum(firstAffected, sel.Range(r).anchor.Position());
+ lastAffected = Platform::Maximum(lastAffected, sel.Range(r).caret.Position()+1);
+ lastAffected = Platform::Maximum(lastAffected, sel.Range(r).anchor.Position());
+ }
+ }
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
+ InvalidateRange(firstAffected, lastAffected);
+}
+
+void Editor::SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_) {
+ currentPos_ = ClampPositionIntoDocument(currentPos_);
+ anchor_ = ClampPositionIntoDocument(anchor_);
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ /* For Line selection - ensure the anchor and caret are always
+ at the beginning and end of the region lines. */
+ if (sel.selType == Selection::selLines) {
+ if (currentPos_ > anchor_) {
+ anchor_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())));
+ currentPos_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())));
+ } else {
+ currentPos_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())));
+ anchor_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())));
+ }
+ }
+ SelectionRange rangeNew(currentPos_, anchor_);
+ if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) {
+ InvalidateSelection(rangeNew);
+ }
+ sel.RangeMain() = rangeNew;
+ SetRectangularRange();
+ ClaimSelection();
+
+ if (highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetSelection(int currentPos_, int anchor_) {
+ SetSelection(SelectionPosition(currentPos_), SelectionPosition(anchor_));
+}
+
+// Just move the caret on the main selection
+void Editor::SetSelection(SelectionPosition currentPos_) {
+ currentPos_ = ClampPositionIntoDocument(currentPos_);
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ if (sel.Count() > 1 || !(sel.RangeMain().caret == currentPos_)) {
+ InvalidateSelection(SelectionRange(currentPos_));
+ }
+ if (sel.IsRectangular()) {
+ sel.Rectangular() =
+ SelectionRange(SelectionPosition(currentPos_), sel.Rectangular().anchor);
+ SetRectangularRange();
+ } else {
+ sel.RangeMain() =
+ SelectionRange(SelectionPosition(currentPos_), sel.RangeMain().anchor);
+ }
+ ClaimSelection();
+
+ if (highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetSelection(int currentPos_) {
+ SetSelection(SelectionPosition(currentPos_));
+}
+
+void Editor::SetEmptySelection(SelectionPosition currentPos_) {
+ int currentLine = pdoc->LineFromPosition(currentPos_.Position());
+ SelectionRange rangeNew(ClampPositionIntoDocument(currentPos_));
+ if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) {
+ InvalidateSelection(rangeNew);
+ }
+ sel.Clear();
+ sel.RangeMain() = rangeNew;
+ SetRectangularRange();
+ ClaimSelection();
+
+ if (highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ QueueIdleWork(WorkNeeded::workUpdateUI);
+}
+
+void Editor::SetEmptySelection(int currentPos_) {
+ SetEmptySelection(SelectionPosition(currentPos_));
+}
+
+bool Editor::RangeContainsProtected(int start, int end) const {
+ if (vs.ProtectionActive()) {
+ if (start > end) {
+ int t = start;
+ start = end;
+ end = t;
+ }
+ int mask = pdoc->stylingBitsMask;
+ for (int pos = start; pos < end; pos++) {
+ if (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected())
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Editor::SelectionContainsProtected() {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Asks document to find a good position and then moves out of any invisible positions.
+ */
+int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const {
+ return MovePositionOutsideChar(SelectionPosition(pos), moveDir, checkLineEnd).Position();
+}
+
+SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd) const {
+ int posMoved = pdoc->MovePositionOutsideChar(pos.Position(), moveDir, checkLineEnd);
+ if (posMoved != pos.Position())
+ pos.SetPosition(posMoved);
+ if (vs.ProtectionActive()) {
+ int mask = pdoc->stylingBitsMask;
+ if (moveDir > 0) {
+ if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1) & mask].IsProtected()) {
+ while ((pos.Position() < pdoc->Length()) &&
+ (vs.styles[pdoc->StyleAt(pos.Position()) & mask].IsProtected()))
+ pos.Add(1);
+ }
+ } else if (moveDir < 0) {
+ if (vs.styles[pdoc->StyleAt(pos.Position()) & mask].IsProtected()) {
+ while ((pos.Position() > 0) &&
+ (vs.styles[pdoc->StyleAt(pos.Position() - 1) & mask].IsProtected()))
+ pos.Add(-1);
+ }
+ }
+ }
+ return pos;
+}
+
+int Editor::MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, bool ensureVisible) {
+ bool simpleCaret = (sel.Count() == 1) && sel.Empty();
+ SelectionPosition spCaret = sel.Last();
+
+ int delta = newPos.Position() - sel.MainCaret();
+ newPos = ClampPositionIntoDocument(newPos);
+ newPos = MovePositionOutsideChar(newPos, delta);
+ if (!multipleSelection && sel.IsRectangular() && (selt == Selection::selStream)) {
+ // Can't turn into multiple selection so clear additional selections
+ InvalidateSelection(SelectionRange(newPos), true);
+ SelectionRange rangeMain = sel.RangeMain();
+ sel.SetSelection(rangeMain);
+ }
+ if (!sel.IsRectangular() && (selt == Selection::selRectangle)) {
+ // Switching to rectangular
+ InvalidateSelection(sel.RangeMain(), false);
+ SelectionRange rangeMain = sel.RangeMain();
+ sel.Clear();
+ sel.Rectangular() = rangeMain;
+ }
+ if (selt != Selection::noSel) {
+ sel.selType = selt;
+ }
+ if (selt != Selection::noSel || sel.MoveExtends()) {
+ SetSelection(newPos);
+ } else {
+ SetEmptySelection(newPos);
+ }
+ ShowCaretAtCurrentPosition();
+
+ int currentLine = pdoc->LineFromPosition(newPos.Position());
+ if (ensureVisible) {
+ // In case in need of wrapping to ensure DisplayFromDoc works.
+ if (currentLine >= wrapPending.start)
+ WrapLines(wsAll);
+ XYScrollPosition newXY = XYScrollToMakeVisible(
+ SelectionRange(posDrag.IsValid() ? posDrag : sel.RangeMain().caret), xysDefault);
+ if (simpleCaret && (newXY.xOffset == xOffset)) {
+ // simple vertical scroll then invalidate
+ ScrollTo(newXY.topLine);
+ InvalidateSelection(SelectionRange(spCaret), true);
+ } else {
+ SetXYScroll(newXY);
+ }
+ }
+
+ if (highlightDelimiter.NeedsDrawing(currentLine)) {
+ RedrawSelMargin();
+ }
+ return 0;
+}
+
+int Editor::MovePositionTo(int newPos, Selection::selTypes selt, bool ensureVisible) {
+ return MovePositionTo(SelectionPosition(newPos), selt, ensureVisible);
+}
+
+SelectionPosition Editor::MovePositionSoVisible(SelectionPosition pos, int moveDir) {
+ pos = ClampPositionIntoDocument(pos);
+ pos = MovePositionOutsideChar(pos, moveDir);
+ int lineDoc = pdoc->LineFromPosition(pos.Position());
+ if (cs.GetVisible(lineDoc)) {
+ return pos;
+ } else {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (moveDir > 0) {
+ // lineDisplay is already line before fold as lines in fold use display line of line after fold
+ lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed());
+ return SelectionPosition(pdoc->LineStart(cs.DocFromDisplay(lineDisplay)));
+ } else {
+ lineDisplay = Platform::Clamp(lineDisplay - 1, 0, cs.LinesDisplayed());
+ return SelectionPosition(pdoc->LineEnd(cs.DocFromDisplay(lineDisplay)));
+ }
+ }
+}
+
+SelectionPosition Editor::MovePositionSoVisible(int pos, int moveDir) {
+ return MovePositionSoVisible(SelectionPosition(pos), moveDir);
+}
+
+Point Editor::PointMainCaret() {
+ return LocationFromPosition(sel.Range(sel.Main()).caret);
+}
+
+/**
+ * Choose the x position that the caret will try to stick to
+ * as it moves up and down.
+ */
+void Editor::SetLastXChosen() {
+ Point pt = PointMainCaret();
+ lastXChosen = pt.x + xOffset;
+}
+
+void Editor::ScrollTo(int line, bool moveThumb) {
+ int topLineNew = Platform::Clamp(line, 0, MaxScrollPos());
+ if (topLineNew != topLine) {
+ // Try to optimise small scrolls
+#ifndef UNDER_CE
+ int linesToMove = topLine - topLineNew;
+ bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting);
+ willRedrawAll = !performBlit;
+#endif
+ SetTopLine(topLineNew);
+ // Optimize by styling the view as this will invalidate any needed area
+ // which could abort the initial paint if discovered later.
+ StyleToPositionInView(PositionAfterArea(GetClientRectangle()));
+#ifndef UNDER_CE
+ // Perform redraw rather than scroll if many lines would be redrawn anyway.
+ if (performBlit) {
+ ScrollText(linesToMove);
+ } else {
+ Redraw();
+ }
+ willRedrawAll = false;
+#else
+ Redraw();
+#endif
+ if (moveThumb) {
+ SetVerticalScrollPos();
+ }
+ }
+}
+
+void Editor::ScrollText(int /* linesToMove */) {
+ //Platform::DebugPrintf("Editor::ScrollText %d\n", linesToMove);
+ Redraw();
+}
+
+void Editor::HorizontalScrollTo(int xPos) {
+ //Platform::DebugPrintf("HorizontalScroll %d\n", xPos);
+ if (xPos < 0)
+ xPos = 0;
+ if (!Wrapping() && (xOffset != xPos)) {
+ xOffset = xPos;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ SetHorizontalScrollPos();
+ RedrawRect(GetClientRectangle());
+ }
+}
+
+void Editor::VerticalCentreCaret() {
+ int lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret());
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ int newTop = lineDisplay - (LinesOnScreen() / 2);
+ if (topLine != newTop) {
+ SetTopLine(newTop > 0 ? newTop : 0);
+ RedrawRect(GetClientRectangle());
+ }
+}
+
+// Avoid 64 bit compiler warnings.
+// Scintilla does not support text buffers larger than 2**31
+static int istrlen(const char *s) {
+ return static_cast<int>(strlen(s));
+}
+
+void Editor::MoveSelectedLines(int lineDelta) {
+
+ // if selection doesn't start at the beginning of the line, set the new start
+ int selectionStart = SelectionStart().Position();
+ int startLine = pdoc->LineFromPosition(selectionStart);
+ int beginningOfStartLine = pdoc->LineStart(startLine);
+ selectionStart = beginningOfStartLine;
+
+ // if selection doesn't end at the beginning of a line greater than that of the start,
+ // then set it at the beginning of the next one
+ int selectionEnd = SelectionEnd().Position();
+ int endLine = pdoc->LineFromPosition(selectionEnd);
+ int beginningOfEndLine = pdoc->LineStart(endLine);
+ bool appendEol = false;
+ if (selectionEnd > beginningOfEndLine
+ || selectionStart == selectionEnd) {
+ selectionEnd = pdoc->LineStart(endLine + 1);
+ appendEol = (selectionEnd == pdoc->Length() && pdoc->LineFromPosition(selectionEnd) == endLine);
+ }
+
+ // if there's nowhere for the selection to move
+ // (i.e. at the beginning going up or at the end going down),
+ // stop it right there!
+ if ((selectionStart == 0 && lineDelta < 0)
+ || (selectionEnd == pdoc->Length() && lineDelta > 0)
+ || selectionStart == selectionEnd) {
+ return;
+ }
+
+ UndoGroup ug(pdoc);
+
+ if (lineDelta > 0 && selectionEnd == pdoc->LineStart(pdoc->LinesTotal() - 1)) {
+ SetSelection(pdoc->MovePositionOutsideChar(selectionEnd - 1, -1), selectionEnd);
+ ClearSelection();
+ selectionEnd = CurrentPosition();
+ }
+ SetSelection(selectionStart, selectionEnd);
+
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+
+ int selectionLength = SelectionRange(selectionStart, selectionEnd).Length();
+ Point currentLocation = LocationFromPosition(CurrentPosition());
+ int currentLine = LineFromLocation(currentLocation);
+
+ if (appendEol)
+ SetSelection(pdoc->MovePositionOutsideChar(selectionStart - 1, -1), selectionEnd);
+ ClearSelection();
+
+ const char *eol = StringFromEOLMode(pdoc->eolMode);
+ if (currentLine + lineDelta >= pdoc->LinesTotal())
+ pdoc->InsertCString(pdoc->Length(), eol);
+ GoToLine(currentLine + lineDelta);
+
+ pdoc->InsertCString(CurrentPosition(), selectedText.Data());
+ if (appendEol) {
+ pdoc->InsertCString(CurrentPosition() + selectionLength, eol);
+ selectionLength += istrlen(eol);
+ }
+ SetSelection(CurrentPosition(), CurrentPosition() + selectionLength);
+}
+
+void Editor::MoveSelectedLinesUp() {
+ MoveSelectedLines(-1);
+}
+
+void Editor::MoveSelectedLinesDown() {
+ MoveSelectedLines(1);
+}
+
+void Editor::MoveCaretInsideView(bool ensureVisible) {
+ PRectangle rcClient = GetTextRectangle();
+ Point pt = PointMainCaret();
+ if (pt.y < rcClient.top) {
+ MovePositionTo(SPositionFromLocation(
+ Point(lastXChosen - xOffset, rcClient.top),
+ false, false, UserVirtualSpace()),
+ Selection::noSel, ensureVisible);
+ } else if ((pt.y + vs.lineHeight - 1) > rcClient.bottom) {
+ int yOfLastLineFullyDisplayed = rcClient.top + (LinesOnScreen() - 1) * vs.lineHeight;
+ MovePositionTo(SPositionFromLocation(
+ Point(lastXChosen - xOffset, rcClient.top + yOfLastLineFullyDisplayed),
+ false, false, UserVirtualSpace()),
+ Selection::noSel, ensureVisible);
+ }
+}
+
+int Editor::DisplayFromPosition(int pos) {
+ int lineDoc = pdoc->LineFromPosition(pos);
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
+ if (surface && ll) {
+ LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
+ unsigned int posLineStart = pdoc->LineStart(lineDoc);
+ int posInLine = pos - posLineStart;
+ lineDisplay--; // To make up for first increment ahead.
+ for (int subLine = 0; subLine < ll->lines; subLine++) {
+ if (posInLine >= ll->LineStart(subLine)) {
+ lineDisplay++;
+ }
+ }
+ }
+ return lineDisplay;
+}
+
+/**
+ * Ensure the caret is reasonably visible in context.
+ *
+Caret policy in SciTE
+
+If slop is set, we can define a slop value.
+This value defines an unwanted zone (UZ) where the caret is... unwanted.
+This zone is defined as a number of pixels near the vertical margins,
+and as a number of lines near the horizontal margins.
+By keeping the caret away from the edges, it is seen within its context,
+so it is likely that the identifier that the caret is on can be completely seen,
+and that the current line is seen with some of the lines following it which are
+often dependent on that line.
+
+If strict is set, the policy is enforced... strictly.
+The caret is centred on the display if slop is not set,
+and cannot go in the UZ if slop is set.
+
+If jumps is set, the display is moved more energetically
+so the caret can move in the same direction longer before the policy is applied again.
+'3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin.
+
+If even is not set, instead of having symmetrical UZs,
+the left and bottom UZs are extended up to right and top UZs respectively.
+This way, we favour the displaying of useful information: the begining of lines,
+where most code reside, and the lines after the caret, eg. the body of a function.
+
+ | | | | |
+slop | strict | jumps | even | Caret can go to the margin | When reaching limit (caret going out of
+ | | | | | visibility or going into the UZ) display is...
+-----+--------+-------+------+--------------------------------------------+--------------------------------------------------------------
+ 0 | 0 | 0 | 0 | Yes | moved to put caret on top/on right
+ 0 | 0 | 0 | 1 | Yes | moved by one position
+ 0 | 0 | 1 | 0 | Yes | moved to put caret on top/on right
+ 0 | 0 | 1 | 1 | Yes | centred on the caret
+ 0 | 1 | - | 0 | Caret is always on top/on right of display | -
+ 0 | 1 | - | 1 | No, caret is always centred | -
+ 1 | 0 | 0 | 0 | Yes | moved to put caret out of the asymmetrical UZ
+ 1 | 0 | 0 | 1 | Yes | moved to put caret out of the UZ
+ 1 | 0 | 1 | 0 | Yes | moved to put caret at 3UZ of the top or right margin
+ 1 | 0 | 1 | 1 | Yes | moved to put caret at 3UZ of the margin
+ 1 | 1 | - | 0 | Caret is always at UZ of top/right margin | -
+ 1 | 1 | 0 | 1 | No, kept out of UZ | moved by one position
+ 1 | 1 | 1 | 1 | No, kept out of UZ | moved to put caret at 3UZ of the margin
+*/
+
+Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange range, const XYScrollOptions options) {
+ PRectangle rcClient = GetTextRectangle();
+ Point pt = LocationFromPosition(range.caret);
+ Point ptAnchor = LocationFromPosition(range.anchor);
+ const Point ptOrigin = GetVisibleOriginInMain();
+ pt.x += ptOrigin.x;
+ pt.y += ptOrigin.y;
+ ptAnchor.x += ptOrigin.x;
+ ptAnchor.y += ptOrigin.y;
+ const Point ptBottomCaret(pt.x, pt.y + vs.lineHeight - 1);
+
+ XYScrollPosition newXY(xOffset, topLine);
+ if (rcClient.Empty()) {
+ return newXY;
+ }
+
+ // Vertical positioning
+ if ((options & xysVertical) && (pt.y < rcClient.top || ptBottomCaret.y >= rcClient.bottom || (caretYPolicy & CARET_STRICT) != 0)) {
+ const int lineCaret = DisplayFromPosition(range.caret.Position());
+ const int linesOnScreen = LinesOnScreen();
+ const int halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2;
+ const bool bSlop = (caretYPolicy & CARET_SLOP) != 0;
+ const bool bStrict = (caretYPolicy & CARET_STRICT) != 0;
+ const bool bJump = (caretYPolicy & CARET_JUMPS) != 0;
+ const bool bEven = (caretYPolicy & CARET_EVEN) != 0;
+
+ // It should be possible to scroll the window to show the caret,
+ // but this fails to remove the caret on GTK+
+ if (bSlop) { // A margin is defined
+ int yMoveT, yMoveB;
+ if (bStrict) {
+ int yMarginT, yMarginB;
+ if (!(options & xysUseMargin)) {
+ // In drag mode, avoid moves
+ // otherwise, a double click will select several lines.
+ yMarginT = yMarginB = 0;
+ } else {
+ // yMarginT must equal to caretYSlop, with a minimum of 1 and
+ // a maximum of slightly less than half the heigth of the text area.
+ yMarginT = Platform::Clamp(caretYSlop, 1, halfScreen);
+ if (bEven) {
+ yMarginB = yMarginT;
+ } else {
+ yMarginB = linesOnScreen - yMarginT - 1;
+ }
+ }
+ yMoveT = yMarginT;
+ if (bEven) {
+ if (bJump) {
+ yMoveT = Platform::Clamp(caretYSlop * 3, 1, halfScreen);
+ }
+ yMoveB = yMoveT;
+ } else {
+ yMoveB = linesOnScreen - yMoveT - 1;
+ }
+ if (lineCaret < topLine + yMarginT) {
+ // Caret goes too high
+ newXY.topLine = lineCaret - yMoveT;
+ } else if (lineCaret > topLine + linesOnScreen - 1 - yMarginB) {
+ // Caret goes too low
+ newXY.topLine = lineCaret - linesOnScreen + 1 + yMoveB;
+ }
+ } else { // Not strict
+ yMoveT = bJump ? caretYSlop * 3 : caretYSlop;
+ yMoveT = Platform::Clamp(yMoveT, 1, halfScreen);
+ if (bEven) {
+ yMoveB = yMoveT;
+ } else {
+ yMoveB = linesOnScreen - yMoveT - 1;
+ }
+ if (lineCaret < topLine) {
+ // Caret goes too high
+ newXY.topLine = lineCaret - yMoveT;
+ } else if (lineCaret > topLine + linesOnScreen - 1) {
+ // Caret goes too low
+ newXY.topLine = lineCaret - linesOnScreen + 1 + yMoveB;
+ }
+ }
+ } else { // No slop
+ if (!bStrict && !bJump) {
+ // Minimal move
+ if (lineCaret < topLine) {
+ // Caret goes too high
+ newXY.topLine = lineCaret;
+ } else if (lineCaret > topLine + linesOnScreen - 1) {
+ // Caret goes too low
+ if (bEven) {
+ newXY.topLine = lineCaret - linesOnScreen + 1;
+ } else {
+ newXY.topLine = lineCaret;
+ }
+ }
+ } else { // Strict or going out of display
+ if (bEven) {
+ // Always center caret
+ newXY.topLine = lineCaret - halfScreen;
+ } else {
+ // Always put caret on top of display
+ newXY.topLine = lineCaret;
+ }
+ }
+ }
+ if (!(range.caret == range.anchor)) {
+ const int lineAnchor = DisplayFromPosition(range.anchor.Position());
+ if (lineAnchor < lineCaret) {
+ // Shift up to show anchor or as much of range as possible
+ newXY.topLine = std::min(newXY.topLine, lineAnchor);
+ newXY.topLine = std::max(newXY.topLine, lineCaret - LinesOnScreen());
+ } else {
+ // Shift down to show anchor or as much of range as possible
+ newXY.topLine = std::max(newXY.topLine, lineAnchor - LinesOnScreen());
+ newXY.topLine = std::min(newXY.topLine, lineCaret);
+ }
+ }
+ newXY.topLine = Platform::Clamp(newXY.topLine, 0, MaxScrollPos());
+ }
+
+ // Horizontal positioning
+ if ((options & xysHorizontal) && !Wrapping()) {
+ const int halfScreen = Platform::Maximum(rcClient.Width() - 4, 4) / 2;
+ const bool bSlop = (caretXPolicy & CARET_SLOP) != 0;
+ const bool bStrict = (caretXPolicy & CARET_STRICT) != 0;
+ const bool bJump = (caretXPolicy & CARET_JUMPS) != 0;
+ const bool bEven = (caretXPolicy & CARET_EVEN) != 0;
+
+ if (bSlop) { // A margin is defined
+ int xMoveL, xMoveR;
+ if (bStrict) {
+ int xMarginL, xMarginR;
+ if (!(options & xysUseMargin)) {
+ // In drag mode, avoid moves unless very near of the margin
+ // otherwise, a simple click will select text.
+ xMarginL = xMarginR = 2;
+ } else {
+ // xMargin must equal to caretXSlop, with a minimum of 2 and
+ // a maximum of slightly less than half the width of the text area.
+ xMarginR = Platform::Clamp(caretXSlop, 2, halfScreen);
+ if (bEven) {
+ xMarginL = xMarginR;
+ } else {
+ xMarginL = rcClient.Width() - xMarginR - 4;
+ }
+ }
+ if (bJump && bEven) {
+ // Jump is used only in even mode
+ xMoveL = xMoveR = Platform::Clamp(caretXSlop * 3, 1, halfScreen);
+ } else {
+ xMoveL = xMoveR = 0; // Not used, avoid a warning
+ }
+ if (pt.x < rcClient.left + xMarginL) {
+ // Caret is on the left of the display
+ if (bJump && bEven) {
+ newXY.xOffset -= xMoveL;
+ } else {
+ // Move just enough to allow to display the caret
+ newXY.xOffset -= (rcClient.left + xMarginL) - pt.x;
+ }
+ } else if (pt.x >= rcClient.right - xMarginR) {
+ // Caret is on the right of the display
+ if (bJump && bEven) {
+ newXY.xOffset += xMoveR;
+ } else {
+ // Move just enough to allow to display the caret
+ newXY.xOffset += pt.x - (rcClient.right - xMarginR) + 1;
+ }
+ }
+ } else { // Not strict
+ xMoveR = bJump ? caretXSlop * 3 : caretXSlop;
+ xMoveR = Platform::Clamp(xMoveR, 1, halfScreen);
+ if (bEven) {
+ xMoveL = xMoveR;
+ } else {
+ xMoveL = rcClient.Width() - xMoveR - 4;
+ }
+ if (pt.x < rcClient.left) {
+ // Caret is on the left of the display
+ newXY.xOffset -= xMoveL;
+ } else if (pt.x >= rcClient.right) {
+ // Caret is on the right of the display
+ newXY.xOffset += xMoveR;
+ }
+ }
+ } else { // No slop
+ if (bStrict ||
+ (bJump && (pt.x < rcClient.left || pt.x >= rcClient.right))) {
+ // Strict or going out of display
+ if (bEven) {
+ // Center caret
+ newXY.xOffset += pt.x - rcClient.left - halfScreen;
+ } else {
+ // Put caret on right
+ newXY.xOffset += pt.x - rcClient.right + 1;
+ }
+ } else {
+ // Move just enough to allow to display the caret
+ if (pt.x < rcClient.left) {
+ // Caret is on the left of the display
+ if (bEven) {
+ newXY.xOffset -= rcClient.left - pt.x;
+ } else {
+ newXY.xOffset += pt.x - rcClient.right + 1;
+ }
+ } else if (pt.x >= rcClient.right) {
+ // Caret is on the right of the display
+ newXY.xOffset += pt.x - rcClient.right + 1;
+ }
+ }
+ }
+ // In case of a jump (find result) largely out of display, adjust the offset to display the caret
+ if (pt.x + xOffset < rcClient.left + newXY.xOffset) {
+ newXY.xOffset = pt.x + xOffset - rcClient.left;
+ } else if (pt.x + xOffset >= rcClient.right + newXY.xOffset) {
+ newXY.xOffset = pt.x + xOffset - rcClient.right + 1;
+ if (vs.caretStyle == CARETSTYLE_BLOCK) {
+ // Ensure we can see a good portion of the block caret
+ newXY.xOffset += static_cast<int>(vs.aveCharWidth);
+ }
+ }
+ if (!(range.caret == range.anchor)) {
+ if (ptAnchor.x < pt.x) {
+ // Shift to left to show anchor or as much of range as possible
+ int maxOffset = ptAnchor.x + xOffset - rcClient.left - 1;
+ int minOffset = pt.x + xOffset - rcClient.right + 1;
+ newXY.xOffset = std::min(newXY.xOffset, maxOffset);
+ newXY.xOffset = std::max(newXY.xOffset, minOffset);
+ } else {
+ // Shift to right to show anchor or as much of range as possible
+ int minOffset = ptAnchor.x + xOffset - rcClient.right + 1;
+ int maxOffset = pt.x + xOffset - rcClient.left - 1;
+ newXY.xOffset = std::max(newXY.xOffset, minOffset);
+ newXY.xOffset = std::min(newXY.xOffset, maxOffset);
+ }
+ }
+ if (newXY.xOffset < 0) {
+ newXY.xOffset = 0;
+ }
+ }
+
+ return newXY;
+}
+
+void Editor::SetXYScroll(XYScrollPosition newXY) {
+ if ((newXY.topLine != topLine) || (newXY.xOffset != xOffset)) {
+ if (newXY.topLine != topLine) {
+ SetTopLine(newXY.topLine);
+ SetVerticalScrollPos();
+ }
+ if (newXY.xOffset != xOffset) {
+ xOffset = newXY.xOffset;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ if (newXY.xOffset > 0) {
+ PRectangle rcText = GetTextRectangle();
+ if (horizontalScrollBarVisible &&
+ rcText.Width() + xOffset > scrollWidth) {
+ scrollWidth = xOffset + rcText.Width();
+ SetScrollBars();
+ }
+ }
+ SetHorizontalScrollPos();
+ }
+ Redraw();
+ UpdateSystemCaret();
+ }
+}
+
+void Editor::ScrollRange(SelectionRange range) {
+ SetXYScroll(XYScrollToMakeVisible(range, xysDefault));
+}
+
+void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {
+ SetXYScroll(XYScrollToMakeVisible(SelectionRange(posDrag.IsValid() ? posDrag : sel.RangeMain().caret),
+ static_cast<XYScrollOptions>((useMargin?xysUseMargin:0)|(vert?xysVertical:0)|(horiz?xysHorizontal:0))));
+}
+
+void Editor::ShowCaretAtCurrentPosition() {
+ if (hasFocus) {
+ caret.active = true;
+ caret.on = true;
+ SetTicking(true);
+ } else {
+ caret.active = false;
+ caret.on = false;
+ }
+ InvalidateCaret();
+}
+
+void Editor::DropCaret() {
+ caret.active = false;
+ InvalidateCaret();
+}
+
+void Editor::InvalidateCaret() {
+ if (posDrag.IsValid()) {
+ InvalidateRange(posDrag.Position(), posDrag.Position() + 1);
+ } else {
+ for (size_t r=0; r<sel.Count(); r++) {
+ InvalidateRange(sel.Range(r).caret.Position(), sel.Range(r).caret.Position() + 1);
+ }
+ }
+ UpdateSystemCaret();
+}
+
+void Editor::UpdateSystemCaret() {
+}
+
+bool Editor::Wrapping() const {
+ return vs.wrapState != eWrapNone;
+}
+
+void Editor::NeedWrapping(int docLineStart, int docLineEnd) {
+//Platform::DebugPrintf("\nNeedWrapping: %0d..%0d\n", docLineStart, docLineEnd);
+ if (wrapPending.AddRange(docLineStart, docLineEnd)) {
+ llc.Invalidate(LineLayout::llPositions);
+ }
+ // Wrap lines during idle.
+ if (Wrapping() && wrapPending.NeedsWrap()) {
+ SetIdle(true);
+ }
+}
+
+bool Editor::WrapOneLine(Surface *surface, int lineToWrap) {
+ AutoLineLayout ll(llc, RetrieveLineLayout(lineToWrap));
+ int linesWrapped = 1;
+ if (ll) {
+ LayoutLine(lineToWrap, surface, vs, ll, wrapWidth);
+ linesWrapped = ll->lines;
+ }
+ return cs.SetHeight(lineToWrap, linesWrapped +
+ (vs.annotationVisible ? pdoc->AnnotationLines(lineToWrap) : 0));
+}
+
+// Perform wrapping for a subset of the lines needing wrapping.
+// wsAll: wrap all lines which need wrapping in this single call
+// wsVisible: wrap currently visible lines
+// wsIdle: wrap one page + 100 lines
+// Return true if wrapping occurred.
+bool Editor::WrapLines(enum wrapScope ws) {
+ int goodTopLine = topLine;
+ bool wrapOccurred = false;
+ if (!Wrapping()) {
+ if (wrapWidth != LineLayout::wrapWidthInfinite) {
+ wrapWidth = LineLayout::wrapWidthInfinite;
+ for (int lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) {
+ cs.SetHeight(lineDoc, 1 +
+ (vs.annotationVisible ? pdoc->AnnotationLines(lineDoc) : 0));
+ }
+ wrapOccurred = true;
+ }
+ wrapPending.Reset();
+
+ } else if (wrapPending.NeedsWrap()) {
+ wrapPending.start = std::min(wrapPending.start, pdoc->LinesTotal());
+ if (!SetIdle(true)) {
+ // Idle processing not supported so full wrap required.
+ ws = wsAll;
+ }
+ // Decide where to start wrapping
+ int lineToWrap = wrapPending.start;
+ int lineToWrapEnd = std::min(wrapPending.end, pdoc->LinesTotal());
+ const int lineDocTop = cs.DocFromDisplay(topLine);
+ const int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop);
+ if (ws == wsVisible) {
+ lineToWrap = Platform::Clamp(lineDocTop-5, wrapPending.start, pdoc->LinesTotal());
+ // Priority wrap to just after visible area.
+ // Since wrapping could reduce display lines, treat each
+ // as taking only one display line.
+ lineToWrapEnd = lineDocTop;
+ int lines = LinesOnScreen() + 1;
+ while ((lineToWrapEnd < cs.LinesInDoc()) && (lines>0)) {
+ if (cs.GetVisible(lineToWrapEnd))
+ lines--;
+ lineToWrapEnd++;
+ }
+ // .. and if the paint window is outside pending wraps
+ if ((lineToWrap > wrapPending.end) || (lineToWrapEnd < wrapPending.start)) {
+ // Currently visible text does not need wrapping
+ return false;
+ }
+ } else if (ws == wsIdle) {
+ lineToWrapEnd = lineToWrap + LinesOnScreen() + 100;
+ }
+ const int lineEndNeedWrap = std::min(wrapPending.end, pdoc->LinesTotal());
+ lineToWrapEnd = std::min(lineToWrapEnd, lineEndNeedWrap);
+
+ // Ensure all lines being wrapped are styled.
+ pdoc->EnsureStyledTo(pdoc->LineStart(lineToWrapEnd));
+
+ if (lineToWrap < lineToWrapEnd) {
+
+ PRectangle rcTextArea = GetClientRectangle();
+ rcTextArea.left = vs.textStart;
+ rcTextArea.right -= vs.rightMarginWidth;
+ wrapWidth = rcTextArea.Width();
+ RefreshStyleData();
+ AutoSurface surface(this);
+ if (surface) {
+//Platform::DebugPrintf("Wraplines: scope=%0d need=%0d..%0d perform=%0d..%0d\n", ws, wrapPending.start, wrapPending.end, lineToWrap, lineToWrapEnd);
+
+ while (lineToWrap < lineToWrapEnd) {
+ if (WrapOneLine(surface, lineToWrap)) {
+ wrapOccurred = true;
+ }
+ wrapPending.Wrapped(lineToWrap);
+ lineToWrap++;
+ }
+
+ goodTopLine = cs.DisplayFromDoc(lineDocTop) + std::min(subLineTop, cs.GetHeight(lineDocTop)-1);
+ }
+ }
+
+ // If wrapping is done, bring it to resting position
+ if (wrapPending.start >= lineEndNeedWrap) {
+ wrapPending.Reset();
+ }
+ }
+
+ if (wrapOccurred) {
+ SetScrollBars();
+ SetTopLine(Platform::Clamp(goodTopLine, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ }
+
+ return wrapOccurred;
+}
+
+void Editor::LinesJoin() {
+ if (!RangeContainsProtected(targetStart, targetEnd)) {
+ UndoGroup ug(pdoc);
+ bool prevNonWS = true;
+ for (int pos = targetStart; pos < targetEnd; pos++) {
+ if (pdoc->IsPositionInLineEnd(pos)) {
+ targetEnd -= pdoc->LenChar(pos);
+ pdoc->DelChar(pos);
+ if (prevNonWS) {
+ // Ensure at least one space separating previous lines
+ pdoc->InsertChar(pos, ' ');
+ targetEnd++;
+ }
+ } else {
+ prevNonWS = pdoc->CharAt(pos) != ' ';
+ }
+ }
+ }
+}
+
+const char *Editor::StringFromEOLMode(int eolMode) {
+ if (eolMode == SC_EOL_CRLF) {
+ return "\r\n";
+ } else if (eolMode == SC_EOL_CR) {
+ return "\r";
+ } else {
+ return "\n";
+ }
+}
+
+void Editor::LinesSplit(int pixelWidth) {
+ if (!RangeContainsProtected(targetStart, targetEnd)) {
+ if (pixelWidth == 0) {
+ PRectangle rcText = GetTextRectangle();
+ pixelWidth = rcText.Width();
+ }
+ int lineStart = pdoc->LineFromPosition(targetStart);
+ int lineEnd = pdoc->LineFromPosition(targetEnd);
+ const char *eol = StringFromEOLMode(pdoc->eolMode);
+ UndoGroup ug(pdoc);
+ for (int line = lineStart; line <= lineEnd; line++) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+ if (surface && ll) {
+ unsigned int posLineStart = pdoc->LineStart(line);
+ LayoutLine(line, surface, vs, ll, pixelWidth);
+ for (int subLine = 1; subLine < ll->lines; subLine++) {
+ pdoc->InsertCString(
+ static_cast<int>(posLineStart + (subLine - 1) * strlen(eol) +
+ ll->LineStart(subLine)),
+ eol);
+ targetEnd += static_cast<int>(strlen(eol));
+ }
+ }
+ lineEnd = pdoc->LineFromPosition(targetEnd);
+ }
+ }
+}
+
+int Editor::SubstituteMarkerIfEmpty(int markerCheck, int markerDefault) const {
+ if (vs.markers[markerCheck].markType == SC_MARK_EMPTY)
+ return markerDefault;
+ return markerCheck;
+}
+
+bool ValidStyledText(ViewStyle &vs, size_t styleOffset, const StyledText &st) {
+ if (st.multipleStyles) {
+ for (size_t iStyle=0; iStyle<st.length; iStyle++) {
+ if (!vs.ValidStyle(styleOffset + st.styles[iStyle]))
+ return false;
+ }
+ } else {
+ if (!vs.ValidStyle(styleOffset + st.style))
+ return false;
+ }
+ return true;
+}
+
+static int WidthStyledText(Surface *surface, ViewStyle &vs, int styleOffset,
+ const char *text, const unsigned char *styles, size_t len) {
+ int width = 0;
+ size_t start = 0;
+ while (start < len) {
+ size_t style = styles[start];
+ size_t endSegment = start;
+ while ((endSegment+1 < len) && (static_cast<size_t>(styles[endSegment+1]) == style))
+ endSegment++;
+ width += surface->WidthText(vs.styles[style+styleOffset].font, text + start,
+ static_cast<int>(endSegment - start + 1));
+ start = endSegment + 1;
+ }
+ return width;
+}
+
+static int WidestLineWidth(Surface *surface, ViewStyle &vs, int styleOffset, const StyledText &st) {
+ int widthMax = 0;
+ size_t start = 0;
+ while (start < st.length) {
+ size_t lenLine = st.LineLength(start);
+ int widthSubLine;
+ if (st.multipleStyles) {
+ widthSubLine = WidthStyledText(surface, vs, styleOffset, st.text + start, st.styles + start, lenLine);
+ } else {
+ widthSubLine = surface->WidthText(vs.styles[styleOffset + st.style].font,
+ st.text + start, static_cast<int>(lenLine));
+ }
+ if (widthSubLine > widthMax)
+ widthMax = widthSubLine;
+ start += lenLine + 1;
+ }
+ return widthMax;
+}
+
+void DrawStyledText(Surface *surface, ViewStyle &vs, int styleOffset, PRectangle rcText, int ascent,
+ const StyledText &st, size_t start, size_t length) {
+
+ if (st.multipleStyles) {
+ int x = rcText.left;
+ size_t i = 0;
+ while (i < length) {
+ size_t end = i;
+ int style = st.styles[i + start];
+ while (end < length-1 && st.styles[start+end+1] == style)
+ end++;
+ style += styleOffset;
+ int width = surface->WidthText(vs.styles[style].font,
+ st.text + start + i, static_cast<int>(end - i + 1));
+ PRectangle rcSegment = rcText;
+ rcSegment.left = x;
+ rcSegment.right = x + width + 1;
+ surface->DrawTextNoClip(rcSegment, vs.styles[style].font,
+ ascent, st.text + start + i,
+ static_cast<int>(end - i + 1),
+ vs.styles[style].fore,
+ vs.styles[style].back);
+ x += width;
+ i = end + 1;
+ }
+ } else {
+ size_t style = st.style + styleOffset;
+ surface->DrawTextNoClip(rcText, vs.styles[style].font,
+ rcText.top + vs.maxAscent, st.text + start,
+ static_cast<int>(length),
+ vs.styles[style].fore,
+ vs.styles[style].back);
+ }
+}
+
+void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
+ if (vs.fixedColumnWidth == 0)
+ return;
+
+ AllocateGraphics();
+ RefreshStyleData();
+ RefreshPixMaps(surfWindow);
+
+ PRectangle rcMargin = GetClientRectangle();
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcMargin.Move(0, -ptOrigin.y);
+ rcMargin.left = 0;
+ rcMargin.right = vs.fixedColumnWidth;
+
+ if (!rc.Intersects(rcMargin))
+ return;
+
+ Surface *surface;
+ if (bufferedDraw) {
+ surface = pixmapSelMargin;
+ } else {
+ surface = surfWindow;
+ }
+
+ // Clip vertically to paint area to avoid drawing line numbers
+ if (rcMargin.bottom > rc.bottom)
+ rcMargin.bottom = rc.bottom;
+ if (rcMargin.top < rc.top)
+ rcMargin.top = rc.top;
+
+ PRectangle rcSelMargin = rcMargin;
+ rcSelMargin.right = rcMargin.left;
+ if (rcSelMargin.bottom < rc.bottom)
+ rcSelMargin.bottom = rc.bottom;
+
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if (vs.ms[margin].width > 0) {
+
+ rcSelMargin.left = rcSelMargin.right;
+ rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width;
+
+ if (vs.ms[margin].style != SC_MARGIN_NUMBER) {
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ // Required because of special way brush is created for selection margin
+ // Ensure patterns line up when scrolling with separate margin view
+ // by choosing correctly aligned variant.
+ bool invertPhase = static_cast<int>(ptOrigin.y) & 1;
+ surface->FillRectangle(rcSelMargin,
+ invertPhase ? *pixmapSelPattern : *pixmapSelPatternOffset1);
+ } else {
+ ColourDesired colour;
+ switch (vs.ms[margin].style) {
+ case SC_MARGIN_BACK:
+ colour = vs.styles[STYLE_DEFAULT].back;
+ break;
+ case SC_MARGIN_FORE:
+ colour = vs.styles[STYLE_DEFAULT].fore;
+ break;
+ default:
+ colour = vs.styles[STYLE_LINENUMBER].back;
+ break;
+ }
+ surface->FillRectangle(rcSelMargin, colour);
+ }
+ } else {
+ surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back);
+ }
+
+ const int lineStartPaint = (rcMargin.top + ptOrigin.y) / vs.lineHeight;
+ int visibleLine = TopLineOfMain() + lineStartPaint;
+ int yposScreen = lineStartPaint * vs.lineHeight - ptOrigin.y;
+ // Work out whether the top line is whitespace located after a
+ // lessening of fold level which implies a 'fold tail' but which should not
+ // be displayed until the last of a sequence of whitespace.
+ bool needWhiteClosure = false;
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ int level = pdoc->GetLevel(cs.DocFromDisplay(visibleLine));
+ if (level & SC_FOLDLEVELWHITEFLAG) {
+ int lineBack = cs.DocFromDisplay(visibleLine);
+ int levelPrev = level;
+ while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) {
+ lineBack--;
+ levelPrev = pdoc->GetLevel(lineBack);
+ }
+ if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
+ if ((level & SC_FOLDLEVELNUMBERMASK) < (levelPrev & SC_FOLDLEVELNUMBERMASK))
+ needWhiteClosure = true;
+ }
+ }
+ if (highlightDelimiter.isEnabled) {
+ int lastLine = cs.DocFromDisplay(topLine + LinesOnScreen()) + 1;
+ pdoc->GetHighlightDelimiters(highlightDelimiter, pdoc->LineFromPosition(CurrentPosition()), lastLine);
+ }
+ }
+
+ // Old code does not know about new markers needed to distinguish all cases
+ int folderOpenMid = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEROPENMID,
+ SC_MARKNUM_FOLDEROPEN);
+ int folderEnd = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEREND,
+ SC_MARKNUM_FOLDER);
+
+ while ((visibleLine < cs.LinesDisplayed()) && yposScreen < rc.bottom) {
+
+ PLATFORM_ASSERT(visibleLine < cs.LinesDisplayed());
+ int lineDoc = cs.DocFromDisplay(visibleLine);
+ PLATFORM_ASSERT(cs.GetVisible(lineDoc));
+ bool firstSubLine = visibleLine == cs.DisplayFromDoc(lineDoc);
+ bool lastSubLine = visibleLine == (cs.DisplayFromDoc(lineDoc + 1) - 1);
+
+ int marks = pdoc->GetMark(lineDoc);
+ if (!firstSubLine)
+ marks = 0;
+
+ bool headWithTail = false;
+
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ // Decide which fold indicator should be displayed
+ int level = pdoc->GetLevel(lineDoc);
+ int levelNext = pdoc->GetLevel(lineDoc + 1);
+ int levelNum = level & SC_FOLDLEVELNUMBERMASK;
+ int levelNextNum = levelNext & SC_FOLDLEVELNUMBERMASK;
+ if (level & SC_FOLDLEVELHEADERFLAG) {
+ if (firstSubLine) {
+ if (levelNum < levelNextNum) {
+ if (cs.GetExpanded(lineDoc)) {
+ if (levelNum == SC_FOLDLEVELBASE)
+ marks |= 1 << SC_MARKNUM_FOLDEROPEN;
+ else
+ marks |= 1 << folderOpenMid;
+ } else {
+ if (levelNum == SC_FOLDLEVELBASE)
+ marks |= 1 << SC_MARKNUM_FOLDER;
+ else
+ marks |= 1 << folderEnd;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else {
+ if (levelNum < levelNextNum) {
+ if (cs.GetExpanded(lineDoc)) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ needWhiteClosure = false;
+ int firstFollowupLine = cs.DocFromDisplay(cs.DisplayFromDoc(lineDoc + 1));
+ int firstFollowupLineLevel = pdoc->GetLevel(firstFollowupLine);
+ int secondFollowupLineLevelNum = pdoc->GetLevel(firstFollowupLine + 1) & SC_FOLDLEVELNUMBERMASK;
+ if (!cs.GetExpanded(lineDoc)) {
+ if ((firstFollowupLineLevel & SC_FOLDLEVELWHITEFLAG) &&
+ (levelNum > secondFollowupLineLevelNum))
+ needWhiteClosure = true;
+
+ if (highlightDelimiter.IsFoldBlockHighlighted(firstFollowupLine))
+ headWithTail = true;
+ }
+ } else if (level & SC_FOLDLEVELWHITEFLAG) {
+ if (needWhiteClosure) {
+ if (levelNext & SC_FOLDLEVELWHITEFLAG) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ needWhiteClosure = false;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ needWhiteClosure = false;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ if (levelNextNum < levelNum) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ if (levelNextNum < levelNum) {
+ needWhiteClosure = false;
+ if (levelNext & SC_FOLDLEVELWHITEFLAG) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ needWhiteClosure = true;
+ } else if (lastSubLine) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ }
+
+ marks &= vs.ms[margin].mask;
+
+ PRectangle rcMarker = rcSelMargin;
+ rcMarker.top = yposScreen;
+ rcMarker.bottom = yposScreen + vs.lineHeight;
+ if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
+ if (firstSubLine) {
+ char number[100] = "";
+ if (lineDoc >= 0)
+ sprintf(number, "%d", lineDoc + 1);
+ if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
+ int lev = pdoc->GetLevel(lineDoc);
+ sprintf(number, "%c%c %03X %03X",
+ (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
+ (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
+ lev & SC_FOLDLEVELNUMBERMASK,
+ lev >> 16
+ );
+ }
+ PRectangle rcNumber = rcMarker;
+ // Right justify
+ XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
+ XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding;
+ rcNumber.left = xpos;
+ surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
+ rcNumber.top + vs.maxAscent, number, istrlen(number),
+ vs.styles[STYLE_LINENUMBER].fore,
+ vs.styles[STYLE_LINENUMBER].back);
+ } else if (vs.wrapVisualFlags & SC_WRAPVISUALFLAG_MARGIN) {
+ PRectangle rcWrapMarker = rcMarker;
+ rcWrapMarker.right -= 3;
+ rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth;
+ DrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
+ }
+ } else if (vs.ms[margin].style == SC_MARGIN_TEXT || vs.ms[margin].style == SC_MARGIN_RTEXT) {
+ if (firstSubLine) {
+ const StyledText stMargin = pdoc->MarginStyledText(lineDoc);
+ if (stMargin.text && ValidStyledText(vs, vs.marginStyleOffset, stMargin)) {
+ surface->FillRectangle(rcMarker,
+ vs.styles[stMargin.StyleAt(0)+vs.marginStyleOffset].back);
+ if (vs.ms[margin].style == SC_MARGIN_RTEXT) {
+ int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);
+ rcMarker.left = rcMarker.right - width - 3;
+ }
+ DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker, rcMarker.top + vs.maxAscent,
+ stMargin, 0, stMargin.length);
+ }
+ }
+ }
+
+ if (marks) {
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if (marks & 1) {
+ LineMarker::typeOfFold tFold = LineMarker::undefined;
+ if ((vs.ms[margin].mask & SC_MASK_FOLDERS) && highlightDelimiter.IsFoldBlockHighlighted(lineDoc)) {
+ if (highlightDelimiter.IsBodyOfFoldBlock(lineDoc)) {
+ tFold = LineMarker::body;
+ } else if (highlightDelimiter.IsHeadOfFoldBlock(lineDoc)) {
+ if (firstSubLine) {
+ tFold = headWithTail ? LineMarker::headWithTail : LineMarker::head;
+ } else {
+ if (cs.GetExpanded(lineDoc) || headWithTail) {
+ tFold = LineMarker::body;
+ } else {
+ tFold = LineMarker::undefined;
+ }
+ }
+ } else if (highlightDelimiter.IsTailOfFoldBlock(lineDoc)) {
+ tFold = LineMarker::tail;
+ }
+ }
+ vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font, tFold, vs.ms[margin].style);
+ }
+ marks >>= 1;
+ }
+ }
+
+ visibleLine++;
+ yposScreen += vs.lineHeight;
+ }
+ }
+ }
+
+ PRectangle rcBlankMargin = rcMargin;
+ rcBlankMargin.left = rcSelMargin.right;
+ surface->FillRectangle(rcBlankMargin, vs.styles[STYLE_DEFAULT].back);
+
+ if (bufferedDraw) {
+ surfWindow->Copy(rcMargin, Point(rcMargin.left, rcMargin.top), *pixmapSelMargin);
+ }
+}
+
+void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid) {
+ int ydiff = (rcTab.bottom - rcTab.top) / 2;
+ int xhead = rcTab.right - 1 - ydiff;
+ if (xhead <= rcTab.left) {
+ ydiff -= rcTab.left - xhead - 1;
+ xhead = rcTab.left - 1;
+ }
+ if ((rcTab.left + 2) < (rcTab.right - 1))
+ surface->MoveTo(rcTab.left + 2, ymid);
+ else
+ surface->MoveTo(rcTab.right - 1, ymid);
+ surface->LineTo(rcTab.right - 1, ymid);
+ surface->LineTo(xhead, ymid - ydiff);
+ surface->MoveTo(rcTab.right - 1, ymid);
+ surface->LineTo(xhead, ymid + ydiff);
+}
+
+LineLayout *Editor::RetrieveLineLayout(int lineNumber) {
+ int posLineStart = pdoc->LineStart(lineNumber);
+ int posLineEnd = pdoc->LineStart(lineNumber + 1);
+ PLATFORM_ASSERT(posLineEnd >= posLineStart);
+ int lineCaret = pdoc->LineFromPosition(sel.MainCaret());
+ return llc.Retrieve(lineNumber, lineCaret,
+ posLineEnd - posLineStart, pdoc->GetStyleClock(),
+ LinesOnScreen() + 1, pdoc->LinesTotal());
+}
+
+/**
+ * Fill in the LineLayout data for the given line.
+ * Copy the given @a line and its styles from the document into local arrays.
+ * Also determine the x position at which each character starts.
+ */
+void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width) {
+//void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width, Document *pdoc, PositionCache &posCache, SpecialRepresentations &reprs) {
+ if (!ll)
+ return;
+
+ PLATFORM_ASSERT(line < pdoc->LinesTotal());
+ PLATFORM_ASSERT(ll->chars != NULL);
+ int posLineStart = pdoc->LineStart(line);
+ int posLineEnd = pdoc->LineStart(line + 1);
+ // If the line is very long, limit the treatment to a length that should fit in the viewport
+ if (posLineEnd > (posLineStart + ll->maxLineLength)) {
+ posLineEnd = posLineStart + ll->maxLineLength;
+ }
+ if (ll->validity == LineLayout::llCheckTextAndStyle) {
+ int lineLength = posLineEnd - posLineStart;
+ if (!vstyle.viewEOL) {
+ lineLength = pdoc->LineEnd(line) - posLineStart;
+ }
+ if (lineLength == ll->numCharsInLine) {
+ // See if chars, styles, indicators, are all the same
+ bool allSame = true;
+ const int styleMask = pdoc->stylingBitsMask;
+ // Check base line layout
+ char styleByte = 0;
+ int numCharsInLine = 0;
+ while (numCharsInLine < lineLength) {
+ int charInDoc = numCharsInLine + posLineStart;
+ char chDoc = pdoc->CharAt(charInDoc);
+ styleByte = pdoc->StyleAt(charInDoc);
+ allSame = allSame &&
+ (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte & styleMask));
+ allSame = allSame &&
+ (ll->indicators[numCharsInLine] == static_cast<char>(styleByte & ~styleMask));
+ if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed)
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == chDoc);
+ else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower)
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc)));
+ else // Style::caseUpper
+ allSame = allSame &&
+ (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
+ numCharsInLine++;
+ }
+ allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled
+ if (allSame) {
+ ll->validity = LineLayout::llPositions;
+ } else {
+ ll->validity = LineLayout::llInvalid;
+ }
+ } else {
+ ll->validity = LineLayout::llInvalid;
+ }
+ }
+ if (ll->validity == LineLayout::llInvalid) {
+ ll->widthLine = LineLayout::wrapWidthInfinite;
+ ll->lines = 1;
+ if (vstyle.edgeState == EDGE_BACKGROUND) {
+ ll->edgeColumn = pdoc->FindColumn(line, vstyle.theEdge);
+ if (ll->edgeColumn >= posLineStart) {
+ ll->edgeColumn -= posLineStart;
+ }
+ } else {
+ ll->edgeColumn = -1;
+ }
+
+ char styleByte;
+ const int styleMask = pdoc->stylingBitsMask;
+ ll->styleBitsSet = 0;
+ // Fill base line layout
+ const int lineLength = posLineEnd - posLineStart;
+ pdoc->GetCharRange(ll->chars, posLineStart, lineLength);
+ pdoc->GetStyleRange(ll->styles, posLineStart, lineLength);
+ int numCharsBeforeEOL = pdoc->LineEnd(line) - posLineStart;
+ const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL;
+ for (int styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) {
+ styleByte = ll->styles[styleInLine];
+ ll->styleBitsSet |= styleByte;
+ ll->styles[styleInLine] = static_cast<char>(styleByte & styleMask);
+ ll->indicators[styleInLine] = static_cast<char>(styleByte & ~styleMask);
+ }
+ styleByte = static_cast<char>(((lineLength > 0) ? ll->styles[lineLength-1] : 0) & styleMask);
+ if (vstyle.someStylesForceCase) {
+ for (int charInLine = 0; charInLine<lineLength; charInLine++) {
+ char chDoc = ll->chars[charInLine];
+ if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseUpper)
+ ll->chars[charInLine] = static_cast<char>(toupper(chDoc));
+ else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower)
+ ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
+ }
+ }
+ ll->xHighlightGuide = 0;
+ // Extra element at the end of the line to hold end x position and act as
+ ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character
+ ll->styles[numCharsInLine] = styleByte; // For eolFilled
+ ll->indicators[numCharsInLine] = 0;
+
+ // Layout the line, determining the position of each character,
+ // with an extra element at the end for the end of the line.
+ ll->positions[0] = 0;
+ bool lastSegItalics = false;
+
+ BreakFinder bfLayout(ll, 0, numCharsInLine, posLineStart, 0, false, pdoc, &reprs);
+ while (bfLayout.More()) {
+
+ const TextSegment ts = bfLayout.Next();
+
+ std::fill(&ll->positions[ts.start+1], &ll->positions[ts.end()+1], 0.0f);
+ if (vstyle.styles[ll->styles[ts.start]].visible) {
+ if (ts.representation) {
+ XYPOSITION representationWidth = vstyle.controlCharWidth;
+ if (ll->chars[ts.start] == '\t') {
+ // Tab is a special case of representation, taking a variable amount of space
+ representationWidth =
+ ((static_cast<int>((ll->positions[ts.start] + 2) / vstyle.tabWidth) + 1) * vstyle.tabWidth) - ll->positions[ts.start];
+ } else {
+ if (representationWidth <= 0.0) {
+ XYPOSITION positionsRepr[256]; // Should expand when needed
+ posCache.MeasureWidths(surface, vstyle, STYLE_CONTROLCHAR, ts.representation->stringRep.c_str(),
+ static_cast<unsigned int>(ts.representation->stringRep.length()), positionsRepr, pdoc);
+ representationWidth = positionsRepr[ts.representation->stringRep.length()-1] + vstyle.ctrlCharPadding;
+ }
+ }
+ for (int ii=0; ii < ts.length; ii++)
+ ll->positions[ts.start + 1 + ii] = representationWidth;
+ } else {
+ if ((ts.length == 1) && (' ' == ll->chars[ts.start])) {
+ // Over half the segments are single characters and of these about half are space characters.
+ ll->positions[ts.start + 1] = vstyle.styles[ll->styles[ts.start]].spaceWidth;
+ } else {
+ posCache.MeasureWidths(surface, vstyle, ll->styles[ts.start], ll->chars + ts.start,
+ ts.length, ll->positions + ts.start + 1, pdoc);
+ }
+ }
+ lastSegItalics = (!ts.representation) && ((ll->chars[ts.end()-1] != ' ') && vstyle.styles[ll->styles[ts.start]].italic);
+ }
+
+ for (int posToIncrease = ts.start+1; posToIncrease <= ts.end(); posToIncrease++) {
+ ll->positions[posToIncrease] += ll->positions[ts.start];
+ }
+ }
+
+ // Small hack to make lines that end with italics not cut off the edge of the last character
+ if (lastSegItalics) {
+ ll->positions[numCharsInLine] += vstyle.lastSegItalicsOffset;
+ }
+ ll->numCharsInLine = numCharsInLine;
+ ll->numCharsBeforeEOL = numCharsBeforeEOL;
+ ll->validity = LineLayout::llPositions;
+ }
+ // Hard to cope when too narrow, so just assume there is space
+ if (width < 20) {
+ width = 20;
+ }
+ if ((ll->validity == LineLayout::llPositions) || (ll->widthLine != width)) {
+ ll->widthLine = width;
+ if (width == LineLayout::wrapWidthInfinite) {
+ ll->lines = 1;
+ } else if (width > ll->positions[ll->numCharsInLine]) {
+ // Simple common case where line does not need wrapping.
+ ll->lines = 1;
+ } else {
+ if (vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ width -= static_cast<int>(vstyle.aveCharWidth); // take into account the space for end wrap mark
+ }
+ XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line
+ if (vstyle.wrapIndentMode == SC_WRAPINDENT_INDENT) {
+ wrapAddIndent = pdoc->IndentSize() * vstyle.spaceWidth;
+ } else if (vstyle.wrapIndentMode == SC_WRAPINDENT_FIXED) {
+ wrapAddIndent = vstyle.wrapVisualStartIndent * vstyle.aveCharWidth;
+ }
+ ll->wrapIndent = wrapAddIndent;
+ if (vstyle.wrapIndentMode != SC_WRAPINDENT_FIXED)
+ for (int i = 0; i < ll->numCharsInLine; i++) {
+ if (!IsSpaceOrTab(ll->chars[i])) {
+ ll->wrapIndent += ll->positions[i]; // Add line indent
+ break;
+ }
+ }
+ // Check for text width minimum
+ if (ll->wrapIndent > width - static_cast<int>(vstyle.aveCharWidth) * 15)
+ ll->wrapIndent = wrapAddIndent;
+ // Check for wrapIndent minimum
+ if ((vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (ll->wrapIndent < vstyle.aveCharWidth))
+ ll->wrapIndent = vstyle.aveCharWidth; // Indent to show start visual
+ ll->lines = 0;
+ // Calculate line start positions based upon width.
+ int lastGoodBreak = 0;
+ int lastLineStart = 0;
+ XYACCUMULATOR startOffset = 0;
+ int p = 0;
+ while (p < ll->numCharsInLine) {
+ if ((ll->positions[p + 1] - startOffset) >= width) {
+ if (lastGoodBreak == lastLineStart) {
+ // Try moving to start of last character
+ if (p > 0) {
+ lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
+ - posLineStart;
+ }
+ if (lastGoodBreak == lastLineStart) {
+ // Ensure at least one character on line.
+ lastGoodBreak = pdoc->MovePositionOutsideChar(lastGoodBreak + posLineStart + 1, 1)
+ - posLineStart;
+ }
+ }
+ lastLineStart = lastGoodBreak;
+ ll->lines++;
+ ll->SetLineStart(ll->lines, lastGoodBreak);
+ startOffset = ll->positions[lastGoodBreak];
+ // take into account the space for start wrap mark and indent
+ startOffset -= ll->wrapIndent;
+ p = lastGoodBreak + 1;
+ continue;
+ }
+ if (p > 0) {
+ if (vstyle.wrapState == eWrapChar) {
+ lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
+ - posLineStart;
+ p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
+ continue;
+ } else if (ll->styles[p] != ll->styles[p - 1]) {
+ lastGoodBreak = p;
+ } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) {
+ lastGoodBreak = p;
+ }
+ }
+ p++;
+ }
+ ll->lines++;
+ }
+ ll->validity = LineLayout::llLines;
+ }
+}
+
+ColourDesired Editor::SelectionBackground(ViewStyle &vsDraw, bool main) const {
+ return main ?
+ (primarySelection ? vsDraw.selColours.back : vsDraw.selBackground2) :
+ vsDraw.selAdditionalBackground;
+}
+
+ColourDesired Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
+ ColourDesired background, int inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) const {
+ if (inSelection == 1) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
+ return SelectionBackground(vsDraw, true);
+ }
+ } else if (inSelection == 2) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA)) {
+ return SelectionBackground(vsDraw, false);
+ }
+ } else {
+ if ((vsDraw.edgeState == EDGE_BACKGROUND) &&
+ (i >= ll->edgeColumn) &&
+ (i < ll->numCharsBeforeEOL))
+ return vsDraw.edgecolour;
+ if (inHotspot && vsDraw.hotspotColours.back.isSet)
+ return vsDraw.hotspotColours.back;
+ }
+ if (overrideBackground && (styleMain != STYLE_BRACELIGHT) && (styleMain != STYLE_BRACEBAD)) {
+ return background;
+ } else {
+ return vsDraw.styles[styleMain].back;
+ }
+}
+
+void Editor::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight) {
+ Point from(0, ((lineVisible & 1) && (lineHeight & 1)) ? 1 : 0);
+ PRectangle rcCopyArea(start + 1, rcSegment.top, start + 2, rcSegment.bottom);
+ surface->Copy(rcCopyArea, from,
+ highlight ? *pixmapIndentGuideHighlight : *pixmapIndentGuide);
+}
+
+void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
+ bool isEndMarker, ColourDesired wrapColour) {
+ surface->PenColour(wrapColour);
+
+ enum { xa = 1 }; // gap before start
+ int w = rcPlace.right - rcPlace.left - xa - 1;
+
+ bool xStraight = isEndMarker; // x-mirrored symbol for start marker
+
+ int x0 = xStraight ? rcPlace.left : rcPlace.right - 1;
+ int y0 = rcPlace.top;
+
+ int dy = (rcPlace.bottom - rcPlace.top) / 5;
+ int y = (rcPlace.bottom - rcPlace.top) / 2 + dy;
+
+ struct Relative {
+ Surface *surface;
+ int xBase;
+ int xDir;
+ int yBase;
+ int yDir;
+ void MoveTo(int xRelative, int yRelative) {
+ surface->MoveTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
+ }
+ void LineTo(int xRelative, int yRelative) {
+ surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
+ }
+ };
+ Relative rel = {surface, x0, xStraight ? 1 : -1, y0, 1};
+
+ // arrow head
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + 2*w / 3, y - dy);
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + 2*w / 3, y + dy);
+
+ // arrow body
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + w, y);
+ rel.LineTo(xa + w, y - 2 * dy);
+ rel.LineTo(xa - 1, // on windows lineto is exclusive endpoint, perhaps GTK not...
+ y - 2 * dy);
+}
+
+static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourDesired fill, int alpha) {
+ if (alpha != SC_ALPHA_NOALPHA) {
+ surface->AlphaRectangle(rc, 0, fill, alpha, fill, alpha, 0);
+ }
+}
+
+void DrawTextBlob(Surface *surface, ViewStyle &vsDraw, PRectangle rcSegment,
+ const char *s, ColourDesired textBack, ColourDesired textFore, bool twoPhaseDraw) {
+ if (!twoPhaseDraw) {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ Font &ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
+ int normalCharHeight = surface->Ascent(ctrlCharsFont) -
+ surface->InternalLeading(ctrlCharsFont);
+ PRectangle rcCChar = rcSegment;
+ rcCChar.left = rcCChar.left + 1;
+ rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight;
+ rcCChar.bottom = rcSegment.top + vsDraw.maxAscent + 1;
+ PRectangle rcCentral = rcCChar;
+ rcCentral.top++;
+ rcCentral.bottom--;
+ surface->FillRectangle(rcCentral, textFore);
+ PRectangle rcChar = rcCChar;
+ rcChar.left++;
+ rcChar.right--;
+ surface->DrawTextClipped(rcChar, ctrlCharsFont,
+ rcSegment.top + vsDraw.maxAscent, s, istrlen(s),
+ textBack, textFore);
+}
+
+void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
+ int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart,
+ bool overrideBackground, ColourDesired background,
+ bool drawWrapMarkEnd, ColourDesired wrapColour) {
+
+ const int posLineStart = pdoc->LineStart(line);
+ const int styleMask = pdoc->stylingBitsMask;
+ PRectangle rcSegment = rcLine;
+
+ const bool lastSubLine = subLine == (ll->lines - 1);
+ XYPOSITION virtualSpace = 0;
+ if (lastSubLine) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ virtualSpace = sel.VirtualSpaceFor(pdoc->LineEnd(line)) * spaceWidth;
+ }
+ XYPOSITION xEol = ll->positions[lineEnd] - subLineStart;
+
+ // Fill the virtual space and show selections within it
+ if (virtualSpace) {
+ rcSegment.left = xEol + xStart;
+ rcSegment.right = xEol + xStart + virtualSpace;
+ surface->FillRectangle(rcSegment, overrideBackground ? background : vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back);
+ if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) {
+ SelectionSegment virtualSpaceRange(SelectionPosition(pdoc->LineEnd(line)), SelectionPosition(pdoc->LineEnd(line), sel.VirtualSpaceFor(pdoc->LineEnd(line))));
+ for (size_t r=0; r<sel.Count(); r++) {
+ int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ if (alpha == SC_ALPHA_NOALPHA) {
+ SelectionSegment portion = sel.Range(r).Intersect(virtualSpaceRange);
+ if (!portion.Empty()) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] - subLineStart + portion.start.VirtualSpace() * spaceWidth;
+ rcSegment.right = xStart + ll->positions[portion.end.Position() - posLineStart] - subLineStart + portion.end.VirtualSpace() * spaceWidth;
+ rcSegment.left = (rcSegment.left > rcLine.left) ? rcSegment.left : rcLine.left;
+ rcSegment.right = (rcSegment.right < rcLine.right) ? rcSegment.right : rcLine.right;
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, r == sel.Main()));
+ }
+ }
+ }
+ }
+ }
+
+ int eolInSelection = 0;
+ int alpha = SC_ALPHA_NOALPHA;
+ if (!hideSelection) {
+ int posAfterLineEnd = pdoc->LineStart(line + 1);
+ eolInSelection = (subLine == (ll->lines - 1)) ? sel.InSelectionForEOL(posAfterLineEnd) : 0;
+ alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ }
+
+ // Draw the [CR], [LF], or [CR][LF] blobs if visible line ends are on
+ XYPOSITION blobsWidth = 0;
+ if (lastSubLine) {
+ for (int eolPos=ll->numCharsBeforeEOL; eolPos<ll->numCharsInLine; eolPos++) {
+ rcSegment.left = xStart + ll->positions[eolPos] - subLineStart + virtualSpace;
+ rcSegment.right = xStart + ll->positions[eolPos+1] - subLineStart + virtualSpace;
+ blobsWidth += rcSegment.Width();
+ char hexits[4];
+ const char *ctrlChar;
+ unsigned char chEOL = ll->chars[eolPos];
+ if (UTF8IsAscii(chEOL)) {
+ ctrlChar = ControlCharacterString(chEOL);
+ } else {
+ sprintf(hexits, "x%2X", chEOL);
+ ctrlChar = hexits;
+ }
+ int styleMain = ll->styles[eolPos];
+ ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, eolInSelection, false, styleMain, eolPos, ll);
+ ColourDesired textFore = vsDraw.styles[styleMain].fore;
+ if (eolInSelection && vsDraw.selColours.fore.isSet) {
+ textFore = (eolInSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
+ }
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1)) {
+ if (alpha == SC_ALPHA_NOALPHA) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
+ } else {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ } else {
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ DrawTextBlob(surface, vsDraw, rcSegment, ctrlChar, textBack, textFore, twoPhaseDraw);
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
+ }
+ }
+ }
+
+ // Draw the eol-is-selected rectangle
+ rcSegment.left = xEol + xStart + virtualSpace + blobsWidth;
+ rcSegment.right = rcSegment.left + vsDraw.aveCharWidth;
+
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
+ } else {
+ if (overrideBackground) {
+ surface->FillRectangle(rcSegment, background);
+ } else if (line < pdoc->LinesTotal() - 1) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back);
+ } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
+ }
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
+ }
+ }
+
+ // Fill the remainder of the line
+ rcSegment.left = rcSegment.right;
+ if (rcSegment.left < rcLine.left)
+ rcSegment.left = rcLine.left;
+ rcSegment.right = rcLine.right;
+
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
+ } else {
+ if (overrideBackground) {
+ surface->FillRectangle(rcSegment, background);
+ } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back);
+ } else {
+ surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
+ }
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
+ }
+ }
+
+ if (drawWrapMarkEnd) {
+ PRectangle rcPlace = rcSegment;
+
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_END_BY_TEXT) {
+ rcPlace.left = xEol + xStart + virtualSpace;
+ rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
+ } else {
+ // rcLine is clipped to text area
+ rcPlace.right = rcLine.right;
+ rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
+ }
+ DrawWrapMarker(surface, rcPlace, true, wrapColour);
+ }
+}
+
+void Editor::DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, ViewStyle &vsDraw,
+ int xStart, PRectangle rcLine, LineLayout *ll, int subLine) {
+ const XYPOSITION subLineStart = ll->positions[ll->LineStart(subLine)];
+ PRectangle rcIndic(
+ ll->positions[startPos] + xStart - subLineStart,
+ rcLine.top + vsDraw.maxAscent,
+ ll->positions[endPos] + xStart - subLineStart,
+ rcLine.top + vsDraw.maxAscent + 3);
+ vsDraw.indicators[indicNum].Draw(surface, rcIndic, rcLine);
+}
+
+void Editor::DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
+ PRectangle rcLine, LineLayout *ll, int subLine, int lineEnd, bool under) {
+ // Draw decorators
+ const int posLineStart = pdoc->LineStart(line);
+ const int lineStart = ll->LineStart(subLine);
+ const int posLineEnd = posLineStart + lineEnd;
+
+ if (!under) {
+ // Draw indicators
+ // foreach indicator...
+ for (int indicnum = 0, mask = 1 << pdoc->stylingBits; mask < 0x100; indicnum++) {
+ if (!(mask & ll->styleBitsSet)) {
+ mask <<= 1;
+ continue;
+ }
+ int startPos = -1;
+ // foreach style pos in line...
+ for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) {
+ // look for starts...
+ if (startPos < 0) {
+ // NOT in indicator run, looking for START
+ if (indicPos < lineEnd && (ll->indicators[indicPos] & mask))
+ startPos = indicPos;
+ }
+ // ... or ends
+ if (startPos >= 0) {
+ // IN indicator run, looking for END
+ if (indicPos >= lineEnd || !(ll->indicators[indicPos] & mask)) {
+ // AT end of indicator run, DRAW it!
+ DrawIndicator(indicnum, startPos, indicPos, surface, vsDraw, xStart, rcLine, ll, subLine);
+ // RESET control var
+ startPos = -1;
+ }
+ }
+ }
+ mask <<= 1;
+ }
+ }
+
+ for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) {
+ if (under == vsDraw.indicators[deco->indicator].under) {
+ int startPos = posLineStart + lineStart;
+ if (!deco->rs.ValueAt(startPos)) {
+ startPos = deco->rs.EndRun(startPos);
+ }
+ while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) {
+ int endPos = deco->rs.EndRun(startPos);
+ if (endPos > posLineEnd)
+ endPos = posLineEnd;
+ DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart,
+ surface, vsDraw, xStart, rcLine, ll, subLine);
+ startPos = deco->rs.EndRun(endPos);
+ }
+ }
+ }
+
+ // Use indicators to highlight matching braces
+ if ((vs.braceHighlightIndicatorSet && (bracesMatchStyle == STYLE_BRACELIGHT)) ||
+ (vs.braceBadLightIndicatorSet && (bracesMatchStyle == STYLE_BRACEBAD))) {
+ int braceIndicator = (bracesMatchStyle == STYLE_BRACELIGHT) ? vs.braceHighlightIndicator : vs.braceBadLightIndicator;
+ if (under == vsDraw.indicators[braceIndicator].under) {
+ Range rangeLine(posLineStart + lineStart, posLineEnd);
+ if (rangeLine.ContainsCharacter(braces[0])) {
+ int braceOffset = braces[0] - posLineStart;
+ if (braceOffset < ll->numCharsInLine) {
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, xStart, rcLine, ll, subLine);
+ }
+ }
+ if (rangeLine.ContainsCharacter(braces[1])) {
+ int braceOffset = braces[1] - posLineStart;
+ if (braceOffset < ll->numCharsInLine) {
+ DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, xStart, rcLine, ll, subLine);
+ }
+ }
+ }
+ }
+}
+
+void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart,
+ PRectangle rcLine, LineLayout *ll, int subLine) {
+ int indent = pdoc->GetLineIndentation(line) * vsDraw.spaceWidth;
+ PRectangle rcSegment = rcLine;
+ int annotationLine = subLine - ll->lines;
+ const StyledText stAnnotation = pdoc->AnnotationStyledText(line);
+ if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) {
+ surface->FillRectangle(rcSegment, vsDraw.styles[0].back);
+ if (vs.annotationVisible == ANNOTATION_BOXED) {
+ // Only care about calculating width if need to draw box
+ int widthAnnotation = WidestLineWidth(surface, vsDraw, vsDraw.annotationStyleOffset, stAnnotation);
+ widthAnnotation += vsDraw.spaceWidth * 2; // Margins
+ rcSegment.left = xStart + indent;
+ rcSegment.right = rcSegment.left + widthAnnotation;
+ } else {
+ rcSegment.left = xStart;
+ }
+ const int annotationLines = pdoc->AnnotationLines(line);
+ size_t start = 0;
+ size_t lengthAnnotation = stAnnotation.LineLength(start);
+ int lineInAnnotation = 0;
+ while ((lineInAnnotation < annotationLine) && (start < stAnnotation.length)) {
+ start += lengthAnnotation + 1;
+ lengthAnnotation = stAnnotation.LineLength(start);
+ lineInAnnotation++;
+ }
+ PRectangle rcText = rcSegment;
+ if (vs.annotationVisible == ANNOTATION_BOXED) {
+ surface->FillRectangle(rcText,
+ vsDraw.styles[stAnnotation.StyleAt(start) + vsDraw.annotationStyleOffset].back);
+ rcText.left += vsDraw.spaceWidth;
+ }
+ DrawStyledText(surface, vsDraw, vsDraw.annotationStyleOffset, rcText, rcText.top + vsDraw.maxAscent,
+ stAnnotation, start, lengthAnnotation);
+ if (vs.annotationVisible == ANNOTATION_BOXED) {
+ surface->PenColour(vsDraw.styles[vsDraw.annotationStyleOffset].fore);
+ surface->MoveTo(rcSegment.left, rcSegment.top);
+ surface->LineTo(rcSegment.left, rcSegment.bottom);
+ surface->MoveTo(rcSegment.right, rcSegment.top);
+ surface->LineTo(rcSegment.right, rcSegment.bottom);
+ if (subLine == ll->lines) {
+ surface->MoveTo(rcSegment.left, rcSegment.top);
+ surface->LineTo(rcSegment.right, rcSegment.top);
+ }
+ if (subLine == ll->lines+annotationLines-1) {
+ surface->MoveTo(rcSegment.left, rcSegment.bottom - 1);
+ surface->LineTo(rcSegment.right, rcSegment.bottom - 1);
+ }
+ }
+ }
+}
+
+void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
+ PRectangle rcLine, LineLayout *ll, int subLine) {
+
+ if (subLine >= ll->lines) {
+ DrawAnnotation(surface, vsDraw, line, xStart, rcLine, ll, subLine);
+ return; // No further drawing
+ }
+
+ PRectangle rcSegment = rcLine;
+
+ // Using one font for all control characters so it can be controlled independently to ensure
+ // the box goes around the characters tightly. Seems to be no way to work out what height
+ // is taken by an individual character - internal leading gives varying results.
+ Font &ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
+
+ // See if something overrides the line background color: Either if caret is on the line
+ // and background color is set for that, or if a marker is defined that forces its background
+ // color onto the line, or if a marker is defined but has no selection margin in which to
+ // display itself (as long as it's not an SC_MARK_EMPTY marker). These are checked in order
+ // with the earlier taking precedence. When multiple markers cause background override,
+ // the color for the highest numbered one is used.
+ bool overrideBackground = false;
+ ColourDesired background;
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
+ overrideBackground = true;
+ background = vsDraw.caretLineBackground;
+ }
+ if (!overrideBackground) {
+ int marks = pdoc->GetMark(line);
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) &&
+ (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ background = vsDraw.markers[markBit].back;
+ overrideBackground = true;
+ }
+ marks >>= 1;
+ }
+ }
+ if (!overrideBackground) {
+ if (vsDraw.maskInLine) {
+ int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
+ if (marksMasked) {
+ for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
+ if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY) &&
+ (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ overrideBackground = true;
+ background = vsDraw.markers[markBit].back;
+ }
+ marksMasked >>= 1;
+ }
+ }
+ }
+ }
+
+ const bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) &&
+ (!overrideBackground) && (vsDraw.whitespaceColours.back.isSet);
+
+ bool inIndentation = subLine == 0; // Do not handle indentation except on first subline.
+ const XYPOSITION indentWidth = pdoc->IndentSize() * vsDraw.spaceWidth;
+ const XYPOSITION epsilon = 0.0001f; // A small nudge to avoid floating point precision issues
+
+ const int posLineStart = pdoc->LineStart(line);
+
+ const int startseg = ll->LineStart(subLine);
+ const XYACCUMULATOR subLineStart = ll->positions[startseg];
+ int lineStart = 0;
+ int lineEnd = 0;
+ if (subLine < ll->lines) {
+ lineStart = ll->LineStart(subLine);
+ lineEnd = ll->LineStart(subLine + 1);
+ if (subLine == ll->lines - 1) {
+ lineEnd = ll->numCharsBeforeEOL;
+ }
+ }
+
+ const ColourDesired wrapColour = vsDraw.WrapColour();
+
+ bool drawWrapMarkEnd = false;
+
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ if (subLine + 1 < ll->lines) {
+ drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0;
+ }
+ }
+
+ if (ll->wrapIndent != 0) {
+
+ bool continuedWrapLine = false;
+ if (subLine < ll->lines) {
+ continuedWrapLine = ll->LineStart(subLine) != 0;
+ }
+
+ if (continuedWrapLine) {
+ // draw continuation rect
+ PRectangle rcPlace = rcSegment;
+
+ rcPlace.left = ll->positions[startseg] + xStart - subLineStart;
+ rcPlace.right = rcPlace.left + ll->wrapIndent;
+
+ // default bgnd here..
+ surface->FillRectangle(rcSegment, overrideBackground ? background :
+ vsDraw.styles[STYLE_DEFAULT].back);
+
+ // main line style would be below but this would be inconsistent with end markers
+ // also would possibly not be the style at wrap point
+ //int styleMain = ll->styles[lineStart];
+ //surface->FillRectangle(rcPlace, vsDraw.styles[styleMain].back);
+
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_START) {
+
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_START_BY_TEXT)
+ rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
+ else
+ rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
+
+ DrawWrapMarker(surface, rcPlace, false, wrapColour);
+ }
+
+ xStart += static_cast<int>(ll->wrapIndent);
+ }
+ }
+
+ const bool selBackDrawn = vsDraw.selColours.back.isSet &&
+ ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA));
+
+ // Does not take margin into account but not significant
+ const int xStartVisible = static_cast<int>(subLineStart) - xStart;
+
+ ll->psel = &sel;
+
+ if (twoPhaseDraw) {
+ BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc, &reprs);
+
+ // Background drawing loop
+ while (bfBack.More()) {
+
+ const TextSegment ts = bfBack.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
+
+ rcSegment.left = ll->positions[ts.start] + xStart - subLineStart;
+ rcSegment.right = ll->positions[ts.end()] + xStart - subLineStart;
+ // Only try to draw if really visible - enhances performance by not calling environment to
+ // draw strings that are completely past the right side of the window.
+ if (rcSegment.Intersects(rcLine)) {
+ // Clip to line rectangle, since may have a huge position which will not work with some platforms
+ if (rcSegment.left < rcLine.left)
+ rcSegment.left = rcLine.left;
+ if (rcSegment.right > rcLine.right)
+ rcSegment.right = rcLine.right;
+
+ const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
+ const bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
+ ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, inSelection,
+ inHotspot, ll->styles[i], i, ll);
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ } else {
+ // Blob display
+ inIndentation = false;
+ }
+ surface->FillRectangle(rcSegment, textBack);
+ } else {
+ // Normal text display
+ surface->FillRectangle(rcSegment, textBack);
+ if (vsDraw.viewWhitespace != wsInvisible ||
+ (inIndentation && vsDraw.viewIndentationGuides == ivReal)) {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ PRectangle rcSpace(ll->positions[cpos + ts.start] + xStart - subLineStart,
+ rcSegment.top,
+ ll->positions[cpos + ts.start + 1] + xStart - subLineStart,
+ rcSegment.bottom);
+ surface->FillRectangle(rcSpace, vsDraw.whitespaceColours.back);
+ }
+ } else {
+ inIndentation = false;
+ }
+ }
+ }
+ }
+ } else if (rcSegment.left > rcLine.right) {
+ break;
+ }
+ }
+
+ DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd,
+ xStart, subLine, subLineStart, overrideBackground, background,
+ drawWrapMarkEnd, wrapColour);
+ }
+
+ DrawIndicators(surface, vsDraw, line, xStart, rcLine, ll, subLine, lineEnd, true);
+
+ if (vsDraw.edgeState == EDGE_LINE) {
+ int edgeX = vsDraw.theEdge * vsDraw.spaceWidth;
+ rcSegment.left = edgeX + xStart;
+ if ((ll->wrapIndent != 0) && (lineStart != 0))
+ rcSegment.left -= ll->wrapIndent;
+ rcSegment.right = rcSegment.left + 1;
+ surface->FillRectangle(rcSegment, vsDraw.edgecolour);
+ }
+
+ // Draw underline mark as part of background if not transparent
+ int marks = pdoc->GetMark(line);
+ int markBit;
+ for (markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE) &&
+ (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ PRectangle rcUnderline = rcLine;
+ rcUnderline.top = rcUnderline.bottom - 2;
+ surface->FillRectangle(rcUnderline, vsDraw.markers[markBit].back);
+ }
+ marks >>= 1;
+ }
+
+ inIndentation = subLine == 0; // Do not handle indentation except on first subline.
+ // Foreground drawing loop
+ BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, xStartVisible,
+ ((!twoPhaseDraw && selBackDrawn) || vsDraw.selColours.fore.isSet), pdoc, &reprs);
+
+ while (bfFore.More()) {
+
+ const TextSegment ts = bfFore.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
+
+ rcSegment.left = ll->positions[ts.start] + xStart - subLineStart;
+ rcSegment.right = ll->positions[ts.end()] + xStart - subLineStart;
+ // Only try to draw if really visible - enhances performance by not calling environment to
+ // draw strings that are completely past the right side of the window.
+ if (rcSegment.Intersects(rcLine)) {
+ int styleMain = ll->styles[i];
+ ColourDesired textFore = vsDraw.styles[styleMain].fore;
+ Font &textFont = vsDraw.styles[styleMain].font;
+ //hotspot foreground
+ if (ll->hsStart != -1 && iDoc >= ll->hsStart && iDoc < hsEnd) {
+ if (vsDraw.hotspotColours.fore.isSet)
+ textFore = vsDraw.hotspotColours.fore;
+ }
+ const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
+ if (inSelection && (vsDraw.selColours.fore.isSet)) {
+ textFore = (inSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
+ }
+ const bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
+ ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll);
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (!twoPhaseDraw) {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ for (int indentCount = (ll->positions[i] + epsilon) / indentWidth;
+ indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
+ indentCount++) {
+ if (indentCount > 0) {
+ int xIndent = indentCount * indentWidth;
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+ if (vsDraw.viewWhitespace != wsInvisible) {
+ if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
+ surface->PenColour(textFore);
+ PRectangle rcTab(rcSegment.left + 1, rcSegment.top + 4,
+ rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent);
+ DrawTabArrow(surface, rcTab, rcSegment.top + vsDraw.lineHeight / 2);
+ }
+ }
+ } else {
+ inIndentation = false;
+ if (vsDraw.controlCharSymbol >= 32) {
+ char cc[2] = { static_cast<char>(vsDraw.controlCharSymbol), '\0' };
+ surface->DrawTextNoClip(rcSegment, ctrlCharsFont,
+ rcSegment.top + vsDraw.maxAscent,
+ cc, 1, textBack, textFore);
+ } else {
+ DrawTextBlob(surface, vsDraw, rcSegment, ts.representation->stringRep.c_str(), textBack, textFore, twoPhaseDraw);
+ }
+ }
+ } else {
+ // Normal text display
+ if (vsDraw.styles[styleMain].visible) {
+ if (twoPhaseDraw) {
+ surface->DrawTextTransparent(rcSegment, textFont,
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore);
+ } else {
+ surface->DrawTextNoClip(rcSegment, textFont,
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore, textBack);
+ }
+ }
+ if (vsDraw.viewWhitespace != wsInvisible ||
+ (inIndentation && vsDraw.viewIndentationGuides != ivNone)) {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
+ if (vsDraw.viewWhitespace != wsInvisible) {
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
+ if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ XYPOSITION xmid = (ll->positions[cpos + ts.start] + ll->positions[cpos + ts.start + 1]) / 2;
+ if (!twoPhaseDraw && drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ textBack = vsDraw.whitespaceColours.back;
+ PRectangle rcSpace(ll->positions[cpos + ts.start] + xStart - subLineStart,
+ rcSegment.top,
+ ll->positions[cpos + ts.start + 1] + xStart - subLineStart,
+ rcSegment.bottom);
+ surface->FillRectangle(rcSpace, textBack);
+ }
+ PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0);
+ rcDot.right = rcDot.left + vs.whitespaceSize;
+ rcDot.bottom = rcDot.top + vs.whitespaceSize;
+ surface->FillRectangle(rcDot, textFore);
+ }
+ }
+ if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ for (int indentCount = (ll->positions[cpos + ts.start] + epsilon) / indentWidth;
+ indentCount <= (ll->positions[cpos + ts.start + 1] - epsilon) / indentWidth;
+ indentCount++) {
+ if (indentCount > 0) {
+ int xIndent = indentCount * indentWidth;
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+ } else {
+ inIndentation = false;
+ }
+ }
+ }
+ }
+ if (ll->hsStart != -1 && vsDraw.hotspotUnderline && iDoc >= ll->hsStart && iDoc < ll->hsEnd) {
+ PRectangle rcUL = rcSegment;
+ rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
+ rcUL.bottom = rcUL.top + 1;
+ if (vsDraw.hotspotColours.fore.isSet)
+ surface->FillRectangle(rcUL, vsDraw.hotspotColours.fore);
+ else
+ surface->FillRectangle(rcUL, textFore);
+ } else if (vsDraw.styles[styleMain].underline) {
+ PRectangle rcUL = rcSegment;
+ rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
+ rcUL.bottom = rcUL.top + 1;
+ surface->FillRectangle(rcUL, textFore);
+ }
+ } else if (rcSegment.left > rcLine.right) {
+ break;
+ }
+ }
+ if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth)
+ && (subLine == 0)) {
+ int indentSpace = pdoc->GetLineIndentation(line);
+ int xStartText = ll->positions[pdoc->GetLineIndentPosition(line) - posLineStart];
+
+ // Find the most recent line with some text
+
+ int lineLastWithText = line;
+ while (lineLastWithText > Platform::Maximum(line-20, 0) && pdoc->IsWhiteLine(lineLastWithText)) {
+ lineLastWithText--;
+ }
+ if (lineLastWithText < line) {
+ xStartText = 100000; // Don't limit to visible indentation on empty line
+ // This line is empty, so use indentation of last line with text
+ int indentLastWithText = pdoc->GetLineIndentation(lineLastWithText);
+ int isFoldHeader = pdoc->GetLevel(lineLastWithText) & SC_FOLDLEVELHEADERFLAG;
+ if (isFoldHeader) {
+ // Level is one more level than parent
+ indentLastWithText += pdoc->IndentSize();
+ }
+ if (vsDraw.viewIndentationGuides == ivLookForward) {
+ // In viLookForward mode, previous line only used if it is a fold header
+ if (isFoldHeader) {
+ indentSpace = Platform::Maximum(indentSpace, indentLastWithText);
+ }
+ } else { // viLookBoth
+ indentSpace = Platform::Maximum(indentSpace, indentLastWithText);
+ }
+ }
+
+ int lineNextWithText = line;
+ while (lineNextWithText < Platform::Minimum(line+20, pdoc->LinesTotal()) && pdoc->IsWhiteLine(lineNextWithText)) {
+ lineNextWithText++;
+ }
+ if (lineNextWithText > line) {
+ xStartText = 100000; // Don't limit to visible indentation on empty line
+ // This line is empty, so use indentation of first next line with text
+ indentSpace = Platform::Maximum(indentSpace,
+ pdoc->GetLineIndentation(lineNextWithText));
+ }
+
+ for (int indentPos = pdoc->IndentSize(); indentPos < indentSpace; indentPos += pdoc->IndentSize()) {
+ int xIndent = indentPos * vsDraw.spaceWidth;
+ if (xIndent < xStartText) {
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
+ }
+ }
+
+ DrawIndicators(surface, vsDraw, line, xStart, rcLine, ll, subLine, lineEnd, false);
+
+ // End of the drawing of the current line
+ if (!twoPhaseDraw) {
+ DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd,
+ xStart, subLine, subLineStart, overrideBackground, background,
+ drawWrapMarkEnd, wrapColour);
+ }
+ if (!hideSelection && ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA))) {
+ // For each selection draw
+ int virtualSpaces = 0;
+ if (subLine == (ll->lines - 1)) {
+ virtualSpaces = sel.VirtualSpaceFor(pdoc->LineEnd(line));
+ }
+ SelectionPosition posStart(posLineStart + lineStart);
+ SelectionPosition posEnd(posLineStart + lineEnd, virtualSpaces);
+ SelectionSegment virtualSpaceRange(posStart, posEnd);
+ for (size_t r=0; r<sel.Count(); r++) {
+ int alpha = (r == sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha;
+ if (alpha != SC_ALPHA_NOALPHA) {
+ SelectionSegment portion = sel.Range(r).Intersect(virtualSpaceRange);
+ if (!portion.Empty()) {
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] - subLineStart + portion.start.VirtualSpace() * spaceWidth;
+ rcSegment.right = xStart + ll->positions[portion.end.Position() - posLineStart] - subLineStart + portion.end.VirtualSpace() * spaceWidth;
+ if ((ll->wrapIndent != 0) && (lineStart != 0)) {
+ if ((portion.start.Position() - posLineStart) == lineStart && sel.Range(r).ContainsCharacter(portion.start.Position() - 1))
+ rcSegment.left -= static_cast<int>(ll->wrapIndent); // indentation added to xStart was truncated to int, so we do the same here
+ }
+ rcSegment.left = (rcSegment.left > rcLine.left) ? rcSegment.left : rcLine.left;
+ rcSegment.right = (rcSegment.right < rcLine.right) ? rcSegment.right : rcLine.right;
+ if (rcSegment.right > rcLine.left)
+ SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, r == sel.Main()), alpha);
+ }
+ }
+ }
+ }
+
+ // Draw any translucent whole line states
+ rcSegment = rcLine;
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) {
+ SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground, vsDraw.caretLineAlpha);
+ }
+ marks = pdoc->GetMark(line);
+ for (markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) {
+ SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ } else if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE)) {
+ PRectangle rcUnderline = rcSegment;
+ rcUnderline.top = rcUnderline.bottom - 2;
+ SimpleAlphaRectangle(surface, rcUnderline, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ }
+ marks >>= 1;
+ }
+ if (vsDraw.maskInLine) {
+ int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
+ if (marksMasked) {
+ for (markBit = 0; (markBit < 32) && marksMasked; markBit++) {
+ if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) {
+ SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back, vsDraw.markers[markBit].alpha);
+ }
+ marksMasked >>= 1;
+ }
+ }
+ }
+}
+
+void Editor::DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine,
+ int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour) {
+
+ int lineStart = ll->LineStart(subLine);
+ int posBefore = posCaret;
+ int posAfter = MovePositionOutsideChar(posCaret + 1, 1);
+ int numCharsToDraw = posAfter - posCaret;
+
+ // Work out where the starting and ending offsets are. We need to
+ // see if the previous character shares horizontal space, such as a
+ // glyph / combining character. If so we'll need to draw that too.
+ int offsetFirstChar = offset;
+ int offsetLastChar = offset + (posAfter - posCaret);
+ while ((posBefore > 0) && ((offsetLastChar - numCharsToDraw) >= lineStart)) {
+ if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - numCharsToDraw]) > 0) {
+ // The char does not share horizontal space
+ break;
+ }
+ // Char shares horizontal space, update the numChars to draw
+ // Update posBefore to point to the prev char
+ posBefore = MovePositionOutsideChar(posBefore - 1, -1);
+ numCharsToDraw = posAfter - posBefore;
+ offsetFirstChar = offset - (posCaret - posBefore);
+ }
+
+ // See if the next character shares horizontal space, if so we'll
+ // need to draw that too.
+ if (offsetFirstChar < 0)
+ offsetFirstChar = 0;
+ numCharsToDraw = offsetLastChar - offsetFirstChar;
+ while ((offsetLastChar < ll->LineStart(subLine + 1)) && (offsetLastChar <= ll->numCharsInLine)) {
+ // Update posAfter to point to the 2nd next char, this is where
+ // the next character ends, and 2nd next begins. We'll need
+ // to compare these two
+ posBefore = posAfter;
+ posAfter = MovePositionOutsideChar(posAfter + 1, 1);
+ offsetLastChar = offset + (posAfter - posCaret);
+ if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - (posAfter - posBefore)]) > 0) {
+ // The char does not share horizontal space
+ break;
+ }
+ // Char shares horizontal space, update the numChars to draw
+ numCharsToDraw = offsetLastChar - offsetFirstChar;
+ }
+
+ // We now know what to draw, update the caret drawing rectangle
+ rcCaret.left = ll->positions[offsetFirstChar] - ll->positions[lineStart] + xStart;
+ rcCaret.right = ll->positions[offsetFirstChar+numCharsToDraw] - ll->positions[lineStart] + xStart;
+
+ // Adjust caret position to take into account any word wrapping symbols.
+ if ((ll->wrapIndent != 0) && (lineStart != 0)) {
+ XYPOSITION wordWrapCharWidth = ll->wrapIndent;
+ rcCaret.left += wordWrapCharWidth;
+ rcCaret.right += wordWrapCharWidth;
+ }
+
+ // This character is where the caret block is, we override the colours
+ // (inversed) for drawing the caret here.
+ int styleMain = ll->styles[offsetFirstChar];
+ surface->DrawTextClipped(rcCaret, vsDraw.styles[styleMain].font,
+ rcCaret.top + vsDraw.maxAscent, ll->chars + offsetFirstChar,
+ numCharsToDraw, vsDraw.styles[styleMain].back,
+ caretColour);
+}
+
+void Editor::RefreshPixMaps(Surface *surfaceWindow) {
+ if (!pixmapSelPattern->Initialised()) {
+ const int patternSize = 8;
+ pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow, wMain.GetID());
+ pixmapSelPatternOffset1->InitPixMap(patternSize, patternSize, surfaceWindow, wMain.GetID());
+ // This complex procedure is to reproduce the checkerboard dithered pattern used by windows
+ // for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half
+ // way between the chrome colour and the chrome highlight colour making a nice transition
+ // between the window chrome and the content area. And it works in low colour depths.
+ PRectangle rcPattern(0, 0, patternSize, patternSize);
+
+ // Initialize default colours based on the chrome colour scheme. Typically the highlight is white.
+ ColourDesired colourFMFill = vs.selbar;
+ ColourDesired colourFMStripes = vs.selbarlight;
+
+ if (!(vs.selbarlight == ColourDesired(0xff, 0xff, 0xff))) {
+ // User has chosen an unusual chrome colour scheme so just use the highlight edge colour.
+ // (Typically, the highlight colour is white.)
+ colourFMFill = vs.selbarlight;
+ }
+
+ if (vs.foldmarginColour.isSet) {
+ // override default fold margin colour
+ colourFMFill = vs.foldmarginColour;
+ }
+ if (vs.foldmarginHighlightColour.isSet) {
+ // override default fold margin highlight colour
+ colourFMStripes = vs.foldmarginHighlightColour;
+ }
+
+ pixmapSelPattern->FillRectangle(rcPattern, colourFMFill);
+ pixmapSelPatternOffset1->FillRectangle(rcPattern, colourFMStripes);
+ for (int y = 0; y < patternSize; y++) {
+ for (int x = y % 2; x < patternSize; x+=2) {
+ PRectangle rcPixel(x, y, x+1, y+1);
+ pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes);
+ pixmapSelPatternOffset1->FillRectangle(rcPixel, colourFMFill);
+ }
+ }
+ }
+
+ if (!pixmapIndentGuide->Initialised()) {
+ // 1 extra pixel in height so can handle odd/even positions and so produce a continuous line
+ pixmapIndentGuide->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID());
+ pixmapIndentGuideHighlight->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID());
+ PRectangle rcIG(0, 0, 1, vs.lineHeight);
+ pixmapIndentGuide->FillRectangle(rcIG, vs.styles[STYLE_INDENTGUIDE].back);
+ pixmapIndentGuide->PenColour(vs.styles[STYLE_INDENTGUIDE].fore);
+ pixmapIndentGuideHighlight->FillRectangle(rcIG, vs.styles[STYLE_BRACELIGHT].back);
+ pixmapIndentGuideHighlight->PenColour(vs.styles[STYLE_BRACELIGHT].fore);
+ for (int stripe = 1; stripe < vs.lineHeight + 1; stripe += 2) {
+ PRectangle rcPixel(0, stripe, 1, stripe+1);
+ pixmapIndentGuide->FillRectangle(rcPixel, vs.styles[STYLE_INDENTGUIDE].fore);
+ pixmapIndentGuideHighlight->FillRectangle(rcPixel, vs.styles[STYLE_BRACELIGHT].fore);
+ }
+ }
+
+ if (bufferedDraw) {
+ if (!pixmapLine->Initialised()) {
+ PRectangle rcClient = GetClientRectangle();
+ pixmapLine->InitPixMap(rcClient.Width(), vs.lineHeight,
+ surfaceWindow, wMain.GetID());
+ pixmapSelMargin->InitPixMap(vs.fixedColumnWidth,
+ rcClient.Height(), surfaceWindow, wMain.GetID());
+ }
+ }
+}
+
+void Editor::DrawCarets(Surface *surface, ViewStyle &vsDraw, int lineDoc, int xStart,
+ PRectangle rcLine, LineLayout *ll, int subLine) {
+ // When drag is active it is the only caret drawn
+ bool drawDrag = posDrag.IsValid();
+ if (hideSelection && !drawDrag)
+ return;
+ const int posLineStart = pdoc->LineStart(lineDoc);
+ // For each selection draw
+ for (size_t r=0; (r<sel.Count()) || drawDrag; r++) {
+ const bool mainCaret = r == sel.Main();
+ const SelectionPosition posCaret = (drawDrag ? posDrag : sel.Range(r).caret);
+ const int offset = posCaret.Position() - posLineStart;
+ const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;
+ const XYPOSITION virtualOffset = posCaret.VirtualSpace() * spaceWidth;
+ if (ll->InLine(offset, subLine) && offset <= ll->numCharsBeforeEOL) {
+ XYPOSITION xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)];
+ if (ll->wrapIndent != 0) {
+ int lineStart = ll->LineStart(subLine);
+ if (lineStart != 0) // Wrapped
+ xposCaret += ll->wrapIndent;
+ }
+ bool caretBlinkState = (caret.active && caret.on) || (!additionalCaretsBlink && !mainCaret);
+ bool caretVisibleState = additionalCaretsVisible || mainCaret;
+ if ((xposCaret >= 0) && (vsDraw.caretWidth > 0) && (vsDraw.caretStyle != CARETSTYLE_INVISIBLE) &&
+ ((posDrag.IsValid()) || (caretBlinkState && caretVisibleState))) {
+ bool caretAtEOF = false;
+ bool caretAtEOL = false;
+ bool drawBlockCaret = false;
+ XYPOSITION widthOverstrikeCaret;
+ int caretWidthOffset = 0;
+ PRectangle rcCaret = rcLine;
+
+ if (posCaret.Position() == pdoc->Length()) { // At end of document
+ caretAtEOF = true;
+ widthOverstrikeCaret = vsDraw.aveCharWidth;
+ } else if ((posCaret.Position() - posLineStart) >= ll->numCharsInLine) { // At end of line
+ caretAtEOL = true;
+ widthOverstrikeCaret = vsDraw.aveCharWidth;
+ } else {
+ widthOverstrikeCaret = ll->positions[offset + 1] - ll->positions[offset];
+ }
+ if (widthOverstrikeCaret < 3) // Make sure its visible
+ widthOverstrikeCaret = 3;
+
+ if (xposCaret > 0)
+ caretWidthOffset = 1; // Move back so overlaps both character cells.
+ xposCaret += xStart;
+ if (posDrag.IsValid()) {
+ /* Dragging text, use a line caret */
+ rcCaret.left = xposCaret - caretWidthOffset;
+ rcCaret.right = rcCaret.left + vsDraw.caretWidth;
+ } else if (inOverstrike && drawOverstrikeCaret) {
+ /* Overstrike (insert mode), use a modified bar caret */
+ rcCaret.top = rcCaret.bottom - 2;
+ rcCaret.left = xposCaret + 1;
+ rcCaret.right = rcCaret.left + widthOverstrikeCaret - 1;
+ } else if (vsDraw.caretStyle == CARETSTYLE_BLOCK) {
+ /* Block caret */
+ rcCaret.left = xposCaret;
+ if (!caretAtEOL && !caretAtEOF && (ll->chars[offset] != '\t') && !(IsControlCharacter(ll->chars[offset]))) {
+ drawBlockCaret = true;
+ rcCaret.right = xposCaret + widthOverstrikeCaret;
+ } else {
+ rcCaret.right = xposCaret + vsDraw.aveCharWidth;
+ }
+ } else {
+ /* Line caret */
+ rcCaret.left = xposCaret - caretWidthOffset;
+ rcCaret.right = rcCaret.left + vsDraw.caretWidth;
+ }
+ ColourDesired caretColour = mainCaret ? vsDraw.caretcolour : vsDraw.additionalCaretColour;
+ if (drawBlockCaret) {
+ DrawBlockCaret(surface, vsDraw, ll, subLine, xStart, offset, posCaret.Position(), rcCaret, caretColour);
+ } else {
+ surface->FillRectangle(rcCaret, caretColour);
+ }
+ }
+ }
+ if (drawDrag)
+ break;
+ }
+}
+
+void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
+ //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n",
+ // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
+ AllocateGraphics();
+
+ RefreshStyleData();
+ if (paintState == paintAbandoned)
+ return; // Scroll bars may have changed so need redraw
+ RefreshPixMaps(surfaceWindow);
+
+ paintAbandonedByStyling = false;
+
+ StyleToPositionInView(PositionAfterArea(rcArea));
+
+ PRectangle rcClient = GetClientRectangle();
+ Point ptOrigin = GetVisibleOriginInMain();
+ //Platform::DebugPrintf("Client: (%3d,%3d) ... (%3d,%3d) %d\n",
+ // rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
+
+ int screenLinePaintFirst = rcArea.top / vs.lineHeight;
+
+ int xStart = vs.textStart - xOffset + ptOrigin.x;
+ int ypos = 0;
+ if (!bufferedDraw)
+ ypos += screenLinePaintFirst * vs.lineHeight;
+ int yposScreen = screenLinePaintFirst * vs.lineHeight;
+
+ if (NotifyUpdateUI()) {
+ RefreshStyleData();
+ RefreshPixMaps(surfaceWindow);
+ }
+
+ // Wrap the visible lines if needed.
+ if (WrapLines(wsVisible)) {
+ // The wrapping process has changed the height of some lines so
+ // abandon this paint for a complete repaint.
+ if (AbandonPaint()) {
+ return;
+ }
+ RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change
+ }
+ PLATFORM_ASSERT(pixmapSelPattern->Initialised());
+
+ if (!bufferedDraw)
+ surfaceWindow->SetClip(rcArea);
+
+ if (paintState != paintAbandoned) {
+ if (vs.marginInside) {
+ PaintSelMargin(surfaceWindow, rcArea);
+ PRectangle rcRightMargin = rcClient;
+ rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
+ if (rcArea.Intersects(rcRightMargin)) {
+ surfaceWindow->FillRectangle(rcRightMargin, vs.styles[STYLE_DEFAULT].back);
+ }
+ } else { // Else separate view so separate paint event but leftMargin included to allow overlap
+ PRectangle rcLeftMargin = rcArea;
+ rcLeftMargin.left = 0;
+ rcLeftMargin.right = rcLeftMargin.left + vs.leftMarginWidth;
+ if (rcArea.Intersects(rcLeftMargin)) {
+ surfaceWindow->FillRectangle(rcLeftMargin, vs.styles[STYLE_DEFAULT].back);
+ }
+ }
+ }
+
+ if (paintState == paintAbandoned) {
+ // Either styling or NotifyUpdateUI noticed that painting is needed
+ // outside the current painting rectangle
+ //Platform::DebugPrintf("Abandoning paint\n");
+ if (Wrapping()) {
+ if (paintAbandonedByStyling) {
+ // Styling has spilled over a line end, such as occurs by starting a multiline
+ // comment. The width of subsequent text may have changed, so rewrap.
+ NeedWrapping(cs.DocFromDisplay(topLine));
+ }
+ }
+ return;
+ }
+ //Platform::DebugPrintf("start display %d, offset = %d\n", pdoc->Length(), xOffset);
+
+ // Allow text at start of line to overlap 1 pixel into the margin as this displays
+ // serifs and italic stems for aliased text.
+ const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0;
+
+ // Do the painting
+ if (rcArea.right > vs.textStart - leftTextOverlap) {
+
+ Surface *surface = surfaceWindow;
+ if (bufferedDraw) {
+ surface = pixmapLine;
+ PLATFORM_ASSERT(pixmapLine->Initialised());
+ }
+ surface->SetUnicodeMode(IsUnicodeMode());
+ surface->SetDBCSMode(CodePage());
+
+ int visibleLine = TopLineOfMain() + screenLinePaintFirst;
+
+ SelectionPosition posCaret = sel.RangeMain().caret;
+ if (posDrag.IsValid())
+ posCaret = posDrag;
+ int lineCaret = pdoc->LineFromPosition(posCaret.Position());
+
+ PRectangle rcTextArea = rcClient;
+ if (vs.marginInside) {
+ rcTextArea.left += vs.textStart;
+ rcTextArea.right -= vs.rightMarginWidth;
+ } else {
+ rcTextArea = rcArea;
+ }
+
+ // Remove selection margin from drawing area so text will not be drawn
+ // on it in unbuffered mode.
+ if (!bufferedDraw && vs.marginInside) {
+ PRectangle rcClipText = rcTextArea;
+ rcClipText.left -= leftTextOverlap;
+ surfaceWindow->SetClip(rcClipText);
+ }
+
+ // Loop on visible lines
+ //double durLayout = 0.0;
+ //double durPaint = 0.0;
+ //double durCopy = 0.0;
+ //ElapsedTime etWhole;
+ int lineDocPrevious = -1; // Used to avoid laying out one document line multiple times
+ AutoLineLayout ll(llc, 0);
+ while (visibleLine < cs.LinesDisplayed() && yposScreen < rcArea.bottom) {
+
+ int lineDoc = cs.DocFromDisplay(visibleLine);
+ // Only visible lines should be handled by the code within the loop
+ PLATFORM_ASSERT(cs.GetVisible(lineDoc));
+ int lineStartSet = cs.DisplayFromDoc(lineDoc);
+ int subLine = visibleLine - lineStartSet;
+
+ // Copy this line and its styles from the document into local arrays
+ // and determine the x position at which each character starts.
+ //ElapsedTime et;
+ if (lineDoc != lineDocPrevious) {
+ ll.Set(0);
+ ll.Set(RetrieveLineLayout(lineDoc));
+ LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
+ lineDocPrevious = lineDoc;
+ }
+ //durLayout += et.Duration(true);
+
+ if (ll) {
+ ll->containsCaret = lineDoc == lineCaret;
+ if (hideSelection) {
+ ll->containsCaret = false;
+ }
+
+ GetHotSpotRange(ll->hsStart, ll->hsEnd);
+
+ PRectangle rcLine = rcTextArea;
+ rcLine.top = ypos;
+ rcLine.bottom = ypos + vs.lineHeight;
+
+ bool bracesIgnoreStyle = false;
+ if ((vs.braceHighlightIndicatorSet && (bracesMatchStyle == STYLE_BRACELIGHT)) ||
+ (vs.braceBadLightIndicatorSet && (bracesMatchStyle == STYLE_BRACEBAD))) {
+ bracesIgnoreStyle = true;
+ }
+ Range rangeLine(pdoc->LineStart(lineDoc), pdoc->LineStart(lineDoc + 1));
+ // Highlight the current braces if any
+ ll->SetBracesHighlight(rangeLine, braces, static_cast<char>(bracesMatchStyle),
+ highlightGuideColumn * vs.spaceWidth, bracesIgnoreStyle);
+
+ if (leftTextOverlap && bufferedDraw) {
+ PRectangle rcSpacer = rcLine;
+ rcSpacer.right = rcSpacer.left;
+ rcSpacer.left -= 1;
+ surface->FillRectangle(rcSpacer, vs.styles[STYLE_DEFAULT].back);
+ }
+
+ // Draw the line
+ DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine);
+ //durPaint += et.Duration(true);
+
+ // Restore the previous styles for the brace highlights in case layout is in cache.
+ ll->RestoreBracesHighlight(rangeLine, braces, bracesIgnoreStyle);
+
+ bool expanded = cs.GetExpanded(lineDoc);
+ const int level = pdoc->GetLevel(lineDoc);
+ const int levelNext = pdoc->GetLevel(lineDoc + 1);
+ if ((level & SC_FOLDLEVELHEADERFLAG) &&
+ ((level & SC_FOLDLEVELNUMBERMASK) < (levelNext & SC_FOLDLEVELNUMBERMASK))) {
+ // Paint the line above the fold
+ if ((expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_EXPANDED))
+ ||
+ (!expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_CONTRACTED))) {
+ PRectangle rcFoldLine = rcLine;
+ rcFoldLine.bottom = rcFoldLine.top + 1;
+ surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore);
+ }
+ // Paint the line below the fold
+ if ((expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_EXPANDED))
+ ||
+ (!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) {
+ PRectangle rcFoldLine = rcLine;
+ rcFoldLine.top = rcFoldLine.bottom - 1;
+ surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore);
+ }
+ }
+
+ DrawCarets(surface, vs, lineDoc, xStart, rcLine, ll, subLine);
+
+ if (bufferedDraw) {
+ Point from(vs.textStart-leftTextOverlap, 0);
+ PRectangle rcCopyArea(vs.textStart-leftTextOverlap, yposScreen,
+ rcClient.right - vs.rightMarginWidth, yposScreen + vs.lineHeight);
+ surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
+ }
+
+ lineWidthMaxSeen = Platform::Maximum(
+ lineWidthMaxSeen, ll->positions[ll->numCharsInLine]);
+ //durCopy += et.Duration(true);
+ }
+
+ if (!bufferedDraw) {
+ ypos += vs.lineHeight;
+ }
+
+ yposScreen += vs.lineHeight;
+ visibleLine++;
+
+ //gdk_flush();
+ }
+ ll.Set(0);
+ //if (durPaint < 0.00000001)
+ // durPaint = 0.00000001;
+
+ // Right column limit indicator
+ PRectangle rcBeyondEOF = (vs.marginInside) ? rcClient : rcArea;
+ rcBeyondEOF.left = vs.textStart;
+ rcBeyondEOF.right = rcBeyondEOF.right - ((vs.marginInside) ? vs.rightMarginWidth : 0);
+ rcBeyondEOF.top = (cs.LinesDisplayed() - TopLineOfMain()) * vs.lineHeight;
+ if (rcBeyondEOF.top < rcBeyondEOF.bottom) {
+ surfaceWindow->FillRectangle(rcBeyondEOF, vs.styles[STYLE_DEFAULT].back);
+ if (vs.edgeState == EDGE_LINE) {
+ int edgeX = vs.theEdge * vs.spaceWidth;
+ rcBeyondEOF.left = edgeX + xStart;
+ rcBeyondEOF.right = rcBeyondEOF.left + 1;
+ surfaceWindow->FillRectangle(rcBeyondEOF, vs.edgecolour);
+ }
+ }
+ //Platform::DebugPrintf(
+ //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n",
+ //durLayout, durPaint, durLayout / durPaint, durCopy, etWhole.Duration());
+ NotifyPainted();
+ }
+}
+
+// Space (3 space characters) between line numbers and text when printing.
+#define lineNumberPrintSpace " "
+
+ColourDesired InvertedLight(ColourDesired orig) {
+ unsigned int r = orig.GetRed();
+ unsigned int g = orig.GetGreen();
+ unsigned int b = orig.GetBlue();
+ unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye
+ unsigned int il = 0xff - l;
+ if (l == 0)
+ return ColourDesired(0xff, 0xff, 0xff);
+ r = r * il / l;
+ g = g * il / l;
+ b = b * il / l;
+ return ColourDesired(Platform::Minimum(r, 0xff), Platform::Minimum(g, 0xff), Platform::Minimum(b, 0xff));
+}
+
+// This is mostly copied from the Paint method but with some things omitted
+// such as the margin markers, line numbers, selection and caret
+// Should be merged back into a combined Draw method.
+long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
+ if (!pfr)
+ return 0;
+
+ AutoSurface surface(pfr->hdc, this, SC_TECHNOLOGY_DEFAULT);
+ if (!surface)
+ return 0;
+ AutoSurface surfaceMeasure(pfr->hdcTarget, this, SC_TECHNOLOGY_DEFAULT);
+ if (!surfaceMeasure) {
+ return 0;
+ }
+
+ // Can't use measurements cached for screen
+ posCache.Clear();
+
+ ViewStyle vsPrint(vs);
+ vsPrint.technology = SC_TECHNOLOGY_DEFAULT;
+
+ // Modify the view style for printing as do not normally want any of the transient features to be printed
+ // Printing supports only the line number margin.
+ int lineNumberIndex = -1;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) {
+ lineNumberIndex = margin;
+ } else {
+ vsPrint.ms[margin].width = 0;
+ }
+ }
+ vsPrint.fixedColumnWidth = 0;
+ vsPrint.zoomLevel = printParameters.magnification;
+ // Don't show indentation guides
+ // If this ever gets changed, cached pixmap would need to be recreated if technology != SC_TECHNOLOGY_DEFAULT
+ vsPrint.viewIndentationGuides = ivNone;
+ // Don't show the selection when printing
+ vsPrint.selColours.back.isSet = false;
+ vsPrint.selColours.fore.isSet = false;
+ vsPrint.selAlpha = SC_ALPHA_NOALPHA;
+ vsPrint.selAdditionalAlpha = SC_ALPHA_NOALPHA;
+ vsPrint.whitespaceColours.back.isSet = false;
+ vsPrint.whitespaceColours.fore.isSet = false;
+ vsPrint.showCaretLineBackground = false;
+ vsPrint.alwaysShowCaretLineBackground = false;
+ // Don't highlight matching braces using indicators
+ vsPrint.braceHighlightIndicatorSet = false;
+ vsPrint.braceBadLightIndicatorSet = false;
+
+ // Set colours for printing according to users settings
+ for (size_t sty = 0; sty < vsPrint.styles.size(); sty++) {
+ if (printParameters.colourMode == SC_PRINT_INVERTLIGHT) {
+ vsPrint.styles[sty].fore = InvertedLight(vsPrint.styles[sty].fore);
+ vsPrint.styles[sty].back = InvertedLight(vsPrint.styles[sty].back);
+ } else if (printParameters.colourMode == SC_PRINT_BLACKONWHITE) {
+ vsPrint.styles[sty].fore = ColourDesired(0, 0, 0);
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITE) {
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) {
+ if (sty <= STYLE_DEFAULT) {
+ vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
+ }
+ }
+ }
+ // White background for the line numbers
+ vsPrint.styles[STYLE_LINENUMBER].back = ColourDesired(0xff, 0xff, 0xff);
+
+ // Printing uses different margins, so reset screen margins
+ vsPrint.leftMarginWidth = 0;
+ vsPrint.rightMarginWidth = 0;
+
+ vsPrint.Refresh(*surfaceMeasure, pdoc->tabInChars);
+ // Determining width must hapen after fonts have been realised in Refresh
+ int lineNumberWidth = 0;
+ if (lineNumberIndex >= 0) {
+ lineNumberWidth = surfaceMeasure->WidthText(vsPrint.styles[STYLE_LINENUMBER].font,
+ "99999" lineNumberPrintSpace, 5 + istrlen(lineNumberPrintSpace));
+ vsPrint.ms[lineNumberIndex].width = lineNumberWidth;
+ vsPrint.Refresh(*surfaceMeasure, pdoc->tabInChars); // Recalculate fixedColumnWidth
+ }
+
+ int linePrintStart = pdoc->LineFromPosition(pfr->chrg.cpMin);
+ int linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1;
+ if (linePrintLast < linePrintStart)
+ linePrintLast = linePrintStart;
+ int linePrintMax = pdoc->LineFromPosition(pfr->chrg.cpMax);
+ if (linePrintLast > linePrintMax)
+ linePrintLast = linePrintMax;
+ //Platform::DebugPrintf("Formatting lines=[%0d,%0d,%0d] top=%0d bottom=%0d line=%0d %0d\n",
+ // linePrintStart, linePrintLast, linePrintMax, pfr->rc.top, pfr->rc.bottom, vsPrint.lineHeight,
+ // surfaceMeasure->Height(vsPrint.styles[STYLE_LINENUMBER].font));
+ int endPosPrint = pdoc->Length();
+ if (linePrintLast < pdoc->LinesTotal())
+ endPosPrint = pdoc->LineStart(linePrintLast + 1);
+
+ // Ensure we are styled to where we are formatting.
+ pdoc->EnsureStyledTo(endPosPrint);
+
+ int xStart = vsPrint.fixedColumnWidth + pfr->rc.left;
+ int ypos = pfr->rc.top;
+
+ int lineDoc = linePrintStart;
+
+ int nPrintPos = pfr->chrg.cpMin;
+ int visibleLine = 0;
+ int widthPrint = pfr->rc.right - pfr->rc.left - vsPrint.fixedColumnWidth;
+ if (printParameters.wrapState == eWrapNone)
+ widthPrint = LineLayout::wrapWidthInfinite;
+
+ while (lineDoc <= linePrintLast && ypos < pfr->rc.bottom) {
+
+ // When printing, the hdc and hdcTarget may be the same, so
+ // changing the state of surfaceMeasure may change the underlying
+ // state of surface. Therefore, any cached state is discarded before
+ // using each surface.
+ surfaceMeasure->FlushCachedState();
+
+ // Copy this line and its styles from the document into local arrays
+ // and determine the x position at which each character starts.
+ LineLayout ll(pdoc->LineStart(lineDoc+1)-pdoc->LineStart(lineDoc)+1);
+ LayoutLine(lineDoc, surfaceMeasure, vsPrint, &ll, widthPrint);
+
+ ll.containsCaret = false;
+
+ PRectangle rcLine;
+ rcLine.left = pfr->rc.left;
+ rcLine.top = ypos;
+ rcLine.right = pfr->rc.right - 1;
+ rcLine.bottom = ypos + vsPrint.lineHeight;
+
+ // When document line is wrapped over multiple display lines, find where
+ // to start printing from to ensure a particular position is on the first
+ // line of the page.
+ if (visibleLine == 0) {
+ int startWithinLine = nPrintPos - pdoc->LineStart(lineDoc);
+ for (int iwl = 0; iwl < ll.lines - 1; iwl++) {
+ if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) {
+ visibleLine = -iwl;
+ }
+ }
+
+ if (ll.lines > 1 && startWithinLine >= ll.LineStart(ll.lines - 1)) {
+ visibleLine = -(ll.lines - 1);
+ }
+ }
+
+ if (draw && lineNumberWidth &&
+ (ypos + vsPrint.lineHeight <= pfr->rc.bottom) &&
+ (visibleLine >= 0)) {
+ char number[100];
+ sprintf(number, "%d" lineNumberPrintSpace, lineDoc + 1);
+ PRectangle rcNumber = rcLine;
+ rcNumber.right = rcNumber.left + lineNumberWidth;
+ // Right justify
+ rcNumber.left = rcNumber.right - surfaceMeasure->WidthText(
+ vsPrint.styles[STYLE_LINENUMBER].font, number, istrlen(number));
+ surface->FlushCachedState();
+ surface->DrawTextNoClip(rcNumber, vsPrint.styles[STYLE_LINENUMBER].font,
+ ypos + vsPrint.maxAscent, number, istrlen(number),
+ vsPrint.styles[STYLE_LINENUMBER].fore,
+ vsPrint.styles[STYLE_LINENUMBER].back);
+ }
+
+ // Draw the line
+ surface->FlushCachedState();
+
+ for (int iwl = 0; iwl < ll.lines; iwl++) {
+ if (ypos + vsPrint.lineHeight <= pfr->rc.bottom) {
+ if (visibleLine >= 0) {
+ if (draw) {
+ rcLine.top = ypos;
+ rcLine.bottom = ypos + vsPrint.lineHeight;
+ DrawLine(surface, vsPrint, lineDoc, visibleLine, xStart, rcLine, &ll, iwl);
+ }
+ ypos += vsPrint.lineHeight;
+ }
+ visibleLine++;
+ if (iwl == ll.lines - 1)
+ nPrintPos = pdoc->LineStart(lineDoc + 1);
+ else
+ nPrintPos += ll.LineStart(iwl + 1) - ll.LineStart(iwl);
+ }
+ }
+
+ ++lineDoc;
+ }
+
+ // Clear cache so measurements are not used for screen
+ posCache.Clear();
+
+ return nPrintPos;
+}
+
+int Editor::TextWidth(int style, const char *text) {
+ RefreshStyleData();
+ AutoSurface surface(this);
+ if (surface) {
+ return surface->WidthText(vs.styles[style].font, text, istrlen(text));
+ } else {
+ return 1;
+ }
+}
+
+// Empty method is overridden on GTK+ to show / hide scrollbars
+void Editor::ReconfigureScrollBars() {}
+
+void Editor::SetScrollBars() {
+ RefreshStyleData();
+
+ int nMax = MaxScrollPos();
+ int nPage = LinesOnScreen();
+ bool modified = ModifyScrollBars(nMax + nPage - 1, nPage);
+ if (modified) {
+ DwellEnd(true);
+ }
+
+ // TODO: ensure always showing as many lines as possible
+ // May not be, if, for example, window made larger
+ if (topLine > MaxScrollPos()) {
+ SetTopLine(Platform::Clamp(topLine, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ if (modified) {
+ if (!AbandonPaint())
+ Redraw();
+ }
+ //Platform::DebugPrintf("end max = %d page = %d\n", nMax, nPage);
+}
+
+void Editor::ChangeSize() {
+ DropGraphics(false);
+ SetScrollBars();
+ if (Wrapping()) {
+ PRectangle rcTextArea = GetClientRectangle();
+ rcTextArea.left = vs.textStart;
+ rcTextArea.right -= vs.rightMarginWidth;
+ if (wrapWidth != rcTextArea.Width()) {
+ NeedWrapping();
+ Redraw();
+ }
+ }
+}
+
+int Editor::InsertSpace(int position, unsigned int spaces) {
+ if (spaces > 0) {
+ std::string spaceText(spaces, ' ');
+ pdoc->InsertString(position, spaceText.c_str(), spaces);
+ position += spaces;
+ }
+ return position;
+}
+
+void Editor::AddChar(char ch) {
+ char s[2];
+ s[0] = ch;
+ s[1] = '\0';
+ AddCharUTF(s, 1);
+}
+
+void Editor::FilterSelections() {
+ if (!additionalSelectionTyping && (sel.Count() > 1)) {
+ SelectionRange rangeOnly = sel.RangeMain();
+ InvalidateSelection(rangeOnly, true);
+ sel.SetSelection(rangeOnly);
+ }
+}
+
+static bool cmpSelPtrs(const SelectionRange *a, const SelectionRange *b) {
+ return *a < *b;
+}
+
+// AddCharUTF inserts an array of bytes which may or may not be in UTF-8.
+void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
+ FilterSelections();
+ {
+ UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty() || inOverstrike);
+
+ std::vector<SelectionRange *> selPtrs;
+ for (size_t r = 0; r < sel.Count(); r++) {
+ selPtrs.push_back(&sel.Range(r));
+ }
+ std::sort(selPtrs.begin(), selPtrs.end(), cmpSelPtrs);
+
+ for (std::vector<SelectionRange *>::reverse_iterator rit = selPtrs.rbegin();
+ rit != selPtrs.rend(); ++rit) {
+ SelectionRange *currentSel = *rit;
+ if (!RangeContainsProtected(currentSel->Start().Position(),
+ currentSel->End().Position())) {
+ int positionInsert = currentSel->Start().Position();
+ if (!currentSel->Empty()) {
+ if (currentSel->Length()) {
+ pdoc->DeleteChars(positionInsert, currentSel->Length());
+ currentSel->ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ currentSel->MinimizeVirtualSpace();
+ }
+ } else if (inOverstrike) {
+ if (positionInsert < pdoc->Length()) {
+ if (!pdoc->IsPositionInLineEnd(positionInsert)) {
+ pdoc->DelChar(positionInsert);
+ currentSel->ClearVirtualSpace();
+ }
+ }
+ }
+ positionInsert = InsertSpace(positionInsert, currentSel->caret.VirtualSpace());
+ if (pdoc->InsertString(positionInsert, s, len)) {
+ currentSel->caret.SetPosition(positionInsert + len);
+ currentSel->anchor.SetPosition(positionInsert + len);
+ }
+ currentSel->ClearVirtualSpace();
+ // If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
+ if (Wrapping()) {
+ AutoSurface surface(this);
+ if (surface) {
+ if (WrapOneLine(surface, pdoc->LineFromPosition(positionInsert))) {
+ SetScrollBars();
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ }
+ }
+ }
+ }
+ }
+ if (Wrapping()) {
+ SetScrollBars();
+ }
+ ThinRectangularRange();
+ // If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
+ EnsureCaretVisible();
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+ if ((caretSticky == SC_CARETSTICKY_OFF) ||
+ ((caretSticky == SC_CARETSTICKY_WHITESPACE) && !IsAllSpacesOrTabs(s, len))) {
+ SetLastXChosen();
+ }
+
+ if (treatAsDBCS) {
+ NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
+ static_cast<unsigned char>(s[1]));
+ } else if (len > 0) {
+ int byte = static_cast<unsigned char>(s[0]);
+ if ((byte < 0xC0) || (1 == len)) {
+ // Handles UTF-8 characters between 0x01 and 0x7F and single byte
+ // characters when not in UTF-8 mode.
+ // Also treats \0 and naked trail bytes 0x80 to 0xBF as valid
+ // characters representing themselves.
+ } else {
+ // Unroll 1 to 3 byte UTF-8 sequences. See reference data at:
+ // http://www.cl.cam.ac.uk/~mgk25/unicode.html
+ // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
+ if (byte < 0xE0) {
+ int byte2 = static_cast<unsigned char>(s[1]);
+ if ((byte2 & 0xC0) == 0x80) {
+ // Two-byte-character lead-byte followed by a trail-byte.
+ byte = (((byte & 0x1F) << 6) | (byte2 & 0x3F));
+ }
+ // A two-byte-character lead-byte not followed by trail-byte
+ // represents itself.
+ } else if (byte < 0xF0) {
+ int byte2 = static_cast<unsigned char>(s[1]);
+ int byte3 = static_cast<unsigned char>(s[2]);
+ if (((byte2 & 0xC0) == 0x80) && ((byte3 & 0xC0) == 0x80)) {
+ // Three-byte-character lead byte followed by two trail bytes.
+ byte = (((byte & 0x0F) << 12) | ((byte2 & 0x3F) << 6) |
+ (byte3 & 0x3F));
+ }
+ // A three-byte-character lead-byte not followed by two trail-bytes
+ // represents itself.
+ }
+ }
+ NotifyChar(byte);
+ }
+
+ if (recordingMacro) {
+ NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(s));
+ }
+}
+
+void Editor::InsertPaste(SelectionPosition selStart, const char *text, int len) {
+ if (multiPasteMode == SC_MULTIPASTE_ONCE) {
+ selStart = SelectionPosition(InsertSpace(selStart.Position(), selStart.VirtualSpace()));
+ if (pdoc->InsertString(selStart.Position(), text, len)) {
+ SetEmptySelection(selStart.Position() + len);
+ }
+ } else {
+ // SC_MULTIPASTE_EACH
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ int positionInsert = sel.Range(r).Start().Position();
+ if (!sel.Range(r).Empty()) {
+ if (sel.Range(r).Length()) {
+ pdoc->DeleteChars(positionInsert, sel.Range(r).Length());
+ sel.Range(r).ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ sel.Range(r).MinimizeVirtualSpace();
+ }
+ }
+ positionInsert = InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace());
+ if (pdoc->InsertString(positionInsert, text, len)) {
+ sel.Range(r).caret.SetPosition(positionInsert + len);
+ sel.Range(r).anchor.SetPosition(positionInsert + len);
+ }
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ }
+}
+
+void Editor::ClearSelection(bool retainMultipleSelections) {
+ if (!sel.IsRectangular() && !retainMultipleSelections)
+ FilterSelections();
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!sel.Range(r).Empty()) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ pdoc->DeleteChars(sel.Range(r).Start().Position(),
+ sel.Range(r).Length());
+ sel.Range(r) = sel.Range(r).Start();
+ }
+ }
+ }
+ ThinRectangularRange();
+ sel.RemoveDuplicates();
+ ClaimSelection();
+}
+
+void Editor::ClearAll() {
+ {
+ UndoGroup ug(pdoc);
+ if (0 != pdoc->Length()) {
+ pdoc->DeleteChars(0, pdoc->Length());
+ }
+ if (!pdoc->IsReadOnly()) {
+ cs.Clear();
+ pdoc->AnnotationClearAll();
+ pdoc->MarginClearAll();
+ }
+ }
+ sel.Clear();
+ SetTopLine(0);
+ SetVerticalScrollPos();
+ InvalidateStyleRedraw();
+}
+
+void Editor::ClearDocumentStyle() {
+ Decoration *deco = pdoc->decorations.root;
+ while (deco) {
+ // Save next in case deco deleted
+ Decoration *decoNext = deco->next;
+ if (deco->indicator < INDIC_CONTAINER) {
+ pdoc->decorations.SetCurrentIndicator(deco->indicator);
+ pdoc->DecorationFillRange(0, 0, pdoc->Length());
+ }
+ deco = decoNext;
+ }
+ pdoc->StartStyling(0, '\377');
+ pdoc->SetStyleFor(pdoc->Length(), 0);
+ cs.ShowAll();
+ pdoc->ClearLevels();
+}
+
+void Editor::CopyAllowLine() {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText, true);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::Cut() {
+ pdoc->CheckReadOnly();
+ if (!pdoc->IsReadOnly() && !SelectionContainsProtected()) {
+ Copy();
+ ClearSelection();
+ }
+}
+
+void Editor::PasteRectangular(SelectionPosition pos, const char *ptr, int len) {
+ if (pdoc->IsReadOnly() || SelectionContainsProtected()) {
+ return;
+ }
+ sel.Clear();
+ sel.RangeMain() = SelectionRange(pos);
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ UndoGroup ug(pdoc);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ int xInsert = XFromPosition(sel.RangeMain().caret);
+ bool prevCr = false;
+ while ((len > 0) && IsEOLChar(ptr[len-1]))
+ len--;
+ for (int i = 0; i < len; i++) {
+ if (IsEOLChar(ptr[i])) {
+ if ((ptr[i] == '\r') || (!prevCr))
+ line++;
+ if (line >= pdoc->LinesTotal()) {
+ if (pdoc->eolMode != SC_EOL_LF)
+ pdoc->InsertChar(pdoc->Length(), '\r');
+ if (pdoc->eolMode != SC_EOL_CR)
+ pdoc->InsertChar(pdoc->Length(), '\n');
+ }
+ // Pad the end of lines with spaces if required
+ sel.RangeMain().caret.SetPosition(PositionFromLineX(line, xInsert));
+ if ((XFromPosition(sel.MainCaret()) < xInsert) && (i + 1 < len)) {
+ while (XFromPosition(sel.MainCaret()) < xInsert) {
+ pdoc->InsertChar(sel.MainCaret(), ' ');
+ sel.RangeMain().caret.Add(1);
+ }
+ }
+ prevCr = ptr[i] == '\r';
+ } else {
+ pdoc->InsertString(sel.MainCaret(), ptr + i, 1);
+ sel.RangeMain().caret.Add(1);
+ prevCr = false;
+ }
+ }
+ SetEmptySelection(pos);
+}
+
+bool Editor::CanPaste() {
+ return !pdoc->IsReadOnly() && !SelectionContainsProtected();
+}
+
+void Editor::Clear() {
+ // If multiple selections, don't delete EOLS
+ if (sel.Empty()) {
+ bool singleVirtual = false;
+ if ((sel.Count() == 1) &&
+ !RangeContainsProtected(sel.MainCaret(), sel.MainCaret() + 1) &&
+ sel.RangeMain().Start().VirtualSpace()) {
+ singleVirtual = true;
+ }
+ UndoGroup ug(pdoc, (sel.Count() > 1) || singleVirtual);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).caret.Position(), sel.Range(r).caret.Position() + 1)) {
+ if (sel.Range(r).Start().VirtualSpace()) {
+ if (sel.Range(r).anchor < sel.Range(r).caret)
+ sel.Range(r) = SelectionPosition(InsertSpace(sel.Range(r).anchor.Position(), sel.Range(r).anchor.VirtualSpace()));
+ else
+ sel.Range(r) = SelectionPosition(InsertSpace(sel.Range(r).caret.Position(), sel.Range(r).caret.VirtualSpace()));
+ }
+ if ((sel.Count() == 1) || !pdoc->IsPositionInLineEnd(sel.Range(r).caret.Position())) {
+ pdoc->DelChar(sel.Range(r).caret.Position());
+ sel.Range(r).ClearVirtualSpace();
+ } // else multiple selection so don't eat line ends
+ } else {
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ } else {
+ ClearSelection();
+ }
+ sel.RemoveDuplicates();
+}
+
+void Editor::SelectAll() {
+ sel.Clear();
+ SetSelection(0, pdoc->Length());
+ Redraw();
+}
+
+void Editor::Undo() {
+ if (pdoc->CanUndo()) {
+ InvalidateCaret();
+ int newPos = pdoc->Undo();
+ if (newPos >= 0)
+ SetEmptySelection(newPos);
+ EnsureCaretVisible();
+ }
+}
+
+void Editor::Redo() {
+ if (pdoc->CanRedo()) {
+ int newPos = pdoc->Redo();
+ if (newPos >= 0)
+ SetEmptySelection(newPos);
+ EnsureCaretVisible();
+ }
+}
+
+void Editor::DelChar() {
+ if (!RangeContainsProtected(sel.MainCaret(), sel.MainCaret() + 1)) {
+ pdoc->DelChar(sel.MainCaret());
+ }
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+}
+
+void Editor::DelCharBack(bool allowLineStartDeletion) {
+ if (!sel.IsRectangular())
+ FilterSelections();
+ if (sel.IsRectangular())
+ allowLineStartDeletion = false;
+ UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty());
+ if (sel.Empty()) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).caret.Position() - 1, sel.Range(r).caret.Position())) {
+ if (sel.Range(r).caret.VirtualSpace()) {
+ sel.Range(r).caret.SetVirtualSpace(sel.Range(r).caret.VirtualSpace() - 1);
+ sel.Range(r).anchor.SetVirtualSpace(sel.Range(r).caret.VirtualSpace());
+ } else {
+ int lineCurrentPos = pdoc->LineFromPosition(sel.Range(r).caret.Position());
+ if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.Range(r).caret.Position())) {
+ if (pdoc->GetColumn(sel.Range(r).caret.Position()) <= pdoc->GetLineIndentation(lineCurrentPos) &&
+ pdoc->GetColumn(sel.Range(r).caret.Position()) > 0 && pdoc->backspaceUnindents) {
+ UndoGroup ugInner(pdoc, !ug.Needed());
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ if (indentation % indentationStep == 0) {
+ pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
+ } else {
+ pdoc->SetLineIndentation(lineCurrentPos, indentation - (indentation % indentationStep));
+ }
+ // SetEmptySelection
+ sel.Range(r) = SelectionRange(pdoc->GetLineIndentPosition(lineCurrentPos),
+ pdoc->GetLineIndentPosition(lineCurrentPos));
+ } else {
+ pdoc->DelCharBack(sel.Range(r).caret.Position());
+ }
+ }
+ }
+ } else {
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ ThinRectangularRange();
+ } else {
+ ClearSelection();
+ }
+ sel.RemoveDuplicates();
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+}
+
+void Editor::NotifyFocus(bool) {}
+
+void Editor::SetCtrlID(int identifier) {
+ ctrlID = identifier;
+}
+
+void Editor::NotifyStyleToNeeded(int endStyleNeeded) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_STYLENEEDED;
+ scn.position = endStyleNeeded;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyStyleNeeded(Document *, void *, int endStyleNeeded) {
+ NotifyStyleToNeeded(endStyleNeeded);
+}
+
+void Editor::NotifyLexerChanged(Document *, void *) {
+}
+
+void Editor::NotifyErrorOccurred(Document *, void *, int status) {
+ errorStatus = status;
+}
+
+void Editor::NotifyChar(int ch) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_CHARADDED;
+ scn.ch = ch;
+ NotifyParent(scn);
+}
+
+void Editor::NotifySavePoint(bool isSavePoint) {
+ SCNotification scn = {0};
+ if (isSavePoint) {
+ scn.nmhdr.code = SCN_SAVEPOINTREACHED;
+ } else {
+ scn.nmhdr.code = SCN_SAVEPOINTLEFT;
+ }
+ NotifyParent(scn);
+}
+
+void Editor::NotifyModifyAttempt() {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_MODIFYATTEMPTRO;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_DOUBLECLICK;
+ scn.line = LineFromLocation(pt);
+ scn.position = PositionFromLocation(pt, true);
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
+ scn.position = position;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_HOTSPOTCLICK;
+ scn.position = position;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+}
+
+void Editor::NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_HOTSPOTRELEASECLICK;
+ scn.position = position;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+}
+
+bool Editor::NotifyUpdateUI() {
+ if (needUpdateUI) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_UPDATEUI;
+ scn.updated = needUpdateUI;
+ NotifyParent(scn);
+ needUpdateUI = 0;
+ return true;
+ }
+ return false;
+}
+
+void Editor::NotifyPainted() {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_PAINTED;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt) {
+ int mask = pdoc->decorations.AllOnFor(position);
+ if ((click && mask) || pdoc->decorations.clickNotified) {
+ SCNotification scn = {0};
+ pdoc->decorations.clickNotified = click;
+ scn.nmhdr.code = click ? SCN_INDICATORCLICK : SCN_INDICATORRELEASE;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0);
+ scn.position = position;
+ NotifyParent(scn);
+ }
+}
+
+bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) {
+ int marginClicked = -1;
+ int x = vs.textStart - vs.fixedColumnWidth;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width))
+ marginClicked = margin;
+ x += vs.ms[margin].width;
+ }
+ if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) {
+ int position = pdoc->LineStart(LineFromLocation(pt));
+ if ((vs.ms[marginClicked].mask & SC_MASK_FOLDERS) && (foldAutomatic & SC_AUTOMATICFOLD_CLICK)) {
+ int lineClick = pdoc->LineFromPosition(position);
+ if (shift && ctrl) {
+ FoldAll(SC_FOLDACTION_TOGGLE);
+ } else {
+ int levelClick = pdoc->GetLevel(lineClick);
+ if (levelClick & SC_FOLDLEVELHEADERFLAG) {
+ if (shift) {
+ // Ensure all children visible
+ FoldExpand(lineClick, SC_FOLDACTION_EXPAND, levelClick);
+ } else if (ctrl) {
+ FoldExpand(lineClick, SC_FOLDACTION_TOGGLE, levelClick);
+ } else {
+ // Toggle this line
+ FoldLine(lineClick, SC_FOLDACTION_TOGGLE);
+ }
+ }
+ }
+ return true;
+ }
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_MARGINCLICK;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ scn.position = position;
+ scn.margin = marginClicked;
+ NotifyParent(scn);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void Editor::NotifyNeedShown(int pos, int len) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_NEEDSHOWN;
+ scn.position = pos;
+ scn.length = len;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyDwelling(Point pt, bool state) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND;
+ scn.position = PositionFromLocation(pt, true);
+ scn.x = pt.x + vs.ExternalMarginWidth();
+ scn.y = pt.y;
+ NotifyParent(scn);
+}
+
+void Editor::NotifyZoom() {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_ZOOM;
+ NotifyParent(scn);
+}
+
+// Notifications from document
+void Editor::NotifyModifyAttempt(Document *, void *) {
+ //Platform::DebugPrintf("** Modify Attempt\n");
+ NotifyModifyAttempt();
+}
+
+void Editor::NotifySavePoint(Document *, void *, bool atSavePoint) {
+ //Platform::DebugPrintf("** Save Point %s\n", atSavePoint ? "On" : "Off");
+ NotifySavePoint(atSavePoint);
+}
+
+void Editor::CheckModificationForWrap(DocModification mh) {
+ if (mh.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) {
+ llc.Invalidate(LineLayout::llCheckTextAndStyle);
+ int lineDoc = pdoc->LineFromPosition(mh.position);
+ int lines = Platform::Maximum(0, mh.linesAdded);
+ if (Wrapping()) {
+ NeedWrapping(lineDoc, lineDoc + lines + 1);
+ }
+ RefreshStyleData();
+ // Fix up annotation heights
+ SetAnnotationHeights(lineDoc, lineDoc + lines + 2);
+ }
+}
+
+// Move a position so it is still after the same character as before the insertion.
+static inline int MovePositionForInsertion(int position, int startInsertion, int length) {
+ if (position > startInsertion) {
+ return position + length;
+ }
+ return position;
+}
+
+// Move a position so it is still after the same character as before the deletion if that
+// character is still present else after the previous surviving character.
+static inline int MovePositionForDeletion(int position, int startDeletion, int length) {
+ if (position > startDeletion) {
+ int endDeletion = startDeletion + length;
+ if (position > endDeletion) {
+ return position - length;
+ } else {
+ return startDeletion;
+ }
+ } else {
+ return position;
+ }
+}
+
+void Editor::NotifyModified(Document *, DocModification mh, void *) {
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(Range(mh.position, mh.position + mh.length));
+ }
+ if (mh.modificationType & SC_MOD_CHANGELINESTATE) {
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(
+ Range(pdoc->LineStart(mh.line), pdoc->LineStart(mh.line + 1)));
+ } else {
+ // Could check that change is before last visible line.
+ Redraw();
+ }
+ }
+ if (mh.modificationType & SC_MOD_LEXERSTATE) {
+ if (paintState == painting) {
+ CheckForChangeOutsidePaint(
+ Range(mh.position, mh.position + mh.length));
+ } else {
+ Redraw();
+ }
+ }
+ if (mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) {
+ if (mh.modificationType & SC_MOD_CHANGESTYLE) {
+ pdoc->IncrementStyleClock();
+ }
+ if (paintState == notPainting) {
+ if (mh.position < pdoc->LineStart(topLine)) {
+ // Styling performed before this view
+ Redraw();
+ } else {
+ InvalidateRange(mh.position, mh.position + mh.length);
+ }
+ }
+ if (mh.modificationType & SC_MOD_CHANGESTYLE) {
+ llc.Invalidate(LineLayout::llCheckTextAndStyle);
+ }
+ } else {
+ // Move selection and brace highlights
+ if (mh.modificationType & SC_MOD_INSERTTEXT) {
+ sel.MovePositions(true, mh.position, mh.length);
+ braces[0] = MovePositionForInsertion(braces[0], mh.position, mh.length);
+ braces[1] = MovePositionForInsertion(braces[1], mh.position, mh.length);
+ } else if (mh.modificationType & SC_MOD_DELETETEXT) {
+ sel.MovePositions(false, mh.position, mh.length);
+ braces[0] = MovePositionForDeletion(braces[0], mh.position, mh.length);
+ braces[1] = MovePositionForDeletion(braces[1], mh.position, mh.length);
+ }
+ if ((mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) && cs.HiddenLines()) {
+ // Some lines are hidden so may need shown.
+ // TODO: check if the modified area is hidden.
+ if (mh.modificationType & SC_MOD_BEFOREINSERT) {
+ int lineOfPos = pdoc->LineFromPosition(mh.position);
+ bool insertingNewLine = false;
+ for (int i=0; i < mh.length; i++) {
+ if ((mh.text[i] == '\n') || (mh.text[i] == '\r'))
+ insertingNewLine = true;
+ }
+ if (insertingNewLine && (mh.position != pdoc->LineStart(lineOfPos)))
+ NeedShown(mh.position, pdoc->LineStart(lineOfPos+1) - mh.position);
+ else
+ NeedShown(mh.position, 0);
+ } else if (mh.modificationType & SC_MOD_BEFOREDELETE) {
+ NeedShown(mh.position, mh.length);
+ }
+ }
+ if (mh.linesAdded != 0) {
+ // Update contraction state for inserted and removed lines
+ // lineOfPos should be calculated in context of state before modification, shouldn't it
+ int lineOfPos = pdoc->LineFromPosition(mh.position);
+ if (mh.position > pdoc->LineStart(lineOfPos))
+ lineOfPos++; // Affecting subsequent lines
+ if (mh.linesAdded > 0) {
+ cs.InsertLines(lineOfPos, mh.linesAdded);
+ } else {
+ cs.DeleteLines(lineOfPos, -mh.linesAdded);
+ }
+ }
+ if (mh.modificationType & SC_MOD_CHANGEANNOTATION) {
+ int lineDoc = pdoc->LineFromPosition(mh.position);
+ if (vs.annotationVisible) {
+ cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded);
+ Redraw();
+ }
+ }
+ CheckModificationForWrap(mh);
+ if (mh.linesAdded != 0) {
+ // Avoid scrolling of display if change before current display
+ if (mh.position < posTopLine && !CanDeferToLastStep(mh)) {
+ int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos());
+ if (newTop != topLine) {
+ SetTopLine(newTop);
+ SetVerticalScrollPos();
+ }
+ }
+
+ if (paintState == notPainting && !CanDeferToLastStep(mh)) {
+ QueueIdleWork(WorkNeeded::workStyle, pdoc->Length());
+ Redraw();
+ }
+ } else {
+ if (paintState == notPainting && mh.length && !CanEliminate(mh)) {
+ QueueIdleWork(WorkNeeded::workStyle, mh.position + mh.length);
+ InvalidateRange(mh.position, mh.position + mh.length);
+ }
+ }
+ }
+
+ if (mh.linesAdded != 0 && !CanDeferToLastStep(mh)) {
+ SetScrollBars();
+ }
+
+ if ((mh.modificationType & SC_MOD_CHANGEMARKER) || (mh.modificationType & SC_MOD_CHANGEMARGIN)) {
+ if ((!willRedrawAll) && ((paintState == notPainting) || !PaintContainsMargin())) {
+ if (mh.modificationType & SC_MOD_CHANGEFOLD) {
+ // Fold changes can affect the drawing of following lines so redraw whole margin
+ RedrawSelMargin(highlightDelimiter.isEnabled ? -1 : mh.line-1, true);
+ } else {
+ RedrawSelMargin(mh.line);
+ }
+ }
+ }
+ if ((mh.modificationType & SC_MOD_CHANGEFOLD) && (foldAutomatic & SC_AUTOMATICFOLD_CHANGE)) {
+ FoldChanged(mh.line, mh.foldLevelNow, mh.foldLevelPrev);
+ }
+
+ // NOW pay the piper WRT "deferred" visual updates
+ if (IsLastStep(mh)) {
+ SetScrollBars();
+ Redraw();
+ }
+
+ // If client wants to see this modification
+ if (mh.modificationType & modEventMask) {
+ if ((mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) == 0) {
+ // Real modification made to text of document.
+ NotifyChange(); // Send EN_CHANGE
+ }
+
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_MODIFIED;
+ scn.position = mh.position;
+ scn.modificationType = mh.modificationType;
+ scn.text = mh.text;
+ scn.length = mh.length;
+ scn.linesAdded = mh.linesAdded;
+ scn.line = mh.line;
+ scn.foldLevelNow = mh.foldLevelNow;
+ scn.foldLevelPrev = mh.foldLevelPrev;
+ scn.token = mh.token;
+ scn.annotationLinesAdded = mh.annotationLinesAdded;
+ NotifyParent(scn);
+ }
+}
+
+void Editor::NotifyDeleted(Document *, void *) {
+ /* Do nothing */
+}
+
+void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+
+ // Enumerates all macroable messages
+ switch (iMessage) {
+ case SCI_CUT:
+ case SCI_COPY:
+ case SCI_PASTE:
+ case SCI_CLEAR:
+ case SCI_REPLACESEL:
+ case SCI_ADDTEXT:
+ case SCI_INSERTTEXT:
+ case SCI_APPENDTEXT:
+ case SCI_CLEARALL:
+ case SCI_SELECTALL:
+ case SCI_GOTOLINE:
+ case SCI_GOTOPOS:
+ case SCI_SEARCHANCHOR:
+ case SCI_SEARCHNEXT:
+ case SCI_SEARCHPREV:
+ case SCI_LINEDOWN:
+ case SCI_LINEDOWNEXTEND:
+ case SCI_PARADOWN:
+ case SCI_PARADOWNEXTEND:
+ case SCI_LINEUP:
+ case SCI_LINEUPEXTEND:
+ case SCI_PARAUP:
+ case SCI_PARAUPEXTEND:
+ case SCI_CHARLEFT:
+ case SCI_CHARLEFTEXTEND:
+ case SCI_CHARRIGHT:
+ case SCI_CHARRIGHTEXTEND:
+ case SCI_WORDLEFT:
+ case SCI_WORDLEFTEXTEND:
+ case SCI_WORDRIGHT:
+ case SCI_WORDRIGHTEXTEND:
+ case SCI_WORDPARTLEFT:
+ case SCI_WORDPARTLEFTEXTEND:
+ case SCI_WORDPARTRIGHT:
+ case SCI_WORDPARTRIGHTEXTEND:
+ case SCI_WORDLEFTEND:
+ case SCI_WORDLEFTENDEXTEND:
+ case SCI_WORDRIGHTEND:
+ case SCI_WORDRIGHTENDEXTEND:
+ case SCI_HOME:
+ case SCI_HOMEEXTEND:
+ case SCI_LINEEND:
+ case SCI_LINEENDEXTEND:
+ case SCI_HOMEWRAP:
+ case SCI_HOMEWRAPEXTEND:
+ case SCI_LINEENDWRAP:
+ case SCI_LINEENDWRAPEXTEND:
+ case SCI_DOCUMENTSTART:
+ case SCI_DOCUMENTSTARTEXTEND:
+ case SCI_DOCUMENTEND:
+ case SCI_DOCUMENTENDEXTEND:
+ case SCI_STUTTEREDPAGEUP:
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ case SCI_STUTTEREDPAGEDOWN:
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+ case SCI_PAGEUP:
+ case SCI_PAGEUPEXTEND:
+ case SCI_PAGEDOWN:
+ case SCI_PAGEDOWNEXTEND:
+ case SCI_EDITTOGGLEOVERTYPE:
+ case SCI_CANCEL:
+ case SCI_DELETEBACK:
+ case SCI_TAB:
+ case SCI_BACKTAB:
+ case SCI_FORMFEED:
+ case SCI_VCHOME:
+ case SCI_VCHOMEEXTEND:
+ case SCI_VCHOMEWRAP:
+ case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
+ case SCI_DELWORDLEFT:
+ case SCI_DELWORDRIGHT:
+ case SCI_DELWORDRIGHTEND:
+ case SCI_DELLINELEFT:
+ case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
+ case SCI_LINECUT:
+ case SCI_LINEDELETE:
+ case SCI_LINETRANSPOSE:
+ case SCI_LINEDUPLICATE:
+ case SCI_LOWERCASE:
+ case SCI_UPPERCASE:
+ case SCI_LINESCROLLDOWN:
+ case SCI_LINESCROLLUP:
+ case SCI_DELETEBACKNOTLINE:
+ case SCI_HOMEDISPLAY:
+ case SCI_HOMEDISPLAYEXTEND:
+ case SCI_LINEENDDISPLAY:
+ case SCI_LINEENDDISPLAYEXTEND:
+ case SCI_SETSELECTIONMODE:
+ case SCI_LINEDOWNRECTEXTEND:
+ case SCI_LINEUPRECTEXTEND:
+ case SCI_CHARLEFTRECTEXTEND:
+ case SCI_CHARRIGHTRECTEXTEND:
+ case SCI_HOMERECTEXTEND:
+ case SCI_VCHOMERECTEXTEND:
+ case SCI_LINEENDRECTEXTEND:
+ case SCI_PAGEUPRECTEXTEND:
+ case SCI_PAGEDOWNRECTEXTEND:
+ case SCI_SELECTIONDUPLICATE:
+ case SCI_COPYALLOWLINE:
+ case SCI_VERTICALCENTRECARET:
+ case SCI_MOVESELECTEDLINESUP:
+ case SCI_MOVESELECTEDLINESDOWN:
+ case SCI_SCROLLTOSTART:
+ case SCI_SCROLLTOEND:
+ break;
+
+ // Filter out all others like display changes. Also, newlines are redundant
+ // with char insert messages.
+ case SCI_NEWLINE:
+ default:
+ // printf("Filtered out %ld of macro recording\n", iMessage);
+ return ;
+ }
+
+ // Send notification
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_MACRORECORD;
+ scn.message = iMessage;
+ scn.wParam = wParam;
+ scn.lParam = lParam;
+ NotifyParent(scn);
+}
+
+// Something has changed that the container should know about
+void Editor::ContainerNeedsUpdate(int flags) {
+ needUpdateUI |= flags;
+}
+
+/**
+ * Force scroll and keep position relative to top of window.
+ *
+ * If stuttered = true and not already at first/last row, move to first/last row of window.
+ * If stuttered = true and already at first/last row, scroll as normal.
+ */
+void Editor::PageMove(int direction, Selection::selTypes selt, bool stuttered) {
+ int topLineNew;
+ SelectionPosition newPos;
+
+ int currentLine = pdoc->LineFromPosition(sel.MainCaret());
+ int topStutterLine = topLine + caretYSlop;
+ int bottomStutterLine =
+ pdoc->LineFromPosition(PositionFromLocation(
+ Point(lastXChosen - xOffset, direction * vs.lineHeight * LinesToScroll())))
+ - caretYSlop - 1;
+
+ if (stuttered && (direction < 0 && currentLine > topStutterLine)) {
+ topLineNew = topLine;
+ newPos = SPositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * caretYSlop),
+ false, false, UserVirtualSpace());
+
+ } else if (stuttered && (direction > 0 && currentLine < bottomStutterLine)) {
+ topLineNew = topLine;
+ newPos = SPositionFromLocation(Point(lastXChosen - xOffset, vs.lineHeight * (LinesToScroll() - caretYSlop)),
+ false, false, UserVirtualSpace());
+
+ } else {
+ Point pt = LocationFromPosition(sel.MainCaret());
+
+ topLineNew = Platform::Clamp(
+ topLine + direction * LinesToScroll(), 0, MaxScrollPos());
+ newPos = SPositionFromLocation(
+ Point(lastXChosen - xOffset, pt.y + direction * (vs.lineHeight * LinesToScroll())),
+ false, false, UserVirtualSpace());
+ }
+
+ if (topLineNew != topLine) {
+ SetTopLine(topLineNew);
+ MovePositionTo(newPos, selt);
+ Redraw();
+ SetVerticalScrollPos();
+ } else {
+ MovePositionTo(newPos, selt);
+ }
+}
+
+void Editor::ChangeCaseOfSelection(int caseMapping) {
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionRange current = sel.Range(r);
+ SelectionRange currentNoVS = current;
+ currentNoVS.ClearVirtualSpace();
+ size_t rangeBytes = currentNoVS.Length();
+ if (rangeBytes > 0) {
+ std::string sText = RangeText(currentNoVS.Start().Position(), currentNoVS.End().Position());
+
+ std::string sMapped = CaseMapString(sText, caseMapping);
+
+ if (sMapped != sText) {
+ size_t firstDifference = 0;
+ while (sMapped[firstDifference] == sText[firstDifference])
+ firstDifference++;
+ size_t lastDifferenceText = sText.size() - 1;
+ size_t lastDifferenceMapped = sMapped.size() - 1;
+ while (sMapped[lastDifferenceMapped] == sText[lastDifferenceText]) {
+ lastDifferenceText--;
+ lastDifferenceMapped--;
+ }
+ size_t endDifferenceText = sText.size() - 1 - lastDifferenceText;
+ pdoc->DeleteChars(
+ static_cast<int>(currentNoVS.Start().Position() + firstDifference),
+ static_cast<int>(rangeBytes - firstDifference - endDifferenceText));
+ pdoc->InsertString(
+ static_cast<int>(currentNoVS.Start().Position() + firstDifference),
+ sMapped.c_str() + firstDifference,
+ static_cast<int>(lastDifferenceMapped - firstDifference + 1));
+ // Automatic movement changes selection so reset to exactly the same as it was.
+ int diffSizes = static_cast<int>(sMapped.size() - sText.size());
+ if (diffSizes != 0) {
+ if (current.anchor > current.caret)
+ current.anchor.Add(diffSizes);
+ else
+ current.caret.Add(diffSizes);
+ }
+ sel.Range(r) = current;
+ }
+ }
+ }
+}
+
+void Editor::LineTranspose() {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ if (line > 0) {
+ UndoGroup ug(pdoc);
+ int startPrev = pdoc->LineStart(line - 1);
+ int endPrev = pdoc->LineEnd(line - 1);
+ int start = pdoc->LineStart(line);
+ int end = pdoc->LineEnd(line);
+ std::string line1 = RangeText(startPrev, endPrev);
+ int len1 = endPrev - startPrev;
+ std::string line2 = RangeText(start, end);
+ int len2 = end - start;
+ pdoc->DeleteChars(start, len2);
+ pdoc->DeleteChars(startPrev, len1);
+ pdoc->InsertString(startPrev, line2.c_str(), len2);
+ pdoc->InsertString(start - len1 + len2, line1.c_str(), len1);
+ MovePositionTo(SelectionPosition(start - len1 + len2));
+ }
+}
+
+void Editor::Duplicate(bool forLine) {
+ if (sel.Empty()) {
+ forLine = true;
+ }
+ UndoGroup ug(pdoc);
+ const char *eol = "";
+ int eolLen = 0;
+ if (forLine) {
+ eol = StringFromEOLMode(pdoc->eolMode);
+ eolLen = istrlen(eol);
+ }
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionPosition start = sel.Range(r).Start();
+ SelectionPosition end = sel.Range(r).End();
+ if (forLine) {
+ int line = pdoc->LineFromPosition(sel.Range(r).caret.Position());
+ start = SelectionPosition(pdoc->LineStart(line));
+ end = SelectionPosition(pdoc->LineEnd(line));
+ }
+ std::string text = RangeText(start.Position(), end.Position());
+ if (forLine)
+ pdoc->InsertString(end.Position(), eol, eolLen);
+ pdoc->InsertString(end.Position() + eolLen, text.c_str(), SelectionRange(end, start).Length());
+ }
+ if (sel.Count() && sel.IsRectangular()) {
+ SelectionPosition last = sel.Last();
+ if (forLine) {
+ int line = pdoc->LineFromPosition(last.Position());
+ last = SelectionPosition(last.Position() + pdoc->LineStart(line+1) - pdoc->LineStart(line));
+ }
+ if (sel.Rectangular().anchor > sel.Rectangular().caret)
+ sel.Rectangular().anchor = last;
+ else
+ sel.Rectangular().caret = last;
+ SetRectangularRange();
+ }
+}
+
+void Editor::CancelModes() {
+ sel.SetMoveExtends(false);
+}
+
+void Editor::NewLine() {
+ // Remove non-main ranges
+ InvalidateSelection(sel.RangeMain(), true);
+ sel.SetSelection(sel.RangeMain());
+
+ // Clear main range and insert line end
+ bool needGroupUndo = !sel.Empty();
+ if (needGroupUndo)
+ pdoc->BeginUndoAction();
+
+ if (!sel.Empty())
+ ClearSelection();
+ const char *eol = "\n";
+ if (pdoc->eolMode == SC_EOL_CRLF) {
+ eol = "\r\n";
+ } else if (pdoc->eolMode == SC_EOL_CR) {
+ eol = "\r";
+ } // else SC_EOL_LF -> "\n" already set
+ bool inserted = pdoc->InsertCString(sel.MainCaret(), eol);
+ // Want to end undo group before NotifyChar as applications often modify text here
+ if (needGroupUndo)
+ pdoc->EndUndoAction();
+ if (inserted) {
+ SetEmptySelection(sel.MainCaret() + istrlen(eol));
+ while (*eol) {
+ NotifyChar(*eol);
+ if (recordingMacro) {
+ char txt[2];
+ txt[0] = *eol;
+ txt[1] = '\0';
+ NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(txt));
+ }
+ eol++;
+ }
+ }
+ SetLastXChosen();
+ SetScrollBars();
+ EnsureCaretVisible();
+ // Avoid blinking during rapid typing:
+ ShowCaretAtCurrentPosition();
+}
+
+void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) {
+ SelectionPosition caretToUse = sel.Range(sel.Main()).caret;
+ if (sel.IsRectangular()) {
+ if (selt == Selection::noSel) {
+ caretToUse = (direction > 0) ? sel.Limits().end : sel.Limits().start;
+ } else {
+ caretToUse = sel.Rectangular().caret;
+ }
+ }
+
+ Point pt = LocationFromPosition(caretToUse);
+ int skipLines = 0;
+
+ if (vs.annotationVisible) {
+ int lineDoc = pdoc->LineFromPosition(caretToUse.Position());
+ Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc));
+ int subLine = (pt.y - ptStartLine.y) / vs.lineHeight;
+
+ if (direction < 0 && subLine == 0) {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (lineDisplay > 0) {
+ skipLines = pdoc->AnnotationLines(cs.DocFromDisplay(lineDisplay - 1));
+ }
+ } else if (direction > 0 && subLine >= (cs.GetHeight(lineDoc) - 1 - pdoc->AnnotationLines(lineDoc))) {
+ skipLines = pdoc->AnnotationLines(lineDoc);
+ }
+ }
+
+ int newY = pt.y + (1 + skipLines) * direction * vs.lineHeight;
+ SelectionPosition posNew = SPositionFromLocation(
+ Point(lastXChosen - xOffset, newY), false, false, UserVirtualSpace());
+
+ if (direction < 0) {
+ // Line wrapping may lead to a location on the same line, so
+ // seek back if that is the case.
+ Point ptNew = LocationFromPosition(posNew.Position());
+ while ((posNew.Position() > 0) && (pt.y == ptNew.y)) {
+ posNew.Add(-1);
+ posNew.SetVirtualSpace(0);
+ ptNew = LocationFromPosition(posNew.Position());
+ }
+ } else if (direction > 0 && posNew.Position() != pdoc->Length()) {
+ // There is an equivalent case when moving down which skips
+ // over a line.
+ Point ptNew = LocationFromPosition(posNew.Position());
+ while ((posNew.Position() > caretToUse.Position()) && (ptNew.y > newY)) {
+ posNew.Add(-1);
+ posNew.SetVirtualSpace(0);
+ ptNew = LocationFromPosition(posNew.Position());
+ }
+ }
+
+ MovePositionTo(MovePositionSoVisible(posNew, direction), selt);
+}
+
+void Editor::ParaUpOrDown(int direction, Selection::selTypes selt) {
+ int lineDoc, savedPos = sel.MainCaret();
+ do {
+ MovePositionTo(SelectionPosition(direction > 0 ? pdoc->ParaDown(sel.MainCaret()) : pdoc->ParaUp(sel.MainCaret())), selt);
+ lineDoc = pdoc->LineFromPosition(sel.MainCaret());
+ if (direction > 0) {
+ if (sel.MainCaret() >= pdoc->Length() && !cs.GetVisible(lineDoc)) {
+ if (selt == Selection::noSel) {
+ MovePositionTo(SelectionPosition(pdoc->LineEndPosition(savedPos)));
+ }
+ break;
+ }
+ }
+ } while (!cs.GetVisible(lineDoc));
+}
+
+int Editor::StartEndDisplayLine(int pos, bool start) {
+ RefreshStyleData();
+ int line = pdoc->LineFromPosition(pos);
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+ int posRet = INVALID_POSITION;
+ if (surface && ll) {
+ unsigned int posLineStart = pdoc->LineStart(line);
+ LayoutLine(line, surface, vs, ll, wrapWidth);
+ int posInLine = pos - posLineStart;
+ if (posInLine <= ll->maxLineLength) {
+ for (int subLine = 0; subLine < ll->lines; subLine++) {
+ if ((posInLine >= ll->LineStart(subLine)) && (posInLine <= ll->LineStart(subLine + 1))) {
+ if (start) {
+ posRet = ll->LineStart(subLine) + posLineStart;
+ } else {
+ if (subLine == ll->lines - 1)
+ posRet = ll->LineStart(subLine + 1) + posLineStart;
+ else
+ posRet = ll->LineStart(subLine + 1) + posLineStart - 1;
+ }
+ }
+ }
+ }
+ }
+ if (posRet == INVALID_POSITION) {
+ return pos;
+ } else {
+ return posRet;
+ }
+}
+
+int Editor::KeyCommand(unsigned int iMessage) {
+ switch (iMessage) {
+ case SCI_LINEDOWN:
+ CursorUpOrDown(1);
+ break;
+ case SCI_LINEDOWNEXTEND:
+ CursorUpOrDown(1, Selection::selStream);
+ break;
+ case SCI_LINEDOWNRECTEXTEND:
+ CursorUpOrDown(1, Selection::selRectangle);
+ break;
+ case SCI_PARADOWN:
+ ParaUpOrDown(1);
+ break;
+ case SCI_PARADOWNEXTEND:
+ ParaUpOrDown(1, Selection::selStream);
+ break;
+ case SCI_LINESCROLLDOWN:
+ ScrollTo(topLine + 1);
+ MoveCaretInsideView(false);
+ break;
+ case SCI_LINEUP:
+ CursorUpOrDown(-1);
+ break;
+ case SCI_LINEUPEXTEND:
+ CursorUpOrDown(-1, Selection::selStream);
+ break;
+ case SCI_LINEUPRECTEXTEND:
+ CursorUpOrDown(-1, Selection::selRectangle);
+ break;
+ case SCI_PARAUP:
+ ParaUpOrDown(-1);
+ break;
+ case SCI_PARAUPEXTEND:
+ ParaUpOrDown(-1, Selection::selStream);
+ break;
+ case SCI_LINESCROLLUP:
+ ScrollTo(topLine - 1);
+ MoveCaretInsideView(false);
+ break;
+ case SCI_CHARLEFT:
+ if (SelectionEmpty() || sel.MoveExtends()) {
+ if ((sel.Count() == 1) && pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret);
+ } else if (sel.MoveExtends() && sel.selType == Selection::selStream) {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1));
+ } else {
+ MovePositionTo(MovePositionSoVisible(
+ SelectionPosition((sel.LimitsForRectangularElseMain().start).Position() - 1), -1));
+ }
+ } else {
+ MovePositionTo(sel.LimitsForRectangularElseMain().start);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARLEFTEXTEND:
+ if (pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret, Selection::selStream);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1), Selection::selStream);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARLEFTRECTEXTEND:
+ if (pdoc->IsLineEndPosition(sel.MainCaret()) && sel.RangeMain().caret.VirtualSpace()) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1);
+ MovePositionTo(spCaret, Selection::selRectangle);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() - 1), -1), Selection::selRectangle);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHT:
+ if (SelectionEmpty() || sel.MoveExtends()) {
+ if ((virtualSpaceOptions & SCVS_USERACCESSIBLE) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret);
+ } else if (sel.MoveExtends() && sel.selType == Selection::selStream) {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1));
+ } else {
+ MovePositionTo(MovePositionSoVisible(
+ SelectionPosition((sel.LimitsForRectangularElseMain().end).Position() + 1), 1));
+ }
+ } else {
+ MovePositionTo(sel.LimitsForRectangularElseMain().end);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHTEXTEND:
+ if ((virtualSpaceOptions & SCVS_USERACCESSIBLE) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret, Selection::selStream);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1), Selection::selStream);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_CHARRIGHTRECTEXTEND:
+ if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) && pdoc->IsLineEndPosition(sel.MainCaret())) {
+ SelectionPosition spCaret = sel.RangeMain().caret;
+ spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1);
+ MovePositionTo(spCaret, Selection::selRectangle);
+ } else {
+ MovePositionTo(MovePositionSoVisible(SelectionPosition(sel.MainCaret() + 1), 1), Selection::selRectangle);
+ }
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFT:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), -1), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), -1), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHT:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), 1), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(sel.MainCaret(), 1), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+
+ case SCI_WORDLEFTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), -1), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDLEFTENDEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), -1), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), 1), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDRIGHTENDEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(sel.MainCaret(), 1), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+
+ case SCI_HOME:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ SetLastXChosen();
+ break;
+ case SCI_HOMEEXTEND:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_HOMERECTEXTEND:
+ MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_LINEEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()));
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDEXTEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDRECTEXTEND:
+ MovePositionTo(pdoc->LineEndPosition(sel.MainCaret()), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_HOMEWRAP: {
+ SelectionPosition homePos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (sel.RangeMain().caret <= homePos)
+ homePos = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_HOMEWRAPEXTEND: {
+ SelectionPosition homePos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (sel.RangeMain().caret <= homePos)
+ homePos = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())));
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDWRAP: {
+ SelectionPosition endPos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), false), 1);
+ SelectionPosition realEndPos = SelectionPosition(pdoc->LineEndPosition(sel.MainCaret()));
+ if (endPos > realEndPos // if moved past visible EOLs
+ || sel.RangeMain().caret >= endPos) // if at end of display line already
+ endPos = realEndPos;
+ MovePositionTo(endPos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDWRAPEXTEND: {
+ SelectionPosition endPos = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), false), 1);
+ SelectionPosition realEndPos = SelectionPosition(pdoc->LineEndPosition(sel.MainCaret()));
+ if (endPos > realEndPos // if moved past visible EOLs
+ || sel.RangeMain().caret >= endPos) // if at end of display line already
+ endPos = realEndPos;
+ MovePositionTo(endPos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DOCUMENTSTART:
+ MovePositionTo(0);
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTSTARTEXTEND:
+ MovePositionTo(0, Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTEND:
+ MovePositionTo(pdoc->Length());
+ SetLastXChosen();
+ break;
+ case SCI_DOCUMENTENDEXTEND:
+ MovePositionTo(pdoc->Length(), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_STUTTEREDPAGEUP:
+ PageMove(-1, Selection::noSel, true);
+ break;
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ PageMove(-1, Selection::selStream, true);
+ break;
+ case SCI_STUTTEREDPAGEDOWN:
+ PageMove(1, Selection::noSel, true);
+ break;
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+ PageMove(1, Selection::selStream, true);
+ break;
+ case SCI_PAGEUP:
+ PageMove(-1);
+ break;
+ case SCI_PAGEUPEXTEND:
+ PageMove(-1, Selection::selStream);
+ break;
+ case SCI_PAGEUPRECTEXTEND:
+ PageMove(-1, Selection::selRectangle);
+ break;
+ case SCI_PAGEDOWN:
+ PageMove(1);
+ break;
+ case SCI_PAGEDOWNEXTEND:
+ PageMove(1, Selection::selStream);
+ break;
+ case SCI_PAGEDOWNRECTEXTEND:
+ PageMove(1, Selection::selRectangle);
+ break;
+ case SCI_EDITTOGGLEOVERTYPE:
+ inOverstrike = !inOverstrike;
+ DropCaret();
+ ShowCaretAtCurrentPosition();
+ ContainerNeedsUpdate(SC_UPDATE_CONTENT);
+ NotifyUpdateUI();
+ break;
+ case SCI_CANCEL: // Cancel any modes - handled in subclass
+ // Also unselect text
+ CancelModes();
+ break;
+ case SCI_DELETEBACK:
+ DelCharBack(true);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+ case SCI_DELETEBACKNOTLINE:
+ DelCharBack(false);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+ case SCI_TAB:
+ Indent(true);
+ if (caretSticky == SC_CARETSTICKY_OFF) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ ShowCaretAtCurrentPosition(); // Avoid blinking
+ break;
+ case SCI_BACKTAB:
+ Indent(false);
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ ShowCaretAtCurrentPosition(); // Avoid blinking
+ break;
+ case SCI_NEWLINE:
+ NewLine();
+ break;
+ case SCI_FORMFEED:
+ AddChar('\f');
+ break;
+ case SCI_VCHOME:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()));
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEEXTEND:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMERECTEXTEND:
+ MovePositionTo(pdoc->VCHomePosition(sel.MainCaret()), Selection::selRectangle);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEWRAP: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if ((viewLineStart < sel.RangeMain().caret) && (viewLineStart > homePos))
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_VCHOMEWRAPEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if ((viewLineStart < sel.RangeMain().caret) && (viewLineStart > homePos))
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_ZOOMIN:
+ if (vs.zoomLevel < 20) {
+ vs.zoomLevel++;
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ }
+ break;
+ case SCI_ZOOMOUT:
+ if (vs.zoomLevel > -10) {
+ vs.zoomLevel--;
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ }
+ break;
+ case SCI_DELWORDLEFT: {
+ int startWord = pdoc->NextWordStart(sel.MainCaret(), -1);
+ pdoc->DeleteChars(startWord, sel.MainCaret() - startWord);
+ sel.RangeMain().ClearVirtualSpace();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DELWORDRIGHT: {
+ UndoGroup ug(pdoc);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ sel.RangeMain().anchor = sel.RangeMain().caret;
+ int endWord = pdoc->NextWordStart(sel.MainCaret(), 1);
+ pdoc->DeleteChars(sel.MainCaret(), endWord - sel.MainCaret());
+ }
+ break;
+ case SCI_DELWORDRIGHTEND: {
+ UndoGroup ug(pdoc);
+ sel.RangeMain().caret = SelectionPosition(
+ InsertSpace(sel.RangeMain().caret.Position(), sel.RangeMain().caret.VirtualSpace()));
+ int endWord = pdoc->NextWordEnd(sel.MainCaret(), 1);
+ pdoc->DeleteChars(sel.MainCaret(), endWord - sel.MainCaret());
+ }
+ break;
+ case SCI_DELLINELEFT: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(line);
+ pdoc->DeleteChars(start, sel.MainCaret() - start);
+ sel.RangeMain().ClearVirtualSpace();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_DELLINERIGHT: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int end = pdoc->LineEnd(line);
+ pdoc->DeleteChars(sel.MainCaret(), end - sel.MainCaret());
+ }
+ break;
+ case SCI_LINECOPY: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart().Position());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position());
+ CopyRangeToClipboard(pdoc->LineStart(lineStart),
+ pdoc->LineStart(lineEnd + 1));
+ }
+ break;
+ case SCI_LINECUT: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart().Position());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position());
+ int start = pdoc->LineStart(lineStart);
+ int end = pdoc->LineStart(lineEnd + 1);
+ SetSelection(start, end);
+ Cut();
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEDELETE: {
+ int line = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(line);
+ int end = pdoc->LineStart(line + 1);
+ pdoc->DeleteChars(start, end - start);
+ }
+ break;
+ case SCI_LINETRANSPOSE:
+ LineTranspose();
+ break;
+ case SCI_LINEDUPLICATE:
+ Duplicate(true);
+ break;
+ case SCI_SELECTIONDUPLICATE:
+ Duplicate(false);
+ break;
+ case SCI_LOWERCASE:
+ ChangeCaseOfSelection(cmLower);
+ break;
+ case SCI_UPPERCASE:
+ ChangeCaseOfSelection(cmUpper);
+ break;
+ case SCI_WORDPARTLEFT:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(sel.MainCaret()), -1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTLEFTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(sel.MainCaret()), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTRIGHT:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(sel.MainCaret()), 1));
+ SetLastXChosen();
+ break;
+ case SCI_WORDPARTRIGHTEXTEND:
+ MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(sel.MainCaret()), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_HOMEDISPLAY:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), true), -1));
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEDISPLAY: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_HOMEDISPLAYEXTEND:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), true), -1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_VCHOMEDISPLAYEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
+ case SCI_LINEENDDISPLAY:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), false), 1));
+ SetLastXChosen();
+ break;
+ case SCI_LINEENDDISPLAYEXTEND:
+ MovePositionTo(MovePositionSoVisible(
+ StartEndDisplayLine(sel.MainCaret(), false), 1), Selection::selStream);
+ SetLastXChosen();
+ break;
+ case SCI_SCROLLTOSTART:
+ ScrollTo(0);
+ break;
+ case SCI_SCROLLTOEND:
+ ScrollTo(MaxScrollPos());
+ break;
+ }
+ return 0;
+}
+
+int Editor::KeyDefault(int, int) {
+ return 0;
+}
+
+int Editor::KeyDownWithModifiers(int key, int modifiers, bool *consumed) {
+ DwellEnd(false);
+ int msg = kmap.Find(key, modifiers);
+ if (msg) {
+ if (consumed)
+ *consumed = true;
+ return WndProc(msg, 0, 0);
+ } else {
+ if (consumed)
+ *consumed = false;
+ return KeyDefault(key, modifiers);
+ }
+}
+
+int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
+ int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ return KeyDownWithModifiers(key, modifiers, consumed);
+}
+
+void Editor::Indent(bool forwards) {
+ UndoGroup ug(pdoc);
+ for (size_t r=0; r<sel.Count(); r++) {
+ int lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position());
+ int caretPosition = sel.Range(r).caret.Position();
+ int lineCurrentPos = pdoc->LineFromPosition(caretPosition);
+ if (lineOfAnchor == lineCurrentPos) {
+ if (forwards) {
+ pdoc->DeleteChars(sel.Range(r).Start().Position(), sel.Range(r).Length());
+ caretPosition = sel.Range(r).caret.Position();
+ if (pdoc->GetColumn(caretPosition) <= pdoc->GetColumn(pdoc->GetLineIndentPosition(lineCurrentPos)) &&
+ pdoc->tabIndents) {
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ pdoc->SetLineIndentation(lineCurrentPos, indentation + indentationStep - indentation % indentationStep);
+ sel.Range(r) = SelectionRange(pdoc->GetLineIndentPosition(lineCurrentPos));
+ } else {
+ if (pdoc->useTabs) {
+ pdoc->InsertChar(caretPosition, '\t');
+ sel.Range(r) = SelectionRange(caretPosition+1);
+ } else {
+ int numSpaces = (pdoc->tabInChars) -
+ (pdoc->GetColumn(caretPosition) % (pdoc->tabInChars));
+ if (numSpaces < 1)
+ numSpaces = pdoc->tabInChars;
+ for (int i = 0; i < numSpaces; i++) {
+ pdoc->InsertChar(caretPosition + i, ' ');
+ }
+ sel.Range(r) = SelectionRange(caretPosition+numSpaces);
+ }
+ }
+ } else {
+ if (pdoc->GetColumn(caretPosition) <= pdoc->GetLineIndentation(lineCurrentPos) &&
+ pdoc->tabIndents) {
+ int indentation = pdoc->GetLineIndentation(lineCurrentPos);
+ int indentationStep = pdoc->IndentSize();
+ pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
+ sel.Range(r) = SelectionRange(pdoc->GetLineIndentPosition(lineCurrentPos));
+ } else {
+ int newColumn = ((pdoc->GetColumn(caretPosition) - 1) / pdoc->tabInChars) *
+ pdoc->tabInChars;
+ if (newColumn < 0)
+ newColumn = 0;
+ int newPos = caretPosition;
+ while (pdoc->GetColumn(newPos) > newColumn)
+ newPos--;
+ sel.Range(r) = SelectionRange(newPos);
+ }
+ }
+ } else { // Multiline
+ int anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor);
+ int currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos);
+ // Multiple lines selected so indent / dedent
+ int lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos);
+ int lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos);
+ if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition)
+ lineBottomSel--; // If not selecting any characters on a line, do not indent
+ pdoc->Indent(forwards, lineBottomSel, lineTopSel);
+ if (lineOfAnchor < lineCurrentPos) {
+ if (currentPosPosOnLine == 0)
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor));
+ else
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos + 1), pdoc->LineStart(lineOfAnchor));
+ } else {
+ if (anchorPosOnLine == 0)
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor));
+ else
+ sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor + 1));
+ }
+ }
+ }
+}
+
+class CaseFolderASCII : public CaseFolderTable {
+public:
+ CaseFolderASCII() {
+ StandardASCII();
+ }
+ ~CaseFolderASCII() {
+ }
+};
+
+
+CaseFolder *Editor::CaseFolderForEncoding() {
+ // Simple default that only maps ASCII upper case to lower case.
+ return new CaseFolderASCII();
+}
+
+/**
+ * Search of a text in the document, in the given range.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::FindText(
+ uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
+ ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX.
+ sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range.
+
+ Sci_TextToFind *ft = reinterpret_cast<Sci_TextToFind *>(lParam);
+ int lengthFound = istrlen(ft->lpstrText);
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ int pos = pdoc->FindText(ft->chrg.cpMin, ft->chrg.cpMax, ft->lpstrText,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ wParam,
+ &lengthFound);
+ if (pos != -1) {
+ ft->chrgText.cpMin = pos;
+ ft->chrgText.cpMax = pos + lengthFound;
+ }
+ return pos;
+}
+
+/**
+ * Relocatable search support : Searches relative to current selection
+ * point and sets the selection to the found text range with
+ * each search.
+ */
+/**
+ * Anchor following searches at current selection start: This allows
+ * multiple incremental interactive searches to be macro recorded
+ * while still setting the selection to found text so the find/select
+ * operation is self-contained.
+ */
+void Editor::SearchAnchor() {
+ searchAnchor = SelectionStart().Position();
+}
+
+/**
+ * Find text from current search anchor: Must call @c SearchAnchor first.
+ * Used for next text and previous text requests.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::SearchText(
+ unsigned int iMessage, ///< Accepts both @c SCI_SEARCHNEXT and @c SCI_SEARCHPREV.
+ uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
+ ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX.
+ sptr_t lParam) { ///< The text to search for.
+
+ const char *txt = reinterpret_cast<char *>(lParam);
+ int pos;
+ int lengthFound = istrlen(txt);
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ if (iMessage == SCI_SEARCHNEXT) {
+ pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ wParam,
+ &lengthFound);
+ } else {
+ pos = pdoc->FindText(searchAnchor, 0, txt,
+ (wParam & SCFIND_MATCHCASE) != 0,
+ (wParam & SCFIND_WHOLEWORD) != 0,
+ (wParam & SCFIND_WORDSTART) != 0,
+ (wParam & SCFIND_REGEXP) != 0,
+ wParam,
+ &lengthFound);
+ }
+ if (pos != -1) {
+ SetSelection(pos, pos + lengthFound);
+ }
+
+ return pos;
+}
+
+std::string Editor::CaseMapString(const std::string &s, int caseMapping) {
+ std::string ret(s);
+ for (size_t i=0; i<ret.size(); i++) {
+ switch (caseMapping) {
+ case cmUpper:
+ if (ret[i] >= 'a' && ret[i] <= 'z')
+ ret[i] = static_cast<char>(ret[i] - 'a' + 'A');
+ break;
+ case cmLower:
+ if (ret[i] >= 'A' && ret[i] <= 'Z')
+ ret[i] = static_cast<char>(ret[i] - 'A' + 'a');
+ break;
+ }
+ }
+ return ret;
+}
+
+/**
+ * Search for text in the target range of the document.
+ * @return The position of the found text, -1 if not found.
+ */
+long Editor::SearchInTarget(const char *text, int length) {
+ int lengthFound = length;
+
+ if (!pdoc->HasCaseFolder())
+ pdoc->SetCaseFolder(CaseFolderForEncoding());
+ int pos = pdoc->FindText(targetStart, targetEnd, text,
+ (searchFlags & SCFIND_MATCHCASE) != 0,
+ (searchFlags & SCFIND_WHOLEWORD) != 0,
+ (searchFlags & SCFIND_WORDSTART) != 0,
+ (searchFlags & SCFIND_REGEXP) != 0,
+ searchFlags,
+ &lengthFound);
+ if (pos != -1) {
+ targetStart = pos;
+ targetEnd = pos + lengthFound;
+ }
+ return pos;
+}
+
+void Editor::GoToLine(int lineNo) {
+ if (lineNo > pdoc->LinesTotal())
+ lineNo = pdoc->LinesTotal();
+ if (lineNo < 0)
+ lineNo = 0;
+ SetEmptySelection(pdoc->LineStart(lineNo));
+ ShowCaretAtCurrentPosition();
+ EnsureCaretVisible();
+}
+
+static bool Close(Point pt1, Point pt2) {
+ if (abs(pt1.x - pt2.x) > 3)
+ return false;
+ if (abs(pt1.y - pt2.y) > 3)
+ return false;
+ return true;
+}
+
+std::string Editor::RangeText(int start, int end) const {
+ if (start < end) {
+ int len = end - start;
+ std::string ret(len, '\0');
+ for (int i = 0; i < len; i++) {
+ ret[i] = pdoc->CharAt(start + i);
+ }
+ return ret;
+ }
+ return std::string();
+}
+
+void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
+ if (sel.Empty()) {
+ if (allowLineCopy) {
+ int currentLine = pdoc->LineFromPosition(sel.MainCaret());
+ int start = pdoc->LineStart(currentLine);
+ int end = pdoc->LineEnd(currentLine);
+
+ std::string text = RangeText(start, end);
+ if (pdoc->eolMode != SC_EOL_LF)
+ text.push_back('\r');
+ if (pdoc->eolMode != SC_EOL_CR)
+ text.push_back('\n');
+ ss->Copy(text, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, false, true);
+ }
+ } else {
+ std::string text;
+ std::vector<SelectionRange> rangesInOrder = sel.RangesCopy();
+ if (sel.selType == Selection::selRectangle)
+ std::sort(rangesInOrder.begin(), rangesInOrder.end());
+ for (size_t r=0; r<rangesInOrder.size(); r++) {
+ SelectionRange current = rangesInOrder[r];
+ text.append(RangeText(current.Start().Position(), current.End().Position()));
+ if (sel.selType == Selection::selRectangle) {
+ if (pdoc->eolMode != SC_EOL_LF)
+ text.push_back('\r');
+ if (pdoc->eolMode != SC_EOL_CR)
+ text.push_back('\n');
+ }
+ }
+ ss->Copy(text, pdoc->dbcsCodePage,
+ vs.styles[STYLE_DEFAULT].characterSet, sel.IsRectangular(), sel.selType == Selection::selLines);
+ }
+}
+
+void Editor::CopyRangeToClipboard(int start, int end) {
+ start = pdoc->ClampPositionIntoDocument(start);
+ end = pdoc->ClampPositionIntoDocument(end);
+ SelectionText selectedText;
+ std::string text = RangeText(start, end);
+ selectedText.Copy(text,
+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::CopyText(int length, const char *text) {
+ SelectionText selectedText;
+ selectedText.Copy(std::string(text, length),
+ pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
+ CopyToClipboard(selectedText);
+}
+
+void Editor::SetDragPosition(SelectionPosition newPos) {
+ if (newPos.Position() >= 0) {
+ newPos = MovePositionOutsideChar(newPos, 1);
+ posDrop = newPos;
+ }
+ if (!(posDrag == newPos)) {
+ caret.on = true;
+ SetTicking(true);
+ InvalidateCaret();
+ posDrag = newPos;
+ InvalidateCaret();
+ }
+}
+
+void Editor::DisplayCursor(Window::Cursor c) {
+ if (cursorMode == SC_CURSORNORMAL)
+ wMain.SetCursor(c);
+ else
+ wMain.SetCursor(static_cast<Window::Cursor>(cursorMode));
+}
+
+bool Editor::DragThreshold(Point ptStart, Point ptNow) {
+ int xMove = ptStart.x - ptNow.x;
+ int yMove = ptStart.y - ptNow.y;
+ int distanceSquared = xMove * xMove + yMove * yMove;
+ return distanceSquared > 16;
+}
+
+void Editor::StartDrag() {
+ // Always handled by subclasses
+ //SetMouseCapture(true);
+ //DisplayCursor(Window::cursorArrow);
+}
+
+void Editor::DropAt(SelectionPosition position, const char *value, size_t lengthValue, bool moving, bool rectangular) {
+ //Platform::DebugPrintf("DropAt %d %d\n", inDragDrop, position);
+ if (inDragDrop == ddDragging)
+ dropWentOutside = false;
+
+ bool positionWasInSelection = PositionInSelection(position.Position());
+
+ bool positionOnEdgeOfSelection =
+ (position == SelectionStart()) || (position == SelectionEnd());
+
+ if ((inDragDrop != ddDragging) || !(positionWasInSelection) ||
+ (positionOnEdgeOfSelection && !moving)) {
+
+ SelectionPosition selStart = SelectionStart();
+ SelectionPosition selEnd = SelectionEnd();
+
+ UndoGroup ug(pdoc);
+
+ SelectionPosition positionAfterDeletion = position;
+ if ((inDragDrop == ddDragging) && moving) {
+ // Remove dragged out text
+ if (rectangular || sel.selType == Selection::selLines) {
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (position >= sel.Range(r).Start()) {
+ if (position > sel.Range(r).End()) {
+ positionAfterDeletion.Add(-sel.Range(r).Length());
+ } else {
+ positionAfterDeletion.Add(-SelectionRange(position, sel.Range(r).Start()).Length());
+ }
+ }
+ }
+ } else {
+ if (position > selStart) {
+ positionAfterDeletion.Add(-SelectionRange(selEnd, selStart).Length());
+ }
+ }
+ ClearSelection();
+ }
+ position = positionAfterDeletion;
+
+ if (rectangular) {
+ PasteRectangular(position, value, static_cast<int>(lengthValue));
+ // Should try to select new rectangle but it may not be a rectangle now so just select the drop position
+ SetEmptySelection(position);
+ } else {
+ position = MovePositionOutsideChar(position, sel.MainCaret() - position.Position());
+ position = SelectionPosition(InsertSpace(position.Position(), position.VirtualSpace()));
+ if (pdoc->InsertString(position.Position(), value, static_cast<int>(lengthValue))) {
+ SelectionPosition posAfterInsertion = position;
+ posAfterInsertion.Add(static_cast<int>(lengthValue));
+ SetSelection(posAfterInsertion, position);
+ }
+ }
+ } else if (inDragDrop == ddDragging) {
+ SetEmptySelection(position);
+ }
+}
+
+void Editor::DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular) {
+ DropAt(position, value, strlen(value), moving, rectangular);
+}
+
+/**
+ * @return true if given position is inside the selection,
+ */
+bool Editor::PositionInSelection(int pos) {
+ pos = MovePositionOutsideChar(pos, sel.MainCaret() - pos);
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (sel.Range(r).Contains(pos))
+ return true;
+ }
+ return false;
+}
+
+bool Editor::PointInSelection(Point pt) {
+ SelectionPosition pos = SPositionFromLocation(pt, false, true);
+ Point ptPos = LocationFromPosition(pos);
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionRange range = sel.Range(r);
+ if (range.Contains(pos)) {
+ bool hit = true;
+ if (pos == range.Start()) {
+ // see if just before selection
+ if (pt.x < ptPos.x) {
+ hit = false;
+ }
+ }
+ if (pos == range.End()) {
+ // see if just after selection
+ if (pt.x > ptPos.x) {
+ hit = false;
+ }
+ }
+ if (hit)
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Editor::PointInSelMargin(Point pt) {
+ // Really means: "Point in a margin"
+ if (vs.fixedColumnWidth > 0) { // There is a margin
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = vs.textStart - vs.leftMarginWidth;
+ rcSelMargin.left = vs.textStart - vs.fixedColumnWidth;
+ return rcSelMargin.Contains(pt);
+ } else {
+ return false;
+ }
+}
+
+Window::Cursor Editor::GetMarginCursor(Point pt) const {
+ int x = 0;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width))
+ return static_cast<Window::Cursor>(vs.ms[margin].cursor);
+ x += vs.ms[margin].width;
+ }
+ return Window::cursorReverseArrow;
+}
+
+void Editor::TrimAndSetSelection(int currentPos_, int anchor_) {
+ sel.TrimSelection(SelectionRange(currentPos_, anchor_));
+ SetSelection(currentPos_, anchor_);
+}
+
+void Editor::LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine) {
+ int selCurrentPos, selAnchorPos;
+ if (wholeLine) {
+ int lineCurrent_ = pdoc->LineFromPosition(lineCurrentPos_);
+ int lineAnchor_ = pdoc->LineFromPosition(lineAnchorPos_);
+ if (lineAnchorPos_ < lineCurrentPos_) {
+ selCurrentPos = pdoc->LineStart(lineCurrent_ + 1);
+ selAnchorPos = pdoc->LineStart(lineAnchor_);
+ } else if (lineAnchorPos_ > lineCurrentPos_) {
+ selCurrentPos = pdoc->LineStart(lineCurrent_);
+ selAnchorPos = pdoc->LineStart(lineAnchor_ + 1);
+ } else { // Same line, select it
+ selCurrentPos = pdoc->LineStart(lineAnchor_ + 1);
+ selAnchorPos = pdoc->LineStart(lineAnchor_);
+ }
+ } else {
+ if (lineAnchorPos_ < lineCurrentPos_) {
+ selCurrentPos = StartEndDisplayLine(lineCurrentPos_, false) + 1;
+ selCurrentPos = pdoc->MovePositionOutsideChar(selCurrentPos, 1);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, true);
+ } else if (lineAnchorPos_ > lineCurrentPos_) {
+ selCurrentPos = StartEndDisplayLine(lineCurrentPos_, true);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, false) + 1;
+ selAnchorPos = pdoc->MovePositionOutsideChar(selAnchorPos, 1);
+ } else { // Same line, select it
+ selCurrentPos = StartEndDisplayLine(lineAnchorPos_, false) + 1;
+ selCurrentPos = pdoc->MovePositionOutsideChar(selCurrentPos, 1);
+ selAnchorPos = StartEndDisplayLine(lineAnchorPos_, true);
+ }
+ }
+ TrimAndSetSelection(selCurrentPos, selAnchorPos);
+}
+
+void Editor::WordSelection(int pos) {
+ if (pos < wordSelectAnchorStartPos) {
+ // Extend backward to the word containing pos.
+ // Skip ExtendWordSelect if the line is empty or if pos is after the last character.
+ // This ensures that a series of empty lines isn't counted as a single "word".
+ if (!pdoc->IsLineEndPosition(pos))
+ pos = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(pos + 1, 1), -1);
+ TrimAndSetSelection(pos, wordSelectAnchorEndPos);
+ } else if (pos > wordSelectAnchorEndPos) {
+ // Extend forward to the word containing the character to the left of pos.
+ // Skip ExtendWordSelect if the line is empty or if pos is the first position on the line.
+ // This ensures that a series of empty lines isn't counted as a single "word".
+ if (pos > pdoc->LineStart(pdoc->LineFromPosition(pos)))
+ pos = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(pos - 1, -1), 1);
+ TrimAndSetSelection(pos, wordSelectAnchorStartPos);
+ } else {
+ // Select only the anchored word
+ if (pos >= originalAnchorPos)
+ TrimAndSetSelection(wordSelectAnchorEndPos, wordSelectAnchorStartPos);
+ else
+ TrimAndSetSelection(wordSelectAnchorStartPos, wordSelectAnchorEndPos);
+ }
+}
+
+void Editor::DwellEnd(bool mouseMoved) {
+ if (mouseMoved)
+ ticksToDwell = dwellDelay;
+ else
+ ticksToDwell = SC_TIME_FOREVER;
+ if (dwelling && (dwellDelay < SC_TIME_FOREVER)) {
+ dwelling = false;
+ NotifyDwelling(ptMouseLast, dwelling);
+ }
+}
+
+void Editor::MouseLeave() {
+ SetHotSpotRange(NULL);
+ if (!HaveMouseCapture()) {
+ ptMouseLast = Point(-1,-1);
+ DwellEnd(true);
+ }
+}
+
+static bool AllowVirtualSpace(int virtualSpaceOptions, bool rectangular) {
+ return (!rectangular && ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0))
+ || (rectangular && ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) != 0));
+}
+
+void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
+ //Platform::DebugPrintf("ButtonDown %d %d = %d alt=%d %d\n", curTime, lastClickTime, curTime - lastClickTime, alt, inDragDrop);
+ ptMouseLast = pt;
+ SelectionPosition newPos = SPositionFromLocation(pt, false, false, AllowVirtualSpace(virtualSpaceOptions, alt));
+ newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
+ inDragDrop = ddNone;
+ sel.SetMoveExtends(false);
+
+ if (NotifyMarginClick(pt, shift, ctrl, alt))
+ return;
+
+ NotifyIndicatorClick(true, newPos.Position(), shift, ctrl, alt);
+
+ bool inSelMargin = PointInSelMargin(pt);
+ // In margin ctrl+(double)click should always select everything
+ if (ctrl && inSelMargin) {
+ SelectAll();
+ lastClickTime = curTime;
+ lastClick = pt;
+ return;
+ }
+ if (shift && !inSelMargin) {
+ SetSelection(newPos);
+ }
+ if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) {
+ //Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
+ SetMouseCapture(true);
+ if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))
+ SetEmptySelection(newPos.Position());
+ bool doubleClick = false;
+ // Stop mouse button bounce changing selection type
+ if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
+ if (inSelMargin) {
+ // Inside margin selection type should be either selSubLine or selWholeLine.
+ if (selectionType == selSubLine) {
+ // If it is selSubLine, we're inside a *double* click and word wrap is enabled,
+ // so we switch to selWholeLine in order to select whole line.
+ selectionType = selWholeLine;
+ } else if (selectionType != selSubLine && selectionType != selWholeLine) {
+ // If it is neither, reset selection type to line selection.
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ }
+ } else {
+ if (selectionType == selChar) {
+ selectionType = selWord;
+ doubleClick = true;
+ } else if (selectionType == selWord) {
+ // Since we ended up here, we're inside a *triple* click, which should always select
+ // whole line irregardless of word wrap being enabled or not.
+ selectionType = selWholeLine;
+ } else {
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ }
+ }
+ }
+
+ if (selectionType == selWord) {
+ int charPos = originalAnchorPos;
+ if (sel.MainCaret() == originalAnchorPos) {
+ charPos = PositionFromLocation(pt, false, true);
+ charPos = MovePositionOutsideChar(charPos, -1);
+ }
+
+ int startWord, endWord;
+ if ((sel.MainCaret() >= originalAnchorPos) && !pdoc->IsLineEndPosition(charPos)) {
+ startWord = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(charPos + 1, 1), -1);
+ endWord = pdoc->ExtendWordSelect(charPos, 1);
+ } else {
+ // Selecting backwards, or anchor beyond last character on line. In these cases,
+ // we select the word containing the character to the *left* of the anchor.
+ if (charPos > pdoc->LineStart(pdoc->LineFromPosition(charPos))) {
+ startWord = pdoc->ExtendWordSelect(charPos, -1);
+ endWord = pdoc->ExtendWordSelect(startWord, 1);
+ } else {
+ // Anchor at start of line; select nothing to begin with.
+ startWord = charPos;
+ endWord = charPos;
+ }
+ }
+
+ wordSelectAnchorStartPos = startWord;
+ wordSelectAnchorEndPos = endWord;
+ wordSelectInitialCaretPos = sel.MainCaret();
+ WordSelection(wordSelectInitialCaretPos);
+ } else if (selectionType == selSubLine || selectionType == selWholeLine) {
+ lineAnchorPos = newPos.Position();
+ LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine);
+ //Platform::DebugPrintf("Triple click: %d - %d\n", anchor, currentPos);
+ } else {
+ SetEmptySelection(sel.MainCaret());
+ }
+ //Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos);
+ if (doubleClick) {
+ NotifyDoubleClick(pt, shift, ctrl, alt);
+ if (PositionIsHotspot(newPos.Position()))
+ NotifyHotSpotDoubleClicked(newPos.Position(), shift, ctrl, alt);
+ }
+ } else { // Single click
+ if (inSelMargin) {
+ sel.selType = Selection::selStream;
+ if (!shift) {
+ // Single click in margin: select whole line or only subline if word wrap is enabled
+ lineAnchorPos = newPos.Position();
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine);
+ } else {
+ // Single shift+click in margin: select from line anchor to clicked line
+ if (sel.MainAnchor() > sel.MainCaret())
+ lineAnchorPos = sel.MainAnchor() - 1;
+ else
+ lineAnchorPos = sel.MainAnchor();
+ // Reset selection type if there is an empty selection.
+ // This ensures that we don't end up stuck in previous selection mode, which is no longer valid.
+ // Otherwise, if there's a non empty selection, reset selection type only if it differs from selSubLine and selWholeLine.
+ // This ensures that we continue selecting in the same selection mode.
+ if (sel.Empty() || (selectionType != selSubLine && selectionType != selWholeLine))
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine);
+ }
+
+ SetDragPosition(SelectionPosition(invalidPosition));
+ SetMouseCapture(true);
+ } else {
+ if (PointIsHotspot(pt)) {
+ NotifyHotSpotClicked(newPos.Position(), shift, ctrl, alt);
+ hotSpotClickPos = PositionFromLocation(pt,true,false);
+ }
+ if (!shift) {
+ if (PointInSelection(pt) && !SelectionEmpty())
+ inDragDrop = ddInitial;
+ else
+ inDragDrop = ddNone;
+ }
+ SetMouseCapture(true);
+ if (inDragDrop != ddInitial) {
+ SetDragPosition(SelectionPosition(invalidPosition));
+ if (!shift) {
+ if (ctrl && multipleSelection) {
+ SelectionRange range(newPos);
+ sel.TentativeSelection(range);
+ InvalidateSelection(range, true);
+ } else {
+ InvalidateSelection(SelectionRange(newPos), true);
+ if (sel.Count() > 1)
+ Redraw();
+ if ((sel.Count() > 1) || (sel.selType != Selection::selStream))
+ sel.Clear();
+ sel.selType = alt ? Selection::selRectangle : Selection::selStream;
+ SetSelection(newPos, newPos);
+ }
+ }
+ SelectionPosition anchorCurrent = newPos;
+ if (shift)
+ anchorCurrent = sel.IsRectangular() ?
+ sel.Rectangular().anchor : sel.RangeMain().anchor;
+ sel.selType = alt ? Selection::selRectangle : Selection::selStream;
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ sel.Rectangular() = SelectionRange(newPos, anchorCurrent);
+ SetRectangularRange();
+ }
+ }
+ }
+ lastClickTime = curTime;
+ lastClick = pt;
+ lastXChosen = pt.x + xOffset;
+ ShowCaretAtCurrentPosition();
+}
+
+bool Editor::PositionIsHotspot(int position) const {
+ return vs.styles[pdoc->StyleAt(position) & pdoc->stylingBitsMask].hotspot;
+}
+
+bool Editor::PointIsHotspot(Point pt) {
+ int pos = PositionFromLocation(pt, true);
+ if (pos == INVALID_POSITION)
+ return false;
+ return PositionIsHotspot(pos);
+}
+
+void Editor::SetHotSpotRange(Point *pt) {
+ if (pt) {
+ int pos = PositionFromLocation(*pt);
+
+ // If we don't limit this to word characters then the
+ // range can encompass more than the run range and then
+ // the underline will not be drawn properly.
+ int hsStart_ = pdoc->ExtendStyleRange(pos, -1, vs.hotspotSingleLine);
+ int hsEnd_ = pdoc->ExtendStyleRange(pos, 1, vs.hotspotSingleLine);
+
+ // Only invalidate the range if the hotspot range has changed...
+ if (hsStart_ != hsStart || hsEnd_ != hsEnd) {
+ if (hsStart != -1) {
+ InvalidateRange(hsStart, hsEnd);
+ }
+ hsStart = hsStart_;
+ hsEnd = hsEnd_;
+ InvalidateRange(hsStart, hsEnd);
+ }
+ } else {
+ if (hsStart != -1) {
+ int hsStart_ = hsStart;
+ int hsEnd_ = hsEnd;
+ hsStart = -1;
+ hsEnd = -1;
+ InvalidateRange(hsStart_, hsEnd_);
+ } else {
+ hsStart = -1;
+ hsEnd = -1;
+ }
+ }
+}
+
+void Editor::GetHotSpotRange(int &hsStart_, int &hsEnd_) const {
+ hsStart_ = hsStart;
+ hsEnd_ = hsEnd;
+}
+
+void Editor::ButtonMoveWithModifiers(Point pt, int modifiers) {
+ if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
+ DwellEnd(true);
+ }
+
+ SelectionPosition movePos = SPositionFromLocation(pt, false, false,
+ AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular()));
+ movePos = MovePositionOutsideChar(movePos, sel.MainCaret() - movePos.Position());
+
+ if (inDragDrop == ddInitial) {
+ if (DragThreshold(ptMouseLast, pt)) {
+ SetMouseCapture(false);
+ SetDragPosition(movePos);
+ CopySelectionRange(&drag);
+ StartDrag();
+ }
+ return;
+ }
+
+ ptMouseLast = pt;
+ //Platform::DebugPrintf("Move %d %d\n", pt.x, pt.y);
+ if (HaveMouseCapture()) {
+
+ // Slow down autoscrolling/selection
+ autoScrollTimer.ticksToWait -= timer.tickSize;
+ if (autoScrollTimer.ticksToWait > 0)
+ return;
+ autoScrollTimer.ticksToWait = autoScrollDelay;
+
+ // Adjust selection
+ if (posDrag.IsValid()) {
+ SetDragPosition(movePos);
+ } else {
+ if (selectionType == selChar) {
+ if (sel.selType == Selection::selStream && (modifiers & SCI_ALT) && mouseSelectionRectangularSwitch) {
+ sel.selType = Selection::selRectangle;
+ }
+ if (sel.IsRectangular()) {
+ sel.Rectangular() = SelectionRange(movePos, sel.Rectangular().anchor);
+ SetSelection(movePos, sel.RangeMain().anchor);
+ } else if (sel.Count() > 1) {
+ InvalidateSelection(sel.RangeMain(), false);
+ SelectionRange range(movePos, sel.RangeMain().anchor);
+ sel.TentativeSelection(range);
+ InvalidateSelection(range, true);
+ } else {
+ SetSelection(movePos, sel.RangeMain().anchor);
+ }
+ } else if (selectionType == selWord) {
+ // Continue selecting by word
+ if (movePos.Position() == wordSelectInitialCaretPos) { // Didn't move
+ // No need to do anything. Previously this case was lumped
+ // in with "Moved forward", but that can be harmful in this
+ // case: a handler for the NotifyDoubleClick re-adjusts
+ // the selection for a fancier definition of "word" (for
+ // example, in Perl it is useful to include the leading
+ // '$', '%' or '@' on variables for word selection). In this
+ // the ButtonMove() called via Tick() for auto-scrolling
+ // could result in the fancier word selection adjustment
+ // being unmade.
+ } else {
+ wordSelectInitialCaretPos = -1;
+ WordSelection(movePos.Position());
+ }
+ } else {
+ // Continue selecting by line
+ LineSelection(movePos.Position(), lineAnchorPos, selectionType == selWholeLine);
+ }
+ }
+
+ // Autoscroll
+ PRectangle rcClient = GetClientRectangle();
+ Point ptOrigin = GetVisibleOriginInMain();
+ rcClient.Move(0, -ptOrigin.y);
+ int lineMove = DisplayFromPosition(movePos.Position());
+ if (pt.y > rcClient.bottom) {
+ ScrollTo(lineMove - LinesOnScreen() + 1);
+ Redraw();
+ } else if (pt.y < rcClient.top) {
+ ScrollTo(lineMove);
+ Redraw();
+ }
+ EnsureCaretVisible(false, false, true);
+
+ if (hsStart != -1 && !PositionIsHotspot(movePos.Position()))
+ SetHotSpotRange(NULL);
+
+ if (hotSpotClickPos != INVALID_POSITION && PositionFromLocation(pt,true,false) != hotSpotClickPos) {
+ if (inDragDrop == ddNone) {
+ DisplayCursor(Window::cursorText);
+ }
+ hotSpotClickPos = INVALID_POSITION;
+ }
+
+ } else {
+ if (vs.fixedColumnWidth > 0) { // There is a margin
+ if (PointInSelMargin(pt)) {
+ DisplayCursor(GetMarginCursor(pt));
+ SetHotSpotRange(NULL);
+ return; // No need to test for selection
+ }
+ }
+ // Display regular (drag) cursor over selection
+ if (PointInSelection(pt) && !SelectionEmpty()) {
+ DisplayCursor(Window::cursorArrow);
+ } else if (PointIsHotspot(pt)) {
+ DisplayCursor(Window::cursorHand);
+ SetHotSpotRange(&pt);
+ } else {
+ DisplayCursor(Window::cursorText);
+ SetHotSpotRange(NULL);
+ }
+ }
+}
+
+void Editor::ButtonMove(Point pt) {
+ ButtonMoveWithModifiers(pt, 0);
+}
+
+void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
+ //Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop);
+ SelectionPosition newPos = SPositionFromLocation(pt, false, false,
+ AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular()));
+ newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
+ if (inDragDrop == ddInitial) {
+ inDragDrop = ddNone;
+ SetEmptySelection(newPos);
+ selectionType = selChar;
+ originalAnchorPos = sel.MainCaret();
+ }
+ if (hotSpotClickPos != INVALID_POSITION && PointIsHotspot(pt)) {
+ hotSpotClickPos = INVALID_POSITION;
+ NotifyHotSpotReleaseClick(newPos.Position(), false, ctrl, false);
+ }
+ if (HaveMouseCapture()) {
+ if (PointInSelMargin(pt)) {
+ DisplayCursor(GetMarginCursor(pt));
+ } else {
+ DisplayCursor(Window::cursorText);
+ SetHotSpotRange(NULL);
+ }
+ ptMouseLast = pt;
+ SetMouseCapture(false);
+ NotifyIndicatorClick(false, newPos.Position(), false, false, false);
+ if (inDragDrop == ddDragging) {
+ SelectionPosition selStart = SelectionStart();
+ SelectionPosition selEnd = SelectionEnd();
+ if (selStart < selEnd) {
+ if (drag.Length()) {
+ if (ctrl) {
+ if (pdoc->InsertString(newPos.Position(), drag.Data(), static_cast<int>(drag.Length()))) {
+ SetSelection(newPos.Position(), newPos.Position() + static_cast<int>(drag.Length()));
+ }
+ } else if (newPos < selStart) {
+ pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length()));
+ if (pdoc->InsertString(newPos.Position(), drag.Data(), static_cast<int>(drag.Length()))) {
+ SetSelection(newPos.Position(), newPos.Position() + static_cast<int>(drag.Length()));
+ }
+ } else if (newPos > selEnd) {
+ pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length()));
+ newPos.Add(-static_cast<int>(drag.Length()));
+ if (pdoc->InsertString(newPos.Position(), drag.Data(), static_cast<int>(drag.Length()))) {
+ SetSelection(newPos.Position(), newPos.Position() + static_cast<int>(drag.Length()));
+ }
+ } else {
+ SetEmptySelection(newPos.Position());
+ }
+ drag.Clear();
+ }
+ selectionType = selChar;
+ }
+ } else {
+ if (selectionType == selChar) {
+ if (sel.Count() > 1) {
+ sel.RangeMain() =
+ SelectionRange(newPos, sel.Range(sel.Count() - 1).anchor);
+ InvalidateSelection(sel.RangeMain(), true);
+ } else {
+ SetSelection(newPos, sel.RangeMain().anchor);
+ }
+ }
+ sel.CommitTentative();
+ }
+ SetRectangularRange();
+ lastClickTime = curTime;
+ lastClick = pt;
+ lastXChosen = pt.x + xOffset;
+ if (sel.selType == Selection::selStream) {
+ SetLastXChosen();
+ }
+ inDragDrop = ddNone;
+ EnsureCaretVisible(false);
+ }
+}
+
+// Called frequently to perform background UI including
+// caret blinking and automatic scrolling.
+void Editor::Tick() {
+ if (HaveMouseCapture()) {
+ // Auto scroll
+ ButtonMove(ptMouseLast);
+ }
+ if (caret.period > 0) {
+ timer.ticksToWait -= timer.tickSize;
+ if (timer.ticksToWait <= 0) {
+ caret.on = !caret.on;
+ timer.ticksToWait = caret.period;
+ if (caret.active) {
+ InvalidateCaret();
+ }
+ }
+ }
+ if (horizontalScrollBarVisible && trackLineWidth && (lineWidthMaxSeen > scrollWidth)) {
+ scrollWidth = lineWidthMaxSeen;
+ SetScrollBars();
+ }
+ if ((dwellDelay < SC_TIME_FOREVER) &&
+ (ticksToDwell > 0) &&
+ (!HaveMouseCapture()) &&
+ (ptMouseLast.y >= 0)) {
+ ticksToDwell -= timer.tickSize;
+ if (ticksToDwell <= 0) {
+ dwelling = true;
+ NotifyDwelling(ptMouseLast, dwelling);
+ }
+ }
+}
+
+bool Editor::Idle() {
+
+ bool idleDone;
+
+ bool wrappingDone = !Wrapping();
+
+ if (!wrappingDone) {
+ // Wrap lines during idle.
+ WrapLines(wsIdle);
+ // No more wrapping
+ if (!wrapPending.NeedsWrap())
+ wrappingDone = true;
+ }
+
+ // Add more idle things to do here, but make sure idleDone is
+ // set correctly before the function returns. returning
+ // false will stop calling this idle funtion until SetIdle() is
+ // called again.
+
+ idleDone = wrappingDone; // && thatDone && theOtherThingDone...
+
+ return !idleDone;
+}
+
+void Editor::SetFocusState(bool focusState) {
+ hasFocus = focusState;
+ NotifyFocus(hasFocus);
+ if (hasFocus) {
+ ShowCaretAtCurrentPosition();
+ } else {
+ CancelModes();
+ DropCaret();
+ }
+}
+
+int Editor::PositionAfterArea(PRectangle rcArea) const {
+ // The start of the document line after the display line after the area
+ // This often means that the line after a modification is restyled which helps
+ // detect multiline comment additions and heals single line comments
+ int lineAfter = topLine + (rcArea.bottom - 1) / vs.lineHeight + 1;
+ if (lineAfter < cs.LinesDisplayed())
+ return pdoc->LineStart(cs.DocFromDisplay(lineAfter) + 1);
+ else
+ return pdoc->Length();
+}
+
+// Style to a position within the view. If this causes a change at end of last line then
+// affects later lines so style all the viewed text.
+void Editor::StyleToPositionInView(Position pos) {
+ int endWindow = (vs.marginInside) ? (PositionAfterArea(GetClientRectangle())) : (pdoc->Length());
+ if (pos > endWindow)
+ pos = endWindow;
+ int styleAtEnd = pdoc->StyleAt(pos-1);
+ pdoc->EnsureStyledTo(pos);
+ if ((endWindow > pos) && (styleAtEnd != pdoc->StyleAt(pos-1))) {
+ // Style at end of line changed so is multi-line change like starting a comment
+ // so require rest of window to be styled.
+ pdoc->EnsureStyledTo(endWindow);
+ }
+}
+
+void Editor::IdleWork() {
+ // Style the line after the modification as this allows modifications that change just the
+ // line of the modification to heal instead of propagating to the rest of the window.
+ if (workNeeded.items & WorkNeeded::workStyle)
+ StyleToPositionInView(pdoc->LineStart(pdoc->LineFromPosition(workNeeded.upTo) + 2));
+
+ NotifyUpdateUI();
+ workNeeded.Reset();
+}
+
+void Editor::QueueIdleWork(WorkNeeded::workItems items, int upTo) {
+ workNeeded.Need(items, upTo);
+}
+
+bool Editor::PaintContains(PRectangle rc) {
+ if (rc.Empty()) {
+ return true;
+ } else {
+ return rcPaint.Contains(rc);
+ }
+}
+
+bool Editor::PaintContainsMargin() {
+ if (wMargin.GetID()) {
+ // With separate margin view, paint of text view
+ // never contains margin.
+ return false;
+ }
+ PRectangle rcSelMargin = GetClientRectangle();
+ rcSelMargin.right = vs.textStart;
+ return PaintContains(rcSelMargin);
+}
+
+void Editor::CheckForChangeOutsidePaint(Range r) {
+ if (paintState == painting && !paintingAllText) {
+ //Platform::DebugPrintf("Checking range in paint %d-%d\n", r.start, r.end);
+ if (!r.Valid())
+ return;
+
+ PRectangle rcRange = RectangleFromRange(r.start, r.end);
+ PRectangle rcText = GetTextRectangle();
+ if (rcRange.top < rcText.top) {
+ rcRange.top = rcText.top;
+ }
+ if (rcRange.bottom > rcText.bottom) {
+ rcRange.bottom = rcText.bottom;
+ }
+
+ if (!PaintContains(rcRange)) {
+ AbandonPaint();
+ paintAbandonedByStyling = true;
+ }
+ }
+}
+
+void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {
+ if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) {
+ if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) {
+ CheckForChangeOutsidePaint(Range(braces[0]));
+ CheckForChangeOutsidePaint(Range(pos0));
+ braces[0] = pos0;
+ }
+ if ((braces[1] != pos1) || (matchStyle != bracesMatchStyle)) {
+ CheckForChangeOutsidePaint(Range(braces[1]));
+ CheckForChangeOutsidePaint(Range(pos1));
+ braces[1] = pos1;
+ }
+ bracesMatchStyle = matchStyle;
+ if (paintState == notPainting) {
+ Redraw();
+ }
+ }
+}
+
+void Editor::SetAnnotationHeights(int start, int end) {
+ if (vs.annotationVisible) {
+ bool changedHeight = false;
+ for (int line=start; line<end && line<pdoc->LinesTotal(); line++) {
+ int linesWrapped = 1;
+ if (Wrapping()) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+ if (surface && ll) {
+ LayoutLine(line, surface, vs, ll, wrapWidth);
+ linesWrapped = ll->lines;
+ }
+ }
+ if (cs.SetHeight(line, pdoc->AnnotationLines(line) + linesWrapped))
+ changedHeight = true;
+ }
+ if (changedHeight) {
+ Redraw();
+ }
+ }
+}
+
+void Editor::SetDocPointer(Document *document) {
+ //Platform::DebugPrintf("** %x setdoc to %x\n", pdoc, document);
+ pdoc->RemoveWatcher(this, 0);
+ pdoc->Release();
+ if (document == NULL) {
+ pdoc = new Document();
+ } else {
+ pdoc = document;
+ }
+ pdoc->AddRef();
+
+ // Ensure all positions within document
+ sel.Clear();
+ targetStart = 0;
+ targetEnd = 0;
+
+ braces[0] = invalidPosition;
+ braces[1] = invalidPosition;
+
+ vs.ReleaseAllExtendedStyles();
+
+ SetRepresentations();
+
+ // Reset the contraction state to fully shown.
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ llc.Deallocate();
+ NeedWrapping();
+
+ pdoc->AddWatcher(this, 0);
+ SetScrollBars();
+ Redraw();
+}
+
+void Editor::SetAnnotationVisible(int visible) {
+ if (vs.annotationVisible != visible) {
+ bool changedFromOrToHidden = ((vs.annotationVisible != 0) != (visible != 0));
+ vs.annotationVisible = visible;
+ if (changedFromOrToHidden) {
+ int dir = vs.annotationVisible ? 1 : -1;
+ for (int line=0; line<pdoc->LinesTotal(); line++) {
+ int annotationLines = pdoc->AnnotationLines(line);
+ if (annotationLines > 0) {
+ cs.SetHeight(line, cs.GetHeight(line) + annotationLines * dir);
+ }
+ }
+ }
+ Redraw();
+ }
+}
+
+/**
+ * Recursively expand a fold, making lines visible except where they have an unexpanded parent.
+ */
+int Editor::ExpandLine(int line) {
+ int lineMaxSubord = pdoc->GetLastChild(line);
+ line++;
+ while (line <= lineMaxSubord) {
+ cs.SetVisible(line, line, true);
+ int level = pdoc->GetLevel(line);
+ if (level & SC_FOLDLEVELHEADERFLAG) {
+ if (cs.GetExpanded(line)) {
+ line = ExpandLine(line);
+ } else {
+ line = pdoc->GetLastChild(line);
+ }
+ }
+ line++;
+ }
+ return lineMaxSubord;
+}
+
+void Editor::SetFoldExpanded(int lineDoc, bool expanded) {
+ if (cs.SetExpanded(lineDoc, expanded)) {
+ RedrawSelMargin();
+ }
+}
+
+void Editor::FoldLine(int line, int action) {
+ if (line >= 0) {
+ if (action == SC_FOLDACTION_TOGGLE) {
+ if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) {
+ line = pdoc->GetFoldParent(line);
+ if (line < 0)
+ return;
+ }
+ action = (cs.GetExpanded(line)) ? SC_FOLDACTION_CONTRACT : SC_FOLDACTION_EXPAND;
+ }
+
+ if (action == SC_FOLDACTION_CONTRACT) {
+ int lineMaxSubord = pdoc->GetLastChild(line);
+ if (lineMaxSubord > line) {
+ cs.SetExpanded(line, 0);
+ cs.SetVisible(line + 1, lineMaxSubord, false);
+
+ int lineCurrent = pdoc->LineFromPosition(sel.MainCaret());
+ if (lineCurrent > line && lineCurrent <= lineMaxSubord) {
+ // This does not re-expand the fold
+ EnsureCaretVisible();
+ }
+ }
+
+ } else {
+ if (!(cs.GetVisible(line))) {
+ EnsureLineVisible(line, false);
+ GoToLine(line);
+ }
+ cs.SetExpanded(line, 1);
+ ExpandLine(line);
+ }
+
+ SetScrollBars();
+ Redraw();
+ }
+}
+
+void Editor::FoldExpand(int line, int action, int level) {
+ bool expanding = action == SC_FOLDACTION_EXPAND;
+ if (action == SC_FOLDACTION_TOGGLE) {
+ expanding = !cs.GetExpanded(line);
+ }
+ SetFoldExpanded(line, expanding);
+ if (expanding && (cs.HiddenLines() == 0))
+ // Nothing to do
+ return;
+ int lineMaxSubord = pdoc->GetLastChild(line, level & SC_FOLDLEVELNUMBERMASK);
+ line++;
+ cs.SetVisible(line, lineMaxSubord, expanding);
+ while (line <= lineMaxSubord) {
+ int levelLine = pdoc->GetLevel(line);
+ if (levelLine & SC_FOLDLEVELHEADERFLAG) {
+ SetFoldExpanded(line, expanding);
+ }
+ line++;
+ }
+ SetScrollBars();
+ Redraw();
+}
+
+int Editor::ContractedFoldNext(int lineStart) const {
+ for (int line = lineStart; line<pdoc->LinesTotal();) {
+ if (!cs.GetExpanded(line) && (pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG))
+ return line;
+ line = cs.ContractedNext(line+1);
+ if (line < 0)
+ return -1;
+ }
+
+ return -1;
+}
+
+/**
+ * Recurse up from this line to find any folds that prevent this line from being visible
+ * and unfold them all.
+ */
+void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) {
+
+ // In case in need of wrapping to ensure DisplayFromDoc works.
+ if (lineDoc >= wrapPending.start)
+ WrapLines(wsAll);
+
+ if (!cs.GetVisible(lineDoc)) {
+ // Back up to find a non-blank line
+ int lookLine = lineDoc;
+ int lookLineLevel = pdoc->GetLevel(lookLine);
+ while ((lookLine > 0) && (lookLineLevel & SC_FOLDLEVELWHITEFLAG)) {
+ lookLineLevel = pdoc->GetLevel(--lookLine);
+ }
+ int lineParent = pdoc->GetFoldParent(lookLine);
+ if (lineParent < 0) {
+ // Backed up to a top level line, so try to find parent of initial line
+ lineParent = pdoc->GetFoldParent(lineDoc);
+ }
+ if (lineParent >= 0) {
+ if (lineDoc != lineParent)
+ EnsureLineVisible(lineParent, enforcePolicy);
+ if (!cs.GetExpanded(lineParent)) {
+ cs.SetExpanded(lineParent, 1);
+ ExpandLine(lineParent);
+ }
+ }
+ SetScrollBars();
+ Redraw();
+ }
+ if (enforcePolicy) {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (visiblePolicy & VISIBLE_SLOP) {
+ if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) {
+ SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ } else if ((lineDisplay > topLine + LinesOnScreen() - 1) ||
+ ((visiblePolicy & VISIBLE_STRICT) && (lineDisplay > topLine + LinesOnScreen() - 1 - visibleSlop))) {
+ SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() + 1 + visibleSlop, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ } else {
+ if ((topLine > lineDisplay) || (lineDisplay > topLine + LinesOnScreen() - 1) || (visiblePolicy & VISIBLE_STRICT)) {
+ SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() / 2 + 1, 0, MaxScrollPos()));
+ SetVerticalScrollPos();
+ Redraw();
+ }
+ }
+ }
+}
+
+void Editor::FoldAll(int action) {
+ pdoc->EnsureStyledTo(pdoc->Length());
+ int maxLine = pdoc->LinesTotal();
+ bool expanding = action == SC_FOLDACTION_EXPAND;
+ if (action == SC_FOLDACTION_TOGGLE) {
+ // Discover current state
+ for (int lineSeek = 0; lineSeek < maxLine; lineSeek++) {
+ if (pdoc->GetLevel(lineSeek) & SC_FOLDLEVELHEADERFLAG) {
+ expanding = !cs.GetExpanded(lineSeek);
+ break;
+ }
+ }
+ }
+ if (expanding) {
+ cs.SetVisible(0, maxLine-1, true);
+ for (int line = 0; line < maxLine; line++) {
+ int levelLine = pdoc->GetLevel(line);
+ if (levelLine & SC_FOLDLEVELHEADERFLAG) {
+ SetFoldExpanded(line, true);
+ }
+ }
+ } else {
+ for (int line = 0; line < maxLine; line++) {
+ int level = pdoc->GetLevel(line);
+ if ((level & SC_FOLDLEVELHEADERFLAG) &&
+ (SC_FOLDLEVELBASE == (level & SC_FOLDLEVELNUMBERMASK))) {
+ SetFoldExpanded(line, false);
+ int lineMaxSubord = pdoc->GetLastChild(line, -1);
+ if (lineMaxSubord > line) {
+ cs.SetVisible(line + 1, lineMaxSubord, false);
+ }
+ }
+ }
+ }
+ SetScrollBars();
+ Redraw();
+}
+
+void Editor::FoldChanged(int line, int levelNow, int levelPrev) {
+ if (levelNow & SC_FOLDLEVELHEADERFLAG) {
+ if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
+ // Adding a fold point.
+ if (cs.SetExpanded(line, true)) {
+ RedrawSelMargin();
+ }
+ FoldExpand(line, SC_FOLDACTION_EXPAND, levelPrev);
+ }
+ } else if (levelPrev & SC_FOLDLEVELHEADERFLAG) {
+ if (!cs.GetExpanded(line)) {
+ // Removing the fold from one that has been contracted so should expand
+ // otherwise lines are left invisible with no way to make them visible
+ if (cs.SetExpanded(line, true)) {
+ RedrawSelMargin();
+ }
+ FoldExpand(line, SC_FOLDACTION_EXPAND, levelPrev);
+ }
+ }
+ if (!(levelNow & SC_FOLDLEVELWHITEFLAG) &&
+ ((levelPrev & SC_FOLDLEVELNUMBERMASK) > (levelNow & SC_FOLDLEVELNUMBERMASK))) {
+ if (cs.HiddenLines()) {
+ // See if should still be hidden
+ int parentLine = pdoc->GetFoldParent(line);
+ if ((parentLine < 0) || (cs.GetExpanded(parentLine) && cs.GetVisible(parentLine))) {
+ cs.SetVisible(line, line, true);
+ SetScrollBars();
+ Redraw();
+ }
+ }
+ }
+}
+
+void Editor::NeedShown(int pos, int len) {
+ if (foldAutomatic & SC_AUTOMATICFOLD_SHOW) {
+ int lineStart = pdoc->LineFromPosition(pos);
+ int lineEnd = pdoc->LineFromPosition(pos+len);
+ for (int line = lineStart; line <= lineEnd; line++) {
+ EnsureLineVisible(line, false);
+ }
+ } else {
+ NotifyNeedShown(pos, len);
+ }
+}
+
+int Editor::GetTag(char *tagValue, int tagNumber) {
+ const char *text = 0;
+ int length = 0;
+ if ((tagNumber >= 1) && (tagNumber <= 9)) {
+ char name[3] = "\\?";
+ name[1] = static_cast<char>(tagNumber + '0');
+ length = 2;
+ text = pdoc->SubstituteByPosition(name, &length);
+ }
+ if (tagValue) {
+ if (text)
+ memcpy(tagValue, text, length + 1);
+ else
+ *tagValue = '\0';
+ }
+ return length;
+}
+
+int Editor::ReplaceTarget(bool replacePatterns, const char *text, int length) {
+ UndoGroup ug(pdoc);
+ if (length == -1)
+ length = istrlen(text);
+ if (replacePatterns) {
+ text = pdoc->SubstituteByPosition(text, &length);
+ if (!text) {
+ return 0;
+ }
+ }
+ if (targetStart != targetEnd)
+ pdoc->DeleteChars(targetStart, targetEnd - targetStart);
+ targetEnd = targetStart;
+ pdoc->InsertString(targetStart, text, length);
+ targetEnd = targetStart + length;
+ return length;
+}
+
+bool Editor::IsUnicodeMode() const {
+ return pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage);
+}
+
+int Editor::CodePage() const {
+ if (pdoc)
+ return pdoc->dbcsCodePage;
+ else
+ return 0;
+}
+
+int Editor::WrapCount(int line) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+
+ if (surface && ll) {
+ LayoutLine(line, surface, vs, ll, wrapWidth);
+ return ll->lines;
+ } else {
+ return 1;
+ }
+}
+
+void Editor::AddStyledText(char *buffer, int appendLength) {
+ // The buffer consists of alternating character bytes and style bytes
+ int textLength = appendLength / 2;
+ std::string text(textLength, '\0');
+ int i;
+ for (i = 0; i < textLength; i++) {
+ text[i] = buffer[i*2];
+ }
+ pdoc->InsertString(CurrentPosition(), text.c_str(), textLength);
+ for (i = 0; i < textLength; i++) {
+ text[i] = buffer[i*2+1];
+ }
+ pdoc->StartStyling(CurrentPosition(), static_cast<char>(0xff));
+ pdoc->SetStyles(textLength, text.c_str());
+ SetEmptySelection(sel.MainCaret() + textLength);
+}
+
+static bool ValidMargin(unsigned long wParam) {
+ return wParam <= SC_MAX_MARGIN;
+}
+
+static char *CharPtrFromSPtr(sptr_t lParam) {
+ return reinterpret_cast<char *>(lParam);
+}
+
+void Editor::StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ vs.EnsureStyle(wParam);
+ switch (iMessage) {
+ case SCI_STYLESETFORE:
+ vs.styles[wParam].fore = ColourDesired(lParam);
+ break;
+ case SCI_STYLESETBACK:
+ vs.styles[wParam].back = ColourDesired(lParam);
+ break;
+ case SCI_STYLESETBOLD:
+ vs.styles[wParam].weight = lParam != 0 ? SC_WEIGHT_BOLD : SC_WEIGHT_NORMAL;
+ break;
+ case SCI_STYLESETWEIGHT:
+ vs.styles[wParam].weight = lParam;
+ break;
+ case SCI_STYLESETITALIC:
+ vs.styles[wParam].italic = lParam != 0;
+ break;
+ case SCI_STYLESETEOLFILLED:
+ vs.styles[wParam].eolFilled = lParam != 0;
+ break;
+ case SCI_STYLESETSIZE:
+ vs.styles[wParam].size = lParam * SC_FONT_SIZE_MULTIPLIER;
+ break;
+ case SCI_STYLESETSIZEFRACTIONAL:
+ vs.styles[wParam].size = lParam;
+ break;
+ case SCI_STYLESETFONT:
+ if (lParam != 0) {
+ vs.SetStyleFontName(wParam, CharPtrFromSPtr(lParam));
+ }
+ break;
+ case SCI_STYLESETUNDERLINE:
+ vs.styles[wParam].underline = lParam != 0;
+ break;
+ case SCI_STYLESETCASE:
+ vs.styles[wParam].caseForce = static_cast<Style::ecaseForced>(lParam);
+ break;
+ case SCI_STYLESETCHARACTERSET:
+ vs.styles[wParam].characterSet = lParam;
+ pdoc->SetCaseFolder(NULL);
+ break;
+ case SCI_STYLESETVISIBLE:
+ vs.styles[wParam].visible = lParam != 0;
+ break;
+ case SCI_STYLESETCHANGEABLE:
+ vs.styles[wParam].changeable = lParam != 0;
+ break;
+ case SCI_STYLESETHOTSPOT:
+ vs.styles[wParam].hotspot = lParam != 0;
+ break;
+ }
+ InvalidateStyleRedraw();
+}
+
+sptr_t Editor::StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ vs.EnsureStyle(wParam);
+ switch (iMessage) {
+ case SCI_STYLEGETFORE:
+ return vs.styles[wParam].fore.AsLong();
+ case SCI_STYLEGETBACK:
+ return vs.styles[wParam].back.AsLong();
+ case SCI_STYLEGETBOLD:
+ return vs.styles[wParam].weight > SC_WEIGHT_NORMAL;
+ case SCI_STYLEGETWEIGHT:
+ return vs.styles[wParam].weight;
+ case SCI_STYLEGETITALIC:
+ return vs.styles[wParam].italic ? 1 : 0;
+ case SCI_STYLEGETEOLFILLED:
+ return vs.styles[wParam].eolFilled ? 1 : 0;
+ case SCI_STYLEGETSIZE:
+ return vs.styles[wParam].size / SC_FONT_SIZE_MULTIPLIER;
+ case SCI_STYLEGETSIZEFRACTIONAL:
+ return vs.styles[wParam].size;
+ case SCI_STYLEGETFONT:
+ if (!vs.styles[wParam].fontName)
+ return 0;
+ if (lParam != 0)
+ strcpy(CharPtrFromSPtr(lParam), vs.styles[wParam].fontName);
+ return strlen(vs.styles[wParam].fontName);
+ case SCI_STYLEGETUNDERLINE:
+ return vs.styles[wParam].underline ? 1 : 0;
+ case SCI_STYLEGETCASE:
+ return static_cast<int>(vs.styles[wParam].caseForce);
+ case SCI_STYLEGETCHARACTERSET:
+ return vs.styles[wParam].characterSet;
+ case SCI_STYLEGETVISIBLE:
+ return vs.styles[wParam].visible ? 1 : 0;
+ case SCI_STYLEGETCHANGEABLE:
+ return vs.styles[wParam].changeable ? 1 : 0;
+ case SCI_STYLEGETHOTSPOT:
+ return vs.styles[wParam].hotspot ? 1 : 0;
+ }
+ return 0;
+}
+
+sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
+ const size_t n = strlen(val);
+ if (lParam != 0) {
+ char *ptr = reinterpret_cast<char *>(lParam);
+ strcpy(ptr, val);
+ }
+ return n; // Not including NUL
+}
+
+sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ //Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam);
+
+ // Optional macro recording hook
+ if (recordingMacro)
+ NotifyMacroRecord(iMessage, wParam, lParam);
+
+ switch (iMessage) {
+
+ case SCI_GETTEXT: {
+ if (lParam == 0)
+ return pdoc->Length() + 1;
+ if (wParam == 0)
+ return 0;
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iChar = 0;
+ for (; iChar < wParam - 1; iChar++)
+ ptr[iChar] = pdoc->CharAt(iChar);
+ ptr[iChar] = '\0';
+ return iChar;
+ }
+
+ case SCI_SETTEXT: {
+ if (lParam == 0)
+ return 0;
+ UndoGroup ug(pdoc);
+ pdoc->DeleteChars(0, pdoc->Length());
+ SetEmptySelection(0);
+ pdoc->InsertCString(0, CharPtrFromSPtr(lParam));
+ return 1;
+ }
+
+ case SCI_GETTEXTLENGTH:
+ return pdoc->Length();
+
+ case SCI_CUT:
+ Cut();
+ SetLastXChosen();
+ break;
+
+ case SCI_COPY:
+ Copy();
+ break;
+
+ case SCI_COPYALLOWLINE:
+ CopyAllowLine();
+ break;
+
+ case SCI_VERTICALCENTRECARET:
+ VerticalCentreCaret();
+ break;
+
+ case SCI_MOVESELECTEDLINESUP:
+ MoveSelectedLinesUp();
+ break;
+
+ case SCI_MOVESELECTEDLINESDOWN:
+ MoveSelectedLinesDown();
+ break;
+
+ case SCI_COPYRANGE:
+ CopyRangeToClipboard(wParam, lParam);
+ break;
+
+ case SCI_COPYTEXT:
+ CopyText(wParam, CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_PASTE:
+ Paste();
+ if ((caretSticky == SC_CARETSTICKY_OFF) || (caretSticky == SC_CARETSTICKY_WHITESPACE)) {
+ SetLastXChosen();
+ }
+ EnsureCaretVisible();
+ break;
+
+ case SCI_CLEAR:
+ Clear();
+ SetLastXChosen();
+ EnsureCaretVisible();
+ break;
+
+ case SCI_UNDO:
+ Undo();
+ SetLastXChosen();
+ break;
+
+ case SCI_CANUNDO:
+ return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0;
+
+ case SCI_EMPTYUNDOBUFFER:
+ pdoc->DeleteUndoHistory();
+ return 0;
+
+ case SCI_GETFIRSTVISIBLELINE:
+ return topLine;
+
+ case SCI_SETFIRSTVISIBLELINE:
+ ScrollTo(wParam);
+ break;
+
+ case SCI_GETLINE: { // Risk of overwriting the end of the buffer
+ int lineStart = pdoc->LineStart(wParam);
+ int lineEnd = pdoc->LineStart(wParam + 1);
+ if (lParam == 0) {
+ return lineEnd - lineStart;
+ }
+ char *ptr = CharPtrFromSPtr(lParam);
+ int iPlace = 0;
+ for (int iChar = lineStart; iChar < lineEnd; iChar++) {
+ ptr[iPlace++] = pdoc->CharAt(iChar);
+ }
+ return iPlace;
+ }
+
+ case SCI_GETLINECOUNT:
+ if (pdoc->LinesTotal() == 0)
+ return 1;
+ else
+ return pdoc->LinesTotal();
+
+ case SCI_GETMODIFY:
+ return !pdoc->IsSavePoint();
+
+ case SCI_SETSEL: {
+ int nStart = static_cast<int>(wParam);
+ int nEnd = static_cast<int>(lParam);
+ if (nEnd < 0)
+ nEnd = pdoc->Length();
+ if (nStart < 0)
+ nStart = nEnd; // Remove selection
+ InvalidateSelection(SelectionRange(nStart, nEnd));
+ sel.Clear();
+ sel.selType = Selection::selStream;
+ SetSelection(nEnd, nStart);
+ EnsureCaretVisible();
+ }
+ break;
+
+ case SCI_GETSELTEXT: {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+ if (lParam == 0) {
+ return selectedText.LengthWithTerminator();
+ } else {
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iChar = 0;
+ if (selectedText.Length()) {
+ for (; iChar < selectedText.LengthWithTerminator(); iChar++)
+ ptr[iChar] = selectedText.Data()[iChar];
+ } else {
+ ptr[0] = '\0';
+ }
+ return iChar;
+ }
+ }
+
+ case SCI_LINEFROMPOSITION:
+ if (static_cast<int>(wParam) < 0)
+ return 0;
+ return pdoc->LineFromPosition(wParam);
+
+ case SCI_POSITIONFROMLINE:
+ if (static_cast<int>(wParam) < 0)
+ wParam = pdoc->LineFromPosition(SelectionStart().Position());
+ if (wParam == 0)
+ return 0; // Even if there is no text, there is a first line that starts at 0
+ if (static_cast<int>(wParam) > pdoc->LinesTotal())
+ return -1;
+ //if (wParam > pdoc->LineFromPosition(pdoc->Length())) // Useful test, anyway...
+ // return -1;
+ return pdoc->LineStart(wParam);
+
+ // Replacement of the old Scintilla interpretation of EM_LINELENGTH
+ case SCI_LINELENGTH:
+ if ((static_cast<int>(wParam) < 0) ||
+ (static_cast<int>(wParam) > pdoc->LineFromPosition(pdoc->Length())))
+ return 0;
+ return pdoc->LineStart(wParam + 1) - pdoc->LineStart(wParam);
+
+ case SCI_REPLACESEL: {
+ if (lParam == 0)
+ return 0;
+ UndoGroup ug(pdoc);
+ ClearSelection();
+ char *replacement = CharPtrFromSPtr(lParam);
+ pdoc->InsertCString(sel.MainCaret(), replacement);
+ SetEmptySelection(sel.MainCaret() + istrlen(replacement));
+ EnsureCaretVisible();
+ }
+ break;
+
+ case SCI_SETTARGETSTART:
+ targetStart = wParam;
+ break;
+
+ case SCI_GETTARGETSTART:
+ return targetStart;
+
+ case SCI_SETTARGETEND:
+ targetEnd = wParam;
+ break;
+
+ case SCI_GETTARGETEND:
+ return targetEnd;
+
+ case SCI_TARGETFROMSELECTION:
+ if (sel.MainCaret() < sel.MainAnchor()) {
+ targetStart = sel.MainCaret();
+ targetEnd = sel.MainAnchor();
+ } else {
+ targetStart = sel.MainAnchor();
+ targetEnd = sel.MainCaret();
+ }
+ break;
+
+ case SCI_REPLACETARGET:
+ PLATFORM_ASSERT(lParam);
+ return ReplaceTarget(false, CharPtrFromSPtr(lParam), wParam);
+
+ case SCI_REPLACETARGETRE:
+ PLATFORM_ASSERT(lParam);
+ return ReplaceTarget(true, CharPtrFromSPtr(lParam), wParam);
+
+ case SCI_SEARCHINTARGET:
+ PLATFORM_ASSERT(lParam);
+ return SearchInTarget(CharPtrFromSPtr(lParam), wParam);
+
+ case SCI_SETSEARCHFLAGS:
+ searchFlags = wParam;
+ break;
+
+ case SCI_GETSEARCHFLAGS:
+ return searchFlags;
+
+ case SCI_GETTAG:
+ return GetTag(CharPtrFromSPtr(lParam), wParam);
+
+ case SCI_POSITIONBEFORE:
+ return pdoc->MovePositionOutsideChar(wParam - 1, -1, true);
+
+ case SCI_POSITIONAFTER:
+ return pdoc->MovePositionOutsideChar(wParam + 1, 1, true);
+
+ case SCI_POSITIONRELATIVE:
+ return Platform::Clamp(pdoc->GetRelativePosition(wParam, lParam), 0, pdoc->Length());
+
+ case SCI_LINESCROLL:
+ ScrollTo(topLine + lParam);
+ HorizontalScrollTo(xOffset + static_cast<int>(wParam) * vs.spaceWidth);
+ return 1;
+
+ case SCI_SETXOFFSET:
+ xOffset = wParam;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ SetHorizontalScrollPos();
+ Redraw();
+ break;
+
+ case SCI_GETXOFFSET:
+ return xOffset;
+
+ case SCI_CHOOSECARETX:
+ SetLastXChosen();
+ break;
+
+ case SCI_SCROLLCARET:
+ EnsureCaretVisible();
+ break;
+
+ case SCI_SETREADONLY:
+ pdoc->SetReadOnly(wParam != 0);
+ return 1;
+
+ case SCI_GETREADONLY:
+ return pdoc->IsReadOnly();
+
+ case SCI_CANPASTE:
+ return CanPaste();
+
+ case SCI_POINTXFROMPOSITION:
+ if (lParam < 0) {
+ return 0;
+ } else {
+ Point pt = LocationFromPosition(lParam);
+ // Convert to view-relative
+ return pt.x - vs.textStart + vs.fixedColumnWidth;
+ }
+
+ case SCI_POINTYFROMPOSITION:
+ if (lParam < 0) {
+ return 0;
+ } else {
+ Point pt = LocationFromPosition(lParam);
+ return pt.y;
+ }
+
+ case SCI_FINDTEXT:
+ return FindText(wParam, lParam);
+
+ case SCI_GETTEXTRANGE: {
+ if (lParam == 0)
+ return 0;
+ Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam);
+ int cpMax = tr->chrg.cpMax;
+ if (cpMax == -1)
+ cpMax = pdoc->Length();
+ PLATFORM_ASSERT(cpMax <= pdoc->Length());
+ int len = cpMax - tr->chrg.cpMin; // No -1 as cpMin and cpMax are referring to inter character positions
+ pdoc->GetCharRange(tr->lpstrText, tr->chrg.cpMin, len);
+ // Spec says copied text is terminated with a NUL
+ tr->lpstrText[len] = '\0';
+ return len; // Not including NUL
+ }
+
+ case SCI_HIDESELECTION:
+ hideSelection = wParam != 0;
+ Redraw();
+ break;
+
+ case SCI_FORMATRANGE:
+ return FormatRange(wParam != 0, reinterpret_cast<Sci_RangeToFormat *>(lParam));
+
+ case SCI_GETMARGINLEFT:
+ return vs.leftMarginWidth;
+
+ case SCI_GETMARGINRIGHT:
+ return vs.rightMarginWidth;
+
+ case SCI_SETMARGINLEFT:
+ lastXChosen += lParam - vs.leftMarginWidth;
+ vs.leftMarginWidth = lParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETMARGINRIGHT:
+ vs.rightMarginWidth = lParam;
+ InvalidateStyleRedraw();
+ break;
+
+ // Control specific mesages
+
+ case SCI_ADDTEXT: {
+ if (lParam == 0)
+ return 0;
+ pdoc->InsertString(CurrentPosition(), CharPtrFromSPtr(lParam), wParam);
+ SetEmptySelection(sel.MainCaret() + wParam);
+ return 0;
+ }
+
+ case SCI_ADDSTYLEDTEXT:
+ if (lParam)
+ AddStyledText(CharPtrFromSPtr(lParam), wParam);
+ return 0;
+
+ case SCI_INSERTTEXT: {
+ if (lParam == 0)
+ return 0;
+ int insertPos = wParam;
+ if (static_cast<int>(wParam) == -1)
+ insertPos = CurrentPosition();
+ int newCurrent = CurrentPosition();
+ char *sz = CharPtrFromSPtr(lParam);
+ pdoc->InsertCString(insertPos, sz);
+ if (newCurrent > insertPos)
+ newCurrent += istrlen(sz);
+ SetEmptySelection(newCurrent);
+ return 0;
+ }
+
+ case SCI_APPENDTEXT:
+ pdoc->InsertString(pdoc->Length(), CharPtrFromSPtr(lParam), wParam);
+ return 0;
+
+ case SCI_CLEARALL:
+ ClearAll();
+ return 0;
+
+ case SCI_DELETERANGE:
+ pdoc->DeleteChars(wParam, lParam);
+ return 0;
+
+ case SCI_CLEARDOCUMENTSTYLE:
+ ClearDocumentStyle();
+ return 0;
+
+ case SCI_SETUNDOCOLLECTION:
+ pdoc->SetUndoCollection(wParam != 0);
+ return 0;
+
+ case SCI_GETUNDOCOLLECTION:
+ return pdoc->IsCollectingUndo();
+
+ case SCI_BEGINUNDOACTION:
+ pdoc->BeginUndoAction();
+ return 0;
+
+ case SCI_ENDUNDOACTION:
+ pdoc->EndUndoAction();
+ return 0;
+
+ case SCI_GETCARETPERIOD:
+ return caret.period;
+
+ case SCI_SETCARETPERIOD:
+ caret.period = wParam;
+ break;
+
+ case SCI_GETWORDCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccWord, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETWORDCHARS: {
+ pdoc->SetDefaultCharClasses(false);
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccWord);
+ }
+ break;
+
+ case SCI_GETWHITESPACECHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccSpace, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETWHITESPACECHARS: {
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccSpace);
+ }
+ break;
+
+ case SCI_GETPUNCTUATIONCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccPunctuation, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETPUNCTUATIONCHARS: {
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccPunctuation);
+ }
+ break;
+
+ case SCI_SETCHARSDEFAULT:
+ pdoc->SetDefaultCharClasses(true);
+ break;
+
+ case SCI_GETLENGTH:
+ return pdoc->Length();
+
+ case SCI_ALLOCATE:
+ pdoc->Allocate(wParam);
+ break;
+
+ case SCI_GETCHARAT:
+ return pdoc->CharAt(wParam);
+
+ case SCI_SETCURRENTPOS:
+ if (sel.IsRectangular()) {
+ sel.Rectangular().caret.SetPosition(wParam);
+ SetRectangularRange();
+ Redraw();
+ } else {
+ SetSelection(wParam, sel.MainAnchor());
+ }
+ break;
+
+ case SCI_GETCURRENTPOS:
+ return sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret();
+
+ case SCI_SETANCHOR:
+ if (sel.IsRectangular()) {
+ sel.Rectangular().anchor.SetPosition(wParam);
+ SetRectangularRange();
+ Redraw();
+ } else {
+ SetSelection(sel.MainCaret(), wParam);
+ }
+ break;
+
+ case SCI_GETANCHOR:
+ return sel.IsRectangular() ? sel.Rectangular().anchor.Position() : sel.MainAnchor();
+
+ case SCI_SETSELECTIONSTART:
+ SetSelection(Platform::Maximum(sel.MainCaret(), wParam), wParam);
+ break;
+
+ case SCI_GETSELECTIONSTART:
+ return sel.LimitsForRectangularElseMain().start.Position();
+
+ case SCI_SETSELECTIONEND:
+ SetSelection(wParam, Platform::Minimum(sel.MainAnchor(), wParam));
+ break;
+
+ case SCI_GETSELECTIONEND:
+ return sel.LimitsForRectangularElseMain().end.Position();
+
+ case SCI_SETEMPTYSELECTION:
+ SetEmptySelection(wParam);
+ break;
+
+ case SCI_SETPRINTMAGNIFICATION:
+ printParameters.magnification = wParam;
+ break;
+
+ case SCI_GETPRINTMAGNIFICATION:
+ return printParameters.magnification;
+
+ case SCI_SETPRINTCOLOURMODE:
+ printParameters.colourMode = wParam;
+ break;
+
+ case SCI_GETPRINTCOLOURMODE:
+ return printParameters.colourMode;
+
+ case SCI_SETPRINTWRAPMODE:
+ printParameters.wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone;
+ break;
+
+ case SCI_GETPRINTWRAPMODE:
+ return printParameters.wrapState;
+
+ case SCI_GETSTYLEAT:
+ if (static_cast<int>(wParam) >= pdoc->Length())
+ return 0;
+ else
+ return pdoc->StyleAt(wParam);
+
+ case SCI_REDO:
+ Redo();
+ break;
+
+ case SCI_SELECTALL:
+ SelectAll();
+ break;
+
+ case SCI_SETSAVEPOINT:
+ pdoc->SetSavePoint();
+ break;
+
+ case SCI_GETSTYLEDTEXT: {
+ if (lParam == 0)
+ return 0;
+ Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam);
+ int iPlace = 0;
+ for (int iChar = tr->chrg.cpMin; iChar < tr->chrg.cpMax; iChar++) {
+ tr->lpstrText[iPlace++] = pdoc->CharAt(iChar);
+ tr->lpstrText[iPlace++] = pdoc->StyleAt(iChar);
+ }
+ tr->lpstrText[iPlace] = '\0';
+ tr->lpstrText[iPlace + 1] = '\0';
+ return iPlace;
+ }
+
+ case SCI_CANREDO:
+ return (pdoc->CanRedo() && !pdoc->IsReadOnly()) ? 1 : 0;
+
+ case SCI_MARKERLINEFROMHANDLE:
+ return pdoc->LineFromHandle(wParam);
+
+ case SCI_MARKERDELETEHANDLE:
+ pdoc->DeleteMarkFromHandle(wParam);
+ break;
+
+ case SCI_GETVIEWWS:
+ return vs.viewWhitespace;
+
+ case SCI_SETVIEWWS:
+ vs.viewWhitespace = static_cast<WhiteSpaceVisibility>(wParam);
+ Redraw();
+ break;
+
+ case SCI_GETWHITESPACESIZE:
+ return vs.whitespaceSize;
+
+ case SCI_SETWHITESPACESIZE:
+ vs.whitespaceSize = static_cast<int>(wParam);
+ Redraw();
+ break;
+
+ case SCI_POSITIONFROMPOINT:
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ false, false);
+
+ case SCI_POSITIONFROMPOINTCLOSE:
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ true, false);
+
+ case SCI_CHARPOSITIONFROMPOINT:
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ false, true);
+
+ case SCI_CHARPOSITIONFROMPOINTCLOSE:
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ true, true);
+
+ case SCI_GOTOLINE:
+ GoToLine(wParam);
+ break;
+
+ case SCI_GOTOPOS:
+ SetEmptySelection(wParam);
+ EnsureCaretVisible();
+ break;
+
+ case SCI_GETCURLINE: {
+ int lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret());
+ int lineStart = pdoc->LineStart(lineCurrentPos);
+ unsigned int lineEnd = pdoc->LineStart(lineCurrentPos + 1);
+ if (lParam == 0) {
+ return 1 + lineEnd - lineStart;
+ }
+ PLATFORM_ASSERT(wParam > 0);
+ char *ptr = CharPtrFromSPtr(lParam);
+ unsigned int iPlace = 0;
+ for (unsigned int iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) {
+ ptr[iPlace++] = pdoc->CharAt(iChar);
+ }
+ ptr[iPlace] = '\0';
+ return sel.MainCaret() - lineStart;
+ }
+
+ case SCI_GETENDSTYLED:
+ return pdoc->GetEndStyled();
+
+ case SCI_GETEOLMODE:
+ return pdoc->eolMode;
+
+ case SCI_SETEOLMODE:
+ pdoc->eolMode = wParam;
+ break;
+
+ case SCI_SETLINEENDTYPESALLOWED:
+ if (pdoc->SetLineEndTypesAllowed(wParam)) {
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETLINEENDTYPESALLOWED:
+ return pdoc->GetLineEndTypesAllowed();
+
+ case SCI_GETLINEENDTYPESACTIVE:
+ return pdoc->GetLineEndTypesActive();
+
+ case SCI_STARTSTYLING:
+ pdoc->StartStyling(wParam, static_cast<char>(lParam));
+ break;
+
+ case SCI_SETSTYLING:
+ pdoc->SetStyleFor(wParam, static_cast<char>(lParam));
+ break;
+
+ case SCI_SETSTYLINGEX: // Specify a complete styling buffer
+ if (lParam == 0)
+ return 0;
+ pdoc->SetStyles(wParam, CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_SETBUFFEREDDRAW:
+ bufferedDraw = wParam != 0;
+ break;
+
+ case SCI_GETBUFFEREDDRAW:
+ return bufferedDraw;
+
+ case SCI_GETTWOPHASEDRAW:
+ return twoPhaseDraw;
+
+ case SCI_SETTWOPHASEDRAW:
+ twoPhaseDraw = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETFONTQUALITY:
+ vs.extraFontFlag &= ~SC_EFF_QUALITY_MASK;
+ vs.extraFontFlag |= (wParam & SC_EFF_QUALITY_MASK);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETFONTQUALITY:
+ return (vs.extraFontFlag & SC_EFF_QUALITY_MASK);
+
+ case SCI_SETTABWIDTH:
+ if (wParam > 0) {
+ pdoc->tabInChars = wParam;
+ if (pdoc->indentInChars == 0)
+ pdoc->actualIndentInChars = pdoc->tabInChars;
+ }
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETTABWIDTH:
+ return pdoc->tabInChars;
+
+ case SCI_SETINDENT:
+ pdoc->indentInChars = wParam;
+ if (pdoc->indentInChars != 0)
+ pdoc->actualIndentInChars = pdoc->indentInChars;
+ else
+ pdoc->actualIndentInChars = pdoc->tabInChars;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETINDENT:
+ return pdoc->indentInChars;
+
+ case SCI_SETUSETABS:
+ pdoc->useTabs = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETUSETABS:
+ return pdoc->useTabs;
+
+ case SCI_SETLINEINDENTATION:
+ pdoc->SetLineIndentation(wParam, lParam);
+ break;
+
+ case SCI_GETLINEINDENTATION:
+ return pdoc->GetLineIndentation(wParam);
+
+ case SCI_GETLINEINDENTPOSITION:
+ return pdoc->GetLineIndentPosition(wParam);
+
+ case SCI_SETTABINDENTS:
+ pdoc->tabIndents = wParam != 0;
+ break;
+
+ case SCI_GETTABINDENTS:
+ return pdoc->tabIndents;
+
+ case SCI_SETBACKSPACEUNINDENTS:
+ pdoc->backspaceUnindents = wParam != 0;
+ break;
+
+ case SCI_GETBACKSPACEUNINDENTS:
+ return pdoc->backspaceUnindents;
+
+ case SCI_SETMOUSEDWELLTIME:
+ dwellDelay = wParam;
+ ticksToDwell = dwellDelay;
+ break;
+
+ case SCI_GETMOUSEDWELLTIME:
+ return dwellDelay;
+
+ case SCI_WORDSTARTPOSITION:
+ return pdoc->ExtendWordSelect(wParam, -1, lParam != 0);
+
+ case SCI_WORDENDPOSITION:
+ return pdoc->ExtendWordSelect(wParam, 1, lParam != 0);
+
+ case SCI_SETWRAPMODE:
+ if (vs.SetWrapState(wParam)) {
+ xOffset = 0;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPMODE:
+ return vs.wrapState;
+
+ case SCI_SETWRAPVISUALFLAGS:
+ if (vs.SetWrapVisualFlags(wParam)) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPVISUALFLAGS:
+ return vs.wrapVisualFlags;
+
+ case SCI_SETWRAPVISUALFLAGSLOCATION:
+ if (vs.SetWrapVisualFlagsLocation(wParam)) {
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETWRAPVISUALFLAGSLOCATION:
+ return vs.wrapVisualFlagsLocation;
+
+ case SCI_SETWRAPSTARTINDENT:
+ if (vs.SetWrapVisualStartIndent(wParam)) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPSTARTINDENT:
+ return vs.wrapVisualStartIndent;
+
+ case SCI_SETWRAPINDENTMODE:
+ if (vs.SetWrapIndentMode(wParam)) {
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETWRAPINDENTMODE:
+ return vs.wrapIndentMode;
+
+ case SCI_SETLAYOUTCACHE:
+ llc.SetLevel(wParam);
+ break;
+
+ case SCI_GETLAYOUTCACHE:
+ return llc.GetLevel();
+
+ case SCI_SETPOSITIONCACHE:
+ posCache.SetSize(wParam);
+ break;
+
+ case SCI_GETPOSITIONCACHE:
+ return posCache.GetSize();
+
+ case SCI_SETSCROLLWIDTH:
+ PLATFORM_ASSERT(wParam > 0);
+ if ((wParam > 0) && (wParam != static_cast<unsigned int >(scrollWidth))) {
+ lineWidthMaxSeen = 0;
+ scrollWidth = wParam;
+ SetScrollBars();
+ }
+ break;
+
+ case SCI_GETSCROLLWIDTH:
+ return scrollWidth;
+
+ case SCI_SETSCROLLWIDTHTRACKING:
+ trackLineWidth = wParam != 0;
+ break;
+
+ case SCI_GETSCROLLWIDTHTRACKING:
+ return trackLineWidth;
+
+ case SCI_LINESJOIN:
+ LinesJoin();
+ break;
+
+ case SCI_LINESSPLIT:
+ LinesSplit(wParam);
+ break;
+
+ case SCI_TEXTWIDTH:
+ PLATFORM_ASSERT(wParam < vs.styles.size());
+ PLATFORM_ASSERT(lParam);
+ return TextWidth(wParam, CharPtrFromSPtr(lParam));
+
+ case SCI_TEXTHEIGHT:
+ return vs.lineHeight;
+
+ case SCI_SETENDATLASTLINE:
+ PLATFORM_ASSERT((wParam == 0) || (wParam == 1));
+ if (endAtLastLine != (wParam != 0)) {
+ endAtLastLine = wParam != 0;
+ SetScrollBars();
+ }
+ break;
+
+ case SCI_GETENDATLASTLINE:
+ return endAtLastLine;
+
+ case SCI_SETCARETSTICKY:
+ PLATFORM_ASSERT(wParam <= SC_CARETSTICKY_WHITESPACE);
+ if (wParam <= SC_CARETSTICKY_WHITESPACE) {
+ caretSticky = wParam;
+ }
+ break;
+
+ case SCI_GETCARETSTICKY:
+ return caretSticky;
+
+ case SCI_TOGGLECARETSTICKY:
+ caretSticky = !caretSticky;
+ break;
+
+ case SCI_GETCOLUMN:
+ return pdoc->GetColumn(wParam);
+
+ case SCI_FINDCOLUMN:
+ return pdoc->FindColumn(wParam, lParam);
+
+ case SCI_SETHSCROLLBAR :
+ if (horizontalScrollBarVisible != (wParam != 0)) {
+ horizontalScrollBarVisible = wParam != 0;
+ SetScrollBars();
+ ReconfigureScrollBars();
+ }
+ break;
+
+ case SCI_GETHSCROLLBAR:
+ return horizontalScrollBarVisible;
+
+ case SCI_SETVSCROLLBAR:
+ if (verticalScrollBarVisible != (wParam != 0)) {
+ verticalScrollBarVisible = wParam != 0;
+ SetScrollBars();
+ ReconfigureScrollBars();
+ if (verticalScrollBarVisible)
+ SetVerticalScrollPos();
+ }
+ break;
+
+ case SCI_GETVSCROLLBAR:
+ return verticalScrollBarVisible;
+
+ case SCI_SETINDENTATIONGUIDES:
+ vs.viewIndentationGuides = IndentView(wParam);
+ Redraw();
+ break;
+
+ case SCI_GETINDENTATIONGUIDES:
+ return vs.viewIndentationGuides;
+
+ case SCI_SETHIGHLIGHTGUIDE:
+ if ((highlightGuideColumn != static_cast<int>(wParam)) || (wParam > 0)) {
+ highlightGuideColumn = wParam;
+ Redraw();
+ }
+ break;
+
+ case SCI_GETHIGHLIGHTGUIDE:
+ return highlightGuideColumn;
+
+ case SCI_GETLINEENDPOSITION:
+ return pdoc->LineEnd(wParam);
+
+ case SCI_SETCODEPAGE:
+ if (ValidCodePage(wParam)) {
+ if (pdoc->SetDBCSCodePage(wParam)) {
+ cs.Clear();
+ cs.InsertLines(0, pdoc->LinesTotal() - 1);
+ SetAnnotationHeights(0, pdoc->LinesTotal());
+ InvalidateStyleRedraw();
+ SetRepresentations();
+ }
+ }
+ break;
+
+ case SCI_GETCODEPAGE:
+ return pdoc->dbcsCodePage;
+
+#ifdef INCLUDE_DEPRECATED_FEATURES
+ case SCI_SETUSEPALETTE:
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETUSEPALETTE:
+ return 0;
+#endif
+
+ // Marker definition and setting
+ case SCI_MARKERDEFINE:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].markType = lParam;
+ vs.CalcLargestMarkerHeight();
+ }
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_MARKERSYMBOLDEFINED:
+ if (wParam <= MARKER_MAX)
+ return vs.markers[wParam].markType;
+ else
+ return 0;
+
+ case SCI_MARKERSETFORE:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].fore = ColourDesired(lParam);
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETBACKSELECTED:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].backSelected = ColourDesired(lParam);
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERENABLEHIGHLIGHT:
+ highlightDelimiter.isEnabled = wParam == 1;
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETBACK:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].back = ColourDesired(lParam);
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+ case SCI_MARKERSETALPHA:
+ if (wParam <= MARKER_MAX)
+ vs.markers[wParam].alpha = lParam;
+ InvalidateStyleRedraw();
+ break;
+ case SCI_MARKERADD: {
+ int markerID = pdoc->AddMark(wParam, lParam);
+ return markerID;
+ }
+ case SCI_MARKERADDSET:
+ if (lParam != 0)
+ pdoc->AddMarkSet(wParam, lParam);
+ break;
+
+ case SCI_MARKERDELETE:
+ pdoc->DeleteMark(wParam, lParam);
+ break;
+
+ case SCI_MARKERDELETEALL:
+ pdoc->DeleteAllMarks(static_cast<int>(wParam));
+ break;
+
+ case SCI_MARKERGET:
+ return pdoc->GetMark(wParam);
+
+ case SCI_MARKERNEXT:
+ return pdoc->MarkerNext(wParam, lParam);
+
+ case SCI_MARKERPREVIOUS: {
+ for (int iLine = wParam; iLine >= 0; iLine--) {
+ if ((pdoc->GetMark(iLine) & lParam) != 0)
+ return iLine;
+ }
+ }
+ return -1;
+
+ case SCI_MARKERDEFINEPIXMAP:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam));
+ vs.CalcLargestMarkerHeight();
+ };
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_RGBAIMAGESETWIDTH:
+ sizeRGBAImage.x = wParam;
+ break;
+
+ case SCI_RGBAIMAGESETHEIGHT:
+ sizeRGBAImage.y = wParam;
+ break;
+
+ case SCI_RGBAIMAGESETSCALE:
+ scaleRGBAImage = wParam;
+ break;
+
+ case SCI_MARKERDEFINERGBAIMAGE:
+ if (wParam <= MARKER_MAX) {
+ vs.markers[wParam].SetRGBAImage(sizeRGBAImage, scaleRGBAImage / 100.0, reinterpret_cast<unsigned char *>(lParam));
+ vs.CalcLargestMarkerHeight();
+ };
+ InvalidateStyleData();
+ RedrawSelMargin();
+ break;
+
+ case SCI_SETMARGINTYPEN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].style = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINTYPEN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].style;
+ else
+ return 0;
+
+ case SCI_SETMARGINWIDTHN:
+ if (ValidMargin(wParam)) {
+ // Short-circuit if the width is unchanged, to avoid unnecessary redraw.
+ if (vs.ms[wParam].width != lParam) {
+ lastXChosen += lParam - vs.ms[wParam].width;
+ vs.ms[wParam].width = lParam;
+ InvalidateStyleRedraw();
+ }
+ }
+ break;
+
+ case SCI_GETMARGINWIDTHN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].width;
+ else
+ return 0;
+
+ case SCI_SETMARGINMASKN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].mask = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINMASKN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].mask;
+ else
+ return 0;
+
+ case SCI_SETMARGINSENSITIVEN:
+ if (ValidMargin(wParam)) {
+ vs.ms[wParam].sensitive = lParam != 0;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_GETMARGINSENSITIVEN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].sensitive ? 1 : 0;
+ else
+ return 0;
+
+ case SCI_SETMARGINCURSORN:
+ if (ValidMargin(wParam))
+ vs.ms[wParam].cursor = lParam;
+ break;
+
+ case SCI_GETMARGINCURSORN:
+ if (ValidMargin(wParam))
+ return vs.ms[wParam].cursor;
+ else
+ return 0;
+
+ case SCI_STYLECLEARALL:
+ vs.ClearStyles();
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_STYLESETFORE:
+ case SCI_STYLESETBACK:
+ case SCI_STYLESETBOLD:
+ case SCI_STYLESETWEIGHT:
+ case SCI_STYLESETITALIC:
+ case SCI_STYLESETEOLFILLED:
+ case SCI_STYLESETSIZE:
+ case SCI_STYLESETSIZEFRACTIONAL:
+ case SCI_STYLESETFONT:
+ case SCI_STYLESETUNDERLINE:
+ case SCI_STYLESETCASE:
+ case SCI_STYLESETCHARACTERSET:
+ case SCI_STYLESETVISIBLE:
+ case SCI_STYLESETCHANGEABLE:
+ case SCI_STYLESETHOTSPOT:
+ StyleSetMessage(iMessage, wParam, lParam);
+ break;
+
+ case SCI_STYLEGETFORE:
+ case SCI_STYLEGETBACK:
+ case SCI_STYLEGETBOLD:
+ case SCI_STYLEGETWEIGHT:
+ case SCI_STYLEGETITALIC:
+ case SCI_STYLEGETEOLFILLED:
+ case SCI_STYLEGETSIZE:
+ case SCI_STYLEGETSIZEFRACTIONAL:
+ case SCI_STYLEGETFONT:
+ case SCI_STYLEGETUNDERLINE:
+ case SCI_STYLEGETCASE:
+ case SCI_STYLEGETCHARACTERSET:
+ case SCI_STYLEGETVISIBLE:
+ case SCI_STYLEGETCHANGEABLE:
+ case SCI_STYLEGETHOTSPOT:
+ return StyleGetMessage(iMessage, wParam, lParam);
+
+ case SCI_STYLERESETDEFAULT:
+ vs.ResetDefaultStyle();
+ InvalidateStyleRedraw();
+ break;
+ case SCI_SETSTYLEBITS:
+ vs.EnsureStyle((1 << wParam) - 1);
+ pdoc->SetStylingBits(wParam);
+ break;
+
+ case SCI_GETSTYLEBITS:
+ return pdoc->stylingBits;
+
+ case SCI_SETLINESTATE:
+ return pdoc->SetLineState(wParam, lParam);
+
+ case SCI_GETLINESTATE:
+ return pdoc->GetLineState(wParam);
+
+ case SCI_GETMAXLINESTATE:
+ return pdoc->GetMaxLineState();
+
+ case SCI_GETCARETLINEVISIBLE:
+ return vs.showCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLE:
+ vs.showCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+ case SCI_GETCARETLINEVISIBLEALWAYS:
+ return vs.alwaysShowCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLEALWAYS:
+ vs.alwaysShowCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETLINEBACK:
+ return vs.caretLineBackground.AsLong();
+ case SCI_SETCARETLINEBACK:
+ vs.caretLineBackground = wParam;
+ InvalidateStyleRedraw();
+ break;
+ case SCI_GETCARETLINEBACKALPHA:
+ return vs.caretLineAlpha;
+ case SCI_SETCARETLINEBACKALPHA:
+ vs.caretLineAlpha = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ // Folding messages
+
+ case SCI_VISIBLEFROMDOCLINE:
+ return cs.DisplayFromDoc(wParam);
+
+ case SCI_DOCLINEFROMVISIBLE:
+ return cs.DocFromDisplay(wParam);
+
+ case SCI_WRAPCOUNT:
+ return WrapCount(wParam);
+
+ case SCI_SETFOLDLEVEL: {
+ int prev = pdoc->SetLevel(wParam, lParam);
+ if (prev != lParam)
+ RedrawSelMargin();
+ return prev;
+ }
+
+ case SCI_GETFOLDLEVEL:
+ return pdoc->GetLevel(wParam);
+
+ case SCI_GETLASTCHILD:
+ return pdoc->GetLastChild(wParam, lParam);
+
+ case SCI_GETFOLDPARENT:
+ return pdoc->GetFoldParent(wParam);
+
+ case SCI_SHOWLINES:
+ cs.SetVisible(wParam, lParam, true);
+ SetScrollBars();
+ Redraw();
+ break;
+
+ case SCI_HIDELINES:
+ if (wParam > 0)
+ cs.SetVisible(wParam, lParam, false);
+ SetScrollBars();
+ Redraw();
+ break;
+
+ case SCI_GETLINEVISIBLE:
+ return cs.GetVisible(wParam);
+
+ case SCI_GETALLLINESVISIBLE:
+ return cs.HiddenLines() ? 0 : 1;
+
+ case SCI_SETFOLDEXPANDED:
+ SetFoldExpanded(wParam, lParam != 0);
+ break;
+
+ case SCI_GETFOLDEXPANDED:
+ return cs.GetExpanded(wParam);
+
+ case SCI_SETAUTOMATICFOLD:
+ foldAutomatic = wParam;
+ break;
+
+ case SCI_GETAUTOMATICFOLD:
+ return foldAutomatic;
+
+ case SCI_SETFOLDFLAGS:
+ foldFlags = wParam;
+ Redraw();
+ break;
+
+ case SCI_TOGGLEFOLD:
+ FoldLine(wParam, SC_FOLDACTION_TOGGLE);
+ break;
+
+ case SCI_FOLDLINE:
+ FoldLine(wParam, lParam);
+ break;
+
+ case SCI_FOLDCHILDREN:
+ FoldExpand(wParam, lParam, pdoc->GetLevel(wParam));
+ break;
+
+ case SCI_FOLDALL:
+ FoldAll(wParam);
+ break;
+
+ case SCI_EXPANDCHILDREN:
+ FoldExpand(wParam, SC_FOLDACTION_EXPAND, lParam);
+ break;
+
+ case SCI_CONTRACTEDFOLDNEXT:
+ return ContractedFoldNext(wParam);
+
+ case SCI_ENSUREVISIBLE:
+ EnsureLineVisible(wParam, false);
+ break;
+
+ case SCI_ENSUREVISIBLEENFORCEPOLICY:
+ EnsureLineVisible(wParam, true);
+ break;
+
+ case SCI_SCROLLRANGE:
+ ScrollRange(SelectionRange(lParam, wParam));
+ break;
+
+ case SCI_SEARCHANCHOR:
+ SearchAnchor();
+ break;
+
+ case SCI_SEARCHNEXT:
+ case SCI_SEARCHPREV:
+ return SearchText(iMessage, wParam, lParam);
+
+ case SCI_SETXCARETPOLICY:
+ caretXPolicy = wParam;
+ caretXSlop = lParam;
+ break;
+
+ case SCI_SETYCARETPOLICY:
+ caretYPolicy = wParam;
+ caretYSlop = lParam;
+ break;
+
+ case SCI_SETVISIBLEPOLICY:
+ visiblePolicy = wParam;
+ visibleSlop = lParam;
+ break;
+
+ case SCI_LINESONSCREEN:
+ return LinesOnScreen();
+
+ case SCI_SETSELFORE:
+ vs.selColours.fore = ColourOptional(wParam, lParam);
+ vs.selAdditionalForeground = ColourDesired(lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETSELBACK:
+ vs.selColours.back = ColourOptional(wParam, lParam);
+ vs.selAdditionalBackground = ColourDesired(lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETSELALPHA:
+ vs.selAlpha = wParam;
+ vs.selAdditionalAlpha = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETSELALPHA:
+ return vs.selAlpha;
+
+ case SCI_GETSELEOLFILLED:
+ return vs.selEOLFilled;
+
+ case SCI_SETSELEOLFILLED:
+ vs.selEOLFilled = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETWHITESPACEFORE:
+ vs.whitespaceColours.fore = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETWHITESPACEBACK:
+ vs.whitespaceColours.back = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETCARETFORE:
+ vs.caretcolour = ColourDesired(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETFORE:
+ return vs.caretcolour.AsLong();
+
+ case SCI_SETCARETSTYLE:
+ if (wParam <= CARETSTYLE_BLOCK)
+ vs.caretStyle = wParam;
+ else
+ /* Default to the line caret */
+ vs.caretStyle = CARETSTYLE_LINE;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETSTYLE:
+ return vs.caretStyle;
+
+ case SCI_SETCARETWIDTH:
+ if (static_cast<int>(wParam) <= 0)
+ vs.caretWidth = 0;
+ else if (wParam >= 3)
+ vs.caretWidth = 3;
+ else
+ vs.caretWidth = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCARETWIDTH:
+ return vs.caretWidth;
+
+ case SCI_ASSIGNCMDKEY:
+ kmap.AssignCmdKey(Platform::LowShortFromLong(wParam),
+ Platform::HighShortFromLong(wParam), lParam);
+ break;
+
+ case SCI_CLEARCMDKEY:
+ kmap.AssignCmdKey(Platform::LowShortFromLong(wParam),
+ Platform::HighShortFromLong(wParam), SCI_NULL);
+ break;
+
+ case SCI_CLEARALLCMDKEYS:
+ kmap.Clear();
+ break;
+
+ case SCI_INDICSETSTYLE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].style = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETSTYLE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].style : 0;
+
+ case SCI_INDICSETFORE:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].fore = ColourDesired(lParam);
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETFORE:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fore.AsLong() : 0;
+
+ case SCI_INDICSETUNDER:
+ if (wParam <= INDIC_MAX) {
+ vs.indicators[wParam].under = lParam != 0;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETUNDER:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].under : 0;
+
+ case SCI_INDICSETALPHA:
+ if (wParam <= INDIC_MAX && lParam >=0 && lParam <= 255) {
+ vs.indicators[wParam].fillAlpha = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETALPHA:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fillAlpha : 0;
+
+ case SCI_INDICSETOUTLINEALPHA:
+ if (wParam <= INDIC_MAX && lParam >=0 && lParam <= 255) {
+ vs.indicators[wParam].outlineAlpha = lParam;
+ InvalidateStyleRedraw();
+ }
+ break;
+
+ case SCI_INDICGETOUTLINEALPHA:
+ return (wParam <= INDIC_MAX) ? vs.indicators[wParam].outlineAlpha : 0;
+
+ case SCI_SETINDICATORCURRENT:
+ pdoc->decorations.SetCurrentIndicator(wParam);
+ break;
+ case SCI_GETINDICATORCURRENT:
+ return pdoc->decorations.GetCurrentIndicator();
+ case SCI_SETINDICATORVALUE:
+ pdoc->decorations.SetCurrentValue(wParam);
+ break;
+ case SCI_GETINDICATORVALUE:
+ return pdoc->decorations.GetCurrentValue();
+
+ case SCI_INDICATORFILLRANGE:
+ pdoc->DecorationFillRange(wParam, pdoc->decorations.GetCurrentValue(), lParam);
+ break;
+
+ case SCI_INDICATORCLEARRANGE:
+ pdoc->DecorationFillRange(wParam, 0, lParam);
+ break;
+
+ case SCI_INDICATORALLONFOR:
+ return pdoc->decorations.AllOnFor(wParam);
+
+ case SCI_INDICATORVALUEAT:
+ return pdoc->decorations.ValueAt(wParam, lParam);
+
+ case SCI_INDICATORSTART:
+ return pdoc->decorations.Start(wParam, lParam);
+
+ case SCI_INDICATOREND:
+ return pdoc->decorations.End(wParam, lParam);
+
+ case SCI_LINEDOWN:
+ case SCI_LINEDOWNEXTEND:
+ case SCI_PARADOWN:
+ case SCI_PARADOWNEXTEND:
+ case SCI_LINEUP:
+ case SCI_LINEUPEXTEND:
+ case SCI_PARAUP:
+ case SCI_PARAUPEXTEND:
+ case SCI_CHARLEFT:
+ case SCI_CHARLEFTEXTEND:
+ case SCI_CHARRIGHT:
+ case SCI_CHARRIGHTEXTEND:
+ case SCI_WORDLEFT:
+ case SCI_WORDLEFTEXTEND:
+ case SCI_WORDRIGHT:
+ case SCI_WORDRIGHTEXTEND:
+ case SCI_WORDLEFTEND:
+ case SCI_WORDLEFTENDEXTEND:
+ case SCI_WORDRIGHTEND:
+ case SCI_WORDRIGHTENDEXTEND:
+ case SCI_HOME:
+ case SCI_HOMEEXTEND:
+ case SCI_LINEEND:
+ case SCI_LINEENDEXTEND:
+ case SCI_HOMEWRAP:
+ case SCI_HOMEWRAPEXTEND:
+ case SCI_LINEENDWRAP:
+ case SCI_LINEENDWRAPEXTEND:
+ case SCI_DOCUMENTSTART:
+ case SCI_DOCUMENTSTARTEXTEND:
+ case SCI_DOCUMENTEND:
+ case SCI_DOCUMENTENDEXTEND:
+ case SCI_SCROLLTOSTART:
+ case SCI_SCROLLTOEND:
+
+ case SCI_STUTTEREDPAGEUP:
+ case SCI_STUTTEREDPAGEUPEXTEND:
+ case SCI_STUTTEREDPAGEDOWN:
+ case SCI_STUTTEREDPAGEDOWNEXTEND:
+
+ case SCI_PAGEUP:
+ case SCI_PAGEUPEXTEND:
+ case SCI_PAGEDOWN:
+ case SCI_PAGEDOWNEXTEND:
+ case SCI_EDITTOGGLEOVERTYPE:
+ case SCI_CANCEL:
+ case SCI_DELETEBACK:
+ case SCI_TAB:
+ case SCI_BACKTAB:
+ case SCI_NEWLINE:
+ case SCI_FORMFEED:
+ case SCI_VCHOME:
+ case SCI_VCHOMEEXTEND:
+ case SCI_VCHOMEWRAP:
+ case SCI_VCHOMEWRAPEXTEND:
+ case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
+ case SCI_ZOOMIN:
+ case SCI_ZOOMOUT:
+ case SCI_DELWORDLEFT:
+ case SCI_DELWORDRIGHT:
+ case SCI_DELWORDRIGHTEND:
+ case SCI_DELLINELEFT:
+ case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
+ case SCI_LINECUT:
+ case SCI_LINEDELETE:
+ case SCI_LINETRANSPOSE:
+ case SCI_LINEDUPLICATE:
+ case SCI_LOWERCASE:
+ case SCI_UPPERCASE:
+ case SCI_LINESCROLLDOWN:
+ case SCI_LINESCROLLUP:
+ case SCI_WORDPARTLEFT:
+ case SCI_WORDPARTLEFTEXTEND:
+ case SCI_WORDPARTRIGHT:
+ case SCI_WORDPARTRIGHTEXTEND:
+ case SCI_DELETEBACKNOTLINE:
+ case SCI_HOMEDISPLAY:
+ case SCI_HOMEDISPLAYEXTEND:
+ case SCI_LINEENDDISPLAY:
+ case SCI_LINEENDDISPLAYEXTEND:
+ case SCI_LINEDOWNRECTEXTEND:
+ case SCI_LINEUPRECTEXTEND:
+ case SCI_CHARLEFTRECTEXTEND:
+ case SCI_CHARRIGHTRECTEXTEND:
+ case SCI_HOMERECTEXTEND:
+ case SCI_VCHOMERECTEXTEND:
+ case SCI_LINEENDRECTEXTEND:
+ case SCI_PAGEUPRECTEXTEND:
+ case SCI_PAGEDOWNRECTEXTEND:
+ case SCI_SELECTIONDUPLICATE:
+ return KeyCommand(iMessage);
+
+ case SCI_BRACEHIGHLIGHT:
+ SetBraceHighlight(static_cast<int>(wParam), lParam, STYLE_BRACELIGHT);
+ break;
+
+ case SCI_BRACEHIGHLIGHTINDICATOR:
+ if (lParam >= 0 && lParam <= INDIC_MAX) {
+ vs.braceHighlightIndicatorSet = wParam != 0;
+ vs.braceHighlightIndicator = lParam;
+ }
+ break;
+
+ case SCI_BRACEBADLIGHT:
+ SetBraceHighlight(static_cast<int>(wParam), -1, STYLE_BRACEBAD);
+ break;
+
+ case SCI_BRACEBADLIGHTINDICATOR:
+ if (lParam >= 0 && lParam <= INDIC_MAX) {
+ vs.braceBadLightIndicatorSet = wParam != 0;
+ vs.braceBadLightIndicator = lParam;
+ }
+ break;
+
+ case SCI_BRACEMATCH:
+ // wParam is position of char to find brace for,
+ // lParam is maximum amount of text to restyle to find it
+ return pdoc->BraceMatch(wParam, lParam);
+
+ case SCI_GETVIEWEOL:
+ return vs.viewEOL;
+
+ case SCI_SETVIEWEOL:
+ vs.viewEOL = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETZOOM:
+ vs.zoomLevel = wParam;
+ InvalidateStyleRedraw();
+ NotifyZoom();
+ break;
+
+ case SCI_GETZOOM:
+ return vs.zoomLevel;
+
+ case SCI_GETEDGECOLUMN:
+ return vs.theEdge;
+
+ case SCI_SETEDGECOLUMN:
+ vs.theEdge = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEDGEMODE:
+ return vs.edgeState;
+
+ case SCI_SETEDGEMODE:
+ vs.edgeState = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEDGECOLOUR:
+ return vs.edgecolour.AsLong();
+
+ case SCI_SETEDGECOLOUR:
+ vs.edgecolour = ColourDesired(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETDOCPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc);
+
+ case SCI_SETDOCPOINTER:
+ CancelModes();
+ SetDocPointer(reinterpret_cast<Document *>(lParam));
+ return 0;
+
+ case SCI_CREATEDOCUMENT: {
+ Document *doc = new Document();
+ doc->AddRef();
+ return reinterpret_cast<sptr_t>(doc);
+ }
+
+ case SCI_ADDREFDOCUMENT:
+ (reinterpret_cast<Document *>(lParam))->AddRef();
+ break;
+
+ case SCI_RELEASEDOCUMENT:
+ (reinterpret_cast<Document *>(lParam))->Release();
+ break;
+
+ case SCI_CREATELOADER: {
+ Document *doc = new Document();
+ doc->AddRef();
+ doc->Allocate(wParam);
+ doc->SetUndoCollection(false);
+ return reinterpret_cast<sptr_t>(static_cast<ILoader *>(doc));
+ }
+
+ case SCI_SETMODEVENTMASK:
+ modEventMask = wParam;
+ return 0;
+
+ case SCI_GETMODEVENTMASK:
+ return modEventMask;
+
+ case SCI_CONVERTEOLS:
+ pdoc->ConvertLineEnds(wParam);
+ SetSelection(sel.MainCaret(), sel.MainAnchor()); // Ensure selection inside document
+ return 0;
+
+ case SCI_SETLENGTHFORENCODE:
+ lengthForEncode = wParam;
+ return 0;
+
+ case SCI_SELECTIONISRECTANGLE:
+ return sel.selType == Selection::selRectangle ? 1 : 0;
+
+ case SCI_SETSELECTIONMODE: {
+ switch (wParam) {
+ case SC_SEL_STREAM:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selStream));
+ sel.selType = Selection::selStream;
+ break;
+ case SC_SEL_RECTANGLE:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selRectangle));
+ sel.selType = Selection::selRectangle;
+ break;
+ case SC_SEL_LINES:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selLines));
+ sel.selType = Selection::selLines;
+ break;
+ case SC_SEL_THIN:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selThin));
+ sel.selType = Selection::selThin;
+ break;
+ default:
+ sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selStream));
+ sel.selType = Selection::selStream;
+ }
+ InvalidateSelection(sel.RangeMain(), true);
+ break;
+ }
+ case SCI_GETSELECTIONMODE:
+ switch (sel.selType) {
+ case Selection::selStream:
+ return SC_SEL_STREAM;
+ case Selection::selRectangle:
+ return SC_SEL_RECTANGLE;
+ case Selection::selLines:
+ return SC_SEL_LINES;
+ case Selection::selThin:
+ return SC_SEL_THIN;
+ default: // ?!
+ return SC_SEL_STREAM;
+ }
+ case SCI_GETLINESELSTARTPOSITION:
+ case SCI_GETLINESELENDPOSITION: {
+ SelectionSegment segmentLine(SelectionPosition(pdoc->LineStart(wParam)),
+ SelectionPosition(pdoc->LineEnd(wParam)));
+ for (size_t r=0; r<sel.Count(); r++) {
+ SelectionSegment portion = sel.Range(r).Intersect(segmentLine);
+ if (portion.start.IsValid()) {
+ return (iMessage == SCI_GETLINESELSTARTPOSITION) ? portion.start.Position() : portion.end.Position();
+ }
+ }
+ return INVALID_POSITION;
+ }
+
+ case SCI_SETOVERTYPE:
+ inOverstrike = wParam != 0;
+ break;
+
+ case SCI_GETOVERTYPE:
+ return inOverstrike ? 1 : 0;
+
+ case SCI_SETFOCUS:
+ SetFocusState(wParam != 0);
+ break;
+
+ case SCI_GETFOCUS:
+ return hasFocus;
+
+ case SCI_SETSTATUS:
+ errorStatus = wParam;
+ break;
+
+ case SCI_GETSTATUS:
+ return errorStatus;
+
+ case SCI_SETMOUSEDOWNCAPTURES:
+ mouseDownCaptures = wParam != 0;
+ break;
+
+ case SCI_GETMOUSEDOWNCAPTURES:
+ return mouseDownCaptures;
+
+ case SCI_SETCURSOR:
+ cursorMode = wParam;
+ DisplayCursor(Window::cursorText);
+ break;
+
+ case SCI_GETCURSOR:
+ return cursorMode;
+
+ case SCI_SETCONTROLCHARSYMBOL:
+ vs.controlCharSymbol = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETCONTROLCHARSYMBOL:
+ return vs.controlCharSymbol;
+
+ case SCI_SETREPRESENTATION:
+ reprs.SetRepresentation(reinterpret_cast<const char *>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_GETREPRESENTATION: {
+ Representation *repr = reprs.RepresentationFromCharacter(
+ reinterpret_cast<const char *>(wParam), UTF8MaxBytes);
+ if (repr) {
+ if (lParam != 0)
+ strcpy(CharPtrFromSPtr(lParam), repr->stringRep.c_str());
+ return repr->stringRep.size();
+ }
+ return 0;
+ }
+
+ case SCI_CLEARREPRESENTATION:
+ reprs.ClearRepresentation(reinterpret_cast<const char *>(wParam));
+ break;
+
+ case SCI_STARTRECORD:
+ recordingMacro = true;
+ return 0;
+
+ case SCI_STOPRECORD:
+ recordingMacro = false;
+ return 0;
+
+ case SCI_MOVECARETINSIDEVIEW:
+ MoveCaretInsideView();
+ break;
+
+ case SCI_SETFOLDMARGINCOLOUR:
+ vs.foldmarginColour = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETFOLDMARGINHICOLOUR:
+ vs.foldmarginHighlightColour = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETHOTSPOTACTIVEFORE:
+ vs.hotspotColours.fore = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEFORE:
+ return vs.hotspotColours.fore.AsLong();
+
+ case SCI_SETHOTSPOTACTIVEBACK:
+ vs.hotspotColours.back = ColourOptional(wParam, lParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEBACK:
+ return vs.hotspotColours.back.AsLong();
+
+ case SCI_SETHOTSPOTACTIVEUNDERLINE:
+ vs.hotspotUnderline = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTACTIVEUNDERLINE:
+ return vs.hotspotUnderline ? 1 : 0;
+
+ case SCI_SETHOTSPOTSINGLELINE:
+ vs.hotspotSingleLine = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETHOTSPOTSINGLELINE:
+ return vs.hotspotSingleLine ? 1 : 0;
+
+ case SCI_SETPASTECONVERTENDINGS:
+ convertPastes = wParam != 0;
+ break;
+
+ case SCI_GETPASTECONVERTENDINGS:
+ return convertPastes ? 1 : 0;
+
+ case SCI_GETCHARACTERPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc->BufferPointer());
+
+ case SCI_GETRANGEPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc->RangePointer(wParam, lParam));
+
+ case SCI_GETGAPPOSITION:
+ return pdoc->GapPosition();
+
+ case SCI_SETEXTRAASCENT:
+ vs.extraAscent = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEXTRAASCENT:
+ return vs.extraAscent;
+
+ case SCI_SETEXTRADESCENT:
+ vs.extraDescent = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETEXTRADESCENT:
+ return vs.extraDescent;
+
+ case SCI_MARGINSETSTYLEOFFSET:
+ vs.marginStyleOffset = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_MARGINGETSTYLEOFFSET:
+ return vs.marginStyleOffset;
+
+ case SCI_SETMARGINOPTIONS:
+ marginOptions = wParam;
+ break;
+
+ case SCI_GETMARGINOPTIONS:
+ return marginOptions;
+
+ case SCI_MARGINSETTEXT:
+ pdoc->MarginSetText(wParam, CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_MARGINGETTEXT: {
+ const StyledText st = pdoc->MarginStyledText(wParam);
+ if (lParam) {
+ if (st.text)
+ memcpy(CharPtrFromSPtr(lParam), st.text, st.length);
+ else
+ strcpy(CharPtrFromSPtr(lParam), "");
+ }
+ return st.length;
+ }
+
+ case SCI_MARGINSETSTYLE:
+ pdoc->MarginSetStyle(wParam, lParam);
+ break;
+
+ case SCI_MARGINGETSTYLE: {
+ const StyledText st = pdoc->MarginStyledText(wParam);
+ return st.style;
+ }
+
+ case SCI_MARGINSETSTYLES:
+ pdoc->MarginSetStyles(wParam, reinterpret_cast<const unsigned char *>(lParam));
+ break;
+
+ case SCI_MARGINGETSTYLES: {
+ const StyledText st = pdoc->MarginStyledText(wParam);
+ if (lParam) {
+ if (st.styles)
+ memcpy(CharPtrFromSPtr(lParam), st.styles, st.length);
+ else
+ strcpy(CharPtrFromSPtr(lParam), "");
+ }
+ return st.styles ? st.length : 0;
+ }
+
+ case SCI_MARGINTEXTCLEARALL:
+ pdoc->MarginClearAll();
+ break;
+
+ case SCI_ANNOTATIONSETTEXT:
+ pdoc->AnnotationSetText(wParam, CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_ANNOTATIONGETTEXT: {
+ const StyledText st = pdoc->AnnotationStyledText(wParam);
+ if (lParam) {
+ if (st.text)
+ memcpy(CharPtrFromSPtr(lParam), st.text, st.length);
+ else
+ strcpy(CharPtrFromSPtr(lParam), "");
+ }
+ return st.length;
+ }
+
+ case SCI_ANNOTATIONGETSTYLE: {
+ const StyledText st = pdoc->AnnotationStyledText(wParam);
+ return st.style;
+ }
+
+ case SCI_ANNOTATIONSETSTYLE:
+ pdoc->AnnotationSetStyle(wParam, lParam);
+ break;
+
+ case SCI_ANNOTATIONSETSTYLES:
+ pdoc->AnnotationSetStyles(wParam, reinterpret_cast<const unsigned char *>(lParam));
+ break;
+
+ case SCI_ANNOTATIONGETSTYLES: {
+ const StyledText st = pdoc->AnnotationStyledText(wParam);
+ if (lParam) {
+ if (st.styles)
+ memcpy(CharPtrFromSPtr(lParam), st.styles, st.length);
+ else
+ strcpy(CharPtrFromSPtr(lParam), "");
+ }
+ return st.styles ? st.length : 0;
+ }
+
+ case SCI_ANNOTATIONGETLINES:
+ return pdoc->AnnotationLines(wParam);
+
+ case SCI_ANNOTATIONCLEARALL:
+ pdoc->AnnotationClearAll();
+ break;
+
+ case SCI_ANNOTATIONSETVISIBLE:
+ SetAnnotationVisible(wParam);
+ break;
+
+ case SCI_ANNOTATIONGETVISIBLE:
+ return vs.annotationVisible;
+
+ case SCI_ANNOTATIONSETSTYLEOFFSET:
+ vs.annotationStyleOffset = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_ANNOTATIONGETSTYLEOFFSET:
+ return vs.annotationStyleOffset;
+
+ case SCI_RELEASEALLEXTENDEDSTYLES:
+ vs.ReleaseAllExtendedStyles();
+ break;
+
+ case SCI_ALLOCATEEXTENDEDSTYLES:
+ return vs.AllocateExtendedStyles(wParam);
+
+ case SCI_ADDUNDOACTION:
+ pdoc->AddUndoAction(wParam, lParam & UNDO_MAY_COALESCE);
+ break;
+
+ case SCI_SETMOUSESELECTIONRECTANGULARSWITCH:
+ mouseSelectionRectangularSwitch = wParam != 0;
+ break;
+
+ case SCI_GETMOUSESELECTIONRECTANGULARSWITCH:
+ return mouseSelectionRectangularSwitch;
+
+ case SCI_SETMULTIPLESELECTION:
+ multipleSelection = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETMULTIPLESELECTION:
+ return multipleSelection;
+
+ case SCI_SETADDITIONALSELECTIONTYPING:
+ additionalSelectionTyping = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALSELECTIONTYPING:
+ return additionalSelectionTyping;
+
+ case SCI_SETMULTIPASTE:
+ multiPasteMode = wParam;
+ break;
+
+ case SCI_GETMULTIPASTE:
+ return multiPasteMode;
+
+ case SCI_SETADDITIONALCARETSBLINK:
+ additionalCaretsBlink = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALCARETSBLINK:
+ return additionalCaretsBlink;
+
+ case SCI_SETADDITIONALCARETSVISIBLE:
+ additionalCaretsVisible = wParam != 0;
+ InvalidateCaret();
+ break;
+
+ case SCI_GETADDITIONALCARETSVISIBLE:
+ return additionalCaretsVisible;
+
+ case SCI_GETSELECTIONS:
+ return sel.Count();
+
+ case SCI_GETSELECTIONEMPTY:
+ return sel.Empty();
+
+ case SCI_CLEARSELECTIONS:
+ sel.Clear();
+ Redraw();
+ break;
+
+ case SCI_SETSELECTION:
+ sel.SetSelection(SelectionRange(wParam, lParam));
+ Redraw();
+ break;
+
+ case SCI_ADDSELECTION:
+ sel.AddSelection(SelectionRange(wParam, lParam));
+ Redraw();
+ break;
+
+ case SCI_SETMAINSELECTION:
+ sel.SetMain(wParam);
+ Redraw();
+ break;
+
+ case SCI_GETMAINSELECTION:
+ return sel.Main();
+
+ case SCI_SETSELECTIONNCARET:
+ sel.Range(wParam).caret.SetPosition(lParam);
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNCARET:
+ return sel.Range(wParam).caret.Position();
+
+ case SCI_SETSELECTIONNANCHOR:
+ sel.Range(wParam).anchor.SetPosition(lParam);
+ Redraw();
+ break;
+ case SCI_GETSELECTIONNANCHOR:
+ return sel.Range(wParam).anchor.Position();
+
+ case SCI_SETSELECTIONNCARETVIRTUALSPACE:
+ sel.Range(wParam).caret.SetVirtualSpace(lParam);
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNCARETVIRTUALSPACE:
+ return sel.Range(wParam).caret.VirtualSpace();
+
+ case SCI_SETSELECTIONNANCHORVIRTUALSPACE:
+ sel.Range(wParam).anchor.SetVirtualSpace(lParam);
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNANCHORVIRTUALSPACE:
+ return sel.Range(wParam).anchor.VirtualSpace();
+
+ case SCI_SETSELECTIONNSTART:
+ sel.Range(wParam).anchor.SetPosition(lParam);
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNSTART:
+ return sel.Range(wParam).Start().Position();
+
+ case SCI_SETSELECTIONNEND:
+ sel.Range(wParam).caret.SetPosition(lParam);
+ Redraw();
+ break;
+
+ case SCI_GETSELECTIONNEND:
+ return sel.Range(wParam).End().Position();
+
+ case SCI_SETRECTANGULARSELECTIONCARET:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().caret.SetPosition(wParam);
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONCARET:
+ return sel.Rectangular().caret.Position();
+
+ case SCI_SETRECTANGULARSELECTIONANCHOR:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().anchor.SetPosition(wParam);
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONANCHOR:
+ return sel.Rectangular().anchor.Position();
+
+ case SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().caret.SetVirtualSpace(wParam);
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE:
+ return sel.Rectangular().caret.VirtualSpace();
+
+ case SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE:
+ if (!sel.IsRectangular())
+ sel.Clear();
+ sel.selType = Selection::selRectangle;
+ sel.Rectangular().anchor.SetVirtualSpace(wParam);
+ SetRectangularRange();
+ Redraw();
+ break;
+
+ case SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE:
+ return sel.Rectangular().anchor.VirtualSpace();
+
+ case SCI_SETVIRTUALSPACEOPTIONS:
+ virtualSpaceOptions = wParam;
+ break;
+
+ case SCI_GETVIRTUALSPACEOPTIONS:
+ return virtualSpaceOptions;
+
+ case SCI_SETADDITIONALSELFORE:
+ vs.selAdditionalForeground = ColourDesired(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETADDITIONALSELBACK:
+ vs.selAdditionalBackground = ColourDesired(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_SETADDITIONALSELALPHA:
+ vs.selAdditionalAlpha = wParam;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETADDITIONALSELALPHA:
+ return vs.selAdditionalAlpha;
+
+ case SCI_SETADDITIONALCARETFORE:
+ vs.additionalCaretColour = ColourDesired(wParam);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_GETADDITIONALCARETFORE:
+ return vs.additionalCaretColour.AsLong();
+
+ case SCI_ROTATESELECTION:
+ sel.RotateMain();
+ InvalidateSelection(sel.RangeMain(), true);
+ break;
+
+ case SCI_SWAPMAINANCHORCARET:
+ InvalidateSelection(sel.RangeMain());
+ sel.RangeMain() = SelectionRange(sel.RangeMain().anchor, sel.RangeMain().caret);
+ break;
+
+ case SCI_CHANGELEXERSTATE:
+ pdoc->ChangeLexerState(wParam, lParam);
+ break;
+
+ case SCI_SETIDENTIFIER:
+ SetCtrlID(wParam);
+ break;
+
+ case SCI_GETIDENTIFIER:
+ return GetCtrlID();
+
+ case SCI_SETTECHNOLOGY:
+ // No action by default
+ break;
+
+ case SCI_GETTECHNOLOGY:
+ return technology;
+
+ case SCI_COUNTCHARACTERS:
+ return pdoc->CountCharacters(wParam, lParam);
+
+ default:
+ return DefWndProc(iMessage, wParam, lParam);
+ }
+ //Platform::DebugPrintf("end wnd proc\n");
+ return 0l;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Editor.h b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.h
new file mode 100644
index 00000000000..2bf8336fa55
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Editor.h
@@ -0,0 +1,620 @@
+// Scintilla source code edit control
+/** @file Editor.h
+ ** Defines the main editor class.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class Timer {
+public:
+ bool ticking;
+ int ticksToWait;
+ enum {tickSize = 100};
+ TickerID tickerID;
+
+ Timer();
+};
+
+/**
+ */
+class Idler {
+public:
+ bool state;
+ IdlerID idlerID;
+
+ Idler();
+};
+
+/**
+ * When platform has a way to generate an event before painting,
+ * accumulate needed styling range and other work items in
+ * WorkNeeded to avoid unnecessary work inside paint handler
+ */
+class WorkNeeded {
+public:
+ enum workItems {
+ workNone=0,
+ workStyle=1,
+ workUpdateUI=2
+ };
+ bool active;
+ enum workItems items;
+ Position upTo;
+
+ WorkNeeded() : active(false), items(workNone), upTo(0) {}
+ void Reset() {
+ active = false;
+ items = workNone;
+ upTo = 0;
+ }
+ void Need(workItems items_, Position pos) {
+ if ((items_ & workStyle) && (upTo < pos))
+ upTo = pos;
+ items = static_cast<workItems>(items | items_);
+ }
+};
+
+/**
+ * Hold a piece of text selected for copying or dragging, along with encoding and selection format information.
+ */
+class SelectionText {
+ std::string s;
+public:
+ bool rectangular;
+ bool lineCopy;
+ int codePage;
+ int characterSet;
+ SelectionText() : rectangular(false), lineCopy(false), codePage(0), characterSet(0) {}
+ ~SelectionText() {
+ }
+ void Clear() {
+ s.clear();
+ rectangular = false;
+ lineCopy = false;
+ codePage = 0;
+ characterSet = 0;
+ }
+ void Copy(const std::string &s_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
+ s = s_;
+ codePage = codePage_;
+ characterSet = characterSet_;
+ rectangular = rectangular_;
+ lineCopy = lineCopy_;
+ FixSelectionForClipboard();
+ }
+ void Copy(const SelectionText &other) {
+ Copy(other.s, other.codePage, other.characterSet, other.rectangular, other.lineCopy);
+ }
+ const char *Data() const {
+ return s.c_str();
+ }
+ size_t Length() const {
+ return s.length();
+ }
+ size_t LengthWithTerminator() const {
+ return s.length() + 1;
+ }
+ bool Empty() const {
+ return s.empty();
+ }
+private:
+ void FixSelectionForClipboard() {
+ // To avoid truncating the contents of the clipboard when pasted where the
+ // clipboard contains NUL characters, replace NUL characters by spaces.
+ std::replace(s.begin(), s.end(), '\0', ' ');
+ }
+};
+
+struct WrapPending {
+ // The range of lines that need to be wrapped
+ enum { lineLarge = 0x7ffffff };
+ int start; // When there are wraps pending, will be in document range
+ int end; // May be lineLarge to indicate all of document after start
+ WrapPending() {
+ start = lineLarge;
+ end = lineLarge;
+ }
+ void Reset() {
+ start = lineLarge;
+ end = lineLarge;
+ }
+ void Wrapped(int line) {
+ if (start == line)
+ start++;
+ }
+ bool NeedsWrap() const {
+ return start < end;
+ }
+ bool AddRange(int lineStart, int lineEnd) {
+ const bool neededWrap = NeedsWrap();
+ bool changed = false;
+ if (start > lineStart) {
+ start = lineStart;
+ changed = true;
+ }
+ if ((end < lineEnd) || !neededWrap) {
+ end = lineEnd;
+ changed = true;
+ }
+ return changed;
+ }
+};
+
+/**
+ */
+class Editor : public EditModel, public DocWatcher {
+ // Private so Editor objects can not be copied
+ explicit Editor(const Editor &);
+ Editor &operator=(const Editor &);
+
+protected: // ScintillaBase subclass needs access to much of Editor
+
+ /** On GTK+, Scintilla is a container widget holding two scroll bars
+ * whereas on Windows there is just one window with both scroll bars turned on. */
+ Window wMain; ///< The Scintilla parent window
+ Window wMargin; ///< May be separate when using a scroll view for wMain
+
+ /** Style resources may be expensive to allocate so are cached between uses.
+ * When a style attribute is changed, this cache is flushed. */
+ bool stylesValid;
+ ViewStyle vs;
+ int technology;
+ Point sizeRGBAImage;
+ float scaleRGBAImage;
+
+ MarginView marginView;
+ EditView view;
+
+ int cursorMode;
+
+ bool hasFocus;
+ bool mouseDownCaptures;
+
+ int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret
+ bool horizontalScrollBarVisible;
+ int scrollWidth;
+ bool verticalScrollBarVisible;
+ bool endAtLastLine;
+ int caretSticky;
+ int marginOptions;
+ bool mouseSelectionRectangularSwitch;
+ bool multipleSelection;
+ bool additionalSelectionTyping;
+ int multiPasteMode;
+
+ int virtualSpaceOptions;
+
+ KeyMap kmap;
+
+ Timer timer;
+ Timer autoScrollTimer;
+ enum { autoScrollDelay = 200 };
+
+ Idler idler;
+
+ Point lastClick;
+ unsigned int lastClickTime;
+ Point doubleClickCloseThreshold;
+ int dwellDelay;
+ int ticksToDwell;
+ bool dwelling;
+ enum { selChar, selWord, selSubLine, selWholeLine } selectionType;
+ Point ptMouseLast;
+ enum { ddNone, ddInitial, ddDragging } inDragDrop;
+ bool dropWentOutside;
+ SelectionPosition posDrop;
+ int hotSpotClickPos;
+ int lastXChosen;
+ int lineAnchorPos;
+ int originalAnchorPos;
+ int wordSelectAnchorStartPos;
+ int wordSelectAnchorEndPos;
+ int wordSelectInitialCaretPos;
+ int targetStart;
+ int targetEnd;
+ int searchFlags;
+ int topLine;
+ int posTopLine;
+ int lengthForEncode;
+
+ int needUpdateUI;
+
+ enum { notPainting, painting, paintAbandoned } paintState;
+ bool paintAbandonedByStyling;
+ PRectangle rcPaint;
+ bool paintingAllText;
+ bool willRedrawAll;
+ WorkNeeded workNeeded;
+
+ int modEventMask;
+
+ SelectionText drag;
+
+ int caretXPolicy;
+ int caretXSlop; ///< Ensure this many pixels visible on both sides of caret
+
+ int caretYPolicy;
+ int caretYSlop; ///< Ensure this many lines visible on both sides of caret
+
+ int visiblePolicy;
+ int visibleSlop;
+
+ int searchAnchor;
+
+ bool recordingMacro;
+
+ int foldAutomatic;
+
+ // Wrapping support
+ WrapPending wrapPending;
+
+ bool convertPastes;
+
+ Editor();
+ virtual ~Editor();
+ virtual void Initialise() = 0;
+ virtual void Finalise();
+
+ void InvalidateStyleData();
+ void InvalidateStyleRedraw();
+ void RefreshStyleData();
+ void SetRepresentations();
+ void DropGraphics(bool freeObjects);
+ void AllocateGraphics();
+
+ // The top left visible point in main window coordinates. Will be 0,0 except for
+ // scroll views where it will be equivalent to the current scroll position.
+ virtual Point GetVisibleOriginInMain() const;
+ Point DocumentPointFromView(Point ptView) const; // Convert a point from view space to document
+ int TopLineOfMain() const; // Return the line at Main's y coordinate 0
+ virtual PRectangle GetClientRectangle() const;
+ virtual PRectangle GetClientDrawingRectangle();
+ PRectangle GetTextRectangle() const;
+
+ virtual int LinesOnScreen() const;
+ int LinesToScroll() const;
+ int MaxScrollPos() const;
+ SelectionPosition ClampPositionIntoDocument(SelectionPosition sp) const;
+ Point LocationFromPosition(SelectionPosition pos);
+ Point LocationFromPosition(int pos);
+ int XFromPosition(int pos);
+ int XFromPosition(SelectionPosition sp);
+ SelectionPosition SPositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false, bool virtualSpace=true);
+ int PositionFromLocation(Point pt, bool canReturnInvalid = false, bool charPosition = false);
+ SelectionPosition SPositionFromLineX(int lineDoc, int x);
+ int PositionFromLineX(int line, int x);
+ int LineFromLocation(Point pt) const;
+ void SetTopLine(int topLineNew);
+
+ virtual bool AbandonPaint();
+ virtual void RedrawRect(PRectangle rc);
+ virtual void DiscardOverdraw();
+ virtual void Redraw();
+ void RedrawSelMargin(int line=-1, bool allAfter=false);
+ PRectangle RectangleFromRange(Range r, int overlap);
+ void InvalidateRange(int start, int end);
+
+ bool UserVirtualSpace() const {
+ return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
+ }
+ int CurrentPosition() const;
+ bool SelectionEmpty() const;
+ SelectionPosition SelectionStart();
+ SelectionPosition SelectionEnd();
+ void SetRectangularRange();
+ void ThinRectangularRange();
+ void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false);
+ void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_);
+ void SetSelection(int currentPos_, int anchor_);
+ void SetSelection(SelectionPosition currentPos_);
+ void SetSelection(int currentPos_);
+ void SetEmptySelection(SelectionPosition currentPos_);
+ void SetEmptySelection(int currentPos_);
+ bool RangeContainsProtected(int start, int end) const;
+ bool SelectionContainsProtected();
+ int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const;
+ SelectionPosition MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd=true) const;
+ int MovePositionTo(SelectionPosition newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true);
+ int MovePositionTo(int newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true);
+ SelectionPosition MovePositionSoVisible(SelectionPosition pos, int moveDir);
+ SelectionPosition MovePositionSoVisible(int pos, int moveDir);
+ Point PointMainCaret();
+ void SetLastXChosen();
+
+ void ScrollTo(int line, bool moveThumb=true);
+ virtual void ScrollText(int linesToMove);
+ void HorizontalScrollTo(int xPos);
+ void VerticalCentreCaret();
+ void MoveSelectedLines(int lineDelta);
+ void MoveSelectedLinesUp();
+ void MoveSelectedLinesDown();
+ void MoveCaretInsideView(bool ensureVisible=true);
+ int DisplayFromPosition(int pos);
+
+ struct XYScrollPosition {
+ int xOffset;
+ int topLine;
+ XYScrollPosition(int xOffset_, int topLine_) : xOffset(xOffset_), topLine(topLine_) {}
+ bool operator==(const XYScrollPosition &other) const {
+ return (xOffset == other.xOffset) && (topLine == other.topLine);
+ }
+ };
+ enum XYScrollOptions {
+ xysUseMargin=0x1,
+ xysVertical=0x2,
+ xysHorizontal=0x4,
+ xysDefault=xysUseMargin|xysVertical|xysHorizontal};
+ XYScrollPosition XYScrollToMakeVisible(const SelectionRange &range, const XYScrollOptions options);
+ void SetXYScroll(XYScrollPosition newXY);
+ void EnsureCaretVisible(bool useMargin=true, bool vert=true, bool horiz=true);
+ void ScrollRange(SelectionRange range);
+ void ShowCaretAtCurrentPosition();
+ void DropCaret();
+ void CaretSetPeriod(int period);
+ void InvalidateCaret();
+ virtual void UpdateSystemCaret();
+
+ bool Wrapping() const;
+ void NeedWrapping(int docLineStart=0, int docLineEnd=WrapPending::lineLarge);
+ bool WrapOneLine(Surface *surface, int lineToWrap);
+ enum wrapScope {wsAll, wsVisible, wsIdle};
+ bool WrapLines(enum wrapScope ws);
+ void LinesJoin();
+ void LinesSplit(int pixelWidth);
+
+ void PaintSelMargin(Surface *surface, PRectangle &rc);
+ void RefreshPixMaps(Surface *surfaceWindow);
+ void Paint(Surface *surfaceWindow, PRectangle rcArea);
+ long FormatRange(bool draw, Sci_RangeToFormat *pfr);
+ int TextWidth(int style, const char *text);
+
+ virtual void SetVerticalScrollPos() = 0;
+ virtual void SetHorizontalScrollPos() = 0;
+ virtual bool ModifyScrollBars(int nMax, int nPage) = 0;
+ virtual void ReconfigureScrollBars();
+ void SetScrollBars();
+ void ChangeSize();
+
+ void FilterSelections();
+ int InsertSpace(int position, unsigned int spaces);
+ void AddChar(char ch);
+ virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
+ void FillVirtualSpace();
+ void InsertPaste(const char *text, int len);
+ enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 };
+ void InsertPasteShape(const char *text, int len, PasteShape shape);
+ void ClearSelection(bool retainMultipleSelections = false);
+ void ClearAll();
+ void ClearDocumentStyle();
+ void Cut();
+ void PasteRectangular(SelectionPosition pos, const char *ptr, int len);
+ virtual void Copy() = 0;
+ virtual void CopyAllowLine();
+ virtual bool CanPaste();
+ virtual void Paste() = 0;
+ void Clear();
+ void SelectAll();
+ void Undo();
+ void Redo();
+ void DelCharBack(bool allowLineStartDeletion);
+ virtual void ClaimSelection() = 0;
+
+ static int ModifierFlags(bool shift, bool ctrl, bool alt, bool meta=false);
+ virtual void NotifyChange() = 0;
+ virtual void NotifyFocus(bool focus);
+ virtual void SetCtrlID(int identifier);
+ virtual int GetCtrlID() { return ctrlID; }
+ virtual void NotifyParent(SCNotification scn) = 0;
+ virtual void NotifyStyleToNeeded(int endStyleNeeded);
+ void NotifyChar(int ch);
+ void NotifySavePoint(bool isSavePoint);
+ void NotifyModifyAttempt();
+ virtual void NotifyDoubleClick(Point pt, int modifiers);
+ virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt);
+ void NotifyHotSpotClicked(int position, int modifiers);
+ void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt);
+ void NotifyHotSpotDoubleClicked(int position, int modifiers);
+ void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt);
+ void NotifyHotSpotReleaseClick(int position, int modifiers);
+ void NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt);
+ bool NotifyUpdateUI();
+ void NotifyPainted();
+ void NotifyIndicatorClick(bool click, int position, int modifiers);
+ void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt);
+ bool NotifyMarginClick(Point pt, int modifiers);
+ bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
+ void NotifyNeedShown(int pos, int len);
+ void NotifyDwelling(Point pt, bool state);
+ void NotifyZoom();
+
+ void NotifyModifyAttempt(Document *document, void *userData);
+ void NotifySavePoint(Document *document, void *userData, bool atSavePoint);
+ void CheckModificationForWrap(DocModification mh);
+ void NotifyModified(Document *document, DocModification mh, void *userData);
+ void NotifyDeleted(Document *document, void *userData);
+ void NotifyStyleNeeded(Document *doc, void *userData, int endPos);
+ void NotifyLexerChanged(Document *doc, void *userData);
+ void NotifyErrorOccurred(Document *doc, void *userData, int status);
+ void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ void ContainerNeedsUpdate(int flags);
+ void PageMove(int direction, Selection::selTypes selt=Selection::noSel, bool stuttered = false);
+ enum { cmSame, cmUpper, cmLower };
+ virtual std::string CaseMapString(const std::string &s, int caseMapping);
+ void ChangeCaseOfSelection(int caseMapping);
+ void LineTranspose();
+ void Duplicate(bool forLine);
+ virtual void CancelModes();
+ void NewLine();
+ void CursorUpOrDown(int direction, Selection::selTypes selt=Selection::noSel);
+ void ParaUpOrDown(int direction, Selection::selTypes selt=Selection::noSel);
+ int StartEndDisplayLine(int pos, bool start);
+ virtual int KeyCommand(unsigned int iMessage);
+ virtual int KeyDefault(int /* key */, int /*modifiers*/);
+ int KeyDownWithModifiers(int key, int modifiers, bool *consumed);
+ int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0);
+
+ void Indent(bool forwards);
+
+ virtual CaseFolder *CaseFolderForEncoding();
+ long FindText(uptr_t wParam, sptr_t lParam);
+ void SearchAnchor();
+ long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ long SearchInTarget(const char *text, int length);
+ void GoToLine(int lineNo);
+
+ virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
+ std::string RangeText(int start, int end) const;
+ void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false);
+ void CopyRangeToClipboard(int start, int end);
+ void CopyText(int length, const char *text);
+ void SetDragPosition(SelectionPosition newPos);
+ virtual void DisplayCursor(Window::Cursor c);
+ virtual bool DragThreshold(Point ptStart, Point ptNow);
+ virtual void StartDrag();
+ void DropAt(SelectionPosition position, const char *value, size_t lengthValue, bool moving, bool rectangular);
+ void DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular);
+ /** PositionInSelection returns true if position in selection. */
+ bool PositionInSelection(int pos);
+ bool PointInSelection(Point pt);
+ bool PointInSelMargin(Point pt) const;
+ Window::Cursor GetMarginCursor(Point pt) const;
+ void TrimAndSetSelection(int currentPos_, int anchor_);
+ void LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine);
+ void WordSelection(int pos);
+ void DwellEnd(bool mouseMoved);
+ void MouseLeave();
+ virtual void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers);
+ virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
+ void ButtonMoveWithModifiers(Point pt, int modifiers);
+ void ButtonMove(Point pt);
+ void ButtonUp(Point pt, unsigned int curTime, bool ctrl);
+
+ void Tick();
+ bool Idle();
+ virtual void SetTicking(bool on);
+ enum TickReason { tickCaret, tickScroll, tickWiden, tickDwell, tickPlatform };
+ virtual void TickFor(TickReason reason);
+ virtual bool FineTickerAvailable();
+ virtual bool FineTickerRunning(TickReason reason);
+ virtual void FineTickerStart(TickReason reason, int millis, int tolerance);
+ virtual void FineTickerCancel(TickReason reason);
+ virtual bool SetIdle(bool) { return false; }
+ virtual void SetMouseCapture(bool on) = 0;
+ virtual bool HaveMouseCapture() = 0;
+ void SetFocusState(bool focusState);
+
+ int PositionAfterArea(PRectangle rcArea) const;
+ void StyleToPositionInView(Position pos);
+ virtual void IdleWork();
+ virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo=0);
+
+ virtual bool PaintContains(PRectangle rc);
+ bool PaintContainsMargin();
+ void CheckForChangeOutsidePaint(Range r);
+ void SetBraceHighlight(Position pos0, Position pos1, int matchStyle);
+
+ void SetAnnotationHeights(int start, int end);
+ virtual void SetDocPointer(Document *document);
+
+ void SetAnnotationVisible(int visible);
+
+ int ExpandLine(int line);
+ void SetFoldExpanded(int lineDoc, bool expanded);
+ void FoldLine(int line, int action);
+ void FoldExpand(int line, int action, int level);
+ int ContractedFoldNext(int lineStart) const;
+ void EnsureLineVisible(int lineDoc, bool enforcePolicy);
+ void FoldChanged(int line, int levelNow, int levelPrev);
+ void NeedShown(int pos, int len);
+ void FoldAll(int action);
+
+ int GetTag(char *tagValue, int tagNumber);
+ int ReplaceTarget(bool replacePatterns, const char *text, int length=-1);
+
+ bool PositionIsHotspot(int position) const;
+ bool PointIsHotspot(Point pt);
+ void SetHotSpotRange(Point *pt);
+ Range GetHotSpotRange() const;
+ void SetHoverIndicatorPosition(int position);
+ void SetHoverIndicatorPoint(Point pt);
+
+ int CodePage() const;
+ virtual bool ValidCodePage(int /* codePage */) const { return true; }
+ int WrapCount(int line);
+ void AddStyledText(char *buffer, int appendLength);
+
+ virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;
+ void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ static const char *StringFromEOLMode(int eolMode);
+
+ static sptr_t StringResult(sptr_t lParam, const char *val);
+ static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);
+
+public:
+ // Public so the COM thunks can access it.
+ bool IsUnicodeMode() const;
+ // Public so scintilla_send_message can use it.
+ virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ // Public so scintilla_set_id can use it.
+ int ctrlID;
+ // Public so COM methods for drag and drop can set it.
+ int errorStatus;
+ friend class AutoSurface;
+ friend class SelectionLineIterator;
+};
+
+/**
+ * A smart pointer class to ensure Surfaces are set up and deleted correctly.
+ */
+class AutoSurface {
+private:
+ Surface *surf;
+public:
+ AutoSurface(Editor *ed, int technology = -1) : surf(0) {
+ if (ed->wMain.GetID()) {
+ surf = Surface::Allocate(technology != -1 ? technology : ed->technology);
+ if (surf) {
+ surf->Init(ed->wMain.GetID());
+ surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
+ surf->SetDBCSMode(ed->CodePage());
+ }
+ }
+ }
+ AutoSurface(SurfaceID sid, Editor *ed, int technology = -1) : surf(0) {
+ if (ed->wMain.GetID()) {
+ surf = Surface::Allocate(technology != -1 ? technology : ed->technology);
+ if (surf) {
+ surf->Init(sid, ed->wMain.GetID());
+ surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
+ surf->SetDBCSMode(ed->CodePage());
+ }
+ }
+ }
+ ~AutoSurface() {
+ delete surf;
+ }
+ Surface *operator->() const {
+ return surf;
+ }
+ operator Surface *() const {
+ return surf;
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.cxx
new file mode 100644
index 00000000000..25d83ceb8b6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.cxx
@@ -0,0 +1,191 @@
+// Scintilla source code edit control
+/** @file ExternalLexer.cxx
+ ** Support external lexers in DLLs.
+ **/
+// Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson.
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "LexerModule.h"
+#include "Catalogue.h"
+#include "ExternalLexer.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LexerManager *LexerManager::theInstance = NULL;
+
+//------------------------------------------
+//
+// ExternalLexerModule
+//
+//------------------------------------------
+
+void ExternalLexerModule::SetExternal(GetLexerFactoryFunction fFactory, int index) {
+ fneFactory = fFactory;
+ fnFactory = fFactory(index);
+}
+
+//------------------------------------------
+//
+// LexerLibrary
+//
+//------------------------------------------
+
+LexerLibrary::LexerLibrary(const char *ModuleName) {
+ // Initialise some members...
+ first = NULL;
+ last = NULL;
+
+ // Load the DLL
+ lib = DynamicLibrary::Load(ModuleName);
+ if (lib->IsValid()) {
+ m_sModuleName = ModuleName;
+ //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects
+ GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount");
+
+ if (GetLexerCount) {
+ ExternalLexerModule *lex;
+ LexerMinder *lm;
+
+ // Find functions in the DLL
+ GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName");
+ GetLexerFactoryFunction fnFactory = (GetLexerFactoryFunction)(sptr_t)lib->FindFunction("GetLexerFactory");
+
+ int nl = GetLexerCount();
+
+ for (int i = 0; i < nl; i++) {
+ // Assign a buffer for the lexer name.
+ char lexname[100] = "";
+ GetLexerName(i, lexname, sizeof(lexname));
+ lex = new ExternalLexerModule(SCLEX_AUTOMATIC, NULL, lexname, NULL);
+ Catalogue::AddLexerModule(lex);
+
+ // Create a LexerMinder so we don't leak the ExternalLexerModule...
+ lm = new LexerMinder;
+ lm->self = lex;
+ lm->next = NULL;
+ if (first != NULL) {
+ last->next = lm;
+ last = lm;
+ } else {
+ first = lm;
+ last = lm;
+ }
+
+ // The external lexer needs to know how to call into its DLL to
+ // do its lexing and folding, we tell it here.
+ lex->SetExternal(fnFactory, i);
+ }
+ }
+ }
+ next = NULL;
+}
+
+LexerLibrary::~LexerLibrary() {
+ Release();
+ delete lib;
+}
+
+void LexerLibrary::Release() {
+ LexerMinder *lm;
+ LexerMinder *lmNext;
+ lm = first;
+ while (NULL != lm) {
+ lmNext = lm->next;
+ delete lm->self;
+ delete lm;
+ lm = lmNext;
+ }
+
+ first = NULL;
+ last = NULL;
+}
+
+//------------------------------------------
+//
+// LexerManager
+//
+//------------------------------------------
+
+/// Return the single LexerManager instance...
+LexerManager *LexerManager::GetInstance() {
+ if (!theInstance)
+ theInstance = new LexerManager;
+ return theInstance;
+}
+
+/// Delete any LexerManager instance...
+void LexerManager::DeleteInstance() {
+ delete theInstance;
+ theInstance = NULL;
+}
+
+/// protected constructor - this is a singleton...
+LexerManager::LexerManager() {
+ first = NULL;
+ last = NULL;
+}
+
+LexerManager::~LexerManager() {
+ Clear();
+}
+
+void LexerManager::Load(const char *path) {
+ LoadLexerLibrary(path);
+}
+
+void LexerManager::LoadLexerLibrary(const char *module) {
+ for (LexerLibrary *ll = first; ll; ll= ll->next) {
+ if (strcmp(ll->m_sModuleName.c_str(), module) == 0)
+ return;
+ }
+ LexerLibrary *lib = new LexerLibrary(module);
+ if (NULL != first) {
+ last->next = lib;
+ last = lib;
+ } else {
+ first = lib;
+ last = lib;
+ }
+}
+
+void LexerManager::Clear() {
+ if (NULL != first) {
+ LexerLibrary *cur = first;
+ LexerLibrary *next;
+ while (cur) {
+ next = cur->next;
+ delete cur;
+ cur = next;
+ }
+ first = NULL;
+ last = NULL;
+ }
+}
+
+//------------------------------------------
+//
+// LexerManager
+//
+//------------------------------------------
+
+LMMinder::~LMMinder() {
+ LexerManager::DeleteInstance();
+}
+
+LMMinder minder;
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.h b/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.h
new file mode 100644
index 00000000000..a85213e31be
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ExternalLexer.h
@@ -0,0 +1,92 @@
+// Scintilla source code edit control
+/** @file ExternalLexer.h
+ ** Support external lexers in DLLs.
+ **/
+// Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson.
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef EXTERNALLEXER_H
+#define EXTERNALLEXER_H
+
+#if PLAT_WIN
+#define EXT_LEXER_DECL __stdcall
+#else
+#define EXT_LEXER_DECL
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+typedef void*(EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index);
+typedef int (EXT_LEXER_DECL *GetLexerCountFn)();
+typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
+typedef LexerFactoryFunction(EXT_LEXER_DECL *GetLexerFactoryFunction)(unsigned int Index);
+
+/// Sub-class of LexerModule to use an external lexer.
+class ExternalLexerModule : public LexerModule {
+protected:
+ GetLexerFactoryFunction fneFactory;
+ std::string name;
+public:
+ ExternalLexerModule(int language_, LexerFunction fnLexer_,
+ const char *languageName_=0, LexerFunction fnFolder_=0) :
+ LexerModule(language_, fnLexer_, 0, fnFolder_),
+ fneFactory(0), name(languageName_){
+ languageName = name.c_str();
+ }
+ virtual void SetExternal(GetLexerFactoryFunction fFactory, int index);
+};
+
+/// LexerMinder points to an ExternalLexerModule - so we don't leak them.
+class LexerMinder {
+public:
+ ExternalLexerModule *self;
+ LexerMinder *next;
+};
+
+/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders.
+class LexerLibrary {
+ DynamicLibrary *lib;
+ LexerMinder *first;
+ LexerMinder *last;
+
+public:
+ explicit LexerLibrary(const char *ModuleName);
+ ~LexerLibrary();
+ void Release();
+
+ LexerLibrary *next;
+ std::string m_sModuleName;
+};
+
+/// LexerManager manages external lexers, contains LexerLibrarys.
+class LexerManager {
+public:
+ ~LexerManager();
+
+ static LexerManager *GetInstance();
+ static void DeleteInstance();
+
+ void Load(const char *path);
+ void Clear();
+
+private:
+ LexerManager();
+ static LexerManager *theInstance;
+
+ void LoadLexerLibrary(const char *module);
+ LexerLibrary *first;
+ LexerLibrary *last;
+};
+
+class LMMinder {
+public:
+ ~LMMinder();
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/FontQuality.h b/3rdparty/bgfx/3rdparty/scintilla/src/FontQuality.h
new file mode 100644
index 00000000000..a0ae207f8aa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/FontQuality.h
@@ -0,0 +1,31 @@
+// Scintilla source code edit control
+/** @file FontQuality.h
+ ** Definitions to control font anti-aliasing.
+ ** Redefine constants from Scintilla.h to avoid including Scintilla.h in PlatWin.cxx.
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef FONTQUALITY_H
+#define FONTQUALITY_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+// These definitions match Scintilla.h
+#define SC_EFF_QUALITY_MASK 0xF
+#define SC_EFF_QUALITY_DEFAULT 0
+#define SC_EFF_QUALITY_NON_ANTIALIASED 1
+#define SC_EFF_QUALITY_ANTIALIASED 2
+#define SC_EFF_QUALITY_LCD_OPTIMIZED 3
+
+// These definitions must match SC_TECHNOLOGY_* in Scintilla.h
+#define SCWIN_TECH_GDI 0
+#define SCWIN_TECH_DIRECTWRITE 1
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.cxx
new file mode 100644
index 00000000000..62df0b7161a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.cxx
@@ -0,0 +1,180 @@
+// Scintilla source code edit control
+/** @file Indicator.cxx
+ ** Defines the style of indicators which are text decorations such as underlining.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <vector>
+#include <map>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "Indicator.h"
+#include "XPM.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static PRectangle PixelGridAlign(const PRectangle &rc) {
+ // Move left and right side to nearest pixel to avoid blurry visuals
+ return PRectangle::FromInts(int(rc.left + 0.5), int(rc.top), int(rc.right + 0.5), int(rc.bottom));
+}
+
+void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, DrawState drawState, int value) const {
+ StyleAndColour sacDraw = sacNormal;
+ if (Flags() & SC_INDICFLAG_VALUEFORE) {
+ sacDraw.fore = value & SC_INDICVALUEMASK;
+ }
+ if (drawState == drawHover) {
+ sacDraw = sacHover;
+ }
+ surface->PenColour(sacDraw.fore);
+ int ymid = static_cast<int>(rc.bottom + rc.top) / 2;
+ if (sacDraw.style == INDIC_SQUIGGLE) {
+ int x = int(rc.left+0.5);
+ int xLast = int(rc.right+0.5);
+ int y = 0;
+ surface->MoveTo(x, static_cast<int>(rc.top) + y);
+ while (x < xLast) {
+ if ((x + 2) > xLast) {
+ if (xLast > x)
+ y = 1;
+ x = xLast;
+ } else {
+ x += 2;
+ y = 2 - y;
+ }
+ surface->LineTo(x, static_cast<int>(rc.top) + y);
+ }
+ } else if (sacDraw.style == INDIC_SQUIGGLEPIXMAP) {
+ PRectangle rcSquiggle = PixelGridAlign(rc);
+
+ int width = Platform::Minimum(4000, static_cast<int>(rcSquiggle.Width()));
+ RGBAImage image(width, 3, 1.0, 0);
+ enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f };
+ for (int x = 0; x < width; x++) {
+ if (x%2) {
+ // Two halfway columns have a full pixel in middle flanked by light pixels
+ image.SetPixel(x, 0, sacDraw.fore, alphaSide);
+ image.SetPixel(x, 1, sacDraw.fore, alphaFull);
+ image.SetPixel(x, 2, sacDraw.fore, alphaSide);
+ } else {
+ // Extreme columns have a full pixel at bottom or top and a mid-tone pixel in centre
+ image.SetPixel(x, (x % 4) ? 0 : 2, sacDraw.fore, alphaFull);
+ image.SetPixel(x, 1, sacDraw.fore, alphaSide2);
+ }
+ }
+ surface->DrawRGBAImage(rcSquiggle, image.GetWidth(), image.GetHeight(), image.Pixels());
+ } else if (sacDraw.style == INDIC_SQUIGGLELOW) {
+ surface->MoveTo(static_cast<int>(rc.left), static_cast<int>(rc.top));
+ int x = static_cast<int>(rc.left) + 3;
+ int y = 0;
+ while (x < rc.right) {
+ surface->LineTo(x - 1, static_cast<int>(rc.top) + y);
+ y = 1 - y;
+ surface->LineTo(x, static_cast<int>(rc.top) + y);
+ x += 3;
+ }
+ surface->LineTo(static_cast<int>(rc.right), static_cast<int>(rc.top) + y); // Finish the line
+ } else if (sacDraw.style == INDIC_TT) {
+ surface->MoveTo(static_cast<int>(rc.left), ymid);
+ int x = static_cast<int>(rc.left) + 5;
+ while (x < rc.right) {
+ surface->LineTo(x, ymid);
+ surface->MoveTo(x-3, ymid);
+ surface->LineTo(x-3, ymid+2);
+ x++;
+ surface->MoveTo(x, ymid);
+ x += 5;
+ }
+ surface->LineTo(static_cast<int>(rc.right), ymid); // Finish the line
+ if (x - 3 <= rc.right) {
+ surface->MoveTo(x-3, ymid);
+ surface->LineTo(x-3, ymid+2);
+ }
+ } else if (sacDraw.style == INDIC_DIAGONAL) {
+ int x = static_cast<int>(rc.left);
+ while (x < rc.right) {
+ surface->MoveTo(x, static_cast<int>(rc.top) + 2);
+ int endX = x+3;
+ int endY = static_cast<int>(rc.top) - 1;
+ if (endX > rc.right) {
+ endY += endX - static_cast<int>(rc.right);
+ endX = static_cast<int>(rc.right);
+ }
+ surface->LineTo(endX, endY);
+ x += 4;
+ }
+ } else if (sacDraw.style == INDIC_STRIKE) {
+ surface->MoveTo(static_cast<int>(rc.left), static_cast<int>(rc.top) - 4);
+ surface->LineTo(static_cast<int>(rc.right), static_cast<int>(rc.top) - 4);
+ } else if ((sacDraw.style == INDIC_HIDDEN) || (sacDraw.style == INDIC_TEXTFORE)) {
+ // Draw nothing
+ } else if (sacDraw.style == INDIC_BOX) {
+ surface->MoveTo(static_cast<int>(rc.left), ymid + 1);
+ surface->LineTo(static_cast<int>(rc.right), ymid + 1);
+ surface->LineTo(static_cast<int>(rc.right), static_cast<int>(rcLine.top) + 1);
+ surface->LineTo(static_cast<int>(rc.left), static_cast<int>(rcLine.top) + 1);
+ surface->LineTo(static_cast<int>(rc.left), ymid + 1);
+ } else if (sacDraw.style == INDIC_ROUNDBOX ||
+ sacDraw.style == INDIC_STRAIGHTBOX ||
+ sacDraw.style == INDIC_FULLBOX) {
+ PRectangle rcBox = rcLine;
+ if (sacDraw.style != INDIC_FULLBOX)
+ rcBox.top = rcLine.top + 1;
+ rcBox.left = rc.left;
+ rcBox.right = rc.right;
+ surface->AlphaRectangle(rcBox, (sacDraw.style == INDIC_ROUNDBOX) ? 1 : 0,
+ sacDraw.fore, fillAlpha, sacDraw.fore, outlineAlpha, 0);
+ } else if (sacDraw.style == INDIC_DOTBOX) {
+ PRectangle rcBox = PixelGridAlign(rc);
+ rcBox.top = rcLine.top + 1;
+ rcBox.bottom = rcLine.bottom;
+ // Cap width at 4000 to avoid large allocations when mistakes made
+ int width = Platform::Minimum(static_cast<int>(rcBox.Width()), 4000);
+ RGBAImage image(width, static_cast<int>(rcBox.Height()), 1.0, 0);
+ // Draw horizontal lines top and bottom
+ for (int x=0; x<width; x++) {
+ for (int y = 0; y<static_cast<int>(rcBox.Height()); y += static_cast<int>(rcBox.Height()) - 1) {
+ image.SetPixel(x, y, sacDraw.fore, ((x + y) % 2) ? outlineAlpha : fillAlpha);
+ }
+ }
+ // Draw vertical lines left and right
+ for (int y = 1; y<static_cast<int>(rcBox.Height()); y++) {
+ for (int x=0; x<width; x += width-1) {
+ image.SetPixel(x, y, sacDraw.fore, ((x + y) % 2) ? outlineAlpha : fillAlpha);
+ }
+ }
+ surface->DrawRGBAImage(rcBox, image.GetWidth(), image.GetHeight(), image.Pixels());
+ } else if (sacDraw.style == INDIC_DASH) {
+ int x = static_cast<int>(rc.left);
+ while (x < rc.right) {
+ surface->MoveTo(x, ymid);
+ surface->LineTo(Platform::Minimum(x + 4, static_cast<int>(rc.right)), ymid);
+ x += 7;
+ }
+ } else if (sacDraw.style == INDIC_DOTS) {
+ int x = static_cast<int>(rc.left);
+ while (x < static_cast<int>(rc.right)) {
+ PRectangle rcDot = PRectangle::FromInts(x, ymid, x + 1, ymid + 1);
+ surface->FillRectangle(rcDot, sacDraw.fore);
+ x += 2;
+ }
+ } else if (sacDraw.style == INDIC_COMPOSITIONTHICK) {
+ PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom);
+ surface->FillRectangle(rcComposition, sacDraw.fore);
+ } else if (sacDraw.style == INDIC_COMPOSITIONTHIN) {
+ PRectangle rcComposition(rc.left+1, rcLine.bottom-2, rc.right-1, rcLine.bottom-1);
+ surface->FillRectangle(rcComposition, sacDraw.fore);
+ } else { // Either INDIC_PLAIN or unknown
+ surface->MoveTo(static_cast<int>(rc.left), ymid);
+ surface->LineTo(static_cast<int>(rc.right), ymid);
+ }
+}
+
+void Indicator::SetFlags(int attributes_) {
+ attributes = attributes_;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.h b/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.h
new file mode 100644
index 00000000000..c22ec71c64f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Indicator.h
@@ -0,0 +1,60 @@
+// Scintilla source code edit control
+/** @file Indicator.h
+ ** Defines the style of indicators which are text decorations such as underlining.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef INDICATOR_H
+#define INDICATOR_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+struct StyleAndColour {
+ int style;
+ ColourDesired fore;
+ StyleAndColour() : style(INDIC_PLAIN), fore(0, 0, 0) {
+ }
+ StyleAndColour(int style_, ColourDesired fore_ = ColourDesired(0, 0, 0)) : style(style_), fore(fore_) {
+ }
+ bool operator==(const StyleAndColour &other) const {
+ return (style == other.style) && (fore == other.fore);
+ }
+};
+
+/**
+ */
+class Indicator {
+public:
+ enum DrawState { drawNormal, drawHover };
+ StyleAndColour sacNormal;
+ StyleAndColour sacHover;
+ bool under;
+ int fillAlpha;
+ int outlineAlpha;
+ int attributes;
+ Indicator() : under(false), fillAlpha(30), outlineAlpha(50), attributes(0) {
+ }
+ Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) :
+ sacNormal(style_, fore_), sacHover(style_, fore_), under(under_), fillAlpha(fillAlpha_), outlineAlpha(outlineAlpha_), attributes(0) {
+ }
+ void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, DrawState drawState, int value) const;
+ bool IsDynamic() const {
+ return !(sacNormal == sacHover);
+ }
+ bool OverridesTextFore() const {
+ return sacNormal.style == INDIC_TEXTFORE || sacHover.style == INDIC_TEXTFORE;
+ }
+ int Flags() const {
+ return attributes;
+ }
+ void SetFlags(int attributes_);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.cxx
new file mode 100644
index 00000000000..cb6f2b8d41d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.cxx
@@ -0,0 +1,160 @@
+// Scintilla source code edit control
+/** @file KeyMap.cxx
+ ** Defines a mapping between keystrokes and commands.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+
+#include <vector>
+#include <map>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+
+#include "KeyMap.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+KeyMap::KeyMap() {
+ for (int i = 0; MapDefault[i].key; i++) {
+ AssignCmdKey(MapDefault[i].key,
+ MapDefault[i].modifiers,
+ MapDefault[i].msg);
+ }
+}
+
+KeyMap::~KeyMap() {
+ Clear();
+}
+
+void KeyMap::Clear() {
+ kmap.clear();
+}
+
+void KeyMap::AssignCmdKey(int key, int modifiers, unsigned int msg) {
+ kmap[KeyModifiers(key, modifiers)] = msg;
+}
+
+unsigned int KeyMap::Find(int key, int modifiers) const {
+ std::map<KeyModifiers, unsigned int>::const_iterator it = kmap.find(KeyModifiers(key, modifiers));
+ return (it == kmap.end()) ? 0 : it->second;
+}
+
+#if PLAT_GTK_MACOSX
+#define OS_X_KEYS 1
+#else
+#define OS_X_KEYS 0
+#endif
+
+// Define a modifier that is exactly Ctrl key on all platforms
+// Most uses of Ctrl map to Cmd on OS X but some can't so use SCI_[S]CTRL_META
+#if OS_X_KEYS
+#define SCI_CTRL_META SCI_META
+#define SCI_SCTRL_META (SCI_META | SCI_SHIFT)
+#else
+#define SCI_CTRL_META SCI_CTRL
+#define SCI_SCTRL_META (SCI_CTRL | SCI_SHIFT)
+#endif
+
+const KeyToCommand KeyMap::MapDefault[] = {
+
+#if OS_X_KEYS
+ {SCK_DOWN, SCI_CTRL, SCI_DOCUMENTEND},
+ {SCK_DOWN, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND},
+ {SCK_UP, SCI_CTRL, SCI_DOCUMENTSTART},
+ {SCK_UP, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND},
+ {SCK_LEFT, SCI_CTRL, SCI_VCHOME},
+ {SCK_LEFT, SCI_CSHIFT, SCI_VCHOMEEXTEND},
+ {SCK_RIGHT, SCI_CTRL, SCI_LINEEND},
+ {SCK_RIGHT, SCI_CSHIFT, SCI_LINEENDEXTEND},
+#endif
+
+ {SCK_DOWN, SCI_NORM, SCI_LINEDOWN},
+ {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
+ {SCK_DOWN, SCI_CTRL_META, SCI_LINESCROLLDOWN},
+ {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND},
+ {SCK_UP, SCI_NORM, SCI_LINEUP},
+ {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
+ {SCK_UP, SCI_CTRL_META, SCI_LINESCROLLUP},
+ {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND},
+ {'[', SCI_CTRL, SCI_PARAUP},
+ {'[', SCI_CSHIFT, SCI_PARAUPEXTEND},
+ {']', SCI_CTRL, SCI_PARADOWN},
+ {']', SCI_CSHIFT, SCI_PARADOWNEXTEND},
+ {SCK_LEFT, SCI_NORM, SCI_CHARLEFT},
+ {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
+ {SCK_LEFT, SCI_CTRL_META, SCI_WORDLEFT},
+ {SCK_LEFT, SCI_SCTRL_META, SCI_WORDLEFTEXTEND},
+ {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND},
+ {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT},
+ {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND},
+ {SCK_RIGHT, SCI_CTRL_META, SCI_WORDRIGHT},
+ {SCK_RIGHT, SCI_SCTRL_META, SCI_WORDRIGHTEXTEND},
+ {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND},
+ {'/', SCI_CTRL, SCI_WORDPARTLEFT},
+ {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND},
+ {'\\', SCI_CTRL, SCI_WORDPARTRIGHT},
+ {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND},
+ {SCK_HOME, SCI_NORM, SCI_VCHOME},
+ {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND},
+ {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART},
+ {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND},
+ {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY},
+ {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND},
+ {SCK_END, SCI_NORM, SCI_LINEEND},
+ {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND},
+ {SCK_END, SCI_CTRL, SCI_DOCUMENTEND},
+ {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND},
+ {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY},
+ {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND},
+ {SCK_PRIOR, SCI_NORM, SCI_PAGEUP},
+ {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND},
+ {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND},
+ {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN},
+ {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND},
+ {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND},
+ {SCK_DELETE, SCI_NORM, SCI_CLEAR},
+ {SCK_DELETE, SCI_SHIFT, SCI_CUT},
+ {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT},
+ {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT},
+ {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE},
+ {SCK_INSERT, SCI_SHIFT, SCI_PASTE},
+ {SCK_INSERT, SCI_CTRL, SCI_COPY},
+ {SCK_ESCAPE, SCI_NORM, SCI_CANCEL},
+ {SCK_BACK, SCI_NORM, SCI_DELETEBACK},
+ {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK},
+ {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT},
+ {SCK_BACK, SCI_ALT, SCI_UNDO},
+ {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT},
+ {'Z', SCI_CTRL, SCI_UNDO},
+#if OS_X_KEYS
+ {'Z', SCI_CSHIFT, SCI_REDO},
+#else
+ {'Y', SCI_CTRL, SCI_REDO},
+#endif
+ {'X', SCI_CTRL, SCI_CUT},
+ {'C', SCI_CTRL, SCI_COPY},
+ {'V', SCI_CTRL, SCI_PASTE},
+ {'A', SCI_CTRL, SCI_SELECTALL},
+ {SCK_TAB, SCI_NORM, SCI_TAB},
+ {SCK_TAB, SCI_SHIFT, SCI_BACKTAB},
+ {SCK_RETURN, SCI_NORM, SCI_NEWLINE},
+ {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE},
+ {SCK_ADD, SCI_CTRL, SCI_ZOOMIN},
+ {SCK_SUBTRACT, SCI_CTRL, SCI_ZOOMOUT},
+ {SCK_DIVIDE, SCI_CTRL, SCI_SETZOOM},
+ {'L', SCI_CTRL, SCI_LINECUT},
+ {'L', SCI_CSHIFT, SCI_LINEDELETE},
+ {'T', SCI_CSHIFT, SCI_LINECOPY},
+ {'T', SCI_CTRL, SCI_LINETRANSPOSE},
+ {'D', SCI_CTRL, SCI_SELECTIONDUPLICATE},
+ {'U', SCI_CTRL, SCI_LOWERCASE},
+ {'U', SCI_CSHIFT, SCI_UPPERCASE},
+ {0,0,0},
+};
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.h b/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.h
new file mode 100644
index 00000000000..b102b356f3d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/KeyMap.h
@@ -0,0 +1,66 @@
+// Scintilla source code edit control
+/** @file KeyMap.h
+ ** Defines a mapping between keystrokes and commands.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef KEYMAP_H
+#define KEYMAP_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+#define SCI_NORM 0
+#define SCI_SHIFT SCMOD_SHIFT
+#define SCI_CTRL SCMOD_CTRL
+#define SCI_ALT SCMOD_ALT
+#define SCI_META SCMOD_META
+#define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
+#define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
+
+/**
+ */
+class KeyModifiers {
+public:
+ int key;
+ int modifiers;
+ KeyModifiers(int key_, int modifiers_) : key(key_), modifiers(modifiers_) {
+ }
+ bool operator<(const KeyModifiers &other) const {
+ if (key == other.key)
+ return modifiers < other.modifiers;
+ else
+ return key < other.key;
+ }
+};
+
+/**
+ */
+class KeyToCommand {
+public:
+ int key;
+ int modifiers;
+ unsigned int msg;
+};
+
+/**
+ */
+class KeyMap {
+ std::map<KeyModifiers, unsigned int> kmap;
+ static const KeyToCommand MapDefault[];
+
+public:
+ KeyMap();
+ ~KeyMap();
+ void Clear();
+ void AssignCmdKey(int key, int modifiers, unsigned int msg);
+ unsigned int Find(int key, int modifiers) const; // 0 returned on failure
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.cxx
new file mode 100644
index 00000000000..98e75ca52ea
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.cxx
@@ -0,0 +1,398 @@
+// Scintilla source code edit control
+/** @file LineMarker.cxx
+ ** Defines the look of a line marker in the margin.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+#include <math.h>
+
+#include <vector>
+#include <map>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "XPM.h"
+#include "LineMarker.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+void LineMarker::SetXPM(const char *textForm) {
+ delete pxpm;
+ pxpm = new XPM(textForm);
+ markType = SC_MARK_PIXMAP;
+}
+
+void LineMarker::SetXPM(const char *const *linesForm) {
+ delete pxpm;
+ pxpm = new XPM(linesForm);
+ markType = SC_MARK_PIXMAP;
+}
+
+void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) {
+ delete image;
+ image = new RGBAImage(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage);
+ markType = SC_MARK_RGBAIMAGE;
+}
+
+static void DrawBox(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
+ PRectangle rc = PRectangle::FromInts(
+ centreX - armSize,
+ centreY - armSize,
+ centreX + armSize + 1,
+ centreY + armSize + 1);
+ surface->RectangleDraw(rc, back, fore);
+}
+
+static void DrawCircle(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore, ColourDesired back) {
+ PRectangle rcCircle = PRectangle::FromInts(
+ centreX - armSize,
+ centreY - armSize,
+ centreX + armSize + 1,
+ centreY + armSize + 1);
+ surface->Ellipse(rcCircle, back, fore);
+}
+
+static void DrawPlus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
+ PRectangle rcV = PRectangle::FromInts(centreX, centreY - armSize + 2, centreX + 1, centreY + armSize - 2 + 1);
+ surface->FillRectangle(rcV, fore);
+ PRectangle rcH = PRectangle::FromInts(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY + 1);
+ surface->FillRectangle(rcH, fore);
+}
+
+static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, ColourDesired fore) {
+ PRectangle rcH = PRectangle::FromInts(centreX - armSize + 2, centreY, centreX + armSize - 2 + 1, centreY + 1);
+ surface->FillRectangle(rcH, fore);
+}
+
+void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const {
+ if (customDraw != NULL) {
+ customDraw(surface, rcWhole, fontForCharacter, tFold, marginStyle, this);
+ return;
+ }
+
+ ColourDesired colourHead = back;
+ ColourDesired colourBody = back;
+ ColourDesired colourTail = back;
+
+ switch (tFold) {
+ case LineMarker::head :
+ case LineMarker::headWithTail :
+ colourHead = backSelected;
+ colourTail = backSelected;
+ break;
+ case LineMarker::body :
+ colourHead = backSelected;
+ colourBody = backSelected;
+ break;
+ case LineMarker::tail :
+ colourBody = backSelected;
+ colourTail = backSelected;
+ break;
+ default :
+ // LineMarker::undefined
+ break;
+ }
+
+ if ((markType == SC_MARK_PIXMAP) && (pxpm)) {
+ pxpm->Draw(surface, rcWhole);
+ return;
+ }
+ if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
+ // Make rectangle just large enough to fit image centred on centre of rcWhole
+ PRectangle rcImage;
+ rcImage.top = ((rcWhole.top + rcWhole.bottom) - image->GetScaledHeight()) / 2;
+ rcImage.bottom = rcImage.top + image->GetScaledHeight();
+ rcImage.left = ((rcWhole.left + rcWhole.right) - image->GetScaledWidth()) / 2;
+ rcImage.right = rcImage.left + image->GetScaledWidth();
+ surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
+ return;
+ }
+ // Restrict most shapes a bit
+ PRectangle rc = rcWhole;
+ rc.top++;
+ rc.bottom--;
+ int minDim = Platform::Minimum(static_cast<int>(rc.Width()), static_cast<int>(rc.Height()));
+ minDim--; // Ensure does not go beyond edge
+ int centreX = static_cast<int>(floor((rc.right + rc.left) / 2.0));
+ int centreY = static_cast<int>(floor((rc.bottom + rc.top) / 2.0));
+ int dimOn2 = minDim / 2;
+ int dimOn4 = minDim / 4;
+ int blobSize = dimOn2-1;
+ int armSize = dimOn2-2;
+ if (marginStyle == SC_MARGIN_NUMBER || marginStyle == SC_MARGIN_TEXT || marginStyle == SC_MARGIN_RTEXT) {
+ // On textual margins move marker to the left to try to avoid overlapping the text
+ centreX = static_cast<int>(rc.left) + dimOn2 + 1;
+ }
+ if (markType == SC_MARK_ROUNDRECT) {
+ PRectangle rcRounded = rc;
+ rcRounded.left = rc.left + 1;
+ rcRounded.right = rc.right - 1;
+ surface->RoundedRectangle(rcRounded, fore, back);
+ } else if (markType == SC_MARK_CIRCLE) {
+ PRectangle rcCircle = PRectangle::FromInts(
+ centreX - dimOn2,
+ centreY - dimOn2,
+ centreX + dimOn2,
+ centreY + dimOn2);
+ surface->Ellipse(rcCircle, fore, back);
+ } else if (markType == SC_MARK_ARROW) {
+ Point pts[] = {
+ Point::FromInts(centreX - dimOn4, centreY - dimOn2),
+ Point::FromInts(centreX - dimOn4, centreY + dimOn2),
+ Point::FromInts(centreX + dimOn2 - dimOn4, centreY),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+
+ } else if (markType == SC_MARK_ARROWDOWN) {
+ Point pts[] = {
+ Point::FromInts(centreX - dimOn2, centreY - dimOn4),
+ Point::FromInts(centreX + dimOn2, centreY - dimOn4),
+ Point::FromInts(centreX, centreY + dimOn2 - dimOn4),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+
+ } else if (markType == SC_MARK_PLUS) {
+ Point pts[] = {
+ Point::FromInts(centreX - armSize, centreY - 1),
+ Point::FromInts(centreX - 1, centreY - 1),
+ Point::FromInts(centreX - 1, centreY - armSize),
+ Point::FromInts(centreX + 1, centreY - armSize),
+ Point::FromInts(centreX + 1, centreY - 1),
+ Point::FromInts(centreX + armSize, centreY -1),
+ Point::FromInts(centreX + armSize, centreY +1),
+ Point::FromInts(centreX + 1, centreY + 1),
+ Point::FromInts(centreX + 1, centreY + armSize),
+ Point::FromInts(centreX - 1, centreY + armSize),
+ Point::FromInts(centreX - 1, centreY + 1),
+ Point::FromInts(centreX - armSize, centreY + 1),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+
+ } else if (markType == SC_MARK_MINUS) {
+ Point pts[] = {
+ Point::FromInts(centreX - armSize, centreY - 1),
+ Point::FromInts(centreX + armSize, centreY -1),
+ Point::FromInts(centreX + armSize, centreY +1),
+ Point::FromInts(centreX - armSize, centreY + 1),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+
+ } else if (markType == SC_MARK_SMALLRECT) {
+ PRectangle rcSmall;
+ rcSmall.left = rc.left + 1;
+ rcSmall.top = rc.top + 2;
+ rcSmall.right = rc.right - 1;
+ rcSmall.bottom = rc.bottom - 2;
+ surface->RectangleDraw(rcSmall, fore, back);
+
+ } else if (markType == SC_MARK_EMPTY || markType == SC_MARK_BACKGROUND ||
+ markType == SC_MARK_UNDERLINE || markType == SC_MARK_AVAILABLE) {
+ // An invisible marker so don't draw anything
+
+ } else if (markType == SC_MARK_VLINE) {
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ } else if (markType == SC_MARK_LCORNER) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY);
+ surface->LineTo(static_cast<int>(rc.right) - 1, centreY);
+
+ } else if (markType == SC_MARK_TCORNER) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX, centreY);
+ surface->LineTo(static_cast<int>(rc.right) - 1, centreY);
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY + 1);
+
+ surface->PenColour(colourHead);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ } else if (markType == SC_MARK_LCORNERCURVE) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY-3);
+ surface->LineTo(centreX+3, centreY);
+ surface->LineTo(static_cast<int>(rc.right) - 1, centreY);
+
+ } else if (markType == SC_MARK_TCORNERCURVE) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX, centreY-3);
+ surface->LineTo(centreX+3, centreY);
+ surface->LineTo(static_cast<int>(rc.right) - 1, centreY);
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY-2);
+
+ surface->PenColour(colourHead);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ } else if (markType == SC_MARK_BOXPLUS) {
+ DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawPlus(surface, centreX, centreY, blobSize, colourTail);
+
+ } else if (markType == SC_MARK_BOXPLUSCONNECTED) {
+ if (tFold == LineMarker::headWithTail)
+ surface->PenColour(colourTail);
+ else
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY - blobSize);
+
+ DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawPlus(surface, centreX, centreY, blobSize, colourTail);
+
+ if (tFold == LineMarker::body) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX + 1, centreY + blobSize);
+ surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
+
+ surface->MoveTo(centreX + blobSize, centreY + blobSize);
+ surface->LineTo(centreX + blobSize, centreY - blobSize);
+
+ surface->MoveTo(centreX + 1, centreY - blobSize);
+ surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
+ }
+ } else if (markType == SC_MARK_BOXMINUS) {
+ DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawMinus(surface, centreX, centreY, blobSize, colourTail);
+
+ surface->PenColour(colourHead);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ } else if (markType == SC_MARK_BOXMINUSCONNECTED) {
+ DrawBox(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawMinus(surface, centreX, centreY, blobSize, colourTail);
+
+ surface->PenColour(colourHead);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY - blobSize);
+
+ if (tFold == LineMarker::body) {
+ surface->PenColour(colourTail);
+ surface->MoveTo(centreX + 1, centreY + blobSize);
+ surface->LineTo(centreX + blobSize + 1, centreY + blobSize);
+
+ surface->MoveTo(centreX + blobSize, centreY + blobSize);
+ surface->LineTo(centreX + blobSize, centreY - blobSize);
+
+ surface->MoveTo(centreX + 1, centreY - blobSize);
+ surface->LineTo(centreX + blobSize + 1, centreY - blobSize);
+ }
+ } else if (markType == SC_MARK_CIRCLEPLUS) {
+ DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawPlus(surface, centreX, centreY, blobSize, colourTail);
+
+ } else if (markType == SC_MARK_CIRCLEPLUSCONNECTED) {
+ if (tFold == LineMarker::headWithTail)
+ surface->PenColour(colourTail);
+ else
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY - blobSize);
+
+ DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawPlus(surface, centreX, centreY, blobSize, colourTail);
+
+ } else if (markType == SC_MARK_CIRCLEMINUS) {
+ surface->PenColour(colourHead);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawMinus(surface, centreX, centreY, blobSize, colourTail);
+
+ } else if (markType == SC_MARK_CIRCLEMINUSCONNECTED) {
+ surface->PenColour(colourHead);
+ surface->MoveTo(centreX, centreY + blobSize);
+ surface->LineTo(centreX, static_cast<int>(rcWhole.bottom));
+
+ surface->PenColour(colourBody);
+ surface->MoveTo(centreX, static_cast<int>(rcWhole.top));
+ surface->LineTo(centreX, centreY - blobSize);
+
+ DrawCircle(surface, centreX, centreY, blobSize, fore, colourHead);
+ DrawMinus(surface, centreX, centreY, blobSize, colourTail);
+
+ } else if (markType >= SC_MARK_CHARACTER) {
+ char character[1];
+ character[0] = static_cast<char>(markType - SC_MARK_CHARACTER);
+ XYPOSITION width = surface->WidthText(fontForCharacter, character, 1);
+ rc.left += (rc.Width() - width) / 2;
+ rc.right = rc.left + width;
+ surface->DrawTextClipped(rc, fontForCharacter, rc.bottom - 2,
+ character, 1, fore, back);
+
+ } else if (markType == SC_MARK_DOTDOTDOT) {
+ XYPOSITION right = static_cast<XYPOSITION>(centreX - 6);
+ for (int b=0; b<3; b++) {
+ PRectangle rcBlob(right, rc.bottom - 4, right + 2, rc.bottom-2);
+ surface->FillRectangle(rcBlob, fore);
+ right += 5.0f;
+ }
+ } else if (markType == SC_MARK_ARROWS) {
+ surface->PenColour(fore);
+ int right = centreX - 2;
+ const int armLength = dimOn2 - 1;
+ for (int b = 0; b<3; b++) {
+ surface->MoveTo(right, centreY);
+ surface->LineTo(right - armLength, centreY - armLength);
+ surface->MoveTo(right, centreY);
+ surface->LineTo(right - armLength, centreY + armLength);
+ right += 4;
+ }
+ } else if (markType == SC_MARK_SHORTARROW) {
+ Point pts[] = {
+ Point::FromInts(centreX, centreY + dimOn2),
+ Point::FromInts(centreX + dimOn2, centreY),
+ Point::FromInts(centreX, centreY - dimOn2),
+ Point::FromInts(centreX, centreY - dimOn4),
+ Point::FromInts(centreX - dimOn4, centreY - dimOn4),
+ Point::FromInts(centreX - dimOn4, centreY + dimOn4),
+ Point::FromInts(centreX, centreY + dimOn4),
+ Point::FromInts(centreX, centreY + dimOn2),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+ } else if (markType == SC_MARK_LEFTRECT) {
+ PRectangle rcLeft = rcWhole;
+ rcLeft.right = rcLeft.left + 4;
+ surface->FillRectangle(rcLeft, back);
+ } else if (markType == SC_MARK_BOOKMARK) {
+ int halfHeight = minDim / 3;
+ Point pts[] = {
+ Point::FromInts(static_cast<int>(rc.left), centreY-halfHeight),
+ Point::FromInts(static_cast<int>(rc.right) - 3, centreY - halfHeight),
+ Point::FromInts(static_cast<int>(rc.right) - 3 - halfHeight, centreY),
+ Point::FromInts(static_cast<int>(rc.right) - 3, centreY + halfHeight),
+ Point::FromInts(static_cast<int>(rc.left), centreY + halfHeight),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
+ } else { // SC_MARK_FULLRECT
+ surface->FillRectangle(rcWhole, back);
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.h b/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.h
new file mode 100644
index 00000000000..6a5fe749244
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/LineMarker.h
@@ -0,0 +1,86 @@
+// Scintilla source code edit control
+/** @file LineMarker.h
+ ** Defines the look of a line marker in the margin .
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef LINEMARKER_H
+#define LINEMARKER_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
+
+/**
+ */
+class LineMarker {
+public:
+ enum typeOfFold { undefined, head, body, tail, headWithTail };
+
+ int markType;
+ ColourDesired fore;
+ ColourDesired back;
+ ColourDesired backSelected;
+ int alpha;
+ XPM *pxpm;
+ RGBAImage *image;
+ /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
+ * Draw function for drawing line markers. Allow those platforms to override
+ * it instead of creating a new method(s) in the Surface class that existing
+ * platforms must implement as empty. */
+ DrawLineMarkerFn customDraw;
+ LineMarker() {
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0,0,0);
+ back = ColourDesired(0xff,0xff,0xff);
+ backSelected = ColourDesired(0xff,0x00,0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ pxpm = NULL;
+ image = NULL;
+ customDraw = NULL;
+ }
+ LineMarker(const LineMarker &) {
+ // Defined to avoid pxpm being blindly copied, not as a complete copy constructor
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0,0,0);
+ back = ColourDesired(0xff,0xff,0xff);
+ backSelected = ColourDesired(0xff,0x00,0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ pxpm = NULL;
+ image = NULL;
+ customDraw = NULL;
+ }
+ ~LineMarker() {
+ delete pxpm;
+ delete image;
+ }
+ LineMarker &operator=(const LineMarker &other) {
+ // Defined to avoid pxpm being blindly copied, not as a complete assignment operator
+ if (this != &other) {
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0,0,0);
+ back = ColourDesired(0xff,0xff,0xff);
+ backSelected = ColourDesired(0xff,0x00,0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ delete pxpm;
+ pxpm = NULL;
+ delete image;
+ image = NULL;
+ customDraw = NULL;
+ }
+ return *this;
+ }
+ void SetXPM(const char *textForm);
+ void SetXPM(const char *const *linesForm);
+ void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
+ void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.cxx
new file mode 100644
index 00000000000..a6fc1f40b39
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.cxx
@@ -0,0 +1,470 @@
+// Scintilla source code edit control
+/** @file MarginView.cxx
+ ** Defines the appearance of the editor margin.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+#include <memory>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "StringCopy.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+void DrawWrapMarker(Surface *surface, PRectangle rcPlace,
+ bool isEndMarker, ColourDesired wrapColour) {
+ surface->PenColour(wrapColour);
+
+ enum { xa = 1 }; // gap before start
+ int w = static_cast<int>(rcPlace.right - rcPlace.left) - xa - 1;
+
+ bool xStraight = isEndMarker; // x-mirrored symbol for start marker
+
+ int x0 = static_cast<int>(xStraight ? rcPlace.left : rcPlace.right - 1);
+ int y0 = static_cast<int>(rcPlace.top);
+
+ int dy = static_cast<int>(rcPlace.bottom - rcPlace.top) / 5;
+ int y = static_cast<int>(rcPlace.bottom - rcPlace.top) / 2 + dy;
+
+ struct Relative {
+ Surface *surface;
+ int xBase;
+ int xDir;
+ int yBase;
+ int yDir;
+ void MoveTo(int xRelative, int yRelative) {
+ surface->MoveTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
+ }
+ void LineTo(int xRelative, int yRelative) {
+ surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
+ }
+ };
+ Relative rel = { surface, x0, xStraight ? 1 : -1, y0, 1 };
+
+ // arrow head
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + 2 * w / 3, y - dy);
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + 2 * w / 3, y + dy);
+
+ // arrow body
+ rel.MoveTo(xa, y);
+ rel.LineTo(xa + w, y);
+ rel.LineTo(xa + w, y - 2 * dy);
+ rel.LineTo(xa - 1, // on windows lineto is exclusive endpoint, perhaps GTK not...
+ y - 2 * dy);
+}
+
+MarginView::MarginView() {
+ pixmapSelMargin = 0;
+ pixmapSelPattern = 0;
+ pixmapSelPatternOffset1 = 0;
+ wrapMarkerPaddingRight = 3;
+ customDrawWrapMarker = NULL;
+}
+
+void MarginView::DropGraphics(bool freeObjects) {
+ if (freeObjects) {
+ delete pixmapSelMargin;
+ pixmapSelMargin = 0;
+ delete pixmapSelPattern;
+ pixmapSelPattern = 0;
+ delete pixmapSelPatternOffset1;
+ pixmapSelPatternOffset1 = 0;
+ } else {
+ if (pixmapSelMargin)
+ pixmapSelMargin->Release();
+ if (pixmapSelPattern)
+ pixmapSelPattern->Release();
+ if (pixmapSelPatternOffset1)
+ pixmapSelPatternOffset1->Release();
+ }
+}
+
+void MarginView::AllocateGraphics(const ViewStyle &vsDraw) {
+ if (!pixmapSelMargin)
+ pixmapSelMargin = Surface::Allocate(vsDraw.technology);
+ if (!pixmapSelPattern)
+ pixmapSelPattern = Surface::Allocate(vsDraw.technology);
+ if (!pixmapSelPatternOffset1)
+ pixmapSelPatternOffset1 = Surface::Allocate(vsDraw.technology);
+}
+
+void MarginView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw) {
+ if (!pixmapSelPattern->Initialised()) {
+ const int patternSize = 8;
+ pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow, wid);
+ pixmapSelPatternOffset1->InitPixMap(patternSize, patternSize, surfaceWindow, wid);
+ // This complex procedure is to reproduce the checkerboard dithered pattern used by windows
+ // for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half
+ // way between the chrome colour and the chrome highlight colour making a nice transition
+ // between the window chrome and the content area. And it works in low colour depths.
+ PRectangle rcPattern = PRectangle::FromInts(0, 0, patternSize, patternSize);
+
+ // Initialize default colours based on the chrome colour scheme. Typically the highlight is white.
+ ColourDesired colourFMFill = vsDraw.selbar;
+ ColourDesired colourFMStripes = vsDraw.selbarlight;
+
+ if (!(vsDraw.selbarlight == ColourDesired(0xff, 0xff, 0xff))) {
+ // User has chosen an unusual chrome colour scheme so just use the highlight edge colour.
+ // (Typically, the highlight colour is white.)
+ colourFMFill = vsDraw.selbarlight;
+ }
+
+ if (vsDraw.foldmarginColour.isSet) {
+ // override default fold margin colour
+ colourFMFill = vsDraw.foldmarginColour;
+ }
+ if (vsDraw.foldmarginHighlightColour.isSet) {
+ // override default fold margin highlight colour
+ colourFMStripes = vsDraw.foldmarginHighlightColour;
+ }
+
+ pixmapSelPattern->FillRectangle(rcPattern, colourFMFill);
+ pixmapSelPatternOffset1->FillRectangle(rcPattern, colourFMStripes);
+ for (int y = 0; y < patternSize; y++) {
+ for (int x = y % 2; x < patternSize; x += 2) {
+ PRectangle rcPixel = PRectangle::FromInts(x, y, x + 1, y + 1);
+ pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes);
+ pixmapSelPatternOffset1->FillRectangle(rcPixel, colourFMFill);
+ }
+ }
+ }
+}
+
+static int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault, const ViewStyle &vs) {
+ if (vs.markers[markerCheck].markType == SC_MARK_EMPTY)
+ return markerDefault;
+ return markerCheck;
+}
+
+void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRectangle rcMargin,
+ const EditModel &model, const ViewStyle &vs) {
+
+ PRectangle rcSelMargin = rcMargin;
+ rcSelMargin.right = rcMargin.left;
+ if (rcSelMargin.bottom < rc.bottom)
+ rcSelMargin.bottom = rc.bottom;
+
+ Point ptOrigin = model.GetVisibleOriginInMain();
+ FontAlias fontLineNumber = vs.styles[STYLE_LINENUMBER].font;
+ for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) {
+ if (vs.ms[margin].width > 0) {
+
+ rcSelMargin.left = rcSelMargin.right;
+ rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width;
+
+ if (vs.ms[margin].style != SC_MARGIN_NUMBER) {
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ // Required because of special way brush is created for selection margin
+ // Ensure patterns line up when scrolling with separate margin view
+ // by choosing correctly aligned variant.
+ bool invertPhase = static_cast<int>(ptOrigin.y) & 1;
+ surface->FillRectangle(rcSelMargin,
+ invertPhase ? *pixmapSelPattern : *pixmapSelPatternOffset1);
+ } else {
+ ColourDesired colour;
+ switch (vs.ms[margin].style) {
+ case SC_MARGIN_BACK:
+ colour = vs.styles[STYLE_DEFAULT].back;
+ break;
+ case SC_MARGIN_FORE:
+ colour = vs.styles[STYLE_DEFAULT].fore;
+ break;
+ default:
+ colour = vs.styles[STYLE_LINENUMBER].back;
+ break;
+ }
+ surface->FillRectangle(rcSelMargin, colour);
+ }
+ } else {
+ surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back);
+ }
+
+ const int lineStartPaint = static_cast<int>(rcMargin.top + ptOrigin.y) / vs.lineHeight;
+ int visibleLine = model.TopLineOfMain() + lineStartPaint;
+ int yposScreen = lineStartPaint * vs.lineHeight - static_cast<int>(ptOrigin.y);
+ // Work out whether the top line is whitespace located after a
+ // lessening of fold level which implies a 'fold tail' but which should not
+ // be displayed until the last of a sequence of whitespace.
+ bool needWhiteClosure = false;
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine));
+ if (level & SC_FOLDLEVELWHITEFLAG) {
+ int lineBack = model.cs.DocFromDisplay(visibleLine);
+ int levelPrev = level;
+ while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) {
+ lineBack--;
+ levelPrev = model.pdoc->GetLevel(lineBack);
+ }
+ if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
+ if ((level & SC_FOLDLEVELNUMBERMASK) < (levelPrev & SC_FOLDLEVELNUMBERMASK))
+ needWhiteClosure = true;
+ }
+ }
+ if (highlightDelimiter.isEnabled) {
+ int lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1;
+ model.pdoc->GetHighlightDelimiters(highlightDelimiter, model.pdoc->LineFromPosition(model.sel.MainCaret()), lastLine);
+ }
+ }
+
+ // Old code does not know about new markers needed to distinguish all cases
+ const int folderOpenMid = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEROPENMID,
+ SC_MARKNUM_FOLDEROPEN, vs);
+ const int folderEnd = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEREND,
+ SC_MARKNUM_FOLDER, vs);
+
+ while ((visibleLine < model.cs.LinesDisplayed()) && yposScreen < rc.bottom) {
+
+ PLATFORM_ASSERT(visibleLine < model.cs.LinesDisplayed());
+ const int lineDoc = model.cs.DocFromDisplay(visibleLine);
+ PLATFORM_ASSERT(model.cs.GetVisible(lineDoc));
+ const int firstVisibleLine = model.cs.DisplayFromDoc(lineDoc);
+ const int lastVisibleLine = model.cs.DisplayLastFromDoc(lineDoc);
+ const bool firstSubLine = visibleLine == firstVisibleLine;
+ const bool lastSubLine = visibleLine == lastVisibleLine;
+
+ int marks = model.pdoc->GetMark(lineDoc);
+ if (!firstSubLine)
+ marks = 0;
+
+ bool headWithTail = false;
+
+ if (vs.ms[margin].mask & SC_MASK_FOLDERS) {
+ // Decide which fold indicator should be displayed
+ const int level = model.pdoc->GetLevel(lineDoc);
+ const int levelNext = model.pdoc->GetLevel(lineDoc + 1);
+ const int levelNum = level & SC_FOLDLEVELNUMBERMASK;
+ const int levelNextNum = levelNext & SC_FOLDLEVELNUMBERMASK;
+ if (level & SC_FOLDLEVELHEADERFLAG) {
+ if (firstSubLine) {
+ if (levelNum < levelNextNum) {
+ if (model.cs.GetExpanded(lineDoc)) {
+ if (levelNum == SC_FOLDLEVELBASE)
+ marks |= 1 << SC_MARKNUM_FOLDEROPEN;
+ else
+ marks |= 1 << folderOpenMid;
+ } else {
+ if (levelNum == SC_FOLDLEVELBASE)
+ marks |= 1 << SC_MARKNUM_FOLDER;
+ else
+ marks |= 1 << folderEnd;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else {
+ if (levelNum < levelNextNum) {
+ if (model.cs.GetExpanded(lineDoc)) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ needWhiteClosure = false;
+ const int firstFollowupLine = model.cs.DocFromDisplay(model.cs.DisplayFromDoc(lineDoc + 1));
+ const int firstFollowupLineLevel = model.pdoc->GetLevel(firstFollowupLine);
+ const int secondFollowupLineLevelNum = model.pdoc->GetLevel(firstFollowupLine + 1) & SC_FOLDLEVELNUMBERMASK;
+ if (!model.cs.GetExpanded(lineDoc)) {
+ if ((firstFollowupLineLevel & SC_FOLDLEVELWHITEFLAG) &&
+ (levelNum > secondFollowupLineLevelNum))
+ needWhiteClosure = true;
+
+ if (highlightDelimiter.IsFoldBlockHighlighted(firstFollowupLine))
+ headWithTail = true;
+ }
+ } else if (level & SC_FOLDLEVELWHITEFLAG) {
+ if (needWhiteClosure) {
+ if (levelNext & SC_FOLDLEVELWHITEFLAG) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ needWhiteClosure = false;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ needWhiteClosure = false;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ if (levelNextNum < levelNum) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ if (levelNextNum < levelNum) {
+ needWhiteClosure = false;
+ if (levelNext & SC_FOLDLEVELWHITEFLAG) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ needWhiteClosure = true;
+ } else if (lastSubLine) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ }
+ }
+
+ marks &= vs.ms[margin].mask;
+
+ PRectangle rcMarker = rcSelMargin;
+ rcMarker.top = static_cast<XYPOSITION>(yposScreen);
+ rcMarker.bottom = static_cast<XYPOSITION>(yposScreen + vs.lineHeight);
+ if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
+ if (firstSubLine) {
+ char number[100] = "";
+ if (lineDoc >= 0)
+ sprintf(number, "%d", lineDoc + 1);
+ if (model.foldFlags & (SC_FOLDFLAG_LEVELNUMBERS | SC_FOLDFLAG_LINESTATE)) {
+ if (model.foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
+ int lev = model.pdoc->GetLevel(lineDoc);
+ sprintf(number, "%c%c %03X %03X",
+ (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
+ (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
+ lev & SC_FOLDLEVELNUMBERMASK,
+ lev >> 16
+ );
+ } else {
+ int state = model.pdoc->GetLineState(lineDoc);
+ sprintf(number, "%0X", state);
+ }
+ }
+ PRectangle rcNumber = rcMarker;
+ // Right justify
+ XYPOSITION width = surface->WidthText(fontLineNumber, number, static_cast<int>(strlen(number)));
+ XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding;
+ rcNumber.left = xpos;
+ DrawTextNoClipPhase(surface, rcNumber, vs.styles[STYLE_LINENUMBER],
+ rcNumber.top + vs.maxAscent, number, static_cast<int>(strlen(number)), drawAll);
+ } else if (vs.wrapVisualFlags & SC_WRAPVISUALFLAG_MARGIN) {
+ PRectangle rcWrapMarker = rcMarker;
+ rcWrapMarker.right -= wrapMarkerPaddingRight;
+ rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth;
+ if (customDrawWrapMarker == NULL) {
+ DrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
+ } else {
+ customDrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
+ }
+ }
+ } else if (vs.ms[margin].style == SC_MARGIN_TEXT || vs.ms[margin].style == SC_MARGIN_RTEXT) {
+ const StyledText stMargin = model.pdoc->MarginStyledText(lineDoc);
+ if (stMargin.text && ValidStyledText(vs, vs.marginStyleOffset, stMargin)) {
+ if (firstSubLine) {
+ surface->FillRectangle(rcMarker,
+ vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
+ if (vs.ms[margin].style == SC_MARGIN_RTEXT) {
+ int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);
+ rcMarker.left = rcMarker.right - width - 3;
+ }
+ DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker,
+ stMargin, 0, stMargin.length, drawAll);
+ } else {
+ // if we're displaying annotation lines, color the margin to match the associated document line
+ const int annotationLines = model.pdoc->AnnotationLines(lineDoc);
+ if (annotationLines && (visibleLine > lastVisibleLine - annotationLines)) {
+ surface->FillRectangle(rcMarker, vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
+ }
+ }
+ }
+ }
+
+ if (marks) {
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if (marks & 1) {
+ LineMarker::typeOfFold tFold = LineMarker::undefined;
+ if ((vs.ms[margin].mask & SC_MASK_FOLDERS) && highlightDelimiter.IsFoldBlockHighlighted(lineDoc)) {
+ if (highlightDelimiter.IsBodyOfFoldBlock(lineDoc)) {
+ tFold = LineMarker::body;
+ } else if (highlightDelimiter.IsHeadOfFoldBlock(lineDoc)) {
+ if (firstSubLine) {
+ tFold = headWithTail ? LineMarker::headWithTail : LineMarker::head;
+ } else {
+ if (model.cs.GetExpanded(lineDoc) || headWithTail) {
+ tFold = LineMarker::body;
+ } else {
+ tFold = LineMarker::undefined;
+ }
+ }
+ } else if (highlightDelimiter.IsTailOfFoldBlock(lineDoc)) {
+ tFold = LineMarker::tail;
+ }
+ }
+ vs.markers[markBit].Draw(surface, rcMarker, fontLineNumber, tFold, vs.ms[margin].style);
+ }
+ marks >>= 1;
+ }
+ }
+
+ visibleLine++;
+ yposScreen += vs.lineHeight;
+ }
+ }
+ }
+
+ PRectangle rcBlankMargin = rcMargin;
+ rcBlankMargin.left = rcSelMargin.right;
+ surface->FillRectangle(rcBlankMargin, vs.styles[STYLE_DEFAULT].back);
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.h b/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.h
new file mode 100644
index 00000000000..ff55646767f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/MarginView.h
@@ -0,0 +1,50 @@
+// Scintilla source code edit control
+/** @file MarginView.h
+ ** Defines the appearance of the editor margin.
+ **/
+// Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef MARGINVIEW_H
+#define MARGINVIEW_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);
+
+typedef void (*DrawWrapMarkerFn)(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);
+
+/**
+* MarginView draws the margins.
+*/
+class MarginView {
+public:
+ Surface *pixmapSelMargin;
+ Surface *pixmapSelPattern;
+ Surface *pixmapSelPatternOffset1;
+ // Highlight current folding block
+ HighlightDelimiter highlightDelimiter;
+
+ int wrapMarkerPaddingRight; // right-most pixel padding of wrap markers
+ /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
+ * DrawWrapMarker function for drawing wrap markers. Allow those platforms to
+ * override it instead of creating a new method in the Surface class that
+ * existing platforms must implement as empty. */
+ DrawWrapMarkerFn customDrawWrapMarker;
+
+ MarginView();
+
+ void DropGraphics(bool freeObjects);
+ void AllocateGraphics(const ViewStyle &vsDraw);
+ void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw);
+ void PaintMargin(Surface *surface, int topLine, PRectangle rc, PRectangle rcMargin,
+ const EditModel &model, const ViewStyle &vs);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Partitioning.h b/3rdparty/bgfx/3rdparty/scintilla/src/Partitioning.h
new file mode 100644
index 00000000000..688b38d7d38
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Partitioning.h
@@ -0,0 +1,198 @@
+// Scintilla source code edit control
+/** @file Partitioning.h
+ ** Data structure used to partition an interval. Used for holding line start/end positions.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef PARTITIONING_H
+#define PARTITIONING_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/// A split vector of integers with a method for adding a value to all elements
+/// in a range.
+/// Used by the Partitioning class.
+
+class SplitVectorWithRangeAdd : public SplitVector<int> {
+public:
+ explicit SplitVectorWithRangeAdd(int growSize_) {
+ SetGrowSize(growSize_);
+ ReAllocate(growSize_);
+ }
+ ~SplitVectorWithRangeAdd() {
+ }
+ void RangeAddDelta(int start, int end, int delta) {
+ // end is 1 past end, so end-start is number of elements to change
+ int i = 0;
+ int rangeLength = end - start;
+ int range1Length = rangeLength;
+ int part1Left = part1Length - start;
+ if (range1Length > part1Left)
+ range1Length = part1Left;
+ while (i < range1Length) {
+ body[start++] += delta;
+ i++;
+ }
+ start += gapLength;
+ while (i < rangeLength) {
+ body[start++] += delta;
+ i++;
+ }
+ }
+};
+
+/// Divide an interval into multiple partitions.
+/// Useful for breaking a document down into sections such as lines.
+/// A 0 length interval has a single 0 length partition, numbered 0
+/// If interval not 0 length then each partition non-zero length
+/// When needed, positions after the interval are considered part of the last partition
+/// but the end of the last partition can be found with PositionFromPartition(last+1).
+
+class Partitioning {
+private:
+ // To avoid calculating all the partition positions whenever any text is inserted
+ // there may be a step somewhere in the list.
+ int stepPartition;
+ int stepLength;
+ SplitVectorWithRangeAdd *body;
+
+ // Move step forward
+ void ApplyStep(int partitionUpTo) {
+ if (stepLength != 0) {
+ body->RangeAddDelta(stepPartition+1, partitionUpTo + 1, stepLength);
+ }
+ stepPartition = partitionUpTo;
+ if (stepPartition >= body->Length()-1) {
+ stepPartition = body->Length()-1;
+ stepLength = 0;
+ }
+ }
+
+ // Move step backward
+ void BackStep(int partitionDownTo) {
+ if (stepLength != 0) {
+ body->RangeAddDelta(partitionDownTo+1, stepPartition+1, -stepLength);
+ }
+ stepPartition = partitionDownTo;
+ }
+
+ void Allocate(int growSize) {
+ body = new SplitVectorWithRangeAdd(growSize);
+ stepPartition = 0;
+ stepLength = 0;
+ body->Insert(0, 0); // This value stays 0 for ever
+ body->Insert(1, 0); // This is the end of the first partition and will be the start of the second
+ }
+
+public:
+ explicit Partitioning(int growSize) {
+ Allocate(growSize);
+ }
+
+ ~Partitioning() {
+ delete body;
+ body = 0;
+ }
+
+ int Partitions() const {
+ return body->Length()-1;
+ }
+
+ void InsertPartition(int partition, int pos) {
+ if (stepPartition < partition) {
+ ApplyStep(partition);
+ }
+ body->Insert(partition, pos);
+ stepPartition++;
+ }
+
+ void SetPartitionStartPosition(int partition, int pos) {
+ ApplyStep(partition+1);
+ if ((partition < 0) || (partition > body->Length())) {
+ return;
+ }
+ body->SetValueAt(partition, pos);
+ }
+
+ void InsertText(int partitionInsert, int delta) {
+ // Point all the partitions after the insertion point further along in the buffer
+ if (stepLength != 0) {
+ if (partitionInsert >= stepPartition) {
+ // Fill in up to the new insertion point
+ ApplyStep(partitionInsert);
+ stepLength += delta;
+ } else if (partitionInsert >= (stepPartition - body->Length() / 10)) {
+ // Close to step but before so move step back
+ BackStep(partitionInsert);
+ stepLength += delta;
+ } else {
+ ApplyStep(body->Length()-1);
+ stepPartition = partitionInsert;
+ stepLength = delta;
+ }
+ } else {
+ stepPartition = partitionInsert;
+ stepLength = delta;
+ }
+ }
+
+ void RemovePartition(int partition) {
+ if (partition > stepPartition) {
+ ApplyStep(partition);
+ stepPartition--;
+ } else {
+ stepPartition--;
+ }
+ body->Delete(partition);
+ }
+
+ int PositionFromPartition(int partition) const {
+ PLATFORM_ASSERT(partition >= 0);
+ PLATFORM_ASSERT(partition < body->Length());
+ if ((partition < 0) || (partition >= body->Length())) {
+ return 0;
+ }
+ int pos = body->ValueAt(partition);
+ if (partition > stepPartition)
+ pos += stepLength;
+ return pos;
+ }
+
+ /// Return value in range [0 .. Partitions() - 1] even for arguments outside interval
+ int PartitionFromPosition(int pos) const {
+ if (body->Length() <= 1)
+ return 0;
+ if (pos >= (PositionFromPartition(body->Length()-1)))
+ return body->Length() - 1 - 1;
+ int lower = 0;
+ int upper = body->Length()-1;
+ do {
+ int middle = (upper + lower + 1) / 2; // Round high
+ int posMiddle = body->ValueAt(middle);
+ if (middle > stepPartition)
+ posMiddle += stepLength;
+ if (pos < posMiddle) {
+ upper = middle - 1;
+ } else {
+ lower = middle;
+ }
+ } while (lower < upper);
+ return lower;
+ }
+
+ void DeleteAll() {
+ int growSize = body->GetGrowSize();
+ delete body;
+ Allocate(growSize);
+ }
+};
+
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.cxx
new file mode 100644
index 00000000000..8fd96cbedfd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.cxx
@@ -0,0 +1,556 @@
+// Scintilla source code edit control
+/** @file PerLine.cxx
+ ** Manages data associated with each line of the document
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+
+#include <vector>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "CellBuffer.h"
+#include "PerLine.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+MarkerHandleSet::MarkerHandleSet() {
+ root = 0;
+}
+
+MarkerHandleSet::~MarkerHandleSet() {
+ MarkerHandleNumber *mhn = root;
+ while (mhn) {
+ MarkerHandleNumber *mhnToFree = mhn;
+ mhn = mhn->next;
+ delete mhnToFree;
+ }
+ root = 0;
+}
+
+int MarkerHandleSet::Length() const {
+ int c = 0;
+ MarkerHandleNumber *mhn = root;
+ while (mhn) {
+ c++;
+ mhn = mhn->next;
+ }
+ return c;
+}
+
+int MarkerHandleSet::MarkValue() const {
+ unsigned int m = 0;
+ MarkerHandleNumber *mhn = root;
+ while (mhn) {
+ m |= (1 << mhn->number);
+ mhn = mhn->next;
+ }
+ return m;
+}
+
+bool MarkerHandleSet::Contains(int handle) const {
+ MarkerHandleNumber *mhn = root;
+ while (mhn) {
+ if (mhn->handle == handle) {
+ return true;
+ }
+ mhn = mhn->next;
+ }
+ return false;
+}
+
+bool MarkerHandleSet::InsertHandle(int handle, int markerNum) {
+ MarkerHandleNumber *mhn = new MarkerHandleNumber;
+ mhn->handle = handle;
+ mhn->number = markerNum;
+ mhn->next = root;
+ root = mhn;
+ return true;
+}
+
+void MarkerHandleSet::RemoveHandle(int handle) {
+ MarkerHandleNumber **pmhn = &root;
+ while (*pmhn) {
+ MarkerHandleNumber *mhn = *pmhn;
+ if (mhn->handle == handle) {
+ *pmhn = mhn->next;
+ delete mhn;
+ return;
+ }
+ pmhn = &((*pmhn)->next);
+ }
+}
+
+bool MarkerHandleSet::RemoveNumber(int markerNum, bool all) {
+ bool performedDeletion = false;
+ MarkerHandleNumber **pmhn = &root;
+ while (*pmhn) {
+ MarkerHandleNumber *mhn = *pmhn;
+ if (mhn->number == markerNum) {
+ *pmhn = mhn->next;
+ delete mhn;
+ performedDeletion = true;
+ if (!all)
+ break;
+ } else {
+ pmhn = &((*pmhn)->next);
+ }
+ }
+ return performedDeletion;
+}
+
+void MarkerHandleSet::CombineWith(MarkerHandleSet *other) {
+ MarkerHandleNumber **pmhn = &root;
+ while (*pmhn) {
+ pmhn = &((*pmhn)->next);
+ }
+ *pmhn = other->root;
+ other->root = 0;
+}
+
+LineMarkers::~LineMarkers() {
+ Init();
+}
+
+void LineMarkers::Init() {
+ for (int line = 0; line < markers.Length(); line++) {
+ delete markers[line];
+ markers[line] = 0;
+ }
+ markers.DeleteAll();
+}
+
+void LineMarkers::InsertLine(int line) {
+ if (markers.Length()) {
+ markers.Insert(line, 0);
+ }
+}
+
+void LineMarkers::RemoveLine(int line) {
+ // Retain the markers from the deleted line by oring them into the previous line
+ if (markers.Length()) {
+ if (line > 0) {
+ MergeMarkers(line - 1);
+ }
+ markers.Delete(line);
+ }
+}
+
+int LineMarkers::LineFromHandle(int markerHandle) {
+ if (markers.Length()) {
+ for (int line = 0; line < markers.Length(); line++) {
+ if (markers[line]) {
+ if (markers[line]->Contains(markerHandle)) {
+ return line;
+ }
+ }
+ }
+ }
+ return -1;
+}
+
+void LineMarkers::MergeMarkers(int pos) {
+ if (markers[pos + 1] != NULL) {
+ if (markers[pos] == NULL)
+ markers[pos] = new MarkerHandleSet;
+ markers[pos]->CombineWith(markers[pos + 1]);
+ delete markers[pos + 1];
+ markers[pos + 1] = NULL;
+ }
+}
+
+int LineMarkers::MarkValue(int line) {
+ if (markers.Length() && (line >= 0) && (line < markers.Length()) && markers[line])
+ return markers[line]->MarkValue();
+ else
+ return 0;
+}
+
+int LineMarkers::MarkerNext(int lineStart, int mask) const {
+ if (lineStart < 0)
+ lineStart = 0;
+ int length = markers.Length();
+ for (int iLine = lineStart; iLine < length; iLine++) {
+ MarkerHandleSet *onLine = markers[iLine];
+ if (onLine && ((onLine->MarkValue() & mask) != 0))
+ //if ((pdoc->GetMark(iLine) & lParam) != 0)
+ return iLine;
+ }
+ return -1;
+}
+
+int LineMarkers::AddMark(int line, int markerNum, int lines) {
+ handleCurrent++;
+ if (!markers.Length()) {
+ // No existing markers so allocate one element per line
+ markers.InsertValue(0, lines, 0);
+ }
+ if (line >= markers.Length()) {
+ return -1;
+ }
+ if (!markers[line]) {
+ // Need new structure to hold marker handle
+ markers[line] = new MarkerHandleSet();
+ }
+ markers[line]->InsertHandle(handleCurrent, markerNum);
+
+ return handleCurrent;
+}
+
+bool LineMarkers::DeleteMark(int line, int markerNum, bool all) {
+ bool someChanges = false;
+ if (markers.Length() && (line >= 0) && (line < markers.Length()) && markers[line]) {
+ if (markerNum == -1) {
+ someChanges = true;
+ delete markers[line];
+ markers[line] = NULL;
+ } else {
+ someChanges = markers[line]->RemoveNumber(markerNum, all);
+ if (markers[line]->Length() == 0) {
+ delete markers[line];
+ markers[line] = NULL;
+ }
+ }
+ }
+ return someChanges;
+}
+
+void LineMarkers::DeleteMarkFromHandle(int markerHandle) {
+ int line = LineFromHandle(markerHandle);
+ if (line >= 0) {
+ markers[line]->RemoveHandle(markerHandle);
+ if (markers[line]->Length() == 0) {
+ delete markers[line];
+ markers[line] = NULL;
+ }
+ }
+}
+
+LineLevels::~LineLevels() {
+}
+
+void LineLevels::Init() {
+ levels.DeleteAll();
+}
+
+void LineLevels::InsertLine(int line) {
+ if (levels.Length()) {
+ int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE;
+ levels.InsertValue(line, 1, level);
+ }
+}
+
+void LineLevels::RemoveLine(int line) {
+ if (levels.Length()) {
+ // Move up following lines but merge header flag from this line
+ // to line before to avoid a temporary disappearence causing expansion.
+ int firstHeader = levels[line] & SC_FOLDLEVELHEADERFLAG;
+ levels.Delete(line);
+ if (line == levels.Length()-1) // Last line loses the header flag
+ levels[line-1] &= ~SC_FOLDLEVELHEADERFLAG;
+ else if (line > 0)
+ levels[line-1] |= firstHeader;
+ }
+}
+
+void LineLevels::ExpandLevels(int sizeNew) {
+ levels.InsertValue(levels.Length(), sizeNew - levels.Length(), SC_FOLDLEVELBASE);
+}
+
+void LineLevels::ClearLevels() {
+ levels.DeleteAll();
+}
+
+int LineLevels::SetLevel(int line, int level, int lines) {
+ int prev = 0;
+ if ((line >= 0) && (line < lines)) {
+ if (!levels.Length()) {
+ ExpandLevels(lines + 1);
+ }
+ prev = levels[line];
+ if (prev != level) {
+ levels[line] = level;
+ }
+ }
+ return prev;
+}
+
+int LineLevels::GetLevel(int line) const {
+ if (levels.Length() && (line >= 0) && (line < levels.Length())) {
+ return levels[line];
+ } else {
+ return SC_FOLDLEVELBASE;
+ }
+}
+
+LineState::~LineState() {
+}
+
+void LineState::Init() {
+ lineStates.DeleteAll();
+}
+
+void LineState::InsertLine(int line) {
+ if (lineStates.Length()) {
+ lineStates.EnsureLength(line);
+ int val = (line < lineStates.Length()) ? lineStates[line] : 0;
+ lineStates.Insert(line, val);
+ }
+}
+
+void LineState::RemoveLine(int line) {
+ if (lineStates.Length() > line) {
+ lineStates.Delete(line);
+ }
+}
+
+int LineState::SetLineState(int line, int state) {
+ lineStates.EnsureLength(line + 1);
+ int stateOld = lineStates[line];
+ lineStates[line] = state;
+ return stateOld;
+}
+
+int LineState::GetLineState(int line) {
+ if (line < 0)
+ return 0;
+ lineStates.EnsureLength(line + 1);
+ return lineStates[line];
+}
+
+int LineState::GetMaxLineState() const {
+ return lineStates.Length();
+}
+
+static int NumberLines(const char *text) {
+ if (text) {
+ int newLines = 0;
+ while (*text) {
+ if (*text == '\n')
+ newLines++;
+ text++;
+ }
+ return newLines+1;
+ } else {
+ return 0;
+ }
+}
+
+// Each allocated LineAnnotation is a char array which starts with an AnnotationHeader
+// and then has text and optional styles.
+
+static const int IndividualStyles = 0x100;
+
+struct AnnotationHeader {
+ short style; // Style IndividualStyles implies array of styles
+ short lines;
+ int length;
+};
+
+LineAnnotation::~LineAnnotation() {
+ ClearAll();
+}
+
+void LineAnnotation::Init() {
+ ClearAll();
+}
+
+void LineAnnotation::InsertLine(int line) {
+ if (annotations.Length()) {
+ annotations.EnsureLength(line);
+ annotations.Insert(line, 0);
+ }
+}
+
+void LineAnnotation::RemoveLine(int line) {
+ if (annotations.Length() && (line > 0) && (line <= annotations.Length())) {
+ delete []annotations[line-1];
+ annotations.Delete(line-1);
+ }
+}
+
+bool LineAnnotation::MultipleStyles(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
+ return reinterpret_cast<AnnotationHeader *>(annotations[line])->style == IndividualStyles;
+ else
+ return 0;
+}
+
+int LineAnnotation::Style(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
+ return reinterpret_cast<AnnotationHeader *>(annotations[line])->style;
+ else
+ return 0;
+}
+
+const char *LineAnnotation::Text(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
+ return annotations[line]+sizeof(AnnotationHeader);
+ else
+ return 0;
+}
+
+const unsigned char *LineAnnotation::Styles(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line] && MultipleStyles(line))
+ return reinterpret_cast<unsigned char *>(annotations[line] + sizeof(AnnotationHeader) + Length(line));
+ else
+ return 0;
+}
+
+static char *AllocateAnnotation(int length, int style) {
+ size_t len = sizeof(AnnotationHeader) + length + ((style == IndividualStyles) ? length : 0);
+ char *ret = new char[len];
+ memset(ret, 0, len);
+ return ret;
+}
+
+void LineAnnotation::SetText(int line, const char *text) {
+ if (text && (line >= 0)) {
+ annotations.EnsureLength(line+1);
+ int style = Style(line);
+ if (annotations[line]) {
+ delete []annotations[line];
+ }
+ annotations[line] = AllocateAnnotation(static_cast<int>(strlen(text)), style);
+ AnnotationHeader *pah = reinterpret_cast<AnnotationHeader *>(annotations[line]);
+ pah->style = static_cast<short>(style);
+ pah->length = static_cast<int>(strlen(text));
+ pah->lines = static_cast<short>(NumberLines(text));
+ memcpy(annotations[line]+sizeof(AnnotationHeader), text, pah->length);
+ } else {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) {
+ delete []annotations[line];
+ annotations[line] = 0;
+ }
+ }
+}
+
+void LineAnnotation::ClearAll() {
+ for (int line = 0; line < annotations.Length(); line++) {
+ delete []annotations[line];
+ annotations[line] = 0;
+ }
+ annotations.DeleteAll();
+}
+
+void LineAnnotation::SetStyle(int line, int style) {
+ annotations.EnsureLength(line+1);
+ if (!annotations[line]) {
+ annotations[line] = AllocateAnnotation(0, style);
+ }
+ reinterpret_cast<AnnotationHeader *>(annotations[line])->style = static_cast<short>(style);
+}
+
+void LineAnnotation::SetStyles(int line, const unsigned char *styles) {
+ if (line >= 0) {
+ annotations.EnsureLength(line+1);
+ if (!annotations[line]) {
+ annotations[line] = AllocateAnnotation(0, IndividualStyles);
+ } else {
+ AnnotationHeader *pahSource = reinterpret_cast<AnnotationHeader *>(annotations[line]);
+ if (pahSource->style != IndividualStyles) {
+ char *allocation = AllocateAnnotation(pahSource->length, IndividualStyles);
+ AnnotationHeader *pahAlloc = reinterpret_cast<AnnotationHeader *>(allocation);
+ pahAlloc->length = pahSource->length;
+ pahAlloc->lines = pahSource->lines;
+ memcpy(allocation + sizeof(AnnotationHeader), annotations[line] + sizeof(AnnotationHeader), pahSource->length);
+ delete []annotations[line];
+ annotations[line] = allocation;
+ }
+ }
+ AnnotationHeader *pah = reinterpret_cast<AnnotationHeader *>(annotations[line]);
+ pah->style = IndividualStyles;
+ memcpy(annotations[line] + sizeof(AnnotationHeader) + pah->length, styles, pah->length);
+ }
+}
+
+int LineAnnotation::Length(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
+ return reinterpret_cast<AnnotationHeader *>(annotations[line])->length;
+ else
+ return 0;
+}
+
+int LineAnnotation::Lines(int line) const {
+ if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line])
+ return reinterpret_cast<AnnotationHeader *>(annotations[line])->lines;
+ else
+ return 0;
+}
+
+LineTabstops::~LineTabstops() {
+ Init();
+}
+
+void LineTabstops::Init() {
+ for (int line = 0; line < tabstops.Length(); line++) {
+ delete tabstops[line];
+ }
+ tabstops.DeleteAll();
+}
+
+void LineTabstops::InsertLine(int line) {
+ if (tabstops.Length()) {
+ tabstops.EnsureLength(line);
+ tabstops.Insert(line, 0);
+ }
+}
+
+void LineTabstops::RemoveLine(int line) {
+ if (tabstops.Length() > line) {
+ delete tabstops[line];
+ tabstops.Delete(line);
+ }
+}
+
+bool LineTabstops::ClearTabstops(int line) {
+ if (line < tabstops.Length()) {
+ TabstopList *tl = tabstops[line];
+ if (tl) {
+ tl->clear();
+ return true;
+ }
+ }
+ return false;
+}
+
+bool LineTabstops::AddTabstop(int line, int x) {
+ tabstops.EnsureLength(line + 1);
+ if (!tabstops[line]) {
+ tabstops[line] = new TabstopList();
+ }
+
+ TabstopList *tl = tabstops[line];
+ if (tl) {
+ // tabstop positions are kept in order - insert in the right place
+ std::vector<int>::iterator it = std::lower_bound(tl->begin(), tl->end(), x);
+ // don't insert duplicates
+ if (it == tl->end() || *it != x) {
+ tl->insert(it, x);
+ return true;
+ }
+ }
+ return false;
+}
+
+int LineTabstops::GetNextTabstop(int line, int x) const {
+ if (line < tabstops.Length()) {
+ TabstopList *tl = tabstops[line];
+ if (tl) {
+ for (size_t i = 0; i < tl->size(); i++) {
+ if ((*tl)[i] > x) {
+ return (*tl)[i];
+ }
+ }
+ }
+ }
+ return 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.h b/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.h
new file mode 100644
index 00000000000..4bf1c88fdd6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/PerLine.h
@@ -0,0 +1,136 @@
+// Scintilla source code edit control
+/** @file PerLine.h
+ ** Manages data associated with each line of the document
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef PERLINE_H
+#define PERLINE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ * This holds the marker identifier and the marker type to display.
+ * MarkerHandleNumbers are members of lists.
+ */
+struct MarkerHandleNumber {
+ int handle;
+ int number;
+ MarkerHandleNumber *next;
+};
+
+/**
+ * A marker handle set contains any number of MarkerHandleNumbers.
+ */
+class MarkerHandleSet {
+ MarkerHandleNumber *root;
+
+public:
+ MarkerHandleSet();
+ ~MarkerHandleSet();
+ int Length() const;
+ int MarkValue() const; ///< Bit set of marker numbers.
+ bool Contains(int handle) const;
+ bool InsertHandle(int handle, int markerNum);
+ void RemoveHandle(int handle);
+ bool RemoveNumber(int markerNum, bool all);
+ void CombineWith(MarkerHandleSet *other);
+};
+
+class LineMarkers : public PerLine {
+ SplitVector<MarkerHandleSet *> markers;
+ /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big.
+ int handleCurrent;
+public:
+ LineMarkers() : handleCurrent(0) {
+ }
+ virtual ~LineMarkers();
+ virtual void Init();
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ int MarkValue(int line);
+ int MarkerNext(int lineStart, int mask) const;
+ int AddMark(int line, int marker, int lines);
+ void MergeMarkers(int pos);
+ bool DeleteMark(int line, int markerNum, bool all);
+ void DeleteMarkFromHandle(int markerHandle);
+ int LineFromHandle(int markerHandle);
+};
+
+class LineLevels : public PerLine {
+ SplitVector<int> levels;
+public:
+ virtual ~LineLevels();
+ virtual void Init();
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ void ExpandLevels(int sizeNew=-1);
+ void ClearLevels();
+ int SetLevel(int line, int level, int lines);
+ int GetLevel(int line) const;
+};
+
+class LineState : public PerLine {
+ SplitVector<int> lineStates;
+public:
+ LineState() {
+ }
+ virtual ~LineState();
+ virtual void Init();
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ int SetLineState(int line, int state);
+ int GetLineState(int line);
+ int GetMaxLineState() const;
+};
+
+class LineAnnotation : public PerLine {
+ SplitVector<char *> annotations;
+public:
+ LineAnnotation() {
+ }
+ virtual ~LineAnnotation();
+ virtual void Init();
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ bool MultipleStyles(int line) const;
+ int Style(int line) const;
+ const char *Text(int line) const;
+ const unsigned char *Styles(int line) const;
+ void SetText(int line, const char *text);
+ void ClearAll();
+ void SetStyle(int line, int style);
+ void SetStyles(int line, const unsigned char *styles);
+ int Length(int line) const;
+ int Lines(int line) const;
+};
+
+typedef std::vector<int> TabstopList;
+
+class LineTabstops : public PerLine {
+ SplitVector<TabstopList *> tabstops;
+public:
+ LineTabstops() {
+ }
+ virtual ~LineTabstops();
+ virtual void Init();
+ virtual void InsertLine(int line);
+ virtual void RemoveLine(int line);
+
+ bool ClearTabstops(int line);
+ bool AddTabstop(int line, int x);
+ int GetNextTabstop(int line, int x) const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.cxx
new file mode 100644
index 00000000000..860a780d9a8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.cxx
@@ -0,0 +1,703 @@
+// Scintilla source code edit control
+/** @file PositionCache.cxx
+ ** Classes for caching layout information.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LineLayout::LineLayout(int maxLineLength_) :
+ lineStarts(0),
+ lenLineStarts(0),
+ lineNumber(-1),
+ inCache(false),
+ maxLineLength(-1),
+ numCharsInLine(0),
+ numCharsBeforeEOL(0),
+ validity(llInvalid),
+ xHighlightGuide(0),
+ highlightColumn(0),
+ containsCaret(false),
+ edgeColumn(0),
+ chars(0),
+ styles(0),
+ positions(0),
+ hotspot(0,0),
+ widthLine(wrapWidthInfinite),
+ lines(1),
+ wrapIndent(0) {
+ bracePreviousStyles[0] = 0;
+ bracePreviousStyles[1] = 0;
+ Resize(maxLineLength_);
+}
+
+LineLayout::~LineLayout() {
+ Free();
+}
+
+void LineLayout::Resize(int maxLineLength_) {
+ if (maxLineLength_ > maxLineLength) {
+ Free();
+ chars = new char[maxLineLength_ + 1];
+ styles = new unsigned char[maxLineLength_ + 1];
+ // Extra position allocated as sometimes the Windows
+ // GetTextExtentExPoint API writes an extra element.
+ positions = new XYPOSITION[maxLineLength_ + 1 + 1];
+ maxLineLength = maxLineLength_;
+ }
+}
+
+void LineLayout::Free() {
+ delete []chars;
+ chars = 0;
+ delete []styles;
+ styles = 0;
+ delete []positions;
+ positions = 0;
+ delete []lineStarts;
+ lineStarts = 0;
+}
+
+void LineLayout::Invalidate(validLevel validity_) {
+ if (validity > validity_)
+ validity = validity_;
+}
+
+int LineLayout::LineStart(int line) const {
+ if (line <= 0) {
+ return 0;
+ } else if ((line >= lines) || !lineStarts) {
+ return numCharsInLine;
+ } else {
+ return lineStarts[line];
+ }
+}
+
+int LineLayout::LineLastVisible(int line) const {
+ if (line < 0) {
+ return 0;
+ } else if ((line >= lines-1) || !lineStarts) {
+ return numCharsBeforeEOL;
+ } else {
+ return lineStarts[line+1];
+ }
+}
+
+Range LineLayout::SubLineRange(int subLine) const {
+ return Range(LineStart(subLine), LineLastVisible(subLine));
+}
+
+bool LineLayout::InLine(int offset, int line) const {
+ return ((offset >= LineStart(line)) && (offset < LineStart(line + 1))) ||
+ ((offset == numCharsInLine) && (line == (lines-1)));
+}
+
+void LineLayout::SetLineStart(int line, int start) {
+ if ((line >= lenLineStarts) && (line != 0)) {
+ int newMaxLines = line + 20;
+ int *newLineStarts = new int[newMaxLines];
+ for (int i = 0; i < newMaxLines; i++) {
+ if (i < lenLineStarts)
+ newLineStarts[i] = lineStarts[i];
+ else
+ newLineStarts[i] = 0;
+ }
+ delete []lineStarts;
+ lineStarts = newLineStarts;
+ lenLineStarts = newMaxLines;
+ }
+ lineStarts[line] = start;
+}
+
+void LineLayout::SetBracesHighlight(Range rangeLine, const Position braces[],
+ char bracesMatchStyle, int xHighlight, bool ignoreStyle) {
+ if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) {
+ int braceOffset = braces[0] - rangeLine.start;
+ if (braceOffset < numCharsInLine) {
+ bracePreviousStyles[0] = styles[braceOffset];
+ styles[braceOffset] = bracesMatchStyle;
+ }
+ }
+ if (!ignoreStyle && rangeLine.ContainsCharacter(braces[1])) {
+ int braceOffset = braces[1] - rangeLine.start;
+ if (braceOffset < numCharsInLine) {
+ bracePreviousStyles[1] = styles[braceOffset];
+ styles[braceOffset] = bracesMatchStyle;
+ }
+ }
+ if ((braces[0] >= rangeLine.start && braces[1] <= rangeLine.end) ||
+ (braces[1] >= rangeLine.start && braces[0] <= rangeLine.end)) {
+ xHighlightGuide = xHighlight;
+ }
+}
+
+void LineLayout::RestoreBracesHighlight(Range rangeLine, const Position braces[], bool ignoreStyle) {
+ if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) {
+ int braceOffset = braces[0] - rangeLine.start;
+ if (braceOffset < numCharsInLine) {
+ styles[braceOffset] = bracePreviousStyles[0];
+ }
+ }
+ if (!ignoreStyle && rangeLine.ContainsCharacter(braces[1])) {
+ int braceOffset = braces[1] - rangeLine.start;
+ if (braceOffset < numCharsInLine) {
+ styles[braceOffset] = bracePreviousStyles[1];
+ }
+ }
+ xHighlightGuide = 0;
+}
+
+int LineLayout::FindBefore(XYPOSITION x, int lower, int upper) const {
+ do {
+ int middle = (upper + lower + 1) / 2; // Round high
+ XYPOSITION posMiddle = positions[middle];
+ if (x < posMiddle) {
+ upper = middle - 1;
+ } else {
+ lower = middle;
+ }
+ } while (lower < upper);
+ return lower;
+}
+
+
+int LineLayout::FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const {
+ int pos = FindBefore(x, range.start, range.end);
+ while (pos < range.end) {
+ if (charPosition) {
+ if (x < (positions[pos + 1])) {
+ return pos;
+ }
+ } else {
+ if (x < ((positions[pos] + positions[pos + 1]) / 2)) {
+ return pos;
+ }
+ }
+ pos++;
+ }
+ return range.end;
+}
+
+Point LineLayout::PointFromPosition(int posInLine, int lineHeight) const {
+ Point pt;
+ // In case of very long line put x at arbitrary large position
+ if (posInLine > maxLineLength) {
+ pt.x = positions[maxLineLength] - positions[LineStart(lines)];
+ }
+
+ for (int subLine = 0; subLine < lines; subLine++) {
+ const Range rangeSubLine = SubLineRange(subLine);
+ if (posInLine >= rangeSubLine.start) {
+ pt.y = static_cast<XYPOSITION>(subLine*lineHeight);
+ if (posInLine <= rangeSubLine.end) {
+ pt.x = positions[posInLine] - positions[rangeSubLine.start];
+ if (rangeSubLine.start != 0) // Wrapped lines may be indented
+ pt.x += wrapIndent;
+ }
+ } else {
+ break;
+ }
+ }
+ return pt;
+}
+
+int LineLayout::EndLineStyle() const {
+ return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0];
+}
+
+LineLayoutCache::LineLayoutCache() :
+ level(0),
+ allInvalidated(false), styleClock(-1), useCount(0) {
+ Allocate(0);
+}
+
+LineLayoutCache::~LineLayoutCache() {
+ Deallocate();
+}
+
+void LineLayoutCache::Allocate(size_t length_) {
+ PLATFORM_ASSERT(cache.empty());
+ allInvalidated = false;
+ cache.resize(length_);
+}
+
+void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
+ PLATFORM_ASSERT(useCount == 0);
+ size_t lengthForLevel = 0;
+ if (level == llcCaret) {
+ lengthForLevel = 1;
+ } else if (level == llcPage) {
+ lengthForLevel = linesOnScreen + 1;
+ } else if (level == llcDocument) {
+ lengthForLevel = linesInDoc;
+ }
+ if (lengthForLevel > cache.size()) {
+ Deallocate();
+ Allocate(lengthForLevel);
+ } else {
+ if (lengthForLevel < cache.size()) {
+ for (size_t i = lengthForLevel; i < cache.size(); i++) {
+ delete cache[i];
+ cache[i] = 0;
+ }
+ }
+ cache.resize(lengthForLevel);
+ }
+ PLATFORM_ASSERT(cache.size() == lengthForLevel);
+}
+
+void LineLayoutCache::Deallocate() {
+ PLATFORM_ASSERT(useCount == 0);
+ for (size_t i = 0; i < cache.size(); i++)
+ delete cache[i];
+ cache.clear();
+}
+
+void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) {
+ if (!cache.empty() && !allInvalidated) {
+ for (size_t i = 0; i < cache.size(); i++) {
+ if (cache[i]) {
+ cache[i]->Invalidate(validity_);
+ }
+ }
+ if (validity_ == LineLayout::llInvalid) {
+ allInvalidated = true;
+ }
+ }
+}
+
+void LineLayoutCache::SetLevel(int level_) {
+ allInvalidated = false;
+ if ((level_ != -1) && (level != level_)) {
+ level = level_;
+ Deallocate();
+ }
+}
+
+LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
+ int linesOnScreen, int linesInDoc) {
+ AllocateForLevel(linesOnScreen, linesInDoc);
+ if (styleClock != styleClock_) {
+ Invalidate(LineLayout::llCheckTextAndStyle);
+ styleClock = styleClock_;
+ }
+ allInvalidated = false;
+ int pos = -1;
+ LineLayout *ret = 0;
+ if (level == llcCaret) {
+ pos = 0;
+ } else if (level == llcPage) {
+ if (lineNumber == lineCaret) {
+ pos = 0;
+ } else if (cache.size() > 1) {
+ pos = 1 + (lineNumber % (cache.size() - 1));
+ }
+ } else if (level == llcDocument) {
+ pos = lineNumber;
+ }
+ if (pos >= 0) {
+ PLATFORM_ASSERT(useCount == 0);
+ if (!cache.empty() && (pos < static_cast<int>(cache.size()))) {
+ if (cache[pos]) {
+ if ((cache[pos]->lineNumber != lineNumber) ||
+ (cache[pos]->maxLineLength < maxChars)) {
+ delete cache[pos];
+ cache[pos] = 0;
+ }
+ }
+ if (!cache[pos]) {
+ cache[pos] = new LineLayout(maxChars);
+ }
+ cache[pos]->lineNumber = lineNumber;
+ cache[pos]->inCache = true;
+ ret = cache[pos];
+ useCount++;
+ }
+ }
+
+ if (!ret) {
+ ret = new LineLayout(maxChars);
+ ret->lineNumber = lineNumber;
+ }
+
+ return ret;
+}
+
+void LineLayoutCache::Dispose(LineLayout *ll) {
+ allInvalidated = false;
+ if (ll) {
+ if (!ll->inCache) {
+ delete ll;
+ } else {
+ useCount--;
+ }
+ }
+}
+
+// Simply pack the (maximum 4) character bytes into an int
+static inline int KeyFromString(const char *charBytes, size_t len) {
+ PLATFORM_ASSERT(len <= 4);
+ int k=0;
+ for (size_t i=0; i<len && charBytes[i]; i++) {
+ k = k * 0x100;
+ k += static_cast<unsigned char>(charBytes[i]);
+ }
+ return k;
+}
+
+SpecialRepresentations::SpecialRepresentations() {
+ std::fill(startByteHasReprs, startByteHasReprs+0x100, 0);
+}
+
+void SpecialRepresentations::SetRepresentation(const char *charBytes, const char *value) {
+ MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, UTF8MaxBytes));
+ if (it == mapReprs.end()) {
+ // New entry so increment for first byte
+ startByteHasReprs[static_cast<unsigned char>(charBytes[0])]++;
+ }
+ mapReprs[KeyFromString(charBytes, UTF8MaxBytes)] = Representation(value);
+}
+
+void SpecialRepresentations::ClearRepresentation(const char *charBytes) {
+ MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, UTF8MaxBytes));
+ if (it != mapReprs.end()) {
+ mapReprs.erase(it);
+ startByteHasReprs[static_cast<unsigned char>(charBytes[0])]--;
+ }
+}
+
+const Representation *SpecialRepresentations::RepresentationFromCharacter(const char *charBytes, size_t len) const {
+ PLATFORM_ASSERT(len <= 4);
+ if (!startByteHasReprs[static_cast<unsigned char>(charBytes[0])])
+ return 0;
+ MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes, len));
+ if (it != mapReprs.end()) {
+ return &(it->second);
+ }
+ return 0;
+}
+
+bool SpecialRepresentations::Contains(const char *charBytes, size_t len) const {
+ PLATFORM_ASSERT(len <= 4);
+ if (!startByteHasReprs[static_cast<unsigned char>(charBytes[0])])
+ return false;
+ MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes, len));
+ return it != mapReprs.end();
+}
+
+void SpecialRepresentations::Clear() {
+ mapReprs.clear();
+ std::fill(startByteHasReprs, startByteHasReprs+0x100, 0);
+}
+
+void BreakFinder::Insert(int val) {
+ if (val > nextBreak) {
+ const std::vector<int>::iterator it = std::lower_bound(selAndEdge.begin(), selAndEdge.end(), val);
+ if (it == selAndEdge.end()) {
+ selAndEdge.push_back(val);
+ } else if (*it != val) {
+ selAndEdge.insert(it, 1, val);
+ }
+ }
+}
+
+BreakFinder::BreakFinder(const LineLayout *ll_, const Selection *psel, Range lineRange_, int posLineStart_,
+ int xStart, bool breakForSelection, const Document *pdoc_, const SpecialRepresentations *preprs_, const ViewStyle *pvsDraw) :
+ ll(ll_),
+ lineRange(lineRange_),
+ posLineStart(posLineStart_),
+ nextBreak(lineRange_.start),
+ saeCurrentPos(0),
+ saeNext(0),
+ subBreak(-1),
+ pdoc(pdoc_),
+ encodingFamily(pdoc_->CodePageFamily()),
+ preprs(preprs_) {
+
+ // Search for first visible break
+ // First find the first visible character
+ if (xStart > 0.0f)
+ nextBreak = ll->FindBefore(static_cast<XYPOSITION>(xStart), lineRange.start, lineRange.end);
+ // Now back to a style break
+ while ((nextBreak > lineRange.start) && (ll->styles[nextBreak] == ll->styles[nextBreak - 1])) {
+ nextBreak--;
+ }
+
+ if (breakForSelection) {
+ SelectionPosition posStart(posLineStart);
+ SelectionPosition posEnd(posLineStart + lineRange.end);
+ SelectionSegment segmentLine(posStart, posEnd);
+ for (size_t r=0; r<psel->Count(); r++) {
+ SelectionSegment portion = psel->Range(r).Intersect(segmentLine);
+ if (!(portion.start == portion.end)) {
+ if (portion.start.IsValid())
+ Insert(portion.start.Position() - posLineStart);
+ if (portion.end.IsValid())
+ Insert(portion.end.Position() - posLineStart);
+ }
+ }
+ }
+ if (pvsDraw && pvsDraw->indicatorsSetFore > 0) {
+ for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) {
+ if (pvsDraw->indicators[deco->indicator].OverridesTextFore()) {
+ int startPos = deco->rs.EndRun(posLineStart);
+ while (startPos < (posLineStart + lineRange.end)) {
+ Insert(startPos - posLineStart);
+ startPos = deco->rs.EndRun(startPos);
+ }
+ }
+ }
+ }
+ Insert(ll->edgeColumn);
+ Insert(lineRange.end);
+ saeNext = (!selAndEdge.empty()) ? selAndEdge[0] : -1;
+}
+
+BreakFinder::~BreakFinder() {
+}
+
+TextSegment BreakFinder::Next() {
+ if (subBreak == -1) {
+ int prev = nextBreak;
+ while (nextBreak < lineRange.end) {
+ int charWidth = 1;
+ if (encodingFamily == efUnicode)
+ charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(ll->chars) + nextBreak, lineRange.end - nextBreak);
+ else if (encodingFamily == efDBCS)
+ charWidth = pdoc->IsDBCSLeadByte(ll->chars[nextBreak]) ? 2 : 1;
+ const Representation *repr = preprs->RepresentationFromCharacter(ll->chars + nextBreak, charWidth);
+ if (((nextBreak > 0) && (ll->styles[nextBreak] != ll->styles[nextBreak - 1])) ||
+ repr ||
+ (nextBreak == saeNext)) {
+ while ((nextBreak >= saeNext) && (saeNext < lineRange.end)) {
+ saeCurrentPos++;
+ saeNext = (saeCurrentPos < selAndEdge.size()) ? selAndEdge[saeCurrentPos] : lineRange.end;
+ }
+ if ((nextBreak > prev) || repr) {
+ // Have a segment to report
+ if (nextBreak == prev) {
+ nextBreak += charWidth;
+ } else {
+ repr = 0; // Optimize -> should remember repr
+ }
+ if ((nextBreak - prev) < lengthStartSubdivision) {
+ return TextSegment(prev, nextBreak - prev, repr);
+ } else {
+ break;
+ }
+ }
+ }
+ nextBreak += charWidth;
+ }
+ if ((nextBreak - prev) < lengthStartSubdivision) {
+ return TextSegment(prev, nextBreak - prev);
+ }
+ subBreak = prev;
+ }
+ // Splitting up a long run from prev to nextBreak in lots of approximately lengthEachSubdivision.
+ // For very long runs add extra breaks after spaces or if no spaces before low punctuation.
+ int startSegment = subBreak;
+ if ((nextBreak - subBreak) <= lengthEachSubdivision) {
+ subBreak = -1;
+ return TextSegment(startSegment, nextBreak - startSegment);
+ } else {
+ subBreak += pdoc->SafeSegment(ll->chars + subBreak, nextBreak-subBreak, lengthEachSubdivision);
+ if (subBreak >= nextBreak) {
+ subBreak = -1;
+ return TextSegment(startSegment, nextBreak - startSegment);
+ } else {
+ return TextSegment(startSegment, subBreak - startSegment);
+ }
+ }
+}
+
+bool BreakFinder::More() const {
+ return (subBreak >= 0) || (nextBreak < lineRange.end);
+}
+
+PositionCacheEntry::PositionCacheEntry() :
+ styleNumber(0), len(0), clock(0), positions(0) {
+}
+
+void PositionCacheEntry::Set(unsigned int styleNumber_, const char *s_,
+ unsigned int len_, XYPOSITION *positions_, unsigned int clock_) {
+ Clear();
+ styleNumber = styleNumber_;
+ len = len_;
+ clock = clock_;
+ if (s_ && positions_) {
+ positions = new XYPOSITION[len + (len / 4) + 1];
+ for (unsigned int i=0; i<len; i++) {
+ positions[i] = positions_[i];
+ }
+ memcpy(reinterpret_cast<char *>(reinterpret_cast<void *>(positions + len)), s_, len);
+ }
+}
+
+PositionCacheEntry::~PositionCacheEntry() {
+ Clear();
+}
+
+void PositionCacheEntry::Clear() {
+ delete []positions;
+ positions = 0;
+ styleNumber = 0;
+ len = 0;
+ clock = 0;
+}
+
+bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_,
+ unsigned int len_, XYPOSITION *positions_) const {
+ if ((styleNumber == styleNumber_) && (len == len_) &&
+ (memcmp(reinterpret_cast<char *>(reinterpret_cast<void *>(positions + len)), s_, len)== 0)) {
+ for (unsigned int i=0; i<len; i++) {
+ positions_[i] = positions[i];
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
+unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) {
+ unsigned int ret = s[0] << 7;
+ for (unsigned int i=0; i<len_; i++) {
+ ret *= 1000003;
+ ret ^= s[i];
+ }
+ ret *= 1000003;
+ ret ^= len_;
+ ret *= 1000003;
+ ret ^= styleNumber_;
+ return ret;
+}
+
+bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const {
+ return clock > other.clock;
+}
+
+void PositionCacheEntry::ResetClock() {
+ if (clock > 0) {
+ clock = 1;
+ }
+}
+
+PositionCache::PositionCache() {
+ clock = 1;
+ pces.resize(0x400);
+ allClear = true;
+}
+
+PositionCache::~PositionCache() {
+ Clear();
+}
+
+void PositionCache::Clear() {
+ if (!allClear) {
+ for (size_t i=0; i<pces.size(); i++) {
+ pces[i].Clear();
+ }
+ }
+ clock = 1;
+ allClear = true;
+}
+
+void PositionCache::SetSize(size_t size_) {
+ Clear();
+ pces.resize(size_);
+}
+
+void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, unsigned int styleNumber,
+ const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc) {
+
+ allClear = false;
+ size_t probe = pces.size(); // Out of bounds
+ if ((!pces.empty()) && (len < 30)) {
+ // Only store short strings in the cache so it doesn't churn with
+ // long comments with only a single comment.
+
+ // Two way associative: try two probe positions.
+ unsigned int hashValue = PositionCacheEntry::Hash(styleNumber, s, len);
+ probe = hashValue % pces.size();
+ if (pces[probe].Retrieve(styleNumber, s, len, positions)) {
+ return;
+ }
+ unsigned int probe2 = (hashValue * 37) % pces.size();
+ if (pces[probe2].Retrieve(styleNumber, s, len, positions)) {
+ return;
+ }
+ // Not found. Choose the oldest of the two slots to replace
+ if (pces[probe].NewerThan(pces[probe2])) {
+ probe = probe2;
+ }
+ }
+ if (len > BreakFinder::lengthStartSubdivision) {
+ // Break up into segments
+ unsigned int startSegment = 0;
+ XYPOSITION xStartSegment = 0;
+ while (startSegment < len) {
+ unsigned int lenSegment = pdoc->SafeSegment(s + startSegment, len - startSegment, BreakFinder::lengthEachSubdivision);
+ FontAlias fontStyle = vstyle.styles[styleNumber].font;
+ surface->MeasureWidths(fontStyle, s + startSegment, lenSegment, positions + startSegment);
+ for (unsigned int inSeg = 0; inSeg < lenSegment; inSeg++) {
+ positions[startSegment + inSeg] += xStartSegment;
+ }
+ xStartSegment = positions[startSegment + lenSegment - 1];
+ startSegment += lenSegment;
+ }
+ } else {
+ FontAlias fontStyle = vstyle.styles[styleNumber].font;
+ surface->MeasureWidths(fontStyle, s, len, positions);
+ }
+ if (probe < pces.size()) {
+ // Store into cache
+ clock++;
+ if (clock > 60000) {
+ // Since there are only 16 bits for the clock, wrap it round and
+ // reset all cache entries so none get stuck with a high clock.
+ for (size_t i=0; i<pces.size(); i++) {
+ pces[i].ResetClock();
+ }
+ clock = 2;
+ }
+ pces[probe].Set(styleNumber, s, len, positions, clock);
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.h b/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.h
new file mode 100644
index 00000000000..edc0a5ddb3e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/PositionCache.h
@@ -0,0 +1,201 @@
+// Scintilla source code edit control
+/** @file PositionCache.h
+ ** Classes for caching layout information.
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef POSITIONCACHE_H
+#define POSITIONCACHE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+static inline bool IsEOLChar(char ch) {
+ return (ch == '\r') || (ch == '\n');
+}
+
+/**
+ */
+class LineLayout {
+private:
+ friend class LineLayoutCache;
+ int *lineStarts;
+ int lenLineStarts;
+ /// Drawing is only performed for @a maxLineLength characters on each line.
+ int lineNumber;
+ bool inCache;
+public:
+ enum { wrapWidthInfinite = 0x7ffffff };
+ int maxLineLength;
+ int numCharsInLine;
+ int numCharsBeforeEOL;
+ enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity;
+ int xHighlightGuide;
+ bool highlightColumn;
+ bool containsCaret;
+ int edgeColumn;
+ char *chars;
+ unsigned char *styles;
+ XYPOSITION *positions;
+ char bracePreviousStyles[2];
+
+ // Hotspot support
+ Range hotspot;
+
+ // Wrapped line support
+ int widthLine;
+ int lines;
+ XYPOSITION wrapIndent; // In pixels
+
+ explicit LineLayout(int maxLineLength_);
+ virtual ~LineLayout();
+ void Resize(int maxLineLength_);
+ void Free();
+ void Invalidate(validLevel validity_);
+ int LineStart(int line) const;
+ int LineLastVisible(int line) const;
+ Range SubLineRange(int line) const;
+ bool InLine(int offset, int line) const;
+ void SetLineStart(int line, int start);
+ void SetBracesHighlight(Range rangeLine, const Position braces[],
+ char bracesMatchStyle, int xHighlight, bool ignoreStyle);
+ void RestoreBracesHighlight(Range rangeLine, const Position braces[], bool ignoreStyle);
+ int FindBefore(XYPOSITION x, int lower, int upper) const;
+ int FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const;
+ Point PointFromPosition(int posInLine, int lineHeight) const;
+ int EndLineStyle() const;
+};
+
+/**
+ */
+class LineLayoutCache {
+ int level;
+ std::vector<LineLayout *>cache;
+ bool allInvalidated;
+ int styleClock;
+ int useCount;
+ void Allocate(size_t length_);
+ void AllocateForLevel(int linesOnScreen, int linesInDoc);
+public:
+ LineLayoutCache();
+ virtual ~LineLayoutCache();
+ void Deallocate();
+ enum {
+ llcNone=SC_CACHE_NONE,
+ llcCaret=SC_CACHE_CARET,
+ llcPage=SC_CACHE_PAGE,
+ llcDocument=SC_CACHE_DOCUMENT
+ };
+ void Invalidate(LineLayout::validLevel validity_);
+ void SetLevel(int level_);
+ int GetLevel() const { return level; }
+ LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
+ int linesOnScreen, int linesInDoc);
+ void Dispose(LineLayout *ll);
+};
+
+class PositionCacheEntry {
+ unsigned int styleNumber:8;
+ unsigned int len:8;
+ unsigned int clock:16;
+ XYPOSITION *positions;
+public:
+ PositionCacheEntry();
+ ~PositionCacheEntry();
+ void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock_);
+ void Clear();
+ bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const;
+ static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len);
+ bool NewerThan(const PositionCacheEntry &other) const;
+ void ResetClock();
+};
+
+class Representation {
+public:
+ std::string stringRep;
+ explicit Representation(const char *value="") : stringRep(value) {
+ }
+};
+
+typedef std::map<int, Representation> MapRepresentation;
+
+class SpecialRepresentations {
+ MapRepresentation mapReprs;
+ short startByteHasReprs[0x100];
+public:
+ SpecialRepresentations();
+ void SetRepresentation(const char *charBytes, const char *value);
+ void ClearRepresentation(const char *charBytes);
+ const Representation *RepresentationFromCharacter(const char *charBytes, size_t len) const;
+ bool Contains(const char *charBytes, size_t len) const;
+ void Clear();
+};
+
+struct TextSegment {
+ int start;
+ int length;
+ const Representation *representation;
+ TextSegment(int start_=0, int length_=0, const Representation *representation_=0) :
+ start(start_), length(length_), representation(representation_) {
+ }
+ int end() const {
+ return start + length;
+ }
+};
+
+// Class to break a line of text into shorter runs at sensible places.
+class BreakFinder {
+ const LineLayout *ll;
+ Range lineRange;
+ int posLineStart;
+ int nextBreak;
+ std::vector<int> selAndEdge;
+ unsigned int saeCurrentPos;
+ int saeNext;
+ int subBreak;
+ const Document *pdoc;
+ EncodingFamily encodingFamily;
+ const SpecialRepresentations *preprs;
+ void Insert(int val);
+ // Private so BreakFinder objects can not be copied
+ BreakFinder(const BreakFinder &);
+public:
+ // If a whole run is longer than lengthStartSubdivision then subdivide
+ // into smaller runs at spaces or punctuation.
+ enum { lengthStartSubdivision = 300 };
+ // Try to make each subdivided run lengthEachSubdivision or shorter.
+ enum { lengthEachSubdivision = 100 };
+ BreakFinder(const LineLayout *ll_, const Selection *psel, Range rangeLine_, int posLineStart_,
+ int xStart, bool breakForSelection, const Document *pdoc_, const SpecialRepresentations *preprs_, const ViewStyle *pvsDraw);
+ ~BreakFinder();
+ TextSegment Next();
+ bool More() const;
+};
+
+class PositionCache {
+ std::vector<PositionCacheEntry> pces;
+ unsigned int clock;
+ bool allClear;
+ // Private so PositionCache objects can not be copied
+ PositionCache(const PositionCache &);
+public:
+ PositionCache();
+ ~PositionCache();
+ void Clear();
+ void SetSize(size_t size_);
+ size_t GetSize() const { return pces.size(); }
+ void MeasureWidths(Surface *surface, const ViewStyle &vstyle, unsigned int styleNumber,
+ const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc);
+};
+
+inline bool IsSpaceOrTab(int ch) {
+ return ch == ' ' || ch == '\t';
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.cxx
new file mode 100644
index 00000000000..2824a5b707a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.cxx
@@ -0,0 +1,960 @@
+// Scintilla source code edit control
+/** @file RESearch.cxx
+ ** Regular expression search library.
+ **/
+
+/*
+ * regex - Regular expression pattern matching and replacement
+ *
+ * By: Ozan S. Yigit (oz)
+ * Dept. of Computer Science
+ * York University
+ *
+ * Original code available from http://www.cs.yorku.ca/~oz/
+ * Translation to C++ by Neil Hodgson neilh@scintilla.org
+ * Removed all use of register.
+ * Converted to modern function prototypes.
+ * Put all global/static variables into an object so this code can be
+ * used from multiple threads, etc.
+ * Some extensions by Philippe Lhoste PhiLho(a)GMX.net
+ * '?' extensions by Michael Mullin masmullin@gmail.com
+ *
+ * These routines are the PUBLIC DOMAIN equivalents of regex
+ * routines as found in 4.nBSD UN*X, with minor extensions.
+ *
+ * These routines are derived from various implementations found
+ * in software tools books, and Conroy's grep. They are NOT derived
+ * from licensed/restricted software.
+ * For more interesting/academic/complicated implementations,
+ * see Henry Spencer's regexp routines, or GNU Emacs pattern
+ * matching module.
+ *
+ * Modification history removed.
+ *
+ * Interfaces:
+ * RESearch::Compile: compile a regular expression into a NFA.
+ *
+ * const char *RESearch::Compile(const char *pattern, int length,
+ * bool caseSensitive, bool posix)
+ *
+ * Returns a short error string if they fail.
+ *
+ * RESearch::Execute: execute the NFA to match a pattern.
+ *
+ * int RESearch::Execute(characterIndexer &ci, int lp, int endp)
+ *
+ * re_fail: failure routine for RESearch::Execute. (no longer used)
+ *
+ * void re_fail(char *msg, char op)
+ *
+ * Regular Expressions:
+ *
+ * [1] char matches itself, unless it is a special
+ * character (metachar): . \ [ ] * + ? ^ $
+ * and ( ) if posix option.
+ *
+ * [2] . matches any character.
+ *
+ * [3] \ matches the character following it, except:
+ * - \a, \b, \f, \n, \r, \t, \v match the corresponding C
+ * escape char, respectively BEL, BS, FF, LF, CR, TAB and VT;
+ * Note that \r and \n are never matched because Scintilla
+ * regex searches are made line per line
+ * (stripped of end-of-line chars).
+ * - if not in posix mode, when followed by a
+ * left or right round bracket (see [8]);
+ * - when followed by a digit 1 to 9 (see [9]);
+ * - when followed by a left or right angle bracket
+ * (see [10]);
+ * - when followed by d, D, s, S, w or W (see [11]);
+ * - when followed by x and two hexa digits (see [12].
+ * Backslash is used as an escape character for all
+ * other meta-characters, and itself.
+ *
+ * [4] [set] matches one of the characters in the set.
+ * If the first character in the set is "^",
+ * it matches the characters NOT in the set, i.e.
+ * complements the set. A shorthand S-E (start dash end)
+ * is used to specify a set of characters S up to
+ * E, inclusive. S and E must be characters, otherwise
+ * the dash is taken literally (eg. in expression [\d-a]).
+ * The special characters "]" and "-" have no special
+ * meaning if they appear as the first chars in the set.
+ * To include both, put - first: [-]A-Z]
+ * (or just backslash them).
+ * examples: match:
+ *
+ * [-]|] matches these 3 chars,
+ *
+ * []-|] matches from ] to | chars
+ *
+ * [a-z] any lowercase alpha
+ *
+ * [^-]] any char except - and ]
+ *
+ * [^A-Z] any char except uppercase
+ * alpha
+ *
+ * [a-zA-Z] any alpha
+ *
+ * [5] * any regular expression form [1] to [4]
+ * (except [8], [9] and [10] forms of [3]),
+ * followed by closure char (*)
+ * matches zero or more matches of that form.
+ *
+ * [6] + same as [5], except it matches one or more.
+ *
+ * [5-6] Both [5] and [6] are greedy (they match as much as possible).
+ * Unless they are followed by the 'lazy' quantifier (?)
+ * In which case both [5] and [6] try to match as little as possible
+ *
+ * [7] ? same as [5] except it matches zero or one.
+ *
+ * [8] a regular expression in the form [1] to [13], enclosed
+ * as \(form\) (or (form) with posix flag) matches what
+ * form matches. The enclosure creates a set of tags,
+ * used for [9] and for pattern substitution.
+ * The tagged forms are numbered starting from 1.
+ *
+ * [9] a \ followed by a digit 1 to 9 matches whatever a
+ * previously tagged regular expression ([8]) matched.
+ *
+ * [10] \< a regular expression starting with a \< construct
+ * \> and/or ending with a \> construct, restricts the
+ * pattern matching to the beginning of a word, and/or
+ * the end of a word. A word is defined to be a character
+ * string beginning and/or ending with the characters
+ * A-Z a-z 0-9 and _. Scintilla extends this definition
+ * by user setting. The word must also be preceded and/or
+ * followed by any character outside those mentioned.
+ *
+ * [11] \l a backslash followed by d, D, s, S, w or W,
+ * becomes a character class (both inside and
+ * outside sets []).
+ * d: decimal digits
+ * D: any char except decimal digits
+ * s: whitespace (space, \t \n \r \f \v)
+ * S: any char except whitespace (see above)
+ * w: alphanumeric & underscore (changed by user setting)
+ * W: any char except alphanumeric & underscore (see above)
+ *
+ * [12] \xHH a backslash followed by x and two hexa digits,
+ * becomes the character whose Ascii code is equal
+ * to these digits. If not followed by two digits,
+ * it is 'x' char itself.
+ *
+ * [13] a composite regular expression xy where x and y
+ * are in the form [1] to [12] matches the longest
+ * match of x followed by a match for y.
+ *
+ * [14] ^ a regular expression starting with a ^ character
+ * $ and/or ending with a $ character, restricts the
+ * pattern matching to the beginning of the line,
+ * or the end of line. [anchors] Elsewhere in the
+ * pattern, ^ and $ are treated as ordinary characters.
+ *
+ *
+ * Acknowledgements:
+ *
+ * HCR's Hugh Redelmeier has been most helpful in various
+ * stages of development. He convinced me to include BOW
+ * and EOW constructs, originally invented by Rob Pike at
+ * the University of Toronto.
+ *
+ * References:
+ * Software tools Kernighan & Plauger
+ * Software tools in Pascal Kernighan & Plauger
+ * Grep [rsx-11 C dist] David Conroy
+ * ed - text editor Un*x Programmer's Manual
+ * Advanced editing on Un*x B. W. Kernighan
+ * RegExp routines Henry Spencer
+ *
+ * Notes:
+ *
+ * This implementation uses a bit-set representation for character
+ * classes for speed and compactness. Each character is represented
+ * by one bit in a 256-bit block. Thus, CCL always takes a
+ * constant 32 bytes in the internal nfa, and RESearch::Execute does a single
+ * bit comparison to locate the character in the set.
+ *
+ * Examples:
+ *
+ * pattern: foo*.*
+ * compile: CHR f CHR o CLO CHR o END CLO ANY END END
+ * matches: fo foo fooo foobar fobar foxx ...
+ *
+ * pattern: fo[ob]a[rz]
+ * compile: CHR f CHR o CCL bitset CHR a CCL bitset END
+ * matches: fobar fooar fobaz fooaz
+ *
+ * pattern: foo\\+
+ * compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END
+ * matches: foo\ foo\\ foo\\\ ...
+ *
+ * pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo)
+ * compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END
+ * matches: foo1foo foo2foo foo3foo
+ *
+ * pattern: \(fo.*\)-\1
+ * compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END
+ * matches: foo-foo fo-fo fob-fob foobar-foobar ...
+ */
+
+#include <stdlib.h>
+
+#include <string>
+#include <algorithm>
+
+#include "CharClassify.h"
+#include "RESearch.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#define OKP 1
+#define NOP 0
+
+#define CHR 1
+#define ANY 2
+#define CCL 3
+#define BOL 4
+#define EOL 5
+#define BOT 6
+#define EOT 7
+#define BOW 8
+#define EOW 9
+#define REF 10
+#define CLO 11
+#define CLQ 12 /* 0 to 1 closure */
+#define LCLO 13 /* lazy closure */
+
+#define END 0
+
+/*
+ * The following defines are not meant to be changeable.
+ * They are for readability only.
+ */
+#define BLKIND 0370
+#define BITIND 07
+
+const char bitarr[] = { 1, 2, 4, 8, 16, 32, 64, '\200' };
+
+#define badpat(x) (*nfa = END, x)
+
+/*
+ * Character classification table for word boundary operators BOW
+ * and EOW is passed in by the creator of this object (Scintilla
+ * Document). The Document default state is that word chars are:
+ * 0-9, a-z, A-Z and _
+ */
+
+RESearch::RESearch(CharClassify *charClassTable) {
+ failure = 0;
+ charClass = charClassTable;
+ sta = NOP; /* status of lastpat */
+ bol = 0;
+ std::fill(bittab, bittab + BITBLK, 0);
+ std::fill(tagstk, tagstk + MAXTAG, 0);
+ std::fill(nfa, nfa + MAXNFA, 0);
+ Clear();
+}
+
+RESearch::~RESearch() {
+ Clear();
+}
+
+void RESearch::Clear() {
+ for (int i = 0; i < MAXTAG; i++) {
+ pat[i].clear();
+ bopat[i] = NOTFOUND;
+ eopat[i] = NOTFOUND;
+ }
+}
+
+void RESearch::GrabMatches(CharacterIndexer &ci) {
+ for (unsigned int i = 0; i < MAXTAG; i++) {
+ if ((bopat[i] != NOTFOUND) && (eopat[i] != NOTFOUND)) {
+ unsigned int len = eopat[i] - bopat[i];
+ pat[i].resize(len);
+ for (unsigned int j = 0; j < len; j++)
+ pat[i][j] = ci.CharAt(bopat[i] + j);
+ }
+ }
+}
+
+void RESearch::ChSet(unsigned char c) {
+ bittab[((c) & BLKIND) >> 3] |= bitarr[(c) & BITIND];
+}
+
+void RESearch::ChSetWithCase(unsigned char c, bool caseSensitive) {
+ if (caseSensitive) {
+ ChSet(c);
+ } else {
+ if ((c >= 'a') && (c <= 'z')) {
+ ChSet(c);
+ ChSet(static_cast<unsigned char>(c - 'a' + 'A'));
+ } else if ((c >= 'A') && (c <= 'Z')) {
+ ChSet(c);
+ ChSet(static_cast<unsigned char>(c - 'A' + 'a'));
+ } else {
+ ChSet(c);
+ }
+ }
+}
+
+unsigned char escapeValue(unsigned char ch) {
+ switch (ch) {
+ case 'a': return '\a';
+ case 'b': return '\b';
+ case 'f': return '\f';
+ case 'n': return '\n';
+ case 'r': return '\r';
+ case 't': return '\t';
+ case 'v': return '\v';
+ }
+ return 0;
+}
+
+static int GetHexaChar(unsigned char hd1, unsigned char hd2) {
+ int hexValue = 0;
+ if (hd1 >= '0' && hd1 <= '9') {
+ hexValue += 16 * (hd1 - '0');
+ } else if (hd1 >= 'A' && hd1 <= 'F') {
+ hexValue += 16 * (hd1 - 'A' + 10);
+ } else if (hd1 >= 'a' && hd1 <= 'f') {
+ hexValue += 16 * (hd1 - 'a' + 10);
+ } else {
+ return -1;
+ }
+ if (hd2 >= '0' && hd2 <= '9') {
+ hexValue += hd2 - '0';
+ } else if (hd2 >= 'A' && hd2 <= 'F') {
+ hexValue += hd2 - 'A' + 10;
+ } else if (hd2 >= 'a' && hd2 <= 'f') {
+ hexValue += hd2 - 'a' + 10;
+ } else {
+ return -1;
+ }
+ return hexValue;
+}
+
+/**
+ * Called when the parser finds a backslash not followed
+ * by a valid expression (like \( in non-Posix mode).
+ * @param pattern : pointer on the char after the backslash.
+ * @param incr : (out) number of chars to skip after expression evaluation.
+ * @return the char if it resolves to a simple char,
+ * or -1 for a char class. In this case, bittab is changed.
+ */
+int RESearch::GetBackslashExpression(
+ const char *pattern,
+ int &incr) {
+ // Since error reporting is primitive and messages are not used anyway,
+ // I choose to interpret unexpected syntax in a logical way instead
+ // of reporting errors. Otherwise, we can stick on, eg., PCRE behavior.
+ incr = 0; // Most of the time, will skip the char "naturally".
+ int c;
+ int result = -1;
+ unsigned char bsc = *pattern;
+ if (!bsc) {
+ // Avoid overrun
+ result = '\\'; // \ at end of pattern, take it literally
+ return result;
+ }
+
+ switch (bsc) {
+ case 'a':
+ case 'b':
+ case 'n':
+ case 'f':
+ case 'r':
+ case 't':
+ case 'v':
+ result = escapeValue(bsc);
+ break;
+ case 'x': {
+ unsigned char hd1 = *(pattern + 1);
+ unsigned char hd2 = *(pattern + 2);
+ int hexValue = GetHexaChar(hd1, hd2);
+ if (hexValue >= 0) {
+ result = hexValue;
+ incr = 2; // Must skip the digits
+ } else {
+ result = 'x'; // \x without 2 digits: see it as 'x'
+ }
+ }
+ break;
+ case 'd':
+ for (c = '0'; c <= '9'; c++) {
+ ChSet(static_cast<unsigned char>(c));
+ }
+ break;
+ case 'D':
+ for (c = 0; c < MAXCHR; c++) {
+ if (c < '0' || c > '9') {
+ ChSet(static_cast<unsigned char>(c));
+ }
+ }
+ break;
+ case 's':
+ ChSet(' ');
+ ChSet('\t');
+ ChSet('\n');
+ ChSet('\r');
+ ChSet('\f');
+ ChSet('\v');
+ break;
+ case 'S':
+ for (c = 0; c < MAXCHR; c++) {
+ if (c != ' ' && !(c >= 0x09 && c <= 0x0D)) {
+ ChSet(static_cast<unsigned char>(c));
+ }
+ }
+ break;
+ case 'w':
+ for (c = 0; c < MAXCHR; c++) {
+ if (iswordc(static_cast<unsigned char>(c))) {
+ ChSet(static_cast<unsigned char>(c));
+ }
+ }
+ break;
+ case 'W':
+ for (c = 0; c < MAXCHR; c++) {
+ if (!iswordc(static_cast<unsigned char>(c))) {
+ ChSet(static_cast<unsigned char>(c));
+ }
+ }
+ break;
+ default:
+ result = bsc;
+ }
+ return result;
+}
+
+const char *RESearch::Compile(const char *pattern, int length, bool caseSensitive, bool posix) {
+ char *mp=nfa; /* nfa pointer */
+ char *lp; /* saved pointer */
+ char *sp=nfa; /* another one */
+ char *mpMax = mp + MAXNFA - BITBLK - 10;
+
+ int tagi = 0; /* tag stack index */
+ int tagc = 1; /* actual tag count */
+
+ int n;
+ char mask; /* xor mask -CCL/NCL */
+ int c1, c2, prevChar;
+
+ if (!pattern || !length) {
+ if (sta)
+ return 0;
+ else
+ return badpat("No previous regular expression");
+ }
+ sta = NOP;
+
+ const char *p=pattern; /* pattern pointer */
+ for (int i=0; i<length; i++, p++) {
+ if (mp > mpMax)
+ return badpat("Pattern too long");
+ lp = mp;
+ switch (*p) {
+
+ case '.': /* match any char */
+ *mp++ = ANY;
+ break;
+
+ case '^': /* match beginning */
+ if (p == pattern) {
+ *mp++ = BOL;
+ } else {
+ *mp++ = CHR;
+ *mp++ = *p;
+ }
+ break;
+
+ case '$': /* match endofline */
+ if (!*(p+1)) {
+ *mp++ = EOL;
+ } else {
+ *mp++ = CHR;
+ *mp++ = *p;
+ }
+ break;
+
+ case '[': /* match char class */
+ *mp++ = CCL;
+ prevChar = 0;
+
+ i++;
+ if (*++p == '^') {
+ mask = '\377';
+ i++;
+ p++;
+ } else {
+ mask = 0;
+ }
+
+ if (*p == '-') { /* real dash */
+ i++;
+ prevChar = *p;
+ ChSet(*p++);
+ }
+ if (*p == ']') { /* real brace */
+ i++;
+ prevChar = *p;
+ ChSet(*p++);
+ }
+ while (*p && *p != ']') {
+ if (*p == '-') {
+ if (prevChar < 0) {
+ // Previous def. was a char class like \d, take dash literally
+ prevChar = *p;
+ ChSet(*p);
+ } else if (*(p+1)) {
+ if (*(p+1) != ']') {
+ c1 = prevChar + 1;
+ i++;
+ c2 = static_cast<unsigned char>(*++p);
+ if (c2 == '\\') {
+ if (!*(p+1)) { // End of RE
+ return badpat("Missing ]");
+ } else {
+ i++;
+ p++;
+ int incr;
+ c2 = GetBackslashExpression(p, incr);
+ i += incr;
+ p += incr;
+ if (c2 >= 0) {
+ // Convention: \c (c is any char) is case sensitive, whatever the option
+ ChSet(static_cast<unsigned char>(c2));
+ prevChar = c2;
+ } else {
+ // bittab is already changed
+ prevChar = -1;
+ }
+ }
+ }
+ if (prevChar < 0) {
+ // Char after dash is char class like \d, take dash literally
+ prevChar = '-';
+ ChSet('-');
+ } else {
+ // Put all chars between c1 and c2 included in the char set
+ while (c1 <= c2) {
+ ChSetWithCase(static_cast<unsigned char>(c1++), caseSensitive);
+ }
+ }
+ } else {
+ // Dash before the ], take it literally
+ prevChar = *p;
+ ChSet(*p);
+ }
+ } else {
+ return badpat("Missing ]");
+ }
+ } else if (*p == '\\' && *(p+1)) {
+ i++;
+ p++;
+ int incr;
+ int c = GetBackslashExpression(p, incr);
+ i += incr;
+ p += incr;
+ if (c >= 0) {
+ // Convention: \c (c is any char) is case sensitive, whatever the option
+ ChSet(static_cast<unsigned char>(c));
+ prevChar = c;
+ } else {
+ // bittab is already changed
+ prevChar = -1;
+ }
+ } else {
+ prevChar = static_cast<unsigned char>(*p);
+ ChSetWithCase(*p, caseSensitive);
+ }
+ i++;
+ p++;
+ }
+ if (!*p)
+ return badpat("Missing ]");
+
+ for (n = 0; n < BITBLK; bittab[n++] = 0)
+ *mp++ = static_cast<char>(mask ^ bittab[n]);
+
+ break;
+
+ case '*': /* match 0 or more... */
+ case '+': /* match 1 or more... */
+ case '?':
+ if (p == pattern)
+ return badpat("Empty closure");
+ lp = sp; /* previous opcode */
+ if (*lp == CLO || *lp == LCLO) /* equivalence... */
+ break;
+ switch (*lp) {
+
+ case BOL:
+ case BOT:
+ case EOT:
+ case BOW:
+ case EOW:
+ case REF:
+ return badpat("Illegal closure");
+ default:
+ break;
+ }
+
+ if (*p == '+')
+ for (sp = mp; lp < sp; lp++)
+ *mp++ = *lp;
+
+ *mp++ = END;
+ *mp++ = END;
+ sp = mp;
+
+ while (--mp > lp)
+ *mp = mp[-1];
+ if (*p == '?') *mp = CLQ;
+ else if (*(p+1) == '?') *mp = LCLO;
+ else *mp = CLO;
+
+ mp = sp;
+ break;
+
+ case '\\': /* tags, backrefs... */
+ i++;
+ switch (*++p) {
+ case '<':
+ *mp++ = BOW;
+ break;
+ case '>':
+ if (*sp == BOW)
+ return badpat("Null pattern inside \\<\\>");
+ *mp++ = EOW;
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ n = *p-'0';
+ if (tagi > 0 && tagstk[tagi] == n)
+ return badpat("Cyclical reference");
+ if (tagc > n) {
+ *mp++ = static_cast<char>(REF);
+ *mp++ = static_cast<char>(n);
+ } else {
+ return badpat("Undetermined reference");
+ }
+ break;
+ default:
+ if (!posix && *p == '(') {
+ if (tagc < MAXTAG) {
+ tagstk[++tagi] = tagc;
+ *mp++ = BOT;
+ *mp++ = static_cast<char>(tagc++);
+ } else {
+ return badpat("Too many \\(\\) pairs");
+ }
+ } else if (!posix && *p == ')') {
+ if (*sp == BOT)
+ return badpat("Null pattern inside \\(\\)");
+ if (tagi > 0) {
+ *mp++ = static_cast<char>(EOT);
+ *mp++ = static_cast<char>(tagstk[tagi--]);
+ } else {
+ return badpat("Unmatched \\)");
+ }
+ } else {
+ int incr;
+ int c = GetBackslashExpression(p, incr);
+ i += incr;
+ p += incr;
+ if (c >= 0) {
+ *mp++ = CHR;
+ *mp++ = static_cast<unsigned char>(c);
+ } else {
+ *mp++ = CCL;
+ mask = 0;
+ for (n = 0; n < BITBLK; bittab[n++] = 0)
+ *mp++ = static_cast<char>(mask ^ bittab[n]);
+ }
+ }
+ }
+ break;
+
+ default : /* an ordinary char */
+ if (posix && *p == '(') {
+ if (tagc < MAXTAG) {
+ tagstk[++tagi] = tagc;
+ *mp++ = BOT;
+ *mp++ = static_cast<char>(tagc++);
+ } else {
+ return badpat("Too many () pairs");
+ }
+ } else if (posix && *p == ')') {
+ if (*sp == BOT)
+ return badpat("Null pattern inside ()");
+ if (tagi > 0) {
+ *mp++ = static_cast<char>(EOT);
+ *mp++ = static_cast<char>(tagstk[tagi--]);
+ } else {
+ return badpat("Unmatched )");
+ }
+ } else {
+ unsigned char c = *p;
+ if (!c) // End of RE
+ c = '\\'; // We take it as raw backslash
+ if (caseSensitive || !iswordc(c)) {
+ *mp++ = CHR;
+ *mp++ = c;
+ } else {
+ *mp++ = CCL;
+ mask = 0;
+ ChSetWithCase(c, false);
+ for (n = 0; n < BITBLK; bittab[n++] = 0)
+ *mp++ = static_cast<char>(mask ^ bittab[n]);
+ }
+ }
+ break;
+ }
+ sp = lp;
+ }
+ if (tagi > 0)
+ return badpat((posix ? "Unmatched (" : "Unmatched \\("));
+ *mp = END;
+ sta = OKP;
+ return 0;
+}
+
+/*
+ * RESearch::Execute:
+ * execute nfa to find a match.
+ *
+ * special cases: (nfa[0])
+ * BOL
+ * Match only once, starting from the
+ * beginning.
+ * CHR
+ * First locate the character without
+ * calling PMatch, and if found, call
+ * PMatch for the remaining string.
+ * END
+ * RESearch::Compile failed, poor luser did not
+ * check for it. Fail fast.
+ *
+ * If a match is found, bopat[0] and eopat[0] are set
+ * to the beginning and the end of the matched fragment,
+ * respectively.
+ *
+ */
+int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
+ unsigned char c;
+ int ep = NOTFOUND;
+ char *ap = nfa;
+
+ bol = lp;
+ failure = 0;
+
+ Clear();
+
+ switch (*ap) {
+
+ case BOL: /* anchored: match from BOL only */
+ ep = PMatch(ci, lp, endp, ap);
+ break;
+ case EOL: /* just searching for end of line normal path doesn't work */
+ if (*(ap+1) == END) {
+ lp = endp;
+ ep = lp;
+ break;
+ } else {
+ return 0;
+ }
+ case CHR: /* ordinary char: locate it fast */
+ c = *(ap+1);
+ while ((lp < endp) && (static_cast<unsigned char>(ci.CharAt(lp)) != c))
+ lp++;
+ if (lp >= endp) /* if EOS, fail, else fall through. */
+ return 0;
+ default: /* regular matching all the way. */
+ while (lp < endp) {
+ ep = PMatch(ci, lp, endp, ap);
+ if (ep != NOTFOUND)
+ break;
+ lp++;
+ }
+ break;
+ case END: /* munged automaton. fail always */
+ return 0;
+ }
+ if (ep == NOTFOUND)
+ return 0;
+
+ bopat[0] = lp;
+ eopat[0] = ep;
+ return 1;
+}
+
+/*
+ * PMatch: internal routine for the hard part
+ *
+ * This code is partly snarfed from an early grep written by
+ * David Conroy. The backref and tag stuff, and various other
+ * innovations are by oz.
+ *
+ * special case optimizations: (nfa[n], nfa[n+1])
+ * CLO ANY
+ * We KNOW .* will match everything up to the
+ * end of line. Thus, directly go to the end of
+ * line, without recursive PMatch calls. As in
+ * the other closure cases, the remaining pattern
+ * must be matched by moving backwards on the
+ * string recursively, to find a match for xy
+ * (x is ".*" and y is the remaining pattern)
+ * where the match satisfies the LONGEST match for
+ * x followed by a match for y.
+ * CLO CHR
+ * We can again scan the string forward for the
+ * single char and at the point of failure, we
+ * execute the remaining nfa recursively, same as
+ * above.
+ *
+ * At the end of a successful match, bopat[n] and eopat[n]
+ * are set to the beginning and end of subpatterns matched
+ * by tagged expressions (n = 1 to 9).
+ */
+
+extern void re_fail(char *,char);
+
+#define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND])
+
+/*
+ * skip values for CLO XXX to skip past the closure
+ */
+
+#define ANYSKIP 2 /* [CLO] ANY END */
+#define CHRSKIP 3 /* [CLO] CHR chr END */
+#define CCLSKIP 34 /* [CLO] CCL 32 bytes END */
+
+int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) {
+ int op, c, n;
+ int e; /* extra pointer for CLO */
+ int bp; /* beginning of subpat... */
+ int ep; /* ending of subpat... */
+ int are; /* to save the line ptr. */
+ int llp; /* lazy lp for LCLO */
+
+ while ((op = *ap++) != END)
+ switch (op) {
+
+ case CHR:
+ if (ci.CharAt(lp++) != *ap++)
+ return NOTFOUND;
+ break;
+ case ANY:
+ if (lp++ >= endp)
+ return NOTFOUND;
+ break;
+ case CCL:
+ if (lp >= endp)
+ return NOTFOUND;
+ c = ci.CharAt(lp++);
+ if (!isinset(ap,c))
+ return NOTFOUND;
+ ap += BITBLK;
+ break;
+ case BOL:
+ if (lp != bol)
+ return NOTFOUND;
+ break;
+ case EOL:
+ if (lp < endp)
+ return NOTFOUND;
+ break;
+ case BOT:
+ bopat[static_cast<int>(*ap++)] = lp;
+ break;
+ case EOT:
+ eopat[static_cast<int>(*ap++)] = lp;
+ break;
+ case BOW:
+ if ((lp!=bol && iswordc(ci.CharAt(lp-1))) || !iswordc(ci.CharAt(lp)))
+ return NOTFOUND;
+ break;
+ case EOW:
+ if (lp==bol || !iswordc(ci.CharAt(lp-1)) || iswordc(ci.CharAt(lp)))
+ return NOTFOUND;
+ break;
+ case REF:
+ n = *ap++;
+ bp = bopat[n];
+ ep = eopat[n];
+ while (bp < ep)
+ if (ci.CharAt(bp++) != ci.CharAt(lp++))
+ return NOTFOUND;
+ break;
+ case LCLO:
+ case CLQ:
+ case CLO:
+ are = lp;
+ switch (*ap) {
+
+ case ANY:
+ if (op == CLO || op == LCLO)
+ while (lp < endp)
+ lp++;
+ else if (lp < endp)
+ lp++;
+
+ n = ANYSKIP;
+ break;
+ case CHR:
+ c = *(ap+1);
+ if (op == CLO || op == LCLO)
+ while ((lp < endp) && (c == ci.CharAt(lp)))
+ lp++;
+ else if ((lp < endp) && (c == ci.CharAt(lp)))
+ lp++;
+ n = CHRSKIP;
+ break;
+ case CCL:
+ while ((lp < endp) && isinset(ap+1,ci.CharAt(lp)))
+ lp++;
+ n = CCLSKIP;
+ break;
+ default:
+ failure = true;
+ //re_fail("closure: bad nfa.", *ap);
+ return NOTFOUND;
+ }
+ ap += n;
+
+ llp = lp;
+ e = NOTFOUND;
+ while (llp >= are) {
+ int q;
+ if ((q = PMatch(ci, llp, endp, ap)) != NOTFOUND) {
+ e = q;
+ lp = llp;
+ if (op != LCLO) return e;
+ }
+ if (*ap == END) return e;
+ --llp;
+ }
+ if (*ap == EOT)
+ PMatch(ci, lp, endp, ap);
+ return e;
+ default:
+ //re_fail("RESearch::Execute: bad nfa.", static_cast<char>(op));
+ return NOTFOUND;
+ }
+ return lp;
+}
+
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.h b/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.h
new file mode 100644
index 00000000000..3a7f0e4d61e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/RESearch.h
@@ -0,0 +1,73 @@
+// Scintilla source code edit control
+/** @file RESearch.h
+ ** Interface to the regular expression search library.
+ **/
+// Written by Neil Hodgson <neilh@scintilla.org>
+// Based on the work of Ozan S. Yigit.
+// This file is in the public domain.
+
+#ifndef RESEARCH_H
+#define RESEARCH_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/*
+ * The following defines are not meant to be changeable.
+ * They are for readability only.
+ */
+#define MAXCHR 256
+#define CHRBIT 8
+#define BITBLK MAXCHR/CHRBIT
+
+class CharacterIndexer {
+public:
+ virtual char CharAt(int index)=0;
+ virtual ~CharacterIndexer() {
+ }
+};
+
+class RESearch {
+
+public:
+ explicit RESearch(CharClassify *charClassTable);
+ ~RESearch();
+ void Clear();
+ void GrabMatches(CharacterIndexer &ci);
+ const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix);
+ int Execute(CharacterIndexer &ci, int lp, int endp);
+
+ enum { MAXTAG=10 };
+ enum { MAXNFA=2048 };
+ enum { NOTFOUND=-1 };
+
+ int bopat[MAXTAG];
+ int eopat[MAXTAG];
+ std::string pat[MAXTAG];
+
+private:
+ void ChSet(unsigned char c);
+ void ChSetWithCase(unsigned char c, bool caseSensitive);
+ int GetBackslashExpression(const char *pattern, int &incr);
+
+ int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
+
+ int bol;
+ int tagstk[MAXTAG]; /* subpat tag stack */
+ char nfa[MAXNFA]; /* automaton */
+ int sta;
+ unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */
+ int failure;
+ CharClassify *charClass;
+ bool iswordc(unsigned char x) const {
+ return charClass->IsWord(x);
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.cxx
new file mode 100644
index 00000000000..4a0dde50a41
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.cxx
@@ -0,0 +1,290 @@
+/** @file RunStyles.cxx
+ ** Data structure used to store sparse styles.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <stdexcept>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+// Find the first run at a position
+int RunStyles::RunFromPosition(int position) const {
+ int run = starts->PartitionFromPosition(position);
+ // Go to first element with this position
+ while ((run > 0) && (position == starts->PositionFromPartition(run-1))) {
+ run--;
+ }
+ return run;
+}
+
+// If there is no run boundary at position, insert one continuing style.
+int RunStyles::SplitRun(int position) {
+ int run = RunFromPosition(position);
+ int posRun = starts->PositionFromPartition(run);
+ if (posRun < position) {
+ int runStyle = ValueAt(position);
+ run++;
+ starts->InsertPartition(run, position);
+ styles->InsertValue(run, 1, runStyle);
+ }
+ return run;
+}
+
+void RunStyles::RemoveRun(int run) {
+ starts->RemovePartition(run);
+ styles->DeleteRange(run, 1);
+}
+
+void RunStyles::RemoveRunIfEmpty(int run) {
+ if ((run < starts->Partitions()) && (starts->Partitions() > 1)) {
+ if (starts->PositionFromPartition(run) == starts->PositionFromPartition(run+1)) {
+ RemoveRun(run);
+ }
+ }
+}
+
+void RunStyles::RemoveRunIfSameAsPrevious(int run) {
+ if ((run > 0) && (run < starts->Partitions())) {
+ if (styles->ValueAt(run-1) == styles->ValueAt(run)) {
+ RemoveRun(run);
+ }
+ }
+}
+
+RunStyles::RunStyles() {
+ starts = new Partitioning(8);
+ styles = new SplitVector<int>();
+ styles->InsertValue(0, 2, 0);
+}
+
+RunStyles::~RunStyles() {
+ delete starts;
+ starts = NULL;
+ delete styles;
+ styles = NULL;
+}
+
+int RunStyles::Length() const {
+ return starts->PositionFromPartition(starts->Partitions());
+}
+
+int RunStyles::ValueAt(int position) const {
+ return styles->ValueAt(starts->PartitionFromPosition(position));
+}
+
+int RunStyles::FindNextChange(int position, int end) const {
+ int run = starts->PartitionFromPosition(position);
+ if (run < starts->Partitions()) {
+ int runChange = starts->PositionFromPartition(run);
+ if (runChange > position)
+ return runChange;
+ int nextChange = starts->PositionFromPartition(run + 1);
+ if (nextChange > position) {
+ return nextChange;
+ } else if (position < end) {
+ return end;
+ } else {
+ return end + 1;
+ }
+ } else {
+ return end + 1;
+ }
+}
+
+int RunStyles::StartRun(int position) const {
+ return starts->PositionFromPartition(starts->PartitionFromPosition(position));
+}
+
+int RunStyles::EndRun(int position) const {
+ return starts->PositionFromPartition(starts->PartitionFromPosition(position) + 1);
+}
+
+bool RunStyles::FillRange(int &position, int value, int &fillLength) {
+ if (fillLength <= 0) {
+ return false;
+ }
+ int end = position + fillLength;
+ if (end > Length()) {
+ return false;
+ }
+ int runEnd = RunFromPosition(end);
+ if (styles->ValueAt(runEnd) == value) {
+ // End already has value so trim range.
+ end = starts->PositionFromPartition(runEnd);
+ if (position >= end) {
+ // Whole range is already same as value so no action
+ return false;
+ }
+ fillLength = end - position;
+ } else {
+ runEnd = SplitRun(end);
+ }
+ int runStart = RunFromPosition(position);
+ if (styles->ValueAt(runStart) == value) {
+ // Start is in expected value so trim range.
+ runStart++;
+ position = starts->PositionFromPartition(runStart);
+ fillLength = end - position;
+ } else {
+ if (starts->PositionFromPartition(runStart) < position) {
+ runStart = SplitRun(position);
+ runEnd++;
+ }
+ }
+ if (runStart < runEnd) {
+ styles->SetValueAt(runStart, value);
+ // Remove each old run over the range
+ for (int run=runStart+1; run<runEnd; run++) {
+ RemoveRun(runStart+1);
+ }
+ runEnd = RunFromPosition(end);
+ RemoveRunIfSameAsPrevious(runEnd);
+ RemoveRunIfSameAsPrevious(runStart);
+ runEnd = RunFromPosition(end);
+ RemoveRunIfEmpty(runEnd);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void RunStyles::SetValueAt(int position, int value) {
+ int len = 1;
+ FillRange(position, value, len);
+}
+
+void RunStyles::InsertSpace(int position, int insertLength) {
+ int runStart = RunFromPosition(position);
+ if (starts->PositionFromPartition(runStart) == position) {
+ int runStyle = ValueAt(position);
+ // Inserting at start of run so make previous longer
+ if (runStart == 0) {
+ // Inserting at start of document so ensure 0
+ if (runStyle) {
+ styles->SetValueAt(0, 0);
+ starts->InsertPartition(1, 0);
+ styles->InsertValue(1, 1, runStyle);
+ starts->InsertText(0, insertLength);
+ } else {
+ starts->InsertText(runStart, insertLength);
+ }
+ } else {
+ if (runStyle) {
+ starts->InsertText(runStart-1, insertLength);
+ } else {
+ // Insert at end of run so do not extend style
+ starts->InsertText(runStart, insertLength);
+ }
+ }
+ } else {
+ starts->InsertText(runStart, insertLength);
+ }
+}
+
+void RunStyles::DeleteAll() {
+ delete starts;
+ starts = NULL;
+ delete styles;
+ styles = NULL;
+ starts = new Partitioning(8);
+ styles = new SplitVector<int>();
+ styles->InsertValue(0, 2, 0);
+}
+
+void RunStyles::DeleteRange(int position, int deleteLength) {
+ int end = position + deleteLength;
+ int runStart = RunFromPosition(position);
+ int runEnd = RunFromPosition(end);
+ if (runStart == runEnd) {
+ // Deleting from inside one run
+ starts->InsertText(runStart, -deleteLength);
+ RemoveRunIfEmpty(runStart);
+ } else {
+ runStart = SplitRun(position);
+ runEnd = SplitRun(end);
+ starts->InsertText(runStart, -deleteLength);
+ // Remove each old run over the range
+ for (int run=runStart; run<runEnd; run++) {
+ RemoveRun(runStart);
+ }
+ RemoveRunIfEmpty(runStart);
+ RemoveRunIfSameAsPrevious(runStart);
+ }
+}
+
+int RunStyles::Runs() const {
+ return starts->Partitions();
+}
+
+bool RunStyles::AllSame() const {
+ for (int run = 1; run < starts->Partitions(); run++) {
+ if (styles->ValueAt(run) != styles->ValueAt(run - 1))
+ return false;
+ }
+ return true;
+}
+
+bool RunStyles::AllSameAs(int value) const {
+ return AllSame() && (styles->ValueAt(0) == value);
+}
+
+int RunStyles::Find(int value, int start) const {
+ if (start < Length()) {
+ int run = start ? RunFromPosition(start) : 0;
+ if (styles->ValueAt(run) == value)
+ return start;
+ run++;
+ while (run < starts->Partitions()) {
+ if (styles->ValueAt(run) == value)
+ return starts->PositionFromPartition(run);
+ run++;
+ }
+ }
+ return -1;
+}
+
+void RunStyles::Check() const {
+#if defined(__EXCEPTIONS)
+ if (Length() < 0) {
+ throw std::runtime_error("RunStyles: Length can not be negative.");
+ }
+ if (starts->Partitions() < 1) {
+ throw std::runtime_error("RunStyles: Must always have 1 or more partitions.");
+ }
+ if (starts->Partitions() != styles->Length()-1) {
+ throw std::runtime_error("RunStyles: Partitions and styles different lengths.");
+ }
+ int start=0;
+ while (start < Length()) {
+ int end = EndRun(start);
+ if (start >= end) {
+ throw std::runtime_error("RunStyles: Partition is 0 length.");
+ }
+ start = end;
+ }
+ if (styles->ValueAt(styles->Length()-1) != 0) {
+ throw std::runtime_error("RunStyles: Unused style at end changed.");
+ }
+ for (int j=1; j<styles->Length()-1; j++) {
+ if (styles->ValueAt(j) == styles->ValueAt(j-1)) {
+ throw std::runtime_error("RunStyles: Style of a partition same as previous.");
+ }
+ }
+#endif // defined(__EXCEPTIONS)
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.h b/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.h
new file mode 100644
index 00000000000..b096ad8004f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/RunStyles.h
@@ -0,0 +1,54 @@
+/** @file RunStyles.h
+ ** Data structure used to store sparse styles.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+/// Styling buffer using one element for each run rather than using
+/// a filled buffer.
+
+#ifndef RUNSTYLES_H
+#define RUNSTYLES_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class RunStyles {
+private:
+ Partitioning *starts;
+ SplitVector<int> *styles;
+ int RunFromPosition(int position) const;
+ int SplitRun(int position);
+ void RemoveRun(int run);
+ void RemoveRunIfEmpty(int run);
+ void RemoveRunIfSameAsPrevious(int run);
+ // Private so RunStyles objects can not be copied
+ RunStyles(const RunStyles &);
+public:
+ RunStyles();
+ ~RunStyles();
+ int Length() const;
+ int ValueAt(int position) const;
+ int FindNextChange(int position, int end) const;
+ int StartRun(int position) const;
+ int EndRun(int position) const;
+ // Returns true if some values may have changed
+ bool FillRange(int &position, int value, int &fillLength);
+ void SetValueAt(int position, int value);
+ void InsertSpace(int position, int insertLength);
+ void DeleteAll();
+ void DeleteRange(int position, int deleteLength);
+ int Runs() const;
+ bool AllSame() const;
+ bool AllSameAs(int value) const;
+ int Find(int value, int start) const;
+
+ void Check() const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/SciTE.properties b/3rdparty/bgfx/3rdparty/scintilla/src/SciTE.properties
new file mode 100644
index 00000000000..1eda9fae4c2
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/SciTE.properties
@@ -0,0 +1,6 @@
+# SciTE.properties is the per directory local options file and can be used to override
+# settings made in SciTEGlobal.properties
+command.build.directory.*.cxx=..\win32
+command.build.directory.*.h=..\win32
+command.build.*.cxx=nmake -f scintilla.mak QUIET=1
+command.build.*.h=nmake -f scintilla.mak QUIET=1
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.cxx
new file mode 100644
index 00000000000..b52fb9a043f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.cxx
@@ -0,0 +1,1070 @@
+// Scintilla source code edit control
+/** @file ScintillaBase.cxx
+ ** An enhanced subclass of Editor with calltips, autocomplete and context menu.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <stdexcept>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#ifdef SCI_LEXER
+#include "SciLexer.h"
+#endif
+
+#include "PropSetSimple.h"
+
+#ifdef SCI_LEXER
+#include "LexerModule.h"
+#include "Catalogue.h"
+#endif
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+#include "AutoComplete.h"
+#include "ScintillaBase.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+ScintillaBase::ScintillaBase() {
+ displayPopupMenu = true;
+ listType = 0;
+ maxListWidth = 0;
+ multiAutoCMode = SC_MULTIAUTOC_ONCE;
+}
+
+ScintillaBase::~ScintillaBase() {
+}
+
+void ScintillaBase::Finalise() {
+ Editor::Finalise();
+ popup.Destroy();
+}
+
+void ScintillaBase::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
+ bool isFillUp = ac.Active() && ac.IsFillUpChar(*s);
+ if (!isFillUp) {
+ Editor::AddCharUTF(s, len, treatAsDBCS);
+ }
+ if (ac.Active()) {
+ AutoCompleteCharacterAdded(s[0]);
+ // For fill ups add the character after the autocompletion has
+ // triggered so containers see the key so can display a calltip.
+ if (isFillUp) {
+ Editor::AddCharUTF(s, len, treatAsDBCS);
+ }
+ }
+}
+
+void ScintillaBase::Command(int cmdId) {
+
+ switch (cmdId) {
+
+ case idAutoComplete: // Nothing to do
+
+ break;
+
+ case idCallTip: // Nothing to do
+
+ break;
+
+ case idcmdUndo:
+ WndProc(SCI_UNDO, 0, 0);
+ break;
+
+ case idcmdRedo:
+ WndProc(SCI_REDO, 0, 0);
+ break;
+
+ case idcmdCut:
+ WndProc(SCI_CUT, 0, 0);
+ break;
+
+ case idcmdCopy:
+ WndProc(SCI_COPY, 0, 0);
+ break;
+
+ case idcmdPaste:
+ WndProc(SCI_PASTE, 0, 0);
+ break;
+
+ case idcmdDelete:
+ WndProc(SCI_CLEAR, 0, 0);
+ break;
+
+ case idcmdSelectAll:
+ WndProc(SCI_SELECTALL, 0, 0);
+ break;
+ }
+}
+
+int ScintillaBase::KeyCommand(unsigned int iMessage) {
+ // Most key commands cancel autocompletion mode
+ if (ac.Active()) {
+ switch (iMessage) {
+ // Except for these
+ case SCI_LINEDOWN:
+ AutoCompleteMove(1);
+ return 0;
+ case SCI_LINEUP:
+ AutoCompleteMove(-1);
+ return 0;
+ case SCI_PAGEDOWN:
+ AutoCompleteMove(ac.lb->GetVisibleRows());
+ return 0;
+ case SCI_PAGEUP:
+ AutoCompleteMove(-ac.lb->GetVisibleRows());
+ return 0;
+ case SCI_VCHOME:
+ AutoCompleteMove(-5000);
+ return 0;
+ case SCI_LINEEND:
+ AutoCompleteMove(5000);
+ return 0;
+ case SCI_DELETEBACK:
+ DelCharBack(true);
+ AutoCompleteCharacterDeleted();
+ EnsureCaretVisible();
+ return 0;
+ case SCI_DELETEBACKNOTLINE:
+ DelCharBack(false);
+ AutoCompleteCharacterDeleted();
+ EnsureCaretVisible();
+ return 0;
+ case SCI_TAB:
+ AutoCompleteCompleted();
+ return 0;
+ case SCI_NEWLINE:
+ AutoCompleteCompleted();
+ return 0;
+
+ default:
+ AutoCompleteCancel();
+ }
+ }
+
+ if (ct.inCallTipMode) {
+ if (
+ (iMessage != SCI_CHARLEFT) &&
+ (iMessage != SCI_CHARLEFTEXTEND) &&
+ (iMessage != SCI_CHARRIGHT) &&
+ (iMessage != SCI_CHARRIGHTEXTEND) &&
+ (iMessage != SCI_EDITTOGGLEOVERTYPE) &&
+ (iMessage != SCI_DELETEBACK) &&
+ (iMessage != SCI_DELETEBACKNOTLINE)
+ ) {
+ ct.CallTipCancel();
+ }
+ if ((iMessage == SCI_DELETEBACK) || (iMessage == SCI_DELETEBACKNOTLINE)) {
+ if (sel.MainCaret() <= ct.posStartCallTip) {
+ ct.CallTipCancel();
+ }
+ }
+ }
+ return Editor::KeyCommand(iMessage);
+}
+
+void ScintillaBase::AutoCompleteDoubleClick(void *p) {
+ ScintillaBase *sci = reinterpret_cast<ScintillaBase *>(p);
+ sci->AutoCompleteCompleted();
+}
+
+void ScintillaBase::AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen) {
+ UndoGroup ug(pdoc);
+ if (multiAutoCMode == SC_MULTIAUTOC_ONCE) {
+ pdoc->DeleteChars(startPos, removeLen);
+ const int lengthInserted = pdoc->InsertString(startPos, text, textLen);
+ SetEmptySelection(startPos + lengthInserted);
+ } else {
+ // SC_MULTIAUTOC_EACH
+ for (size_t r=0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ int positionInsert = sel.Range(r).Start().Position();
+ positionInsert = InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace());
+ if (positionInsert - removeLen >= 0) {
+ positionInsert -= removeLen;
+ pdoc->DeleteChars(positionInsert, removeLen);
+ }
+ const int lengthInserted = pdoc->InsertString(positionInsert, text, textLen);
+ if (lengthInserted > 0) {
+ sel.Range(r).caret.SetPosition(positionInsert + lengthInserted);
+ sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted);
+ }
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ }
+}
+
+void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
+ //Platform::DebugPrintf("AutoComplete %s\n", list);
+ ct.CallTipCancel();
+
+ if (ac.chooseSingle && (listType == 0)) {
+ if (list && !strchr(list, ac.GetSeparator())) {
+ const char *typeSep = strchr(list, ac.GetTypesep());
+ int lenInsert = typeSep ?
+ static_cast<int>(typeSep-list) : static_cast<int>(strlen(list));
+ if (ac.ignoreCase) {
+ // May need to convert the case before invocation, so remove lenEntered characters
+ AutoCompleteInsert(sel.MainCaret() - lenEntered, lenEntered, list, lenInsert);
+ } else {
+ AutoCompleteInsert(sel.MainCaret(), 0, list + lenEntered, lenInsert - lenEntered);
+ }
+ ac.Cancel();
+ return;
+ }
+ }
+ ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),
+ lenEntered, vs.lineHeight, IsUnicodeMode(), technology);
+
+ PRectangle rcClient = GetClientRectangle();
+ Point pt = LocationFromPosition(sel.MainCaret() - lenEntered);
+ PRectangle rcPopupBounds = wMain.GetMonitorRect(pt);
+ if (rcPopupBounds.Height() == 0)
+ rcPopupBounds = rcClient;
+
+ int heightLB = ac.heightLBDefault;
+ int widthLB = ac.widthLBDefault;
+ if (pt.x >= rcClient.right - widthLB) {
+ HorizontalScrollTo(static_cast<int>(xOffset + pt.x - rcClient.right + widthLB));
+ Redraw();
+ pt = PointMainCaret();
+ }
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ pt.x += ptOrigin.x;
+ pt.y += ptOrigin.y;
+ }
+ PRectangle rcac;
+ rcac.left = pt.x - ac.lb->CaretFromEdge();
+ if (pt.y >= rcPopupBounds.bottom - heightLB && // Wont fit below.
+ pt.y >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2) { // and there is more room above.
+ rcac.top = pt.y - heightLB;
+ if (rcac.top < rcPopupBounds.top) {
+ heightLB -= static_cast<int>(rcPopupBounds.top - rcac.top);
+ rcac.top = rcPopupBounds.top;
+ }
+ } else {
+ rcac.top = pt.y + vs.lineHeight;
+ }
+ rcac.right = rcac.left + widthLB;
+ rcac.bottom = static_cast<XYPOSITION>(Platform::Minimum(static_cast<int>(rcac.top) + heightLB, static_cast<int>(rcPopupBounds.bottom)));
+ ac.lb->SetPositionRelative(rcac, wMain);
+ ac.lb->SetFont(vs.styles[STYLE_DEFAULT].font);
+ unsigned int aveCharWidth = static_cast<unsigned int>(vs.styles[STYLE_DEFAULT].aveCharWidth);
+ ac.lb->SetAverageCharWidth(aveCharWidth);
+ ac.lb->SetDoubleClickAction(AutoCompleteDoubleClick, this);
+
+ ac.SetList(list ? list : "");
+
+ // Fiddle the position of the list so it is right next to the target and wide enough for all its strings
+ PRectangle rcList = ac.lb->GetDesiredRect();
+ int heightAlloced = static_cast<int>(rcList.bottom - rcList.top);
+ widthLB = Platform::Maximum(widthLB, static_cast<int>(rcList.right - rcList.left));
+ if (maxListWidth != 0)
+ widthLB = Platform::Minimum(widthLB, aveCharWidth*maxListWidth);
+ // Make an allowance for large strings in list
+ rcList.left = pt.x - ac.lb->CaretFromEdge();
+ rcList.right = rcList.left + widthLB;
+ if (((pt.y + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) && // Wont fit below.
+ ((pt.y + vs.lineHeight / 2) >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2)) { // and there is more room above.
+ rcList.top = pt.y - heightAlloced;
+ } else {
+ rcList.top = pt.y + vs.lineHeight;
+ }
+ rcList.bottom = rcList.top + heightAlloced;
+ ac.lb->SetPositionRelative(rcList, wMain);
+ ac.Show(true);
+ if (lenEntered != 0) {
+ AutoCompleteMoveToCurrentWord();
+ }
+}
+
+void ScintillaBase::AutoCompleteCancel() {
+ if (ac.Active()) {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_AUTOCCANCELLED;
+ scn.wParam = 0;
+ scn.listType = 0;
+ NotifyParent(scn);
+ }
+ ac.Cancel();
+}
+
+void ScintillaBase::AutoCompleteMove(int delta) {
+ ac.Move(delta);
+}
+
+void ScintillaBase::AutoCompleteMoveToCurrentWord() {
+ std::string wordCurrent = RangeText(ac.posStart - ac.startLen, sel.MainCaret());
+ ac.Select(wordCurrent.c_str());
+}
+
+void ScintillaBase::AutoCompleteCharacterAdded(char ch) {
+ if (ac.IsFillUpChar(ch)) {
+ AutoCompleteCompleted();
+ } else if (ac.IsStopChar(ch)) {
+ AutoCompleteCancel();
+ } else {
+ AutoCompleteMoveToCurrentWord();
+ }
+}
+
+void ScintillaBase::AutoCompleteCharacterDeleted() {
+ if (sel.MainCaret() < ac.posStart - ac.startLen) {
+ AutoCompleteCancel();
+ } else if (ac.cancelAtStartPos && (sel.MainCaret() <= ac.posStart)) {
+ AutoCompleteCancel();
+ } else {
+ AutoCompleteMoveToCurrentWord();
+ }
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_AUTOCCHARDELETED;
+ scn.wParam = 0;
+ scn.listType = 0;
+ NotifyParent(scn);
+}
+
+void ScintillaBase::AutoCompleteCompleted() {
+ int item = ac.GetSelection();
+ if (item == -1) {
+ AutoCompleteCancel();
+ return;
+ }
+ const std::string selected = ac.GetValue(item);
+
+ ac.Show(false);
+
+ SCNotification scn = {};
+ scn.nmhdr.code = listType > 0 ? SCN_USERLISTSELECTION : SCN_AUTOCSELECTION;
+ scn.message = 0;
+ scn.wParam = listType;
+ scn.listType = listType;
+ Position firstPos = ac.posStart - ac.startLen;
+ scn.position = firstPos;
+ scn.lParam = firstPos;
+ scn.text = selected.c_str();
+ NotifyParent(scn);
+
+ if (!ac.Active())
+ return;
+ ac.Cancel();
+
+ if (listType > 0)
+ return;
+
+ Position endPos = sel.MainCaret();
+ if (ac.dropRestOfWord)
+ endPos = pdoc->ExtendWordSelect(endPos, 1, true);
+ if (endPos < firstPos)
+ return;
+ AutoCompleteInsert(firstPos, endPos - firstPos, selected.c_str(), static_cast<int>(selected.length()));
+ SetLastXChosen();
+}
+
+int ScintillaBase::AutoCompleteGetCurrent() const {
+ if (!ac.Active())
+ return -1;
+ return ac.GetSelection();
+}
+
+int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) const {
+ if (ac.Active()) {
+ int item = ac.GetSelection();
+ if (item != -1) {
+ const std::string selected = ac.GetValue(item);
+ if (buffer != NULL)
+ memcpy(buffer, selected.c_str(), selected.length()+1);
+ return static_cast<int>(selected.length());
+ }
+ }
+ if (buffer != NULL)
+ *buffer = '\0';
+ return 0;
+}
+
+void ScintillaBase::CallTipShow(Point pt, const char *defn) {
+ ac.Cancel();
+ // If container knows about STYLE_CALLTIP then use it in place of the
+ // STYLE_DEFAULT for the face name, size and character set. Also use it
+ // for the foreground and background colour.
+ int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT;
+ if (ct.UseStyleCallTip()) {
+ ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);
+ }
+ if (wMargin.GetID()) {
+ Point ptOrigin = GetVisibleOriginInMain();
+ pt.x += ptOrigin.x;
+ pt.y += ptOrigin.y;
+ }
+ PRectangle rc = ct.CallTipStart(sel.MainCaret(), pt,
+ vs.lineHeight,
+ defn,
+ vs.styles[ctStyle].fontName,
+ vs.styles[ctStyle].sizeZoomed,
+ CodePage(),
+ vs.styles[ctStyle].characterSet,
+ vs.technology,
+ wMain);
+ // If the call-tip window would be out of the client
+ // space
+ PRectangle rcClient = GetClientRectangle();
+ int offset = vs.lineHeight + static_cast<int>(rc.Height());
+ // adjust so it displays above the text.
+ if (rc.bottom > rcClient.bottom && rc.Height() < rcClient.Height()) {
+ rc.top -= offset;
+ rc.bottom -= offset;
+ }
+ // adjust so it displays below the text.
+ if (rc.top < rcClient.top && rc.Height() < rcClient.Height()) {
+ rc.top += offset;
+ rc.bottom += offset;
+ }
+ // Now display the window.
+ CreateCallTipWindow(rc);
+ ct.wCallTip.SetPositionRelative(rc, wMain);
+ ct.wCallTip.Show();
+}
+
+void ScintillaBase::CallTipClick() {
+ SCNotification scn = {};
+ scn.nmhdr.code = SCN_CALLTIPCLICK;
+ scn.position = ct.clickPlace;
+ NotifyParent(scn);
+}
+
+void ScintillaBase::ContextMenu(Point pt) {
+ if (displayPopupMenu) {
+ bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
+ popup.CreatePopUp();
+ AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo());
+ AddToPopUp("Redo", idcmdRedo, writable && pdoc->CanRedo());
+ AddToPopUp("");
+ AddToPopUp("Cut", idcmdCut, writable && !sel.Empty());
+ AddToPopUp("Copy", idcmdCopy, !sel.Empty());
+ AddToPopUp("Paste", idcmdPaste, writable && WndProc(SCI_CANPASTE, 0, 0));
+ AddToPopUp("Delete", idcmdDelete, writable && !sel.Empty());
+ AddToPopUp("");
+ AddToPopUp("Select All", idcmdSelectAll);
+ popup.Show(pt, wMain);
+ }
+}
+
+void ScintillaBase::CancelModes() {
+ AutoCompleteCancel();
+ ct.CallTipCancel();
+ Editor::CancelModes();
+}
+
+void ScintillaBase::ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers) {
+ CancelModes();
+ Editor::ButtonDownWithModifiers(pt, curTime, modifiers);
+}
+
+void ScintillaBase::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
+ ButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt));
+}
+
+#ifdef SCI_LEXER
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class LexState : public LexInterface {
+ const LexerModule *lexCurrent;
+ void SetLexerModule(const LexerModule *lex);
+ PropSetSimple props;
+ int interfaceVersion;
+public:
+ int lexLanguage;
+
+ explicit LexState(Document *pdoc_);
+ virtual ~LexState();
+ void SetLexer(uptr_t wParam);
+ void SetLexerLanguage(const char *languageName);
+ const char *DescribeWordListSets();
+ void SetWordList(int n, const char *wl);
+ const char *GetName() const;
+ void *PrivateCall(int operation, void *pointer);
+ const char *PropertyNames();
+ int PropertyType(const char *name);
+ const char *DescribeProperty(const char *name);
+ void PropSet(const char *key, const char *val);
+ const char *PropGet(const char *key) const;
+ int PropGetInt(const char *key, int defaultValue=0) const;
+ int PropGetExpanded(const char *key, char *result) const;
+
+ int LineEndTypesSupported();
+ int AllocateSubStyles(int styleBase, int numberStyles);
+ int SubStylesStart(int styleBase);
+ int SubStylesLength(int styleBase);
+ int StyleFromSubStyle(int subStyle);
+ int PrimaryStyleFromStyle(int style);
+ void FreeSubStyles();
+ void SetIdentifiers(int style, const char *identifiers);
+ int DistanceToSecondaryStyles();
+ const char *GetSubStyleBases();
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+LexState::LexState(Document *pdoc_) : LexInterface(pdoc_) {
+ lexCurrent = 0;
+ performingStyle = false;
+ interfaceVersion = lvOriginal;
+ lexLanguage = SCLEX_CONTAINER;
+}
+
+LexState::~LexState() {
+ if (instance) {
+ instance->Release();
+ instance = 0;
+ }
+}
+
+LexState *ScintillaBase::DocumentLexState() {
+ if (!pdoc->pli) {
+ pdoc->pli = new LexState(pdoc);
+ }
+ return static_cast<LexState *>(pdoc->pli);
+}
+
+void LexState::SetLexerModule(const LexerModule *lex) {
+ if (lex != lexCurrent) {
+ if (instance) {
+ instance->Release();
+ instance = 0;
+ }
+ interfaceVersion = lvOriginal;
+ lexCurrent = lex;
+ if (lexCurrent) {
+ instance = lexCurrent->Create();
+ interfaceVersion = instance->Version();
+ }
+ pdoc->LexerChanged();
+ }
+}
+
+void LexState::SetLexer(uptr_t wParam) {
+ lexLanguage = static_cast<int>(wParam);
+ if (lexLanguage == SCLEX_CONTAINER) {
+ SetLexerModule(0);
+ } else {
+ const LexerModule *lex = Catalogue::Find(lexLanguage);
+ if (!lex)
+ lex = Catalogue::Find(SCLEX_NULL);
+ SetLexerModule(lex);
+ }
+}
+
+void LexState::SetLexerLanguage(const char *languageName) {
+ const LexerModule *lex = Catalogue::Find(languageName);
+ if (!lex)
+ lex = Catalogue::Find(SCLEX_NULL);
+ if (lex)
+ lexLanguage = lex->GetLanguage();
+ SetLexerModule(lex);
+}
+
+const char *LexState::DescribeWordListSets() {
+ if (instance) {
+ return instance->DescribeWordListSets();
+ } else {
+ return 0;
+ }
+}
+
+void LexState::SetWordList(int n, const char *wl) {
+ if (instance) {
+ int firstModification = instance->WordListSet(n, wl);
+ if (firstModification >= 0) {
+ pdoc->ModifiedAt(firstModification);
+ }
+ }
+}
+
+const char *LexState::GetName() const {
+ return lexCurrent ? lexCurrent->languageName : "";
+}
+
+void *LexState::PrivateCall(int operation, void *pointer) {
+ if (pdoc && instance) {
+ return instance->PrivateCall(operation, pointer);
+ } else {
+ return 0;
+ }
+}
+
+const char *LexState::PropertyNames() {
+ if (instance) {
+ return instance->PropertyNames();
+ } else {
+ return 0;
+ }
+}
+
+int LexState::PropertyType(const char *name) {
+ if (instance) {
+ return instance->PropertyType(name);
+ } else {
+ return SC_TYPE_BOOLEAN;
+ }
+}
+
+const char *LexState::DescribeProperty(const char *name) {
+ if (instance) {
+ return instance->DescribeProperty(name);
+ } else {
+ return 0;
+ }
+}
+
+void LexState::PropSet(const char *key, const char *val) {
+ props.Set(key, val);
+ if (instance) {
+ int firstModification = instance->PropertySet(key, val);
+ if (firstModification >= 0) {
+ pdoc->ModifiedAt(firstModification);
+ }
+ }
+}
+
+const char *LexState::PropGet(const char *key) const {
+ return props.Get(key);
+}
+
+int LexState::PropGetInt(const char *key, int defaultValue) const {
+ return props.GetInt(key, defaultValue);
+}
+
+int LexState::PropGetExpanded(const char *key, char *result) const {
+ return props.GetExpanded(key, result);
+}
+
+int LexState::LineEndTypesSupported() {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->LineEndTypesSupported();
+ }
+ return 0;
+}
+
+int LexState::AllocateSubStyles(int styleBase, int numberStyles) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->AllocateSubStyles(styleBase, numberStyles);
+ }
+ return -1;
+}
+
+int LexState::SubStylesStart(int styleBase) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->SubStylesStart(styleBase);
+ }
+ return -1;
+}
+
+int LexState::SubStylesLength(int styleBase) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->SubStylesLength(styleBase);
+ }
+ return 0;
+}
+
+int LexState::StyleFromSubStyle(int subStyle) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->StyleFromSubStyle(subStyle);
+ }
+ return 0;
+}
+
+int LexState::PrimaryStyleFromStyle(int style) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->PrimaryStyleFromStyle(style);
+ }
+ return 0;
+}
+
+void LexState::FreeSubStyles() {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ static_cast<ILexerWithSubStyles *>(instance)->FreeSubStyles();
+ }
+}
+
+void LexState::SetIdentifiers(int style, const char *identifiers) {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ static_cast<ILexerWithSubStyles *>(instance)->SetIdentifiers(style, identifiers);
+ }
+}
+
+int LexState::DistanceToSecondaryStyles() {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->DistanceToSecondaryStyles();
+ }
+ return 0;
+}
+
+const char *LexState::GetSubStyleBases() {
+ if (instance && (interfaceVersion >= lvSubStyles)) {
+ return static_cast<ILexerWithSubStyles *>(instance)->GetSubStyleBases();
+ }
+ return "";
+}
+
+#endif
+
+void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) {
+#ifdef SCI_LEXER
+ if (DocumentLexState()->lexLanguage != SCLEX_CONTAINER) {
+ int lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled());
+ int endStyled = pdoc->LineStart(lineEndStyled);
+ DocumentLexState()->Colourise(endStyled, endStyleNeeded);
+ return;
+ }
+#endif
+ Editor::NotifyStyleToNeeded(endStyleNeeded);
+}
+
+void ScintillaBase::NotifyLexerChanged(Document *, void *) {
+#ifdef SCI_LEXER
+ vs.EnsureStyle(0xff);
+#endif
+}
+
+sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ switch (iMessage) {
+ case SCI_AUTOCSHOW:
+ listType = 0;
+ AutoCompleteStart(static_cast<int>(wParam), reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_AUTOCCANCEL:
+ ac.Cancel();
+ break;
+
+ case SCI_AUTOCACTIVE:
+ return ac.Active();
+
+ case SCI_AUTOCPOSSTART:
+ return ac.posStart;
+
+ case SCI_AUTOCCOMPLETE:
+ AutoCompleteCompleted();
+ break;
+
+ case SCI_AUTOCSETSEPARATOR:
+ ac.SetSeparator(static_cast<char>(wParam));
+ break;
+
+ case SCI_AUTOCGETSEPARATOR:
+ return ac.GetSeparator();
+
+ case SCI_AUTOCSTOPS:
+ ac.SetStopChars(reinterpret_cast<char *>(lParam));
+ break;
+
+ case SCI_AUTOCSELECT:
+ ac.Select(reinterpret_cast<char *>(lParam));
+ break;
+
+ case SCI_AUTOCGETCURRENT:
+ return AutoCompleteGetCurrent();
+
+ case SCI_AUTOCGETCURRENTTEXT:
+ return AutoCompleteGetCurrentText(reinterpret_cast<char *>(lParam));
+
+ case SCI_AUTOCSETCANCELATSTART:
+ ac.cancelAtStartPos = wParam != 0;
+ break;
+
+ case SCI_AUTOCGETCANCELATSTART:
+ return ac.cancelAtStartPos;
+
+ case SCI_AUTOCSETFILLUPS:
+ ac.SetFillUpChars(reinterpret_cast<char *>(lParam));
+ break;
+
+ case SCI_AUTOCSETCHOOSESINGLE:
+ ac.chooseSingle = wParam != 0;
+ break;
+
+ case SCI_AUTOCGETCHOOSESINGLE:
+ return ac.chooseSingle;
+
+ case SCI_AUTOCSETIGNORECASE:
+ ac.ignoreCase = wParam != 0;
+ break;
+
+ case SCI_AUTOCGETIGNORECASE:
+ return ac.ignoreCase;
+
+ case SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR:
+ ac.ignoreCaseBehaviour = static_cast<unsigned int>(wParam);
+ break;
+
+ case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR:
+ return ac.ignoreCaseBehaviour;
+
+ case SCI_AUTOCSETMULTI:
+ multiAutoCMode = static_cast<int>(wParam);
+ break;
+
+ case SCI_AUTOCGETMULTI:
+ return multiAutoCMode;
+
+ case SCI_AUTOCSETORDER:
+ ac.autoSort = static_cast<int>(wParam);
+ break;
+
+ case SCI_AUTOCGETORDER:
+ return ac.autoSort;
+
+ case SCI_USERLISTSHOW:
+ listType = static_cast<int>(wParam);
+ AutoCompleteStart(0, reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_AUTOCSETAUTOHIDE:
+ ac.autoHide = wParam != 0;
+ break;
+
+ case SCI_AUTOCGETAUTOHIDE:
+ return ac.autoHide;
+
+ case SCI_AUTOCSETDROPRESTOFWORD:
+ ac.dropRestOfWord = wParam != 0;
+ break;
+
+ case SCI_AUTOCGETDROPRESTOFWORD:
+ return ac.dropRestOfWord;
+
+ case SCI_AUTOCSETMAXHEIGHT:
+ ac.lb->SetVisibleRows(static_cast<int>(wParam));
+ break;
+
+ case SCI_AUTOCGETMAXHEIGHT:
+ return ac.lb->GetVisibleRows();
+
+ case SCI_AUTOCSETMAXWIDTH:
+ maxListWidth = static_cast<int>(wParam);
+ break;
+
+ case SCI_AUTOCGETMAXWIDTH:
+ return maxListWidth;
+
+ case SCI_REGISTERIMAGE:
+ ac.lb->RegisterImage(static_cast<int>(wParam), reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_REGISTERRGBAIMAGE:
+ ac.lb->RegisterRGBAImage(static_cast<int>(wParam), static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y),
+ reinterpret_cast<unsigned char *>(lParam));
+ break;
+
+ case SCI_CLEARREGISTEREDIMAGES:
+ ac.lb->ClearRegisteredImages();
+ break;
+
+ case SCI_AUTOCSETTYPESEPARATOR:
+ ac.SetTypesep(static_cast<char>(wParam));
+ break;
+
+ case SCI_AUTOCGETTYPESEPARATOR:
+ return ac.GetTypesep();
+
+ case SCI_CALLTIPSHOW:
+ CallTipShow(LocationFromPosition(static_cast<int>(wParam)),
+ reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_CALLTIPCANCEL:
+ ct.CallTipCancel();
+ break;
+
+ case SCI_CALLTIPACTIVE:
+ return ct.inCallTipMode;
+
+ case SCI_CALLTIPPOSSTART:
+ return ct.posStartCallTip;
+
+ case SCI_CALLTIPSETPOSSTART:
+ ct.posStartCallTip = static_cast<int>(wParam);
+ break;
+
+ case SCI_CALLTIPSETHLT:
+ ct.SetHighlight(static_cast<int>(wParam), static_cast<int>(lParam));
+ break;
+
+ case SCI_CALLTIPSETBACK:
+ ct.colourBG = ColourDesired(static_cast<long>(wParam));
+ vs.styles[STYLE_CALLTIP].back = ct.colourBG;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_CALLTIPSETFORE:
+ ct.colourUnSel = ColourDesired(static_cast<long>(wParam));
+ vs.styles[STYLE_CALLTIP].fore = ct.colourUnSel;
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_CALLTIPSETFOREHLT:
+ ct.colourSel = ColourDesired(static_cast<long>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_CALLTIPUSESTYLE:
+ ct.SetTabSize(static_cast<int>(wParam));
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_CALLTIPSETPOSITION:
+ ct.SetPosition(wParam != 0);
+ InvalidateStyleRedraw();
+ break;
+
+ case SCI_USEPOPUP:
+ displayPopupMenu = wParam != 0;
+ break;
+
+#ifdef SCI_LEXER
+ case SCI_SETLEXER:
+ DocumentLexState()->SetLexer(static_cast<int>(wParam));
+ break;
+
+ case SCI_GETLEXER:
+ return DocumentLexState()->lexLanguage;
+
+ case SCI_COLOURISE:
+ if (DocumentLexState()->lexLanguage == SCLEX_CONTAINER) {
+ pdoc->ModifiedAt(static_cast<int>(wParam));
+ NotifyStyleToNeeded((lParam == -1) ? pdoc->Length() : static_cast<int>(lParam));
+ } else {
+ DocumentLexState()->Colourise(static_cast<int>(wParam), static_cast<int>(lParam));
+ }
+ Redraw();
+ break;
+
+ case SCI_SETPROPERTY:
+ DocumentLexState()->PropSet(reinterpret_cast<const char *>(wParam),
+ reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_GETPROPERTY:
+ return StringResult(lParam, DocumentLexState()->PropGet(reinterpret_cast<const char *>(wParam)));
+
+ case SCI_GETPROPERTYEXPANDED:
+ return DocumentLexState()->PropGetExpanded(reinterpret_cast<const char *>(wParam),
+ reinterpret_cast<char *>(lParam));
+
+ case SCI_GETPROPERTYINT:
+ return DocumentLexState()->PropGetInt(reinterpret_cast<const char *>(wParam), static_cast<int>(lParam));
+
+ case SCI_SETKEYWORDS:
+ DocumentLexState()->SetWordList(static_cast<int>(wParam), reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_SETLEXERLANGUAGE:
+ DocumentLexState()->SetLexerLanguage(reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_GETLEXERLANGUAGE:
+ return StringResult(lParam, DocumentLexState()->GetName());
+
+ case SCI_PRIVATELEXERCALL:
+ return reinterpret_cast<sptr_t>(
+ DocumentLexState()->PrivateCall(static_cast<int>(wParam), reinterpret_cast<void *>(lParam)));
+
+ case SCI_GETSTYLEBITSNEEDED:
+ return 8;
+
+ case SCI_PROPERTYNAMES:
+ return StringResult(lParam, DocumentLexState()->PropertyNames());
+
+ case SCI_PROPERTYTYPE:
+ return DocumentLexState()->PropertyType(reinterpret_cast<const char *>(wParam));
+
+ case SCI_DESCRIBEPROPERTY:
+ return StringResult(lParam,
+ DocumentLexState()->DescribeProperty(reinterpret_cast<const char *>(wParam)));
+
+ case SCI_DESCRIBEKEYWORDSETS:
+ return StringResult(lParam, DocumentLexState()->DescribeWordListSets());
+
+ case SCI_GETLINEENDTYPESSUPPORTED:
+ return DocumentLexState()->LineEndTypesSupported();
+
+ case SCI_ALLOCATESUBSTYLES:
+ return DocumentLexState()->AllocateSubStyles(static_cast<int>(wParam), static_cast<int>(lParam));
+
+ case SCI_GETSUBSTYLESSTART:
+ return DocumentLexState()->SubStylesStart(static_cast<int>(wParam));
+
+ case SCI_GETSUBSTYLESLENGTH:
+ return DocumentLexState()->SubStylesLength(static_cast<int>(wParam));
+
+ case SCI_GETSTYLEFROMSUBSTYLE:
+ return DocumentLexState()->StyleFromSubStyle(static_cast<int>(wParam));
+
+ case SCI_GETPRIMARYSTYLEFROMSTYLE:
+ return DocumentLexState()->PrimaryStyleFromStyle(static_cast<int>(wParam));
+
+ case SCI_FREESUBSTYLES:
+ DocumentLexState()->FreeSubStyles();
+ break;
+
+ case SCI_SETIDENTIFIERS:
+ DocumentLexState()->SetIdentifiers(static_cast<int>(wParam),
+ reinterpret_cast<const char *>(lParam));
+ break;
+
+ case SCI_DISTANCETOSECONDARYSTYLES:
+ return DocumentLexState()->DistanceToSecondaryStyles();
+
+ case SCI_GETSUBSTYLEBASES:
+ return StringResult(lParam, DocumentLexState()->GetSubStyleBases());
+#endif
+
+ default:
+ return Editor::WndProc(iMessage, wParam, lParam);
+ }
+ return 0l;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.h b/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.h
new file mode 100644
index 00000000000..d6401cc307c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ScintillaBase.h
@@ -0,0 +1,104 @@
+// Scintilla source code edit control
+/** @file ScintillaBase.h
+ ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef SCINTILLABASE_H
+#define SCINTILLABASE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+#ifdef SCI_LEXER
+class LexState;
+#endif
+
+/**
+ */
+class ScintillaBase : public Editor {
+ // Private so ScintillaBase objects can not be copied
+ explicit ScintillaBase(const ScintillaBase &);
+ ScintillaBase &operator=(const ScintillaBase &);
+
+protected:
+ /** Enumeration of commands and child windows. */
+ enum {
+ idCallTip=1,
+ idAutoComplete=2,
+
+ idcmdUndo=10,
+ idcmdRedo=11,
+ idcmdCut=12,
+ idcmdCopy=13,
+ idcmdPaste=14,
+ idcmdDelete=15,
+ idcmdSelectAll=16
+ };
+
+ enum { maxLenInputIME = 200 };
+
+ bool displayPopupMenu;
+ Menu popup;
+ AutoComplete ac;
+
+ CallTip ct;
+
+ int listType; ///< 0 is an autocomplete list
+ int maxListWidth; /// Maximum width of list, in average character widths
+ int multiAutoCMode; /// Mode for autocompleting when multiple selections are present
+
+#ifdef SCI_LEXER
+ LexState *DocumentLexState();
+ void SetLexer(uptr_t wParam);
+ void SetLexerLanguage(const char *languageName);
+ void Colourise(int start, int end);
+#endif
+
+ ScintillaBase();
+ virtual ~ScintillaBase();
+ virtual void Initialise() = 0;
+ virtual void Finalise();
+
+ virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
+ void Command(int cmdId);
+ virtual void CancelModes();
+ virtual int KeyCommand(unsigned int iMessage);
+
+ void AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen);
+ void AutoCompleteStart(int lenEntered, const char *list);
+ void AutoCompleteCancel();
+ void AutoCompleteMove(int delta);
+ int AutoCompleteGetCurrent() const;
+ int AutoCompleteGetCurrentText(char *buffer) const;
+ void AutoCompleteCharacterAdded(char ch);
+ void AutoCompleteCharacterDeleted();
+ void AutoCompleteCompleted();
+ void AutoCompleteMoveToCurrentWord();
+ static void AutoCompleteDoubleClick(void *p);
+
+ void CallTipClick();
+ void CallTipShow(Point pt, const char *defn);
+ virtual void CreateCallTipWindow(PRectangle rc) = 0;
+
+ virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
+ void ContextMenu(Point pt);
+
+ virtual void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers);
+ virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
+
+ void NotifyStyleToNeeded(int endStyleNeeded);
+ void NotifyLexerChanged(Document *doc, void *userData);
+
+public:
+ // Public so scintilla_send_message can use it
+ virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Selection.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Selection.cxx
new file mode 100644
index 00000000000..52ed5774ebb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Selection.cxx
@@ -0,0 +1,418 @@
+// Scintilla source code edit control
+/** @file Selection.cxx
+ ** Classes maintaining the selection.
+ **/
+// Copyright 2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+
+#include <vector>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+
+#include "Selection.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+void SelectionPosition::MoveForInsertDelete(bool insertion, int startChange, int length) {
+ if (insertion) {
+ if (position == startChange) {
+ int virtualLengthRemove = std::min(length, virtualSpace);
+ virtualSpace -= virtualLengthRemove;
+ position += virtualLengthRemove;
+ } else if (position > startChange) {
+ position += length;
+ }
+ } else {
+ if (position == startChange) {
+ virtualSpace = 0;
+ }
+ if (position > startChange) {
+ int endDeletion = startChange + length;
+ if (position > endDeletion) {
+ position -= length;
+ } else {
+ position = startChange;
+ virtualSpace = 0;
+ }
+ }
+ }
+}
+
+bool SelectionPosition::operator <(const SelectionPosition &other) const {
+ if (position == other.position)
+ return virtualSpace < other.virtualSpace;
+ else
+ return position < other.position;
+}
+
+bool SelectionPosition::operator >(const SelectionPosition &other) const {
+ if (position == other.position)
+ return virtualSpace > other.virtualSpace;
+ else
+ return position > other.position;
+}
+
+bool SelectionPosition::operator <=(const SelectionPosition &other) const {
+ if (position == other.position && virtualSpace == other.virtualSpace)
+ return true;
+ else
+ return other > *this;
+}
+
+bool SelectionPosition::operator >=(const SelectionPosition &other) const {
+ if (position == other.position && virtualSpace == other.virtualSpace)
+ return true;
+ else
+ return *this > other;
+}
+
+int SelectionRange::Length() const {
+ if (anchor > caret) {
+ return anchor.Position() - caret.Position();
+ } else {
+ return caret.Position() - anchor.Position();
+ }
+}
+
+void SelectionRange::MoveForInsertDelete(bool insertion, int startChange, int length) {
+ caret.MoveForInsertDelete(insertion, startChange, length);
+ anchor.MoveForInsertDelete(insertion, startChange, length);
+}
+
+bool SelectionRange::Contains(int pos) const {
+ if (anchor > caret)
+ return (pos >= caret.Position()) && (pos <= anchor.Position());
+ else
+ return (pos >= anchor.Position()) && (pos <= caret.Position());
+}
+
+bool SelectionRange::Contains(SelectionPosition sp) const {
+ if (anchor > caret)
+ return (sp >= caret) && (sp <= anchor);
+ else
+ return (sp >= anchor) && (sp <= caret);
+}
+
+bool SelectionRange::ContainsCharacter(int posCharacter) const {
+ if (anchor > caret)
+ return (posCharacter >= caret.Position()) && (posCharacter < anchor.Position());
+ else
+ return (posCharacter >= anchor.Position()) && (posCharacter < caret.Position());
+}
+
+SelectionSegment SelectionRange::Intersect(SelectionSegment check) const {
+ SelectionSegment inOrder(caret, anchor);
+ if ((inOrder.start <= check.end) || (inOrder.end >= check.start)) {
+ SelectionSegment portion = check;
+ if (portion.start < inOrder.start)
+ portion.start = inOrder.start;
+ if (portion.end > inOrder.end)
+ portion.end = inOrder.end;
+ if (portion.start > portion.end)
+ return SelectionSegment();
+ else
+ return portion;
+ } else {
+ return SelectionSegment();
+ }
+}
+
+bool SelectionRange::Trim(SelectionRange range) {
+ SelectionPosition startRange = range.Start();
+ SelectionPosition endRange = range.End();
+ SelectionPosition start = Start();
+ SelectionPosition end = End();
+ PLATFORM_ASSERT(start <= end);
+ PLATFORM_ASSERT(startRange <= endRange);
+ if ((startRange <= end) && (endRange >= start)) {
+ if ((start > startRange) && (end < endRange)) {
+ // Completely covered by range -> empty at start
+ end = start;
+ } else if ((start < startRange) && (end > endRange)) {
+ // Completely covers range -> empty at start
+ end = start;
+ } else if (start <= startRange) {
+ // Trim end
+ end = startRange;
+ } else { //
+ PLATFORM_ASSERT(end >= endRange);
+ // Trim start
+ start = endRange;
+ }
+ if (anchor > caret) {
+ caret = start;
+ anchor = end;
+ } else {
+ anchor = start;
+ caret = end;
+ }
+ return Empty();
+ } else {
+ return false;
+ }
+}
+
+// If range is all virtual collapse to start of virtual space
+void SelectionRange::MinimizeVirtualSpace() {
+ if (caret.Position() == anchor.Position()) {
+ int virtualSpace = caret.VirtualSpace();
+ if (virtualSpace > anchor.VirtualSpace())
+ virtualSpace = anchor.VirtualSpace();
+ caret.SetVirtualSpace(virtualSpace);
+ anchor.SetVirtualSpace(virtualSpace);
+ }
+}
+
+Selection::Selection() : mainRange(0), moveExtends(false), tentativeMain(false), selType(selStream) {
+ AddSelection(SelectionRange(SelectionPosition(0)));
+}
+
+Selection::~Selection() {
+}
+
+bool Selection::IsRectangular() const {
+ return (selType == selRectangle) || (selType == selThin);
+}
+
+int Selection::MainCaret() const {
+ return ranges[mainRange].caret.Position();
+}
+
+int Selection::MainAnchor() const {
+ return ranges[mainRange].anchor.Position();
+}
+
+SelectionRange &Selection::Rectangular() {
+ return rangeRectangular;
+}
+
+SelectionSegment Selection::Limits() const {
+ if (ranges.empty()) {
+ return SelectionSegment();
+ } else {
+ SelectionSegment sr(ranges[0].anchor, ranges[0].caret);
+ for (size_t i=1; i<ranges.size(); i++) {
+ sr.Extend(ranges[i].anchor);
+ sr.Extend(ranges[i].caret);
+ }
+ return sr;
+ }
+}
+
+SelectionSegment Selection::LimitsForRectangularElseMain() const {
+ if (IsRectangular()) {
+ return Limits();
+ } else {
+ return SelectionSegment(ranges[mainRange].caret, ranges[mainRange].anchor);
+ }
+}
+
+size_t Selection::Count() const {
+ return ranges.size();
+}
+
+size_t Selection::Main() const {
+ return mainRange;
+}
+
+void Selection::SetMain(size_t r) {
+ PLATFORM_ASSERT(r < ranges.size());
+ mainRange = r;
+}
+
+SelectionRange &Selection::Range(size_t r) {
+ return ranges[r];
+}
+
+const SelectionRange &Selection::Range(size_t r) const {
+ return ranges[r];
+}
+
+SelectionRange &Selection::RangeMain() {
+ return ranges[mainRange];
+}
+
+const SelectionRange &Selection::RangeMain() const {
+ return ranges[mainRange];
+}
+
+SelectionPosition Selection::Start() const {
+ if (IsRectangular()) {
+ return rangeRectangular.Start();
+ } else {
+ return ranges[mainRange].Start();
+ }
+}
+
+bool Selection::MoveExtends() const {
+ return moveExtends;
+}
+
+void Selection::SetMoveExtends(bool moveExtends_) {
+ moveExtends = moveExtends_;
+}
+
+bool Selection::Empty() const {
+ for (size_t i=0; i<ranges.size(); i++) {
+ if (!ranges[i].Empty())
+ return false;
+ }
+ return true;
+}
+
+SelectionPosition Selection::Last() const {
+ SelectionPosition lastPosition;
+ for (size_t i=0; i<ranges.size(); i++) {
+ if (lastPosition < ranges[i].caret)
+ lastPosition = ranges[i].caret;
+ if (lastPosition < ranges[i].anchor)
+ lastPosition = ranges[i].anchor;
+ }
+ return lastPosition;
+}
+
+int Selection::Length() const {
+ int len = 0;
+ for (size_t i=0; i<ranges.size(); i++) {
+ len += ranges[i].Length();
+ }
+ return len;
+}
+
+void Selection::MovePositions(bool insertion, int startChange, int length) {
+ for (size_t i=0; i<ranges.size(); i++) {
+ ranges[i].MoveForInsertDelete(insertion, startChange, length);
+ }
+ if (selType == selRectangle) {
+ rangeRectangular.MoveForInsertDelete(insertion, startChange, length);
+ }
+}
+
+void Selection::TrimSelection(SelectionRange range) {
+ for (size_t i=0; i<ranges.size();) {
+ if ((i != mainRange) && (ranges[i].Trim(range))) {
+ // Trimmed to empty so remove
+ for (size_t j=i; j<ranges.size()-1; j++) {
+ ranges[j] = ranges[j+1];
+ if (j == mainRange-1)
+ mainRange--;
+ }
+ ranges.pop_back();
+ } else {
+ i++;
+ }
+ }
+}
+
+void Selection::SetSelection(SelectionRange range) {
+ ranges.clear();
+ ranges.push_back(range);
+ mainRange = ranges.size() - 1;
+}
+
+void Selection::AddSelection(SelectionRange range) {
+ TrimSelection(range);
+ ranges.push_back(range);
+ mainRange = ranges.size() - 1;
+}
+
+void Selection::AddSelectionWithoutTrim(SelectionRange range) {
+ ranges.push_back(range);
+ mainRange = ranges.size() - 1;
+}
+
+void Selection::DropSelection(size_t r) {
+ if ((ranges.size() > 1) && (r < ranges.size())) {
+ size_t mainNew = mainRange;
+ if (mainNew >= r) {
+ if (mainNew == 0) {
+ mainNew = ranges.size() - 2;
+ } else {
+ mainNew--;
+ }
+ }
+ ranges.erase(ranges.begin() + r);
+ mainRange = mainNew;
+ }
+}
+
+void Selection::TentativeSelection(SelectionRange range) {
+ if (!tentativeMain) {
+ rangesSaved = ranges;
+ }
+ ranges = rangesSaved;
+ AddSelection(range);
+ TrimSelection(ranges[mainRange]);
+ tentativeMain = true;
+}
+
+void Selection::CommitTentative() {
+ rangesSaved.clear();
+ tentativeMain = false;
+}
+
+int Selection::CharacterInSelection(int posCharacter) const {
+ for (size_t i=0; i<ranges.size(); i++) {
+ if (ranges[i].ContainsCharacter(posCharacter))
+ return i == mainRange ? 1 : 2;
+ }
+ return 0;
+}
+
+int Selection::InSelectionForEOL(int pos) const {
+ for (size_t i=0; i<ranges.size(); i++) {
+ if (!ranges[i].Empty() && (pos > ranges[i].Start().Position()) && (pos <= ranges[i].End().Position()))
+ return i == mainRange ? 1 : 2;
+ }
+ return 0;
+}
+
+int Selection::VirtualSpaceFor(int pos) const {
+ int virtualSpace = 0;
+ for (size_t i=0; i<ranges.size(); i++) {
+ if ((ranges[i].caret.Position() == pos) && (virtualSpace < ranges[i].caret.VirtualSpace()))
+ virtualSpace = ranges[i].caret.VirtualSpace();
+ if ((ranges[i].anchor.Position() == pos) && (virtualSpace < ranges[i].anchor.VirtualSpace()))
+ virtualSpace = ranges[i].anchor.VirtualSpace();
+ }
+ return virtualSpace;
+}
+
+void Selection::Clear() {
+ ranges.clear();
+ ranges.push_back(SelectionRange());
+ mainRange = ranges.size() - 1;
+ selType = selStream;
+ moveExtends = false;
+ ranges[mainRange].Reset();
+ rangeRectangular.Reset();
+}
+
+void Selection::RemoveDuplicates() {
+ for (size_t i=0; i<ranges.size()-1; i++) {
+ if (ranges[i].Empty()) {
+ size_t j=i+1;
+ while (j<ranges.size()) {
+ if (ranges[i] == ranges[j]) {
+ ranges.erase(ranges.begin() + j);
+ if (mainRange >= j)
+ mainRange--;
+ } else {
+ j++;
+ }
+ }
+ }
+ }
+}
+
+void Selection::RotateMain() {
+ mainRange = (mainRange + 1) % ranges.size();
+}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Selection.h b/3rdparty/bgfx/3rdparty/scintilla/src/Selection.h
new file mode 100644
index 00000000000..499f837712b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Selection.h
@@ -0,0 +1,193 @@
+// Scintilla source code edit control
+/** @file Selection.h
+ ** Classes maintaining the selection.
+ **/
+// Copyright 2009 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef SELECTION_H
+#define SELECTION_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+class SelectionPosition {
+ int position;
+ int virtualSpace;
+public:
+ explicit SelectionPosition(int position_=INVALID_POSITION, int virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) {
+ PLATFORM_ASSERT(virtualSpace < 800000);
+ if (virtualSpace < 0)
+ virtualSpace = 0;
+ }
+ void Reset() {
+ position = 0;
+ virtualSpace = 0;
+ }
+ void MoveForInsertDelete(bool insertion, int startChange, int length);
+ bool operator ==(const SelectionPosition &other) const {
+ return position == other.position && virtualSpace == other.virtualSpace;
+ }
+ bool operator <(const SelectionPosition &other) const;
+ bool operator >(const SelectionPosition &other) const;
+ bool operator <=(const SelectionPosition &other) const;
+ bool operator >=(const SelectionPosition &other) const;
+ int Position() const {
+ return position;
+ }
+ void SetPosition(int position_) {
+ position = position_;
+ virtualSpace = 0;
+ }
+ int VirtualSpace() const {
+ return virtualSpace;
+ }
+ void SetVirtualSpace(int virtualSpace_) {
+ PLATFORM_ASSERT(virtualSpace_ < 800000);
+ if (virtualSpace_ >= 0)
+ virtualSpace = virtualSpace_;
+ }
+ void Add(int increment) {
+ position = position + increment;
+ }
+ bool IsValid() const {
+ return position >= 0;
+ }
+};
+
+// Ordered range to make drawing simpler
+struct SelectionSegment {
+ SelectionPosition start;
+ SelectionPosition end;
+ SelectionSegment() : start(), end() {
+ }
+ SelectionSegment(SelectionPosition a, SelectionPosition b) {
+ if (a < b) {
+ start = a;
+ end = b;
+ } else {
+ start = b;
+ end = a;
+ }
+ }
+ bool Empty() const {
+ return start == end;
+ }
+ void Extend(SelectionPosition p) {
+ if (start > p)
+ start = p;
+ if (end < p)
+ end = p;
+ }
+};
+
+struct SelectionRange {
+ SelectionPosition caret;
+ SelectionPosition anchor;
+
+ SelectionRange() : caret(), anchor() {
+ }
+ explicit SelectionRange(SelectionPosition single) : caret(single), anchor(single) {
+ }
+ explicit SelectionRange(int single) : caret(single), anchor(single) {
+ }
+ SelectionRange(SelectionPosition caret_, SelectionPosition anchor_) : caret(caret_), anchor(anchor_) {
+ }
+ SelectionRange(int caret_, int anchor_) : caret(caret_), anchor(anchor_) {
+ }
+ bool Empty() const {
+ return anchor == caret;
+ }
+ int Length() const;
+ // int Width() const; // Like Length but takes virtual space into account
+ bool operator ==(const SelectionRange &other) const {
+ return caret == other.caret && anchor == other.anchor;
+ }
+ bool operator <(const SelectionRange &other) const {
+ return caret < other.caret || ((caret == other.caret) && (anchor < other.anchor));
+ }
+ void Reset() {
+ anchor.Reset();
+ caret.Reset();
+ }
+ void ClearVirtualSpace() {
+ anchor.SetVirtualSpace(0);
+ caret.SetVirtualSpace(0);
+ }
+ void MoveForInsertDelete(bool insertion, int startChange, int length);
+ bool Contains(int pos) const;
+ bool Contains(SelectionPosition sp) const;
+ bool ContainsCharacter(int posCharacter) const;
+ SelectionSegment Intersect(SelectionSegment check) const;
+ SelectionPosition Start() const {
+ return (anchor < caret) ? anchor : caret;
+ }
+ SelectionPosition End() const {
+ return (anchor < caret) ? caret : anchor;
+ }
+ bool Trim(SelectionRange range);
+ // If range is all virtual collapse to start of virtual space
+ void MinimizeVirtualSpace();
+};
+
+class Selection {
+ std::vector<SelectionRange> ranges;
+ std::vector<SelectionRange> rangesSaved;
+ SelectionRange rangeRectangular;
+ size_t mainRange;
+ bool moveExtends;
+ bool tentativeMain;
+public:
+ enum selTypes { noSel, selStream, selRectangle, selLines, selThin };
+ selTypes selType;
+
+ Selection();
+ ~Selection();
+ bool IsRectangular() const;
+ int MainCaret() const;
+ int MainAnchor() const;
+ SelectionRange &Rectangular();
+ SelectionSegment Limits() const;
+ // This is for when you want to move the caret in response to a
+ // user direction command - for rectangular selections, use the range
+ // that covers all selected text otherwise return the main selection.
+ SelectionSegment LimitsForRectangularElseMain() const;
+ size_t Count() const;
+ size_t Main() const;
+ void SetMain(size_t r);
+ SelectionRange &Range(size_t r);
+ const SelectionRange &Range(size_t r) const;
+ SelectionRange &RangeMain();
+ const SelectionRange &RangeMain() const;
+ SelectionPosition Start() const;
+ bool MoveExtends() const;
+ void SetMoveExtends(bool moveExtends_);
+ bool Empty() const;
+ SelectionPosition Last() const;
+ int Length() const;
+ void MovePositions(bool insertion, int startChange, int length);
+ void TrimSelection(SelectionRange range);
+ void SetSelection(SelectionRange range);
+ void AddSelection(SelectionRange range);
+ void AddSelectionWithoutTrim(SelectionRange range);
+ void DropSelection(size_t r);
+ void TentativeSelection(SelectionRange range);
+ void CommitTentative();
+ int CharacterInSelection(int posCharacter) const;
+ int InSelectionForEOL(int pos) const;
+ int VirtualSpaceFor(int pos) const;
+ void Clear();
+ void RemoveDuplicates();
+ void RotateMain();
+ bool Tentative() const { return tentativeMain; }
+ std::vector<SelectionRange> RangesCopy() const {
+ return ranges;
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/SplitVector.h b/3rdparty/bgfx/3rdparty/scintilla/src/SplitVector.h
new file mode 100644
index 00000000000..288c9e39f42
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/SplitVector.h
@@ -0,0 +1,291 @@
+// Scintilla source code edit control
+/** @file SplitVector.h
+ ** Main data structure for holding arrays that handle insertions
+ ** and deletions efficiently.
+ **/
+// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef SPLITVECTOR_H
+#define SPLITVECTOR_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+template <typename T>
+class SplitVector {
+protected:
+ T *body;
+ int size;
+ int lengthBody;
+ int part1Length;
+ int gapLength; /// invariant: gapLength == size - lengthBody
+ int growSize;
+
+ /// Move the gap to a particular position so that insertion and
+ /// deletion at that point will not require much copying and
+ /// hence be fast.
+ void GapTo(int position) {
+ if (position != part1Length) {
+ if (position < part1Length) {
+ memmove(
+ body + position + gapLength,
+ body + position,
+ sizeof(T) * (part1Length - position));
+ } else { // position > part1Length
+ memmove(
+ body + part1Length,
+ body + part1Length + gapLength,
+ sizeof(T) * (position - part1Length));
+ }
+ part1Length = position;
+ }
+ }
+
+ /// Check that there is room in the buffer for an insertion,
+ /// reallocating if more space needed.
+ void RoomFor(int insertionLength) {
+ if (gapLength <= insertionLength) {
+ while (growSize < size / 6)
+ growSize *= 2;
+ ReAllocate(size + insertionLength + growSize);
+ }
+ }
+
+ void Init() {
+ body = NULL;
+ growSize = 8;
+ size = 0;
+ lengthBody = 0;
+ part1Length = 0;
+ gapLength = 0;
+ }
+
+public:
+ /// Construct a split buffer.
+ SplitVector() {
+ Init();
+ }
+
+ ~SplitVector() {
+ delete []body;
+ body = 0;
+ }
+
+ int GetGrowSize() const {
+ return growSize;
+ }
+
+ void SetGrowSize(int growSize_) {
+ growSize = growSize_;
+ }
+
+ /// Reallocate the storage for the buffer to be newSize and
+ /// copy exisiting contents to the new buffer.
+ /// Must not be used to decrease the size of the buffer.
+ void ReAllocate(int newSize) {
+ if (newSize > size) {
+ // Move the gap to the end
+ GapTo(lengthBody);
+ T *newBody = new T[newSize];
+ if ((size != 0) && (body != 0)) {
+ memmove(newBody, body, sizeof(T) * lengthBody);
+ delete []body;
+ }
+ body = newBody;
+ gapLength += newSize - size;
+ size = newSize;
+ }
+ }
+
+ /// Retrieve the character at a particular position.
+ /// Retrieving positions outside the range of the buffer returns 0.
+ /// The assertions here are disabled since calling code can be
+ /// simpler if out of range access works and returns 0.
+ T ValueAt(int position) const {
+ if (position < part1Length) {
+ //PLATFORM_ASSERT(position >= 0);
+ if (position < 0) {
+ return 0;
+ } else {
+ return body[position];
+ }
+ } else {
+ //PLATFORM_ASSERT(position < lengthBody);
+ if (position >= lengthBody) {
+ return 0;
+ } else {
+ return body[gapLength + position];
+ }
+ }
+ }
+
+ void SetValueAt(int position, T v) {
+ if (position < part1Length) {
+ PLATFORM_ASSERT(position >= 0);
+ if (position < 0) {
+ ;
+ } else {
+ body[position] = v;
+ }
+ } else {
+ PLATFORM_ASSERT(position < lengthBody);
+ if (position >= lengthBody) {
+ ;
+ } else {
+ body[gapLength + position] = v;
+ }
+ }
+ }
+
+ T &operator[](int position) const {
+ PLATFORM_ASSERT(position >= 0 && position < lengthBody);
+ if (position < part1Length) {
+ return body[position];
+ } else {
+ return body[gapLength + position];
+ }
+ }
+
+ /// Retrieve the length of the buffer.
+ int Length() const {
+ return lengthBody;
+ }
+
+ /// Insert a single value into the buffer.
+ /// Inserting at positions outside the current range fails.
+ void Insert(int position, T v) {
+ PLATFORM_ASSERT((position >= 0) && (position <= lengthBody));
+ if ((position < 0) || (position > lengthBody)) {
+ return;
+ }
+ RoomFor(1);
+ GapTo(position);
+ body[part1Length] = v;
+ lengthBody++;
+ part1Length++;
+ gapLength--;
+ }
+
+ /// Insert a number of elements into the buffer setting their value.
+ /// Inserting at positions outside the current range fails.
+ void InsertValue(int position, int insertLength, T v) {
+ PLATFORM_ASSERT((position >= 0) && (position <= lengthBody));
+ if (insertLength > 0) {
+ if ((position < 0) || (position > lengthBody)) {
+ return;
+ }
+ RoomFor(insertLength);
+ GapTo(position);
+ std::fill(&body[part1Length], &body[part1Length + insertLength], v);
+ lengthBody += insertLength;
+ part1Length += insertLength;
+ gapLength -= insertLength;
+ }
+ }
+
+ /// Ensure at least length elements allocated,
+ /// appending zero valued elements if needed.
+ void EnsureLength(int wantedLength) {
+ if (Length() < wantedLength) {
+ InsertValue(Length(), wantedLength - Length(), 0);
+ }
+ }
+
+ /// Insert text into the buffer from an array.
+ void InsertFromArray(int positionToInsert, const T s[], int positionFrom, int insertLength) {
+ PLATFORM_ASSERT((positionToInsert >= 0) && (positionToInsert <= lengthBody));
+ if (insertLength > 0) {
+ if ((positionToInsert < 0) || (positionToInsert > lengthBody)) {
+ return;
+ }
+ RoomFor(insertLength);
+ GapTo(positionToInsert);
+ memmove(body + part1Length, s + positionFrom, sizeof(T) * insertLength);
+ lengthBody += insertLength;
+ part1Length += insertLength;
+ gapLength -= insertLength;
+ }
+ }
+
+ /// Delete one element from the buffer.
+ void Delete(int position) {
+ PLATFORM_ASSERT((position >= 0) && (position < lengthBody));
+ if ((position < 0) || (position >= lengthBody)) {
+ return;
+ }
+ DeleteRange(position, 1);
+ }
+
+ /// Delete a range from the buffer.
+ /// Deleting positions outside the current range fails.
+ void DeleteRange(int position, int deleteLength) {
+ PLATFORM_ASSERT((position >= 0) && (position + deleteLength <= lengthBody));
+ if ((position < 0) || ((position + deleteLength) > lengthBody)) {
+ return;
+ }
+ if ((position == 0) && (deleteLength == lengthBody)) {
+ // Full deallocation returns storage and is faster
+ delete []body;
+ Init();
+ } else if (deleteLength > 0) {
+ GapTo(position);
+ lengthBody -= deleteLength;
+ gapLength += deleteLength;
+ }
+ }
+
+ /// Delete all the buffer contents.
+ void DeleteAll() {
+ DeleteRange(0, lengthBody);
+ }
+
+ // Retrieve a range of elements into an array
+ void GetRange(T *buffer, int position, int retrieveLength) const {
+ // Split into up to 2 ranges, before and after the split then use memcpy on each.
+ int range1Length = 0;
+ if (position < part1Length) {
+ int part1AfterPosition = part1Length - position;
+ range1Length = retrieveLength;
+ if (range1Length > part1AfterPosition)
+ range1Length = part1AfterPosition;
+ }
+ memcpy(buffer, body + position, range1Length * sizeof(T));
+ buffer += range1Length;
+ position = position + range1Length + gapLength;
+ int range2Length = retrieveLength - range1Length;
+ memcpy(buffer, body + position, range2Length * sizeof(T));
+ }
+
+ T *BufferPointer() {
+ RoomFor(1);
+ GapTo(lengthBody);
+ body[lengthBody] = 0;
+ return body;
+ }
+
+ T *RangePointer(int position, int rangeLength) {
+ if (position < part1Length) {
+ if ((position + rangeLength) > part1Length) {
+ // Range overlaps gap, so move gap to start of range.
+ GapTo(position);
+ return body + position + gapLength;
+ } else {
+ return body + position;
+ }
+ } else {
+ return body + position + gapLength;
+ }
+ }
+
+ int GapPosition() const {
+ return part1Length;
+ }
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Style.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/Style.cxx
new file mode 100644
index 00000000000..ba3f97c3d58
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Style.cxx
@@ -0,0 +1,167 @@
+// Scintilla source code edit control
+/** @file Style.cxx
+ ** Defines the font and colour style for a class of text.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "Style.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+FontAlias::FontAlias() {
+}
+
+FontAlias::FontAlias(const FontAlias &other) : Font() {
+ SetID(other.fid);
+}
+
+FontAlias::~FontAlias() {
+ SetID(0);
+ // ~Font will not release the actual font resource since it is now 0
+}
+
+void FontAlias::MakeAlias(Font &fontOrigin) {
+ SetID(fontOrigin.GetID());
+}
+
+void FontAlias::ClearFont() {
+ SetID(0);
+}
+
+bool FontSpecification::operator==(const FontSpecification &other) const {
+ return fontName == other.fontName &&
+ weight == other.weight &&
+ italic == other.italic &&
+ size == other.size &&
+ characterSet == other.characterSet &&
+ extraFontFlag == other.extraFontFlag;
+}
+
+bool FontSpecification::operator<(const FontSpecification &other) const {
+ if (fontName != other.fontName)
+ return fontName < other.fontName;
+ if (weight != other.weight)
+ return weight < other.weight;
+ if (italic != other.italic)
+ return italic == false;
+ if (size != other.size)
+ return size < other.size;
+ if (characterSet != other.characterSet)
+ return characterSet < other.characterSet;
+ if (extraFontFlag != other.extraFontFlag)
+ return extraFontFlag < other.extraFontFlag;
+ return false;
+}
+
+FontMeasurements::FontMeasurements() {
+ Clear();
+}
+
+void FontMeasurements::Clear() {
+ ascent = 1;
+ descent = 1;
+ aveCharWidth = 1;
+ spaceWidth = 1;
+ sizeZoomed = 2;
+}
+
+Style::Style() : FontSpecification() {
+ Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
+ Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, 0, SC_CHARSET_DEFAULT,
+ SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
+}
+
+Style::Style(const Style &source) : FontSpecification(), FontMeasurements() {
+ Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
+ 0, 0, 0,
+ SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
+ fore = source.fore;
+ back = source.back;
+ characterSet = source.characterSet;
+ weight = source.weight;
+ italic = source.italic;
+ size = source.size;
+ fontName = source.fontName;
+ eolFilled = source.eolFilled;
+ underline = source.underline;
+ caseForce = source.caseForce;
+ visible = source.visible;
+ changeable = source.changeable;
+ hotspot = source.hotspot;
+}
+
+Style::~Style() {
+}
+
+Style &Style::operator=(const Style &source) {
+ if (this == &source)
+ return * this;
+ Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
+ 0, 0, SC_CHARSET_DEFAULT,
+ SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false);
+ fore = source.fore;
+ back = source.back;
+ characterSet = source.characterSet;
+ weight = source.weight;
+ italic = source.italic;
+ size = source.size;
+ fontName = source.fontName;
+ eolFilled = source.eolFilled;
+ underline = source.underline;
+ caseForce = source.caseForce;
+ visible = source.visible;
+ changeable = source.changeable;
+ return *this;
+}
+
+void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_,
+ const char *fontName_, int characterSet_,
+ int weight_, bool italic_, bool eolFilled_,
+ bool underline_, ecaseForced caseForce_,
+ bool visible_, bool changeable_, bool hotspot_) {
+ fore = fore_;
+ back = back_;
+ characterSet = characterSet_;
+ weight = weight_;
+ italic = italic_;
+ size = size_;
+ fontName = fontName_;
+ eolFilled = eolFilled_;
+ underline = underline_;
+ caseForce = caseForce_;
+ visible = visible_;
+ changeable = changeable_;
+ hotspot = hotspot_;
+ font.ClearFont();
+ FontMeasurements::Clear();
+}
+
+void Style::ClearTo(const Style &source) {
+ Clear(
+ source.fore,
+ source.back,
+ source.size,
+ source.fontName,
+ source.characterSet,
+ source.weight,
+ source.italic,
+ source.eolFilled,
+ source.underline,
+ source.caseForce,
+ source.visible,
+ source.changeable,
+ source.hotspot);
+}
+
+void Style::Copy(Font &font_, const FontMeasurements &fm_) {
+ font.MakeAlias(font_);
+ (FontMeasurements &)(*this) = fm_;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/Style.h b/3rdparty/bgfx/3rdparty/scintilla/src/Style.h
new file mode 100644
index 00000000000..411b11a08b9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/Style.h
@@ -0,0 +1,91 @@
+// Scintilla source code edit control
+/** @file Style.h
+ ** Defines the font and colour style for a class of text.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef STYLE_H
+#define STYLE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+struct FontSpecification {
+ const char *fontName;
+ int weight;
+ bool italic;
+ int size;
+ int characterSet;
+ int extraFontFlag;
+ FontSpecification() :
+ fontName(0),
+ weight(SC_WEIGHT_NORMAL),
+ italic(false),
+ size(10 * SC_FONT_SIZE_MULTIPLIER),
+ characterSet(0),
+ extraFontFlag(0) {
+ }
+ bool operator==(const FontSpecification &other) const;
+ bool operator<(const FontSpecification &other) const;
+};
+
+// Just like Font but only has a copy of the FontID so should not delete it
+class FontAlias : public Font {
+ // Private so FontAlias objects can not be assigned except for intiialization
+ FontAlias &operator=(const FontAlias &);
+public:
+ FontAlias();
+ FontAlias(const FontAlias &);
+ virtual ~FontAlias();
+ void MakeAlias(Font &fontOrigin);
+ void ClearFont();
+};
+
+struct FontMeasurements {
+ unsigned int ascent;
+ unsigned int descent;
+ XYPOSITION aveCharWidth;
+ XYPOSITION spaceWidth;
+ int sizeZoomed;
+ FontMeasurements();
+ void Clear();
+};
+
+/**
+ */
+class Style : public FontSpecification, public FontMeasurements {
+public:
+ ColourDesired fore;
+ ColourDesired back;
+ bool eolFilled;
+ bool underline;
+ enum ecaseForced {caseMixed, caseUpper, caseLower};
+ ecaseForced caseForce;
+ bool visible;
+ bool changeable;
+ bool hotspot;
+
+ FontAlias font;
+
+ Style();
+ Style(const Style &source);
+ ~Style();
+ Style &operator=(const Style &source);
+ void Clear(ColourDesired fore_, ColourDesired back_,
+ int size_,
+ const char *fontName_, int characterSet_,
+ int weight_, bool italic_, bool eolFilled_,
+ bool underline_, ecaseForced caseForce_,
+ bool visible_, bool changeable_, bool hotspot_);
+ void ClearTo(const Style &source);
+ void Copy(Font &font_, const FontMeasurements &fm_);
+ bool IsProtected() const { return !(changeable && visible);}
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.cxx
new file mode 100644
index 00000000000..04053b05701
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.cxx
@@ -0,0 +1,311 @@
+// Scintilla source code edit control
+/** @file UniConversion.cxx
+ ** Functions to handle UTF-8 and UTF-16 strings.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+
+#include "UniConversion.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
+enum { SURROGATE_TRAIL_LAST = 0xDFFF };
+enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 };
+
+unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {
+ unsigned int len = 0;
+ for (unsigned int i = 0; i < tlen && uptr[i];) {
+ unsigned int uch = uptr[i];
+ if (uch < 0x80) {
+ len++;
+ } else if (uch < 0x800) {
+ len += 2;
+ } else if ((uch >= SURROGATE_LEAD_FIRST) &&
+ (uch <= SURROGATE_TRAIL_LAST)) {
+ len += 4;
+ i++;
+ } else {
+ len += 3;
+ }
+ i++;
+ }
+ return len;
+}
+
+void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) {
+ unsigned int k = 0;
+ for (unsigned int i = 0; i < tlen && uptr[i];) {
+ unsigned int uch = uptr[i];
+ if (uch < 0x80) {
+ putf[k++] = static_cast<char>(uch);
+ } else if (uch < 0x800) {
+ putf[k++] = static_cast<char>(0xC0 | (uch >> 6));
+ putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
+ } else if ((uch >= SURROGATE_LEAD_FIRST) &&
+ (uch <= SURROGATE_TRAIL_LAST)) {
+ // Half a surrogate pair
+ i++;
+ unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff);
+ putf[k++] = static_cast<char>(0xF0 | (xch >> 18));
+ putf[k++] = static_cast<char>(0x80 | ((xch >> 12) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | ((xch >> 6) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | (xch & 0x3f));
+ } else {
+ putf[k++] = static_cast<char>(0xE0 | (uch >> 12));
+ putf[k++] = static_cast<char>(0x80 | ((uch >> 6) & 0x3f));
+ putf[k++] = static_cast<char>(0x80 | (uch & 0x3f));
+ }
+ i++;
+ }
+ if (k < len)
+ putf[k] = '\0';
+}
+
+unsigned int UTF8CharLength(unsigned char ch) {
+ if (ch < 0x80) {
+ return 1;
+ } else if (ch < 0x80 + 0x40 + 0x20) {
+ return 2;
+ } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) {
+ return 3;
+ } else {
+ return 4;
+ }
+}
+
+size_t UTF16Length(const char *s, size_t len) {
+ size_t ulen = 0;
+ size_t charLen;
+ for (size_t i = 0; i<len;) {
+ unsigned char ch = static_cast<unsigned char>(s[i]);
+ if (ch < 0x80) {
+ charLen = 1;
+ } else if (ch < 0x80 + 0x40 + 0x20) {
+ charLen = 2;
+ } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) {
+ charLen = 3;
+ } else {
+ charLen = 4;
+ ulen++;
+ }
+ i += charLen;
+ ulen++;
+ }
+ return ulen;
+}
+
+size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen) {
+ size_t ui = 0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ size_t i = 0;
+ while ((i<len) && (ui<tlen)) {
+ unsigned char ch = us[i++];
+ if (ch < 0x80) {
+ tbuf[ui] = ch;
+ } else if (ch < 0x80 + 0x40 + 0x20) {
+ tbuf[ui] = static_cast<wchar_t>((ch & 0x1F) << 6);
+ ch = us[i++];
+ tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + (ch & 0x7F));
+ } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) {
+ tbuf[ui] = static_cast<wchar_t>((ch & 0xF) << 12);
+ ch = us[i++];
+ tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + ((ch & 0x7F) << 6));
+ ch = us[i++];
+ tbuf[ui] = static_cast<wchar_t>(tbuf[ui] + (ch & 0x7F));
+ } else {
+ // Outside the BMP so need two surrogates
+ int val = (ch & 0x7) << 18;
+ ch = us[i++];
+ val += (ch & 0x3F) << 12;
+ ch = us[i++];
+ val += (ch & 0x3F) << 6;
+ ch = us[i++];
+ val += (ch & 0x3F);
+ tbuf[ui] = static_cast<wchar_t>(((val - 0x10000) >> 10) + SURROGATE_LEAD_FIRST);
+ ui++;
+ tbuf[ui] = static_cast<wchar_t>((val & 0x3ff) + SURROGATE_TRAIL_FIRST);
+ }
+ ui++;
+ }
+ return ui;
+}
+
+unsigned int UTF32FromUTF8(const char *s, unsigned int len, unsigned int *tbuf, unsigned int tlen) {
+ unsigned int ui=0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ unsigned int i=0;
+ while ((i<len) && (ui<tlen)) {
+ unsigned char ch = us[i++];
+ unsigned int value = 0;
+ if (ch < 0x80) {
+ value = ch;
+ } else if (((len-i) >= 1) && (ch < 0x80 + 0x40 + 0x20)) {
+ value = (ch & 0x1F) << 6;
+ ch = us[i++];
+ value += ch & 0x7F;
+ } else if (((len-i) >= 2) && (ch < 0x80 + 0x40 + 0x20 + 0x10)) {
+ value = (ch & 0xF) << 12;
+ ch = us[i++];
+ value += (ch & 0x7F) << 6;
+ ch = us[i++];
+ value += ch & 0x7F;
+ } else if ((len-i) >= 3) {
+ value = (ch & 0x7) << 18;
+ ch = us[i++];
+ value += (ch & 0x3F) << 12;
+ ch = us[i++];
+ value += (ch & 0x3F) << 6;
+ ch = us[i++];
+ value += ch & 0x3F;
+ }
+ tbuf[ui] = value;
+ ui++;
+ }
+ return ui;
+}
+
+unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) {
+ if (val < SUPPLEMENTAL_PLANE_FIRST) {
+ tbuf[0] = static_cast<wchar_t>(val);
+ return 1;
+ } else {
+ tbuf[0] = static_cast<wchar_t>(((val - SUPPLEMENTAL_PLANE_FIRST) >> 10) + SURROGATE_LEAD_FIRST);
+ tbuf[1] = static_cast<wchar_t>((val & 0x3ff) + SURROGATE_TRAIL_FIRST);
+ return 2;
+ }
+}
+
+int UTF8BytesOfLead[256];
+static bool initialisedBytesOfLead = false;
+
+static int BytesFromLead(int leadByte) {
+ if (leadByte < 0xC2) {
+ // Single byte or invalid
+ return 1;
+ } else if (leadByte < 0xE0) {
+ return 2;
+ } else if (leadByte < 0xF0) {
+ return 3;
+ } else if (leadByte < 0xF5) {
+ return 4;
+ } else {
+ // Characters longer than 4 bytes not possible in current UTF-8
+ return 1;
+ }
+}
+
+void UTF8BytesOfLeadInitialise() {
+ if (!initialisedBytesOfLead) {
+ for (int i=0; i<256; i++) {
+ UTF8BytesOfLead[i] = BytesFromLead(i);
+ }
+ initialisedBytesOfLead = true;
+ }
+}
+
+// Return both the width of the first character in the string and a status
+// saying whether it is valid or invalid.
+// Most invalid sequences return a width of 1 so are treated as isolated bytes but
+// the non-characters *FFFE, *FFFF and FDD0 .. FDEF return 3 or 4 as they can be
+// reasonably treated as code points in some circumstances. They will, however,
+// not have associated glyphs.
+int UTF8Classify(const unsigned char *us, int len) {
+ // For the rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ if (*us < 0x80) {
+ // Single bytes easy
+ return 1;
+ } else if (*us > 0xf4) {
+ // Characters longer than 4 bytes not possible in current UTF-8
+ return UTF8MaskInvalid | 1;
+ } else if (*us >= 0xf0) {
+ // 4 bytes
+ if (len < 4)
+ return UTF8MaskInvalid | 1;
+ if (UTF8IsTrailByte(us[1]) && UTF8IsTrailByte(us[2]) && UTF8IsTrailByte(us[3])) {
+ if (((us[1] & 0xf) == 0xf) && (us[2] == 0xbf) && ((us[3] == 0xbe) || (us[3] == 0xbf))) {
+ // *FFFE or *FFFF non-character
+ return UTF8MaskInvalid | 4;
+ }
+ if (*us == 0xf4) {
+ // Check if encoding a value beyond the last Unicode character 10FFFF
+ if (us[1] > 0x8f) {
+ return UTF8MaskInvalid | 1;
+ } else if (us[1] == 0x8f) {
+ if (us[2] > 0xbf) {
+ return UTF8MaskInvalid | 1;
+ } else if (us[2] == 0xbf) {
+ if (us[3] > 0xbf) {
+ return UTF8MaskInvalid | 1;
+ }
+ }
+ }
+ } else if ((*us == 0xf0) && ((us[1] & 0xf0) == 0x80)) {
+ // Overlong
+ return UTF8MaskInvalid | 1;
+ }
+ return 4;
+ } else {
+ return UTF8MaskInvalid | 1;
+ }
+ } else if (*us >= 0xe0) {
+ // 3 bytes
+ if (len < 3)
+ return UTF8MaskInvalid | 1;
+ if (UTF8IsTrailByte(us[1]) && UTF8IsTrailByte(us[2])) {
+ if ((*us == 0xe0) && ((us[1] & 0xe0) == 0x80)) {
+ // Overlong
+ return UTF8MaskInvalid | 1;
+ }
+ if ((*us == 0xed) && ((us[1] & 0xe0) == 0xa0)) {
+ // Surrogate
+ return UTF8MaskInvalid | 1;
+ }
+ if ((*us == 0xef) && (us[1] == 0xbf) && (us[2] == 0xbe)) {
+ // U+FFFE non-character - 3 bytes long
+ return UTF8MaskInvalid | 3;
+ }
+ if ((*us == 0xef) && (us[1] == 0xbf) && (us[2] == 0xbf)) {
+ // U+FFFF non-character - 3 bytes long
+ return UTF8MaskInvalid | 3;
+ }
+ if ((*us == 0xef) && (us[1] == 0xb7) && (((us[2] & 0xf0) == 0x90) || ((us[2] & 0xf0) == 0xa0))) {
+ // U+FDD0 .. U+FDEF
+ return UTF8MaskInvalid | 3;
+ }
+ return 3;
+ } else {
+ return UTF8MaskInvalid | 1;
+ }
+ } else if (*us >= 0xc2) {
+ // 2 bytes
+ if (len < 2)
+ return UTF8MaskInvalid | 1;
+ if (UTF8IsTrailByte(us[1])) {
+ return 2;
+ } else {
+ return UTF8MaskInvalid | 1;
+ }
+ } else {
+ // 0xc0 .. 0xc1 is overlong encoding
+ // 0x80 .. 0xbf is trail byte
+ return UTF8MaskInvalid | 1;
+ }
+}
+
+int UTF8DrawBytes(const unsigned char *us, int len) {
+ int utf8StatusNext = UTF8Classify(us, len);
+ return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth);
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.h b/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.h
new file mode 100644
index 00000000000..08898cac38f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/UniConversion.h
@@ -0,0 +1,68 @@
+// Scintilla source code edit control
+/** @file UniConversion.h
+ ** Functions to handle UTF-8 and UTF-16 strings.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef UNICONVERSION_H
+#define UNICONVERSION_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+const int UTF8MaxBytes = 4;
+
+const int unicodeReplacementChar = 0xFFFD;
+
+unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen);
+void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len);
+unsigned int UTF8CharLength(unsigned char ch);
+size_t UTF16Length(const char *s, size_t len);
+size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen);
+unsigned int UTF32FromUTF8(const char *s, unsigned int len, unsigned int *tbuf, unsigned int tlen);
+unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf);
+
+extern int UTF8BytesOfLead[256];
+void UTF8BytesOfLeadInitialise();
+
+inline bool UTF8IsTrailByte(int ch) {
+ return (ch >= 0x80) && (ch < 0xc0);
+}
+
+inline bool UTF8IsAscii(int ch) {
+ return ch < 0x80;
+}
+
+enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
+int UTF8Classify(const unsigned char *us, int len);
+
+// Similar to UTF8Classify but returns a length of 1 for invalid bytes
+// instead of setting the invalid flag
+int UTF8DrawBytes(const unsigned char *us, int len);
+
+// Line separator is U+2028 \xe2\x80\xa8
+// Paragraph separator is U+2029 \xe2\x80\xa9
+const int UTF8SeparatorLength = 3;
+inline bool UTF8IsSeparator(const unsigned char *us) {
+ return (us[0] == 0xe2) && (us[1] == 0x80) && ((us[2] == 0xa8) || (us[2] == 0xa9));
+}
+
+// NEL is U+0085 \xc2\x85
+const int UTF8NELLength = 2;
+inline bool UTF8IsNEL(const unsigned char *us) {
+ return (us[0] == 0xc2) && (us[1] == 0x85);
+}
+
+enum { SURROGATE_LEAD_FIRST = 0xD800 };
+enum { SURROGATE_LEAD_LAST = 0xDBFF };
+inline unsigned int UTF16CharLength(wchar_t uch) {
+ return ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST)) ? 2 : 1;
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/UnicodeFromUTF8.h b/3rdparty/bgfx/3rdparty/scintilla/src/UnicodeFromUTF8.h
new file mode 100644
index 00000000000..ae66cb0a928
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/UnicodeFromUTF8.h
@@ -0,0 +1,32 @@
+// Scintilla source code edit control
+/** @file UnicodeFromUTF8.h
+ ** Lexer infrastructure.
+ **/
+// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
+// This file is in the public domain.
+
+#ifndef UNICODEFROMUTF8_H
+#define UNICODEFROMUTF8_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+inline int UnicodeFromUTF8(const unsigned char *us) {
+ if (us[0] < 0xC2) {
+ return us[0];
+ } else if (us[0] < 0xE0) {
+ return ((us[0] & 0x1F) << 6) + (us[1] & 0x3F);
+ } else if (us[0] < 0xF0) {
+ return ((us[0] & 0xF) << 12) + ((us[1] & 0x3F) << 6) + (us[2] & 0x3F);
+ } else if (us[0] < 0xF5) {
+ return ((us[0] & 0x7) << 18) + ((us[1] & 0x3F) << 12) + ((us[2] & 0x3F) << 6) + (us[3] & 0x3F);
+ }
+ return us[0];
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.cxx
new file mode 100644
index 00000000000..e56c8f37563
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.cxx
@@ -0,0 +1,589 @@
+// Scintilla source code edit control
+/** @file ViewStyle.cxx
+ ** Store information on how the document is to be viewed.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <string.h>
+#include <assert.h>
+
+#include <vector>
+#include <map>
+
+#include "Platform.h"
+
+#include "Scintilla.h"
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+MarginStyle::MarginStyle() :
+ style(SC_MARGIN_SYMBOL), width(0), mask(0), sensitive(false), cursor(SC_CURSORREVERSEARROW) {
+}
+
+// A list of the fontnames - avoids wasting space in each style
+FontNames::FontNames() {
+}
+
+FontNames::~FontNames() {
+ Clear();
+}
+
+void FontNames::Clear() {
+ for (std::vector<char *>::const_iterator it=names.begin(); it != names.end(); ++it) {
+ delete []*it;
+ }
+ names.clear();
+}
+
+const char *FontNames::Save(const char *name) {
+ if (!name)
+ return 0;
+
+ for (std::vector<char *>::const_iterator it=names.begin(); it != names.end(); ++it) {
+ if (strcmp(*it, name) == 0) {
+ return *it;
+ }
+ }
+ const size_t lenName = strlen(name) + 1;
+ char *nameSave = new char[lenName];
+ memcpy(nameSave, name, lenName);
+ names.push_back(nameSave);
+ return nameSave;
+}
+
+FontRealised::FontRealised() {
+}
+
+FontRealised::~FontRealised() {
+ font.Release();
+}
+
+void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs) {
+ PLATFORM_ASSERT(fs.fontName);
+ sizeZoomed = fs.size + zoomLevel * SC_FONT_SIZE_MULTIPLIER;
+ if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
+ sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
+
+ float deviceHeight = static_cast<float>(surface.DeviceHeightFont(sizeZoomed));
+ FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight, fs.italic, fs.extraFontFlag, technology, fs.characterSet);
+ font.Create(fp);
+
+ ascent = static_cast<unsigned int>(surface.Ascent(font));
+ descent = static_cast<unsigned int>(surface.Descent(font));
+ aveCharWidth = surface.AverageCharWidth(font);
+ spaceWidth = surface.WidthChar(font, ' ');
+}
+
+ViewStyle::ViewStyle() {
+ Init();
+}
+
+ViewStyle::ViewStyle(const ViewStyle &source) {
+ Init(source.styles.size());
+ for (unsigned int sty=0; sty<source.styles.size(); sty++) {
+ styles[sty] = source.styles[sty];
+ // Can't just copy fontname as its lifetime is relative to its owning ViewStyle
+ styles[sty].fontName = fontNames.Save(source.styles[sty].fontName);
+ }
+ nextExtendedStyle = source.nextExtendedStyle;
+ for (int mrk=0; mrk<=MARKER_MAX; mrk++) {
+ markers[mrk] = source.markers[mrk];
+ }
+ CalcLargestMarkerHeight();
+ indicatorsDynamic = 0;
+ indicatorsSetFore = 0;
+ for (int ind=0; ind<=INDIC_MAX; ind++) {
+ indicators[ind] = source.indicators[ind];
+ if (indicators[ind].IsDynamic())
+ indicatorsDynamic++;
+ if (indicators[ind].OverridesTextFore())
+ indicatorsSetFore++;
+ }
+
+ selColours = source.selColours;
+ selAdditionalForeground = source.selAdditionalForeground;
+ selAdditionalBackground = source.selAdditionalBackground;
+ selBackground2 = source.selBackground2;
+ selAlpha = source.selAlpha;
+ selAdditionalAlpha = source.selAdditionalAlpha;
+ selEOLFilled = source.selEOLFilled;
+
+ foldmarginColour = source.foldmarginColour;
+ foldmarginHighlightColour = source.foldmarginHighlightColour;
+
+ hotspotColours = source.hotspotColours;
+ hotspotUnderline = source.hotspotUnderline;
+ hotspotSingleLine = source.hotspotSingleLine;
+
+ whitespaceColours = source.whitespaceColours;
+ controlCharSymbol = source.controlCharSymbol;
+ controlCharWidth = source.controlCharWidth;
+ selbar = source.selbar;
+ selbarlight = source.selbarlight;
+ caretcolour = source.caretcolour;
+ additionalCaretColour = source.additionalCaretColour;
+ showCaretLineBackground = source.showCaretLineBackground;
+ alwaysShowCaretLineBackground = source.alwaysShowCaretLineBackground;
+ caretLineBackground = source.caretLineBackground;
+ caretLineAlpha = source.caretLineAlpha;
+ edgecolour = source.edgecolour;
+ edgeState = source.edgeState;
+ caretStyle = source.caretStyle;
+ caretWidth = source.caretWidth;
+ someStylesProtected = false;
+ someStylesForceCase = false;
+ leftMarginWidth = source.leftMarginWidth;
+ rightMarginWidth = source.rightMarginWidth;
+ for (int margin=0; margin <= SC_MAX_MARGIN; margin++) {
+ ms[margin] = source.ms[margin];
+ }
+ maskInLine = source.maskInLine;
+ fixedColumnWidth = source.fixedColumnWidth;
+ marginInside = source.marginInside;
+ textStart = source.textStart;
+ zoomLevel = source.zoomLevel;
+ viewWhitespace = source.viewWhitespace;
+ whitespaceSize = source.whitespaceSize;
+ viewIndentationGuides = source.viewIndentationGuides;
+ viewEOL = source.viewEOL;
+ extraFontFlag = source.extraFontFlag;
+ extraAscent = source.extraAscent;
+ extraDescent = source.extraDescent;
+ marginStyleOffset = source.marginStyleOffset;
+ annotationVisible = source.annotationVisible;
+ annotationStyleOffset = source.annotationStyleOffset;
+ braceHighlightIndicatorSet = source.braceHighlightIndicatorSet;
+ braceHighlightIndicator = source.braceHighlightIndicator;
+ braceBadLightIndicatorSet = source.braceBadLightIndicatorSet;
+ braceBadLightIndicator = source.braceBadLightIndicator;
+
+ theEdge = source.theEdge;
+
+ marginNumberPadding = source.marginNumberPadding;
+ ctrlCharPadding = source.ctrlCharPadding;
+ lastSegItalicsOffset = source.lastSegItalicsOffset;
+
+ wrapState = source.wrapState;
+ wrapVisualFlags = source.wrapVisualFlags;
+ wrapVisualFlagsLocation = source.wrapVisualFlagsLocation;
+ wrapVisualStartIndent = source.wrapVisualStartIndent;
+ wrapIndentMode = source.wrapIndentMode;
+}
+
+ViewStyle::~ViewStyle() {
+ styles.clear();
+ for (FontMap::iterator it = fonts.begin(); it != fonts.end(); ++it) {
+ delete it->second;
+ }
+ fonts.clear();
+}
+
+void ViewStyle::Init(size_t stylesSize_) {
+ AllocStyles(stylesSize_);
+ nextExtendedStyle = 256;
+ fontNames.Clear();
+ ResetDefaultStyle();
+
+ // There are no image markers by default, so no need for calling CalcLargestMarkerHeight()
+ largestMarkerHeight = 0;
+
+ indicators[0] = Indicator(INDIC_SQUIGGLE, ColourDesired(0, 0x7f, 0));
+ indicators[1] = Indicator(INDIC_TT, ColourDesired(0, 0, 0xff));
+ indicators[2] = Indicator(INDIC_PLAIN, ColourDesired(0xff, 0, 0));
+
+ technology = SC_TECHNOLOGY_DEFAULT;
+ indicatorsDynamic = 0;
+ indicatorsSetFore = 0;
+ lineHeight = 1;
+ lineOverlap = 0;
+ maxAscent = 1;
+ maxDescent = 1;
+ aveCharWidth = 8;
+ spaceWidth = 8;
+ tabWidth = spaceWidth * 8;
+
+ selColours.fore = ColourOptional(ColourDesired(0xff, 0, 0));
+ selColours.back = ColourOptional(ColourDesired(0xc0, 0xc0, 0xc0), true);
+ selAdditionalForeground = ColourDesired(0xff, 0, 0);
+ selAdditionalBackground = ColourDesired(0xd7, 0xd7, 0xd7);
+ selBackground2 = ColourDesired(0xb0, 0xb0, 0xb0);
+ selAlpha = SC_ALPHA_NOALPHA;
+ selAdditionalAlpha = SC_ALPHA_NOALPHA;
+ selEOLFilled = false;
+
+ foldmarginColour = ColourOptional(ColourDesired(0xff, 0, 0));
+ foldmarginHighlightColour = ColourOptional(ColourDesired(0xc0, 0xc0, 0xc0));
+
+ whitespaceColours.fore = ColourOptional();
+ whitespaceColours.back = ColourOptional(ColourDesired(0xff, 0xff, 0xff));
+ controlCharSymbol = 0; /* Draw the control characters */
+ controlCharWidth = 0;
+ selbar = Platform::Chrome();
+ selbarlight = Platform::ChromeHighlight();
+ styles[STYLE_LINENUMBER].fore = ColourDesired(0, 0, 0);
+ styles[STYLE_LINENUMBER].back = Platform::Chrome();
+ caretcolour = ColourDesired(0, 0, 0);
+ additionalCaretColour = ColourDesired(0x7f, 0x7f, 0x7f);
+ showCaretLineBackground = false;
+ alwaysShowCaretLineBackground = false;
+ caretLineBackground = ColourDesired(0xff, 0xff, 0);
+ caretLineAlpha = SC_ALPHA_NOALPHA;
+ edgecolour = ColourDesired(0xc0, 0xc0, 0xc0);
+ edgeState = EDGE_NONE;
+ caretStyle = CARETSTYLE_LINE;
+ caretWidth = 1;
+ someStylesProtected = false;
+ someStylesForceCase = false;
+
+ hotspotColours.fore = ColourOptional(ColourDesired(0, 0, 0xff));
+ hotspotColours.back = ColourOptional(ColourDesired(0xff, 0xff, 0xff));
+ hotspotUnderline = true;
+ hotspotSingleLine = true;
+
+ leftMarginWidth = 1;
+ rightMarginWidth = 1;
+ ms[0].style = SC_MARGIN_NUMBER;
+ ms[0].width = 0;
+ ms[0].mask = 0;
+ ms[1].style = SC_MARGIN_SYMBOL;
+ ms[1].width = 16;
+ ms[1].mask = ~SC_MASK_FOLDERS;
+ ms[2].style = SC_MARGIN_SYMBOL;
+ ms[2].width = 0;
+ ms[2].mask = 0;
+ marginInside = true;
+ fixedColumnWidth = marginInside ? leftMarginWidth : 0;
+ maskInLine = 0xffffffff;
+ for (int margin=0; margin <= SC_MAX_MARGIN; margin++) {
+ fixedColumnWidth += ms[margin].width;
+ if (ms[margin].width > 0)
+ maskInLine &= ~ms[margin].mask;
+ }
+ textStart = marginInside ? fixedColumnWidth : leftMarginWidth;
+ zoomLevel = 0;
+ viewWhitespace = wsInvisible;
+ whitespaceSize = 1;
+ viewIndentationGuides = ivNone;
+ viewEOL = false;
+ extraFontFlag = 0;
+ extraAscent = 0;
+ extraDescent = 0;
+ marginStyleOffset = 0;
+ annotationVisible = ANNOTATION_HIDDEN;
+ annotationStyleOffset = 0;
+ braceHighlightIndicatorSet = false;
+ braceHighlightIndicator = 0;
+ braceBadLightIndicatorSet = false;
+ braceBadLightIndicator = 0;
+
+ theEdge = 0;
+
+ marginNumberPadding = 3;
+ ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side
+ lastSegItalicsOffset = 2;
+
+ wrapState = eWrapNone;
+ wrapVisualFlags = 0;
+ wrapVisualFlagsLocation = 0;
+ wrapVisualStartIndent = 0;
+ wrapIndentMode = SC_WRAPINDENT_FIXED;
+}
+
+void ViewStyle::Refresh(Surface &surface, int tabInChars) {
+ for (FontMap::iterator it = fonts.begin(); it != fonts.end(); ++it) {
+ delete it->second;
+ }
+ fonts.clear();
+
+ selbar = Platform::Chrome();
+ selbarlight = Platform::ChromeHighlight();
+
+ for (unsigned int i=0; i<styles.size(); i++) {
+ styles[i].extraFontFlag = extraFontFlag;
+ }
+
+ CreateAndAddFont(styles[STYLE_DEFAULT]);
+ for (unsigned int j=0; j<styles.size(); j++) {
+ CreateAndAddFont(styles[j]);
+ }
+
+ for (FontMap::iterator it = fonts.begin(); it != fonts.end(); ++it) {
+ it->second->Realise(surface, zoomLevel, technology, it->first);
+ }
+
+ for (unsigned int k=0; k<styles.size(); k++) {
+ FontRealised *fr = Find(styles[k]);
+ styles[k].Copy(fr->font, *fr);
+ }
+ indicatorsDynamic = 0;
+ indicatorsSetFore = 0;
+ for (int ind = 0; ind <= INDIC_MAX; ind++) {
+ if (indicators[ind].IsDynamic())
+ indicatorsDynamic++;
+ if (indicators[ind].OverridesTextFore())
+ indicatorsSetFore++;
+ }
+ maxAscent = 1;
+ maxDescent = 1;
+ FindMaxAscentDescent();
+ maxAscent += extraAscent;
+ maxDescent += extraDescent;
+ lineHeight = maxAscent + maxDescent;
+ lineOverlap = lineHeight / 10;
+ if (lineOverlap < 2)
+ lineOverlap = 2;
+ if (lineOverlap > lineHeight)
+ lineOverlap = lineHeight;
+
+ someStylesProtected = false;
+ someStylesForceCase = false;
+ for (unsigned int l=0; l<styles.size(); l++) {
+ if (styles[l].IsProtected()) {
+ someStylesProtected = true;
+ }
+ if (styles[l].caseForce != Style::caseMixed) {
+ someStylesForceCase = true;
+ }
+ }
+
+ aveCharWidth = styles[STYLE_DEFAULT].aveCharWidth;
+ spaceWidth = styles[STYLE_DEFAULT].spaceWidth;
+ tabWidth = spaceWidth * tabInChars;
+
+ controlCharWidth = 0.0;
+ if (controlCharSymbol >= 32) {
+ controlCharWidth = surface.WidthChar(styles[STYLE_CONTROLCHAR].font, static_cast<char>(controlCharSymbol));
+ }
+
+ fixedColumnWidth = marginInside ? leftMarginWidth : 0;
+ maskInLine = 0xffffffff;
+ for (int margin=0; margin <= SC_MAX_MARGIN; margin++) {
+ fixedColumnWidth += ms[margin].width;
+ if (ms[margin].width > 0)
+ maskInLine &= ~ms[margin].mask;
+ }
+ textStart = marginInside ? fixedColumnWidth : leftMarginWidth;
+}
+
+void ViewStyle::ReleaseAllExtendedStyles() {
+ nextExtendedStyle = 256;
+}
+
+int ViewStyle::AllocateExtendedStyles(int numberStyles) {
+ int startRange = static_cast<int>(nextExtendedStyle);
+ nextExtendedStyle += numberStyles;
+ EnsureStyle(nextExtendedStyle);
+ for (size_t i=startRange; i<nextExtendedStyle; i++) {
+ styles[i].ClearTo(styles[STYLE_DEFAULT]);
+ }
+ return startRange;
+}
+
+void ViewStyle::EnsureStyle(size_t index) {
+ if (index >= styles.size()) {
+ AllocStyles(index+1);
+ }
+}
+
+void ViewStyle::ResetDefaultStyle() {
+ styles[STYLE_DEFAULT].Clear(ColourDesired(0,0,0),
+ ColourDesired(0xff,0xff,0xff),
+ Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, fontNames.Save(Platform::DefaultFont()),
+ SC_CHARSET_DEFAULT,
+ SC_WEIGHT_NORMAL, false, false, false, Style::caseMixed, true, true, false);
+}
+
+void ViewStyle::ClearStyles() {
+ // Reset all styles to be like the default style
+ for (unsigned int i=0; i<styles.size(); i++) {
+ if (i != STYLE_DEFAULT) {
+ styles[i].ClearTo(styles[STYLE_DEFAULT]);
+ }
+ }
+ styles[STYLE_LINENUMBER].back = Platform::Chrome();
+
+ // Set call tip fore/back to match the values previously set for call tips
+ styles[STYLE_CALLTIP].back = ColourDesired(0xff, 0xff, 0xff);
+ styles[STYLE_CALLTIP].fore = ColourDesired(0x80, 0x80, 0x80);
+}
+
+void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {
+ styles[styleIndex].fontName = fontNames.Save(name);
+}
+
+bool ViewStyle::ProtectionActive() const {
+ return someStylesProtected;
+}
+
+int ViewStyle::ExternalMarginWidth() const {
+ return marginInside ? 0 : fixedColumnWidth;
+}
+
+bool ViewStyle::ValidStyle(size_t styleIndex) const {
+ return styleIndex < styles.size();
+}
+
+void ViewStyle::CalcLargestMarkerHeight() {
+ largestMarkerHeight = 0;
+ for (int m = 0; m <= MARKER_MAX; ++m) {
+ switch (markers[m].markType) {
+ case SC_MARK_PIXMAP:
+ if (markers[m].pxpm && markers[m].pxpm->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].pxpm->GetHeight();
+ break;
+ case SC_MARK_RGBAIMAGE:
+ if (markers[m].image && markers[m].image->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].image->GetHeight();
+ break;
+ }
+ }
+}
+
+// See if something overrides the line background color: Either if caret is on the line
+// and background color is set for that, or if a marker is defined that forces its background
+// color onto the line, or if a marker is defined but has no selection margin in which to
+// display itself (as long as it's not an SC_MARK_EMPTY marker). These are checked in order
+// with the earlier taking precedence. When multiple markers cause background override,
+// the color for the highest numbered one is used.
+ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const {
+ ColourOptional background;
+ if ((caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground && (caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret) {
+ background = ColourOptional(caretLineBackground, true);
+ }
+ if (!background.isSet && marksOfLine) {
+ int marks = marksOfLine;
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && (markers[markBit].markType == SC_MARK_BACKGROUND) &&
+ (markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ background = ColourOptional(markers[markBit].back, true);
+ }
+ marks >>= 1;
+ }
+ }
+ if (!background.isSet && maskInLine) {
+ int marksMasked = marksOfLine & maskInLine;
+ if (marksMasked) {
+ for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
+ if ((marksMasked & 1) && (markers[markBit].markType != SC_MARK_EMPTY) &&
+ (markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
+ background = ColourOptional(markers[markBit].back, true);
+ }
+ marksMasked >>= 1;
+ }
+ }
+ }
+ return background;
+}
+
+bool ViewStyle::SelectionBackgroundDrawn() const {
+ return selColours.back.isSet &&
+ ((selAlpha == SC_ALPHA_NOALPHA) || (selAdditionalAlpha == SC_ALPHA_NOALPHA));
+}
+
+bool ViewStyle::WhitespaceBackgroundDrawn() const {
+ return (viewWhitespace != wsInvisible) && (whitespaceColours.back.isSet);
+}
+
+ColourDesired ViewStyle::WrapColour() const {
+ if (whitespaceColours.fore.isSet)
+ return whitespaceColours.fore;
+ else
+ return styles[STYLE_DEFAULT].fore;
+}
+
+bool ViewStyle::SetWrapState(int wrapState_) {
+ WrapMode wrapStateWanted;
+ switch (wrapState_) {
+ case SC_WRAP_WORD:
+ wrapStateWanted = eWrapWord;
+ break;
+ case SC_WRAP_CHAR:
+ wrapStateWanted = eWrapChar;
+ break;
+ case SC_WRAP_WHITESPACE:
+ wrapStateWanted = eWrapWhitespace;
+ break;
+ default:
+ wrapStateWanted = eWrapNone;
+ break;
+ }
+ bool changed = wrapState != wrapStateWanted;
+ wrapState = wrapStateWanted;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualFlags(int wrapVisualFlags_) {
+ bool changed = wrapVisualFlags != wrapVisualFlags_;
+ wrapVisualFlags = wrapVisualFlags_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) {
+ bool changed = wrapVisualFlagsLocation != wrapVisualFlagsLocation_;
+ wrapVisualFlagsLocation = wrapVisualFlagsLocation_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualStartIndent(int wrapVisualStartIndent_) {
+ bool changed = wrapVisualStartIndent != wrapVisualStartIndent_;
+ wrapVisualStartIndent = wrapVisualStartIndent_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) {
+ bool changed = wrapIndentMode != wrapIndentMode_;
+ wrapIndentMode = wrapIndentMode_;
+ return changed;
+}
+
+void ViewStyle::AllocStyles(size_t sizeNew) {
+ size_t i=styles.size();
+ styles.resize(sizeNew);
+ if (styles.size() > STYLE_DEFAULT) {
+ for (; i<sizeNew; i++) {
+ if (i != STYLE_DEFAULT) {
+ styles[i].ClearTo(styles[STYLE_DEFAULT]);
+ }
+ }
+ }
+}
+
+void ViewStyle::CreateAndAddFont(const FontSpecification &fs) {
+ if (fs.fontName) {
+ FontMap::iterator it = fonts.find(fs);
+ if (it == fonts.end()) {
+ fonts[fs] = new FontRealised();
+ }
+ }
+}
+
+FontRealised *ViewStyle::Find(const FontSpecification &fs) {
+ if (!fs.fontName) // Invalid specification so return arbitrary object
+ return fonts.begin()->second;
+ FontMap::iterator it = fonts.find(fs);
+ if (it != fonts.end()) {
+ // Should always reach here since map was just set for all styles
+ return it->second;
+ }
+ return 0;
+}
+
+void ViewStyle::FindMaxAscentDescent() {
+ for (FontMap::const_iterator it = fonts.begin(); it != fonts.end(); ++it) {
+ if (maxAscent < it->second->ascent)
+ maxAscent = it->second->ascent;
+ if (maxDescent < it->second->descent)
+ maxDescent = it->second->descent;
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.h b/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.h
new file mode 100644
index 00000000000..930ad104c4f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/ViewStyle.h
@@ -0,0 +1,199 @@
+// Scintilla source code edit control
+/** @file ViewStyle.h
+ ** Store information on how the document is to be viewed.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef VIEWSTYLE_H
+#define VIEWSTYLE_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ */
+class MarginStyle {
+public:
+ int style;
+ int width;
+ int mask;
+ bool sensitive;
+ int cursor;
+ MarginStyle();
+};
+
+/**
+ */
+class FontNames {
+private:
+ std::vector<char *> names;
+
+ // Private so FontNames objects can not be copied
+ FontNames(const FontNames &);
+public:
+ FontNames();
+ ~FontNames();
+ void Clear();
+ const char *Save(const char *name);
+};
+
+class FontRealised : public FontMeasurements {
+ // Private so FontRealised objects can not be copied
+ FontRealised(const FontRealised &);
+ FontRealised &operator=(const FontRealised &);
+public:
+ Font font;
+ FontRealised();
+ virtual ~FontRealised();
+ void Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs);
+};
+
+enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth};
+
+enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
+
+typedef std::map<FontSpecification, FontRealised *> FontMap;
+
+enum WrapMode { eWrapNone, eWrapWord, eWrapChar, eWrapWhitespace };
+
+class ColourOptional : public ColourDesired {
+public:
+ bool isSet;
+ ColourOptional(ColourDesired colour_=ColourDesired(0,0,0), bool isSet_=false) : ColourDesired(colour_), isSet(isSet_) {
+ }
+ ColourOptional(uptr_t wParam, sptr_t lParam) : ColourDesired(static_cast<long>(lParam)), isSet(wParam != 0) {
+ }
+};
+
+struct ForeBackColours {
+ ColourOptional fore;
+ ColourOptional back;
+};
+
+/**
+ */
+class ViewStyle {
+ FontNames fontNames;
+ FontMap fonts;
+public:
+ std::vector<Style> styles;
+ size_t nextExtendedStyle;
+ LineMarker markers[MARKER_MAX + 1];
+ int largestMarkerHeight;
+ Indicator indicators[INDIC_MAX + 1];
+ unsigned int indicatorsDynamic;
+ unsigned int indicatorsSetFore;
+ int technology;
+ int lineHeight;
+ int lineOverlap;
+ unsigned int maxAscent;
+ unsigned int maxDescent;
+ XYPOSITION aveCharWidth;
+ XYPOSITION spaceWidth;
+ XYPOSITION tabWidth;
+ ForeBackColours selColours;
+ ColourDesired selAdditionalForeground;
+ ColourDesired selAdditionalBackground;
+ ColourDesired selBackground2;
+ int selAlpha;
+ int selAdditionalAlpha;
+ bool selEOLFilled;
+ ForeBackColours whitespaceColours;
+ int controlCharSymbol;
+ XYPOSITION controlCharWidth;
+ ColourDesired selbar;
+ ColourDesired selbarlight;
+ ColourOptional foldmarginColour;
+ ColourOptional foldmarginHighlightColour;
+ ForeBackColours hotspotColours;
+ bool hotspotUnderline;
+ bool hotspotSingleLine;
+ /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
+ int leftMarginWidth; ///< Spacing margin on left of text
+ int rightMarginWidth; ///< Spacing margin on right of text
+ int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
+ MarginStyle ms[SC_MAX_MARGIN+1];
+ int fixedColumnWidth; ///< Total width of margins
+ bool marginInside; ///< true: margin included in text view, false: separate views
+ int textStart; ///< Starting x position of text within the view
+ int zoomLevel;
+ WhiteSpaceVisibility viewWhitespace;
+ int whitespaceSize;
+ IndentView viewIndentationGuides;
+ bool viewEOL;
+ ColourDesired caretcolour;
+ ColourDesired additionalCaretColour;
+ bool showCaretLineBackground;
+ bool alwaysShowCaretLineBackground;
+ ColourDesired caretLineBackground;
+ int caretLineAlpha;
+ ColourDesired edgecolour;
+ int edgeState;
+ int caretStyle;
+ int caretWidth;
+ bool someStylesProtected;
+ bool someStylesForceCase;
+ int extraFontFlag;
+ int extraAscent;
+ int extraDescent;
+ int marginStyleOffset;
+ int annotationVisible;
+ int annotationStyleOffset;
+ bool braceHighlightIndicatorSet;
+ int braceHighlightIndicator;
+ bool braceBadLightIndicatorSet;
+ int braceBadLightIndicator;
+ int theEdge;
+ int marginNumberPadding; // the right-side padding of the number margin
+ int ctrlCharPadding; // the padding around control character text blobs
+ int lastSegItalicsOffset; // the offset so as not to clip italic characters at EOLs
+
+ // Wrapping support
+ WrapMode wrapState;
+ int wrapVisualFlags;
+ int wrapVisualFlagsLocation;
+ int wrapVisualStartIndent;
+ int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT
+
+ ViewStyle();
+ ViewStyle(const ViewStyle &source);
+ ~ViewStyle();
+ void Init(size_t stylesSize_=256);
+ void Refresh(Surface &surface, int tabInChars);
+ void ReleaseAllExtendedStyles();
+ int AllocateExtendedStyles(int numberStyles);
+ void EnsureStyle(size_t index);
+ void ResetDefaultStyle();
+ void ClearStyles();
+ void SetStyleFontName(int styleIndex, const char *name);
+ bool ProtectionActive() const;
+ int ExternalMarginWidth() const;
+ bool ValidStyle(size_t styleIndex) const;
+ void CalcLargestMarkerHeight();
+ ColourOptional Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const;
+ bool SelectionBackgroundDrawn() const;
+ bool WhitespaceBackgroundDrawn() const;
+ ColourDesired WrapColour() const;
+
+ bool SetWrapState(int wrapState_);
+ bool SetWrapVisualFlags(int wrapVisualFlags_);
+ bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_);
+ bool SetWrapVisualStartIndent(int wrapVisualStartIndent_);
+ bool SetWrapIndentMode(int wrapIndentMode_);
+
+private:
+ void AllocStyles(size_t sizeNew);
+ void CreateAndAddFont(const FontSpecification &fs);
+ FontRealised *Find(const FontSpecification &fs);
+ void FindMaxAscentDescent();
+ // Private so can only be copied through copy constructor which ensures font names initialised correctly
+ ViewStyle &operator=(const ViewStyle &);
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/XPM.cxx b/3rdparty/bgfx/3rdparty/scintilla/src/XPM.cxx
new file mode 100644
index 00000000000..c2b308acb72
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/XPM.cxx
@@ -0,0 +1,303 @@
+// Scintilla source code edit control
+/** @file XPM.cxx
+ ** Define a class that holds data in the X Pixmap (XPM) format.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <vector>
+#include <map>
+
+#include "Platform.h"
+
+#include "XPM.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static const char *NextField(const char *s) {
+ // In case there are leading spaces in the string
+ while (*s && *s == ' ') {
+ s++;
+ }
+ while (*s && *s != ' ') {
+ s++;
+ }
+ while (*s && *s == ' ') {
+ s++;
+ }
+ return s;
+}
+
+// Data lines in XPM can be terminated either with NUL or "
+static size_t MeasureLength(const char *s) {
+ size_t i = 0;
+ while (s[i] && (s[i] != '\"'))
+ i++;
+ return i;
+}
+
+ColourDesired XPM::ColourFromCode(int ch) const {
+ return colourCodeTable[ch];
+}
+
+void XPM::FillRun(Surface *surface, int code, int startX, int y, int x) {
+ if ((code != codeTransparent) && (startX != x)) {
+ PRectangle rc = PRectangle::FromInts(startX, y, x, y + 1);
+ surface->FillRectangle(rc, ColourFromCode(code));
+ }
+}
+
+XPM::XPM(const char *textForm) {
+ Init(textForm);
+}
+
+XPM::XPM(const char *const *linesForm) {
+ Init(linesForm);
+}
+
+XPM::~XPM() {
+}
+
+void XPM::Init(const char *textForm) {
+ // Test done is two parts to avoid possibility of overstepping the memory
+ // if memcmp implemented strangely. Must be 4 bytes at least at destination.
+ if ((0 == memcmp(textForm, "/* X", 4)) && (0 == memcmp(textForm, "/* XPM */", 9))) {
+ // Build the lines form out of the text form
+ std::vector<const char *> linesForm = LinesFormFromTextForm(textForm);
+ if (!linesForm.empty()) {
+ Init(&linesForm[0]);
+ }
+ } else {
+ // It is really in line form
+ Init(reinterpret_cast<const char * const *>(textForm));
+ }
+}
+
+void XPM::Init(const char *const *linesForm) {
+ height = 1;
+ width = 1;
+ nColours = 1;
+ pixels.clear();
+ codeTransparent = ' ';
+ if (!linesForm)
+ return;
+
+ std::fill(colourCodeTable, colourCodeTable+256, 0);
+ const char *line0 = linesForm[0];
+ width = atoi(line0);
+ line0 = NextField(line0);
+ height = atoi(line0);
+ pixels.resize(width*height);
+ line0 = NextField(line0);
+ nColours = atoi(line0);
+ line0 = NextField(line0);
+ if (atoi(line0) != 1) {
+ // Only one char per pixel is supported
+ return;
+ }
+
+ for (int c=0; c<nColours; c++) {
+ const char *colourDef = linesForm[c+1];
+ int code = static_cast<unsigned char>(colourDef[0]);
+ colourDef += 4;
+ ColourDesired colour(0xff, 0xff, 0xff);
+ if (*colourDef == '#') {
+ colour.Set(colourDef);
+ } else {
+ codeTransparent = static_cast<char>(code);
+ }
+ colourCodeTable[code] = colour;
+ }
+
+ for (int y=0; y<height; y++) {
+ const char *lform = linesForm[y+nColours+1];
+ size_t len = MeasureLength(lform);
+ for (size_t x = 0; x<len; x++)
+ pixels[y * width + x] = static_cast<unsigned char>(lform[x]);
+ }
+}
+
+void XPM::Draw(Surface *surface, PRectangle &rc) {
+ if (pixels.empty()) {
+ return;
+ }
+ // Centre the pixmap
+ int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2);
+ int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2);
+ for (int y=0; y<height; y++) {
+ int prevCode = 0;
+ int xStartRun = 0;
+ for (int x=0; x<width; x++) {
+ int code = pixels[y * width + x];
+ if (code != prevCode) {
+ FillRun(surface, prevCode, startX + xStartRun, startY + y, startX + x);
+ xStartRun = x;
+ prevCode = code;
+ }
+ }
+ FillRun(surface, prevCode, startX + xStartRun, startY + y, startX + width);
+ }
+}
+
+void XPM::PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const {
+ if (pixels.empty() || (x<0) || (x >= width) || (y<0) || (y >= height)) {
+ colour = 0;
+ transparent = true;
+ return;
+ }
+ int code = pixels[y * width + x];
+ transparent = code == codeTransparent;
+ if (transparent) {
+ colour = 0;
+ } else {
+ colour = ColourFromCode(code).AsLong();
+ }
+}
+
+std::vector<const char *> XPM::LinesFormFromTextForm(const char *textForm) {
+ // Build the lines form out of the text form
+ std::vector<const char *> linesForm;
+ int countQuotes = 0;
+ int strings=1;
+ int j=0;
+ for (; countQuotes < (2*strings) && textForm[j] != '\0'; j++) {
+ if (textForm[j] == '\"') {
+ if (countQuotes == 0) {
+ // First field: width, height, number of colors, chars per pixel
+ const char *line0 = textForm + j + 1;
+ // Skip width
+ line0 = NextField(line0);
+ // Add 1 line for each pixel of height
+ strings += atoi(line0);
+ line0 = NextField(line0);
+ // Add 1 line for each colour
+ strings += atoi(line0);
+ }
+ if (countQuotes / 2 >= strings) {
+ break; // Bad height or number of colors!
+ }
+ if ((countQuotes & 1) == 0) {
+ linesForm.push_back(textForm + j + 1);
+ }
+ countQuotes++;
+ }
+ }
+ if (textForm[j] == '\0' || countQuotes / 2 > strings) {
+ // Malformed XPM! Height + number of colors too high or too low
+ linesForm.clear();
+ }
+ return linesForm;
+}
+
+RGBAImage::RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_) :
+ height(height_), width(width_), scale(scale_) {
+ if (pixels_) {
+ pixelBytes.assign(pixels_, pixels_ + CountBytes());
+ } else {
+ pixelBytes.resize(CountBytes());
+ }
+}
+
+RGBAImage::RGBAImage(const XPM &xpm) {
+ height = xpm.GetHeight();
+ width = xpm.GetWidth();
+ scale = 1;
+ pixelBytes.resize(CountBytes());
+ for (int y=0; y<height; y++) {
+ for (int x=0; x<width; x++) {
+ ColourDesired colour;
+ bool transparent = false;
+ xpm.PixelAt(x, y, colour, transparent);
+ SetPixel(x, y, colour, transparent ? 0 : 255);
+ }
+ }
+}
+
+RGBAImage::~RGBAImage() {
+}
+
+int RGBAImage::CountBytes() const {
+ return width * height * 4;
+}
+
+const unsigned char *RGBAImage::Pixels() const {
+ return &pixelBytes[0];
+}
+
+void RGBAImage::SetPixel(int x, int y, ColourDesired colour, int alpha) {
+ unsigned char *pixel = &pixelBytes[0] + (y*width+x) * 4;
+ // RGBA
+ pixel[0] = static_cast<unsigned char>(colour.GetRed());
+ pixel[1] = static_cast<unsigned char>(colour.GetGreen());
+ pixel[2] = static_cast<unsigned char>(colour.GetBlue());
+ pixel[3] = static_cast<unsigned char>(alpha);
+}
+
+RGBAImageSet::RGBAImageSet() : height(-1), width(-1) {
+}
+
+RGBAImageSet::~RGBAImageSet() {
+ Clear();
+}
+
+/// Remove all images.
+void RGBAImageSet::Clear() {
+ for (ImageMap::iterator it=images.begin(); it != images.end(); ++it) {
+ delete it->second;
+ it->second = 0;
+ }
+ images.clear();
+ height = -1;
+ width = -1;
+}
+
+/// Add an image.
+void RGBAImageSet::Add(int ident, RGBAImage *image) {
+ ImageMap::iterator it=images.find(ident);
+ if (it == images.end()) {
+ images[ident] = image;
+ } else {
+ delete it->second;
+ it->second = image;
+ }
+ height = -1;
+ width = -1;
+}
+
+/// Get image by id.
+RGBAImage *RGBAImageSet::Get(int ident) {
+ ImageMap::iterator it = images.find(ident);
+ if (it != images.end()) {
+ return it->second;
+ }
+ return NULL;
+}
+
+/// Give the largest height of the set.
+int RGBAImageSet::GetHeight() const {
+ if (height < 0) {
+ for (ImageMap::const_iterator it=images.begin(); it != images.end(); ++it) {
+ if (height < it->second->GetHeight()) {
+ height = it->second->GetHeight();
+ }
+ }
+ }
+ return (height > 0) ? height : 0;
+}
+
+/// Give the largest width of the set.
+int RGBAImageSet::GetWidth() const {
+ if (width < 0) {
+ for (ImageMap::const_iterator it=images.begin(); it != images.end(); ++it) {
+ if (width < it->second->GetWidth()) {
+ width = it->second->GetWidth();
+ }
+ }
+ }
+ return (width > 0) ? width : 0;
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/src/XPM.h b/3rdparty/bgfx/3rdparty/scintilla/src/XPM.h
new file mode 100644
index 00000000000..631fe138659
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/src/XPM.h
@@ -0,0 +1,94 @@
+// Scintilla source code edit control
+/** @file XPM.h
+ ** Define a classes to hold image data in the X Pixmap (XPM) and RGBA formats.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef XPM_H
+#define XPM_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+/**
+ * Hold a pixmap in XPM format.
+ */
+class XPM {
+ int height;
+ int width;
+ int nColours;
+ std::vector<unsigned char> pixels;
+ ColourDesired colourCodeTable[256];
+ char codeTransparent;
+ ColourDesired ColourFromCode(int ch) const;
+ void FillRun(Surface *surface, int code, int startX, int y, int x);
+public:
+ explicit XPM(const char *textForm);
+ explicit XPM(const char *const *linesForm);
+ ~XPM();
+ void Init(const char *textForm);
+ void Init(const char *const *linesForm);
+ /// Decompose image into runs and use FillRectangle for each run
+ void Draw(Surface *surface, PRectangle &rc);
+ int GetHeight() const { return height; }
+ int GetWidth() const { return width; }
+ void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const;
+private:
+ static std::vector<const char *>LinesFormFromTextForm(const char *textForm);
+};
+
+/**
+ * A translucent image stored as a sequence of RGBA bytes.
+ */
+class RGBAImage {
+ // Private so RGBAImage objects can not be copied
+ RGBAImage(const RGBAImage &);
+ RGBAImage &operator=(const RGBAImage &);
+ int height;
+ int width;
+ float scale;
+ std::vector<unsigned char> pixelBytes;
+public:
+ RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_);
+ explicit RGBAImage(const XPM &xpm);
+ virtual ~RGBAImage();
+ int GetHeight() const { return height; }
+ int GetWidth() const { return width; }
+ float GetScale() const { return scale; }
+ float GetScaledHeight() const { return height / scale; }
+ float GetScaledWidth() const { return width / scale; }
+ int CountBytes() const;
+ const unsigned char *Pixels() const;
+ void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff);
+};
+
+/**
+ * A collection of RGBAImage pixmaps indexed by integer id.
+ */
+class RGBAImageSet {
+ typedef std::map<int, RGBAImage*> ImageMap;
+ ImageMap images;
+ mutable int height; ///< Memorize largest height of the set.
+ mutable int width; ///< Memorize largest width of the set.
+public:
+ RGBAImageSet();
+ ~RGBAImageSet();
+ /// Remove all images.
+ void Clear();
+ /// Add an image.
+ void Add(int ident, RGBAImage *image);
+ /// Get image by id.
+ RGBAImage *Get(int ident);
+ /// Give the largest height of the set.
+ int GetHeight() const;
+ /// Give the largest width of the set.
+ int GetWidth() const;
+};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/MessageNumbers.py b/3rdparty/bgfx/3rdparty/scintilla/test/MessageNumbers.py
new file mode 100644
index 00000000000..78202706934
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/MessageNumbers.py
@@ -0,0 +1,63 @@
+# List many windows message numbers
+
+msgs = {
+"WM_ACTIVATE":6,
+"WM_ACTIVATEAPP":28,
+"WM_CAPTURECHANGED":533,
+"WM_CHAR":258,
+"WM_CLOSE":16,
+"WM_CREATE":1,
+"WM_COMMAND":273,
+"WM_DESTROY":2,
+"WM_ENTERSIZEMOVE":561,
+"WM_ERASEBKGND":20,
+"WM_EXITSIZEMOVE":562,
+"WM_GETMINMAXINFO":36,
+"WM_GETTEXT":13,
+"WM_IME_SETCONTEXT":0x0281,
+"WM_IME_NOTIFY":0x0282,
+"WM_KEYDOWN":256,
+"WM_KEYUP":257,
+"WM_KILLFOCUS":8,
+"WM_LBUTTONDOWN":513,
+"WM_LBUTTONUP":514,
+"WM_MBUTTONDOWN":519,
+"WM_MBUTTONUP":520,
+"WM_MBUTTONDBLCLK":521,
+"WM_MOUSEACTIVATE":33,
+"WM_MOUSEMOVE":512,
+"WM_MOVE":3,
+"WM_MOVING":534,
+"WM_NCACTIVATE":134,
+"WM_NCCALCSIZE":131,
+"WM_NCCREATE":129,
+"WM_NCDESTROY":130,
+"WM_NCHITTEST":132,
+"WM_NCLBUTTONDBLCLK":163,
+"WM_NCLBUTTONDOWN":161,
+"WM_NCLBUTTONUP":162,
+"WM_NCMOUSEMOVE":160,
+"WM_NCPAINT":133,
+"WM_PAINT":15,
+"WM_PARENTNOTIFY":528,
+"WM_SETCURSOR":32,
+"WM_SETFOCUS":7,
+"WM_SETFONT":48,
+"WM_SETTEXT":12,
+"WM_SHOWWINDOW":24,
+"WM_SIZE":5,
+"WM_SIZING":532,
+"WM_SYNCPAINT":136,
+"WM_SYSCOMMAND":274,
+"WM_SYSKEYDOWN":260,
+"WM_TIMER":275,
+"WM_USER":1024,
+"WM_USER+1":1025,
+"WM_WINDOWPOSCHANGED":71,
+"WM_WINDOWPOSCHANGING":70,
+}
+
+sgsm={}
+for k,v in msgs.items():
+ sgsm[v] = k
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/README b/3rdparty/bgfx/3rdparty/scintilla/test/README
new file mode 100644
index 00000000000..f62f1785159
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/README
@@ -0,0 +1,30 @@
+The test directory contains some unit and performance tests for Scintilla.
+
+The tests can only be run on Windows or Linux/Qt using Python 2.7 or 3.x.
+Python 2.7+ is required because the bytes string type and literals are available.
+Scintilla must be built before running any tests.
+
+A test application for Windows only is in xite.py and this can be run to experiment:
+pythonw xite.py
+
+To run the basic tests:
+python simpleTests.py
+
+There are some lexing tests with simple input files in several languages in the examples
+subdirectory and their expected lexed states in *.styled where the start of each style
+is marked with {styleNumber}, for example:
+{15}<%@{16}language=javas{15}%>{0}
+
+To run the lexing tests:
+python lexTests.py
+
+To check for performance regressions:
+python performanceTests.py
+While each test run will be different and the timer has only limited granularity, some results
+from a 2 GHz Athlon with a DEBUG build are:
+ 0.187 testAddLine
+. 0.203 testAddLineMiddle
+. 0.171 testHuge
+. 0.203 testHugeInserts
+. 0.312 testHugeReplace
+.
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/ScintillaCallable.py b/3rdparty/bgfx/3rdparty/scintilla/test/ScintillaCallable.py
new file mode 100644
index 00000000000..8dbcfcdee27
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/ScintillaCallable.py
@@ -0,0 +1,159 @@
+# -*- coding: utf-8 -*-
+
+from __future__ import unicode_literals
+
+import ctypes, os, sys
+
+from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
+
+class TEXTRANGE(ctypes.Structure):
+ _fields_= (\
+ ('cpMin', c_long),
+ ('cpMax', c_long),
+ ('lpstrText', ctypes.POINTER(ctypes.c_char)),
+ )
+
+class FINDTEXT(ctypes.Structure):
+ _fields_= (\
+ ('cpMin', c_long),
+ ('cpMax', c_long),
+ ('lpstrText', c_char_p),
+ ('cpMinText', c_long),
+ ('cpMaxText', c_long),
+ )
+
+class SciCall:
+ def __init__(self, fn, ptr, msg, stringResult=False):
+ self._fn = fn
+ self._ptr = ptr
+ self._msg = msg
+ self._stringResult = stringResult
+ def __call__(self, w=0, l=0):
+ ww = ctypes.cast(w, c_char_p)
+ if self._stringResult:
+ lengthBytes = self._fn(self._ptr, self._msg, ww, None)
+ if lengthBytes == 0:
+ return bytearray()
+ result = (ctypes.c_byte * lengthBytes)(0)
+ lengthBytes2 = self._fn(self._ptr, self._msg, ww, ctypes.cast(result, c_char_p))
+ assert lengthBytes == lengthBytes2
+ return bytearray(result)[:lengthBytes]
+ else:
+ ll = ctypes.cast(l, c_char_p)
+ return self._fn(self._ptr, self._msg, ww, ll)
+
+sciFX = ctypes.CFUNCTYPE(c_long, c_char_p, c_int, c_char_p, c_char_p)
+
+class ScintillaCallable:
+ def __init__(self, face, scifn, sciptr):
+ self.__dict__["face"] = face
+ self.__dict__["used"] = set()
+ self.__dict__["all"] = set()
+ # The k member is for accessing constants as a dictionary
+ self.__dict__["k"] = {}
+ for f in face.features:
+ self.all.add(f)
+ if face.features[f]["FeatureType"] == "val":
+ self.k[f] = int(self.face.features[f]["Value"], 0)
+ elif face.features[f]["FeatureType"] == "evt":
+ self.k["SCN_"+f] = int(self.face.features[f]["Value"], 0)
+ scifn = sciFX(scifn)
+ self.__dict__["_scifn"] = scifn
+ self.__dict__["_sciptr"] = sciptr
+ def __getattr__(self, name):
+ if name in self.face.features:
+ self.used.add(name)
+ feature = self.face.features[name]
+ value = int(feature["Value"], 0)
+ #~ print("Feature", name, feature)
+ if feature["FeatureType"] == "val":
+ self.__dict__[name] = value
+ return value
+ else:
+ if feature["Param2Type"] == "stringresult" and \
+ name not in ["GetText", "GetLine", "GetCurLine"]:
+ return SciCall(self._scifn, self._sciptr, value, True)
+ else:
+ return SciCall(self._scifn, self._sciptr, value)
+ elif ("Get" + name) in self.face.features:
+ self.used.add("Get" + name)
+ feature = self.face.features["Get" + name]
+ value = int(feature["Value"], 0)
+ if feature["FeatureType"] == "get" and \
+ not name.startswith("Get") and \
+ not feature["Param1Type"] and \
+ not feature["Param2Type"] and \
+ feature["ReturnType"] in ["bool", "int", "position"]:
+ #~ print("property", feature)
+ return self._scifn(self._sciptr, value, None, None)
+ elif name.startswith("SCN_") and name in self.k:
+ self.used.add(name)
+ feature = self.face.features[name[4:]]
+ value = int(feature["Value"], 0)
+ #~ print("Feature", name, feature)
+ if feature["FeatureType"] == "val":
+ return value
+ raise AttributeError(name)
+ def __setattr__(self, name, val):
+ if ("Set" + name) in self.face.features:
+ self.used.add("Set" + name)
+ feature = self.face.features["Set" + name]
+ value = int(feature["Value"], 0)
+ #~ print("setproperty", feature)
+ if feature["FeatureType"] == "set" and not name.startswith("Set"):
+ if feature["Param1Type"] in ["bool", "int", "position"]:
+ return self._scifn(self._sciptr, value, c_char_p(val), None)
+ elif feature["Param2Type"] in ["string"]:
+ return self._scifn(self._sciptr, value, None, c_char_p(val))
+ raise AttributeError(name)
+ raise AttributeError(name)
+ def getvalue(self, name):
+ if name in self.face.features:
+ feature = self.face.features[name]
+ if feature["FeatureType"] != "evt":
+ try:
+ return int(feature["Value"], 0)
+ except ValueError:
+ return -1
+ return -1
+
+
+ def ByteRange(self, start, end):
+ tr = TEXTRANGE()
+ tr.cpMin = start
+ tr.cpMax = end
+ length = end - start
+ tr.lpstrText = ctypes.create_string_buffer(length + 1)
+ self.GetTextRange(0, ctypes.byref(tr))
+ text = tr.lpstrText[:length]
+ text += b"\0" * (length - len(text))
+ return text
+ def StyledTextRange(self, start, end):
+ tr = TEXTRANGE()
+ tr.cpMin = start
+ tr.cpMax = end
+ length = 2 * (end - start)
+ tr.lpstrText = ctypes.create_string_buffer(length + 2)
+ self.GetStyledText(0, ctypes.byref(tr))
+ styledText = tr.lpstrText[:length]
+ styledText += b"\0" * (length - len(styledText))
+ return styledText
+ def FindBytes(self, start, end, s, flags):
+ ft = FINDTEXT()
+ ft.cpMin = start
+ ft.cpMax = end
+ ft.lpstrText = s
+ ft.cpMinText = 0
+ ft.cpMaxText = 0
+ pos = self.FindText(flags, ctypes.byref(ft))
+ #~ print(start, end, ft.cpMinText, ft.cpMaxText)
+ return pos
+
+ def Contents(self):
+ return self.ByteRange(0, self.Length)
+
+ def SetContents(self, s):
+ self.TargetStart = 0
+ self.TargetEnd = self.Length
+ self.ReplaceTarget(len(s), s)
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/XiteMenu.py b/3rdparty/bgfx/3rdparty/scintilla/test/XiteMenu.py
new file mode 100644
index 00000000000..b047cf80422
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/XiteMenu.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+from __future__ import unicode_literals
+
+""" Define the menu structure used by the Pentacle applications """
+
+MenuStructure = [
+ ["&File", [
+ ["&New", "<control>N"],
+ ["&Open...", "<control>O"],
+ ["&Save", "<control>S"],
+ ["Save &As...", "<control><shift>S"],
+ ["Test", ""],
+ ["Exercised", ""],
+ ["Uncalled", ""],
+ ["-", ""],
+ ["&Exit", ""]]],
+ [ "&Edit", [
+ ["&Undo", "<control>Z"],
+ ["&Redo", "<control>Y"],
+ ["-", ""],
+ ["Cu&t", "<control>X"],
+ ["&Copy", "<control>C"],
+ ["&Paste", "<control>V"],
+ ["&Delete", "Del"],
+ ["Select &All", "<control>A"],
+ ]],
+]
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/XiteQt.py b/3rdparty/bgfx/3rdparty/scintilla/test/XiteQt.py
new file mode 100644
index 00000000000..48c39e402d0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/XiteQt.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+# Requires Python 2.7 or later
+
+import ctypes, os, sys, unittest
+
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+import ScintillaCallable
+
+sys.path.append("..")
+from bin import ScintillaEditPy
+
+scintillaDirectory = ".."
+scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
+scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
+sys.path.append(scintillaScriptsDirectory)
+import Face
+
+class Form(QDialog):
+
+ def __init__(self, parent=None):
+ super(Form, self).__init__(parent)
+ self.resize(460,300)
+ # Create widget
+ self.edit = ScintillaEditPy.ScintillaEdit(self)
+
+class XiteWin():
+ def __init__(self, test=""):
+ self.face = Face.Face()
+ self.face.ReadFromFile(os.path.join(scintillaIncludeDirectory, "Scintilla.iface"))
+
+ self.test = test
+
+ self.form = Form()
+
+ scifn = self.form.edit.send(int(self.face.features["GetDirectFunction"]["Value"]), 0, 0)
+ sciptr = ctypes.c_char_p(self.form.edit.send(
+ int(self.face.features["GetDirectPointer"]["Value"]), 0,0))
+
+ self.ed = ScintillaCallable.ScintillaCallable(self.face, scifn, sciptr)
+ self.form.show()
+
+ def DoStuff(self):
+ print(self.test)
+ self.CmdTest()
+
+ def DoEvents(self):
+ QApplication.processEvents()
+
+ def CmdTest(self):
+ runner = unittest.TextTestRunner()
+ tests = unittest.defaultTestLoader.loadTestsFromName(self.test)
+ results = runner.run(tests)
+ print(results)
+ sys.exit(0)
+
+xiteFrame = None
+
+def main(test):
+ global xiteFrame
+ app = QApplication(sys.argv)
+ xiteFrame = XiteWin(test)
+ xiteFrame.DoStuff()
+ sys.exit(app.exec_())
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/XiteWin.py b/3rdparty/bgfx/3rdparty/scintilla/test/XiteWin.py
new file mode 100644
index 00000000000..0dd9e4309ca
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/XiteWin.py
@@ -0,0 +1,531 @@
+# -*- coding: utf-8 -*-
+# Requires Python 2.7 or later
+
+from __future__ import with_statement
+from __future__ import unicode_literals
+
+import os, sys, unittest
+
+import ctypes
+from ctypes import wintypes
+from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
+from ctypes.wintypes import HWND, WPARAM, LPARAM, HANDLE, HBRUSH, LPCWSTR
+user32=ctypes.windll.user32
+gdi32=ctypes.windll.gdi32
+kernel32=ctypes.windll.kernel32
+from MessageNumbers import msgs, sgsm
+
+import ScintillaCallable
+import XiteMenu
+
+scintillaDirectory = ".."
+scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
+scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
+sys.path.append(scintillaScriptsDirectory)
+import Face
+
+scintillaBinDirectory = os.path.join(scintillaDirectory, "bin")
+os.environ['PATH'] = os.environ['PATH'] + ";" + scintillaBinDirectory
+#print(os.environ['PATH'])
+
+WFUNC = ctypes.WINFUNCTYPE(c_int, HWND, c_uint, WPARAM, LPARAM)
+
+WS_CHILD = 0x40000000
+WS_CLIPCHILDREN = 0x2000000
+WS_OVERLAPPEDWINDOW = 0xcf0000
+WS_VISIBLE = 0x10000000
+WS_HSCROLL = 0x100000
+WS_VSCROLL = 0x200000
+WA_INACTIVE = 0
+MF_POPUP = 16
+MF_SEPARATOR = 0x800
+IDYES = 6
+OFN_HIDEREADONLY = 4
+MB_OK = 0
+MB_YESNOCANCEL = 3
+MF_CHECKED = 8
+MF_UNCHECKED = 0
+SW_SHOW = 5
+PM_REMOVE = 1
+
+VK_SHIFT = 16
+VK_CONTROL = 17
+VK_MENU = 18
+
+class OPENFILENAME(ctypes.Structure):
+ _fields_ = (("lStructSize", c_int),
+ ("hwndOwner", c_int),
+ ("hInstance", c_int),
+ ("lpstrFilter", c_wchar_p),
+ ("lpstrCustomFilter", c_char_p),
+ ("nMaxCustFilter", c_int),
+ ("nFilterIndex", c_int),
+ ("lpstrFile", c_wchar_p),
+ ("nMaxFile", c_int),
+ ("lpstrFileTitle", c_wchar_p),
+ ("nMaxFileTitle", c_int),
+ ("lpstrInitialDir", c_wchar_p),
+ ("lpstrTitle", c_wchar_p),
+ ("flags", c_int),
+ ("nFileOffset", c_ushort),
+ ("nFileExtension", c_ushort),
+ ("lpstrDefExt", c_char_p),
+ ("lCustData", c_int),
+ ("lpfnHook", c_char_p),
+ ("lpTemplateName", c_char_p),
+ ("pvReserved", c_char_p),
+ ("dwReserved", c_int),
+ ("flagsEx", c_int))
+
+ def __init__(self, win, title):
+ ctypes.Structure.__init__(self)
+ self.lStructSize = ctypes.sizeof(OPENFILENAME)
+ self.nMaxFile = 1024
+ self.hwndOwner = win
+ self.lpstrTitle = title
+ self.Flags = OFN_HIDEREADONLY
+
+trace = False
+#~ trace = True
+
+def WindowSize(w):
+ rc = ctypes.wintypes.RECT()
+ user32.GetClientRect(w, ctypes.byref(rc))
+ return rc.right - rc.left, rc.bottom - rc.top
+
+def IsKeyDown(key):
+ return (user32.GetKeyState(key) & 0x8000) != 0
+
+def KeyTranslate(w):
+ tr = { 9: "Tab", 0xD:"Enter", 0x1B: "Esc" }
+ if w in tr:
+ return tr[w]
+ elif ord("A") <= w <= ord("Z"):
+ return chr(w)
+ elif 0x70 <= w <= 0x7b:
+ return "F" + str(w-0x70+1)
+ else:
+ return "Unknown_" + hex(w)
+
+class WNDCLASS(ctypes.Structure):
+ _fields_= (\
+ ('style', c_int),
+ ('lpfnWndProc', WFUNC),
+ ('cls_extra', c_int),
+ ('wnd_extra', c_int),
+ ('hInst', HANDLE),
+ ('hIcon', HANDLE),
+ ('hCursor', HANDLE),
+ ('hbrBackground', HBRUSH),
+ ('menu_name', LPCWSTR),
+ ('lpzClassName', LPCWSTR),
+ )
+
+hinst = ctypes.windll.kernel32.GetModuleHandleW(0)
+
+def RegisterClass(name, func, background = 0):
+ # register a window class for toplevel windows.
+ wc = WNDCLASS()
+ wc.style = 0
+ wc.lpfnWndProc = func
+ wc.cls_extra = 0
+ wc.wnd_extra = 0
+ wc.hInst = hinst
+ wc.hIcon = 0
+ wc.hCursor = 0
+ wc.hbrBackground = background
+ wc.menu_name = None
+ wc.lpzClassName = name
+ user32.RegisterClassW(ctypes.byref(wc))
+
+
+class XiteWin():
+ def __init__(self, test=""):
+ self.face = Face.Face()
+ self.face.ReadFromFile(os.path.join(scintillaIncludeDirectory, "Scintilla.iface"))
+
+ self.titleDirty = True
+ self.fullPath = ""
+ self.test = test
+
+ self.appName = "xite"
+
+ self.cmds = {}
+ self.windowName = "XiteWindow"
+ self.wfunc = WFUNC(self.WndProc)
+ RegisterClass(self.windowName, self.wfunc)
+ user32.CreateWindowExW(0, self.windowName, self.appName, \
+ WS_VISIBLE | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, \
+ 0, 0, 500, 700, 0, 0, hinst, 0)
+
+ args = sys.argv[1:]
+ self.SetMenus()
+ if args:
+ self.GrabFile(args[0])
+ self.FocusOnEditor()
+ self.ed.GotoPos(self.ed.Length)
+
+ if self.test:
+ print(self.test)
+ for k in self.cmds:
+ if self.cmds[k] == "Test":
+ user32.PostMessageW(self.win, msgs["WM_COMMAND"], k, 0)
+
+ def FocusOnEditor(self):
+ user32.SetFocus(self.sciHwnd)
+
+ def OnSize(self):
+ width, height = WindowSize(self.win)
+ user32.SetWindowPos(self.sciHwnd, 0, 0, 0, width, height, 0)
+ user32.InvalidateRect(self.win, 0, 0)
+
+ def OnCreate(self, hwnd):
+ self.win = hwnd
+ # Side effect: loads the DLL
+ x = ctypes.windll.SciLexer.Scintilla_DirectFunction
+ self.sciHwnd = user32.CreateWindowExW(0,
+ "Scintilla", "Source",
+ WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_CLIPCHILDREN,
+ 0, 0, 100, 100, self.win, 0, hinst, 0)
+ user32.ShowWindow(self.sciHwnd, SW_SHOW)
+ user32.SendMessageW.restype = WPARAM
+ scifn = user32.SendMessageW(self.sciHwnd,
+ int(self.face.features["GetDirectFunction"]["Value"], 0), 0,0)
+ sciptr = c_char_p(user32.SendMessageW(self.sciHwnd,
+ int(self.face.features["GetDirectPointer"]["Value"], 0), 0,0))
+ self.ed = ScintillaCallable.ScintillaCallable(self.face, scifn, sciptr)
+
+ self.FocusOnEditor()
+
+
+ def Invalidate(self):
+ user32.InvalidateRect(self.win, 0, 0)
+
+ def WndProc(self, h, m, w, l):
+ user32.DefWindowProcW.argtypes = [HWND, c_uint, WPARAM, LPARAM]
+ ms = sgsm.get(m, "XXX")
+ if trace:
+ print("%s %s %s %s" % (hex(h)[2:],ms,w,l))
+ if ms == "WM_CLOSE":
+ user32.PostQuitMessage(0)
+ elif ms == "WM_CREATE":
+ self.OnCreate(h)
+ return 0
+ elif ms == "WM_SIZE":
+ # Work out size
+ if w != 1:
+ self.OnSize()
+ return 0
+ elif ms == "WM_COMMAND":
+ cmdCode = w & 0xffff
+ if cmdCode in self.cmds:
+ self.Command(self.cmds[cmdCode])
+ return 0
+ elif ms == "WM_ACTIVATE":
+ if w != WA_INACTIVE:
+ self.FocusOnEditor()
+ return 0
+ else:
+ return user32.DefWindowProcW(h, m, w, l)
+ return 0
+
+ def Command(self, name):
+ name = name.replace(" ", "")
+ method = "Cmd" + name
+ cmd = None
+ try:
+ cmd = getattr(self, method)
+ except AttributeError:
+ return
+ if cmd:
+ cmd()
+
+ def KeyDown(self, w, prefix = ""):
+ keyName = prefix
+ if IsKeyDown(VK_CONTROL):
+ keyName += "<control>"
+ if IsKeyDown(VK_SHIFT):
+ keyName += "<shift>"
+ keyName += KeyTranslate(w)
+ if trace:
+ print("Key:", keyName)
+ if keyName in self.keys:
+ method = "Cmd" + self.keys[keyName]
+ getattr(self, method)()
+ return True
+ #~ print("UKey:", keyName)
+ return False
+
+ def Accelerator(self, msg):
+ ms = sgsm.get(msg.message, "XXX")
+ if ms == "WM_KEYDOWN":
+ return self.KeyDown(msg.wParam)
+ elif ms == "WM_SYSKEYDOWN":
+ return self.KeyDown(msg.wParam, "<alt>")
+ return False
+
+ def AppLoop(self):
+ msg = ctypes.wintypes.MSG()
+ lpmsg = ctypes.byref(msg)
+ while user32.GetMessageW(lpmsg, 0, 0, 0):
+ if trace and msg.message != msgs["WM_TIMER"]:
+ print('mm', hex(msg.hWnd)[2:],sgsm.get(msg.message, "XXX"))
+ if not self.Accelerator(msg):
+ user32.TranslateMessage(lpmsg)
+ user32.DispatchMessageW(lpmsg)
+
+ def DoEvents(self):
+ msg = ctypes.wintypes.MSG()
+ lpmsg = ctypes.byref(msg)
+ cont = True
+ while cont:
+ cont = user32.PeekMessageW(lpmsg, 0, 0, 0, PM_REMOVE)
+ if cont:
+ if not self.Accelerator(msg):
+ user32.TranslateMessage(lpmsg)
+ user32.DispatchMessageW(lpmsg)
+
+ def SetTitle(self, changePath):
+ if changePath or self.titleDirty != self.ed.Modify:
+ self.titleDirty = self.ed.Modify
+ self.title = self.fullPath
+ if self.titleDirty:
+ self.title += " * "
+ else:
+ self.title += " - "
+ self.title += self.appName
+ if self.win:
+ user32.SetWindowTextW(self.win, self.title)
+
+ def Open(self):
+ ofx = OPENFILENAME(self.win, "Open File")
+ opath = "\0" * 1024
+ ofx.lpstrFile = opath
+ filters = ["Python (.py;.pyw)|*.py;*.pyw|All|*.*"]
+ filterText = "\0".join([f.replace("|", "\0") for f in filters])+"\0\0"
+ ofx.lpstrFilter = filterText
+ if ctypes.windll.comdlg32.GetOpenFileNameW(ctypes.byref(ofx)):
+ absPath = opath.replace("\0", "")
+ self.GrabFile(absPath)
+ self.FocusOnEditor()
+ self.ed.LexerLanguage = "python"
+ self.ed.Lexer = self.ed.SCLEX_PYTHON
+ self.ed.SetKeyWords(0, b"class def else for from if import print return while")
+ for style in [k for k in self.ed.k if k.startswith("SCE_P_")]:
+ self.ed.StyleSetFont(self.ed.k[style], b"Verdana")
+ if "COMMENT" in style:
+ self.ed.StyleSetFore(self.ed.k[style], 127 * 256)
+ self.ed.StyleSetFont(self.ed.k[style], b"Comic Sans MS")
+ elif "OPERATOR" in style:
+ self.ed.StyleSetBold(self.ed.k[style], 1)
+ self.ed.StyleSetFore(self.ed.k[style], 127 * 256 * 256)
+ elif "WORD" in style:
+ self.ed.StyleSetItalic(self.ed.k[style], 255)
+ self.ed.StyleSetFore(self.ed.k[style], 255 * 256 * 256)
+ elif "TRIPLE" in style:
+ self.ed.StyleSetFore(self.ed.k[style], 0xA0A0)
+ elif "STRING" in style or "CHARACTER" in style:
+ self.ed.StyleSetFore(self.ed.k[style], 0xA000A0)
+ else:
+ self.ed.StyleSetFore(self.ed.k[style], 0)
+
+ def SaveAs(self):
+ ofx = OPENFILENAME(self.win, "Save File")
+ opath = "\0" * 1024
+ ofx.lpstrFile = opath
+ if ctypes.windll.comdlg32.GetSaveFileNameW(ctypes.byref(ofx)):
+ self.fullPath = opath.replace("\0", "")
+ self.Save()
+ self.SetTitle(1)
+ self.FocusOnEditor()
+
+ def SetMenus(self):
+ ui = XiteMenu.MenuStructure
+ self.cmds = {}
+ self.keys = {}
+
+ cmdId = 0
+ self.menuBar = user32.CreateMenu()
+ for name, contents in ui:
+ cmdId += 1
+ menu = user32.CreateMenu()
+ for item in contents:
+ text, key = item
+ cmdText = text.replace("&", "")
+ cmdText = cmdText.replace("...", "")
+ cmdText = cmdText.replace(" ", "")
+ cmdId += 1
+ if key:
+ keyText = key.replace("<control>", "Ctrl+")
+ keyText = keyText.replace("<shift>", "Shift+")
+ text += "\t" + keyText
+ if text == "-":
+ user32.AppendMenuW(menu, MF_SEPARATOR, cmdId, text)
+ else:
+ user32.AppendMenuW(menu, 0, cmdId, text)
+ self.cmds[cmdId] = cmdText
+ self.keys[key] = cmdText
+ #~ print(cmdId, item)
+ user32.AppendMenuW(self.menuBar, MF_POPUP, menu, name)
+ user32.SetMenu(self.win, self.menuBar)
+ self.CheckMenuItem("Wrap", True)
+ user32.ShowWindow(self.win, SW_SHOW)
+
+ def CheckMenuItem(self, name, val):
+ #~ print(name, val)
+ if self.cmds:
+ for k,v in self.cmds.items():
+ if v == name:
+ #~ print(name, k)
+ user32.CheckMenuItem(user32.GetMenu(self.win), \
+ k, [MF_UNCHECKED, MF_CHECKED][val])
+
+ def Exit(self):
+ sys.exit(0)
+
+ def DisplayMessage(self, msg, ask):
+ return IDYES == user32.MessageBoxW(self.win, \
+ msg, self.appName, [MB_OK, MB_YESNOCANCEL][ask])
+
+ def NewDocument(self):
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.ed.SetSavePoint()
+
+ def SaveIfUnsure(self):
+ if self.ed.Modify:
+ msg = "Save changes to \"" + self.fullPath + "\"?"
+ print(msg)
+ decision = self.DisplayMessage(msg, True)
+ if decision:
+ self.CmdSave()
+ return decision
+ return True
+
+ def New(self):
+ if self.SaveIfUnsure():
+ self.fullPath = ""
+ self.overrideMode = None
+ self.NewDocument()
+ self.SetTitle(1)
+ self.Invalidate()
+
+ def CheckMenus(self):
+ pass
+
+ def MoveSelection(self, caret, anchor=-1):
+ if anchor == -1:
+ anchor = caret
+ self.ed.SetSelectionStart(caret)
+ self.ed.SetSelectionEnd(anchor)
+ self.ed.ScrollCaret()
+ self.Invalidate()
+
+ def GrabFile(self, name):
+ self.fullPath = name
+ self.overrideMode = None
+ self.NewDocument()
+ fsr = open(name, "rb")
+ data = fsr.read()
+ fsr.close()
+ self.ed.AddText(len(data), data)
+ self.ed.EmptyUndoBuffer()
+ self.MoveSelection(0)
+ self.SetTitle(1)
+
+ def Save(self):
+ fos = open(self.fullPath, "wb")
+ blockSize = 1024
+ length = self.ed.Length
+ i = 0
+ while i < length:
+ grabSize = length - i
+ if grabSize > blockSize:
+ grabSize = blockSize
+ #~ print(i, grabSize, length)
+ data = self.ed.ByteRange(i, i + grabSize)
+ fos.write(data)
+ i += grabSize
+ fos.close()
+ self.ed.SetSavePoint()
+ self.SetTitle(0)
+
+ # Command handlers are called by menu actions
+
+ def CmdNew(self):
+ self.New()
+
+ def CmdOpen(self):
+ self.Open()
+
+ def CmdSave(self):
+ if (self.fullPath == None) or (len(self.fullPath) == 0):
+ self.SaveAs()
+ else:
+ self.Save()
+
+ def CmdSaveAs(self):
+ self.SaveAs()
+
+ def CmdTest(self):
+ runner = unittest.TextTestRunner()
+ if self.test:
+ tests = unittest.defaultTestLoader.loadTestsFromName(self.test)
+ else:
+ tests = unittest.defaultTestLoader.loadTestsFromName("simpleTests")
+ results = runner.run(tests)
+ #~ print(results)
+ if self.test:
+ user32.PostQuitMessage(0)
+
+ def CmdExercised(self):
+ print()
+ unused = sorted(self.ed.all.difference(self.ed.used))
+ print("Unused", len(unused))
+ print()
+ print("\n".join(unused))
+ print()
+ print("Used", len(self.ed.used))
+ print()
+ print("\n".join(sorted(self.ed.used)))
+
+ def Uncalled(self):
+ print("")
+ unused = sorted(self.ed.all.difference(self.ed.used))
+ uu = {}
+ for u in unused:
+ v = self.ed.getvalue(u)
+ if v > 2000:
+ uu[v] = u
+ #~ for x in sorted(uu.keys())[150:]:
+ return uu
+
+ def CmdExit(self):
+ self.Exit()
+
+ def CmdUndo(self):
+ self.ed.Undo()
+
+ def CmdRedo(self):
+ self.ed.Redo()
+
+ def CmdCut(self):
+ self.ed.Cut()
+
+ def CmdCopy(self):
+ self.ed.Copy()
+
+ def CmdPaste(self):
+ self.ed.Paste()
+
+ def CmdDelete(self):
+ self.ed.Clear()
+
+xiteFrame = None
+
+def main(test):
+ global xiteFrame
+ xiteFrame = XiteWin(test)
+ xiteFrame.AppLoop()
+ #~ xiteFrame.CmdExercised()
+ return xiteFrame.Uncalled()
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp
new file mode 100644
index 00000000000..a78acdc3469
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp
@@ -0,0 +1,12 @@
+<%@language=javas%>
+<%
+#include
+function x() {
+}
+%>
+<%@language=vbscript%>
+<%
+sub x 'comment
+%>
+<head>
+<body></body>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp.styled
new file mode 100644
index 00000000000..920c6380d24
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.asp.styled
@@ -0,0 +1,12 @@
+{15}<%@{16}language=javas{15}%>{0}
+{15}<%{56}
+#{61}include{56}
+{62}function{56} {61}x{65}(){56} {65}{{56}
+{65}}{56}
+{15}%>{0}
+{15}<%@{16}language=vbscript{15}%>{0}
+{15}<%{81}
+{84}sub{81} {86}x{81} {82}'comment {81}
+{15}%>{0}
+{1}<head>{0}
+{1}<body></body>{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx
new file mode 100644
index 00000000000..38499707295
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx
@@ -0,0 +1,16 @@
+// A demonstration program
+#include <stdio.h>
+#if 0 /* */
+#define DUMMY() \
+ if (1);
+#endif
+
+#define M\
+
+\
+
+int main() {
+ double x[] = {3.14159,6.02e23,1.6e-19,1.0+1};
+ int y[] = {75,0113,0x4b};
+ printf("hello world %d %g\n", y[0], x[0]);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx.styled
new file mode 100644
index 00000000000..b602717a51d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.cxx.styled
@@ -0,0 +1,16 @@
+{2}// A demonstration program
+{9}#include <stdio.h>
+#if 0 {23}/* */{9}
+{73}#define DUMMY() \
+ if (1);
+{9}#endif
+{0}
+{9}#define M\
+
+{0}\
+
+{5}int{0} {11}main{10}(){0} {10}{{0}
+ {11}double{0} {11}x{10}[]{0} {10}={0} {10}{{4}3.14159{10},{4}6.02e23{10},{4}1.6e-19{10},{4}1.0{10}+{4}1{10}};{0}
+ {5}int{0} {11}y{10}[]{0} {10}={0} {10}{{4}75{10},{4}0113{10},{4}0x4b{10}};{0}
+ {11}printf{10}({6}"hello world %d %g\n"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0}
+{10}}{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d
new file mode 100644
index 00000000000..617aa38a129
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d
@@ -0,0 +1,47 @@
+$
+// /++ +/ doccomments are not yet supported
+/* */
+/** */
+/// drdr
+/+ /+ +/ +/
+//keyword test
+keyword1
+keyword2
+keyword4
+keyword5
+keyword6
+keyword7
+//unicode identifier test
+вапёasdÓΘΣαԷԸՑהכ拉麺ã¨ã²ã‚·ãƒžã‚¤ë‹¨ê²°ì„
+//strings test
+'s
+'
+w's'w
+"multiline
+ string"w
+e"zz"e
+r"asd\"e
+r"multiline
+ string"c
+r`asd\`e
+`multiline
+ string`d
+x"023 abc"e
+x"023
+ abc"w
+//numbers test
+a[3..4]=3
+2.stringof
+2.0.stringof
+2.
+2.2e+2
+2.2e-2
+.2e+2
+.2
+2e+2
+0x2e+2
+0x2ep+10
+,.2.stringof,
+
+end
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d.styled
new file mode 100644
index 00000000000..32e4556dd20
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.d.styled
@@ -0,0 +1,47 @@
+{14}${0}
+{2}// /++ +/ doccomments are not yet supported
+{1}/* */{0}
+{3}/** */{0}
+{15}/// drdr
+{4}/+ /+ +/ +/{0}
+{2}//keyword test
+{6}keyword1{0}
+{7}keyword2{0}
+{9}keyword4{0}
+{20}keyword5{0}
+{21}keyword6{0}
+{22}keyword7{0}
+{2}//unicode identifier test
+{14}вапёasdÓΘΣαԷԸՑהכ拉麺ã¨ã²ã‚·ãƒžã‚¤ë‹¨ê²°ì„{0}
+{2}//strings test
+{11}'s
+'
+{14}w{12}'s'{14}w{0}
+{10}"multiline
+ string"w{0}
+{14}e{10}"zz"{14}e{0}
+{19}r"asd\"{14}e{0}
+{19}r"multiline
+ string"c{0}
+{14}r{18}`asd\`{14}e{0}
+{18}`multiline
+ string`d{0}
+{19}x"023 abc"{14}e{0}
+{19}x"023
+ abc"w{0}
+{2}//numbers test
+{14}a{13}[{5}3{13}..{5}4{13}]={5}3{0}
+{5}2.stringof{0}
+{5}2.0{13}.{14}stringof{0}
+{5}2.{0}
+{5}2.2e+2{0}
+{5}2.2e-2{0}
+{5}.2e+2{0}
+{5}.2{0}
+{5}2e+2{0}
+{5}0x2e{13}+{5}2{0}
+{5}0x2ep+10{0}
+{13},{5}.2{13}.{14}stringof{13},{0}
+
+{14}end{0}
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html
new file mode 100644
index 00000000000..caebcf41aee
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<script type="text/javascript">
+var b = /abc/i.test('abc');
+'x\
+</t>'
+</script>
+<head>
+ <meta name="Date.Modified" content="20010515" />
+ <title>SinkWorld - Portability</title>
+ <unknown>SinkWorld - Portability</unknown>
+ <link rel="stylesheet" type="text/css" href="SW.css">
+</head>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html.styled
new file mode 100644
index 00000000000..3e50a11470d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.html.styled
@@ -0,0 +1,12 @@
+{1}<html{8} {3}xmlns{8}={6}"http://www.w3.org/1999/xhtml"{1}>{0}
+{1}<script{8} {3}type{8}={6}"text/javascript"{1}>{40}
+{46}var{41} {46}b{41} {50}={41} {52}/abc/i{46}.test{50}({49}'abc'{50});{41}
+{49}'x\
+</t>'{41}
+{1}</script>{0}
+{1}<head>{0}
+ {1}<meta{8} {3}name{8}={6}"Date.Modified"{8} {3}content{8}={6}"20010515"{8} {11}/>{0}
+ {1}<title>{0}SinkWorld - Portability{1}</title>{0}
+ {2}<unknown>{0}SinkWorld - Portability{2}</unknown>{0}
+ {1}<link{8} {3}rel{8}={6}"stylesheet"{8} {3}type{8}={6}"text/css"{8} {3}href{8}={6}"SW.css"{1}>{0}
+{1}</head>{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua
new file mode 100644
index 00000000000..cfa3537b5ea
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua
@@ -0,0 +1,7 @@
+--[[ coding:UTF-8
+comment ]]
+function first()
+::é–‹::
+ -- Comment
+ func(SCI_ANNOTATIONSETTEXT, 'a', 0, "LINE1")
+end
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua.styled
new file mode 100644
index 00000000000..0c8f76fa44f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.lua.styled
@@ -0,0 +1,7 @@
+{1}--[[ coding:UTF-8
+comment ]]{0}
+{5}function{0} {11}first{10}(){0}
+{20}::é–‹::{0}
+ {2}-- Comment
+{0} {11}func{10}({11}SCI_ANNOTATIONSETTEXT{10},{0} {7}'a'{10},{0} {4}0{10},{0} {6}"LINE1"{10}){0}
+{5}end{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php
new file mode 100644
index 00000000000..bc7302d852d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php
@@ -0,0 +1,6 @@
+<head> <!-- About to script -->
+<?php
+echo "<!-- -->\n";
+/* ?> */
+?>
+<strong>for</strong><b>if</b>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php.styled
new file mode 100644
index 00000000000..fb90ba06ed6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.php.styled
@@ -0,0 +1,6 @@
+{1}<head>{0} {9}<!-- About to script -->{0}
+{18}<?php{118}
+echo {119}"<!-- -->\n"{127};{118}
+{124}/* ?> */{118}
+{18}?>{0}
+{1}<strong>{0}for{1}</strong><b>{0}if{1}</b>{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl
new file mode 100644
index 00000000000..19288f2c93f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl
@@ -0,0 +1,5 @@
+use strict;
+while ( $r ) {
+ printf ( "Example text \n" );
+ sleep 1;
+} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl.styled
new file mode 100644
index 00000000000..74da4e91127
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.pl.styled
@@ -0,0 +1,5 @@
+{5}use{0} {11}strict{10};{0}
+{5}while{0} {10}({0} {12}$r{0} {10}){0} {10}{{0}
+ {5}printf{0} {10}({0} {6}"Example text \n"{0} {10});{0}
+ {5}sleep{0} {4}1{10};{0}
+{10}} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py
new file mode 100644
index 00000000000..12c4b71dfba
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py
@@ -0,0 +1,11 @@
+# Convert all punctuation characters except '_', '*', and '.' into spaces.
+def depunctuate(s):
+ '''A docstring'''
+ """Docstring 2"""
+ d = ""
+ for ch in s:
+ if ch in 'abcde':
+ d = d + ch
+ else:
+ d = d + " "
+ return d
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py.styled
new file mode 100644
index 00000000000..02f94a92386
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.py.styled
@@ -0,0 +1,11 @@
+{1}# Convert all punctuation characters except '_', '*', and '.' into spaces.{0}
+{5}def{0} {9}depunctuate{10}({11}s{10}):{0}
+ {6}'''A docstring'''{0}
+ {7}"""Docstring 2"""{0}
+ {11}d{0} {10}={0} {3}""{0}
+ {5}for{0} {11}ch{0} {5}in{0} {11}s{10}:{0}
+ {5}if{0} {11}ch{0} {5}in{0} {4}'abcde'{10}:{0}
+ {11}d{0} {10}={0} {11}d{0} {10}+{0} {11}ch{0}
+ {5}else{10}:{0}
+ {11}d{0} {10}={0} {11}d{0} {10}+{0} {3}" "{0}
+ {5}return{0} {11}d{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb
new file mode 100644
index 00000000000..d1bb0f0a8ed
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb
@@ -0,0 +1,6 @@
+class Demo
+ def test # A test
+ i = 1
+ puts "Example"
+ end
+end \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb.styled
new file mode 100644
index 00000000000..904d07dd3be
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.rb.styled
@@ -0,0 +1,6 @@
+{5}class{0} {8}Demo{0}
+ {5}def{0} {9}test{0} {2}# A test{0}
+ {11}i{0} {10}={0} {4}1{0}
+ {11}puts{0} {6}"Example"{0}
+ {5}end{0}
+{5}end \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb
new file mode 100644
index 00000000000..a4503704bdd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb
@@ -0,0 +1,9 @@
+' String"
+Dim a As String = "hello, world"
+Dim b As String = "hello world"
+Dim c As String = "Joe said ""Hello"" to me"
+Dim d As String = "\\\\server\\share\\file.txt"
+' Character
+""C "c"C "cc"C
+' Date
+d = #5/31/1993# or # 01/01/0001 12:00:00AM #
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb.styled b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb.styled
new file mode 100644
index 00000000000..e0c86f9181f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/examples/x.vb.styled
@@ -0,0 +1,9 @@
+{1}' String"
+{3}Dim{0} {7}a{0} {3}As{0} {3}String{0} {6}={0} {4}"hello, world"{0}
+{3}Dim{0} {7}b{0} {3}As{0} {3}String{0} {6}={0} {4}"hello world"{0}
+{3}Dim{0} {7}c{0} {3}As{0} {3}String{0} {6}={0} {4}"Joe said ""Hello"" to me"{0}
+{3}Dim{0} {7}d{0} {3}As{0} {3}String{0} {6}={0} {4}"\\\\server\\share\\file.txt"{0}
+{1}' Character
+{4}""C{0} {4}"c"C{0} {4}"cc"C{0}
+{1}' Date
+{7}d{0} {6}={0} {8}#5/31/1993#{0} {3}or{0} {8}# 01/01/0001 12:00:00AM #{0}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/lexTests.py b/3rdparty/bgfx/3rdparty/scintilla/test/lexTests.py
new file mode 100644
index 00000000000..a53db7eb86c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/lexTests.py
@@ -0,0 +1,126 @@
+# -*- coding: utf-8 -*-
+# Requires Python 2.7 or later
+
+import io, os, sys, unittest
+
+if sys.platform == "win32":
+ import XiteWin as Xite
+else:
+ import XiteQt as Xite
+
+keywordsHTML = [
+b"b body content head href html link meta "
+ b"name rel script strong title type xmlns",
+b"function",
+b"sub"
+]
+
+class TestLexers(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def AsStyled(self):
+ text = self.ed.Contents()
+ data = io.BytesIO()
+ prevStyle = -1
+ for o in range(self.ed.Length):
+ styleNow = self.ed.GetStyleAt(o)
+ if styleNow != prevStyle:
+ styleBuf = "{%0d}" % styleNow
+ data.write(styleBuf.encode('utf-8'))
+ prevStyle = styleNow
+ data.write(text[o:o+1])
+ return data.getvalue()
+
+ def LexExample(self, name, lexerName, keywords=None):
+ if keywords is None:
+ keywords = []
+ self.ed.SetCodePage(65001)
+ self.ed.LexerLanguage = lexerName
+ bits = self.ed.StyleBitsNeeded
+ mask = 2 << bits - 1
+ self.ed.StyleBits = bits
+ for i in range(len(keywords)):
+ self.ed.SetKeyWords(i, keywords[i])
+
+ nameExample = os.path.join("examples", name)
+ namePrevious = nameExample +".styled"
+ nameNew = nameExample +".new"
+ with open(nameExample, "rb") as f:
+ prog = f.read()
+ BOM = b"\xEF\xBB\xBF"
+ if prog.startswith(BOM):
+ prog = prog[len(BOM):]
+ lenDocument = len(prog)
+ self.ed.AddText(lenDocument, prog)
+ self.ed.Colourise(0, lenDocument)
+ self.assertEquals(self.ed.EndStyled, lenDocument)
+ try:
+ with open(namePrevious, "rb") as f:
+ prevStyled = f.read()
+ except FileNotFoundError:
+ prevStyled = ""
+ progStyled = self.AsStyled()
+ if progStyled != prevStyled:
+ with open(nameNew, "wb") as f:
+ f.write(progStyled)
+ print(progStyled)
+ print(prevStyled)
+ self.assertEquals(progStyled, prevStyled)
+ # The whole file doesn't parse like it did before so don't try line by line
+ # as that is likely to fail many times.
+ return
+
+ # Try partial lexes from the start of every line which should all be identical.
+ for line in range(self.ed.LineCount):
+ lineStart = self.ed.PositionFromLine(line)
+ self.ed.StartStyling(lineStart, mask)
+ self.assertEquals(self.ed.EndStyled, lineStart)
+ self.ed.Colourise(lineStart, lenDocument)
+ progStyled = self.AsStyled()
+ if progStyled != prevStyled:
+ with open(nameNew, "wb") as f:
+ f.write(progStyled)
+ self.assertEquals(progStyled, prevStyled)
+ # Give up after one failure
+ return
+
+ def testCXX(self):
+ self.LexExample("x.cxx", b"cpp", [b"int"])
+
+ def testPython(self):
+ self.LexExample("x.py", b"python",
+ [b"class def else for if import in print return while"])
+
+ def testHTML(self):
+ self.LexExample("x.html", b"hypertext", keywordsHTML)
+
+ def testASP(self):
+ self.LexExample("x.asp", b"hypertext", keywordsHTML)
+
+ def testPHP(self):
+ self.LexExample("x.php", b"hypertext", keywordsHTML)
+
+ def testVB(self):
+ self.LexExample("x.vb", b"vb", [b"as dim or string"])
+
+ def testLua(self):
+ self.LexExample("x.lua", b"lua", [b"function end"])
+
+ def testRuby(self):
+ self.LexExample("x.rb", b"ruby", [b"class def end"])
+
+ def testPerl(self):
+ self.LexExample("x.pl", b"perl", [b"printf sleep use while"])
+
+ def testD(self):
+ self.LexExample("x.d", b"d",
+ [b"keyword1", b"keyword2", b"", b"keyword4", b"keyword5",
+ b"keyword6", b"keyword7"])
+
+if __name__ == '__main__':
+ Xite.main("lexTests")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/performanceTests.py b/3rdparty/bgfx/3rdparty/scintilla/test/performanceTests.py
new file mode 100644
index 00000000000..5784ca0a512
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/performanceTests.py
@@ -0,0 +1,125 @@
+# -*- coding: utf-8 -*-
+
+from __future__ import with_statement
+from __future__ import unicode_literals
+
+import os, string, sys, time, unittest
+
+if sys.platform == "win32":
+ import XiteWin as Xite
+else:
+ import XiteQt as Xite
+
+class TestPerformance(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testAddLine(self):
+ data = (string.ascii_letters + string.digits + "\n").encode('utf-8')
+ start = time.time()
+ for i in range(1000):
+ self.ed.AddText(len(data), data)
+ self.assertEquals(self.ed.LineCount, i + 2)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testAddLine" % duration)
+ self.xite.DoEvents()
+ self.assert_(self.ed.Length > 0)
+
+ def testAddLineMiddle(self):
+ data = (string.ascii_letters + string.digits + "\n").encode('utf-8')
+ start = time.time()
+ for i in range(1000):
+ self.ed.AddText(len(data), data)
+ self.assertEquals(self.ed.LineCount, i + 2)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testAddLineMiddle" % duration)
+ self.xite.DoEvents()
+ self.assert_(self.ed.Length > 0)
+
+ def testHuge(self):
+ data = (string.ascii_letters + string.digits + "\n").encode('utf-8')
+ data = data * 100000
+ start = time.time()
+ self.ed.AddText(len(data), data)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testHuge" % duration)
+ self.xite.DoEvents()
+ self.assert_(self.ed.Length > 0)
+
+ def testHugeInserts(self):
+ data = (string.ascii_letters + string.digits + "\n").encode('utf-8')
+ data = data * 100000
+ insert = (string.digits + "\n").encode('utf-8')
+ self.ed.AddText(len(data), data)
+ start = time.time()
+ for i in range(1000):
+ self.ed.InsertText(0, insert)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testHugeInserts" % duration)
+ self.xite.DoEvents()
+ self.assert_(self.ed.Length > 0)
+
+ def testHugeReplace(self):
+ oneLine = (string.ascii_letters + string.digits + "\n").encode('utf-8')
+ data = oneLine * 100000
+ insert = (string.digits + "\n").encode('utf-8')
+ self.ed.AddText(len(data), data)
+ start = time.time()
+ for i in range(1000):
+ self.ed.TargetStart = i * len(insert)
+ self.ed.TargetEnd = self.ed.TargetStart + len(oneLine)
+ self.ed.ReplaceTarget(len(insert), insert)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testHugeReplace" % duration)
+ self.xite.DoEvents()
+ self.assert_(self.ed.Length > 0)
+
+ def testUTF8CaseSearches(self):
+ self.ed.SetCodePage(65001)
+ oneLine = "Fold Margin=折りãŸãŸã¿è¡¨ç¤ºç”¨ã®ä½™ç™½(&F)\n".encode('utf-8')
+ manyLines = oneLine * 100000
+ manyLines = manyLines + "φ\n".encode('utf-8')
+ self.ed.AddText(len(manyLines), manyLines)
+ searchString = "φ".encode('utf-8')
+ start = time.time()
+ for i in range(10):
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = self.ed.SCFIND_MATCHCASE
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assert_(pos > 0)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testUTF8CaseSearches" % duration)
+ self.xite.DoEvents()
+
+ def testUTF8Searches(self):
+ self.ed.SetCodePage(65001)
+ oneLine = "Fold Margin=折りãŸãŸã¿è¡¨ç¤ºç”¨ã®ä½™ç™½(&F)\n".encode('utf-8')
+ manyLines = oneLine * 100000
+ manyLines = manyLines + "φ\n".encode('utf-8')
+ self.ed.AddText(len(manyLines), manyLines)
+ searchString = "φ".encode('utf-8')
+ start = time.time()
+ for i in range(10):
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assert_(pos > 0)
+ end = time.time()
+ duration = end - start
+ print("%6.3f testUTF8Searches" % duration)
+ self.xite.DoEvents()
+
+if __name__ == '__main__':
+ Xite.main("performanceTests")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/simpleTests.py b/3rdparty/bgfx/3rdparty/scintilla/test/simpleTests.py
new file mode 100644
index 00000000000..4e8462c7100
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/simpleTests.py
@@ -0,0 +1,2120 @@
+# -*- coding: utf-8 -*-
+# Requires Python 2.7 or later
+
+from __future__ import with_statement
+from __future__ import unicode_literals
+
+import codecs, ctypes, os, sys, unittest
+
+if sys.platform == "win32":
+ import XiteWin as Xite
+else:
+ import XiteQt as Xite
+
+class TestSimple(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testLength(self):
+ self.assertEquals(self.ed.Length, 0)
+
+ def testAddText(self):
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(self.ed.GetCharAt(0), ord("x"))
+ self.assertEquals(self.ed.GetStyleAt(0), 0)
+ self.ed.ClearAll()
+ self.assertEquals(self.ed.Length, 0)
+
+ def testDeleteRange(self):
+ self.ed.AddText(5, b"abcde")
+ self.assertEquals(self.ed.Length, 5)
+ self.ed.DeleteRange(1, 2)
+ self.assertEquals(self.ed.Length, 3)
+ self.assertEquals(self.ed.Contents(), b"ade")
+
+ def testAddStyledText(self):
+ self.assertEquals(self.ed.EndStyled, 0)
+ self.ed.AddStyledText(2, b"x\002")
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(self.ed.GetCharAt(0), ord("x"))
+ self.assertEquals(self.ed.GetStyleAt(0), 2)
+ self.assertEquals(self.ed.StyledTextRange(0, 1), b"x\002")
+ self.ed.ClearDocumentStyle()
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(self.ed.GetCharAt(0), ord("x"))
+ self.assertEquals(self.ed.GetStyleAt(0), 0)
+ self.assertEquals(self.ed.StyledTextRange(0, 1), b"x\0")
+
+ def testStyling(self):
+ self.assertEquals(self.ed.EndStyled, 0)
+ self.ed.AddStyledText(4, b"x\002y\003")
+ self.assertEquals(self.ed.StyledTextRange(0, 2), b"x\002y\003")
+ self.ed.StartStyling(0,0xf)
+ self.ed.SetStyling(1, 5)
+ self.assertEquals(self.ed.StyledTextRange(0, 2), b"x\005y\003")
+
+ self.ed.StartStyling(0,0xff)
+ self.ed.SetStylingEx(2, b"\100\101")
+ self.assertEquals(self.ed.StyledTextRange(0, 2), b"x\100y\101")
+
+ def testPosition(self):
+ self.assertEquals(self.ed.CurrentPos, 0)
+ self.assertEquals(self.ed.Anchor, 0)
+ self.ed.AddText(1, b"x")
+ # Caret has automatically moved
+ self.assertEquals(self.ed.CurrentPos, 1)
+ self.assertEquals(self.ed.Anchor, 1)
+ self.ed.SelectAll()
+ self.assertEquals(self.ed.CurrentPos, 0)
+ self.assertEquals(self.ed.Anchor, 1)
+ self.ed.Anchor = 0
+ self.assertEquals(self.ed.Anchor, 0)
+ # Check line positions
+ self.assertEquals(self.ed.PositionFromLine(0), 0)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 1)
+ self.assertEquals(self.ed.PositionFromLine(1), 1)
+
+ self.ed.CurrentPos = 1
+ self.assertEquals(self.ed.Anchor, 0)
+ self.assertEquals(self.ed.CurrentPos, 1)
+
+ def testBeyonEnd(self):
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.GetLineEndPosition(0), 1)
+ self.assertEquals(self.ed.GetLineEndPosition(1), 1)
+ self.assertEquals(self.ed.GetLineEndPosition(2), 1)
+
+ def testSelection(self):
+ self.assertEquals(self.ed.CurrentPos, 0)
+ self.assertEquals(self.ed.Anchor, 0)
+ self.assertEquals(self.ed.SelectionStart, 0)
+ self.assertEquals(self.ed.SelectionEnd, 0)
+ self.ed.AddText(1, b"x")
+ self.ed.SelectionStart = 0
+ self.assertEquals(self.ed.CurrentPos, 1)
+ self.assertEquals(self.ed.Anchor, 0)
+ self.assertEquals(self.ed.SelectionStart, 0)
+ self.assertEquals(self.ed.SelectionEnd, 1)
+ self.ed.SelectionStart = 1
+ self.assertEquals(self.ed.CurrentPos, 1)
+ self.assertEquals(self.ed.Anchor, 1)
+ self.assertEquals(self.ed.SelectionStart, 1)
+ self.assertEquals(self.ed.SelectionEnd, 1)
+
+ self.ed.SelectionEnd = 0
+ self.assertEquals(self.ed.CurrentPos, 0)
+ self.assertEquals(self.ed.Anchor, 0)
+
+ def testSetSelection(self):
+ self.ed.AddText(4, b"abcd")
+ self.ed.SetSel(1, 3)
+ self.assertEquals(self.ed.SelectionStart, 1)
+ self.assertEquals(self.ed.SelectionEnd, 3)
+ result = self.ed.GetSelText(0)
+ self.assertEquals(result, b"bc\0")
+ self.ed.ReplaceSel(0, b"1234")
+ self.assertEquals(self.ed.Length, 6)
+ self.assertEquals(self.ed.Contents(), b"a1234d")
+
+ def testReadOnly(self):
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.ReadOnly, 0)
+ self.assertEquals(self.ed.Contents(), b"x")
+ self.ed.ReadOnly = 1
+ self.assertEquals(self.ed.ReadOnly, 1)
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.Contents(), b"x")
+ self.ed.ReadOnly = 0
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.Contents(), b"xx")
+ self.ed.Null()
+ self.assertEquals(self.ed.Contents(), b"xx")
+
+ def testAddLine(self):
+ data = b"x" * 70 + b"\n"
+ for i in range(5):
+ self.ed.AddText(len(data), data)
+ self.assertEquals(self.ed.LineCount, i + 2)
+ self.assert_(self.ed.Length > 0)
+
+ def testInsertText(self):
+ data = b"xy"
+ self.ed.InsertText(0, data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(data, self.ed.ByteRange(0,2))
+
+ self.ed.InsertText(1, data)
+ # Should now be "xxyy"
+ self.assertEquals(self.ed.Length, 4)
+ self.assertEquals(b"xxyy", self.ed.ByteRange(0,4))
+
+ def testInsertNul(self):
+ data = b"\0"
+ self.ed.AddText(1, data)
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(data, self.ed.ByteRange(0,1))
+
+ def testUndoRedo(self):
+ data = b"xy"
+ self.assertEquals(self.ed.Modify, 0)
+ self.assertEquals(self.ed.UndoCollection, 1)
+ self.assertEquals(self.ed.CanRedo(), 0)
+ self.assertEquals(self.ed.CanUndo(), 0)
+ self.ed.InsertText(0, data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.ed.Modify, 1)
+ self.assertEquals(self.ed.CanRedo(), 0)
+ self.assertEquals(self.ed.CanUndo(), 1)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.ed.Modify, 0)
+ self.assertEquals(self.ed.CanRedo(), 1)
+ self.assertEquals(self.ed.CanUndo(), 0)
+ self.ed.Redo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.ed.Modify, 1)
+ self.assertEquals(data, self.ed.Contents())
+ self.assertEquals(self.ed.CanRedo(), 0)
+ self.assertEquals(self.ed.CanUndo(), 1)
+
+ def testUndoSavePoint(self):
+ data = b"xy"
+ self.assertEquals(self.ed.Modify, 0)
+ self.ed.InsertText(0, data)
+ self.assertEquals(self.ed.Modify, 1)
+ self.ed.SetSavePoint()
+ self.assertEquals(self.ed.Modify, 0)
+ self.ed.InsertText(0, data)
+ self.assertEquals(self.ed.Modify, 1)
+
+ def testUndoCollection(self):
+ data = b"xy"
+ self.assertEquals(self.ed.UndoCollection, 1)
+ self.ed.UndoCollection = 0
+ self.assertEquals(self.ed.UndoCollection, 0)
+ self.ed.InsertText(0, data)
+ self.assertEquals(self.ed.CanRedo(), 0)
+ self.assertEquals(self.ed.CanUndo(), 0)
+ self.ed.UndoCollection = 1
+
+ def testGetColumn(self):
+ self.ed.AddText(1, b"x")
+ self.assertEquals(self.ed.GetColumn(0), 0)
+ self.assertEquals(self.ed.GetColumn(1), 1)
+ # Next line caused infinite loop in 1.71
+ self.assertEquals(self.ed.GetColumn(2), 1)
+ self.assertEquals(self.ed.GetColumn(3), 1)
+
+ def testTabWidth(self):
+ self.assertEquals(self.ed.TabWidth, 8)
+ self.ed.AddText(3, b"x\tb")
+ self.assertEquals(self.ed.GetColumn(0), 0)
+ self.assertEquals(self.ed.GetColumn(1), 1)
+ self.assertEquals(self.ed.GetColumn(2), 8)
+ for col in range(10):
+ if col == 0:
+ self.assertEquals(self.ed.FindColumn(0, col), 0)
+ elif col == 1:
+ self.assertEquals(self.ed.FindColumn(0, col), 1)
+ elif col == 8:
+ self.assertEquals(self.ed.FindColumn(0, col), 2)
+ elif col == 9:
+ self.assertEquals(self.ed.FindColumn(0, col), 3)
+ else:
+ self.assertEquals(self.ed.FindColumn(0, col), 1)
+ self.ed.TabWidth = 4
+ self.assertEquals(self.ed.TabWidth, 4)
+ self.assertEquals(self.ed.GetColumn(0), 0)
+ self.assertEquals(self.ed.GetColumn(1), 1)
+ self.assertEquals(self.ed.GetColumn(2), 4)
+
+ def testIndent(self):
+ self.assertEquals(self.ed.Indent, 0)
+ self.assertEquals(self.ed.UseTabs, 1)
+ self.ed.Indent = 8
+ self.ed.UseTabs = 0
+ self.assertEquals(self.ed.Indent, 8)
+ self.assertEquals(self.ed.UseTabs, 0)
+ self.ed.AddText(3, b"x\tb")
+ self.assertEquals(self.ed.GetLineIndentation(0), 0)
+ self.ed.InsertText(0, b" ")
+ self.assertEquals(self.ed.GetLineIndentation(0), 1)
+ self.assertEquals(self.ed.GetLineIndentPosition(0), 1)
+ self.assertEquals(self.ed.Contents(), b" x\tb")
+ self.ed.SetLineIndentation(0,2)
+ self.assertEquals(self.ed.Contents(), b" x\tb")
+ self.assertEquals(self.ed.GetLineIndentPosition(0), 2)
+ self.ed.UseTabs = 1
+ self.ed.SetLineIndentation(0,8)
+ self.assertEquals(self.ed.Contents(), b"\tx\tb")
+ self.assertEquals(self.ed.GetLineIndentPosition(0), 1)
+
+ def testGetCurLine(self):
+ self.ed.AddText(1, b"x")
+ data = ctypes.create_string_buffer(b"\0" * 100)
+ caret = self.ed.GetCurLine(len(data), data)
+ self.assertEquals(caret, 1)
+ self.assertEquals(data.value, b"x")
+
+ def testGetLine(self):
+ self.ed.AddText(1, b"x")
+ data = ctypes.create_string_buffer(b"\0" * 100)
+ self.ed.GetLine(0, data)
+ self.assertEquals(data.value, b"x")
+
+ def testLineEnds(self):
+ self.ed.AddText(3, b"x\ny")
+ self.assertEquals(self.ed.GetLineEndPosition(0), 1)
+ self.assertEquals(self.ed.GetLineEndPosition(1), 3)
+ self.assertEquals(self.ed.LineLength(0), 2)
+ self.assertEquals(self.ed.LineLength(1), 1)
+ if sys.platform == "win32":
+ self.assertEquals(self.ed.EOLMode, self.ed.SC_EOL_CRLF)
+ else:
+ self.assertEquals(self.ed.EOLMode, self.ed.SC_EOL_LF)
+ lineEnds = [b"\r\n", b"\r", b"\n"]
+ for lineEndType in [self.ed.SC_EOL_CR, self.ed.SC_EOL_LF, self.ed.SC_EOL_CRLF]:
+ self.ed.EOLMode = lineEndType
+ self.assertEquals(self.ed.EOLMode, lineEndType)
+ self.ed.ConvertEOLs(lineEndType)
+ self.assertEquals(self.ed.Contents(), b"x" + lineEnds[lineEndType] + b"y")
+ self.assertEquals(self.ed.LineLength(0), 1 + len(lineEnds[lineEndType]))
+
+ # Several tests for unicode line ends U+2028 and U+2029
+
+ def testUnicodeLineEnds(self):
+ # Add two lines separated with U+2028 and ensure it is seen as two lines
+ # Then remove U+2028 and should be just 1 lines
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ self.ed.AddText(5, b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 2)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 1)
+ self.assertEquals(self.ed.GetLineEndPosition(1), 5)
+ self.assertEquals(self.ed.LineLength(0), 4)
+ self.assertEquals(self.ed.LineLength(1), 1)
+ self.ed.TargetStart = 1
+ self.ed.TargetEnd = 4
+ self.ed.ReplaceTarget(0, b"")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.assertEquals(self.ed.LineLength(0), 2)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 2)
+ self.assertEquals(self.ed.LineEndTypesSupported, 1)
+
+ def testUnicodeLineEndsWithCodePage0(self):
+ # Try the Unicode line ends when not in Unicode mode -> should remain 1 line
+ self.ed.SetCodePage(0)
+ self.ed.AddText(5, b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.ed.AddText(4, b"x\xc2\x85y")
+ self.assertEquals(self.ed.LineCount, 1)
+
+ def testUnicodeLineEndsSwitchToUnicodeAndBack(self):
+ # Add the Unicode line ends when not in Unicode mode
+ self.ed.SetCodePage(0)
+ self.ed.AddText(5, b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 1)
+ # Into UTF-8 mode - should now be interpreting as two lines
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ self.assertEquals(self.ed.LineCount, 2)
+ # Back to code page 0 and 1 line
+ self.ed.SetCodePage(0)
+ self.assertEquals(self.ed.LineCount, 1)
+
+ def testUFragmentedEOLCompletion(self):
+ # Add 2 starting bytes of UTF-8 line end then complete it
+ self.ed.ClearAll()
+ self.ed.AddText(4, b"x\xe2\x80y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 4)
+ self.ed.SetSel(3,3)
+ self.ed.AddText(1, b"\xa8")
+ self.assertEquals(self.ed.Contents(), b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 2)
+
+ # Add 1 starting bytes of UTF-8 line end then complete it
+ self.ed.ClearAll()
+ self.ed.AddText(3, b"x\xe2y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 3)
+ self.ed.SetSel(2,2)
+ self.ed.AddText(2, b"\x80\xa8")
+ self.assertEquals(self.ed.Contents(), b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testUFragmentedEOLStart(self):
+ # Add end of UTF-8 line end then insert start
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ self.assertEquals(self.ed.LineCount, 1)
+ self.ed.AddText(4, b"x\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.ed.SetSel(1,1)
+ self.ed.AddText(1, b"\xe2")
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testUBreakApartEOL(self):
+ # Add two lines separated by U+2029 then remove and add back each byte ensuring
+ # only one line after each removal of any byte in line end and 2 lines after reinsertion
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ text = b"x\xe2\x80\xa9y";
+ self.ed.AddText(5, text)
+ self.assertEquals(self.ed.LineCount, 2)
+
+ for i in range(len(text)):
+ self.ed.TargetStart = i
+ self.ed.TargetEnd = i + 1
+ self.ed.ReplaceTarget(0, b"")
+ if i in [0, 4]:
+ # Removing text characters does not change number of lines
+ self.assertEquals(self.ed.LineCount, 2)
+ else:
+ # Removing byte from line end, removes 1 line
+ self.assertEquals(self.ed.LineCount, 1)
+
+ self.ed.TargetEnd = i
+ self.ed.ReplaceTarget(1, text[i:i+1])
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testURemoveEOLFragment(self):
+ # Add UTF-8 line end then delete each byte causing line end to disappear
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ for i in range(3):
+ self.ed.ClearAll()
+ self.ed.AddText(5, b"x\xe2\x80\xa8y")
+ self.assertEquals(self.ed.LineCount, 2)
+ self.ed.TargetStart = i+1
+ self.ed.TargetEnd = i+2
+ self.ed.ReplaceTarget(0, b"")
+ self.assertEquals(self.ed.LineCount, 1)
+
+ # Several tests for unicode NEL line ends U+0085
+
+ def testNELLineEnds(self):
+ # Add two lines separated with U+0085 and ensure it is seen as two lines
+ # Then remove U+0085 and should be just 1 lines
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ self.ed.AddText(4, b"x\xc2\x85y")
+ self.assertEquals(self.ed.LineCount, 2)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 1)
+ self.assertEquals(self.ed.GetLineEndPosition(1), 4)
+ self.assertEquals(self.ed.LineLength(0), 3)
+ self.assertEquals(self.ed.LineLength(1), 1)
+ self.ed.TargetStart = 1
+ self.ed.TargetEnd = 3
+ self.ed.ReplaceTarget(0, b"")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.assertEquals(self.ed.LineLength(0), 2)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 2)
+
+ def testNELFragmentedEOLCompletion(self):
+ # Add starting byte of UTF-8 NEL then complete it
+ self.ed.AddText(3, b"x\xc2y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.assertEquals(self.ed.GetLineEndPosition(0), 3)
+ self.ed.SetSel(2,2)
+ self.ed.AddText(1, b"\x85")
+ self.assertEquals(self.ed.Contents(), b"x\xc2\x85y")
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testNELFragmentedEOLStart(self):
+ # Add end of UTF-8 NEL then insert start
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ self.assertEquals(self.ed.LineCount, 1)
+ self.ed.AddText(4, b"x\x85y")
+ self.assertEquals(self.ed.LineCount, 1)
+ self.ed.SetSel(1,1)
+ self.ed.AddText(1, b"\xc2")
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testNELBreakApartEOL(self):
+ # Add two lines separated by U+0085 then remove and add back each byte ensuring
+ # only one line after each removal of any byte in line end and 2 lines after reinsertion
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.ed.SetCodePage(65001)
+ self.ed.SetLineEndTypesAllowed(1)
+ text = b"x\xc2\x85y";
+ self.ed.AddText(4, text)
+ self.assertEquals(self.ed.LineCount, 2)
+
+ for i in range(len(text)):
+ self.ed.TargetStart = i
+ self.ed.TargetEnd = i + 1
+ self.ed.ReplaceTarget(0, b"")
+ if i in [0, 3]:
+ # Removing text characters does not change number of lines
+ self.assertEquals(self.ed.LineCount, 2)
+ else:
+ # Removing byte from line end, removes 1 line
+ self.assertEquals(self.ed.LineCount, 1)
+
+ self.ed.TargetEnd = i
+ self.ed.ReplaceTarget(1, text[i:i+1])
+ self.assertEquals(self.ed.LineCount, 2)
+
+ def testNELRemoveEOLFragment(self):
+ # Add UTF-8 NEL then delete each byte causing line end to disappear
+ self.ed.SetCodePage(65001)
+ for i in range(2):
+ self.ed.ClearAll()
+ self.ed.AddText(4, b"x\xc2\x85y")
+ self.assertEquals(self.ed.LineCount, 2)
+ self.ed.TargetStart = i+1
+ self.ed.TargetEnd = i+2
+ self.ed.ReplaceTarget(0, b"")
+ self.assertEquals(self.ed.LineCount, 1)
+
+ def testGoto(self):
+ self.ed.AddText(5, b"a\nb\nc")
+ self.assertEquals(self.ed.CurrentPos, 5)
+ self.ed.GotoLine(1)
+ self.assertEquals(self.ed.CurrentPos, 2)
+ self.ed.GotoPos(4)
+ self.assertEquals(self.ed.CurrentPos, 4)
+
+ def testCutCopyPaste(self):
+ self.ed.AddText(5, b"a1b2c")
+ self.ed.SetSel(1,3)
+ self.ed.Cut()
+ self.xite.DoEvents()
+ self.assertEquals(self.ed.CanPaste(), 1)
+ self.ed.SetSel(0, 0)
+ self.ed.Paste()
+ self.assertEquals(self.ed.Contents(), b"1ba2c")
+ self.ed.SetSel(4,5)
+ self.ed.Copy()
+ self.ed.SetSel(1,3)
+ self.ed.Paste()
+ self.assertEquals(self.ed.Contents(), b"1c2c")
+ self.ed.SetSel(2,4)
+ self.ed.Clear()
+ self.assertEquals(self.ed.Contents(), b"1c")
+
+ def testCopyAllowLine(self):
+ self.xite.DoEvents()
+ lineEndType = self.ed.EOLMode
+ self.ed.EOLMode = self.ed.SC_EOL_LF
+ self.ed.AddText(5, b"a1\nb2")
+ self.ed.SetSel(1,1)
+ self.ed.CopyAllowLine()
+ self.xite.DoEvents()
+ self.assertEquals(self.ed.CanPaste(), 1)
+ self.ed.SetSel(0, 0)
+ self.ed.Paste()
+ self.ed.EOLMode = lineEndType
+ self.assertEquals(self.ed.Contents(), b"a1\na1\nb2")
+
+ def testDuplicate(self):
+ self.ed.AddText(3, b"1b2")
+ self.ed.SetSel(1,2)
+ self.ed.SelectionDuplicate()
+ self.assertEquals(self.ed.Contents(), b"1bb2")
+
+ def testTransposeLines(self):
+ self.ed.AddText(8, b"a1\nb2\nc3")
+ self.ed.SetSel(3,3)
+ self.ed.LineTranspose()
+ self.assertEquals(self.ed.Contents(), b"b2\na1\nc3")
+
+ def testGetSet(self):
+ self.ed.SetContents(b"abc")
+ self.assertEquals(self.ed.TextLength, 3)
+ result = ctypes.create_string_buffer(b"\0" * 5)
+ length = self.ed.GetText(4, result)
+ self.assertEquals(result.value, b"abc")
+
+ def testAppend(self):
+ self.ed.SetContents(b"abc")
+ self.assertEquals(self.ed.SelectionStart, 0)
+ self.assertEquals(self.ed.SelectionEnd, 0)
+ text = b"12"
+ self.ed.AppendText(len(text), text)
+ self.assertEquals(self.ed.SelectionStart, 0)
+ self.assertEquals(self.ed.SelectionEnd, 0)
+ self.assertEquals(self.ed.Contents(), b"abc12")
+
+ def testTarget(self):
+ self.ed.SetContents(b"abcd")
+ self.ed.TargetStart = 1
+ self.ed.TargetEnd = 3
+ self.assertEquals(self.ed.TargetStart, 1)
+ self.assertEquals(self.ed.TargetEnd, 3)
+ rep = b"321"
+ self.ed.ReplaceTarget(len(rep), rep)
+ self.assertEquals(self.ed.Contents(), b"a321d")
+ self.ed.SearchFlags = self.ed.SCFIND_REGEXP
+ self.assertEquals(self.ed.SearchFlags, self.ed.SCFIND_REGEXP)
+ searchString = b"\([1-9]+\)"
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(1, pos)
+ tagString = self.ed.GetTag(1)
+ self.assertEquals(tagString, b"321")
+ rep = b"\\1"
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = 0
+ self.ed.ReplaceTargetRE(len(rep), rep)
+ self.assertEquals(self.ed.Contents(), b"321a321d")
+ self.ed.SetSel(4,5)
+ self.ed.TargetFromSelection()
+ self.assertEquals(self.ed.TargetStart, 4)
+ self.assertEquals(self.ed.TargetEnd, 5)
+
+ def testTargetEscape(self):
+ # Checks that a literal \ can be in the replacement. Bug #2959876
+ self.ed.SetContents(b"abcd")
+ self.ed.TargetStart = 1
+ self.ed.TargetEnd = 3
+ rep = b"\\\\n"
+ self.ed.ReplaceTargetRE(len(rep), rep)
+ self.assertEquals(self.ed.Contents(), b"a\\nd")
+
+ def testPointsAndPositions(self):
+ self.ed.AddText(1, b"x")
+ # Start of text
+ self.assertEquals(self.ed.PositionFromPoint(0,0), 0)
+ # End of text
+ self.assertEquals(self.ed.PositionFromPoint(0,100), 1)
+
+ def testLinePositions(self):
+ text = b"ab\ncd\nef"
+ nl = b"\n"
+ if sys.version_info[0] == 3:
+ nl = ord(b"\n")
+ self.ed.AddText(len(text), text)
+ self.assertEquals(self.ed.LineFromPosition(-1), 0)
+ line = 0
+ for pos in range(len(text)+1):
+ self.assertEquals(self.ed.LineFromPosition(pos), line)
+ if pos < len(text) and text[pos] == nl:
+ line += 1
+
+ def testWordPositions(self):
+ text = b"ab cd\tef"
+ self.ed.AddText(len(text), text)
+ self.assertEquals(self.ed.WordStartPosition(3, 0), 2)
+ self.assertEquals(self.ed.WordStartPosition(4, 0), 3)
+ self.assertEquals(self.ed.WordStartPosition(5, 0), 3)
+ self.assertEquals(self.ed.WordStartPosition(6, 0), 5)
+
+ self.assertEquals(self.ed.WordEndPosition(2, 0), 3)
+ self.assertEquals(self.ed.WordEndPosition(3, 0), 5)
+ self.assertEquals(self.ed.WordEndPosition(4, 0), 5)
+ self.assertEquals(self.ed.WordEndPosition(5, 0), 6)
+ self.assertEquals(self.ed.WordEndPosition(6, 0), 8)
+
+MODI = 1
+UNDO = 2
+REDO = 4
+
+class TestContainerUndo(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.data = b"xy"
+
+ def UndoState(self):
+ return (MODI if self.ed.Modify else 0) | \
+ (UNDO if self.ed.CanUndo() else 0) | \
+ (REDO if self.ed.CanRedo() else 0)
+
+ def testContainerActNoCoalesce(self):
+ self.ed.InsertText(0, self.data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 0)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO | REDO)
+ self.ed.Redo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+
+ def testContainerActCoalesce(self):
+ self.ed.InsertText(0, self.data)
+ self.ed.AddUndoAction(5, 1)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+ self.ed.Redo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+
+ def testContainerMultiStage(self):
+ self.ed.InsertText(0, self.data)
+ self.ed.AddUndoAction(5, 1)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+ self.ed.Redo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+
+ def testContainerMultiStageNoText(self):
+ self.ed.AddUndoAction(5, 1)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+ self.assertEquals(self.UndoState(), REDO)
+ self.ed.Redo()
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+ self.assertEquals(self.UndoState(), REDO)
+
+ def testContainerActCoalesceEnd(self):
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.InsertText(0, self.data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+ self.ed.Redo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+
+ def testContainerBetweenInsertAndInsert(self):
+ self.assertEquals(self.ed.Length, 0)
+ self.ed.InsertText(0, self.data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.InsertText(2, self.data)
+ self.assertEquals(self.ed.Length, 4)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ # Undoes both insertions and the containerAction in the middle
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+
+ def testContainerNoCoalesceBetweenInsertAndInsert(self):
+ self.assertEquals(self.ed.Length, 0)
+ self.ed.InsertText(0, self.data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 0)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.InsertText(2, self.data)
+ self.assertEquals(self.ed.Length, 4)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ # Undo last insertion
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO | REDO)
+ # Undo container
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO | REDO)
+ # Undo first insertion
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 0)
+ self.assertEquals(self.UndoState(), REDO)
+
+ def testContainerBetweenDeleteAndDelete(self):
+ self.ed.InsertText(0, self.data)
+ self.ed.EmptyUndoBuffer()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), 0)
+ self.ed.SetSel(2,2)
+ self.ed.DeleteBack()
+ self.assertEquals(self.ed.Length, 1)
+ self.ed.AddUndoAction(5, 1)
+ self.ed.DeleteBack()
+ self.assertEquals(self.ed.Length, 0)
+ # Undoes both deletions and the containerAction in the middle
+ self.ed.Undo()
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), REDO)
+
+ def testContainerBetweenInsertAndDelete(self):
+ self.assertEquals(self.ed.Length, 0)
+ self.ed.InsertText(0, self.data)
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.AddUndoAction(5, 1)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.SetSel(0,1)
+ self.ed.Cut()
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(self.UndoState(), MODI | UNDO)
+ self.ed.Undo() # Only undoes the deletion
+ self.assertEquals(self.ed.Length, 2)
+ self.assertEquals(self.UndoState(), MODI | UNDO | REDO)
+
+class TestKeyCommands(unittest.TestCase):
+ """ These commands are normally assigned to keys and take no arguments """
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def selRange(self):
+ return self.ed.CurrentPos, self.ed.Anchor
+
+ def testLineMove(self):
+ self.ed.AddText(8, b"x1\ny2\nz3")
+ self.ed.SetSel(0,0)
+ self.ed.ChooseCaretX()
+ self.ed.LineDown()
+ self.ed.LineDown()
+ self.assertEquals(self.selRange(), (6, 6))
+ self.ed.LineUp()
+ self.assertEquals(self.selRange(), (3, 3))
+ self.ed.LineDownExtend()
+ self.assertEquals(self.selRange(), (6, 3))
+ self.ed.LineUpExtend()
+ self.ed.LineUpExtend()
+ self.assertEquals(self.selRange(), (0, 3))
+
+ def testCharMove(self):
+ self.ed.AddText(8, b"x1\ny2\nz3")
+ self.ed.SetSel(0,0)
+ self.ed.CharRight()
+ self.ed.CharRight()
+ self.assertEquals(self.selRange(), (2, 2))
+ self.ed.CharLeft()
+ self.assertEquals(self.selRange(), (1, 1))
+ self.ed.CharRightExtend()
+ self.assertEquals(self.selRange(), (2, 1))
+ self.ed.CharLeftExtend()
+ self.ed.CharLeftExtend()
+ self.assertEquals(self.selRange(), (0, 1))
+
+ def testWordMove(self):
+ self.ed.AddText(10, b"a big boat")
+ self.ed.SetSel(3,3)
+ self.ed.WordRight()
+ self.ed.WordRight()
+ self.assertEquals(self.selRange(), (10, 10))
+ self.ed.WordLeft()
+ self.assertEquals(self.selRange(), (6, 6))
+ self.ed.WordRightExtend()
+ self.assertEquals(self.selRange(), (10, 6))
+ self.ed.WordLeftExtend()
+ self.ed.WordLeftExtend()
+ self.assertEquals(self.selRange(), (2, 6))
+
+ def testHomeEndMove(self):
+ self.ed.AddText(10, b"a big boat")
+ self.ed.SetSel(3,3)
+ self.ed.Home()
+ self.assertEquals(self.selRange(), (0, 0))
+ self.ed.LineEnd()
+ self.assertEquals(self.selRange(), (10, 10))
+ self.ed.SetSel(3,3)
+ self.ed.HomeExtend()
+ self.assertEquals(self.selRange(), (0, 3))
+ self.ed.LineEndExtend()
+ self.assertEquals(self.selRange(), (10, 3))
+
+ def testStartEndMove(self):
+ self.ed.AddText(10, b"a\nbig\nboat")
+ self.ed.SetSel(3,3)
+ self.ed.DocumentStart()
+ self.assertEquals(self.selRange(), (0, 0))
+ self.ed.DocumentEnd()
+ self.assertEquals(self.selRange(), (10, 10))
+ self.ed.SetSel(3,3)
+ self.ed.DocumentStartExtend()
+ self.assertEquals(self.selRange(), (0, 3))
+ self.ed.DocumentEndExtend()
+ self.assertEquals(self.selRange(), (10, 3))
+
+
+class TestMarkers(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.ed.AddText(5, b"x\ny\nz")
+
+ def testMarker(self):
+ handle = self.ed.MarkerAdd(1,1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(handle), 1)
+ self.ed.MarkerDelete(1,1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(handle), -1)
+
+ def testTwiceAddedDelete(self):
+ handle = self.ed.MarkerAdd(1,1)
+ self.assertEquals(self.ed.MarkerGet(1), 2)
+ handle2 = self.ed.MarkerAdd(1,1)
+ self.assertEquals(self.ed.MarkerGet(1), 2)
+ self.ed.MarkerDelete(1,1)
+ self.assertEquals(self.ed.MarkerGet(1), 2)
+ self.ed.MarkerDelete(1,1)
+ self.assertEquals(self.ed.MarkerGet(1), 0)
+
+ def testMarkerDeleteAll(self):
+ h1 = self.ed.MarkerAdd(0,1)
+ h2 = self.ed.MarkerAdd(1,2)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h1), 0)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h2), 1)
+ self.ed.MarkerDeleteAll(1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h1), -1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h2), 1)
+ self.ed.MarkerDeleteAll(-1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h1), -1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(h2), -1)
+
+ def testMarkerDeleteHandle(self):
+ handle = self.ed.MarkerAdd(0,1)
+ self.assertEquals(self.ed.MarkerLineFromHandle(handle), 0)
+ self.ed.MarkerDeleteHandle(handle)
+ self.assertEquals(self.ed.MarkerLineFromHandle(handle), -1)
+
+ def testMarkerBits(self):
+ self.assertEquals(self.ed.MarkerGet(0), 0)
+ self.ed.MarkerAdd(0,1)
+ self.assertEquals(self.ed.MarkerGet(0), 2)
+ self.ed.MarkerAdd(0,2)
+ self.assertEquals(self.ed.MarkerGet(0), 6)
+
+ def testMarkerAddSet(self):
+ self.assertEquals(self.ed.MarkerGet(0), 0)
+ self.ed.MarkerAddSet(0,5)
+ self.assertEquals(self.ed.MarkerGet(0), 5)
+ self.ed.MarkerDeleteAll(-1)
+
+ def testMarkerNext(self):
+ self.assertEquals(self.ed.MarkerNext(0, 2), -1)
+ h1 = self.ed.MarkerAdd(0,1)
+ h2 = self.ed.MarkerAdd(2,1)
+ self.assertEquals(self.ed.MarkerNext(0, 2), 0)
+ self.assertEquals(self.ed.MarkerNext(1, 2), 2)
+ self.assertEquals(self.ed.MarkerNext(2, 2), 2)
+ self.assertEquals(self.ed.MarkerPrevious(0, 2), 0)
+ self.assertEquals(self.ed.MarkerPrevious(1, 2), 0)
+ self.assertEquals(self.ed.MarkerPrevious(2, 2), 2)
+
+ def testMarkerNegative(self):
+ self.assertEquals(self.ed.MarkerNext(-1, 2), -1)
+
+ def testLineState(self):
+ self.assertEquals(self.ed.MaxLineState, 0)
+ self.assertEquals(self.ed.GetLineState(0), 0)
+ self.assertEquals(self.ed.GetLineState(1), 0)
+ self.assertEquals(self.ed.GetLineState(2), 0)
+ self.ed.SetLineState(1, 100)
+ self.assertNotEquals(self.ed.MaxLineState, 0)
+ self.assertEquals(self.ed.GetLineState(0), 0)
+ self.assertEquals(self.ed.GetLineState(1), 100)
+ self.assertEquals(self.ed.GetLineState(2), 0)
+
+ def testSymbolRetrieval(self):
+ self.ed.MarkerDefine(1,3)
+ self.assertEquals(self.ed.MarkerSymbolDefined(1), 3)
+
+class TestIndicators(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testSetIndicator(self):
+ self.assertEquals(self.ed.IndicGetStyle(0), 1)
+ self.assertEquals(self.ed.IndicGetFore(0), 0x007f00)
+ self.ed.IndicSetStyle(0, 2)
+ self.ed.IndicSetFore(0, 0xff0080)
+ self.assertEquals(self.ed.IndicGetStyle(0), 2)
+ self.assertEquals(self.ed.IndicGetFore(0), 0xff0080)
+
+ def testIndicatorFill(self):
+ self.ed.InsertText(0, b"abc")
+ self.ed.IndicatorCurrent = 3
+ self.ed.IndicatorFillRange(1,1)
+ self.assertEquals(self.ed.IndicatorValueAt(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorValueAt(3, 1), 1)
+ self.assertEquals(self.ed.IndicatorValueAt(3, 2), 0)
+ self.assertEquals(self.ed.IndicatorStart(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorEnd(3, 0), 1)
+ self.assertEquals(self.ed.IndicatorStart(3, 1), 1)
+ self.assertEquals(self.ed.IndicatorEnd(3, 1), 2)
+ self.assertEquals(self.ed.IndicatorStart(3, 2), 2)
+ self.assertEquals(self.ed.IndicatorEnd(3, 2), 3)
+
+ def testIndicatorAtEnd(self):
+ self.ed.InsertText(0, b"ab")
+ self.ed.IndicatorCurrent = 3
+ self.ed.IndicatorFillRange(1,1)
+ self.assertEquals(self.ed.IndicatorValueAt(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorValueAt(3, 1), 1)
+ self.assertEquals(self.ed.IndicatorStart(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorEnd(3, 0), 1)
+ self.assertEquals(self.ed.IndicatorStart(3, 1), 1)
+ self.assertEquals(self.ed.IndicatorEnd(3, 1), 2)
+ self.ed.DeleteRange(1, 1)
+ # Now only one character left and does not have indicator so indicator 3 is null
+ self.assertEquals(self.ed.IndicatorValueAt(3, 0), 0)
+ # Since null, remaining calls return 0
+ self.assertEquals(self.ed.IndicatorStart(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorEnd(3, 0), 0)
+ self.assertEquals(self.ed.IndicatorStart(3, 1), 0)
+ self.assertEquals(self.ed.IndicatorEnd(3, 1), 0)
+
+class TestScrolling(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ # 150 should be enough lines
+ self.ed.InsertText(0, b"a" * 150 + b"\n" * 150)
+
+ def testTop(self):
+ self.ed.GotoLine(0)
+ self.assertEquals(self.ed.FirstVisibleLine, 0)
+
+ def testLineScroll(self):
+ self.ed.GotoLine(0)
+ self.ed.LineScroll(0, 3)
+ self.assertEquals(self.ed.FirstVisibleLine, 3)
+ self.ed.LineScroll(0, -2)
+ self.assertEquals(self.ed.FirstVisibleLine, 1)
+ self.assertEquals(self.ed.XOffset, 0)
+ self.ed.LineScroll(10, 0)
+ self.assertGreater(self.ed.XOffset, 0)
+ scroll_width = float(self.ed.XOffset) / 10
+ self.ed.LineScroll(-2, 0)
+ self.assertEquals(self.ed.XOffset, scroll_width * 8)
+
+ def testVisibleLine(self):
+ self.ed.FirstVisibleLine = 7
+ self.assertEquals(self.ed.FirstVisibleLine, 7)
+
+class TestSearch(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.ed.InsertText(0, b"a\tbig boat\t")
+
+ def testFind(self):
+ pos = self.ed.FindBytes(0, self.ed.Length, b"zzz", 0)
+ self.assertEquals(pos, -1)
+ pos = self.ed.FindBytes(0, self.ed.Length, b"big", 0)
+ self.assertEquals(pos, 2)
+
+ def testFindEmpty(self):
+ pos = self.ed.FindBytes(0, self.ed.Length, b"", 0)
+ self.assertEquals(pos, 0)
+
+ def testCaseFind(self):
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"big", 0), 2)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bIg", 0), 2)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bIg",
+ self.ed.SCFIND_MATCHCASE), -1)
+
+ def testWordFind(self):
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bi", 0), 2)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bi",
+ self.ed.SCFIND_WHOLEWORD), -1)
+
+ def testWordStartFind(self):
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bi", 0), 2)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"bi",
+ self.ed.SCFIND_WORDSTART), 2)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"ig", 0), 3)
+ self.assertEquals(self.ed.FindBytes(0, self.ed.Length, b"ig",
+ self.ed.SCFIND_WORDSTART), -1)
+
+ def testREFind(self):
+ flags = self.ed.SCFIND_REGEXP
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"b.g", 0))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"b.g", flags))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"\<b.g\>", flags))
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"b[A-Z]g",
+ flags | self.ed.SCFIND_MATCHCASE))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"b[a-z]g", flags))
+ self.assertEquals(6, self.ed.FindBytes(0, self.ed.Length, b"b[a-z]*t", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"^a", flags))
+ self.assertEquals(10, self.ed.FindBytes(0, self.ed.Length, b"\t$", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\([a]\).*\0", flags))
+
+ def testPosixREFind(self):
+ flags = self.ed.SCFIND_REGEXP | self.ed.SCFIND_POSIX
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"b.g", 0))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"b.g", flags))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"\<b.g\>", flags))
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"b[A-Z]g",
+ flags | self.ed.SCFIND_MATCHCASE))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"b[a-z]g", flags))
+ self.assertEquals(6, self.ed.FindBytes(0, self.ed.Length, b"b[a-z]*t", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"^a", flags))
+ self.assertEquals(10, self.ed.FindBytes(0, self.ed.Length, b"\t$", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"([a]).*\0", flags))
+
+ def testPhilippeREFind(self):
+ # Requires 1.,72
+ flags = self.ed.SCFIND_REGEXP
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\w", flags))
+ self.assertEquals(1, self.ed.FindBytes(0, self.ed.Length, b"\W", flags))
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"\d", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\D", flags))
+ self.assertEquals(1, self.ed.FindBytes(0, self.ed.Length, b"\s", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\S", flags))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"\x62", flags))
+
+ def testRENonASCII(self):
+ self.ed.InsertText(0, b"\xAD")
+ flags = self.ed.SCFIND_REGEXP
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"\\x10", flags))
+ self.assertEquals(2, self.ed.FindBytes(0, self.ed.Length, b"\\x09", flags))
+ self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"\\xAB", flags))
+ self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\\xAD", flags))
+
+class TestRepresentations(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testGetControl(self):
+ result = self.ed.GetRepresentation(b"\001")
+ self.assertEquals(result, b"SOH")
+
+ def testClearControl(self):
+ result = self.ed.GetRepresentation(b"\002")
+ self.assertEquals(result, b"STX")
+ self.ed.ClearRepresentation(b"\002")
+ result = self.ed.GetRepresentation(b"\002")
+ self.assertEquals(result, b"")
+
+ def testSetOhm(self):
+ ohmSign = b"\xe2\x84\xa6"
+ ohmExplained = b"U+2126 \xe2\x84\xa6"
+ self.ed.SetRepresentation(ohmSign, ohmExplained)
+ result = self.ed.GetRepresentation(ohmSign)
+ self.assertEquals(result, ohmExplained)
+
+class TestProperties(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testSet(self):
+ self.ed.SetProperty(b"test", b"12")
+ self.assertEquals(self.ed.GetPropertyInt(b"test"), 12)
+ result = self.ed.GetProperty(b"test")
+ self.assertEquals(result, b"12")
+ self.ed.SetProperty(b"test.plus", b"[$(test)]")
+ result = self.ed.GetPropertyExpanded(b"test.plus")
+ self.assertEquals(result, b"[12]")
+
+class TestTextMargin(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.txt = b"abcd"
+ self.ed.AddText(1, b"x")
+
+ def testAscent(self):
+ lineHeight = self.ed.TextHeight(0)
+ self.assertEquals(self.ed.ExtraAscent, 0)
+ self.assertEquals(self.ed.ExtraDescent, 0)
+ self.ed.ExtraAscent = 1
+ self.assertEquals(self.ed.ExtraAscent, 1)
+ self.ed.ExtraDescent = 2
+ self.assertEquals(self.ed.ExtraDescent, 2)
+ lineHeightIncreased = self.ed.TextHeight(0)
+ self.assertEquals(lineHeightIncreased, lineHeight + 2 + 1)
+
+ def testTextMargin(self):
+ self.ed.MarginSetText(0, self.txt)
+ result = self.ed.MarginGetText(0)
+ self.assertEquals(result, self.txt)
+ self.ed.MarginTextClearAll()
+
+ def testTextMarginStyle(self):
+ self.ed.MarginSetText(0, self.txt)
+ self.ed.MarginSetStyle(0, 33)
+ self.assertEquals(self.ed.MarginGetStyle(0), 33)
+ self.ed.MarginTextClearAll()
+
+ def testTextMarginStyles(self):
+ styles = b"\001\002\003\004"
+ self.ed.MarginSetText(0, self.txt)
+ self.ed.MarginSetStyles(0, styles)
+ result = self.ed.MarginGetStyles(0)
+ self.assertEquals(result, styles)
+ self.ed.MarginTextClearAll()
+
+ def testTextMarginStyleOffset(self):
+ self.ed.MarginSetStyleOffset(300)
+ self.assertEquals(self.ed.MarginGetStyleOffset(), 300)
+
+class TestAnnotation(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.txt = b"abcd"
+ self.ed.AddText(1, b"x")
+
+ def testTextAnnotation(self):
+ self.assertEquals(self.ed.AnnotationGetLines(), 0)
+ self.ed.AnnotationSetText(0, self.txt)
+ self.assertEquals(self.ed.AnnotationGetLines(), 1)
+ result = self.ed.AnnotationGetText(0)
+ self.assertEquals(len(result), 4)
+ self.assertEquals(result, self.txt)
+ self.ed.AnnotationClearAll()
+
+ def testTextAnnotationStyle(self):
+ self.ed.AnnotationSetText(0, self.txt)
+ self.ed.AnnotationSetStyle(0, 33)
+ self.assertEquals(self.ed.AnnotationGetStyle(0), 33)
+ self.ed.AnnotationClearAll()
+
+ def testTextAnnotationStyles(self):
+ styles = b"\001\002\003\004"
+ self.ed.AnnotationSetText(0, self.txt)
+ self.ed.AnnotationSetStyles(0, styles)
+ result = self.ed.AnnotationGetStyles(0)
+ self.assertEquals(result, styles)
+ self.ed.AnnotationClearAll()
+
+ def testExtendedStyles(self):
+ start0 = self.ed.AllocateExtendedStyles(0)
+ self.assertEquals(start0, 256)
+ start1 = self.ed.AllocateExtendedStyles(10)
+ self.assertEquals(start1, 256)
+ start2 = self.ed.AllocateExtendedStyles(20)
+ self.assertEquals(start2, start1 + 10)
+ # Reset by changing lexer
+ self.ed.ReleaseAllExtendedStyles()
+ start0 = self.ed.AllocateExtendedStyles(0)
+ self.assertEquals(start0, 256)
+
+ def testTextAnnotationStyleOffset(self):
+ self.ed.AnnotationSetStyleOffset(300)
+ self.assertEquals(self.ed.AnnotationGetStyleOffset(), 300)
+
+ def testTextAnnotationVisible(self):
+ self.assertEquals(self.ed.AnnotationGetVisible(), 0)
+ self.ed.AnnotationSetVisible(2)
+ self.assertEquals(self.ed.AnnotationGetVisible(), 2)
+ self.ed.AnnotationSetVisible(0)
+
+class TestMultiSelection(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ # 3 lines of 3 characters
+ t = b"xxx\nxxx\nxxx"
+ self.ed.AddText(len(t), t)
+
+ def testSelectionCleared(self):
+ self.ed.ClearSelections()
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 0)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 0)
+
+ def test1Selection(self):
+ self.ed.SetSelection(1, 2)
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 2)
+ self.assertEquals(self.ed.GetSelectionNStart(0), 1)
+ self.assertEquals(self.ed.GetSelectionNEnd(0), 2)
+ self.ed.SwapMainAnchorCaret()
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1)
+
+ def test1SelectionReversed(self):
+ self.ed.SetSelection(2, 1)
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1)
+ self.assertEquals(self.ed.GetSelectionNStart(0), 1)
+ self.assertEquals(self.ed.GetSelectionNEnd(0), 2)
+
+ def test1SelectionByStartEnd(self):
+ self.ed.SetSelectionNStart(0, 2)
+ self.ed.SetSelectionNEnd(0, 3)
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 2)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 3)
+ self.assertEquals(self.ed.GetSelectionNStart(0), 2)
+ self.assertEquals(self.ed.GetSelectionNEnd(0), 3)
+
+ def test2Selections(self):
+ self.ed.SetSelection(1, 2)
+ self.ed.AddSelection(4, 5)
+ self.assertEquals(self.ed.Selections, 2)
+ self.assertEquals(self.ed.MainSelection, 1)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 2)
+ self.assertEquals(self.ed.GetSelectionNCaret(1), 4)
+ self.assertEquals(self.ed.GetSelectionNAnchor(1), 5)
+ self.assertEquals(self.ed.GetSelectionNStart(0), 1)
+ self.assertEquals(self.ed.GetSelectionNEnd(0), 2)
+ self.ed.MainSelection = 0
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.ed.RotateSelection()
+ self.assertEquals(self.ed.MainSelection, 1)
+
+ def testRectangularSelection(self):
+ self.ed.RectangularSelectionAnchor = 1
+ self.assertEquals(self.ed.RectangularSelectionAnchor, 1)
+ self.ed.RectangularSelectionCaret = 10
+ self.assertEquals(self.ed.RectangularSelectionCaret, 10)
+ self.assertEquals(self.ed.Selections, 3)
+ self.assertEquals(self.ed.MainSelection, 2)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2)
+ self.assertEquals(self.ed.GetSelectionNAnchor(1), 5)
+ self.assertEquals(self.ed.GetSelectionNCaret(1), 6)
+ self.assertEquals(self.ed.GetSelectionNAnchor(2), 9)
+ self.assertEquals(self.ed.GetSelectionNCaret(2), 10)
+
+ def testVirtualSpace(self):
+ self.ed.SetSelection(3, 7)
+ self.ed.SetSelectionNCaretVirtualSpace(0, 3)
+ self.assertEquals(self.ed.GetSelectionNCaretVirtualSpace(0), 3)
+ self.ed.SetSelectionNAnchorVirtualSpace(0, 2)
+ self.assertEquals(self.ed.GetSelectionNAnchorVirtualSpace(0), 2)
+ # Does not check that virtual space is valid by being at end of line
+ self.ed.SetSelection(1, 1)
+ self.ed.SetSelectionNCaretVirtualSpace(0, 3)
+ self.assertEquals(self.ed.GetSelectionNCaretVirtualSpace(0), 3)
+
+ def testRectangularVirtualSpace(self):
+ self.ed.VirtualSpaceOptions=1
+ self.ed.RectangularSelectionAnchor = 3
+ self.assertEquals(self.ed.RectangularSelectionAnchor, 3)
+ self.ed.RectangularSelectionCaret = 7
+ self.assertEquals(self.ed.RectangularSelectionCaret, 7)
+ self.ed.RectangularSelectionAnchorVirtualSpace = 1
+ self.assertEquals(self.ed.RectangularSelectionAnchorVirtualSpace, 1)
+ self.ed.RectangularSelectionCaretVirtualSpace = 10
+ self.assertEquals(self.ed.RectangularSelectionCaretVirtualSpace, 10)
+ self.assertEquals(self.ed.Selections, 2)
+ self.assertEquals(self.ed.MainSelection, 1)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 3)
+ self.assertEquals(self.ed.GetSelectionNAnchorVirtualSpace(0), 1)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 3)
+ self.assertEquals(self.ed.GetSelectionNCaretVirtualSpace(0), 10)
+
+ def testRectangularVirtualSpaceOptionOff(self):
+ # Same as previous test but virtual space option off so no virtual space in result
+ self.ed.VirtualSpaceOptions=0
+ self.ed.RectangularSelectionAnchor = 3
+ self.assertEquals(self.ed.RectangularSelectionAnchor, 3)
+ self.ed.RectangularSelectionCaret = 7
+ self.assertEquals(self.ed.RectangularSelectionCaret, 7)
+ self.ed.RectangularSelectionAnchorVirtualSpace = 1
+ self.assertEquals(self.ed.RectangularSelectionAnchorVirtualSpace, 1)
+ self.ed.RectangularSelectionCaretVirtualSpace = 10
+ self.assertEquals(self.ed.RectangularSelectionCaretVirtualSpace, 10)
+ self.assertEquals(self.ed.Selections, 2)
+ self.assertEquals(self.ed.MainSelection, 1)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 3)
+ self.assertEquals(self.ed.GetSelectionNAnchorVirtualSpace(0), 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 3)
+ self.assertEquals(self.ed.GetSelectionNCaretVirtualSpace(0), 0)
+
+ def testDropSelectionN(self):
+ self.ed.SetSelection(1, 2)
+ # Only one so dropping has no effect
+ self.ed.DropSelectionN(0)
+ self.assertEquals(self.ed.Selections, 1)
+ self.ed.AddSelection(4, 5)
+ self.assertEquals(self.ed.Selections, 2)
+ # Outside bounds so no effect
+ self.ed.DropSelectionN(2)
+ self.assertEquals(self.ed.Selections, 2)
+ # Dropping before main so main decreases
+ self.ed.DropSelectionN(0)
+ self.assertEquals(self.ed.Selections, 1)
+ self.assertEquals(self.ed.MainSelection, 0)
+ self.assertEquals(self.ed.GetSelectionNCaret(0), 4)
+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 5)
+
+ self.ed.AddSelection(10, 11)
+ self.ed.AddSelection(20, 21)
+ self.assertEquals(self.ed.Selections, 3)
+ self.assertEquals(self.ed.MainSelection, 2)
+ self.ed.MainSelection = 1
+ # Dropping after main so main does not change
+ self.ed.DropSelectionN(2)
+ self.assertEquals(self.ed.MainSelection, 1)
+
+ # Dropping first selection so wraps around to new last.
+ self.ed.AddSelection(30, 31)
+ self.ed.AddSelection(40, 41)
+ self.assertEquals(self.ed.Selections, 4)
+ self.ed.MainSelection = 0
+ self.ed.DropSelectionN(0)
+ self.assertEquals(self.ed.MainSelection, 2)
+
+class TestStyleAttributes(unittest.TestCase):
+ """ These tests are just to ensure that the calls set and retrieve values.
+ They do not check the visual appearance of the style attributes.
+ """
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.testColour = 0x171615
+ self.testFont = b"Georgia"
+
+ def tearDown(self):
+ self.ed.StyleResetDefault()
+
+ def testFont(self):
+ self.ed.StyleSetFont(self.ed.STYLE_DEFAULT, self.testFont)
+ self.assertEquals(self.ed.StyleGetFont(self.ed.STYLE_DEFAULT), self.testFont)
+
+ def testSize(self):
+ self.ed.StyleSetSize(self.ed.STYLE_DEFAULT, 12)
+ self.assertEquals(self.ed.StyleGetSize(self.ed.STYLE_DEFAULT), 12)
+ self.assertEquals(self.ed.StyleGetSizeFractional(self.ed.STYLE_DEFAULT), 12*self.ed.SC_FONT_SIZE_MULTIPLIER)
+ self.ed.StyleSetSizeFractional(self.ed.STYLE_DEFAULT, 1234)
+ self.assertEquals(self.ed.StyleGetSizeFractional(self.ed.STYLE_DEFAULT), 1234)
+
+ def testBold(self):
+ self.ed.StyleSetBold(self.ed.STYLE_DEFAULT, 1)
+ self.assertEquals(self.ed.StyleGetBold(self.ed.STYLE_DEFAULT), 1)
+ self.assertEquals(self.ed.StyleGetWeight(self.ed.STYLE_DEFAULT), self.ed.SC_WEIGHT_BOLD)
+ self.ed.StyleSetWeight(self.ed.STYLE_DEFAULT, 530)
+ self.assertEquals(self.ed.StyleGetWeight(self.ed.STYLE_DEFAULT), 530)
+
+ def testItalic(self):
+ self.ed.StyleSetItalic(self.ed.STYLE_DEFAULT, 1)
+ self.assertEquals(self.ed.StyleGetItalic(self.ed.STYLE_DEFAULT), 1)
+
+ def testUnderline(self):
+ self.assertEquals(self.ed.StyleGetUnderline(self.ed.STYLE_DEFAULT), 0)
+ self.ed.StyleSetUnderline(self.ed.STYLE_DEFAULT, 1)
+ self.assertEquals(self.ed.StyleGetUnderline(self.ed.STYLE_DEFAULT), 1)
+
+ def testFore(self):
+ self.assertEquals(self.ed.StyleGetFore(self.ed.STYLE_DEFAULT), 0)
+ self.ed.StyleSetFore(self.ed.STYLE_DEFAULT, self.testColour)
+ self.assertEquals(self.ed.StyleGetFore(self.ed.STYLE_DEFAULT), self.testColour)
+
+ def testBack(self):
+ self.assertEquals(self.ed.StyleGetBack(self.ed.STYLE_DEFAULT), 0xffffff)
+ self.ed.StyleSetBack(self.ed.STYLE_DEFAULT, self.testColour)
+ self.assertEquals(self.ed.StyleGetBack(self.ed.STYLE_DEFAULT), self.testColour)
+
+ def testEOLFilled(self):
+ self.assertEquals(self.ed.StyleGetEOLFilled(self.ed.STYLE_DEFAULT), 0)
+ self.ed.StyleSetEOLFilled(self.ed.STYLE_DEFAULT, 1)
+ self.assertEquals(self.ed.StyleGetEOLFilled(self.ed.STYLE_DEFAULT), 1)
+
+ def testCharacterSet(self):
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_RUSSIAN)
+ self.assertEquals(self.ed.StyleGetCharacterSet(self.ed.STYLE_DEFAULT), self.ed.SC_CHARSET_RUSSIAN)
+
+ def testCase(self):
+ self.assertEquals(self.ed.StyleGetCase(self.ed.STYLE_DEFAULT), self.ed.SC_CASE_MIXED)
+ self.ed.StyleSetCase(self.ed.STYLE_DEFAULT, self.ed.SC_CASE_UPPER)
+ self.assertEquals(self.ed.StyleGetCase(self.ed.STYLE_DEFAULT), self.ed.SC_CASE_UPPER)
+ self.ed.StyleSetCase(self.ed.STYLE_DEFAULT, self.ed.SC_CASE_LOWER)
+ self.assertEquals(self.ed.StyleGetCase(self.ed.STYLE_DEFAULT), self.ed.SC_CASE_LOWER)
+
+ def testVisible(self):
+ self.assertEquals(self.ed.StyleGetVisible(self.ed.STYLE_DEFAULT), 1)
+ self.ed.StyleSetVisible(self.ed.STYLE_DEFAULT, 0)
+ self.assertEquals(self.ed.StyleGetVisible(self.ed.STYLE_DEFAULT), 0)
+
+ def testChangeable(self):
+ self.assertEquals(self.ed.StyleGetChangeable(self.ed.STYLE_DEFAULT), 1)
+ self.ed.StyleSetChangeable(self.ed.STYLE_DEFAULT, 0)
+ self.assertEquals(self.ed.StyleGetChangeable(self.ed.STYLE_DEFAULT), 0)
+
+ def testHotSpot(self):
+ self.assertEquals(self.ed.StyleGetHotSpot(self.ed.STYLE_DEFAULT), 0)
+ self.ed.StyleSetHotSpot(self.ed.STYLE_DEFAULT, 1)
+ self.assertEquals(self.ed.StyleGetHotSpot(self.ed.STYLE_DEFAULT), 1)
+
+class TestCharacterNavigation(unittest.TestCase):
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ self.ed.SetCodePage(65001)
+
+ def tearDown(self):
+ self.ed.SetCodePage(0)
+
+ def testBeforeAfter(self):
+ t = "aåflﬔ-"
+ tv = t.encode("UTF-8")
+ self.ed.SetContents(tv)
+ pos = 0
+ for i in range(len(t)-1):
+ after = self.ed.PositionAfter(pos)
+ self.assert_(after > i)
+ back = self.ed.PositionBefore(after)
+ self.assertEquals(pos, back)
+ pos = after
+
+ def testRelative(self):
+ # \x61 \xc3\xa5 \xef\xac\x82 \xef\xac\x94 \x2d
+ t = "aåflﬔ-"
+ tv = t.encode("UTF-8")
+ self.ed.SetContents(tv)
+ self.assertEquals(self.ed.PositionRelative(1, 2), 6)
+ self.assertEquals(self.ed.PositionRelative(6, -2), 1)
+ pos = 0
+ previous = 0
+ for i in range(1, len(t)):
+ after = self.ed.PositionRelative(pos, i)
+ self.assert_(after > pos)
+ self.assert_(after > previous)
+ previous = after
+ pos = len(t)
+ previous = pos
+ for i in range(1, len(t)-1):
+ after = self.ed.PositionRelative(pos, -i)
+ self.assert_(after < pos)
+ self.assert_(after < previous)
+ previous = after
+
+class TestCaseMapping(unittest.TestCase):
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def tearDown(self):
+ self.ed.SetCodePage(0)
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_DEFAULT)
+
+ def testEmpty(self):
+ # Trying to upper case an empty string caused a crash at one stage
+ t = b"x"
+ self.ed.SetContents(t)
+ self.ed.UpperCase()
+ self.assertEquals(self.ed.Contents(), b"x")
+
+ def testASCII(self):
+ t = b"x"
+ self.ed.SetContents(t)
+ self.ed.SetSel(0,1)
+ self.ed.UpperCase()
+ self.assertEquals(self.ed.Contents(), b"X")
+
+ def testLatin1(self):
+ t = "Ã¥".encode("Latin-1")
+ r = "Ã…".encode("Latin-1")
+ self.ed.SetContents(t)
+ self.ed.SetSel(0,1)
+ self.ed.UpperCase()
+ self.assertEquals(self.ed.Contents(), r)
+
+ def testRussian(self):
+ if sys.platform == "win32":
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_RUSSIAN)
+ else:
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_CYRILLIC)
+ t = "Б".encode("Windows-1251")
+ r = "б".encode("Windows-1251")
+ self.ed.SetContents(t)
+ self.ed.SetSel(0,1)
+ self.ed.LowerCase()
+ self.assertEquals(self.ed.Contents(), r)
+
+ def testUTF(self):
+ self.ed.SetCodePage(65001)
+ t = "Ã¥".encode("UTF-8")
+ r = "Ã…".encode("UTF-8")
+ self.ed.SetContents(t)
+ self.ed.SetSel(0,2)
+ self.ed.UpperCase()
+ self.assertEquals(self.ed.Contents(), r)
+
+ def testUTFDifferentLength(self):
+ self.ed.SetCodePage(65001)
+ t = "ı".encode("UTF-8")
+ r = "I".encode("UTF-8")
+ self.ed.SetContents(t)
+ self.assertEquals(self.ed.Length, 2)
+ self.ed.SetSel(0,2)
+ self.ed.UpperCase()
+ self.assertEquals(self.ed.Length, 1)
+ self.assertEquals(self.ed.Contents(), r)
+
+ def testUTFGrows(self):
+ # This crashed at one point in debug builds due to looking past end of shorter string
+ self.ed.SetCodePage(65001)
+ # ﬖ is a single character ligature taking 3 bytes in UTF8: EF AC 96
+ t = 'ﬖﬖ'.encode("UTF-8")
+ self.ed.SetContents(t)
+ self.assertEquals(self.ed.Length, 6)
+ self.ed.SetSel(0,self.ed.Length)
+ self.ed.UpperCase()
+ # To convert to upper case the ligature is separated into Õ¾ and Õ¶ then uppercased to ÕŽ and Õ†
+ # each of which takes 2 bytes in UTF-8: D5 8E D5 86
+ r = 'ÕŽÕ†ÕŽÕ†'.encode("UTF-8")
+ self.assertEquals(self.ed.Length, 8)
+ self.assertEquals(self.ed.Contents(), r)
+ self.assertEquals(self.ed.SelectionEnd, self.ed.Length)
+
+ def testUTFShrinks(self):
+ self.ed.SetCodePage(65001)
+ # ï¬ is a single character ligature taking 3 bytes in UTF8: EF AC 81
+ t = 'ï¬ï¬'.encode("UTF-8")
+ self.ed.SetContents(t)
+ self.assertEquals(self.ed.Length, 6)
+ self.ed.SetSel(0,self.ed.Length)
+ self.ed.UpperCase()
+ # To convert to upper case the ligature is separated into f and i then uppercased to F and I
+ # each of which takes 1 byte in UTF-8: 46 49
+ r = 'FIFI'.encode("UTF-8")
+ self.assertEquals(self.ed.Length, 4)
+ self.assertEquals(self.ed.Contents(), r)
+ self.assertEquals(self.ed.SelectionEnd, self.ed.Length)
+
+class TestCaseInsensitiveSearch(unittest.TestCase):
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def tearDown(self):
+ self.ed.SetCodePage(0)
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_DEFAULT)
+
+ def testEmpty(self):
+ text = b" x X"
+ searchString = b""
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(0, pos)
+
+ def testASCII(self):
+ text = b" x X"
+ searchString = b"X"
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(1, pos)
+
+ def testLatin1(self):
+ text = "Frånd Åå".encode("Latin-1")
+ searchString = "Ã…".encode("Latin-1")
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(2, pos)
+
+ def testRussian(self):
+ self.ed.StyleSetCharacterSet(self.ed.STYLE_DEFAULT, self.ed.SC_CHARSET_RUSSIAN)
+ text = "=(Б tex б)".encode("Windows-1251")
+ searchString = "б".encode("Windows-1251")
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(2, pos)
+
+ def testUTF(self):
+ self.ed.SetCodePage(65001)
+ text = "Frånd Åå".encode("UTF-8")
+ searchString = "Ã…".encode("UTF-8")
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(2, pos)
+
+ def testUTFDifferentLength(self):
+ # Searching for a two byte string finds a single byte
+ self.ed.SetCodePage(65001)
+ # two byte string "Å¿" single byte "s"
+ text = "Frånds Ååſ $".encode("UTF-8")
+ searchString = "Å¿".encode("UTF-8")
+ firstPosition = len("Frånd".encode("UTF-8"))
+ self.assertEquals(len(searchString), 2)
+ self.ed.SetContents(text)
+ self.ed.TargetStart = 0
+ self.ed.TargetEnd = self.ed.Length-1
+ self.ed.SearchFlags = 0
+ pos = self.ed.SearchInTarget(len(searchString), searchString)
+ self.assertEquals(firstPosition, pos)
+ self.assertEquals(firstPosition+1, self.ed.TargetEnd)
+
+class TestLexer(unittest.TestCase):
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testLexerNumber(self):
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.assertEquals(self.ed.GetLexer(), self.ed.SCLEX_CPP)
+
+ def testLexerName(self):
+ self.ed.LexerLanguage = b"cpp"
+ self.assertEquals(self.ed.GetLexer(), self.ed.SCLEX_CPP)
+ name = self.ed.GetLexerLanguage(0)
+ self.assertEquals(name, b"cpp")
+
+ def testPropertyNames(self):
+ propertyNames = self.ed.PropertyNames()
+ self.assertNotEquals(propertyNames, b"")
+ # The cpp lexer has a boolean property named lexer.cpp.allow.dollars
+ propNameDollars = b"lexer.cpp.allow.dollars"
+ propertyType = self.ed.PropertyType(propNameDollars)
+ self.assertEquals(propertyType, self.ed.SC_TYPE_BOOLEAN)
+ propertyDescription = self.ed.DescribeProperty(propNameDollars)
+ self.assertNotEquals(propertyDescription, b"")
+
+ def testWordListDescriptions(self):
+ wordSet = self.ed.DescribeKeyWordSets()
+ self.assertNotEquals(wordSet, b"")
+
+class TestSubStyles(unittest.TestCase):
+ ''' These tests include knowledge of the current implementation in the cpp lexer
+ and may have to change when that implementation changes.
+ Currently supports subStyles for IDENTIFIER 11 and COMMENTDOCKEYWORD 17 '''
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testInfo(self):
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ bases = self.ed.GetSubStyleBases()
+ self.assertEquals(bases, b"\x0b\x11") # 11, 17
+ self.assertEquals(self.ed.DistanceToSecondaryStyles(), 0x40)
+
+ def testAllocate(self):
+ firstSubStyle = 0x80 # Current implementation
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ self.assertEquals(self.ed.GetStyleFromSubStyle(firstSubStyle), firstSubStyle)
+ self.assertEquals(self.ed.GetSubStylesStart(self.ed.SCE_C_IDENTIFIER), 0)
+ self.assertEquals(self.ed.GetSubStylesLength(self.ed.SCE_C_IDENTIFIER), 0)
+ numSubStyles = 5
+ subs = self.ed.AllocateSubStyles(self.ed.SCE_C_IDENTIFIER, numSubStyles)
+ self.assertEquals(subs, firstSubStyle)
+ self.assertEquals(self.ed.GetSubStylesStart(self.ed.SCE_C_IDENTIFIER), firstSubStyle)
+ self.assertEquals(self.ed.GetSubStylesLength(self.ed.SCE_C_IDENTIFIER), numSubStyles)
+ self.assertEquals(self.ed.GetStyleFromSubStyle(subs), self.ed.SCE_C_IDENTIFIER)
+ self.assertEquals(self.ed.GetStyleFromSubStyle(subs+numSubStyles-1), self.ed.SCE_C_IDENTIFIER)
+ self.assertEquals(self.ed.GetStyleFromSubStyle(self.ed.SCE_C_IDENTIFIER), self.ed.SCE_C_IDENTIFIER)
+ # Now free and check same as start
+ self.ed.FreeSubStyles()
+ self.assertEquals(self.ed.GetStyleFromSubStyle(subs), subs)
+ self.assertEquals(self.ed.GetSubStylesStart(self.ed.SCE_C_IDENTIFIER), 0)
+ self.assertEquals(self.ed.GetSubStylesLength(self.ed.SCE_C_IDENTIFIER), 0)
+
+ def testInactive(self):
+ firstSubStyle = 0x80 # Current implementation
+ inactiveDistance = self.ed.DistanceToSecondaryStyles()
+ self.ed.Lexer = self.ed.SCLEX_CPP
+ numSubStyles = 5
+ subs = self.ed.AllocateSubStyles(self.ed.SCE_C_IDENTIFIER, numSubStyles)
+ self.assertEquals(subs, firstSubStyle)
+ self.assertEquals(self.ed.GetStyleFromSubStyle(subs), self.ed.SCE_C_IDENTIFIER)
+ self.assertEquals(self.ed.GetStyleFromSubStyle(subs+inactiveDistance), self.ed.SCE_C_IDENTIFIER+inactiveDistance)
+ self.ed.FreeSubStyles()
+
+ def testSecondary(self):
+ inactiveDistance = self.ed.DistanceToSecondaryStyles()
+ self.assertEquals(self.ed.GetPrimaryStyleFromStyle(self.ed.SCE_C_IDENTIFIER+inactiveDistance), self.ed.SCE_C_IDENTIFIER)
+
+class TestCallTip(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ # 1 line of 4 characters
+ t = b"fun("
+ self.ed.AddText(len(t), t)
+
+ def testBasics(self):
+ self.assertEquals(self.ed.CallTipActive(), 0)
+ self.ed.CallTipShow(1, "fun(int x)")
+ self.assertEquals(self.ed.CallTipActive(), 1)
+ self.assertEquals(self.ed.CallTipPosStart(), 4)
+ self.ed.CallTipSetPosStart(1)
+ self.assertEquals(self.ed.CallTipPosStart(), 1)
+ self.ed.CallTipCancel()
+ self.assertEquals(self.ed.CallTipActive(), 0)
+
+class TestAutoComplete(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ # 1 line of 3 characters
+ t = b"xxx\n"
+ self.ed.AddText(len(t), t)
+
+ def testDefaults(self):
+ self.assertEquals(self.ed.AutoCGetSeparator(), ord(' '))
+ self.assertEquals(self.ed.AutoCGetMaxHeight(), 5)
+ self.assertEquals(self.ed.AutoCGetMaxWidth(), 0)
+ self.assertEquals(self.ed.AutoCGetTypeSeparator(), ord('?'))
+ self.assertEquals(self.ed.AutoCGetIgnoreCase(), 0)
+ self.assertEquals(self.ed.AutoCGetAutoHide(), 1)
+ self.assertEquals(self.ed.AutoCGetDropRestOfWord(), 0)
+
+ def testChangeDefaults(self):
+ self.ed.AutoCSetSeparator(ord('-'))
+ self.assertEquals(self.ed.AutoCGetSeparator(), ord('-'))
+ self.ed.AutoCSetSeparator(ord(' '))
+
+ self.ed.AutoCSetMaxHeight(100)
+ self.assertEquals(self.ed.AutoCGetMaxHeight(), 100)
+ self.ed.AutoCSetMaxHeight(5)
+
+ self.ed.AutoCSetMaxWidth(100)
+ self.assertEquals(self.ed.AutoCGetMaxWidth(), 100)
+ self.ed.AutoCSetMaxWidth(0)
+
+ self.ed.AutoCSetTypeSeparator(ord('@'))
+ self.assertEquals(self.ed.AutoCGetTypeSeparator(), ord('@'))
+ self.ed.AutoCSetTypeSeparator(ord('?'))
+
+ self.ed.AutoCSetIgnoreCase(1)
+ self.assertEquals(self.ed.AutoCGetIgnoreCase(), 1)
+ self.ed.AutoCSetIgnoreCase(0)
+
+ self.ed.AutoCSetAutoHide(0)
+ self.assertEquals(self.ed.AutoCGetAutoHide(), 0)
+ self.ed.AutoCSetAutoHide(1)
+
+ self.ed.AutoCSetDropRestOfWord(1)
+ self.assertEquals(self.ed.AutoCGetDropRestOfWord(), 1)
+ self.ed.AutoCSetDropRestOfWord(0)
+
+ def testAutoShow(self):
+ self.assertEquals(self.ed.AutoCActive(), 0)
+ self.ed.SetSel(0, 0)
+
+ self.ed.AutoCShow(0, b"za defn ghi")
+ self.assertEquals(self.ed.AutoCActive(), 1)
+ #~ time.sleep(2)
+ self.assertEquals(self.ed.AutoCPosStart(), 0)
+ self.assertEquals(self.ed.AutoCGetCurrent(), 0)
+ t = self.ed.AutoCGetCurrentText(5)
+ #~ self.assertEquals(l, 3)
+ self.assertEquals(t, b"za")
+ self.ed.AutoCCancel()
+ self.assertEquals(self.ed.AutoCActive(), 0)
+
+ def testAutoShowComplete(self):
+ self.assertEquals(self.ed.AutoCActive(), 0)
+ self.ed.SetSel(0, 0)
+
+ self.ed.AutoCShow(0, b"za defn ghi")
+ self.ed.AutoCComplete()
+ self.assertEquals(self.ed.Contents(), b"zaxxx\n")
+
+ self.assertEquals(self.ed.AutoCActive(), 0)
+
+ def testAutoShowSelect(self):
+ self.assertEquals(self.ed.AutoCActive(), 0)
+ self.ed.SetSel(0, 0)
+
+ self.ed.AutoCShow(0, b"za defn ghi")
+ self.ed.AutoCSelect(0, b"d")
+ self.ed.AutoCComplete()
+ self.assertEquals(self.ed.Contents(), b"defnxxx\n")
+
+ self.assertEquals(self.ed.AutoCActive(), 0)
+
+ def testWriteOnly(self):
+ """ Checks that setting attributes doesn't crash or change tested behaviour
+ but does not check that the changed attributes are effective. """
+ self.ed.AutoCStops(0, b"abcde")
+ self.ed.AutoCSetFillUps(0, b"1234")
+
+class TestDirectAccess(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testGapPosition(self):
+ text = b"abcd"
+ self.ed.SetContents(text)
+ self.assertEquals(self.ed.GapPosition, 4)
+ self.ed.TargetStart = 1
+ self.ed.TargetEnd = 1
+ rep = b"-"
+ self.ed.ReplaceTarget(len(rep), rep)
+ self.assertEquals(self.ed.GapPosition, 2)
+
+ def testCharacterPointerAndRangePointer(self):
+ text = b"abcd"
+ self.ed.SetContents(text)
+ characterPointer = self.ed.CharacterPointer
+ rangePointer = self.ed.GetRangePointer(0,3)
+ self.assertEquals(characterPointer, rangePointer)
+ cpBuffer = ctypes.c_char_p(characterPointer)
+ self.assertEquals(cpBuffer.value, text)
+ # Gap will not be moved as already moved for CharacterPointer call
+ rangePointer = self.ed.GetRangePointer(1,3)
+ cpBuffer = ctypes.c_char_p(rangePointer)
+ self.assertEquals(cpBuffer.value, text[1:])
+
+class TestWordChars(unittest.TestCase):
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def tearDown(self):
+ self.ed.SetCharsDefault()
+
+ def _setChars(self, charClass, chars):
+ """ Wrapper to call self.ed.Set*Chars with the right type
+ @param charClass {str} the character class, "word", "space", etc.
+ @param chars {iterable of int} characters to set
+ """
+ if sys.version_info.major == 2:
+ # Python 2, use latin-1 encoded str
+ unichars = (unichr(x) for x in chars if x != 0)
+ # can't use literal u"", that's a syntax error in Py3k
+ # uncode() doesn't exist in Py3k, but we never run it there
+ result = unicode("").join(unichars).encode("latin-1")
+ else:
+ # Python 3, use bytes()
+ result = bytes(x for x in chars if x != 0)
+ meth = getattr(self.ed, "Set%sChars" % (charClass.capitalize()))
+ return meth(None, result)
+
+ def assertCharSetsEqual(self, first, second, *args, **kwargs):
+ """ Assert that the two character sets are equal.
+ If either set are an iterable of numbers, convert them to chars
+ first. """
+ first_set = set()
+ for c in first:
+ first_set.add(chr(c) if isinstance(c, int) else c)
+ second_set = set()
+ for c in second:
+ second_set.add(chr(c) if isinstance(c, int) else c)
+ return self.assertEqual(first_set, second_set, *args, **kwargs)
+
+ def testDefaultWordChars(self):
+ # check that the default word chars are as expected
+ import string
+ data = self.ed.GetWordChars(None)
+ expected = set(string.digits + string.ascii_letters + '_') | \
+ set(chr(x) for x in range(0x80, 0x100))
+ self.assertCharSetsEqual(data, expected)
+
+ def testDefaultWhitespaceChars(self):
+ # check that the default whitespace chars are as expected
+ import string
+ data = self.ed.GetWhitespaceChars(None)
+ expected = (set(chr(x) for x in (range(0, 0x20))) | set(' ')) - \
+ set(['\r', '\n'])
+ self.assertCharSetsEqual(data, expected)
+
+ def testDefaultPunctuationChars(self):
+ # check that the default punctuation chars are as expected
+ import string
+ data = self.ed.GetPunctuationChars(None)
+ expected = set(chr(x) for x in range(0x20, 0x80)) - \
+ set(string.ascii_letters + string.digits + "\r\n_ ")
+ self.assertCharSetsEqual(data, expected)
+
+ def testCustomWordChars(self):
+ # check that setting things to whitespace chars makes them not words
+ self._setChars("whitespace", range(1, 0x100))
+ data = self.ed.GetWordChars(None)
+ expected = set()
+ self.assertCharSetsEqual(data, expected)
+ # and now set something to make sure that works too
+ expected = set(range(1, 0x100, 2))
+ self._setChars("word", expected)
+ data = self.ed.GetWordChars(None)
+ self.assertCharSetsEqual(data, expected)
+
+ def testCustomWhitespaceChars(self):
+ # check setting whitespace chars to non-default values
+ self._setChars("word", range(1, 0x100))
+ # we can't change chr(0) from being anything but whitespace
+ expected = set([0])
+ data = self.ed.GetWhitespaceChars(None)
+ self.assertCharSetsEqual(data, expected)
+ # now try to set it to something custom
+ expected = set(range(1, 0x100, 2)) | set([0])
+ self._setChars("whitespace", expected)
+ data = self.ed.GetWhitespaceChars(None)
+ self.assertCharSetsEqual(data, expected)
+
+ def testCustomPunctuationChars(self):
+ # check setting punctuation chars to non-default values
+ self._setChars("word", range(1, 0x100))
+ expected = set()
+ data = self.ed.GetPunctuationChars(0)
+ self.assertEquals(set(data), expected)
+ # now try to set it to something custom
+ expected = set(range(1, 0x100, 1))
+ self._setChars("punctuation", expected)
+ data = self.ed.GetPunctuationChars(None)
+ self.assertCharSetsEqual(data, expected)
+
+class TestExplicitTabStops(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+ # 2 lines of 4 characters
+ self.t = b"fun(\nint)"
+ self.ed.AddText(len(self.t), self.t)
+
+ def testAddingAndClearing(self):
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 0)
+
+ # Add a tab stop at 7
+ self.ed.AddTabStop(0, 7)
+ # Check added
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 7)
+ # Check does not affect line 1
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 0)
+
+ # Add a tab stop at 18
+ self.ed.AddTabStop(0, 18)
+ # Check added
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 7)
+ self.assertEquals(self.ed.GetNextTabStop(0,7), 18)
+ # Check does not affect line 1
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(1,7), 0)
+
+ # Add a tab stop between others at 13
+ self.ed.AddTabStop(0, 13)
+ # Check added
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 7)
+ self.assertEquals(self.ed.GetNextTabStop(0,7), 13)
+ self.assertEquals(self.ed.GetNextTabStop(0,13), 18)
+ # Check does not affect line 1
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(1,7), 0)
+
+ self.ed.ClearTabStops(0)
+ # Check back to original state
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 0)
+
+ def testLineInsertionDeletion(self):
+ # Add a tab stop at 7 on line 1
+ self.ed.AddTabStop(1, 7)
+ # Check added
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 7)
+
+ # More text at end
+ self.ed.AddText(len(self.t), self.t)
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 7)
+ self.assertEquals(self.ed.GetNextTabStop(2,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(3,0), 0)
+
+ # Another 2 lines before explicit line moves the explicit tab stop
+ data = b"x\ny\n"
+ self.ed.InsertText(4, data)
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(2,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(3,0), 7)
+ self.assertEquals(self.ed.GetNextTabStop(4,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(5,0), 0)
+
+ # Undo moves the explicit tab stop back
+ self.ed.Undo()
+ self.assertEquals(self.ed.GetNextTabStop(0,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(1,0), 7)
+ self.assertEquals(self.ed.GetNextTabStop(2,0), 0)
+ self.assertEquals(self.ed.GetNextTabStop(3,0), 0)
+
+if __name__ == '__main__':
+ uu = Xite.main("simpleTests")
+ #~ for x in sorted(uu.keys()):
+ #~ print(x, uu[x])
+ #~ print()
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/LICENSE_1_0.txt b/3rdparty/bgfx/3rdparty/scintilla/test/unit/LICENSE_1_0.txt
new file mode 100644
index 00000000000..36b7cd93cdf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/LICENSE_1_0.txt
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/README b/3rdparty/bgfx/3rdparty/scintilla/test/unit/README
new file mode 100644
index 00000000000..2558d8e8639
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/README
@@ -0,0 +1,15 @@
+The test/unit directory contains unit tests for Scintilla data structures.
+
+The tests can be run on Windows, OS X, or Linux using g++ and GNU make.
+The Catch test framework is used.
+https://github.com/philsquared/Catch
+The file catch.hpp is under the Boost Software License which is contained in LICENSE_1_0.txt
+
+ To run the tests on OS X or Linux:
+make test
+
+ To run the tests on Windows:
+mingw32-make test
+
+ Visual C++ (2010+) and nmake can also be used on Windows:
+nmake -f test.mak test
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/SciTE.properties b/3rdparty/bgfx/3rdparty/scintilla/test/unit/SciTE.properties
new file mode 100644
index 00000000000..cbbe2086215
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/SciTE.properties
@@ -0,0 +1,5 @@
+command.go.*.cxx=./unitTest
+if PLAT_WIN
+ make.command=mingw32-make
+ command.go.*.cxx=unitTest
+command.go.needs.$(file.patterns.cplusplus)=$(make.command)
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/catch.hpp b/3rdparty/bgfx/3rdparty/scintilla/test/unit/catch.hpp
new file mode 100644
index 00000000000..a8aec02d66b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/catch.hpp
@@ -0,0 +1,8734 @@
+/*
+ * CATCH v1.0 build 47 (master branch)
+ * Generated: 2014-05-20 19:02:15.946806
+ * ----------------------------------------------------------
+ * This file has been merged from multiple headers. Please don't edit it directly
+ * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
+ *
+ * Distributed under the Boost Software License, Version 1.0. (See accompanying
+ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
+#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
+
+#define TWOBLUECUBES_CATCH_HPP_INCLUDED
+
+// #included from: internal/catch_suppress_warnings.h
+
+#define TWOBLUECUBES_CATCH_SUPPRESS_WARNINGS_H_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#pragma clang diagnostic ignored "-Wvariadic-macros"
+#pragma clang diagnostic ignored "-Wc99-extensions"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#pragma clang diagnostic ignored "-Wc++98-compat"
+#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
+#endif
+
+#ifdef CATCH_CONFIG_MAIN
+# define CATCH_CONFIG_RUNNER
+#endif
+
+#ifdef CATCH_CONFIG_RUNNER
+# ifndef CLARA_CONFIG_MAIN
+# define CLARA_CONFIG_MAIN_NOT_DEFINED
+# define CLARA_CONFIG_MAIN
+# endif
+#endif
+
+// #included from: internal/catch_notimplemented_exception.h
+#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
+
+// #included from: catch_common.h
+#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
+
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
+#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
+
+#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
+#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
+
+#include <sstream>
+#include <stdexcept>
+#include <algorithm>
+
+// #included from: catch_compiler_capabilities.h
+#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
+
+// Much of the following code is based on Boost (1.53)
+
+#ifdef __clang__
+
+# if __has_feature(cxx_nullptr)
+# define CATCH_CONFIG_CPP11_NULLPTR
+# endif
+
+# if __has_feature(cxx_noexcept)
+# define CATCH_CONFIG_CPP11_NOEXCEPT
+# endif
+
+#endif // __clang__
+
+////////////////////////////////////////////////////////////////////////////////
+// Borland
+#ifdef __BORLANDC__
+
+#if (__BORLANDC__ > 0x582 )
+//#define CATCH_CONFIG_SFINAE // Not confirmed
+#endif
+
+#endif // __BORLANDC__
+
+////////////////////////////////////////////////////////////////////////////////
+// EDG
+#ifdef __EDG_VERSION__
+
+#if (__EDG_VERSION__ > 238 )
+//#define CATCH_CONFIG_SFINAE // Not confirmed
+#endif
+
+#endif // __EDG_VERSION__
+
+////////////////////////////////////////////////////////////////////////////////
+// Digital Mars
+#ifdef __DMC__
+
+#if (__DMC__ > 0x840 )
+//#define CATCH_CONFIG_SFINAE // Not confirmed
+#endif
+
+#endif // __DMC__
+
+////////////////////////////////////////////////////////////////////////////////
+// GCC
+#ifdef __GNUC__
+
+#if __GNUC__ < 3
+
+#if (__GNUC_MINOR__ >= 96 )
+//#define CATCH_CONFIG_SFINAE
+#endif
+
+#elif __GNUC__ >= 3
+
+// #define CATCH_CONFIG_SFINAE // Taking this out completely for now
+
+#endif // __GNUC__ < 3
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) )
+
+#define CATCH_CONFIG_CPP11_NULLPTR
+#endif
+
+#endif // __GNUC__
+
+////////////////////////////////////////////////////////////////////////////////
+// Visual C++
+#ifdef _MSC_VER
+
+#if (_MSC_VER >= 1310 ) // (VC++ 7.0+)
+//#define CATCH_CONFIG_SFINAE // Not confirmed
+#endif
+
+#endif // _MSC_VER
+
+// Use variadic macros if the compiler supports them
+#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \
+ ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \
+ ( defined __GNUC__ && __GNUC__ >= 3 ) || \
+ ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L )
+
+#ifndef CATCH_CONFIG_NO_VARIADIC_MACROS
+#define CATCH_CONFIG_VARIADIC_MACROS
+#endif
+
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// C++ language feature support
+
+// detect language version:
+#if (__cplusplus == 201103L)
+# define CATCH_CPP11
+# define CATCH_CPP11_OR_GREATER
+#elif (__cplusplus >= 201103L)
+# define CATCH_CPP11_OR_GREATER
+#endif
+
+// noexcept support:
+#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
+# define CATCH_NOEXCEPT noexcept
+# define CATCH_NOEXCEPT_IS(x) noexcept(x)
+#else
+# define CATCH_NOEXCEPT throw()
+# define CATCH_NOEXCEPT_IS(x)
+#endif
+
+namespace Catch {
+
+ class NonCopyable {
+ NonCopyable( NonCopyable const& );
+ void operator = ( NonCopyable const& );
+ protected:
+ NonCopyable() {}
+ virtual ~NonCopyable();
+ };
+
+ class SafeBool {
+ public:
+ typedef void (SafeBool::*type)() const;
+
+ static type makeSafe( bool value ) {
+ return value ? &SafeBool::trueValue : 0;
+ }
+ private:
+ void trueValue() const {}
+ };
+
+ template<typename ContainerT>
+ inline void deleteAll( ContainerT& container ) {
+ typename ContainerT::const_iterator it = container.begin();
+ typename ContainerT::const_iterator itEnd = container.end();
+ for(; it != itEnd; ++it )
+ delete *it;
+ }
+ template<typename AssociativeContainerT>
+ inline void deleteAllValues( AssociativeContainerT& container ) {
+ typename AssociativeContainerT::const_iterator it = container.begin();
+ typename AssociativeContainerT::const_iterator itEnd = container.end();
+ for(; it != itEnd; ++it )
+ delete it->second;
+ }
+
+ bool startsWith( std::string const& s, std::string const& prefix );
+ bool endsWith( std::string const& s, std::string const& suffix );
+ bool contains( std::string const& s, std::string const& infix );
+ void toLowerInPlace( std::string& s );
+ std::string toLower( std::string const& s );
+ std::string trim( std::string const& str );
+
+ struct pluralise {
+ pluralise( std::size_t count, std::string const& label );
+
+ friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
+
+ std::size_t m_count;
+ std::string m_label;
+ };
+
+ struct SourceLineInfo {
+
+ SourceLineInfo();
+ SourceLineInfo( char const* _file, std::size_t _line );
+ SourceLineInfo( SourceLineInfo const& other );
+# ifdef CATCH_CPP11_OR_GREATER
+ SourceLineInfo( SourceLineInfo && ) = default;
+ SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
+ SourceLineInfo& operator = ( SourceLineInfo && ) = default;
+# endif
+ bool empty() const;
+ bool operator == ( SourceLineInfo const& other ) const;
+
+ std::string file;
+ std::size_t line;
+ };
+
+ std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
+
+ // This is just here to avoid compiler warnings with macro constants and boolean literals
+ inline bool isTrue( bool value ){ return value; }
+
+ void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
+
+ // Use this in variadic streaming macros to allow
+ // >> +StreamEndStop
+ // as well as
+ // >> stuff +StreamEndStop
+ struct StreamEndStop {
+ std::string operator+() {
+ return std::string();
+ }
+ };
+ template<typename T>
+ T const& operator + ( T const& value, StreamEndStop ) {
+ return value;
+ }
+}
+
+#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
+#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
+
+#include <ostream>
+
+namespace Catch {
+
+ class NotImplementedException : public std::exception
+ {
+ public:
+ NotImplementedException( SourceLineInfo const& lineInfo );
+ NotImplementedException( NotImplementedException const& ) {}
+
+ virtual ~NotImplementedException() CATCH_NOEXCEPT {}
+
+ virtual const char* what() const CATCH_NOEXCEPT;
+
+ private:
+ std::string m_what;
+ SourceLineInfo m_lineInfo;
+ };
+
+} // end namespace Catch
+
+///////////////////////////////////////////////////////////////////////////////
+#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
+
+// #included from: internal/catch_context.h
+#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
+
+// #included from: catch_interfaces_generators.h
+#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct IGeneratorInfo {
+ virtual ~IGeneratorInfo();
+ virtual bool moveNext() = 0;
+ virtual std::size_t getCurrentIndex() const = 0;
+ };
+
+ struct IGeneratorsForTest {
+ virtual ~IGeneratorsForTest();
+
+ virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0;
+ virtual bool moveNext() = 0;
+ };
+
+ IGeneratorsForTest* createGeneratorsForTest();
+
+} // end namespace Catch
+
+// #included from: catch_ptr.hpp
+#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+namespace Catch {
+
+ // An intrusive reference counting smart pointer.
+ // T must implement addRef() and release() methods
+ // typically implementing the IShared interface
+ template<typename T>
+ class Ptr {
+ public:
+ Ptr() : m_p( NULL ){}
+ Ptr( T* p ) : m_p( p ){
+ if( m_p )
+ m_p->addRef();
+ }
+ Ptr( Ptr const& other ) : m_p( other.m_p ){
+ if( m_p )
+ m_p->addRef();
+ }
+ ~Ptr(){
+ if( m_p )
+ m_p->release();
+ }
+ void reset() {
+ if( m_p )
+ m_p->release();
+ m_p = NULL;
+ }
+ Ptr& operator = ( T* p ){
+ Ptr temp( p );
+ swap( temp );
+ return *this;
+ }
+ Ptr& operator = ( Ptr const& other ){
+ Ptr temp( other );
+ swap( temp );
+ return *this;
+ }
+ void swap( Ptr& other ) { std::swap( m_p, other.m_p ); }
+ T* get() { return m_p; }
+ const T* get() const{ return m_p; }
+ T& operator*() const { return *m_p; }
+ T* operator->() const { return m_p; }
+ bool operator !() const { return m_p == NULL; }
+ operator SafeBool::type() const { return SafeBool::makeSafe( m_p != NULL ); }
+
+ private:
+ T* m_p;
+ };
+
+ struct IShared : NonCopyable {
+ virtual ~IShared();
+ virtual void addRef() const = 0;
+ virtual void release() const = 0;
+ };
+
+ template<typename T = IShared>
+ struct SharedImpl : T {
+
+ SharedImpl() : m_rc( 0 ){}
+
+ virtual void addRef() const {
+ ++m_rc;
+ }
+ virtual void release() const {
+ if( --m_rc == 0 )
+ delete this;
+ }
+
+ mutable unsigned int m_rc;
+ };
+
+} // end namespace Catch
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#include <memory>
+#include <vector>
+#include <stdlib.h>
+
+namespace Catch {
+
+ class TestCase;
+ class Stream;
+ struct IResultCapture;
+ struct IRunner;
+ struct IGeneratorsForTest;
+ struct IConfig;
+
+ struct IContext
+ {
+ virtual ~IContext();
+
+ virtual IResultCapture* getResultCapture() = 0;
+ virtual IRunner* getRunner() = 0;
+ virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0;
+ virtual bool advanceGeneratorsForCurrentTest() = 0;
+ virtual Ptr<IConfig const> getConfig() const = 0;
+ };
+
+ struct IMutableContext : IContext
+ {
+ virtual ~IMutableContext();
+ virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
+ virtual void setRunner( IRunner* runner ) = 0;
+ virtual void setConfig( Ptr<IConfig const> const& config ) = 0;
+ };
+
+ IContext& getCurrentContext();
+ IMutableContext& getCurrentMutableContext();
+ void cleanUpContext();
+ Stream createStream( std::string const& streamName );
+
+}
+
+// #included from: internal/catch_test_registry.hpp
+#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
+
+// #included from: catch_interfaces_testcase.h
+#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
+
+#include <vector>
+
+namespace Catch {
+
+ class TestSpec;
+
+ struct ITestCase : IShared {
+ virtual void invoke () const = 0;
+ protected:
+ virtual ~ITestCase();
+ };
+
+ class TestCase;
+ struct IConfig;
+
+ struct ITestCaseRegistry {
+ virtual ~ITestCaseRegistry();
+ virtual std::vector<TestCase> const& getAllTests() const = 0;
+ virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector<TestCase>& matchingTestCases ) const = 0;
+
+ };
+}
+
+namespace Catch {
+
+template<typename C>
+class MethodTestCase : public SharedImpl<ITestCase> {
+
+public:
+ MethodTestCase( void (C::*method)() ) : m_method( method ) {}
+
+ virtual void invoke() const {
+ C obj;
+ (obj.*m_method)();
+ }
+
+private:
+ virtual ~MethodTestCase() {}
+
+ void (C::*m_method)();
+};
+
+typedef void(*TestFunction)();
+
+struct NameAndDesc {
+ NameAndDesc( const char* _name = "", const char* _description= "" )
+ : name( _name ), description( _description )
+ {}
+
+ const char* name;
+ const char* description;
+};
+
+struct AutoReg {
+
+ AutoReg( TestFunction function,
+ SourceLineInfo const& lineInfo,
+ NameAndDesc const& nameAndDesc );
+
+ template<typename C>
+ AutoReg( void (C::*method)(),
+ char const* className,
+ NameAndDesc const& nameAndDesc,
+ SourceLineInfo const& lineInfo ) {
+ registerTestCase( new MethodTestCase<C>( method ),
+ className,
+ nameAndDesc,
+ lineInfo );
+ }
+
+ void registerTestCase( ITestCase* testCase,
+ char const* className,
+ NameAndDesc const& nameAndDesc,
+ SourceLineInfo const& lineInfo );
+
+ ~AutoReg();
+
+private:
+ AutoReg( AutoReg const& );
+ void operator= ( AutoReg const& );
+};
+
+} // end namespace Catch
+
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TESTCASE( ... ) \
+ static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\
+ static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )()
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\
+ namespace{ \
+ struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \
+ void test(); \
+ }; \
+ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \
+ } \
+ void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test()
+
+#else
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \
+ static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\
+ static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )()
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\
+ namespace{ \
+ struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \
+ void test(); \
+ }; \
+ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \
+ } \
+ void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test()
+
+#endif
+
+// #included from: internal/catch_capture.hpp
+#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
+
+// #included from: catch_expression_decomposer.hpp
+#define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED
+
+// #included from: catch_expression_lhs.hpp
+#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
+
+// #included from: catch_expressionresult_builder.h
+#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_BUILDER_H_INCLUDED
+
+// #included from: catch_tostring.h
+#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
+
+// #included from: catch_sfinae.hpp
+#define TWOBLUECUBES_CATCH_SFINAE_HPP_INCLUDED
+
+// Try to detect if the current compiler supports SFINAE
+
+namespace Catch {
+
+ struct TrueType {
+ static const bool value = true;
+ typedef void Enable;
+ char sizer[1];
+ };
+ struct FalseType {
+ static const bool value = false;
+ typedef void Disable;
+ char sizer[2];
+ };
+
+#ifdef CATCH_CONFIG_SFINAE
+
+ template<bool> struct NotABooleanExpression;
+
+ template<bool c> struct If : NotABooleanExpression<c> {};
+ template<> struct If<true> : TrueType {};
+ template<> struct If<false> : FalseType {};
+
+ template<int size> struct SizedIf;
+ template<> struct SizedIf<sizeof(TrueType)> : TrueType {};
+ template<> struct SizedIf<sizeof(FalseType)> : FalseType {};
+
+#endif // CATCH_CONFIG_SFINAE
+
+} // end namespace Catch
+
+#include <sstream>
+#include <iomanip>
+#include <limits>
+#include <vector>
+#include <cstddef>
+
+#ifdef __OBJC__
+// #included from: catch_objc_arc.hpp
+#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
+
+#import <Foundation/Foundation.h>
+
+#ifdef __has_feature
+#define CATCH_ARC_ENABLED __has_feature(objc_arc)
+#else
+#define CATCH_ARC_ENABLED 0
+#endif
+
+void arcSafeRelease( NSObject* obj );
+id performOptionalSelector( id obj, SEL sel );
+
+#if !CATCH_ARC_ENABLED
+inline void arcSafeRelease( NSObject* obj ) {
+ [obj release];
+}
+inline id performOptionalSelector( id obj, SEL sel ) {
+ if( [obj respondsToSelector: sel] )
+ return [obj performSelector: sel];
+ return nil;
+}
+#define CATCH_UNSAFE_UNRETAINED
+#define CATCH_ARC_STRONG
+#else
+inline void arcSafeRelease( NSObject* ){}
+inline id performOptionalSelector( id obj, SEL sel ) {
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+#endif
+ if( [obj respondsToSelector: sel] )
+ return [obj performSelector: sel];
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+ return nil;
+}
+#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
+#define CATCH_ARC_STRONG __strong
+#endif
+
+#endif
+
+namespace Catch {
+namespace Detail {
+
+// SFINAE is currently disabled by default for all compilers.
+// If the non SFINAE version of IsStreamInsertable is ambiguous for you
+// and your compiler supports SFINAE, try #defining CATCH_CONFIG_SFINAE
+#ifdef CATCH_CONFIG_SFINAE
+
+ template<typename T>
+ class IsStreamInsertableHelper {
+ template<int N> struct TrueIfSizeable : TrueType {};
+
+ template<typename T2>
+ static TrueIfSizeable<sizeof((*(std::ostream*)0) << *((T2 const*)0))> dummy(T2*);
+ static FalseType dummy(...);
+
+ public:
+ typedef SizedIf<sizeof(dummy((T*)0))> type;
+ };
+
+ template<typename T>
+ struct IsStreamInsertable : IsStreamInsertableHelper<T>::type {};
+
+#else
+
+ struct BorgType {
+ template<typename T> BorgType( T const& );
+ };
+
+ TrueType& testStreamable( std::ostream& );
+ FalseType testStreamable( FalseType );
+
+ FalseType operator<<( std::ostream const&, BorgType const& );
+
+ template<typename T>
+ struct IsStreamInsertable {
+ static std::ostream &s;
+ static T const&t;
+ enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) };
+ };
+
+#endif
+
+ template<bool C>
+ struct StringMakerBase {
+ template<typename T>
+ static std::string convert( T const& ) { return "{?}"; }
+ };
+
+ template<>
+ struct StringMakerBase<true> {
+ template<typename T>
+ static std::string convert( T const& _value ) {
+ std::ostringstream oss;
+ oss << _value;
+ return oss.str();
+ }
+ };
+
+ struct Endianness {
+ enum Arch { Big, Little };
+
+ static Arch which() {
+ union _{
+ int asInt;
+ char asChar[sizeof (int)];
+ } u;
+
+ u.asInt = 1;
+ return ( u.asChar[sizeof(int)-1] == 1 ) ? Big : Little;
+ }
+ };
+
+ // Writes the raw memory into a string, considering endianness
+ template<typename T>
+ std::string rawMemoryToString( T value ) {
+ union _ {
+ T typedValue;
+ unsigned char bytes[sizeof(T)];
+ } u;
+
+ u.typedValue = value;
+
+ std::ostringstream oss;
+ oss << "0x";
+
+ int i = 0, end = sizeof(T), inc = 1;
+ if( Endianness::which() == Endianness::Little ) {
+ i = end-1;
+ end = inc = -1;
+ }
+ for( ; i != end; i += inc )
+ oss << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)u.bytes[i];
+ return oss.str();
+ }
+
+} // end namespace Detail
+
+template<typename T>
+std::string toString( T const& value );
+
+template<typename T>
+struct StringMaker :
+ Detail::StringMakerBase<Detail::IsStreamInsertable<T>::value> {};
+
+template<typename T>
+struct StringMaker<T*> {
+ template<typename U>
+ static std::string convert( U* p ) {
+ if( !p )
+ return INTERNAL_CATCH_STRINGIFY( NULL );
+ else
+ return Detail::rawMemoryToString( p );
+ }
+};
+
+template<typename R, typename C>
+struct StringMaker<R C::*> {
+ static std::string convert( R C::* p ) {
+ if( !p )
+ return INTERNAL_CATCH_STRINGIFY( NULL );
+ else
+ return Detail::rawMemoryToString( p );
+ }
+};
+
+namespace Detail {
+ template<typename InputIterator>
+ std::string rangeToString( InputIterator first, InputIterator last );
+}
+
+template<typename T, typename Allocator>
+struct StringMaker<std::vector<T, Allocator> > {
+ static std::string convert( std::vector<T,Allocator> const& v ) {
+ return Detail::rangeToString( v.begin(), v.end() );
+ }
+};
+
+namespace Detail {
+ template<typename T>
+ std::string makeString( T const& value ) {
+ return StringMaker<T>::convert( value );
+ }
+} // end namespace Detail
+
+/// \brief converts any type to a string
+///
+/// The default template forwards on to ostringstream - except when an
+/// ostringstream overload does not exist - in which case it attempts to detect
+/// that and writes {?}.
+/// Overload (not specialise) this template for custom typs that you don't want
+/// to provide an ostream overload for.
+template<typename T>
+std::string toString( T const& value ) {
+ return StringMaker<T>::convert( value );
+}
+
+// Built in overloads
+
+std::string toString( std::string const& value );
+std::string toString( std::wstring const& value );
+std::string toString( const char* const value );
+std::string toString( char* const value );
+std::string toString( int value );
+std::string toString( unsigned long value );
+std::string toString( unsigned int value );
+std::string toString( const double value );
+std::string toString( bool value );
+std::string toString( char value );
+std::string toString( signed char value );
+std::string toString( unsigned char value );
+
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
+std::string toString( std::nullptr_t );
+#endif
+
+#ifdef __OBJC__
+ std::string toString( NSString const * const& nsstring );
+ std::string toString( NSString * CATCH_ARC_STRONG const& nsstring );
+ std::string toString( NSObject* const& nsObject );
+#endif
+
+ namespace Detail {
+ template<typename InputIterator>
+ std::string rangeToString( InputIterator first, InputIterator last ) {
+ std::ostringstream oss;
+ oss << "{ ";
+ if( first != last ) {
+ oss << toString( *first );
+ for( ++first ; first != last ; ++first ) {
+ oss << ", " << toString( *first );
+ }
+ }
+ oss << " }";
+ return oss.str();
+ }
+}
+
+} // end namespace Catch
+
+// #included from: catch_assertionresult.h
+#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
+
+#include <string>
+// #included from: catch_result_type.h
+#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
+
+namespace Catch {
+
+ // ResultWas::OfType enum
+ struct ResultWas { enum OfType {
+ Unknown = -1,
+ Ok = 0,
+ Info = 1,
+ Warning = 2,
+
+ FailureBit = 0x10,
+
+ ExpressionFailed = FailureBit | 1,
+ ExplicitFailure = FailureBit | 2,
+
+ Exception = 0x100 | FailureBit,
+
+ ThrewException = Exception | 1,
+ DidntThrowException = Exception | 2
+
+ }; };
+
+ inline bool isOk( ResultWas::OfType resultType ) {
+ return ( resultType & ResultWas::FailureBit ) == 0;
+ }
+ inline bool isJustInfo( int flags ) {
+ return flags == ResultWas::Info;
+ }
+
+ // ResultAction::Value enum
+ struct ResultAction { enum Value {
+ None,
+ Failed = 1, // Failure - but no debug break if Debug bit not set
+ Debug = 2, // If this bit is set, invoke the debugger
+ Abort = 4 // Test run should abort
+ }; };
+
+ // ResultDisposition::Flags enum
+ struct ResultDisposition { enum Flags {
+ Normal = 0x00,
+
+ ContinueOnFailure = 0x01, // Failures fail test, but execution continues
+ NegateResult = 0x02, // Prefix expressiom with !
+ SuppressFail = 0x04 // Failures are reported but do not fail the test
+ }; };
+
+ inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
+ return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
+ }
+
+ inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
+ inline bool shouldNegate( int flags ) { return ( flags & ResultDisposition::NegateResult ) != 0; }
+ inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
+
+} // end namespace Catch
+
+
+namespace Catch {
+
+ struct AssertionInfo
+ {
+ AssertionInfo() {}
+ AssertionInfo( std::string const& _macroName,
+ SourceLineInfo const& _lineInfo,
+ std::string const& _capturedExpression,
+ ResultDisposition::Flags _resultDisposition );
+
+ std::string macroName;
+ SourceLineInfo lineInfo;
+ std::string capturedExpression;
+ ResultDisposition::Flags resultDisposition;
+ };
+
+ struct AssertionResultData
+ {
+ AssertionResultData() : resultType( ResultWas::Unknown ) {}
+
+ std::string reconstructedExpression;
+ std::string message;
+ ResultWas::OfType resultType;
+ };
+
+ class AssertionResult {
+ public:
+ AssertionResult();
+ AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
+ ~AssertionResult();
+# ifdef CATCH_CPP11_OR_GREATER
+ AssertionResult( AssertionResult const& ) = default;
+ AssertionResult( AssertionResult && ) = default;
+ AssertionResult& operator = ( AssertionResult const& ) = default;
+ AssertionResult& operator = ( AssertionResult && ) = default;
+# endif
+
+ bool isOk() const;
+ bool succeeded() const;
+ ResultWas::OfType getResultType() const;
+ bool hasExpression() const;
+ bool hasMessage() const;
+ std::string getExpression() const;
+ std::string getExpressionInMacro() const;
+ bool hasExpandedExpression() const;
+ std::string getExpandedExpression() const;
+ std::string getMessage() const;
+ SourceLineInfo getSourceInfo() const;
+ std::string getTestMacroName() const;
+
+ protected:
+ AssertionInfo m_info;
+ AssertionResultData m_resultData;
+ };
+
+} // end namespace Catch
+
+// #included from: catch_evaluate.hpp
+#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
+#endif
+
+#include <cstddef>
+
+namespace Catch {
+namespace Internal {
+
+ enum Operator {
+ IsEqualTo,
+ IsNotEqualTo,
+ IsLessThan,
+ IsGreaterThan,
+ IsLessThanOrEqualTo,
+ IsGreaterThanOrEqualTo
+ };
+
+ template<Operator Op> struct OperatorTraits { static const char* getName(){ return "*error*"; } };
+ template<> struct OperatorTraits<IsEqualTo> { static const char* getName(){ return "=="; } };
+ template<> struct OperatorTraits<IsNotEqualTo> { static const char* getName(){ return "!="; } };
+ template<> struct OperatorTraits<IsLessThan> { static const char* getName(){ return "<"; } };
+ template<> struct OperatorTraits<IsGreaterThan> { static const char* getName(){ return ">"; } };
+ template<> struct OperatorTraits<IsLessThanOrEqualTo> { static const char* getName(){ return "<="; } };
+ template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
+
+ template<typename T>
+ inline T& opCast(T const& t) { return const_cast<T&>(t); }
+
+// nullptr_t support based on pull request #154 from Konstantin Baumann
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
+ inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; }
+#endif // CATCH_CONFIG_CPP11_NULLPTR
+
+ // So the compare overloads can be operator agnostic we convey the operator as a template
+ // enum, which is used to specialise an Evaluator for doing the comparison.
+ template<typename T1, typename T2, Operator Op>
+ class Evaluator{};
+
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsEqualTo> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs) {
+ return opCast( lhs ) == opCast( rhs );
+ }
+ };
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsNotEqualTo> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs ) {
+ return opCast( lhs ) != opCast( rhs );
+ }
+ };
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsLessThan> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs ) {
+ return opCast( lhs ) < opCast( rhs );
+ }
+ };
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsGreaterThan> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs ) {
+ return opCast( lhs ) > opCast( rhs );
+ }
+ };
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs ) {
+ return opCast( lhs ) >= opCast( rhs );
+ }
+ };
+ template<typename T1, typename T2>
+ struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
+ static bool evaluate( T1 const& lhs, T2 const& rhs ) {
+ return opCast( lhs ) <= opCast( rhs );
+ }
+ };
+
+ template<Operator Op, typename T1, typename T2>
+ bool applyEvaluator( T1 const& lhs, T2 const& rhs ) {
+ return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
+ }
+
+ // This level of indirection allows us to specialise for integer types
+ // to avoid signed/ unsigned warnings
+
+ // "base" overload
+ template<Operator Op, typename T1, typename T2>
+ bool compare( T1 const& lhs, T2 const& rhs ) {
+ return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
+ }
+
+ // unsigned X to int
+ template<Operator Op> bool compare( unsigned int lhs, int rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
+ }
+ template<Operator Op> bool compare( unsigned long lhs, int rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
+ }
+ template<Operator Op> bool compare( unsigned char lhs, int rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
+ }
+
+ // unsigned X to long
+ template<Operator Op> bool compare( unsigned int lhs, long rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
+ }
+ template<Operator Op> bool compare( unsigned long lhs, long rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
+ }
+ template<Operator Op> bool compare( unsigned char lhs, long rhs ) {
+ return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
+ }
+
+ // int to unsigned X
+ template<Operator Op> bool compare( int lhs, unsigned int rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
+ }
+ template<Operator Op> bool compare( int lhs, unsigned long rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
+ }
+ template<Operator Op> bool compare( int lhs, unsigned char rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
+ }
+
+ // long to unsigned X
+ template<Operator Op> bool compare( long lhs, unsigned int rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
+ }
+ template<Operator Op> bool compare( long lhs, unsigned long rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
+ }
+ template<Operator Op> bool compare( long lhs, unsigned char rhs ) {
+ return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
+ }
+
+ // pointer to long (when comparing against NULL)
+ template<Operator Op, typename T> bool compare( long lhs, T* rhs ) {
+ return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
+ }
+ template<Operator Op, typename T> bool compare( T* lhs, long rhs ) {
+ return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
+ }
+
+ // pointer to int (when comparing against NULL)
+ template<Operator Op, typename T> bool compare( int lhs, T* rhs ) {
+ return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
+ }
+ template<Operator Op, typename T> bool compare( T* lhs, int rhs ) {
+ return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
+ }
+
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
+ // pointer to nullptr_t (when comparing against nullptr)
+ template<Operator Op, typename T> bool compare( std::nullptr_t, T* rhs ) {
+ return Evaluator<T*, T*, Op>::evaluate( NULL, rhs );
+ }
+ template<Operator Op, typename T> bool compare( T* lhs, std::nullptr_t ) {
+ return Evaluator<T*, T*, Op>::evaluate( lhs, NULL );
+ }
+#endif // CATCH_CONFIG_CPP11_NULLPTR
+
+} // end of namespace Internal
+} // end of namespace Catch
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+namespace Catch {
+
+struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
+
+// Wraps the (stringised versions of) the lhs, operator and rhs of an expression - as well as
+// the result of evaluating it. This is used to build an AssertionResult object
+class ExpressionResultBuilder {
+public:
+
+ ExpressionResultBuilder( ResultWas::OfType resultType = ResultWas::Unknown );
+ ExpressionResultBuilder( ExpressionResultBuilder const& other );
+ ExpressionResultBuilder& operator=(ExpressionResultBuilder const& other );
+
+ ExpressionResultBuilder& setResultType( ResultWas::OfType result );
+ ExpressionResultBuilder& setResultType( bool result );
+ ExpressionResultBuilder& setLhs( std::string const& lhs );
+ ExpressionResultBuilder& setRhs( std::string const& rhs );
+ ExpressionResultBuilder& setOp( std::string const& op );
+
+ ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition );
+
+ template<typename T>
+ ExpressionResultBuilder& operator << ( T const& value ) {
+ m_stream << value;
+ return *this;
+ }
+
+ std::string reconstructExpression( AssertionInfo const& info ) const;
+
+ AssertionResult buildResult( AssertionInfo const& info ) const;
+
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& );
+
+private:
+ AssertionResultData m_data;
+ struct ExprComponents {
+ ExprComponents() : shouldNegate( false ) {}
+ bool shouldNegate;
+ std::string lhs, rhs, op;
+ } m_exprComponents;
+ std::ostringstream m_stream;
+};
+
+} // end namespace Catch
+
+namespace Catch {
+
+// Wraps the LHS of an expression and captures the operator and RHS (if any) -
+// wrapping them all in an ExpressionResultBuilder object
+template<typename T>
+class ExpressionLhs {
+ ExpressionLhs& operator = ( ExpressionLhs const& );
+# ifdef CATCH_CPP11_OR_GREATER
+ ExpressionLhs& operator = ( ExpressionLhs && ) = delete;
+# endif
+
+public:
+ ExpressionLhs( T lhs ) : m_lhs( lhs ) {}
+# ifdef CATCH_CPP11_OR_GREATER
+ ExpressionLhs( ExpressionLhs const& ) = default;
+ ExpressionLhs( ExpressionLhs && ) = default;
+# endif
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator == ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsEqualTo>( rhs );
+ }
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator != ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsNotEqualTo>( rhs );
+ }
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator < ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsLessThan>( rhs );
+ }
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator > ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsGreaterThan>( rhs );
+ }
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator <= ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
+ }
+
+ template<typename RhsT>
+ ExpressionResultBuilder& operator >= ( RhsT const& rhs ) {
+ return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
+ }
+
+ ExpressionResultBuilder& operator == ( bool rhs ) {
+ return captureExpression<Internal::IsEqualTo>( rhs );
+ }
+
+ ExpressionResultBuilder& operator != ( bool rhs ) {
+ return captureExpression<Internal::IsNotEqualTo>( rhs );
+ }
+
+ ExpressionResultBuilder& endExpression( ResultDisposition::Flags resultDisposition ) {
+ bool value = m_lhs ? true : false;
+ return m_result
+ .setLhs( Catch::toString( value ) )
+ .setResultType( value )
+ .endExpression( resultDisposition );
+ }
+
+ // Only simple binary expressions are allowed on the LHS.
+ // If more complex compositions are required then place the sub expression in parentheses
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& );
+ template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& );
+
+private:
+ template<Internal::Operator Op, typename RhsT>
+ ExpressionResultBuilder& captureExpression( RhsT const& rhs ) {
+ return m_result
+ .setResultType( Internal::compare<Op>( m_lhs, rhs ) )
+ .setLhs( Catch::toString( m_lhs ) )
+ .setRhs( Catch::toString( rhs ) )
+ .setOp( Internal::OperatorTraits<Op>::getName() );
+ }
+
+private:
+ ExpressionResultBuilder m_result;
+ T m_lhs;
+};
+
+} // end namespace Catch
+
+namespace Catch {
+
+// Captures the LHS of the expression and wraps it in an Expression Lhs object
+class ExpressionDecomposer {
+public:
+
+ template<typename T>
+ ExpressionLhs<T const&> operator->* ( T const& operand ) {
+ return ExpressionLhs<T const&>( operand );
+ }
+
+ ExpressionLhs<bool> operator->* ( bool value ) {
+ return ExpressionLhs<bool>( value );
+ }
+};
+
+} // end namespace Catch
+
+// #included from: catch_message.h
+#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct MessageInfo {
+ MessageInfo( std::string const& _macroName,
+ SourceLineInfo const& _lineInfo,
+ ResultWas::OfType _type );
+
+ std::string macroName;
+ SourceLineInfo lineInfo;
+ ResultWas::OfType type;
+ std::string message;
+ unsigned int sequence;
+
+ bool operator == ( MessageInfo const& other ) const {
+ return sequence == other.sequence;
+ }
+ bool operator < ( MessageInfo const& other ) const {
+ return sequence < other.sequence;
+ }
+ private:
+ static unsigned int globalCount;
+ };
+
+ struct MessageBuilder {
+ MessageBuilder( std::string const& macroName,
+ SourceLineInfo const& lineInfo,
+ ResultWas::OfType type )
+ : m_info( macroName, lineInfo, type )
+ {}
+
+ template<typename T>
+ MessageBuilder& operator << ( T const& value ) {
+ m_stream << value;
+ return *this;
+ }
+
+ MessageInfo m_info;
+ std::ostringstream m_stream;
+ };
+
+ class ScopedMessage {
+ public:
+ ScopedMessage( MessageBuilder const& builder );
+ ScopedMessage( ScopedMessage const& other );
+ ~ScopedMessage();
+
+ MessageInfo m_info;
+ };
+
+} // end namespace Catch
+
+// #included from: catch_interfaces_capture.h
+#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ class TestCase;
+ class ExpressionResultBuilder;
+ class AssertionResult;
+ struct AssertionInfo;
+ struct SectionInfo;
+ struct MessageInfo;
+ class ScopedMessageBuilder;
+ struct Counts;
+
+ struct IResultCapture {
+
+ virtual ~IResultCapture();
+
+ virtual void assertionEnded( AssertionResult const& result ) = 0;
+ virtual bool sectionStarted( SectionInfo const& sectionInfo,
+ Counts& assertions ) = 0;
+ virtual void sectionEnded( SectionInfo const& name, Counts const& assertions, double _durationInSeconds ) = 0;
+ virtual void pushScopedMessage( MessageInfo const& message ) = 0;
+ virtual void popScopedMessage( MessageInfo const& message ) = 0;
+
+ virtual bool shouldDebugBreak() const = 0;
+
+ virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) = 0;
+
+ virtual std::string getCurrentTestName() const = 0;
+ virtual const AssertionResult* getLastResult() const = 0;
+ };
+}
+
+// #included from: catch_debugger.h
+#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED
+
+// #included from: catch_platform.h
+#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
+
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+#define CATCH_PLATFORM_MAC
+#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+#define CATCH_PLATFORM_IPHONE
+#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
+#define CATCH_PLATFORM_WINDOWS
+#endif
+
+#include <string>
+
+namespace Catch{
+
+ bool isDebuggerActive();
+ void writeToDebugConsole( std::string const& text );
+}
+
+#ifdef CATCH_PLATFORM_MAC
+
+ // The following code snippet based on:
+ // http://cocoawithlove.com/2008/03/break-into-debugger.html
+ #ifdef DEBUG
+ #if defined(__ppc64__) || defined(__ppc__)
+ #define CATCH_BREAK_INTO_DEBUGGER() \
+ if( Catch::isDebuggerActive() ) { \
+ __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
+ : : : "memory","r0","r3","r4" ); \
+ }
+ #else
+ #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) {__asm__("int $3\n" : : );}
+ #endif
+ #endif
+
+#elif defined(_MSC_VER)
+ #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { __debugbreak(); }
+#elif defined(__MINGW32__)
+ extern "C" __declspec(dllimport) void __stdcall DebugBreak();
+ #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { DebugBreak(); }
+#endif
+
+#ifndef CATCH_BREAK_INTO_DEBUGGER
+#define CATCH_BREAK_INTO_DEBUGGER() Catch::isTrue( true );
+#endif
+
+// #included from: catch_interfaces_registry_hub.h
+#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ class TestCase;
+ struct ITestCaseRegistry;
+ struct IExceptionTranslatorRegistry;
+ struct IExceptionTranslator;
+ struct IReporterRegistry;
+ struct IReporterFactory;
+
+ struct IRegistryHub {
+ virtual ~IRegistryHub();
+
+ virtual IReporterRegistry const& getReporterRegistry() const = 0;
+ virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
+ virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0;
+ };
+
+ struct IMutableRegistryHub {
+ virtual ~IMutableRegistryHub();
+ virtual void registerReporter( std::string const& name, IReporterFactory* factory ) = 0;
+ virtual void registerTest( TestCase const& testInfo ) = 0;
+ virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
+ };
+
+ IRegistryHub& getRegistryHub();
+ IMutableRegistryHub& getMutableRegistryHub();
+ void cleanUp();
+ std::string translateActiveException();
+
+}
+
+// #included from: catch_interfaces_config.h
+#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ struct Verbosity { enum Level {
+ NoOutput = 0,
+ Quiet,
+ Normal
+ }; };
+
+ struct WarnAbout { enum What {
+ Nothing = 0x00,
+ NoAssertions = 0x01
+ }; };
+
+ struct ShowDurations { enum OrNot {
+ DefaultForReporter,
+ Always,
+ Never
+ }; };
+
+ class TestSpec;
+
+ struct IConfig : IShared {
+
+ virtual ~IConfig();
+
+ virtual bool allowThrows() const = 0;
+ virtual std::ostream& stream() const = 0;
+ virtual std::string name() const = 0;
+ virtual bool includeSuccessfulResults() const = 0;
+ virtual bool shouldDebugBreak() const = 0;
+ virtual bool warnAboutMissingAssertions() const = 0;
+ virtual int abortAfter() const = 0;
+ virtual bool showInvisibles() const = 0;
+ virtual ShowDurations::OrNot showDurations() const = 0;
+ virtual TestSpec const& testSpec() const = 0;
+ };
+}
+
+#include <ostream>
+
+namespace Catch {
+
+ inline IResultCapture& getResultCapture() {
+ if( IResultCapture* capture = getCurrentContext().getResultCapture() )
+ return *capture;
+ else
+ throw std::logic_error( "No result capture instance" );
+ }
+
+ template<typename MatcherT>
+ ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
+ std::string const& matcherCallAsString ) {
+ std::string matcherAsString = matcher.toString();
+ if( matcherAsString == "{?}" )
+ matcherAsString = matcherCallAsString;
+ return ExpressionResultBuilder()
+ .setRhs( matcherAsString )
+ .setOp( "matches" );
+ }
+
+ template<typename MatcherT, typename ArgT>
+ ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
+ ArgT const& arg,
+ std::string const& matcherCallAsString ) {
+ return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
+ .setLhs( Catch::toString( arg ) )
+ .setResultType( matcher.match( arg ) );
+ }
+
+ template<typename MatcherT, typename ArgT>
+ ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
+ ArgT* arg,
+ std::string const& matcherCallAsString ) {
+ return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
+ .setLhs( Catch::toString( arg ) )
+ .setResultType( matcher.match( arg ) );
+ }
+
+struct TestFailureException{};
+
+} // end namespace Catch
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_ACCEPT_EXPR( evaluatedExpr, resultDisposition, originalExpr ) \
+ if( Catch::ResultAction::Value internal_catch_action = Catch::getResultCapture().acceptExpression( evaluatedExpr, __assertionInfo ) ) { \
+ if( internal_catch_action & Catch::ResultAction::Debug ) CATCH_BREAK_INTO_DEBUGGER(); \
+ if( internal_catch_action & Catch::ResultAction::Abort ) throw Catch::TestFailureException(); \
+ if( !Catch::shouldContinueOnFailure( resultDisposition ) ) throw Catch::TestFailureException(); \
+ Catch::isTrue( false && originalExpr ); \
+ }
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
+ try { \
+ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).endExpression( resultDisposition ), resultDisposition, expr ); \
+ } catch( Catch::TestFailureException& ) { \
+ throw; \
+ } catch( ... ) { \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), \
+ Catch::ResultDisposition::Normal, expr ); \
+ } \
+ } while( Catch::isTrue( false ) )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \
+ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
+ if( Catch::getResultCapture().getLastResult()->succeeded() )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \
+ INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
+ if( !Catch::getResultCapture().getLastResult()->succeeded() )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
+ try { \
+ expr; \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
+ } \
+ catch( ... ) { \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException(), resultDisposition, false ); \
+ } \
+} while( Catch::isTrue( false ) )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
+ try { \
+ if( Catch::getCurrentContext().getConfig()->allowThrows() ) { \
+ expr; \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::DidntThrowException ), resultDisposition, false ); \
+ } \
+ } \
+ catch( Catch::TestFailureException& ) { \
+ throw; \
+ } \
+ catch( exceptionType ) { \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( Catch::ResultWas::Ok ), resultDisposition, false ); \
+ }
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS( expr, exceptionType, resultDisposition, macroName ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
+ INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
+ } while( Catch::isTrue( false ) )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
+ INTERNAL_CATCH_THROWS_IMPL( expr, exceptionType, resultDisposition ) \
+ catch( ... ) { \
+ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \
+ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \
+ } \
+ } while( Catch::isTrue( false ) )
+
+///////////////////////////////////////////////////////////////////////////////
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+ #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << __VA_ARGS__ +::Catch::StreamEndStop(), resultDisposition, true ) \
+ } while( Catch::isTrue( false ) )
+#else
+ #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
+ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \
+ } while( Catch::isTrue( false ) )
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_INFO( log, macroName ) \
+ Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log;
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \
+ do { \
+ Catch::AssertionInfo __assertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \
+ try { \
+ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::expressionResultBuilderFromMatcher( ::Catch::Matchers::matcher, arg, #matcher ) ), resultDisposition, false ); \
+ } catch( Catch::TestFailureException& ) { \
+ throw; \
+ } catch( ... ) { \
+ INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionResultBuilder( Catch::ResultWas::ThrewException ) << Catch::translateActiveException() ), \
+ resultDisposition | Catch::ResultDisposition::ContinueOnFailure, false ); \
+ } \
+ } while( Catch::isTrue( false ) )
+
+// #included from: internal/catch_section.h
+#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
+
+// #included from: catch_section_info.h
+#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
+
+namespace Catch {
+
+ struct SectionInfo {
+ SectionInfo( std::string const& _name,
+ std::string const& _description,
+ SourceLineInfo const& _lineInfo )
+ : name( _name ),
+ description( _description ),
+ lineInfo( _lineInfo )
+ {}
+
+ std::string name;
+ std::string description;
+ SourceLineInfo lineInfo;
+ };
+
+} // end namespace Catch
+
+// #included from: catch_totals.hpp
+#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
+
+#include <cstddef>
+
+namespace Catch {
+
+ struct Counts {
+ Counts() : passed( 0 ), failed( 0 ) {}
+
+ Counts operator - ( Counts const& other ) const {
+ Counts diff;
+ diff.passed = passed - other.passed;
+ diff.failed = failed - other.failed;
+ return diff;
+ }
+ Counts& operator += ( Counts const& other ) {
+ passed += other.passed;
+ failed += other.failed;
+ return *this;
+ }
+
+ std::size_t total() const {
+ return passed + failed;
+ }
+
+ std::size_t passed;
+ std::size_t failed;
+ };
+
+ struct Totals {
+
+ Totals operator - ( Totals const& other ) const {
+ Totals diff;
+ diff.assertions = assertions - other.assertions;
+ diff.testCases = testCases - other.testCases;
+ return diff;
+ }
+
+ Totals delta( Totals const& prevTotals ) const {
+ Totals diff = *this - prevTotals;
+ if( diff.assertions.failed > 0 )
+ ++diff.testCases.failed;
+ else
+ ++diff.testCases.passed;
+ return diff;
+ }
+
+ Totals& operator += ( Totals const& other ) {
+ assertions += other.assertions;
+ testCases += other.testCases;
+ return *this;
+ }
+
+ Counts assertions;
+ Counts testCases;
+ };
+}
+
+// #included from: catch_timer.h
+#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
+
+#ifdef CATCH_PLATFORM_WINDOWS
+typedef unsigned long long uint64_t;
+#else
+#include <stdint.h>
+#endif
+
+namespace Catch {
+
+ class Timer {
+ public:
+ Timer() : m_ticks( 0 ) {}
+ void start();
+ unsigned int getElapsedNanoseconds() const;
+ unsigned int getElapsedMilliseconds() const;
+ double getElapsedSeconds() const;
+
+ private:
+ uint64_t m_ticks;
+ };
+
+} // namespace Catch
+
+#include <string>
+
+namespace Catch {
+
+ class Section {
+ public:
+ Section( SourceLineInfo const& lineInfo,
+ std::string const& name,
+ std::string const& description = "" );
+ ~Section();
+# ifdef CATCH_CPP11_OR_GREATER
+ Section( Section const& ) = default;
+ Section( Section && ) = default;
+ Section& operator = ( Section const& ) = default;
+ Section& operator = ( Section && ) = default;
+# endif
+
+ // This indicates whether the section should be executed or not
+ operator bool();
+
+ private:
+
+ SectionInfo m_info;
+
+ std::string m_name;
+ Counts m_assertions;
+ bool m_sectionIncluded;
+ Timer m_timer;
+ };
+
+} // end namespace Catch
+
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+ #define INTERNAL_CATCH_SECTION( ... ) \
+ if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
+#else
+ #define INTERNAL_CATCH_SECTION( name, desc ) \
+ if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) )
+#endif
+
+// #included from: internal/catch_generators.hpp
+#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
+
+#include <iterator>
+#include <vector>
+#include <string>
+#include <stdlib.h>
+
+namespace Catch {
+
+template<typename T>
+struct IGenerator {
+ virtual ~IGenerator() {}
+ virtual T getValue( std::size_t index ) const = 0;
+ virtual std::size_t size () const = 0;
+};
+
+template<typename T>
+class BetweenGenerator : public IGenerator<T> {
+public:
+ BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){}
+
+ virtual T getValue( std::size_t index ) const {
+ return m_from+static_cast<int>( index );
+ }
+
+ virtual std::size_t size() const {
+ return static_cast<std::size_t>( 1+m_to-m_from );
+ }
+
+private:
+
+ T m_from;
+ T m_to;
+};
+
+template<typename T>
+class ValuesGenerator : public IGenerator<T> {
+public:
+ ValuesGenerator(){}
+
+ void add( T value ) {
+ m_values.push_back( value );
+ }
+
+ virtual T getValue( std::size_t index ) const {
+ return m_values[index];
+ }
+
+ virtual std::size_t size() const {
+ return m_values.size();
+ }
+
+private:
+ std::vector<T> m_values;
+};
+
+template<typename T>
+class CompositeGenerator {
+public:
+ CompositeGenerator() : m_totalSize( 0 ) {}
+
+ // *** Move semantics, similar to auto_ptr ***
+ CompositeGenerator( CompositeGenerator& other )
+ : m_fileInfo( other.m_fileInfo ),
+ m_totalSize( 0 )
+ {
+ move( other );
+ }
+
+ CompositeGenerator& setFileInfo( const char* fileInfo ) {
+ m_fileInfo = fileInfo;
+ return *this;
+ }
+
+ ~CompositeGenerator() {
+ deleteAll( m_composed );
+ }
+
+ operator T () const {
+ size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize );
+
+ typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin();
+ typename std::vector<const IGenerator<T>*>::const_iterator itEnd = m_composed.end();
+ for( size_t index = 0; it != itEnd; ++it )
+ {
+ const IGenerator<T>* generator = *it;
+ if( overallIndex >= index && overallIndex < index + generator->size() )
+ {
+ return generator->getValue( overallIndex-index );
+ }
+ index += generator->size();
+ }
+ CATCH_INTERNAL_ERROR( "Indexed past end of generated range" );
+ return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so
+ }
+
+ void add( const IGenerator<T>* generator ) {
+ m_totalSize += generator->size();
+ m_composed.push_back( generator );
+ }
+
+ CompositeGenerator& then( CompositeGenerator& other ) {
+ move( other );
+ return *this;
+ }
+
+ CompositeGenerator& then( T value ) {
+ ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
+ valuesGen->add( value );
+ add( valuesGen );
+ return *this;
+ }
+
+private:
+
+ void move( CompositeGenerator& other ) {
+ std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) );
+ m_totalSize += other.m_totalSize;
+ other.m_composed.clear();
+ }
+
+ std::vector<const IGenerator<T>*> m_composed;
+ std::string m_fileInfo;
+ size_t m_totalSize;
+};
+
+namespace Generators
+{
+ template<typename T>
+ CompositeGenerator<T> between( T from, T to ) {
+ CompositeGenerator<T> generators;
+ generators.add( new BetweenGenerator<T>( from, to ) );
+ return generators;
+ }
+
+ template<typename T>
+ CompositeGenerator<T> values( T val1, T val2 ) {
+ CompositeGenerator<T> generators;
+ ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
+ valuesGen->add( val1 );
+ valuesGen->add( val2 );
+ generators.add( valuesGen );
+ return generators;
+ }
+
+ template<typename T>
+ CompositeGenerator<T> values( T val1, T val2, T val3 ){
+ CompositeGenerator<T> generators;
+ ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
+ valuesGen->add( val1 );
+ valuesGen->add( val2 );
+ valuesGen->add( val3 );
+ generators.add( valuesGen );
+ return generators;
+ }
+
+ template<typename T>
+ CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) {
+ CompositeGenerator<T> generators;
+ ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
+ valuesGen->add( val1 );
+ valuesGen->add( val2 );
+ valuesGen->add( val3 );
+ valuesGen->add( val4 );
+ generators.add( valuesGen );
+ return generators;
+ }
+
+} // end namespace Generators
+
+using namespace Generators;
+
+} // end namespace Catch
+
+#define INTERNAL_CATCH_LINESTR2( line ) #line
+#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line )
+
+#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" )
+
+// #included from: internal/catch_interfaces_exception.h
+#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ typedef std::string(*exceptionTranslateFunction)();
+
+ struct IExceptionTranslator {
+ virtual ~IExceptionTranslator();
+ virtual std::string translate() const = 0;
+ };
+
+ struct IExceptionTranslatorRegistry {
+ virtual ~IExceptionTranslatorRegistry();
+
+ virtual std::string translateActiveException() const = 0;
+ };
+
+ class ExceptionTranslatorRegistrar {
+ template<typename T>
+ class ExceptionTranslator : public IExceptionTranslator {
+ public:
+
+ ExceptionTranslator( std::string(*translateFunction)( T& ) )
+ : m_translateFunction( translateFunction )
+ {}
+
+ virtual std::string translate() const {
+ try {
+ throw;
+ }
+ catch( T& ex ) {
+ return m_translateFunction( ex );
+ }
+ }
+
+ protected:
+ std::string(*m_translateFunction)( T& );
+ };
+
+ public:
+ template<typename T>
+ ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
+ getMutableRegistryHub().registerTranslator
+ ( new ExceptionTranslator<T>( translateFunction ) );
+ }
+ };
+}
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) \
+ static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ); \
+ namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ) ); }\
+ static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature )
+
+// #included from: internal/catch_approx.hpp
+#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
+
+#include <cmath>
+#include <limits>
+
+namespace Catch {
+namespace Detail {
+
+ class Approx {
+ public:
+ explicit Approx ( double value )
+ : m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
+ m_scale( 1.0 ),
+ m_value( value )
+ {}
+
+ Approx( Approx const& other )
+ : m_epsilon( other.m_epsilon ),
+ m_scale( other.m_scale ),
+ m_value( other.m_value )
+ {}
+
+ static Approx custom() {
+ return Approx( 0 );
+ }
+
+ Approx operator()( double value ) {
+ Approx approx( value );
+ approx.epsilon( m_epsilon );
+ approx.scale( m_scale );
+ return approx;
+ }
+
+ friend bool operator == ( double lhs, Approx const& rhs ) {
+ // Thanks to Richard Harris for his help refining this formula
+ return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
+ }
+
+ friend bool operator == ( Approx const& lhs, double rhs ) {
+ return operator==( rhs, lhs );
+ }
+
+ friend bool operator != ( double lhs, Approx const& rhs ) {
+ return !operator==( lhs, rhs );
+ }
+
+ friend bool operator != ( Approx const& lhs, double rhs ) {
+ return !operator==( rhs, lhs );
+ }
+
+ Approx& epsilon( double newEpsilon ) {
+ m_epsilon = newEpsilon;
+ return *this;
+ }
+
+ Approx& scale( double newScale ) {
+ m_scale = newScale;
+ return *this;
+ }
+
+ std::string toString() const {
+ std::ostringstream oss;
+ oss << "Approx( " << Catch::toString( m_value ) << " )";
+ return oss.str();
+ }
+
+ private:
+ double m_epsilon;
+ double m_scale;
+ double m_value;
+ };
+}
+
+template<>
+inline std::string toString<Detail::Approx>( Detail::Approx const& value ) {
+ return value.toString();
+}
+
+} // end namespace Catch
+
+// #included from: internal/catch_matchers.hpp
+#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
+
+namespace Catch {
+namespace Matchers {
+ namespace Impl {
+
+ template<typename ExpressionT>
+ struct Matcher : SharedImpl<IShared>
+ {
+ typedef ExpressionT ExpressionType;
+
+ virtual ~Matcher() {}
+ virtual Ptr<Matcher> clone() const = 0;
+ virtual bool match( ExpressionT const& expr ) const = 0;
+ virtual std::string toString() const = 0;
+ };
+
+ template<typename DerivedT, typename ExpressionT>
+ struct MatcherImpl : Matcher<ExpressionT> {
+
+ virtual Ptr<Matcher<ExpressionT> > clone() const {
+ return Ptr<Matcher<ExpressionT> >( new DerivedT( static_cast<DerivedT const&>( *this ) ) );
+ }
+ };
+
+ namespace Generic {
+
+ template<typename ExpressionT>
+ class AllOf : public MatcherImpl<AllOf<ExpressionT>, ExpressionT> {
+ public:
+
+ AllOf() {}
+ AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {}
+
+ AllOf& add( Matcher<ExpressionT> const& matcher ) {
+ m_matchers.push_back( matcher.clone() );
+ return *this;
+ }
+ virtual bool match( ExpressionT const& expr ) const
+ {
+ for( std::size_t i = 0; i < m_matchers.size(); ++i )
+ if( !m_matchers[i]->match( expr ) )
+ return false;
+ return true;
+ }
+ virtual std::string toString() const {
+ std::ostringstream oss;
+ oss << "( ";
+ for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
+ if( i != 0 )
+ oss << " and ";
+ oss << m_matchers[i]->toString();
+ }
+ oss << " )";
+ return oss.str();
+ }
+
+ private:
+ std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
+ };
+
+ template<typename ExpressionT>
+ class AnyOf : public MatcherImpl<AnyOf<ExpressionT>, ExpressionT> {
+ public:
+
+ AnyOf() {}
+ AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {}
+
+ AnyOf& add( Matcher<ExpressionT> const& matcher ) {
+ m_matchers.push_back( matcher.clone() );
+ return *this;
+ }
+ virtual bool match( ExpressionT const& expr ) const
+ {
+ for( std::size_t i = 0; i < m_matchers.size(); ++i )
+ if( m_matchers[i]->match( expr ) )
+ return true;
+ return false;
+ }
+ virtual std::string toString() const {
+ std::ostringstream oss;
+ oss << "( ";
+ for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
+ if( i != 0 )
+ oss << " or ";
+ oss << m_matchers[i]->toString();
+ }
+ oss << " )";
+ return oss.str();
+ }
+
+ private:
+ std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
+ };
+
+ }
+
+ namespace StdString {
+
+ inline std::string makeString( std::string const& str ) { return str; }
+ inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); }
+
+ struct Equals : MatcherImpl<Equals, std::string> {
+ Equals( std::string const& str ) : m_str( str ){}
+ Equals( Equals const& other ) : m_str( other.m_str ){}
+
+ virtual ~Equals();
+
+ virtual bool match( std::string const& expr ) const {
+ return m_str == expr;
+ }
+ virtual std::string toString() const {
+ return "equals: \"" + m_str + "\"";
+ }
+
+ std::string m_str;
+ };
+
+ struct Contains : MatcherImpl<Contains, std::string> {
+ Contains( std::string const& substr ) : m_substr( substr ){}
+ Contains( Contains const& other ) : m_substr( other.m_substr ){}
+
+ virtual ~Contains();
+
+ virtual bool match( std::string const& expr ) const {
+ return expr.find( m_substr ) != std::string::npos;
+ }
+ virtual std::string toString() const {
+ return "contains: \"" + m_substr + "\"";
+ }
+
+ std::string m_substr;
+ };
+
+ struct StartsWith : MatcherImpl<StartsWith, std::string> {
+ StartsWith( std::string const& substr ) : m_substr( substr ){}
+ StartsWith( StartsWith const& other ) : m_substr( other.m_substr ){}
+
+ virtual ~StartsWith();
+
+ virtual bool match( std::string const& expr ) const {
+ return expr.find( m_substr ) == 0;
+ }
+ virtual std::string toString() const {
+ return "starts with: \"" + m_substr + "\"";
+ }
+
+ std::string m_substr;
+ };
+
+ struct EndsWith : MatcherImpl<EndsWith, std::string> {
+ EndsWith( std::string const& substr ) : m_substr( substr ){}
+ EndsWith( EndsWith const& other ) : m_substr( other.m_substr ){}
+
+ virtual ~EndsWith();
+
+ virtual bool match( std::string const& expr ) const {
+ return expr.find( m_substr ) == expr.size() - m_substr.size();
+ }
+ virtual std::string toString() const {
+ return "ends with: \"" + m_substr + "\"";
+ }
+
+ std::string m_substr;
+ };
+ } // namespace StdString
+ } // namespace Impl
+
+ // The following functions create the actual matcher objects.
+ // This allows the types to be inferred
+ template<typename ExpressionT>
+ inline Impl::Generic::AllOf<ExpressionT> AllOf( Impl::Matcher<ExpressionT> const& m1,
+ Impl::Matcher<ExpressionT> const& m2 ) {
+ return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 );
+ }
+ template<typename ExpressionT>
+ inline Impl::Generic::AllOf<ExpressionT> AllOf( Impl::Matcher<ExpressionT> const& m1,
+ Impl::Matcher<ExpressionT> const& m2,
+ Impl::Matcher<ExpressionT> const& m3 ) {
+ return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
+ }
+ template<typename ExpressionT>
+ inline Impl::Generic::AnyOf<ExpressionT> AnyOf( Impl::Matcher<ExpressionT> const& m1,
+ Impl::Matcher<ExpressionT> const& m2 ) {
+ return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 );
+ }
+ template<typename ExpressionT>
+ inline Impl::Generic::AnyOf<ExpressionT> AnyOf( Impl::Matcher<ExpressionT> const& m1,
+ Impl::Matcher<ExpressionT> const& m2,
+ Impl::Matcher<ExpressionT> const& m3 ) {
+ return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
+ }
+
+ inline Impl::StdString::Equals Equals( std::string const& str ) {
+ return Impl::StdString::Equals( str );
+ }
+ inline Impl::StdString::Equals Equals( const char* str ) {
+ return Impl::StdString::Equals( Impl::StdString::makeString( str ) );
+ }
+ inline Impl::StdString::Contains Contains( std::string const& substr ) {
+ return Impl::StdString::Contains( substr );
+ }
+ inline Impl::StdString::Contains Contains( const char* substr ) {
+ return Impl::StdString::Contains( Impl::StdString::makeString( substr ) );
+ }
+ inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) {
+ return Impl::StdString::StartsWith( substr );
+ }
+ inline Impl::StdString::StartsWith StartsWith( const char* substr ) {
+ return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) );
+ }
+ inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) {
+ return Impl::StdString::EndsWith( substr );
+ }
+ inline Impl::StdString::EndsWith EndsWith( const char* substr ) {
+ return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) );
+ }
+
+} // namespace Matchers
+
+using namespace Matchers;
+
+} // namespace Catch
+
+// These files are included here so the single_include script doesn't put them
+// in the conditionally compiled sections
+// #included from: internal/catch_test_case_info.h
+#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
+
+#include <string>
+#include <set>
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+namespace Catch {
+
+ struct ITestCase;
+
+ struct TestCaseInfo {
+ TestCaseInfo( std::string const& _name,
+ std::string const& _className,
+ std::string const& _description,
+ std::set<std::string> const& _tags,
+ bool _isHidden,
+ SourceLineInfo const& _lineInfo );
+
+ TestCaseInfo( TestCaseInfo const& other );
+
+ std::string name;
+ std::string className;
+ std::string description;
+ std::set<std::string> tags;
+ std::set<std::string> lcaseTags;
+ std::string tagsAsString;
+ SourceLineInfo lineInfo;
+ bool isHidden;
+ bool throws;
+ };
+
+ class TestCase : public TestCaseInfo {
+ public:
+
+ TestCase( ITestCase* testCase, TestCaseInfo const& info );
+ TestCase( TestCase const& other );
+
+ TestCase withName( std::string const& _newName ) const;
+
+ void invoke() const;
+
+ TestCaseInfo const& getTestCaseInfo() const;
+
+ bool isHidden() const;
+ bool throws() const;
+
+ void swap( TestCase& other );
+ bool operator == ( TestCase const& other ) const;
+ bool operator < ( TestCase const& other ) const;
+ TestCase& operator = ( TestCase const& other );
+
+ private:
+ Ptr<ITestCase> test;
+ };
+
+ TestCase makeTestCase( ITestCase* testCase,
+ std::string const& className,
+ std::string const& name,
+ std::string const& description,
+ SourceLineInfo const& lineInfo );
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+// #included from: internal/catch_interfaces_runner.h
+#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
+
+namespace Catch {
+ class TestCase;
+
+ struct IRunner {
+ virtual ~IRunner();
+ };
+}
+
+
+#ifdef __OBJC__
+// #included from: internal/catch_objc.hpp
+#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
+
+#import <objc/runtime.h>
+
+#include <string>
+
+// NB. Any general catch headers included here must be included
+// in catch.hpp first to make sure they are included by the single
+// header for non obj-usage
+
+///////////////////////////////////////////////////////////////////////////////
+// This protocol is really only here for (self) documenting purposes, since
+// all its methods are optional.
+@protocol OcFixture
+
+@optional
+
+-(void) setUp;
+-(void) tearDown;
+
+@end
+
+namespace Catch {
+
+ class OcMethod : public SharedImpl<ITestCase> {
+
+ public:
+ OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
+
+ virtual void invoke() const {
+ id obj = [[m_cls alloc] init];
+
+ performOptionalSelector( obj, @selector(setUp) );
+ performOptionalSelector( obj, m_sel );
+ performOptionalSelector( obj, @selector(tearDown) );
+
+ arcSafeRelease( obj );
+ }
+ private:
+ virtual ~OcMethod() {}
+
+ Class m_cls;
+ SEL m_sel;
+ };
+
+ namespace Detail{
+
+ inline std::string getAnnotation( Class cls,
+ std::string const& annotationName,
+ std::string const& testCaseName ) {
+ NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
+ SEL sel = NSSelectorFromString( selStr );
+ arcSafeRelease( selStr );
+ id value = performOptionalSelector( cls, sel );
+ if( value )
+ return [(NSString*)value UTF8String];
+ return "";
+ }
+ }
+
+ inline size_t registerTestMethods() {
+ size_t noTestMethods = 0;
+ int noClasses = objc_getClassList( NULL, 0 );
+
+ Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
+ objc_getClassList( classes, noClasses );
+
+ for( int c = 0; c < noClasses; c++ ) {
+ Class cls = classes[c];
+ {
+ u_int count;
+ Method* methods = class_copyMethodList( cls, &count );
+ for( u_int m = 0; m < count ; m++ ) {
+ SEL selector = method_getName(methods[m]);
+ std::string methodName = sel_getName(selector);
+ if( startsWith( methodName, "Catch_TestCase_" ) ) {
+ std::string testCaseName = methodName.substr( 15 );
+ std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
+ std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
+ const char* className = class_getName( cls );
+
+ getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) );
+ noTestMethods++;
+ }
+ }
+ free(methods);
+ }
+ }
+ return noTestMethods;
+ }
+
+ namespace Matchers {
+ namespace Impl {
+ namespace NSStringMatchers {
+
+ template<typename MatcherT>
+ struct StringHolder : MatcherImpl<MatcherT, NSString*>{
+ StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
+ StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
+ StringHolder() {
+ arcSafeRelease( m_substr );
+ }
+
+ NSString* m_substr;
+ };
+
+ struct Equals : StringHolder<Equals> {
+ Equals( NSString* substr ) : StringHolder( substr ){}
+
+ virtual bool match( ExpressionType const& str ) const {
+ return (str != nil || m_substr == nil ) &&
+ [str isEqualToString:m_substr];
+ }
+
+ virtual std::string toString() const {
+ return "equals string: \"" + Catch::toString( m_substr ) + "\"";
+ }
+ };
+
+ struct Contains : StringHolder<Contains> {
+ Contains( NSString* substr ) : StringHolder( substr ){}
+
+ virtual bool match( ExpressionType const& str ) const {
+ return (str != nil || m_substr == nil ) &&
+ [str rangeOfString:m_substr].location != NSNotFound;
+ }
+
+ virtual std::string toString() const {
+ return "contains string: \"" + Catch::toString( m_substr ) + "\"";
+ }
+ };
+
+ struct StartsWith : StringHolder<StartsWith> {
+ StartsWith( NSString* substr ) : StringHolder( substr ){}
+
+ virtual bool match( ExpressionType const& str ) const {
+ return (str != nil || m_substr == nil ) &&
+ [str rangeOfString:m_substr].location == 0;
+ }
+
+ virtual std::string toString() const {
+ return "starts with: \"" + Catch::toString( m_substr ) + "\"";
+ }
+ };
+ struct EndsWith : StringHolder<EndsWith> {
+ EndsWith( NSString* substr ) : StringHolder( substr ){}
+
+ virtual bool match( ExpressionType const& str ) const {
+ return (str != nil || m_substr == nil ) &&
+ [str rangeOfString:m_substr].location == [str length] - [m_substr length];
+ }
+
+ virtual std::string toString() const {
+ return "ends with: \"" + Catch::toString( m_substr ) + "\"";
+ }
+ };
+
+ } // namespace NSStringMatchers
+ } // namespace Impl
+
+ inline Impl::NSStringMatchers::Equals
+ Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
+
+ inline Impl::NSStringMatchers::Contains
+ Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
+
+ inline Impl::NSStringMatchers::StartsWith
+ StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
+
+ inline Impl::NSStringMatchers::EndsWith
+ EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
+
+ } // namespace Matchers
+
+ using namespace Matchers;
+
+} // namespace Catch
+
+///////////////////////////////////////////////////////////////////////////////
+#define OC_TEST_CASE( name, desc )\
++(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \
+{\
+return @ name; \
+}\
++(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \
+{ \
+return @ desc; \
+} \
+-(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test )
+
+#endif
+
+#ifdef CATCH_CONFIG_RUNNER
+// #included from: internal/catch_impl.hpp
+#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
+
+// Collect all the implementation files together here
+// These are the equivalent of what would usually be cpp files
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wweak-vtables"
+#endif
+
+// #included from: catch_runner.hpp
+#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
+
+// #included from: internal/catch_commandline.hpp
+#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
+
+// #included from: catch_config.hpp
+#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
+
+// #included from: catch_test_spec_parser.hpp
+#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+// #included from: catch_test_spec.hpp
+#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ class TestSpec {
+ struct Pattern : SharedImpl<> {
+ virtual ~Pattern();
+ virtual bool matches( TestCaseInfo const& testCase ) const = 0;
+ };
+ class NamePattern : public Pattern {
+ enum WildcardPosition {
+ NoWildcard = 0,
+ WildcardAtStart = 1,
+ WildcardAtEnd = 2,
+ WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
+ };
+
+ public:
+ NamePattern( std::string const& name ) : m_name( toLower( name ) ), m_wildcard( NoWildcard ) {
+ if( startsWith( m_name, "*" ) ) {
+ m_name = m_name.substr( 1 );
+ m_wildcard = WildcardAtStart;
+ }
+ if( endsWith( m_name, "*" ) ) {
+ m_name = m_name.substr( 0, m_name.size()-1 );
+ m_wildcard = (WildcardPosition)( m_wildcard | WildcardAtEnd );
+ }
+ }
+ virtual ~NamePattern();
+ virtual bool matches( TestCaseInfo const& testCase ) const {
+ switch( m_wildcard ) {
+ case NoWildcard:
+ return m_name == toLower( testCase.name );
+ case WildcardAtStart:
+ return endsWith( toLower( testCase.name ), m_name );
+ case WildcardAtEnd:
+ return startsWith( toLower( testCase.name ), m_name );
+ case WildcardAtBothEnds:
+ return contains( toLower( testCase.name ), m_name );
+ }
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
+#endif
+ throw std::logic_error( "Unknown enum" );
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+ }
+ private:
+ std::string m_name;
+ WildcardPosition m_wildcard;
+ };
+ class TagPattern : public Pattern {
+ public:
+ TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {}
+ virtual ~TagPattern();
+ virtual bool matches( TestCaseInfo const& testCase ) const {
+ return testCase.lcaseTags.find( m_tag ) != testCase.lcaseTags.end();
+ }
+ private:
+ std::string m_tag;
+ };
+ class ExcludedPattern : public Pattern {
+ public:
+ ExcludedPattern( Ptr<Pattern> const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {}
+ virtual ~ExcludedPattern();
+ virtual bool matches( TestCaseInfo const& testCase ) const { return !m_underlyingPattern->matches( testCase ); }
+ private:
+ Ptr<Pattern> m_underlyingPattern;
+ };
+
+ struct Filter {
+ std::vector<Ptr<Pattern> > m_patterns;
+
+ bool matches( TestCaseInfo const& testCase ) const {
+ // All patterns in a filter must match for the filter to be a match
+ for( std::vector<Ptr<Pattern> >::const_iterator it = m_patterns.begin(), itEnd = m_patterns.end(); it != itEnd; ++it )
+ if( !(*it)->matches( testCase ) )
+ return false;
+ return true;
+ }
+ };
+
+ public:
+ bool hasFilters() const {
+ return !m_filters.empty();
+ }
+ bool matches( TestCaseInfo const& testCase ) const {
+ // A TestSpec matches if any filter matches
+ for( std::vector<Filter>::const_iterator it = m_filters.begin(), itEnd = m_filters.end(); it != itEnd; ++it )
+ if( it->matches( testCase ) )
+ return true;
+ return false;
+ }
+
+ private:
+ std::vector<Filter> m_filters;
+
+ friend class TestSpecParser;
+ };
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+namespace Catch {
+
+ class TestSpecParser {
+ enum Mode{ None, Name, QuotedName, Tag };
+ Mode m_mode;
+ bool m_exclusion;
+ std::size_t m_start, m_pos;
+ std::string m_arg;
+ TestSpec::Filter m_currentFilter;
+ TestSpec m_testSpec;
+
+ public:
+ TestSpecParser parse( std::string const& arg ) {
+ m_mode = None;
+ m_exclusion = false;
+ m_start = std::string::npos;
+ m_arg = arg;
+ for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
+ visitChar( m_arg[m_pos] );
+ if( m_mode == Name )
+ addPattern<TestSpec::NamePattern>();
+ return *this;
+ }
+ TestSpec testSpec() {
+ addFilter();
+ return m_testSpec;
+ }
+ private:
+ void visitChar( char c ) {
+ if( m_mode == None ) {
+ switch( c ) {
+ case ' ': return;
+ case '~': m_exclusion = true; return;
+ case '[': return startNewMode( Tag, ++m_pos );
+ case '"': return startNewMode( QuotedName, ++m_pos );
+ default: startNewMode( Name, m_pos ); break;
+ }
+ }
+ if( m_mode == Name ) {
+ if( c == ',' ) {
+ addPattern<TestSpec::NamePattern>();
+ addFilter();
+ }
+ else if( c == '[' ) {
+ if( subString() == "exclude:" )
+ m_exclusion = true;
+ else
+ addPattern<TestSpec::NamePattern>();
+ startNewMode( Tag, ++m_pos );
+ }
+ }
+ else if( m_mode == QuotedName && c == '"' )
+ addPattern<TestSpec::NamePattern>();
+ else if( m_mode == Tag && c == ']' )
+ addPattern<TestSpec::TagPattern>();
+ }
+ void startNewMode( Mode mode, std::size_t start ) {
+ m_mode = mode;
+ m_start = start;
+ }
+ std::string subString() const { return m_arg.substr( m_start, m_pos - m_start ); }
+ template<typename T>
+ void addPattern() {
+ std::string token = subString();
+ if( startsWith( token, "exclude:" ) ) {
+ m_exclusion = true;
+ token = token.substr( 8 );
+ }
+ if( !token.empty() ) {
+ Ptr<TestSpec::Pattern> pattern = new T( token );
+ if( m_exclusion )
+ pattern = new TestSpec::ExcludedPattern( pattern );
+ m_currentFilter.m_patterns.push_back( pattern );
+ }
+ m_exclusion = false;
+ m_mode = None;
+ }
+ void addFilter() {
+ if( !m_currentFilter.m_patterns.empty() ) {
+ m_testSpec.m_filters.push_back( m_currentFilter );
+ m_currentFilter = TestSpec::Filter();
+ }
+ }
+ };
+ inline TestSpec parseTestSpec( std::string const& arg ) {
+ return TestSpecParser().parse( arg ).testSpec();
+ }
+
+} // namespace Catch
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+// #included from: catch_stream.h
+#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
+
+#include <streambuf>
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+namespace Catch {
+
+ class Stream {
+ public:
+ Stream();
+ Stream( std::streambuf* _streamBuf, bool _isOwned );
+ void release();
+
+ std::streambuf* streamBuf;
+
+ private:
+ bool isOwned;
+ };
+}
+
+#include <memory>
+#include <vector>
+#include <string>
+#include <iostream>
+
+#ifndef CATCH_CONFIG_CONSOLE_WIDTH
+#define CATCH_CONFIG_CONSOLE_WIDTH 80
+#endif
+
+namespace Catch {
+
+ struct ConfigData {
+
+ ConfigData()
+ : listTests( false ),
+ listTags( false ),
+ listReporters( false ),
+ listTestNamesOnly( false ),
+ showSuccessfulTests( false ),
+ shouldDebugBreak( false ),
+ noThrow( false ),
+ showHelp( false ),
+ showInvisibles( false ),
+ abortAfter( -1 ),
+ verbosity( Verbosity::Normal ),
+ warnings( WarnAbout::Nothing ),
+ showDurations( ShowDurations::DefaultForReporter )
+ {}
+
+ bool listTests;
+ bool listTags;
+ bool listReporters;
+ bool listTestNamesOnly;
+
+ bool showSuccessfulTests;
+ bool shouldDebugBreak;
+ bool noThrow;
+ bool showHelp;
+ bool showInvisibles;
+
+ int abortAfter;
+
+ Verbosity::Level verbosity;
+ WarnAbout::What warnings;
+ ShowDurations::OrNot showDurations;
+
+ std::string reporterName;
+ std::string outputFilename;
+ std::string name;
+ std::string processName;
+
+ std::vector<std::string> testsOrTags;
+ };
+
+ class Config : public SharedImpl<IConfig> {
+ private:
+ Config( Config const& other );
+ Config& operator = ( Config const& other );
+ virtual void dummy();
+ public:
+
+ Config()
+ : m_os( std::cout.rdbuf() )
+ {}
+
+ Config( ConfigData const& data )
+ : m_data( data ),
+ m_os( std::cout.rdbuf() )
+ {
+ if( !data.testsOrTags.empty() ) {
+ TestSpecParser parser;
+ for( std::size_t i = 0; i < data.testsOrTags.size(); ++i )
+ parser.parse( data.testsOrTags[i] );
+ m_testSpec = parser.testSpec();
+ }
+ }
+
+ virtual ~Config() {
+ m_os.rdbuf( std::cout.rdbuf() );
+ m_stream.release();
+ }
+
+ void setFilename( std::string const& filename ) {
+ m_data.outputFilename = filename;
+ }
+
+ std::string const& getFilename() const {
+ return m_data.outputFilename ;
+ }
+
+ bool listTests() const { return m_data.listTests; }
+ bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
+ bool listTags() const { return m_data.listTags; }
+ bool listReporters() const { return m_data.listReporters; }
+
+ std::string getProcessName() const { return m_data.processName; }
+
+ bool shouldDebugBreak() const { return m_data.shouldDebugBreak; }
+
+ void setStreamBuf( std::streambuf* buf ) {
+ m_os.rdbuf( buf ? buf : std::cout.rdbuf() );
+ }
+
+ void useStream( std::string const& streamName ) {
+ Stream stream = createStream( streamName );
+ setStreamBuf( stream.streamBuf );
+ m_stream.release();
+ m_stream = stream;
+ }
+
+ std::string getReporterName() const { return m_data.reporterName; }
+
+ int abortAfter() const { return m_data.abortAfter; }
+
+ TestSpec const& testSpec() const { return m_testSpec; }
+
+ bool showHelp() const { return m_data.showHelp; }
+ bool showInvisibles() const { return m_data.showInvisibles; }
+
+ // IConfig interface
+ virtual bool allowThrows() const { return !m_data.noThrow; }
+ virtual std::ostream& stream() const { return m_os; }
+ virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
+ virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
+ virtual bool warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; }
+ virtual ShowDurations::OrNot showDurations() const { return m_data.showDurations; }
+
+ private:
+ ConfigData m_data;
+
+ Stream m_stream;
+ mutable std::ostream m_os;
+ TestSpec m_testSpec;
+ };
+
+} // end namespace Catch
+
+// #included from: catch_clara.h
+#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
+
+// Use Catch's value for console width (store Clara's off to the side, if present)
+#ifdef CLARA_CONFIG_CONSOLE_WIDTH
+#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
+#undef CLARA_CONFIG_CONSOLE_WIDTH
+#endif
+#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH
+
+// Declare Clara inside the Catch namespace
+#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch {
+// #included from: ../external/clara.h
+
+// Only use header guard if we are not using an outer namespace
+#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE)
+
+#ifndef STITCH_CLARA_OPEN_NAMESPACE
+#define TWOBLUECUBES_CLARA_H_INCLUDED
+#define STITCH_CLARA_OPEN_NAMESPACE
+#define STITCH_CLARA_CLOSE_NAMESPACE
+#else
+#define STITCH_CLARA_CLOSE_NAMESPACE }
+#endif
+
+#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE
+
+// ----------- #included from tbc_text_format.h -----------
+
+// Only use header guard if we are not using an outer namespace
+#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE)
+#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+#define TBC_TEXT_FORMAT_H_INCLUDED
+#endif
+
+#include <string>
+#include <vector>
+#include <sstream>
+
+// Use optional outer namespace
+#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
+#endif
+
+namespace Tbc {
+
+#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
+ const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
+#else
+ const unsigned int consoleWidth = 80;
+#endif
+
+ struct TextAttributes {
+ TextAttributes()
+ : initialIndent( std::string::npos ),
+ indent( 0 ),
+ width( consoleWidth-1 ),
+ tabChar( '\t' )
+ {}
+
+ TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; }
+ TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; }
+ TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; }
+ TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; }
+
+ std::size_t initialIndent; // indent of first line, or npos
+ std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos
+ std::size_t width; // maximum width of text, including indent. Longer text will wrap
+ char tabChar; // If this char is seen the indent is changed to current pos
+ };
+
+ class Text {
+ public:
+ Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
+ : attr( _attr )
+ {
+ std::string wrappableChars = " [({.,/|\\-";
+ std::size_t indent = _attr.initialIndent != std::string::npos
+ ? _attr.initialIndent
+ : _attr.indent;
+ std::string remainder = _str;
+
+ while( !remainder.empty() ) {
+ if( lines.size() >= 1000 ) {
+ lines.push_back( "... message truncated due to excessive size" );
+ return;
+ }
+ std::size_t tabPos = std::string::npos;
+ std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
+ std::size_t pos = remainder.find_first_of( '\n' );
+ if( pos <= width ) {
+ width = pos;
+ }
+ pos = remainder.find_last_of( _attr.tabChar, width );
+ if( pos != std::string::npos ) {
+ tabPos = pos;
+ if( remainder[width] == '\n' )
+ width--;
+ remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
+ }
+
+ if( width == remainder.size() ) {
+ spliceLine( indent, remainder, width );
+ }
+ else if( remainder[width] == '\n' ) {
+ spliceLine( indent, remainder, width );
+ if( width <= 1 || remainder.size() != 1 )
+ remainder = remainder.substr( 1 );
+ indent = _attr.indent;
+ }
+ else {
+ pos = remainder.find_last_of( wrappableChars, width );
+ if( pos != std::string::npos && pos > 0 ) {
+ spliceLine( indent, remainder, pos );
+ if( remainder[0] == ' ' )
+ remainder = remainder.substr( 1 );
+ }
+ else {
+ spliceLine( indent, remainder, width-1 );
+ lines.back() += "-";
+ }
+ if( lines.size() == 1 )
+ indent = _attr.indent;
+ if( tabPos != std::string::npos )
+ indent += tabPos;
+ }
+ }
+ }
+
+ void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
+ lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
+ _remainder = _remainder.substr( _pos );
+ }
+
+ typedef std::vector<std::string>::const_iterator const_iterator;
+
+ const_iterator begin() const { return lines.begin(); }
+ const_iterator end() const { return lines.end(); }
+ std::string const& last() const { return lines.back(); }
+ std::size_t size() const { return lines.size(); }
+ std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
+ std::string toString() const {
+ std::ostringstream oss;
+ oss << *this;
+ return oss.str();
+ }
+
+ inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
+ for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
+ it != itEnd; ++it ) {
+ if( it != _text.begin() )
+ _stream << "\n";
+ _stream << *it;
+ }
+ return _stream;
+ }
+
+ private:
+ std::string str;
+ TextAttributes attr;
+ std::vector<std::string> lines;
+ };
+
+} // end namespace Tbc
+
+#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+} // end outer namespace
+#endif
+
+#endif // TBC_TEXT_FORMAT_H_INCLUDED
+
+// ----------- end of #include from tbc_text_format.h -----------
+// ........... back in /Users/philnash/Dev/OSS/Clara/srcs/clara.h
+
+#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE
+
+#include <map>
+#include <algorithm>
+#include <stdexcept>
+#include <memory>
+
+// Use optional outer namespace
+#ifdef STITCH_CLARA_OPEN_NAMESPACE
+STITCH_CLARA_OPEN_NAMESPACE
+#endif
+
+namespace Clara {
+
+ struct UnpositionalTag {};
+
+ extern UnpositionalTag _;
+
+#ifdef CLARA_CONFIG_MAIN
+ UnpositionalTag _;
+#endif
+
+ namespace Detail {
+
+#ifdef CLARA_CONSOLE_WIDTH
+ const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH;
+#else
+ const unsigned int consoleWidth = 80;
+#endif
+
+ using namespace Tbc;
+
+ inline bool startsWith( std::string const& str, std::string const& prefix ) {
+ return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix;
+ }
+
+ template<typename T> struct RemoveConstRef{ typedef T type; };
+ template<typename T> struct RemoveConstRef<T&>{ typedef T type; };
+ template<typename T> struct RemoveConstRef<T const&>{ typedef T type; };
+ template<typename T> struct RemoveConstRef<T const>{ typedef T type; };
+
+ template<typename T> struct IsBool { static const bool value = false; };
+ template<> struct IsBool<bool> { static const bool value = true; };
+
+ template<typename T>
+ void convertInto( std::string const& _source, T& _dest ) {
+ std::stringstream ss;
+ ss << _source;
+ ss >> _dest;
+ if( ss.fail() )
+ throw std::runtime_error( "Unable to convert " + _source + " to destination type" );
+ }
+ inline void convertInto( std::string const& _source, std::string& _dest ) {
+ _dest = _source;
+ }
+ inline void convertInto( std::string const& _source, bool& _dest ) {
+ std::string sourceLC = _source;
+ std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower );
+ if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
+ _dest = true;
+ else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
+ _dest = false;
+ else
+ throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" );
+ }
+ inline void convertInto( bool _source, bool& _dest ) {
+ _dest = _source;
+ }
+ template<typename T>
+ inline void convertInto( bool, T& ) {
+ throw std::runtime_error( "Invalid conversion" );
+ }
+
+ template<typename ConfigT>
+ struct IArgFunction {
+ virtual ~IArgFunction() {}
+# ifdef CATCH_CPP11_OR_GREATER
+ IArgFunction() = default;
+ IArgFunction( IArgFunction const& ) = default;
+# endif
+ virtual void set( ConfigT& config, std::string const& value ) const = 0;
+ virtual void setFlag( ConfigT& config ) const = 0;
+ virtual bool takesArg() const = 0;
+ virtual IArgFunction* clone() const = 0;
+ };
+
+ template<typename ConfigT>
+ class BoundArgFunction {
+ public:
+ BoundArgFunction() : functionObj( NULL ) {}
+ BoundArgFunction( IArgFunction<ConfigT>* _functionObj ) : functionObj( _functionObj ) {}
+ BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : NULL ) {}
+ BoundArgFunction& operator = ( BoundArgFunction const& other ) {
+ IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : NULL;
+ delete functionObj;
+ functionObj = newFunctionObj;
+ return *this;
+ }
+ ~BoundArgFunction() { delete functionObj; }
+
+ void set( ConfigT& config, std::string const& value ) const {
+ functionObj->set( config, value );
+ }
+ void setFlag( ConfigT& config ) const {
+ functionObj->setFlag( config );
+ }
+ bool takesArg() const { return functionObj->takesArg(); }
+
+ bool isSet() const {
+ return functionObj != NULL;
+ }
+ private:
+ IArgFunction<ConfigT>* functionObj;
+ };
+
+ template<typename C>
+ struct NullBinder : IArgFunction<C>{
+ virtual void set( C&, std::string const& ) const {}
+ virtual void setFlag( C& ) const {}
+ virtual bool takesArg() const { return true; }
+ virtual IArgFunction<C>* clone() const { return new NullBinder( *this ); }
+ };
+
+ template<typename C, typename M>
+ struct BoundDataMember : IArgFunction<C>{
+ BoundDataMember( M C::* _member ) : member( _member ) {}
+ virtual void set( C& p, std::string const& stringValue ) const {
+ convertInto( stringValue, p.*member );
+ }
+ virtual void setFlag( C& p ) const {
+ convertInto( true, p.*member );
+ }
+ virtual bool takesArg() const { return !IsBool<M>::value; }
+ virtual IArgFunction<C>* clone() const { return new BoundDataMember( *this ); }
+ M C::* member;
+ };
+ template<typename C, typename M>
+ struct BoundUnaryMethod : IArgFunction<C>{
+ BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {}
+ virtual void set( C& p, std::string const& stringValue ) const {
+ typename RemoveConstRef<M>::type value;
+ convertInto( stringValue, value );
+ (p.*member)( value );
+ }
+ virtual void setFlag( C& p ) const {
+ typename RemoveConstRef<M>::type value;
+ convertInto( true, value );
+ (p.*member)( value );
+ }
+ virtual bool takesArg() const { return !IsBool<M>::value; }
+ virtual IArgFunction<C>* clone() const { return new BoundUnaryMethod( *this ); }
+ void (C::*member)( M );
+ };
+ template<typename C>
+ struct BoundNullaryMethod : IArgFunction<C>{
+ BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {}
+ virtual void set( C& p, std::string const& stringValue ) const {
+ bool value;
+ convertInto( stringValue, value );
+ if( value )
+ (p.*member)();
+ }
+ virtual void setFlag( C& p ) const {
+ (p.*member)();
+ }
+ virtual bool takesArg() const { return false; }
+ virtual IArgFunction<C>* clone() const { return new BoundNullaryMethod( *this ); }
+ void (C::*member)();
+ };
+
+ template<typename C>
+ struct BoundUnaryFunction : IArgFunction<C>{
+ BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {}
+ virtual void set( C& obj, std::string const& stringValue ) const {
+ bool value;
+ convertInto( stringValue, value );
+ if( value )
+ function( obj );
+ }
+ virtual void setFlag( C& p ) const {
+ function( p );
+ }
+ virtual bool takesArg() const { return false; }
+ virtual IArgFunction<C>* clone() const { return new BoundUnaryFunction( *this ); }
+ void (*function)( C& );
+ };
+
+ template<typename C, typename T>
+ struct BoundBinaryFunction : IArgFunction<C>{
+ BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {}
+ virtual void set( C& obj, std::string const& stringValue ) const {
+ typename RemoveConstRef<T>::type value;
+ convertInto( stringValue, value );
+ function( obj, value );
+ }
+ virtual void setFlag( C& obj ) const {
+ typename RemoveConstRef<T>::type value;
+ convertInto( true, value );
+ function( obj, value );
+ }
+ virtual bool takesArg() const { return !IsBool<T>::value; }
+ virtual IArgFunction<C>* clone() const { return new BoundBinaryFunction( *this ); }
+ void (*function)( C&, T );
+ };
+
+ } // namespace Detail
+
+ struct Parser {
+ Parser() : separators( " \t=:" ) {}
+
+ struct Token {
+ enum Type { Positional, ShortOpt, LongOpt };
+ Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {}
+ Type type;
+ std::string data;
+ };
+
+ void parseIntoTokens( int argc, char const * const * argv, std::vector<Parser::Token>& tokens ) const {
+ const std::string doubleDash = "--";
+ for( int i = 1; i < argc && argv[i] != doubleDash; ++i )
+ parseIntoTokens( argv[i] , tokens);
+ }
+ void parseIntoTokens( std::string arg, std::vector<Parser::Token>& tokens ) const {
+ while( !arg.empty() ) {
+ Parser::Token token( Parser::Token::Positional, arg );
+ arg = "";
+ if( token.data[0] == '-' ) {
+ if( token.data.size() > 1 && token.data[1] == '-' ) {
+ token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) );
+ }
+ else {
+ token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) );
+ if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) {
+ arg = "-" + token.data.substr( 1 );
+ token.data = token.data.substr( 0, 1 );
+ }
+ }
+ }
+ if( token.type != Parser::Token::Positional ) {
+ std::size_t pos = token.data.find_first_of( separators );
+ if( pos != std::string::npos ) {
+ arg = token.data.substr( pos+1 );
+ token.data = token.data.substr( 0, pos );
+ }
+ }
+ tokens.push_back( token );
+ }
+ }
+ std::string separators;
+ };
+
+ template<typename ConfigT>
+ struct CommonArgProperties {
+ CommonArgProperties() {}
+ CommonArgProperties( Detail::BoundArgFunction<ConfigT> const& _boundField ) : boundField( _boundField ) {}
+
+ Detail::BoundArgFunction<ConfigT> boundField;
+ std::string description;
+ std::string detail;
+ std::string placeholder; // Only value if boundField takes an arg
+
+ bool takesArg() const {
+ return !placeholder.empty();
+ }
+ void validate() const {
+ if( !boundField.isSet() )
+ throw std::logic_error( "option not bound" );
+ }
+ };
+ struct OptionArgProperties {
+ std::vector<std::string> shortNames;
+ std::string longName;
+
+ bool hasShortName( std::string const& shortName ) const {
+ return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end();
+ }
+ bool hasLongName( std::string const& _longName ) const {
+ return _longName == longName;
+ }
+ };
+ struct PositionalArgProperties {
+ PositionalArgProperties() : position( -1 ) {}
+ int position; // -1 means non-positional (floating)
+
+ bool isFixedPositional() const {
+ return position != -1;
+ }
+ };
+
+ template<typename ConfigT>
+ class CommandLine {
+
+ struct Arg : CommonArgProperties<ConfigT>, OptionArgProperties, PositionalArgProperties {
+ Arg() {}
+ Arg( Detail::BoundArgFunction<ConfigT> const& _boundField ) : CommonArgProperties<ConfigT>( _boundField ) {}
+
+ using CommonArgProperties<ConfigT>::placeholder; // !TBD
+
+ std::string dbgName() const {
+ if( !longName.empty() )
+ return "--" + longName;
+ if( !shortNames.empty() )
+ return "-" + shortNames[0];
+ return "positional args";
+ }
+ std::string commands() const {
+ std::ostringstream oss;
+ bool first = true;
+ std::vector<std::string>::const_iterator it = shortNames.begin(), itEnd = shortNames.end();
+ for(; it != itEnd; ++it ) {
+ if( first )
+ first = false;
+ else
+ oss << ", ";
+ oss << "-" << *it;
+ }
+ if( !longName.empty() ) {
+ if( !first )
+ oss << ", ";
+ oss << "--" << longName;
+ }
+ if( !placeholder.empty() )
+ oss << " <" << placeholder << ">";
+ return oss.str();
+ }
+ };
+
+ // NOTE: std::auto_ptr is deprecated in c++11/c++0x
+#if defined(__cplusplus) && __cplusplus > 199711L
+ typedef std::unique_ptr<Arg> ArgAutoPtr;
+#else
+ typedef std::auto_ptr<Arg> ArgAutoPtr;
+#endif
+
+ friend void addOptName( Arg& arg, std::string const& optName )
+ {
+ if( optName.empty() )
+ return;
+ if( Detail::startsWith( optName, "--" ) ) {
+ if( !arg.longName.empty() )
+ throw std::logic_error( "Only one long opt may be specified. '"
+ + arg.longName
+ + "' already specified, now attempting to add '"
+ + optName + "'" );
+ arg.longName = optName.substr( 2 );
+ }
+ else if( Detail::startsWith( optName, "-" ) )
+ arg.shortNames.push_back( optName.substr( 1 ) );
+ else
+ throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" );
+ }
+ friend void setPositionalArg( Arg& arg, int position )
+ {
+ arg.position = position;
+ }
+
+ class ArgBuilder {
+ public:
+ ArgBuilder( Arg* arg ) : m_arg( arg ) {}
+
+ // Bind a non-boolean data member (requires placeholder string)
+ template<typename C, typename M>
+ void bind( M C::* field, std::string const& placeholder ) {
+ m_arg->boundField = new Detail::BoundDataMember<C,M>( field );
+ m_arg->placeholder = placeholder;
+ }
+ // Bind a boolean data member (no placeholder required)
+ template<typename C>
+ void bind( bool C::* field ) {
+ m_arg->boundField = new Detail::BoundDataMember<C,bool>( field );
+ }
+
+ // Bind a method taking a single, non-boolean argument (requires a placeholder string)
+ template<typename C, typename M>
+ void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) {
+ m_arg->boundField = new Detail::BoundUnaryMethod<C,M>( unaryMethod );
+ m_arg->placeholder = placeholder;
+ }
+
+ // Bind a method taking a single, boolean argument (no placeholder string required)
+ template<typename C>
+ void bind( void (C::* unaryMethod)( bool ) ) {
+ m_arg->boundField = new Detail::BoundUnaryMethod<C,bool>( unaryMethod );
+ }
+
+ // Bind a method that takes no arguments (will be called if opt is present)
+ template<typename C>
+ void bind( void (C::* nullaryMethod)() ) {
+ m_arg->boundField = new Detail::BoundNullaryMethod<C>( nullaryMethod );
+ }
+
+ // Bind a free function taking a single argument - the object to operate on (no placeholder string required)
+ template<typename C>
+ void bind( void (* unaryFunction)( C& ) ) {
+ m_arg->boundField = new Detail::BoundUnaryFunction<C>( unaryFunction );
+ }
+
+ // Bind a free function taking a single argument - the object to operate on (requires a placeholder string)
+ template<typename C, typename T>
+ void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) {
+ m_arg->boundField = new Detail::BoundBinaryFunction<C, T>( binaryFunction );
+ m_arg->placeholder = placeholder;
+ }
+
+ ArgBuilder& describe( std::string const& description ) {
+ m_arg->description = description;
+ return *this;
+ }
+ ArgBuilder& detail( std::string const& detail ) {
+ m_arg->detail = detail;
+ return *this;
+ }
+
+ protected:
+ Arg* m_arg;
+ };
+
+ class OptBuilder : public ArgBuilder {
+ public:
+ OptBuilder( Arg* arg ) : ArgBuilder( arg ) {}
+ OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {}
+
+ OptBuilder& operator[]( std::string const& optName ) {
+ addOptName( *ArgBuilder::m_arg, optName );
+ return *this;
+ }
+ };
+
+ public:
+
+ CommandLine()
+ : m_boundProcessName( new Detail::NullBinder<ConfigT>() ),
+ m_highestSpecifiedArgPosition( 0 ),
+ m_throwOnUnrecognisedTokens( false )
+ {}
+ CommandLine( CommandLine const& other )
+ : m_boundProcessName( other.m_boundProcessName ),
+ m_options ( other.m_options ),
+ m_positionalArgs( other.m_positionalArgs ),
+ m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ),
+ m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
+ {
+ if( other.m_floatingArg.get() )
+ m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) );
+ }
+
+ CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
+ m_throwOnUnrecognisedTokens = shouldThrow;
+ return *this;
+ }
+
+ OptBuilder operator[]( std::string const& optName ) {
+ m_options.push_back( Arg() );
+ addOptName( m_options.back(), optName );
+ OptBuilder builder( &m_options.back() );
+ return builder;
+ }
+
+ ArgBuilder operator[]( int position ) {
+ m_positionalArgs.insert( std::make_pair( position, Arg() ) );
+ if( position > m_highestSpecifiedArgPosition )
+ m_highestSpecifiedArgPosition = position;
+ setPositionalArg( m_positionalArgs[position], position );
+ ArgBuilder builder( &m_positionalArgs[position] );
+ return builder;
+ }
+
+ // Invoke this with the _ instance
+ ArgBuilder operator[]( UnpositionalTag ) {
+ if( m_floatingArg.get() )
+ throw std::logic_error( "Only one unpositional argument can be added" );
+ m_floatingArg = ArgAutoPtr( new Arg() );
+ ArgBuilder builder( m_floatingArg.get() );
+ return builder;
+ }
+
+ template<typename C, typename M>
+ void bindProcessName( M C::* field ) {
+ m_boundProcessName = new Detail::BoundDataMember<C,M>( field );
+ }
+ template<typename C, typename M>
+ void bindProcessName( void (C::*_unaryMethod)( M ) ) {
+ m_boundProcessName = new Detail::BoundUnaryMethod<C,M>( _unaryMethod );
+ }
+
+ void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const {
+ typename std::vector<Arg>::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it;
+ std::size_t maxWidth = 0;
+ for( it = itBegin; it != itEnd; ++it )
+ maxWidth = (std::max)( maxWidth, it->commands().size() );
+
+ for( it = itBegin; it != itEnd; ++it ) {
+ Detail::Text usage( it->commands(), Detail::TextAttributes()
+ .setWidth( maxWidth+indent )
+ .setIndent( indent ) );
+ Detail::Text desc( it->description, Detail::TextAttributes()
+ .setWidth( width - maxWidth - 3 ) );
+
+ for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) {
+ std::string usageCol = i < usage.size() ? usage[i] : "";
+ os << usageCol;
+
+ if( i < desc.size() && !desc[i].empty() )
+ os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' )
+ << desc[i];
+ os << "\n";
+ }
+ }
+ }
+ std::string optUsage() const {
+ std::ostringstream oss;
+ optUsage( oss );
+ return oss.str();
+ }
+
+ void argSynopsis( std::ostream& os ) const {
+ for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) {
+ if( i > 1 )
+ os << " ";
+ typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( i );
+ if( it != m_positionalArgs.end() )
+ os << "<" << it->second.placeholder << ">";
+ else if( m_floatingArg.get() )
+ os << "<" << m_floatingArg->placeholder << ">";
+ else
+ throw std::logic_error( "non consecutive positional arguments with no floating args" );
+ }
+ // !TBD No indication of mandatory args
+ if( m_floatingArg.get() ) {
+ if( m_highestSpecifiedArgPosition > 1 )
+ os << " ";
+ os << "[<" << m_floatingArg->placeholder << "> ...]";
+ }
+ }
+ std::string argSynopsis() const {
+ std::ostringstream oss;
+ argSynopsis( oss );
+ return oss.str();
+ }
+
+ void usage( std::ostream& os, std::string const& procName ) const {
+ validate();
+ os << "usage:\n " << procName << " ";
+ argSynopsis( os );
+ if( !m_options.empty() ) {
+ os << " [options]\n\nwhere options are: \n";
+ optUsage( os, 2 );
+ }
+ os << "\n";
+ }
+ std::string usage( std::string const& procName ) const {
+ std::ostringstream oss;
+ usage( oss, procName );
+ return oss.str();
+ }
+
+ ConfigT parse( int argc, char const * const * argv ) const {
+ ConfigT config;
+ parseInto( argc, argv, config );
+ return config;
+ }
+
+ std::vector<Parser::Token> parseInto( int argc, char const * const * argv, ConfigT& config ) const {
+ std::string processName = argv[0];
+ std::size_t lastSlash = processName.find_last_of( "/\\" );
+ if( lastSlash != std::string::npos )
+ processName = processName.substr( lastSlash+1 );
+ m_boundProcessName.set( config, processName );
+ std::vector<Parser::Token> tokens;
+ Parser parser;
+ parser.parseIntoTokens( argc, argv, tokens );
+ return populate( tokens, config );
+ }
+
+ std::vector<Parser::Token> populate( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
+ validate();
+ std::vector<Parser::Token> unusedTokens = populateOptions( tokens, config );
+ unusedTokens = populateFixedArgs( unusedTokens, config );
+ unusedTokens = populateFloatingArgs( unusedTokens, config );
+ return unusedTokens;
+ }
+
+ std::vector<Parser::Token> populateOptions( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
+ std::vector<Parser::Token> unusedTokens;
+ std::vector<std::string> errors;
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
+ Parser::Token const& token = tokens[i];
+ typename std::vector<Arg>::const_iterator it = m_options.begin(), itEnd = m_options.end();
+ for(; it != itEnd; ++it ) {
+ Arg const& arg = *it;
+
+ try {
+ if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) ||
+ ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) {
+ if( arg.takesArg() ) {
+ if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional )
+ errors.push_back( "Expected argument to option: " + token.data );
+ else
+ arg.boundField.set( config, tokens[++i].data );
+ }
+ else {
+ arg.boundField.setFlag( config );
+ }
+ break;
+ }
+ }
+ catch( std::exception& ex ) {
+ errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" );
+ }
+ }
+ if( it == itEnd ) {
+ if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens )
+ unusedTokens.push_back( token );
+ else if( m_throwOnUnrecognisedTokens )
+ errors.push_back( "unrecognised option: " + token.data );
+ }
+ }
+ if( !errors.empty() ) {
+ std::ostringstream oss;
+ for( std::vector<std::string>::const_iterator it = errors.begin(), itEnd = errors.end();
+ it != itEnd;
+ ++it ) {
+ if( it != errors.begin() )
+ oss << "\n";
+ oss << *it;
+ }
+ throw std::runtime_error( oss.str() );
+ }
+ return unusedTokens;
+ }
+ std::vector<Parser::Token> populateFixedArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
+ std::vector<Parser::Token> unusedTokens;
+ int position = 1;
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
+ Parser::Token const& token = tokens[i];
+ typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( position );
+ if( it != m_positionalArgs.end() )
+ it->second.boundField.set( config, token.data );
+ else
+ unusedTokens.push_back( token );
+ if( token.type == Parser::Token::Positional )
+ position++;
+ }
+ return unusedTokens;
+ }
+ std::vector<Parser::Token> populateFloatingArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
+ if( !m_floatingArg.get() )
+ return tokens;
+ std::vector<Parser::Token> unusedTokens;
+ for( std::size_t i = 0; i < tokens.size(); ++i ) {
+ Parser::Token const& token = tokens[i];
+ if( token.type == Parser::Token::Positional )
+ m_floatingArg->boundField.set( config, token.data );
+ else
+ unusedTokens.push_back( token );
+ }
+ return unusedTokens;
+ }
+
+ void validate() const
+ {
+ if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() )
+ throw std::logic_error( "No options or arguments specified" );
+
+ for( typename std::vector<Arg>::const_iterator it = m_options.begin(),
+ itEnd = m_options.end();
+ it != itEnd; ++it )
+ it->validate();
+ }
+
+ private:
+ Detail::BoundArgFunction<ConfigT> m_boundProcessName;
+ std::vector<Arg> m_options;
+ std::map<int, Arg> m_positionalArgs;
+ ArgAutoPtr m_floatingArg;
+ int m_highestSpecifiedArgPosition;
+ bool m_throwOnUnrecognisedTokens;
+ };
+
+} // end namespace Clara
+
+STITCH_CLARA_CLOSE_NAMESPACE
+#undef STITCH_CLARA_OPEN_NAMESPACE
+#undef STITCH_CLARA_CLOSE_NAMESPACE
+
+#endif // TWOBLUECUBES_CLARA_H_INCLUDED
+#undef STITCH_CLARA_OPEN_NAMESPACE
+
+// Restore Clara's value for console width, if present
+#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
+#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
+#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
+#endif
+
+#include <fstream>
+
+namespace Catch {
+
+ inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; }
+ inline void abortAfterX( ConfigData& config, int x ) {
+ if( x < 1 )
+ throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" );
+ config.abortAfter = x;
+ }
+ inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); }
+
+ inline void addWarning( ConfigData& config, std::string const& _warning ) {
+ if( _warning == "NoAssertions" )
+ config.warnings = (WarnAbout::What)( config.warnings | WarnAbout::NoAssertions );
+ else
+ throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" );
+
+ }
+ inline void setVerbosity( ConfigData& config, int level ) {
+ // !TBD: accept strings?
+ config.verbosity = (Verbosity::Level)level;
+ }
+ inline void setShowDurations( ConfigData& config, bool _showDurations ) {
+ config.showDurations = _showDurations
+ ? ShowDurations::Always
+ : ShowDurations::Never;
+ }
+ inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) {
+ std::ifstream f( _filename.c_str() );
+ if( !f.is_open() )
+ throw std::domain_error( "Unable to load input file: " + _filename );
+
+ std::string line;
+ while( std::getline( f, line ) ) {
+ line = trim(line);
+ if( !line.empty() && !startsWith( line, "#" ) )
+ addTestOrTags( config, "\"" + line + "\"," );
+ }
+ }
+
+ inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
+
+ using namespace Clara;
+ CommandLine<ConfigData> cli;
+
+ cli.bindProcessName( &ConfigData::processName );
+
+ cli["-?"]["-h"]["--help"]
+ .describe( "display usage information" )
+ .bind( &ConfigData::showHelp );
+
+ cli["-l"]["--list-tests"]
+ .describe( "list all/matching test cases" )
+ .bind( &ConfigData::listTests );
+
+ cli["-t"]["--list-tags"]
+ .describe( "list all/matching tags" )
+ .bind( &ConfigData::listTags );
+
+ cli["-s"]["--success"]
+ .describe( "include successful tests in output" )
+ .bind( &ConfigData::showSuccessfulTests );
+
+ cli["-b"]["--break"]
+ .describe( "break into debugger on failure" )
+ .bind( &ConfigData::shouldDebugBreak );
+
+ cli["-e"]["--nothrow"]
+ .describe( "skip exception tests" )
+ .bind( &ConfigData::noThrow );
+
+ cli["-i"]["--invisibles"]
+ .describe( "show invisibles (tabs, newlines)" )
+ .bind( &ConfigData::showInvisibles );
+
+ cli["-o"]["--out"]
+ .describe( "output filename" )
+ .bind( &ConfigData::outputFilename, "filename" );
+
+ cli["-r"]["--reporter"]
+// .placeholder( "name[:filename]" )
+ .describe( "reporter to use (defaults to console)" )
+ .bind( &ConfigData::reporterName, "name" );
+
+ cli["-n"]["--name"]
+ .describe( "suite name" )
+ .bind( &ConfigData::name, "name" );
+
+ cli["-a"]["--abort"]
+ .describe( "abort at first failure" )
+ .bind( &abortAfterFirst );
+
+ cli["-x"]["--abortx"]
+ .describe( "abort after x failures" )
+ .bind( &abortAfterX, "no. failures" );
+
+ cli["-w"]["--warn"]
+ .describe( "enable warnings" )
+ .bind( &addWarning, "warning name" );
+
+// - needs updating if reinstated
+// cli.into( &setVerbosity )
+// .describe( "level of verbosity (0=no output)" )
+// .shortOpt( "v")
+// .longOpt( "verbosity" )
+// .placeholder( "level" );
+
+ cli[_]
+ .describe( "which test or tests to use" )
+ .bind( &addTestOrTags, "test name, pattern or tags" );
+
+ cli["-d"]["--durations"]
+ .describe( "show test durations" )
+ .bind( &setShowDurations, "yes/no" );
+
+ cli["-f"]["--input-file"]
+ .describe( "load test names to run from a file" )
+ .bind( &loadTestNamesFromFile, "filename" );
+
+ // Less common commands which don't have a short form
+ cli["--list-test-names-only"]
+ .describe( "list all/matching test cases names only" )
+ .bind( &ConfigData::listTestNamesOnly );
+
+ cli["--list-reporters"]
+ .describe( "list all reporters" )
+ .bind( &ConfigData::listReporters );
+
+ return cli;
+ }
+
+} // end namespace Catch
+
+// #included from: internal/catch_list.hpp
+#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED
+
+// #included from: catch_text.h
+#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED
+
+#define TBC_TEXT_FORMAT_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH
+
+#define CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE Catch
+// #included from: ../external/tbc_text_format.h
+// Only use header guard if we are not using an outer namespace
+#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
+# ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
+# define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
+# endif
+# else
+# define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
+# endif
+#endif
+#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
+#include <string>
+#include <vector>
+#include <sstream>
+
+// Use optional outer namespace
+#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
+#endif
+
+namespace Tbc {
+
+#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
+ const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
+#else
+ const unsigned int consoleWidth = 80;
+#endif
+
+ struct TextAttributes {
+ TextAttributes()
+ : initialIndent( std::string::npos ),
+ indent( 0 ),
+ width( consoleWidth-1 ),
+ tabChar( '\t' )
+ {}
+
+ TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; }
+ TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; }
+ TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; }
+ TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; }
+
+ std::size_t initialIndent; // indent of first line, or npos
+ std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos
+ std::size_t width; // maximum width of text, including indent. Longer text will wrap
+ char tabChar; // If this char is seen the indent is changed to current pos
+ };
+
+ class Text {
+ public:
+ Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
+ : attr( _attr )
+ {
+ std::string wrappableChars = " [({.,/|\\-";
+ std::size_t indent = _attr.initialIndent != std::string::npos
+ ? _attr.initialIndent
+ : _attr.indent;
+ std::string remainder = _str;
+
+ while( !remainder.empty() ) {
+ if( lines.size() >= 1000 ) {
+ lines.push_back( "... message truncated due to excessive size" );
+ return;
+ }
+ std::size_t tabPos = std::string::npos;
+ std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
+ std::size_t pos = remainder.find_first_of( '\n' );
+ if( pos <= width ) {
+ width = pos;
+ }
+ pos = remainder.find_last_of( _attr.tabChar, width );
+ if( pos != std::string::npos ) {
+ tabPos = pos;
+ if( remainder[width] == '\n' )
+ width--;
+ remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
+ }
+
+ if( width == remainder.size() ) {
+ spliceLine( indent, remainder, width );
+ }
+ else if( remainder[width] == '\n' ) {
+ spliceLine( indent, remainder, width );
+ if( width <= 1 || remainder.size() != 1 )
+ remainder = remainder.substr( 1 );
+ indent = _attr.indent;
+ }
+ else {
+ pos = remainder.find_last_of( wrappableChars, width );
+ if( pos != std::string::npos && pos > 0 ) {
+ spliceLine( indent, remainder, pos );
+ if( remainder[0] == ' ' )
+ remainder = remainder.substr( 1 );
+ }
+ else {
+ spliceLine( indent, remainder, width-1 );
+ lines.back() += "-";
+ }
+ if( lines.size() == 1 )
+ indent = _attr.indent;
+ if( tabPos != std::string::npos )
+ indent += tabPos;
+ }
+ }
+ }
+
+ void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
+ lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
+ _remainder = _remainder.substr( _pos );
+ }
+
+ typedef std::vector<std::string>::const_iterator const_iterator;
+
+ const_iterator begin() const { return lines.begin(); }
+ const_iterator end() const { return lines.end(); }
+ std::string const& last() const { return lines.back(); }
+ std::size_t size() const { return lines.size(); }
+ std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
+ std::string toString() const {
+ std::ostringstream oss;
+ oss << *this;
+ return oss.str();
+ }
+
+ inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
+ for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
+ it != itEnd; ++it ) {
+ if( it != _text.begin() )
+ _stream << "\n";
+ _stream << *it;
+ }
+ return _stream;
+ }
+
+ private:
+ std::string str;
+ TextAttributes attr;
+ std::vector<std::string> lines;
+ };
+
+} // end namespace Tbc
+
+#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+} // end outer namespace
+#endif
+
+#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
+#undef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
+
+namespace Catch {
+ using Tbc::Text;
+ using Tbc::TextAttributes;
+}
+
+// #included from: catch_console_colour.hpp
+#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
+
+namespace Catch {
+
+ namespace Detail {
+ struct IColourImpl;
+ }
+
+ struct Colour {
+ enum Code {
+ None = 0,
+
+ White,
+ Red,
+ Green,
+ Blue,
+ Cyan,
+ Yellow,
+ Grey,
+
+ Bright = 0x10,
+
+ BrightRed = Bright | Red,
+ BrightGreen = Bright | Green,
+ LightGrey = Bright | Grey,
+ BrightWhite = Bright | White,
+
+ // By intention
+ FileName = LightGrey,
+ ResultError = BrightRed,
+ ResultSuccess = BrightGreen,
+
+ Error = BrightRed,
+ Success = Green,
+
+ OriginalExpression = Cyan,
+ ReconstructedExpression = Yellow,
+
+ SecondaryText = LightGrey,
+ Headers = White
+ };
+
+ // Use constructed object for RAII guard
+ Colour( Code _colourCode );
+ ~Colour();
+
+ // Use static method for one-shot changes
+ static void use( Code _colourCode );
+
+ private:
+ Colour( Colour const& other );
+ static Detail::IColourImpl* impl();
+ };
+
+} // end namespace Catch
+
+// #included from: catch_interfaces_reporter.h
+#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
+
+// #included from: catch_option.hpp
+#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED
+
+namespace Catch {
+
+ // An optional type
+ template<typename T>
+ class Option {
+ public:
+ Option() : nullableValue( NULL ) {}
+ Option( T const& _value )
+ : nullableValue( new( storage ) T( _value ) )
+ {}
+ Option( Option const& _other )
+ : nullableValue( _other ? new( storage ) T( *_other ) : NULL )
+ {}
+
+ ~Option() {
+ reset();
+ }
+
+ Option& operator= ( Option const& _other ) {
+ if( &_other != this ) {
+ reset();
+ if( _other )
+ nullableValue = new( storage ) T( *_other );
+ }
+ return *this;
+ }
+ Option& operator = ( T const& _value ) {
+ reset();
+ nullableValue = new( storage ) T( _value );
+ return *this;
+ }
+
+ void reset() {
+ if( nullableValue )
+ nullableValue->~T();
+ nullableValue = NULL;
+ }
+
+ T& operator*() { return *nullableValue; }
+ T const& operator*() const { return *nullableValue; }
+ T* operator->() { return nullableValue; }
+ const T* operator->() const { return nullableValue; }
+
+ T valueOr( T const& defaultValue ) const {
+ return nullableValue ? *nullableValue : defaultValue;
+ }
+
+ bool some() const { return nullableValue != NULL; }
+ bool none() const { return nullableValue == NULL; }
+
+ bool operator !() const { return nullableValue == NULL; }
+ operator SafeBool::type() const {
+ return SafeBool::makeSafe( some() );
+ }
+
+ private:
+ T* nullableValue;
+ char storage[sizeof(T)];
+ };
+
+} // end namespace Catch
+
+#include <string>
+#include <ostream>
+#include <map>
+#include <assert.h>
+
+namespace Catch
+{
+ struct ReporterConfig {
+ explicit ReporterConfig( Ptr<IConfig> const& _fullConfig )
+ : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
+
+ ReporterConfig( Ptr<IConfig> const& _fullConfig, std::ostream& _stream )
+ : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
+
+ std::ostream& stream() const { return *m_stream; }
+ Ptr<IConfig> fullConfig() const { return m_fullConfig; }
+
+ private:
+ std::ostream* m_stream;
+ Ptr<IConfig> m_fullConfig;
+ };
+
+ struct ReporterPreferences {
+ ReporterPreferences()
+ : shouldRedirectStdOut( false )
+ {}
+
+ bool shouldRedirectStdOut;
+ };
+
+ template<typename T>
+ struct LazyStat : Option<T> {
+ LazyStat() : used( false ) {}
+ LazyStat& operator=( T const& _value ) {
+ Option<T>::operator=( _value );
+ used = false;
+ return *this;
+ }
+ void reset() {
+ Option<T>::reset();
+ used = false;
+ }
+ bool used;
+ };
+
+ struct TestRunInfo {
+ TestRunInfo( std::string const& _name ) : name( _name ) {}
+ std::string name;
+ };
+ struct GroupInfo {
+ GroupInfo( std::string const& _name,
+ std::size_t _groupIndex,
+ std::size_t _groupsCount )
+ : name( _name ),
+ groupIndex( _groupIndex ),
+ groupsCounts( _groupsCount )
+ {}
+
+ std::string name;
+ std::size_t groupIndex;
+ std::size_t groupsCounts;
+ };
+
+ struct AssertionStats {
+ AssertionStats( AssertionResult const& _assertionResult,
+ std::vector<MessageInfo> const& _infoMessages,
+ Totals const& _totals )
+ : assertionResult( _assertionResult ),
+ infoMessages( _infoMessages ),
+ totals( _totals )
+ {
+ if( assertionResult.hasMessage() ) {
+ // Copy message into messages list.
+ // !TBD This should have been done earlier, somewhere
+ MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
+ builder << assertionResult.getMessage();
+ builder.m_info.message = builder.m_stream.str();
+
+ infoMessages.push_back( builder.m_info );
+ }
+ }
+ virtual ~AssertionStats();
+
+# ifdef CATCH_CPP11_OR_GREATER
+ AssertionStats( AssertionStats const& ) = default;
+ AssertionStats( AssertionStats && ) = default;
+ AssertionStats& operator = ( AssertionStats const& ) = default;
+ AssertionStats& operator = ( AssertionStats && ) = default;
+# endif
+
+ AssertionResult assertionResult;
+ std::vector<MessageInfo> infoMessages;
+ Totals totals;
+ };
+
+ struct SectionStats {
+ SectionStats( SectionInfo const& _sectionInfo,
+ Counts const& _assertions,
+ double _durationInSeconds,
+ bool _missingAssertions )
+ : sectionInfo( _sectionInfo ),
+ assertions( _assertions ),
+ durationInSeconds( _durationInSeconds ),
+ missingAssertions( _missingAssertions )
+ {}
+ virtual ~SectionStats();
+# ifdef CATCH_CPP11_OR_GREATER
+ SectionStats( SectionStats const& ) = default;
+ SectionStats( SectionStats && ) = default;
+ SectionStats& operator = ( SectionStats const& ) = default;
+ SectionStats& operator = ( SectionStats && ) = default;
+# endif
+
+ SectionInfo sectionInfo;
+ Counts assertions;
+ double durationInSeconds;
+ bool missingAssertions;
+ };
+
+ struct TestCaseStats {
+ TestCaseStats( TestCaseInfo const& _testInfo,
+ Totals const& _totals,
+ std::string const& _stdOut,
+ std::string const& _stdErr,
+ bool _aborting )
+ : testInfo( _testInfo ),
+ totals( _totals ),
+ stdOut( _stdOut ),
+ stdErr( _stdErr ),
+ aborting( _aborting )
+ {}
+ virtual ~TestCaseStats();
+
+# ifdef CATCH_CPP11_OR_GREATER
+ TestCaseStats( TestCaseStats const& ) = default;
+ TestCaseStats( TestCaseStats && ) = default;
+ TestCaseStats& operator = ( TestCaseStats const& ) = default;
+ TestCaseStats& operator = ( TestCaseStats && ) = default;
+# endif
+
+ TestCaseInfo testInfo;
+ Totals totals;
+ std::string stdOut;
+ std::string stdErr;
+ bool aborting;
+ };
+
+ struct TestGroupStats {
+ TestGroupStats( GroupInfo const& _groupInfo,
+ Totals const& _totals,
+ bool _aborting )
+ : groupInfo( _groupInfo ),
+ totals( _totals ),
+ aborting( _aborting )
+ {}
+ TestGroupStats( GroupInfo const& _groupInfo )
+ : groupInfo( _groupInfo ),
+ aborting( false )
+ {}
+ virtual ~TestGroupStats();
+
+# ifdef CATCH_CPP11_OR_GREATER
+ TestGroupStats( TestGroupStats const& ) = default;
+ TestGroupStats( TestGroupStats && ) = default;
+ TestGroupStats& operator = ( TestGroupStats const& ) = default;
+ TestGroupStats& operator = ( TestGroupStats && ) = default;
+# endif
+
+ GroupInfo groupInfo;
+ Totals totals;
+ bool aborting;
+ };
+
+ struct TestRunStats {
+ TestRunStats( TestRunInfo const& _runInfo,
+ Totals const& _totals,
+ bool _aborting )
+ : runInfo( _runInfo ),
+ totals( _totals ),
+ aborting( _aborting )
+ {}
+ virtual ~TestRunStats();
+
+# ifndef CATCH_CPP11_OR_GREATER
+ TestRunStats( TestRunStats const& _other )
+ : runInfo( _other.runInfo ),
+ totals( _other.totals ),
+ aborting( _other.aborting )
+ {}
+# else
+ TestRunStats( TestRunStats const& ) = default;
+ TestRunStats( TestRunStats && ) = default;
+ TestRunStats& operator = ( TestRunStats const& ) = default;
+ TestRunStats& operator = ( TestRunStats && ) = default;
+# endif
+
+ TestRunInfo runInfo;
+ Totals totals;
+ bool aborting;
+ };
+
+ struct IStreamingReporter : IShared {
+ virtual ~IStreamingReporter();
+
+ // Implementing class must also provide the following static method:
+ // static std::string getDescription();
+
+ virtual ReporterPreferences getPreferences() const = 0;
+
+ virtual void noMatchingTestCases( std::string const& spec ) = 0;
+
+ virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
+ virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0;
+
+ virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
+ virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
+
+ virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
+
+ virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
+ virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
+ virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
+ virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
+ virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
+ };
+
+ struct IReporterFactory {
+ virtual ~IReporterFactory();
+ virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0;
+ virtual std::string getDescription() const = 0;
+ };
+
+ struct IReporterRegistry {
+ typedef std::map<std::string, IReporterFactory*> FactoryMap;
+
+ virtual ~IReporterRegistry();
+ virtual IStreamingReporter* create( std::string const& name, Ptr<IConfig> const& config ) const = 0;
+ virtual FactoryMap const& getFactories() const = 0;
+ };
+
+}
+
+#include <limits>
+#include <algorithm>
+
+namespace Catch {
+
+ inline std::size_t listTests( Config const& config ) {
+
+ TestSpec testSpec = config.testSpec();
+ if( config.testSpec().hasFilters() )
+ std::cout << "Matching test cases:\n";
+ else {
+ std::cout << "All available test cases:\n";
+ testSpec = TestSpecParser().parse( "*" ).testSpec();
+ }
+
+ std::size_t matchedTests = 0;
+ TextAttributes nameAttr, tagsAttr;
+ nameAttr.setInitialIndent( 2 ).setIndent( 4 );
+ tagsAttr.setIndent( 6 );
+
+ std::vector<TestCase> matchedTestCases;
+ getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases );
+ for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
+ it != itEnd;
+ ++it ) {
+ matchedTests++;
+ TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
+ Colour::Code colour = testCaseInfo.isHidden
+ ? Colour::SecondaryText
+ : Colour::None;
+ Colour colourGuard( colour );
+
+ std::cout << Text( testCaseInfo.name, nameAttr ) << std::endl;
+ if( !testCaseInfo.tags.empty() )
+ std::cout << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl;
+ }
+
+ if( !config.testSpec().hasFilters() )
+ std::cout << pluralise( matchedTests, "test case" ) << "\n" << std::endl;
+ else
+ std::cout << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl;
+ return matchedTests;
+ }
+
+ inline std::size_t listTestsNamesOnly( Config const& config ) {
+ TestSpec testSpec = config.testSpec();
+ if( !config.testSpec().hasFilters() )
+ testSpec = TestSpecParser().parse( "*" ).testSpec();
+ std::size_t matchedTests = 0;
+ std::vector<TestCase> matchedTestCases;
+ getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases );
+ for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
+ it != itEnd;
+ ++it ) {
+ matchedTests++;
+ TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
+ std::cout << testCaseInfo.name << std::endl;
+ }
+ return matchedTests;
+ }
+
+ struct TagInfo {
+ TagInfo() : count ( 0 ) {}
+ void add( std::string const& spelling ) {
+ ++count;
+ spellings.insert( spelling );
+ }
+ std::string all() const {
+ std::string out;
+ for( std::set<std::string>::const_iterator it = spellings.begin(), itEnd = spellings.end();
+ it != itEnd;
+ ++it )
+ out += "[" + *it + "]";
+ return out;
+ }
+ std::set<std::string> spellings;
+ std::size_t count;
+ };
+
+ inline std::size_t listTags( Config const& config ) {
+ TestSpec testSpec = config.testSpec();
+ if( config.testSpec().hasFilters() )
+ std::cout << "Tags for matching test cases:\n";
+ else {
+ std::cout << "All available tags:\n";
+ testSpec = TestSpecParser().parse( "*" ).testSpec();
+ }
+
+ std::map<std::string, TagInfo> tagCounts;
+
+ std::vector<TestCase> matchedTestCases;
+ getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, config, matchedTestCases );
+ for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
+ it != itEnd;
+ ++it ) {
+ for( std::set<std::string>::const_iterator tagIt = it->getTestCaseInfo().tags.begin(),
+ tagItEnd = it->getTestCaseInfo().tags.end();
+ tagIt != tagItEnd;
+ ++tagIt ) {
+ std::string tagName = *tagIt;
+ std::string lcaseTagName = toLower( tagName );
+ std::map<std::string, TagInfo>::iterator countIt = tagCounts.find( lcaseTagName );
+ if( countIt == tagCounts.end() )
+ countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first;
+ countIt->second.add( tagName );
+ }
+ }
+
+ for( std::map<std::string, TagInfo>::const_iterator countIt = tagCounts.begin(),
+ countItEnd = tagCounts.end();
+ countIt != countItEnd;
+ ++countIt ) {
+ std::ostringstream oss;
+ oss << " " << std::setw(2) << countIt->second.count << " ";
+ Text wrapper( countIt->second.all(), TextAttributes()
+ .setInitialIndent( 0 )
+ .setIndent( oss.str().size() )
+ .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) );
+ std::cout << oss.str() << wrapper << "\n";
+ }
+ std::cout << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl;
+ return tagCounts.size();
+ }
+
+ inline std::size_t listReporters( Config const& /*config*/ ) {
+ std::cout << "Available reports:\n";
+ IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
+ IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it;
+ std::size_t maxNameLen = 0;
+ for(it = itBegin; it != itEnd; ++it )
+ maxNameLen = (std::max)( maxNameLen, it->first.size() );
+
+ for(it = itBegin; it != itEnd; ++it ) {
+ Text wrapper( it->second->getDescription(), TextAttributes()
+ .setInitialIndent( 0 )
+ .setIndent( 7+maxNameLen )
+ .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) );
+ std::cout << " "
+ << it->first
+ << ":"
+ << std::string( maxNameLen - it->first.size() + 2, ' ' )
+ << wrapper << "\n";
+ }
+ std::cout << std::endl;
+ return factories.size();
+ }
+
+ inline Option<std::size_t> list( Config const& config ) {
+ Option<std::size_t> listedCount;
+ if( config.listTests() )
+ listedCount = listedCount.valueOr(0) + listTests( config );
+ if( config.listTestNamesOnly() )
+ listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );
+ if( config.listTags() )
+ listedCount = listedCount.valueOr(0) + listTags( config );
+ if( config.listReporters() )
+ listedCount = listedCount.valueOr(0) + listReporters( config );
+ return listedCount;
+ }
+
+} // end namespace Catch
+
+// #included from: internal/catch_runner_impl.hpp
+#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
+
+// #included from: catch_test_case_tracker.hpp
+#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
+
+#include <map>
+#include <string>
+#include <assert.h>
+
+namespace Catch {
+namespace SectionTracking {
+
+ class TrackedSection {
+
+ typedef std::map<std::string, TrackedSection> TrackedSections;
+
+ public:
+ enum RunState {
+ NotStarted,
+ Executing,
+ ExecutingChildren,
+ Completed
+ };
+
+ TrackedSection( std::string const& name, TrackedSection* parent )
+ : m_name( name ), m_runState( NotStarted ), m_parent( parent )
+ {}
+
+ RunState runState() const { return m_runState; }
+
+ TrackedSection* findChild( std::string const& childName ) {
+ TrackedSections::iterator it = m_children.find( childName );
+ return it != m_children.end()
+ ? &it->second
+ : NULL;
+ }
+ TrackedSection* acquireChild( std::string const& childName ) {
+ if( TrackedSection* child = findChild( childName ) )
+ return child;
+ m_children.insert( std::make_pair( childName, TrackedSection( childName, this ) ) );
+ return findChild( childName );
+ }
+ void enter() {
+ if( m_runState == NotStarted )
+ m_runState = Executing;
+ }
+ void leave() {
+ for( TrackedSections::const_iterator it = m_children.begin(), itEnd = m_children.end();
+ it != itEnd;
+ ++it )
+ if( it->second.runState() != Completed ) {
+ m_runState = ExecutingChildren;
+ return;
+ }
+ m_runState = Completed;
+ }
+ TrackedSection* getParent() {
+ return m_parent;
+ }
+ bool hasChildren() const {
+ return !m_children.empty();
+ }
+
+ private:
+ std::string m_name;
+ RunState m_runState;
+ TrackedSections m_children;
+ TrackedSection* m_parent;
+
+ };
+
+ class TestCaseTracker {
+ public:
+ TestCaseTracker( std::string const& testCaseName )
+ : m_testCase( testCaseName, NULL ),
+ m_currentSection( &m_testCase ),
+ m_completedASectionThisRun( false )
+ {}
+
+ bool enterSection( std::string const& name ) {
+ TrackedSection* child = m_currentSection->acquireChild( name );
+ if( m_completedASectionThisRun || child->runState() == TrackedSection::Completed )
+ return false;
+
+ m_currentSection = child;
+ m_currentSection->enter();
+ return true;
+ }
+ void leaveSection() {
+ m_currentSection->leave();
+ m_currentSection = m_currentSection->getParent();
+ assert( m_currentSection != NULL );
+ m_completedASectionThisRun = true;
+ }
+
+ bool currentSectionHasChildren() const {
+ return m_currentSection->hasChildren();
+ }
+ bool isCompleted() const {
+ return m_testCase.runState() == TrackedSection::Completed;
+ }
+
+ class Guard {
+ public:
+ Guard( TestCaseTracker& tracker ) : m_tracker( tracker ) {
+ m_tracker.enterTestCase();
+ }
+ ~Guard() {
+ m_tracker.leaveTestCase();
+ }
+ private:
+ Guard( Guard const& );
+ void operator = ( Guard const& );
+ TestCaseTracker& m_tracker;
+ };
+
+ private:
+ void enterTestCase() {
+ m_currentSection = &m_testCase;
+ m_completedASectionThisRun = false;
+ m_testCase.enter();
+ }
+ void leaveTestCase() {
+ m_testCase.leave();
+ }
+
+ TrackedSection m_testCase;
+ TrackedSection* m_currentSection;
+ bool m_completedASectionThisRun;
+ };
+
+} // namespace SectionTracking
+
+using SectionTracking::TestCaseTracker;
+
+} // namespace Catch
+
+#include <set>
+#include <string>
+
+namespace Catch {
+
+ class StreamRedirect {
+
+ public:
+ StreamRedirect( std::ostream& stream, std::string& targetString )
+ : m_stream( stream ),
+ m_prevBuf( stream.rdbuf() ),
+ m_targetString( targetString )
+ {
+ stream.rdbuf( m_oss.rdbuf() );
+ }
+
+ ~StreamRedirect() {
+ m_targetString += m_oss.str();
+ m_stream.rdbuf( m_prevBuf );
+ }
+
+ private:
+ std::ostream& m_stream;
+ std::streambuf* m_prevBuf;
+ std::ostringstream m_oss;
+ std::string& m_targetString;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class RunContext : public IResultCapture, public IRunner {
+
+ RunContext( RunContext const& );
+ void operator =( RunContext const& );
+
+ public:
+
+ explicit RunContext( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> const& reporter )
+ : m_runInfo( config->name() ),
+ m_context( getCurrentMutableContext() ),
+ m_activeTestCase( NULL ),
+ m_config( config ),
+ m_reporter( reporter ),
+ m_prevRunner( m_context.getRunner() ),
+ m_prevResultCapture( m_context.getResultCapture() ),
+ m_prevConfig( m_context.getConfig() )
+ {
+ m_context.setRunner( this );
+ m_context.setConfig( m_config );
+ m_context.setResultCapture( this );
+ m_reporter->testRunStarting( m_runInfo );
+ }
+
+ virtual ~RunContext() {
+ m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
+ m_context.setRunner( m_prevRunner );
+ m_context.setConfig( NULL );
+ m_context.setResultCapture( m_prevResultCapture );
+ m_context.setConfig( m_prevConfig );
+ }
+
+ void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) {
+ m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) );
+ }
+ void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) {
+ m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) );
+ }
+
+ Totals runTest( TestCase const& testCase ) {
+ Totals prevTotals = m_totals;
+
+ std::string redirectedCout;
+ std::string redirectedCerr;
+
+ TestCaseInfo testInfo = testCase.getTestCaseInfo();
+
+ m_reporter->testCaseStarting( testInfo );
+
+ m_activeTestCase = &testCase;
+ m_testCaseTracker = TestCaseTracker( testInfo.name );
+
+ do {
+ do {
+ runCurrentTest( redirectedCout, redirectedCerr );
+ }
+ while( !m_testCaseTracker->isCompleted() && !aborting() );
+ }
+ while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() );
+
+ Totals deltaTotals = m_totals.delta( prevTotals );
+ m_totals.testCases += deltaTotals.testCases;
+ m_reporter->testCaseEnded( TestCaseStats( testInfo,
+ deltaTotals,
+ redirectedCout,
+ redirectedCerr,
+ aborting() ) );
+
+ m_activeTestCase = NULL;
+ m_testCaseTracker.reset();
+
+ return deltaTotals;
+ }
+
+ Ptr<IConfig const> config() const {
+ return m_config;
+ }
+
+ private: // IResultCapture
+
+ virtual ResultAction::Value acceptExpression( ExpressionResultBuilder const& assertionResult, AssertionInfo const& assertionInfo ) {
+ m_lastAssertionInfo = assertionInfo;
+ return actOnCurrentResult( assertionResult.buildResult( assertionInfo ) );
+ }
+
+ virtual void assertionEnded( AssertionResult const& result ) {
+ if( result.getResultType() == ResultWas::Ok ) {
+ m_totals.assertions.passed++;
+ }
+ else if( !result.isOk() ) {
+ m_totals.assertions.failed++;
+ }
+
+ if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
+ m_messages.clear();
+
+ // Reset working state
+ m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
+ }
+
+ virtual bool sectionStarted (
+ SectionInfo const& sectionInfo,
+ Counts& assertions
+ )
+ {
+ std::ostringstream oss;
+ oss << sectionInfo.name << "@" << sectionInfo.lineInfo;
+
+ if( !m_testCaseTracker->enterSection( oss.str() ) )
+ return false;
+
+ m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
+
+ m_reporter->sectionStarting( sectionInfo );
+
+ assertions = m_totals.assertions;
+
+ return true;
+ }
+ bool testForMissingAssertions( Counts& assertions ) {
+ if( assertions.total() != 0 ||
+ !m_config->warnAboutMissingAssertions() ||
+ m_testCaseTracker->currentSectionHasChildren() )
+ return false;
+ m_totals.assertions.failed++;
+ assertions.failed++;
+ return true;
+ }
+
+ virtual void sectionEnded( SectionInfo const& info, Counts const& prevAssertions, double _durationInSeconds ) {
+ if( std::uncaught_exception() ) {
+ m_unfinishedSections.push_back( UnfinishedSections( info, prevAssertions, _durationInSeconds ) );
+ return;
+ }
+
+ Counts assertions = m_totals.assertions - prevAssertions;
+ bool missingAssertions = testForMissingAssertions( assertions );
+
+ m_testCaseTracker->leaveSection();
+
+ m_reporter->sectionEnded( SectionStats( info, assertions, _durationInSeconds, missingAssertions ) );
+ m_messages.clear();
+ }
+
+ virtual void pushScopedMessage( MessageInfo const& message ) {
+ m_messages.push_back( message );
+ }
+
+ virtual void popScopedMessage( MessageInfo const& message ) {
+ m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() );
+ }
+
+ virtual bool shouldDebugBreak() const {
+ return m_config->shouldDebugBreak();
+ }
+
+ virtual std::string getCurrentTestName() const {
+ return m_activeTestCase
+ ? m_activeTestCase->getTestCaseInfo().name
+ : "";
+ }
+
+ virtual const AssertionResult* getLastResult() const {
+ return &m_lastResult;
+ }
+
+ public:
+ // !TBD We need to do this another way!
+ bool aborting() const {
+ return m_totals.assertions.failed == static_cast<std::size_t>( m_config->abortAfter() );
+ }
+
+ private:
+
+ ResultAction::Value actOnCurrentResult( AssertionResult const& result ) {
+ m_lastResult = result;
+ assertionEnded( m_lastResult );
+
+ ResultAction::Value action = ResultAction::None;
+
+ if( !m_lastResult.isOk() ) {
+ action = ResultAction::Failed;
+ if( shouldDebugBreak() )
+ action = (ResultAction::Value)( action | ResultAction::Debug );
+ if( aborting() )
+ action = (ResultAction::Value)( action | ResultAction::Abort );
+ }
+ return action;
+ }
+
+ void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) {
+ TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
+ SectionInfo testCaseSection( testCaseInfo.name, testCaseInfo.description, testCaseInfo.lineInfo );
+ m_reporter->sectionStarting( testCaseSection );
+ Counts prevAssertions = m_totals.assertions;
+ double duration = 0;
+ try {
+ m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal );
+ TestCaseTracker::Guard guard( *m_testCaseTracker );
+
+ Timer timer;
+ timer.start();
+ if( m_reporter->getPreferences().shouldRedirectStdOut ) {
+ StreamRedirect coutRedir( std::cout, redirectedCout );
+ StreamRedirect cerrRedir( std::cerr, redirectedCerr );
+ m_activeTestCase->invoke();
+ }
+ else {
+ m_activeTestCase->invoke();
+ }
+ duration = timer.getElapsedSeconds();
+ }
+ catch( TestFailureException& ) {
+ // This just means the test was aborted due to failure
+ }
+ catch(...) {
+ ExpressionResultBuilder exResult( ResultWas::ThrewException );
+ exResult << translateActiveException();
+ actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo ) );
+ }
+ // If sections ended prematurely due to an exception we stored their
+ // infos here so we can tear them down outside the unwind process.
+ for( std::vector<UnfinishedSections>::const_reverse_iterator it = m_unfinishedSections.rbegin(),
+ itEnd = m_unfinishedSections.rend();
+ it != itEnd;
+ ++it )
+ sectionEnded( it->info, it->prevAssertions, it->durationInSeconds );
+ m_unfinishedSections.clear();
+ m_messages.clear();
+
+ Counts assertions = m_totals.assertions - prevAssertions;
+ bool missingAssertions = testForMissingAssertions( assertions );
+
+ SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions );
+ m_reporter->sectionEnded( testCaseSectionStats );
+ }
+
+ private:
+ struct UnfinishedSections {
+ UnfinishedSections( SectionInfo const& _info, Counts const& _prevAssertions, double _durationInSeconds )
+ : info( _info ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
+ {}
+
+ SectionInfo info;
+ Counts prevAssertions;
+ double durationInSeconds;
+ };
+
+ TestRunInfo m_runInfo;
+ IMutableContext& m_context;
+ TestCase const* m_activeTestCase;
+ Option<TestCaseTracker> m_testCaseTracker;
+ AssertionResult m_lastResult;
+
+ Ptr<IConfig const> m_config;
+ Totals m_totals;
+ Ptr<IStreamingReporter> m_reporter;
+ std::vector<MessageInfo> m_messages;
+ IRunner* m_prevRunner;
+ IResultCapture* m_prevResultCapture;
+ Ptr<IConfig const> m_prevConfig;
+ AssertionInfo m_lastAssertionInfo;
+ std::vector<UnfinishedSections> m_unfinishedSections;
+ };
+
+} // end namespace Catch
+
+// #included from: internal/catch_version.h
+#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED
+
+namespace Catch {
+
+ // Versioning information
+ struct Version {
+ Version( unsigned int _majorVersion,
+ unsigned int _minorVersion,
+ unsigned int _buildNumber,
+ char const* const _branchName )
+ : majorVersion( _majorVersion ),
+ minorVersion( _minorVersion ),
+ buildNumber( _buildNumber ),
+ branchName( _branchName )
+ {}
+
+ unsigned int const majorVersion;
+ unsigned int const minorVersion;
+ unsigned int const buildNumber;
+ char const* const branchName;
+
+ private:
+ void operator=( Version const& );
+ };
+
+ extern Version libraryVersion;
+}
+
+#include <fstream>
+#include <stdlib.h>
+#include <limits>
+
+namespace Catch {
+
+ class Runner {
+
+ public:
+ Runner( Ptr<Config> const& config )
+ : m_config( config )
+ {
+ openStream();
+ makeReporter();
+ }
+
+ Totals runTests() {
+
+ RunContext context( m_config.get(), m_reporter );
+
+ Totals totals;
+
+ context.testGroupStarting( "", 1, 1 ); // deprecated?
+
+ TestSpec testSpec = m_config->testSpec();
+ if( !testSpec.hasFilters() )
+ testSpec = TestSpecParser().parse( "~[.]" ).testSpec(); // All not hidden tests
+
+ std::vector<TestCase> testCases;
+ getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, testCases );
+
+ int testsRunForGroup = 0;
+ for( std::vector<TestCase>::const_iterator it = testCases.begin(), itEnd = testCases.end();
+ it != itEnd;
+ ++it ) {
+ testsRunForGroup++;
+ if( m_testsAlreadyRun.find( *it ) == m_testsAlreadyRun.end() ) {
+
+ if( context.aborting() )
+ break;
+
+ totals += context.runTest( *it );
+ m_testsAlreadyRun.insert( *it );
+ }
+ }
+ context.testGroupEnded( "", totals, 1, 1 );
+ return totals;
+ }
+
+ private:
+ void openStream() {
+ // Open output file, if specified
+ if( !m_config->getFilename().empty() ) {
+ m_ofs.open( m_config->getFilename().c_str() );
+ if( m_ofs.fail() ) {
+ std::ostringstream oss;
+ oss << "Unable to open file: '" << m_config->getFilename() << "'";
+ throw std::domain_error( oss.str() );
+ }
+ m_config->setStreamBuf( m_ofs.rdbuf() );
+ }
+ }
+ void makeReporter() {
+ std::string reporterName = m_config->getReporterName().empty()
+ ? "console"
+ : m_config->getReporterName();
+
+ m_reporter = getRegistryHub().getReporterRegistry().create( reporterName, m_config.get() );
+ if( !m_reporter ) {
+ std::ostringstream oss;
+ oss << "No reporter registered with name: '" << reporterName << "'";
+ throw std::domain_error( oss.str() );
+ }
+ }
+
+ private:
+ Ptr<Config> m_config;
+ std::ofstream m_ofs;
+ Ptr<IStreamingReporter> m_reporter;
+ std::set<TestCase> m_testsAlreadyRun;
+ };
+
+ class Session {
+ static bool alreadyInstantiated;
+
+ public:
+
+ struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; };
+
+ Session()
+ : m_cli( makeCommandLineParser() ) {
+ if( alreadyInstantiated ) {
+ std::string msg = "Only one instance of Catch::Session can ever be used";
+ std::cerr << msg << std::endl;
+ throw std::logic_error( msg );
+ }
+ alreadyInstantiated = true;
+ }
+ ~Session() {
+ Catch::cleanUp();
+ }
+
+ void showHelp( std::string const& processName ) {
+ std::cout << "\nCatch v" << libraryVersion.majorVersion << "."
+ << libraryVersion.minorVersion << " build "
+ << libraryVersion.buildNumber;
+ if( libraryVersion.branchName != std::string( "master" ) )
+ std::cout << " (" << libraryVersion.branchName << " branch)";
+ std::cout << "\n";
+
+ m_cli.usage( std::cout, processName );
+ std::cout << "For more detail usage please see the project docs\n" << std::endl;
+ }
+
+ int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) {
+ try {
+ m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail );
+ m_unusedTokens = m_cli.parseInto( argc, argv, m_configData );
+ if( m_configData.showHelp )
+ showHelp( m_configData.processName );
+ m_config.reset();
+ }
+ catch( std::exception& ex ) {
+ {
+ Colour colourGuard( Colour::Red );
+ std::cerr << "\nError(s) in input:\n"
+ << Text( ex.what(), TextAttributes().setIndent(2) )
+ << "\n\n";
+ }
+ m_cli.usage( std::cout, m_configData.processName );
+ return (std::numeric_limits<int>::max)();
+ }
+ return 0;
+ }
+
+ void useConfigData( ConfigData const& _configData ) {
+ m_configData = _configData;
+ m_config.reset();
+ }
+
+ int run( int argc, char* const argv[] ) {
+
+ int returnCode = applyCommandLine( argc, argv );
+ if( returnCode == 0 )
+ returnCode = run();
+ return returnCode;
+ }
+
+ int run() {
+ if( m_configData.showHelp )
+ return 0;
+
+ try
+ {
+ config(); // Force config to be constructed
+ Runner runner( m_config );
+
+ // Handle list request
+ if( Option<std::size_t> listed = list( config() ) )
+ return static_cast<int>( *listed );
+
+ return static_cast<int>( runner.runTests().assertions.failed );
+ }
+ catch( std::exception& ex ) {
+ std::cerr << ex.what() << std::endl;
+ return (std::numeric_limits<int>::max)();
+ }
+ }
+
+ Clara::CommandLine<ConfigData> const& cli() const {
+ return m_cli;
+ }
+ std::vector<Clara::Parser::Token> const& unusedTokens() const {
+ return m_unusedTokens;
+ }
+ ConfigData& configData() {
+ return m_configData;
+ }
+ Config& config() {
+ if( !m_config )
+ m_config = new Config( m_configData );
+ return *m_config;
+ }
+
+ private:
+ Clara::CommandLine<ConfigData> m_cli;
+ std::vector<Clara::Parser::Token> m_unusedTokens;
+ ConfigData m_configData;
+ Ptr<Config> m_config;
+ };
+
+ bool Session::alreadyInstantiated = false;
+
+} // end namespace Catch
+
+// #included from: catch_registry_hub.hpp
+#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED
+
+// #included from: catch_test_case_registry_impl.hpp
+#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
+
+#include <vector>
+#include <set>
+#include <sstream>
+#include <iostream>
+
+namespace Catch {
+
+ class TestRegistry : public ITestCaseRegistry {
+ public:
+ TestRegistry() : m_unnamedCount( 0 ) {}
+ virtual ~TestRegistry();
+
+ virtual void registerTest( TestCase const& testCase ) {
+ std::string name = testCase.getTestCaseInfo().name;
+ if( name == "" ) {
+ std::ostringstream oss;
+ oss << "Anonymous test case " << ++m_unnamedCount;
+ return registerTest( testCase.withName( oss.str() ) );
+ }
+
+ if( m_functions.find( testCase ) == m_functions.end() ) {
+ m_functions.insert( testCase );
+ m_functionsInOrder.push_back( testCase );
+ if( !testCase.isHidden() )
+ m_nonHiddenFunctions.push_back( testCase );
+ }
+ else {
+ TestCase const& prev = *m_functions.find( testCase );
+ {
+ Colour colourGuard( Colour::Red );
+ std::cerr << "error: TEST_CASE( \"" << name << "\" ) already defined.\n"
+ << "\tFirst seen at " << prev.getTestCaseInfo().lineInfo << "\n"
+ << "\tRedefined at " << testCase.getTestCaseInfo().lineInfo << std::endl;
+ }
+ exit(1);
+ }
+ }
+
+ virtual std::vector<TestCase> const& getAllTests() const {
+ return m_functionsInOrder;
+ }
+
+ virtual std::vector<TestCase> const& getAllNonHiddenTests() const {
+ return m_nonHiddenFunctions;
+ }
+
+ virtual void getFilteredTests( TestSpec const& testSpec, IConfig const& config, std::vector<TestCase>& matchingTestCases ) const {
+ for( std::vector<TestCase>::const_iterator it = m_functionsInOrder.begin(),
+ itEnd = m_functionsInOrder.end();
+ it != itEnd;
+ ++it ) {
+ if( testSpec.matches( *it ) && ( config.allowThrows() || !it->throws() ) )
+ matchingTestCases.push_back( *it );
+ }
+ }
+
+ private:
+
+ std::set<TestCase> m_functions;
+ std::vector<TestCase> m_functionsInOrder;
+ std::vector<TestCase> m_nonHiddenFunctions;
+ size_t m_unnamedCount;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class FreeFunctionTestCase : public SharedImpl<ITestCase> {
+ public:
+
+ FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {}
+
+ virtual void invoke() const {
+ m_fun();
+ }
+
+ private:
+ virtual ~FreeFunctionTestCase();
+
+ TestFunction m_fun;
+ };
+
+ inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
+ std::string className = classOrQualifiedMethodName;
+ if( startsWith( className, "&" ) )
+ {
+ std::size_t lastColons = className.rfind( "::" );
+ std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
+ if( penultimateColons == std::string::npos )
+ penultimateColons = 1;
+ className = className.substr( penultimateColons, lastColons-penultimateColons );
+ }
+ return className;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ AutoReg::AutoReg( TestFunction function,
+ SourceLineInfo const& lineInfo,
+ NameAndDesc const& nameAndDesc ) {
+ registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo );
+ }
+
+ AutoReg::~AutoReg() {}
+
+ void AutoReg::registerTestCase( ITestCase* testCase,
+ char const* classOrQualifiedMethodName,
+ NameAndDesc const& nameAndDesc,
+ SourceLineInfo const& lineInfo ) {
+
+ getMutableRegistryHub().registerTest
+ ( makeTestCase( testCase,
+ extractClassName( classOrQualifiedMethodName ),
+ nameAndDesc.name,
+ nameAndDesc.description,
+ lineInfo ) );
+ }
+
+} // end namespace Catch
+
+// #included from: catch_reporter_registry.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED
+
+#include <map>
+
+namespace Catch {
+
+ class ReporterRegistry : public IReporterRegistry {
+
+ public:
+
+ virtual ~ReporterRegistry() {
+ deleteAllValues( m_factories );
+ }
+
+ virtual IStreamingReporter* create( std::string const& name, Ptr<IConfig> const& config ) const {
+ FactoryMap::const_iterator it = m_factories.find( name );
+ if( it == m_factories.end() )
+ return NULL;
+ return it->second->create( ReporterConfig( config ) );
+ }
+
+ void registerReporter( std::string const& name, IReporterFactory* factory ) {
+ m_factories.insert( std::make_pair( name, factory ) );
+ }
+
+ FactoryMap const& getFactories() const {
+ return m_factories;
+ }
+
+ private:
+ FactoryMap m_factories;
+ };
+}
+
+// #included from: catch_exception_translator_registry.hpp
+#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
+
+#ifdef __OBJC__
+#import "Foundation/Foundation.h"
+#endif
+
+namespace Catch {
+
+ class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
+ public:
+ ~ExceptionTranslatorRegistry() {
+ deleteAll( m_translators );
+ }
+
+ virtual void registerTranslator( const IExceptionTranslator* translator ) {
+ m_translators.push_back( translator );
+ }
+
+ virtual std::string translateActiveException() const {
+ try {
+#ifdef __OBJC__
+ // In Objective-C try objective-c exceptions first
+ @try {
+ throw;
+ }
+ @catch (NSException *exception) {
+ return toString( [exception description] );
+ }
+#else
+ throw;
+#endif
+ }
+ catch( std::exception& ex ) {
+ return ex.what();
+ }
+ catch( std::string& msg ) {
+ return msg;
+ }
+ catch( const char* msg ) {
+ return msg;
+ }
+ catch(...) {
+ return tryTranslators( m_translators.begin() );
+ }
+ }
+
+ std::string tryTranslators( std::vector<const IExceptionTranslator*>::const_iterator it ) const {
+ if( it == m_translators.end() )
+ return "Unknown exception";
+
+ try {
+ return (*it)->translate();
+ }
+ catch(...) {
+ return tryTranslators( it+1 );
+ }
+ }
+
+ private:
+ std::vector<const IExceptionTranslator*> m_translators;
+ };
+}
+
+namespace Catch {
+
+ namespace {
+
+ class RegistryHub : public IRegistryHub, public IMutableRegistryHub {
+
+ RegistryHub( RegistryHub const& );
+ void operator=( RegistryHub const& );
+
+ public: // IRegistryHub
+ RegistryHub() {
+ }
+ virtual IReporterRegistry const& getReporterRegistry() const {
+ return m_reporterRegistry;
+ }
+ virtual ITestCaseRegistry const& getTestCaseRegistry() const {
+ return m_testCaseRegistry;
+ }
+ virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() {
+ return m_exceptionTranslatorRegistry;
+ }
+
+ public: // IMutableRegistryHub
+ virtual void registerReporter( std::string const& name, IReporterFactory* factory ) {
+ m_reporterRegistry.registerReporter( name, factory );
+ }
+ virtual void registerTest( TestCase const& testInfo ) {
+ m_testCaseRegistry.registerTest( testInfo );
+ }
+ virtual void registerTranslator( const IExceptionTranslator* translator ) {
+ m_exceptionTranslatorRegistry.registerTranslator( translator );
+ }
+
+ private:
+ TestRegistry m_testCaseRegistry;
+ ReporterRegistry m_reporterRegistry;
+ ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
+ };
+
+ // Single, global, instance
+ inline RegistryHub*& getTheRegistryHub() {
+ static RegistryHub* theRegistryHub = NULL;
+ if( !theRegistryHub )
+ theRegistryHub = new RegistryHub();
+ return theRegistryHub;
+ }
+ }
+
+ IRegistryHub& getRegistryHub() {
+ return *getTheRegistryHub();
+ }
+ IMutableRegistryHub& getMutableRegistryHub() {
+ return *getTheRegistryHub();
+ }
+ void cleanUp() {
+ delete getTheRegistryHub();
+ getTheRegistryHub() = NULL;
+ cleanUpContext();
+ }
+ std::string translateActiveException() {
+ return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
+ }
+
+} // end namespace Catch
+
+// #included from: catch_notimplemented_exception.hpp
+#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED
+
+#include <ostream>
+
+namespace Catch {
+
+ NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo )
+ : m_lineInfo( lineInfo ) {
+ std::ostringstream oss;
+ oss << lineInfo << ": function ";
+ oss << "not implemented";
+ m_what = oss.str();
+ }
+
+ const char* NotImplementedException::what() const CATCH_NOEXCEPT {
+ return m_what.c_str();
+ }
+
+} // end namespace Catch
+
+// #included from: catch_context_impl.hpp
+#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
+
+// #included from: catch_stream.hpp
+#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED
+
+// #included from: catch_streambuf.h
+#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED
+
+#include <streambuf>
+
+namespace Catch {
+
+ class StreamBufBase : public std::streambuf {
+ public:
+ virtual ~StreamBufBase() CATCH_NOEXCEPT;
+ };
+}
+
+#include <stdexcept>
+#include <cstdio>
+
+namespace Catch {
+
+ template<typename WriterF, size_t bufferSize=256>
+ class StreamBufImpl : public StreamBufBase {
+ char data[bufferSize];
+ WriterF m_writer;
+
+ public:
+ StreamBufImpl() {
+ setp( data, data + sizeof(data) );
+ }
+
+ ~StreamBufImpl() CATCH_NOEXCEPT {
+ sync();
+ }
+
+ private:
+ int overflow( int c ) {
+ sync();
+
+ if( c != EOF ) {
+ if( pbase() == epptr() )
+ m_writer( std::string( 1, static_cast<char>( c ) ) );
+ else
+ sputc( static_cast<char>( c ) );
+ }
+ return 0;
+ }
+
+ int sync() {
+ if( pbase() != pptr() ) {
+ m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
+ setp( pbase(), epptr() );
+ }
+ return 0;
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ struct OutputDebugWriter {
+
+ void operator()( std::string const&str ) {
+ writeToDebugConsole( str );
+ }
+ };
+
+ Stream::Stream()
+ : streamBuf( NULL ), isOwned( false )
+ {}
+
+ Stream::Stream( std::streambuf* _streamBuf, bool _isOwned )
+ : streamBuf( _streamBuf ), isOwned( _isOwned )
+ {}
+
+ void Stream::release() {
+ if( isOwned ) {
+ delete streamBuf;
+ streamBuf = NULL;
+ isOwned = false;
+ }
+ }
+}
+
+namespace Catch {
+
+ class Context : public IMutableContext {
+
+ Context() : m_config( NULL ), m_runner( NULL ), m_resultCapture( NULL ) {}
+ Context( Context const& );
+ void operator=( Context const& );
+
+ public: // IContext
+ virtual IResultCapture* getResultCapture() {
+ return m_resultCapture;
+ }
+ virtual IRunner* getRunner() {
+ return m_runner;
+ }
+ virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) {
+ return getGeneratorsForCurrentTest()
+ .getGeneratorInfo( fileInfo, totalSize )
+ .getCurrentIndex();
+ }
+ virtual bool advanceGeneratorsForCurrentTest() {
+ IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
+ return generators && generators->moveNext();
+ }
+
+ virtual Ptr<IConfig const> getConfig() const {
+ return m_config;
+ }
+
+ public: // IMutableContext
+ virtual void setResultCapture( IResultCapture* resultCapture ) {
+ m_resultCapture = resultCapture;
+ }
+ virtual void setRunner( IRunner* runner ) {
+ m_runner = runner;
+ }
+ virtual void setConfig( Ptr<IConfig const> const& config ) {
+ m_config = config;
+ }
+
+ friend IMutableContext& getCurrentMutableContext();
+
+ private:
+ IGeneratorsForTest* findGeneratorsForCurrentTest() {
+ std::string testName = getResultCapture()->getCurrentTestName();
+
+ std::map<std::string, IGeneratorsForTest*>::const_iterator it =
+ m_generatorsByTestName.find( testName );
+ return it != m_generatorsByTestName.end()
+ ? it->second
+ : NULL;
+ }
+
+ IGeneratorsForTest& getGeneratorsForCurrentTest() {
+ IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
+ if( !generators ) {
+ std::string testName = getResultCapture()->getCurrentTestName();
+ generators = createGeneratorsForTest();
+ m_generatorsByTestName.insert( std::make_pair( testName, generators ) );
+ }
+ return *generators;
+ }
+
+ private:
+ Ptr<IConfig const> m_config;
+ IRunner* m_runner;
+ IResultCapture* m_resultCapture;
+ std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
+ };
+
+ namespace {
+ Context* currentContext = NULL;
+ }
+ IMutableContext& getCurrentMutableContext() {
+ if( !currentContext )
+ currentContext = new Context();
+ return *currentContext;
+ }
+ IContext& getCurrentContext() {
+ return getCurrentMutableContext();
+ }
+
+ Stream createStream( std::string const& streamName ) {
+ if( streamName == "stdout" ) return Stream( std::cout.rdbuf(), false );
+ if( streamName == "stderr" ) return Stream( std::cerr.rdbuf(), false );
+ if( streamName == "debug" ) return Stream( new StreamBufImpl<OutputDebugWriter>, true );
+
+ throw std::domain_error( "Unknown stream: " + streamName );
+ }
+
+ void cleanUpContext() {
+ delete currentContext;
+ currentContext = NULL;
+ }
+}
+
+// #included from: catch_console_colour_impl.hpp
+#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
+
+namespace Catch { namespace Detail {
+ struct IColourImpl {
+ virtual ~IColourImpl() {}
+ virtual void use( Colour::Code _colourCode ) = 0;
+ };
+}}
+
+#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
+
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+#ifdef __AFXDLL
+#include <AfxWin.h>
+#else
+#include <windows.h>
+#endif
+
+namespace Catch {
+namespace {
+
+ class Win32ColourImpl : public Detail::IColourImpl {
+ public:
+ Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
+ {
+ CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+ GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
+ originalAttributes = csbiInfo.wAttributes;
+ }
+
+ virtual void use( Colour::Code _colourCode ) {
+ switch( _colourCode ) {
+ case Colour::None: return setTextAttribute( originalAttributes );
+ case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
+ case Colour::Red: return setTextAttribute( FOREGROUND_RED );
+ case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
+ case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
+ case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
+ case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
+ case Colour::Grey: return setTextAttribute( 0 );
+
+ case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
+ case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
+ case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
+ case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
+
+ case Colour::Bright: throw std::logic_error( "not a colour" );
+ }
+ }
+
+ private:
+ void setTextAttribute( WORD _textAttribute ) {
+ SetConsoleTextAttribute( stdoutHandle, _textAttribute );
+ }
+ HANDLE stdoutHandle;
+ WORD originalAttributes;
+ };
+
+ inline bool shouldUseColourForPlatform() {
+ return true;
+ }
+
+ static Detail::IColourImpl* platformColourInstance() {
+ static Win32ColourImpl s_instance;
+ return &s_instance;
+ }
+
+} // end anon namespace
+} // end namespace Catch
+
+#else // Not Windows - assumed to be POSIX compatible //////////////////////////
+
+#include <unistd.h>
+
+namespace Catch {
+namespace {
+
+ // use POSIX/ ANSI console terminal codes
+ // Thanks to Adam Strzelecki for original contribution
+ // (http://github.com/nanoant)
+ // https://github.com/philsquared/Catch/pull/131
+ class PosixColourImpl : public Detail::IColourImpl {
+ public:
+ virtual void use( Colour::Code _colourCode ) {
+ switch( _colourCode ) {
+ case Colour::None:
+ case Colour::White: return setColour( "[0m" );
+ case Colour::Red: return setColour( "[0;31m" );
+ case Colour::Green: return setColour( "[0;32m" );
+ case Colour::Blue: return setColour( "[0:34m" );
+ case Colour::Cyan: return setColour( "[0;36m" );
+ case Colour::Yellow: return setColour( "[0;33m" );
+ case Colour::Grey: return setColour( "[1;30m" );
+
+ case Colour::LightGrey: return setColour( "[0;37m" );
+ case Colour::BrightRed: return setColour( "[1;31m" );
+ case Colour::BrightGreen: return setColour( "[1;32m" );
+ case Colour::BrightWhite: return setColour( "[1;37m" );
+
+ case Colour::Bright: throw std::logic_error( "not a colour" );
+ }
+ }
+ private:
+ void setColour( const char* _escapeCode ) {
+ std::cout << '\033' << _escapeCode;
+ }
+ };
+
+ inline bool shouldUseColourForPlatform() {
+ return isatty(STDOUT_FILENO);
+ }
+
+ static Detail::IColourImpl* platformColourInstance() {
+ static PosixColourImpl s_instance;
+ return &s_instance;
+ }
+
+} // end anon namespace
+} // end namespace Catch
+
+#endif // not Windows
+
+namespace Catch {
+
+ namespace {
+ struct NoColourImpl : Detail::IColourImpl {
+ void use( Colour::Code ) {}
+
+ static IColourImpl* instance() {
+ static NoColourImpl s_instance;
+ return &s_instance;
+ }
+ };
+ static bool shouldUseColour() {
+ return shouldUseColourForPlatform() && !isDebuggerActive();
+ }
+ }
+
+ Colour::Colour( Code _colourCode ){ use( _colourCode ); }
+ Colour::~Colour(){ use( None ); }
+ void Colour::use( Code _colourCode ) {
+ impl()->use( _colourCode );
+ }
+
+ Detail::IColourImpl* Colour::impl() {
+ return shouldUseColour()
+ ? platformColourInstance()
+ : NoColourImpl::instance();
+ }
+
+} // end namespace Catch
+
+// #included from: catch_generators_impl.hpp
+#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
+
+#include <vector>
+#include <string>
+#include <map>
+
+namespace Catch {
+
+ struct GeneratorInfo : IGeneratorInfo {
+
+ GeneratorInfo( std::size_t size )
+ : m_size( size ),
+ m_currentIndex( 0 )
+ {}
+
+ bool moveNext() {
+ if( ++m_currentIndex == m_size ) {
+ m_currentIndex = 0;
+ return false;
+ }
+ return true;
+ }
+
+ std::size_t getCurrentIndex() const {
+ return m_currentIndex;
+ }
+
+ std::size_t m_size;
+ std::size_t m_currentIndex;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class GeneratorsForTest : public IGeneratorsForTest {
+
+ public:
+ ~GeneratorsForTest() {
+ deleteAll( m_generatorsInOrder );
+ }
+
+ IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) {
+ std::map<std::string, IGeneratorInfo*>::const_iterator it = m_generatorsByName.find( fileInfo );
+ if( it == m_generatorsByName.end() ) {
+ IGeneratorInfo* info = new GeneratorInfo( size );
+ m_generatorsByName.insert( std::make_pair( fileInfo, info ) );
+ m_generatorsInOrder.push_back( info );
+ return *info;
+ }
+ return *it->second;
+ }
+
+ bool moveNext() {
+ std::vector<IGeneratorInfo*>::const_iterator it = m_generatorsInOrder.begin();
+ std::vector<IGeneratorInfo*>::const_iterator itEnd = m_generatorsInOrder.end();
+ for(; it != itEnd; ++it ) {
+ if( (*it)->moveNext() )
+ return true;
+ }
+ return false;
+ }
+
+ private:
+ std::map<std::string, IGeneratorInfo*> m_generatorsByName;
+ std::vector<IGeneratorInfo*> m_generatorsInOrder;
+ };
+
+ IGeneratorsForTest* createGeneratorsForTest()
+ {
+ return new GeneratorsForTest();
+ }
+
+} // end namespace Catch
+
+// #included from: catch_assertionresult.hpp
+#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
+
+namespace Catch {
+
+ AssertionInfo::AssertionInfo( std::string const& _macroName,
+ SourceLineInfo const& _lineInfo,
+ std::string const& _capturedExpression,
+ ResultDisposition::Flags _resultDisposition )
+ : macroName( _macroName ),
+ lineInfo( _lineInfo ),
+ capturedExpression( _capturedExpression ),
+ resultDisposition( _resultDisposition )
+ {}
+
+ AssertionResult::AssertionResult() {}
+
+ AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
+ : m_info( info ),
+ m_resultData( data )
+ {}
+
+ AssertionResult::~AssertionResult() {}
+
+ // Result was a success
+ bool AssertionResult::succeeded() const {
+ return Catch::isOk( m_resultData.resultType );
+ }
+
+ // Result was a success, or failure is suppressed
+ bool AssertionResult::isOk() const {
+ return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
+ }
+
+ ResultWas::OfType AssertionResult::getResultType() const {
+ return m_resultData.resultType;
+ }
+
+ bool AssertionResult::hasExpression() const {
+ return !m_info.capturedExpression.empty();
+ }
+
+ bool AssertionResult::hasMessage() const {
+ return !m_resultData.message.empty();
+ }
+
+ std::string AssertionResult::getExpression() const {
+ if( shouldNegate( m_info.resultDisposition ) )
+ return "!" + m_info.capturedExpression;
+ else
+ return m_info.capturedExpression;
+ }
+ std::string AssertionResult::getExpressionInMacro() const {
+ if( m_info.macroName.empty() )
+ return m_info.capturedExpression;
+ else
+ return m_info.macroName + "( " + m_info.capturedExpression + " )";
+ }
+
+ bool AssertionResult::hasExpandedExpression() const {
+ return hasExpression() && getExpandedExpression() != getExpression();
+ }
+
+ std::string AssertionResult::getExpandedExpression() const {
+ return m_resultData.reconstructedExpression;
+ }
+
+ std::string AssertionResult::getMessage() const {
+ return m_resultData.message;
+ }
+ SourceLineInfo AssertionResult::getSourceInfo() const {
+ return m_info.lineInfo;
+ }
+
+ std::string AssertionResult::getTestMacroName() const {
+ return m_info.macroName;
+ }
+
+} // end namespace Catch
+
+// #included from: catch_expressionresult_builder.hpp
+#define TWOBLUECUBES_CATCH_EXPRESSIONRESULT_BUILDER_HPP_INCLUDED
+
+#include <assert.h>
+
+namespace Catch {
+
+ ExpressionResultBuilder::ExpressionResultBuilder( ResultWas::OfType resultType ) {
+ m_data.resultType = resultType;
+ }
+ ExpressionResultBuilder::ExpressionResultBuilder( ExpressionResultBuilder const& other )
+ : m_data( other.m_data ),
+ m_exprComponents( other.m_exprComponents )
+ {
+ m_stream << other.m_stream.str();
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::operator=(ExpressionResultBuilder const& other ) {
+ m_data = other.m_data;
+ m_exprComponents = other.m_exprComponents;
+ m_stream.str("");
+ m_stream << other.m_stream.str();
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::setResultType( ResultWas::OfType result ) {
+ m_data.resultType = result;
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::setResultType( bool result ) {
+ m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed;
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::endExpression( ResultDisposition::Flags resultDisposition ) {
+ m_exprComponents.shouldNegate = shouldNegate( resultDisposition );
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::setLhs( std::string const& lhs ) {
+ m_exprComponents.lhs = lhs;
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::setRhs( std::string const& rhs ) {
+ m_exprComponents.rhs = rhs;
+ return *this;
+ }
+ ExpressionResultBuilder& ExpressionResultBuilder::setOp( std::string const& op ) {
+ m_exprComponents.op = op;
+ return *this;
+ }
+ AssertionResult ExpressionResultBuilder::buildResult( AssertionInfo const& info ) const
+ {
+ assert( m_data.resultType != ResultWas::Unknown );
+
+ AssertionResultData data = m_data;
+
+ // Flip bool results if shouldNegate is set
+ if( m_exprComponents.shouldNegate && data.resultType == ResultWas::Ok )
+ data.resultType = ResultWas::ExpressionFailed;
+ else if( m_exprComponents.shouldNegate && data.resultType == ResultWas::ExpressionFailed )
+ data.resultType = ResultWas::Ok;
+
+ data.message = m_stream.str();
+ data.reconstructedExpression = reconstructExpression( info );
+ if( m_exprComponents.shouldNegate ) {
+ if( m_exprComponents.op == "" )
+ data.reconstructedExpression = "!" + data.reconstructedExpression;
+ else
+ data.reconstructedExpression = "!(" + data.reconstructedExpression + ")";
+ }
+ return AssertionResult( info, data );
+ }
+ std::string ExpressionResultBuilder::reconstructExpression( AssertionInfo const& info ) const {
+ if( m_exprComponents.op == "" )
+ return m_exprComponents.lhs.empty() ? info.capturedExpression : m_exprComponents.op + m_exprComponents.lhs;
+ else if( m_exprComponents.op == "matches" )
+ return m_exprComponents.lhs + " " + m_exprComponents.rhs;
+ else if( m_exprComponents.op != "!" ) {
+ if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 &&
+ m_exprComponents.lhs.find("\n") == std::string::npos &&
+ m_exprComponents.rhs.find("\n") == std::string::npos )
+ return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs;
+ else
+ return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs;
+ }
+ else
+ return "{can't expand - use " + info.macroName + "_FALSE( " + info.capturedExpression.substr(1) + " ) instead of " + info.macroName + "( " + info.capturedExpression + " ) for better diagnostics}";
+ }
+
+} // end namespace Catch
+
+// #included from: catch_test_case_info.hpp
+#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED
+
+namespace Catch {
+
+ inline bool isSpecialTag( std::string const& tag ) {
+ return tag == "." ||
+ tag == "hide" ||
+ tag == "!hide" ||
+ tag == "!throws";
+ }
+ inline bool isReservedTag( std::string const& tag ) {
+ return !isSpecialTag( tag ) && tag.size() > 0 && !isalnum( tag[0] );
+ }
+ inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
+ if( isReservedTag( tag ) ) {
+ {
+ Colour colourGuard( Colour::Red );
+ std::cerr
+ << "Tag name [" << tag << "] not allowed.\n"
+ << "Tag names starting with non alpha-numeric characters are reserved\n";
+ }
+ {
+ Colour colourGuard( Colour::FileName );
+ std::cerr << _lineInfo << std::endl;
+ }
+ exit(1);
+ }
+ }
+
+ TestCase makeTestCase( ITestCase* _testCase,
+ std::string const& _className,
+ std::string const& _name,
+ std::string const& _descOrTags,
+ SourceLineInfo const& _lineInfo )
+ {
+ bool isHidden( startsWith( _name, "./" ) ); // Legacy support
+
+ // Parse out tags
+ std::set<std::string> tags;
+ std::string desc, tag;
+ bool inTag = false;
+ for( std::size_t i = 0; i < _descOrTags.size(); ++i ) {
+ char c = _descOrTags[i];
+ if( !inTag ) {
+ if( c == '[' )
+ inTag = true;
+ else
+ desc += c;
+ }
+ else {
+ if( c == ']' ) {
+ enforceNotReservedTag( tag, _lineInfo );
+
+ inTag = false;
+ if( tag == "hide" || tag == "." )
+ isHidden = true;
+ else
+ tags.insert( tag );
+ tag.clear();
+ }
+ else
+ tag += c;
+ }
+ }
+ if( isHidden ) {
+ tags.insert( "hide" );
+ tags.insert( "." );
+ }
+
+ TestCaseInfo info( _name, _className, desc, tags, isHidden, _lineInfo );
+ return TestCase( _testCase, info );
+ }
+
+ TestCaseInfo::TestCaseInfo( std::string const& _name,
+ std::string const& _className,
+ std::string const& _description,
+ std::set<std::string> const& _tags,
+ bool _isHidden,
+ SourceLineInfo const& _lineInfo )
+ : name( _name ),
+ className( _className ),
+ description( _description ),
+ tags( _tags ),
+ lineInfo( _lineInfo ),
+ isHidden( _isHidden ),
+ throws( false )
+ {
+ std::ostringstream oss;
+ for( std::set<std::string>::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) {
+ oss << "[" << *it << "]";
+ if( *it == "!throws" )
+ throws = true;
+ lcaseTags.insert( toLower( *it ) );
+ }
+ tagsAsString = oss.str();
+ }
+
+ TestCaseInfo::TestCaseInfo( TestCaseInfo const& other )
+ : name( other.name ),
+ className( other.className ),
+ description( other.description ),
+ tags( other.tags ),
+ lcaseTags( other.lcaseTags ),
+ tagsAsString( other.tagsAsString ),
+ lineInfo( other.lineInfo ),
+ isHidden( other.isHidden ),
+ throws( other.throws )
+ {}
+
+ TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
+
+ TestCase::TestCase( TestCase const& other )
+ : TestCaseInfo( other ),
+ test( other.test )
+ {}
+
+ TestCase TestCase::withName( std::string const& _newName ) const {
+ TestCase other( *this );
+ other.name = _newName;
+ return other;
+ }
+
+ void TestCase::swap( TestCase& other ) {
+ test.swap( other.test );
+ name.swap( other.name );
+ className.swap( other.className );
+ description.swap( other.description );
+ tags.swap( other.tags );
+ lcaseTags.swap( other.lcaseTags );
+ tagsAsString.swap( other.tagsAsString );
+ std::swap( TestCaseInfo::isHidden, static_cast<TestCaseInfo&>( other ).isHidden );
+ std::swap( TestCaseInfo::throws, static_cast<TestCaseInfo&>( other ).throws );
+ std::swap( lineInfo, other.lineInfo );
+ }
+
+ void TestCase::invoke() const {
+ test->invoke();
+ }
+
+ bool TestCase::isHidden() const {
+ return TestCaseInfo::isHidden;
+ }
+ bool TestCase::throws() const {
+ return TestCaseInfo::throws;
+ }
+
+ bool TestCase::operator == ( TestCase const& other ) const {
+ return test.get() == other.test.get() &&
+ name == other.name &&
+ className == other.className;
+ }
+
+ bool TestCase::operator < ( TestCase const& other ) const {
+ return name < other.name;
+ }
+ TestCase& TestCase::operator = ( TestCase const& other ) {
+ TestCase temp( other );
+ swap( temp );
+ return *this;
+ }
+
+ TestCaseInfo const& TestCase::getTestCaseInfo() const
+ {
+ return *this;
+ }
+
+} // end namespace Catch
+
+// #included from: catch_version.hpp
+#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
+
+namespace Catch {
+
+ // These numbers are maintained by a script
+ Version libraryVersion( 1, 0, 47, "master" );
+}
+
+// #included from: catch_message.hpp
+#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED
+
+namespace Catch {
+
+ MessageInfo::MessageInfo( std::string const& _macroName,
+ SourceLineInfo const& _lineInfo,
+ ResultWas::OfType _type )
+ : macroName( _macroName ),
+ lineInfo( _lineInfo ),
+ type( _type ),
+ sequence( ++globalCount )
+ {}
+
+ // This may need protecting if threading support is added
+ unsigned int MessageInfo::globalCount = 0;
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ ScopedMessage::ScopedMessage( MessageBuilder const& builder )
+ : m_info( builder.m_info )
+ {
+ m_info.message = builder.m_stream.str();
+ getResultCapture().pushScopedMessage( m_info );
+ }
+ ScopedMessage::ScopedMessage( ScopedMessage const& other )
+ : m_info( other.m_info )
+ {}
+
+ ScopedMessage::~ScopedMessage() {
+ getResultCapture().popScopedMessage( m_info );
+ }
+
+} // end namespace Catch
+
+// #included from: catch_legacy_reporter_adapter.hpp
+#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED
+
+// #included from: catch_legacy_reporter_adapter.h
+#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED
+
+namespace Catch
+{
+ // Deprecated
+ struct IReporter : IShared {
+ virtual ~IReporter();
+
+ virtual bool shouldRedirectStdout() const = 0;
+
+ virtual void StartTesting() = 0;
+ virtual void EndTesting( Totals const& totals ) = 0;
+ virtual void StartGroup( std::string const& groupName ) = 0;
+ virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0;
+ virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0;
+ virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0;
+ virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0;
+ virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0;
+ virtual void NoAssertionsInSection( std::string const& sectionName ) = 0;
+ virtual void NoAssertionsInTestCase( std::string const& testName ) = 0;
+ virtual void Aborted() = 0;
+ virtual void Result( AssertionResult const& result ) = 0;
+ };
+
+ class LegacyReporterAdapter : public SharedImpl<IStreamingReporter>
+ {
+ public:
+ LegacyReporterAdapter( Ptr<IReporter> const& legacyReporter );
+ virtual ~LegacyReporterAdapter();
+
+ virtual ReporterPreferences getPreferences() const;
+ virtual void noMatchingTestCases( std::string const& );
+ virtual void testRunStarting( TestRunInfo const& );
+ virtual void testGroupStarting( GroupInfo const& groupInfo );
+ virtual void testCaseStarting( TestCaseInfo const& testInfo );
+ virtual void sectionStarting( SectionInfo const& sectionInfo );
+ virtual void assertionStarting( AssertionInfo const& );
+ virtual bool assertionEnded( AssertionStats const& assertionStats );
+ virtual void sectionEnded( SectionStats const& sectionStats );
+ virtual void testCaseEnded( TestCaseStats const& testCaseStats );
+ virtual void testGroupEnded( TestGroupStats const& testGroupStats );
+ virtual void testRunEnded( TestRunStats const& testRunStats );
+
+ private:
+ Ptr<IReporter> m_legacyReporter;
+ };
+}
+
+namespace Catch
+{
+ LegacyReporterAdapter::LegacyReporterAdapter( Ptr<IReporter> const& legacyReporter )
+ : m_legacyReporter( legacyReporter )
+ {}
+ LegacyReporterAdapter::~LegacyReporterAdapter() {}
+
+ ReporterPreferences LegacyReporterAdapter::getPreferences() const {
+ ReporterPreferences prefs;
+ prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout();
+ return prefs;
+ }
+
+ void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {}
+ void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) {
+ m_legacyReporter->StartTesting();
+ }
+ void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) {
+ m_legacyReporter->StartGroup( groupInfo.name );
+ }
+ void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) {
+ m_legacyReporter->StartTestCase( testInfo );
+ }
+ void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) {
+ m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description );
+ }
+ void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) {
+ // Not on legacy interface
+ }
+
+ bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) {
+ if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) {
+ for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end();
+ it != itEnd;
+ ++it ) {
+ if( it->type == ResultWas::Info ) {
+ ExpressionResultBuilder expressionBuilder( it->type );
+ expressionBuilder << it->message;
+ AssertionInfo info( it->macroName, it->lineInfo, "", ResultDisposition::Normal );
+ AssertionResult result = expressionBuilder.buildResult( info );
+ m_legacyReporter->Result( result );
+ }
+ }
+ }
+ m_legacyReporter->Result( assertionStats.assertionResult );
+ return true;
+ }
+ void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) {
+ if( sectionStats.missingAssertions )
+ m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name );
+ m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions );
+ }
+ void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) {
+ m_legacyReporter->EndTestCase
+ ( testCaseStats.testInfo,
+ testCaseStats.totals,
+ testCaseStats.stdOut,
+ testCaseStats.stdErr );
+ }
+ void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) {
+ if( testGroupStats.aborting )
+ m_legacyReporter->Aborted();
+ m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals );
+ }
+ void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) {
+ m_legacyReporter->EndTesting( testRunStats.totals );
+ }
+}
+
+// #included from: catch_timer.hpp
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++11-long-long"
+#endif
+
+#ifdef CATCH_PLATFORM_WINDOWS
+#include <windows.h>
+#else
+#include <sys/time.h>
+#endif
+
+namespace Catch {
+
+ namespace {
+#ifdef CATCH_PLATFORM_WINDOWS
+ uint64_t getCurrentTicks() {
+ static uint64_t hz=0, hzo=0;
+ if (!hz) {
+ QueryPerformanceFrequency((LARGE_INTEGER*)&hz);
+ QueryPerformanceCounter((LARGE_INTEGER*)&hzo);
+ }
+ uint64_t t;
+ QueryPerformanceCounter((LARGE_INTEGER*)&t);
+ return ((t-hzo)*1000000)/hz;
+ }
+#else
+ uint64_t getCurrentTicks() {
+ timeval t;
+ gettimeofday(&t,NULL);
+ return (uint64_t)t.tv_sec * 1000000ull + (uint64_t)t.tv_usec;
+ }
+#endif
+ }
+
+ void Timer::start() {
+ m_ticks = getCurrentTicks();
+ }
+ unsigned int Timer::getElapsedNanoseconds() const {
+ return (unsigned int)(getCurrentTicks() - m_ticks);
+ }
+ unsigned int Timer::getElapsedMilliseconds() const {
+ return (unsigned int)((getCurrentTicks() - m_ticks)/1000);
+ }
+ double Timer::getElapsedSeconds() const {
+ return (getCurrentTicks() - m_ticks)/1000000.0;
+ }
+
+} // namespace Catch
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+// #included from: catch_common.hpp
+#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
+
+namespace Catch {
+
+ bool startsWith( std::string const& s, std::string const& prefix ) {
+ return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix;
+ }
+ bool endsWith( std::string const& s, std::string const& suffix ) {
+ return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix;
+ }
+ bool contains( std::string const& s, std::string const& infix ) {
+ return s.find( infix ) != std::string::npos;
+ }
+ void toLowerInPlace( std::string& s ) {
+ std::transform( s.begin(), s.end(), s.begin(), ::tolower );
+ }
+ std::string toLower( std::string const& s ) {
+ std::string lc = s;
+ toLowerInPlace( lc );
+ return lc;
+ }
+ std::string trim( std::string const& str ) {
+ static char const* whitespaceChars = "\n\r\t ";
+ std::string::size_type start = str.find_first_not_of( whitespaceChars );
+ std::string::size_type end = str.find_last_not_of( whitespaceChars );
+
+ return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
+ }
+
+ pluralise::pluralise( std::size_t count, std::string const& label )
+ : m_count( count ),
+ m_label( label )
+ {}
+
+ std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
+ os << pluraliser.m_count << " " << pluraliser.m_label;
+ if( pluraliser.m_count != 1 )
+ os << "s";
+ return os;
+ }
+
+ SourceLineInfo::SourceLineInfo() : line( 0 ){}
+ SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line )
+ : file( _file ),
+ line( _line )
+ {}
+ SourceLineInfo::SourceLineInfo( SourceLineInfo const& other )
+ : file( other.file ),
+ line( other.line )
+ {}
+ bool SourceLineInfo::empty() const {
+ return file.empty();
+ }
+ bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const {
+ return line == other.line && file == other.file;
+ }
+
+ std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
+#ifndef __GNUG__
+ os << info.file << "(" << info.line << ")";
+#else
+ os << info.file << ":" << info.line;
+#endif
+ return os;
+ }
+
+ void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) {
+ std::ostringstream oss;
+ oss << locationInfo << ": Internal Catch error: '" << message << "'";
+ if( isTrue( true ))
+ throw std::logic_error( oss.str() );
+ }
+}
+
+// #included from: catch_section.hpp
+#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
+
+namespace Catch {
+
+ Section::Section( SourceLineInfo const& lineInfo,
+ std::string const& name,
+ std::string const& description )
+ : m_info( name, description, lineInfo ),
+ m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
+ {
+ m_timer.start();
+ }
+
+ Section::~Section() {
+ if( m_sectionIncluded )
+ getResultCapture().sectionEnded( m_info, m_assertions, m_timer.getElapsedSeconds() );
+ }
+
+ // This indicates whether the section should be executed or not
+ Section::operator bool() {
+ return m_sectionIncluded;
+ }
+
+} // end namespace Catch
+
+// #included from: catch_debugger.hpp
+#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
+
+#include <iostream>
+
+#ifdef CATCH_PLATFORM_MAC
+
+ #include <assert.h>
+ #include <stdbool.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <sys/sysctl.h>
+
+ namespace Catch{
+
+ // The following function is taken directly from the following technical note:
+ // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html
+
+ // Returns true if the current process is being debugged (either
+ // running under the debugger or has a debugger attached post facto).
+ bool isDebuggerActive(){
+
+ int mib[4];
+ struct kinfo_proc info;
+ size_t size;
+
+ // Initialize the flags so that, if sysctl fails for some bizarre
+ // reason, we get a predictable result.
+
+ info.kp_proc.p_flag = 0;
+
+ // Initialize mib, which tells sysctl the info we want, in this case
+ // we're looking for information about a specific process ID.
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+
+ // Call sysctl.
+
+ size = sizeof(info);
+ if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) != 0 ) {
+ std::cerr << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
+ return false;
+ }
+
+ // We're being debugged if the P_TRACED flag is set.
+
+ return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
+ }
+ } // namespace Catch
+
+#elif defined(_MSC_VER)
+ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+ namespace Catch {
+ bool isDebuggerActive() {
+ return IsDebuggerPresent() != 0;
+ }
+ }
+#elif defined(__MINGW32__)
+ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+ namespace Catch {
+ bool isDebuggerActive() {
+ return IsDebuggerPresent() != 0;
+ }
+ }
+#else
+ namespace Catch {
+ inline bool isDebuggerActive() { return false; }
+ }
+#endif // Platform
+
+#ifdef CATCH_PLATFORM_WINDOWS
+ extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* );
+ namespace Catch {
+ void writeToDebugConsole( std::string const& text ) {
+ ::OutputDebugStringA( text.c_str() );
+ }
+ }
+#else
+ namespace Catch {
+ void writeToDebugConsole( std::string const& text ) {
+ // !TBD: Need a version for Mac/ XCode and other IDEs
+ std::cout << text;
+ }
+ }
+#endif // Platform
+
+// #included from: catch_tostring.hpp
+#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED
+
+namespace Catch {
+
+std::string toString( std::string const& value ) {
+ std::string s = value;
+ if( getCurrentContext().getConfig()->showInvisibles() ) {
+ for(size_t i = 0; i < s.size(); ++i ) {
+ std::string subs;
+ switch( s[i] ) {
+ case '\n': subs = "\\n"; break;
+ case '\t': subs = "\\t"; break;
+ default: break;
+ }
+ if( !subs.empty() ) {
+ s = s.substr( 0, i ) + subs + s.substr( i+1 );
+ ++i;
+ }
+ }
+ }
+ return "\"" + s + "\"";
+}
+std::string toString( std::wstring const& value ) {
+
+ std::string s;
+ s.reserve( value.size() );
+ for(size_t i = 0; i < value.size(); ++i )
+ s += value[i] <= 0xff ? static_cast<char>( value[i] ) : '?';
+ return toString( s );
+}
+
+std::string toString( const char* const value ) {
+ return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
+}
+
+std::string toString( char* const value ) {
+ return Catch::toString( static_cast<const char*>( value ) );
+}
+
+std::string toString( int value ) {
+ std::ostringstream oss;
+ oss << value;
+ return oss.str();
+}
+
+std::string toString( unsigned long value ) {
+ std::ostringstream oss;
+ if( value > 8192 )
+ oss << "0x" << std::hex << value;
+ else
+ oss << value;
+ return oss.str();
+}
+
+std::string toString( unsigned int value ) {
+ return toString( static_cast<unsigned long>( value ) );
+}
+
+std::string toString( const double value ) {
+ std::ostringstream oss;
+ oss << std::setprecision( 10 )
+ << std::fixed
+ << value;
+ std::string d = oss.str();
+ std::size_t i = d.find_last_not_of( '0' );
+ if( i != std::string::npos && i != d.size()-1 ) {
+ if( d[i] == '.' )
+ i++;
+ d = d.substr( 0, i+1 );
+ }
+ return d;
+}
+
+std::string toString( bool value ) {
+ return value ? "true" : "false";
+}
+
+std::string toString( char value ) {
+ return value < ' '
+ ? toString( static_cast<unsigned int>( value ) )
+ : Detail::makeString( value );
+}
+
+std::string toString( signed char value ) {
+ return toString( static_cast<char>( value ) );
+}
+
+std::string toString( unsigned char value ) {
+ return toString( static_cast<char>( value ) );
+}
+
+#ifdef CATCH_CONFIG_CPP11_NULLPTR
+std::string toString( std::nullptr_t ) {
+ return "nullptr";
+}
+#endif
+
+#ifdef __OBJC__
+ std::string toString( NSString const * const& nsstring ) {
+ if( !nsstring )
+ return "nil";
+ return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
+ }
+ std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
+ if( !nsstring )
+ return "nil";
+ return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
+ }
+ std::string toString( NSObject* const& nsObject ) {
+ return toString( [nsObject description] );
+ }
+#endif
+
+} // end namespace Catch
+
+// #included from: ../reporters/catch_reporter_xml.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED
+
+// #included from: catch_reporter_bases.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED
+
+namespace Catch {
+
+ struct StreamingReporterBase : SharedImpl<IStreamingReporter> {
+
+ StreamingReporterBase( ReporterConfig const& _config )
+ : m_config( _config.fullConfig() ),
+ stream( _config.stream() )
+ {}
+
+ virtual ~StreamingReporterBase();
+
+ virtual void noMatchingTestCases( std::string const& ) {}
+
+ virtual void testRunStarting( TestRunInfo const& _testRunInfo ) {
+ currentTestRunInfo = _testRunInfo;
+ }
+ virtual void testGroupStarting( GroupInfo const& _groupInfo ) {
+ currentGroupInfo = _groupInfo;
+ }
+
+ virtual void testCaseStarting( TestCaseInfo const& _testInfo ) {
+ currentTestCaseInfo = _testInfo;
+ }
+ virtual void sectionStarting( SectionInfo const& _sectionInfo ) {
+ m_sectionStack.push_back( _sectionInfo );
+ }
+
+ virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) {
+ m_sectionStack.pop_back();
+ }
+ virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) {
+ currentTestCaseInfo.reset();
+ assert( m_sectionStack.empty() );
+ }
+ virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) {
+ currentGroupInfo.reset();
+ }
+ virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) {
+ currentTestCaseInfo.reset();
+ currentGroupInfo.reset();
+ currentTestRunInfo.reset();
+ }
+
+ Ptr<IConfig> m_config;
+ std::ostream& stream;
+
+ LazyStat<TestRunInfo> currentTestRunInfo;
+ LazyStat<GroupInfo> currentGroupInfo;
+ LazyStat<TestCaseInfo> currentTestCaseInfo;
+
+ std::vector<SectionInfo> m_sectionStack;
+ };
+
+ struct CumulativeReporterBase : SharedImpl<IStreamingReporter> {
+ template<typename T, typename ChildNodeT>
+ struct Node : SharedImpl<> {
+ explicit Node( T const& _value ) : value( _value ) {}
+ virtual ~Node() {}
+
+ typedef std::vector<Ptr<ChildNodeT> > ChildNodes;
+ T value;
+ ChildNodes children;
+ };
+ struct SectionNode : SharedImpl<> {
+ explicit SectionNode( SectionStats const& _stats ) : stats( _stats ) {}
+ virtual ~SectionNode();
+
+ bool operator == ( SectionNode const& other ) const {
+ return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
+ }
+ bool operator == ( Ptr<SectionNode> const& other ) const {
+ return operator==( *other );
+ }
+
+ SectionStats stats;
+ typedef std::vector<Ptr<SectionNode> > ChildSections;
+ typedef std::vector<AssertionStats> Assertions;
+ ChildSections childSections;
+ Assertions assertions;
+ std::string stdOut;
+ std::string stdErr;
+ };
+
+ struct BySectionInfo {
+ BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
+ BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
+ bool operator() ( Ptr<SectionNode> const& node ) const {
+ return node->stats.sectionInfo.lineInfo == m_other.lineInfo;
+ }
+ private:
+ void operator=( BySectionInfo const& );
+ SectionInfo const& m_other;
+ };
+
+ typedef Node<TestCaseStats, SectionNode> TestCaseNode;
+ typedef Node<TestGroupStats, TestCaseNode> TestGroupNode;
+ typedef Node<TestRunStats, TestGroupNode> TestRunNode;
+
+ CumulativeReporterBase( ReporterConfig const& _config )
+ : m_config( _config.fullConfig() ),
+ stream( _config.stream() )
+ {}
+ ~CumulativeReporterBase();
+
+ virtual void testRunStarting( TestRunInfo const& ) {}
+ virtual void testGroupStarting( GroupInfo const& ) {}
+
+ virtual void testCaseStarting( TestCaseInfo const& ) {}
+
+ virtual void sectionStarting( SectionInfo const& sectionInfo ) {
+ SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
+ Ptr<SectionNode> node;
+ if( m_sectionStack.empty() ) {
+ if( !m_rootSection )
+ m_rootSection = new SectionNode( incompleteStats );
+ node = m_rootSection;
+ }
+ else {
+ SectionNode& parentNode = *m_sectionStack.back();
+ SectionNode::ChildSections::const_iterator it =
+ std::find_if( parentNode.childSections.begin(),
+ parentNode.childSections.end(),
+ BySectionInfo( sectionInfo ) );
+ if( it == parentNode.childSections.end() ) {
+ node = new SectionNode( incompleteStats );
+ parentNode.childSections.push_back( node );
+ }
+ else
+ node = *it;
+ }
+ m_sectionStack.push_back( node );
+ m_deepestSection = node;
+ }
+
+ virtual void assertionStarting( AssertionInfo const& ) {}
+
+ virtual bool assertionEnded( AssertionStats const& assertionStats ) {
+ assert( !m_sectionStack.empty() );
+ SectionNode& sectionNode = *m_sectionStack.back();
+ sectionNode.assertions.push_back( assertionStats );
+ return true;
+ }
+ virtual void sectionEnded( SectionStats const& sectionStats ) {
+ assert( !m_sectionStack.empty() );
+ SectionNode& node = *m_sectionStack.back();
+ node.stats = sectionStats;
+ m_sectionStack.pop_back();
+ }
+ virtual void testCaseEnded( TestCaseStats const& testCaseStats ) {
+ Ptr<TestCaseNode> node = new TestCaseNode( testCaseStats );
+ assert( m_sectionStack.size() == 0 );
+ node->children.push_back( m_rootSection );
+ m_testCases.push_back( node );
+ m_rootSection.reset();
+
+ assert( m_deepestSection );
+ m_deepestSection->stdOut = testCaseStats.stdOut;
+ m_deepestSection->stdErr = testCaseStats.stdErr;
+ }
+ virtual void testGroupEnded( TestGroupStats const& testGroupStats ) {
+ Ptr<TestGroupNode> node = new TestGroupNode( testGroupStats );
+ node->children.swap( m_testCases );
+ m_testGroups.push_back( node );
+ }
+ virtual void testRunEnded( TestRunStats const& testRunStats ) {
+ Ptr<TestRunNode> node = new TestRunNode( testRunStats );
+ node->children.swap( m_testGroups );
+ m_testRuns.push_back( node );
+ testRunEndedCumulative();
+ }
+ virtual void testRunEndedCumulative() = 0;
+
+ Ptr<IConfig> m_config;
+ std::ostream& stream;
+ std::vector<AssertionStats> m_assertions;
+ std::vector<std::vector<Ptr<SectionNode> > > m_sections;
+ std::vector<Ptr<TestCaseNode> > m_testCases;
+ std::vector<Ptr<TestGroupNode> > m_testGroups;
+
+ std::vector<Ptr<TestRunNode> > m_testRuns;
+
+ Ptr<SectionNode> m_rootSection;
+ Ptr<SectionNode> m_deepestSection;
+ std::vector<Ptr<SectionNode> > m_sectionStack;
+
+ };
+
+} // end namespace Catch
+
+// #included from: ../internal/catch_reporter_registrars.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
+
+namespace Catch {
+
+ template<typename T>
+ class LegacyReporterRegistrar {
+
+ class ReporterFactory : public IReporterFactory {
+ virtual IStreamingReporter* create( ReporterConfig const& config ) const {
+ return new LegacyReporterAdapter( new T( config ) );
+ }
+
+ virtual std::string getDescription() const {
+ return T::getDescription();
+ }
+ };
+
+ public:
+
+ LegacyReporterRegistrar( std::string const& name ) {
+ getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
+ }
+ };
+
+ template<typename T>
+ class ReporterRegistrar {
+
+ class ReporterFactory : public IReporterFactory {
+
+ // *** Please Note ***:
+ // - If you end up here looking at a compiler error because it's trying to register
+ // your custom reporter class be aware that the native reporter interface has changed
+ // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via
+ // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter.
+ // However please consider updating to the new interface as the old one is now
+ // deprecated and will probably be removed quite soon!
+ // Please contact me via github if you have any questions at all about this.
+ // In fact, ideally, please contact me anyway to let me know you've hit this - as I have
+ // no idea who is actually using custom reporters at all (possibly no-one!).
+ // The new interface is designed to minimise exposure to interface changes in the future.
+ virtual IStreamingReporter* create( ReporterConfig const& config ) const {
+ return new T( config );
+ }
+
+ virtual std::string getDescription() const {
+ return T::getDescription();
+ }
+ };
+
+ public:
+
+ ReporterRegistrar( std::string const& name ) {
+ getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
+ }
+ };
+}
+
+#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \
+ namespace{ Catch::LegacyReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); }
+#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \
+ namespace{ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); }
+
+// #included from: ../internal/catch_xmlwriter.hpp
+#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ class XmlWriter {
+ public:
+
+ class ScopedElement {
+ public:
+ ScopedElement( XmlWriter* writer )
+ : m_writer( writer )
+ {}
+
+ ScopedElement( ScopedElement const& other )
+ : m_writer( other.m_writer ){
+ other.m_writer = NULL;
+ }
+
+ ~ScopedElement() {
+ if( m_writer )
+ m_writer->endElement();
+ }
+
+ ScopedElement& writeText( std::string const& text, bool indent = true ) {
+ m_writer->writeText( text, indent );
+ return *this;
+ }
+
+ template<typename T>
+ ScopedElement& writeAttribute( std::string const& name, T const& attribute ) {
+ m_writer->writeAttribute( name, attribute );
+ return *this;
+ }
+
+ private:
+ mutable XmlWriter* m_writer;
+ };
+
+ XmlWriter()
+ : m_tagIsOpen( false ),
+ m_needsNewline( false ),
+ m_os( &std::cout )
+ {}
+
+ XmlWriter( std::ostream& os )
+ : m_tagIsOpen( false ),
+ m_needsNewline( false ),
+ m_os( &os )
+ {}
+
+ ~XmlWriter() {
+ while( !m_tags.empty() )
+ endElement();
+ }
+
+//# ifndef CATCH_CPP11_OR_GREATER
+// XmlWriter& operator = ( XmlWriter const& other ) {
+// XmlWriter temp( other );
+// swap( temp );
+// return *this;
+// }
+//# else
+// XmlWriter( XmlWriter const& ) = default;
+// XmlWriter( XmlWriter && ) = default;
+// XmlWriter& operator = ( XmlWriter const& ) = default;
+// XmlWriter& operator = ( XmlWriter && ) = default;
+//# endif
+//
+// void swap( XmlWriter& other ) {
+// std::swap( m_tagIsOpen, other.m_tagIsOpen );
+// std::swap( m_needsNewline, other.m_needsNewline );
+// std::swap( m_tags, other.m_tags );
+// std::swap( m_indent, other.m_indent );
+// std::swap( m_os, other.m_os );
+// }
+
+ XmlWriter& startElement( std::string const& name ) {
+ ensureTagClosed();
+ newlineIfNecessary();
+ stream() << m_indent << "<" << name;
+ m_tags.push_back( name );
+ m_indent += " ";
+ m_tagIsOpen = true;
+ return *this;
+ }
+
+ ScopedElement scopedElement( std::string const& name ) {
+ ScopedElement scoped( this );
+ startElement( name );
+ return scoped;
+ }
+
+ XmlWriter& endElement() {
+ newlineIfNecessary();
+ m_indent = m_indent.substr( 0, m_indent.size()-2 );
+ if( m_tagIsOpen ) {
+ stream() << "/>\n";
+ m_tagIsOpen = false;
+ }
+ else {
+ stream() << m_indent << "</" << m_tags.back() << ">\n";
+ }
+ m_tags.pop_back();
+ return *this;
+ }
+
+ XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) {
+ if( !name.empty() && !attribute.empty() ) {
+ stream() << " " << name << "=\"";
+ writeEncodedText( attribute );
+ stream() << "\"";
+ }
+ return *this;
+ }
+
+ XmlWriter& writeAttribute( std::string const& name, bool attribute ) {
+ stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\"";
+ return *this;
+ }
+
+ template<typename T>
+ XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
+ if( !name.empty() )
+ stream() << " " << name << "=\"" << attribute << "\"";
+ return *this;
+ }
+
+ XmlWriter& writeText( std::string const& text, bool indent = true ) {
+ if( !text.empty() ){
+ bool tagWasOpen = m_tagIsOpen;
+ ensureTagClosed();
+ if( tagWasOpen && indent )
+ stream() << m_indent;
+ writeEncodedText( text );
+ m_needsNewline = true;
+ }
+ return *this;
+ }
+
+ XmlWriter& writeComment( std::string const& text ) {
+ ensureTagClosed();
+ stream() << m_indent << "<!--" << text << "-->";
+ m_needsNewline = true;
+ return *this;
+ }
+
+ XmlWriter& writeBlankLine() {
+ ensureTagClosed();
+ stream() << "\n";
+ return *this;
+ }
+
+ void setStream( std::ostream& os ) {
+ m_os = &os;
+ }
+
+ private:
+ XmlWriter( XmlWriter const& );
+ void operator=( XmlWriter const& );
+
+ std::ostream& stream() {
+ return *m_os;
+ }
+
+ void ensureTagClosed() {
+ if( m_tagIsOpen ) {
+ stream() << ">\n";
+ m_tagIsOpen = false;
+ }
+ }
+
+ void newlineIfNecessary() {
+ if( m_needsNewline ) {
+ stream() << "\n";
+ m_needsNewline = false;
+ }
+ }
+
+ void writeEncodedText( std::string const& text ) {
+ static const char* charsToEncode = "<&\"";
+ std::string mtext = text;
+ std::string::size_type pos = mtext.find_first_of( charsToEncode );
+ while( pos != std::string::npos ) {
+ stream() << mtext.substr( 0, pos );
+
+ switch( mtext[pos] ) {
+ case '<':
+ stream() << "&lt;";
+ break;
+ case '&':
+ stream() << "&amp;";
+ break;
+ case '\"':
+ stream() << "&quot;";
+ break;
+ }
+ mtext = mtext.substr( pos+1 );
+ pos = mtext.find_first_of( charsToEncode );
+ }
+ stream() << mtext;
+ }
+
+ bool m_tagIsOpen;
+ bool m_needsNewline;
+ std::vector<std::string> m_tags;
+ std::string m_indent;
+ std::ostream* m_os;
+ };
+
+}
+namespace Catch {
+ class XmlReporter : public SharedImpl<IReporter> {
+ public:
+ XmlReporter( ReporterConfig const& config ) : m_config( config ), m_sectionDepth( 0 ) {}
+
+ static std::string getDescription() {
+ return "Reports test results as an XML document";
+ }
+ virtual ~XmlReporter();
+
+ private: // IReporter
+
+ virtual bool shouldRedirectStdout() const {
+ return true;
+ }
+
+ virtual void StartTesting() {
+ m_xml.setStream( m_config.stream() );
+ m_xml.startElement( "Catch" );
+ if( !m_config.fullConfig()->name().empty() )
+ m_xml.writeAttribute( "name", m_config.fullConfig()->name() );
+ }
+
+ virtual void EndTesting( const Totals& totals ) {
+ m_xml.scopedElement( "OverallResults" )
+ .writeAttribute( "successes", totals.assertions.passed )
+ .writeAttribute( "failures", totals.assertions.failed );
+ m_xml.endElement();
+ }
+
+ virtual void StartGroup( const std::string& groupName ) {
+ m_xml.startElement( "Group" )
+ .writeAttribute( "name", groupName );
+ }
+
+ virtual void EndGroup( const std::string&, const Totals& totals ) {
+ m_xml.scopedElement( "OverallResults" )
+ .writeAttribute( "successes", totals.assertions.passed )
+ .writeAttribute( "failures", totals.assertions.failed );
+ m_xml.endElement();
+ }
+
+ virtual void StartSection( const std::string& sectionName, const std::string& description ) {
+ if( m_sectionDepth++ > 0 ) {
+ m_xml.startElement( "Section" )
+ .writeAttribute( "name", trim( sectionName ) )
+ .writeAttribute( "description", description );
+ }
+ }
+ virtual void NoAssertionsInSection( const std::string& ) {}
+ virtual void NoAssertionsInTestCase( const std::string& ) {}
+
+ virtual void EndSection( const std::string& /*sectionName*/, const Counts& assertions ) {
+ if( --m_sectionDepth > 0 ) {
+ m_xml.scopedElement( "OverallResults" )
+ .writeAttribute( "successes", assertions.passed )
+ .writeAttribute( "failures", assertions.failed );
+ m_xml.endElement();
+ }
+ }
+
+ virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) {
+ m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) );
+ m_currentTestSuccess = true;
+ }
+
+ virtual void Result( const Catch::AssertionResult& assertionResult ) {
+ if( !m_config.fullConfig()->includeSuccessfulResults() && assertionResult.getResultType() == ResultWas::Ok )
+ return;
+
+ if( assertionResult.hasExpression() ) {
+ m_xml.startElement( "Expression" )
+ .writeAttribute( "success", assertionResult.succeeded() )
+ .writeAttribute( "filename", assertionResult.getSourceInfo().file )
+ .writeAttribute( "line", assertionResult.getSourceInfo().line );
+
+ m_xml.scopedElement( "Original" )
+ .writeText( assertionResult.getExpression() );
+ m_xml.scopedElement( "Expanded" )
+ .writeText( assertionResult.getExpandedExpression() );
+ m_currentTestSuccess &= assertionResult.succeeded();
+ }
+
+ switch( assertionResult.getResultType() ) {
+ case ResultWas::ThrewException:
+ m_xml.scopedElement( "Exception" )
+ .writeAttribute( "filename", assertionResult.getSourceInfo().file )
+ .writeAttribute( "line", assertionResult.getSourceInfo().line )
+ .writeText( assertionResult.getMessage() );
+ m_currentTestSuccess = false;
+ break;
+ case ResultWas::Info:
+ m_xml.scopedElement( "Info" )
+ .writeText( assertionResult.getMessage() );
+ break;
+ case ResultWas::Warning:
+ m_xml.scopedElement( "Warning" )
+ .writeText( assertionResult.getMessage() );
+ break;
+ case ResultWas::ExplicitFailure:
+ m_xml.scopedElement( "Failure" )
+ .writeText( assertionResult.getMessage() );
+ m_currentTestSuccess = false;
+ break;
+ case ResultWas::Unknown:
+ case ResultWas::Ok:
+ case ResultWas::FailureBit:
+ case ResultWas::ExpressionFailed:
+ case ResultWas::Exception:
+ case ResultWas::DidntThrowException:
+ break;
+ }
+ if( assertionResult.hasExpression() )
+ m_xml.endElement();
+ }
+
+ virtual void Aborted() {
+ // !TBD
+ }
+
+ virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) {
+ m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess );
+ m_xml.endElement();
+ }
+
+ private:
+ ReporterConfig m_config;
+ bool m_currentTestSuccess;
+ XmlWriter m_xml;
+ int m_sectionDepth;
+ };
+
+} // end namespace Catch
+
+// #included from: ../reporters/catch_reporter_junit.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED
+
+#include <assert.h>
+
+namespace Catch {
+
+ class JunitReporter : public CumulativeReporterBase {
+ public:
+ JunitReporter( ReporterConfig const& _config )
+ : CumulativeReporterBase( _config ),
+ xml( _config.stream() )
+ {}
+
+ ~JunitReporter();
+
+ static std::string getDescription() {
+ return "Reports test results in an XML format that looks like Ant's junitreport target";
+ }
+
+ virtual void noMatchingTestCases( std::string const& /*spec*/ ) {}
+
+ virtual ReporterPreferences getPreferences() const {
+ ReporterPreferences prefs;
+ prefs.shouldRedirectStdOut = true;
+ return prefs;
+ }
+
+ virtual void testRunStarting( TestRunInfo const& runInfo ) {
+ CumulativeReporterBase::testRunStarting( runInfo );
+ xml.startElement( "testsuites" );
+ }
+
+ virtual void testGroupStarting( GroupInfo const& groupInfo ) {
+ suiteTimer.start();
+ stdOutForSuite.str("");
+ stdErrForSuite.str("");
+ unexpectedExceptions = 0;
+ CumulativeReporterBase::testGroupStarting( groupInfo );
+ }
+
+ virtual bool assertionEnded( AssertionStats const& assertionStats ) {
+ if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException )
+ unexpectedExceptions++;
+ return CumulativeReporterBase::assertionEnded( assertionStats );
+ }
+
+ virtual void testCaseEnded( TestCaseStats const& testCaseStats ) {
+ stdOutForSuite << testCaseStats.stdOut;
+ stdErrForSuite << testCaseStats.stdErr;
+ CumulativeReporterBase::testCaseEnded( testCaseStats );
+ }
+
+ virtual void testGroupEnded( TestGroupStats const& testGroupStats ) {
+ double suiteTime = suiteTimer.getElapsedSeconds();
+ CumulativeReporterBase::testGroupEnded( testGroupStats );
+ writeGroup( *m_testGroups.back(), suiteTime );
+ }
+
+ virtual void testRunEndedCumulative() {
+ xml.endElement();
+ }
+
+ void writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
+ XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
+ TestGroupStats const& stats = groupNode.value;
+ xml.writeAttribute( "name", stats.groupInfo.name );
+ xml.writeAttribute( "errors", unexpectedExceptions );
+ xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
+ xml.writeAttribute( "tests", stats.totals.assertions.total() );
+ xml.writeAttribute( "hostname", "tbd" ); // !TBD
+ if( m_config->showDurations() == ShowDurations::Never )
+ xml.writeAttribute( "time", "" );
+ else
+ xml.writeAttribute( "time", suiteTime );
+ xml.writeAttribute( "timestamp", "tbd" ); // !TBD
+
+ // Write test cases
+ for( TestGroupNode::ChildNodes::const_iterator
+ it = groupNode.children.begin(), itEnd = groupNode.children.end();
+ it != itEnd;
+ ++it )
+ writeTestCase( **it );
+
+ xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite.str() ), false );
+ xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false );
+ }
+
+ void writeTestCase( TestCaseNode const& testCaseNode ) {
+ TestCaseStats const& stats = testCaseNode.value;
+
+ // All test cases have exactly one section - which represents the
+ // test case itself. That section may have 0-n nested sections
+ assert( testCaseNode.children.size() == 1 );
+ SectionNode const& rootSection = *testCaseNode.children.front();
+
+ std::string className = stats.testInfo.className;
+
+ if( className.empty() ) {
+ if( rootSection.childSections.empty() )
+ className = "global";
+ }
+ writeSection( className, "", rootSection );
+ }
+
+ void writeSection( std::string const& className,
+ std::string const& rootName,
+ SectionNode const& sectionNode ) {
+ std::string name = trim( sectionNode.stats.sectionInfo.name );
+ if( !rootName.empty() )
+ name = rootName + "/" + name;
+
+ if( !sectionNode.assertions.empty() ||
+ !sectionNode.stdOut.empty() ||
+ !sectionNode.stdErr.empty() ) {
+ XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
+ if( className.empty() ) {
+ xml.writeAttribute( "classname", name );
+ xml.writeAttribute( "name", "root" );
+ }
+ else {
+ xml.writeAttribute( "classname", className );
+ xml.writeAttribute( "name", name );
+ }
+ xml.writeAttribute( "time", toString( sectionNode.stats.durationInSeconds ) );
+
+ writeAssertions( sectionNode );
+
+ if( !sectionNode.stdOut.empty() )
+ xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), false );
+ if( !sectionNode.stdErr.empty() )
+ xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), false );
+ }
+ for( SectionNode::ChildSections::const_iterator
+ it = sectionNode.childSections.begin(),
+ itEnd = sectionNode.childSections.end();
+ it != itEnd;
+ ++it )
+ if( className.empty() )
+ writeSection( name, "", **it );
+ else
+ writeSection( className, name, **it );
+ }
+
+ void writeAssertions( SectionNode const& sectionNode ) {
+ for( SectionNode::Assertions::const_iterator
+ it = sectionNode.assertions.begin(), itEnd = sectionNode.assertions.end();
+ it != itEnd;
+ ++it )
+ writeAssertion( *it );
+ }
+ void writeAssertion( AssertionStats const& stats ) {
+ AssertionResult const& result = stats.assertionResult;
+ if( !result.isOk() ) {
+ std::string elementName;
+ switch( result.getResultType() ) {
+ case ResultWas::ThrewException:
+ elementName = "error";
+ break;
+ case ResultWas::ExplicitFailure:
+ elementName = "failure";
+ break;
+ case ResultWas::ExpressionFailed:
+ elementName = "failure";
+ break;
+ case ResultWas::DidntThrowException:
+ elementName = "failure";
+ break;
+
+ // We should never see these here:
+ case ResultWas::Info:
+ case ResultWas::Warning:
+ case ResultWas::Ok:
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ elementName = "internalError";
+ break;
+ }
+
+ XmlWriter::ScopedElement e = xml.scopedElement( elementName );
+
+ xml.writeAttribute( "message", result.getExpandedExpression() );
+ xml.writeAttribute( "type", result.getTestMacroName() );
+
+ std::ostringstream oss;
+ if( !result.getMessage().empty() )
+ oss << result.getMessage() << "\n";
+ for( std::vector<MessageInfo>::const_iterator
+ it = stats.infoMessages.begin(),
+ itEnd = stats.infoMessages.end();
+ it != itEnd;
+ ++it )
+ if( it->type == ResultWas::Info )
+ oss << it->message << "\n";
+
+ oss << "at " << result.getSourceInfo();
+ xml.writeText( oss.str(), false );
+ }
+ }
+
+ XmlWriter xml;
+ Timer suiteTimer;
+ std::ostringstream stdOutForSuite;
+ std::ostringstream stdErrForSuite;
+ unsigned int unexpectedExceptions;
+ };
+
+ INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
+
+} // end namespace Catch
+
+// #included from: ../reporters/catch_reporter_console.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED
+
+#include <cstring>
+
+namespace Catch {
+
+ struct ConsoleReporter : StreamingReporterBase {
+ ConsoleReporter( ReporterConfig const& _config )
+ : StreamingReporterBase( _config ),
+ m_headerPrinted( false ),
+ m_atLeastOneTestCasePrinted( false )
+ {}
+
+ virtual ~ConsoleReporter();
+ static std::string getDescription() {
+ return "Reports test results as plain lines of text";
+ }
+ virtual ReporterPreferences getPreferences() const {
+ ReporterPreferences prefs;
+ prefs.shouldRedirectStdOut = false;
+ return prefs;
+ }
+
+ virtual void noMatchingTestCases( std::string const& spec ) {
+ stream << "No test cases matched '" << spec << "'" << std::endl;
+ }
+
+ virtual void assertionStarting( AssertionInfo const& ) {
+ }
+
+ virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
+ AssertionResult const& result = _assertionStats.assertionResult;
+
+ bool printInfoMessages = true;
+
+ // Drop out if result was successful and we're not printing those
+ if( !m_config->includeSuccessfulResults() && result.isOk() ) {
+ if( result.getResultType() != ResultWas::Warning )
+ return false;
+ printInfoMessages = false;
+ }
+
+ lazyPrint();
+
+ AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
+ printer.print();
+ stream << std::endl;
+ return true;
+ }
+
+ virtual void sectionStarting( SectionInfo const& _sectionInfo ) {
+ m_headerPrinted = false;
+ StreamingReporterBase::sectionStarting( _sectionInfo );
+ }
+ virtual void sectionEnded( SectionStats const& _sectionStats ) {
+ if( _sectionStats.missingAssertions ) {
+ lazyPrint();
+ Colour colour( Colour::ResultError );
+ if( m_sectionStack.size() > 1 )
+ stream << "\nNo assertions in section";
+ else
+ stream << "\nNo assertions in test case";
+ stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
+ }
+ if( m_headerPrinted ) {
+ if( m_config->showDurations() == ShowDurations::Always )
+ stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
+ m_headerPrinted = false;
+ }
+ else {
+ if( m_config->showDurations() == ShowDurations::Always )
+ stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
+ }
+ StreamingReporterBase::sectionEnded( _sectionStats );
+ }
+
+ virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) {
+ StreamingReporterBase::testCaseEnded( _testCaseStats );
+ m_headerPrinted = false;
+ }
+ virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) {
+ if( currentGroupInfo.used ) {
+ printSummaryDivider();
+ stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n";
+ printTotals( _testGroupStats.totals );
+ stream << "\n" << std::endl;
+ }
+ StreamingReporterBase::testGroupEnded( _testGroupStats );
+ }
+ virtual void testRunEnded( TestRunStats const& _testRunStats ) {
+ if( m_atLeastOneTestCasePrinted )
+ printTotalsDivider();
+ printTotals( _testRunStats.totals );
+ stream << "\n" << std::endl;
+ StreamingReporterBase::testRunEnded( _testRunStats );
+ }
+
+ private:
+
+ class AssertionPrinter {
+ void operator= ( AssertionPrinter const& );
+ public:
+ AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
+ : stream( _stream ),
+ stats( _stats ),
+ result( _stats.assertionResult ),
+ colour( Colour::None ),
+ message( result.getMessage() ),
+ messages( _stats.infoMessages ),
+ printInfoMessages( _printInfoMessages )
+ {
+ switch( result.getResultType() ) {
+ case ResultWas::Ok:
+ colour = Colour::Success;
+ passOrFail = "PASSED";
+ //if( result.hasMessage() )
+ if( _stats.infoMessages.size() == 1 )
+ messageLabel = "with message";
+ if( _stats.infoMessages.size() > 1 )
+ messageLabel = "with messages";
+ break;
+ case ResultWas::ExpressionFailed:
+ if( result.isOk() ) {
+ colour = Colour::Success;
+ passOrFail = "FAILED - but was ok";
+ }
+ else {
+ colour = Colour::Error;
+ passOrFail = "FAILED";
+ }
+ if( _stats.infoMessages.size() == 1 )
+ messageLabel = "with message";
+ if( _stats.infoMessages.size() > 1 )
+ messageLabel = "with messages";
+ break;
+ case ResultWas::ThrewException:
+ colour = Colour::Error;
+ passOrFail = "FAILED";
+ messageLabel = "due to unexpected exception with message";
+ break;
+ case ResultWas::DidntThrowException:
+ colour = Colour::Error;
+ passOrFail = "FAILED";
+ messageLabel = "because no exception was thrown where one was expected";
+ break;
+ case ResultWas::Info:
+ messageLabel = "info";
+ break;
+ case ResultWas::Warning:
+ messageLabel = "warning";
+ break;
+ case ResultWas::ExplicitFailure:
+ passOrFail = "FAILED";
+ colour = Colour::Error;
+ if( _stats.infoMessages.size() == 1 )
+ messageLabel = "explicitly with message";
+ if( _stats.infoMessages.size() > 1 )
+ messageLabel = "explicitly with messages";
+ break;
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ passOrFail = "** internal error **";
+ colour = Colour::Error;
+ break;
+ }
+ }
+
+ void print() const {
+ printSourceInfo();
+ if( stats.totals.assertions.total() > 0 ) {
+ if( result.isOk() )
+ stream << "\n";
+ printResultType();
+ printOriginalExpression();
+ printReconstructedExpression();
+ }
+ else {
+ stream << "\n";
+ }
+ printMessage();
+ }
+
+ private:
+ void printResultType() const {
+ if( !passOrFail.empty() ) {
+ Colour colourGuard( colour );
+ stream << passOrFail << ":\n";
+ }
+ }
+ void printOriginalExpression() const {
+ if( result.hasExpression() ) {
+ Colour colourGuard( Colour::OriginalExpression );
+ stream << " ";
+ stream << result.getExpressionInMacro();
+ stream << "\n";
+ }
+ }
+ void printReconstructedExpression() const {
+ if( result.hasExpandedExpression() ) {
+ stream << "with expansion:\n";
+ Colour colourGuard( Colour::ReconstructedExpression );
+ stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n";
+ }
+ }
+ void printMessage() const {
+ if( !messageLabel.empty() )
+ stream << messageLabel << ":" << "\n";
+ for( std::vector<MessageInfo>::const_iterator it = messages.begin(), itEnd = messages.end();
+ it != itEnd;
+ ++it ) {
+ // If this assertion is a warning ignore any INFO messages
+ if( printInfoMessages || it->type != ResultWas::Info )
+ stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n";
+ }
+ }
+ void printSourceInfo() const {
+ Colour colourGuard( Colour::FileName );
+ stream << result.getSourceInfo() << ": ";
+ }
+
+ std::ostream& stream;
+ AssertionStats const& stats;
+ AssertionResult const& result;
+ Colour::Code colour;
+ std::string passOrFail;
+ std::string messageLabel;
+ std::string message;
+ std::vector<MessageInfo> messages;
+ bool printInfoMessages;
+ };
+
+ void lazyPrint() {
+
+ if( !currentTestRunInfo.used )
+ lazyPrintRunInfo();
+ if( !currentGroupInfo.used )
+ lazyPrintGroupInfo();
+
+ if( !m_headerPrinted ) {
+ printTestCaseAndSectionHeader();
+ m_headerPrinted = true;
+ }
+ m_atLeastOneTestCasePrinted = true;
+ }
+ void lazyPrintRunInfo() {
+ stream << "\n" << getLineOfChars<'~'>() << "\n";
+ Colour colour( Colour::SecondaryText );
+ stream << currentTestRunInfo->name
+ << " is a Catch v" << libraryVersion.majorVersion << "."
+ << libraryVersion.minorVersion << " b"
+ << libraryVersion.buildNumber;
+ if( libraryVersion.branchName != std::string( "master" ) )
+ stream << " (" << libraryVersion.branchName << ")";
+ stream << " host application.\n"
+ << "Run with -? for options\n\n";
+
+ currentTestRunInfo.used = true;
+ }
+ void lazyPrintGroupInfo() {
+ if( !currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1 ) {
+ printClosedHeader( "Group: " + currentGroupInfo->name );
+ currentGroupInfo.used = true;
+ }
+ }
+ void printTestCaseAndSectionHeader() {
+ assert( !m_sectionStack.empty() );
+ printOpenHeader( currentTestCaseInfo->name );
+
+ if( m_sectionStack.size() > 1 ) {
+ Colour colourGuard( Colour::Headers );
+
+ std::vector<SectionInfo>::const_iterator
+ it = m_sectionStack.begin()+1, // Skip first section (test case)
+ itEnd = m_sectionStack.end();
+ for( ; it != itEnd; ++it )
+ printHeaderString( it->name, 2 );
+ }
+
+ SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
+
+ if( !lineInfo.empty() ){
+ stream << getLineOfChars<'-'>() << "\n";
+ Colour colourGuard( Colour::FileName );
+ stream << lineInfo << "\n";
+ }
+ stream << getLineOfChars<'.'>() << "\n" << std::endl;
+ }
+
+ void printClosedHeader( std::string const& _name ) {
+ printOpenHeader( _name );
+ stream << getLineOfChars<'.'>() << "\n";
+ }
+ void printOpenHeader( std::string const& _name ) {
+ stream << getLineOfChars<'-'>() << "\n";
+ {
+ Colour colourGuard( Colour::Headers );
+ printHeaderString( _name );
+ }
+ }
+
+ // if string has a : in first line will set indent to follow it on
+ // subsequent lines
+ void printHeaderString( std::string const& _string, std::size_t indent = 0 ) {
+ std::size_t i = _string.find( ": " );
+ if( i != std::string::npos )
+ i+=2;
+ else
+ i = 0;
+ stream << Text( _string, TextAttributes()
+ .setIndent( indent+i)
+ .setInitialIndent( indent ) ) << "\n";
+ }
+
+ void printTotals( const Totals& totals ) {
+ if( totals.testCases.total() == 0 ) {
+ stream << "No tests ran";
+ }
+ else if( totals.assertions.total() == 0 ) {
+ Colour colour( Colour::Yellow );
+ printCounts( "test case", totals.testCases );
+ stream << " (no assertions)";
+ }
+ else if( totals.assertions.failed ) {
+ Colour colour( Colour::ResultError );
+ printCounts( "test case", totals.testCases );
+ if( totals.testCases.failed > 0 ) {
+ stream << " (";
+ printCounts( "assertion", totals.assertions );
+ stream << ")";
+ }
+ }
+ else {
+ Colour colour( Colour::ResultSuccess );
+ stream << "All tests passed ("
+ << pluralise( totals.assertions.passed, "assertion" ) << " in "
+ << pluralise( totals.testCases.passed, "test case" ) << ")";
+ }
+ }
+ void printCounts( std::string const& label, Counts const& counts ) {
+ if( counts.total() == 1 ) {
+ stream << "1 " << label << " - ";
+ if( counts.failed )
+ stream << "failed";
+ else
+ stream << "passed";
+ }
+ else {
+ stream << counts.total() << " " << label << "s ";
+ if( counts.passed ) {
+ if( counts.failed )
+ stream << "- " << counts.failed << " failed";
+ else if( counts.passed == 2 )
+ stream << "- both passed";
+ else
+ stream << "- all passed";
+ }
+ else {
+ if( counts.failed == 2 )
+ stream << "- both failed";
+ else
+ stream << "- all failed";
+ }
+ }
+ }
+
+ void printTotalsDivider() {
+ stream << getLineOfChars<'='>() << "\n";
+ }
+ void printSummaryDivider() {
+ stream << getLineOfChars<'-'>() << "\n";
+ }
+ template<char C>
+ static char const* getLineOfChars() {
+ static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
+ if( !*line ) {
+ memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
+ line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
+ }
+ return line;
+ }
+
+ private:
+ bool m_headerPrinted;
+ bool m_atLeastOneTestCasePrinted;
+ };
+
+ INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter )
+
+} // end namespace Catch
+
+// #included from: ../reporters/catch_reporter_compact.hpp
+#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_HPP_INCLUDED
+
+namespace Catch {
+
+ struct CompactReporter : StreamingReporterBase {
+
+ CompactReporter( ReporterConfig const& _config )
+ : StreamingReporterBase( _config )
+ {}
+
+ virtual ~CompactReporter();
+
+ static std::string getDescription() {
+ return "Reports test results on a single line, suitable for IDEs";
+ }
+
+ virtual ReporterPreferences getPreferences() const {
+ ReporterPreferences prefs;
+ prefs.shouldRedirectStdOut = false;
+ return prefs;
+ }
+
+ virtual void noMatchingTestCases( std::string const& spec ) {
+ stream << "No test cases matched '" << spec << "'" << std::endl;
+ }
+
+ virtual void assertionStarting( AssertionInfo const& ) {
+ }
+
+ virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
+ AssertionResult const& result = _assertionStats.assertionResult;
+
+ bool printInfoMessages = true;
+
+ // Drop out if result was successful and we're not printing those
+ if( !m_config->includeSuccessfulResults() && result.isOk() ) {
+ if( result.getResultType() != ResultWas::Warning )
+ return false;
+ printInfoMessages = false;
+ }
+
+ AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
+ printer.print();
+
+ stream << std::endl;
+ return true;
+ }
+
+ virtual void testRunEnded( TestRunStats const& _testRunStats ) {
+ printTotals( _testRunStats.totals );
+ stream << "\n" << std::endl;
+ StreamingReporterBase::testRunEnded( _testRunStats );
+ }
+
+ private:
+ class AssertionPrinter {
+ void operator= ( AssertionPrinter const& );
+ public:
+ AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
+ : stream( _stream )
+ , stats( _stats )
+ , result( _stats.assertionResult )
+ , messages( _stats.infoMessages )
+ , itMessage( _stats.infoMessages.begin() )
+ , printInfoMessages( _printInfoMessages )
+ {}
+
+ void print() {
+ printSourceInfo();
+
+ itMessage = messages.begin();
+
+ switch( result.getResultType() ) {
+ case ResultWas::Ok:
+ printResultType( Colour::ResultSuccess, passedString() );
+ printOriginalExpression();
+ printReconstructedExpression();
+ if ( ! result.hasExpression() )
+ printRemainingMessages( Colour::None );
+ else
+ printRemainingMessages();
+ break;
+ case ResultWas::ExpressionFailed:
+ if( result.isOk() )
+ printResultType( Colour::ResultSuccess, failedString() + std::string( " - but was ok" ) );
+ else
+ printResultType( Colour::Error, failedString() );
+ printOriginalExpression();
+ printReconstructedExpression();
+ printRemainingMessages();
+ break;
+ case ResultWas::ThrewException:
+ printResultType( Colour::Error, failedString() );
+ printIssue( "unexpected exception with message:" );
+ printMessage();
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::DidntThrowException:
+ printResultType( Colour::Error, failedString() );
+ printIssue( "expected exception, got none" );
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::Info:
+ printResultType( Colour::None, "info" );
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::Warning:
+ printResultType( Colour::None, "warning" );
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::ExplicitFailure:
+ printResultType( Colour::Error, failedString() );
+ printIssue( "explicitly" );
+ printRemainingMessages( Colour::None );
+ break;
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ printResultType( Colour::Error, "** internal error **" );
+ break;
+ }
+ }
+
+ private:
+ // Colour::LightGrey
+
+ static Colour::Code dimColour() { return Colour::FileName; }
+
+#ifdef CATCH_PLATFORM_MAC
+ static const char* failedString() { return "FAILED"; }
+ static const char* passedString() { return "PASSED"; }
+#else
+ static const char* failedString() { return "failed"; }
+ static const char* passedString() { return "passed"; }
+#endif
+
+ void printSourceInfo() const {
+ Colour colourGuard( Colour::FileName );
+ stream << result.getSourceInfo() << ":";
+ }
+
+ void printResultType( Colour::Code colour, std::string passOrFail ) const {
+ if( !passOrFail.empty() ) {
+ {
+ Colour colourGuard( colour );
+ stream << " " << passOrFail;
+ }
+ stream << ":";
+ }
+ }
+
+ void printIssue( std::string issue ) const {
+ stream << " " << issue;
+ }
+
+ void printExpressionWas() {
+ if( result.hasExpression() ) {
+ stream << ";";
+ {
+ Colour colour( dimColour() );
+ stream << " expression was:";
+ }
+ printOriginalExpression();
+ }
+ }
+
+ void printOriginalExpression() const {
+ if( result.hasExpression() ) {
+ stream << " " << result.getExpression();
+ }
+ }
+
+ void printReconstructedExpression() const {
+ if( result.hasExpandedExpression() ) {
+ {
+ Colour colour( dimColour() );
+ stream << " for: ";
+ }
+ stream << result.getExpandedExpression();
+ }
+ }
+
+ void printMessage() {
+ if ( itMessage != messages.end() ) {
+ stream << " '" << itMessage->message << "'";
+ ++itMessage;
+ }
+ }
+
+ void printRemainingMessages( Colour::Code colour = dimColour() ) {
+ if ( itMessage == messages.end() )
+ return;
+
+ // using messages.end() directly yields compilation error:
+ std::vector<MessageInfo>::const_iterator itEnd = messages.end();
+ const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
+
+ {
+ Colour colourGuard( colour );
+ stream << " with " << pluralise( N, "message" ) << ":";
+ }
+
+ for(; itMessage != itEnd; ) {
+ // If this assertion is a warning ignore any INFO messages
+ if( printInfoMessages || itMessage->type != ResultWas::Info ) {
+ stream << " '" << itMessage->message << "'";
+ if ( ++itMessage != itEnd ) {
+ Colour colourGuard( dimColour() );
+ stream << " and";
+ }
+ }
+ }
+ }
+
+ private:
+ std::ostream& stream;
+ AssertionStats const& stats;
+ AssertionResult const& result;
+ std::vector<MessageInfo> messages;
+ std::vector<MessageInfo>::const_iterator itMessage;
+ bool printInfoMessages;
+ };
+
+ // Colour, message variants:
+ // - white: No tests ran.
+ // - red: Failed [both/all] N test cases, failed [both/all] M assertions.
+ // - white: Passed [both/all] N test cases (no assertions).
+ // - red: Failed N tests cases, failed M assertions.
+ // - green: Passed [both/all] N tests cases with M assertions.
+
+ std::string bothOrAll( std::size_t count ) const {
+ return count == 1 ? "" : count == 2 ? "both " : "all " ;
+ }
+
+ void printTotals( const Totals& totals ) const {
+ if( totals.testCases.total() == 0 ) {
+ stream << "No tests ran.";
+ }
+ else if( totals.testCases.failed == totals.testCases.total() ) {
+ Colour colour( Colour::ResultError );
+ const std::string qualify_assertions_failed =
+ totals.assertions.failed == totals.assertions.total() ?
+ bothOrAll( totals.assertions.failed ) : "";
+ stream <<
+ "Failed " << bothOrAll( totals.testCases.failed )
+ << pluralise( totals.testCases.failed, "test case" ) << ", "
+ "failed " << qualify_assertions_failed <<
+ pluralise( totals.assertions.failed, "assertion" ) << ".";
+ }
+ else if( totals.assertions.total() == 0 ) {
+ stream <<
+ "Passed " << bothOrAll( totals.testCases.total() )
+ << pluralise( totals.testCases.total(), "test case" )
+ << " (no assertions).";
+ }
+ else if( totals.assertions.failed ) {
+ Colour colour( Colour::ResultError );
+ stream <<
+ "Failed " << pluralise( totals.testCases.failed, "test case" ) << ", "
+ "failed " << pluralise( totals.assertions.failed, "assertion" ) << ".";
+ }
+ else {
+ Colour colour( Colour::ResultSuccess );
+ stream <<
+ "Passed " << bothOrAll( totals.testCases.passed )
+ << pluralise( totals.testCases.passed, "test case" ) <<
+ " with " << pluralise( totals.assertions.passed, "assertion" ) << ".";
+ }
+ }
+ };
+
+ INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter )
+
+} // end namespace Catch
+
+namespace Catch {
+ NonCopyable::~NonCopyable() {}
+ IShared::~IShared() {}
+ StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {}
+ IContext::~IContext() {}
+ IResultCapture::~IResultCapture() {}
+ ITestCase::~ITestCase() {}
+ ITestCaseRegistry::~ITestCaseRegistry() {}
+ IRegistryHub::~IRegistryHub() {}
+ IMutableRegistryHub::~IMutableRegistryHub() {}
+ IExceptionTranslator::~IExceptionTranslator() {}
+ IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
+ IReporter::~IReporter() {}
+ IReporterFactory::~IReporterFactory() {}
+ IReporterRegistry::~IReporterRegistry() {}
+ IStreamingReporter::~IStreamingReporter() {}
+ AssertionStats::~AssertionStats() {}
+ SectionStats::~SectionStats() {}
+ TestCaseStats::~TestCaseStats() {}
+ TestGroupStats::~TestGroupStats() {}
+ TestRunStats::~TestRunStats() {}
+ CumulativeReporterBase::SectionNode::~SectionNode() {}
+ CumulativeReporterBase::~CumulativeReporterBase() {}
+
+ StreamingReporterBase::~StreamingReporterBase() {}
+ ConsoleReporter::~ConsoleReporter() {}
+ CompactReporter::~CompactReporter() {}
+ IRunner::~IRunner() {}
+ IMutableContext::~IMutableContext() {}
+ IConfig::~IConfig() {}
+ XmlReporter::~XmlReporter() {}
+ JunitReporter::~JunitReporter() {}
+ TestRegistry::~TestRegistry() {}
+ FreeFunctionTestCase::~FreeFunctionTestCase() {}
+ IGeneratorInfo::~IGeneratorInfo() {}
+ IGeneratorsForTest::~IGeneratorsForTest() {}
+ TestSpec::Pattern::~Pattern() {}
+ TestSpec::NamePattern::~NamePattern() {}
+ TestSpec::TagPattern::~TagPattern() {}
+ TestSpec::ExcludedPattern::~ExcludedPattern() {}
+
+ Matchers::Impl::StdString::Equals::~Equals() {}
+ Matchers::Impl::StdString::Contains::~Contains() {}
+ Matchers::Impl::StdString::StartsWith::~StartsWith() {}
+ Matchers::Impl::StdString::EndsWith::~EndsWith() {}
+
+ void Config::dummy() {}
+
+ INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( "xml", XmlReporter )
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#endif
+
+#ifdef CATCH_CONFIG_MAIN
+// #included from: internal/catch_default_main.hpp
+#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
+
+#ifndef __OBJC__
+
+// Standard C/C++ main entry point
+int main (int argc, char * const argv[]) {
+ return Catch::Session().run( argc, argv );
+}
+
+#else // __OBJC__
+
+// Objective-C entry point
+int main (int argc, char * const argv[]) {
+#if !CATCH_ARC_ENABLED
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+#endif
+
+ Catch::registerTestMethods();
+ int result = Catch::Session().run( argc, (char* const*)argv );
+
+#if !CATCH_ARC_ENABLED
+ [pool drain];
+#endif
+
+ return result;
+}
+
+#endif // __OBJC__
+
+#endif
+
+#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
+# undef CLARA_CONFIG_MAIN
+#endif
+
+//////
+
+// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
+#ifdef CATCH_CONFIG_PREFIX_ALL
+
+#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
+#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "CATCH_REQUIRE_FALSE" )
+
+#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" )
+#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
+#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
+
+#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
+#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CATCH_CHECK_FALSE" )
+#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" )
+#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" )
+#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" )
+
+#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
+#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
+#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
+
+#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
+#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" )
+
+#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" )
+#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg )
+#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" )
+#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" )
+#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" )
+
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+ #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
+ #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
+ #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+ #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ )
+ #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __VA_ARGS__ )
+#else
+ #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
+ #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
+ #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
+ #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
+ #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg )
+ #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg )
+#endif
+#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
+
+#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
+#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
+
+#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
+
+// "BDD-style" convenience wrappers
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
+#else
+#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags )
+#endif
+#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" )
+#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" )
+#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" )
+#define CATCH_THEN( desc ) CATCH_SECTION( " Then: " desc, "" )
+#define CATCH_AND_THEN( desc ) CATCH_SECTION( " And: " desc, "" )
+
+// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
+#else
+
+#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
+#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::NegateResult, "REQUIRE_FALSE" )
+
+#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::Normal, "REQUIRE_THROWS" )
+#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
+#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
+
+#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
+#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::NegateResult, "CHECK_FALSE" )
+#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" )
+#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
+#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
+
+#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, ..., Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" )
+#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
+#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
+
+#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
+#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" )
+
+#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" )
+#define WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg )
+#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" )
+#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" )
+#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" )
+
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+ #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
+ #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
+ #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+ #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ )
+ #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __VA_ARGS__ )
+#else
+ #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
+ #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
+ #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
+ #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
+ #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg )
+ #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg )
+#endif
+#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
+
+#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
+#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
+
+#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
+
+#endif
+
+#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
+
+// "BDD-style" convenience wrappers
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
+#else
+#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
+#endif
+#define GIVEN( desc ) SECTION( " Given: " desc, "" )
+#define WHEN( desc ) SECTION( " When: " desc, "" )
+#define AND_WHEN( desc ) SECTION( "And when: " desc, "" )
+#define THEN( desc ) SECTION( " Then: " desc, "" )
+#define AND_THEN( desc ) SECTION( " And: " desc, "" )
+
+using Catch::Detail::Approx;
+
+// #included from: internal/catch_reenable_warnings.h
+
+#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/makefile b/3rdparty/bgfx/3rdparty/scintilla/test/unit/makefile
new file mode 100644
index 00000000000..68339110090
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/makefile
@@ -0,0 +1,67 @@
+# Build all the unit tests using GNU make and either g++ or clang
+# Should be run using mingw32-make on Windows, not nmake
+# On Windows g++ is used, on OS X clang, and on Linux G++ is used by default
+# but clang can be used by defining CLANG when invoking make
+# clang works only with libc++, not libstdc++
+# Tested with clang 3.3 and g++ 4.8
+
+ifndef windir
+ifeq ($(shell uname),Darwin)
+# On OS X always use clang as g++ is old version
+CLANG = 1
+USELIBCPP = 1
+endif
+endif
+
+CXXFLAGS += --std=c++11
+
+ifdef CLANG
+CXX = clang++
+ifdef USELIBCPP
+# OS X, use libc++ but don't have sanitizers
+CXXFLAGS += --stdlib=libc++
+LINKFLAGS = -lc++
+else
+# Linux, have sanitizers
+SANITIZE = -fsanitize=address,undefined
+CXXFLAGS += $(SANITIZE)
+endif
+else
+CXX = g++
+endif
+
+ifdef windir
+DEL = del /q
+EXE = unitTest.exe
+else
+DEL = rm -f
+EXE = unitTest
+endif
+
+INCLUDEDIRS = -I ../../include -I ../../src -I../../lexlib
+
+CPPFLAGS += $(INCLUDEDIRS)
+CXXFLAGS += -Wall -Wextra
+
+# Files in this directory containing tests
+TESTSRC=test*.cxx
+# Files being tested from scintilla/src directory
+TESTEDSRC=\
+ ../../src/CellBuffer.cxx \
+ ../../src/CharClassify.cxx \
+ ../../src/ContractionState.cxx \
+ ../../src/Decoration.cxx \
+ ../../src/RunStyles.cxx
+
+TESTS=$(EXE)
+
+all: $(TESTS)
+
+test: $(TESTS)
+ ./$(EXE)
+
+clean:
+ $(DEL) $(TESTS) *.o *.obj *.exe
+
+$(EXE): $(TESTSRC) $(TESTEDSRC) unitTest.cxx
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LINKFLAGS) $^ -o $@
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/test.mak b/3rdparty/bgfx/3rdparty/scintilla/test/unit/test.mak
new file mode 100644
index 00000000000..934b0aa125c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/test.mak
@@ -0,0 +1,32 @@
+# Build all the unit tests with Microsoft Visual C++ using nmake
+# Tested with Visual C++ 2010 and 2013
+
+DEL = del /q
+EXE = unitTest.exe
+
+INCLUDEDIRS = /I../../include /I../../src /I../../lexlib
+
+CXXFLAGS = /EHsc /wd 4805 $(INCLUDEDIRS)
+
+# Files in this directory containing tests
+TESTSRC=test*.cxx
+# Files being tested from scintilla/src directory
+TESTEDSRC=\
+ ../../src/CellBuffer.cxx \
+ ../../src/CharClassify.cxx \
+ ../../src/ContractionState.cxx \
+ ../../src/Decoration.cxx \
+ ../../src/RunStyles.cxx
+
+TESTS=$(EXE)
+
+all: $(TESTS)
+
+test: $(TESTS)
+ $(EXE)
+
+clean:
+ $(DEL) $(TESTS) *.o *.obj *.exe
+
+$(EXE): $(TESTSRC) $(TESTEDSRC) $(@B).obj
+ $(CXX) $(CXXFLAGS) /Fe$@ $**
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCellBuffer.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCellBuffer.cxx
new file mode 100644
index 00000000000..691271927cd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCellBuffer.cxx
@@ -0,0 +1,140 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <cstring>
+#include <stdexcept>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "CellBuffer.h"
+
+#include "catch.hpp"
+
+// Test CellBuffer.
+
+TEST_CASE("CellBuffer") {
+
+ const char sText[] = "Scintilla";
+ const size_t sLength = strlen(sText);
+
+ CellBuffer cb;
+
+ SECTION("InsertOneLine") {
+ bool startSequence = false;
+ const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ REQUIRE(startSequence);
+ REQUIRE(sLength == cb.Length());
+ REQUIRE(memcmp(cpChange, sText, sLength) == 0);
+ REQUIRE(1 == cb.Lines());
+ REQUIRE(0 == cb.LineStart(0));
+ REQUIRE(0 == cb.LineFromPosition(0));
+ REQUIRE(sLength == cb.LineStart(1));
+ REQUIRE(0 == cb.LineFromPosition(sLength));
+ REQUIRE(cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+ }
+
+ SECTION("InsertTwoLines") {
+ const char sText2[] = "Two\nLines";
+ const size_t sLength2 = strlen(sText2);
+ bool startSequence = false;
+ const char *cpChange = cb.InsertString(0, sText2, sLength2, startSequence);
+ REQUIRE(startSequence);
+ REQUIRE(sLength2 == cb.Length());
+ REQUIRE(memcmp(cpChange, sText2, sLength2) == 0);
+ REQUIRE(2 == cb.Lines());
+ REQUIRE(0 == cb.LineStart(0));
+ REQUIRE(0 == cb.LineFromPosition(0));
+ REQUIRE(4 == cb.LineStart(1));
+ REQUIRE(1 == cb.LineFromPosition(5));
+ REQUIRE(sLength2 == cb.LineStart(2));
+ REQUIRE(1 == cb.LineFromPosition(sLength2));
+ REQUIRE(cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+ }
+
+ SECTION("UndoOff") {
+ REQUIRE(cb.IsCollectingUndo());
+ cb.SetUndoCollection(false);
+ REQUIRE(!cb.IsCollectingUndo());
+ bool startSequence = false;
+ const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ REQUIRE(!startSequence);
+ REQUIRE(sLength == cb.Length());
+ REQUIRE(memcmp(cpChange, sText, sLength) == 0);
+ REQUIRE(!cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+ }
+
+ SECTION("UndoRedo") {
+ const char sTextDeleted[] = "ci";
+ const char sTextAfterDeletion[] = "Sntilla";
+ bool startSequence = false;
+ const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ REQUIRE(startSequence);
+ REQUIRE(sLength == cb.Length());
+ REQUIRE(memcmp(cpChange, sText, sLength) == 0);
+ REQUIRE(memcmp(cb.BufferPointer(), sText, sLength) == 0);
+ REQUIRE(cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+ const char *cpDeletion = cb.DeleteChars(1, 2, startSequence);
+ REQUIRE(startSequence);
+ REQUIRE(memcmp(cpDeletion, sTextDeleted, strlen(sTextDeleted)) == 0);
+ REQUIRE(memcmp(cb.BufferPointer(), sTextAfterDeletion, strlen(sTextAfterDeletion)) == 0);
+ REQUIRE(cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+
+ int steps = cb.StartUndo();
+ REQUIRE(steps == 1);
+ cb.PerformUndoStep();
+ REQUIRE(memcmp(cb.BufferPointer(), sText, sLength) == 0);
+ REQUIRE(cb.CanUndo());
+ REQUIRE(cb.CanRedo());
+
+ steps = cb.StartUndo();
+ REQUIRE(steps == 1);
+ cb.PerformUndoStep();
+ REQUIRE(cb.Length() == 0);
+ REQUIRE(!cb.CanUndo());
+ REQUIRE(cb.CanRedo());
+
+ steps = cb.StartRedo();
+ REQUIRE(steps == 1);
+ cb.PerformRedoStep();
+ REQUIRE(memcmp(cb.BufferPointer(), sText, sLength) == 0);
+ REQUIRE(cb.CanUndo());
+ REQUIRE(cb.CanRedo());
+
+ steps = cb.StartRedo();
+ REQUIRE(steps == 1);
+ cb.PerformRedoStep();
+ REQUIRE(memcmp(cb.BufferPointer(), sTextAfterDeletion, strlen(sTextAfterDeletion)) == 0);
+ REQUIRE(cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+
+ cb.DeleteUndoHistory();
+ REQUIRE(!cb.CanUndo());
+ REQUIRE(!cb.CanRedo());
+ }
+
+ SECTION("LineEndTypes") {
+ REQUIRE(cb.GetLineEndTypes() == 0);
+ cb.SetLineEndTypes(1);
+ REQUIRE(cb.GetLineEndTypes() == 1);
+ cb.SetLineEndTypes(0);
+ REQUIRE(cb.GetLineEndTypes() == 0);
+ }
+
+ SECTION("ReadOnly") {
+ REQUIRE(!cb.IsReadOnly());
+ cb.SetReadOnly(true);
+ REQUIRE(cb.IsReadOnly());
+ bool startSequence = false;
+ cb.InsertString(0, sText, sLength, startSequence);
+ REQUIRE(cb.Length() == 0);
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCharClassify.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCharClassify.cxx
new file mode 100644
index 00000000000..c1e6cf532ff
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testCharClassify.cxx
@@ -0,0 +1,121 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "CharClassify.h"
+
+#include "catch.hpp"
+
+// Test CharClassify.
+
+class CharClassifyTest {
+ // Avoid warnings, private so never called.
+ CharClassifyTest(const CharClassifyTest &);
+protected:
+ CharClassifyTest() {
+ pcc = new CharClassify();
+ for (int ch = 0; ch < 256; ch++) {
+ if (ch == '\r' || ch == '\n')
+ charClass[ch] = CharClassify::ccNewLine;
+ else if (ch < 0x20 || ch == ' ')
+ charClass[ch] = CharClassify::ccSpace;
+ else if (ch >= 0x80 || isalnum(ch) || ch == '_')
+ charClass[ch] = CharClassify::ccWord;
+ else
+ charClass[ch] = CharClassify::ccPunctuation;
+ }
+ }
+
+ ~CharClassifyTest() {
+ delete pcc;
+ pcc = 0;
+ }
+
+ CharClassify *pcc;
+ CharClassify::cc charClass[256];
+
+ static const char* GetClassName(CharClassify::cc charClass) {
+ switch(charClass) {
+ #define CASE(c) case CharClassify::c: return #c
+ CASE(ccSpace);
+ CASE(ccNewLine);
+ CASE(ccWord);
+ CASE(ccPunctuation);
+ #undef CASE
+ default:
+ return "<unknown>";
+ }
+ }
+};
+
+TEST_CASE_METHOD(CharClassifyTest, "Defaults") {
+ for (int i = 0; i < 256; i++) {
+ if (charClass[i] != pcc->GetClass(i))
+ std::cerr
+ << "Character " << i
+ << " should be class " << GetClassName(charClass[i])
+ << ", but got " << GetClassName(pcc->GetClass(i)) << std::endl;
+ REQUIRE(charClass[i] == pcc->GetClass(i));
+ }
+}
+
+TEST_CASE_METHOD(CharClassifyTest, "Custom") {
+ unsigned char buf[2] = {0, 0};
+ for (int i = 0; i < 256; i++) {
+ CharClassify::cc thisClass = CharClassify::cc(i % 4);
+ buf[0] = i;
+ pcc->SetCharClasses(buf, thisClass);
+ charClass[i] = thisClass;
+ }
+ for (int i = 0; i < 256; i++) {
+ if (charClass[i] != pcc->GetClass(i))
+ std::cerr
+ << "Character " << i
+ << " should be class " << GetClassName(charClass[i])
+ << ", but got " << GetClassName(pcc->GetClass(i)) << std::endl;
+ REQUIRE(charClass[i] == pcc->GetClass(i));
+ }
+}
+
+TEST_CASE_METHOD(CharClassifyTest, "CharsOfClass") {
+ unsigned char buf[2] = {0, 0};
+ for (int i = 1; i < 256; i++) {
+ CharClassify::cc thisClass = CharClassify::cc(i % 4);
+ buf[0] = i;
+ pcc->SetCharClasses(buf, thisClass);
+ charClass[i] = thisClass;
+ }
+ for (int classVal = 0; classVal < 4; ++classVal) {
+ CharClassify::cc thisClass = CharClassify::cc(classVal % 4);
+ int size = pcc->GetCharsOfClass(thisClass, NULL);
+ unsigned char* buffer = new unsigned char[size + 1];
+ buffer[size] = '\0';
+ pcc->GetCharsOfClass(thisClass, buffer);
+ for (int i = 1; i < 256; i++) {
+ if (charClass[i] == thisClass) {
+ if (!memchr(reinterpret_cast<char*>(buffer), i, size))
+ std::cerr
+ << "Character " << i
+ << " should be class " << GetClassName(thisClass)
+ << ", but was not in GetCharsOfClass;"
+ << " it is reported to be "
+ << GetClassName(pcc->GetClass(i)) << std::endl;
+ REQUIRE(memchr(reinterpret_cast<char*>(buffer), i, size));
+ } else {
+ if (memchr(reinterpret_cast<char*>(buffer), i, size))
+ std::cerr
+ << "Character " << i
+ << " should not be class " << GetClassName(thisClass)
+ << ", but was in GetCharsOfClass"
+ << " it is reported to be "
+ << GetClassName(pcc->GetClass(i)) << std::endl;
+ REQUIRE_FALSE(memchr(reinterpret_cast<char*>(buffer), i, size));
+ }
+ }
+ delete []buffer;
+ }
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testContractionState.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testContractionState.cxx
new file mode 100644
index 00000000000..b7d220be531
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testContractionState.cxx
@@ -0,0 +1,140 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+
+#include "catch.hpp"
+
+// Test ContractionState.
+
+TEST_CASE("ContractionState") {
+
+ ContractionState cs;
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(1 == cs.LinesInDoc());
+ REQUIRE(1 == cs.LinesDisplayed());
+ REQUIRE(0 == cs.DisplayFromDoc(0));
+ REQUIRE(0 == cs.DocFromDisplay(0));
+ }
+
+ SECTION("OneLine") {
+ cs.InsertLine(0);
+ REQUIRE(2 == cs.LinesInDoc());
+ REQUIRE(2 == cs.LinesDisplayed());
+ REQUIRE(0 == cs.DisplayFromDoc(0));
+ REQUIRE(0 == cs.DocFromDisplay(0));
+ REQUIRE(1 == cs.DisplayFromDoc(1));
+ REQUIRE(1 == cs.DocFromDisplay(1));
+ }
+
+ SECTION("InsertionThenDeletions") {
+ cs.InsertLines(0,4);
+ cs.DeleteLine(1);
+
+ REQUIRE(4 == cs.LinesInDoc());
+ REQUIRE(4 == cs.LinesDisplayed());
+ for (int l=0;l<4;l++) {
+ REQUIRE(l == cs.DisplayFromDoc(l));
+ REQUIRE(l == cs.DocFromDisplay(l));
+ }
+
+ cs.DeleteLines(0,2);
+ REQUIRE(2 == cs.LinesInDoc());
+ REQUIRE(2 == cs.LinesDisplayed());
+ for (int l=0;l<2;l++) {
+ REQUIRE(l == cs.DisplayFromDoc(l));
+ REQUIRE(l == cs.DocFromDisplay(l));
+ }
+ }
+
+ SECTION("ShowHide") {
+ cs.InsertLines(0,4);
+ REQUIRE(true == cs.GetVisible(0));
+ REQUIRE(true == cs.GetVisible(1));
+ REQUIRE(true == cs.GetVisible(2));
+ REQUIRE(5 == cs.LinesDisplayed());
+
+ cs.SetVisible(1, 1, false);
+ REQUIRE(true == cs.GetVisible(0));
+ REQUIRE(0 == cs.GetVisible(1));
+ REQUIRE(true == cs.GetVisible(2));
+ REQUIRE(4 == cs.LinesDisplayed());
+ REQUIRE(1 == cs.HiddenLines());
+
+ cs.SetVisible(1, 2, true);
+ for (int l=0;l<4;l++) {
+ REQUIRE(true == cs.GetVisible(0));
+ }
+
+ cs.SetVisible(1, 1, false);
+ REQUIRE(0 == cs.GetVisible(1));
+ cs.ShowAll();
+ for (int l=0;l<4;l++) {
+ REQUIRE(true == cs.GetVisible(0));
+ }
+ REQUIRE(0 == cs.HiddenLines());
+ }
+
+ SECTION("Hidden") {
+ cs.InsertLines(0,1);
+ for (int l=0;l<2;l++) {
+ REQUIRE(true == cs.GetVisible(0));
+ }
+ REQUIRE(0 == cs.HiddenLines());
+
+ cs.SetVisible(1, 1, false);
+ REQUIRE(true == cs.GetVisible(0));
+ REQUIRE(0 == cs.GetVisible(1));
+ REQUIRE(1 == cs.HiddenLines());
+
+ cs.SetVisible(1, 1, true);
+ for (int l=0;l<2;l++) {
+ REQUIRE(true == cs.GetVisible(0));
+ }
+ REQUIRE(0 == cs.HiddenLines());
+ }
+
+ SECTION("Contracting") {
+ cs.InsertLines(0,4);
+ for (int l=0;l<4;l++) {
+ REQUIRE(true == cs.GetExpanded(l));
+ }
+
+ cs.SetExpanded(2, false);
+ REQUIRE(true == cs.GetExpanded(1));
+ REQUIRE(0 == cs.GetExpanded(2));
+ REQUIRE(true == cs.GetExpanded(3));
+
+ REQUIRE(2 == cs.ContractedNext(0));
+ REQUIRE(2 == cs.ContractedNext(1));
+ REQUIRE(2 == cs.ContractedNext(2));
+ REQUIRE(-1 == cs.ContractedNext(3));
+
+ cs.SetExpanded(2, true);
+ REQUIRE(true == cs.GetExpanded(1));
+ REQUIRE(true == cs.GetExpanded(2));
+ REQUIRE(true == cs.GetExpanded(3));
+ }
+
+ SECTION("ChangeHeight") {
+ cs.InsertLines(0,4);
+ for (int l=0;l<4;l++) {
+ REQUIRE(1 == cs.GetHeight(l));
+ }
+
+ cs.SetHeight(1, 2);
+ REQUIRE(1 == cs.GetHeight(0));
+ REQUIRE(2 == cs.GetHeight(1));
+ REQUIRE(1 == cs.GetHeight(2));
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testDecoration.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testDecoration.cxx
new file mode 100644
index 00000000000..86eb9ec393b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testDecoration.cxx
@@ -0,0 +1,89 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <stdexcept>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "Decoration.h"
+
+#include "catch.hpp"
+
+const int indicator=4;
+
+// Test Decoration.
+
+TEST_CASE("Decoration") {
+
+ Decoration deco(indicator);
+
+ SECTION("HasCorrectIndicator") {
+ REQUIRE(indicator == deco.indicator);
+ }
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0 == deco.rs.Length());
+ REQUIRE(1 == deco.rs.Runs());
+ REQUIRE(deco.Empty());
+ }
+
+ SECTION("SimpleSpace") {
+ deco.rs.InsertSpace(0, 1);
+ REQUIRE(deco.Empty());
+ }
+
+ SECTION("SimpleRun") {
+ deco.rs.InsertSpace(0, 1);
+ deco.rs.SetValueAt(0, 2);
+ REQUIRE(!deco.Empty());
+ }
+}
+
+// Test DecorationList.
+
+TEST_CASE("DecorationList") {
+
+ DecorationList decol;
+
+ SECTION("HasCorrectIndicator") {
+ decol.SetCurrentIndicator(indicator);
+ REQUIRE(indicator == decol.GetCurrentIndicator());
+ }
+
+ SECTION("HasCorrectCurrentValue") {
+ const int value = 55;
+ decol.SetCurrentValue(value);
+ REQUIRE(value == decol.GetCurrentValue());
+ }
+
+ SECTION("ExpandSetValues") {
+ decol.SetCurrentIndicator(indicator);
+ decol.InsertSpace(0, 9);
+ const int value = 59;
+ int position = 4;
+ int fillLength = 3;
+ bool changed = decol.FillRange(position, value, fillLength);
+ REQUIRE(changed);
+ REQUIRE(position == 4);
+ REQUIRE(fillLength == 3);
+ REQUIRE(fillLength == 3);
+ REQUIRE(decol.ValueAt(indicator, 5) == value);
+ REQUIRE(decol.AllOnFor(5) == (1 << indicator));
+ REQUIRE(decol.Start(indicator, 5) == 4);
+ REQUIRE(decol.End(indicator, 5) == 7);
+ const int indicatorB=6;
+ decol.SetCurrentIndicator(indicatorB);
+ changed = decol.FillRange(position, value, fillLength);
+ REQUIRE(changed);
+ REQUIRE(decol.AllOnFor(5) == ((1 << indicator) | (1 << indicatorB)));
+ decol.DeleteRange(5, 1);
+ REQUIRE(decol.Start(indicatorB, 5) == 4);
+ REQUIRE(decol.End(indicatorB, 5) == 6);
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testPartitioning.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testPartitioning.cxx
new file mode 100644
index 00000000000..f86dcf4db7f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testPartitioning.cxx
@@ -0,0 +1,182 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+
+#include "catch.hpp"
+
+const int growSize = 4;
+
+const int lengthTestArray = 8;
+static const int testArray[lengthTestArray] = {3, 4, 5, 6, 7, 8, 9, 10};
+
+// Test SplitVectorWithRangeAdd.
+
+TEST_CASE("SplitVectorWithRangeAdd") {
+
+ SplitVectorWithRangeAdd svwra(growSize);
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0 == svwra.Length());
+ }
+
+ SECTION("IncrementExceptEnds") {
+ svwra.InsertFromArray(0, testArray, 0, lengthTestArray);
+ svwra.RangeAddDelta(1, lengthTestArray-1, 1);
+ for (int i=0; i<svwra.Length(); i++) {
+ if ((i == 0) || (i == lengthTestArray-1))
+ REQUIRE((i+3) == svwra.ValueAt(i));
+ else
+ REQUIRE((i+4) == svwra.ValueAt(i));
+ }
+ }
+
+}
+
+// Test Partitioning.
+
+TEST_CASE("Partitioning") {
+
+ Partitioning part(growSize);
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(1 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(part.Partitions()));
+ REQUIRE(0 == part.PartitionFromPosition(0));
+ }
+
+ SECTION("SimpleInsert") {
+ part.InsertText(0, 1);
+ REQUIRE(1 == part.Partitions());
+ REQUIRE(1 == part.PositionFromPartition(part.Partitions()));
+ }
+
+ SECTION("TwoPartitions") {
+ part.InsertText(0, 2);
+ part.InsertPartition(1, 1);
+ REQUIRE(2 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(1 == part.PositionFromPartition(1));
+ REQUIRE(2 == part.PositionFromPartition(2));
+ }
+
+ SECTION("MoveStart") {
+ part.InsertText(0, 3);
+ part.InsertPartition(1, 2);
+ part.SetPartitionStartPosition(1,1);
+ REQUIRE(2 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(1 == part.PositionFromPartition(1));
+ REQUIRE(3 == part.PositionFromPartition(2));
+ }
+
+ SECTION("InsertAgain") {
+ part.InsertText(0, 3);
+ part.InsertPartition(1, 2);
+ part.InsertText(0,3);
+ part.InsertText(1,2);
+ REQUIRE(2 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(5 == part.PositionFromPartition(1));
+ REQUIRE(8 == part.PositionFromPartition(2));
+ }
+
+ SECTION("InsertReversed") {
+ part.InsertText(0, 3);
+ part.InsertPartition(1, 2);
+ part.InsertText(1,2);
+ part.InsertText(0,3);
+ REQUIRE(2 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(5 == part.PositionFromPartition(1));
+ REQUIRE(8 == part.PositionFromPartition(2));
+ }
+
+ SECTION("InverseSearch") {
+ part.InsertText(0, 3);
+ part.InsertPartition(1, 2);
+ part.SetPartitionStartPosition(1,1);
+
+ REQUIRE(2 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(1 == part.PositionFromPartition(1));
+ REQUIRE(3 == part.PositionFromPartition(2));
+
+ REQUIRE(0 == part.PartitionFromPosition(0));
+ REQUIRE(1 == part.PartitionFromPosition(1));
+ REQUIRE(1 == part.PartitionFromPosition(2));
+
+ REQUIRE(1 == part.PartitionFromPosition(3));
+ }
+
+ SECTION("DeletePartition") {
+ part.InsertText(0, 2);
+ part.InsertPartition(1, 1);
+ part.RemovePartition(1);
+ REQUIRE(1 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(2 == part.PositionFromPartition(1));
+ }
+
+ SECTION("DeleteAll") {
+ part.InsertText(0, 3);
+ part.InsertPartition(1, 2);
+ part.SetPartitionStartPosition(1,1);
+ part.DeleteAll();
+ // Back to initial state
+ REQUIRE(1 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(part.Partitions()));
+ }
+
+ SECTION("TestBackwards") {
+ part.InsertText(0, 10);
+ part.InsertPartition(1, 3);
+ part.InsertPartition(2, 6);
+ part.InsertPartition(3, 9);
+ part.InsertText(2,4);
+ part.InsertText(1,2);
+ part.InsertText(0,3);
+ REQUIRE(4 == part.Partitions());
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(6 == part.PositionFromPartition(1));
+ REQUIRE(11 == part.PositionFromPartition(2));
+ REQUIRE(18 == part.PositionFromPartition(3));
+ REQUIRE(19 == part.PositionFromPartition(4));
+ }
+
+ SECTION("TestMany") {
+ // Provoke backstep call
+ part.InsertText(0, 42);
+ for (int i=0; i<20; i++) {
+ part.InsertPartition(i+1, (i+1) * 2);
+ }
+ for (int i=20; i>0; i--) {
+ part.InsertText(i,2);
+ }
+ REQUIRE(21 == part.Partitions());
+ for (int i=1; i<20; i++) {
+ REQUIRE((i*4 - 2) == part.PositionFromPartition(i));
+ REQUIRE(i == part.PartitionFromPosition(i*4 - 2));
+ }
+ part.InsertText(19,2);
+ REQUIRE(3 == part.PartitionFromPosition(10));
+ part.InsertText(0,2);
+ part.InsertText(0,-2);
+ part.RemovePartition(1);
+ REQUIRE(0 == part.PositionFromPartition(0));
+ REQUIRE(6 == part.PositionFromPartition(1));
+ REQUIRE(10 == part.PositionFromPartition(2));
+ part.RemovePartition(10);
+ REQUIRE(46 == part.PositionFromPartition(10));
+ REQUIRE(10 == part.PartitionFromPosition(46));
+ REQUIRE(50 == part.PositionFromPartition(11));
+ REQUIRE(11 == part.PartitionFromPosition(50));
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testRunStyles.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testRunStyles.cxx
new file mode 100644
index 00000000000..d7843459601
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testRunStyles.cxx
@@ -0,0 +1,321 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <stdexcept>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+
+#include "catch.hpp"
+
+// Test RunStyles.
+
+TEST_CASE("RunStyles") {
+
+ RunStyles rs;
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ }
+
+ SECTION("SimpleInsert") {
+ rs.InsertSpace(0, 1);
+ REQUIRE(1 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ REQUIRE(0 == rs.ValueAt(0));
+ REQUIRE(1 == rs.FindNextChange(0, rs.Length()));
+ REQUIRE(2 == rs.FindNextChange(1, rs.Length()));
+ }
+
+ SECTION("TwoRuns") {
+ rs.InsertSpace(0, 2);
+ REQUIRE(2 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ rs.SetValueAt(0, 2);
+ REQUIRE(2 == rs.Runs());
+ REQUIRE(2 == rs.ValueAt(0));
+ REQUIRE(0 == rs.ValueAt(1));
+ REQUIRE(1 == rs.FindNextChange(0, rs.Length()));
+ REQUIRE(2 == rs.FindNextChange(1, rs.Length()));
+ REQUIRE(3 == rs.FindNextChange(2, rs.Length()));
+ }
+
+ SECTION("LongerRuns") {
+ rs.InsertSpace(0, 5);
+ rs.SetValueAt(0, 3);
+ rs.SetValueAt(1, 3);
+ REQUIRE(3 == rs.ValueAt(0));
+ REQUIRE(3 == rs.ValueAt(1));
+ REQUIRE(0 == rs.ValueAt(2));
+ REQUIRE(2 == rs.Runs());
+
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(2 == rs.EndRun(0));
+
+ REQUIRE(0 == rs.StartRun(1));
+ REQUIRE(2 == rs.EndRun(1));
+
+ REQUIRE(2 == rs.StartRun(2));
+ REQUIRE(5 == rs.EndRun(2));
+
+ REQUIRE(2 == rs.StartRun(3));
+ REQUIRE(5 == rs.EndRun(3));
+
+ REQUIRE(2 == rs.StartRun(4));
+ REQUIRE(5 == rs.EndRun(4));
+
+ // At end
+ REQUIRE(2 == rs.StartRun(5));
+ REQUIRE(5 == rs.EndRun(5));
+
+ // After end is same as end
+ REQUIRE(2 == rs.StartRun(6));
+ REQUIRE(5 == rs.EndRun(6));
+
+ REQUIRE(2 == rs.FindNextChange(0, rs.Length()));
+ REQUIRE(5 == rs.FindNextChange(2, rs.Length()));
+ REQUIRE(6 == rs.FindNextChange(5, rs.Length()));
+ }
+
+ SECTION("FillRange") {
+ rs.InsertSpace(0, 5);
+ int startFill = 1;
+ int lengthFill = 3;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(1 == startFill);
+ REQUIRE(3 == lengthFill);
+
+ REQUIRE(0 == rs.ValueAt(0));
+ REQUIRE(99 == rs.ValueAt(1));
+ REQUIRE(99 == rs.ValueAt(2));
+ REQUIRE(99 == rs.ValueAt(3));
+ REQUIRE(0 == rs.ValueAt(4));
+
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(1 == rs.EndRun(0));
+
+ REQUIRE(1 == rs.StartRun(1));
+ REQUIRE(4 == rs.EndRun(1));
+ }
+
+ SECTION("FillRangeAlreadyFilled") {
+ rs.InsertSpace(0, 5);
+ int startFill = 1;
+ int lengthFill = 3;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(1 == startFill);
+ REQUIRE(3 == lengthFill);
+
+ int startFill2 = 2;
+ int lengthFill2 = 1;
+ // Compiler warnings if 'false' used instead of '0' as expected value:
+ REQUIRE(0 == rs.FillRange(startFill2, 99, lengthFill2));
+ REQUIRE(2 == startFill2);
+ REQUIRE(1 == lengthFill2);
+ REQUIRE(0 == rs.ValueAt(0));
+ REQUIRE(99 == rs.ValueAt(1));
+ REQUIRE(99 == rs.ValueAt(2));
+ REQUIRE(99 == rs.ValueAt(3));
+ REQUIRE(0 == rs.ValueAt(4));
+ REQUIRE(3 == rs.Runs());
+ }
+
+ SECTION("FillRangeAlreadyPartFilled") {
+ rs.InsertSpace(0, 5);
+ int startFill = 1;
+ int lengthFill = 2;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(1 == startFill);
+ REQUIRE(2 == lengthFill);
+
+ int startFill2 = 2;
+ int lengthFill2 = 2;
+ REQUIRE(true == rs.FillRange(startFill2, 99, lengthFill2));
+ REQUIRE(3 == startFill2);
+ REQUIRE(1 == lengthFill2);
+ REQUIRE(3 == rs.Runs());
+ }
+
+ SECTION("DeleteRange") {
+ rs.InsertSpace(0, 5);
+ rs.SetValueAt(0, 3);
+ REQUIRE(2 == rs.Runs());
+ rs.SetValueAt(1, 3);
+ REQUIRE(2 == rs.Runs());
+ rs.DeleteRange(1, 1);
+ REQUIRE(4 == rs.Length());
+ REQUIRE(2 == rs.Runs());
+ REQUIRE(3 == rs.ValueAt(0));
+ REQUIRE(0 == rs.ValueAt(1));
+
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(1 == rs.EndRun(0));
+
+ REQUIRE(1 == rs.StartRun(1));
+ REQUIRE(4 == rs.EndRun(1));
+
+ REQUIRE(1 == rs.StartRun(2));
+ REQUIRE(4 == rs.EndRun(2));
+ }
+
+ SECTION("Find") {
+ rs.InsertSpace(0, 5);
+ int startFill = 1;
+ int lengthFill = 3;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(1 == startFill);
+ REQUIRE(3 == lengthFill);
+
+ REQUIRE(0 == rs.Find(0,0));
+ REQUIRE(1 == rs.Find(99,0));
+ REQUIRE(-1 == rs.Find(3,0));
+
+ REQUIRE(4 == rs.Find(0,1));
+ REQUIRE(1 == rs.Find(99,1));
+ REQUIRE(-1 == rs.Find(3,1));
+
+ REQUIRE(4 == rs.Find(0,2));
+ REQUIRE(2 == rs.Find(99,2));
+ REQUIRE(-1 == rs.Find(3, 2));
+
+ REQUIRE(4 == rs.Find(0,4));
+ REQUIRE(-1 == rs.Find(99,4));
+ REQUIRE(-1 == rs.Find(3,4));
+
+ REQUIRE(-1 == rs.Find(0,5));
+ REQUIRE(-1 == rs.Find(99,5));
+ REQUIRE(-1 == rs.Find(3,5));
+
+ REQUIRE(-1 == rs.Find(0,6));
+ REQUIRE(-1 == rs.Find(99,6));
+ REQUIRE(-1 == rs.Find(3,6));
+ }
+
+ SECTION("AllSame") {
+ REQUIRE(true == rs.AllSame());
+ rs.InsertSpace(0, 5);
+ REQUIRE(true == rs.AllSame());
+ REQUIRE(0 == rs.AllSameAs(88));
+ REQUIRE(true == rs.AllSameAs(0));
+ int startFill = 1;
+ int lengthFill = 3;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(0 == rs.AllSame());
+ REQUIRE(0 == rs.AllSameAs(88));
+ REQUIRE(0 == rs.AllSameAs(0));
+ REQUIRE(true == rs.FillRange(startFill, 0, lengthFill));
+ REQUIRE(true == rs.AllSame());
+ REQUIRE(0 == rs.AllSameAs(88));
+ REQUIRE(true == rs.AllSameAs(0));
+ }
+
+ SECTION("FindWithReversion") {
+ rs.InsertSpace(0, 5);
+ REQUIRE(1 == rs.Runs());
+
+ int startFill = 1;
+ int lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(1 == startFill);
+ REQUIRE(1 == lengthFill);
+ REQUIRE(3 == rs.Runs());
+
+ startFill = 2;
+ lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(2 == startFill);
+ REQUIRE(1 == lengthFill);
+ REQUIRE(3 == rs.Runs());
+
+ startFill = 1;
+ lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 0, lengthFill));
+ REQUIRE(3 == rs.Runs());
+ REQUIRE(1 == lengthFill);
+
+ startFill = 2;
+ lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 0, lengthFill));
+ REQUIRE(1 == rs.Runs());
+ REQUIRE(1 == lengthFill);
+
+ REQUIRE(-1 == rs.Find(0,6));
+ }
+
+ SECTION("FinalRunInversion") {
+ REQUIRE(1 == rs.Runs());
+ rs.InsertSpace(0, 1);
+ REQUIRE(1 == rs.Runs());
+ rs.SetValueAt(0, 1);
+ REQUIRE(1 == rs.Runs());
+ rs.InsertSpace(1, 1);
+ REQUIRE(1 == rs.Runs());
+ rs.SetValueAt(1, 1);
+ REQUIRE(1 == rs.Runs());
+ rs.SetValueAt(1, 0);
+ REQUIRE(2 == rs.Runs());
+ rs.SetValueAt(1, 1);
+ REQUIRE(1 == rs.Runs());
+ }
+
+ SECTION("DeleteAll") {
+ rs.InsertSpace(0, 5);
+ rs.SetValueAt(0, 3);
+ rs.SetValueAt(1, 3);
+ rs.DeleteAll();
+ REQUIRE(0 == rs.Length());
+ REQUIRE(0 == rs.ValueAt(0));
+ REQUIRE(1 == rs.Runs());
+ }
+
+ SECTION("DeleteSecond") {
+ rs.InsertSpace(0, 3);
+ int startFill = 1;
+ int lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(3 == rs.Length());
+ REQUIRE(3 == rs.Runs());
+ rs.DeleteRange(1, 1);
+ REQUIRE(2 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ }
+
+ SECTION("DeleteEndRun") {
+ rs.InsertSpace(0, 2);
+ int startFill = 1;
+ int lengthFill = 1;
+ REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
+ REQUIRE(2 == rs.Length());
+ REQUIRE(2 == rs.Runs());
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(1 == rs.EndRun(0));
+ REQUIRE(1 == rs.StartRun(1));
+ REQUIRE(2 == rs.EndRun(1));
+ rs.DeleteRange(1, 1);
+ REQUIRE(1 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(1 == rs.EndRun(0));
+ REQUIRE(0 == rs.StartRun(1));
+ REQUIRE(1 == rs.EndRun(1));
+ rs.Check();
+ }
+
+ SECTION("OutsideBounds") {
+ rs.InsertSpace(0, 1);
+ int startFill = 1;
+ int lengthFill = 1;
+ rs.FillRange(startFill, 99, lengthFill);
+ REQUIRE(1 == rs.Length());
+ REQUIRE(1 == rs.Runs());
+ REQUIRE(0 == rs.StartRun(0));
+ REQUIRE(1 == rs.EndRun(0));
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSparseState.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSparseState.cxx
new file mode 100644
index 00000000000..bcc7d5552e7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSparseState.cxx
@@ -0,0 +1,228 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string>
+#include <vector>
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SparseState.h"
+
+#include "catch.hpp"
+
+// Test SparseState.
+
+TEST_CASE("SparseState") {
+
+ SparseState<int> ss;
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0u == ss.size());
+ int val = ss.ValueAt(0);
+ REQUIRE(0 == val);
+ }
+
+ SECTION("SimpleSetAndGet") {
+ ss.Set(0, 22);
+ ss.Set(1, 23);
+ REQUIRE(2u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(22 == ss.ValueAt(0));
+ REQUIRE(23 == ss.ValueAt(1));
+ REQUIRE(23 == ss.ValueAt(2));
+ }
+
+ SECTION("RetrieveBetween") {
+ ss.Set(0, 10);
+ ss.Set(2, 12);
+ REQUIRE(2u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(10 == ss.ValueAt(0));
+ REQUIRE(10 == ss.ValueAt(1));
+ REQUIRE(12 == ss.ValueAt(2));
+ }
+
+ SECTION("RetrieveBefore") {
+ ss.Set(2, 12);
+ REQUIRE(1u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(0 == ss.ValueAt(0));
+ REQUIRE(0 == ss.ValueAt(1));
+ REQUIRE(12 == ss.ValueAt(2));
+ }
+
+ SECTION("Delete") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Delete(2);
+ REQUIRE(1u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(30 == ss.ValueAt(0));
+ REQUIRE(30 == ss.ValueAt(1));
+ REQUIRE(30 == ss.ValueAt(2));
+ }
+
+ SECTION("DeleteBetween") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Delete(1);
+ REQUIRE(1u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(30 == ss.ValueAt(0));
+ REQUIRE(30 == ss.ValueAt(1));
+ REQUIRE(30 == ss.ValueAt(2));
+ }
+
+ SECTION("ReplaceLast") {
+ ss.Set(0, 30);
+ ss.Set(2, 31);
+ ss.Set(2, 32);
+ REQUIRE(2u == ss.size());
+ REQUIRE(0 == ss.ValueAt(-1));
+ REQUIRE(30 == ss.ValueAt(0));
+ REQUIRE(30 == ss.ValueAt(1));
+ REQUIRE(32 == ss.ValueAt(2));
+ REQUIRE(32 == ss.ValueAt(3));
+ }
+
+ SECTION("OnlyChangeAppended") {
+ ss.Set(0, 30);
+ ss.Set(2, 31);
+ ss.Set(3, 31);
+ REQUIRE(2u == ss.size());
+ }
+
+ SECTION("MergeBetween") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+ REQUIRE(3u == ss.size());
+
+ SparseState<int> ssAdditions(3);
+ ssAdditions.Set(4, 34);
+ REQUIRE(1u == ssAdditions.size());
+ bool mergeChanged = ss.Merge(ssAdditions,5);
+ REQUIRE(0 == mergeChanged);
+
+ ssAdditions.Set(4, 44);
+ REQUIRE(1u == ssAdditions.size());
+ mergeChanged = ss.Merge(ssAdditions,5);
+ REQUIRE(true == mergeChanged);
+ REQUIRE(3u == ss.size());
+ REQUIRE(44 == ss.ValueAt(4));
+ }
+
+ SECTION("MergeAtExisting") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+ REQUIRE(3u == ss.size());
+
+ SparseState<int> ssAdditions(4);
+ ssAdditions.Set(4, 34);
+ REQUIRE(1u == ssAdditions.size());
+ bool mergeChanged = ss.Merge(ssAdditions,5);
+ REQUIRE(0 == mergeChanged);
+
+ ssAdditions.Set(4, 44);
+ REQUIRE(1u == ssAdditions.size());
+ mergeChanged = ss.Merge(ssAdditions,5);
+ REQUIRE(true == mergeChanged);
+ REQUIRE(3u == ss.size());
+ REQUIRE(44 == ss.ValueAt(4));
+ }
+
+ SECTION("MergeWhichRemoves") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+ REQUIRE(3u == ss.size());
+
+ SparseState<int> ssAdditions(2);
+ ssAdditions.Set(2, 22);
+ REQUIRE(1u == ssAdditions.size());
+ REQUIRE(22 == ssAdditions.ValueAt(2));
+ bool mergeChanged = ss.Merge(ssAdditions,5);
+ REQUIRE(true == mergeChanged);
+ REQUIRE(2u == ss.size());
+ REQUIRE(22 == ss.ValueAt(2));
+ }
+
+ SECTION("MergeIgnoreSome") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+
+ SparseState<int> ssAdditions(2);
+ ssAdditions.Set(2, 32);
+ bool mergeChanged = ss.Merge(ssAdditions,3);
+
+ REQUIRE(0 == mergeChanged);
+ REQUIRE(2u == ss.size());
+ REQUIRE(32 == ss.ValueAt(2));
+ }
+
+ SECTION("MergeIgnoreSomeStart") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+
+ SparseState<int> ssAdditions(2);
+ ssAdditions.Set(2, 32);
+ bool mergeChanged = ss.Merge(ssAdditions,2);
+
+ REQUIRE(0 == mergeChanged);
+ REQUIRE(2u == ss.size());
+ REQUIRE(32 == ss.ValueAt(2));
+ }
+
+ SECTION("MergeIgnoreRepeat") {
+ ss.Set(0, 30);
+ ss.Set(2, 32);
+ ss.Set(4, 34);
+
+ SparseState<int> ssAdditions(5);
+ // Appending same value as at end of pss.
+ ssAdditions.Set(5, 34);
+ bool mergeChanged = ss.Merge(ssAdditions,6);
+
+ REQUIRE(0 == mergeChanged);
+ REQUIRE(3u == ss.size());
+ REQUIRE(34 == ss.ValueAt(4));
+ }
+
+}
+
+TEST_CASE("SparseStateString") {
+
+ SparseState<std::string> ss;
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0u == ss.size());
+ std::string val = ss.ValueAt(0);
+ REQUIRE("" == val);
+ }
+
+ SECTION("SimpleSetAndGet") {
+ REQUIRE(0u == ss.size());
+ ss.Set(0, "22");
+ ss.Set(1, "23");
+ REQUIRE(2u == ss.size());
+ REQUIRE("" == ss.ValueAt(-1));
+ REQUIRE("22" == ss.ValueAt(0));
+ REQUIRE("23" == ss.ValueAt(1));
+ REQUIRE("23" == ss.ValueAt(2));
+ }
+
+ SECTION("DeleteBetween") {
+ ss.Set(0, "30");
+ ss.Set(2, "32");
+ ss.Delete(1);
+ REQUIRE(1u == ss.size());
+ REQUIRE("" == ss.ValueAt(-1));
+ REQUIRE("30" == ss.ValueAt(0));
+ REQUIRE("30" == ss.ValueAt(1));
+ REQUIRE("30" == ss.ValueAt(2));
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSplitVector.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSplitVector.cxx
new file mode 100644
index 00000000000..8465a0fa78f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testSplitVector.cxx
@@ -0,0 +1,214 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "SplitVector.h"
+
+#include "catch.hpp"
+
+// Test SplitVector.
+
+const int lengthTestArray = 4;
+static const int testArray[4] = {3, 4, 5, 6};
+
+TEST_CASE("SplitVector") {
+
+ SplitVector<int> sv;
+
+ SECTION("IsEmptyInitially") {
+ REQUIRE(0 == sv.Length());
+ }
+
+ SECTION("InsertOne") {
+ sv.InsertValue(0, 10, 0);
+ sv.Insert(5, 3);
+ REQUIRE(11 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i == 5) ? 3 : 0) == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("Insertion") {
+ sv.InsertValue(0, 10, 0);
+ REQUIRE(10 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(0 == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("EnsureLength") {
+ sv.EnsureLength(4);
+ REQUIRE(4 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(0 == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("InsertFromArray") {
+ sv.InsertFromArray(0, testArray, 0, lengthTestArray);
+ REQUIRE(lengthTestArray == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE((i+3) == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("SetValue") {
+ sv.InsertValue(0, 10, 0);
+ sv.SetValueAt(5, 3);
+ REQUIRE(10 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i == 5) ? 3 : 0) == sv.ValueAt(i));
+ }
+ // Move the gap
+ sv.InsertValue(7, 1, 17);
+ REQUIRE(17 == sv.ValueAt(7));
+ REQUIRE(0 == sv.ValueAt(8));
+ // Set after the gap
+ sv.SetValueAt(8, 19);
+ REQUIRE(19 == sv.ValueAt(8));
+ }
+
+ SECTION("Indexing") {
+ sv.InsertValue(0, 10, 0);
+ sv.SetValueAt(5, 3);
+ REQUIRE(10 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i == 5) ? 3 : 0) == sv[i]);
+ }
+}
+
+ SECTION("Fill") {
+ sv.InsertValue(0, 10, 0);
+ REQUIRE(10 == sv.Length());
+ sv.InsertValue(7, 1, 1);
+ REQUIRE(11 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i == 7) ? 1 : 0) == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("DeleteOne") {
+ sv.InsertFromArray(0, testArray, 0, lengthTestArray);
+ sv.Delete(2);
+ REQUIRE((lengthTestArray-1) == sv.Length());
+ REQUIRE(3 == sv[0]);
+ REQUIRE(4 == sv[1]);
+ REQUIRE(6 == sv[2]);
+ }
+
+ SECTION("DeleteRange") {
+ sv.InsertValue(0, 10, 0);
+ REQUIRE(10 == sv.Length());
+ sv.InsertValue(7, 1, 1);
+ REQUIRE(11 == sv.Length());
+ sv.DeleteRange(2, 3);
+ REQUIRE(8 == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i == 4) ? 1 : 0) == sv.ValueAt(i));
+ }
+ }
+
+ SECTION("DeleteAll") {
+ sv.InsertValue(0, 10, 0);
+ sv.InsertValue(7, 1, 1);
+ sv.DeleteRange(2, 3);
+ sv.DeleteAll();
+ REQUIRE(0 == sv.Length());
+ }
+
+ SECTION("GetRange") {
+ sv.InsertValue(0, 10, 0);
+ sv.InsertValue(7, 1, 1);
+ int retrieveArray[11] = {0};
+ sv.GetRange(retrieveArray, 0, 11);
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(((i==7) ? 1 : 0) == retrieveArray[i]);
+ }
+ }
+
+ SECTION("GetRangeOverGap") {
+ sv.InsertFromArray(0, testArray, 0, lengthTestArray);
+ REQUIRE(lengthTestArray == sv.Length());
+ int retrieveArray[lengthTestArray] = {0};
+ sv.GetRange(retrieveArray, 0, lengthTestArray);
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE((i+3) == retrieveArray[i]);
+ }
+ }
+
+ SECTION("ReplaceUp") {
+ // Replace each element by inserting and then deleting the displaced element
+ // This should perform many moves
+ const int testLength=105;
+ sv.EnsureLength(testLength);
+ for (int i=0; i<testLength; i++)
+ sv.SetValueAt(i, i+2);
+ REQUIRE(testLength == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ sv.InsertValue(i, 1, i+9);
+ sv.Delete(i+1);
+ }
+ for (int i=0; i<sv.Length(); i++)
+ REQUIRE((i+9) == sv.ValueAt(i));
+ }
+
+ SECTION("ReplaceDown") {
+ // From the end, replace each element by inserting and then deleting the displaced element
+ // This should perform many moves
+ const int testLength=24;
+ sv.EnsureLength(testLength);
+ for (int i=0; i<testLength; i++)
+ sv.SetValueAt(i, i+12);
+ REQUIRE(testLength == sv.Length());
+ for (int i=sv.Length()-1; i>=0; i--) {
+ sv.InsertValue(i, 1, i+5);
+ sv.Delete(i+1);
+ }
+ for (int i=0; i<sv.Length(); i++)
+ REQUIRE((i+5) == sv.ValueAt(i));
+ }
+
+ SECTION("BufferPointer") {
+ sv.InsertFromArray(0, testArray, 0, lengthTestArray);
+ int *retrievePointer = sv.BufferPointer();
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE((i+3) == retrievePointer[i]);
+ }
+ }
+
+ SECTION("DeleteBackAndForth") {
+ sv.InsertValue(0, 10, 87);
+ for (int i=0; i<10; i+=2) {
+ int len = 10 - i;
+ REQUIRE(len == sv.Length());
+ for (int i=0; i<sv.Length(); i++) {
+ REQUIRE(87 == sv.ValueAt(i));
+ }
+ sv.Delete(len-1);
+ sv.Delete(0);
+ }
+ }
+
+ SECTION("GrowSize") {
+ sv.SetGrowSize(5);
+ REQUIRE(5 == sv.GetGrowSize());
+ }
+
+ SECTION("OutsideBounds") {
+ sv.InsertValue(0, 10, 87);
+ REQUIRE(0 == sv.ValueAt(-1));
+ REQUIRE(0 == sv.ValueAt(10));
+
+ /* Could be a death test as this asserts:
+ sv.SetValueAt(-1,98);
+ sv.SetValueAt(10,99);
+ REQUIRE(0 == sv.ValueAt(-1));
+ REQUIRE(0 == sv.ValueAt(10));
+ */
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/testUnicodeFromUTF8.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testUnicodeFromUTF8.cxx
new file mode 100644
index 00000000000..841a9c68c2d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/testUnicodeFromUTF8.cxx
@@ -0,0 +1,44 @@
+// Unit Tests for Scintilla internal data structures
+
+#include <string.h>
+
+#include <algorithm>
+
+#include "Platform.h"
+
+#include "UnicodeFromUTF8.h"
+
+#include "catch.hpp"
+
+// Test UnicodeFromUTF8.
+// Use examples from Wikipedia:
+// http://en.wikipedia.org/wiki/UTF-8
+
+TEST_CASE("UnicodeFromUTF8") {
+
+ SECTION("ASCII") {
+ const unsigned char s[]={'a', 0};
+ REQUIRE(UnicodeFromUTF8(s) == 'a');
+ }
+
+ SECTION("Example1") {
+ const unsigned char s[]={0x24, 0};
+ REQUIRE(UnicodeFromUTF8(s) == 0x24);
+ }
+
+ SECTION("Example2") {
+ const unsigned char s[]={0xC2, 0xA2, 0};
+ REQUIRE(UnicodeFromUTF8(s) == 0xA2);
+ }
+
+ SECTION("Example3") {
+ const unsigned char s[]={0xE2, 0x82, 0xAC, 0};
+ REQUIRE(UnicodeFromUTF8(s) == 0x20AC);
+ }
+
+ SECTION("Example4") {
+ const unsigned char s[]={0xF0, 0x90, 0x8D, 0x88, 0};
+ REQUIRE(UnicodeFromUTF8(s) == 0x10348);
+ }
+
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/unit/unitTest.cxx b/3rdparty/bgfx/3rdparty/scintilla/test/unit/unitTest.cxx
new file mode 100644
index 00000000000..a6feed20429
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/unit/unitTest.cxx
@@ -0,0 +1,58 @@
+// Unit Tests for Scintilla internal data structures
+
+/*
+ Currently tested:
+ SplitVector
+ Partitioning
+ RunStyles
+ ContractionState
+ CharClassify
+ Decoration
+ DecorationList
+ CellBuffer
+ UnicodeFromUTF8
+
+ To do:
+ PerLine *
+ Range
+ StyledText
+ CaseFolder ...
+ Document
+ RESearch
+ Selection
+ UniConversion
+ Style
+
+ lexlib:
+ Accessor
+ LexAccessor
+ CharacterSet
+ OptionSet
+ PropSetSimple
+ StyleContext
+ WordList
+*/
+
+#include <cstdio>
+#include <cstdarg>
+
+#include "Platform.h"
+
+#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
+#include "catch.hpp"
+
+// Needed for PLATFORM_ASSERT in code being tested
+
+void Platform::Assert(const char *c, const char *file, int line) {
+ fprintf(stderr, "Assertion [%s] failed at %s %d\n", c, file, line);
+ abort();
+}
+
+void Platform::DebugPrintf(const char *format, ...) {
+ char buffer[2000];
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsprintf(buffer, format, pArguments);
+ va_end(pArguments);
+ fprintf(stderr, "%s", buffer);
+}
diff --git a/3rdparty/bgfx/3rdparty/scintilla/test/xite.py b/3rdparty/bgfx/3rdparty/scintilla/test/xite.py
new file mode 100644
index 00000000000..399c7954442
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/test/xite.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+
+import XiteWin
+
+if __name__ == "__main__":
+ XiteWin.main("")
diff --git a/3rdparty/bgfx/3rdparty/scintilla/tgzsrc b/3rdparty/bgfx/3rdparty/scintilla/tgzsrc
new file mode 100644
index 00000000000..a4d4ee08430
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/tgzsrc
@@ -0,0 +1,4 @@
+cd ..
+rm -f scintilla.tgz
+tar --create --exclude \*.o --exclude \*.obj --exclude \*.dll --exclude \*.exe --exclude \*.a scintilla/* \
+ | gzip -c >scintilla.tgz
diff --git a/3rdparty/bgfx/3rdparty/scintilla/version.txt b/3rdparty/bgfx/3rdparty/scintilla/version.txt
new file mode 100644
index 00000000000..53d5a5ad65a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/version.txt
@@ -0,0 +1 @@
+356
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/CheckD2D.cxx b/3rdparty/bgfx/3rdparty/scintilla/win32/CheckD2D.cxx
new file mode 100644
index 00000000000..80f5d46d2dd
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/CheckD2D.cxx
@@ -0,0 +1,3 @@
+// This file is compiled to check whether Direct2D and DirectWrite headers are available.
+#include <d2d1.h>
+#include <dwrite.h>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.cxx b/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.cxx
new file mode 100644
index 00000000000..dbb755fb1dc
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.cxx
@@ -0,0 +1,129 @@
+// Scintilla source code edit control
+/** @file HanjaDic.cxx
+ ** Korean Hanja Dictionary
+ ** Convert between Korean Hanja and Hangul by COM interface.
+ **/
+// Copyright 2015 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <windows.h>
+
+#include "UniConversion.h"
+#include "HanjaDic.h"
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+namespace HanjaDict {
+
+interface IRadical;
+interface IHanja;
+interface IStrokes;
+
+typedef enum { HANJA_UNKNOWN = 0, HANJA_K0 = 1, HANJA_K1 = 2, HANJA_OTHER = 3 } HANJA_TYPE;
+
+interface IHanjaDic : IUnknown {
+ STDMETHOD(OpenMainDic)();
+ STDMETHOD(CloseMainDic)();
+ STDMETHOD(GetHanjaWords)(BSTR bstrHangul, SAFEARRAY* ppsaHanja, VARIANT_BOOL* pfFound);
+ STDMETHOD(GetHanjaChars)(unsigned short wchHangul, BSTR* pbstrHanjaChars, VARIANT_BOOL* pfFound);
+ STDMETHOD(HanjaToHangul)(BSTR bstrHanja, BSTR* pbstrHangul);
+ STDMETHOD(GetHanjaType)(unsigned short wchHanja, HANJA_TYPE* pHanjaType);
+ STDMETHOD(GetHanjaSense)(unsigned short wchHanja, BSTR* pbstrSense);
+ STDMETHOD(GetRadicalID)(short SeqNumOfRadical, short* pRadicalID, unsigned short* pwchRadical);
+ STDMETHOD(GetRadical)(short nRadicalID, IRadical** ppIRadical);
+ STDMETHOD(RadicalIDToHanja)(short nRadicalID, unsigned short* pwchRadical);
+ STDMETHOD(GetHanja)(unsigned short wchHanja, IHanja** ppIHanja);
+ STDMETHOD(GetStrokes)(short nStrokes, IStrokes** ppIStrokes);
+ STDMETHOD(OpenDefaultCustomDic)();
+ STDMETHOD(OpenCustomDic)(BSTR bstrPath, long* plUdr);
+ STDMETHOD(CloseDefaultCustomDic)();
+ STDMETHOD(CloseCustomDic)(long lUdr);
+ STDMETHOD(CloseAllCustomDics)();
+ STDMETHOD(GetDefaultCustomHanjaWords)(BSTR bstrHangul, SAFEARRAY** ppsaHanja, VARIANT_BOOL* pfFound);
+ STDMETHOD(GetCustomHanjaWords)(long lUdr, BSTR bstrHangul, SAFEARRAY** ppsaHanja, VARIANT_BOOL* pfFound);
+ STDMETHOD(PutDefaultCustomHanjaWord)(BSTR bstrHangul, BSTR bstrHanja);
+ STDMETHOD(PutCustomHanjaWord)(long lUdr, BSTR bstrHangul, BSTR bstrHanja);
+ STDMETHOD(MaxNumOfRadicals)(short* pVal);
+ STDMETHOD(MaxNumOfStrokes)(short* pVal);
+ STDMETHOD(DefaultCustomDic)(long* pVal);
+ STDMETHOD(DefaultCustomDic)(long pVal);
+ STDMETHOD(MaxHanjaType)(HANJA_TYPE* pHanjaType);
+ STDMETHOD(MaxHanjaType)(HANJA_TYPE pHanjaType);
+};
+
+extern "C" const GUID __declspec(selectany) IID_IHanjaDic =
+{ 0xad75f3ac, 0x18cd, 0x48c6, { 0xa2, 0x7d, 0xf1, 0xe9, 0xa7, 0xdc, 0xe4, 0x32 } };
+
+class HanjaDic {
+private:
+ HRESULT hr;
+ CLSID CLSID_HanjaDic;
+
+public:
+ IHanjaDic *HJinterface;
+
+ HanjaDic() : HJinterface(NULL) {
+ hr = CLSIDFromProgID(OLESTR("mshjdic.hanjadic"), &CLSID_HanjaDic);
+ if (SUCCEEDED(hr)) {
+ hr = CoCreateInstance(CLSID_HanjaDic, NULL,
+ CLSCTX_INPROC_SERVER, IID_IHanjaDic,
+ (LPVOID *)& HJinterface);
+ if (SUCCEEDED(hr)) {
+ hr = HJinterface->OpenMainDic();
+ }
+ }
+ }
+
+ ~HanjaDic() {
+ if (SUCCEEDED(hr)) {
+ hr = HJinterface->CloseMainDic();
+ HJinterface->Release();
+ }
+ }
+
+ bool HJdictAvailable() {
+ return SUCCEEDED(hr);
+ }
+
+ bool IsHanja(int hanja) {
+ HANJA_TYPE hanjaType;
+ hr = HJinterface->GetHanjaType(static_cast<unsigned short>(hanja), &hanjaType);
+ if (SUCCEEDED(hr)) {
+ return (hanjaType > 0);
+ }
+ return false;
+ }
+};
+
+int GetHangulOfHanja(wchar_t *inout) {
+ // Convert every hanja to hangul.
+ // Return the number of characters converted.
+ int changed = 0;
+ HanjaDic dict;
+ if (dict.HJdictAvailable()) {
+ const size_t len = wcslen(inout);
+ wchar_t conv[UTF8MaxBytes] = {0};
+ BSTR bstrHangul = SysAllocString(conv);
+ for (size_t i=0; i<len; i++) {
+ if (dict.IsHanja(static_cast<int>(inout[i]))) { // Pass hanja only!
+ conv[0] = inout[i];
+ BSTR bstrHanja = SysAllocString(conv);
+ HRESULT hr = dict.HJinterface->HanjaToHangul(bstrHanja, &bstrHangul);
+ if (SUCCEEDED(hr)) {
+ inout[i] = static_cast<wchar_t>(bstrHangul[0]);
+ changed += 1;
+ }
+ SysFreeString(bstrHanja);
+ }
+ }
+ SysFreeString(bstrHangul);
+ }
+ return changed;
+}
+
+}
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.h b/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.h
new file mode 100644
index 00000000000..d58735dca0e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/HanjaDic.h
@@ -0,0 +1,26 @@
+// Scintilla source code edit control
+/** @file HanjaDic.h
+ ** Korean Hanja Dictionary
+ ** Convert between Korean Hanja and Hangul by COM interface.
+ **/
+// Copyright 2015 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef HANJADIC_H
+#define HANJADIC_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+namespace HanjaDict {
+
+int GetHangulOfHanja(wchar_t *inout);
+
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.cxx b/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.cxx
new file mode 100644
index 00000000000..6ea35d388cf
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.cxx
@@ -0,0 +1,3306 @@
+// Scintilla source code edit control
+/** @file PlatWin.cxx
+ ** Implementation of platform facilities on Windows.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <time.h>
+#include <math.h>
+#include <ctype.h>
+#include <limits.h>
+
+#include <vector>
+#include <map>
+
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0500
+#undef WINVER
+#define WINVER 0x0500
+#include <windows.h>
+#include <commctrl.h>
+#include <richedit.h>
+#include <windowsx.h>
+
+#if defined(NTDDI_WIN7) && !defined(DISABLE_D2D)
+#define USE_D2D 1
+#endif
+
+#if defined(USE_D2D)
+#include <d2d1.h>
+#include <dwrite.h>
+#endif
+
+#include "Platform.h"
+#include "StringCopy.h"
+#include "XPM.h"
+#include "UniConversion.h"
+#include "FontQuality.h"
+
+#ifndef IDC_HAND
+#define IDC_HAND MAKEINTRESOURCE(32649)
+#endif
+
+#ifndef SPI_GETFONTSMOOTHINGCONTRAST
+#define SPI_GETFONTSMOOTHINGCONTRAST 0x200C
+#endif
+
+static void *PointerFromWindow(HWND hWnd) {
+ return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
+}
+
+static void SetWindowPointer(HWND hWnd, void *ptr) {
+ ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
+}
+
+extern UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage);
+
+// Declarations needed for functions dynamically loaded as not available on all Windows versions.
+typedef BOOL (WINAPI *AlphaBlendSig)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
+typedef HMONITOR (WINAPI *MonitorFromPointSig)(POINT, DWORD);
+typedef HMONITOR (WINAPI *MonitorFromRectSig)(LPCRECT, DWORD);
+typedef BOOL (WINAPI *GetMonitorInfoSig)(HMONITOR, LPMONITORINFO);
+
+static CRITICAL_SECTION crPlatformLock;
+static HINSTANCE hinstPlatformRes = 0;
+
+static HMODULE hDLLImage = 0;
+static AlphaBlendSig AlphaBlendFn = 0;
+
+static HMODULE hDLLUser32 = 0;
+static HMONITOR (WINAPI *MonitorFromPointFn)(POINT, DWORD) = 0;
+static HMONITOR (WINAPI *MonitorFromRectFn)(LPCRECT, DWORD) = 0;
+static BOOL (WINAPI *GetMonitorInfoFn)(HMONITOR, LPMONITORINFO) = 0;
+
+static HCURSOR reverseArrowCursor = NULL;
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+Point Point::FromLong(long lpoint) {
+ return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint)));
+}
+
+static RECT RectFromPRectangle(PRectangle prc) {
+ RECT rc = {static_cast<LONG>(prc.left), static_cast<LONG>(prc.top),
+ static_cast<LONG>(prc.right), static_cast<LONG>(prc.bottom)};
+ return rc;
+}
+
+#if defined(USE_D2D)
+IDWriteFactory *pIDWriteFactory = 0;
+ID2D1Factory *pD2DFactory = 0;
+IDWriteRenderingParams *defaultRenderingParams = 0;
+IDWriteRenderingParams *customClearTypeRenderingParams = 0;
+
+static HMODULE hDLLD2D = NULL;
+static HMODULE hDLLDWrite = NULL;
+
+bool LoadD2D() {
+ static bool triedLoadingD2D = false;
+ if (!triedLoadingD2D) {
+ typedef HRESULT (WINAPI *D2D1CFSig)(D2D1_FACTORY_TYPE factoryType, REFIID riid,
+ CONST D2D1_FACTORY_OPTIONS *pFactoryOptions, IUnknown **factory);
+ typedef HRESULT (WINAPI *DWriteCFSig)(DWRITE_FACTORY_TYPE factoryType, REFIID iid,
+ IUnknown **factory);
+
+ hDLLD2D = ::LoadLibraryEx(TEXT("D2D1.DLL"), 0, 0x00000800 /*LOAD_LIBRARY_SEARCH_SYSTEM32*/);
+ if (hDLLD2D) {
+ D2D1CFSig fnD2DCF = (D2D1CFSig)::GetProcAddress(hDLLD2D, "D2D1CreateFactory");
+ if (fnD2DCF) {
+ // A single threaded factory as Scintilla always draw on the GUI thread
+ fnD2DCF(D2D1_FACTORY_TYPE_SINGLE_THREADED,
+ __uuidof(ID2D1Factory),
+ 0,
+ reinterpret_cast<IUnknown**>(&pD2DFactory));
+ }
+ }
+ hDLLDWrite = ::LoadLibraryEx(TEXT("DWRITE.DLL"), 0, 0x00000800 /*LOAD_LIBRARY_SEARCH_SYSTEM32*/);
+ if (hDLLDWrite) {
+ DWriteCFSig fnDWCF = (DWriteCFSig)::GetProcAddress(hDLLDWrite, "DWriteCreateFactory");
+ if (fnDWCF) {
+ fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown**>(&pIDWriteFactory));
+ }
+ }
+
+ if (pIDWriteFactory) {
+ HRESULT hr = pIDWriteFactory->CreateRenderingParams(&defaultRenderingParams);
+ if (SUCCEEDED(hr)) {
+ unsigned int clearTypeContrast;
+ if (::SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &clearTypeContrast, 0)) {
+
+ FLOAT gamma;
+ if (clearTypeContrast >= 1000 && clearTypeContrast <= 2200)
+ gamma = static_cast<FLOAT>(clearTypeContrast) / 1000.0f;
+ else
+ gamma = defaultRenderingParams->GetGamma();
+
+ pIDWriteFactory->CreateCustomRenderingParams(gamma, defaultRenderingParams->GetEnhancedContrast(), defaultRenderingParams->GetClearTypeLevel(),
+ defaultRenderingParams->GetPixelGeometry(), defaultRenderingParams->GetRenderingMode(), &customClearTypeRenderingParams);
+ }
+ }
+ }
+
+ }
+ triedLoadingD2D = true;
+ return pIDWriteFactory && pD2DFactory;
+}
+#endif
+
+struct FormatAndMetrics {
+ int technology;
+ HFONT hfont;
+#if defined(USE_D2D)
+ IDWriteTextFormat *pTextFormat;
+#endif
+ int extraFontFlag;
+ int characterSet;
+ FLOAT yAscent;
+ FLOAT yDescent;
+ FLOAT yInternalLeading;
+ FormatAndMetrics(HFONT hfont_, int extraFontFlag_, int characterSet_) :
+ technology(SCWIN_TECH_GDI), hfont(hfont_),
+#if defined(USE_D2D)
+ pTextFormat(0),
+#endif
+ extraFontFlag(extraFontFlag_), characterSet(characterSet_), yAscent(2), yDescent(1), yInternalLeading(0) {
+ }
+#if defined(USE_D2D)
+ FormatAndMetrics(IDWriteTextFormat *pTextFormat_,
+ int extraFontFlag_,
+ int characterSet_,
+ FLOAT yAscent_,
+ FLOAT yDescent_,
+ FLOAT yInternalLeading_) :
+ technology(SCWIN_TECH_DIRECTWRITE),
+ hfont(0),
+ pTextFormat(pTextFormat_),
+ extraFontFlag(extraFontFlag_),
+ characterSet(characterSet_),
+ yAscent(yAscent_),
+ yDescent(yDescent_),
+ yInternalLeading(yInternalLeading_) {
+ }
+#endif
+ ~FormatAndMetrics() {
+ if (hfont)
+ ::DeleteObject(hfont);
+#if defined(USE_D2D)
+ if (pTextFormat)
+ pTextFormat->Release();
+ pTextFormat = 0;
+#endif
+ extraFontFlag = 0;
+ characterSet = 0;
+ yAscent = 2;
+ yDescent = 1;
+ yInternalLeading = 0;
+ }
+ HFONT HFont();
+};
+
+HFONT FormatAndMetrics::HFont() {
+ LOGFONTW lf = {};
+#if defined(USE_D2D)
+ if (technology == SCWIN_TECH_GDI) {
+ if (0 == ::GetObjectW(hfont, sizeof(lf), &lf)) {
+ return 0;
+ }
+ } else {
+ HRESULT hr = pTextFormat->GetFontFamilyName(lf.lfFaceName, LF_FACESIZE);
+ if (!SUCCEEDED(hr)) {
+ return 0;
+ }
+ lf.lfWeight = pTextFormat->GetFontWeight();
+ lf.lfItalic = pTextFormat->GetFontStyle() == DWRITE_FONT_STYLE_ITALIC;
+ lf.lfHeight = -static_cast<int>(pTextFormat->GetFontSize());
+ }
+#else
+ if (0 == ::GetObjectW(hfont, sizeof(lf), &lf)) {
+ return 0;
+ }
+#endif
+ return ::CreateFontIndirectW(&lf);
+}
+
+#ifndef CLEARTYPE_QUALITY
+#define CLEARTYPE_QUALITY 5
+#endif
+
+static BYTE Win32MapFontQuality(int extraFontFlag) {
+ switch (extraFontFlag & SC_EFF_QUALITY_MASK) {
+
+ case SC_EFF_QUALITY_NON_ANTIALIASED:
+ return NONANTIALIASED_QUALITY;
+
+ case SC_EFF_QUALITY_ANTIALIASED:
+ return ANTIALIASED_QUALITY;
+
+ case SC_EFF_QUALITY_LCD_OPTIMIZED:
+ return CLEARTYPE_QUALITY;
+
+ default:
+ return SC_EFF_QUALITY_DEFAULT;
+ }
+}
+
+#if defined(USE_D2D)
+static D2D1_TEXT_ANTIALIAS_MODE DWriteMapFontQuality(int extraFontFlag) {
+ switch (extraFontFlag & SC_EFF_QUALITY_MASK) {
+
+ case SC_EFF_QUALITY_NON_ANTIALIASED:
+ return D2D1_TEXT_ANTIALIAS_MODE_ALIASED;
+
+ case SC_EFF_QUALITY_ANTIALIASED:
+ return D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE;
+
+ case SC_EFF_QUALITY_LCD_OPTIMIZED:
+ return D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE;
+
+ default:
+ return D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
+ }
+}
+#endif
+
+static void SetLogFont(LOGFONTW &lf, const char *faceName, int characterSet, float size, int weight, bool italic, int extraFontFlag) {
+ lf = LOGFONTW();
+ // The negative is to allow for leading
+ lf.lfHeight = -(abs(static_cast<int>(size + 0.5)));
+ lf.lfWeight = weight;
+ lf.lfItalic = static_cast<BYTE>(italic ? 1 : 0);
+ lf.lfCharSet = static_cast<BYTE>(characterSet);
+ lf.lfQuality = Win32MapFontQuality(extraFontFlag);
+ UTF16FromUTF8(faceName, strlen(faceName)+1, lf.lfFaceName, LF_FACESIZE);
+}
+
+/**
+ * Create a hash from the parameters for a font to allow easy checking for identity.
+ * If one font is the same as another, its hash will be the same, but if the hash is the
+ * same then they may still be different.
+ */
+static int HashFont(const FontParameters &fp) {
+ return
+ static_cast<int>(fp.size) ^
+ (fp.characterSet << 10) ^
+ ((fp.extraFontFlag & SC_EFF_QUALITY_MASK) << 9) ^
+ ((fp.weight/100) << 12) ^
+ (fp.italic ? 0x20000000 : 0) ^
+ (fp.technology << 15) ^
+ fp.faceName[0];
+}
+
+class FontCached : Font {
+ FontCached *next;
+ int usage;
+ float size;
+ LOGFONTW lf;
+ int technology;
+ int hash;
+ explicit FontCached(const FontParameters &fp);
+ ~FontCached() {}
+ bool SameAs(const FontParameters &fp);
+ virtual void Release();
+
+ static FontCached *first;
+public:
+ static FontID FindOrCreate(const FontParameters &fp);
+ static void ReleaseId(FontID fid_);
+};
+
+FontCached *FontCached::first = 0;
+
+FontCached::FontCached(const FontParameters &fp) :
+ next(0), usage(0), size(1.0), hash(0) {
+ SetLogFont(lf, fp.faceName, fp.characterSet, fp.size, fp.weight, fp.italic, fp.extraFontFlag);
+ technology = fp.technology;
+ hash = HashFont(fp);
+ fid = 0;
+ if (technology == SCWIN_TECH_GDI) {
+ HFONT hfont = ::CreateFontIndirectW(&lf);
+ fid = reinterpret_cast<void *>(new FormatAndMetrics(hfont, fp.extraFontFlag, fp.characterSet));
+ } else {
+#if defined(USE_D2D)
+ IDWriteTextFormat *pTextFormat;
+ const int faceSize = 200;
+ WCHAR wszFace[faceSize];
+ UTF16FromUTF8(fp.faceName, strlen(fp.faceName)+1, wszFace, faceSize);
+ FLOAT fHeight = fp.size;
+ DWRITE_FONT_STYLE style = fp.italic ? DWRITE_FONT_STYLE_ITALIC : DWRITE_FONT_STYLE_NORMAL;
+ HRESULT hr = pIDWriteFactory->CreateTextFormat(wszFace, NULL,
+ static_cast<DWRITE_FONT_WEIGHT>(fp.weight),
+ style,
+ DWRITE_FONT_STRETCH_NORMAL, fHeight, L"en-us", &pTextFormat);
+ if (SUCCEEDED(hr)) {
+ pTextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+
+ const int maxLines = 2;
+ DWRITE_LINE_METRICS lineMetrics[maxLines];
+ UINT32 lineCount = 0;
+ FLOAT yAscent = 1.0f;
+ FLOAT yDescent = 1.0f;
+ FLOAT yInternalLeading = 0.0f;
+ IDWriteTextLayout *pTextLayout = 0;
+ hr = pIDWriteFactory->CreateTextLayout(L"X", 1, pTextFormat,
+ 100.0f, 100.0f, &pTextLayout);
+ if (SUCCEEDED(hr)) {
+ hr = pTextLayout->GetLineMetrics(lineMetrics, maxLines, &lineCount);
+ if (SUCCEEDED(hr)) {
+ yAscent = lineMetrics[0].baseline;
+ yDescent = lineMetrics[0].height - lineMetrics[0].baseline;
+
+ FLOAT emHeight;
+ hr = pTextLayout->GetFontSize(0, &emHeight);
+ if (SUCCEEDED(hr)) {
+ yInternalLeading = lineMetrics[0].height - emHeight;
+ }
+ }
+ pTextLayout->Release();
+ pTextFormat->SetLineSpacing(DWRITE_LINE_SPACING_METHOD_UNIFORM, lineMetrics[0].height, lineMetrics[0].baseline);
+ }
+ fid = reinterpret_cast<void *>(new FormatAndMetrics(pTextFormat, fp.extraFontFlag, fp.characterSet, yAscent, yDescent, yInternalLeading));
+ }
+#endif
+ }
+ usage = 1;
+}
+
+bool FontCached::SameAs(const FontParameters &fp) {
+ if (
+ (size == fp.size) &&
+ (lf.lfWeight == fp.weight) &&
+ (lf.lfItalic == static_cast<BYTE>(fp.italic ? 1 : 0)) &&
+ (lf.lfCharSet == fp.characterSet) &&
+ (lf.lfQuality == Win32MapFontQuality(fp.extraFontFlag)) &&
+ (technology == fp.technology)) {
+ wchar_t wszFace[LF_FACESIZE];
+ UTF16FromUTF8(fp.faceName, strlen(fp.faceName)+1, wszFace, LF_FACESIZE);
+ return 0 == wcscmp(lf.lfFaceName,wszFace);
+ }
+ return false;
+}
+
+void FontCached::Release() {
+ delete reinterpret_cast<FormatAndMetrics *>(fid);
+ fid = 0;
+}
+
+FontID FontCached::FindOrCreate(const FontParameters &fp) {
+ FontID ret = 0;
+ ::EnterCriticalSection(&crPlatformLock);
+ int hashFind = HashFont(fp);
+ for (FontCached *cur=first; cur; cur=cur->next) {
+ if ((cur->hash == hashFind) &&
+ cur->SameAs(fp)) {
+ cur->usage++;
+ ret = cur->fid;
+ }
+ }
+ if (ret == 0) {
+ FontCached *fc = new FontCached(fp);
+ fc->next = first;
+ first = fc;
+ ret = fc->fid;
+ }
+ ::LeaveCriticalSection(&crPlatformLock);
+ return ret;
+}
+
+void FontCached::ReleaseId(FontID fid_) {
+ ::EnterCriticalSection(&crPlatformLock);
+ FontCached **pcur=&first;
+ for (FontCached *cur=first; cur; cur=cur->next) {
+ if (cur->fid == fid_) {
+ cur->usage--;
+ if (cur->usage == 0) {
+ *pcur = cur->next;
+ cur->Release();
+ cur->next = 0;
+ delete cur;
+ }
+ break;
+ }
+ pcur=&cur->next;
+ }
+ ::LeaveCriticalSection(&crPlatformLock);
+}
+
+Font::Font() {
+ fid = 0;
+}
+
+Font::~Font() {
+}
+
+#define FONTS_CACHED
+
+void Font::Create(const FontParameters &fp) {
+ Release();
+ if (fp.faceName)
+ fid = FontCached::FindOrCreate(fp);
+}
+
+void Font::Release() {
+ if (fid)
+ FontCached::ReleaseId(fid);
+ fid = 0;
+}
+
+// Buffer to hold strings and string position arrays without always allocating on heap.
+// May sometimes have string too long to allocate on stack. So use a fixed stack-allocated buffer
+// when less than safe size otherwise allocate on heap and free automatically.
+template<typename T, int lengthStandard>
+class VarBuffer {
+ T bufferStandard[lengthStandard];
+ // Private so VarBuffer objects can not be copied
+ VarBuffer(const VarBuffer &);
+ VarBuffer &operator=(const VarBuffer &);
+public:
+ T *buffer;
+ explicit VarBuffer(size_t length) : buffer(0) {
+ if (length > lengthStandard) {
+ buffer = new T[length];
+ } else {
+ buffer = bufferStandard;
+ }
+ }
+ ~VarBuffer() {
+ if (buffer != bufferStandard) {
+ delete []buffer;
+ buffer = 0;
+ }
+ }
+};
+
+const int stackBufferLength = 1000;
+class TextWide : public VarBuffer<wchar_t, stackBufferLength> {
+public:
+ int tlen;
+ TextWide(const char *s, int len, bool unicodeMode, int codePage=0) :
+ VarBuffer<wchar_t, stackBufferLength>(len) {
+ if (unicodeMode) {
+ tlen = static_cast<int>(UTF16FromUTF8(s, len, buffer, len));
+ } else {
+ // Support Asian string display in 9x English
+ tlen = ::MultiByteToWideChar(codePage, 0, s, len, buffer, len);
+ }
+ }
+};
+typedef VarBuffer<XYPOSITION, stackBufferLength> TextPositions;
+
+class SurfaceGDI : public Surface {
+ bool unicodeMode;
+ HDC hdc;
+ bool hdcOwned;
+ HPEN pen;
+ HPEN penOld;
+ HBRUSH brush;
+ HBRUSH brushOld;
+ HFONT font;
+ HFONT fontOld;
+ HBITMAP bitmap;
+ HBITMAP bitmapOld;
+ int maxWidthMeasure;
+ int maxLenText;
+
+ int codePage;
+
+ void BrushColor(ColourDesired back);
+ void SetFont(Font &font_);
+
+ // Private so SurfaceGDI objects can not be copied
+ SurfaceGDI(const SurfaceGDI &);
+ SurfaceGDI &operator=(const SurfaceGDI &);
+public:
+ SurfaceGDI();
+ virtual ~SurfaceGDI();
+
+ void Init(WindowID wid);
+ void Init(SurfaceID sid, WindowID wid);
+ void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
+
+ void Release();
+ bool Initialised();
+ void PenColour(ColourDesired fore);
+ int LogPixelsY();
+ int DeviceHeightFont(int points);
+ void MoveTo(int x_, int y_);
+ void LineTo(int x_, int y_);
+ void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back);
+ void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void FillRectangle(PRectangle rc, ColourDesired back);
+ void FillRectangle(PRectangle rc, Surface &surfacePattern);
+ void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags);
+ void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage);
+ void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void Copy(PRectangle rc, Point from, Surface &surfaceSource);
+
+ void DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT fuOptions);
+ void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
+ void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
+ XYPOSITION WidthText(Font &font_, const char *s, int len);
+ XYPOSITION WidthChar(Font &font_, char ch);
+ XYPOSITION Ascent(Font &font_);
+ XYPOSITION Descent(Font &font_);
+ XYPOSITION InternalLeading(Font &font_);
+ XYPOSITION ExternalLeading(Font &font_);
+ XYPOSITION Height(Font &font_);
+ XYPOSITION AverageCharWidth(Font &font_);
+
+ void SetClip(PRectangle rc);
+ void FlushCachedState();
+
+ void SetUnicodeMode(bool unicodeMode_);
+ void SetDBCSMode(int codePage_);
+};
+
+SurfaceGDI::SurfaceGDI() :
+ unicodeMode(false),
+ hdc(0), hdcOwned(false),
+ pen(0), penOld(0),
+ brush(0), brushOld(0),
+ font(0), fontOld(0),
+ bitmap(0), bitmapOld(0) {
+ maxWidthMeasure = INT_MAX;
+ // There appears to be a 16 bit string length limit in GDI on NT.
+ maxLenText = 65535;
+
+ codePage = 0;
+}
+
+SurfaceGDI::~SurfaceGDI() {
+ Release();
+}
+
+void SurfaceGDI::Release() {
+ if (penOld) {
+ ::SelectObject(reinterpret_cast<HDC>(hdc), penOld);
+ ::DeleteObject(pen);
+ penOld = 0;
+ }
+ pen = 0;
+ if (brushOld) {
+ ::SelectObject(reinterpret_cast<HDC>(hdc), brushOld);
+ ::DeleteObject(brush);
+ brushOld = 0;
+ }
+ brush = 0;
+ if (fontOld) {
+ // Fonts are not deleted as they are owned by a Font object
+ ::SelectObject(reinterpret_cast<HDC>(hdc), fontOld);
+ fontOld = 0;
+ }
+ font = 0;
+ if (bitmapOld) {
+ ::SelectObject(reinterpret_cast<HDC>(hdc), bitmapOld);
+ ::DeleteObject(bitmap);
+ bitmapOld = 0;
+ }
+ bitmap = 0;
+ if (hdcOwned) {
+ ::DeleteDC(reinterpret_cast<HDC>(hdc));
+ hdc = 0;
+ hdcOwned = false;
+ }
+}
+
+bool SurfaceGDI::Initialised() {
+ return hdc != 0;
+}
+
+void SurfaceGDI::Init(WindowID) {
+ Release();
+ hdc = ::CreateCompatibleDC(NULL);
+ hdcOwned = true;
+ ::SetTextAlign(reinterpret_cast<HDC>(hdc), TA_BASELINE);
+}
+
+void SurfaceGDI::Init(SurfaceID sid, WindowID) {
+ Release();
+ hdc = reinterpret_cast<HDC>(sid);
+ ::SetTextAlign(reinterpret_cast<HDC>(hdc), TA_BASELINE);
+}
+
+void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID) {
+ Release();
+ SurfaceGDI *psurfOther = static_cast<SurfaceGDI *>(surface_);
+ hdc = ::CreateCompatibleDC(psurfOther->hdc);
+ hdcOwned = true;
+ bitmap = ::CreateCompatibleBitmap(psurfOther->hdc, width, height);
+ bitmapOld = static_cast<HBITMAP>(::SelectObject(hdc, bitmap));
+ ::SetTextAlign(reinterpret_cast<HDC>(hdc), TA_BASELINE);
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
+}
+
+void SurfaceGDI::PenColour(ColourDesired fore) {
+ if (pen) {
+ ::SelectObject(hdc, penOld);
+ ::DeleteObject(pen);
+ pen = 0;
+ penOld = 0;
+ }
+ pen = ::CreatePen(0,1,fore.AsLong());
+ penOld = static_cast<HPEN>(::SelectObject(reinterpret_cast<HDC>(hdc), pen));
+}
+
+void SurfaceGDI::BrushColor(ColourDesired back) {
+ if (brush) {
+ ::SelectObject(hdc, brushOld);
+ ::DeleteObject(brush);
+ brush = 0;
+ brushOld = 0;
+ }
+ // Only ever want pure, non-dithered brushes
+ ColourDesired colourNearest = ::GetNearestColor(hdc, back.AsLong());
+ brush = ::CreateSolidBrush(colourNearest.AsLong());
+ brushOld = static_cast<HBRUSH>(::SelectObject(hdc, brush));
+}
+
+void SurfaceGDI::SetFont(Font &font_) {
+ if (font_.GetID() != font) {
+ FormatAndMetrics *pfm = reinterpret_cast<FormatAndMetrics *>(font_.GetID());
+ PLATFORM_ASSERT(pfm->technology == SCWIN_TECH_GDI);
+ if (fontOld) {
+ ::SelectObject(hdc, pfm->hfont);
+ } else {
+ fontOld = static_cast<HFONT>(::SelectObject(hdc, pfm->hfont));
+ }
+ font = reinterpret_cast<HFONT>(pfm->hfont);
+ }
+}
+
+int SurfaceGDI::LogPixelsY() {
+ return ::GetDeviceCaps(hdc, LOGPIXELSY);
+}
+
+int SurfaceGDI::DeviceHeightFont(int points) {
+ return ::MulDiv(points, LogPixelsY(), 72);
+}
+
+void SurfaceGDI::MoveTo(int x_, int y_) {
+ ::MoveToEx(hdc, x_, y_, 0);
+}
+
+void SurfaceGDI::LineTo(int x_, int y_) {
+ ::LineTo(hdc, x_, y_);
+}
+
+void SurfaceGDI::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) {
+ PenColour(fore);
+ BrushColor(back);
+ std::vector<POINT> outline;
+ for (int i=0; i<npts; i++) {
+ POINT pt = {static_cast<LONG>(pts[i].x), static_cast<LONG>(pts[i].y)};
+ outline.push_back(pt);
+ }
+ ::Polygon(hdc, &outline[0], npts);
+}
+
+void SurfaceGDI::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ PenColour(fore);
+ BrushColor(back);
+ const RECT rcw = RectFromPRectangle(rc);
+ ::Rectangle(hdc, rcw.left, rcw.top, rcw.right, rcw.bottom);
+}
+
+void SurfaceGDI::FillRectangle(PRectangle rc, ColourDesired back) {
+ // Using ExtTextOut rather than a FillRect ensures that no dithering occurs.
+ // There is no need to allocate a brush either.
+ RECT rcw = RectFromPRectangle(rc);
+ ::SetBkColor(hdc, back.AsLong());
+ ::ExtTextOut(hdc, rcw.left, rcw.top, ETO_OPAQUE, &rcw, TEXT(""), 0, NULL);
+}
+
+void SurfaceGDI::FillRectangle(PRectangle rc, Surface &surfacePattern) {
+ HBRUSH br;
+ if (static_cast<SurfaceGDI &>(surfacePattern).bitmap)
+ br = ::CreatePatternBrush(static_cast<SurfaceGDI &>(surfacePattern).bitmap);
+ else // Something is wrong so display in red
+ br = ::CreateSolidBrush(RGB(0xff, 0, 0));
+ RECT rcw = RectFromPRectangle(rc);
+ ::FillRect(hdc, &rcw, br);
+ ::DeleteObject(br);
+}
+
+void SurfaceGDI::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ PenColour(fore);
+ BrushColor(back);
+ const RECT rcw = RectFromPRectangle(rc);
+ ::RoundRect(hdc,
+ rcw.left + 1, rcw.top,
+ rcw.right - 1, rcw.bottom,
+ 8, 8);
+}
+
+// Plot a point into a DWORD buffer symetrically to all 4 qudrants
+static void AllFour(DWORD *pixels, int width, int height, int x, int y, DWORD val) {
+ pixels[y*width+x] = val;
+ pixels[y*width+width-1-x] = val;
+ pixels[(height-1-y)*width+x] = val;
+ pixels[(height-1-y)*width+width-1-x] = val;
+}
+
+#ifndef AC_SRC_OVER
+#define AC_SRC_OVER 0x00
+#endif
+#ifndef AC_SRC_ALPHA
+#define AC_SRC_ALPHA 0x01
+#endif
+
+static DWORD dwordFromBGRA(byte b, byte g, byte r, byte a) {
+ union {
+ byte pixVal[4];
+ DWORD val;
+ } converter;
+ converter.pixVal[0] = b;
+ converter.pixVal[1] = g;
+ converter.pixVal[2] = r;
+ converter.pixVal[3] = a;
+ return converter.val;
+}
+
+void SurfaceGDI::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int /* flags*/ ) {
+ const RECT rcw = RectFromPRectangle(rc);
+ if (AlphaBlendFn && rc.Width() > 0) {
+ HDC hMemDC = ::CreateCompatibleDC(reinterpret_cast<HDC>(hdc));
+ int width = static_cast<int>(rc.Width());
+ int height = static_cast<int>(rc.Height());
+ // Ensure not distorted too much by corners when small
+ cornerSize = Platform::Minimum(cornerSize, (Platform::Minimum(width, height) / 2) - 2);
+ BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}};
+ void *image = 0;
+ HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
+ DIB_RGB_COLORS, &image, NULL, 0);
+
+ if (hbmMem) {
+ HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
+
+ DWORD valEmpty = dwordFromBGRA(0,0,0,0);
+ DWORD valFill = dwordFromBGRA(
+ static_cast<byte>(GetBValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(GetGValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(GetRValue(fill.AsLong()) * alphaFill / 255),
+ static_cast<byte>(alphaFill));
+ DWORD valOutline = dwordFromBGRA(
+ static_cast<byte>(GetBValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(GetGValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(GetRValue(outline.AsLong()) * alphaOutline / 255),
+ static_cast<byte>(alphaOutline));
+ DWORD *pixels = reinterpret_cast<DWORD *>(image);
+ for (int y=0; y<height; y++) {
+ for (int x=0; x<width; x++) {
+ if ((x==0) || (x==width-1) || (y == 0) || (y == height-1)) {
+ pixels[y*width+x] = valOutline;
+ } else {
+ pixels[y*width+x] = valFill;
+ }
+ }
+ }
+ for (int c=0; c<cornerSize; c++) {
+ for (int x=0; x<c+1; x++) {
+ AllFour(pixels, width, height, x, c-x, valEmpty);
+ }
+ }
+ for (int x=1; x<cornerSize; x++) {
+ AllFour(pixels, width, height, x, cornerSize-x, valOutline);
+ }
+
+ BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+
+ AlphaBlendFn(reinterpret_cast<HDC>(hdc), rcw.left, rcw.top, width, height, hMemDC, 0, 0, width, height, merge);
+
+ SelectBitmap(hMemDC, hbmOld);
+ ::DeleteObject(hbmMem);
+ }
+ ::DeleteDC(hMemDC);
+ } else {
+ BrushColor(outline);
+ FrameRect(hdc, &rcw, brush);
+ }
+}
+
+void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) {
+ if (AlphaBlendFn && rc.Width() > 0) {
+ HDC hMemDC = ::CreateCompatibleDC(reinterpret_cast<HDC>(hdc));
+ if (rc.Width() > width)
+ rc.left += static_cast<int>((rc.Width() - width) / 2);
+ rc.right = rc.left + width;
+ if (rc.Height() > height)
+ rc.top += static_cast<int>((rc.Height() - height) / 2);
+ rc.bottom = rc.top + height;
+
+ BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}};
+ unsigned char *image = 0;
+ HBITMAP hbmMem = CreateDIBSection(reinterpret_cast<HDC>(hMemDC), &bpih,
+ DIB_RGB_COLORS, reinterpret_cast<void **>(&image), NULL, 0);
+ if (hbmMem) {
+ HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
+
+ for (int y=height-1; y>=0; y--) {
+ for (int x=0; x<width; x++) {
+ unsigned char *pixel = image + (y*width+x) * 4;
+ unsigned char alpha = pixelsImage[3];
+ // Input is RGBA, output is BGRA with premultiplied alpha
+ pixel[2] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[1] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[0] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[3] = static_cast<unsigned char>(*pixelsImage++);
+ }
+ }
+
+ BLENDFUNCTION merge = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+
+ AlphaBlendFn(reinterpret_cast<HDC>(hdc), static_cast<int>(rc.left), static_cast<int>(rc.top),
+ static_cast<int>(rc.Width()), static_cast<int>(rc.Height()), hMemDC, 0, 0, width, height, merge);
+
+ SelectBitmap(hMemDC, hbmOld);
+ ::DeleteObject(hbmMem);
+ }
+ ::DeleteDC(hMemDC);
+
+ }
+}
+
+void SurfaceGDI::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ PenColour(fore);
+ BrushColor(back);
+ const RECT rcw = RectFromPRectangle(rc);
+ ::Ellipse(hdc, rcw.left, rcw.top, rcw.right, rcw.bottom);
+}
+
+void SurfaceGDI::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
+ ::BitBlt(hdc,
+ static_cast<int>(rc.left), static_cast<int>(rc.top),
+ static_cast<int>(rc.Width()), static_cast<int>(rc.Height()),
+ static_cast<SurfaceGDI &>(surfaceSource).hdc,
+ static_cast<int>(from.x), static_cast<int>(from.y), SRCCOPY);
+}
+
+typedef VarBuffer<int, stackBufferLength> TextPositionsI;
+
+void SurfaceGDI::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT fuOptions) {
+ SetFont(font_);
+ RECT rcw = RectFromPRectangle(rc);
+ SIZE sz={0,0};
+ int pos = 0;
+ int x = static_cast<int>(rc.left);
+ const int yBaseInt = static_cast<int>(ybase);
+
+ // Text drawing may fail if the text is too big.
+ // If it does fail, slice up into segments and draw each segment.
+ const int maxSegmentLength = 0x200;
+
+ if (!unicodeMode) {
+ // Use ANSI calls
+ int lenDraw = Platform::Minimum(len, maxLenText);
+ if (!::ExtTextOutA(hdc, x, yBaseInt, fuOptions, &rcw, s, lenDraw, NULL)) {
+ while (lenDraw > pos) {
+ int seglen = Platform::Minimum(maxSegmentLength, lenDraw - pos);
+ if (!::ExtTextOutA(hdc, x, yBaseInt, fuOptions, &rcw, s + pos, seglen, NULL)) {
+ PLATFORM_ASSERT(false);
+ return;
+ }
+ ::GetTextExtentPoint32A(hdc, s+pos, seglen, &sz);
+ x += sz.cx;
+ pos += seglen;
+ }
+ }
+ } else {
+ // Use Unicode calls
+ const TextWide tbuf(s, len, unicodeMode, codePage);
+ if (!::ExtTextOutW(hdc, x, yBaseInt, fuOptions, &rcw, tbuf.buffer, tbuf.tlen, NULL)) {
+ while (tbuf.tlen > pos) {
+ int seglen = Platform::Minimum(maxSegmentLength, tbuf.tlen - pos);
+ if (!::ExtTextOutW(hdc, x, yBaseInt, fuOptions, &rcw, tbuf.buffer + pos, seglen, NULL)) {
+ PLATFORM_ASSERT(false);
+ return;
+ }
+ ::GetTextExtentPoint32W(hdc, tbuf.buffer+pos, seglen, &sz);
+ x += sz.cx;
+ pos += seglen;
+ }
+ }
+ }
+}
+
+void SurfaceGDI::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ ::SetTextColor(hdc, fore.AsLong());
+ ::SetBkColor(hdc, back.AsLong());
+ DrawTextCommon(rc, font_, ybase, s, len, ETO_OPAQUE);
+}
+
+void SurfaceGDI::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ ::SetTextColor(hdc, fore.AsLong());
+ ::SetBkColor(hdc, back.AsLong());
+ DrawTextCommon(rc, font_, ybase, s, len, ETO_OPAQUE | ETO_CLIPPED);
+}
+
+void SurfaceGDI::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore) {
+ // Avoid drawing spaces in transparent mode
+ for (int i=0; i<len; i++) {
+ if (s[i] != ' ') {
+ ::SetTextColor(hdc, fore.AsLong());
+ ::SetBkMode(hdc, TRANSPARENT);
+ DrawTextCommon(rc, font_, ybase, s, len, 0);
+ ::SetBkMode(hdc, OPAQUE);
+ return;
+ }
+ }
+}
+
+XYPOSITION SurfaceGDI::WidthText(Font &font_, const char *s, int len) {
+ SetFont(font_);
+ SIZE sz={0,0};
+ if (!unicodeMode) {
+ ::GetTextExtentPoint32A(hdc, s, Platform::Minimum(len, maxLenText), &sz);
+ } else {
+ const TextWide tbuf(s, len, unicodeMode, codePage);
+ ::GetTextExtentPoint32W(hdc, tbuf.buffer, tbuf.tlen, &sz);
+ }
+ return static_cast<XYPOSITION>(sz.cx);
+}
+
+void SurfaceGDI::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) {
+ SetFont(font_);
+ SIZE sz={0,0};
+ int fit = 0;
+ if (unicodeMode) {
+ const TextWide tbuf(s, len, unicodeMode, codePage);
+ TextPositionsI poses(tbuf.tlen);
+ fit = tbuf.tlen;
+ if (!::GetTextExtentExPointW(hdc, tbuf.buffer, tbuf.tlen, maxWidthMeasure, &fit, poses.buffer, &sz)) {
+ // Likely to have failed because on Windows 9x where function not available
+ // So measure the character widths by measuring each initial substring
+ // Turns a linear operation into a qudratic but seems fast enough on test files
+ for (int widthSS=0; widthSS < tbuf.tlen; widthSS++) {
+ ::GetTextExtentPoint32W(hdc, tbuf.buffer, widthSS+1, &sz);
+ poses.buffer[widthSS] = sz.cx;
+ }
+ }
+ // Map the widths given for UTF-16 characters back onto the UTF-8 input string
+ int ui=0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ int i=0;
+ while (ui<fit) {
+ unsigned char uch = us[i];
+ unsigned int lenChar = 1;
+ if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) {
+ lenChar = 4;
+ ui++;
+ } else if (uch >= (0x80 + 0x40 + 0x20)) {
+ lenChar = 3;
+ } else if (uch >= (0x80)) {
+ lenChar = 2;
+ }
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = static_cast<XYPOSITION>(poses.buffer[ui]);
+ }
+ ui++;
+ }
+ XYPOSITION lastPos = 0.0f;
+ if (i > 0)
+ lastPos = positions[i-1];
+ while (i<len) {
+ positions[i++] = lastPos;
+ }
+ } else {
+ // Zero positions to avoid random behaviour on failure.
+ std::fill(positions, positions + len, 0.0f);
+ // len may be larger than platform supports so loop over segments small enough for platform
+ int startOffset = 0;
+ while (len > 0) {
+ int lenBlock = Platform::Minimum(len, maxLenText);
+ TextPositionsI poses(len);
+ if (!::GetTextExtentExPointA(hdc, s, lenBlock, maxWidthMeasure, &fit, poses.buffer, &sz)) {
+ // Eeek - a NULL DC or other foolishness could cause this.
+ return;
+ } else if (fit < lenBlock) {
+ // For some reason, such as an incomplete DBCS character
+ // Not all the positions are filled in so make them equal to end.
+ if (fit == 0)
+ poses.buffer[fit++] = 0;
+ for (int i = fit; i<lenBlock; i++)
+ poses.buffer[i] = poses.buffer[fit-1];
+ }
+ for (int i=0; i<lenBlock; i++)
+ positions[i] = static_cast<XYPOSITION>(poses.buffer[i] + startOffset);
+ startOffset = poses.buffer[lenBlock-1];
+ len -= lenBlock;
+ positions += lenBlock;
+ s += lenBlock;
+ }
+ }
+}
+
+XYPOSITION SurfaceGDI::WidthChar(Font &font_, char ch) {
+ SetFont(font_);
+ SIZE sz;
+ ::GetTextExtentPoint32A(hdc, &ch, 1, &sz);
+ return static_cast<XYPOSITION>(sz.cx);
+}
+
+XYPOSITION SurfaceGDI::Ascent(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmAscent);
+}
+
+XYPOSITION SurfaceGDI::Descent(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmDescent);
+}
+
+XYPOSITION SurfaceGDI::InternalLeading(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmInternalLeading);
+}
+
+XYPOSITION SurfaceGDI::ExternalLeading(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmExternalLeading);
+}
+
+XYPOSITION SurfaceGDI::Height(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmHeight);
+}
+
+XYPOSITION SurfaceGDI::AverageCharWidth(Font &font_) {
+ SetFont(font_);
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ return static_cast<XYPOSITION>(tm.tmAveCharWidth);
+}
+
+void SurfaceGDI::SetClip(PRectangle rc) {
+ ::IntersectClipRect(hdc, static_cast<int>(rc.left), static_cast<int>(rc.top),
+ static_cast<int>(rc.right), static_cast<int>(rc.bottom));
+}
+
+void SurfaceGDI::FlushCachedState() {
+ pen = 0;
+ brush = 0;
+ font = 0;
+}
+
+void SurfaceGDI::SetUnicodeMode(bool unicodeMode_) {
+ unicodeMode=unicodeMode_;
+}
+
+void SurfaceGDI::SetDBCSMode(int codePage_) {
+ // No action on window as automatically handled by system.
+ codePage = codePage_;
+}
+
+#if defined(USE_D2D)
+
+class SurfaceD2D : public Surface {
+ bool unicodeMode;
+ int x, y;
+
+ int codePage;
+ int codePageText;
+
+ ID2D1RenderTarget *pRenderTarget;
+ bool ownRenderTarget;
+ int clipsActive;
+
+ IDWriteTextFormat *pTextFormat;
+ FLOAT yAscent;
+ FLOAT yDescent;
+ FLOAT yInternalLeading;
+
+ ID2D1SolidColorBrush *pBrush;
+
+ int logPixelsY;
+ float dpiScaleX;
+ float dpiScaleY;
+
+ void SetFont(Font &font_);
+
+ // Private so SurfaceD2D objects can not be copied
+ SurfaceD2D(const SurfaceD2D &);
+ SurfaceD2D &operator=(const SurfaceD2D &);
+public:
+ SurfaceD2D();
+ virtual ~SurfaceD2D();
+
+ void SetScale();
+ void Init(WindowID wid);
+ void Init(SurfaceID sid, WindowID wid);
+ void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
+
+ void Release();
+ bool Initialised();
+
+ HRESULT FlushDrawing();
+
+ void PenColour(ColourDesired fore);
+ void D2DPenColour(ColourDesired fore, int alpha=255);
+ int LogPixelsY();
+ int DeviceHeightFont(int points);
+ void MoveTo(int x_, int y_);
+ void LineTo(int x_, int y_);
+ void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back);
+ void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void FillRectangle(PRectangle rc, ColourDesired back);
+ void FillRectangle(PRectangle rc, Surface &surfacePattern);
+ void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags);
+ void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage);
+ void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
+ void Copy(PRectangle rc, Point from, Surface &surfaceSource);
+
+ void DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT fuOptions);
+ void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
+ void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
+ void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
+ XYPOSITION WidthText(Font &font_, const char *s, int len);
+ XYPOSITION WidthChar(Font &font_, char ch);
+ XYPOSITION Ascent(Font &font_);
+ XYPOSITION Descent(Font &font_);
+ XYPOSITION InternalLeading(Font &font_);
+ XYPOSITION ExternalLeading(Font &font_);
+ XYPOSITION Height(Font &font_);
+ XYPOSITION AverageCharWidth(Font &font_);
+
+ void SetClip(PRectangle rc);
+ void FlushCachedState();
+
+ void SetUnicodeMode(bool unicodeMode_);
+ void SetDBCSMode(int codePage_);
+};
+
+SurfaceD2D::SurfaceD2D() :
+ unicodeMode(false),
+ x(0), y(0) {
+
+ codePage = 0;
+ codePageText = 0;
+
+ pRenderTarget = NULL;
+ ownRenderTarget = false;
+ clipsActive = 0;
+
+ // From selected font
+ pTextFormat = NULL;
+ yAscent = 2;
+ yDescent = 1;
+ yInternalLeading = 0;
+
+ pBrush = NULL;
+
+ logPixelsY = 72;
+ dpiScaleX = 1.0;
+ dpiScaleY = 1.0;
+}
+
+SurfaceD2D::~SurfaceD2D() {
+ Release();
+}
+
+void SurfaceD2D::Release() {
+ if (pBrush) {
+ pBrush->Release();
+ pBrush = 0;
+ }
+ if (pRenderTarget) {
+ while (clipsActive) {
+ pRenderTarget->PopAxisAlignedClip();
+ clipsActive--;
+ }
+ if (ownRenderTarget) {
+ pRenderTarget->Release();
+ }
+ pRenderTarget = 0;
+ }
+}
+
+void SurfaceD2D::SetScale() {
+ HDC hdcMeasure = ::CreateCompatibleDC(NULL);
+ logPixelsY = ::GetDeviceCaps(hdcMeasure, LOGPIXELSY);
+ dpiScaleX = ::GetDeviceCaps(hdcMeasure, LOGPIXELSX) / 96.0f;
+ dpiScaleY = logPixelsY / 96.0f;
+ ::DeleteDC(hdcMeasure);
+}
+
+bool SurfaceD2D::Initialised() {
+ return pRenderTarget != 0;
+}
+
+HRESULT SurfaceD2D::FlushDrawing() {
+ return pRenderTarget->Flush();
+}
+
+void SurfaceD2D::Init(WindowID /* wid */) {
+ Release();
+ SetScale();
+}
+
+void SurfaceD2D::Init(SurfaceID sid, WindowID) {
+ Release();
+ SetScale();
+ pRenderTarget = reinterpret_cast<ID2D1RenderTarget *>(sid);
+}
+
+void SurfaceD2D::InitPixMap(int width, int height, Surface *surface_, WindowID) {
+ Release();
+ SetScale();
+ SurfaceD2D *psurfOther = static_cast<SurfaceD2D *>(surface_);
+ ID2D1BitmapRenderTarget *pCompatibleRenderTarget = NULL;
+ D2D1_SIZE_F desiredSize = D2D1::SizeF(static_cast<float>(width), static_cast<float>(height));
+ D2D1_PIXEL_FORMAT desiredFormat;
+#ifdef __MINGW32__
+ desiredFormat.format = DXGI_FORMAT_UNKNOWN;
+#else
+ desiredFormat = psurfOther->pRenderTarget->GetPixelFormat();
+#endif
+ desiredFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
+ HRESULT hr = psurfOther->pRenderTarget->CreateCompatibleRenderTarget(
+ &desiredSize, NULL, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &pCompatibleRenderTarget);
+ if (SUCCEEDED(hr)) {
+ pRenderTarget = pCompatibleRenderTarget;
+ pRenderTarget->BeginDraw();
+ ownRenderTarget = true;
+ }
+ SetUnicodeMode(psurfOther->unicodeMode);
+ SetDBCSMode(psurfOther->codePage);
+}
+
+void SurfaceD2D::PenColour(ColourDesired fore) {
+ D2DPenColour(fore);
+}
+
+void SurfaceD2D::D2DPenColour(ColourDesired fore, int alpha) {
+ if (pRenderTarget) {
+ D2D_COLOR_F col;
+ col.r = (fore.AsLong() & 0xff) / 255.0f;
+ col.g = ((fore.AsLong() & 0xff00) >> 8) / 255.0f;
+ col.b = (fore.AsLong() >> 16) / 255.0f;
+ col.a = alpha / 255.0f;
+ if (pBrush) {
+ pBrush->SetColor(col);
+ } else {
+ HRESULT hr = pRenderTarget->CreateSolidColorBrush(col, &pBrush);
+ if (!SUCCEEDED(hr) && pBrush) {
+ pBrush->Release();
+ pBrush = 0;
+ }
+ }
+ }
+}
+
+void SurfaceD2D::SetFont(Font &font_) {
+ FormatAndMetrics *pfm = reinterpret_cast<FormatAndMetrics *>(font_.GetID());
+ PLATFORM_ASSERT(pfm->technology == SCWIN_TECH_DIRECTWRITE);
+ pTextFormat = pfm->pTextFormat;
+ yAscent = pfm->yAscent;
+ yDescent = pfm->yDescent;
+ yInternalLeading = pfm->yInternalLeading;
+ codePageText = codePage;
+ if (pfm->characterSet) {
+ codePageText = CodePageFromCharSet(pfm->characterSet, codePage);
+ }
+ if (pRenderTarget) {
+ D2D1_TEXT_ANTIALIAS_MODE aaMode;
+ aaMode = DWriteMapFontQuality(pfm->extraFontFlag);
+
+ if (aaMode == D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE && customClearTypeRenderingParams)
+ pRenderTarget->SetTextRenderingParams(customClearTypeRenderingParams);
+ else if (defaultRenderingParams)
+ pRenderTarget->SetTextRenderingParams(defaultRenderingParams);
+
+ pRenderTarget->SetTextAntialiasMode(aaMode);
+ }
+}
+
+int SurfaceD2D::LogPixelsY() {
+ return logPixelsY;
+}
+
+int SurfaceD2D::DeviceHeightFont(int points) {
+ return ::MulDiv(points, LogPixelsY(), 72);
+}
+
+void SurfaceD2D::MoveTo(int x_, int y_) {
+ x = x_;
+ y = y_;
+}
+
+static int Delta(int difference) {
+ if (difference < 0)
+ return -1;
+ else if (difference > 0)
+ return 1;
+ else
+ return 0;
+}
+
+static float RoundFloat(float f) {
+ return float(int(f+0.5f));
+}
+
+void SurfaceD2D::LineTo(int x_, int y_) {
+ if (pRenderTarget) {
+ int xDiff = x_ - x;
+ int xDelta = Delta(xDiff);
+ int yDiff = y_ - y;
+ int yDelta = Delta(yDiff);
+ if ((xDiff == 0) || (yDiff == 0)) {
+ // Horizontal or vertical lines can be more precisely drawn as a filled rectangle
+ int xEnd = x_ - xDelta;
+ int left = Platform::Minimum(x, xEnd);
+ int width = abs(x - xEnd) + 1;
+ int yEnd = y_ - yDelta;
+ int top = Platform::Minimum(y, yEnd);
+ int height = abs(y - yEnd) + 1;
+ D2D1_RECT_F rectangle1 = D2D1::RectF(static_cast<float>(left), static_cast<float>(top),
+ static_cast<float>(left+width), static_cast<float>(top+height));
+ pRenderTarget->FillRectangle(&rectangle1, pBrush);
+ } else if ((abs(xDiff) == abs(yDiff))) {
+ // 45 degree slope
+ pRenderTarget->DrawLine(D2D1::Point2F(x + 0.5f, y + 0.5f),
+ D2D1::Point2F(x_ + 0.5f - xDelta, y_ + 0.5f - yDelta), pBrush);
+ } else {
+ // Line has a different slope so difficult to avoid last pixel
+ pRenderTarget->DrawLine(D2D1::Point2F(x + 0.5f, y + 0.5f),
+ D2D1::Point2F(x_ + 0.5f, y_ + 0.5f), pBrush);
+ }
+ x = x_;
+ y = y_;
+ }
+}
+
+void SurfaceD2D::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ ID2D1Factory *pFactory = 0;
+ pRenderTarget->GetFactory(&pFactory);
+ ID2D1PathGeometry *geometry=0;
+ HRESULT hr = pFactory->CreatePathGeometry(&geometry);
+ if (SUCCEEDED(hr)) {
+ ID2D1GeometrySink *sink = 0;
+ hr = geometry->Open(&sink);
+ if (SUCCEEDED(hr)) {
+ sink->BeginFigure(D2D1::Point2F(pts[0].x + 0.5f, pts[0].y + 0.5f), D2D1_FIGURE_BEGIN_FILLED);
+ for (size_t i=1; i<static_cast<size_t>(npts); i++) {
+ sink->AddLine(D2D1::Point2F(pts[i].x + 0.5f, pts[i].y + 0.5f));
+ }
+ sink->EndFigure(D2D1_FIGURE_END_CLOSED);
+ sink->Close();
+ sink->Release();
+
+ D2DPenColour(back);
+ pRenderTarget->FillGeometry(geometry,pBrush);
+ D2DPenColour(fore);
+ pRenderTarget->DrawGeometry(geometry,pBrush);
+ }
+
+ geometry->Release();
+ }
+ }
+}
+
+void SurfaceD2D::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ D2D1_RECT_F rectangle1 = D2D1::RectF(RoundFloat(rc.left) + 0.5f, rc.top+0.5f, RoundFloat(rc.right) - 0.5f, rc.bottom-0.5f);
+ D2DPenColour(back);
+ pRenderTarget->FillRectangle(&rectangle1, pBrush);
+ D2DPenColour(fore);
+ pRenderTarget->DrawRectangle(&rectangle1, pBrush);
+ }
+}
+
+void SurfaceD2D::FillRectangle(PRectangle rc, ColourDesired back) {
+ if (pRenderTarget) {
+ D2DPenColour(back);
+ D2D1_RECT_F rectangle1 = D2D1::RectF(RoundFloat(rc.left), rc.top, RoundFloat(rc.right), rc.bottom);
+ pRenderTarget->FillRectangle(&rectangle1, pBrush);
+ }
+}
+
+void SurfaceD2D::FillRectangle(PRectangle rc, Surface &surfacePattern) {
+ SurfaceD2D &surfOther = static_cast<SurfaceD2D &>(surfacePattern);
+ surfOther.FlushDrawing();
+ ID2D1Bitmap *pBitmap = NULL;
+ ID2D1BitmapRenderTarget *pCompatibleRenderTarget = reinterpret_cast<ID2D1BitmapRenderTarget *>(
+ surfOther.pRenderTarget);
+ HRESULT hr = pCompatibleRenderTarget->GetBitmap(&pBitmap);
+ if (SUCCEEDED(hr)) {
+ ID2D1BitmapBrush *pBitmapBrush = NULL;
+ D2D1_BITMAP_BRUSH_PROPERTIES brushProperties =
+ D2D1::BitmapBrushProperties(D2D1_EXTEND_MODE_WRAP, D2D1_EXTEND_MODE_WRAP,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
+ // Create the bitmap brush.
+ hr = pRenderTarget->CreateBitmapBrush(pBitmap, brushProperties, &pBitmapBrush);
+ pBitmap->Release();
+ if (SUCCEEDED(hr)) {
+ pRenderTarget->FillRectangle(
+ D2D1::RectF(rc.left, rc.top, rc.right, rc.bottom),
+ pBitmapBrush);
+ pBitmapBrush->Release();
+ }
+ }
+}
+
+void SurfaceD2D::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ D2D1_ROUNDED_RECT roundedRectFill = {
+ D2D1::RectF(rc.left+1.0f, rc.top+1.0f, rc.right-1.0f, rc.bottom-1.0f),
+ 4, 4};
+ D2DPenColour(back);
+ pRenderTarget->FillRoundedRectangle(roundedRectFill, pBrush);
+
+ D2D1_ROUNDED_RECT roundedRect = {
+ D2D1::RectF(rc.left + 0.5f, rc.top+0.5f, rc.right - 0.5f, rc.bottom-0.5f),
+ 4, 4};
+ D2DPenColour(fore);
+ pRenderTarget->DrawRoundedRectangle(roundedRect, pBrush);
+ }
+}
+
+void SurfaceD2D::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int /* flags*/ ) {
+ if (pRenderTarget) {
+ if (cornerSize == 0) {
+ // When corner size is zero, draw square rectangle to prevent blurry pixels at corners
+ D2D1_RECT_F rectFill = D2D1::RectF(RoundFloat(rc.left) + 1.0f, rc.top + 1.0f, RoundFloat(rc.right) - 1.0f, rc.bottom - 1.0f);
+ D2DPenColour(fill, alphaFill);
+ pRenderTarget->FillRectangle(rectFill, pBrush);
+
+ D2D1_RECT_F rectOutline = D2D1::RectF(RoundFloat(rc.left) + 0.5f, rc.top + 0.5f, RoundFloat(rc.right) - 0.5f, rc.bottom - 0.5f);
+ D2DPenColour(outline, alphaOutline);
+ pRenderTarget->DrawRectangle(rectOutline, pBrush);
+ } else {
+ const float cornerSizeF = static_cast<float>(cornerSize);
+ D2D1_ROUNDED_RECT roundedRectFill = {
+ D2D1::RectF(RoundFloat(rc.left) + 1.0f, rc.top + 1.0f, RoundFloat(rc.right) - 1.0f, rc.bottom - 1.0f),
+ cornerSizeF, cornerSizeF};
+ D2DPenColour(fill, alphaFill);
+ pRenderTarget->FillRoundedRectangle(roundedRectFill, pBrush);
+
+ D2D1_ROUNDED_RECT roundedRect = {
+ D2D1::RectF(RoundFloat(rc.left) + 0.5f, rc.top + 0.5f, RoundFloat(rc.right) - 0.5f, rc.bottom - 0.5f),
+ cornerSizeF, cornerSizeF};
+ D2DPenColour(outline, alphaOutline);
+ pRenderTarget->DrawRoundedRectangle(roundedRect, pBrush);
+ }
+ }
+}
+
+void SurfaceD2D::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) {
+ if (pRenderTarget) {
+ if (rc.Width() > width)
+ rc.left += static_cast<int>((rc.Width() - width) / 2);
+ rc.right = rc.left + width;
+ if (rc.Height() > height)
+ rc.top += static_cast<int>((rc.Height() - height) / 2);
+ rc.bottom = rc.top + height;
+
+ std::vector<unsigned char> image(height * width * 4);
+ for (int yPixel=0; yPixel<height; yPixel++) {
+ for (int xPixel = 0; xPixel<width; xPixel++) {
+ unsigned char *pixel = &image[0] + (yPixel*width + xPixel) * 4;
+ unsigned char alpha = pixelsImage[3];
+ // Input is RGBA, output is BGRA with premultiplied alpha
+ pixel[2] = (*pixelsImage++) * alpha / 255;
+ pixel[1] = (*pixelsImage++) * alpha / 255;
+ pixel[0] = (*pixelsImage++) * alpha / 255;
+ pixel[3] = *pixelsImage++;
+ }
+ }
+
+ ID2D1Bitmap *bitmap = 0;
+ D2D1_SIZE_U size = D2D1::SizeU(width, height);
+ D2D1_BITMAP_PROPERTIES props = {{DXGI_FORMAT_B8G8R8A8_UNORM,
+ D2D1_ALPHA_MODE_PREMULTIPLIED}, 72.0, 72.0};
+ HRESULT hr = pRenderTarget->CreateBitmap(size, &image[0],
+ width * 4, &props, &bitmap);
+ if (SUCCEEDED(hr)) {
+ D2D1_RECT_F rcDestination = {rc.left, rc.top, rc.right, rc.bottom};
+ pRenderTarget->DrawBitmap(bitmap, rcDestination);
+ bitmap->Release();
+ }
+ }
+}
+
+void SurfaceD2D::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ FLOAT radius = rc.Width() / 2.0f;
+ D2D1_ELLIPSE ellipse = {
+ D2D1::Point2F((rc.left + rc.right) / 2.0f, (rc.top + rc.bottom) / 2.0f),
+ radius,radius};
+
+ PenColour(back);
+ pRenderTarget->FillEllipse(ellipse, pBrush);
+ PenColour(fore);
+ pRenderTarget->DrawEllipse(ellipse, pBrush);
+ }
+}
+
+void SurfaceD2D::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
+ SurfaceD2D &surfOther = static_cast<SurfaceD2D &>(surfaceSource);
+ surfOther.FlushDrawing();
+ ID2D1BitmapRenderTarget *pCompatibleRenderTarget = reinterpret_cast<ID2D1BitmapRenderTarget *>(
+ surfOther.pRenderTarget);
+ ID2D1Bitmap *pBitmap = NULL;
+ HRESULT hr = pCompatibleRenderTarget->GetBitmap(&pBitmap);
+ if (SUCCEEDED(hr)) {
+ D2D1_RECT_F rcDestination = {rc.left, rc.top, rc.right, rc.bottom};
+ D2D1_RECT_F rcSource = {from.x, from.y, from.x + rc.Width(), from.y + rc.Height()};
+ pRenderTarget->DrawBitmap(pBitmap, rcDestination, 1.0f,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, rcSource);
+ hr = pRenderTarget->Flush();
+ if (FAILED(hr)) {
+ Platform::DebugPrintf("Failed Flush 0x%x\n", hr);
+ }
+ pBitmap->Release();
+ }
+}
+
+void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT fuOptions) {
+ SetFont(font_);
+
+ // Use Unicode calls
+ const TextWide tbuf(s, len, unicodeMode, codePageText);
+ if (pRenderTarget && pTextFormat && pBrush) {
+ if (fuOptions & ETO_CLIPPED) {
+ D2D1_RECT_F rcClip = {rc.left, rc.top, rc.right, rc.bottom};
+ pRenderTarget->PushAxisAlignedClip(rcClip, D2D1_ANTIALIAS_MODE_ALIASED);
+ }
+
+ // Explicitly creating a text layout appears a little faster
+ IDWriteTextLayout *pTextLayout;
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat,
+ rc.Width(), rc.Height(), &pTextLayout);
+ if (SUCCEEDED(hr)) {
+ D2D1_POINT_2F origin = {rc.left, ybase-yAscent};
+ pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, D2D1_DRAW_TEXT_OPTIONS_NONE);
+ pTextLayout->Release();
+ }
+
+ if (fuOptions & ETO_CLIPPED) {
+ pRenderTarget->PopAxisAlignedClip();
+ }
+ }
+}
+
+void SurfaceD2D::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ FillRectangle(rc, back);
+ D2DPenColour(fore);
+ DrawTextCommon(rc, font_, ybase, s, len, ETO_OPAQUE);
+ }
+}
+
+void SurfaceD2D::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore, ColourDesired back) {
+ if (pRenderTarget) {
+ FillRectangle(rc, back);
+ D2DPenColour(fore);
+ DrawTextCommon(rc, font_, ybase, s, len, ETO_OPAQUE | ETO_CLIPPED);
+ }
+}
+
+void SurfaceD2D::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len,
+ ColourDesired fore) {
+ // Avoid drawing spaces in transparent mode
+ for (int i=0; i<len; i++) {
+ if (s[i] != ' ') {
+ if (pRenderTarget) {
+ D2DPenColour(fore);
+ DrawTextCommon(rc, font_, ybase, s, len, 0);
+ }
+ return;
+ }
+ }
+}
+
+XYPOSITION SurfaceD2D::WidthText(Font &font_, const char *s, int len) {
+ FLOAT width = 1.0;
+ SetFont(font_);
+ const TextWide tbuf(s, len, unicodeMode, codePageText);
+ if (pIDWriteFactory && pTextFormat) {
+ // Create a layout
+ IDWriteTextLayout *pTextLayout = 0;
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 1000.0, 1000.0, &pTextLayout);
+ if (SUCCEEDED(hr)) {
+ DWRITE_TEXT_METRICS textMetrics;
+ if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics)))
+ width = textMetrics.widthIncludingTrailingWhitespace;
+ pTextLayout->Release();
+ }
+ }
+ return width;
+}
+
+void SurfaceD2D::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) {
+ SetFont(font_);
+ int fit = 0;
+ const TextWide tbuf(s, len, unicodeMode, codePageText);
+ TextPositions poses(tbuf.tlen);
+ fit = tbuf.tlen;
+ const int clusters = 1000;
+ DWRITE_CLUSTER_METRICS clusterMetrics[clusters];
+ UINT32 count = 0;
+ if (pIDWriteFactory && pTextFormat) {
+ SetFont(font_);
+ // Create a layout
+ IDWriteTextLayout *pTextLayout = 0;
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 10000.0, 1000.0, &pTextLayout);
+ if (!SUCCEEDED(hr))
+ return;
+ // For now, assuming WCHAR == cluster
+ if (!SUCCEEDED(pTextLayout->GetClusterMetrics(clusterMetrics, clusters, &count)))
+ return;
+ FLOAT position = 0.0f;
+ size_t ti=0;
+ for (size_t ci=0; ci<count; ci++) {
+ position += clusterMetrics[ci].width;
+ for (size_t inCluster=0; inCluster<clusterMetrics[ci].length; inCluster++) {
+ //poses.buffer[ti++] = int(position + 0.5);
+ poses.buffer[ti++] = position;
+ }
+ }
+ PLATFORM_ASSERT(ti == static_cast<size_t>(tbuf.tlen));
+ pTextLayout->Release();
+ }
+ if (unicodeMode) {
+ // Map the widths given for UTF-16 characters back onto the UTF-8 input string
+ int ui=0;
+ const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+ int i=0;
+ while (ui<fit) {
+ unsigned char uch = us[i];
+ unsigned int lenChar = 1;
+ if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) {
+ lenChar = 4;
+ ui++;
+ } else if (uch >= (0x80 + 0x40 + 0x20)) {
+ lenChar = 3;
+ } else if (uch >= (0x80)) {
+ lenChar = 2;
+ }
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
+ positions[i++] = poses.buffer[ui];
+ }
+ ui++;
+ }
+ XYPOSITION lastPos = 0.0f;
+ if (i > 0)
+ lastPos = positions[i-1];
+ while (i<len) {
+ positions[i++] = lastPos;
+ }
+ } else if (codePageText == 0) {
+
+ // One character per position
+ PLATFORM_ASSERT(len == tbuf.tlen);
+ for (size_t kk=0; kk<static_cast<size_t>(len); kk++) {
+ positions[kk] = poses.buffer[kk];
+ }
+
+ } else {
+
+ // May be more than one byte per position
+ unsigned int ui = 0;
+ FLOAT position = 0.0f;
+ for (int i=0; i<len;) {
+ if (ui < count)
+ position = poses.buffer[ui];
+ if (Platform::IsDBCSLeadByte(codePageText, s[i])) {
+ positions[i] = position;
+ positions[i+1] = position;
+ i += 2;
+ } else {
+ positions[i] = position;
+ i++;
+ }
+
+ ui++;
+ }
+ }
+}
+
+XYPOSITION SurfaceD2D::WidthChar(Font &font_, char ch) {
+ FLOAT width = 1.0;
+ SetFont(font_);
+ if (pIDWriteFactory && pTextFormat) {
+ // Create a layout
+ IDWriteTextLayout *pTextLayout = 0;
+ const WCHAR wch = ch;
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(&wch, 1, pTextFormat, 1000.0, 1000.0, &pTextLayout);
+ if (SUCCEEDED(hr)) {
+ DWRITE_TEXT_METRICS textMetrics;
+ if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics)))
+ width = textMetrics.widthIncludingTrailingWhitespace;
+ pTextLayout->Release();
+ }
+ }
+ return width;
+}
+
+XYPOSITION SurfaceD2D::Ascent(Font &font_) {
+ SetFont(font_);
+ return ceil(yAscent);
+}
+
+XYPOSITION SurfaceD2D::Descent(Font &font_) {
+ SetFont(font_);
+ return ceil(yDescent);
+}
+
+XYPOSITION SurfaceD2D::InternalLeading(Font &font_) {
+ SetFont(font_);
+ return floor(yInternalLeading);
+}
+
+XYPOSITION SurfaceD2D::ExternalLeading(Font &) {
+ // Not implemented, always return one
+ return 1;
+}
+
+XYPOSITION SurfaceD2D::Height(Font &font_) {
+ return Ascent(font_) + Descent(font_);
+}
+
+XYPOSITION SurfaceD2D::AverageCharWidth(Font &font_) {
+ FLOAT width = 1.0;
+ SetFont(font_);
+ if (pIDWriteFactory && pTextFormat) {
+ // Create a layout
+ IDWriteTextLayout *pTextLayout = 0;
+ const WCHAR wszAllAlpha[] = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ const size_t lenAllAlpha = wcslen(wszAllAlpha);
+ HRESULT hr = pIDWriteFactory->CreateTextLayout(wszAllAlpha, static_cast<UINT32>(lenAllAlpha),
+ pTextFormat, 1000.0, 1000.0, &pTextLayout);
+ if (SUCCEEDED(hr)) {
+ DWRITE_TEXT_METRICS textMetrics;
+ if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics)))
+ width = textMetrics.width / lenAllAlpha;
+ pTextLayout->Release();
+ }
+ }
+ return width;
+}
+
+void SurfaceD2D::SetClip(PRectangle rc) {
+ if (pRenderTarget) {
+ D2D1_RECT_F rcClip = {rc.left, rc.top, rc.right, rc.bottom};
+ pRenderTarget->PushAxisAlignedClip(rcClip, D2D1_ANTIALIAS_MODE_ALIASED);
+ clipsActive++;
+ }
+}
+
+void SurfaceD2D::FlushCachedState() {
+}
+
+void SurfaceD2D::SetUnicodeMode(bool unicodeMode_) {
+ unicodeMode=unicodeMode_;
+}
+
+void SurfaceD2D::SetDBCSMode(int codePage_) {
+ // No action on window as automatically handled by system.
+ codePage = codePage_;
+}
+#endif
+
+Surface *Surface::Allocate(int technology) {
+#if defined(USE_D2D)
+ if (technology == SCWIN_TECH_GDI)
+ return new SurfaceGDI;
+ else
+ return new SurfaceD2D;
+#else
+ return new SurfaceGDI;
+#endif
+}
+
+Window::~Window() {
+}
+
+void Window::Destroy() {
+ if (wid)
+ ::DestroyWindow(reinterpret_cast<HWND>(wid));
+ wid = 0;
+}
+
+bool Window::HasFocus() {
+ return ::GetFocus() == wid;
+}
+
+PRectangle Window::GetPosition() {
+ RECT rc;
+ ::GetWindowRect(reinterpret_cast<HWND>(wid), &rc);
+ return PRectangle::FromInts(rc.left, rc.top, rc.right, rc.bottom);
+}
+
+void Window::SetPosition(PRectangle rc) {
+ ::SetWindowPos(reinterpret_cast<HWND>(wid),
+ 0, static_cast<int>(rc.left), static_cast<int>(rc.top),
+ static_cast<int>(rc.Width()), static_cast<int>(rc.Height()), SWP_NOZORDER | SWP_NOACTIVATE);
+}
+
+static RECT RectFromMonitor(HMONITOR hMonitor) {
+ if (GetMonitorInfoFn) {
+ MONITORINFO mi = {0};
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfoFn(hMonitor, &mi)) {
+ return mi.rcWork;
+ }
+ }
+ RECT rc = {0, 0, 0, 0};
+ if (::SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc, 0) == 0) {
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = 0;
+ rc.bottom = 0;
+ }
+ return rc;
+}
+
+void Window::SetPositionRelative(PRectangle rc, Window w) {
+ LONG style = ::GetWindowLong(reinterpret_cast<HWND>(wid), GWL_STYLE);
+ if (style & WS_POPUP) {
+ POINT ptOther = {0, 0};
+ ::ClientToScreen(reinterpret_cast<HWND>(w.GetID()), &ptOther);
+ rc.Move(static_cast<XYPOSITION>(ptOther.x), static_cast<XYPOSITION>(ptOther.y));
+
+ RECT rcMonitor = RectFromPRectangle(rc);
+
+ HMONITOR hMonitor = NULL;
+ if (MonitorFromRectFn)
+ hMonitor = MonitorFromRectFn(&rcMonitor, MONITOR_DEFAULTTONEAREST);
+ // If hMonitor is NULL, that's just the main screen anyways.
+ //::GetMonitorInfo(hMonitor, &mi);
+ RECT rcWork = RectFromMonitor(hMonitor);
+
+ if (rcWork.left < rcWork.right) {
+ // Now clamp our desired rectangle to fit inside the work area
+ // This way, the menu will fit wholly on one screen. An improvement even
+ // if you don't have a second monitor on the left... Menu's appears half on
+ // one screen and half on the other are just U.G.L.Y.!
+ if (rc.right > rcWork.right)
+ rc.Move(rcWork.right - rc.right, 0);
+ if (rc.bottom > rcWork.bottom)
+ rc.Move(0, rcWork.bottom - rc.bottom);
+ if (rc.left < rcWork.left)
+ rc.Move(rcWork.left - rc.left, 0);
+ if (rc.top < rcWork.top)
+ rc.Move(0, rcWork.top - rc.top);
+ }
+ }
+ SetPosition(rc);
+}
+
+PRectangle Window::GetClientPosition() {
+ RECT rc={0,0,0,0};
+ if (wid)
+ ::GetClientRect(reinterpret_cast<HWND>(wid), &rc);
+ return PRectangle::FromInts(rc.left, rc.top, rc.right, rc.bottom);
+}
+
+void Window::Show(bool show) {
+ if (show)
+ ::ShowWindow(reinterpret_cast<HWND>(wid), SW_SHOWNOACTIVATE);
+ else
+ ::ShowWindow(reinterpret_cast<HWND>(wid), SW_HIDE);
+}
+
+void Window::InvalidateAll() {
+ ::InvalidateRect(reinterpret_cast<HWND>(wid), NULL, FALSE);
+}
+
+void Window::InvalidateRectangle(PRectangle rc) {
+ RECT rcw = RectFromPRectangle(rc);
+ ::InvalidateRect(reinterpret_cast<HWND>(wid), &rcw, FALSE);
+}
+
+static LRESULT Window_SendMessage(Window *w, UINT msg, WPARAM wParam=0, LPARAM lParam=0) {
+ return ::SendMessage(reinterpret_cast<HWND>(w->GetID()), msg, wParam, lParam);
+}
+
+void Window::SetFont(Font &font) {
+ Window_SendMessage(this, WM_SETFONT,
+ reinterpret_cast<WPARAM>(font.GetID()), 0);
+}
+
+static void FlipBitmap(HBITMAP bitmap, int width, int height) {
+ HDC hdc = ::CreateCompatibleDC(NULL);
+ if (hdc != NULL) {
+ HGDIOBJ prevBmp = ::SelectObject(hdc, bitmap);
+ ::StretchBlt(hdc, width - 1, 0, -width, height, hdc, 0, 0, width, height, SRCCOPY);
+ ::SelectObject(hdc, prevBmp);
+ ::DeleteDC(hdc);
+ }
+}
+
+static HCURSOR GetReverseArrowCursor() {
+ if (reverseArrowCursor != NULL)
+ return reverseArrowCursor;
+
+ ::EnterCriticalSection(&crPlatformLock);
+ HCURSOR cursor = reverseArrowCursor;
+ if (cursor == NULL) {
+ cursor = ::LoadCursor(NULL, IDC_ARROW);
+ ICONINFO info;
+ if (::GetIconInfo(cursor, &info)) {
+ BITMAP bmp;
+ if (::GetObject(info.hbmMask, sizeof(bmp), &bmp)) {
+ FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight);
+ if (info.hbmColor != NULL)
+ FlipBitmap(info.hbmColor, bmp.bmWidth, bmp.bmHeight);
+ info.xHotspot = (DWORD)bmp.bmWidth - 1 - info.xHotspot;
+
+ reverseArrowCursor = ::CreateIconIndirect(&info);
+ if (reverseArrowCursor != NULL)
+ cursor = reverseArrowCursor;
+ }
+
+ ::DeleteObject(info.hbmMask);
+ if (info.hbmColor != NULL)
+ ::DeleteObject(info.hbmColor);
+ }
+ }
+ ::LeaveCriticalSection(&crPlatformLock);
+ return cursor;
+}
+
+void Window::SetCursor(Cursor curs) {
+ switch (curs) {
+ case cursorText:
+ ::SetCursor(::LoadCursor(NULL,IDC_IBEAM));
+ break;
+ case cursorUp:
+ ::SetCursor(::LoadCursor(NULL,IDC_UPARROW));
+ break;
+ case cursorWait:
+ ::SetCursor(::LoadCursor(NULL,IDC_WAIT));
+ break;
+ case cursorHoriz:
+ ::SetCursor(::LoadCursor(NULL,IDC_SIZEWE));
+ break;
+ case cursorVert:
+ ::SetCursor(::LoadCursor(NULL,IDC_SIZENS));
+ break;
+ case cursorHand:
+ ::SetCursor(::LoadCursor(NULL,IDC_HAND));
+ break;
+ case cursorReverseArrow:
+ ::SetCursor(GetReverseArrowCursor());
+ break;
+ case cursorArrow:
+ case cursorInvalid: // Should not occur, but just in case.
+ ::SetCursor(::LoadCursor(NULL,IDC_ARROW));
+ break;
+ }
+}
+
+void Window::SetTitle(const char *s) {
+ ::SetWindowTextA(reinterpret_cast<HWND>(wid), s);
+}
+
+/* Returns rectangle of monitor pt is on, both rect and pt are in Window's
+ coordinates */
+PRectangle Window::GetMonitorRect(Point pt) {
+ // MonitorFromPoint and GetMonitorInfo are not available on Windows 95 and NT 4.
+ PRectangle rcPosition = GetPosition();
+ POINT ptDesktop = {static_cast<LONG>(pt.x + rcPosition.left),
+ static_cast<LONG>(pt.y + rcPosition.top)};
+ HMONITOR hMonitor = NULL;
+ if (MonitorFromPointFn)
+ hMonitor = MonitorFromPointFn(ptDesktop, MONITOR_DEFAULTTONEAREST);
+
+ RECT rcWork = RectFromMonitor(hMonitor);
+ if (rcWork.left < rcWork.right) {
+ PRectangle rcMonitor(
+ rcWork.left - rcPosition.left,
+ rcWork.top - rcPosition.top,
+ rcWork.right - rcPosition.left,
+ rcWork.bottom - rcPosition.top);
+ return rcMonitor;
+ } else {
+ return PRectangle();
+ }
+}
+
+struct ListItemData {
+ const char *text;
+ int pixId;
+};
+
+class LineToItem {
+ std::vector<char> words;
+
+ std::vector<ListItemData> data;
+
+public:
+ LineToItem() {
+ }
+ ~LineToItem() {
+ Clear();
+ }
+ void Clear() {
+ words.clear();
+ data.clear();
+ }
+
+ ListItemData Get(int index) const {
+ if (index >= 0 && index < static_cast<int>(data.size())) {
+ return data[index];
+ } else {
+ ListItemData missing = {"", -1};
+ return missing;
+ }
+ }
+ int Count() const {
+ return static_cast<int>(data.size());
+ }
+
+ void AllocItem(const char *text, int pixId) {
+ ListItemData lid = { text, pixId };
+ data.push_back(lid);
+ }
+
+ char *SetWords(const char *s) {
+ words = std::vector<char>(s, s+strlen(s)+1);
+ return &words[0];
+ }
+};
+
+const TCHAR ListBoxX_ClassName[] = TEXT("ListBoxX");
+
+ListBox::ListBox() {
+}
+
+ListBox::~ListBox() {
+}
+
+class ListBoxX : public ListBox {
+ int lineHeight;
+ FontID fontCopy;
+ int technology;
+ RGBAImageSet images;
+ LineToItem lti;
+ HWND lb;
+ bool unicodeMode;
+ int desiredVisibleRows;
+ unsigned int maxItemCharacters;
+ unsigned int aveCharWidth;
+ Window *parent;
+ int ctrlID;
+ CallBackAction doubleClickAction;
+ void *doubleClickActionData;
+ const char *widestItem;
+ unsigned int maxCharWidth;
+ int resizeHit;
+ PRectangle rcPreSize;
+ Point dragOffset;
+ Point location; // Caret location at which the list is opened
+ int wheelDelta; // mouse wheel residue
+
+ HWND GetHWND() const;
+ void AppendListItem(const char *text, const char *numword);
+ static void AdjustWindowRect(PRectangle *rc);
+ int ItemHeight() const;
+ int MinClientWidth() const;
+ int TextOffset() const;
+ POINT GetClientExtent() const;
+ POINT MinTrackSize() const;
+ POINT MaxTrackSize() const;
+ void SetRedraw(bool on);
+ void OnDoubleClick();
+ void ResizeToCursor();
+ void StartResize(WPARAM);
+ LRESULT NcHitTest(WPARAM, LPARAM) const;
+ void CentreItem(int n);
+ void Paint(HDC);
+ static LRESULT PASCAL ControlWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
+
+ static const Point ItemInset; // Padding around whole item
+ static const Point TextInset; // Padding around text
+ static const Point ImageInset; // Padding around image
+
+public:
+ ListBoxX() : lineHeight(10), fontCopy(0), technology(0), lb(0), unicodeMode(false),
+ desiredVisibleRows(5), maxItemCharacters(0), aveCharWidth(8),
+ parent(NULL), ctrlID(0), doubleClickAction(NULL), doubleClickActionData(NULL),
+ widestItem(NULL), maxCharWidth(1), resizeHit(0), wheelDelta(0) {
+ }
+ virtual ~ListBoxX() {
+ if (fontCopy) {
+ ::DeleteObject(fontCopy);
+ fontCopy = 0;
+ }
+ }
+ virtual void SetFont(Font &font);
+ virtual void Create(Window &parent_, int ctrlID_, Point location_, int lineHeight_, bool unicodeMode_, int technology_);
+ virtual void SetAverageCharWidth(int width);
+ virtual void SetVisibleRows(int rows);
+ virtual int GetVisibleRows() const;
+ virtual PRectangle GetDesiredRect();
+ virtual int CaretFromEdge();
+ virtual void Clear();
+ virtual void Append(char *s, int type = -1);
+ virtual int Length();
+ virtual void Select(int n);
+ virtual int GetSelection();
+ virtual int Find(const char *prefix);
+ virtual void GetValue(int n, char *value, int len);
+ virtual void RegisterImage(int type, const char *xpm_data);
+ virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage);
+ virtual void ClearRegisteredImages();
+ virtual void SetDoubleClickAction(CallBackAction action, void *data) {
+ doubleClickAction = action;
+ doubleClickActionData = data;
+ }
+ virtual void SetList(const char *list, char separator, char typesep);
+ void Draw(DRAWITEMSTRUCT *pDrawItem);
+ LRESULT WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
+ static LRESULT PASCAL StaticWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
+};
+
+const Point ListBoxX::ItemInset(0, 0);
+const Point ListBoxX::TextInset(2, 0);
+const Point ListBoxX::ImageInset(1, 0);
+
+ListBox *ListBox::Allocate() {
+ ListBoxX *lb = new ListBoxX();
+ return lb;
+}
+
+void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHeight_, bool unicodeMode_, int technology_) {
+ parent = &parent_;
+ ctrlID = ctrlID_;
+ location = location_;
+ lineHeight = lineHeight_;
+ unicodeMode = unicodeMode_;
+ technology = technology_;
+ HWND hwndParent = reinterpret_cast<HWND>(parent->GetID());
+ HINSTANCE hinstanceParent = GetWindowInstance(hwndParent);
+ // Window created as popup so not clipped within parent client area
+ wid = ::CreateWindowEx(
+ WS_EX_WINDOWEDGE, ListBoxX_ClassName, TEXT(""),
+ WS_POPUP | WS_THICKFRAME,
+ 100,100, 150,80, hwndParent,
+ NULL,
+ hinstanceParent,
+ this);
+
+ POINT locationw = {static_cast<LONG>(location.x), static_cast<LONG>(location.y)};
+ ::MapWindowPoints(hwndParent, NULL, &locationw, 1);
+ location = Point::FromInts(locationw.x, locationw.y);
+}
+
+void ListBoxX::SetFont(Font &font) {
+ if (font.GetID()) {
+ if (fontCopy) {
+ ::DeleteObject(fontCopy);
+ fontCopy = 0;
+ }
+ FormatAndMetrics *pfm = reinterpret_cast<FormatAndMetrics *>(font.GetID());
+ fontCopy = pfm->HFont();
+ ::SendMessage(lb, WM_SETFONT, reinterpret_cast<WPARAM>(fontCopy), 0);
+ }
+}
+
+void ListBoxX::SetAverageCharWidth(int width) {
+ aveCharWidth = width;
+}
+
+void ListBoxX::SetVisibleRows(int rows) {
+ desiredVisibleRows = rows;
+}
+
+int ListBoxX::GetVisibleRows() const {
+ return desiredVisibleRows;
+}
+
+HWND ListBoxX::GetHWND() const {
+ return reinterpret_cast<HWND>(GetID());
+}
+
+PRectangle ListBoxX::GetDesiredRect() {
+ PRectangle rcDesired = GetPosition();
+
+ int rows = Length();
+ if ((rows == 0) || (rows > desiredVisibleRows))
+ rows = desiredVisibleRows;
+ rcDesired.bottom = rcDesired.top + ItemHeight() * rows;
+
+ int width = MinClientWidth();
+ HDC hdc = ::GetDC(lb);
+ HFONT oldFont = SelectFont(hdc, fontCopy);
+ SIZE textSize = {0, 0};
+ int len = 0;
+ if (widestItem) {
+ len = static_cast<int>(strlen(widestItem));
+ if (unicodeMode) {
+ const TextWide tbuf(widestItem, len, unicodeMode);
+ ::GetTextExtentPoint32W(hdc, tbuf.buffer, tbuf.tlen, &textSize);
+ } else {
+ ::GetTextExtentPoint32A(hdc, widestItem, len, &textSize);
+ }
+ }
+ TEXTMETRIC tm;
+ ::GetTextMetrics(hdc, &tm);
+ maxCharWidth = tm.tmMaxCharWidth;
+ SelectFont(hdc, oldFont);
+ ::ReleaseDC(lb, hdc);
+
+ int widthDesired = Platform::Maximum(textSize.cx, (len + 1) * tm.tmAveCharWidth);
+ if (width < widthDesired)
+ width = widthDesired;
+
+ rcDesired.right = rcDesired.left + TextOffset() + width + (TextInset.x * 2);
+ if (Length() > rows)
+ rcDesired.right += ::GetSystemMetrics(SM_CXVSCROLL);
+
+ AdjustWindowRect(&rcDesired);
+ return rcDesired;
+}
+
+int ListBoxX::TextOffset() const {
+ int pixWidth = images.GetWidth();
+ return static_cast<int>(pixWidth == 0 ? ItemInset.x : ItemInset.x + pixWidth + (ImageInset.x * 2));
+}
+
+int ListBoxX::CaretFromEdge() {
+ PRectangle rc;
+ AdjustWindowRect(&rc);
+ return TextOffset() + static_cast<int>(TextInset.x + (0 - rc.left) - 1);
+}
+
+void ListBoxX::Clear() {
+ ::SendMessage(lb, LB_RESETCONTENT, 0, 0);
+ maxItemCharacters = 0;
+ widestItem = NULL;
+ lti.Clear();
+}
+
+void ListBoxX::Append(char *, int) {
+ // This method is no longer called in Scintilla
+ PLATFORM_ASSERT(false);
+}
+
+int ListBoxX::Length() {
+ return lti.Count();
+}
+
+void ListBoxX::Select(int n) {
+ // We are going to scroll to centre on the new selection and then select it, so disable
+ // redraw to avoid flicker caused by a painting new selection twice in unselected and then
+ // selected states
+ SetRedraw(false);
+ CentreItem(n);
+ ::SendMessage(lb, LB_SETCURSEL, n, 0);
+ SetRedraw(true);
+}
+
+int ListBoxX::GetSelection() {
+ return static_cast<int>(::SendMessage(lb, LB_GETCURSEL, 0, 0));
+}
+
+// This is not actually called at present
+int ListBoxX::Find(const char *) {
+ return LB_ERR;
+}
+
+void ListBoxX::GetValue(int n, char *value, int len) {
+ ListItemData item = lti.Get(n);
+ strncpy(value, item.text, len);
+ value[len-1] = '\0';
+}
+
+void ListBoxX::RegisterImage(int type, const char *xpm_data) {
+ XPM xpmImage(xpm_data);
+ images.Add(type, new RGBAImage(xpmImage));
+}
+
+void ListBoxX::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) {
+ images.Add(type, new RGBAImage(width, height, 1.0, pixelsImage));
+}
+
+void ListBoxX::ClearRegisteredImages() {
+ images.Clear();
+}
+
+void ListBoxX::Draw(DRAWITEMSTRUCT *pDrawItem) {
+ if ((pDrawItem->itemAction == ODA_SELECT) || (pDrawItem->itemAction == ODA_DRAWENTIRE)) {
+ RECT rcBox = pDrawItem->rcItem;
+ rcBox.left += TextOffset();
+ if (pDrawItem->itemState & ODS_SELECTED) {
+ RECT rcImage = pDrawItem->rcItem;
+ rcImage.right = rcBox.left;
+ // The image is not highlighted
+ ::FillRect(pDrawItem->hDC, &rcImage, reinterpret_cast<HBRUSH>(COLOR_WINDOW+1));
+ ::FillRect(pDrawItem->hDC, &rcBox, reinterpret_cast<HBRUSH>(COLOR_HIGHLIGHT+1));
+ ::SetBkColor(pDrawItem->hDC, ::GetSysColor(COLOR_HIGHLIGHT));
+ ::SetTextColor(pDrawItem->hDC, ::GetSysColor(COLOR_HIGHLIGHTTEXT));
+ } else {
+ ::FillRect(pDrawItem->hDC, &pDrawItem->rcItem, reinterpret_cast<HBRUSH>(COLOR_WINDOW+1));
+ ::SetBkColor(pDrawItem->hDC, ::GetSysColor(COLOR_WINDOW));
+ ::SetTextColor(pDrawItem->hDC, ::GetSysColor(COLOR_WINDOWTEXT));
+ }
+
+ ListItemData item = lti.Get(pDrawItem->itemID);
+ int pixId = item.pixId;
+ const char *text = item.text;
+ int len = static_cast<int>(strlen(text));
+
+ RECT rcText = rcBox;
+ ::InsetRect(&rcText, static_cast<int>(TextInset.x), static_cast<int>(TextInset.y));
+
+ if (unicodeMode) {
+ const TextWide tbuf(text, len, unicodeMode);
+ ::DrawTextW(pDrawItem->hDC, tbuf.buffer, tbuf.tlen, &rcText, DT_NOPREFIX|DT_END_ELLIPSIS|DT_SINGLELINE|DT_NOCLIP);
+ } else {
+ ::DrawTextA(pDrawItem->hDC, text, len, &rcText, DT_NOPREFIX|DT_END_ELLIPSIS|DT_SINGLELINE|DT_NOCLIP);
+ }
+ if (pDrawItem->itemState & ODS_SELECTED) {
+ ::DrawFocusRect(pDrawItem->hDC, &rcBox);
+ }
+
+ // Draw the image, if any
+ RGBAImage *pimage = images.Get(pixId);
+ if (pimage) {
+ Surface *surfaceItem = Surface::Allocate(technology);
+ if (surfaceItem) {
+ if (technology == SCWIN_TECH_GDI) {
+ surfaceItem->Init(pDrawItem->hDC, pDrawItem->hwndItem);
+ long left = pDrawItem->rcItem.left + static_cast<int>(ItemInset.x + ImageInset.x);
+ PRectangle rcImage = PRectangle::FromInts(left, pDrawItem->rcItem.top,
+ left + images.GetWidth(), pDrawItem->rcItem.bottom);
+ surfaceItem->DrawRGBAImage(rcImage,
+ pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels());
+ delete surfaceItem;
+ ::SetTextAlign(pDrawItem->hDC, TA_TOP);
+ } else {
+#if defined(USE_D2D)
+ D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(
+ D2D1_RENDER_TARGET_TYPE_DEFAULT,
+ D2D1::PixelFormat(
+ DXGI_FORMAT_B8G8R8A8_UNORM,
+ D2D1_ALPHA_MODE_IGNORE),
+ 0,
+ 0,
+ D2D1_RENDER_TARGET_USAGE_NONE,
+ D2D1_FEATURE_LEVEL_DEFAULT
+ );
+ ID2D1DCRenderTarget *pDCRT = 0;
+ HRESULT hr = pD2DFactory->CreateDCRenderTarget(&props, &pDCRT);
+ if (SUCCEEDED(hr)) {
+ RECT rcWindow;
+ GetClientRect(pDrawItem->hwndItem, &rcWindow);
+ hr = pDCRT->BindDC(pDrawItem->hDC, &rcWindow);
+ if (SUCCEEDED(hr)) {
+ surfaceItem->Init(pDCRT, pDrawItem->hwndItem);
+ pDCRT->BeginDraw();
+ long left = pDrawItem->rcItem.left + static_cast<long>(ItemInset.x + ImageInset.x);
+ PRectangle rcImage = PRectangle::FromInts(left, pDrawItem->rcItem.top,
+ left + images.GetWidth(), pDrawItem->rcItem.bottom);
+ surfaceItem->DrawRGBAImage(rcImage,
+ pimage->GetWidth(), pimage->GetHeight(), pimage->Pixels());
+ delete surfaceItem;
+ pDCRT->EndDraw();
+ pDCRT->Release();
+ } else {
+ delete surfaceItem;
+ }
+ } else {
+ delete surfaceItem;
+ }
+#endif
+ }
+ }
+ }
+ }
+}
+
+void ListBoxX::AppendListItem(const char *text, const char *numword) {
+ int pixId = -1;
+ if (numword) {
+ pixId = 0;
+ char ch;
+ while ((ch = *++numword) != '\0') {
+ pixId = 10 * pixId + (ch - '0');
+ }
+ }
+
+ lti.AllocItem(text, pixId);
+ unsigned int len = static_cast<unsigned int>(strlen(text));
+ if (maxItemCharacters < len) {
+ maxItemCharacters = len;
+ widestItem = text;
+ }
+}
+
+void ListBoxX::SetList(const char *list, char separator, char typesep) {
+ // Turn off redraw while populating the list - this has a significant effect, even if
+ // the listbox is not visible.
+ SetRedraw(false);
+ Clear();
+ size_t size = strlen(list);
+ char *words = lti.SetWords(list);
+ char *startword = words;
+ char *numword = NULL;
+ for (size_t i=0; i < size; i++) {
+ if (words[i] == separator) {
+ words[i] = '\0';
+ if (numword)
+ *numword = '\0';
+ AppendListItem(startword, numword);
+ startword = words + i + 1;
+ numword = NULL;
+ } else if (words[i] == typesep) {
+ numword = words + i;
+ }
+ }
+ if (startword) {
+ if (numword)
+ *numword = '\0';
+ AppendListItem(startword, numword);
+ }
+
+ // Finally populate the listbox itself with the correct number of items
+ int count = lti.Count();
+ ::SendMessage(lb, LB_INITSTORAGE, count, 0);
+ for (int j=0; j<count; j++) {
+ ::SendMessage(lb, LB_ADDSTRING, 0, j+1);
+ }
+ SetRedraw(true);
+}
+
+void ListBoxX::AdjustWindowRect(PRectangle *rc) {
+ RECT rcw = RectFromPRectangle(*rc);
+ ::AdjustWindowRectEx(&rcw, WS_THICKFRAME, false, WS_EX_WINDOWEDGE);
+ *rc = PRectangle::FromInts(rcw.left, rcw.top, rcw.right, rcw.bottom);
+}
+
+int ListBoxX::ItemHeight() const {
+ int itemHeight = lineHeight + (static_cast<int>(TextInset.y) * 2);
+ int pixHeight = images.GetHeight() + (static_cast<int>(ImageInset.y) * 2);
+ if (itemHeight < pixHeight) {
+ itemHeight = pixHeight;
+ }
+ return itemHeight;
+}
+
+int ListBoxX::MinClientWidth() const {
+ return 12 * (aveCharWidth+aveCharWidth/3);
+}
+
+POINT ListBoxX::MinTrackSize() const {
+ PRectangle rc = PRectangle::FromInts(0, 0, MinClientWidth(), ItemHeight());
+ AdjustWindowRect(&rc);
+ POINT ret = {static_cast<LONG>(rc.Width()), static_cast<LONG>(rc.Height())};
+ return ret;
+}
+
+POINT ListBoxX::MaxTrackSize() const {
+ PRectangle rc = PRectangle::FromInts(0, 0,
+ Platform::Maximum(MinClientWidth(),
+ maxCharWidth * maxItemCharacters + static_cast<int>(TextInset.x) * 2 +
+ TextOffset() + ::GetSystemMetrics(SM_CXVSCROLL)),
+ ItemHeight() * lti.Count());
+ AdjustWindowRect(&rc);
+ POINT ret = {static_cast<LONG>(rc.Width()), static_cast<LONG>(rc.Height())};
+ return ret;
+}
+
+void ListBoxX::SetRedraw(bool on) {
+ ::SendMessage(lb, WM_SETREDRAW, static_cast<BOOL>(on), 0);
+ if (on)
+ ::InvalidateRect(lb, NULL, TRUE);
+}
+
+static XYPOSITION XYMinimum(XYPOSITION a, XYPOSITION b) {
+ if (a < b)
+ return a;
+ else
+ return b;
+}
+
+static XYPOSITION XYMaximum(XYPOSITION a, XYPOSITION b) {
+ if (a > b)
+ return a;
+ else
+ return b;
+}
+
+void ListBoxX::ResizeToCursor() {
+ PRectangle rc = GetPosition();
+ POINT ptw;
+ ::GetCursorPos(&ptw);
+ Point pt = Point::FromInts(ptw.x, ptw.y);
+ pt.x += dragOffset.x;
+ pt.y += dragOffset.y;
+
+ switch (resizeHit) {
+ case HTLEFT:
+ rc.left = pt.x;
+ break;
+ case HTRIGHT:
+ rc.right = pt.x;
+ break;
+ case HTTOP:
+ rc.top = pt.y;
+ break;
+ case HTTOPLEFT:
+ rc.top = pt.y;
+ rc.left = pt.x;
+ break;
+ case HTTOPRIGHT:
+ rc.top = pt.y;
+ rc.right = pt.x;
+ break;
+ case HTBOTTOM:
+ rc.bottom = pt.y;
+ break;
+ case HTBOTTOMLEFT:
+ rc.bottom = pt.y;
+ rc.left = pt.x;
+ break;
+ case HTBOTTOMRIGHT:
+ rc.bottom = pt.y;
+ rc.right = pt.x;
+ break;
+ }
+
+ POINT ptMin = MinTrackSize();
+ POINT ptMax = MaxTrackSize();
+ // We don't allow the left edge to move at present, but just in case
+ rc.left = XYMaximum(XYMinimum(rc.left, rcPreSize.right - ptMin.x), rcPreSize.right - ptMax.x);
+ rc.top = XYMaximum(XYMinimum(rc.top, rcPreSize.bottom - ptMin.y), rcPreSize.bottom - ptMax.y);
+ rc.right = XYMaximum(XYMinimum(rc.right, rcPreSize.left + ptMax.x), rcPreSize.left + ptMin.x);
+ rc.bottom = XYMaximum(XYMinimum(rc.bottom, rcPreSize.top + ptMax.y), rcPreSize.top + ptMin.y);
+
+ SetPosition(rc);
+}
+
+void ListBoxX::StartResize(WPARAM hitCode) {
+ rcPreSize = GetPosition();
+ POINT cursorPos;
+ ::GetCursorPos(&cursorPos);
+
+ switch (hitCode) {
+ case HTRIGHT:
+ case HTBOTTOM:
+ case HTBOTTOMRIGHT:
+ dragOffset.x = rcPreSize.right - cursorPos.x;
+ dragOffset.y = rcPreSize.bottom - cursorPos.y;
+ break;
+
+ case HTTOPRIGHT:
+ dragOffset.x = rcPreSize.right - cursorPos.x;
+ dragOffset.y = rcPreSize.top - cursorPos.y;
+ break;
+
+ // Note that the current hit test code prevents the left edge cases ever firing
+ // as we don't want the left edge to be moveable
+ case HTLEFT:
+ case HTTOP:
+ case HTTOPLEFT:
+ dragOffset.x = rcPreSize.left - cursorPos.x;
+ dragOffset.y = rcPreSize.top - cursorPos.y;
+ break;
+ case HTBOTTOMLEFT:
+ dragOffset.x = rcPreSize.left - cursorPos.x;
+ dragOffset.y = rcPreSize.bottom - cursorPos.y;
+ break;
+
+ default:
+ return;
+ }
+
+ ::SetCapture(GetHWND());
+ resizeHit = static_cast<int>(hitCode);
+}
+
+LRESULT ListBoxX::NcHitTest(WPARAM wParam, LPARAM lParam) const {
+ LRESULT hit = ::DefWindowProc(GetHWND(), WM_NCHITTEST, wParam, lParam);
+ // There is an apparent bug in the DefWindowProc hit test code whereby it will
+ // return HTTOPXXX if the window in question is shorter than the default
+ // window caption height + frame, even if one is hovering over the bottom edge of
+ // the frame, so workaround that here
+ if (hit >= HTTOP && hit <= HTTOPRIGHT) {
+ int minHeight = GetSystemMetrics(SM_CYMINTRACK);
+ PRectangle rc = const_cast<ListBoxX*>(this)->GetPosition();
+ int yPos = GET_Y_LPARAM(lParam);
+ if ((rc.Height() < minHeight) && (yPos > ((rc.top + rc.bottom)/2))) {
+ hit += HTBOTTOM - HTTOP;
+ }
+ }
+
+ // Nerver permit resizing that moves the left edge. Allow movement of top or bottom edge
+ // depending on whether the list is above or below the caret
+ switch (hit) {
+ case HTLEFT:
+ case HTTOPLEFT:
+ case HTBOTTOMLEFT:
+ hit = HTERROR;
+ break;
+
+ case HTTOP:
+ case HTTOPRIGHT: {
+ PRectangle rc = const_cast<ListBoxX*>(this)->GetPosition();
+ // Valid only if caret below list
+ if (location.y < rc.top)
+ hit = HTERROR;
+ }
+ break;
+
+ case HTBOTTOM:
+ case HTBOTTOMRIGHT: {
+ PRectangle rc = const_cast<ListBoxX*>(this)->GetPosition();
+ // Valid only if caret above list
+ if (rc.bottom < location.y)
+ hit = HTERROR;
+ }
+ break;
+ }
+
+ return hit;
+}
+
+void ListBoxX::OnDoubleClick() {
+
+ if (doubleClickAction != NULL) {
+ doubleClickAction(doubleClickActionData);
+ }
+}
+
+POINT ListBoxX::GetClientExtent() const {
+ PRectangle rc = const_cast<ListBoxX*>(this)->GetClientPosition();
+ POINT ret;
+ ret.x = static_cast<LONG>(rc.Width());
+ ret.y = static_cast<LONG>(rc.Height());
+ return ret;
+}
+
+void ListBoxX::CentreItem(int n) {
+ // If below mid point, scroll up to centre, but with more items below if uneven
+ if (n >= 0) {
+ POINT extent = GetClientExtent();
+ int visible = extent.y/ItemHeight();
+ if (visible < Length()) {
+ LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0);
+ int half = (visible - 1) / 2;
+ if (n > (top + half))
+ ::SendMessage(lb, LB_SETTOPINDEX, n - half , 0);
+ }
+ }
+}
+
+// Performs a double-buffered paint operation to avoid flicker
+void ListBoxX::Paint(HDC hDC) {
+ POINT extent = GetClientExtent();
+ HBITMAP hBitmap = ::CreateCompatibleBitmap(hDC, extent.x, extent.y);
+ HDC bitmapDC = ::CreateCompatibleDC(hDC);
+ HBITMAP hBitmapOld = SelectBitmap(bitmapDC, hBitmap);
+ // The list background is mainly erased during painting, but can be a small
+ // unpainted area when at the end of a non-integrally sized list with a
+ // vertical scroll bar
+ RECT rc = { 0, 0, extent.x, extent.y };
+ ::FillRect(bitmapDC, &rc, reinterpret_cast<HBRUSH>(COLOR_WINDOW+1));
+ // Paint the entire client area and vertical scrollbar
+ ::SendMessage(lb, WM_PRINT, reinterpret_cast<WPARAM>(bitmapDC), PRF_CLIENT|PRF_NONCLIENT);
+ ::BitBlt(hDC, 0, 0, extent.x, extent.y, bitmapDC, 0, 0, SRCCOPY);
+ // Select a stock brush to prevent warnings from BoundsChecker
+ ::SelectObject(bitmapDC, GetStockFont(WHITE_BRUSH));
+ SelectBitmap(bitmapDC, hBitmapOld);
+ ::DeleteDC(bitmapDC);
+ ::DeleteObject(hBitmap);
+}
+
+LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ try {
+ switch (uMsg) {
+ case WM_ERASEBKGND:
+ return TRUE;
+
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HDC hDC = ::BeginPaint(hWnd, &ps);
+ ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
+ if (lbx)
+ lbx->Paint(hDC);
+ ::EndPaint(hWnd, &ps);
+ }
+ return 0;
+
+ case WM_MOUSEACTIVATE:
+ // This prevents the view activating when the scrollbar is clicked
+ return MA_NOACTIVATE;
+
+ case WM_LBUTTONDOWN: {
+ // We must take control of selection to prevent the ListBox activating
+ // the popup
+ LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam);
+ int item = LOWORD(lResult);
+ if (HIWORD(lResult) == 0 && item >= 0) {
+ ::SendMessage(hWnd, LB_SETCURSEL, item, 0);
+ }
+ }
+ return 0;
+
+ case WM_LBUTTONUP:
+ return 0;
+
+ case WM_LBUTTONDBLCLK: {
+ ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd)));
+ if (lbx) {
+ lbx->OnDoubleClick();
+ }
+ }
+ return 0;
+
+ case WM_MBUTTONDOWN:
+ // disable the scroll wheel button click action
+ return 0;
+ }
+
+ WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
+ if (prevWndProc) {
+ return ::CallWindowProc(prevWndProc, hWnd, uMsg, wParam, lParam);
+ } else {
+ return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
+ }
+ } catch (...) {
+ }
+ return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
+}
+
+LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
+ switch (iMessage) {
+ case WM_CREATE: {
+ HINSTANCE hinstanceParent = GetWindowInstance(reinterpret_cast<HWND>(parent->GetID()));
+ // Note that LBS_NOINTEGRALHEIGHT is specified to fix cosmetic issue when resizing the list
+ // but has useful side effect of speeding up list population significantly
+ lb = ::CreateWindowEx(
+ 0, TEXT("listbox"), TEXT(""),
+ WS_CHILD | WS_VSCROLL | WS_VISIBLE |
+ LBS_OWNERDRAWFIXED | LBS_NODATA | LBS_NOINTEGRALHEIGHT,
+ 0, 0, 150,80, hWnd,
+ reinterpret_cast<HMENU>(ctrlID),
+ hinstanceParent,
+ 0);
+ WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(lb, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(ControlWndProc)));
+ ::SetWindowLongPtr(lb, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(prevWndProc));
+ }
+ break;
+
+ case WM_SIZE:
+ if (lb) {
+ SetRedraw(false);
+ ::SetWindowPos(lb, 0, 0,0, LOWORD(lParam), HIWORD(lParam), SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
+ // Ensure the selection remains visible
+ CentreItem(GetSelection());
+ SetRedraw(true);
+ }
+ break;
+
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ ::BeginPaint(hWnd, &ps);
+ ::EndPaint(hWnd, &ps);
+ }
+ break;
+
+ case WM_COMMAND:
+ // This is not actually needed now - the registered double click action is used
+ // directly to action a choice from the list.
+ ::SendMessage(reinterpret_cast<HWND>(parent->GetID()), iMessage, wParam, lParam);
+ break;
+
+ case WM_MEASUREITEM: {
+ MEASUREITEMSTRUCT *pMeasureItem = reinterpret_cast<MEASUREITEMSTRUCT *>(lParam);
+ pMeasureItem->itemHeight = static_cast<unsigned int>(ItemHeight());
+ }
+ break;
+
+ case WM_DRAWITEM:
+ Draw(reinterpret_cast<DRAWITEMSTRUCT *>(lParam));
+ break;
+
+ case WM_DESTROY:
+ lb = 0;
+ ::SetWindowLong(hWnd, 0, 0);
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+
+ case WM_ERASEBKGND:
+ // To reduce flicker we can elide background erasure since this window is
+ // completely covered by its child.
+ return TRUE;
+
+ case WM_GETMINMAXINFO: {
+ MINMAXINFO *minMax = reinterpret_cast<MINMAXINFO*>(lParam);
+ minMax->ptMaxTrackSize = MaxTrackSize();
+ minMax->ptMinTrackSize = MinTrackSize();
+ }
+ break;
+
+ case WM_MOUSEACTIVATE:
+ return MA_NOACTIVATE;
+
+ case WM_NCHITTEST:
+ return NcHitTest(wParam, lParam);
+
+ case WM_NCLBUTTONDOWN:
+ // We have to implement our own window resizing because the DefWindowProc
+ // implementation insists on activating the resized window
+ StartResize(wParam);
+ return 0;
+
+ case WM_MOUSEMOVE: {
+ if (resizeHit == 0) {
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ } else {
+ ResizeToCursor();
+ }
+ }
+ break;
+
+ case WM_LBUTTONUP:
+ case WM_CANCELMODE:
+ if (resizeHit != 0) {
+ resizeHit = 0;
+ ::ReleaseCapture();
+ }
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+
+ case WM_MOUSEWHEEL:
+ wheelDelta -= static_cast<short>(HIWORD(wParam));
+ if (abs(wheelDelta) >= WHEEL_DELTA) {
+ int nRows = GetVisibleRows();
+ int linesToScroll = 1;
+ if (nRows > 1) {
+ linesToScroll = nRows - 1;
+ }
+ if (linesToScroll > 3) {
+ linesToScroll = 3;
+ }
+ linesToScroll *= (wheelDelta / WHEEL_DELTA);
+ LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0) + linesToScroll;
+ if (top < 0) {
+ top = 0;
+ }
+ ::SendMessage(lb, LB_SETTOPINDEX, top, 0);
+ // update wheel delta residue
+ if (wheelDelta >= 0)
+ wheelDelta = wheelDelta % WHEEL_DELTA;
+ else
+ wheelDelta = - (-wheelDelta % WHEEL_DELTA);
+ }
+ break;
+
+ default:
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ }
+
+ return 0;
+}
+
+LRESULT PASCAL ListBoxX::StaticWndProc(
+ HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
+ if (iMessage == WM_CREATE) {
+ CREATESTRUCT *pCreate = reinterpret_cast<CREATESTRUCT *>(lParam);
+ SetWindowPointer(hWnd, pCreate->lpCreateParams);
+ }
+ // Find C++ object associated with window.
+ ListBoxX *lbx = reinterpret_cast<ListBoxX *>(PointerFromWindow(hWnd));
+ if (lbx) {
+ return lbx->WndProc(hWnd, iMessage, wParam, lParam);
+ } else {
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ }
+}
+
+static bool ListBoxX_Register() {
+ WNDCLASSEX wndclassc;
+ wndclassc.cbSize = sizeof(wndclassc);
+ // We need CS_HREDRAW and CS_VREDRAW because of the ellipsis that might be drawn for
+ // truncated items in the list and the appearance/disappearance of the vertical scroll bar.
+ // The list repaint is double-buffered to avoid the flicker this would otherwise cause.
+ wndclassc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
+ wndclassc.cbClsExtra = 0;
+ wndclassc.cbWndExtra = sizeof(ListBoxX *);
+ wndclassc.hInstance = hinstPlatformRes;
+ wndclassc.hIcon = NULL;
+ wndclassc.hbrBackground = NULL;
+ wndclassc.lpszMenuName = NULL;
+ wndclassc.lpfnWndProc = ListBoxX::StaticWndProc;
+ wndclassc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
+ wndclassc.lpszClassName = ListBoxX_ClassName;
+ wndclassc.hIconSm = 0;
+
+ return ::RegisterClassEx(&wndclassc) != 0;
+}
+
+bool ListBoxX_Unregister() {
+ return ::UnregisterClass(ListBoxX_ClassName, hinstPlatformRes) != 0;
+}
+
+Menu::Menu() : mid(0) {
+}
+
+void Menu::CreatePopUp() {
+ Destroy();
+ mid = ::CreatePopupMenu();
+}
+
+void Menu::Destroy() {
+ if (mid)
+ ::DestroyMenu(reinterpret_cast<HMENU>(mid));
+ mid = 0;
+}
+
+void Menu::Show(Point pt, Window &w) {
+ ::TrackPopupMenu(reinterpret_cast<HMENU>(mid),
+ TPM_RIGHTBUTTON, static_cast<int>(pt.x - 4), static_cast<int>(pt.y), 0,
+ reinterpret_cast<HWND>(w.GetID()), NULL);
+ Destroy();
+}
+
+static bool initialisedET = false;
+static bool usePerformanceCounter = false;
+static LARGE_INTEGER frequency;
+
+ElapsedTime::ElapsedTime() {
+ if (!initialisedET) {
+ usePerformanceCounter = ::QueryPerformanceFrequency(&frequency) != 0;
+ initialisedET = true;
+ }
+ if (usePerformanceCounter) {
+ LARGE_INTEGER timeVal;
+ ::QueryPerformanceCounter(&timeVal);
+ bigBit = timeVal.HighPart;
+ littleBit = timeVal.LowPart;
+ } else {
+ bigBit = clock();
+ littleBit = 0;
+ }
+}
+
+double ElapsedTime::Duration(bool reset) {
+ double result;
+ long endBigBit;
+ long endLittleBit;
+
+ if (usePerformanceCounter) {
+ LARGE_INTEGER lEnd;
+ ::QueryPerformanceCounter(&lEnd);
+ endBigBit = lEnd.HighPart;
+ endLittleBit = lEnd.LowPart;
+ LARGE_INTEGER lBegin;
+ lBegin.HighPart = bigBit;
+ lBegin.LowPart = littleBit;
+ double elapsed = static_cast<double>(lEnd.QuadPart - lBegin.QuadPart);
+ result = elapsed / static_cast<double>(frequency.QuadPart);
+ } else {
+ endBigBit = clock();
+ endLittleBit = 0;
+ double elapsed = endBigBit - bigBit;
+ result = elapsed / CLOCKS_PER_SEC;
+ }
+ if (reset) {
+ bigBit = endBigBit;
+ littleBit = endLittleBit;
+ }
+ return result;
+}
+
+class DynamicLibraryImpl : public DynamicLibrary {
+protected:
+ HMODULE h;
+public:
+ explicit DynamicLibraryImpl(const char *modulePath) {
+ h = ::LoadLibraryA(modulePath);
+ }
+
+ virtual ~DynamicLibraryImpl() {
+ if (h != NULL)
+ ::FreeLibrary(h);
+ }
+
+ // Use GetProcAddress to get a pointer to the relevant function.
+ virtual Function FindFunction(const char *name) {
+ if (h != NULL) {
+ // C++ standard doesn't like casts betwen function pointers and void pointers so use a union
+ union {
+ FARPROC fp;
+ Function f;
+ } fnConv;
+ fnConv.fp = ::GetProcAddress(h, name);
+ return fnConv.f;
+ } else {
+ return NULL;
+ }
+ }
+
+ virtual bool IsValid() {
+ return h != NULL;
+ }
+};
+
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
+ return static_cast<DynamicLibrary *>(new DynamicLibraryImpl(modulePath));
+}
+
+ColourDesired Platform::Chrome() {
+ return ::GetSysColor(COLOR_3DFACE);
+}
+
+ColourDesired Platform::ChromeHighlight() {
+ return ::GetSysColor(COLOR_3DHIGHLIGHT);
+}
+
+const char *Platform::DefaultFont() {
+ return "Verdana";
+}
+
+int Platform::DefaultFontSize() {
+ return 8;
+}
+
+unsigned int Platform::DoubleClickTime() {
+ return ::GetDoubleClickTime();
+}
+
+bool Platform::MouseButtonBounce() {
+ return false;
+}
+
+void Platform::DebugDisplay(const char *s) {
+ ::OutputDebugStringA(s);
+}
+
+bool Platform::IsKeyDown(int key) {
+ return (::GetKeyState(key) & 0x80000000) != 0;
+}
+
+long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) {
+ // This should never be called - its here to satisfy an old interface
+ return static_cast<long>(::SendMessage(reinterpret_cast<HWND>(w), msg, wParam, lParam));
+}
+
+long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) {
+ // This should never be called - its here to satisfy an old interface
+ return static_cast<long>(::SendMessage(reinterpret_cast<HWND>(w), msg, wParam,
+ reinterpret_cast<LPARAM>(lParam)));
+}
+
+bool Platform::IsDBCSLeadByte(int codePage, char ch) {
+ // Byte ranges found in Wikipedia articles with relevant search strings in each case
+ unsigned char uch = static_cast<unsigned char>(ch);
+ switch (codePage) {
+ case 932:
+ // Shift_jis
+ return ((uch >= 0x81) && (uch <= 0x9F)) ||
+ ((uch >= 0xE0) && (uch <= 0xEF));
+ case 936:
+ // GBK
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 949:
+ // Korean Wansung KS C-5601-1987
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 950:
+ // Big5
+ return (uch >= 0x81) && (uch <= 0xFE);
+ case 1361:
+ // Korean Johab KS C-5601-1992
+ return
+ ((uch >= 0x84) && (uch <= 0xD3)) ||
+ ((uch >= 0xD8) && (uch <= 0xDE)) ||
+ ((uch >= 0xE0) && (uch <= 0xF9));
+ }
+ return false;
+}
+
+int Platform::DBCSCharLength(int codePage, const char *s) {
+ if (codePage == 932 || codePage == 936 || codePage == 949 ||
+ codePage == 950 || codePage == 1361) {
+ return Platform::IsDBCSLeadByte(codePage, s[0]) ? 2 : 1;
+ } else {
+ return 1;
+ }
+}
+
+int Platform::DBCSCharMaxLength() {
+ return 2;
+}
+
+// These are utility functions not really tied to a platform
+
+int Platform::Minimum(int a, int b) {
+ if (a < b)
+ return a;
+ else
+ return b;
+}
+
+int Platform::Maximum(int a, int b) {
+ if (a > b)
+ return a;
+ else
+ return b;
+}
+
+//#define TRACE
+
+#ifdef TRACE
+void Platform::DebugPrintf(const char *format, ...) {
+ char buffer[2000];
+ va_list pArguments;
+ va_start(pArguments, format);
+ vsprintf(buffer,format,pArguments);
+ va_end(pArguments);
+ Platform::DebugDisplay(buffer);
+}
+#else
+void Platform::DebugPrintf(const char *, ...) {
+}
+#endif
+
+static bool assertionPopUps = true;
+
+bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
+ bool ret = assertionPopUps;
+ assertionPopUps = assertionPopUps_;
+ return ret;
+}
+
+void Platform::Assert(const char *c, const char *file, int line) {
+ char buffer[2000];
+ sprintf(buffer, "Assertion [%s] failed at %s %d%s", c, file, line, assertionPopUps ? "" : "\r\n");
+ if (assertionPopUps) {
+ int idButton = ::MessageBoxA(0, buffer, "Assertion failure",
+ MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
+ if (idButton == IDRETRY) {
+ ::DebugBreak();
+ } else if (idButton == IDIGNORE) {
+ // all OK
+ } else {
+ abort();
+ }
+ } else {
+ Platform::DebugDisplay(buffer);
+ ::DebugBreak();
+ abort();
+ }
+}
+
+int Platform::Clamp(int val, int minVal, int maxVal) {
+ if (val > maxVal)
+ val = maxVal;
+ if (val < minVal)
+ val = minVal;
+ return val;
+}
+
+#ifdef _MSC_VER
+// GetVersionEx has been deprecated fro Windows 8.1 but called here to determine if Windows 9x.
+// Too dangerous to find alternate check.
+#pragma warning(disable: 4996)
+#endif
+
+void Platform_Initialise(void *hInstance) {
+ ::InitializeCriticalSection(&crPlatformLock);
+ hinstPlatformRes = reinterpret_cast<HINSTANCE>(hInstance);
+ // This may be called from DllMain, in which case the call to LoadLibrary
+ // is bad because it can upset the DLL load order.
+ if (!hDLLImage) {
+ hDLLImage = ::LoadLibrary(TEXT("Msimg32"));
+ }
+ if (hDLLImage) {
+ AlphaBlendFn = (AlphaBlendSig)::GetProcAddress(hDLLImage, "AlphaBlend");
+ }
+ if (!hDLLUser32) {
+ hDLLUser32 = ::LoadLibrary(TEXT("User32"));
+ }
+ if (hDLLUser32) {
+ MonitorFromPointFn = (MonitorFromPointSig)::GetProcAddress(hDLLUser32, "MonitorFromPoint");
+ MonitorFromRectFn = (MonitorFromRectSig)::GetProcAddress(hDLLUser32, "MonitorFromRect");
+ GetMonitorInfoFn = (GetMonitorInfoSig)::GetProcAddress(hDLLUser32, "GetMonitorInfoA");
+ }
+
+ ListBoxX_Register();
+}
+
+#ifdef _MSC_VER
+#pragma warning(default: 4996)
+#endif
+
+void Platform_Finalise(bool fromDllMain) {
+#if defined(USE_D2D)
+ if (!fromDllMain) {
+ if (defaultRenderingParams) {
+ defaultRenderingParams->Release();
+ defaultRenderingParams = 0;
+ }
+ if (customClearTypeRenderingParams) {
+ customClearTypeRenderingParams->Release();
+ customClearTypeRenderingParams = 0;
+ }
+ if (pIDWriteFactory) {
+ pIDWriteFactory->Release();
+ pIDWriteFactory = 0;
+ }
+ if (pD2DFactory) {
+ pD2DFactory->Release();
+ pD2DFactory = 0;
+ }
+ if (hDLLDWrite) {
+ FreeLibrary(hDLLDWrite);
+ hDLLDWrite = NULL;
+ }
+ if (hDLLD2D) {
+ FreeLibrary(hDLLD2D);
+ hDLLD2D = NULL;
+ }
+ }
+#endif
+ if (reverseArrowCursor != NULL)
+ ::DestroyCursor(reverseArrowCursor);
+ ListBoxX_Unregister();
+ ::DeleteCriticalSection(&crPlatformLock);
+ if (hDLLUser32) {
+ FreeLibrary(hDLLUser32);
+ hDLLUser32 = NULL;
+ }
+ if (hDLLImage) {
+ FreeLibrary(hDLLImage);
+ hDLLImage = NULL;
+ }
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.h b/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.h
new file mode 100644
index 00000000000..e5913ba17c6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/PlatWin.h
@@ -0,0 +1,28 @@
+// Scintilla source code edit control
+/** @file PlatWin.h
+ ** Implementation of platform facilities on Windows.
+ **/
+// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef PLATWIN_H
+#define PLATWIN_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
+extern void Platform_Initialise(void *hInstance);
+extern void Platform_Finalise(bool fromDllMain);
+
+#if defined(USE_D2D)
+extern bool LoadD2D();
+extern ID2D1Factory *pD2DFactory;
+extern IDWriteFactory *pIDWriteFactory;
+#endif
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/SciLexer.vcxproj b/3rdparty/bgfx/3rdparty/scintilla/win32/SciLexer.vcxproj
new file mode 100644
index 00000000000..a151c02de15
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/SciLexer.vcxproj
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{FBE04237-9C7B-4973-9C60-505975998B39}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>SciLexer</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <UseDebugLibraries>true</UseDebugLibraries>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <UseDebugLibraries>true</UseDebugLibraries>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <WarningLevel>Level4</WarningLevel>
+ <PreprocessorDefinitions>WIN32;SCI_LEXER;_CRT_SECURE_NO_DEPRECATE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\include;..\src;..\lexlib;</AdditionalIncludeDirectories>
+ <BrowseInformation>true</BrowseInformation>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <MinimalRebuild>false</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>imm32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\lexers\*.cxx" />
+ <ClCompile Include="..\lexlib\*.cxx" />
+ <ClCompile Include="..\src\*.cxx" />
+ <ClCompile Include="..\win32\HanjaDic.cxx" />
+ <ClCompile Include="..\win32\PlatWin.cxx" />
+ <ClCompile Include="..\win32\ScintillaWin.cxx" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\include\*.h" />
+ <ClInclude Include="..\src\*.h" />
+ <ClInclude Include="..\lexlib\*.h" />
+ <ClInclude Include="..\win32\*.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\win32\ScintRes.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/SciTE.properties b/3rdparty/bgfx/3rdparty/scintilla/win32/SciTE.properties
new file mode 100644
index 00000000000..5856b8de11b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/SciTE.properties
@@ -0,0 +1,21 @@
+command.build.SConstruct=scons.bat .
+command.name.1.SConstruct=scons clean
+command.1.SConstruct=scons.bat --clean .
+
+command.build.*.mak=nmake -f $(FileNameExt) DEBUG=1 QUIET=1
+command.name.1.*.mak=nmake clean
+command.1.*.mak=nmake -f $(FileNameExt) clean
+command.name.2.*.mak=Borland Make
+command.2.*.mak=make -f $(FileNameExt)
+command.subsystem.2.*.mak=0
+command.name.3.*.mak=make clean
+command.3.*.mak=make -f $(FileNameExt) clean
+command.name.4.*.mak=make debug
+command.4.*.mak=make DEBUG=1 -f $(FileNameExt)
+command.name.5.*.mak=nmake debug
+command.5.*.mak=nmake DEBUG=1 -f $(FileNameExt)
+# SciTE.properties is the per directory local options file and can be used to override
+# settings made in SciTEGlobal.properties
+command.build.*.cxx=nmake -f scintilla.mak DEBUG=1 QUIET=1
+command.build.*.h=nmake -f scintilla.mak DEBUG=1 QUIET=1
+command.build.*.rc=nmake -f scintilla.mak DEBUG=1 QUIET=1
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/ScintRes.rc b/3rdparty/bgfx/3rdparty/scintilla/win32/ScintRes.rc
new file mode 100644
index 00000000000..3e4a0563b31
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/ScintRes.rc
@@ -0,0 +1,37 @@
+// Resource file for Scintilla
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <windows.h>
+
+#define VERSION_SCINTILLA "3.5.6"
+#define VERSION_WORDS 3, 5, 6, 0
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VERSION_WORDS
+PRODUCTVERSION VERSION_WORDS
+FILEFLAGSMASK 0x3fL
+FILEFLAGS 0
+FILEOS VOS_NT_WINDOWS32
+FILETYPE VFT_APP
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0"
+ VALUE "FileDescription", "Scintilla.DLL - a Source Editing Component\0"
+ VALUE "FileVersion", VERSION_SCINTILLA "\0"
+ VALUE "InternalName", "Scintilla\0"
+ VALUE "LegalCopyright", "Copyright 1998-2012 by Neil Hodgson\0"
+ VALUE "OriginalFilename", "Scintilla.DLL\0"
+ VALUE "ProductName", "Scintilla\0"
+ VALUE "ProductVersion", VERSION_SCINTILLA "\0"
+ END
+ END
+END
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/Scintilla.def b/3rdparty/bgfx/3rdparty/scintilla/win32/Scintilla.def
new file mode 100644
index 00000000000..7ff903b4538
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/Scintilla.def
@@ -0,0 +1,2 @@
+EXPORTS
+ Scintilla_DirectFunction \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/ScintillaWin.cxx b/3rdparty/bgfx/3rdparty/scintilla/win32/ScintillaWin.cxx
new file mode 100644
index 00000000000..176faed1b3a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/ScintillaWin.cxx
@@ -0,0 +1,3321 @@
+// Scintilla source code edit control
+/** @file ScintillaWin.cxx
+ ** Windows specific subclass of ScintillaBase.
+ **/
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+#include <limits.h>
+
+#include <cmath>
+#include <stdexcept>
+#include <new>
+#include <string>
+#include <vector>
+#include <map>
+#include <algorithm>
+
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0500
+#undef WINVER
+#define WINVER 0x0500
+#include <windows.h>
+#include <commctrl.h>
+#include <richedit.h>
+#include <windowsx.h>
+#include <zmouse.h>
+#include <ole2.h>
+
+#if defined(NTDDI_WIN7) && !defined(DISABLE_D2D)
+#define USE_D2D 1
+#endif
+
+#if defined(USE_D2D)
+#include <d2d1.h>
+#include <dwrite.h>
+#endif
+
+#include "Platform.h"
+
+#include "ILexer.h"
+#include "Scintilla.h"
+
+#ifdef SCI_LEXER
+#include "SciLexer.h"
+#endif
+#include "StringCopy.h"
+#ifdef SCI_LEXER
+#include "LexerModule.h"
+#endif
+#include "SplitVector.h"
+#include "Partitioning.h"
+#include "RunStyles.h"
+#include "ContractionState.h"
+#include "CellBuffer.h"
+#include "CallTip.h"
+#include "KeyMap.h"
+#include "Indicator.h"
+#include "XPM.h"
+#include "LineMarker.h"
+#include "Style.h"
+#include "ViewStyle.h"
+#include "CharClassify.h"
+#include "Decoration.h"
+#include "CaseFolder.h"
+#include "Document.h"
+#include "CaseConvert.h"
+#include "UniConversion.h"
+#include "Selection.h"
+#include "PositionCache.h"
+#include "EditModel.h"
+#include "MarginView.h"
+#include "EditView.h"
+#include "Editor.h"
+
+#include "AutoComplete.h"
+#include "ScintillaBase.h"
+
+#ifdef SCI_LEXER
+#include "ExternalLexer.h"
+#endif
+
+#include "PlatWin.h"
+#include "HanjaDic.h"
+
+#ifndef SPI_GETWHEELSCROLLLINES
+#define SPI_GETWHEELSCROLLLINES 104
+#endif
+
+#ifndef WM_UNICHAR
+#define WM_UNICHAR 0x0109
+#endif
+
+#ifndef UNICODE_NOCHAR
+#define UNICODE_NOCHAR 0xFFFF
+#endif
+
+#ifndef MK_ALT
+#define MK_ALT 32
+#endif
+
+#define SC_WIN_IDLE 5001
+
+#define SC_INDICATOR_INPUT INDIC_IME
+#define SC_INDICATOR_TARGET INDIC_IME+1
+#define SC_INDICATOR_CONVERTED INDIC_IME+2
+#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX
+
+typedef BOOL (WINAPI *TrackMouseEventSig)(LPTRACKMOUSEEVENT);
+typedef UINT_PTR (WINAPI *SetCoalescableTimerSig)(HWND hwnd, UINT_PTR nIDEvent,
+ UINT uElapse, TIMERPROC lpTimerFunc, ULONG uToleranceDelay);
+
+// GCC has trouble with the standard COM ABI so do it the old C way with explicit vtables.
+
+const TCHAR callClassName[] = TEXT("CallTip");
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void *PointerFromWindow(HWND hWnd) {
+ return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
+}
+
+static void SetWindowPointer(HWND hWnd, void *ptr) {
+ ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
+}
+
+static void SetWindowID(HWND hWnd, int identifier) {
+ ::SetWindowLongPtr(hWnd, GWLP_ID, identifier);
+}
+
+static Point PointFromPOINT(POINT pt) {
+ return Point::FromInts(pt.x, pt.y);
+}
+
+class ScintillaWin; // Forward declaration for COM interface subobjects
+
+typedef void VFunction(void);
+
+static HMODULE commctrl32 = 0;
+
+/**
+ */
+class FormatEnumerator {
+public:
+ VFunction **vtbl;
+ int ref;
+ unsigned int pos;
+ std::vector<CLIPFORMAT> formats;
+ FormatEnumerator(int pos_, CLIPFORMAT formats_[], size_t formatsLen_);
+};
+
+/**
+ */
+class DropSource {
+public:
+ VFunction **vtbl;
+ ScintillaWin *sci;
+ DropSource();
+};
+
+/**
+ */
+class DataObject {
+public:
+ VFunction **vtbl;
+ ScintillaWin *sci;
+ DataObject();
+};
+
+/**
+ */
+class DropTarget {
+public:
+ VFunction **vtbl;
+ ScintillaWin *sci;
+ DropTarget();
+};
+
+/**
+ */
+class ScintillaWin :
+ public ScintillaBase {
+
+ bool lastKeyDownConsumed;
+
+ bool capturedMouse;
+ bool trackedMouseLeave;
+ TrackMouseEventSig TrackMouseEventFn;
+ SetCoalescableTimerSig SetCoalescableTimerFn;
+
+ unsigned int linesPerScroll; ///< Intellimouse support
+ int wheelDelta; ///< Wheel delta from roll
+
+ HRGN hRgnUpdate;
+
+ bool hasOKText;
+
+ CLIPFORMAT cfColumnSelect;
+ CLIPFORMAT cfBorlandIDEBlockType;
+ CLIPFORMAT cfLineSelect;
+ CLIPFORMAT cfVSLineTag;
+
+ HRESULT hrOle;
+ DropSource ds;
+ DataObject dob;
+ DropTarget dt;
+
+ static HINSTANCE hInstance;
+ static ATOM scintillaClassAtom;
+ static ATOM callClassAtom;
+
+#if defined(USE_D2D)
+ ID2D1RenderTarget *pRenderTarget;
+ bool renderTargetValid;
+#endif
+
+ explicit ScintillaWin(HWND hwnd);
+ ScintillaWin(const ScintillaWin &);
+ virtual ~ScintillaWin();
+ ScintillaWin &operator=(const ScintillaWin &);
+
+ virtual void Initialise();
+ virtual void Finalise();
+#if defined(USE_D2D)
+ void EnsureRenderTarget(HDC hdc);
+ void DropRenderTarget();
+#endif
+ HWND MainHWND();
+
+ static sptr_t DirectFunction(
+ sptr_t ptr, UINT iMessage, uptr_t wParam, sptr_t lParam);
+ static sptr_t PASCAL SWndProc(
+ HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam);
+ static sptr_t PASCAL CTWndProc(
+ HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam);
+
+ enum { invalidTimerID, standardTimerID, idleTimerID, fineTimerStart };
+
+ virtual bool DragThreshold(Point ptStart, Point ptNow);
+ virtual void StartDrag();
+ int TargetAsUTF8(char *text);
+ int EncodedFromUTF8(char *utf8, char *encoded) const;
+ sptr_t WndPaint(uptr_t wParam);
+
+ sptr_t HandleCompositionWindowed(uptr_t wParam, sptr_t lParam);
+ sptr_t HandleCompositionInline(uptr_t wParam, sptr_t lParam);
+ static bool KoreanIME();
+ void MoveImeCarets(int offset);
+ void DrawImeIndicator(int indicator, int len);
+ void SetCandidateWindowPos();
+ void SelectionToHangul();
+ void EscapeHanja();
+ void ToggleHanja();
+
+ UINT CodePageOfDocument() const;
+ virtual bool ValidCodePage(int codePage) const;
+ virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+ virtual bool SetIdle(bool on);
+ UINT_PTR timers[tickDwell+1];
+ virtual bool FineTickerAvailable();
+ virtual bool FineTickerRunning(TickReason reason);
+ virtual void FineTickerStart(TickReason reason, int millis, int tolerance);
+ virtual void FineTickerCancel(TickReason reason);
+ virtual void SetMouseCapture(bool on);
+ virtual bool HaveMouseCapture();
+ virtual void SetTrackMouseLeaveEvent(bool on);
+ virtual bool PaintContains(PRectangle rc);
+ virtual void ScrollText(int linesToMove);
+ virtual void UpdateSystemCaret();
+ virtual void SetVerticalScrollPos();
+ virtual void SetHorizontalScrollPos();
+ virtual bool ModifyScrollBars(int nMax, int nPage);
+ virtual void NotifyChange();
+ virtual void NotifyFocus(bool focus);
+ virtual void SetCtrlID(int identifier);
+ virtual int GetCtrlID();
+ virtual void NotifyParent(SCNotification scn);
+ virtual void NotifyDoubleClick(Point pt, int modifiers);
+ virtual CaseFolder *CaseFolderForEncoding();
+ virtual std::string CaseMapString(const std::string &s, int caseMapping);
+ virtual void Copy();
+ virtual void CopyAllowLine();
+ virtual bool CanPaste();
+ virtual void Paste();
+ virtual void CreateCallTipWindow(PRectangle rc);
+ virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
+ virtual void ClaimSelection();
+
+ // DBCS
+ void ImeStartComposition();
+ void ImeEndComposition();
+
+ void GetIntelliMouseParameters();
+ virtual void CopyToClipboard(const SelectionText &selectedText);
+ void ScrollMessage(WPARAM wParam);
+ void HorizontalScrollMessage(WPARAM wParam);
+ void FullPaint();
+ void FullPaintDC(HDC dc);
+ bool IsCompatibleDC(HDC dc);
+ DWORD EffectFromState(DWORD grfKeyState) const;
+
+ virtual int SetScrollInfo(int nBar, LPCSCROLLINFO lpsi, BOOL bRedraw);
+ virtual bool GetScrollInfo(int nBar, LPSCROLLINFO lpsi);
+ void ChangeScrollPos(int barType, int pos);
+ sptr_t GetTextLength();
+ sptr_t GetText(uptr_t wParam, sptr_t lParam);
+
+public:
+ // Public for benefit of Scintilla_DirectFunction
+ virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
+
+ /// Implement IUnknown
+ STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
+ STDMETHODIMP_(ULONG)AddRef();
+ STDMETHODIMP_(ULONG)Release();
+
+ /// Implement IDropTarget
+ STDMETHODIMP DragEnter(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL pt, PDWORD pdwEffect);
+ STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffect);
+ STDMETHODIMP DragLeave();
+ STDMETHODIMP Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL pt, PDWORD pdwEffect);
+
+ /// Implement important part of IDataObject
+ STDMETHODIMP GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM);
+
+ static bool Register(HINSTANCE hInstance_);
+ static bool Unregister();
+
+ friend class DropSource;
+ friend class DataObject;
+ friend class DropTarget;
+ bool DragIsRectangularOK(CLIPFORMAT fmt) const {
+ return drag.rectangular && (fmt == cfColumnSelect);
+ }
+
+private:
+ // For use in creating a system caret
+ bool HasCaretSizeChanged() const;
+ BOOL CreateSystemCaret();
+ BOOL DestroySystemCaret();
+ HBITMAP sysCaretBitmap;
+ int sysCaretWidth;
+ int sysCaretHeight;
+};
+
+HINSTANCE ScintillaWin::hInstance = 0;
+ATOM ScintillaWin::scintillaClassAtom = 0;
+ATOM ScintillaWin::callClassAtom = 0;
+
+ScintillaWin::ScintillaWin(HWND hwnd) {
+
+ lastKeyDownConsumed = false;
+
+ capturedMouse = false;
+ trackedMouseLeave = false;
+ TrackMouseEventFn = 0;
+ SetCoalescableTimerFn = 0;
+
+ linesPerScroll = 0;
+ wheelDelta = 0; // Wheel delta from roll
+
+ hRgnUpdate = 0;
+
+ hasOKText = false;
+
+ // There does not seem to be a real standard for indicating that the clipboard
+ // contains a rectangular selection, so copy Developer Studio and Borland Delphi.
+ cfColumnSelect = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat(TEXT("MSDEVColumnSelect")));
+ cfBorlandIDEBlockType = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat(TEXT("Borland IDE Block Type")));
+
+ // Likewise for line-copy (copies a full line when no text is selected)
+ cfLineSelect = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat(TEXT("MSDEVLineSelect")));
+ cfVSLineTag = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat(TEXT("VisualStudioEditorOperationsLineCutCopyClipboardTag")));
+ hrOle = E_FAIL;
+
+ wMain = hwnd;
+
+ dob.sci = this;
+ ds.sci = this;
+ dt.sci = this;
+
+ sysCaretBitmap = 0;
+ sysCaretWidth = 0;
+ sysCaretHeight = 0;
+
+#if defined(USE_D2D)
+ pRenderTarget = 0;
+ renderTargetValid = true;
+#endif
+
+ caret.period = ::GetCaretBlinkTime();
+ if (caret.period < 0)
+ caret.period = 0;
+
+ Initialise();
+}
+
+ScintillaWin::~ScintillaWin() {}
+
+void ScintillaWin::Initialise() {
+ // Initialize COM. If the app has already done this it will have
+ // no effect. If the app hasnt, we really shouldnt ask them to call
+ // it just so this internal feature works.
+ hrOle = ::OleInitialize(NULL);
+
+ // Find TrackMouseEvent which is available on Windows > 95
+ HMODULE user32 = ::GetModuleHandle(TEXT("user32.dll"));
+ if (user32) {
+ TrackMouseEventFn = (TrackMouseEventSig)::GetProcAddress(user32, "TrackMouseEvent");
+ SetCoalescableTimerFn = (SetCoalescableTimerSig)::GetProcAddress(user32, "SetCoalescableTimer");
+ }
+ if (TrackMouseEventFn == NULL) {
+ // Windows 95 has an emulation in comctl32.dll:_TrackMouseEvent
+ if (!commctrl32)
+ commctrl32 = ::LoadLibrary(TEXT("comctl32.dll"));
+ if (commctrl32 != NULL) {
+ TrackMouseEventFn = (TrackMouseEventSig)
+ ::GetProcAddress(commctrl32, "_TrackMouseEvent");
+ }
+ }
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ timers[tr] = 0;
+ }
+ vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourDesired(0, 0, 0xff));
+ vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourDesired(0, 0, 0xff));
+}
+
+void ScintillaWin::Finalise() {
+ ScintillaBase::Finalise();
+ for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
+ FineTickerCancel(tr);
+ }
+ SetIdle(false);
+#if defined(USE_D2D)
+ DropRenderTarget();
+#endif
+ ::RevokeDragDrop(MainHWND());
+ if (SUCCEEDED(hrOle)) {
+ ::OleUninitialize();
+ }
+}
+
+#if defined(USE_D2D)
+
+void ScintillaWin::EnsureRenderTarget(HDC hdc) {
+ if (!renderTargetValid) {
+ DropRenderTarget();
+ renderTargetValid = true;
+ }
+ if (pD2DFactory && !pRenderTarget) {
+ RECT rc;
+ HWND hw = MainHWND();
+ GetClientRect(hw, &rc);
+
+ D2D1_SIZE_U size = D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top);
+
+ // Create a Direct2D render target.
+#if 1
+ D2D1_RENDER_TARGET_PROPERTIES drtp;
+ drtp.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
+ drtp.pixelFormat.format = DXGI_FORMAT_UNKNOWN;
+ drtp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
+ drtp.dpiX = 96.0;
+ drtp.dpiY = 96.0;
+ drtp.usage = D2D1_RENDER_TARGET_USAGE_NONE;
+ drtp.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
+
+ if (technology == SC_TECHNOLOGY_DIRECTWRITEDC) {
+ // Explicit pixel format needed.
+ drtp.pixelFormat = D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM,
+ D2D1_ALPHA_MODE_IGNORE);
+
+ ID2D1DCRenderTarget *pDCRT = NULL;
+ HRESULT hr = pD2DFactory->CreateDCRenderTarget(&drtp, &pDCRT);
+ if (SUCCEEDED(hr)) {
+ pRenderTarget = pDCRT;
+ } else {
+ Platform::DebugPrintf("Failed CreateDCRenderTarget 0x%x\n", hr);
+ pRenderTarget = NULL;
+ }
+
+ } else {
+ D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp;
+ dhrtp.hwnd = hw;
+ dhrtp.pixelSize = size;
+ dhrtp.presentOptions = (technology == SC_TECHNOLOGY_DIRECTWRITERETAIN) ?
+ D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS : D2D1_PRESENT_OPTIONS_NONE;
+
+ ID2D1HwndRenderTarget *pHwndRenderTarget = NULL;
+ HRESULT hr = pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pHwndRenderTarget);
+ if (SUCCEEDED(hr)) {
+ pRenderTarget = pHwndRenderTarget;
+ } else {
+ Platform::DebugPrintf("Failed CreateHwndRenderTarget 0x%x\n", hr);
+ pRenderTarget = NULL;
+ }
+ }
+#else
+ pD2DFactory->CreateHwndRenderTarget(
+ D2D1::RenderTargetProperties(
+ D2D1_RENDER_TARGET_TYPE_DEFAULT ,
+ D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
+ 96.0f, 96.0f, D2D1_RENDER_TARGET_USAGE_NONE, D2D1_FEATURE_LEVEL_DEFAULT),
+ D2D1::HwndRenderTargetProperties(hw, size),
+ &pRenderTarget);
+#endif
+ // Pixmaps were created to be compatible with previous render target so
+ // need to be recreated.
+ DropGraphics(false);
+ }
+
+ if ((technology == SC_TECHNOLOGY_DIRECTWRITEDC) && pRenderTarget) {
+ RECT rcWindow;
+ GetClientRect(MainHWND(), &rcWindow);
+ HRESULT hr = static_cast<ID2D1DCRenderTarget*>(pRenderTarget)->BindDC(hdc, &rcWindow);
+ if (FAILED(hr)) {
+ Platform::DebugPrintf("BindDC failed 0x%x\n", hr);
+ DropRenderTarget();
+ }
+ }
+}
+
+void ScintillaWin::DropRenderTarget() {
+ if (pRenderTarget) {
+ pRenderTarget->Release();
+ pRenderTarget = 0;
+ }
+}
+
+#endif
+
+HWND ScintillaWin::MainHWND() {
+ return reinterpret_cast<HWND>(wMain.GetID());
+}
+
+bool ScintillaWin::DragThreshold(Point ptStart, Point ptNow) {
+ int xMove = static_cast<int>(std::abs(ptStart.x - ptNow.x));
+ int yMove = static_cast<int>(std::abs(ptStart.y - ptNow.y));
+ return (xMove > ::GetSystemMetrics(SM_CXDRAG)) ||
+ (yMove > ::GetSystemMetrics(SM_CYDRAG));
+}
+
+void ScintillaWin::StartDrag() {
+ inDragDrop = ddDragging;
+ DWORD dwEffect = 0;
+ dropWentOutside = true;
+ IDataObject *pDataObject = reinterpret_cast<IDataObject *>(&dob);
+ IDropSource *pDropSource = reinterpret_cast<IDropSource *>(&ds);
+ //Platform::DebugPrintf("About to DoDragDrop %x %x\n", pDataObject, pDropSource);
+ HRESULT hr = ::DoDragDrop(
+ pDataObject,
+ pDropSource,
+ DROPEFFECT_COPY | DROPEFFECT_MOVE, &dwEffect);
+ //Platform::DebugPrintf("DoDragDrop = %x\n", hr);
+ if (SUCCEEDED(hr)) {
+ if ((hr == DRAGDROP_S_DROP) && (dwEffect == DROPEFFECT_MOVE) && dropWentOutside) {
+ // Remove dragged out text
+ ClearSelection();
+ }
+ }
+ inDragDrop = ddNone;
+ SetDragPosition(SelectionPosition(invalidPosition));
+}
+
+// Avoid warnings everywhere for old style casts by concentrating them here
+static WORD LoWord(uptr_t l) {
+ return LOWORD(l);
+}
+
+static WORD HiWord(uptr_t l) {
+ return HIWORD(l);
+}
+
+static int InputCodePage() {
+ HKL inputLocale = ::GetKeyboardLayout(0);
+ LANGID inputLang = LOWORD(inputLocale);
+ char sCodePage[10];
+ int res = ::GetLocaleInfoA(MAKELCID(inputLang, SORT_DEFAULT),
+ LOCALE_IDEFAULTANSICODEPAGE, sCodePage, sizeof(sCodePage));
+ if (!res)
+ return 0;
+ return atoi(sCodePage);
+}
+
+/** Map the key codes to their equivalent SCK_ form. */
+static int KeyTranslate(int keyIn) {
+//PLATFORM_ASSERT(!keyIn);
+ switch (keyIn) {
+ case VK_DOWN: return SCK_DOWN;
+ case VK_UP: return SCK_UP;
+ case VK_LEFT: return SCK_LEFT;
+ case VK_RIGHT: return SCK_RIGHT;
+ case VK_HOME: return SCK_HOME;
+ case VK_END: return SCK_END;
+ case VK_PRIOR: return SCK_PRIOR;
+ case VK_NEXT: return SCK_NEXT;
+ case VK_DELETE: return SCK_DELETE;
+ case VK_INSERT: return SCK_INSERT;
+ case VK_ESCAPE: return SCK_ESCAPE;
+ case VK_BACK: return SCK_BACK;
+ case VK_TAB: return SCK_TAB;
+ case VK_RETURN: return SCK_RETURN;
+ case VK_ADD: return SCK_ADD;
+ case VK_SUBTRACT: return SCK_SUBTRACT;
+ case VK_DIVIDE: return SCK_DIVIDE;
+ case VK_LWIN: return SCK_WIN;
+ case VK_RWIN: return SCK_RWIN;
+ case VK_APPS: return SCK_MENU;
+ case VK_OEM_2: return '/';
+ case VK_OEM_3: return '`';
+ case VK_OEM_4: return '[';
+ case VK_OEM_5: return '\\';
+ case VK_OEM_6: return ']';
+ default: return keyIn;
+ }
+}
+
+static bool BoundsContains(PRectangle rcBounds, HRGN hRgnBounds, PRectangle rcCheck) {
+ bool contains = true;
+ if (!rcCheck.Empty()) {
+ if (!rcBounds.Contains(rcCheck)) {
+ contains = false;
+ } else if (hRgnBounds) {
+ // In bounding rectangle so check more accurately using region
+ HRGN hRgnCheck = ::CreateRectRgn(static_cast<int>(rcCheck.left), static_cast<int>(rcCheck.top),
+ static_cast<int>(rcCheck.right), static_cast<int>(rcCheck.bottom));
+ if (hRgnCheck) {
+ HRGN hRgnDifference = ::CreateRectRgn(0, 0, 0, 0);
+ if (hRgnDifference) {
+ int combination = ::CombineRgn(hRgnDifference, hRgnCheck, hRgnBounds, RGN_DIFF);
+ if (combination != NULLREGION) {
+ contains = false;
+ }
+ ::DeleteRgn(hRgnDifference);
+ }
+ ::DeleteRgn(hRgnCheck);
+ }
+ }
+ }
+ return contains;
+}
+
+// Returns the target converted to UTF8.
+// Return the length in bytes.
+int ScintillaWin::TargetAsUTF8(char *text) {
+ int targetLength = targetEnd - targetStart;
+ if (IsUnicodeMode()) {
+ if (text) {
+ pdoc->GetCharRange(text, targetStart, targetLength);
+ }
+ } else {
+ // Need to convert
+ std::string s = RangeText(targetStart, targetEnd);
+ int charsLen = ::MultiByteToWideChar(CodePageOfDocument(), 0, &s[0], targetLength, NULL, 0);
+ std::wstring characters(charsLen, '\0');
+ ::MultiByteToWideChar(CodePageOfDocument(), 0, &s[0], targetLength, &characters[0], charsLen);
+
+ int utf8Len = ::WideCharToMultiByte(CP_UTF8, 0, &characters[0], charsLen, NULL, 0, 0, 0);
+ if (text) {
+ ::WideCharToMultiByte(CP_UTF8, 0, &characters[0], charsLen, text, utf8Len, 0, 0);
+ text[utf8Len] = '\0';
+ }
+ return utf8Len;
+ }
+ return targetLength;
+}
+
+// Translates a nul terminated UTF8 string into the document encoding.
+// Return the length of the result in bytes.
+int ScintillaWin::EncodedFromUTF8(char *utf8, char *encoded) const {
+ int inputLength = (lengthForEncode >= 0) ? lengthForEncode : static_cast<int>(strlen(utf8));
+ if (IsUnicodeMode()) {
+ if (encoded) {
+ memcpy(encoded, utf8, inputLength);
+ }
+ return inputLength;
+ } else {
+ // Need to convert
+ int charsLen = ::MultiByteToWideChar(CP_UTF8, 0, utf8, inputLength, NULL, 0);
+ std::wstring characters(charsLen, '\0');
+ ::MultiByteToWideChar(CP_UTF8, 0, utf8, inputLength, &characters[0], charsLen);
+
+ int encodedLen = ::WideCharToMultiByte(CodePageOfDocument(),
+ 0, &characters[0], charsLen, NULL, 0, 0, 0);
+ if (encoded) {
+ ::WideCharToMultiByte(CodePageOfDocument(), 0, &characters[0], charsLen, encoded, encodedLen, 0, 0);
+ encoded[encodedLen] = '\0';
+ }
+ return encodedLen;
+ }
+}
+
+LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
+ //ElapsedTime et;
+
+ // Redirect assertions to debug output and save current state
+ bool assertsPopup = Platform::ShowAssertionPopUps(false);
+ paintState = painting;
+ PAINTSTRUCT ps;
+ PAINTSTRUCT *pps;
+
+ bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains
+ // a PAINSTRUCT* from the OCX
+ // Removed since this interferes with reporting other assertions as it occurs repeatedly
+ //PLATFORM_ASSERT(hRgnUpdate == NULL);
+ hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0);
+ if (IsOcxCtrl) {
+ pps = reinterpret_cast<PAINTSTRUCT*>(wParam);
+ } else {
+ ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE);
+ pps = &ps;
+ ::BeginPaint(MainHWND(), pps);
+ }
+ rcPaint = PRectangle::FromInts(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom);
+ PRectangle rcClient = GetClientRectangle();
+ paintingAllText = BoundsContains(rcPaint, hRgnUpdate, rcClient);
+ if (technology == SC_TECHNOLOGY_DEFAULT) {
+ AutoSurface surfaceWindow(pps->hdc, this);
+ if (surfaceWindow) {
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ }
+ } else {
+#if defined(USE_D2D)
+ EnsureRenderTarget(pps->hdc);
+ AutoSurface surfaceWindow(pRenderTarget, this);
+ if (surfaceWindow) {
+ pRenderTarget->BeginDraw();
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ HRESULT hr = pRenderTarget->EndDraw();
+ if (hr == D2DERR_RECREATE_TARGET) {
+ DropRenderTarget();
+ paintState = paintAbandoned;
+ }
+ }
+#endif
+ }
+ if (hRgnUpdate) {
+ ::DeleteRgn(hRgnUpdate);
+ hRgnUpdate = 0;
+ }
+
+ if (!IsOcxCtrl)
+ ::EndPaint(MainHWND(), pps);
+ if (paintState == paintAbandoned) {
+ // Painting area was insufficient to cover new styling or brace highlight positions
+ if (IsOcxCtrl) {
+ FullPaintDC(pps->hdc);
+ } else {
+ FullPaint();
+ }
+ }
+ paintState = notPainting;
+
+ // Restore debug output state
+ Platform::ShowAssertionPopUps(assertsPopup);
+
+ //Platform::DebugPrintf("Paint took %g\n", et.Duration());
+ return 0l;
+}
+
+sptr_t ScintillaWin::HandleCompositionWindowed(uptr_t wParam, sptr_t lParam) {
+ if (lParam & GCS_RESULTSTR) {
+ HIMC hIMC = ::ImmGetContext(MainHWND());
+ if (hIMC) {
+ wchar_t wcs[maxLenInputIME];
+ LONG bytes = ::ImmGetCompositionStringW(hIMC,
+ GCS_RESULTSTR, wcs, (maxLenInputIME-1)*2);
+ int wides = bytes / 2;
+ if (IsUnicodeMode()) {
+ char utfval[maxLenInputIME * 3];
+ unsigned int len = UTF8Length(wcs, wides);
+ UTF8FromUTF16(wcs, wides, utfval, len);
+ utfval[len] = '\0';
+ AddCharUTF(utfval, len);
+ } else {
+ char dbcsval[maxLenInputIME * 2];
+ int size = ::WideCharToMultiByte(InputCodePage(),
+ 0, wcs, wides, dbcsval, sizeof(dbcsval) - 1, 0, 0);
+ for (int i=0; i<size; i++) {
+ AddChar(dbcsval[i]);
+ }
+ }
+ // Set new position after converted
+ Point pos = PointMainCaret();
+ COMPOSITIONFORM CompForm;
+ CompForm.dwStyle = CFS_POINT;
+ CompForm.ptCurrentPos.x = static_cast<int>(pos.x);
+ CompForm.ptCurrentPos.y = static_cast<int>(pos.y);
+ ::ImmSetCompositionWindow(hIMC, &CompForm);
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ }
+ return 0;
+ }
+ return ::DefWindowProc(MainHWND(), WM_IME_COMPOSITION, wParam, lParam);
+}
+
+bool ScintillaWin::KoreanIME() {
+ const int codePage = InputCodePage();
+ return codePage == 949 || codePage == 1361;
+}
+
+void ScintillaWin::MoveImeCarets(int offset) {
+ // Move carets relatively by bytes.
+ for (size_t r=0; r<sel.Count(); r++) {
+ int positionInsert = sel.Range(r).Start().Position();
+ sel.Range(r).caret.SetPosition(positionInsert + offset);
+ sel.Range(r).anchor.SetPosition(positionInsert + offset);
+ }
+}
+
+void ScintillaWin::DrawImeIndicator(int indicator, int len) {
+ // Emulate the visual style of IME characters with indicators.
+ // Draw an indicator on the character before caret by the character bytes of len
+ // so it should be called after addCharUTF().
+ // It does not affect caret positions.
+ if (indicator < 8 || indicator > INDIC_MAX) {
+ return;
+ }
+ pdoc->decorations.SetCurrentIndicator(indicator);
+ for (size_t r=0; r<sel.Count(); r++) {
+ int positionInsert = sel.Range(r).Start().Position();
+ pdoc->DecorationFillRange(positionInsert - len, 1, len);
+ }
+}
+
+void ScintillaWin::SetCandidateWindowPos() {
+ HIMC hIMC = ::ImmGetContext(MainHWND());
+ if (hIMC) {
+ Point pos = PointMainCaret();
+ CANDIDATEFORM CandForm;
+ CandForm.dwIndex = 0;
+ CandForm.dwStyle = CFS_CANDIDATEPOS;
+ CandForm.ptCurrentPos.x = static_cast<int>(pos.x);
+ CandForm.ptCurrentPos.y = static_cast<int>(pos.y + vs.lineHeight);
+ ::ImmSetCandidateWindow(hIMC, &CandForm);
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ }
+}
+
+static std::string StringEncode(std::wstring s, int codePage) {
+ if (s.length()) {
+ int cchMulti = ::WideCharToMultiByte(codePage, 0, s.c_str(), static_cast<int>(s.length()), NULL, 0, NULL, NULL);
+ std::string sMulti(cchMulti, 0);
+ ::WideCharToMultiByte(codePage, 0, s.c_str(), static_cast<int>(s.size()), &sMulti[0], cchMulti, NULL, NULL);
+ return sMulti;
+ } else {
+ return std::string();
+ }
+}
+
+static std::wstring StringDecode(std::string s, int codePage) {
+ if (s.length()) {
+ int cchWide = ::MultiByteToWideChar(codePage, 0, s.c_str(), static_cast<int>(s.length()), NULL, 0);
+ std::wstring sWide(cchWide, 0);
+ ::MultiByteToWideChar(codePage, 0, s.c_str(), static_cast<int>(s.length()), &sWide[0], cchWide);
+ return sWide;
+ } else {
+ return std::wstring();
+ }
+}
+
+void ScintillaWin::SelectionToHangul() {
+ // Convert every hanja to hangul within the main range.
+ const int selStart = sel.RangeMain().Start().Position();
+ const int documentStrLen = sel.RangeMain().Length();
+ const int selEnd = selStart + documentStrLen;
+ const int utf16Len = pdoc->CountUTF16(selStart, selEnd);
+
+ if (utf16Len > 0) {
+ std::string documentStr(documentStrLen, '\0');
+ pdoc->GetCharRange(&documentStr[0], selStart, documentStrLen);
+
+ std::wstring uniStr = StringDecode(documentStr, CodePageOfDocument());
+ int converted = HanjaDict::GetHangulOfHanja(&uniStr[0]);
+ documentStr = StringEncode(uniStr, CodePageOfDocument());
+
+ if (converted > 0) {
+ pdoc->BeginUndoAction();
+ ClearSelection();
+ InsertPaste(&documentStr[0], static_cast<int>(documentStr.size()));
+ pdoc->EndUndoAction();
+ }
+ }
+}
+
+void ScintillaWin::EscapeHanja() {
+ // The candidate box pops up to user to select a hanja.
+ // It comes into WM_IME_COMPOSITION with GCS_RESULTSTR.
+ // The existing hangul or hanja is replaced with it.
+ if (sel.Count() > 1) {
+ return; // Do not allow multi carets.
+ }
+ int currentPos = CurrentPosition();
+ int oneCharLen = pdoc->LenChar(currentPos);
+
+ if (oneCharLen < 2) {
+ return; // No need to handle SBCS.
+ }
+
+ // ImmEscapeW() may overwrite uniChar[] with a null terminated string.
+ // So enlarge it enough to Maximum 4 as in UTF-8.
+ unsigned int const safeLength = UTF8MaxBytes+1;
+ std::string oneChar(safeLength, '\0');
+ pdoc->GetCharRange(&oneChar[0], currentPos, oneCharLen);
+
+ std::wstring uniChar = StringDecode(oneChar, CodePageOfDocument());
+
+ HIMC hIMC=ImmGetContext(MainHWND());
+ if (hIMC) {
+ // Set the candidate box position since IME may show it.
+ SetCandidateWindowPos();
+ // IME_ESC_HANJA_MODE appears to receive the first character only.
+ if (ImmEscapeW(GetKeyboardLayout(0), hIMC, IME_ESC_HANJA_MODE, &uniChar[0])) {
+ SetSelection (currentPos, currentPos + oneCharLen);
+ }
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ }
+}
+
+void ScintillaWin::ToggleHanja() {
+ // If selection, convert every hanja to hangul within the main range.
+ // If no selection, commit to IME.
+ if (sel.Count() > 1) {
+ return; // Do not allow multi carets.
+ }
+
+ if (sel.Empty()) {
+ EscapeHanja();
+ } else {
+ SelectionToHangul();
+ }
+}
+
+sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
+ // Copy & paste by johnsonj with a lot of helps of Neil.
+ // Great thanks for my foreruners, jiniya and BLUEnLIVE.
+
+ HIMC hIMC = ::ImmGetContext(MainHWND());
+ if (!hIMC) {
+ return 0;
+ }
+
+ if (pdoc->TentativeActive()) {
+ pdoc->TentativeUndo();
+ } else {
+ // No tentative undo means start of this composition so
+ // fill in any virtual spaces.
+ FillVirtualSpace();
+ }
+
+ view.imeCaretBlockOverride = false;
+
+ if (lParam & GCS_COMPSTR) {
+ wchar_t wcs[maxLenInputIME] = { 0 };
+ long bytes = ::ImmGetCompositionStringW
+ (hIMC, GCS_COMPSTR, wcs, maxLenInputIME);
+ unsigned int wcsLen = bytes / 2;
+
+ if ((wcsLen == 0) || (wcsLen >= maxLenInputIME)) {
+ ShowCaretAtCurrentPosition();
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ return 0;
+ }
+
+ pdoc->TentativeStart(); // TentativeActive from now on.
+
+ // Get attribute information from composition string.
+ BYTE compAttr[maxLenInputIME] = { 0 };
+ unsigned int imeCursorPos = 0;
+
+ if (lParam & GCS_COMPATTR) {
+ ImmGetCompositionStringW(hIMC, GCS_COMPATTR, compAttr, sizeof(compAttr));
+ }
+ if (lParam & GCS_CURSORPOS) {
+ imeCursorPos = ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, NULL, 0);
+ }
+
+ // Display character by character.
+ int numBytes = 0;
+ int imeCharPos[maxLenInputIME + 1] = { 0 };
+
+ bool tmpRecordingMacro = recordingMacro;
+ recordingMacro = false;
+ for (size_t i = 0; i < wcsLen; ) {
+ const size_t ucWidth = UTF16CharLength(wcs[i]);
+ const std::wstring uniChar(wcs+i, ucWidth);
+ char oneChar[UTF8MaxBytes + 1] = "\0\0\0\0"; // Maximum 4 bytes in utf8
+ unsigned int oneCharLen = 0;
+
+ if (IsUnicodeMode()) {
+ oneCharLen = UTF8Length(uniChar.c_str(), static_cast<unsigned int>(uniChar.length()));
+ UTF8FromUTF16(uniChar.c_str(), static_cast<unsigned int>(uniChar.length()), oneChar, oneCharLen);
+ } else {
+ oneCharLen = ::WideCharToMultiByte(InputCodePage(), 0,
+ uniChar.c_str(), static_cast<unsigned int>(uniChar.length()), oneChar, sizeof(oneChar)-1, 0, 0);
+ }
+ oneChar[oneCharLen] = '\0';
+
+ // Display a character.
+ AddCharUTF(oneChar, oneCharLen);
+
+ // Record compstr character positions for moving IME carets.
+ numBytes += oneCharLen;
+ imeCharPos[i + 1] = numBytes;
+
+ // Draw an indicator on the character.
+ int indicator = SC_INDICATOR_UNKNOWN;
+ switch ((int)compAttr[i]) {
+ case ATTR_INPUT:
+ indicator = SC_INDICATOR_INPUT;
+ break;
+ case ATTR_TARGET_NOTCONVERTED:
+ case ATTR_TARGET_CONVERTED:
+ indicator = SC_INDICATOR_TARGET;
+ break;
+ case ATTR_CONVERTED:
+ indicator = SC_INDICATOR_CONVERTED;
+ break;
+ }
+ DrawImeIndicator(indicator, oneCharLen);
+ i += ucWidth;
+ }
+ recordingMacro = tmpRecordingMacro;
+
+ // Move IME caret position.
+ MoveImeCarets(-imeCharPos[wcsLen] + imeCharPos[imeCursorPos]);
+ if (KoreanIME()) {
+ view.imeCaretBlockOverride = true;
+ }
+ } else if (lParam & GCS_RESULTSTR) {
+ wchar_t wcs[maxLenInputIME] = { 0 };
+ long bytes = ::ImmGetCompositionStringW
+ (hIMC, GCS_RESULTSTR, wcs, maxLenInputIME);
+ unsigned int wcsLen = bytes / 2;
+
+ for (size_t i = 0; i < wcsLen;) {
+ const size_t ucWidth = UTF16CharLength(wcs[i]);
+ const std::wstring uniChar(wcs+i, ucWidth);
+ char oneChar[UTF8MaxBytes+1] = "\0\0\0\0"; // Maximum 4 bytes in UTF-8.
+ unsigned int oneCharLen = 0;
+
+ if (IsUnicodeMode()) {
+ oneCharLen = UTF8Length(uniChar.c_str(), static_cast<unsigned int>(uniChar.length()));
+ UTF8FromUTF16(uniChar.c_str(), static_cast<unsigned int>(uniChar.length()), oneChar, oneCharLen);
+ } else {
+ oneCharLen = ::WideCharToMultiByte(InputCodePage(), 0,
+ uniChar.c_str(), static_cast<unsigned int>(uniChar.length()), oneChar, sizeof(oneChar)-1, 0, 0);
+ }
+ oneChar[oneCharLen] = '\0';
+ AddCharUTF(oneChar, oneCharLen);
+ i += ucWidth;
+ }
+ }
+ SetCandidateWindowPos();
+ ShowCaretAtCurrentPosition();
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ return 0;
+}
+
+// Translate message IDs from WM_* and EM_* to SCI_* so can partly emulate Windows Edit control
+static unsigned int SciMessageFromEM(unsigned int iMessage) {
+ switch (iMessage) {
+ case EM_CANPASTE: return SCI_CANPASTE;
+ case EM_CANUNDO: return SCI_CANUNDO;
+ case EM_EMPTYUNDOBUFFER: return SCI_EMPTYUNDOBUFFER;
+ case EM_FINDTEXTEX: return SCI_FINDTEXT;
+ case EM_FORMATRANGE: return SCI_FORMATRANGE;
+ case EM_GETFIRSTVISIBLELINE: return SCI_GETFIRSTVISIBLELINE;
+ case EM_GETLINECOUNT: return SCI_GETLINECOUNT;
+ case EM_GETSELTEXT: return SCI_GETSELTEXT;
+ case EM_GETTEXTRANGE: return SCI_GETTEXTRANGE;
+ case EM_HIDESELECTION: return SCI_HIDESELECTION;
+ case EM_LINEINDEX: return SCI_POSITIONFROMLINE;
+ case EM_LINESCROLL: return SCI_LINESCROLL;
+ case EM_REPLACESEL: return SCI_REPLACESEL;
+ case EM_SCROLLCARET: return SCI_SCROLLCARET;
+ case EM_SETREADONLY: return SCI_SETREADONLY;
+ case WM_CLEAR: return SCI_CLEAR;
+ case WM_COPY: return SCI_COPY;
+ case WM_CUT: return SCI_CUT;
+ case WM_SETTEXT: return SCI_SETTEXT;
+ case WM_PASTE: return SCI_PASTE;
+ case WM_UNDO: return SCI_UNDO;
+ }
+ return iMessage;
+}
+
+UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage) {
+ if (documentCodePage == SC_CP_UTF8) {
+ return SC_CP_UTF8;
+ }
+ switch (characterSet) {
+ case SC_CHARSET_ANSI: return 1252;
+ case SC_CHARSET_DEFAULT: return documentCodePage;
+ case SC_CHARSET_BALTIC: return 1257;
+ case SC_CHARSET_CHINESEBIG5: return 950;
+ case SC_CHARSET_EASTEUROPE: return 1250;
+ case SC_CHARSET_GB2312: return 936;
+ case SC_CHARSET_GREEK: return 1253;
+ case SC_CHARSET_HANGUL: return 949;
+ case SC_CHARSET_MAC: return 10000;
+ case SC_CHARSET_OEM: return 437;
+ case SC_CHARSET_RUSSIAN: return 1251;
+ case SC_CHARSET_SHIFTJIS: return 932;
+ case SC_CHARSET_TURKISH: return 1254;
+ case SC_CHARSET_JOHAB: return 1361;
+ case SC_CHARSET_HEBREW: return 1255;
+ case SC_CHARSET_ARABIC: return 1256;
+ case SC_CHARSET_VIETNAMESE: return 1258;
+ case SC_CHARSET_THAI: return 874;
+ case SC_CHARSET_8859_15: return 28605;
+ // Not supported
+ case SC_CHARSET_CYRILLIC: return documentCodePage;
+ case SC_CHARSET_SYMBOL: return documentCodePage;
+ }
+ return documentCodePage;
+}
+
+UINT ScintillaWin::CodePageOfDocument() const {
+ return CodePageFromCharSet(vs.styles[STYLE_DEFAULT].characterSet, pdoc->dbcsCodePage);
+}
+
+sptr_t ScintillaWin::GetTextLength() {
+ if (pdoc->Length() == 0)
+ return 0;
+ std::vector<char> docBytes(pdoc->Length(), '\0');
+ pdoc->GetCharRange(&docBytes[0], 0, pdoc->Length());
+ if (IsUnicodeMode()) {
+ return UTF16Length(&docBytes[0], static_cast<unsigned int>(docBytes.size()));
+ } else {
+ return ::MultiByteToWideChar(CodePageOfDocument(), 0, &docBytes[0],
+ static_cast<int>(docBytes.size()), NULL, 0);
+ }
+}
+
+sptr_t ScintillaWin::GetText(uptr_t wParam, sptr_t lParam) {
+ wchar_t *ptr = reinterpret_cast<wchar_t *>(lParam);
+ if (pdoc->Length() == 0) {
+ *ptr = L'\0';
+ return 0;
+ }
+ std::vector<char> docBytes(pdoc->Length(), '\0');
+ pdoc->GetCharRange(&docBytes[0], 0, pdoc->Length());
+ if (IsUnicodeMode()) {
+ size_t lengthUTF16 = UTF16Length(&docBytes[0], static_cast<unsigned int>(docBytes.size()));
+ if (lParam == 0)
+ return lengthUTF16;
+ if (wParam == 0)
+ return 0;
+ size_t uLen = UTF16FromUTF8(&docBytes[0], docBytes.size(),
+ ptr, static_cast<int>(wParam) - 1);
+ ptr[uLen] = L'\0';
+ return uLen;
+ } else {
+ // Not Unicode mode
+ // Convert to Unicode using the current Scintilla code page
+ const UINT cpSrc = CodePageOfDocument();
+ int lengthUTF16 = ::MultiByteToWideChar(cpSrc, 0, &docBytes[0],
+ static_cast<int>(docBytes.size()), NULL, 0);
+ if (lengthUTF16 >= static_cast<int>(wParam))
+ lengthUTF16 = static_cast<int>(wParam)-1;
+ ::MultiByteToWideChar(cpSrc, 0, &docBytes[0],
+ static_cast<int>(docBytes.size()),
+ ptr, lengthUTF16);
+ ptr[lengthUTF16] = L'\0';
+ return lengthUTF16;
+ }
+}
+
+sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ try {
+ //Platform::DebugPrintf("S M:%x WP:%x L:%x\n", iMessage, wParam, lParam);
+ iMessage = SciMessageFromEM(iMessage);
+ switch (iMessage) {
+
+ case WM_CREATE:
+ ctrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(wMain.GetID()));
+ // Get Intellimouse scroll line parameters
+ GetIntelliMouseParameters();
+ ::RegisterDragDrop(MainHWND(), reinterpret_cast<IDropTarget *>(&dt));
+ break;
+
+ case WM_COMMAND:
+ Command(LoWord(wParam));
+ break;
+
+ case WM_PAINT:
+ return WndPaint(wParam);
+
+ case WM_PRINTCLIENT: {
+ HDC hdc = reinterpret_cast<HDC>(wParam);
+ if (!IsCompatibleDC(hdc)) {
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+ FullPaintDC(hdc);
+ }
+ break;
+
+ case WM_VSCROLL:
+ ScrollMessage(wParam);
+ break;
+
+ case WM_HSCROLL:
+ HorizontalScrollMessage(wParam);
+ break;
+
+ case WM_SIZE: {
+#if defined(USE_D2D)
+ if (paintState == notPainting) {
+ DropRenderTarget();
+ } else {
+ renderTargetValid = false;
+ }
+#endif
+ //Platform::DebugPrintf("Scintilla WM_SIZE %d %d\n", LoWord(lParam), HiWord(lParam));
+ ChangeSize();
+ }
+ break;
+
+ case WM_MOUSEWHEEL:
+ // if autocomplete list active then send mousewheel message to it
+ if (ac.Active()) {
+ HWND hWnd = reinterpret_cast<HWND>(ac.lb->GetID());
+ ::SendMessage(hWnd, iMessage, wParam, lParam);
+ break;
+ }
+
+ // Don't handle datazoom.
+ // (A good idea for datazoom would be to "fold" or "unfold" details.
+ // i.e. if datazoomed out only class structures are visible, when datazooming in the control
+ // structures appear, then eventually the individual statements...)
+ if (wParam & MK_SHIFT) {
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+
+ // Either SCROLL or ZOOM. We handle the wheel steppings calculation
+ wheelDelta -= static_cast<short>(HiWord(wParam));
+ if (abs(wheelDelta) >= WHEEL_DELTA && linesPerScroll > 0) {
+ int linesToScroll = linesPerScroll;
+ if (linesPerScroll == WHEEL_PAGESCROLL)
+ linesToScroll = LinesOnScreen() - 1;
+ if (linesToScroll == 0) {
+ linesToScroll = 1;
+ }
+ linesToScroll *= (wheelDelta / WHEEL_DELTA);
+ if (wheelDelta >= 0)
+ wheelDelta = wheelDelta % WHEEL_DELTA;
+ else
+ wheelDelta = - (-wheelDelta % WHEEL_DELTA);
+
+ if (wParam & MK_CONTROL) {
+ // Zoom! We play with the font sizes in the styles.
+ // Number of steps/line is ignored, we just care if sizing up or down
+ if (linesToScroll < 0) {
+ KeyCommand(SCI_ZOOMIN);
+ } else {
+ KeyCommand(SCI_ZOOMOUT);
+ }
+ } else {
+ // Scroll
+ ScrollTo(topLine + linesToScroll);
+ }
+ }
+ return 0;
+
+ case WM_TIMER:
+ if (wParam == idleTimerID && idler.state) {
+ SendMessage(MainHWND(), SC_WIN_IDLE, 0, 1);
+ } else {
+ TickFor(static_cast<TickReason>(wParam - fineTimerStart));
+ }
+ break;
+
+ case SC_WIN_IDLE:
+ // wParam=dwTickCountInitial, or 0 to initialize. lParam=bSkipUserInputTest
+ if (idler.state) {
+ if (lParam || (WAIT_TIMEOUT == MsgWaitForMultipleObjects(0, 0, 0, 0, QS_INPUT|QS_HOTKEY))) {
+ if (Idle()) {
+ // User input was given priority above, but all events do get a turn. Other
+ // messages, notifications, etc. will get interleaved with the idle messages.
+
+ // However, some things like WM_PAINT are a lower priority, and will not fire
+ // when there's a message posted. So, several times a second, we stop and let
+ // the low priority events have a turn (after which the timer will fire again).
+
+ DWORD dwCurrent = GetTickCount();
+ DWORD dwStart = wParam ? static_cast<DWORD>(wParam) : dwCurrent;
+ const DWORD maxWorkTime = 50;
+
+ if (dwCurrent >= dwStart && dwCurrent > maxWorkTime && dwCurrent - maxWorkTime < dwStart)
+ PostMessage(MainHWND(), SC_WIN_IDLE, dwStart, 0);
+ } else {
+ SetIdle(false);
+ }
+ }
+ }
+ break;
+
+ case WM_GETMINMAXINFO:
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_LBUTTONDOWN: {
+ // For IME, set the composition string as the result string.
+ HIMC hIMC = ::ImmGetContext(MainHWND());
+ ::ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ //
+ //Platform::DebugPrintf("Buttdown %d %x %x %x %x %x\n",iMessage, wParam, lParam,
+ // Platform::IsKeyDown(VK_SHIFT),
+ // Platform::IsKeyDown(VK_CONTROL),
+ // Platform::IsKeyDown(VK_MENU));
+ ::SetFocus(MainHWND());
+ ButtonDown(Point::FromLong(static_cast<long>(lParam)), ::GetMessageTime(),
+ (wParam & MK_SHIFT) != 0,
+ (wParam & MK_CONTROL) != 0,
+ Platform::IsKeyDown(VK_MENU));
+ }
+ break;
+
+ case WM_MOUSEMOVE: {
+ const Point pt = Point::FromLong(static_cast<long>(lParam));
+
+ // Windows might send WM_MOUSEMOVE even though the mouse has not been moved:
+ // http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
+ if (ptMouseLast.x != pt.x || ptMouseLast.y != pt.y) {
+ SetTrackMouseLeaveEvent(true);
+ ButtonMoveWithModifiers(pt,
+ ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) |
+ ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) |
+ (Platform::IsKeyDown(VK_MENU) ? SCI_ALT : 0));
+ }
+ }
+ break;
+
+ case WM_MOUSELEAVE:
+ SetTrackMouseLeaveEvent(false);
+ MouseLeave();
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_LBUTTONUP:
+ ButtonUp(Point::FromLong(static_cast<long>(lParam)),
+ ::GetMessageTime(),
+ (wParam & MK_CONTROL) != 0);
+ break;
+
+ case WM_RBUTTONDOWN:
+ ::SetFocus(MainHWND());
+ if (!PointInSelection(Point::FromLong(static_cast<long>(lParam)))) {
+ CancelModes();
+ SetEmptySelection(PositionFromLocation(Point::FromLong(static_cast<long>(lParam))));
+ }
+ break;
+
+ case WM_SETCURSOR:
+ if (LoWord(lParam) == HTCLIENT) {
+ if (inDragDrop == ddDragging) {
+ DisplayCursor(Window::cursorUp);
+ } else {
+ // Display regular (drag) cursor over selection
+ POINT pt;
+ if (0 != ::GetCursorPos(&pt)) {
+ ::ScreenToClient(MainHWND(), &pt);
+ if (PointInSelMargin(PointFromPOINT(pt))) {
+ DisplayCursor(GetMarginCursor(PointFromPOINT(pt)));
+ } else if (PointInSelection(PointFromPOINT(pt)) && !SelectionEmpty()) {
+ DisplayCursor(Window::cursorArrow);
+ } else if (PointIsHotspot(PointFromPOINT(pt))) {
+ DisplayCursor(Window::cursorHand);
+ } else {
+ DisplayCursor(Window::cursorText);
+ }
+ }
+ }
+ return TRUE;
+ } else {
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+
+ case WM_CHAR:
+ if (((wParam >= 128) || !iscntrl(static_cast<int>(wParam))) || !lastKeyDownConsumed) {
+ wchar_t wcs[2] = {static_cast<wchar_t>(wParam), 0};
+ if (IsUnicodeMode()) {
+ // For a wide character version of the window:
+ char utfval[UTF8MaxBytes];
+ unsigned int len = UTF8Length(wcs, 1);
+ UTF8FromUTF16(wcs, 1, utfval, len);
+ AddCharUTF(utfval, len);
+ } else {
+ UINT cpDest = CodePageOfDocument();
+ char inBufferCP[20];
+ int size = ::WideCharToMultiByte(cpDest,
+ 0, wcs, 1, inBufferCP, sizeof(inBufferCP) - 1, 0, 0);
+ inBufferCP[size] = '\0';
+ AddCharUTF(inBufferCP, size);
+ }
+ }
+ return 0;
+
+ case WM_UNICHAR:
+ if (wParam == UNICODE_NOCHAR) {
+ return IsUnicodeMode() ? 1 : 0;
+ } else if (lastKeyDownConsumed) {
+ return 1;
+ } else {
+ if (IsUnicodeMode()) {
+ char utfval[UTF8MaxBytes];
+ wchar_t wcs[2] = {static_cast<wchar_t>(wParam), 0};
+ unsigned int len = UTF8Length(wcs, 1);
+ UTF8FromUTF16(wcs, 1, utfval, len);
+ AddCharUTF(utfval, len);
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN: {
+ //Platform::DebugPrintf("S keydown %d %x %x %x %x\n",iMessage, wParam, lParam, ::IsKeyDown(VK_SHIFT), ::IsKeyDown(VK_CONTROL));
+ lastKeyDownConsumed = false;
+ int ret = KeyDown(KeyTranslate(static_cast<int>(wParam)),
+ Platform::IsKeyDown(VK_SHIFT),
+ Platform::IsKeyDown(VK_CONTROL),
+ Platform::IsKeyDown(VK_MENU),
+ &lastKeyDownConsumed);
+ if (!ret && !lastKeyDownConsumed) {
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+ break;
+ }
+
+ case WM_IME_KEYDOWN: {
+ if (wParam == VK_HANJA) {
+ ToggleHanja();
+ }
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+
+ case WM_KEYUP:
+ //Platform::DebugPrintf("S keyup %d %x %x\n",iMessage, wParam, lParam);
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_SETTINGCHANGE:
+ //Platform::DebugPrintf("Setting Changed\n");
+ InvalidateStyleData();
+ // Get Intellimouse scroll line parameters
+ GetIntelliMouseParameters();
+ break;
+
+ case WM_GETDLGCODE:
+ return DLGC_HASSETSEL | DLGC_WANTALLKEYS;
+
+ case WM_KILLFOCUS: {
+ HWND wOther = reinterpret_cast<HWND>(wParam);
+ HWND wThis = MainHWND();
+ HWND wCT = reinterpret_cast<HWND>(ct.wCallTip.GetID());
+ if (!wParam ||
+ !(::IsChild(wThis, wOther) || (wOther == wCT))) {
+ SetFocusState(false);
+ DestroySystemCaret();
+ }
+ // Explicitly complete any IME composition
+ HIMC hIMC = ImmGetContext(MainHWND());
+ if (hIMC) {
+ ::ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ }
+ }
+ break;
+
+ case WM_SETFOCUS:
+ SetFocusState(true);
+ DestroySystemCaret();
+ CreateSystemCaret();
+ break;
+
+ case WM_SYSCOLORCHANGE:
+ //Platform::DebugPrintf("Setting Changed\n");
+ InvalidateStyleData();
+ break;
+
+ case WM_IME_STARTCOMPOSITION: // dbcs
+ if (KoreanIME() || imeInteraction == imeInline) {
+ return 0;
+ } else {
+ ImeStartComposition();
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+
+ case WM_IME_ENDCOMPOSITION: // dbcs
+ ImeEndComposition();
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_IME_COMPOSITION:
+ if (KoreanIME() || imeInteraction == imeInline) {
+ return HandleCompositionInline(wParam, lParam);
+ } else {
+ return HandleCompositionWindowed(wParam, lParam);
+ }
+
+ case WM_CONTEXTMENU:
+ if (displayPopupMenu) {
+ Point pt = Point::FromLong(static_cast<long>(lParam));
+ if ((pt.x == -1) && (pt.y == -1)) {
+ // Caused by keyboard so display menu near caret
+ pt = PointMainCaret();
+ POINT spt = {static_cast<int>(pt.x), static_cast<int>(pt.y)};
+ ::ClientToScreen(MainHWND(), &spt);
+ pt = PointFromPOINT(spt);
+ }
+ ContextMenu(pt);
+ return 0;
+ }
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_INPUTLANGCHANGE:
+ //::SetThreadLocale(LOWORD(lParam));
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_INPUTLANGCHANGEREQUEST:
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_ERASEBKGND:
+ return 1; // Avoid any background erasure as whole window painted.
+
+ case WM_CAPTURECHANGED:
+ capturedMouse = false;
+ return 0;
+
+ case WM_IME_SETCONTEXT:
+ if (KoreanIME() || imeInteraction == imeInline) {
+ if (wParam) {
+ LPARAM NoImeWin = lParam;
+ NoImeWin = NoImeWin & (~ISC_SHOWUICOMPOSITIONWINDOW);
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, NoImeWin);
+ }
+ }
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ // These are not handled in Scintilla and its faster to dispatch them here.
+ // Also moves time out to here so profile doesn't count lots of empty message calls.
+
+ case WM_MOVE:
+ case WM_MOUSEACTIVATE:
+ case WM_NCHITTEST:
+ case WM_NCCALCSIZE:
+ case WM_NCPAINT:
+ case WM_NCMOUSEMOVE:
+ case WM_NCLBUTTONDOWN:
+ case WM_IME_NOTIFY:
+ case WM_SYSCOMMAND:
+ case WM_WINDOWPOSCHANGING:
+ case WM_WINDOWPOSCHANGED:
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+
+ case WM_GETTEXTLENGTH:
+ return GetTextLength();
+
+ case WM_GETTEXT:
+ return GetText(wParam, lParam);
+
+ case EM_LINEFROMCHAR:
+ if (static_cast<int>(wParam) < 0) {
+ wParam = SelectionStart().Position();
+ }
+ return pdoc->LineFromPosition(static_cast<int>(wParam));
+
+ case EM_EXLINEFROMCHAR:
+ return pdoc->LineFromPosition(static_cast<int>(lParam));
+
+ case EM_GETSEL:
+ if (wParam) {
+ *reinterpret_cast<int *>(wParam) = SelectionStart().Position();
+ }
+ if (lParam) {
+ *reinterpret_cast<int *>(lParam) = SelectionEnd().Position();
+ }
+ return MAKELONG(SelectionStart().Position(), SelectionEnd().Position());
+
+ case EM_EXGETSEL: {
+ if (lParam == 0) {
+ return 0;
+ }
+ Sci_CharacterRange *pCR = reinterpret_cast<Sci_CharacterRange *>(lParam);
+ pCR->cpMin = SelectionStart().Position();
+ pCR->cpMax = SelectionEnd().Position();
+ }
+ break;
+
+ case EM_SETSEL: {
+ int nStart = static_cast<int>(wParam);
+ int nEnd = static_cast<int>(lParam);
+ if (nStart == 0 && nEnd == -1) {
+ nEnd = pdoc->Length();
+ }
+ if (nStart == -1) {
+ nStart = nEnd; // Remove selection
+ }
+ if (nStart > nEnd) {
+ SetSelection(nEnd, nStart);
+ } else {
+ SetSelection(nStart, nEnd);
+ }
+ EnsureCaretVisible();
+ }
+ break;
+
+ case EM_EXSETSEL: {
+ if (lParam == 0) {
+ return 0;
+ }
+ Sci_CharacterRange *pCR = reinterpret_cast<Sci_CharacterRange *>(lParam);
+ sel.selType = Selection::selStream;
+ if (pCR->cpMin == 0 && pCR->cpMax == -1) {
+ SetSelection(pCR->cpMin, pdoc->Length());
+ } else {
+ SetSelection(pCR->cpMin, pCR->cpMax);
+ }
+ EnsureCaretVisible();
+ return pdoc->LineFromPosition(SelectionStart().Position());
+ }
+
+ case SCI_GETDIRECTFUNCTION:
+ return reinterpret_cast<sptr_t>(DirectFunction);
+
+ case SCI_GETDIRECTPOINTER:
+ return reinterpret_cast<sptr_t>(this);
+
+ case SCI_GRABFOCUS:
+ ::SetFocus(MainHWND());
+ break;
+
+#ifdef INCLUDE_DEPRECATED_FEATURES
+ case SCI_SETKEYSUNICODE:
+ break;
+
+ case SCI_GETKEYSUNICODE:
+ return true;
+#endif
+
+ case SCI_SETTECHNOLOGY:
+ if ((wParam == SC_TECHNOLOGY_DEFAULT) ||
+ (wParam == SC_TECHNOLOGY_DIRECTWRITERETAIN) ||
+ (wParam == SC_TECHNOLOGY_DIRECTWRITEDC) ||
+ (wParam == SC_TECHNOLOGY_DIRECTWRITE)) {
+ if (technology != static_cast<int>(wParam)) {
+ if (static_cast<int>(wParam) > SC_TECHNOLOGY_DEFAULT) {
+#if defined(USE_D2D)
+ if (!LoadD2D())
+ // Failed to load Direct2D or DirectWrite so no effect
+ return 0;
+#else
+ return 0;
+#endif
+ }
+#if defined(USE_D2D)
+ DropRenderTarget();
+#endif
+ technology = static_cast<int>(wParam);
+ // Invalidate all cached information including layout.
+ DropGraphics(true);
+ InvalidateStyleRedraw();
+ }
+ }
+ break;
+
+#ifdef SCI_LEXER
+ case SCI_LOADLEXERLIBRARY:
+ LexerManager::GetInstance()->Load(reinterpret_cast<const char *>(lParam));
+ break;
+#endif
+
+ case SCI_TARGETASUTF8:
+ return TargetAsUTF8(reinterpret_cast<char*>(lParam));
+
+ case SCI_ENCODEDFROMUTF8:
+ return EncodedFromUTF8(reinterpret_cast<char*>(wParam),
+ reinterpret_cast<char*>(lParam));
+
+ default:
+ return ScintillaBase::WndProc(iMessage, wParam, lParam);
+ }
+ } catch (std::bad_alloc &) {
+ errorStatus = SC_STATUS_BADALLOC;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return 0l;
+}
+
+bool ScintillaWin::ValidCodePage(int codePage) const {
+ return codePage == 0 || codePage == SC_CP_UTF8 ||
+ codePage == 932 || codePage == 936 || codePage == 949 ||
+ codePage == 950 || codePage == 1361;
+}
+
+sptr_t ScintillaWin::DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+}
+
+/**
+* Report that this Editor subclass has a working implementation of FineTickerStart.
+*/
+bool ScintillaWin::FineTickerAvailable() {
+ return true;
+}
+
+bool ScintillaWin::FineTickerRunning(TickReason reason) {
+ return timers[reason] != 0;
+}
+
+void ScintillaWin::FineTickerStart(TickReason reason, int millis, int tolerance) {
+ FineTickerCancel(reason);
+ if (SetCoalescableTimerFn && tolerance) {
+ timers[reason] = SetCoalescableTimerFn(MainHWND(), fineTimerStart + reason, millis, NULL, tolerance);
+ } else {
+ timers[reason] = ::SetTimer(MainHWND(), fineTimerStart + reason, millis, NULL);
+ }
+}
+
+void ScintillaWin::FineTickerCancel(TickReason reason) {
+ if (timers[reason]) {
+ ::KillTimer(MainHWND(), timers[reason]);
+ timers[reason] = 0;
+ }
+}
+
+
+bool ScintillaWin::SetIdle(bool on) {
+ // On Win32 the Idler is implemented as a Timer on the Scintilla window. This
+ // takes advantage of the fact that WM_TIMER messages are very low priority,
+ // and are only posted when the message queue is empty, i.e. during idle time.
+ if (idler.state != on) {
+ if (on) {
+ idler.idlerID = ::SetTimer(MainHWND(), idleTimerID, 10, NULL)
+ ? reinterpret_cast<IdlerID>(idleTimerID) : 0;
+ } else {
+ ::KillTimer(MainHWND(), reinterpret_cast<uptr_t>(idler.idlerID));
+ idler.idlerID = 0;
+ }
+ idler.state = idler.idlerID != 0;
+ }
+ return idler.state;
+}
+
+void ScintillaWin::SetMouseCapture(bool on) {
+ if (mouseDownCaptures) {
+ if (on) {
+ ::SetCapture(MainHWND());
+ } else {
+ ::ReleaseCapture();
+ }
+ }
+ capturedMouse = on;
+}
+
+bool ScintillaWin::HaveMouseCapture() {
+ // Cannot just see if GetCapture is this window as the scroll bar also sets capture for the window
+ return capturedMouse;
+ //return capturedMouse && (::GetCapture() == MainHWND());
+}
+
+void ScintillaWin::SetTrackMouseLeaveEvent(bool on) {
+ if (on && TrackMouseEventFn && !trackedMouseLeave) {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = MainHWND();
+ tme.dwHoverTime = HOVER_DEFAULT; // Unused but triggers Dr. Memory if not initialized
+ TrackMouseEventFn(&tme);
+ }
+ trackedMouseLeave = on;
+}
+
+bool ScintillaWin::PaintContains(PRectangle rc) {
+ if (paintState == painting) {
+ return BoundsContains(rcPaint, hRgnUpdate, rc);
+ }
+ return true;
+}
+
+void ScintillaWin::ScrollText(int /* linesToMove */) {
+ //Platform::DebugPrintf("ScintillaWin::ScrollText %d\n", linesToMove);
+ //::ScrollWindow(MainHWND(), 0,
+ // vs.lineHeight * linesToMove, 0, 0);
+ //::UpdateWindow(MainHWND());
+ Redraw();
+ UpdateSystemCaret();
+}
+
+void ScintillaWin::UpdateSystemCaret() {
+ if (hasFocus) {
+ if (HasCaretSizeChanged()) {
+ DestroySystemCaret();
+ CreateSystemCaret();
+ }
+ Point pos = PointMainCaret();
+ ::SetCaretPos(static_cast<int>(pos.x), static_cast<int>(pos.y));
+ }
+}
+
+int ScintillaWin::SetScrollInfo(int nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) {
+ return ::SetScrollInfo(MainHWND(), nBar, lpsi, bRedraw);
+}
+
+bool ScintillaWin::GetScrollInfo(int nBar, LPSCROLLINFO lpsi) {
+ return ::GetScrollInfo(MainHWND(), nBar, lpsi) ? true : false;
+}
+
+// Change the scroll position but avoid repaint if changing to same value
+void ScintillaWin::ChangeScrollPos(int barType, int pos) {
+ SCROLLINFO sci = {
+ sizeof(sci), 0, 0, 0, 0, 0, 0
+ };
+ sci.fMask = SIF_POS;
+ GetScrollInfo(barType, &sci);
+ if (sci.nPos != pos) {
+ DwellEnd(true);
+ sci.nPos = pos;
+ SetScrollInfo(barType, &sci, TRUE);
+ }
+}
+
+void ScintillaWin::SetVerticalScrollPos() {
+ ChangeScrollPos(SB_VERT, topLine);
+}
+
+void ScintillaWin::SetHorizontalScrollPos() {
+ ChangeScrollPos(SB_HORZ, xOffset);
+}
+
+bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) {
+ bool modified = false;
+ SCROLLINFO sci = {
+ sizeof(sci), 0, 0, 0, 0, 0, 0
+ };
+ sci.fMask = SIF_PAGE | SIF_RANGE;
+ GetScrollInfo(SB_VERT, &sci);
+ int vertEndPreferred = nMax;
+ if (!verticalScrollBarVisible)
+ nPage = vertEndPreferred + 1;
+ if ((sci.nMin != 0) ||
+ (sci.nMax != vertEndPreferred) ||
+ (sci.nPage != static_cast<unsigned int>(nPage)) ||
+ (sci.nPos != 0)) {
+ sci.fMask = SIF_PAGE | SIF_RANGE;
+ sci.nMin = 0;
+ sci.nMax = vertEndPreferred;
+ sci.nPage = nPage;
+ sci.nPos = 0;
+ sci.nTrackPos = 1;
+ SetScrollInfo(SB_VERT, &sci, TRUE);
+ modified = true;
+ }
+
+ PRectangle rcText = GetTextRectangle();
+ int horizEndPreferred = scrollWidth;
+ if (horizEndPreferred < 0)
+ horizEndPreferred = 0;
+ unsigned int pageWidth = static_cast<unsigned int>(rcText.Width());
+ if (!horizontalScrollBarVisible || Wrapping())
+ pageWidth = horizEndPreferred + 1;
+ sci.fMask = SIF_PAGE | SIF_RANGE;
+ GetScrollInfo(SB_HORZ, &sci);
+ if ((sci.nMin != 0) ||
+ (sci.nMax != horizEndPreferred) ||
+ (sci.nPage != pageWidth) ||
+ (sci.nPos != 0)) {
+ sci.fMask = SIF_PAGE | SIF_RANGE;
+ sci.nMin = 0;
+ sci.nMax = horizEndPreferred;
+ sci.nPage = pageWidth;
+ sci.nPos = 0;
+ sci.nTrackPos = 1;
+ SetScrollInfo(SB_HORZ, &sci, TRUE);
+ modified = true;
+ if (scrollWidth < static_cast<int>(pageWidth)) {
+ HorizontalScrollTo(0);
+ }
+ }
+ return modified;
+}
+
+void ScintillaWin::NotifyChange() {
+ ::SendMessage(::GetParent(MainHWND()), WM_COMMAND,
+ MAKELONG(GetCtrlID(), SCEN_CHANGE),
+ reinterpret_cast<LPARAM>(MainHWND()));
+}
+
+void ScintillaWin::NotifyFocus(bool focus) {
+ ::SendMessage(::GetParent(MainHWND()), WM_COMMAND,
+ MAKELONG(GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),
+ reinterpret_cast<LPARAM>(MainHWND()));
+ Editor::NotifyFocus(focus);
+}
+
+void ScintillaWin::SetCtrlID(int identifier) {
+ ::SetWindowID(reinterpret_cast<HWND>(wMain.GetID()), identifier);
+}
+
+int ScintillaWin::GetCtrlID() {
+ return ::GetDlgCtrlID(reinterpret_cast<HWND>(wMain.GetID()));
+}
+
+void ScintillaWin::NotifyParent(SCNotification scn) {
+ scn.nmhdr.hwndFrom = MainHWND();
+ scn.nmhdr.idFrom = GetCtrlID();
+ ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
+ GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
+}
+
+void ScintillaWin::NotifyDoubleClick(Point pt, int modifiers) {
+ //Platform::DebugPrintf("ScintillaWin Double click 0\n");
+ ScintillaBase::NotifyDoubleClick(pt, modifiers);
+ // Send myself a WM_LBUTTONDBLCLK, so the container can handle it too.
+ ::SendMessage(MainHWND(),
+ WM_LBUTTONDBLCLK,
+ (modifiers & SCI_SHIFT) ? MK_SHIFT : 0,
+ MAKELPARAM(pt.x, pt.y));
+}
+
+class CaseFolderDBCS : public CaseFolderTable {
+ // Allocate the expandable storage here so that it does not need to be reallocated
+ // for each call to Fold.
+ std::vector<wchar_t> utf16Mixed;
+ std::vector<wchar_t> utf16Folded;
+ UINT cp;
+public:
+ explicit CaseFolderDBCS(UINT cp_) : cp(cp_) {
+ StandardASCII();
+ }
+ virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
+ if ((lenMixed == 1) && (sizeFolded > 0)) {
+ folded[0] = mapping[static_cast<unsigned char>(mixed[0])];
+ return 1;
+ } else {
+ if (lenMixed > utf16Mixed.size()) {
+ utf16Mixed.resize(lenMixed + 8);
+ }
+ size_t nUtf16Mixed = ::MultiByteToWideChar(cp, 0, mixed,
+ static_cast<int>(lenMixed),
+ &utf16Mixed[0],
+ static_cast<int>(utf16Mixed.size()));
+
+ if (nUtf16Mixed == 0) {
+ // Failed to convert -> bad input
+ folded[0] = '\0';
+ return 1;
+ }
+
+ unsigned int lenFlat = 0;
+ for (size_t mixIndex=0; mixIndex < nUtf16Mixed; mixIndex++) {
+ if ((lenFlat + 20) > utf16Folded.size())
+ utf16Folded.resize(lenFlat + 60);
+ const char *foldedUTF8 = CaseConvert(utf16Mixed[mixIndex], CaseConversionFold);
+ if (foldedUTF8) {
+ // Maximum length of a case conversion is 6 bytes, 3 characters
+ wchar_t wFolded[20];
+ size_t charsConverted = UTF16FromUTF8(foldedUTF8,
+ strlen(foldedUTF8),
+ wFolded, ELEMENTS(wFolded));
+ for (size_t j=0; j<charsConverted; j++)
+ utf16Folded[lenFlat++] = wFolded[j];
+ } else {
+ utf16Folded[lenFlat++] = utf16Mixed[mixIndex];
+ }
+ }
+
+ size_t lenOut = ::WideCharToMultiByte(cp, 0,
+ &utf16Folded[0], lenFlat,
+ NULL, 0, NULL, 0);
+
+ if (lenOut < sizeFolded) {
+ ::WideCharToMultiByte(cp, 0,
+ &utf16Folded[0], lenFlat,
+ folded, static_cast<int>(lenOut), NULL, 0);
+ return lenOut;
+ } else {
+ return 0;
+ }
+ }
+ }
+};
+
+CaseFolder *ScintillaWin::CaseFolderForEncoding() {
+ UINT cpDest = CodePageOfDocument();
+ if (cpDest == SC_CP_UTF8) {
+ return new CaseFolderUnicode();
+ } else {
+ if (pdoc->dbcsCodePage == 0) {
+ CaseFolderTable *pcf = new CaseFolderTable();
+ pcf->StandardASCII();
+ // Only for single byte encodings
+ UINT cpDoc = CodePageOfDocument();
+ for (int i=0x80; i<0x100; i++) {
+ char sCharacter[2] = "A";
+ sCharacter[0] = static_cast<char>(i);
+ wchar_t wCharacter[20];
+ unsigned int lengthUTF16 = ::MultiByteToWideChar(cpDoc, 0, sCharacter, 1,
+ wCharacter, ELEMENTS(wCharacter));
+ if (lengthUTF16 == 1) {
+ const char *caseFolded = CaseConvert(wCharacter[0], CaseConversionFold);
+ if (caseFolded) {
+ wchar_t wLower[20];
+ size_t charsConverted = UTF16FromUTF8(caseFolded,
+ strlen(caseFolded),
+ wLower, ELEMENTS(wLower));
+ if (charsConverted == 1) {
+ char sCharacterLowered[20];
+ unsigned int lengthConverted = ::WideCharToMultiByte(cpDoc, 0,
+ wLower, static_cast<int>(charsConverted),
+ sCharacterLowered, ELEMENTS(sCharacterLowered), NULL, 0);
+ if ((lengthConverted == 1) && (sCharacter[0] != sCharacterLowered[0])) {
+ pcf->SetTranslation(sCharacter[0], sCharacterLowered[0]);
+ }
+ }
+ }
+ }
+ }
+ return pcf;
+ } else {
+ return new CaseFolderDBCS(cpDest);
+ }
+ }
+}
+
+std::string ScintillaWin::CaseMapString(const std::string &s, int caseMapping) {
+ if ((s.size() == 0) || (caseMapping == cmSame))
+ return s;
+
+ UINT cpDoc = CodePageOfDocument();
+ if (cpDoc == SC_CP_UTF8) {
+ std::string retMapped(s.length() * maxExpansionCaseConversion, 0);
+ size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(),
+ (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower);
+ retMapped.resize(lenMapped);
+ return retMapped;
+ }
+
+ unsigned int lengthUTF16 = ::MultiByteToWideChar(cpDoc, 0, s.c_str(),
+ static_cast<int>(s.size()), NULL, 0);
+ if (lengthUTF16 == 0) // Failed to convert
+ return s;
+
+ DWORD mapFlags = LCMAP_LINGUISTIC_CASING |
+ ((caseMapping == cmUpper) ? LCMAP_UPPERCASE : LCMAP_LOWERCASE);
+
+ // Change text to UTF-16
+ std::vector<wchar_t> vwcText(lengthUTF16);
+ ::MultiByteToWideChar(cpDoc, 0, s.c_str(), static_cast<int>(s.size()), &vwcText[0], lengthUTF16);
+
+ // Change case
+ int charsConverted = ::LCMapStringW(LOCALE_SYSTEM_DEFAULT, mapFlags,
+ &vwcText[0], lengthUTF16, NULL, 0);
+ std::vector<wchar_t> vwcConverted(charsConverted);
+ ::LCMapStringW(LOCALE_SYSTEM_DEFAULT, mapFlags,
+ &vwcText[0], lengthUTF16, &vwcConverted[0], charsConverted);
+
+ // Change back to document encoding
+ unsigned int lengthConverted = ::WideCharToMultiByte(cpDoc, 0,
+ &vwcConverted[0], static_cast<int>(vwcConverted.size()),
+ NULL, 0, NULL, 0);
+ std::vector<char> vcConverted(lengthConverted);
+ ::WideCharToMultiByte(cpDoc, 0,
+ &vwcConverted[0], static_cast<int>(vwcConverted.size()),
+ &vcConverted[0], static_cast<int>(vcConverted.size()), NULL, 0);
+
+ return std::string(&vcConverted[0], vcConverted.size());
+}
+
+void ScintillaWin::Copy() {
+ //Platform::DebugPrintf("Copy\n");
+ if (!sel.Empty()) {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText);
+ CopyToClipboard(selectedText);
+ }
+}
+
+void ScintillaWin::CopyAllowLine() {
+ SelectionText selectedText;
+ CopySelectionRange(&selectedText, true);
+ CopyToClipboard(selectedText);
+}
+
+bool ScintillaWin::CanPaste() {
+ if (!Editor::CanPaste())
+ return false;
+ if (::IsClipboardFormatAvailable(CF_TEXT))
+ return true;
+ if (IsUnicodeMode())
+ return ::IsClipboardFormatAvailable(CF_UNICODETEXT) != 0;
+ return false;
+}
+
+class GlobalMemory {
+ HGLOBAL hand;
+public:
+ void *ptr;
+ GlobalMemory() : hand(0), ptr(0) {
+ }
+ explicit GlobalMemory(HGLOBAL hand_) : hand(hand_), ptr(0) {
+ if (hand) {
+ ptr = ::GlobalLock(hand);
+ }
+ }
+ ~GlobalMemory() {
+ PLATFORM_ASSERT(!ptr);
+ assert(!hand);
+ }
+ void Allocate(size_t bytes) {
+ assert(!hand);
+ hand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, bytes);
+ if (hand) {
+ ptr = ::GlobalLock(hand);
+ }
+ }
+ HGLOBAL Unlock() {
+ PLATFORM_ASSERT(ptr);
+ HGLOBAL handCopy = hand;
+ ::GlobalUnlock(hand);
+ ptr = 0;
+ hand = 0;
+ return handCopy;
+ }
+ void SetClip(UINT uFormat) {
+ ::SetClipboardData(uFormat, Unlock());
+ }
+ operator bool() const {
+ return ptr != 0;
+ }
+ SIZE_T Size() {
+ return ::GlobalSize(hand);
+ }
+};
+
+void ScintillaWin::Paste() {
+ if (!::OpenClipboard(MainHWND()))
+ return;
+ UndoGroup ug(pdoc);
+ const bool isLine = SelectionEmpty() &&
+ (::IsClipboardFormatAvailable(cfLineSelect) || ::IsClipboardFormatAvailable(cfVSLineTag));
+ ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH);
+ bool isRectangular = (::IsClipboardFormatAvailable(cfColumnSelect) != 0);
+
+ if (!isRectangular) {
+ // Evaluate "Borland IDE Block Type" explicitly
+ GlobalMemory memBorlandSelection(::GetClipboardData(cfBorlandIDEBlockType));
+ if (memBorlandSelection) {
+ isRectangular = (memBorlandSelection.Size() == 1) && (static_cast<BYTE *>(memBorlandSelection.ptr)[0] == 0x02);
+ memBorlandSelection.Unlock();
+ }
+ }
+ const PasteShape pasteShape = isRectangular ? pasteRectangular : (isLine ? pasteLine : pasteStream);
+
+ // Always use CF_UNICODETEXT if available
+ GlobalMemory memUSelection(::GetClipboardData(CF_UNICODETEXT));
+ if (memUSelection) {
+ wchar_t *uptr = static_cast<wchar_t *>(memUSelection.ptr);
+ if (uptr) {
+ unsigned int len;
+ std::vector<char> putf;
+ // Default Scintilla behaviour in Unicode mode
+ if (IsUnicodeMode()) {
+ unsigned int bytes = static_cast<unsigned int>(memUSelection.Size());
+ len = UTF8Length(uptr, bytes / 2);
+ putf.resize(len + 1);
+ UTF8FromUTF16(uptr, bytes / 2, &putf[0], len);
+ } else {
+ // CF_UNICODETEXT available, but not in Unicode mode
+ // Convert from Unicode to current Scintilla code page
+ UINT cpDest = CodePageOfDocument();
+ len = ::WideCharToMultiByte(cpDest, 0, uptr, -1,
+ NULL, 0, NULL, NULL) - 1; // subtract 0 terminator
+ putf.resize(len + 1);
+ ::WideCharToMultiByte(cpDest, 0, uptr, -1,
+ &putf[0], len + 1, NULL, NULL);
+ }
+
+ InsertPasteShape(&putf[0], len, pasteShape);
+ }
+ memUSelection.Unlock();
+ } else {
+ // CF_UNICODETEXT not available, paste ANSI text
+ GlobalMemory memSelection(::GetClipboardData(CF_TEXT));
+ if (memSelection) {
+ char *ptr = static_cast<char *>(memSelection.ptr);
+ if (ptr) {
+ unsigned int bytes = static_cast<unsigned int>(memSelection.Size());
+ unsigned int len = bytes;
+ for (unsigned int i = 0; i < bytes; i++) {
+ if ((len == bytes) && (0 == ptr[i]))
+ len = i;
+ }
+
+ // In Unicode mode, convert clipboard text to UTF-8
+ if (IsUnicodeMode()) {
+ std::vector<wchar_t> uptr(len+1);
+
+ unsigned int ulen = ::MultiByteToWideChar(CP_ACP, 0,
+ ptr, len, &uptr[0], len+1);
+
+ unsigned int mlen = UTF8Length(&uptr[0], ulen);
+ std::vector<char> putf(mlen+1);
+ UTF8FromUTF16(&uptr[0], ulen, &putf[0], mlen);
+
+ InsertPasteShape(&putf[0], mlen, pasteShape);
+ } else {
+ InsertPasteShape(ptr, len, pasteShape);
+ }
+ }
+ memSelection.Unlock();
+ }
+ }
+ ::CloseClipboard();
+ Redraw();
+}
+
+void ScintillaWin::CreateCallTipWindow(PRectangle) {
+ if (!ct.wCallTip.Created()) {
+ ct.wCallTip = ::CreateWindow(callClassName, TEXT("ACallTip"),
+ WS_POPUP, 100, 100, 150, 20,
+ MainHWND(), 0,
+ GetWindowInstance(MainHWND()),
+ this);
+ ct.wDraw = ct.wCallTip;
+ }
+}
+
+void ScintillaWin::AddToPopUp(const char *label, int cmd, bool enabled) {
+ HMENU hmenuPopup = reinterpret_cast<HMENU>(popup.GetID());
+ if (!label[0])
+ ::AppendMenuA(hmenuPopup, MF_SEPARATOR, 0, "");
+ else if (enabled)
+ ::AppendMenuA(hmenuPopup, MF_STRING, cmd, label);
+ else
+ ::AppendMenuA(hmenuPopup, MF_STRING | MF_DISABLED | MF_GRAYED, cmd, label);
+}
+
+void ScintillaWin::ClaimSelection() {
+ // Windows does not have a primary selection
+}
+
+/// Implement IUnknown
+
+STDMETHODIMP_(ULONG)FormatEnumerator_AddRef(FormatEnumerator *fe);
+STDMETHODIMP FormatEnumerator_QueryInterface(FormatEnumerator *fe, REFIID riid, PVOID *ppv) {
+ //Platform::DebugPrintf("EFE QI");
+ *ppv = NULL;
+ if (riid == IID_IUnknown)
+ *ppv = reinterpret_cast<IEnumFORMATETC *>(fe);
+ if (riid == IID_IEnumFORMATETC)
+ *ppv = reinterpret_cast<IEnumFORMATETC *>(fe);
+ if (!*ppv)
+ return E_NOINTERFACE;
+ FormatEnumerator_AddRef(fe);
+ return S_OK;
+}
+STDMETHODIMP_(ULONG)FormatEnumerator_AddRef(FormatEnumerator *fe) {
+ return ++fe->ref;
+}
+STDMETHODIMP_(ULONG)FormatEnumerator_Release(FormatEnumerator *fe) {
+ fe->ref--;
+ if (fe->ref > 0)
+ return fe->ref;
+ delete fe;
+ return 0;
+}
+/// Implement IEnumFORMATETC
+STDMETHODIMP FormatEnumerator_Next(FormatEnumerator *fe, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched) {
+ if (rgelt == NULL) return E_POINTER;
+ unsigned int putPos = 0;
+ while ((fe->pos < fe->formats.size()) && (putPos < celt)) {
+ rgelt->cfFormat = fe->formats[fe->pos];
+ rgelt->ptd = 0;
+ rgelt->dwAspect = DVASPECT_CONTENT;
+ rgelt->lindex = -1;
+ rgelt->tymed = TYMED_HGLOBAL;
+ rgelt++;
+ fe->pos++;
+ putPos++;
+ }
+ if (pceltFetched)
+ *pceltFetched = putPos;
+ return putPos ? S_OK : S_FALSE;
+}
+STDMETHODIMP FormatEnumerator_Skip(FormatEnumerator *fe, ULONG celt) {
+ fe->pos += celt;
+ return S_OK;
+}
+STDMETHODIMP FormatEnumerator_Reset(FormatEnumerator *fe) {
+ fe->pos = 0;
+ return S_OK;
+}
+STDMETHODIMP FormatEnumerator_Clone(FormatEnumerator *fe, IEnumFORMATETC **ppenum) {
+ FormatEnumerator *pfe;
+ try {
+ pfe = new FormatEnumerator(fe->pos, &fe->formats[0], fe->formats.size());
+ } catch (...) {
+ return E_OUTOFMEMORY;
+ }
+ return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC,
+ reinterpret_cast<void **>(ppenum));
+}
+
+static VFunction *vtFormatEnumerator[] = {
+ (VFunction *)(FormatEnumerator_QueryInterface),
+ (VFunction *)(FormatEnumerator_AddRef),
+ (VFunction *)(FormatEnumerator_Release),
+ (VFunction *)(FormatEnumerator_Next),
+ (VFunction *)(FormatEnumerator_Skip),
+ (VFunction *)(FormatEnumerator_Reset),
+ (VFunction *)(FormatEnumerator_Clone)
+};
+
+FormatEnumerator::FormatEnumerator(int pos_, CLIPFORMAT formats_[], size_t formatsLen_) {
+ vtbl = vtFormatEnumerator;
+ ref = 0; // First QI adds first reference...
+ pos = pos_;
+ formats.insert(formats.begin(), formats_, formats_+formatsLen_);
+}
+
+/// Implement IUnknown
+STDMETHODIMP DropSource_QueryInterface(DropSource *ds, REFIID riid, PVOID *ppv) {
+ return ds->sci->QueryInterface(riid, ppv);
+}
+STDMETHODIMP_(ULONG)DropSource_AddRef(DropSource *ds) {
+ return ds->sci->AddRef();
+}
+STDMETHODIMP_(ULONG)DropSource_Release(DropSource *ds) {
+ return ds->sci->Release();
+}
+
+/// Implement IDropSource
+STDMETHODIMP DropSource_QueryContinueDrag(DropSource *, BOOL fEsc, DWORD grfKeyState) {
+ if (fEsc)
+ return DRAGDROP_S_CANCEL;
+ if (!(grfKeyState & MK_LBUTTON))
+ return DRAGDROP_S_DROP;
+ return S_OK;
+}
+
+STDMETHODIMP DropSource_GiveFeedback(DropSource *, DWORD) {
+ return DRAGDROP_S_USEDEFAULTCURSORS;
+}
+
+static VFunction *vtDropSource[] = {
+ (VFunction *)(DropSource_QueryInterface),
+ (VFunction *)(DropSource_AddRef),
+ (VFunction *)(DropSource_Release),
+ (VFunction *)(DropSource_QueryContinueDrag),
+ (VFunction *)(DropSource_GiveFeedback)
+};
+
+DropSource::DropSource() {
+ vtbl = vtDropSource;
+ sci = 0;
+}
+
+/// Implement IUnkown
+STDMETHODIMP DataObject_QueryInterface(DataObject *pd, REFIID riid, PVOID *ppv) {
+ //Platform::DebugPrintf("DO QI %x\n", pd);
+ return pd->sci->QueryInterface(riid, ppv);
+}
+STDMETHODIMP_(ULONG)DataObject_AddRef(DataObject *pd) {
+ return pd->sci->AddRef();
+}
+STDMETHODIMP_(ULONG)DataObject_Release(DataObject *pd) {
+ return pd->sci->Release();
+}
+/// Implement IDataObject
+STDMETHODIMP DataObject_GetData(DataObject *pd, FORMATETC *pFEIn, STGMEDIUM *pSTM) {
+ return pd->sci->GetData(pFEIn, pSTM);
+}
+
+STDMETHODIMP DataObject_GetDataHere(DataObject *, FORMATETC *, STGMEDIUM *) {
+ //Platform::DebugPrintf("DOB GetDataHere\n");
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP DataObject_QueryGetData(DataObject *pd, FORMATETC *pFE) {
+ if (pd->sci->DragIsRectangularOK(pFE->cfFormat) &&
+ pFE->ptd == 0 &&
+ (pFE->dwAspect & DVASPECT_CONTENT) != 0 &&
+ pFE->lindex == -1 &&
+ (pFE->tymed & TYMED_HGLOBAL) != 0
+ ) {
+ return S_OK;
+ }
+
+ bool formatOK = (pFE->cfFormat == CF_TEXT) ||
+ ((pFE->cfFormat == CF_UNICODETEXT) && pd->sci->IsUnicodeMode());
+ if (!formatOK ||
+ pFE->ptd != 0 ||
+ (pFE->dwAspect & DVASPECT_CONTENT) == 0 ||
+ pFE->lindex != -1 ||
+ (pFE->tymed & TYMED_HGLOBAL) == 0
+ ) {
+ //Platform::DebugPrintf("DOB QueryGetData No %x\n",pFE->cfFormat);
+ //return DATA_E_FORMATETC;
+ return S_FALSE;
+ }
+ //Platform::DebugPrintf("DOB QueryGetData OK %x\n",pFE->cfFormat);
+ return S_OK;
+}
+
+STDMETHODIMP DataObject_GetCanonicalFormatEtc(DataObject *pd, FORMATETC *, FORMATETC *pFEOut) {
+ //Platform::DebugPrintf("DOB GetCanon\n");
+ if (pd->sci->IsUnicodeMode())
+ pFEOut->cfFormat = CF_UNICODETEXT;
+ else
+ pFEOut->cfFormat = CF_TEXT;
+ pFEOut->ptd = 0;
+ pFEOut->dwAspect = DVASPECT_CONTENT;
+ pFEOut->lindex = -1;
+ pFEOut->tymed = TYMED_HGLOBAL;
+ return S_OK;
+}
+
+STDMETHODIMP DataObject_SetData(DataObject *, FORMATETC *, STGMEDIUM *, BOOL) {
+ //Platform::DebugPrintf("DOB SetData\n");
+ return E_FAIL;
+}
+
+STDMETHODIMP DataObject_EnumFormatEtc(DataObject *pd, DWORD dwDirection, IEnumFORMATETC **ppEnum) {
+ try {
+ //Platform::DebugPrintf("DOB EnumFormatEtc %d\n", dwDirection);
+ if (dwDirection != DATADIR_GET) {
+ *ppEnum = 0;
+ return E_FAIL;
+ }
+ FormatEnumerator *pfe;
+ if (pd->sci->IsUnicodeMode()) {
+ CLIPFORMAT formats[] = {CF_UNICODETEXT, CF_TEXT};
+ pfe = new FormatEnumerator(0, formats, ELEMENTS(formats));
+ } else {
+ CLIPFORMAT formats[] = {CF_TEXT};
+ pfe = new FormatEnumerator(0, formats, ELEMENTS(formats));
+ }
+ return FormatEnumerator_QueryInterface(pfe, IID_IEnumFORMATETC,
+ reinterpret_cast<void **>(ppEnum));
+ } catch (std::bad_alloc &) {
+ pd->sci->errorStatus = SC_STATUS_BADALLOC;
+ return E_OUTOFMEMORY;
+ } catch (...) {
+ pd->sci->errorStatus = SC_STATUS_FAILURE;
+ return E_FAIL;
+ }
+}
+
+STDMETHODIMP DataObject_DAdvise(DataObject *, FORMATETC *, DWORD, IAdviseSink *, PDWORD) {
+ //Platform::DebugPrintf("DOB DAdvise\n");
+ return E_FAIL;
+}
+
+STDMETHODIMP DataObject_DUnadvise(DataObject *, DWORD) {
+ //Platform::DebugPrintf("DOB DUnadvise\n");
+ return E_FAIL;
+}
+
+STDMETHODIMP DataObject_EnumDAdvise(DataObject *, IEnumSTATDATA **) {
+ //Platform::DebugPrintf("DOB EnumDAdvise\n");
+ return E_FAIL;
+}
+
+static VFunction *vtDataObject[] = {
+ (VFunction *)(DataObject_QueryInterface),
+ (VFunction *)(DataObject_AddRef),
+ (VFunction *)(DataObject_Release),
+ (VFunction *)(DataObject_GetData),
+ (VFunction *)(DataObject_GetDataHere),
+ (VFunction *)(DataObject_QueryGetData),
+ (VFunction *)(DataObject_GetCanonicalFormatEtc),
+ (VFunction *)(DataObject_SetData),
+ (VFunction *)(DataObject_EnumFormatEtc),
+ (VFunction *)(DataObject_DAdvise),
+ (VFunction *)(DataObject_DUnadvise),
+ (VFunction *)(DataObject_EnumDAdvise)
+};
+
+DataObject::DataObject() {
+ vtbl = vtDataObject;
+ sci = 0;
+}
+
+/// Implement IUnknown
+STDMETHODIMP DropTarget_QueryInterface(DropTarget *dt, REFIID riid, PVOID *ppv) {
+ //Platform::DebugPrintf("DT QI %x\n", dt);
+ return dt->sci->QueryInterface(riid, ppv);
+}
+STDMETHODIMP_(ULONG)DropTarget_AddRef(DropTarget *dt) {
+ return dt->sci->AddRef();
+}
+STDMETHODIMP_(ULONG)DropTarget_Release(DropTarget *dt) {
+ return dt->sci->Release();
+}
+
+/// Implement IDropTarget by forwarding to Scintilla
+STDMETHODIMP DropTarget_DragEnter(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL pt, PDWORD pdwEffect) {
+ try {
+ return dt->sci->DragEnter(pIDataSource, grfKeyState, pt, pdwEffect);
+ } catch (...) {
+ dt->sci->errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+STDMETHODIMP DropTarget_DragOver(DropTarget *dt, DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) {
+ try {
+ return dt->sci->DragOver(grfKeyState, pt, pdwEffect);
+ } catch (...) {
+ dt->sci->errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+STDMETHODIMP DropTarget_DragLeave(DropTarget *dt) {
+ try {
+ return dt->sci->DragLeave();
+ } catch (...) {
+ dt->sci->errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+STDMETHODIMP DropTarget_Drop(DropTarget *dt, LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL pt, PDWORD pdwEffect) {
+ try {
+ return dt->sci->Drop(pIDataSource, grfKeyState, pt, pdwEffect);
+ } catch (...) {
+ dt->sci->errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+
+static VFunction *vtDropTarget[] = {
+ (VFunction *)(DropTarget_QueryInterface),
+ (VFunction *)(DropTarget_AddRef),
+ (VFunction *)(DropTarget_Release),
+ (VFunction *)(DropTarget_DragEnter),
+ (VFunction *)(DropTarget_DragOver),
+ (VFunction *)(DropTarget_DragLeave),
+ (VFunction *)(DropTarget_Drop)
+};
+
+DropTarget::DropTarget() {
+ vtbl = vtDropTarget;
+ sci = 0;
+}
+
+/**
+ * DBCS: support Input Method Editor (IME).
+ * Called when IME Window opened.
+ */
+void ScintillaWin::ImeStartComposition() {
+ if (caret.active) {
+ // Move IME Window to current caret position
+ HIMC hIMC = ::ImmGetContext(MainHWND());
+ Point pos = PointMainCaret();
+ COMPOSITIONFORM CompForm;
+ CompForm.dwStyle = CFS_POINT;
+ CompForm.ptCurrentPos.x = static_cast<int>(pos.x);
+ CompForm.ptCurrentPos.y = static_cast<int>(pos.y);
+
+ ::ImmSetCompositionWindow(hIMC, &CompForm);
+
+ // Set font of IME window to same as surrounded text.
+ if (stylesValid) {
+ // Since the style creation code has been made platform independent,
+ // The logfont for the IME is recreated here.
+ int styleHere = (pdoc->StyleAt(sel.MainCaret())) & 31;
+ LOGFONTW lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L""};
+ int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER;
+ if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
+ sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
+ AutoSurface surface(this);
+ int deviceHeight = sizeZoomed;
+ if (surface) {
+ deviceHeight = (sizeZoomed * surface->LogPixelsY()) / 72;
+ }
+ // The negative is to allow for leading
+ lf.lfHeight = -(abs(deviceHeight / SC_FONT_SIZE_MULTIPLIER));
+ lf.lfWeight = vs.styles[styleHere].weight;
+ lf.lfItalic = static_cast<BYTE>(vs.styles[styleHere].italic ? 1 : 0);
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfFaceName[0] = L'\0';
+ if (vs.styles[styleHere].fontName) {
+ const char* fontName = vs.styles[styleHere].fontName;
+ UTF16FromUTF8(fontName, strlen(fontName)+1, lf.lfFaceName, LF_FACESIZE);
+ }
+
+ ::ImmSetCompositionFontW(hIMC, &lf);
+ }
+ ::ImmReleaseContext(MainHWND(), hIMC);
+ // Caret is displayed in IME window. So, caret in Scintilla is useless.
+ DropCaret();
+ }
+}
+
+/** Called when IME Window closed. */
+void ScintillaWin::ImeEndComposition() {
+ ShowCaretAtCurrentPosition();
+}
+
+void ScintillaWin::GetIntelliMouseParameters() {
+ // This retrieves the number of lines per scroll as configured inthe Mouse Properties sheet in Control Panel
+ ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0);
+}
+
+void ScintillaWin::CopyToClipboard(const SelectionText &selectedText) {
+ if (!::OpenClipboard(MainHWND()))
+ return;
+ ::EmptyClipboard();
+
+ GlobalMemory uniText;
+
+ // Default Scintilla behaviour in Unicode mode
+ if (IsUnicodeMode()) {
+ size_t uchars = UTF16Length(selectedText.Data(),
+ static_cast<int>(selectedText.LengthWithTerminator()));
+ uniText.Allocate(2 * uchars);
+ if (uniText) {
+ UTF16FromUTF8(selectedText.Data(), selectedText.LengthWithTerminator(),
+ static_cast<wchar_t *>(uniText.ptr), uchars);
+ }
+ } else {
+ // Not Unicode mode
+ // Convert to Unicode using the current Scintilla code page
+ UINT cpSrc = CodePageFromCharSet(
+ selectedText.characterSet, selectedText.codePage);
+ int uLen = ::MultiByteToWideChar(cpSrc, 0, selectedText.Data(),
+ static_cast<int>(selectedText.LengthWithTerminator()), 0, 0);
+ uniText.Allocate(2 * uLen);
+ if (uniText) {
+ ::MultiByteToWideChar(cpSrc, 0, selectedText.Data(),
+ static_cast<int>(selectedText.LengthWithTerminator()),
+ static_cast<wchar_t *>(uniText.ptr), uLen);
+ }
+ }
+
+ if (uniText) {
+ uniText.SetClip(CF_UNICODETEXT);
+ } else {
+ // There was a failure - try to copy at least ANSI text
+ GlobalMemory ansiText;
+ ansiText.Allocate(selectedText.LengthWithTerminator());
+ if (ansiText) {
+ memcpy(static_cast<char *>(ansiText.ptr), selectedText.Data(), selectedText.LengthWithTerminator());
+ ansiText.SetClip(CF_TEXT);
+ }
+ }
+
+ if (selectedText.rectangular) {
+ ::SetClipboardData(cfColumnSelect, 0);
+
+ GlobalMemory borlandSelection;
+ borlandSelection.Allocate(1);
+ if (borlandSelection) {
+ static_cast<BYTE *>(borlandSelection.ptr)[0] = 0x02;
+ borlandSelection.SetClip(cfBorlandIDEBlockType);
+ }
+ }
+
+ if (selectedText.lineCopy) {
+ ::SetClipboardData(cfLineSelect, 0);
+ ::SetClipboardData(cfVSLineTag, 0);
+ }
+
+ ::CloseClipboard();
+}
+
+void ScintillaWin::ScrollMessage(WPARAM wParam) {
+ //DWORD dwStart = timeGetTime();
+ //Platform::DebugPrintf("Scroll %x %d\n", wParam, lParam);
+
+ SCROLLINFO sci = {};
+ sci.cbSize = sizeof(sci);
+ sci.fMask = SIF_ALL;
+
+ GetScrollInfo(SB_VERT, &sci);
+
+ //Platform::DebugPrintf("ScrollInfo %d mask=%x min=%d max=%d page=%d pos=%d track=%d\n", b,sci.fMask,
+ //sci.nMin, sci.nMax, sci.nPage, sci.nPos, sci.nTrackPos);
+
+ int topLineNew = topLine;
+ switch (LoWord(wParam)) {
+ case SB_LINEUP:
+ topLineNew -= 1;
+ break;
+ case SB_LINEDOWN:
+ topLineNew += 1;
+ break;
+ case SB_PAGEUP:
+ topLineNew -= LinesToScroll(); break;
+ case SB_PAGEDOWN: topLineNew += LinesToScroll(); break;
+ case SB_TOP: topLineNew = 0; break;
+ case SB_BOTTOM: topLineNew = MaxScrollPos(); break;
+ case SB_THUMBPOSITION: topLineNew = sci.nTrackPos; break;
+ case SB_THUMBTRACK: topLineNew = sci.nTrackPos; break;
+ }
+ ScrollTo(topLineNew);
+}
+
+void ScintillaWin::HorizontalScrollMessage(WPARAM wParam) {
+ int xPos = xOffset;
+ PRectangle rcText = GetTextRectangle();
+ int pageWidth = static_cast<int>(rcText.Width() * 2 / 3);
+ switch (LoWord(wParam)) {
+ case SB_LINEUP:
+ xPos -= 20;
+ break;
+ case SB_LINEDOWN: // May move past the logical end
+ xPos += 20;
+ break;
+ case SB_PAGEUP:
+ xPos -= pageWidth;
+ break;
+ case SB_PAGEDOWN:
+ xPos += pageWidth;
+ if (xPos > scrollWidth - rcText.Width()) { // Hit the end exactly
+ xPos = scrollWidth - static_cast<int>(rcText.Width());
+ }
+ break;
+ case SB_TOP:
+ xPos = 0;
+ break;
+ case SB_BOTTOM:
+ xPos = scrollWidth;
+ break;
+ case SB_THUMBPOSITION:
+ case SB_THUMBTRACK: {
+ // Do NOT use wParam, its 16 bit and not enough for very long lines. Its still possible to overflow the 32 bit but you have to try harder =]
+ SCROLLINFO si;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_TRACKPOS;
+ if (GetScrollInfo(SB_HORZ, &si)) {
+ xPos = si.nTrackPos;
+ }
+ }
+ break;
+ }
+ HorizontalScrollTo(xPos);
+}
+
+/**
+ * Redraw all of text area.
+ * This paint will not be abandoned.
+ */
+void ScintillaWin::FullPaint() {
+ if ((technology == SC_TECHNOLOGY_DEFAULT) || (technology == SC_TECHNOLOGY_DIRECTWRITEDC)) {
+ HDC hdc = ::GetDC(MainHWND());
+ FullPaintDC(hdc);
+ ::ReleaseDC(MainHWND(), hdc);
+ } else {
+ FullPaintDC(0);
+ }
+}
+
+/**
+ * Redraw all of text area on the specified DC.
+ * This paint will not be abandoned.
+ */
+void ScintillaWin::FullPaintDC(HDC hdc) {
+ paintState = painting;
+ rcPaint = GetClientRectangle();
+ paintingAllText = true;
+ if (technology == SC_TECHNOLOGY_DEFAULT) {
+ AutoSurface surfaceWindow(hdc, this);
+ if (surfaceWindow) {
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ }
+ } else {
+#if defined(USE_D2D)
+ EnsureRenderTarget(hdc);
+ AutoSurface surfaceWindow(pRenderTarget, this);
+ if (surfaceWindow) {
+ pRenderTarget->BeginDraw();
+ Paint(surfaceWindow, rcPaint);
+ surfaceWindow->Release();
+ HRESULT hr = pRenderTarget->EndDraw();
+ if (hr == D2DERR_RECREATE_TARGET) {
+ DropRenderTarget();
+ }
+ }
+#endif
+ }
+ paintState = notPainting;
+}
+
+static bool CompareDevCap(HDC hdc, HDC hOtherDC, int nIndex) {
+ return ::GetDeviceCaps(hdc, nIndex) == ::GetDeviceCaps(hOtherDC, nIndex);
+}
+
+bool ScintillaWin::IsCompatibleDC(HDC hOtherDC) {
+ HDC hdc = ::GetDC(MainHWND());
+ bool isCompatible =
+ CompareDevCap(hdc, hOtherDC, TECHNOLOGY) &&
+ CompareDevCap(hdc, hOtherDC, LOGPIXELSY) &&
+ CompareDevCap(hdc, hOtherDC, LOGPIXELSX) &&
+ CompareDevCap(hdc, hOtherDC, BITSPIXEL) &&
+ CompareDevCap(hdc, hOtherDC, PLANES);
+ ::ReleaseDC(MainHWND(), hdc);
+ return isCompatible;
+}
+
+DWORD ScintillaWin::EffectFromState(DWORD grfKeyState) const {
+ // These are the Wordpad semantics.
+ DWORD dwEffect;
+ if (inDragDrop == ddDragging) // Internal defaults to move
+ dwEffect = DROPEFFECT_MOVE;
+ else
+ dwEffect = DROPEFFECT_COPY;
+ if (grfKeyState & MK_ALT)
+ dwEffect = DROPEFFECT_MOVE;
+ if (grfKeyState & MK_CONTROL)
+ dwEffect = DROPEFFECT_COPY;
+ return dwEffect;
+}
+
+/// Implement IUnknown
+STDMETHODIMP ScintillaWin::QueryInterface(REFIID riid, PVOID *ppv) {
+ *ppv = NULL;
+ if (riid == IID_IUnknown)
+ *ppv = reinterpret_cast<IDropTarget *>(&dt);
+ if (riid == IID_IDropSource)
+ *ppv = reinterpret_cast<IDropSource *>(&ds);
+ if (riid == IID_IDropTarget)
+ *ppv = reinterpret_cast<IDropTarget *>(&dt);
+ if (riid == IID_IDataObject)
+ *ppv = reinterpret_cast<IDataObject *>(&dob);
+ if (!*ppv)
+ return E_NOINTERFACE;
+ return S_OK;
+}
+
+STDMETHODIMP_(ULONG) ScintillaWin::AddRef() {
+ return 1;
+}
+
+STDMETHODIMP_(ULONG) ScintillaWin::Release() {
+ return 1;
+}
+
+/// Implement IDropTarget
+STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL, PDWORD pdwEffect) {
+ if (pIDataSource == NULL)
+ return E_POINTER;
+ FORMATETC fmtu = {CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ HRESULT hrHasUText = pIDataSource->QueryGetData(&fmtu);
+ hasOKText = (hrHasUText == S_OK);
+ if (!hasOKText) {
+ FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ HRESULT hrHasText = pIDataSource->QueryGetData(&fmte);
+ hasOKText = (hrHasText == S_OK);
+ }
+ if (!hasOKText) {
+ *pdwEffect = DROPEFFECT_NONE;
+ return S_OK;
+ }
+
+ *pdwEffect = EffectFromState(grfKeyState);
+ return S_OK;
+}
+
+STDMETHODIMP ScintillaWin::DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) {
+ try {
+ if (!hasOKText || pdoc->IsReadOnly()) {
+ *pdwEffect = DROPEFFECT_NONE;
+ return S_OK;
+ }
+
+ *pdwEffect = EffectFromState(grfKeyState);
+
+ // Update the cursor.
+ POINT rpt = {pt.x, pt.y};
+ ::ScreenToClient(MainHWND(), &rpt);
+ SetDragPosition(SPositionFromLocation(PointFromPOINT(rpt), false, false, UserVirtualSpace()));
+
+ return S_OK;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+
+STDMETHODIMP ScintillaWin::DragLeave() {
+ try {
+ SetDragPosition(SelectionPosition(invalidPosition));
+ return S_OK;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+
+STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,
+ POINTL pt, PDWORD pdwEffect) {
+ try {
+ *pdwEffect = EffectFromState(grfKeyState);
+
+ if (pIDataSource == NULL)
+ return E_POINTER;
+
+ SetDragPosition(SelectionPosition(invalidPosition));
+
+ STGMEDIUM medium = {0, {0}, 0};
+
+ std::vector<char> data; // Includes terminating NUL
+
+ FORMATETC fmtu = {CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ HRESULT hr = pIDataSource->GetData(&fmtu, &medium);
+ if (SUCCEEDED(hr) && medium.hGlobal) {
+ GlobalMemory memUDrop(medium.hGlobal);
+ wchar_t *udata = static_cast<wchar_t *>(memUDrop.ptr);
+ if (udata) {
+ if (IsUnicodeMode()) {
+ int tlen = static_cast<int>(memUDrop.Size());
+ // Convert UTF-16 to UTF-8
+ int dataLen = UTF8Length(udata, tlen/2);
+ data.resize(dataLen+1);
+ UTF8FromUTF16(udata, tlen/2, &data[0], dataLen);
+ } else {
+ // Convert UTF-16 to ANSI
+ //
+ // Default Scintilla behavior in Unicode mode
+ // CF_UNICODETEXT available, but not in Unicode mode
+ // Convert from Unicode to current Scintilla code page
+ UINT cpDest = CodePageOfDocument();
+ int tlen = ::WideCharToMultiByte(cpDest, 0, udata, -1,
+ NULL, 0, NULL, NULL) - 1; // subtract 0 terminator
+ data.resize(tlen + 1);
+ ::WideCharToMultiByte(cpDest, 0, udata, -1,
+ &data[0], tlen + 1, NULL, NULL);
+ }
+ }
+ memUDrop.Unlock();
+ } else {
+ FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ hr = pIDataSource->GetData(&fmte, &medium);
+ if (SUCCEEDED(hr) && medium.hGlobal) {
+ GlobalMemory memDrop(medium.hGlobal);
+ const char *cdata = static_cast<char *>(memDrop.ptr);
+ if (cdata)
+ data.assign(cdata, cdata+strlen(cdata)+1);
+ memDrop.Unlock();
+ }
+ }
+
+ if (!SUCCEEDED(hr) || data.empty()) {
+ //Platform::DebugPrintf("Bad data format: 0x%x\n", hres);
+ return hr;
+ }
+
+ FORMATETC fmtr = {cfColumnSelect, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
+ HRESULT hrRectangular = pIDataSource->QueryGetData(&fmtr);
+
+ POINT rpt = {pt.x, pt.y};
+ ::ScreenToClient(MainHWND(), &rpt);
+ SelectionPosition movePos = SPositionFromLocation(PointFromPOINT(rpt), false, false, UserVirtualSpace());
+
+ DropAt(movePos, &data[0], data.size() - 1, *pdwEffect == DROPEFFECT_MOVE, hrRectangular == S_OK);
+
+ // Free data
+ if (medium.pUnkForRelease != NULL)
+ medium.pUnkForRelease->Release();
+ else
+ ::GlobalFree(medium.hGlobal);
+
+ return S_OK;
+ } catch (...) {
+ errorStatus = SC_STATUS_FAILURE;
+ }
+ return E_FAIL;
+}
+
+/// Implement important part of IDataObject
+STDMETHODIMP ScintillaWin::GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM) {
+ bool formatOK = (pFEIn->cfFormat == CF_TEXT) ||
+ ((pFEIn->cfFormat == CF_UNICODETEXT) && IsUnicodeMode());
+ if (!formatOK ||
+ pFEIn->ptd != 0 ||
+ (pFEIn->dwAspect & DVASPECT_CONTENT) == 0 ||
+ pFEIn->lindex != -1 ||
+ (pFEIn->tymed & TYMED_HGLOBAL) == 0
+ ) {
+ //Platform::DebugPrintf("DOB GetData No %d %x %x fmt=%x\n", lenDrag, pFEIn, pSTM, pFEIn->cfFormat);
+ return DATA_E_FORMATETC;
+ }
+ pSTM->tymed = TYMED_HGLOBAL;
+ //Platform::DebugPrintf("DOB GetData OK %d %x %x\n", lenDrag, pFEIn, pSTM);
+
+ GlobalMemory text;
+ if (pFEIn->cfFormat == CF_UNICODETEXT) {
+ size_t uchars = UTF16Length(drag.Data(), static_cast<int>(drag.LengthWithTerminator()));
+ text.Allocate(2 * uchars);
+ if (text) {
+ UTF16FromUTF8(drag.Data(), drag.LengthWithTerminator(),
+ static_cast<wchar_t *>(text.ptr), uchars);
+ }
+ } else {
+ text.Allocate(drag.LengthWithTerminator());
+ if (text) {
+ memcpy(static_cast<char *>(text.ptr), drag.Data(), drag.LengthWithTerminator());
+ }
+ }
+ pSTM->hGlobal = text ? text.Unlock() : 0;
+ pSTM->pUnkForRelease = 0;
+ return S_OK;
+}
+
+bool ScintillaWin::Register(HINSTANCE hInstance_) {
+
+ hInstance = hInstance_;
+ bool result;
+
+ // Register the Scintilla class
+ // Register Scintilla as a wide character window
+ WNDCLASSEXW wndclass;
+ wndclass.cbSize = sizeof(wndclass);
+ wndclass.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = ScintillaWin::SWndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = sizeof(ScintillaWin *);
+ wndclass.hInstance = hInstance;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = NULL;
+ wndclass.hbrBackground = NULL;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = L"Scintilla";
+ wndclass.hIconSm = 0;
+ scintillaClassAtom = ::RegisterClassExW(&wndclass);
+ result = 0 != scintillaClassAtom;
+
+ if (result) {
+ // Register the CallTip class
+ WNDCLASSEX wndclassc;
+ wndclassc.cbSize = sizeof(wndclassc);
+ wndclassc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
+ wndclassc.cbClsExtra = 0;
+ wndclassc.cbWndExtra = sizeof(ScintillaWin *);
+ wndclassc.hInstance = hInstance;
+ wndclassc.hIcon = NULL;
+ wndclassc.hbrBackground = NULL;
+ wndclassc.lpszMenuName = NULL;
+ wndclassc.lpfnWndProc = ScintillaWin::CTWndProc;
+ wndclassc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
+ wndclassc.lpszClassName = callClassName;
+ wndclassc.hIconSm = 0;
+
+ callClassAtom = ::RegisterClassEx(&wndclassc);
+ result = 0 != callClassAtom;
+ }
+
+ return result;
+}
+
+bool ScintillaWin::Unregister() {
+ bool result = true;
+ if (0 != scintillaClassAtom) {
+ if (::UnregisterClass(MAKEINTATOM(scintillaClassAtom), hInstance) == 0) {
+ result = false;
+ }
+ scintillaClassAtom = 0;
+ }
+ if (0 != callClassAtom) {
+ if (::UnregisterClass(MAKEINTATOM(callClassAtom), hInstance) == 0) {
+ result = false;
+ }
+ callClassAtom = 0;
+ }
+ return result;
+}
+
+bool ScintillaWin::HasCaretSizeChanged() const {
+ if (
+ ( (0 != vs.caretWidth) && (sysCaretWidth != vs.caretWidth) )
+ || ((0 != vs.lineHeight) && (sysCaretHeight != vs.lineHeight))
+ ) {
+ return true;
+ }
+ return false;
+}
+
+BOOL ScintillaWin::CreateSystemCaret() {
+ sysCaretWidth = vs.caretWidth;
+ if (0 == sysCaretWidth) {
+ sysCaretWidth = 1;
+ }
+ sysCaretHeight = vs.lineHeight;
+ int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) *
+ sysCaretHeight;
+ std::vector<char> bits(bitmapSize);
+ sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1,
+ 1, reinterpret_cast<BYTE *>(&bits[0]));
+ BOOL retval = ::CreateCaret(
+ MainHWND(), sysCaretBitmap,
+ sysCaretWidth, sysCaretHeight);
+ if (technology == SC_TECHNOLOGY_DEFAULT) {
+ // System caret interferes with Direct2D drawing so only show it for GDI.
+ ::ShowCaret(MainHWND());
+ }
+ return retval;
+}
+
+BOOL ScintillaWin::DestroySystemCaret() {
+ ::HideCaret(MainHWND());
+ BOOL retval = ::DestroyCaret();
+ if (sysCaretBitmap) {
+ ::DeleteObject(sysCaretBitmap);
+ sysCaretBitmap = 0;
+ }
+ return retval;
+}
+
+sptr_t PASCAL ScintillaWin::CTWndProc(
+ HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) {
+ // Find C++ object associated with window.
+ ScintillaWin *sciThis = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd));
+ try {
+ // ctp will be zero if WM_CREATE not seen yet
+ if (sciThis == 0) {
+ if (iMessage == WM_CREATE) {
+ // Associate CallTip object with window
+ CREATESTRUCT *pCreate = reinterpret_cast<CREATESTRUCT *>(lParam);
+ SetWindowPointer(hWnd, pCreate->lpCreateParams);
+ return 0;
+ } else {
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ }
+ } else {
+ if (iMessage == WM_NCDESTROY) {
+ ::SetWindowLong(hWnd, 0, 0);
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ } else if (iMessage == WM_PAINT) {
+ PAINTSTRUCT ps;
+ ::BeginPaint(hWnd, &ps);
+ Surface *surfaceWindow = Surface::Allocate(sciThis->technology);
+ if (surfaceWindow) {
+#if defined(USE_D2D)
+ ID2D1HwndRenderTarget *pCTRenderTarget = 0;
+#endif
+ RECT rc;
+ GetClientRect(hWnd, &rc);
+ // Create a Direct2D render target.
+ if (sciThis->technology == SC_TECHNOLOGY_DEFAULT) {
+ surfaceWindow->Init(ps.hdc, hWnd);
+ } else {
+#if defined(USE_D2D)
+ D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp;
+ dhrtp.hwnd = hWnd;
+ dhrtp.pixelSize = D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top);
+ dhrtp.presentOptions = (sciThis->technology == SC_TECHNOLOGY_DIRECTWRITERETAIN) ?
+ D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS : D2D1_PRESENT_OPTIONS_NONE;
+
+ D2D1_RENDER_TARGET_PROPERTIES drtp;
+ drtp.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
+ drtp.pixelFormat.format = DXGI_FORMAT_UNKNOWN;
+ drtp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN;
+ drtp.dpiX = 96.0;
+ drtp.dpiY = 96.0;
+ drtp.usage = D2D1_RENDER_TARGET_USAGE_NONE;
+ drtp.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
+
+ if (!SUCCEEDED(pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pCTRenderTarget))) {
+ surfaceWindow->Release();
+ delete surfaceWindow;
+ ::EndPaint(hWnd, &ps);
+ return 0;
+ }
+ surfaceWindow->Init(pCTRenderTarget, hWnd);
+ pCTRenderTarget->BeginDraw();
+#endif
+ }
+ surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == sciThis->ct.codePage);
+ surfaceWindow->SetDBCSMode(sciThis->ct.codePage);
+ sciThis->ct.PaintCT(surfaceWindow);
+#if defined(USE_D2D)
+ if (pCTRenderTarget)
+ pCTRenderTarget->EndDraw();
+#endif
+ surfaceWindow->Release();
+ delete surfaceWindow;
+#if defined(USE_D2D)
+ if (pCTRenderTarget)
+ pCTRenderTarget->Release();
+#endif
+ }
+ ::EndPaint(hWnd, &ps);
+ return 0;
+ } else if ((iMessage == WM_NCLBUTTONDOWN) || (iMessage == WM_NCLBUTTONDBLCLK)) {
+ POINT pt;
+ pt.x = static_cast<short>(LOWORD(lParam));
+ pt.y = static_cast<short>(HIWORD(lParam));
+ ScreenToClient(hWnd, &pt);
+ sciThis->ct.MouseClick(PointFromPOINT(pt));
+ sciThis->CallTipClick();
+ return 0;
+ } else if (iMessage == WM_LBUTTONDOWN) {
+ // This does not fire due to the hit test code
+ sciThis->ct.MouseClick(Point::FromLong(static_cast<long>(lParam)));
+ sciThis->CallTipClick();
+ return 0;
+ } else if (iMessage == WM_SETCURSOR) {
+ ::SetCursor(::LoadCursor(NULL, IDC_ARROW));
+ return 0;
+ } else if (iMessage == WM_NCHITTEST) {
+ return HTCAPTION;
+ } else {
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ }
+ }
+ } catch (...) {
+ sciThis->errorStatus = SC_STATUS_FAILURE;
+ }
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+}
+
+sptr_t ScintillaWin::DirectFunction(
+ sptr_t ptr, UINT iMessage, uptr_t wParam, sptr_t lParam) {
+ PLATFORM_ASSERT(::GetCurrentThreadId() == ::GetWindowThreadProcessId(reinterpret_cast<ScintillaWin *>(ptr)->MainHWND(), NULL));
+ return reinterpret_cast<ScintillaWin *>(ptr)->WndProc(iMessage, wParam, lParam);
+}
+
+extern "C"
+#ifndef STATIC_BUILD
+__declspec(dllexport)
+#endif
+sptr_t __stdcall Scintilla_DirectFunction(
+ ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) {
+ return sci->WndProc(iMessage, wParam, lParam);
+}
+
+sptr_t PASCAL ScintillaWin::SWndProc(
+ HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) {
+ //Platform::DebugPrintf("S W:%x M:%x WP:%x L:%x\n", hWnd, iMessage, wParam, lParam);
+
+ // Find C++ object associated with window.
+ ScintillaWin *sci = reinterpret_cast<ScintillaWin *>(PointerFromWindow(hWnd));
+ // sci will be zero if WM_CREATE not seen yet
+ if (sci == 0) {
+ try {
+ if (iMessage == WM_CREATE) {
+ // Create C++ object associated with window
+ sci = new ScintillaWin(hWnd);
+ SetWindowPointer(hWnd, sci);
+ return sci->WndProc(iMessage, wParam, lParam);
+ }
+ } catch (...) {
+ }
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ } else {
+ if (iMessage == WM_NCDESTROY) {
+ try {
+ sci->Finalise();
+ delete sci;
+ } catch (...) {
+ }
+ ::SetWindowLong(hWnd, 0, 0);
+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam);
+ } else {
+ return sci->WndProc(iMessage, wParam, lParam);
+ }
+ }
+}
+
+// This function is externally visible so it can be called from container when building statically.
+// Must be called once only.
+int Scintilla_RegisterClasses(void *hInstance) {
+ Platform_Initialise(hInstance);
+ bool result = ScintillaWin::Register(reinterpret_cast<HINSTANCE>(hInstance));
+#ifdef SCI_LEXER
+ Scintilla_LinkLexers();
+#endif
+ return result;
+}
+
+static int ResourcesRelease(bool fromDllMain) {
+ bool result = ScintillaWin::Unregister();
+ if (commctrl32) {
+ FreeLibrary(commctrl32);
+ commctrl32 = NULL;
+ }
+ Platform_Finalise(fromDllMain);
+ return result;
+}
+
+// This function is externally visible so it can be called from container when building statically.
+int Scintilla_ReleaseResources() {
+ return ResourcesRelease(false);
+}
+
+#ifndef STATIC_BUILD
+extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) {
+ //Platform::DebugPrintf("Scintilla::DllMain %d %d\n", hInstance, dwReason);
+ if (dwReason == DLL_PROCESS_ATTACH) {
+ if (!Scintilla_RegisterClasses(hInstance))
+ return FALSE;
+ } else if (dwReason == DLL_PROCESS_DETACH) {
+ if (lpvReserved == NULL) {
+ ResourcesRelease(true);
+ }
+ }
+ return TRUE;
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/deps.mak b/3rdparty/bgfx/3rdparty/scintilla/win32/deps.mak
new file mode 100644
index 00000000000..b92e3054595
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/deps.mak
@@ -0,0 +1,535 @@
+CheckD2D.o: CheckD2D.cxx
+PlatWin.o: PlatWin.cxx ../include/Platform.h ../lexlib/StringCopy.h \
+ ../src/XPM.h ../src/UniConversion.h ../src/FontQuality.h
+ScintillaWin.o: ScintillaWin.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/StringCopy.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \
+ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
+ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \
+ ../src/CaseConvert.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h ../src/Editor.h ../src/AutoComplete.h \
+ ../src/ScintillaBase.h PlatWin.h
+AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/CharacterSet.h ../src/AutoComplete.h
+CallTip.o: ../src/CallTip.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/CallTip.h
+CaseConvert.o: ../src/CaseConvert.cxx ../lexlib/StringCopy.h \
+ ../src/CaseConvert.h ../src/UniConversion.h ../src/UnicodeFromUTF8.h
+CaseFolder.o: ../src/CaseFolder.cxx ../src/CaseFolder.h \
+ ../src/CaseConvert.h ../src/UniConversion.h
+Catalogue.o: ../src/Catalogue.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/LexerModule.h \
+ ../src/Catalogue.h
+CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/CellBuffer.h ../src/UniConversion.h
+CharClassify.o: ../src/CharClassify.cxx ../src/CharClassify.h
+ContractionState.o: ../src/ContractionState.cxx ../include/Platform.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h
+Decoration.o: ../src/Decoration.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h ../src/Decoration.h
+Document.o: ../src/Document.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/CharacterSet.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \
+ ../src/PerLine.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/RESearch.h \
+ ../src/UniConversion.h
+EditModel.o: ../src/EditModel.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/StringCopy.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \
+ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
+ ../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/UniConversion.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h
+Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h ../src/Editor.h
+EditView.o: ../src/EditView.cxx ../include/Platform.h ../include/ILexer.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \
+ ../src/EditView.h
+ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../include/SciLexer.h \
+ ../lexlib/LexerModule.h ../src/Catalogue.h ../src/ExternalLexer.h
+Indicator.o: ../src/Indicator.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/Indicator.h ../src/XPM.h
+KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \
+ ../src/KeyMap.h
+LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../lexlib/StringCopy.h ../src/XPM.h \
+ ../src/LineMarker.h
+MarginView.o: ../src/MarginView.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/StringCopy.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/KeyMap.h \
+ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \
+ ../src/ViewStyle.h ../src/CharClassify.h ../src/Decoration.h \
+ ../src/CaseFolder.h ../src/Document.h ../src/UniConversion.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h \
+ ../src/MarginView.h ../src/EditView.h
+PerLine.o: ../src/PerLine.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/CellBuffer.h ../src/PerLine.h
+PositionCache.o: ../src/PositionCache.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../src/SplitVector.h \
+ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \
+ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \
+ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \
+ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \
+ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \
+ ../src/PositionCache.h
+RESearch.o: ../src/RESearch.cxx ../src/CharClassify.h ../src/RESearch.h
+RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h
+ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../lexlib/PropSetSimple.h \
+ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \
+ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \
+ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \
+ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \
+ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h \
+ ../src/MarginView.h ../src/EditView.h ../src/Editor.h \
+ ../src/AutoComplete.h ../src/ScintillaBase.h
+Selection.o: ../src/Selection.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/Selection.h
+Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \
+ ../src/Style.h
+UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h
+ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \
+ ../include/Scintilla.h ../src/SplitVector.h ../src/Partitioning.h \
+ ../src/RunStyles.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \
+ ../src/Style.h ../src/ViewStyle.h
+XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h
+Accessor.o: ../lexlib/Accessor.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h
+CharacterCategory.o: ../lexlib/CharacterCategory.cxx \
+ ../lexlib/StringCopy.h ../lexlib/CharacterCategory.h
+CharacterSet.o: ../lexlib/CharacterSet.cxx ../lexlib/CharacterSet.h
+LexerBase.o: ../lexlib/LexerBase.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h
+LexerModule.o: ../lexlib/LexerModule.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h ../lexlib/LexerSimple.h
+LexerNoExceptions.o: ../lexlib/LexerNoExceptions.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h \
+ ../lexlib/LexerNoExceptions.h
+LexerSimple.o: ../lexlib/LexerSimple.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h ../lexlib/LexerSimple.h
+PropSetSimple.o: ../lexlib/PropSetSimple.cxx ../lexlib/PropSetSimple.h
+StyleContext.o: ../lexlib/StyleContext.cxx ../include/ILexer.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h
+WordList.o: ../lexlib/WordList.cxx ../lexlib/StringCopy.h \
+ ../lexlib/WordList.h
+LexA68k.o: ../lexers/LexA68k.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexAbaqus.o: ../lexers/LexAbaqus.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexAda.o: ../lexers/LexAda.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAPDL.o: ../lexers/LexAPDL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexAsm.o: ../lexers/LexAsm.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexAsn1.o: ../lexers/LexAsn1.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexASY.o: ../lexers/LexASY.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAU3.o: ../lexers/LexAU3.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAVE.o: ../lexers/LexAVE.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexAVS.o: ../lexers/LexAVS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexBaan.o: ../lexers/LexBaan.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexBash.o: ../lexers/LexBash.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexBasic.o: ../lexers/LexBasic.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexBullant.o: ../lexers/LexBullant.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCaml.o: ../lexers/LexCaml.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexCLW.o: ../lexers/LexCLW.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexCmake.o: ../lexers/LexCmake.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCOBOL.o: ../lexers/LexCOBOL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCoffeeScript.o: ../lexers/LexCoffeeScript.cxx ../include/Platform.h \
+ ../include/ILexer.h ../include/Scintilla.h ../include/SciLexer.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexConf.o: ../lexers/LexConf.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCPP.o: ../lexers/LexCPP.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h \
+ ../lexlib/SubStyles.h
+LexCrontab.o: ../lexers/LexCrontab.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCsound.o: ../lexers/LexCsound.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexCSS.o: ../lexers/LexCSS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexD.o: ../lexers/LexD.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexDMAP.o: ../lexers/LexDMAP.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexDMIS.o: ../lexers/LexDMIS.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexECL.o: ../lexers/LexECL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/PropSetSimple.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexEiffel.o: ../lexers/LexEiffel.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexErlang.o: ../lexers/LexErlang.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexEScript.o: ../lexers/LexEScript.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexFlagship.o: ../lexers/LexFlagship.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexForth.o: ../lexers/LexForth.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexFortran.o: ../lexers/LexFortran.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexGAP.o: ../lexers/LexGAP.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexGui4Cli.o: ../lexers/LexGui4Cli.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexHaskell.o: ../lexers/LexHaskell.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/CharacterCategory.h ../lexlib/LexerModule.h \
+ ../lexlib/OptionSet.h
+LexHTML.o: ../lexers/LexHTML.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/StringCopy.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexInno.o: ../lexers/LexInno.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexKix.o: ../lexers/LexKix.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexKVIrc.o: ../lexers/LexKVIrc.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexLaTeX.o: ../lexers/LexLaTeX.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/LexerBase.h
+LexLisp.o: ../lexers/LexLisp.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexLout.o: ../lexers/LexLout.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexLua.o: ../lexers/LexLua.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMagik.o: ../lexers/LexMagik.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMarkdown.o: ../lexers/LexMarkdown.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMatlab.o: ../lexers/LexMatlab.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMetapost.o: ../lexers/LexMetapost.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMMIXAL.o: ../lexers/LexMMIXAL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexModula.o: ../lexers/LexModula.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMPT.o: ../lexers/LexMPT.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexMSSQL.o: ../lexers/LexMSSQL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexMySQL.o: ../lexers/LexMySQL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexNimrod.o: ../lexers/LexNimrod.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexNsis.o: ../lexers/LexNsis.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOpal.o: ../lexers/LexOpal.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOScript.o: ../lexers/LexOScript.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexOthers.o: ../lexers/LexOthers.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPascal.o: ../lexers/LexPascal.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPB.o: ../lexers/LexPB.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPerl.o: ../lexers/LexPerl.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexPLM.o: ../lexers/LexPLM.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPO.o: ../lexers/LexPO.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPOV.o: ../lexers/LexPOV.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPowerPro.o: ../lexers/LexPowerPro.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPowerShell.o: ../lexers/LexPowerShell.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexProgress.o: ../lexers/LexProgress.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexPS.o: ../lexers/LexPS.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexPython.o: ../lexers/LexPython.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexR.o: ../lexers/LexR.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexRebol.o: ../lexers/LexRebol.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexRuby.o: ../lexers/LexRuby.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexRust.o: ../lexers/LexRust.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexScriptol.o: ../lexers/LexScriptol.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSmalltalk.o: ../lexers/LexSmalltalk.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSML.o: ../lexers/LexSML.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexSorcus.o: ../lexers/LexSorcus.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSpecman.o: ../lexers/LexSpecman.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSpice.o: ../lexers/LexSpice.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexSQL.o: ../lexers/LexSQL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h
+LexSTTXT.o: ../lexers/LexSTTXT.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTACL.o: ../lexers/LexTACL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTADS3.o: ../lexers/LexTADS3.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTAL.o: ../lexers/LexTAL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTCL.o: ../lexers/LexTCL.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTCMD.o: ../lexers/LexTCMD.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexTeX.o: ../lexers/LexTeX.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexTxt2tags.o: ../lexers/LexTxt2tags.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVB.o: ../lexers/LexVB.cxx ../include/ILexer.h ../include/Scintilla.h \
+ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h
+LexVerilog.o: ../lexers/LexVerilog.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVHDL.o: ../lexers/LexVHDL.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
+LexVisualProlog.o: ../lexers/LexVisualProlog.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/CharacterCategory.h \
+ ../lexlib/LexerModule.h ../lexlib/OptionSet.h
+LexYAML.o: ../lexers/LexYAML.cxx ../include/ILexer.h \
+ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/makefile b/3rdparty/bgfx/3rdparty/scintilla/win32/makefile
new file mode 100644
index 00000000000..6aa0d613983
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/makefile
@@ -0,0 +1,171 @@
+# Make file for Scintilla on Windows
+# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+# The License.txt file describes the conditions under which this software may be distributed.
+# This makefile assumes the MinGW32 version of GCC 4.x is used and changes will
+# be needed to use other compilers.
+
+.SUFFIXES: .cxx
+ifeq ($(OS),Windows_NT)
+DEL = del /q
+else
+DEL = rm -f
+endif
+RANLIB ?= ranlib
+WINDRES ?= windres
+
+COMPONENT = ../bin/Scintilla.dll
+LEXCOMPONENT = ../bin/SciLexer.dll
+LEXLIB = Lexers.a
+
+vpath %.h ../src ../include ../lexlib
+vpath %.cxx ../src ../lexlib ../lexers
+
+LDFLAGS=-shared -static -Wl,--enable-runtime-pseudo-reloc-v2 -mwindows -Wl,--add-stdcall-alias
+LIBS=-lstdc++ -limm32 -lole32 -luuid -loleaut32
+# Add -MMD to get dependencies
+INCLUDEDIRS=-I ../include -I ../src -I../lexlib
+
+# Check if Direct2D headers are available by trying to compile a file that includes them.
+# Most distributions of MinGW32 do not include Direct2D support but MinGW64 does.
+ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
+D2DFLAGS=-DDISABLE_D2D
+endif
+
+CXXBASEFLAGS=--std=c++0x -Wall -pedantic $(INCLUDEDIRS) -fno-rtti $(D2DFLAGS)
+
+ifdef CXX11_REGEX
+REFLAGS=-DCXX11_REGEX
+endif
+
+ifdef DEBUG
+CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS)
+else
+CXXFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS)
+STRIPFLAG=-s
+endif
+
+.cxx.o:
+ $(CXX) $(CXXFLAGS) $(REFLAGS) -c $<
+
+ALL: $(COMPONENT) $(LEXCOMPONENT) $(LEXLIB) ScintillaWinS.o
+
+clean:
+ $(DEL) *.exe *.o *.obj *.dll *.res *.map *.plist
+
+analyze:
+ clang --analyze -D DISABLE_D2D $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
+
+deps:
+ $(CXX) -MM $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx >deps.mak
+
+LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
+
+
+BASEOBJS = \
+ AutoComplete.o \
+ CallTip.o \
+ CaseConvert.o \
+ CaseFolder.o \
+ CellBuffer.o \
+ CharacterCategory.o \
+ CharacterSet.o \
+ CharClassify.o \
+ ContractionState.o \
+ Decoration.o \
+ Document.o \
+ EditModel.o \
+ Editor.o \
+ EditView.o \
+ KeyMap.o \
+ Indicator.o \
+ LineMarker.o \
+ MarginView.o \
+ PerLine.o \
+ PlatWin.o \
+ PositionCache.o \
+ PropSetSimple.o \
+ RESearch.o \
+ RunStyles.o \
+ ScintRes.o \
+ Selection.o \
+ Style.o \
+ UniConversion.o \
+ ViewStyle.o \
+ XPM.o \
+ HanjaDic.o
+
+SOBJS = ScintillaWin.o ScintillaBase.o $(BASEOBJS)
+
+$(COMPONENT): $(SOBJS) Scintilla.def
+ $(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $(SOBJS) $(CXXFLAGS) $(LIBS)
+
+LOBJS = \
+ Accessor.o \
+ Catalogue.o \
+ ExternalLexer.o \
+ LexerBase.o \
+ LexerModule.o \
+ LexerSimple.o \
+ ScintillaWinL.o \
+ ScintillaBaseL.o \
+ StyleContext.o \
+ WordList.o \
+ $(BASEOBJS) \
+ $(LEXOBJS)
+$(LEXCOMPONENT): $(LOBJS) Scintilla.def
+ $(CXX) $(LDFLAGS) -o $@ $(STRIPFLAG) $(LOBJS) $(CXXFLAGS) $(LIBS)
+
+$(LEXLIB): $(LEXOBJS)
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+# Automatically generate dependencies for most files with "make deps"
+include deps.mak
+
+# These dependencies are maintained by hand as they do not use the default output name
+
+ScintillaBaseL.o: ScintillaBase.cxx Platform.h \
+ ILexer.h Scintilla.h SciLexer.h PropSetSimple.h \
+ SplitVector.h Partitioning.h RunStyles.h \
+ ContractionState.h CellBuffer.h CallTip.h \
+ KeyMap.h Indicator.h XPM.h LineMarker.h \
+ Style.h ViewStyle.h AutoComplete.h \
+ CharClassify.h Decoration.h Document.h \
+ Selection.h PositionCache.h EditModel.h Editor.h EditView.h \
+ ScintillaBase.h LexAccessor.h Accessor.h \
+ LexerModule.h Catalogue.h CaseFolder.h
+
+ScintillaWinL.o: ScintillaWin.cxx Platform.h \
+ ILexer.h Scintilla.h SplitVector.h \
+ Partitioning.h RunStyles.h ContractionState.h \
+ CellBuffer.h CallTip.h KeyMap.h Indicator.h \
+ XPM.h LineMarker.h Style.h AutoComplete.h \
+ ViewStyle.h CharClassify.h Decoration.h \
+ Document.h Selection.h PositionCache.h \
+ EditModel.h Editor.h EditView.h ScintillaBase.h UniConversion.h \
+ LexAccessor.h Accessor.h \
+ LexerModule.h Catalogue.h CaseConvert.h \
+ CaseFolder.h
+
+ScintillaWinS.o: ScintillaWin.cxx Platform.h \
+ ILexer.h Scintilla.h SplitVector.h \
+ Partitioning.h RunStyles.h ContractionState.h \
+ CellBuffer.h CallTip.h KeyMap.h Indicator.h \
+ XPM.h LineMarker.h Style.h AutoComplete.h \
+ ViewStyle.h CharClassify.h Decoration.h \
+ Document.h Selection.h PositionCache.h \
+ EditModel.h Editor.h EditView.h ScintillaBase.h UniConversion.h \
+ CaseConvert.h CaseFolder.h
+
+ScintillaBaseL.o:
+ $(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
+
+ScintillaWinS.o:
+ $(CXX) $(CXXFLAGS) -D STATIC_BUILD -c $< -o $@
+
+ScintillaWinL.o:
+ $(CXX) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
+
+ScintRes.o: ScintRes.rc
+ $(WINDRES) ScintRes.rc $@
+
diff --git a/3rdparty/bgfx/3rdparty/scintilla/win32/scintilla.mak b/3rdparty/bgfx/3rdparty/scintilla/win32/scintilla.mak
new file mode 100644
index 00000000000..5b4975ef354
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/win32/scintilla.mak
@@ -0,0 +1,992 @@
+# Make file for Scintilla on Windows Visual C++ version
+# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+# The License.txt file describes the conditions under which this software may be distributed.
+# This makefile is for using Visual C++ with nmake.
+# Usage for Microsoft:
+# nmake -f scintilla.mak
+# For debug versions define DEBUG on the command line:
+# nmake DEBUG=1 -f scintilla.mak
+# The main makefile uses mingw32 gcc and may be more current than this file.
+
+.SUFFIXES: .cxx
+
+DIR_O=.
+DIR_BIN=..\bin
+
+COMPONENT=$(DIR_BIN)\Scintilla.dll
+LEXCOMPONENT=$(DIR_BIN)\SciLexer.dll
+LEXLIB=Lexers.lib
+
+LD=link
+
+CRTFLAGS=-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_DEPRECATE=1
+CXXFLAGS=-Zi -TP -MP -W4 -EHsc -Zc:forScope -Zc:wchar_t $(CRTFLAGS)
+CXXDEBUG=-Od -MTd -DDEBUG
+CXXNDEBUG=-O1 -MT -DNDEBUG -GL
+NAME=-Fo
+LDFLAGS=-OPT:REF -LTCG -DEBUG
+LDDEBUG=
+LIBS=KERNEL32.lib USER32.lib GDI32.lib IMM32.lib OLE32.LIB OLEAUT32.LIB
+NOLOGO=-nologo
+
+!IFDEF QUIET
+CXX=@$(CXX)
+CXXFLAGS=$(CXXFLAGS) $(NOLOGO)
+LDFLAGS=$(LDFLAGS) $(NOLOGO)
+!ENDIF
+
+!IF [cl -c -nologo CheckD2D.cxx >NUL:]
+CXXFLAGS=$(CXXFLAGS) -DDISABLE_D2D
+!MESSAGE Direct2D is not available
+!ENDIF
+
+!IFDEF CXX11_REGEX
+CXXFLAGS=$(CXXFLAGS) -DCXX11_REGEX
+!ENDIF
+
+!IFDEF DEBUG
+CXXFLAGS=$(CXXFLAGS) $(CXXDEBUG)
+LDFLAGS=$(LDDEBUG) $(LDFLAGS)
+!ELSE
+CXXFLAGS=$(CXXFLAGS) $(CXXNDEBUG)
+!ENDIF
+
+INCLUDEDIRS=-I../include -I../src -I../lexlib
+CXXFLAGS=$(CXXFLAGS) $(INCLUDEDIRS)
+
+ALL: $(COMPONENT) $(LEXCOMPONENT) $(LEXLIB) $(DIR_O)\ScintillaWinS.obj
+
+clean:
+ -del /q $(DIR_O)\*.obj $(DIR_O)\*.pdb $(COMPONENT) $(LEXCOMPONENT) \
+ $(DIR_O)\*.res $(DIR_BIN)\*.map $(DIR_BIN)\*.exp $(DIR_BIN)\*.pdb $(DIR_BIN)\*.lib
+
+SHAREDOBJS=\
+ $(DIR_O)\AutoComplete.obj \
+ $(DIR_O)\CallTip.obj \
+ $(DIR_O)\CaseConvert.obj \
+ $(DIR_O)\CaseFolder.obj \
+ $(DIR_O)\CellBuffer.obj \
+ $(DIR_O)\CharacterCategory.obj \
+ $(DIR_O)\CharacterSet.obj \
+ $(DIR_O)\CharClassify.obj \
+ $(DIR_O)\ContractionState.obj \
+ $(DIR_O)\Decoration.obj \
+ $(DIR_O)\Document.obj \
+ $(DIR_O)\EditModel.obj \
+ $(DIR_O)\Editor.obj \
+ $(DIR_O)\EditView.obj \
+ $(DIR_O)\Indicator.obj \
+ $(DIR_O)\KeyMap.obj \
+ $(DIR_O)\LineMarker.obj \
+ $(DIR_O)\MarginView.obj \
+ $(DIR_O)\PerLine.obj \
+ $(DIR_O)\PlatWin.obj \
+ $(DIR_O)\PositionCache.obj \
+ $(DIR_O)\PropSetSimple.obj \
+ $(DIR_O)\RESearch.obj \
+ $(DIR_O)\RunStyles.obj \
+ $(DIR_O)\Selection.obj \
+ $(DIR_O)\Style.obj \
+ $(DIR_O)\UniConversion.obj \
+ $(DIR_O)\ViewStyle.obj \
+ $(DIR_O)\XPM.obj \
+ $(DIR_O)\HanjaDic.obj \
+
+SOBJS=\
+ $(SHAREDOBJS) \
+ $(DIR_O)\ScintillaBase.obj \
+ $(DIR_O)\ScintillaWin.obj
+
+#++Autogenerated -- run scripts/LexGen.py to regenerate
+#**LEXOBJS=\\\n\(\t$(DIR_O)\\\*.obj \\\n\)
+LEXOBJS=\
+ $(DIR_O)\LexA68k.obj \
+ $(DIR_O)\LexAbaqus.obj \
+ $(DIR_O)\LexAda.obj \
+ $(DIR_O)\LexAPDL.obj \
+ $(DIR_O)\LexAsm.obj \
+ $(DIR_O)\LexAsn1.obj \
+ $(DIR_O)\LexASY.obj \
+ $(DIR_O)\LexAU3.obj \
+ $(DIR_O)\LexAVE.obj \
+ $(DIR_O)\LexAVS.obj \
+ $(DIR_O)\LexBaan.obj \
+ $(DIR_O)\LexBash.obj \
+ $(DIR_O)\LexBasic.obj \
+ $(DIR_O)\LexBibTeX.obj \
+ $(DIR_O)\LexBullant.obj \
+ $(DIR_O)\LexCaml.obj \
+ $(DIR_O)\LexCLW.obj \
+ $(DIR_O)\LexCmake.obj \
+ $(DIR_O)\LexCOBOL.obj \
+ $(DIR_O)\LexCoffeeScript.obj \
+ $(DIR_O)\LexConf.obj \
+ $(DIR_O)\LexCPP.obj \
+ $(DIR_O)\LexCrontab.obj \
+ $(DIR_O)\LexCsound.obj \
+ $(DIR_O)\LexCSS.obj \
+ $(DIR_O)\LexD.obj \
+ $(DIR_O)\LexDMAP.obj \
+ $(DIR_O)\LexDMIS.obj \
+ $(DIR_O)\LexECL.obj \
+ $(DIR_O)\LexEiffel.obj \
+ $(DIR_O)\LexErlang.obj \
+ $(DIR_O)\LexEScript.obj \
+ $(DIR_O)\LexFlagship.obj \
+ $(DIR_O)\LexForth.obj \
+ $(DIR_O)\LexFortran.obj \
+ $(DIR_O)\LexGAP.obj \
+ $(DIR_O)\LexGui4Cli.obj \
+ $(DIR_O)\LexHaskell.obj \
+ $(DIR_O)\LexHex.obj \
+ $(DIR_O)\LexHTML.obj \
+ $(DIR_O)\LexInno.obj \
+ $(DIR_O)\LexKix.obj \
+ $(DIR_O)\LexKVIrc.obj \
+ $(DIR_O)\LexLaTeX.obj \
+ $(DIR_O)\LexLisp.obj \
+ $(DIR_O)\LexLout.obj \
+ $(DIR_O)\LexLua.obj \
+ $(DIR_O)\LexMagik.obj \
+ $(DIR_O)\LexMarkdown.obj \
+ $(DIR_O)\LexMatlab.obj \
+ $(DIR_O)\LexMetapost.obj \
+ $(DIR_O)\LexMMIXAL.obj \
+ $(DIR_O)\LexModula.obj \
+ $(DIR_O)\LexMPT.obj \
+ $(DIR_O)\LexMSSQL.obj \
+ $(DIR_O)\LexMySQL.obj \
+ $(DIR_O)\LexNimrod.obj \
+ $(DIR_O)\LexNsis.obj \
+ $(DIR_O)\LexOpal.obj \
+ $(DIR_O)\LexOScript.obj \
+ $(DIR_O)\LexOthers.obj \
+ $(DIR_O)\LexPascal.obj \
+ $(DIR_O)\LexPB.obj \
+ $(DIR_O)\LexPerl.obj \
+ $(DIR_O)\LexPLM.obj \
+ $(DIR_O)\LexPO.obj \
+ $(DIR_O)\LexPOV.obj \
+ $(DIR_O)\LexPowerPro.obj \
+ $(DIR_O)\LexPowerShell.obj \
+ $(DIR_O)\LexProgress.obj \
+ $(DIR_O)\LexPS.obj \
+ $(DIR_O)\LexPython.obj \
+ $(DIR_O)\LexR.obj \
+ $(DIR_O)\LexRebol.obj \
+ $(DIR_O)\LexRegistry.obj \
+ $(DIR_O)\LexRuby.obj \
+ $(DIR_O)\LexRust.obj \
+ $(DIR_O)\LexScriptol.obj \
+ $(DIR_O)\LexSmalltalk.obj \
+ $(DIR_O)\LexSML.obj \
+ $(DIR_O)\LexSorcus.obj \
+ $(DIR_O)\LexSpecman.obj \
+ $(DIR_O)\LexSpice.obj \
+ $(DIR_O)\LexSQL.obj \
+ $(DIR_O)\LexSTTXT.obj \
+ $(DIR_O)\LexTACL.obj \
+ $(DIR_O)\LexTADS3.obj \
+ $(DIR_O)\LexTAL.obj \
+ $(DIR_O)\LexTCL.obj \
+ $(DIR_O)\LexTCMD.obj \
+ $(DIR_O)\LexTeX.obj \
+ $(DIR_O)\LexTxt2tags.obj \
+ $(DIR_O)\LexVB.obj \
+ $(DIR_O)\LexVerilog.obj \
+ $(DIR_O)\LexVHDL.obj \
+ $(DIR_O)\LexVisualProlog.obj \
+ $(DIR_O)\LexYAML.obj \
+
+#--Autogenerated -- end of automatically generated section
+
+LOBJS=\
+ $(SHAREDOBJS) \
+ $(DIR_O)\Accessor.obj \
+ $(DIR_O)\Catalogue.obj \
+ $(DIR_O)\ExternalLexer.obj \
+ $(DIR_O)\LexerBase.obj \
+ $(DIR_O)\LexerModule.obj \
+ $(DIR_O)\LexerSimple.obj \
+ $(DIR_O)\StyleContext.obj \
+ $(DIR_O)\WordList.obj \
+ $(DIR_O)\ScintillaBaseL.obj \
+ $(DIR_O)\ScintillaWinL.obj \
+ $(LEXOBJS)
+
+$(DIR_O)\ScintRes.res : ScintRes.rc
+ $(RC) -fo$@ $**
+
+$(COMPONENT): $(SOBJS) $(DIR_O)\ScintRes.res
+ $(LD) $(LDFLAGS) -DEF:Scintilla.def -DLL -OUT:$@ $** $(LIBS)
+
+$(LEXCOMPONENT): $(LOBJS) $(DIR_O)\ScintRes.res
+ $(LD) $(LDFLAGS) -DEF:Scintilla.def -DLL -OUT:$@ $** $(LIBS)
+
+$(LEXLIB): $(LEXOBJS)
+ LIB /OUT:$@ $(LEXOBJS)
+
+# Define how to build all the objects and what they depend on
+
+{..\src}.cxx{$(DIR_O)}.obj::
+ $(CXX) $(CXXFLAGS) -c $(NAME)$(DIR_O)\ $<
+{..\lexlib}.cxx{$(DIR_O)}.obj::
+ $(CXX) $(CXXFLAGS) -c $(NAME)$(DIR_O)\ $<
+{..\lexers}.cxx{$(DIR_O)}.obj::
+ $(CXX) $(CXXFLAGS) -c $(NAME)$(DIR_O)\ $<
+{.}.cxx{$(DIR_O)}.obj::
+ $(CXX) $(CXXFLAGS) -c $(NAME)$(DIR_O)\ $<
+
+# Some source files are compiled into more than one object because of different conditional compilation
+$(DIR_O)\ScintillaBaseL.obj: ..\src\ScintillaBase.cxx
+ $(CXX) $(CXXFLAGS) -DSCI_LEXER -c $(NAME)$@ ..\src\ScintillaBase.cxx
+
+$(DIR_O)\ScintillaWinL.obj: ScintillaWin.cxx
+ $(CXX) $(CXXFLAGS) -DSCI_LEXER -c $(NAME)$@ ScintillaWin.cxx
+
+$(DIR_O)\ScintillaWinS.obj: ScintillaWin.cxx
+ $(CXX) $(CXXFLAGS) -DSTATIC_BUILD -c $(NAME)$@ ScintillaWin.cxx
+
+# Dependencies
+
+# All lexers depend on this set of headers
+LEX_HEADERS= \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h \
+ ../lexlib/CharacterSet.h \
+ ../lexlib/LexerModule.h \
+ ../lexlib/OptionSet.h \
+ ../lexlib/SparseState.h \
+ ../lexlib/SubStyles.h
+
+$(DIR_O)\Accessor.obj: \
+ ../lexlib/Accessor.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h
+$(DIR_O)\AutoComplete.obj: \
+ ../src/AutoComplete.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../lexlib/CharacterSet.h \
+ ../src/AutoComplete.h
+$(DIR_O)\CallTip.obj: \
+ ../src/CallTip.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/CallTip.h
+$(DIR_O)\CaseConvert.obj: \
+ ../src/CaseConvert.cxx \
+ ../lexlib/StringCopy.h \
+ ../src/CaseConvert.h \
+ ../src/UniConversion.h \
+ ../src/UnicodeFromUTF8.h
+$(DIR_O)\CaseFolder.obj: \
+ ../src/CaseFolder.cxx \
+ ../src/CaseFolder.h \
+ ../src/CaseConvert.h \
+ ../src/UniConversion.h
+$(DIR_O)\Catalogue.obj: \
+ ../src/Catalogue.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/LexerModule.h \
+ ../src/Catalogue.h
+$(DIR_O)\CellBuffer.obj: \
+ ../src/CellBuffer.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/CellBuffer.h \
+ ../src/UniConversion.h
+$(DIR_O)\CharacterCategory.obj: \
+ ../lexlib/CharacterCategory.cxx \
+ ../lexlib/StringCopy.h \
+ ../lexlib/CharacterCategory.h
+$(DIR_O)\CharacterSet.obj: \
+ ../lexlib/CharacterSet.cxx \
+ ../lexlib/CharacterSet.h
+$(DIR_O)\CharClassify.obj: \
+ ../src/CharClassify.cxx \
+ ../src/CharClassify.h
+$(DIR_O)\ContractionState.obj: \
+ ../src/ContractionState.cxx \
+ ../include/Platform.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h
+$(DIR_O)\Decoration.obj: \
+ ../src/Decoration.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/Decoration.h
+$(DIR_O)\Document.obj: \
+ ../src/Document.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/CharacterSet.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/CellBuffer.h \
+ ../src/PerLine.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/RESearch.h \
+ ../src/UniConversion.h
+$(DIR_O)\EditModel.obj: \
+ ../src/EditModel.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h
+$(DIR_O)\Editor.obj: \
+ ../src/Editor.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h
+$(DIR_O)\EditView.obj: \
+ ../src/EditView.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h
+$(DIR_O)\ExternalLexer.obj: \
+ ../src/ExternalLexer.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/LexerModule.h \
+ ../src/Catalogue.h \
+ ../src/ExternalLexer.h
+$(DIR_O)\Indicator.obj: \
+ ../src/Indicator.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/Indicator.h \
+ ../src/XPM.h
+$(DIR_O)\KeyMap.obj: \
+ ../src/KeyMap.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/KeyMap.h
+
+#++Autogenerated -- run scripts/LexGen.py to regenerate
+#**\n\($(DIR_O)\\\*.obj: ..\\lexers\\\*.cxx $(LEX_HEADERS)\n\n\)
+
+$(DIR_O)\LexA68k.obj: ..\lexers\LexA68k.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAbaqus.obj: ..\lexers\LexAbaqus.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAda.obj: ..\lexers\LexAda.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAPDL.obj: ..\lexers\LexAPDL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAsm.obj: ..\lexers\LexAsm.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAsn1.obj: ..\lexers\LexAsn1.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexASY.obj: ..\lexers\LexASY.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAU3.obj: ..\lexers\LexAU3.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAVE.obj: ..\lexers\LexAVE.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexAVS.obj: ..\lexers\LexAVS.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexBaan.obj: ..\lexers\LexBaan.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexBash.obj: ..\lexers\LexBash.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexBasic.obj: ..\lexers\LexBasic.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexBibTeX.obj: ..\lexers\LexBibTeX.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexBullant.obj: ..\lexers\LexBullant.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCaml.obj: ..\lexers\LexCaml.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCLW.obj: ..\lexers\LexCLW.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCmake.obj: ..\lexers\LexCmake.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCOBOL.obj: ..\lexers\LexCOBOL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCoffeeScript.obj: ..\lexers\LexCoffeeScript.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexConf.obj: ..\lexers\LexConf.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCPP.obj: ..\lexers\LexCPP.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCrontab.obj: ..\lexers\LexCrontab.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCsound.obj: ..\lexers\LexCsound.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexCSS.obj: ..\lexers\LexCSS.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexD.obj: ..\lexers\LexD.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexDMAP.obj: ..\lexers\LexDMAP.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexDMIS.obj: ..\lexers\LexDMIS.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexECL.obj: ..\lexers\LexECL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexEiffel.obj: ..\lexers\LexEiffel.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexErlang.obj: ..\lexers\LexErlang.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexEScript.obj: ..\lexers\LexEScript.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexFlagship.obj: ..\lexers\LexFlagship.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexForth.obj: ..\lexers\LexForth.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexFortran.obj: ..\lexers\LexFortran.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexGAP.obj: ..\lexers\LexGAP.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexGui4Cli.obj: ..\lexers\LexGui4Cli.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexHaskell.obj: ..\lexers\LexHaskell.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexHex.obj: ..\lexers\LexHex.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexHTML.obj: ..\lexers\LexHTML.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexInno.obj: ..\lexers\LexInno.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexKix.obj: ..\lexers\LexKix.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexKVIrc.obj: ..\lexers\LexKVIrc.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexLaTeX.obj: ..\lexers\LexLaTeX.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexLisp.obj: ..\lexers\LexLisp.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexLout.obj: ..\lexers\LexLout.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexLua.obj: ..\lexers\LexLua.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMagik.obj: ..\lexers\LexMagik.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMarkdown.obj: ..\lexers\LexMarkdown.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMatlab.obj: ..\lexers\LexMatlab.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMetapost.obj: ..\lexers\LexMetapost.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMMIXAL.obj: ..\lexers\LexMMIXAL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexModula.obj: ..\lexers\LexModula.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMPT.obj: ..\lexers\LexMPT.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMSSQL.obj: ..\lexers\LexMSSQL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexMySQL.obj: ..\lexers\LexMySQL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexNimrod.obj: ..\lexers\LexNimrod.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexNsis.obj: ..\lexers\LexNsis.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexOpal.obj: ..\lexers\LexOpal.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexOScript.obj: ..\lexers\LexOScript.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexOthers.obj: ..\lexers\LexOthers.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPascal.obj: ..\lexers\LexPascal.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPB.obj: ..\lexers\LexPB.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPerl.obj: ..\lexers\LexPerl.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPLM.obj: ..\lexers\LexPLM.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPO.obj: ..\lexers\LexPO.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPOV.obj: ..\lexers\LexPOV.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPowerPro.obj: ..\lexers\LexPowerPro.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPowerShell.obj: ..\lexers\LexPowerShell.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexProgress.obj: ..\lexers\LexProgress.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPS.obj: ..\lexers\LexPS.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexPython.obj: ..\lexers\LexPython.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexR.obj: ..\lexers\LexR.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexRebol.obj: ..\lexers\LexRebol.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexRegistry.obj: ..\lexers\LexRegistry.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexRuby.obj: ..\lexers\LexRuby.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexRust.obj: ..\lexers\LexRust.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexScriptol.obj: ..\lexers\LexScriptol.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSmalltalk.obj: ..\lexers\LexSmalltalk.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSML.obj: ..\lexers\LexSML.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSorcus.obj: ..\lexers\LexSorcus.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSpecman.obj: ..\lexers\LexSpecman.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSpice.obj: ..\lexers\LexSpice.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSQL.obj: ..\lexers\LexSQL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexSTTXT.obj: ..\lexers\LexSTTXT.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTACL.obj: ..\lexers\LexTACL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTADS3.obj: ..\lexers\LexTADS3.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTAL.obj: ..\lexers\LexTAL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTCL.obj: ..\lexers\LexTCL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTCMD.obj: ..\lexers\LexTCMD.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTeX.obj: ..\lexers\LexTeX.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexTxt2tags.obj: ..\lexers\LexTxt2tags.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexVB.obj: ..\lexers\LexVB.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexVerilog.obj: ..\lexers\LexVerilog.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexVHDL.obj: ..\lexers\LexVHDL.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexVisualProlog.obj: ..\lexers\LexVisualProlog.cxx $(LEX_HEADERS)
+
+$(DIR_O)\LexYAML.obj: ..\lexers\LexYAML.cxx $(LEX_HEADERS)
+
+
+#--Autogenerated -- end of automatically generated section
+
+$(DIR_O)\LexerBase.obj: \
+ ../lexlib/LexerBase.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h \
+ ../lexlib/LexerBase.h
+$(DIR_O)\LexerModule.obj: \
+ ../lexlib/LexerModule.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h \
+ ../lexlib/LexerBase.h \
+ ../lexlib/LexerSimple.h
+$(DIR_O)\LexerNoExceptions.obj: \
+ ../lexlib/LexerNoExceptions.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h \
+ ../lexlib/LexerBase.h \
+ ../lexlib/LexerNoExceptions.h
+$(DIR_O)\LexerSimple.obj: \
+ ../lexlib/LexerSimple.cxx \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../include/SciLexer.h \
+ ../lexlib/PropSetSimple.h \
+ ../lexlib/WordList.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/LexerModule.h \
+ ../lexlib/LexerBase.h \
+ ../lexlib/LexerSimple.h
+$(DIR_O)\LineMarker.obj: \
+ ../src/LineMarker.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h
+$(DIR_O)\MarginView.obj: \
+ ../src/MarginView.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h
+$(DIR_O)\PerLine.obj: \
+ ../src/PerLine.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/CellBuffer.h \
+ ../src/PerLine.h
+$(DIR_O)\PlatWin.obj: \
+ PlatWin.cxx \
+ ../include/Platform.h \
+ ../lexlib/StringCopy.h \
+ ../src/XPM.h \
+ ../src/UniConversion.h \
+ ../src/FontQuality.h
+$(DIR_O)\PositionCache.obj: \
+ ../src/PositionCache.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h
+$(DIR_O)\PropSetSimple.obj: \
+ ../lexlib/PropSetSimple.cxx \
+ ../lexlib/PropSetSimple.h
+$(DIR_O)\RESearch.obj: \
+ ../src/RESearch.cxx \
+ ../src/CharClassify.h \
+ ../src/RESearch.h
+$(DIR_O)\RunStyles.obj: \
+ ../src/RunStyles.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h
+$(DIR_O)\ScintillaBase.obj: \
+ ../src/ScintillaBase.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/PropSetSimple.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/CallTip.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h \
+ ../src/AutoComplete.h \
+ ../src/ScintillaBase.h
+$(DIR_O)\ScintillaBaseL.obj: \
+ ../src/ScintillaBase.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/PropSetSimple.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/CallTip.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h \
+ ../src/AutoComplete.h \
+ ../src/ScintillaBase.h
+$(DIR_O)\ScintillaWin.obj: \
+ ScintillaWin.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/CallTip.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/CaseConvert.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h \
+ ../src/AutoComplete.h \
+ ../src/ScintillaBase.h \
+ PlatWin.h \
+ HanjaDic.h
+$(DIR_O)\ScintillaWinL.obj: \
+ ScintillaWin.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/CallTip.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/CaseConvert.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h \
+ ../src/AutoComplete.h \
+ ../src/ScintillaBase.h \
+ PlatWin.h \
+ HanjaDic.h
+$(DIR_O)\ScintillaWinS.obj: \
+ ScintillaWin.cxx \
+ ../include/Platform.h \
+ ../include/ILexer.h \
+ ../include/Scintilla.h \
+ ../lexlib/StringCopy.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/ContractionState.h \
+ ../src/CellBuffer.h \
+ ../src/CallTip.h \
+ ../src/KeyMap.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h \
+ ../src/CharClassify.h \
+ ../src/Decoration.h \
+ ../src/CaseFolder.h \
+ ../src/Document.h \
+ ../src/CaseConvert.h \
+ ../src/UniConversion.h \
+ ../src/Selection.h \
+ ../src/PositionCache.h \
+ ../src/EditModel.h \
+ ../src/MarginView.h \
+ ../src/EditView.h \
+ ../src/Editor.h \
+ ../src/AutoComplete.h \
+ ../src/ScintillaBase.h \
+ PlatWin.h \
+ HanjaDic.h
+$(DIR_O)\Selection.obj: \
+ ../src/Selection.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/Selection.h
+$(DIR_O)\Style.obj: \
+ ../src/Style.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/Style.h
+$(DIR_O)\StyleContext.obj: \
+ ../lexlib/StyleContext.cxx \
+ ../include/ILexer.h \
+ ../lexlib/LexAccessor.h \
+ ../lexlib/Accessor.h \
+ ../lexlib/StyleContext.h
+$(DIR_O)\UniConversion.obj: \
+ ../src/UniConversion.cxx \
+ ../src/UniConversion.h
+$(DIR_O)\ViewStyle.obj: \
+ ../src/ViewStyle.cxx \
+ ../include/Platform.h \
+ ../include/Scintilla.h \
+ ../src/SplitVector.h \
+ ../src/Partitioning.h \
+ ../src/RunStyles.h \
+ ../src/Indicator.h \
+ ../src/XPM.h \
+ ../src/LineMarker.h \
+ ../src/Style.h \
+ ../src/ViewStyle.h
+$(DIR_O)\WordList.obj: \
+ ../lexlib/WordList.cxx \
+ ../lexlib/StringCopy.h \
+ ../lexlib/WordList.h
+$(DIR_O)\XPM.obj: \
+ ../src/XPM.cxx \
+ ../include/Platform.h \
+ ../src/XPM.h
+$(DIR_O)\HanjaDic: \
+ ./HanjaDic.h
diff --git a/3rdparty/bgfx/3rdparty/scintilla/zipsrc.bat b/3rdparty/bgfx/3rdparty/scintilla/zipsrc.bat
new file mode 100644
index 00000000000..e9268fae202
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/scintilla/zipsrc.bat
@@ -0,0 +1,4 @@
+cd ..
+del/q scintilla.zip
+zip scintilla.zip scintilla\*.* scintilla\*\*.* scintilla\*\*\*.* scintilla\*\*\*\*.* scintilla\*\*\*\*\*.* -x *.o -x *.obj -x *.dll -x *.lib -x *.res -x *.exp
+cd scintilla
diff --git a/3rdparty/bgfx/3rdparty/stb/stb_image.c b/3rdparty/bgfx/3rdparty/stb/stb_image.c
index 9431567ec2a..bc305501477 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_image.c
+++ b/3rdparty/bgfx/3rdparty/stb/stb_image.c
@@ -1,17 +1,35 @@
-/* stb_image - v1.39 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c
- when you control the images you're loading
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wshadow"
+#elif defined(_MSC_VER)
+# pragma warning(disable:4312) // warning C4312: 'type cast': conversion from '' to '' of greater size
+# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration
+# pragma warning(disable:4457) // warning C4457: declaration of 'y' hides function parameter
+#endif
+
+/* stb_image - v2.06 - public domain image loader - http://nothings.org/stb_image.h
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
+ // i.e. it should look like this:
+ #include ...
+ #include ...
+ #include ...
+ #define STB_IMAGE_IMPLEMENTATION
+ #include "stb_image.h"
+
+ You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
+ And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
+
+
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
- JPEG baseline (no JPEG progressive)
- PNG 8-bit-per-channel only
+ JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
+ PNG 1/2/4/8-bit-per-channel (16 bpc not supported)
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
@@ -20,25 +38,141 @@
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
-
- - stbi__jpeg_huff_decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- - stbi__jpeg_huff_decode from arbitrary I/O callbacks
- - overridable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)
-
- Latest revisions:
- 1.39 (2014-06-15) TGA optimization fix, multiple BMP fixes
- 1.38 (2014-06-06) suppress MSVC run-time warnings, fix accidental rename of 'skip'
- 1.37 (2014-06-04) remove duplicate typedef
- 1.36 (2014-06-03) converted to header file, allow reading incorrect iphoned-images without iphone flag
- 1.35 (2014-05-27) warnings, bugfixes, TGA optimization, etc
- 1.34 (unknown ) warning fix
- 1.33 (2011-07-14) minor fixes suggested by Dave Moore
+ PNM (PPM and PGM binary only)
+
+ - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
+ - decode from arbitrary I/O callbacks
+ - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
+
+ Full documentation under "DOCUMENTATION" below.
+
+
+ Revision 2.00 release notes:
+
+ - Progressive JPEG is now supported.
+
+ - PPM and PGM binary formats are now supported, thanks to Ken Miller.
+
+ - x86 platforms now make use of SSE2 SIMD instructions for
+ JPEG decoding, and ARM platforms can use NEON SIMD if requested.
+ This work was done by Fabian "ryg" Giesen. SSE2 is used by
+ default, but NEON must be enabled explicitly; see docs.
+
+ With other JPEG optimizations included in this version, we see
+ 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup
+ on a JPEG on an ARM machine, relative to previous versions of this
+ library. The same results will not obtain for all JPGs and for all
+ x86/ARM machines. (Note that progressive JPEGs are significantly
+ slower to decode than regular JPEGs.) This doesn't mean that this
+ is the fastest JPEG decoder in the land; rather, it brings it
+ closer to parity with standard libraries. If you want the fastest
+ decode, look elsewhere. (See "Philosophy" section of docs below.)
+
+ See final bullet items below for more info on SIMD.
+
+ - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing
+ the memory allocator. Unlike other STBI libraries, these macros don't
+ support a context parameter, so if you need to pass a context in to
+ the allocator, you'll have to store it in a global or a thread-local
+ variable.
+
+ - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and
+ STBI_NO_LINEAR.
+ STBI_NO_HDR: suppress implementation of .hdr reader format
+ STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API
+
+ - You can suppress implementation of any of the decoders to reduce
+ your code footprint by #defining one or more of the following
+ symbols before creating the implementation.
+
+ STBI_NO_JPEG
+ STBI_NO_PNG
+ STBI_NO_BMP
+ STBI_NO_PSD
+ STBI_NO_TGA
+ STBI_NO_GIF
+ STBI_NO_HDR
+ STBI_NO_PIC
+ STBI_NO_PNM (.ppm and .pgm)
+
+ - You can request *only* certain decoders and suppress all other ones
+ (this will be more forward-compatible, as addition of new decoders
+ doesn't require you to disable them explicitly):
+
+ STBI_ONLY_JPEG
+ STBI_ONLY_PNG
+ STBI_ONLY_BMP
+ STBI_ONLY_PSD
+ STBI_ONLY_TGA
+ STBI_ONLY_GIF
+ STBI_ONLY_HDR
+ STBI_ONLY_PIC
+ STBI_ONLY_PNM (.ppm and .pgm)
+
+ Note that you can define multiples of these, and you will get all
+ of them ("only x" and "only y" is interpreted to mean "only x&y").
+
+ - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
+ want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
+
+ - Compilation of all SIMD code can be suppressed with
+ #define STBI_NO_SIMD
+ It should not be necessary to disable SIMD unless you have issues
+ compiling (e.g. using an x86 compiler which doesn't support SSE
+ intrinsics or that doesn't support the method used to detect
+ SSE2 support at run-time), and even those can be reported as
+ bugs so I can refine the built-in compile-time checking to be
+ smarter.
+
+ - The old STBI_SIMD system which allowed installing a user-defined
+ IDCT etc. has been removed. If you need this, don't upgrade. My
+ assumption is that almost nobody was doing this, and those who
+ were will find the built-in SIMD more satisfactory anyway.
+
+ - RGB values computed for JPEG images are slightly different from
+ previous versions of stb_image. (This is due to using less
+ integer precision in SIMD.) The C code has been adjusted so
+ that the same RGB values will be computed regardless of whether
+ SIMD support is available, so your app should always produce
+ consistent results. But these results are slightly different from
+ previous versions. (Specifically, about 3% of available YCbCr values
+ will compute different RGB results from pre-1.49 versions by +-1;
+ most of the deviating values are one smaller in the G channel.)
+
+ - If you must produce consistent results with previous versions of
+ stb_image, #define STBI_JPEG_OLD and you will get the same results
+ you used to; however, you will not get the SIMD speedups for
+ the YCbCr-to-RGB conversion step (although you should still see
+ significant JPEG speedup from the other changes).
+
+ Please note that STBI_JPEG_OLD is a temporary feature; it will be
+ removed in future versions of the library. It is only intended for
+ near-term back-compatibility use.
+
+
+ Latest revision history:
+ 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
+ 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
+ 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
+ 2.03 (2015-04-12) additional corruption checking
+ stbi_set_flip_vertically_on_load
+ fix NEON support; fix mingw support
+ 2.02 (2015-01-19) fix incorrect assert, fix warning
+ 2.01 (2015-01-17) fix various warnings
+ 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
+ 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD
+ progressive JPEG
+ PGM/PPM support
+ STBI_MALLOC,STBI_REALLOC,STBI_FREE
+ STBI_NO_*, STBI_ONLY_*
+ GIF bugfix
+ 1.48 (2014-12-14) fix incorrectly-named assert()
+ 1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)
+ optimize PNG
+ fix bug in interlaced PNG with user-specified channel count
See end of file for full revision history.
- TODO:
- stbi_info support for BMP,PSD,HDR,PIC
-
============================ Contributors =========================
@@ -49,36 +183,55 @@
Jean-Marc Lienher (gif) Won Chun
Tom Seddon (pic) the Horde3D community
Thatcher Ulrich (psd) Janez Zemva
- Jonathan Blow
+ Ken Miller (pgm, ppm) Jonathan Blow
Laurent Gomila
- Extensions, features Aruelien Pocheville
- Jetro Lauha (stbi_info) Ryamond Barbiero
- James "moose2000" Brown (iPhone PNG) David Woo
- Ben "Disch" Wenger (io callbacks) Roy Eltham
- Martin "SpartanJ" Golini Luke Graham
- Thomas Ruf
- John Bartholomew
- Optimizations & bugfixes Ken Hamada
- Fabian "ryg" Giesen Cort Stratton
- Arseny Kapoulkine Blazej Dariusz Roszkowski
- Thibault Reuille
- If your name should be here but Paul Du Bois
- isn't, let Sean know. Guillaume George
- Jerry Jansson
- Hayaki Saito
+ Aruelien Pocheville
+ Extensions, features Ryamond Barbiero
+ Jetro Lauha (stbi_info) David Woo
+ Martin "SpartanJ" Golini (stbi_info) Martin Golini
+ James "moose2000" Brown (iPhone PNG) Roy Eltham
+ Ben "Disch" Wenger (io callbacks) Luke Graham
+ Omar Cornut (1/2/4-bit PNG) Thomas Ruf
+ Nicolas Guillemot (vertical flip) John Bartholomew
+ Ken Hamada
+ Optimizations & bugfixes Cort Stratton
+ Fabian "ryg" Giesen Blazej Dariusz Roszkowski
+ Arseny Kapoulkine Thibault Reuille
+ Paul Du Bois
+ Guillaume George
+ If your name should be here but Jerry Jansson
+ isn't, let Sean know. Hayaki Saito
+ Johan Duparc
+ Ronny Chevalier
+ Michal Cichon
+ Tero Hanninen
+ Sergio Gonzalez
+ Cass Everitt
+ Engin Manap
+ Martins Mozeiko
+ Joseph Thomson
+ Phil Jordan
+
+License:
+ This software is in the public domain. Where that dedication is not
+ recognized, you are granted a perpetual, irrevocable license to copy
+ and modify this file however you want.
+
*/
#ifndef STBI_INCLUDE_STB_IMAGE_H
#define STBI_INCLUDE_STB_IMAGE_H
+// DOCUMENTATION
+//
// Limitations:
-// - no jpeg progressive support
-// - non-HDR formats support 8-bit samples only (jpeg, png)
-// - no delayed line count (jpeg) -- IJG doesn't support either
+// - no 16-bit-per-channel PNG
+// - no 12-bit-per-channel JPEG
+// - no JPEGs with arithmetic coding
// - no 1-bit BMP
// - GIF always returns *comp=4
//
-// Basic usage (see HDR discussion below):
+// Basic usage (see HDR discussion below for HDR usage):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
// // ... process data if not NULL ...
@@ -94,14 +247,16 @@
// int req_comp -- if non-zero, # of image components requested in result
//
// The return value from an image loader is an 'unsigned char *' which points
-// to the pixel data. The pixel data consists of *y scanlines of *x pixels,
+// to the pixel data, or NULL on an allocation failure or if the image is
+// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
// with each pixel consisting of N interleaved 8-bit components; the first
// pixel pointed to is top-left-most in the image. There is no padding between
// image scanlines or between pixels, regardless of format. The number of
// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.
// If req_comp is non-zero, *comp has the number of components that _would_
// have been output otherwise. E.g. if you set req_comp to 4, you will always
-// get RGBA output, but you can check *comp to easily see if it's opaque.
+// get RGBA output, but you can check *comp to see if it's trivially opaque
+// because e.g. there were only 3 channels in the source image.
//
// An output image with N components has the following components interleaved
// in this order in each pixel:
@@ -123,18 +278,66 @@
//
// ===========================================================================
//
-// iPhone PNG support:
+// Philosophy
//
-// By default we convert iphone-formatted PNGs back to RGB; nominally they
-// would silently load as BGR, except the existing code should have just
-// failed on such iPhone PNGs. But you can disable this conversion by
-// by calling stbi_convert_iphone_png_to_rgb(0), in which case
-// you will always just get the native iphone "format" through.
+// stb libraries are designed with the following priorities:
//
-// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
-// pixel to remove any premultiplied alpha *only* if the image file explicitly
-// says there's premultiplied data (currently only happens in iPhone images,
-// and only if iPhone convert-to-rgb processing is on).
+// 1. easy to use
+// 2. easy to maintain
+// 3. good performance
+//
+// Sometimes I let "good performance" creep up in priority over "easy to maintain",
+// and for best performance I may provide less-easy-to-use APIs that give higher
+// performance, in addition to the easy to use ones. Nevertheless, it's important
+// to keep in mind that from the standpoint of you, a client of this library,
+// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all.
+//
+// Some secondary priorities arise directly from the first two, some of which
+// make more explicit reasons why performance can't be emphasized.
+//
+// - Portable ("ease of use")
+// - Small footprint ("easy to maintain")
+// - No dependencies ("ease of use")
+//
+// ===========================================================================
+//
+// I/O callbacks
+//
+// I/O callbacks allow you to read from arbitrary sources, like packaged
+// files or some other source. Data read from callbacks are processed
+// through a small internal buffer (currently 128 bytes) to try to reduce
+// overhead.
+//
+// The three functions you must define are "read" (reads some bytes of data),
+// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
+//
+// ===========================================================================
+//
+// SIMD support
+//
+// The JPEG decoder will try to automatically use SIMD kernels on x86 when
+// supported by the compiler. For ARM Neon support, you must explicitly
+// request it.
+//
+// (The old do-it-yourself SIMD API is no longer supported in the current
+// code.)
+//
+// On x86, SSE2 will automatically be used when available based on a run-time
+// test; if not, the generic C versions are used as a fall-back. On ARM targets,
+// the typical path is to have separate builds for NEON and non-NEON devices
+// (at least this is true for iOS and Android). Therefore, the NEON support is
+// toggled by a build flag: define STBI_NEON to get NEON loops.
+//
+// The output of the JPEG decoder is slightly different from versions where
+// SIMD support was introduced (that is, for versions before 1.49). The
+// difference is only +-1 in the 8-bit RGB channels, and only on a small
+// fraction of pixels. You can force the pre-1.49 behavior by defining
+// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path
+// and hence cost some performance.
+//
+// If for some reason you do not want to use any of SIMD code, or if
+// you have issues compiling it, you can disable it entirely by
+// defining STBI_NO_SIMD.
//
// ===========================================================================
//
@@ -174,29 +377,22 @@
//
// ===========================================================================
//
-// I/O callbacks
+// iPhone PNG support:
//
-// I/O callbacks allow you to read from arbitrary sources, like packaged
-// files or some other source. Data read from callbacks are processed
-// through a small internal buffer (currently 128 bytes) to try to reduce
-// overhead.
+// By default we convert iphone-formatted PNGs back to RGB, even though
+// they are internally encoded differently. You can disable this conversion
+// by by calling stbi_convert_iphone_png_to_rgb(0), in which case
+// you will always just get the native iphone "format" through (which
+// is BGR stored in RGB).
+//
+// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
+// pixel to remove any premultiplied alpha *only* if the image file explicitly
+// says there's premultiplied data (currently only happens in iPhone images,
+// and only if iPhone convert-to-rgb processing is on).
//
-// The three functions you must define are "read" (reads some bytes of data),
-// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
#ifndef STBI_NO_STDIO
-
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-# if !defined(_CRT_SECURE_NO_WARNINGS)
-# define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen()
-# endif
-# pragma warning(push)
-# pragma warning(disable:4996) // suppress even more warnings about fopen()
-# pragma warning(disable:4312) // warning C4312: 'type cast': conversion from 'int' to 'unsigned char *' of greater size
-# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration
-# pragma warning(disable:4457) // warning C4457: declaration of 'y' hides function parameter
-#endif
#include <stdio.h>
#endif // STBI_NO_STDIO
@@ -233,14 +429,6 @@ extern "C" {
// load image by filename, open file, or memory buffer
//
-STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
-
-#ifndef STBI_NO_STDIO
-STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
-STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
-// for stbi_load_from_file, file pointer is left pointing immediately after image
-#endif
-
typedef struct
{
int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
@@ -248,26 +436,36 @@ typedef struct
int (*eof) (void *user); // returns nonzero if we are at end of file/data
} stbi_io_callbacks;
-STBIDEF stbi_uc *stbi_load_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp);
+STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp);
-#ifndef STBI_NO_HDR
- STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
+#ifndef STBI_NO_STDIO
+STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
+// for stbi_load_from_file, file pointer is left pointing immediately after image
+#endif
+
+#ifndef STBI_NO_LINEAR
+ STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
+ STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
+ STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
#ifndef STBI_NO_STDIO
- STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp);
STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp);
#endif
+#endif
- STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp);
-
+#ifndef STBI_NO_HDR
STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
STBIDEF void stbi_hdr_to_ldr_scale(float scale);
+#endif
+#ifndef STBI_NO_LINEAR
STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
STBIDEF void stbi_ldr_to_hdr_scale(float scale);
#endif // STBI_NO_HDR
-// stbi_is_hdr is always defined
+// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
#ifndef STBI_NO_STDIO
@@ -304,6 +502,8 @@ STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultipl
// or just pass them through "as-is"
STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
+// flip the image vertically, so the first pixel in the output array is the bottom left
+STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
// ZLIB client - used by PNG, available for other purposes
@@ -316,26 +516,6 @@ STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int
STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
-// define faster low-level operations (typically SIMD support)
-#ifdef STBI_SIMD
-typedef void (*stbi_idct_8x8)(stbi_uc *out, int out_stride, short data[64], unsigned short *dequantize);
-// compute an integer IDCT on "input"
-// input[x] = data[x] * dequantize[x]
-// write results to 'out': 64 samples, each run of 8 spaced by 'out_stride'
-// CLAMP results to 0..255
-typedef void (*stbi_YCbCr_to_RGB_run)(stbi_uc *output, stbi_uc const *y, stbi_uc const *cb, stbi_uc const *cr, int count, int step);
-// compute a conversion from YCbCr to RGB
-// 'count' pixels
-// write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B
-// y: Y input channel
-// cb: Cb input channel; scale/biased to be 0..255
-// cr: Cr input channel; scale/biased to be 0..255
-
-STBIDEF void stbi_install_idct(stbi_idct_8x8 func);
-STBIDEF void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
-#endif // STBI_SIMD
-
-
#ifdef __cplusplus
}
#endif
@@ -347,19 +527,62 @@ STBIDEF void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
#ifdef STB_IMAGE_IMPLEMENTATION
-#ifndef STBI_NO_HDR
+#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
+ || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
+ || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
+ || defined(STBI_ONLY_ZLIB)
+ #ifndef STBI_ONLY_JPEG
+ #define STBI_NO_JPEG
+ #endif
+ #ifndef STBI_ONLY_PNG
+ #define STBI_NO_PNG
+ #endif
+ #ifndef STBI_ONLY_BMP
+ #define STBI_NO_BMP
+ #endif
+ #ifndef STBI_ONLY_PSD
+ #define STBI_NO_PSD
+ #endif
+ #ifndef STBI_ONLY_TGA
+ #define STBI_NO_TGA
+ #endif
+ #ifndef STBI_ONLY_GIF
+ #define STBI_NO_GIF
+ #endif
+ #ifndef STBI_ONLY_HDR
+ #define STBI_NO_HDR
+ #endif
+ #ifndef STBI_ONLY_PIC
+ #define STBI_NO_PIC
+ #endif
+ #ifndef STBI_ONLY_PNM
+ #define STBI_NO_PNM
+ #endif
+#endif
+
+#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)
+#define STBI_NO_ZLIB
+#endif
+
+
+#include <stdarg.h>
+#include <stddef.h> // ptrdiff_t on osx
+#include <stdlib.h>
+#include <string.h>
+
+#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
#include <math.h> // ldexp
-#include <string.h> // strcmp, strtok
#endif
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif
-#include <stdlib.h>
-#include <memory.h>
+
+#ifndef STBI_ASSERT
#include <assert.h>
-#include <stdarg.h>
-#include <stddef.h> // ptrdiff_t on osx
+#define STBI_ASSERT(x) assert(x)
+#endif
+
#ifndef _MSC_VER
#ifdef __cplusplus
@@ -404,6 +627,117 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
#define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
#endif
+#if defined(STBI_MALLOC) && defined(STBI_FREE) && defined(STBI_REALLOC)
+// ok
+#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC)
+// ok
+#else
+#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC."
+#endif
+
+#ifndef STBI_MALLOC
+#define STBI_MALLOC(sz) malloc(sz)
+#define STBI_REALLOC(p,sz) realloc(p,sz)
+#define STBI_FREE(p) free(p)
+#endif
+
+// x86/x64 detection
+#if defined(__x86_64__) || defined(_M_X64)
+#define STBI__X64_TARGET
+#elif defined(__i386) || defined(_M_IX86)
+#define STBI__X86_TARGET
+#endif
+
+#if defined(__GNUC__) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)
+// NOTE: not clear do we actually need this for the 64-bit path?
+// gcc doesn't support sse2 intrinsics unless you compile with -msse2,
+// (but compiling with -msse2 allows the compiler to use SSE2 everywhere;
+// this is just broken and gcc are jerks for not fixing it properly
+// http://www.virtualdub.org/blog/pivot/entry.php?id=363 )
+#define STBI_NO_SIMD
+#endif
+
+#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)
+// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET
+//
+// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the
+// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.
+// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not
+// simultaneously enabling "-mstackrealign".
+//
+// See https://github.com/nothings/stb/issues/81 for more information.
+//
+// So default to no SSE2 on 32-bit MinGW. If you've read this far and added
+// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2.
+#define STBI_NO_SIMD
+#endif
+
+#if !defined(STBI_NO_SIMD) && defined(STBI__X86_TARGET)
+#define STBI_SSE2
+#include <emmintrin.h>
+
+#ifdef _MSC_VER
+
+#if _MSC_VER >= 1400 // not VC6
+#include <intrin.h> // __cpuid
+static int stbi__cpuid3(void)
+{
+ int info[4];
+ __cpuid(info,1);
+ return info[3];
+}
+#else
+static int stbi__cpuid3(void)
+{
+ int res;
+ __asm {
+ mov eax,1
+ cpuid
+ mov res,edx
+ }
+ return res;
+}
+#endif
+
+#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name
+
+static int stbi__sse2_available()
+{
+ int info3 = stbi__cpuid3();
+ return ((info3 >> 26) & 1) != 0;
+}
+#else // assume GCC-style if not VC++
+#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
+
+static int stbi__sse2_available()
+{
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
+ // GCC 4.8+ has a nice way to do this
+ return __builtin_cpu_supports("sse2");
+#else
+ // portable way to do this, preferably without using GCC inline ASM?
+ // just bail for now.
+ return 0;
+#endif
+}
+#endif
+#endif
+
+// ARM NEON
+#if defined(STBI_NO_SIMD) && defined(STBI_NEON)
+#undef STBI_NEON
+#endif
+
+#ifdef STBI_NEON
+#include <arm_neon.h>
+// assume GCC or Clang on ARM targets
+#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
+#endif
+
+#ifndef STBI_SIMD_ALIGN
+#define STBI_SIMD_ALIGN(type, name) type name
+#endif
+
///////////////////////////////////////////////
//
// stbi__context struct and start_xxx functions
@@ -429,7 +763,7 @@ typedef struct
static void stbi__refill_buffer(stbi__context *s);
-// initialize a memory-stbi__jpeg_huff_decode context
+// initialize a memory-decode context
static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
{
s->io.read = NULL;
@@ -490,29 +824,59 @@ static void stbi__rewind(stbi__context *s)
s->img_buffer = s->img_buffer_original;
}
+#ifndef STBI_NO_JPEG
static int stbi__jpeg_test(stbi__context *s);
static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PNG
static int stbi__png_test(stbi__context *s);
static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_BMP
static int stbi__bmp_test(stbi__context *s);
static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_TGA
static int stbi__tga_test(stbi__context *s);
static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_PSD
static int stbi__psd_test(stbi__context *s);
static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
#ifndef STBI_NO_HDR
static int stbi__hdr_test(stbi__context *s);
static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);
#endif
+
+#ifndef STBI_NO_PIC
static int stbi__pic_test(stbi__context *s);
static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+
+#ifndef STBI_NO_GIF
static int stbi__gif_test(stbi__context *s);
static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
+#ifndef STBI_NO_PNM
+static int stbi__pnm_test(stbi__context *s);
+static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp);
+static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);
+#endif
// this is not threadsafe
static const char *stbi__g_failure_reason;
@@ -528,6 +892,11 @@ static int stbi__err(const char *str)
return 0;
}
+static void *stbi__malloc(size_t size)
+{
+ return STBI_MALLOC(size);
+}
+
// stbi__err - error
// stbi__errpf - error returning pointer to float
// stbi__errpuc - error returning pointer to unsigned char
@@ -545,22 +914,47 @@ static int stbi__err(const char *str)
STBIDEF void stbi_image_free(void *retval_from_stbi_load)
{
- free(retval_from_stbi_load);
+ STBI_FREE(retval_from_stbi_load);
}
-#ifndef STBI_NO_HDR
+#ifndef STBI_NO_LINEAR
static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
+#endif
+
+#ifndef STBI_NO_HDR
static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
#endif
-static unsigned char *stbi_load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+static int stbi__vertically_flip_on_load = 0;
+
+STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
+{
+ stbi__vertically_flip_on_load = flag_true_if_should_flip;
+}
+
+static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
+ #ifndef STBI_NO_JPEG
if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PNG
if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_BMP
if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_GIF
if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PSD
if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PIC
if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp);
+ #endif
+ #ifndef STBI_NO_PNM
+ if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp);
+ #endif
#ifndef STBI_NO_HDR
if (stbi__hdr_test(s)) {
@@ -569,16 +963,80 @@ static unsigned char *stbi_load_main(stbi__context *s, int *x, int *y, int *comp
}
#endif
+ #ifndef STBI_NO_TGA
// test tga last because it's a crappy test!
if (stbi__tga_test(s))
return stbi__tga_load(s,x,y,comp,req_comp);
+ #endif
+
return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
}
+static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ unsigned char *result = stbi__load_main(s, x, y, comp, req_comp);
+
+ if (stbi__vertically_flip_on_load && result != NULL) {
+ int w = *x, h = *y;
+ int depth = req_comp ? req_comp : *comp;
+ int row,col,z;
+ stbi_uc temp;
+
+ // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once
+ for (row = 0; row < (h>>1); row++) {
+ for (col = 0; col < w; col++) {
+ for (z = 0; z < depth; z++) {
+ temp = result[(row * w + col) * depth + z];
+ result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z];
+ result[((h - row - 1) * w + col) * depth + z] = temp;
+ }
+ }
+ }
+ }
+
+ return result;
+}
+
+static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp)
+{
+ if (stbi__vertically_flip_on_load && result != NULL) {
+ int w = *x, h = *y;
+ int depth = req_comp ? req_comp : *comp;
+ int row,col,z;
+ float temp;
+
+ // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once
+ for (row = 0; row < (h>>1); row++) {
+ for (col = 0; col < w; col++) {
+ for (z = 0; z < depth; z++) {
+ temp = result[(row * w + col) * depth + z];
+ result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z];
+ result[((h - row - 1) * w + col) * depth + z] = temp;
+ }
+ }
+ }
+ }
+}
+
+
#ifndef STBI_NO_STDIO
-STBIDEF unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
+
+static FILE *stbi__fopen(char const *filename, char const *mode)
+{
+ FILE *f;
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ if (0 != fopen_s(&f, filename, mode))
+ f=0;
+#else
+ f = fopen(filename, mode);
+#endif
+ return f;
+}
+
+
+STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
{
- FILE *f = fopen(filename, "rb");
+ FILE *f = stbi__fopen(filename, "rb");
unsigned char *result;
if (!f) return stbi__errpuc("can't fopen", "Unable to open file");
result = stbi_load_from_file(f,x,y,comp,req_comp);
@@ -586,12 +1044,12 @@ STBIDEF unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp
return result;
}
-STBIDEF unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
+STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
unsigned char *result;
stbi__context s;
stbi__start_file(&s,f);
- result = stbi_load_main(&s,x,y,comp,req_comp);
+ result = stbi__load_flip(&s,x,y,comp,req_comp);
if (result) {
// need to 'unget' all the characters in the IO buffer
fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
@@ -600,75 +1058,78 @@ STBIDEF unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, i
}
#endif //!STBI_NO_STDIO
-STBIDEF unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
+STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
- return stbi_load_main(&s,x,y,comp,req_comp);
+ return stbi__load_flip(&s,x,y,comp,req_comp);
}
-unsigned char *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
+STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi_load_main(&s,x,y,comp,req_comp);
+ return stbi__load_flip(&s,x,y,comp,req_comp);
}
-#ifndef STBI_NO_HDR
-
-float *stbi_loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+#ifndef STBI_NO_LINEAR
+static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
unsigned char *data;
#ifndef STBI_NO_HDR
- if (stbi__hdr_test(s))
- return stbi__hdr_load(s,x,y,comp,req_comp);
+ if (stbi__hdr_test(s)) {
+ float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp);
+ if (hdr_data)
+ stbi__float_postprocess(hdr_data,x,y,comp,req_comp);
+ return hdr_data;
+ }
#endif
- data = stbi_load_main(s, x, y, comp, req_comp);
+ data = stbi__load_flip(s, x, y, comp, req_comp);
if (data)
return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
}
-float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
+STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
+ return stbi__loadf_main(&s,x,y,comp,req_comp);
}
-float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
+STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
+ return stbi__loadf_main(&s,x,y,comp,req_comp);
}
#ifndef STBI_NO_STDIO
-float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
+STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
{
- FILE *f = fopen(filename, "rb");
float *result;
+ FILE *f = stbi__fopen(filename, "rb");
if (!f) return stbi__errpf("can't fopen", "Unable to open file");
result = stbi_loadf_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
}
-float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
+STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_file(&s,f);
- return stbi_loadf_main(&s,x,y,comp,req_comp);
+ return stbi__loadf_main(&s,x,y,comp,req_comp);
}
#endif // !STBI_NO_STDIO
-#endif // !STBI_NO_HDR
+#endif // !STBI_NO_LINEAR
-// these is-hdr-or-not is defined independent of whether STBI_NO_HDR is
-// defined, for API simplicity; if STBI_NO_HDR is defined, it always
+// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is
+// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always
// reports false!
-int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
+STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
{
#ifndef STBI_NO_HDR
stbi__context s;
@@ -684,7 +1145,7 @@ int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
#ifndef STBI_NO_STDIO
STBIDEF int stbi_is_hdr (char const *filename)
{
- FILE *f = fopen(filename, "rb");
+ FILE *f = stbi__fopen(filename, "rb");
int result=0;
if (f) {
result = stbi_is_hdr_from_file(f);
@@ -716,17 +1177,17 @@ STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void
#endif
}
-#ifndef STBI_NO_HDR
static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;
static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;
-void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
-void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
-
-void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
-void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
+#ifndef STBI_NO_LINEAR
+STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
+STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
#endif
+STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
+STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
+
//////////////////////////////////////////////////////////////////////////////
//
@@ -735,9 +1196,9 @@ void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
enum
{
- SCAN_load=0,
- SCAN_type,
- SCAN_header
+ STBI__SCAN_load=0,
+ STBI__SCAN_type,
+ STBI__SCAN_header
};
static void stbi__refill_buffer(stbi__context *s)
@@ -745,7 +1206,7 @@ static void stbi__refill_buffer(stbi__context *s)
int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
if (n == 0) {
// at end of file, treat same as if from memory, but need to handle case
- // where s->img_buffer isn't pointing to safe memory, stbi__err.g. 0-byte file
+ // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
s->read_from_callbacks = 0;
s->img_buffer = s->buffer_start;
s->img_buffer_end = s->buffer_start+1;
@@ -781,6 +1242,10 @@ stbi_inline static int stbi__at_eof(stbi__context *s)
static void stbi__skip(stbi__context *s, int n)
{
+ if (n < 0) {
+ s->img_buffer = s->img_buffer_end;
+ return;
+ }
if (s->io.read) {
int blen = (int) (s->img_buffer_end - s->img_buffer);
if (blen < n) {
@@ -840,10 +1305,13 @@ static stbi__uint32 stbi__get32le(stbi__context *s)
return z + (stbi__get16le(s) << 16);
}
+#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings
+
+
//////////////////////////////////////////////////////////////////////////////
//
// generic converter from built-in img_n to req_comp
-// individual types do this automatically as much as possible (stbi__err.g. jpeg
+// individual types do this automatically as much as possible (e.g. jpeg
// does all cases internally since it needs to colorspace convert anyway,
// and it never has alpha, so very few cases ). png can automatically
// interleave an alpha=255 channel, but falls back to this for other cases
@@ -862,11 +1330,11 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r
unsigned char *good;
if (req_comp == img_n) return data;
- assert(req_comp >= 1 && req_comp <= 4);
+ STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
- good = (unsigned char *) malloc(req_comp * x * y);
+ good = (unsigned char *) stbi__malloc(req_comp * x * y);
if (good == NULL) {
- free(data);
+ STBI_FREE(data);
return stbi__errpuc("outofmem", "Out of memory");
}
@@ -891,21 +1359,21 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r
CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break;
CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break;
CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break;
- default: assert(0);
+ default: STBI_ASSERT(0);
}
#undef CASE
}
- free(data);
+ STBI_FREE(data);
return good;
}
-#ifndef STBI_NO_HDR
+#ifndef STBI_NO_LINEAR
static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
{
int i,k,n;
- float *output = (float *) malloc(x * y * comp * sizeof(float));
- if (output == NULL) { free(data); return stbi__errpf("outofmem", "Out of memory"); }
+ float *output = (float *) stbi__malloc(x * y * comp * sizeof(float));
+ if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); }
// compute number of non-alpha components
if (comp & 1) n = comp; else n = comp-1;
for (i=0; i < x*y; ++i) {
@@ -914,16 +1382,18 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
}
if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
}
- free(data);
+ STBI_FREE(data);
return output;
}
+#endif
+#ifndef STBI_NO_HDR
#define stbi__float2int(x) ((int) (x))
static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
{
int i,k,n;
- stbi_uc *output = (stbi_uc *) malloc(x * y * comp);
- if (output == NULL) { free(data); return stbi__errpuc("outofmem", "Out of memory"); }
+ stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp);
+ if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
// compute number of non-alpha components
if (comp & 1) n = comp; else n = comp-1;
for (i=0; i < x*y; ++i) {
@@ -940,17 +1410,16 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
output[i*comp + k] = (stbi_uc) stbi__float2int(z);
}
}
- free(data);
+ STBI_FREE(data);
return output;
}
#endif
//////////////////////////////////////////////////////////////////////////////
//
-// "baseline" JPEG/JFIF decoder (not actually fully baseline implementation)
+// "baseline" JPEG/JFIF decoder
//
// simple implementation
-// - channel subsampling of at most 2 in each dimension
// - doesn't support delayed output of y-dimension
// - simple interface (only one output format: 8-bit interleaved RGB)
// - doesn't try to recover corrupt jpegs
@@ -964,13 +1433,10 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
// - quality integer IDCT derived from IJG's 'slow'
// performance
// - fast huffman; reasonable integer IDCT
+// - some SIMD kernels for common paths on targets with SSE2/NEON
// - uses a lot of intermediate memory, could cache poorly
-// - load http://nothings.org/remote/anemones.jpg 3 times on 2.8Ghz P4
-// stb_jpeg: 1.34 seconds (MSVC6, default release build)
-// stb_jpeg: 1.06 seconds (MSVC6, processor = Pentium Pro)
-// IJL11.dll: 1.08 seconds (compiled by intel)
-// IJG 1998: 0.98 seconds (MSVC6, makefile provided by IJG)
-// IJG 1998: 0.95 seconds (MSVC6, makefile + proc=PPro)
+
+#ifndef STBI_NO_JPEG
// huffman decoding acceleration
#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
@@ -988,13 +1454,11 @@ typedef struct
typedef struct
{
- #ifdef STBI_SIMD
- unsigned short dequant2[4][64];
- #endif
stbi__context *s;
stbi__huffman huff_dc[4];
stbi__huffman huff_ac[4];
stbi_uc dequant[4][64];
+ stbi__int16 fast_ac[4][1 << FAST_BITS];
// sizes for components, interleaved MCUs
int img_h_max, img_v_max;
@@ -1012,17 +1476,31 @@ typedef struct
int x,y,w2,h2;
stbi_uc *data;
- void *raw_data;
+ void *raw_data, *raw_coeff;
stbi_uc *linebuf;
+ short *coeff; // progressive only
+ int coeff_w, coeff_h; // number of 8x8 coefficient blocks
} img_comp[4];
- stbi__uint32 code_buffer; // jpeg entropy-coded buffer
+ stbi__uint32 code_buffer; // jpeg entropy-coded buffer
int code_bits; // number of valid bits
unsigned char marker; // marker seen while filling entropy buffer
int nomore; // flag if we saw a marker so must stop
+ int progressive;
+ int spec_start;
+ int spec_end;
+ int succ_high;
+ int succ_low;
+ int eob_run;
+
int scan_n, order[4];
int restart_interval, todo;
+
+// kernels
+ void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
+ void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);
+ stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);
} stbi__jpeg;
static int stbi__build_huffman(stbi__huffman *h, int *count)
@@ -1066,6 +1544,33 @@ static int stbi__build_huffman(stbi__huffman *h, int *count)
return 1;
}
+// build a table that decodes both magnitude and value of small ACs in
+// one go.
+static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
+{
+ int i;
+ for (i=0; i < (1 << FAST_BITS); ++i) {
+ stbi_uc fast = h->fast[i];
+ fast_ac[i] = 0;
+ if (fast < 255) {
+ int rs = h->values[fast];
+ int run = (rs >> 4) & 15;
+ int magbits = rs & 15;
+ int len = h->size[fast];
+
+ if (magbits && len + magbits <= FAST_BITS) {
+ // magnitude code followed by receive_extend code
+ int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
+ int m = 1 << (magbits - 1);
+ if (k < m) k += (-1 << magbits) + 1;
+ // if the result is small enough, we can fit it in fast_ac table
+ if (k >= -128 && k <= 127)
+ fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits));
+ }
+ }
+ }
+}
+
static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
{
do {
@@ -1086,7 +1591,7 @@ static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
// (1 << n) - 1
static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
-// stbi__jpeg_huff_decode a jpeg huffman value from the bitstream
+// decode a jpeg huffman value from the bitstream
stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
{
unsigned int temp;
@@ -1128,7 +1633,7 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
// convert the huffman code to the symbol id
c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
- assert((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
+ STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
// convert the id to a symbol
j->code_bits -= k;
@@ -1136,31 +1641,46 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
return h->values[c];
}
+// bias[n] = (-1<<n) + 1
+static int const stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};
+
// combined JPEG 'receive' and JPEG 'extend', since baseline
// always extends everything it receives.
stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
{
- unsigned int m = 1 << (n-1);
unsigned int k;
+ int sgn;
if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
- #if 1
+ sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB
k = stbi_lrot(j->code_buffer, n);
+ STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask)));
j->code_buffer = k & ~stbi__bmask[n];
k &= stbi__bmask[n];
j->code_bits -= n;
- #else
- k = (j->code_buffer >> (32 - n)) & stbi__bmask[n];
+ return k + (stbi__jbias[n] & ~sgn);
+}
+
+// get some unsigned bits
+stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
+{
+ unsigned int k;
+ if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
+ k = stbi_lrot(j->code_buffer, n);
+ j->code_buffer = k & ~stbi__bmask[n];
+ k &= stbi__bmask[n];
j->code_bits -= n;
- j->code_buffer <<= n;
- #endif
- // the following test is probably a random branch that won't
- // predict well. I tried to table accelerate it but failed.
- // maybe it's compiling as a conditional move?
- if (k < m)
- return (-1 << n) + k + 1;
- else
- return k;
+ return k;
+}
+
+stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
+{
+ unsigned int k;
+ if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
+ k = j->code_buffer;
+ j->code_buffer <<= 1;
+ --j->code_bits;
+ return k & 0x80000000;
}
// given a value that's at position X in the zigzag stream,
@@ -1180,11 +1700,14 @@ static stbi_uc stbi__jpeg_dezigzag[64+15] =
63, 63, 63, 63, 63, 63, 63
};
-// stbi__jpeg_huff_decode one 64-entry block--
-static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, int b)
+// decode one 64-entry block--
+static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant)
{
int diff,dc,k;
- int t = stbi__jpeg_huff_decode(j, hdc);
+ int t;
+
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ t = stbi__jpeg_huff_decode(j, hdc);
if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");
// 0 all the ac values now so we can do it 32-bits at a time
@@ -1193,28 +1716,189 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman
diff = t ? stbi__extend_receive(j, t) : 0;
dc = j->img_comp[b].dc_pred + diff;
j->img_comp[b].dc_pred = dc;
- data[0] = (short) dc;
+ data[0] = (short) (dc * dequant[0]);
- // stbi__jpeg_huff_decode AC components, see JPEG spec
+ // decode AC components, see JPEG spec
k = 1;
do {
- int r,s;
- int rs = stbi__jpeg_huff_decode(j, hac);
- if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
- s = rs & 15;
- r = rs >> 4;
- if (s == 0) {
- if (rs != 0xf0) break; // end block
- k += 16;
+ unsigned int zig;
+ int c,r,s;
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
+ r = fac[c];
+ if (r) { // fast-AC path
+ k += (r >> 4) & 15; // run
+ s = r & 15; // combined length
+ j->code_buffer <<= s;
+ j->code_bits -= s;
+ // decode into unzigzag'd location
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) ((r >> 8) * dequant[zig]);
} else {
- k += r;
- // stbi__jpeg_huff_decode into unzigzag'd location
- data[stbi__jpeg_dezigzag[k++]] = (short) stbi__extend_receive(j,s);
+ int rs = stbi__jpeg_huff_decode(j, hac);
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (rs != 0xf0) break; // end block
+ k += 16;
+ } else {
+ k += r;
+ // decode into unzigzag'd location
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
+ }
}
} while (k < 64);
return 1;
}
+static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)
+{
+ int diff,dc;
+ int t;
+ if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
+
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+
+ if (j->succ_high == 0) {
+ // first scan for DC coefficient, must be first
+ memset(data,0,64*sizeof(data[0])); // 0 all the ac values now
+ t = stbi__jpeg_huff_decode(j, hdc);
+ diff = t ? stbi__extend_receive(j, t) : 0;
+
+ dc = j->img_comp[b].dc_pred + diff;
+ j->img_comp[b].dc_pred = dc;
+ data[0] = (short) (dc << j->succ_low);
+ } else {
+ // refinement scan for DC coefficient
+ if (stbi__jpeg_get_bit(j))
+ data[0] += (short) (1 << j->succ_low);
+ }
+ return 1;
+}
+
+// @OPTIMIZE: store non-zigzagged during the decode passes,
+// and only de-zigzag when dequantizing
+static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)
+{
+ int k;
+ if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
+
+ if (j->succ_high == 0) {
+ int shift = j->succ_low;
+
+ if (j->eob_run) {
+ --j->eob_run;
+ return 1;
+ }
+
+ k = j->spec_start;
+ do {
+ unsigned int zig;
+ int c,r,s;
+ if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
+ c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
+ r = fac[c];
+ if (r) { // fast-AC path
+ k += (r >> 4) & 15; // run
+ s = r & 15; // combined length
+ j->code_buffer <<= s;
+ j->code_bits -= s;
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) ((r >> 8) << shift);
+ } else {
+ int rs = stbi__jpeg_huff_decode(j, hac);
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (r < 15) {
+ j->eob_run = (1 << r);
+ if (r)
+ j->eob_run += stbi__jpeg_get_bits(j, r);
+ --j->eob_run;
+ break;
+ }
+ k += 16;
+ } else {
+ k += r;
+ zig = stbi__jpeg_dezigzag[k++];
+ data[zig] = (short) (stbi__extend_receive(j,s) << shift);
+ }
+ }
+ } while (k <= j->spec_end);
+ } else {
+ // refinement scan for these AC coefficients
+
+ short bit = (short) (1 << j->succ_low);
+
+ if (j->eob_run) {
+ --j->eob_run;
+ for (k = j->spec_start; k <= j->spec_end; ++k) {
+ short *p = &data[stbi__jpeg_dezigzag[k]];
+ if (*p != 0)
+ if (stbi__jpeg_get_bit(j))
+ if ((*p & bit)==0) {
+ if (*p > 0)
+ *p += bit;
+ else
+ *p -= bit;
+ }
+ }
+ } else {
+ k = j->spec_start;
+ do {
+ int r,s;
+ int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
+ if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
+ s = rs & 15;
+ r = rs >> 4;
+ if (s == 0) {
+ if (r < 15) {
+ j->eob_run = (1 << r) - 1;
+ if (r)
+ j->eob_run += stbi__jpeg_get_bits(j, r);
+ r = 64; // force end of block
+ } else {
+ // r=15 s=0 should write 16 0s, so we just do
+ // a run of 15 0s and then write s (which is 0),
+ // so we don't have to do anything special here
+ }
+ } else {
+ if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
+ // sign bit
+ if (stbi__jpeg_get_bit(j))
+ s = bit;
+ else
+ s = -bit;
+ }
+
+ // advance by r
+ while (k <= j->spec_end) {
+ short *p = &data[stbi__jpeg_dezigzag[k++]];
+ if (*p != 0) {
+ if (stbi__jpeg_get_bit(j))
+ if ((*p & bit)==0) {
+ if (*p > 0)
+ *p += bit;
+ else
+ *p -= bit;
+ }
+ } else {
+ if (r == 0) {
+ *p = (short) s;
+ break;
+ }
+ --r;
+ }
+ }
+ } while (k <= j->spec_end);
+ }
+ }
+ return 1;
+}
+
// take a -128..127 value and stbi__clamp it and convert to 0..255
stbi_inline static stbi_uc stbi__clamp(int x)
{
@@ -1226,21 +1910,21 @@ stbi_inline static stbi_uc stbi__clamp(int x)
return (stbi_uc) x;
}
-#define stbi__f2f(x) (int) (((x) * 4096 + 0.5))
+#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5)))
#define stbi__fsh(x) ((x) << 12)
// derived from jidctint -- DCT_ISLOW
-#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
+#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
p2 = s2; \
p3 = s6; \
- p1 = (p2+p3) * stbi__f2f(0.5411961f); \
- t2 = p1 + p3*stbi__f2f(-1.847759065f); \
- t3 = p1 + p2*stbi__f2f( 0.765366865f); \
+ p1 = (p2+p3) * stbi__f2f(0.5411961f); \
+ t2 = p1 + p3*stbi__f2f(-1.847759065f); \
+ t3 = p1 + p2*stbi__f2f( 0.765366865f); \
p2 = s0; \
p3 = s4; \
- t0 = stbi__fsh(p2+p3); \
- t1 = stbi__fsh(p2-p3); \
+ t0 = stbi__fsh(p2+p3); \
+ t1 = stbi__fsh(p2-p3); \
x0 = t0+t3; \
x3 = t0-t3; \
x1 = t1+t2; \
@@ -1253,36 +1937,28 @@ stbi_inline static stbi_uc stbi__clamp(int x)
p4 = t1+t3; \
p1 = t0+t3; \
p2 = t1+t2; \
- p5 = (p3+p4)*stbi__f2f( 1.175875602f); \
- t0 = t0*stbi__f2f( 0.298631336f); \
- t1 = t1*stbi__f2f( 2.053119869f); \
- t2 = t2*stbi__f2f( 3.072711026f); \
- t3 = t3*stbi__f2f( 1.501321110f); \
- p1 = p5 + p1*stbi__f2f(-0.899976223f); \
- p2 = p5 + p2*stbi__f2f(-2.562915447f); \
- p3 = p3*stbi__f2f(-1.961570560f); \
- p4 = p4*stbi__f2f(-0.390180644f); \
+ p5 = (p3+p4)*stbi__f2f( 1.175875602f); \
+ t0 = t0*stbi__f2f( 0.298631336f); \
+ t1 = t1*stbi__f2f( 2.053119869f); \
+ t2 = t2*stbi__f2f( 3.072711026f); \
+ t3 = t3*stbi__f2f( 1.501321110f); \
+ p1 = p5 + p1*stbi__f2f(-0.899976223f); \
+ p2 = p5 + p2*stbi__f2f(-2.562915447f); \
+ p3 = p3*stbi__f2f(-1.961570560f); \
+ p4 = p4*stbi__f2f(-0.390180644f); \
t3 += p1+p4; \
t2 += p2+p3; \
t1 += p2+p4; \
t0 += p1+p3;
-#ifdef STBI_SIMD
-typedef unsigned short stbi_dequantize_t;
-#else
-typedef stbi_uc stbi_dequantize_t;
-#endif
-
-// .344 seconds on 3*anemones.jpg
-static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64], stbi_dequantize_t *dequantize)
+static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
{
int i,val[64],*v=val;
- stbi_dequantize_t *dq = dequantize;
stbi_uc *o;
short *d = data;
// columns
- for (i=0; i < 8; ++i,++d,++dq, ++v) {
+ for (i=0; i < 8; ++i,++d, ++v) {
// if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
&& d[40]==0 && d[48]==0 && d[56]==0) {
@@ -1290,11 +1966,10 @@ static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64], stbi_
// (1|2|3|4|5|6|7)==0 0 seconds
// all separate -0.047 seconds
// 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
- int dcterm = d[0] * dq[0] << 2;
+ int dcterm = d[0] << 2;
v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
} else {
- STBI__IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24],
- d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56])
+ STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])
// constants scaled things up by 1<<12; let's bring them back
// down, but keep 2 extra bits of precision
x0 += 512; x1 += 512; x2 += 512; x3 += 512;
@@ -1335,14 +2010,394 @@ static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64], stbi_
}
}
-#ifdef STBI_SIMD
-static stbi_idct_8x8 stbi__idct_installed = stbi__idct_block;
+#ifdef STBI_SSE2
+// sse2 integer IDCT. not the fastest possible implementation but it
+// produces bit-identical results to the generic C version so it's
+// fully "transparent".
+static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
+{
+ // This is constructed to match our regular (generic) integer IDCT exactly.
+ __m128i row0, row1, row2, row3, row4, row5, row6, row7;
+ __m128i tmp;
+
+ // dot product constant: even elems=x, odd elems=y
+ #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
+
+ // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
+ // out(1) = c1[even]*x + c1[odd]*y
+ #define dct_rot(out0,out1, x,y,c0,c1) \
+ __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
+ __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
+ __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
+ __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
+ __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
+ __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
+
+ // out = in << 12 (in 16-bit, out 32-bit)
+ #define dct_widen(out, in) \
+ __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
+ __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
+
+ // wide add
+ #define dct_wadd(out, a, b) \
+ __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
+ __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
+
+ // wide sub
+ #define dct_wsub(out, a, b) \
+ __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
+ __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
+
+ // butterfly a/b, add bias, then shift by "s" and pack
+ #define dct_bfly32o(out0, out1, a,b,bias,s) \
+ { \
+ __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
+ __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
+ dct_wadd(sum, abiased, b); \
+ dct_wsub(dif, abiased, b); \
+ out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
+ out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
+ }
-STBIDEF void stbi_install_idct(stbi_idct_8x8 func)
-{
- stbi__idct_installed = func;
+ // 8-bit interleave step (for transposes)
+ #define dct_interleave8(a, b) \
+ tmp = a; \
+ a = _mm_unpacklo_epi8(a, b); \
+ b = _mm_unpackhi_epi8(tmp, b)
+
+ // 16-bit interleave step (for transposes)
+ #define dct_interleave16(a, b) \
+ tmp = a; \
+ a = _mm_unpacklo_epi16(a, b); \
+ b = _mm_unpackhi_epi16(tmp, b)
+
+ #define dct_pass(bias,shift) \
+ { \
+ /* even part */ \
+ dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
+ __m128i sum04 = _mm_add_epi16(row0, row4); \
+ __m128i dif04 = _mm_sub_epi16(row0, row4); \
+ dct_widen(t0e, sum04); \
+ dct_widen(t1e, dif04); \
+ dct_wadd(x0, t0e, t3e); \
+ dct_wsub(x3, t0e, t3e); \
+ dct_wadd(x1, t1e, t2e); \
+ dct_wsub(x2, t1e, t2e); \
+ /* odd part */ \
+ dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
+ dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
+ __m128i sum17 = _mm_add_epi16(row1, row7); \
+ __m128i sum35 = _mm_add_epi16(row3, row5); \
+ dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
+ dct_wadd(x4, y0o, y4o); \
+ dct_wadd(x5, y1o, y5o); \
+ dct_wadd(x6, y2o, y5o); \
+ dct_wadd(x7, y3o, y4o); \
+ dct_bfly32o(row0,row7, x0,x7,bias,shift); \
+ dct_bfly32o(row1,row6, x1,x6,bias,shift); \
+ dct_bfly32o(row2,row5, x2,x5,bias,shift); \
+ dct_bfly32o(row3,row4, x3,x4,bias,shift); \
+ }
+
+ __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
+ __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));
+ __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));
+ __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
+ __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));
+ __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));
+ __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));
+ __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));
+
+ // rounding biases in column/row passes, see stbi__idct_block for explanation.
+ __m128i bias_0 = _mm_set1_epi32(512);
+ __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));
+
+ // load
+ row0 = _mm_load_si128((const __m128i *) (data + 0*8));
+ row1 = _mm_load_si128((const __m128i *) (data + 1*8));
+ row2 = _mm_load_si128((const __m128i *) (data + 2*8));
+ row3 = _mm_load_si128((const __m128i *) (data + 3*8));
+ row4 = _mm_load_si128((const __m128i *) (data + 4*8));
+ row5 = _mm_load_si128((const __m128i *) (data + 5*8));
+ row6 = _mm_load_si128((const __m128i *) (data + 6*8));
+ row7 = _mm_load_si128((const __m128i *) (data + 7*8));
+
+ // column pass
+ dct_pass(bias_0, 10);
+
+ {
+ // 16bit 8x8 transpose pass 1
+ dct_interleave16(row0, row4);
+ dct_interleave16(row1, row5);
+ dct_interleave16(row2, row6);
+ dct_interleave16(row3, row7);
+
+ // transpose pass 2
+ dct_interleave16(row0, row2);
+ dct_interleave16(row1, row3);
+ dct_interleave16(row4, row6);
+ dct_interleave16(row5, row7);
+
+ // transpose pass 3
+ dct_interleave16(row0, row1);
+ dct_interleave16(row2, row3);
+ dct_interleave16(row4, row5);
+ dct_interleave16(row6, row7);
+ }
+
+ // row pass
+ dct_pass(bias_1, 17);
+
+ {
+ // pack
+ __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
+ __m128i p1 = _mm_packus_epi16(row2, row3);
+ __m128i p2 = _mm_packus_epi16(row4, row5);
+ __m128i p3 = _mm_packus_epi16(row6, row7);
+
+ // 8bit 8x8 transpose pass 1
+ dct_interleave8(p0, p2); // a0e0a1e1...
+ dct_interleave8(p1, p3); // c0g0c1g1...
+
+ // transpose pass 2
+ dct_interleave8(p0, p1); // a0c0e0g0...
+ dct_interleave8(p2, p3); // b0d0f0h0...
+
+ // transpose pass 3
+ dct_interleave8(p0, p2); // a0b0c0d0...
+ dct_interleave8(p1, p3); // a4b4c4d4...
+
+ // store
+ _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
+ _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
+ }
+
+#undef dct_const
+#undef dct_rot
+#undef dct_widen
+#undef dct_wadd
+#undef dct_wsub
+#undef dct_bfly32o
+#undef dct_interleave8
+#undef dct_interleave16
+#undef dct_pass
+}
+
+#endif // STBI_SSE2
+
+#ifdef STBI_NEON
+
+// NEON integer IDCT. should produce bit-identical
+// results to the generic C version.
+static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
+{
+ int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;
+
+ int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));
+ int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));
+ int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));
+ int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));
+ int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));
+ int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));
+ int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));
+ int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));
+ int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));
+ int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));
+ int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));
+ int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));
+
+#define dct_long_mul(out, inq, coeff) \
+ int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
+ int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
+
+#define dct_long_mac(out, acc, inq, coeff) \
+ int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
+ int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
+
+#define dct_widen(out, inq) \
+ int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
+ int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
+
+// wide add
+#define dct_wadd(out, a, b) \
+ int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
+ int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
+
+// wide sub
+#define dct_wsub(out, a, b) \
+ int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
+ int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
+
+// butterfly a/b, then shift using "shiftop" by "s" and pack
+#define dct_bfly32o(out0,out1, a,b,shiftop,s) \
+ { \
+ dct_wadd(sum, a, b); \
+ dct_wsub(dif, a, b); \
+ out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \
+ out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \
+ }
+
+#define dct_pass(shiftop, shift) \
+ { \
+ /* even part */ \
+ int16x8_t sum26 = vaddq_s16(row2, row6); \
+ dct_long_mul(p1e, sum26, rot0_0); \
+ dct_long_mac(t2e, p1e, row6, rot0_1); \
+ dct_long_mac(t3e, p1e, row2, rot0_2); \
+ int16x8_t sum04 = vaddq_s16(row0, row4); \
+ int16x8_t dif04 = vsubq_s16(row0, row4); \
+ dct_widen(t0e, sum04); \
+ dct_widen(t1e, dif04); \
+ dct_wadd(x0, t0e, t3e); \
+ dct_wsub(x3, t0e, t3e); \
+ dct_wadd(x1, t1e, t2e); \
+ dct_wsub(x2, t1e, t2e); \
+ /* odd part */ \
+ int16x8_t sum15 = vaddq_s16(row1, row5); \
+ int16x8_t sum17 = vaddq_s16(row1, row7); \
+ int16x8_t sum35 = vaddq_s16(row3, row5); \
+ int16x8_t sum37 = vaddq_s16(row3, row7); \
+ int16x8_t sumodd = vaddq_s16(sum17, sum35); \
+ dct_long_mul(p5o, sumodd, rot1_0); \
+ dct_long_mac(p1o, p5o, sum17, rot1_1); \
+ dct_long_mac(p2o, p5o, sum35, rot1_2); \
+ dct_long_mul(p3o, sum37, rot2_0); \
+ dct_long_mul(p4o, sum15, rot2_1); \
+ dct_wadd(sump13o, p1o, p3o); \
+ dct_wadd(sump24o, p2o, p4o); \
+ dct_wadd(sump23o, p2o, p3o); \
+ dct_wadd(sump14o, p1o, p4o); \
+ dct_long_mac(x4, sump13o, row7, rot3_0); \
+ dct_long_mac(x5, sump24o, row5, rot3_1); \
+ dct_long_mac(x6, sump23o, row3, rot3_2); \
+ dct_long_mac(x7, sump14o, row1, rot3_3); \
+ dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \
+ dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \
+ dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \
+ dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \
+ }
+
+ // load
+ row0 = vld1q_s16(data + 0*8);
+ row1 = vld1q_s16(data + 1*8);
+ row2 = vld1q_s16(data + 2*8);
+ row3 = vld1q_s16(data + 3*8);
+ row4 = vld1q_s16(data + 4*8);
+ row5 = vld1q_s16(data + 5*8);
+ row6 = vld1q_s16(data + 6*8);
+ row7 = vld1q_s16(data + 7*8);
+
+ // add DC bias
+ row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));
+
+ // column pass
+ dct_pass(vrshrn_n_s32, 10);
+
+ // 16bit 8x8 transpose
+ {
+// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.
+// whether compilers actually get this is another story, sadly.
+#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }
+#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }
+#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }
+
+ // pass 1
+ dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6
+ dct_trn16(row2, row3);
+ dct_trn16(row4, row5);
+ dct_trn16(row6, row7);
+
+ // pass 2
+ dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4
+ dct_trn32(row1, row3);
+ dct_trn32(row4, row6);
+ dct_trn32(row5, row7);
+
+ // pass 3
+ dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0
+ dct_trn64(row1, row5);
+ dct_trn64(row2, row6);
+ dct_trn64(row3, row7);
+
+#undef dct_trn16
+#undef dct_trn32
+#undef dct_trn64
+ }
+
+ // row pass
+ // vrshrn_n_s32 only supports shifts up to 16, we need
+ // 17. so do a non-rounding shift of 16 first then follow
+ // up with a rounding shift by 1.
+ dct_pass(vshrn_n_s32, 16);
+
+ {
+ // pack and round
+ uint8x8_t p0 = vqrshrun_n_s16(row0, 1);
+ uint8x8_t p1 = vqrshrun_n_s16(row1, 1);
+ uint8x8_t p2 = vqrshrun_n_s16(row2, 1);
+ uint8x8_t p3 = vqrshrun_n_s16(row3, 1);
+ uint8x8_t p4 = vqrshrun_n_s16(row4, 1);
+ uint8x8_t p5 = vqrshrun_n_s16(row5, 1);
+ uint8x8_t p6 = vqrshrun_n_s16(row6, 1);
+ uint8x8_t p7 = vqrshrun_n_s16(row7, 1);
+
+ // again, these can translate into one instruction, but often don't.
+#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }
+#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }
+#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }
+
+ // sadly can't use interleaved stores here since we only write
+ // 8 bytes to each scan line!
+
+ // 8x8 8-bit transpose pass 1
+ dct_trn8_8(p0, p1);
+ dct_trn8_8(p2, p3);
+ dct_trn8_8(p4, p5);
+ dct_trn8_8(p6, p7);
+
+ // pass 2
+ dct_trn8_16(p0, p2);
+ dct_trn8_16(p1, p3);
+ dct_trn8_16(p4, p6);
+ dct_trn8_16(p5, p7);
+
+ // pass 3
+ dct_trn8_32(p0, p4);
+ dct_trn8_32(p1, p5);
+ dct_trn8_32(p2, p6);
+ dct_trn8_32(p3, p7);
+
+ // store
+ vst1_u8(out, p0); out += out_stride;
+ vst1_u8(out, p1); out += out_stride;
+ vst1_u8(out, p2); out += out_stride;
+ vst1_u8(out, p3); out += out_stride;
+ vst1_u8(out, p4); out += out_stride;
+ vst1_u8(out, p5); out += out_stride;
+ vst1_u8(out, p6); out += out_stride;
+ vst1_u8(out, p7);
+
+#undef dct_trn8_8
+#undef dct_trn8_16
+#undef dct_trn8_32
+ }
+
+#undef dct_long_mul
+#undef dct_long_mac
+#undef dct_widen
+#undef dct_wadd
+#undef dct_wsub
+#undef dct_bfly32o
+#undef dct_pass
}
-#endif
+
+#endif // STBI_NEON
#define STBI__MARKER_none 0xff
// if there's a pending marker from the entropy stream, return that
@@ -1373,6 +2428,7 @@ static void stbi__jpeg_reset(stbi__jpeg *j)
j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;
j->marker = STBI__MARKER_none;
j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
+ j->eob_run = 0;
// no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
// since we don't even allow 1<<30 pixels
}
@@ -1380,73 +2436,151 @@ static void stbi__jpeg_reset(stbi__jpeg *j)
static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
{
stbi__jpeg_reset(z);
- if (z->scan_n == 1) {
- int i,j;
- #ifdef STBI_SIMD
- __declspec(align(16))
- #endif
- short data[64];
- int n = z->order[0];
- // non-interleaved data, we just need to process one block at a time,
- // in trivial scanline order
- // number of blocks to do just depends on how many actual "pixels" this
- // component has, independent of interleaved MCU blocking and such
- int w = (z->img_comp[n].x+7) >> 3;
- int h = (z->img_comp[n].y+7) >> 3;
- for (j=0; j < h; ++j) {
- for (i=0; i < w; ++i) {
- if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
- #ifdef STBI_SIMD
- stbi__idct_installed(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
- #else
- stbi__idct_block(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
- #endif
- // every data block is an MCU, so countdown the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- // if it's NOT a restart, then just bail, so we get corrupt data
- // rather than no data
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
+ if (!z->progressive) {
+ if (z->scan_n == 1) {
+ int i,j;
+ STBI_SIMD_ALIGN(short, data[64]);
+ int n = z->order[0];
+ // non-interleaved data, we just need to process one block at a time,
+ // in trivial scanline order
+ // number of blocks to do just depends on how many actual "pixels" this
+ // component has, independent of interleaved MCU blocking and such
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
+ // every data block is an MCU, so countdown the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ // if it's NOT a restart, then just bail, so we get corrupt data
+ // rather than no data
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
}
}
+ return 1;
+ } else { // interleaved
+ int i,j,k,x,y;
+ STBI_SIMD_ALIGN(short, data[64]);
+ for (j=0; j < z->img_mcu_y; ++j) {
+ for (i=0; i < z->img_mcu_x; ++i) {
+ // scan an interleaved mcu... process scan_n components in order
+ for (k=0; k < z->scan_n; ++k) {
+ int n = z->order[k];
+ // scan out an mcu's worth of this component; that's just determined
+ // by the basic H and V specified for the component
+ for (y=0; y < z->img_comp[n].v; ++y) {
+ for (x=0; x < z->img_comp[n].h; ++x) {
+ int x2 = (i*z->img_comp[n].h + x)*8;
+ int y2 = (j*z->img_comp[n].v + y)*8;
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);
+ }
+ }
+ }
+ // after all interleaved components, that's an interleaved MCU,
+ // so now count down the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
}
- } else { // interleaved!
- int i,j,k,x,y;
- short data[64];
- for (j=0; j < z->img_mcu_y; ++j) {
- for (i=0; i < z->img_mcu_x; ++i) {
- // scan an interleaved mcu... process scan_n components in order
- for (k=0; k < z->scan_n; ++k) {
- int n = z->order[k];
- // scan out an mcu's worth of this component; that's just determined
- // by the basic H and V specified for the component
- for (y=0; y < z->img_comp[n].v; ++y) {
- for (x=0; x < z->img_comp[n].h; ++x) {
- int x2 = (i*z->img_comp[n].h + x)*8;
- int y2 = (j*z->img_comp[n].v + y)*8;
- if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0;
- #ifdef STBI_SIMD
- stbi__idct_installed(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]);
- #else
- stbi__idct_block(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]);
- #endif
+ } else {
+ if (z->scan_n == 1) {
+ int i,j;
+ int n = z->order[0];
+ // non-interleaved data, we just need to process one block at a time,
+ // in trivial scanline order
+ // number of blocks to do just depends on how many actual "pixels" this
+ // component has, independent of interleaved MCU blocking and such
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
+ if (z->spec_start == 0) {
+ if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
+ return 0;
+ } else {
+ int ha = z->img_comp[n].ha;
+ if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))
+ return 0;
+ }
+ // every data block is an MCU, so countdown the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
+ }
+ }
+ return 1;
+ } else { // interleaved
+ int i,j,k,x,y;
+ for (j=0; j < z->img_mcu_y; ++j) {
+ for (i=0; i < z->img_mcu_x; ++i) {
+ // scan an interleaved mcu... process scan_n components in order
+ for (k=0; k < z->scan_n; ++k) {
+ int n = z->order[k];
+ // scan out an mcu's worth of this component; that's just determined
+ // by the basic H and V specified for the component
+ for (y=0; y < z->img_comp[n].v; ++y) {
+ for (x=0; x < z->img_comp[n].h; ++x) {
+ int x2 = (i*z->img_comp[n].h + x);
+ int y2 = (j*z->img_comp[n].v + y);
+ short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);
+ if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
+ return 0;
+ }
}
}
+ // after all interleaved components, that's an interleaved MCU,
+ // so now count down the restart interval
+ if (--z->todo <= 0) {
+ if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
+ if (!STBI__RESTART(z->marker)) return 1;
+ stbi__jpeg_reset(z);
+ }
}
- // after all interleaved components, that's an interleaved MCU,
- // so now count down the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- // if it's NOT a restart, then just bail, so we get corrupt data
- // rather than no data
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
+ }
+ return 1;
+ }
+ }
+}
+
+static void stbi__jpeg_dequantize(short *data, stbi_uc *dequant)
+{
+ int i;
+ for (i=0; i < 64; ++i)
+ data[i] *= dequant[i];
+}
+
+static void stbi__jpeg_finish(stbi__jpeg *z)
+{
+ if (z->progressive) {
+ // dequantize and idct the data
+ int i,j,n;
+ for (n=0; n < z->s->img_n; ++n) {
+ int w = (z->img_comp[n].x+7) >> 3;
+ int h = (z->img_comp[n].y+7) >> 3;
+ for (j=0; j < h; ++j) {
+ for (i=0; i < w; ++i) {
+ short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
+ stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
+ z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
}
}
}
}
- return 1;
}
static int stbi__process_marker(stbi__jpeg *z, int m)
@@ -1456,9 +2590,6 @@ static int stbi__process_marker(stbi__jpeg *z, int m)
case STBI__MARKER_none: // no marker found
return stbi__err("expected marker","Corrupt JPEG");
- case 0xC2: // stbi__SOF - progressive
- return stbi__err("progressive jpeg","JPEG format not supported (progressive)");
-
case 0xDD: // DRI - specify restart interval
if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
z->restart_interval = stbi__get16be(z->s);
@@ -1474,10 +2605,6 @@ static int stbi__process_marker(stbi__jpeg *z, int m)
if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
for (i=0; i < 64; ++i)
z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s);
- #ifdef STBI_SIMD
- for (i=0; i < 64; ++i)
- z->dequant2[t][i] = z->dequant[t][i];
- #endif
L -= 65;
}
return L==0;
@@ -1505,6 +2632,8 @@ static int stbi__process_marker(stbi__jpeg *z, int m)
}
for (i=0; i < n; ++i)
v[i] = stbi__get8(z->s);
+ if (tc != 0)
+ stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
L -= n;
}
return L==0;
@@ -1517,28 +2646,42 @@ static int stbi__process_marker(stbi__jpeg *z, int m)
return 0;
}
-// after we see stbi__SOS
+// after we see SOS
static int stbi__process_scan_header(stbi__jpeg *z)
{
int i;
int Ls = stbi__get16be(z->s);
z->scan_n = stbi__get8(z->s);
- if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad stbi__SOS component count","Corrupt JPEG");
- if (Ls != 6+2*z->scan_n) return stbi__err("bad stbi__SOS len","Corrupt JPEG");
+ if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
+ if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
for (i=0; i < z->scan_n; ++i) {
int id = stbi__get8(z->s), which;
int q = stbi__get8(z->s);
for (which = 0; which < z->s->img_n; ++which)
if (z->img_comp[which].id == id)
break;
- if (which == z->s->img_n) return 0;
+ if (which == z->s->img_n) return 0; // no match
z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
z->order[i] = which;
}
- if (stbi__get8(z->s) != 0) return stbi__err("bad stbi__SOS","Corrupt JPEG");
- stbi__get8(z->s); // should be 63, but might be 0
- if (stbi__get8(z->s) != 0) return stbi__err("bad stbi__SOS","Corrupt JPEG");
+
+ {
+ int aa;
+ z->spec_start = stbi__get8(z->s);
+ z->spec_end = stbi__get8(z->s); // should be 63, but might be 0
+ aa = stbi__get8(z->s);
+ z->succ_high = (aa >> 4);
+ z->succ_low = (aa & 15);
+ if (z->progressive) {
+ if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)
+ return stbi__err("bad SOS", "Corrupt JPEG");
+ } else {
+ if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
+ if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
+ z->spec_end = 63;
+ }
+ }
return 1;
}
@@ -1547,8 +2690,8 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
{
stbi__context *s = z->s;
int Lf,p,i,q, h_max=1,v_max=1,c;
- Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad stbi__SOF len","Corrupt JPEG"); // JPEG
- p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
+ Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
+ p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
c = stbi__get8(s);
@@ -1559,7 +2702,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
z->img_comp[i].linebuf = NULL;
}
- if (Lf != 8+3*s->img_n) return stbi__err("bad stbi__SOF len","Corrupt JPEG");
+ if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
for (i=0; i < s->img_n; ++i) {
z->img_comp[i].id = stbi__get8(s);
@@ -1572,9 +2715,9 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
}
- if (scan != SCAN_load) return 1;
+ if (scan != STBI__SCAN_load) return 1;
- if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to stbi__jpeg_huff_decode");
+ if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
for (i=0; i < s->img_n; ++i) {
if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
@@ -1590,64 +2733,82 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan)
z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
for (i=0; i < s->img_n; ++i) {
- // number of effective pixels (stbi__err.g. for non-interleaved MCU)
+ // number of effective pixels (e.g. for non-interleaved MCU)
z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
- // to simplify generation, we'll allocate enough memory to stbi__jpeg_huff_decode
+ // to simplify generation, we'll allocate enough memory to decode
// the bogus oversized data from using interleaved MCUs and their
- // big blocks (stbi__err.g. a 16x16 iMCU on an image of width 33); we won't
+ // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
// discard the extra data until colorspace conversion
z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
- z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
+ z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15);
+
if (z->img_comp[i].raw_data == NULL) {
for(--i; i >= 0; --i) {
- free(z->img_comp[i].raw_data);
+ STBI_FREE(z->img_comp[i].raw_data);
z->img_comp[i].data = NULL;
}
return stbi__err("outofmem", "Out of memory");
}
- // align blocks for installable-idct using mmx/sse
+ // align blocks for idct using mmx/sse
z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
z->img_comp[i].linebuf = NULL;
+ if (z->progressive) {
+ z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3;
+ z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3;
+ z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15);
+ z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
+ } else {
+ z->img_comp[i].coeff = 0;
+ z->img_comp[i].raw_coeff = 0;
+ }
}
return 1;
}
-// use comparisons since in some cases we handle more than one case (stbi__err.g. stbi__SOF)
+// use comparisons since in some cases we handle more than one case (e.g. SOF)
#define stbi__DNL(x) ((x) == 0xdc)
#define stbi__SOI(x) ((x) == 0xd8)
#define stbi__EOI(x) ((x) == 0xd9)
-#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1)
+#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
#define stbi__SOS(x) ((x) == 0xda)
-static int decode_jpeg_header(stbi__jpeg *z, int scan)
+#define stbi__SOF_progressive(x) ((x) == 0xc2)
+
+static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
{
int m;
z->marker = STBI__MARKER_none; // initialize cached marker to empty
m = stbi__get_marker(z);
- if (!stbi__SOI(m)) return stbi__err("no stbi__SOI","Corrupt JPEG");
- if (scan == SCAN_type) return 1;
+ if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
+ if (scan == STBI__SCAN_type) return 1;
m = stbi__get_marker(z);
while (!stbi__SOF(m)) {
if (!stbi__process_marker(z,m)) return 0;
m = stbi__get_marker(z);
while (m == STBI__MARKER_none) {
// some files have extra padding after their blocks, so ok, we'll scan
- if (stbi__at_eof(z->s)) return stbi__err("no stbi__SOF", "Corrupt JPEG");
+ if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
m = stbi__get_marker(z);
}
}
+ z->progressive = stbi__SOF_progressive(m);
if (!stbi__process_frame_header(z, scan)) return 0;
return 1;
}
-static int decode_jpeg_image(stbi__jpeg *j)
+// decode image to YCbCr format
+static int stbi__decode_jpeg_image(stbi__jpeg *j)
{
int m;
+ for (m = 0; m < 4; m++) {
+ j->img_comp[m].raw_data = NULL;
+ j->img_comp[m].raw_coeff = NULL;
+ }
j->restart_interval = 0;
- if (!decode_jpeg_header(j, SCAN_load)) return 0;
+ if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
m = stbi__get_marker(j);
while (!stbi__EOI(m)) {
if (stbi__SOS(m)) {
@@ -1661,7 +2822,7 @@ static int decode_jpeg_image(stbi__jpeg *j)
j->marker = stbi__get8(j->s);
break;
} else if (x != 0) {
- return 0;
+ return stbi__err("junk before marker", "Corrupt JPEG");
}
}
// if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
@@ -1671,6 +2832,8 @@ static int decode_jpeg_image(stbi__jpeg *j)
}
m = stbi__get_marker(j);
}
+ if (j->progressive)
+ stbi__jpeg_finish(j);
return 1;
}
@@ -1754,6 +2917,123 @@ static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc
return out;
}
+#if defined(STBI_SSE2) || defined(STBI_NEON)
+static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
+{
+ // need to generate 2x2 samples for every one in input
+ int i=0,t0,t1;
+
+ if (w == 1) {
+ out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
+ return out;
+ }
+
+ t1 = 3*in_near[0] + in_far[0];
+ // process groups of 8 pixels for as long as we can.
+ // note we can't handle the last pixel in a row in this loop
+ // because we need to handle the filter boundary conditions.
+ for (; i < ((w-1) & ~7); i += 8) {
+#if defined(STBI_SSE2)
+ // load and perform the vertical filtering pass
+ // this uses 3*x + y = 4*x + (y - x)
+ __m128i zero = _mm_setzero_si128();
+ __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i));
+ __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));
+ __m128i farw = _mm_unpacklo_epi8(farb, zero);
+ __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
+ __m128i diff = _mm_sub_epi16(farw, nearw);
+ __m128i nears = _mm_slli_epi16(nearw, 2);
+ __m128i curr = _mm_add_epi16(nears, diff); // current row
+
+ // horizontal filter works the same based on shifted vers of current
+ // row. "prev" is current row shifted right by 1 pixel; we need to
+ // insert the previous pixel value (from t1).
+ // "next" is current row shifted left by 1 pixel, with first pixel
+ // of next block of 8 pixels added in.
+ __m128i prv0 = _mm_slli_si128(curr, 2);
+ __m128i nxt0 = _mm_srli_si128(curr, 2);
+ __m128i prev = _mm_insert_epi16(prv0, t1, 0);
+ __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);
+
+ // horizontal filter, polyphase implementation since it's convenient:
+ // even pixels = 3*cur + prev = cur*4 + (prev - cur)
+ // odd pixels = 3*cur + next = cur*4 + (next - cur)
+ // note the shared term.
+ __m128i bias = _mm_set1_epi16(8);
+ __m128i curs = _mm_slli_epi16(curr, 2);
+ __m128i prvd = _mm_sub_epi16(prev, curr);
+ __m128i nxtd = _mm_sub_epi16(next, curr);
+ __m128i curb = _mm_add_epi16(curs, bias);
+ __m128i even = _mm_add_epi16(prvd, curb);
+ __m128i odd = _mm_add_epi16(nxtd, curb);
+
+ // interleave even and odd pixels, then undo scaling.
+ __m128i int0 = _mm_unpacklo_epi16(even, odd);
+ __m128i int1 = _mm_unpackhi_epi16(even, odd);
+ __m128i de0 = _mm_srli_epi16(int0, 4);
+ __m128i de1 = _mm_srli_epi16(int1, 4);
+
+ // pack and write output
+ __m128i outv = _mm_packus_epi16(de0, de1);
+ _mm_storeu_si128((__m128i *) (out + i*2), outv);
+#elif defined(STBI_NEON)
+ // load and perform the vertical filtering pass
+ // this uses 3*x + y = 4*x + (y - x)
+ uint8x8_t farb = vld1_u8(in_far + i);
+ uint8x8_t nearb = vld1_u8(in_near + i);
+ int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
+ int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
+ int16x8_t curr = vaddq_s16(nears, diff); // current row
+
+ // horizontal filter works the same based on shifted vers of current
+ // row. "prev" is current row shifted right by 1 pixel; we need to
+ // insert the previous pixel value (from t1).
+ // "next" is current row shifted left by 1 pixel, with first pixel
+ // of next block of 8 pixels added in.
+ int16x8_t prv0 = vextq_s16(curr, curr, 7);
+ int16x8_t nxt0 = vextq_s16(curr, curr, 1);
+ int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
+ int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);
+
+ // horizontal filter, polyphase implementation since it's convenient:
+ // even pixels = 3*cur + prev = cur*4 + (prev - cur)
+ // odd pixels = 3*cur + next = cur*4 + (next - cur)
+ // note the shared term.
+ int16x8_t curs = vshlq_n_s16(curr, 2);
+ int16x8_t prvd = vsubq_s16(prev, curr);
+ int16x8_t nxtd = vsubq_s16(next, curr);
+ int16x8_t even = vaddq_s16(curs, prvd);
+ int16x8_t odd = vaddq_s16(curs, nxtd);
+
+ // undo scaling and round, then store with even/odd phases interleaved
+ uint8x8x2_t o;
+ o.val[0] = vqrshrun_n_s16(even, 4);
+ o.val[1] = vqrshrun_n_s16(odd, 4);
+ vst2_u8(out + i*2, o);
+#endif
+
+ // "previous" value for next iter
+ t1 = 3*in_near[i+7] + in_far[i+7];
+ }
+
+ t0 = t1;
+ t1 = 3*in_near[i] + in_far[i];
+ out[i*2] = stbi__div16(3*t1 + t0 + 8);
+
+ for (++i; i < w; ++i) {
+ t0 = t1;
+ t1 = 3*in_near[i]+in_far[i];
+ out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
+ out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
+ }
+ out[w*2-1] = stbi__div4(t1+2);
+
+ STBI_NOTUSED(hs);
+
+ return out;
+}
+#endif
+
static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
{
// resample with nearest-neighbor
@@ -1765,10 +3045,10 @@ static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_
return out;
}
+#ifdef STBI_JPEG_OLD
+// this is the same YCbCr-to-RGB calculation that stb_image has used
+// historically before the algorithm changes in 1.49
#define float2fixed(x) ((int) ((x) * 65536 + 0.5))
-
-// 0.38 seconds on 3*anemones.jpg (0.25 with processor = Pro)
-// VC6 without processor=Pro is generating multiple LEAs per multiply!
static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
{
int i;
@@ -1793,28 +3073,214 @@ static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc
out += step;
}
}
+#else
+// this is a reduced-precision calculation of YCbCr-to-RGB introduced
+// to make sure the code produces the same results in both SIMD and scalar
+#define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8)
+static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
+{
+ int i;
+ for (i=0; i < count; ++i) {
+ int y_fixed = (y[i] << 20) + (1<<19); // rounding
+ int r,g,b;
+ int cr = pcr[i] - 128;
+ int cb = pcb[i] - 128;
+ r = y_fixed + cr* float2fixed(1.40200f);
+ g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);
+ b = y_fixed + cb* float2fixed(1.77200f);
+ r >>= 20;
+ g >>= 20;
+ b >>= 20;
+ if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
+ if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
+ if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
+ out[0] = (stbi_uc)r;
+ out[1] = (stbi_uc)g;
+ out[2] = (stbi_uc)b;
+ out[3] = 255;
+ out += step;
+ }
+}
+#endif
+
+#if defined(STBI_SSE2) || defined(STBI_NEON)
+static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)
+{
+ int i = 0;
+
+#ifdef STBI_SSE2
+ // step == 3 is pretty ugly on the final interleave, and i'm not convinced
+ // it's useful in practice (you wouldn't use it for textures, for example).
+ // so just accelerate step == 4 case.
+ if (step == 4) {
+ // this is a fairly straightforward implementation and not super-optimized.
+ __m128i signflip = _mm_set1_epi8((char)0x80);
+ __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f));
+ __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));
+ __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));
+ __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f));
+ __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);
+ __m128i xw = _mm_set1_epi16(255); // alpha channel
+
+ for (; i+7 < count; i += 8) {
+ // load
+ __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));
+ __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));
+ __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));
+ __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
+ __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
+
+ // unpack to short (and left-shift cr, cb by 8)
+ __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);
+ __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
+ __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
+
+ // color transform
+ __m128i yws = _mm_srli_epi16(yw, 4);
+ __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
+ __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
+ __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
+ __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
+ __m128i rws = _mm_add_epi16(cr0, yws);
+ __m128i gwt = _mm_add_epi16(cb0, yws);
+ __m128i bws = _mm_add_epi16(yws, cb1);
+ __m128i gws = _mm_add_epi16(gwt, cr1);
+
+ // descale
+ __m128i rw = _mm_srai_epi16(rws, 4);
+ __m128i bw = _mm_srai_epi16(bws, 4);
+ __m128i gw = _mm_srai_epi16(gws, 4);
+
+ // back to byte, set up for transpose
+ __m128i brb = _mm_packus_epi16(rw, bw);
+ __m128i gxb = _mm_packus_epi16(gw, xw);
+
+ // transpose to interleave channels
+ __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
+ __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
+ __m128i o0 = _mm_unpacklo_epi16(t0, t1);
+ __m128i o1 = _mm_unpackhi_epi16(t0, t1);
+
+ // store
+ _mm_storeu_si128((__m128i *) (out + 0), o0);
+ _mm_storeu_si128((__m128i *) (out + 16), o1);
+ out += 32;
+ }
+ }
+#endif
-#ifdef STBI_SIMD
-static stbi_YCbCr_to_RGB_run stbi__YCbCr_installed = stbi__YCbCr_to_RGB_row;
+#ifdef STBI_NEON
+ // in this version, step=3 support would be easy to add. but is there demand?
+ if (step == 4) {
+ // this is a fairly straightforward implementation and not super-optimized.
+ uint8x8_t signflip = vdup_n_u8(0x80);
+ int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f));
+ int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));
+ int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));
+ int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f));
+
+ for (; i+7 < count; i += 8) {
+ // load
+ uint8x8_t y_bytes = vld1_u8(y + i);
+ uint8x8_t cr_bytes = vld1_u8(pcr + i);
+ uint8x8_t cb_bytes = vld1_u8(pcb + i);
+ int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
+ int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
+
+ // expand to s16
+ int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
+ int16x8_t crw = vshll_n_s8(cr_biased, 7);
+ int16x8_t cbw = vshll_n_s8(cb_biased, 7);
+
+ // color transform
+ int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
+ int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
+ int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
+ int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
+ int16x8_t rws = vaddq_s16(yws, cr0);
+ int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
+ int16x8_t bws = vaddq_s16(yws, cb1);
+
+ // undo scaling, round, convert to byte
+ uint8x8x4_t o;
+ o.val[0] = vqrshrun_n_s16(rws, 4);
+ o.val[1] = vqrshrun_n_s16(gws, 4);
+ o.val[2] = vqrshrun_n_s16(bws, 4);
+ o.val[3] = vdup_n_u8(255);
+
+ // store, interleaving r/g/b/a
+ vst4_u8(out, o);
+ out += 8*4;
+ }
+ }
+#endif
-STBIDEF void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func)
-{
- stbi__YCbCr_installed = func;
+ for (; i < count; ++i) {
+ int y_fixed = (y[i] << 20) + (1<<19); // rounding
+ int r,g,b;
+ int cr = pcr[i] - 128;
+ int cb = pcb[i] - 128;
+ r = y_fixed + cr* float2fixed(1.40200f);
+ g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);
+ b = y_fixed + cb* float2fixed(1.77200f);
+ r >>= 20;
+ g >>= 20;
+ b >>= 20;
+ if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
+ if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
+ if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
+ out[0] = (stbi_uc)r;
+ out[1] = (stbi_uc)g;
+ out[2] = (stbi_uc)b;
+ out[3] = 255;
+ out += step;
+ }
}
#endif
+// set up the kernels
+static void stbi__setup_jpeg(stbi__jpeg *j)
+{
+ j->idct_block_kernel = stbi__idct_block;
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
+
+#ifdef STBI_SSE2
+ if (stbi__sse2_available()) {
+ j->idct_block_kernel = stbi__idct_simd;
+ #ifndef STBI_JPEG_OLD
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
+ #endif
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
+ }
+#endif
+
+#ifdef STBI_NEON
+ j->idct_block_kernel = stbi__idct_simd;
+ #ifndef STBI_JPEG_OLD
+ j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
+ #endif
+ j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
+#endif
+}
// clean up the temporary component buffers
static void stbi__cleanup_jpeg(stbi__jpeg *j)
{
int i;
for (i=0; i < j->s->img_n; ++i) {
- if (j->img_comp[i].data) {
- free(j->img_comp[i].raw_data);
+ if (j->img_comp[i].raw_data) {
+ STBI_FREE(j->img_comp[i].raw_data);
+ j->img_comp[i].raw_data = NULL;
j->img_comp[i].data = NULL;
}
+ if (j->img_comp[i].raw_coeff) {
+ STBI_FREE(j->img_comp[i].raw_coeff);
+ j->img_comp[i].raw_coeff = 0;
+ j->img_comp[i].coeff = 0;
+ }
if (j->img_comp[i].linebuf) {
- free(j->img_comp[i].linebuf);
+ STBI_FREE(j->img_comp[i].linebuf);
j->img_comp[i].linebuf = NULL;
}
}
@@ -1833,12 +3299,13 @@ typedef struct
static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
{
int n, decode_n;
+ z->s->img_n = 0; // make stbi__cleanup_jpeg safe
+
// validate req_comp
if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
- z->s->img_n = 0;
- // load a jpeg image from whichever source
- if (!decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
+ // load a jpeg image from whichever source, but leave in YCbCr format
+ if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
// determine actual number of components to generate
n = req_comp ? req_comp : z->s->img_n;
@@ -1862,7 +3329,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp
// allocate line buffer big enough for upsampling off the edges
// with upsample factor of 4
- z->img_comp[k].linebuf = (stbi_uc *) malloc(z->s->img_x + 3);
+ z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);
if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
r->hs = z->img_h_max / z->img_comp[k].h;
@@ -1875,12 +3342,12 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp
if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;
else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;
- else if (r->hs == 2 && r->vs == 2) r->resample = stbi__resample_row_hv_2;
+ else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;
else r->resample = stbi__resample_row_generic;
}
// can't error after this so, this is safe
- output = (stbi_uc *) malloc(n * z->s->img_x * z->s->img_y + 1);
+ output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1);
if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
// now go ahead and resample
@@ -1903,11 +3370,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp
if (n >= 3) {
stbi_uc *y = coutput[0];
if (z->s->img_n == 3) {
- #ifdef STBI_SIMD
- stbi__YCbCr_installed(out, y, coutput[1], coutput[2], z->s->img_x, n);
- #else
- stbi__YCbCr_to_RGB_row(out, y, coutput[1], coutput[2], z->s->img_x, n);
- #endif
+ z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
} else
for (i=0; i < z->s->img_x; ++i) {
out[0] = out[1] = out[2] = y[i];
@@ -1934,6 +3397,7 @@ static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *com
{
stbi__jpeg j;
j.s = s;
+ stbi__setup_jpeg(&j);
return load_jpeg_image(&j, x,y,comp,req_comp);
}
@@ -1942,14 +3406,15 @@ static int stbi__jpeg_test(stbi__context *s)
int r;
stbi__jpeg j;
j.s = s;
- r = decode_jpeg_header(&j, SCAN_type);
+ stbi__setup_jpeg(&j);
+ r = stbi__decode_jpeg_header(&j, STBI__SCAN_type);
stbi__rewind(s);
return r;
}
static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
{
- if (!decode_jpeg_header(j, SCAN_header)) {
+ if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {
stbi__rewind( j->s );
return 0;
}
@@ -1965,14 +3430,17 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
j.s = s;
return stbi__jpeg_info_raw(&j, x, y, comp);
}
+#endif
-// public domain zlib stbi__jpeg_huff_decode v0.2 Sean Barrett 2006-11-18
+// public domain zlib decode v0.2 Sean Barrett 2006-11-18
// simple implementation
// - all input must be provided in an upfront buffer
// - all output is written to a single output buffer (can malloc/realloc)
// performance
// - fast huffman
+#ifndef STBI_NO_ZLIB
+
// fast-way is faster to check than jpeg huffman, but slow way is slower
#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables
#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)
@@ -2000,9 +3468,9 @@ stbi_inline static int stbi__bitreverse16(int n)
stbi_inline static int stbi__bit_reverse(int v, int bits)
{
- assert(bits <= 16);
+ STBI_ASSERT(bits <= 16);
// to bit reverse n bits, reverse 16 and shift
- // stbi__err.g. 11 bits, bit reverse and shift away 5
+ // e.g. 11 bits, bit reverse and shift away 5
return stbi__bitreverse16(v) >> (16-bits);
}
@@ -2013,12 +3481,13 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)
// DEFLATE spec for generating codes
memset(sizes, 0, sizeof(sizes));
- memset(z->fast, 255, sizeof(z->fast));
+ memset(z->fast, 0, sizeof(z->fast));
for (i=0; i < num; ++i)
++sizes[sizelist[i]];
sizes[0] = 0;
for (i=1; i < 16; ++i)
- assert(sizes[i] <= (1 << i));
+ if (sizes[i] > (1 << i))
+ return stbi__err("bad sizes", "Corrupt PNG");
code = 0;
for (i=1; i < 16; ++i) {
next_code[i] = code;
@@ -2026,7 +3495,7 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)
z->firstsymbol[i] = (stbi__uint16) k;
code = (code + sizes[i]);
if (sizes[i])
- if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt JPEG");
+ if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
z->maxcode[i] = code << (16-i); // preshift for inner loop
code <<= 1;
k += sizes[i];
@@ -2036,12 +3505,13 @@ static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)
int s = sizelist[i];
if (s) {
int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
+ stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);
z->size [c] = (stbi_uc ) s;
z->value[c] = (stbi__uint16) i;
if (s <= STBI__ZFAST_BITS) {
int k = stbi__bit_reverse(next_code[s],s);
while (k < (1 << STBI__ZFAST_BITS)) {
- z->fast[k] = (stbi__uint16) c;
+ z->fast[k] = fastv;
k += (1 << s);
}
}
@@ -2080,7 +3550,7 @@ stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
static void stbi__fill_bits(stbi__zbuf *z)
{
do {
- assert(z->code_buffer < (1U << z->num_bits));
+ STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
z->code_buffer |= stbi__zget8(z) << z->num_bits;
z->num_bits += 8;
} while (z->num_bits <= 24);
@@ -2096,18 +3566,9 @@ stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)
return k;
}
-stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
+static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
{
int b,s,k;
- if (a->num_bits < 16) stbi__fill_bits(a);
- b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
- if (b < 0xffff) {
- s = z->size[b];
- a->code_buffer >>= s;
- a->num_bits -= s;
- return z->value[b];
- }
-
// not resolved by fast table, so compute it the slow way
// use jpeg approach, which requires MSbits at top
k = stbi__bit_reverse(a->code_buffer, 16);
@@ -2117,22 +3578,37 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
if (s == 16) return -1; // invalid code!
// code size is s, so:
b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
- assert(z->size[b] == s);
+ STBI_ASSERT(z->size[b] == s);
a->code_buffer >>= s;
a->num_bits -= s;
return z->value[b];
}
-static int stbi__zexpand(stbi__zbuf *z, int n) // need to make room for n bytes
+stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
+{
+ int b,s;
+ if (a->num_bits < 16) stbi__fill_bits(a);
+ b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
+ if (b) {
+ s = b >> 9;
+ a->code_buffer >>= s;
+ a->num_bits -= s;
+ return b & 511;
+ }
+ return stbi__zhuffman_decode_slowpath(a, z);
+}
+
+static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes
{
char *q;
int cur, limit;
+ z->zout = zout;
if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
cur = (int) (z->zout - z->zout_start);
limit = (int) (z->zout_end - z->zout_start);
while (cur + n > limit)
limit *= 2;
- q = (char *) realloc(z->zout_start, limit);
+ q = (char *) STBI_REALLOC(z->zout_start, limit);
if (q == NULL) return stbi__err("outofmem", "Out of memory");
z->zout_start = q;
z->zout = q + cur;
@@ -2156,16 +3632,23 @@ static int stbi__zdist_extra[32] =
static int stbi__parse_huffman_block(stbi__zbuf *a)
{
+ char *zout = a->zout;
for(;;) {
int z = stbi__zhuffman_decode(a, &a->z_length);
if (z < 256) {
if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
- if (a->zout >= a->zout_end) if (!stbi__zexpand(a, 1)) return 0;
- *a->zout++ = (char) z;
+ if (zout >= a->zout_end) {
+ if (!stbi__zexpand(a, zout, 1)) return 0;
+ zout = a->zout;
+ }
+ *zout++ = (char) z;
} else {
stbi_uc *p;
int len,dist;
- if (z == 256) return 1;
+ if (z == 256) {
+ a->zout = zout;
+ return 1;
+ }
z -= 257;
len = stbi__zlength_base[z];
if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
@@ -2173,11 +3656,18 @@ static int stbi__parse_huffman_block(stbi__zbuf *a)
if (z < 0) return stbi__err("bad huffman code","Corrupt PNG");
dist = stbi__zdist_base[z];
if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
- if (a->zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
- if (a->zout + len > a->zout_end) if (!stbi__zexpand(a, len)) return 0;
- p = (stbi_uc *) (a->zout - dist);
- while (len--)
- *a->zout++ = *p++;
+ if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
+ if (zout + len > a->zout_end) {
+ if (!stbi__zexpand(a, zout, len)) return 0;
+ zout = a->zout;
+ }
+ p = (stbi_uc *) (zout - dist);
+ if (dist == 1) { // run of one byte; common in images.
+ stbi_uc v = *p;
+ if (len) { do *zout++ = v; while (--len); }
+ } else {
+ if (len) { do *zout++ = *p++; while (--len); }
+ }
}
}
}
@@ -2204,7 +3694,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a)
n = 0;
while (n < hlit + hdist) {
int c = stbi__zhuffman_decode(a, &z_codelength);
- assert(c >= 0 && c < 19);
+ if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
if (c < 16)
lencodes[n++] = (stbi_uc) c;
else if (c == 16) {
@@ -2216,7 +3706,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a)
memset(lencodes+n, 0, c);
n += c;
} else {
- assert(c == 18);
+ STBI_ASSERT(c == 18);
c = stbi__zreceive(a,7)+11;
memset(lencodes+n, 0, c);
n += c;
@@ -2241,7 +3731,7 @@ static int stbi__parse_uncomperssed_block(stbi__zbuf *a)
a->code_buffer >>= 8;
a->num_bits -= 8;
}
- assert(a->num_bits == 0);
+ STBI_ASSERT(a->num_bits == 0);
// now fill header the normal way
while (k < 4)
header[k++] = stbi__zget8(a);
@@ -2250,7 +3740,7 @@ static int stbi__parse_uncomperssed_block(stbi__zbuf *a)
if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
if (a->zout + len > a->zout_end)
- if (!stbi__zexpand(a, len)) return 0;
+ if (!stbi__zexpand(a, a->zout, len)) return 0;
memcpy(a->zout, a->zbuffer, len);
a->zbuffer += len;
a->zout += len;
@@ -2325,7 +3815,7 @@ static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse
STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
{
stbi__zbuf a;
- char *p = (char *) malloc(initial_size);
+ char *p = (char *) stbi__malloc(initial_size);
if (p == NULL) return NULL;
a.zbuffer = (stbi_uc *) buffer;
a.zbuffer_end = (stbi_uc *) buffer + len;
@@ -2333,7 +3823,7 @@ STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
- free(a.zout_start);
+ STBI_FREE(a.zout_start);
return NULL;
}
}
@@ -2346,7 +3836,7 @@ STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
{
stbi__zbuf a;
- char *p = (char *) malloc(initial_size);
+ char *p = (char *) stbi__malloc(initial_size);
if (p == NULL) return NULL;
a.zbuffer = (stbi_uc *) buffer;
a.zbuffer_end = (stbi_uc *) buffer + len;
@@ -2354,7 +3844,7 @@ STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, i
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
- free(a.zout_start);
+ STBI_FREE(a.zout_start);
return NULL;
}
}
@@ -2373,7 +3863,7 @@ STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer
STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
{
stbi__zbuf a;
- char *p = (char *) malloc(16384);
+ char *p = (char *) stbi__malloc(16384);
if (p == NULL) return NULL;
a.zbuffer = (stbi_uc *) buffer;
a.zbuffer_end = (stbi_uc *) buffer+len;
@@ -2381,7 +3871,7 @@ STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int
if (outlen) *outlen = (int) (a.zout - a.zout_start);
return a.zout_start;
} else {
- free(a.zout_start);
+ STBI_FREE(a.zout_start);
return NULL;
}
}
@@ -2396,6 +3886,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char
else
return -1;
}
+#endif
// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
// simple implementation
@@ -2407,15 +3898,13 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char
// performance
// - uses stb_zlib, a PD zlib implementation with fast huffman decoding
-
+#ifndef STBI_NO_PNG
typedef struct
{
stbi__uint32 length;
stbi__uint32 type;
} stbi__pngchunk;
-#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
-
static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
{
stbi__pngchunk c;
@@ -2441,13 +3930,23 @@ typedef struct
enum {
- STBI__F_none=0, STBI__F_sub=1, STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4,
- STBI__F_avg_first, STBI__F_paeth_first
+ STBI__F_none=0,
+ STBI__F_sub=1,
+ STBI__F_up=2,
+ STBI__F_avg=3,
+ STBI__F_paeth=4,
+ // synthetic filters used for first scanline to avoid needing a dummy row of 0s
+ STBI__F_avg_first,
+ STBI__F_paeth_first
};
static stbi_uc first_row_filter[5] =
{
- STBI__F_none, STBI__F_sub, STBI__F_none, STBI__F_avg_first, STBI__F_paeth_first
+ STBI__F_none,
+ STBI__F_sub,
+ STBI__F_none,
+ STBI__F_avg_first,
+ STBI__F_paeth_first
};
static int stbi__paeth(int a, int b, int c)
@@ -2461,32 +3960,50 @@ static int stbi__paeth(int a, int b, int c)
return c;
}
-#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings
+static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };
// create the png data from post-deflated data
-static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y)
+static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)
{
stbi__context *s = a->s;
stbi__uint32 i,j,stride = x*out_n;
+ stbi__uint32 img_len, img_width_bytes;
int k;
int img_n = s->img_n; // copy it into a local for later
- assert(out_n == s->img_n || out_n == s->img_n+1);
- a->out = (stbi_uc *) malloc(x * y * out_n);
+
+ STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
+ a->out = (stbi_uc *) stbi__malloc(x * y * out_n); // extra bytes to write off the end into
if (!a->out) return stbi__err("outofmem", "Out of memory");
+
+ img_width_bytes = (((img_n * x * depth) + 7) >> 3);
+ img_len = (img_width_bytes + 1) * y;
if (s->img_x == x && s->img_y == y) {
- if (raw_len != (img_n * x + 1) * y) return stbi__err("not enough pixels","Corrupt PNG");
+ if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG");
} else { // interlaced:
- if (raw_len < (img_n * x + 1) * y) return stbi__err("not enough pixels","Corrupt PNG");
+ if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
}
+
for (j=0; j < y; ++j) {
stbi_uc *cur = a->out + stride*j;
stbi_uc *prior = cur - stride;
int filter = *raw++;
- if (filter > 4) return stbi__err("invalid filter","Corrupt PNG");
+ int filter_bytes = img_n;
+ int width = x;
+ if (filter > 4)
+ return stbi__err("invalid filter","Corrupt PNG");
+
+ if (depth < 8) {
+ STBI_ASSERT(img_width_bytes <= x);
+ cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place
+ filter_bytes = 1;
+ width = img_width_bytes;
+ }
+
// if first row, use special filter that doesn't sample previous row
if (j == 0) filter = first_row_filter[filter];
- // handle first pixel explicitly
- for (k=0; k < img_n; ++k) {
+
+ // handle first byte explicitly
+ for (k=0; k < filter_bytes; ++k) {
switch (filter) {
case STBI__F_none : cur[k] = raw[k]; break;
case STBI__F_sub : cur[k] = raw[k]; break;
@@ -2497,28 +4014,39 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r
case STBI__F_paeth_first: cur[k] = raw[k]; break;
}
}
- if (img_n != out_n) cur[img_n] = 255;
- raw += img_n;
- cur += out_n;
- prior += out_n;
+
+ if (depth == 8) {
+ if (img_n != out_n)
+ cur[img_n] = 255; // first pixel
+ raw += img_n;
+ cur += out_n;
+ prior += out_n;
+ } else {
+ raw += 1;
+ cur += 1;
+ prior += 1;
+ }
+
// this is a little gross, so that we don't switch per-pixel or per-component
- if (img_n == out_n) {
+ if (depth < 8 || img_n == out_n) {
+ int nk = (width - 1)*img_n;
#define CASE(f) \
case f: \
- for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \
- for (k=0; k < img_n; ++k)
+ for (k=0; k < nk; ++k)
switch (filter) {
- CASE(STBI__F_none) cur[k] = raw[k]; break;
- CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-img_n]); break;
+ // "none" filter turns into a memcpy here; make that explicit.
+ case STBI__F_none: memcpy(cur, raw, nk); break;
+ CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;
CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
- CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-img_n])>>1)); break;
- CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
- CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-img_n] >> 1)); break;
- CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-img_n],0,0)); break;
+ CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;
+ CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;
+ CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;
+ CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;
}
#undef CASE
+ raw += nk;
} else {
- assert(img_n+1 == out_n);
+ STBI_ASSERT(img_n+1 == out_n);
#define CASE(f) \
case f: \
for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
@@ -2535,18 +4063,93 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r
#undef CASE
}
}
+
+ // we make a separate pass to expand bits to pixels; for performance,
+ // this could run two scanlines behind the above code, so it won't
+ // intefere with filtering but will still be in the cache.
+ if (depth < 8) {
+ for (j=0; j < y; ++j) {
+ stbi_uc *cur = a->out + stride*j;
+ stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;
+ // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit
+ // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop
+ stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
+
+ // note that the final byte might overshoot and write more data than desired.
+ // we can allocate enough data that this never writes out of memory, but it
+ // could also overwrite the next scanline. can it overwrite non-empty data
+ // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.
+ // so we need to explicitly clamp the final ones
+
+ if (depth == 4) {
+ for (k=x*img_n; k >= 2; k-=2, ++in) {
+ *cur++ = scale * ((*in >> 4) );
+ *cur++ = scale * ((*in ) & 0x0f);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 4) );
+ } else if (depth == 2) {
+ for (k=x*img_n; k >= 4; k-=4, ++in) {
+ *cur++ = scale * ((*in >> 6) );
+ *cur++ = scale * ((*in >> 4) & 0x03);
+ *cur++ = scale * ((*in >> 2) & 0x03);
+ *cur++ = scale * ((*in ) & 0x03);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 6) );
+ if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);
+ if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);
+ } else if (depth == 1) {
+ for (k=x*img_n; k >= 8; k-=8, ++in) {
+ *cur++ = scale * ((*in >> 7) );
+ *cur++ = scale * ((*in >> 6) & 0x01);
+ *cur++ = scale * ((*in >> 5) & 0x01);
+ *cur++ = scale * ((*in >> 4) & 0x01);
+ *cur++ = scale * ((*in >> 3) & 0x01);
+ *cur++ = scale * ((*in >> 2) & 0x01);
+ *cur++ = scale * ((*in >> 1) & 0x01);
+ *cur++ = scale * ((*in ) & 0x01);
+ }
+ if (k > 0) *cur++ = scale * ((*in >> 7) );
+ if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);
+ if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);
+ if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);
+ if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);
+ if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);
+ if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);
+ }
+ if (img_n != out_n) {
+ // insert alpha = 255
+ stbi_uc *cur = a->out + stride*j;
+ int i;
+ if (img_n == 1) {
+ for (i=x-1; i >= 0; --i) {
+ cur[i*2+1] = 255;
+ cur[i*2+0] = cur[i];
+ }
+ } else {
+ STBI_ASSERT(img_n == 3);
+ for (i=x-1; i >= 0; --i) {
+ cur[i*4+3] = 255;
+ cur[i*4+2] = cur[i*3+2];
+ cur[i*4+1] = cur[i*3+1];
+ cur[i*4+0] = cur[i*3+0];
+ }
+ }
+ }
+ }
+ }
+
return 1;
}
-static int stbi__create_png_image(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, int interlaced)
+static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)
{
stbi_uc *final;
int p;
if (!interlaced)
- return stbi__create_png_image_raw(a, raw, raw_len, out_n, a->s->img_x, a->s->img_y);
+ return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);
// de-interlacing
- final = (stbi_uc *) malloc(a->s->img_x * a->s->img_y * out_n);
+ final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n);
for (p=0; p < 7; ++p) {
int xorig[] = { 0,4,0,2,0,1,0 };
int yorig[] = { 0,0,4,0,2,0,1 };
@@ -2557,17 +4160,22 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_l
x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
if (x && y) {
- if (!stbi__create_png_image_raw(a, raw, raw_len, out_n, x, y)) {
- free(final);
+ stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
+ if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
+ STBI_FREE(final);
return 0;
}
- for (j=0; j < y; ++j)
- for (i=0; i < x; ++i)
- memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
+ for (j=0; j < y; ++j) {
+ for (i=0; i < x; ++i) {
+ int out_y = j*yspc[p]+yorig[p];
+ int out_x = i*xspc[p]+xorig[p];
+ memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n,
a->out + (j*x+i)*out_n, out_n);
- free(a->out);
- raw += (x*out_n+1)*y;
- raw_len -= (x*out_n+1)*y;
+ }
+ }
+ STBI_FREE(a->out);
+ image_data += img_len;
+ image_data_len -= img_len;
}
}
a->out = final;
@@ -2583,7 +4191,7 @@ static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
// compute color-based transparency, assuming we've
// already got 255 as the alpha value in the output
- assert(out_n == 2 || out_n == 4);
+ STBI_ASSERT(out_n == 2 || out_n == 4);
if (out_n == 2) {
for (i=0; i < pixel_count; ++i) {
@@ -2605,7 +4213,7 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int
stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
stbi_uc *p, *temp_out, *orig = a->out;
- p = (stbi_uc *) malloc(pixel_count * pal_img_n);
+ p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n);
if (p == NULL) return stbi__err("outofmem", "Out of memory");
// between here and free(out) below, exitting would leak
@@ -2629,7 +4237,7 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int
p += 4;
}
}
- free(a->out);
+ STBI_FREE(a->out);
a->out = temp_out;
STBI_NOTUSED(len);
@@ -2664,7 +4272,7 @@ static void stbi__de_iphone(stbi__png *z)
p += 3;
}
} else {
- assert(s->img_out_n == 4);
+ STBI_ASSERT(s->img_out_n == 4);
if (stbi__unpremultiply_on_load) {
// convert bgr to rgb and unpremultiply
for (i=0; i < pixel_count; ++i) {
@@ -2692,12 +4300,14 @@ static void stbi__de_iphone(stbi__png *z)
}
}
+#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
+
static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
{
stbi_uc palette[1024], pal_img_n=0;
stbi_uc has_trans=0, tc[3];
stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
- int first=1,k,interlace=0, is_iphone=0;
+ int first=1,k,interlace=0, color=0, depth=0, is_iphone=0;
stbi__context *s = z->s;
z->expanded = NULL;
@@ -2706,23 +4316,23 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if (!stbi__check_png_header(s)) return 0;
- if (scan == SCAN_type) return 1;
+ if (scan == STBI__SCAN_type) return 1;
for (;;) {
stbi__pngchunk c = stbi__get_chunk_header(s);
switch (c.type) {
- case PNG_TYPE('C','g','B','I'):
+ case STBI__PNG_TYPE('C','g','B','I'):
is_iphone = 1;
stbi__skip(s, c.length);
break;
- case PNG_TYPE('I','H','D','R'): {
- int depth,color,comp,filter;
+ case STBI__PNG_TYPE('I','H','D','R'): {
+ int comp,filter;
if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
first = 0;
if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
- depth = stbi__get8(s); if (depth != 8) return stbi__err("8bit only","PNG not supported: 8-bit only");
+ depth = stbi__get8(s); if (depth != 1 && depth != 2 && depth != 4 && depth != 8) return stbi__err("1/2/4/8-bit only","PNG not supported: 1/2/4/8-bit only");
color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG");
if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG");
@@ -2731,8 +4341,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
if (!pal_img_n) {
s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
- if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to stbi__jpeg_huff_decode");
- if (scan == SCAN_header) return 1;
+ if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
+ if (scan == STBI__SCAN_header) return 1;
} else {
// if paletted, then pal_n is our final components, and
// img_n is # components to decompress/filter.
@@ -2743,7 +4353,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
break;
}
- case PNG_TYPE('P','L','T','E'): {
+ case STBI__PNG_TYPE('P','L','T','E'): {
if (first) return stbi__err("first not IHDR", "Corrupt PNG");
if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
pal_len = c.length / 3;
@@ -2757,11 +4367,11 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
break;
}
- case PNG_TYPE('t','R','N','S'): {
+ case STBI__PNG_TYPE('t','R','N','S'): {
if (first) return stbi__err("first not IHDR", "Corrupt PNG");
if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
if (pal_img_n) {
- if (scan == SCAN_header) { s->img_n = 4; return 1; }
+ if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
pal_img_n = 4;
@@ -2772,21 +4382,22 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
has_trans = 1;
for (k=0; k < s->img_n; ++k)
- tc[k] = (stbi_uc) (stbi__get16be(s) & 255); // non 8-bit images will be larger
+ tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger
}
break;
}
- case PNG_TYPE('I','D','A','T'): {
+ case STBI__PNG_TYPE('I','D','A','T'): {
if (first) return stbi__err("first not IHDR", "Corrupt PNG");
if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
- if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; }
+ if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
+ if ((int)(ioff + c.length) < (int)ioff) return 0;
if (ioff + c.length > idata_limit) {
stbi_uc *p;
if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
while (ioff + c.length > idata_limit)
idata_limit *= 2;
- p = (stbi_uc *) realloc(z->idata, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
+ p = (stbi_uc *) STBI_REALLOC(z->idata, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
z->idata = p;
}
if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
@@ -2794,19 +4405,22 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
break;
}
- case PNG_TYPE('I','E','N','D'): {
- stbi__uint32 raw_len;
+ case STBI__PNG_TYPE('I','E','N','D'): {
+ stbi__uint32 raw_len, bpl;
if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if (scan != SCAN_load) return 1;
+ if (scan != STBI__SCAN_load) return 1;
if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
- z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, 16384, (int *) &raw_len, !is_iphone);
+ // initial guess for decoded data size to avoid unnecessary reallocs
+ bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component
+ raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
+ z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
if (z->expanded == NULL) return 0; // zlib should set error
- free(z->idata); z->idata = NULL;
+ STBI_FREE(z->idata); z->idata = NULL;
if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
s->img_out_n = s->img_n+1;
else
s->img_out_n = s->img_n;
- if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, interlace)) return 0;
+ if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, depth, color, interlace)) return 0;
if (has_trans)
if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
@@ -2819,7 +4433,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
return 0;
}
- free(z->expanded); z->expanded = NULL;
+ STBI_FREE(z->expanded); z->expanded = NULL;
return 1;
}
@@ -2849,7 +4463,7 @@ static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req
{
unsigned char *result=NULL;
if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
- if (stbi__parse_png_file(p, SCAN_load, req_comp)) {
+ if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
result = p->out;
p->out = NULL;
if (req_comp && req_comp != p->s->img_out_n) {
@@ -2859,11 +4473,11 @@ static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req
}
*x = p->s->img_x;
*y = p->s->img_y;
- if (n) *n = p->s->img_n;
+ if (n) *n = p->s->img_out_n;
}
- free(p->out); p->out = NULL;
- free(p->expanded); p->expanded = NULL;
- free(p->idata); p->idata = NULL;
+ STBI_FREE(p->out); p->out = NULL;
+ STBI_FREE(p->expanded); p->expanded = NULL;
+ STBI_FREE(p->idata); p->idata = NULL;
return result;
}
@@ -2885,7 +4499,7 @@ static int stbi__png_test(stbi__context *s)
static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
{
- if (!stbi__parse_png_file(p, SCAN_header, 0)) {
+ if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {
stbi__rewind( p->s );
return 0;
}
@@ -2901,8 +4515,11 @@ static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
p.s = s;
return stbi__png_info_raw(&p, x, y, comp);
}
+#endif
// Microsoft/Windows BMP image
+
+#ifndef STBI_NO_BMP
static int stbi__bmp_test_raw(stbi__context *s)
{
int r;
@@ -3038,7 +4655,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
return stbi__errpuc("bad BMP", "bad BMP");
}
} else {
- assert(hsz == 108 || hsz == 124);
+ STBI_ASSERT(hsz == 108 || hsz == 124);
mr = stbi__get32le(s);
mg = stbi__get32le(s);
mb = stbi__get32le(s);
@@ -3057,15 +4674,15 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
psize = (offset - 14 - hsz) >> 2;
}
s->img_n = ma ? 4 : 3;
- if (req_comp && req_comp >= 3) // we can directly stbi__jpeg_huff_decode 3 or 4
+ if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
target = req_comp;
else
target = s->img_n; // if they want monochrome, we'll post-convert
- out = (stbi_uc *) malloc(target * s->img_x * s->img_y);
+ out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y);
if (!out) return stbi__errpuc("outofmem", "Out of memory");
if (bpp < 16) {
int z=0;
- if (psize == 0 || psize > 256) { free(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
+ if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
for (i=0; i < psize; ++i) {
pal[i][2] = stbi__get8(s);
pal[i][1] = stbi__get8(s);
@@ -3076,7 +4693,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
stbi__skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4));
if (bpp == 4) width = (s->img_x + 1) >> 1;
else if (bpp == 8) width = s->img_x;
- else { free(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
+ else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
pad = (-width)&3;
for (j=0; j < (int) s->img_y; ++j) {
for (i=0; i < (int) s->img_x; i += 2) {
@@ -3114,7 +4731,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
easy = 2;
}
if (!easy) {
- if (!mr || !mg || !mb) { free(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
+ if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
// right shift amt to put high bit in position #7
rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);
gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);
@@ -3134,7 +4751,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
}
} else {
for (i=0; i < (int) s->img_x; ++i) {
- stbi__uint32 v = (stbi__uint32) (bpp == 16 ? stbi__get16le(s) : stbi__get32le(s));
+ stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s));
int a;
out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
@@ -3167,10 +4784,11 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int
if (comp) *comp = s->img_n;
return out;
}
+#endif
// Targa Truevision - TGA
// by Jonathan Dummer
-
+#ifndef STBI_NO_TGA
static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
{
int tga_w, tga_h, tga_comp;
@@ -3254,7 +4872,7 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int
unsigned char *tga_data;
unsigned char *tga_palette = NULL;
int i, j;
- unsigned char raw_data[4] = {};
+ unsigned char raw_data[4];
int RLE_count = 0;
int RLE_repeating = 0;
int read_next_pixel = 1;
@@ -3290,7 +4908,7 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int
*y = tga_height;
if (comp) *comp = tga_comp;
- tga_data = (unsigned char*)malloc( tga_width * tga_height * tga_comp );
+ tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp );
if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");
// skip to the data's starting position (offset usually = 0)
@@ -3309,14 +4927,14 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int
// any data to skip? (offset usually = 0)
stbi__skip(s, tga_palette_start );
// load the palette
- tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 );
+ tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_palette_bits / 8 );
if (!tga_palette) {
- free(tga_data);
+ STBI_FREE(tga_data);
return stbi__errpuc("outofmem", "Out of memory");
}
if (!stbi__getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 )) {
- free(tga_data);
- free(tga_palette);
+ STBI_FREE(tga_data);
+ STBI_FREE(tga_palette);
return stbi__errpuc("bad palette", "Corrupt TGA");
}
}
@@ -3398,7 +5016,7 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int
// clear my palette, if I had one
if ( tga_palette != NULL )
{
- free( tga_palette );
+ STBI_FREE( tga_palette );
}
}
@@ -3426,10 +5044,12 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int
// OK, done
return tga_data;
}
+#endif
// *************************************************************************************************
// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
+#ifndef STBI_NO_PSD
static int stbi__psd_test(stbi__context *s)
{
int r = (stbi__get32be(s) == 0x38425053);
@@ -3500,7 +5120,7 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
return stbi__errpuc("bad compression", "PSD has an unknown compression format");
// Create the destination image.
- out = (stbi_uc *) malloc(4 * w*h);
+ out = (stbi_uc *) stbi__malloc(4 * w*h);
if (!out) return stbi__errpuc("outofmem", "Out of memory");
pixelCount = w*h;
@@ -3528,7 +5148,8 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
p = out+channel;
if (channel >= channelCount) {
// Fill this channel with default data.
- for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4;
+ for (i = 0; i < pixelCount; i++, p += 4)
+ *p = (channel == 3 ? 255 : 0);
} else {
// Read the RLE data.
count = 0;
@@ -3574,11 +5195,12 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
p = out + channel;
if (channel > channelCount) {
// Fill this channel with default data.
- for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4;
+ for (i = 0; i < pixelCount; i++, p += 4)
+ *p = channel == 3 ? 255 : 0;
} else {
// Read the data.
- for (i = 0; i < pixelCount; i++)
- *p = stbi__get8(s), p += 4;
+ for (i = 0; i < pixelCount; i++, p += 4)
+ *p = stbi__get8(s);
}
}
}
@@ -3588,12 +5210,13 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
if (out == NULL) return out; // stbi__convert_format frees input on failure
}
- if (comp) *comp = channelCount;
+ if (comp) *comp = 4;
*y = h;
*x = w;
return out;
}
+#endif
// *************************************************************************************************
// Softimage PIC loader
@@ -3602,6 +5225,7 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int
// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
+#ifndef STBI_NO_PIC
static int stbi__pic_is4(stbi__context *s,const char *str)
{
int i;
@@ -3778,18 +5402,18 @@ static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int re
x = stbi__get16be(s);
y = stbi__get16be(s);
if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)");
- if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to stbi__jpeg_huff_decode");
+ if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode");
stbi__get32be(s); //skip `ratio'
stbi__get16be(s); //skip `fields'
stbi__get16be(s); //skip `pad'
// intermediate buffer is RGBA
- result = (stbi_uc *) malloc(x*y*4);
+ result = (stbi_uc *) stbi__malloc(x*y*4);
memset(result, 0xff, x*y*4);
if (!stbi__pic_load_core(s,x,y,comp, result)) {
- free(result);
+ STBI_FREE(result);
result=0;
}
*px = x;
@@ -3806,9 +5430,12 @@ static int stbi__pic_test(stbi__context *s)
stbi__rewind(s);
return r;
}
+#endif
// *************************************************************************************************
// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
+
+#ifndef STBI_NO_GIF
typedef struct
{
stbi__int16 prefix;
@@ -3857,7 +5484,7 @@ static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], in
pal[i][2] = stbi__get8(s);
pal[i][1] = stbi__get8(s);
pal[i][0] = stbi__get8(s);
- pal[i][3] = transp ? 0 : 255;
+ pal[i][3] = transp == i ? 0 : 255;
}
}
@@ -3869,7 +5496,7 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in
version = stbi__get8(s);
if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF");
- if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
+ if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
stbi__g_failure_reason = "";
g->w = stbi__get16le(s);
@@ -3905,7 +5532,7 @@ static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
{
stbi_uc *p, *c;
- // recurse to stbi__jpeg_huff_decode the prefixes, since the linked-list is backwards,
+ // recurse to decode the prefixes, since the linked-list is backwards,
// and working backwards through an interleaved image would be nasty
if (g->codes[code].prefix >= 0)
stbi__out_gif_code(g, g->codes[code].prefix);
@@ -3944,6 +5571,7 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
stbi__gif_lzw *p;
lzw_cs = stbi__get8(s);
+ if (lzw_cs > 12) return NULL;
clear = 1 << lzw_cs;
first = 1;
codesize = lzw_cs + 1;
@@ -4036,14 +5664,14 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
if (g->out == 0) {
if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header
- g->out = (stbi_uc *) malloc(4 * g->w * g->h);
+ g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
stbi__fill_gif_background(g);
} else {
// animated-gif-only path
if (((g->eflags & 0x1C) >> 2) == 3) {
old_out = g->out;
- g->out = (stbi_uc *) malloc(4 * g->w * g->h);
+ g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
memcpy(g->out, old_out, g->w*g->h*4);
}
@@ -4121,7 +5749,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
}
case 0x3B: // gif stream termination code
- return (stbi_uc *) 1;
+ return (stbi_uc *) s; // using '1' causes warning on some compilers
default:
return stbi__errpuc("unknown code", "Corrupt GIF");
@@ -4132,10 +5760,11 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i
static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
stbi_uc *u = 0;
- stbi__gif g={};
+ stbi__gif g;
+ memset(&g, 0, sizeof(g));
u = stbi__gif_load_next(s, &g, comp, req_comp);
- if (u == (void *) 1) u = 0; // end of animated gif marker
+ if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
if (u) {
*x = g.w;
*y = g.h;
@@ -4148,7 +5777,7 @@ static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
{
return stbi__gif_info_raw(s,x,y,comp);
}
-
+#endif
// *************************************************************************************************
// Radiance RGBE HDR loader
@@ -4265,7 +5894,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re
if (req_comp == 0) req_comp = 3;
// Read data
- hdr_data = (float *) malloc(height * width * req_comp * sizeof(float));
+ hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float));
// Load image data
// image data is stored as some number of sca
@@ -4298,13 +5927,13 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re
stbi__hdr_convert(hdr_data, rgbe, req_comp);
i = 1;
j = 0;
- free(scanline);
+ STBI_FREE(scanline);
goto main_decode_loop; // yes, this makes no sense
}
len <<= 8;
len |= stbi__get8(s);
- if (len != width) { free(hdr_data); free(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
- if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4);
+ if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
+ if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4);
for (k = 0; k < 4; ++k) {
i = 0;
@@ -4326,7 +5955,7 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re
for (i=0; i < width; ++i)
stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
}
- free(scanline);
+ STBI_FREE(scanline);
}
return hdr_data;
@@ -4372,6 +6001,7 @@ static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
}
#endif // STBI_NO_HDR
+#ifndef STBI_NO_BMP
static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
{
int hsz;
@@ -4399,7 +6029,9 @@ static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
*comp = stbi__get16le(s) / 8;
return 1;
}
+#endif
+#ifndef STBI_NO_PSD
static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
{
int channelCount;
@@ -4430,7 +6062,9 @@ static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
*comp = 4;
return 1;
}
+#endif
+#ifndef STBI_NO_PIC
static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
{
int act_comp=0,num_packets=0,chained;
@@ -4475,35 +6109,163 @@ static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
return 1;
}
+#endif
+
+// *************************************************************************************************
+// Portable Gray Map and Portable Pixel Map loader
+// by Ken Miller
+//
+// PGM: http://netpbm.sourceforge.net/doc/pgm.html
+// PPM: http://netpbm.sourceforge.net/doc/ppm.html
+//
+// Known limitations:
+// Does not support comments in the header section
+// Does not support ASCII image data (formats P2 and P3)
+// Does not support 16-bit-per-channel
+
+#ifndef STBI_NO_PNM
+
+static int stbi__pnm_test(stbi__context *s)
+{
+ char p, t;
+ p = (char) stbi__get8(s);
+ t = (char) stbi__get8(s);
+ if (p != 'P' || (t != '5' && t != '6')) {
+ stbi__rewind( s );
+ return 0;
+ }
+ return 1;
+}
+
+static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
+{
+ stbi_uc *out;
+ if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))
+ return 0;
+ *x = s->img_x;
+ *y = s->img_y;
+ *comp = s->img_n;
+
+ out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y);
+ if (!out) return stbi__errpuc("outofmem", "Out of memory");
+ stbi__getn(s, out, s->img_n * s->img_x * s->img_y);
+
+ if (req_comp && req_comp != s->img_n) {
+ out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
+ if (out == NULL) return out; // stbi__convert_format frees input on failure
+ }
+ return out;
+}
+
+static int stbi__pnm_isspace(char c)
+{
+ return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
+}
+
+static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
+{
+ while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
+ *c = (char) stbi__get8(s);
+}
+
+static int stbi__pnm_isdigit(char c)
+{
+ return c >= '0' && c <= '9';
+}
+
+static int stbi__pnm_getinteger(stbi__context *s, char *c)
+{
+ int value = 0;
+
+ while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
+ value = value*10 + (*c - '0');
+ *c = (char) stbi__get8(s);
+ }
+
+ return value;
+}
+
+static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
+{
+ int maxv;
+ char c, p, t;
+
+ stbi__rewind( s );
+
+ // Get identifier
+ p = (char) stbi__get8(s);
+ t = (char) stbi__get8(s);
+ if (p != 'P' || (t != '5' && t != '6')) {
+ stbi__rewind( s );
+ return 0;
+ }
+
+ *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm
+
+ c = (char) stbi__get8(s);
+ stbi__pnm_skip_whitespace(s, &c);
+
+ *x = stbi__pnm_getinteger(s, &c); // read width
+ stbi__pnm_skip_whitespace(s, &c);
+
+ *y = stbi__pnm_getinteger(s, &c); // read height
+ stbi__pnm_skip_whitespace(s, &c);
+
+ maxv = stbi__pnm_getinteger(s, &c); // read max value
+
+ if (maxv > 255)
+ return stbi__err("max value > 255", "PPM image not 8-bit");
+ else
+ return 1;
+}
+#endif
static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
{
- if (stbi__jpeg_info(s, x, y, comp))
- return 1;
- if (stbi__png_info(s, x, y, comp))
- return 1;
- if (stbi__gif_info(s, x, y, comp))
- return 1;
- if (stbi__bmp_info(s, x, y, comp))
- return 1;
- if (stbi__psd_info(s, x, y, comp))
- return 1;
- if (stbi__pic_info(s, x, y, comp))
- return 1;
+ #ifndef STBI_NO_JPEG
+ if (stbi__jpeg_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PNG
+ if (stbi__png_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_GIF
+ if (stbi__gif_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_BMP
+ if (stbi__bmp_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PSD
+ if (stbi__psd_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PIC
+ if (stbi__pic_info(s, x, y, comp)) return 1;
+ #endif
+
+ #ifndef STBI_NO_PNM
+ if (stbi__pnm_info(s, x, y, comp)) return 1;
+ #endif
+
#ifndef STBI_NO_HDR
- if (stbi__hdr_info(s, x, y, comp))
- return 1;
+ if (stbi__hdr_info(s, x, y, comp)) return 1;
#endif
+
// test tga last because it's a crappy test!
+ #ifndef STBI_NO_TGA
if (stbi__tga_info(s, x, y, comp))
return 1;
+ #endif
return stbi__err("unknown image type", "Image not of any known type, or corrupt");
}
#ifndef STBI_NO_STDIO
STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
{
- FILE *f = fopen(filename, "rb");
+ FILE *f = stbi__fopen(filename, "rb");
int result;
if (!f) return stbi__err("can't fopen", "Unable to open file");
result = stbi_info_from_file(f, x, y, comp);
@@ -4539,114 +6301,145 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int
#endif // STB_IMAGE_IMPLEMENTATION
-#if !defined(STBI_NO_STDIO) && defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_CRT_SECURE_NO_WARNINGS)
-#pragma warning(pop)
-#endif
-
-
/*
revision history:
- 1.39 (2014-06-15)
- fix to TGA optimization when req_comp != number of components in TGA;
- fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
- add support for BMP version 5 (more ignored fields)
- 1.38 (2014-06-06)
- suppress MSVC warnings on integer casts truncating values
- fix accidental rename of 'skip' field of I/O
- 1.37 (2014-06-04)
- remove duplicate typedef
- 1.36 (2014-06-03)
- convert to header file single-file library
- if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
- 1.35 (2014-05-27)
- various warnings
- fix broken STBI_SIMD path
- fix bug where stbi_load_from_file no longer left file pointer in correct place
- fix broken non-easy path for 32-bit BMP (possibly never used)
- TGA optimization by Arseny Kapoulkine
- 1.34 (unknown)
- use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
- 1.33 (2011-07-14)
- make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
- 1.32 (2011-07-13)
- support for "info" function for all supported filetypes (SpartanJ)
- 1.31 (2011-06-20)
- a few more leak fixes, bug in PNG handling (SpartanJ)
- 1.30 (2011-06-11)
- added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
- removed deprecated format-specific test/load functions
- removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
- error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
- fix inefficiency in decoding 32-bit BMP (David Woo)
- 1.29 (2010-08-16)
- various warning fixes from Aurelien Pocheville
- 1.28 (2010-08-01)
- fix bug in GIF palette transparency (SpartanJ)
- 1.27 (2010-08-01)
- cast-to-stbi_uc to fix warnings
- 1.26 (2010-07-24)
- fix bug in file buffering for PNG reported by SpartanJ
- 1.25 (2010-07-17)
- refix trans_data warning (Won Chun)
- 1.24 (2010-07-12)
- perf improvements reading from files on platforms with lock-heavy fgetc()
- minor perf improvements for jpeg
- deprecated type-specific functions so we'll get feedback if they're needed
- attempt to fix trans_data warning (Won Chun)
- 1.23 fixed bug in iPhone support
- 1.22 (2010-07-10)
- removed image *writing* support
- stbi_info support from Jetro Lauha
- GIF support from Jean-Marc Lienher
- iPhone PNG-extensions from James Brown
- warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
- 1.21 fix use of 'stbi_uc' in header (reported by jon blow)
- 1.20 added support for Softimage PIC, by Tom Seddon
- 1.19 bug in interlaced PNG corruption check (found by ryg)
- 1.18 2008-08-02
- fix a threading bug (local mutable static)
- 1.17 support interlaced PNG
- 1.16 major bugfix - stbi__convert_format converted one too many pixels
- 1.15 initialize some fields for thread safety
- 1.14 fix threadsafe conversion bug
- header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
- 1.13 threadsafe
- 1.12 const qualifiers in the API
- 1.11 Support installable IDCT, colorspace conversion routines
- 1.10 Fixes for 64-bit (don't use "unsigned long")
- optimized upsampling by Fabian "ryg" Giesen
- 1.09 Fix format-conversion for PSD code (bad global variables!)
- 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
- 1.07 attempt to fix C++ warning/errors again
- 1.06 attempt to fix C++ warning/errors again
- 1.05 fix TGA loading to return correct *comp and use good luminance calc
- 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
- 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
- 1.02 support for (subset of) HDR files, float interface for preferred access to them
- 1.01 fix bug: possible bug in handling right-side up bmps... not sure
- fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
- 1.00 interface to zlib that skips zlib header
- 0.99 correct handling of alpha in palette
- 0.98 TGA loader by lonesock; dynamically add loaders (untested)
- 0.97 jpeg errors on too large a file; also catch another malloc failure
- 0.96 fix detection of invalid v value - particleman@mollyrocket forum
- 0.95 during header scan, seek to markers in case of padding
- 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
- 0.93 handle jpegtran output; verbose errors
- 0.92 read 4,8,16,24,32-bit BMP files of several formats
- 0.91 output 24-bit Windows 3.0 BMP files
- 0.90 fix a few more warnings; bump version number to approach 1.0
- 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
- 0.60 fix compiling as c++
- 0.59 fix warnings: merge Dave Moore's -Wall fixes
- 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
- 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
- 0.56 fix bug: zlib uncompressed mode len vs. nlen
- 0.55 fix bug: restart_interval not initialized to 0
- 0.54 allow NULL for 'int *comp'
- 0.53 fix bug in png 3->4; speedup png decoding
- 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
- 0.51 obey req_comp requests, 1-component jpegs return as 1-component,
- on 'test' only check type, not whether we support this variant
- 0.50 first released version
+ 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
+ 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
+ 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
+ 2.03 (2015-04-12) extra corruption checking (mmozeiko)
+ stbi_set_flip_vertically_on_load (nguillemot)
+ fix NEON support; fix mingw support
+ 2.02 (2015-01-19) fix incorrect assert, fix warning
+ 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
+ 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
+ 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)
+ progressive JPEG (stb)
+ PGM/PPM support (Ken Miller)
+ STBI_MALLOC,STBI_REALLOC,STBI_FREE
+ GIF bugfix -- seemingly never worked
+ STBI_NO_*, STBI_ONLY_*
+ 1.48 (2014-12-14) fix incorrectly-named assert()
+ 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
+ optimize PNG (ryg)
+ fix bug in interlaced PNG with user-specified channel count (stb)
+ 1.46 (2014-08-26)
+ fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG
+ 1.45 (2014-08-16)
+ fix MSVC-ARM internal compiler error by wrapping malloc
+ 1.44 (2014-08-07)
+ various warning fixes from Ronny Chevalier
+ 1.43 (2014-07-15)
+ fix MSVC-only compiler problem in code changed in 1.42
+ 1.42 (2014-07-09)
+ don't define _CRT_SECURE_NO_WARNINGS (affects user code)
+ fixes to stbi__cleanup_jpeg path
+ added STBI_ASSERT to avoid requiring assert.h
+ 1.41 (2014-06-25)
+ fix search&replace from 1.36 that messed up comments/error messages
+ 1.40 (2014-06-22)
+ fix gcc struct-initialization warning
+ 1.39 (2014-06-15)
+ fix to TGA optimization when req_comp != number of components in TGA;
+ fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
+ add support for BMP version 5 (more ignored fields)
+ 1.38 (2014-06-06)
+ suppress MSVC warnings on integer casts truncating values
+ fix accidental rename of 'skip' field of I/O
+ 1.37 (2014-06-04)
+ remove duplicate typedef
+ 1.36 (2014-06-03)
+ convert to header file single-file library
+ if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
+ 1.35 (2014-05-27)
+ various warnings
+ fix broken STBI_SIMD path
+ fix bug where stbi_load_from_file no longer left file pointer in correct place
+ fix broken non-easy path for 32-bit BMP (possibly never used)
+ TGA optimization by Arseny Kapoulkine
+ 1.34 (unknown)
+ use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
+ 1.33 (2011-07-14)
+ make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
+ 1.32 (2011-07-13)
+ support for "info" function for all supported filetypes (SpartanJ)
+ 1.31 (2011-06-20)
+ a few more leak fixes, bug in PNG handling (SpartanJ)
+ 1.30 (2011-06-11)
+ added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
+ removed deprecated format-specific test/load functions
+ removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
+ error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
+ fix inefficiency in decoding 32-bit BMP (David Woo)
+ 1.29 (2010-08-16)
+ various warning fixes from Aurelien Pocheville
+ 1.28 (2010-08-01)
+ fix bug in GIF palette transparency (SpartanJ)
+ 1.27 (2010-08-01)
+ cast-to-stbi_uc to fix warnings
+ 1.26 (2010-07-24)
+ fix bug in file buffering for PNG reported by SpartanJ
+ 1.25 (2010-07-17)
+ refix trans_data warning (Won Chun)
+ 1.24 (2010-07-12)
+ perf improvements reading from files on platforms with lock-heavy fgetc()
+ minor perf improvements for jpeg
+ deprecated type-specific functions so we'll get feedback if they're needed
+ attempt to fix trans_data warning (Won Chun)
+ 1.23 fixed bug in iPhone support
+ 1.22 (2010-07-10)
+ removed image *writing* support
+ stbi_info support from Jetro Lauha
+ GIF support from Jean-Marc Lienher
+ iPhone PNG-extensions from James Brown
+ warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
+ 1.21 fix use of 'stbi_uc' in header (reported by jon blow)
+ 1.20 added support for Softimage PIC, by Tom Seddon
+ 1.19 bug in interlaced PNG corruption check (found by ryg)
+ 1.18 (2008-08-02)
+ fix a threading bug (local mutable static)
+ 1.17 support interlaced PNG
+ 1.16 major bugfix - stbi__convert_format converted one too many pixels
+ 1.15 initialize some fields for thread safety
+ 1.14 fix threadsafe conversion bug
+ header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
+ 1.13 threadsafe
+ 1.12 const qualifiers in the API
+ 1.11 Support installable IDCT, colorspace conversion routines
+ 1.10 Fixes for 64-bit (don't use "unsigned long")
+ optimized upsampling by Fabian "ryg" Giesen
+ 1.09 Fix format-conversion for PSD code (bad global variables!)
+ 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
+ 1.07 attempt to fix C++ warning/errors again
+ 1.06 attempt to fix C++ warning/errors again
+ 1.05 fix TGA loading to return correct *comp and use good luminance calc
+ 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
+ 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
+ 1.02 support for (subset of) HDR files, float interface for preferred access to them
+ 1.01 fix bug: possible bug in handling right-side up bmps... not sure
+ fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
+ 1.00 interface to zlib that skips zlib header
+ 0.99 correct handling of alpha in palette
+ 0.98 TGA loader by lonesock; dynamically add loaders (untested)
+ 0.97 jpeg errors on too large a file; also catch another malloc failure
+ 0.96 fix detection of invalid v value - particleman@mollyrocket forum
+ 0.95 during header scan, seek to markers in case of padding
+ 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
+ 0.93 handle jpegtran output; verbose errors
+ 0.92 read 4,8,16,24,32-bit BMP files of several formats
+ 0.91 output 24-bit Windows 3.0 BMP files
+ 0.90 fix a few more warnings; bump version number to approach 1.0
+ 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
+ 0.60 fix compiling as c++
+ 0.59 fix warnings: merge Dave Moore's -Wall fixes
+ 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
+ 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
+ 0.56 fix bug: zlib uncompressed mode len vs. nlen
+ 0.55 fix bug: restart_interval not initialized to 0
+ 0.54 allow NULL for 'int *comp'
+ 0.53 fix bug in png 3->4; speedup png decoding
+ 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
+ 0.51 obey req_comp requests, 1-component jpegs return as 1-component,
+ on 'test' only check type, not whether we support this variant
+ 0.50 (2006-11-19)
+ first released version
*/
diff --git a/3rdparty/bgfx/3rdparty/stb/stb_truetype.h b/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
index 3c5d6f304ed..98f1319e844 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
+++ b/3rdparty/bgfx/3rdparty/stb/stb_truetype.h
@@ -1,8 +1,11 @@
-// [ImGui] this is a slightly modified version of stb_truetype.h 1.02
-// [ImGui] we added stbtt_PackFontRangesGatherRects() and stbtt_PackFontRangesRenderIntoRects() and modified stbtt_PackBegin()
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wshadow"
+#elif defined(_MSC_VER)
+# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration
+#endif
-// stb_truetype.h - v1.02 - public domain
-// authored from 2009-2014 by Sean Barrett / RAD Game Tools
+// stb_truetype.h - v1.07 - public domain
+// authored from 2009-2015 by Sean Barrett / RAD Game Tools
//
// This library processes TrueType files:
// parse files
@@ -37,46 +40,37 @@
// Johan Duparc
// Hou Qiming
// Fabian "ryg" Giesen
+// Martins Mozeiko
+// Cap Petschulat
+// Omar Cornut
+// github:aloucks
+// Peter LaValle
+// Giumo X. Clanjor
//
// Misc other:
// Ryan Gordon
//
// VERSION HISTORY
//
-// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++
-// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match
-// non-oversampled; STBTT_POINT_SIZE for packed case only
-// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling
-// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg)
-// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID
-// 0.8b (2014-07-07) fix a warning
-// 0.8 (2014-05-25) fix a few more warnings
-// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back
-// 0.6c (2012-07-24) improve documentation
-// 0.6b (2012-07-20) fix a few more warnings
-// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels,
-// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty
-// 0.5 (2011-12-09) bugfixes:
-// subpixel glyph renderer computed wrong bounding box
-// first vertex of shape can be off-curve (FreeSans)
-// 0.4b (2011-12-03) fixed an error in the font baking example
-// 0.4 (2011-12-01) kerning, subpixel rendering (tor)
-// bugfixes for:
-// codepoint-to-glyph conversion using table fmt=12
-// codepoint-to-glyph conversion using table fmt=4
-// stbtt_GetBakedQuad with non-square texture (Zer)
-// updated Hello World! sample to use kerning and subpixel
-// fixed some warnings
-// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM)
-// userdata, malloc-from-userdata, non-zero fill (stb)
-// 0.2 (2009-03-11) Fix unsigned/signed char warnings
-// 0.1 (2009-03-09) First public release
+// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
+// variant PackFontRanges to pack and render in separate phases;
+// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
+// fixed an assert() bug in the new rasterizer
+// replace assert() with STBTT_assert() in new rasterizer
+// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine)
+// also more precise AA rasterizer, except if shapes overlap
+// remove need for STBTT_sort
+// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC
+// 1.04 (2015-04-15) typo in example
+// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes
+//
+// Full history can be found at the end of this file.
//
// LICENSE
//
// This software is in the public domain. Where that dedication is not
-// recognized, you are granted a perpetual, irrevokable license to copy
-// and modify this file as you see fit.
+// recognized, you are granted a perpetual, irrevocable license to copy,
+// distribute, and modify this file as you see fit.
//
// USAGE
//
@@ -86,6 +80,9 @@
// before the #include of this file. This expands out the actual
// implementation into that C/C++ file.
//
+// To make the implementation private to the file that generates the implementation,
+// #define STBTT_STATIC
+//
// Simple 3D API (don't ship this, but it's fine for tools and quick start)
// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture
// stbtt_GetBakedQuad() -- compute quad to draw for a given char
@@ -112,6 +109,15 @@
// stbtt_GetFontVMetrics()
// stbtt_GetCodepointKernAdvance()
//
+// Starting with version 1.06, the rasterizer was replaced with a new,
+// faster and generally-more-precise rasterizer. The new rasterizer more
+// accurately measures pixel coverage for anti-aliasing, except in the case
+// where multiple shapes overlap, in which case it overestimates the AA pixel
+// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If
+// this turns out to be a problem, you can re-enable the old rasterizer with
+// #define STBTT_RASTERIZER_VERSION 1
+// which will incur about a 15% speed hit.
+//
// ADDITIONAL DOCUMENTATION
//
// Immediately after this block comment are a series of sample programs.
@@ -211,7 +217,15 @@
// Baked bitmap interface 70 LOC /
// Font name matching & access 150 LOC ---- 150
// C runtime library abstraction 60 LOC ---- 60
-
+//
+//
+// PERFORMANCE MEASUREMENTS FOR 1.06:
+//
+// 32-bit 64-bit
+// Previous release: 8.83 s 7.68 s
+// Pool allocations: 7.72 s 6.34 s
+// Inline sort : 6.54 s 5.65 s
+// New rasterizer : 5.63 s 5.00 s
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
@@ -225,16 +239,16 @@
#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation
#include "stb_truetype.h"
-char ttf_buffer[1<<20];
+unsigned char ttf_buffer[1<<20];
unsigned char temp_bitmap[512*512];
stbtt_bakedchar cdata[96]; // ASCII 32..126 is 95 glyphs
-GLstbtt_uint ftex;
+GLuint ftex;
void my_stbtt_initfont(void)
{
fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb"));
- stbtt_BakeFontBitmap(data,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits!
+ stbtt_BakeFontBitmap(ttf_buffer,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits!
// can free ttf_buffer at this point
glGenTextures(1, &ftex);
glBindTexture(GL_TEXTURE_2D, ftex);
@@ -246,6 +260,7 @@ void my_stbtt_initfont(void)
void my_stbtt_print(float x, float y, char *text)
{
// assume orthographic projection with units = screen pixels, origin at top left
+ glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, ftex);
glBegin(GL_QUADS);
while (*text) {
@@ -321,7 +336,7 @@ int main(int arg, char **argv)
stbtt_fontinfo font;
int i,j,ascent,baseline,ch=0;
float scale, xpos=2; // leave a little padding in case the character extends left
- char *text = "Heljo World!";
+ char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness
fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb"));
stbtt_InitFont(&font, buffer, 0);
@@ -379,18 +394,6 @@ int main(int arg, char **argv)
typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1];
typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1];
- #ifdef STBTT_STATIC
- #define STBTT_DEF static
- #else
- #define STBTT_DEF extern
- #endif
-
- // #define your own STBTT_sort() to override this to avoid qsort
- #ifndef STBTT_sort
- #include <stdlib.h>
- #define STBTT_sort(data,num_items,item_size,compare_func) qsort(data,num_items,item_size,compare_func)
- #endif
-
// #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h
#ifndef STBTT_ifloor
#include <math.h>
@@ -437,6 +440,12 @@ int main(int arg, char **argv)
#ifndef __STB_INCLUDE_STB_TRUETYPE_H__
#define __STB_INCLUDE_STB_TRUETYPE_H__
+#ifdef STBTT_STATIC
+#define STBTT_DEF static
+#else
+#define STBTT_DEF extern
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -512,7 +521,7 @@ STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, i
// Future calls using this context will pack characters into the bitmap passed
// in here: a 1-channel bitmap that is weight x height. stride_in_bytes is
// the distance from one row to the next (or 0 to mean they are packed tightly
-// together). "padding" is // the amount of padding to leave between each
+// together). "padding" is the amount of padding to leave between each
// character (normally you want '1' for bitmaps you'll use as textures with
// bilinear filtering).
//
@@ -541,34 +550,34 @@ STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontd
typedef struct
{
float font_size;
- int first_unicode_char_in_range;
- int num_chars_in_range;
+ int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint
+ int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints
+ int num_chars;
stbtt_packedchar *chardata_for_range; // output
+ unsigned char h_oversample, v_oversample; // don't set these, they're used internally
} stbtt_pack_range;
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges);
// Creates character bitmaps from multiple ranges of characters stored in
// ranges. This will usually create a better-packed bitmap than multiple
-// calls to stbtt_PackFontRange.
-
-STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
-STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
-// Those functions are called by stbtt_PackFontRanges(). If you want to
-// pack multiple fonts or custom data into a same texture, you may copy
-// the contents of stbtt_PackFontRanges() and create a custom version
-// using those functions.
+// calls to stbtt_PackFontRange. Note that you can call this multiple
+// times within a single PackBegin/PackEnd.
STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample);
// Oversampling a font increases the quality by allowing higher-quality subpixel
// positioning, and is especially valuable at smaller text sizes.
//
// This function sets the amount of oversampling for all following calls to
-// stbtt_PackFontRange(s). The default (no oversampling) is achieved by
-// h_oversample=1, v_oversample=1. The total number of pixels required is
+// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given
+// pack context. The default (no oversampling) is achieved by h_oversample=1
+// and v_oversample=1. The total number of pixels required is
// h_oversample*v_oversample larger than the default; for example, 2x2
// oversampling requires 4x the storage of 1x1. For best results, render
// oversampled textures with bilinear filtering. Look at the readme in
// stb/tests/oversample for information about oversampled fonts
+//
+// To use with PackFontRangesGather etc., you must set it before calls
+// call to PackFontRangesGatherRects.
STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, // same data as above
int char_index, // character to display
@@ -576,6 +585,19 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph,
stbtt_aligned_quad *q, // output: quad to draw
int align_to_integer);
+STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
+STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects);
+STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects);
+// Calling these functions in sequence is roughly equivalent to calling
+// stbtt_PackFontRanges(). If you more control over the packing of multiple
+// fonts, or if you want to pack custom data into a font texture, take a look
+// at the source to of stbtt_PackFontRanges() and create a custom version
+// using these functions, e.g. call GatherRects multiple times,
+// building up a single array of rects, then call PackRects once,
+// then call RenderIntoRects repeatedly. This may result in a
+// better packing than calling PackFontRanges multiple times
+// (or it may not).
+
// this is an opaque structure that you shouldn't mess with which holds
// all the context needed from PackBegin to PackEnd.
struct stbtt_pack_context {
@@ -901,8 +923,16 @@ enum { // languageID for STBTT_PLATFORM_ID_MAC
#define STBTT_MAX_OVERSAMPLE 8
#endif
+#if STBTT_MAX_OVERSAMPLE > 255
+#error "STBTT_MAX_OVERSAMPLE cannot be > 255"
+#endif
+
typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1];
+#ifndef STBTT_RASTERIZER_VERSION
+#define STBTT_RASTERIZER_VERSION 2
+#endif
+
//////////////////////////////////////////////////////////////////////////
//
// accessors to parse data from file
@@ -971,7 +1001,7 @@ STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection,
stbtt_int32 n = ttLONG(font_collection+8);
if (index >= n)
return -1;
- return ttULONG(font_collection+12+index*14);
+ return ttULONG(font_collection+12+index*4);
}
}
return -1;
@@ -1059,7 +1089,6 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1;
stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10);
stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1;
- stbtt_uint16 item, offset, start, end;
// do a binary search of the segments
stbtt_uint32 endCount = index_map + 14;
@@ -1076,8 +1105,8 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
// now decrement to bias correctly to find smallest
search -= 2;
while (entrySelector) {
+ stbtt_uint16 end;
searchRange >>= 1;
- start = ttUSHORT(data + search + searchRange*2 + segcount*2 + 2);
end = ttUSHORT(data + search + searchRange*2);
if (unicode_codepoint > end)
search += searchRange*2;
@@ -1085,19 +1114,21 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep
}
search += 2;
- item = (stbtt_uint16) ((search - endCount) >> 1);
+ {
+ stbtt_uint16 offset, start;
+ stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1);
- STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item));
- start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
- end = ttUSHORT(data + index_map + 14 + 2 + 2*item);
- if (unicode_codepoint < start)
- return 0;
+ STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item));
+ start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
+ if (unicode_codepoint < start)
+ return 0;
- offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
- if (offset == 0)
- return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item));
+ offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
+ if (offset == 0)
+ return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item));
- return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item);
+ return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item);
+ }
} else if (format == 12 || format == 13) {
stbtt_uint32 ngroups = ttULONG(data+index_map+12);
stbtt_int32 low,high;
@@ -1550,42 +1581,129 @@ STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codep
stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1);
}
+//////////////////////////////////////////////////////////////////////////////
+//
+// Rasterizer
+
+typedef struct stbtt__hheap_chunk
+{
+ struct stbtt__hheap_chunk *next;
+} stbtt__hheap_chunk;
+
+typedef struct stbtt__hheap
+{
+ struct stbtt__hheap_chunk *head;
+ void *first_free;
+ int num_remaining_in_head_chunk;
+} stbtt__hheap;
+
+static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata)
+{
+ if (hh->first_free) {
+ void *p = hh->first_free;
+ hh->first_free = * (void **) p;
+ return p;
+ } else {
+ if (hh->num_remaining_in_head_chunk == 0) {
+ int count = (size < 32 ? 2000 : size < 128 ? 800 : 100);
+ stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata);
+ if (c == NULL)
+ return NULL;
+ c->next = hh->head;
+ hh->head = c;
+ hh->num_remaining_in_head_chunk = count;
+ }
+ --hh->num_remaining_in_head_chunk;
+ return (char *) (hh->head) + size * hh->num_remaining_in_head_chunk;
+ }
+}
+
+static void stbtt__hheap_free(stbtt__hheap *hh, void *p)
+{
+ *(void **) p = hh->first_free;
+ hh->first_free = p;
+}
+
+static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata)
+{
+ stbtt__hheap_chunk *c = hh->head;
+ while (c) {
+ stbtt__hheap_chunk *n = c->next;
+ STBTT_free(c, userdata);
+ c = n;
+ }
+}
+
typedef struct stbtt__edge {
float x0,y0, x1,y1;
int invert;
} stbtt__edge;
+
typedef struct stbtt__active_edge
{
+ struct stbtt__active_edge *next;
+ #if STBTT_RASTERIZER_VERSION==1
int x,dx;
float ey;
- struct stbtt__active_edge *next;
- int valid;
+ int direction;
+ #elif STBTT_RASTERIZER_VERSION==2
+ float fx,fdx,fdy;
+ float direction;
+ float sy;
+ float ey;
+ #else
+ #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+ #endif
} stbtt__active_edge;
-#define FIXSHIFT 10
-#define FIX (1 << FIXSHIFT)
-#define FIXMASK (FIX-1)
+#if STBTT_RASTERIZER_VERSION == 1
+#define STBTT_FIXSHIFT 10
+#define STBTT_FIX (1 << STBTT_FIXSHIFT)
+#define STBTT_FIXMASK (STBTT_FIX-1)
-static stbtt__active_edge *new_active(stbtt__edge *e, int off_x, float start_point, void *userdata)
+static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata)
{
- stbtt__active_edge *z = (stbtt__active_edge *) STBTT_malloc(sizeof(*z), userdata); // @TODO: make a pool of these!!!
+ stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
- STBTT_assert(e->y0 <= start_point);
if (!z) return z;
- // round dx down to avoid going too far
+
+ // round dx down to avoid overshooting
if (dxdy < 0)
- z->dx = -STBTT_ifloor(FIX * -dxdy);
+ z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy);
else
- z->dx = STBTT_ifloor(FIX * dxdy);
- z->x = STBTT_ifloor(FIX * (e->x0 + dxdy * (start_point - e->y0)));
- z->x -= off_x * FIX;
+ z->dx = STBTT_ifloor(STBTT_FIX * dxdy);
+
+ z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount
+ z->x -= off_x * STBTT_FIX;
+
z->ey = e->y1;
z->next = 0;
- z->valid = e->invert ? 1 : -1;
+ z->direction = e->invert ? 1 : -1;
return z;
}
+#elif STBTT_RASTERIZER_VERSION == 2
+static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata)
+{
+ stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata);
+ float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
+ //STBTT_assert(e->y0 <= start_point);
+ if (!z) return z;
+ z->fdx = dxdy;
+ z->fdy = (1/dxdy);
+ z->fx = e->x0 + dxdy * (start_point - e->y0);
+ z->fx -= off_x;
+ z->direction = e->invert ? 1.0f : -1.0f;
+ z->sy = e->y0;
+ z->ey = e->y1;
+ z->next = 0;
+ return z;
+}
+#else
+#error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+#endif
+#if STBTT_RASTERIZER_VERSION == 1
// note: this routine clips fills that extend off the edges... ideally this
// wouldn't happen, but it could happen if the truetype glyph bounding boxes
// are wrong, or if the user supplies a too-small bitmap
@@ -1597,26 +1715,26 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac
while (e) {
if (w == 0) {
// if we're currently at zero, we need to record the edge start point
- x0 = e->x; w += e->valid;
+ x0 = e->x; w += e->direction;
} else {
- int x1 = e->x; w += e->valid;
+ int x1 = e->x; w += e->direction;
// if we went to zero, we need to draw
if (w == 0) {
- int i = x0 >> FIXSHIFT;
- int j = x1 >> FIXSHIFT;
+ int i = x0 >> STBTT_FIXSHIFT;
+ int j = x1 >> STBTT_FIXSHIFT;
if (i < len && j >= 0) {
if (i == j) {
// x0,x1 are the same pixel, so compute combined coverage
- scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> FIXSHIFT);
+ scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT);
} else {
if (i >= 0) // add antialiasing for x0
- scanline[i] = scanline[i] + (stbtt_uint8) (((FIX - (x0 & FIXMASK)) * max_weight) >> FIXSHIFT);
+ scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT);
else
i = -1; // clip
if (j < len) // add antialiasing for x1
- scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & FIXMASK) * max_weight) >> FIXSHIFT);
+ scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT);
else
j = len; // clip
@@ -1633,6 +1751,7 @@ static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__ac
static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
{
+ stbtt__hheap hh = { 0 };
stbtt__active_edge *active = NULL;
int y,j=0;
int max_weight = (255 / vsubsample); // weight per vertical scanline
@@ -1660,9 +1779,9 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e,
stbtt__active_edge * z = *step;
if (z->ey <= scan_y) {
*step = z->next; // delete from list
- STBTT_assert(z->valid);
- z->valid = 0;
- STBTT_free(z, userdata);
+ STBTT_assert(z->direction);
+ z->direction = 0;
+ stbtt__hheap_free(&hh, z);
} else {
z->x += z->dx; // advance to position for current scanline
step = &((*step)->next); // advance through list
@@ -1691,7 +1810,7 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e,
// insert all edges that start before the center of this scanline -- omit ones that also end on this scanline
while (e->y0 <= scan_y) {
if (e->y1 > scan_y) {
- stbtt__active_edge *z = new_active(e, off_x, scan_y, userdata);
+ stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata);
// find insertion point
if (active == NULL)
active = z;
@@ -1722,24 +1841,392 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e,
++j;
}
- while (active) {
- stbtt__active_edge *z = active;
- active = active->next;
- STBTT_free(z, userdata);
+ stbtt__hheap_cleanup(&hh, userdata);
+
+ if (scanline != scanline_data)
+ STBTT_free(scanline, userdata);
+}
+
+#elif STBTT_RASTERIZER_VERSION == 2
+
+// the edge passed in here does not cross the vertical line at x or the vertical line at x+1
+// (i.e. it has already been clipped to those)
+static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1)
+{
+ if (y0 == y1) return;
+ STBTT_assert(y0 < y1);
+ STBTT_assert(e->sy <= e->ey);
+ if (y0 > e->ey) return;
+ if (y1 < e->sy) return;
+ if (y0 < e->sy) {
+ x0 += (x1-x0) * (e->sy - y0) / (y1-y0);
+ y0 = e->sy;
+ }
+ if (y1 > e->ey) {
+ x1 += (x1-x0) * (e->ey - y1) / (y1-y0);
+ y1 = e->ey;
}
+ if (x0 == x)
+ STBTT_assert(x1 <= x+1);
+ else if (x0 == x+1)
+ STBTT_assert(x1 >= x);
+ else if (x0 <= x)
+ STBTT_assert(x1 <= x);
+ else if (x0 >= x+1)
+ STBTT_assert(x1 >= x+1);
+ else
+ STBTT_assert(x1 >= x && x1 <= x+1);
+
+ if (x0 <= x && x1 <= x)
+ scanline[x] += e->direction * (y1-y0);
+ else if (x0 >= x+1 && x1 >= x+1)
+ ;
+ else {
+ STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1);
+ scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position
+ }
+}
+
+static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top)
+{
+ float y_bottom = y_top+1;
+
+ while (e) {
+ // brute force every pixel
+
+ // compute intersection points with top & bottom
+ STBTT_assert(e->ey >= y_top);
+
+ if (e->fdx == 0) {
+ float x0 = e->fx;
+ if (x0 < len) {
+ if (x0 >= 0) {
+ stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom);
+ stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom);
+ } else {
+ stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom);
+ }
+ }
+ } else {
+ float x0 = e->fx;
+ float dx = e->fdx;
+ float xb = x0 + dx;
+ float x_top, x_bottom;
+ float y0,y1;
+ float dy = e->fdy;
+ STBTT_assert(e->sy <= y_bottom && e->ey >= y_top);
+
+ // compute endpoints of line segment clipped to this scanline (if the
+ // line segment starts on this scanline. x0 is the intersection of the
+ // line with y_top, but that may be off the line segment.
+ if (e->sy > y_top) {
+ x_top = x0 + dx * (e->sy - y_top);
+ y0 = e->sy;
+ } else {
+ x_top = x0;
+ y0 = y_top;
+ }
+ if (e->ey < y_bottom) {
+ x_bottom = x0 + dx * (e->ey - y_top);
+ y1 = e->ey;
+ } else {
+ x_bottom = xb;
+ y1 = y_bottom;
+ }
+
+ if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) {
+ // from here on, we don't have to range check x values
+
+ if ((int) x_top == (int) x_bottom) {
+ float height;
+ // simple case, only spans one pixel
+ int x = (int) x_top;
+ height = y1 - y0;
+ STBTT_assert(x >= 0 && x < len);
+ scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height;
+ scanline_fill[x] += e->direction * height; // everything right of this pixel is filled
+ } else {
+ int x,x1,x2;
+ float y_crossing, step, sign, area;
+ // covers 2+ pixels
+ if (x_top > x_bottom) {
+ // flip scanline vertically; signed area is the same
+ float t;
+ y0 = y_bottom - (y0 - y_top);
+ y1 = y_bottom - (y1 - y_top);
+ t = y0, y0 = y1, y1 = t;
+ t = x_bottom, x_bottom = x_top, x_top = t;
+ dx = -dx;
+ dy = -dy;
+ t = x0, x0 = xb, xb = t;
+ }
+
+ x1 = (int) x_top;
+ x2 = (int) x_bottom;
+ // compute intersection with y axis at x1+1
+ y_crossing = (x1+1 - x0) * dy + y_top;
+
+ sign = e->direction;
+ // area of the rectangle covered from y0..y_crossing
+ area = sign * (y_crossing-y0);
+ // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing)
+ scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2);
+
+ step = sign * dy;
+ for (x = x1+1; x < x2; ++x) {
+ scanline[x] += area + step/2;
+ area += step;
+ }
+ y_crossing += dy * (x2 - (x1+1));
+
+ STBTT_assert(fabs(area) <= 1.01f);
+
+ scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (y1-y_crossing);
+
+ scanline_fill[x2] += sign * (y1-y0);
+ }
+ } else {
+ // if edge goes outside of box we're drawing, we require
+ // clipping logic. since this does not match the intended use
+ // of this library, we use a different, very slow brute
+ // force implementation
+ int x;
+ for (x=0; x < len; ++x) {
+ // cases:
+ //
+ // there can be up to two intersections with the pixel. any intersection
+ // with left or right edges can be handled by splitting into two (or three)
+ // regions. intersections with top & bottom do not necessitate case-wise logic.
+ //
+ // the old way of doing this found the intersections with the left & right edges,
+ // then used some simple logic to produce up to three segments in sorted order
+ // from top-to-bottom. however, this had a problem: if an x edge was epsilon
+ // across the x border, then the corresponding y position might not be distinct
+ // from the other y segment, and it might ignored as an empty segment. to avoid
+ // that, we need to explicitly produce segments based on x positions.
+
+ // rename variables to clear pairs
+ float y0 = y_top;
+ float x1 = (float) (x);
+ float x2 = (float) (x+1);
+ float x3 = xb;
+ float y3 = y_bottom;
+ float y1,y2;
+
+ // x = e->x + e->dx * (y-y_top)
+ // (y-y_top) = (x - e->x) / e->dx
+ // y = (x - e->x) / e->dx + y_top
+ y1 = (x - x0) / dx + y_top;
+ y2 = (x+1 - x0) / dx + y_top;
+
+ if (x0 < x1 && x3 > x2) { // three segments descending down-right
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+ stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2);
+ stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+ } else if (x3 < x1 && x0 > x2) { // three segments descending down-left
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+ stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1);
+ stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+ } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+ stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+ } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
+ stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
+ } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+ stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+ } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
+ stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
+ } else { // one segment
+ stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3);
+ }
+ }
+ }
+ }
+ e = e->next;
+ }
+}
+
+// directly AA rasterize edges w/o supersampling
+static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
+{
+ (void)vsubsample;
+ stbtt__hheap hh;
+ memset(&hh, 0, sizeof(hh));
+ stbtt__active_edge *active = NULL;
+ int y,j=0, i;
+ float scanline_data[129], *scanline, *scanline2;
+
+ if (result->w > 64)
+ scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata);
+ else
+ scanline = scanline_data;
+
+ scanline2 = scanline + result->w;
+
+ y = off_y;
+ e[n].y0 = (float) (off_y + result->h) + 1;
+
+ while (j < result->h) {
+ // find center of pixel for this scanline
+ float scan_y_top = y + 0.0f;
+ float scan_y_bottom = y + 1.0f;
+ stbtt__active_edge **step = &active;
+
+ STBTT_memset(scanline , 0, result->w*sizeof(scanline[0]));
+ STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0]));
+
+ // update all active edges;
+ // remove all active edges that terminate before the top of this scanline
+ while (*step) {
+ stbtt__active_edge * z = *step;
+ if (z->ey <= scan_y_top) {
+ *step = z->next; // delete from list
+ STBTT_assert(z->direction);
+ z->direction = 0;
+ stbtt__hheap_free(&hh, z);
+ } else {
+ step = &((*step)->next); // advance through list
+ }
+ }
+
+ // insert all edges that start before the bottom of this scanline
+ while (e->y0 <= scan_y_bottom) {
+ stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata);
+ STBTT_assert(z->ey >= scan_y_top);
+ // insert at front
+ z->next = active;
+ active = z;
+ ++e;
+ }
+
+ // now process all active edges
+ if (active)
+ stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top);
+
+ {
+ float sum = 0;
+ for (i=0; i < result->w; ++i) {
+ float k;
+ int m;
+ sum += scanline2[i];
+ k = scanline[i] + sum;
+ k = (float) fabs(k)*255 + 0.5f;
+ m = (int) k;
+ if (m > 255) m = 255;
+ result->pixels[j*result->stride + i] = (unsigned char) m;
+ }
+ }
+ // advance all the edges
+ step = &active;
+ while (*step) {
+ stbtt__active_edge *z = *step;
+ z->fx += z->fdx; // advance to position for current scanline
+ step = &((*step)->next); // advance through list
+ }
+
+ ++y;
+ ++j;
+ }
+
+ stbtt__hheap_cleanup(&hh, userdata);
+
if (scanline != scanline_data)
STBTT_free(scanline, userdata);
}
+#else
+#error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+#endif
+
+#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0)
-static int stbtt__edge_compare(const void *p, const void *q)
+static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n)
{
- stbtt__edge *a = (stbtt__edge *) p;
- stbtt__edge *b = (stbtt__edge *) q;
+ int i,j;
+ for (i=1; i < n; ++i) {
+ stbtt__edge t = p[i], *a = &t;
+ j = i;
+ while (j > 0) {
+ stbtt__edge *b = &p[j-1];
+ int c = STBTT__COMPARE(a,b);
+ if (!c) break;
+ p[j] = p[j-1];
+ --j;
+ }
+ if (i != j)
+ p[j] = t;
+ }
+}
- if (a->y0 < b->y0) return -1;
- if (a->y0 > b->y0) return 1;
- return 0;
+static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
+{
+ /* threshhold for transitioning to insertion sort */
+ while (n > 12) {
+ stbtt__edge t;
+ int c01,c12,c,m,i,j;
+
+ /* compute median of three */
+ m = n >> 1;
+ c01 = STBTT__COMPARE(&p[0],&p[m]);
+ c12 = STBTT__COMPARE(&p[m],&p[n-1]);
+ /* if 0 >= mid >= end, or 0 < mid < end, then use mid */
+ if (c01 != c12) {
+ /* otherwise, we'll need to swap something else to middle */
+ int z;
+ c = STBTT__COMPARE(&p[0],&p[n-1]);
+ /* 0>mid && mid<n: 0>n => n; 0<n => 0 */
+ /* 0<mid && mid>n: 0>n => 0; 0<n => n */
+ z = (c == c12) ? 0 : n-1;
+ t = p[z];
+ p[z] = p[m];
+ p[m] = t;
+ }
+ /* now p[m] is the median-of-three */
+ /* swap it to the beginning so it won't move around */
+ t = p[0];
+ p[0] = p[m];
+ p[m] = t;
+
+ /* partition loop */
+ i=1;
+ j=n-1;
+ for(;;) {
+ /* handling of equality is crucial here */
+ /* for sentinels & efficiency with duplicates */
+ for (;;++i) {
+ if (!STBTT__COMPARE(&p[i], &p[0])) break;
+ }
+ for (;;--j) {
+ if (!STBTT__COMPARE(&p[0], &p[j])) break;
+ }
+ /* make sure we haven't crossed */
+ if (i >= j) break;
+ t = p[i];
+ p[i] = p[j];
+ p[j] = t;
+
+ ++i;
+ --j;
+ }
+ /* recurse on smaller side, iterate on larger */
+ if (j < (n-i)) {
+ stbtt__sort_edges_quicksort(p,j);
+ p = p+i;
+ n = n-i;
+ } else {
+ stbtt__sort_edges_quicksort(p+i, n-i);
+ n = j;
+ }
+ }
+}
+
+static void stbtt__sort_edges(stbtt__edge *p, int n)
+{
+ stbtt__sort_edges_quicksort(p, n);
+ stbtt__sort_edges_ins_sort(p, n);
}
typedef struct
@@ -1752,7 +2239,13 @@ static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcou
float y_scale_inv = invert ? -scale_y : scale_y;
stbtt__edge *e;
int n,i,j,k,m;
+#if STBTT_RASTERIZER_VERSION == 1
int vsubsample = result->h < 8 ? 15 : 5;
+#elif STBTT_RASTERIZER_VERSION == 2
+ int vsubsample = 1;
+#else
+ #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
+#endif
// vsubsample should divide 255 evenly; otherwise we won't reach full opacity
// now we have to blow out the windings into explicit edge lists
@@ -1789,7 +2282,8 @@ static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcou
}
// now sort the edges by their highest point (should snap to integer, and then by x)
- STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare);
+ //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare);
+ stbtt__sort_edges(e, n);
// now, traverse the scanlines and find the intersections on each scanline, use xor winding rule
stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata);
@@ -2054,8 +2548,8 @@ STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int
float d3d_bias = opengl_fillrule ? 0 : -0.5f;
float ipw = 1.0f / pw, iph = 1.0f / ph;
stbtt_bakedchar *b = chardata + char_index;
- int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5);
- int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5);
+ int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f);
+ int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f);
q->x0 = round_x + d3d_bias;
q->y0 = round_y + d3d_bias;
@@ -2209,7 +2703,7 @@ static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_i
for (j=0; j < h; ++j) {
int i;
unsigned int total;
- memset(buffer, 0, kernel_width);
+ STBTT_memset(buffer, 0, kernel_width);
total = 0;
@@ -2236,6 +2730,13 @@ static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_i
pixels[i] = (unsigned char) (total / 4);
}
break;
+ case 5:
+ for (i=0; i <= safe_w; ++i) {
+ total += pixels[i] - buffer[i & STBTT__OVER_MASK];
+ buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
+ pixels[i] = (unsigned char) (total / 5);
+ }
+ break;
default:
for (i=0; i <= safe_w; ++i) {
total += pixels[i] - buffer[i & STBTT__OVER_MASK];
@@ -2263,7 +2764,7 @@ static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_i
for (j=0; j < w; ++j) {
int i;
unsigned int total;
- memset(buffer, 0, kernel_width);
+ STBTT_memset(buffer, 0, kernel_width);
total = 0;
@@ -2290,6 +2791,13 @@ static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_i
pixels[i*stride_in_bytes] = (unsigned char) (total / 4);
}
break;
+ case 5:
+ for (i=0; i <= safe_h; ++i) {
+ total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
+ buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes];
+ pixels[i*stride_in_bytes] = (unsigned char) (total / 5);
+ }
+ break;
default:
for (i=0; i <= safe_h; ++i) {
total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK];
@@ -2330,21 +2838,20 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fon
for (i=0; i < num_ranges; ++i) {
float fh = ranges[i].font_size;
float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh);
- for (j=0; j < ranges[i].num_chars_in_range; ++j) {
+ ranges[i].h_oversample = (unsigned char) spc->h_oversample;
+ ranges[i].v_oversample = (unsigned char) spc->v_oversample;
+ for (j=0; j < ranges[i].num_chars; ++j) {
int x0,y0,x1,y1;
- int glyph = stbtt_FindGlyphIndex(info,ranges[i].first_unicode_char_in_range + j);
- if (glyph) {
- stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
- scale * spc->h_oversample,
- scale * spc->v_oversample,
- 0,0,
- &x0,&y0,&x1,&y1);
- rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
- rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
- } else {
- rects[k].w = rects[k].h = 1;
- }
- ++k;
+ int codepoint = ranges[i].first_unicode_codepoint_in_range ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
+ int glyph = stbtt_FindGlyphIndex(info, codepoint);
+ stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
+ scale * spc->h_oversample,
+ scale * spc->v_oversample,
+ 0,0,
+ &x0,&y0,&x1,&y1);
+ rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
+ rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
+ ++k;
}
}
@@ -2354,22 +2861,30 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fon
// rects array must be big enough to accommodate all characters in the given ranges
STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
{
- float recip_h = 1.0f / spc->h_oversample;
- float recip_v = 1.0f / spc->v_oversample;
- float sub_x = stbtt__oversample_shift(spc->h_oversample);
- float sub_y = stbtt__oversample_shift(spc->v_oversample);
int i,j,k, return_value = 1;
+ // save current values
+ int old_h_over = spc->h_oversample;
+ int old_v_over = spc->v_oversample;
+
k = 0;
for (i=0; i < num_ranges; ++i) {
float fh = ranges[i].font_size;
float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh);
- for (j=0; j < ranges[i].num_chars_in_range; ++j) {
+ float recip_h,recip_v,sub_x,sub_y;
+ spc->h_oversample = ranges[i].h_oversample;
+ spc->v_oversample = ranges[i].v_oversample;
+ recip_h = 1.0f / spc->h_oversample;
+ recip_v = 1.0f / spc->v_oversample;
+ sub_x = stbtt__oversample_shift(spc->h_oversample);
+ sub_y = stbtt__oversample_shift(spc->v_oversample);
+ for (j=0; j < ranges[i].num_chars; ++j) {
stbrp_rect *r = &rects[k];
if (r->was_packed) {
stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];
int advance, lsb, x0,y0,x1,y1;
- int glyph = stbtt_FindGlyphIndex(info, ranges[i].first_unicode_char_in_range + j);
+ int codepoint = ranges[i].first_unicode_codepoint_in_range ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
+ int glyph = stbtt_FindGlyphIndex(info, codepoint);
stbrp_coord pad = (stbrp_coord) spc->padding;
// pad on left and top
@@ -2419,19 +2934,28 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt
}
}
+ // restore original values
+ spc->h_oversample = old_h_over;
+ spc->v_oversample = old_v_over;
+
return return_value;
}
+STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects)
+{
+ stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects);
+}
+
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
{
stbtt_fontinfo info;
int i,j,n, return_value = 1;
- stbrp_context *context = (stbrp_context *) spc->pack_info;
+ //stbrp_context *context = (stbrp_context *) spc->pack_info;
stbrp_rect *rects;
// flag all characters as NOT packed
for (i=0; i < num_ranges; ++i)
- for (j=0; j < ranges[i].num_chars_in_range; ++j)
+ for (j=0; j < ranges[i].num_chars; ++j)
ranges[i].chardata_for_range[j].x0 =
ranges[i].chardata_for_range[j].y0 =
ranges[i].chardata_for_range[j].x1 =
@@ -2439,7 +2963,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd
n = 0;
for (i=0; i < num_ranges; ++i)
- n += ranges[i].num_chars_in_range;
+ n += ranges[i].num_chars;
rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
if (rects == NULL)
@@ -2449,19 +2973,21 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontd
n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);
- stbrp_pack_rects(context, rects, n);
+ stbtt_PackFontRangesPackRects(spc, rects, n);
return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);
+ STBTT_free(rects, spc->user_allocator_context);
return return_value;
}
STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, float font_size,
- int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range)
+ int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range)
{
stbtt_pack_range range;
- range.first_unicode_char_in_range = first_unicode_char_in_range;
- range.num_chars_in_range = num_chars_in_range;
+ range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range;
+ range.array_of_unicode_codepoints = NULL;
+ range.num_chars = num_chars_in_range;
range.chardata_for_range = chardata_for_range;
range.font_size = font_size;
return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);
@@ -2473,8 +2999,8 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, i
stbtt_packedchar *b = chardata + char_index;
if (align_to_integer) {
- float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5);
- float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5);
+ float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f);
+ float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f);
q->x0 = x;
q->y0 = y;
q->x1 = x + b->xoff2 - b->xoff;
@@ -2656,3 +3182,47 @@ STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const
}
#endif // STB_TRUETYPE_IMPLEMENTATION
+
+
+// FULL VERSION HISTORY
+//
+// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;
+// allow PackFontRanges to pack and render in separate phases;
+// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
+// fixed an assert() bug in the new rasterizer
+// replace assert() with STBTT_assert() in new rasterizer
+// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine)
+// also more precise AA rasterizer, except if shapes overlap
+// remove need for STBTT_sort
+// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC
+// 1.04 (2015-04-15) typo in example
+// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes
+// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++
+// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match
+// non-oversampled; STBTT_POINT_SIZE for packed case only
+// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling
+// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg)
+// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID
+// 0.8b (2014-07-07) fix a warning
+// 0.8 (2014-05-25) fix a few more warnings
+// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back
+// 0.6c (2012-07-24) improve documentation
+// 0.6b (2012-07-20) fix a few more warnings
+// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels,
+// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty
+// 0.5 (2011-12-09) bugfixes:
+// subpixel glyph renderer computed wrong bounding box
+// first vertex of shape can be off-curve (FreeSans)
+// 0.4b (2011-12-03) fixed an error in the font baking example
+// 0.4 (2011-12-01) kerning, subpixel rendering (tor)
+// bugfixes for:
+// codepoint-to-glyph conversion using table fmt=12
+// codepoint-to-glyph conversion using table fmt=4
+// stbtt_GetBakedQuad with non-square texture (Zer)
+// updated Hello World! sample to use kerning and subpixel
+// fixed some warnings
+// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM)
+// userdata, malloc-from-userdata, non-zero fill (stb)
+// 0.2 (2009-03-11) Fix unsigned/signed char warnings
+// 0.1 (2009-03-09) First public release
+//
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 725d50bcd60..3b412508723 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -1,8 +1,8 @@
[bgfx](https://github.com/bkaradzic/bgfx) - Cross-platform rendering library
============================================================================
-What is it?
------------
+[What is it?](https://bkaradzic.github.io/bgfx/overview.html)
+-------------------------------------------------------------
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style
rendering library.
@@ -11,6 +11,8 @@ Supported rendering backends:
* Direct3D 9
* Direct3D 11
+ * Direct3D 12 (WIP)
+ * Metal (WIP)
* OpenGL 2.1
* OpenGL 3.1+
* OpenGL ES 2
@@ -26,10 +28,11 @@ Supported platforms:
* Android (14+, ARM, x86, MIPS)
* asm.js/Emscripten (1.25.0)
* FreeBSD
- * iOS
+ * iOS (iPhone, iPad, AppleTV)
* Linux ![](https://tc27.draster.com/app/rest/builds/buildType:(id:Bgfx_Linux)/statusIcon)
+ * MIPS Creator CI20
* Native Client (PPAPI 37+, ARM, x86, x64, PNaCl)
- * OSX (10.9)
+ * OSX (10.9+)
* RaspberryPi
* Windows (XP, Vista, 7, 8, 10) ![](https://tc27.draster.com/app/rest/builds/buildType:(id:Bgfx_Windows)/statusIcon)
* WinRT (WinPhone 8.0+)
@@ -42,11 +45,11 @@ Supported compilers:
Languages:
- * [C99 API documentation](https://github.com/bkaradzic/bgfx/blob/master/include/bgfx.c99.h)
- * [C++ API documentation](https://github.com/bkaradzic/bgfx/blob/master/include/bgfx.h)
+ * [C/C++ API documentation](https://bkaradzic.github.io/bgfx/bgfx.html)
* [C#/VB/F# language API bindings](https://github.com/MikePopoloski/SharpBgfx)
* [D language API bindings](https://github.com/DerelictOrg/DerelictBgfx)
* [Go language API bindings](https://github.com/james4k/go-bgfx)
+ * [Java language API bindings](https://github.com/enleeten/twilight-bgfx)
Build status
------------
@@ -79,738 +82,38 @@ focusing on racing games.
https://github.com/andr3wmac/Torque6 Torque 6 is an MIT licensed 3D engine
loosely based on Torque2D. Being neither Torque2D or Torque3D it is the 6th
derivative of the original Torque Engine.
+<a href="http://www.youtube.com/watch?feature=player_embedded&v=p4LTM_QGK34
+" target="_blank"><img src="http://img.youtube.com/vi/p4LTM_QGK34/0.jpg"
+alt="Torque 6 Material Editor" width="640" height="480" border="0" /></a>
https://github.com/cgbystrom/twinkle GPU-accelerated UI framework powered by
JavaScript for desktop/mobile apps. Idea is to combine the fast workflow and
deployment model of web with the performance of native code and GPU acceleration.
-Examples
---------
+https://github.com/nem0/LumixEngine LumixEngine is a MIT licensed 3D engine.
+The main goal is performance and Unity-like usability.
+<a href="http://www.youtube.com/watch?feature=player_embedded&v=eyqk61Yw52E
+" target="_blank"><img src="http://img.youtube.com/vi/eyqk61Yw52E/0.jpg"
+alt="LumixEngine Terrain Editor" width="640" height="480" border="0" /></a>
-Most of the examples require shader/texture/mesh data to be loaded. When running
-examples your current directory should be examples/runtime.
+[Building](https://bkaradzic.github.io/bgfx/build.html)
+-------------------------------------------------------
- <bgfx_path>/examples/runtime $ ../../.build/<config>/bin/example-00-helloworldDebug
+[Examples](https://bkaradzic.github.io/bgfx/examples.html)
+----------------------------------------------------------
-### [00-helloworld](https://github.com/bkaradzic/bgfx/blob/master/examples/00-helloworld)
+[API Reference](https://bkaradzic.github.io/bgfx/bgfx.html)
+-----------------------------------------------------------
-Initialization and debug text.
+[Tools](https://bkaradzic.github.io/bgfx/tools.html)
+----------------------------------------------------
-![example-00-helloworld](https://github.com/bkaradzic/bgfx/raw/master/examples/00-helloworld/screenshot.png)
+[License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html)
+-----------------------------------------------------------------------
-### [01-cubes](https://github.com/bkaradzic/bgfx/blob/master/examples/01-cubes/cubes.cpp)
-
-Rendering simple static mesh.
-
-![example-01-cubes](https://github.com/bkaradzic/bgfx/raw/master/examples/01-cubes/screenshot.png)
-
-### [02-metaballs](https://github.com/bkaradzic/bgfx/blob/master/examples/02-metaballs)
-
-Rendering with transient buffers and embedding shaders.
-
-![example-02-metaballs](https://github.com/bkaradzic/bgfx/raw/master/examples/02-metaballs/screenshot.png)
-
-### [03-raymarch](https://github.com/bkaradzic/bgfx/blob/master/examples/03-raymarch)
-
-Updating shader uniforms.
-
-![example-03-raymarch](https://github.com/bkaradzic/bgfx/raw/master/examples/03-raymarch/screenshot.png)
-
-### [04-mesh](https://github.com/bkaradzic/bgfx/blob/master/examples/04-mesh)
-
-Loading meshes.
-
-![example-04-mesh](https://github.com/bkaradzic/bgfx/raw/master/examples/04-mesh/screenshot.png)
-
-### [05-instancing](https://github.com/bkaradzic/bgfx/blob/master/examples/05-instancing)
-
-Geometry instancing.
-
-![example-05-instancing](https://github.com/bkaradzic/bgfx/raw/master/examples/05-instancing/screenshot.png)
-
-### [06-bump](https://github.com/bkaradzic/bgfx/blob/master/examples/06-bump)
-
-Loading textures.
-
-![example-06-bump](https://github.com/bkaradzic/bgfx/raw/master/examples/06-bump/screenshot.png)
-
-### [07-callback](https://github.com/bkaradzic/bgfx/blob/master/examples/07-callback)
-
-Implementing application specific callbacks for taking screen shots, caching
-OpenGL binary shaders, and video capture.
-
-### [08-update](https://github.com/bkaradzic/bgfx/blob/master/examples/08-update)
-
-Updating textures.
-
-### [09-hdr](https://github.com/bkaradzic/bgfx/tree/master/examples/09-hdr)
-Using multiple views and render targets.
-
-![example-09-hdr](https://github.com/bkaradzic/bgfx/raw/master/examples/09-hdr/screenshot.png)
-
-### [10-font](https://github.com/bkaradzic/bgfx/tree/master/examples/10-font)
-
-Use the font system to display text and styled text.
-
-![example-10-font](https://github.com/bkaradzic/bgfx/raw/master/examples/10-font/screenshot.png)
-
-### [11-fontsdf](https://github.com/bkaradzic/bgfx/tree/master/examples/11-fontsdf)
-
-Use a single distance field font to render text of various size.
-
-![example-11-fontsdf](https://github.com/bkaradzic/bgfx/raw/master/examples/11-fontsdf/screenshot.png)
-
-### [12-lod](https://github.com/bkaradzic/bgfx/tree/master/examples/12-lod)
-
-Mesh LOD transitions.
-
-![example-12-lod](https://github.com/bkaradzic/bgfx/raw/master/examples/12-lod/screenshot.png)
-
-### [13-stencil](https://github.com/bkaradzic/bgfx/tree/master/examples/13-stencil)
-
-Stencil reflections and shadows.
-
-![example-13-stencil](https://github.com/bkaradzic/bgfx/raw/master/examples/13-stencil/screenshot.png)
-
-### [14-shadowvolumes](https://github.com/bkaradzic/bgfx/tree/master/examples/14-shadowvolumes)
-
-Shadow volumes.
-
-![example-14-shadowvolumes](https://github.com/bkaradzic/bgfx/raw/master/examples/14-shadowvolumes/screenshot.png)
-
-### [15-shadowmaps-simple](https://github.com/bkaradzic/bgfx/tree/master/examples/15-shadowmaps-simple)
-
-![example-15-shadowmaps-simple](https://github.com/bkaradzic/bgfx/raw/master/examples/15-shadowmaps-simple/screenshot.png)
-
-### [16-shadowmaps](https://github.com/bkaradzic/bgfx/tree/master/examples/16-shadowmaps)
-
-![example-16-shadowmaps](https://github.com/bkaradzic/bgfx/raw/master/examples/16-shadowmaps/screenshot.png)
-
-### [17-drawstress](https://github.com/bkaradzic/bgfx/blob/master/examples/17-drawstress)
-
-#### 60Hz
-
-Draw stress is CPU stress test to show what is the maximimum number of draw
-calls while maintaining 60Hz frame rate. bgfx currently has default limit of 64K
-draw calls per frame. You can increase this limit by changing
-`BGFX_CONFIG_MAX_DRAW_CALLS`.
-
-| CPU | Renderer | GPU | Arch/Compiler/OS | Dim | Calls |
-|:-------------|:-------------|:----------|:--------------------:|----:|------:|
-| i7-4770K 4.2 | GL2.1 | 2xGTX780 | x64/VS2013/Win 8.1 | 51 |132651 |
-| i7-4770K 4.2 | DX11 | 2xGTX780 | x64/VS2013/Win 8.1 | 50 |125000 |
-| i7-4790K 4.0 | GL2.1 | GTX970 | x64/VS2015/Win 10 | 47 |103823 |
-| i7-4790K 4.0 | DX11 | GTX970 | x64/VS2015/Win 10 | 45 | 91125 |
-| i7-4790K 4.0 | DX9 | GTX970 | x64/VS2013/Win 10 | 40 | 64000 |
-| i5-3570 3.8 | NV 331.49 | GTX560Ti | x64/GCC/Linux | 40 | 64000+|
-| i7-920 2.66 | GL2.1 | GTX650Ti | x64/VS2008/Win 7 | 38 | 54872 |
-| i7-920 2.66 | GL2.1 | GTX650Ti | x86/VS2008/Win 7 | 38 | 54872 |
-| i7-4790K 4.0 | DX11 | R7 240 | x64/VS2015/Win 10 | 36 | 46656 |
-| i7-920 2.66 | NV 331.113 | GTX650Ti | x64/GCC/Linux | 34 | 39304 |
-| i7-4790K 4.0 | DX9 | R7 240 | x64/VS2015/Win 10 | 32 | 32768 |
-| i7-920 2.66 | DX9 | GTX650Ti | x64/GCC/Win 7 | 32 | 32768 |
-| i7-920 2.66 | DX9 | GTX650Ti | x64/VS2008/Win 7 | 32 | 32768 |
-| i7-920 2.66 | DX9 | GTX650Ti | x86/GCC/Win 7 | 30 | 27000 |
-| i7-920 2.66 | DX9 | GTX650Ti | x86/VS2008/Win 7 | 30 | 27000 |
-| i5-4250U 1.3 | GL2.1 | HD5000 | x64/Clang/OSX 10.9 | 28 | 21852 |
-| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/Linux | 27 | 19683 |
-| i7-2600K 3.4 | DX9 | AMD6800 | x64/VS2012/Win 7 | 27 | 19683 |
-| i7-2600K 3.4 | GL2.1 | AMD6800 | x64/VS2012/Win 7 | 26 | 17576 |
-| i7-4770R 3.2 | Mesa 10.0.1 | HD5200 | x64/GCC/SteamOS | 25 | 15625 |
-| i7-920 2.66 | DX9-Wine | GTX650Ti | x64/GCC/Linux | 24 | 13824 |
-| i7-4750HQ 2.0| Mesa 10.0.1 | HD5200 | x64/GCC/Linux | 22 | 10648 |
-| i7-4750HQ 2.0| Mesa 10.1.3 | HD5200 | x64/GCC/Linux | 21 | 9261 |
-| i7-920 2.66 | ES2-ANGLE | GTX650Ti | x86/VS2008/Win 7 | 21 | 9261 |
-| Q8200 2.33 | Gallium 0.4 | AMD5770 | x64/GCC/Linux | 21 | 9261 |
-| i5-4250U 1.3 | ES2 | HD5000 | JIT/Clang/PNaCl 31 | 21 | 9261 |
-| i5-4250U 1.3 | ES2 | HD5000 | x86/GCC/NaCl 31 | 20 | 8000 |
-| Q8200 2.33 | Gallium 0.4 | GTX260 | x64/GCC/Linux | 19 | 6859 |
-| i5-2450M 2.5 | Mesa 10.2.0 | HD3000 | x64/GCC/Linux | 19 | 6859 |
-| i7-920 2.66 | ES2-PowerVR | GTX650Ti | x86/VS2008/Win 7 | 18 | 5832 |
-| i7-920 2.66 | FF27-GL | GTX650Ti | JIT/Clang/W7-asm.js | 17 | 4913 |
-| i7-4750HQ 2.0| Mesa 8.0.5 | LLVMPIPE | x64/GCC/Linux | 16 | 4096 |
-| i7-920 2.66 | ES2-Qualcomm | GTX650Ti | x86/VS2008/Win 7 | 15 | 3375 |
-| i7-920 2.66 | ES2 | GTX650Ti | x64/GCC/NaCl 31 | 15 | 3375 |
-| i7-920 2.66 | ES2 | GTX650Ti | JIT/Clang/PNaCl 31 | 15 | 3375 |
-| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/NaCl 31 | 15 | 3375 |
-| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/PNaCl 31 | 15 | 3375 |
-| '12 Nexus 7 | ES2 | Tegra3 | ARM/GCC/Android | 15 | 3375 |
-| i5-4250U 1.3 | ES2-FF27 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
-| i5-4250U 1.3 | Chrome33 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
-| iPad mini 2 | ES2 | PVR G6430 | ARM64/Clang/iOS7 | 15 | 3375 |
-| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-asm.js | 14 | 2744 |
-| i7-920 2.66 | FF27-ANGLE | GTX650Ti | JIT/Clang/W7-asm.js | 12 | 2744 |
-| '13 Nexus 10 | ES2 | Mali T604 | ARM/GCC/Android | 13 | 2197 |
-| iPhone 5 | ES2 | PVR SGX543| ARM/Clang/iOS7 | 13 | 2197 |
-| '13 Nexus 7 | ES2 | S4 Pro | ARM/GCC/Android | 12 | 1728 |
-| iPad 2 | ES2 | PVR SGX543| ARM/Clang/iOS6 | 12 | 1728 |
-| Xperia Z | ES2 | Adreno320 | ARM/GCC/Android | 11 | 1331 |
-| iPod 4 | ES2 | PVR SGX535| ARM/Clang/iOS6 | 7 | 343 |
-| i7-920 2.66 | ES2-Mali | GTX650Ti | x86/VS2008/Windows7 | 6 | 216 |
-| RaspberryPi | ES2 | VC IV | ARM/GCC/Raspbian | 6 | 216 |
-
-To test browsers in 60Hz mode following changes were made:
-
- * Firefox 27 about:config adjustments: `webgl.prefer-native-gl true` (on Windows),
- and `layout.frame_rate 500`.
- * Chrome 33 command line option: `--disable-gpu-vsync`.
-
-#### 30Hz (test for browsers)
-
-By default browsers are using vsync, and don't have option to turn it off
-programatically.
-
-| CPU | Renderer | GPU | Arch/Compiler/OS | Dim | Calls |
-|:-------------|:---------|:----------|:----------------------:|----:|------:|
-| i7-920 2.66 | GL2.1 | GTX650Ti | x64/VS2008/Win7 | 38 | 64000+|
-| i5-4250U 1.3 | GL2.1 | HD5000 | x64/Clang/OSX 10.9 | 36 | 46656 |
-| i5-4250U 1.3 | Chrome34 | HD5000 | JIT/Clang/OSX-PNaCl 31 | 28 | 21952 |
-| i5-4250U 1.3 | Chrome33 | HD5000 | JIT/Clang/OSX-PNaCl 31 | 27 | 19683 |
-| i5-4250U 1.3 | FF28 | HD5000 | JIT/Clang/OSX-asm.js | 25 | 15625 |
-| i5-4250U 1.3 | FF36 | HD5000 | JIT/Clang/OSX-asm.js | 25 | 15625 |
-| i5-4250U 1.3 | Chrome41 | HD5000 | x64/GCC/OSX-NaCl 41 | 24 | 13824 |
-| i5-4250U 1.3 | FF37 | HD5000 | JIT/Clang/OSX-asm.js | 23 | 12167 |
-| i5-4250U 1.3 | FF27 | HD5000 | JIT/Clang/OSX-asm.js | 20 | 8000 |
-| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-PNaCl 31 | 20 | 8000 |
-| i7-920 2.66 | Chrome34 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
-| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
-| i7-920 2.66 | FF28 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
-| i7-920 2.66 | FF27 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
-| i5-4250U 1.3 | Safari7 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
-
-
- * [JavaScript+WebGL port](https://github.com/djg/webgl-drawstress-js)
-
-### [18-ibl](https://github.com/bkaradzic/bgfx/tree/master/examples/18-ibl)
-
-Image based lighting.
-
-![example-18-ibl](https://github.com/bkaradzic/bgfx/raw/master/examples/18-ibl/screenshot.png)
-
-### [19-oit](https://github.com/bkaradzic/bgfx/tree/master/examples/19-oit)
-
-Weighted, Blended Order-Independent Transparency
-
-![example-19-oit](https://github.com/bkaradzic/bgfx/raw/master/examples/19-oit/screenshot.png)
-
-### [20-nanovg](https://github.com/bkaradzic/bgfx/tree/master/examples/20-nanovg)
-
-NanoVG is small antialiased vector graphics rendering library.
-
-![example-20-nanovg](https://github.com/bkaradzic/bgfx/raw/master/examples/20-nanovg/screenshot.png)
-
-### [21-deferred](https://github.com/bkaradzic/bgfx/tree/master/examples/21-deferred)
-
-MRT rendering and deferred shading.
-
-![example-21-deferred](https://github.com/bkaradzic/bgfx/raw/master/examples/21-deferred/screenshot.png)
-
-### [22-windows](https://github.com/bkaradzic/bgfx/tree/master/examples/22-windows)
-
-Rendering into multiple windows.
-
-### [23-vectordisplay](https://github.com/bkaradzic/bgfx/tree/master/examples/23-vectordisplay)
-
-Rendering lines as oldschool vectors.
-
-![example-23-vectordisplay](https://github.com/bkaradzic/bgfx/raw/master/examples/23-vectordisplay/screenshot.png)
-
-### [24-nbody](https://github.com/bkaradzic/bgfx/tree/master/examples/24-nbody)
-
-N-body simulation with compute shaders using buffers.
-
-![example-24-nbody](https://github.com/bkaradzic/bgfx/raw/master/examples/24-nbody/screenshot.png)
-
-### [25-c99](https://github.com/bkaradzic/bgfx/tree/master/examples/25-c99)
-
-Initialization and debug text with C99 API.
-
-Dependencies
-------------
-
-[https://github.com/bkaradzic/bx](https://github.com/bkaradzic/bx)
-
-Building
---------
-
-Steps bellow are for default build system inside bgfx repository. There is
-alterative way to build bgfx and examples with [fips](https://github.com/floooh/fips-bgfx/#fips-bgfx).
-
-Binary builds (for Windows and Linux) are also available [here](https://tc27.draster.com/bgfx-bins/).
-
-### Getting source
-
- git clone git://github.com/bkaradzic/bx.git
- git clone git://github.com/bkaradzic/bgfx.git
-
-### Quick start (Windows with Visual Studio)
-
-Enter bgfx directory:
-
- cd bgfx
-
-Generate Visual Studio 2013 project files:
-
- ..\bx\tools\bin\windows\genie vs2013
-
-Open bgfx solution in Visual Studio 2013:
-
- start .build\projects\vs2013\bgfx.sln
-
-### Generating project files for all targets
-
- cd bgfx
- make
-
-After calling `make`, .build/projects/* directory will be generated. All
-intermediate files generated by compiler will be inside .build directory
-structure. Deleting .build directory at any time is safe.
-
-### Prerequisites for Android
-
-Download AndroidNDK from:
-[https://developer.android.com/tools/sdk/ndk/index.html](https://developer.android.com/tools/sdk/ndk/index.html)
-
- setx ANDROID_NDK_ROOT <path to AndroidNDK directory>
- setx ANDROID_NDK_ARM <path to AndroidNDK directory>\toolchains\arm-linux-androideabi-4.7\prebuilt\windows-x86_64
- setx ANDROID_NDK_MIPS <path to AndroidNDK directory>\toolchains\mipsel-linux-android-4.7\prebuilt\windows-x86_64
- setx ANDROID_NDK_X86 <path to AndroidNDK directory>\toolchains\x86-4.7\prebuilt\windows-x86_64
-
-### Prerequisites for Linux
-
- sudo apt-get install libgl1-mesa-dev
-
-### Prerequisites for Native Client
-
-Download Native Client SDK from:
-[https://developers.google.com/native-client/sdk/download](https://developers.google.com/native-client/sdk/download)
-
- setx NACL_SDK_ROOT <path to Native Client SDK directory>
-
-### Prerequisites for Windows
-
-Windows users download GnuWin32 utilities from:
-[http://gnuwin32.sourceforge.net/packages/make.htm](http://gnuwin32.sourceforge.net/packages/make.htm)
-[http://gnuwin32.sourceforge.net/packages/coreutils.htm](http://gnuwin32.sourceforge.net/packages/coreutils.htm)
-[http://gnuwin32.sourceforge.net/packages/libiconv.htm](http://gnuwin32.sourceforge.net/packages/libiconv.htm)
-[http://gnuwin32.sourceforge.net/packages/libintl.htm](http://gnuwin32.sourceforge.net/packages/libintl.htm)
-
-When building on Windows, you have to set DXSDK_DIR environment variable to
-point to DirectX SDK directory.
-
- setx DXSDK_DIR <path to DirectX SDK directory>
-
-If you're building with Visual Studio 2008, you'll need TR1 support from:
-[Visual C++ 2008 Feature Pack Release](https://www.microsoft.com/en-us/download/details.aspx?id=6922)
-
-If you're building with MinGW/TDM compiler on Windows make DirectX SDK
-directory link to directory without spaces in the path.
-
- mklink /D c:\dxsdk <path to DirectX SDK directory>
- setx DXSDK_DIR c:\dxsdk
-
-Apply this [patch](https://github.com/bkaradzic/bx/blob/master/include/compat/mingw/dxsdk.patch)
-to DXSDK from June 2010 to be able to use it with MinGW/TDM.
-
-### Building
-
-Visual Studio 2008 command line:
-
- make vs2008-release64
-
-Visual Studio 2008 IDE:
-
- start .build/projects/vs2008/bgfx.sln
-
-Xcode 5 IDE:
-
- open .build/projects/xcode4/bgfx.xcworkspace
-Due to [inability](http://industriousone.com/debugdir) to set working directory for an Xcode project from premake configuration file, it has to be set manually for each example project:
-
-1. Open *"Edit scheme..."* dialog for a given project.
-2. Select *"Run"* settings.
-3. Check *"Use custom working directory"* and enter following path: `${PROJECT_DIR}/../../../examples/runtime`.
-
-Linux 64-bit:
-
- make linux-release64
-
-WinRT / Windows Phone 8.1:
-
- ../bx/tools/bin/windows/genie --vs=winphone81 vs2013
-Build the resulting solution and deploy to device. Note that
-shaders will need to be compiled with the appropriate target profile for your platform.
-
-Other platforms:
-
- make <configuration>
-
-Configuration is `<platform>-<debug/release>[32/64]`. For example:
-
- linux-release32, nacl-debug64, nacl-arm-debug, pnacl-release,
- android-release, etc.
-
-Amalgamated build
------------------
-
-For ease of integration to other build system bgfx library can be built with
-single .cpp file. It's only necessary to build [src/amalgamated.cpp](https://github.com/bkaradzic/bgfx/blob/master/src/amalgamated.cpp)
-inside different build system.
-
-OculusVR integration
---------------------
-
-OculusVR support is currently experimental, and only DX11 is tested. To build
-with OculusVR HMD support enabled you must set `OVR_DIR` enviroment variable:
-
- set OVR_DIR=<path to OculusSDK>
-
-And generate project files with `--with-ovr` option:
-
- genie --with-ovr vs2012
-
-In `LibOVR/Include` create trampoline headers `OVR_D3D.h` and `OVR_GL.h`.
-
-`OVR_D3D.h` should contain:
-
- #include "../Src/OVR_CAPI_D3D.h"
-
-`OVR_GL.h` should contain:
-
- #include "../Src/OVR_CAPI_GL.h"
-
-Internals
----------
-
-bgfx is using sort-based draw call bucketing. This means that submission order
-doesn't necessarily match the rendering order, but on the low-level they
-will be sorted and ordered correctly. On the high level this allows
-more optimal way of submitting draw calls for all passes at one place, and on
-the low-level this allows better optimization of rendering order. This sometimes
-creates undesired results usually for GUI rendering, where draw order should
-usually match submit order. bgfx provides way to enable sequential rendering for
-these cases (see `bgfx::setViewSeq`).
-
-Internally all low-level rendering draw calls are issued inside single function
-`Context::rendererSubmit`. This function exist inside each renderer backend
-implementation.
-
-More detailed description of sort-based draw call bucketing can be found at:
-[Order your graphics draw calls around!](http://realtimecollisiondetection.net/blog/?p=86)
-
-Customization
--------------
-
-By default each platform has sane default values. For example on Windows default
-renderer is DirectX9, and on Linux it is OpenGL 2.1. On Windows platform all
-rendering backends are available. For OpenGL ES on desktop you can find more
-information at:-
-[OpenGL ES 2.0 and EGL on desktop](http://www.g-truc.net/post-0457.html)
-
-If you're targeting specific mobile hardware, you can find GLES support in their
-official SDKs:
-[Adreno SDK](http://developer.qualcomm.com/mobile-development/mobile-technologies/gaming-graphics-optimization-adreno/tools-and-resources),
-[Mali SDK](http://www.malideveloper.com/),
-[PowerVR SDK](http://www.imgtec.com/powervr/insider/sdkdownloads/).
-
-All configuration settings are located inside [src/config.h](https://github.com/bkaradzic/bgfx/blob/master/src/config.h).
-
-Every `BGFX_CONFIG_*` setting can be changed by passing defines thru compiler
-switches. For example setting preprocessor define `BGFX_CONFIG_RENDERER_OPENGL=1`
-will change backend renderer to OpenGL 2.1. on Windows. Since rendering APIs are
-platform specific, this obviously won't work nor make sense in all cases.
-Certain platforms have only single choice, for example the Native Client works
-only with OpenGL ES 2.0 renderer, using anything other than that will result in
-build errors.
-
-Debugging and Profiling
------------------------
-
-### RenderDoc
-
-Loading of RenderDoc is integrated in bgfx when using DX11 or OpenGL renderer.
-You can drop in `renderdoc.dll` from RenderDoc distribution into working
-directory, and it will be automatically loaded during bgfx initialization. This
-allows frame capture at any time by pressing **F11**.
-
-Download: [RenderDoc](https://renderdoc.org/builds)
-
-### IntelGPA
-
-Right click **Intel GPA Monitor** tray icon, choose preferences, check
-"Auto-detect launched applications" option. Find `InjectionList.txt` in GPA
-directory and add `examples-*` to the list.
-
-Download: [IntelGPA](https://software.intel.com/en-us/vcsource/tools/intel-gpa)
-
-Other debuggers:
-
-| Name | OS | DX9 | DX11 | GL | GLES | Source |
-|:----------|:--------------|:----:|:----:|:----:|:----:|:------:|
-| APITrace | Linux/OSX/Win | x | x | x | x | x |
-| CodeXL | Linux/Win | | | x | | |
-| Dissector | Win | x | | | | x |
-| IntelGPA | Linux/OSX/Win | x | x | | x | |
-| Nsight | Win | x | x | x | | |
-| PerfHUD | Win | x | x | | | |
-| RenderDoc | Win | | x | x | | x |
-| vogl | Linux | | | x | | x |
-
-Download:
-[APITrace](https://apitrace.github.io/)
-[CodeXL](http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/)
-[Dissector](https://github.com/imccown/Dissector)
-[Nsight](https://developer.nvidia.com/nvidia-nsight-visual-studio-edition)
-[PerfHUD](https://developer.nvidia.com/nvidia-perfhud)
-[vogl](https://github.com/ValveSoftware/vogl)
-
-SDL, GLFW, etc.
----------------
-
-It is possible to use bgfx with SDL, GLFW and similar cross platform windowing
-libraries. The main requirement is that windowing library provides access to
-native window handle that's used to create Direct3D device or OpenGL context.
-
-Using bgfx with SDL example:
-
- #include <SDL.h>
- #include <bgfxplatform.h> // it must be included after SDL to enable SDL
- // integration code path.
-
- #include <bgfx.h>
- ...
-
- int main(...
- {
- SDL_window* window = SDL_CreateWindow(...
- bgfx::sdlSetWindow(window);
-
- ...
- bgfx::init();
-
-**NOTE** You can use `--with-sdl` when runnning GENie to enable SDL2 integration
-with examples:
-
- genie --with-sdl vs2012
-
-**NOTE** `--with-glfw` is also available, but it's just simple stub to be used
-to test GLFW integration API.
-
-**NOTE** Special care is necessary to make custom windowing to work with
-multithreaded renderer. Each platform has rules about where renderer can be and
-how multithreading interacts with context/device. To disable multithreaded
-render use `BGFX_CONFIG_MULTITHREDED=0` preprocessor define.
-
-Tools
------
-
-### Shader Compiler (shaderc)
-
-bgfx cross-platform shader language is based on GLSL syntax. It's uses ANSI C
-preprocessor to transform GLSL like language syntax into HLSL. This technique
-has certain drawbacks, but overall it's simple and allows quick authoring of
-cross-platform shaders.
-
-Some differences between bgfx's shaderc flavor of GLSL and regular GLSL:
-
- - No `bool/int` uniforms, all uniforms must be `float`.
- - Attributes and varyings can be accessed only from `main()` function.
- - Must use `SAMPLER2D/3D/CUBE/etc.` macros instead of `sampler2D/3D/Cube/etc.`
- tokens.
- - Must use `vec2/3/4_splat(<value>)` instead of `vec2/3/4(<value>)`.
- - Must use `mul(x, y)` when multiplying vectors and matrices.
- - Must use `varying.def.sc` to define input/output semantic and precission
- instead of using `attribute/in` and `varying/in/out`.
- - `$input/$output` tokens must appear at the begining of shader.
-
-For more info see [shader helper macros](https://github.com/bkaradzic/bgfx/blob/master/src/bgfx_shader.sh).
-
-### Texture Compiler (texturec)
-
-This tool doesn't currently exist. To produce DDS, KTX or PVR textures use:
-
-[.dds - nVidia Texture Tools - DDS Utilities](https://developer.nvidia.com/legacy-texture-tools)
-[.ktx - Mali GPU Texture Compression Tool](http://malideveloper.arm.com/develop-for-mali/mali-gpu-texture-compression-tool/)
-[.pvr - PowerVR Insider SDK](http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp)
-
-### Geometry Compiler (geometryc)
-
-Converts Wavefront .obj mesh file to format optimal for using with bgfx.
-
-Todo
-----
-
- - Blit between textures.
- - Occlusion queries.
- - Fullscreen mode.
- - ETC2, PVRTC1/2 decoding fallback for targets that don't support it natively.
- - shaderc as library for runtime shader building.
- - texturec tool with support for all supported texture formats.
- - Multiple vertex streams support.
- - Animated mesh example.
- - Direct3D 12 renderer backend.
- - Metal renderer backend.
- - Vulkan renderer backend.
-
-Contact
--------
-
-[@bkaradzic](https://twitter.com/bkaradzic)
-
-Project page
-https://github.com/bkaradzic/bgfx
-
-3rd Party Libraries
--------------------
-
-All required 3rd party libraries are included in bgfx repository in [3rdparty/](https://github.com/bkaradzic/bgfx/tree/master/3rdparty)
-directory.
-
-### Blendish (MIT)
-
-Blendish - Blender 2.5 UI based theming functions for NanoVG.
-
-https://bitbucket.org/duangle/oui-blendish
-
-### edtaa3 (MIT)
-
-Contour Rendering by Distance Fields
-
-https://github.com/OpenGLInsights/OpenGLInsightsCode/tree/master/Chapter%2012%202D%20Shape%20Rendering%20by%20Distance%20Fields
-
-### fcpp (BSD)
-
-Frexx C preprocessor
-
-https://github.com/bagder/fcpp
-
-### Forsyth Triangle Order Optimizer (Public Domain)
-
-http://gameangst.com/?p=9
-
-### FreeType
-
-http://www.freetype.org/
-
-### glsl-optimizer (MIT)
-
-GLSL optimizer based on Mesa's GLSL compiler. Used in Unity for mobile shader
-optimization.
-
-https://github.com/aras-p/glsl-optimizer
-
-### NanoVG (ZLIB)
-
-NanoVG is small antialiased vector graphics rendering library.
-
-https://github.com/memononen/nanovg
-
-### ImGui (MIT)
-
-Bloat-free Immediate Mode Graphical User interface for C++ with minimal
-dependencies.
-
-https://github.com/ocornut/imgui
-
-### SDF (MIT)
-
-Sweep-and-update Euclidean distance transform of an antialised image for contour
-texturing.
-
-https://github.com/memononen/SDF
-
-### stb (Public Domain)
-
-http://nothings.org
-
-### Vertex Cache Optimised Index Buffer Compression (BSD)
-
-https://github.com/ConorStokes/IndexBufferCompression
-
-Assets
-------
-
-Bunny
-[Stanford University Computer Graphics Laboratory](http://www-graphics.stanford.edu/data/3Dscanrep/)
-
-Uffizi
-[Light Probe Image Gallery](http://www.pauldebevec.com/Probes/)
-
-Wells
-[Bernhard Vogl Light probes](http://dativ.at/lightprobes/)
-
-Pisa, Ennis, Grace
-[High-Resolution Light Probe Image Gallery](http://gl.ict.usc.edu/Data/HighResProbes/)
-
-Droid Sans Font
-http://www.fontsquirrel.com/license/Droid-Sans
-
-Bleeding Cowboys Font
-http://www.dafont.com/bleeding-cowboys.font
-
-Cheap Fire Font
-http://www.dafont.com/cheap-fire.font
-
-Five Minutes Font
-http://www.fonts2u.com/fiveminutes.font
-
-Mias Scribblings Font
-http://www.dafont.com/mias-scribblings.font
-
-Ruritania Font
-http://www.dafont.com/ruritania.font
-
-Signika Font
-http://fontfabric.com/signika-font/
-
-Visitor Font
-http://www.dafont.com/visitor.font
-
-Special-Elite Font
-http://www.fontspace.com/astigmatic-one-eye-typographic-institute/special-elite
-
-FontAwesome Font
-http://fontawesome.io/
-
-Sherlock Holmes text
-http://www.gutenberg.org/ebooks/1661
-
-Tree Pack 1
-http://www.turbosquid.com/3d-models/free-obj-mode-tree-pack/506851
-
-Getting involved
-----------------
-
-Everyone is welcome to contribute to bgfx by submitting bug reports, testing
-on different platforms, writing examples, improving documentation, profiling
-and optimizing, etc.
-
-When contributing to the bgfx project you must agree to the BSD 2-clause
-licensing terms.
-
-Contributors
-------------
-
-Garett Bass ([@gtbass](https://github.com/gtbass)) - OSX port.
-Jeremie Roy ([@jeremieroy](https://github.com/jeremieroy)) - Font system and
- examples.
-Miloš Tošić ([@milostosic](https://github.com/milostosic)) - 12-lod example.
-Dario Manesku ([@dariomanesku](https://github.com/dariomanesku)) - 13-stencil,
- 14-shadowvolumes, 15-shadowmaps-simple, 16-shadowmaps, 18-ibl
-James Gray ([@james4k](https://github.com/james4k)) - Go language API bindings.
-Guillaume Piolat ([@p0nce](https://github.com/p0nce)) - D language API bindings.
-Mike Popoloski ([@MikePopoloski](https://github.com/MikePopoloski)) - C#/VB/F#
-language API bindings, WinRT/WinPhone support.
-Kai Jourdan ([@questor](https://github.com/questor)) - 23-vectordisplay example
-Stanlo Slasinski ([@stanlo](https://github.com/stanlo)) - 24-nbody example
-Daniel Collin ([@emoon](https://github.com/emoon)) - Port of Ocornut's ImGui
- to bgfx.
-Andre Weissflog ([@floooh](https://github.com/floooh)) - Alternative build
-system fips.
-Andrew Johnson ([@ajohnson23](https://github.com/ajohnson23)) - TeamCity build.
-
-[License (BSD 2-clause)](https://github.com/bkaradzic/bgfx/blob/master/LICENSE)
--------------------------------------------------------------------------------
+<a href="http://opensource.org/licenses/BSD-2-Clause" target="_blank">
+<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
+</a>
Copyright 2010-2015 Branimir Karadzic. All rights reserved.
@@ -822,17 +125,17 @@ Andrew Johnson ([@ajohnson23](https://github.com/ajohnson23)) - TeamCity build.
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
index beef8cea1bb..b1f762ea76f 100644
--- a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
+++ b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
@@ -4,7 +4,7 @@
*/
#include "common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/uint32_t.h>
#include "logo.h"
@@ -36,7 +36,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
// Use debug font to print information about this example.
bgfx::dbgTextClear();
@@ -50,7 +50,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/00-helloworld");
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Initialization and debug text.");
- // Advance to next frame. Rendering thread will be kicked to
+ // Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}
diff --git a/3rdparty/bgfx/examples/01-cubes/cubes.cpp b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
index e6eb82cac1b..d3679d1ea48 100644
--- a/3rdparty/bgfx/examples/01-cubes/cubes.cpp
+++ b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
@@ -55,144 +55,165 @@ static const uint16_t s_cubeIndices[36] =
6, 3, 7,
};
-int _main_(int /*_argc*/, char** /*_argv*/)
+class Cubes : public entry::AppI
{
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
-
- bgfx::init();
- bgfx::reset(width, height, reset);
-
- // Enable debug text.
- bgfx::setDebug(debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- // Create vertex stream declaration.
- PosColorVertex::init();
-
- // Create static vertex buffer.
- bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(
- // Static data can be passed with bgfx::makeRef
- bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
- , PosColorVertex::ms_decl
- );
-
- // Create static index buffer.
- bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(
- // Static data can be passed with bgfx::makeRef
- bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) )
- );
-
- // Create program from shaders.
- bgfx::ProgramHandle program = loadProgram("vs_cubes", "fs_cubes");
-
- int64_t timeOffset = bx::getHPCounter();
-
- while (!entry::processEvents(width, height, debug, reset) )
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
{
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
-
- float time = (float)( (now-timeOffset)/double(bx::getHPFrequency() ) );
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/01-cube");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Rendering simple static mesh.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -35.0f };
-
- // Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
- {
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
+
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Create vertex stream declaration.
+ PosColorVertex::init();
+
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ // Static data can be passed with bgfx::makeRef
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosColorVertex::ms_decl
+ );
+
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(
+ // Static data can be passed with bgfx::makeRef
+ bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) )
+ );
+
+ // Create program from shaders.
+ m_program = loadProgram("vs_cubes", "fs_cubes");
+
+ m_timeOffset = bx::getHPCounter();
+ }
- float proj[16];
- bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
+ virtual int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ bgfx::destroyProgram(m_program);
- bgfx::setViewTransform(0, view, proj);
+ // Shutdown bgfx.
+ bgfx::shutdown();
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
- }
- else
- {
- float view[16];
- bx::mtxLookAt(view, eye, at);
+ return 0;
+ }
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+
+ float time = (float)( (now-m_timeOffset)/double(bx::getHPFrequency() ) );
+
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/01-cube");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Rendering simple static mesh.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -35.0f };
+
+ // Set view and projection matrix for view 0.
+ const bgfx::HMD* hmd = bgfx::getHMD();
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ {
+ float view[16];
+ bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
- }
+ float proj[16];
+ bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::setViewTransform(0, view, proj);
- // Submit 11x11 cubes.
- for (uint32_t yy = 0; yy < 11; ++yy)
- {
- for (uint32_t xx = 0; xx < 11; ++xx)
+ // Set view 0 default viewport.
+ //
+ // Use HMD's width/height since HMD's internal frame buffer size
+ // might be much larger than window size.
+ bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ }
+ else
{
- float mtx[16];
- bx::mtxRotateXY(mtx, time + xx*0.21f, time + yy*0.37f);
- mtx[12] = -15.0f + float(xx)*3.0f;
- mtx[13] = -15.0f + float(yy)*3.0f;
- mtx[14] = 0.0f;
-
- // Set model matrix for rendering.
- bgfx::setTransform(mtx);
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ }
- // Set render states.
- bgfx::setState(BGFX_STATE_DEFAULT);
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
- // Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ // Submit 11x11 cubes.
+ for (uint32_t yy = 0; yy < 11; ++yy)
+ {
+ for (uint32_t xx = 0; xx < 11; ++xx)
+ {
+ float mtx[16];
+ bx::mtxRotateXY(mtx, time + xx*0.21f, time + yy*0.37f);
+ mtx[12] = -15.0f + float(xx)*3.0f;
+ mtx[13] = -15.0f + float(yy)*3.0f;
+ mtx[14] = 0.0f;
+
+ // Set model matrix for rendering.
+ bgfx::setTransform(mtx);
+
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
+
+ // Set render states.
+ bgfx::setState(BGFX_STATE_DEFAULT);
+
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
+ }
}
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
}
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- // Cleanup.
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
- bgfx::destroyProgram(program);
-
- // Shutdown bgfx.
- bgfx::shutdown();
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+ bgfx::ProgramHandle m_program;
+ int64_t m_timeOffset;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(Cubes);
diff --git a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
index b8df14bb3ba..f26ec2830b7 100644
--- a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
+++ b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_metaballs_glsl[398] =
{
- 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?......va
+ 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?......va
0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi
0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, // ng highp vec3 v_
@@ -28,7 +28,7 @@ static const uint8_t fs_metaballs_glsl[398] =
};
static const uint8_t fs_metaballs_dx9[429] =
{
- 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..,.?........
+ 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..,.?........
0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
@@ -58,7 +58,7 @@ static const uint8_t fs_metaballs_dx9[429] =
};
static const uint8_t fs_metaballs_dx11[660] =
{
- 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x84, 0x02, 0x44, 0x58, 0x42, 0x43, // FSH..,.?....DXBC
+ 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x84, 0x02, 0x44, 0x58, 0x42, 0x43, // FSH..,.?....DXBC
0x71, 0x00, 0x85, 0x0b, 0x80, 0xfd, 0x1e, 0xdf, 0x09, 0x21, 0xdf, 0xe6, 0x3a, 0xef, 0x53, 0xf8, // q........!..:.S.
0x01, 0x00, 0x00, 0x00, 0x84, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
@@ -101,3 +101,50 @@ static const uint8_t fs_metaballs_dx11[660] =
0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, // .....@.....?>...
0x00, 0x00, 0x00, 0x00, // ....
};
+static const uint8_t fs_metaballs_mtl[704] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH..,.?......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x6e, // r0;. float3 v_n
+ 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // ormal;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // tput {. float4
+ 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, // gl_FragColor;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, // haderUniform {.}
+ 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // ;.fragment xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, // tlShaderOutput x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, // latMtlMain (xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, // MtlShaderInput _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, // mtl_i [[stage_in
+ 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // ]], constant xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // tMtlShaderUnifor
+ 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, // m& _mtl_u [[buff
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _mtl_o;. float
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x6f, 0x72, // var_1 = dot (nor
+ 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // malize(_mtl_i.v_
+ 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // normal), float3(
+ 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, // 0.0, 0.0, -1.0))
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ;. float4 tmpva
+ 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, // r_2;. tmpvar_2.
+ 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // w = 1.0;. tmpva
+ 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, // r_2.xyz = pow ((
+ 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // (. pow (_mtl_
+ 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // i.v_color0.xyz,
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, // float3(2.2, 2.2,
+ 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // 2.2)). * tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, // ar_1) + pow (tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x66, // var_1, 30.0)), f
+ 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, 0x2c, // loat3(0.4545454,
+ 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, // 0.4545454, 0.45
+ 0x34, 0x35, 0x34, 0x35, 0x34, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 45454));. _mtl_
+ 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // o.gl_FragColor =
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, // tmpvar_2;. ret
+ 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // urn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
index 7578433b317..6593f3d33c1 100644
--- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
+++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
@@ -4,7 +4,7 @@
*/
#include "common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
// embedded shaders
#include "vs_metaballs.bin.h"
@@ -460,294 +460,323 @@ uint32_t triangulate(uint8_t* _result, uint32_t _stride, const float* __restrict
return num;
}
-int _main_(int /*_argc*/, char** /*_argv*/)
+#define DIMS 32
+
+class Metaballs : public entry::AppI
{
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
+ {
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- bgfx::init();
- bgfx::reset(width, height, reset);
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
- // Create vertex stream declaration.
- PosNormalColorVertex::init();
+ // Create vertex stream declaration.
+ PosNormalColorVertex::init();
- const bgfx::Memory* vs_metaballs;
- const bgfx::Memory* fs_metaballs;
+ const bgfx::Memory* vs_metaballs;
+ const bgfx::Memory* fs_metaballs;
- switch (bgfx::getRendererType() )
- {
- case bgfx::RendererType::Direct3D9:
- vs_metaballs = bgfx::makeRef(vs_metaballs_dx9, sizeof(vs_metaballs_dx9) );
- fs_metaballs = bgfx::makeRef(fs_metaballs_dx9, sizeof(fs_metaballs_dx9) );
- break;
-
- case bgfx::RendererType::Direct3D11:
- case bgfx::RendererType::Direct3D12:
- vs_metaballs = bgfx::makeRef(vs_metaballs_dx11, sizeof(vs_metaballs_dx11) );
- fs_metaballs = bgfx::makeRef(fs_metaballs_dx11, sizeof(fs_metaballs_dx11) );
- break;
-
- default:
- vs_metaballs = bgfx::makeRef(vs_metaballs_glsl, sizeof(vs_metaballs_glsl) );
- fs_metaballs = bgfx::makeRef(fs_metaballs_glsl, sizeof(fs_metaballs_glsl) );
- break;
- }
+ switch (bgfx::getRendererType() )
+ {
+ case bgfx::RendererType::Direct3D9:
+ vs_metaballs = bgfx::makeRef(vs_metaballs_dx9, sizeof(vs_metaballs_dx9) );
+ fs_metaballs = bgfx::makeRef(fs_metaballs_dx9, sizeof(fs_metaballs_dx9) );
+ break;
+
+ case bgfx::RendererType::Direct3D11:
+ case bgfx::RendererType::Direct3D12:
+ vs_metaballs = bgfx::makeRef(vs_metaballs_dx11, sizeof(vs_metaballs_dx11) );
+ fs_metaballs = bgfx::makeRef(fs_metaballs_dx11, sizeof(fs_metaballs_dx11) );
+ break;
+
+ case bgfx::RendererType::Metal:
+ vs_metaballs = bgfx::makeRef(vs_metaballs_mtl, sizeof(vs_metaballs_mtl) );
+ fs_metaballs = bgfx::makeRef(fs_metaballs_mtl, sizeof(fs_metaballs_mtl) );
+ break;
+
+ default:
+ vs_metaballs = bgfx::makeRef(vs_metaballs_glsl, sizeof(vs_metaballs_glsl) );
+ fs_metaballs = bgfx::makeRef(fs_metaballs_glsl, sizeof(fs_metaballs_glsl) );
+ break;
+ }
- bgfx::ShaderHandle vsh = bgfx::createShader(vs_metaballs);
- bgfx::ShaderHandle fsh = bgfx::createShader(fs_metaballs);
+ bgfx::ShaderHandle vsh = bgfx::createShader(vs_metaballs);
+ bgfx::ShaderHandle fsh = bgfx::createShader(fs_metaballs);
- // Create program from shaders.
- bgfx::ProgramHandle program = bgfx::createProgram(vsh, fsh, true /* destroy shaders when program is destroyed */);
+ // Create program from shaders.
+ m_program = bgfx::createProgram(vsh, fsh, true /* destroy shaders when program is destroyed */);
-#define DIMS 32
+ m_grid = new Grid[DIMS*DIMS*DIMS];
+ m_timeOffset = bx::getHPCounter();
+ }
- Grid* grid = new Grid[DIMS*DIMS*DIMS];
- const uint32_t ypitch = DIMS;
- const uint32_t zpitch = DIMS*DIMS;
- const float invdim = 1.0f/float(DIMS-1);
+ int shutdown() BX_OVERRIDE
+ {
+ delete [] m_grid;
- int64_t timeOffset = bx::getHPCounter();
+ // Cleanup.
+ bgfx::destroyProgram(m_program);
- while (!entry::processEvents(width, height, debug, reset) )
- {
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
-
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
-
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
- float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) );
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/02-metaball");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Rendering with transient buffers and embedding shaders.");
-
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -50.0f };
-
- // Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
- {
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
+ // Shutdown bgfx.
+ bgfx::shutdown();
- float proj[16];
- bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
+ return 0;
+ }
- bgfx::setViewTransform(0, view, proj);
+ bool update() BX_OVERRIDE
+ {
+ const uint32_t ypitch = DIMS;
+ const uint32_t zpitch = DIMS*DIMS;
+ const float invdim = 1.0f/float(DIMS-1);
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
- }
- else
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
{
- float view[16];
- bx::mtxLookAt(view, eye, at);
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+ float time = (float)( (now - m_timeOffset)/double(bx::getHPFrequency() ) );
+
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/02-metaball");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Rendering with transient buffers and embedding shaders.");
+
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -50.0f };
+
+ // Set view and projection matrix for view 0.
+ const bgfx::HMD* hmd = bgfx::getHMD();
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ {
+ float view[16];
+ bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ float proj[16];
+ bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
- }
+ bgfx::setViewTransform(0, view, proj);
- // Stats.
- uint32_t numVertices = 0;
- int64_t profUpdate = 0;
- int64_t profNormal = 0;
- int64_t profTriangulate = 0;
+ // Set view 0 default viewport.
+ //
+ // Use HMD's width/height since HMD's internal frame buffer size
+ // might be much larger than window size.
+ bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ }
+ else
+ {
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
- // Allocate 32K vertices in transient vertex buffer.
- uint32_t maxVertices = (32<<10);
- bgfx::TransientVertexBuffer tvb;
- bgfx::allocTransientVertexBuffer(&tvb, maxVertices, PosNormalColorVertex::ms_decl);
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
- const uint32_t numSpheres = 16;
- float sphere[numSpheres][4];
- for (uint32_t ii = 0; ii < numSpheres; ++ii)
- {
- sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f);
- sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f);
- sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f);
- sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f);
- }
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ }
- profUpdate = bx::getHPCounter();
+ // Stats.
+ uint32_t numVertices = 0;
+ int64_t profUpdate = 0;
+ int64_t profNormal = 0;
+ int64_t profTriangulate = 0;
- for (uint32_t zz = 0; zz < DIMS; ++zz)
- {
- for (uint32_t yy = 0; yy < DIMS; ++yy)
+ // Allocate 32K vertices in transient vertex buffer.
+ uint32_t maxVertices = (32<<10);
+ bgfx::TransientVertexBuffer tvb;
+ bgfx::allocTransientVertexBuffer(&tvb, maxVertices, PosNormalColorVertex::ms_decl);
+
+ const uint32_t numSpheres = 16;
+ float sphere[numSpheres][4];
+ for (uint32_t ii = 0; ii < numSpheres; ++ii)
{
- uint32_t offset = (zz*DIMS+yy)*DIMS;
+ sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f);
+ sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f);
+ sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f);
+ sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f);
+ }
+
+ profUpdate = bx::getHPCounter();
- for (uint32_t xx = 0; xx < DIMS; ++xx)
+ for (uint32_t zz = 0; zz < DIMS; ++zz)
+ {
+ for (uint32_t yy = 0; yy < DIMS; ++yy)
{
- uint32_t xoffset = offset + xx;
+ uint32_t offset = (zz*DIMS+yy)*DIMS;
- float dist = 0.0f;
- float prod = 1.0f;
- for (uint32_t ii = 0; ii < numSpheres; ++ii)
+ for (uint32_t xx = 0; xx < DIMS; ++xx)
{
- const float* pos = sphere[ii];
- float dx = pos[0] - (-DIMS*0.5f + float(xx) );
- float dy = pos[1] - (-DIMS*0.5f + float(yy) );
- float dz = pos[2] - (-DIMS*0.5f + float(zz) );
- float invr = pos[3];
- float dot = dx*dx + dy*dy + dz*dz;
- dot *= invr*invr;
-
- dist *= dot;
- dist += prod;
- prod *= dot;
+ uint32_t xoffset = offset + xx;
+
+ float dist = 0.0f;
+ float prod = 1.0f;
+ for (uint32_t ii = 0; ii < numSpheres; ++ii)
+ {
+ const float* pos = sphere[ii];
+ float dx = pos[0] - (-DIMS*0.5f + float(xx) );
+ float dy = pos[1] - (-DIMS*0.5f + float(yy) );
+ float dz = pos[2] - (-DIMS*0.5f + float(zz) );
+ float invr = pos[3];
+ float dot = dx*dx + dy*dy + dz*dz;
+ dot *= invr*invr;
+
+ dist *= dot;
+ dist += prod;
+ prod *= dot;
+ }
+
+ m_grid[xoffset].m_val = dist / prod - 1.0f;
}
-
- grid[xoffset].m_val = dist / prod - 1.0f;
}
}
- }
- profUpdate = bx::getHPCounter() - profUpdate;
+ profUpdate = bx::getHPCounter() - profUpdate;
- profNormal = bx::getHPCounter();
+ profNormal = bx::getHPCounter();
- for (uint32_t zz = 1; zz < DIMS-1; ++zz)
- {
- for (uint32_t yy = 1; yy < DIMS-1; ++yy)
+ for (uint32_t zz = 1; zz < DIMS-1; ++zz)
{
- uint32_t offset = (zz*DIMS+yy)*DIMS;
-
- for (uint32_t xx = 1; xx < DIMS-1; ++xx)
+ for (uint32_t yy = 1; yy < DIMS-1; ++yy)
{
- uint32_t xoffset = offset + xx;
+ uint32_t offset = (zz*DIMS+yy)*DIMS;
- float normal[3] =
+ for (uint32_t xx = 1; xx < DIMS-1; ++xx)
{
- grid[xoffset-1 ].m_val - grid[xoffset+1 ].m_val,
- grid[xoffset-ypitch].m_val - grid[xoffset+ypitch].m_val,
- grid[xoffset-zpitch].m_val - grid[xoffset+zpitch].m_val,
- };
+ uint32_t xoffset = offset + xx;
+
+ Grid* grid = m_grid;
+ float normal[3] =
+ {
+ grid[xoffset-1 ].m_val - grid[xoffset+1 ].m_val,
+ grid[xoffset-ypitch].m_val - grid[xoffset+ypitch].m_val,
+ grid[xoffset-zpitch].m_val - grid[xoffset+zpitch].m_val,
+ };
- bx::vec3Norm(grid[xoffset].m_normal, normal);
+ bx::vec3Norm(grid[xoffset].m_normal, normal);
+ }
}
}
- }
-
- profNormal = bx::getHPCounter() - profNormal;
- profTriangulate = bx::getHPCounter();
+ profNormal = bx::getHPCounter() - profNormal;
- PosNormalColorVertex* vertex = (PosNormalColorVertex*)tvb.data;
+ profTriangulate = bx::getHPCounter();
- for (uint32_t zz = 0; zz < DIMS-1 && numVertices+12 < maxVertices; ++zz)
- {
- float rgb[6];
- rgb[2] = zz*invdim;
- rgb[5] = (zz+1)*invdim;
+ PosNormalColorVertex* vertex = (PosNormalColorVertex*)tvb.data;
- for (uint32_t yy = 0; yy < DIMS-1 && numVertices+12 < maxVertices; ++yy)
+ for (uint32_t zz = 0; zz < DIMS-1 && numVertices+12 < maxVertices; ++zz)
{
- uint32_t offset = (zz*DIMS+yy)*DIMS;
-
- rgb[1] = yy*invdim;
- rgb[4] = (yy+1)*invdim;
+ float rgb[6];
+ rgb[2] = zz*invdim;
+ rgb[5] = (zz+1)*invdim;
- for (uint32_t xx = 0; xx < DIMS-1 && numVertices+12 < maxVertices; ++xx)
+ for (uint32_t yy = 0; yy < DIMS-1 && numVertices+12 < maxVertices; ++yy)
{
- uint32_t xoffset = offset + xx;
+ uint32_t offset = (zz*DIMS+yy)*DIMS;
- rgb[0] = xx*invdim;
- rgb[3] = (xx+1)*invdim;
+ rgb[1] = yy*invdim;
+ rgb[4] = (yy+1)*invdim;
- float pos[3] =
+ for (uint32_t xx = 0; xx < DIMS-1 && numVertices+12 < maxVertices; ++xx)
{
- -DIMS*0.5f + float(xx),
- -DIMS*0.5f + float(yy),
- -DIMS*0.5f + float(zz)
- };
-
- const Grid* val[8] = {
- &grid[xoffset+zpitch+ypitch ],
- &grid[xoffset+zpitch+ypitch+1],
- &grid[xoffset+ypitch+1 ],
- &grid[xoffset+ypitch ],
- &grid[xoffset+zpitch ],
- &grid[xoffset+zpitch+1 ],
- &grid[xoffset+1 ],
- &grid[xoffset ],
- };
-
- uint32_t num = triangulate( (uint8_t*)vertex, PosNormalColorVertex::ms_decl.getStride(), rgb, pos, val, 0.5f);
- vertex += num;
- numVertices += num;
+ uint32_t xoffset = offset + xx;
+
+ rgb[0] = xx*invdim;
+ rgb[3] = (xx+1)*invdim;
+
+ float pos[3] =
+ {
+ -DIMS*0.5f + float(xx),
+ -DIMS*0.5f + float(yy),
+ -DIMS*0.5f + float(zz)
+ };
+
+ const Grid* grid = m_grid;
+ const Grid* val[8] = {
+ &grid[xoffset+zpitch+ypitch ],
+ &grid[xoffset+zpitch+ypitch+1],
+ &grid[xoffset+ypitch+1 ],
+ &grid[xoffset+ypitch ],
+ &grid[xoffset+zpitch ],
+ &grid[xoffset+zpitch+1 ],
+ &grid[xoffset+1 ],
+ &grid[xoffset ],
+ };
+
+ uint32_t num = triangulate( (uint8_t*)vertex, PosNormalColorVertex::ms_decl.getStride(), rgb, pos, val, 0.5f);
+ vertex += num;
+ numVertices += num;
+ }
}
}
- }
- profTriangulate = bx::getHPCounter() - profTriangulate;
+ profTriangulate = bx::getHPCounter() - profTriangulate;
+
+ float mtx[16];
+ bx::mtxRotateXY(mtx, time*0.67f, time);
- float mtx[16];
- bx::mtxRotateXY(mtx, time*0.67f, time);
+ // Set model matrix for rendering.
+ bgfx::setTransform(mtx);
- // Set model matrix for rendering.
- bgfx::setTransform(mtx);
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(&tvb, 0, numVertices);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
+ // Set render states.
+ bgfx::setState(BGFX_STATE_DEFAULT);
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(&tvb, 0, numVertices);
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
- // Set render states.
- bgfx::setState(BGFX_STATE_DEFAULT);
+ // Display stats.
+ bgfx::dbgTextPrintf(1, 4, 0x0f, "Num vertices: %5d (%6.4f%%)", numVertices, float(numVertices)/maxVertices * 100);
+ bgfx::dbgTextPrintf(1, 5, 0x0f, " Update: % 7.3f[ms]", double(profUpdate)*toMs);
+ bgfx::dbgTextPrintf(1, 6, 0x0f, "Calc normals: % 7.3f[ms]", double(profNormal)*toMs);
+ bgfx::dbgTextPrintf(1, 7, 0x0f, " Triangulate: % 7.3f[ms]", double(profTriangulate)*toMs);
+ bgfx::dbgTextPrintf(1, 8, 0x0f, " Frame: % 7.3f[ms]", double(frameTime)*toMs);
- // Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
- // Display stats.
- bgfx::dbgTextPrintf(1, 4, 0x0f, "Num vertices: %5d (%6.4f%%)", numVertices, float(numVertices)/maxVertices * 100);
- bgfx::dbgTextPrintf(1, 5, 0x0f, " Update: % 7.3f[ms]", double(profUpdate)*toMs);
- bgfx::dbgTextPrintf(1, 6, 0x0f, "Calc normals: % 7.3f[ms]", double(profNormal)*toMs);
- bgfx::dbgTextPrintf(1, 7, 0x0f, " Triangulate: % 7.3f[ms]", double(profTriangulate)*toMs);
- bgfx::dbgTextPrintf(1, 8, 0x0f, " Frame: % 7.3f[ms]", double(frameTime)*toMs);
+ return true;
+ }
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- delete [] grid;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ bgfx::ProgramHandle m_program;
- // Cleanup.
- bgfx::destroyProgram(program);
+ Grid* m_grid;
+ int64_t m_timeOffset;
- // Shutdown bgfx.
- bgfx::shutdown();
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(Metaballs);
diff --git a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
index 27f05cafb85..70f3e56b654 100644
--- a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
+++ b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.bin.h
@@ -1,8 +1,8 @@
static const uint8_t vs_metaballs_glsl[537] =
{
- 0x56, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
- 0x65, 0x6c, 0x09, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model
- 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe6, 0x01, // ViewProj........
+ 0x56, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe6, 0x01, // ViewProj........
0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ..attribute high
0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // p vec4 a_color0;
0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // .attribute highp
@@ -37,9 +37,9 @@ static const uint8_t vs_metaballs_glsl[537] =
};
static const uint8_t vs_metaballs_dx9[457] =
{
- 0x56, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
- 0x65, 0x6c, 0x09, 0x20, 0x04, 0x00, 0x03, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
- 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, 0x98, 0x01, // ViewProj........
+ 0x56, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x03, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x98, 0x01, // ViewProj........
0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2e, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, // ........CTAB....
0x83, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, // ................
0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, // ....|...D.......
@@ -69,9 +69,9 @@ static const uint8_t vs_metaballs_dx9[457] =
};
static const uint8_t vs_metaballs_dx11[726] =
{
- 0x56, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
- 0x65, 0x6c, 0x09, 0x20, 0x00, 0x00, 0x80, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
- 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x08, 0x04, 0x00, 0x9c, 0x02, // ViewProj........
+ 0x56, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod
+ 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model
+ 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x9c, 0x02, // ViewProj........
0x44, 0x58, 0x42, 0x43, 0xc6, 0x4d, 0x04, 0x38, 0x93, 0x20, 0x89, 0x1c, 0xbe, 0x68, 0xbc, 0xd4, // DXBC.M.8. ...h..
0xee, 0x2f, 0x8a, 0xe9, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ./..............
0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN
@@ -116,3 +116,60 @@ static const uint8_t vs_metaballs_dx11[726] =
0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, // F.......>.......
0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ....@.
};
+static const uint8_t vs_metaballs_mtl[855] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00, 0x75, 0x73, // VSH..,.?..H...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // normal [[attribu
+ 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // te(1)]];. float
+ 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, // 3 a_position [[a
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, // ttribute(2)]];.}
+ 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ;.struct xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, // ShaderOutput {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, // float4 gl_Posit
+ 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, // ion [[position]]
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ;. float4 v_col
+ 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, // or0;. float3 v_
+ 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // normal;.};.struc
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, // t xlatMtlShaderU
+ 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // niform {. float
+ 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, // 4x4 u_model[32];
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, // . float4x4 u_mo
+ 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // delViewProj;.};.
+ 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // vertex xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // aderOutput xlatM
+ 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // tlMain (xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // haderInput _mtl_
+ 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, // i [[stage_in]],
+ 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // constant xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, // ShaderUniform& _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, // mtl_u [[buffer(0
+ 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // )]]).{. xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, // ShaderOutput _mt
+ 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, // l_o;. float4 tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_1;. tmpvar
+ 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // _1.w = 1.0;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, // pvar_1.xyz = _mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // l_i.a_position;.
+ 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // _mtl_o.gl_Posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // tion = (_mtl_u.u
+ 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, // _modelViewProj *
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // tmpvar_1);. fl
+ 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, // oat4 tmpvar_2;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x30, 0x2e, // tmpvar_2.w = 0.
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, // 0;. tmpvar_2.xy
+ 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x6e, 0x6f, 0x72, // z = _mtl_i.a_nor
+ 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, // mal;. _mtl_o.v_
+ 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // normal = (_mtl_u
+ 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x20, 0x2a, 0x20, 0x74, 0x6d, // .u_model[0] * tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // pvar_2).xyz;. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // mtl_o.v_color0 =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // _mtl_i.a_color0
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ;. return _mtl_
+ 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // o;.}...
+};
diff --git a/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc b/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
index 56adfd1a7bc..d58ff1f7a2e 100644
--- a/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
+++ b/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
@@ -15,9 +15,11 @@ $input v_color0, v_texcoord0
#include "../common/common.sh"
#include "iq_sdf.sh"
-uniform float u_time;
uniform mat4 u_mtx;
-uniform vec3 u_lightDir;
+uniform vec4 u_lightDirTime;
+
+#define u_lightDir u_lightDirTime.xyz
+#define u_time u_lightDirTime.w
float sceneDist(vec3 _pos)
{
diff --git a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
index 44fc390929d..7fd619db9fa 100644
--- a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
+++ b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
@@ -95,11 +95,10 @@ void renderScreenSpaceQuad(uint32_t _view, bgfx::ProgramHandle _program, float _
indices[4] = 3;
indices[5] = 2;
- bgfx::setProgram(_program);
bgfx::setState(BGFX_STATE_DEFAULT);
bgfx::setIndexBuffer(&tib);
bgfx::setVertexBuffer(&tvb);
- bgfx::submit(_view);
+ bgfx::submit(_view, _program);
}
}
@@ -124,7 +123,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, 0
);
- // Setup root path for binary shaders. Shader binaries are different
+ // Setup root path for binary shaders. Shader binaries are different
// for each renderer.
switch (bgfx::getRendererType() )
{
@@ -140,9 +139,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Create vertex stream declaration.
PosColorTexCoord0Vertex::init();
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
- bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
- bgfx::UniformHandle u_lightDir = bgfx::createUniform("u_lightDir", bgfx::UniformType::Uniform3fv);
+ bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ bgfx::UniformHandle u_lightDirTime = bgfx::createUniform("u_lightDirTime", bgfx::UniformType::Vec4);
// Create program from shaders.
bgfx::ProgramHandle raymarching = loadProgram("vs_raymarching", "fs_raymarching");
@@ -159,7 +157,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to viewZ 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -176,7 +174,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
float at[3] = { 0.0f, 0.0f, 0.0f };
float eye[3] = { 0.0f, 0.0f, -15.0f };
-
+
float view[16];
float proj[16];
bx::mtxLookAt(view, eye, at);
@@ -200,16 +198,17 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bx::mtxRotateXY(mtx
, time
, time*0.37f
- );
+ );
float mtxInv[16];
bx::mtxInverse(mtxInv, mtx);
float lightDirModel[4] = { -0.4f, -0.5f, -1.0f, 0.0f };
float lightDirModelN[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
bx::vec3Norm(lightDirModelN, lightDirModel);
- float lightDir[4];
- bx::vec4MulMtx(lightDir, lightDirModelN, mtxInv);
- bgfx::setUniform(u_lightDir, lightDir);
+ float lightDirTime[4];
+ bx::vec4MulMtx(lightDirTime, lightDirModelN, mtxInv);
+ lightDirTime[3] = time;
+ bgfx::setUniform(u_lightDirTime, lightDirTime);
float mvp[16];
bx::mtxMul(mvp, mtx, vp);
@@ -218,11 +217,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bx::mtxInverse(invMvp, mvp);
bgfx::setUniform(u_mtx, invMvp);
- bgfx::setUniform(u_time, &time);
-
renderScreenSpaceQuad(1, raymarching, 0.0f, 0.0f, 1280.0f, 720.0f);
- // Advance to next frame. Rendering thread will be kicked to
+ // Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}
@@ -230,9 +227,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Cleanup.
bgfx::destroyProgram(raymarching);
- bgfx::destroyUniform(u_time);
bgfx::destroyUniform(u_mtx);
- bgfx::destroyUniform(u_lightDir);
+ bgfx::destroyUniform(u_lightDirTime);
// Shutdown bgfx.
bgfx::shutdown();
diff --git a/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc b/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
index 243ec1e7ded..5ee47bf9182 100644
--- a/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
+++ b/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
@@ -7,7 +7,7 @@ $input v_pos, v_view, v_normal, v_color0
#include "../common/common.sh"
-uniform float u_time;
+uniform vec4 u_time;
vec2 blinn(vec3 _lightDir, vec3 _normal, vec3 _viewDir)
{
@@ -39,9 +39,9 @@ void main()
vec4 lc = lit(bln.x, bln.y, 1.0);
float fres = fresnel(bln.x, 0.2, 5.0);
- float index = ( (sin(v_pos.x*3.0+u_time)*0.3+0.7)
- + ( cos(v_pos.y*3.0+u_time)*0.4+0.6)
- + ( cos(v_pos.z*3.0+u_time)*0.2+0.8)
+ float index = ( (sin(v_pos.x*3.0+u_time.x)*0.3+0.7)
+ + ( cos(v_pos.y*3.0+u_time.x)*0.4+0.6)
+ + ( cos(v_pos.z*3.0+u_time.x)*0.2+0.8)
)*M_PI;
vec3 color = vec3(sin(index*8.0)*0.4 + 0.6
diff --git a/3rdparty/bgfx/examples/04-mesh/mesh.cpp b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
index 04a36cbaad1..bf4c4269333 100644
--- a/3rdparty/bgfx/examples/04-mesh/mesh.cpp
+++ b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
@@ -27,7 +27,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, 0
);
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
+ bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
// Create program from shaders.
bgfx::ProgramHandle program = loadProgram("vs_mesh", "fs_mesh");
@@ -43,7 +43,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -65,7 +65,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
@@ -98,11 +98,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bx::mtxRotateXY(mtx
, 0.0f
, time*0.37f
- );
+ );
meshSubmit(mesh, 0, program, mtx);
- // Advance to next frame. Rendering thread will be kicked to
+ // Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}
diff --git a/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc b/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
index 84ab2527386..ba9a3069515 100644
--- a/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
+++ b/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
@@ -8,14 +8,14 @@ $output v_pos, v_view, v_normal, v_color0
#include "../common/common.sh"
-uniform float u_time;
+uniform vec4 u_time;
void main()
{
vec3 pos = a_position;
- float sx = sin(pos.x*32.0+u_time*4.0)*0.5+0.5;
- float cy = cos(pos.y*32.0+u_time*4.0)*0.5+0.5;
+ float sx = sin(pos.x*32.0+u_time.x*4.0)*0.5+0.5;
+ float cy = cos(pos.y*32.0+u_time.x*4.0)*0.5+0.5;
vec3 displacement = vec3(sx, cy, sx*cy);
vec3 normal = a_normal.xyz*2.0 - 1.0;
diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
index bac9b68547f..2313adccabd 100644
--- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp
+++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
@@ -104,7 +104,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -135,7 +135,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
@@ -191,9 +191,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
}
}
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
@@ -205,7 +202,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ bgfx::submit(0, program);
}
}
diff --git a/3rdparty/bgfx/examples/06-bump/bump.cpp b/3rdparty/bgfx/examples/06-bump/bump.cpp
index e5c4a521876..1cbf74592de 100644
--- a/3rdparty/bgfx/examples/06-bump/bump.cpp
+++ b/3rdparty/bgfx/examples/06-bump/bump.cpp
@@ -103,259 +103,286 @@ static const uint16_t s_cubeIndices[36] =
21, 23, 22,
};
-int _main_(int /*_argc*/, char** /*_argv*/)
+class Bump : public entry::AppI
{
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
-
- bgfx::init();
- bgfx::reset(width, height, reset);
-
- // Enable debug text.
- bgfx::setDebug(debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- // Get renderer capabilities info.
- const bgfx::Caps* caps = bgfx::getCaps();
- bool instancingSupported = 0 != (caps->supported & BGFX_CAPS_INSTANCING);
-
- // Create vertex stream declaration.
- PosNormalTangentTexcoordVertex::init();
-
- calcTangents(s_cubeVertices
- , BX_COUNTOF(s_cubeVertices)
- , PosNormalTangentTexcoordVertex::ms_decl
- , s_cubeIndices
- , BX_COUNTOF(s_cubeIndices)
- );
-
- // Create static vertex buffer.
- bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(
- bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
- , PosNormalTangentTexcoordVertex::ms_decl
- );
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
+ {
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
+
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Get renderer capabilities info.
+ const bgfx::Caps* caps = bgfx::getCaps();
+ m_instancingSupported = 0 != (caps->supported & BGFX_CAPS_INSTANCING);
+
+ // Create vertex stream declaration.
+ PosNormalTangentTexcoordVertex::init();
+
+ calcTangents(s_cubeVertices
+ , BX_COUNTOF(s_cubeVertices)
+ , PosNormalTangentTexcoordVertex::ms_decl
+ , s_cubeIndices
+ , BX_COUNTOF(s_cubeIndices)
+ );
+
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosNormalTangentTexcoordVertex::ms_decl
+ );
+
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
+
+ // Create texture sampler uniforms.
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1);
+
+ m_numLights = 4;
+ u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4, m_numLights);
+ u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Vec4, m_numLights);
+
+ // Create program from shaders.
+ m_program = loadProgram(m_instancingSupported ? "vs_bump_instanced" : "vs_bump", "fs_bump");
+
+ // Load diffuse texture.
+ m_textureColor = loadTexture("fieldstone-rgba.dds");
+
+ // Load normal texture.
+ m_textureNormal = loadTexture("fieldstone-n.dds");
+
+ m_timeOffset = bx::getHPCounter();
+ }
- // Create static index buffer.
- bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
+ virtual int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ bgfx::destroyProgram(m_program);
+ bgfx::destroyTexture(m_textureColor);
+ bgfx::destroyTexture(m_textureNormal);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texNormal);
+ bgfx::destroyUniform(u_lightPosRadius);
+ bgfx::destroyUniform(u_lightRgbInnerR);
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
- // Create texture sampler uniforms.
- bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_texNormal = bgfx::createUniform("u_texNormal", bgfx::UniformType::Uniform1iv);
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset) )
+ {
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
- uint16_t numLights = 4;
- bgfx::UniformHandle u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Uniform4fv, numLights);
- bgfx::UniformHandle u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Uniform4fv, numLights);
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
- // Create program from shaders.
- bgfx::ProgramHandle program = loadProgram(instancingSupported ? "vs_bump_instanced" : "vs_bump", "fs_bump");
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
- // Load diffuse texture.
- bgfx::TextureHandle textureColor = loadTexture("fieldstone-rgba.dds");
+ float time = (float)( (now-m_timeOffset)/freq);
- // Load normal texture.
- bgfx::TextureHandle textureNormal = loadTexture("fieldstone-n.dds");
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/06-bump");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Loading textures.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
- int64_t timeOffset = bx::getHPCounter();
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -7.0f };
- while (!entry::processEvents(width, height, debug, reset) )
- {
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
-
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
-
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
-
- float time = (float)( (now-timeOffset)/freq);
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/06-bump");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Loading textures.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -7.0f };
-
- // Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
- {
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
+ // Set view and projection matrix for view 0.
+ const bgfx::HMD* hmd = bgfx::getHMD();
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
+ {
+ float view[16];
+ bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
- float proj[16];
- bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
+ float proj[16];
+ bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ bgfx::setViewTransform(0, view, proj);
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
- }
- else
- {
- float view[16];
- bx::mtxLookAt(view, eye, at);
+ // Set view 0 default viewport.
+ //
+ // Use HMD's width/height since HMD's internal frame buffer size
+ // might be much larger than window size.
+ bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
+ }
+ else
+ {
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
- bgfx::setViewTransform(0, view, proj);
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+ bgfx::setViewTransform(0, view, proj);
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
- }
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
+ }
- float lightPosRadius[4][4];
- for (uint32_t ii = 0; ii < numLights; ++ii)
- {
- lightPosRadius[ii][0] = sinf( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f;
- lightPosRadius[ii][1] = cosf( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f;
- lightPosRadius[ii][2] = -2.5f;
- lightPosRadius[ii][3] = 3.0f;
- }
+ float lightPosRadius[4][4];
+ for (uint32_t ii = 0; ii < m_numLights; ++ii)
+ {
+ lightPosRadius[ii][0] = sinf( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f;
+ lightPosRadius[ii][1] = cosf( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f;
+ lightPosRadius[ii][2] = -2.5f;
+ lightPosRadius[ii][3] = 3.0f;
+ }
- bgfx::setUniform(u_lightPosRadius, lightPosRadius, numLights);
+ bgfx::setUniform(u_lightPosRadius, lightPosRadius, m_numLights);
- float lightRgbInnerR[4][4] =
- {
- { 1.0f, 0.7f, 0.2f, 0.8f },
- { 0.7f, 0.2f, 1.0f, 0.8f },
- { 0.2f, 1.0f, 0.7f, 0.8f },
- { 1.0f, 0.4f, 0.2f, 0.8f },
- };
+ float lightRgbInnerR[4][4] =
+ {
+ { 1.0f, 0.7f, 0.2f, 0.8f },
+ { 0.7f, 0.2f, 1.0f, 0.8f },
+ { 0.2f, 1.0f, 0.7f, 0.8f },
+ { 1.0f, 0.4f, 0.2f, 0.8f },
+ };
- bgfx::setUniform(u_lightRgbInnerR, lightRgbInnerR, numLights);
+ bgfx::setUniform(u_lightRgbInnerR, lightRgbInnerR, m_numLights);
- const uint16_t instanceStride = 64;
- const uint16_t numInstances = 3;
+ const uint16_t instanceStride = 64;
+ const uint16_t numInstances = 3;
- if (instancingSupported)
- {
- // Write instance data for 3x3 cubes.
- for (uint32_t yy = 0; yy < 3; ++yy)
+ if (m_instancingSupported)
{
- const bgfx::InstanceDataBuffer* idb = bgfx::allocInstanceDataBuffer(numInstances, instanceStride);
- if (NULL != idb)
+ // Write instance data for 3x3 cubes.
+ for (uint32_t yy = 0; yy < 3; ++yy)
+ {
+ const bgfx::InstanceDataBuffer* idb = bgfx::allocInstanceDataBuffer(numInstances, instanceStride);
+ if (NULL != idb)
+ {
+ uint8_t* data = idb->data;
+
+ for (uint32_t xx = 0; xx < 3; ++xx)
+ {
+ float* mtx = (float*)data;
+ bx::mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
+ mtx[12] = -3.0f + float(xx)*3.0f;
+ mtx[13] = -3.0f + float(yy)*3.0f;
+ mtx[14] = 0.0f;
+
+ data += instanceStride;
+ }
+
+ // Set instance data buffer.
+ bgfx::setInstanceDataBuffer(idb, numInstances);
+
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
+
+ // Bind textures.
+ bgfx::setTexture(0, s_texColor, m_textureColor);
+ bgfx::setTexture(1, s_texNormal, m_textureNormal);
+
+ // Set render states.
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_MSAA
+ );
+
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
+ }
+ }
+ }
+ else
+ {
+ for (uint32_t yy = 0; yy < 3; ++yy)
{
- uint8_t* data = idb->data;
-
for (uint32_t xx = 0; xx < 3; ++xx)
{
- float* mtx = (float*)data;
+ float mtx[16];
bx::mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
mtx[12] = -3.0f + float(xx)*3.0f;
mtx[13] = -3.0f + float(yy)*3.0f;
mtx[14] = 0.0f;
- data += instanceStride;
- }
-
- // Set instance data buffer.
- bgfx::setInstanceDataBuffer(idb, numInstances);
+ // Set transform for draw call.
+ bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
+ // Bind textures.
+ bgfx::setTexture(0, s_texColor, m_textureColor);
+ bgfx::setTexture(1, s_texNormal, m_textureNormal);
- // Bind textures.
- bgfx::setTexture(0, u_texColor, textureColor);
- bgfx::setTexture(1, u_texNormal, textureNormal);
+ // Set render states.
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_MSAA
+ );
- // Set render states.
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_DEPTH_WRITE
- | BGFX_STATE_DEPTH_TEST_LESS
- | BGFX_STATE_MSAA
- );
-
- // Submit primitive for rendering to view 0.
- bgfx::submit(0);
- }
- }
- }
- else
- {
- for (uint32_t yy = 0; yy < 3; ++yy)
- {
- for (uint32_t xx = 0; xx < 3; ++xx)
- {
- float mtx[16];
- bx::mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
- mtx[12] = -3.0f + float(xx)*3.0f;
- mtx[13] = -3.0f + float(yy)*3.0f;
- mtx[14] = 0.0f;
-
- // Set transform for draw call.
- bgfx::setTransform(mtx);
-
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
-
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
-
- // Bind textures.
- bgfx::setTexture(0, u_texColor, textureColor);
- bgfx::setTexture(1, u_texNormal, textureNormal);
-
- // Set render states.
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_DEPTH_WRITE
- | BGFX_STATE_DEPTH_TEST_LESS
- | BGFX_STATE_MSAA
- );
-
- // Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
+ }
}
}
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
}
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- // Cleanup.
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
- bgfx::destroyProgram(program);
- bgfx::destroyTexture(textureColor);
- bgfx::destroyTexture(textureNormal);
- bgfx::destroyUniform(u_texColor);
- bgfx::destroyUniform(u_texNormal);
- bgfx::destroyUniform(u_lightPosRadius);
- bgfx::destroyUniform(u_lightRgbInnerR);
-
- // Shutdown bgfx.
- bgfx::shutdown();
-
- return 0;
-}
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+ bgfx::UniformHandle s_texColor;
+ bgfx::UniformHandle s_texNormal;
+ bgfx::UniformHandle u_lightPosRadius;
+ bgfx::UniformHandle u_lightRgbInnerR;
+ bgfx::ProgramHandle m_program;
+ bgfx::TextureHandle m_textureColor;
+ bgfx::TextureHandle m_textureNormal;
+ uint16_t m_numLights;
+ bool m_instancingSupported;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ int64_t m_timeOffset;
+};
+
+ENTRY_IMPLEMENT_MAIN(Bump);
diff --git a/3rdparty/bgfx/examples/06-bump/fs_bump.sc b/3rdparty/bgfx/examples/06-bump/fs_bump.sc
index 59f3a0f90f8..f5806ebe30e 100644
--- a/3rdparty/bgfx/examples/06-bump/fs_bump.sc
+++ b/3rdparty/bgfx/examples/06-bump/fs_bump.sc
@@ -7,8 +7,8 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 // in...
#include "../common/common.sh"
-SAMPLER2D(u_texColor, 0);
-SAMPLER2D(u_texNormal, 1);
+SAMPLER2D(s_texColor, 0);
+SAMPLER2D(s_texNormal, 1);
uniform vec4 u_lightPosRadius[4];
uniform vec4 u_lightRgbInnerR[4];
@@ -61,7 +61,7 @@ void main()
);
vec3 normal;
- normal.xy = texture2D(u_texNormal, v_texcoord0).xy * 2.0 - 1.0;
+ normal.xy = texture2D(s_texNormal, v_texcoord0).xy * 2.0 - 1.0;
normal.z = sqrt(1.0 - dot(normal.xy, normal.xy) );
vec3 view = -normalize(v_view);
@@ -71,7 +71,7 @@ void main()
lightColor += calcLight(2, tbn, v_wpos, normal, view);
lightColor += calcLight(3, tbn, v_wpos, normal, view);
- vec4 color = toLinear(texture2D(u_texColor, v_texcoord0) );
+ vec4 color = toLinear(texture2D(s_texColor, v_texcoord0) );
gl_FragColor.xyz = max(vec3_splat(0.05), lightColor.xyz)*color.xyz;
gl_FragColor.w = 1.0;
diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp
index 3caec753fed..fa0b0329d88 100644
--- a/3rdparty/bgfx/examples/07-callback/callback.cpp
+++ b/3rdparty/bgfx/examples/07-callback/callback.cpp
@@ -136,10 +136,16 @@ struct BgfxCallback : public bgfx::CallbackI
abort();
}
+ virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) BX_OVERRIDE
+ {
+ dbgPrintf("%s (%d): ", _filePath, _line);
+ dbgPrintfVargs(_format, _argList);
+ }
+
virtual uint32_t cacheReadSize(uint64_t _id) BX_OVERRIDE
{
char filePath[256];
- bx::snprintf(filePath, sizeof(filePath), "%016" PRIx64, _id);
+ bx::snprintf(filePath, sizeof(filePath), "temp/%016" PRIx64, _id);
// Use cache id as filename.
FILE* file = fopen(filePath, "rb");
@@ -417,7 +423,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -469,9 +475,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
@@ -480,7 +483,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ bgfx::submit(0, program);
}
}
diff --git a/3rdparty/bgfx/examples/08-update/fs_update.sc b/3rdparty/bgfx/examples/08-update/fs_update.sc
index 8e1ec202504..2e0313dca30 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update.sc
@@ -7,9 +7,9 @@ $input v_texcoord0
#include "../common/common.sh"
-SAMPLERCUBE(u_texCube, 0);
+SAMPLERCUBE(s_texCube, 0);
void main()
{
- gl_FragColor = textureCube(u_texCube, v_texcoord0);
+ gl_FragColor = textureCube(s_texCube, v_texcoord0);
}
diff --git a/3rdparty/bgfx/examples/08-update/fs_update_3d.sc b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
index dad87e9cfdb..f99f994f7a9 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
@@ -7,11 +7,11 @@ $input v_texcoord0
#include "../common/common.sh"
-SAMPLER3D(u_texColor, 0);
-uniform float u_time;
+SAMPLER3D(s_texColor, 0);
+uniform vec4 u_time;
void main()
{
- vec3 uvw = vec3(v_texcoord0.xy*0.5+0.5, sin(u_time)*0.5+0.5);
- gl_FragColor = vec4_splat(texture3D(u_texColor, uvw).x);
+ vec3 uvw = vec3(v_texcoord0.xy*0.5+0.5, sin(u_time.x)*0.5+0.5);
+ gl_FragColor = vec4_splat(texture3D(s_texColor, uvw).x);
}
diff --git a/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc b/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
index d5792bbdf83..daf378ba08e 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
@@ -7,9 +7,9 @@ $input v_texcoord0
#include "../common/common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- gl_FragColor = texture2D(u_texColor, v_texcoord0.xy*0.5+0.5);
+ gl_FragColor = texture2D(s_texColor, v_texcoord0.xy*0.5+0.5);
}
diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp
index 38486b9b3e3..51bd8c0213d 100644
--- a/3rdparty/bgfx/examples/08-update/update.cpp
+++ b/3rdparty/bgfx/examples/08-update/update.cpp
@@ -138,10 +138,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::TextureHandle textures[] =
{
- loadTexture("texture_compression_bc1.dds", BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP),
- loadTexture("texture_compression_bc2.dds", BGFX_TEXTURE_U_CLAMP),
- loadTexture("texture_compression_bc3.dds", BGFX_TEXTURE_V_CLAMP),
- loadTexture("texture_compression_etc1.ktx"),
+ loadTexture("texture_compression_bc1.dds", BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP),
+ loadTexture("texture_compression_bc2.dds", BGFX_TEXTURE_U_CLAMP),
+ loadTexture("texture_compression_bc3.dds", BGFX_TEXTURE_V_CLAMP),
+ loadTexture("texture_compression_etc1.ktx", BGFX_TEXTURE_U_BORDER|BGFX_TEXTURE_V_BORDER|BGFX_TEXTURE_BORDER_COLOR(1) ),
loadTexture("texture_compression_etc2.ktx"),
loadTexture("texture_compression_ptc12.pvr"),
loadTexture("texture_compression_ptc14.pvr"),
@@ -197,20 +197,22 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Create static index buffer.
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
- // Create texture sampler uniforms.
- bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
-
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
-
- bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update");
- bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp");
- bgfx::ProgramHandle program3d = BGFX_INVALID_HANDLE;
+ // Create programs.
+ bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update");
+ bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp");
+ bgfx::ProgramHandle program3d = BGFX_INVALID_HANDLE;
if (texture3DSupported)
{
program3d = loadProgram("vs_update", "fs_update_3d");
}
+ // Create texture sampler uniforms.
+ bgfx::UniformHandle s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1);
+ bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+
+ // Create time uniform.
+ bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
+
const uint32_t textureSide = 2048;
bgfx::TextureHandle textureCube = bgfx::createTextureCube(textureSide, 1
@@ -243,13 +245,16 @@ int _main_(int /*_argc*/, char** /*_argv*/)
while (!entry::processEvents(width, height, debug, reset) )
{
+ float borderColor[4] = { float(rand()%255)/255.0f, float(rand()%255)/255.0f, float(rand()%255)/255.0f, float(rand()%255)/255.0f };
+ bgfx::setPaletteColor(1, borderColor);
+
// Set view 0 and 1 viewport.
bgfx::setViewRect(0, 0, 0, width, height);
bgfx::setViewRect(1, 0, 0, width, height);
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -348,123 +353,108 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
// Bind texture.
- bgfx::setTexture(0, u_texCube, textureCube);
+ bgfx::setTexture(0, s_texCube, textureCube);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ bgfx::submit(0, program);
// Set view and projection matrix for view 1.
const float aspectRatio = float(height)/float(width);
- const float size = 10.0f;
+ const float size = 11.0f;
bx::mtxOrtho(proj, -size, size, size*aspectRatio, -size*aspectRatio, 0.0f, 1000.0f);
bgfx::setViewTransform(1, NULL, proj);
- bx::mtxTranslate(mtx, -8.0f - BX_COUNTOF(textures)*0.1f*0.5f, 1.9f, 0.0f);
+ bx::mtxTranslate(mtx, -size+2.0f - BX_COUNTOF(textures)*0.1f*0.5f, 1.9f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(programCmp);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
// Bind texture.
- bgfx::setTexture(0, u_texColor, texture2d);
+ bgfx::setTexture(0, s_texColor, texture2d);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 1.
- bgfx::submit(1);
+ bgfx::submit(1, programCmp);
- const float xpos = -8.0f - BX_COUNTOF(textures)*0.1f*0.5f;
+ const float xpos = -size+2.0f - BX_COUNTOF(textures)*0.1f*0.5f;
for (uint32_t ii = 0; ii < BX_COUNTOF(textures); ++ii)
{
- bx::mtxTranslate(mtx, xpos + ii*2.1f, 4.0f, 0.0f);
+ bx::mtxTranslate(mtx, xpos + ii*2.1f, size-6.5f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(programCmp);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh, 0, 6);
// Bind texture.
- bgfx::setTexture(0, u_texColor, textures[ii]);
+ bgfx::setTexture(0, s_texColor, textures[ii]);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 1.
- bgfx::submit(1);
+ bgfx::submit(1, programCmp);
}
for (uint32_t ii = 0; ii < numTextures3d; ++ii)
{
- bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f);
+ bx::mtxTranslate(mtx, xpos + ii*2.1f, -size+6.5f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program3d);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh, 0, 6);
// Bind texture.
- bgfx::setTexture(0, u_texColor, textures3d[ii]);
+ bgfx::setTexture(0, s_texColor, textures3d[ii]);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 1.
- bgfx::submit(1);
+ bgfx::submit(1, program3d);
}
- for (uint32_t ii = 0; ii < 3; ++ii)
+ for (uint32_t ii = 0; ii < 4; ++ii)
{
- bx::mtxTranslate(mtx, xpos + 8*2.1f, -4.0f + ii*2.1f, 0.0f);
+ bx::mtxTranslate(mtx, xpos + (size-2.0f)*2.1f, -size+6.5f + ii*2.1f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(programCmp);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh, 24, 4);
bgfx::setIndexBuffer(ibh, 0, 6);
// Bind texture.
- bgfx::setTexture(0, u_texColor, textures[ii]);
+ bgfx::setTexture(0, s_texColor, textures[ii]);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 1.
- bgfx::submit(1);
+ bgfx::submit(1, programCmp);
}
// Advance to next frame. Rendering thread will be kicked to
@@ -501,8 +491,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::destroyProgram(programCmp);
bgfx::destroyProgram(program);
bgfx::destroyUniform(u_time);
- bgfx::destroyUniform(u_texColor);
- bgfx::destroyUniform(u_texCube);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texCube);
// Shutdown bgfx.
bgfx::shutdown();
diff --git a/3rdparty/bgfx/examples/09-hdr/common.sh b/3rdparty/bgfx/examples/09-hdr/common.sh
index 2d7324c9071..8ed16af170d 100644
--- a/3rdparty/bgfx/examples/09-hdr/common.sh
+++ b/3rdparty/bgfx/examples/09-hdr/common.sh
@@ -7,6 +7,7 @@
uniform vec4 u_offset[16];
uniform vec4 u_tonemap;
+#define u_time u_tonemap.w
float reinhard(float _x)
{
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
index d5c950c8c4c..0b236460b96 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
@@ -7,9 +7,9 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
#include "common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- gl_FragColor = blur9(u_texColor, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4);
+ gl_FragColor = blur9(s_texColor, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4);
}
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
index 9ec9b1bb7d3..411970a9985 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
@@ -7,23 +7,23 @@ $input v_texcoord0
#include "common.sh"
-SAMPLER2D(u_texColor, 0);
-SAMPLER2D(u_texLum, 1);
+SAMPLER2D(s_texColor, 0);
+SAMPLER2D(s_texLum, 1);
void main()
{
- float lum = clamp(decodeRE8(texture2D(u_texLum, v_texcoord0) ), 0.1, 0.7);
+ float lum = clamp(decodeRE8(texture2D(s_texLum, v_texcoord0) ), 0.1, 0.7);
vec3 rgb = vec3(0.0, 0.0, 0.0);
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[0].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[1].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[2].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[3].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[4].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[5].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[6].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[7].xy) );
- rgb += decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[8].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[0].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[1].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[2].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[3].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[4].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[5].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[6].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[7].xy) );
+ rgb += decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[8].xy) );
rgb *= 1.0/9.0;
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
index d86eedd1f0f..4a2c355d65c 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
@@ -7,21 +7,21 @@ $input v_texcoord0
#include "common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
float delta = 0.0001;
- vec3 rgb0 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[0].xy) );
- vec3 rgb1 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[1].xy) );
- vec3 rgb2 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[2].xy) );
- vec3 rgb3 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[3].xy) );
- vec3 rgb4 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[4].xy) );
- vec3 rgb5 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[5].xy) );
- vec3 rgb6 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[6].xy) );
- vec3 rgb7 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[7].xy) );
- vec3 rgb8 = decodeRGBE8(texture2D(u_texColor, v_texcoord0+u_offset[8].xy) );
+ vec3 rgb0 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[0].xy) );
+ vec3 rgb1 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[1].xy) );
+ vec3 rgb2 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[2].xy) );
+ vec3 rgb3 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[3].xy) );
+ vec3 rgb4 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[4].xy) );
+ vec3 rgb5 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[5].xy) );
+ vec3 rgb6 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[6].xy) );
+ vec3 rgb7 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[7].xy) );
+ vec3 rgb8 = decodeRGBE8(texture2D(s_texColor, v_texcoord0+u_offset[8].xy) );
float avg = luma(rgb0).x
+ luma(rgb1).x
+ luma(rgb2).x
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
index 71545dcf3a8..f533d7100a7 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
@@ -7,27 +7,27 @@ $input v_texcoord0
#include "common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
float sum;
- sum = decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 0].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 1].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 2].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 3].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 4].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 5].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 6].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 7].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 8].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[ 9].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[10].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[11].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[12].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[13].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[14].xy) );
- sum += decodeRE8(texture2D(u_texColor, v_texcoord0+u_offset[15].xy) );
+ sum = decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 0].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 1].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 2].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 3].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 4].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 5].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 6].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 7].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 8].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[ 9].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[10].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[11].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[12].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[13].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[14].xy) );
+ sum += decodeRE8(texture2D(s_texColor, v_texcoord0+u_offset[15].xy) );
float avg = sum/16.0;
gl_FragColor = encodeRE8(avg);
}
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
index 0dc406853fd..3e6b5be2986 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
@@ -7,8 +7,7 @@ $input v_pos, v_view, v_normal
#include "common.sh"
-uniform float u_time;
-SAMPLERCUBE(u_texCube, 0);
+SAMPLERCUBE(s_texCube, 0);
vec2 blinn(vec3 _lightDir, vec3 _normal, vec3 _viewDir)
{
@@ -50,7 +49,7 @@ void main()
, sin(index*2.0)*0.4 + 0.6
);
- color *= textureCube(u_texCube, reflect(view, -normal) ).xyz;
+ color *= textureCube(s_texCube, reflect(view, -normal) ).xyz;
gl_FragColor = encodeRGBE8(color.xyz*lc.y + fres*pow(lc.z, 128.0) );
}
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
index e4f5e1e287d..7439322791c 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
@@ -7,12 +7,12 @@ $input v_texcoord0
#include "common.sh"
-SAMPLERCUBE(u_texCube, 0);
+SAMPLERCUBE(s_texCube, 0);
uniform mat4 u_mtx;
void main()
{
vec3 dir = vec3(v_texcoord0*2.0 - 1.0, 1.0);
dir = normalize(mul(u_mtx, vec4(dir, 0.0) ).xyz);
- gl_FragColor = encodeRGBE8(textureCube(u_texCube, dir).xyz);
+ gl_FragColor = encodeRGBE8(textureCube(s_texCube, dir).xyz);
}
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
index 79cff7adde9..62a071c0e0a 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
@@ -7,14 +7,14 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
#include "common.sh"
-SAMPLER2D(u_texColor, 0);
-SAMPLER2D(u_texLum, 1);
-SAMPLER2D(u_texBlur, 2);
+SAMPLER2D(s_texColor, 0);
+SAMPLER2D(s_texLum, 1);
+SAMPLER2D(s_texBlur, 2);
void main()
{
- vec3 rgb = decodeRGBE8(texture2D(u_texColor, v_texcoord0) );
- float lum = clamp(decodeRE8(texture2D(u_texLum, v_texcoord0) ), 0.1, 0.7);
+ vec3 rgb = decodeRGBE8(texture2D(s_texColor, v_texcoord0) );
+ float lum = clamp(decodeRE8(texture2D(s_texLum, v_texcoord0) ), 0.1, 0.7);
vec3 Yxy = convertRGB2Yxy(rgb);
@@ -28,7 +28,7 @@ void main()
rgb = convertYxy2RGB(Yxy);
- vec4 blur = blur9(u_texBlur
+ vec4 blur = blur9(s_texBlur
, v_texcoord0
, v_texcoord1
, v_texcoord2
diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
index f8ccb29aa19..9ad7eb5aeca 100644
--- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp
+++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
@@ -139,354 +139,394 @@ inline float square(float _x)
return _x*_x;
}
-int _main_(int /*_argc*/, char** /*_argv*/)
+class HDR : public entry::AppI
{
- PosColorTexCoord0Vertex::init();
-
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
-
- bgfx::init();
- bgfx::reset(width, height, reset);
-
- // Enable debug text.
- bgfx::setDebug(debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- // Set view debug names.
- bgfx::setViewName(0, "Skybox");
- bgfx::setViewName(1, "Mesh");
- bgfx::setViewName(2, "Luminance");
- bgfx::setViewName(3, "Downscale luminance 0");
- bgfx::setViewName(4, "Downscale luminance 1");
- bgfx::setViewName(5, "Downscale luminance 2");
- bgfx::setViewName(6, "Downscale luminance 3");
- bgfx::setViewName(7, "Brightness");
- bgfx::setViewName(8, "Blur vertical");
- bgfx::setViewName(9, "Blur horizontal + tonemap");
-
- bgfx::TextureHandle uffizi = loadTexture("uffizi.dds"
- , 0
- | BGFX_TEXTURE_U_CLAMP
- | BGFX_TEXTURE_V_CLAMP
- | BGFX_TEXTURE_W_CLAMP
- );
-
- bgfx::ProgramHandle skyProgram = loadProgram("vs_hdr_skybox", "fs_hdr_skybox");
- bgfx::ProgramHandle lumProgram = loadProgram("vs_hdr_lum", "fs_hdr_lum");
- bgfx::ProgramHandle lumAvgProgram = loadProgram("vs_hdr_lumavg", "fs_hdr_lumavg");
- bgfx::ProgramHandle blurProgram = loadProgram("vs_hdr_blur", "fs_hdr_blur");
- bgfx::ProgramHandle brightProgram = loadProgram("vs_hdr_bright", "fs_hdr_bright");
- bgfx::ProgramHandle meshProgram = loadProgram("vs_hdr_mesh", "fs_hdr_mesh");
- bgfx::ProgramHandle tonemapProgram = loadProgram("vs_hdr_tonemap", "fs_hdr_tonemap");
-
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
- bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1i);
- bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1i);
- bgfx::UniformHandle u_texLum = bgfx::createUniform("u_texLum", bgfx::UniformType::Uniform1i);
- bgfx::UniformHandle u_texBlur = bgfx::createUniform("u_texBlur", bgfx::UniformType::Uniform1i);
- bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
- bgfx::UniformHandle u_tonemap = bgfx::createUniform("u_tonemap", bgfx::UniformType::Uniform4fv);
- bgfx::UniformHandle u_offset = bgfx::createUniform("u_offset", bgfx::UniformType::Uniform4fv, 16);
-
- Mesh* mesh = meshLoad("meshes/bunny.bin");
-
- bgfx::FrameBufferHandle fbh;
- bgfx::TextureHandle fbtextures[] =
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
{
- bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP),
- bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY),
- };
- fbh = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
-
- bgfx::FrameBufferHandle lum[5];
- lum[0] = bgfx::createFrameBuffer(128, 128, bgfx::TextureFormat::BGRA8);
- lum[1] = bgfx::createFrameBuffer( 64, 64, bgfx::TextureFormat::BGRA8);
- lum[2] = bgfx::createFrameBuffer( 16, 16, bgfx::TextureFormat::BGRA8);
- lum[3] = bgfx::createFrameBuffer( 4, 4, bgfx::TextureFormat::BGRA8);
- lum[4] = bgfx::createFrameBuffer( 1, 1, bgfx::TextureFormat::BGRA8);
-
- bgfx::FrameBufferHandle bright;
- bright = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Half, bgfx::TextureFormat::BGRA8);
-
- bgfx::FrameBufferHandle blur;
- blur = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Eighth, bgfx::TextureFormat::BGRA8);
-
- // Imgui.
- imguiCreate();
-
- const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
- s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
- s_originBottomLeft = bgfx::RendererType::OpenGL == renderer || bgfx::RendererType::OpenGLES == renderer;
-
- uint32_t oldWidth = 0;
- uint32_t oldHeight = 0;
- uint32_t oldReset = reset;
-
- float speed = 0.37f;
- float middleGray = 0.18f;
- float white = 1.1f;
- float threshold = 1.5f;
-
- int32_t scrollArea = 0;
-
- float time = 0.0f;
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
+
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Create vertex stream declaration.
+ PosColorTexCoord0Vertex::init();
+
+ // Set view m_debug names.
+ bgfx::setViewName(0, "Skybox");
+ bgfx::setViewName(1, "Mesh");
+ bgfx::setViewName(2, "Luminance");
+ bgfx::setViewName(3, "Downscale luminance 0");
+ bgfx::setViewName(4, "Downscale luminance 1");
+ bgfx::setViewName(5, "Downscale luminance 2");
+ bgfx::setViewName(6, "Downscale luminance 3");
+ bgfx::setViewName(7, "Brightness");
+ bgfx::setViewName(8, "Blur vertical");
+ bgfx::setViewName(9, "Blur horizontal + tonemap");
+
+ m_uffizi = loadTexture("uffizi.dds"
+ , 0
+ | BGFX_TEXTURE_U_CLAMP
+ | BGFX_TEXTURE_V_CLAMP
+ | BGFX_TEXTURE_W_CLAMP
+ );
+
+ m_skyProgram = loadProgram("vs_hdr_skybox", "fs_hdr_skybox");
+ m_lumProgram = loadProgram("vs_hdr_lum", "fs_hdr_lum");
+ m_lumAvgProgram = loadProgram("vs_hdr_lumavg", "fs_hdr_lumavg");
+ m_blurProgram = loadProgram("vs_hdr_blur", "fs_hdr_blur");
+ m_brightProgram = loadProgram("vs_hdr_bright", "fs_hdr_bright");
+ m_meshProgram = loadProgram("vs_hdr_mesh", "fs_hdr_mesh");
+ m_tonemapProgram = loadProgram("vs_hdr_tonemap", "fs_hdr_tonemap");
+
+ s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ s_texLum = bgfx::createUniform("s_texLum", bgfx::UniformType::Int1);
+ s_texBlur = bgfx::createUniform("s_texBlur", bgfx::UniformType::Int1);
+ u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ u_tonemap = bgfx::createUniform("u_tonemap", bgfx::UniformType::Vec4);
+ u_offset = bgfx::createUniform("u_offset", bgfx::UniformType::Vec4, 16);
+
+ m_mesh = meshLoad("meshes/bunny.bin");
+
+ m_fbtextures[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
+ m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY);
+ m_fbh = bgfx::createFrameBuffer(BX_COUNTOF(m_fbtextures), m_fbtextures, true);
+
+ m_lum[0] = bgfx::createFrameBuffer(128, 128, bgfx::TextureFormat::BGRA8);
+ m_lum[1] = bgfx::createFrameBuffer( 64, 64, bgfx::TextureFormat::BGRA8);
+ m_lum[2] = bgfx::createFrameBuffer( 16, 16, bgfx::TextureFormat::BGRA8);
+ m_lum[3] = bgfx::createFrameBuffer( 4, 4, bgfx::TextureFormat::BGRA8);
+ m_lum[4] = bgfx::createFrameBuffer( 1, 1, bgfx::TextureFormat::BGRA8);
+
+ m_bright = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Half, bgfx::TextureFormat::BGRA8);
+ m_blur = bgfx::createFrameBuffer(bgfx::BackbufferRatio::Eighth, bgfx::TextureFormat::BGRA8);
+
+ // Imgui.
+ imguiCreate();
+
+ const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
+ s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
+ s_originBottomLeft = bgfx::RendererType::OpenGL == renderer || bgfx::RendererType::OpenGLES == renderer;
+
+ m_oldWidth = 0;
+ m_oldHeight = 0;
+ m_oldReset = m_reset;
+
+ m_speed = 0.37f;
+ m_middleGray = 0.18f;
+ m_white = 1.1f;
+ m_threshold = 1.5f;
+
+ m_scrollArea = 0;
+
+ m_time = 0.0f;
+ }
- entry::MouseState mouseState;
- while (!entry::processEvents(width, height, debug, reset, &mouseState) )
+ virtual int shutdown() BX_OVERRIDE
{
- if (oldWidth != width
- || oldHeight != height
- || oldReset != reset)
- {
- // Recreate variable size render targets when resolution changes.
- oldWidth = width;
- oldHeight = height;
- oldReset = reset;
-
- uint32_t msaa = (reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT;
-
- bgfx::destroyFrameBuffer(fbh);
-
- fbtextures[0] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, ( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT)|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
- fbtextures[1] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY|( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT) );
- fbh = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
- }
-
- imguiBeginFrame(mouseState.m_mx
- , mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
- , width
- , height
- );
-
- imguiBeginScrollArea("Settings", width - width / 5 - 10, 10, width / 5, height / 3, &scrollArea);
- imguiSeparatorLine();
-
- imguiSlider("Speed", speed, 0.0f, 1.0f, 0.01f);
- imguiSeparator();
-
- imguiSlider("Middle gray", middleGray, 0.1f, 1.0f, 0.01f);
- imguiSlider("White point", white, 0.1f, 2.0f, 0.01f);
- imguiSlider("Threshold", threshold, 0.1f, 2.0f, 0.01f);
-
- imguiEndScrollArea();
- imguiEndFrame();
+ // Cleanup.
+ imguiDestroy();
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ meshUnload(m_mesh);
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
-
- time += (float)(frameTime*speed/freq);
-
- bgfx::setUniform(u_time, &time);
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/09-hdr");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Using multiple views and frame buffers.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- // Set views.
- for (uint32_t ii = 0; ii < 6; ++ii)
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_lum); ++ii)
{
- bgfx::setViewRect(ii, 0, 0, width, height);
+ bgfx::destroyFrameBuffer(m_lum[ii]);
}
- bgfx::setViewFrameBuffer(0, fbh);
- bgfx::setViewFrameBuffer(1, fbh);
- bgfx::setViewClear(1, BGFX_CLEAR_DISCARD_DEPTH|BGFX_CLEAR_DISCARD_STENCIL);
-
- bgfx::setViewRect(2, 0, 0, 128, 128);
- bgfx::setViewFrameBuffer(2, lum[0]);
-
- bgfx::setViewRect(3, 0, 0, 64, 64);
- bgfx::setViewFrameBuffer(3, lum[1]);
-
- bgfx::setViewRect(4, 0, 0, 16, 16);
- bgfx::setViewFrameBuffer(4, lum[2]);
-
- bgfx::setViewRect(5, 0, 0, 4, 4);
- bgfx::setViewFrameBuffer(5, lum[3]);
-
- bgfx::setViewRect(6, 0, 0, 1, 1);
- bgfx::setViewFrameBuffer(6, lum[4]);
-
- bgfx::setViewRect(7, 0, 0, width/2, height/2);
- bgfx::setViewFrameBuffer(7, bright);
+ bgfx::destroyFrameBuffer(m_bright);
+ bgfx::destroyFrameBuffer(m_blur);
+ bgfx::destroyFrameBuffer(m_fbh);
+
+ bgfx::destroyProgram(m_meshProgram);
+ bgfx::destroyProgram(m_skyProgram);
+ bgfx::destroyProgram(m_tonemapProgram);
+ bgfx::destroyProgram(m_lumProgram);
+ bgfx::destroyProgram(m_lumAvgProgram);
+ bgfx::destroyProgram(m_blurProgram);
+ bgfx::destroyProgram(m_brightProgram);
+ bgfx::destroyTexture(m_uffizi);
+
+ bgfx::destroyUniform(s_texCube);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texLum);
+ bgfx::destroyUniform(s_texBlur);
+ bgfx::destroyUniform(u_mtx);
+ bgfx::destroyUniform(u_tonemap);
+ bgfx::destroyUniform(u_offset);
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
- bgfx::setViewRect(8, 0, 0, width/8, height/8);
- bgfx::setViewFrameBuffer(8, blur);
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ if (m_oldWidth != m_width
+ || m_oldHeight != m_height
+ || m_oldReset != m_reset)
+ {
+ // Recreate variable size render targets when resolution changes.
+ m_oldWidth = m_width;
+ m_oldHeight = m_height;
+ m_oldReset = m_reset;
+
+ uint32_t msaa = (m_reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT;
+
+ bgfx::destroyFrameBuffer(m_fbh);
+
+ m_fbtextures[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, ( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT)|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
+ m_fbtextures[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY|( (msaa+1)<<BGFX_TEXTURE_RT_MSAA_SHIFT) );
+ m_fbh = bgfx::createFrameBuffer(BX_COUNTOF(m_fbtextures), m_fbtextures, true);
+ }
+
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , m_width
+ , m_height
+ );
- bgfx::setViewRect(9, 0, 0, width, height);
+ imguiBeginScrollArea("Settings", m_width - m_width / 5 - 10, 10, m_width / 5, m_height / 3, &m_scrollArea);
+ imguiSeparatorLine();
- float view[16];
- float proj[16];
+ imguiSlider("Speed", m_speed, 0.0f, 1.0f, 0.01f);
+ imguiSeparator();
- bx::mtxIdentity(view);
- bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+ imguiSlider("Middle gray", m_middleGray, 0.1f, 1.0f, 0.01f);
+ imguiSlider("White point", m_white, 0.1f, 2.0f, 0.01f);
+ imguiSlider("Threshold", m_threshold, 0.1f, 2.0f, 0.01f);
- // Set view and projection matrix for view 0.
- for (uint32_t ii = 0; ii < 10; ++ii)
- {
- bgfx::setViewTransform(ii, view, proj);
+ imguiEndScrollArea();
+ imguiEndFrame();
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+
+ m_time += (float)(frameTime*m_speed/freq);
+
+ // Use m_debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/09-hdr");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Using multiple views and frame buffers.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ // Set views.
+ for (uint32_t ii = 0; ii < 6; ++ii)
+ {
+ bgfx::setViewRect(ii, 0, 0, m_width, m_height);
+ }
+ bgfx::setViewFrameBuffer(0, m_fbh);
+ bgfx::setViewFrameBuffer(1, m_fbh);
+ bgfx::setViewClear(1, BGFX_CLEAR_DISCARD_DEPTH|BGFX_CLEAR_DISCARD_STENCIL);
+
+ bgfx::setViewRect(2, 0, 0, 128, 128);
+ bgfx::setViewFrameBuffer(2, m_lum[0]);
+
+ bgfx::setViewRect(3, 0, 0, 64, 64);
+ bgfx::setViewFrameBuffer(3, m_lum[1]);
+
+ bgfx::setViewRect(4, 0, 0, 16, 16);
+ bgfx::setViewFrameBuffer(4, m_lum[2]);
+
+ bgfx::setViewRect(5, 0, 0, 4, 4);
+ bgfx::setViewFrameBuffer(5, m_lum[3]);
+
+ bgfx::setViewRect(6, 0, 0, 1, 1);
+ bgfx::setViewFrameBuffer(6, m_lum[4]);
+
+ bgfx::setViewRect(7, 0, 0, m_width/2, m_height/2);
+ bgfx::setViewFrameBuffer(7, m_bright);
+
+ bgfx::setViewRect(8, 0, 0, m_width/8, m_height/8);
+ bgfx::setViewFrameBuffer(8, m_blur);
+
+ bgfx::setViewRect(9, 0, 0, m_width, m_height);
+
+ float view[16];
+ float proj[16];
+
+ bx::mtxIdentity(view);
+ bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+
+ // Set view and projection matrix for view 0.
+ for (uint32_t ii = 0; ii < 10; ++ii)
+ {
+ bgfx::setViewTransform(ii, view, proj);
+ }
+
+ float at[3] = { 0.0f, 1.0f, 0.0f };
+ float eye[3] = { 0.0f, 1.0f, -2.5f };
+
+ float mtx[16];
+ bx::mtxRotateXY(mtx
+ , 0.0f
+ , m_time
+ );
+
+ float temp[4];
+ bx::vec3MulMtx(temp, eye, mtx);
+
+ bx::mtxLookAt(view, temp, at);
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
+
+ // Set view and projection matrix for view 1.
+ bgfx::setViewTransform(1, view, proj);
+
+ bgfx::setUniform(u_mtx, mtx);
+
+ // Render skybox into view 0.
+ bgfx::setTexture(0, s_texCube, m_uffizi);
+
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad( (float)m_width, (float)m_height, true);
+ bgfx::submit(0, m_skyProgram);
+
+ // Render m_mesh into view 1
+ bgfx::setTexture(0, s_texCube, m_uffizi);
+ meshSubmit(m_mesh, 1, m_meshProgram, NULL);
+
+ // Calculate luminance.
+ setOffsets2x2Lum(u_offset, 128, 128);
+ bgfx::setTexture(0, s_texColor, m_fbtextures[0]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad(128.0f, 128.0f, s_originBottomLeft);
+ bgfx::submit(2, m_lumProgram);
+
+ // Downscale luminance 0.
+ setOffsets4x4Lum(u_offset, 128, 128);
+ bgfx::setTexture(0, s_texColor, m_lum[0]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad(64.0f, 64.0f, s_originBottomLeft);
+ bgfx::submit(3, m_lumAvgProgram);
+
+ // Downscale luminance 1.
+ setOffsets4x4Lum(u_offset, 64, 64);
+ bgfx::setTexture(0, s_texColor, m_lum[1]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad(16.0f, 16.0f, s_originBottomLeft);
+ bgfx::submit(4, m_lumAvgProgram);
+
+ // Downscale luminance 2.
+ setOffsets4x4Lum(u_offset, 16, 16);
+ bgfx::setTexture(0, s_texColor, m_lum[2]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad(4.0f, 4.0f, s_originBottomLeft);
+ bgfx::submit(5, m_lumAvgProgram);
+
+ // Downscale luminance 3.
+ setOffsets4x4Lum(u_offset, 4, 4);
+ bgfx::setTexture(0, s_texColor, m_lum[3]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad(1.0f, 1.0f, s_originBottomLeft);
+ bgfx::submit(6, m_lumAvgProgram);
+
+ float tonemap[4] = { m_middleGray, square(m_white), m_threshold, m_time };
+ bgfx::setUniform(u_tonemap, tonemap);
+
+ // m_bright pass m_threshold is tonemap[3].
+ setOffsets4x4Lum(u_offset, m_width/2, m_height/2);
+ bgfx::setTexture(0, s_texColor, m_fbtextures[0]);
+ bgfx::setTexture(1, s_texLum, m_lum[4]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad( (float)m_width/2.0f, (float)m_height/2.0f, s_originBottomLeft);
+ bgfx::submit(7, m_brightProgram);
+
+ // m_blur m_bright pass vertically.
+ bgfx::setTexture(0, s_texColor, m_bright);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad( (float)m_width/8.0f, (float)m_height/8.0f, s_originBottomLeft);
+ bgfx::submit(8, m_blurProgram);
+
+ // m_blur m_bright pass horizontally, do tonemaping and combine.
+ bgfx::setTexture(0, s_texColor, m_fbtextures[0]);
+ bgfx::setTexture(1, s_texLum, m_lum[4]);
+ bgfx::setTexture(2, s_texBlur, m_blur);
+ bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
+ screenSpaceQuad( (float)m_width, (float)m_height, s_originBottomLeft);
+ bgfx::submit(9, m_tonemapProgram);
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
}
- float at[3] = { 0.0f, 1.0f, 0.0f };
- float eye[3] = { 0.0f, 1.0f, -2.5f };
-
- float mtx[16];
- bx::mtxRotateXY(mtx
- , 0.0f
- , time
- );
-
- float temp[4];
- bx::vec3MulMtx(temp, eye, mtx);
-
- bx::mtxLookAt(view, temp, at);
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
-
- // Set view and projection matrix for view 1.
- bgfx::setViewTransform(1, view, proj);
-
- bgfx::setUniform(u_mtx, mtx);
-
- // Render skybox into view 0.
- bgfx::setTexture(0, u_texCube, uffizi);
-
- bgfx::setProgram(skyProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad( (float)width, (float)height, true);
- bgfx::submit(0);
-
- // Render mesh into view 1
- bgfx::setTexture(0, u_texCube, uffizi);
- meshSubmit(mesh, 1, meshProgram, NULL);
-
- // Calculate luminance.
- setOffsets2x2Lum(u_offset, 128, 128);
- bgfx::setTexture(0, u_texColor, fbtextures[0]);
- bgfx::setProgram(lumProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad(128.0f, 128.0f, s_originBottomLeft);
- bgfx::submit(2);
-
- // Downscale luminance 0.
- setOffsets4x4Lum(u_offset, 128, 128);
- bgfx::setTexture(0, u_texColor, lum[0]);
- bgfx::setProgram(lumAvgProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad(64.0f, 64.0f, s_originBottomLeft);
- bgfx::submit(3);
-
- // Downscale luminance 1.
- setOffsets4x4Lum(u_offset, 64, 64);
- bgfx::setTexture(0, u_texColor, lum[1]);
- bgfx::setProgram(lumAvgProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad(16.0f, 16.0f, s_originBottomLeft);
- bgfx::submit(4);
-
- // Downscale luminance 2.
- setOffsets4x4Lum(u_offset, 16, 16);
- bgfx::setTexture(0, u_texColor, lum[2]);
- bgfx::setProgram(lumAvgProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad(4.0f, 4.0f, s_originBottomLeft);
- bgfx::submit(5);
-
- // Downscale luminance 3.
- setOffsets4x4Lum(u_offset, 4, 4);
- bgfx::setTexture(0, u_texColor, lum[3]);
- bgfx::setProgram(lumAvgProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad(1.0f, 1.0f, s_originBottomLeft);
- bgfx::submit(6);
-
- float tonemap[4] = { middleGray, square(white), threshold, 0.0f };
- bgfx::setUniform(u_tonemap, tonemap);
-
- // Bright pass threshold is tonemap[3].
- setOffsets4x4Lum(u_offset, width/2, height/2);
- bgfx::setTexture(0, u_texColor, fbtextures[0]);
- bgfx::setTexture(1, u_texLum, lum[4]);
- bgfx::setProgram(brightProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad( (float)width/2.0f, (float)height/2.0f, s_originBottomLeft);
- bgfx::submit(7);
-
- // Blur bright pass vertically.
- bgfx::setTexture(0, u_texColor, bright);
- bgfx::setProgram(blurProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad( (float)width/8.0f, (float)height/8.0f, s_originBottomLeft);
- bgfx::submit(8);
-
- // Blur bright pass horizontally, do tonemaping and combine.
- bgfx::setTexture(0, u_texColor, fbtextures[0]);
- bgfx::setTexture(1, u_texLum, lum[4]);
- bgfx::setTexture(2, u_texBlur, blur);
- bgfx::setProgram(tonemapProgram);
- bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
- screenSpaceQuad( (float)width, (float)height, s_originBottomLeft);
- bgfx::submit(9);
-
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ return false;
}
- // Cleanup.
- imguiDestroy();
-
- meshUnload(mesh);
+ entry::MouseState m_mouseState;
+
+ bgfx::ProgramHandle m_skyProgram;
+ bgfx::ProgramHandle m_lumProgram;
+ bgfx::ProgramHandle m_lumAvgProgram;
+ bgfx::ProgramHandle m_blurProgram;
+ bgfx::ProgramHandle m_brightProgram;
+ bgfx::ProgramHandle m_meshProgram;
+ bgfx::ProgramHandle m_tonemapProgram;
+
+ bgfx::TextureHandle m_uffizi;
+ bgfx::UniformHandle s_texCube;
+ bgfx::UniformHandle s_texColor;
+ bgfx::UniformHandle s_texLum;
+ bgfx::UniformHandle s_texBlur;
+ bgfx::UniformHandle u_mtx;
+ bgfx::UniformHandle u_tonemap;
+ bgfx::UniformHandle u_offset;
+
+ Mesh* m_mesh;
+
+ bgfx::TextureHandle m_fbtextures[2];
+ bgfx::FrameBufferHandle m_fbh;
+ bgfx::FrameBufferHandle m_lum[5];
+ bgfx::FrameBufferHandle m_bright;
+ bgfx::FrameBufferHandle m_blur;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ uint32_t m_oldWidth;
+ uint32_t m_oldHeight;
+ uint32_t m_oldReset;
+
+ float m_speed;
+ float m_middleGray;
+ float m_white;
+ float m_threshold;
+
+ int32_t m_scrollArea;
+
+ float m_time;
+};
- for (uint32_t ii = 0; ii < BX_COUNTOF(lum); ++ii)
- {
- bgfx::destroyFrameBuffer(lum[ii]);
- }
- bgfx::destroyFrameBuffer(bright);
- bgfx::destroyFrameBuffer(blur);
- bgfx::destroyFrameBuffer(fbh);
-
- bgfx::destroyProgram(meshProgram);
- bgfx::destroyProgram(skyProgram);
- bgfx::destroyProgram(tonemapProgram);
- bgfx::destroyProgram(lumProgram);
- bgfx::destroyProgram(lumAvgProgram);
- bgfx::destroyProgram(blurProgram);
- bgfx::destroyProgram(brightProgram);
- bgfx::destroyTexture(uffizi);
-
- bgfx::destroyUniform(u_time);
- bgfx::destroyUniform(u_texCube);
- bgfx::destroyUniform(u_texColor);
- bgfx::destroyUniform(u_texLum);
- bgfx::destroyUniform(u_texBlur);
- bgfx::destroyUniform(u_mtx);
- bgfx::destroyUniform(u_tonemap);
- bgfx::destroyUniform(u_offset);
-
- // Shutdown bgfx.
- bgfx::shutdown();
-
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(HDR);
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
index b12f18abe98..a23df59bead 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
@@ -8,8 +8,6 @@ $output v_pos, v_view, v_normal
#include "../common/common.sh"
-uniform float u_time;
-
void main()
{
vec3 pos = a_position;
diff --git a/3rdparty/bgfx/examples/10-font/font.cpp b/3rdparty/bgfx/examples/10-font/font.cpp
index d25ef264be6..660ff2998af 100644
--- a/3rdparty/bgfx/examples/10-font/font.cpp
+++ b/3rdparty/bgfx/examples/10-font/font.cpp
@@ -5,7 +5,7 @@
#include "common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/string.h>
#include <bx/fpumath.h>
@@ -97,21 +97,21 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Preload glyphs and blit them to atlas.
fontManager->preloadGlyph(fonts[ii], L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. \n");
- // You can unload the truetype files at this stage, but in that
- // case, the set of glyph's will be limited to the set of preloaded
+ // You can unload the truetype files at this stage, but in that
+ // case, the set of glyph's will be limited to the set of preloaded
// glyph.
fontManager->destroyTtf(fontFiles[ii]);
}
TrueTypeHandle fontAwesomeTtf = loadTtf(fontManager, "font/fontawesome-webfont.ttf");
- // This font doesn't have any preloaded glyph's but the truetype file
+ // This font doesn't have any preloaded glyph's but the truetype file
// is loaded so glyph will be generated as needed.
FontHandle fontAwesome72 = fontManager->createFontByPixelSize(fontAwesomeTtf, 0, 72);
TrueTypeHandle visitorTtf = loadTtf(fontManager, "font/visitor1.ttf");
- // This font doesn't have any preloaded glyph's but the truetype file
+ // This font doesn't have any preloaded glyph's but the truetype file
// is loaded so glyph will be generated as needed.
FontHandle visitor10 = fontManager->createFontByPixelSize(visitorTtf, 0, 10);
@@ -119,7 +119,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
//a static text buffer content cannot be modified after its first submit.
TextBufferHandle staticText = textBufferManager->createTextBuffer(FONT_TYPE_ALPHA, BufferType::Static);
- // The pen position represent the top left of the box of the first line
+ // The pen position represent the top left of the box of the first line
// of text.
textBufferManager->setPenPosition(staticText, 24.0f, 100.0f);
@@ -168,7 +168,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -203,7 +203,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Setup a top-left ortho matrix for screen space drawing.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float proj[16];
bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
diff --git a/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp b/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
index 149206a54a2..d54d4756cd8 100644
--- a/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
+++ b/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
@@ -6,7 +6,7 @@
#include "common.h"
#include "bgfx_utils.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/fpumath.h>
@@ -130,9 +130,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, width
, height
);
@@ -176,7 +177,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -201,7 +202,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Setup a top-left ortho matrix for screen space drawing.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float proj[16];
bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
diff --git a/3rdparty/bgfx/examples/12-lod/fs_tree.sc b/3rdparty/bgfx/examples/12-lod/fs_tree.sc
index c7be20c97b5..4ff3b4805ea 100644
--- a/3rdparty/bgfx/examples/12-lod/fs_tree.sc
+++ b/3rdparty/bgfx/examples/12-lod/fs_tree.sc
@@ -9,7 +9,7 @@ $input v_pos, v_view, v_normal, v_texcoord0
SAMPLER2D(u_texColor, 0);
SAMPLER2D(u_texStipple, 1);
-uniform vec3 u_stipple;
+uniform vec4 u_stipple;
vec2 blinn(vec3 _lightDir, vec3 _normal, vec3 _viewDir)
{
@@ -24,7 +24,8 @@ void main()
vec2 viewport = (u_viewRect.zw - u_viewRect.xy) * vec2(1.0/8.0, 1.0/4.0);
vec2 stippleUV = viewport*(v_pos.xy*0.5 + 0.5);
vec4 color = texture2D(u_texColor, v_texcoord0);
- if ((u_stipple.x - texture2D(u_texStipple,stippleUV).r)*u_stipple.y > u_stipple.z || color.w < 0.5)
+ if ( (u_stipple.x - texture2D(u_texStipple,stippleUV).x)*u_stipple.y > u_stipple.z
+ || color.w < 0.5)
{
discard;
}
diff --git a/3rdparty/bgfx/examples/12-lod/lod.cpp b/3rdparty/bgfx/examples/12-lod/lod.cpp
index 7317c8488c7..c57d7bd820d 100644
--- a/3rdparty/bgfx/examples/12-lod/lod.cpp
+++ b/3rdparty/bgfx/examples/12-lod/lod.cpp
@@ -44,9 +44,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, 0
);
- bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_stipple = bgfx::createUniform("u_stipple", bgfx::UniformType::Uniform3fv);
- bgfx::UniformHandle u_texStipple = bgfx::createUniform("u_texStipple", bgfx::UniformType::Uniform1iv);
+ bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ bgfx::UniformHandle s_texStipple = bgfx::createUniform("s_texStipple", bgfx::UniformType::Int1);
+ bgfx::UniformHandle u_stipple = bgfx::createUniform("u_stipple", bgfx::UniformType::Vec4);
bgfx::ProgramHandle program = loadProgram("vs_tree", "fs_tree");
@@ -117,9 +117,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, width
, height
);
@@ -143,7 +144,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -163,7 +164,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
@@ -209,26 +210,26 @@ int _main_(int /*_argc*/, char** /*_argv*/)
stippleInv[1] = 1.0f;
stippleInv[2] = (float(transitionFrame)*4.0f/255.0f) - (1.0f/255.0f);
- bgfx::setTexture(0, u_texColor, textureBark);
- bgfx::setTexture(1, u_texStipple, textureStipple);
+ bgfx::setTexture(0, s_texColor, textureBark);
+ bgfx::setTexture(1, s_texStipple, textureStipple);
bgfx::setUniform(u_stipple, stipple);
meshSubmit(meshTrunk[mainLOD], 0, program, mtx, stateOpaque);
- bgfx::setTexture(0, u_texColor, textureLeafs);
- bgfx::setTexture(1, u_texStipple, textureStipple);
+ bgfx::setTexture(0, s_texColor, textureLeafs);
+ bgfx::setTexture(1, s_texStipple, textureStipple);
bgfx::setUniform(u_stipple, stipple);
meshSubmit(meshTop[mainLOD], 0, program, mtx, stateTransparent);
if (transitions
&& (transitionFrame != 0) )
{
- bgfx::setTexture(0, u_texColor, textureBark);
- bgfx::setTexture(1, u_texStipple, textureStipple);
+ bgfx::setTexture(0, s_texColor, textureBark);
+ bgfx::setTexture(1, s_texStipple, textureStipple);
bgfx::setUniform(u_stipple, stippleInv);
meshSubmit(meshTrunk[targetLOD], 0, program, mtx, stateOpaque);
- bgfx::setTexture(0, u_texColor, textureLeafs);
- bgfx::setTexture(1, u_texStipple, textureStipple);
+ bgfx::setTexture(0, s_texColor, textureLeafs);
+ bgfx::setTexture(1, s_texStipple, textureStipple);
bgfx::setUniform(u_stipple, stippleInv);
meshSubmit(meshTop[targetLOD], 0, program, mtx, stateTransparent);
}
@@ -279,9 +280,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Cleanup.
bgfx::destroyProgram(program);
- bgfx::destroyUniform(u_texColor);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texStipple);
bgfx::destroyUniform(u_stipple);
- bgfx::destroyUniform(u_texStipple);
bgfx::destroyTexture(textureStipple);
bgfx::destroyTexture(textureLeafs);
diff --git a/3rdparty/bgfx/examples/12-lod/vs_tree.sc b/3rdparty/bgfx/examples/12-lod/vs_tree.sc
index 32eb4db1f9a..c4274e8d11f 100644
--- a/3rdparty/bgfx/examples/12-lod/vs_tree.sc
+++ b/3rdparty/bgfx/examples/12-lod/vs_tree.sc
@@ -8,8 +8,6 @@ $output v_pos, v_view, v_normal, v_texcoord0
#include "../common/common.sh"
-uniform float u_time;
-
void main()
{
vec3 pos = a_position;
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lightning.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lightning.sc
index 19ca37e6793..a35e00ac094 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lightning.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lightning.sc
@@ -10,8 +10,8 @@ $input v_normal, v_view
#define MAX_NUM_LIGHTS 5
uniform vec4 u_params;
-uniform vec3 u_ambient;
-uniform vec3 u_diffuse;
+uniform vec4 u_ambient;
+uniform vec4 u_diffuse;
uniform vec4 u_color;
uniform vec4 u_specular_shininess;
uniform vec4 u_lightPosRadius[MAX_NUM_LIGHTS];
@@ -50,7 +50,7 @@ vec3 calcLight(int _idx, vec3 _view, vec3 _normal, vec3 _viewDir)
float dist = max(length(toLight), u_lightPosRadius[_idx].w);
float attn = 250.0 * pow(dist, -2.0);
- vec3 rgb = (lc.y * u_diffuse + lc.z * u_specular) * u_lightRgbInnerR[_idx].rgb * attn;
+ vec3 rgb = (lc.y * u_diffuse.xyz + lc.z * u_specular) * u_lightRgbInnerR[_idx].rgb * attn;
return rgb;
}
@@ -60,7 +60,7 @@ void main()
vec3 normal = normalize(v_normal);
vec3 viewDir = -normalize(v_view);
- vec3 ambientColor = u_ambient * u_ambientPass;
+ vec3 ambientColor = u_ambient.xyz * u_ambientPass;
vec3 lightColor = vec3_splat(0.0);
for(int ii = 0; ii < MAX_NUM_LIGHTS; ++ii)
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
index eea20d8ffb2..fafbf3de211 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
@@ -7,16 +7,16 @@ $input v_texcoord0
#include "../common/common.sh"
uniform vec4 u_color;
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- vec4 tcolor = toLinear(texture2D(u_texColor, v_texcoord0));
+ vec4 color = toLinear(texture2D(s_texColor, v_texcoord0) );
- if (tcolor.x < 0.1) //OK for now.
+ if (color.x < 0.1)
{
discard;
}
- gl_FragColor = toGamma(tcolor + u_color);
+ gl_FragColor = toGamma(color + u_color);
}
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
index 42c2781422d..0f33138b7ff 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
@@ -6,9 +6,9 @@ $input v_texcoord0
*/
#include "../common/common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- gl_FragColor = texture2D(u_texColor, v_texcoord0);
+ gl_FragColor = texture2D(s_texColor, v_texcoord0);
}
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lightning.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lightning.sc
index 9ffe0ce9dc6..07ce0c84297 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lightning.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lightning.sc
@@ -10,8 +10,8 @@ $input v_normal, v_view, v_texcoord0
#define MAX_NUM_LIGHTS 5
uniform vec4 u_params;
-uniform vec3 u_ambient;
-uniform vec3 u_diffuse;
+uniform vec4 u_ambient;
+uniform vec4 u_diffuse;
uniform vec4 u_color;
uniform vec4 u_specular_shininess;
uniform vec4 u_lightPosRadius[MAX_NUM_LIGHTS];
@@ -51,7 +51,7 @@ vec3 calcLight(int _idx, vec3 _view, vec3 _normal, vec3 _viewDir)
float dist = max(length(toLight), u_lightPosRadius[_idx].w);
float attn = 250.0 * pow(dist, -2.0);
- vec3 rgb = (lc.y * u_diffuse + lc.z * u_specular) * u_lightRgbInnerR[_idx].rgb * attn;
+ vec3 rgb = (lc.y * u_diffuse.xyz + lc.z * u_specular) * u_lightRgbInnerR[_idx].rgb * attn;
return rgb;
}
@@ -61,7 +61,7 @@ void main()
vec3 normal = normalize(v_normal);
vec3 viewDir = -normalize(v_view);
- vec3 ambientColor = u_ambient * u_ambientPass;
+ vec3 ambientColor = u_ambient.xyz * u_ambientPass;
vec3 lightColor = vec3_splat(0.0);
for(int ii = 0; ii < MAX_NUM_LIGHTS; ++ii)
diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
index 3b869b5c5f3..7a1e90d2834 100644
--- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp
+++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
@@ -9,7 +9,7 @@
#include "common.h"
#include "bgfx_utils.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/readerwriter.h>
#include <bx/fpumath.h>
@@ -149,7 +149,7 @@ static const uint16_t s_planeIndices[] =
static bool s_flipV = false;
static uint32_t s_viewMask = 0;
static uint32_t s_clearMask = 0;
-static bgfx::UniformHandle u_texColor;
+static bgfx::UniformHandle s_texColor;
inline void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far)
{
@@ -316,14 +316,13 @@ struct Uniforms
m_lightRgbInnerR[ii][3] = 1.0f;
}
- u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv);
- u_ambient = bgfx::createUniform("u_ambient", bgfx::UniformType::Uniform4fv);
- u_diffuse = bgfx::createUniform("u_diffuse", bgfx::UniformType::Uniform4fv);
- u_specular_shininess = bgfx::createUniform("u_specular_shininess", bgfx::UniformType::Uniform4fv);
- u_color = bgfx::createUniform("u_color", bgfx::UniformType::Uniform4fv);
- u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f );
- u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Uniform4fv, MAX_NUM_LIGHTS);
- u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Uniform4fv, MAX_NUM_LIGHTS);
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ u_ambient = bgfx::createUniform("u_ambient", bgfx::UniformType::Vec4);
+ u_diffuse = bgfx::createUniform("u_diffuse", bgfx::UniformType::Vec4);
+ u_specular_shininess = bgfx::createUniform("u_specular_shininess", bgfx::UniformType::Vec4);
+ u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
+ u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4, MAX_NUM_LIGHTS);
+ u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Vec4, MAX_NUM_LIGHTS);
}
//call this once at initialization
@@ -334,12 +333,6 @@ struct Uniforms
bgfx::setUniform(u_specular_shininess, &m_specular_shininess);
}
- //call this once per frame
- void submitPerFrameUniforms()
- {
- bgfx::setUniform(u_time, &m_time);
- }
-
//call this before each draw call
void submitPerDrawUniforms()
{
@@ -356,7 +349,6 @@ struct Uniforms
bgfx::destroyUniform(u_diffuse);
bgfx::destroyUniform(u_specular_shininess);
bgfx::destroyUniform(u_color);
- bgfx::destroyUniform(u_time);
bgfx::destroyUniform(u_lightPosRadius);
bgfx::destroyUniform(u_lightRgbInnerR);
}
@@ -399,7 +391,6 @@ struct Uniforms
bgfx::UniformHandle u_diffuse;
bgfx::UniformHandle u_specular_shininess;
bgfx::UniformHandle u_color;
- bgfx::UniformHandle u_time;
bgfx::UniformHandle u_lightPosRadius;
bgfx::UniformHandle u_lightRgbInnerR;
};
@@ -811,14 +802,13 @@ struct Mesh
// Set model matrix for rendering.
bgfx::setTransform(_mtx);
- bgfx::setProgram(_program);
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
// Set texture
if (bgfx::invalidHandle != _texture.idx)
{
- bgfx::setTexture(0, u_texColor, _texture);
+ bgfx::setTexture(0, s_texColor, _texture);
}
// Apply render state
@@ -826,7 +816,7 @@ struct Mesh
bgfx::setState(_renderState.m_state, _renderState.m_blendFactorRgba);
// Submit
- bgfx::submit(_viewId);
+ bgfx::submit(_viewId, _program);
// Keep track of submited view ids
s_viewMask |= 1 << _viewId;
@@ -873,7 +863,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
s_uniforms.init();
s_uniforms.submitConstUniforms();
- u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
bgfx::ProgramHandle programTextureLightning = loadProgram("vs_stencil_texture_lightning", "fs_stencil_texture_lightning");
bgfx::ProgramHandle programColorLightning = loadProgram("vs_stencil_color_lightning", "fs_stencil_color_lightning" );
@@ -915,7 +905,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
lightRgbInnerR[ii][2] = rgbInnerR[index][2];
lightRgbInnerR[ii][3] = rgbInnerR[index][3];
}
- memcpy(s_uniforms.m_lightRgbInnerR, lightRgbInnerR, MAX_NUM_LIGHTS * 4*sizeof(float));
+ memcpy(s_uniforms.m_lightRgbInnerR, lightRgbInnerR, MAX_NUM_LIGHTS * 4*sizeof(float) );
// Set view and projection matrices.
const float aspect = float(viewState.m_width)/float(viewState.m_height);
@@ -952,9 +942,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, viewState.m_width
, viewState.m_height
);
@@ -1001,7 +992,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
s_uniforms.m_params.m_lightCount = settings_numLights;
s_uniforms.m_params.m_lightIndex = 0.0f;
s_uniforms.m_color[3] = settings_reflectionValue;
- s_uniforms.submitPerFrameUniforms();
// Time.
int64_t now = bx::getHPCounter();
@@ -1041,11 +1031,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
for (uint8_t ii = 0; ii < numLights; ++ii)
{
lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f;
- lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f;
+ lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ) )*4.0f;
lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f;
lightPosRadius[ii][3] = radius;
}
- memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
+ memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float) );
// Floor position.
float floorMtx[16];
@@ -1120,7 +1110,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Make sure at the beginning everything gets cleared.
clearView(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, clearValues);
- bgfx::submit(0);
+ bgfx::touch(0);
s_viewMask |= 1;
// Bunny and columns color.
@@ -1163,7 +1153,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bx::vec3MulMtx(reflectedLights[ii], lightPosRadius[ii], reflectMtx);
reflectedLights[ii][3] = lightPosRadius[ii][3];
}
- memcpy(s_uniforms.m_lightPosRadius, reflectedLights, numLights * 4*sizeof(float));
+ memcpy(s_uniforms.m_lightPosRadius, reflectedLights, numLights * 4*sizeof(float) );
// Reflect and submit bunny.
float mtxReflectedBunny[16];
@@ -1187,7 +1177,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
}
// Set lights back.
- memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
+ memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float) );
// Third pass - Blend plane.
// Floor.
@@ -1407,7 +1397,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::destroyProgram(programColorBlack);
bgfx::destroyProgram(programTexture);
- bgfx::destroyUniform(u_texColor);
+ bgfx::destroyUniform(s_texColor);
s_uniforms.destroy();
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lightning.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lightning.sc
index 7b3519337dd..9ed8d7a632b 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lightning.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lightning.sc
@@ -8,14 +8,14 @@ $input v_normal, v_view
#include "../common/common.sh"
uniform vec4 u_params;
uniform vec4 u_svparams;
-uniform vec3 u_ambient;
-uniform vec3 u_diffuse;
+uniform vec4 u_ambient;
+uniform vec4 u_diffuse;
uniform vec4 u_color;
uniform vec4 u_specular_shininess;
uniform vec4 u_fog;
uniform vec4 u_lightPosRadius;
uniform vec4 u_lightRgbInnerR;
-SAMPLER2D(u_texStencil, 7);
+SAMPLER2D(s_texStencil, 1);
#define u_ambientPass u_params.x
#define u_lightningPass u_params.y
@@ -54,21 +54,21 @@ vec3 calcLight(vec3 _view, vec3 _normal, vec3 _viewDir)
float dist = max(length(toLight), u_lightPosRadius.w);
float attn = 50.0 * pow(dist, -2.0);
- vec3 rgb = (lc.y * u_diffuse + lc.z * u_specular) * u_lightRgbInnerR.rgb * attn;
+ vec3 rgb = (lc.y * u_diffuse.xyz + lc.z * u_specular) * u_lightRgbInnerR.rgb * attn;
return rgb;
}
void main()
{
- vec3 ambientColor = u_ambient * u_ambientPass;
+ vec3 ambientColor = u_ambient.xyz * u_ambientPass;
vec3 normal = normalize(v_normal);
vec3 viewDir = -normalize(v_view);
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightningPass;
vec2 ndc = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * u_texelHalf;
- vec4 texcolor = texture2D(u_texStencil, ndc);
+ vec4 texcolor = texture2D(s_texStencil, ndc);
float s = (texcolor.x - texcolor.y) + 2.0 * (texcolor.z - texcolor.w);
s *= u_useStencilTex;
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
index eea20d8ffb2..2a2ab4107d8 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
@@ -7,11 +7,11 @@ $input v_texcoord0
#include "../common/common.sh"
uniform vec4 u_color;
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- vec4 tcolor = toLinear(texture2D(u_texColor, v_texcoord0));
+ vec4 tcolor = toLinear(texture2D(s_texColor, v_texcoord0));
if (tcolor.x < 0.1) //OK for now.
{
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
index 7c8bdd9d1df..652f83810b0 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
@@ -11,14 +11,16 @@ vec4 stencilColor(float _k)
, float(abs(_k + 1.0) < 0.0001)/255.0
, float(abs(_k - 2.0) < 0.0001)/255.0
, float(abs(_k + 2.0) < 0.0001)/255.0
- );
+ );
}
void main()
{
float k = 1.0;
if (!gl_FrontFacing)
+ {
k = -k;
+ }
gl_FragColor = stencilColor(k);
}
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
index ba281a41b69..efc14e5df81 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
@@ -11,14 +11,16 @@ vec4 stencilColor(float _k)
, float(abs(_k + 1.0) < 0.0001)/255.0
, float(abs(_k - 2.0) < 0.0001)/255.0
, float(abs(_k + 2.0) < 0.0001)/255.0
- );
+ );
}
void main()
{
float k = 2.0;
if (!gl_FrontFacing)
+ {
k = -k;
+ }
gl_FragColor = stencilColor(k);
}
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
index 7623b254e36..51c02371ffa 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
@@ -1,24 +1,26 @@
/*
-* Copyright 2013-2014 Dario Manesku. All rights reserved.
-* License: http://www.opensource.org/licenses/BSD-2-Clause
-*/
+ * Copyright 2013-2014 Dario Manesku. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
#include "../common/common.sh"
vec4 stencilColor(float _k)
{
- return vec4(float(abs(_k - 1.0) < 0.0001)/255.0
- , float(abs(_k + 1.0) < 0.0001)/255.0
- , float(abs(_k - 2.0) < 0.0001)/255.0
- , float(abs(_k + 2.0) < 0.0001)/255.0
- );
+ return vec4(float(abs(_k - 1.0) < 0.0001)/255.0
+ , float(abs(_k + 1.0) < 0.0001)/255.0
+ , float(abs(_k - 2.0) < 0.0001)/255.0
+ , float(abs(_k + 2.0) < 0.0001)/255.0
+ );
}
void main()
{
- float k = -1.0;
- if (gl_FrontFacing)
- k = -k;
+ float k = -1.0;
+ if (gl_FrontFacing)
+ {
+ k = -k;
+ }
- gl_FragColor = stencilColor(k);
+ gl_FragColor = stencilColor(k);
}
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
index 21042bebc6a..400d1b3127f 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
@@ -7,13 +7,13 @@ $input v_k
#include "../common/common.sh"
-uniform vec3 u_color;
-
void main()
{
float k = v_k;
if (!gl_FrontFacing)
+ {
k = -k;
+ }
gl_FragColor.xyzw =
vec4( float(abs(k - 1.0) < 0.0001)/255.0
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
index 42c2781422d..0f33138b7ff 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
@@ -6,9 +6,9 @@ $input v_texcoord0
*/
#include "../common/common.sh"
-SAMPLER2D(u_texColor, 0);
+SAMPLER2D(s_texColor, 0);
void main()
{
- gl_FragColor = texture2D(u_texColor, v_texcoord0);
+ gl_FragColor = texture2D(s_texColor, v_texcoord0);
}
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lightning.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lightning.sc
index 0bb27a04dd6..d22c0ddc2eb 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lightning.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lightning.sc
@@ -8,15 +8,14 @@ $input v_normal, v_view, v_texcoord0
#include "../common/common.sh"
uniform vec4 u_params;
uniform vec4 u_svparams;
-uniform vec3 u_ambient;
-uniform vec3 u_diffuse;
-uniform vec4 u_color;
+uniform vec4 u_ambient;
+uniform vec4 u_diffuse;
uniform vec4 u_specular_shininess;
uniform vec4 u_fog;
uniform vec4 u_lightPosRadius;
uniform vec4 u_lightRgbInnerR;
-SAMPLER2D(u_texColor, 0);
-SAMPLER2D(u_texStencil, 7);
+SAMPLER2D(s_texColor, 0);
+SAMPLER2D(s_texStencil, 1);
#define u_ambientPass u_params.x
#define u_lightningPass u_params.y
@@ -55,21 +54,21 @@ vec3 calcLight(vec3 _view, vec3 _normal, vec3 _viewDir)
float dist = max(length(toLight), u_lightPosRadius.w);
float attn = 50.0 * pow(dist, -2.0);
- vec3 rgb = (lc.y * u_diffuse + lc.z * u_specular) * u_lightRgbInnerR.rgb * attn;
+ vec3 rgb = (lc.y * u_diffuse.xyz + lc.z * u_specular) * u_lightRgbInnerR.rgb * attn;
return rgb;
}
void main()
{
- vec3 ambientColor = u_ambient * u_ambientPass;
+ vec3 ambientColor = u_ambient.xyz * u_ambientPass;
vec3 normal = normalize(v_normal);
vec3 viewDir = -normalize(v_view);
vec3 lightColor = calcLight(v_view, normal, viewDir) * u_lightningPass;
vec2 ndc = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * u_texelHalf;
- vec4 texcolor = texture2D(u_texStencil, ndc);
+ vec4 texcolor = texture2D(s_texStencil, ndc);
float s = (texcolor.x - texcolor.y) + 2.0 * (texcolor.z - texcolor.w);
s *= u_useStencilTex;
@@ -78,7 +77,7 @@ void main()
float fogFactor = 1.0/exp2(u_fogDensity*u_fogDensity*z*z*LOG2);
fogFactor = clamp(fogFactor, 0.0, 1.0);
- vec3 color = toLinear(texture2D(u_texColor, v_texcoord0)).xyz;
+ vec3 color = toLinear(texture2D(s_texColor, v_texcoord0)).xyz;
vec3 ambient = toGamma(ambientColor * color);
vec3 diffuse = toGamma(lightColor * color);
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
index ce8b5aac61c..17a19ab566c 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
@@ -19,7 +19,7 @@ using namespace std::tr1;
#include "common.h"
#include "bgfx_utils.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/readerwriter.h>
#include <bx/allocator.h>
@@ -116,8 +116,8 @@ static float s_texelHalf = 0.0f;
static uint32_t s_viewMask = 0;
-static bgfx::UniformHandle u_texColor;
-static bgfx::UniformHandle u_texStencil;
+static bgfx::UniformHandle s_texColor;
+static bgfx::UniformHandle s_texStencil;
static bgfx::FrameBufferHandle s_stencilFb;
void setViewClearMask(uint32_t _viewMask, uint8_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil)
@@ -250,17 +250,16 @@ struct Uniforms
m_virtualLightPos_extrusionDist[2] = 0.0f;
m_virtualLightPos_extrusionDist[3] = 100.0f;
- u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv);
- u_svparams = bgfx::createUniform("u_svparams", bgfx::UniformType::Uniform4fv);
- u_ambient = bgfx::createUniform("u_ambient", bgfx::UniformType::Uniform4fv);
- u_diffuse = bgfx::createUniform("u_diffuse", bgfx::UniformType::Uniform4fv);
- u_specular_shininess = bgfx::createUniform("u_specular_shininess", bgfx::UniformType::Uniform4fv);
- u_fog = bgfx::createUniform("u_fog", bgfx::UniformType::Uniform4fv);
- u_color = bgfx::createUniform("u_color", bgfx::UniformType::Uniform4fv);
- u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f );
- u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Uniform4fv);
- u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Uniform4fv);
- u_virtualLightPos_extrusionDist = bgfx::createUniform("u_virtualLightPos_extrusionDist", bgfx::UniformType::Uniform4fv);
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ u_svparams = bgfx::createUniform("u_svparams", bgfx::UniformType::Vec4);
+ u_ambient = bgfx::createUniform("u_ambient", bgfx::UniformType::Vec4);
+ u_diffuse = bgfx::createUniform("u_diffuse", bgfx::UniformType::Vec4);
+ u_specular_shininess = bgfx::createUniform("u_specular_shininess", bgfx::UniformType::Vec4);
+ u_fog = bgfx::createUniform("u_fog", bgfx::UniformType::Vec4);
+ u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
+ u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4);
+ u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Vec4);
+ u_virtualLightPos_extrusionDist = bgfx::createUniform("u_virtualLightPos_extrusionDist", bgfx::UniformType::Vec4);
}
//call this once at initialization
@@ -272,12 +271,6 @@ struct Uniforms
bgfx::setUniform(u_fog, &m_fog);
}
- //call this once per frame
- void submitPerFrameUniforms()
- {
- bgfx::setUniform(u_time, &m_time);
- }
-
//call this before each draw call
void submitPerDrawUniforms()
{
@@ -298,7 +291,6 @@ struct Uniforms
bgfx::destroyUniform(u_specular_shininess);
bgfx::destroyUniform(u_fog);
bgfx::destroyUniform(u_color);
- bgfx::destroyUniform(u_time);
bgfx::destroyUniform(u_lightPosRadius);
bgfx::destroyUniform(u_lightRgbInnerR);
bgfx::destroyUniform(u_virtualLightPos_extrusionDist);
@@ -351,7 +343,6 @@ struct Uniforms
bgfx::UniformHandle u_specular_shininess;
bgfx::UniformHandle u_fog;
bgfx::UniformHandle u_color;
- bgfx::UniformHandle u_time;
bgfx::UniformHandle u_lightPosRadius;
bgfx::UniformHandle u_lightRgbInnerR;
bgfx::UniformHandle u_virtualLightPos_extrusionDist;
@@ -576,14 +567,20 @@ struct ClearValues
uint8_t m_clearStencil;
};
-void submit(uint8_t _id, int32_t _depth = 0)
+void submit(uint8_t _id, bgfx::ProgramHandle _handle, int32_t _depth = 0)
{
- bgfx::submit(_id, _depth);
+ bgfx::submit(_id, _handle, _depth);
// Keep track of submited view ids.
s_viewMask |= 1 << _id;
}
+void touch(uint8_t _id)
+{
+ bgfx::ProgramHandle handle = BGFX_INVALID_HANDLE;
+ ::submit(_id, handle);
+}
+
struct Aabb
{
float m_min[3];
@@ -852,7 +849,7 @@ struct Group
//Init faces and edges.
m_faces.reserve(m_numIndices/3); //1 face = 3 indices
- m_edges = (Edge*)malloc(m_numIndices * sizeof(Edge)); //1 triangle = 3 indices = 3 edges.
+ m_edges = (Edge*)malloc(m_numIndices * sizeof(Edge) ); //1 triangle = 3 indices = 3 edges.
m_edgePlanesUnalignedPtr = (Plane*)malloc(m_numIndices * sizeof(Plane) + 15);
m_edgePlanes = (Plane*)bx::alignPtr(m_edgePlanesUnalignedPtr, 0, 16);
@@ -919,7 +916,7 @@ struct Group
std::pair<uint16_t, uint16_t> keyInv = std::make_pair(ui1, ui0);
EdgeMap::iterator iter = edgeMap.find(keyInv);
- if (iter != edgeMap.end())
+ if (iter != edgeMap.end() )
{
EdgeAndPlane& ep = iter->second;
memcpy(ep.m_plane[ep.m_faceIndex].m_plane, plane, 4*sizeof(float) );
@@ -944,8 +941,8 @@ struct Group
Edge* edge = &m_edges[m_numEdges];
Plane* plane = &m_edgePlanes[index];
- memcpy(edge, iter->second.m_faceReverseOrder, sizeof(Edge));
- memcpy(plane, iter->second.m_plane, 2 * sizeof(Plane));
+ memcpy(edge, iter->second.m_faceReverseOrder, sizeof(Edge) );
+ memcpy(plane, iter->second.m_plane, 2 * sizeof(Plane) );
m_numEdges++;
index += 2;
@@ -1170,10 +1167,6 @@ struct Model
// Set uniforms
s_uniforms.submitPerDrawUniforms();
- // Set program
- BX_CHECK(bgfx::invalidHandle != m_program, "Error, program is not set.");
- bgfx::setProgram(m_program);
-
// Set transform
bgfx::setTransform(_mtx);
@@ -1184,15 +1177,16 @@ struct Model
// Set textures
if (bgfx::invalidHandle != m_texture.idx)
{
- bgfx::setTexture(0, u_texColor, m_texture);
+ bgfx::setTexture(0, s_texColor, m_texture);
}
- bgfx::setTexture(7, u_texStencil, s_stencilFb);
+ bgfx::setTexture(1, s_texStencil, s_stencilFb);
// Apply render state
::setRenderState(_renderState);
// Submit
- ::submit(_viewId);
+ BX_CHECK(bgfx::invalidHandle != m_program, "Error, program is not set.");
+ ::submit(_viewId, m_program);
}
}
@@ -1556,7 +1550,7 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume
const float4_t r1 = float4_mul(vY, ly);
const float4_t r2 = float4_mul(vZ, lz);
- const float4_t dot = float4_add(r0, float4_add(r1, r2));
+ const float4_t dot = float4_add(r0, float4_add(r1, r2) );
const float4_t f = float4_add(dot, vW);
const float4_t zero = float4_zero();
@@ -1906,8 +1900,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
};
s_stencilFb = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
- u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
- u_texStencil = bgfx::createUniform("u_texStencil", bgfx::UniformType::Uniform1iv);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ s_texStencil = bgfx::createUniform("s_texStencil", bgfx::UniformType::Int1);
bgfx::ProgramHandle programTextureLightning = loadProgram("vs_shadowvolume_texture_lightning", "fs_shadowvolume_texture_lightning");
bgfx::ProgramHandle programColorLightning = loadProgram("vs_shadowvolume_color_lightning", "fs_shadowvolume_color_lightning" );
@@ -2116,7 +2110,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float eye[3];
cameraGetPosition(eye);
@@ -2135,9 +2129,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, viewState.m_width
, viewState.m_height
);
@@ -2255,7 +2250,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
s_uniforms.m_params.m_lightningPass = 1.0f;
s_uniforms.m_params.m_texelHalf = s_texelHalf;
s_uniforms.m_svparams.m_useStencilTex = float(settings_useStencilTexture);
- s_uniforms.submitPerFrameUniforms();
//set picked bunny model
Model* bunnyModel = BunnyLowPoly == currentMesh ? &bunnyLowPolyModel : &bunnyHighPolyModel;
@@ -2539,7 +2533,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, clearValues.m_clearStencil
);
- ::submit(0);
+ ::touch(0);
// Draw ambient only.
s_uniforms.m_params.m_ambientPass = 1.0f;
@@ -2721,30 +2715,27 @@ int _main_(int /*_argc*/, char** /*_argv*/)
const RenderState& renderStateCraftStencil = s_renderStates[renderStateIndex];
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[programIndex][ShadowVolumePart::Side]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(shadowVolume.m_vbSides);
bgfx::setIndexBuffer(shadowVolume.m_ibSides);
- ::setRenderState(renderStateCraftStencil);
- ::submit(viewId);
+ setRenderState(renderStateCraftStencil);
+ ::submit(viewId, svProgs[programIndex][ShadowVolumePart::Side]);
if (shadowVolume.m_cap)
{
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[programIndex][ShadowVolumePart::Front]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setIndexBuffer(shadowVolume.m_ibFrontCap);
- ::setRenderState(renderStateCraftStencil);
- ::submit(viewId);
+ setRenderState(renderStateCraftStencil);
+ ::submit(viewId, svProgs[programIndex][ShadowVolumePart::Front]);
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[programIndex][ShadowVolumePart::Back]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setIndexBuffer(shadowVolume.m_ibBackCap);
::setRenderState(renderStateCraftStencil);
- ::submit(viewId);
+ ::submit(viewId, svProgs[programIndex][ShadowVolumePart::Back]);
}
if (settings_drawShadowVolumes)
@@ -2752,30 +2743,27 @@ int _main_(int /*_argc*/, char** /*_argv*/)
const RenderState& renderState = s_renderStates[RenderState::Custom_DrawShadowVolume_Lines];
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Side]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(shadowVolume.m_vbSides);
bgfx::setIndexBuffer(shadowVolume.m_ibSides);
::setRenderState(renderState);
- ::submit(VIEWID_RANGE1_PASS3);
+ ::submit(VIEWID_RANGE1_PASS3, svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Side]);
if (shadowVolume.m_cap)
{
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Front]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setIndexBuffer(shadowVolume.m_ibFrontCap);
::setRenderState(renderState);
- ::submit(VIEWID_RANGE1_PASS3);
+ ::submit(VIEWID_RANGE1_PASS3, svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Front]);
s_uniforms.submitPerDrawUniforms();
- bgfx::setProgram(svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Back]);
bgfx::setTransform(shadowVolumeMtx);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setIndexBuffer(shadowVolume.m_ibBackCap);
::setRenderState(renderState);
- ::submit(VIEWID_RANGE1_PASS3);
+ ::submit(VIEWID_RANGE1_PASS3, svProgs[ShadowVolumeProgramType::Color][ShadowVolumePart::Back]);
}
}
}
@@ -2853,8 +2841,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
s_uniforms.destroy();
- bgfx::destroyUniform(u_texColor);
- bgfx::destroyUniform(u_texStencil);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texStencil);
bgfx::destroyFrameBuffer(s_stencilFb);
bgfx::destroyTexture(figureTex);
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
index 50c6d01c506..f3a88945cf5 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
@@ -7,10 +7,10 @@
uniform vec4 u_lightPos;
#if SHADOW_PACKED_DEPTH
-SAMPLER2D(u_shadowMap, 4);
+SAMPLER2D(u_shadowMap, 0);
# define Sampler sampler2D
#else
-SAMPLER2DSHADOW(u_shadowMap, 4);
+SAMPLER2DSHADOW(u_shadowMap, 0);
# define Sampler sampler2DShadow
#endif // SHADOW_PACKED_DEPTH
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
index 35eade7c6f8..513a37f2579 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
@@ -9,7 +9,7 @@
#include "common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/readerwriter.h>
#include <bx/fpumath.h>
@@ -86,9 +86,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setDebug(debug);
// Uniforms.
- bgfx::UniformHandle u_shadowMap = bgfx::createUniform("u_shadowMap", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_lightPos = bgfx::createUniform("u_lightPos", bgfx::UniformType::Uniform4fv);
- bgfx::UniformHandle u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Uniform4x4fv);
+ bgfx::UniformHandle u_shadowMap = bgfx::createUniform("u_shadowMap", bgfx::UniformType::Int1);
+ bgfx::UniformHandle u_lightPos = bgfx::createUniform("u_lightPos", bgfx::UniformType::Vec4);
+ bgfx::UniformHandle u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Mat4);
// Vertex declarations.
bgfx::VertexDecl PosNormalDecl;
@@ -178,7 +178,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
state[1]->m_viewId = RENDER_SCENE_PASS_ID;
state[1]->m_numTextures = 1;
state[1]->m_textures[0].m_flags = UINT32_MAX;
- state[1]->m_textures[0].m_stage = 4;
+ state[1]->m_textures[0].m_stage = 0;
state[1]->m_textures[0].m_sampler = u_shadowMap;
state[1]->m_textures[0].m_texture = shadowMapTexture;
@@ -311,7 +311,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Floor.
bx::mtxMul(lightMtx, mtxFloor, mtxShadow);
- bgfx::setUniform(u_lightMtx, lightMtx);
uint32_t cached = bgfx::setTransform(mtxFloor);
for (uint32_t pass = 0; pass < 2; ++pass)
{
@@ -327,29 +326,31 @@ int _main_(int /*_argc*/, char** /*_argv*/)
);
}
bgfx::setUniform(u_lightMtx, lightMtx);
- bgfx::setProgram(st.m_program);
bgfx::setIndexBuffer(ibh);
bgfx::setVertexBuffer(vbh);
bgfx::setState(st.m_state);
- bgfx::submit(st.m_viewId);
+ bgfx::submit(st.m_viewId, st.m_program);
}
// Bunny.
bx::mtxMul(lightMtx, mtxBunny, mtxShadow);
bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(bunny, &state[0], 1, mtxBunny);
+ bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(bunny, &state[1], 1, mtxBunny);
// Hollow cube.
bx::mtxMul(lightMtx, mtxHollowcube, mtxShadow);
bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(hollowcube, &state[0], 1, mtxHollowcube);
+ bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(hollowcube, &state[1], 1, mtxHollowcube);
// Cube.
bx::mtxMul(lightMtx, mtxCube, mtxShadow);
bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(cube, &state[0], 1, mtxCube);
+ bgfx::setUniform(u_lightMtx, lightMtx);
meshSubmit(cube, &state[1], 1, mtxCube);
// Advance to next frame. Rendering thread will be kicked to
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning.sh b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning.sh
index 769a8c662fa..9c19212a3f0 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning.sh
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning.sh
@@ -10,8 +10,8 @@ uniform vec4 u_params1;
uniform vec4 u_params2;
uniform vec4 u_color;
-uniform vec3 u_materialKa;
-uniform vec3 u_materialKd;
+uniform vec4 u_materialKa;
+uniform vec4 u_materialKd;
uniform vec4 u_materialKs;
uniform vec4 u_lightPosition;
uniform vec4 u_lightAmbientPower;
@@ -23,10 +23,10 @@ uniform vec4 u_smSamplingParams;
uniform vec4 u_csmFarDistances;
#if SM_OMNI
-uniform vec3 u_tetraNormalGreen;
-uniform vec3 u_tetraNormalYellow;
-uniform vec3 u_tetraNormalBlue;
-uniform vec3 u_tetraNormalRed;
+uniform vec4 u_tetraNormalGreen;
+uniform vec4 u_tetraNormalYellow;
+uniform vec4 u_tetraNormalBlue;
+uniform vec4 u_tetraNormalRed;
#endif
SAMPLER2D(u_shadowMap0, 4);
@@ -45,8 +45,8 @@ Shader evalShader(float _diff, float _spec)
{
Shader shader;
- shader.ambi = u_lightAmbientPower.xyz * u_lightAmbientPower.w * u_materialKa;
- shader.diff = u_lightDiffusePower.xyz * u_lightDiffusePower.w * u_materialKd * _diff;
+ shader.ambi = u_lightAmbientPower.xyz * u_lightAmbientPower.w * u_materialKa.xyz;
+ shader.diff = u_lightDiffusePower.xyz * u_lightDiffusePower.w * u_materialKd.xyz * _diff;
shader.spec = u_lightSpecularPower.xyz * u_lightSpecularPower.w * u_materialKs.xyz * _spec;
return shader;
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning_main.sh b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning_main.sh
index 9b2aa73815a..3e3373e6278 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning_main.sh
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lightning_main.sh
@@ -79,10 +79,10 @@
vec4 faceSelection;
vec3 pos = v_position.xyz;
- faceSelection.x = dot(u_tetraNormalGreen, pos);
- faceSelection.y = dot(u_tetraNormalYellow, pos);
- faceSelection.z = dot(u_tetraNormalBlue, pos);
- faceSelection.w = dot(u_tetraNormalRed, pos);
+ faceSelection.x = dot(u_tetraNormalGreen.xyz, pos);
+ faceSelection.y = dot(u_tetraNormalYellow.xyz, pos);
+ faceSelection.z = dot(u_tetraNormalBlue.xyz, pos);
+ faceSelection.w = dot(u_tetraNormalRed.xyz, pos);
vec4 shadowcoord;
float faceMax = max(max(faceSelection.x, faceSelection.y), max(faceSelection.z, faceSelection.w));
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
index 6754ccd2f9e..34ce52c36d2 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
+++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
@@ -10,7 +10,7 @@
#include "common.h"
#include "bgfx_utils.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/timer.h>
#include <bx/readerwriter.h>
#include <bx/fpumath.h>
@@ -448,34 +448,34 @@ struct Uniforms
m_XOffset = 10.0f/512.0f;
m_YOffset = 10.0f/512.0f;
- u_params0 = bgfx::createUniform("u_params0", bgfx::UniformType::Uniform4fv);
- u_params1 = bgfx::createUniform("u_params1", bgfx::UniformType::Uniform4fv);
- u_params2 = bgfx::createUniform("u_params2", bgfx::UniformType::Uniform4fv);
- u_color = bgfx::createUniform("u_color", bgfx::UniformType::Uniform4fv);
- u_smSamplingParams = bgfx::createUniform("u_smSamplingParams", bgfx::UniformType::Uniform4fv);
- u_csmFarDistances = bgfx::createUniform("u_csmFarDistances", bgfx::UniformType::Uniform4fv);
- u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Uniform4x4fv);
-
- u_tetraNormalGreen = bgfx::createUniform("u_tetraNormalGreen", bgfx::UniformType::Uniform3fv);
- u_tetraNormalYellow = bgfx::createUniform("u_tetraNormalYellow", bgfx::UniformType::Uniform3fv);
- u_tetraNormalBlue = bgfx::createUniform("u_tetraNormalBlue", bgfx::UniformType::Uniform3fv);
- u_tetraNormalRed = bgfx::createUniform("u_tetraNormalRed", bgfx::UniformType::Uniform3fv);
-
- u_shadowMapMtx0 = bgfx::createUniform("u_shadowMapMtx0", bgfx::UniformType::Uniform4x4fv);
- u_shadowMapMtx1 = bgfx::createUniform("u_shadowMapMtx1", bgfx::UniformType::Uniform4x4fv);
- u_shadowMapMtx2 = bgfx::createUniform("u_shadowMapMtx2", bgfx::UniformType::Uniform4x4fv);
- u_shadowMapMtx3 = bgfx::createUniform("u_shadowMapMtx3", bgfx::UniformType::Uniform4x4fv);
-
- u_lightPosition = bgfx::createUniform("u_lightPosition", bgfx::UniformType::Uniform4fv);
- u_lightAmbientPower = bgfx::createUniform("u_lightAmbientPower", bgfx::UniformType::Uniform4fv);
- u_lightDiffusePower = bgfx::createUniform("u_lightDiffusePower", bgfx::UniformType::Uniform4fv);
- u_lightSpecularPower = bgfx::createUniform("u_lightSpecularPower", bgfx::UniformType::Uniform4fv);
- u_lightSpotDirectionInner = bgfx::createUniform("u_lightSpotDirectionInner", bgfx::UniformType::Uniform4fv);
- u_lightAttenuationSpotOuter = bgfx::createUniform("u_lightAttenuationSpotOuter", bgfx::UniformType::Uniform4fv);
-
- u_materialKa = bgfx::createUniform("u_materialKa", bgfx::UniformType::Uniform4fv);
- u_materialKd = bgfx::createUniform("u_materialKd", bgfx::UniformType::Uniform4fv);
- u_materialKs = bgfx::createUniform("u_materialKs", bgfx::UniformType::Uniform4fv);
+ u_params0 = bgfx::createUniform("u_params0", bgfx::UniformType::Vec4);
+ u_params1 = bgfx::createUniform("u_params1", bgfx::UniformType::Vec4);
+ u_params2 = bgfx::createUniform("u_params2", bgfx::UniformType::Vec4);
+ u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
+ u_smSamplingParams = bgfx::createUniform("u_smSamplingParams", bgfx::UniformType::Vec4);
+ u_csmFarDistances = bgfx::createUniform("u_csmFarDistances", bgfx::UniformType::Vec4);
+ u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Mat4);
+
+ u_tetraNormalGreen = bgfx::createUniform("u_tetraNormalGreen", bgfx::UniformType::Vec4);
+ u_tetraNormalYellow = bgfx::createUniform("u_tetraNormalYellow", bgfx::UniformType::Vec4);
+ u_tetraNormalBlue = bgfx::createUniform("u_tetraNormalBlue", bgfx::UniformType::Vec4);
+ u_tetraNormalRed = bgfx::createUniform("u_tetraNormalRed", bgfx::UniformType::Vec4);
+
+ u_shadowMapMtx0 = bgfx::createUniform("u_shadowMapMtx0", bgfx::UniformType::Mat4);
+ u_shadowMapMtx1 = bgfx::createUniform("u_shadowMapMtx1", bgfx::UniformType::Mat4);
+ u_shadowMapMtx2 = bgfx::createUniform("u_shadowMapMtx2", bgfx::UniformType::Mat4);
+ u_shadowMapMtx3 = bgfx::createUniform("u_shadowMapMtx3", bgfx::UniformType::Mat4);
+
+ u_lightPosition = bgfx::createUniform("u_lightPosition", bgfx::UniformType::Vec4);
+ u_lightAmbientPower = bgfx::createUniform("u_lightAmbientPower", bgfx::UniformType::Vec4);
+ u_lightDiffusePower = bgfx::createUniform("u_lightDiffusePower", bgfx::UniformType::Vec4);
+ u_lightSpecularPower = bgfx::createUniform("u_lightSpecularPower", bgfx::UniformType::Vec4);
+ u_lightSpotDirectionInner = bgfx::createUniform("u_lightSpotDirectionInner", bgfx::UniformType::Vec4);
+ u_lightAttenuationSpotOuter = bgfx::createUniform("u_lightAttenuationSpotOuter", bgfx::UniformType::Vec4);
+
+ u_materialKa = bgfx::createUniform("u_materialKa", bgfx::UniformType::Vec4);
+ u_materialKd = bgfx::createUniform("u_materialKd", bgfx::UniformType::Vec4);
+ u_materialKs = bgfx::createUniform("u_materialKs", bgfx::UniformType::Vec4);
}
@@ -1006,7 +1006,6 @@ struct Mesh
// Set model matrix for rendering.
bgfx::setTransform(_mtx);
- bgfx::setProgram(_program);
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
@@ -1026,7 +1025,7 @@ struct Mesh
bgfx::setState(_renderState.m_state, _renderState.m_blendFactorRgba);
// Submit.
- bgfx::submit(_viewId);
+ bgfx::submit(_viewId, _program);
}
}
@@ -1350,11 +1349,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Uniforms.
s_uniforms.init();
- u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
- u_shadowMap[0] = bgfx::createUniform("u_shadowMap0", bgfx::UniformType::Uniform1iv);
- u_shadowMap[1] = bgfx::createUniform("u_shadowMap1", bgfx::UniformType::Uniform1iv);
- u_shadowMap[2] = bgfx::createUniform("u_shadowMap2", bgfx::UniformType::Uniform1iv);
- u_shadowMap[3] = bgfx::createUniform("u_shadowMap3", bgfx::UniformType::Uniform1iv);
+ u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Int1);
+ u_shadowMap[0] = bgfx::createUniform("u_shadowMap0", bgfx::UniformType::Int1);
+ u_shadowMap[1] = bgfx::createUniform("u_shadowMap1", bgfx::UniformType::Int1);
+ u_shadowMap[2] = bgfx::createUniform("u_shadowMap2", bgfx::UniformType::Int1);
+ u_shadowMap[3] = bgfx::createUniform("u_shadowMap3", bgfx::UniformType::Int1);
// Programs.
s_programs.init();
@@ -1972,9 +1971,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Imgui.
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, viewState.m_width
, viewState.m_height
);
@@ -1985,9 +1985,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
#define IMGUI_FLOAT_SLIDER(_name, _val) \
imguiSlider(_name \
, _val \
- , *(((float*)&_val)+1) \
- , *(((float*)&_val)+2) \
- , *(((float*)&_val)+3) \
+ , *( ((float*)&_val)+1) \
+ , *( ((float*)&_val)+2) \
+ , *( ((float*)&_val)+3) \
)
imguiBool("Update lights", settings.m_updateLights);
@@ -2648,7 +2648,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, clearValues.m_clearDepth
, clearValues.m_clearStencil
);
- bgfx::submit(0);
+ bgfx::touch(0);
// Clear shadowmap rendertarget at beginning.
const uint8_t flags0 = (LightType::DirectionalLight == settings.m_lightType)
@@ -2662,7 +2662,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, clearValues.m_clearDepth
, clearValues.m_clearStencil
);
- bgfx::submit(RENDERVIEW_SHADOWMAP_0_ID);
+ bgfx::touch(RENDERVIEW_SHADOWMAP_0_ID);
const uint8_t flags1 = (LightType::DirectionalLight == settings.m_lightType)
? BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
@@ -2677,7 +2677,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, clearValues.m_clearDepth
, clearValues.m_clearStencil
);
- bgfx::submit(RENDERVIEW_SHADOWMAP_1_ID+ii);
+ bgfx::touch(RENDERVIEW_SHADOWMAP_1_ID+ii);
}
// Render.
@@ -2727,7 +2727,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
vertex[5].m_y = max;
vertex[5].m_z = zz;
- bgfx::setProgram(s_programs.m_black);
bgfx::setState(0);
bgfx::setStencil(BGFX_STENCIL_TEST_ALWAYS
| BGFX_STENCIL_FUNC_REF(1)
@@ -2737,7 +2736,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
| BGFX_STENCIL_OP_PASS_Z_REPLACE
);
bgfx::setVertexBuffer(&vb);
- bgfx::submit(RENDERVIEW_SHADOWMAP_0_ID);
+ bgfx::submit(RENDERVIEW_SHADOWMAP_0_ID, s_programs.m_black);
}
}
@@ -2810,19 +2809,18 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bool bVsmOrEsm = (SmImpl::VSM == settings.m_smImpl) || (SmImpl::ESM == settings.m_smImpl);
// Blur shadow map.
- if (bVsmOrEsm && currentSmSettings->m_doBlur)
+ if (bVsmOrEsm
+ && currentSmSettings->m_doBlur)
{
bgfx::setTexture(4, u_shadowMap[0], s_rtShadowMap[0]);
- bgfx::setProgram(s_programs.m_vBlur[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(RENDERVIEW_VBLUR_0_ID);
+ bgfx::submit(RENDERVIEW_VBLUR_0_ID, s_programs.m_vBlur[depthType]);
bgfx::setTexture(4, u_shadowMap[0], s_rtBlur);
- bgfx::setProgram(s_programs.m_hBlur[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(RENDERVIEW_HBLUR_0_ID);
+ bgfx::submit(RENDERVIEW_HBLUR_0_ID, s_programs.m_hBlur[depthType]);
if (LightType::DirectionalLight == settings.m_lightType)
{
@@ -2831,16 +2829,14 @@ int _main_(int /*_argc*/, char** /*_argv*/)
const uint8_t viewId = RENDERVIEW_VBLUR_0_ID + jj;
bgfx::setTexture(4, u_shadowMap[0], s_rtShadowMap[ii]);
- bgfx::setProgram(s_programs.m_vBlur[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(viewId);
+ bgfx::submit(viewId, s_programs.m_vBlur[depthType]);
bgfx::setTexture(4, u_shadowMap[0], s_rtBlur);
- bgfx::setProgram(s_programs.m_hBlur[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(viewId+1);
+ bgfx::submit(viewId+1, s_programs.m_hBlur[depthType]);
}
}
}
@@ -3068,20 +3064,18 @@ int _main_(int /*_argc*/, char** /*_argv*/)
if (settings.m_drawDepthBuffer)
{
bgfx::setTexture(4, u_shadowMap[0], s_rtShadowMap[0]);
- bgfx::setProgram(s_programs.m_drawDepth[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID);
+ bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID, s_programs.m_drawDepth[depthType]);
if (LightType::DirectionalLight == settings.m_lightType)
{
for (uint8_t ii = 1; ii < settings.m_numSplits; ++ii)
{
bgfx::setTexture(4, u_shadowMap[0], s_rtShadowMap[ii]);
- bgfx::setProgram(s_programs.m_drawDepth[depthType]);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad(currentShadowMapSizef, currentShadowMapSizef, s_flipV);
- bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID+ii);
+ bgfx::submit(RENDERVIEW_DRAWDEPTH_0_ID+ii, s_programs.m_drawDepth[depthType]);
}
}
}
diff --git a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
index ba79c792149..1f40768b370 100644
--- a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
+++ b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
@@ -3,7 +3,7 @@
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/uint32_t.h>
#include "common.h"
@@ -13,10 +13,6 @@
#include "vs_drawstress.bin.h"
#include "fs_drawstress.bin.h"
-#if BX_PLATFORM_EMSCRIPTEN
-# include <emscripten.h>
-#endif // BX_PLATFORM_EMSCRIPTEN
-
struct PosColorVertex
{
float m_x;
@@ -66,25 +62,6 @@ static const uint16_t s_cubeIndices[36] =
6, 3, 7,
};
-uint32_t width = 1280;
-uint32_t height = 720;
-uint32_t debug = BGFX_DEBUG_TEXT;
-uint32_t reset = BGFX_RESET_NONE;
-
-bool autoAdjust = true;
-int32_t scrollArea = 0;
-int32_t dim = 16;
-int32_t maxDim = 40;
-uint32_t transform = 0;
-
-entry::MouseState mouseState;
-
-int64_t timeOffset = bx::getHPCounter();
-
-int64_t deltaTimeNs = 0;
-int64_t deltaTimeAvgNs = 0;
-int64_t numFrames = 0;
-
#if BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_NACL
static const int64_t highwm = 1000000/35;
static const int64_t lowwm = 1000000/27;
@@ -93,242 +70,277 @@ static const int64_t highwm = 1000000/65;
static const int64_t lowwm = 1000000/57;
#endif // BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_NACL
-bgfx::ProgramHandle program;
-bgfx::VertexBufferHandle vbh;
-bgfx::IndexBufferHandle ibh;
-
-BX_NO_INLINE bool mainloop()
+class DrawStress : public entry::AppI
{
- if (!entry::processEvents(width, height, debug, reset, &mouseState) )
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
{
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t hpFreq = bx::getHPFrequency();
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(hpFreq);
- const double toMs = 1000.0/freq;
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_NONE;
- deltaTimeNs += frameTime*1000000/hpFreq;
+ m_autoAdjust = true;
+ m_scrollArea = 0;
+ m_dim = 16;
+ m_maxDim = 40;
+ m_transform = 0;
- if (deltaTimeNs > 1000000)
- {
- deltaTimeAvgNs = deltaTimeNs / bx::int64_max(1, numFrames);
+ m_timeOffset = bx::getHPCounter();
- if (autoAdjust)
- {
- if (deltaTimeAvgNs < highwm)
- {
- dim = bx::uint32_min(dim + 2, maxDim);
- }
- else if (deltaTimeAvgNs > lowwm)
- {
- dim = bx::uint32_max(dim - 1, 2);
- }
- }
+ m_deltaTimeNs = 0;
+ m_deltaTimeAvgNs = 0;
+ m_numFrames = 0;
- deltaTimeNs = 0;
- numFrames = 0;
- }
- else
- {
- ++numFrames;
- }
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
- float time = (float)( (now-timeOffset)/freq);
+ const bgfx::Caps* caps = bgfx::getCaps();
+ m_maxDim = (int32_t)powf(float(caps->maxDrawCalls), 1.0f/3.0f);
- imguiBeginFrame(mouseState.m_mx
- , mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
, 0
- , width
- , height
);
- imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, height / 3, &scrollArea);
- imguiSeparatorLine();
+ // Create vertex stream declaration.
+ PosColorVertex::init();
- transform = imguiChoose(transform
- , "Rotate"
- , "No fragments"
- );
- imguiSeparatorLine();
+ const bgfx::Memory* vs_drawstress;
+ const bgfx::Memory* fs_drawstress;
- if (imguiCheck("Auto adjust", autoAdjust) )
+ switch (bgfx::getRendererType() )
{
- autoAdjust ^= true;
+ case bgfx::RendererType::Direct3D9:
+ vs_drawstress = bgfx::makeRef(vs_drawstress_dx9, sizeof(vs_drawstress_dx9) );
+ fs_drawstress = bgfx::makeRef(fs_drawstress_dx9, sizeof(fs_drawstress_dx9) );
+ break;
+
+ case bgfx::RendererType::Direct3D11:
+ case bgfx::RendererType::Direct3D12:
+ vs_drawstress = bgfx::makeRef(vs_drawstress_dx11, sizeof(vs_drawstress_dx11) );
+ fs_drawstress = bgfx::makeRef(fs_drawstress_dx11, sizeof(fs_drawstress_dx11) );
+ break;
+
+ case bgfx::RendererType::Metal:
+ vs_drawstress = bgfx::makeRef(vs_drawstress_mtl, sizeof(vs_drawstress_mtl) );
+ fs_drawstress = bgfx::makeRef(fs_drawstress_mtl, sizeof(fs_drawstress_mtl) );
+ break;
+
+ default:
+ vs_drawstress = bgfx::makeRef(vs_drawstress_glsl, sizeof(vs_drawstress_glsl) );
+ fs_drawstress = bgfx::makeRef(fs_drawstress_glsl, sizeof(fs_drawstress_glsl) );
+ break;
}
- imguiSlider("Dim", dim, 5, maxDim);
- imguiLabel("Draw calls: %d", dim*dim*dim);
- imguiLabel("Avg Delta Time (1 second) [ms]: %0.4f", deltaTimeAvgNs/1000.0f);
-
- imguiEndScrollArea();
- imguiEndFrame();
+ // Create program from shaders.
+ m_program = bgfx::createProgram(
+ bgfx::createShader(vs_drawstress)
+ , bgfx::createShader(fs_drawstress)
+ , true /* destroy shaders when program is destroyed */
+ );
- float at[3] = { 0.0f, 0.0f, 0.0f };
- float eye[3] = { 0.0f, 0.0f, -35.0f };
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosColorVertex::ms_decl
+ );
- float view[16];
- float proj[16];
- bx::mtxLookAt(view, eye, at);
- bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
- // Set view and projection matrix for view 0.
- bgfx::setViewTransform(0, view, proj);
+ // Imgui.
+ imguiCreate();
+ }
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
+ int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ imguiDestroy();
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+ bgfx::destroyProgram(m_program);
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ // Shutdown bgfx.
+ bgfx::shutdown();
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/17-drawstress");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Draw stress, maximizing number of draw calls.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: %7.3f[ms]", double(frameTime)*toMs);
+ return 0;
+ }
- float mtxS[16];
- const float scale = 0 == transform ? 0.25f : 0.0f;
- bx::mtxScale(mtxS, scale, scale, scale);
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t hpFreq = bx::getHPFrequency();
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(hpFreq);
+ const double toMs = 1000.0/freq;
- const float step = 0.6f;
- float pos[3];
- pos[0] = -step*dim / 2.0f;
- pos[1] = -step*dim / 2.0f;
- pos[2] = -15.0;
+ m_deltaTimeNs += frameTime*1000000/hpFreq;
- for (uint32_t zz = 0; zz < uint32_t(dim); ++zz)
- {
- for (uint32_t yy = 0; yy < uint32_t(dim); ++yy)
+ if (m_deltaTimeNs > 1000000)
{
- for (uint32_t xx = 0; xx < uint32_t(dim); ++xx)
- {
- float mtxR[16];
- bx::mtxRotateXYZ(mtxR, time + xx*0.21f, time + yy*0.37f, time + yy*0.13f);
+ m_deltaTimeAvgNs = m_deltaTimeNs / bx::int64_max(1, m_numFrames);
- float mtx[16];
- bx::mtxMul(mtx, mtxS, mtxR);
+ if (m_autoAdjust)
+ {
+ if (m_deltaTimeAvgNs < highwm)
+ {
+ m_dim = bx::uint32_min(m_dim + 2, m_maxDim);
+ }
+ else if (m_deltaTimeAvgNs > lowwm)
+ {
+ m_dim = bx::uint32_max(m_dim - 1, 2);
+ }
+ }
- mtx[12] = pos[0] + float(xx)*step;
- mtx[13] = pos[1] + float(yy)*step;
- mtx[14] = pos[2] + float(zz)*step;
+ m_deltaTimeNs = 0;
+ m_numFrames = 0;
+ }
+ else
+ {
+ ++m_numFrames;
+ }
- // Set model matrix for rendering.
- bgfx::setTransform(mtx);
+ float time = (float)( (now-m_timeOffset)/freq);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , m_width
+ , m_height
+ );
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
+ imguiBeginScrollArea("Settings", m_width - m_width / 4 - 10, 10, m_width / 4, m_height / 3, &m_scrollArea);
+ imguiSeparatorLine();
- // Set render states.
- bgfx::setState(BGFX_STATE_DEFAULT);
+ m_transform = imguiChoose(m_transform
+ , "Rotate"
+ , "No fragments"
+ );
+ imguiSeparatorLine();
- // Submit primitive for rendering to view 0.
- bgfx::submit(0);
- }
+ if (imguiCheck("Auto adjust", m_autoAdjust) )
+ {
+ m_autoAdjust ^= true;
}
- }
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
+ imguiSlider("Dim", m_dim, 5, m_maxDim);
+ imguiLabel("Draw calls: %d", m_dim*m_dim*m_dim);
+ imguiLabel("Avg Delta Time (1 second) [ms]: %0.4f", m_deltaTimeAvgNs/1000.0f);
- return false;
- }
+ imguiEndScrollArea();
+ imguiEndFrame();
- return true;
-}
+ float at[3] = { 0.0f, 0.0f, 0.0f };
+ float eye[3] = { 0.0f, 0.0f, -35.0f };
-void loop()
-{
- mainloop();
-}
+ float view[16];
+ float proj[16];
+ bx::mtxLookAt(view, eye, at);
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f);
-int _main_(int /*_argc*/, char** /*_argv*/)
-{
- bgfx::init();
- bgfx::reset(width, height, reset);
+ // Set view and projection matrix for view 0.
+ bgfx::setViewTransform(0, view, proj);
- const bgfx::Caps* caps = bgfx::getCaps();
- maxDim = (int32_t)powf(float(caps->maxDrawCalls), 1.0f/3.0f);
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
- // Enable debug text.
- bgfx::setDebug(debug);
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
+ // Use debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/17-drawstress");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Draw stress, maximizing number of draw calls.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: %7.3f[ms]", double(frameTime)*toMs);
- // Create vertex stream declaration.
- PosColorVertex::init();
+ float mtxS[16];
+ const float scale = 0 == m_transform ? 0.25f : 0.0f;
+ bx::mtxScale(mtxS, scale, scale, scale);
- const bgfx::Memory* vs_drawstress;
- const bgfx::Memory* fs_drawstress;
+ const float step = 0.6f;
+ float pos[3];
+ pos[0] = -step*m_dim / 2.0f;
+ pos[1] = -step*m_dim / 2.0f;
+ pos[2] = -15.0;
- switch (bgfx::getRendererType() )
- {
- case bgfx::RendererType::Direct3D9:
- vs_drawstress = bgfx::makeRef(vs_drawstress_dx9, sizeof(vs_drawstress_dx9) );
- fs_drawstress = bgfx::makeRef(fs_drawstress_dx9, sizeof(fs_drawstress_dx9) );
- break;
-
- case bgfx::RendererType::Direct3D11:
- case bgfx::RendererType::Direct3D12:
- vs_drawstress = bgfx::makeRef(vs_drawstress_dx11, sizeof(vs_drawstress_dx11) );
- fs_drawstress = bgfx::makeRef(fs_drawstress_dx11, sizeof(fs_drawstress_dx11) );
- break;
-
- default:
- vs_drawstress = bgfx::makeRef(vs_drawstress_glsl, sizeof(vs_drawstress_glsl) );
- fs_drawstress = bgfx::makeRef(fs_drawstress_glsl, sizeof(fs_drawstress_glsl) );
- break;
- }
+ for (uint32_t zz = 0; zz < uint32_t(m_dim); ++zz)
+ {
+ for (uint32_t yy = 0; yy < uint32_t(m_dim); ++yy)
+ {
+ for (uint32_t xx = 0; xx < uint32_t(m_dim); ++xx)
+ {
+ float mtxR[16];
+ bx::mtxRotateXYZ(mtxR, time + xx*0.21f, time + yy*0.37f, time + yy*0.13f);
- // Create program from shaders.
- program = bgfx::createProgram(
- bgfx::createShader(vs_drawstress)
- , bgfx::createShader(fs_drawstress)
- , true /* destroy shaders when program is destroyed */
- );
+ float mtx[16];
+ bx::mtxMul(mtx, mtxS, mtxR);
- const bgfx::Memory* mem;
+ mtx[12] = pos[0] + float(xx)*step;
+ mtx[13] = pos[1] + float(yy)*step;
+ mtx[14] = pos[2] + float(zz)*step;
- // Create static vertex buffer.
- mem = bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) );
- vbh = bgfx::createVertexBuffer(mem, PosColorVertex::ms_decl);
+ // Set model matrix for rendering.
+ bgfx::setTransform(mtx);
- // Create static index buffer.
- mem = bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) );
- ibh = bgfx::createIndexBuffer(mem);
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
- // Imgui.
- imguiCreate();
+ // Set render states.
+ bgfx::setState(BGFX_STATE_DEFAULT);
-#if BX_PLATFORM_EMSCRIPTEN
- emscripten_set_main_loop(&loop, -1, 1);
-#else
- while (!mainloop() );
-#endif // BX_PLATFORM_EMSCRIPTEN
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(0, m_program);
+ }
+ }
+ }
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ entry::MouseState m_mouseState;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- // Cleanup.
- imguiDestroy();
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
- bgfx::destroyProgram(program);
+ bool m_autoAdjust;
+ int32_t m_scrollArea;
+ int32_t m_dim;
+ int32_t m_maxDim;
+ uint32_t m_transform;
- // Shutdown bgfx.
- bgfx::shutdown();
+ int64_t m_timeOffset;
+
+ int64_t m_deltaTimeNs;
+ int64_t m_deltaTimeAvgNs;
+ int64_t m_numFrames;
+
+ bgfx::ProgramHandle m_program;
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(DrawStress);
diff --git a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
index 5765a6521dc..cf32868ff42 100644
--- a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
+++ b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_drawstress_glsl[89] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...va
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...va
0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void
0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // main ().{. gl_F
@@ -9,7 +9,7 @@ static const uint8_t fs_drawstress_glsl[89] =
};
static const uint8_t fs_drawstress_dx9[137] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
@@ -21,7 +21,7 @@ static const uint8_t fs_drawstress_dx9[137] =
};
static const uint8_t fs_drawstress_dx11[260] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0xf4, 0x00, 0x44, 0x58, 0x42, 0x43, // FSH....I....DXBC
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0xf4, 0x00, 0x44, 0x58, 0x42, 0x43, // FSH....I....DXBC
0xa6, 0x7f, 0x08, 0xe2, 0x95, 0xbd, 0x5f, 0xa3, 0x3f, 0x5b, 0x58, 0x8e, 0x54, 0x0f, 0x89, 0x67, // ......_.?[X.T..g
0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, // ........ISGNL...
@@ -39,3 +39,32 @@ static const uint8_t fs_drawstress_dx11[260] =
0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>...
0x00, 0x00, 0x00, 0x00, // ....
};
+static const uint8_t fs_drawstress_mtl[404] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x75, 0x73, // FSH....I......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // r0;.};.struct xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // t {. float4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // FragColor;.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // erUniform {.};.f
+ 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // tl_o;. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // l_FragColor = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, // tl_i.v_color0;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
+};
diff --git a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
index 12f40fbad01..27cb89d15c3 100644
--- a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
+++ b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_drawstress_glsl[325] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ...attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
@@ -24,8 +24,8 @@ static const uint8_t vs_drawstress_glsl[325] =
};
static const uint8_t vs_drawstress_dx9[319] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -47,8 +47,8 @@ static const uint8_t vs_drawstress_dx9[319] =
};
static const uint8_t vs_drawstress_dx11[510] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0xd4, 0x01, 0x44, 0x58, 0x42, 0x43, 0x32, 0x9b, 0xdd, 0xb5, 0xa9, 0xb7, 0x22, 0xf0, 0xcf, 0x5e, // ..DXBC2....."..^
0x34, 0x2c, 0x72, 0xf0, 0x87, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, // 4,r.............
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...|.......IS
@@ -80,3 +80,47 @@ static const uint8_t vs_drawstress_dx11[510] =
0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x00, 0x00, // ... ......F.....
0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, 0x00, // ..>.........@.
};
+static const uint8_t vs_drawstress_mtl[647] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH....I..x...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // bute(1)]];.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // erOutput {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // at4 gl_Position
+ 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // [[position]];.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // float4 v_color0;
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, // {. float4x4 u_m
+ 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, // odelViewProj;.};
+ 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .vertex xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, // tl_o;. float4 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // r_1.w = 1.0;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // mpvar_1.xyz = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // tl_i.a_position;
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // . _mtl_o.gl_Pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ition = (_mtl_u.
+ 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, // u_modelViewProj
+ 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // * tmpvar_1);. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // mtl_o.v_color0 =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // _mtl_i.a_color0
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ;. return _mtl_
+ 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // o;.}...
+};
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
index ee4b332e887..b5c2b38b0a4 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
@@ -7,16 +7,14 @@ $input v_view, v_normal
#include "../common/common.sh"
-uniform float u_time;
uniform vec4 u_params;
uniform mat4 u_mtx;
uniform vec4 u_flags;
-uniform vec3 u_camPos;
-uniform vec3 u_rgbDiff;
-uniform vec3 u_rgbSpec;
+uniform vec4 u_rgbDiff;
+uniform vec4 u_rgbSpec;
-SAMPLERCUBE(u_texCube, 4);
-SAMPLERCUBE(u_texCubeIrr, 5);
+SAMPLERCUBE(s_texCube, 0);
+SAMPLERCUBE(s_texCubeIrr, 1);
#define u_glossiness u_params.x
#define u_exposure u_params.y
@@ -53,10 +51,10 @@ void main()
vec3 cubeN = normalize(mul(u_mtx, vec4(n, 0.0)).xyz);
float mipLevel = min((1.0 - u_glossiness)*11.0 + 1.0, 8.0);
- vec3 cenv = textureCubeLod(u_texCube, cubeR, mipLevel).xyz;
+ vec3 cenv = textureCubeLod(s_texCube, cubeR, mipLevel).xyz;
- vec3 kd = u_rgbDiff;
- vec3 ks = u_rgbSpec;
+ vec3 kd = u_rgbDiff.xyz;
+ vec3 ks = u_rgbSpec.xyz;
vec3 cs = ks * u_diffspec;
vec3 cd = kd * (1.0 - cs);
@@ -66,7 +64,7 @@ void main()
vec3 spec = cs * pow(ndoth, pwr) * ( (pwr + 8.0)/8.0) * fresnel(cs, vdoth);
vec3 ambspec = fresnel(cs, ndotv) * cenv;
- vec3 ambdiff = cd * textureCube(u_texCubeIrr, cubeN).xyz;
+ vec3 ambdiff = cd * textureCube(s_texCubeIrr, cubeN).xyz;
vec3 lc = ( diff * u_doDiffuse + spec * u_doSpecular ) * ndotl * clight;
vec3 ec = (ambdiff * u_doDiffuseIbl + ambspec * u_doSpecularIbl);
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
index aedab151989..66835748202 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
@@ -7,7 +7,7 @@ $input v_dir
#include "../common/common.sh"
-SAMPLERCUBE(u_texCube, 4);
+SAMPLERCUBE(s_texCube, 0);
uniform vec4 u_params;
#define u_exposure u_params.y
@@ -16,7 +16,7 @@ void main()
{
vec3 dir = normalize(v_dir);
- vec4 color = textureCubeLod(u_texCube, dir, 0.0);
+ vec4 color = textureCubeLod(s_texCube, dir, 0.0);
color *= exp2(u_exposure);
gl_FragColor = toFilmic(color);
diff --git a/3rdparty/bgfx/examples/18-ibl/ibl.cpp b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
index 732598784c3..2d98aba5ac2 100644
--- a/3rdparty/bgfx/examples/18-ibl/ibl.cpp
+++ b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
@@ -23,22 +23,20 @@ struct Uniforms
m_time = 0.0f;
bx::mtxIdentity(m_mtx);
- u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
- u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
- u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv);
- u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Uniform4fv);
- u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Uniform3fv);
- u_rgbDiff = bgfx::createUniform("u_rgbDiff", bgfx::UniformType::Uniform3fv);
- u_rgbSpec = bgfx::createUniform("u_rgbSpec", bgfx::UniformType::Uniform3fv);
+ u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Vec4);
+ u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Vec4);
+ u_rgbDiff = bgfx::createUniform("u_rgbDiff", bgfx::UniformType::Vec4);
+ u_rgbSpec = bgfx::createUniform("u_rgbSpec", bgfx::UniformType::Vec4);
}
// Call this once per frame.
void submitPerFrameUniforms()
{
- bgfx::setUniform(u_time, &m_time);
- bgfx::setUniform(u_mtx, m_mtx);
- bgfx::setUniform(u_flags, m_flags);
- bgfx::setUniform(u_camPos, m_camPos);
+ bgfx::setUniform(u_mtx, m_mtx);
+ bgfx::setUniform(u_flags, m_flags);
+ bgfx::setUniform(u_camPos, m_camPosTime);
bgfx::setUniform(u_rgbDiff, m_rgbDiff);
bgfx::setUniform(u_rgbSpec, m_rgbSpec);
}
@@ -57,7 +55,6 @@ struct Uniforms
bgfx::destroyUniform(u_flags);
bgfx::destroyUniform(u_params);
bgfx::destroyUniform(u_mtx);
- bgfx::destroyUniform(u_time);
}
union
@@ -67,7 +64,7 @@ struct Uniforms
float m_glossiness;
float m_exposure;
float m_diffspec;
- float m_unused0;
+ float m_time;
};
float m_params[4];
@@ -86,13 +83,11 @@ struct Uniforms
float m_flags[4];
};
- float m_time;
float m_mtx[16];
- float m_camPos[3];
- float m_rgbDiff[3];
- float m_rgbSpec[3];
+ float m_camPosTime[4];
+ float m_rgbDiff[4];
+ float m_rgbSpec[4];
- bgfx::UniformHandle u_time;
bgfx::UniformHandle u_mtx;
bgfx::UniformHandle u_params;
bgfx::UniformHandle u_flags;
@@ -256,17 +251,15 @@ int _main_(int /*_argc*/, char** /*_argv*/)
lightProbes[LightProbe::Grace ].load("grace");
LightProbe::Enum currentLightProbe = LightProbe::Wells;
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
- bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
- bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv);
- bgfx::UniformHandle u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Uniform4fv);
- bgfx::UniformHandle u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Uniform3fv);
+ bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ bgfx::UniformHandle u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Vec4);
+ bgfx::UniformHandle u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Vec4);
+ bgfx::UniformHandle s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1);
+ bgfx::UniformHandle s_texCubeIrr = bgfx::createUniform("s_texCubeIrr", bgfx::UniformType::Int1);
- bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1i);
- bgfx::UniformHandle u_texCubeIrr = bgfx::createUniform("u_texCubeIrr", bgfx::UniformType::Uniform1i);
-
- bgfx::ProgramHandle programMesh = loadProgram("vs_ibl_mesh", "fs_ibl_mesh");
- bgfx::ProgramHandle programSky = loadProgram("vs_ibl_skybox", "fs_ibl_skybox");
+ bgfx::ProgramHandle programMesh = loadProgram("vs_ibl_mesh", "fs_ibl_mesh");
+ bgfx::ProgramHandle programSky = loadProgram("vs_ibl_skybox", "fs_ibl_skybox");
Mesh* meshBunny;
meshBunny = meshLoad("meshes/bunny.bin");
@@ -316,9 +309,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, width
, height
);
@@ -354,7 +348,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
settings.m_crossCubemapPreview = ImguiCubemap::Enum( (settings.m_crossCubemapPreview+1) % ImguiCubemap::Count);
}
- imguiSlider("Texture LOD", lod, float(0.0f), 10.1f, 0.1f);
+ imguiSlider("Texture LOD", lod, 0.0f, 10.1f, 0.1f);
imguiEndScrollArea();
@@ -441,8 +435,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
s_uniforms.m_flags[1] = float(settings.m_specular);
s_uniforms.m_flags[2] = float(settings.m_diffuseIbl);
s_uniforms.m_flags[3] = float(settings.m_specularIbl);
- memcpy(s_uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float));
- memcpy(s_uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float));
+ memcpy(s_uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float) );
+ memcpy(s_uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float) );
s_uniforms.submitPerFrameUniforms();
@@ -454,7 +448,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
const double toMs = 1000.0/freq;
time += (float)(frameTime*settings.m_speed/freq);
- s_uniforms.m_time = time;
+ s_uniforms.m_camPosTime[3] = time;
// Use debug font to print information about this example.
bgfx::dbgTextClear();
@@ -478,7 +472,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewTransform(0, view, proj);
bx::mtxLookAt(view, eye, at);
- memcpy(s_uniforms.m_camPos, eye, 3*sizeof(float));
+ memcpy(s_uniforms.m_camPosTime, eye, 3*sizeof(float) );
bx::mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
bgfx::setViewTransform(1, view, proj);
@@ -486,12 +480,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewRect(1, 0, 0, width, height);
// View 0.
- bgfx::setTexture(4, u_texCube, lightProbes[currentLightProbe].m_tex);
- bgfx::setProgram(programSky);
+ bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE);
screenSpaceQuad( (float)width, (float)height, true);
s_uniforms.submitPerDrawUniforms();
- bgfx::submit(0);
+ bgfx::submit(0, programSky);
// View 1.
float mtx[16];
@@ -507,8 +500,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, 0.0f
);
- bgfx::setTexture(4, u_texCube, lightProbes[currentLightProbe].m_tex);
- bgfx::setTexture(5, u_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
+ bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex);
+ bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr);
meshSubmit(meshBunny, 1, programMesh, mtx);
// Advance to next frame. Rendering thread will be kicked to
@@ -526,10 +519,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::destroyUniform(u_flags);
bgfx::destroyUniform(u_params);
bgfx::destroyUniform(u_mtx);
- bgfx::destroyUniform(u_time);
- bgfx::destroyUniform(u_texCube);
- bgfx::destroyUniform(u_texCubeIrr);
+ bgfx::destroyUniform(s_texCube);
+ bgfx::destroyUniform(s_texCubeIrr);
for (uint8_t ii = 0; ii < LightProbe::Count; ++ii)
{
diff --git a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
index 10ade6a3cd1..d38b44559e7 100644
--- a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
@@ -8,7 +8,7 @@ $output v_view, v_normal
#include "../common/common.sh"
-uniform vec3 u_camPos;
+uniform vec4 u_camPos;
void main()
{
@@ -16,5 +16,5 @@ void main()
vec3 normal = a_normal * 2.0 - 1.0;
v_normal = mul(u_model[0], vec4(normal, 0.0) ).xyz;
- v_view = normalize(u_camPos - mul(u_model[0], vec4(a_position, 1.0)).xyz);
+ v_view = normalize(u_camPos.xyz - mul(u_model[0], vec4(a_position, 1.0)).xyz);
}
diff --git a/3rdparty/bgfx/examples/19-oit/oit.cpp b/3rdparty/bgfx/examples/19-oit/oit.cpp
index 35b242296cd..7457364e86e 100644
--- a/3rdparty/bgfx/examples/19-oit/oit.cpp
+++ b/3rdparty/bgfx/examples/19-oit/oit.cpp
@@ -193,9 +193,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(mem);
// Create texture sampler uniforms.
- bgfx::UniformHandle u_texColor0 = bgfx::createUniform("u_texColor0", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_texColor1 = bgfx::createUniform("u_texColor1", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle u_color = bgfx::createUniform("u_color", bgfx::UniformType::Uniform4fv);
+ bgfx::UniformHandle s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Int1);
+ bgfx::UniformHandle s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Int1);
+ bgfx::UniformHandle u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
bgfx::ProgramHandle blend = loadProgram("vs_oit", "fs_oit" );
bgfx::ProgramHandle wbSeparatePass = loadProgram("vs_oit", "fs_oit_wb_separate" );
@@ -242,9 +242,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, width
, height
);
@@ -310,11 +311,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewTransform(0, view, proj);
- // Set clear color palette for index 0
- bgfx::setClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f);
+ // Set palette color for index 0
+ bgfx::setPaletteColor(0, 0.0f, 0.0f, 0.0f, 0.0f);
- // Set clear color palette for index 1
- bgfx::setClearColor(1, 1.0f, 1.0f, 1.0f, 1.0f);
+ // Set palette color for index 1
+ bgfx::setPaletteColor(1, 1.0f, 1.0f, 1.0f, 1.0f);
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
@@ -380,11 +381,12 @@ int _main_(int /*_argc*/, char** /*_argv*/)
| BGFX_STATE_MSAA
;
+ bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;
switch (mode)
{
case 0:
// Set vertex and fragment shaders.
- bgfx::setProgram(blend);
+ program = blend;
// Set render states.
bgfx::setState(state
@@ -394,7 +396,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
case 1:
// Set vertex and fragment shaders.
- bgfx::setProgram(wbSeparatePass);
+ program = wbSeparatePass;
// Set render states.
bgfx::setState(state
@@ -404,7 +406,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
default:
// Set vertex and fragment shaders.
- bgfx::setProgram(wbPass);
+ program = wbPass;
// Set render states.
bgfx::setState(state
@@ -417,22 +419,23 @@ int _main_(int /*_argc*/, char** /*_argv*/)
}
// Submit primitive for rendering to view 0.
- bgfx::submit(0);
+ bgfx::submit(0, program);
}
}
}
if (0 != mode)
{
- bgfx::setTexture(0, u_texColor0, fbtextures[0]);
- bgfx::setTexture(1, u_texColor1, fbtextures[1]);
- bgfx::setProgram(1 == mode ? wbSeparateBlit : wbBlit);
+ bgfx::setTexture(0, s_texColor0, fbtextures[0]);
+ bgfx::setTexture(1, s_texColor1, fbtextures[1]);
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_SRC_ALPHA, BGFX_STATE_BLEND_SRC_ALPHA)
);
screenSpaceQuad( (float)width, (float)height, s_flipV);
- bgfx::submit(1);
+ bgfx::submit(1
+ , 1 == mode ? wbSeparateBlit : wbBlit
+ );
}
// Advance to next frame. Rendering thread will be kicked to
@@ -451,8 +454,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::destroyProgram(wbSeparateBlit);
bgfx::destroyProgram(wbPass);
bgfx::destroyProgram(wbBlit);
- bgfx::destroyUniform(u_texColor0);
- bgfx::destroyUniform(u_texColor1);
+ bgfx::destroyUniform(s_texColor0);
+ bgfx::destroyUniform(s_texColor1);
bgfx::destroyUniform(u_color);
// Shutdown bgfx.
diff --git a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
index 4439dd03c64..2f4060a40b8 100644
--- a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
+++ b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <math.h>
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/string.h>
#include <bx/timer.h>
#include "entry/entry.h"
@@ -91,12 +91,12 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
// Window
nvgBeginPath(vg);
nvgRoundedRect(vg, x,y, w,h, cornerRadius);
- nvgFillColor(vg, nvgRGBA(28,30,34,192));
- // nvgFillColor(vg, nvgRGBA(0,0,0,128));
+ nvgFillColor(vg, nvgRGBA(28,30,34,192) );
+ // nvgFillColor(vg, nvgRGBA(0,0,0,128) );
nvgFill(vg);
// Drop shadow
- shadowPaint = nvgBoxGradient(vg, x,y+2, w,h, cornerRadius*2, 10, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+ shadowPaint = nvgBoxGradient(vg, x,y+2, w,h, cornerRadius*2, 10, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, x-10,y-10, w+20,h+30);
nvgRoundedRect(vg, x,y, w,h, cornerRadius);
@@ -105,7 +105,7 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
nvgFill(vg);
// Header
- headerPaint = nvgLinearGradient(vg, x,y,x,y+15, nvgRGBA(255,255,255,8), nvgRGBA(0,0,0,16));
+ headerPaint = nvgLinearGradient(vg, x,y,x,y+15, nvgRGBA(255,255,255,8), nvgRGBA(0,0,0,16) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+1,y+1, w-2,30, cornerRadius-1);
nvgFillPaint(vg, headerPaint);
@@ -113,7 +113,7 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
nvgBeginPath(vg);
nvgMoveTo(vg, x+0.5f, y+0.5f+30);
nvgLineTo(vg, x+0.5f+w-1, y+0.5f+30);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,32));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,32) );
nvgStroke(vg);
nvgFontSize(vg, 18.0f);
@@ -121,11 +121,11 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
nvgFontBlur(vg,2);
- nvgFillColor(vg, nvgRGBA(0,0,0,128));
+ nvgFillColor(vg, nvgRGBA(0,0,0,128) );
nvgText(vg, x+w/2,y+16+1, title, NULL);
nvgFontBlur(vg,0);
- nvgFillColor(vg, nvgRGBA(220,220,220,160));
+ nvgFillColor(vg, nvgRGBA(220,220,220,160) );
nvgText(vg, x+w/2,y+16, title, NULL);
nvgRestore(vg);
@@ -138,7 +138,7 @@ void drawSearchBox(struct NVGcontext* vg, const char* text, float x, float y, fl
float cornerRadius = h/2-1;
// Edit
- bg = nvgBoxGradient(vg, x,y+1.5f, w,h, h/2,5, nvgRGBA(0,0,0,16), nvgRGBA(0,0,0,92));
+ bg = nvgBoxGradient(vg, x,y+1.5f, w,h, h/2,5, nvgRGBA(0,0,0,16), nvgRGBA(0,0,0,92) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x,y, w,h, cornerRadius);
nvgFillPaint(vg, bg);
@@ -146,25 +146,25 @@ void drawSearchBox(struct NVGcontext* vg, const char* text, float x, float y, fl
/* nvgBeginPath(vg);
nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
nvgStroke(vg);*/
nvgFontSize(vg, h*1.3f);
nvgFontFace(vg, "icons");
- nvgFillColor(vg, nvgRGBA(255,255,255,64));
+ nvgFillColor(vg, nvgRGBA(255,255,255,64) );
nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
nvgText(vg, x+h*0.55f, y+h*0.55f, cpToUTF8(ICON_SEARCH,icon), NULL);
nvgFontSize(vg, 20.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,32));
+ nvgFillColor(vg, nvgRGBA(255,255,255,32) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+h*1.05f,y+h*0.5f,text, NULL);
nvgFontSize(vg, h*1.3f);
nvgFontFace(vg, "icons");
- nvgFillColor(vg, nvgRGBA(255,255,255,32));
+ nvgFillColor(vg, nvgRGBA(255,255,255,32) );
nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
nvgText(vg, x+w-h*0.55f, y+h*0.55f, cpToUTF8(ICON_CIRCLED_CROSS,icon), NULL);
}
@@ -175,7 +175,7 @@ void drawDropDown(struct NVGcontext* vg, const char* text, float x, float y, flo
char icon[8];
float cornerRadius = 4.0f;
- bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16));
+ bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
nvgFillPaint(vg, bg);
@@ -183,18 +183,18 @@ void drawDropDown(struct NVGcontext* vg, const char* text, float x, float y, flo
nvgBeginPath(vg);
nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
nvgStroke(vg);
nvgFontSize(vg, 20.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,160));
+ nvgFillColor(vg, nvgRGBA(255,255,255,160) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
nvgFontSize(vg, h*1.3f);
nvgFontFace(vg, "icons");
- nvgFillColor(vg, nvgRGBA(255,255,255,64));
+ nvgFillColor(vg, nvgRGBA(255,255,255,64) );
nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
nvgText(vg, x+w-h*0.5f, y+h*0.5f, cpToUTF8(ICON_CHEVRON_RIGHT,icon), NULL);
}
@@ -205,7 +205,7 @@ void drawLabel(struct NVGcontext* vg, const char* text, float x, float y, float
nvgFontSize(vg, 18.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,128));
+ nvgFillColor(vg, nvgRGBA(255,255,255,128) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x,y+h*0.5f,text, NULL);
@@ -215,7 +215,7 @@ void drawEditBoxBase(struct NVGcontext* vg, float x, float y, float w, float h)
{
struct NVGpaint bg;
// Edit
- bg = nvgBoxGradient(vg, x+1,y+1+1.5f, w-2,h-2, 3,4, nvgRGBA(255,255,255,32), nvgRGBA(32,32,32,32));
+ bg = nvgBoxGradient(vg, x+1,y+1+1.5f, w-2,h-2, 3,4, nvgRGBA(255,255,255,32), nvgRGBA(32,32,32,32) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+1,y+1, w-2,h-2, 4-1);
nvgFillPaint(vg, bg);
@@ -223,7 +223,7 @@ void drawEditBoxBase(struct NVGcontext* vg, float x, float y, float w, float h)
nvgBeginPath(vg);
nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, 4-0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
nvgStroke(vg);
}
@@ -233,7 +233,7 @@ void drawEditBox(struct NVGcontext* vg, const char* text, float x, float y, floa
nvgFontSize(vg, 20.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,64));
+ nvgFillColor(vg, nvgRGBA(255,255,255,64) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
}
@@ -249,13 +249,13 @@ void drawEditBoxNum(struct NVGcontext* vg,
nvgFontSize(vg, 18.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,64));
+ nvgFillColor(vg, nvgRGBA(255,255,255,64) );
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+w-h*0.3f,y+h*0.5f,units, NULL);
nvgFontSize(vg, 20.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,128));
+ nvgFillColor(vg, nvgRGBA(255,255,255,128) );
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+w-uw-h*0.5f,y+h*0.5f,text, NULL);
}
@@ -268,12 +268,12 @@ void drawCheckBox(struct NVGcontext* vg, const char* text, float x, float y, flo
nvgFontSize(vg, 18.0f);
nvgFontFace(vg, "sans");
- nvgFillColor(vg, nvgRGBA(255,255,255,160));
+ nvgFillColor(vg, nvgRGBA(255,255,255,160) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+28,y+h*0.5f,text, NULL);
- bg = nvgBoxGradient(vg, x+1,y+(int)(h*0.5f)-9+1, 18,18, 3,3, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92));
+ bg = nvgBoxGradient(vg, x+1,y+(int)(h*0.5f)-9+1, 18,18, 3,3, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+1,y+(int)(h*0.5f)-9, 18,18, 3);
nvgFillPaint(vg, bg);
@@ -281,7 +281,7 @@ void drawCheckBox(struct NVGcontext* vg, const char* text, float x, float y, flo
nvgFontSize(vg, 40);
nvgFontFace(vg, "icons");
- nvgFillColor(vg, nvgRGBA(255,255,255,128));
+ nvgFillColor(vg, nvgRGBA(255,255,255,128) );
nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
nvgText(vg, x+9+2, y+h*0.5f, cpToUTF8(ICON_CHECK,icon), NULL);
}
@@ -293,10 +293,10 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
float cornerRadius = 4.0f;
float tw = 0, iw = 0;
- bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,isBlack(col)?16:32), nvgRGBA(0,0,0,isBlack(col)?16:32));
+ bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,isBlack(col)?16:32), nvgRGBA(0,0,0,isBlack(col)?16:32) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
- if (!isBlack(col)) {
+ if (!isBlack(col) ) {
nvgFillColor(vg, col);
nvgFill(vg);
}
@@ -305,7 +305,7 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
nvgBeginPath(vg);
nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
nvgStroke(vg);
nvgFontSize(vg, 20.0f);
@@ -321,7 +321,7 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
if (preicon != 0) {
nvgFontSize(vg, h*1.3f);
nvgFontFace(vg, "icons");
- nvgFillColor(vg, nvgRGBA(255,255,255,96));
+ nvgFillColor(vg, nvgRGBA(255,255,255,96) );
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
nvgText(vg, x+w*0.5f-tw*0.5f-iw*0.75f, y+h*0.5f, cpToUTF8(preicon,icon), NULL);
}
@@ -329,9 +329,9 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
nvgFontSize(vg, 20.0f);
nvgFontFace(vg, "sans-bold");
nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
- nvgFillColor(vg, nvgRGBA(0,0,0,160));
+ nvgFillColor(vg, nvgRGBA(0,0,0,160) );
nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f-1,text, NULL);
- nvgFillColor(vg, nvgRGBA(255,255,255,160));
+ nvgFillColor(vg, nvgRGBA(255,255,255,160) );
nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f,text, NULL);
}
@@ -345,14 +345,14 @@ void drawSlider(struct NVGcontext* vg, float pos, float x, float y, float w, flo
// nvgClearState(vg);
// Slot
- bg = nvgBoxGradient(vg, x,cy-2+1, w,4, 2,2, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,128));
+ bg = nvgBoxGradient(vg, x,cy-2+1, w,4, 2,2, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,128) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x,cy-2, w,4, 2);
nvgFillPaint(vg, bg);
nvgFill(vg);
// Knob Shadow
- bg = nvgRadialGradient(vg, x+(int)(pos*w),cy+1, kr-3,kr+3, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0));
+ bg = nvgRadialGradient(vg, x+(int)(pos*w),cy+1, kr-3,kr+3, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, x+(int)(pos*w)-kr-5,cy-kr-5,kr*2+5+5,kr*2+5+5+3);
nvgCircle(vg, x+(int)(pos*w),cy, kr);
@@ -361,17 +361,17 @@ void drawSlider(struct NVGcontext* vg, float pos, float x, float y, float w, flo
nvgFill(vg);
// Knob
- knob = nvgLinearGradient(vg, x,cy-kr,x,cy+kr, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16));
+ knob = nvgLinearGradient(vg, x,cy-kr,x,cy+kr, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16) );
nvgBeginPath(vg);
nvgCircle(vg, x+(int)(pos*w),cy, kr-1);
- nvgFillColor(vg, nvgRGBA(40,43,48,255));
+ nvgFillColor(vg, nvgRGBA(40,43,48,255) );
nvgFill(vg);
nvgFillPaint(vg, knob);
nvgFill(vg);
nvgBeginPath(vg);
nvgCircle(vg, x+(int)(pos*w),cy, kr-0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,92));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,92) );
nvgStroke(vg);
nvgRestore(vg);
@@ -390,14 +390,14 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
float br = (ex < ey ? ex : ey) * 0.5f;
float blink = 1 - powf(sinf(t*0.5f),200)*0.8f;
- bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16));
+ bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16) );
nvgBeginPath(vg);
nvgEllipse(vg, lx+3.0f,ly+16.0f, ex,ey);
nvgEllipse(vg, rx+3.0f,ry+16.0f, ex,ey);
nvgFillPaint(vg, bg);
nvgFill(vg);
- bg = nvgLinearGradient(vg, x,y+h*0.25f,x+w*0.1f,y+h, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255));
+ bg = nvgLinearGradient(vg, x,y+h*0.25f,x+w*0.1f,y+h, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255) );
nvgBeginPath(vg);
nvgEllipse(vg, lx,ly, ex,ey);
nvgEllipse(vg, rx,ry, ex,ey);
@@ -414,7 +414,7 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
dy *= ey*0.5f;
nvgBeginPath(vg);
nvgEllipse(vg, lx+dx,ly+dy+ey*0.25f*(1-blink), br,br*blink);
- nvgFillColor(vg, nvgRGBA(32,32,32,255));
+ nvgFillColor(vg, nvgRGBA(32,32,32,255) );
nvgFill(vg);
dx = (mx - rx) / (ex * 10);
@@ -427,16 +427,16 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
dy *= ey*0.5f;
nvgBeginPath(vg);
nvgEllipse(vg, rx+dx,ry+dy+ey*0.25f*(1-blink), br,br*blink);
- nvgFillColor(vg, nvgRGBA(32,32,32,255));
+ nvgFillColor(vg, nvgRGBA(32,32,32,255) );
nvgFill(vg);
- gloss = nvgRadialGradient(vg, lx-ex*0.25f,ly-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0));
+ gloss = nvgRadialGradient(vg, lx-ex*0.25f,ly-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0) );
nvgBeginPath(vg);
nvgEllipse(vg, lx,ly, ex,ey);
nvgFillPaint(vg, gloss);
nvgFill(vg);
- gloss = nvgRadialGradient(vg, rx-ex*0.25f,ry-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0));
+ gloss = nvgRadialGradient(vg, rx-ex*0.25f,ry-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0) );
nvgBeginPath(vg);
nvgEllipse(vg, rx,ry, ex,ey);
nvgFillPaint(vg, gloss);
@@ -451,12 +451,12 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
float dx = w/5.0f;
int i;
- samples[0] = (1+sinf(t*1.2345f+cosf(t*0.33457f)*0.44f))*0.5f;
- samples[1] = (1+sinf(t*0.68363f+cosf(t*1.3f)*1.55f))*0.5f;
- samples[2] = (1+sinf(t*1.1642f+cosf(t*0.33457f)*1.24f))*0.5f;
- samples[3] = (1+sinf(t*0.56345f+cosf(t*1.63f)*0.14f))*0.5f;
- samples[4] = (1+sinf(t*1.6245f+cosf(t*0.254f)*0.3f))*0.5f;
- samples[5] = (1+sinf(t*0.345f+cosf(t*0.03f)*0.6f))*0.5f;
+ samples[0] = (1+sinf(t*1.2345f+cosf(t*0.33457f)*0.44f) )*0.5f;
+ samples[1] = (1+sinf(t*0.68363f+cosf(t*1.3f)*1.55f) )*0.5f;
+ samples[2] = (1+sinf(t*1.1642f+cosf(t*0.33457f)*1.24f) )*0.5f;
+ samples[3] = (1+sinf(t*0.56345f+cosf(t*1.63f)*0.14f) )*0.5f;
+ samples[4] = (1+sinf(t*1.6245f+cosf(t*0.254f)*0.3f) )*0.5f;
+ samples[5] = (1+sinf(t*0.345f+cosf(t*0.03f)*0.6f) )*0.5f;
for (i = 0; i < 6; i++) {
sx[i] = x+i*dx;
@@ -464,7 +464,7 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
}
// Graph background
- bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(0,160,192,0), nvgRGBA(0,160,192,64));
+ bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(0,160,192,0), nvgRGBA(0,160,192,64) );
nvgBeginPath(vg);
nvgMoveTo(vg, sx[0], sy[0]);
for (i = 1; i < 6; i++)
@@ -479,7 +479,7 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
nvgMoveTo(vg, sx[0], sy[0]+2);
for (i = 1; i < 6; i++)
nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1]+2, sx[i]-dx*0.5f,sy[i]+2, sx[i],sy[i]+2);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,32));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,32) );
nvgStrokeWidth(vg, 3.0f);
nvgStroke(vg);
@@ -487,13 +487,13 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
nvgMoveTo(vg, sx[0], sy[0]);
for (i = 1; i < 6; i++)
nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1], sx[i]-dx*0.5f,sy[i], sx[i],sy[i]);
- nvgStrokeColor(vg, nvgRGBA(0,160,192,255));
+ nvgStrokeColor(vg, nvgRGBA(0,160,192,255) );
nvgStrokeWidth(vg, 3.0f);
nvgStroke(vg);
// Graph sample pos
for (i = 0; i < 6; i++) {
- bg = nvgRadialGradient(vg, sx[i],sy[i]+2, 3.0f,8.0f, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,0));
+ bg = nvgRadialGradient(vg, sx[i],sy[i]+2, 3.0f,8.0f, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, sx[i]-10, sy[i]-10+2, 20,20);
nvgFillPaint(vg, bg);
@@ -503,12 +503,12 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
nvgBeginPath(vg);
for (i = 0; i < 6; i++)
nvgCircle(vg, sx[i], sy[i], 4.0f);
- nvgFillColor(vg, nvgRGBA(0,160,192,255));
+ nvgFillColor(vg, nvgRGBA(0,160,192,255) );
nvgFill(vg);
nvgBeginPath(vg);
for (i = 0; i < 6; i++)
nvgCircle(vg, sx[i], sy[i], 2.0f);
- nvgFillColor(vg, nvgRGBA(220,220,220,255));
+ nvgFillColor(vg, nvgRGBA(220,220,220,255) );
nvgFill(vg);
nvgStrokeWidth(vg, 1.0f);
@@ -524,14 +524,14 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
int imgw, imgh;
float stackh = (nimages/2) * (thumb+10) + 10;
int i;
- float u = (1+cosf(t*0.5f))*0.5f;
+ float u = (1+cosf(t*0.5f) )*0.5f;
float scrollh;
nvgSave(vg);
// nvgClearState(vg);
// Drop shadow
- shadowPaint = nvgBoxGradient(vg, x,y+4, w,h, cornerRadius*2, 20, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+ shadowPaint = nvgBoxGradient(vg, x,y+4, w,h, cornerRadius*2, 20, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, x-10,y-10, w+20,h+30);
nvgRoundedRect(vg, x,y, w,h, cornerRadius);
@@ -545,7 +545,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
nvgMoveTo(vg, x-10,y+arry);
nvgLineTo(vg, x+1,y+arry-11);
nvgLineTo(vg, x+1,y+arry+11);
- nvgFillColor(vg, nvgRGBA(200,200,200,255));
+ nvgFillColor(vg, nvgRGBA(200,200,200,255) );
nvgFill(vg);
nvgSave(vg);
@@ -576,7 +576,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
nvgFillPaint(vg, imgPaint);
nvgFill(vg);
- shadowPaint = nvgBoxGradient(vg, tx-1,ty, thumb+2,thumb+2, 5, 3, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+ shadowPaint = nvgBoxGradient(vg, tx-1,ty, thumb+2,thumb+2, 5, 3, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, tx-5,ty-5, thumb+10,thumb+10);
nvgRoundedRect(vg, tx,ty, thumb,thumb, 6);
@@ -587,38 +587,38 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
nvgBeginPath(vg);
nvgRoundedRect(vg, tx+0.5f,ty+0.5f, thumb-1,thumb-1, 4-0.5f);
nvgStrokeWidth(vg,1.0f);
- nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+ nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
nvgStroke(vg);
}
nvgRestore(vg);
// Hide fades
- fadePaint = nvgLinearGradient(vg, x,y,x,y+6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0));
+ fadePaint = nvgLinearGradient(vg, x,y,x,y+6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0) );
nvgBeginPath(vg);
nvgRect(vg, x+4,y,w-8,6);
nvgFillPaint(vg, fadePaint);
nvgFill(vg);
- fadePaint = nvgLinearGradient(vg, x,y+h,x,y+h-6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0));
+ fadePaint = nvgLinearGradient(vg, x,y+h,x,y+h-6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0) );
nvgBeginPath(vg);
nvgRect(vg, x+4,y+h-6,w-8,6);
nvgFillPaint(vg, fadePaint);
nvgFill(vg);
// Scroll bar
- shadowPaint = nvgBoxGradient(vg, x+w-12+1,y+4+1, 8,h-8, 3,4, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92));
+ shadowPaint = nvgBoxGradient(vg, x+w-12+1,y+4+1, 8,h-8, 3,4, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+w-12,y+4, 8,h-8, 3);
nvgFillPaint(vg, shadowPaint);
- // nvgFillColor(vg, nvgRGBA(255,0,0,128));
+ // nvgFillColor(vg, nvgRGBA(255,0,0,128) );
nvgFill(vg);
scrollh = (h/stackh) * (h-8);
- shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255));
+ shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255) );
nvgBeginPath(vg);
nvgRoundedRect(vg, x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2);
nvgFillPaint(vg, shadowPaint);
- // nvgFillColor(vg, nvgRGBA(0,0,0,128));
+ // nvgFillColor(vg, nvgRGBA(0,0,0,128) );
nvgFill(vg);
nvgRestore(vg);
@@ -635,7 +635,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
/* nvgBeginPath(vg);
nvgRect(vg, x,y,w,h);
- nvgFillColor(vg, nvgRGBA(255,0,0,128));
+ nvgFillColor(vg, nvgRGBA(255,0,0,128) );
nvgFill(vg);*/
cx = x + w*0.5f;
@@ -656,7 +656,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
ay = cy + sinf(a0) * (r0+r1)*0.5f;
bx = cx + cosf(a1) * (r0+r1)*0.5f;
by = cy + sinf(a1) * (r0+r1)*0.5f;
- paint = nvgLinearGradient(vg, ax,ay, bx,by, nvgHSLA(a0/(NVG_PI*2),1.0f,0.55f,255), nvgHSLA(a1/(NVG_PI*2),1.0f,0.55f,255));
+ paint = nvgLinearGradient(vg, ax,ay, bx,by, nvgHSLA(a0/(NVG_PI*2),1.0f,0.55f,255), nvgHSLA(a1/(NVG_PI*2),1.0f,0.55f,255) );
nvgFillPaint(vg, paint);
nvgFill(vg);
}
@@ -664,7 +664,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
nvgBeginPath(vg);
nvgCircle(vg, cx,cy, r0-0.5f);
nvgCircle(vg, cx,cy, r1+0.5f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,64));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,64) );
nvgStrokeWidth(vg, 1.0f);
nvgStroke(vg);
@@ -677,10 +677,10 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
nvgStrokeWidth(vg, 2.0f);
nvgBeginPath(vg);
nvgRect(vg, r0-1,-3,r1-r0+2,6);
- nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+ nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
nvgStroke(vg);
- paint = nvgBoxGradient(vg, r0-3,-5,r1-r0+6,10, 2,4, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+ paint = nvgBoxGradient(vg, r0-3,-5,r1-r0+6,10, 2,4, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, r0-2-10,-4-10,r1-r0+4+20,8+20);
nvgRect(vg, r0-2,-4,r1-r0+4,8);
@@ -699,13 +699,13 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
nvgLineTo(vg, ax,ay);
nvgLineTo(vg, bx,by);
nvgClosePath(vg);
- paint = nvgLinearGradient(vg, r,0, ax,ay, nvgHSLA(hue,1.0f,0.5f,255), nvgRGBA(255,255,255,255));
+ paint = nvgLinearGradient(vg, r,0, ax,ay, nvgHSLA(hue,1.0f,0.5f,255), nvgRGBA(255,255,255,255) );
nvgFillPaint(vg, paint);
nvgFill(vg);
- paint = nvgLinearGradient(vg, (r+ax)*0.5f,(0+ay)*0.5f, bx,by, nvgRGBA(0,0,0,0), nvgRGBA(0,0,0,255));
+ paint = nvgLinearGradient(vg, (r+ax)*0.5f,(0+ay)*0.5f, bx,by, nvgRGBA(0,0,0,0), nvgRGBA(0,0,0,255) );
nvgFillPaint(vg, paint);
nvgFill(vg);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,64));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,64) );
nvgStroke(vg);
// Select circle on triangle
@@ -714,10 +714,10 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
nvgStrokeWidth(vg, 2.0f);
nvgBeginPath(vg);
nvgCircle(vg, ax,ay,5);
- nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+ nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
nvgStroke(vg);
- paint = nvgRadialGradient(vg, ax,ay, 7,9, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0));
+ paint = nvgRadialGradient(vg, ax,ay, 7,9, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0) );
nvgBeginPath(vg);
nvgRect(vg, ax-20,ay-20,40,40);
nvgCircle(vg, ax,ay,7);
@@ -760,7 +760,7 @@ void drawLines(struct NVGcontext* vg, float x, float y, float w, float h, float
nvgLineJoin(vg, joins[j]);
nvgStrokeWidth(vg, s*0.3f);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,160));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,160) );
nvgBeginPath(vg);
nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
nvgLineTo(vg, fx+pts[2], fy+pts[3]);
@@ -772,7 +772,7 @@ void drawLines(struct NVGcontext* vg, float x, float y, float w, float h, float
nvgLineJoin(vg, NVG_BEVEL);
nvgStrokeWidth(vg, 1.0f);
- nvgStrokeColor(vg, nvgRGBA(0,192,255,255));
+ nvgStrokeColor(vg, nvgRGBA(0,192,255,255) );
nvgBeginPath(vg);
nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
nvgLineTo(vg, fx+pts[2], fy+pts[3]);
@@ -1029,11 +1029,11 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
int hit = mx > x && mx < (x+width) && my >= y && my < (y+lineh);
nvgBeginPath(vg);
- nvgFillColor(vg, nvgRGBA(255,255,255,hit?64:8));
+ nvgFillColor(vg, nvgRGBA(255,255,255,hit?64:8) );
nvgRect(vg, x, y, row->width, lineh);
nvgFill(vg);
- nvgFillColor(vg, nvgRGBA(255,255,255,255));
+ nvgFillColor(vg, nvgRGBA(255,255,255,255) );
nvgText(vg, x, y, row->start, row->end);
if (hit) {
@@ -1049,7 +1049,7 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
px = tgx;
}
nvgBeginPath(vg);
- nvgFillColor(vg, nvgRGBA(255,192,0,255));
+ nvgFillColor(vg, nvgRGBA(255,192,0,255) );
nvgRect(vg, caretx, y, 1, lineh);
nvgFill(vg);
@@ -1074,17 +1074,17 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
nvgTextBounds(vg, gx,gy, txt, NULL, bounds);
nvgBeginPath(vg);
- nvgFillColor(vg, nvgRGBA(255,192,0,255));
+ nvgFillColor(vg, nvgRGBA(255,192,0,255) );
nvgRoundedRect(vg
- , roundf(bounds[0])-4.0f
- , roundf(bounds[1])-2.0f
- , roundf(bounds[2]-bounds[0])+8.0f
- , roundf(bounds[3]-bounds[1])+4.0f
- , (roundf(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f
+ , bx::fround(bounds[0])-4.0f
+ , bx::fround(bounds[1])-2.0f
+ , bx::fround(bounds[2]-bounds[0])+8.0f
+ , bx::fround(bounds[3]-bounds[1])+4.0f
+ , (bx::fround(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f
);
nvgFill(vg);
- nvgFillColor(vg, nvgRGBA(32,32,32,255));
+ nvgFillColor(vg, nvgRGBA(32,32,32,255) );
nvgText(vg, gx,gy, txt, NULL);
}
@@ -1096,21 +1096,21 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
nvgTextBoxBounds(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL, bounds);
nvgBeginPath(vg);
- nvgFillColor(vg, nvgRGBA(220,220,220,255));
+ nvgFillColor(vg, nvgRGBA(220,220,220,255) );
nvgRoundedRect(vg
- , roundf(bounds[0]-2.0f)
- , roundf(bounds[1]-2.0f)
- , roundf(bounds[2]-bounds[0])+4.0f
- , roundf(bounds[3]-bounds[1])+4.0f
+ , bx::fround(bounds[0]-2.0f)
+ , bx::fround(bounds[1]-2.0f)
+ , bx::fround(bounds[2]-bounds[0])+4.0f
+ , bx::fround(bounds[3]-bounds[1])+4.0f
, 3.0f
);
- px = float( (int)((bounds[2]+bounds[0])/2) );
+ px = float( (int)( (bounds[2]+bounds[0])/2) );
nvgMoveTo(vg, px,bounds[1] - 10);
nvgLineTo(vg, px+7,bounds[1]+1);
nvgLineTo(vg, px-7,bounds[1]+1);
nvgFill(vg);
- nvgFillColor(vg, nvgRGBA(0,0,0,220));
+ nvgFillColor(vg, nvgRGBA(0,0,0,220) );
nvgTextBox(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL);
nvgRestore(vg);
@@ -1120,7 +1120,7 @@ void drawWidths(struct NVGcontext* vg, float x, float y, float width)
{
nvgSave(vg);
- nvgStrokeColor(vg, nvgRGBA(0,0,0,255));
+ nvgStrokeColor(vg, nvgRGBA(0,0,0,255) );
for (uint32_t ii = 0; ii < 20; ++ii)
{
@@ -1179,7 +1179,7 @@ void renderDemo(struct NVGcontext* vg, float mx, float my, float width, float he
drawEditBox(vg, "Password", x,y, 280,28);
y += 38;
drawCheckBox(vg, "Remember me", x,y, 140,28);
- drawButton(vg, ICON_LOGIN, "Sign in", x+138, y, 140, 28, nvgRGBA(0,96,128,255));
+ drawButton(vg, ICON_LOGIN, "Sign in", x+138, y, 140, 28, nvgRGBA(0,96,128,255) );
y += 45;
// Slider
@@ -1189,8 +1189,8 @@ void renderDemo(struct NVGcontext* vg, float mx, float my, float width, float he
drawSlider(vg, 0.4f, x,y, 170,28);
y += 55;
- drawButton(vg, ICON_TRASH, "Delete", x, y, 160, 28, nvgRGBA(128,16,8,255));
- drawButton(vg, 0, "Cancel", x+170, y, 110, 28, nvgRGBA(0,0,0,0));
+ drawButton(vg, ICON_TRASH, "Delete", x, y, 160, 28, nvgRGBA(128,16,8,255) );
+ drawButton(vg, 0, "Cancel", x+170, y, 110, 28, nvgRGBA(0,0,0,0) );
// Thumbnails box
drawThumbnails(vg, popx, popy-30, 160, 300, data->images, 12, t);
@@ -1247,7 +1247,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
// Use debug font to print information about this example.
bgfx::dbgTextClear();
diff --git a/3rdparty/bgfx/examples/21-deferred/deferred.cpp b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
index 7d7190c6d7f..019b8920518 100644
--- a/3rdparty/bgfx/examples/21-deferred/deferred.cpp
+++ b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
@@ -15,13 +15,9 @@
#define RENDER_PASS_DEBUG_LIGHTS_ID 3
#define RENDER_PASS_DEBUG_GBUFFER_ID 4
+static float s_texelHalf = 0.0f;
static bool s_originBottomLeft = false;
-inline void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far)
-{
- bx::mtxProj(_result, _fovy, _aspect, _near, _far, s_originBottomLeft);
-}
-
struct PosNormalTangentTexcoordVertex
{
float m_x;
@@ -217,523 +213,581 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf
}
}
-int _main_(int /*_argc*/, char** /*_argv*/)
+class Deferred : public entry::AppI
{
- uint32_t width = 1280;
- uint32_t height = 720;
- uint32_t debug = BGFX_DEBUG_TEXT;
- uint32_t reset = BGFX_RESET_VSYNC;
-
- bgfx::init();
- bgfx::reset(width, height, reset);
-
- // Enable debug text.
- bgfx::setDebug(debug);
-
- // Set clear color palette for index 0
- bgfx::setClearColor(0, UINT32_C(0x00000000) );
-
- // Set clear color palette for index 1
- bgfx::setClearColor(1, UINT32_C(0x303030ff) );
-
- // Set geometry pass view clear state.
- bgfx::setViewClear(RENDER_PASS_GEOMETRY_ID
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 1.0f
- , 0
- , 1
- );
-
- // Set light pass view clear state.
- bgfx::setViewClear(RENDER_PASS_LIGHT_ID
- , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
- , 1.0f
- , 0
- , 0
- );
-
- // Create vertex stream declaration.
- PosNormalTangentTexcoordVertex::init();
- PosTexCoord0Vertex::init();
- DebugVertex::init();
-
- calcTangents(s_cubeVertices
- , BX_COUNTOF(s_cubeVertices)
- , PosNormalTangentTexcoordVertex::ms_decl
- , s_cubeIndices
- , BX_COUNTOF(s_cubeIndices)
- );
-
- // Create static vertex buffer.
- bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(
- bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
- , PosNormalTangentTexcoordVertex::ms_decl
- );
-
- // Create static index buffer.
- bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
-
- // Create texture sampler uniforms.
- bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Uniform1iv);
-
- bgfx::UniformHandle s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Uniform1iv);
- bgfx::UniformHandle s_light = bgfx::createUniform("s_light", bgfx::UniformType::Uniform1iv);
-
- bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
- bgfx::UniformHandle u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Uniform4fv);
- bgfx::UniformHandle u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Uniform4fv);
-
- // Create program from shaders.
- bgfx::ProgramHandle geomProgram = loadProgram("vs_deferred_geom", "fs_deferred_geom");
- bgfx::ProgramHandle lightProgram = loadProgram("vs_deferred_light", "fs_deferred_light");
- bgfx::ProgramHandle combineProgram = loadProgram("vs_deferred_combine", "fs_deferred_combine");
- bgfx::ProgramHandle debugProgram = loadProgram("vs_deferred_debug", "fs_deferred_debug");
- bgfx::ProgramHandle lineProgram = loadProgram("vs_deferred_debug_line", "fs_deferred_debug_line");
-
- // Load diffuse texture.
- bgfx::TextureHandle textureColor = loadTexture("fieldstone-rgba.dds");
-
- // Load normal texture.
- bgfx::TextureHandle textureNormal = loadTexture("fieldstone-n.dds");
-
- bgfx::TextureHandle gbufferTex[3] = { BGFX_INVALID_HANDLE, BGFX_INVALID_HANDLE, BGFX_INVALID_HANDLE };
- bgfx::FrameBufferHandle gbuffer = BGFX_INVALID_HANDLE;
- bgfx::FrameBufferHandle lightBuffer = BGFX_INVALID_HANDLE;
-
- // Imgui.
- imguiCreate();
-
- const int64_t timeOffset = bx::getHPCounter();
- const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
- const float texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
- s_originBottomLeft = bgfx::RendererType::OpenGL == renderer || bgfx::RendererType::OpenGLES == renderer;
-
- // Get renderer capabilities info.
- const bgfx::Caps* caps = bgfx::getCaps();
-
- uint32_t oldWidth = 0;
- uint32_t oldHeight = 0;
- uint32_t oldReset = reset;
-
- int32_t scrollArea = 0;
- int32_t numLights = 512;
- float lightAnimationSpeed = 0.3f;
- bool animateMesh = true;
- bool showScissorRects = false;
- bool showGBuffer = true;
-
- float view[16];
- float initialPos[3] = { 0.0f, 0.0f, -15.0f };
- cameraCreate();
- cameraSetPosition(initialPos);
- cameraSetVerticalAngle(0.0f);
- cameraGetViewMtx(view);
-
- entry::MouseState mouseState;
- while (!entry::processEvents(width, height, debug, reset, &mouseState) )
+ void init(int /*_argc*/, char** /*_argv*/) BX_OVERRIDE
{
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const double toMs = 1000.0/freq;
- const float deltaTime = float(frameTime/freq);
-
- float time = (float)( (now-timeOffset)/freq);
-
- // Use debug font to print information about this example.
- bgfx::dbgTextClear();
- bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/21-deferred");
- bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: MRT rendering and deferred shading.");
- bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
-
- if (2 > caps->maxFBAttachments)
- {
- // When multiple render targets (MRT) is not supported by GPU,
- // implement alternative code path that doesn't use MRT.
- bool blink = uint32_t(time*3.0f)&1;
- bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " MRT not supported by GPU. ");
+ m_width = 1280;
+ m_height = 720;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, width, height);
+ bgfx::init();
+ bgfx::reset(m_width, m_height, m_reset);
- // This dummy draw call is here to make sure that view 0 is cleared
- // if no other draw calls are submitted to view 0.
- bgfx::submit(0);
- }
- else
- {
- if (oldWidth != width
- || oldHeight != height
- || oldReset != reset
- || !bgfx::isValid(gbuffer) )
- {
- // Recreate variable size render targets when resolution changes.
- oldWidth = width;
- oldHeight = height;
- oldReset = reset;
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
- if (bgfx::isValid(gbuffer) )
- {
- bgfx::destroyFrameBuffer(gbuffer);
- }
+ // Set palette color for index 0
+ bgfx::setPaletteColor(0, UINT32_C(0x00000000) );
- const uint32_t samplerFlags = 0
- | BGFX_TEXTURE_RT
- | BGFX_TEXTURE_MIN_POINT
- | BGFX_TEXTURE_MAG_POINT
- | BGFX_TEXTURE_MIP_POINT
- | BGFX_TEXTURE_U_CLAMP
- | BGFX_TEXTURE_V_CLAMP
- ;
- gbufferTex[0] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, samplerFlags);
- gbufferTex[1] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, samplerFlags);
- gbufferTex[2] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::D24, samplerFlags);
- gbuffer = bgfx::createFrameBuffer(BX_COUNTOF(gbufferTex), gbufferTex, true);
-
- if (bgfx::isValid(lightBuffer) )
- {
- bgfx::destroyFrameBuffer(lightBuffer);
- }
+ // Set palette color for index 1
+ bgfx::setPaletteColor(1, UINT32_C(0x303030ff) );
- lightBuffer = bgfx::createFrameBuffer(width, height, bgfx::TextureFormat::BGRA8, samplerFlags);
- }
+ // Set geometry pass view clear state.
+ bgfx::setViewClear(RENDER_PASS_GEOMETRY_ID
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 1.0f
+ , 0
+ , 1
+ );
- imguiBeginFrame(mouseState.m_mx
- , mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ // Set light pass view clear state.
+ bgfx::setViewClear(RENDER_PASS_LIGHT_ID
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 1.0f
+ , 0
, 0
- , width
- , height
);
- imguiBeginScrollArea("Settings", width - width / 5 - 10, 10, width / 5, height / 3, &scrollArea);
- imguiSeparatorLine();
+ // Create vertex stream declaration.
+ PosNormalTangentTexcoordVertex::init();
+ PosTexCoord0Vertex::init();
+ DebugVertex::init();
- imguiSlider("Num lights", numLights, 1, 2048);
+ calcTangents(s_cubeVertices
+ , BX_COUNTOF(s_cubeVertices)
+ , PosNormalTangentTexcoordVertex::ms_decl
+ , s_cubeIndices
+ , BX_COUNTOF(s_cubeIndices)
+ );
- if (imguiCheck("Show G-Buffer.", showGBuffer) )
- {
- showGBuffer = !showGBuffer;
- }
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
+ , PosNormalTangentTexcoordVertex::ms_decl
+ );
- if (imguiCheck("Show light scissor.", showScissorRects) )
- {
- showScissorRects = !showScissorRects;
- }
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
- if (imguiCheck("Animate mesh.", animateMesh) )
- {
- animateMesh = !animateMesh;
- }
+ // Create texture sampler uniforms.
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1);
- imguiSlider("Lights animation speed", lightAnimationSpeed, 0.0f, 0.4f, 0.01f);
+ s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Int1);
+ s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Int1);
+ s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Int1);
+ s_light = bgfx::createUniform("s_light", bgfx::UniformType::Int1);
- imguiEndScrollArea();
- imguiEndFrame();
+ u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
+ u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4);
+ u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Vec4);
- // Update camera.
- cameraUpdate(deltaTime, mouseState);
- cameraGetViewMtx(view);
+ // Create program from shaders.
+ m_geomProgram = loadProgram("vs_deferred_geom", "fs_deferred_geom");
+ m_lightProgram = loadProgram("vs_deferred_light", "fs_deferred_light");
+ m_combineProgram = loadProgram("vs_deferred_combine", "fs_deferred_combine");
+ m_debugProgram = loadProgram("vs_deferred_debug", "fs_deferred_debug");
+ m_lineProgram = loadProgram("vs_deferred_debug_line", "fs_deferred_debug_line");
- // Setup views
- float vp[16];
- float invMvp[16];
- {
- bgfx::setViewRect(RENDER_PASS_GEOMETRY_ID, 0, 0, width, height);
- bgfx::setViewRect(RENDER_PASS_LIGHT_ID, 0, 0, width, height);
- bgfx::setViewRect(RENDER_PASS_COMBINE_ID, 0, 0, width, height);
- bgfx::setViewRect(RENDER_PASS_DEBUG_LIGHTS_ID, 0, 0, width, height);
- bgfx::setViewRect(RENDER_PASS_DEBUG_GBUFFER_ID, 0, 0, width, height);
+ // Load diffuse texture.
+ m_textureColor = loadTexture("fieldstone-rgba.dds");
- bgfx::setViewFrameBuffer(RENDER_PASS_LIGHT_ID, lightBuffer);
+ // Load normal texture.
+ m_textureNormal = loadTexture("fieldstone-n.dds");
- float proj[16];
- mtxProj(proj, 60.0f, float(width)/float(height), 0.1f, 100.0f);
+ m_gbufferTex[0].idx = bgfx::invalidHandle;
+ m_gbufferTex[1].idx = bgfx::invalidHandle;
+ m_gbufferTex[2].idx = bgfx::invalidHandle;
+ m_gbuffer.idx = bgfx::invalidHandle;
+ m_lightBuffer.idx = bgfx::invalidHandle;
- bgfx::setViewFrameBuffer(RENDER_PASS_GEOMETRY_ID, gbuffer);
- bgfx::setViewTransform(RENDER_PASS_GEOMETRY_ID, view, proj);
+ // Imgui.
+ imguiCreate();
- bx::mtxMul(vp, view, proj);
- bx::mtxInverse(invMvp, vp);
+ m_timeOffset = bx::getHPCounter();
+ const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
+ s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
+ s_originBottomLeft = bgfx::RendererType::OpenGL == renderer || bgfx::RendererType::OpenGLES == renderer;
- bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
- bgfx::setViewTransform(RENDER_PASS_LIGHT_ID, NULL, proj);
- bgfx::setViewTransform(RENDER_PASS_COMBINE_ID, NULL, proj);
+ // Get renderer capabilities info.
+ m_caps = bgfx::getCaps();
- const float aspectRatio = float(height)/float(width);
- const float size = 10.0f;
- bx::mtxOrtho(proj, -size, size, size*aspectRatio, -size*aspectRatio, 0.0f, 1000.0f);
- bgfx::setViewTransform(RENDER_PASS_DEBUG_GBUFFER_ID, NULL, proj);
+ m_oldWidth = 0;
+ m_oldHeight = 0;
+ m_oldReset = m_reset;
- bx::mtxOrtho(proj, 0.0f, (float)width, 0.0f, (float)height, 0.0f, 1000.0f);
- bgfx::setViewTransform(RENDER_PASS_DEBUG_LIGHTS_ID, NULL, proj);
- }
+ m_scrollArea = 0;
+ m_numLights = 512;
+ m_lightAnimationSpeed = 0.3f;
+ m_animateMesh = true;
+ m_showScissorRects = false;
+ m_showGBuffer = true;
+
+ cameraCreate();
+
+ const float initialPos[3] = { 0.0f, 0.0f, -15.0f };
+ cameraSetPosition(initialPos);
+ cameraSetVerticalAngle(0.0f);
+ }
+
+ virtual int shutdown() BX_OVERRIDE
+ {
+ // Cleanup.
+ cameraDestroy();
+ imguiDestroy();
+
+ if (bgfx::isValid(m_gbuffer) )
+ {
+ bgfx::destroyFrameBuffer(m_gbuffer);
+ bgfx::destroyFrameBuffer(m_lightBuffer);
+ }
+
+ bgfx::destroyIndexBuffer(m_ibh);
+ bgfx::destroyVertexBuffer(m_vbh);
+
+ bgfx::destroyProgram(m_geomProgram);
+ bgfx::destroyProgram(m_lightProgram);
+ bgfx::destroyProgram(m_combineProgram);
+ bgfx::destroyProgram(m_debugProgram);
+ bgfx::destroyProgram(m_lineProgram);
+
+ bgfx::destroyTexture(m_textureColor);
+ bgfx::destroyTexture(m_textureNormal);
+ bgfx::destroyUniform(s_texColor);
+ bgfx::destroyUniform(s_texNormal);
+
+ bgfx::destroyUniform(s_albedo);
+ bgfx::destroyUniform(s_normal);
+ bgfx::destroyUniform(s_depth);
+ bgfx::destroyUniform(s_light);
+
+ bgfx::destroyUniform(u_lightPosRadius);
+ bgfx::destroyUniform(u_lightRgbInnerR);
+ bgfx::destroyUniform(u_mtx);
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
- const uint32_t dim = 11;
- const float offset = (float(dim-1) * 3.0f) * 0.5f;
+ return 0;
+ }
+
+ bool update() BX_OVERRIDE
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const double toMs = 1000.0/freq;
+ const float deltaTime = float(frameTime/freq);
+
+ float time = (float)( (now-m_timeOffset)/freq);
+
+ // Use m_debug font to print information about this example.
+ bgfx::dbgTextClear();
+ bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/21-deferred");
+ bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: MRT rendering and deferred shading.");
+ bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
+
+ if (2 > m_caps->maxFBAttachments)
+ {
+ // When multiple render targets (MRT) is not supported by GPU,
+ // implement alternative code path that doesn't use MRT.
+ bool blink = uint32_t(time*3.0f)&1;
+ bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " MRT not supported by GPU. ");
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, m_width, m_height);
- // Draw into geometry pass.
- for (uint32_t yy = 0; yy < dim; ++yy)
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+ }
+ else
{
- for (uint32_t xx = 0; xx < dim; ++xx)
+ if (m_oldWidth != m_width
+ || m_oldHeight != m_height
+ || m_oldReset != m_reset
+ || !bgfx::isValid(m_gbuffer) )
{
- float mtx[16];
- if (animateMesh)
+ // Recreate variable size render targets when resolution changes.
+ m_oldWidth = m_width;
+ m_oldHeight = m_height;
+ m_oldReset = m_reset;
+
+ if (bgfx::isValid(m_gbuffer) )
{
- bx::mtxRotateXY(mtx, time*1.023f + xx*0.21f, time*0.03f + yy*0.37f);
+ bgfx::destroyFrameBuffer(m_gbuffer);
}
- else
+
+ const uint32_t samplerFlags = 0
+ | BGFX_TEXTURE_RT
+ | BGFX_TEXTURE_MIN_POINT
+ | BGFX_TEXTURE_MAG_POINT
+ | BGFX_TEXTURE_MIP_POINT
+ | BGFX_TEXTURE_U_CLAMP
+ | BGFX_TEXTURE_V_CLAMP
+ ;
+ m_gbufferTex[0] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, samplerFlags);
+ m_gbufferTex[1] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::BGRA8, samplerFlags);
+ m_gbufferTex[2] = bgfx::createTexture2D(m_width, m_height, 1, bgfx::TextureFormat::D24, samplerFlags);
+ m_gbuffer = bgfx::createFrameBuffer(BX_COUNTOF(m_gbufferTex), m_gbufferTex, true);
+
+ if (bgfx::isValid(m_lightBuffer) )
{
- bx::mtxIdentity(mtx);
+ bgfx::destroyFrameBuffer(m_lightBuffer);
}
- mtx[12] = -offset + float(xx)*3.0f;
- mtx[13] = -offset + float(yy)*3.0f;
- mtx[14] = 0.0f;
- // Set transform for draw call.
- bgfx::setTransform(mtx);
+ m_lightBuffer = bgfx::createFrameBuffer(m_width, m_height, bgfx::TextureFormat::BGRA8, samplerFlags);
+ }
- // Set vertex and fragment shaders.
- bgfx::setProgram(geomProgram);
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , m_width
+ , m_height
+ );
- // Set vertex and index buffer.
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh);
+ imguiBeginScrollArea("Settings", m_width - m_width / 5 - 10, 10, m_width / 5, m_height / 3, &m_scrollArea);
+ imguiSeparatorLine();
- // Bind textures.
- bgfx::setTexture(0, s_texColor, textureColor);
- bgfx::setTexture(1, s_texNormal, textureNormal);
+ imguiSlider("Num lights", m_numLights, 1, 2048);
- // Set render states.
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_DEPTH_WRITE
- | BGFX_STATE_DEPTH_TEST_LESS
- | BGFX_STATE_MSAA
- );
+ if (imguiCheck("Show G-Buffer.", m_showGBuffer) )
+ {
+ m_showGBuffer = !m_showGBuffer;
+ }
- // Submit primitive for rendering to view 0.
- bgfx::submit(RENDER_PASS_GEOMETRY_ID);
+ if (imguiCheck("Show light scissor.", m_showScissorRects) )
+ {
+ m_showScissorRects = !m_showScissorRects;
}
- }
- // Draw lights into light buffer.
- for (int32_t light = 0; light < numLights; ++light)
- {
- Sphere lightPosRadius;
+ if (imguiCheck("Animate mesh.", m_animateMesh) )
+ {
+ m_animateMesh = !m_animateMesh;
+ }
- float lightTime = time * lightAnimationSpeed * (sinf(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f);
- lightPosRadius.m_center[0] = sinf( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset;
- lightPosRadius.m_center[1] = cosf( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset;
- lightPosRadius.m_center[2] = sinf( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f;
- lightPosRadius.m_radius = 2.0f;
+ imguiSlider("Lights animation speed", m_lightAnimationSpeed, 0.0f, 0.4f, 0.01f);
- Aabb aabb;
- sphereToAabb(aabb, lightPosRadius);
+ imguiEndScrollArea();
+ imguiEndFrame();
- float box[8][3] =
- {
- { aabb.m_min[0], aabb.m_min[1], aabb.m_min[2] },
- { aabb.m_min[0], aabb.m_min[1], aabb.m_max[2] },
- { aabb.m_min[0], aabb.m_max[1], aabb.m_min[2] },
- { aabb.m_min[0], aabb.m_max[1], aabb.m_max[2] },
- { aabb.m_max[0], aabb.m_min[1], aabb.m_min[2] },
- { aabb.m_max[0], aabb.m_min[1], aabb.m_max[2] },
- { aabb.m_max[0], aabb.m_max[1], aabb.m_min[2] },
- { aabb.m_max[0], aabb.m_max[1], aabb.m_max[2] },
- };
-
- float xyz[3];
- bx::vec3MulMtxH(xyz, box[0], vp);
- float minx = xyz[0];
- float miny = xyz[1];
- float maxx = xyz[0];
- float maxy = xyz[1];
- float maxz = xyz[2];
-
- for (uint32_t ii = 1; ii < 8; ++ii)
+ // Update camera.
+ cameraUpdate(deltaTime, m_mouseState);
+
+ float view[16];
+ cameraGetViewMtx(view);
+
+ // Setup views
+ float vp[16];
+ float invMvp[16];
{
- bx::vec3MulMtxH(xyz, box[ii], vp);
- minx = bx::fmin(minx, xyz[0]);
- miny = bx::fmin(miny, xyz[1]);
- maxx = bx::fmax(maxx, xyz[0]);
- maxy = bx::fmax(maxy, xyz[1]);
- maxz = bx::fmax(maxz, xyz[2]);
+ bgfx::setViewRect(RENDER_PASS_GEOMETRY_ID, 0, 0, m_width, m_height);
+ bgfx::setViewRect(RENDER_PASS_LIGHT_ID, 0, 0, m_width, m_height);
+ bgfx::setViewRect(RENDER_PASS_COMBINE_ID, 0, 0, m_width, m_height);
+ bgfx::setViewRect(RENDER_PASS_DEBUG_LIGHTS_ID, 0, 0, m_width, m_height);
+ bgfx::setViewRect(RENDER_PASS_DEBUG_GBUFFER_ID, 0, 0, m_width, m_height);
+
+ bgfx::setViewFrameBuffer(RENDER_PASS_LIGHT_ID, m_lightBuffer);
+
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, s_originBottomLeft);
+
+ bgfx::setViewFrameBuffer(RENDER_PASS_GEOMETRY_ID, m_gbuffer);
+ bgfx::setViewTransform(RENDER_PASS_GEOMETRY_ID, view, proj);
+
+ bx::mtxMul(vp, view, proj);
+ bx::mtxInverse(invMvp, vp);
+
+ bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+ bgfx::setViewTransform(RENDER_PASS_LIGHT_ID, NULL, proj);
+ bgfx::setViewTransform(RENDER_PASS_COMBINE_ID, NULL, proj);
+
+ const float aspectRatio = float(m_height)/float(m_width);
+ const float size = 10.0f;
+ bx::mtxOrtho(proj, -size, size, size*aspectRatio, -size*aspectRatio, 0.0f, 1000.0f);
+ bgfx::setViewTransform(RENDER_PASS_DEBUG_GBUFFER_ID, NULL, proj);
+
+ bx::mtxOrtho(proj, 0.0f, (float)m_width, 0.0f, (float)m_height, 0.0f, 1000.0f);
+ bgfx::setViewTransform(RENDER_PASS_DEBUG_LIGHTS_ID, NULL, proj);
}
- // Cull light if it's fully behind camera.
- if (maxz >= 0.0f)
- {
- float x0 = bx::fclamp( (minx * 0.5f + 0.5f) * width, 0.0f, (float)width);
- float y0 = bx::fclamp( (miny * 0.5f + 0.5f) * height, 0.0f, (float)height);
- float x1 = bx::fclamp( (maxx * 0.5f + 0.5f) * width, 0.0f, (float)width);
- float y1 = bx::fclamp( (maxy * 0.5f + 0.5f) * height, 0.0f, (float)height);
+ const uint32_t dim = 11;
+ const float offset = (float(dim-1) * 3.0f) * 0.5f;
- if (showScissorRects)
+ // Draw into geometry pass.
+ for (uint32_t yy = 0; yy < dim; ++yy)
+ {
+ for (uint32_t xx = 0; xx < dim; ++xx)
{
- bgfx::TransientVertexBuffer tvb;
- bgfx::TransientIndexBuffer tib;
- if (bgfx::allocTransientBuffers(&tvb, DebugVertex::ms_decl, 4, &tib, 8) )
+ float mtx[16];
+ if (m_animateMesh)
+ {
+ bx::mtxRotateXY(mtx, time*1.023f + xx*0.21f, time*0.03f + yy*0.37f);
+ }
+ else
{
- uint32_t abgr = 0x8000ff00;
-
- DebugVertex* vertex = (DebugVertex*)tvb.data;
- vertex->m_x = x0;
- vertex->m_y = y0;
- vertex->m_z = 0.0f;
- vertex->m_abgr = abgr;
- ++vertex;
-
- vertex->m_x = x1;
- vertex->m_y = y0;
- vertex->m_z = 0.0f;
- vertex->m_abgr = abgr;
- ++vertex;
-
- vertex->m_x = x1;
- vertex->m_y = y1;
- vertex->m_z = 0.0f;
- vertex->m_abgr = abgr;
- ++vertex;
-
- vertex->m_x = x0;
- vertex->m_y = y1;
- vertex->m_z = 0.0f;
- vertex->m_abgr = abgr;
-
- uint16_t* indices = (uint16_t*)tib.data;
- *indices++ = 0;
- *indices++ = 1;
- *indices++ = 1;
- *indices++ = 2;
- *indices++ = 2;
- *indices++ = 3;
- *indices++ = 3;
- *indices++ = 0;
-
- bgfx::setProgram(lineProgram);
- bgfx::setVertexBuffer(&tvb);
- bgfx::setIndexBuffer(&tib);
- bgfx::setState(0
+ bx::mtxIdentity(mtx);
+ }
+ mtx[12] = -offset + float(xx)*3.0f;
+ mtx[13] = -offset + float(yy)*3.0f;
+ mtx[14] = 0.0f;
+
+ // Set transform for draw call.
+ bgfx::setTransform(mtx);
+
+ // Set vertex and index buffer.
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
+
+ // Bind textures.
+ bgfx::setTexture(0, s_texColor, m_textureColor);
+ bgfx::setTexture(1, s_texNormal, m_textureNormal);
+
+ // Set render states.
+ bgfx::setState(0
| BGFX_STATE_RGB_WRITE
- | BGFX_STATE_PT_LINES
- | BGFX_STATE_BLEND_ALPHA
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_MSAA
);
- bgfx::submit(RENDER_PASS_DEBUG_LIGHTS_ID);
- }
+
+ // Submit primitive for rendering to view 0.
+ bgfx::submit(RENDER_PASS_GEOMETRY_ID, m_geomProgram);
}
+ }
+
+ // Draw lights into light buffer.
+ for (int32_t light = 0; light < m_numLights; ++light)
+ {
+ Sphere lightPosRadius;
+
+ float lightTime = time * m_lightAnimationSpeed * (sinf(light/float(m_numLights) * bx::piHalf ) * 0.5f + 0.5f);
+ lightPosRadius.m_center[0] = sinf( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset;
+ lightPosRadius.m_center[1] = cosf( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset;
+ lightPosRadius.m_center[2] = sinf( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f;
+ lightPosRadius.m_radius = 2.0f;
+
+ Aabb aabb;
+ sphereToAabb(aabb, lightPosRadius);
- uint8_t val = light&7;
- float lightRgbInnerR[4] =
+ float box[8][3] =
{
- val & 0x1 ? 1.0f : 0.25f,
- val & 0x2 ? 1.0f : 0.25f,
- val & 0x4 ? 1.0f : 0.25f,
- 0.8f,
+ { aabb.m_min[0], aabb.m_min[1], aabb.m_min[2] },
+ { aabb.m_min[0], aabb.m_min[1], aabb.m_max[2] },
+ { aabb.m_min[0], aabb.m_max[1], aabb.m_min[2] },
+ { aabb.m_min[0], aabb.m_max[1], aabb.m_max[2] },
+ { aabb.m_max[0], aabb.m_min[1], aabb.m_min[2] },
+ { aabb.m_max[0], aabb.m_min[1], aabb.m_max[2] },
+ { aabb.m_max[0], aabb.m_max[1], aabb.m_min[2] },
+ { aabb.m_max[0], aabb.m_max[1], aabb.m_max[2] },
};
- // Draw light.
- bgfx::setUniform(u_lightPosRadius, &lightPosRadius);
- bgfx::setUniform(u_lightRgbInnerR, lightRgbInnerR);
- bgfx::setUniform(u_mtx, invMvp);
- const uint16_t scissorHeight = uint16_t(y1-y0);
- bgfx::setScissor(uint16_t(x0), height-scissorHeight-uint16_t(y0), uint16_t(x1-x0), scissorHeight);
- bgfx::setTexture(0, s_normal, gbuffer, 1);
- bgfx::setTexture(1, s_depth, gbuffer, 2);
- bgfx::setProgram(lightProgram);
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_BLEND_ADD
- );
- screenSpaceQuad( (float)width, (float)height, texelHalf, s_originBottomLeft);
- bgfx::submit(RENDER_PASS_LIGHT_ID);
- }
- }
+ float xyz[3];
+ bx::vec3MulMtxH(xyz, box[0], vp);
+ float minx = xyz[0];
+ float miny = xyz[1];
+ float maxx = xyz[0];
+ float maxy = xyz[1];
+ float maxz = xyz[2];
- // Combine color and light buffers.
- bgfx::setTexture(0, s_albedo, gbuffer, 0);
- bgfx::setTexture(1, s_light, lightBuffer, 0);
- bgfx::setProgram(combineProgram);
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- );
- screenSpaceQuad( (float)width, (float)height, texelHalf, s_originBottomLeft);
- bgfx::submit(RENDER_PASS_COMBINE_ID);
+ for (uint32_t ii = 1; ii < 8; ++ii)
+ {
+ bx::vec3MulMtxH(xyz, box[ii], vp);
+ minx = bx::fmin(minx, xyz[0]);
+ miny = bx::fmin(miny, xyz[1]);
+ maxx = bx::fmax(maxx, xyz[0]);
+ maxy = bx::fmax(maxy, xyz[1]);
+ maxz = bx::fmax(maxz, xyz[2]);
+ }
- if (showGBuffer)
- {
- const float aspectRatio = float(width)/float(height);
+ // Cull light if it's fully behind camera.
+ if (maxz >= 0.0f)
+ {
+ float x0 = bx::fclamp( (minx * 0.5f + 0.5f) * m_width, 0.0f, (float)m_width);
+ float y0 = bx::fclamp( (miny * 0.5f + 0.5f) * m_height, 0.0f, (float)m_height);
+ float x1 = bx::fclamp( (maxx * 0.5f + 0.5f) * m_width, 0.0f, (float)m_width);
+ float y1 = bx::fclamp( (maxy * 0.5f + 0.5f) * m_height, 0.0f, (float)m_height);
- // Draw debug GBuffer.
- for (uint32_t ii = 0; ii < BX_COUNTOF(gbufferTex); ++ii)
- {
- float mtx[16];
- bx::mtxSRT(mtx
- , aspectRatio, 1.0f, 1.0f
- , 0.0f, 0.0f, 0.0f
- , -7.9f - BX_COUNTOF(gbufferTex)*0.1f*0.5f + ii*2.1f*aspectRatio, 4.0f, 0.0f
- );
+ if (m_showScissorRects)
+ {
+ bgfx::TransientVertexBuffer tvb;
+ bgfx::TransientIndexBuffer tib;
+ if (bgfx::allocTransientBuffers(&tvb, DebugVertex::ms_decl, 4, &tib, 8) )
+ {
+ uint32_t abgr = 0x8000ff00;
+
+ DebugVertex* vertex = (DebugVertex*)tvb.data;
+ vertex->m_x = x0;
+ vertex->m_y = y0;
+ vertex->m_z = 0.0f;
+ vertex->m_abgr = abgr;
+ ++vertex;
+
+ vertex->m_x = x1;
+ vertex->m_y = y0;
+ vertex->m_z = 0.0f;
+ vertex->m_abgr = abgr;
+ ++vertex;
+
+ vertex->m_x = x1;
+ vertex->m_y = y1;
+ vertex->m_z = 0.0f;
+ vertex->m_abgr = abgr;
+ ++vertex;
+
+ vertex->m_x = x0;
+ vertex->m_y = y1;
+ vertex->m_z = 0.0f;
+ vertex->m_abgr = abgr;
+
+ uint16_t* indices = (uint16_t*)tib.data;
+ *indices++ = 0;
+ *indices++ = 1;
+ *indices++ = 1;
+ *indices++ = 2;
+ *indices++ = 2;
+ *indices++ = 3;
+ *indices++ = 3;
+ *indices++ = 0;
+
+ bgfx::setVertexBuffer(&tvb);
+ bgfx::setIndexBuffer(&tib);
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_PT_LINES
+ | BGFX_STATE_BLEND_ALPHA
+ );
+ bgfx::submit(RENDER_PASS_DEBUG_LIGHTS_ID, m_lineProgram);
+ }
+ }
- bgfx::setTransform(mtx);
- bgfx::setProgram(debugProgram);
- bgfx::setVertexBuffer(vbh);
- bgfx::setIndexBuffer(ibh, 0, 6);
- bgfx::setTexture(0, s_texColor, gbufferTex[ii]);
- bgfx::setState(BGFX_STATE_RGB_WRITE);
- bgfx::submit(RENDER_PASS_DEBUG_GBUFFER_ID);
+ uint8_t val = light&7;
+ float lightRgbInnerR[4] =
+ {
+ val & 0x1 ? 1.0f : 0.25f,
+ val & 0x2 ? 1.0f : 0.25f,
+ val & 0x4 ? 1.0f : 0.25f,
+ 0.8f,
+ };
+
+ // Draw light.
+ bgfx::setUniform(u_lightPosRadius, &lightPosRadius);
+ bgfx::setUniform(u_lightRgbInnerR, lightRgbInnerR);
+ bgfx::setUniform(u_mtx, invMvp);
+ const uint16_t scissorHeight = uint16_t(y1-y0);
+ bgfx::setScissor(uint16_t(x0), m_height-scissorHeight-uint16_t(y0), uint16_t(x1-x0), scissorHeight);
+ bgfx::setTexture(0, s_normal, m_gbuffer, 1);
+ bgfx::setTexture(1, s_depth, m_gbuffer, 2);
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_BLEND_ADD
+ );
+ screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, s_originBottomLeft);
+ bgfx::submit(RENDER_PASS_LIGHT_ID, m_lightProgram);
+ }
}
- }
- }
-
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame();
- }
- // Cleanup.
- cameraDestroy();
- imguiDestroy();
+ // Combine color and light buffers.
+ bgfx::setTexture(0, s_albedo, m_gbuffer, 0);
+ bgfx::setTexture(1, s_light, m_lightBuffer, 0);
+ bgfx::setState(0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ );
+ screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, s_originBottomLeft);
+ bgfx::submit(RENDER_PASS_COMBINE_ID, m_combineProgram);
- if (bgfx::isValid(gbuffer) )
- {
- bgfx::destroyFrameBuffer(gbuffer);
- bgfx::destroyFrameBuffer(lightBuffer);
- }
+ if (m_showGBuffer)
+ {
+ const float aspectRatio = float(m_width)/float(m_height);
- bgfx::destroyIndexBuffer(ibh);
- bgfx::destroyVertexBuffer(vbh);
+ // Draw m_debug m_gbuffer.
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_gbufferTex); ++ii)
+ {
+ float mtx[16];
+ bx::mtxSRT(mtx
+ , aspectRatio, 1.0f, 1.0f
+ , 0.0f, 0.0f, 0.0f
+ , -7.9f - BX_COUNTOF(m_gbufferTex)*0.1f*0.5f + ii*2.1f*aspectRatio, 4.0f, 0.0f
+ );
- bgfx::destroyProgram(geomProgram);
- bgfx::destroyProgram(lightProgram);
- bgfx::destroyProgram(combineProgram);
- bgfx::destroyProgram(debugProgram);
- bgfx::destroyProgram(lineProgram);
+ bgfx::setTransform(mtx);
+ bgfx::setVertexBuffer(m_vbh);
+ bgfx::setIndexBuffer(m_ibh, 0, 6);
+ bgfx::setTexture(0, s_texColor, m_gbufferTex[ii]);
+ bgfx::setState(BGFX_STATE_RGB_WRITE);
+ bgfx::submit(RENDER_PASS_DEBUG_GBUFFER_ID, m_debugProgram);
+ }
+ }
+ }
- bgfx::destroyTexture(textureColor);
- bgfx::destroyTexture(textureNormal);
- bgfx::destroyUniform(s_texColor);
- bgfx::destroyUniform(s_texNormal);
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
- bgfx::destroyUniform(s_albedo);
- bgfx::destroyUniform(s_normal);
- bgfx::destroyUniform(s_depth);
- bgfx::destroyUniform(s_light);
+ return true;
+ }
- bgfx::destroyUniform(u_lightPosRadius);
- bgfx::destroyUniform(u_lightRgbInnerR);
- bgfx::destroyUniform(u_mtx);
+ return false;
+ }
- // Shutdown bgfx.
- bgfx::shutdown();
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+ bgfx::UniformHandle s_texColor;
+ bgfx::UniformHandle s_texNormal;
+
+ bgfx::UniformHandle s_albedo;
+ bgfx::UniformHandle s_normal;
+ bgfx::UniformHandle s_depth;
+ bgfx::UniformHandle s_light;
+
+ bgfx::UniformHandle u_mtx;
+ bgfx::UniformHandle u_lightPosRadius;
+ bgfx::UniformHandle u_lightRgbInnerR;
+
+ bgfx::ProgramHandle m_geomProgram;
+ bgfx::ProgramHandle m_lightProgram;
+ bgfx::ProgramHandle m_combineProgram;
+ bgfx::ProgramHandle m_debugProgram;
+ bgfx::ProgramHandle m_lineProgram;
+ bgfx::TextureHandle m_textureColor;
+ bgfx::TextureHandle m_textureNormal;
+
+ bgfx::TextureHandle m_gbufferTex[3];
+ bgfx::FrameBufferHandle m_gbuffer;
+ bgfx::FrameBufferHandle m_lightBuffer;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ uint32_t m_oldWidth;
+ uint32_t m_oldHeight;
+ uint32_t m_oldReset;
+
+ int32_t m_scrollArea;
+ int32_t m_numLights;
+ float m_lightAnimationSpeed;
+ bool m_animateMesh;
+ bool m_showScissorRects;
+ bool m_showGBuffer;
+
+ entry::MouseState m_mouseState;
+
+ const bgfx::Caps* m_caps;
+ int64_t m_timeOffset;
+};
- return 0;
-}
+ENTRY_IMPLEMENT_MAIN(Deferred);
diff --git a/3rdparty/bgfx/examples/22-windows/windows.cpp b/3rdparty/bgfx/examples/22-windows/windows.cpp
index 203dce0afdb..36156fce478 100644
--- a/3rdparty/bgfx/examples/22-windows/windows.cpp
+++ b/3rdparty/bgfx/examples/22-windows/windows.cpp
@@ -200,7 +200,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewRect(0, 0, 0, width, height);
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
// Set view and projection matrix for view 0.
for (uint32_t ii = 1; ii < MAX_WINDOWS; ++ii)
@@ -267,9 +267,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set model matrix for rendering.
bgfx::setTransform(mtx);
- // Set vertex and fragment shaders.
- bgfx::setProgram(program);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
@@ -277,8 +274,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
- // Submit primitive for rendering to view 0.
- bgfx::submit(count%MAX_WINDOWS);
+ // Submit primitive for rendering.
+ bgfx::submit(count%MAX_WINDOWS, program);
++count;
}
}
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blit.sc b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blit.sc
index 62bc399585e..ee56fcfa4f6 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blit.sc
+++ b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blit.sc
@@ -2,12 +2,19 @@ $input v_color0, v_texcoord0
#include <bgfx_shader.sh>
-SAMPLER2D(s_textureSampler, 0);
+SAMPLER2D(s_texColor, 0);
-uniform float u_compose_alpha;
-uniform float u_compose_mult;
+uniform vec4 u_params;
+#define u_blur_scale u_params.xy
+#define u_compose_mult u_params.z
+#define u_compose_alpha u_params.w
-void main() {
- gl_FragColor = texture2D(s_textureSampler, v_texcoord0.xy) *
- vec4(u_compose_mult, u_compose_mult, u_compose_mult, u_compose_alpha*u_compose_mult);
+void main()
+{
+ gl_FragColor = texture2D(s_texColor, v_texcoord0.xy)
+ * vec4( u_compose_mult
+ , u_compose_mult
+ , u_compose_mult
+ , u_compose_mult*u_compose_alpha
+ );
}
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blur.sc b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blur.sc
index c323bb066a9..e51d425d186 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blur.sc
+++ b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_blur.sc
@@ -2,23 +2,30 @@ $input v_color0, v_texcoord0
#include <bgfx_shader.sh>
-SAMPLER2D(s_textureSampler, 0);
+SAMPLER2D(s_texColor, 0);
-uniform vec2 u_blur_scale;
+uniform vec4 u_params;
+#define u_blur_scale u_params.xy
+#define u_compose_mult u_params.z
+#define u_compose_alpha u_params.w
-uniform float u_compose_alpha;
-uniform float u_compose_mult;
+void main()
+{
+ vec4 color;
+ color = texture2D(s_texColor, vec2(v_texcoord0.x-4.0*u_blur_scale.x, v_texcoord0.y-4.0*u_blur_scale.y))*0.05;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x-3.0*u_blur_scale.x, v_texcoord0.y-3.0*u_blur_scale.y))*0.09;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x-2.0*u_blur_scale.x, v_texcoord0.y-2.0*u_blur_scale.y))*0.12;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x-1.0*u_blur_scale.x, v_texcoord0.y-1.0*u_blur_scale.y))*0.15;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x+0.0*u_blur_scale.x, v_texcoord0.y+0.0*u_blur_scale.y))*0.16;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x+1.0*u_blur_scale.x, v_texcoord0.y+1.0*u_blur_scale.y))*0.15;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x+2.0*u_blur_scale.x, v_texcoord0.y+2.0*u_blur_scale.y))*0.12;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x+3.0*u_blur_scale.x, v_texcoord0.y+3.0*u_blur_scale.y))*0.09;
+ color += texture2D(s_texColor, vec2(v_texcoord0.x+4.0*u_blur_scale.x, v_texcoord0.y+4.0*u_blur_scale.y))*0.05;
-void main() {
- vec4 color = texture2D(s_textureSampler, vec2(v_texcoord0.x-4.0*u_blur_scale.x, v_texcoord0.y-4.0*u_blur_scale.y))*0.05;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x-3.0*u_blur_scale.x, v_texcoord0.y-3.0*u_blur_scale.y))*0.09;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x-2.0*u_blur_scale.x, v_texcoord0.y-2.0*u_blur_scale.y))*0.12;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x-1.0*u_blur_scale.x, v_texcoord0.y-1.0*u_blur_scale.y))*0.15;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x+0.0*u_blur_scale.x, v_texcoord0.y+0.0*u_blur_scale.y))*0.16;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x+1.0*u_blur_scale.x, v_texcoord0.y+1.0*u_blur_scale.y))*0.15;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x+2.0*u_blur_scale.x, v_texcoord0.y+2.0*u_blur_scale.y))*0.12;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x+3.0*u_blur_scale.x, v_texcoord0.y+3.0*u_blur_scale.y))*0.09;
- color += texture2D(s_textureSampler, vec2(v_texcoord0.x+4.0*u_blur_scale.x, v_texcoord0.y+4.0*u_blur_scale.y))*0.05;
-
- gl_FragColor = color * vec4(u_compose_mult, u_compose_mult, u_compose_mult, u_compose_alpha*u_compose_mult);
+ gl_FragColor = color
+ * vec4(u_compose_mult
+ , u_compose_mult
+ , u_compose_mult
+ , u_compose_mult * u_compose_alpha
+ );
}
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_fb.sc b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_fb.sc
index ac3f4b99dd8..19a6d93b23a 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_fb.sc
+++ b/3rdparty/bgfx/examples/23-vectordisplay/fs_vectordisplay_fb.sc
@@ -2,11 +2,14 @@ $input v_color0, v_texcoord0
#include <bgfx_shader.sh>
-SAMPLER2D(s_lineTexture, 0);
+SAMPLER2D(s_texColor, 0);
-uniform float u_compose_alpha;
+uniform vec4 u_params;
+#define u_blur_scale u_params.xy
+#define u_compose_mult u_params.z
+#define u_compose_alpha u_params.w
void main() {
- vec4 texColor = texture2D(s_lineTexture, v_texcoord0.xy);
+ vec4 texColor = texture2D(s_texColor, v_texcoord0.xy);
gl_FragColor = v_color0 * texColor * vec4(1.0, 1.0, 1.0, u_compose_alpha);
}
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
index 4d6b5132a5a..f0999cb723f 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
@@ -84,7 +84,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
index 7f603c15d9e..4285502394d 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
@@ -93,16 +93,11 @@ void VectorDisplay::setup(uint16_t _width, uint16_t _height, int _view)
m_view = _view;
m_drawToScreenShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_fb");
- u_compose_alpha = bgfx::createUniform("u_compose_alpha", bgfx::UniformType::Uniform1f);
+ m_blurShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blur");
+ m_blitShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blit");
- m_blurShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blur");
- u_blur_scale = bgfx::createUniform("u_blur_scale", bgfx::UniformType::Uniform2fv);
- u_compose_mult = bgfx::createUniform("u_compose_mult", bgfx::UniformType::Uniform1f);
-
- m_blitShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blit");
-
- //generate uniforms for sampler
- s_textureSampler = bgfx::createUniform("u_tex1", bgfx::UniformType::Uniform1iv);
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
genLinetex();
@@ -131,17 +126,13 @@ void VectorDisplay::teardown()
teardownResDependent();
bgfx::destroyProgram(m_drawToScreenShader);
- bgfx::destroyUniform(u_compose_alpha);
- bgfx::destroyTexture(m_lineTexId);
- bgfx::destroyUniform(s_lineTexture);
-
bgfx::destroyProgram(m_blurShader);
- bgfx::destroyUniform(u_blur_scale);
- bgfx::destroyUniform(u_compose_mult);
+ bgfx::destroyProgram(m_blitShader);
- bgfx::destroyUniform(s_textureSampler);
+ bgfx::destroyUniform(u_params);
+ bgfx::destroyUniform(s_texColor);
- bgfx::destroyProgram(m_blitShader);
+ bgfx::destroyTexture(m_lineTexId);
}
void VectorDisplay::beginFrame()
@@ -164,6 +155,7 @@ void VectorDisplay::endFrame()
BX_CHECK(m_points.size() < MAX_NUMBER_VERTICES, "");
bgfx::updateDynamicVertexBuffer(m_vertexBuffers[m_currentDrawStep]
+ , 0
, bgfx::copy(m_points.data(), (uint32_t)m_points.size() * sizeof(point_t) )
);
m_vertexBuffersSize[m_currentDrawStep] = (uint32_t)m_points.size();
@@ -189,10 +181,10 @@ void VectorDisplay::endFrame()
alpha = powf(m_decayValue, stepi - 1.0f) * m_initialDecay;
}
- bgfx::setUniform(u_compose_alpha, &alpha);
+ float params[4] = { 0.0f, 0.0f, 0.0f, alpha };
+ bgfx::setUniform(u_params, &params);
- bgfx::setTexture(0, s_lineTexture, m_lineTexId);
- bgfx::setProgram(m_drawToScreenShader);
+ bgfx::setTexture(0, s_texColor, m_lineTexId);
bgfx::setVertexBuffer(m_vertexBuffers[i], m_vertexBuffersSize[i]); // explicitly feed vertex number!
@@ -204,24 +196,21 @@ void VectorDisplay::endFrame()
);
bgfx::setViewName(m_view, "RenderVectorDisplay");
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_drawToScreenShader);
}
}
int viewCounter = m_view + 1;
+ bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+
float glow_iter_mult = 1.05f + ( (m_brightness - 1.0f) / 5.0f);
float glow_fin_mult = 1.25f + ( (m_brightness - 1.0f) / 2.0f);
-
- bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f);
+ float params[4] = { 0.0f, 0.0f, glow_iter_mult, 1.0f };
if (m_brightness > 0)
{
- float alpha = 1.0f;
- bgfx::setUniform(u_compose_alpha, &alpha);
- bgfx::setUniform(u_compose_mult, &glow_iter_mult);
-
- bgfx::setTexture(0, s_textureSampler, m_sceneFrameBuffer);
+ bgfx::setTexture(0, s_texColor, m_sceneFrameBuffer);
int npasses = (int)(m_brightness * 4);
for (int pass = 0; pass < npasses; pass++)
@@ -234,32 +223,29 @@ void VectorDisplay::endFrame()
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_ALPHA_WRITE
);
- float scale[2];
- scale[0] = 1.0f / m_glowWidth;
- scale[1] = 0.0f;
- bgfx::setUniform(u_blur_scale, &scale);
- bgfx::setProgram(m_blurShader);
+ params[0] = 1.0f / m_glowWidth;
+ params[1] = 0.0f;
+ bgfx::setUniform(u_params, &params);
bgfx::setViewTransform(viewCounter, NULL, proj);
screenSpaceQuad(m_glowWidth, m_glowHeight);
bgfx::setViewName(viewCounter, "BlendPassA");
- bgfx::submit(viewCounter);
+ bgfx::submit(viewCounter, m_blurShader);
viewCounter++;
bgfx::setViewFrameBuffer(viewCounter, m_glow1FrameBuffer); //second glow pass
bgfx::setViewRect(viewCounter, 0, 0, m_glowWidth, m_glowHeight);
- bgfx::setTexture(0, s_textureSampler, m_glow0FrameBuffer);
- bgfx::setProgram(m_blurShader);
+ bgfx::setTexture(0, s_texColor, m_glow0FrameBuffer);
bgfx::setViewTransform(viewCounter, NULL, proj);
screenSpaceQuad(m_glowWidth, m_glowHeight);
- bgfx::setUniform(u_compose_alpha, &alpha);
- bgfx::setUniform(u_compose_mult, &glow_iter_mult);
- scale[0] = 0.0f;
- scale[1] = 1.0f / m_glowHeight;
- bgfx::setUniform(u_blur_scale, &scale);
+ params[0] = 0.0f;
+ params[1] = 1.0f / m_glowHeight;
+ params[2] = glow_iter_mult;
+ params[3] = 1.0f;
+ bgfx::setUniform(u_params, params);
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
@@ -267,32 +253,33 @@ void VectorDisplay::endFrame()
);
bgfx::setViewName(viewCounter, "BlendPassB");
- bgfx::submit(viewCounter);
+ bgfx::submit(viewCounter, m_blurShader);
viewCounter++;
//set for next iteration
- bgfx::setTexture(0, s_textureSampler, m_glow1FrameBuffer);
+ bgfx::setTexture(0, s_texColor, m_glow1FrameBuffer);
}
}
+ bgfx::discard();
+
//now do last pass, combination of blur and normal buffer to screen
bgfx::setViewTransform(viewCounter, NULL, proj);
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
- bgfx::setTexture(0, s_textureSampler, m_sceneFrameBuffer);
- bgfx::setProgram(m_blitShader);
+ bgfx::setTexture(0, s_texColor, m_sceneFrameBuffer);
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_ALPHA_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
);
- float tempOne = 1.0f;
- bgfx::setUniform(u_compose_alpha, &tempOne);
- bgfx::setUniform(u_compose_mult, &tempOne);
+ params[2] = 1.0f;
+ params[3] = 1.0f;
+ bgfx::setUniform(u_params, params);
bgfx::setViewName(viewCounter, "BlendVectorToDisplay");
screenSpaceQuad(m_screenWidth, m_screenHeight);
- bgfx::submit(viewCounter);
+ bgfx::submit(viewCounter, m_blitShader);
viewCounter++;
if (m_brightness > 0)
@@ -300,17 +287,18 @@ void VectorDisplay::endFrame()
// blend in the glow
bgfx::setViewTransform(viewCounter, NULL, proj);
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
- bgfx::setTexture(0, s_textureSampler, m_glow1FrameBuffer);
- bgfx::setProgram(m_blitShader);
+ bgfx::setTexture(0, s_texColor, m_glow1FrameBuffer);
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_ALPHA_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
);
- bgfx::setUniform(u_compose_mult, &glow_fin_mult);
+
+ params[2] = glow_fin_mult;
+ bgfx::setUniform(u_params, params);
bgfx::setViewName(viewCounter, "BlendBlurToDisplay");
screenSpaceQuad(m_screenWidth, m_screenHeight);
- bgfx::submit(viewCounter);
+ bgfx::submit(viewCounter, m_blitShader);
viewCounter++;
}
}
@@ -880,7 +868,6 @@ void VectorDisplay::genLinetex() // generate
;
m_lineTexId = bgfx::createTexture2D(TEXTURE_SIZE, TEXTURE_SIZE, 1, bgfx::TextureFormat::BGRA8, flags, mem);
- s_lineTexture = bgfx::createUniform("s_lineTexture", bgfx::UniformType::Uniform1iv);
}
static const int8_t simplex[95][112] =
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
index d5d66032694..0b8c78a8efb 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
@@ -12,7 +12,7 @@
#ifndef __VECTORDISPLAY_H__
#define __VECTORDISPLAY_H__
-#include "bgfx.h"
+#include <bgfx/bgfx.h>
#include <tinystl/allocator.h>
#include <tinystl/vector.h>
@@ -150,20 +150,16 @@ protected:
bool m_originBottomLeft;
float m_texelHalf;
- bgfx::ProgramHandle m_drawToScreenShader; // program for drawing to the framebuffer
- bgfx::UniformHandle u_compose_alpha;
-
- bgfx::FrameBufferHandle m_sceneFrameBuffer;
-
- bgfx::ProgramHandle m_blurShader; // program for gaussian blur
- bgfx::UniformHandle u_blur_scale;
- bgfx::UniformHandle u_compose_mult;
- bgfx::UniformHandle s_textureSampler; //texture handle for blur
-
+ bgfx::ProgramHandle m_drawToScreenShader; // program for drawing to the framebuffer
+ bgfx::ProgramHandle m_blurShader; // program for gaussian blur
bgfx::ProgramHandle m_blitShader;
- bgfx::FrameBufferHandle m_glow0FrameBuffer; // framebuffer for glow pass 0
- bgfx::FrameBufferHandle m_glow1FrameBuffer; // framebuffer for glow pass 1
+ bgfx::UniformHandle u_params;
+ bgfx::UniformHandle s_texColor;
+
+ bgfx::FrameBufferHandle m_sceneFrameBuffer;
+ bgfx::FrameBufferHandle m_glow0FrameBuffer; // framebuffer for glow pass 0
+ bgfx::FrameBufferHandle m_glow1FrameBuffer; // framebuffer for glow pass 1
int m_view;
@@ -182,7 +178,6 @@ protected:
stl::vector<int> m_vertexBuffersSize;
bgfx::TextureHandle m_lineTexId;
- bgfx::UniformHandle s_lineTexture;
float m_initialDecay;
diff --git a/3rdparty/bgfx/examples/24-nbody/nbody.cpp b/3rdparty/bgfx/examples/24-nbody/nbody.cpp
index 72da9e38a0f..854a55a7aea 100644
--- a/3rdparty/bgfx/examples/24-nbody/nbody.cpp
+++ b/3rdparty/bgfx/examples/24-nbody/nbody.cpp
@@ -7,7 +7,7 @@
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
struct u_paramsDataStruct
{
@@ -161,7 +161,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::DynamicVertexBufferHandle prevPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
bgfx::DynamicVertexBufferHandle prevPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE);
- bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv, 3);
+ bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, 3);
bgfx::ProgramHandle initInstancesProgram = bgfx::createProgram(loadShader("cs_init_instances"), true);
bgfx::ProgramHandle updateInstancesProgram = bgfx::createProgram(loadShader("cs_update_instances"), true);
@@ -219,9 +219,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
imguiBeginFrame(mouseState.m_mx
, mouseState.m_my
- , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
- | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
- , 0
+ , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , mouseState.m_mz
, width
, height
);
@@ -294,7 +295,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float viewHead[16];
float eye[3] = {};
@@ -324,9 +325,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewRect(0, 0, 0, width, height);
}
- // Set vertex and fragment shaders.
- bgfx::setProgram(particleProgram);
-
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh);
@@ -342,11 +340,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Submit primitive for rendering to view 0.
if (useIndirect)
{
- bgfx::submit(0, indirectBuffer, 0);
+ bgfx::submit(0, particleProgram, indirectBuffer, 0);
}
else
{
- bgfx::submit(0);
+ bgfx::submit(0, particleProgram);
}
// Advance to next frame. Rendering thread will be kicked to
@@ -395,7 +393,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bool blink = uint32_t(time*3.0f)&1;
bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " Compute is not supported by GPU. ");
- bgfx::submit(0);
+ bgfx::touch(0);
bgfx::frame();
}
}
diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c
index e217e10e8c6..a362736b435 100644
--- a/3rdparty/bgfx/examples/25-c99/helloworld.c
+++ b/3rdparty/bgfx/examples/25-c99/helloworld.c
@@ -3,7 +3,7 @@
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
-#include <bgfx.c99.h>
+#include <bgfx/c99/bgfx.h>
#include "../00-helloworld/logo.h"
extern bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset);
@@ -47,7 +47,7 @@ int _main_(int _argc, char** _argv)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx_submit(0, 0);
+ bgfx_touch(0);
// Use debug font to print information about this example.
bgfx_dbg_text_clear(0, false);
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
index 5f19524e568..386062c065d 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
@@ -12,7 +12,7 @@
#include <tinystl/string.h>
namespace stl = tinystl;
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/readerwriter.h>
#include <bx/fpumath.h>
#include <bx/string.h>
@@ -21,12 +21,12 @@ namespace stl = tinystl;
#include "bgfx_utils.h"
-void* load(bx::FileReaderI* _reader, const char* _filePath, uint32_t* _size)
+void* load(bx::FileReaderI* _reader, bx::ReallocatorI* _allocator, const char* _filePath, uint32_t* _size)
{
if (0 == bx::open(_reader, _filePath) )
{
uint32_t size = (uint32_t)bx::getSize(_reader);
- void* data = malloc(size);
+ void* data = BX_ALLOC(_allocator, size);
bx::read(_reader, data, size);
bx::close(_reader);
if (NULL != _size)
@@ -45,7 +45,12 @@ void* load(bx::FileReaderI* _reader, const char* _filePath, uint32_t* _size)
void* load(const char* _filePath, uint32_t* _size)
{
- return load(entry::getFileReader(), _filePath, _size);
+ return load(entry::getFileReader(), entry::getAllocator(), _filePath, _size);
+}
+
+void unload(void* _ptr)
+{
+ BX_FREE(entry::getAllocator(), _ptr);
}
static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePath)
@@ -99,6 +104,10 @@ static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const char* _name
shaderPath = "shaders/glsl/";
break;
+ case bgfx::RendererType::Metal:
+ shaderPath = "shaders/metal/";
+ break;
+
case bgfx::RendererType::OpenGLES:
shaderPath = "shaders/gles/";
break;
@@ -122,7 +131,11 @@ bgfx::ShaderHandle loadShader(const char* _name)
bgfx::ProgramHandle loadProgram(bx::FileReaderI* _reader, const char* _vsName, const char* _fsName)
{
bgfx::ShaderHandle vsh = loadShader(_reader, _vsName);
- bgfx::ShaderHandle fsh = loadShader(_reader, _fsName);
+ bgfx::ShaderHandle fsh = BGFX_INVALID_HANDLE;
+ if (NULL != _fsName)
+ {
+ fsh = loadShader(_reader, _fsName);
+ }
return bgfx::createProgram(vsh, fsh, true /* destroy shaders when program is destroyed */);
}
@@ -176,24 +189,27 @@ bgfx::TextureHandle loadTexture(bx::FileReaderI* _reader, const char* _name, uin
BX_FREE(allocator, data);
- handle = bgfx::createTexture2D(uint16_t(width), uint16_t(height), 1
- , bgfx::TextureFormat::RGBA8
- , _flags
- , bgfx::copy(img, width*height*4)
- );
+ if (NULL != img)
+ {
+ handle = bgfx::createTexture2D(uint16_t(width), uint16_t(height), 1
+ , bgfx::TextureFormat::RGBA8
+ , _flags
+ , bgfx::copy(img, width*height*4)
+ );
- free(img);
+ free(img);
- if (NULL != _info)
- {
- bgfx::calcTextureSize(*_info
- , uint16_t(width)
- , uint16_t(height)
- , 0
- , false
- , 1
- , bgfx::TextureFormat::RGBA8
- );
+ if (NULL != _info)
+ {
+ bgfx::calcTextureSize(*_info
+ , uint16_t(width)
+ , uint16_t(height)
+ , 0
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA8
+ );
+ }
}
}
else
@@ -521,11 +537,10 @@ struct Mesh
const Group& group = *it;
bgfx::setTransform(cached);
- bgfx::setProgram(_program);
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setState(_state);
- bgfx::submit(_id);
+ bgfx::submit(_id, _program);
}
}
@@ -551,11 +566,10 @@ struct Mesh
, texture.m_flags
);
}
- bgfx::setProgram(state.m_program);
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(group.m_vbh);
bgfx::setState(state.m_state);
- bgfx::submit(state.m_viewId);
+ bgfx::submit(state.m_viewId, state.m_program);
}
}
}
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.h b/3rdparty/bgfx/examples/common/bgfx_utils.h
index 514028a9996..2938abff1b9 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.h
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.h
@@ -6,9 +6,10 @@
#ifndef BGFX_UTILS_H_HEADER_GUARD
#define BGFX_UTILS_H_HEADER_GUARD
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
void* load(const char* _filePath, uint32_t* _size = NULL);
+void unload(void* _ptr);
bgfx::ShaderHandle loadShader(const char* _name);
bgfx::ProgramHandle loadProgram(const char* _vsName, const char* _fsName);
bgfx::TextureHandle loadTexture(const char* _name, uint32_t _flags = BGFX_TEXTURE_NONE, uint8_t _skip = 0, bgfx::TextureInfo* _info = NULL);
diff --git a/3rdparty/bgfx/examples/common/camera.cpp b/3rdparty/bgfx/examples/common/camera.cpp
index b7a04553fb9..4d0a47166ea 100644
--- a/3rdparty/bgfx/examples/common/camera.cpp
+++ b/3rdparty/bgfx/examples/common/camera.cpp
@@ -53,7 +53,7 @@ static void cmd(const void* _userData)
cmdExec( (const char*)_userData);
}
-static const InputBinding s_camBindings[] =
+static const InputBinding s_camBindings[] =
{
{ entry::Key::KeyW, entry::Modifier::None, 0, cmd, "move forward" },
{ entry::Key::GamepadUp, entry::Modifier::None, 0, cmd, "move forward" },
@@ -258,7 +258,7 @@ struct Camera
bx::mtxLookAt(_viewMtx, m_eye, m_at, m_up);
}
- void setPosition(float* _pos)
+ void setPosition(const float* _pos)
{
memcpy(m_eye, _pos, sizeof(float)*3);
}
@@ -267,7 +267,7 @@ struct Camera
{
m_verticalAngle = _verticalAngle;
}
-
+
void setHorizontalAngle(float _horizontalAngle)
{
m_horizontalAngle = _horizontalAngle;
@@ -303,7 +303,7 @@ void cameraDestroy()
s_camera = NULL;
}
-void cameraSetPosition(float* _pos)
+void cameraSetPosition(const float* _pos)
{
s_camera->setPosition(_pos);
}
@@ -330,12 +330,12 @@ void cameraGetViewMtx(float* _viewMtx)
void cameraGetPosition(float* _pos)
{
- memcpy(_pos, s_camera->m_eye, 3*sizeof(float));
+ memcpy(_pos, s_camera->m_eye, 3*sizeof(float) );
}
void cameraGetAt(float* _at)
{
- memcpy(_at, s_camera->m_at, 3*sizeof(float));
+ memcpy(_at, s_camera->m_at, 3*sizeof(float) );
}
void cameraUpdate(float _deltaTime, const entry::MouseState& _mouseState)
diff --git a/3rdparty/bgfx/examples/common/camera.h b/3rdparty/bgfx/examples/common/camera.h
index 946ff6e23da..2619d1bad60 100644
--- a/3rdparty/bgfx/examples/common/camera.h
+++ b/3rdparty/bgfx/examples/common/camera.h
@@ -22,7 +22,7 @@ void cameraCreate();
void cameraDestroy();
///
-void cameraSetPosition(float* _pos);
+void cameraSetPosition(const float* _pos);
///
void cameraSetHorizontalAngle(float _horizontalAngle);
diff --git a/3rdparty/bgfx/examples/common/cube_atlas.cpp b/3rdparty/bgfx/examples/common/cube_atlas.cpp
index 6928338a642..1d762b6544d 100644
--- a/3rdparty/bgfx/examples/common/cube_atlas.cpp
+++ b/3rdparty/bgfx/examples/common/cube_atlas.cpp
@@ -4,7 +4,7 @@
*/
#include "common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <limits.h> // INT_MAX
#include <memory.h> // memset
@@ -318,7 +318,7 @@ void Atlas::init()
{
m_texelSize = float(UINT16_MAX) / float(m_textureSize);
float texelHalf = m_texelSize/2.0f;
- switch (bgfx::getRendererType())
+ switch (bgfx::getRendererType() )
{
case bgfx::RendererType::Direct3D9:
m_texelOffset[0] = 0.0f;
@@ -405,42 +405,46 @@ uint16_t Atlas::addRegion(uint16_t _width, uint16_t _height, const uint8_t* _bit
void Atlas::updateRegion(const AtlasRegion& _region, const uint8_t* _bitmapBuffer)
{
- const bgfx::Memory* mem = bgfx::alloc(_region.width * _region.height * 4);
- memset(mem->data, 0, mem->size);
- if (_region.getType() == AtlasRegion::TYPE_BGRA8)
+ uint32_t size = _region.width * _region.height * 4;
+ if (0 < size)
{
- const uint8_t* inLineBuffer = _bitmapBuffer;
- uint8_t* outLineBuffer = m_textureBuffer + _region.getFaceIndex() * (m_textureSize * m_textureSize * 4) + ( ( (_region.y * m_textureSize) + _region.x) * 4);
-
- for (int yy = 0; yy < _region.height; ++yy)
+ const bgfx::Memory* mem = bgfx::alloc(size);
+ memset(mem->data, 0, mem->size);
+ if (_region.getType() == AtlasRegion::TYPE_BGRA8)
{
- memcpy(outLineBuffer, inLineBuffer, _region.width * 4);
- inLineBuffer += _region.width * 4;
- outLineBuffer += m_textureSize * 4;
- }
+ const uint8_t* inLineBuffer = _bitmapBuffer;
+ uint8_t* outLineBuffer = m_textureBuffer + _region.getFaceIndex() * (m_textureSize * m_textureSize * 4) + ( ( (_region.y * m_textureSize) + _region.x) * 4);
- memcpy(mem->data, _bitmapBuffer, mem->size);
- }
- else
- {
- uint32_t layer = _region.getComponentIndex();
- const uint8_t* inLineBuffer = _bitmapBuffer;
- uint8_t* outLineBuffer = (m_textureBuffer + _region.getFaceIndex() * (m_textureSize * m_textureSize * 4) + ( ( (_region.y * m_textureSize) + _region.x) * 4) );
+ for (int yy = 0; yy < _region.height; ++yy)
+ {
+ memcpy(outLineBuffer, inLineBuffer, _region.width * 4);
+ inLineBuffer += _region.width * 4;
+ outLineBuffer += m_textureSize * 4;
+ }
- for (int yy = 0; yy < _region.height; ++yy)
+ memcpy(mem->data, _bitmapBuffer, mem->size);
+ }
+ else
{
- for (int xx = 0; xx < _region.width; ++xx)
+ uint32_t layer = _region.getComponentIndex();
+ const uint8_t* inLineBuffer = _bitmapBuffer;
+ uint8_t* outLineBuffer = (m_textureBuffer + _region.getFaceIndex() * (m_textureSize * m_textureSize * 4) + ( ( (_region.y * m_textureSize) + _region.x) * 4) );
+
+ for (int yy = 0; yy < _region.height; ++yy)
{
- outLineBuffer[(xx * 4) + layer] = inLineBuffer[xx];
+ for (int xx = 0; xx < _region.width; ++xx)
+ {
+ outLineBuffer[(xx * 4) + layer] = inLineBuffer[xx];
+ }
+
+ memcpy(mem->data + yy * _region.width * 4, outLineBuffer, _region.width * 4);
+ inLineBuffer += _region.width;
+ outLineBuffer += m_textureSize * 4;
}
-
- memcpy(mem->data + yy * _region.width * 4, outLineBuffer, _region.width * 4);
- inLineBuffer += _region.width;
- outLineBuffer += m_textureSize * 4;
}
- }
- bgfx::updateTextureCube(m_textureHandle, (uint8_t)_region.getFaceIndex(), 0, _region.x, _region.y, _region.width, _region.height, mem);
+ bgfx::updateTextureCube(m_textureHandle, (uint8_t)_region.getFaceIndex(), 0, _region.x, _region.y, _region.width, _region.height, mem);
+ }
}
void Atlas::packFaceLayerUV(uint32_t _idx, uint8_t* _vertexBuffer, uint32_t _offset, uint32_t _stride) const
diff --git a/3rdparty/bgfx/examples/common/cube_atlas.h b/3rdparty/bgfx/examples/common/cube_atlas.h
index c35b0a1ef2f..5efde04858d 100644
--- a/3rdparty/bgfx/examples/common/cube_atlas.h
+++ b/3rdparty/bgfx/examples/common/cube_atlas.h
@@ -15,7 +15,7 @@
/// algorithm based on C++ sources provided by Jukka Jylänki at:
/// http://clb.demon.fi/files/RectangleBinPack/
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
struct AtlasRegion
{
@@ -54,12 +54,12 @@ class Atlas
{
public:
/// create an empty dynamic atlas (region can be updated and added)
- /// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA))
+ /// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA) )
/// @param maxRegionCount maximum number of region allowed in the atlas
Atlas(uint16_t _textureSize, uint16_t _maxRegionsCount = 4096);
/// initialize a static atlas with serialized data (region can be updated but not added)
- /// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA))
+ /// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA) )
/// @param textureBuffer buffer of size 6*textureSize*textureSize*sizeof(uint32_t) (will be copied)
/// @param regionCount number of region in the Atlas
/// @param regionBuffer buffer containing the region (will be copied)
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 07826f1d035..61dbe0b3c9c 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -3,12 +3,16 @@
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/string.h>
#include <bx/readerwriter.h>
#include <time.h>
+#if BX_PLATFORM_EMSCRIPTEN
+# include <emscripten.h>
+#endif // BX_PLATFORM_EMSCRIPTEN
+
#include "entry_p.h"
#include "cmd.h"
#include "input.h"
@@ -38,6 +42,118 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
+ static const char* s_keyName[] =
+ {
+ "None",
+ "Esc",
+ "Return",
+ "Tab",
+ "Space",
+ "Backspace",
+ "Up",
+ "Down",
+ "Left",
+ "Right",
+ "Insert",
+ "Delete",
+ "Home",
+ "End",
+ "PageUp",
+ "PageDown",
+ "Print",
+ "Plus",
+ "Minus",
+ "LeftBracket",
+ "RightBracket",
+ "Semicolon",
+ "Quote",
+ "Comma",
+ "Period",
+ "Slash",
+ "Backslash",
+ "Tilde",
+ "F1",
+ "F2",
+ "F3",
+ "F4",
+ "F5",
+ "F6",
+ "F7",
+ "F8",
+ "F9",
+ "F10",
+ "F11",
+ "F12",
+ "NumPad0",
+ "NumPad1",
+ "NumPad2",
+ "NumPad3",
+ "NumPad4",
+ "NumPad5",
+ "NumPad6",
+ "NumPad7",
+ "NumPad8",
+ "NumPad9",
+ "Key0",
+ "Key1",
+ "Key2",
+ "Key3",
+ "Key4",
+ "Key5",
+ "Key6",
+ "Key7",
+ "Key8",
+ "Key9",
+ "KeyA",
+ "KeyB",
+ "KeyC",
+ "KeyD",
+ "KeyE",
+ "KeyF",
+ "KeyG",
+ "KeyH",
+ "KeyI",
+ "KeyJ",
+ "KeyK",
+ "KeyL",
+ "KeyM",
+ "KeyN",
+ "KeyO",
+ "KeyP",
+ "KeyQ",
+ "KeyR",
+ "KeyS",
+ "KeyT",
+ "KeyU",
+ "KeyV",
+ "KeyW",
+ "KeyX",
+ "KeyY",
+ "KeyZ",
+ "GamepadA",
+ "GamepadB",
+ "GamepadX",
+ "GamepadY",
+ "GamepadThumbL",
+ "GamepadThumbR",
+ "GamepadShoulderL",
+ "GamepadShoulderR",
+ "GamepadUp",
+ "GamepadDown",
+ "GamepadLeft",
+ "GamepadRight",
+ "GamepadBack",
+ "GamepadStart",
+ "GamepadGuide",
+ };
+ BX_STATIC_ASSERT(Key::Count == BX_COUNTOF(s_keyName) );
+
+ const char* getName(Key::Enum _key)
+ {
+ BX_CHECK(_key < Key::Count, "Invalid key %d.", _key);
+ return s_keyName[_key];
+ }
+
char keyToAscii(Key::Enum _key, uint8_t _modifiers)
{
const bool isAscii = (Key::Key0 <= _key && _key <= Key::KeyZ)
@@ -98,11 +214,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return false;
}
- void cmd(const void* _userData)
- {
- cmdExec( (const char*)_userData);
- }
-
int cmdMouseLock(CmdContext* /*_context*/, void* /*_userData*/, int _argc, char const* const* _argv)
{
if (_argc > 1)
@@ -126,6 +237,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|| setOrToggle(s_reset, "msaa", BGFX_RESET_MSAA_X16, 1, _argc, _argv)
|| setOrToggle(s_reset, "flush", BGFX_RESET_FLUSH_AFTER_RENDER, 1, _argc, _argv)
|| setOrToggle(s_reset, "flip", BGFX_RESET_FLIP_AFTER_RENDER, 1, _argc, _argv)
+ || setOrToggle(s_reset, "hidpi", BGFX_RESET_HIDPI, 1, _argc, _argv)
)
{
return 0;
@@ -156,6 +268,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return 0;
}
+ else if (0 == strcmp(_argv[1], "fullscreen") )
+ {
+ WindowHandle window = { 0 };
+ toggleFullscreen(window);
+ return 0;
+ }
}
return 1;
@@ -169,22 +287,49 @@ BX_PRAGMA_DIAGNOSTIC_POP();
static const InputBinding s_bindings[] =
{
- { entry::Key::KeyQ, entry::Modifier::LeftCtrl, 1, cmd, "exit" },
- { entry::Key::F1, entry::Modifier::None, 1, cmd, "graphics stats" },
- { entry::Key::GamepadStart, entry::Modifier::None, 1, cmd, "graphics stats" },
- { entry::Key::F1, entry::Modifier::LeftShift, 1, cmd, "graphics stats 0\ngraphics text 0" },
- { entry::Key::F3, entry::Modifier::None, 1, cmd, "graphics wireframe" },
- { entry::Key::F4, entry::Modifier::None, 1, cmd, "graphics hmd" },
- { entry::Key::F4, entry::Modifier::LeftShift, 1, cmd, "graphics hmdrecenter" },
- { entry::Key::F4, entry::Modifier::LeftCtrl, 1, cmd, "graphics hmddbg" },
- { entry::Key::F7, entry::Modifier::None, 1, cmd, "graphics vsync" },
- { entry::Key::F8, entry::Modifier::None, 1, cmd, "graphics msaa" },
- { entry::Key::F9, entry::Modifier::None, 1, cmd, "graphics flush" },
- { entry::Key::Print, entry::Modifier::None, 1, cmd, "graphics screenshot" },
+ { entry::Key::KeyQ, entry::Modifier::LeftCtrl, 1, NULL, "exit" },
+ { entry::Key::KeyQ, entry::Modifier::RightCtrl, 1, NULL, "exit" },
+ { entry::Key::KeyF, entry::Modifier::LeftCtrl, 1, NULL, "graphics fullscreen" },
+ { entry::Key::KeyF, entry::Modifier::RightCtrl, 1, NULL, "graphics fullscreen" },
+ { entry::Key::Return, entry::Modifier::RightAlt, 1, NULL, "graphics fullscreen" },
+ { entry::Key::F1, entry::Modifier::None, 1, NULL, "graphics stats" },
+ { entry::Key::GamepadStart, entry::Modifier::None, 1, NULL, "graphics stats" },
+ { entry::Key::F1, entry::Modifier::LeftShift, 1, NULL, "graphics stats 0\ngraphics text 0" },
+ { entry::Key::F3, entry::Modifier::None, 1, NULL, "graphics wireframe" },
+ { entry::Key::F4, entry::Modifier::None, 1, NULL, "graphics hmd" },
+ { entry::Key::F4, entry::Modifier::LeftShift, 1, NULL, "graphics hmdrecenter" },
+ { entry::Key::F4, entry::Modifier::LeftCtrl, 1, NULL, "graphics hmddbg" },
+ { entry::Key::F7, entry::Modifier::None, 1, NULL, "graphics vsync" },
+ { entry::Key::F8, entry::Modifier::None, 1, NULL, "graphics msaa" },
+ { entry::Key::F9, entry::Modifier::None, 1, NULL, "graphics flush" },
+ { entry::Key::F10, entry::Modifier::None, 1, NULL, "graphics hidpi" },
+ { entry::Key::Print, entry::Modifier::None, 1, NULL, "graphics screenshot" },
INPUT_BINDING_END
};
+#if BX_PLATFORM_EMSCRIPTEN
+ static AppI* s_app;
+ static void updateApp()
+ {
+ s_app->update();
+ }
+#endif // BX_PLATFORM_EMSCRIPTEN
+
+ int runApp(AppI* _app, int _argc, char** _argv)
+ {
+ _app->init(_argc, _argv);
+
+#if BX_PLATFORM_EMSCRIPTEN
+ s_app = _app;
+ emscripten_set_main_loop(&updateApp, -1, 1);
+#else
+ while (_app->update() );
+#endif // BX_PLATFORM_EMSCRIPTEN
+
+ return _app->shutdown();
+ }
+
int main(int _argc, char** _argv)
{
//DBG(BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME);
@@ -203,7 +348,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
inputAddBindings("bindings", s_bindings);
entry::WindowHandle defaultWindow = { 0 };
- entry::setWindowTitle(defaultWindow, bx::baseName(_argv[0]));
+ entry::setWindowTitle(defaultWindow, bx::baseName(_argv[0]) );
int32_t result = ::_main_(_argc, _argv);
@@ -319,7 +464,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
case Event::Window:
break;
- default:
+ case Event::Suspend:
+ break;
+
+ default:
break;
}
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry.h b/3rdparty/bgfx/examples/common/entry/entry.h
index be1d35d75a2..13b85262067 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.h
+++ b/3rdparty/bgfx/examples/common/entry/entry.h
@@ -18,6 +18,13 @@ extern "C" int _main_(int _argc, char** _argv);
#define ENTRY_WINDOW_FLAG_ASPECT_RATIO UINT32_C(0x00000001)
#define ENTRY_WINDOW_FLAG_FRAME UINT32_C(0x00000002)
+#define ENTRY_IMPLEMENT_MAIN(_app) \
+ int _main_(int _argc, char** _argv) \
+ { \
+ _app app; \
+ return entry::runApp(&app, _argc, _argv); \
+ }
+
namespace entry
{
struct WindowHandle { uint16_t idx; };
@@ -84,13 +91,24 @@ namespace entry
Down,
Left,
Right,
- PageUp,
- PageDown,
+ Insert,
+ Delete,
Home,
End,
+ PageUp,
+ PageDown,
Print,
Plus,
Minus,
+ LeftBracket,
+ RightBracket,
+ Semicolon,
+ Quote,
+ Comma,
+ Period,
+ Slash,
+ Backslash,
+ Tilde,
F1,
F2,
F3,
@@ -170,6 +188,21 @@ namespace entry
};
};
+ struct Suspend
+ {
+ enum Enum
+ {
+ WillSuspend,
+ DidSuspend,
+ WillResume,
+ DidResume,
+
+ Count
+ };
+ };
+
+ const char* getName(Key::Enum _key);
+
struct MouseState
{
MouseState()
@@ -231,6 +264,20 @@ namespace entry
bool processWindowEvents(WindowState& _state, uint32_t& _debug, uint32_t& _reset);
+ struct BX_NO_VTABLE AppI
+ {
+ virtual ~AppI() = 0;
+ virtual void init(int _argc, char** _argv) = 0;
+ virtual int shutdown() = 0;
+ virtual bool update() = 0;
+ };
+
+ inline AppI::~AppI()
+ {
+ }
+
+ int runApp(AppI* _app, int _argc, char** _argv);
+
} // namespace entry
#endif // ENTRY_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/entry_android.cpp b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
index 2d7c852c86c..aef9fee938a 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_android.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
@@ -7,7 +7,7 @@
#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_ANDROID
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <stdio.h>
#include <bx/thread.h>
@@ -181,14 +181,22 @@ namespace entry
break;
case APP_CMD_GAINED_FOCUS:
+ {
// Command from main thread: the app's activity window has gained
// input focus.
+ WindowHandle defaultWindow = { 0 };
+ m_eventQueue.postSuspendEvent(defaultWindow, Suspend::WillResume);
break;
+ }
case APP_CMD_LOST_FOCUS:
+ {
// Command from main thread: the app's activity window has lost
// input focus.
+ WindowHandle defaultWindow = { 0 };
+ m_eventQueue.postSuspendEvent(defaultWindow, Suspend::WillSuspend);
break;
+ }
case APP_CMD_CONFIG_CHANGED:
// Command from main thread: the current device configuration has changed.
@@ -204,8 +212,12 @@ namespace entry
break;
case APP_CMD_RESUME:
+ {
// Command from main thread: the app's activity has been resumed.
+ WindowHandle defaultWindow = { 0 };
+ m_eventQueue.postSuspendEvent(defaultWindow, Suspend::DidResume);
break;
+ }
case APP_CMD_SAVE_STATE:
// Command from main thread: the app should generate a new saved state
@@ -216,8 +228,12 @@ namespace entry
break;
case APP_CMD_PAUSE:
+ {
// Command from main thread: the app's activity has been paused.
+ WindowHandle defaultWindow = { 0 };
+ m_eventQueue.postSuspendEvent(defaultWindow, Suspend::DidSuspend);
break;
+ }
case APP_CMD_STOP:
// Command from main thread: the app's activity has been stopped.
diff --git a/3rdparty/bgfx/examples/common/entry/entry_asmjs.cpp b/3rdparty/bgfx/examples/common/entry/entry_asmjs.cpp
index 3ac5497b1d0..f5c3dc62c4d 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_asmjs.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_asmjs.cpp
@@ -8,29 +8,356 @@
#if BX_PLATFORM_EMSCRIPTEN
#include <emscripten.h>
+#include <emscripten/html5.h>
+
+extern "C" void entry_emscripten_yield()
+{
+// emscripten_sleep(0);
+}
namespace entry
{
+ static WindowHandle s_defaultWindow = { 0 };
+
+ static uint8_t s_translateKey[256];
+
+ struct Context
+ {
+ Context()
+ : m_scrollf(0.0f)
+ , m_mx(0)
+ , m_my(0)
+ , m_scroll(0)
+ {
+ memset(s_translateKey, 0, sizeof(s_translateKey));
+ s_translateKey[27] = Key::Esc;
+ s_translateKey[uint8_t('\n')] =
+ s_translateKey[uint8_t('\r')] = Key::Return;
+ s_translateKey[uint8_t('\t')] = Key::Tab;
+ s_translateKey[127] = Key::Backspace;
+ s_translateKey[uint8_t(' ')] = Key::Space;
+ s_translateKey[38] = Key::Up;
+ s_translateKey[40] = Key::Down;
+ s_translateKey[37] = Key::Left;
+ s_translateKey[39] = Key::Right;
+
+ s_translateKey[uint8_t('+')] =
+ s_translateKey[uint8_t('=')] = Key::Plus;
+ s_translateKey[uint8_t('_')] =
+ s_translateKey[uint8_t('-')] = Key::Minus;
+
+ s_translateKey[uint8_t(':')] =
+ s_translateKey[uint8_t(';')] = Key::Semicolon;
+ s_translateKey[uint8_t('"')] =
+ s_translateKey[uint8_t('\'')] = Key::Quote;
+
+ s_translateKey[uint8_t('{')] =
+ s_translateKey[uint8_t('[')] = Key::LeftBracket;
+ s_translateKey[uint8_t('}')] =
+ s_translateKey[uint8_t(']')] = Key::RightBracket;
+
+ s_translateKey[uint8_t('<')] =
+ s_translateKey[uint8_t(',')] = Key::Comma;
+ s_translateKey[uint8_t('>')] =
+ s_translateKey[uint8_t('.')] = Key::Period;
+ s_translateKey[uint8_t('?')] =
+ s_translateKey[uint8_t('/')] = Key::Slash;
+ s_translateKey[uint8_t('|')] =
+ s_translateKey[uint8_t('\\')] = Key::Backslash;
+
+ s_translateKey[uint8_t('~')] =
+ s_translateKey[uint8_t('`')] = Key::Tilde;
+
+ s_translateKey[uint8_t('0')] = Key::Key0;
+ s_translateKey[uint8_t('1')] = Key::Key1;
+ s_translateKey[uint8_t('2')] = Key::Key2;
+ s_translateKey[uint8_t('3')] = Key::Key3;
+ s_translateKey[uint8_t('4')] = Key::Key4;
+ s_translateKey[uint8_t('5')] = Key::Key5;
+ s_translateKey[uint8_t('6')] = Key::Key6;
+ s_translateKey[uint8_t('7')] = Key::Key7;
+ s_translateKey[uint8_t('8')] = Key::Key8;
+ s_translateKey[uint8_t('9')] = Key::Key9;
+
+ for (char ch = 'a'; ch <= 'z'; ++ch)
+ {
+ s_translateKey[uint8_t(ch)] =
+ s_translateKey[uint8_t(ch - ' ')] = Key::KeyA + (ch - 'a');
+ }
+ }
+
+ int32_t run(int _argc, char** _argv)
+ {
+ emscripten_set_mousedown_callback("#canvas", this, true, mouseCb);
+ emscripten_set_mouseup_callback("#canvas", this, true, mouseCb);
+ emscripten_set_mousemove_callback("#canvas", this, true, mouseCb);
+
+ emscripten_set_wheel_callback("#canvas", this, true, wheelCb);
+
+ emscripten_set_keypress_callback(NULL, this, true, keyCb);
+ emscripten_set_keydown_callback(NULL, this, true, keyCb);
+ emscripten_set_keyup_callback(NULL, this, true, keyCb);
+
+ emscripten_set_resize_callback(0, this, true, resizeCb);
+
+ EmscriptenFullscreenStrategy fullscreenStrategy = {};
+ fullscreenStrategy.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT;
+ fullscreenStrategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE;
+ fullscreenStrategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT;
+ fullscreenStrategy.canvasResizedCallback = canvasResizeCb;
+ fullscreenStrategy.canvasResizedCallbackUserData = this;
+
+ emscripten_request_fullscreen_strategy("#canvas", false, &fullscreenStrategy);
+
+ emscripten_set_focus_callback(NULL, this, true, focusCb);
+ emscripten_set_focusin_callback(NULL, this, true, focusCb);
+ emscripten_set_focusout_callback(NULL, this, true, focusCb);
+
+ int32_t result = main(_argc, _argv);
+ return result;
+ }
+
+ static EM_BOOL mouseCb(int eventType, const EmscriptenMouseEvent* event, void* userData);
+ static EM_BOOL wheelCb(int eventType, const EmscriptenWheelEvent* event, void* userData);
+ static EM_BOOL keyCb(int eventType, const EmscriptenKeyboardEvent* event, void* userData);
+ static EM_BOOL resizeCb(int eventType, const EmscriptenUiEvent* event, void* userData);
+ static EM_BOOL canvasResizeCb(int eventType, const void* reserved, void* userData);
+ static EM_BOOL focusCb(int eventType, const EmscriptenFocusEvent* event, void* userData);
+
+ EventQueue m_eventQueue;
+
+ float m_scrollf;
+ int32_t m_mx;
+ int32_t m_my;
+ int32_t m_scroll;
+ };
+
+ static Context s_ctx;
+
+ EM_BOOL Context::mouseCb(int eventType, const EmscriptenMouseEvent* event, void* userData)
+ {
+ BX_UNUSED(userData);
+
+ if (event)
+ {
+ switch (eventType)
+ {
+ case EMSCRIPTEN_EVENT_MOUSEMOVE:
+ {
+ s_ctx.m_mx = event->canvasX;
+ s_ctx.m_my = event->canvasY;
+ s_ctx.m_eventQueue.postMouseEvent(s_defaultWindow, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
+ return true;
+ }
+ case EMSCRIPTEN_EVENT_MOUSEDOWN:
+ case EMSCRIPTEN_EVENT_MOUSEUP:
+ case EMSCRIPTEN_EVENT_DBLCLICK:
+ {
+ s_ctx.m_mx = event->canvasX;
+ s_ctx.m_my = event->canvasY;
+ MouseButton::Enum mb = (event->button == 2) ? MouseButton::Right : ((event->button == 1) ? MouseButton::Middle : MouseButton::Left);
+ s_ctx.m_eventQueue.postMouseEvent(s_defaultWindow, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll, mb, (eventType != EMSCRIPTEN_EVENT_MOUSEUP));
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ EM_BOOL Context::wheelCb(int eventType, const EmscriptenWheelEvent* event, void* userData)
+ {
+ BX_UNUSED(userData);
+
+ if (event)
+ {
+ switch (eventType)
+ {
+ case EMSCRIPTEN_EVENT_WHEEL:
+ {
+ s_ctx.m_scrollf += event->deltaY;
+
+ s_ctx.m_scroll = (int32_t)s_ctx.m_scrollf;
+ s_ctx.m_eventQueue.postMouseEvent(s_defaultWindow, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ uint8_t translateModifiers(const EmscriptenKeyboardEvent* event)
+ {
+ uint8_t mask = 0;
+
+ if (event->shiftKey)
+ mask |= Modifier::LeftShift | Modifier::RightShift;
+
+ if (event->altKey)
+ mask |= Modifier::LeftAlt | Modifier::RightAlt;
+
+ if (event->ctrlKey)
+ mask |= Modifier::LeftCtrl | Modifier::RightCtrl;
+
+ if (event->metaKey)
+ mask |= Modifier::LeftMeta | Modifier::RightMeta;
+
+ return mask;
+ }
+
+ Key::Enum handleKeyEvent(const EmscriptenKeyboardEvent* event, uint8_t* specialKeys, uint8_t* _pressedChar)
+ {
+ *_pressedChar = (uint8_t)event->keyCode;
+
+ int keyCode = (int)event->keyCode;
+ *specialKeys = translateModifiers(event);
+
+ if (event->charCode == 0)
+ {
+ switch (keyCode)
+ {
+ case 112: return Key::F1;
+ case 113: return Key::F2;
+ case 114: return Key::F3;
+ case 115: return Key::F4;
+ case 116: return Key::F5;
+ case 117: return Key::F6;
+ case 118: return Key::F7;
+ case 119: return Key::F8;
+ case 120: return Key::F9;
+ case 121: return Key::F10;
+ case 122: return Key::F11;
+ case 123: return Key::F12;
+
+ case 37: return Key::Left;
+ case 39: return Key::Right;
+ case 38: return Key::Up;
+ case 40: return Key::Down;
+ }
+ }
+
+ // if this is a unhandled key just return None
+ if (keyCode < 256)
+ {
+ return (Key::Enum)s_translateKey[keyCode];
+ }
+
+ return Key::None;
+ }
+
+ EM_BOOL Context::keyCb(int eventType, const EmscriptenKeyboardEvent *event, void *userData)
+ {
+ BX_UNUSED(userData);
+
+ if (event)
+ {
+ uint8_t modifiers = 0;
+ uint8_t pressedChar[4];
+ Key::Enum key = handleKeyEvent(event, &modifiers, &pressedChar[0]);
+
+ // Returning true means that we take care of the key (instead of the default behavior)
+ if (key != Key::None)
+ {
+ switch (eventType)
+ {
+ case EMSCRIPTEN_EVENT_KEYPRESS:
+ case EMSCRIPTEN_EVENT_KEYDOWN:
+ {
+ if (key == Key::KeyQ && (modifiers & Modifier::RightMeta) )
+ {
+ s_ctx.m_eventQueue.postExitEvent();
+ }
+ else
+ {
+ enum { ShiftMask = Modifier::LeftShift|Modifier::RightShift };
+ s_ctx.m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar);
+ s_ctx.m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true);
+ return true;
+ }
+ break;
+ }
+ case EMSCRIPTEN_EVENT_KEYUP:
+ {
+ s_ctx.m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, false);
+ return true;
+ }
+ }
+ }
+
+ }
+ return false;
+ }
+
+ EM_BOOL Context::resizeCb(int eventType, const EmscriptenUiEvent* event, void* userData)
+ {
+ BX_UNUSED(eventType, event, userData);
+ return false;
+ }
+
+ EM_BOOL Context::canvasResizeCb(int eventType, const void* reserved, void* userData)
+ {
+ BX_UNUSED(eventType, reserved, userData);
+ return false;
+ }
+
+ EM_BOOL Context::focusCb(int eventType, const EmscriptenFocusEvent* event, void* userData)
+ {
+ printf("focusCb %d", eventType);
+ BX_UNUSED(event, userData);
+
+ if (event)
+ {
+ switch (eventType)
+ {
+ case EMSCRIPTEN_EVENT_BLUR:
+ {
+ s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidSuspend);
+ return true;
+ }
+ case EMSCRIPTEN_EVENT_FOCUS:
+ {
+ s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidResume);
+ return true;
+ }
+ case EMSCRIPTEN_EVENT_FOCUSIN:
+ {
+ s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillResume);
+ return true;
+ }
+ case EMSCRIPTEN_EVENT_FOCUSOUT:
+ {
+ s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillSuspend);
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
const Event* poll()
{
- return NULL;
+ entry_emscripten_yield();
+ return s_ctx.m_eventQueue.poll();
}
const Event* poll(WindowHandle _handle)
{
- BX_UNUSED(_handle);
- return NULL;
+ entry_emscripten_yield();
+ return s_ctx.m_eventQueue.poll(_handle);
}
void release(const Event* _event)
{
- BX_UNUSED(_event);
+ s_ctx.m_eventQueue.release(_event);
}
WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags, const char* _title)
{
BX_UNUSED(_x, _y, _width, _height, _flags, _title);
WindowHandle handle = { UINT16_MAX };
+
return handle;
}
@@ -72,7 +399,8 @@ namespace entry
int main(int _argc, char** _argv)
{
- return entry::main(_argc, _argv);
+ using namespace entry;
+ return s_ctx.run(_argc, _argv);
}
#endif // BX_PLATFORM_EMSCRIPTEN
diff --git a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
index 42a7bc6f047..615d828cea9 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
@@ -9,7 +9,7 @@
#define GLFW_DLL
#include <GLFW/glfw3.h>
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include "dbg.h"
// This is just trivial implementation of GLFW3 integration.
diff --git a/3rdparty/bgfx/examples/common/entry/entry_ios.mm b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
index 8fc67ffe8c7..1a10d26f765 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_ios.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
@@ -11,7 +11,13 @@
#import <UIKit/UIKit.h>
#import <QuartzCore/CAEAGLLayer.h>
-#include <bgfxplatform.h>
+#if __IPHONE_8_0 && !TARGET_IPHONE_SIMULATOR // check if sdk/target supports metal
+# import <Metal/Metal.h>
+# import <QuartzCore/CAMetalLayer.h>
+//# define HAS_METAL_SDK
+#endif
+
+#include <bgfx/bgfxplatform.h>
#include <bx/uint32_t.h>
#include <bx/thread.h>
@@ -140,6 +146,22 @@ namespace entry
using namespace entry;
+#ifdef HAS_METAL_SDK
+static id<MTLDevice> m_device = NULL;
+#else
+static void* m_device = NULL;
+#endif
+
+@interface ViewController : UIViewController
+@end
+@implementation ViewController
+- (BOOL)prefersStatusBarHidden
+{
+ return YES;
+}
+@end
+
+
@interface View : UIView
{
CADisplayLink* m_displayLink;
@@ -151,6 +173,19 @@ using namespace entry;
+ (Class)layerClass
{
+#ifdef HAS_METAL_SDK
+ Class metalClass = NSClassFromString(@"CAMetalLayer"); //is metal runtime sdk available
+ if ( metalClass != nil)
+ {
+ m_device = MTLCreateSystemDefaultDevice(); // is metal supported on this device (is there a better way to do this - without creating device ?)
+ if (m_device)
+ {
+ [m_device retain];
+ return metalClass;
+ }
+ }
+#endif
+
return [CAEAGLLayer class];
}
@@ -162,13 +197,25 @@ using namespace entry;
{
return nil;
}
-
- CAEAGLLayer* layer = (CAEAGLLayer*)self.layer;
- bgfx::iosSetEaglLayer(layer);
-
+
+ bgfx::PlatformData pd;
+ pd.ndt = NULL;
+ pd.nwh = self.layer;
+ pd.context = m_device;
+ pd.backBuffer = NULL;
+ pd.backBufferDS = NULL;
+ bgfx::setPlatformData(pd);
+
return self;
}
+- (void)layoutSubviews
+{
+ uint32_t frameW = (uint32_t)(self.contentScaleFactor * self.frame.size.width);
+ uint32_t frameH = (uint32_t)(self.contentScaleFactor * self.frame.size.height);
+ s_ctx->m_eventQueue.postSizeEvent(s_defaultWindow, frameW, frameH);
+}
+
- (void)start
{
if (nil == m_displayLink)
@@ -256,6 +303,13 @@ using namespace entry;
m_view = [ [View alloc] initWithFrame: rect];
[m_window addSubview: m_view];
+
+ UIViewController *viewController = [[ViewController alloc] init];
+ viewController.view = m_view;
+
+ [m_window setRootViewController:viewController];
+ [m_window makeKeyAndVisible];
+
[m_window makeKeyAndVisible];
//float scaleFactor = [[UIScreen mainScreen] scale]; // should use this, but ui is too small on ipad retina
@@ -269,22 +323,26 @@ using namespace entry;
- (void)applicationWillResignActive:(UIApplication *)application
{
BX_UNUSED(application);
+ s_ctx->m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillSuspend);
[m_view stop];
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
BX_UNUSED(application);
+ s_ctx->m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidSuspend);
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
BX_UNUSED(application);
+ s_ctx->m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillResume);
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
BX_UNUSED(application);
+ s_ctx->m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidResume);
[m_view start];
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_nacl.cpp b/3rdparty/bgfx/examples/common/entry/entry_nacl.cpp
index 8d6fac7baff..bc476290db0 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_nacl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_nacl.cpp
@@ -7,7 +7,7 @@
#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_NACL
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <stdio.h>
#include <string.h>
@@ -29,7 +29,7 @@
#include <ppapi/c/ppp_instance.h>
#include <ppapi/gles2/gl2ext_ppapi.h>
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <bx/thread.h>
#include "entry.h"
diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
index 89e7c4814d1..5b59fe06c84 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <bx/uint32_t.h>
#include <bx/thread.h>
@@ -39,6 +39,8 @@
- (void)windowWillClose:(NSNotification*)notification;
- (BOOL)windowShouldClose:(NSWindow*)window;
- (void)windowDidResize:(NSNotification*)notification;
+- (void)windowDidBecomeKey:(NSNotification *)notification;
+- (void)windowDidResignKey:(NSNotification *)notification;
@end
@@ -86,8 +88,8 @@ namespace entry
, m_fullscreen(false)
{
s_translateKey[27] = Key::Esc;
- s_translateKey[13] = Key::Return;
- s_translateKey[9] = Key::Tab;
+ s_translateKey[uint8_t('\n')] = Key::Return;
+ s_translateKey[uint8_t('\t')] = Key::Tab;
s_translateKey[127] = Key::Backspace;
s_translateKey[uint8_t(' ')] = Key::Space;
@@ -96,6 +98,28 @@ namespace entry
s_translateKey[uint8_t('_')] =
s_translateKey[uint8_t('-')] = Key::Minus;
+ s_translateKey[uint8_t('~')] =
+ s_translateKey[uint8_t('`')] = Key::Tilde;
+
+ s_translateKey[uint8_t(':')] =
+ s_translateKey[uint8_t(';')] = Key::Semicolon;
+ s_translateKey[uint8_t('"')] =
+ s_translateKey[uint8_t('\'')] = Key::Quote;
+
+ s_translateKey[uint8_t('{')] =
+ s_translateKey[uint8_t('[')] = Key::LeftBracket;
+ s_translateKey[uint8_t('}')] =
+ s_translateKey[uint8_t(']')] = Key::RightBracket;
+
+ s_translateKey[uint8_t('<')] =
+ s_translateKey[uint8_t(',')] = Key::Comma;
+ s_translateKey[uint8_t('>')] =
+ s_translateKey[uint8_t('.')] = Key::Period;
+ s_translateKey[uint8_t('?')] =
+ s_translateKey[uint8_t('/')] = Key::Slash;
+ s_translateKey[uint8_t('|')] =
+ s_translateKey[uint8_t('\\')] = Key::Backslash;
+
s_translateKey[uint8_t('0')] = Key::Key0;
s_translateKey[uint8_t('1')] = Key::Key1;
s_translateKey[uint8_t('2')] = Key::Key2;
@@ -249,7 +273,7 @@ namespace entry
{
// TODO: remove!
// Command + Left Mouse Button acts as middle! This just a temporary solution!
- // This is becase the average OSX user doesn't have middle mouse click.
+ // This is because the average OSX user doesn't have middle mouse click.
MouseButton::Enum mb = ([event modifierFlags] & NSCommandKeyMask) ? MouseButton::Middle : MouseButton::Left;
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, mb, true);
break;
@@ -362,6 +386,18 @@ namespace entry
m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, false);
}
+ void windowDidBecomeKey()
+ {
+ m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillResume);
+ m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidResume);
+ }
+
+ void windowDidResignKey()
+ {
+ m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillSuspend);
+ m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidSuspend);
+ }
+
int32_t run(int _argc, char** _argv)
{
[NSApplication sharedApplication];
@@ -701,6 +737,20 @@ namespace entry
s_ctx.windowDidResize();
}
+- (void)windowDidBecomeKey:(NSNotification*)notification
+{
+ BX_UNUSED(notification);
+ using namespace entry;
+ s_ctx.windowDidBecomeKey();
+}
+
+- (void)windowDidResignKey:(NSNotification*)notification
+{
+ BX_UNUSED(notification);
+ using namespace entry;
+ s_ctx.windowDidResignKey();
+}
+
@end
int main(int _argc, char** _argv)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index d0ba73311c5..e1a1a514855 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -75,6 +75,7 @@ namespace entry
Mouse,
Size,
Window,
+ Suspend,
};
Event(Enum _type)
@@ -154,6 +155,13 @@ namespace entry
void* m_nwh;
};
+ struct SuspendEvent : public Event
+ {
+ ENTRY_IMPLEMENT_EVENT(SuspendEvent, Event::Suspend);
+
+ Suspend::Enum m_state;
+ };
+
const Event* poll();
const Event* poll(WindowHandle _handle);
void release(const Event* _event);
@@ -248,6 +256,13 @@ namespace entry
m_queue.push(ev);
}
+ void postSuspendEvent(WindowHandle _handle, Suspend::Enum _state)
+ {
+ SuspendEvent* ev = new SuspendEvent(_handle);
+ ev->m_state = _state;
+ m_queue.push(ev);
+ }
+
const Event* poll()
{
return m_queue.pop();
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 91bfef74865..a9faec69e47 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -13,7 +13,7 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <stdio.h>
#include <bx/thread.h>
@@ -320,7 +320,7 @@ namespace entry
initTranslateGamepadAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT, GamepadAxis::RightZ);
}
- void run(int _argc, char** _argv)
+ int run(int _argc, char** _argv)
{
m_mte.m_argc = _argc;
m_mte.m_argv = _argv;
@@ -644,7 +644,7 @@ namespace entry
Msg* msg = (Msg*)uev.data2;
if (isValid(handle) )
{
- SDL_SetWindowTitle(m_window[handle.idx], msg->m_title.c_str());
+ SDL_SetWindowTitle(m_window[handle.idx], msg->m_title.c_str() );
}
delete msg;
}
@@ -710,6 +710,8 @@ namespace entry
SDL_DestroyWindow(m_window[0]);
SDL_Quit();
+
+ return m_thread.getExitCode();
}
WindowHandle findHandle(uint32_t _windowId)
@@ -896,8 +898,7 @@ namespace entry
int main(int _argc, char** _argv)
{
using namespace entry;
- s_ctx.run(_argc, _argv);
- return 0;
+ return s_ctx.run(_argc, _argv);
}
#endif // ENTRY_CONFIG_USE_SDL
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 65fd6013c6b..c61450c9ab9 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -7,12 +7,13 @@
#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_WINDOWS
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <bx/uint32_t.h>
#include <bx/thread.h>
#include <bx/mutex.h>
#include <bx/handlealloc.h>
+#include <bx/timer.h>
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -116,6 +117,17 @@ namespace entry
void update(EventQueue& _eventQueue)
{
+ int64_t now = bx::getHPCounter();
+ static int64_t next = now;
+
+ if (now < next)
+ {
+ return;
+ }
+
+ const int64_t timerFreq = bx::getHPFrequency();
+ next = now + timerFreq/60;
+
if (NULL == m_xinputdll)
{
return;
@@ -332,80 +344,91 @@ namespace entry
, m_exit(false)
{
memset(s_translateKey, 0, sizeof(s_translateKey) );
- s_translateKey[VK_ESCAPE] = Key::Esc;
- s_translateKey[VK_RETURN] = Key::Return;
- s_translateKey[VK_TAB] = Key::Tab;
- s_translateKey[VK_BACK] = Key::Backspace;
- s_translateKey[VK_SPACE] = Key::Space;
- s_translateKey[VK_UP] = Key::Up;
- s_translateKey[VK_DOWN] = Key::Down;
- s_translateKey[VK_LEFT] = Key::Left;
- s_translateKey[VK_RIGHT] = Key::Right;
- s_translateKey[VK_PRIOR] = Key::PageUp;
- s_translateKey[VK_NEXT] = Key::PageUp;
- s_translateKey[VK_HOME] = Key::Home;
- s_translateKey[VK_END] = Key::End;
- s_translateKey[VK_SNAPSHOT] = Key::Print;
- s_translateKey[VK_OEM_PLUS] = Key::Plus;
- s_translateKey[VK_OEM_MINUS] = Key::Minus;
- s_translateKey[VK_F1] = Key::F1;
- s_translateKey[VK_F2] = Key::F2;
- s_translateKey[VK_F3] = Key::F3;
- s_translateKey[VK_F4] = Key::F4;
- s_translateKey[VK_F5] = Key::F5;
- s_translateKey[VK_F6] = Key::F6;
- s_translateKey[VK_F7] = Key::F7;
- s_translateKey[VK_F8] = Key::F8;
- s_translateKey[VK_F9] = Key::F9;
- s_translateKey[VK_F10] = Key::F10;
- s_translateKey[VK_F11] = Key::F11;
- s_translateKey[VK_F12] = Key::F12;
- s_translateKey[VK_NUMPAD0] = Key::NumPad0;
- s_translateKey[VK_NUMPAD1] = Key::NumPad1;
- s_translateKey[VK_NUMPAD2] = Key::NumPad2;
- s_translateKey[VK_NUMPAD3] = Key::NumPad3;
- s_translateKey[VK_NUMPAD4] = Key::NumPad4;
- s_translateKey[VK_NUMPAD5] = Key::NumPad5;
- s_translateKey[VK_NUMPAD6] = Key::NumPad6;
- s_translateKey[VK_NUMPAD7] = Key::NumPad7;
- s_translateKey[VK_NUMPAD8] = Key::NumPad8;
- s_translateKey[VK_NUMPAD9] = Key::NumPad9;
- s_translateKey[uint8_t('0')] = Key::Key0;
- s_translateKey[uint8_t('1')] = Key::Key1;
- s_translateKey[uint8_t('2')] = Key::Key2;
- s_translateKey[uint8_t('3')] = Key::Key3;
- s_translateKey[uint8_t('4')] = Key::Key4;
- s_translateKey[uint8_t('5')] = Key::Key5;
- s_translateKey[uint8_t('6')] = Key::Key6;
- s_translateKey[uint8_t('7')] = Key::Key7;
- s_translateKey[uint8_t('8')] = Key::Key8;
- s_translateKey[uint8_t('9')] = Key::Key9;
- s_translateKey[uint8_t('A')] = Key::KeyA;
- s_translateKey[uint8_t('B')] = Key::KeyB;
- s_translateKey[uint8_t('C')] = Key::KeyC;
- s_translateKey[uint8_t('D')] = Key::KeyD;
- s_translateKey[uint8_t('E')] = Key::KeyE;
- s_translateKey[uint8_t('F')] = Key::KeyF;
- s_translateKey[uint8_t('G')] = Key::KeyG;
- s_translateKey[uint8_t('H')] = Key::KeyH;
- s_translateKey[uint8_t('I')] = Key::KeyI;
- s_translateKey[uint8_t('J')] = Key::KeyJ;
- s_translateKey[uint8_t('K')] = Key::KeyK;
- s_translateKey[uint8_t('L')] = Key::KeyL;
- s_translateKey[uint8_t('M')] = Key::KeyM;
- s_translateKey[uint8_t('N')] = Key::KeyN;
- s_translateKey[uint8_t('O')] = Key::KeyO;
- s_translateKey[uint8_t('P')] = Key::KeyP;
- s_translateKey[uint8_t('Q')] = Key::KeyQ;
- s_translateKey[uint8_t('R')] = Key::KeyR;
- s_translateKey[uint8_t('S')] = Key::KeyS;
- s_translateKey[uint8_t('T')] = Key::KeyT;
- s_translateKey[uint8_t('U')] = Key::KeyU;
- s_translateKey[uint8_t('V')] = Key::KeyV;
- s_translateKey[uint8_t('W')] = Key::KeyW;
- s_translateKey[uint8_t('X')] = Key::KeyX;
- s_translateKey[uint8_t('Y')] = Key::KeyY;
- s_translateKey[uint8_t('Z')] = Key::KeyZ;
+ s_translateKey[VK_ESCAPE] = Key::Esc;
+ s_translateKey[VK_RETURN] = Key::Return;
+ s_translateKey[VK_TAB] = Key::Tab;
+ s_translateKey[VK_BACK] = Key::Backspace;
+ s_translateKey[VK_SPACE] = Key::Space;
+ s_translateKey[VK_UP] = Key::Up;
+ s_translateKey[VK_DOWN] = Key::Down;
+ s_translateKey[VK_LEFT] = Key::Left;
+ s_translateKey[VK_RIGHT] = Key::Right;
+ s_translateKey[VK_INSERT] = Key::Insert;
+ s_translateKey[VK_DELETE] = Key::Delete;
+ s_translateKey[VK_HOME] = Key::Home;
+ s_translateKey[VK_END] = Key::End;
+ s_translateKey[VK_PRIOR] = Key::PageUp;
+ s_translateKey[VK_NEXT] = Key::PageUp;
+ s_translateKey[VK_SNAPSHOT] = Key::Print;
+ s_translateKey[VK_OEM_PLUS] = Key::Plus;
+ s_translateKey[VK_OEM_MINUS] = Key::Minus;
+ s_translateKey[VK_OEM_4] = Key::LeftBracket;
+ s_translateKey[VK_OEM_6] = Key::RightBracket;
+ s_translateKey[VK_OEM_1] = Key::Semicolon;
+ s_translateKey[VK_OEM_7] = Key::Quote;
+ s_translateKey[VK_OEM_COMMA] = Key::Comma;
+ s_translateKey[VK_OEM_PERIOD] = Key::Period;
+ s_translateKey[VK_OEM_2] = Key::Slash;
+ s_translateKey[VK_OEM_5] = Key::Backslash;
+ s_translateKey[VK_OEM_3] = Key::Tilde;
+ s_translateKey[VK_F1] = Key::F1;
+ s_translateKey[VK_F2] = Key::F2;
+ s_translateKey[VK_F3] = Key::F3;
+ s_translateKey[VK_F4] = Key::F4;
+ s_translateKey[VK_F5] = Key::F5;
+ s_translateKey[VK_F6] = Key::F6;
+ s_translateKey[VK_F7] = Key::F7;
+ s_translateKey[VK_F8] = Key::F8;
+ s_translateKey[VK_F9] = Key::F9;
+ s_translateKey[VK_F10] = Key::F10;
+ s_translateKey[VK_F11] = Key::F11;
+ s_translateKey[VK_F12] = Key::F12;
+ s_translateKey[VK_NUMPAD0] = Key::NumPad0;
+ s_translateKey[VK_NUMPAD1] = Key::NumPad1;
+ s_translateKey[VK_NUMPAD2] = Key::NumPad2;
+ s_translateKey[VK_NUMPAD3] = Key::NumPad3;
+ s_translateKey[VK_NUMPAD4] = Key::NumPad4;
+ s_translateKey[VK_NUMPAD5] = Key::NumPad5;
+ s_translateKey[VK_NUMPAD6] = Key::NumPad6;
+ s_translateKey[VK_NUMPAD7] = Key::NumPad7;
+ s_translateKey[VK_NUMPAD8] = Key::NumPad8;
+ s_translateKey[VK_NUMPAD9] = Key::NumPad9;
+ s_translateKey[uint8_t('0')] = Key::Key0;
+ s_translateKey[uint8_t('1')] = Key::Key1;
+ s_translateKey[uint8_t('2')] = Key::Key2;
+ s_translateKey[uint8_t('3')] = Key::Key3;
+ s_translateKey[uint8_t('4')] = Key::Key4;
+ s_translateKey[uint8_t('5')] = Key::Key5;
+ s_translateKey[uint8_t('6')] = Key::Key6;
+ s_translateKey[uint8_t('7')] = Key::Key7;
+ s_translateKey[uint8_t('8')] = Key::Key8;
+ s_translateKey[uint8_t('9')] = Key::Key9;
+ s_translateKey[uint8_t('A')] = Key::KeyA;
+ s_translateKey[uint8_t('B')] = Key::KeyB;
+ s_translateKey[uint8_t('C')] = Key::KeyC;
+ s_translateKey[uint8_t('D')] = Key::KeyD;
+ s_translateKey[uint8_t('E')] = Key::KeyE;
+ s_translateKey[uint8_t('F')] = Key::KeyF;
+ s_translateKey[uint8_t('G')] = Key::KeyG;
+ s_translateKey[uint8_t('H')] = Key::KeyH;
+ s_translateKey[uint8_t('I')] = Key::KeyI;
+ s_translateKey[uint8_t('J')] = Key::KeyJ;
+ s_translateKey[uint8_t('K')] = Key::KeyK;
+ s_translateKey[uint8_t('L')] = Key::KeyL;
+ s_translateKey[uint8_t('M')] = Key::KeyM;
+ s_translateKey[uint8_t('N')] = Key::KeyN;
+ s_translateKey[uint8_t('O')] = Key::KeyO;
+ s_translateKey[uint8_t('P')] = Key::KeyP;
+ s_translateKey[uint8_t('Q')] = Key::KeyQ;
+ s_translateKey[uint8_t('R')] = Key::KeyR;
+ s_translateKey[uint8_t('S')] = Key::KeyS;
+ s_translateKey[uint8_t('T')] = Key::KeyT;
+ s_translateKey[uint8_t('U')] = Key::KeyU;
+ s_translateKey[uint8_t('V')] = Key::KeyV;
+ s_translateKey[uint8_t('W')] = Key::KeyW;
+ s_translateKey[uint8_t('X')] = Key::KeyX;
+ s_translateKey[uint8_t('Y')] = Key::KeyY;
+ s_translateKey[uint8_t('Z')] = Key::KeyZ;
}
int32_t run(int _argc, char** _argv)
@@ -488,7 +511,7 @@ namespace entry
s_xinput.shutdown();
- return 0;
+ return thread.getExitCode();
}
LRESULT process(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam)
@@ -507,7 +530,7 @@ namespace entry
, msg->m_y
, msg->m_width
, msg->m_height
- , m_hwnd[0]
+ , NULL
, NULL
, (HINSTANCE)GetModuleHandle(NULL)
, 0
@@ -825,7 +848,7 @@ namespace entry
void adjust(HWND _hwnd, uint32_t _width, uint32_t _height, bool _windowFrame)
{
- m_width = _width;
+ m_width = _width;
m_height = _height;
m_aspectRatio = float(_width)/float(_height);
@@ -857,15 +880,16 @@ namespace entry
GetMonitorInfo(monitor, &mi);
newrect = mi.rcMonitor;
rect = mi.rcMonitor;
+ m_aspectRatio = float(newrect.right - newrect.left)/float(newrect.bottom - newrect.top);
#endif // !defined(__MINGW__)
}
SetWindowLong(_hwnd, GWL_STYLE, style);
- uint32_t prewidth = newrect.right - newrect.left;
+ uint32_t prewidth = newrect.right - newrect.left;
uint32_t preheight = newrect.bottom - newrect.top;
AdjustWindowRect(&newrect, style, FALSE);
- m_frameWidth = (newrect.right - newrect.left) - prewidth;
- m_frameHeight = (newrect.bottom - newrect.top) - preheight;
+ m_frameWidth = (newrect.right - newrect.left) - prewidth;
+ m_frameHeight = (newrect.bottom - newrect.top ) - preheight;
UpdateWindow(_hwnd);
if (rect.left == -32000
@@ -875,46 +899,19 @@ namespace entry
rect.top = 0;
}
- int32_t left = rect.left;
- int32_t top = rect.top;
- int32_t width = (newrect.right-newrect.left);
+ int32_t left = rect.left;
+ int32_t top = rect.top;
+ int32_t width = (newrect.right-newrect.left);
int32_t height = (newrect.bottom-newrect.top);
if (!_windowFrame)
{
float aspectRatio = 1.0f/m_aspectRatio;
- width = bx::uint32_max(ENTRY_DEFAULT_WIDTH/4, width);
+ width = bx::uint32_max(ENTRY_DEFAULT_WIDTH/4, width);
height = uint32_t(float(width)*aspectRatio);
- left = newrect.left+(newrect.right-newrect.left-width)/2;
- top = newrect.top+(newrect.bottom-newrect.top-height)/2;
- }
-
- HWND parent = GetWindow(_hwnd, GW_OWNER);
- if (NULL != parent)
- {
- if (_windowFrame)
- {
- SetWindowPos(parent
- , HWND_TOP
- , -32000
- , -32000
- , 0
- , 0
- , SWP_SHOWWINDOW
- );
- }
- else
- {
- SetWindowPos(parent
- , HWND_TOP
- , newrect.left
- , newrect.top
- , newrect.right-newrect.left
- , newrect.bottom-newrect.top
- , SWP_SHOWWINDOW
- );
- }
+ left = newrect.left+(newrect.right -newrect.left-width)/2;
+ top = newrect.top +(newrect.bottom-newrect.top-height)/2;
}
SetWindowPos(_hwnd
@@ -1069,7 +1066,7 @@ namespace entry
void toggleFullscreen(WindowHandle _handle)
{
- BX_UNUSED(_handle);
+ PostMessage(s_ctx.m_hwnd[0], WM_USER_WINDOW_TOGGLE_FRAME, _handle.idx, 0);
}
void setMouseLock(WindowHandle _handle, bool _lock)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp b/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp
index 1bca2de28da..042c032d609 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_winrt.cpp
@@ -7,7 +7,7 @@
#if BX_PLATFORM_WINRT
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#include <bx/thread.h>
using namespace Windows::ApplicationModel;
@@ -44,7 +44,7 @@ public:
window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
- bgfx::winrtSetWindow(reinterpret_cast<IUnknown*>(window));
+ bgfx::winrtSetWindow(reinterpret_cast<IUnknown*>(window) );
}
virtual void Load(String^ entryPoint)
@@ -62,8 +62,8 @@ public:
static const float dipsPerInch = 96.0f;
g_eventQueue.postSizeEvent(g_defaultWindow
- , lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f))
- , lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f))
+ , lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f) )
+ , lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f) )
);
while (!m_windowClosed)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index 02d14316952..16b7af4ffa1 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -11,7 +11,7 @@
#define XK_LATIN1
#include <X11/keysymdef.h>
#include <X11/Xlib.h> // will include X11 which #defines None... Don't mess with order of includes.
-#include <bgfxplatform.h>
+#include <bgfx/bgfxplatform.h>
#undef None
#include <bx/thread.h>
@@ -63,6 +63,11 @@ namespace entry
struct Joystick
{
+ Joystick()
+ : m_fd(-1)
+ {
+ }
+
void init()
{
m_fd = open("/dev/input/js0", O_RDONLY | O_NONBLOCK);
@@ -80,7 +85,7 @@ namespace entry
void shutdown()
{
- if (0 != m_fd)
+ if (-1 != m_fd)
{
close(m_fd);
}
@@ -99,7 +104,7 @@ namespace entry
bool update(EventQueue& _eventQueue)
{
- if (0 == m_fd)
+ if (-1 == m_fd)
{
return false;
}
@@ -202,13 +207,24 @@ namespace entry
initTranslateKey(XK_Down, Key::Down);
initTranslateKey(XK_Left, Key::Left);
initTranslateKey(XK_Right, Key::Right);
- initTranslateKey(XK_Page_Up, Key::PageUp);
- initTranslateKey(XK_Page_Down, Key::PageUp);
+ initTranslateKey(XK_Insert, Key::Insert);
+ initTranslateKey(XK_Delete, Key::Delete);
initTranslateKey(XK_Home, Key::Home);
initTranslateKey(XK_KP_End, Key::End);
+ initTranslateKey(XK_Page_Up, Key::PageUp);
+ initTranslateKey(XK_Page_Down, Key::PageDown);
initTranslateKey(XK_Print, Key::Print);
initTranslateKey(XK_equal, Key::Plus);
initTranslateKey(XK_minus, Key::Minus);
+ initTranslateKey(XK_bracketleft, Key::LeftBracket);
+ initTranslateKey(XK_bracketright, Key::RightBracket);
+ initTranslateKey(XK_semicolon, Key::Semicolon);
+ initTranslateKey(XK_apostrophe, Key::Quote);
+ initTranslateKey(XK_comma, Key::Comma);
+ initTranslateKey(XK_period, Key::Period);
+ initTranslateKey(XK_slash, Key::Slash);
+ initTranslateKey(XK_backslash, Key::Backslash);
+ initTranslateKey(XK_grave, Key::Tilde);
initTranslateKey(XK_F1, Key::F1);
initTranslateKey(XK_F2, Key::F2);
initTranslateKey(XK_F3, Key::F3);
@@ -283,11 +299,10 @@ namespace entry
m_visual = DefaultVisual(m_display, screen);
m_root = RootWindow(m_display, screen);
- XSetWindowAttributes windowAttrs;
- memset(&windowAttrs, 0, sizeof(windowAttrs) );
- windowAttrs.background_pixmap = 0;
- windowAttrs.border_pixel = 0;
- windowAttrs.event_mask = 0
+ memset(&m_windowAttrs, 0, sizeof(m_windowAttrs) );
+ m_windowAttrs.background_pixmap = 0;
+ m_windowAttrs.border_pixel = 0;
+ m_windowAttrs.event_mask = 0
| ButtonPressMask
| ButtonReleaseMask
| ExposureMask
@@ -306,7 +321,7 @@ namespace entry
, InputOutput
, m_visual
, CWBorderPixel|CWEventMask
- , &windowAttrs
+ , &m_windowAttrs
);
// Clear window to black.
@@ -322,6 +337,20 @@ namespace entry
XMapWindow(m_display, m_window[0]);
XStoreName(m_display, m_window[0], "BGFX");
+ XIM im;
+ im = XOpenIM(m_display, NULL, NULL, NULL);
+
+ XIC ic;
+ ic = XCreateIC(im
+ , XNInputStyle
+ , 0
+ | XIMPreeditNothing
+ | XIMStatusNothing
+ , XNClientWindow
+ , m_window[0]
+ , NULL
+ );
+
//
bgfx::x11SetDisplayWindow(m_display, m_window[0]);
@@ -433,10 +462,30 @@ namespace entry
default:
{
+ WindowHandle handle = findHandle(xkey.window);
+ if (KeyPress == event.type)
+ {
+ Status status = 0;
+ uint8_t utf8[4];
+ int len = Xutf8LookupString(ic, &xkey, (char*)utf8, sizeof(utf8), &keysym, &status);
+ switch (status)
+ {
+ case XLookupChars:
+ case XLookupBoth:
+ if (0 != len)
+ {
+ m_eventQueue.postCharEvent(handle, len, utf8);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
Key::Enum key = fromXk(keysym);
if (Key::None != key)
{
- WindowHandle handle = findHandle(xkey.window);
m_eventQueue.postKeyEvent(handle, key, m_modifiers, KeyPress == event.type);
}
}
@@ -463,10 +512,13 @@ namespace entry
s_joystick.shutdown();
+ XDestroyIC(ic);
+ XCloseIM(im);
+
XUnmapWindow(m_display, m_window[0]);
XDestroyWindow(m_display, m_window[0]);
- return EXIT_SUCCESS;
+ return thread.getExitCode();
}
void setModifier(Modifier::Enum _modifier, bool _set)
@@ -477,21 +529,6 @@ namespace entry
void createWindow(WindowHandle _handle, Msg* msg)
{
- XSetWindowAttributes windowAttrs;
- memset(&windowAttrs, 0, sizeof(windowAttrs) );
- windowAttrs.background_pixmap = 0;
- windowAttrs.border_pixel = 0;
- windowAttrs.event_mask = 0
- | ButtonPressMask
- | ButtonReleaseMask
- | ExposureMask
- | KeyPressMask
- | KeyReleaseMask
- | PointerMotionMask
- | ResizeRedirectMask
- | StructureNotifyMask
- ;
-
Window window = XCreateWindow(m_display
, m_root
, msg->m_x
@@ -503,7 +540,7 @@ namespace entry
, InputOutput
, m_visual
, CWBorderPixel|CWEventMask
- , &windowAttrs
+ , &m_windowAttrs
);
m_window[_handle.idx] = window;
@@ -567,6 +604,8 @@ namespace entry
Visual* m_visual;
Window m_root;
+ XSetWindowAttributes m_windowAttrs;
+
Display* m_display;
Window m_window[ENTRY_CONFIG_MAX_WINDOWS];
uint32_t m_flags[ENTRY_CONFIG_MAX_WINDOWS];
@@ -632,26 +671,23 @@ namespace entry
void setWindowPos(WindowHandle _handle, int32_t _x, int32_t _y)
{
- BX_UNUSED(_handle, _x, _y);
+ Display* display = s_ctx.m_display;
+ Window window = s_ctx.m_window[_handle.idx];
+ XMoveWindow(display, window, _x, _y);
}
void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height)
{
- BX_UNUSED(_handle);
- XResizeRequestEvent ev;
- ev.type = ResizeRequest;
- ev.serial = 0;
- ev.send_event = true;
- ev.display = s_ctx.m_display;
- ev.window = s_ctx.m_window[0];
- ev.width = (int)_width;
- ev.height = (int)_height;
- XSendEvent(s_ctx.m_display, s_ctx.m_window[0], false, ResizeRedirectMask, (XEvent*)&ev);
+ Display* display = s_ctx.m_display;
+ Window window = s_ctx.m_window[_handle.idx];
+ XResizeWindow(display, window, int32_t(_width), int32_t(_height) );
}
void setWindowTitle(WindowHandle _handle, const char* _title)
{
- XStoreName(s_ctx.m_display, s_ctx.m_window[_handle.idx], _title);
+ Display* display = s_ctx.m_display;
+ Window window = s_ctx.m_window[_handle.idx];
+ XStoreName(display, window, _title);
}
void toggleWindowFrame(WindowHandle _handle)
diff --git a/3rdparty/bgfx/examples/common/entry/input.cpp b/3rdparty/bgfx/examples/common/entry/input.cpp
index 871bc96ea1d..a0618f86c9c 100644
--- a/3rdparty/bgfx/examples/common/entry/input.cpp
+++ b/3rdparty/bgfx/examples/common/entry/input.cpp
@@ -7,6 +7,7 @@
#include "entry_p.h"
#include "input.h"
+#include "cmd.h"
#include <bx/allocator.h>
#include <bx/ringbuffer.h>
@@ -88,10 +89,10 @@ struct Keyboard
return state;
}
- static void decodeKeyState(uint32_t _state, uint8_t& _modifiers, bool& _down)
+ static bool decodeKeyState(uint32_t _state, uint8_t& _modifiers)
{
_modifiers = (_state>>16)&0xff;
- _down = 0 != ( (_state>>8)&0xff);
+ return 0 != ( (_state>> 8)&0xff);
}
void setKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down)
@@ -100,6 +101,24 @@ struct Keyboard
m_once[_key] = false;
}
+ bool getKeyState(entry::Key::Enum _key, uint8_t* _modifiers)
+ {
+ uint8_t modifiers;
+ _modifiers = NULL == _modifiers ? &modifiers : _modifiers;
+
+ return decodeKeyState(m_key[_key], *_modifiers);
+ }
+
+ uint8_t getModifiersState()
+ {
+ uint8_t modifiers = 0;
+ for (uint32_t ii = 0; ii < entry::Key::Count; ++ii)
+ {
+ modifiers |= (m_key[ii]>>16)&0xff;
+ }
+ return modifiers;
+ }
+
void pushChar(uint8_t _len, const uint8_t _char[4])
{
for (uint32_t len = m_ring.reserve(4)
@@ -195,8 +214,7 @@ struct Input
for (const InputBinding* binding = _bindings; binding->m_key != entry::Key::None; ++binding)
{
uint8_t modifiers;
- bool down;
- Keyboard::decodeKeyState(m_keyboard.m_key[binding->m_key], modifiers, down);
+ bool down = Keyboard::decodeKeyState(m_keyboard.m_key[binding->m_key], modifiers);
if (binding->m_flags == 1)
{
@@ -205,7 +223,14 @@ struct Input
if (modifiers == binding->m_modifiers
&& !m_keyboard.m_once[binding->m_key])
{
- binding->m_fn(binding->m_userData);
+ if (NULL == binding->m_fn)
+ {
+ cmdExec( (const char*)binding->m_userData);
+ }
+ else
+ {
+ binding->m_fn(binding->m_userData);
+ }
m_keyboard.m_once[binding->m_key] = true;
}
}
@@ -219,7 +244,14 @@ struct Input
if (down
&& modifiers == binding->m_modifiers)
{
- binding->m_fn(binding->m_userData);
+ if (NULL == binding->m_fn)
+ {
+ cmdExec( (const char*)binding->m_userData);
+ }
+ else
+ {
+ binding->m_fn(binding->m_userData);
+ }
}
}
}
@@ -287,6 +319,16 @@ void inputSetKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down)
s_input->m_keyboard.setKeyState(_key, _modifiers, _down);
}
+bool inputGetKeyState(entry::Key::Enum _key, uint8_t* _modifiers)
+{
+ return s_input->m_keyboard.getKeyState(_key, _modifiers);
+}
+
+uint8_t inputGetModifiersState()
+{
+ return s_input->m_keyboard.getModifiersState();
+}
+
void inputChar(uint8_t _len, const uint8_t _char[4])
{
s_input->m_keyboard.pushChar(_len, _char);
diff --git a/3rdparty/bgfx/examples/common/entry/input.h b/3rdparty/bgfx/examples/common/entry/input.h
index c3f7ef18223..2dcbbdb74f6 100644
--- a/3rdparty/bgfx/examples/common/entry/input.h
+++ b/3rdparty/bgfx/examples/common/entry/input.h
@@ -39,6 +39,12 @@ void inputProcess();
///
void inputSetKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down);
+///
+bool inputGetKeyState(entry::Key::Enum _key, uint8_t* _modifiers = NULL);
+
+///
+uint8_t inputGetModifiersState();
+
/// Adds single UTF-8 encoded character into input buffer.
void inputChar(uint8_t _len, const uint8_t _char[4]);
diff --git a/3rdparty/bgfx/examples/common/font/font_manager.cpp b/3rdparty/bgfx/examples/common/font/font_manager.cpp
index 8532a534e03..053f7c95f93 100644
--- a/3rdparty/bgfx/examples/common/font/font_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/font_manager.cpp
@@ -25,7 +25,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
#include "../common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <math.h>
#if USE_EDTAA3
diff --git a/3rdparty/bgfx/examples/common/font/font_manager.h b/3rdparty/bgfx/examples/common/font/font_manager.h
index 73d47120333..978440a8f73 100644
--- a/3rdparty/bgfx/examples/common/font/font_manager.h
+++ b/3rdparty/bgfx/examples/common/font/font_manager.h
@@ -7,7 +7,7 @@
#define FONT_MANAGER_H_HEADER_GUARD
#include <bx/handlealloc.h>
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
class Atlas;
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
index b81d3412b97..69a3484dc65 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h
@@ -1,19 +1,19 @@
static const uint8_t fs_font_basic_glsl[553] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x09, 0x02, 0x00, 0x00, 0x76, // Color..........v
0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif
0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // orm lowp sampler
- 0x43, 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube u_texColor;
+ 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube s_texColor;
0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.
0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, // lowp float rgb
0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // a_1[4];. lowp v
0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;.
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu
- 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol
+ 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (s_texCol
0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0.
0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);. highp in
0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;. tm
@@ -36,75 +36,140 @@ static const uint8_t fs_font_basic_glsl[553] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_4;.}...
};
-static const uint8_t fs_font_basic_dx9[445] =
+static const uint8_t fs_font_basic_dx9[462] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH.............
- 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, // ..".CTAB....S...
- 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
- 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // L...0...........
- 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // <.......u_texCol
- 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // or..............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // .......@...?....
- 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, // ...?Q...........
- 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x1f, 0x00, 0x00, 0x02, // ..........@.....
- 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, // ................
- 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, // ................
- 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, // ..U.............
- 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, // X.........U.....
- 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ..U.X...........
- 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ......U.........
- 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ........X.......
- 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, // ............B...
- 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xb0, 0x01, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
+ 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
+ 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
+ 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
+ 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
+ 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x1f, 0x00, 0x00, // ...........@....
+ 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
+ 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, // ................
+ 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ...U............
+ 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, // .X.........U....
+ 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ...U.X..........
+ 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // .......U........
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // .........X......
+ 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, // .............B..
+ 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ..............
};
-static const uint8_t fs_font_basic_dx11[600] =
+static const uint8_t fs_font_basic_dx11[617] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x48, 0x02, 0x44, 0x58, 0x42, 0x43, // FSH.......H.DXBC
- 0xdb, 0x69, 0x11, 0xe0, 0xc0, 0xf9, 0x23, 0x5b, 0x4d, 0x65, 0x8f, 0xa1, 0x99, 0x34, 0xff, 0x76, // .i....#[Me...4.v
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....H.......,...
- 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
- 0x53, 0x48, 0x44, 0x52, 0x6c, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, // SHDRl...@...[...
- 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, // Z....`......X0..
- 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b...
- 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........b.......
- 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // h.......i.......
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // ........E.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, // .....`......6...
- 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // .0 .........*...
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6....0 .....
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, // ............6...
- 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // .0 .............
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6....0 .....
- 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, // ....:.......2...
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........:.......
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // .@.....@.@.....?
- 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...........
- 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // .0 .............
- 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8.... ..........
- 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....:.......6...
- 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r ......F.......
- 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >.......
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x48, 0x02, 0x44, 0x58, 0x42, // Color0.....H.DXB
+ 0x43, 0xdb, 0x69, 0x11, 0xe0, 0xc0, 0xf9, 0x23, 0x5b, 0x4d, 0x65, 0x8f, 0xa1, 0x99, 0x34, 0xff, // C.i....#[Me...4.
+ 0x76, 0x01, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // v....H.......,..
+ 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, // .........ISGNl..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........b......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
+ 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, // OR.TEXCOORD..OSG
+ 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... ..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET..
+ 0xab, 0x53, 0x48, 0x44, 0x52, 0x6c, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, // .SHDRl...@...[..
+ 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, // .Z....`......X0.
+ 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, // ..p......UU..b..
+ 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, // .........b......
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // .h.......i......
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .........E......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, // .....F.......F~.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // ......`......6..
+ 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // ..0 .........*..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, // .....6....0 ....
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .............6..
+ 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // ..0 ............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, // .....6....0 ....
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....:.......2..
+ 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, // .........:......
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // ..@.....@.@.....
+ 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // ?...............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6..........
+ 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ..0 ............
+ 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .8.... .........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .....:.......6..
+ 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, // .r ......F......
+ 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .>.......
+};
+static const uint8_t fs_font_basic_mtl[950] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xa7, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x74, // r0;. float4 v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // excoord0;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // rOutput {. half
+ 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // 4 gl_FragColor;.
+ 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // };.struct xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, // lShaderUniform {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, // ffer(0)]]. ,
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, // texturecube<floa
+ 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, // t> s_texColor [[
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, // texture(0)]], sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, // mpler _mtlsmp_s_
+ 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, // texColor [[sampl
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, // _mtl_o;. half
+ 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, // rgba_1[4];. hal
+ 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // f4 tmpvar_2;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, // mpvar_2 = half4(
+ 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // s_texColor.sampl
+ 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // e(_mtlsmp_s_texC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x29, 0x28, 0x5f, // olor, (float3)(_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // mtl_i.v_texcoord
+ 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, // 0.xyz)));. int
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_3;. tmpv
+ 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x5f, 0x6d, 0x74, // ar_3 = int(((_mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // l_i.v_texcoord0.
+ 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, // w * 4.0) + 0.5))
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, // ;. rgba_1[0] =
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, // tmpvar_2.z;. rg
+ 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ba_1[1] = tmpvar
+ 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, // _2.y;. rgba_1[2
+ 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, // ] = tmpvar_2.x;.
+ 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[3] = tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // pvar_2.w;. half
+ 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_4;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, // pvar_4.xyz = hal
+ 0x66, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // f3(_mtl_i.v_colo
+ 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // r0.xyz);. tmpva
+ 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, // r_4.w = ((half)(
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // _mtl_i.v_color0.
+ 0x77, 0x20, 0x2a, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x72, 0x67, 0x62, 0x61, 0x5f, // w * (float)rgba_
+ 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x29, 0x29, 0x3b, 0x0a, 0x20, // 1[tmpvar_3]));.
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // _mtl_o.gl_FragC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, // olor = tmpvar_4;
+ 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // . return _mtl_o
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}...
};
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_basic.sc b/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
index ca905e9d17e..7b4b6636fde 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
+++ b/3rdparty/bgfx/examples/common/font/fs_font_basic.sc
@@ -2,11 +2,11 @@ $input v_color0, v_texcoord0
#include "../../common/common.sh"
-SAMPLERCUBE(u_texColor, 0);
+SAMPLERCUBE(s_texColor, 0);
void main()
{
- vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
+ vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
int index = int(v_texcoord0.w*4.0 + 0.5);
float rgba[4];
rgba[0] = color.z;
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
index c4703df6c4e..030ec333753 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h
@@ -1,19 +1,19 @@
static const uint8_t fs_font_distance_field_glsl[1019] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xdb, 0x03, 0x00, 0x00, 0x76, // Color..........v
0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif
0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // orm lowp sampler
- 0x43, 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube u_texColor;
+ 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube s_texColor;
0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.
0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, // lowp float rgb
0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // a_1[4];. lowp v
0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;.
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu
- 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol
+ 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (s_texCol
0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0.
0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);. highp in
0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;. tm
@@ -65,121 +65,220 @@ static const uint8_t fs_font_distance_field_glsl[1019] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_9;.}...
};
-static const uint8_t fs_font_distance_field_dx9[737] =
+static const uint8_t fs_font_distance_field_dx9[754] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x03, 0xff, 0xff, // FSH.............
- 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, // ..".CTAB....S...
- 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
- 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // L...0...........
- 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // <.......u_texCol
- 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // or..............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // .......@...?....
- 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, // ...?Q...........
- 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, // ..........@.Q...
- 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xc0, // .......A...?....
- 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, // ..@@............
- 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, // ................
- 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, // ..........U.....
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, // ........X.......
- 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, // ..U.............
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, // ..........U.X...
- 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, // ................
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U.
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, // ................
- 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, // X...............
- 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, // ....B...........
- 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x90, 0x91, // ................
- 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, // ......U.........
- 0x00, 0x00, 0x55, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, // ..U.[...........
- 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, // ................
- 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, // ................
- 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, // ..U.............
- 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, // ..U.......U.....
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, // ......U.......U.
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, 0x03, // ..........U.....
- 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, // ......U.........
- 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, 0xa0, // ................
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, // ..............U.
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, // ................
- 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................
- 0x00, // .
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x02, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
+ 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
+ 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
+ 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
+ 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
+ 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, // ...........@.Q..
+ 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........A...?...
+ 0xc0, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, // ...@@...........
+ 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, // ...........U....
+ 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, // .........X......
+ 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, // ...U............
+ 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, // ...........U.X..
+ 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, // ................
+ 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, // .X..............
+ 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, // .....B..........
+ 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xc6, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x01, 0x00, 0x90, // ................
+ 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x07, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // .......U........
+ 0x80, 0x00, 0x00, 0x55, 0x80, 0x5b, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, // ...U.[..........
+ 0x90, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x06, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, // ...U............
+ 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, // ...U.......U....
+ 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, // .......U.......U
+ 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xaa, 0x81, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0x00, // ...........U....
+ 0x03, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, // .......U........
+ 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0xff, // ................
+ 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, // ................
+ 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
+ 0x00, 0x00, // ..
};
-static const uint8_t fs_font_distance_field_dx11[1036] =
+static const uint8_t fs_font_distance_field_dx11[1053] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xfc, 0x03, 0x44, 0x58, 0x42, 0x43, // FSH.........DXBC
- 0x9a, 0xd6, 0x47, 0xb1, 0x98, 0xc8, 0x0f, 0x79, 0xab, 0x0a, 0x57, 0x47, 0xee, 0xac, 0xc0, 0xfe, // ..G....y..WG....
- 0x01, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
- 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
- 0x53, 0x48, 0x44, 0x52, 0x20, 0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, // SHDR ...@.......
- 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, // Z....`......X0..
- 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b...
- 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........b.......
- 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, // h.......i.......
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // ........E.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, // .....`......6...
- 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // .0 .........*...
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6....0 .....
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, // ............6...
- 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // .0 .............
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6....0 .....
- 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, // ....:.......2...
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........:.......
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // .@.....@.@.....?
- 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...........
- 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // .0 .............
- 0x36, 0x00, 0x00, 0x06, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, // 6...............
- 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, // A...............
- 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, // ....V...........
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "...............
- 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, // ............r...
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, // ....F...........
- 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // B.......F.......
- 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x62, 0x00, 0x10, 0x00, // F.......K...b...
- 0x00, 0x00, 0x00, 0x00, 0x56, 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, // ....V...........
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "...............
- 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, // *.......2...B...
- 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A.......
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // .@.....A.@.....?
- 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 2..."...........
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, // .....@.....A.@..
- 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?....2.......
- 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, // ....A.......F...
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........".......
- 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .@.....?...?...?
- 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, // ...?........8 ..
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, // ........2..."...
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .............@..
- 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, 0x07, // .....@....@@8...
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........8.......
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8.... ......
- 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........:.......
- 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, // 6...r ......F...
- 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ....>.......
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xfc, 0x03, 0x44, 0x58, 0x42, // Color0.......DXB
+ 0x43, 0x9a, 0xd6, 0x47, 0xb1, 0x98, 0xc8, 0x0f, 0x79, 0xab, 0x0a, 0x57, 0x47, 0xee, 0xac, 0xc0, // C..G....y..WG...
+ 0xfe, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .............,..
+ 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, // .........ISGNl..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........b......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
+ 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, // OR.TEXCOORD..OSG
+ 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... ..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET..
+ 0xab, 0x53, 0x48, 0x44, 0x52, 0x20, 0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, // .SHDR ...@......
+ 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, // .Z....`......X0.
+ 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, // ..p......UU..b..
+ 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, // .........b......
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // .h.......i......
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .........E......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, // .....F.......F~.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // ......`......6..
+ 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // ..0 .........*..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, // .....6....0 ....
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .............6..
+ 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // ..0 ............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06, 0x12, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, // .....6....0 ....
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....:.......2..
+ 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, // .........:......
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // ..@.....@.@.....
+ 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // ?...............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6..........
+ 0x00, 0x0a, 0x30, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ..0 ............
+ 0x00, 0x36, 0x00, 0x00, 0x06, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, // .6..............
+ 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, // .A..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .....V..........
+ 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, // ."..............
+ 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, // .............r..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .....F..........
+ 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, // .B.......F......
+ 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x62, 0x00, 0x10, // .F.......K...b..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....V..........
+ 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ."..............
+ 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, // .*.......2...B..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........A......
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // ..@.....A.@.....
+ 0x3f, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // ?2..."..........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, // ......@.....A.@.
+ 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ....?....2......
+ 0x00, 0xa6, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, // .....A.......F..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ........."......
+ 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, // ..@.....?...?...
+ 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, // ?...?........8 .
+ 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, // .........2..."..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, // ..............@.
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x38, 0x00, 0x00, // ......@....@@8..
+ 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, // .........8......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....8.... .....
+ 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // .........:......
+ 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, // .6...r ......F..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .....>.......
+};
+static const uint8_t fs_font_distance_field_mtl[1492] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xc5, 0x05, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x74, // r0;. float4 v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // excoord0;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // rOutput {. half
+ 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // 4 gl_FragColor;.
+ 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // };.struct xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, // lShaderUniform {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, // ffer(0)]]. ,
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, // texturecube<floa
+ 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, // t> s_texColor [[
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, // texture(0)]], sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, // mpler _mtlsmp_s_
+ 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, // texColor [[sampl
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, // _mtl_o;. half
+ 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, // rgba_1[4];. hal
+ 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // f4 tmpvar_2;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, // mpvar_2 = half4(
+ 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // s_texColor.sampl
+ 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // e(_mtlsmp_s_texC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x29, 0x28, 0x5f, // olor, (float3)(_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // mtl_i.v_texcoord
+ 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, // 0.xyz)));. int
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_3;. tmpv
+ 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x5f, 0x6d, 0x74, // ar_3 = int(((_mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // l_i.v_texcoord0.
+ 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, // w * 4.0) + 0.5))
+ 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, // ;. rgba_1[0] =
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, // tmpvar_2.z;. rg
+ 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ba_1[1] = tmpvar
+ 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, // _2.y;. rgba_1[2
+ 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, // ] = tmpvar_2.x;.
+ 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[3] = tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // pvar_2.w;. floa
+ 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, // t3 tmpvar_4;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x64, 0x66, 0x64, 0x78, 0x28, 0x5f, // mpvar_4 = dfdx(_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // mtl_i.v_texcoord
+ 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // 0.xyz);. float3
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_5;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x64, 0x66, 0x64, 0x79, 0x28, 0x5f, 0x6d, 0x74, // var_5 = dfdy(_mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // l_i.v_texcoord0.
+ 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, // xyz);. float tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_6;. tmpvar
+ 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, // _6 = (8.0 * (sqr
+ 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // t(. dot (tmpv
+ 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x0a, // ar_4, tmpvar_4).
+ 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, // ) + sqrt(.
+ 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, 0x20, 0x74, // dot (tmpvar_5, t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, // mpvar_5). )));.
+ 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x3b, // float edge0_7;
+ 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, // . edge0_7 = (0.
+ 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, // 5 - tmpvar_6);.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x31, 0x5f, 0x38, 0x3b, 0x0a, // float edge1_8;.
+ 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x31, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, // edge1_8 = (0.5
+ 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, // + tmpvar_6);.
+ 0x68, 0x61, 0x6c, 0x66, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, // half tmpvar_9;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, // tmpvar_9 = clam
+ 0x70, 0x20, 0x28, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, // p (((half)((floa
+ 0x74, 0x29, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // t)((half)((float
+ 0x29, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // )rgba_1[tmpvar_3
+ 0x5d, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x29, 0x20, 0x2f, 0x20, // ] - edge0_7)) /
+ 0x28, 0x65, 0x64, 0x67, 0x65, 0x31, 0x5f, 0x38, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // (edge1_8 - edge0
+ 0x5f, 0x37, 0x29, 0x29, 0x29, 0x2c, 0x20, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x30, 0x2e, 0x30, // _7))), (half)0.0
+ 0x2c, 0x20, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // , (half)1.0);.
+ 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, // half4 tmpvar_10;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x7a, // . tmpvar_10.xyz
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, // = half3(_mtl_i.
+ 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, // v_color0.xyz);.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, // tmpvar_10.w = (
+ 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // (half)(_mtl_i.v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, // color0.w * (floa
+ 0x74, 0x29, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x28, 0x74, // t)(tmpvar_9 * (t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, // mpvar_9 * . (
+ 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x68, 0x61, // (half)3.0 - ((ha
+ 0x6c, 0x66, 0x29, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lf)2.0 * tmpvar_
+ 0x39, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // 9)). ))));. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // tl_o.gl_FragColo
+ 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, // r = tmpvar_10;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
};
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.sc b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.sc
index e039f14622d..3d09ee07f21 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.sc
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.sc
@@ -2,11 +2,11 @@ $input v_color0, v_texcoord0
#include "../../common/common.sh"
-SAMPLERCUBE(u_texColor, 0);
+SAMPLERCUBE(s_texColor, 0);
void main()
{
- vec4 color = textureCube(u_texColor, v_texcoord0.xyz);
+ vec4 color = textureCube(s_texColor, v_texcoord0.xyz);
int index = int(v_texcoord0.w*4.0 + 0.5);
float rgba[4];
rgba[0] = color.z;
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
index 35391955c10..46bdf5ab710 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h
@@ -1,13 +1,13 @@
static const uint8_t fs_font_distance_field_subpixel_glsl[1268] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x76, // Color..........v
0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif
0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // orm lowp sampler
- 0x43, 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube u_texColor;
+ 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube s_texColor;
0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.
0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp int tmpv
0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
@@ -27,14 +27,14 @@ static const uint8_t fs_font_distance_field_subpixel_glsl[1268] =
0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // var_2);. lowp f
0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // loat tmpvar_5;.
0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // tmpvar_5 = text
- 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // ureCube (u_texCo
+ 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // ureCube (s_texCo
0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // lor, (v_texcoord
0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // 0.xyz - tmpvar_4
0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // )).zyxw[tmpvar_1
0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ];. lowp float
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_6;. tmpv
0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, // ar_6 = textureCu
- 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, // be (u_texColor,
+ 0x62, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, // be (s_texColor,
0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // (v_texcoord0.xyz
0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, // + tmpvar_4)).zy
0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // xw[tmpvar_1];.
@@ -81,146 +81,273 @@ static const uint8_t fs_font_distance_field_subpixel_glsl[1268] =
0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, // * v_color0.w);.
0x7d, 0x0a, 0x0a, 0x00, // }...
};
-static const uint8_t fs_font_distance_field_subpixel_dx9[885] =
+static const uint8_t fs_font_distance_field_subpixel_dx9[902] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x68, 0x03, 0x00, 0x03, 0xff, 0xff, // FSH.......h.....
- 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, // ..".CTAB....S...
- 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
- 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // L...0...........
- 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // <.......u_texCol
- 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // or..............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // .......@...?....
- 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x80, // ...?Q...........
- 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, 0x05, // ..........@.Q...
- 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@@....
- 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xc1, 0xaa, 0x2a, 0x3e, // ....Q.........*>
- 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, // ...A...?........
- 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, // ................
- 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, 0xa0, // ................
- 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, // ..U.............
- 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, 0xa0, // X.........U.....
- 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ..U.X...........
- 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ......U.........
- 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, // ........X.......
- 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x5b, 0x00, 0x00, 0x02, // ............[...
- 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, // ................
- 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xe4, 0x90, 0x42, 0x00, 0x00, 0x03, // ............B...
- 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, // ................
- 0x02, 0x00, 0x01, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, // ................
- 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xe4, 0x90, // ................
- 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, // ................
- 0x07, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, // ................
- 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, // ........B.......
- 0x03, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, // ................
- 0x03, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, // ......U.........
- 0x01, 0x00, 0xe4, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, // ................
- 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa1, 0x03, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, 0x04, // ......U.........
- 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, 0xa0, // ..........U.....
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0x00, 0x80, // ..........U.....
- 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x90, 0x80, // ..........U.....
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x02, 0x00, 0x55, 0x80, 0x00, 0x00, 0xff, 0x90, // ..........U.....
- 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x04, 0x00, 0x00, 0x04, // ................
- 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, // ..............U.
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, // ................
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xff, 0x90, // ................
- 0xff, 0xff, 0x00, 0x00, 0x00, // .....
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x68, 0x03, 0x00, 0x03, 0xff, // Color0.....h....
+ 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
+ 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
+ 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
+ 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, // ........@...?...
+ 0x00, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, // ....?Q..........
+ 0x80, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0xc0, 0x51, 0x00, 0x00, // ...........@.Q..
+ 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, // ...........@@...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, 0x0f, 0xa0, 0xc1, 0xaa, 0x2a, // .....Q.........*
+ 0x3e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // >...A...?.......
+ 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
+ 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0xff, 0x90, 0x00, 0x00, 0x00, // ................
+ 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ...U............
+ 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xaa, // .X.........U....
+ 0xa0, 0x00, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x00, 0x00, 0x55, 0x81, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ...U.X..........
+ 0x80, 0x00, 0x00, 0xaa, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // .......U........
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, // .........X......
+ 0x80, 0x00, 0x00, 0xe4, 0x8c, 0x00, 0x00, 0xff, 0xa0, 0x00, 0x00, 0xaa, 0xa0, 0x5b, 0x00, 0x00, // .............[..
+ 0x02, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, // ................
+ 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa1, 0x01, 0x00, 0xe4, 0x90, 0x42, 0x00, 0x00, // .............B..
+ 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, // ................
+ 0x03, 0x02, 0x00, 0x01, 0x80, 0x02, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, // ................
+ 0x04, 0x03, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xe4, // ................
+ 0x90, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0x80, 0x07, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, // ................
+ 0x02, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, // .........B......
+ 0x80, 0x03, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, // ................
+ 0x80, 0x03, 0x00, 0xc6, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x02, 0x00, 0xaa, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, // .......U........
+ 0x80, 0x01, 0x00, 0xe4, 0x91, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, // ................
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa1, 0x03, 0x00, 0xaa, 0xa0, 0x04, 0x00, 0x00, // .......U........
+ 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xaa, // ...........U....
+ 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0x00, // ...........U....
+ 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0e, 0x80, 0x00, 0x00, 0x55, 0x81, 0x02, 0x00, 0x90, // ...........U....
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x02, 0x00, 0x55, 0x80, 0x00, 0x00, 0xff, // ...........U....
+ 0x90, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0x80, 0x04, 0x00, 0x00, // ................
+ 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, // ...............U
+ 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xff, // ................
+ 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
-static const uint8_t fs_font_distance_field_subpixel_dx11[1288] =
+static const uint8_t fs_font_distance_field_subpixel_dx11[1305] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xf8, 0x04, 0x44, 0x58, 0x42, 0x43, // FSH.........DXBC
- 0x72, 0x17, 0x00, 0xad, 0x3a, 0xed, 0x4a, 0x16, 0x14, 0x58, 0xdb, 0x06, 0xdf, 0x01, 0x0f, 0x39, // r...:.J..X.....9
- 0x01, 0x00, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
- 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
- 0x53, 0x48, 0x44, 0x52, 0x1c, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, // SHDR....@.......
- 0x35, 0x18, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, // 5..........?....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // ...............?
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?............
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // .......?Z....`..
- 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X0...p......
- 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x82, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b...........
- 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...........e...
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, // . ......h.......
- 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, // 2...........:...
- 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, 0x00, // .....@.....@.@..
- 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?............
- 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0d, // ............2...
- 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // r...........A...
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, // .....@....*>..*>
- 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ..*>....F.......
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // E...........F...
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`..
- 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................
- 0x66, 0x0c, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, // f.......F.......
- 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....2...r.......
- 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, // .........@....*>
- 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, // ..*>..*>....F...
- 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........".......
- 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // E...........F...
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`..
- 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........B.......
- 0x66, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, 0x00, // f.......F.......
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // *...............
- 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8..."...........
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x00, 0x00, 0x06, // .....@.....?6...
- 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A...
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....K...2.......
- 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // F...............
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2...".......
- 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // ....A........@..
- 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, 0x09, // ...A.@.....?2...
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, // .@.....A.@.....?
- 0x00, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, // ................
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // A...............
- 0x00, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, // ............V...
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // A...............
- 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8.... ..........
- 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, // ....:...........
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .........@.....?
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x0a, 0x00, 0x10, 0x00, // ...?...?...?....
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8 ..r.......
- 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // 2...r.......F...
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, // .....@..........
- 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, // .........@....@@
- 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ..@@..@@....8...
- 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r.......F.......
- 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // F.......8...r...
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....F.......F...
- 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8...r ......
- 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // F...............
- 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >.......
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xf8, 0x04, 0x44, 0x58, 0x42, // Color0.......DXB
+ 0x43, 0x72, 0x17, 0x00, 0xad, 0x3a, 0xed, 0x4a, 0x16, 0x14, 0x58, 0xdb, 0x06, 0xdf, 0x01, 0x0f, // Cr...:.J..X.....
+ 0x39, 0x01, 0x00, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // 9............,..
+ 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, // .........ISGNl..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........b......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
+ 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, // OR.TEXCOORD..OSG
+ 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... ..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET..
+ 0xab, 0x53, 0x48, 0x44, 0x52, 0x1c, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, // .SHDR....@......
+ 0x00, 0x35, 0x18, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, // .5..........?...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, // ................
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ?...............
+ 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....?...........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, // ........?Z....`.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, // .....X0...p.....
+ 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x82, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // .UU..b..........
+ 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, // .b...........e..
+ 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, // .. ......h......
+ 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, // .2...........:..
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x01, 0x40, 0x00, // ......@.....@.@.
+ 0x00, 0x00, 0x00, 0x00, 0x3f, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ....?...........
+ 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x05, 0xe2, 0x00, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .............2..
+ 0x0d, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x80, 0x41, 0x00, 0x00, // .r...........A..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, // ......@....*>..*
+ 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x02, 0x00, 0x00, // >..*>....F......
+ 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .E...........F..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, // .....F~.......`.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // ................
+ 0x00, 0x66, 0x0c, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, // .f.......F......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, // .....2...r......
+ 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xc1, 0xaa, 0x2a, // ..........@....*
+ 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0xc1, 0xaa, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, // >..*>..*>....F..
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ........."......
+ 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .E...........F..
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, // .....F~.......`.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .........B......
+ 0x00, 0x66, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, 0x00, 0x0a, 0x00, 0x10, // .f.......F......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .*..............
+ 0x00, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .8..."..........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x00, 0x00, // ......@.....?6..
+ 0x06, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x80, 0x41, 0x00, 0x00, // .............A..
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....K...2......
+ 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, // .F..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....2..."......
+ 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, // .....A........@.
+ 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x32, 0x00, 0x00, // ....A.@.....?2..
+ 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // ..@.....A.@.....
+ 0x3f, 0x00, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // ?...............
+ 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .A..............
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, // .............V..
+ 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, // .A..............
+ 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // .8.... .........
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, // .....:..........
+ 0x0a, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, // ..........@.....
+ 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x0a, 0x00, 0x10, // ?...?...?...?...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....8 ..r......
+ 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x32, 0x00, 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .2...r.......F..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, // ......@.........
+ 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, // ..........@....@
+ 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // @..@@..@@....8..
+ 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, // .r.......F......
+ 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, // .F.......8...r..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, // .....F.......F..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....8...r .....
+ 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00, 0x01, 0x00, 0x00, // .F..............
+ 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .>.......
+};
+static const uint8_t fs_font_distance_field_subpixel_mtl[1945] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x8a, 0x07, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x74, // r0;. float4 v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // excoord0;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // rOutput {. half
+ 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // 4 gl_FragColor;.
+ 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // };.struct xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, // lShaderUniform {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, // ffer(0)]]. ,
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, // texturecube<floa
+ 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, // t> s_texColor [[
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, // texture(0)]], sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, // mpler _mtlsmp_s_
+ 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, // texColor [[sampl
+ 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, // er(0)]]).{. xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, // _mtl_o;. int t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // r_1 = int(((_mtl
+ 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, // _i.v_texcoord0.w
+ 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, // * 4.0) + 0.5));
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // . float3 tmpvar
+ 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, // _2;. tmpvar_2 =
+ 0x20, 0x64, 0x66, 0x64, 0x78, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, // dfdx(_mtl_i.v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, // excoord0.xyz);.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // float3 tmpvar_3
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x64, // ;. tmpvar_3 = d
+ 0x66, 0x64, 0x79, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // fdy(_mtl_i.v_tex
+ 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, // coord0.xyz);. f
+ 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, // loat3 tmpvar_4;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, // tmpvar_4 = (0.
+ 0x31, 0x36, 0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 166667 * tmpvar_
+ 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, // 2);. float3 tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_5;. tmpvar_
+ 0x35, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, // 5 = (_mtl_i.v_te
+ 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, // xcoord0.xyz - tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // pvar_4);. float
+ 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 3 tmpvar_6;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // pvar_6 = (_mtl_i
+ 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // .v_texcoord0.xyz
+ 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x3b, 0x0a, 0x20, 0x20, // + tmpvar_4);.
+ 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, // half4 tmpvar_7;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, // tmpvar_7 = hal
+ 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, // f4(s_texColor.sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, // mple(_mtlsmp_s_t
+ 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // exColor, (float3
+ 0x29, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, // )(tmpvar_5)));.
+ 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, // half tmpvar_8;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, // tmpvar_8 = ((h
+ 0x61, 0x6c, 0x66, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x7a, 0x79, 0x78, // alf)tmpvar_7.zyx
+ 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // w[tmpvar_1]);.
+ 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, // half4 tmpvar_9;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, // tmpvar_9 = hal
+ 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, // f4(s_texColor.sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, // mple(_mtlsmp_s_t
+ 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // exColor, (float3
+ 0x29, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, // )(tmpvar_6)));.
+ 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, // half tmpvar_10;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, // . tmpvar_10 = (
+ 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, // (half)tmpvar_9.z
+ 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x29, 0x3b, 0x0a, // yxw[tmpvar_1]);.
+ 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, // half tmpvar_11
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, // ;. tmpvar_11 =
+ 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, // ((half)0.5 * (tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // pvar_8 + tmpvar_
+ 0x31, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, // 10));. float tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // pvar_12;. tmpva
+ 0x72, 0x5f, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, // r_12 = (8.0 * (s
+ 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, // qrt(. dot (tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // pvar_2, tmpvar_2
+ 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // ). ) + sqrt(.
+ 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, // dot (tmpvar_3,
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, // tmpvar_3). )))
+ 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. half3 tmpvar
+ 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, // _13;. tmpvar_13
+ 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, // .x = tmpvar_8;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, // tmpvar_13.y = t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // mpvar_11;. tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ar_13.z = tmpvar
+ 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, // _10;. float edg
+ 0x65, 0x30, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, // e0_14;. edge0_1
+ 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 4 = (0.5 - tmpva
+ 0x72, 0x5f, 0x31, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, // r_12);. float e
+ 0x64, 0x67, 0x65, 0x31, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x31, // dge1_15;. edge1
+ 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, // _15 = (0.5 + tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, // var_12);. half3
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // tmpvar_16;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, // pvar_16 = clamp
+ 0x28, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // (((half3)((float
+ 0x33, 0x29, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, // 3)((half3)((floa
+ 0x74, 0x33, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2d, 0x20, 0x65, // t3)tmpvar_13 - e
+ 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x34, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x65, 0x64, 0x67, // dge0_14)) / (edg
+ 0x65, 0x31, 0x5f, 0x31, 0x35, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x34, // e1_15 - edge0_14
+ 0x29, 0x29, 0x29, 0x2c, 0x20, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x30, 0x2e, 0x30, 0x2c, 0x20, // ))), (half)0.0,
+ 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // (half)1.0);. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // tl_o.gl_FragColo
+ 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x29, // r.xyz = ((half3)
+ 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x29, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ((float3)(tmpvar
+ 0x5f, 0x31, 0x36, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, // _16 * (tmpvar_16
+ 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x33, // * . ((half)3
+ 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x32, 0x2e, 0x30, 0x20, // .0 - ((half)2.0
+ 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x29, 0x29, 0x0a, 0x20, 0x20, // * tmpvar_16)).
+ 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // )) * _mtl_i.v_co
+ 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // lor0.w));. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, // _o.gl_FragColor.
+ 0x77, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, // w = ((half)((flo
+ 0x61, 0x74, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x5f, // at)tmpvar_11 * _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, // mtl_i.v_color0.w
+ 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, // ));. return _mt
+ 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // l_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.sc b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.sc
index 33416f30a19..b817b7979c6 100644
--- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.sc
+++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.sc
@@ -2,7 +2,7 @@ $input v_color0, v_texcoord0
#include "../../common/common.sh"
-SAMPLERCUBE(u_texColor, 0);
+SAMPLERCUBE(s_texColor, 0);
void main()
{
@@ -13,8 +13,8 @@ void main()
vec3 sampleLeft = v_texcoord0.xyz - decal;
vec3 sampleRight = v_texcoord0.xyz + decal;
- float left_dist = textureCube(u_texColor, sampleLeft).zyxw[index];
- float right_dist = textureCube(u_texColor, sampleRight).zyxw[index];
+ float left_dist = textureCube(s_texColor, sampleLeft).zyxw[index];
+ float right_dist = textureCube(s_texColor, sampleRight).zyxw[index];
float dist = 0.5 * (left_dist + right_dist);
diff --git a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
index f3dd51342db..540a0ea3869 100644
--- a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
@@ -5,7 +5,7 @@
#include "../common.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <stddef.h> // offsetof
#include <memory.h> // memcpy
#include <wchar.h> // wcslen
@@ -329,6 +329,15 @@ void TextBuffer::clearTextBuffer()
void TextBuffer::appendGlyph(FontHandle _handle, CodePoint _codePoint)
{
+ if (_codePoint == L'\t')
+ {
+ for (uint32_t ii = 0; ii < 4; ++ii)
+ {
+ appendGlyph(_handle, L' ');
+ }
+ return;
+ }
+
const GlyphInfo* glyph = m_fontManager->getGlyphInfo(_handle, _codePoint);
BX_WARN(NULL != glyph, "Glyph not found (font handle %d, code point %d)", _handle.idx, _codePoint);
if (NULL == glyph)
@@ -336,27 +345,27 @@ void TextBuffer::appendGlyph(FontHandle _handle, CodePoint _codePoint)
return;
}
- const FontInfo& font = m_fontManager->getFontInfo(_handle);
-
if( m_vertexCount/4 >= MAX_BUFFERED_CHARACTERS)
{
return;
}
+ const FontInfo& font = m_fontManager->getFontInfo(_handle);
+
if (_codePoint == L'\n')
{
m_penX = m_originX;
m_penY += m_lineGap + m_lineAscender -m_lineDescender;
m_lineGap = font.lineGap;
- m_lineDescender = font.descender;
- m_lineAscender = font.ascender;
+ m_lineDescender = font.descender;
+ m_lineAscender = font.ascender;
m_lineStartIndex = m_vertexCount;
return;
}
//is there a change of font size that require the text on the left to be centered again ?
if (font.ascender > m_lineAscender
- || (font.descender < m_lineDescender) )
+ || (font.descender < m_lineDescender) )
{
if (font.descender < m_lineDescender)
{
@@ -377,7 +386,7 @@ void TextBuffer::appendGlyph(FontHandle _handle, CodePoint _codePoint)
const Atlas* atlas = m_fontManager->getAtlas();
if (m_styleFlags & STYLE_BACKGROUND
- && m_backgroundColor & 0xFF000000)
+ && m_backgroundColor & 0xff000000)
{
float x0 = (m_penX - kerning);
float y0 = (m_penY);
@@ -584,6 +593,15 @@ TextBufferManager::TextBufferManager(FontManager* _fontManager)
fs_font_distance_field_subpixel = bgfx::makeRef(fs_font_distance_field_subpixel_dx11, sizeof(fs_font_distance_field_subpixel_dx11) );
break;
+ case bgfx::RendererType::Metal:
+ vs_font_basic = bgfx::makeRef(vs_font_basic_mtl, sizeof(vs_font_basic_mtl) );
+ fs_font_basic = bgfx::makeRef(fs_font_basic_mtl, sizeof(fs_font_basic_mtl) );
+ vs_font_distance_field = bgfx::makeRef(vs_font_distance_field_mtl, sizeof(vs_font_distance_field_mtl) );
+ fs_font_distance_field = bgfx::makeRef(fs_font_distance_field_mtl, sizeof(fs_font_distance_field_mtl) );
+ vs_font_distance_field_subpixel = bgfx::makeRef(vs_font_distance_field_subpixel_mtl, sizeof(vs_font_distance_field_subpixel_mtl) );
+ fs_font_distance_field_subpixel = bgfx::makeRef(fs_font_distance_field_subpixel_mtl, sizeof(fs_font_distance_field_subpixel_mtl) );
+ break;
+
default:
vs_font_basic = bgfx::makeRef(vs_font_basic_glsl, sizeof(vs_font_basic_glsl) );
fs_font_basic = bgfx::makeRef(fs_font_basic_glsl, sizeof(fs_font_basic_glsl) );
@@ -619,7 +637,7 @@ TextBufferManager::TextBufferManager(FontManager* _fontManager)
.add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
.end();
- u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
}
TextBufferManager::~TextBufferManager()
@@ -627,7 +645,7 @@ TextBufferManager::~TextBufferManager()
BX_CHECK(m_textBufferHandles.getNumHandles() == 0, "All the text buffers must be destroyed before destroying the manager");
delete [] m_textBuffers;
- bgfx::destroyUniform(u_texColor);
+ bgfx::destroyUniform(s_texColor);
bgfx::destroyProgram(m_basicProgram);
bgfx::destroyProgram(m_distanceProgram);
@@ -706,12 +724,13 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
return;
}
- bgfx::setTexture(0, u_texColor, m_fontManager->getAtlas()->getTextureHandle() );
+ bgfx::setTexture(0, s_texColor, m_fontManager->getAtlas()->getTextureHandle() );
+ bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;
switch (bc.fontType)
{
case FONT_TYPE_ALPHA:
- bgfx::setProgram(m_basicProgram);
+ program = m_basicProgram;
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
@@ -719,7 +738,7 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
break;
case FONT_TYPE_DISTANCE:
- bgfx::setProgram(m_distanceProgram);
+ program = m_distanceProgram;
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
@@ -727,7 +746,7 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
break;
case FONT_TYPE_DISTANCE_SUBPIXEL:
- bgfx::setProgram(m_distanceSubpixelProgram);
+ program = m_distanceSubpixelProgram;
bgfx::setState(0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_INV_SRC_COLOR)
@@ -764,7 +783,7 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
}
bgfx::setVertexBuffer(vbh, 0, bc.textBuffer->getVertexCount() );
- bgfx::setIndexBuffer(ibh, bc.textBuffer->getIndexCount() );
+ bgfx::setIndexBuffer(ibh, 0, bc.textBuffer->getIndexCount() );
}
break;
@@ -793,10 +812,12 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
vbh.idx = bc.vertexBufferHandleIdx;
bgfx::updateDynamicIndexBuffer(ibh
+ , 0
, bgfx::copy(bc.textBuffer->getIndexBuffer(), indexSize)
);
bgfx::updateDynamicVertexBuffer(vbh
+ , 0
, bgfx::copy(bc.textBuffer->getVertexBuffer(), vertexSize)
);
}
@@ -820,7 +841,7 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, uint8_t _id,
break;
}
- bgfx::submit(_id, _depth);
+ bgfx::submit(_id, program, _depth);
}
void TextBufferManager::setStyle(TextBufferHandle _handle, uint32_t _flags)
diff --git a/3rdparty/bgfx/examples/common/font/text_buffer_manager.h b/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
index 6a9ce84b865..bdffe7b035c 100644
--- a/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
+++ b/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
@@ -88,7 +88,7 @@ private:
bx::HandleAllocT<MAX_TEXT_BUFFER_COUNT> m_textBufferHandles;
FontManager* m_fontManager;
bgfx::VertexDecl m_vertexDecl;
- bgfx::UniformHandle u_texColor;
+ bgfx::UniformHandle s_texColor;
bgfx::ProgramHandle m_basicProgram;
bgfx::ProgramHandle m_distanceProgram;
bgfx::ProgramHandle m_distanceSubpixelProgram;
diff --git a/3rdparty/bgfx/examples/common/font/text_metrics.cpp b/3rdparty/bgfx/examples/common/font/text_metrics.cpp
index d48035fb858..677a3585e9c 100644
--- a/3rdparty/bgfx/examples/common/font/text_metrics.cpp
+++ b/3rdparty/bgfx/examples/common/font/text_metrics.cpp
@@ -158,7 +158,7 @@ void TextLineMetrics::getSubText(const char* _string, uint32_t _firstLine, uint3
uint32_t state = 0;
// y is bottom of a text line
uint32_t currentLine = 0;
- while(*_string && (currentLine < _firstLine))
+ while(*_string && (currentLine < _firstLine) )
{
for (; *_string; ++_string)
{
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
index 7ae95c9e2ae..5df95fa7cce 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_basic.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_font_basic_glsl[431] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
@@ -30,8 +30,8 @@ static const uint8_t vs_font_basic_glsl[431] =
};
static const uint8_t vs_font_basic_dx9[335] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -54,8 +54,8 @@ static const uint8_t vs_font_basic_dx9[335] =
};
static const uint8_t vs_font_basic_dx11[580] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x18, 0x02, 0x44, 0x58, 0x42, 0x43, 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, // ..DXBC.].....:HQ
0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, // ...i.f..........
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
@@ -92,3 +92,54 @@ static const uint8_t vs_font_basic_dx11[580] =
0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, // ......>.........
0x10, 0x00, 0x40, 0x00, // ..@.
};
+static const uint8_t vs_font_basic_mtl[764] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, // )]];. float2 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at4 a_texcoord0
+ 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, // [[attribute(2)]]
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // {. float4 gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio
+ 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, // n]];. float4 v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // color0;. float4
+ 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, // v_texcoord0;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, // haderUniform {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // float4x4 u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, // lViewProj;.};.ve
+ 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // rtex xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // erOutput xlatMtl
+ 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // Main (xlatMtlSha
+ 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, // derInput _mtl_i
+ 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, // [[stage_in]], co
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // nstant xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, // aderUniform& _mt
+ 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // l_u [[buffer(0)]
+ 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // ]).{. xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // aderOutput _mtl_
+ 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // o;. float4 tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
+ 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, // .zw = float2(0.0
+ 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);. tmpvar
+ 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, // _1.xy = _mtl_i.a
+ 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // _position;. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // l_o.gl_Position
+ 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // = (_mtl_u.u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, // ar_1);. _mtl_o.
+ 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // v_texcoord0 = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // tl_i.a_texcoord0
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ;. _mtl_o.v_col
+ 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, // or0 = _mtl_i.a_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // olor0;. return
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
index 66358f01777..6fea18b931a 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_distance_field.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_font_distance_field_glsl[431] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
@@ -30,8 +30,8 @@ static const uint8_t vs_font_distance_field_glsl[431] =
};
static const uint8_t vs_font_distance_field_dx9[335] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -54,8 +54,8 @@ static const uint8_t vs_font_distance_field_dx9[335] =
};
static const uint8_t vs_font_distance_field_dx11[580] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x18, 0x02, 0x44, 0x58, 0x42, 0x43, 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, // ..DXBC.].....:HQ
0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, // ...i.f..........
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
@@ -92,3 +92,54 @@ static const uint8_t vs_font_distance_field_dx11[580] =
0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, // ......>.........
0x10, 0x00, 0x40, 0x00, // ..@.
};
+static const uint8_t vs_font_distance_field_mtl[764] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, // )]];. float2 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at4 a_texcoord0
+ 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, // [[attribute(2)]]
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // {. float4 gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio
+ 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, // n]];. float4 v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // color0;. float4
+ 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, // v_texcoord0;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, // haderUniform {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // float4x4 u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, // lViewProj;.};.ve
+ 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // rtex xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // erOutput xlatMtl
+ 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // Main (xlatMtlSha
+ 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, // derInput _mtl_i
+ 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, // [[stage_in]], co
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // nstant xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, // aderUniform& _mt
+ 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // l_u [[buffer(0)]
+ 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // ]).{. xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // aderOutput _mtl_
+ 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // o;. float4 tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
+ 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, // .zw = float2(0.0
+ 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);. tmpvar
+ 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, // _1.xy = _mtl_i.a
+ 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // _position;. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // l_o.gl_Position
+ 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // = (_mtl_u.u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, // ar_1);. _mtl_o.
+ 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // v_texcoord0 = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // tl_i.a_texcoord0
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ;. _mtl_o.v_col
+ 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, // or0 = _mtl_i.a_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // olor0;. return
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h b/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
index 90d9ff1f8a2..bd885e453e3 100644
--- a/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
+++ b/3rdparty/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_font_distance_field_subpixel_glsl[431] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
@@ -30,8 +30,8 @@ static const uint8_t vs_font_distance_field_subpixel_glsl[431] =
};
static const uint8_t vs_font_distance_field_subpixel_dx9[335] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x2c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ,.......#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -54,8 +54,8 @@ static const uint8_t vs_font_distance_field_subpixel_dx9[335] =
};
static const uint8_t vs_font_distance_field_subpixel_dx11[580] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x18, 0x02, 0x44, 0x58, 0x42, 0x43, 0xe3, 0x5d, 0xf0, 0xa8, 0xb3, 0x95, 0xec, 0x3a, 0x48, 0x51, // ..DXBC.].....:HQ
0xb3, 0xab, 0xaf, 0x69, 0xf9, 0x66, 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, // ...i.f..........
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
@@ -92,3 +92,54 @@ static const uint8_t vs_font_distance_field_subpixel_dx11[580] =
0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, // ......>.........
0x10, 0x00, 0x40, 0x00, // ..@.
};
+static const uint8_t vs_font_distance_field_subpixel_mtl[764] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xed, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, // )]];. float2 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at4 a_texcoord0
+ 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, // [[attribute(2)]]
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // {. float4 gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio
+ 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, // n]];. float4 v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // color0;. float4
+ 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, // v_texcoord0;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, // haderUniform {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // float4x4 u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, // lViewProj;.};.ve
+ 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // rtex xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // erOutput xlatMtl
+ 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // Main (xlatMtlSha
+ 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, // derInput _mtl_i
+ 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, // [[stage_in]], co
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // nstant xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, // aderUniform& _mt
+ 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // l_u [[buffer(0)]
+ 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // ]).{. xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // aderOutput _mtl_
+ 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // o;. float4 tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
+ 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, // .zw = float2(0.0
+ 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);. tmpvar
+ 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, // _1.xy = _mtl_i.a
+ 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // _position;. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // l_o.gl_Position
+ 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // = (_mtl_u.u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, // ar_1);. _mtl_o.
+ 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // v_texcoord0 = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // tl_i.a_texcoord0
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ;. _mtl_o.v_col
+ 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, // or0 = _mtl_i.a_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // olor0;. return
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
index b62eefd0550..611a46bc560 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_color.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_imgui_color_glsl[89] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...va
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...va
0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4
0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void
0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // main ().{. gl_F
@@ -9,7 +9,7 @@ static const uint8_t fs_imgui_color_glsl[89] =
};
static const uint8_t fs_imgui_color_dx9[137] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH....I..|.....
0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
@@ -21,7 +21,7 @@ static const uint8_t fs_imgui_color_dx9[137] =
};
static const uint8_t fs_imgui_color_dx11[260] =
{
- 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0xf4, 0x00, 0x44, 0x58, 0x42, 0x43, // FSH....I....DXBC
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0xf4, 0x00, 0x44, 0x58, 0x42, 0x43, // FSH....I....DXBC
0xa6, 0x7f, 0x08, 0xe2, 0x95, 0xbd, 0x5f, 0xa3, 0x3f, 0x5b, 0x58, 0x8e, 0x54, 0x0f, 0x89, 0x67, // ......_.?[X.T..g
0x01, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, // ........ISGNL...
@@ -39,3 +39,32 @@ static const uint8_t fs_imgui_color_dx11[260] =
0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>...
0x00, 0x00, 0x00, 0x00, // ....
};
+static const uint8_t fs_imgui_color_mtl[404] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x75, 0x73, // FSH....I......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // r0;.};.struct xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // t {. float4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // FragColor;.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // erUniform {.};.f
+ 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // tl_o;. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // l_FragColor = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, // tl_i.v_color0;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
index db5b5da4de8..265aef506c1 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_imgui_cubemap_glsl[363] =
{
- 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x46, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x02, 0x01, 0x00, 0x00, // geLodEnabled....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
0x00, 0x01, 0x00, 0x33, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...3...varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ighp vec3 v_norm
@@ -24,60 +24,116 @@ static const uint8_t fs_imgui_cubemap_glsl[363] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_1;.}...
};
-static const uint8_t fs_imgui_cubemap_dx9[373] =
+static const uint8_t fs_imgui_cubemap_dx9[390] =
{
- 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..P.......0.CTAB
- 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // `...........t...
- 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, // ....s_texColor..
- 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
- 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, // d...............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x01, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, // ......L?..L>....
- 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0x90, // ................
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, // ................
- 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, // ...._...........
- 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, // ................
- 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, 0x04, // ..........U.....
- 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, 0xa0, // ......U.......U.
- 0xff, 0xff, 0x00, 0x00, 0x00, // .....
+ 0x46, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH....e...s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
+ 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
+ 0x00, 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...P.......0.CTA
+ 0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
+ 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, // .`...........t..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, // .....s_texColor.
+ 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, // .u_imageLodEnabl
+ 0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x01, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, // .......L?..L>...
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, // ................
+ 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, // ................
+ 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, // ....._..........
+ 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, // ................
+ 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, 0x00, // ...........U....
+ 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x55, // .......U.......U
+ 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ......
};
-static const uint8_t fs_imgui_cubemap_dx11[424] =
+static const uint8_t fs_imgui_cubemap_dx11[441] =
{
- 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x00, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x80, 0x01, 0x44, 0x58, 0x42, 0x43, 0x3a, 0x0c, 0x3f, 0xee, 0x22, 0x31, 0x60, 0x3f, // ....DXBC:.?."1`?
- 0x80, 0x4a, 0x2e, 0x3f, 0xcb, 0x18, 0x1c, 0x94, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, // .J.?............
- 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, // ....,...........
- 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNL...........
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4e, 0x4f, 0x52, 0x4d, // SV_POSITION.NORM
- 0x41, 0x4c, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // AL..OSGN,.......
- 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ...........
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T
- 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xc4, 0x00, 0x00, 0x00, // ARGET...SHDR....
- 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, // @...1...Y...F. .
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, // ........Z....`..
- 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....X0...p......
- 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // UU..b...r.......
- 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h...
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
- 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F~......
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
- 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
- 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .........
- 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, // .@....L?.@....L>
- 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >.......
+ 0x46, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x00, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0..
+ 0x00, 0x01, 0x00, 0x80, 0x01, 0x44, 0x58, 0x42, 0x43, 0x3a, 0x0c, 0x3f, 0xee, 0x22, 0x31, 0x60, // .....DXBC:.?."1`
+ 0x3f, 0x80, 0x4a, 0x2e, 0x3f, 0xcb, 0x18, 0x1c, 0x94, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // ?.J.?...........
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, // .....,..........
+ 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNL..........
+ 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4e, 0x4f, 0x52, // .SV_POSITION.NOR
+ 0x4d, 0x41, 0x4c, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // MAL..OSGN,......
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... ..........
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, // .............SV_
+ 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xc4, 0x00, 0x00, // TARGET...SHDR...
+ 0x00, 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, // .@...1...Y...F.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, // .........Z....`.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, // .....X0...p.....
+ 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // .UU..b...r......
+ 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, // .e.... ......h..
+ 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....H..........
+ 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .F.......F~.....
+ 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // ..`........ ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6...r .....
+ 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, // .F.......2.... .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ..@....L?.@....L
+ 0x3e, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >>.......
+};
+static const uint8_t fs_imgui_cubemap_mtl[812] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x1d, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH....e......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // . float3 v_norm
+ 0x61, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // al;.};.struct xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, // t {. half4 gl_F
+ 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // ragColor;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // rUniform {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, // at4 u_imageLodEn
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, // abled;.};.fragme
+ 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // nt xlatMtlShader
+ 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // Output xlatMtlMa
+ 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // in (xlatMtlShade
+ 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, // rInput _mtl_i [[
+ 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, // stage_in]], cons
+ 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // tant xlatMtlShad
+ 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // erUniform& _mtl_
+ 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, // u [[buffer(0)]].
+ 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x63, 0x75, 0x62, // , texturecub
+ 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // e<float> s_texCo
+ 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, // lor [[texture(0)
+ 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ]], sampler _mtl
+ 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, // smp_s_texColor [
+ 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, // [sampler(0)]]).{
+ 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // . xlatMtlShader
+ 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, // Output _mtl_o;.
+ 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // half4 tmpvar_1;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, // . tmpvar_1 = ha
+ 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, // lf4(s_texColor.s
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, // ample(_mtlsmp_s_
+ 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // texColor, (float
+ 0x33, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // 3)(_mtl_i.v_norm
+ 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // al), level(_mtl_
+ 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // u.u_imageLodEnab
+ 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // led.x)));. floa
+ 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_2;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, // pvar_2 = (0.2 +
+ 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // (0.8 * _mtl_u.u_
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, // imageLodEnabled.
+ 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, // y));. half4 tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_3;. tmpvar_
+ 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 3.xyz = tmpvar_1
+ 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // .xyz;. tmpvar_3
+ 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // .w = half(tmpvar
+ 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, // _2);. _mtl_o.gl
+ 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, // var_3;. return
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
index dd51fc825be..8496e53c794 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_imgui_image_glsl[360] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x02, 0x01, 0x00, 0x00, // geLodEnabled....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...0...varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
@@ -24,60 +24,116 @@ static const uint8_t fs_imgui_image_glsl[360] =
0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar
0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _1;.}...
};
-static const uint8_t fs_imgui_image_dx9[377] =
+static const uint8_t fs_imgui_image_dx9[394] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..T.......0.CTAB
- 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // `...........t...
- 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, // ....s_texColor..
- 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
- 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, // d...............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, // .......?......L?
- 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, // ..L>............
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
- 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0xe4, 0xa0, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, 0x80, // ..........U.....
- 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .........
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
+ 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
+ 0x00, 0x01, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...T.......0.CTA
+ 0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
+ 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, // .`...........t..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, // .....s_texColor.
+ 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, // .u_imageLodEnabl
+ 0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ........?......L
+ 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, // ?..L>...........
+ 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0xe4, // ................
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0xa0, 0x00, 0x00, 0xaa, // ...........U....
+ 0x80, 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ..........
};
-static const uint8_t fs_imgui_image_dx11[428] =
+static const uint8_t fs_imgui_image_dx11[445] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x00, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x84, 0x01, 0x44, 0x58, 0x42, 0x43, 0x60, 0x83, 0xa2, 0x5c, 0x77, 0x3d, 0xcc, 0x9b, // ....DXBC`...w=..
- 0xb9, 0x73, 0xdf, 0x41, 0x6b, 0x18, 0x8f, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, // .s.Ak...........
- 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
- 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC
- 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // OORD....OSGN,...
- 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
- 0xc4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...1...Y...
- 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // F. .........Z...
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X....p..
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
- 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, // h.......H.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, // .....`........ .
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, // ........6...r ..
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // ....F.......2...
- 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // . ........ .....
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, // .....@....L?.@..
- 0xcd, 0xcc, 0x4c, 0x3e, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ..L>>.......
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x00, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0..
+ 0x00, 0x01, 0x00, 0x84, 0x01, 0x44, 0x58, 0x42, 0x43, 0x60, 0x83, 0xa2, 0x5c, 0x77, 0x3d, 0xcc, // .....DXBC`...w=.
+ 0x9b, 0xb9, 0x73, 0xdf, 0x41, 0x6b, 0x18, 0x8f, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, // ..s.Ak..........
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, // .....,..........
+ 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNP..........
+ 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, // .SV_POSITION.TEX
+ 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, // COORD....OSGN,..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, // .SV_TARGET...SHD
+ 0x52, 0xc4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, // R....@...1...Y..
+ 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, // .F. .........Z..
+ 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, // ..`......X....p.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, // .....UU..b...2..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, // .h.......H......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, // .....F.......F~.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, // ......`........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, // .........6...r .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....F.......2..
+ 0x0a, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // .. ........ ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, // ......@....L?.@.
+ 0x00, 0xcd, 0xcc, 0x4c, 0x3e, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // ...L>>.......
+};
+static const uint8_t fs_imgui_image_mtl[816] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x21, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH.o.><..!...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . float2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // oord0;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, // tput {. half4 g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // l_FragColor;.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // float4 u_imageLo
+ 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, // dEnabled;.};.fra
+ 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // gment xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // derOutput xlatMt
+ 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // lMain (xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // aderInput _mtl_i
+ 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c
+ 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // onstant xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, // haderUniform& _m
+ 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, // tl_u [[buffer(0)
+ 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ]]. , texture
+ 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // 2d<float> s_texC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, // olor [[texture(0
+ 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, // )]], sampler _mt
+ 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, // lsmp_s_texColor
+ 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, // [[sampler(0)]]).
+ 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // {. xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // rOutput _mtl_o;.
+ 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // half4 tmpvar_1
+ 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, // ;. tmpvar_1 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, // alf4(s_texColor.
+ 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, // sample(_mtlsmp_s
+ 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, // _texColor, (floa
+ 0x74, 0x32, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // t2)(_mtl_i.v_tex
+ 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x28, 0x5f, // coord0), level(_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, // mtl_u.u_imageLod
+ 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // Enabled.x)));.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // float tmpvar_2;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, // tmpvar_2 = (0.
+ 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // 2 + (0.8 * _mtl_
+ 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // u.u_imageLodEnab
+ 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // led.y));. half4
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_3;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // var_3.xyz = tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // ar_1.xyz;. tmpv
+ 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x28, 0x74, 0x6d, // ar_3.w = half(tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // pvar_2);. _mtl_
+ 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // o.gl_FragColor =
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, // tmpvar_3;. ret
+ 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // urn _mtl_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
index 096e7ff1a26..237bdb1e10c 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h
@@ -1,8 +1,8 @@
static const uint8_t fs_imgui_image_swizz_glsl[425] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, // ...u_swizzle....
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x02, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x02, 0x01, 0x00, 0x00, // ...u_swizzle....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
0x00, 0x01, 0x00, 0x61, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...a...varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
@@ -28,67 +28,127 @@ static const uint8_t fs_imgui_image_swizz_glsl[425] =
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_1;.}...
};
-static const uint8_t fs_imgui_image_swizz_dx9[441] =
+static const uint8_t fs_imgui_image_swizz_dx9[458] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x17, 0x01, 0x01, 0x00, // ...u_swizzle....
- 0x01, 0x00, 0x84, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x38, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........8.CTAB
- 0x1c, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, // ................
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, // ............X...
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........d.......
- 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, // t...............
- 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // ................
- 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // ........s_texCol
- 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // or..............
- 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, // ....u_imageLodEn
- 0x61, 0x62, 0x6c, 0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, // abled...........
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, // ........u_swizzl
- 0x65, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // e.ps_3_0.Microso
- 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad
- 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, // er Compiler 9.29
- 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, // .952.3111...Q...
- 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, // .......?......L?
- 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, // ..L>............
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
- 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x80, // ................
- 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, // ..............U.
- 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, // ................
- 0x00, 0x00, 0x40, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ..@......
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
+ 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
+ 0x00, 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x01, 0x01, // ....u_swizzle...
+ 0x00, 0x01, 0x00, 0x84, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x38, 0x00, 0x43, 0x54, 0x41, // ...........8.CTA
+ 0x42, 0x1c, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00, // B...............
+ 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, // .............X..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........d......
+ 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, // .t..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // ................
+ 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .........s_texCo
+ 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // .....u_imageLodE
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, // nabled..........
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // .........u_swizz
+ 0x6c, 0x65, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // le.ps_3_0.Micros
+ 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha
+ 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, // der Compiler 9.2
+ 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0x51, 0x00, 0x00, // 9.952.3111...Q..
+ 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ........?......L
+ 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, // ?..L>...........
+ 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, // ................
+ 0x03, 0x00, 0x00, 0x07, 0x80, 0x02, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x09, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, // ................
+ 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, // ................
+ 0x80, 0x00, 0x00, 0x40, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ...@......
};
-static const uint8_t fs_imgui_image_swizz_dx11[476] =
+static const uint8_t fs_imgui_image_swizz_dx11[493] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x00, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x17, 0x00, 0x10, 0x00, // ...u_swizzle....
- 0x01, 0x00, 0xa4, 0x01, 0x44, 0x58, 0x42, 0x43, 0x82, 0x53, 0x75, 0xc2, 0x4f, 0x7e, 0x06, 0x0a, // ....DXBC.Su.O~..
- 0x49, 0x27, 0x42, 0x29, 0x01, 0x0a, 0x6a, 0x92, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, // I'B)..j.........
- 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
- 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC
- 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // OORD....OSGN,...
- 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
- 0xe4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // ....@...9...Y...
- 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // F. .........Z...
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X....p..
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
- 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, // h.......H.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, // .....`........ .
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // ....F.......F. .
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, // ........2..."...
- 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .........
- 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, // .@....L?.@....L>
- 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, 0x00, // 6.... ..........
- 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // ....>..... .
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x00, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x12, 0x00, 0x10, 0x00, // ...u_swizzle....
+ 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0..
+ 0x00, 0x01, 0x00, 0xa4, 0x01, 0x44, 0x58, 0x42, 0x43, 0x82, 0x53, 0x75, 0xc2, 0x4f, 0x7e, 0x06, // .....DXBC.Su.O~.
+ 0x0a, 0x49, 0x27, 0x42, 0x29, 0x01, 0x0a, 0x6a, 0x92, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, // .I'B)..j........
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, // .....,..........
+ 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNP..........
+ 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, // .SV_POSITION.TEX
+ 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, // COORD....OSGN,..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, // .SV_TARGET...SHD
+ 0x52, 0xe4, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, // R....@...9...Y..
+ 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, // .F. .........Z..
+ 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, // ..`......X....p.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, // .....UU..b...2..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, // .h.......H......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, // .....F.......F~.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, // ......`........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, // .....F.......F.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, // .........2..."..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ..@....L?.@....L
+ 0x3e, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, // >6.... .........
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, // .....>..... .
+};
+static const uint8_t fs_imgui_image_swizz_mtl[879] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH.o.><..`...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . float2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // oord0;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, // tput {. half4 g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // l_FragColor;.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // float4 u_imageLo
+ 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // dEnabled;. floa
+ 0x74, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, 0x0a, 0x7d, 0x3b, // t4 u_swizzle;.};
+ 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // .fragment xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, // lShaderOutput xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, // atMtlMain (xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // tlShaderInput _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, // tl_i [[stage_in]
+ 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ], constant xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // MtlShaderUniform
+ 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, // & _mtl_u [[buffe
+ 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, // r(0)]]. , tex
+ 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, // ture2d<float> s_
+ 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, // texColor [[textu
+ 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // re(0)]], sampler
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // _mtlsmp_s_texCo
+ 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, // lor [[sampler(0)
+ 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ]]).{. xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // haderOutput _mtl
+ 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // _o;. half4 tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // = half4(s_texCo
+ 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, // lor.sample(_mtls
+ 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, // mp_s_texColor, (
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, // float2)(_mtl_i.v
+ 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, // _texcoord0), lev
+ 0x65, 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // el(_mtl_u.u_imag
+ 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x29, // eLodEnabled.x)))
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. float tmpvar
+ 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, // _2;. tmpvar_2 =
+ 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x5f, // (0.2 + (0.8 * _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, // mtl_u.u_imageLod
+ 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // Enabled.y));. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // alf4 tmpvar_3;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_3.xyz =
+ 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x64, 0x6f, 0x74, // half3(((half)dot
+ 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ((float4)tmpvar
+ 0x5f, 0x31, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x77, 0x69, // _1, _mtl_u.u_swi
+ 0x7a, 0x7a, 0x6c, 0x65, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // zzle)));. tmpva
+ 0x72, 0x5f, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x28, 0x74, 0x6d, 0x70, // r_3.w = half(tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // var_2);. _mtl_o
+ 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // .gl_FragColor =
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // tmpvar_3;. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
index 8c39751d083..5a54b079fe2 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_imgui_latlong_glsl[651] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x02, 0x01, 0x00, 0x00, // geLodEnabled....
0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
0x00, 0x01, 0x00, 0x53, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...S...varying h
0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
@@ -42,81 +42,155 @@ static const uint8_t fs_imgui_latlong_glsl[651] =
0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp
0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_4;.}...
};
-static const uint8_t fs_imgui_latlong_dx9[537] =
+static const uint8_t fs_imgui_latlong_dx9[554] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x01, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0xf4, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
- 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // `...........t...
- 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, // ....s_texColor..
- 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
- 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, // d...............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
- 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0xc0, // .......?...@..I.
- 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, // ....Q.........L?
- 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, // ..L>............
- 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, // ................
- 0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0xa0, // ................
- 0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
- 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0x00, 0xa0, // ..........U.....
- 0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
- 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, 0x80, 0x02, 0x00, 0x55, 0x81, // ..............U.
- 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
- 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
- 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
- 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, // ..............U.
- 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, // ..........U.....
- 0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ..U......
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH.o.><...s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, // Color0......u_im
+ 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x01, 0x00, // ageLodEnabled...
+ 0x00, 0x01, 0x00, 0xf4, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, // ...........0.CTA
+ 0x42, 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, // B...............
+ 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .............D..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, // .`...........t..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, // .....s_texColor.
+ 0xab, 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, // .u_imageLodEnabl
+ 0x65, 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, // ed..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, // .29.952.3111.Q..
+ 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, // ........?...@..I
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, // .....Q.........L
+ 0x3f, 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // ?..L>...........
+ 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x98, 0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, // ................
+ 0xa0, 0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, // ...............U
+ 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, // .....%..........
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0x00, // ...........U....
+ 0xa0, 0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, // ................
+ 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, // ...............U
+ 0xa0, 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, // .....%..........
+ 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, 0x80, 0x02, 0x00, 0x55, // ...............U
+ 0x81, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, // ........._......
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, // ................
+ 0x80, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, // ...............U
+ 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, // ...........U....
+ 0xa0, 0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ...U......
};
-static const uint8_t fs_imgui_latlong_dx11[600] =
+static const uint8_t fs_imgui_latlong_dx11[617] =
{
- 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
- 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x17, 0x00, 0x00, 0x00, // geLodEnabled....
- 0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x8e, 0x4b, 0x65, 0x9b, 0x2e, 0xce, 0x92, 0x33, // ..0.DXBC.Ke....3
- 0xf0, 0xfb, 0x9d, 0x50, 0x09, 0x30, 0x0b, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // ...P.0......0...
- 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
- 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC
- 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // OORD....OSGN,...
- 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
- 0x70, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // p...@.......Y...
- 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // F. .........Z...
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X0...p..
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
- 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
- 0x00, 0x00, 0x00, 0x00, 0x16, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@..
- 0xdb, 0x0f, 0x49, 0x40, 0xdb, 0x0f, 0xc9, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..I@...@........
- 0x4d, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
- 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // ........M.......
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A...
- 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, 0x00, // ....M.......b...
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
- 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
- 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // :.......8.......
- 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....:.......*...
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
- 0x46, 0x03, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F~......
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
- 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
- 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .........
- 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, // .@....L?.@....L>
- 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >.......
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x00, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0..
+ 0x00, 0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x8e, 0x4b, 0x65, 0x9b, 0x2e, 0xce, 0x92, // ...0.DXBC.Ke....
+ 0x33, 0xf0, 0xfb, 0x9d, 0x50, 0x09, 0x30, 0x0b, 0xf1, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, // 3...P.0......0..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, // .....,..........
+ 0x00, 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNP..........
+ 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, // .SV_POSITION.TEX
+ 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, // COORD....OSGN,..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......... ......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, // .SV_TARGET...SHD
+ 0x52, 0x70, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, // Rp...@.......Y..
+ 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, // .F. .........Z..
+ 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, // ..`......X0...p.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, // .....UU..b...2..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, // .h.......8...2..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, // ..............@.
+ 0x00, 0xdb, 0x0f, 0x49, 0x40, 0xdb, 0x0f, 0xc9, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...I@...@.......
+ 0x00, 0x4d, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, // .M...B..........
+ 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, // .........M......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, // .............A..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, // .....M.......b..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // .............8..
+ 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .........*......
+ 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, // .:.......8......
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // .....:.......*..
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....H..........
+ 0x00, 0x46, 0x03, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .F.......F~.....
+ 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // ..`........ ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6...r .....
+ 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, // .F.......2.... .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....... ........
+ 0x00, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, // ..@....L?.@....L
+ 0x3e, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >>.......
+};
+static const uint8_t fs_imgui_latlong_mtl[1091] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x34, 0x04, 0x00, 0x00, 0x75, 0x73, // FSH.o.><..4...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . float2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // oord0;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, // tput {. half4 g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // l_FragColor;.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // float4 u_imageLo
+ 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, // dEnabled;.};.fra
+ 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // gment xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // derOutput xlatMt
+ 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // lMain (xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // aderInput _mtl_i
+ 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c
+ 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // onstant xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, // haderUniform& _m
+ 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, // tl_u [[buffer(0)
+ 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ]]. , texture
+ 0x63, 0x75, 0x62, 0x65, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, // cube<float> s_te
+ 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // xColor [[texture
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, // (0)]], sampler _
+ 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // mtlsmp_s_texColo
+ 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // r [[sampler(0)]]
+ 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // ).{. xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // derOutput _mtl_o
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // ;. float3 resul
+ 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, // t_1;. float tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_2;. tmpvar_
+ 0x32, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, // 2 = (_mtl_i.v_te
+ 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, 0x32, 0x38, // xcoord0.x * 6.28
+ 0x33, 0x31, 0x38, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // 3185);. float t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_3;. tmpva
+ 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // r_3 = (_mtl_i.v_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
+ 0x31, 0x34, 0x31, 0x35, 0x39, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // 141593);. resul
+ 0x74, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, // t_1.x = (-(sin(t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, // mpvar_3)) * sin(
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, // tmpvar_2));. re
+ 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, // sult_1.y = cos(t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, // mpvar_3);. resu
+ 0x6c, 0x74, 0x5f, 0x31, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, // lt_1.z = (-(sin(
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, // tmpvar_3)) * cos
+ 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // (tmpvar_2));. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // alf4 tmpvar_4;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, // tmpvar_4 = half
+ 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, // 4(s_texColor.sam
+ 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, // ple(_mtlsmp_s_te
+ 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x29, // xColor, (float3)
+ 0x28, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x29, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, // (result_1), leve
+ 0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, // l(_mtl_u.u_image
+ 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x3b, // LodEnabled.x)));
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // . float tmpvar_
+ 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, // 5;. tmpvar_5 =
+ 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // (0.2 + (0.8 * _m
+ 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // tl_u.u_imageLodE
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, // nabled.y));. ha
+ 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, // lf4 tmpvar_6;.
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, // tmpvar_6.xyz = t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, // mpvar_4.xyz;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, // mpvar_6.w = half
+ 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // (tmpvar_5);. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // tl_o.gl_FragColo
+ 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, // r = tmpvar_6;.
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, // return _mtl_o;.}
+ 0x0a, 0x0a, 0x00, // ...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
index 09112c16c21..08d722db698 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_texture.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_imgui_texture_glsl[290] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x76, // Color..........v
0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
@@ -20,51 +20,103 @@ static const uint8_t fs_imgui_texture_glsl[290] =
0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_1;.}.
0x0a, 0x00, // ..
};
-static const uint8_t fs_imgui_texture_dx9[241] =
+static const uint8_t fs_imgui_texture_dx9[258] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH.............
- 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, // ..".CTAB....S...
- 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
- 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // L...0...........
- 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // <.......s_texCol
- 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, // or..............
- 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
- 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
- 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, // 29.952.3111.....
- 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, // ................
- 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, // ................
- 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, // B...............
- 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0x90, // ................
- 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................
- 0x00, // .
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe4, 0x00, 0x00, 0x03, 0xff, // Color0..........
+ 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
+ 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
+ 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, // .L...0..........
+ 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // .<.......s_texCo
+ 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, // lor.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, // .....ps_3_0.Micr
+ 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
+ 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, // .29.952.3111....
+ 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, // ................
+ 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, // ................
+ 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, // .B..............
+ 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, // ................
+ 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, // ................
+ 0x00, 0x00, // ..
};
-static const uint8_t fs_imgui_texture_dx11[404] =
+static const uint8_t fs_imgui_texture_dx11[421] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x84, 0x01, 0x44, 0x58, 0x42, 0x43, // FSH.........DXBC
- 0x57, 0x7b, 0x79, 0x39, 0xfb, 0xd2, 0x84, 0x36, 0x53, 0xeb, 0x9a, 0xf9, 0x9e, 0xa5, 0xf8, 0xb1, // W{y9...6S.......
- 0x01, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
- 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
- 0x53, 0x48, 0x44, 0x52, 0xa8, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, // SHDR....@...*...
- 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X...
- 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b...
- 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........b...2...
- 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // h.......E.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // .....`......8...
- 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ..............
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, // :.......6...r ..
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, // ....F.......>...
- 0x00, 0x00, 0x00, 0x00, // ....
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x84, 0x01, 0x44, 0x58, 0x42, // Color0.......DXB
+ 0x43, 0x57, 0x7b, 0x79, 0x39, 0xfb, 0xd2, 0x84, 0x36, 0x53, 0xeb, 0x9a, 0xf9, 0x9e, 0xa5, 0xf8, // CW{y9...6S......
+ 0xb1, 0x01, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .............,..
+ 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, // .........ISGNl..
+ 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........P......
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
+ 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........b......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
+ 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, // OR.TEXCOORD..OSG
+ 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... ..
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET..
+ 0xab, 0x53, 0x48, 0x44, 0x52, 0xa8, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, // .SHDR....@...*..
+ 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, // .Z....`......X..
+ 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, // ..p......UU..b..
+ 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, // .........b...2..
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... .....
+ 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .h.......E......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, // .....F.......F~.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, // ......`......8..
+ 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .. .............
+ 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, // .:.......6...r .
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....F.......>..
+ 0x01, 0x00, 0x00, 0x00, 0x00, // .....
+};
+static const uint8_t fs_imgui_texture_mtl[744] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xd9, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, // r0;. float2 v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // excoord0;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // rOutput {. half
+ 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // 4 gl_FragColor;.
+ 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // };.struct xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, // lShaderUniform {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, // ffer(0)]]. ,
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, // texture2d<float>
+ 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, // s_texColor [[te
+ 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, // xture(0)]], samp
+ 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, // ler _mtlsmp_s_te
+ 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // xColor [[sampler
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // (0)]]).{. xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, // tlShaderOutput _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, // mtl_o;. half4 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, // r_1 = half4(s_te
+ 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, // xColor.sample(_m
+ 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // tlsmp_s_texColor
+ 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // , (float2)(_mtl_
+ 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x29, 0x29, // i.v_texcoord0)))
+ 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. half4 tmpvar
+ 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, // _2;. tmpvar_2.x
+ 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // yz = half3(_mtl_
+ 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, // i.v_color0.xyz);
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, // . tmpvar_2.w =
+ 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, // ((half)(_mtl_i.v
+ 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x66, 0x6c, 0x6f, // _color0.w * (flo
+ 0x61, 0x74, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x29, 0x29, 0x3b, // at)tmpvar_1.x));
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // . _mtl_o.gl_Fra
+ 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // gColor = tmpvar_
+ 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // 2;. return _mtl
+ 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
index 593e126fb91..ed79a9399c5 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_ocornut_imgui_glsl[238] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, // ..........varyin
0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, // g highp vec4 v_c
0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // olor0;.varying h
@@ -16,48 +16,92 @@ static const uint8_t fs_ocornut_imgui_glsl[238] =
0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x76, // = (tmpvar_1 * v
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0);.}...
};
-static const uint8_t fs_ocornut_imgui_dx9[225] =
+static const uint8_t fs_ocornut_imgui_dx9[237] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x03, 0xff, 0xff, // FSH.............
- 0xfe, 0xff, 0x21, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, // ..!.CTAB....O...
- 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
- 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // H...0...........
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, // 8.......s_tex...
- 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, // ps_3_0.Microsoft
- 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // (R) HLSL Shader
- 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, // Compiler 9.29.9
- 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, // 52.3111.........
- 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, // ................
- 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, // ............B...
- 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, // ................
- 0x00, 0x08, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, // ................
- 0x00, // .
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x21, 0x00, // 0.............!.
+ 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, // CTAB....O.......
+ 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, // ............H...
+ 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, // 0...........8...
+ 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, // ....s_tex.......
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, // ............ps_3
+ 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, // _0.Microsoft (R)
+ 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, // HLSL Shader Com
+ 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, // piler 9.29.952.3
+ 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, // 111.............
+ 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........B.......
+ 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, 0x0f, 0x80, // ................
+ 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // .............
};
-static const uint8_t fs_ocornut_imgui_dx11[384] =
+static const uint8_t fs_ocornut_imgui_dx11[396] =
{
- 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x70, 0x01, 0x44, 0x58, 0x42, 0x43, // FSH.......p.DXBC
- 0xbe, 0x78, 0xe7, 0xa5, 0x19, 0x0c, 0x70, 0xeb, 0x4c, 0xb1, 0xac, 0x1f, 0x16, 0x84, 0xe9, 0x97, // .x....p.L.......
- 0x01, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ....p.......,...
- 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, // ........ISGNl...
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
- 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ................
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........b.......
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
- 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, // R.TEXCOORD..OSGN
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ...
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET...
- 0x53, 0x48, 0x44, 0x52, 0x94, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // SHDR....@...%...
- 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X...
- 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b...
- 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ........b...2...
- 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
- 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, // h.......E.......
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ....F.......F~..
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // .....`......8...
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F.......
- 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // F.......>.......
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x70, 0x01, 0x44, 0x58, 0x42, 0x43, 0xbe, 0x78, 0xe7, 0xa5, // 0.....p.DXBC.x..
+ 0x19, 0x0c, 0x70, 0xeb, 0x4c, 0xb1, 0xac, 0x1f, 0x16, 0x84, 0xe9, 0x97, 0x01, 0x00, 0x00, 0x00, // ..p.L...........
+ 0x70, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, // p.......,.......
+ 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....ISGNl.......
+ 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....P...........
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................
+ 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....b...........
+ 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, // ............SV_P
+ 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, // OSITION.COLOR.TE
+ 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // XCOORD..OSGN,...
+ 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
+ 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
+ 0x94, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // ....@...%...Z...
+ 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X....p..
+ 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ....UU..b.......
+ 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ....b...2.......
+ 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h...
+ 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....E...........
+ 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F~......
+ 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, // .`......8.... ..
+ 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ....F.......F...
+ 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ....>.......
+};
+static const uint8_t fs_ocornut_imgui_mtl[634] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH.......k...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, // r0;. float2 v_t
+ 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // excoord0;.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // rOutput {. half
+ 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // 4 gl_FragColor;.
+ 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // };.struct xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, // lShaderUniform {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, // .};.fragment xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // tMtlShaderOutput
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, // xlatMtlMain (xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, // atMtlShaderInput
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // _mtl_i [[stage_
+ 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, // in]], constant x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, // orm& _mtl_u [[bu
+ 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, 0x20, 0x20, 0x20, // ffer(0)]]. ,
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, // texture2d<float>
+ 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // s_tex [[texture
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, // (0)]], sampler _
+ 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x20, 0x5b, 0x5b, 0x73, // mtlsmp_s_tex [[s
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // ampler(0)]]).{.
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, // tput _mtl_o;. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // alf4 tmpvar_1;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, // tmpvar_1 = half
+ 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, // 4(s_tex.sample(_
+ 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x66, // mtlsmp_s_tex, (f
+ 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // loat2)(_mtl_i.v_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // texcoord0)));.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // _mtl_o.gl_FragCo
+ 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x29, 0x28, 0x28, // lor = ((half4)((
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, // float4)tmpvar_1
+ 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // * _mtl_i.v_color
+ 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, // 0));. return _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tl_o;.}...
};
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index d44a4a46a45..073191fde57 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -29,7 +29,6 @@
#include <bx/fpumath.h>
#include <bx/handlealloc.h>
-#include "../entry/dbg.h"
#include "imgui.h"
#include "ocornut_imgui.h"
#include "../nanovg/nanovg.h"
@@ -467,7 +466,7 @@ struct Imgui
_size = sizeof(s_droidSansTtf);
}
- IMGUI_create(_data, _size, _fontSize, _allocator);
+ IMGUI_create(_data, _size, _fontSize, m_allocator);
m_nvg = nvgCreate(1, m_view);
nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
@@ -486,9 +485,9 @@ struct Imgui
PosUvVertex::init();
PosNormalVertex::init();
- u_imageLodEnabled = bgfx::createUniform("u_imageLodEnabled", bgfx::UniformType::Uniform4fv);
- u_imageSwizzle = bgfx::createUniform("u_swizzle", bgfx::UniformType::Uniform4fv);
- s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Uniform1i);
+ u_imageLodEnabled = bgfx::createUniform("u_imageLodEnabled", bgfx::UniformType::Vec4);
+ u_imageSwizzle = bgfx::createUniform("u_swizzle", bgfx::UniformType::Vec4);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
const bgfx::Memory* vs_imgui_color;
const bgfx::Memory* fs_imgui_color;
@@ -533,6 +532,20 @@ struct Imgui
fs_imgui_image = bgfx::makeRef(fs_imgui_image_dx11, sizeof(fs_imgui_image_dx11) );
fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx11, sizeof(fs_imgui_image_swizz_dx11) );
break;
+
+ case bgfx::RendererType::Metal:
+ vs_imgui_color = bgfx::makeRef(vs_imgui_color_mtl, sizeof(vs_imgui_color_mtl) );
+ fs_imgui_color = bgfx::makeRef(fs_imgui_color_mtl, sizeof(fs_imgui_color_mtl) );
+ vs_imgui_texture = bgfx::makeRef(vs_imgui_texture_mtl, sizeof(vs_imgui_texture_mtl) );
+ fs_imgui_texture = bgfx::makeRef(fs_imgui_texture_mtl, sizeof(fs_imgui_texture_mtl) );
+ vs_imgui_cubemap = bgfx::makeRef(vs_imgui_cubemap_mtl, sizeof(vs_imgui_cubemap_mtl) );
+ fs_imgui_cubemap = bgfx::makeRef(fs_imgui_cubemap_mtl, sizeof(fs_imgui_cubemap_mtl) );
+ vs_imgui_latlong = bgfx::makeRef(vs_imgui_latlong_mtl, sizeof(vs_imgui_latlong_mtl) );
+ fs_imgui_latlong = bgfx::makeRef(fs_imgui_latlong_mtl, sizeof(fs_imgui_latlong_mtl) );
+ vs_imgui_image = bgfx::makeRef(vs_imgui_image_mtl, sizeof(vs_imgui_image_mtl) );
+ fs_imgui_image = bgfx::makeRef(fs_imgui_image_mtl, sizeof(fs_imgui_image_mtl) );
+ fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_mtl, sizeof(fs_imgui_image_swizz_mtl) );
+ break;
default:
vs_imgui_color = bgfx::makeRef(vs_imgui_color_glsl, sizeof(vs_imgui_color_glsl) );
@@ -771,7 +784,7 @@ struct Imgui
&& m_leftPressed)
{
// Toggle active input.
- if (isActiveInputField(_id))
+ if (isActiveInputField(_id) )
{
clearActiveInputField();
}
@@ -824,7 +837,7 @@ struct Imgui
const int32_t mx = int32_t(float(_mx)*xscale);
const int32_t my = int32_t(float(_my)*yscale);
- IMGUI_beginFrame(mx, my, _button, _width, _height, _inputChar, _view);
+ IMGUI_beginFrame(mx, my, _button, _scroll, _width, _height, _inputChar, _view);
nvgBeginFrameScaled(m_nvg, m_viewWidth, m_viewHeight, m_surfaceWidth, m_surfaceHeight, 1.0f);
nvgViewId(m_nvg, _view);
@@ -832,7 +845,7 @@ struct Imgui
bgfx::setViewSeq(_view, true);
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
m_viewWidth = _width / 2;
m_surfaceWidth = _surfaceWidth / 2;
@@ -1081,7 +1094,7 @@ struct Imgui
else
{
// Clear active if scroll is selected but not visible any more.
- if (isActive(hid))
+ if (isActive(hid) )
{
clearActive();
}
@@ -1208,6 +1221,11 @@ struct Imgui
const uint32_t rgb0 = _rgb0&0x00ffffff;
+ if (!visible(yy, height, area.m_scissorY, area.m_scissorHeight))
+ {
+ return false;
+ }
+
drawRoundedRect( (float)xx
, (float)yy
, (float)width
@@ -1253,6 +1271,11 @@ struct Imgui
const bool over = enabled && inRect(xx, yy, width, height);
const bool res = buttonLogic(id, over);
+ if (!visible(yy, height, area.m_scissorY, area.m_scissorHeight))
+ {
+ return false;
+ }
+
if (isHot(id) )
{
drawRoundedRect( (float)xx
@@ -1303,6 +1326,12 @@ struct Imgui
const int32_t cx = xx + BUTTON_HEIGHT / 2 - CHECK_SIZE / 2;
const int32_t cy = yy + BUTTON_HEIGHT / 2 - CHECK_SIZE / 2;
+
+ if (!visible(cy, CHECK_SIZE+6, area.m_scissorY, area.m_scissorHeight))
+ {
+ return false;
+ }
+
drawRoundedRect( (float)cx - 3
, (float)cy - 3
, (float)CHECK_SIZE + 6
@@ -1400,7 +1429,7 @@ struct Imgui
// Handle input.
if (isActiveInputField(id) )
{
- const size_t cursor = size_t(strlen(_str));
+ const size_t cursor = size_t(strlen(_str) );
if (m_char == 0x08 || m_char == 0x7f) //backspace or delete
{
@@ -1423,7 +1452,7 @@ struct Imgui
if (drawLabel)
{
uint32_t numVertices = 0; //unused
- const int32_t labelWidth = int32_t(getTextLength(m_fonts[m_currentFontIdx].m_cdata, _label, numVertices));
+ const int32_t labelWidth = int32_t(getTextLength(m_fonts[m_currentFontIdx].m_cdata, _label, numVertices) );
xx += (labelWidth + 6);
width -= (labelWidth + 6);
}
@@ -1563,7 +1592,7 @@ struct Imgui
, enabled?imguiRGBA(255,196,0,200):imguiRGBA(128,128,128,32)
);
}
- else if (isActive(id))
+ else if (isActive(id) )
{
drawRoundedRect( (float)buttonX
, (float)yy
@@ -1633,9 +1662,8 @@ struct Imgui
|BGFX_STATE_ALPHA_WRITE
|BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
- bgfx::setProgram(m_imageProgram);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_imageProgram);
return res;
}
@@ -1701,9 +1729,8 @@ struct Imgui
|BGFX_STATE_ALPHA_WRITE
|BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
- bgfx::setProgram(m_imageSwizzProgram);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_imageSwizzProgram);
return res;
}
@@ -1762,9 +1789,8 @@ struct Imgui
|BGFX_STATE_ALPHA_WRITE
|BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
- bgfx::setProgram(m_latlongProgram);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_latlongProgram);
return res;
}
@@ -1895,7 +1921,6 @@ struct Imgui
bgfx::setTransform(mtx);
bgfx::setTexture(0, s_texColor, _cubemap);
- bgfx::setProgram(m_cubeMapProgram);
bgfx::setVertexBuffer(&tvb);
bgfx::setIndexBuffer(&tib);
bgfx::setState(BGFX_STATE_RGB_WRITE
@@ -1903,7 +1928,7 @@ struct Imgui
|BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_cubeMapProgram);
return res;
}
@@ -2411,9 +2436,8 @@ struct Imgui
| BGFX_STATE_ALPHA_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
- bgfx::setProgram(m_colorProgram);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_colorProgram);
}
}
@@ -2717,9 +2741,8 @@ struct Imgui
| BGFX_STATE_ALPHA_WRITE
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
);
- bgfx::setProgram(m_textureProgram);
setCurrentScissor();
- bgfx::submit(m_view);
+ bgfx::submit(m_view, m_textureProgram);
}
#endif // USE_NANOVG_FONT
}
@@ -3055,6 +3078,12 @@ struct Imgui
bool m_scissorEnabled;
};
+ bool visible(int32_t _elemY, int32_t _elemHeight, int32_t _scissorY, int32_t _scissorHeight)
+ {
+ return (_elemY+_elemHeight) > _scissorY
+ && (_elemY) < (_scissorY+_scissorHeight);
+ }
+
inline Area& getCurrentArea()
{
return m_areas[m_areaId];
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index cb0622319ef..e85b9d3a16a 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -26,11 +26,13 @@
#ifndef IMGUI_H_HEADER_GUARD
#define IMGUI_H_HEADER_GUARD
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <ocornut-imgui/imgui.h>
+#include <ocornut-imgui/imgui_wm.h>
-#define IMGUI_MBUT_LEFT 0x01
-#define IMGUI_MBUT_RIGHT 0x02
+#define IMGUI_MBUT_LEFT 0x01
+#define IMGUI_MBUT_RIGHT 0x02
+#define IMGUI_MBUT_MIDDLE 0x04
/// For custom values, define these macros before including imgui.h
@@ -206,12 +208,65 @@ bool imguiMouseOverArea();
namespace ImGui
{
+#define IMGUI_FLAGS_NONE UINT16_C(0x0000)
+#define IMGUI_FLAGS_ALPHA_BLEND UINT16_C(0x0001)
+
+ // Helper function for passing bgfx::TextureHandle to ImGui::Image.
+ inline void Image(bgfx::TextureHandle _handle
+ , uint16_t _flags
+ , const ImVec2& _size
+ , const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
+ , const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
+ , const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
+ , const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
+ )
+ {
+ union { struct { uint16_t flags; bgfx::TextureHandle handle; } s; ImTextureID ptr; } texture;
+ texture.s.flags = _flags;
+ texture.s.handle = _handle;
+ Image(texture.ptr, _size, _uv0, _uv1, _tintCol, _borderCol);
+ }
+
// Helper function for passing bgfx::TextureHandle to ImGui::Image.
- inline void Image(bgfx::TextureHandle _handle, 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))
+ inline void Image(bgfx::TextureHandle _handle
+ , const ImVec2& _size
+ , const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
+ , const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
+ , const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
+ , const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
+ )
+ {
+ Image(_handle, IMGUI_FLAGS_ALPHA_BLEND, _size, _uv0, _uv1, _tintCol, _borderCol);
+ }
+
+ // Helper function for passing bgfx::TextureHandle to ImGui::ImageButton.
+ inline bool ImageButton(bgfx::TextureHandle _handle
+ , uint16_t _flags
+ , const ImVec2& _size
+ , const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
+ , const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
+ , int _framePadding = -1
+ , const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
+ , const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
+ )
+ {
+ union { struct { uint16_t flags; bgfx::TextureHandle handle; } s; ImTextureID ptr; } texture;
+ texture.s.flags = _flags;
+ texture.s.handle = _handle;
+ return ImageButton(texture.ptr, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
+ }
+
+ // Helper function for passing bgfx::TextureHandle to ImGui::ImageButton.
+ inline bool ImageButton(bgfx::TextureHandle _handle
+ , const ImVec2& _size
+ , const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
+ , const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
+ , int _framePadding = -1
+ , const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
+ , const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
+ )
{
- union { bgfx::TextureHandle handle; ImTextureID ptr; } texture;
- texture.handle = _handle;
- Image(texture.ptr, _size, _uv0, _uv1, _tint_col, _border_col);
+ return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
}
} // namespace ImGui
diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
index 368d503a1ba..8efddcc65f8 100644
--- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
@@ -3,87 +3,360 @@
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/allocator.h>
#include <bx/fpumath.h>
+#include <bx/timer.h>
#include <ocornut-imgui/imgui.h>
+#include <ocornut-imgui/imgui_wm.h>
#include "imgui.h"
#include "ocornut_imgui.h"
#include <stb/stb_image.c>
+#ifndef USE_ENTRY
+# define USE_ENTRY defined(SCI_NAMESPACE)
+#endif // USE_ENTRY
+
+#if USE_ENTRY
+# include "../entry/entry.h"
+#endif // USE_ENTRY
+
+#if defined(SCI_NAMESPACE)
+# include "../entry/input.h"
+# include "scintilla.h"
+#endif // defined(SCI_NAMESPACE)
+
#include "vs_ocornut_imgui.bin.h"
#include "fs_ocornut_imgui.bin.h"
+void viewCallback(const ImDrawList* _parentList, const ImDrawCmd* _cmd);
+
+class PlatformWindow : public ImGuiWM::PlatformWindow
+{
+ typedef ImGuiWM::PlatformWindow Super;
+
+public:
+ PlatformWindow(bool _mainWindow, bool _isDragWindow)
+ : ImGuiWM::PlatformWindow(_mainWindow, _isDragWindow)
+ , m_pos(0.0f, 0.0f)
+ , m_size(0.0f, 0.0f)
+ , m_drag(false)
+ {
+#if USE_ENTRY
+ if (!_mainWindow
+ && !_isDragWindow)
+ {
+ m_window = entry::createWindow(0, 0, 640, 380);
+ extern void pwToWindow(entry::WindowHandle _handle, PlatformWindow* _pw);
+ pwToWindow(m_window, this);
+ }
+ else
+ {
+ m_window.idx = 0;
+ }
+#endif // USE_ENTRY
+ }
+
+ virtual ~PlatformWindow() BX_OVERRIDE
+ {
+ }
+
+ virtual bool Init(ImGuiWM::PlatformWindow* /*_parent*/) BX_OVERRIDE
+ {
+ return true;
+ }
+
+ virtual const ImVec2& GetPosition() const BX_OVERRIDE
+ {
+ return m_pos;
+ }
+
+ virtual const ImVec2& GetSize() const BX_OVERRIDE
+ {
+ return m_size;
+ }
+
+ virtual void Show() BX_OVERRIDE
+ {
+ }
+
+ virtual void Hide() BX_OVERRIDE
+ {
+ }
+
+ virtual void SetSize(const ImVec2& _size) BX_OVERRIDE
+ {
+#if USE_ENTRY
+ if (0 != m_window.idx
+ && m_size.x != _size.x
+ && m_size.y != _size.y)
+ {
+ entry::setWindowSize(m_window, int32_t(_size.x), int32_t(_size.y) );
+ }
+#endif // USE_ENTRY
+
+ m_size = _size;
+ }
+
+ virtual void SetPosition(const ImVec2& _pos) BX_OVERRIDE
+ {
+
+#if USE_ENTRY
+ if (0 != m_window.idx
+ && m_pos.x != _pos.x
+ && m_pos.y != _pos.y)
+ {
+ entry::setWindowPos(m_window, int32_t(_pos.x), int32_t(_pos.y) );
+ }
+#endif // USE_ENTRY
+
+ m_pos = _pos;
+ }
+
+ virtual void SetTitle(const char* _title) BX_OVERRIDE
+ {
+#if USE_ENTRY
+ entry::setWindowTitle(m_window, _title);
+#else
+ BX_UNUSED(_title);
+#endif // USE_ENTRY
+ }
+
+ virtual void PreUpdate() BX_OVERRIDE
+ {
+ }
+
+ virtual void PaintBegin()
+ {
+#if USE_ENTRY
+ if (!m_bIsDragWindow)
+ {
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+ union { entry::WindowHandle handle; void* ptr; } cast = { m_window };
+ drawList->AddCallback(viewCallback, cast.ptr);
+ drawList->PushClipRect(ImVec4(0.0f, 0.0f, m_size.x, m_size.y) );
+ }
+#endif // USE_ENTRY
+ }
+
+ virtual void Paint() BX_OVERRIDE
+ {
+ if (!m_bIsDragWindow)
+ {
+ Super::Paint();
+ }
+ }
+
+ virtual void PaintEnd()
+ {
+#if USE_ENTRY
+ if (!m_bIsDragWindow)
+ {
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+ drawList->PopClipRect();
+ drawList->AddCallback(viewCallback, NULL);
+ }
+#endif // USE_ENTRY
+ }
+
+ virtual void Destroy() BX_OVERRIDE
+ {
+ }
+
+ virtual void StartDrag() BX_OVERRIDE
+ {
+ m_drag = true;
+ }
+
+ virtual void StopDrag() BX_OVERRIDE
+ {
+ m_drag = false;
+ }
+
+ virtual bool IsDraging() BX_OVERRIDE
+ {
+ return m_drag;
+ }
+
+private:
+ ImVec2 m_pos;
+ ImVec2 m_size;
+ bool m_drag;
+
+#if USE_ENTRY
+ entry::WindowHandle m_window;
+#endif // USE_ENTRY
+};
+
+class WindowManager : public ImGuiWM::WindowManager
+{
+ typedef ImGuiWM::WindowManager Super;
+
+public:
+ WindowManager()
+ {
+ }
+
+ virtual ~WindowManager() BX_OVERRIDE
+ {
+ }
+
+protected:
+ virtual ImGuiWM::PlatformWindow* CreatePlatformWindow(bool _main, ImGuiWM::PlatformWindow* _parent, bool _isDragWindow) BX_OVERRIDE
+ {
+#if USE_ENTRY
+#else
+ if (!_main
+ && !_isDragWindow)
+ {
+ return NULL;
+ }
+#endif // USE_ENTRY
+
+ PlatformWindow* window = new (ImGui::MemAlloc(sizeof(PlatformWindow) ) ) PlatformWindow(_main, _isDragWindow);
+ window->Init(_parent);
+ return static_cast<ImGuiWM::PlatformWindow*>(window);
+ }
+
+ virtual void LogFormatted(const char* _str) BX_OVERRIDE
+ {
+ BX_TRACE("%s", _str); BX_UNUSED(_str);
+ }
+
+ virtual void InternalRun() BX_OVERRIDE
+ {
+ PreUpdate();
+ Update();
+ }
+};
+
struct OcornutImguiContext
{
static void* memAlloc(size_t _size);
static void memFree(void* _ptr);
- static void renderDrawLists(ImDrawList** const _lists, int _count);
+ static void renderDrawLists(ImDrawData* _drawData);
- void render(ImDrawList** const _lists, int _count)
+ void render(ImDrawData* _drawData)
{
- const float width = ImGui::GetIO().DisplaySize.x;
- const float height = ImGui::GetIO().DisplaySize.y;
+ const ImGuiIO& io = ImGui::GetIO();
+ const float width = io.DisplaySize.x;
+ const float height = io.DisplaySize.y;
- float ortho[16];
- bx::mtxOrtho(ortho, 0.0f, width, height, 0.0f, -1.0f, 1.0f);
+ {
+ float ortho[16];
+ bx::mtxOrtho(ortho, 0.0f, width, height, 0.0f, -1.0f, 1.0f);
+ bgfx::setViewTransform(m_viewId, NULL, ortho);
+ }
- bgfx::setViewTransform(m_viewId, NULL, ortho);
+#if USE_ENTRY
+ for (uint32_t ii = 1; ii < BX_COUNTOF(m_window); ++ii)
+ {
+ Window& window = m_window[ii];
+ if (bgfx::isValid(window.m_fbh) )
+ {
+ const uint8_t viewId = window.m_viewId;
+ bgfx::setViewClear(viewId
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff + rand()
+ , 1.0f
+ , 0
+ );
+ bgfx::setViewFrameBuffer(viewId, window.m_fbh);
+ bgfx::setViewRect(viewId
+ , 0
+ , 0
+ , window.m_state.m_width
+ , window.m_state.m_height
+ );
+ float ortho[16];
+ bx::mtxOrtho(ortho
+ , 0.0f
+ , float(window.m_state.m_width)
+ , float(window.m_state.m_height)
+ , 0.0f
+ , -1.0f
+ , 1.0f
+ );
+ bgfx::setViewTransform(viewId
+ , NULL
+ , ortho
+ );
+ }
+ }
+#endif // USE_ENTRY
// Render command lists
- for (int32_t ii = 0; ii < _count; ++ii)
+ for (int32_t ii = 0, num = _drawData->CmdListsCount; ii < num; ++ii)
{
bgfx::TransientVertexBuffer tvb;
+ bgfx::TransientIndexBuffer tib;
- uint32_t vtx_size = 0;
+ const ImDrawList* drawList = _drawData->CmdLists[ii];
+ uint32_t numVertices = (uint32_t)drawList->VtxBuffer.size();
+ uint32_t numIndices = (uint32_t)drawList->IdxBuffer.size();
- const ImDrawList* cmd_list = _lists[ii];
- const ImDrawVert* vtx_buffer = cmd_list->vtx_buffer.begin();
-
- const ImDrawCmd* pcmd_begin = cmd_list->commands.begin();
- const ImDrawCmd* pcmd_end = cmd_list->commands.end();
- for (const ImDrawCmd* pcmd = pcmd_begin; pcmd != pcmd_end; pcmd++)
- {
- vtx_size += (uint32_t)pcmd->vtx_count;
- }
-
- if (!bgfx::checkAvailTransientVertexBuffer(vtx_size, m_decl))
+ if (!bgfx::checkAvailTransientVertexBuffer(numVertices, m_decl)
+ || !bgfx::checkAvailTransientIndexBuffer(numIndices) )
{
// not enough space in transient buffer just quit drawing the rest...
break;
}
- bgfx::allocTransientVertexBuffer(&tvb, vtx_size, m_decl);
+ bgfx::allocTransientVertexBuffer(&tvb, numVertices, m_decl);
+ bgfx::allocTransientIndexBuffer(&tib, numIndices);
ImDrawVert* verts = (ImDrawVert*)tvb.data;
- memcpy(verts, vtx_buffer, vtx_size * sizeof(ImDrawVert));
-
- uint32_t vtx_offset = 0;
- for (const ImDrawCmd* pcmd = pcmd_begin; pcmd != pcmd_end; pcmd++)
- {
- bgfx::setState(0
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
- | BGFX_STATE_MSAA
- );
- bgfx::setScissor(uint16_t(pcmd->clip_rect.x)
- , uint16_t(pcmd->clip_rect.y)
- , uint16_t(pcmd->clip_rect.z-pcmd->clip_rect.x)
- , uint16_t(pcmd->clip_rect.w-pcmd->clip_rect.y)
- );
- union { void* ptr; bgfx::TextureHandle handle; } texture = { pcmd->texture_id };
-
- bgfx::setTexture(0, s_tex, 0 != texture.handle.idx
- ? texture.handle
- : m_texture
- );
+ memcpy(verts, drawList->VtxBuffer.begin(), numVertices * sizeof(ImDrawVert) );
- bgfx::setVertexBuffer(&tvb, vtx_offset, pcmd->vtx_count);
- bgfx::setProgram(m_program);
- bgfx::submit(m_viewId);
+ ImDrawIdx* indices = (ImDrawIdx*)tib.data;
+ memcpy(indices, drawList->IdxBuffer.begin(), numIndices * sizeof(ImDrawIdx) );
- vtx_offset += pcmd->vtx_count;
+ uint32_t offset = 0;
+ for (const ImDrawCmd* cmd = drawList->CmdBuffer.begin(), *cmdEnd = drawList->CmdBuffer.end(); cmd != cmdEnd; ++cmd)
+ {
+ if (cmd->UserCallback)
+ {
+ cmd->UserCallback(drawList, cmd);
+ }
+ else if (0 != cmd->ElemCount)
+ {
+ uint64_t state = 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_MSAA
+ ;
+
+ bgfx::TextureHandle th = m_texture;
+
+ if (NULL != cmd->TextureId)
+ {
+ union { ImTextureID ptr; struct { uint16_t flags; bgfx::TextureHandle handle; } s; } texture = { cmd->TextureId };
+ state |= 0 != (IMGUI_FLAGS_ALPHA_BLEND & texture.s.flags)
+ ? BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ : BGFX_STATE_NONE
+ ;
+ th = texture.s.handle;
+ }
+ else
+ {
+ state |= BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA);
+ }
+
+ const uint16_t xx = uint16_t(bx::fmax(cmd->ClipRect.x, 0.0f) );
+ const uint16_t yy = uint16_t(bx::fmax(cmd->ClipRect.y, 0.0f) );
+ bgfx::setScissor(xx, yy
+ , uint16_t(bx::fmin(cmd->ClipRect.z, 65535.0f)-xx)
+ , uint16_t(bx::fmin(cmd->ClipRect.w, 65535.0f)-yy)
+ );
+
+ bgfx::setState(state);
+ bgfx::setTexture(0, s_tex, th);
+ bgfx::setVertexBuffer(&tvb, 0, numVertices);
+ bgfx::setIndexBuffer(&tib, offset, cmd->ElemCount);
+ bgfx::submit(m_viewId, m_program);
+ }
+
+ offset += cmd->ElemCount;
}
}
}
@@ -92,6 +365,8 @@ struct OcornutImguiContext
{
m_viewId = 255;
m_allocator = _allocator;
+ m_lastScroll = 0;
+ m_last = bx::getHPCounter();
ImGuiIO& io = ImGui::GetIO();
io.RenderDrawListsFn = renderDrawLists;
@@ -100,30 +375,55 @@ struct OcornutImguiContext
io.MemAllocFn = memAlloc;
io.MemFreeFn = memFree;
}
+
io.DisplaySize = ImVec2(1280.0f, 720.0f);
- io.DeltaTime = 1.0f / 60.0f;
+ io.DeltaTime = 1.0f / 60.0f;
io.IniFilename = NULL;
-// io.PixelCenterOffset = bgfx::RendererType::Direct3D9 == bgfx::getRendererType() ? -0.5f : 0.0f;
+
+#if defined(SCI_NAMESPACE)
+ io.KeyMap[ImGuiKey_Tab] = (int)entry::Key::Tab;
+ io.KeyMap[ImGuiKey_LeftArrow] = (int)entry::Key::Left;
+ io.KeyMap[ImGuiKey_RightArrow] = (int)entry::Key::Right;
+ io.KeyMap[ImGuiKey_UpArrow] = (int)entry::Key::Up;
+ io.KeyMap[ImGuiKey_DownArrow] = (int)entry::Key::Down;
+ io.KeyMap[ImGuiKey_Home] = (int)entry::Key::Home;
+ io.KeyMap[ImGuiKey_End] = (int)entry::Key::End;
+ io.KeyMap[ImGuiKey_Delete] = (int)entry::Key::Delete;
+ io.KeyMap[ImGuiKey_Backspace] = (int)entry::Key::Backspace;
+ io.KeyMap[ImGuiKey_Enter] = (int)entry::Key::Return;
+ io.KeyMap[ImGuiKey_Escape] = (int)entry::Key::Esc;
+ io.KeyMap[ImGuiKey_A] = (int)entry::Key::KeyA;
+ io.KeyMap[ImGuiKey_C] = (int)entry::Key::KeyC;
+ io.KeyMap[ImGuiKey_V] = (int)entry::Key::KeyV;
+ io.KeyMap[ImGuiKey_X] = (int)entry::Key::KeyX;
+ io.KeyMap[ImGuiKey_Y] = (int)entry::Key::KeyY;
+ io.KeyMap[ImGuiKey_Z] = (int)entry::Key::KeyZ;
+#endif // defined(SCI_NAMESPACE)
const bgfx::Memory* vsmem;
const bgfx::Memory* fsmem;
- switch (bgfx::getRendererType())
+ switch (bgfx::getRendererType() )
{
case bgfx::RendererType::Direct3D9:
- vsmem = bgfx::makeRef(vs_ocornut_imgui_dx9, sizeof(vs_ocornut_imgui_dx9));
- fsmem = bgfx::makeRef(fs_ocornut_imgui_dx9, sizeof(fs_ocornut_imgui_dx9));
+ vsmem = bgfx::makeRef(vs_ocornut_imgui_dx9, sizeof(vs_ocornut_imgui_dx9) );
+ fsmem = bgfx::makeRef(fs_ocornut_imgui_dx9, sizeof(fs_ocornut_imgui_dx9) );
break;
case bgfx::RendererType::Direct3D11:
case bgfx::RendererType::Direct3D12:
- vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11));
- fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11));
+ vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11) );
+ fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11) );
+ break;
+
+ case bgfx::RendererType::Metal:
+ vsmem = bgfx::makeRef(vs_ocornut_imgui_mtl, sizeof(vs_ocornut_imgui_mtl) );
+ fsmem = bgfx::makeRef(fs_ocornut_imgui_mtl, sizeof(fs_ocornut_imgui_mtl) );
break;
default:
- vsmem = bgfx::makeRef(vs_ocornut_imgui_glsl, sizeof(vs_ocornut_imgui_glsl));
- fsmem = bgfx::makeRef(fs_ocornut_imgui_glsl, sizeof(fs_ocornut_imgui_glsl));
+ vsmem = bgfx::makeRef(vs_ocornut_imgui_glsl, sizeof(vs_ocornut_imgui_glsl) );
+ fsmem = bgfx::makeRef(fs_ocornut_imgui_glsl, sizeof(fs_ocornut_imgui_glsl) );
break;
}
@@ -133,12 +433,12 @@ struct OcornutImguiContext
m_decl
.begin()
- .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
- .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
+ .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
.end();
- s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Uniform1i);
+ s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Int1);
uint8_t* data;
int32_t width;
@@ -153,16 +453,67 @@ struct OcornutImguiContext
, (uint16_t)height
, 1
, bgfx::TextureFormat::BGRA8
- , BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT
+ , 0
, bgfx::copy(data, width*height*4)
);
ImGuiStyle& style = ImGui::GetStyle();
style.FrameRounding = 4.0f;
+
+ m_wm = BX_NEW(m_allocator, WindowManager);
+ m_wm->Init();
+
+#if 0
+ {
+ class Window : public ImGuiWM::Window
+ {
+ public:
+ Window(const char* _title)
+ : ImGuiWM::Window()
+ {
+ SetTitle(_title);
+ }
+
+ virtual void OnGui() BX_OVERRIDE
+ {
+ }
+ };
+
+ class WindowX : public ImGuiWM::Window
+ {
+ public:
+ WindowX(const char* _title)
+ : ImGuiWM::Window()
+ {
+ SetTitle(_title);
+ }
+
+ virtual void OnGui() BX_OVERRIDE
+ {
+#if defined(SCI_NAMESPACE) && 0
+ bool opened = true;
+ ImGuiScintilla("Scintilla Editor", &opened, ImVec2(640.0f, 480.0f) );
+#endif // 0
+ }
+ };
+
+ Window* w0 = new Window("test");
+ WindowX* w1 = new WindowX("abcd");
+ Window* w2 = new Window("xyzw");
+ Window* w3 = new Window("0123");
+
+ m_wm->Dock(w0);
+ m_wm->DockWith(w1, w0, ImGuiWM::E_DOCK_ORIENTATION_RIGHT);
+ m_wm->DockWith(w2, w1, ImGuiWM::E_DOCK_ORIENTATION_BOTTOM);
+ m_wm->DockWith(w3, w0, ImGuiWM::E_DOCK_ORIENTATION_BOTTOM);
+ }
+#endif // 0
}
void destroy()
{
+ m_wm->Exit();
+ BX_DELETE(m_allocator, m_wm);
ImGui::Shutdown();
bgfx::destroyUniform(s_tex);
@@ -172,23 +523,59 @@ struct OcornutImguiContext
m_allocator = NULL;
}
- void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId)
+ void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, int _width, int _height, char _inputChar, uint8_t _viewId)
{
- m_viewId = _viewId;
+ m_viewId = _viewId;
+ m_defaultViewId = _viewId;
+
ImGuiIO& io = ImGui::GetIO();
- io.AddInputCharacter(_inputChar & 0x7f); // ASCII or GTFO! :)
- io.DisplaySize = ImVec2((float)_width, (float)_height);
- io.DeltaTime = 1.0f / 60.0f;
- io.MousePos = ImVec2((float)_mx, (float)_my);
+ if (_inputChar < 0x7f)
+ {
+ io.AddInputCharacter(_inputChar); // ASCII or GTFO! :(
+ }
+
+ io.DisplaySize = ImVec2( (float)_width, (float)_height);
+
+ const int64_t now = bx::getHPCounter();
+ const int64_t frameTime = now - m_last;
+ m_last = now;
+ const double freq = double(bx::getHPFrequency() );
+ io.DeltaTime = float(frameTime/freq);
+
+ io.MousePos = ImVec2( (float)_mx, (float)_my);
io.MouseDown[0] = 0 != (_button & IMGUI_MBUT_LEFT);
+ io.MouseDown[1] = 0 != (_button & IMGUI_MBUT_RIGHT);
+ io.MouseDown[2] = 0 != (_button & IMGUI_MBUT_MIDDLE);
+ io.MouseWheel = (float)(_scroll - m_lastScroll);
+ m_lastScroll = _scroll;
+
+#if defined(SCI_NAMESPACE)
+ uint8_t modifiers = inputGetModifiersState();
+ io.KeyShift = 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) );
+ io.KeyCtrl = 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) );
+ io.KeyAlt = 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) );
+ for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii)
+ {
+ io.KeysDown[ii] = inputGetKeyState(entry::Key::Enum(ii) );
+ }
+#endif // defined(SCI_NAMESPACE)
ImGui::NewFrame();
- //ImGui::ShowTestWindow(); //Debug only.
+#if 0
+ ImGui::ShowTestWindow(); //Debug only.
+#endif // 0
+
+#if 0
+ extern void ShowExampleAppCustomNodeGraph(bool* opened);
+ bool opened = true;
+ ShowExampleAppCustomNodeGraph(&opened);
+#endif // 0
}
void endFrame()
{
+ m_wm->Run();
ImGui::Render();
}
@@ -197,11 +584,84 @@ struct OcornutImguiContext
bgfx::ProgramHandle m_program;
bgfx::TextureHandle m_texture;
bgfx::UniformHandle s_tex;
+ WindowManager* m_wm;
+ int64_t m_last;
+ int32_t m_lastScroll;
uint8_t m_viewId;
+ uint8_t m_defaultViewId;
+
+#if USE_ENTRY
+ struct Window
+ {
+ Window()
+ {
+ m_fbh.idx = bgfx::invalidHandle;
+ }
+
+ entry::WindowState m_state;
+ PlatformWindow* m_pw;
+ bgfx::FrameBufferHandle m_fbh;
+ uint8_t m_viewId;
+ };
+
+ Window m_window[16];
+#endif // USE_ENTRY
};
static OcornutImguiContext s_ctx;
+#if USE_ENTRY
+
+void viewCallback(const ImDrawList* /*_parentList*/, const ImDrawCmd* _cmd)
+{
+ union { void* ptr; entry::WindowHandle handle; } cast = { _cmd->UserCallbackData };
+
+ if (0 != cast.handle.idx)
+ {
+ s_ctx.m_viewId = s_ctx.m_window[cast.handle.idx].m_viewId;
+ }
+ else
+ {
+ s_ctx.m_viewId = s_ctx.m_defaultViewId;
+ }
+}
+
+void pwToWindow(entry::WindowHandle _handle, PlatformWindow* _pw)
+{
+ s_ctx.m_window[_handle.idx].m_pw = _pw;
+}
+
+void imguiUpdateWindow(const entry::WindowState& _state)
+{
+ OcornutImguiContext::Window& window = s_ctx.m_window[_state.m_handle.idx];
+
+ if (window.m_state.m_nwh != _state.m_nwh
+ || (window.m_state.m_width != _state.m_width
+ || window.m_state.m_height != _state.m_height) )
+ {
+ // When window changes size or native window handle changed
+ // frame buffer must be recreated.
+ if (bgfx::isValid(window.m_fbh) )
+ {
+ bgfx::destroyFrameBuffer(window.m_fbh);
+ window.m_fbh.idx = bgfx::invalidHandle;
+ }
+
+ if (NULL != _state.m_nwh)
+ {
+ window.m_fbh = bgfx::createFrameBuffer(_state.m_nwh, _state.m_width, _state.m_height);
+ window.m_viewId = 200 + _state.m_handle.idx;
+ }
+ else
+ {
+ window.m_viewId = s_ctx.m_defaultViewId;
+ }
+ }
+
+ memcpy(&window.m_state, &_state, sizeof(entry::WindowState) );
+}
+#endif // USE_ENTRY
+
void* OcornutImguiContext::memAlloc(size_t _size)
{
return BX_ALLOC(s_ctx.m_allocator, _size);
@@ -212,9 +672,9 @@ void OcornutImguiContext::memFree(void* _ptr)
BX_FREE(s_ctx.m_allocator, _ptr);
}
-void OcornutImguiContext::renderDrawLists(ImDrawList** const _lists, int _count)
+void OcornutImguiContext::renderDrawLists(ImDrawData* draw_data)
{
- s_ctx.render(_lists, _count);
+ s_ctx.render(draw_data);
}
void IMGUI_create(const void* _data, uint32_t _size, float _fontSize, bx::AllocatorI* _allocator)
@@ -227,9 +687,9 @@ void IMGUI_destroy()
s_ctx.destroy();
}
-void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId)
+void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, int _width, int _height, char _inputChar, uint8_t _viewId)
{
- s_ctx.beginFrame(_mx, _my, _button, _width, _height, _inputChar, _viewId);
+ s_ctx.beginFrame(_mx, _my, _button, _scroll, _width, _height, _inputChar, _viewId);
}
void IMGUI_endFrame()
diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.h b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.h
index fd5d2503d9d..450b281767f 100644
--- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.h
@@ -12,7 +12,7 @@ namespace bx { struct AllocatorI; }
void IMGUI_create(const void* _data, uint32_t _size, float _fontSize, bx::AllocatorI* _allocator);
void IMGUI_destroy();
-void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId);
+void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, int _width, int _height, char _inputChar, uint8_t _viewId);
void IMGUI_endFrame();
#endif // OCORNUT_IMGUI_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/imgui/scintilla.cpp b/3rdparty/bgfx/examples/common/imgui/scintilla.cpp
new file mode 100644
index 00000000000..f9f0d06ea22
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/scintilla.cpp
@@ -0,0 +1,1128 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#if defined(SCI_NAMESPACE)
+
+#include <bx/bx.h>
+
+#include <algorithm>
+#include <map>
+
+#if BX_PLATFORM_EMSCRIPTEN
+# include <compat/ctype.h>
+#endif // BX_PLATFORM_EMSCRIPTEN
+
+#include <string>
+#include <vector>
+#include <string.h>
+
+#include "scintilla/include/Platform.h"
+#include "scintilla/include/Scintilla.h"
+#include "scintilla/include/ILexer.h"
+#include "scintilla/include/SciLexer.h"
+#include "scintilla/lexlib/LexerModule.h"
+#include "scintilla/src/SplitVector.h"
+#include "scintilla/src/Partitioning.h"
+#include "scintilla/src/RunStyles.h"
+#include "scintilla/src/Catalogue.h"
+#include "scintilla/src/ContractionState.h"
+#include "scintilla/src/CellBuffer.h"
+#include "scintilla/src/KeyMap.h"
+#include "scintilla/src/Indicator.h"
+#include "scintilla/src/XPM.h"
+#include "scintilla/src/LineMarker.h"
+#include "scintilla/src/Style.h"
+#include "scintilla/src/ViewStyle.h"
+#include "scintilla/src/Decoration.h"
+#include "scintilla/src/CharClassify.h"
+#include "scintilla/src/CaseFolder.h"
+#include "scintilla/src/Document.h"
+#include "scintilla/src/Selection.h"
+#include "scintilla/src/PositionCache.h"
+#include "scintilla/src/EditModel.h"
+#include "scintilla/src/MarginView.h"
+#include "scintilla/src/EditView.h"
+#include "scintilla/src/Editor.h"
+#include "scintilla/src/AutoComplete.h"
+#include "scintilla/src/CallTip.h"
+#include "scintilla/src/ScintillaBase.h"
+
+#include <bx/debug.h>
+#include <bx/macros.h>
+#include <bx/string.h>
+#include <bx/uint32_t.h>
+
+#define STBTT_DEF extern
+#include <stb/stb_truetype.h>
+
+#include "imgui.h"
+#include "../bgfx_utils.h"
+#include "scintilla.h"
+
+#include "../entry/input.h"
+
+#define IMGUI_NEW(type) new (ImGui::MemAlloc(sizeof(type) ) ) type
+#define IMGUI_DELETE(type, obj) reinterpret_cast<type*>(obj)->~type(), ImGui::MemFree(obj)
+
+static void fillRectangle(Scintilla::PRectangle _rc, Scintilla::ColourDesired _color)
+{
+ const uint32_t abgr = (uint32_t)_color.AsLong();
+
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+ drawList->AddDrawCmd();
+ drawList->AddRectFilled(
+ ImVec2(_rc.left + pos.x, _rc.top + pos.y)
+ , ImVec2(_rc.right + pos.x, _rc.bottom + pos.y)
+ , abgr
+ );
+}
+
+static inline uint32_t makeRgba(uint32_t r, uint32_t g, uint32_t b, uint32_t a = 0xFF)
+{
+ return a << 24 | b << 16 | g << 8 | r;
+}
+
+struct FontInt
+{
+ ImFont* m_font;
+ float m_scale;
+ float m_fontSize;
+};
+
+class SurfaceInt : public Scintilla::Surface
+{
+public:
+ SurfaceInt()
+ {
+ }
+
+ virtual ~SurfaceInt()
+ {
+ }
+
+ virtual void Init(Scintilla::WindowID /*_wid*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void Init(Scintilla::SurfaceID /*_sid*/, Scintilla::WindowID /*_wid*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void InitPixMap(int /*_width*/, int /*_height*/, Scintilla::Surface* /*_surface*/, Scintilla::WindowID /*_wid*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void Release() BX_OVERRIDE
+ {
+ }
+
+ virtual bool Initialised() BX_OVERRIDE
+ {
+ return true;
+ }
+
+ virtual void PenColour(Scintilla::ColourDesired /*_fore*/) BX_OVERRIDE
+ {
+ }
+
+ virtual int LogPixelsY() BX_OVERRIDE
+ {
+ return 72;
+ }
+
+ virtual int DeviceHeightFont(int /*points*/) BX_OVERRIDE
+ {
+ return 1500;
+ }
+
+ virtual void MoveTo(int _x, int _y) BX_OVERRIDE
+ {
+ BX_UNUSED(_x, _y);
+ }
+
+ virtual void LineTo(int _x, int _y) BX_OVERRIDE
+ {
+ BX_UNUSED(_x, _y);
+ }
+
+ virtual void Polygon(Scintilla::Point *pts, int npts, Scintilla::ColourDesired fore, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ BX_UNUSED(pts, npts, fore, back);
+ }
+
+ virtual void RectangleDraw(Scintilla::PRectangle rc, Scintilla::ColourDesired fore, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ BX_UNUSED(fore);
+
+ FillRectangle(rc, back);
+ }
+
+ virtual void FillRectangle(Scintilla::PRectangle rc, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ fillRectangle(rc, back);
+ }
+
+ virtual void FillRectangle(Scintilla::PRectangle rc, Scintilla::Surface& surfacePattern) BX_OVERRIDE
+ {
+ BX_UNUSED(rc, surfacePattern);
+ }
+
+ virtual void RoundedRectangle(Scintilla::PRectangle rc, Scintilla::ColourDesired fore, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ BX_UNUSED(rc, fore, back);
+ }
+
+ virtual void AlphaRectangle(Scintilla::PRectangle _rc, int /*_cornerSize*/, Scintilla::ColourDesired _fill, int _alphaFill, Scintilla::ColourDesired /*_outline*/, int /*_alphaOutline*/, int /*_flags*/) BX_OVERRIDE
+ {
+ unsigned int back = 0
+ | (uint32_t)( (_fill.AsLong() & 0xffffff)
+ | ( (_alphaFill & 0xff) << 24) )
+ ;
+
+ FillRectangle(_rc, Scintilla::ColourDesired(back) );
+ }
+
+
+ virtual void DrawRGBAImage(Scintilla::PRectangle /*_rc*/, int /*_width*/, int /*_height*/, const unsigned char* /*_pixelsImage*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void Ellipse(Scintilla::PRectangle rc, Scintilla::ColourDesired fore, Scintilla::ColourDesired /*back*/) BX_OVERRIDE
+ {
+ FillRectangle(rc, fore);
+ }
+
+ virtual void Copy(Scintilla::PRectangle /*_rc*/, Scintilla::Point /*_from*/, Scintilla::Surface& /*_surfaceSource*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void DrawTextNoClip(Scintilla::PRectangle rc, Scintilla::Font& _font, Scintilla::XYPOSITION ybase, const char *s, int len, Scintilla::ColourDesired fore, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ BX_UNUSED(back);
+ DrawTextBase(rc, _font, ybase, s, len, fore);
+ }
+
+ virtual void DrawTextClipped(Scintilla::PRectangle rc, Scintilla::Font& _font, Scintilla::XYPOSITION ybase, const char *s, int len, Scintilla::ColourDesired fore, Scintilla::ColourDesired back) BX_OVERRIDE
+ {
+ BX_UNUSED(back);
+ DrawTextBase(rc, _font, ybase, s, len, fore);
+ }
+
+ virtual void DrawTextTransparent(Scintilla::PRectangle rc, Scintilla::Font& _font, Scintilla::XYPOSITION ybase, const char *s, int len, Scintilla::ColourDesired fore) BX_OVERRIDE
+ {
+ DrawTextBase(rc, _font, ybase, s, len, fore);
+ }
+
+ virtual void MeasureWidths(Scintilla::Font& /*_font*/, const char* _str, int _len, Scintilla::XYPOSITION* _positions) BX_OVERRIDE
+ {
+ float position = 0;
+
+ ImFont* imFont = ImGui::GetWindowFont();
+
+ while (_len--)
+ {
+ position += imFont->GetCharAdvance( (unsigned short)*_str++);
+ *_positions++ = position;
+ }
+ }
+
+ virtual Scintilla::XYPOSITION WidthText(Scintilla::Font& /*_font*/, const char* _str, int _len) BX_OVERRIDE
+ {
+ ImVec2 t = ImGui::CalcTextSize(_str, _str + _len);
+ return t.x;
+ }
+
+ virtual Scintilla::XYPOSITION WidthChar(Scintilla::Font& _font, char ch) BX_OVERRIDE
+ {
+ FontInt* fi = (FontInt*)_font.GetID();
+ return fi->m_font->GetCharAdvance( (unsigned int)ch) * fi->m_scale;
+ }
+
+ virtual Scintilla::XYPOSITION Ascent(Scintilla::Font& _font) BX_OVERRIDE
+ {
+ FontInt* fi = (FontInt*)_font.GetID();
+ return fi->m_font->Ascent * fi->m_scale;
+ }
+
+ virtual Scintilla::XYPOSITION Descent(Scintilla::Font& _font) BX_OVERRIDE
+ {
+ FontInt* fi = (FontInt*)_font.GetID();
+ return -fi->m_font->Descent * fi->m_scale;
+ }
+
+ virtual Scintilla::XYPOSITION InternalLeading(Scintilla::Font& /*_font*/) BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ virtual Scintilla::XYPOSITION ExternalLeading(Scintilla::Font& /*_font*/) BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ virtual Scintilla::XYPOSITION Height(Scintilla::Font& _font) BX_OVERRIDE
+ {
+ return Ascent(_font) + Descent(_font);
+ }
+
+ virtual Scintilla::XYPOSITION AverageCharWidth(Scintilla::Font& _font) BX_OVERRIDE
+ {
+ return WidthChar(_font, 'n');
+ }
+
+ virtual void SetClip(Scintilla::PRectangle /*_rc*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void FlushCachedState() BX_OVERRIDE
+ {
+ }
+
+ virtual void SetUnicodeMode(bool /*_unicodeMode*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void SetDBCSMode(int /*_codePage*/) BX_OVERRIDE
+ {
+ }
+
+private:
+ void DrawTextBase(Scintilla::PRectangle _rc, Scintilla::Font& _font, float _ybase, const char* _str, int _len, Scintilla::ColourDesired _fore)
+ {
+ float xt = _rc.left;
+ float yt = _ybase;
+
+ uint32_t fore = (uint32_t)_fore.AsLong();
+ FontInt* fi = (FontInt*)_font.GetID();
+
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+ drawList->AddText(fi->m_font
+ , fi->m_fontSize
+ , ImVec2(xt + pos.x, yt + pos.y - fi->m_fontSize)
+ , fore
+ , _str
+ , _str + _len
+ );
+ }
+
+ Scintilla::ColourDesired m_penColour;
+};
+
+struct WindowInt
+{
+ WindowInt()
+ : m_show(false)
+ {
+ }
+
+ Scintilla::PRectangle position;
+ bool m_show;
+};
+
+WindowInt* AllocateWindowInt()
+{
+ return new WindowInt;
+}
+
+inline WindowInt* GetWindow(Scintilla::WindowID id)
+{
+ return (WindowInt*)id;
+}
+
+class ListBoxInt : public Scintilla::ListBox
+{
+public:
+ ListBoxInt()
+ : m_maxStrWidth(0)
+ , m_lineHeight(10)
+ , m_desiredVisibleRows(5)
+ , m_aveCharWidth(8)
+ , m_unicodeMode(false)
+ {
+ }
+
+ ~ListBoxInt()
+ {
+ }
+
+ virtual void SetFont(Scintilla::Font& /*_font*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void Create(Scintilla::Window& /*_parent*/, int /*_ctrlID*/, Scintilla::Point _location, int _lineHeight, bool _unicodeMode, int /*_technology*/) BX_OVERRIDE
+ {
+ m_location = _location;
+ m_lineHeight = _lineHeight;
+ m_unicodeMode = _unicodeMode;
+ m_maxStrWidth = 0;
+ wid = Scintilla::WindowID(4);
+ }
+
+ virtual void SetAverageCharWidth(int width) BX_OVERRIDE
+ {
+ m_aveCharWidth = width;
+ }
+
+ virtual void SetVisibleRows(int rows) BX_OVERRIDE
+ {
+ m_desiredVisibleRows = rows;
+ }
+
+ virtual int GetVisibleRows() const BX_OVERRIDE
+ {
+ return m_desiredVisibleRows;
+ }
+
+ virtual Scintilla::PRectangle GetDesiredRect() BX_OVERRIDE
+ {
+ Scintilla::PRectangle rc;
+ rc.top = 0;
+ rc.left = 0;
+ rc.right = 350;
+ rc.bottom = 140;
+ return rc;
+ }
+
+ virtual int CaretFromEdge() BX_OVERRIDE
+ {
+ return 4 + 16;
+ }
+
+ virtual void Clear() BX_OVERRIDE
+ {
+ }
+
+ virtual void Append(char* /*s*/, int /*type = -1*/) BX_OVERRIDE
+ {
+ }
+
+ virtual int Length() BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ virtual void Select(int /*n*/) BX_OVERRIDE
+ {
+ }
+
+ virtual int GetSelection() BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ virtual int Find(const char* /*prefix*/) BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ virtual void GetValue(int /*n*/, char* value, int /*len*/) BX_OVERRIDE
+ {
+ value[0] = '\0';
+ }
+
+ virtual void RegisterImage(int /*type*/, const char* /*xpm_data*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void RegisterRGBAImage(int /*type*/, int /*width*/, int /*height*/, const unsigned char* /*pixelsImage*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void ClearRegisteredImages() BX_OVERRIDE
+ {
+ }
+
+ virtual void SetDoubleClickAction(Scintilla::CallBackAction, void*) BX_OVERRIDE
+ {
+ }
+
+ virtual void SetList(const char* /*list*/, char /*separator*/, char /*typesep*/) BX_OVERRIDE
+ {
+ }
+
+private:
+ Scintilla::Point m_location;
+ size_t m_maxStrWidth;
+ int m_lineHeight;
+ int m_desiredVisibleRows;
+ int m_aveCharWidth;
+ bool m_unicodeMode;
+};
+
+struct Editor : public Scintilla::ScintillaBase
+{
+public:
+ Editor()
+ : m_width(0)
+ , m_height(0)
+ , m_searchResultIndication(0xff5A5A5A)
+ , m_filteredSearchResultIndication(0xff5a5a5a)
+ , m_occurrenceIndication(0xff5a5a5a)
+ , m_writeOccurrenceIndication(0xff5a5a5a)
+ , m_findScope(0xffddf0ff)
+ , m_sourceHoverBackground(0xff000000)
+ , m_singleLineComment(0xffa8a8a8)
+ , m_multiLineComment(0xffa8a8a8)
+ , m_commentTaskTag(0xffa8a8a8)
+ , m_javadoc(0xffa8a8a8)
+ , m_javadocLink(0xff548fa0)
+ , m_javadocTag(0xffa8a8a8)
+ , m_javadocKeyword(0xffea9c77)
+ , m_class(0xfff9f9f9)
+ , m_interface(0xfff9f9f9)
+ , m_method(0xfff9f9f9)
+ , m_methodDeclaration(0xfff9f9f9)
+ , m_bracket(0xfff9f9f9)
+ , m_number(0xfff9f9f9)
+ , m_string(0xff76ba53)
+ , m_operator(0xfff9f9f9)
+ , m_keyword(0xffea9c77)
+ , m_annotation(0xffa020f0)
+ , m_staticMethod(0xfff9f9f9)
+ , m_localVariable(0xff4b9ce9)
+ , m_localVariableDeclaration(0xff4b9ce9)
+ , m_field(0xff4b9ce9)
+ , m_staticField(0xff4b9ce9)
+ , m_staticFinalField(0xff4b9ce9)
+ , m_deprecatedMember(0xfff9f9f9)
+ , m_foreground(0xffffffff)
+ , m_lineNumber(0xff00ffff)
+ {
+ }
+
+ virtual ~Editor()
+ {
+ }
+
+ virtual void Initialise() BX_OVERRIDE
+ {
+ wMain = AllocateWindowInt();
+
+ ImGuiIO& io = ImGui::GetIO();
+ wMain.SetPosition(Scintilla::PRectangle::FromInts(0, 0, int(io.DisplaySize.x), int(io.DisplaySize.y) ) );
+
+ view.bufferedDraw = false;
+
+ command(SCI_SETLEXER, SCLEX_CPP);
+ command(SCI_SETSTYLEBITS, 7);
+
+ const int fontSize = 15;
+ const char* fontName = "";
+
+ setStyle(STYLE_DEFAULT, m_foreground, m_background, fontSize, fontName);
+ command(SCI_STYLECLEARALL);
+
+ setStyle(STYLE_INDENTGUIDE, 0xffc0c0c0, m_background, fontSize, fontName);
+ setStyle(STYLE_BRACELIGHT, m_bracket, m_background, fontSize, fontName);
+ setStyle(STYLE_BRACEBAD, m_bracket, m_background, fontSize, fontName);
+ setStyle(STYLE_LINENUMBER, m_lineNumber, 0xd0333333, fontSize, fontName);
+
+ setStyle(SCE_C_DEFAULT, m_foreground, m_background, fontSize, fontName);
+ setStyle(SCE_C_STRING, m_string, m_background);
+ setStyle(SCE_C_IDENTIFIER, m_method, m_background);
+ setStyle(SCE_C_CHARACTER, m_string, m_background);
+ setStyle(SCE_C_WORD, m_keyword, m_background);
+ setStyle(SCE_C_WORD2, m_keyword, m_background);
+ setStyle(SCE_C_GLOBALCLASS, m_class, m_background);
+ setStyle(SCE_C_PREPROCESSOR, m_annotation, m_background);
+ setStyle(SCE_C_NUMBER, m_number, m_background);
+ setStyle(SCE_C_OPERATOR, m_operator, m_background);
+ setStyle(SCE_C_COMMENT, m_multiLineComment, m_background);
+ setStyle(SCE_C_COMMENTLINE, m_singleLineComment, m_background);
+ setStyle(SCE_C_COMMENTDOC, m_multiLineComment, m_background);
+
+ command(SCI_SETSELBACK, 1, m_background.AsLong() );
+ command(SCI_SETCARETFORE, UINT32_MAX, 0);
+ command(SCI_SETCARETLINEVISIBLE, 1);
+ command(SCI_SETCARETLINEBACK, UINT32_MAX);
+ command(SCI_SETCARETLINEBACKALPHA, 0x20);
+
+ command(SCI_SETUSETABS, 1);
+ command(SCI_SETTABWIDTH, 4);
+ command(SCI_SETINDENTATIONGUIDES, SC_IV_REAL);
+
+ command(SCI_MARKERSETBACK, 0, 0xff6a6a6a);
+ command(SCI_MARKERSETFORE, 0, 0xff0000ff);
+
+ command(SCI_SETMARGINWIDTHN, 0, 44);
+ command(SCI_SETMARGINTYPEN, 1, SC_MARGIN_SYMBOL);
+ command(SCI_SETMARGINMASKN, 1, ~SC_MASK_FOLDERS);
+ command(SCI_RGBAIMAGESETSCALE, 100);
+ command(SCI_SETMARGINWIDTHN, 1, 0);
+ command(SCI_MARKERDEFINE, 0, SC_MARK_RGBAIMAGE);
+
+ SetFocusState(true);
+ CaretSetPeriod(0);
+ }
+
+ virtual void CreateCallTipWindow(Scintilla::PRectangle /*_rc*/) BX_OVERRIDE
+ {
+ if (!ct.wCallTip.Created() )
+ {
+ ct.wCallTip = AllocateWindowInt();
+ ct.wDraw = ct.wCallTip;
+ }
+ }
+
+ virtual void AddToPopUp(const char* /*_label*/, int /*_cmd*/, bool /*_enabled*/) BX_OVERRIDE
+ {
+ }
+
+ void Resize(int /*_x*/, int /*_y*/, int _width, int _height)
+ {
+ m_width = _width;
+ m_height = _height;
+
+ wMain.SetPosition(Scintilla::PRectangle::FromInts(0, 0, m_width, m_height) );
+ }
+
+ virtual void SetVerticalScrollPos() BX_OVERRIDE
+ {
+ }
+
+ virtual void SetHorizontalScrollPos() BX_OVERRIDE
+ {
+ xOffset = 0;
+ }
+
+ virtual bool ModifyScrollBars(int /*nMax*/, int /*nPage*/) BX_OVERRIDE
+ {
+ return false;
+ }
+
+ void ClaimSelection()
+ {
+ }
+
+ virtual void Copy() BX_OVERRIDE
+ {
+ }
+
+ virtual void Paste() BX_OVERRIDE
+ {
+ }
+
+ virtual void NotifyChange() BX_OVERRIDE
+ {
+ }
+
+ virtual void NotifyParent(Scintilla::SCNotification /*scn*/) BX_OVERRIDE
+ {
+ }
+
+ virtual void CopyToClipboard(const Scintilla::SelectionText& /*selectedText*/) BX_OVERRIDE
+ {
+ }
+
+
+ virtual void SetMouseCapture(bool /*on*/) BX_OVERRIDE
+ {
+ }
+
+ virtual bool HaveMouseCapture() BX_OVERRIDE
+ {
+ return false;
+ }
+
+ virtual sptr_t DefWndProc(unsigned int /*iMessage*/, uptr_t /*wParam*/, sptr_t /*lParam*/) BX_OVERRIDE
+ {
+ return 0;
+ }
+
+ intptr_t command(unsigned int _msg, uintptr_t _p0 = 0, intptr_t _p1 = 0)
+ {
+ return WndProc(_msg, _p0, _p1);
+ }
+
+ void draw()
+ {
+ ImVec2 cursorPos = ImGui::GetCursorPos();
+ ImVec2 regionMax = ImGui::GetWindowContentRegionMax();
+ ImVec2 size = ImVec2( regionMax.x - cursorPos.x - 32
+ , regionMax.y - cursorPos.y
+ );
+
+ Resize(0, 0, (int)size.x, (int)size.y);
+
+ uint8_t modifiers = inputGetModifiersState();
+ const bool shift = 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) );
+ const bool ctrl = 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) );
+ const bool alt = 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) );
+
+ if (ImGui::IsKeyPressed(entry::Key::Tab) )
+ {
+ Editor::KeyDown(SCK_TAB, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Left) )
+ {
+ Editor::KeyDown(SCK_LEFT, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Right) )
+ {
+ Editor::KeyDown(SCK_RIGHT, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Up) )
+ {
+ Editor::KeyDown(SCK_UP, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Down) )
+ {
+ Editor::KeyDown(SCK_DOWN, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::PageUp) )
+ {
+ Editor::KeyDown(SCK_PRIOR, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::PageDown) )
+ {
+ Editor::KeyDown(SCK_NEXT, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Home) )
+ {
+ Editor::KeyDown(SCK_HOME, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::End) )
+ {
+ Editor::KeyDown(SCK_END, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Delete) )
+ {
+ Editor::KeyDown(SCK_DELETE, shift, ctrl, alt);
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Backspace) )
+ {
+ Editor::KeyDown(SCK_BACK, shift, ctrl, alt); inputGetChar();
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Return) )
+ {
+ Editor::KeyDown(SCK_RETURN, shift, ctrl, alt); inputGetChar();
+ }
+ else if (ImGui::IsKeyPressed(entry::Key::Esc) )
+ {
+ Editor::KeyDown(SCK_ESCAPE, shift, ctrl, alt);
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyA) )
+ {
+ Editor::KeyDown('A', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyC) )
+ {
+ Editor::KeyDown('C', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyV) )
+ {
+ Editor::KeyDown('V', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyX) )
+ {
+ Editor::KeyDown('X', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyY) )
+ {
+ Editor::KeyDown('Y', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl && ImGui::IsKeyPressed(entry::Key::KeyZ) )
+ {
+ Editor::KeyDown('Z', shift, ctrl, alt); inputGetChar();
+ }
+ else if (ctrl || alt)
+ {
+ // ignore...
+ }
+ else
+ {
+ for (const uint8_t* ch = inputGetChar(); NULL != ch; ch = inputGetChar() )
+ {
+ switch (*ch)
+ {
+ case '\b': Editor::KeyDown(SCK_BACK, shift, ctrl, alt); break;
+ case '\n': Editor::KeyDown(SCK_RETURN, shift, ctrl, alt); break;
+ default: Editor::AddCharUTF( (const char*)ch, 1); break;
+ }
+ }
+ }
+
+ int32_t lineCount = int32_t(command(SCI_GETLINECOUNT) );
+ int32_t firstVisibleLine = int32_t(command(SCI_GETFIRSTVISIBLELINE) );
+ float fontHeight = ImGui::GetWindowFontSize();
+
+ if (ImGui::IsMouseClicked(0) )
+ {
+ ImGuiIO& io = ImGui::GetIO();
+ Scintilla::Point pt = Scintilla::Point::FromInts( (int)io.MouseClickedPos[0].x, (int)io.MouseClickedPos[0].y);
+
+ ButtonDown(pt, (unsigned int)io.MouseDownDuration[0], false, false, false);
+ }
+
+ Tick();
+
+ ImGui::BeginGroup();
+ ImGui::BeginChild("##editor", ImVec2(size.x, size.y-20) );
+ Scintilla::AutoSurface surfaceWindow(this);
+ if (surfaceWindow)
+ {
+ Paint(surfaceWindow, GetClientRectangle() );
+ surfaceWindow->Release();
+ }
+ ImGui::EndChild();
+
+ ImGui::SameLine();
+
+ ImGui::BeginChild("##scroll");
+ ImGuiListClipper clipper;
+ clipper.Begin(lineCount, fontHeight*2.0f);
+
+ if (m_lastFirstVisibleLine != firstVisibleLine)
+ {
+ m_lastFirstVisibleLine = firstVisibleLine;
+ ImGui::SetScrollY(firstVisibleLine * fontHeight*2.0f);
+ }
+ else if (firstVisibleLine != clipper.DisplayStart)
+ {
+ command(SCI_SETFIRSTVISIBLELINE, clipper.DisplayStart);
+ }
+
+ clipper.End();
+ ImGui::EndChild();
+
+ ImGui::EndGroup();
+ }
+
+ void setStyle(int style, Scintilla::ColourDesired fore, Scintilla::ColourDesired back = UINT32_MAX, int size = -1, const char* face = NULL)
+ {
+ command(SCI_STYLESETFORE, uptr_t(style), fore.AsLong() );
+ command(SCI_STYLESETBACK, uptr_t(style), back.AsLong() );
+
+ if (size >= 1)
+ {
+ command(SCI_STYLESETSIZE, uptr_t(style), size);
+ }
+
+ if (face)
+ {
+ command(SCI_STYLESETFONT, uptr_t(style), reinterpret_cast<sptr_t>(face) );
+ }
+ }
+
+private:
+ int m_width;
+ int m_height;
+ int m_lastFirstVisibleLine;
+
+ Scintilla::ColourDesired m_searchResultIndication;
+ Scintilla::ColourDesired m_filteredSearchResultIndication;
+ Scintilla::ColourDesired m_occurrenceIndication;
+ Scintilla::ColourDesired m_writeOccurrenceIndication;
+ Scintilla::ColourDesired m_findScope;
+ Scintilla::ColourDesired m_sourceHoverBackground;
+ Scintilla::ColourDesired m_singleLineComment;
+ Scintilla::ColourDesired m_multiLineComment;
+ Scintilla::ColourDesired m_commentTaskTag;
+ Scintilla::ColourDesired m_javadoc;
+ Scintilla::ColourDesired m_javadocLink;
+ Scintilla::ColourDesired m_javadocTag;
+ Scintilla::ColourDesired m_javadocKeyword;
+ Scintilla::ColourDesired m_class;
+ Scintilla::ColourDesired m_interface;
+ Scintilla::ColourDesired m_method;
+ Scintilla::ColourDesired m_methodDeclaration;
+ Scintilla::ColourDesired m_bracket;
+ Scintilla::ColourDesired m_number;
+ Scintilla::ColourDesired m_string;
+ Scintilla::ColourDesired m_operator;
+ Scintilla::ColourDesired m_keyword;
+ Scintilla::ColourDesired m_annotation;
+ Scintilla::ColourDesired m_staticMethod;
+ Scintilla::ColourDesired m_localVariable;
+ Scintilla::ColourDesired m_localVariableDeclaration;
+ Scintilla::ColourDesired m_field;
+ Scintilla::ColourDesired m_staticField;
+ Scintilla::ColourDesired m_staticFinalField;
+ Scintilla::ColourDesired m_deprecatedMember;
+ Scintilla::ColourDesired m_background;
+ Scintilla::ColourDesired m_currentLine;
+ Scintilla::ColourDesired m_foreground;
+ Scintilla::ColourDesired m_lineNumber;
+ Scintilla::ColourDesired m_selectionBackground;
+ Scintilla::ColourDesired m_selectionForeground;
+};
+
+ScintillaEditor* ScintillaEditor::create(int _width, int _height)
+{
+ Editor* editor = IMGUI_NEW(Editor);
+
+ editor->Initialise();
+ editor->Resize(0, 0, _width, _height);
+
+ return reinterpret_cast<ScintillaEditor*>(editor);
+}
+
+void ScintillaEditor::destroy(ScintillaEditor* _scintilla)
+{
+ IMGUI_DELETE(Editor, _scintilla);
+}
+
+intptr_t ScintillaEditor::command(unsigned int _msg, uintptr_t _p0, intptr_t _p1)
+{
+ Editor* editor = reinterpret_cast<Editor*>(this);
+ return editor->command(_msg, _p0, _p1);
+}
+
+void ScintillaEditor::draw()
+{
+ Editor* editor = reinterpret_cast<Editor*>(this);
+ return editor->draw();
+}
+
+// Scintilla hooks
+namespace Scintilla
+{
+ Font::Font()
+ : fid(0)
+ {
+ }
+
+ Font::~Font()
+ {
+ }
+
+ void Font::Create(const FontParameters& fp)
+ {
+ FontInt* newFont = (FontInt*)ImGui::MemAlloc(sizeof(FontInt) );
+ fid = newFont;
+ newFont->m_font = ImGui::GetIO().Fonts->Fonts[0];
+ newFont->m_fontSize = fp.size;
+ newFont->m_scale = fp.size / newFont->m_font->FontSize;
+ }
+
+ void Font::Release()
+ {
+ if (fid)
+ {
+ ImGui::MemFree( (FontInt*)fid);
+ }
+ }
+
+ ColourDesired Platform::Chrome()
+ {
+ return makeRgba(0xe0, 0xe0, 0xe0);
+ }
+
+ ColourDesired Platform::ChromeHighlight()
+ {
+ return makeRgba(0xff, 0xff, 0xff);
+ }
+
+ const char* Platform::DefaultFont()
+ {
+ return "";
+ }
+
+ int Platform::DefaultFontSize()
+ {
+ return 15;
+ }
+
+ unsigned int Platform::DoubleClickTime()
+ {
+ return 500;
+ }
+
+ bool Platform::MouseButtonBounce()
+ {
+ return true;
+ }
+
+ void Platform::Assert(const char* _error, const char* _filename, int _line)
+ {
+ DebugPrintf("%s(%d): %s", _filename, _line, _error);
+ }
+
+ int Platform::Minimum(int a, int b)
+ {
+ return (int)bx::uint32_imin(a, b);
+ }
+
+ int Platform::Maximum(int a, int b)
+ {
+ return (int)bx::uint32_imax(a, b);
+ }
+
+ int Platform::Clamp(int val, int minVal, int maxVal)
+ {
+ return (int)bx::uint32_iclamp(val, minVal, maxVal);
+ }
+
+ void Platform::DebugPrintf(const char* _format, ...)
+ {
+ char temp[8192];
+ char* out = temp;
+ va_list argList;
+ va_start(argList, _format);
+ int32_t len = bx::vsnprintf(out, sizeof(temp), _format, argList);
+ if ( (int32_t)sizeof(temp) < len)
+ {
+ out = (char*)alloca(len+1);
+ len = bx::vsnprintf(out, len, _format, argList);
+ }
+ va_end(argList);
+ out[len] = '\0';
+ bx::debugOutput(out);
+ }
+
+ Menu::Menu()
+ : mid(0)
+ {
+ }
+
+ void Menu::CreatePopUp()
+ {
+ Destroy();
+ mid = MenuID(1);
+ }
+
+ void Menu::Destroy()
+ {
+ mid = 0;
+ }
+
+ void Menu::Show(Point /*_pt*/, Window& /*_w*/)
+ {
+ Destroy();
+ }
+
+ Surface* Surface::Allocate(int)
+ {
+ return IMGUI_NEW(SurfaceInt);
+ }
+
+ Window::~Window()
+ {
+ }
+
+ void Window::Destroy()
+ {
+ if (wid)
+ {
+ Show(false);
+ WindowInt* wi = GetWindow(wid);
+ IMGUI_DELETE(WindowInt, wi);
+ }
+
+ wid = 0;
+ }
+
+ bool Window::HasFocus()
+ {
+ return true;
+ }
+
+ PRectangle Window::GetPosition()
+ {
+ if (0 == wid)
+ {
+ return PRectangle();
+ }
+
+ return GetWindow(wid)->position;
+ }
+
+ void Window::SetPosition(PRectangle rc)
+ {
+ GetWindow(wid)->position = rc;
+ }
+
+ void Window::SetPositionRelative(PRectangle _rc, Window /*_w*/)
+ {
+ SetPosition(_rc);
+ }
+
+ PRectangle Window::GetClientPosition()
+ {
+ if (0 == wid)
+ {
+ return PRectangle();
+ }
+
+ return GetWindow(wid)->position;
+ }
+
+ void Window::Show(bool _show)
+ {
+ if (0 != wid)
+ {
+ GetWindow(wid)->m_show = _show;
+ }
+ }
+
+ void Window::InvalidateAll()
+ {
+ }
+
+ void Window::InvalidateRectangle(PRectangle /*_rc*/)
+ {
+ }
+
+ void Window::SetFont(Font& /*_font*/)
+ {
+ }
+
+ void Window::SetCursor(Cursor /*_curs*/)
+ {
+ cursorLast = cursorText;
+ }
+
+ void Window::SetTitle(const char* /*_str*/)
+ {
+ }
+
+ PRectangle Window::GetMonitorRect(Point /*_pt*/)
+ {
+ return PRectangle();
+ }
+
+ ListBox::ListBox()
+ {
+ }
+
+ ListBox::~ListBox()
+ {
+ }
+
+ ListBox* ListBox::Allocate()
+ {
+ return IMGUI_NEW(ListBoxInt);
+ }
+
+} // namespace Scintilla
+
+ScintillaEditor* ImGuiScintilla(const char* _name, bool* _opened, const ImVec2& _size)
+{
+ ScintillaEditor* sci = NULL;
+
+// if (ImGui::Begin(_name, _opened, _size) )
+ {
+ ImGuiStorage* storage = ImGui::GetStateStorage();
+
+ ImGuiID id = ImGui::GetID(_name);
+ sci = (ScintillaEditor*)storage->GetVoidPtr(id);
+ if (NULL == sci)
+ {
+ ImVec2 size = ImGui::GetWindowSize();
+ sci = ScintillaEditor::create(size.x, size.y);
+ storage->SetVoidPtr(id, (void*)sci);
+ }
+
+ sci->draw();
+ }
+
+// ImGui::End();
+ return sci;
+}
+
+#endif // defined(SCI_NAMESPACE)
diff --git a/3rdparty/bgfx/examples/common/imgui/scintilla.h b/3rdparty/bgfx/examples/common/imgui/scintilla.h
new file mode 100644
index 00000000000..d57362e941f
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/scintilla.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#ifndef SCINTILLA_H_HEADER_GUARD
+#define SCINTILLA_H_HEADER_GUARD
+
+#if defined(SCI_NAMESPACE)
+
+#include <scintilla/include/Scintilla.h>
+
+struct ScintillaEditor
+{
+ static ScintillaEditor* create(int _width, int _height);
+ static void destroy(ScintillaEditor* _scintilla);
+
+ intptr_t command(unsigned int _message, uintptr_t _p0 = 0, intptr_t _p1 = 0);
+ void draw();
+};
+
+ScintillaEditor* ImGuiScintilla(const char* _name, bool* _opened, const ImVec2& _size);
+
+#endif // defined(SCI_NAMESPACE)
+
+#endif // SCINTILLA_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
index 92a5f911442..4867ea1a86c 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_color.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_imgui_color_glsl[324] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x24, 0x01, 0x00, 0x00, 0x61, // wProj......$...a
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x24, 0x01, 0x00, 0x00, 0x61, // wProj......$...a
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v
0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color0;.at
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve
@@ -24,8 +24,8 @@ static const uint8_t vs_imgui_color_glsl[324] =
};
static const uint8_t vs_imgui_color_dx9[290] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
@@ -46,8 +46,8 @@ static const uint8_t vs_imgui_color_dx9[290] =
};
static const uint8_t vs_imgui_color_dx11[465] =
{
- 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0xac, 0x01, 0x44, 0x58, 0x42, // wProj........DXB
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0xac, 0x01, 0x44, 0x58, 0x42, // wProj........DXB
0x43, 0xbc, 0xb2, 0x28, 0xa7, 0xd2, 0xab, 0xc3, 0x2f, 0xa4, 0xe4, 0xbc, 0x67, 0xff, 0xa4, 0xcf, // C..(..../...g...
0x66, 0x01, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // f............,..
0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, 0x00, // .|.......ISGNH..
@@ -77,3 +77,47 @@ static const uint8_t vs_imgui_color_dx11[465] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x05, 0x00, 0x01, 0x00, 0x40, // .....>.........@
0x00, // .
};
+static const uint8_t vs_imgui_color_mtl[653] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH....I..~...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // bute(1)]];.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // erOutput {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // at4 gl_Position
+ 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // [[position]];.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // float4 v_color0;
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, // {. float4x4 u_v
+ 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, // iewProj;.};.vert
+ 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // ex xlatMtlShader
+ 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // Output xlatMtlMa
+ 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // in (xlatMtlShade
+ 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, // rInput _mtl_i [[
+ 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, // stage_in]], cons
+ 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // tant xlatMtlShad
+ 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // erUniform& _mtl_
+ 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, // u [[buffer(0)]])
+ 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // .{. xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, // erOutput _mtl_o;
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // . float4 tmpvar
+ 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, // _1;. tmpvar_1.z
+ 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, // w = float2(0.0,
+ 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 1.0);. tmpvar_1
+ 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, // .xy = _mtl_i.a_p
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // osition.xy;. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // tl_o.gl_Position
+ 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, // = (_mtl_u.u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wProj * tmpvar_1
+ 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, // );. _mtl_o.v_co
+ 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, // lor0 = _mtl_i.a_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, // color0;. return
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
index 1a5f9a2fd8e..6467376b5a7 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_imgui_cubemap_glsl[329] =
{
- 0x56, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x24, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // $...attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, // ghp vec4 a_norma
0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // l;.attribute hig
@@ -24,8 +24,8 @@ static const uint8_t vs_imgui_cubemap_glsl[329] =
};
static const uint8_t vs_imgui_cubemap_dx9[319] =
{
- 0x56, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -47,8 +47,8 @@ static const uint8_t vs_imgui_cubemap_dx9[319] =
};
static const uint8_t vs_imgui_cubemap_dx11[510] =
{
- 0x56, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0xd4, 0x01, 0x44, 0x58, 0x42, 0x43, 0x6e, 0xf2, 0xe5, 0x72, 0xab, 0xb8, 0x0f, 0x91, 0xad, 0x8f, // ..DXBCn..r......
0x4c, 0xdf, 0x0e, 0x04, 0x3e, 0x81, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, // L...>...........
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...|.......IS
@@ -80,3 +80,47 @@ static const uint8_t vs_imgui_cubemap_dx11[510] =
0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, // ..r ......F.....
0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x00, 0x01, 0x00, 0x40, 0x00, // ..>.........@.
};
+static const uint8_t vs_imgui_cubemap_mtl[651] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH....e..|...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // . float4 a_norm
+ 0x61, 0x6c, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // al [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // bute(1)]];.};.st
+ 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // erOutput {. flo
+ 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // at4 gl_Position
+ 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // [[position]];.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, // float3 v_normal;
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, // {. float4x4 u_m
+ 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, // odelViewProj;.};
+ 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .vertex xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, // tl_o;. float4 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva
+ 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // r_1.w = 1.0;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // mpvar_1.xyz = _m
+ 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // tl_i.a_position;
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // . _mtl_o.gl_Pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ition = (_mtl_u.
+ 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, // u_modelViewProj
+ 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // * tmpvar_1);. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, // mtl_o.v_normal =
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // _mtl_i.a_normal
+ 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, // .xyz;. return _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
index 62b917d1028..b34b38c4122 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_imgui_image_glsl[336] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x61, // wProj......0...a
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x61, // wProj......0...a
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v
0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;.
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // attribute highp
@@ -24,8 +24,8 @@ static const uint8_t vs_imgui_image_glsl[336] =
};
static const uint8_t vs_imgui_image_dx9[290] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0xfe, // wProj...........
0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
@@ -46,8 +46,8 @@ static const uint8_t vs_imgui_image_dx9[290] =
};
static const uint8_t vs_imgui_image_dx11[473] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0xb4, 0x01, 0x44, 0x58, 0x42, // wProj........DXB
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0xb4, 0x01, 0x44, 0x58, 0x42, // wProj........DXB
0x43, 0x62, 0x0c, 0x7d, 0x32, 0x98, 0x4b, 0xbb, 0x29, 0xce, 0xaa, 0xb2, 0xca, 0x5d, 0xc9, 0x55, // Cb.}2.K.)....].U
0xf0, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .............,..
0x00, 0x80, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, // .........ISGNL..
@@ -77,3 +77,48 @@ static const uint8_t vs_imgui_image_dx11[473] =
0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, // .....F.......>..
0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // .......@.
};
+static const uint8_t vs_imgui_image_mtl[665] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH.o.><......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float3 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, // (0)]];. float2
+ 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, // a_texcoord0 [[at
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, // tribute(1)]];.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, // haderOutput {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // float4 gl_Positi
+ 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, // on [[position]];
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . float2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // oord0;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, // xlatMtlShaderUn
+ 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // iform {. float4
+ 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, // x4 u_viewProj;.}
+ 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ;.vertex xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, // ShaderOutput xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // tMtlMain (xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, // lShaderInput _mt
+ 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, // l_i [[stage_in]]
+ 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // , constant xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, // tlShaderUniform&
+ 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, // _mtl_u [[buffer
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // (0)]]).{. xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, // tlShaderOutput _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // mtl_o;. float4
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_1;. tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // ar_1.zw = float2
+ 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // (0.0, 1.0);. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // pvar_1.xy = _mtl
+ 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, // _i.a_position.xy
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // ;. _mtl_o.gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // sition = (_mtl_u
+ 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // .u_viewProj * tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // pvar_1);. _mtl_
+ 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, // o.v_texcoord0 =
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _mtl_i.a_texcoor
+ 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, // d0;. return _mt
+ 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // l_o;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
index 7ef94533262..8b84198ba33 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_imgui_latlong_glsl[337] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0x2c, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ,...attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ghp vec3 a_posit
0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, // ion;.attribute h
@@ -25,8 +25,8 @@ static const uint8_t vs_imgui_latlong_glsl[337] =
};
static const uint8_t vs_imgui_latlong_dx9[319] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -48,8 +48,8 @@ static const uint8_t vs_imgui_latlong_dx9[319] =
};
static const uint8_t vs_imgui_latlong_dx11[518] =
{
- 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0xdc, 0x01, 0x44, 0x58, 0x42, 0x43, 0x0b, 0x6a, 0x72, 0xae, 0x8a, 0xf0, 0xc5, 0xba, 0x55, 0x23, // ..DXBC.jr.....U#
0xc7, 0x67, 0xc5, 0xc7, 0xe9, 0x83, 0x01, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x03, 0x00, // .g..............
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
@@ -82,3 +82,48 @@ static const uint8_t vs_imgui_latlong_dx11[518] =
0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>.....
0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ....@.
};
+static const uint8_t vs_imgui_latlong_mtl[659] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x84, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH.o.><......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float3 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, // (0)]];. float2
+ 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, // a_texcoord0 [[at
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, // tribute(1)]];.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, // haderOutput {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // float4 gl_Positi
+ 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, // on [[position]];
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . float2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // oord0;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, // xlatMtlShaderUn
+ 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // iform {. float4
+ 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // x4 u_modelViewPr
+ 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, // oj;.};.vertex xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, // t xlatMtlMain (x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, // latMtlShaderInpu
+ 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, // t _mtl_i [[stage
+ 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, // _in]], constant
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, // xlatMtlShaderUni
+ 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, // form& _mtl_u [[b
+ 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // uffer(0)]]).{.
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, // xlatMtlShaderOut
+ 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // put _mtl_o;. fl
+ 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // oat4 tmpvar_1;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, // tmpvar_1.w = 1.
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // 0;. tmpvar_1.xy
+ 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, // z = _mtl_i.a_pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, // ition;. _mtl_o.
+ 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, // gl_Position = (_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // mtl_u.u_modelVie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wProj * tmpvar_1
+ 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, // );. _mtl_o.v_te
+ 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, // xcoord0 = _mtl_i
+ 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, // .a_texcoord0;.
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, // return _mtl_o;.}
+ 0x0a, 0x0a, 0x00, // ...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
index 805a05eae85..a5c839c5c08 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_texture.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_imgui_texture_glsl[419] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x83, 0x01, 0x00, 0x00, 0x61, // wProj..........a
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x83, 0x01, 0x00, 0x00, 0x61, // wProj..........a
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v
0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color0;.at
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve
@@ -30,8 +30,8 @@ static const uint8_t vs_imgui_texture_glsl[419] =
};
static const uint8_t vs_imgui_texture_dx9[326] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, 0x28, 0x01, 0x00, 0x03, 0xfe, // wProj......(....
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x28, 0x01, 0x00, 0x03, 0xfe, // wProj......(....
0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // ...".CTAB....S..
0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, // ................
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .L...0..........
@@ -54,8 +54,8 @@ static const uint8_t vs_imgui_texture_dx9[326] =
};
static const uint8_t vs_imgui_texture_dx11[575] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x18, 0x02, 0x44, 0x58, 0x42, // wProj........DXB
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x18, 0x02, 0x44, 0x58, 0x42, // wProj........DXB
0x43, 0x02, 0x1b, 0xea, 0x24, 0x10, 0xd8, 0x6f, 0x23, 0xf5, 0xf6, 0x01, 0x38, 0x5b, 0x08, 0x13, // C...$..o#...8[..
0x4d, 0x01, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // M............,..
0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, // .........ISGNh..
@@ -91,3 +91,54 @@ static const uint8_t vs_imgui_texture_dx11[575] =
0x05, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, // .2 ......F......
0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // .>...........@.
};
+static const uint8_t vs_imgui_texture_mtl[757] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0xe6, 0x02, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at2 a_texcoord0
+ 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, // [[attribute(2)]]
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // {. float4 gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio
+ 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, // n]];. float4 v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // color0;. float2
+ 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, // v_texcoord0;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, // haderUniform {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // float4x4 u_view
+ 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, // Proj;.};.vertex
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, // xlatMtlShaderOut
+ 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, // put xlatMtlMain
+ 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, // (xlatMtlShaderIn
+ 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, // put _mtl_i [[sta
+ 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, // ge_in]], constan
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, // t xlatMtlShaderU
+ 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, // niform& _mtl_u [
+ 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, // [buffer(0)]]).{.
+ 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, // xlatMtlShaderO
+ 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, // utput _mtl_o;.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // float4 tmpvar_1;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw =
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // float2(0.0, 1.0
+ 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // );. tmpvar_1.xy
+ 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // = _mtl_i.a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // tion.xy;. _mtl_
+ 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // o.gl_Position =
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, // (_mtl_u.u_viewPr
+ 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, // oj * tmpvar_1);.
+ 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // _mtl_o.v_texco
+ 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, // ord0 = _mtl_i.a_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // texcoord0;. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x5f, // l_o.v_color0 = _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // mtl_i.a_color0;.
+ 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, // return _mtl_o;
+ 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}...
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
index 5473ca3affc..ba968aaa2a6 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
+++ b/3rdparty/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_ocornut_imgui_glsl[523] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0xea, 0x01, 0x00, 0x00, // wTexel..........
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0xea, 0x01, 0x00, 0x00, // wTexel..........
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // attribute highp
0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, // vec4 a_color0;.a
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v
@@ -36,8 +36,8 @@ static const uint8_t vs_ocornut_imgui_glsl[523] =
};
static const uint8_t vs_ocornut_imgui_dx9[367] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, // wTexel......P...
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x50, 0x01, 0x00, 0x03, // wTexel......P...
0xfe, 0xff, 0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, // ....".CTAB....S.
0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, // ................
0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, // ..L...0.........
@@ -62,8 +62,8 @@ static const uint8_t vs_ocornut_imgui_dx9[367] =
};
static const uint8_t vs_ocornut_imgui_dx11[612] =
{
- 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x3c, 0x02, 0x44, 0x58, // wTexel......<.DX
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x3c, 0x02, 0x44, 0x58, // wTexel......<.DX
0x42, 0x43, 0x22, 0x5c, 0xcc, 0x36, 0x58, 0xb2, 0x23, 0x45, 0x8a, 0x2b, 0xbd, 0x13, 0xac, 0xf2, // BC"..6X.#E.+....
0xa4, 0x09, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // ......<.......,.
0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, // ..........ISGNh.
@@ -102,3 +102,60 @@ static const uint8_t vs_ocornut_imgui_dx11[612] =
0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, // ......>.........
0x10, 0x00, 0x10, 0x00, // ....
};
+static const uint8_t vs_ocornut_imgui_mtl[854] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0x75, 0x73, // VSH.......G...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // )]];. float3 a_
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, // position [[attri
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, // bute(1)]];. flo
+ 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // at2 a_texcoord0
+ 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, // [[attribute(2)]]
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // {. float4 gl_Po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // sition [[positio
+ 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, // n]];. float4 v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // color0;. float2
+ 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, // v_texcoord0;.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, // haderUniform {.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x54, 0x65, // float4 u_viewTe
+ 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, // xel;.};.vertex x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, // latMtlShaderOutp
+ 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, // ut xlatMtlMain (
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, // xlatMtlShaderInp
+ 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, // ut _mtl_i [[stag
+ 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, // e_in]], constant
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, // xlatMtlShaderUn
+ 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, // iform& _mtl_u [[
+ 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // buffer(0)]]).{.
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, // tput _mtl_o;. f
+ 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // loat2 tmpvar_1;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x32, // tmpvar_1 = ((2
+ 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, // .0 * _mtl_i.a_po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, // sition.xy) * _mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, // l_u.u_viewTexel.
+ 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, // xy);. float4 tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_2;. tmpvar
+ 0x5f, 0x32, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, // _2.zw = float2(0
+ 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .0, 1.0);. tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ar_2.x = (tmpvar
+ 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // _1.x - 1.0);. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, // mpvar_2.y = (1.0
+ 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x3b, 0x0a, // - tmpvar_1.y);.
+ 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // _mtl_o.gl_Posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // tion = tmpvar_2;
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . _mtl_o.v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, // oord0 = _mtl_i.a
+ 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // _texcoord0;. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // tl_o.v_color0 =
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // _mtl_i.a_color0;
+ 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // . return _mtl_o
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}...
+};
diff --git a/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h b/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
index 8cde7985315..f2de36d49ad 100644
--- a/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
+++ b/3rdparty/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h
@@ -1,14 +1,14 @@
static const uint8_t fs_nanovg_fill_glsl[3095] =
{
- 0x46, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, // FSH........u_sci
- 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, // ssorMat.......u_
- 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, // paintMat.......u
- 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, // _innerCol.......
- 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, // u_outerCol......
+ 0x46, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, // FSH........u_sci
+ 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, // ssorMat.......u_
+ 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, // paintMat.......u
+ 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, // _innerCol.......
+ 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, // u_outerCol......
0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, // .u_scissorExtSca
- 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // le.......u_exten
- 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, // tRadius.......u_
- 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, // params.......s_t
+ 0x6c, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // le.......u_exten
+ 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, // tRadius.......u_
+ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, // params.......s_t
0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x7a, 0x0b, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, // ex......z...vary
0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, // ing highp vec2 v
0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // _position;.varyi
@@ -195,248 +195,475 @@ static const uint8_t fs_nanovg_fill_glsl[3095] =
0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // gColor = result_
0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 1;.}...
};
-static const uint8_t fs_nanovg_fill_dx9[1531] =
+static const uint8_t fs_nanovg_fill_dx9[1543] =
{
- 0x46, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x07, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, // FSH........u_ext
- 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x17, 0x01, 0x09, 0x00, 0x01, 0x00, 0x0a, // entRadius.......
- 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x17, 0x01, 0x06, 0x00, 0x01, 0x00, // u_innerCol......
- 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x17, 0x01, 0x07, 0x00, 0x01, // .u_outerCol.....
- 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x18, 0x01, 0x03, 0x00, // ..u_paintMat....
- 0x03, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x17, 0x01, 0x0a, 0x00, 0x01, // ...u_params.....
- 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, // ..u_scissorExtSc
- 0x61, 0x6c, 0x65, 0x17, 0x01, 0x08, 0x00, 0x01, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, // ale.......u_scis
- 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x18, 0x01, 0x00, 0x00, 0x03, 0x00, 0x6c, 0x05, 0x00, 0x03, // sorMat......l...
- 0xff, 0xff, 0xfe, 0xff, 0x63, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x01, // ....c.CTAB....W.
- 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, // ................
- 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ..P.............
- 0x02, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x02, 0x00, // ................
- 0x09, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, // ................
- 0x00, 0x00, 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, // ................
- 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........(.....
- 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x01, // ..............1.
- 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x43, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x01, // ..C.............
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, 0x04, 0x00, // ......s_tex.....
- 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_
- 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0xab, 0x01, 0x00, // extentRadius....
- 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_
- 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, // innerCol.u_outer
- 0x43, 0x6f, 0x6c, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x00, 0xab, // Col.u_paintMat..
- 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, // ..u_params.u_sci
- 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x75, 0x5f, 0x73, // ssorExtScale.u_s
- 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, // cissorMat.ps_3_0
- 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H
- 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi
- 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, // ler 9.29.952.311
- 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // 1.Q..........?..
- 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0c, 0x00, // .@.......?Q.....
- 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, // .........?..@@..
- 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, // ................
- 0x00, 0x02, 0x05, 0x00, 0x01, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................
- 0x00, 0x90, 0x0b, 0x00, 0x55, 0xa0, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U...........
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x8c, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0a, 0x00, 0x55, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U.......
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x01, 0x80, 0x01, 0x00, 0x55, 0x90, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ....U...........
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x06, 0x80, 0x04, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ........U.......
- 0x06, 0x80, 0x03, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
- 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xd0, 0xa0, 0x06, 0x00, // ................
- 0x00, 0x02, 0x01, 0x00, 0x01, 0x80, 0x09, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, // ................
- 0x02, 0x80, 0x09, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, // ....U...........
- 0xe9, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ................
- 0x44, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0c, 0x80, 0x00, 0x00, // D...U...........
- 0x44, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // D...............
- 0x0c, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x44, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ........D.......
- 0x0c, 0x80, 0x01, 0x00, 0xe4, 0x8b, 0x08, 0x00, 0x44, 0xa1, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, // ........D.......
- 0x07, 0x80, 0x0b, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x1c, 0x80, 0x01, 0x00, // ................
- 0xe4, 0x80, 0x08, 0x00, 0xe4, 0xa1, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
- 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, // ................
- 0x04, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x0a, 0x00, 0xff, 0xa0, 0x23, 0x00, 0x00, 0x02, 0x02, 0x00, // ..........#.....
- 0x0c, 0x80, 0x0a, 0x00, 0xb4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x01, 0x00, // ......B.........
- 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x0f, 0x80, 0x03, 0x00, // ................
- 0x00, 0x80, 0x0c, 0x00, 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x03, 0x00, // ....@.....X.....
- 0x0f, 0x80, 0x02, 0x00, 0xff, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, // ................
- 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x29, 0x00, // ..............).
- 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, // ........U.......
- 0x0f, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, // ......*.........
- 0x04, 0x80, 0x0c, 0x00, 0xaa, 0xa0, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x05, 0x00, // ......).........
- 0xaa, 0x80, 0x42, 0x00, 0x00, 0x03, 0x05, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, // ..B.............
- 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x06, 0x00, 0x0f, 0x80, 0x05, 0x00, 0x00, 0x80, 0x0c, 0x00, // ................
- 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x05, 0x00, 0x0f, 0x80, 0x02, 0x00, // @.....X.........
- 0xff, 0x81, 0x05, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x05, 0x00, // ................
- 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x05, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x04, 0x00, // ................
- 0x0f, 0x80, 0x05, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, // ..........*.....
- 0x00, 0x02, 0x04, 0x00, 0x0f, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..........+...+.
- 0x00, 0x00, 0x58, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xaa, 0x8c, 0x03, 0x00, // ..X.............
- 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x09, 0x00, // ................
- 0xaa, 0xa1, 0x09, 0x00, 0x60, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, // ....`...........
- 0xe4, 0x8b, 0x02, 0x00, 0xf4, 0x81, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x00, 0x00, // ................
- 0xa4, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x02, 0x00, // ......Z.........
- 0xed, 0x80, 0x02, 0x00, 0xed, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, // ................
- 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
- 0xff, 0x80, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, // ............U...
- 0xaa, 0x80, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0c, 0x00, // ............U...
- 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, // ................
- 0x55, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x09, 0x00, // U...........U...
- 0xaa, 0xa1, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x02, 0x00, // ................
- 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x0a, 0x00, // ....U...........
- 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................
- 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x02, 0x00, // U...............
- 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x81, 0x07, 0x00, 0xe4, 0xa0, 0x04, 0x00, // ................
- 0x00, 0x04, 0x03, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x06, 0x00, // ........U.......
- 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, // ................
- 0xff, 0x80, 0x58, 0x00, 0x00, 0x04, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xaa, 0x81, 0x03, 0x00, // ..X.............
- 0xe4, 0x80, 0x01, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ...........
+ 0x46, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex
+ 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, // 0......u_extentR
+ 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x09, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, // adius.......u_in
+ 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x06, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x6f, // nerCol.......u_o
+ 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x07, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, // uterCol.......u_
+ 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x03, 0x00, 0x03, 0x00, 0x08, 0x75, // paintMat.......u
+ 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0x0a, 0x00, 0x01, 0x00, 0x11, 0x75, 0x5f, // _params.......u_
+ 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, // scissorExtScale.
+ 0x01, 0x08, 0x00, 0x01, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, // ......u_scissorM
+ 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x6c, 0x05, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, // at......l.......
+ 0x63, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x57, 0x01, 0x00, 0x00, 0x00, 0x03, // c.CTAB....W.....
+ 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x01, // ..............P.
+ 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xc4, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, // ................
+ 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x02, 0x00, // ................
+ 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, // ................
+ 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x01, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x01, 0x00, // ......(.........
+ 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........1.....
+ 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x01, // ..............C.
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x00, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, // ..s_tex.........
+ 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // ..........u_exte
+ 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, // ntRadius........
+ 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, // ..........u_inne
+ 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, // rCol.u_outerCol.
+ 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, // u_paintMat......
+ 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_
+ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, // params.u_scissor
+ 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, // ExtScale.u_sciss
+ 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // orMat.ps_3_0.Mic
+ 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
+ 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, // 9.29.952.3111.Q.
+ 0x00, 0x05, 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // .........?...@..
+ 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x51, 0x00, 0x00, 0x05, 0x0c, 0x00, 0x0f, 0xa0, 0x00, 0x00, // .....?Q.........
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // .....?..@@......
+ 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
+ 0x01, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, // ................
+ 0x0f, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x90, 0x0b, 0x00, // ................
+ 0x55, 0xa0, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U...............
+ 0x00, 0x8c, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................
+ 0x00, 0x80, 0x0a, 0x00, 0x55, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, // ....U...........
+ 0x00, 0x80, 0x0b, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, // ................
+ 0x55, 0x90, 0x0b, 0x00, 0xff, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U...............
+ 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x04, 0x00, // ................
+ 0xd0, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x80, 0x03, 0x00, // ....U...........
+ 0xd0, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
+ 0x06, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0xd0, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, // ................
+ 0x01, 0x80, 0x09, 0x00, 0x00, 0xa0, 0x06, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x80, 0x09, 0x00, // ................
+ 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe9, 0x80, 0x01, 0x00, // U...............
+ 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x44, 0xa0, 0x00, 0x00, // ............D...
+ 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x44, 0xa0, 0x00, 0x00, // U...........D...
+ 0x00, 0x90, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ................
+ 0xe4, 0x80, 0x02, 0x00, 0x44, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, // ....D...........
+ 0xe4, 0x8b, 0x08, 0x00, 0x44, 0xa1, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x0b, 0x00, // ....D...........
+ 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x1c, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x08, 0x00, // ................
+ 0xe4, 0xa1, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x80, 0x01, 0x00, // ................
+ 0xff, 0x80, 0x01, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................
+ 0xff, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x04, 0x80, 0x02, 0x00, // ................
+ 0xaa, 0x80, 0x0a, 0x00, 0xff, 0xa0, 0x23, 0x00, 0x00, 0x02, 0x02, 0x00, 0x0c, 0x80, 0x0a, 0x00, // ......#.........
+ 0xb4, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x03, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x00, 0x08, // ..B.............
+ 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x0f, 0x80, 0x03, 0x00, 0x00, 0x80, 0x0c, 0x00, // ................
+ 0x40, 0xa0, 0x0c, 0x00, 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x03, 0x00, 0x0f, 0x80, 0x02, 0x00, // @.....X.........
+ 0xff, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, // ..........).....
+ 0xff, 0xa0, 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, 0x0f, 0x80, 0x0b, 0x00, // ....U...........
+ 0xff, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x05, 0x00, 0x04, 0x80, 0x0c, 0x00, // ..*.............
+ 0xaa, 0xa0, 0x29, 0x00, 0x02, 0x02, 0x0a, 0x00, 0xff, 0xa0, 0x05, 0x00, 0xaa, 0x80, 0x42, 0x00, // ..)...........B.
+ 0x00, 0x03, 0x05, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x04, 0x00, // ................
+ 0x00, 0x04, 0x06, 0x00, 0x0f, 0x80, 0x05, 0x00, 0x00, 0x80, 0x0c, 0x00, 0x40, 0xa0, 0x0c, 0x00, // ............@...
+ 0x15, 0xa0, 0x58, 0x00, 0x00, 0x04, 0x05, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xff, 0x81, 0x05, 0x00, // ..X.............
+ 0xe4, 0x80, 0x06, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x05, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
+ 0xff, 0x80, 0x05, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0x03, 0x04, 0x00, 0x0f, 0x80, 0x05, 0x00, // ................
+ 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x04, 0x00, // ......*.........
+ 0x0f, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x58, 0x00, // ......+...+...X.
+ 0x00, 0x04, 0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xaa, 0x8c, 0x03, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................
+ 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x09, 0x00, 0xaa, 0xa1, 0x09, 0x00, // ................
+ 0x60, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xe4, 0x8b, 0x02, 0x00, // `...............
+ 0xf4, 0x81, 0x0b, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0a, 0x80, 0x00, 0x00, 0xa4, 0x80, 0x0c, 0x00, // ................
+ 0x00, 0xa0, 0x5a, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x80, 0x02, 0x00, 0xed, 0x80, 0x02, 0x00, // ..Z.............
+ 0xed, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, // ................
+ 0xff, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0xff, 0x80, 0x0b, 0x00, // ................
+ 0x00, 0x03, 0x02, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x0a, 0x00, // ........U.......
+ 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x55, 0x80, 0x0c, 0x00, 0x00, 0xa0, 0x02, 0x00, // ........U.......
+ 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, // ............U...
+ 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x80, 0x09, 0x00, 0xaa, 0xa1, 0x04, 0x00, // ........U.......
+ 0x00, 0x04, 0x00, 0x00, 0x02, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, // ................
+ 0x55, 0x80, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x0a, 0x00, 0x00, 0xa0, 0x05, 0x00, // U...............
+ 0x00, 0x03, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, // ............U...
+ 0x00, 0x02, 0x03, 0x00, 0x0f, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, // ................
+ 0x0f, 0x80, 0x03, 0x00, 0xe4, 0x81, 0x07, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, // ................
+ 0x0f, 0x80, 0x00, 0x00, 0x55, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x05, 0x00, // ....U...........
+ 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x80, 0x58, 0x00, // ..............X.
+ 0x00, 0x04, 0x00, 0x08, 0x0f, 0x80, 0x02, 0x00, 0xaa, 0x81, 0x03, 0x00, 0xe4, 0x80, 0x01, 0x00, // ................
+ 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // .......
};
-static const uint8_t fs_nanovg_fill_dx11[2286] =
+static const uint8_t fs_nanovg_fill_dx11[2298] =
{
- 0x46, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x07, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, // FSH........u_sci
- 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0a, 0x75, 0x5f, // ssorMat.......u_
- 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x18, 0x00, 0x30, 0x00, 0x03, 0x00, 0x0a, 0x75, // paintMat..0....u
- 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x17, 0x00, 0x60, 0x00, 0x01, 0x00, 0x0a, // _innerCol..`....
- 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x17, 0x00, 0x70, 0x00, 0x01, 0x00, // u_outerCol..p...
+ 0x46, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, // FSH........u_sci
+ 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0a, 0x75, 0x5f, // ssorMat.......u_
+ 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x00, 0x30, 0x00, 0x03, 0x00, 0x0a, 0x75, // paintMat..0....u
+ 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x00, 0x60, 0x00, 0x01, 0x00, 0x0a, // _innerCol..`....
+ 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x00, 0x70, 0x00, 0x01, 0x00, // u_outerCol..p...
0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, // .u_scissorExtSca
- 0x6c, 0x65, 0x17, 0x00, 0x80, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // le.......u_exten
- 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x17, 0x00, 0x90, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, // tRadius.......u_
- 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x17, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x5c, 0x08, 0x44, 0x58, // params........DX
- 0x42, 0x43, 0xd1, 0x0d, 0x44, 0xc2, 0xc4, 0x7b, 0x60, 0xde, 0xb6, 0xfb, 0x34, 0x0f, 0x88, 0x9d, // BC..D..{`...4...
- 0xbc, 0x6e, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // .n............,.
- 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, // ..........ISGNh.
- 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........P.....
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................
- 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x0c, // ................
- 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, // ..SV_POSITION.TE
- 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, // XCOORD....OSGN,.
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... .....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................
- 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, // ..SV_TARGET...SH
- 0x44, 0x52, 0x84, 0x07, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x59, 0x00, // DR....@.......Y.
- 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5a, 0x00, // ..F. .........Z.
- 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, // ...`......X....p
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, // ......UU..b...2.
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, // ......b.........
- 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e.... ......h.
- 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...2.....
- 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ...
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...2.....
- 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ...........
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
- 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, // ..2.......F.....
- 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // ..F. ...........
- 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x81, 0x00, // ..2.......F.....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. .A.....
- 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x20, 0x00, 0x0e, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2 ..2.....
- 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, // ..F...A.........
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@....
- 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .?...?........8.
- 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, // ..........2...".
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, // ......*........@
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // .....@.@........
- 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0xc1, 0x00, // ..".............
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, // .......@.....?8.
- 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..".............
- 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x33, 0x00, // .... .........3.
- 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..".............
- 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x33, 0x00, 0x00, 0x07, 0x42, 0x00, // ...@.....?3...B.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, // ......:........@
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?8...".....
- 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..*.............
- 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, // ......B.......:.
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@....
- 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ......*.......8.
- 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, // ..........V.....
- 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, // .... .........2.
- 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, // ............ ...
- 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, // ................
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, // ............ ...
- 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, // ..........2.....
- 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, // .... .A.........
- 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, // ..F. ...........
- 0x00, 0x09, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x80, 0x81, 0x00, // ................
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, // ..........A.....
- 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..4...........:.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, // ......*.......3.
- 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, // ................
- 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x0a, 0xc2, 0x00, // ...@......4.....
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, // ......B.........
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, // ..............K.
- 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B.......*.....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ......B.......*.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B.......*.....
- 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, // ..*. .A.........
- 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, // ..2...B.........
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@....
- 0x00, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x20, 0x00, 0x08, 0x42, 0x00, // .?*........ ..B.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, // ......*.........
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, // ...............
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. .A.....
- 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, // ......F. .......
- 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, // ..2.............
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ......F.......F.
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, // .........8...B.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ................
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, // ......8.... ....
- 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, // ..*.......:.....
- 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..6...r ......F.
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, // ..............B.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. .......
- 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, // ...@.....?....*.
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8.........
- 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, // ..V......... ...
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
- 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, // .... ...........
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
- 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0e, 0x00, // .... ...........
- 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x45, 0x00, // .... .........E.
- 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ................
- 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`....
- 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, // ......B.......*.
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@....
- 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, // ..6............@
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, // .....?6.........
- 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xf2, 0x00, // ..........7.....
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8.
- 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..".............
- 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, // ..........8....
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..............:.
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6...r ....
- 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, // ..F.............
- 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..".......:. ...
- 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, // .......@.....@..
- 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, // ..........6....
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // .......@.....?..
- 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, // .?...?...?......
- 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..".......:. ...
- 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, // .......@....@@..
- 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, // ..........E.....
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, // ..............F~
+ 0x6c, 0x65, 0x12, 0x00, 0x80, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // le.......u_exten
+ 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x00, 0x90, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, // tRadius.......u_
+ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, // params.......s_t
+ 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x5c, 0x08, 0x44, 0x58, 0x42, 0x43, 0xd1, 0x0d, // ex0.......DXBC..
+ 0x44, 0xc2, 0xc4, 0x7b, 0x60, 0xde, 0xb6, 0xfb, 0x34, 0x0f, 0x88, 0x9d, 0xbc, 0x6e, 0x01, 0x00, // D..{`...4....n..
+ 0x00, 0x00, 0x5c, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, // ..........,.....
+ 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, // ......ISGNh.....
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ......P.........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................
+ 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x53, 0x56, // ..............SV
+ 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // _POSITION.TEXCOO
+ 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, // RD....OSGN,.....
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, // ..............SV
+ 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x84, 0x07, // _TARGET...SHDR..
+ 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..@.......Y...F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // .........Z....`
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X....p....
+ 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b...2.....
+ 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...........e.
+ 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, // ... ......h.....
+ 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, // ..8...2.......V.
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ......F. .......
+ 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, // ..2...2.......F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, // ...............
+ 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, // ..F...........2.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, // ......F.......F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, // .............2.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F.........
+ 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // ..F. .A.........
+ 0x00, 0x00, 0x32, 0x20, 0x00, 0x0e, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, // ..2 ..2.......F.
+ 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, // ..A......... ...
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // .......@.....?..
+ 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // .?........8.....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ................
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2...".....
+ 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..*........@....
+ 0x00, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, // .@.@..........".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, // ...@.....?8...".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, // ................
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x22, 0x00, // .........3...".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x33, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?3...B.....
+ 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..:........@....
+ 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // .?8...".......*.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, // ................
+ 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..B.......:. ...
+ 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // .......@........
+ 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, // ..*.......8.....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, // ......V.........
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, // .........2.....
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ........ .......
+ 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, // ................
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ........ .......
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, // ......2.........
+ 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x80, // .A...........F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xc2, 0x00, // ...............
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x06, 0x04, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, // ......A.......4.
+ 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........:.....
+ 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x12, 0x00, // ..*.......3.....
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......4.........
+ 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................
+ 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ..B.............
+ 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x42, 0x00, // ..........K...B.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......*.........
+ 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..B.......*.....
+ 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x42, 0x00, // ..............B.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, // ......*.......*.
+ 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, // .A...........2.
+ 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..B......... ...
+ 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2a, 0x00, // .......@.....?*.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x20, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ....... ..B.....
+ 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..*......... ...
+ 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ................
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ..F. .A.........
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2.
+ 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
+ 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8...B.....
+ 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ..8.... ......*.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // ......:.......6.
+ 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, // ..r ......F.....
+ 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........B.....
+ 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, // ..:. ..........@
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?....*.....
+ 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, // ..8...........V.
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ........ .......
+ 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, // ..2.............
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, // ...............
+ 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, // ................
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, // ................
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, 0xc2, 0x00, // ...............
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, // ................
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, // .........E.....
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, // ..............F~
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, // .......`........
- 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..".......*. ...
+ 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..B.......*. ...
0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, // .......@......6.
0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@....
0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, // .?6.............
0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......7.........
- 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..V.......F.....
- 0x00, 0x00, 0x06, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, // ..........8.....
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, // ..............:.
- 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......8.... ....
- 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
- 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, // ................
- 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0xb0, 0x00, // ......>.......
+ 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F.....
+ 0x00, 0x00, 0x06, 0x0c, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, // ..........8...".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ................
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, // ......8.... ....
+ 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, // ..........:.....
+ 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ..6...r ......F.
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // ..............".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. .......
+ 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, // ...@.....@......
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6.... ....
+ 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // ...@.....?...?..
+ 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // .?...?........".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. .......
+ 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, // ...@....@@......
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......E.........
+ 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, // ..........F~....
+ 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // ...`..........".
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......*. .......
+ 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x00, // ...@......6.....
+ 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, // .......@.....?6.
+ 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, // ................
+ 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, // ..7...........V.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x0c, // ......F.........
+ 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, // ......8.........
+ 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, // ..........:.....
+ 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..8.... ......F.
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ......F. .......
+ 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, // ................
+ 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0xb0, 0x00, // ..>.......
+};
+static const uint8_t fs_nanovg_fill_mtl[3540] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0xc5, 0x0d, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float2 v_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, // tion;. float2 v
+ 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, // _texcoord0;.};.s
+ 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // truct xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x61, // derOutput {. ha
+ 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // lf4 gl_FragColor
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // MtlShaderUniform
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x20, 0x75, 0x5f, // {. float3x3 u_
+ 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // scissorMat;. fl
+ 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, // oat3x3 u_paintMa
+ 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, // t;. float4 u_in
+ 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // nerCol;. float4
+ 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x66, // u_outerCol;. f
+ 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // loat4 u_scissorE
+ 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // xtScale;. float
+ 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // 4 u_extentRadius
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // ;. float4 u_par
+ 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, // ams;.};.fragment
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // tput xlatMtlMain
+ 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, // (xlatMtlShaderI
+ 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, // nput _mtl_i [[st
+ 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, // age_in]], consta
+ 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // nt xlatMtlShader
+ 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, // Uniform& _mtl_u
+ 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, // [[buffer(0)]].
+ 0x2c, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, // , texture2d<fl
+ 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, // oat> s_tex [[tex
+ 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // ture(0)]], sampl
+ 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, // er _mtlsmp_s_tex
+ 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, // [[sampler(0)]])
+ 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // .{. xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, // erOutput _mtl_o;
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // . half4 result_
+ 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 1;. float tmpva
+ 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x73, 0x63, // r_2;. float2 sc
+ 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, // _3;. float3 tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_4;. tmpvar_
+ 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 4.z = 1.0;. tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // var_4.xy = _mtl_
+ 0x69, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // i.v_position;.
+ 0x73, 0x63, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, // sc_3 = (float2(0
+ 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, // .5, 0.5) - ((.
+ 0x20, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // abs((_mtl_u.u_
+ 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // scissorMat * tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, // var_4).xy). -
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, // _mtl_u.u_scissor
+ 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, // ExtScale.xy) * _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // mtl_u.u_scissorE
+ 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // xtScale.zw));.
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, // tmpvar_2 = (clam
+ 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, // p (sc_3.x, 0.0,
+ 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, // 1.0) * clamp (sc
+ 0x5f, 0x33, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // _3.y, 0.0, 1.0))
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. float tmpvar
+ 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, // _5;. tmpvar_5 =
+ 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, // (min (1.0, (.
+ 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x5f, // (1.0 - abs(((_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // mtl_i.v_texcoord
+ 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, // 0.x * 2.0) - 1.0
+ 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ))). * _mtl_u.
+ 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, // u_params.y)) * m
+ 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, // in (1.0, _mtl_i.
+ 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x29, 0x3b, // v_texcoord0.y));
+ 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // . if ((_mtl_u.u
+ 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, // _params.w == 0.0
+ 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // )) {. float4
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // color_6;. flo
+ 0x61, 0x74, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, // at3 tmpvar_7;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, // tmpvar_7.z = 1
+ 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, // .0;. tmpvar_7
+ 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x70, // .xy = _mtl_i.v_p
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // osition;. flo
+ 0x61, 0x74, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, // at2 tmpvar_8;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, // tmpvar_8 = (ab
+ 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, // s((_mtl_u.u_pain
+ 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x29, // tMat * tmpvar_7)
+ 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // .xy) - (_mtl_u.u
+ 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, // _extentRadius.xy
+ 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // - _mtl_u.u_exte
+ 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, // ntRadius.zz));.
+ 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // float2 tmpvar
+ 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // _9;. tmpvar_9
+ 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, // = max (tmpvar_8
+ 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // , 0.0);. floa
+ 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, // t4 tmpvar_10;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, // tmpvar_10 = mi
+ 0x78, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, // x (_mtl_u.u_inne
+ 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6f, // rCol, _mtl_u.u_o
+ 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, // uterCol, clamp (
+ 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, // (. (((min (
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, // . max (tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2e, 0x78, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_8.x, tmpvar
+ 0x5f, 0x38, 0x2e, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, // _8.y). , 0.
+ 0x30, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 0) + sqrt(.
+ 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // dot (tmpvar_9
+ 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // , tmpvar_9).
+ 0x20, 0x20, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // )) - _mtl_u.u_
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, // extentRadius.z)
+ 0x2b, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // + (_mtl_u.u_para
+ 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.x * 0.5)).
+ 0x20, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // / _mtl_u.u_par
+ 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // ams.x), 0.0, 1.0
+ 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x2e, // ));. color_6.
+ 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, // xyz = tmpvar_10.
+ 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, // xyz;. color_6
+ 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, // .w = (tmpvar_10.
+ 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, // w * (tmpvar_5 *
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_2));.
+ 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // result_1 = half4
+ 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, // (color_6);. } e
+ 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, // lse {. if ((_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, // mtl_u.u_params.w
+ 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // == 1.0)) {.
+ 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, // half4 color_11
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, // ;. float3 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_12;.
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, // tmpvar_12.z = 1.
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 0;. tmpvar_
+ 0x31, 0x32, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, // 12.xy = _mtl_i.v
+ 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // _position;.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // float2 tmpvar_1
+ 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 3;. tmpvar_
+ 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // 13 = ((_mtl_u.u_
+ 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // paintMat * tmpva
+ 0x72, 0x5f, 0x31, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // r_12).xy / _mtl_
+ 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // u.u_extentRadius
+ 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // .xy);. half
+ 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_14;.
+ 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x68, // tmpvar_14 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // alf4(s_tex.sampl
+ 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, // e(_mtlsmp_s_tex,
+ 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // (float2)(tmpvar
+ 0x5f, 0x31, 0x33, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, // _13)));. co
+ 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lor_11 = tmpvar_
+ 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, // 14;. half4
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_15;.
+ 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // if ((_mtl_u.u_p
+ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, // arams.z == 0.0))
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // {. tmpva
+ 0x72, 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, // r_15 = tmpvar_14
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, // ;. } else {
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x74, // . half4 t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_16;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, // tmpvar_16.xyz
+ 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, // = half3(float3(1
+ 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, // .0, 1.0, 1.0));.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // tmpvar_1
+ 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, // 6.w = tmpvar_14.
+ 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // x;. tmpva
+ 0x72, 0x5f, 0x31, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, // r_15 = tmpvar_16
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. };.
+ 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // color_11.xyz =
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // tmpvar_15.xyz;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x20, // color_11.w
+ 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // = ((half)((float
+ 0x29, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, // )tmpvar_15.w * (
+ 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpvar_5 * tmpva
+ 0x72, 0x5f, 0x32, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // r_2)));. re
+ 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // sult_1 = color_1
+ 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, // 1;. } else {.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if ((_mtl_
+ 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, // u.u_params.w ==
+ 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.0)) {.
+ 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // result_1 = half4
+ 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // (float4(1.0, 1.0
+ 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // , 1.0, 1.0));.
+ 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // } else {.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // if ((_mtl_u
+ 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, // .u_params.w == 3
+ 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0)) {.
+ 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x37, 0x3b, // half4 color_17;
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // . half4
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_18;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x20, // tmpvar_18
+ 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, // = half4(s_tex.sa
+ 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, // mple(_mtlsmp_s_t
+ 0x65, 0x78, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x5f, 0x6d, 0x74, // ex, (float2)(_mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, // l_i.v_texcoord0)
+ 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, // ));. co
+ 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lor_17 = tmpvar_
+ 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, // 18;. ha
+ 0x6c, 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, // lf4 tmpvar_19;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x5f, 0x6d, // if ((_m
+ 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, // tl_u.u_params.z
+ 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // == 0.0)) {.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, // tmpvar_19
+ 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_18;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, // } else {
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x6c, // . hal
+ 0x66, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x3b, 0x0a, 0x20, 0x20, // f4 tmpvar_20;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar
+ 0x5f, 0x32, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x33, 0x28, // _20.xyz = half3(
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, // float3(1.0, 1.0,
+ 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.0));.
+ 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x2e, 0x77, 0x20, // tmpvar_20.w
+ 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x2e, 0x78, 0x3b, 0x0a, 0x20, // = tmpvar_18.x;.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva
+ 0x72, 0x5f, 0x31, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, // r_19 = tmpvar_20
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, // ;. };.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // color_1
+ 0x37, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 7.xyz = tmpvar_1
+ 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9.xyz;.
+ 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x28, // color_17.w = ((
+ 0x68, 0x61, 0x6c, 0x66, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x74, 0x6d, 0x70, // half)((float)tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_19.w * tmpva
+ 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_2));.
+ 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, // result_1 = ((ha
+ 0x6c, 0x66, 0x34, 0x29, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x29, 0x63, 0x6f, 0x6c, // lf4)((float4)col
+ 0x6f, 0x72, 0x5f, 0x31, 0x37, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // or_17 * _mtl_u.u
+ 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _innerCol));.
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, // };. };
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x5f, // . };. };. _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // mtl_o.gl_FragCol
+ 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // or = result_1;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
};
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
index 7a0a93ecb06..263c1b31b94 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
@@ -28,7 +28,7 @@
#include <math.h>
#include "nanovg.h"
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/bx.h>
@@ -188,7 +188,7 @@ namespace
tex = &gl->textures[gl->ntextures++];
}
- memset(tex, 0, sizeof(*tex));
+ memset(tex, 0, sizeof(*tex) );
return tex;
}
@@ -218,7 +218,7 @@ namespace
{
bgfx::destroyTexture(gl->textures[ii].id);
}
- memset(&gl->textures[ii], 0, sizeof(gl->textures[ii]));
+ memset(&gl->textures[ii], 0, sizeof(gl->textures[ii]) );
gl->textures[ii].id.idx = bgfx::invalidHandle;
return 1;
}
@@ -247,6 +247,11 @@ namespace
fs_nanovg_fill = bgfx::makeRef(fs_nanovg_fill_dx11, sizeof(fs_nanovg_fill_dx11) );
break;
+ case bgfx::RendererType::Metal:
+ vs_nanovg_fill = bgfx::makeRef(vs_nanovg_fill_mtl, sizeof(vs_nanovg_fill_mtl) );
+ fs_nanovg_fill = bgfx::makeRef(fs_nanovg_fill_mtl, sizeof(fs_nanovg_fill_mtl) );
+ break;
+
default:
vs_nanovg_fill = bgfx::makeRef(vs_nanovg_fill_glsl, sizeof(vs_nanovg_fill_glsl) );
fs_nanovg_fill = bgfx::makeRef(fs_nanovg_fill_glsl, sizeof(fs_nanovg_fill_glsl) );
@@ -259,19 +264,19 @@ namespace
, true
);
- gl->u_scissorMat = bgfx::createUniform("u_scissorMat", bgfx::UniformType::Uniform3x3fv);
- gl->u_paintMat = bgfx::createUniform("u_paintMat", bgfx::UniformType::Uniform3x3fv);
- gl->u_innerCol = bgfx::createUniform("u_innerCol", bgfx::UniformType::Uniform4fv);
- gl->u_outerCol = bgfx::createUniform("u_outerCol", bgfx::UniformType::Uniform4fv);
- gl->u_viewSize = bgfx::createUniform("u_viewSize", bgfx::UniformType::Uniform2fv);
- gl->u_scissorExtScale = bgfx::createUniform("u_scissorExtScale", bgfx::UniformType::Uniform4fv);
- gl->u_extentRadius = bgfx::createUniform("u_extentRadius", bgfx::UniformType::Uniform4fv);
- gl->u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv);
- gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Uniform1i);
+ gl->u_scissorMat = bgfx::createUniform("u_scissorMat", bgfx::UniformType::Mat3);
+ gl->u_paintMat = bgfx::createUniform("u_paintMat", bgfx::UniformType::Mat3);
+ gl->u_innerCol = bgfx::createUniform("u_innerCol", bgfx::UniformType::Vec4);
+ gl->u_outerCol = bgfx::createUniform("u_outerCol", bgfx::UniformType::Vec4);
+ gl->u_viewSize = bgfx::createUniform("u_viewSize", bgfx::UniformType::Vec4);
+ gl->u_scissorExtScale = bgfx::createUniform("u_scissorExtScale", bgfx::UniformType::Vec4);
+ gl->u_extentRadius = bgfx::createUniform("u_extentRadius", bgfx::UniformType::Vec4);
+ gl->u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4);
+ gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Int1);
if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9)
{
- gl->u_halfTexel = bgfx::createUniform("u_halfTexel", bgfx::UniformType::Uniform4fv);
+ gl->u_halfTexel = bgfx::createUniform("u_halfTexel", bgfx::UniformType::Vec4);
}
else
{
@@ -384,10 +389,10 @@ namespace
invdet = 1.0 / det;
inv[0] = (float)(t[3] * invdet);
inv[2] = (float)(-t[2] * invdet);
- inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet);
+ inv[4] = (float)( ((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet);
inv[1] = (float)(-t[1] * invdet);
inv[3] = (float)(t[0] * invdet);
- inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet);
+ inv[5] = (float)( ((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet);
}
static void glnvg__xformToMat3x4(float* m3, float* t)
@@ -412,7 +417,7 @@ namespace
struct GLNVGtexture* tex = NULL;
float invxform[6] = {};
- memset(frag, 0, sizeof(*frag));
+ memset(frag, 0, sizeof(*frag) );
frag->innerCol = paint->innerColor;
frag->outerCol = paint->outerColor;
@@ -422,7 +427,7 @@ namespace
if (scissor->extent[0] < 0.5f || scissor->extent[1] < 0.5f)
{
- memset(frag->scissorMat, 0, sizeof(frag->scissorMat));
+ memset(frag->scissorMat, 0, sizeof(frag->scissorMat) );
frag->scissorExt[0] = 1.0f;
frag->scissorExt[1] = 1.0f;
frag->scissorScale[0] = 1.0f;
@@ -437,7 +442,7 @@ namespace
frag->scissorScale[0] = sqrtf(scissor->xform[0]*scissor->xform[0] + scissor->xform[2]*scissor->xform[2]) / fringe;
frag->scissorScale[1] = sqrtf(scissor->xform[1]*scissor->xform[1] + scissor->xform[3]*scissor->xform[3]) / fringe;
}
- memcpy(frag->extent, paint->extent, sizeof(frag->extent));
+ memcpy(frag->extent, paint->extent, sizeof(frag->extent) );
frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe;
bgfx::TextureHandle invalid = BGFX_INVALID_HANDLE;
@@ -556,7 +561,6 @@ namespace
{
if (2 < paths[i].fillCount)
{
- bgfx::setProgram(gl->prog);
bgfx::setState(0);
bgfx::setStencil(0
| BGFX_STENCIL_TEST_ALWAYS
@@ -574,7 +578,7 @@ namespace
bgfx::setVertexBuffer(&gl->tvb);
bgfx::setTexture(0, gl->s_tex, gl->th);
fan(paths[i].fillOffset, paths[i].fillCount);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
}
@@ -586,7 +590,6 @@ namespace
// Draw fringes
for (i = 0; i < npaths; i++)
{
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state
| BGFX_STATE_PT_TRISTRIP
);
@@ -599,12 +602,11 @@ namespace
);
bgfx::setVertexBuffer(&gl->tvb, paths[i].strokeOffset, paths[i].strokeCount);
bgfx::setTexture(0, gl->s_tex, gl->th);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
}
// Draw fill
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state);
bgfx::setVertexBuffer(&gl->tvb, call->vertexOffset, call->vertexCount);
bgfx::setTexture(0, gl->s_tex, gl->th);
@@ -615,7 +617,7 @@ namespace
| BGFX_STENCIL_OP_FAIL_Z_ZERO
| BGFX_STENCIL_OP_PASS_Z_ZERO
);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
static void glnvg__convexFill(struct GLNVGcontext* gl, struct GLNVGcall* call)
@@ -628,12 +630,11 @@ namespace
for (i = 0; i < npaths; i++)
{
if (paths[i].fillCount == 0) continue;
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state);
bgfx::setVertexBuffer(&gl->tvb);
bgfx::setTexture(0, gl->s_tex, gl->th);
fan(paths[i].fillOffset, paths[i].fillCount);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
if (gl->edgeAntiAlias)
@@ -641,13 +642,12 @@ namespace
// Draw fringes
for (i = 0; i < npaths; i++)
{
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state
| BGFX_STATE_PT_TRISTRIP
);
bgfx::setVertexBuffer(&gl->tvb, paths[i].strokeOffset, paths[i].strokeCount);
bgfx::setTexture(0, gl->s_tex, gl->th);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
}
}
@@ -662,14 +662,12 @@ namespace
// Draw Strokes
for (i = 0; i < npaths; i++)
{
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state
| BGFX_STATE_PT_TRISTRIP
);
bgfx::setVertexBuffer(&gl->tvb, paths[i].strokeOffset, paths[i].strokeCount);
bgfx::setTexture(0, gl->s_tex, gl->th);
- bgfx::setTexture(0, gl->s_tex, gl->th);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
}
@@ -679,11 +677,10 @@ namespace
{
nvgRenderSetUniforms(gl, call->uniformOffset, call->image);
- bgfx::setProgram(gl->prog);
bgfx::setState(gl->state);
bgfx::setVertexBuffer(&gl->tvb, call->vertexOffset, call->vertexCount);
bgfx::setTexture(0, gl->s_tex, gl->th);
- bgfx::submit(gl->viewid);
+ bgfx::submit(gl->viewid, gl->prog);
}
}
@@ -779,7 +776,7 @@ namespace
gl->calls = (struct GLNVGcall*)realloc(gl->calls, sizeof(struct GLNVGcall) * gl->ccalls);
}
ret = &gl->calls[gl->ncalls++];
- memset(ret, 0, sizeof(struct GLNVGcall));
+ memset(ret, 0, sizeof(struct GLNVGcall) );
return ret;
}
@@ -865,7 +862,7 @@ namespace
{
struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
const struct NVGpath* path = &paths[i];
- memset(copy, 0, sizeof(struct GLNVGpath));
+ memset(copy, 0, sizeof(struct GLNVGpath) );
if (path->nfill > 0)
{
copy->fillOffset = offset;
@@ -901,7 +898,7 @@ namespace
call->uniformOffset = glnvg__allocFragUniforms(gl, 2);
// Simple shader for stencil
frag = nvg__fragUniformPtr(gl, call->uniformOffset);
- memset(frag, 0, sizeof(*frag));
+ memset(frag, 0, sizeof(*frag) );
frag->type = NSVG_SHADER_SIMPLE;
// Fill shader
glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, fringe, fringe);
@@ -935,7 +932,7 @@ namespace
{
struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
const struct NVGpath* path = &paths[i];
- memset(copy, 0, sizeof(struct GLNVGpath));
+ memset(copy, 0, sizeof(struct GLNVGpath) );
if (path->nstroke)
{
copy->strokeOffset = offset;
@@ -1018,11 +1015,11 @@ NVGcontext* nvgCreate(int edgeaa, unsigned char viewid)
{
struct NVGparams params;
struct NVGcontext* ctx = NULL;
- struct GLNVGcontext* gl = (struct GLNVGcontext*)malloc(sizeof(struct GLNVGcontext));
+ struct GLNVGcontext* gl = (struct GLNVGcontext*)malloc(sizeof(struct GLNVGcontext) );
if (gl == NULL) goto error;
- memset(gl, 0, sizeof(struct GLNVGcontext));
+ memset(gl, 0, sizeof(struct GLNVGcontext) );
- memset(&params, 0, sizeof(params));
+ memset(&params, 0, sizeof(params) );
params.renderCreate = nvgRenderCreate;
params.renderCreateTexture = nvgRenderCreateTexture;
params.renderDeleteTexture = nvgRenderDeleteTexture;
diff --git a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
index 38d4bbbce3a..aeac0d14115 100644
--- a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
+++ b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h
@@ -1,8 +1,8 @@
static const uint8_t vs_nanovg_fill_glsl[541] =
{
- 0x56, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, // wSize.......u_ha
- 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0xeb, 0x01, 0x00, // lfTexel.........
+ 0x56, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, // wSize.......u_ha
+ 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0xeb, 0x01, 0x00, // lfTexel.........
0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // .attribute highp
0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec2 a_position
0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ;.attribute high
@@ -12,7 +12,7 @@ static const uint8_t vs_nanovg_fill_glsl[541] =
0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // n;.varying highp
0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec2 v_texcoord
0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.uniform highp
- 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, // vec2 u_viewSize
+ 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, // vec4 u_viewSize
0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.uniform highp
0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, // vec4 u_halfTexel
0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{
@@ -35,23 +35,22 @@ static const uint8_t vs_nanovg_fill_glsl[541] =
0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, // gl_Position = t
0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mpvar_1;.}...
};
-static const uint8_t vs_nanovg_fill_dx9[448] =
+static const uint8_t vs_nanovg_fill_dx9[432] =
{
- 0x56, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, 0x6c, // VSH........u_hal
- 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, // fTexel.......u_v
- 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x90, 0x01, 0x00, // iewSize.........
- 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2e, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, // .......CTAB.....
+ 0x56, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, 0x6c, // VSH........u_hal
+ 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, // fTexel.......u_v
+ 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x80, 0x01, 0x00, // iewSize.........
+ 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2a, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x72, // .....*.CTAB....r
0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, // ................
- 0x91, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, // ...|...D........
+ 0x91, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, // ...k...D........
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, // ...P.......`....
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // .......l.......u
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, // .......P.......u
0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, // _halfTexel......
0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, // ...........u_vie
- 0x77, 0x53, 0x69, 0x7a, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, // wSize...........
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, // .......vs_3_0.Mi
- 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, // crosoft (R) HLSL
- 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, // Shader Compiler
- 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, // 9.29.952.3111.Q
+ 0x77, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // wSize.vs_3_0.Mic
+ 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
+ 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, // 9.29.952.3111..Q
0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..............?.
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, // ................
0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, // ................
@@ -68,8 +67,8 @@ static const uint8_t vs_nanovg_fill_dx9[448] =
};
static const uint8_t vs_nanovg_fill_dx11[577] =
{
- 0x56, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
- 0x77, 0x53, 0x69, 0x7a, 0x65, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x02, 0x44, 0x58, 0x42, // wSize........DXB
+ 0x56, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie
+ 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x02, 0x44, 0x58, 0x42, // wSize........DXB
0x43, 0x99, 0x64, 0x1c, 0x9f, 0xec, 0x38, 0xd9, 0xd2, 0x91, 0x86, 0xde, 0x66, 0x7d, 0x52, 0x06, // C.d...8.....f}R.
0xfe, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, // .............,..
0x00, 0x80, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, // .........ISGNL..
@@ -106,3 +105,61 @@ static const uint8_t vs_nanovg_fill_dx11[577] =
0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x10, // .....>..........
0x00, // .
};
+static const uint8_t vs_nanovg_fill_mtl[865] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x75, 0x73, // VSH.......R...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float2 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, // (0)]];. float2
+ 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, // a_texcoord0 [[at
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, // tribute(1)]];.};
+ 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // .struct xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, // haderOutput {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // float4 gl_Positi
+ 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, // on [[position]];
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float2 v_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, // tion;. float2 v
+ 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, // _texcoord0;.};.s
+ 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // truct xlatMtlSha
+ 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, // derUniform {. f
+ 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, // loat4 u_viewSize
+ 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, // ;. float4 u_hal
+ 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, // fTexel;.};.verte
+ 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, // x xlatMtlShaderO
+ 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // utput xlatMtlMai
+ 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // n (xlatMtlShader
+ 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, // Input _mtl_i [[s
+ 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, // tage_in]], const
+ 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // ant xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // rUniform& _mtl_u
+ 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, // [[buffer(0)]]).
+ 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // {. xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // rOutput _mtl_o;.
+ 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // _mtl_o.v_posit
+ 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, // ion = _mtl_i.a_p
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // osition;. _mtl_
+ 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, // o.v_texcoord0 =
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // (_mtl_i.a_texcoo
+ 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x68, // rd0 + _mtl_u.u_h
+ 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, // alfTexel.xy);.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // float4 tmpvar_1;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw =
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // float2(0.0, 1.0
+ 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, // );. tmpvar_1.x
+ 0x3d, 0x20, 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // = (((2.0 * _mtl_
+ 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, // i.a_position.x)
+ 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // / _mtl_u.u_viewS
+ 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ize.x) - 1.0);.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, // tmpvar_1.y = (1
+ 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, // .0 - ((2.0 * _mt
+ 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, // l_i.a_position.y
+ 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, // ) / _mtl_u.u_vie
+ 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, // wSize.y));. _mt
+ 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // l_o.gl_Position
+ 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, // = tmpvar_1;. re
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // turn _mtl_o;.}..
+ 0x00, // .
+};
diff --git a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.sc b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.sc
index 31324f55cd6..b1cb88e4d5a 100644
--- a/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.sc
+++ b/3rdparty/bgfx/examples/common/nanovg/vs_nanovg_fill.sc
@@ -5,7 +5,7 @@ $output v_position, v_texcoord0
#define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 4)
-uniform vec2 u_viewSize;
+uniform vec4 u_viewSize;
#if NEED_HALF_TEXEL
uniform vec4 u_halfTexel;
diff --git a/3rdparty/bgfx/examples/makefile b/3rdparty/bgfx/examples/makefile
index ebebb525fb0..56ad944b750 100644
--- a/3rdparty/bgfx/examples/makefile
+++ b/3rdparty/bgfx/examples/makefile
@@ -30,3 +30,23 @@ rebuild:
@make -s --no-print-directory rebuild -C common/font
@make -s --no-print-directory rebuild -C common/imgui
@make -s --no-print-directory rebuild -C common/nanovg
+
+metal:
+ @make -s --no-print-directory TARGET=5 -C 01-cubes
+ @make -s --no-print-directory TARGET=5 -C 03-raymarch
+ @make -s --no-print-directory TARGET=5 -C 04-mesh
+ @make -s --no-print-directory TARGET=5 -C 05-instancing
+ @make -s --no-print-directory TARGET=5 -C 06-bump
+ @make -s --no-print-directory TARGET=5 -C 07-callback
+ @make -s --no-print-directory TARGET=5 -C 08-update
+ @make -s --no-print-directory TARGET=5 -C 09-hdr
+ @make -s --no-print-directory TARGET=5 -C 12-lod
+ @make -s --no-print-directory TARGET=5 -C 13-stencil
+ @make -s --no-print-directory TARGET=5 -C 14-shadowvolumes
+ @make -s --no-print-directory TARGET=5 -C 15-shadowmaps-simple
+ @make -s --no-print-directory TARGET=5 -C 16-shadowmaps
+ @make -s --no-print-directory TARGET=5 -C 18-ibl
+ @make -s --no-print-directory TARGET=5 -C 19-oit
+ @make -s --no-print-directory TARGET=5 -C 21-deferred
+ @make -s --no-print-directory TARGET=5 -C 23-vectordisplay
+ @make -s --no-print-directory TARGET=5 -C 24-nbody
diff --git a/3rdparty/bgfx/examples/runtime/osx-info.plist b/3rdparty/bgfx/examples/runtime/osx-info.plist
new file mode 100644
index 00000000000..5c142434381
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/osx-info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
+ <key>NSHighResolutionCapable</key>
+ <string>True</string>
+</dict>
+</plist>
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_indirect.bin
index fb332c36e55..1d6b836a5e6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_init_instances.bin
index e37094e81f0..7d2ad935881 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_update_instances.bin
index 2a8b0c207cb..5f9fc49ebe9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_bump.bin
index 22d61c2a911..21650cca90f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_callback.bin
index 9fc11fc401f..3b8307c7bb6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_cubes.bin
index 3836bd65e34..5bd281a0889 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
index ee46a924ee7..126bf9b99c0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
index 51771e233e6..3406a9c63ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
index 3836bd65e34..5bd281a0889 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
index 49eed042abb..76b01317d43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
index c70f3fbf028..e4d10bd7976 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_blur.bin
index 6bd4b3bed4d..ba98412874d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_bright.bin
index b6aa02abaab..d56757ab9b2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lum.bin
index 5da19596867..999b85009f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lumavg.bin
index 0c581b2f77f..da88dceecee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_mesh.bin
index bde2a77c924..40295d5052b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_skybox.bin
index 8f0ed628beb..481cbe4ff45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_tonemap.bin
index 8d6b573baf8..14b02b0779d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
index 7e7e0f7542b..d3ea732918d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin
index 87b46fbd364..13b5e270386 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_instancing.bin
index 3836bd65e34..5bd281a0889 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_mesh.bin
index bc25b2b13b2..3ef2924ff5a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit.bin
index 5350f0f76d4..dbc13a82124 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb.bin
index 78b05dafdee..b0e0b24c880 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_blit.bin
index 89921908072..3cb4d722e14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate.bin
index 46791491b02..04457e27027 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate_blit.bin
index b319c073af9..faf0106bb12 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
index 3a7938e0008..0b6b5ca926c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_raymarching.bin
index 8fabafc16ee..dabd907d908 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_black.bin
index 8fae711210c..2477d864d9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm.bin
index 94b43903c8d..9adc52e608c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_csm.bin
index 40f5cbb63d4..6af5d39a43c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear.bin
index 0895f3ceac1..327fec56972 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_csm.bin
index abb67019886..611a3aaa90a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_omni.bin
index 56c2fd0c589..175b7f1d951 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_omni.bin
index 7f7a4ce68cf..bc3e865aa95 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard.bin
index bac30d52ce9..765fcc0d729 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_csm.bin
index 6616d09c0d6..c39380b7869 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear.bin
index 432c0ad5602..276ccbeddcd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_csm.bin
index 69be9b8a264..e4004b021c3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_omni.bin
index c128fd2a40b..a77a1d2a787 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_omni.bin
index 7545c76220c..25b5e800b19 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf.bin
index 2205505e7c1..5930f492b42 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_csm.bin
index cd972e11ed3..58a4434cfdd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear.bin
index d3ae74ffcbf..63ce03cee0f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
index 08ae741a992..f3e7b7f82af 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
index 72d4b47b919..4654cf33e9b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_omni.bin
index 32d3368fcdd..a1369295751 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm.bin
index 794fc311b05..75de94d5d7e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_csm.bin
index e692ce6a5f3..4b99893b6be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear.bin
index c6aa9bb1605..96745e909fe 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
index 83be379f851..32e7e3b55f9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
index 90a79727576..7e22436b4ef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_omni.bin
index 0bdd8f296b3..8bf0df91f13 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_lightning_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_texture.bin
index b9d3df5e087..c2e9abff4f3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur.bin
index a29e4998a3d..50abe5a34e9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur_vsm.bin
index 6d5ab82bda4..2bb9efb6c8b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth.bin
index 633a71eaeaf..c8ffafa85fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_linear.bin
index 96400c4f0e1..e9c292b023b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm.bin
index aa4b85d47ab..b9857fdf3b2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm_linear.bin
index a66ada9ad84..eb459e0913a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_texture.bin
index 51771e233e6..c40ab8f0508 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth.bin
index 9ef3f6a6a54..9f0ee665dd8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth_vsm.bin
index 293ea097d79..c9d2106ab65 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur.bin
index a29e4998a3d..50abe5a34e9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur_vsm.bin
index 6d5ab82bda4..2bb9efb6c8b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_lightning.bin
index c917ddf3261..6a27c7300f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_texture.bin
index b9d3df5e087..91b9ec7b7a1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackblank.bin
index 4747fa598e4..7d08d4d8815 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackcolor.bin
index d0bc7635bb3..02b5d7d35cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex1.bin
index 1927c3799f8..e9063cb8be1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex2.bin
index 03c0e5bb430..c71bdb9c136 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontblank.bin
index 9a5864e2f5b..cc76e50f1c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontcolor.bin
index d0bc7635bb3..02b5d7d35cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex1.bin
index 1927c3799f8..e9063cb8be1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex2.bin
index 03c0e5bb430..c71bdb9c136 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svside.bin
index bcfeadf4c45..4b54caf54fb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsideblank.bin
index 53b06d33a27..7a7e6bfc25a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidecolor.bin
index 88cf95cf3c1..49f452c9c26 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidetex.bin
index a662fffb723..26d3ba7dc4c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture.bin
index 51771e233e6..3406a9c63ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture_lightning.bin
index 6dc1221708b..2bac69eb29e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
index 19bfae2d072..32fa218efb4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
index 14c1ee5fbfd..00d1f8a4a6a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow.bin
index 8fae711210c..2477d864d9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
index 9f677a46fca..ba7432d9619 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_black.bin
index 8fae711210c..2477d864d9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_lightning.bin
index d3260e154e6..b7bb1b79867 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_texture.bin
index b9d3df5e087..91b9ec7b7a1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture.bin
index 51771e233e6..3406a9c63ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture_lightning.bin
index 411390e3947..e7405f58ad5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_tree.bin
index e3545cabcc2..018b83c8ea1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update.bin
index 28a7d9e5145..0d9517a6904 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin
index 1bd0ae427f5..0108d173eb5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_cmp.bin
index a711e35e75b..948b91cdb64 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blit.bin
index 63899d9fae7..a774280e2e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blur.bin
index 6dd383f79a4..c7144ae8468 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_fb.bin
index 2b620a87faa..f16eb976640 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump.bin
index 96a56e6e404..596456d7cd4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump_instanced.bin
index 976e45ca043..577c2f0c390 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_callback.bin
index bd208118d66..ec8b4310ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_cubes.bin
index 3a41de99801..2ab2bb4c2d8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
index 3a41de99801..2ab2bb4c2d8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
index 96a56e6e404..596456d7cd4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_blur.bin
index a4aa6bfd8a8..2163232b6ff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_bright.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lum.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lumavg.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_mesh.bin
index f6c68d7703d..778bf4db1a2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_skybox.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_tonemap.bin
index 04239696488..d43e9788fbf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
index 922f34a2554..b9febc31cb4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
index 19431c77e61..5aa032ea932 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_instancing.bin
index 242829adfea..72fbf2b22b9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_mesh.bin
index afed14ed8b1..0be1bdcaab9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit.bin
index 5b0f4d302d4..9b908d92d84 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit_blit.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_particle.bin
index 87620c4f22f..8d5c20604fc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_raymarching.bin
index b52f9088493..32a98a3bd43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color.bin
index 8f85c40edb9..ea5a1bb9eec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning.bin
index 4cd7bb1fc7d..9db9b5cf657 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_csm.bin
index 0102103cb31..fa34dbe5903 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear.bin
index 784559c2316..33294bc60f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_csm.bin
index 29a4d89ca48..1d1a9cb4336 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_omni.bin
index bb435c9705b..2f77d700594 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_omni.bin
index 76b66b2ddf7..5f1c27c88c3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_lightning_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_depth.bin
index 8f85c40edb9..ea5a1bb9eec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_hblur.bin
index 587e1c5ea52..ae4f645b805 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth.bin
index ba60f4be48d..571197880c4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth_linear.bin
index dfbe275efe9..bb3c7e10045 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture_lightning.bin
index 9ddeb6b0314..aee7ea99961 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_unpackdepth.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_vblur.bin
index 0bef94602dd..7f4381f77fa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_lightning.bin
index d948a54aac5..22ca9af2f5f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svback.bin
index 3f8abf9bd2b..f7df4d8245a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svfront.bin
index 8f85c40edb9..ea5a1bb9eec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svside.bin
index e666405fa49..02904ce8d68 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture_lightning.bin
index 68c21c047fd..643a962a1ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_mesh.bin
index 445f521ba13..29a82478915 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow.bin
index 8f85c40edb9..ea5a1bb9eec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow_pd.bin
index 6bf6bfda9b5..cfe2231a2f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color.bin
index 8f85c40edb9..ea5a1bb9eec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_lightning.bin
index 8a8461290c8..74709d7dddd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture.bin
index f9ffaa68676..2278290e567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture_lightning.bin
index b4a620d07c4..0503e565ef7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_tree.bin
index 3c121ff0458..ccbdc821768 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_update.bin
index ee9ec2a3e36..d8d9558017c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_vectordisplay_fb.bin
index b52f9088493..32a98a3bd43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
index 4bc05ae5253..a074cd8a3e2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
index 347b2a17045..57876856254 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
index 0108011f01b..bdffeb9c076 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
index 829c5fc3eda..cc13a509ba8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
index 68b8ece5153..4cac33773e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
index 0108011f01b..bdffeb9c076 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
index 9697d9715f3..c8cbf705ea2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
index e50e94ea95e..5c16613bad5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
index 2334c4478e9..f426518b036 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
index 684bfb42213..38c67736508 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
index e1ae5fa9831..f2be253e8b7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
index 16fbce916db..0fe106a0adb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
index 3162abdf1b2..7c2c50723bd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
index de67b2edc2a..0598ce6cc4f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
index fbbe57f8539..f9c5bdf5f56 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
index 05e4cc64e2e..873b11cf560 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
index 6024963efb0..a68ed6cf51d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
index 0108011f01b..bdffeb9c076 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
index 43352e6238e..09e8453a1d6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
index 2f8873ad6ec..38475da682f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
index bd4ca7f2cbc..b041df0bda7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
index 751406dca4e..c51c81e1b96 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
index 4becff53b9b..332cd07bc4a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
index 723c501d25f..c1f188e8370 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
index c816f0058f3..c52033f7e3b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
index 34bbe518343..d3cd94464fb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
index db15ddd5d0b..1759b12105b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm.bin
index f9f32dc30d7..0ebc05de809 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_csm.bin
index f474056bd6d..ae8d997d040 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear.bin
index 33651228686..06d600bc563 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_csm.bin
index 390076b93df..c797f9d359a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_omni.bin
index 386135a01d9..83a7200e42b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_omni.bin
index e0baf11d1ef..30a32b876fb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard.bin
index 8dc3b26c993..8d671384108 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_csm.bin
index 72bd2b12e68..7550ab771be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear.bin
index 758d4e62f42..c1837a5cc7f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_csm.bin
index 7d97c3c6c94..2f7a8e6a477 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_omni.bin
index c996ee43c30..b20f27e5f50 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_omni.bin
index a6374c28274..285976d1c62 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf.bin
index ad93b380fbb..008536682f4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_csm.bin
index 9eac9f23669..aedb20eb619 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear.bin
index 3584bfd889c..57c763439b5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
index 6c0c71328b8..1ba9fc72be1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
index 1c9bbb0dc20..66abdeb2efd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_omni.bin
index f5eb2db0d01..2a2d3b3481e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm.bin
index 3435d2da946..7e8b0bdc566 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_csm.bin
index d834a552612..f3a1ecd2586 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear.bin
index d58f1125d48..d6a5555fd04 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
index e2f37d0328e..1e355c21a89 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
index 2fd74a843fe..50b94e1c5cf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_omni.bin
index bea8d104be0..5e82a73b20f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_lightning_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
index ae841b20f23..816e771389e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
index f2078e17459..0014266fb98 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
index 6c5dfc3a5f9..088921490a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
index 90a3c8e66e2..4a693345ca4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
index b546425c545..1c98ebebaa9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
index 02f116d68e5..f146f09bfc0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
index eee825a5954..89745b960ce 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
index 79fcee4f529..c8d44342e49 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
index c1362a520b1..bab1a305755 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
index a4300f4a81a..55c5f9e10ca 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
index f2078e17459..0014266fb98 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
index 6c5dfc3a5f9..088921490a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lightning.bin
index 2b485b190e7..d2b3c50f5ec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
index ae841b20f23..3b34c1191f9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
index 5f2a390ae65..f35fe6e1dfd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
index fe3c98b8a14..57089f27fe2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
index 3bb7ca59764..49110e0ed14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
index e665de3887c..7752be6658d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
index d2ae7f433af..b201b42a274 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
index fe3c98b8a14..57089f27fe2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
index 3bb7ca59764..49110e0ed14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
index e665de3887c..7752be6658d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
index ee9999fdf11..4ba5d987404 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
index 034af143c9e..95a432fd6e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
index 13169718c3c..6e349468748 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
index 196b91e4771..a299cf2199c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
index 79fcee4f529..4cac33773e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lightning.bin
index 90bd45ba152..216041c92be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
index eefef33599d..402646e293d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
index c5f075af753..fe0dadd74f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
index db15ddd5d0b..1759b12105b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
index e9b02f5dfb7..5c8c5a455f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
index db15ddd5d0b..1759b12105b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lightning.bin
index 734570ad9c2..812a7288250 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
index ae841b20f23..3b34c1191f9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
index 79fcee4f529..4cac33773e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lightning.bin
index ac5c402be31..dfa60bab5a3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
index ae11aa20eb1..ddc984405d1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
index 5498219bf47..9b583ab3ef4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
index 4cf2358fc46..abc86d23a09 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
index a5f7a508e2d..97e41b8eee1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
index bb961692993..8793fcf84de 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
index b5aa0399b69..905e8dd5d7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
index 396a61b0313..8b22edabe2b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
index dbbdeb9d5ce..ae10af6fa40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
index 7e3fa3cbc1b..19f743864cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
index 6fbdd9666c7..5b24007c6dc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
index ea3136548ce..6bed4a49eb9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
index ea3136548ce..6bed4a49eb9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
index dbbdeb9d5ce..ae10af6fa40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
index 407f06db523..aafc58d61d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
index 52d35e7265d..f8a154140aa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
index 0b8adb44a65..c1734e3e3fc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
index d6a8adb23eb..a4e8c3d11e9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
index 295af709d4a..92fb53dd59b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
index d99a711621f..9cc463534d9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
index 86b9ecf96c6..62f5bd31dae 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
index 5b6bc306da8..0bd10c7a53f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
index 2148ec57ee1..fa1d3b9a442 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
index 06316a553f4..63ec02a3531 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
index 1dc1eb8eb60..4550c08d137 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning.bin
index 2cb230201d4..93a692801b5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_csm.bin
index e8ef1b2ab66..6b819879e75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear.bin
index 1914345cc19..3bc8a261ee5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_csm.bin
index 06b4150942b..9e7c86f7bb1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_omni.bin
index 4f5a51c0f35..2c6c09c36c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_omni.bin
index fb98e9b192b..7a0105a308d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_lightning_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
index 1dc1eb8eb60..4550c08d137 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
index 78849bce910..17606423b6c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
index b3b2c76fcdb..3e5827745c0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
index 54fcc1a5c0b..329980ae388 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lightning.bin
index d221ef09436..a04a6320173 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
index c91c158b87e..347b4ed021b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lightning.bin
index 4cef2540883..f948ab9105f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
index 8456d7f92f2..ff9efe36483 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
index 1dc1eb8eb60..4550c08d137 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
index b1eae0e7000..7571a1e53fa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lightning.bin
index 4bf0cff8806..e632b911c39 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
index 87a5007fe90..f5b0d896104 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
index 1dc1eb8eb60..4550c08d137 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
index eb6609a5cd0..3bd185477f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
index 1dc1eb8eb60..4550c08d137 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lightning.bin
index 3deb18e91f7..bedf096177e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
index c9f514aa053..a299604962c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lightning.bin
index 0a91b904da6..7257af2e87f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
index 573b06ff280..9e69b0bb4a4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
index a7deb192dcb..1c043f0ad5c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
index 06316a553f4..63ec02a3531 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx9/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin
new file mode 100644
index 00000000000..72c5eaf6bb2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
index a65f651e35c..048a96abc67 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
index c8ecec1ed96..1059fa84416 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin
index 2c5bad44d23..c0d146336e2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin
index d55eef9ec9e..4be92138513 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_cubes.bin
index e3c452fb1ef..de509a3eeb5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin
index 6c4068356e3..9f444cd6809 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug.bin
index 2853d847a0d..18195420f57 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug_line.bin
index e3c452fb1ef..de509a3eeb5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin
index 75244097861..16d128fe345 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin
index be822092996..2730664891e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin
index a67575a01d2..91adc88bec9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin
index 631547846eb..f978ba318f9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin
index db6d2f22c7a..5c24ceba783 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin
index 2e2f8d0a53c..c1454ba68c7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin
index a1dfd098153..57551110328 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin
index 8f3921cd48a..ab749d22b16 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin
index e325d9aaf34..48b5272d87c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
index 593b4035fd1..5e96353619c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
index cf240542199..bb2e9aeafe3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_instancing.bin
index e3c452fb1ef..de509a3eeb5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin
index 6778a6775b8..75aeaeeaadf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit.bin
index 319b651eed1..8c5294afa49 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
index 6348267e457..e594526cf19 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_blit.bin
index 7f13dca6273..cd2a8d201c4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
index 22899332c34..51ae8f2dbaf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate_blit.bin
index fd506a7b5eb..ca62c6e3ff5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin
index 1dad1e78498..d56a476ee07 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin
index a74f5480d3c..0fc2f3703ff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin
index 096059b53f1..0a7b4118d9e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin
index c263fce3d50..7316f095fa3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin
index 9a106fe2cf4..01131f3d85c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin
index 2ad0305c3df..5f342ec396a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin
index 9425ccfc7c9..0a1677885b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin
index 4c51e759952..a9c0f3f7234 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin
index 96a28378993..384fe08e17f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin
index b8b3b68e787..ad36fa13de6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin
index ff241dcc87c..5f75eb78748 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin
index 89be59b182e..d8b2e73926a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin
index 9663c9f2a26..18389d52061 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin
index 987755f615b..101c938ca7b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin
index 07fa4e6ab8c..1c77fb06cde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin
index 41d8f2c6210..acdaba7a85c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin
index 498a54e7897..2e3c8032449 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
index b8e41b4c324..555297a60d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
index e35a3702f8b..5ec150317bb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin
index a169733cebe..ff27f69318f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin
index d62fb29ffc3..372c9106da3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin
index b9f26763243..b53921656e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin
index 42086c83595..6d0b631bcdf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
index 926a38fe58c..8b778ad84fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
index 1940c9d85cd..7c496d2d736 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin
index 1d873d1dfec..0496f530f14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin
index 48ad9bde0f2..885640dda0a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
index 59623fe13df..e635da9c9bc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin
index 88a9091830f..8cd91a899a9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
index 3d8bcb3dfb3..d6bdeb0b6c9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
index d90aac8cdb6..c1c6b516290 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin
index 811e3eb7197..e50fed3c64d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin
index 89ddb22f716..c2ccac516e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin
index 3d88839874d..f021c850793 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
index 8dc32522c1b..b963ccfd100 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin
index e004d5bd2dd..fac7a851ad1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
index 59623fe13df..e635da9c9bc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin
index 88a9091830f..8cd91a899a9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin
index f0f4f35a2f2..a96ffde0b40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin
index 48ad9bde0f2..d843710a8b0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
index 3bcf87c1624..2222aa66d6d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin
index 5fcd8ee14e2..037db8cc859 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin
index 75de052c027..be30cfc29dc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin
index 765483377bb..add036b2560 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin
index 61163f58808..cbe487457f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin
index 5fcd8ee14e2..037db8cc859 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin
index abf74d5f109..3b160781d19 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin
index 1fb23be2a48..92620196e3a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin
index 8e5f01d7440..205d7185386 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin
index 72019d1fcf8..24f593e21da 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin
index 898606a1d01..455d85035da 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin
index d01b3a0303d..0e732199535 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin
index 3d88839874d..18195420f57 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin
index ed4bd0584ea..5e59912aba7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin
index f47b0335341..fe1fee41cb6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
index 548e48e2104..7ba659fb8ff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
index 3d8bcb3dfb3..d6bdeb0b6c9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_black.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin
index e4d2da062ef..776c24867fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin
index 48ad9bde0f2..d843710a8b0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture.bin
index 3d88839874d..18195420f57 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin
index 18d0cac34e4..7e823c40ea9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin
index b268a905f43..2bd2dbc1229 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update.bin
index 3d382a3149a..f754924f104 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
index 636d67fcb21..b7b8fb4cd0e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_cmp.bin
index 1231ed164df..57a1dc6c27b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blit.bin
index 1c4e4374cb4..14776fe31e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blur.bin
index fe96a936cb2..9c3bee0bf39 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_fb.bin
index da74756ae2d..2d63fcfca45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump.bin
index 584a06a416a..bc648979ebf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump_instanced.bin
index 4fa04ebbc0a..dca3ab761cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_callback.bin
index 904e7a0b540..c476e63c8f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_cubes.bin
index 74daaf97ddf..e45e21d5221 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_combine.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug_line.bin
index 74daaf97ddf..e45e21d5221 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_geom.bin
index 584a06a416a..bc648979ebf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_light.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_blur.bin
index df79ac88ae1..b01e8d247be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_bright.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lum.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lumavg.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_mesh.bin
index c6c2ac99726..54ca679f238 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_skybox.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_tonemap.bin
index b9b599d4a03..40e2f68e743 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
index c38a2a61125..fa99121843b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
index 48c9f352131..6a3f2f2e619 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_instancing.bin
index f3bb319f202..809e2ef0fd1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_mesh.bin
index 65a0ff078de..206f16ac278 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit.bin
index c8981989e5d..0aa675e0471 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit_blit.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_particle.bin
index 935b3b3b7dd..319468ccf2b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_raymarching.bin
index 048425644b3..e1ad85e5d40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color.bin
index f6c7b8c409a..0f88a6bbb88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin
index dcf941255a0..f94a6d8164a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin
index d977615dd26..2b37ce8c997 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin
index ecfac75ed0e..72c9d7f909f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin
index f328ea3b627..203531db55f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin
index d60d6a48064..9a969e29c97 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin
index b73a33f1e45..7dc9beebe9e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin
index f6c7b8c409a..0f88a6bbb88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin
index d50626daf3d..cbc198fafc3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin
index 226acce4d60..f0322e5fdd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin
index 139680a2644..133ae6017cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin
index 3dfde4d7138..b79e5f767a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin
index 4deb8068b72..ea2ef934f60 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin
index d34be5b2e40..9e99653dd37 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin
index 61065e02a93..3c54366063d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin
index f6c7b8c409a..0f88a6bbb88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin
index b0c3dcf266d..1bc67deb511 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin
index 3dfde4d7138..b79e5f767a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_mesh.bin
index a56af6e5fd7..0b61754c913 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow.bin
index f6c7b8c409a..0f88a6bbb88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin
index 226acce4d60..f0322e5fdd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color.bin
index f6c7b8c409a..0f88a6bbb88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin
index d34be5b2e40..9e99653dd37 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture.bin
index efe27355d50..3368689b86a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin
index 3dfde4d7138..b79e5f767a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_tree.bin
index 73e62d45f53..4dcda77b709 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_update.bin
index 6f81ac00613..11ae4ca3876 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_vectordisplay_fb.bin
index 048425644b3..e1ad85e5d40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/gles/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/gles/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
index 575406b70eb..146f0f80889 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
index dc22cc94a45..8c0aa81a7c4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
index 36acf9bd63c..04eb1a408b5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin
index 6afd5f5bce6..d8f1a5d7226 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin
index 7ee39df1960..ea83094fa23 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_cubes.bin
index c69e52960ec..6f8e3df8290 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
index 51568821223..5deb207e94d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
index f9efeaf059a..d9bf2d2c4a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
index c69e52960ec..6f8e3df8290 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
index 8b563240593..2a833e00bfb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
index df0a7d10736..f623de8d234 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin
index 833c51dc4e1..c51399d333a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin
index 675f22c2d50..11d6506257d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin
index 499021728d4..062005e0a8f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin
index 194140e95d8..e5f6cc585fe 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin
index fc4ed71ccb3..6a3d0772e14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_skybox.bin
index d38ecc16458..a14e4323d1a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin
index f636cca2d63..2a877923cef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
index 31dee889f18..2e35f1e240e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin
index 8a3b35647bd..16c6969b746 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_instancing.bin
index c69e52960ec..6f8e3df8290 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin
index 16e65568a00..e761dfca77e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit.bin
index 2d23e4850ac..cd6f420e9dd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
index 33211f436da..32f69e5aed2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_blit.bin
index b2d3250d6e9..998144e1b45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
index 8dd17a78b2e..d77b34792fa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate_blit.bin
index d8818f07afc..31fe76ab83d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_particle.bin
index 0140c3d8982..6153a0ee0b3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin
index 2fd4cee5af7..19c63becfe8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_black.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin
index c0a66357e4b..c158fab0530 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin
index fc3c5438596..4c54039dd29 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin
index d398f125f62..afec490e51c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin
index fd9f1777e99..c8e67a6b134 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin
index 91fdc59abd8..ab2002f7cc2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin
index a1131ef6d03..f7b3944e05b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin
index fb4b7d1e173..911579fc0b5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin
index 5f83b996f9f..b9b683980c4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin
index b6d7cb68eb8..6d5d493fbc0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin
index 42df593d129..3b1269cf028 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin
index d0a480f8f2d..770c1297acd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin
index 7a12642aed4..6b06a2ccf35 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin
index 2b35212e22f..ae8c23a6130 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin
index 2b07d3c3362..d485d900014 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin
index 0ebf2aceecc..b635a6bf4f9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
index 91a23eda013..1f7ce109cfd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
index fb7c778d59c..5265cd5803c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin
index e4e06289579..35f142f65ca 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin
index 56897d5250c..4cbaeda75b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin
index 5795fd204b8..96d35c6b0b0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin
index 6526a23861e..83d645a4088 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
index 61cd980fba4..19971b517aa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
index 6caa801a0cd..800d24e1aa2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin
index 322b002b190..eaf1d915411 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin
index 1985a019ffa..08ec2bbf471 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
index 67e5c8b1a53..a4b099de0de 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin
index 67ff0cca32d..a7eb99190dc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
index eeb4cc3e099..6148b430945 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
index 3c4b6939ed6..d59593b94a3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm.bin
index 88477e5eb39..1c3b380747f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm_linear.bin
index 46690567848..d89b12c6a1f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin
index 8e2bdd70924..fafb0e9002a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
index bb5e6102d59..af6a2d0c727 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin
index 1e832a47010..98435947567 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
index 67e5c8b1a53..a4b099de0de 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin
index 67ff0cca32d..a7eb99190dc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin
index 6e33b509f45..1dd99786c68 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin
index 1985a019ffa..16e982ef81c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
index 3bcf87c1624..2222aa66d6d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackcolor.bin
index 1bca2a9ca21..d7f14f0edc7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin
index 3a91565b1d5..41599dec915 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin
index cb120e02bf6..a8ebd7e2e24 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin
index 61163f58808..cbe487457f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontcolor.bin
index 1bca2a9ca21..d7f14f0edc7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin
index 69d42d30d98..63ec33854a4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin
index 5bc71deeb01..c69fe99787f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin
index 92108021d10..46bb55c8e5b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsideblank.bin
index 72019d1fcf8..24f593e21da 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidecolor.bin
index 102aa8235c9..cfcae3f3b06 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin
index 3ca5921c578..90ade7bdfde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin
index 8e2bdd70924..d9bf2d2c4a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin
index 4a53ef15b18..4d517df717d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin
index e8a1b580115..31f9f2f4a79 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
index 04429baf7a0..e18e85fbbcb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin
index eeb4cc3e099..6148b430945 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_black.bin
index e1169c71706..98147ab064a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin
index d36d01338cd..4135af924d1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin
index 1985a019ffa..16e982ef81c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture.bin
index 8e2bdd70924..d9bf2d2c4a0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin
index 474a9b3ccdf..b9d80197e47 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin
index 112f7772b48..48d7ea940b3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update.bin
index f19f2c54fa7..4c63286d14f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
index 0dd12aaa48e..8b9af3fc299 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_cmp.bin
index d8e985ed197..8140d027b7c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blit.bin
index 81b0a64fffa..ecbe0244c48 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blur.bin
index 2f2c75456b6..de29eabbdd0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_fb.bin
index d2ccacf1a6d..43ef526713b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump.bin
index 90846090824..1305f0b5ae4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump_instanced.bin
index 5984139704d..f36aa07e97f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_callback.bin
index 9b7cf07bdc4..22c9c2a85a4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_cubes.bin
index 72bd79a52d4..14e430c2852 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
index 72bd79a52d4..14e430c2852 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
index 90846090824..1305f0b5ae4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_blur.bin
index 12877df2307..7842c331742 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_bright.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lum.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_mesh.bin
index b3830abd0e4..1673c922879 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_skybox.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin
index 5f7653bab35..98cbe1fdbde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
index dcc212c876c..172605cd36f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
index 8692f4df58a..dcf57829e4a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_instancing.bin
index e5aaf578707..a625ee1cf96 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_mesh.bin
index f8d8bc8918e..4402482062d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit.bin
index 58697b3dec2..22442f74b74 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit_blit.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_particle.bin
index 652ebb75dc2..79a7c5a725f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_raymarching.bin
index 55c2635cdfc..e2941e6b5cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin
index 3e3340aec36..1e0b06b0abf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin
index 4d24835e41e..22a1174e4fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin
index 64392fdac21..88275faa666 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin
index 6819ef3d404..9be46ed63a3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin
index 4235cd8b83a..f7dd09c0b22 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin
index bf2e228f5b0..ab2b5f800da 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin
index 0970d2fae5f..791d2d8f7a8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin
index 3e3340aec36..1e0b06b0abf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin
index 08fb08d8996..4745bd56d42 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin
index fa560bbcc50..099732ee310 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin
index 364806d8795..948af8f4698 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin
index b1345004e3d..aa79e920ad2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin
index 7f42cae7114..16073d09cd3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin
index 3d3c9dc30bc..851bba285e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin
index b84f0f526df..42a40d7fb47 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin
index 3e3340aec36..1e0b06b0abf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin
index a21c6a054a5..8a8bd58d57a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin
index b1345004e3d..aa79e920ad2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_mesh.bin
index 3d5c69a7f19..f78b90342e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow.bin
index 3e3340aec36..1e0b06b0abf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin
index fa560bbcc50..099732ee310 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color.bin
index 3e3340aec36..1e0b06b0abf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin
index 3d3c9dc30bc..851bba285e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture.bin
index 7b5dc61e351..c75e2e66ea5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin
index b1345004e3d..aa79e920ad2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_tree.bin
index f72bb603e29..06e825aaa8d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_update.bin
index 0987b5a84cd..81f5a9c4109 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_vectordisplay_fb.bin
index 55c2635cdfc..e2941e6b5cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin
new file mode 100644
index 00000000000..d9c2da922fc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin
new file mode 100644
index 00000000000..9ac95509870
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin
new file mode 100644
index 00000000000..fb726f353c0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin
new file mode 100644
index 00000000000..fa8ca277c11
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin
new file mode 100644
index 00000000000..e48079000cc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin
new file mode 100644
index 00000000000..fb726f353c0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin
new file mode 100644
index 00000000000..8a18929a80c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin
new file mode 100644
index 00000000000..89bc35bc2a3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin
new file mode 100644
index 00000000000..14475c3ade0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin
new file mode 100644
index 00000000000..6ec541f32ad
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin
new file mode 100644
index 00000000000..76ff3900cd3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin
new file mode 100644
index 00000000000..f4d3784e6da
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin
new file mode 100644
index 00000000000..f650d6686b2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin
new file mode 100644
index 00000000000..d113a607c3e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin
new file mode 100644
index 00000000000..bb42a0bdae8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
new file mode 100644
index 00000000000..3ee33011539
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
new file mode 100644
index 00000000000..f36f1f5ebba
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_instancing.bin
new file mode 100644
index 00000000000..fb726f353c0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin
new file mode 100644
index 00000000000..f99861205a3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin
new file mode 100644
index 00000000000..6d6012f5eb3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
new file mode 100644
index 00000000000..2dae0e8f200
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
new file mode 100644
index 00000000000..ef295e63d22
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
new file mode 100644
index 00000000000..2ef7b1b065c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
new file mode 100644
index 00000000000..3772fd2de80
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin
new file mode 100644
index 00000000000..39d113334d6
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin
new file mode 100644
index 00000000000..1a3de3d0ab9
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin
new file mode 100644
index 00000000000..5281abc6100
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm.bin
new file mode 100644
index 00000000000..5b9813e8595
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_csm.bin
new file mode 100644
index 00000000000..c5a8b4b215c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear.bin
new file mode 100644
index 00000000000..c4d87c03987
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_csm.bin
new file mode 100644
index 00000000000..2eeed8cde91
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_omni.bin
new file mode 100644
index 00000000000..4ce8af71a63
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_omni.bin
new file mode 100644
index 00000000000..ca3449ca4d2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard.bin
new file mode 100644
index 00000000000..d8fe2fc1ae9
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_csm.bin
new file mode 100644
index 00000000000..5089c8f1d23
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear.bin
new file mode 100644
index 00000000000..1884107d6bc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_csm.bin
new file mode 100644
index 00000000000..2fa958d85bd
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_omni.bin
new file mode 100644
index 00000000000..6e7bffc7959
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_omni.bin
new file mode 100644
index 00000000000..af048da8a6f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf.bin
new file mode 100644
index 00000000000..467c47d243e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_csm.bin
new file mode 100644
index 00000000000..6faad277fd6
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear.bin
new file mode 100644
index 00000000000..3e0fbb37abc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
new file mode 100644
index 00000000000..31dd9f7c420
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
new file mode 100644
index 00000000000..3a5f285cf37
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_omni.bin
new file mode 100644
index 00000000000..e7c3ad1fa1a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm.bin
new file mode 100644
index 00000000000..a76c572dc2a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_csm.bin
new file mode 100644
index 00000000000..8915dd6c718
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear.bin
new file mode 100644
index 00000000000..79ddb6551c8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
new file mode 100644
index 00000000000..392fceccbd3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
new file mode 100644
index 00000000000..b377bf7db6a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_omni.bin
new file mode 100644
index 00000000000..953b60d9b18
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lightning_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
new file mode 100644
index 00000000000..ae7007c7af8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
new file mode 100644
index 00000000000..b5fe202adc9
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
new file mode 100644
index 00000000000..f42eef2fcc8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
new file mode 100644
index 00000000000..ccec78ba002
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
new file mode 100644
index 00000000000..67b12c79dcc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin
new file mode 100644
index 00000000000..7480677534d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin
new file mode 100644
index 00000000000..8b2ee2abbd3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
new file mode 100644
index 00000000000..436d6d4471f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
new file mode 100644
index 00000000000..cd9a6e88530
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
new file mode 100644
index 00000000000..94abea67646
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
new file mode 100644
index 00000000000..b5fe202adc9
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
new file mode 100644
index 00000000000..f42eef2fcc8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lightning.bin
new file mode 100644
index 00000000000..5f7d4490bb7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin
new file mode 100644
index 00000000000..52de7234847
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
new file mode 100644
index 00000000000..187800af846
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin
new file mode 100644
index 00000000000..ec4fa7bfff5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin
new file mode 100644
index 00000000000..51d0af3c132
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin
new file mode 100644
index 00000000000..65eefb71cd1
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
new file mode 100644
index 00000000000..747c3963734
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin
new file mode 100644
index 00000000000..ec4fa7bfff5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin
new file mode 100644
index 00000000000..1ee26821e14
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin
new file mode 100644
index 00000000000..d638ce4dbb2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin
new file mode 100644
index 00000000000..e67e7c2306e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin
new file mode 100644
index 00000000000..aaf666c25d8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin
new file mode 100644
index 00000000000..bdfa2f42428
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin
new file mode 100644
index 00000000000..843ccfa6f0e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin
new file mode 100644
index 00000000000..e48079000cc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lightning.bin
new file mode 100644
index 00000000000..7e7bbab26e3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
new file mode 100644
index 00000000000..5c173c76aac
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
new file mode 100644
index 00000000000..26a2cc3de69
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
new file mode 100644
index 00000000000..5281abc6100
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
new file mode 100644
index 00000000000..ccec78ba002
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin
new file mode 100644
index 00000000000..5281abc6100
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lightning.bin
new file mode 100644
index 00000000000..ec312f8a3d8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin
new file mode 100644
index 00000000000..52de7234847
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin
new file mode 100644
index 00000000000..e48079000cc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lightning.bin
new file mode 100644
index 00000000000..b0f45e5b5b6
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
new file mode 100644
index 00000000000..c36a93d60b5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin
new file mode 100644
index 00000000000..6deeecafcd6
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
new file mode 100644
index 00000000000..aa8f3cb2e9a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin
new file mode 100644
index 00000000000..0e9089a14d1
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin
new file mode 100644
index 00000000000..e1c858e537a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin
new file mode 100644
index 00000000000..2b71fdb79b3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin
new file mode 100644
index 00000000000..ab9efb8dd6e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin
new file mode 100644
index 00000000000..7998ca70fb0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin
new file mode 100644
index 00000000000..7ed86a0fd2b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin
new file mode 100644
index 00000000000..f7f3092c847
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin
new file mode 100644
index 00000000000..66262f6bc11
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin
new file mode 100644
index 00000000000..66262f6bc11
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin
new file mode 100644
index 00000000000..7998ca70fb0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin
new file mode 100644
index 00000000000..62e916b1c78
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin
new file mode 100644
index 00000000000..172750107c5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin
new file mode 100644
index 00000000000..6fb9ab855e1
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
new file mode 100644
index 00000000000..c29d5680e10
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
new file mode 100644
index 00000000000..ada939a9055
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_instancing.bin
new file mode 100644
index 00000000000..3201b941d1e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin
new file mode 100644
index 00000000000..53f57d4439a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin
new file mode 100644
index 00000000000..7dfd658840c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin
new file mode 100644
index 00000000000..be331f304db
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin
new file mode 100644
index 00000000000..38f1edfabd4
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin
new file mode 100644
index 00000000000..cf6de8b45c3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning.bin
new file mode 100644
index 00000000000..9dcdb61b4ee
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_csm.bin
new file mode 100644
index 00000000000..a143cfc02b8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear.bin
new file mode 100644
index 00000000000..02994d2b8b6
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_csm.bin
new file mode 100644
index 00000000000..8b833673081
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_omni.bin
new file mode 100644
index 00000000000..54785f92d0e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_omni.bin
new file mode 100644
index 00000000000..ac6332a27f3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lightning_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin
new file mode 100644
index 00000000000..cf6de8b45c3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin
new file mode 100644
index 00000000000..49949ec67e8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin
new file mode 100644
index 00000000000..1c1ec34d8c7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin
new file mode 100644
index 00000000000..a5471e7cb39
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lightning.bin
new file mode 100644
index 00000000000..2e7362934bb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin
new file mode 100644
index 00000000000..123787fa57a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lightning.bin
new file mode 100644
index 00000000000..2e782b0cb4c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin
new file mode 100644
index 00000000000..442d4977a71
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin
new file mode 100644
index 00000000000..cf6de8b45c3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin
new file mode 100644
index 00000000000..3b893600359
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lightning.bin
new file mode 100644
index 00000000000..2e7362934bb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin
new file mode 100644
index 00000000000..51bac010fba
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin
new file mode 100644
index 00000000000..cf6de8b45c3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin
new file mode 100644
index 00000000000..1c1ec34d8c7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin
new file mode 100644
index 00000000000..cf6de8b45c3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lightning.bin
new file mode 100644
index 00000000000..2e782b0cb4c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin
new file mode 100644
index 00000000000..10fb2d926e2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lightning.bin
new file mode 100644
index 00000000000..2e7362934bb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lightning.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin
new file mode 100644
index 00000000000..851e55ebc2e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin
new file mode 100644
index 00000000000..37e19eade16
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin
new file mode 100644
index 00000000000..38f1edfabd4
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/tvos-info.plist b/3rdparty/bgfx/examples/runtime/tvos-info.plist
new file mode 100644
index 00000000000..4aa5d31f9ca
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/tvos-info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>arm64</string>
+ </array>
+</dict>
+</plist>
diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx/bgfx.h
index 5f67ddee438..524953228c3 100644
--- a/3rdparty/bgfx/include/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/bgfx.h
@@ -6,15 +6,16 @@
#ifndef BGFX_H_HEADER_GUARD
#define BGFX_H_HEADER_GUARD
+#include <stdarg.h> // va_list
#include <stdint.h> // uint32_t
#include <stdlib.h> // size_t
-#include "bgfxdefines.h"
+#include <bgfx/bgfxdefines.h>
///
#define BGFX_HANDLE(_name) \
struct _name { uint16_t idx; }; \
- inline bool isValid(_name _handle) { return bgfx::invalidHandle != _handle.idx; }
+ inline bool isValid(_name _handle) { return bgfx::invalidHandle != _handle.idx; }
#define BGFX_INVALID_HANDLE { bgfx::invalidHandle }
@@ -23,6 +24,10 @@ namespace bx { struct ReallocatorI; }
/// BGFX
namespace bgfx
{
+ /// Fatal error enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_fatal_t`.
+ ///
struct Fatal
{
enum Enum
@@ -38,15 +43,20 @@ namespace bgfx
};
};
+ /// Renderer backend type enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_renderer_type_t`.
+ ///
struct RendererType
{
- /// Renderer type enumeration.
+ /// Renderer types:
enum Enum
{
Null, //!< No rendering.
Direct3D9, //!< Direct3D 9.0
Direct3D11, //!< Direct3D 11.0
Direct3D12, //!< Direct3D 12.0
+ Metal, //!< Metal
OpenGLES, //!< OpenGL ES 2.0+
OpenGL, //!< OpenGL 2.1+
Vulkan, //!< Vulkan
@@ -55,8 +65,13 @@ namespace bgfx
};
};
+ /// Access mode enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_access_t`.
+ ///
struct Access
{
+ /// Access:
enum Enum
{
Read,
@@ -67,9 +82,13 @@ namespace bgfx
};
};
+ /// Vertex attribute enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_attrib_t`.
+ ///
struct Attrib
{
- /// Corresponds to vertex shader attribute.
+ /// Corresponds to vertex shader attribute. Attributes:
enum Enum
{
Position, //!< a_position
@@ -93,60 +112,107 @@ namespace bgfx
};
};
+ /// Vertex attribute type enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_attrib_type_t`.
+ ///
struct AttribType
{
+ /// Attribute types:
enum Enum
{
- Uint8,
- Int16,
- Half, // Availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
- Float,
+ Uint8, //!< Uint8
+ Uint10, //!< Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
+ Int16, //!< Int16
+ Half, //!< Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
+ Float, //!< Float
Count
};
};
+ /// Texture format enum.
+ ///
+ /// Notation:
+ ///
+ /// RGBA16S
+ /// ^ ^ ^
+ /// | | +-- [ ]Unorm
+ /// | | [F]loat
+ /// | | [S]norm
+ /// | | [I]nt
+ /// | | [U]int
+ /// | +---- Number of bits per component
+ /// +-------- Components
+ ///
+ /// @attention Availability depends on Caps (see: formats).
+ ///
+ /// @attention C99 equivalent is `bgfx_texture_format_t`.
+ ///
struct TextureFormat
{
- // Availability depends on Caps (see: formats).
+ /// Texture formats:
enum Enum
{
- BC1, // DXT1
- BC2, // DXT3
- BC3, // DXT5
- BC4, // LATC1/ATI1
- BC5, // LATC2/ATI2
- BC6H, // BC6H
- BC7, // BC7
- ETC1, // ETC1 RGB8
- ETC2, // ETC2 RGB8
- ETC2A, // ETC2 RGBA8
- ETC2A1, // ETC2 RGB8A1
- PTC12, // PVRTC1 RGB 2BPP
- PTC14, // PVRTC1 RGB 4BPP
- PTC12A, // PVRTC1 RGBA 2BPP
- PTC14A, // PVRTC1 RGBA 4BPP
- PTC22, // PVRTC2 RGBA 2BPP
- PTC24, // PVRTC2 RGBA 4BPP
-
- Unknown, // compressed formats above
+ BC1, //!< DXT1
+ BC2, //!< DXT3
+ BC3, //!< DXT5
+ BC4, //!< LATC1/ATI1
+ BC5, //!< LATC2/ATI2
+ BC6H, //!< BC6H
+ BC7, //!< BC7
+ ETC1, //!< ETC1 RGB8
+ ETC2, //!< ETC2 RGB8
+ ETC2A, //!< ETC2 RGBA8
+ ETC2A1, //!< ETC2 RGB8A1
+ PTC12, //!< PVRTC1 RGB 2BPP
+ PTC14, //!< PVRTC1 RGB 4BPP
+ PTC12A, //!< PVRTC1 RGBA 2BPP
+ PTC14A, //!< PVRTC1 RGBA 4BPP
+ PTC22, //!< PVRTC2 RGBA 2BPP
+ PTC24, //!< PVRTC2 RGBA 4BPP
+
+ Unknown, // Compressed formats above.
R1,
+ A8,
R8,
+ R8I,
+ R8U,
+ R8S,
R16,
+ R16I,
+ R16U,
R16F,
- R32,
+ R16S,
+ R32I,
+ R32U,
R32F,
RG8,
+ RG8I,
+ RG8U,
+ RG8S,
RG16,
+ RG16I,
+ RG16U,
RG16F,
- RG32,
+ RG16S,
+ RG32I,
+ RG32U,
RG32F,
+ RGB9E5F,
BGRA8,
RGBA8,
+ RGBA8I,
+ RGBA8U,
+ RGBA8S,
RGBA16,
+ RGBA16I,
+ RGBA16U,
RGBA16F,
- RGBA32,
+ RGBA16S,
+ RGBA32I,
+ RGBA32U,
RGBA32F,
R5G6B5,
RGBA4,
@@ -154,7 +220,7 @@ namespace bgfx
RGB10A2,
R11G11B10F,
- UnknownDepth, // depth formats below
+ UnknownDepth, // Depth formats below.
D16,
D24,
@@ -169,28 +235,33 @@ namespace bgfx
};
};
+ /// Uniform type enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_uniform_type_t`.
+ ///
struct UniformType
{
+ /// Uniform types:
enum Enum
{
- Uniform1i,
- Uniform1f,
+ Int1,
End,
- Uniform1iv,
- Uniform1fv,
- Uniform2fv,
- Uniform3fv,
- Uniform4fv,
- Uniform3x3fv,
- Uniform4x4fv,
+ Vec4,
+ Mat3,
+ Mat4,
Count
};
};
+ /// Backbuffer ratio enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_backbuffer_ratio_t`.
+ ///
struct BackbufferRatio
{
+ /// Backbuffer ratios:
enum Enum
{
Equal,
@@ -219,11 +290,14 @@ namespace bgfx
BGFX_HANDLE(VertexDeclHandle);
/// Callback interface to implement application specific behavior.
- /// Cached items are currently used only for OpenGL binary shaders.
+ /// Cached items are currently used for OpenGL and Direct3D 12 binary
+ /// shaders.
///
/// @remarks
- /// 'fatal' callback can be called from any thread. Other callbacks
- /// are called from the render thread.
+ /// 'fatal' and 'trace' callbacks can be called from any thread. Other
+ /// callbacks are called from the render thread.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_interface_t`.
///
struct CallbackI
{
@@ -233,59 +307,95 @@ namespace bgfx
/// called on unrecoverable error. It's not safe to continue, inform
/// user and terminate application from this call.
///
- /// @param _code Fatal error code.
- /// @param _str More information about error.
+ /// @param[in] _code Fatal error code.
+ /// @param[in] _str More information about error.
+ ///
+ /// @remarks
+ /// Not thread safe and it can be called from any thread.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.fatal`.
///
virtual void fatal(Fatal::Enum _code, const char* _str) = 0;
+ /// Print debug message.
+ ///
+ /// @param[in] _filePath File path where debug message was generated.
+ /// @param[in] _line Line where debug message was generated.
+ /// @param[in] _format `printf` style format.
+ /// @param[in] _argList Variable arguments list initialized with
+ /// `va_start`.
+ ///
+ /// @remarks
+ /// Not thread safe and it can be called from any thread.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.trace_vargs`.
+ ///
+ virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) = 0;
+
/// Return size of for cached item. Return 0 if no cached item was
/// found.
///
- /// @param _id Cache id.
+ /// @param[in] _id Cache id.
/// @returns Number of bytes to read.
///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_read_size`.
+ ///
virtual uint32_t cacheReadSize(uint64_t _id) = 0;
/// Read cached item.
///
- /// @param _id Cache id.
- /// @param _data Buffer where to read data.
- /// @param _size Size of data to read.
+ /// @param[in] _id Cache id.
+ /// @param[in] _data Buffer where to read data.
+ /// @param[in] _size Size of data to read.
///
/// @returns True if data is read.
///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_read`.
+ ///
virtual bool cacheRead(uint64_t _id, void* _data, uint32_t _size) = 0;
/// Write cached item.
///
- /// @param _id Cache id.
- /// @param _data Data to write.
- /// @param _size Size of data to write.
+ /// @param[in] _id Cache id.
+ /// @param[in] _data Data to write.
+ /// @param[in] _size Size of data to write.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_write`.
///
virtual void cacheWrite(uint64_t _id, const void* _data, uint32_t _size) = 0;
/// Screenshot captured. Screenshot format is always 4-byte BGRA.
///
- /// @param _filePath File path.
- /// @param _width Image width.
- /// @param _height Image height.
- /// @param _pitch Number of bytes to skip to next line.
- /// @param _data Image data.
- /// @param _size Image size.
- /// @param _yflip If true image origin is bottom left.
+ /// @param[in] _filePath File path.
+ /// @param[in] _width Image width.
+ /// @param[in] _height Image height.
+ /// @param[in] _pitch Number of bytes to skip to next line.
+ /// @param[in] _data Image data.
+ /// @param[in] _size Image size.
+ /// @param[in] _yflip If true image origin is bottom left.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.screen_shot`.
///
virtual void screenShot(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _data, uint32_t _size, bool _yflip) = 0;
/// Called when capture begins.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_begin`.
+ ///
virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0;
/// Called when capture ends.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_end`.
+ ///
virtual void captureEnd() = 0;
/// Captured frame.
///
- /// @param _data Image data.
- /// @param _size Image size.
+ /// @param[in] _data Image data.
+ /// @param[in] _size Image size.
+ ///
+ /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_frame`.
///
virtual void captureFrame(const void* _data, uint32_t _size) = 0;
};
@@ -294,9 +404,15 @@ namespace bgfx
{
}
+ /// Memory release callback.
+ ///
+ /// @attention C99 equivalent is `bgfx_release_fn_t`.
///
typedef void (*ReleaseFn)(void* _ptr, void* _userData);
+ /// Memory obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
+ ///
+ /// @attention C99 equivalent is `bgfx_memory_t`.
///
struct Memory
{
@@ -305,6 +421,9 @@ namespace bgfx
};
/// Renderer capabilities.
+ ///
+ /// @attention C99 equivalent is `bgfx_caps_t`.
+ ///
struct Caps
{
/// Renderer backend type. See: `bgfx::RendererType`
@@ -330,21 +449,25 @@ namespace bgfx
///
uint64_t supported;
- uint32_t maxDrawCalls; ///< Maximum draw calls.
- uint16_t maxTextureSize; ///< Maximum texture size.
- uint16_t maxViews; ///< Maximum views.
- uint8_t maxFBAttachments; ///< Maximum frame buffer attachments.
- uint8_t numGPUs; ///< Number of enumerated GPUs.
- uint16_t vendorId; ///< Selected GPU vendor id.
- uint16_t deviceId; ///< Selected GPU device id.
+ uint32_t maxDrawCalls; //!< Maximum draw calls.
+ uint16_t maxTextureSize; //!< Maximum texture size.
+ uint16_t maxViews; //!< Maximum views.
+ uint8_t maxFBAttachments; //!< Maximum frame buffer attachments.
+ uint8_t numGPUs; //!< Number of enumerated GPUs.
+ uint16_t vendorId; //!< Selected GPU vendor id.
+ uint16_t deviceId; //!< Selected GPU device id.
+ /// GPU info.
+ ///
+ /// @attention C99 equivalent is `bgfx_caps_gpu_t`.
+ ///
struct GPU
{
uint16_t vendorId;
uint16_t deviceId;
};
- GPU gpu[4]; ///< Enumerated GPUs.
+ GPU gpu[4]; //!< Enumerated GPUs.
/// Supported texture formats.
/// - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported
@@ -354,26 +477,35 @@ namespace bgfx
uint8_t formats[TextureFormat::Count];
};
+ /// Transient index buffer.
+ ///
+ /// @attention C99 equivalent is `bgfx_transient_index_buffer_t`.
///
struct TransientIndexBuffer
{
- uint8_t* data;
- uint32_t size;
- uint32_t startIndex;
- IndexBufferHandle handle;
+ uint8_t* data; //!< Pointer to data.
+ uint32_t size; //!< Data size.
+ uint32_t startIndex; //!< First index.
+ IndexBufferHandle handle; //!< Index buffer handle.
};
+ /// Transient vertex buffer.
+ ///
+ /// @attention C99 equivalent is `bgfx_transient_vertex_buffer_t`.
///
struct TransientVertexBuffer
{
- uint8_t* data;
- uint32_t size;
- uint32_t startVertex;
- uint16_t stride;
- VertexBufferHandle handle;
- VertexDeclHandle decl;
+ uint8_t* data; //!< Pointer to data.
+ uint32_t size; //!< Data size.
+ uint32_t startVertex; //!< First vertex.
+ uint16_t stride; //!< Vertex stride.
+ VertexBufferHandle handle; //!< Vertex buffer handle.
+ VertexDeclHandle decl; //!< Vertex declaration handle.
};
+ /// Instance data buffer info.
+ ///
+ /// @attention C99 equivalent is `bgfx_texture_info_t`.
///
struct InstanceDataBuffer
{
@@ -385,6 +517,9 @@ namespace bgfx
VertexBufferHandle handle; //!< Vertex buffer object handle.
};
+ /// Texture info.
+ ///
+ /// @attention C99 equivalent is `bgfx_texture_info_t`.
///
struct TextureInfo
{
@@ -398,6 +533,9 @@ namespace bgfx
bool cubeMap; //!< Texture is cubemap.
};
+ /// Transform data.
+ ///
+ /// @attention C99 equivalent is `bgfx_transform_t`.
///
struct Transform
{
@@ -406,9 +544,15 @@ namespace bgfx
};
/// HMD info.
+ ///
+ /// @attention C99 equivalent is `bgfx_hmd_t`.
+ ///
struct HMD
{
/// Eye
+ ///
+ /// @attention C99 equivalent is `bgfx_hmd_eye_t`.
+ ///
struct Eye
{
float rotation[4]; //!< Eye rotation represented as quaternion.
@@ -419,47 +563,80 @@ namespace bgfx
};
Eye eye[2];
- uint16_t width; //!< Framebuffer width.
- uint16_t height; //!< Framebuffer width.
+ uint16_t width; //!< Framebuffer width.
+ uint16_t height; //!< Framebuffer width.
+ uint32_t deviceWidth; //!< Device resolution width
+ uint32_t deviceHeight; //!< Device resolution height
+ uint8_t flags; //!< Status flags
+ };
+
+ /// Renderer statistics data.
+ ///
+ /// @attention C99 equivalent is `bgfx_stats_t`.
+ ///
+ struct Stats
+ {
+ uint64_t cpuTime; //!< CPU frame time.
+ uint64_t cpuTimerFreq; //!< CPU timer frequency.
+
+ uint64_t gpuTime; //!< GPU frame time.
+ uint64_t gpuTimerFreq; //!< GPU timer frequency.
};
/// Vertex declaration.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_decl_t`.
+ ///
struct VertexDecl
{
VertexDecl();
/// Start VertexDecl.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_decl_begin`.
+ ///
VertexDecl& begin(RendererType::Enum _renderer = RendererType::Null);
/// End VertexDecl.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_decl_begin`.
+ ///
void end();
/// Add attribute to VertexDecl.
///
- /// @param _attrib Attribute semantics. See: `bgfx::Attrib`
- /// @param _num Number of elements 1, 2, 3 or 4.
- /// @param _type Element type.
- /// @param _normalized When using fixed point AttribType (f.e. Uint8)
+ /// @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
+ /// @param[in] _num Number of elements 1, 2, 3 or 4.
+ /// @param[in] _type Element type.
+ /// @param[in] _normalized When using fixed point AttribType (f.e. Uint8)
/// value will be normalized for vertex shader usage. When normalized
/// is set to true, AttribType::Uint8 value in range 0-255 will be
/// in range 0.0-1.0 in vertex shader.
- /// @param _asInt Packaging rule for vertexPack, vertexUnpack, and
+ /// @param[in] _asInt Packaging rule for vertexPack, vertexUnpack, and
/// vertexConvert for AttribType::Uint8 and AttribType::Int16.
/// Unpacking code must be implemented inside vertex shader.
///
/// @remarks
/// Must be called between begin/end.
///
+ /// @attention C99 equivalent is `bgfx_vertex_decl_add`.
+ ///
VertexDecl& add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized = false, bool _asInt = false);
/// Skip _num bytes in vertex stream.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_decl_skip`.
+ ///
VertexDecl& skip(uint8_t _num);
/// Decode attribute.
+ ///
+ /// @attention C99 equivalent is ``.
+ ///
void decode(Attrib::Enum _attrib, uint8_t& _num, AttribType::Enum& _type, bool& _normalized, bool& _asInt) const;
/// Returns true if VertexDecl contains attribute.
- bool has(Attrib::Enum _attrib) const { return 0xff != m_attributes[_attrib]; }
+ bool has(Attrib::Enum _attrib) const { return UINT16_MAX != m_attributes[_attrib]; }
/// Returns relative attribute offset from the vertex.
uint16_t getOffset(Attrib::Enum _attrib) const { return m_offset[_attrib]; }
@@ -473,90 +650,113 @@ namespace bgfx
uint32_t m_hash;
uint16_t m_stride;
uint16_t m_offset[Attrib::Count];
- uint8_t m_attributes[Attrib::Count];
+ uint16_t m_attributes[Attrib::Count];
};
/// Pack vec4 into vertex stream format.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_pack`.
+ ///
void vertexPack(const float _input[4], bool _inputNormalized, Attrib::Enum _attr, const VertexDecl& _decl, void* _data, uint32_t _index = 0);
/// Unpack vec4 from vertex stream format.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_unpack`.
+ ///
void vertexUnpack(float _output[4], Attrib::Enum _attr, const VertexDecl& _decl, const void* _data, uint32_t _index = 0);
/// Converts vertex stream data from one vertex stream format to another.
///
- /// @param _destDecl Destination vertex stream declaration.
- /// @param _destData Destination vertex stream.
- /// @param _srcDecl Source vertex stream declaration.
- /// @param _srcData Source vertex stream data.
- /// @param _num Number of vertices to convert from source to destination.
+ /// @param[in] _destDecl Destination vertex stream declaration.
+ /// @param[in] _destData Destination vertex stream.
+ /// @param[in] _srcDecl Source vertex stream declaration.
+ /// @param[in] _srcData Source vertex stream data.
+ /// @param[in] _num Number of vertices to convert from source to destination.
+ ///
+ /// @attention C99 equivalent is `bgfx_vertex_convert`.
///
void vertexConvert(const VertexDecl& _destDecl, void* _destData, const VertexDecl& _srcDecl, const void* _srcData, uint32_t _num = 1);
/// Weld vertices.
///
- /// @param _output Welded vertices remapping table. The size of buffer
+ /// @param[in] _output Welded vertices remapping table. The size of buffer
/// must be the same as number of vertices.
- /// @param _decl Vertex stream declaration.
- /// @param _data Vertex stream.
- /// @param _num Number of vertices in vertex stream.
- /// @param _epsilon Error tolerance for vertex position comparison.
+ /// @param[in] _decl Vertex stream declaration.
+ /// @param[in] _data Vertex stream.
+ /// @param[in] _num Number of vertices in vertex stream.
+ /// @param[in] _epsilon Error tolerance for vertex position comparison.
/// @returns Number of unique vertices after vertex welding.
///
+ /// @attention C99 equivalent is `bgfx_weld_vertices`.
+ ///
uint16_t weldVertices(uint16_t* _output, const VertexDecl& _decl, const void* _data, uint16_t _num, float _epsilon = 0.001f);
/// Swizzle RGBA8 image to BGRA8.
///
- /// @param _width Width of input image (pixels).
- /// @param _height Height of input image (pixels).
- /// @param _pitch Pitch of input image (bytes).
- /// @param _src Source image.
- /// @param _dst Destination image. Must be the same size as input image.
+ /// @param[in] _width Width of input image (pixels).
+ /// @param[in] _height Height of input image (pixels).
+ /// @param[in] _pitch Pitch of input image (bytes).
+ /// @param[in] _src Source image.
+ /// @param[in] _dst Destination image. Must be the same size as input image.
/// _dst might be pointer to the same memory as _src.
///
+ /// @attention C99 equivalent is `bgfx_image_swizzle_bgra8`.
+ ///
void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
/// Downsample RGBA8 image with 2x2 pixel average filter.
///
- /// @param _width Width of input image (pixels).
- /// @param _height Height of input image (pixels).
- /// @param _pitch Pitch of input image (bytes).
- /// @param _src Source image.
- /// @param _dst Destination image. Must be at least quarter size of
+ /// @param[in] _width Width of input image (pixels).
+ /// @param[in] _height Height of input image (pixels).
+ /// @param[in] _pitch Pitch of input image (bytes).
+ /// @param[in] _src Source image.
+ /// @param[in] _dst Destination image. Must be at least quarter size of
/// input image. _dst might be pointer to the same memory as _src.
///
+ /// @attention C99 equivalent is `bgfx_image_rgba8_downsample_2x2`.
+ ///
void imageRgba8Downsample2x2(uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _src, void* _dst);
/// Returns supported backend API renderers.
+ ///
+ /// @attention C99 equivalent is `bgfx_get_supported_renderers`.
+ ///
uint8_t getSupportedRenderers(RendererType::Enum _enum[RendererType::Count]);
/// Returns name of renderer.
+ ///
+ /// @attention C99 equivalent is `bgfx_get_renderer_name`.
+ ///
const char* getRendererName(RendererType::Enum _type);
/// Initialize bgfx library.
///
- /// @param _type Select rendering backend. When set to RendererType::Count
+ /// @param[in] _type Select rendering backend. When set to RendererType::Count
/// default rendering backend will be selected.
/// See: `bgfx::RendererType`
///
- /// @param _vendorId Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device.
+ /// @param[in] _vendorId Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
+ /// device.
/// - `BGFX_PCI_ID_NONE` - autoselect.
/// - `BGFX_PCI_ID_AMD` - AMD.
/// - `BGFX_PCI_ID_INTEL` - Intel.
/// - `BGFX_PCI_ID_NVIDIA` - nVidia.
///
- /// @param _deviceId Device id. If set to 0 it will select first device, or device with
+ /// @param[in] _deviceId Device id. If set to 0 it will select first device, or device with
/// matching id.
///
- /// @param _callback Provide application specific callback interface.
+ /// @param[in] _callback Provide application specific callback interface.
/// See: `bgfx::CallbackI`
///
- /// @param _reallocator Custom allocator. When custom allocator is not
+ /// @param[in] _reallocator Custom allocator. When custom allocator is not
/// specified, library uses default CRT allocator. The library assumes
/// icustom allocator is thread safe.
///
+ /// @returns `true` if initialization is sucessful.
+ ///
/// @attention C99 equivalent is `bgfx_init`.
///
- void init(RendererType::Enum _type = RendererType::Count, uint16_t _vendorId = BGFX_PCI_ID_NONE, uint16_t _deviceId = 0, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL);
+ bool init(RendererType::Enum _type = RendererType::Count, uint16_t _vendorId = BGFX_PCI_ID_NONE, uint16_t _deviceId = 0, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL);
/// Shutdown bgfx library.
///
@@ -566,9 +766,9 @@ namespace bgfx
/// Reset graphic settings and back-buffer size.
///
- /// @param _width Back-buffer width.
- /// @param _height Back-buffer height.
- /// @param _flags
+ /// @param[in] _width Back-buffer width.
+ /// @param[in] _height Back-buffer height.
+ /// @param[in] _flags See: `BGFX_RESET_*` for more info.
/// - `BGFX_RESET_NONE` - No reset flags.
/// - `BGFX_RESET_FULLSCREEN` - Not supported yet.
/// - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA.
@@ -578,9 +778,11 @@ namespace bgfx
/// - `BGFX_RESET_HMD` - HMD stereo rendering.
/// - `BGFX_RESET_HMD_DEBUG` - HMD stereo rendering debug mode.
/// - `BGFX_RESET_HMD_RECENTER` - HMD calibration.
+ /// - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU.
/// - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
/// occurs. Default behavior is that flip occurs before rendering new
/// frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ /// - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
///
/// @attention This call doesn't actually change window size, it just
/// resizes back-buffer. Windowing code has to change window size.
@@ -627,6 +829,10 @@ namespace bgfx
///
const HMD* getHMD();
+ /// Returns performance counters.
+ ///
+ const Stats* getStats();
+
/// Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
///
/// @attention C99 equivalent is `bgfx_alloc`.
@@ -652,7 +858,7 @@ namespace bgfx
/// Set debug flags.
///
- /// @param _debug Available flags:
+ /// @param[in] _debug Available flags:
/// - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set
/// all rendering calls will be skipped. It's useful when profiling
/// to quickly assess bottleneck between CPU and GPU.
@@ -679,12 +885,12 @@ namespace bgfx
/// Draw image into internal debug text buffer.
///
- /// @param _x X position from top-left.
- /// @param _y Y position from top-left.
- /// @param _width Image width.
- /// @param _height Image height.
- /// @param _data Raw image data (character/attribute raw encoding).
- /// @param _pitch Image pitch in bytes.
+ /// @param[in] _x X position from top-left.
+ /// @param[in] _y Y position from top-left.
+ /// @param[in] _width Image width.
+ /// @param[in] _height Image height.
+ /// @param[in] _data Raw image data (character/attribute raw encoding).
+ /// @param[in] _pitch Image pitch in bytes.
///
/// @attention C99 equivalent is `bgfx_dbg_text_image`.
///
@@ -692,8 +898,8 @@ namespace bgfx
/// Create static index buffer.
///
- /// @param _mem Index buffer data.
- /// @param _flags Buffer creation flags.
+ /// @param[in] _mem Index buffer data.
+ /// @param[in] _flags Buffer creation flags.
/// - `BGFX_BUFFER_NONE` - No flags.
/// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
/// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
@@ -718,8 +924,20 @@ namespace bgfx
/// Create static vertex buffer.
///
- /// @param _mem Vertex buffer data.
- /// @param _decl Vertex declaration.
+ /// @param[in] _mem Vertex buffer data.
+ /// @param[in] _decl Vertex declaration.
+ /// @param[in] _flags Buffer creation flags.
+ /// - `BGFX_BUFFER_NONE` - No flags.
+ /// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
+ /// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
+ /// is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.
+ /// - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.
+ /// - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if different amount of
+ /// data is passed. If this flag is not specified if more data is passed on update buffer
+ /// will be trimmed to fit existing buffer size. This flag has effect only on dynamic
+ /// buffers.
+ /// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
+ /// index buffers.
/// @returns Static vertex buffer handle.
///
/// @attention C99 equivalent is `bgfx_create_vertex_buffer`.
@@ -728,7 +946,7 @@ namespace bgfx
/// Destroy static vertex buffer.
///
- /// @param _handle Static vertex buffer handle.
+ /// @param[in] _handle Static vertex buffer handle.
///
/// @attention C99 equivalent is `bgfx_destroy_vertex_buffer`.
///
@@ -736,8 +954,8 @@ namespace bgfx
/// Create empty dynamic index buffer.
///
- /// @param _num Number of indices.
- /// @param _flags Buffer creation flags.
+ /// @param[in] _num Number of indices.
+ /// @param[in] _flags Buffer creation flags.
/// - `BGFX_BUFFER_NONE` - No flags.
/// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
/// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
@@ -756,8 +974,8 @@ namespace bgfx
/// Create dynamic index buffer and initialized it.
///
- /// @param _mem Index buffer data.
- /// @param _flags Buffer creation flags.
+ /// @param[in] _mem Index buffer data.
+ /// @param[in] _flags Buffer creation flags.
/// - `BGFX_BUFFER_NONE` - No flags.
/// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
/// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
@@ -776,16 +994,17 @@ namespace bgfx
/// Update dynamic index buffer.
///
- /// @param _handle Dynamic index buffer handle.
- /// @param _mem Index buffer data.
+ /// @param[in] _handle Dynamic index buffer handle.
+ /// @param[in] _startIndex Start index.
+ /// @param[in] _mem Index buffer data.
///
/// @attention C99 equivalent is `bgfx_update_dynamic_index_buffer`.
///
- void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem);
+ void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem);
/// Destroy dynamic index buffer.
///
- /// @param _handle Dynamic index buffer handle.
+ /// @param[in] _handle Dynamic index buffer handle.
///
/// @attention C99 equivalent is `bgfx_destroy_dynamic_index_buffer`.
///
@@ -793,9 +1012,9 @@ namespace bgfx
/// Create empty dynamic vertex buffer.
///
- /// @param _num Number of vertices.
- /// @param _decl Vertex declaration.
- /// @param _flags Buffer creation flags.
+ /// @param[in] _num Number of vertices.
+ /// @param[in] _decl Vertex declaration.
+ /// @param[in] _flags Buffer creation flags.
/// - `BGFX_BUFFER_NONE` - No flags.
/// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
/// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
@@ -814,9 +1033,9 @@ namespace bgfx
/// Create dynamic vertex buffer and initialize it.
///
- /// @param _mem Vertex buffer data.
- /// @param _decl Vertex declaration.
- /// @param _flags Buffer creation flags.
+ /// @param[in] _mem Vertex buffer data.
+ /// @param[in] _decl Vertex declaration.
+ /// @param[in] _flags Buffer creation flags.
/// - `BGFX_BUFFER_NONE` - No flags.
/// - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
/// - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer
@@ -835,9 +1054,13 @@ namespace bgfx
/// Update dynamic vertex buffer.
///
+ /// @param[in] _handle Dynamic vertex buffer handle.
+ /// @param[in] _startVertex Start vertex.
+ /// @param[in] _mem Vertex buffer data.
+ ///
/// @attention C99 equivalent is `bgfx_update_dynamic_vertex_buffer`.
///
- void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, const Memory* _mem);
+ void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem);
/// Destroy dynamic vertex buffer.
///
@@ -847,7 +1070,7 @@ namespace bgfx
/// Returns true if internal transient index buffer has enough space.
///
- /// @param _num Number of indices.
+ /// @param[in] _num Number of indices.
///
/// @attention C99 equivalent is `bgfx_check_avail_transient_index_buffer`.
///
@@ -855,8 +1078,8 @@ namespace bgfx
/// Returns true if internal transient vertex buffer has enough space.
///
- /// @param _num Number of vertices.
- /// @param _decl Vertex declaration.
+ /// @param[in] _num Number of vertices.
+ /// @param[in] _decl Vertex declaration.
///
/// @attention C99 equivalent is `bgfx_check_avail_transient_vertex_buffer`.
///
@@ -864,8 +1087,8 @@ namespace bgfx
/// Returns true if internal instance data buffer has enough space.
///
- /// @param _num Number of instances.
- /// @param _stride Stride per instance.
+ /// @param[in] _num Number of instances.
+ /// @param[in] _stride Stride per instance.
///
/// @attention C99 equivalent is `bgfx_check_avail_instance_data_buffer`.
///
@@ -874,9 +1097,9 @@ namespace bgfx
/// Returns true if both internal transient index and vertex buffer have
/// enough space.
///
- /// @param _numVertices Number of vertices.
- /// @param _decl Vertex declaration.
- /// @param _numIndices Number of indices.
+ /// @param[in] _numVertices Number of vertices.
+ /// @param[in] _decl Vertex declaration.
+ /// @param[in] _numIndices Number of indices.
///
/// @attention C99 equivalent is `bgfx_check_avail_transient_buffers`.
///
@@ -887,7 +1110,7 @@ namespace bgfx
/// @param[out] _tib TransientIndexBuffer structure is filled and is valid
/// for the duration of frame, and it can be reused for multiple draw
/// calls.
- /// @param _num Number of indices to allocate.
+ /// @param[in] _num Number of indices to allocate.
///
/// @remarks
/// 1. You must call setIndexBuffer after alloc in order to avoid memory
@@ -903,8 +1126,8 @@ namespace bgfx
/// @param[out] _tvb TransientVertexBuffer structure is filled and is valid
/// for the duration of frame, and it can be reused for multiple draw
/// calls.
- /// @param _num Number of vertices to allocate.
- /// @param _decl Vertex declaration.
+ /// @param[in] _num Number of vertices to allocate.
+ /// @param[in] _decl Vertex declaration.
///
/// @remarks
/// You must call setVertexBuffer after alloc in order to avoid memory
@@ -955,9 +1178,9 @@ namespace bgfx
/// Returns num of uniforms, and uniform handles used inside shader.
///
- /// @param _handle Shader handle.
- /// @param _uniforms UniformHandle array where data will be stored.
- /// @param _max Maximum capacity of array.
+ /// @param[in] _handle Shader handle.
+ /// @param[in] _uniforms UniformHandle array where data will be stored.
+ /// @param[in] _max Maximum capacity of array.
/// @returns Number of uniforms used by shader.
///
/// @remarks
@@ -976,9 +1199,9 @@ namespace bgfx
/// Create program with vertex and fragment shaders.
///
- /// @param _vsh Vertex shader.
- /// @param _fsh Fragment shader.
- /// @param _destroyShaders If true, shaders will be destroyed when
+ /// @param[in] _vsh Vertex shader.
+ /// @param[in] _fsh Fragment shader.
+ /// @param[in] _destroyShaders If true, shaders will be destroyed when
/// program is destroyed.
/// @returns Program handle if vertex shader output and fragment shader
/// input are matching, otherwise returns invalid program handle.
@@ -989,8 +1212,8 @@ namespace bgfx
/// Create program with compute shader.
///
- /// @param _csh Compute shader.
- /// @param _destroyShader If true, shader will be destroyed when
+ /// @param[in] _csh Compute shader.
+ /// @param[in] _destroyShader If true, shader will be destroyed when
/// program is destroyed.
/// @returns Program handle.
///
@@ -1030,17 +1253,36 @@ namespace bgfx
/// Create 2D texture.
///
- /// @param _width
- /// @param _height
- /// @param _numMips
- /// @param _format
- /// @param _flags
- /// @param _mem
+ /// @param[in] _width Width.
+ /// @param[in] _height Height.
+ /// @param[in] _numMips Number of mip-maps.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _flags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
+ ///
+ /// @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable.
///
/// @attention C99 equivalent is `bgfx_create_texture_2d`.
///
TextureHandle createTexture2D(uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint32_t _flags = BGFX_TEXTURE_NONE, const Memory* _mem = NULL);
+ /// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ /// if back buffer resolution changes.
+ ///
+ /// @param[in] _ratio Frame buffer size in respect to back-buffer size. See:
+ /// `BackbufferRatio::Enum`.
+ /// @param[in] _numMips Number of mip-maps.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _flags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
///
/// @attention C99 equivalent is `bgfx_create_texture_2d_scaled`.
///
@@ -1048,13 +1290,19 @@ namespace bgfx
/// Create 3D texture.
///
- /// @param _width
- /// @param _height
- /// @param _depth
- /// @param _numMips
- /// @param _format
- /// @param _flags
- /// @param _mem
+ /// @param[in] _width Width.
+ /// @param[in] _height Height.
+ /// @param[in] _depth Depth.
+ /// @param[in] _numMips Number of mip-maps.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _flags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
+ ///
+ /// @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable.
///
/// @attention C99 equivalent is `bgfx_create_texture_3d`.
///
@@ -1062,11 +1310,17 @@ namespace bgfx
/// Create Cube texture.
///
- /// @param _size
- /// @param _numMips
- /// @param _format
- /// @param _flags
- /// @param _mem
+ /// @param[in] _size Cube side size.
+ /// @param[in] _numMips Number of mip-maps.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _flags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
+ ///
+ /// @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable.
///
/// @attention C99 equivalent is `bgfx_create_texture_cube`.
///
@@ -1074,14 +1328,14 @@ namespace bgfx
/// Update 2D texture.
///
- /// @param _handle
- /// @param _mip
- /// @param _x
- /// @param _y
- /// @param _width
- /// @param _height
- /// @param _mem
- /// @param _pitch Pitch of input image (bytes). When _pitch is set to
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _mip Mip level.
+ /// @param[in] _x X offset in texture.
+ /// @param[in] _y Y offset in texture.
+ /// @param[in] _width Width of texture block.
+ /// @param[in] _height Height of texture block.
+ /// @param[in] _mem Texture update data.
+ /// @param[in] _pitch Pitch of input image (bytes). When _pitch is set to
/// UINT16_MAX, it will be calculated internally based on _width.
///
/// @attention C99 equivalent is `bgfx_update_texture_2d`.
@@ -1090,15 +1344,15 @@ namespace bgfx
/// Update 3D texture.
///
- /// @param _handle
- /// @param _mip
- /// @param _x
- /// @param _y
- /// @param _z
- /// @param _width
- /// @param _height
- /// @param _depth
- /// @param _mem
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _mip Mip level.
+ /// @param[in] _x X offset in texture.
+ /// @param[in] _y Y offset in texture.
+ /// @param[in] _z Z offset in texture.
+ /// @param[in] _width Width of texture block.
+ /// @param[in] _height Height of texture block.
+ /// @param[in] _depth Depth of texture block.
+ /// @param[in] _mem Texture update data.
///
/// @attention C99 equivalent is `bgfx_update_texture_3d`.
///
@@ -1106,34 +1360,34 @@ namespace bgfx
/// Update Cube texture.
///
- /// @param _handle
- /// @param _side Cubemap side, where 0 is +X, 1 is -X, 2 is +Y, 3 is
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _side Cubemap side, where 0 is +X, 1 is -X, 2 is +Y, 3 is
/// -Y, 4 is +Z, and 5 is -Z.
///
- /// +----------+
- /// |-z 2|
- /// | ^ +y |
- /// | | |
- /// | +---->+x |
- /// +----------+----------+----------+----------+
- /// |+y 1|+y 4|+y 0|+y 5|
- /// | ^ -x | ^ +z | ^ +x | ^ -z |
- /// | | | | | | | | |
- /// | +---->+z | +---->+x | +---->-z | +---->-x |
- /// +----------+----------+----------+----------+
- /// |+z 3|
- /// | ^ -y |
- /// | | |
- /// | +---->+x |
- /// +----------+
- ///
- /// @param _mip
- /// @param _x
- /// @param _y
- /// @param _width
- /// @param _height
- /// @param _mem
- /// @param _pitch Pitch of input image (bytes). When _pitch is set to
+ /// +----------+
+ /// |-z 2|
+ /// | ^ +y |
+ /// | | |
+ /// | +---->+x |
+ /// +----------+----------+----------+----------+
+ /// |+y 1|+y 4|+y 0|+y 5|
+ /// | ^ -x | ^ +z | ^ +x | ^ -z |
+ /// | | | | | | | | |
+ /// | +---->+z | +---->+x | +---->-z | +---->-x |
+ /// +----------+----------+----------+----------+
+ /// |+z 3|
+ /// | ^ -y |
+ /// | | |
+ /// | +---->+x |
+ /// +----------+
+ ///
+ /// @param[in] _mip Mip level.
+ /// @param[in] _x X offset in texture.
+ /// @param[in] _y Y offset in texture.
+ /// @param[in] _width Width of texture block.
+ /// @param[in] _height Height of texture block.
+ /// @param[in] _mem Texture update data.
+ /// @param[in] _pitch Pitch of input image (bytes). When _pitch is set to
/// UINT16_MAX, it will be calculated internally based on _width.
///
/// @attention C99 equivalent is `bgfx_update_texture_cube`.
@@ -1148,15 +1402,32 @@ namespace bgfx
/// Create frame buffer (simple).
///
- /// @param _width Texture width.
- /// @param _height Texture height.
- /// @param _format Texture format.
- /// @param _textureFlags Texture flags.
+ /// @param[in] _width Texture width.
+ /// @param[in] _height Texture height.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _textureFlags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
///
/// @attention C99 equivalent is `bgfx_create_frame_buffer`.
///
FrameBufferHandle createFrameBuffer(uint16_t _width, uint16_t _height, TextureFormat::Enum _format, uint32_t _textureFlags = BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP);
+ /// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ /// if back buffer resolution changes.
+ ///
+ /// @param[in] _ratio Frame buffer size in respect to back-buffer size. See:
+ /// `BackbufferRatio::Enum`.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ /// @param[in] _textureFlags Default texture sampling mode is linear, and wrap mode
+ /// is repeat.
+ /// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
+ /// mode.
+ /// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
+ /// sampling.
///
/// @attention C99 equivalent is `bgfx_create_frame_buffer_scaled`.
///
@@ -1164,9 +1435,9 @@ namespace bgfx
/// Create frame buffer.
///
- /// @param _num Number of texture attachments.
- /// @param _handles Texture attachments.
- /// @param _destroyTextures If true, textures will be destroyed when
+ /// @param[in] _num Number of texture attachments.
+ /// @param[in] _handles Texture attachments.
+ /// @param[in] _destroyTextures If true, textures will be destroyed when
/// frame buffer is destroyed.
///
/// @attention C99 equivalent is `bgfx_create_frame_buffer_from_handles`.
@@ -1175,10 +1446,10 @@ namespace bgfx
/// Create frame buffer for multiple window rendering.
///
- /// @param _nwh OS' target native window handle.
- /// @param _width Window back buffer width.
- /// @param _height Window back buffer height.
- /// @param _depthFormat Window back buffer depth format.
+ /// @param[in] _nwh OS' target native window handle.
+ /// @param[in] _width Window back buffer width.
+ /// @param[in] _height Window back buffer height.
+ /// @param[in] _depthFormat Window back buffer depth format.
///
/// @returns Handle to frame buffer object.
///
@@ -1197,9 +1468,9 @@ namespace bgfx
/// Create shader uniform parameter.
///
- /// @param _name Uniform name in shader.
- /// @param _type Type of uniform (See: `bgfx::UniformType`).
- /// @param _num Number of elements in array.
+ /// @param[in] _name Uniform name in shader.
+ /// @param[in] _type Type of uniform (See: `bgfx::UniformType`).
+ /// @param[in] _num Number of elements in array.
///
/// @returns Handle to uniform object.
///
@@ -1227,43 +1498,43 @@ namespace bgfx
/// Destroy shader uniform parameter.
///
- /// @param _handle Handle to uniform object.
+ /// @param[in] _handle Handle to uniform object.
///
/// @attention C99 equivalent is `bgfx_destroy_uniform`.
///
void destroyUniform(UniformHandle _handle);
- /// Set clear color palette value.
+ /// Set palette color value.
///
- /// @param _index Index into palette.
- /// @param _rgba Packed 32-bit RGBA value.
+ /// @param[in] _index Index into palette.
+ /// @param[in] _rgba Packed 32-bit RGBA value.
///
- /// @attention C99 equivalent is ``.
+ /// @attention C99 equivalent is `bgfx_set_palette_color`.
///
- void setClearColor(uint8_t _index, uint32_t _rgba);
+ void setPaletteColor(uint8_t _index, uint32_t _rgba);
- /// Set clear color palette value.
+ /// Set palette color value.
///
- /// @param _index Index into palette.
- /// @param _r, _g, _b, _a RGBA floating point values.
+ /// @param[in] _index Index into palette.
+ /// @param[in] _r, _g, _b, _a RGBA floating point values.
///
- /// @attention C99 equivalent is ``.
+ /// @attention C99 equivalent is `bgfx_set_palette_color`.
///
- void setClearColor(uint8_t _index, float _r, float _g, float _b, float _a);
+ void setPaletteColor(uint8_t _index, float _r, float _g, float _b, float _a);
- /// Set clear color palette value.
+ /// Set palette color value.
///
- /// @param _index Index into palette.
- /// @param _rgba RGBA floating point value.
+ /// @param[in] _index Index into palette.
+ /// @param[in] _rgba RGBA floating point value.
///
- /// @attention C99 equivalent is `bgfx_set_clear_color`.
+ /// @attention C99 equivalent is `bgfx_set_palette_color`.
///
- void setClearColor(uint8_t _index, const float _rgba[4]);
+ void setPaletteColor(uint8_t _index, const float _rgba[4]);
/// Set view name.
///
- /// @param _id View id.
- /// @param _name View name.
+ /// @param[in] _id View id.
+ /// @param[in] _name View name.
///
/// @remarks
/// This is debug only feature.
@@ -1282,11 +1553,11 @@ namespace bgfx
/// Set view rectangle. Draw primitive outside view will be clipped.
///
- /// @param _id View id.
- /// @param _x Position x from the left corner of the window.
- /// @param _y Position y from the top corner of the window.
- /// @param _width Width of view port region.
- /// @param _height Height of view port region.
+ /// @param[in] _id View id.
+ /// @param[in] _x Position x from the left corner of the window.
+ /// @param[in] _y Position y from the top corner of the window.
+ /// @param[in] _width Width of view port region.
+ /// @param[in] _height Height of view port region.
///
/// @attention C99 equivalent is `bgfx_set_view_rect`.
///
@@ -1295,10 +1566,11 @@ namespace bgfx
/// Set view scissor. Draw primitive outside view will be clipped. When
/// _x, _y, _width and _height are set to 0, scissor will be disabled.
///
- /// @param _x Position x from the left corner of the window.
- /// @param _y Position y from the top corner of the window.
- /// @param _width Width of scissor region.
- /// @param _height Height of scissor region.
+ /// @param[in] _id View id.
+ /// @param[in] _x Position x from the left corner of the window.
+ /// @param[in] _y Position y from the top corner of the window.
+ /// @param[in] _width Width of scissor region.
+ /// @param[in] _height Height of scissor region.
///
/// @attention C99 equivalent is `bgfx_set_view_scissor`.
///
@@ -1306,12 +1578,12 @@ namespace bgfx
/// Set view clear flags.
///
- /// @param _id View id.
- /// @param _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ /// @param[in] _id View id.
+ /// @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
/// operation. See: `BGFX_CLEAR_*`.
- /// @param _rgba Color clear value.
- /// @param _depth Depth clear value.
- /// @param _stencil Stencil clear value.
+ /// @param[in] _rgba Color clear value.
+ /// @param[in] _depth Depth clear value.
+ /// @param[in] _stencil Stencil clear value.
///
/// @attention C99 equivalent is `bgfx_set_view_clear`.
///
@@ -1321,11 +1593,19 @@ namespace bgfx
/// frame buffer texture. Must use setClearColor to setup clear color
/// palette.
///
- /// @param _id View id.
- /// @param _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
+ /// @param[in] _id View id.
+ /// @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
/// operation. See: `BGFX_CLEAR_*`.
- /// @param _depth Depth clear value.
- /// @param _stencil Stencil clear value.
+ /// @param[in] _depth Depth clear value.
+ /// @param[in] _stencil Stencil clear value.
+ /// @param[in] _0 Palette index for frame buffer attachment 0.
+ /// @param[in] _1 Palette index for frame buffer attachment 1.
+ /// @param[in] _2 Palette index for frame buffer attachment 2.
+ /// @param[in] _3 Palette index for frame buffer attachment 3.
+ /// @param[in] _4 Palette index for frame buffer attachment 4.
+ /// @param[in] _5 Palette index for frame buffer attachment 5.
+ /// @param[in] _6 Palette index for frame buffer attachment 6.
+ /// @param[in] _7 Palette index for frame buffer attachment 7.
///
/// @attention C99 equivalent is `bgfx_set_view_clear_mrt`.
///
@@ -1340,8 +1620,8 @@ namespace bgfx
/// Set view frame buffer.
///
- /// @param _id View id.
- /// @param _handle Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
+ /// @param[in] _id View id.
+ /// @param[in] _handle Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
/// frame buffer handle will draw primitives from this view into
/// default back buffer.
///
@@ -1355,15 +1635,15 @@ namespace bgfx
/// Set view view and projection matrices, all draw primitives in this
/// view will use these matrices.
///
- /// @param _id View id.
- /// @param _view View matrix.
- /// @param _projL Projection matrix. When using stereo rendering this projection matrix
+ /// @param[in] _id View id.
+ /// @param[in] _view View matrix.
+ /// @param[in] _projL Projection matrix. When using stereo rendering this projection matrix
/// represent projection matrix for left eye.
- /// @param _flags View flags. Use
+ /// @param[in] _flags View flags. Use
/// - `BGFX_VIEW_NONE` - View will be rendered only once if stereo mode is enabled.
/// - `BGFX_VIEW_STEREO` - View will be rendered for both eyes if stereo mode is enabled. When
/// stereo mode is disabled this flag doesn't have effect.
- /// @param _projR Projection matrix for right eye in stereo mode.
+ /// @param[in] _projR Projection matrix for right eye in stereo mode.
///
/// @attention C99 equivalent are `bgfx_set_view_transform`, `bgfx_set_view_transform_stereo`.
///
@@ -1371,12 +1651,12 @@ namespace bgfx
/// Post submit view reordering.
///
- /// @param _id First view id.
- /// @param _num Number of views to remap.
- /// @param _remap View remap id table. Passing `NULL` will reset view ids
+ /// @param[in] _id First view id.
+ /// @param[in] _num Number of views to remap.
+ /// @param[in] _remap View remap id table. Passing `NULL` will reset view ids
/// to default state.
///
- /// @attention C99 equivalent is ``.
+ /// @attention C99 equivalent is `bgfx_set_view_remap`.
///
void setViewRemap(uint8_t _id = 0, uint8_t _num = UINT8_MAX, const void* _remap = NULL);
@@ -1388,7 +1668,7 @@ namespace bgfx
/// Set render states for draw primitive.
///
- /// @param _state State flags. Default state for primitive type is
+ /// @param[in] _state State flags. Default state for primitive type is
/// triangles. See: `BGFX_STATE_DEFAULT`.
/// - `BGFX_STATE_ALPHA_WRITE` - Enable alpha write.
/// - `BGFX_STATE_DEPTH_WRITE` - Enable depth write.
@@ -1400,7 +1680,7 @@ namespace bgfx
/// - `BGFX_STATE_MSAA` - Enable MSAA.
/// - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.
///
- /// @param _rgba Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
+ /// @param[in] _rgba Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and
/// `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
/// @remarks
@@ -1415,8 +1695,8 @@ namespace bgfx
/// Set stencil test state.
///
- /// @param _fstencil Front stencil state.
- /// @param _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`
+ /// @param[in] _fstencil Front stencil state.
+ /// @param[in] _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`
/// _fstencil is applied to both front and back facing primitives.
///
/// @attention C99 equivalent is `bgfx_set_stencil`.
@@ -1424,12 +1704,12 @@ namespace bgfx
void setStencil(uint32_t _fstencil, uint32_t _bstencil = BGFX_STENCIL_NONE);
/// Set scissor for draw primitive. For scissor for all primitives in
- /// view see setViewScissor.
+ /// view see `bgfx::setViewScissor`.
///
- /// @param _x Position x from the left corner of the window.
- /// @param _y Position y from the top corner of the window.
- /// @param _width Width of scissor region.
- /// @param _height Height of scissor region.
+ /// @param[in] _x Position x from the left corner of the window.
+ /// @param[in] _y Position y from the top corner of the window.
+ /// @param[in] _width Width of scissor region.
+ /// @param[in] _height Height of scissor region.
/// @returns Scissor cache index.
///
/// @attention C99 equivalent is `bgfx_set_scissor`.
@@ -1438,7 +1718,7 @@ namespace bgfx
/// Set scissor from cache for draw primitive.
///
- /// @param _cache Index in scissor cache. Passing UINT16_MAX unset primitive
+ /// @param[in] _cache Index in scissor cache. Passing UINT16_MAX unset primitive
/// scissor and primitive will use view scissor instead.
///
/// @attention C99 equivalent is `bgfx_set_scissor_cached`.
@@ -1448,8 +1728,8 @@ namespace bgfx
/// Set model matrix for draw primitive. If it is not called model will
/// be rendered with identity model matrix.
///
- /// @param _mtx Pointer to first matrix in array.
- /// @param _num Number of matrices in array.
+ /// @param[in] _mtx Pointer to first matrix in array.
+ /// @param[in] _num Number of matrices in array.
/// @returns index into matrix cache in case the same model matrix has
/// to be used for other draw primitive call.
///
@@ -1460,8 +1740,8 @@ namespace bgfx
/// Reserve `_num` matrices in internal matrix cache. Pointer returned
/// can be modifed until `bgfx::frame` is called.
///
- /// @param _transform Pointer to `Transform` structure.
- /// @param _num Number of matrices.
+ /// @param[in] _transform Pointer to `Transform` structure.
+ /// @param[in] _num Number of matrices.
/// @returns index into matrix cache.
///
/// @attention C99 equivalent is `bgfx_alloc_transform`.
@@ -1470,8 +1750,8 @@ namespace bgfx
/// Set model matrix from matrix cache for draw primitive.
///
- /// @param _cache Index in matrix cache.
- /// @param _num Number of matrices from cache.
+ /// @param[in] _cache Index in matrix cache.
+ /// @param[in] _num Number of matrices from cache.
///
/// @attention C99 equivalent is `bgfx_set_transform_cached`.
///
@@ -1479,60 +1759,93 @@ namespace bgfx
/// Set shader uniform parameter for draw primitive.
///
+ /// @param[in] _handle Uniform.
+ /// @param[in] _value Pointer to uniform data.
+ /// @param[in] _num Number of elements.
+ ///
/// @attention C99 equivalent is `bgfx_set_uniform`.
///
void setUniform(UniformHandle _handle, const void* _value, uint16_t _num = 1);
/// Set index buffer for draw primitive.
///
+ /// @param[in] _handle Index buffer.
+ /// @param[in] _firstIndex First index to render.
+ /// @param[in] _numIndices Number of indices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_index_buffer`.
///
void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex = 0, uint32_t _numIndices = UINT32_MAX);
/// Set index buffer for draw primitive.
///
+ /// @param[in] _handle Dynamic index buffer.
+ /// @param[in] _firstIndex First index to render.
+ /// @param[in] _numIndices Number of indices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_dynamic_index_buffer`.
///
void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex = 0, uint32_t _numIndices = UINT32_MAX);
/// Set index buffer for draw primitive.
///
- /// @attention C99 equivalent is ``.
+ /// @param[in] _tib Transient index buffer.
+ ///
+ /// @attention C99 equivalent is `bgfx_set_transient_index_buffer`.
///
void setIndexBuffer(const TransientIndexBuffer* _tib);
/// Set index buffer for draw primitive.
///
+ /// @param[in] _tib Transient index buffer.
+ /// @param[in] _firstIndex First index to render.
+ /// @param[in] _numIndices Number of indices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_transient_index_buffer`.
///
void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices);
/// Set vertex buffer for draw primitive.
///
- /// @attention C99 equivalent is ``.
+ /// @param[in] _handle Vertex buffer.
+ ///
+ /// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
///
void setVertexBuffer(VertexBufferHandle _handle);
/// Set vertex buffer for draw primitive.
///
+ /// @param[in] _handle Vertex buffer.
+ /// @param[in] _startVertex First vertex to render.
+ /// @param[in] _numVertices Number of vertices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
///
void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices);
/// Set vertex buffer for draw primitive.
///
+ /// @param[in] _handle Dynamic vertex buffer.
+ /// @param[in] _numVertices Number of vertices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_dynamic_vertex_buffer`.
///
void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _numVertices = UINT32_MAX);
/// Set vertex buffer for draw primitive.
///
- /// @attention C99 equivalent is ``.
+ /// @param[in] _tvb Transient vertex buffer.
+ ///
+ /// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
///
void setVertexBuffer(const TransientVertexBuffer* _tvb);
/// Set vertex buffer for draw primitive.
///
+ /// @param[in] _tvb Transient vertex buffer.
+ /// @param[in] _startVertex First vertex to render.
+ /// @param[in] _numVertices Number of vertices to render.
+ ///
/// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
///
void setVertexBuffer(const TransientVertexBuffer* _tvb, uint32_t _startVertex, uint32_t _numVertices);
@@ -1555,25 +1868,19 @@ namespace bgfx
///
void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num);
- /// Set program for draw primitive.
- ///
- /// @attention C99 equivalent is `bgfx_set_program`.
- ///
- void setProgram(ProgramHandle _handle);
-
/// Set texture stage for draw primitive.
///
- /// @param _stage Texture unit.
- /// @param _sampler Program sampler.
- /// @param _handle Texture handle.
- /// @param _flags Texture sampling mode. Default value UINT32_MAX uses
+ /// @param[in] _stage Texture unit.
+ /// @param[in] _sampler Program sampler.
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _flags Texture sampling mode. Default value UINT32_MAX uses
/// texture sampling settings from the texture.
/// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
/// mode.
/// - `BGFX_TEXTURE_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
/// sampling.
///
- /// @param _flags Texture sampler filtering flags. UINT32_MAX use the
+ /// @param[in] _flags Texture sampler filtering flags. UINT32_MAX use the
/// sampler filtering mode set by texture.
///
/// @attention C99 equivalent is `bgfx_set_texture`.
@@ -1582,11 +1889,11 @@ namespace bgfx
/// Set texture stage for draw primitive.
///
- /// @param _stage Texture unit.
- /// @param _sampler Program sampler.
- /// @param _handle Frame buffer handle.
- /// @param _attachment Attachment index.
- /// @param _flags Texture sampling mode. Default value UINT32_MAX uses
+ /// @param[in] _stage Texture unit.
+ /// @param[in] _sampler Program sampler.
+ /// @param[in] _handle Frame buffer handle.
+ /// @param[in] _attachment Attachment index.
+ /// @param[in] _flags Texture sampling mode. Default value UINT32_MAX uses
/// texture sampling settings from the texture.
/// - `BGFX_TEXTURE_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap
/// mode.
@@ -1597,48 +1904,79 @@ namespace bgfx
///
void setTexture(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment = 0, uint32_t _flags = UINT32_MAX);
+ /// Touch view.
+ uint32_t touch(uint8_t _id);
+
/// Submit primitive for rendering.
///
- /// @param _id View id.
- /// @param _depth Depth for sorting.
+ /// @param[in] _id View id.
+ /// @param[in] _handle Program.
+ /// @param[in] _depth Depth for sorting.
/// @returns Number of draw calls.
///
/// @attention C99 equivalent is `bgfx_submit`.
///
- uint32_t submit(uint8_t _id, int32_t _depth = 0);
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, int32_t _depth = 0);
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
///
+ /// @param[in] _id View id.
+ /// @param[in] _handle Program.
+ /// @param[in] _indirectHandle Indirect buffer.
+ /// @param[in] _start First element in indirect buffer.
+ /// @param[in] _num Number of dispatches.
+ /// @param[in] _depth Depth for sorting.
+ ///
/// @attention C99 equivalent is `bgfx_submit_indirect`.
///
- uint32_t submit(uint8_t _id, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, int32_t _depth = 0);
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, int32_t _depth = 0);
+ /// Set compute index buffer.
///
+ /// @param[in] _stage Compute stage.
+ /// @param[in] _handle Index buffer handle.
+ /// @param[in] _access Buffer access. See `Access::Enum`.
///
/// @attention C99 equivalent is `bgfx_set_compute_index_buffer`.
///
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access);
+ /// Set compute vertex buffer.
///
+ /// @param[in] _stage Compute stage.
+ /// @param[in] _handle Vertex buffer handle.
+ /// @param[in] _access Buffer access. See `Access::Enum`.
///
/// @attention C99 equivalent is `bgfx_set_compute_vertex_buffer`.
///
void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access);
+ /// Set compute dynamic index buffer.
///
+ /// @param[in] _stage Compute stage.
+ /// @param[in] _handle Dynamic index buffer handle.
+ /// @param[in] _access Buffer access. See `Access::Enum`.
///
/// @attention C99 equivalent is `bgfx_set_compute_dynamic_index_buffer`.
///
void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access);
+ /// Set compute dynamic vertex buffer.
///
+ /// @param[in] _stage Compute stage.
+ /// @param[in] _handle Dynamic vertex buffer handle.
+ /// @param[in] _access Buffer access. See `Access::Enum`.
///
/// @attention C99 equivalent is `bgfx_set_compute_dynamic_vertex_buffer`.
///
void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access);
+ /// Set compute indirect buffer.
///
+ /// @param[in] _stage Compute stage.
+ /// @param[in] _handle Indirect buffer handle.
+ /// @param[in] _access Buffer access. See `Access::Enum`.
///
/// @attention C99 equivalent is `bgfx_set_compute_indirect_buffer`.
///
@@ -1646,24 +1984,58 @@ namespace bgfx
/// Set compute image from texture.
///
+ /// @param[in] _stage Texture unit.
+ /// @param[in] _sampler Program sampler.
+ /// @param[in] _handle Texture handle.
+ /// @param[in] _mip Mip level.
+ /// @param[in] _access Texture access. See `Access::Enum`.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ ///
/// @attention C99 equivalent is `bgfx_set_image`.
///
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
/// Set compute image from frame buffer texture.
///
+ /// @param[in] _stage Texture unit.
+ /// @param[in] _sampler Program sampler.
+ /// @param[in] _handle Frame buffer handle.
+ /// @param[in] _attachment Attachment index.
+ /// @param[in] _access Texture access. See `Access::Enum`.
+ /// @param[in] _format Texture format. See: `TextureFormat::Enum`.
+ ///
/// @attention C99 equivalent is `bgfx_set_image_from_frame_buffer`.
///
void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
/// Dispatch compute.
///
+ /// @param[in] _id View id.
+ /// @param[in] _handle Compute program.
+ /// @param[in] _numX Number of groups X.
+ /// @param[in] _numY Number of groups Y.
+ /// @param[in] _numZ Number of groups Z.
+ /// @param[in] _flags View flags. Use
+ /// - `BGFX_VIEW_NONE` - View will be rendered only once if stereo mode is enabled.
+ /// - `BGFX_VIEW_STEREO` - View will be rendered for both eyes if stereo mode is enabled. When
+ /// stereo mode is disabled this flag doesn't have effect.
+ ///
/// @attention C99 equivalent is `bgfx_dispatch`.
///
uint32_t dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX = 1, uint16_t _numY = 1, uint16_t _numZ = 1, uint8_t _flags = BGFX_SUBMIT_EYE_FIRST);
/// Dispatch compute indirect.
///
+ /// @param[in] _id View id.
+ /// @param[in] _handle Compute program.
+ /// @param[in] _indirectHandle Indirect buffer.
+ /// @param[in] _start First element in indirect buffer.
+ /// @param[in] _num Number of dispatches.
+ /// @param[in] _flags View flags. Use
+ /// - `BGFX_VIEW_NONE` - View will be rendered only once if stereo mode is enabled.
+ /// - `BGFX_VIEW_STEREO` - View will be rendered for both eyes if stereo mode is enabled. When
+ /// stereo mode is disabled this flag doesn't have effect.
+ ///
/// @attention C99 equivalent is `bgfx_dispatch_indirect`.
///
uint32_t dispatch(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_SUBMIT_EYE_FIRST);
@@ -1676,7 +2048,7 @@ namespace bgfx
/// Request screen shot.
///
- /// @param _filePath Will be passed to `bgfx::CallbackI::screenShot` callback.
+ /// @param[in] _filePath Will be passed to `bgfx::CallbackI::screenShot` callback.
///
/// @remarks
/// `bgfx::CallbackI::screenShot` must be implemented.
diff --git a/3rdparty/bgfx/include/bgfx/bgfxdefines.h b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
new file mode 100644
index 00000000000..b239be1cf88
--- /dev/null
+++ b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
@@ -0,0 +1,403 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_DEFINES_H_HEADER_GUARD
+#define BGFX_DEFINES_H_HEADER_GUARD
+
+///
+#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write.
+#define BGFX_STATE_ALPHA_WRITE UINT64_C(0x0000000000000002) //!< Enable alpha write.
+#define BGFX_STATE_DEPTH_WRITE UINT64_C(0x0000000000000004) //!< Enable depth write.
+
+#define BGFX_STATE_DEPTH_TEST_LESS UINT64_C(0x0000000000000010) //!< Enable depth test, less.
+#define BGFX_STATE_DEPTH_TEST_LEQUAL UINT64_C(0x0000000000000020) //!< Enable depth test, less equal.
+#define BGFX_STATE_DEPTH_TEST_EQUAL UINT64_C(0x0000000000000030) //!< Enable depth test, equal.
+#define BGFX_STATE_DEPTH_TEST_GEQUAL UINT64_C(0x0000000000000040) //!< Enable depth test, greater equal.
+#define BGFX_STATE_DEPTH_TEST_GREATER UINT64_C(0x0000000000000050) //!< Enable depth test, greater.
+#define BGFX_STATE_DEPTH_TEST_NOTEQUAL UINT64_C(0x0000000000000060) //!< Enable depth test, not equal.
+#define BGFX_STATE_DEPTH_TEST_NEVER UINT64_C(0x0000000000000070) //!< Enable depth test, never.
+#define BGFX_STATE_DEPTH_TEST_ALWAYS UINT64_C(0x0000000000000080) //!< Enable depth test, always.
+#define BGFX_STATE_DEPTH_TEST_SHIFT 4
+#define BGFX_STATE_DEPTH_TEST_MASK UINT64_C(0x00000000000000f0) //!< Depth test state bit mask.
+
+#define BGFX_STATE_BLEND_ZERO UINT64_C(0x0000000000001000) //!<
+#define BGFX_STATE_BLEND_ONE UINT64_C(0x0000000000002000) //!<
+#define BGFX_STATE_BLEND_SRC_COLOR UINT64_C(0x0000000000003000) //!<
+#define BGFX_STATE_BLEND_INV_SRC_COLOR UINT64_C(0x0000000000004000) //!<
+#define BGFX_STATE_BLEND_SRC_ALPHA UINT64_C(0x0000000000005000) //!<
+#define BGFX_STATE_BLEND_INV_SRC_ALPHA UINT64_C(0x0000000000006000) //!<
+#define BGFX_STATE_BLEND_DST_ALPHA UINT64_C(0x0000000000007000) //!<
+#define BGFX_STATE_BLEND_INV_DST_ALPHA UINT64_C(0x0000000000008000) //!<
+#define BGFX_STATE_BLEND_DST_COLOR UINT64_C(0x0000000000009000) //!<
+#define BGFX_STATE_BLEND_INV_DST_COLOR UINT64_C(0x000000000000a000) //!<
+#define BGFX_STATE_BLEND_SRC_ALPHA_SAT UINT64_C(0x000000000000b000) //!<
+#define BGFX_STATE_BLEND_FACTOR UINT64_C(0x000000000000c000) //!<
+#define BGFX_STATE_BLEND_INV_FACTOR UINT64_C(0x000000000000d000) //!<
+#define BGFX_STATE_BLEND_SHIFT 12 //!< Blend state bit shift.
+#define BGFX_STATE_BLEND_MASK UINT64_C(0x000000000ffff000) //!< Blend state bit mask.
+
+#define BGFX_STATE_BLEND_EQUATION_ADD UINT64_C(0x0000000000000000) //!<
+#define BGFX_STATE_BLEND_EQUATION_SUB UINT64_C(0x0000000010000000) //!<
+#define BGFX_STATE_BLEND_EQUATION_REVSUB UINT64_C(0x0000000020000000) //!<
+#define BGFX_STATE_BLEND_EQUATION_MIN UINT64_C(0x0000000030000000) //!<
+#define BGFX_STATE_BLEND_EQUATION_MAX UINT64_C(0x0000000040000000) //!<
+#define BGFX_STATE_BLEND_EQUATION_SHIFT 28 //!< Blend equation bit shift.
+#define BGFX_STATE_BLEND_EQUATION_MASK UINT64_C(0x00000003f0000000) //!< Blend equation bit mask.
+
+#define BGFX_STATE_BLEND_INDEPENDENT UINT64_C(0x0000000400000000) //!< Enable blend independent.
+
+#define BGFX_STATE_CULL_CW UINT64_C(0x0000001000000000) //!< Cull clockwise triangles.
+#define BGFX_STATE_CULL_CCW UINT64_C(0x0000002000000000) //!< Cull counter-clockwise triangles.
+#define BGFX_STATE_CULL_SHIFT 36 //!< Culling mode bit shift.
+#define BGFX_STATE_CULL_MASK UINT64_C(0x0000003000000000) //!< Culling mode bit mask.
+
+/// See BGFX_STATE_ALPHA_REF(_ref) helper macro.
+#define BGFX_STATE_ALPHA_REF_SHIFT 40 //!< Alpha reference bit shift.
+#define BGFX_STATE_ALPHA_REF_MASK UINT64_C(0x0000ff0000000000) //!< Alpha reference bit mask.
+
+#define BGFX_STATE_PT_TRISTRIP UINT64_C(0x0001000000000000) //!< Tristrip.
+#define BGFX_STATE_PT_LINES UINT64_C(0x0002000000000000) //!< Lines.
+#define BGFX_STATE_PT_LINESTRIP UINT64_C(0x0003000000000000) //!< Line strip.
+#define BGFX_STATE_PT_POINTS UINT64_C(0x0004000000000000) //!< Points.
+#define BGFX_STATE_PT_SHIFT 48 //!< Primitive type bit shift.
+#define BGFX_STATE_PT_MASK UINT64_C(0x0007000000000000) //!< Primitive type bit mask.
+
+#define BGFX_STATE_POINT_SIZE_SHIFT 52 //!< Point size bit shift.
+#define BGFX_STATE_POINT_SIZE_MASK UINT64_C(0x0ff0000000000000) //!< Point size bit mask.
+
+/// Enable MSAA write when writing into MSAA frame buffer. This flag is ignored when not writing into
+/// MSAA frame buffer.
+#define BGFX_STATE_MSAA UINT64_C(0x1000000000000000) //!< Enable MSAA rasterization.
+
+#define BGFX_STATE_RESERVED_MASK UINT64_C(0xe000000000000000) //!< Internal bits, do not use!
+
+/// See BGFX_STATE_POINT_SIZE(_size) helper macro.
+#define BGFX_STATE_NONE UINT64_C(0x0000000000000000) //!< No state.
+#define BGFX_STATE_MASK UINT64_C(0xffffffffffffffff) //!< State mask.
+
+/// Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
+/// culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
+#define BGFX_STATE_DEFAULT (0 \
+ | BGFX_STATE_RGB_WRITE \
+ | BGFX_STATE_ALPHA_WRITE \
+ | BGFX_STATE_DEPTH_TEST_LESS \
+ | BGFX_STATE_DEPTH_WRITE \
+ | BGFX_STATE_CULL_CW \
+ | BGFX_STATE_MSAA \
+ )
+
+#define BGFX_STATE_ALPHA_REF(_ref) ( ( (uint64_t)(_ref )<<BGFX_STATE_ALPHA_REF_SHIFT )&BGFX_STATE_ALPHA_REF_MASK)
+#define BGFX_STATE_POINT_SIZE(_size) ( ( (uint64_t)(_size)<<BGFX_STATE_POINT_SIZE_SHIFT)&BGFX_STATE_POINT_SIZE_MASK)
+
+///
+#define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (UINT64_C(0) \
+ | ( ( (uint64_t)(_srcRGB)|( (uint64_t)(_dstRGB)<<4) ) ) \
+ | ( ( (uint64_t)(_srcA )|( (uint64_t)(_dstA )<<4) )<<8) \
+ )
+
+#define BGFX_STATE_BLEND_EQUATION_SEPARATE(_rgb, _a) ( (uint64_t)(_rgb)|( (uint64_t)(_a)<<3) )
+
+///
+#define BGFX_STATE_BLEND_FUNC(_src, _dst) BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst)
+#define BGFX_STATE_BLEND_EQUATION(_equation) BGFX_STATE_BLEND_EQUATION_SEPARATE(_equation, _equation)
+
+#define BGFX_STATE_BLEND_ADD (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) )
+#define BGFX_STATE_BLEND_ALPHA (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA) )
+#define BGFX_STATE_BLEND_DARKEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MIN) )
+#define BGFX_STATE_BLEND_LIGHTEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MAX) )
+#define BGFX_STATE_BLEND_MULTIPLY (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO ) )
+#define BGFX_STATE_BLEND_NORMAL (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) )
+#define BGFX_STATE_BLEND_SCREEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_COLOR) )
+#define BGFX_STATE_BLEND_LINEAR_BURN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_INV_DST_COLOR) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_SUB) )
+
+///
+#define BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) (0 \
+ | ( uint32_t( (_src)>>BGFX_STATE_BLEND_SHIFT) \
+ | ( uint32_t( (_dst)>>BGFX_STATE_BLEND_SHIFT)<<4) ) \
+ )
+
+#define BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation) (0 \
+ | BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) \
+ | ( uint32_t( (_equation)>>BGFX_STATE_BLEND_EQUATION_SHIFT)<<8) \
+ )
+
+#define BGFX_STATE_BLEND_FUNC_RT_1(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<< 0)
+#define BGFX_STATE_BLEND_FUNC_RT_2(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<11)
+#define BGFX_STATE_BLEND_FUNC_RT_3(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<22)
+
+#define BGFX_STATE_BLEND_FUNC_RT_1E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<< 0)
+#define BGFX_STATE_BLEND_FUNC_RT_2E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<11)
+#define BGFX_STATE_BLEND_FUNC_RT_3E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<22)
+
+///
+#define BGFX_STENCIL_FUNC_REF_SHIFT 0 //!<
+#define BGFX_STENCIL_FUNC_REF_MASK UINT32_C(0x000000ff) //!<
+#define BGFX_STENCIL_FUNC_RMASK_SHIFT 8 //!<
+#define BGFX_STENCIL_FUNC_RMASK_MASK UINT32_C(0x0000ff00) //!<
+
+#define BGFX_STENCIL_TEST_LESS UINT32_C(0x00010000) //!< Enable stencil test, less.
+#define BGFX_STENCIL_TEST_LEQUAL UINT32_C(0x00020000) //!<
+#define BGFX_STENCIL_TEST_EQUAL UINT32_C(0x00030000) //!<
+#define BGFX_STENCIL_TEST_GEQUAL UINT32_C(0x00040000) //!<
+#define BGFX_STENCIL_TEST_GREATER UINT32_C(0x00050000) //!<
+#define BGFX_STENCIL_TEST_NOTEQUAL UINT32_C(0x00060000) //!<
+#define BGFX_STENCIL_TEST_NEVER UINT32_C(0x00070000) //!<
+#define BGFX_STENCIL_TEST_ALWAYS UINT32_C(0x00080000) //!<
+#define BGFX_STENCIL_TEST_SHIFT 16 //!<
+#define BGFX_STENCIL_TEST_MASK UINT32_C(0x000f0000) //!<
+
+#define BGFX_STENCIL_OP_FAIL_S_ZERO UINT32_C(0x00000000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_KEEP UINT32_C(0x00100000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_REPLACE UINT32_C(0x00200000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_INCR UINT32_C(0x00300000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_INCRSAT UINT32_C(0x00400000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_DECR UINT32_C(0x00500000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_DECRSAT UINT32_C(0x00600000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_INVERT UINT32_C(0x00700000) //!<
+#define BGFX_STENCIL_OP_FAIL_S_SHIFT 20 //!<
+#define BGFX_STENCIL_OP_FAIL_S_MASK UINT32_C(0x00f00000) //!<
+
+#define BGFX_STENCIL_OP_FAIL_Z_ZERO UINT32_C(0x00000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_KEEP UINT32_C(0x01000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_REPLACE UINT32_C(0x02000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_INCR UINT32_C(0x03000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_INCRSAT UINT32_C(0x04000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_DECR UINT32_C(0x05000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_DECRSAT UINT32_C(0x06000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_INVERT UINT32_C(0x07000000) //!<
+#define BGFX_STENCIL_OP_FAIL_Z_SHIFT 24 //!<
+#define BGFX_STENCIL_OP_FAIL_Z_MASK UINT32_C(0x0f000000) //!<
+
+#define BGFX_STENCIL_OP_PASS_Z_ZERO UINT32_C(0x00000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_KEEP UINT32_C(0x10000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_REPLACE UINT32_C(0x20000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_INCR UINT32_C(0x30000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_INCRSAT UINT32_C(0x40000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_DECR UINT32_C(0x50000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_DECRSAT UINT32_C(0x60000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_INVERT UINT32_C(0x70000000) //!<
+#define BGFX_STENCIL_OP_PASS_Z_SHIFT 28 //!<
+#define BGFX_STENCIL_OP_PASS_Z_MASK UINT32_C(0xf0000000) //!<
+
+#define BGFX_STENCIL_NONE UINT32_C(0x00000000) //!<
+#define BGFX_STENCIL_MASK UINT32_C(0xffffffff) //!<
+#define BGFX_STENCIL_DEFAULT UINT32_C(0x00000000) //!<
+
+/// Set stencil ref value.
+#define BGFX_STENCIL_FUNC_REF(_ref) ( (uint32_t(_ref)<<BGFX_STENCIL_FUNC_REF_SHIFT)&BGFX_STENCIL_FUNC_REF_MASK)
+
+/// Set stencil rmask value.
+#define BGFX_STENCIL_FUNC_RMASK(_mask) ( (uint32_t(_mask)<<BGFX_STENCIL_FUNC_RMASK_SHIFT)&BGFX_STENCIL_FUNC_RMASK_MASK)
+
+///
+#define BGFX_CLEAR_NONE UINT16_C(0x0000) //!< No clear flags.
+#define BGFX_CLEAR_COLOR UINT16_C(0x0001) //!< Clear color.
+#define BGFX_CLEAR_DEPTH UINT16_C(0x0002) //!< Clear depth.
+#define BGFX_CLEAR_STENCIL UINT16_C(0x0004) //!< Clear stencil.
+#define BGFX_CLEAR_DISCARD_COLOR_0 UINT16_C(0x0008) //!< Discard frame buffer attachment 0.
+#define BGFX_CLEAR_DISCARD_COLOR_1 UINT16_C(0x0010) //!< Discard frame buffer attachment 1.
+#define BGFX_CLEAR_DISCARD_COLOR_2 UINT16_C(0x0020) //!< Discard frame buffer attachment 2.
+#define BGFX_CLEAR_DISCARD_COLOR_3 UINT16_C(0x0040) //!< Discard frame buffer attachment 3.
+#define BGFX_CLEAR_DISCARD_COLOR_4 UINT16_C(0x0080) //!< Discard frame buffer attachment 4.
+#define BGFX_CLEAR_DISCARD_COLOR_5 UINT16_C(0x0100) //!< Discard frame buffer attachment 5.
+#define BGFX_CLEAR_DISCARD_COLOR_6 UINT16_C(0x0200) //!< Discard frame buffer attachment 6.
+#define BGFX_CLEAR_DISCARD_COLOR_7 UINT16_C(0x0400) //!< Discard frame buffer attachment 7.
+#define BGFX_CLEAR_DISCARD_DEPTH UINT16_C(0x0800) //!< Discard frame buffer depth attachment.
+#define BGFX_CLEAR_DISCARD_STENCIL UINT16_C(0x1000) //!< Discard frame buffer stencil attachment.
+
+#define BGFX_CLEAR_DISCARD_COLOR_MASK (0 \
+ | BGFX_CLEAR_DISCARD_COLOR_0 \
+ | BGFX_CLEAR_DISCARD_COLOR_1 \
+ | BGFX_CLEAR_DISCARD_COLOR_2 \
+ | BGFX_CLEAR_DISCARD_COLOR_3 \
+ | BGFX_CLEAR_DISCARD_COLOR_4 \
+ | BGFX_CLEAR_DISCARD_COLOR_5 \
+ | BGFX_CLEAR_DISCARD_COLOR_6 \
+ | BGFX_CLEAR_DISCARD_COLOR_7 \
+ )
+#define BGFX_CLEAR_DISCARD_MASK (0 \
+ | BGFX_CLEAR_DISCARD_COLOR_MASK \
+ | BGFX_CLEAR_DISCARD_DEPTH \
+ | BGFX_CLEAR_DISCARD_STENCIL \
+ )
+
+#define BGFX_DEBUG_NONE UINT32_C(0x00000000) //!< No debug.
+#define BGFX_DEBUG_WIREFRAME UINT32_C(0x00000001) //!< Enable wireframe for all primitives.
+#define BGFX_DEBUG_IFH UINT32_C(0x00000002) //!< Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.
+#define BGFX_DEBUG_STATS UINT32_C(0x00000004) //!< Enable statistics display.
+#define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display.
+
+///
+#define BGFX_BUFFER_NONE UINT16_C(0x0000) //!<
+
+#define BGFX_BUFFER_COMPUTE_FORMAT_8x1 UINT16_C(0x0001) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_8x2 UINT16_C(0x0002) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_8x4 UINT16_C(0x0003) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_16x1 UINT16_C(0x0004) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_16x2 UINT16_C(0x0005) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_16x4 UINT16_C(0x0006) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_32x1 UINT16_C(0x0007) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_32x2 UINT16_C(0x0008) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_32x4 UINT16_C(0x0009) //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_SHIFT 0 //!<
+#define BGFX_BUFFER_COMPUTE_FORMAT_MASK UINT16_C(0x000f) //!<
+
+#define BGFX_BUFFER_COMPUTE_TYPE_UINT UINT16_C(0x0010) //!<
+#define BGFX_BUFFER_COMPUTE_TYPE_INT UINT16_C(0x0020) //!<
+#define BGFX_BUFFER_COMPUTE_TYPE_FLOAT UINT16_C(0x0030) //!<
+#define BGFX_BUFFER_COMPUTE_TYPE_SHIFT 4 //!<
+#define BGFX_BUFFER_COMPUTE_TYPE_MASK UINT16_C(0x0030) //!<
+
+#define BGFX_BUFFER_COMPUTE_READ UINT16_C(0x0100) //!< Buffer will be read by shader.
+#define BGFX_BUFFER_COMPUTE_WRITE UINT16_C(0x0200) //!< Buffer will be used for writing.
+#define BGFX_BUFFER_DRAW_INDIRECT UINT16_C(0x0400) //!< Buffer will be used for storing draw indirect commands.
+#define BGFX_BUFFER_ALLOW_RESIZE UINT16_C(0x0800) //!<
+#define BGFX_BUFFER_INDEX32 UINT16_C(0x1000) //!<
+
+#define BGFX_BUFFER_COMPUTE_READ_WRITE (0 \
+ | BGFX_BUFFER_COMPUTE_READ \
+ | BGFX_BUFFER_COMPUTE_WRITE \
+ )
+
+///
+#define BGFX_TEXTURE_NONE UINT32_C(0x00000000) //!<
+#define BGFX_TEXTURE_U_MIRROR UINT32_C(0x00000001) //!<
+#define BGFX_TEXTURE_U_CLAMP UINT32_C(0x00000002) //!<
+#define BGFX_TEXTURE_U_BORDER UINT32_C(0x00000003) //!<
+#define BGFX_TEXTURE_U_SHIFT 0 //!<
+#define BGFX_TEXTURE_U_MASK UINT32_C(0x00000003) //!<
+#define BGFX_TEXTURE_V_MIRROR UINT32_C(0x00000004) //!<
+#define BGFX_TEXTURE_V_CLAMP UINT32_C(0x00000008) //!<
+#define BGFX_TEXTURE_V_BORDER UINT32_C(0x0000000c) //!<
+#define BGFX_TEXTURE_V_SHIFT 2 //!<
+#define BGFX_TEXTURE_V_MASK UINT32_C(0x0000000c) //!<
+#define BGFX_TEXTURE_W_MIRROR UINT32_C(0x00000010) //!<
+#define BGFX_TEXTURE_W_CLAMP UINT32_C(0x00000020) //!<
+#define BGFX_TEXTURE_W_BORDER UINT32_C(0x00000030) //!<
+#define BGFX_TEXTURE_W_SHIFT 4 //!<
+#define BGFX_TEXTURE_W_MASK UINT32_C(0x00000030) //!<
+#define BGFX_TEXTURE_MIN_POINT UINT32_C(0x00000040) //!<
+#define BGFX_TEXTURE_MIN_ANISOTROPIC UINT32_C(0x00000080) //!<
+#define BGFX_TEXTURE_MIN_SHIFT 6 //!<
+#define BGFX_TEXTURE_MIN_MASK UINT32_C(0x000000c0) //!<
+#define BGFX_TEXTURE_MAG_POINT UINT32_C(0x00000100) //!<
+#define BGFX_TEXTURE_MAG_ANISOTROPIC UINT32_C(0x00000200) //!<
+#define BGFX_TEXTURE_MAG_SHIFT 8 //!<
+#define BGFX_TEXTURE_MAG_MASK UINT32_C(0x00000300) //!<
+#define BGFX_TEXTURE_MIP_POINT UINT32_C(0x00000400) //!<
+#define BGFX_TEXTURE_MIP_SHIFT 10 //!<
+#define BGFX_TEXTURE_MIP_MASK UINT32_C(0x00000400) //!<
+#define BGFX_TEXTURE_RT UINT32_C(0x00001000) //!<
+#define BGFX_TEXTURE_RT_MSAA_X2 UINT32_C(0x00002000) //!<
+#define BGFX_TEXTURE_RT_MSAA_X4 UINT32_C(0x00003000) //!<
+#define BGFX_TEXTURE_RT_MSAA_X8 UINT32_C(0x00004000) //!<
+#define BGFX_TEXTURE_RT_MSAA_X16 UINT32_C(0x00005000) //!<
+#define BGFX_TEXTURE_RT_MSAA_SHIFT 12 //!<
+#define BGFX_TEXTURE_RT_MSAA_MASK UINT32_C(0x00007000) //!<
+#define BGFX_TEXTURE_RT_BUFFER_ONLY UINT32_C(0x00008000) //!<
+#define BGFX_TEXTURE_RT_MASK UINT32_C(0x0000f000) //!<
+#define BGFX_TEXTURE_COMPARE_LESS UINT32_C(0x00010000) //!<
+#define BGFX_TEXTURE_COMPARE_LEQUAL UINT32_C(0x00020000) //!<
+#define BGFX_TEXTURE_COMPARE_EQUAL UINT32_C(0x00030000) //!<
+#define BGFX_TEXTURE_COMPARE_GEQUAL UINT32_C(0x00040000) //!<
+#define BGFX_TEXTURE_COMPARE_GREATER UINT32_C(0x00050000) //!<
+#define BGFX_TEXTURE_COMPARE_NOTEQUAL UINT32_C(0x00060000) //!<
+#define BGFX_TEXTURE_COMPARE_NEVER UINT32_C(0x00070000) //!<
+#define BGFX_TEXTURE_COMPARE_ALWAYS UINT32_C(0x00080000) //!<
+#define BGFX_TEXTURE_COMPARE_SHIFT 16 //!<
+#define BGFX_TEXTURE_COMPARE_MASK UINT32_C(0x000f0000) //!<
+#define BGFX_TEXTURE_COMPUTE_WRITE UINT32_C(0x00100000) //!<
+#define BGFX_TEXTURE_SRGB UINT32_C(0x00200000) //!<
+#define BGFX_TEXTURE_BORDER_COLOR_SHIFT 24 //!<
+#define BGFX_TEXTURE_BORDER_COLOR_MASK UINT32_C(0x0f000000) //!<
+#define BGFX_TEXTURE_RESERVED_SHIFT 28 //!<
+#define BGFX_TEXTURE_RESERVED_MASK UINT32_C(0xf0000000) //!<
+
+#define BGFX_TEXTURE_BORDER_COLOR(_index) ( (_index << BGFX_TEXTURE_BORDER_COLOR_SHIFT) & BGFX_TEXTURE_BORDER_COLOR_MASK)
+
+#define BGFX_TEXTURE_SAMPLER_BITS_MASK (0 \
+ | BGFX_TEXTURE_U_MASK \
+ | BGFX_TEXTURE_V_MASK \
+ | BGFX_TEXTURE_W_MASK \
+ | BGFX_TEXTURE_MIN_MASK \
+ | BGFX_TEXTURE_MAG_MASK \
+ | BGFX_TEXTURE_MIP_MASK \
+ | BGFX_TEXTURE_COMPARE_MASK \
+ )
+
+///
+#define BGFX_RESET_NONE UINT32_C(0x00000000) //!< No reset flags.
+#define BGFX_RESET_FULLSCREEN UINT32_C(0x00000001) //!< Not supported yet.
+#define BGFX_RESET_FULLSCREEN_SHIFT 0 //!< Fullscreen bit shift.
+#define BGFX_RESET_FULLSCREEN_MASK UINT32_C(0x00000001) //!< Fullscreen bit mask.
+#define BGFX_RESET_MSAA_X2 UINT32_C(0x00000010) //!< Enable 2x MSAA.
+#define BGFX_RESET_MSAA_X4 UINT32_C(0x00000020) //!< Enable 4x MSAA.
+#define BGFX_RESET_MSAA_X8 UINT32_C(0x00000030) //!< Enable 8x MSAA.
+#define BGFX_RESET_MSAA_X16 UINT32_C(0x00000040) //!< Enable 16x MSAA.
+#define BGFX_RESET_MSAA_SHIFT 4 //!< MSAA mode bit shift.
+#define BGFX_RESET_MSAA_MASK UINT32_C(0x00000070) //!< MSAA mode bit mask.
+#define BGFX_RESET_VSYNC UINT32_C(0x00000080) //!< Enable V-Sync.
+#define BGFX_RESET_MAXANISOTROPY UINT32_C(0x00000100) //!< Turn on/off max anisotropy.
+#define BGFX_RESET_CAPTURE UINT32_C(0x00000200) //!< Begin screen capture.
+#define BGFX_RESET_HMD UINT32_C(0x00000400) //!< HMD stereo rendering.
+#define BGFX_RESET_HMD_DEBUG UINT32_C(0x00000800) //!< HMD stereo rendering debug mode.
+#define BGFX_RESET_HMD_RECENTER UINT32_C(0x00001000) //!< HMD calibration.
+#define BGFX_RESET_FLUSH_AFTER_RENDER UINT32_C(0x00002000) //!< Flush rendering after submitting to GPU.
+#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000) //!< This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+#define BGFX_RESET_SRGB_BACKBUFFER UINT32_C(0x00008000) //!< Enable sRGB backbuffer.
+#define BGFX_RESET_HIDPI UINT32_C(0x00010000) //!< Enable HiDPI rendering.
+
+///
+#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000000001) //!< Texture compare less equal mode is supported.
+#define BGFX_CAPS_TEXTURE_COMPARE_ALL UINT64_C(0x0000000000000003) //!< All texture compare modes are supported.
+#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000000004) //!< 3D textures are supported.
+#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000000000008) //!< Vertex attribute half-float is supported.
+#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000000000010) //!< Vertex attribute 10_10_10_2 is supported.
+#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000000020) //!< Instancing is supported.
+#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000000040) //!< Renderer is on separate thread.
+#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000080) //!< Fragment depth is accessible in fragment shader.
+#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000100) //!< Blend independent is supported.
+#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000200) //!< Compute shaders are supported.
+#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000400) //!< Fragment ordering is available in fragment shader.
+#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000000800) //!< Multiple windows are supported.
+#define BGFX_CAPS_HMD UINT64_C(0x0000000000001000) //!< Head Mounted Display is available.
+#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000002000) //!< 32-bit indices are supported.
+#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000004000) //!< Draw indirect is supported.
+#define BGFX_CAPS_HIDPI UINT64_C(0x0000000000008000) //!< HiDPI rendering is supported.
+
+///
+#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT8_C(0x00) //!< Texture format is not supported.
+#define BGFX_CAPS_FORMAT_TEXTURE_COLOR UINT8_C(0x01) //!< Texture format is supported.
+#define BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB UINT8_C(0x02) //!< Texture as sRGB format is supported.
+#define BGFX_CAPS_FORMAT_TEXTURE_EMULATED UINT8_C(0x04) //!< Texture format is emulated.
+#define BGFX_CAPS_FORMAT_TEXTURE_VERTEX UINT8_C(0x08) //!< Texture format can be used from vertex shader.
+#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE UINT8_C(0x10) //!< Texture format can be used as image from compute shader.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER UINT8_C(0x20) //!< Texture format can be used as frame buffer.
+#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA UINT8_C(0x40) //!< Texture format can be used as MSAA frame buffer.
+#define BGFX_CAPS_FORMAT_TEXTURE_MSAA UINT8_C(0x80) //!< Texture can be sampled as MSAA.
+
+///
+#define BGFX_VIEW_NONE UINT8_C(0x00) //!<
+#define BGFX_VIEW_STEREO UINT8_C(0x01) //!< View will be rendered in stereo mode.
+
+///
+#define BGFX_SUBMIT_EYE_LEFT UINT8_C(0x01) //!< Submit to left eye.
+#define BGFX_SUBMIT_EYE_RIGHT UINT8_C(0x02) //!< Submit to right eye.
+#define BGFX_SUBMIT_EYE_MASK UINT8_C(0x03) //!<
+#define BGFX_SUBMIT_EYE_FIRST BGFX_SUBMIT_EYE_LEFT
+
+///
+#define BGFX_PCI_ID_NONE UINT16_C(0x0000) //!< Autoselect adapter.
+#define BGFX_PCI_ID_SOFTWARE_RASTERIZER UINT16_C(0x0001) //!< Software rasterizer.
+#define BGFX_PCI_ID_AMD UINT16_C(0x1002) //!< AMD adapter.
+#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) //!< Intel adapter.
+#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) //!< nVidia adapter.
+
+///
+#define BGFX_HMD_NONE UINT8_C(0x00) //!< None.
+#define BGFX_HMD_DEVICE_RESOLUTION UINT8_C(0x01) //!< Has HMD native resolution.
+#define BGFX_HMD_RENDERING UINT8_C(0x02) //!< Rendering to HMD.
+
+#endif // BGFX_DEFINES_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/include/bgfxplatform.h b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
index 8a2cf5a0711..920904aa9fc 100644
--- a/3rdparty/bgfx/include/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
@@ -14,6 +14,10 @@
namespace bgfx
{
+ /// Render frame enum.
+ ///
+ /// @attention C99 equivalent is `bgfx_render_frame_t`.
+ ///
struct RenderFrame
{
enum Enum
@@ -26,20 +30,34 @@ namespace bgfx
};
};
- /// WARNING: This call should be only used on platforms that don't
- /// allow creating separate rendering thread. If it is called before
- /// to bgfx::init, render thread won't be created by bgfx::init call.
+ /// Render frame.
+ ///
+ /// @returns Current renderer state. See: `bgfx::RenderFrame`.
+ ///
+ /// @warning This call should be only used on platforms that don't
+ /// allow creating separate rendering thread. If it is called before
+ /// to bgfx::init, render thread won't be created by bgfx::init call.
RenderFrame::Enum renderFrame();
+ /// Platform data.
+ ///
+ /// @attention C99 equivalent is `bgfx_platform_data_t`.
+ ///
struct PlatformData
{
- void* ndt; //< Native display type
- void* nwh; //< Native window handle
- void* context; //< GL context, or D3D device
- void* backBuffer; //< GL backbuffer, or D3D render target view
- void* backBufferDS; //< Backbuffer depth/stencil.
+ void* ndt; //!< Native display type
+ void* nwh; //!< Native window handle
+ void* context; //!< GL context, or D3D device
+ void* backBuffer; //!< GL backbuffer, or D3D render target view
+ void* backBufferDS; //!< Backbuffer depth/stencil.
};
+ /// Set platform data.
+ ///
+ /// @warning Must be called before `bgfx::init`.
+ ///
+ /// @attention C99 equivalent is `bgfx_set_platform_data`.
+ ///
void setPlatformData(const PlatformData& _hooks);
} // namespace bgfx
diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
index 17a1b0ad8b8..b7aeecda3e7 100644
--- a/3rdparty/bgfx/include/bgfx.c99.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
@@ -8,11 +8,12 @@
#ifndef BGFX_C99_H_HEADER_GUARD
#define BGFX_C99_H_HEADER_GUARD
+#include <stdarg.h> // va_list
#include <stdbool.h> // bool
#include <stdint.h> // uint32_t
#include <stdlib.h> // size_t
-#include "bgfxdefines.h"
+#include <bgfx/bgfxdefines.h>
typedef enum bgfx_renderer_type
{
@@ -20,6 +21,7 @@ typedef enum bgfx_renderer_type
BGFX_RENDERER_TYPE_DIRECT3D9,
BGFX_RENDERER_TYPE_DIRECT3D11,
BGFX_RENDERER_TYPE_DIRECT3D12,
+ BGFX_RENDERER_TYPE_METAL,
BGFX_RENDERER_TYPE_OPENGLES,
BGFX_RENDERER_TYPE_OPENGL,
BGFX_RENDERER_TYPE_VULKAN,
@@ -64,6 +66,7 @@ typedef enum bgfx_attrib
typedef enum bgfx_attrib_type
{
BGFX_ATTRIB_TYPE_UINT8,
+ BGFX_ATTRIB_TYPE_UINT10,
BGFX_ATTRIB_TYPE_INT16,
BGFX_ATTRIB_TYPE_HALF,
BGFX_ATTRIB_TYPE_FLOAT,
@@ -95,21 +98,44 @@ typedef enum bgfx_texture_format
BGFX_TEXTURE_FORMAT_UNKNOWN,
BGFX_TEXTURE_FORMAT_R1,
+ BGFX_TEXTURE_FORMAT_A8,
BGFX_TEXTURE_FORMAT_R8,
+ BGFX_TEXTURE_FORMAT_R8I,
+ BGFX_TEXTURE_FORMAT_R8U,
+ BGFX_TEXTURE_FORMAT_R8S,
BGFX_TEXTURE_FORMAT_R16,
+ BGFX_TEXTURE_FORMAT_R16I,
+ BGFX_TEXTURE_FORMAT_R16U,
BGFX_TEXTURE_FORMAT_R16F,
- BGFX_TEXTURE_FORMAT_R32,
+ BGFX_TEXTURE_FORMAT_R16S,
+ BGFX_TEXTURE_FORMAT_R32I,
+ BGFX_TEXTURE_FORMAT_R32U,
BGFX_TEXTURE_FORMAT_R32F,
BGFX_TEXTURE_FORMAT_RG8,
+ BGFX_TEXTURE_FORMAT_RG8I,
+ BGFX_TEXTURE_FORMAT_RG8U,
+ BGFX_TEXTURE_FORMAT_RG8S,
BGFX_TEXTURE_FORMAT_RG16,
+ BGFX_TEXTURE_FORMAT_RG16I,
+ BGFX_TEXTURE_FORMAT_RG16U,
BGFX_TEXTURE_FORMAT_RG16F,
- BGFX_TEXTURE_FORMAT_RG32,
+ BGFX_TEXTURE_FORMAT_RG16S,
+ BGFX_TEXTURE_FORMAT_RG32I,
+ BGFX_TEXTURE_FORMAT_RG32U,
BGFX_TEXTURE_FORMAT_RG32F,
+ BGFX_TEXTURE_FORMAT_RGB9E5F,
BGFX_TEXTURE_FORMAT_BGRA8,
BGFX_TEXTURE_FORMAT_RGBA8,
+ BGFX_TEXTURE_FORMAT_RGBA8I,
+ BGFX_TEXTURE_FORMAT_RGBA8U,
+ BGFX_TEXTURE_FORMAT_RGBA8S,
BGFX_TEXTURE_FORMAT_RGBA16,
+ BGFX_TEXTURE_FORMAT_RGBA16I,
+ BGFX_TEXTURE_FORMAT_RGBA16U,
BGFX_TEXTURE_FORMAT_RGBA16F,
- BGFX_TEXTURE_FORMAT_RGBA32,
+ BGFX_TEXTURE_FORMAT_RGBA16S,
+ BGFX_TEXTURE_FORMAT_RGBA32I,
+ BGFX_TEXTURE_FORMAT_RGBA32U,
BGFX_TEXTURE_FORMAT_RGBA32F,
BGFX_TEXTURE_FORMAT_R5G6B5,
BGFX_TEXTURE_FORMAT_RGBA4,
@@ -134,17 +160,12 @@ typedef enum bgfx_texture_format
typedef enum bgfx_uniform_type
{
- BGFX_UNIFORM_TYPE_UNIFORM1I,
- BGFX_UNIFORM_TYPE_UNIFORM1F,
+ BGFX_UNIFORM_TYPE_INT1,
BGFX_UNIFORM_TYPE_END,
- BGFX_UNIFORM_TYPE_UNIFORM1IV,
- BGFX_UNIFORM_TYPE_UNIFORM1FV,
- BGFX_UNIFORM_TYPE_UNIFORM2FV,
- BGFX_UNIFORM_TYPE_UNIFORM3FV,
- BGFX_UNIFORM_TYPE_UNIFORM4FV,
- BGFX_UNIFORM_TYPE_UNIFORM3X3FV,
- BGFX_UNIFORM_TYPE_UNIFORM4X4FV,
+ BGFX_UNIFORM_TYPE_VEC4,
+ BGFX_UNIFORM_TYPE_MAT3,
+ BGFX_UNIFORM_TYPE_MAT4,
BGFX_UNIFORM_TYPE_COUNT
@@ -164,7 +185,7 @@ typedef enum bgfx_backbuffer_ratio
} bgfx_backbuffer_ratio_t;
#define BGFX_HANDLE_T(_name) \
- typedef struct _name { uint16_t idx; } _name##_t;
+ typedef struct _name { uint16_t idx; } _name##_t
BGFX_HANDLE_T(bgfx_indirect_buffer_handle);
BGFX_HANDLE_T(bgfx_dynamic_index_buffer_handle);
@@ -216,16 +237,30 @@ typedef struct bgfx_hmd
bgfx_hmd_eye_t eye[2];
uint16_t width;
uint16_t height;
+ uint32_t deviceWidth;
+ uint32_t deviceHeight;
+ uint8_t flags;
} bgfx_hmd_t;
/**/
+typedef struct bgfx_stats
+{
+ uint64_t cpuTime;
+ uint64_t cpuTimerFreq;
+
+ uint64_t gpuTime;
+ uint64_t gpuTimerFreq;
+
+} bgfx_stats_t;
+
+/**/
typedef struct bgfx_vertex_decl
{
uint32_t hash;
uint16_t stride;
uint16_t offset[BGFX_ATTRIB_COUNT];
- uint8_t attributes[BGFX_ATTRIB_COUNT];
+ uint16_t attributes[BGFX_ATTRIB_COUNT];
} bgfx_vertex_decl_t;
@@ -329,9 +364,6 @@ typedef enum bgfx_fatal
#endif // BGFX_SHARED_LIB_USE
#if defined(_MSC_VER)
-# define BGFX_VTBL_CALL __stdcall
-# define BGFX_VTBL_THIS // passed via ecx
-# define BGFX_VTBL_THIS_ // passed via ecx
# if BGFX_SHARED_LIB_BUILD
# define BGFX_SHARED_LIB_API __declspec(dllexport)
# elif BGFX_SHARED_LIB_USE
@@ -340,9 +372,6 @@ typedef enum bgfx_fatal
# define BGFX_SHARED_LIB_API
# endif // BGFX_SHARED_LIB_*
#else
-# define BGFX_VTBL_CALL
-# define BGFX_VTBL_THIS BGFX_VTBL_INTEFRACE _this
-# define BGFX_VTBL_THIS_ BGFX_VTBL_INTEFRACE _this,
# define BGFX_SHARED_LIB_API
#endif // defined(_MSC_VER)
@@ -362,19 +391,15 @@ typedef struct bgfx_callback_interface
/**/
typedef struct bgfx_callback_vtbl
{
-# define BGFX_VTBL_INTEFRACE bgfx_callback_interface_t
-
- void* ctor;
- void (BGFX_VTBL_CALL *fatal)(BGFX_VTBL_THIS_ bgfx_fatal_t _code, const char* _str);
- uint32_t (BGFX_VTBL_CALL *cache_read_size)(BGFX_VTBL_THIS_ uint64_t _id);
- bool (BGFX_VTBL_CALL *cache_read)(BGFX_VTBL_THIS_ uint64_t _id, void* _data, uint32_t _size);
- void (BGFX_VTBL_CALL *cache_write)(BGFX_VTBL_THIS_ uint64_t _id, const void* _data, uint32_t _size);
- void (BGFX_VTBL_CALL *screen_shot)(BGFX_VTBL_THIS_ const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _data, uint32_t _size, bool _yflip);
- void (BGFX_VTBL_CALL *capture_begin)(BGFX_VTBL_THIS_ uint32_t _width, uint32_t _height, uint32_t _pitch, bgfx_texture_format_t _format, bool _yflip);
- void (BGFX_VTBL_CALL *capture_end)(BGFX_VTBL_THIS);
- void (BGFX_VTBL_CALL *capture_frame)(BGFX_VTBL_THIS_ const void* _data, uint32_t _size);
-
-# undef BGFX_VTBL_INTEFRACE
+ void (*fatal)(bgfx_callback_interface_t* _this, bgfx_fatal_t _code, const char* _str);
+ void (*trace_vargs)(bgfx_callback_interface_t* _this, const char* _filePath, uint16_t _line, const char* _format, va_list _argList);
+ uint32_t (*cache_read_size)(bgfx_callback_interface_t* _this, uint64_t _id);
+ bool (*cache_read)(bgfx_callback_interface_t* _this, uint64_t _id, void* _data, uint32_t _size);
+ void (*cache_write)(bgfx_callback_interface_t* _this, uint64_t _id, const void* _data, uint32_t _size);
+ void (*screen_shot)(bgfx_callback_interface_t* _this, const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _data, uint32_t _size, bool _yflip);
+ void (*capture_begin)(bgfx_callback_interface_t* _this, uint32_t _width, uint32_t _height, uint32_t _pitch, bgfx_texture_format_t _format, bool _yflip);
+ void (*capture_end)(bgfx_callback_interface_t* _this);
+ void (*capture_frame)(bgfx_callback_interface_t* _this, const void* _data, uint32_t _size);
} bgfx_callback_vtbl_t;
@@ -388,14 +413,9 @@ typedef struct bgfx_reallocator_interface
/**/
typedef struct bgfx_reallocator_vtbl
{
-# define BGFX_VTBL_INTEFRACE bgfx_reallocator_interface_t
-
- void* ctor;
- void* (BGFX_VTBL_CALL *alloc)(BGFX_VTBL_THIS_ size_t _size, size_t _align, const char* _file, uint32_t _line);
- void (BGFX_VTBL_CALL *free)(BGFX_VTBL_THIS_ void* _ptr, size_t _align, const char* _file, uint32_t _line);
- void* (BGFX_VTBL_CALL *realloc)(BGFX_VTBL_THIS_ void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line);
-
-# undef BGFX_VTBL_INTEFRACE
+ void* (*alloc)(bgfx_reallocator_interface_t* _this, size_t _size, size_t _align, const char* _file, uint32_t _line);
+ void (*free)(bgfx_reallocator_interface_t* _this, void* _ptr, size_t _align, const char* _file, uint32_t _line);
+ void* (*realloc)(bgfx_reallocator_interface_t* _this, void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line);
} bgfx_reallocator_vtbl_t;
@@ -436,7 +456,7 @@ BGFX_C_API uint8_t bgfx_get_supported_renderers(bgfx_renderer_type_t _enum[BGFX_
BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type);
/**/
-BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator);
+BGFX_C_API bool bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator);
/**/
BGFX_C_API void bgfx_shutdown();
@@ -457,6 +477,9 @@ BGFX_C_API const bgfx_caps_t* bgfx_get_caps();
BGFX_C_API const bgfx_hmd_t* bgfx_get_hmd();
/**/
+BGFX_C_API const bgfx_stats_t* bgfx_get_stats();
+
+/**/
BGFX_C_API const bgfx_memory_t* bgfx_alloc(uint32_t _size);
/**/
@@ -499,7 +522,7 @@ BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(u
BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_mem(const bgfx_memory_t* _mem, uint16_t _flags);
/**/
-BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, const bgfx_memory_t* _mem);
+BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem);
/**/
BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle);
@@ -511,7 +534,7 @@ BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer
BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
/**/
-BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, const bgfx_memory_t* _mem);
+BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem);
/**/
BGFX_C_API void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle);
@@ -616,7 +639,7 @@ BGFX_C_API bgfx_uniform_handle_t bgfx_create_uniform(const char* _name, bgfx_uni
BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle);
/**/
-BGFX_C_API void bgfx_set_clear_color(uint8_t _index, const float _rgba[4]);
+BGFX_C_API void bgfx_set_palette_color(uint8_t _index, const float _rgba[4]);
/**/
BGFX_C_API void bgfx_set_view_name(uint8_t _id, const char* _name);
@@ -646,6 +669,9 @@ BGFX_C_API void bgfx_set_view_transform(uint8_t _id, const void* _view, const vo
BGFX_C_API void bgfx_set_view_transform_stereo(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR);
/**/
+BGFX_C_API void bgfx_set_view_remap(uint8_t _id, uint8_t _num, const void* _remap);
+
+/**/
BGFX_C_API void bgfx_set_marker(const char* _marker);
/**/
@@ -700,19 +726,19 @@ BGFX_C_API void bgfx_set_instance_data_from_vertex_buffer(bgfx_vertex_buffer_han
BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
/**/
-BGFX_C_API void bgfx_set_program(bgfx_program_handle_t _handle);
-
-/**/
BGFX_C_API void bgfx_set_texture(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint32_t _flags);
/**/
BGFX_C_API void bgfx_set_texture_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, uint32_t _flags);
/**/
-BGFX_C_API uint32_t bgfx_submit(uint8_t _id, int32_t _depth);
+BGFX_C_API uint32_t bgfx_touch(uint8_t _id);
+
+/**/
+BGFX_C_API uint32_t bgfx_submit(uint8_t _id, bgfx_program_handle_t _handle, int32_t _depth);
/**/
-BGFX_C_API uint32_t bgfx_submit_indirect(uint8_t _id, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth);
+BGFX_C_API uint32_t bgfx_submit_indirect(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth);
/**/
BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
diff --git a/3rdparty/bgfx/include/bgfxplatform.c99.h b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
index 31c65bd6fd0..31c65bd6fd0 100644
--- a/3rdparty/bgfx/include/bgfxplatform.c99.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
diff --git a/3rdparty/bgfx/include/bgfxdefines.h b/3rdparty/bgfx/include/bgfxdefines.h
deleted file mode 100644
index cadb1d1a6d6..00000000000
--- a/3rdparty/bgfx/include/bgfxdefines.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
- * License: http://www.opensource.org/licenses/BSD-2-Clause
- */
-
-#ifndef BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_DEFINES_H_HEADER_GUARD
-
-///
-#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001)
-#define BGFX_STATE_ALPHA_WRITE UINT64_C(0x0000000000000002)
-#define BGFX_STATE_DEPTH_WRITE UINT64_C(0x0000000000000004)
-
-#define BGFX_STATE_DEPTH_TEST_LESS UINT64_C(0x0000000000000010)
-#define BGFX_STATE_DEPTH_TEST_LEQUAL UINT64_C(0x0000000000000020)
-#define BGFX_STATE_DEPTH_TEST_EQUAL UINT64_C(0x0000000000000030)
-#define BGFX_STATE_DEPTH_TEST_GEQUAL UINT64_C(0x0000000000000040)
-#define BGFX_STATE_DEPTH_TEST_GREATER UINT64_C(0x0000000000000050)
-#define BGFX_STATE_DEPTH_TEST_NOTEQUAL UINT64_C(0x0000000000000060)
-#define BGFX_STATE_DEPTH_TEST_NEVER UINT64_C(0x0000000000000070)
-#define BGFX_STATE_DEPTH_TEST_ALWAYS UINT64_C(0x0000000000000080)
-#define BGFX_STATE_DEPTH_TEST_SHIFT 4
-#define BGFX_STATE_DEPTH_TEST_MASK UINT64_C(0x00000000000000f0)
-
-#define BGFX_STATE_BLEND_ZERO UINT64_C(0x0000000000001000)
-#define BGFX_STATE_BLEND_ONE UINT64_C(0x0000000000002000)
-#define BGFX_STATE_BLEND_SRC_COLOR UINT64_C(0x0000000000003000)
-#define BGFX_STATE_BLEND_INV_SRC_COLOR UINT64_C(0x0000000000004000)
-#define BGFX_STATE_BLEND_SRC_ALPHA UINT64_C(0x0000000000005000)
-#define BGFX_STATE_BLEND_INV_SRC_ALPHA UINT64_C(0x0000000000006000)
-#define BGFX_STATE_BLEND_DST_ALPHA UINT64_C(0x0000000000007000)
-#define BGFX_STATE_BLEND_INV_DST_ALPHA UINT64_C(0x0000000000008000)
-#define BGFX_STATE_BLEND_DST_COLOR UINT64_C(0x0000000000009000)
-#define BGFX_STATE_BLEND_INV_DST_COLOR UINT64_C(0x000000000000a000)
-#define BGFX_STATE_BLEND_SRC_ALPHA_SAT UINT64_C(0x000000000000b000)
-#define BGFX_STATE_BLEND_FACTOR UINT64_C(0x000000000000c000)
-#define BGFX_STATE_BLEND_INV_FACTOR UINT64_C(0x000000000000d000)
-#define BGFX_STATE_BLEND_SHIFT 12
-#define BGFX_STATE_BLEND_MASK UINT64_C(0x000000000ffff000)
-
-#define BGFX_STATE_BLEND_EQUATION_ADD UINT64_C(0x0000000000000000)
-#define BGFX_STATE_BLEND_EQUATION_SUB UINT64_C(0x0000000010000000)
-#define BGFX_STATE_BLEND_EQUATION_REVSUB UINT64_C(0x0000000020000000)
-#define BGFX_STATE_BLEND_EQUATION_MIN UINT64_C(0x0000000030000000)
-#define BGFX_STATE_BLEND_EQUATION_MAX UINT64_C(0x0000000040000000)
-#define BGFX_STATE_BLEND_EQUATION_SHIFT 28
-#define BGFX_STATE_BLEND_EQUATION_MASK UINT64_C(0x00000003f0000000)
-
-#define BGFX_STATE_BLEND_INDEPENDENT UINT64_C(0x0000000400000000)
-
-#define BGFX_STATE_CULL_CW UINT64_C(0x0000001000000000)
-#define BGFX_STATE_CULL_CCW UINT64_C(0x0000002000000000)
-#define BGFX_STATE_CULL_SHIFT 36
-#define BGFX_STATE_CULL_MASK UINT64_C(0x0000003000000000)
-
-#define BGFX_STATE_ALPHA_REF_SHIFT 40
-#define BGFX_STATE_ALPHA_REF_MASK UINT64_C(0x0000ff0000000000)
-
-#define BGFX_STATE_PT_TRISTRIP UINT64_C(0x0001000000000000)
-#define BGFX_STATE_PT_LINES UINT64_C(0x0002000000000000)
-#define BGFX_STATE_PT_LINESTRIP UINT64_C(0x0003000000000000)
-#define BGFX_STATE_PT_POINTS UINT64_C(0x0004000000000000)
-#define BGFX_STATE_PT_SHIFT 48
-#define BGFX_STATE_PT_MASK UINT64_C(0x0007000000000000)
-
-#define BGFX_STATE_POINT_SIZE_SHIFT 52
-#define BGFX_STATE_POINT_SIZE_MASK UINT64_C(0x0ff0000000000000)
-
-#define BGFX_STATE_MSAA UINT64_C(0x1000000000000000)
-
-#define BGFX_STATE_RESERVED_MASK UINT64_C(0xe000000000000000)
-
-#define BGFX_STATE_NONE UINT64_C(0x0000000000000000)
-#define BGFX_STATE_MASK UINT64_C(0xffffffffffffffff)
-#define BGFX_STATE_DEFAULT (0 \
- | BGFX_STATE_RGB_WRITE \
- | BGFX_STATE_ALPHA_WRITE \
- | BGFX_STATE_DEPTH_TEST_LESS \
- | BGFX_STATE_DEPTH_WRITE \
- | BGFX_STATE_CULL_CW \
- | BGFX_STATE_MSAA \
- )
-
-#define BGFX_STATE_ALPHA_REF(_ref) ( ( (uint64_t)(_ref )<<BGFX_STATE_ALPHA_REF_SHIFT )&BGFX_STATE_ALPHA_REF_MASK)
-#define BGFX_STATE_POINT_SIZE(_size) ( ( (uint64_t)(_size)<<BGFX_STATE_POINT_SIZE_SHIFT)&BGFX_STATE_POINT_SIZE_MASK)
-
-///
-#define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (UINT64_C(0) \
- | ( ( (uint64_t)(_srcRGB)|( (uint64_t)(_dstRGB)<<4) ) ) \
- | ( ( (uint64_t)(_srcA )|( (uint64_t)(_dstA )<<4) )<<8) \
- )
-
-#define BGFX_STATE_BLEND_EQUATION_SEPARATE(_rgb, _a) ( (uint64_t)(_rgb)|( (uint64_t)(_a)<<3) )
-
-///
-#define BGFX_STATE_BLEND_FUNC(_src, _dst) BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst)
-#define BGFX_STATE_BLEND_EQUATION(_equation) BGFX_STATE_BLEND_EQUATION_SEPARATE(_equation, _equation)
-
-#define BGFX_STATE_BLEND_ADD (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) )
-#define BGFX_STATE_BLEND_ALPHA (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA) )
-#define BGFX_STATE_BLEND_DARKEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MIN) )
-#define BGFX_STATE_BLEND_LIGHTEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE ) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_MAX) )
-#define BGFX_STATE_BLEND_MULTIPLY (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO ) )
-#define BGFX_STATE_BLEND_NORMAL (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) )
-#define BGFX_STATE_BLEND_SCREEN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_COLOR) )
-#define BGFX_STATE_BLEND_LINEAR_BURN (BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_INV_DST_COLOR) | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_SUB) )
-
-///
-#define BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) (0 \
- | ( uint32_t( (_src)>>BGFX_STATE_BLEND_SHIFT) \
- | ( uint32_t( (_dst)>>BGFX_STATE_BLEND_SHIFT)<<4) ) \
- )
-
-#define BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation) (0 \
- | BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst) \
- | ( uint32_t( (_equation)>>BGFX_STATE_BLEND_EQUATION_SHIFT)<<8) \
- )
-
-#define BGFX_STATE_BLEND_FUNC_RT_1(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<< 0)
-#define BGFX_STATE_BLEND_FUNC_RT_2(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<11)
-#define BGFX_STATE_BLEND_FUNC_RT_3(_src, _dst) (BGFX_STATE_BLEND_FUNC_RT_x(_src, _dst)<<22)
-
-#define BGFX_STATE_BLEND_FUNC_RT_1E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<< 0)
-#define BGFX_STATE_BLEND_FUNC_RT_2E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<11)
-#define BGFX_STATE_BLEND_FUNC_RT_3E(_src, _dst, _equation) (BGFX_STATE_BLEND_FUNC_RT_xE(_src, _dst, _equation)<<22)
-
-///
-#define BGFX_STENCIL_FUNC_REF_SHIFT 0
-#define BGFX_STENCIL_FUNC_REF_MASK UINT32_C(0x000000ff)
-#define BGFX_STENCIL_FUNC_RMASK_SHIFT 8
-#define BGFX_STENCIL_FUNC_RMASK_MASK UINT32_C(0x0000ff00)
-
-#define BGFX_STENCIL_TEST_LESS UINT32_C(0x00010000)
-#define BGFX_STENCIL_TEST_LEQUAL UINT32_C(0x00020000)
-#define BGFX_STENCIL_TEST_EQUAL UINT32_C(0x00030000)
-#define BGFX_STENCIL_TEST_GEQUAL UINT32_C(0x00040000)
-#define BGFX_STENCIL_TEST_GREATER UINT32_C(0x00050000)
-#define BGFX_STENCIL_TEST_NOTEQUAL UINT32_C(0x00060000)
-#define BGFX_STENCIL_TEST_NEVER UINT32_C(0x00070000)
-#define BGFX_STENCIL_TEST_ALWAYS UINT32_C(0x00080000)
-#define BGFX_STENCIL_TEST_SHIFT 16
-#define BGFX_STENCIL_TEST_MASK UINT32_C(0x000f0000)
-
-#define BGFX_STENCIL_OP_FAIL_S_ZERO UINT32_C(0x00000000)
-#define BGFX_STENCIL_OP_FAIL_S_KEEP UINT32_C(0x00100000)
-#define BGFX_STENCIL_OP_FAIL_S_REPLACE UINT32_C(0x00200000)
-#define BGFX_STENCIL_OP_FAIL_S_INCR UINT32_C(0x00300000)
-#define BGFX_STENCIL_OP_FAIL_S_INCRSAT UINT32_C(0x00400000)
-#define BGFX_STENCIL_OP_FAIL_S_DECR UINT32_C(0x00500000)
-#define BGFX_STENCIL_OP_FAIL_S_DECRSAT UINT32_C(0x00600000)
-#define BGFX_STENCIL_OP_FAIL_S_INVERT UINT32_C(0x00700000)
-#define BGFX_STENCIL_OP_FAIL_S_SHIFT 20
-#define BGFX_STENCIL_OP_FAIL_S_MASK UINT32_C(0x00f00000)
-
-#define BGFX_STENCIL_OP_FAIL_Z_ZERO UINT32_C(0x00000000)
-#define BGFX_STENCIL_OP_FAIL_Z_KEEP UINT32_C(0x01000000)
-#define BGFX_STENCIL_OP_FAIL_Z_REPLACE UINT32_C(0x02000000)
-#define BGFX_STENCIL_OP_FAIL_Z_INCR UINT32_C(0x03000000)
-#define BGFX_STENCIL_OP_FAIL_Z_INCRSAT UINT32_C(0x04000000)
-#define BGFX_STENCIL_OP_FAIL_Z_DECR UINT32_C(0x05000000)
-#define BGFX_STENCIL_OP_FAIL_Z_DECRSAT UINT32_C(0x06000000)
-#define BGFX_STENCIL_OP_FAIL_Z_INVERT UINT32_C(0x07000000)
-#define BGFX_STENCIL_OP_FAIL_Z_SHIFT 24
-#define BGFX_STENCIL_OP_FAIL_Z_MASK UINT32_C(0x0f000000)
-
-#define BGFX_STENCIL_OP_PASS_Z_ZERO UINT32_C(0x00000000)
-#define BGFX_STENCIL_OP_PASS_Z_KEEP UINT32_C(0x10000000)
-#define BGFX_STENCIL_OP_PASS_Z_REPLACE UINT32_C(0x20000000)
-#define BGFX_STENCIL_OP_PASS_Z_INCR UINT32_C(0x30000000)
-#define BGFX_STENCIL_OP_PASS_Z_INCRSAT UINT32_C(0x40000000)
-#define BGFX_STENCIL_OP_PASS_Z_DECR UINT32_C(0x50000000)
-#define BGFX_STENCIL_OP_PASS_Z_DECRSAT UINT32_C(0x60000000)
-#define BGFX_STENCIL_OP_PASS_Z_INVERT UINT32_C(0x70000000)
-#define BGFX_STENCIL_OP_PASS_Z_SHIFT 28
-#define BGFX_STENCIL_OP_PASS_Z_MASK UINT32_C(0xf0000000)
-
-#define BGFX_STENCIL_NONE UINT32_C(0x00000000)
-#define BGFX_STENCIL_MASK UINT32_C(0xffffffff)
-#define BGFX_STENCIL_DEFAULT UINT32_C(0x00000000)
-
-#define BGFX_STENCIL_FUNC_REF(_ref) ( (uint32_t(_ref)<<BGFX_STENCIL_FUNC_REF_SHIFT)&BGFX_STENCIL_FUNC_REF_MASK)
-#define BGFX_STENCIL_FUNC_RMASK(_mask) ( (uint32_t(_mask)<<BGFX_STENCIL_FUNC_RMASK_SHIFT)&BGFX_STENCIL_FUNC_RMASK_MASK)
-
-///
-#define BGFX_CLEAR_NONE UINT16_C(0x0000)
-#define BGFX_CLEAR_COLOR UINT16_C(0x0001)
-#define BGFX_CLEAR_DEPTH UINT16_C(0x0002)
-#define BGFX_CLEAR_STENCIL UINT16_C(0x0004)
-#define BGFX_CLEAR_DISCARD_COLOR_0 UINT16_C(0x0008)
-#define BGFX_CLEAR_DISCARD_COLOR_1 UINT16_C(0x0010)
-#define BGFX_CLEAR_DISCARD_COLOR_2 UINT16_C(0x0020)
-#define BGFX_CLEAR_DISCARD_COLOR_3 UINT16_C(0x0040)
-#define BGFX_CLEAR_DISCARD_COLOR_4 UINT16_C(0x0080)
-#define BGFX_CLEAR_DISCARD_COLOR_5 UINT16_C(0x0100)
-#define BGFX_CLEAR_DISCARD_COLOR_6 UINT16_C(0x0200)
-#define BGFX_CLEAR_DISCARD_COLOR_7 UINT16_C(0x0400)
-#define BGFX_CLEAR_DISCARD_DEPTH UINT16_C(0x0800)
-#define BGFX_CLEAR_DISCARD_STENCIL UINT16_C(0x1000)
-
-#define BGFX_CLEAR_DISCARD_COLOR_MASK (0 \
- | BGFX_CLEAR_DISCARD_COLOR_0 \
- | BGFX_CLEAR_DISCARD_COLOR_1 \
- | BGFX_CLEAR_DISCARD_COLOR_2 \
- | BGFX_CLEAR_DISCARD_COLOR_3 \
- | BGFX_CLEAR_DISCARD_COLOR_4 \
- | BGFX_CLEAR_DISCARD_COLOR_5 \
- | BGFX_CLEAR_DISCARD_COLOR_6 \
- | BGFX_CLEAR_DISCARD_COLOR_7 \
- )
-#define BGFX_CLEAR_DISCARD_MASK (0 \
- | BGFX_CLEAR_DISCARD_COLOR_MASK \
- | BGFX_CLEAR_DISCARD_DEPTH \
- | BGFX_CLEAR_DISCARD_STENCIL \
- )
-
-///
-#define BGFX_DEBUG_NONE UINT32_C(0x00000000)
-#define BGFX_DEBUG_WIREFRAME UINT32_C(0x00000001)
-#define BGFX_DEBUG_IFH UINT32_C(0x00000002)
-#define BGFX_DEBUG_STATS UINT32_C(0x00000004)
-#define BGFX_DEBUG_TEXT UINT32_C(0x00000008)
-
-///
-#define BGFX_BUFFER_NONE UINT16_C(0x0000)
-
-#define BGFX_BUFFER_COMPUTE_FORMAT_8x1 UINT16_C(0x0001)
-#define BGFX_BUFFER_COMPUTE_FORMAT_8x2 UINT16_C(0x0002)
-#define BGFX_BUFFER_COMPUTE_FORMAT_8x4 UINT16_C(0x0003)
-#define BGFX_BUFFER_COMPUTE_FORMAT_16x1 UINT16_C(0x0004)
-#define BGFX_BUFFER_COMPUTE_FORMAT_16x2 UINT16_C(0x0005)
-#define BGFX_BUFFER_COMPUTE_FORMAT_16x4 UINT16_C(0x0006)
-#define BGFX_BUFFER_COMPUTE_FORMAT_32x1 UINT16_C(0x0007)
-#define BGFX_BUFFER_COMPUTE_FORMAT_32x2 UINT16_C(0x0008)
-#define BGFX_BUFFER_COMPUTE_FORMAT_32x4 UINT16_C(0x0009)
-#define BGFX_BUFFER_COMPUTE_FORMAT_SHIFT 0
-#define BGFX_BUFFER_COMPUTE_FORMAT_MASK UINT16_C(0x000f)
-
-#define BGFX_BUFFER_COMPUTE_TYPE_UINT UINT16_C(0x0010)
-#define BGFX_BUFFER_COMPUTE_TYPE_INT UINT16_C(0x0020)
-#define BGFX_BUFFER_COMPUTE_TYPE_FLOAT UINT16_C(0x0030)
-#define BGFX_BUFFER_COMPUTE_TYPE_SHIFT 4
-#define BGFX_BUFFER_COMPUTE_TYPE_MASK UINT16_C(0x0030)
-
-#define BGFX_BUFFER_COMPUTE_READ UINT16_C(0x0100)
-#define BGFX_BUFFER_COMPUTE_WRITE UINT16_C(0x0200)
-#define BGFX_BUFFER_DRAW_INDIRECT UINT16_C(0x0400)
-#define BGFX_BUFFER_ALLOW_RESIZE UINT16_C(0x0800)
-#define BGFX_BUFFER_INDEX32 UINT16_C(0x1000)
-#define BGFX_BUFFER_COMPUTE_READ_WRITE (BGFX_BUFFER_COMPUTE_READ | BGFX_BUFFER_COMPUTE_WRITE)
-
-///
-#define BGFX_TEXTURE_NONE UINT32_C(0x00000000)
-#define BGFX_TEXTURE_U_MIRROR UINT32_C(0x00000001)
-#define BGFX_TEXTURE_U_CLAMP UINT32_C(0x00000002)
-#define BGFX_TEXTURE_U_SHIFT 0
-#define BGFX_TEXTURE_U_MASK UINT32_C(0x00000003)
-#define BGFX_TEXTURE_V_MIRROR UINT32_C(0x00000004)
-#define BGFX_TEXTURE_V_CLAMP UINT32_C(0x00000008)
-#define BGFX_TEXTURE_V_SHIFT 2
-#define BGFX_TEXTURE_V_MASK UINT32_C(0x0000000c)
-#define BGFX_TEXTURE_W_MIRROR UINT32_C(0x00000010)
-#define BGFX_TEXTURE_W_CLAMP UINT32_C(0x00000020)
-#define BGFX_TEXTURE_W_SHIFT 4
-#define BGFX_TEXTURE_W_MASK UINT32_C(0x00000030)
-#define BGFX_TEXTURE_MIN_POINT UINT32_C(0x00000040)
-#define BGFX_TEXTURE_MIN_ANISOTROPIC UINT32_C(0x00000080)
-#define BGFX_TEXTURE_MIN_SHIFT 6
-#define BGFX_TEXTURE_MIN_MASK UINT32_C(0x000000c0)
-#define BGFX_TEXTURE_MAG_POINT UINT32_C(0x00000100)
-#define BGFX_TEXTURE_MAG_ANISOTROPIC UINT32_C(0x00000200)
-#define BGFX_TEXTURE_MAG_SHIFT 8
-#define BGFX_TEXTURE_MAG_MASK UINT32_C(0x00000300)
-#define BGFX_TEXTURE_MIP_POINT UINT32_C(0x00000400)
-#define BGFX_TEXTURE_MIP_SHIFT 10
-#define BGFX_TEXTURE_MIP_MASK UINT32_C(0x00000400)
-#define BGFX_TEXTURE_RT UINT32_C(0x00001000)
-#define BGFX_TEXTURE_RT_MSAA_X2 UINT32_C(0x00002000)
-#define BGFX_TEXTURE_RT_MSAA_X4 UINT32_C(0x00003000)
-#define BGFX_TEXTURE_RT_MSAA_X8 UINT32_C(0x00004000)
-#define BGFX_TEXTURE_RT_MSAA_X16 UINT32_C(0x00005000)
-#define BGFX_TEXTURE_RT_MSAA_SHIFT 12
-#define BGFX_TEXTURE_RT_MSAA_MASK UINT32_C(0x00007000)
-#define BGFX_TEXTURE_RT_BUFFER_ONLY UINT32_C(0x00008000)
-#define BGFX_TEXTURE_RT_MASK UINT32_C(0x0000f000)
-#define BGFX_TEXTURE_COMPARE_LESS UINT32_C(0x00010000)
-#define BGFX_TEXTURE_COMPARE_LEQUAL UINT32_C(0x00020000)
-#define BGFX_TEXTURE_COMPARE_EQUAL UINT32_C(0x00030000)
-#define BGFX_TEXTURE_COMPARE_GEQUAL UINT32_C(0x00040000)
-#define BGFX_TEXTURE_COMPARE_GREATER UINT32_C(0x00050000)
-#define BGFX_TEXTURE_COMPARE_NOTEQUAL UINT32_C(0x00060000)
-#define BGFX_TEXTURE_COMPARE_NEVER UINT32_C(0x00070000)
-#define BGFX_TEXTURE_COMPARE_ALWAYS UINT32_C(0x00080000)
-#define BGFX_TEXTURE_COMPARE_SHIFT 16
-#define BGFX_TEXTURE_COMPARE_MASK UINT32_C(0x000f0000)
-#define BGFX_TEXTURE_COMPUTE_WRITE UINT32_C(0x00100000)
-#define BGFX_TEXTURE_SRGB UINT32_C(0x00200000)
-#define BGFX_TEXTURE_RESERVED_SHIFT 24
-#define BGFX_TEXTURE_RESERVED_MASK UINT32_C(0xff000000)
-
-#define BGFX_TEXTURE_SAMPLER_BITS_MASK (0 \
- | BGFX_TEXTURE_U_MASK \
- | BGFX_TEXTURE_V_MASK \
- | BGFX_TEXTURE_W_MASK \
- | BGFX_TEXTURE_MIN_MASK \
- | BGFX_TEXTURE_MAG_MASK \
- | BGFX_TEXTURE_MIP_MASK \
- | BGFX_TEXTURE_COMPARE_MASK \
- )
-
-///
-#define BGFX_RESET_NONE UINT32_C(0x00000000)
-#define BGFX_RESET_FULLSCREEN UINT32_C(0x00000001)
-#define BGFX_RESET_FULLSCREEN_SHIFT 0
-#define BGFX_RESET_FULLSCREEN_MASK UINT32_C(0x00000001)
-#define BGFX_RESET_MSAA_X2 UINT32_C(0x00000010)
-#define BGFX_RESET_MSAA_X4 UINT32_C(0x00000020)
-#define BGFX_RESET_MSAA_X8 UINT32_C(0x00000030)
-#define BGFX_RESET_MSAA_X16 UINT32_C(0x00000040)
-#define BGFX_RESET_MSAA_SHIFT 4
-#define BGFX_RESET_MSAA_MASK UINT32_C(0x00000070)
-#define BGFX_RESET_VSYNC UINT32_C(0x00000080)
-#define BGFX_RESET_MAXANISOTROPY UINT32_C(0x00000100)
-#define BGFX_RESET_CAPTURE UINT32_C(0x00000200)
-#define BGFX_RESET_HMD UINT32_C(0x00000400)
-#define BGFX_RESET_HMD_DEBUG UINT32_C(0x00000800)
-#define BGFX_RESET_HMD_RECENTER UINT32_C(0x00001000)
-#define BGFX_RESET_FLUSH_AFTER_RENDER UINT32_C(0x00002000)
-#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000)
-#define BGFX_RESET_SRGB_BACKBUFFER UINT32_C(0x00008000)
-
-///
-#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000000001)
-#define BGFX_CAPS_TEXTURE_COMPARE_ALL UINT64_C(0x0000000000000003)
-#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000000004)
-#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000000000008)
-#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000000010)
-#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000000020)
-#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000040)
-#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000080)
-#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000100)
-#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000200)
-#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000000400)
-#define BGFX_CAPS_HMD UINT64_C(0x0000000000000800)
-#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000001000)
-#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000002000)
-
-///
-#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT8_C(0x00)
-#define BGFX_CAPS_FORMAT_TEXTURE_COLOR UINT8_C(0x01)
-#define BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB UINT8_C(0x02)
-#define BGFX_CAPS_FORMAT_TEXTURE_EMULATED UINT8_C(0x04)
-#define BGFX_CAPS_FORMAT_TEXTURE_VERTEX UINT8_C(0x08)
-#define BGFX_CAPS_FORMAT_TEXTURE_IMAGE UINT8_C(0x10)
-#define BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER UINT8_C(0x20)
-
-///
-#define BGFX_VIEW_NONE UINT8_C(0x00)
-#define BGFX_VIEW_STEREO UINT8_C(0x01)
-
-///
-#define BGFX_SUBMIT_EYE_LEFT UINT8_C(0x01)
-#define BGFX_SUBMIT_EYE_RIGHT UINT8_C(0x02)
-#define BGFX_SUBMIT_EYE_MASK UINT8_C(0x03)
-#define BGFX_SUBMIT_EYE_FIRST BGFX_SUBMIT_EYE_LEFT
-
-///
-#define BGFX_PCI_ID_NONE UINT16_C(0x0000)
-#define BGFX_PCI_ID_SOFTWARE_RASTERIZER UINT16_C(0x0001)
-#define BGFX_PCI_ID_AMD UINT16_C(0x1002)
-#define BGFX_PCI_ID_INTEL UINT16_C(0x8086)
-#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de)
-
-#endif // BGFX_DEFINES_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/makefile b/3rdparty/bgfx/makefile
index 599290517bf..cfd80cbd4ef 100644
--- a/3rdparty/bgfx/makefile
+++ b/3rdparty/bgfx/makefile
@@ -20,7 +20,7 @@ endif
# $(info $(OS))
-GENIE=../bx/tools/bin/$(OS)/genie
+GENIE=../bx/tools/bin/$(OS)/genie $(GENIE_FLAGS)
all:
$(GENIE) --with-tools --with-shared-lib vs2008
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index 693b7a3c6c2..c9658d35f84 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -35,6 +35,7 @@ function bgfxProject(_name, _kind, _defines)
includedirs {
path.join(BGFX_DIR, "3rdparty"),
+ path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
path.join(BGFX_DIR, "../bx/include"),
}
@@ -57,14 +58,6 @@ function bgfxProject(_name, _kind, _defines)
}
end
- if (_OPTIONS["vs"] == "vs2012-xp")
- or (_OPTIONS["vs"] == "vs2013-xp") then
- configuration { "vs201*" }
- includedirs {
- "$(DXSDK_DIR)/include",
- }
- end
-
configuration { "Debug" }
defines {
"BGFX_CONFIG_DEBUG=1",
@@ -76,19 +69,15 @@ function bgfxProject(_name, _kind, _defines)
"GLESv2",
}
- configuration { "vs2008" }
- includedirs {
- "$(DXSDK_DIR)/include",
- }
-
- configuration { "winphone8* or winstore8*"}
+ configuration { "winphone8* or winstore8*" }
linkoptions {
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
}
- configuration { "xcode4 or osx or ios*" }
- files {
- path.join(BGFX_DIR, "src/**.mm"),
+ configuration { "*clang*" }
+ buildoptions {
+ "-Wno-microsoft-enum-value", -- enumerator value is not representable in the underlying type 'int'
+ "-Wno-microsoft-const-init", -- default initialization of an object of const type '' without a user-provided default constructor is a Microsoft extension
}
configuration { "osx" }
@@ -102,11 +91,6 @@ function bgfxProject(_name, _kind, _defines)
path.join(BGFX_DIR, "3rdparty/khronos"),
}
- configuration { "x64", "vs* or mingw*" }
- defines {
- "_WIN32_WINNT=0x601",
- }
-
configuration {}
includedirs {
@@ -139,11 +123,38 @@ function bgfxProject(_name, _kind, _defines)
path.join(BGFX_DIR, "src/renderer_null.cpp"),
path.join(BGFX_DIR, "src/renderer_gl.cpp"),
path.join(BGFX_DIR, "src/renderer_vk.cpp"),
+ path.join(BGFX_DIR, "src/shader_dx9bc.cpp"),
+ path.join(BGFX_DIR, "src/shader_dxbc.cpp"),
+ path.join(BGFX_DIR, "src/shader_spirv.cpp"),
path.join(BGFX_DIR, "src/vertexdecl.cpp"),
}
+
+ configuration { "xcode4 or osx or ios*" }
+ files {
+ path.join(BGFX_DIR, "src/amalgamated.mm"),
+ }
+
+ excludes {
+ path.join(BGFX_DIR, "src/glcontext_eagl.mm"),
+ path.join(BGFX_DIR, "src/glcontext_nsgl.mm"),
+ path.join(BGFX_DIR, "src/renderer_mtl.mm"),
+ path.join(BGFX_DIR, "src/amalgamated.cpp"),
+ }
+
+ configuration {}
+
else
+ configuration { "xcode4 or osx or ios*" }
+ files {
+ path.join(BGFX_DIR, "src/glcontext_eagl.mm"),
+ path.join(BGFX_DIR, "src/glcontext_nsgl.mm"),
+ path.join(BGFX_DIR, "src/renderer_mtl.mm"),
+ }
+
+ configuration {}
+
excludes {
- path.join(BGFX_DIR, "src/amalgamated.cpp"),
+ path.join(BGFX_DIR, "src/amalgamated.**"),
}
end
diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua
index 37e53afaa83..98dad9afc31 100644
--- a/3rdparty/bgfx/scripts/example-common.lua
+++ b/3rdparty/bgfx/scripts/example-common.lua
@@ -22,6 +22,30 @@ project ("example-common")
path.join(BGFX_DIR, "examples/common/**.h"),
}
+ if _OPTIONS["with-scintilla"] then
+ defines {
+ "SCI_NAMESPACE",
+ "SCI_LEXER",
+ }
+
+ buildoptions {
+-- "-Wno-missing-field-initializers",
+ }
+
+ includedirs {
+ path.join(BGFX_DIR, "3rdparty/scintilla/include"),
+ path.join(BGFX_DIR, "3rdparty/scintilla/lexlib"),
+ }
+
+ files {
+ path.join(BGFX_DIR, "3rdparty/scintilla/src/**.cxx"),
+ path.join(BGFX_DIR, "3rdparty/scintilla/src/**.h"),
+ path.join(BGFX_DIR, "3rdparty/scintilla/lexlib/**.cxx"),
+ path.join(BGFX_DIR, "3rdparty/scintilla/lexlib/**.h"),
+ path.join(BGFX_DIR, "3rdparty/scintilla/lexers/**.cxx"),
+ }
+ end
+
if _OPTIONS["with-sdl"] then
defines {
"ENTRY_CONFIG_USE_SDL=1",
@@ -37,16 +61,10 @@ project ("example-common")
}
end
- configuration { "vs2008" }
- includedirs {
- "$(DXSDK_DIR)/include",
+ configuration { "osx or ios* or tvos*" }
+ files {
+ path.join(BGFX_DIR, "examples/common/**.mm"),
}
- if (_OPTIONS["vs"] == "vs2012-xp") or (_OPTIONS["vs"] == "vs2013-xp") then
- configuration { "vs201*" }
- includedirs {
- "$(DXSDK_DIR)/include",
- }
- end
configuration { "winphone8* or winstore8*"}
linkoptions {
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 87ef1392731..ce3e8d8e6d2 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -24,6 +24,11 @@ newoption {
}
newoption {
+ trigger = "with-scintilla",
+ description = "Enable building with Scintilla editor.",
+}
+
+newoption {
trigger = "with-shared-lib",
description = "Enable building shared library.",
}
@@ -300,22 +305,19 @@ function exampleProject(_name)
}
configuration { "osx" }
- files {
- path.join(BGFX_DIR, "examples/common/**.mm"),
- }
- links {
- "Cocoa.framework",
- "OpenGL.framework",
+ linkoptions {
+ "-framework Cocoa",
+ "-framework Metal",
+ "-framework QuartzCore",
+ "-framework OpenGL",
}
- configuration { "ios*" }
+ configuration { "ios* or tvos*" }
kind "ConsoleApp"
- files {
- path.join(BGFX_DIR, "examples/common/**.mm"),
- }
linkoptions {
"-framework CoreFoundation",
"-framework Foundation",
+ "-framework Metal",
"-framework OpenGLES",
"-framework UIKit",
"-framework QuartzCore",
@@ -327,6 +329,12 @@ function exampleProject(_name)
path.join(BGFX_DIR, "examples/runtime/iOS-Info.plist"),
}
+ configuration { "xcode4", "tvos" }
+ kind "WindowedApp"
+ files {
+ path.join(BGFX_DIR, "examples/runtime/tvOS-Info.plist"),
+ }
+
configuration { "qnx*" }
targetextension ""
links {
diff --git a/3rdparty/bgfx/scripts/shader-embeded.mk b/3rdparty/bgfx/scripts/shader-embeded.mk
index d57952216cc..59bb3d9d037 100644
--- a/3rdparty/bgfx/scripts/shader-embeded.mk
+++ b/3rdparty/bgfx/scripts/shader-embeded.mk
@@ -27,6 +27,8 @@ vs_%.bin.h : vs_%.sc
-@cat $(SHADER_TMP) >> $(@)
-$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p vs_4_0 -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx11
-@cat $(SHADER_TMP) >> $(@)
+ -$(SILENT) $(SHADERC) $(VS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_mtl
+ -@cat $(SHADER_TMP) >> $(@)
fs_%.bin.h : fs_%.sc
@echo [$(<)]
@@ -36,6 +38,8 @@ fs_%.bin.h : fs_%.sc
-@cat $(SHADER_TMP) >> $(@)
-$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p ps_4_0 -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx11
-@cat $(SHADER_TMP) >> $(@)
+ -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_mtl
+ -@cat $(SHADER_TMP) >> $(@)
.PHONY: all
all: $(BIN)
diff --git a/3rdparty/bgfx/scripts/shader.mk b/3rdparty/bgfx/scripts/shader.mk
index c6c99ff9bc1..002b7564b3e 100644
--- a/3rdparty/bgfx/scripts/shader.mk
+++ b/3rdparty/bgfx/scripts/shader.mk
@@ -10,11 +10,12 @@ ifndef TARGET
.PHONY: all
all:
@echo Usage: make TARGET=# [clean, all, rebuild]
- @echo " TARGET=0 (hlsl - dx9)"
- @echo " TARGET=1 (hlsl - dx11)"
- @echo " TARGET=2 (glsl - nacl)"
- @echo " TARGET=3 (glsl - android)"
- @echo " TARGET=4 (glsl - linux)"
+ @echo " TARGET=0 (hlsl - dx9)"
+ @echo " TARGET=1 (hlsl - dx11)"
+ @echo " TARGET=2 (glsl - nacl)"
+ @echo " TARGET=3 (glsl - android)"
+ @echo " TARGET=4 (glsl - linux)"
+ @echo " TARGET=5 (metal - OSX/iOS)"
@echo " VERBOSE=1 show build commands."
else
@@ -45,6 +46,13 @@ VS_FLAGS=--platform linux -p 120
FS_FLAGS=--platform linux -p 120
CS_FLAGS=--platform linux -p 430
SHADER_PATH=shaders/glsl
+else
+ifeq ($(TARGET), 5)
+VS_FLAGS=--platform osx -p metal
+FS_FLAGS=--platform osx -p metal
+CS_FLAGS=--platform osx -p metal
+SHADER_PATH=shaders/metal
+endif
endif
endif
endif
diff --git a/3rdparty/bgfx/scripts/shaderc.lua b/3rdparty/bgfx/scripts/shaderc.lua
index 5f6d4e4fd22..2824477afff 100644
--- a/3rdparty/bgfx/scripts/shaderc.lua
+++ b/3rdparty/bgfx/scripts/shaderc.lua
@@ -55,12 +55,6 @@ project "shaderc"
path.join(GLSL_OPTIMIZER, "include/c99"),
}
- configuration { "vs*" }
- includedirs {
- "$(DXSDK_DIR)/include",
- }
-
-
configuration { "vs* or mingw*" }
links {
"d3dcompiler",
diff --git a/3rdparty/bgfx/src/amalgamated.cpp b/3rdparty/bgfx/src/amalgamated.cpp
index 2a88eeab6ac..042475d8151 100644
--- a/3rdparty/bgfx/src/amalgamated.cpp
+++ b/3rdparty/bgfx/src/amalgamated.cpp
@@ -17,4 +17,7 @@
#include "renderer_null.cpp"
#include "renderer_gl.cpp"
#include "renderer_vk.cpp"
+#include "shader_dxbc.cpp"
+#include "shader_dx9bc.cpp"
+#include "shader_spirv.cpp"
#include "vertexdecl.cpp"
diff --git a/3rdparty/bgfx/src/amalgamated.mm b/3rdparty/bgfx/src/amalgamated.mm
new file mode 100644
index 00000000000..6781cf9f843
--- /dev/null
+++ b/3rdparty/bgfx/src/amalgamated.mm
@@ -0,0 +1,9 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "amalgamated.cpp"
+#include "glcontext_eagl.mm"
+#include "glcontext_nsgl.mm"
+#include "renderer_mtl.mm"
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index 1137ee04e32..279fd7564c0 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -9,7 +9,7 @@ namespace bgfx
{
#define BGFX_MAIN_THREAD_MAGIC UINT32_C(0x78666762)
-#if BGFX_CONFIG_MULTITHREADED && !BX_PLATFORM_OSX && !BX_PLATFORM_IOS
+#if BGFX_CONFIG_MULTITHREADED
# define BGFX_CHECK_MAIN_THREAD() \
BX_CHECK(NULL != s_ctx, "Library is not initialized yet."); \
BX_CHECK(BGFX_MAIN_THREAD_MAGIC == s_threadIndex, "Must be called from main thread.")
@@ -17,7 +17,7 @@ namespace bgfx
#else
# define BGFX_CHECK_MAIN_THREAD()
# define BGFX_CHECK_RENDER_THREAD()
-#endif // BGFX_CONFIG_MULTITHREADED && !BX_PLATFORM_OSX && !BX_PLATFORM_IOS
+#endif // BGFX_CONFIG_MULTITHREADED
#if BGFX_CONFIG_USE_TINYSTL
void* TinyStlAllocator::static_allocate(size_t _bytes)
@@ -40,6 +40,22 @@ namespace bgfx
{
}
+ virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) BX_OVERRIDE
+ {
+ char temp[2048];
+ char* out = temp;
+ int32_t len = bx::snprintf(out, sizeof(temp), "%s (%d): ", _filePath, _line);
+ int32_t total = len + bx::vsnprintf(out + len, sizeof(temp)-len, _format, _argList);
+ if ( (int32_t)sizeof(temp) < total)
+ {
+ out = (char*)alloca(total+1);
+ memcpy(out, temp, len);
+ bx::vsnprintf(out + len, total-len, _format, _argList);
+ }
+ out[total] = '\0';
+ bx::debugOutput(out);
+ }
+
virtual void fatal(Fatal::Enum _code, const char* _str) BX_OVERRIDE
{
if (Fatal::DebugCheck == _code)
@@ -175,12 +191,7 @@ namespace bgfx
return bx::alignedRealloc(this, _ptr, _size, _align, _file, _line);
}
- void checkLeaks()
- {
-#if BGFX_CONFIG_MEMORY_TRACKING
- BX_WARN(0 == m_numBlocks, "MEMORY LEAK: %d (max: %d)", m_numBlocks, m_maxBlocks);
-#endif // BGFX_CONFIG_MEMORY_TRACKING
- }
+ void checkLeaks();
protected:
#if BGFX_CONFIG_MEMORY_TRACKING
@@ -190,7 +201,7 @@ namespace bgfx
#endif // BGFX_CONFIG_MEMORY_TRACKING
};
- static CallbackStub* s_callbackStub = NULL;
+ static CallbackStub* s_callbackStub = NULL;
static AllocatorStub* s_allocatorStub = NULL;
static bool s_graphicsDebuggerPresent = false;
@@ -199,11 +210,69 @@ namespace bgfx
Caps g_caps;
- static BX_THREAD uint32_t s_threadIndex = 0;
+#if BGFX_CONFIG_MULTITHREADED && !defined(BX_THREAD_LOCAL)
+ class ThreadData
+ {
+ BX_CLASS(ThreadData
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
+ ThreadData(uintptr_t _rhs)
+ {
+ union { uintptr_t ui; void* ptr; } cast = { _rhs };
+ m_tls.set(cast.ptr);
+ }
+
+ operator uintptr_t() const
+ {
+ union { uintptr_t ui; void* ptr; } cast;
+ cast.ptr = m_tls.get();
+ return cast.ui;
+ }
+
+ uintptr_t operator=(uintptr_t _rhs)
+ {
+ union { uintptr_t ui; void* ptr; } cast = { _rhs };
+ m_tls.set(cast.ptr);
+ return _rhs;
+ }
+
+ bool operator==(uintptr_t _rhs) const
+ {
+ uintptr_t lhs = *this;
+ return lhs == _rhs;
+ }
+
+ private:
+ bx::TlsData m_tls;
+ };
+
+ static ThreadData s_threadIndex(0);
+#elif !BGFX_CONFIG_MULTITHREADED
+ static uint32_t s_threadIndex(0);
+#else
+ static BX_THREAD_LOCAL uint32_t s_threadIndex(0);
+#endif
+
static Context* s_ctx = NULL;
static bool s_renderFrameCalled = false;
PlatformData g_platformData;
+ void AllocatorStub::checkLeaks()
+ {
+#if BGFX_CONFIG_MEMORY_TRACKING
+ // BK - CallbackStub will be deleted after printing this info, so there is always one
+ // leak if CallbackStub is used.
+ BX_WARN(uint32_t(NULL != s_callbackStub ? 1 : 0) == m_numBlocks
+ , "MEMORY LEAK: %d (max: %d)"
+ , m_numBlocks
+ , m_maxBlocks
+ );
+#endif // BGFX_CONFIG_MEMORY_TRACKING
+ }
+
void setPlatformData(const PlatformData& _pd)
{
if (NULL != s_ctx)
@@ -236,12 +305,26 @@ namespace bgfx
va_list argList;
va_start(argList, _format);
- bx::vsnprintf(temp, sizeof(temp), _format, argList);
+ char* out = temp;
+ int32_t len = bx::vsnprintf(out, sizeof(temp), _format, argList);
+ if ( (int32_t)sizeof(temp) < len)
+ {
+ out = (char*)alloca(len+1);
+ len = bx::vsnprintf(out, len, _format, argList);
+ }
+ out[len] = '\0';
va_end(argList);
- temp[sizeof(temp)-1] = '\0';
+ g_callback->fatal(_code, out);
+ }
+
+ void trace(const char* _filePath, uint16_t _line, const char* _format, ...)
+ {
+ va_list argList;
+ va_start(argList, _format);
+ g_callback->traceVargs(_filePath, _line, _format, argList);
+ va_end(argList);
- g_callback->fatal(_code, temp);
}
#include "charset.h"
@@ -310,6 +393,10 @@ namespace bgfx
mem = makeRef(vs_debugfont_dx11, sizeof(vs_debugfont_dx11) );
break;
+ case RendererType::Metal:
+ mem = makeRef(vs_debugfont_mtl, sizeof(vs_debugfont_mtl) );
+ break;
+
default:
mem = makeRef(vs_debugfont_glsl, sizeof(vs_debugfont_glsl) );
break;
@@ -328,6 +415,10 @@ namespace bgfx
mem = makeRef(fs_debugfont_dx11, sizeof(fs_debugfont_dx11) );
break;
+ case RendererType::Metal:
+ mem = makeRef(fs_debugfont_mtl, sizeof(fs_debugfont_mtl) );
+ break;
+
default:
mem = makeRef(fs_debugfont_glsl, sizeof(fs_debugfont_glsl) );
break;
@@ -548,6 +639,27 @@ namespace bgfx
fragMem[ii] = makeRef(mem[ii].data, uint32_t(mem[ii].size) );
}
}
+ else if (RendererType::Metal == g_caps.rendererType)
+ {
+ vsh = createShader(makeRef(vs_clear_mtl, sizeof(vs_clear_mtl) ) );
+
+ const Mem mem[] =
+ {
+ Mem(fs_clear0_mtl, sizeof(fs_clear0_mtl) ),
+ Mem(fs_clear1_mtl, sizeof(fs_clear1_mtl) ),
+ Mem(fs_clear2_mtl, sizeof(fs_clear2_mtl) ),
+ Mem(fs_clear3_mtl, sizeof(fs_clear3_mtl) ),
+ Mem(fs_clear4_mtl, sizeof(fs_clear4_mtl) ),
+ Mem(fs_clear5_mtl, sizeof(fs_clear5_mtl) ),
+ Mem(fs_clear6_mtl, sizeof(fs_clear6_mtl) ),
+ Mem(fs_clear7_mtl, sizeof(fs_clear7_mtl) ),
+ };
+
+ for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii)
+ {
+ fragMem[ii] = makeRef(mem[ii].data, uint32_t(mem[ii].size) );
+ }
+ }
else
{
BGFX_FATAL(false, Fatal::UnableToInitialize, "Unknown renderer type %d", g_caps.rendererType);
@@ -588,13 +700,8 @@ namespace bgfx
const char* s_uniformTypeName[] =
{
- "int",
- "float",
+ "int1",
NULL,
- "int",
- "float",
- "vec2",
- "vec3",
"vec4",
"mat3",
"mat4",
@@ -634,7 +741,7 @@ namespace bgfx
"u_model",
"u_modelView",
"u_modelViewProj",
- "u_alphaRef",
+ "u_alphaRef4",
};
const char* getPredefinedUniformName(PredefinedUniform::Enum _enum)
@@ -655,7 +762,7 @@ namespace bgfx
return PredefinedUniform::Count;
}
- uint32_t Frame::submit(uint8_t _id, int32_t _depth)
+ uint32_t Frame::submit(uint8_t _id, ProgramHandle _handle, int32_t _depth)
{
if (m_discard)
{
@@ -670,30 +777,31 @@ namespace bgfx
return m_num;
}
- m_constEnd = m_constantBuffer->getPos();
+ m_uniformEnd = m_uniformBuffer->getPos();
- BX_WARN(invalidHandle != m_key.m_program, "Program with invalid handle");
- if (invalidHandle != m_key.m_program)
- {
- m_key.m_depth = (uint32_t)_depth;
- m_key.m_view = _id;
- m_key.m_seq = s_ctx->m_seq[_id] & s_ctx->m_seqMask[_id];
- s_ctx->m_seq[_id]++;
+ m_key.m_program = invalidHandle == _handle.idx
+ ? 0
+ : _handle.idx
+ ;
- uint64_t key = m_key.encodeDraw();
- m_sortKeys[m_num] = key;
- m_sortValues[m_num] = m_numRenderItems;
- ++m_num;
+ m_key.m_depth = (uint32_t)_depth;
+ m_key.m_view = _id;
+ m_key.m_seq = s_ctx->m_seq[_id] & s_ctx->m_seqMask[_id];
+ s_ctx->m_seq[_id]++;
- m_draw.m_constBegin = m_constBegin;
- m_draw.m_constEnd = m_constEnd;
- m_draw.m_flags |= m_flags;
- m_renderItem[m_numRenderItems].draw = m_draw;
- ++m_numRenderItems;
- }
+ uint64_t key = m_key.encodeDraw();
+ m_sortKeys[m_num] = key;
+ m_sortValues[m_num] = m_numRenderItems;
+ ++m_num;
+
+ m_draw.m_constBegin = m_uniformBegin;
+ m_draw.m_constEnd = m_uniformEnd;
+ m_draw.m_flags |= m_flags;
+ m_renderItem[m_numRenderItems].draw = m_draw;
+ ++m_numRenderItems;
m_draw.clear();
- m_constBegin = m_constEnd;
+ m_uniformBegin = m_uniformEnd;
m_flags = BGFX_STATE_NONE;
return m_num;
@@ -713,7 +821,7 @@ namespace bgfx
return m_num;
}
- m_constEnd = m_constantBuffer->getPos();
+ m_uniformEnd = m_uniformBuffer->getPos();
m_compute.m_matrix = m_draw.m_matrix;
m_compute.m_num = m_draw.m_num;
@@ -723,26 +831,23 @@ namespace bgfx
m_compute.m_submitFlags = _flags;
m_key.m_program = _handle.idx;
- if (invalidHandle != m_key.m_program)
- {
- m_key.m_depth = 0;
- m_key.m_view = _id;
- m_key.m_seq = s_ctx->m_seq[_id];
- s_ctx->m_seq[_id]++;
+ m_key.m_depth = 0;
+ m_key.m_view = _id;
+ m_key.m_seq = s_ctx->m_seq[_id];
+ s_ctx->m_seq[_id]++;
- uint64_t key = m_key.encodeCompute();
- m_sortKeys[m_num] = key;
- m_sortValues[m_num] = m_numRenderItems;
- ++m_num;
+ uint64_t key = m_key.encodeCompute();
+ m_sortKeys[m_num] = key;
+ m_sortValues[m_num] = m_numRenderItems;
+ ++m_num;
- m_compute.m_constBegin = m_constBegin;
- m_compute.m_constEnd = m_constEnd;
- m_renderItem[m_numRenderItems].compute = m_compute;
- ++m_numRenderItems;
- }
+ m_compute.m_constBegin = m_uniformBegin;
+ m_compute.m_constEnd = m_uniformEnd;
+ m_renderItem[m_numRenderItems].compute = m_compute;
+ ++m_numRenderItems;
m_compute.clear();
- m_constBegin = m_constEnd;
+ m_uniformBegin = m_uniformEnd;
return m_num;
}
@@ -758,56 +863,57 @@ namespace bgfx
RenderFrame::Enum renderFrame()
{
- if (NULL == s_ctx)
+ if (BX_ENABLED(BGFX_CONFIG_MULTITHREADED) )
{
- s_renderFrameCalled = true;
- s_threadIndex = ~BGFX_MAIN_THREAD_MAGIC;
- return RenderFrame::NoContext;
- }
+ if (NULL == s_ctx)
+ {
+ s_renderFrameCalled = true;
+ s_threadIndex = ~BGFX_MAIN_THREAD_MAGIC;
+ return RenderFrame::NoContext;
+ }
- BGFX_CHECK_RENDER_THREAD();
- if (s_ctx->renderFrame() )
- {
- Context* ctx = s_ctx;
- ctx->gameSemWait();
- s_ctx = NULL;
- ctx->renderSemPost();
- return RenderFrame::Exiting;
+ BGFX_CHECK_RENDER_THREAD();
+ if (s_ctx->renderFrame() )
+ {
+ Context* ctx = s_ctx;
+ ctx->gameSemWait();
+ s_ctx = NULL;
+ ctx->renderSemPost();
+ return RenderFrame::Exiting;
+ }
+
+ return RenderFrame::Render;
}
- return RenderFrame::Render;
+ BX_CHECK(false, "This call only makes sense if used with multi-threaded renderer.");
+ return RenderFrame::NoContext;
}
const uint32_t g_uniformTypeSize[UniformType::Count+1] =
{
sizeof(int32_t),
- sizeof(float),
0,
- 1*sizeof(int32_t),
- 1*sizeof(float),
- 2*sizeof(float),
- 3*sizeof(float),
4*sizeof(float),
3*3*sizeof(float),
4*4*sizeof(float),
1,
};
- void ConstantBuffer::writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
+ void UniformBuffer::writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
{
uint32_t opcode = encodeOpcode(_type, _loc, _num, true);
write(opcode);
write(_value, g_uniformTypeSize[_type]*_num);
}
- void ConstantBuffer::writeUniformHandle(UniformType::Enum _type, uint16_t _loc, UniformHandle _handle, uint16_t _num)
+ void UniformBuffer::writeUniformHandle(UniformType::Enum _type, uint16_t _loc, UniformHandle _handle, uint16_t _num)
{
uint32_t opcode = encodeOpcode(_type, _loc, _num, false);
write(opcode);
write(&_handle, sizeof(UniformHandle) );
}
- void ConstantBuffer::writeMarker(const char* _marker)
+ void UniformBuffer::writeMarker(const char* _marker)
{
uint16_t num = (uint16_t)strlen(_marker)+1;
uint32_t opcode = encodeOpcode(bgfx::UniformType::Count, 0, num, true);
@@ -828,6 +934,7 @@ namespace bgfx
CAPS_FLAGS(BGFX_CAPS_TEXTURE_COMPARE_ALL),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_3D),
CAPS_FLAGS(BGFX_CAPS_VERTEX_ATTRIB_HALF),
+ CAPS_FLAGS(BGFX_CAPS_VERTEX_ATTRIB_UINT10),
CAPS_FLAGS(BGFX_CAPS_INSTANCING),
CAPS_FLAGS(BGFX_CAPS_RENDERER_MULTITHREADED),
CAPS_FLAGS(BGFX_CAPS_FRAGMENT_DEPTH),
@@ -838,6 +945,7 @@ namespace bgfx
CAPS_FLAGS(BGFX_CAPS_HMD),
CAPS_FLAGS(BGFX_CAPS_INDEX32),
CAPS_FLAGS(BGFX_CAPS_DRAW_INDIRECT),
+ CAPS_FLAGS(BGFX_CAPS_HIDPI),
#undef CAPS_FLAGS
};
@@ -857,24 +965,28 @@ namespace bgfx
}
BX_TRACE("Supported texture formats:");
- BX_TRACE("\t +--------- x = supported / * = emulated");
- BX_TRACE("\t |+-------- sRGB format");
- BX_TRACE("\t ||+------- vertex format");
- BX_TRACE("\t |||+------ image");
- BX_TRACE("\t ||||+----- framebuffer");
- BX_TRACE("\t ||||| +-- name");
+ BX_TRACE("\t +----------- x = supported / * = emulated");
+ BX_TRACE("\t |+---------- sRGB format");
+ BX_TRACE("\t ||+--------- vertex format");
+ BX_TRACE("\t |||+-------- image");
+ BX_TRACE("\t ||||+------- framebuffer");
+ BX_TRACE("\t |||||+------ MSAA framebuffer");
+ BX_TRACE("\t ||||||+----- MSAA texture");
+ BX_TRACE("\t ||||||| +-- name");
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
if (TextureFormat::Unknown != ii
&& TextureFormat::UnknownDepth != ii)
{
uint8_t flags = g_caps.formats[ii];
- BX_TRACE("\t[%c%c%c%c%c] %s"
- , flags&BGFX_CAPS_FORMAT_TEXTURE_COLOR ? 'x' : flags&BGFX_CAPS_FORMAT_TEXTURE_EMULATED ? '*' : ' '
- , flags&BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB ? 'l' : ' '
- , flags&BGFX_CAPS_FORMAT_TEXTURE_VERTEX ? 'v' : ' '
- , flags&BGFX_CAPS_FORMAT_TEXTURE_IMAGE ? 'i' : ' '
- , flags&BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER ? 'f' : ' '
+ BX_TRACE("\t[%c%c%c%c%c%c%c] %s"
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_COLOR ? 'x' : flags&BGFX_CAPS_FORMAT_TEXTURE_EMULATED ? '*' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB ? 'l' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_VERTEX ? 'v' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_IMAGE ? 'i' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER ? 'f' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA ? '+' : ' '
+ , flags&BGFX_CAPS_FORMAT_TEXTURE_MSAA ? 'm' : ' '
, getName(TextureFormat::Enum(ii) )
);
BX_UNUSED(flags);
@@ -901,7 +1013,7 @@ namespace bgfx
TextureFormat::RGBA8, // D3D9 doesn't support RGBA8
};
- void Context::init(RendererType::Enum _type)
+ bool Context::init(RendererType::Enum _type)
{
BX_CHECK(!m_rendererInitialized, "Already initialized?");
@@ -920,14 +1032,13 @@ namespace bgfx
// should not be created.
BX_TRACE("Application called bgfx::renderFrame directly, not creating render thread.");
m_singleThreaded = true
- && !BX_ENABLED(BX_PLATFORM_OSX || BX_PLATFORM_IOS)
&& ~BGFX_MAIN_THREAD_MAGIC == s_threadIndex
;
}
else
{
BX_TRACE("Creating rendering thread.");
- m_thread.init(renderThread, this);
+ m_thread.init(renderThread, this, 0, "bgfx - renderer backend thread");
m_singleThreaded = false;
}
#else
@@ -976,6 +1087,19 @@ namespace bgfx
// g_caps is initialized and available after this point.
frame();
+ if (!m_rendererInitialized)
+ {
+ getCommandBuffer(CommandBuffer::RendererShutdownEnd);
+ frame();
+ frame();
+ m_declRef.shutdown(m_vertexDeclHandle);
+ m_submit->destroy();
+#if BGFX_CONFIG_MULTITHREADED
+ m_render->destroy();
+#endif // BGFX_CONFIG_MULTITHREADED
+ return false;
+ }
+
for (uint32_t ii = 0; ii < BX_COUNTOF(s_emulatedFormats); ++ii)
{
if (0 == (g_caps.formats[s_emulatedFormats[ii] ] & BGFX_CAPS_FORMAT_TEXTURE_COLOR) )
@@ -1006,6 +1130,8 @@ namespace bgfx
m_submit->m_transientIb = createTransientIndexBuffer(BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE);
frame();
}
+
+ return true;
}
void Context::shutdown()
@@ -1171,10 +1297,10 @@ namespace bgfx
memcpy(m_submit->m_view, m_view, sizeof(m_view) );
memcpy(m_submit->m_proj, m_proj, sizeof(m_proj) );
memcpy(m_submit->m_viewFlags, m_viewFlags, sizeof(m_viewFlags) );
- if (m_clearColorDirty > 0)
+ if (m_colorPaletteDirty > 0)
{
- --m_clearColorDirty;
- memcpy(m_submit->m_clearColor, m_clearColor, sizeof(m_clearColor) );
+ --m_colorPaletteDirty;
+ memcpy(m_submit->m_colorPalette, m_clearColor, sizeof(m_clearColor) );
}
m_submit->finish();
@@ -1199,6 +1325,19 @@ namespace bgfx
);
}
+ const char* Context::getName(UniformHandle _handle) const
+ {
+ for (UniformHashMap::const_iterator it = m_uniformHashMap.begin(), itEnd = m_uniformHashMap.end(); it != itEnd; ++it)
+ {
+ if (it->second.idx == _handle.idx)
+ {
+ return it->first.c_str();
+ }
+ }
+
+ return NULL;
+ }
+
bool Context::renderFrame()
{
if (m_rendererInitialized
@@ -1227,12 +1366,12 @@ namespace bgfx
return m_exit;
}
- void rendererUpdateUniforms(RendererContextI* _renderCtx, ConstantBuffer* _constantBuffer, uint32_t _begin, uint32_t _end)
+ void rendererUpdateUniforms(RendererContextI* _renderCtx, UniformBuffer* _uniformBuffer, uint32_t _begin, uint32_t _end)
{
- _constantBuffer->reset(_begin);
- while (_constantBuffer->getPos() < _end)
+ _uniformBuffer->reset(_begin);
+ while (_uniformBuffer->getPos() < _end)
{
- uint32_t opcode = _constantBuffer->read();
+ uint32_t opcode = _uniformBuffer->read();
if (UniformType::End == opcode)
{
@@ -1243,10 +1382,10 @@ namespace bgfx
uint16_t loc;
uint16_t num;
uint16_t copy;
- ConstantBuffer::decodeOpcode(opcode, type, loc, num, copy);
+ UniformBuffer::decodeOpcode(opcode, type, loc, num, copy);
uint32_t size = g_uniformTypeSize[type]*num;
- const char* data = _constantBuffer->read(size);
+ const char* data = _uniformBuffer->read(size);
if (UniformType::Count > type)
{
if (copy)
@@ -1342,6 +1481,7 @@ namespace bgfx
BGFX_RENDERER_CONTEXT(d3d9);
BGFX_RENDERER_CONTEXT(d3d11);
BGFX_RENDERER_CONTEXT(d3d12);
+ BGFX_RENDERER_CONTEXT(mtl);
BGFX_RENDERER_CONTEXT(gl);
BGFX_RENDERER_CONTEXT(vk);
@@ -1355,12 +1495,17 @@ namespace bgfx
bool supported;
};
- static const RendererCreator s_rendererCreator[] =
+ static RendererCreator s_rendererCreator[] =
{
- { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Null
+ { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Noop
{ d3d9::rendererCreate, d3d9::rendererDestroy, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9
{ d3d11::rendererCreate, d3d11::rendererDestroy, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11
{ d3d12::rendererCreate, d3d12::rendererDestroy, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12
+#if BGFX_CONFIG_RENDERER_METAL
+ { mtl::rendererCreate, mtl::rendererDestroy, BGFX_RENDERER_METAL_NAME, !!BGFX_CONFIG_RENDERER_METAL }, // Metal
+#else
+ { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Noop
+#endif // BGFX_CONFIG_RENDERER_METAL
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGLES }, // OpenGLES
{ gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL
{ vk::rendererCreate, vk::rendererDestroy, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan
@@ -1418,7 +1563,11 @@ again:
if (windowsVersionIs(Condition::GreaterEqual, 0x0602) )
{
+#if defined(__MINGW32__)
+ first = RendererType::Direct3D11;
+#else
first = RendererType::Direct3D12;
+#endif // __MINGW32__
second = RendererType::Direct3D11;
if (!s_rendererCreator[second].supported)
{
@@ -1447,27 +1596,52 @@ again:
{
_type = RendererType::OpenGLES;
}
+ else if (s_rendererCreator[RendererType::Direct3D12].supported)
+ {
+ _type = RendererType::Direct3D12;
+ }
else if (s_rendererCreator[RendererType::Vulkan].supported)
{
_type = RendererType::Vulkan;
}
+ else
+ {
+ _type = RendererType::Null;
+ }
+ }
+ else if (BX_ENABLED(BX_PLATFORM_IOS) )
+ {
+ if (s_rendererCreator[RendererType::Metal].supported)
+ {
+ _type = RendererType::Metal;
+ }
+ else if (s_rendererCreator[RendererType::OpenGLES].supported)
+ {
+ _type = RendererType::OpenGLES;
+ }
}
else if (BX_ENABLED(0
|| BX_PLATFORM_ANDROID
|| BX_PLATFORM_EMSCRIPTEN
- || BX_PLATFORM_IOS
|| BX_PLATFORM_NACL
|| BX_PLATFORM_RPI
) )
{
_type = RendererType::OpenGLES;
}
- else if (BX_ENABLED(BX_PLATFORM_WINRT))
+ else if (BX_ENABLED(BX_PLATFORM_WINRT) )
{
_type = RendererType::Direct3D11;
}
else
{
+#if 0
+ if (s_rendererCreator[RendererType::Metal].supported)
+ {
+ _type = RendererType::Metal;
+ }
+ else
+#endif // 0
if (s_rendererCreator[RendererType::OpenGL].supported)
{
_type = RendererType::OpenGL;
@@ -1488,6 +1662,7 @@ again:
if (NULL == renderCtx)
{
+ s_rendererCreator[_type].supported = false;
goto again;
}
@@ -1512,19 +1687,41 @@ again:
uint8_t command;
_cmdbuf.read(command);
- BX_CHECK(CommandBuffer::RendererInit == command
- , "RendererInit must be the first command in command buffer before initialization."
- );
- BX_CHECK(!m_rendererInitialized, "This shouldn't happen! Bad synchronization?");
+ switch (command)
+ {
+ case CommandBuffer::RendererShutdownEnd:
+ m_exit = true;
+ return;
- RendererType::Enum type;
- _cmdbuf.read(type);
+ case CommandBuffer::End:
+ return;
- m_renderCtx = rendererCreate(type);
- m_rendererInitialized = true;
- }
+ default:
+ {
+ BX_CHECK(CommandBuffer::RendererInit == command
+ , "RendererInit must be the first command in command buffer before initialization. Unexpected command %d?"
+ , command
+ );
+ BX_CHECK(!m_rendererInitialized, "This shouldn't happen! Bad synchronization?");
+
+ RendererType::Enum type;
+ _cmdbuf.read(type);
- BX_CHECK(NULL != m_renderCtx, "Should not be NULL at this point.");
+ m_renderCtx = rendererCreate(type);
+ m_rendererInitialized = NULL != m_renderCtx;
+
+ if (!m_rendererInitialized)
+ {
+ _cmdbuf.read(command);
+ BX_CHECK(CommandBuffer::End == command, "Unexpected command %d?"
+ , command
+ );
+ return;
+ }
+ }
+ break;
+ }
+ }
do
{
@@ -1995,10 +2192,9 @@ again:
return s_rendererCreator[_type].name;
}
- void init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::ReallocatorI* _allocator)
+ bool init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::ReallocatorI* _allocator)
{
BX_CHECK(NULL == s_ctx, "bgfx is already initialized.");
- BX_TRACE("Init...");
memset(&g_caps, 0, sizeof(g_caps) );
g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS;
@@ -2028,10 +2224,37 @@ again:
s_callbackStub = BX_NEW(g_allocator, CallbackStub);
}
+ BX_TRACE("Init...");
+
s_ctx = BX_ALIGNED_NEW(g_allocator, Context, 16);
- s_ctx->init(_type);
+ if (!s_ctx->init(_type) )
+ {
+ BX_TRACE("Init failed.");
+
+ BX_ALIGNED_DELETE(g_allocator, s_ctx, 16);
+ s_ctx = NULL;
+
+ if (NULL != s_callbackStub)
+ {
+ BX_DELETE(g_allocator, s_callbackStub);
+ s_callbackStub = NULL;
+ }
+
+ if (NULL != s_allocatorStub)
+ {
+ bx::CrtAllocator allocator;
+ BX_DELETE(&allocator, s_allocatorStub);
+ s_allocatorStub = NULL;
+ }
+
+ s_threadIndex = 0;
+ g_callback = NULL;
+ g_allocator = NULL;
+ return false;
+ }
BX_TRACE("Init complete.");
+ return true;
}
void shutdown()
@@ -2045,6 +2268,13 @@ again:
BX_ALIGNED_DELETE(g_allocator, ctx, 16);
+ BX_TRACE("Shutdown complete.");
+
+ if (NULL != s_allocatorStub)
+ {
+ s_allocatorStub->checkLeaks();
+ }
+
if (NULL != s_callbackStub)
{
BX_DELETE(g_allocator, s_callbackStub);
@@ -2053,18 +2283,14 @@ again:
if (NULL != s_allocatorStub)
{
- s_allocatorStub->checkLeaks();
-
bx::CrtAllocator allocator;
BX_DELETE(&allocator, s_allocatorStub);
s_allocatorStub = NULL;
}
s_threadIndex = 0;
- g_callback = NULL;
- g_allocator = NULL;
-
- BX_TRACE("Shutdown complete.");
+ g_callback = NULL;
+ g_allocator = NULL;
}
void reset(uint32_t _width, uint32_t _height, uint32_t _flags)
@@ -2089,6 +2315,11 @@ again:
return s_ctx->getHMD();
}
+ const Stats* getStats()
+ {
+ return s_ctx->getPerfStats();
+ }
+
RendererType::Enum getRendererType()
{
return g_caps.rendererType;
@@ -2096,6 +2327,7 @@ again:
const Memory* alloc(uint32_t _size)
{
+ BX_CHECK(0 < _size, "Invalid memory operation. _size is 0.");
Memory* mem = (Memory*)BX_ALLOC(g_allocator, sizeof(Memory) + _size);
mem->size = _size;
mem->data = (uint8_t*)mem + sizeof(Memory);
@@ -2104,6 +2336,7 @@ again:
const Memory* copy(const void* _data, uint32_t _size)
{
+ BX_CHECK(0 < _size, "Invalid memory operation. _size is 0.");
const Memory* mem = alloc(_size);
memcpy(mem->data, _data, _size);
return mem;
@@ -2218,11 +2451,11 @@ again:
return s_ctx->createDynamicIndexBuffer(_mem, _flags);
}
- void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem)
+ void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem)
{
BGFX_CHECK_MAIN_THREAD();
BX_CHECK(NULL != _mem, "_mem can't be NULL");
- s_ctx->updateDynamicIndexBuffer(_handle, _mem);
+ s_ctx->updateDynamicIndexBuffer(_handle, _startIndex, _mem);
}
void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle)
@@ -2246,11 +2479,11 @@ again:
return s_ctx->createDynamicVertexBuffer(_mem, _decl, _flags);
}
- void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, const Memory* _mem)
+ void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem)
{
BGFX_CHECK_MAIN_THREAD();
BX_CHECK(NULL != _mem, "_mem can't be NULL");
- s_ctx->updateDynamicVertexBuffer(_handle, _mem);
+ s_ctx->updateDynamicVertexBuffer(_handle, _startVertex, _mem);
}
void destroyDynamicVertexBuffer(DynamicVertexBufferHandle _handle)
@@ -2361,28 +2594,18 @@ again:
ProgramHandle createProgram(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders)
{
BGFX_CHECK_MAIN_THREAD();
- ProgramHandle handle = s_ctx->createProgram(_vsh, _fsh);
-
- if (_destroyShaders)
+ if (!isValid(_fsh) )
{
- destroyShader(_vsh);
- destroyShader(_fsh);
+ return createProgram(_vsh, _destroyShaders);
}
- return handle;
+ return s_ctx->createProgram(_vsh, _fsh, _destroyShaders);
}
ProgramHandle createProgram(ShaderHandle _csh, bool _destroyShader)
{
BGFX_CHECK_MAIN_THREAD();
- ProgramHandle handle = s_ctx->createProgram(_csh);
-
- if (_destroyShader)
- {
- destroyShader(_csh);
- }
-
- return handle;
+ return s_ctx->createProgram(_csh, _destroyShader);
}
void destroyProgram(ProgramHandle _handle)
@@ -2486,8 +2709,8 @@ again:
if (BackbufferRatio::Count != _ratio)
{
- _width = uint16_t(s_ctx->m_frame->m_resolution.m_width);
- _height = uint16_t(s_ctx->m_frame->m_resolution.m_height);
+ _width = uint16_t(s_ctx->m_resolution.m_width);
+ _height = uint16_t(s_ctx->m_resolution.m_height);
getTextureSizeFromRatio(_ratio, _width, _height);
}
@@ -2676,16 +2899,7 @@ again:
, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
);
BX_CHECK(NULL != _handles, "_handles can't be NULL");
- FrameBufferHandle handle = s_ctx->createFrameBuffer(_num, _handles);
- if (_destroyTextures)
- {
- for (uint32_t ii = 0; ii < _num; ++ii)
- {
- destroyTexture(_handles[ii]);
- }
- }
-
- return handle;
+ return s_ctx->createFrameBuffer(_num, _handles, _destroyTextures);
}
FrameBufferHandle createFrameBuffer(void* _nwh, uint16_t _width, uint16_t _height, TextureFormat::Enum _depthFormat)
@@ -2712,7 +2926,7 @@ again:
s_ctx->destroyUniform(_handle);
}
- void setClearColor(uint8_t _index, uint32_t _rgba)
+ void setPaletteColor(uint8_t _index, uint32_t _rgba)
{
BGFX_CHECK_MAIN_THREAD();
@@ -2728,20 +2942,20 @@ again:
bb * 1.0f/255.0f,
aa * 1.0f/255.0f,
};
- s_ctx->setClearColor(_index, rgba);
+ s_ctx->setPaletteColor(_index, rgba);
}
- void setClearColor(uint8_t _index, float _r, float _g, float _b, float _a)
+ void setPaletteColor(uint8_t _index, float _r, float _g, float _b, float _a)
{
BGFX_CHECK_MAIN_THREAD();
float rgba[4] = { _r, _g, _b, _a };
- s_ctx->setClearColor(_index, rgba);
+ s_ctx->setPaletteColor(_index, rgba);
}
- void setClearColor(uint8_t _index, const float _rgba[4])
+ void setPaletteColor(uint8_t _index, const float _rgba[4])
{
BGFX_CHECK_MAIN_THREAD();
- s_ctx->setClearColor(_index, _rgba);
+ s_ctx->setPaletteColor(_index, _rgba);
}
bool checkView(uint8_t _id)
@@ -2941,12 +3155,6 @@ again:
s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
}
- void setProgram(ProgramHandle _handle)
- {
- BGFX_CHECK_MAIN_THREAD();
- s_ctx->setProgram(_handle);
- }
-
void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags)
{
BGFX_CHECK_MAIN_THREAD();
@@ -2959,16 +3167,22 @@ again:
s_ctx->setTexture(_stage, _sampler, _handle, _attachment, _flags);
}
- uint32_t submit(uint8_t _id, int32_t _depth)
+ uint32_t touch(uint8_t _id)
+ {
+ ProgramHandle handle = BGFX_INVALID_HANDLE;
+ return submit(_id, handle);
+ }
+
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, int32_t _depth)
{
BGFX_CHECK_MAIN_THREAD();
- return s_ctx->submit(_id, _depth);
+ return s_ctx->submit(_id, _handle, _depth);
}
- uint32_t submit(uint8_t _id, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
{
BGFX_CHECK_MAIN_THREAD();
- return s_ctx->submit(_id, _indirectHandle, _start, _num, _depth);
+ return s_ctx->submit(_id, _handle, _indirectHandle, _start, _num, _depth);
}
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
@@ -3038,8 +3252,8 @@ again:
}
} // namespace bgfx
-#include <bgfx.c99.h>
-#include <bgfxplatform.c99.h>
+#include <bgfx/c99/bgfx.h>
+#include <bgfx/c99/bgfxplatform.h>
BX_STATIC_ASSERT(bgfx::Fatal::Count == bgfx::Fatal::Enum(BGFX_FATAL_COUNT) );
BX_STATIC_ASSERT(bgfx::RendererType::Count == bgfx::RendererType::Enum(BGFX_RENDERER_TYPE_COUNT) );
@@ -3058,6 +3272,89 @@ BX_STATIC_ASSERT(sizeof(bgfx::TextureInfo) == sizeof(bgfx_texture_info
BX_STATIC_ASSERT(sizeof(bgfx::Caps) == sizeof(bgfx_caps_t) );
BX_STATIC_ASSERT(sizeof(bgfx::PlatformData) == sizeof(bgfx_platform_data_t) );
+namespace bgfx
+{
+ struct CallbackC99 : public CallbackI
+ {
+ virtual ~CallbackC99()
+ {
+ }
+
+ virtual void fatal(Fatal::Enum _code, const char* _str) BX_OVERRIDE
+ {
+ m_interface->vtbl->fatal(m_interface, (bgfx_fatal_t)_code, _str);
+ }
+
+ virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) BX_OVERRIDE
+ {
+ m_interface->vtbl->trace_vargs(m_interface, _filePath, _line, _format, _argList);
+ }
+
+ virtual uint32_t cacheReadSize(uint64_t _id) BX_OVERRIDE
+ {
+ return m_interface->vtbl->cache_read_size(m_interface, _id);
+ }
+
+ virtual bool cacheRead(uint64_t _id, void* _data, uint32_t _size) BX_OVERRIDE
+ {
+ return m_interface->vtbl->cache_read(m_interface, _id, _data, _size);
+ }
+
+ virtual void cacheWrite(uint64_t _id, const void* _data, uint32_t _size) BX_OVERRIDE
+ {
+ m_interface->vtbl->cache_write(m_interface, _id, _data, _size);
+ }
+
+ virtual void screenShot(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _data, uint32_t _size, bool _yflip) BX_OVERRIDE
+ {
+ m_interface->vtbl->screen_shot(m_interface, _filePath, _width, _height, _pitch, _data, _size, _yflip);
+ }
+
+ virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) BX_OVERRIDE
+ {
+ m_interface->vtbl->capture_begin(m_interface, _width, _height, _pitch, (bgfx_texture_format_t)_format, _yflip);
+ }
+
+ virtual void captureEnd() BX_OVERRIDE
+ {
+ m_interface->vtbl->capture_end(m_interface);
+ }
+
+ virtual void captureFrame(const void* _data, uint32_t _size) BX_OVERRIDE
+ {
+ m_interface->vtbl->capture_frame(m_interface, _data, _size);
+ }
+
+ bgfx_callback_interface_t* m_interface;
+ };
+
+ class AllocatorC99 : public bx::ReallocatorI
+ {
+ public:
+ virtual ~AllocatorC99()
+ {
+ }
+
+ virtual void* alloc(size_t _size, size_t _align, const char* _file, uint32_t _line) BX_OVERRIDE
+ {
+ return m_interface->vtbl->alloc(m_interface, _size, _align, _file, _line);
+ }
+
+ virtual void free(void* _ptr, size_t _align, const char* _file, uint32_t _line) BX_OVERRIDE
+ {
+ m_interface->vtbl->free(m_interface, _ptr, _align, _file, _line);
+ }
+
+ virtual void* realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line) BX_OVERRIDE
+ {
+ return m_interface->vtbl->realloc(m_interface, _ptr, _size, _align, _file, _line);
+ }
+
+ bgfx_reallocator_interface_t* m_interface;
+ };
+
+} // namespace bgfx
+
BGFX_C_API void bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _decl, bgfx_renderer_type_t _renderer)
{
bgfx::VertexDecl* decl = (bgfx::VertexDecl*)_decl;
@@ -3132,13 +3429,19 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type)
return bgfx::getRendererName(bgfx::RendererType::Enum(_type) );
}
-BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator)
+BGFX_C_API bool bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator)
{
+ static bgfx::CallbackC99 s_callback;
+ s_callback.m_interface = _callback;
+
+ static bgfx::AllocatorC99 s_allocator;
+ s_allocator.m_interface = _allocator;
+
return bgfx::init(bgfx::RendererType::Enum(_type)
, _vendorId
, _deviceId
- , reinterpret_cast<bgfx::CallbackI*>(_callback)
- , reinterpret_cast<bx::ReallocatorI*>(_allocator)
+ , NULL == _callback ? NULL : &s_callback
+ , NULL == _allocator ? NULL : &s_allocator
);
}
@@ -3172,6 +3475,11 @@ BGFX_C_API const bgfx_hmd_t* bgfx_get_hmd()
return (const bgfx_hmd_t*)bgfx::getHMD();
}
+BGFX_C_API const bgfx_stats_t* bgfx_get_stats()
+{
+ return (const bgfx_stats_t*)bgfx::getStats();
+}
+
BGFX_C_API const bgfx_memory_t* bgfx_alloc(uint32_t _size)
{
return (const bgfx_memory_t*)bgfx::alloc(_size);
@@ -3256,10 +3564,10 @@ BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_m
return handle.c;
}
-BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, const bgfx_memory_t* _mem)
+BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem)
{
union { bgfx_dynamic_index_buffer_handle_t c; bgfx::DynamicIndexBufferHandle cpp; } handle = { _handle };
- bgfx::updateDynamicIndexBuffer(handle.cpp, (const bgfx::Memory*)_mem);
+ bgfx::updateDynamicIndexBuffer(handle.cpp, _startIndex, (const bgfx::Memory*)_mem);
}
BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle)
@@ -3284,10 +3592,10 @@ BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer
return handle.c;
}
-BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, const bgfx_memory_t* _mem)
+BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem)
{
union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
- bgfx::updateDynamicVertexBuffer(handle.cpp, (const bgfx::Memory*)_mem);
+ bgfx::updateDynamicVertexBuffer(handle.cpp, _startVertex, (const bgfx::Memory*)_mem);
}
BGFX_C_API void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle)
@@ -3508,9 +3816,9 @@ BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle)
bgfx::destroyUniform(handle.cpp);
}
-BGFX_C_API void bgfx_set_clear_color(uint8_t _index, const float _rgba[4])
+BGFX_C_API void bgfx_set_palette_color(uint8_t _index, const float _rgba[4])
{
- bgfx::setClearColor(_index, _rgba);
+ bgfx::setPaletteColor(_index, _rgba);
}
BGFX_C_API void bgfx_set_view_name(uint8_t _id, const char* _name)
@@ -3559,6 +3867,11 @@ BGFX_C_API void bgfx_set_view_transform_stereo(uint8_t _id, const void* _view, c
bgfx::setViewTransform(_id, _view, _projL, _flags, _projR);
}
+BGFX_C_API void bgfx_set_view_remap(uint8_t _id, uint8_t _num, const void* _remap)
+{
+ bgfx::setViewRemap(_id, _num, _remap);
+}
+
BGFX_C_API void bgfx_set_marker(const char* _marker)
{
bgfx::setMarker(_marker);
@@ -3656,12 +3969,6 @@ BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_v
bgfx::setInstanceDataBuffer(handle.cpp, _startVertex, _num);
}
-BGFX_C_API void bgfx_set_program(bgfx_program_handle_t _handle)
-{
- union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
- bgfx::setProgram(handle.cpp);
-}
-
BGFX_C_API void bgfx_set_texture(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint32_t _flags)
{
union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
@@ -3676,15 +3983,22 @@ BGFX_C_API void bgfx_set_texture_from_frame_buffer(uint8_t _stage, bgfx_uniform_
bgfx::setTexture(_stage, sampler.cpp, handle.cpp, _attachment, _flags);
}
-BGFX_C_API uint32_t bgfx_submit(uint8_t _id, int32_t _depth)
+BGFX_C_API uint32_t bgfx_touch(uint8_t _id)
{
- return bgfx::submit(_id, _depth);
+ return bgfx::touch(_id);
}
-BGFX_C_API uint32_t bgfx_submit_indirect(uint8_t _id, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
+BGFX_C_API uint32_t bgfx_submit(uint8_t _id, bgfx_program_handle_t _handle, int32_t _depth)
{
+ union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
+ return bgfx::submit(_id, handle.cpp, _depth);
+}
+
+BGFX_C_API uint32_t bgfx_submit_indirect(uint8_t _id, bgfx_program_handle_t _handle, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
+{
+ union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle };
union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };
- return bgfx::submit(_id, indirectHandle.cpp, _start, _num, _depth);
+ return bgfx::submit(_id, handle.cpp, indirectHandle.cpp, _start, _num, _depth);
}
BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
diff --git a/3rdparty/bgfx/src/bgfx_compute.sh b/3rdparty/bgfx/src/bgfx_compute.sh
index eb405e45793..af8dd3e3242 100644
--- a/3rdparty/bgfx/src/bgfx_compute.sh
+++ b/3rdparty/bgfx/src/bgfx_compute.sh
@@ -57,6 +57,13 @@ vec2 unpackHalf2x16(uint _x)
#define IMAGE2D_RW( _name, _reg) RWTexture2D<float> _name : register(u[_reg])
#define UIMAGE2D_RW(_name, _reg) RWTexture2D<uint> _name : register(u[_reg])
+#define IMAGE3D_RO( _name, _format, _reg) Texture3D<_format> _name : register(t[_reg])
+#define UIMAGE3D_RO(_name, _format, _reg) Texture3D<_format> _name : register(t[_reg])
+#define IMAGE3D_WR( _name, _format, _reg) RWTexture3D<_format> _name : register(u[_reg])
+#define UIMAGE3D_WR(_name, _format, _reg) RWTexture3D<_format> _name : register(u[_reg])
+#define IMAGE3D_RW( _name, _reg) RWTexture3D<float> _name : register(u[_reg])
+#define UIMAGE3D_RW(_name, _reg) RWTexture3D<uint> _name : register(u[_reg])
+
#define BUFFER_RO(_name, _struct, _reg) Buffer<_struct> _name : register(t[_reg])
#define BUFFER_RW(_name, _struct, _reg) RWBuffer<_struct> _name : register(u[_reg])
#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg)
@@ -64,15 +71,12 @@ vec2 unpackHalf2x16(uint _x)
#define NUM_THREADS(_x, _y, _z) [numthreads(_x, _y, _z)]
#define __IMAGE_IMPL(_textureType, _storeComponents, _type, _loadComponents) \
- _type imageLoad(Texture2D<_textureType> _image, ivec2 _uv) \
- { \
- return _image[_uv]._loadComponents; \
- } \
- \
- void imageStore(RWTexture2D<_textureType> _image, ivec2 _uv, _type _value) \
- { \
- _image[_uv] = _value._storeComponents; \
- }
+ _type imageLoad( Texture2D<_textureType> _image, ivec2 _uv) { return _image[_uv ]._loadComponents; } \
+ _type imageLoad( Texture3D<_textureType> _image, ivec3 _uvw) { return _image[_uvw]._loadComponents; } \
+ _type imageLoad(RWTexture2D<_textureType> _image, ivec2 _uv) { return _image[_uv ]._loadComponents; } \
+ _type imageLoad(RWTexture3D<_textureType> _image, ivec3 _uvw, _type _value) { return _image[_uvw]._loadComponents; } \
+ void imageStore(RWTexture2D<_textureType> _image, ivec2 _uv, _type _value) { _image[_uv ] = _value._storeComponents; } \
+ void imageStore(RWTexture3D<_textureType> _image, ivec3 _uvw, _type _value) { _image[_uvw] = _value._storeComponents; }
__IMAGE_IMPL(float, x, vec4, xxxx)
__IMAGE_IMPL(vec2, xy, vec4, xyyy)
@@ -87,12 +91,6 @@ __IMAGE_IMPL(ivec2, xy, ivec4, xyyy)
__IMAGE_IMPL(ivec3, xyz, ivec4, xyzz)
__IMAGE_IMPL(ivec4, xyzw, ivec4, xyzw)
-uint4 imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
-{
- uint rr = _image[_uv.xy];
- return uint4(rr, rr, rr, rr);
-}
-
ivec2 imageSize(Texture2D _image)
{
ivec2 result;
@@ -180,6 +178,13 @@ uint atomicCompSwap(uint _mem, uint _compare, uint _data)
#define IMAGE2D_RW( _name, _reg) __IMAGE_XX(_name, r32f, _reg, image2D, readwrite)
#define UIMAGE2D_RW(_name, _reg) __IMAGE_XX(_name, r32ui, _reg, uimage2D, readwrite)
+#define IMAGE3D_RO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, readonly)
+#define UIMAGE3D_RO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, readonly)
+#define IMAGE3D_WR( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image3D, writeonly)
+#define UIMAGE3D_WR(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage3D, writeonly)
+#define IMAGE3D_RW( _name, _reg) __IMAGE_XX(_name, r32f, _reg, image2D, readwrite)
+#define UIMAGE3D_RW(_name, _reg) __IMAGE_XX(_name, r32ui, _reg, uimage2D, readwrite)
+
#define __BUFFER_XX(_name, _type, _reg, _access) \
layout(std430, binding=_reg) _access buffer _name ## Buffer \
{ \
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index 224100456e6..b7bbcf676b5 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -19,7 +19,7 @@
# define BX_CONFIG_ALLOCATOR_DEBUG 1
#endif // BGFX_CONFIG_DEBUG
-#include "bgfx.h"
+#include <bgfx/bgfx.h>
#include "config.h"
#include <inttypes.h>
@@ -52,17 +52,20 @@
namespace bgfx
{
#if BX_COMPILER_CLANG_ANALYZER
- void __attribute__((analyzer_noreturn)) fatal(Fatal::Enum _code, const char* _format, ...);
+ void __attribute__( (analyzer_noreturn) ) fatal(Fatal::Enum _code, const char* _format, ...);
#else
void fatal(Fatal::Enum _code, const char* _format, ...);
#endif // BX_COMPILER_CLANG_ANALYZER
+ void trace(const char* _filePath, uint16_t _line, const char* _format, ...);
+
+ void dbgPrintfVargs(const char* _format, va_list _argList);
void dbgPrintf(const char* _format, ...);
}
#define _BX_TRACE(_format, ...) \
BX_MACRO_BLOCK_BEGIN \
- bgfx::dbgPrintf(BX_FILE_LINE_LITERAL "BGFX " _format "\n", ##__VA_ARGS__); \
+ bgfx::trace(__FILE__, uint16_t(__LINE__), "BGFX " _format "\n", ##__VA_ARGS__); \
BX_MACRO_BLOCK_END
#define _BX_WARN(_condition, _format, ...) \
@@ -94,7 +97,6 @@ namespace bgfx
#include <bx/debug.h>
#include <bx/fpumath.h>
#include <bx/float4x4_t.h>
-#include <bx/blockalloc.h>
#include <bx/endian.h>
#include <bx/handlealloc.h>
#include <bx/hash.h>
@@ -106,13 +108,13 @@ namespace bgfx
#include <bx/string.h>
#include <bx/os.h>
-#include "bgfxplatform.h"
+#include <bgfx/bgfxplatform.h>
#include "image.h"
-#define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x1)
-#define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x3)
+#define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x2)
+#define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x4)
#define BGFX_CHUNK_MAGIC_TEX BX_MAKEFOURCC('T', 'E', 'X', 0x0)
-#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x3)
+#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x4)
#define BGFX_CLEAR_COLOR_USE_PALETTE UINT16_C(0x8000)
#define BGFX_CLEAR_MASK (0 \
@@ -137,11 +139,13 @@ namespace bgfx
# include <tinystl/string.h>
# include <tinystl/unordered_map.h>
# include <tinystl/unordered_set.h>
+# include <tinystl/vector.h>
namespace stl = tinystl;
#else
# include <string>
# include <unordered_map>
# include <unordered_set>
+# include <vector>
namespace stl
{
using namespace std;
@@ -174,6 +178,7 @@ namespace stl
#define BGFX_RENDERER_DIRECT3D9_NAME "Direct3D 9"
#define BGFX_RENDERER_DIRECT3D11_NAME "Direct3D 11"
#define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12"
+#define BGFX_RENDERER_METAL_NAME "Metal"
#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
#define BGFX_RENDERER_NULL_NAME "NULL"
@@ -309,6 +314,14 @@ namespace bgfx
return uint32_t( (_stencil >> (32*_0or1) ) );
}
+ inline bool needBorderColor(uint32_t _flags)
+ {
+ return BGFX_TEXTURE_U_BORDER == (_flags & BGFX_TEXTURE_U_BORDER)
+ || BGFX_TEXTURE_V_BORDER == (_flags & BGFX_TEXTURE_V_BORDER)
+ || BGFX_TEXTURE_W_BORDER == (_flags & BGFX_TEXTURE_W_BORDER)
+ ;
+ }
+
void dump(const VertexDecl& _decl);
struct TextVideoMem
@@ -853,21 +866,34 @@ namespace bgfx
#define CONSTANT_OPCODE_COPY_MASK UINT32_C(0x00000001)
#define BGFX_UNIFORM_FRAGMENTBIT UINT8_C(0x10)
+#define BGFX_UNIFORM_SAMPLERBIT UINT8_C(0x20)
+#define BGFX_UNIFORM_MASK (BGFX_UNIFORM_FRAGMENTBIT|BGFX_UNIFORM_SAMPLERBIT)
- class ConstantBuffer
+ class UniformBuffer
{
public:
- static ConstantBuffer* create(uint32_t _size)
+ static UniformBuffer* create(uint32_t _size = 1<<20)
{
- uint32_t size = BX_ALIGN_16(bx::uint32_max(_size, sizeof(ConstantBuffer) ) );
- void* data = BX_ALLOC(g_allocator, size);
- return ::new(data) ConstantBuffer(_size);
+ uint32_t size = BX_ALIGN_16(bx::uint32_max(_size, sizeof(UniformBuffer) ) );
+ void* data = BX_ALLOC(g_allocator, size);
+ return ::new(data) UniformBuffer(_size);
}
- static void destroy(ConstantBuffer* _constantBuffer)
+ static void destroy(UniformBuffer* _uniformBuffer)
{
- _constantBuffer->~ConstantBuffer();
- BX_FREE(g_allocator, _constantBuffer);
+ _uniformBuffer->~UniformBuffer();
+ BX_FREE(g_allocator, _uniformBuffer);
+ }
+
+ static void update(UniformBuffer*& _uniformBuffer, uint32_t _treshold = 64<<10, uint32_t _grow = 1<<20)
+ {
+ if (_treshold >= _uniformBuffer->m_size - _uniformBuffer->m_pos)
+ {
+ uint32_t size = BX_ALIGN_16(bx::uint32_max(_uniformBuffer->m_size + _grow, sizeof(UniformBuffer) ) );
+ void* data = BX_REALLOC(g_allocator, _uniformBuffer, size);
+ _uniformBuffer = reinterpret_cast<UniformBuffer*>(data);
+ _uniformBuffer->m_size = size;
+ }
}
static uint32_t encodeOpcode(UniformType::Enum _type, uint16_t _loc, uint16_t _num, uint16_t _copy)
@@ -949,14 +975,14 @@ namespace bgfx
void writeMarker(const char* _marker);
private:
- ConstantBuffer(uint32_t _size)
+ UniformBuffer(uint32_t _size)
: m_size(_size-sizeof(m_buffer) )
, m_pos(0)
{
finish();
}
- ~ConstantBuffer()
+ ~UniformBuffer()
{
}
@@ -965,12 +991,9 @@ namespace bgfx
char m_buffer[8];
};
- typedef const void* (*UniformFn)(const void* _data);
-
struct UniformInfo
{
const void* m_data;
- UniformFn m_func;
UniformHandle m_handle;
};
@@ -996,14 +1019,13 @@ namespace bgfx
return NULL;
}
- const UniformInfo& add(UniformHandle _handle, const char* _name, const void* _data, UniformFn _func = NULL)
+ const UniformInfo& add(UniformHandle _handle, const char* _name, const void* _data)
{
UniformHashMap::iterator it = m_uniforms.find(_name);
if (it == m_uniforms.end() )
{
UniformInfo info;
info.m_data = _data;
- info.m_func = _func;
info.m_handle = _handle;
stl::pair<UniformHashMap::iterator, bool> result = m_uniforms.insert(UniformHashMap::value_type(_name, info) );
@@ -1012,7 +1034,6 @@ namespace bgfx
UniformInfo& info = it->second;
info.m_data = _data;
- info.m_func = _func;
info.m_handle = _handle;
return info;
@@ -1085,7 +1106,10 @@ namespace bgfx
for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++ii)
{
- m_bind[ii].m_idx = invalidHandle;
+ Binding& bind = m_bind[ii];
+ bind.m_idx = invalidHandle;
+ bind.m_type = 0;
+ bind.m_un.m_draw.m_flags = 0;
}
}
@@ -1203,9 +1227,10 @@ namespace bgfx
BX_ALIGN_DECL_CACHE_LINE(struct) Frame
{
Frame()
- : m_hmdEnabled(false)
+ : m_uniformMax(0)
, m_waitSubmit(0)
, m_waitRender(0)
+ , m_hmdInitialized(false)
{
SortKey term;
term.reset();
@@ -1220,7 +1245,7 @@ namespace bgfx
void create()
{
- m_constantBuffer = ConstantBuffer::create(BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE);
+ m_uniformBuffer = UniformBuffer::create();
reset();
start();
m_textVideoMem = BX_NEW(g_allocator, TextVideoMem);
@@ -1228,7 +1253,7 @@ namespace bgfx
void destroy()
{
- ConstantBuffer::destroy(m_constantBuffer);
+ UniformBuffer::destroy(m_uniformBuffer);
BX_DELETE(g_allocator, m_textVideoMem);
}
@@ -1242,8 +1267,8 @@ namespace bgfx
void start()
{
m_flags = BGFX_STATE_NONE;
- m_constBegin = 0;
- m_constEnd = 0;
+ m_uniformBegin = 0;
+ m_uniformEnd = 0;
m_draw.clear();
m_compute.clear();
m_matrixCache.reset();
@@ -1256,7 +1281,7 @@ namespace bgfx
m_vboffset = 0;
m_cmdPre.start();
m_cmdPost.start();
- m_constantBuffer->reset();
+ m_uniformBuffer->reset();
m_discard = false;
}
@@ -1265,7 +1290,8 @@ namespace bgfx
m_cmdPre.finish();
m_cmdPost.finish();
- m_constantBuffer->finish();
+ m_uniformMax = bx::uint32_max(m_uniformMax, m_uniformBuffer->getPos() );
+ m_uniformBuffer->finish();
if (0 < m_numDropped)
{
@@ -1279,7 +1305,7 @@ namespace bgfx
void setMarker(const char* _name)
{
- m_constantBuffer->writeMarker(_name);
+ m_uniformBuffer->writeMarker(_name);
}
void setState(uint64_t _state, uint32_t _rgba)
@@ -1394,22 +1420,17 @@ namespace bgfx
m_draw.m_instanceDataBuffer = _handle;
}
- void setProgram(ProgramHandle _handle)
- {
- m_key.m_program = _handle.idx;
- }
-
void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags)
{
- Binding& sampler = m_draw.m_bind[_stage];
- sampler.m_idx = _handle.idx;
- sampler.m_un.m_draw.m_flags = (_flags&BGFX_SAMPLER_DEFAULT_FLAGS)
+ Binding& bind = m_draw.m_bind[_stage];
+ bind.m_idx = _handle.idx;
+ bind.m_type = uint8_t(Binding::Texture);
+ bind.m_un.m_draw.m_flags = (_flags&BGFX_SAMPLER_DEFAULT_FLAGS)
? BGFX_SAMPLER_DEFAULT_FLAGS
: _flags
;
- if (isValid(_sampler)
- && (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) ) )
+ if (isValid(_sampler) )
{
uint32_t stage = _stage;
setUniform(_sampler, &stage);
@@ -1445,8 +1466,7 @@ namespace bgfx
bind.m_un.m_compute.m_access = uint8_t(_access);
bind.m_un.m_compute.m_mip = _mip;
- if (isValid(_sampler)
- && (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) ) )
+ if (isValid(_sampler) )
{
uint32_t stage = _stage;
setUniform(_sampler, &stage);
@@ -1461,14 +1481,14 @@ namespace bgfx
m_flags = BGFX_STATE_NONE;
}
- uint32_t submit(uint8_t _id, int32_t _depth);
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, int32_t _depth);
- uint32_t submit(uint8_t _id, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
+ uint32_t submit(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth)
{
m_draw.m_startIndirect = _start;
m_draw.m_numIndirect = _num;
m_draw.m_indirectBuffer = _indirectHandle;
- return submit(_id, _depth);
+ return submit(_id, _handle, _depth);
}
uint32_t dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _ngx, uint16_t _ngy, uint16_t _ngz, uint8_t _flags);
@@ -1521,7 +1541,8 @@ namespace bgfx
void writeUniform(UniformType::Enum _type, UniformHandle _handle, const void* _value, uint16_t _num)
{
- m_constantBuffer->writeUniform(_type, _handle.idx, _value, _num);
+ UniformBuffer::update(m_uniformBuffer);
+ m_uniformBuffer->writeUniform(_type, _handle.idx, _value, _num);
}
void free(IndexBufferHandle _handle)
@@ -1589,7 +1610,7 @@ namespace bgfx
uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
- float m_clearColor[BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE][4];
+ float m_colorPalette[BGFX_CONFIG_MAX_COLOR_PALETTE][4];
Rect m_rect[BGFX_CONFIG_MAX_VIEWS];
Rect m_scissor[BGFX_CONFIG_MAX_VIEWS];
Matrix4 m_view[BGFX_CONFIG_MAX_VIEWS];
@@ -1602,10 +1623,11 @@ namespace bgfx
RenderDraw m_draw;
RenderCompute m_compute;
uint64_t m_flags;
- uint32_t m_constBegin;
- uint32_t m_constEnd;
+ uint32_t m_uniformBegin;
+ uint32_t m_uniformEnd;
+ uint32_t m_uniformMax;
- ConstantBuffer* m_constantBuffer;
+ UniformBuffer* m_uniformBuffer;
RenderItemCount m_num;
RenderItemCount m_numRenderItems;
@@ -1645,11 +1667,12 @@ namespace bgfx
UniformHandle m_freeUniformHandle[BGFX_CONFIG_MAX_UNIFORMS];
TextVideoMem* m_textVideoMem;
HMD m_hmd;
- bool m_hmdEnabled;
+ Stats m_perfStats;
int64_t m_waitSubmit;
int64_t m_waitRender;
+ bool m_hmdInitialized;
bool m_discard;
};
@@ -1887,7 +1910,7 @@ namespace bgfx
{
}
- void rendererUpdateUniforms(RendererContextI* _renderCtx, ConstantBuffer* _constantBuffer, uint32_t _begin, uint32_t _end);
+ void rendererUpdateUniforms(RendererContextI* _renderCtx, UniformBuffer* _uniformBuffer, uint32_t _begin, uint32_t _end);
#if BGFX_CONFIG_DEBUG
# define BGFX_API_FUNC(_func) BX_NO_INLINE _func
@@ -1902,7 +1925,7 @@ namespace bgfx
, m_submit(&m_frame[BGFX_CONFIG_MULTITHREADED ? 1 : 0])
, m_numFreeDynamicIndexBufferHandles(0)
, m_numFreeDynamicVertexBufferHandles(0)
- , m_clearColorDirty(0)
+ , m_colorPaletteDirty(0)
, m_instBufferCount(0)
, m_frames(0)
, m_debug(BGFX_DEBUG_NONE)
@@ -1927,7 +1950,7 @@ namespace bgfx
}
// game thread
- void init(RendererType::Enum _type);
+ bool init(RendererType::Enum _type);
void shutdown();
CommandBuffer& getCommandBuffer(CommandBuffer::Enum _cmd)
@@ -1987,7 +2010,7 @@ namespace bgfx
BGFX_API_FUNC(const HMD* getHMD() )
{
- if (m_submit->m_hmdEnabled)
+ if (m_submit->m_hmdInitialized)
{
return &m_submit->m_hmd;
}
@@ -1995,6 +2018,11 @@ namespace bgfx
return NULL;
}
+ BGFX_API_FUNC(const Stats* getPerfStats() )
+ {
+ return &m_submit->m_perfStats;
+ }
+
BGFX_API_FUNC(IndexBufferHandle createIndexBuffer(const Memory* _mem, uint16_t _flags) )
{
IndexBufferHandle handle = { m_indexBufferHandle.alloc() };
@@ -2086,7 +2114,7 @@ namespace bgfx
{
IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
BX_WARN(isValid(indexBufferHandle), "Failed to allocate index buffer handle.");
- if (!isValid(indexBufferHandle))
+ if (!isValid(indexBufferHandle) )
{
return ptr;
}
@@ -2113,7 +2141,7 @@ namespace bgfx
if (0 != (_flags & BGFX_BUFFER_COMPUTE_WRITE) )
{
IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
- if (!isValid(indexBufferHandle))
+ if (!isValid(indexBufferHandle) )
{
return handle;
}
@@ -2158,12 +2186,12 @@ namespace bgfx
DynamicIndexBufferHandle handle = createDynamicIndexBuffer(_mem->size/indexSize, _flags);
if (isValid(handle) )
{
- updateDynamicIndexBuffer(handle, _mem);
+ updateDynamicIndexBuffer(handle, 0, _mem);
}
return handle;
}
- BGFX_API_FUNC(void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem) )
+ BGFX_API_FUNC(void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem) )
{
BGFX_CHECK_HANDLE("updateDynamicIndexBuffer", m_dynamicIndexBufferHandle, _handle);
@@ -2184,8 +2212,8 @@ namespace bgfx
dib.m_startIndex = bx::strideAlign(dib.m_offset, indexSize)/indexSize;
}
- uint32_t offset = dib.m_startIndex*indexSize;
- uint32_t size = bx::uint32_min(dib.m_size, _mem->size);
+ uint32_t offset = (dib.m_startIndex + _startIndex)*indexSize;
+ uint32_t size = bx::uint32_min(bx::uint32_satsub(dib.m_size, _startIndex*indexSize), _mem->size);
BX_CHECK(_mem->size <= size, "Truncating dynamic index buffer update (size %d, mem size %d)."
, size
, _mem->size
@@ -2307,12 +2335,12 @@ namespace bgfx
DynamicVertexBufferHandle handle = createDynamicVertexBuffer(uint16_t(numVertices), _decl, _flags);
if (isValid(handle) )
{
- updateDynamicVertexBuffer(handle, _mem);
+ updateDynamicVertexBuffer(handle, 0, _mem);
}
return handle;
}
- BGFX_API_FUNC(void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, const Memory* _mem) )
+ BGFX_API_FUNC(void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem) )
{
BGFX_CHECK_HANDLE("updateDynamicVertexBuffer", m_dynamicVertexBufferHandle, _handle);
@@ -2332,8 +2360,8 @@ namespace bgfx
dvb.m_startVertex = bx::strideAlign(dvb.m_offset, dvb.m_stride)/dvb.m_stride;
}
- uint32_t offset = dvb.m_startVertex*dvb.m_stride;
- uint32_t size = bx::uint32_min(dvb.m_size, _mem->size);
+ uint32_t offset = (dvb.m_startVertex + _startVertex)*dvb.m_stride;
+ uint32_t size = bx::uint32_min(bx::uint32_satsub(dvb.m_size, _startVertex*dvb.m_stride), _mem->size);
BX_CHECK(_mem->size <= size, "Truncating dynamic vertex buffer update (size %d, mem size %d)."
, dvb.m_size
, _mem->size
@@ -2596,6 +2624,7 @@ namespace bgfx
sr.m_refCount = 1;
sr.m_hash = iohash;
sr.m_num = 0;
+ sr.m_owned = false;
sr.m_uniforms = NULL;
UniformHandle* uniforms = (UniformHandle*)alloca(count*sizeof(UniformHandle) );
@@ -2611,7 +2640,7 @@ namespace bgfx
uint8_t type;
bx::read(&reader, type);
- type &= ~BGFX_UNIFORM_FRAGMENTBIT;
+ type &= ~BGFX_UNIFORM_MASK;
uint8_t num;
bx::read(&reader, num);
@@ -2675,6 +2704,16 @@ namespace bgfx
shaderDecRef(_handle);
}
+ void shaderTakeOwnership(ShaderHandle _handle)
+ {
+ ShaderRef& sr = m_shaderRef[_handle.idx];
+ if (!sr.m_owned)
+ {
+ sr.m_owned = true;
+ shaderDecRef(_handle);
+ }
+ }
+
void shaderIncRef(ShaderHandle _handle)
{
ShaderRef& sr = m_shaderRef[_handle.idx];
@@ -2705,7 +2744,7 @@ namespace bgfx
}
}
- BGFX_API_FUNC(ProgramHandle createProgram(ShaderHandle _vsh, ShaderHandle _fsh) )
+ BGFX_API_FUNC(ProgramHandle createProgram(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders) )
{
if (!isValid(_vsh)
|| !isValid(_fsh) )
@@ -2715,6 +2754,15 @@ namespace bgfx
return invalid;
}
+ ProgramHashMap::const_iterator it = m_programHashMap.find(uint32_t(_fsh.idx<<16)|_vsh.idx);
+ if (it != m_programHashMap.end() )
+ {
+ ProgramHandle handle = it->second;
+ ProgramRef& pr = m_programRef[handle.idx];
+ ++pr.m_refCount;
+ return handle;
+ }
+
const ShaderRef& vsr = m_shaderRef[_vsh.idx];
const ShaderRef& fsr = m_shaderRef[_fsh.idx];
if (vsr.m_hash != fsr.m_hash)
@@ -2735,6 +2783,9 @@ namespace bgfx
ProgramRef& pr = m_programRef[handle.idx];
pr.m_vsh = _vsh;
pr.m_fsh = _fsh;
+ pr.m_refCount = 1;
+
+ m_programHashMap.insert(stl::make_pair(uint32_t(_fsh.idx<<16)|_vsh.idx, handle) );
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateProgram);
cmdbuf.write(handle);
@@ -2742,10 +2793,16 @@ namespace bgfx
cmdbuf.write(_fsh);
}
+ if (_destroyShaders)
+ {
+ shaderTakeOwnership(_vsh);
+ shaderTakeOwnership(_fsh);
+ }
+
return handle;
}
- BGFX_API_FUNC(ProgramHandle createProgram(ShaderHandle _vsh) )
+ BGFX_API_FUNC(ProgramHandle createProgram(ShaderHandle _vsh, bool _destroyShader) )
{
if (!isValid(_vsh) )
{
@@ -2754,6 +2811,15 @@ namespace bgfx
return invalid;
}
+ ProgramHashMap::const_iterator it = m_programHashMap.find(_vsh.idx);
+ if (it != m_programHashMap.end() )
+ {
+ ProgramHandle handle = it->second;
+ ProgramRef& pr = m_programRef[handle.idx];
+ ++pr.m_refCount;
+ return handle;
+ }
+
ProgramHandle handle;
handle.idx = m_programHandle.alloc();
@@ -2765,6 +2831,9 @@ namespace bgfx
pr.m_vsh = _vsh;
ShaderHandle fsh = BGFX_INVALID_HANDLE;
pr.m_fsh = fsh;
+ pr.m_refCount = 1;
+
+ m_programHashMap.insert(stl::make_pair(uint32_t(_vsh.idx), handle) );
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateProgram);
cmdbuf.write(handle);
@@ -2772,6 +2841,11 @@ namespace bgfx
cmdbuf.write(fsh);
}
+ if (_destroyShader)
+ {
+ shaderTakeOwnership(_vsh);
+ }
+
return handle;
}
@@ -2779,16 +2853,24 @@ namespace bgfx
{
BGFX_CHECK_HANDLE("destroyProgram", m_programHandle, _handle);
- CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyProgram);
- cmdbuf.write(_handle);
- m_submit->free(_handle);
+ ProgramRef& pr = m_programRef[_handle.idx];
+ int32_t refs = --pr.m_refCount;
+ if (0 == refs)
+ {
+ CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyProgram);
+ cmdbuf.write(_handle);
+ m_submit->free(_handle);
- const ProgramRef& pr = m_programRef[_handle.idx];
- shaderDecRef(pr.m_vsh);
+ shaderDecRef(pr.m_vsh);
+ uint32_t hash = pr.m_vsh.idx;
- if (isValid(pr.m_fsh) )
- {
- shaderDecRef(pr.m_fsh);
+ if (isValid(pr.m_fsh) )
+ {
+ shaderDecRef(pr.m_fsh);
+ hash |= pr.m_fsh.idx << 16;
+ }
+
+ m_programHashMap.erase(m_programHashMap.find(hash) );
}
}
@@ -2832,6 +2914,7 @@ namespace bgfx
ref.m_refCount = 1;
ref.m_bbRatio = uint8_t(_ratio);
ref.m_format = uint8_t(_info->format);
+ ref.m_owned = false;
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateTexture);
cmdbuf.write(handle);
@@ -2867,7 +2950,7 @@ namespace bgfx
, _handle.idx
, _width
, _height
- , getName(TextureFormat::Enum(textureRef.m_format) )
+ , bgfx::getName(TextureFormat::Enum(textureRef.m_format) )
);
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::ResizeTexture);
@@ -2876,6 +2959,16 @@ namespace bgfx
cmdbuf.write(_height);
}
+ void textureTakeOwnership(TextureHandle _handle)
+ {
+ TextureRef& ref = m_textureRef[_handle.idx];
+ if (!ref.m_owned)
+ {
+ ref.m_owned = true;
+ textureDecRef(_handle);
+ }
+ }
+
void textureIncRef(TextureHandle _handle)
{
TextureRef& ref = m_textureRef[_handle.idx];
@@ -2912,7 +3005,7 @@ namespace bgfx
cmdbuf.write(_mem);
}
- BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, TextureHandle* _handles) )
+ BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, TextureHandle* _handles, bool _destroyTextures) )
{
FrameBufferHandle handle = { m_frameBufferHandle.alloc() };
BX_WARN(isValid(handle), "Failed to allocate frame buffer handle.");
@@ -2942,6 +3035,14 @@ namespace bgfx
}
}
+ if (_destroyTextures)
+ {
+ for (uint32_t ii = 0; ii < _num; ++ii)
+ {
+ textureTakeOwnership(_handles[ii]);
+ }
+ }
+
return handle;
}
@@ -3086,14 +3187,14 @@ namespace bgfx
cmdbuf.write(_filePath, len);
}
- BGFX_API_FUNC(void setClearColor(uint8_t _index, const float _rgba[4]) )
+ BGFX_API_FUNC(void setPaletteColor(uint8_t _index, const float _rgba[4]) )
{
- BX_CHECK(_index < BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE, "Clear color palette index out of bounds %d (max: %d)."
+ BX_CHECK(_index < BGFX_CONFIG_MAX_COLOR_PALETTE, "Color palette index out of bounds %d (max: %d)."
, _index
- , BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
+ , BGFX_CONFIG_MAX_COLOR_PALETTE
);
memcpy(&m_clearColor[_index][0], _rgba, 16);
- m_clearColorDirty = 2;
+ m_colorPaletteDirty = 2;
}
BGFX_API_FUNC(void setViewName(uint8_t _id, const char* _name) )
@@ -3258,6 +3359,15 @@ namespace bgfx
BGFX_CHECK_HANDLE("setUniform", m_uniformHandle, _handle);
UniformRef& uniform = m_uniformRef[_handle.idx];
BX_CHECK(uniform.m_num >= _num, "Truncated uniform update. %d (max: %d)", _num, uniform.m_num);
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ BX_CHECK(m_uniformSet.end() == m_uniformSet.find(_handle.idx)
+ , "Uniform %d (%s) was already set for this draw call."
+ , _handle.idx
+ , getName(_handle)
+ );
+ m_uniformSet.insert(_handle.idx);
+ }
m_submit->writeUniform(uniform.m_type, _handle, _value, bx::uint16_min(uniform.m_num, _num) );
}
@@ -3275,6 +3385,7 @@ namespace bgfx
BGFX_API_FUNC(void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices) )
{
+ BGFX_CHECK_HANDLE("setIndexBuffer", m_indexBufferHandle, _tib->handle);
m_submit->setIndexBuffer(_tib, _firstIndex, _numIndices);
}
@@ -3292,6 +3403,7 @@ namespace bgfx
BGFX_API_FUNC(void setVertexBuffer(const TransientVertexBuffer* _tvb, uint32_t _startVertex, uint32_t _numVertices) )
{
+ BGFX_CHECK_HANDLE("setVertexBuffer", m_vertexBufferHandle, _tvb->handle);
m_submit->setVertexBuffer(_tvb, _startVertex, _numVertices);
}
@@ -3320,12 +3432,6 @@ namespace bgfx
);
}
- BGFX_API_FUNC(void setProgram(ProgramHandle _handle) )
- {
- BGFX_CHECK_HANDLE("setProgram", m_programHandle, _handle);
- m_submit->setProgram(_handle);
- }
-
BGFX_API_FUNC(void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags) )
{
BGFX_CHECK_HANDLE_INVALID_OK("setTexture/TextureHandle", m_textureHandle, _handle);
@@ -3348,15 +3454,25 @@ namespace bgfx
m_submit->setTexture(_stage, _sampler, textureHandle, _flags);
}
- BGFX_API_FUNC(uint32_t submit(uint8_t _id, int32_t _depth) )
+ BGFX_API_FUNC(uint32_t submit(uint8_t _id, ProgramHandle _handle, int32_t _depth) )
{
- return m_submit->submit(_id, _depth);
+ BGFX_CHECK_HANDLE_INVALID_OK("submit", m_programHandle, _handle);
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ m_uniformSet.clear();
+ }
+ return m_submit->submit(_id, _handle, _depth);
}
- BGFX_API_FUNC(uint32_t submit(uint8_t _id, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth) )
+ BGFX_API_FUNC(uint32_t submit(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, int32_t _depth) )
{
+ BGFX_CHECK_HANDLE_INVALID_OK("submit", m_programHandle, _handle);
BGFX_CHECK_HANDLE("submit", m_vertexBufferHandle, _indirectHandle);
- return m_submit->submit(_id, _indirectHandle, _start, _num, _depth);
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ m_uniformSet.clear();
+ }
+ return m_submit->submit(_id, _handle, _indirectHandle, _start, _num, _depth);
}
BGFX_API_FUNC(void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access) )
@@ -3418,16 +3534,28 @@ namespace bgfx
BGFX_API_FUNC(uint32_t dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags) )
{
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ m_uniformSet.clear();
+ }
return m_submit->dispatch(_id, _handle, _numX, _numY, _numZ, _flags);
}
BGFX_API_FUNC(uint32_t dispatch(uint8_t _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags) )
{
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ m_uniformSet.clear();
+ }
return m_submit->dispatch(_id, _handle, _indirectHandle, _start, _num, _flags);
}
BGFX_API_FUNC(void discard() )
{
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_UNIFORM) )
+ {
+ m_uniformSet.clear();
+ }
m_submit->discard();
}
@@ -3438,6 +3566,7 @@ namespace bgfx
void freeAllHandles(Frame* _frame);
void frameNoRenderWait();
void swap();
+ const char* getName(UniformHandle _handle) const;
// render thread
bool renderFrame();
@@ -3542,12 +3671,14 @@ namespace bgfx
uint32_t m_hash;
int16_t m_refCount;
uint16_t m_num;
+ bool m_owned;
};
struct ProgramRef
{
ShaderHandle m_vsh;
ShaderHandle m_fsh;
+ int16_t m_refCount;
};
struct UniformRef
@@ -3562,6 +3693,7 @@ namespace bgfx
int16_t m_refCount;
uint8_t m_bbRatio;
uint8_t m_format;
+ bool m_owned;
};
struct FrameBufferRef
@@ -3576,9 +3708,16 @@ namespace bgfx
typedef stl::unordered_map<stl::string, UniformHandle> UniformHashMap;
UniformHashMap m_uniformHashMap;
+ typedef stl::unordered_set<uint16_t> UniformSet;
+ UniformSet m_uniformSet;
UniformRef m_uniformRef[BGFX_CONFIG_MAX_UNIFORMS];
+
ShaderRef m_shaderRef[BGFX_CONFIG_MAX_SHADERS];
+
+ typedef stl::unordered_map<uint32_t, ProgramHandle> ProgramHashMap;
+ ProgramHashMap m_programHashMap;
ProgramRef m_programRef[BGFX_CONFIG_MAX_PROGRAMS];
+
TextureRef m_textureRef[BGFX_CONFIG_MAX_TEXTURES];
FrameBufferRef m_frameBufferRef[BGFX_CONFIG_MAX_FRAME_BUFFERS];
VertexDeclRef m_declRef;
@@ -3587,7 +3726,7 @@ namespace bgfx
FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
- float m_clearColor[BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE][4];
+ float m_clearColor[BGFX_CONFIG_MAX_COLOR_PALETTE][4];
Rect m_rect[BGFX_CONFIG_MAX_VIEWS];
Rect m_scissor[BGFX_CONFIG_MAX_VIEWS];
Matrix4 m_view[BGFX_CONFIG_MAX_VIEWS];
@@ -3596,7 +3735,7 @@ namespace bgfx
uint16_t m_seq[BGFX_CONFIG_MAX_VIEWS];
uint16_t m_seqMask[BGFX_CONFIG_MAX_VIEWS];
- uint8_t m_clearColorDirty;
+ uint8_t m_colorPaletteDirty;
Resolution m_resolution;
int32_t m_instBufferCount;
diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh
index c3d74bb9b6b..8b8948ce065 100644
--- a/3rdparty/bgfx/src/bgfx_shader.sh
+++ b/3rdparty/bgfx/src/bgfx_shader.sh
@@ -59,13 +59,13 @@ struct BgfxSampler2DShadow
float bgfxShadow2D(BgfxSampler2DShadow _sampler, vec3 _coord)
{
- return _sampler.m_texture.SampleCmp(_sampler.m_sampler, _coord.xy, _coord.z * 2.0 - 1.0);
+ return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z * 2.0 - 1.0);
}
float bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord)
{
vec3 coord = _coord.xyz * rcp(_coord.w);
- return _sampler.m_texture.SampleCmp(_sampler.m_sampler, coord.xy, coord.z * 2.0 - 1.0);
+ return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z * 2.0 - 1.0);
}
struct BgfxSampler3D
@@ -270,7 +270,7 @@ vec2 mod(vec2 _a, vec2 _b) { return _a - _b * floor(_a / _b); }
vec3 mod(vec3 _a, vec3 _b) { return _a - _b * floor(_a / _b); }
vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); }
-#elif BGFX_SHADER_LANGUAGE_GLSL
+#else
# define atan2(_x, _y) atan(_x, _y)
# define mul(_a, _b) ( (_a) * (_b) )
# define saturate(_x) clamp(_x, 0.0, 1.0)
@@ -301,7 +301,7 @@ float rcp(float _a) { return 1.0/_a; }
vec2 rcp(vec2 _a) { return vec2(1.0)/_a; }
vec3 rcp(vec3 _a) { return vec3(1.0)/_a; }
vec4 rcp(vec4 _a) { return vec4(1.0)/_a; }
-#endif // BGFX_SHADER_LANGUAGE_HLSL
+#endif // BGFX_SHADER_LANGUAGE_*
uniform vec4 u_viewRect;
uniform vec4 u_viewTexel;
@@ -314,7 +314,8 @@ uniform mat4 u_invViewProj;
uniform mat4 u_model[BGFX_CONFIG_MAX_BONES];
uniform mat4 u_modelView;
uniform mat4 u_modelViewProj;
-uniform float u_alphaRef;
+uniform vec4 u_alphaRef4;
+#define u_alphaRef u_alphaRef4.x
#endif // __cplusplus
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h
index 9323a1388c3..7ed64c04325 100644
--- a/3rdparty/bgfx/src/config.h
+++ b/3rdparty/bgfx/src/config.h
@@ -15,6 +15,7 @@
#if !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D11) \
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \
+ && !defined(BGFX_CONFIG_RENDERER_METAL) \
&& !defined(BGFX_CONFIG_RENDERER_OPENGL) \
&& !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
&& !defined(BGFX_CONFIG_RENDERER_VULKAN) \
@@ -22,24 +23,30 @@
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
- || (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS < 0x0602 /*_WIN32_WINNT_WIN8*/) \
+ || BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_XBOX360 \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
- || (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS >= 0x0601 /*_WIN32_WINNT_WIN7*/) \
+ || BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
# define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \
- || (BX_PLATFORM_WINDOWS && BX_PLATFORM_WINDOWS >= 0x0603 /*_WIN32_WINNT_WINBLUE*/) \
+ || BX_PLATFORM_WINDOWS \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D12
+# ifndef BGFX_CONFIG_RENDERER_METAL
+# define BGFX_CONFIG_RENDERER_METAL (0 \
+ || BX_PLATFORM_IOS \
+ ? 1 : 0)
+# endif // BGFX_CONFIG_RENDERER_METAL
+
# ifndef BGFX_CONFIG_RENDERER_OPENGL
# define BGFX_CONFIG_RENDERER_OPENGL (0 \
|| BX_PLATFORM_FREEBSD \
@@ -86,6 +93,10 @@
# define BGFX_CONFIG_RENDERER_DIRECT3D12 0
# endif // BGFX_CONFIG_RENDERER_DIRECT3D12
+# ifndef BGFX_CONFIG_RENDERER_METAL
+# define BGFX_CONFIG_RENDERER_METAL 0
+# endif // BGFX_CONFIG_RENDERER_METAL
+
# ifndef BGFX_CONFIG_RENDERER_OPENGL
# define BGFX_CONFIG_RENDERER_OPENGL 0
# endif // BGFX_CONFIG_RENDERER_OPENGL
@@ -147,6 +158,16 @@
# define BGFX_CONFIG_DEBUG_OBJECT_NAME BGFX_CONFIG_DEBUG
#endif // BGFX_CONFIG_DEBUG_OBJECT_NAME
+/// Enable Metal markers.
+#ifndef BGFX_CONFIG_DEBUG_MTL
+# define BGFX_CONFIG_DEBUG_MTL BGFX_CONFIG_DEBUG
+#endif // BGFX_CONFIG_DEBUG_MTL
+
+///
+#ifndef BGFX_CONFIG_DEBUG_UNIFORM
+# define BGFX_CONFIG_DEBUG_UNIFORM BGFX_CONFIG_DEBUG
+#endif // BGFX_CONFIG_DEBUG_UNIFORM
+
#ifndef BGFX_CONFIG_MULTITHREADED
# define BGFX_CONFIG_MULTITHREADED ( (!BGFX_CONFIG_RENDERER_NULL)&&(0 \
|| BX_PLATFORM_ANDROID \
@@ -241,7 +262,7 @@
#ifndef BGFX_CONFIG_MAX_UNIFORMS
# define BGFX_CONFIG_MAX_UNIFORMS 512
-#endif // BGFX_CONFIG_MAX_CONSTANTS
+#endif // BGFX_CONFIG_MAX_UNIFORMS
#ifndef BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE
# define BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE (64<<10)
@@ -255,16 +276,12 @@
# define BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
#endif // BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
-#ifndef BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE
-# define BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE (512<<10)
-#endif // BGFX_CONFIG_MAX_CONSTANT_BUFFER_SIZE
-
#ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
#endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
#ifndef BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
-# define BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE 16
+# define BGFX_CONFIG_MAX_COLOR_PALETTE 16
#endif // BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE
#define BGFX_CONFIG_DRAW_INDIRECT_STRIDE 32
diff --git a/3rdparty/bgfx/src/fs_clear0.bin.h b/3rdparty/bgfx/src/fs_clear0.bin.h
index d473f46c1a2..1bf0568ea59 100644
--- a/3rdparty/bgfx/src/fs_clear0.bin.h
+++ b/3rdparty/bgfx/src/fs_clear0.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear0_glsl[128] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x5a, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .Z...uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -11,8 +11,8 @@ static const uint8_t fs_clear0_glsl[128] =
};
static const uint8_t fs_clear0_dx9[204] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x01, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x01, // clear_color.....
0x00, 0xa8, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -27,8 +27,8 @@ static const uint8_t fs_clear0_dx9[204] =
};
static const uint8_t fs_clear0_dx11[259] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0xdc, 0x00, 0x44, 0x58, 0x42, 0x43, 0x97, 0x89, 0xd6, 0x18, 0xd7, 0x24, 0x4d, 0xea, 0xd1, // ...DXBC.....$M..
0xcc, 0xac, 0xc3, 0xb2, 0xf1, 0x52, 0x06, 0x01, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x03, // .....R..........
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -45,3 +45,34 @@ static const uint8_t fs_clear0_dx11[259] =
0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // . .........>....
0x00, 0x80, 0x00, // ...
};
+static const uint8_t fs_clear0_mtl[432] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // Color;.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, // xlatMtlShaderUn
+ 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // iform {. float4
+ 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // bgfx_clear_colo
+ 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, // r[8];.};.fragmen
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, // t xlatMtlShaderO
+ 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // utput xlatMtlMai
+ 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // n (xlatMtlShader
+ 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, // Input _mtl_i [[s
+ 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, // tage_in]], const
+ 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // ant xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // rUniform& _mtl_u
+ 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, // [[buffer(0)]]).
+ 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // {. xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // rOutput _mtl_o;.
+ 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // _mtl_o.gl_Frag
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, // Color = half4(_m
+ 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, // tl_u.bgfx_clear_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, // color[0]);. ret
+ 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // urn _mtl_o;.}...
+};
+
diff --git a/3rdparty/bgfx/src/fs_clear1.bin.h b/3rdparty/bgfx/src/fs_clear1.bin.h
index ccccdffbee0..2d00cc39f76 100644
--- a/3rdparty/bgfx/src/fs_clear1.bin.h
+++ b/3rdparty/bgfx/src/fs_clear1.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear1_glsl[170] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x84, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .....uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -14,8 +14,8 @@ static const uint8_t fs_clear1_glsl[170] =
};
static const uint8_t fs_clear1_dx9[216] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x02, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x02, // clear_color.....
0x00, 0xb4, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -31,8 +31,8 @@ static const uint8_t fs_clear1_dx9[216] =
};
static const uint8_t fs_clear1_dx11[319] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x18, 0x01, 0x44, 0x58, 0x42, 0x43, 0xe1, 0xf9, 0x8b, 0x7f, 0x06, 0xb6, 0xc7, 0x96, 0x4e, // ...DXBC........N
0x0b, 0xee, 0xe9, 0x51, 0x29, 0xfb, 0x5a, 0x01, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x03, // ...Q).Z.........
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -52,3 +52,40 @@ static const uint8_t fs_clear1_dx11[319] =
0x00, 0x00, 0x06, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // .... ......F. ..
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // .......>.......
};
+static const uint8_t fs_clear1_mtl[543] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, // or(1)]];.};.stru
+ 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // ct xlatMtlShader
+ 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // Uniform {. floa
+ 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, // t4 bgfx_clear_co
+ 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, // lor[8];.};.fragm
+ 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // ent xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // rOutput xlatMtlM
+ 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ain (xlatMtlShad
+ 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, // erInput _mtl_i [
+ 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, // [stage_in]], con
+ 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // stant xlatMtlSha
+ 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // derUniform& _mtl
+ 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // _u [[buffer(0)]]
+ 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // ).{. xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // derOutput _mtl_o
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_0 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[0]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_1 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[1]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear2.bin.h b/3rdparty/bgfx/src/fs_clear2.bin.h
index 664f83dcbb6..edb000cf9e1 100644
--- a/3rdparty/bgfx/src/fs_clear2.bin.h
+++ b/3rdparty/bgfx/src/fs_clear2.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear2_glsl[210] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0xac, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .....uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -17,8 +17,8 @@ static const uint8_t fs_clear2_glsl[210] =
};
static const uint8_t fs_clear2_dx9[228] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x03, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x03, // clear_color.....
0x00, 0xc0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -35,8 +35,8 @@ static const uint8_t fs_clear2_dx9[228] =
};
static const uint8_t fs_clear2_dx11[379] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x54, 0x01, 0x44, 0x58, 0x42, 0x43, 0x28, 0xea, 0x41, 0xd6, 0x8b, 0x20, 0x1f, 0x3c, 0x2c, // .T.DXBC(.A.. .<,
0x9b, 0xee, 0x43, 0x6d, 0x8a, 0xc1, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x03, // ..Cm.......T....
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -60,3 +60,46 @@ static const uint8_t fs_clear2_dx11[379] =
0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ......F. ......
0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // ...>.......
};
+static const uint8_t fs_clear2_mtl[639] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH.......p...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // [color(2)]];.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, // float4 bgfx_clea
+ 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // r_color[8];.};.f
+ 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // tl_o;. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x68, // l_FragData_0 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, // _clear_color[0])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_1 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[1]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_2 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x32, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[2]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear3.bin.h b/3rdparty/bgfx/src/fs_clear3.bin.h
index 75c196bc010..5ee88af06c6 100644
--- a/3rdparty/bgfx/src/fs_clear3.bin.h
+++ b/3rdparty/bgfx/src/fs_clear3.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear3_glsl[250] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0xd4, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .....uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -19,8 +19,8 @@ static const uint8_t fs_clear3_glsl[250] =
};
static const uint8_t fs_clear3_dx9[240] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x04, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x04, // clear_color.....
0x00, 0xcc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -37,8 +37,8 @@ static const uint8_t fs_clear3_dx9[240] =
};
static const uint8_t fs_clear3_dx11[439] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x90, 0x01, 0x44, 0x58, 0x42, 0x43, 0x12, 0x80, 0x92, 0xa3, 0x15, 0xef, 0x86, 0x85, 0x80, // ...DXBC.........
0xb7, 0x87, 0xf9, 0x1f, 0xb5, 0xa2, 0x4a, 0x01, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x03, // ......J.........
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -66,3 +66,52 @@ static const uint8_t fs_clear3_dx11[439] =
0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, // ...F. .........>
0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // .......
};
+static const uint8_t fs_clear3_mtl[735] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(2)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x33, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, // _3 [[color(3)]];
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // {. float4 bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, // clear_color[8];.
+ 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // };.fragment xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, // xlatMtlMain (xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, // tMtlShaderInput
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, // _mtl_i [[stage_i
+ 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, // n]], constant xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, // atMtlShaderUnifo
+ 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, // rm& _mtl_u [[buf
+ 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, // fer(0)]]).{. xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // t _mtl_o;. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, // _o.gl_FragData_0
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [0]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, // l_FragData_1 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, // _clear_color[1])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_2 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x32, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[2]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_3 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[3]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear4.bin.h b/3rdparty/bgfx/src/fs_clear4.bin.h
index a43d969d33c..fa99edb5d10 100644
--- a/3rdparty/bgfx/src/fs_clear4.bin.h
+++ b/3rdparty/bgfx/src/fs_clear4.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear4_glsl[290] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0xfc, 0x00, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .....uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -22,8 +22,8 @@ static const uint8_t fs_clear4_glsl[290] =
};
static const uint8_t fs_clear4_dx9[240] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x04, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x04, // clear_color.....
0x00, 0xcc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -40,8 +40,8 @@ static const uint8_t fs_clear4_dx9[240] =
};
static const uint8_t fs_clear4_dx11[499] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0xcc, 0x01, 0x44, 0x58, 0x42, 0x43, 0x0e, 0x7a, 0x23, 0x41, 0x2a, 0x54, 0xbd, 0xa3, 0x8b, // ...DXBC.z#A*T...
0x1e, 0xbd, 0x2e, 0x91, 0x6f, 0x8b, 0x29, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0x03, // ....o.).........
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -73,3 +73,58 @@ static const uint8_t fs_clear4_dx11[499] =
0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // . .........>....
0x00, 0x80, 0x00, // ...
};
+static const uint8_t fs_clear4_mtl[831] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH.......0...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(2)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x33, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, // _3 [[color(3)]];
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x34, // Data_4 [[color(4
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, // )]];.};.struct x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, // orm {. float4 b
+ 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, // gfx_clear_color[
+ 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, // 8];.};.fragment
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, // xlatMtlShaderOut
+ 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, // put xlatMtlMain
+ 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, // (xlatMtlShaderIn
+ 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, // put _mtl_i [[sta
+ 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, // ge_in]], constan
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, // t xlatMtlShaderU
+ 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, // niform& _mtl_u [
+ 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, // [buffer(0)]]).{.
+ 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, // xlatMtlShaderO
+ 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, // utput _mtl_o;.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_0 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // olor[0]);. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, // _o.gl_FragData_1
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [1]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, // l_FragData_2 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x32, 0x5d, 0x29, // _clear_color[2])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_3 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[3]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_4 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x34, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[4]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear5.bin.h b/3rdparty/bgfx/src/fs_clear5.bin.h
index 9eacd37a9a8..2e7bef75f1d 100644
--- a/3rdparty/bgfx/src/fs_clear5.bin.h
+++ b/3rdparty/bgfx/src/fs_clear5.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear5_glsl[330] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x24, 0x01, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .$...uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -24,8 +24,8 @@ static const uint8_t fs_clear5_glsl[330] =
};
static const uint8_t fs_clear5_dx9[240] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x04, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x04, // clear_color.....
0x00, 0xcc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -42,8 +42,8 @@ static const uint8_t fs_clear5_dx9[240] =
};
static const uint8_t fs_clear5_dx11[559] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x08, 0x02, 0x44, 0x58, 0x42, 0x43, 0x60, 0x35, 0x1a, 0x9f, 0xa4, 0xdc, 0x6a, 0x17, 0x97, // ...DXBC`5....j..
0x20, 0xbd, 0x81, 0xee, 0x84, 0xd9, 0xac, 0x01, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x03, // ...............
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x49, // ...,...`.......I
@@ -78,3 +78,64 @@ static const uint8_t fs_clear5_dx11[559] =
0x00, 0x00, 0x06, 0xf2, 0x20, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // .... ......F. ..
0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // .......>.......
};
+static const uint8_t fs_clear5_mtl[927] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(2)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x33, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, // _3 [[color(3)]];
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x34, // Data_4 [[color(4
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x35, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_5 [[col
+ 0x6f, 0x72, 0x28, 0x35, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, // or(5)]];.};.stru
+ 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, // ct xlatMtlShader
+ 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // Uniform {. floa
+ 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, // t4 bgfx_clear_co
+ 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, // lor[8];.};.fragm
+ 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // ent xlatMtlShade
+ 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // rOutput xlatMtlM
+ 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ain (xlatMtlShad
+ 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, // erInput _mtl_i [
+ 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, // [stage_in]], con
+ 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // stant xlatMtlSha
+ 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // derUniform& _mtl
+ 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // _u [[buffer(0)]]
+ 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // ).{. xlatMtlSha
+ 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // derOutput _mtl_o
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_0 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[0]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_1 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // olor[1]);. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, // _o.gl_FragData_2
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x32, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [2]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x68, // l_FragData_3 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x33, 0x5d, 0x29, // _clear_color[3])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_4 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x34, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[4]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_5 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x35, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[5]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear6.bin.h b/3rdparty/bgfx/src/fs_clear6.bin.h
index bc1f2b2ff2c..f0f22690883 100644
--- a/3rdparty/bgfx/src/fs_clear6.bin.h
+++ b/3rdparty/bgfx/src/fs_clear6.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear6_glsl[370] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x4c, 0x01, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .L...uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -27,8 +27,8 @@ static const uint8_t fs_clear6_glsl[370] =
};
static const uint8_t fs_clear6_dx9[240] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x04, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x04, // clear_color.....
0x00, 0xcc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -45,8 +45,8 @@ static const uint8_t fs_clear6_dx9[240] =
};
static const uint8_t fs_clear6_dx11[619] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x44, 0x02, 0x44, 0x58, 0x42, 0x43, 0x68, 0xe2, 0x88, 0x87, 0x2b, 0x8c, 0x92, 0xbc, 0x98, // .D.DXBCh...+....
0x11, 0xb6, 0x94, 0x5c, 0x76, 0x9a, 0x47, 0x01, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x03, // ....v.G....D....
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x49, // ...,...`...$...I
@@ -85,3 +85,70 @@ static const uint8_t fs_clear6_dx11[619] =
0x20, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ......F. ......
0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // ...>.......
};
+static const uint8_t fs_clear6_mtl[1023] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x75, 0x73, // FSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(2)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x33, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, // _3 [[color(3)]];
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x34, // Data_4 [[color(4
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x35, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_5 [[col
+ 0x6f, 0x72, 0x28, 0x35, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(5)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x36, 0x20, 0x5b, // gl_FragData_6 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x36, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // [color(6)]];.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, // aderUniform {.
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, // float4 bgfx_clea
+ 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // r_color[8];.};.f
+ 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS
+ 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat
+ 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl
+ 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl
+ 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]],
+ 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform&
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer(
+ 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt
+ 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // tl_o;. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x3d, 0x20, 0x68, // l_FragData_0 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x30, 0x5d, 0x29, // _clear_color[0])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_1 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[1]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_2 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x32, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // olor[2]);. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x33, // _o.gl_FragData_3
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [3]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x68, // l_FragData_4 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x34, 0x5d, 0x29, // _clear_color[4])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_5 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x35, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[5]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_6 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x36, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[6]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_clear7.bin.h b/3rdparty/bgfx/src/fs_clear7.bin.h
index 7c194f16b41..c36388a603d 100644
--- a/3rdparty/bgfx/src/fs_clear7.bin.h
+++ b/3rdparty/bgfx/src/fs_clear7.bin.h
@@ -1,7 +1,7 @@
static const uint8_t fs_clear7_glsl[410] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x07, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x02, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x74, 0x01, 0x00, 0x00, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // .t...uniform vec
0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, // 4 bgfx_clear_col
0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // or[8];.void main
@@ -29,8 +29,8 @@ static const uint8_t fs_clear7_glsl[410] =
};
static const uint8_t fs_clear7_dx9[240] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x04, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x04, // clear_color.....
0x00, 0xcc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x24, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, // .........$.CTAB.
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, // ...[............
0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, // .......T...0....
@@ -47,8 +47,8 @@ static const uint8_t fs_clear7_dx9[240] =
};
static const uint8_t fs_clear7_dx11[679] =
{
- 0x46, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
- 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x17, 0x08, 0x00, 0x00, 0x08, // clear_color.....
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x62, 0x67, 0x66, 0x78, 0x5f, // FSH........bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x08, 0x00, 0x00, 0x08, // clear_color.....
0x00, 0x80, 0x02, 0x44, 0x58, 0x42, 0x43, 0xe7, 0x1e, 0xec, 0x06, 0x0c, 0xd8, 0x43, 0x65, 0x9a, // ...DXBC......Ce.
0x6f, 0x6f, 0xc7, 0x6f, 0x21, 0xde, 0xa4, 0x01, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x03, // oo.o!...........
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x49, // ...,...`...<...I
@@ -91,3 +91,76 @@ static const uint8_t fs_clear7_dx11[679] =
0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, // ...F. .........>
0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, // .......
};
+static const uint8_t fs_clear7_mtl[1119] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x75, 0x73, // FSH.......P...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, // tlShaderOutput {
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // Data_0 [[color(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_1 [[col
+ 0x6f, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(1)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x5b, // gl_FragData_2 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(2)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x33, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x33, 0x29, 0x5d, 0x5d, 0x3b, // _3 [[color(3)]];
+ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // . half4 gl_Frag
+ 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x34, // Data_4 [[color(4
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, // )]];. half4 gl_
+ 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x35, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // FragData_5 [[col
+ 0x6f, 0x72, 0x28, 0x35, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // or(5)]];. half4
+ 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x36, 0x20, 0x5b, // gl_FragData_6 [
+ 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x36, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x68, // [color(6)]];. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // alf4 gl_FragData
+ 0x5f, 0x37, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x37, 0x29, 0x5d, 0x5d, 0x3b, // _7 [[color(7)]];
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // .};.struct xlatM
+ 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // tlShaderUniform
+ 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // {. float4 bgfx_
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x38, 0x5d, 0x3b, 0x0a, // clear_color[8];.
+ 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // };.fragment xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, // xlatMtlMain (xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, // tMtlShaderInput
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, // _mtl_i [[stage_i
+ 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, // n]], constant xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, // atMtlShaderUnifo
+ 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, // rm& _mtl_u [[buf
+ 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, // fer(0)]]).{. xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // t _mtl_o;. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x30, // _o.gl_FragData_0
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [0]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x68, // l_FragData_1 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x31, 0x5d, 0x29, // _clear_color[1])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_2 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x32, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[2]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_3 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // olor[3]);. _mtl
+ 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x34, // _o.gl_FragData_4
+ 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // = half4(_mtl_u.
+ 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // bgfx_clear_color
+ 0x5b, 0x34, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, // [4]);. _mtl_o.g
+ 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x68, // l_FragData_5 = h
+ 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, // alf4(_mtl_u.bgfx
+ 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x35, 0x5d, 0x29, // _clear_color[5])
+ 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ;. _mtl_o.gl_Fr
+ 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, // agData_6 = half4
+ 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, // (_mtl_u.bgfx_cle
+ 0x61, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x36, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ar_color[6]);.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // _mtl_o.gl_FragDa
+ 0x74, 0x61, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x34, 0x28, 0x5f, 0x6d, 0x74, // ta_7 = half4(_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, // l_u.bgfx_clear_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x5b, 0x37, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // olor[7]);. retu
+ 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // rn _mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/src/fs_debugfont.bin.h b/3rdparty/bgfx/src/fs_debugfont.bin.h
index fa08afc0167..43a477af362 100644
--- a/3rdparty/bgfx/src/fs_debugfont.bin.h
+++ b/3rdparty/bgfx/src/fs_debugfont.bin.h
@@ -1,6 +1,6 @@
static const uint8_t fs_debugfont_glsl[354] =
{
- 0x46, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH..."f...s_tex
+ 0x46, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH..."f...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x42, 0x01, 0x00, 0x00, 0x76, // Color......B...v
0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec
0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary
@@ -26,7 +26,7 @@ static const uint8_t fs_debugfont_glsl[354] =
};
static const uint8_t fs_debugfont_dx9[353] =
{
- 0x46, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..."f..T.....
+ 0x46, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x54, 0x01, 0x00, 0x03, 0xff, 0xff, // FSH..."f..T.....
0xfe, 0xff, 0x22, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, // ..".CTAB....S...
0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, // L...0...........
@@ -52,7 +52,7 @@ static const uint8_t fs_debugfont_dx9[353] =
};
static const uint8_t fs_debugfont_dx11[520] =
{
- 0x46, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0xf8, 0x01, 0x44, 0x58, 0x42, 0x43, // FSH..."f....DXBC
+ 0x46, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0xf8, 0x01, 0x44, 0x58, 0x42, 0x43, // FSH..."f....DXBC
0x5a, 0xd5, 0xe8, 0x3a, 0x43, 0x7d, 0xa8, 0x34, 0xa8, 0x0a, 0x2d, 0x0c, 0xa2, 0xce, 0x50, 0x4f, // Z..:C}.4..-...PO
0x01, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
0xb8, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x84, 0x00, 0x00, 0x00, // ........ISGN....
@@ -86,3 +86,55 @@ static const uint8_t fs_debugfont_dx11[520] =
0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F.......
0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // >.......
};
+static const uint8_t fs_debugfont_mtl[762] =
+{
+ 0x46, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0xeb, 0x02, 0x00, 0x00, 0x75, 0x73, // FSH..."f......us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 v_colo
+ 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, // r0;. float4 v_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, // olor1;. float2
+ 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // v_texcoord0;.};.
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // struct xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x68, // aderOutput {. h
+ 0x61, 0x6c, 0x66, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // alf4 gl_FragColo
+ 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, // r;.};.struct xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, // tMtlShaderUnifor
+ 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, // m {.};.fragment
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, // xlatMtlShaderOut
+ 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, // put xlatMtlMain
+ 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, // (xlatMtlShaderIn
+ 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, // put _mtl_i [[sta
+ 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, // ge_in]], constan
+ 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, // t xlatMtlShaderU
+ 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, // niform& _mtl_u [
+ 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x0a, 0x20, 0x20, 0x2c, // [buffer(0)]]. ,
+ 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, // texture2d<flo
+ 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, // at> s_texColor [
+ 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, // [texture(0)]], s
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, // ampler _mtlsmp_s
+ 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, // _texColor [[samp
+ 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, // ler(0)]]).{. xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, // t _mtl_o;. half
+ 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_1;. tm
+ 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x68, 0x61, 0x6c, 0x66, 0x34, // pvar_1 = ((half4
+ 0x29, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x63, // )mix (_mtl_i.v_c
+ 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, // olor1, _mtl_i.v_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x29, // color0, (float4)
+ 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // s_texColor.sampl
+ 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x73, 0x6d, 0x70, 0x5f, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // e(_mtlsmp_s_texC
+ 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x29, 0x28, 0x5f, // olor, (float2)(_
+ 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // mtl_i.v_texcoord
+ 0x30, 0x29, 0x29, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, // 0)).xxxx));. if
+ 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3c, 0x20, // ((tmpvar_1.w <
+ 0x28, 0x68, 0x61, 0x6c, 0x66, 0x29, 0x30, 0x2e, 0x30, 0x30, 0x33, 0x39, 0x32, 0x31, 0x35, 0x36, // (half)0.00392156
+ 0x39, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, // 9)) {. discar
+ 0x64, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x3b, 0x0a, 0x20, 0x20, // d_fragment();.
+ 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, // };. _mtl_o.gl_F
+ 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
+ 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, // r_1;. return _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tl_o;.}...
+};
+
diff --git a/3rdparty/bgfx/src/glcontext_eagl.h b/3rdparty/bgfx/src/glcontext_eagl.h
index 45ba0fbf3d0..fcc1088c9c2 100644
--- a/3rdparty/bgfx/src/glcontext_eagl.h
+++ b/3rdparty/bgfx/src/glcontext_eagl.h
@@ -23,7 +23,7 @@ namespace bgfx { namespace gl
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_eagl.mm b/3rdparty/bgfx/src/glcontext_eagl.mm
index 1f1c0880264..86c1967816c 100644
--- a/3rdparty/bgfx/src/glcontext_eagl.mm
+++ b/3rdparty/bgfx/src/glcontext_eagl.mm
@@ -15,8 +15,13 @@ namespace bgfx { namespace gl
# define GL_IMPORT(_optional, _proto, _func, _import) _proto _func = NULL
# include "glimports.h"
+ static void* s_opengles = NULL;
+
void GlContext::create(uint32_t _width, uint32_t _height)
{
+ s_opengles = bx::dlopen("/System/Library/Frameworks/OpenGLES.framework/OpenGLES");
+ BX_CHECK(NULL != s_opengles, "OpenGLES dynamic library is not found!");
+
BX_UNUSED(_width, _height);
CAEAGLLayer* layer = (CAEAGLLayer*)g_platformData.nwh;
layer.opaque = true;
@@ -59,6 +64,8 @@ namespace bgfx { namespace gl
, "glCheckFramebufferStatus failed 0x%08x"
, glCheckFramebufferStatus(GL_FRAMEBUFFER)
);
+
+ import();
}
void GlContext::destroy()
@@ -83,17 +90,63 @@ namespace bgfx { namespace gl
EAGLContext* context = (EAGLContext*)m_context;
[context release];
+
+ bx::dlclose(s_opengles);
}
void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags)
{
BX_UNUSED(_width, _height, _flags);
BX_TRACE("resize context");
+
+ if (0 != m_fbo)
+ {
+ GL_CHECK(glDeleteFramebuffers(1, &m_fbo) );
+ m_fbo = 0;
+ }
+
+ if (0 != m_colorRbo)
+ {
+ GL_CHECK(glDeleteRenderbuffers(1, &m_colorRbo) );
+ m_colorRbo = 0;
+ }
+
+ if (0 != m_depthStencilRbo)
+ {
+ GL_CHECK(glDeleteRenderbuffers(1, &m_depthStencilRbo) );
+ m_depthStencilRbo = 0;
+ }
+
+ GL_CHECK(glGenFramebuffers(1, &m_fbo) );
+ GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo) );
+
+ GL_CHECK(glGenRenderbuffers(1, &m_colorRbo) );
+ GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_colorRbo) );
+
+ [((EAGLContext*)m_context) renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)g_platformData.nwh];
+ GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_colorRbo) );
+
+ GLint width;
+ GLint height;
+ GL_CHECK(glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width) );
+ GL_CHECK(glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height) );
+ BX_TRACE("Screen size: %d x %d", width, height);
+
+ GL_CHECK(glGenRenderbuffers(1, &m_depthStencilRbo) );
+ GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_depthStencilRbo) );
+ GL_CHECK(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height) ); // from OES_packed_depth_stencil
+ GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRbo) );
+ GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRbo) );
+
+ BX_CHECK(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ , "glCheckFramebufferStatus failed 0x%08x"
+ , glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ );
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
- return false;
+ return 0;
}
SwapChainGL* GlContext::createSwapChain(void* /*_nwh*/)
@@ -121,6 +174,17 @@ namespace bgfx { namespace gl
void GlContext::import()
{
+ BX_TRACE("Import:");
+# define GL_EXTENSION(_optional, _proto, _func, _import) \
+ { \
+ if (_func == NULL) \
+ { \
+ _func = (_proto)bx::dlsym(s_opengles, #_import); \
+ BX_TRACE("%p " #_func " (" #_import ")", _func); \
+ } \
+ BGFX_FATAL(_optional || NULL != _func, Fatal::UnableToInitialize, "Failed to create OpenGLES context. EAGLGetProcAddress(\"%s\")", #_import); \
+ }
+# include "glimports.h"
}
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp
index 2850121e5e4..8e901486b91 100644
--- a/3rdparty/bgfx/src/glcontext_egl.cpp
+++ b/3rdparty/bgfx/src/glcontext_egl.cpp
@@ -310,10 +310,6 @@ EGL_IMPORT
eglSwapInterval(m_display, 0);
}
-# if BX_PLATFORM_EMSCRIPTEN
- emscripten_set_canvas_size(_width, _height);
-# endif // BX_PLATFORM_EMSCRIPTEN
-
import();
}
@@ -337,8 +333,6 @@ EGL_IMPORT
void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags)
{
- BX_UNUSED(_width, _height);
-
# if BX_PLATFORM_ANDROID
if (NULL != m_display)
{
@@ -346,7 +340,11 @@ EGL_IMPORT
eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry( (ANativeWindow*)g_platformData.nwh, _width, _height, format);
}
-# endif // BX_PLATFORM_ANDROID
+# elif BX_PLATFORM_EMSCRIPTEN
+ emscripten_set_canvas_size(_width, _height);
+# else
+ BX_UNUSED(_width, _height);
+# endif // BX_PLATFORM_*
if (NULL != m_display)
{
@@ -355,12 +353,15 @@ EGL_IMPORT
}
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
return BX_ENABLED(0
| BX_PLATFORM_LINUX
| BX_PLATFORM_WINDOWS
- );
+ )
+ ? BGFX_CAPS_SWAP_CHAIN
+ : 0
+ ;
}
SwapChainGL* GlContext::createSwapChain(void* _nwh)
diff --git a/3rdparty/bgfx/src/glcontext_egl.h b/3rdparty/bgfx/src/glcontext_egl.h
index c8eb2d5d07c..5c263c2a598 100644
--- a/3rdparty/bgfx/src/glcontext_egl.h
+++ b/3rdparty/bgfx/src/glcontext_egl.h
@@ -29,7 +29,7 @@ namespace bgfx { namespace gl
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp
index 270e14dbe07..547c7588687 100644
--- a/3rdparty/bgfx/src/glcontext_glx.cpp
+++ b/3rdparty/bgfx/src/glcontext_glx.cpp
@@ -244,9 +244,9 @@ namespace bgfx { namespace gl
}
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
- return true;
+ return BGFX_CAPS_SWAP_CHAIN;
}
SwapChainGL* GlContext::createSwapChain(void* _nwh)
diff --git a/3rdparty/bgfx/src/glcontext_glx.h b/3rdparty/bgfx/src/glcontext_glx.h
index a931356cbdd..c88ce56400f 100644
--- a/3rdparty/bgfx/src/glcontext_glx.h
+++ b/3rdparty/bgfx/src/glcontext_glx.h
@@ -28,7 +28,7 @@ namespace bgfx { namespace gl
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.h b/3rdparty/bgfx/src/glcontext_nsgl.h
index 666926db984..d7d9886bdde 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.h
+++ b/3rdparty/bgfx/src/glcontext_nsgl.h
@@ -23,7 +23,7 @@ namespace bgfx { namespace gl
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index d39f7da3bb0..68f6d92f8ca 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -101,7 +101,6 @@ namespace bgfx { namespace gl
NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat];
[pixelFormat release];
-// [glView setWantsBestResolutionOpenGLSurface:YES];
[nsWindow setContentView:glView];
NSOpenGLContext* glContext = [glView openGLContext];
@@ -135,6 +134,10 @@ namespace bgfx { namespace gl
{
BX_UNUSED(_width, _height);
+ bool hidpi = !!(_flags&BGFX_RESET_HIDPI);
+ NSOpenGLView* glView = (NSOpenGLView*)m_view;
+ [glView setWantsBestResolutionOpenGLSurface:hidpi];
+
bool vsync = !!(_flags&BGFX_RESET_VSYNC);
GLint interval = vsync ? 1 : 0;
NSOpenGLContext* glContext = (NSOpenGLContext*)m_context;
@@ -142,9 +145,14 @@ namespace bgfx { namespace gl
[glContext update];
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
- return false;
+ NSWindow* nsWindow = (NSWindow*)g_platformData.nwh;
+ uint64_t caps = 1.0f < [nsWindow backingScaleFactor]
+ ? BGFX_CAPS_HIDPI
+ : 0
+ ;
+ return caps;
}
SwapChainGL* GlContext::createSwapChain(void* _nwh)
@@ -176,6 +184,8 @@ namespace bgfx { namespace gl
{
if (NULL == _swapChain)
{
+ NSOpenGLContext* glContext = (NSOpenGLContext*)m_context;
+ [glContext makeCurrentContext];
}
else
{
diff --git a/3rdparty/bgfx/src/glcontext_ppapi.cpp b/3rdparty/bgfx/src/glcontext_ppapi.cpp
index f61244dbd38..fb17a11ff5c 100644
--- a/3rdparty/bgfx/src/glcontext_ppapi.cpp
+++ b/3rdparty/bgfx/src/glcontext_ppapi.cpp
@@ -6,7 +6,7 @@
#include "bgfx_p.h"
#if BX_PLATFORM_NACL && (BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_OPENGL)
-# include <bgfxplatform.h>
+# include <bgfx/bgfxplatform.h>
# include "renderer_gl.h"
namespace bgfx { namespace gl
@@ -153,9 +153,9 @@ namespace bgfx { namespace gl
s_ppapi.resize(_width, _height, _flags);
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
- return false;
+ return 0;
}
SwapChainGL* GlContext::createSwapChain(void* /*_nwh*/)
diff --git a/3rdparty/bgfx/src/glcontext_ppapi.h b/3rdparty/bgfx/src/glcontext_ppapi.h
index f54ea2bb5a8..b67f19dfbe2 100644
--- a/3rdparty/bgfx/src/glcontext_ppapi.h
+++ b/3rdparty/bgfx/src/glcontext_ppapi.h
@@ -27,7 +27,7 @@ namespace bgfx { namespace gl
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp
index ef7f570df8b..2105efda2f7 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.cpp
+++ b/3rdparty/bgfx/src/glcontext_wgl.cpp
@@ -296,9 +296,9 @@ namespace bgfx { namespace gl
}
}
- bool GlContext::isSwapChainSupported()
+ uint64_t GlContext::getCaps() const
{
- return true;
+ return BGFX_CAPS_SWAP_CHAIN;
}
SwapChainGL* GlContext::createSwapChain(void* _nwh)
diff --git a/3rdparty/bgfx/src/glcontext_wgl.h b/3rdparty/bgfx/src/glcontext_wgl.h
index 1948622b88e..4665951b717 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.h
+++ b/3rdparty/bgfx/src/glcontext_wgl.h
@@ -72,7 +72,7 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
- static bool isSwapChainSupported();
+ uint64_t getCaps() const;
SwapChainGL* createSwapChain(void* _nwh);
void destroySwapChain(SwapChainGL* _swapChain);
void swap(SwapChainGL* _swapChain = NULL);
diff --git a/3rdparty/bgfx/src/glimports.h b/3rdparty/bgfx/src/glimports.h
index d3cd99af083..42f966ece35 100644
--- a/3rdparty/bgfx/src/glimports.h
+++ b/3rdparty/bgfx/src/glimports.h
@@ -124,6 +124,8 @@ typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count,
typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
+typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params);
@@ -165,6 +167,7 @@ typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum targe
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
@@ -176,6 +179,7 @@ typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, G
typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat* param);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
@@ -198,6 +202,7 @@ typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLf
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
@@ -299,6 +304,8 @@ GL_IMPORT______(true, PFNGLGETDEBUGMESSAGELOGPROC, glGetDebugMes
GL_IMPORT______(false, PFNGLGETERRORPROC, glGetError);
GL_IMPORT______(false, PFNGLGETFLOATVPROC, glGetFloatv);
GL_IMPORT______(false, PFNGLGETINTEGERVPROC, glGetIntegerv);
+GL_IMPORT______(true, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ);
+GL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v);
GL_IMPORT______(true, PFNGLGETOBJECTLABELPROC, glGetObjectLabel);
GL_IMPORT______(true, PFNGLGETOBJECTPTRLABELPROC, glGetObjectPtrLabel);
GL_IMPORT______(true, PFNGLGETPOINTERVPROC, glGetPointerv);
@@ -320,7 +327,9 @@ GL_IMPORT______(false, PFNGLGETSHADERIVPROC, glGetShaderiv
GL_IMPORT______(false, PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog);
GL_IMPORT______(false, PFNGLGETSTRINGPROC, glGetString);
GL_IMPORT______(false, PFNGLGETUNIFORMLOCATIONPROC, glGetUniformLocation);
+#if BGFX_CONFIG_RENDERER_OPENGL || !(BGFX_CONFIG_RENDERER_OPENGLES < 30)
GL_IMPORT______(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);
+#endif // !(BGFX_CONFIG_RENDERER_OPENGLES < 30)
GL_IMPORT______(false, PFNGLLINKPROGRAMPROC, glLinkProgram);
GL_IMPORT______(true, PFNGLMEMORYBARRIERPROC, glMemoryBarrier);
GL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);
@@ -339,6 +348,7 @@ GL_IMPORT______(true, PFNGLRENDERBUFFERSTORAGEPROC, glRenderbuffe
GL_IMPORT______(true, PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample);
GL_IMPORT______(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);
GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);
+GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);
GL_IMPORT______(false, PFNGLSCISSORPROC, glScissor);
GL_IMPORT______(false, PFNGLSHADERSOURCEPROC, glShaderSource);
GL_IMPORT______(false, PFNGLSTENCILFUNCPROC, glStencilFunc);
@@ -352,6 +362,7 @@ GL_IMPORT______(true, PFNGLTEXIMAGE3DPROC, glTexImage3D)
GL_IMPORT______(false, PFNGLTEXPARAMETERIPROC, glTexParameteri);
GL_IMPORT______(false, PFNGLTEXPARAMETERIVPROC, glTexParameteriv);
GL_IMPORT______(false, PFNGLTEXPARAMETERFPROC, glTexParameterf);
+GL_IMPORT______(false, PFNGLTEXPARAMETERFVPROC, glTexParameterfv);
GL_IMPORT______(true, PFNGLTEXSTORAGE2DPROC, glTexStorage2D);
GL_IMPORT______(true, PFNGLTEXSTORAGE3DPROC, glTexStorage3D);
GL_IMPORT______(false, PFNGLTEXSUBIMAGE2DPROC, glTexSubImage2D);
@@ -368,6 +379,7 @@ GL_IMPORT______(false, PFNGLUNIFORMMATRIX4FVPROC, glUniformMatr
GL_IMPORT______(false, PFNGLUSEPROGRAMPROC, glUseProgram);
GL_IMPORT______(true, PFNGLVERTEXATTRIBDIVISORPROC, glVertexAttribDivisor);
GL_IMPORT______(false, PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer);
+GL_IMPORT______(true, PFNGLVERTEXATTRIBIPOINTERPROC, glVertexAttribIPointer);
GL_IMPORT______(false, PFNGLVERTEXATTRIB1FPROC, glVertexAttrib1f);
GL_IMPORT______(false, PFNGLVERTEXATTRIB2FPROC, glVertexAttrib2f);
GL_IMPORT______(false, PFNGLVERTEXATTRIB3FPROC, glVertexAttrib3f);
@@ -425,6 +437,10 @@ GL_IMPORT______(false, PFNGLCLEARDEPTHFPROC, glClearDepthf
GL_IMPORT______(true, PFNGLINSERTEVENTMARKEREXTPROC, glInsertEventMarker);
GL_IMPORT______(true, PFNGLPUSHGROUPMARKEREXTPROC, glPushGroupMarker);
GL_IMPORT______(true, PFNGLPOPGROUPMARKEREXTPROC, glPopGroupMarker);
+#else
+GL_IMPORT______(true, PFNGLVERTEXATTRIBIPOINTERPROC, glVertexAttribIPointer);
+GL_IMPORT______(true, PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ);
+GL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternalformati64v);
#endif // BGFX_USE_GL_DYNAMIC_LIB
GL_IMPORT______(true, PFNGLSTRINGMARKERGREMEDYPROC, glStringMarkerGREMEDY);
@@ -484,6 +500,7 @@ GL_IMPORT_____x(true, PFNGLDELETESAMPLERSPROC, glDeleteSampl
GL_IMPORT_____x(true, PFNGLBINDSAMPLERPROC, glBindSampler);
GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);
GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);
+GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);
GL_IMPORT_____x(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);
GL_IMPORT_____x(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);
@@ -503,6 +520,7 @@ GL_IMPORT_NV___(true, PFNGLGENQUERIESPROC, glGenQueries)
GL_IMPORT_NV___(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);
GL_IMPORT_NV___(true, PFNGLBEGINQUERYPROC, glBeginQuery);
GL_IMPORT_NV___(true, PFNGLENDQUERYPROC, glEndQuery);
+GL_IMPORT_NV___(true, PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);
GL_IMPORT_NV___(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v);
GL_IMPORT (true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer, glDiscardFramebufferEXT);
@@ -546,6 +564,7 @@ GL_IMPORT______(true, PFNGLDELETESAMPLERSPROC, glDeleteSampl
GL_IMPORT______(true, PFNGLBINDSAMPLERPROC, glBindSampler);
GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);
GL_IMPORT______(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);
+GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);
GL_IMPORT______(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);
GL_IMPORT______(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);
@@ -565,6 +584,7 @@ GL_IMPORT______(true, PFNGLGENQUERIESPROC, glGenQueries)
GL_IMPORT______(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);
GL_IMPORT______(true, PFNGLBEGINQUERYPROC, glBeginQuery);
GL_IMPORT______(true, PFNGLENDQUERYPROC, glEndQuery);
+GL_IMPORT______(true, PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);
GL_IMPORT______(true, PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v);
GL_IMPORT______(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysIndirect);
diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp
index b9fbeedd8d5..8a9ea639336 100644
--- a/3rdparty/bgfx/src/image.cpp
+++ b/3rdparty/bgfx/src/image.cpp
@@ -12,62 +12,88 @@ namespace bgfx
{
static const ImageBlockInfo s_imageBlockInfo[] =
{
- // +------------------ bits per pixel
- // | +--------------- block width
- // | | +------------ block height
- // | | | +-------- block size
- // | | | | +----- min blocks x
- // | | | | | +-- min blocks y
- // | | | | | |
- { 4, 4, 4, 8, 1, 1, 0, 0 }, // BC1
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC2
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC3
- { 4, 4, 4, 8, 1, 1, 0, 0 }, // BC4
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC5
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC6H
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // BC7
- { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC1
- { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2
- { 8, 4, 4, 16, 1, 1, 0, 0 }, // ETC2A
- { 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2A1
- { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12
- { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14
- { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12A
- { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14A
- { 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC22
- { 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC24
- { 0, 0, 0, 0, 1, 1, 0, 0 }, // Unknown
- { 1, 8, 1, 1, 1, 1, 0, 0 }, // R1
- { 8, 1, 1, 1, 1, 1, 0, 0 }, // R8
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // R16
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // R16F
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // R32
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // R32F
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // RG8
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16F
- { 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32
- { 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32F
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // BGRA8
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // RGBA8
- { 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16
- { 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16F
- { 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32
- { 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32F
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // R5G6B5
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // RGBA4
- { 16, 1, 1, 2, 1, 1, 0, 0 }, // RGB5A1
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // RGB10A2
- { 32, 1, 1, 4, 1, 1, 0, 0 }, // R11G11B10F
- { 0, 0, 0, 0, 1, 1, 0, 0 }, // UnknownDepth
- { 16, 1, 1, 2, 1, 1, 16, 0 }, // D16
- { 24, 1, 1, 3, 1, 1, 24, 0 }, // D24
- { 32, 1, 1, 4, 1, 1, 24, 8 }, // D24S8
- { 32, 1, 1, 4, 1, 1, 32, 0 }, // D32
- { 16, 1, 1, 2, 1, 1, 16, 0 }, // D16F
- { 24, 1, 1, 3, 1, 1, 24, 0 }, // D24F
- { 32, 1, 1, 4, 1, 1, 32, 0 }, // D32F
- { 8, 1, 1, 1, 1, 1, 0, 8 }, // D0S8
+ // +------------------------------- bits per pixel
+ // | +---------------------------- block width
+ // | | +------------------------- block height
+ // | | | +--------------------- block size
+ // | | | | +------------------ min blocks x
+ // | | | | | +--------------- min blocks y
+ // | | | | | | +----------- depth bits
+ // | | | | | | | +-------- stencil bits
+ // | | | | | | | | +----- encoding type
+ // | | | | | | | | |
+ { 4, 4, 4, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC1
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC2
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC3
+ { 4, 4, 4, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC4
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC5
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC6H
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BC7
+ { 4, 4, 4, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // ETC1
+ { 4, 4, 4, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // ETC2
+ { 8, 4, 4, 16, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // ETC2A
+ { 4, 4, 4, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // ETC2A1
+ { 2, 8, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC12
+ { 4, 4, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC14
+ { 2, 8, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC12A
+ { 4, 4, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC14A
+ { 2, 8, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC22
+ { 4, 4, 4, 8, 2, 2, 0, 0, uint8_t(EncodingType::Unorm) }, // PTC24
+ { 0, 0, 0, 0, 0, 0, 0, 0, uint8_t(EncodingType::Count) }, // Unknown
+ { 1, 8, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // R1
+ { 8, 1, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // A8
+ { 8, 1, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // R8
+ { 8, 1, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // R8I
+ { 8, 1, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // R8U
+ { 8, 1, 1, 1, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // R8S
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // R16
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // R16I
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // R16U
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // R16F
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // R16S
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // R32I
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // R32U
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // R32F
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RG8
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RG8I
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RG8U
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // RG8S
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RG16
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RG16I
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RG16U
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // RG16F
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // RG16S
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RG32I
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RG32U
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // RG32F
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // RGB9E5F
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // BGRA8
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RGBA8
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RGBA8I
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RGBA8U
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // RGBA8S
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RGBA16
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RGBA16I
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RGBA16U
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // RGBA16F
+ { 64, 1, 1, 8, 1, 1, 0, 0, uint8_t(EncodingType::Snorm) }, // RGBA16S
+ { 128, 1, 1, 16, 1, 1, 0, 0, uint8_t(EncodingType::Int ) }, // RGBA32I
+ { 128, 1, 1, 16, 1, 1, 0, 0, uint8_t(EncodingType::Uint ) }, // RGBA32U
+ { 128, 1, 1, 16, 1, 1, 0, 0, uint8_t(EncodingType::Float) }, // RGBA32F
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // R5G6B5
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RGBA4
+ { 16, 1, 1, 2, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RGB5A1
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // RGB10A2
+ { 32, 1, 1, 4, 1, 1, 0, 0, uint8_t(EncodingType::Unorm) }, // R11G11B10F
+ { 0, 0, 0, 0, 0, 0, 0, 0, uint8_t(EncodingType::Count) }, // UnknownDepth
+ { 16, 1, 1, 2, 1, 1, 16, 0, uint8_t(EncodingType::Unorm) }, // D16
+ { 24, 1, 1, 3, 1, 1, 24, 0, uint8_t(EncodingType::Unorm) }, // D24
+ { 32, 1, 1, 4, 1, 1, 24, 8, uint8_t(EncodingType::Unorm) }, // D24S8
+ { 32, 1, 1, 4, 1, 1, 32, 0, uint8_t(EncodingType::Unorm) }, // D32
+ { 16, 1, 1, 2, 1, 1, 16, 0, uint8_t(EncodingType::Unorm) }, // D16F
+ { 24, 1, 1, 3, 1, 1, 24, 0, uint8_t(EncodingType::Unorm) }, // D24F
+ { 32, 1, 1, 4, 1, 1, 32, 0, uint8_t(EncodingType::Unorm) }, // D32F
+ { 8, 1, 1, 1, 1, 1, 0, 8, uint8_t(EncodingType::Unorm) }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) );
@@ -92,21 +118,44 @@ namespace bgfx
"PTC24", // PTC24
"<unknown>", // Unknown
"R1", // R1
+ "A8", // A8
"R8", // R8
+ "R8I", // R8I
+ "R8U", // R8U
+ "R8S", // R8S
"R16", // R16
+ "R16I", // R16I
+ "R16U", // R16U
"R16F", // R16F
- "R32", // R32
+ "R16S", // R16S
+ "R32I", // R32I
+ "R32U", // R32U
"R32F", // R32F
"RG8", // RG8
+ "RG8I", // RG8I
+ "RG8U", // RG8U
+ "RG8S", // RG8S
"RG16", // RG16
+ "RG16I", // RG16I
+ "RG16U", // RG16U
"RG16F", // RG16F
- "RG32", // RG32
+ "RG16S", // RG16S
+ "RG32I", // RG32I
+ "RG32U", // RG32U
"RG32F", // RG32F
+ "RGB9E5", // RGB9E5F
"BGRA8", // BGRA8
"RGBA8", // RGBA8
+ "RGBA8I", // RGBA8I
+ "RGBA8U", // RGBA8U
+ "RGBA8S", // RGBA8S
"RGBA16", // RGBA16
+ "RGBA16I", // RGBA16I
+ "RGBA16U", // RGBA16U
"RGBA16F", // RGBA16F
- "RGBA32", // RGBA32
+ "RGBA16S", // RGBA16S
+ "RGBA32I", // RGBA32I
+ "RGBA32U", // RGBA32U
"RGBA32F", // RGBA32F
"R5G6B5", // R5G6B5
"RGBA4", // RGBA4
@@ -382,19 +431,24 @@ namespace bgfx
}
}
- void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst)
+ void imageCopy(uint32_t _height, uint32_t _srcPitch, const void* _src, uint32_t _dstPitch, void* _dst)
{
- const uint32_t pitch = _width*_bpp/8;
- const uint8_t* src = (uint8_t*) _src;
- const uint8_t* next = src + _srcPitch;
+ const uint32_t pitch = bx::uint32_min(_srcPitch, _dstPitch);
+ const uint8_t* src = (uint8_t*)_src;
uint8_t* dst = (uint8_t*)_dst;
- for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _srcPitch, dst += pitch)
+ for (uint32_t yy = 0; yy < _height; ++yy, src += _srcPitch, dst += _dstPitch)
{
memcpy(dst, src, pitch);
}
}
+ void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst)
+ {
+ const uint32_t dstPitch = _width*_bpp/8;
+ imageCopy(_height, _srcPitch, _src, dstPitch, _dst);
+ }
+
void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip)
{
uint8_t type = _grayscale ? 3 : 2;
@@ -1381,12 +1435,12 @@ namespace bgfx
{ DDS_FORMAT_R8_UNORM, TextureFormat::R8, false },
{ DDS_FORMAT_R16_UNORM, TextureFormat::R16, false },
{ DDS_FORMAT_R16_FLOAT, TextureFormat::R16F, false },
- { DDS_FORMAT_R32_UINT, TextureFormat::R32, false },
+ { DDS_FORMAT_R32_UINT, TextureFormat::R32U, false },
{ DDS_FORMAT_R32_FLOAT, TextureFormat::R32F, false },
{ DDS_FORMAT_R8G8_UNORM, TextureFormat::RG8, false },
{ DDS_FORMAT_R16G16_UNORM, TextureFormat::RG16, false },
{ DDS_FORMAT_R16G16_FLOAT, TextureFormat::RG16F, false },
- { DDS_FORMAT_R32G32_UINT, TextureFormat::RG32, false },
+ { DDS_FORMAT_R32G32_UINT, TextureFormat::RG32U, false },
{ DDS_FORMAT_R32G32_FLOAT, TextureFormat::RG32F, false },
{ DDS_FORMAT_B8G8R8A8_UNORM, TextureFormat::BGRA8, false },
{ DDS_FORMAT_B8G8R8A8_UNORM_SRGB, TextureFormat::BGRA8, true },
@@ -1394,7 +1448,7 @@ namespace bgfx
{ DDS_FORMAT_R8G8B8A8_UNORM_SRGB, TextureFormat::RGBA8, true },
{ DDS_FORMAT_R16G16B16A16_UNORM, TextureFormat::RGBA16, false },
{ DDS_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F, false },
- { DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32, false },
+ { DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32U, false },
{ DDS_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F, false },
{ DDS_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5, false },
{ DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4, false },
@@ -1413,7 +1467,7 @@ namespace bgfx
static TranslateDdsPixelFormat s_translateDdsPixelFormat[] =
{
{ 8, { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R8 },
- { 16, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16 },
+ { 16, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16U },
{ 16, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::RGBA4 },
{ 16, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 },
{ 16, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 },
@@ -1421,7 +1475,7 @@ namespace bgfx
{ 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 },
{ 32, { 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, TextureFormat::RGB10A2 },
{ 32, { 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, TextureFormat::RG16 },
- { 32, { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R32 },
+ { 32, { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R32U },
};
bool imageParseDds(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader)
@@ -1508,7 +1562,7 @@ namespace bgfx
{
if ( (caps[1] & DDS_CUBEMAP_ALLFACES) != DDS_CUBEMAP_ALLFACES)
{
- // parital cube map is not supported.
+ // partial cube map is not supported.
return false;
}
}
@@ -1653,17 +1707,17 @@ namespace bgfx
{ KTX_R8, TextureFormat::R8 },
{ KTX_RGBA16, TextureFormat::RGBA16 },
{ KTX_RGBA16F, TextureFormat::RGBA16F },
- { KTX_R32UI, TextureFormat::R32 },
+ { KTX_R32UI, TextureFormat::R32U },
{ KTX_R32F, TextureFormat::R32F },
{ KTX_RG8, TextureFormat::RG8 },
{ KTX_RG16, TextureFormat::RG16 },
{ KTX_RG16F, TextureFormat::RG16F },
- { KTX_RG32UI, TextureFormat::RG32 },
+ { KTX_RG32UI, TextureFormat::RG32U },
{ KTX_RG32F, TextureFormat::RG32F },
{ KTX_BGRA, TextureFormat::BGRA8 },
{ KTX_RGBA16, TextureFormat::RGBA16 },
{ KTX_RGBA16F, TextureFormat::RGBA16F },
- { KTX_RGBA32UI, TextureFormat::RGBA32 },
+ { KTX_RGBA32UI, TextureFormat::RGBA32U },
{ KTX_RGBA32F, TextureFormat::RGBA32F },
{ KTX_RGB565, TextureFormat::R5G6B5 },
{ KTX_RGBA4, TextureFormat::RGBA4 },
@@ -1813,9 +1867,9 @@ namespace bgfx
{ PVR3_BC4, PVR3_CHANNEL_TYPE_ANY, TextureFormat::BC4 },
{ PVR3_BC5, PVR3_CHANNEL_TYPE_ANY, TextureFormat::BC5 },
{ PVR3_R8, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R8 },
- { PVR3_R16, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R16 },
+ { PVR3_R16, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R16U },
{ PVR3_R16, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::R16F },
- { PVR3_R32, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R32 },
+ { PVR3_R32, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R32U },
{ PVR3_R32, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::R32F },
{ PVR3_RG8, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RG8 },
{ PVR3_RG16, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RG16 },
@@ -1825,7 +1879,7 @@ namespace bgfx
{ PVR3_BGRA8, PVR3_CHANNEL_TYPE_ANY, TextureFormat::BGRA8 },
{ PVR3_RGBA16, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA16 },
{ PVR3_RGBA16, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::RGBA16F },
- { PVR3_RGBA32, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA32 },
+ { PVR3_RGBA32, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA32U },
{ PVR3_RGBA32, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::RGBA32F },
{ PVR3_RGB565, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R5G6B5 },
{ PVR3_RGBA4, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA4 },
diff --git a/3rdparty/bgfx/src/image.h b/3rdparty/bgfx/src/image.h
index ab0efa0cdd7..5c24ac046e2 100644
--- a/3rdparty/bgfx/src/image.h
+++ b/3rdparty/bgfx/src/image.h
@@ -38,6 +38,20 @@ namespace bgfx
const uint8_t* m_data;
};
+ struct EncodingType
+ {
+ enum Enum
+ {
+ Unorm,
+ Int,
+ Uint,
+ Float,
+ Snorm,
+
+ Count
+ };
+ };
+
struct ImageBlockInfo
{
uint8_t bitsPerPixel;
@@ -48,6 +62,7 @@ namespace bgfx
uint8_t minBlockY;
uint8_t depthBits;
uint8_t stencilBits;
+ uint8_t encoding;
};
///
@@ -81,6 +96,9 @@ namespace bgfx
void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst);
///
+ void imageCopy(uint32_t _height, uint32_t _srcPitch, const void* _src, uint32_t _dstPitch, void* _dst);
+
+ ///
void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst);
///
diff --git a/3rdparty/bgfx/src/ovr.cpp b/3rdparty/bgfx/src/ovr.cpp
index 8a00608ae88..1e34c8ba9c0 100644
--- a/3rdparty/bgfx/src/ovr.cpp
+++ b/3rdparty/bgfx/src/ovr.cpp
@@ -9,28 +9,72 @@
namespace bgfx
{
+#if OVR_VERSION <= OVR_VERSION_050
+# define OVR_EYE_BUFFER 100
+#else
+# define OVR_EYE_BUFFER 8
+#endif // OVR_VERSION...
+
OVR::OVR()
: m_hmd(NULL)
- , m_initialized(false)
+ , m_isenabled(false)
, m_debug(false)
{
}
OVR::~OVR()
{
- BX_CHECK(!m_initialized, "OVR not shutdown properly.");
+ BX_CHECK(NULL == m_hmd, "OVR not shutdown properly.");
}
void OVR::init()
{
- m_initialized = !!ovr_Initialize();
+ bool initialized = !!ovr_Initialize();
+ BX_WARN(initialized, "Unable to create OVR device.");
+ if (!initialized)
+ {
+ return;
+ }
+
+ m_hmd = ovrHmd_Create(0);
+ if (NULL == m_hmd)
+ {
+ m_hmd = ovrHmd_CreateDebug(ovrHmd_DK2);
+ BX_WARN(NULL != m_hmd, "Unable to create OVR device.");
+ if (NULL == m_hmd)
+ {
+ return;
+ }
+ }
+
+ BX_TRACE("HMD: %s, %s, firmware: %d.%d"
+ , m_hmd->ProductName
+ , m_hmd->Manufacturer
+ , m_hmd->FirmwareMajor
+ , m_hmd->FirmwareMinor
+ );
+
+ ovrSizei sizeL = ovrHmd_GetFovTextureSize(m_hmd, ovrEye_Left, m_hmd->DefaultEyeFov[0], 1.0f);
+ ovrSizei sizeR = ovrHmd_GetFovTextureSize(m_hmd, ovrEye_Right, m_hmd->DefaultEyeFov[1], 1.0f);
+ m_rtSize.w = sizeL.w + sizeR.w + OVR_EYE_BUFFER;
+ m_rtSize.h = bx::uint32_max(sizeL.h, sizeR.h);
+ m_warning = true;
}
void OVR::shutdown()
{
- BX_CHECK(NULL == m_hmd, "HMD not destroyed.");
+ BX_CHECK(!m_isenabled, "HMD not disabled.");
+ ovrHmd_Destroy(m_hmd);
+ m_hmd = NULL;
ovr_Shutdown();
- m_initialized = false;
+ }
+
+ void OVR::getViewport(uint8_t _eye, Rect* _viewport)
+ {
+ _viewport->m_x = _eye * (m_rtSize.w + OVR_EYE_BUFFER + 1)/2;
+ _viewport->m_y = 0;
+ _viewport->m_width = (m_rtSize.w - OVR_EYE_BUFFER)/2;
+ _viewport->m_height = m_rtSize.h;
}
bool OVR::postReset(void* _nwh, ovrRenderAPIConfig* _config, bool _debug)
@@ -75,33 +119,12 @@ namespace bgfx
return false;
}
- if (!m_initialized)
- {
- return false;
- }
-
- if (!_debug)
- {
- m_hmd = ovrHmd_Create(0);
- }
-
if (NULL == m_hmd)
{
- m_hmd = ovrHmd_CreateDebug(ovrHmd_DK2);
- BX_WARN(NULL != m_hmd, "Unable to initialize OVR.");
-
- if (NULL == m_hmd)
- {
- return false;
- }
+ return false;
}
- BX_TRACE("HMD: %s, %s, firmware: %d.%d"
- , m_hmd->ProductName
- , m_hmd->Manufacturer
- , m_hmd->FirmwareMajor
- , m_hmd->FirmwareMinor
- );
+ m_isenabled = true;
ovrBool result;
result = ovrHmd_AttachToWindow(m_hmd, _nwh, NULL, NULL);
@@ -142,18 +165,11 @@ namespace bgfx
{
ovrError:
BX_TRACE("Failed to initialize OVR.");
- ovrHmd_Destroy(m_hmd);
- m_hmd = NULL;
+ m_isenabled = false;
return false;
}
- ovrSizei sizeL = ovrHmd_GetFovTextureSize(m_hmd, ovrEye_Left, m_hmd->DefaultEyeFov[0], 1.0f);
- ovrSizei sizeR = ovrHmd_GetFovTextureSize(m_hmd, ovrEye_Right, m_hmd->DefaultEyeFov[1], 1.0f);
- m_rtSize.w = sizeL.w + sizeR.w;
- m_rtSize.h = bx::uint32_max(sizeL.h, sizeR.h);
-
m_warning = true;
-
return true;
}
@@ -167,12 +183,12 @@ ovrError:
ovrRecti rect;
rect.Pos.x = 0;
rect.Pos.y = 0;
- rect.Size.w = m_rtSize.w/2;
+ rect.Size.w = (m_rtSize.w - OVR_EYE_BUFFER)/2;
rect.Size.h = m_rtSize.h;
m_texture[0].Header.RenderViewport = rect;
- rect.Pos.x += rect.Size.w;
+ rect.Pos.x += rect.Size.w + OVR_EYE_BUFFER;
m_texture[1].Header.RenderViewport = rect;
m_timing = ovrHmd_BeginFrame(m_hmd, 0);
@@ -188,11 +204,12 @@ ovrError:
void OVR::preReset()
{
- if (NULL != m_hmd)
+ if (m_isenabled)
{
ovrHmd_EndFrame(m_hmd, m_pose, m_texture);
- ovrHmd_Destroy(m_hmd);
- m_hmd = NULL;
+ ovrHmd_AttachToWindow(m_hmd, NULL, NULL, NULL);
+ ovrHmd_ConfigureRendering(m_hmd, NULL, 0, NULL, NULL);
+ m_isenabled = false;
}
m_debug = false;
@@ -200,11 +217,21 @@ ovrError:
bool OVR::swap(HMD& _hmd)
{
- if (NULL == m_hmd)
+ _hmd.flags = BGFX_HMD_NONE;
+
+ if (NULL != m_hmd)
+ {
+ _hmd.flags |= BGFX_HMD_DEVICE_RESOLUTION;
+ _hmd.deviceWidth = m_hmd->Resolution.w;
+ _hmd.deviceHeight = m_hmd->Resolution.h;
+ }
+
+ if (!m_isenabled)
{
return false;
}
+ _hmd.flags |= BGFX_HMD_RENDERING;
ovrHmd_EndFrame(m_hmd, m_pose, m_texture);
if (m_warning)
diff --git a/3rdparty/bgfx/src/ovr.h b/3rdparty/bgfx/src/ovr.h
index 52eaa591f50..62c81d78ccc 100644
--- a/3rdparty/bgfx/src/ovr.h
+++ b/3rdparty/bgfx/src/ovr.h
@@ -13,7 +13,7 @@
# include <OVR_Version.h>
# define OVR_VERSION_(_a, _b, _c) (_a * 10000 + _b * 100 + _c)
-# define OVR_VERSION OVR_VERSION_(OVR_MAJOR_VERSION, OVR_MINOR_VERSION, OVR_BUILD_VERSION)
+# define OVR_VERSION OVR_VERSION_(OVR_PRODUCT_VERSION, OVR_MAJOR_VERSION, OVR_MINOR_VERSION)
# define OVR_VERSION_042 OVR_VERSION_(0, 4, 2)
# define OVR_VERSION_043 OVR_VERSION_(0, 4, 3)
# define OVR_VERSION_044 OVR_VERSION_(0, 4, 4)
@@ -51,12 +51,12 @@ namespace bgfx
bool isInitialized() const
{
- return m_initialized;
+ return NULL != m_hmd;
}
bool isEnabled() const
{
- return NULL != m_hmd;
+ return m_isenabled;
}
bool isDebug() const
@@ -67,6 +67,7 @@ namespace bgfx
void init();
void shutdown();
+ void getViewport(uint8_t _eye, Rect* _viewport);
bool postReset(void* _nwh, ovrRenderAPIConfig* _config, bool _debug = false);
void postReset(const ovrTexture& _texture);
void preReset();
@@ -87,7 +88,7 @@ namespace bgfx
ovrTexture m_texture[2];
ovrSizei m_rtSize;
bool m_warning;
- bool m_initialized;
+ bool m_isenabled;
bool m_debug;
};
@@ -107,31 +108,40 @@ namespace bgfx
{
}
- void init()
+ bool isInitialized() const
{
+ return false;
}
- void shutdown()
+ bool isEnabled() const
{
+ return false;
}
- bool isInitialized() const
+ bool isDebug() const
{
return false;
}
- bool isEnabled() const
+ void init()
{
- return false;
}
- bool isDebug() const
+ void shutdown()
{
- return false;
+ }
+
+ void getViewport(uint8_t /*_eye*/, Rect* _viewport)
+ {
+ _viewport->m_x = 0;
+ _viewport->m_y = 0;
+ _viewport->m_width = 0;
+ _viewport->m_height = 0;
}
bool swap(HMD& _hmd)
{
+ _hmd.flags = BGFX_HMD_NONE;
getEyePose(_hmd);
return false;
}
diff --git a/3rdparty/bgfx/src/renderdoc.cpp b/3rdparty/bgfx/src/renderdoc.cpp
index 84ae511257e..ac2e2917fa6 100644
--- a/3rdparty/bgfx/src/renderdoc.cpp
+++ b/3rdparty/bgfx/src/renderdoc.cpp
@@ -5,7 +5,7 @@
#include "bgfx_p.h"
-#if BGFX_CONFIG_DEBUG_PIX && !BGFX_CONFIG_RENDERER_OPENGLES && (BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX)
+#if BGFX_CONFIG_DEBUG_PIX && (BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX)
# if BX_PLATFORM_WINDOWS
# include <psapi.h>
# endif // BX_PLATFORM_WINDOWS
@@ -55,27 +55,8 @@ namespace bgfx
return false;
}
-#define RENDERDOC_IMPORT \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_Shutdown); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_SetLogFile); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_GetCapture); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureOptions); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_SetActiveWindow); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_TriggerCapture); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_StartFrameCapture); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_EndFrameCapture); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_GetOverlayBits); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_MaskOverlayBits); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_SetFocusToggleKeys); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureKeys); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_InitRemoteAccess); \
- RENDERDOC_IMPORT_FUNC(RENDERDOC_UnloadCrashHandler);
-
-#define RENDERDOC_IMPORT_FUNC(_func) p##_func _func
- RENDERDOC_IMPORT
-#undef RENDERDOC_IMPORT_FUNC
-
- pRENDERDOC_GetAPIVersion RENDERDOC_GetAPIVersion;
+ pRENDERDOC_GetAPI RENDERDOC_GetAPI;
+ static RENDERDOC_API_1_0_0* s_renderDoc;
void* loadRenderDoc()
{
@@ -89,33 +70,21 @@ namespace bgfx
if (NULL != renderdocdll)
{
- RENDERDOC_GetAPIVersion = (pRENDERDOC_GetAPIVersion)bx::dlsym(renderdocdll, "RENDERDOC_GetAPIVersion");
- if (NULL != RENDERDOC_GetAPIVersion
- && RENDERDOC_API_VERSION == RENDERDOC_GetAPIVersion() )
+ RENDERDOC_GetAPI = (pRENDERDOC_GetAPI)bx::dlsym(renderdocdll, "RENDERDOC_GetAPI");
+ if (NULL != RENDERDOC_GetAPI
+ && 1 == RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_0_0, (void**)&s_renderDoc) )
{
-#define RENDERDOC_IMPORT_FUNC(_func) \
- _func = (p##_func)bx::dlsym(renderdocdll, #_func); \
- BX_TRACE("%p " #_func, _func);
-RENDERDOC_IMPORT
-#undef RENDERDOC_IMPORT_FUNC
+ s_renderDoc->SetLogFilePathTemplate("temp/bgfx");
- RENDERDOC_SetLogFile("temp/bgfx");
+ s_renderDoc->SetFocusToggleKeys(NULL, 0);
- RENDERDOC_SetFocusToggleKeys(NULL, 0);
+ RENDERDOC_InputButton captureKey = eRENDERDOC_Key_F11;
+ s_renderDoc->SetCaptureKeys(&captureKey, 1);
- KeyButton captureKey = eKey_F11;
- RENDERDOC_SetCaptureKeys(&captureKey, 1);
+ s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_AllowVSync, 1);
+ s_renderDoc->SetCaptureOptionU32(eRENDERDOC_Option_SaveAllInitials, 1);
- CaptureOptions opt;
- memset(&opt, 0, sizeof(opt) );
- opt.AllowVSync = 1;
- opt.SaveAllInitials = 1;
- RENDERDOC_SetCaptureOptions(&opt);
-
- uint32_t ident = 0;
- RENDERDOC_InitRemoteAccess(&ident);
-
- RENDERDOC_MaskOverlayBits(eOverlay_None, eOverlay_None);
+ s_renderDoc->MaskOverlayBits(eRENDERDOC_Overlay_None, eRENDERDOC_Overlay_None);
}
else
{
@@ -131,7 +100,7 @@ RENDERDOC_IMPORT
{
if (NULL != _renderdocdll)
{
- RENDERDOC_Shutdown();
+ s_renderDoc->Shutdown();
bx::dlclose(_renderdocdll);
}
}
diff --git a/3rdparty/bgfx/src/renderer.h b/3rdparty/bgfx/src/renderer.h
index 2404172c8f0..68f9ce34712 100644
--- a/3rdparty/bgfx/src/renderer.h
+++ b/3rdparty/bgfx/src/renderer.h
@@ -73,7 +73,7 @@ namespace bgfx
}
template<uint16_t mtxRegs, typename RendererContext, typename Program, typename Draw>
- void setPredefined(RendererContext* _renderer, uint8_t view, uint8_t eye, Program& _program, Frame* _render, const Draw& _draw)
+ void setPredefined(RendererContext* _renderer, uint16_t view, uint8_t eye, Program& _program, Frame* _render, const Draw& _draw)
{
for (uint32_t ii = 0, num = _program.m_numPredefined; ii < num; ++ii)
{
diff --git a/3rdparty/bgfx/src/renderer_d3d.h b/3rdparty/bgfx/src/renderer_d3d.h
index eed410263dd..56cb88c6388 100644
--- a/3rdparty/bgfx/src/renderer_d3d.h
+++ b/3rdparty/bgfx/src/renderer_d3d.h
@@ -32,20 +32,22 @@ namespace bgfx
#define _DX_RELEASE(_ptr, _expected, _check) \
BX_MACRO_BLOCK_BEGIN \
- if (NULL != _ptr) \
+ if (NULL != (_ptr) ) \
{ \
- ULONG count = _ptr->Release(); \
+ ULONG count = (_ptr)->Release(); \
_check(isGraphicsDebuggerPresent() || _expected == count, "%p RefCount is %d (expected %d).", _ptr, count, _expected); BX_UNUSED(count); \
_ptr = NULL; \
} \
BX_MACRO_BLOCK_END
-# define _DX_CHECK_REFCOUNT(_ptr, _expected) \
+#define _DX_CHECK_REFCOUNT(_ptr, _expected) \
BX_MACRO_BLOCK_BEGIN \
ULONG count = getRefCount(_ptr); \
BX_CHECK(isGraphicsDebuggerPresent() || _expected == count, "%p RefCount is %d (expected %d).", _ptr, count, _expected); \
BX_MACRO_BLOCK_END
+#define _DX_NAME(_ptr, _format, ...) setDebugObjectName(_ptr, _format, ##__VA_ARGS__)
+
#if BGFX_CONFIG_DEBUG
# define DX_CHECK(_call) _DX_CHECK(_call)
# define DX_CHECK_REFCOUNT(_ptr, _expected) _DX_CHECK_REFCOUNT(_ptr, _expected)
@@ -54,6 +56,12 @@ namespace bgfx
# define DX_CHECK_REFCOUNT(_ptr, _expected)
#endif // BGFX_CONFIG_DEBUG
+#if BGFX_CONFIG_DEBUG_OBJECT_NAME
+# define DX_NAME(_ptr, _format, ...) _DX_NAME(_ptr, _format, ##__VA_ARGS__)
+#else
+# define DX_NAME(_ptr, _format, ...)
+#endif // BGFX_CONFIG_DEBUG_OBJECT_NAME
+
#define DX_RELEASE(_ptr, _expected) _DX_RELEASE(_ptr, _expected, BX_CHECK)
#define DX_RELEASE_WARNONLY(_ptr, _expected) _DX_RELEASE(_ptr, _expected, BX_WARN)
@@ -65,6 +73,8 @@ namespace bgfx
typedef void (WINAPI* PFN_D3DPERF_SET_OPTIONS)(DWORD _options);
typedef DWORD (WINAPI* PFN_D3DPERF_GET_STATUS)();
typedef HRESULT (WINAPI* PFN_CREATE_DXGI_FACTORY)(REFIID _riid, void** _factory);
+ typedef HRESULT (WINAPI* PFN_GET_DEBUG_INTERFACE)(REFIID _riid, void** _debug);
+ typedef HRESULT (WINAPI* PFN_GET_DEBUG_INTERFACE1)(UINT _flags, REFIID _riid, void** _debug);
#define _PIX_SETMARKER(_col, _name) D3DPERF_SetMarker(_col, _name)
#define _PIX_BEGINEVENT(_col, _name) D3DPERF_BeginEvent(_col, _name)
@@ -90,15 +100,15 @@ namespace bgfx
class StateCacheT
{
public:
- void add(uint64_t _id, Ty* _item)
+ void add(uint64_t _key, Ty* _value)
{
- invalidate(_id);
- m_hashMap.insert(stl::make_pair(_id, _item) );
+ invalidate(_key);
+ m_hashMap.insert(stl::make_pair(_key, _value) );
}
- Ty* find(uint64_t _id)
+ Ty* find(uint64_t _key)
{
- typename HashMap::iterator it = m_hashMap.find(_id);
+ typename HashMap::iterator it = m_hashMap.find(_key);
if (it != m_hashMap.end() )
{
return it->second;
@@ -107,9 +117,9 @@ namespace bgfx
return NULL;
}
- void invalidate(uint64_t _id)
+ void invalidate(uint64_t _key)
{
- typename HashMap::iterator it = m_hashMap.find(_id);
+ typename HashMap::iterator it = m_hashMap.find(_key);
if (it != m_hashMap.end() )
{
DX_RELEASE_WARNONLY(it->second, 0);
@@ -141,16 +151,16 @@ namespace bgfx
class StateCache
{
public:
- void add(uint64_t _id, uint16_t _item)
+ void add(uint64_t _key, uint16_t _value)
{
- invalidate(_id);
- m_hashMap.insert(stl::make_pair(_id, _item));
+ invalidate(_key);
+ m_hashMap.insert(stl::make_pair(_key, _value) );
}
- uint16_t find(uint64_t _id)
+ uint16_t find(uint64_t _key)
{
- HashMap::iterator it = m_hashMap.find(_id);
- if (it != m_hashMap.end())
+ HashMap::iterator it = m_hashMap.find(_key);
+ if (it != m_hashMap.end() )
{
return it->second;
}
@@ -158,10 +168,10 @@ namespace bgfx
return UINT16_MAX;
}
- void invalidate(uint64_t _id)
+ void invalidate(uint64_t _key)
{
- HashMap::iterator it = m_hashMap.find(_id);
- if (it != m_hashMap.end())
+ HashMap::iterator it = m_hashMap.find(_key);
+ if (it != m_hashMap.end() )
{
m_hashMap.erase(it);
}
@@ -174,7 +184,7 @@ namespace bgfx
uint32_t getCount() const
{
- return uint32_t(m_hashMap.size());
+ return uint32_t(m_hashMap.size() );
}
private:
@@ -182,6 +192,128 @@ namespace bgfx
HashMap m_hashMap;
};
+ template<typename Ty>
+ inline void release(Ty)
+ {
+ }
+
+ template<>
+ inline void release<IUnknown*>(IUnknown* _ptr)
+ {
+ DX_RELEASE(_ptr, 0);
+ }
+
+ template <typename Ty, uint16_t MaxHandleT>
+ class StateCacheLru
+ {
+ public:
+ void add(uint64_t _key, Ty _value, uint16_t _parent)
+ {
+ uint16_t handle = m_alloc.alloc();
+ if (UINT16_MAX == handle)
+ {
+ uint16_t back = m_alloc.getBack();
+ invalidate(back);
+ handle = m_alloc.alloc();
+ }
+
+ BX_CHECK(UINT16_MAX != handle, "Failed to find handle.");
+
+ Data& data = m_data[handle];
+ data.m_hash = _key;
+ data.m_value = _value;
+ data.m_parent = _parent;
+ m_hashMap.insert(stl::make_pair(_key, handle) );
+ }
+
+ Ty* find(uint64_t _key)
+ {
+ HashMap::iterator it = m_hashMap.find(_key);
+ if (it != m_hashMap.end() )
+ {
+ uint16_t handle = it->second;
+ m_alloc.touch(handle);
+ return &m_data[handle].m_value;
+ }
+
+ return NULL;
+ }
+
+ void invalidate(uint64_t _key)
+ {
+ HashMap::iterator it = m_hashMap.find(_key);
+ if (it != m_hashMap.end() )
+ {
+ uint16_t handle = it->second;
+ m_alloc.free(handle);
+ m_hashMap.erase(it);
+ release(m_data[handle].m_value);
+ }
+ }
+
+ void invalidate(uint16_t _handle)
+ {
+ if (m_alloc.isValid(_handle) )
+ {
+ m_alloc.free(_handle);
+ Data& data = m_data[_handle];
+ m_hashMap.erase(m_hashMap.find(data.m_hash) );
+ release(data.m_value);
+ }
+ }
+
+ void invalidateWithParent(uint16_t _parent)
+ {
+ for (uint16_t ii = 0; ii < m_alloc.getNumHandles();)
+ {
+ uint16_t handle = m_alloc.getHandleAt(ii);
+ Data& data = m_data[handle];
+
+ if (data.m_parent == _parent)
+ {
+ m_alloc.free(handle);
+ m_hashMap.erase(m_hashMap.find(data.m_hash) );
+ release(data.m_value);
+ }
+ else
+ {
+ ++ii;
+ }
+ }
+ }
+
+ void invalidate()
+ {
+ for (uint16_t ii = 0, num = m_alloc.getNumHandles(); ii < num; ++ii)
+ {
+ uint16_t handle = m_alloc.getHandleAt(ii);
+ Data& data = m_data[handle];
+ release(data.m_value);
+ }
+
+ m_hashMap.clear();
+ m_alloc.reset();
+ }
+
+ uint32_t getCount() const
+ {
+ return uint32_t(m_hashMap.size() );
+ }
+
+ private:
+ typedef stl::unordered_map<uint64_t, uint16_t> HashMap;
+ HashMap m_hashMap;
+ bx::HandleAllocLruT<MaxHandleT> m_alloc;
+ struct Data
+ {
+ uint64_t m_hash;
+ Ty m_value;
+ uint16_t m_parent;
+ };
+
+ Data m_data[MaxHandleT];
+ };
+
} // namespace bgfx
#endif // BGFX_RENDERER_D3D_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index eb8e3aa1137..a7a383d3b7d 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -8,9 +8,10 @@
#if BGFX_CONFIG_RENDERER_DIRECT3D11
# include "renderer_d3d11.h"
-# if !defined(BGFX_D3D11_MAP_CONSTANT_BUFFERS)
-# define BGFX_D3D11_MAP_CONSTANT_BUFFERS 0
-# endif
+#if BX_PLATFORM_WINRT
+# include <inspectable.h>
+# include <windows.ui.xaml.media.dxinterop.h>
+#endif // BX_PLATFORM_WINRT
namespace bgfx { namespace d3d11
{
@@ -46,14 +47,23 @@ namespace bgfx { namespace d3d11
union Zero
{
+ Zero()
+ {
+ memset(this, 0, sizeof(Zero) );
+ }
+
ID3D11Buffer* m_buffer[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
ID3D11UnorderedAccessView* m_uav[D3D11_PS_CS_UAV_REGISTER_COUNT];
ID3D11ShaderResourceView* m_srv[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
ID3D11SamplerState* m_sampler[D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT];
uint32_t m_zero[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ float m_zerof[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
};
- static Zero s_zero;
+ BX_PRAGMA_DIAGNOSTIC_PUSH();
+ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4268) // warning C4268: '' : 'const' static/global data initialized with compiler generated default constructor fills the object with zeros
+ static const Zero s_zero;
+ BX_PRAGMA_DIAGNOSTIC_POP();
static const uint32_t s_checkMsaa[] =
{
@@ -137,6 +147,7 @@ namespace bgfx { namespace d3d11
D3D11_TEXTURE_ADDRESS_WRAP,
D3D11_TEXTURE_ADDRESS_MIRROR,
D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_BORDER,
};
/*
@@ -188,55 +199,78 @@ namespace bgfx { namespace d3d11
static const TextureFormatInfo s_textureFormat[] =
{
- { DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC1_UNORM_SRGB }, // BC1
- { DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC2_UNORM_SRGB }, // BC2
- { DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC3_UNORM_SRGB }, // BC3
- { DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC4
- { DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC5
- { DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC6H
- { DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC7_UNORM_SRGB }, // BC7
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC1
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A1
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC22
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC24
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
- { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R1
- { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8
- { DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16
- { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16F
- { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32
- { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32F
- { DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8
- { DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16
- { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16F
- { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32
- { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32F
- { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB }, // BGRA8
+ { DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC1_UNORM_SRGB }, // BC1
+ { DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC2_UNORM_SRGB }, // BC2
+ { DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC3_UNORM_SRGB }, // BC3
+ { DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC4
+ { DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC5
+ { DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC6H
+ { DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC7_UNORM_SRGB }, // BC7
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC22
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC24
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
+ { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R1
+ { DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // A8
+ { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8
+ { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8I
+ { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8U
+ { DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8S
+ { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16
+ { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16I
+ { DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16U
+ { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16F
+ { DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16S
+ { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32I
+ { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32U
+ { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32F
+ { DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8
+ { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8I
+ { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8U
+ { DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8S
+ { DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16
+ { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16I
+ { DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16U
+ { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16F
+ { DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16S
+ { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32I
+ { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32U
+ { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32F
+ { DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB9E5F
+ { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB }, // BGRA8
{ DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8
- { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16
- { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16F
- { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32
- { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32F
- { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R5G6B5
- { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA4
- { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB5A1
- { DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB10A2
- { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R11G11B10F
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // UnknownDepth
- { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN }, // D16
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24S8
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D32
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D16F
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D24F
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8
+ { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8I
+ { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8U
+ { DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA8S
+ { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16
+ { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16I
+ { DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16U
+ { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16F
+ { DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16S
+ { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32I
+ { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32U
+ { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32F
+ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R5G6B5
+ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA4
+ { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB5A1
+ { DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB10A2
+ { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R11G11B10F
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // UnknownDepth
+ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN }, // D16
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24S8
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D32
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D16F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D24F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -263,25 +297,31 @@ namespace bgfx { namespace d3d11
static const DXGI_FORMAT s_attribType[][4][2] =
{
- {
+ { // Uint8
{ DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UNORM },
{ DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UNORM },
{ DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM },
{ DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM },
},
- {
+ { // Uint10
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ },
+ { // Int16
{ DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SNORM },
{ DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SNORM },
{ DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SNORM },
{ DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SNORM },
},
- {
+ { // Half
{ DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT },
{ DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT },
{ DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT },
{ DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT },
},
- {
+ { // Float
{ DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT },
{ DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT },
{ DXGI_FORMAT_R32G32B32_FLOAT, DXGI_FORMAT_R32G32B32_FLOAT },
@@ -296,7 +336,7 @@ namespace bgfx { namespace d3d11
for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
{
- if (0xff != _decl.m_attributes[attr])
+ if (UINT16_MAX != _decl.m_attributes[attr])
{
memcpy(elem, &s_attrib[attr], sizeof(D3D11_INPUT_ELEMENT_DESC) );
@@ -431,12 +471,75 @@ namespace bgfx { namespace d3d11
return false;
};
+ enum AGS_RETURN_CODE
+ {
+ AGS_SUCCESS,
+ AGS_INVALID_ARGS,
+ AGS_OUT_OF_MEMORY,
+ AGS_ERROR_MISSING_DLL,
+ AGS_ERROR_LEGACY_DRIVER,
+ AGS_EXTENSION_NOT_SUPPORTED,
+ AGS_ADL_FAILURE,
+ };
+
+ enum AGS_DRIVER_EXTENSION
+ {
+ AGS_EXTENSION_QUADLIST = 1 << 0,
+ AGS_EXTENSION_UAV_OVERLAP = 1 << 1,
+ AGS_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 2,
+ AGS_EXTENSION_MULTIDRAWINDIRECT = 1 << 3,
+ };
+
+ struct AGSDriverVersionInfo
+ {
+ char strDriverVersion[256];
+ char strCatalystVersion[256];
+ char strCatalystWebLink[256];
+ };
+
+ struct AGSContext;
+
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_INIT)(AGSContext**);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_DEINIT)(AGSContext*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_GET_CROSSFIRE_GPU_COUNT)(AGSContext*, int32_t*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_GET_TOTAL_GPU_COUNT)(AGSContext*, int32_t*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_GET_GPU_MEMORY_SIZE)(AGSContext*, int32_t, int64_t*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_GET_DRIVER_VERSION_INFO)(AGSContext*, AGSDriverVersionInfo*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_DRIVER_EXTENSIONS_INIT)(AGSContext*, ID3D11Device*, uint32_t*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_DRIVER_EXTENSIONS_DEINIT)(AGSContext*);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INSTANCED_INDIRECT)(AGSContext*, uint32_t, ID3D11Buffer*, uint32_t, uint32_t);
+ typedef AGS_RETURN_CODE (__cdecl* PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INDEXED_INSTANCED_INDIRECT)(AGSContext*, uint32_t, ID3D11Buffer*, uint32_t, uint32_t);
+
+ static PFN_AGS_INIT agsInit;
+ static PFN_AGS_DEINIT agsDeInit;
+ static PFN_AGS_GET_CROSSFIRE_GPU_COUNT agsGetCrossfireGPUCount;
+ static PFN_AGS_GET_TOTAL_GPU_COUNT agsGetTotalGPUCount;
+ static PFN_AGS_GET_GPU_MEMORY_SIZE agsGetGPUMemorySize;
+ static PFN_AGS_GET_DRIVER_VERSION_INFO agsGetDriverVersionInfo;
+ static PFN_AGS_DRIVER_EXTENSIONS_INIT agsDriverExtensions_Init;
+ static PFN_AGS_DRIVER_EXTENSIONS_DEINIT agsDriverExtensions_DeInit;
+ static PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INSTANCED_INDIRECT agsDriverExtensions_MultiDrawInstancedIndirect;
+ static PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INDEXED_INSTANCED_INDIRECT agsDriverExtensions_MultiDrawIndexedInstancedIndirect;
+
+ typedef void (* MultiDrawIndirectFn)(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
+
+ void stubMultiDrawInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
+ void stubMultiDrawIndexedInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
+
+ void amdAgsMultiDrawInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
+ void amdAgsMultiDrawIndexedInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride);
+
+ static MultiDrawIndirectFn multiDrawInstancedIndirect;
+ static MultiDrawIndirectFn multiDrawIndexedInstancedIndirect;
+
#if USE_D3D11_DYNAMIC_LIB
- static PFN_D3D11_CREATE_DEVICE D3D11CreateDevice;
- static PFN_CREATE_DXGI_FACTORY CreateDXGIFactory;
- static PFN_D3DPERF_SET_MARKER D3DPERF_SetMarker;
- static PFN_D3DPERF_BEGIN_EVENT D3DPERF_BeginEvent;
- static PFN_D3DPERF_END_EVENT D3DPERF_EndEvent;
+ static PFN_D3D11_CREATE_DEVICE D3D11CreateDevice;
+ static PFN_CREATE_DXGI_FACTORY CreateDXGIFactory;
+ static PFN_D3DPERF_SET_MARKER D3DPERF_SetMarker;
+ static PFN_D3DPERF_BEGIN_EVENT D3DPERF_BeginEvent;
+ static PFN_D3DPERF_END_EVENT D3DPERF_EndEvent;
+ static PFN_GET_DEBUG_INTERFACE DXGIGetDebugInterface;
+ static PFN_GET_DEBUG_INTERFACE1 DXGIGetDebugInterface1;
#endif // USE_D3D11_DYNAMIC_LIB
struct RendererContextD3D11 : public RendererContextI
@@ -445,7 +548,10 @@ namespace bgfx { namespace d3d11
: m_d3d9dll(NULL)
, m_d3d11dll(NULL)
, m_dxgidll(NULL)
+ , m_dxgidebugdll(NULL)
, m_renderdocdll(NULL)
+ , m_agsdll(NULL)
+ , m_ags(NULL)
, m_driverType(D3D_DRIVER_TYPE_NULL)
, m_featureLevel(D3D_FEATURE_LEVEL(0) )
, m_adapter(NULL)
@@ -466,13 +572,8 @@ namespace bgfx { namespace d3d11
, m_flags(BGFX_RESET_NONE)
, m_maxAnisotropy(1)
, m_currentProgram(NULL)
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- , m_vsScratch(NULL)
- , m_fsScratch(NULL)
-#else
, m_vsChanges(0)
, m_fsChanges(0)
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
, m_rtMsaa(false)
, m_ovrRtv(NULL)
, m_ovrDsv(NULL)
@@ -487,8 +588,21 @@ namespace bgfx { namespace d3d11
{
}
- void init()
+ bool init()
{
+ struct ErrorState
+ {
+ enum Enum
+ {
+ Default,
+ LoadedD3D11,
+ LoadedDXGI,
+ CreatedDXGIFactory,
+ };
+ };
+
+ ErrorState::Enum errorState = ErrorState::Default;
+
// Must be before device creation, and before RenderDoc.
m_ovr.init();
@@ -501,9 +615,96 @@ namespace bgfx { namespace d3d11
memset(m_uniforms, 0, sizeof(m_uniforms) );
memset(&m_resolution, 0, sizeof(m_resolution) );
+ m_ags = NULL;
+ m_agsdll = bx::dlopen(
+#if BX_ARCH_32BIT
+ "amd_ags_x86.dll"
+#else
+ "amd_ags_x64.dll"
+#endif // BX_ARCH_32BIT
+ );
+ if (NULL != m_agsdll)
+ {
+ agsInit = (PFN_AGS_INIT )bx::dlsym(m_agsdll, "agsInit");
+ agsDeInit = (PFN_AGS_DEINIT)bx::dlsym(m_agsdll, "agsDeInit");
+ agsGetCrossfireGPUCount = (PFN_AGS_GET_CROSSFIRE_GPU_COUNT )bx::dlsym(m_agsdll, "agsGetCrossfireGPUCount");
+ agsGetTotalGPUCount = (PFN_AGS_GET_TOTAL_GPU_COUNT )bx::dlsym(m_agsdll, "agsGetTotalGPUCount");
+ agsGetGPUMemorySize = (PFN_AGS_GET_GPU_MEMORY_SIZE )bx::dlsym(m_agsdll, "agsGetGPUMemorySize");
+ agsGetDriverVersionInfo = (PFN_AGS_GET_DRIVER_VERSION_INFO )bx::dlsym(m_agsdll, "agsGetDriverVersionInfo");
+ agsDriverExtensions_Init = (PFN_AGS_DRIVER_EXTENSIONS_INIT )bx::dlsym(m_agsdll, "agsDriverExtensions_Init");
+ agsDriverExtensions_DeInit = (PFN_AGS_DRIVER_EXTENSIONS_DEINIT)bx::dlsym(m_agsdll, "agsDriverExtensions_DeInit");
+ agsDriverExtensions_MultiDrawInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INSTANCED_INDIRECT )bx::dlsym(m_agsdll, "agsDriverExtensions_MultiDrawInstancedIndirect");
+ agsDriverExtensions_MultiDrawIndexedInstancedIndirect = (PFN_AGS_DRIVER_EXTENSIONS_MULTIDRAW_INDEXED_INSTANCED_INDIRECT)bx::dlsym(m_agsdll, "agsDriverExtensions_MultiDrawIndexedInstancedIndirect");
+
+ bool agsSupported = true
+ && NULL != agsInit
+ && NULL != agsDeInit
+ && NULL != agsGetCrossfireGPUCount
+ && NULL != agsGetTotalGPUCount
+ && NULL != agsGetGPUMemorySize
+ && NULL != agsGetDriverVersionInfo
+ && NULL != agsDriverExtensions_Init
+ && NULL != agsDriverExtensions_DeInit
+ && NULL != agsDriverExtensions_MultiDrawInstancedIndirect
+ && NULL != agsDriverExtensions_MultiDrawIndexedInstancedIndirect
+ ;
+ if (agsSupported)
+ {
+ AGS_RETURN_CODE result = agsInit(&m_ags);
+ agsSupported = AGS_SUCCESS == result;
+ if (agsSupported)
+ {
+ AGSDriverVersionInfo vi;
+ result = agsGetDriverVersionInfo(m_ags, &vi);
+ BX_TRACE(" Driver version: %s", vi.strDriverVersion);
+ BX_TRACE(" Catalyst version: %s", vi.strCatalystVersion);
+
+ int32_t numCrossfireGPUs = 0;
+ result = agsGetCrossfireGPUCount(m_ags, &numCrossfireGPUs);
+ BX_TRACE(" Num crossfire GPUs: %d", numCrossfireGPUs);
+
+ int32_t numGPUs = 0;
+ result = agsGetTotalGPUCount(m_ags, &numGPUs);
+ BX_TRACE(" Num GPUs: %d", numGPUs);
+
+ for (int32_t ii = 0; ii < numGPUs; ++ii)
+ {
+ long long memSize;
+ result = agsGetGPUMemorySize(m_ags, ii, &memSize);
+ if (AGS_SUCCESS == result)
+ {
+ char memSizeStr[16];
+ bx::prettify(memSizeStr, BX_COUNTOF(memSizeStr), memSize);
+ BX_TRACE(" GPU #%d mem size: %s", ii, memSizeStr);
+ }
+ }
+ }
+ }
+
+ BX_WARN(!agsSupported, "AMD/AGS supported.");
+ if (!agsSupported)
+ {
+ if (NULL != m_ags)
+ {
+ agsDeInit(m_ags);
+ m_ags = NULL;
+ }
+
+ bx::dlclose(m_agsdll);
+ m_agsdll = NULL;
+ }
+ }
+
#if USE_D3D11_DYNAMIC_LIB
m_d3d11dll = bx::dlopen("d3d11.dll");
- BGFX_FATAL(NULL != m_d3d11dll, Fatal::UnableToInitialize, "Failed to load d3d11.dll.");
+ BX_WARN(NULL != m_d3d11dll, "Failed to load d3d11.dll.");
+
+ if (NULL == m_d3d11dll)
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::LoadedD3D11;
m_d3d9dll = NULL;
@@ -512,26 +713,58 @@ namespace bgfx { namespace d3d11
// D3D11_1.h has ID3DUserDefinedAnnotation
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh446881%28v=vs.85%29.aspx
m_d3d9dll = bx::dlopen("d3d9.dll");
- BGFX_FATAL(NULL != m_d3d9dll, Fatal::UnableToInitialize, "Failed to load d3d9.dll.");
-
- D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9dll, "D3DPERF_SetMarker" );
- D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9dll, "D3DPERF_BeginEvent");
- D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9dll, "D3DPERF_EndEvent" );
- BX_CHECK(NULL != D3DPERF_SetMarker
- && NULL != D3DPERF_BeginEvent
- && NULL != D3DPERF_EndEvent
- , "Failed to initialize PIX events."
- );
+ if (NULL != m_d3d9dll)
+ {
+ D3DPERF_SetMarker = (PFN_D3DPERF_SET_MARKER )bx::dlsym(m_d3d9dll, "D3DPERF_SetMarker" );
+ D3DPERF_BeginEvent = (PFN_D3DPERF_BEGIN_EVENT)bx::dlsym(m_d3d9dll, "D3DPERF_BeginEvent");
+ D3DPERF_EndEvent = (PFN_D3DPERF_END_EVENT )bx::dlsym(m_d3d9dll, "D3DPERF_EndEvent" );
+ BX_CHECK(NULL != D3DPERF_SetMarker
+ && NULL != D3DPERF_BeginEvent
+ && NULL != D3DPERF_EndEvent
+ , "Failed to initialize PIX events."
+ );
+ }
}
D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)bx::dlsym(m_d3d11dll, "D3D11CreateDevice");
- BGFX_FATAL(NULL != D3D11CreateDevice, Fatal::UnableToInitialize, "Function D3D11CreateDevice not found.");
+ BX_WARN(NULL != D3D11CreateDevice, "Function D3D11CreateDevice not found.");
+ if (NULL == D3D11CreateDevice)
+ {
+ goto error;
+ }
m_dxgidll = bx::dlopen("dxgi.dll");
- BGFX_FATAL(NULL != m_dxgidll, Fatal::UnableToInitialize, "Failed to load dxgi.dll.");
+ BX_WARN(NULL != m_dxgidll, "Failed to load dxgi.dll.");
+ if (NULL == m_dxgidll)
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::LoadedDXGI;
CreateDXGIFactory = (PFN_CREATE_DXGI_FACTORY)bx::dlsym(m_dxgidll, "CreateDXGIFactory");
- BGFX_FATAL(NULL != CreateDXGIFactory, Fatal::UnableToInitialize, "Function CreateDXGIFactory not found.");
+ BX_WARN(NULL != CreateDXGIFactory, "Function CreateDXGIFactory not found.");
+ if (NULL == CreateDXGIFactory)
+ {
+ goto error;
+ }
+
+ m_dxgidebugdll = bx::dlopen("dxgidebug.dll");
+ if (NULL != m_dxgidebugdll)
+ {
+ DXGIGetDebugInterface = (PFN_GET_DEBUG_INTERFACE )bx::dlsym(m_dxgidebugdll, "DXGIGetDebugInterface");
+ DXGIGetDebugInterface1 = (PFN_GET_DEBUG_INTERFACE1)bx::dlsym(m_dxgidebugdll, "DXGIGetDebugInterface1");
+ if (NULL == DXGIGetDebugInterface
+ && NULL == DXGIGetDebugInterface1)
+ {
+ bx::dlclose(m_dxgidebugdll);
+ m_dxgidebugdll = NULL;
+ }
+ else
+ {
+ // Figure out how to access IDXGIInfoQueue on pre Win8...
+ }
+ }
#endif // USE_D3D11_DYNAMIC_LIB
HRESULT hr;
@@ -539,11 +772,16 @@ namespace bgfx { namespace d3d11
#if BX_PLATFORM_WINRT
// WinRT requires the IDXGIFactory2 interface, which isn't supported on older platforms
hr = CreateDXGIFactory1(__uuidof(IDXGIFactory2), (void**)&factory);
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create DXGI factory.");
#else
hr = CreateDXGIFactory(IID_IDXGIFactory, (void**)&factory);
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create DXGI factory.");
#endif // BX_PLATFORM_WINRT
+ BX_WARN(SUCCEEDED(hr), "Unable to create DXGI factory.");
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::CreatedDXGIFactory;
m_device = (ID3D11Device*)g_platformData.context;
@@ -610,7 +848,7 @@ namespace bgfx { namespace d3d11
}
DX_RELEASE(factory, NULL != m_adapter ? 1 : 0);
- D3D_FEATURE_LEVEL features[] =
+ D3D_FEATURE_LEVEL featureLevel[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
@@ -626,6 +864,7 @@ namespace bgfx { namespace d3d11
uint32_t flags = 0
| D3D11_CREATE_DEVICE_SINGLETHREADED
| D3D11_CREATE_DEVICE_BGRA_SUPPORT
+// | D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS
| (BX_ENABLED(BGFX_CONFIG_DEBUG) ? D3D11_CREATE_DEVICE_DEBUG : 0)
;
@@ -636,13 +875,17 @@ namespace bgfx { namespace d3d11
, m_driverType
, NULL
, flags
- , &features[ii]
- , BX_COUNTOF(features)-ii
+ , &featureLevel[ii]
+ , BX_COUNTOF(featureLevel)-ii
, D3D11_SDK_VERSION
, &m_device
, &m_featureLevel
, &m_deviceCtx
);
+ BX_WARN(FAILED(hr), "Direct3D11 device feature level %d.%d."
+ , (m_featureLevel >> 12) & 0xf
+ , (m_featureLevel >> 8) & 0xf
+ );
if (FAILED(hr)
&& 0 != (flags & D3D11_CREATE_DEVICE_DEBUG) )
{
@@ -667,7 +910,12 @@ namespace bgfx { namespace d3d11
break;
}
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 device.");
+
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
if (NULL != m_adapter)
{
@@ -677,137 +925,195 @@ namespace bgfx { namespace d3d11
else
{
m_device->GetImmediateContext(&m_deviceCtx);
- BGFX_FATAL(NULL != m_deviceCtx, Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
+ BX_WARN(NULL != m_deviceCtx, "Unable to create Direct3D11 device.");
+
+ if (NULL == m_deviceCtx)
+ {
+ goto error;
+ }
}
- IDXGIDevice* device = NULL;
- IDXGIAdapter* adapter = NULL;
- hr = E_FAIL;
- for (uint32_t ii = 0; ii < BX_COUNTOF(s_deviceIIDs) && FAILED(hr); ++ii)
{
- hr = m_device->QueryInterface(s_deviceIIDs[ii], (void**)&device);
- BX_TRACE("D3D device 11.%d, hr %x", BX_COUNTOF(s_deviceIIDs)-1-ii, hr);
-
- if (SUCCEEDED(hr) )
+ IDXGIDevice* device = NULL;
+ IDXGIAdapter* adapter = NULL;
+ hr = E_FAIL;
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_deviceIIDs) && FAILED(hr); ++ii)
{
+ hr = m_device->QueryInterface(s_deviceIIDs[ii], (void**)&device);
+ BX_TRACE("D3D device 11.%d, hr %x", BX_COUNTOF(s_deviceIIDs)-1-ii, hr);
+
+ if (SUCCEEDED(hr) )
+ {
#if BX_COMPILER_MSVC
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4530) // warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
- try
- {
- // QueryInterface above can succeed, but getting adapter call might crash on Win7.
- hr = device->GetAdapter(&adapter);
- }
- catch (...)
- {
- BX_TRACE("Failed to get adapter foro IID_IDXGIDevice%d.", BX_COUNTOF(s_deviceIIDs)-1-ii);
- DX_RELEASE(device, 0);
- hr = E_FAIL;
- }
+ try
+ {
+ // QueryInterface above can succeed, but getting adapter call might crash on Win7.
+ hr = device->GetAdapter(&adapter);
+ }
+ catch (...)
+ {
+ BX_TRACE("Failed to get adapter foro IID_IDXGIDevice%d.", BX_COUNTOF(s_deviceIIDs)-1-ii);
+ DX_RELEASE(device, 0);
+ hr = E_FAIL;
+ }
BX_PRAGMA_DIAGNOSTIC_POP();
#else
- hr = device->GetAdapter(&adapter);
+ hr = device->GetAdapter(&adapter);
#endif // BX_COMPILER_MSVC
+ }
}
- }
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
-
- // GPA increases device ref count.
- // RenderDoc makes device ref count 0 here.
- //
- // This causes assert in debug. When debugger is present refcount
- // checks are off.
- IDXGIDevice* renderdoc;
- hr = m_device->QueryInterface(IID_IDXGIDeviceRenderDoc, (void**)&renderdoc);
- if (SUCCEEDED(hr) )
- {
- setGraphicsDebuggerPresent(true);
-// DX_RELEASE(renderdoc, 0);
- }
- else
- {
- setGraphicsDebuggerPresent(2 != getRefCount(device) );
- DX_RELEASE(device, 2);
- }
- hr = adapter->GetDesc(&m_adapterDesc);
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
- g_caps.vendorId = 0 == m_adapterDesc.VendorId
- ? BGFX_PCI_ID_SOFTWARE_RASTERIZER
- : (uint16_t)m_adapterDesc.VendorId
- ;
- g_caps.deviceId = (uint16_t)m_adapterDesc.DeviceId;
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 device.");
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
- if (NULL == g_platformData.backBuffer)
- {
+ // GPA increases device ref count.
+ // RenderDoc makes device ref count 0 here.
+ //
+ // This causes assert in debug. When debugger is present refcount
+ // checks are off.
+ IDXGIDevice* renderdoc;
+ hr = m_device->QueryInterface(IID_IDXGIDeviceRenderDoc, (void**)&renderdoc);
+ if (SUCCEEDED(hr) )
+ {
+ setGraphicsDebuggerPresent(true);
+ DX_RELEASE(renderdoc, 2);
+ }
+ else
+ {
+ setGraphicsDebuggerPresent(3 != getRefCount(device) );
+ DX_RELEASE(device, 2);
+ }
+
+ hr = adapter->GetDesc(&m_adapterDesc);
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 device.");
+ if (FAILED(hr) )
+ {
+ DX_RELEASE(adapter, 2);
+ goto error;
+ }
+
+ g_caps.vendorId = 0 == m_adapterDesc.VendorId
+ ? BGFX_PCI_ID_SOFTWARE_RASTERIZER
+ : (uint16_t)m_adapterDesc.VendorId
+ ;
+ g_caps.deviceId = (uint16_t)m_adapterDesc.DeviceId;
+
+ if (NULL == g_platformData.backBuffer)
+ {
#if BX_PLATFORM_WINRT
- hr = adapter->GetParent(__uuidof(IDXGIFactory2), (void**)&m_factory);
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
- DX_RELEASE(adapter, 2);
-
- memset(&m_scd, 0, sizeof(m_scd) );
- m_scd.Width = BGFX_DEFAULT_WIDTH;
- m_scd.Height = BGFX_DEFAULT_HEIGHT;
- m_scd.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- m_scd.Stereo = false;
- m_scd.SampleDesc.Count = 1;
- m_scd.SampleDesc.Quality = 0;
- m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- m_scd.BufferCount = 2;
- m_scd.Scaling = DXGI_SCALING_NONE;
- m_scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
- m_scd.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
-
- hr = m_factory->CreateSwapChainForCoreWindow(m_device
- , (::IUnknown*)g_platformData.nwh
- , &m_scd
- , NULL
- , &m_swapChain
- );
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
+ hr = adapter->GetParent(__uuidof(IDXGIFactory2), (void**)&m_factory);
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 device.");
+ DX_RELEASE(adapter, 2);
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ memset(&m_scd, 0, sizeof(m_scd) );
+ m_scd.Width = BGFX_DEFAULT_WIDTH;
+ m_scd.Height = BGFX_DEFAULT_HEIGHT;
+ m_scd.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ m_scd.Stereo = false;
+ m_scd.SampleDesc.Count = 1;
+ m_scd.SampleDesc.Quality = 0;
+ m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ m_scd.BufferCount = 2;
+ m_scd.Scaling = 0 == g_platformData.ndt
+ ? DXGI_SCALING_NONE
+ : DXGI_SCALING_STRETCH;
+ m_scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+ m_scd.AlphaMode = DXGI_ALPHA_MODE_IGNORE;
+
+ if (NULL == g_platformData.ndt)
+ {
+ hr = m_factory->CreateSwapChainForCoreWindow(m_device
+ , (::IUnknown*)g_platformData.nwh
+ , &m_scd
+ , NULL
+ , &m_swapChain
+ );
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 swap chain.");
+ }
+ else
+ {
+ BGFX_FATAL(g_platformData.ndt == reinterpret_cast<void*>(1), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
+
+ hr = m_factory->CreateSwapChainForComposition(m_device
+ , &m_scd
+ , NULL
+ , &m_swapChain
+ );
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 swap chain.");
+
+ IInspectable* nativeWindow = reinterpret_cast<IInspectable *>(g_platformData.nwh);
+ ISwapChainBackgroundPanelNative* panel = NULL;
+ hr = nativeWindow->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void**)&panel);
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
+
+ if (NULL != panel)
+ {
+ hr = panel->SetSwapChain(m_swapChain);
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
+
+ panel->Release();
+ }
+ }
#else
- hr = adapter->GetParent(IID_IDXGIFactory, (void**)&m_factory);
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
- DX_RELEASE(adapter, 2);
-
- memset(&m_scd, 0, sizeof(m_scd) );
- m_scd.BufferDesc.Width = BGFX_DEFAULT_WIDTH;
- m_scd.BufferDesc.Height = BGFX_DEFAULT_HEIGHT;
- m_scd.BufferDesc.RefreshRate.Numerator = 60;
- m_scd.BufferDesc.RefreshRate.Denominator = 1;
- m_scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- m_scd.SampleDesc.Count = 1;
- m_scd.SampleDesc.Quality = 0;
- m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- m_scd.BufferCount = 1;
- m_scd.OutputWindow = (HWND)g_platformData.nwh;
- m_scd.Windowed = true;
-
- hr = m_factory->CreateSwapChain(m_device
- , &m_scd
- , &m_swapChain
- );
- BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
+ hr = adapter->GetParent(IID_IDXGIFactory, (void**)&m_factory);
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D11 device.");
+ DX_RELEASE(adapter, 2);
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ memset(&m_scd, 0, sizeof(m_scd) );
+ m_scd.BufferDesc.Width = BGFX_DEFAULT_WIDTH;
+ m_scd.BufferDesc.Height = BGFX_DEFAULT_HEIGHT;
+ m_scd.BufferDesc.RefreshRate.Numerator = 60;
+ m_scd.BufferDesc.RefreshRate.Denominator = 1;
+ m_scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ m_scd.SampleDesc.Count = 1;
+ m_scd.SampleDesc.Quality = 0;
+ m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ m_scd.BufferCount = 1;
+ m_scd.OutputWindow = (HWND)g_platformData.nwh;
+ m_scd.Windowed = true;
+
+ hr = m_factory->CreateSwapChain(m_device
+ , &m_scd
+ , &m_swapChain
+ );
- DX_CHECK(m_factory->MakeWindowAssociation((HWND)g_platformData.nwh, 0
- | DXGI_MWA_NO_WINDOW_CHANGES
- | DXGI_MWA_NO_ALT_ENTER
- ));
+ DX_CHECK(m_factory->MakeWindowAssociation( (HWND)g_platformData.nwh, 0
+ | DXGI_MWA_NO_WINDOW_CHANGES
+ | DXGI_MWA_NO_ALT_ENTER
+ ) );
#endif // BX_PLATFORM_WINRT
- }
- else
- {
- memset(&m_scd, 0, sizeof(m_scd) );
- m_scd.SampleDesc.Count = 1;
- m_scd.SampleDesc.Quality = 0;
- setBufferSize(BGFX_DEFAULT_WIDTH, BGFX_DEFAULT_HEIGHT);
- m_backBufferColor = (ID3D11RenderTargetView*)g_platformData.backBuffer;
- m_backBufferDepthStencil = (ID3D11DepthStencilView*)g_platformData.backBufferDS;
+ BX_WARN(SUCCEEDED(hr), "Failed to create swap chain.");
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+ }
+ else
+ {
+ memset(&m_scd, 0, sizeof(m_scd) );
+ m_scd.SampleDesc.Count = 1;
+ m_scd.SampleDesc.Quality = 0;
+ setBufferSize(BGFX_DEFAULT_WIDTH, BGFX_DEFAULT_HEIGHT);
+ m_backBufferColor = (ID3D11RenderTargetView*)g_platformData.backBuffer;
+ m_backBufferDepthStencil = (ID3D11DepthStencilView*)g_platformData.backBufferDS;
+ }
}
m_numWindows = 1;
-#if !defined(__MINGW32__)
if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
{
hr = m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&m_infoQueue);
@@ -823,8 +1129,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
D3D11_MESSAGE_CATEGORY catlist[] =
{
- D3D11_MESSAGE_CATEGORY_STATE_SETTING,
- D3D11_MESSAGE_CATEGORY_EXECUTION,
+ D3D11_MESSAGE_CATEGORY_STATE_CREATION,
};
filter.DenyList.NumCategories = BX_COUNTOF(catlist);
filter.DenyList.pCategoryList = catlist;
@@ -832,249 +1137,337 @@ BX_PRAGMA_DIAGNOSTIC_POP();
DX_RELEASE(m_infoQueue, 3);
}
- else
- {
- // InfoQueue QueryInterface will fail when AMD GPU Perfstudio 2 is present.
- setGraphicsDebuggerPresent(true);
- }
}
-#endif // __MINGW__
-
- UniformHandle handle = BGFX_INVALID_HANDLE;
- for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii)
- {
- m_uniformReg.add(handle, getPredefinedUniformName(PredefinedUniform::Enum(ii) ), &m_predefinedUniforms[ii]);
- }
-
- g_caps.supported |= (0
- | BGFX_CAPS_TEXTURE_3D
- | BGFX_CAPS_VERTEX_ATTRIB_HALF
- | BGFX_CAPS_FRAGMENT_DEPTH
- | (getIntelExtensions(m_device) ? BGFX_CAPS_FRAGMENT_ORDERING : 0)
- | BGFX_CAPS_SWAP_CHAIN
- | (m_ovr.isInitialized() ? BGFX_CAPS_HMD : 0)
- | BGFX_CAPS_DRAW_INDIRECT
- );
- if (m_featureLevel <= D3D_FEATURE_LEVEL_9_2)
- {
- g_caps.maxTextureSize = D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
- g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS));
- }
- else if (m_featureLevel == D3D_FEATURE_LEVEL_9_3)
- {
- g_caps.maxTextureSize = D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION;
- g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
- }
- else
{
- g_caps.supported |= BGFX_CAPS_TEXTURE_COMPARE_ALL;
- g_caps.maxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
- g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
- }
- // 32-bit indices only supported on 9_2+.
- if (m_featureLevel >= D3D_FEATURE_LEVEL_9_2)
- {
- g_caps.supported |= BGFX_CAPS_INDEX32;
- }
+ UniformHandle handle = BGFX_INVALID_HANDLE;
+ for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii)
+ {
+ m_uniformReg.add(handle, getPredefinedUniformName(PredefinedUniform::Enum(ii) ), &m_predefinedUniforms[ii]);
+ }
- // Independent blend only supported on 10_1+.
- if (m_featureLevel >= D3D_FEATURE_LEVEL_10_1)
- {
- g_caps.supported |= BGFX_CAPS_BLEND_INDEPENDENT;
- }
+ g_caps.supported |= (0
+ | BGFX_CAPS_TEXTURE_3D
+ | BGFX_CAPS_VERTEX_ATTRIB_HALF
+ | BGFX_CAPS_VERTEX_ATTRIB_UINT10
+ | BGFX_CAPS_FRAGMENT_DEPTH
+ | (getIntelExtensions(m_device) ? BGFX_CAPS_FRAGMENT_ORDERING : 0)
+ | BGFX_CAPS_SWAP_CHAIN
+ | (m_ovr.isInitialized() ? BGFX_CAPS_HMD : 0)
+ | BGFX_CAPS_DRAW_INDIRECT
+ );
- // Compute support is optional on 10_0 and 10_1 targets.
- if (m_featureLevel == D3D_FEATURE_LEVEL_10_0
- || m_featureLevel == D3D_FEATURE_LEVEL_10_1)
- {
- struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
+ if (m_featureLevel <= D3D_FEATURE_LEVEL_9_2)
{
- BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
- };
-
- D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS data;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &data, sizeof(data) );
- if (SUCCEEDED(hr)
- && data.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x)
+ g_caps.maxTextureSize = D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
+ }
+ else if (m_featureLevel == D3D_FEATURE_LEVEL_9_3)
{
- g_caps.supported |= BGFX_CAPS_COMPUTE;
+ g_caps.maxTextureSize = D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
+ }
+ else
+ {
+ g_caps.supported |= BGFX_CAPS_TEXTURE_COMPARE_ALL;
+ g_caps.maxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
}
- }
- else if (m_featureLevel >= D3D_FEATURE_LEVEL_11_0)
- {
- g_caps.supported |= BGFX_CAPS_COMPUTE;
- }
- // Instancing fully supported on 9_3+, optionally partially supported at lower levels.
- if (m_featureLevel >= D3D_FEATURE_LEVEL_9_3)
- {
- g_caps.supported |= BGFX_CAPS_INSTANCING;
- }
- else
- {
- struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT
+ // 32-bit indices only supported on 9_2+.
+ if (m_featureLevel >= D3D_FEATURE_LEVEL_9_2)
{
- BOOL SimpleInstancingSupported;
- };
+ g_caps.supported |= BGFX_CAPS_INDEX32;
+ }
- D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT data;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE(11) /*D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT*/, &data, sizeof(data) );
- if (SUCCEEDED(hr)
- && data.SimpleInstancingSupported)
+ // Independent blend only supported on 10_1+.
+ if (m_featureLevel >= D3D_FEATURE_LEVEL_10_1)
{
- g_caps.supported |= BGFX_CAPS_INSTANCING;
+ g_caps.supported |= BGFX_CAPS_BLEND_INDEPENDENT;
}
- }
- // shadow compare is optional on 9_1 through 9_3 targets
- if (m_featureLevel <= D3D_FEATURE_LEVEL_9_3)
- {
- struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT
+ // Compute support is optional on 10_0 and 10_1 targets.
+ if (m_featureLevel == D3D_FEATURE_LEVEL_10_0
+ || m_featureLevel == D3D_FEATURE_LEVEL_10_1)
{
- BOOL SupportsDepthAsTextureWithLessEqualComparisonFilter;
- };
+ struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
+ {
+ BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
+ };
- D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT data;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE(9) /*D3D11_FEATURE_D3D9_SHADOW_SUPPORT*/, &data, sizeof(data) );
- if (SUCCEEDED(hr)
- && data.SupportsDepthAsTextureWithLessEqualComparisonFilter)
+ D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS data;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &data, sizeof(data) );
+ if (SUCCEEDED(hr)
+ && data.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x)
+ {
+ g_caps.supported |= BGFX_CAPS_COMPUTE;
+ }
+ }
+ else if (m_featureLevel >= D3D_FEATURE_LEVEL_11_0)
{
- g_caps.supported |= BGFX_CAPS_TEXTURE_COMPARE_LEQUAL;
+ g_caps.supported |= BGFX_CAPS_COMPUTE;
}
- }
- for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
- {
- uint8_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE;
+ // Instancing fully supported on 9_3+, optionally partially supported at lower levels.
+ if (m_featureLevel >= D3D_FEATURE_LEVEL_9_3)
+ {
+ g_caps.supported |= BGFX_CAPS_INSTANCING;
+ }
+ else
+ {
+ struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT
+ {
+ BOOL SimpleInstancingSupported;
+ };
- const DXGI_FORMAT fmt = isDepth(TextureFormat::Enum(ii) )
- ? s_textureFormat[ii].m_fmtDsv
- : s_textureFormat[ii].m_fmt
- ;
- const DXGI_FORMAT fmtSrgb = s_textureFormat[ii].m_fmtSrgb;
+ D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT data;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE(11) /*D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT*/, &data, sizeof(data) );
+ if (SUCCEEDED(hr)
+ && data.SimpleInstancingSupported)
+ {
+ g_caps.supported |= BGFX_CAPS_INSTANCING;
+ }
+ }
- if (DXGI_FORMAT_UNKNOWN != fmt)
+ // shadow compare is optional on 9_1 through 9_3 targets
+ if (m_featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
- struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
+ struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT
{
- DXGI_FORMAT InFormat;
- UINT OutFormatSupport;
+ BOOL SupportsDepthAsTextureWithLessEqualComparisonFilter;
};
- D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2
- data.InFormat = fmt;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
- if (SUCCEEDED(hr) )
+ D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT data;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE(9) /*D3D11_FEATURE_D3D9_SHADOW_SUPPORT*/, &data, sizeof(data) );
+ if (SUCCEEDED(hr)
+ && data.SupportsDepthAsTextureWithLessEqualComparisonFilter)
{
- support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT_TEXTURE2D
- | D3D11_FORMAT_SUPPORT_TEXTURE3D
- | D3D11_FORMAT_SUPPORT_TEXTURECUBE
- ) )
- ? BGFX_CAPS_FORMAT_TEXTURE_COLOR
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
+ g_caps.supported |= BGFX_CAPS_TEXTURE_COMPARE_LEQUAL;
+ }
+ }
- support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT_BUFFER
- | D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER
- | D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER
- ) )
- ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
+ for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+ {
+ uint8_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE;
- support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT_SHADER_LOAD
- ) )
- ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
+ const DXGI_FORMAT fmt = isDepth(TextureFormat::Enum(ii) )
+ ? s_textureFormat[ii].m_fmtDsv
+ : s_textureFormat[ii].m_fmt
+ ;
+ const DXGI_FORMAT fmtSrgb = s_textureFormat[ii].m_fmtSrgb;
- support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT_RENDER_TARGET
- | D3D11_FORMAT_SUPPORT_DEPTH_STENCIL
- ) )
- ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
- }
- else
+ if (DXGI_FORMAT_UNKNOWN != fmt)
{
- BX_TRACE("CheckFeatureSupport failed with %x for format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
+ {
+ DXGI_FORMAT InFormat;
+ UINT OutFormatSupport;
+ };
+
+ D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2
+ data.InFormat = fmt;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
+ if (SUCCEEDED(hr) )
+ {
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_TEXTURE2D
+ | D3D11_FORMAT_SUPPORT_TEXTURE3D
+ | D3D11_FORMAT_SUPPORT_TEXTURECUBE
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_COLOR
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_BUFFER
+ | D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER
+ | D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_SHADER_LOAD
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_RENDER_TARGET
+ | D3D11_FORMAT_SUPPORT_DEPTH_STENCIL
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+ else
+ {
+ BX_TRACE("CheckFeatureSupport failed with %x for format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ }
+
+ if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_IMAGE) )
+ {
+ // clear image flag for additional testing
+ support &= ~BGFX_CAPS_FORMAT_TEXTURE_IMAGE;
+
+ data.InFormat = s_textureFormat[ii].m_fmt;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT2, &data, sizeof(data) );
+ if (SUCCEEDED(hr) )
+ {
+ support |= 0 != (data.OutFormatSupport & (0
+ | D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD
+ | D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+ }
}
- if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_IMAGE) )
+ if (DXGI_FORMAT_UNKNOWN != fmtSrgb)
{
- // clear image flag for additional testing
- support &= ~BGFX_CAPS_FORMAT_TEXTURE_IMAGE;
+ struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
+ {
+ DXGI_FORMAT InFormat;
+ UINT OutFormatSupport;
+ };
- data.InFormat = s_textureFormat[ii].m_fmt;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT2, &data, sizeof(data) );
+ D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2
+ data.InFormat = fmtSrgb;
+ hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
if (SUCCEEDED(hr) )
{
support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD
- | D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE
+ | D3D11_FORMAT_SUPPORT_TEXTURE2D
+ | D3D11_FORMAT_SUPPORT_TEXTURE3D
+ | D3D11_FORMAT_SUPPORT_TEXTURECUBE
) )
- ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
+ ? BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB
: BGFX_CAPS_FORMAT_TEXTURE_NONE
;
}
+ else
+ {
+ BX_TRACE("CheckFeatureSupport failed with %x for sRGB format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ }
}
+
+ g_caps.formats[ii] = support;
}
- if (DXGI_FORMAT_UNKNOWN != fmtSrgb)
+ // Init reserved part of view name.
+ for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
{
- struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
- {
- DXGI_FORMAT InFormat;
- UINT OutFormatSupport;
- };
+ char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
+ bx::snprintf(name, sizeof(name), "%3d ", ii);
+ mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED);
+ }
- D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2
- data.InFormat = fmtSrgb;
- hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
- if (SUCCEEDED(hr) )
- {
- support |= 0 != (data.OutFormatSupport & (0
- | D3D11_FORMAT_SUPPORT_TEXTURE2D
- | D3D11_FORMAT_SUPPORT_TEXTURE3D
- | D3D11_FORMAT_SUPPORT_TEXTURECUBE
- ) )
- ? BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB
- : BGFX_CAPS_FORMAT_TEXTURE_NONE
- ;
- }
- else
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG)
+ && NULL != m_infoQueue)
+ {
+ m_infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true);
+ }
+
+ { //
+ multiDrawInstancedIndirect = stubMultiDrawInstancedIndirect;
+ multiDrawIndexedInstancedIndirect = stubMultiDrawIndexedInstancedIndirect;
+ if (NULL != m_ags)
{
- BX_TRACE("CheckFeatureSupport failed with %x for sRGB format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ uint32_t flags;
+ AGS_RETURN_CODE result = agsDriverExtensions_Init(m_ags, m_device, &flags);
+ bool hasExtensions = AGS_SUCCESS == result;
+
+ if (hasExtensions
+ && 0 != (flags & AGS_EXTENSION_MULTIDRAWINDIRECT) )
+ {
+ multiDrawInstancedIndirect = amdAgsMultiDrawInstancedIndirect;
+ multiDrawIndexedInstancedIndirect = amdAgsMultiDrawIndexedInstancedIndirect;
+ }
+ else
+ {
+ if (hasExtensions)
+ {
+ agsDriverExtensions_DeInit(m_ags);
+ }
+
+ agsDeInit(m_ags);
+ m_ags = NULL;
+ }
}
}
- g_caps.formats[ii] = support;
+ //
+ updateMsaa();
+ postReset();
}
- // Init reserved part of view name.
- for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
- {
- char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
- bx::snprintf(name, sizeof(name), "%3d ", ii);
- mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED);
- }
+ return true;
-#if !defined(__MINGW32__)
- if (BX_ENABLED(BGFX_CONFIG_DEBUG)
- && NULL != m_infoQueue)
+ error:
+ switch (errorState)
{
- m_infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true);
+ case ErrorState::CreatedDXGIFactory:
+ DX_RELEASE(m_swapChain, 0);
+ DX_RELEASE(m_deviceCtx, 0);
+ DX_RELEASE(m_device, 0);
+ DX_RELEASE(m_factory, 0);
+
+ case ErrorState::LoadedDXGI:
+#if USE_D3D11_DYNAMIC_LIB
+ if (NULL != m_dxgidebugdll)
+ {
+ bx::dlclose(m_dxgidebugdll);
+ m_dxgidebugdll = NULL;
+ }
+
+ if (NULL != m_d3d9dll)
+ {
+ bx::dlclose(m_d3d9dll);
+ m_d3d9dll = NULL;
+ }
+
+ bx::dlclose(m_dxgidll);
+ m_dxgidll = NULL;
+#endif // USE_D3D11_DYNAMIC_LIB
+
+ case ErrorState::LoadedD3D11:
+#if USE_D3D11_DYNAMIC_LIB
+ bx::dlclose(m_d3d11dll);
+ m_d3d11dll = NULL;
+#endif // USE_D3D11_DYNAMIC_LIB
+
+ case ErrorState::Default:
+ if (NULL != m_ags)
+ {
+ agsDeInit(m_ags);
+ }
+ bx::dlclose(m_agsdll);
+ m_agsdll = NULL;
+ unloadRenderDoc(m_renderdocdll);
+ m_ovr.shutdown();
+ break;
}
-#endif // !defined(__MINGW32__)
- updateMsaa();
- postReset();
+ return false;
}
void shutdown()
@@ -1082,10 +1475,24 @@ BX_PRAGMA_DIAGNOSTIC_POP();
preReset();
m_ovr.shutdown();
+ if (NULL != m_ags)
+ {
+ agsDeInit(m_ags);
+ m_ags = NULL;
+ }
+
+ bx::dlclose(m_agsdll);
+ m_agsdll = NULL;
+
m_deviceCtx->ClearState();
invalidateCache();
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii)
+ {
+ m_frameBuffers[ii].destroy();
+ }
+
for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii)
{
m_indexBuffers[ii].destroy();
@@ -1108,15 +1515,29 @@ BX_PRAGMA_DIAGNOSTIC_POP();
DX_RELEASE(m_swapChain, 0);
DX_RELEASE(m_deviceCtx, 0);
- DX_RELEASE(m_factory, 0);
DX_RELEASE(m_device, 0);
+ DX_RELEASE(m_factory, 0);
unloadRenderDoc(m_renderdocdll);
#if USE_D3D11_DYNAMIC_LIB
+ if (NULL != m_dxgidebugdll)
+ {
+ bx::dlclose(m_dxgidebugdll);
+ m_dxgidebugdll = NULL;
+ }
+
+ if (NULL != m_d3d9dll)
+ {
+ bx::dlclose(m_d3d9dll);
+ m_d3d9dll = NULL;
+ }
+
bx::dlclose(m_dxgidll);
- bx::dlclose(m_d3d9dll);
+ m_dxgidll = NULL;
+
bx::dlclose(m_d3d11dll);
+ m_d3d11dll = NULL;
#endif // USE_D3D11_DYNAMIC_LIB
}
@@ -1320,7 +1741,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
ID3D11Texture2D* backBuffer;
- DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+ DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
D3D11_TEXTURE2D_DESC backBufferDesc;
backBuffer->GetDesc(&backBufferDesc);
@@ -1460,14 +1881,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
float proj[16];
bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
- prepareShaderConstants();
-
PredefinedUniform& predefined = program.m_predefined[0];
uint8_t flags = predefined.m_type;
setShaderUniform(flags, predefined.m_loc, proj, 4);
commitShaderConstants();
- m_textures[_blitter.m_texture.idx].commit(0);
+ m_textures[_blitter.m_texture.idx].commit(0, BGFX_SAMPLER_DEFAULT_FLAGS, NULL);
commitTextureStage();
}
@@ -1517,7 +1936,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (NULL != m_swapChain)
{
ID3D11Texture2D* color;
- DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&color));
+ DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&color) );
D3D11_RENDER_TARGET_VIEW_DESC desc;
desc.ViewDimension = (m_flags & BGFX_RESET_MSAA_MASK)
@@ -1587,10 +2006,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (NULL != m_swapChain)
{
HRESULT hr = S_OK;
- uint32_t syncInterval = !!(m_flags & BGFX_RESET_VSYNC);
-#if BX_PLATFORM_WINRT
- syncInterval = 1; // sync interval of 0 is not supported on WinRT
-#endif
+ uint32_t syncInterval = BX_ENABLED(BX_PLATFORM_WINRT)
+ ? 1 // sync interval of 0 is not supported on WinRT
+ : !!(m_flags & BGFX_RESET_VSYNC)
+ ;
for (uint32_t ii = 1, num = m_numWindows; ii < num && SUCCEEDED(hr); ++ii)
{
@@ -1625,6 +2044,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_depthStencilStateCache.invalidate();
m_rasterizerStateCache.invalidate();
m_samplerStateCache.invalidate();
+ m_srvUavLru.invalidate();
}
void invalidateCompute()
@@ -1670,9 +2090,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (!!(_resolution.m_flags & BGFX_RESET_MAXANISOTROPY) )
{
m_maxAnisotropy = (m_featureLevel == D3D_FEATURE_LEVEL_9_1)
- ? D3D_FL9_1_DEFAULT_MAX_ANISOTROPY
- : D3D11_REQ_MAXANISOTROPY
- ;
+ ? D3D_FL9_1_DEFAULT_MAX_ANISOTROPY
+ : D3D11_REQ_MAXANISOTROPY
+ ;
}
else
{
@@ -1716,7 +2136,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
, getBufferHeight()
, getBufferFormat()
, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
- ));
+ ) );
}
else
{
@@ -1725,20 +2145,58 @@ BX_PRAGMA_DIAGNOSTIC_POP();
DX_RELEASE(m_swapChain, 0);
+ SwapChainDesc* scd = &m_scd;
+ SwapChainDesc swapChainScd;
+ if (0 != (m_flags & BGFX_RESET_HMD)
+ && m_ovr.isInitialized() )
+ {
+ swapChainScd = m_scd;
+ swapChainScd.SampleDesc = s_msaa[0];
+ scd = &swapChainScd;
+ }
+
#if BX_PLATFORM_WINRT
HRESULT hr;
- hr = m_factory->CreateSwapChainForCoreWindow(m_device
- , (::IUnknown*)g_platformData.nwh
- , &m_scd
- , NULL
- , &m_swapChain
- );
+ if (g_platformData.ndt == 0)
+ {
+ hr = m_factory->CreateSwapChainForCoreWindow(m_device
+ , (::IUnknown*)g_platformData.nwh
+ , scd
+ , NULL
+ , &m_swapChain
+ );
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 swap chain.");
+ }
+ else
+ {
+ BGFX_FATAL(g_platformData.ndt == reinterpret_cast<void*>(1), Fatal::UnableToInitialize, "Invalid native display type.");
+
+ hr = m_factory->CreateSwapChainForComposition(m_device
+ , &m_scd
+ , NULL
+ , &m_swapChain
+ );
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 swap chain.");
+
+ IInspectable *nativeWindow = reinterpret_cast<IInspectable *>(g_platformData.nwh);
+ ISwapChainBackgroundPanelNative* panel = NULL;
+ hr = nativeWindow->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&panel);
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
+
+ if (NULL != panel)
+ {
+ hr = panel->SetSwapChain(m_swapChain);
+ BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to set swap chain on panel.");
+
+ panel->Release();
+ }
+ }
#else
HRESULT hr;
hr = m_factory->CreateSwapChain(m_device
- , &m_scd
- , &m_swapChain
- );
+ , scd
+ , &m_swapChain
+ );
#endif // BX_PLATFORM_WINRT
BGFX_FATAL(SUCCEEDED(hr), bgfx::Fatal::UnableToInitialize, "Failed to create swap chain.");
}
@@ -1758,16 +2216,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (_flags&BGFX_UNIFORM_FRAGMENTBIT)
{
memcpy(&m_fsScratch[_regIndex], _val, _numRegs*16);
-#if !BGFX_D3D11_MAP_CONSTANT_BUFFERS
m_fsChanges += _numRegs;
-#endif
}
else
{
memcpy(&m_vsScratch[_regIndex], _val, _numRegs*16);
-#if !BGFX_D3D11_MAP_CONSTANT_BUFFERS
m_vsChanges += _numRegs;
-#endif
}
}
@@ -1781,37 +2235,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
setShaderUniform(_flags, _regIndex, _val, _numRegs);
}
- void prepareShaderConstants()
- {
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- if (NULL != m_currentProgram->m_vsh->m_buffer)
- {
- D3D11_MAPPED_SUBRESOURCE mapped;
- DX_CHECK(m_deviceCtx->Map(m_currentProgram->m_vsh->m_buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped));
- m_vsScratch = (uint8_t*)mapped.pData;
- }
- if (NULL != m_currentProgram->m_fsh->m_buffer)
- {
- D3D11_MAPPED_SUBRESOURCE mapped;
- DX_CHECK(m_deviceCtx->Map(m_currentProgram->m_fsh->m_buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped));
- m_fsScratch = (uint8_t*)mapped.pData;
- }
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
- }
-
void commitShaderConstants()
{
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- if (NULL != m_vsScratch)
- {
- m_deviceCtx->Unmap(m_currentProgram->m_vsh->m_buffer, 0);
- }
- if (NULL != m_fsScratch)
- {
- m_deviceCtx->Unmap(m_currentProgram->m_fsh->m_buffer, 0);
- }
- m_vsScratch = m_fsScratch = 0;
-#else
if (0 < m_vsChanges)
{
if (NULL != m_currentProgram->m_vsh->m_buffer)
@@ -1831,7 +2256,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_fsChanges = 0;
}
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
}
void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true)
@@ -1921,13 +2345,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
VertexDecl decl;
memcpy(&decl, &_vertexDecl, sizeof(VertexDecl) );
- const uint8_t* attrMask = _program.m_vsh->m_attrMask;
+ const uint16_t* attrMask = _program.m_vsh->m_attrMask;
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
{
- uint8_t mask = attrMask[ii];
- uint8_t attr = (decl.m_attributes[ii] & mask);
- decl.m_attributes[ii] = attr == 0 ? 0xff : attr == 0xff ? 0 : attr;
+ uint16_t mask = attrMask[ii];
+ uint16_t attr = (decl.m_attributes[ii] & mask);
+ decl.m_attributes[ii] = attr == 0 ? UINT16_MAX : attr == UINT16_MAX ? 0 : attr;
}
D3D11_INPUT_ELEMENT_DESC* elem = fillVertexDecl(vertexElements, decl);
@@ -1978,13 +2402,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void setBlendState(uint64_t _state, uint32_t _rgba = 0)
{
- _state &= 0
- | BGFX_STATE_BLEND_MASK
- | BGFX_STATE_BLEND_EQUATION_MASK
- | BGFX_STATE_BLEND_INDEPENDENT
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_RGB_WRITE
- ;
+ _state &= BGFX_D3D11_BLEND_STATE_MASK;
bx::HashMurmur2A murmur;
murmur.begin();
@@ -2024,13 +2442,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
const uint32_t blend = uint32_t( (_state&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT);
const uint32_t equation = uint32_t( (_state&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
- const uint32_t srcRGB = (blend )&0xf;
- const uint32_t dstRGB = (blend>> 4)&0xf;
- const uint32_t srcA = (blend>> 8)&0xf;
- const uint32_t dstA = (blend>>12)&0xf;
+ const uint32_t srcRGB = (blend ) & 0xf;
+ const uint32_t dstRGB = (blend >> 4) & 0xf;
+ const uint32_t srcA = (blend >> 8) & 0xf;
+ const uint32_t dstA = (blend >> 12) & 0xf;
- const uint32_t equRGB = (equation )&0x7;
- const uint32_t equA = (equation>>3)&0x7;
+ const uint32_t equRGB = (equation ) & 0x7;
+ const uint32_t equA = (equation >> 3) & 0x7;
drt->SrcBlend = s_blendFactor[srcRGB][0];
drt->DestBlend = s_blendFactor[dstRGB][0];
@@ -2040,8 +2458,16 @@ BX_PRAGMA_DIAGNOSTIC_POP();
drt->DestBlendAlpha = s_blendFactor[dstA][1];
drt->BlendOpAlpha = s_blendEquation[equA];
- uint8_t writeMask = (_state&BGFX_STATE_ALPHA_WRITE) ? D3D11_COLOR_WRITE_ENABLE_ALPHA : 0;
- writeMask |= (_state&BGFX_STATE_RGB_WRITE) ? D3D11_COLOR_WRITE_ENABLE_RED|D3D11_COLOR_WRITE_ENABLE_GREEN|D3D11_COLOR_WRITE_ENABLE_BLUE : 0;
+ uint8_t writeMask = (_state&BGFX_STATE_ALPHA_WRITE)
+ ? D3D11_COLOR_WRITE_ENABLE_ALPHA
+ : 0
+ ;
+ writeMask |= (_state&BGFX_STATE_RGB_WRITE)
+ ? D3D11_COLOR_WRITE_ENABLE_RED
+ | D3D11_COLOR_WRITE_ENABLE_GREEN
+ | D3D11_COLOR_WRITE_ENABLE_BLUE
+ : 0
+ ;
drt->RenderTargetWriteMask = writeMask;
@@ -2050,19 +2476,19 @@ BX_PRAGMA_DIAGNOSTIC_POP();
for (uint32_t ii = 1, rgba = _rgba; ii < BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; ++ii, rgba >>= 11)
{
drt = &desc.RenderTarget[ii];
- drt->BlendEnable = 0 != (rgba&0x7ff);
+ drt->BlendEnable = 0 != (rgba & 0x7ff);
- const uint32_t src = (rgba )&0xf;
- const uint32_t dst = (rgba>>4)&0xf;
- const uint32_t equationIndex = (rgba>>8)&0x7;
+ const uint32_t src = (rgba ) & 0xf;
+ const uint32_t dst = (rgba >> 4) & 0xf;
+ const uint32_t equ = (rgba >> 8) & 0x7;
drt->SrcBlend = s_blendFactor[src][0];
drt->DestBlend = s_blendFactor[dst][0];
- drt->BlendOp = s_blendEquation[equationIndex];
+ drt->BlendOp = s_blendEquation[equ];
drt->SrcBlendAlpha = s_blendFactor[src][1];
drt->DestBlendAlpha = s_blendFactor[dst][1];
- drt->BlendOpAlpha = s_blendEquation[equationIndex];
+ drt->BlendOpAlpha = s_blendEquation[equ];
drt->RenderTargetWriteMask = writeMask;
}
@@ -2085,7 +2511,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void setDepthStencilState(uint64_t _state, uint64_t _stencil = 0)
{
- _state &= BGFX_STATE_DEPTH_WRITE|BGFX_STATE_DEPTH_TEST_MASK;
+ _state &= BGFX_D3D11_DEPTH_STENCIL_MASK;
uint32_t fstencil = unpackStencil(0, _stencil);
uint32_t ref = (fstencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
@@ -2144,7 +2570,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
_state &= BGFX_STATE_CULL_MASK|BGFX_STATE_MSAA;
_state |= _wireframe ? BGFX_STATE_PT_LINES : BGFX_STATE_NONE;
- _state |= _scissor ? BGFX_STATE_RESERVED_MASK : 0;
+ _state |= _scissor ? BGFX_STATE_RESERVED_MASK : 0;
ID3D11RasterizerState* rs = m_rasterizerStateCache.find(_state);
if (NULL == rs)
@@ -2171,37 +2597,74 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_deviceCtx->RSSetState(rs);
}
- ID3D11SamplerState* getSamplerState(uint32_t _flags)
+ ID3D11SamplerState* getSamplerState(uint32_t _flags, const float _rgba[4])
{
+ const uint32_t index = (_flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
_flags &= BGFX_TEXTURE_SAMPLER_BITS_MASK;
- ID3D11SamplerState* sampler = m_samplerStateCache.find(_flags);
+
+ uint32_t hash;
+ ID3D11SamplerState* sampler;
+ if (!needBorderColor(_flags) )
+ {
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_flags);
+ murmur.add(-1);
+ hash = murmur.end();
+ _rgba = s_zero.m_zerof;
+
+ sampler = m_samplerStateCache.find(hash);
+ }
+ else
+ {
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_flags);
+ murmur.add(index);
+ hash = murmur.end();
+ _rgba = NULL == _rgba ? s_zero.m_zerof : _rgba;
+
+ sampler = m_samplerStateCache.find(hash);
+ if (NULL != sampler)
+ {
+ D3D11_SAMPLER_DESC sd;
+ sampler->GetDesc(&sd);
+ if (0 != memcmp(_rgba, sd.BorderColor, 16) )
+ {
+ // Sampler will be released when updated sampler
+ // is added to cache.
+ sampler = NULL;
+ }
+ }
+ }
+
if (NULL == sampler)
{
- const uint32_t cmpFunc = (_flags&BGFX_TEXTURE_COMPARE_MASK)>>BGFX_TEXTURE_COMPARE_SHIFT;
- const uint8_t minFilter = s_textureFilter[0][(_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT];
- const uint8_t magFilter = s_textureFilter[1][(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
- const uint8_t mipFilter = s_textureFilter[2][(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
- const uint8_t filter = 0 == cmpFunc ? 0 : D3D11_COMPARISON_FILTERING_BIT;
+ const uint32_t cmpFunc = (_flags&BGFX_TEXTURE_COMPARE_MASK)>>BGFX_TEXTURE_COMPARE_SHIFT;
+ const uint8_t minFilter = s_textureFilter[0][(_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT];
+ const uint8_t magFilter = s_textureFilter[1][(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
+ const uint8_t mipFilter = s_textureFilter[2][(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
+ const uint8_t filter = 0 == cmpFunc ? 0 : D3D11_COMPARISON_FILTERING_BIT;
D3D11_SAMPLER_DESC sd;
- sd.Filter = (D3D11_FILTER)(filter|minFilter|magFilter|mipFilter);
- sd.AddressU = s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
- sd.AddressV = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
- sd.AddressW = s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT];
- sd.MipLODBias = 0.0f;
+ sd.Filter = (D3D11_FILTER)(filter|minFilter|magFilter|mipFilter);
+ sd.AddressU = s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
+ sd.AddressV = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
+ sd.AddressW = s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT];
+ sd.MipLODBias = 0.0f;
sd.MaxAnisotropy = m_maxAnisotropy;
sd.ComparisonFunc = 0 == cmpFunc ? D3D11_COMPARISON_NEVER : s_cmpFunc[cmpFunc];
- sd.BorderColor[0] = 0.0f;
- sd.BorderColor[1] = 0.0f;
- sd.BorderColor[2] = 0.0f;
- sd.BorderColor[3] = 0.0f;
+ sd.BorderColor[0] = _rgba[0];
+ sd.BorderColor[1] = _rgba[1];
+ sd.BorderColor[2] = _rgba[2];
+ sd.BorderColor[3] = _rgba[3];
sd.MinLOD = 0;
sd.MaxLOD = D3D11_FLOAT32_MAX;
m_device->CreateSamplerState(&sd, &sampler);
DX_CHECK_REFCOUNT(sampler, 1);
- m_samplerStateCache.add(_flags, sampler);
+ m_samplerStateCache.add(hash, sampler);
}
return sampler;
@@ -2264,6 +2727,101 @@ BX_PRAGMA_DIAGNOSTIC_POP();
commitTextureStage();
}
+ ID3D11UnorderedAccessView* getCachedUav(TextureHandle _handle, uint8_t _mip)
+ {
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_handle);
+ murmur.add(_mip);
+ murmur.add(0);
+ uint32_t hash = murmur.end();
+
+ IUnknown** ptr = m_srvUavLru.find(hash);
+ ID3D11UnorderedAccessView* uav;
+ if (NULL == ptr)
+ {
+ TextureD3D11& texture = m_textures[_handle.idx];
+
+ D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
+ desc.Format = s_textureFormat[texture.m_textureFormat].m_fmtSrv;
+ switch (texture.m_type)
+ {
+ case TextureD3D11::Texture2D:
+ case TextureD3D11::TextureCube:
+ desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MipSlice = _mip;
+ break;
+
+ case TextureD3D11::Texture3D:
+ desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
+ desc.Texture3D.MipSlice = _mip;
+ desc.Texture3D.FirstWSlice = 0;
+ desc.Texture3D.WSize = UINT32_MAX;
+ break;
+ }
+
+ DX_CHECK(m_device->CreateUnorderedAccessView(texture.m_ptr, &desc, &uav) );
+
+ m_srvUavLru.add(hash, uav, _handle.idx);
+ }
+ else
+ {
+ uav = static_cast<ID3D11UnorderedAccessView*>(*ptr);
+ }
+
+ return uav;
+ }
+
+ ID3D11ShaderResourceView* getCachedSrv(TextureHandle _handle, uint8_t _mip)
+ {
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_handle);
+ murmur.add(_mip);
+ murmur.add(0);
+ uint32_t hash = murmur.end();
+
+ IUnknown** ptr = m_srvUavLru.find(hash);
+ ID3D11ShaderResourceView* srv;
+ if (NULL == ptr)
+ {
+ TextureD3D11& texture = m_textures[_handle.idx];
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC desc;
+ desc.Format = s_textureFormat[texture.m_textureFormat].m_fmtSrv;
+ switch (texture.m_type)
+ {
+ case TextureD3D11::Texture2D:
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MostDetailedMip = _mip;
+ desc.Texture2D.MipLevels = 1;
+ break;
+
+ case TextureD3D11::TextureCube:
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
+ desc.TextureCube.MostDetailedMip = _mip;
+ desc.TextureCube.MipLevels = 1;
+ break;
+
+ case TextureD3D11::Texture3D:
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
+ desc.Texture3D.MostDetailedMip = _mip;
+ desc.Texture3D.MipLevels = 1;
+ break;
+ }
+
+ DX_CHECK(m_device->CreateShaderResourceView(texture.m_ptr, &desc, &srv) );
+
+ m_srvUavLru.add(hash, srv, _handle.idx);
+ }
+ else
+ {
+ srv = static_cast<ID3D11ShaderResourceView*>(*ptr);
+ }
+
+ return srv;
+ }
+
void ovrPostReset()
{
#if BGFX_CONFIG_USE_OVR
@@ -2294,7 +2852,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bx::write(&writer, magic);
TextureCreate tc;
- tc.m_flags = BGFX_TEXTURE_RT;
+ tc.m_flags = BGFX_TEXTURE_RT|( ((m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);
tc.m_width = m_ovr.m_rtSize.w;
tc.m_height = m_ovr.m_rtSize.h;
tc.m_sides = 0;
@@ -2365,7 +2923,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (m_flags&BGFX_RESET_CAPTURE)
{
ID3D11Texture2D* backBuffer;
- DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+ DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
D3D11_TEXTURE2D_DESC backBufferDesc;
backBuffer->GetDesc(&backBufferDesc);
@@ -2411,7 +2969,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (NULL != m_captureTexture)
{
ID3D11Texture2D* backBuffer;
- DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+ DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
if (NULL == m_captureResolve)
{
@@ -2419,7 +2977,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
else
{
- m_deviceCtx->ResolveSubresource(m_captureResolve, 0, backBuffer, 0, getBufferFormat());
+ m_deviceCtx->ResolveSubresource(m_captureResolve, 0, backBuffer, 0, getBufferFormat() );
m_deviceCtx->CopyResource(m_captureTexture, m_captureResolve);
}
@@ -2434,13 +2992,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
}
- void commit(ConstantBuffer& _constantBuffer)
+ void commit(UniformBuffer& _uniformBuffer)
{
- _constantBuffer.reset();
+ _uniformBuffer.reset();
for (;;)
{
- uint32_t opcode = _constantBuffer.read();
+ uint32_t opcode = _uniformBuffer.read();
if (UniformType::End == opcode)
{
@@ -2451,17 +3009,17 @@ BX_PRAGMA_DIAGNOSTIC_POP();
uint16_t loc;
uint16_t num;
uint16_t copy;
- ConstantBuffer::decodeOpcode(opcode, type, loc, num, copy);
+ UniformBuffer::decodeOpcode(opcode, type, loc, num, copy);
const char* data;
if (copy)
{
- data = _constantBuffer.read(g_uniformTypeSize[type]*num);
+ data = _uniformBuffer.read(g_uniformTypeSize[type]*num);
}
else
{
UniformHandle handle;
- memcpy(&handle, _constantBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
+ memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
data = (const char*)m_uniforms[handle.idx];
}
@@ -2475,8 +3033,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
switch ( (uint32_t)type)
{
- case UniformType::Uniform3x3fv:
- case UniformType::Uniform3x3fv|BGFX_UNIFORM_FRAGMENTBIT: \
+ case UniformType::Mat3:
+ case UniformType::Mat3|BGFX_UNIFORM_FRAGMENTBIT: \
{
float* value = (float*)data;
for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9)
@@ -2499,32 +3057,37 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
break;
- CASE_IMPLEMENT_UNIFORM(Uniform1i, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1f, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform1iv, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform2fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform3fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform4fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform4x4fv, F, float);
+ CASE_IMPLEMENT_UNIFORM(Int1, I, int);
+ CASE_IMPLEMENT_UNIFORM(Vec4, F, float);
+ CASE_IMPLEMENT_UNIFORM(Mat4, F, float);
case UniformType::End:
break;
default:
- BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _constantBuffer.getPos(), opcode, type, loc, num, copy);
+ BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy);
break;
}
-
#undef CASE_IMPLEMENT_UNIFORM
-
}
}
void clearQuad(ClearQuad& _clearQuad, const Rect& _rect, const Clear& _clear, const float _palette[][4])
{
- uint32_t width = getBufferWidth();
- uint32_t height = getBufferHeight();
+ uint32_t width;
+ uint32_t height;
+
+ if (isValid(m_fbh) )
+ {
+ const FrameBufferD3D11& fb = m_frameBuffers[m_fbh.idx];
+ width = fb.m_width;
+ height = fb.m_height;
+ }
+ else
+ {
+ width = getBufferWidth();
+ height = getBufferHeight();
+ }
if (0 == _rect.m_x
&& 0 == _rect.m_y
@@ -2567,33 +3130,23 @@ BX_PRAGMA_DIAGNOSTIC_POP();
ProgramD3D11& program = m_program[_clearQuad.m_program[numMrt-1].idx];
m_currentProgram = &program;
deviceCtx->VSSetShader(program.m_vsh->m_vertexShader, NULL, 0);
- deviceCtx->VSSetConstantBuffers(0, 0, NULL);
+ deviceCtx->VSSetConstantBuffers(0, 1, s_zero.m_buffer);
if (NULL != m_currentColor)
{
const ShaderD3D11* fsh = program.m_fsh;
deviceCtx->PSSetShader(fsh->m_pixelShader, NULL, 0);
deviceCtx->PSSetConstantBuffers(0, 1, &fsh->m_buffer);
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- D3D11_MAPPED_SUBRESOURCE mapped;
- DX_CHECK(deviceCtx->Map(fsh->m_buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped));
- void* fsScratch = mapped.pData;
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
-
if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
{
float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
for (uint32_t ii = 0; ii < numMrt; ++ii)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE-1, _clear.m_index[ii]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]);
memcpy(mrtClear[ii], _palette[index], 16);
}
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- memcpy(fsScratch, mrtClear, sizeof(mrtClear));
-#else
deviceCtx->UpdateSubresource(fsh->m_buffer, 0, 0, mrtClear, 0, 0);
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
}
else
{
@@ -2605,19 +3158,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
_clear.m_index[3]*1.0f/255.0f,
};
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- memcpy(fsScratch, rgba, sizeof(rgba));
-#else
deviceCtx->UpdateSubresource(fsh->m_buffer, 0, 0, rgba, 0, 0);
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
}
-
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- if (NULL != fsScratch)
- {
- deviceCtx->Unmap(fsh->m_buffer, 0);
- }
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
}
else
{
@@ -2671,8 +3213,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void* m_d3d9dll;
void* m_d3d11dll;
void* m_dxgidll;
+ void* m_dxgidebugdll;
void* m_renderdocdll;
+ void* m_agsdll;
+ AGSContext* m_ags;
+
D3D_DRIVER_TYPE m_driverType;
D3D_FEATURE_LEVEL m_featureLevel;
@@ -2707,10 +3253,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bool m_wireframe;
#if BX_PLATFORM_WINRT
- DXGI_SWAP_CHAIN_DESC1 m_scd;
+ typedef DXGI_SWAP_CHAIN_DESC1 SwapChainDesc;
#else
- DXGI_SWAP_CHAIN_DESC m_scd;
-#endif
+ typedef DXGI_SWAP_CHAIN_DESC SwapChainDesc;
+#endif // BX_PLATFORM_WINRT
+
+ SwapChainDesc m_scd;
uint32_t m_flags;
uint32_t m_maxAnisotropy;
@@ -2731,6 +3279,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
StateCacheT<ID3D11InputLayout> m_inputLayoutCache;
StateCacheT<ID3D11RasterizerState> m_rasterizerStateCache;
StateCacheT<ID3D11SamplerState> m_samplerStateCache;
+ StateCacheLru<IUnknown*, 1024> m_srvUavLru;
TextVideoMem m_textVideoMem;
@@ -2738,15 +3287,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
ProgramD3D11* m_currentProgram;
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- uint8_t* m_vsScratch;
- uint8_t* m_fsScratch;
-#else
uint8_t m_vsScratch[64<<10];
uint8_t m_fsScratch[64<<10];
uint32_t m_vsChanges;
uint32_t m_fsChanges;
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
FrameBufferHandle m_fbh;
bool m_rtMsaa;
@@ -2762,7 +3306,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
RendererContextI* rendererCreate()
{
s_renderD3D11 = BX_NEW(g_allocator, RendererContextD3D11);
- s_renderD3D11->init();
+ if (!s_renderD3D11->init() )
+ {
+ BX_DELETE(g_allocator, s_renderD3D11);
+ s_renderD3D11 = NULL;
+ }
return s_renderD3D11;
}
@@ -2773,6 +3321,55 @@ BX_PRAGMA_DIAGNOSTIC_POP();
s_renderD3D11 = NULL;
}
+ void trim()
+ {
+#if BX_PLATFORM_WINRT
+ if (NULL != s_renderD3D11)
+ {
+ if (s_renderD3D11->m_device)
+ {
+ IDXGIDevice3* pDXGIDevice;
+ HRESULT hr = s_renderD3D11->m_device->QueryInterface(__uuidof(IDXGIDevice3),(void **)&pDXGIDevice);
+ if (SUCCEEDED(hr) )
+ {
+ pDXGIDevice->Trim();
+ pDXGIDevice->Release();
+ }
+ }
+ }
+#endif // BX_PLATFORM_WINRT
+ }
+
+ void stubMultiDrawInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride)
+ {
+ ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
+ for (uint32_t ii = 0; ii < _numDrawIndirect; ++ii)
+ {
+ deviceCtx->DrawInstancedIndirect(_ptr, _offset);
+ _offset += _stride;
+ }
+ }
+
+ void stubMultiDrawIndexedInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride)
+ {
+ ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
+ for (uint32_t ii = 0; ii < _numDrawIndirect; ++ii)
+ {
+ deviceCtx->DrawIndexedInstancedIndirect(_ptr, _offset);
+ _offset += _stride;
+ }
+ }
+
+ void amdAgsMultiDrawInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride)
+ {
+ agsDriverExtensions_MultiDrawInstancedIndirect(s_renderD3D11->m_ags, _numDrawIndirect, _ptr, _offset, _stride);
+ }
+
+ void amdAgsMultiDrawIndexedInstancedIndirect(uint32_t _numDrawIndirect, ID3D11Buffer* _ptr, uint32_t _offset, uint32_t _stride)
+ {
+ agsDriverExtensions_MultiDrawIndexedInstancedIndirect(s_renderD3D11->m_ags, _numDrawIndirect, _ptr, _offset, _stride);
+ }
+
struct UavFormat
{
DXGI_FORMAT format[3];
@@ -2968,7 +3565,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
D3D11_MAPPED_SUBRESOURCE mapped;
BX_UNUSED(_discard);
D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
- DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped));
+ DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped) );
memcpy( (uint8_t*)mapped.pData + _offset, _data, _size);
deviceCtx->Unmap(m_ptr, 0);
#endif // 0
@@ -2985,6 +3582,42 @@ BX_PRAGMA_DIAGNOSTIC_POP();
BufferD3D11::create(_size, _data, _flags, stride, true);
}
+ static bool hasDepthOp(const void* _code, uint32_t _size)
+ {
+ bx::MemoryReader rd(_code, _size);
+
+ DxbcContext dxbc;
+ read(&rd, dxbc);
+
+ struct FindDepthOp
+ {
+ FindDepthOp()
+ : m_found(false)
+ {
+ }
+
+ static bool find(uint32_t /*_offset*/, const DxbcInstruction& _instruction, void* _userData)
+ {
+ FindDepthOp& out = *reinterpret_cast<FindDepthOp*>(_userData);
+ if (_instruction.opcode == DxbcOpcode::DISCARD
+ || (0 != _instruction.numOperands && DxbcOperandType::OutputDepth == _instruction.operand[0].type) )
+ {
+ out.m_found = true;
+ return false;
+ }
+
+ return true;
+ }
+
+ bool m_found;
+
+ } find;
+
+ parse(dxbc.shader, FindDepthOp::find, &find);
+
+ return find.m_found;
+ }
+
void ShaderD3D11::create(const Memory* _mem)
{
bx::MemoryReader reader(_mem->data, _mem->size);
@@ -3056,26 +3689,31 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit);
m_numPredefined++;
}
- else
+ else if (0 == (BGFX_UNIFORM_SAMPLERBIT & type) )
{
const UniformInfo* info = s_renderD3D11->m_uniformReg.find(name);
+ BX_CHECK(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
if (NULL != info)
{
if (NULL == m_constantBuffer)
{
- m_constantBuffer = ConstantBuffer::create(1024);
+ m_constantBuffer = UniformBuffer::create(1024);
}
kind = "user";
m_constantBuffer->writeUniformHandle( (UniformType::Enum)(type|fragmentBit), regIndex, info->m_handle, regCount);
}
}
+ else
+ {
+ kind = "sampler";
+ }
BX_TRACE("\t%s: %s (%s), num %2d, r.index %3d, r.count %2d"
, kind
, name
- , getUniformTypeName(UniformType::Enum(type&~BGFX_UNIFORM_FRAGMENTBIT) )
+ , getUniformTypeName(UniformType::Enum(type&~BGFX_UNIFORM_MASK) )
, num
, regIndex
, regCount
@@ -3097,6 +3735,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (BGFX_CHUNK_MAGIC_FSH == magic)
{
+ m_hasDepthOp = hasDepthOp(code, shaderSize);
DX_CHECK(s_renderD3D11->m_device->CreatePixelShader(code, shaderSize, NULL, &m_pixelShader) );
BGFX_FATAL(NULL != m_ptr, bgfx::Fatal::InvalidShader, "Failed to create fragment shader.");
}
@@ -3117,7 +3756,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
uint8_t numAttrs;
bx::read(&reader, numAttrs);
- memset(m_attrMask, 0, sizeof(m_attrMask));
+ memset(m_attrMask, 0, sizeof(m_attrMask) );
for (uint32_t ii = 0; ii < numAttrs; ++ii)
{
@@ -3128,7 +3767,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (Attrib::Count != attr)
{
- m_attrMask[attr] = 0xff;
+ m_attrMask[attr] = UINT16_MAX;
}
}
@@ -3139,13 +3778,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
D3D11_BUFFER_DESC desc;
desc.ByteWidth = (size + 0xf) & ~0xf;
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- desc.Usage = D3D11_USAGE_DYNAMIC;
- desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
-#else
desc.Usage = D3D11_USAGE_DEFAULT;
desc.CPUAccessFlags = 0;
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
desc.MiscFlags = 0;
desc.StructureByteStride = 0;
@@ -3155,8 +3789,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void TextureD3D11::create(const Memory* _mem, uint32_t _flags, uint8_t _skip)
{
- m_sampler = s_renderD3D11->getSamplerState(_flags);
-
ImageContainer imageContainer;
if (imageParse(imageContainer, _mem->data, _mem->size) )
@@ -3206,7 +3838,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
const bool swizzle = TextureFormat::BGRA8 == m_textureFormat && 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s%s."
- , this - s_renderD3D11->m_textures
+ , getHandle()
, getName( (TextureFormat::Enum)m_textureFormat)
, getName( (TextureFormat::Enum)m_requestedFormat)
, textureWidth
@@ -3403,6 +4035,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void TextureD3D11::destroy()
{
+ s_renderD3D11->m_srvUavLru.invalidateWithParent(getHandle().idx);
DX_RELEASE(m_srv, 0);
DX_RELEASE(m_uav, 0);
DX_RELEASE(m_ptr, 0);
@@ -3445,20 +4078,30 @@ BX_PRAGMA_DIAGNOSTIC_POP();
}
}
- void TextureD3D11::commit(uint8_t _stage, uint32_t _flags)
+ void TextureD3D11::commit(uint8_t _stage, uint32_t _flags, const float _palette[][4])
{
TextureStage& ts = s_renderD3D11->m_textureStage;
ts.m_srv[_stage] = m_srv;
- ts.m_sampler[_stage] = 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags)
- ? s_renderD3D11->getSamplerState(_flags)
- : m_sampler
+ uint32_t flags = 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags)
+ ? _flags
+ : m_flags
;
+ uint32_t index = (flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
+ ts.m_sampler[_stage] = s_renderD3D11->getSamplerState(flags
+ , _palette[index])
+ ;
}
void TextureD3D11::resolve()
{
}
+ TextureHandle TextureD3D11::getHandle() const
+ {
+ TextureHandle handle = { (uint16_t)(this - s_renderD3D11->m_textures) };
+ return handle;
+ }
+
void FrameBufferD3D11::create(uint8_t _num, const TextureHandle* _handles)
{
for (uint32_t ii = 0; ii < BX_COUNTOF(m_rtv); ++ii)
@@ -3476,38 +4119,59 @@ BX_PRAGMA_DIAGNOSTIC_POP();
void FrameBufferD3D11::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat)
{
- BX_UNUSED(_depthFormat);
-
DXGI_SWAP_CHAIN_DESC scd;
memcpy(&scd, &s_renderD3D11->m_scd, sizeof(DXGI_SWAP_CHAIN_DESC) );
scd.BufferDesc.Width = _width;
scd.BufferDesc.Height = _height;
scd.OutputWindow = (HWND)_nwh;
+ ID3D11Device* device = s_renderD3D11->m_device;
+
HRESULT hr;
- hr = s_renderD3D11->m_factory->CreateSwapChain(s_renderD3D11->m_device
+ hr = s_renderD3D11->m_factory->CreateSwapChain(device
, &scd
, &m_swapChain
);
BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
ID3D11Resource* ptr;
- DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&ptr));
- DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(ptr, NULL, &m_rtv[0]) );
+ DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&ptr) );
+ DX_CHECK(device->CreateRenderTargetView(ptr, NULL, &m_rtv[0]) );
DX_RELEASE(ptr, 0);
+
+ DXGI_FORMAT fmtDsv = isDepth(_depthFormat)
+ ? s_textureFormat[_depthFormat].m_fmtDsv
+ : DXGI_FORMAT_D24_UNORM_S8_UINT
+ ;
+ D3D11_TEXTURE2D_DESC dsd;
+ dsd.Width = scd.BufferDesc.Width;
+ dsd.Height = scd.BufferDesc.Height;
+ dsd.MipLevels = 1;
+ dsd.ArraySize = 1;
+ dsd.Format = fmtDsv;
+ dsd.SampleDesc = scd.SampleDesc;
+ dsd.Usage = D3D11_USAGE_DEFAULT;
+ dsd.BindFlags = D3D11_BIND_DEPTH_STENCIL;
+ dsd.CPUAccessFlags = 0;
+ dsd.MiscFlags = 0;
+
+ ID3D11Texture2D* depthStencil;
+ DX_CHECK(device->CreateTexture2D(&dsd, NULL, &depthStencil) );
+ DX_CHECK(device->CreateDepthStencilView(depthStencil, NULL, &m_dsv) );
+ DX_RELEASE(depthStencil, 0);
+
m_srv[0] = NULL;
- m_dsv = NULL;
m_denseIdx = _denseIdx;
m_num = 1;
}
uint16_t FrameBufferD3D11::destroy()
{
- preReset();
+ preReset(true);
DX_RELEASE(m_swapChain, 0);
- m_num = 0;
+ m_num = 0;
m_numTh = 0;
uint16_t denseIdx = m_denseIdx;
@@ -3516,19 +4180,26 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return denseIdx;
}
- void FrameBufferD3D11::preReset()
+ void FrameBufferD3D11::preReset(bool _force)
{
- for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
+ if (0 < m_numTh
+ || _force)
{
- DX_RELEASE(m_srv[ii], 0);
- DX_RELEASE(m_rtv[ii], 0);
- }
+ for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
+ {
+ DX_RELEASE(m_srv[ii], 0);
+ DX_RELEASE(m_rtv[ii], 0);
+ }
- DX_RELEASE(m_dsv, 0);
+ DX_RELEASE(m_dsv, 0);
+ }
}
void FrameBufferD3D11::postReset()
{
+ m_width = 0;
+ m_height = 0;
+
if (0 < m_numTh)
{
m_num = 0;
@@ -3538,6 +4209,32 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (isValid(handle) )
{
const TextureD3D11& texture = s_renderD3D11->m_textures[handle.idx];
+
+ if (0 == m_width)
+ {
+ switch (texture.m_type)
+ {
+ case TextureD3D11::Texture2D:
+ case TextureD3D11::TextureCube:
+ {
+ D3D11_TEXTURE2D_DESC desc;
+ texture.m_texture2d->GetDesc(&desc);
+ m_width = desc.Width;
+ m_height = desc.Height;
+ }
+ break;
+
+ case TextureD3D11::Texture3D:
+ {
+ D3D11_TEXTURE3D_DESC desc;
+ texture.m_texture3d->GetDesc(&desc);
+ m_width = desc.Width;
+ m_height = desc.Height;
+ }
+ break;
+ }
+ }
+
if (isDepth( (TextureFormat::Enum)texture.m_textureFormat) )
{
BX_CHECK(NULL == m_dsv, "Frame buffer already has depth-stencil attached.");
@@ -3678,8 +4375,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
Frame& frame = m_frame[m_control.m_read];
- uint64_t end;
- HRESULT hr = deviceCtx->GetData(frame.m_end, &end, sizeof(end), 0);
+ uint64_t finish;
+ HRESULT hr = deviceCtx->GetData(frame.m_end, &finish, sizeof(finish), 0);
if (S_OK == hr)
{
m_control.consume(1);
@@ -3697,7 +4394,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
deviceCtx->GetData(frame.m_start, &start, sizeof(start), 0);
m_frequency = disjoint.Frequency;
- m_elapsed = end - start;
+ m_elapsed = finish - start;
return true;
}
@@ -3717,10 +4414,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
int64_t elapsed = -bx::getHPCounter();
int64_t captureElapsed = 0;
- if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
- {
- m_gpuTimer.begin();
- }
+ m_gpuTimer.begin();
if (0 < _render->m_iboffset)
{
@@ -3741,9 +4435,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
currentState.m_flags = BGFX_STATE_NONE;
currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE);
- const bool hmdEnabled = m_ovr.isEnabled() || m_ovr.isDebug();
- _render->m_hmdEnabled = hmdEnabled;
+ _render->m_hmdInitialized = m_ovr.isInitialized();
+ const bool hmdEnabled = m_ovr.isEnabled() || m_ovr.isDebug();
ViewState& viewState = m_viewState;
viewState.reset(_render, hmdEnabled);
@@ -3753,11 +4447,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
uint16_t programIdx = invalidHandle;
SortKey key;
- uint8_t view = 0xff;
+ uint16_t view = UINT16_MAX;
FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
const uint64_t primType = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0;
- uint8_t primIndex = uint8_t(primType>>BGFX_STATE_PT_SHIFT);
+ uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT);
PrimInfo prim = s_primInfo[primIndex];
deviceCtx->IASetPrimitiveTopology(prim.m_type);
@@ -3805,7 +4499,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
restartState = 2;
item = restartItem;
restartItem = numItems;
- view = 0xff;
+ view = UINT16_MAX;
continue;
}
@@ -3849,8 +4543,15 @@ BX_PRAGMA_DIAGNOSTIC_POP();
PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW);
}
- viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2;
- viewState.m_rect.m_width /= 2;
+ if (m_ovr.isEnabled() )
+ {
+ m_ovr.getViewport(eye, &viewState.m_rect);
+ }
+ else
+ {
+ viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2;
+ viewState.m_rect.m_width /= 2;
+ }
}
else
{
@@ -3879,7 +4580,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK) )
{
- clearQuad(_clearQuad, viewState.m_rect, clr, _render->m_clearColor);
+ clearQuad(_clearQuad, viewState.m_rect, clr, _render->m_colorPalette);
prim = s_primInfo[BX_COUNTOF(s_primName)]; // Force primitive type update after clear quad.
}
}
@@ -3918,7 +4619,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bool programChanged = false;
bool constantsChanged = compute.m_constBegin < compute.m_constEnd;
- rendererUpdateUniforms(this, _render->m_constantBuffer, compute.m_constBegin, compute.m_constEnd);
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, compute.m_constBegin, compute.m_constEnd);
if (key.m_program != programIdx)
{
@@ -3940,7 +4641,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (constantsChanged)
{
- ConstantBuffer* vcb = program.m_vsh->m_constantBuffer;
+ UniformBuffer* vcb = program.m_vsh->m_constantBuffer;
if (NULL != vcb)
{
commit(*vcb);
@@ -3969,15 +4670,21 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
case Binding::Image:
{
- const TextureD3D11& texture = m_textures[bind.m_idx];
+ TextureD3D11& texture = m_textures[bind.m_idx];
if (Access::Read != bind.m_un.m_compute.m_access)
{
- uav[ii] = texture.m_uav;
+ uav[ii] = 0 == bind.m_un.m_compute.m_mip
+ ? texture.m_uav
+ : s_renderD3D11->getCachedUav(texture.getHandle(), bind.m_un.m_compute.m_mip)
+ ;
}
else
{
- srv[ii] = texture.m_srv;
- sampler[ii] = texture.m_sampler;
+ srv[ii] = 0 == bind.m_un.m_compute.m_mip
+ ? texture.m_srv
+ : s_renderD3D11->getCachedSrv(texture.getHandle(), bind.m_un.m_compute.m_mip)
+ ;
+ sampler[ii] = s_renderD3D11->getSamplerState(texture.m_flags, NULL);
}
}
break;
@@ -4056,10 +4763,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
const uint64_t newFlags = draw.m_flags;
uint64_t changedFlags = currentState.m_flags ^ draw.m_flags;
+ changedFlags |= currentState.m_rgba != draw.m_rgba ? BGFX_D3D11_BLEND_STATE_MASK : 0;
currentState.m_flags = newFlags;
const uint64_t newStencil = draw.m_stencil;
uint64_t changedStencil = currentState.m_stencil ^ draw.m_stencil;
+ changedFlags |= 0 != changedStencil ? BGFX_D3D11_DEPTH_STENCIL_MASK : 0;
currentState.m_stencil = newStencil;
if (resetState)
@@ -4118,29 +4827,25 @@ BX_PRAGMA_DIAGNOSTIC_POP();
setRasterizerState(newFlags, wireframe, scissorEnabled);
}
- if ( (BGFX_STATE_DEPTH_WRITE|BGFX_STATE_DEPTH_TEST_MASK) & changedFlags
- || 0 != changedStencil)
+ if (BGFX_D3D11_DEPTH_STENCIL_MASK & changedFlags)
{
setDepthStencilState(newFlags, newStencil);
}
+ if (BGFX_D3D11_BLEND_STATE_MASK & changedFlags)
+ {
+ setBlendState(newFlags, draw.m_rgba);
+ currentState.m_rgba = draw.m_rgba;
+ }
+
if ( (0
| BGFX_STATE_CULL_MASK
- | BGFX_STATE_RGB_WRITE
- | BGFX_STATE_ALPHA_WRITE
- | BGFX_STATE_BLEND_MASK
- | BGFX_STATE_BLEND_EQUATION_MASK
| BGFX_STATE_ALPHA_REF_MASK
| BGFX_STATE_PT_MASK
| BGFX_STATE_POINT_SIZE_MASK
| BGFX_STATE_MSAA
) & changedFlags)
{
- if ( (BGFX_STATE_BLEND_MASK|BGFX_STATE_BLEND_EQUATION_MASK|BGFX_STATE_ALPHA_WRITE|BGFX_STATE_RGB_WRITE) & changedFlags)
- {
- setBlendState(newFlags, draw.m_rgba);
- }
-
if ( (BGFX_STATE_CULL_MASK|BGFX_STATE_MSAA) & changedFlags)
{
setRasterizerState(newFlags, wireframe, scissorEnabled);
@@ -4163,7 +4868,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bool programChanged = false;
bool constantsChanged = draw.m_constBegin < draw.m_constEnd;
- rendererUpdateUniforms(this, _render->m_constantBuffer, draw.m_constBegin, draw.m_constEnd);
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, draw.m_constBegin, draw.m_constEnd);
if (key.m_program != programIdx)
{
@@ -4185,9 +4890,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
deviceCtx->VSSetShader(vsh->m_vertexShader, NULL, 0);
deviceCtx->VSSetConstantBuffers(0, 1, &vsh->m_buffer);
- if (NULL != m_currentColor)
+ const ShaderD3D11* fsh = program.m_fsh;
+ if (NULL != m_currentColor
+ || fsh->m_hasDepthOp)
{
- const ShaderD3D11* fsh = program.m_fsh;
deviceCtx->PSSetShader(fsh->m_pixelShader, NULL, 0);
deviceCtx->PSSetConstantBuffers(0, 1, &fsh->m_buffer);
}
@@ -4205,21 +4911,15 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
ProgramD3D11& program = m_program[programIdx];
-#if BGFX_D3D11_MAP_CONSTANT_BUFFERS
- if (constantsChanged || 0 != program.m_numPredefined)
- {
- prepareShaderConstants();
- }
-#endif // BGFX_D3D11_MAP_CONSTANT_BUFFERS
if (constantsChanged)
{
- ConstantBuffer* vcb = program.m_vsh->m_constantBuffer;
+ UniformBuffer* vcb = program.m_vsh->m_constantBuffer;
if (NULL != vcb)
{
commit(*vcb);
}
- ConstantBuffer* fcb = program.m_fsh->m_constantBuffer;
+ UniformBuffer* fcb = program.m_fsh->m_constantBuffer;
if (NULL != fcb)
{
commit(*fcb);
@@ -4239,16 +4939,16 @@ BX_PRAGMA_DIAGNOSTIC_POP();
uint32_t changes = 0;
for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
{
- const Binding& sampler = draw.m_bind[stage];
+ const Binding& bind = draw.m_bind[stage];
Binding& current = currentState.m_bind[stage];
- if (current.m_idx != sampler.m_idx
- || current.m_un.m_draw.m_flags != sampler.m_un.m_draw.m_flags
+ if (current.m_idx != bind.m_idx
+ || current.m_un.m_draw.m_flags != bind.m_un.m_draw.m_flags
|| programChanged)
{
- if (invalidHandle != sampler.m_idx)
+ if (invalidHandle != bind.m_idx)
{
- TextureD3D11& texture = m_textures[sampler.m_idx];
- texture.commit(stage, sampler.m_un.m_draw.m_flags);
+ TextureD3D11& texture = m_textures[bind.m_idx];
+ texture.commit(stage, bind.m_un.m_draw.m_flags, _render->m_colorPalette);
}
else
{
@@ -4259,7 +4959,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
++changes;
}
- current = sampler;
+ current = bind;
}
if (0 < changes)
@@ -4294,7 +4994,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (isValid(draw.m_instanceDataBuffer) )
{
- const VertexBufferD3D11& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx];
+ const VertexBufferD3D11& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx];
uint32_t instStride = draw.m_instanceDataStride;
deviceCtx->IASetVertexBuffers(1, 1, &inst.m_ptr, &instStride, &draw.m_instanceDataOffset);
setInputLayout(vertexDecl, m_program[programIdx], draw.m_instanceDataStride/16);
@@ -4359,12 +5059,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
: draw.m_numIndirect
;
- uint32_t args = draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
- {
- deviceCtx->DrawIndexedInstancedIndirect(ptr, args);
- args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- }
+ multiDrawIndexedInstancedIndirect(numDrawIndirect
+ , ptr
+ , draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
}
else
{
@@ -4373,12 +5072,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
: draw.m_numIndirect
;
- uint32_t args = draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
- {
- deviceCtx->DrawInstancedIndirect(ptr, args);
- args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- }
+ multiDrawInstancedIndirect(numDrawIndirect
+ , ptr
+ , draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
}
}
else
@@ -4507,23 +5205,31 @@ BX_PRAGMA_DIAGNOSTIC_POP();
min = min > frameTime ? frameTime : min;
max = max < frameTime ? frameTime : max;
- if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ static uint32_t maxGpuLatency = 0;
+ static double maxGpuElapsed = 0.0f;
+ double elapsedGpuMs = 0.0;
+
+ m_gpuTimer.end();
+
+ while (m_gpuTimer.get() )
{
- PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
+ double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
+ elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
+ maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
+ }
+ maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
- static uint32_t maxGpuLatency = 0;
- static double maxGpuElapsed = 0.0f;
- double elapsedGpuMs = 0.0;
+ const int64_t timerFreq = bx::getHPFrequency();
- m_gpuTimer.end();
+ Stats& perfStats = _render->m_perfStats;
+ perfStats.cpuTime = frameTime;
+ perfStats.cpuTimerFreq = timerFreq;
+ perfStats.gpuTime = m_gpuTimer.m_elapsed;
+ perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
- while (m_gpuTimer.get() )
- {
- double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
- elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
- maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
- }
- maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
+ if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ {
+ PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
TextVideoMem& tvm = m_textVideoMem;
@@ -4531,7 +5237,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (now >= next)
{
- next = now + bx::getHPFrequency();
+ next = now + timerFreq;
double freq = double(bx::getHPFrequency() );
double toMs = 1000.0/freq;
@@ -4545,7 +5251,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
const DXGI_ADAPTER_DESC& desc = m_adapterDesc;
char description[BX_COUNTOF(desc.Description)];
wcstombs(description, desc.Description, BX_COUNTOF(desc.Description) );
- tvm.printf(0, pos++, 0x0f, " Device: %s", description);
+ tvm.printf(0, pos++, 0x8f, " Device: %s", description);
char dedicatedVideo[16];
bx::prettify(dedicatedVideo, BX_COUNTOF(dedicatedVideo), desc.DedicatedVideoMemory);
@@ -4556,10 +5262,14 @@ BX_PRAGMA_DIAGNOSTIC_POP();
char sharedSystem[16];
bx::prettify(sharedSystem, BX_COUNTOF(sharedSystem), desc.SharedSystemMemory);
- tvm.printf(0, pos++, 0x0f, " Memory: %s (video), %s (system), %s (shared)"
+ char processMemoryUsed[16];
+ bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() );
+
+ tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared), %s (process) "
, dedicatedVideo
, dedicatedSystem
, sharedSystem
+ , processMemoryUsed
);
pos = 10;
@@ -4583,7 +5293,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
);
double elapsedCpuMs = double(elapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms] (latency %d)"
+ tvm.printf(10, pos++, 0x8e, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] %c GPU %7.4f [ms] (latency %d) "
, _render->m_num
, statsKeyType[0]
, statsKeyType[1]
@@ -4611,9 +5321,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
tvm.printf(tvm.m_width-27, 0, 0x1f, " [F11 - RenderDoc capture] ");
}
- tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices);
- tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset);
- tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset);
+ tvm.printf(10, pos++, 0x8e, " Indices: %7d ", statsNumIndices);
+ tvm.printf(10, pos++, 0x8e, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax);
+ tvm.printf(10, pos++, 0x8e, " DVB size: %7d ", _render->m_vboffset);
+ tvm.printf(10, pos++, 0x8e, " DIB size: %7d ", _render->m_iboffset);
pos++;
tvm.printf(10, pos++, 0x8e, " State cache: ");
@@ -4628,13 +5339,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
pos++;
double captureMs = double(captureElapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Capture: %3.4f [ms]", captureMs);
+ tvm.printf(10, pos++, 0x8e, " Capture: %7.4f [ms] ", captureMs);
uint8_t attr[2] = { 0x89, 0x8a };
uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender;
- tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %3.4f [ms]", _render->m_waitSubmit*toMs);
- tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %3.4f [ms]", _render->m_waitRender*toMs);
+ tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %7.4f [ms] ", _render->m_waitSubmit*toMs);
+ tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %7.4f [ms] ", _render->m_waitRender*toMs);
min = frameTime;
max = frameTime;
diff --git a/3rdparty/bgfx/src/renderer_d3d11.h b/3rdparty/bgfx/src/renderer_d3d11.h
index 2593fbb85c9..d0560957f72 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.h
+++ b/3rdparty/bgfx/src/renderer_d3d11.h
@@ -17,9 +17,10 @@ BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas" );
BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wpragmas");
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4005) // warning C4005: '' : macro redefinition
+#include <sal.h>
#define D3D11_NO_HELPERS
#if BX_PLATFORM_WINRT
-# include <d3d11_2.h>
+# include <d3d11_3.h>
#else
# include <d3d11.h>
#endif // BX_PLATFORM_WINRT
@@ -27,6 +28,7 @@ BX_PRAGMA_DIAGNOSTIC_POP()
#include "renderer.h"
#include "renderer_d3d.h"
+#include "shader_dxbc.h"
#include "ovr.h"
#include "renderdoc.h"
@@ -38,46 +40,18 @@ BX_PRAGMA_DIAGNOSTIC_POP()
# define D3DCOLOR_RGBA(_r, _g, _b, _a) D3DCOLOR_ARGB(_a, _r, _g, _b)
#endif // D3DCOLOR_RGBA
-#ifndef DXGI_FORMAT_B4G4R4A4_UNORM
-// Win8 only BS
-// https://blogs.msdn.com/b/chuckw/archive/2012/11/14/directx-11-1-and-windows-7.aspx?Redirected=true
-// http://msdn.microsoft.com/en-us/library/windows/desktop/bb173059%28v=vs.85%29.aspx
-# define DXGI_FORMAT_B4G4R4A4_UNORM DXGI_FORMAT(115)
-#endif // DXGI_FORMAT_B4G4R4A4_UNORM
+#define BGFX_D3D11_BLEND_STATE_MASK (0 \
+ | BGFX_STATE_BLEND_MASK \
+ | BGFX_STATE_BLEND_EQUATION_MASK \
+ | BGFX_STATE_BLEND_INDEPENDENT \
+ | BGFX_STATE_ALPHA_WRITE \
+ | BGFX_STATE_RGB_WRITE \
+ )
-#ifndef D3D_FEATURE_LEVEL_11_1
-# define D3D_FEATURE_LEVEL_11_1 D3D_FEATURE_LEVEL(0xb100)
-#endif // D3D_FEATURE_LEVEL_11_1
-
-#if defined(__MINGW32__)
-// MinGW Linux/Wine missing defines...
-# ifndef D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
-# define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT 8
-# endif // D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
-
-# ifndef D3D11_PS_CS_UAV_REGISTER_COUNT
-# define D3D11_PS_CS_UAV_REGISTER_COUNT 8
-# endif // D3D11_PS_CS_UAV_REGISTER_COUNT
-
-# ifndef D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT
-# define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT 8
-# endif
-
-# ifndef D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
-# define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT 8
-# endif // D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
-
-# ifndef D3D11_APPEND_ALIGNED_ELEMENT
-# define D3D11_APPEND_ALIGNED_ELEMENT UINT32_MAX
-# endif // D3D11_APPEND_ALIGNED_ELEMENT
-
-# ifndef D3D11_REQ_MAXANISOTROPY
-# define D3D11_REQ_MAXANISOTROPY 16
-# endif // D3D11_REQ_MAXANISOTROPY
-
-typedef void ID3D11InfoQueue;
-
-#endif // __MINGW32__
+#define BGFX_D3D11_DEPTH_STENCIL_MASK (0 \
+ | BGFX_STATE_DEPTH_WRITE \
+ | BGFX_STATE_DEPTH_TEST_MASK \
+ )
namespace bgfx { namespace d3d11
{
@@ -139,6 +113,7 @@ namespace bgfx { namespace d3d11
, m_hash(0)
, m_numUniforms(0)
, m_numPredefined(0)
+ , m_hasDepthOp(false)
{
}
@@ -149,7 +124,7 @@ namespace bgfx { namespace d3d11
{
if (NULL != m_constantBuffer)
{
- ConstantBuffer::destroy(m_constantBuffer);
+ UniformBuffer::destroy(m_constantBuffer);
m_constantBuffer = NULL;
}
@@ -179,15 +154,16 @@ namespace bgfx { namespace d3d11
};
const Memory* m_code;
ID3D11Buffer* m_buffer;
- ConstantBuffer* m_constantBuffer;
+ UniformBuffer* m_constantBuffer;
PredefinedUniform m_predefined[PredefinedUniform::Count];
- uint8_t m_attrMask[Attrib::Count];
+ uint16_t m_attrMask[Attrib::Count];
uint32_t m_hash;
uint16_t m_numUniforms;
uint8_t m_numPredefined;
+ bool m_hasDepthOp;
};
struct ProgramD3D11
@@ -241,7 +217,6 @@ namespace bgfx { namespace d3d11
: m_ptr(NULL)
, m_srv(NULL)
, m_uav(NULL)
- , m_sampler(NULL)
, m_numMips(0)
{
}
@@ -249,30 +224,33 @@ namespace bgfx { namespace d3d11
void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
void destroy();
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
- void commit(uint8_t _stage, uint32_t _flags = BGFX_SAMPLER_DEFAULT_FLAGS);
+ void commit(uint8_t _stage, uint32_t _flags, const float _palette[][4]);
void resolve();
+ TextureHandle getHandle() const;
union
{
- ID3D11Resource* m_ptr;
+ ID3D11Resource* m_ptr;
ID3D11Texture2D* m_texture2d;
ID3D11Texture3D* m_texture3d;
};
- ID3D11ShaderResourceView* m_srv;
+ ID3D11ShaderResourceView* m_srv;
ID3D11UnorderedAccessView* m_uav;
- ID3D11SamplerState* m_sampler;
uint32_t m_flags;
- uint8_t m_type;
- uint8_t m_requestedFormat;
- uint8_t m_textureFormat;
- uint8_t m_numMips;
+ uint8_t m_type;
+ uint8_t m_requestedFormat;
+ uint8_t m_textureFormat;
+ uint8_t m_numMips;
};
struct FrameBufferD3D11
{
FrameBufferD3D11()
: m_dsv(NULL)
+ , m_swapChain(NULL)
+ , m_width(0)
+ , m_height(0)
, m_denseIdx(UINT16_MAX)
, m_num(0)
, m_numTh(0)
@@ -282,7 +260,7 @@ namespace bgfx { namespace d3d11
void create(uint8_t _num, const TextureHandle* _handles);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
uint16_t destroy();
- void preReset();
+ void preReset(bool _force = false);
void postReset();
void resolve();
void clear(const Clear& _clear, const float _palette[][4]);
@@ -291,6 +269,8 @@ namespace bgfx { namespace d3d11
ID3D11ShaderResourceView* m_srv[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS-1];
ID3D11DepthStencilView* m_dsv;
IDXGISwapChain* m_swapChain;
+ uint32_t m_width;
+ uint32_t m_height;
uint16_t m_denseIdx;
uint8_t m_num;
uint8_t m_numTh;
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index b41207cbc31..902eb8b4610 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -6,7 +6,5007 @@
#include "bgfx_p.h"
#if BGFX_CONFIG_RENDERER_DIRECT3D12
-# include "../../d3d12/src/renderer_d3d12.cpp"
+# include "renderer_d3d12.h"
+
+# if !USE_D3D12_DYNAMIC_LIB
+# pragma comment(lib, "D3D12.lib")
+# endif // !USE_D3D12_DYNAMIC_LIB
+
+namespace bgfx { namespace d3d12
+{
+ static wchar_t s_viewNameW[BGFX_CONFIG_MAX_VIEWS][256];
+
+ struct PrimInfo
+ {
+ D3D_PRIMITIVE_TOPOLOGY m_toplogy;
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE m_topologyType;
+ uint32_t m_min;
+ uint32_t m_div;
+ uint32_t m_sub;
+ };
+
+ static const PrimInfo s_primInfo[] =
+ {
+ { D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, 3, 3, 0 },
+ { D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, 3, 1, 2 },
+ { D3D_PRIMITIVE_TOPOLOGY_LINELIST, D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, 2, 2, 0 },
+ { D3D_PRIMITIVE_TOPOLOGY_POINTLIST, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 1, 1, 0 },
+ { D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED, 0, 0, 0 },
+ };
+
+ static const char* s_primName[] =
+ {
+ "TriList",
+ "TriStrip",
+ "Line",
+ "Point",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_primInfo) == BX_COUNTOF(s_primName)+1);
+
+ static const uint32_t s_checkMsaa[] =
+ {
+ 0,
+ 2,
+ 4,
+ 8,
+ 16,
+ };
+
+ static DXGI_SAMPLE_DESC s_msaa[] =
+ {
+ { 1, 0 },
+ { 2, 0 },
+ { 4, 0 },
+ { 8, 0 },
+ { 16, 0 },
+ };
+
+ static const D3D12_BLEND s_blendFactor[][2] =
+ {
+ { (D3D12_BLEND)0, (D3D12_BLEND)0 }, // ignored
+ { D3D12_BLEND_ZERO, D3D12_BLEND_ZERO }, // ZERO
+ { D3D12_BLEND_ONE, D3D12_BLEND_ONE }, // ONE
+ { D3D12_BLEND_SRC_COLOR, D3D12_BLEND_SRC_ALPHA }, // SRC_COLOR
+ { D3D12_BLEND_INV_SRC_COLOR, D3D12_BLEND_INV_SRC_ALPHA }, // INV_SRC_COLOR
+ { D3D12_BLEND_SRC_ALPHA, D3D12_BLEND_SRC_ALPHA }, // SRC_ALPHA
+ { D3D12_BLEND_INV_SRC_ALPHA, D3D12_BLEND_INV_SRC_ALPHA }, // INV_SRC_ALPHA
+ { D3D12_BLEND_DEST_ALPHA, D3D12_BLEND_DEST_ALPHA }, // DST_ALPHA
+ { D3D12_BLEND_INV_DEST_ALPHA, D3D12_BLEND_INV_DEST_ALPHA }, // INV_DST_ALPHA
+ { D3D12_BLEND_DEST_COLOR, D3D12_BLEND_DEST_ALPHA }, // DST_COLOR
+ { D3D12_BLEND_INV_DEST_COLOR, D3D12_BLEND_INV_DEST_ALPHA }, // INV_DST_COLOR
+ { D3D12_BLEND_SRC_ALPHA_SAT, D3D12_BLEND_ONE }, // SRC_ALPHA_SAT
+ { D3D12_BLEND_BLEND_FACTOR, D3D12_BLEND_BLEND_FACTOR }, // FACTOR
+ { D3D12_BLEND_INV_BLEND_FACTOR, D3D12_BLEND_INV_BLEND_FACTOR }, // INV_FACTOR
+ };
+
+ static const D3D12_BLEND_OP s_blendEquation[] =
+ {
+ D3D12_BLEND_OP_ADD,
+ D3D12_BLEND_OP_SUBTRACT,
+ D3D12_BLEND_OP_REV_SUBTRACT,
+ D3D12_BLEND_OP_MIN,
+ D3D12_BLEND_OP_MAX,
+ };
+
+ static const D3D12_COMPARISON_FUNC s_cmpFunc[] =
+ {
+ D3D12_COMPARISON_FUNC(0), // ignored
+ D3D12_COMPARISON_FUNC_LESS,
+ D3D12_COMPARISON_FUNC_LESS_EQUAL,
+ D3D12_COMPARISON_FUNC_EQUAL,
+ D3D12_COMPARISON_FUNC_GREATER_EQUAL,
+ D3D12_COMPARISON_FUNC_GREATER,
+ D3D12_COMPARISON_FUNC_NOT_EQUAL,
+ D3D12_COMPARISON_FUNC_NEVER,
+ D3D12_COMPARISON_FUNC_ALWAYS,
+ };
+
+ static const D3D12_STENCIL_OP s_stencilOp[] =
+ {
+ D3D12_STENCIL_OP_ZERO,
+ D3D12_STENCIL_OP_KEEP,
+ D3D12_STENCIL_OP_REPLACE,
+ D3D12_STENCIL_OP_INCR,
+ D3D12_STENCIL_OP_INCR_SAT,
+ D3D12_STENCIL_OP_DECR,
+ D3D12_STENCIL_OP_DECR_SAT,
+ D3D12_STENCIL_OP_INVERT,
+ };
+
+ static const D3D12_CULL_MODE s_cullMode[] =
+ {
+ D3D12_CULL_MODE_NONE,
+ D3D12_CULL_MODE_FRONT,
+ D3D12_CULL_MODE_BACK,
+ };
+
+ static const D3D12_TEXTURE_ADDRESS_MODE s_textureAddress[] =
+ {
+ D3D12_TEXTURE_ADDRESS_MODE_WRAP,
+ D3D12_TEXTURE_ADDRESS_MODE_MIRROR,
+ D3D12_TEXTURE_ADDRESS_MODE_CLAMP,
+ D3D12_TEXTURE_ADDRESS_MODE_BORDER,
+ };
+
+ /*
+ * D3D11_FILTER_MIN_MAG_MIP_POINT = 0x00,
+ * D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01,
+ * D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04,
+ * D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05,
+ * D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
+ * D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
+ * D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
+ * D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+ * D3D11_FILTER_ANISOTROPIC = 0x55,
+ *
+ * D3D11_COMPARISON_FILTERING_BIT = 0x80,
+ * D3D11_ANISOTROPIC_FILTERING_BIT = 0x40,
+ *
+ * According to D3D11_FILTER enum bits for mip, mag and mip are:
+ * 0x10 // MIN_LINEAR
+ * 0x04 // MAG_LINEAR
+ * 0x01 // MIP_LINEAR
+ */
+
+ static const uint8_t s_textureFilter[3][3] =
+ {
+ {
+ 0x10, // min linear
+ 0x00, // min point
+ 0x55, // anisotropic
+ },
+ {
+ 0x04, // mag linear
+ 0x00, // mag point
+ 0x55, // anisotropic
+ },
+ {
+ 0x01, // mip linear
+ 0x00, // mip point
+ 0x55, // anisotropic
+ },
+ };
+
+ struct TextureFormatInfo
+ {
+ DXGI_FORMAT m_fmt;
+ DXGI_FORMAT m_fmtSrv;
+ DXGI_FORMAT m_fmtDsv;
+ DXGI_FORMAT m_fmtSrgb;
+ };
+
+ static const TextureFormatInfo s_textureFormat[] =
+ {
+ { DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC1_UNORM_SRGB }, // BC1
+ { DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC2_UNORM_SRGB }, // BC2
+ { DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC3_UNORM_SRGB }, // BC3
+ { DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC4
+ { DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC5
+ { DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC6H
+ { DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC7_UNORM_SRGB }, // BC7
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC22
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC24
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
+ { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R1
+ { DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // A8
+ { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8
+ { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8I
+ { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8U
+ { DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8S
+ { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16
+ { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16I
+ { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16U
+ { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16F
+ { DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16S
+ { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32I
+ { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32U
+ { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32F
+ { DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8
+ { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8I
+ { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8U
+ { DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8S
+ { DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16
+ { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16I
+ { DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16U
+ { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16F
+ { DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16S
+ { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32I
+ { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32U
+ { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32F
+ { DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB9E5F
+ { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB }, // BGRA8
+ { DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8
+ { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8I
+ { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8U
+ { DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA8S
+ { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16
+ { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16I
+ { DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16U
+ { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16F
+ { DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16S
+ { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32I
+ { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32U
+ { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32F
+ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R5G6B5
+ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA4
+ { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB5A1
+ { DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB10A2
+ { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R11G11B10F
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // UnknownDepth
+ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN }, // D16
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24S8
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D32
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D16F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D24F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8
+ };
+ BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
+
+ static const D3D12_INPUT_ELEMENT_DESC s_attrib[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "BITANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "COLOR", 1, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "BLENDINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "BLENDWEIGHT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 4, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 5, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ };
+ BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib) );
+
+ static const DXGI_FORMAT s_attribType[][4][2] =
+ {
+ { // Uint8
+ { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UNORM },
+ { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UNORM },
+ { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM },
+ { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM },
+ },
+ { // Uint10
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ { DXGI_FORMAT_R10G10B10A2_UINT, DXGI_FORMAT_R10G10B10A2_UNORM },
+ },
+ { // Int16
+ { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SNORM },
+ { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SNORM },
+ { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SNORM },
+ { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SNORM },
+ },
+ { // Half
+ { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT },
+ { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT },
+ { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT },
+ { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT },
+ },
+ { // Float
+ { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT },
+ { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT },
+ { DXGI_FORMAT_R32G32B32_FLOAT, DXGI_FORMAT_R32G32B32_FLOAT },
+ { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT },
+ },
+ };
+ BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
+
+ static D3D12_INPUT_ELEMENT_DESC* fillVertexDecl(D3D12_INPUT_ELEMENT_DESC* _out, const VertexDecl& _decl)
+ {
+ D3D12_INPUT_ELEMENT_DESC* elem = _out;
+
+ for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
+ {
+ if (UINT16_MAX != _decl.m_attributes[attr])
+ {
+ memcpy(elem, &s_attrib[attr], sizeof(D3D12_INPUT_ELEMENT_DESC) );
+
+ if (0 == _decl.m_attributes[attr])
+ {
+ elem->AlignedByteOffset = 0;
+ }
+ else
+ {
+ uint8_t num;
+ AttribType::Enum type;
+ bool normalized;
+ bool asInt;
+ _decl.decode(Attrib::Enum(attr), num, type, normalized, asInt);
+ elem->Format = s_attribType[type][num-1][normalized];
+ elem->AlignedByteOffset = _decl.m_offset[attr];
+ }
+
+ ++elem;
+ }
+ }
+
+ return elem;
+ }
+
+ void setResourceBarrier(ID3D12GraphicsCommandList* _commandList, const ID3D12Resource* _resource, D3D12_RESOURCE_STATES _stateBefore, D3D12_RESOURCE_STATES _stateAfter)
+ {
+ D3D12_RESOURCE_BARRIER barrier;
+ barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
+ barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE;
+ barrier.Transition.pResource = const_cast<ID3D12Resource*>(_resource);
+ barrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
+ barrier.Transition.StateBefore = _stateBefore;
+ barrier.Transition.StateAfter = _stateAfter;
+ _commandList->ResourceBarrier(1, &barrier);
+ }
+
+ static const GUID IID_ID3D12CommandAllocator = { 0x6102dee4, 0xaf59, 0x4b09, { 0xb9, 0x99, 0xb4, 0x4d, 0x73, 0xf0, 0x9b, 0x24 } };
+ static const GUID IID_ID3D12CommandQueue = { 0x0ec870a6, 0x5d7e, 0x4c22, { 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed } };
+ static const GUID IID_ID3D12CommandSignature = { 0xc36a797c, 0xec80, 0x4f0a, { 0x89, 0x85, 0xa7, 0xb2, 0x47, 0x50, 0x82, 0xd1 } };
+ static const GUID IID_ID3D12Debug = { 0x344488b7, 0x6846, 0x474b, { 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0 } };
+ static const GUID IID_ID3D12DescriptorHeap = { 0x8efb471d, 0x616c, 0x4f49, { 0x90, 0xf7, 0x12, 0x7b, 0xb7, 0x63, 0xfa, 0x51 } };
+ static const GUID IID_ID3D12Device = { 0x189819f1, 0x1db6, 0x4b57, { 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7 } };
+ static const GUID IID_ID3D12Fence = { 0x0a753dcf, 0xc4d8, 0x4b91, { 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76 } };
+ static const GUID IID_ID3D12GraphicsCommandList = { 0x5b160d0f, 0xac1b, 0x4185, { 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55 } };
+ static const GUID IID_ID3D12InfoQueue = { 0x0742a90b, 0xc387, 0x483f, { 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58 } };
+ static const GUID IID_ID3D12PipelineState = { 0x765a30f3, 0xf624, 0x4c6f, { 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45 } };
+ static const GUID IID_ID3D12Resource = { 0x696442be, 0xa72e, 0x4059, { 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad } };
+ static const GUID IID_ID3D12RootSignature = { 0xc54a6b66, 0x72df, 0x4ee8, { 0x8b, 0xe5, 0xa9, 0x46, 0xa1, 0x42, 0x92, 0x14 } };
+ static const GUID IID_IDXGIFactory4 = { 0x1bc6ea02, 0xef36, 0x464f, { 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a } };
+
+ struct HeapProperty
+ {
+ enum Enum
+ {
+ Default,
+ Upload,
+ ReadBack,
+
+ Count
+ };
+
+ D3D12_HEAP_PROPERTIES m_properties;
+ D3D12_RESOURCE_STATES m_state;
+ };
+
+ static const HeapProperty s_heapProperties[] =
+ {
+ { { D3D12_HEAP_TYPE_DEFAULT, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1 }, D3D12_RESOURCE_STATE_COMMON },
+ { { D3D12_HEAP_TYPE_UPLOAD, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1 }, D3D12_RESOURCE_STATE_GENERIC_READ },
+ { { D3D12_HEAP_TYPE_READBACK, D3D12_CPU_PAGE_PROPERTY_UNKNOWN, D3D12_MEMORY_POOL_UNKNOWN, 1, 1 }, D3D12_RESOURCE_STATE_COPY_DEST },
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_heapProperties) == HeapProperty::Count);
+
+ ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, D3D12_RESOURCE_DESC* _resourceDesc, D3D12_CLEAR_VALUE* _clearValue)
+ {
+ const HeapProperty& heapProperty = s_heapProperties[_heapProperty];
+ ID3D12Resource* resource;
+ DX_CHECK(_device->CreateCommittedResource(&heapProperty.m_properties
+ , D3D12_HEAP_FLAG_NONE
+ , _resourceDesc
+ , heapProperty.m_state
+ , _clearValue
+ , IID_ID3D12Resource
+ , (void**)&resource
+ ) );
+ BX_WARN(NULL != resource, "CreateCommittedResource failed (size: %d). Out of memory?"
+ , _resourceDesc->Width
+ );
+
+ return resource;
+ }
+
+ ID3D12Resource* createCommittedResource(ID3D12Device* _device, HeapProperty::Enum _heapProperty, uint64_t _size, D3D12_RESOURCE_FLAGS _flags = D3D12_RESOURCE_FLAG_NONE)
+ {
+ D3D12_RESOURCE_DESC resourceDesc;
+ resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
+ resourceDesc.Alignment = 0;
+ resourceDesc.Width = _size;
+ resourceDesc.Height = 1;
+ resourceDesc.DepthOrArraySize = 1;
+ resourceDesc.MipLevels = 1;
+ resourceDesc.Format = DXGI_FORMAT_UNKNOWN;
+ resourceDesc.SampleDesc.Count = 1;
+ resourceDesc.SampleDesc.Quality = 0;
+ resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
+ resourceDesc.Flags = _flags;
+
+ return createCommittedResource(_device, _heapProperty, &resourceDesc, NULL);
+ }
+
+ BX_NO_INLINE void setDebugObjectName(ID3D12Object* _object, const char* _format, ...)
+ {
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_OBJECT_NAME) )
+ {
+ char temp[2048];
+ va_list argList;
+ va_start(argList, _format);
+ int size = bx::uint32_min(sizeof(temp)-1, vsnprintf(temp, sizeof(temp), _format, argList) );
+ va_end(argList);
+ temp[size] = '\0';
+
+ wchar_t* wtemp = (wchar_t*)alloca( (size+1)*2);
+ mbstowcs(wtemp, temp, size+1);
+ _object->SetName(wtemp);
+ }
+ }
+
+#if USE_D3D12_DYNAMIC_LIB
+ static PFN_D3D12_CREATE_DEVICE D3D12CreateDevice;
+ static PFN_D3D12_GET_DEBUG_INTERFACE D3D12GetDebugInterface;
+ static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE D3D12SerializeRootSignature;
+ static PFN_CREATE_DXGI_FACTORY CreateDXGIFactory1;
+
+ typedef HANDLE (WINAPI* PFN_CREATE_EVENT_EX_A)(LPSECURITY_ATTRIBUTES _attrs, LPCSTR _name, DWORD _flags, DWORD _access);
+ static PFN_CREATE_EVENT_EX_A CreateEventExA;
+#endif // USE_D3D12_DYNAMIC_LIB
+
+ struct RendererContextD3D12 : public RendererContextI
+ {
+ RendererContextD3D12()
+ : m_wireframe(false)
+ , m_flags(BGFX_RESET_NONE)
+ , m_maxAnisotropy(1)
+ , m_fsChanges(0)
+ , m_vsChanges(0)
+ , m_backBufferColorIdx(0)
+ , m_rtMsaa(false)
+ {
+ }
+
+ ~RendererContextD3D12()
+ {
+ }
+
+ bool init()
+ {
+ struct ErrorState
+ {
+ enum Enum
+ {
+ Default,
+ LoadedKernel32,
+ LoadedD3D12,
+ LoadedDXGI,
+ CreatedDXGIFactory,
+ CreatedCommandQueue,
+ };
+ };
+
+ ErrorState::Enum errorState = ErrorState::Default;
+ LUID luid;
+
+ m_fbh.idx = invalidHandle;
+ memset(m_uniforms, 0, sizeof(m_uniforms) );
+ memset(&m_resolution, 0, sizeof(m_resolution) );
+
+#if USE_D3D12_DYNAMIC_LIB
+ m_kernel32dll = bx::dlopen("kernel32.dll");
+ BX_WARN(NULL != m_kernel32dll, "Failed to load kernel32.dll.");
+ if (NULL == m_kernel32dll)
+ {
+ goto error;
+ }
+
+ CreateEventExA = (PFN_CREATE_EVENT_EX_A)bx::dlsym(m_kernel32dll, "CreateEventExA");
+ BX_WARN(NULL != CreateEventExA, "Function CreateEventExA not found.");
+ if (NULL == CreateEventExA)
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::LoadedKernel32;
+
+ m_d3d12dll = bx::dlopen("d3d12.dll");
+ BX_WARN(NULL != m_d3d12dll, "Failed to load d3d12.dll.");
+ if (NULL == m_d3d12dll)
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::LoadedD3D12;
+
+ D3D12CreateDevice = (PFN_D3D12_CREATE_DEVICE)bx::dlsym(m_d3d12dll, "D3D12CreateDevice");
+ BX_WARN(NULL != D3D12CreateDevice, "Function D3D12CreateDevice not found.");
+
+ D3D12GetDebugInterface = (PFN_D3D12_GET_DEBUG_INTERFACE)bx::dlsym(m_d3d12dll, "D3D12GetDebugInterface");
+ BX_WARN(NULL != D3D12GetDebugInterface, "Function D3D12GetDebugInterface not found.");
+
+ D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)bx::dlsym(m_d3d12dll, "D3D12SerializeRootSignature");
+ BX_WARN(NULL != D3D12SerializeRootSignature, "Function D3D12SerializeRootSignature not found.");
+
+ if (NULL == D3D12CreateDevice
+ || NULL == D3D12GetDebugInterface
+ || NULL == D3D12SerializeRootSignature)
+ {
+ goto error;
+ }
+
+ m_dxgidll = bx::dlopen("dxgi.dll");
+ BX_WARN(NULL != m_dxgidll, "Failed to load dxgi.dll.");
+
+ if (NULL == m_dxgidll)
+ {
+ goto error;
+ }
+
+ CreateDXGIFactory1 = (PFN_CREATE_DXGI_FACTORY)bx::dlsym(m_dxgidll, "CreateDXGIFactory1");
+ BX_WARN(NULL != CreateDXGIFactory1, "Function CreateDXGIFactory1 not found.");
+
+ if (NULL == CreateDXGIFactory1)
+ {
+ goto error;
+ }
+#endif // USE_D3D12_DYNAMIC_LIB
+
+ errorState = ErrorState::LoadedDXGI;
+
+ HRESULT hr;
+
+ hr = CreateDXGIFactory1(IID_IDXGIFactory4, (void**)&m_factory);
+ BX_WARN(SUCCEEDED(hr), "Unable to create DXGI factory.");
+
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::CreatedDXGIFactory;
+
+ m_adapter = NULL;
+ m_driverType = D3D_DRIVER_TYPE_HARDWARE;
+
+ {
+ IDXGIAdapter3* adapter;
+ for (uint32_t ii = 0; DXGI_ERROR_NOT_FOUND != m_factory->EnumAdapters(ii, reinterpret_cast<IDXGIAdapter**>(&adapter) ); ++ii)
+ {
+ DXGI_ADAPTER_DESC desc;
+ hr = adapter->GetDesc(&desc);
+ if (SUCCEEDED(hr) )
+ {
+ BX_TRACE("Adapter #%d", ii);
+
+ char description[BX_COUNTOF(desc.Description)];
+ wcstombs(description, desc.Description, BX_COUNTOF(desc.Description) );
+ BX_TRACE("\tDescription: %s", description);
+ BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x"
+ , desc.VendorId
+ , desc.DeviceId
+ , desc.SubSysId
+ , desc.Revision
+ );
+ BX_TRACE("\tMemory: %" PRIi64 " (video), %" PRIi64 " (system), %" PRIi64 " (shared)"
+ , desc.DedicatedVideoMemory
+ , desc.DedicatedSystemMemory
+ , desc.SharedSystemMemory
+ );
+
+ g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId;
+ g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId;
+ ++g_caps.numGPUs;
+
+ if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId)
+ && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId)
+ && (0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) )
+ {
+ m_adapter = adapter;
+ m_adapter->AddRef();
+ m_driverType = D3D_DRIVER_TYPE_UNKNOWN;
+ }
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD)
+ && 0 != strstr(description, "PerfHUD") )
+ {
+ m_adapter = adapter;
+ m_driverType = D3D_DRIVER_TYPE_REFERENCE;
+ }
+ }
+
+ DX_RELEASE(adapter, adapter == m_adapter ? 1 : 0);
+ }
+ }
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
+ {
+ ID3D12Debug* debug;
+ hr = D3D12GetDebugInterface(IID_ID3D12Debug, (void**)&debug);
+
+ if (SUCCEEDED(hr) )
+ {
+ debug->EnableDebugLayer();
+ }
+ }
+
+ {
+ D3D_FEATURE_LEVEL featureLevel[] =
+ {
+ D3D_FEATURE_LEVEL_12_1,
+ D3D_FEATURE_LEVEL_12_0,
+ D3D_FEATURE_LEVEL_11_1,
+ D3D_FEATURE_LEVEL_11_0,
+ };
+
+ hr = E_FAIL;
+ for (uint32_t ii = 0; ii < BX_COUNTOF(featureLevel) && FAILED(hr); ++ii)
+ {
+ hr = D3D12CreateDevice(m_adapter
+ , featureLevel[ii]
+ , IID_ID3D12Device
+ , (void**)&m_device
+ );
+ BX_WARN(FAILED(hr), "Direct3D12 device feature level %d.%d."
+ , (featureLevel[ii] >> 12) & 0xf
+ , (featureLevel[ii] >> 8) & 0xf
+ );
+ }
+ BX_WARN(SUCCEEDED(hr), "Unable to create Direct3D12 device.");
+ }
+
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ {
+ memset(&m_adapterDesc, 0, sizeof(m_adapterDesc) );
+ luid = m_device->GetAdapterLuid();
+ IDXGIAdapter3* adapter;
+ for (uint32_t ii = 0; DXGI_ERROR_NOT_FOUND != m_factory->EnumAdapters(ii, reinterpret_cast<IDXGIAdapter**>(&adapter) ); ++ii)
+ {
+ adapter->GetDesc(&m_adapterDesc);
+ if (m_adapterDesc.AdapterLuid.LowPart == luid.LowPart
+ && m_adapterDesc.AdapterLuid.HighPart == luid.HighPart)
+ {
+ if (NULL == m_adapter)
+ {
+ m_adapter = adapter;
+ }
+ else
+ {
+ DX_RELEASE(adapter, 0);
+ }
+ break;
+ }
+ DX_RELEASE(adapter, 0);
+ }
+ }
+
+ g_caps.vendorId = (uint16_t)m_adapterDesc.VendorId;
+ g_caps.deviceId = (uint16_t)m_adapterDesc.DeviceId;
+
+ {
+ uint32_t numNodes = m_device->GetNodeCount();
+ BX_TRACE("D3D12 GPU Architecture (num nodes: %d):", numNodes);
+ for (uint32_t ii = 0; ii < numNodes; ++ii)
+ {
+ D3D12_FEATURE_DATA_ARCHITECTURE architecture;
+ architecture.NodeIndex = ii;
+ DX_CHECK(m_device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &architecture, sizeof(architecture) ) );
+ BX_TRACE("\tNode % 2d: TileBasedRenderer %d, UMA %d, CacheCoherentUMA %d"
+ , ii
+ , architecture.TileBasedRenderer
+ , architecture.UMA
+ , architecture.CacheCoherentUMA
+ );
+ if (0 == ii)
+ {
+ memcpy(&m_architecture, &architecture, sizeof(architecture) );
+ }
+ }
+ }
+
+ DX_CHECK(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_options, sizeof(m_options) ) );
+ BX_TRACE("D3D12 options:")
+ BX_TRACE("\tTiledResourcesTier %d", m_options.TiledResourcesTier);
+ BX_TRACE("\tResourceBindingTier %d", m_options.ResourceBindingTier);
+ BX_TRACE("\tROVsSupported %d", m_options.ROVsSupported);
+ BX_TRACE("\tConservativeRasterizationTier %d", m_options.ConservativeRasterizationTier);
+ BX_TRACE("\tCrossNodeSharingTier %d", m_options.CrossNodeSharingTier);
+ BX_TRACE("\tResourceHeapTier %d", m_options.ResourceHeapTier);
+
+ m_cmd.init(m_device);
+ errorState = ErrorState::CreatedCommandQueue;
+
+ m_scd.BufferDesc.Width = BGFX_DEFAULT_WIDTH;
+ m_scd.BufferDesc.Height = BGFX_DEFAULT_HEIGHT;
+ m_scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ m_scd.BufferDesc.Scaling = DXGI_MODE_SCALING_STRETCHED;
+ m_scd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
+ m_scd.BufferDesc.RefreshRate.Numerator = 60;
+ m_scd.BufferDesc.RefreshRate.Denominator = 1;
+ m_scd.SampleDesc.Count = 1;
+ m_scd.SampleDesc.Quality = 0;
+ m_scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ m_scd.BufferCount = bx::uint32_min(BX_COUNTOF(m_backBufferColor), 4);
+ m_scd.OutputWindow = (HWND)g_platformData.nwh;
+ m_scd.Windowed = true;
+ m_scd.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+ m_scd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
+
+ BX_CHECK(m_scd.BufferCount <= BX_COUNTOF(m_backBufferColor), "Swap chain buffer count %d (max %d)."
+ , m_scd.BufferCount
+ , BX_COUNTOF(m_backBufferColor)
+ );
+ hr = m_factory->CreateSwapChain(m_cmd.m_commandQueue
+ , &m_scd
+ , reinterpret_cast<IDXGISwapChain**>(&m_swapChain)
+ );
+ BX_WARN(SUCCEEDED(hr), "Failed to create swap chain.");
+ if (FAILED(hr) )
+ {
+ goto error;
+ }
+
+ m_presentElapsed = 0;
+
+ {
+ m_resolution.m_width = BGFX_DEFAULT_WIDTH;
+ m_resolution.m_height = BGFX_DEFAULT_HEIGHT;
+
+ DX_CHECK(m_factory->MakeWindowAssociation( (HWND)g_platformData.nwh
+ , 0
+ | DXGI_MWA_NO_WINDOW_CHANGES
+ | DXGI_MWA_NO_ALT_ENTER
+ ) );
+
+ m_numWindows = 1;
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
+ {
+ hr = m_device->QueryInterface(IID_ID3D12InfoQueue, (void**)&m_infoQueue);
+
+ if (SUCCEEDED(hr) )
+ {
+ m_infoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_CORRUPTION, true);
+ m_infoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_ERROR, true);
+ m_infoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, false);
+
+ D3D12_INFO_QUEUE_FILTER filter;
+ memset(&filter, 0, sizeof(filter) );
+
+ D3D12_MESSAGE_CATEGORY catlist[] =
+ {
+ D3D12_MESSAGE_CATEGORY_STATE_CREATION,
+ D3D12_MESSAGE_CATEGORY_EXECUTION,
+ };
+ filter.DenyList.NumCategories = BX_COUNTOF(catlist);
+ filter.DenyList.pCategoryList = catlist;
+ m_infoQueue->PushStorageFilter(&filter);
+
+ DX_RELEASE_WARNONLY(m_infoQueue, 0);
+ }
+ }
+
+ D3D12_DESCRIPTOR_HEAP_DESC rtvDescHeap;
+ rtvDescHeap.NumDescriptors = 0
+ + BX_COUNTOF(m_backBufferColor)
+ + BGFX_CONFIG_MAX_FRAME_BUFFERS*BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
+ ;
+ rtvDescHeap.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
+ rtvDescHeap.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
+ rtvDescHeap.NodeMask = 1;
+ DX_CHECK(m_device->CreateDescriptorHeap(&rtvDescHeap
+ , IID_ID3D12DescriptorHeap
+ , (void**)&m_rtvDescriptorHeap
+ ) );
+
+ D3D12_DESCRIPTOR_HEAP_DESC dsvDescHeap;
+ dsvDescHeap.NumDescriptors = 0
+ + 1 // reserved for depth backbuffer.
+ + BGFX_CONFIG_MAX_FRAME_BUFFERS
+ ;
+ dsvDescHeap.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
+ dsvDescHeap.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
+ dsvDescHeap.NodeMask = 1;
+ DX_CHECK(m_device->CreateDescriptorHeap(&dsvDescHeap
+ , IID_ID3D12DescriptorHeap
+ , (void**)&m_dsvDescriptorHeap
+ ) );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_scratchBuffer); ++ii)
+ {
+ m_scratchBuffer[ii].create(BGFX_CONFIG_MAX_DRAW_CALLS*1024
+ , BGFX_CONFIG_MAX_TEXTURES + BGFX_CONFIG_MAX_SHADERS + BGFX_CONFIG_MAX_DRAW_CALLS
+ );
+ }
+ m_samplerAllocator.create(D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER
+ , 1024
+ , BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
+ );
+
+ D3D12_DESCRIPTOR_RANGE descRange[] =
+ {
+ { D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
+ { D3D12_DESCRIPTOR_RANGE_TYPE_SRV, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
+ { D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
+ { D3D12_DESCRIPTOR_RANGE_TYPE_UAV, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, 0, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND },
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(descRange) == Rdt::Count);
+
+ D3D12_ROOT_PARAMETER rootParameter[] =
+ {
+ { D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::Sampler] } }, D3D12_SHADER_VISIBILITY_ALL },
+ { D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::SRV] } }, D3D12_SHADER_VISIBILITY_ALL },
+ { D3D12_ROOT_PARAMETER_TYPE_CBV, { { 0, 0 } }, D3D12_SHADER_VISIBILITY_ALL },
+ { D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::UAV] } }, D3D12_SHADER_VISIBILITY_ALL },
+ };
+ rootParameter[Rdt::CBV].Descriptor.RegisterSpace = 0;
+ rootParameter[Rdt::CBV].Descriptor.ShaderRegister = 0;
+
+ D3D12_ROOT_SIGNATURE_DESC descRootSignature;
+ descRootSignature.NumParameters = BX_COUNTOF(rootParameter);
+ descRootSignature.pParameters = rootParameter;
+ descRootSignature.NumStaticSamplers = 0;
+ descRootSignature.pStaticSamplers = NULL;
+ descRootSignature.Flags = D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT;
+
+ ID3DBlob* outBlob;
+ ID3DBlob* errorBlob;
+ DX_CHECK(D3D12SerializeRootSignature(&descRootSignature
+ , D3D_ROOT_SIGNATURE_VERSION_1
+ , &outBlob
+ , &errorBlob
+ ) );
+
+ DX_CHECK(m_device->CreateRootSignature(0
+ , outBlob->GetBufferPointer()
+ , outBlob->GetBufferSize()
+ , IID_ID3D12RootSignature
+ , (void**)&m_rootSignature
+ ) );
+
+ UniformHandle handle = BGFX_INVALID_HANDLE;
+ for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii)
+ {
+ m_uniformReg.add(handle, getPredefinedUniformName(PredefinedUniform::Enum(ii) ), &m_predefinedUniforms[ii]);
+ }
+
+ g_caps.supported |= ( 0
+ | BGFX_CAPS_TEXTURE_3D
+ | BGFX_CAPS_TEXTURE_COMPARE_ALL
+ | BGFX_CAPS_INSTANCING
+ | BGFX_CAPS_VERTEX_ATTRIB_HALF
+ | BGFX_CAPS_VERTEX_ATTRIB_UINT10
+ | BGFX_CAPS_FRAGMENT_DEPTH
+ | BGFX_CAPS_BLEND_INDEPENDENT
+ | BGFX_CAPS_COMPUTE
+ | (m_options.ROVsSupported ? BGFX_CAPS_FRAGMENT_ORDERING : 0)
+// | BGFX_CAPS_SWAP_CHAIN
+ );
+ g_caps.maxTextureSize = 16384;
+ g_caps.maxFBAttachments = uint8_t(bx::uint32_min(16, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
+
+ for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+ {
+ uint8_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ const DXGI_FORMAT fmt = isDepth(TextureFormat::Enum(ii) )
+ ? s_textureFormat[ii].m_fmtDsv
+ : s_textureFormat[ii].m_fmt
+ ;
+ const DXGI_FORMAT fmtSrgb = s_textureFormat[ii].m_fmtSrgb;
+
+ if (DXGI_FORMAT_UNKNOWN != fmt)
+ {
+ D3D12_FEATURE_DATA_FORMAT_SUPPORT data;
+ data.Format = fmt;
+ hr = m_device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
+ if (SUCCEEDED(hr) )
+ {
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_TEXTURE2D
+ | D3D12_FORMAT_SUPPORT1_TEXTURE3D
+ | D3D12_FORMAT_SUPPORT1_TEXTURECUBE
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_COLOR
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_BUFFER
+ | D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER
+ | D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_SHADER_LOAD
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_RENDER_TARGET
+ | D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+ else
+ {
+ BX_TRACE("CheckFeatureSupport failed with %x for format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ }
+
+ if (0 != (support & BGFX_CAPS_FORMAT_TEXTURE_IMAGE) )
+ {
+ // clear image flag for additional testing
+ support &= ~BGFX_CAPS_FORMAT_TEXTURE_IMAGE;
+
+ data.Format = s_textureFormat[ii].m_fmt;
+ hr = m_device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
+ if (SUCCEEDED(hr) )
+ {
+ support |= 0 != (data.Support2 & (0
+ | D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD
+ | D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_IMAGE
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+ }
+ }
+
+ if (DXGI_FORMAT_UNKNOWN != fmtSrgb)
+ {
+ struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
+ {
+ DXGI_FORMAT InFormat;
+ UINT OutFormatSupport;
+ };
+
+ D3D12_FEATURE_DATA_FORMAT_SUPPORT data;
+ data.Format = fmtSrgb;
+ hr = m_device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
+ if (SUCCEEDED(hr) )
+ {
+ support |= 0 != (data.Support1 & (0
+ | D3D12_FORMAT_SUPPORT1_TEXTURE2D
+ | D3D12_FORMAT_SUPPORT1_TEXTURE3D
+ | D3D12_FORMAT_SUPPORT1_TEXTURECUBE
+ ) )
+ ? BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+ else
+ {
+ BX_TRACE("CheckFeatureSupport failed with %x for sRGB format %s.", hr, getName(TextureFormat::Enum(ii) ) );
+ }
+ }
+
+ g_caps.formats[ii] = support;
+ }
+
+ postReset();
+
+ m_batch.create(4<<10);
+ }
+ return true;
+
+ error:
+ switch (errorState)
+ {
+ case ErrorState::CreatedCommandQueue:
+ m_cmd.shutdown();
+ case ErrorState::CreatedDXGIFactory:
+ DX_RELEASE(m_device, 0);
+ DX_RELEASE(m_adapter, 0);
+ DX_RELEASE(m_factory, 0);
+#if USE_D3D12_DYNAMIC_LIB
+ case ErrorState::LoadedDXGI:
+ bx::dlclose(m_dxgidll);
+ case ErrorState::LoadedD3D12:
+ bx::dlclose(m_d3d12dll);
+ case ErrorState::LoadedKernel32:
+ bx::dlclose(m_kernel32dll);
+#endif // USE_D3D12_DYNAMIC_LIB
+ case ErrorState::Default:
+ break;
+ }
+
+ return false;
+ }
+
+ void shutdown()
+ {
+ m_batch.destroy();
+
+ preReset();
+
+ m_samplerAllocator.destroy();
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_scratchBuffer); ++ii)
+ {
+ m_scratchBuffer[ii].destroy();
+ }
+
+ m_pipelineStateCache.invalidate();
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii)
+ {
+ m_indexBuffers[ii].destroy();
+ }
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_vertexBuffers); ++ii)
+ {
+ m_vertexBuffers[ii].destroy();
+ }
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_shaders); ++ii)
+ {
+ m_shaders[ii].destroy();
+ }
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
+ {
+ m_textures[ii].destroy();
+ }
+
+ DX_RELEASE(m_rtvDescriptorHeap, 0);
+ DX_RELEASE(m_dsvDescriptorHeap, 0);
+
+ DX_RELEASE(m_rootSignature, 0);
+
+ DX_RELEASE(m_swapChain, 0);
+
+ m_cmd.shutdown();
+
+ DX_RELEASE(m_device, 0);
+ DX_RELEASE(m_adapter, 0);
+ DX_RELEASE(m_factory, 0);
+
+#if USE_D3D12_DYNAMIC_LIB
+ bx::dlclose(m_dxgidll);
+ bx::dlclose(m_d3d12dll);
+ bx::dlclose(m_kernel32dll);
+#endif // USE_D3D12_DYNAMIC_LIB
+ }
+
+ RendererType::Enum getRendererType() const BX_OVERRIDE
+ {
+ return RendererType::Direct3D12;
+ }
+
+ const char* getRendererName() const BX_OVERRIDE
+ {
+ return BGFX_RENDERER_DIRECT3D12_NAME;
+ }
+
+ static bool isLost(HRESULT _hr)
+ {
+ return DXGI_ERROR_DEVICE_REMOVED == _hr
+ || DXGI_ERROR_DEVICE_HUNG == _hr
+ || DXGI_ERROR_DEVICE_RESET == _hr
+ || DXGI_ERROR_DRIVER_INTERNAL_ERROR == _hr
+ || DXGI_ERROR_NOT_CURRENTLY_AVAILABLE == _hr
+ ;
+ }
+
+ void flip(HMD& /*_hmd*/) BX_OVERRIDE
+ {
+ if (NULL != m_swapChain)
+ {
+ int64_t start = bx::getHPCounter();
+
+ HRESULT hr = 0;
+ uint32_t syncInterval = !!(m_flags & BGFX_RESET_VSYNC);
+ uint32_t flags = 0 == syncInterval ? DXGI_PRESENT_RESTART : 0;
+ for (uint32_t ii = 1, num = m_numWindows; ii < num && SUCCEEDED(hr); ++ii)
+ {
+ hr = m_frameBuffers[m_windows[ii].idx].m_swapChain->Present(syncInterval, flags);
+ }
+
+ if (SUCCEEDED(hr) )
+ {
+ m_cmd.finish(m_backBufferColorFence[(m_backBufferColorIdx-1) % m_scd.BufferCount]);
+ hr = m_swapChain->Present(syncInterval, flags);
+ }
+
+ int64_t now = bx::getHPCounter();
+ m_presentElapsed = now - start;
+
+ if (FAILED(hr)
+ && isLost(hr) )
+ {
+ ++m_lost;
+ BGFX_FATAL(10 > m_lost, bgfx::Fatal::DeviceLost, "Device is lost. FAILED 0x%08x", hr);
+ }
+ else
+ {
+ m_lost = 0;
+ }
+ }
+ }
+
+ void createIndexBuffer(IndexBufferHandle _handle, Memory* _mem, uint16_t _flags) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].create(_mem->size, _mem->data, _flags, false);
+ }
+
+ void destroyIndexBuffer(IndexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].destroy();
+ }
+
+ void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) BX_OVERRIDE
+ {
+ VertexDecl& decl = m_vertexDecls[_handle.idx];
+ memcpy(&decl, &_decl, sizeof(VertexDecl) );
+ dump(decl);
+ }
+
+ void destroyVertexDecl(VertexDeclHandle /*_handle*/) BX_OVERRIDE
+ {
+ }
+
+ void createVertexBuffer(VertexBufferHandle _handle, Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
+ }
+
+ void destroyVertexBuffer(VertexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].destroy();
+ }
+
+ void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].create(_size, NULL, _flags, false);
+ }
+
+ void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, Memory* _mem) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].update(m_commandList, _offset, bx::uint32_min(_size, _mem->size), _mem->data);
+ }
+
+ void destroyDynamicIndexBuffer(IndexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].destroy();
+ }
+
+ void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) BX_OVERRIDE
+ {
+ VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+ m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
+ }
+
+ void updateDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _offset, uint32_t _size, Memory* _mem) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].update(m_commandList, _offset, bx::uint32_min(_size, _mem->size), _mem->data);
+ }
+
+ void destroyDynamicVertexBuffer(VertexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].destroy();
+ }
+
+ void createShader(ShaderHandle _handle, Memory* _mem) BX_OVERRIDE
+ {
+ m_shaders[_handle.idx].create(_mem);
+ }
+
+ void destroyShader(ShaderHandle _handle) BX_OVERRIDE
+ {
+ m_shaders[_handle.idx].destroy();
+ }
+
+ void createProgram(ProgramHandle _handle, ShaderHandle _vsh, ShaderHandle _fsh) BX_OVERRIDE
+ {
+ m_program[_handle.idx].create(&m_shaders[_vsh.idx], isValid(_fsh) ? &m_shaders[_fsh.idx] : NULL);
+ }
+
+ void destroyProgram(ProgramHandle _handle) BX_OVERRIDE
+ {
+ m_program[_handle.idx].destroy();
+ }
+
+ void createTexture(TextureHandle _handle, Memory* _mem, uint32_t _flags, uint8_t _skip) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].create(_mem, _flags, _skip);
+ }
+
+ void updateTextureBegin(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/) BX_OVERRIDE
+ {
+ }
+
+ void updateTexture(TextureHandle _handle, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].update(m_commandList, _side, _mip, _rect, _z, _depth, _pitch, _mem);
+ }
+
+ void updateTextureEnd() BX_OVERRIDE
+ {
+ }
+
+ void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height) BX_OVERRIDE
+ {
+ TextureD3D12& texture = m_textures[_handle.idx];
+
+ uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate);
+ const Memory* mem = alloc(size);
+
+ bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
+ uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
+ bx::write(&writer, magic);
+
+ TextureCreate tc;
+ tc.m_flags = texture.m_flags;
+ tc.m_width = _width;
+ tc.m_height = _height;
+ tc.m_sides = 0;
+ tc.m_depth = 0;
+ tc.m_numMips = 1;
+ tc.m_format = texture.m_requestedFormat;
+ tc.m_cubeMap = false;
+ tc.m_mem = NULL;
+ bx::write(&writer, tc);
+
+ texture.destroy();
+ texture.create(mem, tc.m_flags, 0);
+
+ release(mem);
+ }
+
+ void destroyTexture(TextureHandle _handle) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].destroy();
+ }
+
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ {
+ m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ }
+
+ void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
+ {
+ uint16_t denseIdx = m_numWindows++;
+ m_windows[denseIdx] = _handle;
+ m_frameBuffers[_handle.idx].create(denseIdx, _nwh, _width, _height, _depthFormat);
+ }
+
+ void destroyFrameBuffer(FrameBufferHandle _handle) BX_OVERRIDE
+ {
+ uint16_t denseIdx = m_frameBuffers[_handle.idx].destroy();
+ if (UINT16_MAX != denseIdx)
+ {
+ --m_numWindows;
+ if (m_numWindows > 1)
+ {
+ FrameBufferHandle handle = m_windows[m_numWindows];
+ m_windows[denseIdx] = handle;
+ m_frameBuffers[handle.idx].m_denseIdx = denseIdx;
+ }
+ }
+ }
+
+ void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) BX_OVERRIDE
+ {
+ if (NULL != m_uniforms[_handle.idx])
+ {
+ BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ }
+
+ uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type] * _num);
+ void* data = BX_ALLOC(g_allocator, size);
+ memset(data, 0, size);
+ m_uniforms[_handle.idx] = data;
+ m_uniformReg.add(_handle, _name, data);
+ }
+
+ void destroyUniform(UniformHandle _handle) BX_OVERRIDE
+ {
+ BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ m_uniforms[_handle.idx] = NULL;
+ }
+
+ void saveScreenShot(const char* _filePath) BX_OVERRIDE
+ {
+ uint32_t idx = (m_backBufferColorIdx-1) % m_scd.BufferCount;
+ m_cmd.finish(m_backBufferColorFence[idx]);
+ ID3D12Resource* backBuffer = m_backBufferColor[idx];
+
+ D3D12_RESOURCE_DESC desc = backBuffer->GetDesc();
+
+ const uint32_t width = (uint32_t)desc.Width;
+ const uint32_t height = (uint32_t)desc.Height;
+
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT layout;
+ uint32_t numRows;
+ uint64_t total;
+ uint64_t pitch;
+ m_device->GetCopyableFootprints(&desc
+ , 0
+ , 1
+ , 0
+ , &layout
+ , &numRows
+ , &pitch
+ , &total
+ );
+
+ ID3D12Resource* readback = createCommittedResource(m_device, HeapProperty::ReadBack, total);
+
+ D3D12_BOX box;
+ box.left = 0;
+ box.top = 0;
+ box.right = width;
+ box.bottom = height;
+ box.front = 0;
+ box.back = 1;
+
+ setResourceBarrier(m_commandList, backBuffer, D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ D3D12_TEXTURE_COPY_LOCATION dst = { readback, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, { layout } };
+ D3D12_TEXTURE_COPY_LOCATION src = { backBuffer, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {} };
+ m_commandList->CopyTextureRegion(&dst, 0, 0, 0, &src, &box);
+ setResourceBarrier(m_commandList, backBuffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_PRESENT);
+ finish();
+ m_commandList = m_cmd.alloc();
+
+ void* data;
+ readback->Map(0, NULL, (void**)&data);
+ imageSwizzleBgra8(width
+ , height
+ , (uint32_t)pitch
+ , data
+ , data
+ );
+ g_callback->screenShot(_filePath
+ , width
+ , height
+ , (uint32_t)pitch
+ , data
+ , (uint32_t)total
+ , false
+ );
+ readback->Unmap(0, NULL);
+
+ DX_RELEASE(readback, 0);
+ }
+
+ void updateViewName(uint8_t /*_id*/, const char* /*_name*/) BX_OVERRIDE
+ {
+ }
+
+ void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE
+ {
+ memcpy(m_uniforms[_loc], _data, _size);
+ }
+
+ void setMarker(const char* /*_marker*/, uint32_t /*_size*/) BX_OVERRIDE
+ {
+ }
+
+ void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) BX_OVERRIDE;
+
+ void blitSetup(TextVideoMemBlitter& _blitter) BX_OVERRIDE
+ {
+ const uint32_t width = m_scd.BufferDesc.Width;
+ const uint32_t height = m_scd.BufferDesc.Height;
+
+ FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
+ setFrameBuffer(fbh, false);
+
+ D3D12_VIEWPORT vp;
+ vp.TopLeftX = 0;
+ vp.TopLeftY = 0;
+ vp.Width = (float)width;
+ vp.Height = (float)height;
+ vp.MinDepth = 0.0f;
+ vp.MaxDepth = 1.0f;
+ m_commandList->RSSetViewports(1, &vp);
+
+ D3D12_RECT rc;
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = width;
+ rc.bottom = height;
+ m_commandList->RSSetScissorRects(1, &rc);
+
+ const uint64_t state = 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_TEST_ALWAYS
+ ;
+
+ ID3D12PipelineState* pso = getPipelineState(state
+ , packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
+ , _blitter.m_vb->decl.idx
+ , _blitter.m_program.idx
+ , 0
+ );
+ m_commandList->SetPipelineState(pso);
+ m_commandList->SetGraphicsRootSignature(m_rootSignature);
+
+ float proj[16];
+ bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
+
+ PredefinedUniform& predefined = m_program[_blitter.m_program.idx].m_predefined[0];
+ uint8_t flags = predefined.m_type;
+ setShaderUniform(flags, predefined.m_loc, proj, 4);
+
+ D3D12_GPU_VIRTUAL_ADDRESS gpuAddress;
+ commitShaderConstants(_blitter.m_program.idx, gpuAddress);
+
+ ScratchBufferD3D12& scratchBuffer = m_scratchBuffer[m_backBufferColorIdx];
+ ID3D12DescriptorHeap* heaps[] =
+ {
+ m_samplerAllocator.getHeap(),
+ scratchBuffer.getHeap(),
+ };
+ m_commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps);
+ m_commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, gpuAddress);
+
+ TextureD3D12& texture = m_textures[_blitter.m_texture.idx];
+ uint32_t samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS] = { texture.m_flags & BGFX_TEXTURE_SAMPLER_BITS_MASK };
+ uint16_t samplerStateIdx = getSamplerState(samplerFlags, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, NULL);
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
+ D3D12_GPU_DESCRIPTOR_HANDLE srvHandle;
+ scratchBuffer.allocSrv(srvHandle, texture);
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, srvHandle);
+
+ VertexBufferD3D12& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
+ const VertexDecl& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
+ D3D12_VERTEX_BUFFER_VIEW viewDesc;
+ viewDesc.BufferLocation = vb.m_gpuVA;
+ viewDesc.StrideInBytes = vertexDecl.m_stride;
+ viewDesc.SizeInBytes = vb.m_size;
+ m_commandList->IASetVertexBuffers(0, 1, &viewDesc);
+
+ const BufferD3D12& ib = m_indexBuffers[_blitter.m_ib->handle.idx];
+ D3D12_INDEX_BUFFER_VIEW ibv;
+ ibv.Format = DXGI_FORMAT_R16_UINT;
+ ibv.BufferLocation = ib.m_gpuVA;
+ ibv.SizeInBytes = ib.m_size;
+ m_commandList->IASetIndexBuffer(&ibv);
+
+ m_commandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ }
+
+ void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
+ {
+ const uint32_t numVertices = _numIndices*4/6;
+ if (0 < numVertices)
+ {
+ m_indexBuffers [_blitter.m_ib->handle.idx].update(m_commandList, 0, _numIndices*2, _blitter.m_ib->data);
+ m_vertexBuffers[_blitter.m_vb->handle.idx].update(m_commandList, 0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
+
+ m_commandList->DrawIndexedInstanced(_numIndices
+ , 1
+ , 0
+ , 0
+ , 0
+ );
+ }
+ }
+
+ void preReset()
+ {
+ finishAll();
+
+ for (uint32_t ii = 0, num = m_scd.BufferCount; ii < num; ++ii)
+ {
+ DX_RELEASE(m_backBufferColor[ii], num-1-ii);
+ }
+ DX_RELEASE(m_backBufferDepthStencil, 0);
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii)
+ {
+ m_frameBuffers[ii].preReset();
+ }
+
+ invalidateCache();
+
+// capturePreReset();
+ }
+
+ void postReset()
+ {
+ memset(m_backBufferColorFence, 0, sizeof(m_backBufferColorFence) );
+
+ uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
+
+ for (uint32_t ii = 0, num = m_scd.BufferCount; ii < num; ++ii)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE handle = m_rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ handle.ptr += ii * rtvDescriptorSize;
+ DX_CHECK(m_swapChain->GetBuffer(ii
+ , IID_ID3D12Resource
+ , (void**)&m_backBufferColor[ii]
+ ) );
+ m_device->CreateRenderTargetView(m_backBufferColor[ii], NULL, handle);
+ }
+
+ D3D12_RESOURCE_DESC resourceDesc;
+ resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ resourceDesc.Alignment = 0;
+ resourceDesc.Width = bx::uint32_max(m_resolution.m_width, 1);
+ resourceDesc.Height = bx::uint32_max(m_resolution.m_height, 1);
+ resourceDesc.DepthOrArraySize = 1;
+ resourceDesc.MipLevels = 0;
+ resourceDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
+ resourceDesc.SampleDesc.Count = 1;
+ resourceDesc.SampleDesc.Quality = 0;
+ resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resourceDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
+
+ D3D12_CLEAR_VALUE clearValue;
+ clearValue.Format = resourceDesc.Format;
+ clearValue.DepthStencil.Depth = 1.0f;
+ clearValue.DepthStencil.Stencil = 0;
+
+ m_backBufferDepthStencil = createCommittedResource(m_device, HeapProperty::Default, &resourceDesc, &clearValue);
+
+ D3D12_DEPTH_STENCIL_VIEW_DESC dsvDesc;
+ ZeroMemory(&dsvDesc, sizeof(dsvDesc) );
+ dsvDesc.Format = resourceDesc.Format;
+ dsvDesc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2D;
+ dsvDesc.Flags = D3D12_DSV_FLAGS(0)
+// | D3D12_DSV_FLAG_READ_ONLY_DEPTH
+// | D3D12_DSV_FLAG_READ_ONLY_DEPTH
+ ;
+
+ m_device->CreateDepthStencilView(m_backBufferDepthStencil
+ , &dsvDesc
+ , m_dsvDescriptorHeap->GetCPUDescriptorHandleForHeapStart()
+ );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii)
+ {
+ m_frameBuffers[ii].postReset();
+ }
+
+ m_commandList = m_cmd.alloc();
+// capturePostReset();
+ }
+
+ void invalidateCache()
+ {
+ m_pipelineStateCache.invalidate();
+
+ m_samplerStateCache.invalidate();
+ m_samplerAllocator.reset();
+ }
+
+ void updateMsaa()
+ {
+ for (uint32_t ii = 1, last = 0; ii < BX_COUNTOF(s_msaa); ++ii)
+ {
+ uint32_t msaa = s_checkMsaa[ii];
+
+ D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS data;
+ memset(&data, 0, sizeof(msaa) );
+ data.Format = m_scd.BufferDesc.Format;
+ data.SampleCount = msaa;
+ data.Flags = D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
+ HRESULT hr = m_device->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &data, sizeof(data) );
+
+data.NumQualityLevels = 0;
+
+ if (SUCCEEDED(hr)
+ && 0 < data.NumQualityLevels)
+ {
+ s_msaa[ii].Count = data.SampleCount;
+ s_msaa[ii].Quality = data.NumQualityLevels - 1;
+ last = ii;
+ }
+ else
+ {
+ s_msaa[ii] = s_msaa[last];
+ }
+ }
+ }
+
+ void updateResolution(const Resolution& _resolution)
+ {
+ if (!!(_resolution.m_flags & BGFX_RESET_MAXANISOTROPY) )
+ {
+ m_maxAnisotropy = D3D12_REQ_MAXANISOTROPY;
+ }
+ else
+ {
+ m_maxAnisotropy = 1;
+ }
+
+ if ( (uint32_t)m_scd.BufferDesc.Width != _resolution.m_width
+ || (uint32_t)m_scd.BufferDesc.Height != _resolution.m_height
+ || m_flags != _resolution.m_flags)
+ {
+ bool resize = (m_flags&BGFX_RESET_MSAA_MASK) == (_resolution.m_flags&BGFX_RESET_MSAA_MASK);
+ m_flags = _resolution.m_flags;
+
+ m_textVideoMem.resize(false, _resolution.m_width, _resolution.m_height);
+ m_textVideoMem.clear();
+
+ m_resolution = _resolution;
+ m_scd.BufferDesc.Width = _resolution.m_width;
+ m_scd.BufferDesc.Height = _resolution.m_height;
+
+ preReset();
+
+ if (resize)
+ {
+ uint32_t nodeMask[] = { 1, 1, 1, 1 };
+ BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(nodeMask) );
+ IUnknown* presentQueue[] ={ m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue, m_cmd.m_commandQueue };
+ BX_STATIC_ASSERT(BX_COUNTOF(m_backBufferColor) == BX_COUNTOF(presentQueue) );
+
+ DX_CHECK(m_swapChain->ResizeBuffers1(m_scd.BufferCount
+ , m_scd.BufferDesc.Width
+ , m_scd.BufferDesc.Height
+ , m_scd.BufferDesc.Format
+ , m_scd.Flags
+ , nodeMask
+ , presentQueue
+ ) );
+ }
+ else
+ {
+ updateMsaa();
+ m_scd.SampleDesc = s_msaa[(m_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT];
+
+ DX_RELEASE(m_swapChain, 0);
+
+ HRESULT hr;
+ hr = m_factory->CreateSwapChain(m_cmd.m_commandQueue
+ , &m_scd
+ , reinterpret_cast<IDXGISwapChain**>(&m_swapChain)
+ );
+ BGFX_FATAL(SUCCEEDED(hr), bgfx::Fatal::UnableToInitialize, "Failed to create swap chain.");
+ }
+
+ postReset();
+ }
+ }
+
+ void setShaderUniform(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs)
+ {
+ if (_flags&BGFX_UNIFORM_FRAGMENTBIT)
+ {
+ memcpy(&m_fsScratch[_regIndex], _val, _numRegs*16);
+ m_fsChanges += _numRegs;
+ }
+ else
+ {
+ memcpy(&m_vsScratch[_regIndex], _val, _numRegs*16);
+ m_vsChanges += _numRegs;
+ }
+ }
+
+ void setShaderUniform4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs)
+ {
+ setShaderUniform(_flags, _regIndex, _val, _numRegs);
+ }
+
+ void setShaderUniform4x4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs)
+ {
+ setShaderUniform(_flags, _regIndex, _val, _numRegs);
+ }
+
+ void commitShaderConstants(uint16_t _programIdx, D3D12_GPU_VIRTUAL_ADDRESS& _gpuAddress)
+ {
+ ProgramD3D12& program = m_program[_programIdx];
+ uint32_t total = bx::strideAlign(0
+ + program.m_vsh->m_size
+ + (NULL != program.m_fsh ? program.m_fsh->m_size : 0)
+ , D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT
+ );
+ uint8_t* data = (uint8_t*)m_scratchBuffer[m_backBufferColorIdx].allocCbv(_gpuAddress, total);
+
+ {
+ uint32_t size = program.m_vsh->m_size;
+ memcpy(data, m_vsScratch, size);
+ data += size;
+
+ m_vsChanges = 0;
+ }
+
+ if (NULL != program.m_fsh)
+ {
+ memcpy(data, m_fsScratch, program.m_fsh->m_size);
+
+ m_fsChanges = 0;
+ }
+ }
+
+ void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true)
+ {
+ if (isValid(m_fbh)
+ && m_fbh.idx != _fbh.idx)
+ {
+ const FrameBufferD3D12& frameBuffer = m_frameBuffers[m_fbh.idx];
+
+ for (uint8_t ii = 0, num = frameBuffer.m_num; ii < num; ++ii)
+ {
+ TextureD3D12& texture = m_textures[frameBuffer.m_texture[ii].idx];
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
+ }
+
+ if (isValid(frameBuffer.m_depth) )
+ {
+ TextureD3D12& texture = m_textures[frameBuffer.m_depth.idx];
+ const bool bufferOnly = 0 != (texture.m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ if (!bufferOnly)
+ {
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_DEPTH_READ);
+ }
+ }
+ }
+
+ if (!isValid(_fbh) )
+ {
+ m_rtvHandle = m_rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
+ m_rtvHandle.ptr += m_backBufferColorIdx * rtvDescriptorSize;
+ m_dsvHandle = m_dsvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+
+ m_currentColor = &m_rtvHandle;
+ m_currentDepthStencil = &m_dsvHandle;
+ m_commandList->OMSetRenderTargets(1, m_currentColor, true, m_currentDepthStencil);
+ }
+ else
+ {
+ const FrameBufferD3D12& frameBuffer = m_frameBuffers[_fbh.idx];
+
+ if (0 < frameBuffer.m_num)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor = m_rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
+ m_rtvHandle.ptr = rtvDescriptor.ptr + (BX_COUNTOF(m_backBufferColor) + _fbh.idx * BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) * rtvDescriptorSize;
+ m_currentColor = &m_rtvHandle;
+ }
+ else
+ {
+ m_currentColor = NULL;
+ }
+
+ if (isValid(frameBuffer.m_depth) )
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE dsvDescriptor = m_dsvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t dsvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
+ m_dsvHandle.ptr = dsvDescriptor.ptr + (1 + _fbh.idx) * dsvDescriptorSize;
+ m_currentDepthStencil = &m_dsvHandle;
+ }
+ else
+ {
+ m_currentDepthStencil = NULL;
+ }
+
+ for (uint8_t ii = 0, num = frameBuffer.m_num; ii < num; ++ii)
+ {
+ TextureD3D12& texture = m_textures[frameBuffer.m_texture[ii].idx];
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_RENDER_TARGET);
+ }
+
+ if (isValid(frameBuffer.m_depth) )
+ {
+ TextureD3D12& texture = m_textures[frameBuffer.m_depth.idx];
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_DEPTH_WRITE);
+ }
+
+ m_commandList->OMSetRenderTargets(frameBuffer.m_num
+ , m_currentColor
+ , true
+ , m_currentDepthStencil
+ );
+ }
+
+ m_fbh = _fbh;
+ m_rtMsaa = _msaa;
+ }
+
+ void setBlendState(D3D12_BLEND_DESC& desc, uint64_t _state, uint32_t _rgba = 0)
+ {
+ memset(&desc, 0, sizeof(desc) );
+ desc.IndependentBlendEnable = !!(BGFX_STATE_BLEND_INDEPENDENT & _state);
+
+ D3D12_RENDER_TARGET_BLEND_DESC* drt = &desc.RenderTarget[0];
+ drt->BlendEnable = !!(BGFX_STATE_BLEND_MASK & _state);
+
+ {
+ const uint32_t blend = uint32_t( (_state & BGFX_STATE_BLEND_MASK ) >> BGFX_STATE_BLEND_SHIFT);
+ const uint32_t equation = uint32_t( (_state & BGFX_STATE_BLEND_EQUATION_MASK) >> BGFX_STATE_BLEND_EQUATION_SHIFT);
+
+ const uint32_t srcRGB = (blend ) & 0xf;
+ const uint32_t dstRGB = (blend >> 4) & 0xf;
+ const uint32_t srcA = (blend >> 8) & 0xf;
+ const uint32_t dstA = (blend >> 12) & 0xf;
+
+ const uint32_t equRGB = (equation ) & 0x7;
+ const uint32_t equA = (equation >> 3) & 0x7;
+
+ drt->SrcBlend = s_blendFactor[srcRGB][0];
+ drt->DestBlend = s_blendFactor[dstRGB][0];
+ drt->BlendOp = s_blendEquation[equRGB];
+
+ drt->SrcBlendAlpha = s_blendFactor[srcA][1];
+ drt->DestBlendAlpha = s_blendFactor[dstA][1];
+ drt->BlendOpAlpha = s_blendEquation[equA];
+ }
+
+ uint8_t writeMask = (_state & BGFX_STATE_ALPHA_WRITE)
+ ? D3D12_COLOR_WRITE_ENABLE_ALPHA
+ : 0
+ ;
+ writeMask |= (_state & BGFX_STATE_RGB_WRITE)
+ ? D3D12_COLOR_WRITE_ENABLE_RED
+ | D3D12_COLOR_WRITE_ENABLE_GREEN
+ | D3D12_COLOR_WRITE_ENABLE_BLUE
+ : 0
+ ;
+
+ drt->RenderTargetWriteMask = writeMask;
+
+ if (desc.IndependentBlendEnable)
+ {
+ for (uint32_t ii = 1, rgba = _rgba; ii < BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; ++ii, rgba >>= 11)
+ {
+ drt = &desc.RenderTarget[ii];
+ drt->BlendEnable = 0 != (rgba & 0x7ff);
+
+ const uint32_t src = (rgba ) & 0xf;
+ const uint32_t dst = (rgba >> 4) & 0xf;
+ const uint32_t equation = (rgba >> 8) & 0x7;
+
+ drt->SrcBlend = s_blendFactor[src][0];
+ drt->DestBlend = s_blendFactor[dst][0];
+ drt->BlendOp = s_blendEquation[equation];
+
+ drt->SrcBlendAlpha = s_blendFactor[src][1];
+ drt->DestBlendAlpha = s_blendFactor[dst][1];
+ drt->BlendOpAlpha = s_blendEquation[equation];
+
+ drt->RenderTargetWriteMask = writeMask;
+ }
+ }
+ else
+ {
+ for (uint32_t ii = 1; ii < BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; ++ii)
+ {
+ memcpy(&desc.RenderTarget[ii], drt, sizeof(D3D12_RENDER_TARGET_BLEND_DESC) );
+ }
+ }
+ }
+
+ void setRasterizerState(D3D12_RASTERIZER_DESC& desc, uint64_t _state, bool _wireframe = false)
+ {
+ const uint32_t cull = (_state&BGFX_STATE_CULL_MASK) >> BGFX_STATE_CULL_SHIFT;
+
+ desc.FillMode = _wireframe
+ ? D3D12_FILL_MODE_WIREFRAME
+ : D3D12_FILL_MODE_SOLID
+ ;
+ desc.CullMode = s_cullMode[cull];
+ desc.FrontCounterClockwise = false;
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.0f;
+ desc.SlopeScaledDepthBias = 0.0f;
+ desc.DepthClipEnable = false;
+ desc.MultisampleEnable = !!(_state&BGFX_STATE_MSAA);
+ desc.AntialiasedLineEnable = false;
+ desc.ForcedSampleCount = 0;
+ desc.ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
+ }
+
+ void setDepthStencilState(D3D12_DEPTH_STENCIL_DESC& desc, uint64_t _state, uint64_t _stencil = 0)
+ {
+ const uint32_t fstencil = unpackStencil(0, _stencil);
+
+ memset(&desc, 0, sizeof(desc) );
+ uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
+ desc.DepthEnable = 0 != func;
+ desc.DepthWriteMask = !!(BGFX_STATE_DEPTH_WRITE & _state)
+ ? D3D12_DEPTH_WRITE_MASK_ALL
+ : D3D12_DEPTH_WRITE_MASK_ZERO
+ ;
+ desc.DepthFunc = s_cmpFunc[func];
+
+ uint32_t bstencil = unpackStencil(1, _stencil);
+ uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil;
+ bstencil = frontAndBack ? bstencil : fstencil;
+
+ desc.StencilEnable = 0 != _stencil;
+ desc.StencilReadMask = (fstencil & BGFX_STENCIL_FUNC_RMASK_MASK) >> BGFX_STENCIL_FUNC_RMASK_SHIFT;
+ desc.StencilWriteMask = 0xff;
+
+ desc.FrontFace.StencilFailOp = s_stencilOp[(fstencil & BGFX_STENCIL_OP_FAIL_S_MASK) >> BGFX_STENCIL_OP_FAIL_S_SHIFT];
+ desc.FrontFace.StencilDepthFailOp = s_stencilOp[(fstencil & BGFX_STENCIL_OP_FAIL_Z_MASK) >> BGFX_STENCIL_OP_FAIL_Z_SHIFT];
+ desc.FrontFace.StencilPassOp = s_stencilOp[(fstencil & BGFX_STENCIL_OP_PASS_Z_MASK) >> BGFX_STENCIL_OP_PASS_Z_SHIFT];
+ desc.FrontFace.StencilFunc = s_cmpFunc[(fstencil & BGFX_STENCIL_TEST_MASK) >> BGFX_STENCIL_TEST_SHIFT];
+
+ desc.BackFace.StencilFailOp = s_stencilOp[(bstencil & BGFX_STENCIL_OP_FAIL_S_MASK) >> BGFX_STENCIL_OP_FAIL_S_SHIFT];
+ desc.BackFace.StencilDepthFailOp = s_stencilOp[(bstencil & BGFX_STENCIL_OP_FAIL_Z_MASK) >> BGFX_STENCIL_OP_FAIL_Z_SHIFT];
+ desc.BackFace.StencilPassOp = s_stencilOp[(bstencil & BGFX_STENCIL_OP_PASS_Z_MASK) >> BGFX_STENCIL_OP_PASS_Z_SHIFT];
+ desc.BackFace.StencilFunc = s_cmpFunc[(bstencil&BGFX_STENCIL_TEST_MASK) >> BGFX_STENCIL_TEST_SHIFT];
+ }
+
+ uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, const VertexDecl& _vertexDecl, const ProgramD3D12& _program, uint8_t _numInstanceData)
+ {
+ VertexDecl decl;
+ memcpy(&decl, &_vertexDecl, sizeof(VertexDecl) );
+ const uint16_t* attrMask = _program.m_vsh->m_attrMask;
+
+ for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
+ {
+ uint16_t mask = attrMask[ii];
+ uint16_t attr = (decl.m_attributes[ii] & mask);
+ decl.m_attributes[ii] = attr == 0 ? UINT16_MAX : attr == UINT16_MAX ? 0 : attr;
+ }
+
+ D3D12_INPUT_ELEMENT_DESC* elem = fillVertexDecl(_vertexElements, decl);
+ uint32_t num = uint32_t(elem-_vertexElements);
+
+ const D3D12_INPUT_ELEMENT_DESC inst = { "TEXCOORD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA, 1 };
+
+ for (uint32_t ii = 0; ii < _numInstanceData; ++ii)
+ {
+ uint32_t index = 7 - ii; // TEXCOORD7 = i_data0, TEXCOORD6 = i_data1, etc.
+
+ uint32_t jj;
+ D3D12_INPUT_ELEMENT_DESC* curr = _vertexElements;
+ for (jj = 0; jj < num; ++jj)
+ {
+ curr = &_vertexElements[jj];
+ if (0 == strcmp(curr->SemanticName, "TEXCOORD")
+ && curr->SemanticIndex == index)
+ {
+ break;
+ }
+ }
+
+ if (jj == num)
+ {
+ curr = elem;
+ ++elem;
+ }
+
+ memcpy(curr, &inst, sizeof(D3D12_INPUT_ELEMENT_DESC) );
+ curr->InputSlot = 1;
+ curr->SemanticIndex = index;
+ curr->AlignedByteOffset = ii*16;
+ }
+
+ return uint32_t(elem-_vertexElements);
+ }
+
+ static void patchCb0(DxbcInstruction& _instruction, void* _userData)
+ {
+ union { void* ptr; uint32_t offset; } cast = { _userData };
+
+ for (uint32_t ii = 0; ii < _instruction.numOperands; ++ii)
+ {
+ DxbcOperand& operand = _instruction.operand[ii];
+ if (DxbcOperandType::ConstantBuffer == operand.type)
+ {
+ if (DxbcOperandAddrMode::Imm32 == operand.addrMode[0]
+ && 0 == operand.regIndex[0]
+ && DxbcOperandAddrMode::Imm32 == operand.addrMode[1])
+ {
+ operand.regIndex[1] += cast.offset;
+ }
+ }
+ }
+ }
+
+ ID3D12PipelineState* getPipelineState(uint16_t _programIdx)
+ {
+ ProgramD3D12& program = m_program[_programIdx];
+
+ const uint32_t hash = program.m_vsh->m_hash;
+
+ ID3D12PipelineState* pso = m_pipelineStateCache.find(hash);
+
+ if (BX_LIKELY(NULL != pso) )
+ {
+ return pso;
+ }
+
+ D3D12_COMPUTE_PIPELINE_STATE_DESC desc;
+ memset(&desc, 0, sizeof(desc) );
+
+ desc.pRootSignature = m_rootSignature;
+
+ desc.CS.pShaderBytecode = program.m_vsh->m_code->data;
+ desc.CS.BytecodeLength = program.m_vsh->m_code->size;
+
+ DX_CHECK(m_device->CreateComputePipelineState(&desc
+ , IID_ID3D12PipelineState
+ , (void**)&pso
+ ) );
+ m_pipelineStateCache.add(hash, pso);
+
+ return pso;
+ }
+
+ ID3D12PipelineState* getPipelineState(uint64_t _state, uint64_t _stencil, uint16_t _declIdx, uint16_t _programIdx, uint8_t _numInstanceData)
+ {
+ ProgramD3D12& program = m_program[_programIdx];
+
+ _state &= 0
+ | BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_WRITE
+ | BGFX_STATE_DEPTH_TEST_MASK
+ | BGFX_STATE_BLEND_MASK
+ | BGFX_STATE_BLEND_EQUATION_MASK
+ | BGFX_STATE_BLEND_INDEPENDENT
+ | BGFX_STATE_CULL_MASK
+ | BGFX_STATE_MSAA
+ | BGFX_STATE_PT_MASK
+ ;
+
+ _stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, BGFX_STENCIL_MASK);
+
+ VertexDecl decl;
+ memcpy(&decl, &m_vertexDecls[_declIdx], sizeof(VertexDecl) );
+ const uint16_t* attrMask = program.m_vsh->m_attrMask;
+
+ for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
+ {
+ uint16_t mask = attrMask[ii];
+ uint16_t attr = (decl.m_attributes[ii] & mask);
+ decl.m_attributes[ii] = attr == 0 ? UINT16_MAX : attr == UINT16_MAX ? 0 : attr;
+ }
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_state);
+ murmur.add(_stencil);
+ murmur.add(program.m_vsh->m_hash);
+ murmur.add(program.m_vsh->m_attrMask, sizeof(program.m_vsh->m_attrMask) );
+ murmur.add(program.m_fsh->m_hash);
+ murmur.add(m_vertexDecls[_declIdx].m_hash);
+ murmur.add(decl.m_attributes, sizeof(decl.m_attributes) );
+ murmur.add(m_fbh.idx);
+ murmur.add(_numInstanceData);
+ const uint32_t hash = murmur.end();
+
+ ID3D12PipelineState* pso = m_pipelineStateCache.find(hash);
+
+ if (NULL != pso)
+ {
+ return pso;
+ }
+
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC desc;
+ memset(&desc, 0, sizeof(desc) );
+
+ desc.pRootSignature = m_rootSignature;
+
+ desc.VS.pShaderBytecode = program.m_vsh->m_code->data;
+ desc.VS.BytecodeLength = program.m_vsh->m_code->size;
+
+ const Memory* temp = alloc(program.m_fsh->m_code->size);
+ memset(temp->data, 0, temp->size);
+ bx::MemoryReader rd(program.m_fsh->m_code->data, program.m_fsh->m_code->size);
+ bx::StaticMemoryBlockWriter wr(temp->data, temp->size);
+
+ DxbcContext dxbc;
+ read(&rd, dxbc);
+
+ bool patchShader = true;
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
+ {
+ union { uint32_t offset; void* ptr; } cast = { 0 };
+ filter(dxbc.shader, dxbc.shader, patchCb0, cast.ptr);
+
+ write(&wr, dxbc);
+
+ dxbcHash(temp->data + 20, temp->size - 20, temp->data + 4);
+
+ patchShader = 0 == memcmp(program.m_fsh->m_code->data, temp->data, 16);
+ BX_CHECK(patchShader, "DXBC fragment shader patching error (ShaderHandle: %d).", program.m_fsh - m_shaders);
+
+ if (!patchShader)
+ {
+ for (uint32_t ii = 20; ii < temp->size; ii += 16)
+ {
+ if (0 != memcmp(&program.m_fsh->m_code->data[ii], &temp->data[ii], 16) )
+ {
+// dbgPrintfData(&program.m_fsh->m_code->data[ii], temp->size-ii, "");
+// dbgPrintfData(&temp->data[ii], temp->size-ii, "");
+ break;
+ }
+ }
+
+ desc.PS.pShaderBytecode = program.m_fsh->m_code->data;
+ desc.PS.BytecodeLength = program.m_fsh->m_code->size;
+ }
+ }
+
+ if (patchShader)
+ {
+ memcpy(temp->data, program.m_fsh->m_code->data, program.m_fsh->m_code->size);
+
+ bx::seek(&wr, 0, bx::Whence::Begin);
+ union { uint32_t offset; void* ptr; } cast =
+ {
+ uint32_t(program.m_vsh->m_size)/16
+ };
+ filter(dxbc.shader, dxbc.shader, patchCb0, cast.ptr);
+ write(&wr, dxbc);
+ dxbcHash(temp->data + 20, temp->size - 20, temp->data + 4);
+
+ desc.PS.pShaderBytecode = temp->data;
+ desc.PS.BytecodeLength = temp->size;
+ }
+
+ desc.DS.pShaderBytecode = NULL;
+ desc.DS.BytecodeLength = 0;
+
+ desc.HS.pShaderBytecode = NULL;
+ desc.HS.BytecodeLength = 0;
+
+ desc.GS.pShaderBytecode = NULL;
+ desc.GS.BytecodeLength = 0;
+
+ desc.StreamOutput.pSODeclaration = NULL;
+ desc.StreamOutput.NumEntries = 0;
+ desc.StreamOutput.pBufferStrides = NULL;
+ desc.StreamOutput.NumStrides = 0;
+ desc.StreamOutput.RasterizedStream = 0;
+
+ setBlendState(desc.BlendState, _state);
+ desc.SampleMask = 1;
+ setRasterizerState(desc.RasterizerState, _state);
+ setDepthStencilState(desc.DepthStencilState, _state, _stencil);
+
+ D3D12_INPUT_ELEMENT_DESC vertexElements[Attrib::Count + 1 + BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
+ desc.InputLayout.NumElements = setInputLayout(vertexElements, m_vertexDecls[_declIdx], program, _numInstanceData);
+ desc.InputLayout.pInputElementDescs = vertexElements;
+
+ uint8_t primIndex = uint8_t( (_state&BGFX_STATE_PT_MASK) >> BGFX_STATE_PT_SHIFT);
+ desc.PrimitiveTopologyType = s_primInfo[primIndex].m_topologyType;
+
+ if (isValid(m_fbh) )
+ {
+ const FrameBufferD3D12& frameBuffer = m_frameBuffers[m_fbh.idx];
+ desc.NumRenderTargets = frameBuffer.m_num;
+
+ for (uint8_t ii = 0, num = frameBuffer.m_num; ii < num; ++ii)
+ {
+ desc.RTVFormats[ii] = m_textures[frameBuffer.m_texture[ii].idx].m_srvd.Format;
+ }
+
+ if (isValid(frameBuffer.m_depth) )
+ {
+ desc.DSVFormat = s_textureFormat[m_textures[frameBuffer.m_depth.idx].m_textureFormat].m_fmtDsv;
+ }
+ else
+ {
+ desc.DSVFormat = DXGI_FORMAT_UNKNOWN;
+ }
+ }
+ else
+ {
+ desc.NumRenderTargets = 1;
+ desc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
+ desc.DSVFormat = DXGI_FORMAT_D24_UNORM_S8_UINT;
+ }
+
+ desc.SampleDesc.Count = 1;
+ desc.SampleDesc.Quality = 0;
+
+ uint32_t length = g_callback->cacheReadSize(hash);
+ bool cached = length > 0;
+
+ void* cachedData = NULL;
+
+ if (cached)
+ {
+ cachedData = BX_ALLOC(g_allocator, length);
+ if (g_callback->cacheRead(hash, cachedData, length) )
+ {
+ BX_TRACE("Loading cached PSO (size %d).", length);
+ bx::MemoryReader reader(cachedData, length);
+
+ desc.CachedPSO.pCachedBlob = reader.getDataPtr();
+ desc.CachedPSO.CachedBlobSizeInBytes = (size_t)reader.remaining();
+
+ HRESULT hr = m_device->CreateGraphicsPipelineState(&desc
+ , IID_ID3D12PipelineState
+ , (void**)&pso
+ );
+ if (FAILED(hr) )
+ {
+ BX_TRACE("Failed to load cached PSO (HRESULT 0x%08x).", hr);
+ memset(&desc.CachedPSO, 0, sizeof(desc.CachedPSO) );
+ }
+ }
+ }
+
+ if (NULL == pso)
+ {
+ DX_CHECK(m_device->CreateGraphicsPipelineState(&desc
+ , IID_ID3D12PipelineState
+ , (void**)&pso
+ ) );
+ }
+ m_pipelineStateCache.add(hash, pso);
+
+ release(temp);
+
+ ID3DBlob* blob;
+ HRESULT hr = pso->GetCachedBlob(&blob);
+ if (SUCCEEDED(hr) )
+ {
+ void* data = blob->GetBufferPointer();
+ length = (uint32_t)blob->GetBufferSize();
+
+ g_callback->cacheWrite(hash, data, length);
+
+ DX_RELEASE(blob, 0);
+ }
+
+ if (NULL != cachedData)
+ {
+ BX_FREE(g_allocator, cachedData);
+ }
+
+ return pso;
+ }
+
+ uint16_t getSamplerState(const uint32_t* _flags, uint32_t _num, const float _palette[][4])
+ {
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_flags, _num * sizeof(uint32_t) );
+ uint32_t hash = murmur.end();
+
+ uint16_t sampler = m_samplerStateCache.find(hash);
+ if (UINT16_MAX == sampler)
+ {
+ sampler = m_samplerAllocator.alloc(_flags, _num, _palette);
+ m_samplerStateCache.add(hash, sampler);
+ }
+
+ return sampler;
+ }
+
+ void commit(UniformBuffer& _uniformBuffer)
+ {
+ _uniformBuffer.reset();
+
+ for (;;)
+ {
+ uint32_t opcode = _uniformBuffer.read();
+
+ if (UniformType::End == opcode)
+ {
+ break;
+ }
+
+ UniformType::Enum type;
+ uint16_t loc;
+ uint16_t num;
+ uint16_t copy;
+ UniformBuffer::decodeOpcode(opcode, type, loc, num, copy);
+
+ const char* data;
+ if (copy)
+ {
+ data = _uniformBuffer.read(g_uniformTypeSize[type]*num);
+ }
+ else
+ {
+ UniformHandle handle;
+ memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
+ data = (const char*)m_uniforms[handle.idx];
+ }
+
+#define CASE_IMPLEMENT_UNIFORM(_uniform, _dxsuffix, _type) \
+ case UniformType::_uniform: \
+ case UniformType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
+ { \
+ setShaderUniform(uint8_t(type), loc, data, num); \
+ } \
+ break;
+
+ switch ( (uint32_t)type)
+ {
+ case UniformType::Mat3:
+ case UniformType::Mat3|BGFX_UNIFORM_FRAGMENTBIT:
+ {
+ float* value = (float*)data;
+ for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9)
+ {
+ Matrix4 mtx;
+ mtx.un.val[ 0] = value[0];
+ mtx.un.val[ 1] = value[1];
+ mtx.un.val[ 2] = value[2];
+ mtx.un.val[ 3] = 0.0f;
+ mtx.un.val[ 4] = value[3];
+ mtx.un.val[ 5] = value[4];
+ mtx.un.val[ 6] = value[5];
+ mtx.un.val[ 7] = 0.0f;
+ mtx.un.val[ 8] = value[6];
+ mtx.un.val[ 9] = value[7];
+ mtx.un.val[10] = value[8];
+ mtx.un.val[11] = 0.0f;
+ setShaderUniform(uint8_t(type), loc, &mtx.un.val[0], 3);
+ }
+ }
+ break;
+
+ CASE_IMPLEMENT_UNIFORM(Int1, I, int);
+ CASE_IMPLEMENT_UNIFORM(Vec4, F, float);
+ CASE_IMPLEMENT_UNIFORM(Mat4, F, float);
+
+ case UniformType::End:
+ break;
+
+ default:
+ BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy);
+ break;
+ }
+#undef CASE_IMPLEMENT_UNIFORM
+ }
+ }
+
+ void clear(const Clear& _clear, const float _palette[][4], const D3D12_RECT* _rect = NULL, uint32_t _num = 0)
+ {
+ if (isValid(m_fbh) )
+ {
+ FrameBufferD3D12& frameBuffer = m_frameBuffers[m_fbh.idx];
+ frameBuffer.clear(m_commandList, _clear, _palette);
+ }
+ else
+ {
+ if (NULL != m_currentColor
+ && BGFX_CLEAR_COLOR & _clear.m_flags)
+ {
+ if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
+ {
+ uint8_t index = _clear.m_index[0];
+ if (UINT8_MAX != index)
+ {
+ m_commandList->ClearRenderTargetView(*m_currentColor
+ , _palette[index]
+ , _num
+ , _rect
+ );
+ }
+ }
+ else
+ {
+ float frgba[4] =
+ {
+ _clear.m_index[0] * 1.0f / 255.0f,
+ _clear.m_index[1] * 1.0f / 255.0f,
+ _clear.m_index[2] * 1.0f / 255.0f,
+ _clear.m_index[3] * 1.0f / 255.0f,
+ };
+ m_commandList->ClearRenderTargetView(*m_currentColor
+ , frgba
+ , _num
+ , _rect
+ );
+ }
+ }
+
+ if (NULL != m_currentDepthStencil
+ && (BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL) & _clear.m_flags)
+ {
+ uint32_t flags = 0;
+ flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH ) ? D3D12_CLEAR_FLAG_DEPTH : 0;
+ flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL) ? D3D12_CLEAR_FLAG_STENCIL : 0;
+
+ m_commandList->ClearDepthStencilView(*m_currentDepthStencil
+ , D3D12_CLEAR_FLAGS(flags)
+ , _clear.m_depth
+ , _clear.m_stencil
+ , _num
+ , _rect
+ );
+ }
+ }
+ }
+
+ void clearQuad(const Rect& _rect, const Clear& _clear, const float _palette[][4])
+ {
+ uint32_t width;
+ uint32_t height;
+
+ if (isValid(m_fbh) )
+ {
+ const FrameBufferD3D12& fb = m_frameBuffers[m_fbh.idx];
+ width = fb.m_width;
+ height = fb.m_height;
+ }
+ else
+ {
+ width = m_scd.BufferDesc.Width;
+ height = m_scd.BufferDesc.Height;
+ }
+
+ if (0 == _rect.m_x
+ && 0 == _rect.m_y
+ && width == _rect.m_width
+ && height == _rect.m_height)
+ {
+ clear(_clear, _palette);
+ }
+ else
+ {
+ D3D12_RECT rect;
+ rect.left = _rect.m_x;
+ rect.top = _rect.m_y;
+ rect.right = _rect.m_x + _rect.m_width;
+ rect.bottom = _rect.m_y + _rect.m_height;
+ clear(_clear, _palette, &rect);
+ }
+ }
+
+ uint64_t kick()
+ {
+ uint64_t fence = m_cmd.kick();
+ m_commandList = m_cmd.alloc();
+ return fence;
+ }
+
+ void finish()
+ {
+ m_cmd.kick();
+ m_cmd.finish();
+ m_commandList = NULL;
+ }
+
+ void finishAll()
+ {
+ uint64_t fence = m_cmd.kick();
+ m_cmd.finish(fence, true);
+ m_commandList = NULL;
+ }
+
+ void* m_kernel32dll;
+ void* m_d3d12dll;
+ void* m_dxgidll;
+
+ D3D_DRIVER_TYPE m_driverType;
+ IDXGIAdapter3* m_adapter;
+ DXGI_ADAPTER_DESC m_adapterDesc;
+ D3D12_FEATURE_DATA_ARCHITECTURE m_architecture;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS m_options;
+
+ IDXGIFactory4* m_factory;
+
+ IDXGISwapChain3* m_swapChain;
+ int64_t m_presentElapsed;
+ uint16_t m_lost;
+ uint16_t m_numWindows;
+ FrameBufferHandle m_windows[BGFX_CONFIG_MAX_FRAME_BUFFERS];
+
+ ID3D12Device* m_device;
+ ID3D12InfoQueue* m_infoQueue;
+
+ ID3D12DescriptorHeap* m_rtvDescriptorHeap;
+ ID3D12DescriptorHeap* m_dsvDescriptorHeap;
+ D3D12_CPU_DESCRIPTOR_HANDLE m_rtvHandle;
+ D3D12_CPU_DESCRIPTOR_HANDLE m_dsvHandle;
+ D3D12_CPU_DESCRIPTOR_HANDLE* m_currentColor;
+ D3D12_CPU_DESCRIPTOR_HANDLE* m_currentDepthStencil;
+ ID3D12Resource* m_backBufferColor[4];
+ uint64_t m_backBufferColorFence[4];
+ ID3D12Resource* m_backBufferDepthStencil;
+
+ ScratchBufferD3D12 m_scratchBuffer[4];
+ DescriptorAllocatorD3D12 m_samplerAllocator;
+
+ ID3D12RootSignature* m_rootSignature;
+
+ CommandQueueD3D12 m_cmd;
+ BatchD3D12 m_batch;
+ ID3D12GraphicsCommandList* m_commandList;
+
+ Resolution m_resolution;
+ bool m_wireframe;
+
+ DXGI_SWAP_CHAIN_DESC m_scd;
+ uint32_t m_flags;
+ uint32_t m_maxAnisotropy;
+
+ BufferD3D12 m_indexBuffers[BGFX_CONFIG_MAX_INDEX_BUFFERS];
+ VertexBufferD3D12 m_vertexBuffers[BGFX_CONFIG_MAX_VERTEX_BUFFERS];
+ ShaderD3D12 m_shaders[BGFX_CONFIG_MAX_SHADERS];
+ ProgramD3D12 m_program[BGFX_CONFIG_MAX_PROGRAMS];
+ TextureD3D12 m_textures[BGFX_CONFIG_MAX_TEXTURES];
+ VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+ FrameBufferD3D12 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
+ void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
+ Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
+ UniformRegistry m_uniformReg;
+
+ StateCacheT<ID3D12PipelineState> m_pipelineStateCache;
+ StateCache m_samplerStateCache;
+
+ TextVideoMem m_textVideoMem;
+
+ uint8_t m_fsScratch[64<<10];
+ uint8_t m_vsScratch[64<<10];
+ uint32_t m_fsChanges;
+ uint32_t m_vsChanges;
+
+ FrameBufferHandle m_fbh;
+ uint32_t m_backBufferColorIdx;
+ bool m_rtMsaa;
+ };
+
+ static RendererContextD3D12* s_renderD3D12;
+
+ RendererContextI* rendererCreate()
+ {
+ s_renderD3D12 = BX_NEW(g_allocator, RendererContextD3D12);
+ if (!s_renderD3D12->init() )
+ {
+ BX_DELETE(g_allocator, s_renderD3D12);
+ s_renderD3D12 = NULL;
+ }
+ return s_renderD3D12;
+ }
+
+ void rendererDestroy()
+ {
+ s_renderD3D12->shutdown();
+ BX_DELETE(g_allocator, s_renderD3D12);
+ s_renderD3D12 = NULL;
+ }
+
+ void ScratchBufferD3D12::create(uint32_t _size, uint32_t _maxDescriptors)
+ {
+ m_size = _size;
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+
+ m_incrementSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
+
+ D3D12_DESCRIPTOR_HEAP_DESC desc;
+ desc.NumDescriptors = _maxDescriptors;
+ desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
+ desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
+ desc.NodeMask = 1;
+ DX_CHECK(device->CreateDescriptorHeap(&desc
+ , IID_ID3D12DescriptorHeap
+ , (void**)&m_heap
+ ) );
+
+ m_upload = createCommittedResource(device, HeapProperty::Upload, desc.NumDescriptors * 1024);
+ m_gpuVA = m_upload->GetGPUVirtualAddress();
+ m_upload->Map(0, NULL, (void**)&m_data);
+
+ reset(m_gpuHandle);
+ }
+
+ void ScratchBufferD3D12::destroy()
+ {
+ m_upload->Unmap(0, NULL);
+
+ DX_RELEASE(m_upload, 0);
+ DX_RELEASE(m_heap, 0);
+ }
+
+ void ScratchBufferD3D12::reset(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle)
+ {
+ m_pos = 0;
+ m_cpuHandle = m_heap->GetCPUDescriptorHandleForHeapStart();
+ m_gpuHandle = m_heap->GetGPUDescriptorHandleForHeapStart();
+ gpuHandle = m_gpuHandle;
+ }
+
+ void* ScratchBufferD3D12::allocCbv(D3D12_GPU_VIRTUAL_ADDRESS& _gpuAddress, uint32_t _size)
+ {
+ _gpuAddress = m_gpuVA + m_pos;
+ D3D12_CONSTANT_BUFFER_VIEW_DESC desc;
+ desc.BufferLocation = _gpuAddress;
+ desc.SizeInBytes = _size;
+
+ void* data = &m_data[m_pos];
+
+ m_pos += BX_ALIGN_256(_size);
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ device->CreateConstantBufferView(&desc
+ , m_cpuHandle
+ );
+ m_cpuHandle.ptr += m_incrementSize;
+ m_gpuHandle.ptr += m_incrementSize;
+
+ return data;
+ }
+
+ void ScratchBufferD3D12::allocSrv(D3D12_GPU_DESCRIPTOR_HANDLE& _gpuHandle, TextureD3D12& _texture, uint8_t _mip)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+
+ D3D12_SHADER_RESOURCE_VIEW_DESC tmpSrvd;
+ D3D12_SHADER_RESOURCE_VIEW_DESC* srvd = &_texture.m_srvd;
+ if (0 != _mip)
+ {
+ memcpy(&tmpSrvd, srvd, sizeof(tmpSrvd) );
+ srvd = &tmpSrvd;
+
+ switch (_texture.m_srvd.ViewDimension)
+ {
+ default:
+ case D3D12_SRV_DIMENSION_TEXTURE2D:
+ srvd->Texture2D.MostDetailedMip = _mip;
+ srvd->Texture2D.MipLevels = 1;
+ srvd->Texture2D.PlaneSlice = 0;
+ srvd->Texture2D.ResourceMinLODClamp = 0;
+ break;
+
+ case D3D12_SRV_DIMENSION_TEXTURECUBE:
+ srvd->TextureCube.MostDetailedMip = _mip;
+ srvd->TextureCube.MipLevels = 1;
+ srvd->TextureCube.ResourceMinLODClamp = 0;
+ break;
+
+ case D3D12_SRV_DIMENSION_TEXTURE3D:
+ srvd->Texture3D.MostDetailedMip = _mip;
+ srvd->Texture3D.MipLevels = 1;
+ srvd->Texture3D.ResourceMinLODClamp = 0;
+ break;
+ }
+ }
+
+ device->CreateShaderResourceView(_texture.m_ptr
+ , srvd
+ , m_cpuHandle
+ );
+ m_cpuHandle.ptr += m_incrementSize;
+
+ _gpuHandle = m_gpuHandle;
+ m_gpuHandle.ptr += m_incrementSize;
+ }
+
+ void ScratchBufferD3D12::allocUav(D3D12_GPU_DESCRIPTOR_HANDLE& _gpuHandle, TextureD3D12& _texture, uint8_t _mip)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+
+ D3D12_UNORDERED_ACCESS_VIEW_DESC tmpUavd;
+ D3D12_UNORDERED_ACCESS_VIEW_DESC* uavd = &_texture.m_uavd;
+ if (0 != _mip)
+ {
+ memcpy(&tmpUavd, uavd, sizeof(tmpUavd) );
+ uavd = &tmpUavd;
+
+ switch (_texture.m_uavd.ViewDimension)
+ {
+ default:
+ case D3D12_UAV_DIMENSION_TEXTURE2D:
+ uavd->Texture2D.MipSlice = _mip;
+ uavd->Texture2D.PlaneSlice = 0;
+ break;
+
+ case D3D12_UAV_DIMENSION_TEXTURE3D:
+ uavd->Texture3D.MipSlice = _mip;
+ break;
+ }
+ }
+
+ device->CreateUnorderedAccessView(_texture.m_ptr
+ , NULL
+ , uavd
+ , m_cpuHandle
+ );
+ m_cpuHandle.ptr += m_incrementSize;
+
+ _gpuHandle = m_gpuHandle;
+ m_gpuHandle.ptr += m_incrementSize;
+ }
+
+ void ScratchBufferD3D12::allocSrv(D3D12_GPU_DESCRIPTOR_HANDLE& _gpuHandle, BufferD3D12& _buffer)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+ device->CreateShaderResourceView(_buffer.m_ptr
+ , &_buffer.m_srvd
+ , m_cpuHandle
+ );
+ m_cpuHandle.ptr += m_incrementSize;
+
+ _gpuHandle = m_gpuHandle;
+ m_gpuHandle.ptr += m_incrementSize;
+ }
+
+ void ScratchBufferD3D12::allocUav(D3D12_GPU_DESCRIPTOR_HANDLE& _gpuHandle, BufferD3D12& _buffer)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+ device->CreateUnorderedAccessView(_buffer.m_ptr
+ , NULL
+ , &_buffer.m_uavd
+ , m_cpuHandle
+ );
+ m_cpuHandle.ptr += m_incrementSize;
+
+ _gpuHandle = m_gpuHandle;
+ m_gpuHandle.ptr += m_incrementSize;
+ }
+
+ void DescriptorAllocatorD3D12::create(D3D12_DESCRIPTOR_HEAP_TYPE _type, uint16_t _maxDescriptors, uint16_t _numDescriptorsPerBlock)
+ {
+ m_handleAlloc = bx::createHandleAlloc(g_allocator, _maxDescriptors);
+ m_numDescriptorsPerBlock = _numDescriptorsPerBlock;
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+
+ m_incrementSize = device->GetDescriptorHandleIncrementSize(_type);
+
+ D3D12_DESCRIPTOR_HEAP_DESC desc;
+ desc.NumDescriptors = _maxDescriptors;
+ desc.Type = _type;
+ desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
+ desc.NodeMask = 1;
+ DX_CHECK(device->CreateDescriptorHeap(&desc
+ , IID_ID3D12DescriptorHeap
+ , (void**)&m_heap
+ ) );
+
+ m_cpuHandle = m_heap->GetCPUDescriptorHandleForHeapStart();
+ m_gpuHandle = m_heap->GetGPUDescriptorHandleForHeapStart();
+ }
+
+ void DescriptorAllocatorD3D12::destroy()
+ {
+ bx::destroyHandleAlloc(g_allocator, m_handleAlloc);
+
+ DX_RELEASE(m_heap, 0);
+ }
+
+ uint16_t DescriptorAllocatorD3D12::alloc(ID3D12Resource* _ptr, const D3D12_SHADER_RESOURCE_VIEW_DESC* _desc)
+ {
+ uint16_t idx = m_handleAlloc->alloc();
+
+ D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle = { m_cpuHandle.ptr + idx * m_incrementSize };
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ device->CreateShaderResourceView(_ptr
+ , _desc
+ , cpuHandle
+ );
+
+ return idx;
+ }
+
+ uint16_t DescriptorAllocatorD3D12::alloc(const uint32_t* _flags, uint32_t _num, const float _palette[][4])
+ {
+ uint16_t idx = m_handleAlloc->alloc();
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ uint32_t maxAnisotropy = s_renderD3D12->m_maxAnisotropy;
+
+ for (uint32_t ii = 0; ii < _num; ++ii)
+ {
+ uint32_t flags = _flags[ii];
+
+ const uint32_t cmpFunc = (flags&BGFX_TEXTURE_COMPARE_MASK)>>BGFX_TEXTURE_COMPARE_SHIFT;
+ const uint8_t minFilter = s_textureFilter[0][(flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT];
+ const uint8_t magFilter = s_textureFilter[1][(flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
+ const uint8_t mipFilter = s_textureFilter[2][(flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
+ const uint8_t filter = 0 == cmpFunc ? 0 : D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT;
+
+ D3D12_SAMPLER_DESC sd;
+ sd.Filter = (D3D12_FILTER)(filter|minFilter|magFilter|mipFilter);
+ sd.AddressU = s_textureAddress[(flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
+ sd.AddressV = s_textureAddress[(flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
+ sd.AddressW = s_textureAddress[(flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT];
+ sd.MipLODBias = 0.0f;
+ sd.MaxAnisotropy = maxAnisotropy;
+ sd.ComparisonFunc = 0 == cmpFunc ? D3D12_COMPARISON_FUNC_NEVER : s_cmpFunc[cmpFunc];
+
+ uint32_t index = (flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
+
+ if (NULL != _palette
+ && needBorderColor(flags) )
+ {
+ const float* rgba = _palette[index];
+ sd.BorderColor[0] = rgba[0];
+ sd.BorderColor[1] = rgba[1];
+ sd.BorderColor[2] = rgba[2];
+ sd.BorderColor[3] = rgba[3];
+ }
+ else
+ {
+ sd.BorderColor[0] = 0.0f;
+ sd.BorderColor[1] = 0.0f;
+ sd.BorderColor[2] = 0.0f;
+ sd.BorderColor[3] = 0.0f;
+ }
+ sd.MinLOD = 0;
+ sd.MaxLOD = D3D12_FLOAT32_MAX;
+
+ D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle =
+ {
+ m_cpuHandle.ptr + (idx * m_numDescriptorsPerBlock + ii) * m_incrementSize
+ };
+
+ device->CreateSampler(&sd, cpuHandle);
+ }
+
+ return idx;
+ }
+
+ void DescriptorAllocatorD3D12::free(uint16_t _idx)
+ {
+ m_handleAlloc->free(_idx);
+ }
+
+ void DescriptorAllocatorD3D12::reset()
+ {
+ uint16_t max = m_handleAlloc->getMaxHandles();
+ bx::destroyHandleAlloc(g_allocator, m_handleAlloc);
+ m_handleAlloc = bx::createHandleAlloc(g_allocator, max);
+ }
+
+ D3D12_GPU_DESCRIPTOR_HANDLE DescriptorAllocatorD3D12::get(uint16_t _idx)
+ {
+ D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle = { m_gpuHandle.ptr + _idx * m_numDescriptorsPerBlock * m_incrementSize };
+ return gpuHandle;
+ }
+
+ void CommandQueueD3D12::init(ID3D12Device* _device)
+ {
+ D3D12_COMMAND_QUEUE_DESC queueDesc;
+ queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
+ queueDesc.Priority = 0;
+ queueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
+ queueDesc.NodeMask = 1;
+ DX_CHECK(_device->CreateCommandQueue(&queueDesc
+ , IID_ID3D12CommandQueue
+ , (void**)&m_commandQueue
+ ) );
+
+ m_completedFence = 0;
+ m_currentFence = 0;
+ DX_CHECK(_device->CreateFence(0
+ , D3D12_FENCE_FLAG_NONE
+ , IID_ID3D12Fence
+ , (void**)&m_fence
+ ) );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_commandList); ++ii)
+ {
+ DX_CHECK(_device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT
+ , IID_ID3D12CommandAllocator
+ , (void**)&m_commandList[ii].m_commandAllocator
+ ) );
+
+ DX_CHECK(_device->CreateCommandList(0
+ , D3D12_COMMAND_LIST_TYPE_DIRECT
+ , m_commandList[ii].m_commandAllocator
+ , NULL
+ , IID_ID3D12GraphicsCommandList
+ , (void**)&m_commandList[ii].m_commandList
+ ) );
+
+ DX_CHECK(m_commandList[ii].m_commandList->Close() );
+ }
+ }
+
+ void CommandQueueD3D12::shutdown()
+ {
+ finish(UINT64_MAX, true);
+
+ DX_RELEASE(m_fence, 0);
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_commandList); ++ii)
+ {
+ DX_RELEASE(m_commandList[ii].m_commandAllocator, 0);
+ DX_RELEASE(m_commandList[ii].m_commandList, 0);
+ }
+
+ DX_RELEASE(m_commandQueue, 0);
+ }
+
+ ID3D12GraphicsCommandList* CommandQueueD3D12::alloc()
+ {
+ while (0 == m_control.reserve(1) )
+ {
+ consume();
+ }
+
+ CommandList& commandList = m_commandList[m_control.m_current];
+ DX_CHECK(commandList.m_commandAllocator->Reset() );
+ DX_CHECK(commandList.m_commandList->Reset(commandList.m_commandAllocator, NULL) );
+ return commandList.m_commandList;
+ }
+
+ uint64_t CommandQueueD3D12::kick()
+ {
+ CommandList& commandList = m_commandList[m_control.m_current];
+ DX_CHECK(commandList.m_commandList->Close() );
+
+ ID3D12CommandList* commandLists[] = { commandList.m_commandList };
+ m_commandQueue->ExecuteCommandLists(BX_COUNTOF(commandLists), commandLists);
+
+ commandList.m_event = CreateEventExA(NULL, NULL, 0, EVENT_ALL_ACCESS);
+ const uint64_t fence = m_currentFence++;
+ m_commandQueue->Signal(m_fence, fence);
+ m_fence->SetEventOnCompletion(fence, commandList.m_event);
+
+ m_control.commit(1);
+
+ return fence;
+ }
+
+ void CommandQueueD3D12::finish(uint64_t _waitFence, bool _finishAll)
+ {
+ while (0 < m_control.available() )
+ {
+ consume();
+
+ if (!_finishAll
+ && _waitFence <= m_completedFence)
+ {
+ return;
+ }
+ }
+
+ BX_CHECK(0 == m_control.available(), "");
+ }
+
+ bool CommandQueueD3D12::tryFinish(uint64_t _waitFence)
+ {
+ if (0 < m_control.available() )
+ {
+ if (consume(0)
+ && _waitFence <= m_completedFence)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ void CommandQueueD3D12::release(ID3D12Resource* _ptr)
+ {
+ m_release[m_control.m_current].push_back(_ptr);
+ }
+
+ bool CommandQueueD3D12::consume(uint32_t _ms)
+ {
+ CommandList& commandList = m_commandList[m_control.m_read];
+ if (WAIT_OBJECT_0 == WaitForSingleObject(commandList.m_event, _ms) )
+ {
+ CloseHandle(commandList.m_event);
+ commandList.m_event = NULL;
+ m_completedFence = m_fence->GetCompletedValue();
+ m_commandQueue->Wait(m_fence, m_completedFence);
+
+ ResourceArray& ra = m_release[m_control.m_read];
+ for (ResourceArray::iterator it = ra.begin(), itEnd = ra.end(); it != itEnd; ++it)
+ {
+ DX_RELEASE(*it, 0);
+ }
+ ra.clear();
+
+ m_control.consume(1);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ void BatchD3D12::create(uint32_t _maxDrawPerBatch)
+ {
+ m_maxDrawPerBatch = _maxDrawPerBatch;
+ setSeqMode(false);
+ setIndirectMode(true);
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ ID3D12RootSignature* rootSignature = s_renderD3D12->m_rootSignature;
+
+ D3D12_INDIRECT_ARGUMENT_DESC drawArgDesc[] =
+ {
+ { D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { { Rdt::CBV } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 0 } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 1 } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_DRAW, { { 0 } } },
+ };
+
+ D3D12_COMMAND_SIGNATURE_DESC drawCommandSignature =
+ {
+ sizeof(DrawIndirectCommand),
+ BX_COUNTOF(drawArgDesc),
+ drawArgDesc,
+ 1,
+ };
+
+ DX_CHECK(device->CreateCommandSignature(&drawCommandSignature
+ , rootSignature
+ , IID_ID3D12CommandSignature
+ , (void**)&m_commandSignature[Draw]
+ ) );
+
+ D3D12_INDIRECT_ARGUMENT_DESC drawIndexedArgDesc[] =
+ {
+ { D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { { Rdt::CBV } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 0 } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 1 } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW, { { 0 } } },
+ { D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED, { { 0 } } },
+ };
+
+ D3D12_COMMAND_SIGNATURE_DESC drawIndexedCommandSignature =
+ {
+ sizeof(DrawIndexedIndirectCommand),
+ BX_COUNTOF(drawIndexedArgDesc),
+ drawIndexedArgDesc,
+ 1,
+ };
+
+ DX_CHECK(device->CreateCommandSignature(&drawIndexedCommandSignature
+ , rootSignature
+ , IID_ID3D12CommandSignature
+ , (void**)&m_commandSignature[DrawIndexed]
+ ) );
+
+ m_cmds[Draw ] = BX_ALLOC(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndirectCommand) );
+ m_cmds[DrawIndexed] = BX_ALLOC(g_allocator, m_maxDrawPerBatch*sizeof(DrawIndexedIndirectCommand) );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_indirect); ++ii)
+ {
+ m_indirect[ii].create(m_maxDrawPerBatch*sizeof(DrawIndexedIndirectCommand)
+ , NULL
+ , BGFX_BUFFER_DRAW_INDIRECT
+ , false
+ , sizeof(DrawIndexedIndirectCommand)
+ );
+ }
+ }
+
+ void BatchD3D12::destroy()
+ {
+ BX_FREE(g_allocator, m_cmds[0]);
+ BX_FREE(g_allocator, m_cmds[1]);
+
+ DX_RELEASE(m_commandSignature[0], 0);
+ DX_RELEASE(m_commandSignature[1], 0);
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_indirect); ++ii)
+ {
+ m_indirect[ii].destroy();
+ }
+ }
+
+ template<typename Ty>
+ Ty& BatchD3D12::getCmd(Enum _type)
+ {
+ uint32_t index = m_num[_type];
+ BX_CHECK(index < m_maxDrawPerBatch, "Memory corruption...");
+ m_num[_type]++;
+ Ty* cmd = &reinterpret_cast<Ty*>(m_cmds[_type])[index];
+ return *cmd;
+ }
+
+ uint32_t BatchD3D12::draw(ID3D12GraphicsCommandList* _commandList, D3D12_GPU_VIRTUAL_ADDRESS _cbv, const RenderDraw& _draw)
+ {
+ Enum type = Enum(!!isValid(_draw.m_indexBuffer) );
+
+ VertexBufferD3D12& vb = s_renderD3D12->m_vertexBuffers[_draw.m_vertexBuffer.idx];
+ vb.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+
+ uint16_t declIdx = !isValid(vb.m_decl) ? _draw.m_vertexDecl.idx : vb.m_decl.idx;
+ const VertexDecl& vertexDecl = s_renderD3D12->m_vertexDecls[declIdx];
+ uint32_t numIndices = 0;
+
+ if (Draw == type)
+ {
+ const uint32_t numVertices = UINT32_MAX == _draw.m_numVertices
+ ? vb.m_size / vertexDecl.m_stride
+ : _draw.m_numVertices
+ ;
+
+ DrawIndirectCommand& cmd = getCmd<DrawIndirectCommand>(Draw);
+ cmd.cbv = _cbv;
+ cmd.vbv[0].BufferLocation = vb.m_gpuVA;
+ cmd.vbv[0].StrideInBytes = vertexDecl.m_stride;
+ cmd.vbv[0].SizeInBytes = vb.m_size;
+ if (isValid(_draw.m_instanceDataBuffer) )
+ {
+ VertexBufferD3D12& inst = s_renderD3D12->m_vertexBuffers[_draw.m_instanceDataBuffer.idx];
+ inst.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+ cmd.vbv[1].BufferLocation = inst.m_gpuVA + _draw.m_instanceDataOffset;
+ cmd.vbv[1].StrideInBytes = _draw.m_instanceDataStride;
+ cmd.vbv[1].SizeInBytes = _draw.m_numInstances * _draw.m_instanceDataStride;
+ }
+ else
+ {
+ memset(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
+ }
+ cmd.draw.InstanceCount = _draw.m_numInstances;
+ cmd.draw.VertexCountPerInstance = numVertices;
+ cmd.draw.StartVertexLocation = _draw.m_startVertex;
+ cmd.draw.StartInstanceLocation = 0;
+ }
+ else
+ {
+ BufferD3D12& ib = s_renderD3D12->m_indexBuffers[_draw.m_indexBuffer.idx];
+ ib.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+
+ const bool hasIndex16 = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32);
+ const uint32_t indexSize = hasIndex16 ? 2 : 4;
+
+ numIndices = UINT32_MAX == _draw.m_numIndices
+ ? ib.m_size / indexSize
+ : _draw.m_numIndices
+ ;
+
+ DrawIndexedIndirectCommand& cmd = getCmd<DrawIndexedIndirectCommand>(DrawIndexed);
+ cmd.cbv = _cbv;
+ cmd.ibv.BufferLocation = ib.m_gpuVA;
+ cmd.ibv.SizeInBytes = ib.m_size;
+ cmd.ibv.Format = hasIndex16
+ ? DXGI_FORMAT_R16_UINT
+ : DXGI_FORMAT_R32_UINT
+ ;
+ cmd.vbv[0].BufferLocation = vb.m_gpuVA;
+ cmd.vbv[0].StrideInBytes = vertexDecl.m_stride;
+ cmd.vbv[0].SizeInBytes = vb.m_size;
+ if (isValid(_draw.m_instanceDataBuffer) )
+ {
+ VertexBufferD3D12& inst = s_renderD3D12->m_vertexBuffers[_draw.m_instanceDataBuffer.idx];
+ inst.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+ cmd.vbv[1].BufferLocation = inst.m_gpuVA + _draw.m_instanceDataOffset;
+ cmd.vbv[1].StrideInBytes = _draw.m_instanceDataStride;
+ cmd.vbv[1].SizeInBytes = _draw.m_numInstances * _draw.m_instanceDataStride;
+ }
+ else
+ {
+ memset(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
+ }
+ cmd.drawIndexed.IndexCountPerInstance = numIndices;
+ cmd.drawIndexed.InstanceCount = _draw.m_numInstances;
+ cmd.drawIndexed.StartIndexLocation = _draw.m_startIndex;
+ cmd.drawIndexed.BaseVertexLocation = _draw.m_startVertex;
+ cmd.drawIndexed.StartInstanceLocation = 0;
+ }
+
+ if (BX_UNLIKELY(m_flushPerBatch == m_num[type]) )
+ {
+ flush(_commandList, type);
+ }
+
+ return numIndices;
+ }
+
+ static const uint32_t s_indirectCommandSize[] =
+ {
+ sizeof(BatchD3D12::DrawIndirectCommand),
+ sizeof(BatchD3D12::DrawIndexedIndirectCommand),
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_indirectCommandSize) == BatchD3D12::Count);
+
+ void BatchD3D12::flush(ID3D12GraphicsCommandList* _commandList, Enum _type)
+ {
+ uint32_t num = m_num[_type];
+ if (0 != num)
+ {
+ m_num[_type] = 0;
+
+ if (m_minIndirect < num)
+ {
+ m_stats.m_numIndirect[_type]++;
+
+ BufferD3D12& indirect = m_indirect[m_currIndirect++];
+ m_currIndirect %= BX_COUNTOF(m_indirect);
+
+ indirect.update(_commandList, 0, num*s_indirectCommandSize[_type], m_cmds[_type]);
+
+ _commandList->ExecuteIndirect(m_commandSignature[_type]
+ , num
+ , indirect.m_ptr
+ , 0
+ , NULL
+ , 0
+ );
+ }
+ else
+ {
+ m_stats.m_numImmediate[_type]++;
+
+ if (Draw == _type)
+ {
+ const DrawIndirectCommand* cmds = reinterpret_cast<DrawIndirectCommand*>(m_cmds[_type]);
+
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ const DrawIndirectCommand& cmd = cmds[ii];
+ if (m_current.cbv != cmd.cbv)
+ {
+ m_current.cbv = cmd.cbv;
+ _commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, cmd.cbv);
+ }
+
+ if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
+ {
+ memcpy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
+ _commandList->IASetVertexBuffers(0
+ , 0 == cmd.vbv[1].BufferLocation ? 1 : 2
+ , cmd.vbv
+ );
+ }
+
+ _commandList->DrawInstanced(
+ cmd.draw.VertexCountPerInstance
+ , cmd.draw.InstanceCount
+ , cmd.draw.StartVertexLocation
+ , cmd.draw.StartInstanceLocation
+ );
+ }
+ }
+ else
+ {
+ const DrawIndexedIndirectCommand* cmds = reinterpret_cast<DrawIndexedIndirectCommand*>(m_cmds[_type]);
+
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ const DrawIndexedIndirectCommand& cmd = cmds[ii];
+ if (m_current.cbv != cmd.cbv)
+ {
+ m_current.cbv = cmd.cbv;
+ _commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, cmd.cbv);
+ }
+
+ if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
+ {
+ memcpy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
+ _commandList->IASetVertexBuffers(0
+ , 0 == cmd.vbv[1].BufferLocation ? 1 : 2
+ , cmd.vbv
+ );
+ }
+
+ if (0 != memcmp(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) ) )
+ {
+ memcpy(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) );
+ _commandList->IASetIndexBuffer(&cmd.ibv);
+ }
+
+ _commandList->DrawIndexedInstanced(
+ cmd.drawIndexed.IndexCountPerInstance
+ , cmd.drawIndexed.InstanceCount
+ , cmd.drawIndexed.StartIndexLocation
+ , cmd.drawIndexed.BaseVertexLocation
+ , cmd.drawIndexed.StartInstanceLocation
+ );
+ }
+ }
+ }
+ }
+ }
+
+ void BatchD3D12::flush(ID3D12GraphicsCommandList* _commandList, bool _clean)
+ {
+ flush(_commandList, Draw);
+ flush(_commandList, DrawIndexed);
+
+ if (_clean)
+ {
+ memset(&m_current, 0, sizeof(m_current) );
+ }
+ }
+
+ void BatchD3D12::begin()
+ {
+ memset(&m_stats, 0, sizeof(m_stats) );
+ memset(&m_current, 0, sizeof(m_current) );
+ }
+
+ void BatchD3D12::end(ID3D12GraphicsCommandList* _commandList)
+ {
+ flush(_commandList);
+ }
+
+ struct UavFormat
+ {
+ DXGI_FORMAT format[3];
+ uint32_t stride;
+ };
+
+ static const UavFormat s_uavFormat[] =
+ { // BGFX_BUFFER_COMPUTE_TYPE_UINT, BGFX_BUFFER_COMPUTE_TYPE_INT, BGFX_BUFFER_COMPUTE_TYPE_FLOAT
+ { { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, 0 }, // ignored
+ { { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN }, 1 }, // BGFX_BUFFER_COMPUTE_FORMAT_8x1
+ { { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN }, 2 }, // BGFX_BUFFER_COMPUTE_FORMAT_8x2
+ { { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN }, 4 }, // BGFX_BUFFER_COMPUTE_FORMAT_8x4
+ { { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_FLOAT }, 2 }, // BGFX_BUFFER_COMPUTE_FORMAT_16x1
+ { { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_FLOAT }, 4 }, // BGFX_BUFFER_COMPUTE_FORMAT_16x2
+ { { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_FLOAT }, 8 }, // BGFX_BUFFER_COMPUTE_FORMAT_16x4
+ { { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_FLOAT }, 4 }, // BGFX_BUFFER_COMPUTE_FORMAT_32x1
+ { { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_FLOAT }, 8 }, // BGFX_BUFFER_COMPUTE_FORMAT_32x2
+ { { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_FLOAT }, 16 }, // BGFX_BUFFER_COMPUTE_FORMAT_32x4
+ };
+
+ void BufferD3D12::create(uint32_t _size, void* _data, uint16_t _flags, bool _vertex, uint32_t _stride)
+ {
+ m_size = _size;
+ m_flags = _flags;
+
+ const bool needUav = 0 != (_flags & (BGFX_BUFFER_COMPUTE_WRITE|BGFX_BUFFER_DRAW_INDIRECT) );
+ const bool drawIndirect = 0 != (_flags & BGFX_BUFFER_DRAW_INDIRECT);
+ m_dynamic = NULL == _data || needUav;
+
+ DXGI_FORMAT format;
+ uint32_t stride;
+
+ D3D12_RESOURCE_FLAGS flags = needUav
+ ? D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS
+ : D3D12_RESOURCE_FLAG_NONE
+ ;
+
+ if (drawIndirect)
+ {
+ format = DXGI_FORMAT_R32G32B32A32_UINT;
+ stride = 16;
+ }
+ else
+ {
+ uint32_t uavFormat = (_flags & BGFX_BUFFER_COMPUTE_FORMAT_MASK) >> BGFX_BUFFER_COMPUTE_FORMAT_SHIFT;
+ if (0 == uavFormat)
+ {
+ if (_vertex)
+ {
+ format = DXGI_FORMAT_R32G32B32A32_FLOAT;
+ stride = 16;
+ }
+ else
+ {
+ if (0 == (_flags & BGFX_BUFFER_INDEX32) )
+ {
+ format = DXGI_FORMAT_R16_UINT;
+ stride = 2;
+ }
+ else
+ {
+ format = DXGI_FORMAT_R32_UINT;
+ stride = 4;
+ }
+ }
+ }
+ else
+ {
+ const uint32_t uavType = bx::uint32_satsub( (_flags & BGFX_BUFFER_COMPUTE_TYPE_MASK) >> BGFX_BUFFER_COMPUTE_TYPE_SHIFT, 1);
+ format = s_uavFormat[uavFormat].format[uavType];
+ stride = s_uavFormat[uavFormat].stride;
+ }
+ }
+
+ stride = 0 == _stride ? stride : _stride;
+
+ m_srvd.Format = format;
+ m_srvd.ViewDimension = D3D12_SRV_DIMENSION_BUFFER;
+ m_srvd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
+ m_srvd.Buffer.FirstElement = 0;
+ m_srvd.Buffer.NumElements = m_size / stride;
+ m_srvd.Buffer.StructureByteStride = 0;
+ m_srvd.Buffer.Flags = D3D12_BUFFER_SRV_FLAG_NONE;
+
+ m_uavd.Format = format;
+ m_uavd.ViewDimension = D3D12_UAV_DIMENSION_BUFFER;
+ m_uavd.Buffer.FirstElement = 0;
+ m_uavd.Buffer.NumElements = m_size / stride;
+ m_uavd.Buffer.StructureByteStride = 0;
+ m_uavd.Buffer.CounterOffsetInBytes = 0;
+ m_uavd.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_NONE;
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ ID3D12GraphicsCommandList* commandList = s_renderD3D12->m_commandList;
+
+ m_ptr = createCommittedResource(device, HeapProperty::Default, _size, flags);
+ m_gpuVA = m_ptr->GetGPUVirtualAddress();
+ setState(commandList, drawIndirect
+ ? D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT
+ : D3D12_RESOURCE_STATE_GENERIC_READ
+ );
+
+ if (!m_dynamic)
+ {
+ update(commandList, 0, _size, _data);
+ }
+ }
+
+ void BufferD3D12::update(ID3D12GraphicsCommandList* _commandList, uint32_t _offset, uint32_t _size, void* _data, bool /*_discard*/)
+ {
+ ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, _size);
+ uint8_t* data;
+ DX_CHECK(staging->Map(0, NULL, (void**)&data) );
+ memcpy(data, _data, _size);
+ staging->Unmap(0, NULL);
+
+ D3D12_RESOURCE_STATES state = setState(_commandList, D3D12_RESOURCE_STATE_COPY_DEST);
+ _commandList->CopyBufferRegion(m_ptr, _offset, staging, 0, _size);
+ setState(_commandList, state);
+
+ s_renderD3D12->m_cmd.release(staging);
+ }
+
+ void BufferD3D12::destroy()
+ {
+ if (NULL != m_ptr)
+ {
+ s_renderD3D12->m_cmd.release(m_ptr);
+ m_dynamic = false;
+ }
+ }
+
+ D3D12_RESOURCE_STATES BufferD3D12::setState(ID3D12GraphicsCommandList* _commandList, D3D12_RESOURCE_STATES _state)
+ {
+ if (m_state != _state)
+ {
+ setResourceBarrier(_commandList
+ , m_ptr
+ , m_state
+ , _state
+ );
+
+ bx::xchg(m_state, _state);
+ }
+
+ return _state;
+ }
+
+ void VertexBufferD3D12::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+ {
+ BufferD3D12::create(_size, _data, _flags, true);
+ m_decl = _declHandle;
+ }
+
+ void ShaderD3D12::create(const Memory* _mem)
+ {
+ bx::MemoryReader reader(_mem->data, _mem->size);
+
+ uint32_t magic;
+ bx::read(&reader, magic);
+
+ switch (magic)
+ {
+ case BGFX_CHUNK_MAGIC_CSH:
+ case BGFX_CHUNK_MAGIC_FSH:
+ case BGFX_CHUNK_MAGIC_VSH:
+ break;
+
+ default:
+ BGFX_FATAL(false, Fatal::InvalidShader, "Unknown shader format %x.", magic);
+ break;
+ }
+
+ bool fragment = BGFX_CHUNK_MAGIC_FSH == magic;
+
+ uint32_t iohash;
+ bx::read(&reader, iohash);
+
+ uint16_t count;
+ bx::read(&reader, count);
+
+ m_numPredefined = 0;
+ m_numUniforms = count;
+
+ BX_TRACE("%s Shader consts %d"
+ , BGFX_CHUNK_MAGIC_FSH == magic ? "Fragment" : BGFX_CHUNK_MAGIC_VSH == magic ? "Vertex" : "Compute"
+ , count
+ );
+
+ uint8_t fragmentBit = fragment ? BGFX_UNIFORM_FRAGMENTBIT : 0;
+
+ if (0 < count)
+ {
+ for (uint32_t ii = 0; ii < count; ++ii)
+ {
+ uint8_t nameSize;
+ bx::read(&reader, nameSize);
+
+ char name[256];
+ bx::read(&reader, &name, nameSize);
+ name[nameSize] = '\0';
+
+ uint8_t type;
+ bx::read(&reader, type);
+
+ uint8_t num;
+ bx::read(&reader, num);
+
+ uint16_t regIndex;
+ bx::read(&reader, regIndex);
+
+ uint16_t regCount;
+ bx::read(&reader, regCount);
+
+ const char* kind = "invalid";
+
+ PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name);
+ if (PredefinedUniform::Count != predefined)
+ {
+ kind = "predefined";
+ m_predefined[m_numPredefined].m_loc = regIndex;
+ m_predefined[m_numPredefined].m_count = regCount;
+ m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit);
+ m_numPredefined++;
+ }
+ else if (0 == (BGFX_UNIFORM_SAMPLERBIT & type) )
+ {
+ const UniformInfo* info = s_renderD3D12->m_uniformReg.find(name);
+ BX_CHECK(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
+
+ if (NULL != info)
+ {
+ if (NULL == m_constantBuffer)
+ {
+ m_constantBuffer = UniformBuffer::create(1024);
+ }
+
+ kind = "user";
+ m_constantBuffer->writeUniformHandle( (UniformType::Enum)(type|fragmentBit), regIndex, info->m_handle, regCount);
+ }
+ }
+ else
+ {
+ kind = "sampler";
+ }
+
+ BX_TRACE("\t%s: %s (%s), num %2d, r.index %3d, r.count %2d"
+ , kind
+ , name
+ , getUniformTypeName(UniformType::Enum(type&~BGFX_UNIFORM_MASK) )
+ , num
+ , regIndex
+ , regCount
+ );
+ BX_UNUSED(kind);
+ }
+
+ if (NULL != m_constantBuffer)
+ {
+ m_constantBuffer->finish();
+ }
+ }
+
+ uint16_t shaderSize;
+ bx::read(&reader, shaderSize);
+
+ const DWORD* code = (const DWORD*)reader.getDataPtr();
+ bx::skip(&reader, shaderSize+1);
+
+ m_code = copy(code, shaderSize);
+
+ uint8_t numAttrs;
+ bx::read(&reader, numAttrs);
+
+ memset(m_attrMask, 0, sizeof(m_attrMask) );
+
+ for (uint32_t ii = 0; ii < numAttrs; ++ii)
+ {
+ uint16_t id;
+ bx::read(&reader, id);
+
+ Attrib::Enum attr = idToAttrib(id);
+
+ if (Attrib::Count != attr)
+ {
+ m_attrMask[attr] = UINT16_MAX;
+ }
+ }
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(iohash);
+ murmur.add(code, shaderSize);
+ murmur.add(numAttrs);
+ murmur.add(m_attrMask, numAttrs);
+ m_hash = murmur.end();
+
+ bx::read(&reader, m_size);
+ }
+
+ void TextureD3D12::create(const Memory* _mem, uint32_t _flags, uint8_t _skip)
+ {
+ ImageContainer imageContainer;
+
+ if (imageParse(imageContainer, _mem->data, _mem->size) )
+ {
+ uint8_t numMips = imageContainer.m_numMips;
+ const uint8_t startLod = uint8_t(bx::uint32_min(_skip, numMips-1) );
+ numMips -= startLod;
+ const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) );
+ const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod);
+ const uint32_t textureHeight = bx::uint32_max(blockInfo.blockHeight, imageContainer.m_height>>startLod);
+
+ m_flags = _flags;
+ m_requestedFormat = (uint8_t)imageContainer.m_format;
+ m_textureFormat = (uint8_t)imageContainer.m_format;
+
+ const TextureFormatInfo& tfi = s_textureFormat[m_requestedFormat];
+ const bool convert = DXGI_FORMAT_UNKNOWN == tfi.m_fmt;
+
+ uint8_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
+ if (convert)
+ {
+ m_textureFormat = (uint8_t)TextureFormat::BGRA8;
+ bpp = 32;
+ }
+
+ if (imageContainer.m_cubeMap)
+ {
+ m_type = TextureCube;
+ }
+ else if (imageContainer.m_depth > 1)
+ {
+ m_type = Texture3D;
+ }
+ else
+ {
+ m_type = Texture2D;
+ }
+
+ m_numMips = numMips;
+ const uint16_t numSides = imageContainer.m_cubeMap ? 6 : 1;
+
+ uint32_t numSrd = numMips*numSides;
+ D3D12_SUBRESOURCE_DATA* srd = (D3D12_SUBRESOURCE_DATA*)alloca(numSrd*sizeof(D3D12_SUBRESOURCE_DATA) );
+
+ uint32_t kk = 0;
+
+ const bool compressed = isCompressed(TextureFormat::Enum(m_textureFormat) );
+ const bool swizzle = TextureFormat::BGRA8 == m_textureFormat && 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
+ uint32_t blockWidth = 1;
+ uint32_t blockHeight = 1;
+
+ if (convert && compressed)
+ {
+ blockWidth = blockInfo.blockWidth;
+ blockHeight = blockInfo.blockHeight;
+ }
+
+ const bool bufferOnly = 0 != (m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE);
+ const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK);
+
+ BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s RT[%c], BO[%c], CW[%c]%s."
+ , this - s_renderD3D12->m_textures
+ , getName( (TextureFormat::Enum)m_textureFormat)
+ , getName( (TextureFormat::Enum)m_requestedFormat)
+ , textureWidth
+ , textureHeight
+ , imageContainer.m_cubeMap ? "x6" : ""
+ , renderTarget ? 'x' : ' '
+ , bufferOnly ? 'x' : ' '
+ , computeWrite ? 'x' : ' '
+ , swizzle ? " (swizzle BGRA8 -> RGBA8)" : ""
+ );
+
+ uint32_t totalSize = 0;
+
+ for (uint8_t side = 0; side < numSides; ++side)
+ {
+ uint32_t width = textureWidth;
+ uint32_t height = textureHeight;
+ uint32_t depth = imageContainer.m_depth;
+
+ for (uint8_t lod = 0; lod < numMips; ++lod)
+ {
+ width = bx::uint32_max(blockWidth, width);
+ height = bx::uint32_max(blockHeight, height);
+ depth = bx::uint32_max(1, depth);
+
+ ImageMip mip;
+ if (imageGetRawData(imageContainer, side, lod+startLod, _mem->data, _mem->size, mip) )
+ {
+ if (convert)
+ {
+ const uint32_t pitch = bx::strideAlign(width*bpp / 8, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
+ const uint32_t slice = bx::strideAlign(pitch * height, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
+
+ uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, slice);
+ imageDecodeToBgra8(temp
+ , mip.m_data
+ , mip.m_width
+ , mip.m_height
+ , pitch, mip.m_format
+ );
+
+ srd[kk].pData = temp;
+ srd[kk].RowPitch = pitch;
+ srd[kk].SlicePitch = slice;
+ totalSize += slice;
+ }
+ else if (compressed)
+ {
+ uint32_t pitch = bx::strideAlign( (mip.m_width /blockInfo.blockWidth )*mip.m_blockSize, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
+ uint32_t slice = bx::strideAlign( (mip.m_height/blockInfo.blockHeight)*pitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
+
+ uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, slice);
+ imageCopy(mip.m_height/blockInfo.blockHeight
+ , (mip.m_width /blockInfo.blockWidth )*mip.m_blockSize
+ , mip.m_data
+ , pitch
+ , temp
+ );
+
+ srd[kk].pData = temp;
+ srd[kk].RowPitch = pitch;
+ srd[kk].SlicePitch = slice;
+ totalSize += slice;
+ }
+ else
+ {
+ const uint32_t pitch = bx::strideAlign(mip.m_width*mip.m_bpp / 8, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
+ const uint32_t slice = bx::strideAlign(pitch * mip.m_height, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
+
+ uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, slice);
+ imageCopy(mip.m_height
+ , mip.m_width*mip.m_bpp / 8
+ , mip.m_data
+ , pitch
+ , temp
+ );
+
+ srd[kk].pData = temp;
+ srd[kk].RowPitch = pitch;
+ srd[kk].SlicePitch = slice;
+ totalSize += slice;
+ }
+
+ if (swizzle)
+ {
+// imageSwizzleBgra8(width, height, mip.m_width*4, data, temp);
+ }
+
+ srd[kk].SlicePitch = mip.m_height*srd[kk].RowPitch;
+ ++kk;
+ }
+ else
+ {
+ const uint32_t pitch = bx::strideAlign(width*bpp / 8, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
+ const uint32_t slice = bx::strideAlign(pitch * height, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
+ totalSize += slice;
+ }
+
+ width >>= 1;
+ height >>= 1;
+ depth >>= 1;
+ }
+ }
+
+ BX_TRACE("texture total size: %d", totalSize);
+
+ const uint32_t msaaQuality = bx::uint32_satsub( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
+ const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality];
+
+ memset(&m_srvd, 0, sizeof(m_srvd) );
+ m_srvd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
+ m_srvd.Format = s_textureFormat[m_textureFormat].m_fmtSrv;
+ DXGI_FORMAT format = s_textureFormat[m_textureFormat].m_fmt;
+ if (swizzle)
+ {
+ format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ m_srvd.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ }
+
+ m_uavd.Format = m_srvd.Format;
+
+ ID3D12Device* device = s_renderD3D12->m_device;
+ ID3D12GraphicsCommandList* commandList = s_renderD3D12->m_commandList;
+
+ D3D12_RESOURCE_DESC resourceDesc;
+ resourceDesc.Alignment = 0;
+ resourceDesc.Width = textureWidth;
+ resourceDesc.Height = textureHeight;
+ resourceDesc.MipLevels = numMips;
+ resourceDesc.Format = format;
+ resourceDesc.SampleDesc = msaa;
+ resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resourceDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
+ resourceDesc.DepthOrArraySize = numSides;
+
+ D3D12_RESOURCE_STATES state = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
+
+ D3D12_CLEAR_VALUE* clearValue = NULL;
+ if (isDepth(TextureFormat::Enum(m_textureFormat) ) )
+ {
+ resourceDesc.Format = s_textureFormat[m_textureFormat].m_fmt;
+ resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
+ state |= D3D12_RESOURCE_STATE_DEPTH_WRITE;
+ state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
+
+ clearValue = (D3D12_CLEAR_VALUE*)alloca(sizeof(D3D12_CLEAR_VALUE) );
+ clearValue->Format = s_textureFormat[m_textureFormat].m_fmtDsv;
+ clearValue->DepthStencil.Depth = 1.0f;
+ clearValue->DepthStencil.Stencil = 0;
+ }
+ else if (renderTarget)
+ {
+ clearValue = (D3D12_CLEAR_VALUE*)alloca(sizeof(D3D12_CLEAR_VALUE) );
+ clearValue->Format = resourceDesc.Format;
+ clearValue->Color[0] = 0.0f;
+ clearValue->Color[1] = 0.0f;
+ clearValue->Color[2] = 0.0f;
+ clearValue->Color[3] = 0.0f;
+
+ resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
+ }
+
+ if (bufferOnly)
+ {
+ resourceDesc.Flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
+ state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
+ }
+
+ if (computeWrite)
+ {
+ resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
+ }
+
+ switch (m_type)
+ {
+ case Texture2D:
+ resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ m_srvd.ViewDimension = 1 < msaa.Count ? D3D12_SRV_DIMENSION_TEXTURE2DMS : D3D12_SRV_DIMENSION_TEXTURE2D;
+ m_srvd.Texture2D.MostDetailedMip = 0;
+ m_srvd.Texture2D.MipLevels = numMips;
+ m_srvd.Texture2D.ResourceMinLODClamp = 0.0f;
+
+ m_uavd.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D;
+ m_uavd.Texture2D.MipSlice = 0;
+ m_uavd.Texture2D.PlaneSlice = 0;
+ break;
+
+ case Texture3D:
+ resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE3D;
+ m_srvd.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE3D;
+ m_srvd.Texture3D.MostDetailedMip = 0;
+ m_srvd.Texture3D.MipLevels = numMips;
+ m_srvd.Texture3D.ResourceMinLODClamp = 0.0f;
+
+ m_uavd.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE3D;
+ m_uavd.Texture3D.MipSlice = 0;
+ m_uavd.Texture3D.FirstWSlice = 0;
+ m_uavd.Texture3D.WSize = 0;
+ break;
+
+ case TextureCube:
+ resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ m_srvd.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBE;
+ m_srvd.TextureCube.MostDetailedMip = 0;
+ m_srvd.TextureCube.MipLevels = numMips;
+ m_srvd.TextureCube.ResourceMinLODClamp = 0.0f;
+
+ m_uavd.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D;
+ m_uavd.Texture2D.MipSlice = 0;
+ m_uavd.Texture2D.PlaneSlice = 0;
+ break;
+ }
+
+ m_ptr = createCommittedResource(device, HeapProperty::Default, &resourceDesc, clearValue);
+
+ {
+ uint64_t uploadBufferSize;
+ uint32_t* numRows = (uint32_t*)alloca(sizeof(uint32_t)*numSrd);
+ uint64_t* rowSizeInBytes = (uint64_t*)alloca(sizeof(uint64_t)*numSrd);
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT* layouts = (D3D12_PLACED_SUBRESOURCE_FOOTPRINT*)alloca(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT)*numSrd);
+
+ device->GetCopyableFootprints(&resourceDesc
+ , 0
+ , numSrd
+ , 0
+ , layouts
+ , numRows
+ , rowSizeInBytes
+ , &uploadBufferSize
+ );
+ BX_WARN(uploadBufferSize == totalSize, "uploadBufferSize %d (totalSize %d), numRows %d, rowSizeInBytes %d"
+ , uploadBufferSize
+ , totalSize
+ , numRows[0]
+ , rowSizeInBytes[0]
+ );
+ }
+
+ if (kk != 0)
+ {
+ ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, totalSize);
+
+ setState(commandList,D3D12_RESOURCE_STATE_COPY_DEST);
+
+ uint64_t result = UpdateSubresources(commandList
+ , m_ptr
+ , staging
+ , 0
+ , 0
+ , numSrd
+ , srd
+ );
+ BX_CHECK(0 != result, "Invalid size"); BX_UNUSED(result);
+ BX_TRACE("Update subresource %" PRId64, result);
+
+ setState(commandList, state);
+
+ s_renderD3D12->m_cmd.release(staging);
+ }
+ else
+ {
+ setState(commandList, state);
+ }
+
+ if (0 != kk)
+ {
+ kk = 0;
+ for (uint8_t side = 0; side < numSides; ++side)
+ {
+ for (uint32_t lod = 0, num = numMips; lod < num; ++lod)
+ {
+ BX_FREE(g_allocator, const_cast<void*>(srd[kk].pData) );
+ ++kk;
+ }
+ }
+ }
+ }
+ }
+
+ void TextureD3D12::destroy()
+ {
+ if (NULL != m_ptr)
+ {
+ s_renderD3D12->m_cmd.release(m_ptr);
+ m_ptr = NULL;
+ }
+ }
+
+ void TextureD3D12::update(ID3D12GraphicsCommandList* _commandList, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
+ {
+ setState(_commandList, D3D12_RESOURCE_STATE_COPY_DEST);
+
+ const uint32_t subres = _mip + (_side * m_numMips);
+ const uint32_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
+ const uint32_t rectpitch = _rect.m_width*bpp/8;
+ const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
+
+ D3D12_RESOURCE_DESC desc = m_ptr->GetDesc();
+
+ desc.Height = _rect.m_height;
+
+ uint32_t numRows;
+ uint64_t rowPitch;
+ uint64_t totalBytes;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT layout;
+ s_renderD3D12->m_device->GetCopyableFootprints(&desc
+ , subres
+ , 1
+ , 0
+ , &layout
+ , &numRows
+ , &rowPitch
+ , &totalBytes
+ );
+
+ ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, totalBytes);
+
+ uint8_t* data;
+
+ DX_CHECK(staging->Map(0, NULL, (void**)&data) );
+ for (uint32_t ii = 0, height = _rect.m_height; ii < height; ++ii)
+ {
+ memcpy(&data[ii*rowPitch], &_mem->data[ii*srcpitch], srcpitch);
+ }
+ staging->Unmap(0, NULL);
+
+ D3D12_BOX box;
+ box.left = 0;
+ box.top = 0;
+ box.right = box.left + _rect.m_width;
+ box.bottom = box.top + _rect.m_height;
+ box.front = _z;
+ box.back = _z+_depth;
+
+ D3D12_TEXTURE_COPY_LOCATION dst = { m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { } };
+ dst.SubresourceIndex = subres;
+ D3D12_TEXTURE_COPY_LOCATION src = { staging, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, { layout } };
+ _commandList->CopyTextureRegion(&dst, _rect.m_x, _rect.m_y, 0, &src, &box);
+
+ setState(_commandList, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
+
+ s_renderD3D12->m_cmd.release(staging);
+ }
+
+ void TextureD3D12::resolve()
+ {
+ }
+
+ D3D12_RESOURCE_STATES TextureD3D12::setState(ID3D12GraphicsCommandList* _commandList, D3D12_RESOURCE_STATES _state)
+ {
+ if (m_state != _state)
+ {
+ setResourceBarrier(_commandList
+ , m_ptr
+ , m_state
+ , _state
+ );
+
+ bx::xchg(m_state, _state);
+ }
+
+ return _state;
+ }
+
+ void FrameBufferD3D12::create(uint8_t _num, const TextureHandle* _handles)
+ {
+ m_numTh = _num;
+ memcpy(m_th, _handles, _num*sizeof(TextureHandle) );
+
+ postReset();
+ }
+
+ void FrameBufferD3D12::create(uint16_t /*_denseIdx*/, void* /*_nwh*/, uint32_t /*_width*/, uint32_t /*_height*/, TextureFormat::Enum /*_depthFormat*/)
+ {
+ }
+
+ void FrameBufferD3D12::preReset()
+ {
+ }
+
+ void FrameBufferD3D12::postReset()
+ {
+ if (m_numTh != 0)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+
+ D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor = s_renderD3D12->m_rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t rtvDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
+ uint32_t fbhIdx = (uint32_t)(this - s_renderD3D12->m_frameBuffers);
+ rtvDescriptor.ptr += (BX_COUNTOF(s_renderD3D12->m_backBufferColor) + fbhIdx * BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) * rtvDescriptorSize;
+
+ m_width = 0;
+ m_height = 0;
+ m_depth.idx = bgfx::invalidHandle;
+ m_num = 0;
+ for (uint32_t ii = 0; ii < m_numTh; ++ii)
+ {
+ TextureHandle handle = m_th[ii];
+ if (isValid(handle) )
+ {
+ const TextureD3D12& texture = s_renderD3D12->m_textures[handle.idx];
+
+ if (0 == m_width)
+ {
+ D3D12_RESOURCE_DESC desc = texture.m_ptr->GetDesc();
+ m_width = uint32_t(desc.Width);
+ m_height = uint32_t(desc.Height);
+ }
+
+ if (isDepth( (TextureFormat::Enum)texture.m_textureFormat) )
+ {
+ BX_CHECK(!isValid(m_depth), "");
+ m_depth = handle;
+ D3D12_CPU_DESCRIPTOR_HANDLE dsvDescriptor = s_renderD3D12->m_dsvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t dsvDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
+ dsvDescriptor.ptr += (1 + fbhIdx) * dsvDescriptorSize;
+
+ const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(texture.m_textureFormat) );
+ BX_UNUSED(blockInfo);
+
+ D3D12_DEPTH_STENCIL_VIEW_DESC dsvDesc;
+ ZeroMemory(&dsvDesc, sizeof(dsvDesc) );
+ dsvDesc.Format = s_textureFormat[texture.m_textureFormat].m_fmtDsv;
+ dsvDesc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2D;
+ dsvDesc.Flags = D3D12_DSV_FLAG_NONE
+// | (blockInfo.depthBits > 0 ? D3D12_DSV_FLAG_READ_ONLY_DEPTH : D3D12_DSV_FLAG_NONE)
+// | (blockInfo.stencilBits > 0 ? D3D12_DSV_FLAG_READ_ONLY_STENCIL : D3D12_DSV_FLAG_NONE)
+ ;
+
+ device->CreateDepthStencilView(texture.m_ptr
+ , &dsvDesc
+ , dsvDescriptor
+ );
+ }
+ else
+ {
+ m_texture[m_num] = handle;
+ D3D12_CPU_DESCRIPTOR_HANDLE rtv = { rtvDescriptor.ptr + m_num * rtvDescriptorSize };
+ device->CreateRenderTargetView(texture.m_ptr
+ , NULL
+ , rtv
+ );
+ m_num++;
+ }
+ }
+ }
+ }
+ }
+
+ uint16_t FrameBufferD3D12::destroy()
+ {
+ m_numTh = 0;
+
+ m_depth.idx = bgfx::invalidHandle;
+
+ uint16_t denseIdx = m_denseIdx;
+ m_denseIdx = UINT16_MAX;
+
+ return denseIdx;
+ }
+
+ void FrameBufferD3D12::resolve()
+ {
+ }
+
+ void FrameBufferD3D12::clear(ID3D12GraphicsCommandList* _commandList, const Clear& _clear, const float _palette[][4], const D3D12_RECT* _rect, uint32_t _num)
+ {
+ ID3D12Device* device = s_renderD3D12->m_device;
+ const uint32_t fbhIdx = (uint32_t)(this - s_renderD3D12->m_frameBuffers);
+
+ if (BGFX_CLEAR_COLOR & _clear.m_flags
+ && 0 != m_num)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor = s_renderD3D12->m_rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t rtvDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
+ rtvDescriptor.ptr += (BX_COUNTOF(s_renderD3D12->m_backBufferColor) + fbhIdx * BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) * rtvDescriptorSize;
+
+ if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
+ {
+ for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
+ {
+ uint8_t index = _clear.m_index[ii];
+ if (UINT8_MAX != index)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE rtv = { rtvDescriptor.ptr + ii * rtvDescriptorSize };
+ _commandList->ClearRenderTargetView(rtv
+ , _palette[index]
+ , _num
+ , _rect
+ );
+ }
+ }
+ }
+ else
+ {
+ float frgba[4] =
+ {
+ _clear.m_index[0]*1.0f/255.0f,
+ _clear.m_index[1]*1.0f/255.0f,
+ _clear.m_index[2]*1.0f/255.0f,
+ _clear.m_index[3]*1.0f/255.0f,
+ };
+ for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE rtv = { rtvDescriptor.ptr + ii * rtvDescriptorSize };
+ _commandList->ClearRenderTargetView(rtv
+ , frgba
+ , _num
+ , _rect
+ );
+ }
+ }
+ }
+
+ if (isValid(m_depth)
+ && (BGFX_CLEAR_DEPTH|BGFX_CLEAR_STENCIL) & _clear.m_flags)
+ {
+ D3D12_CPU_DESCRIPTOR_HANDLE dsvDescriptor = s_renderD3D12->m_dsvDescriptorHeap->GetCPUDescriptorHandleForHeapStart();
+ uint32_t dsvDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
+ dsvDescriptor.ptr += (1 + fbhIdx) * dsvDescriptorSize;
+
+ DWORD flags = 0;
+ flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH) ? D3D12_CLEAR_FLAG_DEPTH : 0;
+ flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL) ? D3D12_CLEAR_FLAG_STENCIL : 0;
+
+ _commandList->ClearDepthStencilView(dsvDescriptor
+ , D3D12_CLEAR_FLAGS(flags)
+ , _clear.m_depth
+ , _clear.m_stencil
+ , _num
+ , _rect
+ );
+ }
+ }
+
+ struct Bind
+ {
+ D3D12_GPU_DESCRIPTOR_HANDLE m_srvHandle;
+ uint16_t m_samplerStateIdx;
+ };
+
+ void RendererContextD3D12::submit(Frame* _render, ClearQuad& /*_clearQuad*/, TextVideoMemBlitter& _textVideoMemBlitter)
+ {
+// PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), L"rendererSubmit");
+
+ updateResolution(_render->m_resolution);
+
+ int64_t elapsed = -bx::getHPCounter();
+ int64_t captureElapsed = 0;
+
+ if (0 < _render->m_iboffset)
+ {
+ TransientIndexBuffer* ib = _render->m_transientIb;
+ m_indexBuffers[ib->handle.idx].update(m_commandList, 0, _render->m_iboffset, ib->data);
+ }
+
+ if (0 < _render->m_vboffset)
+ {
+ TransientVertexBuffer* vb = _render->m_transientVb;
+ m_vertexBuffers[vb->handle.idx].update(m_commandList, 0, _render->m_vboffset, vb->data);
+ }
+
+ _render->sort();
+
+ RenderDraw currentState;
+ currentState.clear();
+ currentState.m_flags = BGFX_STATE_NONE;
+ currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE);
+
+ _render->m_hmdInitialized = false;
+
+ const bool hmdEnabled = false;
+ ViewState viewState(_render, hmdEnabled);
+ viewState.reset(_render, hmdEnabled);
+
+// bool wireframe = !!(_render->m_debug&BGFX_DEBUG_WIREFRAME);
+// setDebugWireframe(wireframe);
+
+ uint16_t currentSamplerStateIdx = invalidHandle;
+ uint16_t currentProgramIdx = invalidHandle;
+ bool hasPredefined = false;
+ uint32_t currentBindHash = 0;
+ ID3D12PipelineState* currentPso = NULL;
+ SortKey key;
+ uint16_t view = UINT16_MAX;
+ FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
+ uint32_t blendFactor = 0;
+
+ const uint64_t primType = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0;
+ uint8_t primIndex = uint8_t(primType >> BGFX_STATE_PT_SHIFT);
+ PrimInfo prim = s_primInfo[primIndex];
+
+ bool wasCompute = false;
+ bool viewHasScissor = false;
+ bool restoreScissor = false;
+ Rect viewScissorRect;
+ viewScissorRect.clear();
+
+ uint32_t statsNumPrimsSubmitted[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumIndices = 0;
+ uint32_t statsKeyType[2] = {};
+
+ m_backBufferColorIdx = m_swapChain->GetCurrentBackBufferIndex();
+
+ const uint64_t f0 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_FACTOR);
+ const uint64_t f1 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_FACTOR, BGFX_STATE_BLEND_INV_FACTOR);
+
+ D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle;
+ ScratchBufferD3D12& scratchBuffer = m_scratchBuffer[m_backBufferColorIdx];
+ scratchBuffer.reset(gpuHandle);
+
+ D3D12_GPU_VIRTUAL_ADDRESS gpuAddress = UINT64_C(0);
+
+ StateCacheLru<Bind, 64> bindLru;
+
+ setResourceBarrier(m_commandList
+ , m_backBufferColor[m_backBufferColorIdx]
+ , D3D12_RESOURCE_STATE_PRESENT
+ , D3D12_RESOURCE_STATE_RENDER_TARGET
+ );
+
+ if (0 == (_render->m_debug&BGFX_DEBUG_IFH) )
+ {
+ m_batch.begin();
+
+// uint8_t eye = 0;
+// uint8_t restartState = 0;
+ viewState.m_rect = _render->m_rect[0];
+
+ int32_t numItems = _render->m_num;
+ for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
+ {
+ const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
+ statsKeyType[isCompute]++;
+
+ const bool viewChanged = 0
+ || key.m_view != view
+ || item == numItems
+ ;
+
+ const RenderItem& renderItem = _render->m_renderItem[_render->m_sortValues[item] ];
+ ++item;
+
+ if (viewChanged)
+ {
+ m_batch.flush(m_commandList, true);
+ kick();
+
+ view = key.m_view;
+ currentPso = NULL;
+ currentSamplerStateIdx = invalidHandle;
+ currentProgramIdx = invalidHandle;
+ hasPredefined = false;
+
+ fbh = _render->m_fb[view];
+ setFrameBuffer(fbh);
+
+ viewState.m_rect = _render->m_rect[view];
+ const Rect& rect = _render->m_rect[view];
+ const Rect& scissorRect = _render->m_scissor[view];
+ viewHasScissor = !scissorRect.isZero();
+ viewScissorRect = viewHasScissor ? scissorRect : rect;
+
+ D3D12_VIEWPORT vp;
+ vp.TopLeftX = rect.m_x;
+ vp.TopLeftY = rect.m_y;
+ vp.Width = rect.m_width;
+ vp.Height = rect.m_height;
+ vp.MinDepth = 0.0f;
+ vp.MaxDepth = 1.0f;
+ m_commandList->RSSetViewports(1, &vp);
+
+ D3D12_RECT rc;
+ rc.left = viewScissorRect.m_x;
+ rc.top = viewScissorRect.m_y;
+ rc.right = viewScissorRect.m_x + viewScissorRect.m_width;
+ rc.bottom = viewScissorRect.m_y + viewScissorRect.m_height;
+ m_commandList->RSSetScissorRects(1, &rc);
+ restoreScissor = false;
+
+ Clear& clr = _render->m_clear[view];
+ if (BGFX_CLEAR_NONE != clr.m_flags)
+ {
+ Rect clearRect = rect;
+ clearRect.intersect(rect, viewScissorRect);
+ clearQuad(clearRect, clr, _render->m_colorPalette);
+ }
+
+ prim = s_primInfo[BX_COUNTOF(s_primName)]; // Force primitive type update.
+ }
+
+ if (isCompute)
+ {
+ if (!wasCompute)
+ {
+ wasCompute = true;
+
+ m_commandList->SetComputeRootSignature(m_rootSignature);
+ ID3D12DescriptorHeap* heaps[] = {
+ m_samplerAllocator.getHeap(),
+ scratchBuffer.getHeap(),
+ };
+ m_commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps);
+ }
+
+ const RenderCompute& compute = renderItem.compute;
+
+ ID3D12PipelineState* pso = getPipelineState(key.m_program);
+ if (pso != currentPso)
+ {
+ currentPso = pso;
+ m_commandList->SetPipelineState(pso);
+ currentBindHash = 0;
+ }
+
+ uint32_t bindHash = bx::hashMurmur2A(compute.m_bind, sizeof(compute.m_bind) );
+ if (currentBindHash != bindHash)
+ {
+ currentBindHash = bindHash;
+
+ Bind* bindCached = bindLru.find(bindHash);
+ if (NULL == bindCached)
+ {
+ D3D12_GPU_DESCRIPTOR_HANDLE srvHandle[BGFX_MAX_COMPUTE_BINDINGS] = {};
+ uint32_t samplerFlags[BGFX_MAX_COMPUTE_BINDINGS] = {};
+
+ for (uint32_t ii = 0; ii < BGFX_MAX_COMPUTE_BINDINGS; ++ii)
+ {
+ const Binding& bind = compute.m_bind[ii];
+ if (invalidHandle != bind.m_idx)
+ {
+ switch (bind.m_type)
+ {
+ case Binding::Image:
+ {
+ TextureD3D12& texture = m_textures[bind.m_idx];
+
+ if (Access::Read != bind.m_un.m_compute.m_access)
+ {
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ scratchBuffer.allocUav(srvHandle[ii], texture, bind.m_un.m_compute.m_mip);
+ }
+ else
+ {
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+ scratchBuffer.allocSrv(srvHandle[ii], texture, bind.m_un.m_compute.m_mip);
+ samplerFlags[ii] = texture.m_flags;
+ }
+ }
+ break;
+
+ case Binding::IndexBuffer:
+ case Binding::VertexBuffer:
+ {
+ BufferD3D12& buffer = Binding::IndexBuffer == bind.m_type
+ ? m_indexBuffers[bind.m_idx]
+ : m_vertexBuffers[bind.m_idx]
+ ;
+
+ if (Access::Read != bind.m_un.m_compute.m_access)
+ {
+ buffer.setState(m_commandList, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ scratchBuffer.allocUav(srvHandle[ii], buffer);
+ }
+ else
+ {
+ buffer.setState(m_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+ scratchBuffer.allocSrv(srvHandle[ii], buffer);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ uint16_t samplerStateIdx = getSamplerState(samplerFlags, BGFX_MAX_COMPUTE_BINDINGS, _render->m_colorPalette);
+ if (samplerStateIdx != currentSamplerStateIdx)
+ {
+ currentSamplerStateIdx = samplerStateIdx;
+ m_commandList->SetComputeRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
+ }
+
+ m_commandList->SetComputeRootDescriptorTable(Rdt::SRV, srvHandle[0]);
+ m_commandList->SetComputeRootDescriptorTable(Rdt::UAV, srvHandle[0]);
+
+ Bind bind;
+ bind.m_srvHandle = srvHandle[0];
+ bind.m_samplerStateIdx = samplerStateIdx;
+ bindLru.add(bindHash, bind, 0);
+ }
+ else
+ {
+ uint16_t samplerStateIdx = bindCached->m_samplerStateIdx;
+ if (samplerStateIdx != currentSamplerStateIdx)
+ {
+ currentSamplerStateIdx = samplerStateIdx;
+ m_commandList->SetComputeRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
+ }
+ m_commandList->SetComputeRootDescriptorTable(Rdt::SRV, bindCached->m_srvHandle);
+ m_commandList->SetComputeRootDescriptorTable(Rdt::UAV, bindCached->m_srvHandle);
+ }
+ }
+
+ bool constantsChanged = false;
+ if (compute.m_constBegin < compute.m_constEnd
+ || currentProgramIdx != key.m_program)
+ {
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, compute.m_constBegin, compute.m_constEnd);
+
+ currentProgramIdx = key.m_program;
+ ProgramD3D12& program = m_program[currentProgramIdx];
+
+ UniformBuffer* vcb = program.m_vsh->m_constantBuffer;
+ if (NULL != vcb)
+ {
+ commit(*vcb);
+ }
+
+ hasPredefined = 0 < program.m_numPredefined;
+ constantsChanged = true;
+ }
+
+ if (constantsChanged
+ || hasPredefined)
+ {
+ ProgramD3D12& program = m_program[currentProgramIdx];
+ viewState.setPredefined<4>(this, view, 0, program, _render, compute);
+ commitShaderConstants(key.m_program, gpuAddress);
+ m_commandList->SetComputeRootConstantBufferView(Rdt::CBV, gpuAddress);
+ }
+
+ if (isValid(compute.m_indirectBuffer) )
+ {
+ const VertexBufferD3D12& vb = m_vertexBuffers[compute.m_indirectBuffer.idx];
+
+ uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
+ ? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ : compute.m_numIndirect
+ ;
+
+ uint32_t args = compute.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
+ for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
+ {
+// m_commandList->ExecuteIndirect(ptr, args);
+ args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
+ }
+ }
+ else
+ {
+ m_commandList->Dispatch(compute.m_numX, compute.m_numY, compute.m_numZ);
+ }
+
+ continue;
+ }
+
+ const RenderDraw& draw = renderItem.draw;
+
+ const uint64_t newFlags = draw.m_flags;
+ uint64_t changedFlags = currentState.m_flags ^ draw.m_flags;
+ currentState.m_flags = newFlags;
+
+ const uint64_t newStencil = draw.m_stencil;
+ uint64_t changedStencil = (currentState.m_stencil ^ draw.m_stencil) & BGFX_STENCIL_FUNC_REF_MASK;
+ currentState.m_stencil = newStencil;
+
+ if (viewChanged
+ || wasCompute)
+ {
+ if (wasCompute)
+ {
+ wasCompute = false;
+ }
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) )
+ {
+ BX_UNUSED(s_viewNameW);
+// wchar_t* viewNameW = s_viewNameW[view];
+// viewNameW[3] = L' ';
+// PIX_ENDEVENT();
+// PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW);
+ }
+
+ currentSamplerStateIdx = invalidHandle;
+ currentProgramIdx = invalidHandle;
+
+ m_commandList->SetGraphicsRootSignature(m_rootSignature);
+ ID3D12DescriptorHeap* heaps[] = {
+ m_samplerAllocator.getHeap(),
+ scratchBuffer.getHeap(),
+ };
+ m_commandList->SetDescriptorHeaps(BX_COUNTOF(heaps), heaps);
+
+ currentState.clear();
+ currentState.m_scissor = !draw.m_scissor;
+ changedFlags = BGFX_STATE_MASK;
+ changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK);
+ currentState.m_flags = newFlags;
+ currentState.m_stencil = newStencil;
+
+ const uint64_t pt = newFlags&BGFX_STATE_PT_MASK;
+ primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT);
+ }
+
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, draw.m_constBegin, draw.m_constEnd);
+
+ if (isValid(draw.m_vertexBuffer) )
+ {
+ const uint64_t state = draw.m_flags;
+ bool hasFactor = 0
+ || f0 == (state & f0)
+ || f1 == (state & f1)
+ ;
+
+ const VertexBufferD3D12& vb = m_vertexBuffers[draw.m_vertexBuffer.idx];
+ uint16_t declIdx = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx;
+
+ ID3D12PipelineState* pso =
+ getPipelineState(state
+ , draw.m_stencil
+ , declIdx
+ , key.m_program
+ , uint8_t(draw.m_instanceDataStride/16)
+ );
+
+ uint16_t scissor = draw.m_scissor;
+ uint32_t bindHash = bx::hashMurmur2A(draw.m_bind, sizeof(draw.m_bind) );
+ if (currentBindHash != bindHash
+ || 0 != changedStencil
+ || (hasFactor && blendFactor != draw.m_rgba)
+ || (0 != (BGFX_STATE_PT_MASK & changedFlags)
+ || prim.m_toplogy != s_primInfo[primIndex].m_toplogy)
+ || currentState.m_scissor != scissor
+ || pso != currentPso)
+ {
+ m_batch.flush(m_commandList);
+ }
+
+ if (currentBindHash != bindHash)
+ {
+ currentBindHash = bindHash;
+
+ Bind* bindCached = bindLru.find(bindHash);
+ if (NULL == bindCached)
+ {
+ D3D12_GPU_DESCRIPTOR_HANDLE srvHandle[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
+ uint32_t samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
+ {
+ srvHandle[0].ptr = 0;
+ for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
+ {
+ const Binding& bind = draw.m_bind[stage];
+ if (invalidHandle != bind.m_idx)
+ {
+ TextureD3D12& texture = m_textures[bind.m_idx];
+ texture.setState(m_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
+ scratchBuffer.allocSrv(srvHandle[stage], texture);
+ samplerFlags[stage] = (0 == (BGFX_SAMPLER_DEFAULT_FLAGS & bind.m_un.m_draw.m_flags)
+ ? bind.m_un.m_draw.m_flags
+ : texture.m_flags
+ ) & (BGFX_TEXTURE_SAMPLER_BITS_MASK|BGFX_TEXTURE_BORDER_COLOR_MASK)
+ ;
+ }
+ else
+ {
+ memcpy(&srvHandle[stage], &srvHandle[0], sizeof(D3D12_GPU_DESCRIPTOR_HANDLE) );
+ samplerFlags[stage] = 0;
+ }
+ }
+ }
+
+ if (srvHandle[0].ptr != 0)
+ {
+ uint16_t samplerStateIdx = getSamplerState(samplerFlags, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, _render->m_colorPalette);
+ if (samplerStateIdx != currentSamplerStateIdx)
+ {
+ currentSamplerStateIdx = samplerStateIdx;
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
+ }
+
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, srvHandle[0]);
+
+ Bind bind;
+ bind.m_srvHandle = srvHandle[0];
+ bind.m_samplerStateIdx = samplerStateIdx;
+ bindLru.add(bindHash, bind, 0);
+ }
+ }
+ else
+ {
+ uint16_t samplerStateIdx = bindCached->m_samplerStateIdx;
+ if (samplerStateIdx != currentSamplerStateIdx)
+ {
+ currentSamplerStateIdx = samplerStateIdx;
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
+ }
+ m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, bindCached->m_srvHandle);
+ }
+ }
+
+ if (0 != changedStencil)
+ {
+ const uint32_t fstencil = unpackStencil(0, draw.m_stencil);
+ const uint32_t ref = (fstencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
+ m_commandList->OMSetStencilRef(ref);
+ }
+
+ if (hasFactor
+ && blendFactor != draw.m_rgba)
+ {
+ blendFactor = draw.m_rgba;
+
+ float bf[4];
+ bf[0] = ( (draw.m_rgba>>24) )/255.0f;
+ bf[1] = ( (draw.m_rgba>>16)&0xff)/255.0f;
+ bf[2] = ( (draw.m_rgba>> 8)&0xff)/255.0f;
+ bf[3] = ( (draw.m_rgba )&0xff)/255.0f;
+ m_commandList->OMSetBlendFactor(bf);
+ }
+
+ if (0 != (BGFX_STATE_PT_MASK & changedFlags)
+ || prim.m_toplogy != s_primInfo[primIndex].m_toplogy)
+ {
+ const uint64_t pt = newFlags&BGFX_STATE_PT_MASK;
+ primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT);
+ prim = s_primInfo[primIndex];
+ m_commandList->IASetPrimitiveTopology(prim.m_toplogy);
+ }
+
+ if (currentState.m_scissor != scissor)
+ {
+ currentState.m_scissor = scissor;
+
+ if (UINT16_MAX == scissor)
+ {
+ if (restoreScissor
+ || viewHasScissor)
+ {
+ restoreScissor = false;
+ D3D12_RECT rc;
+ rc.left = viewScissorRect.m_x;
+ rc.top = viewScissorRect.m_y;
+ rc.right = viewScissorRect.m_x + viewScissorRect.m_width;
+ rc.bottom = viewScissorRect.m_y + viewScissorRect.m_height;
+ m_commandList->RSSetScissorRects(1, &rc);
+ }
+ }
+ else
+ {
+ restoreScissor = true;
+ Rect scissorRect;
+ scissorRect.intersect(viewScissorRect,_render->m_rectCache.m_cache[scissor]);
+ D3D12_RECT rc;
+ rc.left = scissorRect.m_x;
+ rc.top = scissorRect.m_y;
+ rc.right = scissorRect.m_x + scissorRect.m_width;
+ rc.bottom = scissorRect.m_y + scissorRect.m_height;
+ m_commandList->RSSetScissorRects(1, &rc);
+ }
+ }
+
+ if (pso != currentPso)
+ {
+ currentPso = pso;
+ m_commandList->SetPipelineState(pso);
+ }
+
+ bool constantsChanged = false;
+ if (draw.m_constBegin < draw.m_constEnd
+ || currentProgramIdx != key.m_program
+ || BGFX_STATE_ALPHA_REF_MASK & changedFlags)
+ {
+ currentProgramIdx = key.m_program;
+ ProgramD3D12& program = m_program[currentProgramIdx];
+
+ UniformBuffer* vcb = program.m_vsh->m_constantBuffer;
+ if (NULL != vcb)
+ {
+ commit(*vcb);
+ }
+
+ UniformBuffer* fcb = program.m_fsh->m_constantBuffer;
+ if (NULL != fcb)
+ {
+ commit(*fcb);
+ }
+
+ hasPredefined = 0 < program.m_numPredefined;
+ constantsChanged = true;
+ }
+
+ if (constantsChanged
+ || hasPredefined)
+ {
+ ProgramD3D12& program = m_program[currentProgramIdx];
+ uint32_t ref = (newFlags&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT;
+ viewState.m_alphaRef = ref/255.0f;
+ viewState.setPredefined<4>(this, view, 0, program, _render, draw);
+ commitShaderConstants(key.m_program, gpuAddress);
+ }
+
+ uint32_t numIndices = m_batch.draw(m_commandList, gpuAddress, draw);
+ uint32_t numPrimsSubmitted = numIndices / prim.m_div - prim.m_sub;
+ uint32_t numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+
+ statsNumPrimsSubmitted[primIndex] += numPrimsSubmitted;
+ statsNumPrimsRendered[primIndex] += numPrimsRendered;
+ statsNumInstances[primIndex] += draw.m_numInstances;
+ statsNumIndices += numIndices;
+ }
+ }
+
+ m_batch.end(m_commandList);
+ }
+
+ int64_t now = bx::getHPCounter();
+ elapsed += now;
+
+ static int64_t last = now;
+ int64_t frameTime = now - last;
+ last = now;
+
+ static int64_t min = frameTime;
+ static int64_t max = frameTime;
+ min = bx::int64_min(min, frameTime);
+ max = bx::int64_max(max, frameTime);
+
+ static int64_t presentMin = m_presentElapsed;
+ static int64_t presentMax = m_presentElapsed;
+ presentMin = bx::int64_min(presentMin, m_presentElapsed);
+ presentMax = bx::int64_max(presentMax, m_presentElapsed);
+
+ if (_render->m_debug & (BGFX_DEBUG_IFH | BGFX_DEBUG_STATS) )
+ {
+// PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
+
+ TextVideoMem& tvm = m_textVideoMem;
+
+ static int64_t next = now;
+
+ if (now >= next)
+ {
+ next = now + bx::getHPFrequency();
+ double freq = double(bx::getHPFrequency() );
+ double toMs = 1000.0 / freq;
+
+ tvm.clear();
+ uint16_t pos = 0;
+ tvm.printf(0, pos++, BGFX_CONFIG_DEBUG ? 0x89 : 0x8f
+ , " %s / " BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME " "
+ , getRendererName()
+ );
+
+ const DXGI_ADAPTER_DESC& desc = m_adapterDesc;
+ char description[BX_COUNTOF(desc.Description)];
+ wcstombs(description, desc.Description, BX_COUNTOF(desc.Description) );
+ tvm.printf(0, pos++, 0x8f, " Device: %s", description);
+
+ char dedicatedVideo[16];
+ bx::prettify(dedicatedVideo, BX_COUNTOF(dedicatedVideo), desc.DedicatedVideoMemory);
+
+ char dedicatedSystem[16];
+ bx::prettify(dedicatedSystem, BX_COUNTOF(dedicatedSystem), desc.DedicatedSystemMemory);
+
+ char sharedSystem[16];
+ bx::prettify(sharedSystem, BX_COUNTOF(sharedSystem), desc.SharedSystemMemory);
+
+ char processMemoryUsed[16];
+ bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() );
+
+ tvm.printf(0, pos++, 0x8f, " Memory: %s (video), %s (system), %s (shared), %s (process) "
+ , dedicatedVideo
+ , dedicatedSystem
+ , sharedSystem
+ , processMemoryUsed
+ );
+
+ DXGI_QUERY_VIDEO_MEMORY_INFO memInfo;
+ DX_CHECK(m_adapter->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &memInfo) );
+
+ char budget[16];
+ bx::prettify(budget, BX_COUNTOF(budget), memInfo.Budget);
+
+ char currentUsage[16];
+ bx::prettify(currentUsage, BX_COUNTOF(currentUsage), memInfo.CurrentUsage);
+
+ char availableForReservation[16];
+ bx::prettify(availableForReservation, BX_COUNTOF(currentUsage), memInfo.AvailableForReservation);
+
+ char currentReservation[16];
+ bx::prettify(currentReservation, BX_COUNTOF(currentReservation), memInfo.CurrentReservation);
+
+ tvm.printf(0, pos++, 0x8f, " Budget: %s, Usage: %s, AvailRes: %s, CurrRes: %s "
+ , budget
+ , currentUsage
+ , availableForReservation
+ , currentReservation
+ );
+
+ pos = 10;
+ tvm.printf(10, pos++, 0x8e, " Frame: % 7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS "
+ , double(frameTime)*toMs
+ , double(min)*toMs
+ , double(max)*toMs
+ , freq/frameTime
+ );
+ tvm.printf(10, pos++, 0x8e, " Present: % 7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] "
+ , double(m_presentElapsed)*toMs
+ , double(presentMin)*toMs
+ , double(presentMax)*toMs
+ );
+
+ char hmd[16];
+ bx::snprintf(hmd, BX_COUNTOF(hmd), ", [%c] HMD ", hmdEnabled ? '\xfe' : ' ');
+
+ const uint32_t msaa = (m_resolution.m_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT;
+ tvm.printf(10, pos++, 0x8e, " Reset flags: [%c] vsync, [%c] MSAAx%d%s, [%c] MaxAnisotropy "
+ , !!(m_resolution.m_flags&BGFX_RESET_VSYNC) ? '\xfe' : ' '
+ , 0 != msaa ? '\xfe' : ' '
+ , 1<<msaa
+ , ", no-HMD "
+ , !!(m_resolution.m_flags&BGFX_RESET_MAXANISOTROPY) ? '\xfe' : ' '
+ );
+
+ double elapsedCpuMs = double(elapsed)*toMs;
+ tvm.printf(10, pos++, 0x8e, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] "
+ , _render->m_num
+ , statsKeyType[0]
+ , statsKeyType[1]
+ , elapsedCpuMs
+ );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii)
+ {
+ tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d "
+ , s_primName[ii]
+ , statsNumPrimsRendered[ii]
+ , statsNumInstances[ii]
+ , statsNumPrimsSubmitted[ii]
+ );
+ }
+
+ tvm.printf(10, pos++, 0x8e, " Batch: %7dx%d indirect, %7d immediate "
+ , m_batch.m_stats.m_numIndirect[BatchD3D12::Draw]
+ , m_batch.m_maxDrawPerBatch
+ , m_batch.m_stats.m_numImmediate[BatchD3D12::Draw]
+ );
+
+ tvm.printf(10, pos++, 0x8e, " %7dx%d indirect, %7d immediate "
+ , m_batch.m_stats.m_numIndirect[BatchD3D12::DrawIndexed]
+ , m_batch.m_maxDrawPerBatch
+ , m_batch.m_stats.m_numImmediate[BatchD3D12::DrawIndexed]
+ );
+
+// if (NULL != m_renderdocdll)
+// {
+// tvm.printf(tvm.m_width-27, 0, 0x1f, " [F11 - RenderDoc capture] ");
+// }
+
+ tvm.printf(10, pos++, 0x8e, " Indices: %7d ", statsNumIndices);
+ tvm.printf(10, pos++, 0x8e, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax);
+ tvm.printf(10, pos++, 0x8e, " DVB size: %7d ", _render->m_vboffset);
+ tvm.printf(10, pos++, 0x8e, " DIB size: %7d ", _render->m_iboffset);
+
+ pos++;
+ tvm.printf(10, pos++, 0x8e, " State cache: ");
+ tvm.printf(10, pos++, 0x8e, " PSO | Sampler | Bind | Queued ");
+ tvm.printf(10, pos++, 0x8e, " %6d | %6d | %6d | %6d "
+ , m_pipelineStateCache.getCount()
+ , m_samplerStateCache.getCount()
+ , bindLru.getCount()
+ , m_cmd.m_control.available()
+ );
+ pos++;
+
+ double captureMs = double(captureElapsed)*toMs;
+ tvm.printf(10, pos++, 0x8e, " Capture: %7.4f [ms] ", captureMs);
+
+ uint8_t attr[2] = { 0x89, 0x8a };
+ uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender;
+
+ tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %7.4f [ms] ", _render->m_waitSubmit*toMs);
+ tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %7.4f [ms] ", _render->m_waitRender*toMs);
+
+ min = frameTime;
+ max = frameTime;
+ presentMin = m_presentElapsed;
+ presentMax = m_presentElapsed;
+ }
+
+ blit(this, _textVideoMemBlitter, tvm);
+
+// PIX_ENDEVENT();
+ }
+ else if (_render->m_debug & BGFX_DEBUG_TEXT)
+ {
+// PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugtext");
+
+ blit(this, _textVideoMemBlitter, _render->m_textVideoMem);
+
+// PIX_ENDEVENT();
+ }
+
+ setResourceBarrier(m_commandList
+ , m_backBufferColor[m_backBufferColorIdx]
+ , D3D12_RESOURCE_STATE_RENDER_TARGET
+ , D3D12_RESOURCE_STATE_PRESENT
+ );
+ m_backBufferColorFence[m_backBufferColorIdx] = kick();
+ }
+
+} /* namespace d3d12 */ } // namespace bgfx
+
#else
namespace bgfx { namespace d3d12
diff --git a/3rdparty/bgfx/src/renderer_d3d12.h b/3rdparty/bgfx/src/renderer_d3d12.h
new file mode 100644
index 00000000000..00f9a17f89a
--- /dev/null
+++ b/3rdparty/bgfx/src/renderer_d3d12.h
@@ -0,0 +1,434 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_RENDERER_D3D12_H_HEADER_GUARD
+#define BGFX_RENDERER_D3D12_H_HEADER_GUARD
+
+#define USE_D3D12_DYNAMIC_LIB 1
+
+#include <sal.h>
+#include <d3d12.h>
+
+#if defined(__MINGW32__) // BK - temp workaround for MinGW until I nuke d3dx12 usage.
+extern "C++" {
+ __extension__ template<typename Ty>
+ const GUID& __mingw_uuidof();
+
+ template<>
+ const GUID& __mingw_uuidof<ID3D12Device>()
+ {
+ static const GUID IID_ID3D12Device0 = { 0x189819f1, 0x1db6, 0x4b57, { 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7 } };
+ return IID_ID3D12Device0;
+ }
+}
+#endif // defined(__MINGW32__)
+
+BX_PRAGMA_DIAGNOSTIC_PUSH();
+BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers");
+#include <d3dx12.h>
+BX_PRAGMA_DIAGNOSTIC_POP();
+
+#include <dxgi1_4.h>
+
+#include "renderer.h"
+#include "renderer_d3d.h"
+#include "shader_dxbc.h"
+
+namespace bgfx { namespace d3d12
+{
+ struct Rdt
+ {
+ enum Enum
+ {
+ Sampler,
+ SRV,
+ CBV,
+ UAV,
+
+ Count
+ };
+ };
+
+ class ScratchBufferD3D12
+ {
+ public:
+ ScratchBufferD3D12()
+ {
+ }
+
+ ~ScratchBufferD3D12()
+ {
+ }
+
+ void create(uint32_t _size, uint32_t _maxDescriptors);
+ void destroy();
+ void reset(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle);
+
+ void* allocCbv(D3D12_GPU_VIRTUAL_ADDRESS& gpuAddress, uint32_t _size);
+
+ void allocSrv(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle, struct TextureD3D12& _texture, uint8_t _mip = 0);
+ void allocSrv(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle, struct BufferD3D12& _buffer);
+
+ void allocUav(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle, struct TextureD3D12& _texture, uint8_t _mip = 0);
+ void allocUav(D3D12_GPU_DESCRIPTOR_HANDLE& gpuHandle, struct BufferD3D12& _buffer);
+
+ ID3D12DescriptorHeap* getHeap()
+ {
+ return m_heap;
+ }
+
+ private:
+ ID3D12DescriptorHeap* m_heap;
+ ID3D12Resource* m_upload;
+ D3D12_GPU_VIRTUAL_ADDRESS m_gpuVA;
+ D3D12_CPU_DESCRIPTOR_HANDLE m_cpuHandle;
+ D3D12_GPU_DESCRIPTOR_HANDLE m_gpuHandle;
+ uint32_t m_incrementSize;
+ uint8_t* m_data;
+ uint32_t m_size;
+ uint32_t m_pos;
+ };
+
+ class DescriptorAllocatorD3D12
+ {
+ public:
+ DescriptorAllocatorD3D12()
+ : m_numDescriptorsPerBlock(1)
+ {
+ }
+
+ ~DescriptorAllocatorD3D12()
+ {
+ }
+
+ void create(D3D12_DESCRIPTOR_HEAP_TYPE _type, uint16_t _maxDescriptors, uint16_t _numDescriptorsPerBlock = 1);
+ void destroy();
+
+ uint16_t alloc(ID3D12Resource* _ptr, const D3D12_SHADER_RESOURCE_VIEW_DESC* _desc);
+ uint16_t alloc(const uint32_t* _flags, uint32_t _num, const float _palette[][4]);
+ void free(uint16_t _handle);
+ void reset();
+
+ D3D12_GPU_DESCRIPTOR_HANDLE get(uint16_t _handle);
+
+ ID3D12DescriptorHeap* getHeap()
+ {
+ return m_heap;
+ }
+
+ private:
+ ID3D12DescriptorHeap* m_heap;
+ bx::HandleAlloc* m_handleAlloc;
+ D3D12_CPU_DESCRIPTOR_HANDLE m_cpuHandle;
+ D3D12_GPU_DESCRIPTOR_HANDLE m_gpuHandle;
+ uint32_t m_incrementSize;
+ uint16_t m_numDescriptorsPerBlock;
+ };
+
+ struct BufferD3D12
+ {
+ BufferD3D12()
+ : m_ptr(NULL)
+ , m_state(D3D12_RESOURCE_STATE_COMMON)
+ , m_size(0)
+ , m_flags(BGFX_BUFFER_NONE)
+ , m_dynamic(false)
+ {
+ }
+
+ void create(uint32_t _size, void* _data, uint16_t _flags, bool _vertex, uint32_t _stride = 0);
+ void update(ID3D12GraphicsCommandList* _commandList, uint32_t _offset, uint32_t _size, void* _data, bool _discard = false);
+ void destroy();
+
+ D3D12_RESOURCE_STATES setState(ID3D12GraphicsCommandList* _commandList, D3D12_RESOURCE_STATES _state);
+
+ D3D12_SHADER_RESOURCE_VIEW_DESC m_srvd;
+ D3D12_UNORDERED_ACCESS_VIEW_DESC m_uavd;
+ ID3D12Resource* m_ptr;
+ D3D12_GPU_VIRTUAL_ADDRESS m_gpuVA;
+ D3D12_RESOURCE_STATES m_state;
+ uint32_t m_size;
+ uint16_t m_flags;
+ bool m_dynamic;
+ };
+
+ struct VertexBufferD3D12 : public BufferD3D12
+ {
+ void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+
+ VertexDeclHandle m_decl;
+ };
+
+ struct ShaderD3D12
+ {
+ ShaderD3D12()
+ : m_code(NULL)
+ , m_constantBuffer(NULL)
+ , m_hash(0)
+ , m_numUniforms(0)
+ , m_numPredefined(0)
+ {
+ }
+
+ void create(const Memory* _mem);
+ DWORD* getShaderCode(uint8_t _fragmentBit, const Memory* _mem);
+
+ void destroy()
+ {
+ if (NULL != m_constantBuffer)
+ {
+ UniformBuffer::destroy(m_constantBuffer);
+ m_constantBuffer = NULL;
+ }
+
+ m_numPredefined = 0;
+
+ if (NULL != m_code)
+ {
+ release(m_code);
+ m_code = NULL;
+ m_hash = 0;
+ }
+ }
+
+ const Memory* m_code;
+ UniformBuffer* m_constantBuffer;
+
+ PredefinedUniform m_predefined[PredefinedUniform::Count];
+ uint16_t m_attrMask[Attrib::Count];
+
+ uint32_t m_hash;
+ uint16_t m_numUniforms;
+ uint16_t m_size;
+ uint8_t m_numPredefined;
+ };
+
+ struct ProgramD3D12
+ {
+ ProgramD3D12()
+ : m_vsh(NULL)
+ , m_fsh(NULL)
+ {
+ }
+
+ void create(const ShaderD3D12* _vsh, const ShaderD3D12* _fsh)
+ {
+ BX_CHECK(NULL != _vsh->m_code, "Vertex shader doesn't exist.");
+ m_vsh = _vsh;
+ memcpy(&m_predefined[0], _vsh->m_predefined, _vsh->m_numPredefined*sizeof(PredefinedUniform));
+ m_numPredefined = _vsh->m_numPredefined;
+
+ if (NULL != _fsh)
+ {
+ BX_CHECK(NULL != _fsh->m_code, "Fragment shader doesn't exist.");
+ m_fsh = _fsh;
+ memcpy(&m_predefined[m_numPredefined], _fsh->m_predefined, _fsh->m_numPredefined*sizeof(PredefinedUniform));
+ m_numPredefined += _fsh->m_numPredefined;
+ }
+ }
+
+ void destroy()
+ {
+ m_numPredefined = 0;
+ m_vsh = NULL;
+ m_fsh = NULL;
+ }
+
+ const ShaderD3D12* m_vsh;
+ const ShaderD3D12* m_fsh;
+
+ PredefinedUniform m_predefined[PredefinedUniform::Count * 2];
+ uint8_t m_numPredefined;
+ };
+
+ struct TextureD3D12
+ {
+ enum Enum
+ {
+ Texture2D,
+ Texture3D,
+ TextureCube,
+ };
+
+ TextureD3D12()
+ : m_ptr(NULL)
+ , m_state(D3D12_RESOURCE_STATE_COMMON)
+ , m_numMips(0)
+ {
+ memset(&m_srvd, 0, sizeof(m_srvd) );
+ memset(&m_uavd, 0, sizeof(m_uavd) );
+ }
+
+ void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
+ void destroy();
+ void update(ID3D12GraphicsCommandList* _commandList, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
+ void resolve();
+ D3D12_RESOURCE_STATES setState(ID3D12GraphicsCommandList* _commandList, D3D12_RESOURCE_STATES _state);
+
+ D3D12_SHADER_RESOURCE_VIEW_DESC m_srvd;
+ D3D12_UNORDERED_ACCESS_VIEW_DESC m_uavd;
+ ID3D12Resource* m_ptr;
+ D3D12_RESOURCE_STATES m_state;
+ uint32_t m_flags;
+ uint16_t m_samplerIdx;
+ uint8_t m_type;
+ uint8_t m_requestedFormat;
+ uint8_t m_textureFormat;
+ uint8_t m_numMips;
+ };
+
+ struct FrameBufferD3D12
+ {
+ FrameBufferD3D12()
+ : m_swapChain(NULL)
+ , m_width(0)
+ , m_height(0)
+ , m_denseIdx(UINT16_MAX)
+ , m_num(0)
+ , m_numTh(0)
+ {
+ m_depth.idx = bgfx::invalidHandle;
+ }
+
+ void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
+ uint16_t destroy();
+ void preReset();
+ void postReset();
+ void resolve();
+ void clear(ID3D12GraphicsCommandList* _commandList, const Clear& _clear, const float _palette[][4], const D3D12_RECT* _rect = NULL, uint32_t _num = 0);
+
+ TextureHandle m_texture[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ TextureHandle m_depth;
+ IDXGISwapChain* m_swapChain;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint16_t m_denseIdx;
+ uint8_t m_num;
+ uint8_t m_numTh;
+ TextureHandle m_th[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ };
+
+ struct CommandQueueD3D12
+ {
+ CommandQueueD3D12()
+ : m_currentFence(0)
+ , m_completedFence(0)
+ , m_control(BX_COUNTOF(m_commandList) )
+ {
+ BX_STATIC_ASSERT(BX_COUNTOF(m_commandList) == BX_COUNTOF(m_release) );
+ }
+
+ void init(ID3D12Device* _device);
+ void shutdown();
+ ID3D12GraphicsCommandList* alloc();
+ uint64_t kick();
+ void finish(uint64_t _waitFence = UINT64_MAX, bool _finishAll = false);
+ bool tryFinish(uint64_t _waitFence);
+ void release(ID3D12Resource* _ptr);
+ bool consume(uint32_t _ms = INFINITE);
+
+ struct CommandList
+ {
+ ID3D12GraphicsCommandList* m_commandList;
+ ID3D12CommandAllocator* m_commandAllocator;
+ HANDLE m_event;
+ };
+
+ ID3D12CommandQueue* m_commandQueue;
+ uint64_t m_currentFence;
+ uint64_t m_completedFence;
+ ID3D12Fence* m_fence;
+ CommandList m_commandList[32];
+ typedef stl::vector<ID3D12Resource*> ResourceArray;
+ ResourceArray m_release[32];
+ bx::RingBufferControl m_control;
+ };
+
+ struct BatchD3D12
+ {
+ enum Enum
+ {
+ Draw,
+ DrawIndexed,
+
+ Count
+ };
+
+ BatchD3D12()
+ : m_currIndirect(0)
+ , m_maxDrawPerBatch(0)
+ , m_minIndirect(0)
+ , m_flushPerBatch(0)
+ {
+ memset(m_num, 0, sizeof(m_num) );
+ }
+
+ ~BatchD3D12()
+ {
+ }
+
+ void create(uint32_t _maxDrawPerBatch);
+ void destroy();
+
+ template<typename Ty>
+ Ty& getCmd(Enum _type);
+
+ uint32_t draw(ID3D12GraphicsCommandList* _commandList, D3D12_GPU_VIRTUAL_ADDRESS _cbv, const RenderDraw& _draw);
+
+ void flush(ID3D12GraphicsCommandList* _commandList, Enum _type);
+ void flush(ID3D12GraphicsCommandList* _commandList, bool _clean = false);
+
+ void begin();
+ void end(ID3D12GraphicsCommandList* _commandList);
+
+ void setSeqMode(bool _enabled)
+ {
+ m_flushPerBatch = _enabled ? 1 : m_maxDrawPerBatch;
+ }
+
+ void setIndirectMode(bool _enabled)
+ {
+ m_minIndirect = _enabled ? 64 : UINT32_MAX;
+ }
+
+ ID3D12CommandSignature* m_commandSignature[Count];
+ uint32_t m_num[Count];
+ void* m_cmds[Count];
+
+ struct DrawIndirectCommand
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS cbv;
+ D3D12_VERTEX_BUFFER_VIEW vbv[2];
+ D3D12_DRAW_ARGUMENTS draw;
+ };
+
+ struct DrawIndexedIndirectCommand
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS cbv;
+ D3D12_VERTEX_BUFFER_VIEW vbv[2];
+ D3D12_INDEX_BUFFER_VIEW ibv;
+ D3D12_DRAW_INDEXED_ARGUMENTS drawIndexed;
+ };
+
+ struct Stats
+ {
+ uint32_t m_numImmediate[Count];
+ uint32_t m_numIndirect[Count];
+ };
+
+ BufferD3D12 m_indirect[32];
+ uint32_t m_currIndirect;
+ DrawIndexedIndirectCommand m_current;
+
+ Stats m_stats;
+ uint32_t m_maxDrawPerBatch;
+ uint32_t m_minIndirect;
+ uint32_t m_flushPerBatch;
+ };
+
+} /* namespace d3d12 */ } // namespace bgfx
+
+#endif // BGFX_RENDERER_D3D12_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index 0406f33eb2f..d14956ab49d 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -148,31 +148,12 @@ namespace bgfx { namespace d3d9
D3DCULL_CCW,
};
- static const D3DFORMAT s_checkColorFormats[] =
- {
- D3DFMT_UNKNOWN,
- D3DFMT_A8R8G8B8, D3DFMT_UNKNOWN,
- D3DFMT_R32F, D3DFMT_R16F, D3DFMT_G16R16, D3DFMT_A8R8G8B8, D3DFMT_UNKNOWN,
-
- D3DFMT_UNKNOWN, // terminator
- };
-
- static D3DFORMAT s_colorFormat[] =
- {
- D3DFMT_UNKNOWN, // ignored
- D3DFMT_A8R8G8B8,
- D3DFMT_A2B10G10R10,
- D3DFMT_A16B16G16R16,
- D3DFMT_A16B16G16R16F,
- D3DFMT_R16F,
- D3DFMT_R32F,
- };
-
static const D3DTEXTUREADDRESS s_textureAddress[] =
{
D3DTADDRESS_WRAP,
D3DTADDRESS_MIRROR,
D3DTADDRESS_CLAMP,
+ D3DTADDRESS_BORDER,
};
static const D3DTEXTUREFILTERTYPE s_textureFilter[] =
@@ -208,21 +189,44 @@ namespace bgfx { namespace d3d9
{ D3DFMT_UNKNOWN }, // PTC24
{ D3DFMT_UNKNOWN }, // Unknown
{ D3DFMT_A1 }, // R1
+ { D3DFMT_A8 }, // A8
{ D3DFMT_L8 }, // R8
- { D3DFMT_G16R16 }, // R16
+ { D3DFMT_UNKNOWN }, // R8I
+ { D3DFMT_UNKNOWN }, // R8U
+ { D3DFMT_UNKNOWN }, // R8S
+ { D3DFMT_L16 }, // R16
+ { D3DFMT_UNKNOWN }, // R16I
+ { D3DFMT_UNKNOWN }, // R16U
{ D3DFMT_R16F }, // R16F
- { D3DFMT_UNKNOWN }, // R32
+ { D3DFMT_UNKNOWN }, // R16S
+ { D3DFMT_UNKNOWN }, // R32I
+ { D3DFMT_UNKNOWN }, // R32U
{ D3DFMT_R32F }, // R32F
{ D3DFMT_A8L8 }, // RG8
+ { D3DFMT_UNKNOWN }, // RG8I
+ { D3DFMT_UNKNOWN }, // RG8U
+ { D3DFMT_UNKNOWN }, // RG8S
{ D3DFMT_G16R16 }, // RG16
+ { D3DFMT_UNKNOWN }, // RG16I
+ { D3DFMT_UNKNOWN }, // RG16U
{ D3DFMT_G16R16F }, // RG16F
- { D3DFMT_UNKNOWN }, // RG32
+ { D3DFMT_UNKNOWN }, // RG16S
+ { D3DFMT_UNKNOWN }, // RG32I
+ { D3DFMT_UNKNOWN }, // RG32U
{ D3DFMT_G32R32F }, // RG32F
+ { D3DFMT_UNKNOWN }, // RGB9E5F
{ D3DFMT_A8R8G8B8 }, // BGRA8
{ D3DFMT_UNKNOWN }, // RGBA8
+ { D3DFMT_UNKNOWN }, // RGBA8I
+ { D3DFMT_UNKNOWN }, // RGBA8U
+ { D3DFMT_UNKNOWN }, // RGBA8S
{ D3DFMT_A16B16G16R16 }, // RGBA16
+ { D3DFMT_UNKNOWN }, // RGBA16I
+ { D3DFMT_UNKNOWN }, // RGBA16U
{ D3DFMT_A16B16G16R16F }, // RGBA16F
- { D3DFMT_UNKNOWN }, // RGBA32
+ { D3DFMT_UNKNOWN }, // RGBA16S
+ { D3DFMT_UNKNOWN }, // RGBA32I
+ { D3DFMT_UNKNOWN }, // RGBA32U
{ D3DFMT_A32B32G32R32F }, // RGBA32F
{ D3DFMT_R5G6B5 }, // R5G6B5
{ D3DFMT_A4R4G4B4 }, // RGBA4
@@ -282,7 +286,8 @@ namespace bgfx { namespace d3d9
, m_initialized(false)
, m_amd(false)
, m_nvidia(false)
- , m_instancing(false)
+ , m_instancingSupport(false)
+ , m_timerQuerySupport(false)
, m_rtMsaa(false)
{
}
@@ -291,8 +296,21 @@ namespace bgfx { namespace d3d9
{
}
- void init()
+ bool init()
{
+ struct ErrorState
+ {
+ enum Enum
+ {
+ Default,
+ LoadedD3D9,
+ CreatedD3D9,
+ CreatedDevice,
+ };
+ };
+
+ ErrorState::Enum errorState = ErrorState::Default;
+
m_fbh.idx = invalidHandle;
memset(m_uniforms, 0, sizeof(m_uniforms) );
memset(&m_resolution, 0, sizeof(m_resolution) );
@@ -319,11 +337,18 @@ namespace bgfx { namespace d3d9
RECT rect;
GetWindowRect( (HWND)g_platformData.nwh, &rect);
- m_params.BackBufferWidth = rect.right-rect.left;
+ m_params.BackBufferWidth = rect.right-rect.left;
m_params.BackBufferHeight = rect.bottom-rect.top;
m_d3d9dll = bx::dlopen("d3d9.dll");
- BGFX_FATAL(NULL != m_d3d9dll, Fatal::UnableToInitialize, "Failed to load d3d9.dll.");
+ BX_WARN(NULL != m_d3d9dll, "Failed to load d3d9.dll.");
+
+ if (NULL == m_d3d9dll)
+ {
+ goto error;
+ }
+
+ errorState = ErrorState::LoadedD3D9;
if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) )
{
@@ -351,79 +376,93 @@ namespace bgfx { namespace d3d9
#endif // BGFX_CONFIG_RENDERER_DIRECT3D9EX
{
Direct3DCreate9 = (Direct3DCreate9Fn)bx::dlsym(m_d3d9dll, "Direct3DCreate9");
- BGFX_FATAL(NULL != Direct3DCreate9, Fatal::UnableToInitialize, "Function Direct3DCreate9 not found.");
+ BX_WARN(NULL != Direct3DCreate9, "Function Direct3DCreate9 not found.");
+
+ if (NULL == Direct3DCreate9)
+ {
+ goto error;
+ }
+
m_d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
m_pool = D3DPOOL_MANAGED;
}
- BGFX_FATAL(m_d3d9, Fatal::UnableToInitialize, "Unable to create Direct3D.");
+ BX_WARN(NULL != m_d3d9, "Unable to create Direct3D.");
- m_adapter = D3DADAPTER_DEFAULT;
- m_deviceType = BGFX_PCI_ID_SOFTWARE_RASTERIZER == g_caps.vendorId
- ? D3DDEVTYPE_REF
- : D3DDEVTYPE_HAL
- ;
-
- uint8_t numGPUs = uint8_t(bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ) );
- for (uint32_t ii = 0; ii < numGPUs; ++ii)
+ if (NULL == m_d3d9)
{
- D3DADAPTER_IDENTIFIER9 desc;
- HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc);
- if (SUCCEEDED(hr) )
- {
- BX_TRACE("Adapter #%d", ii);
- BX_TRACE("\tDriver: %s", desc.Driver);
- BX_TRACE("\tDescription: %s", desc.Description);
- BX_TRACE("\tDeviceName: %s", desc.DeviceName);
- BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x"
- , desc.VendorId
- , desc.DeviceId
- , desc.SubSysId
- , desc.Revision
- );
+ goto error;
+ }
- g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId;
- g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId;
+ errorState = ErrorState::CreatedD3D9;
- if (D3DADAPTER_DEFAULT == m_adapter)
+ {
+ m_adapter = D3DADAPTER_DEFAULT;
+ m_deviceType = BGFX_PCI_ID_SOFTWARE_RASTERIZER == g_caps.vendorId
+ ? D3DDEVTYPE_REF
+ : D3DDEVTYPE_HAL
+ ;
+
+ uint8_t numGPUs = uint8_t(bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ) );
+ for (uint32_t ii = 0; ii < numGPUs; ++ii)
+ {
+ D3DADAPTER_IDENTIFIER9 desc;
+ HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc);
+ if (SUCCEEDED(hr) )
{
- if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId)
- && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId)
- && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) )
+ BX_TRACE("Adapter #%d", ii);
+ BX_TRACE("\tDriver: %s", desc.Driver);
+ BX_TRACE("\tDescription: %s", desc.Description);
+ BX_TRACE("\tDeviceName: %s", desc.DeviceName);
+ BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x"
+ , desc.VendorId
+ , desc.DeviceId
+ , desc.SubSysId
+ , desc.Revision
+ );
+
+ g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId;
+ g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId;
+
+ if (D3DADAPTER_DEFAULT == m_adapter)
{
- m_adapter = ii;
- }
+ if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId)
+ && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId)
+ && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) )
+ {
+ m_adapter = ii;
+ }
- if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD)
- && 0 != strstr(desc.Description, "PerfHUD"))
- {
- m_adapter = ii;
- m_deviceType = D3DDEVTYPE_REF;
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD)
+ && 0 != strstr(desc.Description, "PerfHUD") )
+ {
+ m_adapter = ii;
+ m_deviceType = D3DDEVTYPE_REF;
+ }
}
}
}
- }
- DX_CHECK(m_d3d9->GetAdapterIdentifier(m_adapter, 0, &m_identifier) );
- m_amd = m_identifier.VendorId == BGFX_PCI_ID_AMD;
- m_nvidia = m_identifier.VendorId == BGFX_PCI_ID_NVIDIA;
- g_caps.vendorId = 0 == m_identifier.VendorId
- ? BGFX_PCI_ID_SOFTWARE_RASTERIZER
- : (uint16_t)m_identifier.VendorId
- ;
- g_caps.deviceId = (uint16_t)m_identifier.DeviceId;
+ DX_CHECK(m_d3d9->GetAdapterIdentifier(m_adapter, 0, &m_identifier) );
+ m_amd = m_identifier.VendorId == BGFX_PCI_ID_AMD;
+ m_nvidia = m_identifier.VendorId == BGFX_PCI_ID_NVIDIA;
+ g_caps.vendorId = 0 == m_identifier.VendorId
+ ? BGFX_PCI_ID_SOFTWARE_RASTERIZER
+ : (uint16_t)m_identifier.VendorId
+ ;
+ g_caps.deviceId = (uint16_t)m_identifier.DeviceId;
- uint32_t behaviorFlags[] =
- {
- D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE | D3DCREATE_PUREDEVICE,
- D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE,
- D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE,
- };
+ uint32_t behaviorFlags[] =
+ {
+ D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE | D3DCREATE_PUREDEVICE,
+ D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE,
+ D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE,
+ };
- for (uint32_t ii = 0; ii < BX_COUNTOF(behaviorFlags) && NULL == m_device; ++ii)
- {
+ for (uint32_t ii = 0; ii < BX_COUNTOF(behaviorFlags) && NULL == m_device; ++ii)
+ {
#if 0 // BGFX_CONFIG_RENDERER_DIRECT3D9EX
- DX_CHECK(m_d3d9->CreateDeviceEx(m_adapter
+ DX_CHECK(m_d3d9->CreateDeviceEx(m_adapter
, m_deviceType
, g_platformHooks.nwh
, behaviorFlags[ii]
@@ -432,17 +471,25 @@ namespace bgfx { namespace d3d9
, &m_device
) );
#else
- DX_CHECK(m_d3d9->CreateDevice(m_adapter
- , m_deviceType
- , (HWND)g_platformData.nwh
- , behaviorFlags[ii]
- , &m_params
- , &m_device
- ) );
+ DX_CHECK(m_d3d9->CreateDevice(m_adapter
+ , m_deviceType
+ , (HWND)g_platformData.nwh
+ , behaviorFlags[ii]
+ , &m_params
+ , &m_device
+ ));
#endif // BGFX_CONFIG_RENDERER_DIRECT3D9EX
+ }
+ }
+
+ BX_WARN(NULL != m_device, "Unable to create Direct3D9 device.");
+
+ if (NULL == m_device)
+ {
+ goto error;
}
- BGFX_FATAL(m_device, Fatal::UnableToInitialize, "Unable to create Direct3D9 device.");
+ errorState = ErrorState::CreatedDevice;
m_numWindows = 1;
@@ -456,15 +503,23 @@ namespace bgfx { namespace d3d9
DX_CHECK(m_device->GetDeviceCaps(&m_caps) );
// For shit GPUs that can create DX9 device but can't do simple stuff. GTFO!
- BGFX_FATAL( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) == 0, Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_SQUAREONLY");
- BGFX_FATAL( (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) == D3DPTEXTURECAPS_MIPMAP, Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_MIPMAP");
- BGFX_FATAL( (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) == D3DPTEXTURECAPS_ALPHA, Fatal::MinimumRequiredSpecs, "D3DPTEXTURECAPS_ALPHA");
- BGFX_FATAL(m_caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && m_caps.PixelShaderVersion >= D3DPS_VERSION(2, 1)
- , Fatal::MinimumRequiredSpecs
+ BX_WARN( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) == 0, "D3DPTEXTURECAPS_SQUAREONLY");
+ BX_WARN( (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) == D3DPTEXTURECAPS_MIPMAP, "D3DPTEXTURECAPS_MIPMAP");
+ BX_WARN( (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) == D3DPTEXTURECAPS_ALPHA, "D3DPTEXTURECAPS_ALPHA");
+ BX_WARN(m_caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && m_caps.PixelShaderVersion >= D3DPS_VERSION(2, 1)
, "Shader Model Version (vs: %x, ps: %x)."
, m_caps.VertexShaderVersion
, m_caps.PixelShaderVersion
);
+
+ if ( (D3DPTEXTURECAPS_SQUAREONLY & m_caps.TextureCaps) != 0
+ || (D3DPTEXTURECAPS_MIPMAP & m_caps.TextureCaps) != D3DPTEXTURECAPS_MIPMAP
+ || (D3DPTEXTURECAPS_ALPHA & m_caps.TextureCaps) != D3DPTEXTURECAPS_ALPHA
+ || !(m_caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && m_caps.PixelShaderVersion >= D3DPS_VERSION(2, 1) ) )
+ {
+ goto error;
+ }
+
BX_TRACE("Max vertex shader 3.0 instr. slots: %d", m_caps.MaxVertexShader30InstructionSlots);
BX_TRACE("Max vertex shader constants: %d", m_caps.MaxVertexShaderConst);
BX_TRACE("Max fragment shader 2.0 instr. slots: %d", m_caps.PS20Caps.NumInstructionSlots);
@@ -476,6 +531,7 @@ namespace bgfx { namespace d3d9
| BGFX_CAPS_TEXTURE_3D
| BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
| BGFX_CAPS_VERTEX_ATTRIB_HALF
+ | BGFX_CAPS_VERTEX_ATTRIB_UINT10
| BGFX_CAPS_FRAGMENT_DEPTH
| BGFX_CAPS_SWAP_CHAIN
| ( (UINT16_MAX < m_caps.MaxVertexIndex) ? BGFX_CAPS_INDEX32 : 0)
@@ -486,7 +542,7 @@ namespace bgfx { namespace d3d9
m_caps.NumSimultaneousRTs = uint8_t(bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
g_caps.maxFBAttachments = uint8_t(m_caps.NumSimultaneousRTs);
- m_caps.MaxAnisotropy = bx::uint32_min(m_caps.MaxAnisotropy, 1);
+ m_caps.MaxAnisotropy = bx::uint32_max(m_caps.MaxAnisotropy, 1);
if (BX_ENABLED(BGFX_CONFIG_RENDERER_USE_EXTENSIONS) )
{
@@ -500,7 +556,7 @@ namespace bgfx { namespace d3d9
BX_UNUSED(fourcc);
}
- m_instancing = false
+ m_instancingSupport = false
|| s_extendedFormats[ExtendedFormat::Inst].m_supported
|| (m_caps.VertexShaderVersion >= D3DVS_VERSION(3, 0) )
;
@@ -520,7 +576,7 @@ namespace bgfx { namespace d3d9
s_textureFormat[TextureFormat::BC4].m_fmt = s_extendedFormats[ExtendedFormat::Ati1].m_supported ? D3DFMT_ATI1 : D3DFMT_UNKNOWN;
s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN;
- g_caps.supported |= m_instancing ? BGFX_CAPS_INSTANCING : 0;
+ g_caps.supported |= m_instancingSupport ? BGFX_CAPS_INSTANCING : 0;
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
@@ -556,23 +612,16 @@ namespace bgfx { namespace d3d9
, s_textureFormat[ii].m_fmt
) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
- g_caps.formats[ii] = support;
- }
- }
+ support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter
+ , m_deviceType
+ , s_textureFormat[ii].m_fmt
+ , true
+ , D3DMULTISAMPLE_2_SAMPLES
+ , NULL
+ ) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE;
- uint32_t index = 1;
- for (const D3DFORMAT* fmt = &s_checkColorFormats[index]; *fmt != D3DFMT_UNKNOWN; ++fmt, ++index)
- {
- for (; *fmt != D3DFMT_UNKNOWN; ++fmt)
- {
- if (SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter, m_deviceType, adapterFormat, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, *fmt) ) )
- {
- s_colorFormat[index] = *fmt;
- break;
- }
+ g_caps.formats[ii] = support;
}
-
- for (; *fmt != D3DFMT_UNKNOWN; ++fmt);
}
m_fmtDepth = D3DFMT_D24S8;
@@ -609,6 +658,18 @@ namespace bgfx { namespace d3d9
#endif // BX_PLATFORM_WINDOWS
{
+ IDirect3DQuery9* timerQueryTest[3] = {};
+ m_timerQuerySupport = true
+ && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMPDISJOINT, &timerQueryTest[0]) )
+ && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMP, &timerQueryTest[1]) )
+ && SUCCEEDED(m_device->CreateQuery(D3DQUERYTYPE_TIMESTAMPFREQ, &timerQueryTest[2]) )
+ ;
+ DX_RELEASE(timerQueryTest[0], 0);
+ DX_RELEASE(timerQueryTest[1], 0);
+ DX_RELEASE(timerQueryTest[2], 0);
+ }
+
+ {
IDirect3DSwapChain9* swapChain;
DX_CHECK(m_device->GetSwapChain(0, &swapChain) );
@@ -632,6 +693,48 @@ namespace bgfx { namespace d3d9
postReset();
m_initialized = true;
+
+ return true;
+
+ error:
+ switch (errorState)
+ {
+ case ErrorState::CreatedDevice:
+#if BGFX_CONFIG_RENDERER_DIRECT3D9EX
+ if (NULL != m_d3d9ex)
+ {
+ DX_RELEASE(m_deviceEx, 1);
+ DX_RELEASE(m_device, 0);
+ }
+ else
+#endif // BGFX_CONFIG_RENDERER_DIRECT3D9EX
+ {
+ DX_RELEASE(m_device, 0);
+ }
+
+ case ErrorState::CreatedD3D9:
+#if BGFX_CONFIG_RENDERER_DIRECT3D9EX
+ if (NULL != m_d3d9ex)
+ {
+ DX_RELEASE(m_d3d9, 1);
+ DX_RELEASE(m_d3d9ex, 0);
+ }
+ else
+#endif // BGFX_CONFIG_RENDERER_DIRECT3D9EX
+ {
+ DX_RELEASE(m_d3d9, 0);
+ }
+
+#if BX_PLATFORM_WINDOWS
+ case ErrorState::LoadedD3D9:
+ bx::dlclose(m_d3d9dll);
+#endif // BX_PLATFORM_WINDOWS
+
+ case ErrorState::Default:
+ break;
+ }
+
+ return false;
}
void shutdown()
@@ -981,7 +1084,7 @@ namespace bgfx { namespace d3d9
uint8_t flags = predefined.m_type;
setShaderUniform(flags, predefined.m_loc, proj, 4);
- m_textures[_blitter.m_texture.idx].commit(0);
+ m_textures[_blitter.m_texture.idx].commit(0, BGFX_SAMPLER_DEFAULT_FLAGS, NULL);
}
void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
@@ -1095,7 +1198,7 @@ namespace bgfx { namespace d3d9
}
DX_CHECK(m_device->SetDepthStencilSurface(m_backBufferDepthStencil) );
- DX_CHECK(m_device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0 != (m_flags & BGFX_RESET_SRGB_BACKBUFFER) ));
+ DX_CHECK(m_device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0 != (m_flags & BGFX_RESET_SRGB_BACKBUFFER) ) );
}
else
{
@@ -1249,7 +1352,10 @@ namespace bgfx { namespace d3d9
capturePreReset();
DX_RELEASE(m_flushQuery, 0);
- m_gpuTimer.preReset();
+ if (m_timerQuerySupport)
+ {
+ m_gpuTimer.preReset();
+ }
for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii)
{
@@ -1279,7 +1385,10 @@ namespace bgfx { namespace d3d9
DX_CHECK(m_device->GetDepthStencilSurface(&m_backBufferDepthStencil) );
DX_CHECK(m_device->CreateQuery(D3DQUERYTYPE_EVENT, &m_flushQuery) );
- m_gpuTimer.postReset();
+ if (m_timerQuerySupport)
+ {
+ m_gpuTimer.postReset();
+ }
capturePostReset();
@@ -1308,18 +1417,26 @@ namespace bgfx { namespace d3d9
{
for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
{
- m_samplerFlags[stage][0] = UINT32_MAX;
- m_samplerFlags[stage][1] = UINT32_MAX;
+ m_samplerFlags[stage] = UINT32_MAX;
}
}
- void setSamplerState(uint8_t _stage, uint32_t _flags, bool _vertex = false)
+ static void setSamplerState(IDirect3DDevice9* _device, DWORD _stage, D3DSAMPLERSTATETYPE _type, DWORD _value)
+ {
+ DX_CHECK(_device->SetSamplerState(_stage, _type, _value) );
+ if (4 > _stage)
+ {
+ DX_CHECK(_device->SetSamplerState(D3DVERTEXTEXTURESAMPLER0 + _stage, _type, _value) );
+ }
+ }
+
+ void setSamplerState(uint8_t _stage, uint32_t _flags, const float _rgba[4])
{
const uint32_t flags = _flags&( (~BGFX_TEXTURE_RESERVED_MASK) | BGFX_TEXTURE_SAMPLER_BITS_MASK | BGFX_TEXTURE_SRGB);
BX_CHECK(_stage < BX_COUNTOF(m_samplerFlags), "");
- if (m_samplerFlags[_stage][_vertex] != flags)
+ if (m_samplerFlags[_stage] != flags)
{
- m_samplerFlags[_stage][_vertex] = flags;
+ m_samplerFlags[_stage] = flags;
IDirect3DDevice9* device = m_device;
D3DTEXTUREADDRESS tau = s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
D3DTEXTUREADDRESS tav = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
@@ -1328,16 +1445,26 @@ namespace bgfx { namespace d3d9
D3DTEXTUREFILTERTYPE magFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
D3DTEXTUREFILTERTYPE mipFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
- DWORD stage = (_vertex ? D3DVERTEXTEXTURESAMPLER0 : 0) + _stage;
-
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSU, tau) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSV, tav) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_ADDRESSW, taw) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MINFILTER, minFilter) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAGFILTER, magFilter) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MIPFILTER, mipFilter) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy) );
- DX_CHECK(device->SetSamplerState(stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB)) );
+ setSamplerState(device, _stage, D3DSAMP_ADDRESSU, tau);
+ setSamplerState(device, _stage, D3DSAMP_ADDRESSV, tav);
+ setSamplerState(device, _stage, D3DSAMP_ADDRESSW, taw);
+ setSamplerState(device, _stage, D3DSAMP_MINFILTER, minFilter);
+ setSamplerState(device, _stage, D3DSAMP_MAGFILTER, magFilter);
+ setSamplerState(device, _stage, D3DSAMP_MIPFILTER, mipFilter);
+ setSamplerState(device, _stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy);
+ setSamplerState(device, _stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB) );
+ if (NULL != _rgba)
+ {
+ if (needBorderColor(_flags) )
+ {
+ DWORD bc = D3DCOLOR_COLORVALUE(_rgba[0], _rgba[1], _rgba[2], _rgba[3]);
+ setSamplerState(device
+ , _stage
+ , D3DSAMP_BORDERCOLOR
+ , bc
+ );
+ }
+ }
}
}
@@ -1424,15 +1551,15 @@ namespace bgfx { namespace d3d9
}
}
- void commit(ConstantBuffer& _constantBuffer)
+ void commit(UniformBuffer& _uniformBuffer)
{
- _constantBuffer.reset();
+ _uniformBuffer.reset();
IDirect3DDevice9* device = m_device;
for (;;)
{
- uint32_t opcode = _constantBuffer.read();
+ uint32_t opcode = _uniformBuffer.read();
if (UniformType::End == opcode)
{
@@ -1443,17 +1570,17 @@ namespace bgfx { namespace d3d9
uint16_t loc;
uint16_t num;
uint16_t copy;
- ConstantBuffer::decodeOpcode(opcode, type, loc, num, copy);
+ UniformBuffer::decodeOpcode(opcode, type, loc, num, copy);
const char* data;
if (copy)
{
- data = _constantBuffer.read(g_uniformTypeSize[type]*num);
+ data = _uniformBuffer.read(g_uniformTypeSize[type]*num);
}
else
{
UniformHandle handle;
- memcpy(&handle, _constantBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
+ memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
data = (const char*)m_uniforms[handle.idx];
}
@@ -1474,7 +1601,7 @@ namespace bgfx { namespace d3d9
switch ( (int32_t)type)
{
- case UniformType::Uniform3x3fv:
+ case UniformType::Mat3:
{
float* value = (float*)data;
for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3, value += 9)
@@ -1497,7 +1624,7 @@ namespace bgfx { namespace d3d9
}
break;
- case UniformType::Uniform3x3fv|BGFX_UNIFORM_FRAGMENTBIT:
+ case UniformType::Mat3|BGFX_UNIFORM_FRAGMENTBIT:
{
float* value = (float*)data;
for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3, value += 9)
@@ -1520,23 +1647,17 @@ namespace bgfx { namespace d3d9
}
break;
- CASE_IMPLEMENT_UNIFORM(Uniform1i, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1f, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform1iv, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform2fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform3fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform4fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform4x4fv, F, float);
+ CASE_IMPLEMENT_UNIFORM(Int1, I, int);
+ CASE_IMPLEMENT_UNIFORM(Vec4, F, float);
+ CASE_IMPLEMENT_UNIFORM(Mat4, F, float);
case UniformType::End:
break;
default:
- BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _constantBuffer.getPos(), opcode, type, loc, num, copy);
+ BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy);
break;
}
-
#undef CASE_IMPLEMENT_UNIFORM
}
}
@@ -1562,7 +1683,7 @@ namespace bgfx { namespace d3d9
{
if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE-1, _clear.m_index[0]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[0]);
const float* rgba = _palette[index];
const float rr = rgba[0];
const float gg = rgba[1];
@@ -1701,7 +1822,7 @@ namespace bgfx { namespace d3d9
float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
for (uint32_t ii = 0; ii < numMrt; ++ii)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE-1, _clear.m_index[ii]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]);
memcpy(mrtClear[ii], _palette[index], 16);
}
@@ -1772,7 +1893,8 @@ namespace bgfx { namespace d3d9
bool m_initialized;
bool m_amd;
bool m_nvidia;
- bool m_instancing;
+ bool m_instancingSupport;
+ bool m_timerQuerySupport;
D3DFORMAT m_fmtDepth;
@@ -1786,7 +1908,7 @@ namespace bgfx { namespace d3d9
UniformRegistry m_uniformReg;
void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
- uint32_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS][2];
+ uint32_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
TextureD3D9* m_updateTexture;
uint8_t* m_updateTextureBits;
@@ -1805,7 +1927,11 @@ namespace bgfx { namespace d3d9
RendererContextI* rendererCreate()
{
s_renderD3D9 = BX_NEW(g_allocator, RendererContextD3D9);
- s_renderD3D9->init();
+ if (!s_renderD3D9->init() )
+ {
+ BX_DELETE(g_allocator, s_renderD3D9);
+ s_renderD3D9 = NULL;
+ }
return s_renderD3D9;
}
@@ -1952,25 +2078,31 @@ namespace bgfx { namespace d3d9
static const uint8_t s_attribType[][4][2] =
{
- {
+ { // Uint8
{ D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N },
{ D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N },
{ D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N },
{ D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N },
},
- {
+ { // Uint10
+ { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N },
+ { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N },
+ { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N },
+ { D3DDECLTYPE_UDEC3, D3DDECLTYPE_DEC3N },
+ },
+ { // Int16
{ D3DDECLTYPE_SHORT2, D3DDECLTYPE_SHORT2N },
{ D3DDECLTYPE_SHORT2, D3DDECLTYPE_SHORT2N },
{ D3DDECLTYPE_SHORT4, D3DDECLTYPE_SHORT4N },
{ D3DDECLTYPE_SHORT4, D3DDECLTYPE_SHORT4N },
},
- {
+ { // Half
{ D3DDECLTYPE_FLOAT16_2, D3DDECLTYPE_FLOAT16_2 },
{ D3DDECLTYPE_FLOAT16_2, D3DDECLTYPE_FLOAT16_2 },
{ D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_FLOAT16_4 },
{ D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_FLOAT16_4 },
},
- {
+ { // Float
{ D3DDECLTYPE_FLOAT1, D3DDECLTYPE_FLOAT1 },
{ D3DDECLTYPE_FLOAT2, D3DDECLTYPE_FLOAT2 },
{ D3DDECLTYPE_FLOAT3, D3DDECLTYPE_FLOAT3 },
@@ -1985,7 +2117,7 @@ namespace bgfx { namespace d3d9
for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
{
- if (0xff != _decl.m_attributes[attr])
+ if (UINT16_MAX != _decl.m_attributes[attr])
{
uint8_t num;
AttribType::Enum type;
@@ -2099,26 +2231,31 @@ namespace bgfx { namespace d3d9
m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit);
m_numPredefined++;
}
- else
+ else if (0 == (BGFX_UNIFORM_SAMPLERBIT & type) )
{
const UniformInfo* info = s_renderD3D9->m_uniformReg.find(name);
BX_CHECK(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
+
if (NULL != info)
{
if (NULL == m_constantBuffer)
{
- m_constantBuffer = ConstantBuffer::create(1024);
+ m_constantBuffer = UniformBuffer::create(1024);
}
kind = "user";
m_constantBuffer->writeUniformHandle( (UniformType::Enum)(type|fragmentBit), regIndex, info->m_handle, regCount);
}
}
+ else
+ {
+ kind = "sampler";
+ }
- BX_TRACE("\t%s: %s, type %2d, num %2d, r.index %3d, r.count %2d"
+ BX_TRACE("\t%s: %s (%s), num %2d, r.index %3d, r.count %2d"
, kind
, name
- , type
+ , getUniformTypeName(UniformType::Enum(type&~BGFX_UNIFORM_MASK) )
, num
, regIndex
, regCount
@@ -2423,8 +2560,6 @@ namespace bgfx { namespace d3d9
void TextureD3D9::create(const Memory* _mem, uint32_t _flags, uint8_t _skip)
{
- m_flags = _flags;
-
ImageContainer imageContainer;
if (imageParse(imageContainer, _mem->data, _mem->size) )
@@ -2436,6 +2571,7 @@ namespace bgfx { namespace d3d9
const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod);
const uint32_t textureHeight = bx::uint32_max(blockInfo.blockHeight, imageContainer.m_height>>startLod);
+ m_flags = _flags;
m_requestedFormat = imageContainer.m_format;
m_textureFormat = imageContainer.m_format;
@@ -2568,7 +2704,7 @@ namespace bgfx { namespace d3d9
{
uint32_t slicePitch;
s_renderD3D9->m_updateTextureSide = _side;
- s_renderD3D9->m_updateTextureMip = _mip;
+ s_renderD3D9->m_updateTextureMip = _mip;
s_renderD3D9->m_updateTextureBits = lock(_side, _mip, s_renderD3D9->m_updateTexturePitch, slicePitch);
}
@@ -2619,13 +2755,21 @@ namespace bgfx { namespace d3d9
unlock(s_renderD3D9->m_updateTextureSide, s_renderD3D9->m_updateTextureMip);
}
- void TextureD3D9::commit(uint8_t _stage, uint32_t _flags)
+ void TextureD3D9::commit(uint8_t _stage, uint32_t _flags, const float _palette[][4])
{
- s_renderD3D9->setSamplerState(_stage, 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? _flags : m_flags);
- DX_CHECK(s_renderD3D9->m_device->SetTexture(_stage, m_ptr) );
+ uint32_t flags = 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags)
+ ? _flags
+ : m_flags
+ ;
+ uint32_t index = (flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
+ s_renderD3D9->setSamplerState(_stage, flags, _palette[index]);
-// s_renderD3D9->setSamplerState(_stage, 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? _flags : m_flags, true);
-// DX_CHECK(s_renderD3D9->m_device->SetTexture(D3DVERTEXTEXTURESAMPLER0 + _stage, m_ptr) );
+ IDirect3DDevice9* device = s_renderD3D9->m_device;
+ DX_CHECK(device->SetTexture(_stage, m_ptr) );
+ if (4 > _stage)
+ {
+ DX_CHECK(device->SetTexture(D3DVERTEXTEXTURESAMPLER0 + _stage, m_ptr) );
+ }
}
void TextureD3D9::resolve() const
@@ -2727,10 +2871,13 @@ namespace bgfx { namespace d3d9
m_hwnd = (HWND)_nwh;
+ m_width = bx::uint32_max(_width, 16);
+ m_height = bx::uint32_max(_height, 16);
+
D3DPRESENT_PARAMETERS params;
memcpy(&params, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) );
- params.BackBufferWidth = bx::uint32_max(_width, 16);
- params.BackBufferHeight = bx::uint32_max(_height, 16);
+ params.BackBufferWidth = m_width;
+ params.BackBufferHeight = m_height;
DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(&params, &m_swapChain) );
DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_color[0]) );
@@ -2828,7 +2975,8 @@ namespace bgfx { namespace d3d9
{
if (NULL != m_hwnd)
{
- DX_RELEASE(m_color[0], 0);
+ DX_RELEASE(m_color[0], 0);
+ DX_RELEASE(m_depthStencil, 0);
DX_RELEASE(m_swapChain, 0);
}
else
@@ -2857,8 +3005,22 @@ namespace bgfx { namespace d3d9
{
if (NULL != m_hwnd)
{
- DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(&s_renderD3D9->m_params, &m_swapChain) );
+ D3DPRESENT_PARAMETERS params;
+ memcpy(&params, &s_renderD3D9->m_params, sizeof(D3DPRESENT_PARAMETERS) );
+ params.BackBufferWidth = m_width;
+ params.BackBufferHeight = m_height;
+
+ DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(&params, &m_swapChain) );
DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_color[0]) );
+ DX_CHECK(s_renderD3D9->m_device->CreateDepthStencilSurface(params.BackBufferWidth
+ , params.BackBufferHeight
+ , params.AutoDepthStencilFormat
+ , params.MultiSampleType
+ , params.MultiSampleQuality
+ , FALSE
+ , &m_depthStencil
+ , NULL
+ ) );
}
else
{
@@ -2961,6 +3123,7 @@ namespace bgfx { namespace d3d9
void TimerQueryD3D9::end()
{
Frame& frame = m_frame[m_control.m_current];
+ frame.m_disjoint->Issue(D3DISSUE_END);
frame.m_end->Issue(D3DISSUE_END);
frame.m_freq->Issue(D3DISSUE_END);
m_control.commit(1);
@@ -2978,14 +3141,14 @@ namespace bgfx { namespace d3d9
{
m_control.consume(1);
- uint64_t start;
- DX_CHECK(frame.m_start->GetData(&start, sizeof(start), 0) );
+ uint64_t timeStart;
+ DX_CHECK(frame.m_start->GetData(&timeStart, sizeof(timeStart), 0) );
- uint64_t end;
- DX_CHECK(frame.m_end->GetData(&end, sizeof(end), 0) );
+ uint64_t timeEnd;
+ DX_CHECK(frame.m_end->GetData(&timeEnd, sizeof(timeEnd), 0) );
m_frequency = freq;
- m_elapsed = end - start;
+ m_elapsed = timeEnd - timeStart;
return true;
}
@@ -3006,8 +3169,7 @@ namespace bgfx { namespace d3d9
int64_t captureElapsed = 0;
device->BeginScene();
-
- if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ if (m_timerQuerySupport)
{
m_gpuTimer.begin();
}
@@ -3036,7 +3198,7 @@ namespace bgfx { namespace d3d9
DX_CHECK(device->SetRenderState(D3DRS_FILLMODE, _render->m_debug&BGFX_DEBUG_WIREFRAME ? D3DFILL_WIREFRAME : D3DFILL_SOLID) );
uint16_t programIdx = invalidHandle;
SortKey key;
- uint8_t view = 0xff;
+ uint16_t view = UINT16_MAX;
FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
uint32_t blendFactor = 0;
@@ -3121,7 +3283,7 @@ namespace bgfx { namespace d3d9
if (BGFX_CLEAR_NONE != (clear.m_flags & BGFX_CLEAR_MASK) )
{
- clearQuad(_clearQuad, viewState.m_rect, clear, _render->m_clearColor);
+ clearQuad(_clearQuad, viewState.m_rect, clear, _render->m_colorPalette);
prim = s_primInfo[BX_COUNTOF(s_primName)]; // Force primitive type update after clear quad.
}
@@ -3335,7 +3497,7 @@ namespace bgfx { namespace d3d9
bool programChanged = false;
bool constantsChanged = draw.m_constBegin < draw.m_constEnd;
- rendererUpdateUniforms(this, _render->m_constantBuffer, draw.m_constBegin, draw.m_constEnd);
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, draw.m_constBegin, draw.m_constEnd);
if (key.m_program != programIdx)
{
@@ -3363,13 +3525,13 @@ namespace bgfx { namespace d3d9
if (constantsChanged)
{
- ConstantBuffer* vcb = program.m_vsh->m_constantBuffer;
+ UniformBuffer* vcb = program.m_vsh->m_constantBuffer;
if (NULL != vcb)
{
commit(*vcb);
}
- ConstantBuffer* fcb = program.m_fsh->m_constantBuffer;
+ UniformBuffer* fcb = program.m_fsh->m_constantBuffer;
if (NULL != fcb)
{
commit(*fcb);
@@ -3382,15 +3544,15 @@ namespace bgfx { namespace d3d9
{
for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
{
- const Binding& sampler = draw.m_bind[stage];
+ const Binding& bind = draw.m_bind[stage];
Binding& current = currentState.m_bind[stage];
- if (current.m_idx != sampler.m_idx
- || current.m_un.m_draw.m_flags != sampler.m_un.m_draw.m_flags
+ if (current.m_idx != bind.m_idx
+ || current.m_un.m_draw.m_flags != bind.m_un.m_draw.m_flags
|| programChanged)
{
- if (invalidHandle != sampler.m_idx)
+ if (invalidHandle != bind.m_idx)
{
- m_textures[sampler.m_idx].commit(stage, sampler.m_un.m_draw.m_flags);
+ m_textures[bind.m_idx].commit(stage, bind.m_un.m_draw.m_flags, _render->m_colorPalette);
}
else
{
@@ -3398,7 +3560,7 @@ namespace bgfx { namespace d3d9
}
}
- current = sampler;
+ current = bind;
}
}
@@ -3423,7 +3585,7 @@ namespace bgfx { namespace d3d9
DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, vertexDecl.m_decl.m_stride) );
if (isValid(draw.m_instanceDataBuffer)
- && m_instancing)
+ && m_instancingSupport)
{
const VertexBufferD3D9& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx];
DX_CHECK(device->SetStreamSourceFreq(0, D3DSTREAMSOURCE_INDEXEDDATA|draw.m_numInstances) );
@@ -3475,10 +3637,10 @@ namespace bgfx { namespace d3d9
numVertices = vb.m_size/vertexDecl.m_decl.m_stride;
}
- uint32_t numIndices = 0;
+ uint32_t numIndices = 0;
uint32_t numPrimsSubmitted = 0;
- uint32_t numInstances = 0;
- uint32_t numPrimsRendered = 0;
+ uint32_t numInstances = 0;
+ uint32_t numPrimsRendered = 0;
if (isValid(draw.m_indexBuffer) )
{
@@ -3501,10 +3663,10 @@ namespace bgfx { namespace d3d9
}
else if (prim.m_min <= draw.m_numIndices)
{
- numIndices = draw.m_numIndices;
+ numIndices = draw.m_numIndices;
numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub;
- numInstances = draw.m_numInstances;
- numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+ numInstances = draw.m_numInstances;
+ numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
DX_CHECK(device->DrawIndexedPrimitive(prim.m_type
, draw.m_startVertex
@@ -3518,8 +3680,8 @@ namespace bgfx { namespace d3d9
else
{
numPrimsSubmitted = numVertices/prim.m_div - prim.m_sub;
- numInstances = draw.m_numInstances;
- numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+ numInstances = draw.m_numInstances;
+ numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
DX_CHECK(device->DrawPrimitive(prim.m_type
, draw.m_startVertex
@@ -3562,14 +3724,12 @@ namespace bgfx { namespace d3d9
min = min > frameTime ? frameTime : min;
max = max < frameTime ? frameTime : max;
- if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
- {
- PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
-
- static uint32_t maxGpuLatency = 0;
- static double maxGpuElapsed = 0.0f;
- double elapsedGpuMs = 0.0;
+ static uint32_t maxGpuLatency = 0;
+ static double maxGpuElapsed = 0.0f;
+ double elapsedGpuMs = 0.0;
+ if (m_timerQuerySupport)
+ {
m_gpuTimer.end();
while (m_gpuTimer.get() )
@@ -3579,6 +3739,19 @@ namespace bgfx { namespace d3d9
maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
+ }
+
+ const int64_t timerFreq = bx::getHPFrequency();
+
+ Stats& perfStats = _render->m_perfStats;
+ perfStats.cpuTime = frameTime;
+ perfStats.cpuTimerFreq = timerFreq;
+ perfStats.gpuTime = m_gpuTimer.m_elapsed;
+ perfStats.gpuTimerFreq = m_gpuTimer.m_frequency;
+
+ if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ {
+ PIX_BEGINEVENT(D3DCOLOR_RGBA(0x40, 0x40, 0x40, 0xff), L"debugstats");
TextVideoMem& tvm = m_textVideoMem;
@@ -3586,9 +3759,9 @@ namespace bgfx { namespace d3d9
if (now >= next)
{
- next = now + bx::getHPFrequency();
+ next = now + timerFreq;
- double freq = double(bx::getHPFrequency() );
+ double freq = double(timerFreq);
double toMs = 1000.0/freq;
tvm.clear();
@@ -3598,7 +3771,11 @@ namespace bgfx { namespace d3d9
);
const D3DADAPTER_IDENTIFIER9& identifier = m_identifier;
- tvm.printf(0, pos++, 0x0f, " Device: %s (%s)", identifier.Description, identifier.Driver);
+ tvm.printf(0, pos++, 0x8f, " Device: %s (%s)", identifier.Description, identifier.Driver);
+
+ char processMemoryUsed[16];
+ bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() );
+ tvm.printf(0, pos++, 0x8f, " Memory: %s (process) ", processMemoryUsed);
pos = 10;
tvm.printf(10, pos++, 0x8e, " Frame: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS "
@@ -3617,7 +3794,7 @@ namespace bgfx { namespace d3d9
);
double elapsedCpuMs = double(elapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms] (latency %d)"
+ tvm.printf(10, pos++, 0x8e, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] %c GPU %7.4f [ms] (latency %d)"
, _render->m_num
, statsKeyType[0]
, statsKeyType[1]
@@ -3639,18 +3816,19 @@ namespace bgfx { namespace d3d9
);
}
- tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices);
- tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset);
- tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset);
+ tvm.printf(10, pos++, 0x8e, " Indices: %7d ", statsNumIndices);
+ tvm.printf(10, pos++, 0x8e, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax);
+ tvm.printf(10, pos++, 0x8e, " DVB size: %7d ", _render->m_vboffset);
+ tvm.printf(10, pos++, 0x8e, " DIB size: %7d ", _render->m_iboffset);
double captureMs = double(captureElapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Capture: %3.4f [ms]", captureMs);
+ tvm.printf(10, pos++, 0x8e, " Capture: %7.4f [ms]", captureMs);
uint8_t attr[2] = { 0x89, 0x8a };
uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender;
- tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %3.4f [ms]", _render->m_waitSubmit*toMs);
- tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %3.4f [ms]", _render->m_waitRender*toMs);
+ tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %7.4f [ms]", _render->m_waitSubmit*toMs);
+ tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %7.4f [ms]", _render->m_waitRender*toMs);
min = frameTime;
max = frameTime;
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index 27acc7abc7d..58676cec900 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -9,6 +9,7 @@
#define BGFX_CONFIG_RENDERER_DIRECT3D9EX (BX_PLATFORM_WINDOWS && 0)
#if BX_PLATFORM_WINDOWS
+# include <sal.h>
# if !BGFX_CONFIG_RENDERER_DIRECT3D9EX
//# define D3D_DISABLE_9EX
# endif // !BGFX_CONFIG_RENDERER_DIRECT3D9EX
@@ -244,7 +245,7 @@ namespace bgfx { namespace d3d9
{
if (NULL != m_constantBuffer)
{
- ConstantBuffer::destroy(m_constantBuffer);
+ UniformBuffer::destroy(m_constantBuffer);
m_constantBuffer = NULL;
}
m_numPredefined = 0;
@@ -262,7 +263,7 @@ namespace bgfx { namespace d3d9
IDirect3DVertexShader9* m_vertexShader;
IDirect3DPixelShader9* m_pixelShader;
};
- ConstantBuffer* m_constantBuffer;
+ UniformBuffer* m_constantBuffer;
PredefinedUniform m_predefined[PredefinedUniform::Count];
uint8_t m_numPredefined;
uint8_t m_type;
@@ -333,7 +334,7 @@ namespace bgfx { namespace d3d9
void updateBegin(uint8_t _side, uint8_t _mip);
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
void updateEnd();
- void commit(uint8_t _stage, uint32_t _flags = BGFX_SAMPLER_DEFAULT_FLAGS);
+ void commit(uint8_t _stage, uint32_t _flags, const float _palette[][4]);
void resolve() const;
void preReset();
@@ -381,6 +382,8 @@ namespace bgfx { namespace d3d9
IDirect3DSurface9* m_depthStencil;
IDirect3DSwapChain9* m_swapChain;
HWND m_hwnd;
+ uint32_t m_width;
+ uint32_t m_height;
TextureHandle m_colorHandle[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS-1];
TextureHandle m_depthHandle;
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index 4545f55756a..557614ef960 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -81,10 +81,11 @@ namespace bgfx { namespace gl
static const GLenum s_attribType[] =
{
- GL_UNSIGNED_BYTE,
- GL_SHORT,
- GL_HALF_FLOAT,
- GL_FLOAT,
+ GL_UNSIGNED_BYTE, // Uint8
+ GL_UNSIGNED_INT_10_10_10_2, // Uint10
+ GL_SHORT, // Int16
+ GL_HALF_FLOAT, // Half
+ GL_FLOAT, // Float
};
BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -154,11 +155,12 @@ namespace bgfx { namespace gl
GL_BACK,
};
- static const GLenum s_textureAddress[] =
+ static GLenum s_textureAddress[] =
{
GL_REPEAT,
GL_MIRRORED_REPEAT,
GL_CLAMP_TO_EDGE,
+ GL_CLAMP_TO_BORDER,
};
static const GLenum s_textureFilterMag[] =
@@ -205,21 +207,44 @@ namespace bgfx { namespace gl
{ GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
{ GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // Unknown
{ GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // R1
+ { GL_ALPHA, GL_ZERO, GL_ALPHA, GL_UNSIGNED_BYTE, false }, // A8
{ GL_R8, GL_ZERO, GL_RED, GL_UNSIGNED_BYTE, false }, // R8
+ { GL_R8I, GL_ZERO, GL_RED, GL_BYTE, false }, // R8S
+ { GL_R8UI, GL_ZERO, GL_RED, GL_UNSIGNED_BYTE, false }, // R8S
+ { GL_R8_SNORM, GL_ZERO, GL_RED, GL_BYTE, false }, // R8S
{ GL_R16, GL_ZERO, GL_RED, GL_UNSIGNED_SHORT, false }, // R16
+ { GL_R16I, GL_ZERO, GL_RED, GL_SHORT, false }, // R16I
+ { GL_R16UI, GL_ZERO, GL_RED, GL_UNSIGNED_SHORT, false }, // R16U
{ GL_R16F, GL_ZERO, GL_RED, GL_HALF_FLOAT, false }, // R16F
- { GL_R32UI, GL_ZERO, GL_RED, GL_UNSIGNED_INT, false }, // R32
+ { GL_R16_SNORM, GL_ZERO, GL_RED, GL_SHORT, false }, // R16S
+ { GL_R32I, GL_ZERO, GL_RED, GL_INT, false }, // R32I
+ { GL_R32UI, GL_ZERO, GL_RED, GL_UNSIGNED_INT, false }, // R32U
{ GL_R32F, GL_ZERO, GL_RED, GL_FLOAT, false }, // R32F
{ GL_RG8, GL_ZERO, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8
+ { GL_RG8I, GL_ZERO, GL_RG, GL_BYTE, false }, // RG8I
+ { GL_RG8UI, GL_ZERO, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8U
+ { GL_RG8_SNORM, GL_ZERO, GL_RG, GL_BYTE, false }, // RG8S
{ GL_RG16, GL_ZERO, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16
+ { GL_RG16I, GL_ZERO, GL_RG, GL_SHORT, false }, // RG16
+ { GL_RG16UI, GL_ZERO, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16
{ GL_RG16F, GL_ZERO, GL_RG, GL_FLOAT, false }, // RG16F
- { GL_RG32UI, GL_ZERO, GL_RG, GL_UNSIGNED_INT, false }, // RG32
+ { GL_RG16_SNORM, GL_ZERO, GL_RG, GL_SHORT, false }, // RG16S
+ { GL_RG32I, GL_ZERO, GL_RG, GL_INT, false }, // RG32I
+ { GL_RG32UI, GL_ZERO, GL_RG, GL_UNSIGNED_INT, false }, // RG32U
{ GL_RG32F, GL_ZERO, GL_RG, GL_FLOAT, false }, // RG32F
+ { GL_RGB9_E5, GL_ZERO, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, false }, // RGB9E5F
{ GL_RGBA8, GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_BYTE, false }, // BGRA8
{ GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8
- { GL_RGBA16, GL_ZERO, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA16
+ { GL_RGBA8I, GL_ZERO, GL_RGBA, GL_BYTE, false }, // RGBA8I
+ { GL_RGBA8UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8U
+ { GL_RGBA8_SNORM, GL_ZERO, GL_RGBA, GL_BYTE, false }, // RGBA8S
+ { GL_RGBA16, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16
+ { GL_RGBA16I, GL_ZERO, GL_RGBA, GL_SHORT, false }, // RGBA16I
+ { GL_RGBA16UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16U
{ GL_RGBA16F, GL_ZERO, GL_RGBA, GL_HALF_FLOAT, false }, // RGBA16F
- { GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32
+ { GL_RGBA16_SNORM, GL_ZERO, GL_RGBA, GL_SHORT, false }, // RGBA16S
+ { GL_RGBA32I, GL_ZERO, GL_RGBA, GL_INT, false }, // RGBA32I
+ { GL_RGBA32UI, GL_ZERO, GL_RGBA, GL_UNSIGNED_INT, false }, // RGBA32U
{ GL_RGBA32F, GL_ZERO, GL_RGBA, GL_FLOAT, false }, // RGBA32F
{ GL_RGB565, GL_ZERO, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
{ GL_RGBA4, GL_ZERO, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, false }, // RGBA4
@@ -261,21 +286,44 @@ namespace bgfx { namespace gl
GL_ZERO, // PTC24
GL_ZERO, // Unknown
GL_ZERO, // R1
+ GL_ALPHA, // A8
GL_R8, // R8
+ GL_R8I, // R8I
+ GL_R8UI, // R8U
+ GL_R8_SNORM, // R8S
GL_R16, // R16
+ GL_R16I, // R16I
+ GL_R16UI, // R16U
GL_R16F, // R16F
- GL_R32UI, // R32
+ GL_R16_SNORM, // R16S
+ GL_R32I, // R32I
+ GL_R32UI, // R32U
GL_R32F, // R32F
GL_RG8, // RG8
+ GL_RG8I, // RG8I
+ GL_RG8UI, // RG8U
+ GL_RG8_SNORM, // RG8S
GL_RG16, // RG16
+ GL_RG16I, // RG16I
+ GL_RG16UI, // RG16U
GL_RG16F, // RG16F
- GL_RG32UI, // RG32
+ GL_RG16_SNORM, // RG16S
+ GL_RG32I, // RG32I
+ GL_RG32UI, // RG32U
GL_RG32F, // RG32F
+ GL_RGB9_E5, // RGB9E5F
GL_RGBA8, // BGRA8
GL_RGBA8, // RGBA8
+ GL_RGBA8I, // RGBA8I
+ GL_RGBA8UI, // RGBA8UI
+ GL_RGBA8_SNORM, // RGBA8S
GL_RGBA16, // RGBA16
+ GL_RGBA16I, // RGBA16I
+ GL_RGBA16UI, // RGBA16U
GL_RGBA16F, // RGBA16F
- GL_RGBA32UI, // RGBA32
+ GL_RGBA16_SNORM, // RGBA16S
+ GL_RGBA32I, // RGBA32I
+ GL_RGBA32UI, // RGBA32U
GL_RGBA32F, // RGBA32F
GL_RGB565, // R5G6B5
GL_RGBA4, // RGBA4
@@ -315,21 +363,44 @@ namespace bgfx { namespace gl
GL_ZERO, // PTC24
GL_ZERO, // Unknown
GL_ZERO, // R1
+ GL_ALPHA, // A8
GL_R8, // R8
+ GL_R8I, // R8I
+ GL_R8UI, // R8UI
+ GL_R8_SNORM, // R8S
GL_R16, // R16
+ GL_R16I, // R16I
+ GL_R16UI, // R16U
GL_R16F, // R16F
- GL_R32UI, // R32
+ GL_R16_SNORM, // R16S
+ GL_R32I, // R32I
+ GL_R32UI, // R32U
GL_R32F, // R32F
GL_RG8, // RG8
+ GL_RG8I, // RG8I
+ GL_RG8UI, // RG8U
+ GL_RG8_SNORM, // RG8S
GL_RG16, // RG16
+ GL_RG16I, // RG16I
+ GL_RG16UI, // RG16U
GL_RG16F, // RG16F
- GL_RG32UI, // RG32
+ GL_RG16_SNORM, // RG16S
+ GL_RG32I, // RG32I
+ GL_RG32UI, // RG32U
GL_RG32F, // RG32F
+ GL_RGB9_E5, // RGB9E5F
GL_RGBA8, // BGRA8
GL_RGBA8, // RGBA8
+ GL_RGBA8I, // RGBA8I
+ GL_RGBA8UI, // RGBA8UI
+ GL_RGBA8_SNORM, // RGBA8S
GL_RGBA16, // RGBA16
+ GL_RGBA16I, // RGBA16I
+ GL_RGBA16UI, // RGBA16U
GL_RGBA16F, // RGBA16F
- GL_RGBA32UI, // RGBA32
+ GL_RGBA16_SNORM, // RGBA16S
+ GL_RGBA32I, // RGBA32I
+ GL_RGBA32UI, // RGBA32U
GL_RGBA32F, // RGBA32F
GL_RGB565, // R5G6B5
GL_RGBA4, // RGBA4
@@ -384,6 +455,8 @@ namespace bgfx { namespace gl
ARB_half_float_pixel,
ARB_half_float_vertex,
ARB_instanced_arrays,
+ ARB_internalformat_query,
+ ARB_internalformat_query2,
ARB_invalidate_subdata,
ARB_map_buffer_range,
ARB_multi_draw_indirect,
@@ -452,6 +525,8 @@ namespace bgfx { namespace gl
EXT_texture_filter_anisotropic,
EXT_texture_format_BGRA8888,
EXT_texture_rg,
+ EXT_texture_shared_exponent,
+ EXT_texture_snorm,
EXT_texture_sRGB,
EXT_texture_storage,
EXT_texture_swizzle,
@@ -479,6 +554,7 @@ namespace bgfx { namespace gl
MOZ_WEBGL_compressed_texture_s3tc,
MOZ_WEBGL_depth_texture,
+ NV_texture_border_clamp,
NV_draw_buffers,
NVX_gpu_memory_info,
@@ -578,6 +654,8 @@ namespace bgfx { namespace gl
{ "ARB_half_float_pixel", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "ARB_half_float_vertex", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "ARB_instanced_arrays", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
+ { "ARB_internalformat_query", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
+ { "ARB_internalformat_query2", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
{ "ARB_invalidate_subdata", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
{ "ARB_map_buffer_range", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "ARB_multi_draw_indirect", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
@@ -646,6 +724,8 @@ namespace bgfx { namespace gl
{ "EXT_texture_filter_anisotropic", false, true },
{ "EXT_texture_format_BGRA8888", false, true },
{ "EXT_texture_rg", false, true }, // GLES2 extension.
+ { "EXT_texture_shared_exponent", false, true },
+ { "EXT_texture_snorm", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "EXT_texture_sRGB", false, true },
{ "EXT_texture_storage", false, true },
{ "EXT_texture_swizzle", false, true },
@@ -673,6 +753,7 @@ namespace bgfx { namespace gl
{ "MOZ_WEBGL_compressed_texture_s3tc", false, true },
{ "MOZ_WEBGL_depth_texture", false, true },
+ { "NV_texture_border_clamp", false, true }, // GLES2 extension.
{ "NV_draw_buffers", false, true }, // GLES2 extension.
{ "NVX_gpu_memory_info", false, true },
@@ -958,7 +1039,7 @@ namespace bgfx { namespace gl
;
GLsizei size = (16*16*getBitsPerPixel(_format) )/8;
- void* data = alloca(size);
+ void* data = bx::alignPtr(alloca(size+16), 0, 16);
if (isCompressed(_format) )
{
@@ -1005,17 +1086,20 @@ namespace bgfx { namespace gl
GLuint id;
GL_CHECK(glGenTextures(1, &id) );
GL_CHECK(glBindTexture(GL_TEXTURE_2D, id) );
- GL_CHECK(glTexStorage2D(GL_TEXTURE_2D, 1, s_imageFormat[_format], 16, 16) );
-
- glBindImageTexture(0
- , id
- , 0
- , GL_FALSE
- , 0
- , GL_READ_WRITE
- , s_imageFormat[_format]
- );
+ glTexStorage2D(GL_TEXTURE_2D, 1, s_imageFormat[_format], 16, 16);
GLenum err = glGetError();
+ if (0 == err)
+ {
+ glBindImageTexture(0
+ , id
+ , 0
+ , GL_FALSE
+ , 0
+ , GL_READ_WRITE
+ , s_imageFormat[_format]
+ );
+ err = glGetError();
+ }
GL_CHECK(glDeleteTextures(1, &id) );
@@ -1051,17 +1135,17 @@ namespace bgfx { namespace gl
if (isDepth(_format) )
{
const ImageBlockInfo& info = getBlockInfo(_format);
- if (0 < info.stencilBits)
+ if (0 == info.depthBits)
{
- attachment = GL_DEPTH_STENCIL_ATTACHMENT;
+ attachment = GL_STENCIL_ATTACHMENT;
}
- else if (0 == info.depthBits)
+ else if (0 == info.stencilBits)
{
- attachment = GL_STENCIL_ATTACHMENT;
+ attachment = GL_DEPTH_ATTACHMENT;
}
else
{
- attachment = GL_DEPTH_ATTACHMENT;
+ attachment = GL_DEPTH_STENCIL_ATTACHMENT;
}
}
else
@@ -1114,6 +1198,7 @@ namespace bgfx { namespace gl
, m_vaoSupport(false)
, m_samplerObjectSupport(false)
, m_shadowSamplersSupport(false)
+ , m_borderColorSupport(BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
, m_programBinarySupport(false)
, m_textureSwizzleSupport(false)
, m_depthTextureSupport(false)
@@ -1144,9 +1229,9 @@ namespace bgfx { namespace gl
// Must be after context is initialized?!
m_ovr.init();
- m_vendor = getGLString(GL_VENDOR);
- m_renderer = getGLString(GL_RENDERER);
- m_version = getGLString(GL_VERSION);
+ m_vendor = getGLString(GL_VENDOR);
+ m_renderer = getGLString(GL_RENDERER);
+ m_version = getGLString(GL_VERSION);
m_glslVersion = getGLString(GL_SHADING_LANGUAGE_VERSION);
GLint numCmpFormats = 0;
@@ -1198,6 +1283,8 @@ namespace bgfx { namespace gl
GL_GET(GL_MAX_TEXTURE_SIZE, 64);
GL_GET(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 0);
GL_GET(GL_MAX_RENDERBUFFER_SIZE, 1);
+ GL_GET(GL_MAX_COLOR_ATTACHMENTS, 1);
+ GL_GET(GL_MAX_DRAW_BUFFERS, 1);
#undef GL_GET
BX_TRACE(" Vendor: %s", m_vendor);
@@ -1213,6 +1300,15 @@ namespace bgfx { namespace gl
^ (uint64_t(getGLStringHash(GL_VERSION ) )<<16)
;
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31)
+ && 0 == strcmp(m_vendor, "Imagination Technologies")
+ && NULL != strstr(m_version, "(SDK 3.5@3510720)") )
+ {
+ // Skip initializing extensions that are broken in emulator.
+ s_extension[Extension::ARB_program_interface_query ].m_initialize =
+ s_extension[Extension::ARB_shader_storage_buffer_object].m_initialize = false;
+ }
+
if (BX_ENABLED(BGFX_CONFIG_RENDERER_USE_EXTENSIONS) )
{
const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
@@ -1408,12 +1504,13 @@ namespace bgfx { namespace gl
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|| BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
{
- setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
- setTextureFormat(TextureFormat::RG16, GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT);
- setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
- setTextureFormat(TextureFormat::R32, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
- setTextureFormat(TextureFormat::RG32, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
- setTextureFormat(TextureFormat::RGBA32, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT);
+ setTextureFormat(TextureFormat::R16I, GL_R16I, GL_RED_INTEGER, GL_SHORT);
+ setTextureFormat(TextureFormat::R16U, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
+// setTextureFormat(TextureFormat::RG16, GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT);
+// setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
+ setTextureFormat(TextureFormat::R32U, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
+ setTextureFormat(TextureFormat::RG32U, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
+ setTextureFormat(TextureFormat::RGBA32U, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT);
}
if (s_extension[Extension::EXT_texture_format_BGRA8888 ].m_supported
@@ -1457,7 +1554,10 @@ namespace bgfx { namespace gl
s_textureFormat[TextureFormat::R8].m_fmt = GL_LUMINANCE;
}
- for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+ for (uint32_t ii = BX_ENABLED(BX_PLATFORM_IOS) ? TextureFormat::Unknown : 0 // skip test on iOS!
+ ; ii < TextureFormat::Count
+ ; ++ii
+ )
{
if (TextureFormat::Unknown != ii
&& TextureFormat::UnknownDepth != ii)
@@ -1504,6 +1604,34 @@ namespace bgfx { namespace gl
: BGFX_CAPS_FORMAT_TEXTURE_NONE
;
+ if (NULL != glGetInternalformativ)
+ {
+ GLint maxSamples;
+ glGetInternalformativ(GL_RENDERBUFFER
+ , s_textureFormat[ii].m_internalFmt
+ , GL_SAMPLES
+ , 1
+ , &maxSamples
+ );
+ GLenum err = glGetError();
+ supported |= 0 == err && maxSamples > 0
+ ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+
+ glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE
+ , s_textureFormat[ii].m_internalFmt
+ , GL_SAMPLES
+ , 1
+ , &maxSamples
+ );
+ err = glGetError();
+ supported |= 0 == err && maxSamples > 0
+ ? BGFX_CAPS_FORMAT_TEXTURE_MSAA
+ : BGFX_CAPS_FORMAT_TEXTURE_NONE
+ ;
+ }
+
g_caps.formats[ii] = supported;
}
@@ -1522,6 +1650,12 @@ namespace bgfx { namespace gl
? BGFX_CAPS_VERTEX_ATTRIB_HALF
: 0
;
+ g_caps.supported |= false
+ || s_extension[Extension::ARB_vertex_type_2_10_10_10_rev].m_supported
+ || s_extension[Extension::OES_vertex_type_10_10_10_2].m_supported
+ ? BGFX_CAPS_VERTEX_ATTRIB_UINT10
+ : 0
+ ;
g_caps.supported |= !!(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 30)
|| s_extension[Extension::EXT_frag_depth].m_supported
? BGFX_CAPS_FRAGMENT_DEPTH
@@ -1570,7 +1704,9 @@ namespace bgfx { namespace gl
|| s_extension[Extension::EXT_draw_buffers ].m_supported
|| s_extension[Extension::WEBGL_draw_buffers].m_supported)
{
- g_caps.maxFBAttachments = uint8_t(bx::uint32_min(glGet(GL_MAX_COLOR_ATTACHMENTS), BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
+ g_caps.maxFBAttachments = uint8_t(bx::uint32_min(glGet(GL_MAX_DRAW_BUFFERS)
+ , BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS)
+ );
}
m_vaoSupport = !!(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
@@ -1621,14 +1757,17 @@ namespace bgfx { namespace gl
|| s_extension[Extension::WEBKIT_WEBGL_depth_texture].m_supported
;
- m_timerQuerySupport = 0
+ m_timerQuerySupport = false
|| s_extension[Extension::ANGLE_timer_query ].m_supported
|| s_extension[Extension::ARB_timer_query ].m_supported
|| s_extension[Extension::EXT_disjoint_timer_query].m_supported
|| s_extension[Extension::EXT_timer_query ].m_supported
;
- m_timerQuerySupport &= NULL != glGetQueryObjectui64v;
+ m_timerQuerySupport &= true
+ && NULL != glGetQueryObjectiv
+ && NULL != glGetQueryObjectui64v
+ ;
g_caps.supported |= m_depthTextureSupport
? BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
@@ -1640,10 +1779,16 @@ namespace bgfx { namespace gl
: 0
;
- g_caps.supported |= GlContext::isSwapChainSupported()
- ? BGFX_CAPS_SWAP_CHAIN
- : 0
- ;
+ g_caps.supported |= m_glctx.getCaps();
+
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) )
+ {
+ m_borderColorSupport = s_extension[Extension::NV_texture_border_clamp].m_supported;
+ s_textureAddress[BGFX_TEXTURE_U_BORDER>>BGFX_TEXTURE_U_SHIFT] = s_extension[Extension::NV_texture_border_clamp].m_supported
+ ? GL_CLAMP_TO_BORDER
+ : GL_CLAMP_TO_EDGE
+ ;
+ }
if (s_extension[Extension::EXT_texture_filter_anisotropic].m_supported)
{
@@ -1753,7 +1898,7 @@ namespace bgfx { namespace gl
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
&& m_timerQuerySupport)
{
- m_queries.create();
+ m_gpuTimer.create();
}
// Init reserved part of view name.
@@ -1784,7 +1929,7 @@ namespace bgfx { namespace gl
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
&& m_timerQuerySupport)
{
- m_queries.destroy();
+ m_gpuTimer.destroy();
}
destroyMsaaFbo();
@@ -2150,9 +2295,15 @@ namespace bgfx { namespace gl
m_resolution = _resolution;
m_resolution.m_flags = flags;
+ if ( (flags & BGFX_RESET_HMD)
+ && m_ovr.isInitialized() )
+ {
+ flags &= ~BGFX_RESET_MSAA_MASK;
+ }
+
setRenderContextSize(m_resolution.m_width
, m_resolution.m_height
- , m_resolution.m_flags
+ , flags
);
updateCapture();
@@ -2368,21 +2519,53 @@ namespace bgfx { namespace gl
}
}
- void setSamplerState(uint32_t _stage, uint32_t _numMips, uint32_t _flags)
+ void setSamplerState(uint32_t _stage, uint32_t _numMips, uint32_t _flags, const float _rgba[4])
{
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|| BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
{
if (0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) )
{
+ const uint32_t index = (_flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
+
_flags &= ~BGFX_TEXTURE_RESERVED_MASK;
_flags &= BGFX_TEXTURE_SAMPLER_BITS_MASK;
_flags |= _numMips<<BGFX_TEXTURE_RESERVED_SHIFT;
- GLuint sampler = m_samplerStateCache.find(_flags);
+
+ GLuint sampler;
+
+ bool hasBorderColor = false;
+ bx::HashMurmur2A murmur;
+ uint32_t hash;
+
+ murmur.begin();
+ murmur.add(_flags);
+ if (!needBorderColor(_flags) )
+ {
+ murmur.add(-1);
+ hash = murmur.end();
+
+ sampler = m_samplerStateCache.find(hash);
+ }
+ else
+ {
+ murmur.add(index);
+ hash = murmur.end();
+
+ if (NULL != _rgba)
+ {
+ hasBorderColor = true;
+ sampler = UINT32_MAX;
+ }
+ else
+ {
+ sampler = m_samplerStateCache.find(hash);
+ }
+ }
if (UINT32_MAX == sampler)
{
- sampler = m_samplerStateCache.add(_flags);
+ sampler = m_samplerStateCache.add(hash);
GL_CHECK(glSamplerParameteri(sampler
, GL_TEXTURE_WRAP_S
@@ -2403,6 +2586,15 @@ namespace bgfx { namespace gl
GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, magFilter) );
GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) );
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
+ || m_borderColorSupport)
+ {
+ if (hasBorderColor)
+ {
+ GL_CHECK(glSamplerParameterfv(sampler, GL_TEXTURE_BORDER_COLOR, _rgba) );
+ }
+ }
+
if (0 != (_flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) )
&& 0.0f < m_maxAnisotropy)
{
@@ -2461,7 +2653,7 @@ namespace bgfx { namespace gl
bx::write(&writer, magic);
TextureCreate tc;
- tc.m_flags = BGFX_TEXTURE_RT;
+ tc.m_flags = BGFX_TEXTURE_RT|( ((m_resolution.m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);;
tc.m_width = m_ovr.m_rtSize.w;
tc.m_height = m_ovr.m_rtSize.h;
tc.m_sides = 0;
@@ -2615,13 +2807,13 @@ namespace bgfx { namespace gl
}
}
- void commit(ConstantBuffer& _constantBuffer)
+ void commit(UniformBuffer& _uniformBuffer)
{
- _constantBuffer.reset();
+ _uniformBuffer.reset();
for (;;)
{
- uint32_t opcode = _constantBuffer.read();
+ uint32_t opcode = _uniformBuffer.read();
if (UniformType::End == opcode)
{
@@ -2632,21 +2824,21 @@ namespace bgfx { namespace gl
uint16_t ignore;
uint16_t num;
uint16_t copy;
- ConstantBuffer::decodeOpcode(opcode, type, ignore, num, copy);
+ UniformBuffer::decodeOpcode(opcode, type, ignore, num, copy);
const char* data;
if (copy)
{
- data = _constantBuffer.read(g_uniformTypeSize[type]*num);
+ data = _uniformBuffer.read(g_uniformTypeSize[type]*num);
}
else
{
UniformHandle handle;
- memcpy(&handle, _constantBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
+ memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
data = (const char*)m_uniforms[handle.idx];
}
- uint32_t loc = _constantBuffer.read();
+ uint32_t loc = _uniformBuffer.read();
#define CASE_IMPLEMENT_UNIFORM(_uniform, _glsuffix, _dxsuffix, _type) \
case UniformType::_uniform: \
@@ -2666,29 +2858,24 @@ namespace bgfx { namespace gl
switch (type)
{
-// case ConstantType::Uniform1iv:
+// case ConstantType::Int1:
// {
// int* value = (int*)data;
-// BX_TRACE("Uniform1iv sampler %d, loc %d (num %d, copy %d)", *value, loc, num, copy);
+// BX_TRACE("Int1 sampler %d, loc %d (num %d, copy %d)", *value, loc, num, copy);
// GL_CHECK(glUniform1iv(loc, num, value) );
// }
// break;
- CASE_IMPLEMENT_UNIFORM(Uniform1i, 1iv, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1f, 1fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform1iv, 1iv, I, int);
- CASE_IMPLEMENT_UNIFORM(Uniform1fv, 1fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform2fv, 2fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform3fv, 3fv, F, float);
- CASE_IMPLEMENT_UNIFORM(Uniform4fv, 4fv, F, float);
- CASE_IMPLEMENT_UNIFORM_T(Uniform3x3fv, Matrix3fv, F, float);
- CASE_IMPLEMENT_UNIFORM_T(Uniform4x4fv, Matrix4fv, F, float);
+ CASE_IMPLEMENT_UNIFORM(Int1, 1iv, I, int);
+ CASE_IMPLEMENT_UNIFORM(Vec4, 4fv, F, float);
+ CASE_IMPLEMENT_UNIFORM_T(Mat3, Matrix3fv, F, float);
+ CASE_IMPLEMENT_UNIFORM_T(Mat4, Matrix4fv, F, float);
case UniformType::End:
break;
default:
- BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _constantBuffer.getPos(), opcode, type, loc, num, copy);
+ BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy);
break;
}
@@ -2715,7 +2902,7 @@ namespace bgfx { namespace gl
{
if (BGFX_CLEAR_COLOR_USE_PALETTE & _clear.m_flags)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE-1, _clear.m_index[0]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[0]);
const float* rgba = _palette[index];
const float rr = rgba[0];
const float gg = rgba[1];
@@ -2808,7 +2995,7 @@ namespace bgfx { namespace gl
Vertex* vertex = (Vertex*)_clearQuad.m_vb->data;
BX_CHECK(vertexDecl.m_stride == sizeof(Vertex), "Stride/Vertex mismatch (stride %d, sizeof(Vertex) %d)", vertexDecl.m_stride, sizeof(Vertex) );
- const float depth = _clear.m_depth;
+ const float depth = _clear.m_depth * 2.0f - 1.0f;
vertex->m_x = -1.0f;
vertex->m_y = -1.0f;
@@ -2840,7 +3027,7 @@ namespace bgfx { namespace gl
float mrtClear[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];
for (uint32_t ii = 0; ii < numMrt; ++ii)
{
- uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE-1, _clear.m_index[ii]);
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, _clear.m_index[ii]);
memcpy(mrtClear[ii], _palette[index], 16);
}
@@ -2879,7 +3066,7 @@ namespace bgfx { namespace gl
FrameBufferGL m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
UniformRegistry m_uniformReg;
void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
- QueriesGL m_queries;
+ TimerQueryGL m_gpuTimer;
VaoStateCache m_vaoStateCache;
SamplerStateCache m_samplerStateCache;
@@ -2900,6 +3087,7 @@ namespace bgfx { namespace gl
bool m_vaoSupport;
bool m_samplerObjectSupport;
bool m_shadowSamplersSupport;
+ bool m_borderColorSupport;
bool m_programBinarySupport;
bool m_textureSwizzleSupport;
bool m_depthTextureSupport;
@@ -3033,28 +3221,22 @@ namespace bgfx { namespace gl
{
case GL_INT:
case GL_UNSIGNED_INT:
- return UniformType::Uniform1iv;
+ return UniformType::Int1;
case GL_FLOAT:
- return UniformType::Uniform1fv;
-
case GL_FLOAT_VEC2:
- return UniformType::Uniform2fv;
-
case GL_FLOAT_VEC3:
- return UniformType::Uniform3fv;
-
case GL_FLOAT_VEC4:
- return UniformType::Uniform4fv;
+ return UniformType::Vec4;
case GL_FLOAT_MAT2:
break;
case GL_FLOAT_MAT3:
- return UniformType::Uniform3x3fv;
+ return UniformType::Mat3;
case GL_FLOAT_MAT4:
- return UniformType::Uniform4x4fv;
+ return UniformType::Mat4;
case GL_SAMPLER_2D:
case GL_INT_SAMPLER_2D:
@@ -3085,7 +3267,7 @@ namespace bgfx { namespace gl
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE:
- return UniformType::Uniform1iv;
+ return UniformType::Int1;
};
BX_CHECK(false, "Unrecognized GL type 0x%04x.", _type);
@@ -3154,7 +3336,7 @@ namespace bgfx { namespace gl
{
if (NULL != m_constantBuffer)
{
- ConstantBuffer::destroy(m_constantBuffer);
+ UniformBuffer::destroy(m_constantBuffer);
m_constantBuffer = NULL;
}
m_numPredefined = 0;
@@ -3179,8 +3361,12 @@ namespace bgfx { namespace gl
GL_CHECK(glBindFragDataLocation(m_id, 0, "bgfx_FragColor") );
#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
- if (s_extension[Extension::ARB_program_interface_query].m_supported
- || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
+ bool piqSupported = true
+ && s_extension[Extension::ARB_program_interface_query ].m_supported
+ && s_extension[Extension::ARB_shader_storage_buffer_object].m_supported
+ ;
+
+ if (piqSupported)
{
GL_CHECK(glGetProgramInterfaceiv(m_id, GL_PROGRAM_INPUT, GL_ACTIVE_RESOURCES, &activeAttribs ) );
GL_CHECK(glGetProgramInterfaceiv(m_id, GL_UNIFORM, GL_ACTIVE_RESOURCES, &activeUniforms) );
@@ -3217,8 +3403,6 @@ namespace bgfx { namespace gl
m_numPredefined = 0;
m_numSamplers = 0;
- const bool piqSupported = s_extension[Extension::ARB_program_interface_query].m_supported;
-
BX_TRACE("Uniforms (%d):", activeUniforms);
for (int32_t ii = 0; ii < activeUniforms; ++ii)
{
@@ -3235,8 +3419,7 @@ namespace bgfx { namespace gl
GLint num;
GLint loc;
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31)
- || piqSupported)
+ if (piqSupported)
{
GL_CHECK(glGetProgramResourceiv(m_id
, GL_UNIFORM
@@ -3334,11 +3517,13 @@ namespace bgfx { namespace gl
else
{
const UniformInfo* info = s_renderGL->m_uniformReg.find(name);
+ BX_WARN(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
+
if (NULL != info)
{
if (NULL == m_constantBuffer)
{
- m_constantBuffer = ConstantBuffer::create(1024);
+ m_constantBuffer = UniformBuffer::create(1024);
}
UniformType::Enum type = convertGlType(gltype);
@@ -3364,8 +3549,7 @@ namespace bgfx { namespace gl
m_constantBuffer->finish();
}
- if (s_extension[Extension::ARB_program_interface_query].m_supported
- || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
+ if (piqSupported)
{
struct VariableInfo
{
@@ -3415,6 +3599,10 @@ namespace bgfx { namespace gl
m_used[used++] = ii;
}
}
+ BX_CHECK(used < BX_COUNTOF(m_used), "Out of bounds %d > array size %d."
+ , used
+ , BX_COUNTOF(m_used)
+ );
m_used[used] = Attrib::Count;
used = 0;
@@ -3427,6 +3615,10 @@ namespace bgfx { namespace gl
m_instanceData[used++] = loc;
}
}
+ BX_CHECK(used < BX_COUNTOF(m_instanceData), "Out of bounds %d > array size %d."
+ , used
+ , BX_COUNTOF(m_instanceData)
+ );
m_instanceData[used] = 0xffff;
}
@@ -3445,13 +3637,33 @@ namespace bgfx { namespace gl
if (-1 != loc)
{
- if (0xff != _vertexDecl.m_attributes[attr])
+ if (UINT16_MAX != _vertexDecl.m_attributes[attr])
{
GL_CHECK(glEnableVertexAttribArray(loc) );
GL_CHECK(glVertexAttribDivisor(loc, 0) );
uint32_t baseVertex = _baseVertex*_vertexDecl.m_stride + _vertexDecl.m_offset[attr];
- GL_CHECK(glVertexAttribPointer(loc, num, s_attribType[type], normalized, _vertexDecl.m_stride, (void*)(uintptr_t)baseVertex) );
+ if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
+ && (AttribType::Uint8 == type || AttribType::Int16 == type)
+ && !normalized)
+ {
+ GL_CHECK(glVertexAttribIPointer(loc
+ , num
+ , s_attribType[type]
+ , _vertexDecl.m_stride
+ , (void*)(uintptr_t)baseVertex)
+ );
+ }
+ else
+ {
+ GL_CHECK(glVertexAttribPointer(loc
+ , num
+ , s_attribType[type]
+ , normalized
+ , _vertexDecl.m_stride
+ , (void*)(uintptr_t)baseVertex)
+ );
+ }
}
else
{
@@ -3550,7 +3762,7 @@ namespace bgfx { namespace gl
m_width = _width;
m_height = _height;
m_depth = _depth;
- m_currentFlags = UINT32_MAX;
+ m_currentSamplerHash = UINT32_MAX;
m_requestedFormat = _format;
m_textureFormat = _format;
@@ -3610,7 +3822,7 @@ namespace bgfx { namespace gl
}
}
- setSamplerState(_flags);
+ setSamplerState(_flags, NULL);
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
&& TextureFormat::BGRA8 == m_requestedFormat
@@ -3987,7 +4199,7 @@ namespace bgfx { namespace gl
}
}
- void TextureGL::setSamplerState(uint32_t _flags)
+ void TextureGL::setSamplerState(uint32_t _flags, const float _rgba[4])
{
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30)
&& !s_textureFilter[m_textureFormat])
@@ -4006,9 +4218,26 @@ namespace bgfx { namespace gl
}
const uint32_t flags = (0 != (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? m_flags : _flags) & BGFX_TEXTURE_SAMPLER_BITS_MASK;
- if (flags != m_currentFlags)
+
+ bool hasBorderColor = false;
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(flags);
+ if (NULL != _rgba)
+ {
+ if (BGFX_TEXTURE_U_BORDER == (flags & BGFX_TEXTURE_U_BORDER)
+ || BGFX_TEXTURE_V_BORDER == (flags & BGFX_TEXTURE_V_BORDER)
+ || BGFX_TEXTURE_W_BORDER == (flags & BGFX_TEXTURE_W_BORDER) )
+ {
+ murmur.add(_rgba, 16);
+ hasBorderColor = true;
+ }
+ }
+ uint32_t hash = murmur.end();
+
+ if (hash != m_currentSamplerHash)
{
- const GLenum target = m_target;
+ const GLenum target = m_target;
const uint8_t numMips = m_numMips;
GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_S, s_textureAddress[(flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT]) );
@@ -4030,6 +4259,16 @@ namespace bgfx { namespace gl
getFilters(flags, 1 < numMips, magFilter, minFilter);
GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter) );
GL_CHECK(glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) );
+
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
+ || s_renderGL->m_borderColorSupport)
+ {
+ if (hasBorderColor)
+ {
+ GL_CHECK(glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, _rgba) );
+ }
+ }
+
if (0 != (flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) )
&& 0.0f < s_renderGL->m_maxAnisotropy)
{
@@ -4051,12 +4290,18 @@ namespace bgfx { namespace gl
}
}
- m_currentFlags = flags;
+ m_currentSamplerHash = hash;
}
}
- void TextureGL::commit(uint32_t _stage, uint32_t _flags)
+ void TextureGL::commit(uint32_t _stage, uint32_t _flags, const float _palette[][4])
{
+ const uint32_t flags = 0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags)
+ ? _flags
+ : m_flags
+ ;
+ const uint32_t index = (flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
+
GL_CHECK(glActiveTexture(GL_TEXTURE0+_stage) );
GL_CHECK(glBindTexture(m_target, m_id) );
@@ -4064,7 +4309,7 @@ namespace bgfx { namespace gl
&& BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) )
{
// GLES2 doesn't have support for sampler object.
- setSamplerState(_flags);
+ setSamplerState(flags, _palette[index]);
}
else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
&& BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL < 31) )
@@ -4072,17 +4317,17 @@ namespace bgfx { namespace gl
// In case that GL 2.1 sampler object is supported via extension.
if (s_renderGL->m_samplerObjectSupport)
{
- s_renderGL->setSamplerState(_stage, m_numMips, _flags);
+ s_renderGL->setSamplerState(_stage, m_numMips, flags, _palette[index]);
}
else
{
- setSamplerState(_flags);
+ setSamplerState(flags, _palette[index]);
}
}
else
{
// Everything else has sampler object.
- s_renderGL->setSamplerState(_stage, m_numMips, _flags);
+ s_renderGL->setSamplerState(_stage, m_numMips, flags, _palette[index]);
}
}
@@ -4275,7 +4520,8 @@ namespace bgfx { namespace gl
if (usesTextureLod)
{
BX_WARN(s_extension[Extension::EXT_shader_texture_lod].m_supported, "EXT_shader_texture_lod is used but not supported by GLES2 driver.");
- if (s_extension[Extension::EXT_shader_texture_lod].m_supported)
+ if (s_extension[Extension::EXT_shader_texture_lod].m_supported
+ /*&& GL_VERTEX_SHADER == m_type*/)
{
writeString(&writer
, "#extension GL_EXT_shader_texture_lod : enable\n"
@@ -4348,7 +4594,10 @@ namespace bgfx { namespace gl
bool usesIUsamplers = !!bx::findIdentifierMatch(code, s_uisamplers);
- uint32_t version = usesIUsamplers ? 130 : (usesTextureLod ? 120 : 0);
+ uint32_t version = usesIUsamplers
+ ? 130
+ : (usesTextureLod ? 120 : 0)
+ ;
if (0 != version)
{
@@ -4363,6 +4612,44 @@ namespace bgfx { namespace gl
}
}
+ if (130 <= version)
+ {
+ if (m_type == GL_FRAGMENT_SHADER)
+ {
+ writeString(&writer, "#define varying in\n");
+ }
+ else
+ {
+ writeString(&writer, "#define attribute in\n");
+ writeString(&writer, "#define varying out\n");
+ }
+
+ uint32_t fragData = 0;
+
+ if (!!bx::findIdentifierMatch(code, "gl_FragData") )
+ {
+ for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii)
+ {
+ char tmpFragData[16];
+ bx::snprintf(tmpFragData, BX_COUNTOF(tmpFragData), "gl_FragData[%d]", ii);
+ fragData = bx::uint32_max(fragData, NULL == strstr(code, tmpFragData) ? 0 : ii+1);
+ }
+
+ BGFX_FATAL(0 != fragData, Fatal::InvalidShader, "Unable to find and patch gl_FragData!");
+ }
+
+ if (0 != fragData)
+ {
+ writeStringf(&writer, "out vec4 bgfx_FragData[%d];\n", fragData);
+ writeString(&writer, "#define gl_FragData bgfx_FragData\n");
+ }
+ else
+ {
+ writeString(&writer, "out vec4 bgfx_FragColor;\n");
+ writeString(&writer, "#define gl_FragColor bgfx_FragColor\n");
+ }
+ }
+
writeString(&writer
, "#define lowp\n"
"#define mediump\n"
@@ -4609,13 +4896,16 @@ namespace bgfx { namespace gl
m_num = uint8_t(colorIdx);
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
{
if (0 == colorIdx)
{
- // When only depth is attached disable draw buffer to avoid
- // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
- GL_CHECK(glDrawBuffer(GL_NONE) );
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
+ {
+ // When only depth is attached disable draw buffer to avoid
+ // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
+ GL_CHECK(glDrawBuffer(GL_NONE) );
+ }
}
else
{
@@ -4782,11 +5072,9 @@ namespace bgfx { namespace gl
int64_t elapsed = -bx::getHPCounter();
int64_t captureElapsed = 0;
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
- && (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
- && m_timerQuerySupport)
+ if (m_timerQuerySupport)
{
- m_queries.begin(0, GL_TIME_ELAPSED);
+ m_gpuTimer.begin();
}
if (0 < _render->m_iboffset)
@@ -4808,14 +5096,14 @@ namespace bgfx { namespace gl
currentState.m_flags = BGFX_STATE_NONE;
currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE);
- const bool hmdEnabled = m_ovr.isEnabled() || m_ovr.isDebug();
- _render->m_hmdEnabled = hmdEnabled;
+ _render->m_hmdInitialized = m_ovr.isInitialized();
+ const bool hmdEnabled = m_ovr.isEnabled() || m_ovr.isDebug();
ViewState viewState(_render, hmdEnabled);
uint16_t programIdx = invalidHandle;
SortKey key;
- uint8_t view = 0xff;
+ uint16_t view = UINT16_MAX;
FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
int32_t height = hmdEnabled
? _render->m_hmd.height
@@ -4879,7 +5167,7 @@ namespace bgfx { namespace gl
restartState = 2;
item = restartItem;
restartItem = numItems;
- view = 0xff;
+ view = UINT16_MAX;
continue;
}
@@ -4925,8 +5213,15 @@ namespace bgfx { namespace gl
GL_CHECK(glInsertEventMarker(0, viewName) );
}
- viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2;
- viewState.m_rect.m_width /= 2;
+ if (m_ovr.isEnabled() )
+ {
+ m_ovr.getViewport(eye, &viewState.m_rect);
+ }
+ else
+ {
+ viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2;
+ viewState.m_rect.m_width /= 2;
+ }
}
else
{
@@ -4954,7 +5249,7 @@ namespace bgfx { namespace gl
if (BGFX_CLEAR_NONE != (clear.m_flags & BGFX_CLEAR_MASK) )
{
- clearQuad(_clearQuad, viewState.m_rect, clear, height, _render->m_clearColor);
+ clearQuad(_clearQuad, viewState.m_rect, clear, height, _render->m_colorPalette);
}
GL_CHECK(glDisable(GL_STENCIL_TEST) );
@@ -5011,7 +5306,7 @@ namespace bgfx { namespace gl
case Binding::IndexBuffer:
{
const IndexBufferGL& buffer = m_indexBuffers[bind.m_idx];
- GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id));
+ GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id) );
barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
}
break;
@@ -5019,7 +5314,7 @@ namespace bgfx { namespace gl
case Binding::VertexBuffer:
{
const VertexBufferGL& buffer = m_vertexBuffers[bind.m_idx];
- GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id));
+ GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id) );
barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
}
break;
@@ -5030,7 +5325,7 @@ namespace bgfx { namespace gl
if (0 != barrier)
{
bool constantsChanged = compute.m_constBegin < compute.m_constEnd;
- rendererUpdateUniforms(this, _render->m_constantBuffer, compute.m_constBegin, compute.m_constEnd);
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, compute.m_constBegin, compute.m_constEnd);
if (constantsChanged
&& NULL != program.m_constantBuffer)
@@ -5057,7 +5352,7 @@ namespace bgfx { namespace gl
uintptr_t args = compute.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
{
- GL_CHECK(glDispatchComputeIndirect(args) );
+ GL_CHECK(glDispatchComputeIndirect((GLintptr)args) );
args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
}
}
@@ -5174,7 +5469,7 @@ namespace bgfx { namespace gl
GLint ref = (stencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
GLint mask = (stencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT;
uint32_t func = (stencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT;
- GL_CHECK(glStencilFuncSeparate(face, s_cmpFunc[func], ref, mask));
+ GL_CHECK(glStencilFuncSeparate(face, s_cmpFunc[func], ref, mask) );
}
if ( (BGFX_STENCIL_OP_FAIL_S_MASK|BGFX_STENCIL_OP_FAIL_Z_MASK|BGFX_STENCIL_OP_PASS_Z_MASK) & changed)
@@ -5294,7 +5589,7 @@ namespace bgfx { namespace gl
const uint32_t srcA = (blend>> 8)&0xf;
const uint32_t dstA = (blend>>12)&0xf;
- const uint32_t equ = uint32_t((newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
+ const uint32_t equ = uint32_t( (newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
const uint32_t equRGB = (equ )&0x7;
const uint32_t equA = (equ>>3)&0x7;
@@ -5386,7 +5681,7 @@ namespace bgfx { namespace gl
bool programChanged = false;
bool constantsChanged = draw.m_constBegin < draw.m_constEnd;
bool bindAttribs = false;
- rendererUpdateUniforms(this, _render->m_constantBuffer, draw.m_constBegin, draw.m_constEnd);
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, draw.m_constBegin, draw.m_constEnd);
if (key.m_program != programIdx)
{
@@ -5417,20 +5712,20 @@ namespace bgfx { namespace gl
{
for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
{
- const Binding& sampler = draw.m_bind[stage];
+ const Binding& bind = draw.m_bind[stage];
Binding& current = currentState.m_bind[stage];
- if (current.m_idx != sampler.m_idx
- || current.m_un.m_draw.m_flags != sampler.m_un.m_draw.m_flags
+ if (current.m_idx != bind.m_idx
+ || current.m_un.m_draw.m_flags != bind.m_un.m_draw.m_flags
|| programChanged)
{
- if (invalidHandle != sampler.m_idx)
+ if (invalidHandle != bind.m_idx)
{
- TextureGL& texture = m_textures[sampler.m_idx];
- texture.commit(stage, sampler.m_un.m_draw.m_flags);
+ TextureGL& texture = m_textures[bind.m_idx];
+ texture.commit(stage, bind.m_un.m_draw.m_flags, _render->m_colorPalette);
}
}
- current = sampler;
+ current = bind;
}
}
@@ -5664,6 +5959,7 @@ namespace bgfx { namespace gl
{
const IndexBufferGL& ib = m_indexBuffers[draw.m_indexBuffer.idx];
const bool hasIndex16 = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32);
+ const uint32_t indexSize = hasIndex16 ? 2 : 4;
const GLenum indexFormat = hasIndex16
? GL_UNSIGNED_SHORT
: GL_UNSIGNED_INT
@@ -5671,7 +5967,6 @@ namespace bgfx { namespace gl
if (UINT32_MAX == draw.m_numIndices)
{
- const uint32_t indexSize = hasIndex16 ? 2 : 4;
numIndices = ib.m_size/indexSize;
numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub;
numInstances = draw.m_numInstances;
@@ -5694,7 +5989,7 @@ namespace bgfx { namespace gl
GL_CHECK(glDrawElementsInstanced(prim.m_type
, numIndices
, indexFormat
- , (void*)(uintptr_t)(draw.m_startIndex*2)
+ , (void*)(uintptr_t)(draw.m_startIndex*indexSize)
, draw.m_numInstances
) );
}
@@ -5749,26 +6044,41 @@ namespace bgfx { namespace gl
min = min > frameTime ? frameTime : min;
max = max < frameTime ? frameTime : max;
- if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ static uint32_t maxGpuLatency = 0;
+ static double maxGpuElapsed = 0.0f;
+ double elapsedGpuMs = 0.0;
+ uint64_t elapsedGl = 0;
+
+ if (m_timerQuerySupport)
{
- double elapsedGpuMs = 0.0;
- uint64_t elapsedGl = 0;
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
- && m_timerQuerySupport)
+ m_gpuTimer.end();
+ while (m_gpuTimer.get() )
{
- m_queries.end(GL_TIME_ELAPSED);
- elapsedGl = m_queries.getResult(0);
- elapsedGpuMs = double(elapsedGl)/1e6;
+ elapsedGl = m_gpuTimer.m_elapsed;
+ elapsedGpuMs = double(elapsedGl)/1e6;
+ maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
}
+ maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
+ }
+
+ const int64_t timerFreq = bx::getHPFrequency();
+ Stats& perfStats = _render->m_perfStats;
+ perfStats.cpuTime = frameTime;
+ perfStats.cpuTimerFreq = timerFreq;
+ perfStats.gpuTime = elapsedGl;
+ perfStats.gpuTimerFreq = 1000000000;
+
+ if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ {
TextVideoMem& tvm = m_textVideoMem;
static int64_t next = now;
if (now >= next)
{
- next = now + bx::getHPFrequency();
- double freq = double(bx::getHPFrequency() );
+ next = now + timerFreq;
+ double freq = double(timerFreq);
double toMs = 1000.0/freq;
tvm.clear();
@@ -5776,10 +6086,14 @@ namespace bgfx { namespace gl
tvm.printf(0, pos++, BGFX_CONFIG_DEBUG ? 0x89 : 0x8f, " %s / " BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME " "
, getRendererName()
);
- tvm.printf(0, pos++, 0x0f, " Vendor: %s", m_vendor);
- tvm.printf(0, pos++, 0x0f, " Renderer: %s", m_renderer);
- tvm.printf(0, pos++, 0x0f, " Version: %s", m_version);
- tvm.printf(0, pos++, 0x0f, "GLSL version: %s", m_glslVersion);
+ tvm.printf(0, pos++, 0x8f, " Vendor: %s ", m_vendor);
+ tvm.printf(0, pos++, 0x8f, " Renderer: %s ", m_renderer);
+ tvm.printf(0, pos++, 0x8f, " Version: %s ", m_version);
+ tvm.printf(0, pos++, 0x8f, " GLSL version: %s ", m_glslVersion);
+
+ char processMemoryUsed[16];
+ bx::prettify(processMemoryUsed, BX_COUNTOF(processMemoryUsed), bx::getProcessMemoryUsed() );
+ tvm.printf(0, pos++, 0x8f, " Memory: %s (process) ", processMemoryUsed);
pos = 10;
tvm.printf(10, pos++, 0x8e, " Frame CPU: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS "
@@ -5802,18 +6116,21 @@ namespace bgfx { namespace gl
);
double elapsedCpuMs = double(elapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms]"
+ tvm.printf(10, pos++, 0x8e, " Submitted: %5d (draw %5d, compute %4d) / CPU %7.4f [ms] %c GPU %7.4f [ms] (latency %d) "
, _render->m_num
, statsKeyType[0]
, statsKeyType[1]
, elapsedCpuMs
, elapsedCpuMs > elapsedGpuMs ? '>' : '<'
- , elapsedGpuMs
+ , maxGpuElapsed
+ , maxGpuLatency
);
+ maxGpuLatency = 0;
+ maxGpuElapsed = 0.0;
for (uint32_t ii = 0; ii < BX_COUNTOF(s_primInfo); ++ii)
{
- tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d"
+ tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d "
, s_primName[ii]
, statsNumPrimsRendered[ii]
, statsNumInstances[ii]
@@ -5826,9 +6143,10 @@ namespace bgfx { namespace gl
tvm.printf(tvm.m_width-27, 0, 0x1f, " [F11 - RenderDoc capture] ");
}
- tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices);
- tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset);
- tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset);
+ tvm.printf(10, pos++, 0x8e, " Indices: %7d ", statsNumIndices);
+ tvm.printf(10, pos++, 0x8e, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax);
+ tvm.printf(10, pos++, 0x8e, " DVB size: %7d ", _render->m_vboffset);
+ tvm.printf(10, pos++, 0x8e, " DIB size: %7d ", _render->m_iboffset);
pos++;
tvm.printf(10, pos++, 0x8e, " State cache: ");
@@ -5837,10 +6155,6 @@ namespace bgfx { namespace gl
, m_vaoStateCache.getCount()
, m_samplerStateCache.getCount()
);
- pos++;
-
- double captureMs = double(captureElapsed)*toMs;
- tvm.printf(10, pos++, 0x8e, " Capture: %3.4f [ms]", captureMs);
#if BGFX_CONFIG_RENDERER_OPENGL
if (s_extension[Extension::ATI_meminfo].m_supported)
@@ -5855,7 +6169,7 @@ namespace bgfx { namespace gl
GL_CHECK(glGetIntegerv(GL_RENDERBUFFER_FREE_MEMORY_ATI, rbfFree) );
pos++;
- tvm.printf(10, pos++, 0x8c, " -------------| free| free b| aux| aux fb");
+ tvm.printf(10, pos++, 0x8c, " -------------| free| free b| aux| aux fb ");
char tmp0[16];
char tmp1[16];
@@ -5866,19 +6180,19 @@ namespace bgfx { namespace gl
bx::prettify(tmp1, BX_COUNTOF(tmp1), vboFree[1]);
bx::prettify(tmp2, BX_COUNTOF(tmp2), vboFree[2]);
bx::prettify(tmp3, BX_COUNTOF(tmp3), vboFree[3]);
- tvm.printf(10, pos++, 0x8e, " VBO: %10s, %10s, %10s, %10s", tmp0, tmp1, tmp2, tmp3);
+ tvm.printf(10, pos++, 0x8e, " VBO: %10s, %10s, %10s, %10s ", tmp0, tmp1, tmp2, tmp3);
bx::prettify(tmp0, BX_COUNTOF(tmp0), texFree[0]);
bx::prettify(tmp1, BX_COUNTOF(tmp1), texFree[1]);
bx::prettify(tmp2, BX_COUNTOF(tmp2), texFree[2]);
bx::prettify(tmp3, BX_COUNTOF(tmp3), texFree[3]);
- tvm.printf(10, pos++, 0x8e, " Texture: %10s, %10s, %10s, %10s", tmp0, tmp1, tmp2, tmp3);
+ tvm.printf(10, pos++, 0x8e, " Texture: %10s, %10s, %10s, %10s ", tmp0, tmp1, tmp2, tmp3);
bx::prettify(tmp0, BX_COUNTOF(tmp0), rbfFree[0]);
bx::prettify(tmp1, BX_COUNTOF(tmp1), rbfFree[1]);
bx::prettify(tmp2, BX_COUNTOF(tmp2), rbfFree[2]);
bx::prettify(tmp3, BX_COUNTOF(tmp3), rbfFree[3]);
- tvm.printf(10, pos++, 0x8e, " Render Buffer: %10s, %10s, %10s, %10s", tmp0, tmp1, tmp2, tmp3);
+ tvm.printf(10, pos++, 0x8e, " Render Buffer: %10s, %10s, %10s, %10s ", tmp0, tmp1, tmp2, tmp3);
}
else if (s_extension[Extension::NVX_gpu_memory_info].m_supported)
{
@@ -5896,30 +6210,34 @@ namespace bgfx { namespace gl
GLint evictedMemory;
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX, &evictedMemory) );
- pos += 2;
+ pos++;
char tmp0[16];
char tmp1[16];
bx::prettify(tmp0, BX_COUNTOF(tmp0), dedicated);
- tvm.printf(10, pos++, 0x8e, " Dedicated: %10s", tmp0);
+ tvm.printf(10, pos++, 0x8e, " Dedicated: %10s ", tmp0);
bx::prettify(tmp0, BX_COUNTOF(tmp0), currAvail);
bx::prettify(tmp1, BX_COUNTOF(tmp1), totalAvail);
- tvm.printf(10, pos++, 0x8e, " Available: %10s / %10s", tmp0, tmp1);
+ tvm.printf(10, pos++, 0x8e, " Available: %10s / %10s ", tmp0, tmp1);
bx::prettify(tmp0, BX_COUNTOF(tmp0), evictedCount);
bx::prettify(tmp1, BX_COUNTOF(tmp1), evictedMemory);
- tvm.printf(10, pos++, 0x8e, " Eviction: %10s / %10s", tmp0, tmp1);
+ tvm.printf(10, pos++, 0x8e, " Eviction: %10s / %10s ", tmp0, tmp1);
}
#endif // BGFX_CONFIG_RENDERER_OPENGL
+ pos++;
+ double captureMs = double(captureElapsed)*toMs;
+ tvm.printf(10, pos++, 0x8e, " Capture: %7.4f [ms] ", captureMs);
+
uint8_t attr[2] = { 0x89, 0x8a };
uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender;
pos++;
- tvm.printf(10, pos++, attr[attrIndex&1], "Submit wait: %3.4f [ms]", double(_render->m_waitSubmit)*toMs);
- tvm.printf(10, pos++, attr[(attrIndex+1)&1], "Render wait: %3.4f [ms]", double(_render->m_waitRender)*toMs);
+ tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %7.4f [ms] ", double(_render->m_waitSubmit)*toMs);
+ tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %7.4f [ms] ", double(_render->m_waitRender)*toMs);
min = frameTime;
max = frameTime;
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 8c77fd2546c..1a17070d7e6 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -121,14 +121,38 @@ typedef uint64_t GLuint64;
# define GL_R8 0x8229
#endif // GL_R8
+#ifndef GL_R8I
+# define GL_R8I 0x8231
+#endif // GL_R8I
+
+#ifndef GL_R8UI
+# define GL_R8UI 0x8232
+#endif // GL_R8UI
+
+#ifndef GL_R8_SNORM
+# define GL_R8_SNORM 0x8F94
+#endif // GL_R8_SNORM
+
#ifndef GL_R16
# define GL_R16 0x822A
#endif // GL_R16
+#ifndef GL_R16I
+# define GL_R16I 0x8233
+#endif // GL_R16I
+
+#ifndef GL_R16UI
+# define GL_R16UI 0x8234
+#endif // GL_R16UI
+
#ifndef GL_R16F
# define GL_R16F 0x822D
#endif // GL_R16F
+#ifndef GL_R16_SNORM
+# define GL_R16_SNORM 0x8F98
+#endif // GL_R16_SNORM
+
#ifndef GL_R32UI
# define GL_R32UI 0x8236
#endif // GL_R32UI
@@ -141,6 +165,18 @@ typedef uint64_t GLuint64;
# define GL_RG8 0x822B
#endif // GL_RG8
+#ifndef GL_RG8I
+# define GL_RG8I 0x8237
+#endif // GL_RG8I
+
+#ifndef GL_RG8UI
+# define GL_RG8UI 0x8238
+#endif // GL_RG8UI
+
+#ifndef GL_RG8_SNORM
+# define GL_RG8_SNORM 0x8F95
+#endif // GL_RG8_SNORM
+
#ifndef GL_RG16
# define GL_RG16 0x822C
#endif // GL_RG16
@@ -153,10 +189,30 @@ typedef uint64_t GLuint64;
# define GL_RG16F 0x822F
#endif // GL_RG16F
+#ifndef GL_RG16I
+# define GL_RG16I 0x8239
+#endif // GL_RG16I
+
+#ifndef GL_RG16UI
+# define GL_RG16UI 0x823A
+#endif // GL_RG16UI
+
+#ifndef GL_RG16_SNORM
+# define GL_RG16_SNORM 0x8F99
+#endif // GL_RG16_SNORM
+
+#ifndef GL_R32I
+# define GL_R32I 0x8235
+#endif // GL_R32I
+
#ifndef GL_R32UI
# define GL_R32UI 0x8236
#endif // GL_R32UI
+#ifndef GL_RG32I
+# define GL_RG32I 0x823B
+#endif // GL_RG32I
+
#ifndef GL_RG32UI
# define GL_RG32UI 0x823C
#endif // GL_RG32UI
@@ -165,6 +221,30 @@ typedef uint64_t GLuint64;
# define GL_RG32F 0x8230
#endif // GL_RG32F
+#ifndef GL_RGBA8I
+# define GL_RGBA8I 0x8D8E
+#endif // GL_RGBA8I
+
+#ifndef GL_RGBA8UI
+# define GL_RGBA8UI 0x8D7C
+#endif // GL_RGBA8UI
+
+#ifndef GL_RGBA8_SNORM
+# define GL_RGBA8_SNORM 0x8F97
+#endif // GL_RGBA8_SNORM
+
+#ifndef GL_RGBA16I
+# define GL_RGBA16I 0x8D88
+#endif // GL_RGBA16I
+
+#ifndef GL_RGBA16UI
+# define GL_RGBA16UI 0x8D76
+#endif // GL_RGBA16UI
+
+#ifndef GL_RGBA16_SNORM
+# define GL_RGBA16_SNORM 0x8F9B
+#endif // GL_RGBA16_SNORM
+
#ifndef GL_RGBA32UI
# define GL_RGBA32UI 0x8D70
#endif // GL_RGBA32UI
@@ -173,6 +253,10 @@ typedef uint64_t GLuint64;
# define GL_RGBA32F 0x8814
#endif // GL_RGBA32F
+#ifndef GL_RGBA32I
+# define GL_RGBA32I 0x8D82
+#endif // GL_RGBA32I
+
#ifndef GL_STENCIL_INDEX
# define GL_STENCIL_INDEX 0x1901
#endif // GL_STENCIL_INDEX
@@ -225,6 +309,14 @@ typedef uint64_t GLuint64;
# define GL_RGBA16UI 0x8D76
#endif // GL_RGBA16UI
+#ifndef GL_RGB9_E5
+# define GL_RGB9_E5 0x8C3D
+#endif // GL_RGB9_E5
+
+#ifndef GL_UNSIGNED_INT_5_9_9_9_REV
+# define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#endif // GL_UNSIGNED_INT_5_9_9_9_REV
+
#ifndef GL_R11F_G11F_B10F
# define GL_R11F_G11F_B10F 0x8C3A
#endif // GL_R11F_G11F_B10F
@@ -385,10 +477,18 @@ typedef uint64_t GLuint64;
# define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#endif // GL_MAX_COLOR_ATTACHMENTS
+#ifndef GL_MAX_DRAW_BUFFERS
+# define GL_MAX_DRAW_BUFFERS 0x8824
+#endif // GL_MAX_DRAW_BUFFERS
+
#ifndef GL_QUERY_RESULT
# define GL_QUERY_RESULT 0x8866
#endif // GL_QUERY_RESULT
+#ifndef GL_QUERY_RESULT_AVAILABLE
+# define GL_QUERY_RESULT_AVAILABLE 0x8867
+#endif // GL_QUERY_RESULT_AVAILABLE
+
#ifndef GL_READ_FRAMEBUFFER
# define GL_READ_FRAMEBUFFER 0x8CA8
#endif /// GL_READ_FRAMEBUFFER
@@ -622,6 +722,10 @@ typedef uint64_t GLuint64;
# define GL_LOCATION 0x930E
#endif // GL_LOCATION
+#ifndef GL_UNSIGNED_INT_10_10_10_2
+# define GL_UNSIGNED_INT_10_10_10_2 0x8DF6
+#endif // GL_UNSIGNED_INT_10_10_10_2
+
// _KHR or _ARB...
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
@@ -657,10 +761,22 @@ typedef uint64_t GLuint64;
# define GL_DEPTH_CLAMP 0x864F
#endif // GL_DEPTH_CLAMP
+#ifndef GL_TEXTURE_BORDER_COLOR
+# define GL_TEXTURE_BORDER_COLOR 0x1004
+#endif // GL_TEXTURE_BORDER_COLOR
+
+#ifndef GL_CLAMP_TO_BORDER
+# define GL_CLAMP_TO_BORDER 0x812D
+#endif // GL_CLAMP_TO_BORDER
+
#ifndef GL_TEXTURE_CUBE_MAP_SEAMLESS
# define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
#endif // GL_TEXTURE_CUBE_MAP_SEAMLESS
+#ifndef GL_TEXTURE_2D_MULTISAMPLE
+# define GL_TEXTURE_2D_MULTISAMPLE 0x9100
+#endif // GL_TEXTURE_2D_MULTISAMPLE
+
#ifndef GL_DRAW_INDIRECT_BUFFER
# define GL_DRAW_INDIRECT_BUFFER 0x8F3F
#endif // GL_DRAW_INDIRECT_BUFFER
@@ -699,7 +815,7 @@ typedef uint64_t GLuint64;
namespace bgfx
{
- class ConstantBuffer;
+ class UniformBuffer;
} // namespace bgfx
namespace bgfx { namespace gl
@@ -966,7 +1082,7 @@ namespace bgfx { namespace gl
, m_fmt(GL_ZERO)
, m_type(GL_ZERO)
, m_flags(0)
- , m_currentFlags(UINT32_MAX)
+ , m_currentSamplerHash(UINT32_MAX)
, m_numMips(0)
{
}
@@ -975,8 +1091,8 @@ namespace bgfx { namespace gl
void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
void destroy();
void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
- void setSamplerState(uint32_t _flags);
- void commit(uint32_t _stage, uint32_t _flags);
+ void setSamplerState(uint32_t _flags, const float _rgba[4]);
+ void commit(uint32_t _stage, uint32_t _flags, const float _palette[][4]);
GLuint m_id;
GLuint m_rbo;
@@ -984,7 +1100,7 @@ namespace bgfx { namespace gl
GLenum m_fmt;
GLenum m_type;
uint32_t m_flags;
- uint32_t m_currentFlags;
+ uint32_t m_currentSamplerHash;
uint32_t m_width;
uint32_t m_height;
uint32_t m_depth;
@@ -1061,12 +1177,12 @@ namespace bgfx { namespace gl
uint8_t m_used[Attrib::Count+1]; // dense
GLint m_attributes[Attrib::Count]; // sparse
- GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
+ GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT+1];
GLint m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
uint8_t m_numSamplers;
- ConstantBuffer* m_constantBuffer;
+ UniformBuffer* m_constantBuffer;
PredefinedUniform m_predefined[PredefinedUniform::Count];
uint8_t m_numPredefined;
VaoCacheRef m_vcref;
@@ -1076,34 +1192,99 @@ namespace bgfx { namespace gl
{
void create()
{
- glGenQueries(BX_COUNTOF(m_queries), m_queries);
+ GL_CHECK(glGenQueries(BX_COUNTOF(m_queries), m_queries) );
}
void destroy()
{
- glDeleteQueries(BX_COUNTOF(m_queries), m_queries);
+ GL_CHECK(glDeleteQueries(BX_COUNTOF(m_queries), m_queries) );
}
void begin(uint16_t _id, GLenum _target) const
{
- glBeginQuery(_target, m_queries[_id]);
+ GL_CHECK(glBeginQuery(_target, m_queries[_id]) );
}
void end(GLenum _target) const
{
- glEndQuery(_target);
+ GL_CHECK(glEndQuery(_target) );
}
uint64_t getResult(uint16_t _id) const
{
uint64_t result;
- glGetQueryObjectui64v(m_queries[_id], GL_QUERY_RESULT, &result);
+ GL_CHECK(glGetQueryObjectui64v(m_queries[_id], GL_QUERY_RESULT, &result) );
return result;
}
GLuint m_queries[64];
};
+ struct TimerQueryGL
+ {
+ TimerQueryGL()
+ : m_control(BX_COUNTOF(m_frame) )
+ {
+ }
+
+ void create()
+ {
+ GL_CHECK(glGenQueries(BX_COUNTOF(m_frame), m_frame) );
+ }
+
+ void destroy()
+ {
+ GL_CHECK(glDeleteQueries(BX_COUNTOF(m_frame), m_frame) );
+ }
+
+ void begin()
+ {
+ while (0 == m_control.reserve(1) )
+ {
+ get();
+ }
+
+ GL_CHECK(glBeginQuery(GL_TIME_ELAPSED
+ , m_frame[m_control.m_current]
+ ) );
+ }
+
+ void end()
+ {
+ GL_CHECK(glEndQuery(GL_TIME_ELAPSED) );
+ m_control.commit(1);
+ }
+
+ bool get()
+ {
+ if (0 != m_control.available() )
+ {
+ GLint available;
+ GL_CHECK(glGetQueryObjectiv(m_frame[m_control.m_read]
+ , GL_QUERY_RESULT_AVAILABLE
+ , &available
+ ) );
+
+ if (available)
+ {
+ GL_CHECK(glGetQueryObjectui64v(m_frame[m_control.m_read]
+ , GL_QUERY_RESULT
+ , &m_elapsed
+ ) );
+ m_control.consume(1);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ uint64_t m_elapsed;
+
+ GLuint m_frame[4];
+ bx::RingBufferControl m_control;
+ };
+
} /* namespace gl */ } // namespace bgfx
#endif // BGFX_RENDERER_GL_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer_mtl.h b/3rdparty/bgfx/src/renderer_mtl.h
new file mode 100644
index 00000000000..495f7abf499
--- /dev/null
+++ b/3rdparty/bgfx/src/renderer_mtl.h
@@ -0,0 +1,714 @@
+/*
+ * Copyright 2011-2015 Attila Kocsis, Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_RENDERER_METAL_H_HEADER_GUARD
+#define BGFX_RENDERER_METAL_H_HEADER_GUARD
+
+#include "bgfx_p.h"
+
+#if BGFX_CONFIG_RENDERER_METAL
+
+#import <QuartzCore/CAMetalLayer.h>
+#import <Metal/Metal.h>
+
+#if BX_PLATFORM_IOS
+# import <UIKit/UIKit.h>
+#endif // BX_PLATFORM_*
+
+namespace bgfx { namespace mtl
+{
+ // c++ wrapper
+ // objects with creation functions starting with 'new' has a refcount 1 after creation, object must be destroyed with release.
+ // commandBuffer, commandEncoders are autoreleased objects. Needs AutoreleasePool!
+
+#define MTL_CLASS(name) \
+ class name \
+ { \
+ public: \
+ name(id <MTL##name> _obj = nil) : m_obj(_obj) {} \
+ operator id <MTL##name>() const { return m_obj; } \
+ id <MTL##name> m_obj;
+
+#define MTL_CLASS_END };
+
+ typedef void (*mtlCallback)(void* userData);
+
+ MTL_CLASS(Buffer)
+ void* contents()
+ {
+ return m_obj.contents;
+ }
+
+ uint32_t length()
+ {
+ return (uint32_t)m_obj.length;
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(CommandBuffer)
+ // Creating Command Encoders
+ id<MTLRenderCommandEncoder> renderCommandEncoderWithDescriptor( MTLRenderPassDescriptor* _renderPassDescriptor){
+ return [m_obj renderCommandEncoderWithDescriptor:_renderPassDescriptor];
+ }
+
+ id<MTLComputeCommandEncoder> computeCommandEncoder()
+ {
+ return [m_obj computeCommandEncoder];
+ }
+
+ // Scheduling and Executing Commands
+ void enqueue()
+ {
+ [m_obj enqueue];
+ }
+
+ void commit()
+ {
+ [m_obj commit];
+ }
+
+ void addCompletedHandler(mtlCallback _cb, void* _data)
+ {
+ [m_obj addCompletedHandler:^(id <MTLCommandBuffer>){ _cb(_data); }];
+ }
+
+ void presentDrawable(id<MTLDrawable> _drawable)
+ {
+ [m_obj presentDrawable:_drawable];
+ }
+
+ void waitUntilCompleted()
+ {
+ [m_obj waitUntilCompleted];
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(CommandQueue)
+ id<MTLCommandBuffer> commandBuffer()
+ {
+ return [m_obj commandBuffer];
+ }
+
+ id<MTLCommandBuffer> commandBufferWithUnretainedReferences()
+ {
+ return [m_obj commandBufferWithUnretainedReferences];
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(ComputeCommandEncoder)
+ void setComputePipelineState(id<MTLComputePipelineState> _state)
+ {
+ [m_obj setComputePipelineState:_state];
+ }
+
+ void setBuffer(id<MTLBuffer> _buffer, NSUInteger _offset, NSUInteger _index)
+ {
+ [m_obj setBuffer:_buffer offset:_offset atIndex:_index];
+ }
+
+ void setTexture(id<MTLTexture> _texture, NSUInteger _index)
+ {
+ [m_obj setTexture:_texture atIndex:_index];
+ }
+
+ void setSamplerState(id<MTLSamplerState> _sampler, NSUInteger _index)
+ {
+ [m_obj setSamplerState:_sampler atIndex:_index];
+ }
+
+ void endEncoding()
+ {
+ [m_obj endEncoding];
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(Device)
+ bool supportsFeatureSet(MTLFeatureSet _featureSet)
+ {
+ return [m_obj supportsFeatureSet:_featureSet];
+ }
+
+ id<MTLLibrary> newLibraryWithData(const void* _data)
+ {
+ NSError* error;
+ id<MTLLibrary> lib = [m_obj newLibraryWithData:(dispatch_data_t)_data error:&error];
+ BX_WARN(NULL == error
+ , "newLibraryWithData failed: %s"
+ , error.localizedDescription.UTF8String
+ );
+ return lib;
+ }
+
+ id<MTLLibrary> newLibraryWithSource(const char* _source)
+ {
+ NSError* error;
+ id<MTLLibrary> lib = [m_obj newLibraryWithSource:@(_source) options:nil error:&error];
+ //TODO: sometimes prints null as paremeter. string is too large
+ BX_WARN(NULL == error
+ , "Shader compilation failed: %s"
+ , error.localizedDescription.UTF8String
+ );
+ return lib;
+ }
+
+ id<MTLCommandQueue> newCommandQueue()
+ {
+ return [m_obj newCommandQueue];
+ }
+
+ id<MTLCommandQueue> newCommandQueueWithMaxCommandBufferCount(NSUInteger _maxCommandBufferCount)
+ {
+ return [m_obj newCommandQueueWithMaxCommandBufferCount:_maxCommandBufferCount];
+ }
+
+ // Creating Resources
+ id<MTLBuffer> newBufferWithLength(unsigned int _length, MTLResourceOptions _options)
+ {
+ return [m_obj newBufferWithLength:_length options:_options ];
+ }
+
+ id<MTLBuffer> newBufferWithBytes(const void* _pointer, NSUInteger _length, MTLResourceOptions _options)
+ {
+ return [m_obj newBufferWithBytes:_pointer length:_length options:_options];
+ }
+
+ id<MTLTexture> newTextureWithDescriptor(MTLTextureDescriptor* _descriptor)
+ {
+ return [m_obj newTextureWithDescriptor:_descriptor];
+ }
+
+ id<MTLSamplerState> newSamplerStateWithDescriptor(MTLSamplerDescriptor* _descriptor)
+ {
+ return [m_obj newSamplerStateWithDescriptor:_descriptor];
+ }
+
+ // Creating Command Objects Needed to Render Graphics
+ id<MTLDepthStencilState> newDepthStencilStateWithDescriptor(MTLDepthStencilDescriptor* _descriptor)
+ {
+ return [m_obj newDepthStencilStateWithDescriptor:_descriptor];
+ }
+
+ id <MTLRenderPipelineState> newRenderPipelineStateWithDescriptor(MTLRenderPipelineDescriptor* _descriptor)
+ {
+ NSError* error;
+ id <MTLRenderPipelineState> state = [m_obj newRenderPipelineStateWithDescriptor:_descriptor error:&error];
+ BX_WARN(NULL == error
+ , "newRenderPipelineStateWithDescriptor failed: %s"
+ , error.localizedDescription.UTF8String
+ );
+ return state;
+ }
+
+ id <MTLRenderPipelineState> newRenderPipelineStateWithDescriptor(MTLRenderPipelineDescriptor* _descriptor, MTLPipelineOption _options, MTLRenderPipelineReflection** _reflection)
+ {
+ NSError* error;
+ id <MTLRenderPipelineState> state = [m_obj newRenderPipelineStateWithDescriptor:_descriptor options:_options reflection:_reflection error:&error];
+
+ BX_WARN(NULL == error
+ , "newRenderPipelineStateWithDescriptor failed: %s"
+ , error.localizedDescription.UTF8String
+ );
+ return state;
+ }
+
+ // Creating Command Objects Needed to Perform Computational Tasks
+ id <MTLComputePipelineState> newComputePipelineStateWithFunction(id <MTLFunction> _computeFunction)
+ {
+ NSError* error;
+ id <MTLComputePipelineState> state = [m_obj newComputePipelineStateWithFunction:_computeFunction error:&error];
+
+ BX_WARN(NULL == error
+ , "newComputePipelineStateWithFunction failed: %s"
+ , error.localizedDescription.UTF8String
+ );
+ return state;
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(Function)
+ NSArray* vertexAttributes() { return m_obj.vertexAttributes; }
+ MTL_CLASS_END
+
+ MTL_CLASS(Library)
+ id <MTLFunction> newFunctionWithName(const char* _functionName) { return [m_obj newFunctionWithName:@(_functionName)]; }
+ MTL_CLASS_END
+
+ MTL_CLASS(RenderCommandEncoder)
+ // Setting Graphics Rendering State
+ void setBlendColor(float _red, float _green, float _blue, float _alpha)
+ {
+ [m_obj setBlendColorRed:_red green:_green blue:_blue alpha:_alpha];
+ }
+
+ void setCullMode(MTLCullMode _cullMode)
+ {
+ [m_obj setCullMode:_cullMode];
+ }
+
+ void setDepthBias(float _depthBias, float _slopeScale, float _clamp)
+ {
+ [m_obj setDepthBias:_depthBias slopeScale:_slopeScale clamp:_clamp];
+ }
+
+ void setDepthStencilState(id<MTLDepthStencilState> _depthStencilState)
+ {
+ [m_obj setDepthStencilState:_depthStencilState];
+ }
+
+ void setFrontFacingWinding(MTLWinding _frontFacingWinding)
+ {
+ [m_obj setFrontFacingWinding:_frontFacingWinding];
+ }
+
+ void setRenderPipelineState(id<MTLRenderPipelineState> _pipelineState)
+ {
+ [m_obj setRenderPipelineState:_pipelineState];
+ }
+
+ void setScissorRect(MTLScissorRect _rect)
+ {
+ [m_obj setScissorRect:_rect];
+ }
+
+ void setStencilReferenceValue(uint32_t _ref)
+ {
+ [m_obj setStencilReferenceValue:_ref];
+ }
+
+ void setTriangleFillMode(MTLTriangleFillMode _fillMode)
+ {
+ [m_obj setTriangleFillMode:_fillMode];
+ }
+
+ void setViewport(MTLViewport _viewport)
+ {
+ [m_obj setViewport:_viewport];
+ }
+
+ void setVisibilityResultMode(MTLVisibilityResultMode _mode, NSUInteger _offset)
+ {
+ [m_obj setVisibilityResultMode:_mode offset:_offset];
+ }
+
+ // Specifying Resources for a Vertex Function
+ void setVertexBuffer(id<MTLBuffer> _buffer, NSUInteger _offset, NSUInteger _index)
+ {
+ [m_obj setVertexBuffer:_buffer offset:_offset atIndex:_index];
+ }
+
+ void setVertexSamplerState(id<MTLSamplerState> _sampler, NSUInteger _index)
+ {
+ [m_obj setVertexSamplerState:_sampler atIndex:_index];
+ }
+
+ void setVertexTexture(id<MTLTexture> _texture, NSUInteger _index)
+ {
+ [m_obj setVertexTexture:_texture atIndex:_index];
+ }
+
+ // Specifying Resources for a Fragment Function
+ void setFragmentBuffer(id<MTLBuffer> _buffer, NSUInteger _offset, NSUInteger _index)
+ {
+ [m_obj setFragmentBuffer:_buffer offset:_offset atIndex:_index];
+ }
+
+ void setFragmentSamplerState(id<MTLSamplerState> _sampler, NSUInteger _index)
+ {
+ [m_obj setFragmentSamplerState:_sampler atIndex:_index];
+ }
+
+ void setFragmentTexture(id<MTLTexture> _texture, NSUInteger _index)
+ {
+ [m_obj setFragmentTexture:_texture atIndex:_index];
+ }
+
+ //Drawing Geometric Primitives
+ //NOTE: not exposing functions without instanceCount, it seems they are just wrappers
+ void drawIndexedPrimitives(MTLPrimitiveType _primitiveType, NSUInteger _indexCount, MTLIndexType _indexType, id<MTLBuffer> _indexBuffer, NSUInteger _indexBufferOffset, NSUInteger _instanceCount)
+ {
+ [m_obj drawIndexedPrimitives:_primitiveType indexCount:_indexCount indexType:_indexType indexBuffer:_indexBuffer indexBufferOffset:_indexBufferOffset instanceCount:_instanceCount];
+ }
+
+ void drawPrimitives(MTLPrimitiveType _primitiveType, NSUInteger _vertexStart, NSUInteger _vertexCount, NSUInteger _instanceCount)
+ {
+ [m_obj drawPrimitives:_primitiveType vertexStart:_vertexStart vertexCount:_vertexCount instanceCount:_instanceCount];
+ }
+
+ void insertDebugSignpost(const char* _string)
+ {
+ [m_obj insertDebugSignpost:@(_string)];
+ }
+
+ void pushDebugGroup(const char* _string)
+ {
+ [m_obj pushDebugGroup:@(_string)];
+ }
+
+ void popDebugGroup()
+ {
+ [m_obj popDebugGroup];
+ }
+
+ void endEncoding()
+ {
+ [m_obj endEncoding];
+ }
+ MTL_CLASS_END
+
+ MTL_CLASS(Texture)
+ // Copying Data into a Texture Image
+ void replaceRegion(MTLRegion _region, NSUInteger _level, NSUInteger _slice, const void* _pixelBytes, NSUInteger _bytesPerRow, NSUInteger _bytesPerImage)
+ {
+ [m_obj replaceRegion:_region mipmapLevel:_level slice:_slice withBytes:_pixelBytes bytesPerRow:_bytesPerRow bytesPerImage:_bytesPerImage];
+ }
+
+ // Copying Data from a Texture Image
+ void getBytes(void* _pixelBytes, NSUInteger _bytesPerRow, NSUInteger _bytesPerImage, MTLRegion _region, NSUInteger _mipmapLevel, NSUInteger _slice)
+ {
+ [m_obj getBytes:_pixelBytes bytesPerRow:_bytesPerRow bytesPerImage:_bytesPerImage fromRegion:_region mipmapLevel:_mipmapLevel slice:_slice];
+ }
+
+ // Creating Textures by Reusing Image Data
+ id<MTLTexture> newTextureViewWithPixelFormat(MTLPixelFormat _pixelFormat)
+ {
+ return [m_obj newTextureViewWithPixelFormat:_pixelFormat];
+ }
+
+ //properties
+ uint32_t width()
+ {
+ return (uint32_t)m_obj.width;
+ }
+
+ uint32_t height()
+ {
+ return (uint32_t)m_obj.height;
+ }
+
+ MTLPixelFormat pixelFormat() const
+ {
+ return m_obj.pixelFormat;
+ }
+ MTL_CLASS_END
+
+ typedef id<MTLComputePipelineState> ComputePipelineState;
+ typedef id<MTLDepthStencilState> DepthStencilState;
+ typedef id<MTLRenderPipelineState> RenderPipelineState;
+ typedef id<MTLSamplerState> SamplerState;
+
+ //descriptors
+ //NOTE: [class new] is same as [[class alloc] init]
+ typedef MTLRenderPipelineDescriptor* RenderPipelineDescriptor;
+
+ inline RenderPipelineDescriptor newRenderPipelineDescriptor()
+ {
+ return [MTLRenderPipelineDescriptor new];
+ }
+
+ inline void reset(RenderPipelineDescriptor _desc)
+ {
+ [_desc reset];
+ }
+
+ typedef MTLRenderPipelineColorAttachmentDescriptor* RenderPipelineColorAttachmentDescriptor;
+
+ typedef MTLDepthStencilDescriptor* DepthStencilDescriptor;
+
+ inline MTLDepthStencilDescriptor* newDepthStencilDescriptor()
+ {
+ return [MTLDepthStencilDescriptor new];
+ }
+
+ typedef MTLStencilDescriptor* StencilDescriptor;
+
+ inline MTLStencilDescriptor* newStencilDescriptor()
+ {
+ return [MTLStencilDescriptor new];
+ }
+
+ typedef MTLRenderPassColorAttachmentDescriptor* RenderPassColorAttachmentDescriptor;
+ typedef MTLRenderPassDepthAttachmentDescriptor* RenderPassDepthAttachmentDescriptor;
+ typedef MTLRenderPassStencilAttachmentDescriptor* RenderPassStencilAttachmentDescriptor;
+
+ typedef MTLRenderPassDescriptor* RenderPassDescriptor;
+
+ inline MTLRenderPassDescriptor* newRenderPassDescriptor()
+ {
+ return [MTLRenderPassDescriptor new];
+ }
+
+ typedef MTLVertexDescriptor* VertexDescriptor;
+
+ inline MTLVertexDescriptor* newVertexDescriptor()
+ {
+ return [MTLVertexDescriptor new];
+ }
+
+ inline void reset(VertexDescriptor _desc)
+ {
+ [_desc reset];
+ }
+
+ typedef MTLSamplerDescriptor* SamplerDescriptor;
+
+ inline MTLSamplerDescriptor* newSamplerDescriptor()
+ {
+ return [MTLSamplerDescriptor new];
+ }
+
+ typedef MTLTextureDescriptor* TextureDescriptor;
+
+ inline MTLTextureDescriptor* newTextureDescriptor()
+ {
+ return [MTLTextureDescriptor new];
+ }
+
+ typedef MTLRenderPipelineReflection* RenderPipelineReflection;
+
+ //helper functions
+ inline void release(NSObject* _obj)
+ {
+ [_obj release];
+ }
+
+ inline void retain(NSObject* _obj)
+ {
+ [_obj retain];
+ }
+
+ inline const char* utf8String(NSString* _str)
+ {
+ return [_str UTF8String];
+ }
+
+#define MTL_RELEASE(_obj) \
+ BX_MACRO_BLOCK_BEGIN \
+ [_obj release]; \
+ _obj = nil; \
+ BX_MACRO_BLOCK_END
+
+#if BX_PLATFORM_IOS
+ inline bool OsVersionEqualOrGreater(const char* _version)
+ {
+ return ([[[UIDevice currentDevice] systemVersion] compare:@(_version) options:NSNumericSearch] != NSOrderedAscending);
+ }
+ //TODO: this could be in bx ?
+#endif //
+
+ // end of c++ wrapper
+
+ template <typename Ty>
+ class StateCacheT
+ {
+ public:
+ void add(uint64_t _id, Ty _item)
+ {
+ invalidate(_id);
+ m_hashMap.insert(stl::make_pair(_id, _item) );
+ }
+
+ Ty find(uint64_t _id)
+ {
+ typename HashMap::iterator it = m_hashMap.find(_id);
+ if (it != m_hashMap.end() )
+ {
+ return it->second;
+ }
+
+ return NULL;
+ }
+
+ void invalidate(uint64_t _id)
+ {
+ typename HashMap::iterator it = m_hashMap.find(_id);
+ if (it != m_hashMap.end() )
+ {
+ MTL_RELEASE(it->second);
+ m_hashMap.erase(it);
+ }
+ }
+
+ void invalidate()
+ {
+ for (typename HashMap::iterator it = m_hashMap.begin(), itEnd = m_hashMap.end(); it != itEnd; ++it)
+ {
+ release(it->second);
+ }
+
+ m_hashMap.clear();
+ }
+
+ uint32_t getCount() const
+ {
+ return uint32_t(m_hashMap.size() );
+ }
+
+ private:
+ typedef stl::unordered_map<uint64_t, Ty> HashMap;
+ HashMap m_hashMap;
+ };
+
+ struct BufferMtl
+ {
+ BufferMtl()
+ : m_buffer(NULL)
+ , m_flags(BGFX_BUFFER_NONE)
+ , m_dynamic(false)
+ {
+ }
+
+ void create(uint32_t _size, void* _data, uint16_t _flags, uint16_t _stride = 0, bool _vertex = false);
+ void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false);
+
+ void destroy()
+ {
+ if (NULL != m_buffer)
+ {
+ [m_buffer release];
+ m_buffer = NULL;
+ m_dynamic = false;
+ }
+ }
+
+ Buffer m_buffer;
+ uint32_t m_size;
+ uint16_t m_flags;
+ bool m_dynamic;
+ };
+
+ typedef BufferMtl IndexBufferMtl;
+
+ struct VertexBufferMtl : public BufferMtl
+ {
+ VertexBufferMtl()
+ : BufferMtl()
+ {
+ }
+
+ void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+
+ VertexDeclHandle m_decl;
+ };
+
+
+ struct ShaderMtl
+ {
+ ShaderMtl()
+ : m_function(NULL)
+ {
+ }
+
+ void create(const Memory* _mem);
+ void destroy()
+ {
+ MTL_RELEASE(m_function);
+
+ }
+
+ Function m_function;
+ };
+
+ struct ProgramMtl
+ {
+ ProgramMtl()
+ : m_vsh(NULL)
+ , m_fsh(NULL)
+ , m_vshConstantBuffer(NULL)
+ , m_fshConstantBuffer(NULL)
+ , m_vshConstantBufferSize(0)
+ , m_vshConstantBufferAlignmentMask(0)
+ , m_fshConstantBufferSize(0)
+ , m_fshConstantBufferAlignmentMask(0)
+ , m_numPredefined(0)
+ , m_processedUniforms(false)
+ {
+ }
+
+ void create(const ShaderMtl* _vsh, const ShaderMtl* _fsh);
+ void destroy();
+
+ RenderPipelineState getRenderPipelineState(uint64_t _state, uint32_t _rgba, FrameBufferHandle _fbHandle, VertexDeclHandle _declHandle, uint16_t _numInstanceData);
+
+ StateCacheT<RenderPipelineState> m_renderPipelineStateCache;
+
+ uint8_t m_used[Attrib::Count+1]; // dense
+ uint32_t m_attributes[Attrib::Count]; // sparse
+ uint32_t m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT+1];
+
+ const ShaderMtl* m_vsh;
+ const ShaderMtl* m_fsh;
+ UniformBuffer* m_vshConstantBuffer;
+ UniformBuffer* m_fshConstantBuffer;
+
+ uint32_t m_vshConstantBufferSize;
+ uint32_t m_vshConstantBufferAlignmentMask;
+ uint32_t m_fshConstantBufferSize;
+ uint32_t m_fshConstantBufferAlignmentMask;
+ PredefinedUniform m_predefined[PredefinedUniform::Count*2];
+ uint8_t m_numPredefined;
+ bool m_processedUniforms;
+ };
+
+ struct TextureMtl
+ {
+ TextureMtl()
+ : m_ptr(NULL)
+ , m_ptrStencil(NULL)
+ , m_sampler(NULL)
+ , m_flags(0)
+ , m_numMips(0)
+ {
+ }
+
+ void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
+ void destroy()
+ {
+ MTL_RELEASE(m_ptr);
+ MTL_RELEASE(m_ptrStencil);
+ }
+ void update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem);
+ void commit(uint8_t _stage, uint32_t _flags = BGFX_SAMPLER_DEFAULT_FLAGS);
+
+ Texture m_ptr;
+ Texture m_ptrStencil; // for emulating packed depth/stencil formats - only for iOS8...
+ SamplerState m_sampler;
+ uint32_t m_flags;
+ uint8_t m_requestedFormat;
+ uint8_t m_textureFormat;
+ uint8_t m_numMips;
+ };
+
+ struct FrameBufferMtl
+ {
+ FrameBufferMtl()
+ : m_denseIdx(UINT16_MAX)
+ , m_pixelFormatHash(0)
+ , m_num(0)
+ {
+ m_depthHandle.idx = invalidHandle;
+ }
+
+ void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
+ void postReset();
+ uint16_t destroy();
+
+// SwapChainMtl* m_swapChain;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint16_t m_denseIdx;
+
+ uint32_t m_pixelFormatHash;
+
+ TextureHandle m_colorHandle[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS-1];
+ TextureHandle m_depthHandle;
+ uint8_t m_num; // number of color handles
+ };
+
+} /* namespace metal */ } // namespace bgfx
+
+#endif // BGFX_CONFIG_RENDERER_METAL
+
+#endif // BGFX_RENDERER_METAL_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
new file mode 100644
index 00000000000..007c2bcb786
--- /dev/null
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -0,0 +1,2799 @@
+/*
+ * Copyright 2011-2015 Attila Kocsis. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "bgfx_p.h"
+
+#if BGFX_CONFIG_RENDERER_METAL
+
+#include "renderer_mtl.h"
+#include "renderer.h"
+#include "bx/bx.h"
+
+#if BX_PLATFORM_OSX
+# include <Cocoa/Cocoa.h>
+#endif
+
+#import <Foundation/Foundation.h>
+
+#define UNIFORM_BUFFER_SIZE (1024*1024)
+
+/*
+Known issues / TODOs:
+- 15-shadowmaps-simple (modified shaderc and example needs modification too, mtxCrop znew = z * 0.5 + 0.5 is not needed ) could be hacked in shader too
+- 19-oit ( hacked shaderc to support MRT output)
+- 21-deferred ( hacked shaderc to support MRT output and fs_deferred_light needed modification for metal (similar to BGFX_SHADER_LANGUAGE_HLSL )
+
+07-callback, saveScreenshot should be implemented with one frame latency (using saveScreenshotBegin and End)
+
+16-shadowmaps, //problem with essl -> metal: SAMPLER2D(u_shadowMap0, 4); sampler index is lost. Shadowmap is set to slot 4, but
+ metal shader uses sampler/texture slot 0. this could require changes outside of renderer_mtl?
+ Otherwise it works with hacking the slot.
+
+24-nbody - cannot generate compute shaders for metal
+
+20-nanonvg - TODO: remove sampler/texture hack
+
+- caps
+
+- optimization...
+
+create binary shader representation
+
+ 13-stencil and 16-shadowmaps are very inefficient. every view stores/loads backbuffer data
+
+ BGFX_RESET_FLIP_AFTER_RENDER on low level renderers should be true? (crashes even with BGFX_RESET_FLIP_AFTER_RENDER because there is
+ one rendering frame before reset). Do I have absolutely need to send result to View at flip or can I do it in submit?
+
+ */
+
+namespace bgfx { namespace mtl
+{
+ static char s_viewName[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME];
+
+ struct PrimInfo
+ {
+ MTLPrimitiveType m_type;
+ uint32_t m_min;
+ uint32_t m_div;
+ uint32_t m_sub;
+ };
+
+ static const PrimInfo s_primInfo[] =
+ {
+ { MTLPrimitiveTypeTriangle, 3, 3, 0 },
+ { MTLPrimitiveTypeTriangleStrip, 3, 1, 2 },
+ { MTLPrimitiveTypeLine, 2, 2, 0 },
+ { MTLPrimitiveTypeLineStrip, 2, 1, 1 },
+ { MTLPrimitiveTypePoint, 1, 1, 0 },
+ };
+
+ static const char* s_primName[] =
+ {
+ "TriList",
+ "TriStrip",
+ "Line",
+ "LineStrip",
+ "Point",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_primInfo) == BX_COUNTOF(s_primName));
+
+ static const char* s_attribName[] =
+ {
+ "a_position",
+ "a_normal",
+ "a_tangent",
+ "a_bitangent",
+ "a_color0",
+ "a_color1",
+ "a_indices",
+ "a_weight",
+ "a_texcoord0",
+ "a_texcoord1",
+ "a_texcoord2",
+ "a_texcoord3",
+ "a_texcoord4",
+ "a_texcoord5",
+ "a_texcoord6",
+ "a_texcoord7",
+ };
+ BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attribName) );
+
+ static const char* s_instanceDataName[] =
+ {
+ "i_data0",
+ "i_data1",
+ "i_data2",
+ "i_data3",
+ "i_data4",
+ };
+ BX_STATIC_ASSERT(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
+
+ static const MTLVertexFormat s_attribType[][4][2] = //type, count, normalized
+ {
+ // Uint8
+ {
+ { MTLVertexFormatUChar2, MTLVertexFormatUChar2Normalized },
+ { MTLVertexFormatUChar2, MTLVertexFormatUChar2Normalized },
+ { MTLVertexFormatUChar3, MTLVertexFormatUChar3Normalized },
+ { MTLVertexFormatUChar4, MTLVertexFormatUChar4Normalized }
+ },
+
+ //Uint10
+ //TODO: normalized only
+ {
+ { MTLVertexFormatInvalid, MTLVertexFormatUInt1010102Normalized },
+ { MTLVertexFormatInvalid, MTLVertexFormatUInt1010102Normalized },
+ { MTLVertexFormatInvalid, MTLVertexFormatUInt1010102Normalized },
+ { MTLVertexFormatInvalid, MTLVertexFormatUInt1010102Normalized }
+ },
+
+ //Int16
+ {
+ { MTLVertexFormatShort2, MTLVertexFormatShort2Normalized },
+ { MTLVertexFormatShort2, MTLVertexFormatShort2Normalized },
+ { MTLVertexFormatShort3, MTLVertexFormatShort3Normalized },
+ { MTLVertexFormatShort4, MTLVertexFormatShort4Normalized }
+ },
+
+ //Half
+ {
+ { MTLVertexFormatHalf2, MTLVertexFormatHalf2 },
+ { MTLVertexFormatHalf2, MTLVertexFormatHalf2 },
+ { MTLVertexFormatHalf3, MTLVertexFormatHalf2 },
+ { MTLVertexFormatHalf4, MTLVertexFormatHalf2 }
+ },
+
+ //Float
+ {
+ { MTLVertexFormatFloat, MTLVertexFormatFloat },
+ { MTLVertexFormatFloat2, MTLVertexFormatFloat2 },
+ { MTLVertexFormatFloat3, MTLVertexFormatFloat3 },
+ { MTLVertexFormatFloat4, MTLVertexFormatFloat4 }
+ },
+ };
+ BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
+
+ static const MTLCullMode s_cullMode[] =
+ {
+ MTLCullModeNone,
+ MTLCullModeFront,
+ MTLCullModeBack,
+ MTLCullModeNone
+ };
+
+ static const MTLBlendFactor s_blendFactor[][2] =
+ {
+ { (MTLBlendFactor)0, (MTLBlendFactor)0 }, // ignored
+ { MTLBlendFactorZero, MTLBlendFactorZero }, // ZERO
+ { MTLBlendFactorOne, MTLBlendFactorOne }, // ONE
+ { MTLBlendFactorSourceColor, MTLBlendFactorSourceAlpha }, // SRC_COLOR
+ { MTLBlendFactorOneMinusSourceColor, MTLBlendFactorOneMinusSourceAlpha }, // INV_SRC_COLOR
+ { MTLBlendFactorSourceAlpha, MTLBlendFactorSourceAlpha }, // SRC_ALPHA
+ { MTLBlendFactorOneMinusSourceAlpha, MTLBlendFactorOneMinusSourceAlpha }, // INV_SRC_ALPHA
+ { MTLBlendFactorDestinationAlpha, MTLBlendFactorDestinationAlpha }, // DST_ALPHA
+ { MTLBlendFactorOneMinusDestinationAlpha, MTLBlendFactorOneMinusDestinationAlpha }, // INV_DST_ALPHA
+ { MTLBlendFactorDestinationColor, MTLBlendFactorDestinationAlpha }, // DST_COLOR
+ { MTLBlendFactorOneMinusDestinationColor, MTLBlendFactorOneMinusDestinationAlpha }, // INV_DST_COLOR
+ { MTLBlendFactorSourceAlphaSaturated, MTLBlendFactorOne }, // SRC_ALPHA_SAT
+ { MTLBlendFactorBlendColor, MTLBlendFactorBlendColor }, // FACTOR
+ { MTLBlendFactorOneMinusBlendColor, MTLBlendFactorOneMinusBlendColor }, // INV_FACTOR
+ };
+
+ static const MTLBlendOperation s_blendEquation[] =
+ {
+ MTLBlendOperationAdd,
+ MTLBlendOperationSubtract,
+ MTLBlendOperationReverseSubtract,
+ MTLBlendOperationMin,
+ MTLBlendOperationMax,
+ };
+
+ static const MTLCompareFunction s_cmpFunc[] =
+ {
+ MTLCompareFunctionAlways, //TODO: depth disable?
+ MTLCompareFunctionLess,
+ MTLCompareFunctionLessEqual,
+ MTLCompareFunctionEqual,
+ MTLCompareFunctionGreaterEqual,
+ MTLCompareFunctionGreater,
+ MTLCompareFunctionNotEqual,
+ MTLCompareFunctionNever,
+ MTLCompareFunctionAlways
+ };
+
+ static const MTLStencilOperation s_stencilOp[] =
+ {
+ MTLStencilOperationZero,
+ MTLStencilOperationKeep,
+ MTLStencilOperationReplace,
+ MTLStencilOperationIncrementWrap,
+ MTLStencilOperationIncrementClamp,
+ MTLStencilOperationDecrementWrap,
+ MTLStencilOperationDecrementClamp,
+ MTLStencilOperationInvert
+ };
+
+ static const MTLSamplerAddressMode s_textureAddress[] =
+ {
+ MTLSamplerAddressModeRepeat,
+ MTLSamplerAddressModeMirrorRepeat,
+ MTLSamplerAddressModeClampToEdge,
+ MTLSamplerAddressModeClampToZero,
+ };
+
+ static const MTLSamplerMinMagFilter s_textureFilterMinMag[] =
+ {
+ MTLSamplerMinMagFilterLinear,
+ MTLSamplerMinMagFilterNearest,
+ MTLSamplerMinMagFilterLinear,
+ };
+
+ static const MTLSamplerMipFilter s_textureFilterMip[] =
+ {
+ MTLSamplerMipFilterLinear,
+ MTLSamplerMipFilterNearest,
+ };
+
+ struct TextureFormatInfo
+ {
+ MTLPixelFormat m_fmt;
+ MTLPixelFormat m_fmtSrgb;
+ };
+
+ static TextureFormatInfo s_textureFormat[] =
+ {
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC1
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC2
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC3
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC4
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC6H
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // BC7
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ETC1
+ { 180 /*MTLPixelFormatETC2_RGB8*/, 181 /*MTLPixelFormatETC2_RGB8_sRGB*/ }, // ETC2
+ { 178 /*MTLPixelFormatEAC_RGBA8*/, 179 /*MTLPixelFormatEAC_RGBA8_sRGB*/ }, // ETC2A
+ { 182 /*MTLPixelFormatETC2_RGB8A1*/, 183 /*MTLPixelFormatETC2_RGB8A1_sRGB*/ }, // ETC2A1
+ { 160 /*MTLPixelFormatPVRTC_RGB_2BPP*/, 161 /*MTLPixelFormatPVRTC_RGB_2BPP_sRGB*/ }, // PTC12
+ { 162 /*MTLPixelFormatPVRTC_RGB_4BPP*/, 163 /*MTLPixelFormatPVRTC_RGB_4BPP_sRGB*/ }, // PTC14
+ { 164 /*MTLPixelFormatPVRTC_RGBA_2BPP*/, 165 /*MTLPixelFormatPVRTC_RGBA_2BPP_sRGB*/ }, // PTC12A
+ { 166 /*MTLPixelFormatPVRTC_RGBA_4BPP*/, 167 /*MTLPixelFormatPVRTC_RGBA_4BPP_sRGB*/ }, // PTC14A
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // PTC22
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // PTC24
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // Unknown
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // R1
+ { MTLPixelFormatA8Unorm, MTLPixelFormatInvalid }, // A8
+ { MTLPixelFormatR8Unorm, 11 /*MTLPixelFormatR8Unorm_sRGB*/ }, // R8
+ { MTLPixelFormatR8Sint, MTLPixelFormatInvalid }, // R8I
+ { MTLPixelFormatR8Uint, MTLPixelFormatInvalid }, // R8U
+ { MTLPixelFormatR8Snorm, MTLPixelFormatInvalid }, // R8S
+ { MTLPixelFormatR16Unorm, MTLPixelFormatInvalid }, // R16
+ { MTLPixelFormatR16Sint, MTLPixelFormatInvalid }, // R16I
+ { MTLPixelFormatR16Uint, MTLPixelFormatInvalid }, // R16U
+ { MTLPixelFormatR16Float, MTLPixelFormatInvalid }, // R16F
+ { MTLPixelFormatR16Snorm, MTLPixelFormatInvalid }, // R16S
+ { MTLPixelFormatR32Sint, MTLPixelFormatInvalid }, // R32I
+ { MTLPixelFormatR32Uint, MTLPixelFormatInvalid }, // R32U
+ { MTLPixelFormatR32Float, MTLPixelFormatInvalid }, // R32F
+ { MTLPixelFormatRG8Unorm, 31 /*MTLPixelFormatRG8Unorm_sRGB*/ }, // RG8
+ { MTLPixelFormatRG8Sint, MTLPixelFormatInvalid }, // RG8I
+ { MTLPixelFormatRG8Uint, MTLPixelFormatInvalid }, // RG8U
+ { MTLPixelFormatRG8Snorm, MTLPixelFormatInvalid }, // RG8S
+ { MTLPixelFormatRG16Unorm, MTLPixelFormatInvalid }, // RG16
+ { MTLPixelFormatRG16Sint, MTLPixelFormatInvalid }, // RG16I
+ { MTLPixelFormatRG16Uint, MTLPixelFormatInvalid }, // RG16U
+ { MTLPixelFormatRG16Float, MTLPixelFormatInvalid }, // RG16F
+ { MTLPixelFormatRG16Snorm, MTLPixelFormatInvalid }, // RG16S
+ { MTLPixelFormatRG32Sint, MTLPixelFormatInvalid }, // RG32I
+ { MTLPixelFormatRG32Uint, MTLPixelFormatInvalid }, // RG32U
+ { MTLPixelFormatRG32Float, MTLPixelFormatInvalid }, // RG32F
+ { MTLPixelFormatRGB9E5Float, MTLPixelFormatInvalid }, // RGB9E5F
+ { MTLPixelFormatBGRA8Unorm, MTLPixelFormatBGRA8Unorm_sRGB }, // BGRA8
+ { MTLPixelFormatRGBA8Unorm, MTLPixelFormatRGBA8Unorm_sRGB }, // RGBA8
+ { MTLPixelFormatRGBA8Sint, MTLPixelFormatInvalid }, // RGBA8I
+ { MTLPixelFormatRGBA8Uint, MTLPixelFormatInvalid }, // RGBA8U
+ { MTLPixelFormatRGBA8Snorm, MTLPixelFormatInvalid }, // RGBA8S
+ { MTLPixelFormatRGBA16Unorm, MTLPixelFormatInvalid }, // RGBA16
+ { MTLPixelFormatRGBA16Sint, MTLPixelFormatInvalid }, // RGBA16I
+ { MTLPixelFormatRGBA16Uint, MTLPixelFormatInvalid }, // RGBA16I
+ { MTLPixelFormatRGBA16Float, MTLPixelFormatInvalid }, // RGBA16F
+ { MTLPixelFormatRGBA16Snorm, MTLPixelFormatInvalid }, // RGBA16S
+ { MTLPixelFormatRGBA32Sint, MTLPixelFormatInvalid }, // RGBA32I
+ { MTLPixelFormatRGBA32Uint, MTLPixelFormatInvalid }, // RGBA32U
+ { MTLPixelFormatRGBA32Float, MTLPixelFormatInvalid }, // RGBA32F
+ { 40 /*MTLPixelFormatB5G6R5Unorm*/, MTLPixelFormatInvalid }, // R5G6B5
+ { 42 /*MTLPixelFormatABGR4Unorm*/, MTLPixelFormatInvalid }, // RGBA4
+ { 41 /*MTLPixelFormatA1BGR5Unorm*/, MTLPixelFormatInvalid }, // RGB5A1
+ { MTLPixelFormatRGB10A2Unorm, MTLPixelFormatInvalid }, // RGB10A2
+ { MTLPixelFormatRG11B10Float, MTLPixelFormatInvalid }, // R11G11B10F
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // UnknownDepth
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D16
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D24
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // D24S8
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D32
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D16F
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D24F
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D32F
+ { MTLPixelFormatStencil8, MTLPixelFormatInvalid }, // D0S8
+ };
+ BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
+
+ #define SHADER_FUNCTION_NAME ("xlatMtlMain")
+ #define SHADER_UNIFORM_NAME ("_mtl_u")
+
+ struct RendererContextMtl : public RendererContextI
+ {
+ RendererContextMtl()
+ : m_metalLayer(NULL)
+ , m_backBufferPixelFormatHash(0)
+ , m_maxAnisotropy(1)
+ , m_numWindows(1)
+ , m_rtMsaa(false)
+ , m_drawable(NULL)
+ {
+ m_fbh.idx = invalidHandle;
+ }
+
+ ~RendererContextMtl()
+ {
+ }
+
+ bool init()
+ {
+ BX_TRACE("Init.");
+
+ if (NULL != NSClassFromString(@"CAMetalLayer") )
+ {
+ //on iOS we need the layer as CAmetalLayer
+#if BX_PLATFORM_IOS
+ CAMetalLayer* metalLayer = (CAMetalLayer*)g_platformData.nwh;
+ if (NULL == metalLayer
+ || ![metalLayer isKindOfClass:NSClassFromString(@"CAMetalLayer")])
+ {
+ BX_WARN(NULL != m_device, "Unable to create Metal device. Please set platform data window to a CAMetalLayer");
+ return false;
+ }
+ m_metalLayer = metalLayer;
+#elif BX_PLATFORM_OSX
+ // create and set metalLayer
+ NSWindow* nsWindow = (NSWindow*)g_platformData.nwh;
+
+ [nsWindow.contentView setWantsLayer:YES];
+ m_metalLayer = [CAMetalLayer layer];
+ [nsWindow.contentView setLayer:m_metalLayer];
+#endif // BX_PLATFORM_*
+
+ m_device = (id<MTLDevice>)g_platformData.context;
+
+ if (NULL == m_device)
+ {
+ m_device = MTLCreateSystemDefaultDevice();
+ }
+ }
+
+ if (NULL == m_device
+ || NULL == m_metalLayer)
+ {
+ BX_WARN(NULL != m_device, "Unable to create Metal device.");
+ return false;
+ }
+
+ m_metalLayer.device = m_device;
+ m_metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm;
+
+ m_commandQueue = m_device.newCommandQueue();
+ BGFX_FATAL(NULL != m_commandQueue, Fatal::UnableToInitialize, "Unable to create Metal device.");
+
+ m_renderPipelineDescriptor = newRenderPipelineDescriptor();
+ m_depthStencilDescriptor = newDepthStencilDescriptor();
+ m_frontFaceStencilDescriptor = newStencilDescriptor();
+ m_backFaceStencilDescriptor = newStencilDescriptor();
+ m_vertexDescriptor = newVertexDescriptor();
+ m_textureDescriptor = newTextureDescriptor();
+ m_samplerDescriptor = newSamplerDescriptor();
+
+ m_uniformBuffer = m_device.newBufferWithLength(UNIFORM_BUFFER_SIZE, 0);
+ m_uniformBufferVertexOffset = 0;
+ m_uniformBufferFragmentOffset = 0;
+
+ memset(m_uniforms, 0, sizeof(m_uniforms) );
+
+ g_caps.supported |= (0
+ | BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
+ | BGFX_CAPS_TEXTURE_3D
+ | BGFX_CAPS_INSTANCING
+ | BGFX_CAPS_VERTEX_ATTRIB_HALF
+// | BGFX_CAPS_FRAGMENT_DEPTH
+ | BGFX_CAPS_BLEND_INDEPENDENT
+ | BGFX_CAPS_COMPUTE
+ | BGFX_CAPS_INDEX32
+ | BGFX_CAPS_DRAW_INDIRECT
+ );
+
+ g_caps.maxTextureSize = 2048; //ASK: real caps width/height: 4096, but max depth(3D) size is only: 2048
+ g_caps.maxFBAttachments = 4; // uint8_t(bx::uint32_min(m_device.supportsFeatureSet(MTLFeatureSet_iOS_GPUFamily2_v1) ? 8 : 4, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS));
+
+ //todo: vendor id, device id, gpu enum
+ //todo: texture format caps
+
+ //add texture formats/caps/etc that are available only on new sdk/devices
+#if BX_PLATFORM_IOS
+# ifdef __IPHONE_8_0
+ if (OsVersionEqualOrGreater("8.0.0"))
+ {
+ s_textureFormat[TextureFormat::D24S8].m_fmt = MTLPixelFormatDepth32Float;
+ }
+# endif // __IPHONE_8_0
+#endif // BX_PLATFORM_*
+
+ for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
+ {
+ uint8_t support = (s_textureFormat[ii].m_fmt != MTLPixelFormatInvalid) ? BGFX_CAPS_FORMAT_TEXTURE_COLOR : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ support |= (s_textureFormat[ii].m_fmtSrgb != MTLPixelFormatInvalid) ? BGFX_CAPS_FORMAT_TEXTURE_COLOR_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ //TODO: additional caps flags
+// support |= BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+// support |= BGFX_CAPS_FORMAT_TEXTURE_IMAGE : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+// support |= BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
+
+ g_caps.formats[ii] = support;
+ }
+
+ // Init reserved part of view name.
+ for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
+ {
+ bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1, "%3d ", ii);
+ }
+
+ return true;
+ }
+
+ void shutdown()
+ {
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_shaders); ++ii)
+ {
+ m_shaders[ii].destroy();
+ }
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
+ {
+ m_textures[ii].destroy();
+ }
+
+ MTL_RELEASE(m_depthStencilDescriptor);
+ MTL_RELEASE(m_frontFaceStencilDescriptor);
+ MTL_RELEASE(m_backFaceStencilDescriptor);
+ MTL_RELEASE(m_renderPipelineDescriptor);
+ MTL_RELEASE(m_vertexDescriptor);
+ MTL_RELEASE(m_textureDescriptor);
+ MTL_RELEASE(m_samplerDescriptor);
+
+ MTL_RELEASE(m_backBufferDepth);
+#if BX_PLATFORM_IOS
+ MTL_RELEASE(m_backBufferStencil);
+#endif // BX_PLATFORM_*
+
+ MTL_RELEASE(m_uniformBuffer);
+ MTL_RELEASE(m_commandQueue);
+ MTL_RELEASE(m_device);
+ }
+
+ RendererType::Enum getRendererType() const BX_OVERRIDE
+ {
+ return RendererType::Metal;
+ }
+
+ const char* getRendererName() const BX_OVERRIDE
+ {
+ return BGFX_RENDERER_METAL_NAME;
+ }
+
+ void createIndexBuffer(IndexBufferHandle _handle, Memory* _mem, uint16_t _flags) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].create(_mem->size, _mem->data, _flags);
+ }
+
+ void destroyIndexBuffer(IndexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].destroy();
+ }
+
+ void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) BX_OVERRIDE
+ {
+ VertexDecl& decl = m_vertexDecls[_handle.idx];
+ memcpy(&decl, &_decl, sizeof(VertexDecl) );
+ dump(decl);
+ }
+
+ void destroyVertexDecl(VertexDeclHandle /*_handle*/) BX_OVERRIDE
+ {
+ }
+
+ void createVertexBuffer(VertexBufferHandle _handle, Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
+ }
+
+ void destroyVertexBuffer(VertexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].destroy();
+ }
+
+ void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].create(_size, NULL, _flags);
+ }
+
+ void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, Memory* _mem) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data);
+ }
+
+ void destroyDynamicIndexBuffer(IndexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_indexBuffers[_handle.idx].destroy();
+ }
+
+ void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) BX_OVERRIDE
+ {
+ VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+ m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
+ }
+
+ void updateDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _offset, uint32_t _size, Memory* _mem) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].update(_offset, bx::uint32_min(_size, _mem->size), _mem->data);
+ }
+
+ void destroyDynamicVertexBuffer(VertexBufferHandle _handle) BX_OVERRIDE
+ {
+ m_vertexBuffers[_handle.idx].destroy();
+ }
+
+ void createShader(ShaderHandle _handle, Memory* _mem) BX_OVERRIDE
+ {
+ m_shaders[_handle.idx].create(_mem);
+ }
+
+ void destroyShader(ShaderHandle _handle) BX_OVERRIDE
+ {
+ m_shaders[_handle.idx].destroy();
+ }
+
+ void createProgram(ProgramHandle _handle, ShaderHandle _vsh, ShaderHandle _fsh) BX_OVERRIDE
+ {
+ m_program[_handle.idx].create(&m_shaders[_vsh.idx], &m_shaders[_fsh.idx]);
+ }
+
+ void destroyProgram(ProgramHandle _handle) BX_OVERRIDE
+ {
+ m_program[_handle.idx].destroy();
+ }
+
+ void createTexture(TextureHandle _handle, Memory* _mem, uint32_t _flags, uint8_t _skip) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].create(_mem, _flags, _skip);
+ }
+
+ void updateTextureBegin(TextureHandle /*_handle*/, uint8_t /*_side*/, uint8_t /*_mip*/) BX_OVERRIDE
+ {
+ }
+
+ void updateTexture(TextureHandle _handle, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].update(_side, _mip, _rect, _z, _depth, _pitch, _mem);
+ }
+
+ void updateTextureEnd() BX_OVERRIDE
+ {
+ }
+
+ void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height) BX_OVERRIDE
+ {
+ TextureMtl& texture = m_textures[_handle.idx];
+
+ uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate);
+ const Memory* mem = alloc(size);
+
+ bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
+ uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
+ bx::write(&writer, magic);
+
+ TextureCreate tc;
+ tc.m_flags = texture.m_flags;
+ tc.m_width = _width;
+ tc.m_height = _height;
+ tc.m_sides = 0;
+ tc.m_depth = 0;
+ tc.m_numMips = 1;
+ tc.m_format = texture.m_requestedFormat;
+ tc.m_cubeMap = false;
+ tc.m_mem = NULL;
+ bx::write(&writer, tc);
+
+ texture.destroy();
+ texture.create(mem, tc.m_flags, 0);
+
+ release(mem);
+ }
+
+ void destroyTexture(TextureHandle _handle) BX_OVERRIDE
+ {
+ m_textures[_handle.idx].destroy();
+ }
+
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ {
+ m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ }
+
+ void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
+ {
+ uint16_t denseIdx = m_numWindows++;
+ m_windows[denseIdx] = _handle;
+ m_frameBuffers[_handle.idx].create(denseIdx, _nwh, _width, _height, _depthFormat);
+ }
+
+ void destroyFrameBuffer(FrameBufferHandle _handle) BX_OVERRIDE
+ {
+ uint16_t denseIdx = m_frameBuffers[_handle.idx].destroy();
+ if (UINT16_MAX != denseIdx)
+ {
+ --m_numWindows;
+ if (m_numWindows > 1)
+ {
+ FrameBufferHandle handle = m_windows[m_numWindows];
+ m_windows[denseIdx] = handle;
+ m_frameBuffers[handle.idx].m_denseIdx = denseIdx;
+ }
+ }
+ }
+
+ void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) BX_OVERRIDE
+ {
+ if (NULL != m_uniforms[_handle.idx])
+ {
+ BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ }
+
+ uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type]*_num);
+ void* data = BX_ALLOC(g_allocator, size);
+ memset(data, 0, size);
+ m_uniforms[_handle.idx] = data;
+ m_uniformReg.add(_handle, _name, data);
+ }
+
+ void destroyUniform(UniformHandle _handle) BX_OVERRIDE
+ {
+ BX_FREE(g_allocator, m_uniforms[_handle.idx]);
+ m_uniforms[_handle.idx] = NULL;
+ }
+
+ void saveScreenShot(const char* _filePath) BX_OVERRIDE
+ {
+ if (NULL == m_drawable
+ || NULL == m_drawable.texture)
+ {
+ return;
+ }
+
+ //TODO: we should wait for completion of pending commandBuffers
+ //TODO: implement this with saveScreenshotBegin/End
+
+ Texture backBuffer = m_drawable.texture;
+ uint32_t width = backBuffer.width();
+ uint32_t height = backBuffer.height();
+ uint32_t length = width*height*4;
+ uint8_t* data = (uint8_t*)BX_ALLOC(g_allocator, length);
+
+ MTLRegion region = { { 0, 0, 0 }, { width, height, 1 } };
+
+ backBuffer.getBytes(data, 4*width, 0, region, 0, 0);
+
+ g_callback->screenShot(_filePath
+ , backBuffer.width()
+ , backBuffer.height()
+ , width*4
+ , data
+ , length
+ , false
+ );
+
+ BX_FREE(g_allocator, data);
+ }
+
+ void updateViewName(uint8_t _id, const char* _name) BX_OVERRIDE
+ {
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) )
+ {
+ bx::strlcpy(&s_viewName[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED]
+ , _name
+ , BX_COUNTOF(s_viewName[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED
+ );
+ }
+ }
+
+ void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE
+ {
+ memcpy(m_uniforms[_loc], _data, _size);
+ }
+
+ void setMarker(const char* _marker, uint32_t /*_size*/) BX_OVERRIDE
+ {
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_MTL) )
+ {
+ m_renderCommandEncoder.insertDebugSignpost(_marker);
+ }
+ }
+
+ void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) BX_OVERRIDE;
+
+ void blitSetup(TextVideoMemBlitter& _blitter) BX_OVERRIDE
+ {
+ RenderCommandEncoder rce = m_renderCommandEncoder;
+
+ uint32_t width = getBufferWidth();
+ uint32_t height = getBufferHeight();
+
+ //if (m_ovr.isEnabled() )
+ //{
+ // m_ovr.getSize(width, height);
+ //}
+
+ FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
+ //TODO: change to default framebuffer - we need a new encoder for this!
+ //setFrameBuffer(fbh, false);
+
+ MTLViewport viewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f};
+ rce.setViewport(viewport);
+ MTLScissorRect rc = { 0,0,width,height };
+ rce.setScissorRect(rc);
+ rce.setCullMode(MTLCullModeNone);
+
+ uint64_t state = BGFX_STATE_RGB_WRITE
+ | BGFX_STATE_ALPHA_WRITE
+ | BGFX_STATE_DEPTH_TEST_ALWAYS;
+
+ setDepthStencilState(state);
+
+ ProgramMtl& program = m_program[_blitter.m_program.idx];
+ RenderPipelineState pipelineState = program.getRenderPipelineState(state, 0, fbh, _blitter.m_vb->decl, 0);
+ rce.setRenderPipelineState(pipelineState);
+
+ uint32_t vertexUniformBufferSize = program.m_vshConstantBufferSize;
+ uint32_t fragmentUniformBufferSize = program.m_fshConstantBufferSize;
+
+ if (vertexUniformBufferSize )
+ {
+ m_uniformBufferVertexOffset = BX_ALIGN_MASK(m_uniformBufferVertexOffset, program.m_vshConstantBufferAlignmentMask);
+ rce.setVertexBuffer(m_uniformBuffer, m_uniformBufferVertexOffset, 0);
+ }
+
+ m_uniformBufferFragmentOffset = m_uniformBufferVertexOffset + vertexUniformBufferSize;
+ if (fragmentUniformBufferSize )
+ {
+ m_uniformBufferFragmentOffset = BX_ALIGN_MASK(m_uniformBufferFragmentOffset, program.m_fshConstantBufferAlignmentMask);
+ rce.setFragmentBuffer(m_uniformBuffer, m_uniformBufferFragmentOffset, 0);
+ }
+
+ VertexBufferMtl& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
+ rce.setVertexBuffer(vb.m_buffer, 0, 1);
+
+ float proj[16];
+ bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
+
+ PredefinedUniform& predefined = program.m_predefined[0];
+ uint8_t flags = predefined.m_type;
+ setShaderUniform(flags, predefined.m_loc, proj, 4);
+
+ m_textures[_blitter.m_texture.idx].commit(0);
+ }
+
+ void blitRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) BX_OVERRIDE
+ {
+ const uint32_t numVertices = _numIndices*4/6;
+ if (0 < numVertices)
+ {
+ m_indexBuffers [_blitter.m_ib->handle.idx].update(0, _numIndices*2, _blitter.m_ib->data);
+ m_vertexBuffers[_blitter.m_vb->handle.idx].update(0, numVertices*_blitter.m_decl.m_stride, _blitter.m_vb->data, true);
+
+ m_renderCommandEncoder.drawIndexedPrimitives(MTLPrimitiveTypeTriangle, _numIndices, MTLIndexTypeUInt16, m_indexBuffers[_blitter.m_ib->handle.idx].m_buffer, 0, 1);
+ }
+ }
+
+ void flip(HMD& /*_hmd*/) BX_OVERRIDE
+ {
+ if (NULL == m_drawable
+ || NULL == m_commandBuffer)
+ {
+ return;
+ }
+
+ // Present and commit the command buffer
+ m_commandBuffer.presentDrawable(m_drawable);
+ MTL_RELEASE(m_drawable);
+
+ m_commandBuffer.commit();
+
+ // using heavy syncing now
+ // TODO: refactor it with double/triple buffering frame data
+ m_commandBuffer.waitUntilCompleted();
+
+ MTL_RELEASE(m_commandBuffer);
+
+ //TODO: support multiple windows on OSX
+ /*
+ if (m_flip)
+ {
+ for (uint32_t ii = 1, num = m_numWindows; ii < num; ++ii)
+ {
+ m_glctx.swap(m_frameBuffers[m_windows[ii].idx].m_swapChain);
+ }
+
+ if (!m_ovr.swap(_hmd) )
+ {
+ m_glctx.swap();
+ }
+ }
+ */
+ }
+
+ void updateResolution(const Resolution& _resolution)
+ {
+ m_maxAnisotropy = !!(_resolution.m_flags & BGFX_RESET_MAXANISOTROPY)
+ ? 16
+ : 1
+ ;
+
+ //TODO: _resolution has wrong dimensions, using m_drawable.texture size now
+ if (NULL == m_drawable.texture)
+ {
+ return;
+ }
+
+ uint32_t width = (uint32_t)m_drawable.texture.width;
+ uint32_t height = (uint32_t)m_drawable.texture.height;
+
+ //TODO: there should be a way to specify if backbuffer needs stencil/depth.
+ //TODO: support msaa
+ if (NULL == m_backBufferDepth
+ || width != m_backBufferDepth.width()
+ || height != m_backBufferDepth.height() )
+ {
+ m_textureDescriptor.textureType = MTLTextureType2D;
+
+ m_textureDescriptor.pixelFormat = MTLPixelFormatDepth32Float_Stencil8;
+
+ m_textureDescriptor.width = width;
+ m_textureDescriptor.height = height;
+ m_textureDescriptor.depth = 1;
+ m_textureDescriptor.mipmapLevelCount = 1;
+ m_textureDescriptor.sampleCount = 1;
+ m_textureDescriptor.arrayLength = 1;
+ m_textureDescriptor.resourceOptions = MTLResourceStorageModePrivate;
+ m_textureDescriptor.cpuCacheMode = MTLCPUCacheModeDefaultCache;
+ m_textureDescriptor.storageMode = MTLStorageModePrivate;
+ m_textureDescriptor.usage = MTLTextureUsageRenderTarget;
+
+ if (NULL != m_backBufferDepth)
+ {
+ release(m_backBufferDepth);
+ }
+ m_backBufferDepth = m_device.newTextureWithDescriptor(m_textureDescriptor);
+
+#if 0
+ m_textureDescriptor.pixelFormat = MTLPixelFormatStencil8;
+
+ if (NULL != m_backBufferStencil)
+ {
+ release(m_backBufferStencil);
+ }
+
+ m_backBufferStencil = m_device.newTextureWithDescriptor(m_textureDescriptor);
+#else
+ m_backBufferStencil = m_backBufferDepth;
+#endif // 0
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(1);
+ murmur.add((uint32_t)m_drawable.texture.pixelFormat);
+ murmur.add((uint32_t)m_backBufferDepth.pixelFormat());
+ murmur.add((uint32_t)m_backBufferStencil.pixelFormat());
+ m_backBufferPixelFormatHash = murmur.end();
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii)
+ {
+ m_frameBuffers[ii].postReset();
+ }
+
+ m_textVideoMem.resize(false, width, height);
+ m_textVideoMem.clear();
+ }
+ }
+
+ void setShaderUniform(uint8_t _flags, uint32_t _loc, const void* _val, uint32_t _numRegs)
+ {
+ if (_flags&BGFX_UNIFORM_FRAGMENTBIT)
+ {
+ memcpy(&((char*)m_uniformBuffer.contents())[m_uniformBufferFragmentOffset + _loc], _val, _numRegs*16);
+ }
+ else
+ {
+ memcpy(&((char*)m_uniformBuffer.contents())[m_uniformBufferVertexOffset + _loc], _val, _numRegs*16);
+ }
+ }
+
+ void setShaderUniform4f(uint8_t _flags, uint32_t _loc, const void* _val, uint32_t _numRegs)
+ {
+ setShaderUniform(_flags, _loc, _val, _numRegs);
+ }
+
+ void setShaderUniform4x4f(uint8_t _flags, uint32_t _loc, const void* _val, uint32_t _numRegs)
+ {
+ setShaderUniform(_flags, _loc, _val, _numRegs);
+ }
+
+ void commit(UniformBuffer& _uniformBuffer)
+ {
+ _uniformBuffer.reset();
+
+ for (;;)
+ {
+ uint32_t opcode = _uniformBuffer.read();
+
+ if (UniformType::End == opcode)
+ {
+ break;
+ }
+
+ UniformType::Enum type;
+ uint16_t loc;
+ uint16_t num;
+ uint16_t copy;
+ UniformBuffer::decodeOpcode(opcode, type, loc, num, copy);
+
+ const char* data;
+ if (copy)
+ {
+ data = _uniformBuffer.read(g_uniformTypeSize[type]*num);
+ }
+ else
+ {
+ UniformHandle handle;
+ memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
+ data = (const char*)m_uniforms[handle.idx];
+ }
+
+#define CASE_IMPLEMENT_UNIFORM(_uniform, _dxsuffix, _type) \
+ case UniformType::_uniform: \
+ case UniformType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
+ { \
+ setShaderUniform(uint8_t(type), loc, data, num); \
+ } \
+ break;
+
+ switch ( (uint32_t)type)
+ {
+ case UniformType::Mat3:
+ case UniformType::Mat3|BGFX_UNIFORM_FRAGMENTBIT: \
+ {
+ float* value = (float*)data;
+ for (uint32_t ii = 0, count = num/3; ii < count; ++ii, loc += 3*16, value += 9)
+ {
+ Matrix4 mtx;
+ mtx.un.val[ 0] = value[0];
+ mtx.un.val[ 1] = value[1];
+ mtx.un.val[ 2] = value[2];
+ mtx.un.val[ 3] = 0.0f;
+ mtx.un.val[ 4] = value[3];
+ mtx.un.val[ 5] = value[4];
+ mtx.un.val[ 6] = value[5];
+ mtx.un.val[ 7] = 0.0f;
+ mtx.un.val[ 8] = value[6];
+ mtx.un.val[ 9] = value[7];
+ mtx.un.val[10] = value[8];
+ mtx.un.val[11] = 0.0f;
+ setShaderUniform(uint8_t(type), loc, &mtx.un.val[0], 3);
+ }
+ }
+ break;
+
+ CASE_IMPLEMENT_UNIFORM(Int1, I, int);
+ CASE_IMPLEMENT_UNIFORM(Vec4, F, float);
+ CASE_IMPLEMENT_UNIFORM(Mat4, F, float);
+
+ case UniformType::End:
+ break;
+
+ default:
+ BX_TRACE("%4d: INVALID 0x%08x, t %d, l %d, n %d, c %d", _uniformBuffer.getPos(), opcode, type, loc, num, copy);
+ break;
+ }
+
+#undef CASE_IMPLEMENT_UNIFORM
+
+ }
+ }
+
+ void setFrameBuffer(mtl::RenderPassDescriptor renderPassDescriptor, FrameBufferHandle _fbh, bool _msaa = true)
+ {
+ if (!isValid(_fbh) )
+ {
+ renderPassDescriptor.colorAttachments[0].texture = m_drawable.texture;
+ renderPassDescriptor.depthAttachment.texture = m_backBufferDepth;
+ renderPassDescriptor.stencilAttachment.texture = m_backBufferStencil;
+
+ //todo: set resolve textures
+ }
+ else
+ {
+ FrameBufferMtl& frameBuffer = m_frameBuffers[_fbh.idx];
+
+ for (uint32_t ii = 0; ii < frameBuffer.m_num; ++ii)
+ {
+ const TextureMtl& texture = m_textures[frameBuffer.m_colorHandle[ii].idx];
+ renderPassDescriptor.colorAttachments[ii].texture = texture.m_ptr;
+ }
+
+ if (isValid(frameBuffer.m_depthHandle))
+ {
+ const TextureMtl& texture = m_textures[frameBuffer.m_depthHandle.idx];
+ renderPassDescriptor.depthAttachment.texture = texture.m_ptr;
+ renderPassDescriptor.stencilAttachment.texture = texture.m_ptrStencil;
+ //TODO: stencilAttachment should be the same if packed/depth stencil format is used
+ }
+
+ //todo: set resolve textures
+ }
+
+ m_fbh = _fbh;
+ m_rtMsaa = _msaa;
+ }
+
+ void setDepthStencilState(uint64_t _state, uint64_t _stencil = 0)
+ {
+ _state &= BGFX_STATE_DEPTH_WRITE|BGFX_STATE_DEPTH_TEST_MASK;
+ uint32_t fstencil = unpackStencil(0, _stencil);
+ uint32_t ref = (fstencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
+ _stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, BGFX_STENCIL_MASK);
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_state);
+ murmur.add(_stencil);
+ uint32_t hash = murmur.end();
+
+ DepthStencilState dss = m_depthStencilStateCache.find(hash);
+ if (NULL == dss)
+ {
+ DepthStencilDescriptor desc = m_depthStencilDescriptor;
+ uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
+ desc.depthWriteEnabled = !!(BGFX_STATE_DEPTH_WRITE & _state);
+ desc.depthCompareFunction = s_cmpFunc[func];
+
+ uint32_t bstencil = unpackStencil(1, _stencil);
+ uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil;
+ bstencil = frontAndBack ? bstencil : fstencil;
+
+ if (0 != _stencil)
+ {
+ StencilDescriptor frontFaceDesc = m_frontFaceStencilDescriptor;
+ StencilDescriptor backfaceDesc = m_backFaceStencilDescriptor;
+
+ uint32_t readMask = (fstencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT;
+ uint32_t writeMask = 0xff;
+
+ frontFaceDesc.stencilFailureOperation = s_stencilOp[(fstencil&BGFX_STENCIL_OP_FAIL_S_MASK)>>BGFX_STENCIL_OP_FAIL_S_SHIFT];
+ frontFaceDesc.depthFailureOperation = s_stencilOp[(fstencil&BGFX_STENCIL_OP_FAIL_Z_MASK)>>BGFX_STENCIL_OP_FAIL_Z_SHIFT];
+ frontFaceDesc.depthStencilPassOperation = s_stencilOp[(fstencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT];
+ frontFaceDesc.stencilCompareFunction = s_cmpFunc[(fstencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT];
+ frontFaceDesc.readMask = readMask;
+ frontFaceDesc.writeMask = writeMask;
+
+ backfaceDesc.stencilFailureOperation = s_stencilOp[(bstencil&BGFX_STENCIL_OP_FAIL_S_MASK)>>BGFX_STENCIL_OP_FAIL_S_SHIFT];
+ backfaceDesc.depthFailureOperation = s_stencilOp[(bstencil&BGFX_STENCIL_OP_FAIL_Z_MASK)>>BGFX_STENCIL_OP_FAIL_Z_SHIFT];
+ backfaceDesc.depthStencilPassOperation = s_stencilOp[(bstencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT];
+ backfaceDesc.stencilCompareFunction = s_cmpFunc[(bstencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT];
+ backfaceDesc.readMask = readMask;
+ backfaceDesc.writeMask = writeMask;
+
+ desc.frontFaceStencil = frontFaceDesc;
+ desc.backFaceStencil = backfaceDesc;
+ }
+ else
+ {
+ desc.backFaceStencil = NULL;
+ desc.frontFaceStencil = NULL;
+ }
+
+ dss = m_device.newDepthStencilStateWithDescriptor(desc);
+
+ m_depthStencilStateCache.add(hash, dss);
+ }
+
+ m_renderCommandEncoder.setDepthStencilState(dss);
+ m_renderCommandEncoder.setStencilReferenceValue(ref);
+ }
+
+ SamplerState getSamplerState(uint32_t _flags)
+ {
+ _flags &= BGFX_TEXTURE_SAMPLER_BITS_MASK;
+ SamplerState sampler = m_samplerStateCache.find(_flags);
+ if (NULL == sampler)
+ {
+
+ m_samplerDescriptor.sAddressMode = s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
+ m_samplerDescriptor.tAddressMode = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
+ m_samplerDescriptor.rAddressMode = s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT];
+ m_samplerDescriptor.minFilter = s_textureFilterMinMag[(_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT];
+ m_samplerDescriptor.magFilter = s_textureFilterMinMag[(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT];
+ m_samplerDescriptor.mipFilter = s_textureFilterMip[(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT];
+ m_samplerDescriptor.lodMinClamp = 0;
+ m_samplerDescriptor.lodMaxClamp = FLT_MAX;
+ m_samplerDescriptor.normalizedCoordinates = TRUE;
+ m_samplerDescriptor.maxAnisotropy = m_maxAnisotropy;
+
+ //TODO: I haven't found how to specify this. Comparison function can be specified in shader.
+ // On OSX this can be specified. There is no support for this on iOS right now.
+ //const uint32_t cmpFunc = (_flags&BGFX_TEXTURE_COMPARE_MASK)>>BGFX_TEXTURE_COMPARE_SHIFT;
+ //const uint8_t filter = 0 == cmpFunc ? 0 : D3D11_COMPARISON_FILTERING_BIT;
+ //m_samplerDescriptor.comparisonFunc = 0 == cmpFunc ? D3D11_COMPARISON_NEVER : s_cmpFunc[cmpFunc];
+
+ sampler = m_device.newSamplerStateWithDescriptor(m_samplerDescriptor);
+ m_samplerStateCache.add(_flags, sampler);
+ }
+
+ return sampler;
+ }
+
+ uint32_t getBufferWidth()
+ {
+ return m_backBufferDepth.width();
+ }
+
+ uint32_t getBufferHeight()
+ {
+ return m_backBufferDepth.height();
+ }
+
+ Device m_device;
+ CommandQueue m_commandQueue;
+ CAMetalLayer* m_metalLayer;
+ Texture m_backBufferDepth;
+ Texture m_backBufferStencil;
+ uint32_t m_backBufferPixelFormatHash;
+ uint32_t m_maxAnisotropy;
+
+ Buffer m_uniformBuffer; //todo: use a pool of this
+ uint32_t m_uniformBufferVertexOffset;
+ uint32_t m_uniformBufferFragmentOffset;
+
+ uint16_t m_numWindows;
+ FrameBufferHandle m_windows[BGFX_CONFIG_MAX_FRAME_BUFFERS];
+
+ IndexBufferMtl m_indexBuffers[BGFX_CONFIG_MAX_INDEX_BUFFERS];
+ VertexBufferMtl m_vertexBuffers[BGFX_CONFIG_MAX_VERTEX_BUFFERS];
+ ShaderMtl m_shaders[BGFX_CONFIG_MAX_SHADERS];
+ ProgramMtl m_program[BGFX_CONFIG_MAX_PROGRAMS];
+ TextureMtl m_textures[BGFX_CONFIG_MAX_TEXTURES];
+ FrameBufferMtl m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
+ VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+ UniformRegistry m_uniformReg;
+ void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
+
+ StateCacheT<DepthStencilState> m_depthStencilStateCache;
+ StateCacheT<SamplerState> m_samplerStateCache;
+
+ TextVideoMem m_textVideoMem;
+
+ FrameBufferHandle m_fbh;
+ bool m_rtMsaa;
+
+ // descriptors
+ RenderPipelineDescriptor m_renderPipelineDescriptor;
+ DepthStencilDescriptor m_depthStencilDescriptor;
+ StencilDescriptor m_frontFaceStencilDescriptor;
+ StencilDescriptor m_backFaceStencilDescriptor;
+ VertexDescriptor m_vertexDescriptor;
+ TextureDescriptor m_textureDescriptor;
+ SamplerDescriptor m_samplerDescriptor;
+
+ // currently active objects data
+ id <CAMetalDrawable> m_drawable;
+ CommandBuffer m_commandBuffer;
+ RenderCommandEncoder m_renderCommandEncoder;
+};
+
+ static RendererContextMtl* s_renderMtl;
+
+ RendererContextI* rendererCreate()
+ {
+ s_renderMtl = BX_NEW(g_allocator, RendererContextMtl);
+ if (!s_renderMtl->init())
+ {
+ BX_DELETE(g_allocator, s_renderMtl);
+ s_renderMtl = NULL;
+ }
+ return s_renderMtl;
+ }
+
+ void rendererDestroy()
+ {
+ s_renderMtl->shutdown();
+ BX_DELETE(g_allocator, s_renderMtl);
+ s_renderMtl = NULL;
+ }
+
+ void writeString(bx::WriterI* _writer, const char* _str)
+ {
+ bx::write(_writer, _str, (int32_t)strlen(_str) );
+ }
+
+ void ShaderMtl::create(const Memory* _mem)
+ {
+ bx::MemoryReader reader(_mem->data, _mem->size);
+
+ uint32_t magic;
+ bx::read(&reader, magic);
+
+ switch (magic)
+ {
+ case BGFX_CHUNK_MAGIC_CSH:
+ case BGFX_CHUNK_MAGIC_FSH:
+ case BGFX_CHUNK_MAGIC_VSH:
+ break;
+
+ default:
+ BGFX_FATAL(false, Fatal::InvalidShader, "Unknown shader format %x.", magic);
+ break;
+ }
+
+ //bool fragment = BGFX_CHUNK_MAGIC_FSH == magic;
+
+ uint32_t iohash;
+ bx::read(&reader, iohash);
+
+ uint16_t count;
+ bx::read(&reader, count);
+
+ BX_TRACE("%s Shader consts %d"
+ , BGFX_CHUNK_MAGIC_FSH == magic ? "Fragment" : BGFX_CHUNK_MAGIC_VSH == magic ? "Vertex" : "Compute"
+ , count
+ );
+
+ for (uint32_t ii = 0; ii < count; ++ii)
+ {
+ uint8_t nameSize;
+ bx::read(&reader, nameSize);
+
+ char name[256];
+ bx::read(&reader, &name, nameSize);
+ name[nameSize] = '\0';
+
+ uint8_t type;
+ bx::read(&reader, type);
+
+ uint8_t num;
+ bx::read(&reader, num);
+
+ uint16_t regIndex;
+ bx::read(&reader, regIndex);
+
+ uint16_t regCount;
+ bx::read(&reader, regCount);
+ }
+
+ uint32_t shaderSize;
+ bx::read(&reader, shaderSize);
+
+ const char* code = (const char*)reader.getDataPtr();
+ bx::skip(&reader, shaderSize+1);
+
+ int32_t codeLen = (int32_t)strlen(code);
+ int32_t tempLen = codeLen + (4<<10);
+ char* temp = (char*)alloca(tempLen);
+ bx::StaticMemoryBlockWriter writer(temp, tempLen);
+
+ //TODO: remove this hack. some shaders have problem with half<->float conversion
+ writeString(&writer
+ , "#define half float\n"
+ "#define half2 float2\n"
+ "#define half3 float3\n"
+ "#define half4 float4\n"
+ );
+
+ bx::write(&writer, code, codeLen);
+ bx::write(&writer, '\0');
+ code = temp;
+
+ //TODO: use binary format
+ Library lib = s_renderMtl->m_device.newLibraryWithSource(code);
+
+ if (NULL != lib)
+ {
+ m_function = lib.newFunctionWithName(SHADER_FUNCTION_NAME);
+ }
+
+ BGFX_FATAL(NULL != m_function, bgfx::Fatal::InvalidShader, "Failed to create %s shader."
+ , BGFX_CHUNK_MAGIC_FSH == magic ? "Fragment" : BGFX_CHUNK_MAGIC_VSH == magic ? "Vertex" : "Compute");
+ }
+
+ void ProgramMtl::create(const ShaderMtl* _vsh, const ShaderMtl* _fsh)
+ {
+ BX_CHECK(NULL != _vsh->m_function.m_obj, "Vertex shader doesn't exist.");
+ m_vsh = _vsh;
+
+ if (NULL != _fsh)
+ {
+ BX_CHECK(NULL != _fsh->m_function.m_obj, "Fragment shader doesn't exist.");
+ m_fsh = _fsh;
+ }
+
+ // get attributes
+ memset(m_attributes, 0xff, sizeof(m_attributes) );
+ uint32_t used = 0;
+ uint32_t instUsed = 0;
+ if (NULL != _vsh->m_function.m_obj )
+ {
+ for (MTLVertexAttribute* attrib in _vsh->m_function.m_obj.vertexAttributes)
+ {
+ if (attrib.active )
+ {
+ const char* name = utf8String(attrib.name);
+ uint32_t loc = (uint32_t)attrib.attributeIndex;
+ BX_TRACE("attr %s: %d", name, loc);
+
+ for (uint8_t ii = 0; ii < Attrib::Count; ++ii)
+ {
+ if (!strcmp(s_attribName[ii],name))
+ {
+ m_attributes[ii] = loc;
+ m_used[used++] = ii;
+ break;
+ }
+ }
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_instanceDataName); ++ii)
+ {
+ if (!strcmp(s_instanceDataName[ii],name))
+ {
+ m_instanceData[instUsed++] = loc;
+ }
+ }
+
+ }
+ }
+ }
+ m_used[used] = Attrib::Count;
+ m_instanceData[instUsed] = UINT16_MAX;
+ }
+
+ void ProgramMtl::destroy()
+ {
+ m_vsh = NULL;
+ m_fsh = NULL;
+
+ if (NULL != m_vshConstantBuffer)
+ {
+ UniformBuffer::destroy(m_vshConstantBuffer);
+ m_vshConstantBuffer = NULL;
+ }
+
+ if (NULL != m_fshConstantBuffer)
+ {
+ UniformBuffer::destroy(m_fshConstantBuffer);
+ m_fshConstantBuffer = NULL;
+ }
+
+ m_vshConstantBufferSize = 0;
+ m_vshConstantBufferAlignmentMask = 0;
+ m_fshConstantBufferSize = 0;
+ m_fshConstantBufferAlignmentMask = 0;
+
+ m_processedUniforms = false;
+ m_numPredefined = 0;
+ }
+
+ UniformType::Enum convertMtlType(MTLDataType _type)
+ {
+ switch (_type)
+ {
+ case MTLDataTypeUInt:
+ case MTLDataTypeInt:
+ return UniformType::Int1;
+
+ case MTLDataTypeFloat:
+ case MTLDataTypeFloat2:
+ case MTLDataTypeFloat3:
+ case MTLDataTypeFloat4:
+ return UniformType::Vec4;
+
+ case MTLDataTypeFloat3x3:
+ return UniformType::Mat3;
+
+ case MTLDataTypeFloat4x4:
+ return UniformType::Mat4;
+
+ };
+
+ BX_CHECK(false, "Unrecognized Mtl Data type 0x%04x.", _type);
+ return UniformType::End;
+ }
+
+ RenderPipelineState ProgramMtl::getRenderPipelineState(uint64_t _state, uint32_t _rgba, FrameBufferHandle _fbHandle, VertexDeclHandle _declHandle, uint16_t _numInstanceData)
+ {
+ _state &= (BGFX_STATE_BLEND_MASK|BGFX_STATE_BLEND_EQUATION_MASK|BGFX_STATE_ALPHA_WRITE|BGFX_STATE_RGB_WRITE|BGFX_STATE_BLEND_INDEPENDENT|BGFX_STATE_MSAA);
+
+ bool independentBlendEnable = !!(BGFX_STATE_BLEND_INDEPENDENT & _state);
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+ murmur.add(_state);
+ murmur.add(independentBlendEnable ? _rgba : 0);
+ if (!isValid(_fbHandle) )
+ {
+ murmur.add(s_renderMtl->m_backBufferPixelFormatHash);
+ }
+ else
+ {
+ FrameBufferMtl& frameBuffer = s_renderMtl->m_frameBuffers[_fbHandle.idx];
+ murmur.add(frameBuffer.m_pixelFormatHash);
+ }
+ murmur.add(_declHandle.idx);
+ murmur.add(_numInstanceData);
+ uint32_t hash = murmur.end();
+
+ RenderPipelineState rps = m_renderPipelineStateCache.find(hash);
+ if (NULL == rps)
+ {
+ RenderPipelineDescriptor& pd = s_renderMtl->m_renderPipelineDescriptor;
+ reset(pd);
+ uint32_t frameBufferAttachment = 1;
+
+ if (!isValid(_fbHandle) )
+ {
+ pd.colorAttachments[0].pixelFormat = s_renderMtl->m_drawable.texture.pixelFormat;
+ pd.depthAttachmentPixelFormat = s_renderMtl->m_backBufferDepth.m_obj.pixelFormat;
+ pd.stencilAttachmentPixelFormat = s_renderMtl->m_backBufferStencil.m_obj.pixelFormat;
+ }
+ else
+ {
+ FrameBufferMtl& frameBuffer = s_renderMtl->m_frameBuffers[_fbHandle.idx];
+ frameBufferAttachment = frameBuffer.m_num;
+
+ for (uint32_t ii = 0; ii < frameBuffer.m_num; ++ii)
+ {
+ const TextureMtl& texture = s_renderMtl->m_textures[frameBuffer.m_colorHandle[ii].idx];
+ pd.colorAttachments[ii].pixelFormat = texture.m_ptr.m_obj.pixelFormat;
+ }
+
+ if (isValid(frameBuffer.m_depthHandle))
+ {
+ const TextureMtl& texture = s_renderMtl->m_textures[frameBuffer.m_depthHandle.idx];
+ pd.depthAttachmentPixelFormat = texture.m_ptr.m_obj.pixelFormat;
+ if (NULL != texture.m_ptrStencil)
+ {
+ pd.stencilAttachmentPixelFormat = MTLPixelFormatInvalid; //texture.m_ptrStencil.m_obj.pixelFormat;
+ }
+ //todo: stencil attachment should be the same as depth for packed depth/stencil
+ }
+ }
+
+ // TODO: BGFX_STATE_MSAA using _fbHandle texture msaa values
+ const uint32_t blend = uint32_t( (_state&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT);
+ const uint32_t equation = uint32_t( (_state&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
+
+ const uint32_t srcRGB = (blend )&0xf;
+ const uint32_t dstRGB = (blend>> 4)&0xf;
+ const uint32_t srcA = (blend>> 8)&0xf;
+ const uint32_t dstA = (blend>>12)&0xf;
+
+ const uint32_t equRGB = (equation )&0x7;
+ const uint32_t equA = (equation>>3)&0x7;
+
+ uint8_t writeMask = (_state&BGFX_STATE_ALPHA_WRITE) ? MTLColorWriteMaskAlpha : 0;
+ writeMask |= (_state&BGFX_STATE_RGB_WRITE) ? MTLColorWriteMaskRed|MTLColorWriteMaskGreen|MTLColorWriteMaskBlue : 0;
+
+ for (uint32_t ii = 0; ii < (independentBlendEnable ? 1 : frameBufferAttachment); ++ii)
+ {
+ RenderPipelineColorAttachmentDescriptor drt = pd.colorAttachments[ii];
+
+ drt.blendingEnabled = !!(BGFX_STATE_BLEND_MASK & _state);
+
+ drt.sourceRGBBlendFactor = s_blendFactor[srcRGB][0];
+ drt.destinationRGBBlendFactor = s_blendFactor[dstRGB][0];
+ drt.rgbBlendOperation = s_blendEquation[equRGB];
+
+ drt.sourceAlphaBlendFactor = s_blendFactor[srcA][1];
+ drt.destinationAlphaBlendFactor = s_blendFactor[dstA][1];
+ drt.alphaBlendOperation = s_blendEquation[equA];
+
+ drt.writeMask = writeMask;
+ }
+
+ if (independentBlendEnable)
+ {
+ for (uint32_t ii = 1, rgba = _rgba; ii < frameBufferAttachment; ++ii, rgba >>= 11)
+ {
+ RenderPipelineColorAttachmentDescriptor drt = pd.colorAttachments[ii];
+
+ drt.blendingEnabled = 0 != (rgba&0x7ff);
+
+ const uint32_t src = (rgba )&0xf;
+ const uint32_t dst = (rgba>>4)&0xf;
+ const uint32_t equationIndex = (rgba>>8)&0x7;
+
+ drt.sourceRGBBlendFactor = s_blendFactor[src][0];
+ drt.destinationRGBBlendFactor = s_blendFactor[dst][0];
+ drt.rgbBlendOperation = s_blendEquation[equationIndex];
+
+ drt.sourceAlphaBlendFactor = s_blendFactor[src][1];
+ drt.destinationAlphaBlendFactor = s_blendFactor[dst][1];
+ drt.alphaBlendOperation = s_blendEquation[equationIndex];
+
+ drt.writeMask = writeMask;
+ }
+ }
+
+ pd.vertexFunction = m_vsh->m_function;
+ pd.fragmentFunction = m_fsh->m_function;
+
+ if (isValid(_declHandle))
+ {
+ VertexDescriptor vertexDesc = s_renderMtl->m_vertexDescriptor;
+ reset(vertexDesc);
+
+ VertexDecl &vertexDecl = s_renderMtl->m_vertexDecls[_declHandle.idx];
+ for (uint32_t ii = 0; Attrib::Count != m_used[ii]; ++ii)
+ {
+ Attrib::Enum attr = Attrib::Enum(m_used[ii]);
+ uint32_t loc = m_attributes[attr];
+
+ uint8_t num;
+ AttribType::Enum type;
+ bool normalized;
+ bool asInt;
+ vertexDecl.decode(attr, num, type, normalized, asInt);
+ BX_CHECK(num <= 4, "num must be <=4");
+
+ if (UINT16_MAX != vertexDecl.m_attributes[attr])
+ {
+ vertexDesc.attributes[loc].format = s_attribType[type][num-1][normalized?1:0];
+ vertexDesc.attributes[loc].bufferIndex = 1;
+ vertexDesc.attributes[loc].offset = vertexDecl.m_offset[attr];
+
+ BX_TRACE("attrib:%s format: %d offset:%d", s_attribName[attr], (int)vertexDesc.attributes[loc].format, (int)vertexDesc.attributes[loc].offset);
+ }
+ else
+ { // missing attribute: using dummy attribute with smallest possible size
+ vertexDesc.attributes[loc].format = MTLVertexFormatUChar2;
+ vertexDesc.attributes[loc].bufferIndex = 1;
+ vertexDesc.attributes[loc].offset = 0;
+ }
+ }
+
+ vertexDesc.layouts[1].stride = vertexDecl.getStride();
+ vertexDesc.layouts[1].stepFunction = MTLVertexStepFunctionPerVertex;
+
+ BX_TRACE("stride: %d", (int)vertexDesc.layouts[1].stride);
+
+ if (_numInstanceData > 0)
+ {
+ for (uint32_t ii = 0; UINT16_MAX != m_instanceData[ii]; ++ii)
+ {
+ uint32_t loc = m_instanceData[ii];
+ vertexDesc.attributes[loc].format = MTLVertexFormatFloat4;
+ vertexDesc.attributes[loc].bufferIndex = 2;
+ vertexDesc.attributes[loc].offset = ii*16;
+ }
+
+ vertexDesc.layouts[2].stride = _numInstanceData * 16;
+ vertexDesc.layouts[2].stepFunction = MTLVertexStepFunctionPerInstance;
+ vertexDesc.layouts[2].stepRate = 1;
+ }
+
+ pd.vertexDescriptor = vertexDesc;
+ }
+
+ if (m_processedUniforms)
+ {
+ rps = s_renderMtl->m_device.newRenderPipelineStateWithDescriptor(pd);
+ }
+ else
+ {
+ m_numPredefined = 0;
+ RenderPipelineReflection reflection = NULL;
+ rps = s_renderMtl->m_device.newRenderPipelineStateWithDescriptor(pd, MTLPipelineOptionBufferTypeInfo, &reflection);
+
+ if (NULL != reflection)
+ {
+ for (uint32_t shaderType = 0; shaderType < 2; ++shaderType)
+ {
+ UniformBuffer*& constantBuffer = (shaderType == 0 ? m_vshConstantBuffer : m_fshConstantBuffer);
+ uint8_t fragmentBit = (1 == shaderType ? BGFX_UNIFORM_FRAGMENTBIT : 0);
+
+ for (MTLArgument* arg in (shaderType == 0 ? reflection.vertexArguments : reflection.fragmentArguments))
+ {
+ BX_TRACE("arg: %s type:%d", utf8String(arg.name), arg.type);
+ if (arg.active)
+ {
+ if (arg.type == MTLArgumentTypeBuffer
+ && 0 == strcmp(utf8String(arg.name), SHADER_UNIFORM_NAME) )
+ {
+ BX_CHECK( arg.index == 0, "Uniform buffer must be in the buffer slot 0.");
+ BX_CHECK( MTLDataTypeStruct == arg.bufferDataType, "%s's type must be a struct",SHADER_UNIFORM_NAME );
+
+ if (MTLDataTypeStruct == arg.bufferDataType)
+ {
+ if (shaderType == 0)
+ {
+ m_vshConstantBufferSize = (uint32_t)arg.bufferDataSize;
+ m_vshConstantBufferAlignmentMask = (uint32_t)arg.bufferAlignment - 1;
+ }
+ else
+ {
+ m_fshConstantBufferSize = (uint32_t)arg.bufferDataSize;
+ m_fshConstantBufferAlignmentMask = (uint32_t)arg.bufferAlignment - 1;
+ }
+
+ for (MTLStructMember* uniform in arg.bufferStructType.members )
+ {
+ const char* name = utf8String(uniform.name);
+ BX_TRACE("uniform: %s type:%d", name, uniform.dataType);
+
+ MTLDataType dataType = uniform.dataType;
+ uint32_t num = 1;
+
+ if (dataType == MTLDataTypeArray)
+ {
+ dataType = uniform.arrayType.elementType;
+ num = (uint32_t)uniform.arrayType.arrayLength;
+ }
+
+ switch (dataType) {
+ case MTLDataTypeFloat4 :
+ num *= 1;
+ break;
+ case MTLDataTypeFloat4x4:
+ num *= 4;
+ break;
+ case MTLDataTypeFloat3x3:
+ num *= 3;
+ break;
+ default:
+ BX_WARN(0, "Unsupported uniform MTLDataType: %d", uniform.dataType);
+ break;
+ }
+
+ PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name);
+ if (PredefinedUniform::Count != predefined)
+ {
+ m_predefined[m_numPredefined].m_loc = uint32_t(uniform.offset);
+ m_predefined[m_numPredefined].m_count = uint16_t(num);
+ m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit);
+ m_numPredefined++;
+ }
+ else
+ {
+ const UniformInfo* info = s_renderMtl->m_uniformReg.find(name);
+ if (NULL != info)
+ {
+ if (NULL == constantBuffer)
+ {
+ constantBuffer = UniformBuffer::create(1024);
+ }
+
+ UniformType::Enum type = convertMtlType(dataType);
+ constantBuffer->writeUniformHandle((UniformType::Enum)(type|fragmentBit), uint32_t(uniform.offset), info->m_handle, uint16_t(num) );
+ BX_TRACE("store %s %d offset:%d", name, info->m_handle, uint32_t(uniform.offset));
+ }
+ }
+
+ }
+ }
+ }
+ else if (arg.type == MTLArgumentTypeTexture)
+ {
+ const char* name = utf8String(arg.name);
+ BX_TRACE("texture: %s index:%d", name, arg.index);
+ }
+ else if (arg.type == MTLArgumentTypeSampler)
+ {
+ const char* name = utf8String(arg.name);
+ BX_TRACE("sampler: %s index:%d", name, arg.index);
+ }
+ }
+ }
+
+ if (NULL != constantBuffer)
+ {
+ constantBuffer->finish();
+ }
+ }
+ }
+
+ m_processedUniforms = true;
+ }
+
+ m_renderPipelineStateCache.add(hash, rps);
+ }
+
+ return rps;
+ }
+
+ void BufferMtl::create(uint32_t _size, void* _data, uint16_t _flags, uint16_t _stride, bool _vertex)
+ {
+ BX_UNUSED(_flags, _stride, _vertex);
+
+ m_size = _size;
+ if (NULL == _data)
+ {
+ m_buffer = s_renderMtl->m_device.newBufferWithLength(_size, 0);
+ }
+ else
+ {
+ m_buffer = s_renderMtl->m_device.newBufferWithBytes(_data, _size, 0);
+ }
+ }
+
+ void BufferMtl::update(uint32_t _offset, uint32_t _size, void* _data, bool _discard)
+ {
+ BX_UNUSED(_discard);
+
+ memcpy( (uint8_t*)m_buffer.contents() + _offset, _data, _size);
+ }
+
+ void VertexBufferMtl::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+ {
+ m_decl = _declHandle;
+ uint16_t stride = isValid(_declHandle)
+ ? s_renderMtl->m_vertexDecls[_declHandle.idx].m_stride
+ : 0
+ ;
+
+ BufferMtl::create(_size, _data, _flags, stride, true);
+ }
+
+ void TextureMtl::create(const Memory* _mem, uint32_t _flags, uint8_t _skip)
+ {
+ m_sampler = s_renderMtl->getSamplerState(_flags);
+
+ ImageContainer imageContainer;
+
+ if (imageParse(imageContainer, _mem->data, _mem->size) )
+ {
+ uint8_t numMips = imageContainer.m_numMips;
+ const uint8_t startLod = uint8_t(bx::uint32_min(_skip, numMips-1) );
+ numMips -= startLod;
+ const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) );
+ const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod);
+ const uint32_t textureHeight = bx::uint32_max(blockInfo.blockHeight, imageContainer.m_height>>startLod);
+
+ m_flags = _flags;
+ m_requestedFormat = (uint8_t)imageContainer.m_format;
+ m_textureFormat = (uint8_t)imageContainer.m_format;
+
+ const TextureFormatInfo& tfi = s_textureFormat[m_requestedFormat];
+ const bool convert = MTLPixelFormatInvalid == tfi.m_fmt;
+
+ uint8_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
+ if (convert)
+ {
+ m_textureFormat = (uint8_t)TextureFormat::RGBA8;
+ bpp = 32;
+ }
+
+ TextureDescriptor desc = s_renderMtl->m_textureDescriptor;
+
+ if (imageContainer.m_cubeMap)
+ {
+ desc.textureType = MTLTextureTypeCube;
+ }
+ else if (imageContainer.m_depth > 1)
+ {
+ desc.textureType = MTLTextureType3D;
+ }
+ else
+ {
+ desc.textureType = MTLTextureType2D;
+ }
+
+ m_numMips = numMips;
+
+ const bool compressed = isCompressed(TextureFormat::Enum(m_textureFormat) );
+
+ BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s."
+ , this - s_renderMtl->m_textures
+ , getName( (TextureFormat::Enum)m_textureFormat)
+ , getName( (TextureFormat::Enum)m_requestedFormat)
+ , textureWidth
+ , textureHeight
+ , imageContainer.m_cubeMap ? "x6" : ""
+ , 0 != (_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : ""
+ );
+
+
+ const bool bufferOnly = 0 != (_flags&BGFX_TEXTURE_RT_BUFFER_ONLY);
+ const bool computeWrite = 0 != (_flags&BGFX_TEXTURE_COMPUTE_WRITE);
+// const bool renderTarget = 0 != (_flags&BGFX_TEXTURE_RT_MASK);
+ const bool srgb = 0 != (_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb;
+// const uint32_t msaaQuality = bx::uint32_satsub( (_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
+// const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality];
+
+ MTLPixelFormat format = MTLPixelFormatInvalid;
+ if (srgb)
+ {
+ format = s_textureFormat[m_textureFormat].m_fmtSrgb;
+ BX_WARN(format != MTLPixelFormatInvalid, "sRGB not supported for texture format %d", m_textureFormat);
+ }
+
+ if (format == MTLPixelFormatInvalid)
+ {
+ // not swizzled and not sRGB, or sRGB unsupported
+ format = s_textureFormat[m_textureFormat].m_fmt;
+ }
+
+ desc.pixelFormat = format;
+ desc.width = textureWidth;
+ desc.height = textureHeight;
+ desc.depth = bx::uint32_max(1,imageContainer.m_depth);
+ desc.mipmapLevelCount = imageContainer.m_numMips;
+ desc.sampleCount = 1; //TODO: set samplecount - If textureType is not MTLTextureType2DMultisample, the value must be 1.
+ desc.resourceOptions = MTLResourceStorageModePrivate;
+ desc.cpuCacheMode = MTLCPUCacheModeDefaultCache;
+ desc.storageMode = bufferOnly ? 1 /*MTLStorageModeManaged*/ : 2 /*MTLStorageModePrivate*/;
+ desc.usage = MTLTextureUsageShaderRead;
+
+ //TODO: set resource flags depending on usage(renderTarget/computeWrite/etc) on iOS9/OSX
+
+ m_ptr = s_renderMtl->m_device.newTextureWithDescriptor(desc);
+ if (m_requestedFormat == TextureFormat::D24S8
+ && desc.pixelFormat == MTLPixelFormatDepth32Float)
+ {
+ desc.pixelFormat = MTLPixelFormatStencil8;
+ m_ptrStencil = s_renderMtl->m_device.newTextureWithDescriptor(desc);
+ }
+
+ uint8_t* temp = NULL;
+ if (convert)
+ {
+ temp = (uint8_t*)BX_ALLOC(g_allocator, textureWidth*textureHeight*4);
+ }
+
+ for (uint8_t side = 0, numSides = imageContainer.m_cubeMap ? 6 : 1; side < numSides; ++side)
+ {
+ uint32_t width = textureWidth;
+ uint32_t height = textureHeight;
+ uint32_t depth = imageContainer.m_depth;
+
+ for (uint8_t lod = 0, num = numMips; lod < num; ++lod)
+ {
+ width = bx::uint32_max(1, width);
+ height = bx::uint32_max(1, height);
+ depth = bx::uint32_max(1, depth);
+
+ ImageMip mip;
+ if (imageGetRawData(imageContainer, side, lod+startLod, _mem->data, _mem->size, mip) )
+ {
+ const uint8_t* data = mip.m_data;
+
+ if (convert)
+ {
+ imageDecodeToRgba8(temp
+ , mip.m_data
+ , mip.m_width
+ , mip.m_height
+ , mip.m_width*4
+ , mip.m_format
+ );
+ data = temp;
+ }
+
+ MTLRegion region = { { 0, 0, 0 }, { width, height, depth } };
+
+ uint32_t bytesPerRow;
+ uint32_t bytesPerImage;
+
+ if (compressed && !convert)
+ {
+ if (format >= 160 /*MTLPixelFormatPVRTC_RGB_2BPP*/
+ && format <= 167 /*MTLPixelFormatPVRTC_RGBA_4BPP_sRGB*/)
+ {
+ bytesPerRow = 0;
+ bytesPerImage = 0;
+ }
+ else
+ {
+ bytesPerRow = (mip.m_width / blockInfo.blockWidth )*mip.m_blockSize;
+ bytesPerImage = (desc.textureType == MTLTextureType3D) ? (mip.m_height/blockInfo.blockHeight)*bytesPerRow : 0;
+ }
+ }
+ else
+ {
+ bytesPerRow = width * bpp / 8;
+ bytesPerImage = (desc.textureType == MTLTextureType3D) ? width * height * bpp / 8 : 0;
+ }
+
+ m_ptr.replaceRegion(region, lod, side, data, bytesPerRow, bytesPerImage);
+ }
+ else if (!computeWrite)
+ {
+ //TODO: do we need to clear to zero??
+ }
+
+ width >>= 1;
+ height >>= 1;
+ depth >>= 1;
+ }
+ }
+
+ if (NULL != temp)
+ {
+ BX_FREE(g_allocator, temp);
+ }
+ }
+ }
+
+ void TextureMtl::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem)
+ {
+ MTLRegion region = { { _rect.m_x, _rect.m_y, _z }, { _rect.m_width, _rect.m_height, _depth } };
+
+ const uint32_t bpp = getBitsPerPixel(TextureFormat::Enum(m_textureFormat) );
+ const uint32_t rectpitch = _rect.m_width*bpp/8;
+ const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
+
+ const bool convert = m_textureFormat != m_requestedFormat;
+
+ uint8_t* data = _mem->data;
+ uint8_t* temp = NULL;
+
+ if (convert)
+ {
+ temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height);
+ imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat);
+ data = temp;
+ }
+
+ m_ptr.replaceRegion(region, _mip, _side, data, srcpitch, srcpitch * _rect.m_height);
+
+ if (NULL != temp)
+ {
+ BX_FREE(g_allocator, temp);
+ }
+ }
+
+ void TextureMtl::commit(uint8_t _stage, uint32_t _flags)
+ {
+ //TODO: vertex or fragment stage?
+ s_renderMtl->m_renderCommandEncoder.setFragmentTexture(m_ptr, _stage);
+ s_renderMtl->m_renderCommandEncoder.setFragmentSamplerState(0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags)
+ ? s_renderMtl->getSamplerState(_flags)
+ : m_sampler, _stage);
+ }
+
+ void FrameBufferMtl::create(uint8_t _num, const TextureHandle* _handles)
+ {
+ m_num = 0;
+ for (uint32_t ii = 0; ii < _num; ++ii)
+ {
+ TextureHandle handle = _handles[ii];
+ if (isValid(handle) )
+ {
+ const TextureMtl& texture = s_renderMtl->m_textures[handle.idx];
+
+ //TODO: separate stencil buffer? or just use packed depth/stencil (which is not available on iOS8)
+ if (isDepth( (TextureFormat::Enum)texture.m_textureFormat) )
+ {
+ m_depthHandle = handle;
+ }
+ else
+ {
+ m_colorHandle[m_num] = handle;
+ m_num++;
+ }
+ }
+ }
+
+ bx::HashMurmur2A murmur;
+ murmur.begin();
+
+ murmur.add(m_num);
+ for (uint32_t ii = 0; ii < m_num; ++ii)
+ {
+ const TextureMtl& texture = s_renderMtl->m_textures[m_colorHandle[ii].idx];
+ murmur.add((uint32_t)texture.m_ptr.pixelFormat());
+ }
+ const TextureMtl& depthTexture = s_renderMtl->m_textures[m_depthHandle.idx];
+ murmur.add((uint32_t)depthTexture.m_ptr.pixelFormat());
+ murmur.add((uint32_t)MTLPixelFormatInvalid); //stencil
+
+ m_pixelFormatHash = murmur.end();
+ }
+
+ void FrameBufferMtl::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat)
+ {
+ BX_UNUSED(_denseIdx, _nwh, _width, _height, _depthFormat);
+
+ BX_WARN(false, "FrameBufferMtl::create not yet implemented");
+ }
+
+ void FrameBufferMtl::postReset()
+ {
+ BX_WARN(false, "FrameBufferMtl::postReset not yet implemented");
+ //TODO: what should we do here?
+ }
+
+ uint16_t FrameBufferMtl::destroy()
+ {
+ m_num = 0;
+ m_depthHandle.idx = invalidHandle;
+
+ uint16_t denseIdx = m_denseIdx;
+ m_denseIdx = UINT16_MAX;
+
+ return denseIdx;
+ }
+
+ void RendererContextMtl::submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) BX_OVERRIDE
+ {
+ BX_UNUSED(_clearQuad);
+
+ m_commandBuffer = m_commandQueue.commandBuffer();
+ retain(m_commandBuffer); // keep alive to be useable at 'flip'
+
+ //TODO: multithreading with multiple commandbuffer
+ // is there a FAST way to tell which view is active?
+
+ //TODO: acquire CAMetalDrawable just before we really need it. When we are using an encoder with target metalLayer's texture
+ m_drawable = m_metalLayer.nextDrawable;
+// retain(m_drawable); // keep alive to be useable at 'flip'
+
+ m_uniformBufferVertexOffset = 0;
+ m_uniformBufferFragmentOffset = 0;
+
+ updateResolution(_render->m_resolution);
+
+ int64_t elapsed = -bx::getHPCounter();
+ int64_t captureElapsed = 0;
+
+ if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ {
+ //TODO
+ //m_gpuTimer.begin();
+ }
+
+ if (0 < _render->m_iboffset)
+ {
+ TransientIndexBuffer* ib = _render->m_transientIb;
+ m_indexBuffers[ib->handle.idx].update(0, _render->m_iboffset, ib->data);
+ }
+
+ if (0 < _render->m_vboffset)
+ {
+ TransientVertexBuffer* vb = _render->m_transientVb;
+ m_vertexBuffers[vb->handle.idx].update(0, _render->m_vboffset, vb->data);
+ }
+
+ _render->sort();
+
+ RenderDraw currentState;
+ currentState.clear();
+ currentState.m_flags = BGFX_STATE_NONE;
+ currentState.m_stencil = packStencil(BGFX_STENCIL_NONE, BGFX_STENCIL_NONE);
+
+ _render->m_hmdInitialized = false;
+
+ const bool hmdEnabled = false;
+ ViewState viewState(_render, hmdEnabled);
+ uint32_t blendFactor = 0;
+
+ bool wireframe = !!(_render->m_debug&BGFX_DEBUG_WIREFRAME);
+
+ //TODO: REMOVE THIS - TEMPORARY HACK
+ m_textureDescriptor.textureType = MTLTextureType2D;
+ m_textureDescriptor.pixelFormat = MTLPixelFormatRGBA8Unorm;
+ m_textureDescriptor.width = 4;
+ m_textureDescriptor.height = 4;
+ m_textureDescriptor.depth = 1;
+ m_textureDescriptor.mipmapLevelCount = 1;
+ m_textureDescriptor.sampleCount = 1; //TODO: set samplecount - If textureType is not MTLTextureType2DMultisample, the value must be 1.
+ Texture zeroTexture = m_device.newTextureWithDescriptor(m_textureDescriptor);
+
+ uint16_t programIdx = invalidHandle;
+ SortKey key;
+ uint16_t view = UINT16_MAX;
+ FrameBufferHandle fbh = BGFX_INVALID_HANDLE;
+
+ //ASK: why should we use this? It changes topology, so possible renders a big mess, doesn't it?
+ //const uint64_t primType = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0;
+ const uint64_t primType = 0;
+ uint8_t primIndex = uint8_t(primType>>BGFX_STATE_PT_SHIFT);
+ PrimInfo prim = s_primInfo[primIndex];
+
+ ProgramMtl* currentProgram = NULL;
+ mtl::RenderCommandEncoder rce;
+
+ bool wasCompute = false;
+ bool viewHasScissor = false;
+ Rect viewScissorRect;
+ viewScissorRect.clear();
+
+ uint32_t statsNumPrimsSubmitted[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumDrawIndirect[BX_COUNTOF(s_primInfo)] = {};
+ uint32_t statsNumIndices = 0;
+ uint32_t statsKeyType[2] = {};
+
+ if (0 == (_render->m_debug&BGFX_DEBUG_IFH) )
+ {
+ bool viewRestart = false;
+ uint8_t eye = 0;
+ uint8_t restartState = 0;
+ viewState.m_rect = _render->m_rect[0];
+
+ int32_t numItems = _render->m_num;
+ for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
+ {
+ const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
+ statsKeyType[isCompute]++;
+
+ const bool viewChanged = 0
+ || key.m_view != view
+ || item == numItems
+ ;
+ const RenderItem& renderItem = _render->m_renderItem[_render->m_sortValues[item] ];
+ ++item;
+
+ if (viewChanged)
+ {
+ if (1 == restartState)
+ {
+ restartState = 2;
+ item = restartItem;
+ restartItem = numItems;
+ view = UINT16_MAX;
+ continue;
+ }
+
+ view = key.m_view;
+ programIdx = invalidHandle;
+
+
+ viewRestart = ( (BGFX_VIEW_STEREO == (_render->m_viewFlags[view] & BGFX_VIEW_STEREO) ) );
+ viewRestart &= hmdEnabled;
+ if (viewRestart)
+ {
+ if (0 == restartState)
+ {
+ restartState = 1;
+ restartItem = item - 1;
+ }
+
+ eye = (restartState - 1) & 1;
+ restartState &= 1;
+ }
+ else
+ {
+ eye = 0;
+ }
+
+ viewState.m_rect = _render->m_rect[view];
+ if (viewRestart)
+ {
+ viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2;
+ viewState.m_rect.m_width /= 2;
+ }
+
+ const Rect& scissorRect = _render->m_scissor[view];
+ viewHasScissor = !scissorRect.isZero();
+ viewScissorRect = viewHasScissor ? scissorRect : viewState.m_rect;
+ Clear& clr = _render->m_clear[view];
+
+ mtl::RenderPassDescriptor renderPassDescriptor = newRenderPassDescriptor();
+
+ //todo: check FB size
+ uint32_t width = getBufferWidth();
+ uint32_t height = getBufferHeight();
+ Rect viewRect = viewState.m_rect;
+ bool fullscreenRect = (0 == viewRect.m_x && 0 == viewRect.m_y && width == viewRect.m_width && height == viewRect.m_height);
+
+ //TODO/OPTIMIZATION: merge views with same target framebuffer into one renderPass
+
+ fbh = _render->m_fb[view];
+ setFrameBuffer(renderPassDescriptor, fbh);
+
+ RenderPassColorAttachmentDescriptor colorAttachment0 = renderPassDescriptor.colorAttachments[0];
+ if (BGFX_CLEAR_COLOR & clr.m_flags)
+ {
+ if (BGFX_CLEAR_COLOR_USE_PALETTE & clr.m_flags)
+ {
+ uint8_t index = (uint8_t)bx::uint32_min(BGFX_CONFIG_MAX_COLOR_PALETTE-1, clr.m_index[0]);
+ const float* rgba = _render->m_colorPalette[index];
+ const float rr = rgba[0];
+ const float gg = rgba[1];
+ const float bb = rgba[2];
+ const float aa = rgba[3];
+ colorAttachment0.clearColor = MTLClearColorMake(rr,gg,bb,aa);
+ }
+ else
+ {
+ float rr = clr.m_index[0]*1.0f/255.0f;
+ float gg = clr.m_index[1]*1.0f/255.0f;
+ float bb = clr.m_index[2]*1.0f/255.0f;
+ float aa = clr.m_index[3]*1.0f/255.0f;
+ colorAttachment0.clearColor = MTLClearColorMake(rr,gg,bb,aa);
+ }
+
+ colorAttachment0.loadAction = MTLLoadActionClear;
+ }
+ else
+ colorAttachment0.loadAction = MTLLoadActionLoad;
+
+ //TODO: optimize store actions use discard flag
+ RenderPassDepthAttachmentDescriptor depthAttachment = renderPassDescriptor.depthAttachment;
+ if (NULL != depthAttachment.texture)
+ {
+ depthAttachment.clearDepth = clr.m_depth;
+ depthAttachment.loadAction = (BGFX_CLEAR_DEPTH & clr.m_flags) ? MTLLoadActionClear : MTLLoadActionLoad;
+ depthAttachment.storeAction = MTLStoreActionStore;
+ }
+
+ RenderPassStencilAttachmentDescriptor stencilAttachment = renderPassDescriptor.stencilAttachment;
+ if (NULL != stencilAttachment.texture)
+ {
+ stencilAttachment.clearStencil = clr.m_stencil;
+ stencilAttachment.loadAction = (BGFX_CLEAR_STENCIL & clr.m_flags) ? MTLLoadActionClear : MTLLoadActionLoad;
+ stencilAttachment.storeAction = MTLStoreActionStore;
+ }
+
+ if (0 != m_renderCommandEncoder)
+ {
+ m_renderCommandEncoder.endEncoding();
+ }
+ rce = m_commandBuffer.renderCommandEncoderWithDescriptor(renderPassDescriptor);
+ m_renderCommandEncoder = rce;
+ MTL_RELEASE(renderPassDescriptor);
+
+ //TODO: REMOVE THIS!!!!
+ // TERRIBLE HACK TO SUPPRESS DEBUG LAYER WARNING ABOUT MISSING TEXTURE/SAMPLER AT 0 in 20-nanovg
+ m_renderCommandEncoder.setFragmentTexture(zeroTexture, 0);
+ m_renderCommandEncoder.setFragmentSamplerState(getSamplerState(0), 0);
+
+ rce.setTriangleFillMode(wireframe? MTLTriangleFillModeLines : MTLTriangleFillModeFill);
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_MTL) )
+ {
+ if (item != 1) //ASK: better check ? I don't get the whole restart thing
+ rce.popDebugGroup();
+
+ rce.pushDebugGroup(s_viewName[view]);
+ }
+
+ MTLViewport vp;
+ vp.originX = viewState.m_rect.m_x;
+ vp.originY = viewState.m_rect.m_y;
+ vp.width = viewState.m_rect.m_width;
+ vp.height = viewState.m_rect.m_height;
+ vp.znear = 0.0f;
+ vp.zfar = 1.0f;
+ rce.setViewport(vp);
+
+ if (BGFX_CLEAR_NONE != (clr.m_flags & BGFX_CLEAR_MASK) && !fullscreenRect)
+ { //TODO: fallback to clear with quad
+ //clearQuad(_clearQuad, viewState.m_rect, clr, _render->m_colorPalette);
+ }
+ }
+
+ //TODO: iscompute
+
+ bool resetState = viewChanged || wasCompute;
+
+ if (wasCompute)
+ {
+ wasCompute = false;
+
+ programIdx = invalidHandle;
+ currentProgram = NULL;
+
+ //TODO
+ //invalidateCompute();
+ }
+
+ const RenderDraw& draw = renderItem.draw;
+
+ const uint64_t newFlags = draw.m_flags;
+ uint64_t changedFlags = currentState.m_flags ^ draw.m_flags;
+ currentState.m_flags = newFlags;
+
+ const uint64_t newStencil = draw.m_stencil;
+ uint64_t changedStencil = currentState.m_stencil ^ draw.m_stencil;
+ currentState.m_stencil = newStencil;
+
+ if (resetState)
+ {
+ currentState.clear();
+ currentState.m_scissor = !draw.m_scissor;
+ changedFlags = BGFX_STATE_MASK;
+ changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK);
+ currentState.m_flags = newFlags;
+ currentState.m_stencil = newStencil;
+
+ programIdx = invalidHandle;
+ setDepthStencilState(newFlags, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT));
+
+ const uint64_t pt = newFlags&BGFX_STATE_PT_MASK;
+ primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT);
+ }
+
+ if (prim.m_type != s_primInfo[primIndex].m_type)
+ {
+ prim = s_primInfo[primIndex];
+ }
+
+ uint16_t scissor = draw.m_scissor;
+ if (currentState.m_scissor != scissor)
+ {
+ currentState.m_scissor = scissor;
+
+ MTLScissorRect rc;
+ if (UINT16_MAX == scissor)
+ {
+ if (viewHasScissor)
+ {
+ rc.x = viewScissorRect.m_x;
+ rc.y = viewScissorRect.m_y;
+ rc.width = viewScissorRect.m_width;
+ rc.height = viewScissorRect.m_height;
+ }
+ else
+ { // can't disable: set to view rect
+ rc.x = viewState.m_rect.m_x;
+ rc.y = viewState.m_rect.m_y;
+ rc.width = viewState.m_rect.m_width;
+ rc.height = viewState.m_rect.m_height;
+ }
+ }
+ else
+ {
+ Rect scissorRect;
+ scissorRect.intersect(viewScissorRect, _render->m_rectCache.m_cache[scissor]);
+ rc.x = scissorRect.m_x;
+ rc.y = scissorRect.m_y;
+ rc.width = scissorRect.m_width;
+ rc.height = scissorRect.m_height;
+ }
+ rce.setScissorRect(rc);
+ }
+
+ if ((BGFX_STATE_DEPTH_WRITE|BGFX_STATE_DEPTH_TEST_MASK) & changedFlags
+ || 0 != changedStencil)
+ {
+ setDepthStencilState(newFlags,newStencil);
+ }
+
+ if ((0
+ | BGFX_STATE_CULL_MASK
+ | BGFX_STATE_ALPHA_REF_MASK
+ | BGFX_STATE_PT_MASK
+ //| BGFX_STATE_POINT_SIZE_MASK //TODO: not supported. could be supported with uniform
+ ) & changedFlags)
+ {
+ if (BGFX_STATE_CULL_MASK & changedFlags)
+ {
+ const uint64_t pt = newFlags&BGFX_STATE_CULL_MASK;
+ uint8_t cullIndex = uint8_t(pt>>BGFX_STATE_CULL_SHIFT);
+ rce.setCullMode(s_cullMode[cullIndex]);
+ }
+
+ if (BGFX_STATE_ALPHA_REF_MASK & changedFlags)
+ {
+ uint32_t ref = (newFlags&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT;
+ viewState.m_alphaRef = ref/255.0f;
+ }
+
+ const uint64_t pt = newFlags&BGFX_STATE_PT_MASK;
+ primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT);
+ if (prim.m_type != s_primInfo[primIndex].m_type)
+ {
+ prim = s_primInfo[primIndex];
+ }
+ }
+
+ if ((blendFactor != draw.m_rgba) && !(newFlags & BGFX_STATE_BLEND_INDEPENDENT) )
+ {
+ const uint32_t rgba = draw.m_rgba;
+ float rr = ( (rgba>>24) )/255.0f;
+ float gg = ( (rgba>>16)&0xff)/255.0f;
+ float bb = ( (rgba>> 8)&0xff)/255.0f;
+ float aa = ( (rgba )&0xff)/255.0f;
+ rce.setBlendColor(rr,gg,bb,aa);
+
+ blendFactor = draw.m_rgba;
+ }
+
+ bool programChanged = false;
+ bool constantsChanged = draw.m_constBegin < draw.m_constEnd;
+ rendererUpdateUniforms(this, _render->m_uniformBuffer, draw.m_constBegin, draw.m_constEnd);
+
+ if (key.m_program != programIdx ||
+ (BGFX_STATE_BLEND_MASK|BGFX_STATE_BLEND_EQUATION_MASK|BGFX_STATE_ALPHA_WRITE|BGFX_STATE_RGB_WRITE|BGFX_STATE_BLEND_INDEPENDENT|BGFX_STATE_MSAA) & changedFlags ||
+ currentState.m_vertexBuffer.idx != draw.m_vertexBuffer.idx ||
+ currentState.m_vertexDecl.idx != draw.m_vertexDecl.idx ||
+ currentState.m_instanceDataStride != draw.m_instanceDataStride ||
+ ( (blendFactor != draw.m_rgba) && !!(newFlags & BGFX_STATE_BLEND_INDEPENDENT) ) )
+ {
+ programIdx = key.m_program;
+ currentState.m_vertexDecl = draw.m_vertexDecl;
+ currentState.m_instanceDataStride = draw.m_instanceDataStride;
+
+ if (invalidHandle == programIdx)
+ {
+ currentProgram = NULL;
+ continue;
+ }
+ else
+ {
+ ProgramMtl& program = m_program[programIdx];
+ currentProgram = &program;
+
+ uint16_t handle = draw.m_vertexBuffer.idx;
+ const VertexBufferMtl& vb = m_vertexBuffers[handle];
+ VertexDeclHandle decl;
+ decl.idx = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx;
+
+ RenderPipelineState pipelineState = program.getRenderPipelineState(newFlags, draw.m_rgba, fbh, decl, draw.m_instanceDataStride/16);
+ if (NULL == pipelineState )
+ { //call with invalid program
+ currentProgram = NULL;
+ programIdx = invalidHandle;
+ continue;
+ }
+
+ rce.setRenderPipelineState(pipelineState);
+ }
+
+ programChanged =
+ constantsChanged = true;
+ }
+
+ if (invalidHandle != programIdx)
+ {
+ ProgramMtl& program = m_program[programIdx];
+
+ uint32_t vertexUniformBufferSize = program.m_vshConstantBufferSize;
+ uint32_t fragmentUniformBufferSize = program.m_fshConstantBufferSize;
+
+ if (vertexUniformBufferSize )
+ {
+ m_uniformBufferVertexOffset = BX_ALIGN_MASK(m_uniformBufferVertexOffset, program.m_vshConstantBufferAlignmentMask);
+ rce.setVertexBuffer(m_uniformBuffer, m_uniformBufferVertexOffset, 0);
+ }
+
+ m_uniformBufferFragmentOffset = m_uniformBufferVertexOffset + vertexUniformBufferSize;
+ if (fragmentUniformBufferSize )
+ {
+ m_uniformBufferFragmentOffset = BX_ALIGN_MASK(m_uniformBufferFragmentOffset, program.m_fshConstantBufferAlignmentMask);
+ rce.setFragmentBuffer(m_uniformBuffer, m_uniformBufferFragmentOffset, 0);
+ }
+
+ //TODO: create new UniformBuffer when not enough place for next buffer
+
+ if (constantsChanged)
+ {
+ UniformBuffer* vcb = program.m_vshConstantBuffer;
+ if (NULL != vcb)
+ {
+ commit(*vcb);
+ }
+
+ UniformBuffer* fcb = program.m_fshConstantBuffer;
+ if (NULL != fcb)
+ {
+ commit(*fcb);
+ }
+ }
+
+ viewState.setPredefined<4>(this, view, eye, program, _render, draw);
+
+ m_uniformBufferFragmentOffset += fragmentUniformBufferSize;
+ m_uniformBufferVertexOffset = m_uniformBufferFragmentOffset;
+ }
+
+ {
+ for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage)
+ {
+ const Binding& sampler = draw.m_bind[stage];
+ Binding& current = currentState.m_bind[stage];
+ if (current.m_idx != sampler.m_idx
+ || current.m_un.m_draw.m_flags != sampler.m_un.m_draw.m_flags
+ || programChanged)
+ {
+ if (invalidHandle != sampler.m_idx)
+ {
+ TextureMtl& texture = m_textures[sampler.m_idx];
+ texture.commit(stage, sampler.m_un.m_draw.m_flags);
+ }
+ }
+
+ current = sampler;
+ }
+ }
+
+ if (currentState.m_vertexBuffer.idx != draw.m_vertexBuffer.idx
+ || currentState.m_startVertex != draw.m_startVertex
+ || currentState.m_instanceDataBuffer.idx != draw.m_instanceDataBuffer.idx
+ || currentState.m_instanceDataOffset != draw.m_instanceDataOffset
+ )
+ {
+ currentState.m_vertexBuffer = draw.m_vertexBuffer;
+ currentState.m_startVertex = draw.m_startVertex;
+ currentState.m_instanceDataBuffer.idx = draw.m_instanceDataBuffer.idx;
+ currentState.m_instanceDataOffset = draw.m_instanceDataOffset;
+
+ uint16_t handle = draw.m_vertexBuffer.idx;
+ if (invalidHandle != handle)
+ {
+ const VertexBufferMtl& vb = m_vertexBuffers[handle];
+
+ uint16_t decl = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx;
+ const VertexDecl& vertexDecl = m_vertexDecls[decl];
+ uint32_t offset = draw.m_startVertex * vertexDecl.getStride();
+
+ rce.setVertexBuffer(vb.m_buffer, offset, 1);
+
+ if (isValid(draw.m_instanceDataBuffer) )
+ {
+ const VertexBufferMtl& inst = m_vertexBuffers[draw.m_instanceDataBuffer.idx];
+ rce.setVertexBuffer(inst.m_buffer, draw.m_instanceDataOffset, 2);
+ }
+ }
+ }
+
+ if (isValid(currentState.m_vertexBuffer) )
+ {
+ uint32_t numVertices = draw.m_numVertices;
+ if (UINT32_MAX == numVertices)
+ {
+ const VertexBufferMtl& vb = m_vertexBuffers[currentState.m_vertexBuffer.idx];
+ uint16_t decl = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx;
+ const VertexDecl& vertexDecl = m_vertexDecls[decl];
+ numVertices = vb.m_size/vertexDecl.m_stride;
+ }
+
+ uint32_t numIndices = 0;
+ uint32_t numPrimsSubmitted = 0;
+ uint32_t numInstances = 0;
+ uint32_t numPrimsRendered = 0;
+ uint32_t numDrawIndirect = 0;
+
+ if (isValid(draw.m_indirectBuffer) )
+ {
+ // TODO: indirect draw
+ }
+ else
+ {
+ if (isValid(draw.m_indexBuffer) )
+ {
+ const IndexBufferMtl& ib = m_indexBuffers[draw.m_indexBuffer.idx];
+ MTLIndexType indexType = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32) ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32;
+
+ if (UINT32_MAX == draw.m_numIndices)
+ {
+ const uint32_t indexSize = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4;
+ numIndices = ib.m_size/indexSize;
+ numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub;
+ numInstances = draw.m_numInstances;
+ numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+
+ rce.drawIndexedPrimitives(prim.m_type, numIndices, indexType, ib.m_buffer, 0, draw.m_numInstances);
+ }
+ else if (prim.m_min <= draw.m_numIndices)
+ {
+ const uint32_t indexSize = 0 == (ib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4;
+ numIndices = draw.m_numIndices;
+ numPrimsSubmitted = numIndices/prim.m_div - prim.m_sub;
+ numInstances = draw.m_numInstances;
+ numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+
+ rce.drawIndexedPrimitives(prim.m_type, numIndices, indexType, ib.m_buffer, draw.m_startIndex * indexSize,numInstances);
+ }
+ }
+ else
+ {
+ numPrimsSubmitted = numVertices/prim.m_div - prim.m_sub;
+ numInstances = draw.m_numInstances;
+ numPrimsRendered = numPrimsSubmitted*draw.m_numInstances;
+
+ rce.drawPrimitives(prim.m_type, 0, draw.m_numVertices, draw.m_numInstances);
+ }
+ }
+
+ statsNumPrimsSubmitted[primIndex] += numPrimsSubmitted;
+ statsNumPrimsRendered[primIndex] += numPrimsRendered;
+ statsNumInstances[primIndex] += numInstances;
+ statsNumDrawIndirect[primIndex] += numDrawIndirect;
+ statsNumIndices += numIndices;
+ }
+ }
+
+ if (wasCompute)
+ {
+ //TODO
+ //invalidateCompute();
+ }
+
+ if (0 < _render->m_num)
+ {
+ //ASK: we now using one commandBuffer that is commited in flush. Should we implement this?
+ //if (0 != (m_resolution.m_flags & BGFX_RESET_FLUSH_AFTER_RENDER) )
+ {
+ // ????
+ //deviceCtx->Flush();
+ }
+
+ captureElapsed = -bx::getHPCounter();
+ //TODO
+ //capture();
+ captureElapsed += bx::getHPCounter();
+ }
+ }
+
+ if (BX_ENABLED(BGFX_CONFIG_DEBUG_MTL) )
+ {
+ if (0 < _render->m_num)
+ {
+ rce.popDebugGroup();
+ }
+ }
+
+ //TODO: debug stats
+ int64_t now = bx::getHPCounter();
+ elapsed += now;
+
+ static int64_t last = now;
+ int64_t frameTime = now - last;
+ last = now;
+
+ static int64_t min = frameTime;
+ static int64_t max = frameTime;
+ min = min > frameTime ? frameTime : min;
+ max = max < frameTime ? frameTime : max;
+
+ if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) )
+ {
+ rce.pushDebugGroup("debugstats");
+
+ static uint32_t maxGpuLatency = 0;
+ static double maxGpuElapsed = 0.0f;
+// double elapsedGpuMs = 0.0;
+
+ //TODO: gputimer
+ /* m_gpuTimer.end();
+
+ while (m_gpuTimer.get() )
+ {
+ double toGpuMs = 1000.0 / double(m_gpuTimer.m_frequency);
+ elapsedGpuMs = m_gpuTimer.m_elapsed * toGpuMs;
+ maxGpuElapsed = elapsedGpuMs > maxGpuElapsed ? elapsedGpuMs : maxGpuElapsed;
+ }
+ maxGpuLatency = bx::uint32_imax(maxGpuLatency, m_gpuTimer.m_control.available()-1);
+ */
+ TextVideoMem& tvm = m_textVideoMem;
+
+ static int64_t next = now;
+
+ if (now >= next)
+ {
+ next = now + bx::getHPFrequency();
+
+ double freq = double(bx::getHPFrequency() );
+ double toMs = 1000.0/freq;
+
+ tvm.clear();
+ uint16_t pos = 0;
+ tvm.printf(0, pos++, BGFX_CONFIG_DEBUG ? 0x89 : 0x8f, " %s / " BX_COMPILER_NAME " / " BX_CPU_NAME " / " BX_ARCH_NAME " / " BX_PLATFORM_NAME " "
+ , getRendererName()
+ );
+
+ //const D3DADAPTER_IDENTIFIER9& identifier = m_identifier;
+ //tvm.printf(0, pos++, 0x0f, " Device: %s (%s)", identifier.Description, identifier.Driver);
+
+ pos = 10;
+ tvm.printf(10, pos++, 0x8e, " Frame: %7.3f, % 7.3f \x1f, % 7.3f \x1e [ms] / % 6.2f FPS "
+ , double(frameTime)*toMs
+ , double(min)*toMs
+ , double(max)*toMs
+ , freq/frameTime
+ );
+
+ /*
+ const uint32_t msaa = (m_resolution.m_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT;
+ tvm.printf(10, pos++, 0x8e, " Reset flags: [%c] vsync, [%c] MSAAx%d, [%c] MaxAnisotropy "
+ , !!(m_resolution.m_flags&BGFX_RESET_VSYNC) ? '\xfe' : ' '
+ , 0 != msaa ? '\xfe' : ' '
+ , 1<<msaa
+ , !!(m_resolution.m_flags&BGFX_RESET_MAXANISOTROPY) ? '\xfe' : ' '
+ );
+ */
+ double elapsedCpuMs = double(elapsed)*toMs;
+ tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms] (latency %d)"
+ , _render->m_num
+ , statsKeyType[0]
+ , statsKeyType[1]
+ , elapsedCpuMs
+ , elapsedCpuMs > maxGpuElapsed ? '>' : '<'
+ , maxGpuElapsed
+ , maxGpuLatency
+ );
+ maxGpuLatency = 0;
+ maxGpuElapsed = 0.0;
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii)
+ {
+ tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d"
+ , s_primName[ii]
+ , statsNumPrimsRendered[ii]
+ , statsNumInstances[ii]
+ , statsNumPrimsSubmitted[ii]
+ );
+ }
+
+ tvm.printf(10, pos++, 0x8e, " Indices: %7d ", statsNumIndices);
+ tvm.printf(10, pos++, 0x8e, " Uniform size: %7d, Max: %7d ", _render->m_uniformEnd, _render->m_uniformMax);
+ tvm.printf(10, pos++, 0x8e, " DVB size: %7d ", _render->m_vboffset);
+ tvm.printf(10, pos++, 0x8e, " DIB size: %7d ", _render->m_iboffset);
+
+ double captureMs = double(captureElapsed)*toMs;
+ tvm.printf(10, pos++, 0x8e, " Capture: %3.4f [ms]", captureMs);
+
+ uint8_t attr[2] = { 0x89, 0x8a };
+ uint8_t attrIndex = _render->m_waitSubmit < _render->m_waitRender;
+
+ tvm.printf(10, pos++, attr[attrIndex&1], " Submit wait: %3.4f [ms]", _render->m_waitSubmit*toMs);
+ tvm.printf(10, pos++, attr[(attrIndex+1)&1], " Render wait: %3.4f [ms]", _render->m_waitRender*toMs);
+
+ min = frameTime;
+ max = frameTime;
+ }
+
+ blit(this, _textVideoMemBlitter, tvm);
+
+ rce.popDebugGroup();
+ }
+ else if (_render->m_debug & BGFX_DEBUG_TEXT)
+ {
+ rce.pushDebugGroup("debugtext");
+
+ blit(this, _textVideoMemBlitter, _render->m_textVideoMem);
+
+ rce.popDebugGroup();
+ }
+
+ //TODO: REMOVE THIS - TEMPORARY HACK
+ release(zeroTexture);
+
+ rce.endEncoding();
+ m_renderCommandEncoder = 0;
+ }
+
+} /* namespace mtl */ } // namespace bgfx
+
+#else
+
+namespace bgfx { namespace mtl
+ {
+ RendererContextI* rendererCreate()
+ {
+ return NULL;
+ }
+
+ void rendererDestroy()
+ {
+ }
+ } /* namespace mtl */ } // namespace bgfx
+
+#endif // BGFX_CONFIG_RENDERER_METAL
diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp
index ce5f812448b..5a86523fc57 100644
--- a/3rdparty/bgfx/src/renderer_null.cpp
+++ b/3rdparty/bgfx/src/renderer_null.cpp
@@ -33,7 +33,7 @@ namespace bgfx { namespace noop
{
}
- void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint8_t /*_flags*/) BX_OVERRIDE
+ void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint16_t /*_flags*/) BX_OVERRIDE
{
}
@@ -49,7 +49,7 @@ namespace bgfx { namespace noop
{
}
- void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint8_t /*_flags*/) BX_OVERRIDE
+ void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint16_t /*_flags*/) BX_OVERRIDE
{
}
@@ -57,7 +57,7 @@ namespace bgfx { namespace noop
{
}
- void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE
+ void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE
{
}
@@ -69,7 +69,7 @@ namespace bgfx { namespace noop
{
}
- void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE
+ void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE
{
}
diff --git a/3rdparty/bgfx/src/renderer_vk.cpp b/3rdparty/bgfx/src/renderer_vk.cpp
index e2ff8cdfe7a..a0739ca1ec0 100644
--- a/3rdparty/bgfx/src/renderer_vk.cpp
+++ b/3rdparty/bgfx/src/renderer_vk.cpp
@@ -4,8 +4,9 @@
*/
#include "bgfx_p.h"
+
#if BGFX_CONFIG_RENDERER_VULKAN
-# include "../../vk/src/renderer_vk.cpp"
+# include "../../bgfx-ext/src/renderer_vk.cpp"
#else
namespace bgfx { namespace vk
diff --git a/3rdparty/bgfx/src/shader_dx9bc.cpp b/3rdparty/bgfx/src/shader_dx9bc.cpp
new file mode 100644
index 00000000000..bfbf4f6ee98
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_dx9bc.cpp
@@ -0,0 +1,748 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "bgfx_p.h"
+#include "shader_dx9bc.h"
+
+BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-parameter");
+BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunneeded-internal-declaration");
+
+namespace bgfx
+{
+ struct Dx9bcOpcodeInfo
+ {
+ uint8_t numOperands;
+ uint8_t numValues;
+ };
+
+ static const Dx9bcOpcodeInfo s_dx9bcOpcodeInfo[] =
+ {
+ { 0, 0 }, // NOP
+ { 2, 0 }, // MOV
+ { 3, 0 }, // ADD
+ { 1, 0 }, // SUB
+ { 4, 0 }, // MAD
+ { 3, 0 }, // MUL
+ { 2, 0 }, // RCP
+ { 2, 0 }, // RSQ
+ { 3, 0 }, // DP3
+ { 3, 0 }, // DP4
+ { 3, 0 }, // MIN
+ { 3, 0 }, // MAX
+ { 3, 0 }, // SLT
+ { 3, 0 }, // SGE
+ { 2, 0 }, // EXP
+ { 2, 0 }, // LOG
+ { 1, 0 }, // LIT
+ { 1, 0 }, // DST
+ { 4, 0 }, // LRP
+ { 2, 0 }, // FRC
+ { 1, 0 }, // M4X4
+ { 1, 0 }, // M4X3
+ { 1, 0 }, // M3X4
+ { 1, 0 }, // M3X3
+ { 1, 0 }, // M3X2
+ { 0, 0 }, // CALL
+ { 0, 0 }, // CALLNZ
+ { 0, 0 }, // LOOP
+ { 0, 0 }, // RET
+ { 0, 0 }, // ENDLOOP
+ { 0, 0 }, // LABEL
+ { 1, 1 }, // DCL
+ { 3, 0 }, // POW
+ { 1, 0 }, // CRS
+ { 1, 0 }, // SGN
+ { 1, 0 }, // ABS
+ { 2, 0 }, // NRM
+ { 4, 0 }, // SINCOS
+ { 1, 0 }, // REP
+ { 0, 0 }, // ENDREP
+ { 1, 0 }, // IF
+ { 2, 0 }, // IFC
+ { 0, 0 }, // ELSE
+ { 0, 0 }, // ENDIF
+ { 0, 0 }, // BREAK
+ { 2, 0 }, // BREAKC
+ { 2, 0 }, // MOVA
+ { 1, 4 }, // DEFB
+ { 1, 4 }, // DEFI
+ { 0, 0 }, // 0
+ { 0, 0 }, // 1
+ { 0, 0 }, // 2
+ { 0, 0 }, // 3
+ { 0, 0 }, // 4
+ { 0, 0 }, // 5
+ { 0, 0 }, // 6
+ { 0, 0 }, // 7
+ { 0, 0 }, // 8
+ { 0, 0 }, // 9
+ { 0, 0 }, // 10
+ { 0, 0 }, // 11
+ { 0, 0 }, // 12
+ { 0, 0 }, // 13
+ { 0, 0 }, // 14
+ { 1, 0 }, // TEXCOORD
+ { 1, 0 }, // TEXKILL
+ { 3, 0 }, // TEX
+ { 1, 0 }, // TEXBEM
+ { 1, 0 }, // TEXBEM1
+ { 1, 0 }, // TEXREG2AR
+ { 1, 0 }, // TEXREG2GB
+ { 1, 0 }, // TEXM3X2PAD
+ { 1, 0 }, // TEXM3X2TEX
+ { 1, 0 }, // TEXM3X3PAD
+ { 1, 0 }, // TEXM3X3TEX
+ { 1, 0 }, // TEXM3X3DIFF
+ { 1, 0 }, // TEXM3X3SPEC
+ { 1, 0 }, // TEXM3X3VSPEC
+ { 2, 0 }, // EXPP
+ { 2, 0 }, // LOGP
+ { 4, 0 }, // CND
+ { 1, 4 }, // DEF
+ { 1, 0 }, // TEXREG2RGB
+ { 1, 0 }, // TEXDP3TEX
+ { 1, 0 }, // TEXM3X2DEPTH
+ { 1, 0 }, // TEXDP3
+ { 1, 0 }, // TEXM3X3
+ { 1, 0 }, // TEXDEPTH
+ { 4, 0 }, // CMP
+ { 1, 0 }, // BEM
+ { 4, 0 }, // DP2ADD
+ { 2, 0 }, // DSX
+ { 2, 0 }, // DSY
+ { 5, 0 }, // TEXLDD
+ { 1, 0 }, // SETP
+ { 3, 0 }, // TEXLDL
+ { 0, 0 }, // BREAKP
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOpcodeInfo) == Dx9bcOpcode::Count);
+
+ static const char* s_dx9bcOpcode[] =
+ {
+ "nop",
+ "mov",
+ "add",
+ "sub",
+ "mad",
+ "mul",
+ "rcp",
+ "rsq",
+ "dp3",
+ "dp4",
+ "min",
+ "max",
+ "slt",
+ "sge",
+ "exp",
+ "log",
+ "lit",
+ "dst",
+ "lrp",
+ "frc",
+ "m4x4",
+ "m4x3",
+ "m3x4",
+ "m3x3",
+ "m3x2",
+ "call",
+ "callnz",
+ "loop",
+ "ret",
+ "endloop",
+ "label",
+ "dcl",
+ "pow",
+ "crs",
+ "sgn",
+ "abs",
+ "nrm",
+ "sincos",
+ "rep",
+ "endrep",
+ "if",
+ "ifc",
+ "else",
+ "endif",
+ "break",
+ "breakc",
+ "mova",
+ "defb",
+ "defi",
+
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
+ "texcoord",
+ "texkill",
+ "tex",
+ "texbem",
+ "texbem1",
+ "texreg2ar",
+ "texreg2gb",
+ "texm3x2pad",
+ "texm3x2tex",
+ "texm3x3pad",
+ "texm3x3tex",
+ "texm3x3diff",
+ "texm3x3spec",
+ "texm3x3vspec",
+ "expp",
+ "logp",
+ "cnd",
+ "def",
+ "texreg2rgb",
+ "texdp3tex",
+ "texm3x2depth",
+ "texdp3",
+ "texm3x3",
+ "texdepth",
+ "cmp",
+ "bem",
+ "dp2add",
+ "dsx",
+ "dsy",
+ "texldd",
+ "setp",
+ "texldl",
+ "breakp",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOpcode) == Dx9bcOpcode::Count);
+
+ const char* getName(Dx9bcOpcode::Enum _opcode)
+ {
+ BX_CHECK(_opcode < Dx9bcOpcode::Count, "Unknown opcode id %d (%x).", _opcode, _opcode);
+ return s_dx9bcOpcode[_opcode];
+ }
+
+ static const char* s_dx9bcOperandType[] =
+ {
+ "r", // Temporary Register File
+ "v", // Input Register File
+ "c", // Constant Register File
+ "t", // Texture Register File (PS)
+ "oPos", // Rasterizer Register File
+ "oD", // Attribute Output Register File
+ "oT", // Texture Coordinate Output Register File
+ "output", // Output register file for VS3.0+
+ "i", // Constant Integer Vector Register File
+ "oColor", // Color Output Register File
+ "oDepth", // Depth Output Register File
+ "s", // Sampler State Register File
+ "c", // Constant Register File 2048 - 4095
+ "c", // Constant Register File 4096 - 6143
+ "c", // Constant Register File 6144 - 8191
+ "b", // Constant Boolean register file
+ "aL", // Loop counter register file
+ "tempfloat16", // 16-bit float temp register file
+ "misctype", // Miscellaneous (single) registers.
+ "label", // Label
+ "p", // Predicate register
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcOperandType) == Dx9bcOperandType::Count);
+
+ static const char* s_dx9bcDeclUsage[] =
+ {
+ "position",
+ "blendweight",
+ "blendindices",
+ "normal",
+ "psize",
+ "texcoord",
+ "tangent",
+ "binormal",
+ "tessfactor",
+ "positiont",
+ "color",
+ "fog",
+ "depth",
+ "sample",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dx9bcDeclUsage) == Dx9bcDeclUsage::Count);
+
+ int32_t read(bx::ReaderI* _reader, Dx9bcSubOperand& _subOperand)
+ {
+ int32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ _subOperand.type = Dx9bcOperandType::Enum( ( (token & UINT32_C(0x70000000) ) >> 28)
+ | ( (token & UINT32_C(0x00001800) ) >> 8) );
+ _subOperand.regIndex = (token & UINT32_C(0x000007ff) );
+ _subOperand.swizzleBits = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const Dx9bcSubOperand& _subOperand)
+ {
+ int32_t size = 0;
+
+ uint32_t token = 0;
+ token |= (_subOperand.type << 28) & UINT32_C(0x70000000);
+ token |= (_subOperand.type << 8) & UINT32_C(0x00001800);
+ token |= _subOperand.regIndex & UINT32_C(0x000007ff);
+ token |= (_subOperand.swizzleBits << 16) & UINT32_C(0x00ff0000);
+ size += bx::write(_writer, token);
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderI* _reader, Dx9bcOperand& _operand)
+ {
+ int32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ _operand.type = Dx9bcOperandType::Enum( ( (token & UINT32_C(0x70000000) ) >> 28)
+ | ( (token & UINT32_C(0x00001800) ) >> 8) );
+ _operand.regIndex = (token & UINT32_C(0x000007ff) );
+ _operand.addrMode = Dx9bcOperandAddrMode::Enum( (token & UINT32_C(0x00002000) ) >> 13);
+
+ if (_operand.destination)
+ {
+ // Destination Parameter Token
+ // https://msdn.microsoft.com/en-us/library/ff552738.aspx
+
+ _operand.writeMask = uint8_t( (token & UINT32_C(0x000f0000) ) >> 16);
+ _operand.saturate = 0 != (token & UINT32_C(0x00100000) );
+ _operand.partialPrecision = 0 != (token & UINT32_C(0x00200000) );
+ _operand.centroid = 0 != (token & UINT32_C(0x00400000) );
+ }
+ else
+ {
+ // Source Parameter Token
+ // https://msdn.microsoft.com/en-us/library/ff569716%28v=vs.85%29.aspx
+
+ _operand.writeMask = 0;
+ _operand.saturate = false;
+ _operand.partialPrecision = false;
+ _operand.centroid = false;
+ _operand.swizzleBits = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16);
+ }
+
+ if (Dx9bcOperandAddrMode::Relative == _operand.addrMode)
+ {
+ size += read(_reader, _operand.subOperand);
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const Dx9bcOperand& _operand)
+ {
+ int32_t size = 0;
+
+ uint32_t token = 0;
+ token |= (_operand.type << 28) & UINT32_C(0x70000000);
+ token |= (_operand.type << 8) & UINT32_C(0x00001800);
+ token |= _operand.regIndex & UINT32_C(0x000007ff);
+ token |= (_operand.addrMode << 13) & UINT32_C(0x00002000);
+ size += bx::write(_writer, token);
+
+ if (Dx9bcOperandAddrMode::Relative == _operand.addrMode)
+ {
+ size += write(_writer, _operand.subOperand);
+ }
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderI* _reader, Dx9bcInstruction& _instruction)
+ {
+ int32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ _instruction.opcode = Dx9bcOpcode::Enum( (token & UINT32_C(0x0000ffff) ) );
+
+ if (Dx9bcOpcode::Comment == _instruction.opcode)
+ {
+ _instruction.specific = 0;
+ _instruction.length = uint16_t( (token & UINT32_C(0x7fff0000) ) >> 16) + 1;
+ _instruction.predicated = false;
+ _instruction.coissue = false;
+ }
+ else
+ {
+ _instruction.specific = uint8_t( (token & UINT32_C(0x00ff0000) ) >> 16);
+ _instruction.length = uint8_t( (token & UINT32_C(0x0f000000) ) >> 24) + 1;
+ _instruction.predicated = 0 != (token & UINT32_C(0x10000000) );
+ _instruction.coissue = 0 != (token & UINT32_C(0x40000000) );
+ }
+
+ if (Dx9bcOpcode::Count <= _instruction.opcode)
+ {
+ if (Dx9bcOpcode::Comment == _instruction.opcode)
+ {
+ for (int32_t ii = 0, num = _instruction.length-1; ii < num; ++ii)
+ {
+ uint32_t tmp;
+ size += bx::read(_reader, tmp);
+ }
+ }
+
+ return size;
+ }
+
+ uint32_t currOp = 0;
+
+ const Dx9bcOpcodeInfo& info = s_dx9bcOpcodeInfo[bx::uint32_min(_instruction.opcode, Dx9bcOpcode::Count)];
+ _instruction.numOperands = info.numOperands;
+ _instruction.numValues = info.numValues;
+
+ switch (_instruction.opcode)
+ {
+ case Dx9bcOpcode::SINCOS:
+ if (5 > _instruction.length)
+ {
+ _instruction.numOperands = 2;
+ }
+ break;
+
+ default:
+ break;
+ };
+
+//BX_TRACE("%d (%d), %d, %d, 0x%08x"
+// , _instruction.opcode
+// , bx::uint32_min(_instruction.opcode, Dx9bcOpcode::Count)
+// , _instruction.length
+// , _instruction.numOperands
+// , token
+// );
+
+ const bool valuesBeforeOpcode = false
+ || Dx9bcOpcode::DCL == _instruction.opcode
+ ;
+
+ if (valuesBeforeOpcode
+ && 0 < info.numValues)
+ {
+ size += read(_reader, _instruction.value, info.numValues*sizeof(uint32_t) );
+ }
+
+ _instruction.operand[0].destination = true;
+
+ switch (_instruction.numOperands)
+ {
+ case 6: size += read(_reader, _instruction.operand[currOp++]);
+ case 5: size += read(_reader, _instruction.operand[currOp++]);
+ case 4: size += read(_reader, _instruction.operand[currOp++]);
+ case 3: size += read(_reader, _instruction.operand[currOp++]);
+ case 2: size += read(_reader, _instruction.operand[currOp++]);
+ case 1: size += read(_reader, _instruction.operand[currOp++]);
+ case 0:
+ if (!valuesBeforeOpcode
+ && 0 < info.numValues)
+ {
+ size += read(_reader, _instruction.value, info.numValues*sizeof(uint32_t) );
+ }
+ break;
+
+ default:
+ BX_CHECK(false, "Instruction %s with invalid number of operands %d (numValues %d)."
+ , getName(_instruction.opcode)
+ , _instruction.numOperands
+ , info.numValues
+ );
+ break;
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const Dx9bcInstruction& _instruction)
+ {
+ int32_t size = 0;
+
+ uint32_t token = 0;
+ token |= _instruction.opcode & UINT32_C(0x0000ffff);
+ token |= (_instruction.specific << 16) & UINT32_C(0x00ff0000);
+ token |= ( (_instruction.length - 1) << 24) & UINT32_C(0x0f000000);
+ size += bx::write(_writer, token);
+
+ uint32_t currOp = 0;
+ switch (_instruction.numOperands)
+ {
+ case 6: size += write(_writer, _instruction.operand[currOp++]);
+ case 5: size += write(_writer, _instruction.operand[currOp++]);
+ case 4: size += write(_writer, _instruction.operand[currOp++]);
+ case 3: size += write(_writer, _instruction.operand[currOp++]);
+ case 2: size += write(_writer, _instruction.operand[currOp++]);
+ case 1: size += write(_writer, _instruction.operand[currOp++]);
+ case 0:
+ break;
+ }
+
+ return 0;
+ }
+
+ int32_t toString(char* _out, int32_t _size, const Dx9bcInstruction& _instruction)
+ {
+ int32_t size = 0;
+
+ if (Dx9bcOpcode::Comment == _instruction.opcode
+ || Dx9bcOpcode::Phase == _instruction.opcode)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "// %x"
+ , _instruction.opcode
+ );
+ return size;
+ }
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%2d %s"
+ , _instruction.opcode
+ , getName(_instruction.opcode)
+ );
+
+ switch (_instruction.opcode)
+ {
+ case Dx9bcOpcode::DCL:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "_%s%d (%d, %d, %d, %d)"
+ , s_dx9bcDeclUsage[_instruction.value[0] & UINT32_C(0x0000000f)]
+ , (_instruction.value[0] & UINT32_C(0x000f0000) )>>16
+ , (_instruction.value[0] & UINT32_C(0x08000000) )>>27 // ?
+ , (_instruction.value[0] & UINT32_C(0x10000000) )>>28 // texture2d
+ , (_instruction.value[0] & UINT32_C(0x20000000) )>>29 // textureCube
+ , (_instruction.value[0] & UINT32_C(0x40000000) )>>30 // texture3d
+ );
+ break;
+
+ default:
+ break;
+ }
+
+ for (uint32_t ii = 0; ii < _instruction.numOperands; ++ii)
+ {
+ const Dx9bcOperand& operand = _instruction.operand[ii];
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%s%d"
+ , 0 == ii ? " " : ", "
+ , s_dx9bcOperandType[operand.type]
+ , operand.regIndex
+ );
+
+ if (operand.destination)
+ {
+ if (0xf > operand.writeMask
+ && 0 < operand.writeMask)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ".%s%s%s%s"
+ , 0 == (operand.writeMask & 1) ? "" : "x"
+ , 0 == (operand.writeMask & 2) ? "" : "y"
+ , 0 == (operand.writeMask & 4) ? "" : "z"
+ , 0 == (operand.writeMask & 8) ? "" : "w"
+ );
+ }
+ }
+ else
+ {
+ if (Dx9bcOperandAddrMode::Relative == operand.addrMode)
+ {
+ const bool array = true;
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "["
+ );
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%d"
+ , s_dx9bcOperandType[operand.subOperand.type]
+ , operand.subOperand.regIndex
+ );
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s"
+ , array ? "]" : ""
+ );
+ }
+
+ if (0xe4 != operand.swizzleBits)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ".%c%c%c%c"
+ , "xyzw"[(operand.swizzleBits )&0x3]
+ , "xyzw"[(operand.swizzleBits>>2)&0x3]
+ , "xyzw"[(operand.swizzleBits>>4)&0x3]
+ , "xyzw"[(operand.swizzleBits>>6)&0x3]
+ );
+ }
+ }
+ }
+
+ switch (_instruction.opcode)
+ {
+ case Dx9bcOpcode::DEF:
+ for (uint32_t jj = 0; jj < _instruction.numValues; ++jj)
+ {
+ union { int32_t i; float f; } cast = { _instruction.value[jj] };
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%f%s"
+ , 0 == jj ? " (" : ", "
+ , cast.f
+ , uint32_t(_instruction.numValues-1) == jj ? ")" : ""
+ );
+ }
+ break;
+
+ case Dx9bcOpcode::DEFI:
+ for (uint32_t jj = 0; jj < _instruction.numValues; ++jj)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%d%s"
+ , 0 == jj ? " (" : ", "
+ , _instruction.value[jj]
+ , uint32_t(_instruction.numValues-1) == jj ? ")" : ""
+ );
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderSeekerI* _reader, Dx9bcShader& _shader)
+ {
+ int32_t size = 0;
+ int64_t offset = bx::seek(_reader);
+
+ for (;;)
+ {
+ Dx9bcInstruction instruction;
+ int32_t length = read(_reader, instruction);
+ size += length;
+
+ if (Dx9bcOpcode::Count > instruction.opcode)
+ {
+ char temp[512];
+ toString(temp, 512, instruction);
+
+ BX_CHECK(length/4 == instruction.length
+ , "%s\nread %d, expected %d"
+ , temp
+ , length/4
+ , instruction.length
+ );
+ }
+ else
+ {
+ if (Dx9bcOpcode::End == instruction.opcode)
+ {
+ size -= length;
+ break;
+ }
+ }
+ }
+
+ bx::seek(_reader, offset, bx::Whence::Begin);
+
+ _shader.byteCode.resize(size);
+ bx::read(_reader, _shader.byteCode.data(), size);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const Dx9bcShader& _shader)
+ {
+ BX_UNUSED(_writer, _shader);
+ return 0;
+ }
+
+ int32_t read(bx::ReaderSeekerI* _reader, Dx9bc& _bc)
+ {
+ int32_t size = 0;
+
+ size += bx::read(_reader, _bc.version);
+
+ bool pixelShader = (0xffff0000 == (_bc.version & 0xffff0000) );
+ uint32_t versionMajor = (_bc.version>>8)&0xff;
+ uint32_t versionMinor = _bc.version&0xff;
+ BX_UNUSED(pixelShader, versionMajor, versionMinor);
+ BX_TRACE("%s shader %d.%d"
+ , pixelShader ? "pixel" : "vertex"
+ , versionMajor
+ , versionMinor
+ );
+
+ size += read(_reader, _bc.shader);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterSeekerI* _writer, const Dx9bc& _dxbc)
+ {
+ BX_UNUSED(_writer, _dxbc);
+ return 0;
+ }
+
+ void parse(const Dx9bcShader& _src, Dx9bcParseFn _fn, void* _userData)
+ {
+ bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
+
+//BX_TRACE("parse %d", _src.byteCode.size());
+
+ for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
+ {
+ Dx9bcInstruction instruction;
+ uint32_t size = read(&reader, instruction);
+ BX_CHECK(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size);
+
+ _fn(token * sizeof(uint32_t), instruction, _userData);
+
+ token += instruction.length;
+ }
+ }
+
+ void filter(Dx9bcShader& _dst, const Dx9bcShader& _src, Dx9bcFilterFn _fn, void* _userData)
+ {
+ bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
+
+ bx::CrtAllocator r;
+ bx::MemoryBlock mb(&r);
+ bx::MemoryWriter writer(&mb);
+
+ for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
+ {
+ Dx9bcInstruction instruction;
+ uint32_t size = read(&reader, instruction);
+ BX_CHECK(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size);
+
+ _fn(instruction, _userData);
+
+ write(&writer, instruction);
+
+ token += instruction.length;
+ }
+
+ uint8_t* data = (uint8_t*)mb.more();
+ uint32_t size = uint32_t(bx::getSize(&writer) );
+ _dst.byteCode.reserve(size);
+ memcpy(_dst.byteCode.data(), data, size);
+ }
+
+} // namespace bgfx
diff --git a/3rdparty/bgfx/src/shader_dx9bc.h b/3rdparty/bgfx/src/shader_dx9bc.h
new file mode 100644
index 00000000000..b161dcaa29d
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_dx9bc.h
@@ -0,0 +1,258 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_SHADER_DX9BC_H
+#define BGFX_SHADER_DX9BC_H
+
+#include <bx/readerwriter.h>
+
+namespace bgfx
+{
+ struct Dx9bcOpcode
+ {
+ enum Enum
+ {
+ NOP,
+ MOV,
+ ADD,
+ SUB,
+ MAD,
+ MUL,
+ RCP,
+ RSQ,
+ DP3,
+ DP4,
+ MIN,
+ MAX,
+ SLT,
+ SGE,
+ EXP,
+ LOG,
+ LIT,
+ DST,
+ LRP,
+ FRC,
+ M4X4,
+ M4X3,
+ M3X4,
+ M3X3,
+ M3X2,
+ CALL,
+ CALLNZ,
+ LOOP,
+ RET,
+ ENDLOOP,
+ LABEL,
+ DCL,
+ POW,
+ CRS,
+ SGN,
+ ABS,
+ NRM,
+ SINCOS,
+ REP,
+ ENDREP,
+ IF,
+ IFC,
+ ELSE,
+ ENDIF,
+ BREAK,
+ BREAKC,
+ MOVA,
+ DEFB,
+ DEFI,
+
+ Unknown = 63,
+ TEXCOORD,
+ TEXKILL,
+ TEX,
+ TEXBEM,
+ TEXBEM1,
+ TEXREG2AR,
+ TEXREG2GB,
+ TEXM3X2PAD,
+ TEXM3X2TEX,
+ TEXM3X3PAD,
+ TEXM3X3TEX,
+ TEXM3X3DIFF,
+ TEXM3X3SPEC,
+ TEXM3X3VSPEC,
+ EXPP,
+ LOGP,
+ CND,
+ DEF,
+ TEXREG2RGB,
+ TEXDP3TEX,
+ TEXM3X2DEPTH,
+ TEXDP3,
+ TEXM3X3,
+ TEXDEPTH,
+ CMP,
+ BEM,
+ DP2ADD,
+ DSX,
+ DSY,
+ TEXLDD,
+ SETP,
+ TEXLDL,
+ BREAKP,
+
+ Count,
+
+ Phase = 0xfffd,
+ Comment = 0xfffe,
+ End = 0xffff
+ };
+ };
+
+ const char* getName(Dx9bcOpcode::Enum _opcode);
+
+ struct Dx9bcResourceDim
+ {
+ enum Enum
+ {
+ Unknown,
+ Texture1D,
+ Texture2D,
+ TextureCube,
+ Texture3D,
+ };
+ };
+
+ struct Dx9bcOperandType
+ {
+ enum Enum
+ {
+ Temp,
+ Input,
+ Const,
+ Texture,
+ RastOut,
+ AttrOut,
+ TexCrdOut,
+ Output,
+ ConstInt,
+ ColorOut,
+ DepthOut,
+ Sampler,
+ Const2,
+ Const3,
+ Const4,
+ ConstBool,
+ Loop,
+ TempFloat16,
+ MiscType,
+ Label,
+ Predicate,
+
+ Count
+ };
+ };
+
+ struct Dx9bcDeclUsage
+ {
+ enum Enum
+ {
+ Position,
+ BlendWeight,
+ BlendIndices,
+ Normal,
+ Psize,
+ Texcoord,
+ Tangent,
+ Binormal,
+ TessFactor,
+ PositionT,
+ Color,
+ Fog,
+ Depth,
+ Sample,
+
+ Count
+ };
+ };
+
+ struct Dx9bcOperandAddrMode
+ {
+ enum Enum
+ {
+ Absolute,
+ Relative,
+
+ Count
+ };
+ };
+
+ struct Dx9bcSubOperand
+ {
+ Dx9bcOperandType::Enum type;
+ uint32_t regIndex;
+ uint8_t swizzleBits;
+ };
+
+ struct Dx9bcOperand
+ {
+ Dx9bcOperandType::Enum type;
+ uint32_t regIndex;
+
+ bool destination;
+
+ // Destination
+ uint8_t writeMask;
+ bool saturate;
+ bool partialPrecision;
+ bool centroid;
+
+ // Source
+ uint8_t swizzleBits;
+
+ Dx9bcOperandAddrMode::Enum addrMode;
+ Dx9bcSubOperand subOperand;
+ };
+
+ struct Dx9bcInstruction
+ {
+ Dx9bcOpcode::Enum opcode;
+ uint16_t length;
+ uint8_t numOperands;
+ uint8_t numValues;
+ uint8_t specific;
+ bool predicated;
+ bool coissue;
+
+ Dx9bcOperand operand[6];
+ int32_t value[4];
+ };
+
+ int32_t read(bx::ReaderI* _reader, Dx9bcInstruction& _instruction);
+ int32_t write(bx::WriterI* _writer, const Dx9bcInstruction& _instruction);
+ int32_t toString(char* _out, int32_t _size, const Dx9bcInstruction& _instruction);
+
+ struct Dx9bcShader
+ {
+ stl::vector<uint8_t> byteCode;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, Dx9bcShader& _shader);
+ int32_t write(bx::WriterI* _writer, const Dx9bcShader& _shader);
+
+ struct Dx9bc
+ {
+ uint32_t version;
+ Dx9bcShader shader;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, Dx9bc& _dx9bc);
+ int32_t write(bx::WriterSeekerI* _writer, const Dx9bc& _dx9bc);
+
+ typedef void (*Dx9bcParseFn)(uint32_t _offset, const Dx9bcInstruction& _instruction, void* _userData);
+ void parse(const Dx9bcShader& _src, Dx9bcParseFn _fn, void* _userData);
+
+ typedef void (*Dx9bcFilterFn)(Dx9bcInstruction& _instruction, void* _userData);
+ void filter(Dx9bcShader& _dst, const Dx9bcShader& _src, Dx9bcFilterFn _fn, void* _userData);
+
+} // namespace bgfx
+
+#endif // BGFX_SHADER_DX9BC_H
diff --git a/3rdparty/bgfx/src/shader_dxbc.cpp b/3rdparty/bgfx/src/shader_dxbc.cpp
new file mode 100644
index 00000000000..34e50c14424
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_dxbc.cpp
@@ -0,0 +1,1924 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "bgfx_p.h"
+#include "shader_dxbc.h"
+
+namespace bgfx
+{
+ struct DxbcOpcodeInfo
+ {
+ uint8_t numOperands;
+ uint8_t numValues;
+ };
+
+ static const DxbcOpcodeInfo s_dxbcOpcodeInfo[] =
+ {
+ { 3, 0 }, // ADD
+ { 3, 0 }, // AND
+ { 0, 0 }, // BREAK
+ { 1, 0 }, // BREAKC
+ { 0, 0 }, // CALL
+ { 0, 0 }, // CALLC
+ { 1, 0 }, // CASE
+ { 0, 0 }, // CONTINUE
+ { 1, 0 }, // CONTINUEC
+ { 0, 0 }, // CUT
+ { 0, 0 }, // DEFAULT
+ { 2, 0 }, // DERIV_RTX
+ { 2, 0 }, // DERIV_RTY
+ { 1, 0 }, // DISCARD
+ { 3, 0 }, // DIV
+ { 3, 0 }, // DP2
+ { 3, 0 }, // DP3
+ { 3, 0 }, // DP4
+ { 0, 0 }, // ELSE
+ { 0, 0 }, // EMIT
+ { 0, 0 }, // EMITTHENCUT
+ { 0, 0 }, // ENDIF
+ { 0, 0 }, // ENDLOOP
+ { 0, 0 }, // ENDSWITCH
+ { 3, 0 }, // EQ
+ { 2, 0 }, // EXP
+ { 2, 0 }, // FRC
+ { 2, 0 }, // FTOI
+ { 2, 0 }, // FTOU
+ { 3, 0 }, // GE
+ { 3, 0 }, // IADD
+ { 1, 0 }, // IF
+ { 3, 0 }, // IEQ
+ { 3, 0 }, // IGE
+ { 3, 0 }, // ILT
+ { 4, 0 }, // IMAD
+ { 3, 0 }, // IMAX
+ { 3, 0 }, // IMIN
+ { 4, 0 }, // IMUL
+ { 3, 0 }, // INE
+ { 2, 0 }, // INEG
+ { 3, 0 }, // ISHL
+ { 3, 0 }, // ISHR
+ { 2, 0 }, // ITOF
+ { 0, 0 }, // LABEL
+ { 3, 0 }, // LD
+ { 4, 0 }, // LD_MS
+ { 2, 0 }, // LOG
+ { 0, 0 }, // LOOP
+ { 3, 0 }, // LT
+ { 4, 0 }, // MAD
+ { 3, 0 }, // MIN
+ { 3, 0 }, // MAX
+ { 0, 1 }, // CUSTOMDATA
+ { 2, 0 }, // MOV
+ { 4, 0 }, // MOVC
+ { 3, 0 }, // MUL
+ { 3, 0 }, // NE
+ { 0, 0 }, // NOP
+ { 2, 0 }, // NOT
+ { 3, 0 }, // OR
+ { 3, 0 }, // RESINFO
+ { 0, 0 }, // RET
+ { 1, 0 }, // RETC
+ { 2, 0 }, // ROUND_NE
+ { 2, 0 }, // ROUND_NI
+ { 2, 0 }, // ROUND_PI
+ { 2, 0 }, // ROUND_Z
+ { 2, 0 }, // RSQ
+ { 4, 0 }, // SAMPLE
+ { 5, 0 }, // SAMPLE_C
+ { 5, 0 }, // SAMPLE_C_LZ
+ { 5, 0 }, // SAMPLE_L
+ { 6, 0 }, // SAMPLE_D
+ { 5, 0 }, // SAMPLE_B
+ { 2, 0 }, // SQRT
+ { 1, 0 }, // SWITCH
+ { 3, 0 }, // SINCOS
+ { 3, 0 }, // UDIV
+ { 3, 0 }, // ULT
+ { 3, 0 }, // UGE
+ { 4, 0 }, // UMUL
+ { 4, 0 }, // UMAD
+ { 3, 0 }, // UMAX
+ { 3, 0 }, // UMIN
+ { 3, 0 }, // USHR
+ { 2, 0 }, // UTOF
+ { 3, 0 }, // XOR
+ { 1, 1 }, // DCL_RESOURCE
+ { 1, 0 }, // DCL_CONSTANT_BUFFER
+ { 1, 0 }, // DCL_SAMPLER
+ { 1, 1 }, // DCL_INDEX_RANGE
+ { 1, 0 }, // DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY
+ { 1, 0 }, // DCL_GS_INPUT_PRIMITIVE
+ { 0, 1 }, // DCL_MAX_OUTPUT_VERTEX_COUNT
+ { 1, 0 }, // DCL_INPUT
+ { 1, 1 }, // DCL_INPUT_SGV
+ { 1, 0 }, // DCL_INPUT_SIV
+ { 1, 0 }, // DCL_INPUT_PS
+ { 1, 1 }, // DCL_INPUT_PS_SGV
+ { 1, 1 }, // DCL_INPUT_PS_SIV
+ { 1, 0 }, // DCL_OUTPUT
+ { 1, 0 }, // DCL_OUTPUT_SGV
+ { 1, 1 }, // DCL_OUTPUT_SIV
+ { 0, 1 }, // DCL_TEMPS
+ { 0, 3 }, // DCL_INDEXABLE_TEMP
+ { 0, 0 }, // DCL_GLOBAL_FLAGS
+
+ { 0, 0 }, // InstrD3D10
+ { 4, 0 }, // LOD
+ { 4, 0 }, // GATHER4
+ { 0, 0 }, // SAMPLE_POS
+ { 0, 0 }, // SAMPLE_INFO
+
+ { 0, 0 }, // InstrD3D10_1
+ { 0, 0 }, // HS_DECLS
+ { 0, 0 }, // HS_CONTROL_POINT_PHASE
+ { 0, 0 }, // HS_FORK_PHASE
+ { 0, 0 }, // HS_JOIN_PHASE
+ { 0, 0 }, // EMIT_STREAM
+ { 0, 0 }, // CUT_STREAM
+ { 1, 0 }, // EMITTHENCUT_STREAM
+ { 1, 0 }, // INTERFACE_CALL
+ { 0, 0 }, // BUFINFO
+ { 2, 0 }, // DERIV_RTX_COARSE
+ { 2, 0 }, // DERIV_RTX_FINE
+ { 2, 0 }, // DERIV_RTY_COARSE
+ { 2, 0 }, // DERIV_RTY_FINE
+ { 5, 0 }, // GATHER4_C
+ { 5, 0 }, // GATHER4_PO
+ { 0, 0 }, // GATHER4_PO_C
+ { 0, 0 }, // RCP
+ { 0, 0 }, // F32TOF16
+ { 0, 0 }, // F16TOF32
+ { 0, 0 }, // UADDC
+ { 0, 0 }, // USUBB
+ { 0, 0 }, // COUNTBITS
+ { 0, 0 }, // FIRSTBIT_HI
+ { 0, 0 }, // FIRSTBIT_LO
+ { 0, 0 }, // FIRSTBIT_SHI
+ { 0, 0 }, // UBFE
+ { 0, 0 }, // IBFE
+ { 5, 0 }, // BFI
+ { 0, 0 }, // BFREV
+ { 5, 0 }, // SWAPC
+ { 0, 0 }, // DCL_STREAM
+ { 1, 0 }, // DCL_FUNCTION_BODY
+ { 0, 0 }, // DCL_FUNCTION_TABLE
+ { 0, 0 }, // DCL_INTERFACE
+ { 0, 0 }, // DCL_INPUT_CONTROL_POINT_COUNT
+ { 0, 0 }, // DCL_OUTPUT_CONTROL_POINT_COUNT
+ { 0, 0 }, // DCL_TESS_DOMAIN
+ { 0, 0 }, // DCL_TESS_PARTITIONING
+ { 0, 0 }, // DCL_TESS_OUTPUT_PRIMITIVE
+ { 0, 0 }, // DCL_HS_MAX_TESSFACTOR
+ { 0, 0 }, // DCL_HS_FORK_PHASE_INSTANCE_COUNT
+ { 0, 0 }, // DCL_HS_JOIN_PHASE_INSTANCE_COUNT
+ { 0, 3 }, // DCL_THREAD_GROUP
+ { 1, 1 }, // DCL_UNORDERED_ACCESS_VIEW_TYPED
+ { 1, 0 }, // DCL_UNORDERED_ACCESS_VIEW_RAW
+ { 1, 1 }, // DCL_UNORDERED_ACCESS_VIEW_STRUCTURED
+ { 1, 1 }, // DCL_THREAD_GROUP_SHARED_MEMORY_RAW
+ { 1, 2 }, // DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED
+ { 1, 0 }, // DCL_RESOURCE_RAW
+ { 1, 1 }, // DCL_RESOURCE_STRUCTURED
+ { 3, 0 }, // LD_UAV_TYPED
+ { 3, 0 }, // STORE_UAV_TYPED
+ { 3, 0 }, // LD_RAW
+ { 3, 0 }, // STORE_RAW
+ { 4, 0 }, // LD_STRUCTURED
+ { 4, 0 }, // STORE_STRUCTURED
+ { 3, 0 }, // ATOMIC_AND
+ { 3, 0 }, // ATOMIC_OR
+ { 3, 0 }, // ATOMIC_XOR
+ { 3, 0 }, // ATOMIC_CMP_STORE
+ { 3, 0 }, // ATOMIC_IADD
+ { 3, 0 }, // ATOMIC_IMAX
+ { 3, 0 }, // ATOMIC_IMIN
+ { 3, 0 }, // ATOMIC_UMAX
+ { 3, 0 }, // ATOMIC_UMIN
+ { 2, 0 }, // IMM_ATOMIC_ALLOC
+ { 2, 0 }, // IMM_ATOMIC_CONSUME
+ { 0, 0 }, // IMM_ATOMIC_IADD
+ { 0, 0 }, // IMM_ATOMIC_AND
+ { 0, 0 }, // IMM_ATOMIC_OR
+ { 0, 0 }, // IMM_ATOMIC_XOR
+ { 0, 0 }, // IMM_ATOMIC_EXCH
+ { 0, 0 }, // IMM_ATOMIC_CMP_EXCH
+ { 0, 0 }, // IMM_ATOMIC_IMAX
+ { 0, 0 }, // IMM_ATOMIC_IMIN
+ { 0, 0 }, // IMM_ATOMIC_UMAX
+ { 0, 0 }, // IMM_ATOMIC_UMIN
+ { 0, 0 }, // SYNC
+ { 3, 0 }, // DADD
+ { 3, 0 }, // DMAX
+ { 3, 0 }, // DMIN
+ { 3, 0 }, // DMUL
+ { 3, 0 }, // DEQ
+ { 3, 0 }, // DGE
+ { 3, 0 }, // DLT
+ { 3, 0 }, // DNE
+ { 2, 0 }, // DMOV
+ { 4, 0 }, // DMOVC
+ { 0, 0 }, // DTOF
+ { 0, 0 }, // FTOD
+ { 3, 0 }, // EVAL_SNAPPED
+ { 3, 0 }, // EVAL_SAMPLE_INDEX
+ { 2, 0 }, // EVAL_CENTROID
+ { 0, 1 }, // DCL_GS_INSTANCE_COUNT
+ { 0, 0 }, // ABORT
+ { 0, 0 }, // DEBUG_BREAK
+
+ { 0, 0 }, // InstrD3D11
+ { 0, 0 }, // DDIV
+ { 0, 0 }, // DFMA
+ { 0, 0 }, // DRCP
+ { 0, 0 }, // MSAD
+ { 0, 0 }, // DTOI
+ { 0, 0 }, // DTOU
+ { 0, 0 }, // ITOD
+ { 0, 0 }, // UTOD
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcodeInfo) == DxbcOpcode::Count);
+
+ static const char* s_dxbcOpcode[] =
+ {
+ "add",
+ "and",
+ "break",
+ "breakc",
+ "call",
+ "callc",
+ "case",
+ "continue",
+ "continuec",
+ "cut",
+ "default",
+ "deriv_rtx",
+ "deriv_rty",
+ "discard",
+ "div",
+ "dp2",
+ "dp3",
+ "dp4",
+ "else",
+ "emit",
+ "emitthencut",
+ "endif",
+ "endloop",
+ "endswitch",
+ "eq",
+ "exp",
+ "frc",
+ "ftoi",
+ "ftou",
+ "ge",
+ "iadd",
+ "if",
+ "ieq",
+ "ige",
+ "ilt",
+ "imad",
+ "imax",
+ "imin",
+ "imul",
+ "ine",
+ "ineg",
+ "ishl",
+ "ishr",
+ "itof",
+ "label",
+ "ld",
+ "ld_ms",
+ "log",
+ "loop",
+ "lt",
+ "mad",
+ "min",
+ "max",
+ "customdata",
+ "mov",
+ "movc",
+ "mul",
+ "ne",
+ "nop",
+ "not",
+ "or",
+ "resinfo",
+ "ret",
+ "retc",
+ "round_ne",
+ "round_ni",
+ "round_pi",
+ "round_z",
+ "rsq",
+ "sample",
+ "sample_c",
+ "sample_c_lz",
+ "sample_l",
+ "sample_d",
+ "sample_b",
+ "sqrt",
+ "switch",
+ "sincos",
+ "udiv",
+ "ult",
+ "uge",
+ "umul",
+ "umad",
+ "umax",
+ "umin",
+ "ushr",
+ "utof",
+ "xor",
+ "dcl_resource",
+ "dcl_constantbuffer",
+ "dcl_sampler",
+ "dcl_index_range",
+ "dcl_gs_output_primitive_topology",
+ "dcl_gs_input_primitive",
+ "dcl_max_output_vertex_count",
+ "dcl_input",
+ "dcl_input_sgv",
+ "dcl_input_siv",
+ "dcl_input_ps",
+ "dcl_input_ps_sgv",
+ "dcl_input_ps_siv",
+ "dcl_output",
+ "dcl_output_sgv",
+ "dcl_output_siv",
+ "dcl_temps",
+ "dcl_indexable_temp",
+ "dcl_global_flags",
+
+ NULL,
+ "lod",
+ "gather4",
+ "sample_pos",
+ "sample_info",
+
+ NULL,
+ "hs_decls",
+ "hs_control_point_phase",
+ "hs_fork_phase",
+ "hs_join_phase",
+ "emit_stream",
+ "cut_stream",
+ "emitthencut_stream",
+ "interface_call",
+ "bufinfo",
+ "deriv_rtx_coarse",
+ "deriv_rtx_fine",
+ "deriv_rty_coarse",
+ "deriv_rty_fine",
+ "gather4_c",
+ "gather4_po",
+ "gather4_po_c",
+ "rcp",
+ "f32tof16",
+ "f16tof32",
+ "uaddc",
+ "usubb",
+ "countbits",
+ "firstbit_hi",
+ "firstbit_lo",
+ "firstbit_shi",
+ "ubfe",
+ "ibfe",
+ "bfi",
+ "bfrev",
+ "swapc",
+ "dcl_stream",
+ "dcl_function_body",
+ "dcl_function_table",
+ "dcl_interface",
+ "dcl_input_control_point_count",
+ "dcl_output_control_point_count",
+ "dcl_tess_domain",
+ "dcl_tess_partitioning",
+ "dcl_tess_output_primitive",
+ "dcl_hs_max_tessfactor",
+ "dcl_hs_fork_phase_instance_count",
+ "dcl_hs_join_phase_instance_count",
+ "dcl_thread_group",
+ "dcl_unordered_access_view_typed",
+ "dcl_unordered_access_view_raw",
+ "dcl_unordered_access_view_structured",
+ "dcl_thread_group_shared_memory_raw",
+ "dcl_thread_group_shared_memory_structured",
+ "dcl_resource_raw",
+ "dcl_resource_structured",
+ "ld_uav_typed",
+ "store_uav_typed",
+ "ld_raw",
+ "store_raw",
+ "ld_structured",
+ "store_structured",
+ "atomic_and",
+ "atomic_or",
+ "atomic_xor",
+ "atomic_cmp_store",
+ "atomic_iadd",
+ "atomic_imax",
+ "atomic_imin",
+ "atomic_umax",
+ "atomic_umin",
+ "imm_atomic_alloc",
+ "imm_atomic_consume",
+ "imm_atomic_iadd",
+ "imm_atomic_and",
+ "imm_atomic_or",
+ "imm_atomic_xor",
+ "imm_atomic_exch",
+ "imm_atomic_cmp_exch",
+ "imm_atomic_imax",
+ "imm_atomic_imin",
+ "imm_atomic_umax",
+ "imm_atomic_umin",
+ "sync",
+ "dadd",
+ "dmax",
+ "dmin",
+ "dmul",
+ "deq",
+ "dge",
+ "dlt",
+ "dne",
+ "dmov",
+ "dmovc",
+ "dtof",
+ "ftod",
+ "eval_snapped",
+ "eval_sample_index",
+ "eval_centroid",
+ "dcl_gs_instance_count",
+ "abort",
+ "debug_break",
+
+ NULL,
+ "ddiv",
+ "dfma",
+ "drcp",
+ "msad",
+ "dtoi",
+ "dtou",
+ "itod",
+ "utod",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOpcode) == DxbcOpcode::Count);
+
+ const char* getName(DxbcOpcode::Enum _opcode)
+ {
+ BX_CHECK(_opcode < DxbcOpcode::Count, "Unknown opcode id %d.", _opcode);
+ return s_dxbcOpcode[_opcode];
+ }
+
+ static const char* s_dxbcSrvType[] =
+ {
+ "", // Unknown
+ "Buffer", // Buffer
+ "Texture1D", // Texture1D
+ "Texture2D", // Texture2D
+ "Texture2DMS", // Texture2DMS
+ "Texture3D", // Texture3D
+ "TextureCube", // TextureCube
+ "Texture1DArray", // Texture1DArray
+ "Texture2DArray", // Texture2DArray
+ "Texture2DMSArray", // Texture2DMSArray
+ "TextureCubearray", // TextureCubearray
+ "RawBuffer", // RawBuffer
+ "StructuredBuffer", // StructuredBuffer
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count);
+
+ const char* s_dxbcInterpolationName[] =
+ {
+ "",
+ "constant",
+ "linear",
+ "linear centroid",
+ "linear noperspective",
+ "linear noperspective centroid",
+ "linear sample",
+ "linear noperspective sample",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count);
+
+ // mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/shortfiles.txt
+ static const char* s_dxbcOperandType[] =
+ {
+ "r", // Temp
+ "v", // Input
+ "o", // Output
+ "x", // TempArray
+ "l", // Imm32
+ "d", // Imm64
+ "s", // Sampler
+ "t", // Resource
+ "cb", // ConstantBuffer
+ "icb", // ImmConstantBuffer
+ "label", // Label
+ "vPrim", // PrimitiveID
+ "oDepth", // OutputDepth
+ "null", // Null
+ "rasterizer", // Rasterizer
+ "oMask", // CoverageMask
+ "stream", // Stream
+ "function_body", // FunctionBody
+ "function_table", // FunctionTable
+ "interface", // Interface
+ "function_input", // FunctionInput
+ "function_output", // FunctionOutput
+ "vOutputControlPointID", // OutputControlPointId
+ "vForkInstanceID", // InputForkInstanceId
+ "vJoinInstanceID", // InputJoinInstanceId
+ "vicp", // InputControlPoint
+ "vocp", // OutputControlPoint
+ "vpc", // InputPatchConstant
+ "vDomain", // InputDomainPoint
+ "this", // ThisPointer
+ "u", // UnorderedAccessView
+ "g", // ThreadGroupSharedMemory
+ "vThreadID", // InputThreadId
+ "vThreadGrouID", // InputThreadGroupId
+ "vThreadIDInGroup", // InputThreadIdInGroup
+ "vCoverage", // InputCoverageMask
+ "vThreadIDInGroupFlattened", // InputThreadIdInGroupFlattened
+ "vGSInstanceID", // InputGsInstanceId
+ "oDepthGE", // OutputDepthGreaterEqual
+ "oDepthLE", // OutputDepthLessEqual
+ "vCycleCounter", // CycleCounter
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcOperandType) == DxbcOperandType::Count);
+
+#define DXBC_MAX_NAME_STRING 512
+
+ int32_t readString(bx::ReaderSeekerI* _reader, int64_t _offset, char* _out, uint32_t _max = DXBC_MAX_NAME_STRING)
+ {
+ int64_t oldOffset = bx::seek(_reader);
+ bx::seek(_reader, _offset, bx::Whence::Begin);
+
+ int32_t size = 0;
+
+ for (uint32_t ii = 0; ii < _max-1; ++ii)
+ {
+ char ch;
+ size += bx::read(_reader, ch);
+ *_out++ = ch;
+
+ if ('\0' == ch)
+ {
+ break;
+ }
+ }
+ *_out = '\0';
+
+ bx::seek(_reader, oldOffset, bx::Whence::Begin);
+
+ return size;
+ }
+
+ inline uint32_t dxbcMixF(uint32_t _b, uint32_t _c, uint32_t _d)
+ {
+ const uint32_t tmp0 = bx::uint32_xor(_c, _d);
+ const uint32_t tmp1 = bx::uint32_and(_b, tmp0);
+ const uint32_t result = bx::uint32_xor(_d, tmp1);
+
+ return result;
+ }
+
+ inline uint32_t dxbcMixG(uint32_t _b, uint32_t _c, uint32_t _d)
+ {
+ return dxbcMixF(_d, _b, _c);
+ }
+
+ inline uint32_t dxbcMixH(uint32_t _b, uint32_t _c, uint32_t _d)
+ {
+ const uint32_t tmp0 = bx::uint32_xor(_b, _c);
+ const uint32_t result = bx::uint32_xor(_d, tmp0);
+
+ return result;
+ }
+
+ inline uint32_t dxbcMixI(uint32_t _b, uint32_t _c, uint32_t _d)
+ {
+ const uint32_t tmp0 = bx::uint32_orc(_b, _d);
+ const uint32_t result = bx::uint32_xor(_c, tmp0);
+
+ return result;
+ }
+
+ void dxbcHashBlock(const uint32_t* data, uint32_t* hash)
+ {
+ const uint32_t d0 = data[ 0];
+ const uint32_t d1 = data[ 1];
+ const uint32_t d2 = data[ 2];
+ const uint32_t d3 = data[ 3];
+ const uint32_t d4 = data[ 4];
+ const uint32_t d5 = data[ 5];
+ const uint32_t d6 = data[ 6];
+ const uint32_t d7 = data[ 7];
+ const uint32_t d8 = data[ 8];
+ const uint32_t d9 = data[ 9];
+ const uint32_t d10 = data[10];
+ const uint32_t d11 = data[11];
+ const uint32_t d12 = data[12];
+ const uint32_t d13 = data[13];
+ const uint32_t d14 = data[14];
+ const uint32_t d15 = data[15];
+
+ uint32_t aa = hash[0];
+ uint32_t bb = hash[1];
+ uint32_t cc = hash[2];
+ uint32_t dd = hash[3];
+
+ aa = bb + bx::uint32_rol(aa + dxbcMixF(bb, cc, dd) + d0 + 0xd76aa478, 7);
+ dd = aa + bx::uint32_rol(dd + dxbcMixF(aa, bb, cc) + d1 + 0xe8c7b756, 12);
+ cc = dd + bx::uint32_ror(cc + dxbcMixF(dd, aa, bb) + d2 + 0x242070db, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixF(cc, dd, aa) + d3 + 0xc1bdceee, 10);
+ aa = bb + bx::uint32_rol(aa + dxbcMixF(bb, cc, dd) + d4 + 0xf57c0faf, 7);
+ dd = aa + bx::uint32_rol(dd + dxbcMixF(aa, bb, cc) + d5 + 0x4787c62a, 12);
+ cc = dd + bx::uint32_ror(cc + dxbcMixF(dd, aa, bb) + d6 + 0xa8304613, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixF(cc, dd, aa) + d7 + 0xfd469501, 10);
+ aa = bb + bx::uint32_rol(aa + dxbcMixF(bb, cc, dd) + d8 + 0x698098d8, 7);
+ dd = aa + bx::uint32_rol(dd + dxbcMixF(aa, bb, cc) + d9 + 0x8b44f7af, 12);
+ cc = dd + bx::uint32_ror(cc + dxbcMixF(dd, aa, bb) + d10 + 0xffff5bb1, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixF(cc, dd, aa) + d11 + 0x895cd7be, 10);
+ aa = bb + bx::uint32_rol(aa + dxbcMixF(bb, cc, dd) + d12 + 0x6b901122, 7);
+ dd = aa + bx::uint32_rol(dd + dxbcMixF(aa, bb, cc) + d13 + 0xfd987193, 12);
+ cc = dd + bx::uint32_ror(cc + dxbcMixF(dd, aa, bb) + d14 + 0xa679438e, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixF(cc, dd, aa) + d15 + 0x49b40821, 10);
+
+ aa = bb + bx::uint32_rol(aa + dxbcMixG(bb, cc, dd) + d1 + 0xf61e2562, 5);
+ dd = aa + bx::uint32_rol(dd + dxbcMixG(aa, bb, cc) + d6 + 0xc040b340, 9);
+ cc = dd + bx::uint32_rol(cc + dxbcMixG(dd, aa, bb) + d11 + 0x265e5a51, 14);
+ bb = cc + bx::uint32_ror(bb + dxbcMixG(cc, dd, aa) + d0 + 0xe9b6c7aa, 12);
+ aa = bb + bx::uint32_rol(aa + dxbcMixG(bb, cc, dd) + d5 + 0xd62f105d, 5);
+ dd = aa + bx::uint32_rol(dd + dxbcMixG(aa, bb, cc) + d10 + 0x02441453, 9);
+ cc = dd + bx::uint32_rol(cc + dxbcMixG(dd, aa, bb) + d15 + 0xd8a1e681, 14);
+ bb = cc + bx::uint32_ror(bb + dxbcMixG(cc, dd, aa) + d4 + 0xe7d3fbc8, 12);
+ aa = bb + bx::uint32_rol(aa + dxbcMixG(bb, cc, dd) + d9 + 0x21e1cde6, 5);
+ dd = aa + bx::uint32_rol(dd + dxbcMixG(aa, bb, cc) + d14 + 0xc33707d6, 9);
+ cc = dd + bx::uint32_rol(cc + dxbcMixG(dd, aa, bb) + d3 + 0xf4d50d87, 14);
+ bb = cc + bx::uint32_ror(bb + dxbcMixG(cc, dd, aa) + d8 + 0x455a14ed, 12);
+ aa = bb + bx::uint32_rol(aa + dxbcMixG(bb, cc, dd) + d13 + 0xa9e3e905, 5);
+ dd = aa + bx::uint32_rol(dd + dxbcMixG(aa, bb, cc) + d2 + 0xfcefa3f8, 9);
+ cc = dd + bx::uint32_rol(cc + dxbcMixG(dd, aa, bb) + d7 + 0x676f02d9, 14);
+ bb = cc + bx::uint32_ror(bb + dxbcMixG(cc, dd, aa) + d12 + 0x8d2a4c8a, 12);
+
+ aa = bb + bx::uint32_rol(aa + dxbcMixH(bb, cc, dd) + d5 + 0xfffa3942, 4);
+ dd = aa + bx::uint32_rol(dd + dxbcMixH(aa, bb, cc) + d8 + 0x8771f681, 11);
+ cc = dd + bx::uint32_rol(cc + dxbcMixH(dd, aa, bb) + d11 + 0x6d9d6122, 16);
+ bb = cc + bx::uint32_ror(bb + dxbcMixH(cc, dd, aa) + d14 + 0xfde5380c, 9);
+ aa = bb + bx::uint32_rol(aa + dxbcMixH(bb, cc, dd) + d1 + 0xa4beea44, 4);
+ dd = aa + bx::uint32_rol(dd + dxbcMixH(aa, bb, cc) + d4 + 0x4bdecfa9, 11);
+ cc = dd + bx::uint32_rol(cc + dxbcMixH(dd, aa, bb) + d7 + 0xf6bb4b60, 16);
+ bb = cc + bx::uint32_ror(bb + dxbcMixH(cc, dd, aa) + d10 + 0xbebfbc70, 9);
+ aa = bb + bx::uint32_rol(aa + dxbcMixH(bb, cc, dd) + d13 + 0x289b7ec6, 4);
+ dd = aa + bx::uint32_rol(dd + dxbcMixH(aa, bb, cc) + d0 + 0xeaa127fa, 11);
+ cc = dd + bx::uint32_rol(cc + dxbcMixH(dd, aa, bb) + d3 + 0xd4ef3085, 16);
+ bb = cc + bx::uint32_ror(bb + dxbcMixH(cc, dd, aa) + d6 + 0x04881d05, 9);
+ aa = bb + bx::uint32_rol(aa + dxbcMixH(bb, cc, dd) + d9 + 0xd9d4d039, 4);
+ dd = aa + bx::uint32_rol(dd + dxbcMixH(aa, bb, cc) + d12 + 0xe6db99e5, 11);
+ cc = dd + bx::uint32_rol(cc + dxbcMixH(dd, aa, bb) + d15 + 0x1fa27cf8, 16);
+ bb = cc + bx::uint32_ror(bb + dxbcMixH(cc, dd, aa) + d2 + 0xc4ac5665, 9);
+
+ aa = bb + bx::uint32_rol(aa + dxbcMixI(bb, cc, dd) + d0 + 0xf4292244, 6);
+ dd = aa + bx::uint32_rol(dd + dxbcMixI(aa, bb, cc) + d7 + 0x432aff97, 10);
+ cc = dd + bx::uint32_rol(cc + dxbcMixI(dd, aa, bb) + d14 + 0xab9423a7, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixI(cc, dd, aa) + d5 + 0xfc93a039, 11);
+ aa = bb + bx::uint32_rol(aa + dxbcMixI(bb, cc, dd) + d12 + 0x655b59c3, 6);
+ dd = aa + bx::uint32_rol(dd + dxbcMixI(aa, bb, cc) + d3 + 0x8f0ccc92, 10);
+ cc = dd + bx::uint32_rol(cc + dxbcMixI(dd, aa, bb) + d10 + 0xffeff47d, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixI(cc, dd, aa) + d1 + 0x85845dd1, 11);
+ aa = bb + bx::uint32_rol(aa + dxbcMixI(bb, cc, dd) + d8 + 0x6fa87e4f, 6);
+ dd = aa + bx::uint32_rol(dd + dxbcMixI(aa, bb, cc) + d15 + 0xfe2ce6e0, 10);
+ cc = dd + bx::uint32_rol(cc + dxbcMixI(dd, aa, bb) + d6 + 0xa3014314, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixI(cc, dd, aa) + d13 + 0x4e0811a1, 11);
+ aa = bb + bx::uint32_rol(aa + dxbcMixI(bb, cc, dd) + d4 + 0xf7537e82, 6);
+ dd = aa + bx::uint32_rol(dd + dxbcMixI(aa, bb, cc) + d11 + 0xbd3af235, 10);
+ cc = dd + bx::uint32_rol(cc + dxbcMixI(dd, aa, bb) + d2 + 0x2ad7d2bb, 15);
+ bb = cc + bx::uint32_ror(bb + dxbcMixI(cc, dd, aa) + d9 + 0xeb86d391, 11);
+
+ hash[0] += aa;
+ hash[1] += bb;
+ hash[2] += cc;
+ hash[3] += dd;
+ }
+
+ // dxbc hash function is slightly modified version of MD5 hash.
+ // https://tools.ietf.org/html/rfc1321
+ // http://www.efgh.com/software/md5.txt
+ //
+ // Assumption is that data pointer, size are both 4-byte aligned,
+ // and little endian.
+ //
+ void dxbcHash(const void* _data, uint32_t _size, void* _digest)
+ {
+ uint32_t hash[4] =
+ {
+ 0x67452301,
+ 0xefcdab89,
+ 0x98badcfe,
+ 0x10325476,
+ };
+
+ const uint32_t* data = (const uint32_t*)_data;
+ for (uint32_t ii = 0, num = _size/64; ii < num; ++ii)
+ {
+ dxbcHashBlock(data, hash);
+ data += 16;
+ }
+
+ uint32_t last[16];
+ memset(last, 0, sizeof(last) );
+
+ const uint32_t remaining = _size & 0x3f;
+
+ if (remaining >= 56)
+ {
+ memcpy(&last[0], data, remaining);
+ last[remaining/4] = 0x80;
+ dxbcHashBlock(last, hash);
+
+ memset(&last[1], 0, 56);
+ }
+ else
+ {
+ memcpy(&last[1], data, remaining);
+ last[1 + remaining/4] = 0x80;
+ }
+
+ last[ 0] = _size * 8;
+ last[15] = _size * 2 + 1;
+ dxbcHashBlock(last, hash);
+
+ memcpy(_digest, hash, 16);
+ }
+
+ int32_t read(bx::ReaderI* _reader, DxbcSubOperand& _subOperand)
+ {
+ uint32_t token;
+ int32_t size = 0;
+
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // e222111000nnttttttttssssssssmmoo
+ // ^^ ^ ^ ^ ^ ^ ^ ^-- number of operands
+ // || | | | | | +---- operand mode
+ // || | | | | +------------ operand mode bits
+ // || | | | +-------------------- type
+ // || | | +---------------------- number of addressing modes
+ // || | +------------------------- addressing mode 0
+ // || +---------------------------- addressing mode 1
+ // |+------------------------------- addressing mode 2
+ // +-------------------------------- extended
+
+ size += bx::read(_reader, token);
+ _subOperand.type = DxbcOperandType::Enum( (token & UINT32_C(0x000ff000) ) >> 12);
+ _subOperand.numAddrModes = uint8_t( (token & UINT32_C(0x00300000) ) >> 20);
+ _subOperand.addrMode = uint8_t( (token & UINT32_C(0x01c00000) ) >> 22);
+ _subOperand.mode = DxbcOperandMode::Enum( (token & UINT32_C(0x0000000c) ) >> 2);
+ _subOperand.modeBits = uint8_t( (token & UINT32_C(0x00000ff0) ) >> 4) & "\x0f\xff\x03\x00"[_subOperand.mode];
+ _subOperand.num = uint8_t( (token & UINT32_C(0x00000003) ) );
+
+ switch (_subOperand.addrMode)
+ {
+ case DxbcOperandAddrMode::Imm32:
+ size += bx::read(_reader, _subOperand.regIndex);
+ break;
+
+ case DxbcOperandAddrMode::Reg:
+ {
+ DxbcSubOperand subOperand;
+ size += read(_reader, subOperand);
+ }
+ break;
+
+ case DxbcOperandAddrMode::RegImm32:
+ {
+ size += bx::read(_reader, _subOperand.regIndex);
+
+ DxbcSubOperand subOperand;
+ size += read(_reader, subOperand);
+ }
+ break;
+
+ case DxbcOperandAddrMode::RegImm64:
+ {
+ size += bx::read(_reader, _subOperand.regIndex);
+ size += bx::read(_reader, _subOperand.regIndex);
+
+ DxbcSubOperand subOperand;
+ size += read(_reader, subOperand);
+ }
+ break;
+
+ default:
+ BX_CHECK(false, "sub operand addressing mode %d", _subOperand.addrMode);
+ break;
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const DxbcSubOperand& _subOperand)
+ {
+ int32_t size = 0;
+
+ uint32_t token = 0;
+ token |= (_subOperand.type << 12) & UINT32_C(0x000ff000);
+ token |= (_subOperand.numAddrModes << 20) & UINT32_C(0x00300000);
+ token |= (_subOperand.addrMode << 22) & UINT32_C(0x01c00000);
+ token |= (_subOperand.mode << 2) & UINT32_C(0x0000000c);
+ token |= (_subOperand.modeBits << 4) & UINT32_C(0x00000ff0);
+ token |= _subOperand.num & UINT32_C(0x00000003);
+ size += bx::write(_writer, token);
+
+ switch (_subOperand.addrMode)
+ {
+ case DxbcOperandAddrMode::Imm32:
+ size += bx::write(_writer, _subOperand.regIndex);
+ break;
+
+ case DxbcOperandAddrMode::Reg:
+ {
+ DxbcSubOperand subOperand;
+ size += write(_writer, subOperand);
+ }
+ break;
+
+ case DxbcOperandAddrMode::RegImm32:
+ {
+ size += bx::write(_writer, _subOperand.regIndex);
+
+ DxbcSubOperand subOperand;
+ size += write(_writer, subOperand);
+ }
+ break;
+
+ case DxbcOperandAddrMode::RegImm64:
+ {
+ size += bx::write(_writer, _subOperand.regIndex);
+ size += bx::write(_writer, _subOperand.regIndex);
+
+ DxbcSubOperand subOperand;
+ size += write(_writer, subOperand);
+ }
+ break;
+
+ default:
+ BX_CHECK(false, "sub operand addressing mode %d", _subOperand.addrMode);
+ break;
+ }
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderI* _reader, DxbcOperand& _operand)
+ {
+ int32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // e222111000nnttttttttssssssssmmoo
+ // ^^ ^ ^ ^ ^ ^ ^ ^-- number of operands
+ // || | | | | | +---- operand mode
+ // || | | | | +------------ operand mode bits
+ // || | | | +-------------------- type
+ // || | | +---------------------- number of addressing modes
+ // || | +------------------------- addressing mode 0
+ // || +---------------------------- addressing mode 1
+ // |+------------------------------- addressing mode 2
+ // +-------------------------------- extended
+
+ _operand.extended = 0 != (token & UINT32_C(0x80000000) );
+ _operand.numAddrModes = uint8_t( (token & UINT32_C(0x00300000) ) >> 20);
+ _operand.addrMode[0] = uint8_t( (token & UINT32_C(0x01c00000) ) >> 22);
+ _operand.addrMode[1] = uint8_t( (token & UINT32_C(0x0e000000) ) >> 25);
+ _operand.addrMode[2] = uint8_t( (token & UINT32_C(0x70000000) ) >> 28);
+ _operand.type = DxbcOperandType::Enum( (token & UINT32_C(0x000ff000) ) >> 12);
+ _operand.mode = DxbcOperandMode::Enum( (token & UINT32_C(0x0000000c) ) >> 2);
+ _operand.modeBits = uint8_t( (token & UINT32_C(0x00000ff0) ) >> 4) & "\x0f\xff\x03\x00"[_operand.mode];
+ _operand.num = uint8_t( (token & UINT32_C(0x00000003) ) );
+
+ if (_operand.extended)
+ {
+ size += bx::read(_reader, _operand.extBits);
+ }
+
+ switch (_operand.type)
+ {
+ case DxbcOperandType::Imm32:
+ _operand.num = 2 == _operand.num ? 4 : _operand.num;
+ for (uint32_t ii = 0; ii < _operand.num; ++ii)
+ {
+ size += bx::read(_reader, _operand.un.imm32[ii]);
+ }
+ break;
+
+ case DxbcOperandType::Imm64:
+ _operand.num = 2 == _operand.num ? 4 : _operand.num;
+ for (uint32_t ii = 0; ii < _operand.num; ++ii)
+ {
+ size += bx::read(_reader, _operand.un.imm64[ii]);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ for (uint32_t ii = 0; ii < _operand.numAddrModes; ++ii)
+ {
+ switch (_operand.addrMode[ii])
+ {
+ case DxbcOperandAddrMode::Imm32:
+ size += bx::read(_reader, _operand.regIndex[ii]);
+ break;
+
+ case DxbcOperandAddrMode::Reg:
+ size += read(_reader, _operand.subOperand[ii]);
+ break;
+
+ case DxbcOperandAddrMode::RegImm32:
+ size += bx::read(_reader, _operand.regIndex[ii]);
+ size += read(_reader, _operand.subOperand[ii]);
+ break;
+
+ default:
+ BX_CHECK(false, "operand %d addressing mode %d", ii, _operand.addrMode[ii]);
+ break;
+ }
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const DxbcOperand& _operand)
+ {
+ int32_t size = 0;
+
+ uint32_t token = 0;
+ token |= _operand.extended ? UINT32_C(0x80000000) : 0;
+ token |= (_operand.numAddrModes << 20) & UINT32_C(0x00300000);
+ token |= (_operand.addrMode[0] << 22) & UINT32_C(0x01c00000);
+ token |= (_operand.addrMode[1] << 25) & UINT32_C(0x0e000000);
+ token |= (_operand.addrMode[2] << 28) & UINT32_C(0x70000000);
+ token |= (_operand.type << 12) & UINT32_C(0x000ff000);
+ token |= (_operand.mode << 2) & UINT32_C(0x0000000c);
+
+ token |= (4 == _operand.num ? 2 : _operand.num) & UINT32_C(0x00000003);
+ token |= ( (_operand.modeBits & "\x0f\xff\x03\x00"[_operand.mode]) << 4) & UINT32_C(0x00000ff0);
+
+ size += bx::write(_writer, token);
+
+ if (_operand.extended)
+ {
+ size += bx::write(_writer, _operand.extBits);
+ }
+
+ switch (_operand.type)
+ {
+ case DxbcOperandType::Imm32:
+ for (uint32_t ii = 0; ii < _operand.num; ++ii)
+ {
+ size += bx::write(_writer, _operand.un.imm32[ii]);
+ }
+ break;
+
+ case DxbcOperandType::Imm64:
+ for (uint32_t ii = 0; ii < _operand.num; ++ii)
+ {
+ size += bx::write(_writer, _operand.un.imm64[ii]);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ for (uint32_t ii = 0; ii < _operand.numAddrModes; ++ii)
+ {
+ switch (_operand.addrMode[ii])
+ {
+ case DxbcOperandAddrMode::Imm32:
+ size += bx::write(_writer, _operand.regIndex[ii]);
+ break;
+
+ case DxbcOperandAddrMode::Reg:
+ size += write(_writer, _operand.subOperand[ii]);
+ break;
+
+ case DxbcOperandAddrMode::RegImm32:
+ size += bx::write(_writer, _operand.regIndex[ii]);
+ size += write(_writer, _operand.subOperand[ii]);
+ break;
+
+ default:
+ BX_CHECK(false, "operand %d addressing mode %d", ii, _operand.addrMode[ii]);
+ break;
+ }
+ }
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderI* _reader, DxbcInstruction& _instruction)
+ {
+ uint32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // elllllll.............ooooooooooo
+ // ^^ ^----------- opcode
+ // |+------------------------------- length
+ // +-------------------------------- extended
+
+ _instruction.opcode = DxbcOpcode::Enum( (token & UINT32_C(0x000007ff) ) );
+ _instruction.length = uint8_t( (token & UINT32_C(0x7f000000) ) >> 24);
+ bool extended = 0 != (token & UINT32_C(0x80000000) );
+
+ _instruction.srv = DxbcResourceDim::Unknown;
+ _instruction.samples = 0;
+
+ _instruction.shadow = false;
+ _instruction.mono = false;
+
+ _instruction.allowRefactoring = false;
+ _instruction.fp64 = false;
+ _instruction.earlyDepth = false;
+ _instruction.enableBuffers = false;
+ _instruction.skipOptimization = false;
+ _instruction.enableMinPrecision = false;
+ _instruction.enableDoubleExtensions = false;
+ _instruction.enableShaderExtensions = false;
+
+ _instruction.threadsInGroup = false;
+ _instruction.sharedMemory = false;
+ _instruction.uavGroup = false;
+ _instruction.uavGlobal = false;
+
+ _instruction.saturate = false;
+ _instruction.testNZ = false;
+ _instruction.retType = DxbcResourceReturnType::Unused;
+
+ switch (_instruction.opcode)
+ {
+ case DxbcOpcode::CUSTOMDATA:
+ {
+// uint32_t dataClass;
+ size += bx::read(_reader, _instruction.length);
+ for (uint32_t ii = 0, num = (_instruction.length-2)/4; ii < num; ++ii)
+ {
+ char temp[16];
+ size += bx::read(_reader, temp, 16);
+ }
+
+ }
+ return size;
+
+ case DxbcOpcode::DCL_CONSTANT_BUFFER:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ a...........
+ // ^------------ Allow refactoring
+
+ _instruction.allowRefactoring = 0 != (token & UINT32_C(0x00000800) );
+ break;
+
+ case DxbcOpcode::DCL_GLOBAL_FLAGS:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ sxmoudfa...........
+ // ^^^^^^^^------------ Allow refactoring
+ // ||||||+------------- FP64
+ // |||||+-------------- Force early depth/stencil
+ // ||||+--------------- Enable raw and structured buffers
+ // |||+---------------- Skip optimizations
+ // ||+----------------- Enable minimum precision
+ // |+------------------ Enable double extension
+ // +------------------- Enable shader extension
+
+ _instruction.allowRefactoring = 0 != (token & UINT32_C(0x00000800) );
+ _instruction.fp64 = 0 != (token & UINT32_C(0x00001000) );
+ _instruction.earlyDepth = 0 != (token & UINT32_C(0x00002000) );
+ _instruction.enableBuffers = 0 != (token & UINT32_C(0x00004000) );
+ _instruction.skipOptimization = 0 != (token & UINT32_C(0x00008000) );
+ _instruction.enableMinPrecision = 0 != (token & UINT32_C(0x00010000) );
+ _instruction.enableDoubleExtensions = 0 != (token & UINT32_C(0x00020000) );
+ _instruction.enableShaderExtensions = 0 != (token & UINT32_C(0x00040000) );
+ break;
+
+ case DxbcOpcode::DCL_INPUT_PS:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ iiiii...........
+ // ^---------------- Interploation
+
+ _instruction.interpolation = DxbcInterpolation::Enum( (token & UINT32_C(0x0000f800) ) >> 11);
+ break;
+
+ case DxbcOpcode::DCL_RESOURCE:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ sssssssrrrrr...........
+ // ^ ^---------------- SRV
+ // +----------------------- MSAA samples
+
+ _instruction.srv = DxbcResourceDim::Enum( (token & UINT32_C(0x0000f800) ) >> 11);
+ _instruction.samples = uint8_t( (token & UINT32_C(0x007f0000) ) >> 16);
+ break;
+
+ case DxbcOpcode::DCL_SAMPLER:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ ms...........
+ // ^^------------ Shadow sampler
+ // +------------- Mono
+
+ _instruction.shadow = 0 != (token & UINT32_C(0x00000800) );
+ _instruction.mono = 0 != (token & UINT32_C(0x00001000) );
+ break;
+
+ case DxbcOpcode::SYNC:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ gust...........
+ // ^^^^------------ Threads in group
+ // ||+------------- Shared memory
+ // |+-------------- UAV group
+ // +--------------- UAV global
+
+ _instruction.threadsInGroup = 0 != (token & UINT32_C(0x00000800) );
+ _instruction.sharedMemory = 0 != (token & UINT32_C(0x00001000) );
+ _instruction.uavGroup = 0 != (token & UINT32_C(0x00002000) );
+ _instruction.uavGlobal = 0 != (token & UINT32_C(0x00004000) );
+ break;
+
+ default:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ ppppn stt...........
+ // ^ ^ ^^------------- Resource info return type
+ // | | +-------------- Saturate
+ // | +------------------- Test not zero
+ // +----------------------- Precise mask
+
+ _instruction.retType = DxbcResourceReturnType::Enum( (token & UINT32_C(0x00001800) ) >> 11);
+ _instruction.saturate = 0 != (token & UINT32_C(0x00002000) );
+ _instruction.testNZ = 0 != (token & UINT32_C(0x00040000) );
+// _instruction.precise = uint8_t( (token & UINT32_C(0x00780000) ) >> 19);
+ break;
+ }
+
+ _instruction.extended[0] = DxbcInstruction::ExtendedType::Count;
+ for (uint32_t ii = 0; extended; ++ii)
+ {
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // e..........................ttttt
+ // ^ ^
+ // | +----- type
+ // +-------------------------------- extended
+
+ uint32_t extBits;
+ size += bx::read(_reader, extBits);
+ extended = 0 != (extBits & UINT32_C(0x80000000) );
+ _instruction.extended[ii] = DxbcInstruction::ExtendedType::Enum(extBits & UINT32_C(0x0000001f) );
+ _instruction.extended[ii+1] = DxbcInstruction::ExtendedType::Count;
+
+ switch (_instruction.extended[ii])
+ {
+ case DxbcInstruction::ExtendedType::SampleControls:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . zzzzyyyyxxxx .....
+ // ^ ^ ^
+ // | | +------------- x
+ // | +----------------- y
+ // +--------------------- z
+
+ _instruction.sampleOffsets[0] = uint8_t( (extBits & UINT32_C(0x00001e00) ) >> 9);
+ _instruction.sampleOffsets[1] = uint8_t( (extBits & UINT32_C(0x0001e000) ) >> 13);
+ _instruction.sampleOffsets[2] = uint8_t( (extBits & UINT32_C(0x001e0000) ) >> 17);
+ break;
+
+ case DxbcInstruction::ExtendedType::ResourceDim:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . .....
+ //
+
+ _instruction.resourceTarget = uint8_t( (extBits & UINT32_C(0x000003e0) ) >> 6);
+ _instruction.resourceStride = uint8_t( (extBits & UINT32_C(0x0000f800) ) >> 11);
+ break;
+
+ case DxbcInstruction::ExtendedType::ResourceReturnType:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . 3333222211110000.....
+ // ^ ^ ^
+ // | | +------------- x
+ // | +----------------- y
+ // +--------------------- z
+
+ _instruction.resourceReturnTypes[0] = DxbcResourceReturnType::Enum( (extBits & UINT32_C(0x000001e0) ) >> 6);
+ _instruction.resourceReturnTypes[1] = DxbcResourceReturnType::Enum( (extBits & UINT32_C(0x00001e00) ) >> 9);
+ _instruction.resourceReturnTypes[2] = DxbcResourceReturnType::Enum( (extBits & UINT32_C(0x0001e000) ) >> 13);
+ _instruction.resourceReturnTypes[3] = DxbcResourceReturnType::Enum( (extBits & UINT32_C(0x001e0000) ) >> 17);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ switch (_instruction.opcode)
+ {
+ case DxbcOpcode::DCL_FUNCTION_TABLE:
+ {
+ uint32_t tableId;
+ size += read(_reader, tableId);
+
+ uint32_t num;
+ size += read(_reader, num);
+
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ uint32_t bodyId;
+ size += read(_reader, bodyId);
+ }
+ }
+ break;
+
+ case DxbcOpcode::DCL_INTERFACE:
+ {
+ uint32_t interfaceId;
+ size += read(_reader, interfaceId);
+
+ uint32_t num;
+ size += read(_reader, num);
+
+ BX_CHECK(false, "not implemented.");
+ }
+ break;
+
+ default:
+ break;
+ };
+
+ uint32_t currOp = 0;
+
+ const DxbcOpcodeInfo& info = s_dxbcOpcodeInfo[_instruction.opcode];
+ _instruction.numOperands = info.numOperands;
+ switch (info.numOperands)
+ {
+ case 6: size += read(_reader, _instruction.operand[currOp++]);
+ case 5: size += read(_reader, _instruction.operand[currOp++]);
+ case 4: size += read(_reader, _instruction.operand[currOp++]);
+ case 3: size += read(_reader, _instruction.operand[currOp++]);
+ case 2: size += read(_reader, _instruction.operand[currOp++]);
+ case 1: size += read(_reader, _instruction.operand[currOp++]);
+ case 0:
+ if (0 < info.numValues)
+ {
+ size += read(_reader, _instruction.value, info.numValues*sizeof(uint32_t) );
+ }
+ break;
+
+ default:
+ BX_CHECK(false, "Instruction %s with invalid number of operands %d (numValues %d)."
+ , getName(_instruction.opcode)
+ , info.numOperands
+ , info.numValues
+ );
+ break;
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const DxbcInstruction& _instruction)
+ {
+ uint32_t token = 0;
+ token |= (_instruction.opcode ) & UINT32_C(0x000007ff);
+ token |= (_instruction.length << 24) & UINT32_C(0x7f000000);
+
+ token |= DxbcInstruction::ExtendedType::Count != _instruction.extended[0]
+ ? UINT32_C(0x80000000)
+ : 0
+ ;
+
+ switch (_instruction.opcode)
+ {
+// case DxbcOpcode::CUSTOMDATA:
+// return size;
+
+ case DxbcOpcode::DCL_CONSTANT_BUFFER:
+ token |= _instruction.allowRefactoring ? UINT32_C(0x00000800) : 0;
+ break;
+
+ case DxbcOpcode::DCL_GLOBAL_FLAGS:
+ token |= _instruction.allowRefactoring ? UINT32_C(0x00000800) : 0;
+ token |= _instruction.fp64 ? UINT32_C(0x00001000) : 0;
+ token |= _instruction.earlyDepth ? UINT32_C(0x00002000) : 0;
+ token |= _instruction.enableBuffers ? UINT32_C(0x00004000) : 0;
+ token |= _instruction.skipOptimization ? UINT32_C(0x00008000) : 0;
+ token |= _instruction.enableMinPrecision ? UINT32_C(0x00010000) : 0;
+ token |= _instruction.enableDoubleExtensions ? UINT32_C(0x00020000) : 0;
+ token |= _instruction.enableShaderExtensions ? UINT32_C(0x00040000) : 0;
+ break;
+
+ case DxbcOpcode::DCL_INPUT_PS:
+ token |= (_instruction.interpolation << 11) & UINT32_C(0x0000f800);
+ break;
+
+ case DxbcOpcode::DCL_RESOURCE:
+ token |= (_instruction.srv << 11) & UINT32_C(0x0000f800);
+ token |= (_instruction.samples << 16) & UINT32_C(0x007f0000);
+ break;
+
+ case DxbcOpcode::DCL_SAMPLER:
+ token |= _instruction.shadow ? (0x00000800) : 0;
+ token |= _instruction.mono ? (0x00001000) : 0;
+ break;
+
+ case DxbcOpcode::SYNC:
+ token |= _instruction.threadsInGroup ? UINT32_C(0x00000800) : 0;
+ token |= _instruction.sharedMemory ? UINT32_C(0x00001000) : 0;
+ token |= _instruction.uavGroup ? UINT32_C(0x00002000) : 0;
+ token |= _instruction.uavGlobal ? UINT32_C(0x00004000) : 0;
+ break;
+
+ default:
+ token |= (_instruction.retType << 11) & UINT32_C(0x00001800);
+ token |= _instruction.saturate ? UINT32_C(0x00002000) : 0;
+ token |= _instruction.testNZ ? UINT32_C(0x00040000) : 0;
+// _instruction.precise = uint8_t( (token & UINT32_C(0x00780000) ) >> 19);
+ break;
+ }
+
+ uint32_t size =0;
+ size += bx::write(_writer, token);
+;
+ for (uint32_t ii = 0; _instruction.extended[ii] != DxbcInstruction::ExtendedType::Count; ++ii)
+ {
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // e..........................ttttt
+ // ^ ^
+ // | +----- type
+ // +-------------------------------- extended
+
+ token = _instruction.extended[ii+1] == DxbcInstruction::ExtendedType::Count
+ ? 0
+ : UINT32_C(0x80000000)
+ ;
+ token |= uint8_t(_instruction.extended[ii]);
+
+ switch (_instruction.extended[ii])
+ {
+ case DxbcInstruction::ExtendedType::SampleControls:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . zzzzyyyyxxxx .....
+ // ^ ^ ^
+ // | | +------------- x
+ // | +----------------- y
+ // +--------------------- z
+
+ token |= (uint32_t(_instruction.sampleOffsets[0]) << 9) & UINT32_C(0x00001e00);
+ token |= (uint32_t(_instruction.sampleOffsets[1]) << 13) & UINT32_C(0x0001e000);
+ token |= (uint32_t(_instruction.sampleOffsets[2]) << 17) & UINT32_C(0x001e0000);
+ break;
+
+ case DxbcInstruction::ExtendedType::ResourceDim:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . .....
+ //
+
+ token |= (uint32_t(_instruction.resourceTarget << 6) & UINT32_C(0x000003e0) );
+ token |= (uint32_t(_instruction.resourceStride << 11) & UINT32_C(0x0000f800) );
+ break;
+
+ case DxbcInstruction::ExtendedType::ResourceReturnType:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // . 3333222211110000.....
+ // ^ ^ ^
+ // | | +------------- x
+ // | +----------------- y
+ // +--------------------- z
+
+ token |= (uint32_t(_instruction.resourceReturnTypes[0]) << 6) & UINT32_C(0x000001e0);
+ token |= (uint32_t(_instruction.resourceReturnTypes[1]) << 9) & UINT32_C(0x00001e00);
+ token |= (uint32_t(_instruction.resourceReturnTypes[2]) << 13) & UINT32_C(0x0001e000);
+ token |= (uint32_t(_instruction.resourceReturnTypes[3]) << 17) & UINT32_C(0x001e0000);
+ break;
+
+ default:
+ break;
+ }
+
+ size += bx::write(_writer, token);
+ }
+
+ for (uint32_t ii = 0; ii < _instruction.numOperands; ++ii)
+ {
+ size += write(_writer, _instruction.operand[ii]);
+ }
+
+ const DxbcOpcodeInfo& info = s_dxbcOpcodeInfo[_instruction.opcode];
+ if (0 < info.numValues)
+ {
+ size += bx::write(_writer, _instruction.value, info.numValues*sizeof(uint32_t) );
+ }
+
+ return size;
+ }
+
+ int32_t toString(char* _out, int32_t _size, const DxbcInstruction& _instruction)
+ {
+ int32_t size = 0;
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%s%s"
+ , getName(_instruction.opcode)
+ , _instruction.saturate ? "_sat" : ""
+ , _instruction.testNZ ? "_nz" : ""
+ );
+
+ if (DxbcResourceDim::Unknown != _instruction.srv)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , " %s<%x>"
+ , s_dxbcSrvType[_instruction.srv]
+ , _instruction.value[0]
+ );
+ }
+ else if (0 < s_dxbcOpcodeInfo[_instruction.opcode].numValues)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , " %d"
+ , _instruction.value[0]
+ );
+ }
+
+ for (uint32_t ii = 0; ii < _instruction.numOperands; ++ii)
+ {
+ const DxbcOperand& operand = _instruction.operand[ii];
+
+ const bool array = false
+ || 1 < operand.numAddrModes
+ || DxbcOperandAddrMode::Imm32 != operand.addrMode[0]
+ ;
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%s%s"
+ , 0 == ii ? " " : ", "
+ , operand.extended ? "*" : ""
+ , s_dxbcOperandType[operand.type]
+ );
+
+ switch (operand.type)
+ {
+ case DxbcOperandType::Imm32:
+ case DxbcOperandType::Imm64:
+ for (uint32_t jj = 0; jj < operand.num; ++jj)
+ {
+ union { uint32_t i; float f; } cast = { operand.un.imm32[jj] };
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%f"
+ , 0 == jj ? "(" : ", "
+ , cast.f
+ );
+ }
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ")"
+ );
+ break;
+
+ default:
+ break;
+ }
+
+ const uint32_t first = DxbcOperandAddrMode::RegImm32 == operand.addrMode[0] ? 0 : 1;
+ if (0 == first)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "["
+ );
+ }
+ else
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%d%s"
+ , operand.regIndex[0]
+ , array ? "[" : ""
+ );
+ }
+
+ for (uint32_t jj = first; jj < operand.numAddrModes; ++jj)
+ {
+ switch (operand.addrMode[jj])
+ {
+ case DxbcOperandAddrMode::Imm32:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%d"
+ , operand.regIndex[jj]
+ );
+ break;
+
+ case DxbcOperandAddrMode::Reg:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s%d"
+ , s_dxbcOperandType[operand.subOperand[jj].type]
+ , operand.regIndex[jj]
+ );
+ break;
+
+ case DxbcOperandAddrMode::RegImm32:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%d + %s%d"
+ , operand.regIndex[jj]
+ , s_dxbcOperandType[operand.subOperand[jj].type]
+ , operand.regIndex[jj]
+ );
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s"
+ , array ? "]" : ""
+ );
+
+ switch (operand.mode)
+ {
+ case DxbcOperandMode::Mask:
+ if (0xf > operand.modeBits
+ && 0 < operand.modeBits)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ".%s%s%s%s"
+ , 0 == (operand.modeBits & 1) ? "" : "x"
+ , 0 == (operand.modeBits & 2) ? "" : "y"
+ , 0 == (operand.modeBits & 4) ? "" : "z"
+ , 0 == (operand.modeBits & 8) ? "" : "w"
+ );
+ }
+ break;
+
+ case DxbcOperandMode::Swizzle:
+ if (0xe4 != operand.modeBits)
+ {
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ".%c%c%c%c"
+ , "xyzw"[(operand.modeBits )&0x3]
+ , "xyzw"[(operand.modeBits>>2)&0x3]
+ , "xyzw"[(operand.modeBits>>4)&0x3]
+ , "xyzw"[(operand.modeBits>>6)&0x3]
+ );
+ }
+ break;
+
+ case DxbcOperandMode::Scalar:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , ".%c"
+ , "xyzw"[operand.modeBits]
+ );
+ break;
+
+ default:
+ break;
+ }
+
+ }
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcSignature& _signature)
+ {
+ int32_t size = 0;
+
+ int64_t offset = bx::seek(_reader);
+
+ uint32_t num;
+ size += bx::read(_reader, num);
+ size += bx::read(_reader, _signature.key);
+
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ DxbcSignature::Element element;
+
+ uint32_t nameOffset;
+ size += bx::read(_reader, nameOffset);
+
+ char name[DXBC_MAX_NAME_STRING];
+ readString(_reader, offset + nameOffset, name);
+ element.name = name;
+
+ size += bx::read(_reader, element.semanticIndex);
+ size += bx::read(_reader, element.valueType);
+ size += bx::read(_reader, element.componentType);
+ size += bx::read(_reader, element.registerIndex);
+ size += bx::read(_reader, element.mask);
+ size += bx::read(_reader, element.readWriteMask);
+ size += bx::read(_reader, element.stream);
+
+ // padding
+ uint8_t padding;
+ size += bx::read(_reader, padding);
+
+ _signature.elements.push_back(element);
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const DxbcSignature& _signature)
+ {
+ int32_t size = 0;
+
+ const uint32_t num = uint32_t(_signature.elements.size() );
+ size += bx::write(_writer, num);
+ size += bx::write(_writer, _signature.key);
+
+ typedef stl::unordered_map<stl::string, uint32_t> NameOffsetMap;
+ NameOffsetMap nom;
+
+ const uint8_t pad = 0;
+ uint32_t nameOffset = num * 24 + 8;
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ const DxbcSignature::Element& element = _signature.elements[ii];
+
+ NameOffsetMap::iterator it = nom.find(element.name);
+ if (it == nom.end() )
+ {
+ nom.insert(stl::make_pair(element.name, nameOffset) );
+ size += bx::write(_writer, nameOffset);
+ nameOffset += uint32_t(element.name.size() + 1);
+ }
+ else
+ {
+ size += bx::write(_writer, it->second);
+ }
+
+ size += bx::write(_writer, element.semanticIndex);
+ size += bx::write(_writer, element.valueType);
+ size += bx::write(_writer, element.componentType);
+ size += bx::write(_writer, element.registerIndex);
+ size += bx::write(_writer, element.mask);
+ size += bx::write(_writer, element.readWriteMask);
+ size += bx::write(_writer, element.stream);
+ size += bx::write(_writer, pad);
+
+ }
+
+ uint32_t len = 0;
+ for (uint32_t ii = 0; ii < num; ++ii)
+ {
+ const DxbcSignature::Element& element = _signature.elements[ii];
+ NameOffsetMap::iterator it = nom.find(element.name);
+ if (it != nom.end() )
+ {
+ nom.erase(it);
+ size += bx::write(_writer, element.name.c_str(), uint32_t(element.name.size() + 1) );
+ len += uint32_t(element.name.size() + 1);
+ }
+ }
+
+ // align 4 bytes
+ size += bx::writeRep(_writer, 0xab, (len+3)/4*4 - len);
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcShader& _shader)
+ {
+ int32_t size = 0;
+
+ size += bx::read(_reader, _shader.version);
+
+ uint32_t bcLength;
+ size += bx::read(_reader, bcLength);
+
+ uint32_t len = (bcLength-2)*sizeof(uint32_t);
+ _shader.byteCode.resize(len);
+ size += bx::read(_reader, _shader.byteCode.data(), len);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const DxbcShader& _shader)
+ {
+ const uint32_t len = uint32_t(_shader.byteCode.size() );
+ const uint32_t bcLength = len / sizeof(uint32_t) + 2;
+
+ int32_t size = 0;
+ size += bx::write(_writer, _shader.version);
+ size += bx::write(_writer, bcLength);
+ size += bx::write(_writer, _shader.byteCode.data(), len);
+
+ return size;
+ }
+
+#define DXBC_CHUNK_HEADER BX_MAKEFOURCC('D', 'X', 'B', 'C')
+#define DXBC_CHUNK_SHADER BX_MAKEFOURCC('S', 'H', 'D', 'R')
+#define DXBC_CHUNK_SHADER_EX BX_MAKEFOURCC('S', 'H', 'E', 'X')
+
+#define DXBC_CHUNK_INPUT_SIGNATURE BX_MAKEFOURCC('I', 'S', 'G', 'N')
+#define DXBC_CHUNK_OUTPUT_SIGNATURE BX_MAKEFOURCC('O', 'S', 'G', 'N')
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcContext& _dxbc)
+ {
+ int32_t size = 0;
+ size += bx::read(_reader, _dxbc.header);
+ _dxbc.shader.shex = false;
+
+ for (uint32_t ii = 0; ii < _dxbc.header.numChunks; ++ii)
+ {
+ bx::seek(_reader, sizeof(DxbcContext::Header) + ii*sizeof(uint32_t), bx::Whence::Begin);
+
+ uint32_t chunkOffset;
+ size += bx::read(_reader, chunkOffset);
+
+ bx::seek(_reader, chunkOffset, bx::Whence::Begin);
+
+ uint32_t fourcc;
+ size += bx::read(_reader, fourcc);
+
+ uint32_t chunkSize;
+ size += bx::read(_reader, chunkSize);
+
+ switch (fourcc)
+ {
+ case DXBC_CHUNK_SHADER_EX:
+ _dxbc.shader.shex = true;
+ // fallthrough
+
+ case DXBC_CHUNK_SHADER:
+ size += read(_reader, _dxbc.shader);
+ break;
+
+ case BX_MAKEFOURCC('I', 'S', 'G', '1'):
+ case DXBC_CHUNK_INPUT_SIGNATURE:
+ size += read(_reader, _dxbc.inputSignature);
+ break;
+
+ case BX_MAKEFOURCC('O', 'S', 'G', '1'):
+ case BX_MAKEFOURCC('O', 'S', 'G', '5'):
+ case DXBC_CHUNK_OUTPUT_SIGNATURE:
+ size += read(_reader, _dxbc.outputSignature);
+ break;
+
+ case BX_MAKEFOURCC('R', 'D', 'E', 'F'):
+ case BX_MAKEFOURCC('I', 'F', 'C', 'E'):
+ case BX_MAKEFOURCC('P', 'C', 'S', 'G'):
+ case BX_MAKEFOURCC('S', 'T', 'A', 'T'):
+ case BX_MAKEFOURCC('S', 'F', 'I', '0'):
+ case BX_MAKEFOURCC('P', 'S', 'O', '1'):
+ case BX_MAKEFOURCC('P', 'S', 'O', '2'):
+ size += chunkSize;
+ break;
+
+ default:
+ size += chunkSize;
+ BX_CHECK(false, "UNKNOWN FOURCC %c%c%c%c %d"
+ , ( (char*)&fourcc)[0]
+ , ( (char*)&fourcc)[1]
+ , ( (char*)&fourcc)[2]
+ , ( (char*)&fourcc)[3]
+ , size
+ );
+ break;
+ }
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterSeekerI* _writer, const DxbcContext& _dxbc)
+ {
+ int32_t size = 0;
+
+ int64_t dxbcOffset = bx::seek(_writer);
+ size += bx::write(_writer, DXBC_CHUNK_HEADER);
+
+ size += bx::writeRep(_writer, 0, 16);
+
+ size += bx::write(_writer, UINT32_C(1) );
+
+ int64_t sizeOffset = bx::seek(_writer);
+ size += bx::writeRep(_writer, 0, 4);
+
+ uint32_t numChunks = 3;
+ size += bx::write(_writer, numChunks);
+
+ int64_t chunksOffsets = bx::seek(_writer);
+ size += bx::writeRep(_writer, 0, numChunks*sizeof(uint32_t) );
+
+ uint32_t chunkOffset[3];
+ uint32_t chunkSize[3];
+
+ chunkOffset[0] = uint32_t(bx::seek(_writer) - dxbcOffset);
+ size += write(_writer, DXBC_CHUNK_INPUT_SIGNATURE);
+ size += write(_writer, UINT32_C(0) );
+ chunkSize[0] = write(_writer, _dxbc.inputSignature);
+
+ chunkOffset[1] = uint32_t(bx::seek(_writer) - dxbcOffset);
+ size += write(_writer, DXBC_CHUNK_OUTPUT_SIGNATURE);
+ size += write(_writer, UINT32_C(0) );
+ chunkSize[1] = write(_writer, _dxbc.outputSignature);
+
+ chunkOffset[2] = uint32_t(bx::seek(_writer) - dxbcOffset);
+ size += write(_writer, _dxbc.shader.shex ? DXBC_CHUNK_SHADER_EX : DXBC_CHUNK_SHADER);
+ size += write(_writer, UINT32_C(0) );
+ chunkSize[2] = write(_writer, _dxbc.shader);
+
+ size += 0
+ + chunkSize[0]
+ + chunkSize[1]
+ + chunkSize[2]
+ ;
+
+ int64_t eof = bx::seek(_writer);
+
+ bx::seek(_writer, sizeOffset, bx::Whence::Begin);
+ bx::write(_writer, size);
+
+ bx::seek(_writer, chunksOffsets, bx::Whence::Begin);
+ bx::write(_writer, chunkOffset, sizeof(chunkOffset) );
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(chunkOffset); ++ii)
+ {
+ bx::seek(_writer, chunkOffset[ii]+4, bx::Whence::Begin);
+ bx::write(_writer, chunkSize[ii]);
+ }
+
+ bx::seek(_writer, eof, bx::Whence::Begin);
+
+ return size;
+ }
+
+ void parse(const DxbcShader& _src, DxbcParseFn _fn, void* _userData)
+ {
+ bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
+
+ for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
+ {
+ DxbcInstruction instruction;
+ uint32_t size = read(&reader, instruction);
+ BX_CHECK(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size);
+
+ bool cont = _fn(token * sizeof(uint32_t), instruction, _userData);
+ if (!cont)
+ {
+ return;
+ }
+
+ token += instruction.length;
+ }
+ }
+
+ void filter(DxbcShader& _dst, const DxbcShader& _src, DxbcFilterFn _fn, void* _userData)
+ {
+ bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
+
+ bx::CrtAllocator r;
+ bx::MemoryBlock mb(&r);
+ bx::MemoryWriter writer(&mb);
+
+ for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
+ {
+ DxbcInstruction instruction;
+ uint32_t size = read(&reader, instruction);
+ BX_CHECK(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size);
+
+ _fn(instruction, _userData);
+
+ write(&writer, instruction);
+
+ token += instruction.length;
+ }
+
+ uint8_t* data = (uint8_t*)mb.more();
+ uint32_t size = uint32_t(bx::getSize(&writer) );
+ _dst.byteCode.reserve(size);
+ memcpy(_dst.byteCode.data(), data, size);
+ }
+
+} // namespace bgfx
diff --git a/3rdparty/bgfx/src/shader_dxbc.h b/3rdparty/bgfx/src/shader_dxbc.h
new file mode 100644
index 00000000000..52590981082
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_dxbc.h
@@ -0,0 +1,609 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_SHADER_DXBC_H
+#define BGFX_SHADER_DXBC_H
+
+#include <bx/readerwriter.h>
+
+namespace bgfx
+{
+ struct DxbcOpcode
+ {
+ enum Enum
+ {
+ ADD,
+ AND,
+ BREAK,
+ BREAKC,
+ CALL,
+ CALLC,
+ CASE,
+ CONTINUE,
+ CONTINUEC,
+ CUT,
+ DEFAULT,
+ DERIV_RTX,
+ DERIV_RTY,
+ DISCARD,
+ DIV,
+ DP2,
+ DP3,
+ DP4,
+ ELSE,
+ EMIT,
+ EMITTHENCUT,
+ ENDIF,
+ ENDLOOP,
+ ENDSWITCH,
+ EQ,
+ EXP,
+ FRC,
+ FTOI,
+ FTOU,
+ GE,
+ IADD,
+ IF,
+ IEQ,
+ IGE,
+ ILT,
+ IMAD,
+ IMAX,
+ IMIN,
+ IMUL,
+ INE,
+ INEG,
+ ISHL,
+ ISHR,
+ ITOF,
+ LABEL,
+ LD,
+ LD_MS,
+ LOG,
+ LOOP,
+ LT,
+ MAD,
+ MIN,
+ MAX,
+ CUSTOMDATA,
+ MOV,
+ MOVC,
+ MUL,
+ NE,
+ NOP,
+ NOT,
+ OR,
+ RESINFO,
+ RET,
+ RETC,
+ ROUND_NE,
+ ROUND_NI,
+ ROUND_PI,
+ ROUND_Z,
+ RSQ,
+ SAMPLE,
+ SAMPLE_C,
+ SAMPLE_C_LZ,
+ SAMPLE_L,
+ SAMPLE_D,
+ SAMPLE_B,
+ SQRT,
+ SWITCH,
+ SINCOS,
+ UDIV,
+ ULT,
+ UGE,
+ UMUL,
+ UMAD,
+ UMAX,
+ UMIN,
+ USHR,
+ UTOF,
+ XOR,
+ DCL_RESOURCE,
+ DCL_CONSTANT_BUFFER,
+ DCL_SAMPLER,
+ DCL_INDEX_RANGE,
+ DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY,
+ DCL_GS_INPUT_PRIMITIVE,
+ DCL_MAX_OUTPUT_VERTEX_COUNT,
+ DCL_INPUT,
+ DCL_INPUT_SGV,
+ DCL_INPUT_SIV,
+ DCL_INPUT_PS,
+ DCL_INPUT_PS_SGV,
+ DCL_INPUT_PS_SIV,
+ DCL_OUTPUT,
+ DCL_OUTPUT_SGV,
+ DCL_OUTPUT_SIV,
+ DCL_TEMPS,
+ DCL_INDEXABLE_TEMP,
+ DCL_GLOBAL_FLAGS,
+
+ UnknownD3D10,
+ LOD,
+ GATHER4,
+ SAMPLE_POS,
+ SAMPLE_INFO,
+
+ UnknownD3D10_1,
+ HS_DECLS,
+ HS_CONTROL_POINT_PHASE,
+ HS_FORK_PHASE,
+ HS_JOIN_PHASE,
+ EMIT_STREAM,
+ CUT_STREAM,
+ EMITTHENCUT_STREAM,
+ INTERFACE_CALL,
+ BUFINFO,
+ DERIV_RTX_COARSE,
+ DERIV_RTX_FINE,
+ DERIV_RTY_COARSE,
+ DERIV_RTY_FINE,
+ GATHER4_C,
+ GATHER4_PO,
+ GATHER4_PO_C,
+ RCP,
+ F32TOF16,
+ F16TOF32,
+ UADDC,
+ USUBB,
+ COUNTBITS,
+ FIRSTBIT_HI,
+ FIRSTBIT_LO,
+ FIRSTBIT_SHI,
+ UBFE,
+ IBFE,
+ BFI,
+ BFREV,
+ SWAPC,
+ DCL_STREAM,
+ DCL_FUNCTION_BODY,
+ DCL_FUNCTION_TABLE,
+ DCL_INTERFACE,
+ DCL_INPUT_CONTROL_POINT_COUNT,
+ DCL_OUTPUT_CONTROL_POINT_COUNT,
+ DCL_TESS_DOMAIN,
+ DCL_TESS_PARTITIONING,
+ DCL_TESS_OUTPUT_PRIMITIVE,
+ DCL_HS_MAX_TESSFACTOR,
+ DCL_HS_FORK_PHASE_INSTANCE_COUNT,
+ DCL_HS_JOIN_PHASE_INSTANCE_COUNT,
+ DCL_THREAD_GROUP,
+ DCL_UNORDERED_ACCESS_VIEW_TYPED,
+ DCL_UNORDERED_ACCESS_VIEW_RAW,
+ DCL_UNORDERED_ACCESS_VIEW_STRUCTURED,
+ DCL_THREAD_GROUP_SHARED_MEMORY_RAW,
+ DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED,
+ DCL_RESOURCE_RAW,
+ DCL_RESOURCE_STRUCTURED,
+ LD_UAV_TYPED,
+ STORE_UAV_TYPED,
+ LD_RAW,
+ STORE_RAW,
+ LD_STRUCTURED,
+ STORE_STRUCTURED,
+ ATOMIC_AND,
+ ATOMIC_OR,
+ ATOMIC_XOR,
+ ATOMIC_CMP_STORE,
+ ATOMIC_IADD,
+ ATOMIC_IMAX,
+ ATOMIC_IMIN,
+ ATOMIC_UMAX,
+ ATOMIC_UMIN,
+ IMM_ATOMIC_ALLOC,
+ IMM_ATOMIC_CONSUME,
+ IMM_ATOMIC_IADD,
+ IMM_ATOMIC_AND,
+ IMM_ATOMIC_OR,
+ IMM_ATOMIC_XOR,
+ IMM_ATOMIC_EXCH,
+ IMM_ATOMIC_CMP_EXCH,
+ IMM_ATOMIC_IMAX,
+ IMM_ATOMIC_IMIN,
+ IMM_ATOMIC_UMAX,
+ IMM_ATOMIC_UMIN,
+ SYNC,
+ DADD,
+ DMAX,
+ DMIN,
+ DMUL,
+ DEQ,
+ DGE,
+ DLT,
+ DNE,
+ DMOV,
+ DMOVC,
+ DTOF,
+ FTOD,
+ EVAL_SNAPPED,
+ EVAL_SAMPLE_INDEX,
+ EVAL_CENTROID,
+ DCL_GS_INSTANCE_COUNT,
+ ABORT,
+ DEBUG_BREAK,
+
+ UnknownD3D11,
+ DDIV,
+ DFMA,
+ DRCP,
+ MSAD,
+ DTOI,
+ DTOU,
+ ITOD,
+ UTOD,
+
+ Count
+ };
+ };
+
+ const char* getName(DxbcOpcode::Enum _opcode);
+
+ struct DxbcBuiltin
+ {
+ // D3D_NAME
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ff728724%28v=vs.85%29.aspx
+ // mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/svs.txt
+ enum Enum
+ {
+ Undefined,
+ Position,
+ ClipDistance,
+ CullDistance,
+ RenderTargetArrayIndex,
+ ViewportArrayIndex,
+ VertexId,
+ PrimitiveId,
+ InstanceId,
+ IsFrontFace,
+ SampleIndex,
+ FinalQuadUEq0EdgeTessFactor,
+ FinalQuadVEq0EdgeTessFactor,
+ FinalQuadUEq1EdgeTessFactor,
+ FinalQuadVEq1EdgeTessFactor,
+ FinalQuadUInsideTessFactor,
+ FinalQuadVInsideTessFactor,
+ FinalTriUEq0EdgeTessFactor,
+ FinalTriVEq0EdgeTessFactor,
+ FinalTriWEq0EdgeTessFactor,
+ FinalTriInsideTessFactor,
+ FinalLineDetailTessFactor,
+ FinalLineDensityTessFactor,
+ Target = 64,
+ Depth,
+ Coverage,
+ DepthGreaterEqual,
+ DepthLessEqual,
+ StencilRef,
+ InnerCoverage,
+ };
+ };
+
+ struct DxbcResourceDim
+ {
+ // D3D_SRV_DIMENSION
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ff728736%28v=vs.85%29.aspx
+ // mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/targets.txt
+ enum Enum
+ {
+ Unknown,
+ Buffer,
+ Texture1D,
+ Texture2D,
+ Texture2DMS,
+ Texture3D,
+ TextureCube,
+ Texture1DArray,
+ Texture2DArray,
+ Texture2DMSArray,
+ TextureCubearray,
+ RawBuffer,
+ StructuredBuffer,
+
+ Count
+ };
+ };
+
+ struct DxbcInterpolation
+ {
+ enum Enum
+ {
+ Unknown,
+ Constant,
+ Linear,
+ LinearCentroid,
+ LinearNoPerspective,
+ LinearNoPerspectiveCentroid,
+ LinearSample,
+ LinearNoPerspectiveSample,
+
+ Count
+ };
+ };
+
+ struct DxbcResourceReturnType
+ {
+ enum Enum
+ {
+ Unorm,
+ Snorm,
+ Sint,
+ Uint,
+ Float,
+ Mixed,
+ Double,
+ Continued,
+ Unused,
+
+ Count
+ };
+ };
+
+ struct DxbcComponentType
+ {
+ enum Enum
+ {
+ Unknown,
+ Uint32,
+ Int32,
+ Float,
+
+ Count
+ };
+ };
+
+ struct DxbcPrecision
+ {
+ enum Enum
+ {
+ Default,
+ Half,
+ Float2_8,
+ Reserved,
+ Int16,
+ Uint16,
+ Any16 = 0xf0,
+ Any10 = 0xf1,
+ };
+ };
+
+ struct DxbcOperandType
+ {
+ enum Enum
+ {
+ Temp,
+ Input,
+ Output,
+ TempArray,
+ Imm32,
+ Imm64,
+ Sampler,
+ Resource,
+ ConstantBuffer,
+ ImmConstantBuffer,
+ Label,
+ PrimitiveID,
+ OutputDepth,
+ Null,
+ Rasterizer,
+ CoverageMask,
+ Stream,
+ FunctionBody,
+ FunctionTable,
+ Interface,
+ FunctionInput,
+ FunctionOutput,
+ OutputControlPointId,
+ InputForkInstanceId,
+ InputJoinInstanceId,
+ InputControlPoint,
+ OutputControlPoint,
+ InputPatchConstant,
+ InputDomainPoint,
+ ThisPointer,
+ UnorderedAccessView,
+ ThreadGroupSharedMemory,
+ InputThreadId,
+ InputThreadGroupId,
+ InputThreadIdInGroup,
+ InputCoverageMask,
+ InputThreadIdInGroupFlattened,
+ InputGsInstanceId,
+ OutputDepthGreaterEqual,
+ OutputDepthLessEqual,
+ CycleCounter,
+
+ Count
+ };
+ };
+
+ struct DxbcOperandAddrMode
+ {
+ enum Enum
+ {
+ Imm32,
+ Imm64,
+ Reg,
+ RegImm32,
+ RegImm64,
+
+ Count
+ };
+ };
+
+ struct DxbcOperandMode
+ {
+ enum Enum
+ {
+ Mask,
+ Swizzle,
+ Scalar,
+
+ Count
+ };
+ };
+
+ struct DxbcSubOperand
+ {
+ DxbcOperandType::Enum type;
+ uint8_t mode;
+ uint8_t modeBits;
+ uint8_t num;
+ uint8_t numAddrModes;
+ uint8_t addrMode;
+ uint32_t regIndex;
+ };
+
+ struct DxbcOperand
+ {
+ DxbcOperandType::Enum type;
+ DxbcOperandMode::Enum mode;
+ uint8_t modeBits;
+ uint8_t num;
+ bool extended;
+ uint32_t extBits;
+
+ uint8_t numAddrModes;
+ uint8_t addrMode[3];
+ uint32_t regIndex[3];
+ DxbcSubOperand subOperand[3];
+
+ union
+ {
+ uint32_t imm32[4];
+ uint64_t imm64[4];
+ } un;
+ };
+
+ struct DxbcInstruction
+ {
+ struct ExtendedType
+ {
+ enum Enum
+ {
+ Empty,
+ SampleControls,
+ ResourceDim,
+ ResourceReturnType,
+
+ Count
+ };
+ };
+
+ DxbcOpcode::Enum opcode;
+ uint32_t value[3];
+ uint32_t length;
+ uint8_t numOperands;
+ ExtendedType::Enum extended[3];
+
+ //
+ DxbcResourceDim::Enum srv;
+ uint8_t samples;
+
+ //
+ DxbcInterpolation::Enum interpolation;
+
+ //
+ bool shadow;
+ bool mono;
+
+ //
+ bool allowRefactoring;
+ bool fp64;
+ bool earlyDepth;
+ bool enableBuffers;
+ bool skipOptimization;
+ bool enableMinPrecision;
+ bool enableDoubleExtensions;
+ bool enableShaderExtensions;
+
+ //
+ bool threadsInGroup;
+ bool sharedMemory;
+ bool uavGroup;
+ bool uavGlobal;
+
+ //
+ DxbcResourceReturnType::Enum retType;
+ bool saturate;
+ uint8_t testNZ;
+
+ //
+ uint8_t sampleOffsets[3];
+ uint8_t resourceTarget;
+ uint8_t resourceStride;
+ DxbcResourceReturnType::Enum resourceReturnTypes[4];
+
+ DxbcOperand operand[6];
+ };
+
+ int32_t read(bx::ReaderI* _reader, DxbcInstruction& _instruction);
+ int32_t write(bx::WriterI* _writer, const DxbcInstruction& _instruction);
+ int32_t toString(char* _out, int32_t _size, const DxbcInstruction& _instruction);
+
+ struct DxbcSignature
+ {
+ struct Element
+ {
+ stl::string name;
+ uint32_t semanticIndex;
+ DxbcBuiltin::Enum valueType;
+ DxbcComponentType::Enum componentType;
+ uint32_t registerIndex;
+ uint8_t mask;
+ uint8_t readWriteMask;
+ uint8_t stream;
+ };
+
+ uint32_t key;
+ stl::vector<Element> elements;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcSignature& _signature);
+ int32_t write(bx::WriterI* _writer, const DxbcSignature& _signature);
+
+ struct DxbcShader
+ {
+ uint32_t version;
+ stl::vector<uint8_t> byteCode;
+ bool shex;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcShader& _shader);
+ int32_t write(bx::WriterI* _writer, const DxbcShader& _shader);
+
+ typedef bool (*DxbcParseFn)(uint32_t _offset, const DxbcInstruction& _instruction, void* _userData);
+ void parse(const DxbcShader& _src, DxbcParseFn _fn, void* _userData);
+
+ typedef void (*DxbcFilterFn)(DxbcInstruction& _instruction, void* _userData);
+ void filter(DxbcShader& _dst, const DxbcShader& _src, DxbcFilterFn _fn, void* _userData);
+
+ struct DxbcContext
+ {
+ struct Header
+ {
+ uint32_t magic;
+ uint8_t hash[16];
+ uint32_t version;
+ uint32_t size;
+ uint32_t numChunks;
+ };
+
+ Header header;
+ DxbcSignature inputSignature;
+ DxbcSignature outputSignature;
+ DxbcShader shader;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, DxbcContext& _dxbc);
+ int32_t write(bx::WriterSeekerI* _writer, const DxbcContext& _dxbc);
+
+ /// Calculate DXBC hash from data.
+ void dxbcHash(const void* _data, uint32_t _size, void* _digest);
+
+} // namespace bgfx
+
+#endif // BGFX_SHADER_DXBC_H
diff --git a/3rdparty/bgfx/src/shader_spirv.cpp b/3rdparty/bgfx/src/shader_spirv.cpp
new file mode 100644
index 00000000000..40bf7acbb6f
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_spirv.cpp
@@ -0,0 +1,732 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "bgfx_p.h"
+#include "shader_spirv.h"
+
+namespace bgfx
+{
+ struct SpirvOpcodeInfo
+ {
+ uint8_t numOperands;
+ uint8_t numValues;
+ bool hasVariable;
+ };
+
+ static const SpirvOpcodeInfo s_sprivOpcodeInfo[] =
+ {
+ { 0, 0, false }, // Nop,
+ { 0, 0, true }, // Source
+ { 0, 0, true }, // SourceExtension
+ { 0, 0, false }, // Extension
+ { 0, 1, true }, // ExtInstImport
+ { 0, 2, false }, // MemoryModel
+ { 0, 2, false }, // EntryPoint
+ { 0, 0, false }, // ExecutionMode
+ { 0, 1, false }, // TypeVoid
+ { 0, 1, false }, // TypeBool
+ { 0, 3, false }, // TypeInt
+ { 0, 2, false }, // TypeFloat
+ { 0, 3, false }, // TypeVector
+ { 0, 3, false }, // TypeMatrix
+ { 1, 7, false }, // TypeSampler
+ { 0, 0, false }, // TypeFilter
+ { 0, 0, false }, // TypeArray
+ { 0, 0, false }, // TypeRuntimeArray
+ { 0, 0, false }, // TypeStruct
+ { 0, 0, false }, // TypeOpaque
+ { 0, 3, false }, // TypePointer
+ { 0, 2, true }, // TypeFunction
+ { 0, 0, false }, // TypeEvent
+ { 0, 0, false }, // TypeDeviceEvent
+ { 0, 0, false }, // TypeReserveId
+ { 0, 0, false }, // TypeQueue
+ { 0, 0, false }, // TypePipe
+ { 0, 0, false }, // ConstantTrue
+ { 0, 0, false }, // ConstantFalse
+ { 0, 2, true }, // Constant
+ { 0, 2, true }, // ConstantComposite
+ { 0, 0, false }, // ConstantSampler
+ { 0, 0, false }, // ConstantNullPointer
+ { 0, 0, false }, // ConstantNullObject
+ { 0, 0, false }, // SpecConstantTrue
+ { 0, 0, false }, // SpecConstantFalse
+ { 0, 0, false }, // SpecConstant
+ { 0, 0, false }, // SpecConstantComposite
+ { 0, 3, true }, // Variable
+ { 0, 0, false }, // VariableArray
+ { 0, 4, false }, // Function
+ { 0, 0, false }, // FunctionParameter
+ { 0, 0, false }, // FunctionEnd
+ { 0, 0, false }, // FunctionCall
+ { 0, 0, false }, // ExtInst
+ { 0, 0, false }, // Undef
+ { 0, 0, false }, // Load
+ { 0, 2, true }, // Store
+ { 0, 0, false }, // Phi
+ { 0, 0, false }, // DecorationGroup
+ { 0, 2, true }, // Decorate
+ { 0, 0, false }, // MemberDecorate
+ { 0, 0, false }, // GroupDecorate
+ { 0, 0, false }, // GroupMemberDecorate
+ { 0, 1, true }, // Name
+ { 0, 1, true }, // MemberName
+ { 0, 0, false }, // String
+ { 0, 0, false }, // Line
+ { 0, 0, false }, // VectorExtractDynamic
+ { 0, 0, false }, // VectorInsertDynamic
+ { 0, 0, false }, // VectorShuffle
+ { 0, 0, false }, // CompositeConstruct
+ { 0, 0, false }, // CompositeExtract
+ { 0, 0, false }, // CompositeInsert
+ { 0, 0, false }, // CopyObject
+ { 0, 0, false }, // CopyMemory
+ { 0, 0, false }, // CopyMemorySized
+ { 0, 0, false }, // Sampler
+ { 0, 0, false }, // TextureSample
+ { 0, 0, false }, // TextureSampleDref
+ { 0, 0, false }, // TextureSampleLod
+ { 0, 0, false }, // TextureSampleProj
+ { 0, 0, false }, // TextureSampleGrad
+ { 0, 0, false }, // TextureSampleOffset
+ { 0, 0, false }, // TextureSampleProjLod
+ { 0, 0, false }, // TextureSampleProjGrad
+ { 0, 0, false }, // TextureSampleLodOffset
+ { 0, 0, false }, // TextureSampleProjOffset
+ { 0, 0, false }, // TextureSampleGradOffset
+ { 0, 0, false }, // TextureSampleProjLodOffset
+ { 0, 0, false }, // TextureSampleProjGradOffset
+ { 0, 0, false }, // TextureFetchTexelLod
+ { 0, 0, false }, // TextureFetchTexelOffset
+ { 0, 0, false }, // TextureFetchSample
+ { 0, 0, false }, // TextureFetchTexel
+ { 0, 0, false }, // TextureGather
+ { 0, 0, false }, // TextureGatherOffset
+ { 0, 0, false }, // TextureGatherOffsets
+ { 0, 0, false }, // TextureQuerySizeLod
+ { 0, 0, false }, // TextureQuerySize
+ { 0, 0, false }, // TextureQueryLod
+ { 0, 0, false }, // TextureQueryLevels
+ { 0, 0, false }, // TextureQuerySamples
+ { 0, 0, false }, // AccessChain
+ { 0, 0, false }, // InBoundsAccessChain
+ { 0, 0, false }, // SNegate
+ { 0, 0, false }, // FNegate
+ { 0, 0, false }, // Not
+ { 0, 0, false }, // Any
+ { 0, 0, false }, // All
+ { 0, 0, false }, // ConvertFToU
+ { 0, 0, false }, // ConvertFToS
+ { 0, 0, false }, // ConvertSToF
+ { 0, 0, false }, // ConvertUToF
+ { 0, 0, false }, // UConvert
+ { 0, 0, false }, // SConvert
+ { 0, 0, false }, // FConvert
+ { 0, 0, false }, // ConvertPtrToU
+ { 0, 0, false }, // ConvertUToPtr
+ { 0, 0, false }, // PtrCastToGeneric
+ { 0, 0, false }, // GenericCastToPtr
+ { 0, 0, false }, // Bitcast
+ { 0, 0, false }, // Transpose
+ { 0, 0, false }, // IsNan
+ { 0, 0, false }, // IsInf
+ { 0, 0, false }, // IsFinite
+ { 0, 0, false }, // IsNormal
+ { 0, 0, false }, // SignBitSet
+ { 0, 0, false }, // LessOrGreater
+ { 0, 0, false }, // Ordered
+ { 0, 0, false }, // Unordered
+ { 0, 0, false }, // ArrayLength
+ { 0, 0, false }, // IAdd
+ { 0, 0, false }, // FAdd
+ { 0, 0, false }, // ISub
+ { 0, 0, false }, // FSub
+ { 0, 0, false }, // IMul
+ { 0, 0, false }, // FMul
+ { 0, 0, false }, // UDiv
+ { 0, 0, false }, // SDiv
+ { 0, 0, false }, // FDiv
+ { 0, 0, false }, // UMod
+ { 0, 0, false }, // SRem
+ { 0, 0, false }, // SMod
+ { 0, 0, false }, // FRem
+ { 0, 0, false }, // FMod
+ { 0, 0, false }, // VectorTimesScalar
+ { 0, 0, false }, // MatrixTimesScalar
+ { 0, 0, false }, // VectorTimesMatrix
+ { 0, 0, false }, // MatrixTimesVector
+ { 0, 0, false }, // MatrixTimesMatrix
+ { 0, 0, false }, // OuterProduct
+ { 0, 0, false }, // Dot
+ { 0, 0, false }, // ShiftRightLogical
+ { 0, 0, false }, // ShiftRightArithmetic
+ { 0, 0, false }, // ShiftLeftLogical
+ { 0, 0, false }, // LogicalOr
+ { 0, 0, false }, // LogicalXor
+ { 0, 0, false }, // LogicalAnd
+ { 0, 0, false }, // BitwiseOr
+ { 0, 0, false }, // BitwiseXor
+ { 0, 0, false }, // BitwiseAnd
+ { 0, 0, false }, // Select
+ { 0, 0, false }, // IEqual
+ { 0, 0, false }, // FOrdEqual
+ { 0, 0, false }, // FUnordEqual
+ { 0, 0, false }, // INotEqual
+ { 0, 0, false }, // FOrdNotEqual
+ { 0, 0, false }, // FUnordNotEqual
+ { 0, 0, false }, // ULessThan
+ { 0, 0, false }, // SLessThan
+ { 0, 0, false }, // FOrdLessThan
+ { 0, 0, false }, // FUnordLessThan
+ { 0, 0, false }, // UGreaterThan
+ { 0, 0, false }, // SGreaterThan
+ { 0, 0, false }, // FOrdGreaterThan
+ { 0, 0, false }, // FUnordGreaterThan
+ { 0, 0, false }, // ULessThanEqual
+ { 0, 0, false }, // SLessThanEqual
+ { 0, 0, false }, // FOrdLessThanEqual
+ { 0, 0, false }, // FUnordLessThanEqual
+ { 0, 0, false }, // UGreaterThanEqual
+ { 0, 0, false }, // SGreaterThanEqual
+ { 0, 0, false }, // FOrdGreaterThanEqual
+ { 0, 0, false }, // FUnordGreaterThanEqual
+ { 0, 0, false }, // DPdx
+ { 0, 0, false }, // DPdy
+ { 0, 0, false }, // Fwidth
+ { 0, 0, false }, // DPdxFine
+ { 0, 0, false }, // DPdyFine
+ { 0, 0, false }, // FwidthFine
+ { 0, 0, false }, // DPdxCoarse
+ { 0, 0, false }, // DPdyCoarse
+ { 0, 0, false }, // FwidthCoarse
+ { 0, 0, false }, // EmitVertex
+ { 0, 0, false }, // EndPrimitive
+ { 0, 0, false }, // EmitStreamVertex
+ { 0, 0, false }, // EndStreamPrimitive
+ { 0, 0, false }, // ControlBarrier
+ { 0, 0, false }, // MemoryBarrier
+ { 0, 0, false }, // ImagePointer
+ { 0, 0, false }, // AtomicInit
+ { 0, 0, false }, // AtomicLoad
+ { 0, 0, false }, // AtomicStore
+ { 0, 0, false }, // AtomicExchange
+ { 0, 0, false }, // AtomicCompareExchange
+ { 0, 0, false }, // AtomicCompareExchangeWeak
+ { 0, 0, false }, // AtomicIIncrement
+ { 0, 0, false }, // AtomicIDecrement
+ { 0, 0, false }, // AtomicIAdd
+ { 0, 0, false }, // AtomicISub
+ { 0, 0, false }, // AtomicUMin
+ { 0, 0, false }, // AtomicUMax
+ { 0, 0, false }, // AtomicAnd
+ { 0, 0, false }, // AtomicOr
+ { 0, 0, false }, // AtomicXor
+ { 0, 0, false }, // LoopMerge
+ { 0, 0, false }, // SelectionMerge
+ { 0, 1, false }, // Label
+ { 0, 1, false }, // Branch
+ { 0, 0, false }, // BranchConditional
+ { 0, 0, false }, // Switch
+ { 0, 0, false }, // Kill
+ { 0, 0, false }, // Return
+ { 0, 0, false }, // ReturnValue
+ { 0, 0, false }, // Unreachable
+ { 0, 0, false }, // LifetimeStart
+ { 0, 0, false }, // LifetimeStop
+ { 0, 0, false }, // CompileFlag
+ { 0, 0, false }, // AsyncGroupCopy
+ { 0, 0, false }, // WaitGroupEvents
+ { 0, 0, false }, // GroupAll
+ { 0, 0, false }, // GroupAny
+ { 0, 0, false }, // GroupBroadcast
+ { 0, 0, false }, // GroupIAdd
+ { 0, 0, false }, // GroupFAdd
+ { 0, 0, false }, // GroupFMin
+ { 0, 0, false }, // GroupUMin
+ { 0, 0, false }, // GroupSMin
+ { 0, 0, false }, // GroupFMax
+ { 0, 0, false }, // GroupUMax
+ { 0, 0, false }, // GroupSMax
+ { 0, 0, false }, // GenericCastToPtrExplicit
+ { 0, 0, false }, // GenericPtrMemSemantics
+ { 0, 0, false }, // ReadPipe
+ { 0, 0, false }, // WritePipe
+ { 0, 0, false }, // ReservedReadPipe
+ { 0, 0, false }, // ReservedWritePipe
+ { 0, 0, false }, // ReserveReadPipePackets
+ { 0, 0, false }, // ReserveWritePipePackets
+ { 0, 0, false }, // CommitReadPipe
+ { 0, 0, false }, // CommitWritePipe
+ { 0, 0, false }, // IsValidReserveId
+ { 0, 0, false }, // GetNumPipePackets
+ { 0, 0, false }, // GetMaxPipePackets
+ { 0, 0, false }, // GroupReserveReadPipePackets
+ { 0, 0, false }, // GroupReserveWritePipePackets
+ { 0, 0, false }, // GroupCommitReadPipe
+ { 0, 0, false }, // GroupCommitWritePipe
+ { 0, 0, false }, // EnqueueMarker
+ { 0, 0, false }, // EnqueueKernel
+ { 0, 0, false }, // GetKernelNDrangeSubGroupCount
+ { 0, 0, false }, // GetKernelNDrangeMaxSubGroupSize
+ { 0, 0, false }, // GetKernelWorkGroupSize
+ { 0, 0, false }, // GetKernelPreferredWorkGroupSizeMultiple
+ { 0, 0, false }, // RetainEvent
+ { 0, 0, false }, // ReleaseEvent
+ { 0, 0, false }, // CreateUserEvent
+ { 0, 0, false }, // IsValidEvent
+ { 0, 0, false }, // SetUserEventStatus
+ { 0, 0, false }, // CaptureEventProfilingInfo
+ { 0, 0, false }, // GetDefaultQueue
+ { 0, 0, false }, // BuildNDRange
+ { 0, 0, false }, // SatConvertSToU
+ { 0, 0, false }, // SatConvertUToS
+ { 0, 0, false }, // AtomicIMin
+ { 0, 0, false }, // AtomicIMax
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_sprivOpcodeInfo) == SpirvOpcode::Count);
+
+ const char* s_spirvOpcode[] =
+ {
+ "Nop",
+ "Source",
+ "SourceExtension",
+ "Extension",
+ "ExtInstImport",
+ "MemoryModel",
+ "EntryPoint",
+ "ExecutionMode",
+ "TypeVoid",
+ "TypeBool",
+ "TypeInt",
+ "TypeFloat",
+ "TypeVector",
+ "TypeMatrix",
+ "TypeSampler",
+ "TypeFilter",
+ "TypeArray",
+ "TypeRuntimeArray",
+ "TypeStruct",
+ "TypeOpaque",
+ "TypePointer",
+ "TypeFunction",
+ "TypeEvent",
+ "TypeDeviceEvent",
+ "TypeReserveId",
+ "TypeQueue",
+ "TypePipe",
+ "ConstantTrue",
+ "ConstantFalse",
+ "Constant",
+ "ConstantComposite",
+ "ConstantSampler",
+ "ConstantNullPointer",
+ "ConstantNullObject",
+ "SpecConstantTrue",
+ "SpecConstantFalse",
+ "SpecConstant",
+ "SpecConstantComposite",
+ "Variable",
+ "VariableArray",
+ "Function",
+ "FunctionParameter",
+ "FunctionEnd",
+ "FunctionCall",
+ "ExtInst",
+ "Undef",
+ "Load",
+ "Store",
+ "Phi",
+ "DecorationGroup",
+ "Decorate",
+ "MemberDecorate",
+ "GroupDecorate",
+ "GroupMemberDecorate",
+ "Name",
+ "MemberName",
+ "String",
+ "Line",
+ "VectorExtractDynamic",
+ "VectorInsertDynamic",
+ "VectorShuffle",
+ "CompositeConstruct",
+ "CompositeExtract",
+ "CompositeInsert",
+ "CopyObject",
+ "CopyMemory",
+ "CopyMemorySized",
+ "Sampler",
+ "TextureSample",
+ "TextureSampleDref",
+ "TextureSampleLod",
+ "TextureSampleProj",
+ "TextureSampleGrad",
+ "TextureSampleOffset",
+ "TextureSampleProjLod",
+ "TextureSampleProjGrad",
+ "TextureSampleLodOffset",
+ "TextureSampleProjOffset",
+ "TextureSampleGradOffset",
+ "TextureSampleProjLodOffset",
+ "TextureSampleProjGradOffset",
+ "TextureFetchTexelLod",
+ "TextureFetchTexelOffset",
+ "TextureFetchSample",
+ "TextureFetchTexel",
+ "TextureGather",
+ "TextureGatherOffset",
+ "TextureGatherOffsets",
+ "TextureQuerySizeLod",
+ "TextureQuerySize",
+ "TextureQueryLod",
+ "TextureQueryLevels",
+ "TextureQuerySamples",
+ "AccessChain",
+ "InBoundsAccessChain",
+ "SNegate",
+ "FNegate",
+ "Not",
+ "Any",
+ "All",
+ "ConvertFToU",
+ "ConvertFToS",
+ "ConvertSToF",
+ "ConvertUToF",
+ "UConvert",
+ "SConvert",
+ "FConvert",
+ "ConvertPtrToU",
+ "ConvertUToPtr",
+ "PtrCastToGeneric",
+ "GenericCastToPtr",
+ "Bitcast",
+ "Transpose",
+ "IsNan",
+ "IsInf",
+ "IsFinite",
+ "IsNormal",
+ "SignBitSet",
+ "LessOrGreater",
+ "Ordered",
+ "Unordered",
+ "ArrayLength",
+ "IAdd",
+ "FAdd",
+ "ISub",
+ "FSub",
+ "IMul",
+ "FMul",
+ "UDiv",
+ "SDiv",
+ "FDiv",
+ "UMod",
+ "SRem",
+ "SMod",
+ "FRem",
+ "FMod",
+ "VectorTimesScalar",
+ "MatrixTimesScalar",
+ "VectorTimesMatrix",
+ "MatrixTimesVector",
+ "MatrixTimesMatrix",
+ "OuterProduct",
+ "Dot",
+ "ShiftRightLogical",
+ "ShiftRightArithmetic",
+ "ShiftLeftLogical",
+ "LogicalOr",
+ "LogicalXor",
+ "LogicalAnd",
+ "BitwiseOr",
+ "BitwiseXor",
+ "BitwiseAnd",
+ "Select",
+ "IEqual",
+ "FOrdEqual",
+ "FUnordEqual",
+ "INotEqual",
+ "FOrdNotEqual",
+ "FUnordNotEqual",
+ "ULessThan",
+ "SLessThan",
+ "FOrdLessThan",
+ "FUnordLessThan",
+ "UGreaterThan",
+ "SGreaterThan",
+ "FOrdGreaterThan",
+ "FUnordGreaterThan",
+ "ULessThanEqual",
+ "SLessThanEqual",
+ "FOrdLessThanEqual",
+ "FUnordLessThanEqual",
+ "UGreaterThanEqual",
+ "SGreaterThanEqual",
+ "FOrdGreaterThanEqual",
+ "FUnordGreaterThanEqual",
+ "DPdx",
+ "DPdy",
+ "Fwidth",
+ "DPdxFine",
+ "DPdyFine",
+ "FwidthFine",
+ "DPdxCoarse",
+ "DPdyCoarse",
+ "FwidthCoarse",
+ "EmitVertex",
+ "EndPrimitive",
+ "EmitStreamVertex",
+ "EndStreamPrimitive",
+ "ControlBarrier",
+ "MemoryBarrier",
+ "ImagePointer",
+ "AtomicInit",
+ "AtomicLoad",
+ "AtomicStore",
+ "AtomicExchange",
+ "AtomicCompareExchange",
+ "AtomicCompareExchangeWeak",
+ "AtomicIIncrement",
+ "AtomicIDecrement",
+ "AtomicIAdd",
+ "AtomicISub",
+ "AtomicUMin",
+ "AtomicUMax",
+ "AtomicAnd",
+ "AtomicOr",
+ "AtomicXor",
+ "LoopMerge",
+ "SelectionMerge",
+ "Label",
+ "Branch",
+ "BranchConditional",
+ "Switch",
+ "Kill",
+ "Return",
+ "ReturnValue",
+ "Unreachable",
+ "LifetimeStart",
+ "LifetimeStop",
+ "CompileFlag",
+ "AsyncGroupCopy",
+ "WaitGroupEvents",
+ "GroupAll",
+ "GroupAny",
+ "GroupBroadcast",
+ "GroupIAdd",
+ "GroupFAdd",
+ "GroupFMin",
+ "GroupUMin",
+ "GroupSMin",
+ "GroupFMax",
+ "GroupUMax",
+ "GroupSMax",
+ "GenericCastToPtrExplicit",
+ "GenericPtrMemSemantics",
+ "ReadPipe",
+ "WritePipe",
+ "ReservedReadPipe",
+ "ReservedWritePipe",
+ "ReserveReadPipePackets",
+ "ReserveWritePipePackets",
+ "CommitReadPipe",
+ "CommitWritePipe",
+ "IsValidReserveId",
+ "GetNumPipePackets",
+ "GetMaxPipePackets",
+ "GroupReserveReadPipePackets",
+ "GroupReserveWritePipePackets",
+ "GroupCommitReadPipe",
+ "GroupCommitWritePipe",
+ "EnqueueMarker",
+ "EnqueueKernel",
+ "GetKernelNDrangeSubGroupCount",
+ "GetKernelNDrangeMaxSubGroupSize",
+ "GetKernelWorkGroupSize",
+ "GetKernelPreferredWorkGroupSizeMultiple",
+ "RetainEvent",
+ "ReleaseEvent",
+ "CreateUserEvent",
+ "IsValidEvent",
+ "SetUserEventStatus",
+ "CaptureEventProfilingInfo",
+ "GetDefaultQueue",
+ "BuildNDRange",
+ "SatConvertSToU",
+ "SatConvertUToS",
+ "AtomicIMin",
+ "AtomicIMax",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_spirvOpcode) == SpirvOpcode::Count);
+
+ const char* getName(SpirvOpcode::Enum _opcode)
+ {
+ BX_CHECK(_opcode < SpirvOpcode::Count, "Unknown opcode id %d.", _opcode);
+ return s_spirvOpcode[_opcode];
+ }
+
+ int32_t read(bx::ReaderI* _reader, SpirvOperand& _operand)
+ {
+ int32_t size = 0;
+
+ BX_UNUSED(_operand);
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderI* _reader, SpirvInstruction& _instruction)
+ {
+ int32_t size = 0;
+
+ uint32_t token;
+ size += bx::read(_reader, token);
+
+ _instruction.opcode = SpirvOpcode::Enum( (token & UINT32_C(0x0000ffff) ) );
+ _instruction.length = uint16_t( (token & UINT32_C(0xffff0000) ) >> 16);
+
+ uint32_t currOp = 0;
+
+ const SpirvOpcodeInfo& info = s_sprivOpcodeInfo[_instruction.opcode];
+
+ if (0 < info.numValues)
+ {
+ size += read(_reader, _instruction.un.value, info.numValues*sizeof(uint32_t) );
+ }
+
+ if (info.hasVariable)
+ {
+ while (size/4 != _instruction.length)
+ {
+ uint32_t tmp;
+ size += bx::read(_reader, tmp);
+ }
+ }
+ else
+ {
+ _instruction.numOperands = info.numOperands;
+ switch (info.numOperands)
+ {
+ case 6: size += read(_reader, _instruction.operand[currOp++]);
+ case 5: size += read(_reader, _instruction.operand[currOp++]);
+ case 4: size += read(_reader, _instruction.operand[currOp++]);
+ case 3: size += read(_reader, _instruction.operand[currOp++]);
+ case 2: size += read(_reader, _instruction.operand[currOp++]);
+ case 1: size += read(_reader, _instruction.operand[currOp++]);
+ case 0:
+ break;
+
+ default:
+ BX_WARN(false, "Instruction %s with invalid number of operands %d (numValues %d)."
+ , getName(_instruction.opcode)
+ , info.numOperands
+ , info.numValues
+ );
+ break;
+ }
+
+ BX_WARN(size/4 == _instruction.length, "read %d, expected %d, %s"
+ , size/4
+ , _instruction.length
+ , getName(_instruction.opcode)
+ );
+ while (size/4 != _instruction.length)
+ {
+ uint32_t tmp;
+ size += bx::read(_reader, tmp);
+ }
+ }
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const SpirvInstruction& _instruction)
+ {
+ int32_t size = 0;
+ BX_UNUSED(_writer, _instruction);
+ return size;
+ }
+
+ int32_t toString(char* _out, int32_t _size, const SpirvInstruction& _instruction)
+ {
+ int32_t size = 0;
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s %d (%d, %d)"
+ , getName(_instruction.opcode)
+ , _instruction.numOperands
+ , _instruction.un.value[0]
+ , _instruction.un.value[1]
+ );
+
+ return size;
+ }
+
+ int32_t read(bx::ReaderSeekerI* _reader, SpirvShader& _shader)
+ {
+ int32_t size = 0;
+
+ uint32_t len = uint32_t(bx::getSize(_reader) - bx::seek(_reader) );
+ _shader.byteCode.resize(len);
+ size += bx::read(_reader, _shader.byteCode.data(), len);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterI* _writer, const SpirvShader& _shader)
+ {
+ int32_t size = 0;
+ BX_UNUSED(_writer, _shader);
+ return size;
+ }
+
+#define SPIRV_MAGIC 0x07230203
+
+ int32_t read(bx::ReaderSeekerI* _reader, Spirv& _spirv)
+ {
+ int32_t size = 0;
+
+ size += bx::read(_reader, _spirv.header);
+
+ if (size != sizeof(Spirv::Header)
+ || _spirv.header.magic != SPIRV_MAGIC
+ )
+ {
+ // error
+ return -size;
+ }
+
+ size += read(_reader, _spirv.shader);
+
+ return size;
+ }
+
+ int32_t write(bx::WriterSeekerI* _writer, const Spirv& _spirv)
+ {
+ int32_t size = 0;
+ BX_UNUSED(_writer, _spirv);
+ return size;
+ }
+
+ void parse(const SpirvShader& _src, SpirvParseFn _fn, void* _userData)
+ {
+ bx::MemoryReader reader(_src.byteCode.data(), uint32_t(_src.byteCode.size() ) );
+
+ for (uint32_t token = 0, numTokens = uint32_t(_src.byteCode.size() / sizeof(uint32_t) ); token < numTokens;)
+ {
+ SpirvInstruction instruction;
+ uint32_t size = read(&reader, instruction);
+ BX_CHECK(size/4 == instruction.length, "read %d, expected %d, %s"
+ , size/4
+ , instruction.length
+ , getName(instruction.opcode)
+ );
+ BX_UNUSED(size);
+
+ _fn(token * sizeof(uint32_t), instruction, _userData);
+
+ token += instruction.length;
+ }
+ }
+
+} // namespace bgfx
diff --git a/3rdparty/bgfx/src/shader_spirv.h b/3rdparty/bgfx/src/shader_spirv.h
new file mode 100644
index 00000000000..5b9cf33c017
--- /dev/null
+++ b/3rdparty/bgfx/src/shader_spirv.h
@@ -0,0 +1,520 @@
+/*
+ * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BGFX_SHADER_SPIRV_H
+#define BGFX_SHADER_SPIRV_H
+
+#include <bx/readerwriter.h>
+
+namespace bgfx
+{
+ // Reference: https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.html
+
+ struct SpirvOpcode
+ {
+ enum Enum
+ {
+ Nop,
+ Source,
+ SourceExtension,
+ Extension,
+ ExtInstImport,
+ MemoryModel,
+ EntryPoint,
+ ExecutionMode,
+ TypeVoid,
+ TypeBool,
+ TypeInt,
+ TypeFloat,
+ TypeVector,
+ TypeMatrix,
+ TypeSampler,
+ TypeFilter,
+ TypeArray,
+ TypeRuntimeArray,
+ TypeStruct,
+ TypeOpaque,
+ TypePointer,
+ TypeFunction,
+ TypeEvent,
+ TypeDeviceEvent,
+ TypeReserveId,
+ TypeQueue,
+ TypePipe,
+ ConstantTrue,
+ ConstantFalse,
+ Constant,
+ ConstantComposite,
+ ConstantSampler,
+ ConstantNullPointer,
+ ConstantNullObject,
+ SpecConstantTrue,
+ SpecConstantFalse,
+ SpecConstant,
+ SpecConstantComposite,
+ Variable,
+ VariableArray,
+ Function,
+ FunctionParameter,
+ FunctionEnd,
+ FunctionCall,
+ ExtInst,
+ Undef,
+ Load,
+ Store,
+ Phi,
+ DecorationGroup,
+ Decorate,
+ MemberDecorate,
+ GroupDecorate,
+ GroupMemberDecorate,
+ Name,
+ MemberName,
+ String,
+ Line,
+ VectorExtractDynamic,
+ VectorInsertDynamic,
+ VectorShuffle,
+ CompositeConstruct,
+ CompositeExtract,
+ CompositeInsert,
+ CopyObject,
+ CopyMemory,
+ CopyMemorySized,
+ Sampler,
+ TextureSample,
+ TextureSampleDref,
+ TextureSampleLod,
+ TextureSampleProj,
+ TextureSampleGrad,
+ TextureSampleOffset,
+ TextureSampleProjLod,
+ TextureSampleProjGrad,
+ TextureSampleLodOffset,
+ TextureSampleProjOffset,
+ TextureSampleGradOffset,
+ TextureSampleProjLodOffset,
+ TextureSampleProjGradOffset,
+ TextureFetchTexelLod,
+ TextureFetchTexelOffset,
+ TextureFetchSample,
+ TextureFetchTexel,
+ TextureGather,
+ TextureGatherOffset,
+ TextureGatherOffsets,
+ TextureQuerySizeLod,
+ TextureQuerySize,
+ TextureQueryLod,
+ TextureQueryLevels,
+ TextureQuerySamples,
+ AccessChain,
+ InBoundsAccessChain,
+ SNegate,
+ FNegate,
+ Not,
+ Any,
+ All,
+ ConvertFToU,
+ ConvertFToS,
+ ConvertSToF,
+ ConvertUToF,
+ UConvert,
+ SConvert,
+ FConvert,
+ ConvertPtrToU,
+ ConvertUToPtr,
+ PtrCastToGeneric,
+ GenericCastToPtr,
+ Bitcast,
+ Transpose,
+ IsNan,
+ IsInf,
+ IsFinite,
+ IsNormal,
+ SignBitSet,
+ LessOrGreater,
+ Ordered,
+ Unordered,
+ ArrayLength,
+ IAdd,
+ FAdd,
+ ISub,
+ FSub,
+ IMul,
+ FMul,
+ UDiv,
+ SDiv,
+ FDiv,
+ UMod,
+ SRem,
+ SMod,
+ FRem,
+ FMod,
+ VectorTimesScalar,
+ MatrixTimesScalar,
+ VectorTimesMatrix,
+ MatrixTimesVector,
+ MatrixTimesMatrix,
+ OuterProduct,
+ Dot,
+ ShiftRightLogical,
+ ShiftRightArithmetic,
+ ShiftLeftLogical,
+ LogicalOr,
+ LogicalXor,
+ LogicalAnd,
+ BitwiseOr,
+ BitwiseXor,
+ BitwiseAnd,
+ Select,
+ IEqual,
+ FOrdEqual,
+ FUnordEqual,
+ INotEqual,
+ FOrdNotEqual,
+ FUnordNotEqual,
+ ULessThan,
+ SLessThan,
+ FOrdLessThan,
+ FUnordLessThan,
+ UGreaterThan,
+ SGreaterThan,
+ FOrdGreaterThan,
+ FUnordGreaterThan,
+ ULessThanEqual,
+ SLessThanEqual,
+ FOrdLessThanEqual,
+ FUnordLessThanEqual,
+ UGreaterThanEqual,
+ SGreaterThanEqual,
+ FOrdGreaterThanEqual,
+ FUnordGreaterThanEqual,
+ DPdx,
+ DPdy,
+ Fwidth,
+ DPdxFine,
+ DPdyFine,
+ FwidthFine,
+ DPdxCoarse,
+ DPdyCoarse,
+ FwidthCoarse,
+ EmitVertex,
+ EndPrimitive,
+ EmitStreamVertex,
+ EndStreamPrimitive,
+ ControlBarrier,
+ MemoryBarrier,
+ ImagePointer,
+ AtomicInit,
+ AtomicLoad,
+ AtomicStore,
+ AtomicExchange,
+ AtomicCompareExchange,
+ AtomicCompareExchangeWeak,
+ AtomicIIncrement,
+ AtomicIDecrement,
+ AtomicIAdd,
+ AtomicISub,
+ AtomicUMin,
+ AtomicUMax,
+ AtomicAnd,
+ AtomicOr,
+ AtomicXor,
+ LoopMerge,
+ SelectionMerge,
+ Label,
+ Branch,
+ BranchConditional,
+ Switch,
+ Kill,
+ Return,
+ ReturnValue,
+ Unreachable,
+ LifetimeStart,
+ LifetimeStop,
+ CompileFlag,
+ AsyncGroupCopy,
+ WaitGroupEvents,
+ GroupAll,
+ GroupAny,
+ GroupBroadcast,
+ GroupIAdd,
+ GroupFAdd,
+ GroupFMin,
+ GroupUMin,
+ GroupSMin,
+ GroupFMax,
+ GroupUMax,
+ GroupSMax,
+ GenericCastToPtrExplicit,
+ GenericPtrMemSemantics,
+ ReadPipe,
+ WritePipe,
+ ReservedReadPipe,
+ ReservedWritePipe,
+ ReserveReadPipePackets,
+ ReserveWritePipePackets,
+ CommitReadPipe,
+ CommitWritePipe,
+ IsValidReserveId,
+ GetNumPipePackets,
+ GetMaxPipePackets,
+ GroupReserveReadPipePackets,
+ GroupReserveWritePipePackets,
+ GroupCommitReadPipe,
+ GroupCommitWritePipe,
+ EnqueueMarker,
+ EnqueueKernel,
+ GetKernelNDrangeSubGroupCount,
+ GetKernelNDrangeMaxSubGroupSize,
+ GetKernelWorkGroupSize,
+ GetKernelPreferredWorkGroupSizeMultiple,
+ RetainEvent,
+ ReleaseEvent,
+ CreateUserEvent,
+ IsValidEvent,
+ SetUserEventStatus,
+ CaptureEventProfilingInfo,
+ GetDefaultQueue,
+ BuildNDRange,
+ SatConvertSToU,
+ SatConvertUToS,
+ AtomicIMin,
+ AtomicIMax,
+
+ Count
+ };
+ };
+
+ struct SpirvBuiltin
+ {
+ enum Enum
+ {
+ Position,
+ PointSize,
+ ClipVertex,
+ ClipDistance,
+ CullDistance,
+ VertexId,
+ InstanceId,
+ BuiltInPrimitiveId,
+ InvocationId,
+ Layer,
+ ViewportIndex,
+ TessLevelOuter,
+ TessLevelInner,
+ TessCoord,
+ PatchVertices,
+ FragCoord,
+ PointCoord,
+ FrontFacing,
+ SampleId,
+ SamplePosition,
+ SampleMask,
+ FragColor,
+ FragDepth,
+ HelperInvocation,
+ NumWorkgroups,
+ WorkgroupSize,
+ WorkgroupId,
+ LocalInvocationId,
+ GlobalInvocationId,
+ LocalInvocationIndex,
+ WorkDim,
+ GlobalSize,
+ EnqueuedWorkgroupSize,
+ GlobalOffset,
+ GlobalLinearId,
+ WorkgroupLinearId,
+ SubgroupSize,
+ SubgroupMaxSize,
+ NumSubgroups,
+ NumEnqueuedSubgroups,
+ SubgroupId,
+ SubgroupLocalInvocationId,
+ };
+ };
+
+ struct SpirvExecutionModel
+ {
+ enum Enum
+ {
+ Vertex,
+ TessellationControl,
+ TessellationEvaluation,
+ Geometry,
+ Fragment,
+ GLCompute,
+ Kernel,
+
+ Count
+ };
+ };
+
+ struct SpirvMemoryModel
+ {
+ enum Enum
+ {
+ Simple,
+ GLSL450,
+ OpenCL12,
+ OpenCL20,
+ OpenCL21,
+
+ Count
+ };
+ };
+
+ struct SpirvStorageClass
+ {
+ enum Enum
+ {
+ UniformConstant,
+ Input,
+ Uniform,
+ Output,
+ WorkgroupLocal,
+ WorkgroupGlobal,
+ PrivateGlobal,
+ Function,
+ Generic,
+ Private,
+ AtomicCounter,
+ };
+ };
+
+ struct SpirvResourceDim
+ {
+ enum Enum
+ {
+ Texture1D,
+ Texture2D,
+ Texture3D,
+ TextureCube,
+ TextureRect,
+ Buffer,
+ };
+ };
+
+ struct SpirvDecoration
+ {
+ enum Enum
+ {
+ PrecisionLow,
+ PrecisionMedium,
+ PrecisionHigh,
+ Block,
+ BufferBlock,
+ RowMajor,
+ ColMajor,
+ GLSLShared,
+ GLSLStd140,
+ GLSLStd430,
+ GLSLPacked,
+ Smooth,
+ Noperspective,
+ Flat,
+ Patch,
+ Centroid,
+ Sample,
+ Invariant,
+ Restrict,
+ Aliased,
+ Volatile,
+ Constant,
+ Coherent,
+ Nonwritable,
+ Nonreadable,
+ Uniform,
+ NoStaticUse,
+ CPacked,
+ SaturatedConversion,
+ Stream,
+ Location,
+ Component,
+ Index,
+ Binding,
+ DescriptorSet,
+ Offset,
+ Alignment,
+ XfbBuffer,
+ Stride,
+ BuiltIn,
+ FuncParamAttr,
+ FPRoundingMode,
+ FPFastMathMode,
+ LinkageAttributes,
+ SpecId,
+
+ Count
+ };
+ };
+
+ struct SpirvOperand
+ {
+ };
+
+ struct SpirvInstruction
+ {
+ SpirvOpcode::Enum opcode;
+ uint16_t length;
+
+ uint8_t numOperands;
+ SpirvOperand operand[6];
+
+ union
+ {
+ struct ResultTypeId
+ {
+ uint32_t resultType;
+ uint32_t id;
+ };
+
+ ResultTypeId constant;
+ ResultTypeId constantComposite;
+
+ uint32_t value[8];
+ } un;
+ };
+
+ int32_t read(bx::ReaderI* _reader, SpirvInstruction& _instruction);
+ int32_t write(bx::WriterI* _writer, const SpirvInstruction& _instruction);
+ int32_t toString(char* _out, int32_t _size, const SpirvInstruction& _instruction);
+
+ struct SpirvShader
+ {
+ stl::vector<uint8_t> byteCode;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, SpirvShader& _shader);
+ int32_t write(bx::WriterI* _writer, const SpirvShader& _shader);
+
+ typedef void (*SpirvParseFn)(uint32_t _offset, const SpirvInstruction& _instruction, void* _userData);
+ void parse(const SpirvShader& _src, SpirvParseFn _fn, void* _userData);
+
+ typedef void (*SpirvFilterFn)(SpirvInstruction& _instruction, void* _userData);
+ void filter(SpirvShader& _dst, const SpirvShader& _src, SpirvFilterFn _fn, void* _userData);
+
+ struct Spirv
+ {
+ struct Header
+ {
+ uint32_t magic;
+ uint32_t version;
+ uint32_t generator;
+ uint32_t bound;
+ uint32_t schema;
+ };
+
+ Header header;
+ SpirvShader shader;
+ };
+
+ int32_t read(bx::ReaderSeekerI* _reader, Spirv& _spirv);
+ int32_t write(bx::WriterSeekerI* _writer, const Spirv& _spirv);
+
+} // namespace bgfx
+
+#endif // BGFX_SHADER_SPIRV_H
diff --git a/3rdparty/bgfx/src/vertexdecl.cpp b/3rdparty/bgfx/src/vertexdecl.cpp
index 83435fa8cf2..470cb56755a 100644
--- a/3rdparty/bgfx/src/vertexdecl.cpp
+++ b/3rdparty/bgfx/src/vertexdecl.cpp
@@ -17,26 +17,29 @@ namespace bgfx
{
static const uint8_t s_attribTypeSizeDx9[AttribType::Count][4] =
{
- { 4, 4, 4, 4 },
- { 4, 4, 8, 8 },
- { 4, 4, 8, 8 },
- { 4, 8, 12, 16 },
+ { 4, 4, 4, 4 }, // Uint8
+ { 4, 4, 4, 4 }, // Uint10
+ { 4, 4, 8, 8 }, // Int16
+ { 4, 4, 8, 8 }, // Half
+ { 4, 8, 12, 16 }, // Float
};
static const uint8_t s_attribTypeSizeDx1x[AttribType::Count][4] =
{
- { 1, 2, 4, 4 },
- { 2, 4, 8, 8 },
- { 2, 4, 8, 8 },
- { 4, 8, 12, 16 },
+ { 1, 2, 4, 4 }, // Uint8
+ { 4, 4, 4, 4 }, // Uint10
+ { 2, 4, 8, 8 }, // Int16
+ { 2, 4, 8, 8 }, // Half
+ { 4, 8, 12, 16 }, // Float
};
static const uint8_t s_attribTypeSizeGl[AttribType::Count][4] =
{
- { 1, 2, 4, 4 },
- { 2, 4, 6, 8 },
- { 2, 4, 6, 8 },
- { 4, 8, 12, 16 },
+ { 1, 2, 4, 4 }, // Uint8
+ { 4, 4, 4, 4 }, // Uint10
+ { 2, 4, 6, 8 }, // Int16
+ { 2, 4, 6, 8 }, // Half
+ { 4, 8, 12, 16 }, // Float
};
static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] =
@@ -45,6 +48,7 @@ namespace bgfx
&s_attribTypeSizeDx9, // Direct3D9
&s_attribTypeSizeDx1x, // Direct3D11
&s_attribTypeSizeDx1x, // Direct3D12
+ &s_attribTypeSizeGl, // Metal
&s_attribTypeSizeGl, // OpenGLES
&s_attribTypeSizeGl, // OpenGL
&s_attribTypeSizeGl, // Vulkan
@@ -107,10 +111,10 @@ namespace bgfx
VertexDecl& VertexDecl::add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized, bool _asInt)
{
- const uint8_t encodedNorm = (_normalized&1)<<6;
- const uint8_t encodedType = (_type&3)<<3;
- const uint8_t encodedNum = (_num-1)&3;
- const uint8_t encodeAsInt = (_asInt&(!!"\x1\x1\x0\x0"[_type]) )<<7;
+ const uint16_t encodedNorm = (_normalized&1)<<7;
+ const uint16_t encodedType = (_type&7)<<3;
+ const uint16_t encodedNum = (_num-1)&3;
+ const uint16_t encodeAsInt = (_asInt&(!!"\x1\x1\x1\x0\x0"[_type]) )<<8;
m_attributes[_attrib] = encodedNorm|encodedType|encodedNum|encodeAsInt;
m_offset[_attrib] = m_stride;
@@ -128,11 +132,11 @@ namespace bgfx
void VertexDecl::decode(Attrib::Enum _attrib, uint8_t& _num, AttribType::Enum& _type, bool& _normalized, bool& _asInt) const
{
- uint8_t val = m_attributes[_attrib];
+ uint16_t val = m_attributes[_attrib];
_num = (val&3)+1;
- _type = AttribType::Enum((val>>3)&3);
- _normalized = !!(val&(1<<6) );
- _asInt = !!(val&(1<<7) );
+ _type = AttribType::Enum( (val>>3)&7);
+ _normalized = !!(val&(1<<7) );
+ _asInt = !!(val&(1<<8) );
}
static const char* s_attrName[] =
@@ -173,7 +177,7 @@ namespace bgfx
for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
{
- if (0xff != _decl.m_attributes[attr])
+ if (UINT16_MAX != _decl.m_attributes[attr])
{
uint8_t num;
AttribType::Enum type;
@@ -255,10 +259,11 @@ namespace bgfx
// AttribType must be in order how it appears in AttribType::Enum!
// id is unique and should not be changed if new AttribTypes are
// added.
- { AttribType::Uint8, 0x0001 },
- { AttribType::Int16, 0x0002 },
- { AttribType::Half, 0x0003 },
- { AttribType::Float, 0x0004 },
+ { AttribType::Uint8, 0x0001 },
+ { AttribType::Uint10, 0x0005 },
+ { AttribType::Int16, 0x0002 },
+ { AttribType::Half, 0x0003 },
+ { AttribType::Float, 0x0004 },
};
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeToId) == AttribType::Count);
@@ -287,7 +292,7 @@ namespace bgfx
for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
{
- numAttrs += 0xff == _decl.m_attributes[attr] ? 0 : 1;
+ numAttrs += UINT16_MAX == _decl.m_attributes[attr] ? 0 : 1;
}
total += bx::write(_writer, numAttrs);
@@ -295,7 +300,7 @@ namespace bgfx
for (uint32_t attr = 0; attr < Attrib::Count; ++attr)
{
- if (0xff != _decl.m_attributes[attr])
+ if (UINT16_MAX != _decl.m_attributes[attr])
{
uint8_t num;
AttribType::Enum type;
@@ -348,7 +353,7 @@ namespace bgfx
Attrib::Enum attr = idToAttrib(attribId);
AttribType::Enum type = idToAttribType(attribTypeId);
- if (Attrib::Count != attr
+ if (Attrib::Count != attr
&& AttribType::Count != type)
{
_decl.add(attr, num, type, normalized, asInt);
@@ -420,6 +425,46 @@ namespace bgfx
}
break;
+ case AttribType::Uint10:
+ {
+ uint32_t packed = 0;
+ if (_inputNormalized)
+ {
+ if (asInt)
+ {
+ switch (num)
+ {
+ default:
+ case 3: packed |= uint32_t(*_input++ * 511.0f + 512.0f);
+ case 2: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f);
+ case 1: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f);
+ }
+ }
+ else
+ {
+ switch (num)
+ {
+ default:
+ case 3: packed |= uint32_t(*_input++ * 1023.0f);
+ case 2: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f);
+ case 1: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f);
+ }
+ }
+ }
+ else
+ {
+ switch (num)
+ {
+ default:
+ case 3: packed |= uint32_t(*_input++);
+ case 2: packed <<= 10; packed |= uint32_t(*_input++);
+ case 1: packed <<= 10; packed |= uint32_t(*_input++);
+ }
+ }
+ *(uint32_t*)data = packed;
+ }
+ break;
+
case AttribType::Int16:
{
int16_t* packed = (int16_t*)data;
@@ -524,6 +569,32 @@ namespace bgfx
}
break;
+ case AttribType::Uint10:
+ {
+ uint32_t packed = *(uint32_t*)data;
+ if (asInt)
+ {
+ switch (num)
+ {
+ default:
+ case 3: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10;
+ case 2: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10;
+ case 1: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f;
+ }
+ }
+ else
+ {
+ switch (num)
+ {
+ default:
+ case 3: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10;
+ case 2: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10;
+ case 1: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f;
+ }
+ }
+ }
+ break;
+
case AttribType::Int16:
{
int16_t* packed = (int16_t*)data;
diff --git a/3rdparty/bgfx/src/vertexdecl.h b/3rdparty/bgfx/src/vertexdecl.h
index 6ba12417bfa..46025527594 100644
--- a/3rdparty/bgfx/src/vertexdecl.h
+++ b/3rdparty/bgfx/src/vertexdecl.h
@@ -6,7 +6,7 @@
#ifndef BGFX_VERTEXDECL_H_HEADER_GUARD
#define BGFX_VERTEXDECL_H_HEADER_GUARD
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include <bx/readerwriter.h>
namespace bgfx
diff --git a/3rdparty/bgfx/src/vs_clear.bin.h b/3rdparty/bgfx/src/vs_clear.bin.h
index 59e52fe4321..c7dea435483 100644
--- a/3rdparty/bgfx/src/vs_clear.bin.h
+++ b/3rdparty/bgfx/src/vs_clear.bin.h
@@ -1,6 +1,6 @@
static const uint8_t vs_clear_glsl[164] =
{
- 0x56, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x61, 0x74, // VSH...........at
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x61, 0x74, // VSH...........at
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve
0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, // c3 a_position;.v
0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // oid main ().{.
@@ -14,7 +14,7 @@ static const uint8_t vs_clear_glsl[164] =
};
static const uint8_t vs_clear_dx9[181] =
{
- 0x56, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x03, 0xfe, 0xff, // VSH.............
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x03, 0xfe, 0xff, // VSH.............
0xfe, 0xff, 0x16, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // ....CTAB....#...
0x00, 0x03, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, // ................
0x1c, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....vs_3_0.Micro
@@ -29,7 +29,7 @@ static const uint8_t vs_clear_dx9[181] =
};
static const uint8_t vs_clear_dx11[254] =
{
- 0x56, 0x53, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x44, 0x58, 0x42, 0x43, // VSH.........DXBC
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, 0x44, 0x58, 0x42, 0x43, // VSH.........DXBC
0x23, 0xd8, 0xec, 0x20, 0x51, 0x86, 0x8e, 0xd5, 0x59, 0x28, 0x7f, 0x72, 0x54, 0xef, 0x89, 0xca, // #.. Q...Y(.rT...
0x01, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, // ............,...
0x60, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // `.......ISGN,...
@@ -46,3 +46,38 @@ static const uint8_t vs_clear_dx11[254] =
0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // 6.... .......@..
0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, // ...?>.........
};
+static const uint8_t vs_clear_mtl[500] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe5, 0x01, 0x00, 0x00, 0x75, 0x73, // VSH...........us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // . float3 a_posi
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // tion [[attribute
+ 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // (0)]];.};.struct
+ 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, // xlatMtlShaderOu
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // tput {. float4
+ 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // gl_Position [[po
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, // sition]];.};.str
+ 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // uct xlatMtlShade
+ 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, // rUniform {.};.ve
+ 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // rtex xlatMtlShad
+ 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // erOutput xlatMtl
+ 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // Main (xlatMtlSha
+ 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, // derInput _mtl_i
+ 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, // [[stage_in]], co
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // nstant xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, // aderUniform& _mt
+ 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // l_u [[buffer(0)]
+ 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, // ]).{. xlatMtlSh
+ 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // aderOutput _mtl_
+ 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // o;. float4 tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
+ 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .w = 1.0;. tmpv
+ 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ar_1.xyz = _mtl_
+ 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // i.a_position;.
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // _mtl_o.gl_Positi
+ 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // on = tmpvar_1;.
+ 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, // return _mtl_o;.
+ 0x7d, 0x0a, 0x0a, 0x00, // }...
+};
diff --git a/3rdparty/bgfx/src/vs_debugfont.bin.h b/3rdparty/bgfx/src/vs_debugfont.bin.h
index 21c919cc71a..6b28a069320 100644
--- a/3rdparty/bgfx/src/vs_debugfont.bin.h
+++ b/3rdparty/bgfx/src/vs_debugfont.bin.h
@@ -1,7 +1,7 @@
static const uint8_t vs_debugfont_glsl[503] =
{
- 0x56, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
0xd2, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi
0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color
0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig
@@ -35,8 +35,8 @@ static const uint8_t vs_debugfont_glsl[503] =
};
static const uint8_t vs_debugfont_dx9[391] =
{
- 0x56, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x64, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // d.......#.CTAB..
0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
@@ -63,8 +63,8 @@ static const uint8_t vs_debugfont_dx9[391] =
};
static const uint8_t vs_debugfont_dx11[714] =
{
- 0x56, 0x53, 0x48, 0x03, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
- 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x56, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..."f...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, // elViewProj......
0x9c, 0x02, 0x44, 0x58, 0x42, 0x43, 0xcf, 0x16, 0xf5, 0x3b, 0x91, 0xcc, 0xae, 0x24, 0x91, 0x6c, // ..DXBC...;...$.l
0x08, 0xa4, 0x91, 0x55, 0x2a, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x03, 0x00, // ...U*...........
0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x49, 0x53, // ..,.......@...IS
@@ -109,3 +109,59 @@ static const uint8_t vs_debugfont_dx11[714] =
0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x04, // ..F.......>.....
0x05, 0x00, 0x06, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00, // ........@.
};
+static const uint8_t vs_debugfont_mtl[843] =
+{
+ 0x56, 0x53, 0x48, 0x04, 0xb8, 0xbe, 0x22, 0x66, 0x00, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x75, 0x73, // VSH..."f..<...us
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me
+ 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput {
+ 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . float4 a_colo
+ 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, // r0 [[attribute(0
+ 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x61, 0x5f, // )]];. float4 a_
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // color1 [[attribu
+ 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // te(1)]];. float
+ 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, // 3 a_position [[a
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, // ttribute(2)]];.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // float2 a_texcoo
+ 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, // rd0 [[attribute(
+ 0x33, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // 3)]];.};.struct
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, // xlatMtlShaderOut
+ 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, // put {. float4 g
+ 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, // l_Position [[pos
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ition]];. float
+ 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // 4 v_color0;. fl
+ 0x6f, 0x61, 0x74, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x20, // oat4 v_color1;.
+ 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // float2 v_texcoo
+ 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, // rd0;.};.struct x
+ 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif
+ 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, // orm {. float4x4
+ 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // u_modelViewProj
+ 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, // ;.};.vertex xlat
+ 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, // MtlShaderOutput
+ 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, // xlatMtlMain (xla
+ 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, // tMtlShaderInput
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, // _mtl_i [[stage_i
+ 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, // n]], constant xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, // atMtlShaderUnifo
+ 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, // rm& _mtl_u [[buf
+ 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, // fer(0)]]).{. xl
+ 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu
+ 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // t _mtl_o;. floa
+ 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // t4 tmpvar_1;. t
+ 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // mpvar_1.w = 1.0;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, // . tmpvar_1.xyz
+ 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // = _mtl_i.a_posit
+ 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, // ion;. _mtl_o.gl
+ 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, // _Position = (_mt
+ 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // l_u.u_modelViewP
+ 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, // roj * tmpvar_1);
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // . _mtl_o.v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, // oord0 = _mtl_i.a
+ 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, // _texcoord0;. _m
+ 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // tl_o.v_color0 =
+ 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // _mtl_i.a_color0;
+ 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . _mtl_o.v_colo
+ 0x72, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x63, 0x6f, // r1 = _mtl_i.a_co
+ 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, // lor1;. return _
+ 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mtl_o;.}...
+};
diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
index ccf6a580b80..0314455b413 100644
--- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp
+++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
-#include <bgfx.h>
+#include <bgfx/bgfx.h>
#include "../../src/vertexdecl.h"
#include <tinystl/allocator.h>
@@ -510,11 +510,11 @@ int main(int _argc, const char* _argv[])
for (uint32_t edge = 0, numEdges = argc-1; edge < numEdges; ++edge)
{
Index3 index;
- index.m_texcoord = 0;
- index.m_normal = 0;
+ index.m_texcoord = -1;
+ index.m_normal = -1;
index.m_vertexIndex = -1;
- char* vertex = argv[edge+1];
+ char* vertex = argv[edge+1];
char* texcoord = strchr(vertex, '/');
if (NULL != texcoord)
{
@@ -528,8 +528,12 @@ int main(int _argc, const char* _argv[])
index.m_normal = (nn < 0) ? nn+numNormals : nn-1;
}
- const int tex = atoi(texcoord);
- index.m_texcoord = (tex < 0) ? tex+numTexcoords : tex-1;
+ // https://en.wikipedia.org/wiki/Wavefront_.obj_file#Vertex_Normal_Indices_Without_Texture_Coordinate_Indices
+ if(*texcoord != '\0')
+ {
+ const int tex = atoi(texcoord);
+ index.m_texcoord = (tex < 0) ? tex+numTexcoords : tex-1;
+ }
}
const int pos = atoi(vertex);
@@ -716,8 +720,8 @@ int main(int _argc, const char* _argv[])
bool hasTexcoord;
{
Index3Map::const_iterator it = indexMap.begin();
- hasNormal = 0 != it->second.m_normal;
- hasTexcoord = 0 != it->second.m_texcoord;
+ hasNormal = -1 != it->second.m_normal;
+ hasTexcoord = -1 != it->second.m_texcoord;
if (!hasTexcoord
&& texcoords.size() == positions.size() )
@@ -938,14 +942,14 @@ int main(int _argc, const char* _argv[])
}
}
- if (0 < numVertices)
+ prim.m_numVertices = numVertices - prim.m_startVertex;
+ if (0 < prim.m_numVertices)
{
- prim.m_numVertices = numVertices - prim.m_startVertex;
prim.m_numIndices = numIndices - prim.m_startIndex;
prim.m_name = groupIt->m_name;
primitives.push_back(prim);
prim.m_startVertex = numVertices;
- prim.m_startIndex = numIndices;
+ prim.m_startIndex = numIndices;
}
BX_TRACE("%3d: s %5d, n %5d, %s\n"
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
index 192a1f33a99..a8c854d2c4e 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
@@ -13,9 +13,9 @@ extern "C"
#include <fpp.h>
} // extern "C"
-#define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x1)
-#define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x3)
-#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x3)
+#define BGFX_CHUNK_MAGIC_CSH BX_MAKEFOURCC('C', 'S', 'H', 0x2)
+#define BGFX_CHUNK_MAGIC_FSH BX_MAKEFOURCC('F', 'S', 'H', 0x4)
+#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x4)
long int fsize(FILE* _file)
{
@@ -70,12 +70,7 @@ static const char* s_OES_texture_3D[] =
const char* s_uniformTypeName[UniformType::Count] =
{
"int",
- "float",
NULL,
- "int",
- "float",
- "vec2",
- "vec3",
"vec4",
"mat3",
"mat4",
@@ -712,10 +707,11 @@ int main(int _argc, const char* _argv[])
bool raw = cmdLine.hasArg('\0', "raw");
- uint32_t glsl = 0;
- uint32_t essl = 0;
- uint32_t hlsl = 2;
- uint32_t d3d = 11;
+ uint32_t glsl = 0;
+ uint32_t essl = 0;
+ uint32_t hlsl = 2;
+ uint32_t d3d = 11;
+ uint32_t metal = 0;
const char* profile = cmdLine.findOption('p', "profile");
if (NULL != profile)
{
@@ -736,6 +732,10 @@ int main(int _argc, const char* _argv[])
{
hlsl = 5;
}
+ else if (0 == strcmp(profile, "metal") )
+ {
+ metal = 1;
+ }
else
{
glsl = atoi(profile);
@@ -801,6 +801,7 @@ int main(int _argc, const char* _argv[])
// preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_ESSL");
preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_GLSL");
preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_HLSL");
+ preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_METAL");
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_COMPUTE");
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT");
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX");
@@ -837,6 +838,9 @@ int main(int _argc, const char* _argv[])
{
preprocessor.setDefine("BX_PLATFORM_OSX=1");
preprocessor.setDefine(glslDefine);
+ char temp[256];
+ bx::snprintf(temp, sizeof(temp), "BGFX_SHADER_LANGUAGE_METAL=%d", metal);
+ preprocessor.setDefine(temp);
}
else if (0 == bx::stricmp(platform, "windows") )
{
@@ -898,6 +902,10 @@ int main(int _argc, const char* _argv[])
{
preprocessor.addDependency(varyingdef);
}
+ else
+ {
+ fprintf(stderr, "ERROR: Failed to parse varying def file: \"%s\" No input/output semantics will be generated in the code!\n", varyingdef);
+ }
while (NULL != parse
&& *parse != '\0')
@@ -1107,7 +1115,8 @@ int main(int _argc, const char* _argv[])
else
{
if (0 != glsl
- || 0 != essl)
+ || 0 != essl
+ || 0 != metal)
{
}
else
@@ -1285,7 +1294,8 @@ int main(int _argc, const char* _argv[])
else
{
if (0 != glsl
- || 0 != essl)
+ || 0 != essl
+ || 0 != metal)
{
if (120 == glsl
|| 0 != essl)
@@ -1647,7 +1657,8 @@ int main(int _argc, const char* _argv[])
}
if (0 != glsl
- || 0 != essl)
+ || 0 != essl
+ || 0 != metal)
{
std::string code;
@@ -1655,7 +1666,14 @@ int main(int _argc, const char* _argv[])
if (0 == essl)
{
- bx::stringPrintf(code, "#version %s\n", profile);
+ if (0 != metal)
+ {
+ bx::stringPrintf(code, "#version 120\n");
+ }
+ else
+ {
+ bx::stringPrintf(code, "#version %s\n", profile);
+ }
bx::stringPrintf(code
, "#define bgfxShadow2D shadow2D\n"
@@ -1716,11 +1734,19 @@ int main(int _argc, const char* _argv[])
}
code += preprocessor.m_preprocessed;
- compiled = compileGLSLShader(cmdLine, essl, code, writer);
+ compiled = compileGLSLShader(cmdLine
+ , metal ? BX_MAKEFOURCC('M', 'T', 'L', 0) : essl
+ , code
+ , writer
+ );
}
else
{
- compiled = compileHLSLShader(cmdLine, d3d, preprocessor.m_preprocessed, writer);
+ compiled = compileHLSLShader(cmdLine
+ , d3d
+ , preprocessor.m_preprocessed
+ , writer
+ );
}
writer->close();
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.h b/3rdparty/bgfx/tools/shaderc/shaderc.h
index 38735c6be64..a9e6e09ff47 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.h
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.h
@@ -104,23 +104,19 @@ struct UniformType
{
enum Enum
{
- Uniform1i,
- Uniform1f,
+ Int1,
End,
- Uniform1iv,
- Uniform1fv,
- Uniform2fv,
- Uniform3fv,
- Uniform4fv,
- Uniform3x3fv,
- Uniform4x4fv,
+ Vec4,
+ Mat3,
+ Mat4,
Count
};
};
#define BGFX_UNIFORM_FRAGMENTBIT UINT8_C(0x10)
+#define BGFX_UNIFORM_SAMPLERBIT UINT8_C(0x20)
const char* getUniformTypeName(UniformType::Enum _enum);
UniformType::Enum nameToUniformTypeEnum(const char* _name);
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
index f0e5cec82fe..a4afb92e43b 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
@@ -16,6 +16,10 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str
glslopt_target target = kGlslTargetOpenGL;
switch (_gles)
{
+ case BX_MAKEFOURCC('M', 'T', 'L', 0):
+ target = kGlslTargetMetal;
+ break;
+
case 2:
target = kGlslTargetOpenGLES20;
break;
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
index e20e09543e6..60c81282b08 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
@@ -100,13 +100,16 @@ struct UniformRemap
uint8_t rows;
};
-static const UniformRemap s_uniformRemap[7] =
+static const UniformRemap s_uniformRemap[] =
{
- { UniformType::Uniform1iv, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 },
- { UniformType::Uniform1fv, D3D_SVC_SCALAR, D3D_SVT_FLOAT, 0, 0 },
- { UniformType::Uniform4fv, D3D_SVC_VECTOR, D3D_SVT_FLOAT, 0, 0 },
- { UniformType::Uniform3x3fv, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 3, 3 },
- { UniformType::Uniform4x4fv, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 4, 4 },
+ { UniformType::Int1, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 },
+ { UniformType::Vec4, D3D_SVC_VECTOR, D3D_SVT_FLOAT, 0, 0 },
+ { UniformType::Mat3, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 3, 3 },
+ { UniformType::Mat4, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 4, 4 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER2D, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER3D, 0, 0 },
+ { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLERCUBE, 0, 0 },
};
UniformType::Enum findUniformType(const D3D11_SHADER_TYPE_DESC& constDesc)
@@ -116,7 +119,7 @@ UniformType::Enum findUniformType(const D3D11_SHADER_TYPE_DESC& constDesc)
const UniformRemap& remap = s_uniformRemap[ii];
if (remap.paramClass == constDesc.Class
- && remap.paramType == constDesc.Type)
+ && remap.paramType == constDesc.Type)
{
if (D3D_SVC_MATRIX_COLUMNS != constDesc.Class)
{
@@ -144,6 +147,24 @@ static uint32_t s_optimizationLevelDx11[4] =
typedef std::vector<std::string> UniformNameList;
+static bool isSampler(D3D_SHADER_VARIABLE_TYPE _svt)
+{
+ switch (_svt)
+ {
+ case D3D_SVT_SAMPLER:
+ case D3D_SVT_SAMPLER1D:
+ case D3D_SVT_SAMPLER2D:
+ case D3D_SVT_SAMPLER3D:
+ case D3D_SVT_SAMPLERCUBE:
+ return true;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
bool getReflectionDataDx9(ID3DBlob* _code, UniformArray& _uniforms)
{
// see reference for magic values: https://msdn.microsoft.com/en-us/library/ff552891(VS.85).aspx
@@ -223,9 +244,9 @@ bool getReflectionDataDx9(ID3DBlob* _code, UniformArray& _uniforms)
);
D3D11_SHADER_TYPE_DESC desc;
- desc.Class = (D3D_SHADER_VARIABLE_CLASS)ctType.Class;
- desc.Type = (D3D_SHADER_VARIABLE_TYPE)ctType.Type;
- desc.Rows = ctType.Rows;
+ desc.Class = (D3D_SHADER_VARIABLE_CLASS)ctType.Class;
+ desc.Type = (D3D_SHADER_VARIABLE_TYPE)ctType.Type;
+ desc.Rows = ctType.Rows;
desc.Columns = ctType.Columns;
UniformType::Enum type = findUniformType(desc);
@@ -233,10 +254,14 @@ bool getReflectionDataDx9(ID3DBlob* _code, UniformArray& _uniforms)
{
Uniform un;
un.name = '$' == name[0] ? name + 1 : name;
- un.type = type;
- un.num = (uint8_t)ctType.Elements;
+ un.type = isSampler(desc.Type)
+ ? UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | type)
+ : type
+ ;
+ un.num = (uint8_t)ctType.Elements;
un.regIndex = ctInfo.RegisterIndex;
un.regCount = ctInfo.RegisterCount;
+
_uniforms.push_back(un);
}
}
@@ -377,7 +402,7 @@ bool getReflectionDataDx11(ID3DBlob* _code, bool _vshader, UniformArray& _unifor
hr = reflect->GetResourceBindingDesc(ii, &bindDesc);
if (SUCCEEDED(hr) )
{
- // if (bindDesc.Type == D3D_SIT_SAMPLER)
+ if (D3D_SIT_SAMPLER == bindDesc.Type)
{
BX_TRACE("\t%s, %d, %d, %d"
, bindDesc.Name
@@ -385,6 +410,18 @@ bool getReflectionDataDx11(ID3DBlob* _code, bool _vshader, UniformArray& _unifor
, bindDesc.BindPoint
, bindDesc.BindCount
);
+
+ const char * end = strstr(bindDesc.Name, "Sampler");
+ if (NULL != end)
+ {
+ Uniform un;
+ un.name.assign(bindDesc.Name, (end - bindDesc.Name) );
+ un.type = UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | UniformType::Int1);
+ un.num = 1;
+ un.regIndex = bindDesc.BindPoint;
+ un.regCount = bindDesc.BindCount;
+ _uniforms.push_back(un);
+ }
}
}
}
diff --git a/3rdparty/bx/include/bx/allocator.h b/3rdparty/bx/include/bx/allocator.h
index 3892c38feea..8d3e88ccdfd 100644
--- a/3rdparty/bx/include/bx/allocator.h
+++ b/3rdparty/bx/include/bx/allocator.h
@@ -58,14 +58,6 @@ namespace bx
return un.ptr;
}
- /// Check if pointer is aligned. _align must be power of two.
- inline bool isPtrAligned(const void* _ptr, size_t _align = BX_CONFIG_ALLOCATOR_NATURAL_ALIGNMENT)
- {
- union { const void* ptr; size_t addr; } un;
- un.ptr = _ptr;
- return 0 == (un.addr & (_align-1) );
- }
-
struct BX_NO_VTABLE AllocatorI
{
virtual ~AllocatorI() = 0;
diff --git a/3rdparty/bx/include/bx/blockalloc.h b/3rdparty/bx/include/bx/blockalloc.h
deleted file mode 100644
index 5bbeb1fbfbf..00000000000
--- a/3rdparty/bx/include/bx/blockalloc.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2010-2015 Branimir Karadzic. All rights reserved.
- * License: http://www.opensource.org/licenses/BSD-2-Clause
- */
-
-#ifndef BX_BLOCKALLOC_H_HEADER_GUARD
-#define BX_BLOCKALLOC_H_HEADER_GUARD
-
-#include "bx.h"
-
-namespace bx
-{
- class BlockAlloc
- {
- public:
- static const uint16_t invalidIndex = 0xffff;
- static const uint32_t minElementSize = 2;
-
- BlockAlloc()
- : m_data(NULL)
- , m_num(0)
- , m_size(0)
- , m_numFree(0)
- , m_freeIndex(invalidIndex)
- {
- }
-
- BlockAlloc(void* _data, uint16_t _num, uint16_t _size)
- : m_data(_data)
- , m_num(_num)
- , m_size(_size)
- , m_numFree(_num)
- , m_freeIndex(0)
- {
- char* data = (char*)_data;
- uint16_t* index = (uint16_t*)_data;
- for (uint16_t ii = 0; ii < m_num-1; ++ii)
- {
- *index = ii+1;
- data += m_size;
- index = (uint16_t*)data;
- }
- *index = invalidIndex;
- }
-
- ~BlockAlloc()
- {
- }
-
- void* alloc()
- {
- if (invalidIndex == m_freeIndex)
- {
- return NULL;
- }
-
- void* obj = ( (char*)m_data) + m_freeIndex*m_size;
- m_freeIndex = *( (uint16_t*)obj);
- --m_numFree;
-
- return obj;
- }
-
- void free(void* _obj)
- {
- uint16_t index = getIndex(_obj);
- BX_CHECK(index < m_num, "index %d, m_num %d", index, m_num);
-
- *( (uint16_t*)_obj) = m_freeIndex;
- m_freeIndex = index;
- ++m_numFree;
- }
-
- uint16_t getIndex(void* _obj) const
- {
- return (uint16_t)( ( (char*)_obj - (char*)m_data ) / m_size);
- }
-
- uint16_t getNumFree() const
- {
- return m_numFree;
- }
-
- void* getFromIndex(uint16_t _index)
- {
- return (char*)m_data + _index*m_size;
- }
-
- private:
- void* m_data;
- uint16_t m_num;
- uint16_t m_size;
- uint16_t m_numFree;
- uint16_t m_freeIndex;
- };
-
-} // namespace bx
-
-#endif // BX_BLOCKALLOC_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/bx.h b/3rdparty/bx/include/bx/bx.h
index 54206474355..48ba9701fb8 100644
--- a/3rdparty/bx/include/bx/bx.h
+++ b/3rdparty/bx/include/bx/bx.h
@@ -44,6 +44,14 @@ namespace bx
Ty tmp = _a; _a = _b; _b = tmp;
}
+ /// Check if pointer is aligned. _align must be power of two.
+ inline bool isPtrAligned(const void* _ptr, size_t _align)
+ {
+ union { const void* ptr; size_t addr; } un;
+ un.ptr = _ptr;
+ return 0 == (un.addr & (_align-1) );
+ }
+
} // namespace bx
// Annoying C++0x stuff..
diff --git a/3rdparty/bx/include/bx/config.h b/3rdparty/bx/include/bx/config.h
index 6447055c4cc..9a439f98651 100644
--- a/3rdparty/bx/include/bx/config.h
+++ b/3rdparty/bx/include/bx/config.h
@@ -24,6 +24,7 @@
# define BX_CONFIG_CRT_FILE_READER_WRITER (0 \
|| BX_PLATFORM_ANDROID \
|| BX_PLATFORM_FREEBSD \
+ || BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_OSX \
diff --git a/3rdparty/bx/include/bx/cpu.h b/3rdparty/bx/include/bx/cpu.h
index a9cab513273..c3713027fbb 100644
--- a/3rdparty/bx/include/bx/cpu.h
+++ b/3rdparty/bx/include/bx/cpu.h
@@ -25,8 +25,7 @@ extern "C" void _ReadWriteBarrier();
# pragma intrinsic(_ReadBarrier)
# pragma intrinsic(_WriteBarrier)
# pragma intrinsic(_ReadWriteBarrier)
-# pragma intrinsic(_InterlockedIncrement)
-# pragma intrinsic(_InterlockedDecrement)
+# pragma intrinsic(_InterlockedExchangeAdd)
# pragma intrinsic(_InterlockedCompareExchange)
#endif // BX_COMPILER_MSVC
@@ -77,27 +76,184 @@ namespace bx
#endif // BX_COMPILER
}
- /// Returns the resulting incremented value.
- inline int32_t atomicInc(volatile void* _ptr)
+ template<typename Ty>
+ inline Ty atomicFetchAndAdd(volatile Ty* _ptr, Ty _value);
+
+ template<typename Ty>
+ inline Ty atomicAddAndFetch(volatile Ty* _ptr, Ty _value);
+
+ template<typename Ty>
+ inline Ty atomicFetchAndSub(volatile Ty* _ptr, Ty _value);
+
+ template<typename Ty>
+ inline Ty atomicSubAndFetch(volatile Ty* _ptr, Ty _value);
+
+ template<typename Ty>
+ inline Ty atomicCompareAndSwap(volatile void* _ptr, Ty _old, Ty _new);
+
+ template<>
+ inline int32_t atomicCompareAndSwap(volatile void* _ptr, int32_t _old, int32_t _new);
+
+ template<>
+ inline int64_t atomicCompareAndSwap(volatile void* _ptr, int64_t _old, int64_t _new);
+
+ template<>
+ inline int32_t atomicFetchAndAdd<int32_t>(volatile int32_t* _ptr, int32_t _add)
{
#if BX_COMPILER_MSVC
- return _InterlockedIncrement( (volatile LONG*)(_ptr) );
+ return _InterlockedExchangeAdd( (volatile long*)_ptr, _add);
#else
- return __sync_add_and_fetch( (volatile int32_t*)_ptr, 1);
-#endif // BX_COMPILER
+ return __sync_fetch_and_add(_ptr, _add);
+#endif // BX_COMPILER_
}
- /// Returns the resulting decremented value.
- inline int32_t atomicDec(volatile void* _ptr)
+ template<>
+ inline int64_t atomicFetchAndAdd<int64_t>(volatile int64_t* _ptr, int64_t _add)
{
#if BX_COMPILER_MSVC
- return _InterlockedDecrement( (volatile LONG*)(_ptr) );
+# if _WIN32_WINNT >= 0x600
+ return _InterlockedExchangeAdd64( (volatile int64_t*)_ptr, _add);
+# else
+ int64_t oldVal;
+ int64_t newVal = *(int64_t volatile*)_ptr;
+ do
+ {
+ oldVal = newVal;
+ newVal = atomicCompareAndSwap(_ptr, oldVal, newVal + _add);
+
+ } while (oldVal != newVal);
+
+ return oldVal;
+# endif
#else
- return __sync_sub_and_fetch( (volatile int32_t*)_ptr, 1);
-#endif // BX_COMPILER
+ return __sync_fetch_and_add(_ptr, _add);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline uint32_t atomicFetchAndAdd<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
+ {
+ return uint32_t(atomicFetchAndAdd<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
+ }
+
+ template<>
+ inline uint64_t atomicFetchAndAdd<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
+ {
+ return uint64_t(atomicFetchAndAdd<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
+ }
+
+ template<>
+ inline int32_t atomicAddAndFetch<int32_t>(volatile int32_t* _ptr, int32_t _add)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, _add) + _add;
+#else
+ return __sync_add_and_fetch(_ptr, _add);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline int64_t atomicAddAndFetch<int64_t>(volatile int64_t* _ptr, int64_t _add)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, _add) + _add;
+#else
+ return __sync_add_and_fetch(_ptr, _add);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline uint32_t atomicAddAndFetch<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
+ {
+ return uint32_t(atomicAddAndFetch<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
+ }
+
+ template<>
+ inline uint64_t atomicAddAndFetch<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
+ {
+ return uint64_t(atomicAddAndFetch<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
+ }
+
+ template<>
+ inline int32_t atomicFetchAndSub<int32_t>(volatile int32_t* _ptr, int32_t _sub)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, -_sub);
+#else
+ return __sync_fetch_and_sub(_ptr, _sub);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline int64_t atomicFetchAndSub<int64_t>(volatile int64_t* _ptr, int64_t _sub)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, -_sub);
+#else
+ return __sync_fetch_and_sub(_ptr, _sub);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline uint32_t atomicFetchAndSub<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
+ {
+ return uint32_t(atomicFetchAndSub<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
+ }
+
+ template<>
+ inline uint64_t atomicFetchAndSub<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
+ {
+ return uint64_t(atomicFetchAndSub<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
+ }
+
+ template<>
+ inline int32_t atomicSubAndFetch<int32_t>(volatile int32_t* _ptr, int32_t _sub)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, -_sub) - _sub;
+#else
+ return __sync_sub_and_fetch(_ptr, _sub);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline int64_t atomicSubAndFetch<int64_t>(volatile int64_t* _ptr, int64_t _sub)
+ {
+#if BX_COMPILER_MSVC
+ return atomicFetchAndAdd(_ptr, -_sub) - _sub;
+#else
+ return __sync_sub_and_fetch(_ptr, _sub);
+#endif // BX_COMPILER_
+ }
+
+ template<>
+ inline uint32_t atomicSubAndFetch<uint32_t>(volatile uint32_t* _ptr, uint32_t _add)
+ {
+ return uint32_t(atomicSubAndFetch<int32_t>( (volatile int32_t*)_ptr, int32_t(_add) ) );
+ }
+
+ template<>
+ inline uint64_t atomicSubAndFetch<uint64_t>(volatile uint64_t* _ptr, uint64_t _add)
+ {
+ return uint64_t(atomicSubAndFetch<int64_t>( (volatile int64_t*)_ptr, int64_t(_add) ) );
+ }
+
+ /// Returns the resulting incremented value.
+ template<typename Ty>
+ inline Ty atomicInc(volatile Ty* _ptr)
+ {
+ return atomicAddAndFetch(_ptr, Ty(1) );
+ }
+
+ /// Returns the resulting decremented value.
+ template<typename Ty>
+ inline Ty atomicDec(volatile Ty* _ptr)
+ {
+ return atomicSubAndFetch(_ptr, Ty(1) );
}
///
+ template<>
inline int32_t atomicCompareAndSwap(volatile void* _ptr, int32_t _old, int32_t _new)
{
#if BX_COMPILER_MSVC
@@ -108,10 +264,21 @@ namespace bx
}
///
+ template<>
+ inline int64_t atomicCompareAndSwap(volatile void* _ptr, int64_t _old, int64_t _new)
+ {
+#if BX_COMPILER_MSVC
+ return _InterlockedCompareExchange64( (volatile LONG64*)(_ptr), _new, _old);
+#else
+ return __sync_val_compare_and_swap( (volatile int64_t*)_ptr, _old, _new);
+#endif // BX_COMPILER
+ }
+
+ ///
inline void* atomicExchangePtr(void** _ptr, void* _new)
{
#if BX_COMPILER_MSVC
- return InterlockedExchangePointer(_ptr, _new); /* VS2012 no intrinsics */
+ return InterlockedExchangePointer(_ptr, _new);
#else
return __sync_lock_test_and_set(_ptr, _new);
#endif // BX_COMPILER
diff --git a/3rdparty/bx/include/bx/debug.h b/3rdparty/bx/include/bx/debug.h
index 7aff6b1f5f0..3e7afb29f6f 100644
--- a/3rdparty/bx/include/bx/debug.h
+++ b/3rdparty/bx/include/bx/debug.h
@@ -51,7 +51,10 @@ namespace bx
inline void debugOutput(const char* _out)
{
#if BX_PLATFORM_ANDROID
- __android_log_write(ANDROID_LOG_DEBUG, "", _out);
+# ifndef BX_ANDROID_LOG_TAG
+# define BX_ANDROID_LOG_TAG ""
+# endif // BX_ANDROID_LOG_TAG
+ __android_log_write(ANDROID_LOG_DEBUG, BX_ANDROID_LOG_TAG, _out);
#elif BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT || BX_PLATFORM_XBOX360
OutputDebugStringA(_out);
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
diff --git a/3rdparty/bx/include/bx/fpumath.h b/3rdparty/bx/include/bx/fpumath.h
index 37d4fec636e..0aa92c8523c 100644
--- a/3rdparty/bx/include/bx/fpumath.h
+++ b/3rdparty/bx/include/bx/fpumath.h
@@ -31,7 +31,7 @@ namespace bx
inline float fround(float _f)
{
- return float(int(_f) );
+ return floorf(_f + 0.5f);
}
inline float fmin(float _a, float _b)
@@ -121,6 +121,25 @@ namespace bx
return result;
}
+ // References:
+ // - Bias And Gain Are Your Friend
+ // http://blog.demofox.org/2012/09/24/bias-and-gain-are-your-friend/
+ // - http://demofox.org/biasgain.html
+ inline float fbias(float _time, float _bias)
+ {
+ return _time / ( ( (1.0f/_bias - 2.0f)*(1.0f - _time) ) + 1.0f);
+ }
+
+ inline float fgain(float _time, float _gain)
+ {
+ if (_time < 0.5f)
+ {
+ return fbias(_time * 2.0f, _gain) * 0.5f;
+ }
+
+ return fbias(_time * 2.0f - 1.0f, 1.0f - _gain) * 0.5f + 0.5f;
+ }
+
inline void vec3Move(float* __restrict _result, const float* __restrict _a)
{
_result[0] = _a[0];
@@ -833,6 +852,82 @@ namespace bx
_result[3] = -vec3Dot(normal, _va);
}
+ inline void calcLinearFit2D(float _result[2], const void* _points, uint32_t _stride, uint32_t _numPoints)
+ {
+ float sumX = 0.0f;
+ float sumY = 0.0f;
+ float sumXX = 0.0f;
+ float sumXY = 0.0f;
+
+ const uint8_t* ptr = (const uint8_t*)_points;
+ for (uint32_t ii = 0; ii < _numPoints; ++ii, ptr += _stride)
+ {
+ const float* point = (const float*)ptr;
+ float xx = point[0];
+ float yy = point[1];
+ sumX += xx;
+ sumY += yy;
+ sumXX += xx*xx;
+ sumXY += xx*yy;
+ }
+
+ // [ sum(x^2) sum(x) ] [ A ] = [ sum(x*y) ]
+ // [ sum(x) numPoints ] [ B ] [ sum(y) ]
+
+ float det = (sumXX*_numPoints - sumX*sumX);
+ float invDet = 1.0f/det;
+
+ _result[0] = (-sumX * sumY + _numPoints * sumXY) * invDet;
+ _result[1] = (sumXX * sumY - sumX * sumXY) * invDet;
+ }
+
+ inline void calcLinearFit3D(float _result[3], const void* _points, uint32_t _stride, uint32_t _numPoints)
+ {
+ float sumX = 0.0f;
+ float sumY = 0.0f;
+ float sumZ = 0.0f;
+ float sumXX = 0.0f;
+ float sumXY = 0.0f;
+ float sumXZ = 0.0f;
+ float sumYY = 0.0f;
+ float sumYZ = 0.0f;
+
+ const uint8_t* ptr = (const uint8_t*)_points;
+ for (uint32_t ii = 0; ii < _numPoints; ++ii, ptr += _stride)
+ {
+ const float* point = (const float*)ptr;
+ float xx = point[0];
+ float yy = point[1];
+ float zz = point[2];
+
+ sumX += xx;
+ sumY += yy;
+ sumZ += zz;
+ sumXX += xx*xx;
+ sumXY += xx*yy;
+ sumXZ += xx*zz;
+ sumYY += yy*yy;
+ sumYZ += yy*zz;
+ }
+
+ // [ sum(x^2) sum(x*y) sum(x) ] [ A ] [ sum(x*z) ]
+ // [ sum(x*y) sum(y^2) sum(y) ] [ B ] = [ sum(y*z) ]
+ // [ sum(x) sum(y) numPoints ] [ C ] [ sum(z) ]
+
+ float mtx[9] =
+ {
+ sumXX, sumXY, sumX,
+ sumXY, sumYY, sumY,
+ sumX, sumY, float(_numPoints),
+ };
+ float invMtx[9];
+ mtx3Inverse(invMtx, mtx);
+
+ _result[0] = invMtx[0]*sumXZ + invMtx[1]*sumYZ + invMtx[2]*sumZ;
+ _result[1] = invMtx[3]*sumXZ + invMtx[4]*sumYZ + invMtx[5]*sumZ;
+ _result[2] = invMtx[6]*sumXZ + invMtx[7]*sumYZ + invMtx[8]*sumZ;
+ }
+
inline void rgbToHsv(float _hsv[3], const float _rgb[3])
{
const float rr = _rgb[0];
diff --git a/3rdparty/bx/include/bx/handlealloc.h b/3rdparty/bx/include/bx/handlealloc.h
index 41dbd4fd142..332fa1d96f1 100644
--- a/3rdparty/bx/include/bx/handlealloc.h
+++ b/3rdparty/bx/include/bx/handlealloc.h
@@ -11,33 +11,30 @@
namespace bx
{
- template <uint16_t MaxHandlesT>
- class HandleAllocT
+ class HandleAlloc
{
public:
- static const uint16_t invalid = 0xffff;
+ static const uint16_t invalid = UINT16_MAX;
- HandleAllocT()
+ HandleAlloc(uint16_t _maxHandles)
: m_numHandles(0)
+ , m_maxHandles(_maxHandles)
{
- for (uint16_t ii = 0; ii < MaxHandlesT; ++ii)
- {
- m_handles[ii] = ii;
- }
+ reset();
}
- ~HandleAllocT()
+ ~HandleAlloc()
{
}
const uint16_t* getHandles() const
{
- return m_handles;
+ return getDensePtr();
}
uint16_t getHandleAt(uint16_t _at) const
{
- return m_handles[_at];
+ return getDensePtr()[_at];
}
uint16_t getNumHandles() const
@@ -47,18 +44,19 @@ namespace bx
uint16_t getMaxHandles() const
{
- return MaxHandlesT;
+ return m_maxHandles;
}
uint16_t alloc()
{
- if (m_numHandles < MaxHandlesT)
+ if (m_numHandles < m_maxHandles)
{
uint16_t index = m_numHandles;
++m_numHandles;
- uint16_t handle = m_handles[index];
- uint16_t* sparse = &m_handles[MaxHandlesT];
+ uint16_t* dense = getDensePtr();
+ uint16_t handle = dense[index];
+ uint16_t* sparse = getSparsePtr();
sparse[handle] = index;
return handle;
}
@@ -66,125 +64,363 @@ namespace bx
return invalid;
}
- bool isValid(uint16_t _handle)
+ bool isValid(uint16_t _handle) const
{
- uint16_t* sparse = &m_handles[MaxHandlesT];
- uint16_t index = sparse[_handle];
+ uint16_t* dense = getDensePtr();
+ uint16_t* sparse = getSparsePtr();
+ uint16_t index = sparse[_handle];
return index < m_numHandles
- && m_handles[index] == _handle
+ && dense[index] == _handle
;
}
void free(uint16_t _handle)
{
- BX_CHECK(0 < m_numHandles, "Freeing invalid handle %d.", _handle);
- uint16_t* sparse = &m_handles[MaxHandlesT];
+ uint16_t* dense = getDensePtr();
+ uint16_t* sparse = getSparsePtr();
uint16_t index = sparse[_handle];
--m_numHandles;
- uint16_t temp = m_handles[m_numHandles];
- m_handles[m_numHandles] = _handle;
+ uint16_t temp = dense[m_numHandles];
+ dense[m_numHandles] = _handle;
sparse[temp] = index;
- m_handles[index] = temp;
+ dense[index] = temp;
+ }
+
+ void reset()
+ {
+ m_numHandles = 0;
+ uint16_t* dense = getDensePtr();
+ for (uint16_t ii = 0, num = m_maxHandles; ii < num; ++ii)
+ {
+ dense[ii] = ii;
+ }
}
private:
- uint16_t m_handles[MaxHandlesT*2];
+ HandleAlloc();
+
+ uint16_t* getDensePtr() const
+ {
+ uint8_t* ptr = (uint8_t*)reinterpret_cast<const uint8_t*>(this);
+ return (uint16_t*)&ptr[sizeof(HandleAlloc)];
+ }
+
+ uint16_t* getSparsePtr() const
+ {
+ return &getDensePtr()[m_maxHandles];
+ }
+
uint16_t m_numHandles;
+ uint16_t m_maxHandles;
};
- class HandleAlloc
+ inline HandleAlloc* createHandleAlloc(AllocatorI* _allocator, uint16_t _maxHandles)
+ {
+ uint8_t* ptr = (uint8_t*)BX_ALLOC(_allocator, sizeof(HandleAlloc) + 2*_maxHandles*sizeof(uint16_t) );
+ return ::new (ptr) HandleAlloc(_maxHandles);
+ }
+
+ inline void destroyHandleAlloc(AllocatorI* _allocator, HandleAlloc* _handleAlloc)
+ {
+ _handleAlloc->~HandleAlloc();
+ BX_FREE(_allocator, _handleAlloc);
+ }
+
+ template <uint16_t MaxHandlesT>
+ class HandleAllocT : public HandleAlloc
{
public:
- static const uint16_t invalid = 0xffff;
+ HandleAllocT()
+ : HandleAlloc(MaxHandlesT)
+ {
+ }
- HandleAlloc(uint16_t _maxHandles, void* _handles)
- : m_handles( (uint16_t*)_handles)
- , m_numHandles(0)
- , m_maxHandles(_maxHandles)
+ ~HandleAllocT()
+ {
+ }
+
+ private:
+ uint16_t m_padding[2*MaxHandlesT];
+ };
+
+ template <uint16_t MaxHandlesT>
+ class HandleListT
+ {
+ public:
+ static const uint16_t invalid = UINT16_MAX;
+
+ HandleListT()
+ : m_front(invalid)
+ , m_back(invalid)
+ {
+ reset();
+ }
+
+ void pushBack(uint16_t _handle)
+ {
+ insertAfter(m_back, _handle);
+ }
+
+ uint16_t popBack()
{
- for (uint16_t ii = 0; ii < _maxHandles; ++ii)
+ uint16_t last = invalid != m_back
+ ? m_back
+ : m_front
+ ;
+
+ if (invalid != last)
{
- m_handles[ii] = ii;
+ remove(last);
}
+
+ return last;
}
- ~HandleAlloc()
+ void pushFront(uint16_t _handle)
+ {
+ insertBefore(m_front, _handle);
+ }
+
+ uint16_t popFront()
+ {
+ uint16_t front = m_front;
+
+ if (invalid != front)
+ {
+ remove(front);
+ }
+
+ return front;
+ }
+
+ uint16_t getFront() const
+ {
+ return m_front;
+ }
+
+ uint16_t getBack() const
+ {
+ return m_back;
+ }
+
+ uint16_t getNext(uint16_t _handle) const
+ {
+ BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
+ const Link& curr = m_links[_handle];
+ return curr.m_next;
+ }
+
+ uint16_t getPrev(uint16_t _handle) const
+ {
+ BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
+ const Link& curr = m_links[_handle];
+ return curr.m_prev;
+ }
+
+ void remove(uint16_t _handle)
+ {
+ BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
+ Link& curr = m_links[_handle];
+
+ if (invalid != curr.m_prev)
+ {
+ Link& prev = m_links[curr.m_prev];
+ prev.m_next = curr.m_next;
+ }
+ else
+ {
+ m_front = curr.m_next;
+ }
+
+ if (invalid != curr.m_next)
+ {
+ Link& next = m_links[curr.m_next];
+ next.m_prev = curr.m_prev;
+ }
+ else
+ {
+ m_back = curr.m_prev;
+ }
+
+ curr.m_prev = invalid;
+ curr.m_next = invalid;
+ }
+
+ void reset()
+ {
+ memset(m_links, 0xff, sizeof(m_links) );
+ }
+
+ private:
+ void insertBefore(int16_t _before, uint16_t _handle)
+ {
+ Link& curr = m_links[_handle];
+ curr.m_next = _before;
+
+ if (invalid != _before)
+ {
+ Link& link = m_links[_before];
+ if (invalid != link.m_prev)
+ {
+ Link& prev = m_links[link.m_prev];
+ prev.m_next = _handle;
+ }
+
+ curr.m_prev = link.m_prev;
+ link.m_prev = _handle;
+ }
+
+ updateFrontBack(_handle);
+ }
+
+ void insertAfter(uint16_t _after, uint16_t _handle)
+ {
+ Link& curr = m_links[_handle];
+ curr.m_prev = _after;
+
+ if (invalid != _after)
+ {
+ Link& link = m_links[_after];
+ if (invalid != link.m_next)
+ {
+ Link& next = m_links[link.m_next];
+ next.m_prev = _handle;
+ }
+
+ curr.m_next = link.m_next;
+ link.m_next = _handle;
+ }
+
+ updateFrontBack(_handle);
+ }
+
+ bool isValid(uint16_t _handle) const
+ {
+ return _handle < MaxHandlesT;
+ }
+
+ void updateFrontBack(uint16_t _handle)
+ {
+ Link& curr = m_links[_handle];
+
+ if (invalid == curr.m_prev)
+ {
+ m_front = _handle;
+ }
+
+ if (invalid == curr.m_next)
+ {
+ m_back = _handle;
+ }
+ }
+
+ uint16_t m_front;
+ uint16_t m_back;
+
+ struct Link
+ {
+ uint16_t m_prev;
+ uint16_t m_next;
+ };
+
+ Link m_links[MaxHandlesT];
+ };
+
+ template <uint16_t MaxHandlesT>
+ class HandleAllocLruT
+ {
+ public:
+ static const uint16_t invalid = UINT16_MAX;
+
+ HandleAllocLruT()
+ {
+ reset();
+ }
+
+ ~HandleAllocLruT()
{
}
const uint16_t* getHandles() const
{
- return m_handles;
+ return m_alloc.getHandles();
}
uint16_t getHandleAt(uint16_t _at) const
{
- return m_handles[_at];
+ return m_alloc.getHandleAt(_at);
}
uint16_t getNumHandles() const
{
- return m_numHandles;
+ return m_alloc.getNumHandles();
}
uint16_t getMaxHandles() const
{
- return m_maxHandles;
+ return m_alloc.getMaxHandles();
}
uint16_t alloc()
{
- if (m_numHandles < m_maxHandles)
+ uint16_t handle = m_alloc.alloc();
+ if (invalid != handle)
{
- uint16_t index = m_numHandles;
- ++m_numHandles;
-
- uint16_t handle = m_handles[index];
- uint16_t* sparse = &m_handles[m_maxHandles];
- sparse[handle] = index;
- return handle;
+ m_list.pushFront(handle);
}
+ return handle;
+ }
- return invalid;
+ bool isValid(uint16_t _handle) const
+ {
+ return m_alloc.isValid(_handle);
}
- bool isValid(uint16_t _handle)
+ void free(uint16_t _handle)
{
- uint16_t* sparse = &m_handles[m_maxHandles];
- uint16_t index = sparse[_handle];
+ BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
+ m_list.remove(_handle);
+ m_alloc.free(_handle);
+ }
- return (index < m_numHandles && m_handles[index] == _handle);
+ void touch(uint16_t _handle)
+ {
+ BX_CHECK(isValid(_handle), "Invalid handle %d!", _handle);
+ m_list.remove(_handle);
+ m_list.pushFront(_handle);
}
- void free(uint16_t _handle)
+ uint16_t getFront() const
{
- uint16_t* sparse = &m_handles[m_maxHandles];
- uint16_t index = sparse[_handle];
- --m_numHandles;
- uint16_t temp = m_handles[m_numHandles];
- m_handles[m_numHandles] = _handle;
- sparse[temp] = index;
- m_handles[index] = temp;
+ return m_list.getFront();
}
- private:
- uint16_t* m_handles;
- uint16_t m_numHandles;
- uint16_t m_maxHandles;
- };
+ uint16_t getBack() const
+ {
+ return m_list.getBack();
+ }
- inline HandleAlloc* createHandleAlloc(AllocatorI* _allocator, uint16_t _maxHandles)
- {
- uint8_t* ptr = (uint8_t*)BX_ALLOC(_allocator, sizeof(HandleAlloc) + 2*_maxHandles*sizeof(uint16_t) );
- return ::new (ptr) HandleAlloc(_maxHandles, &ptr[sizeof(HandleAlloc)]);
- }
+ uint16_t getNext(uint16_t _handle) const
+ {
+ return m_list.getNext(_handle);
+ }
- inline void destroyHandleAlloc(AllocatorI* _allocator, HandleAlloc* _handleAlloc)
- {
- _handleAlloc->~HandleAlloc();
- BX_FREE(_allocator, _handleAlloc);
- }
+ uint16_t getPrev(uint16_t _handle) const
+ {
+ return m_list.getPrev(_handle);
+ }
+
+ void reset()
+ {
+ m_list.reset();
+ m_alloc.reset();
+ }
+
+ private:
+ HandleListT<MaxHandlesT> m_list;
+ HandleAllocT<MaxHandlesT> m_alloc;
+ };
} // namespace bx
diff --git a/3rdparty/bx/include/bx/hash.h b/3rdparty/bx/include/bx/hash.h
index d41bb3793e3..d2f11731552 100644
--- a/3rdparty/bx/include/bx/hash.h
+++ b/3rdparty/bx/include/bx/hash.h
@@ -30,7 +30,19 @@ namespace bx
void add(const void* _data, int _len)
{
- const uint8_t* data = (uint8_t*)_data;
+ if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
+ && BX_UNLIKELY(!isPtrAligned(_data, 4) ) )
+ {
+ addUnaligned(_data, _len);
+ return;
+ }
+
+ addAligned(_data, _len);
+ }
+
+ void addAligned(const void* _data, int _len)
+ {
+ const uint8_t* data = (const uint8_t*)_data;
m_size += _len;
mixTail(data, _len);
@@ -48,6 +60,27 @@ namespace bx
mixTail(data, _len);
}
+ void addUnaligned(const void* _data, int _len)
+ {
+ const uint8_t* data = (const uint8_t*)_data;
+ m_size += _len;
+
+ mixTail(data, _len);
+
+ while(_len >= 4)
+ {
+ uint32_t kk;
+ readUnaligned(data, kk);
+
+ mmix(m_hash, kk);
+
+ data += 4;
+ _len -= 4;
+ }
+
+ mixTail(data, _len);
+ }
+
template<typename Ty>
void add(Ty _value)
{
@@ -67,6 +100,29 @@ namespace bx
}
private:
+ static void readUnaligned(const void* _data, uint32_t& _out)
+ {
+ const uint8_t* data = (const uint8_t*)_data;
+ if (BX_ENABLED(BX_CPU_ENDIAN_LITTLE) )
+ {
+ _out = 0
+ | data[0]<<24
+ | data[1]<<16
+ | data[2]<<8
+ | data[3]
+ ;
+ }
+ else
+ {
+ _out = 0
+ | data[0]
+ | data[1]<<8
+ | data[2]<<16
+ | data[3]<<24
+ ;
+ }
+ }
+
void mixTail(const uint8_t*& _data, int& _len)
{
while( _len && ((_len<4) || m_count) )
diff --git a/3rdparty/bx/include/bx/macros.h b/3rdparty/bx/include/bx/macros.h
index 5086b7e8d6d..4ee97a8ad8c 100644
--- a/3rdparty/bx/include/bx/macros.h
+++ b/3rdparty/bx/include/bx/macros.h
@@ -48,25 +48,36 @@
#define BX_ALIGNOF(_type) __alignof(_type)
+#if defined(__has_feature)
+# define BX_CLANG_HAS_FEATURE(_x) __has_feature(_x)
+#else
+# define BX_CLANG_HAS_FEATURE(_x) 0
+#endif // defined(__has_feature)
+
+#if defined(__has_extension)
+# define BX_CLANG_HAS_EXTENSION(_x) __has_extension(_x)
+#else
+# define BX_CLANG_HAS_EXTENSION(_x) 0
+#endif // defined(__has_extension)
+
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
# define BX_ALIGN_DECL(_align, _decl) _decl __attribute__( (aligned(_align) ) )
# define BX_ALLOW_UNUSED __attribute__( (unused) )
# define BX_FORCE_INLINE __extension__ static __inline __attribute__( (__always_inline__) )
# define BX_FUNCTION __PRETTY_FUNCTION__
+# define BX_LIKELY(_x) __builtin_expect(!!(_x), 1)
+# define BX_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
# define BX_NO_INLINE __attribute__( (noinline) )
# define BX_NO_RETURN __attribute__( (noreturn) )
# define BX_NO_VTABLE
# define BX_OVERRIDE
# define BX_PRINTF_ARGS(_format, _args) __attribute__ ( (format(__printf__, _format, _args) ) )
-# if BX_COMPILER_CLANG && (BX_PLATFORM_OSX || BX_PLATFORM_IOS)
-# define BX_THREAD /* not supported right now */
-# else
-# if (__GNUC__ == 4) && (__GNUC_MINOR__ <= 2)
-# define BX_THREAD /* not supported right now */
-# else
-# define BX_THREAD __thread
-# endif // __GNUC__ <= 4.2
+# if BX_CLANG_HAS_FEATURE(cxx_thread_local)
+# define BX_THREAD_LOCAL __thread
# endif // BX_COMPILER_CLANG
+# if BX_COMPILER_GCC >= 40200
+# define BX_THREAD_LOCAL __thread
+# endif // BX_COMPILER_GCC
# define BX_ATTRIBUTE(_x) __attribute__( (_x) )
# if BX_COMPILER_MSVC_COMPATIBLE
# define __stdcall
@@ -76,23 +87,19 @@
# define BX_ALLOW_UNUSED
# define BX_FORCE_INLINE __forceinline
# define BX_FUNCTION __FUNCTION__
+# define BX_LIKELY(_x) (_x)
+# define BX_UNLIKELY(_x) (_x)
# define BX_NO_INLINE __declspec(noinline)
# define BX_NO_RETURN
# define BX_NO_VTABLE __declspec(novtable)
# define BX_OVERRIDE override
# define BX_PRINTF_ARGS(_format, _args)
-# define BX_THREAD __declspec(thread)
+# define BX_THREAD_LOCAL __declspec(thread)
# define BX_ATTRIBUTE(_x)
#else
# error "Unknown BX_COMPILER_?"
#endif
-#if defined(__has_extension)
-# define BX_CLANG_HAS_EXTENSION(_x) __has_extension(_x)
-#else
-# define BX_CLANG_HAS_EXTENSION(_x) 0
-#endif // defined(__has_extension)
-
// #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)
#define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] BX_ATTRIBUTE(unused)
diff --git a/3rdparty/bx/include/bx/mpscqueue.h b/3rdparty/bx/include/bx/mpscqueue.h
index f0d91e1a238..d7f3966d5ae 100644
--- a/3rdparty/bx/include/bx/mpscqueue.h
+++ b/3rdparty/bx/include/bx/mpscqueue.h
@@ -29,9 +29,8 @@ namespace bx
void push(Ty* _ptr) // producer only
{
- m_write.lock();
+ LwMutexScope $(m_write);
m_queue.push(_ptr);
- m_write.unlock();
}
Ty* peek() // consumer only
@@ -49,6 +48,40 @@ namespace bx
SpScUnboundedQueue<Ty> m_queue;
};
+ template <typename Ty>
+ class MpScUnboundedBlockingQueue
+ {
+ BX_CLASS(MpScUnboundedBlockingQueue
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
+ MpScUnboundedBlockingQueue()
+ {
+ }
+
+ ~MpScUnboundedBlockingQueue()
+ {
+ }
+
+ void push(Ty* _ptr) // producer only
+ {
+ m_queue.push(_ptr);
+ m_sem.post();
+ }
+
+ Ty* pop() // consumer only
+ {
+ m_sem.wait();
+ return m_queue.pop();
+ }
+
+ private:
+ MpScUnboundedQueue<Ty> m_queue;
+ Semaphore m_sem;
+ };
+
} // namespace bx
#endif // BX_MPSCQUEUE_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/mutex.h b/3rdparty/bx/include/bx/mutex.h
index c0b0e8ca2de..ee6bd33871b 100644
--- a/3rdparty/bx/include/bx/mutex.h
+++ b/3rdparty/bx/include/bx/mutex.h
@@ -69,7 +69,13 @@ namespace bx
public:
Mutex()
{
- pthread_mutex_init(&m_handle, NULL);
+ pthread_mutexattr_t attr;
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
+#else
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
+ pthread_mutex_init(&m_handle, &attr);
}
~Mutex()
diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h
index 4fcd2c08079..e188d57e26e 100644
--- a/3rdparty/bx/include/bx/os.h
+++ b/3rdparty/bx/include/bx/os.h
@@ -11,17 +11,23 @@
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
# include <windows.h>
-#elif BX_PLATFORM_ANDROID \
+# include <psapi.h>
+#elif BX_PLATFORM_ANDROID \
|| BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_FREEBSD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
+ || BX_PLATFORM_PS4 \
|| BX_PLATFORM_RPI
# include <sched.h> // sched_yield
-# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX
+# if BX_PLATFORM_FREEBSD \
+ || BX_PLATFORM_IOS \
+ || BX_PLATFORM_NACL \
+ || BX_PLATFORM_OSX \
+ || BX_PLATFORM_PS4
# include <pthread.h> // mach_port_t
# endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL
@@ -29,15 +35,19 @@
# include <sys/nacl_syscalls.h> // nanosleep
# else
# include <time.h> // nanosleep
-# include <dlfcn.h> // dlopen, dlclose, dlsym
+# if !BX_PLATFORM_PS4
+# include <dlfcn.h> // dlopen, dlclose, dlsym
+# endif // !BX_PLATFORM_PS4
# endif // BX_PLATFORM_NACL
-# if BX_PLATFORM_LINUX || BX_PLATFORM_RPI
+# if BX_PLATFORM_ANDROID
+# include <malloc.h> // mallinfo
+# elif BX_PLATFORM_LINUX || BX_PLATFORM_RPI
# include <unistd.h> // syscall
# include <sys/syscall.h>
-# endif // BX_PLATFORM_LINUX || BX_PLATFORM_RPI
-
-# if BX_PLATFORM_ANDROID
+# elif BX_PLATFORM_OSX
+# include <mach/mach.h> // mach_task_basic_info
+# elif BX_PLATFORM_ANDROID
# include "debug.h" // getTid is not implemented...
# endif // BX_PLATFORM_ANDROID
#endif // BX_PLATFORM_
@@ -103,11 +113,60 @@ namespace bx
#endif //
}
+ inline size_t getProcessMemoryUsed()
+ {
+#if BX_PLATFORM_ANDROID
+ struct mallinfo mi = mallinfo();
+ return mi.uordblks;
+#elif BX_PLATFORM_LINUX
+ FILE* file = fopen("/proc/self/statm", "r");
+ if (NULL == file)
+ {
+ return 0;
+ }
+
+ long pages = 0;
+ int items = fscanf(file, "%*s%ld", &pages);
+ fclose(file);
+ return 1 == items
+ ? pages * sysconf(_SC_PAGESIZE)
+ : 0
+ ;
+#elif BX_PLATFORM_OSX
+ mach_task_basic_info info;
+ mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
+
+ int result = task_info(mach_task_self()
+ , MACH_TASK_BASIC_INFO
+ , (task_info_t)&info
+ , &infoCount
+ );
+ if (KERN_SUCCESS != result)
+ {
+ return 0;
+ }
+
+ return info.resident_size;
+#elif BX_PLATFORM_WINDOWS
+ PROCESS_MEMORY_COUNTERS pmc;
+ GetProcessMemoryInfo(GetCurrentProcess()
+ , &pmc
+ , sizeof(pmc)
+ );
+ return pmc.WorkingSetSize;
+#else
+ return 0;
+#endif // BX_PLATFORM_*
+ }
+
inline void* dlopen(const char* _filePath)
{
#if BX_PLATFORM_WINDOWS
return (void*)::LoadLibraryA(_filePath);
-#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
+#elif BX_PLATFORM_EMSCRIPTEN \
+ || BX_PLATFORM_NACL \
+ || BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_filePath);
return NULL;
#else
@@ -119,7 +178,10 @@ namespace bx
{
#if BX_PLATFORM_WINDOWS
::FreeLibrary( (HMODULE)_handle);
-#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
+#elif BX_PLATFORM_EMSCRIPTEN \
+ || BX_PLATFORM_NACL \
+ || BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_handle);
#else
::dlclose(_handle);
@@ -130,7 +192,10 @@ namespace bx
{
#if BX_PLATFORM_WINDOWS
return (void*)::GetProcAddress( (HMODULE)_handle, _symbol);
-#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
+#elif BX_PLATFORM_EMSCRIPTEN \
+ || BX_PLATFORM_NACL \
+ || BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_handle, _symbol);
return NULL;
#else
@@ -142,7 +207,8 @@ namespace bx
{
#if BX_PLATFORM_WINDOWS
::SetEnvironmentVariableA(_name, _value);
-#elif BX_PLATFORM_WINRT
+#elif BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_name, _value);
#else
::setenv(_name, _value, 1);
@@ -153,7 +219,8 @@ namespace bx
{
#if BX_PLATFORM_WINDOWS
::SetEnvironmentVariableA(_name, NULL);
-#elif BX_PLATFORM_WINRT
+#elif BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_name);
#else
::unsetenv(_name);
@@ -162,7 +229,8 @@ namespace bx
inline int chdir(const char* _path)
{
-#if BX_PLATFORM_WINRT
+#if BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_path);
return -1;
#elif BX_COMPILER_MSVC_COMPATIBLE
@@ -174,7 +242,8 @@ namespace bx
inline char* pwd(char* _buffer, uint32_t _size)
{
-#if BX_PLATFORM_WINRT
+#if BX_PLATFORM_PS4 \
+ || BX_PLATFORM_WINRT
BX_UNUSED(_buffer, _size);
return NULL;
#elif BX_COMPILER_MSVC_COMPATIBLE
diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h
index 08b31bf787f..8de637b96ef 100644
--- a/3rdparty/bx/include/bx/platform.h
+++ b/3rdparty/bx/include/bx/platform.h
@@ -169,13 +169,13 @@
#elif defined(__linux__)
# undef BX_PLATFORM_LINUX
# define BX_PLATFORM_LINUX 1
-#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
# undef BX_PLATFORM_IOS
# define BX_PLATFORM_IOS 1
#elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
# undef BX_PLATFORM_OSX
# define BX_PLATFORM_OSX 1
-#elif defined(EMSCRIPTEN)
+#elif defined(__EMSCRIPTEN__)
# undef BX_PLATFORM_EMSCRIPTEN
# define BX_PLATFORM_EMSCRIPTEN 1
#elif defined(__ORBIS__)
@@ -200,6 +200,7 @@
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_QNX \
+ || BX_PLATFORM_PS4 \
|| BX_PLATFORM_RPI \
)
diff --git a/3rdparty/bx/include/bx/process.h b/3rdparty/bx/include/bx/process.h
new file mode 100644
index 00000000000..60fc24c5d9b
--- /dev/null
+++ b/3rdparty/bx/include/bx/process.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2010-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#ifndef BX_PROCESS_H_HEADER_GUARD
+#define BX_PROCESS_H_HEADER_GUARD
+
+#include "string.h"
+#include "uint32_t.h"
+
+#if BX_PLATFORM_LINUX
+# include <unistd.h>
+#endif // BX_PLATFORM_LINUX
+
+namespace bx
+{
+ ///
+ inline void* exec(const char* const* _argv)
+ {
+#if BX_PLATFORM_LINUX
+ pid_t pid = fork();
+
+ if (0 == pid)
+ {
+ int result = execvp(_argv[0], const_cast<char *const*>(&_argv[1]) );
+ BX_UNUSED(result);
+ return NULL;
+ }
+
+ return (void*)uintptr_t(pid);
+#elif BX_PLATFORM_WINDOWS
+ STARTUPINFO si;
+ memset(&si, 0, sizeof(STARTUPINFO) );
+ si.cb = sizeof(STARTUPINFO);
+
+ PROCESS_INFORMATION pi;
+ memset(&pi, 0, sizeof(PROCESS_INFORMATION) );
+
+ int32_t total = 0;
+ for (uint32_t ii = 0; NULL != _argv[ii]; ++ii)
+ {
+ total += (int32_t)strlen(_argv[ii]) + 1;
+ }
+
+ char* temp = (char*)alloca(total);
+ int32_t len = 0;
+ for(uint32_t ii = 0; NULL != _argv[ii]; ++ii)
+ {
+ len += snprintf(&temp[len], bx::uint32_imax(0, total-len)
+ , "%s "
+ , _argv[ii]
+ );
+ }
+
+ bool ok = CreateProcessA(_argv[0]
+ , temp
+ , NULL
+ , NULL
+ , false
+ , 0
+ , NULL
+ , NULL
+ , &si
+ , &pi
+ );
+ if (ok)
+ {
+ return pi.hProcess;
+ }
+
+ return NULL;
+#else
+ return NULL;
+#endif // BX_PLATFORM_LINUX
+ }
+
+} // namespace bx
+
+#endif // BX_PROCESS_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/ringbuffer.h b/3rdparty/bx/include/bx/ringbuffer.h
index 6dff4f237fc..8b24e0e7b7a 100644
--- a/3rdparty/bx/include/bx/ringbuffer.h
+++ b/3rdparty/bx/include/bx/ringbuffer.h
@@ -40,7 +40,7 @@ namespace bx
uint32_t consume(uint32_t _size) // consumer only
{
const uint32_t maxSize = distance(m_read, m_current);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_read, size);
@@ -53,7 +53,7 @@ namespace bx
{
const uint32_t dist = distance(m_write, m_read)-1;
const uint32_t maxSize = uint32_sels(dist, m_size-1, dist);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_write, size);
@@ -65,7 +65,7 @@ namespace bx
uint32_t commit(uint32_t _size) // producer only
{
const uint32_t maxSize = distance(m_current, m_write);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_current, size);
@@ -124,7 +124,7 @@ namespace bx
uint32_t consume(uint32_t _size) // consumer only
{
const uint32_t maxSize = distance(m_read, m_current);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_read, size);
@@ -137,7 +137,7 @@ namespace bx
{
const uint32_t dist = distance(m_write, m_read)-1;
const uint32_t maxSize = uint32_sels(dist, m_size-1, dist);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_write, size);
@@ -149,7 +149,7 @@ namespace bx
uint32_t commit(uint32_t _size) // producer only
{
const uint32_t maxSize = distance(m_current, m_write);
- const uint32_t sizeNoSign = uint32_and(_size, 0x7FFFFFFF);
+ const uint32_t sizeNoSign = uint32_and(_size, 0x7fffffff);
const uint32_t test = uint32_sub(sizeNoSign, maxSize);
const uint32_t size = uint32_sels(test, _size, maxSize);
const uint32_t advance = uint32_add(m_current, size);
diff --git a/3rdparty/bx/include/bx/string.h b/3rdparty/bx/include/bx/string.h
index 242ae1225a8..7f9224a5a03 100644
--- a/3rdparty/bx/include/bx/string.h
+++ b/3rdparty/bx/include/bx/string.h
@@ -113,24 +113,24 @@ namespace bx
return NULL;
}
- /// Find substring in string. Case insensitive. Limit search to _size.
+ /// Find substring in string. Case insensitive. Limit search to _max.
inline const char* stristr(const char* _str, const char* _find, size_t _max)
{
const char* ptr = _str;
- const size_t total = strlen(_str);
- size_t len = _max < total ? _max : total;
+ size_t stringLen = strnlen(_str, _max);
+ const size_t findLen = strlen(_find);
- for (const size_t searchLen = strlen(_find); len >= searchLen; ++ptr, --len)
+ for (; stringLen >= findLen; ++ptr, --stringLen)
{
// Find start of the string.
while (tolower(*ptr) != tolower(*_find) )
{
++ptr;
- --len;
+ --stringLen;
// Search pattern lenght can't be longer than the string.
- if (searchLen > len)
+ if (findLen > stringLen)
{
return NULL;
}
diff --git a/3rdparty/bx/include/bx/thread.h b/3rdparty/bx/include/bx/thread.h
index 331aeafafa4..698418170cd 100644
--- a/3rdparty/bx/include/bx/thread.h
+++ b/3rdparty/bx/include/bx/thread.h
@@ -31,8 +31,9 @@ namespace bx
public:
Thread()
-#if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360|BX_PLATFORM_WINRT
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
: m_handle(INVALID_HANDLE_VALUE)
+ , m_threadId(UINT32_MAX)
#elif BX_PLATFORM_POSIX
: m_handle(0)
#endif // BX_PLATFORM_
@@ -52,7 +53,7 @@ namespace bx
}
}
- void init(ThreadFn _fn, void* _userData = NULL, uint32_t _stackSize = 0)
+ void init(ThreadFn _fn, void* _userData = NULL, uint32_t _stackSize = 0, const char* _name = NULL)
{
BX_CHECK(!m_running, "Already running!");
@@ -61,7 +62,7 @@ namespace bx
m_stackSize = _stackSize;
m_running = true;
-#if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360
m_handle = CreateThread(NULL
, m_stackSize
, threadFunc
@@ -102,12 +103,17 @@ namespace bx
#endif // BX_PLATFORM_
m_sem.wait();
+
+ if (NULL != _name)
+ {
+ setThreadName(_name);
+ }
}
void shutdown()
{
BX_CHECK(m_running, "Not running!");
-#if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360
WaitForSingleObject(m_handle, INFINITE);
GetExitCodeThread(m_handle, (DWORD*)&m_exitCode);
CloseHandle(m_handle);
@@ -139,14 +145,56 @@ namespace bx
return m_exitCode;
}
+ void setThreadName(const char* _name)
+ {
+#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
+ pthread_setname_np(_name);
+#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) || BX_PLATFORM_FREEBSD
+ pthread_setname_np(m_handle, _name);
+#elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
+# pragma pack(push, 8)
+ struct ThreadName
+ {
+ DWORD type;
+ LPCSTR name;
+ DWORD id;
+ DWORD flags;
+ };
+# pragma pack(pop)
+ ThreadName tn;
+ tn.type = 0x1000;
+ tn.name = _name;
+ tn.id = m_threadId;
+ tn.flags = 0;
+
+ __try
+ {
+ RaiseException(0x406d1388
+ , 0
+ , sizeof(tn)/4
+ , reinterpret_cast<ULONG_PTR*>(&tn)
+ );
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ }
+#else
+ BX_UNUSED(_name);
+#endif // BX_PLATFORM_
+ }
+
private:
int32_t entry()
{
+#if BX_PLATFORM_WINDOWS
+ m_threadId = ::GetCurrentThreadId();
+#endif // BX_PLATFORM_WINDOWS
+
m_sem.post();
return m_fn(m_userData);
}
-#if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360|BX_PLATFORM_WINRT
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
static DWORD WINAPI threadFunc(LPVOID _arg)
{
Thread* thread = (Thread*)_arg;
@@ -167,18 +215,19 @@ namespace bx
}
#endif // BX_PLATFORM_
-#if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360|BX_PLATFORM_WINRT
+#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360 || BX_PLATFORM_WINRT
HANDLE m_handle;
+ DWORD m_threadId;
#elif BX_PLATFORM_POSIX
pthread_t m_handle;
#endif // BX_PLATFORM_
- ThreadFn m_fn;
- void* m_userData;
+ ThreadFn m_fn;
+ void* m_userData;
Semaphore m_sem;
- uint32_t m_stackSize;
- int32_t m_exitCode;
- bool m_running;
+ uint32_t m_stackSize;
+ int32_t m_exitCode;
+ bool m_running;
};
#if BX_PLATFORM_WINDOWS
@@ -211,7 +260,7 @@ namespace bx
uint32_t m_id;
};
-#elif !(BX_PLATFORM_WINRT)
+#elif !BX_PLATFORM_WINRT
class TlsData
{
@@ -242,7 +291,7 @@ namespace bx
private:
pthread_key_t m_id;
};
-#endif // BX_PLATFORM_WINDOWS
+#endif // BX_PLATFORM_*
} // namespace bx
diff --git a/3rdparty/bx/include/bx/uint32_t.h b/3rdparty/bx/include/bx/uint32_t.h
index 48908f6511d..22eed28a89e 100644
--- a/3rdparty/bx/include/bx/uint32_t.h
+++ b/3rdparty/bx/include/bx/uint32_t.h
@@ -652,8 +652,8 @@ namespace bx
inline uint64_t uint64_cntlz_ref(uint64_t _val)
{
return _val & UINT64_C(0xffffffff00000000)
- ? uint32_cntlz(uint32_t(_val>>32) ) + 32
- : uint32_cntlz(uint32_t(_val) )
+ ? uint32_cntlz(uint32_t(_val>>32) )
+ : uint32_cntlz(uint32_t(_val) ) + 32
;
}
diff --git a/3rdparty/bx/include/compat/freebsd/signal.h b/3rdparty/bx/include/compat/freebsd/signal.h
new file mode 100644
index 00000000000..fd7d90f336f
--- /dev/null
+++ b/3rdparty/bx/include/compat/freebsd/signal.h
@@ -0,0 +1 @@
+#include <sys/signal.h>
diff --git a/3rdparty/bx/include/compat/mingw/sal.h b/3rdparty/bx/include/compat/mingw/sal.h
index acfcbc5eb65..5fe9e5d17c9 100644
--- a/3rdparty/bx/include/compat/mingw/sal.h
+++ b/3rdparty/bx/include/compat/mingw/sal.h
@@ -42,7 +42,7 @@
#define __ecount(size)
#define __bcount(size)
-#define __in
+// #define __in // Conflicts with STL.
#define __in_ecount(size)
#define __in_bcount(size)
#define __in_z
@@ -52,7 +52,7 @@
#define __in_ecount_nz(size)
#define __in_bcount_nz(size)
#define __in_xcount_opt(size)
-#define __out
+// #define __out // Conflicts with STL.
#define __out_ecount(size)
#define __out_bcount(size)
#define __out_ecount_part(size,length)
@@ -246,6 +246,642 @@
#define __control_entrypoint(category)
#define __data_entrypoint(category)
+#define _Always_(annos)
+#define _Analysis_noreturn_
+#define _Analysis_assume_(expr)
+#define _At_(target, annos)
+#define _At_buffer_(target, iter, bound, annos)
+#define _COM_Outptr_
+#define _COM_Outptr_opt_
+#define _COM_Outptr_opt_result_maybenull_
+#define _COM_Outptr_result_maybenull_
+#define _Check_return_
+#define _Const_
+#define _Deref2_pre_readonly_
+#define _Deref_in_bound_
+#define _Deref_in_range_(lb,ub)
+#define _Deref_inout_bound_
+#define _Deref_inout_z_
+#define _Deref_inout_z_bytecap_c_(size)
+#define _Deref_inout_z_cap_c_(size)
+#define _Deref_opt_out_
+#define _Deref_opt_out_opt_
+#define _Deref_opt_out_opt_z_
+#define _Deref_opt_out_z_
+#define _Deref_out_
+#define _Deref_out_bound_
+#define _Deref_out_opt_
+#define _Deref_out_opt_z_
+#define _Deref_out_range_(lb,ub)
+#define _Deref_out_z_
+#define _Deref_out_z_bytecap_c_(size)
+#define _Deref_out_z_cap_c_(size)
+#define _Deref_post_bytecap_(size)
+#define _Deref_post_bytecap_c_(size)
+#define _Deref_post_bytecap_x_(size)
+#define _Deref_post_bytecount_(size)
+#define _Deref_post_bytecount_c_(size)
+#define _Deref_post_bytecount_x_(size)
+#define _Deref_post_cap_(size)
+#define _Deref_post_cap_c_(size)
+#define _Deref_post_cap_x_(size)
+#define _Deref_post_count_(size)
+#define _Deref_post_count_c_(size)
+#define _Deref_post_count_x_(size)
+#define _Deref_post_maybenull_
+#define _Deref_post_notnull_
+#define _Deref_post_null_
+#define _Deref_post_opt_bytecap_(size)
+#define _Deref_post_opt_bytecap_c_(size)
+#define _Deref_post_opt_bytecap_x_(size)
+#define _Deref_post_opt_bytecount_(size)
+#define _Deref_post_opt_bytecount_c_(size)
+#define _Deref_post_opt_bytecount_x_(size)
+#define _Deref_post_opt_cap_(size)
+#define _Deref_post_opt_cap_c_(size)
+#define _Deref_post_opt_cap_x_(size)
+#define _Deref_post_opt_count_(size)
+#define _Deref_post_opt_count_c_(size)
+#define _Deref_post_opt_count_x_(size)
+#define _Deref_post_opt_valid_
+#define _Deref_post_opt_valid_bytecap_(size)
+#define _Deref_post_opt_valid_bytecap_c_(size)
+#define _Deref_post_opt_valid_bytecap_x_(size)
+#define _Deref_post_opt_valid_cap_(size)
+#define _Deref_post_opt_valid_cap_c_(size)
+#define _Deref_post_opt_valid_cap_x_(size)
+#define _Deref_post_opt_z_
+#define _Deref_post_opt_z_bytecap_(size)
+#define _Deref_post_opt_z_bytecap_c_(size)
+#define _Deref_post_opt_z_bytecap_x_(size)
+#define _Deref_post_opt_z_cap_(size)
+#define _Deref_post_opt_z_cap_c_(size)
+#define _Deref_post_opt_z_cap_x_(size)
+#define _Deref_post_valid_
+#define _Deref_post_valid_bytecap_(size)
+#define _Deref_post_valid_bytecap_c_(size)
+#define _Deref_post_valid_bytecap_x_(size)
+#define _Deref_post_valid_cap_(size)
+#define _Deref_post_valid_cap_c_(size)
+#define _Deref_post_valid_cap_x_(size)
+#define _Deref_post_z_
+#define _Deref_post_z_bytecap_(size)
+#define _Deref_post_z_bytecap_c_(size)
+#define _Deref_post_z_bytecap_x_(size)
+#define _Deref_post_z_cap_(size)
+#define _Deref_post_z_cap_c_(size)
+#define _Deref_post_z_cap_x_(size)
+#define _Deref_pre_bytecap_(size)
+#define _Deref_pre_bytecap_c_(size)
+#define _Deref_pre_bytecap_x_(size)
+#define _Deref_pre_bytecount_(size)
+#define _Deref_pre_bytecount_c_(size)
+#define _Deref_pre_bytecount_x_(size)
+#define _Deref_pre_cap_(size)
+#define _Deref_pre_cap_c_(size)
+#define _Deref_pre_cap_x_(size)
+#define _Deref_pre_count_(size)
+#define _Deref_pre_count_c_(size)
+#define _Deref_pre_count_x_(size)
+#define _Deref_pre_invalid_
+#define _Deref_pre_maybenull_
+#define _Deref_pre_notnull_
+#define _Deref_pre_null_
+#define _Deref_pre_opt_bytecap_(size)
+#define _Deref_pre_opt_bytecap_c_(size)
+#define _Deref_pre_opt_bytecap_x_(size)
+#define _Deref_pre_opt_bytecount_(size)
+#define _Deref_pre_opt_bytecount_c_(size)
+#define _Deref_pre_opt_bytecount_x_(size)
+#define _Deref_pre_opt_cap_(size)
+#define _Deref_pre_opt_cap_c_(size)
+#define _Deref_pre_opt_cap_x_(size)
+#define _Deref_pre_opt_count_(size)
+#define _Deref_pre_opt_count_c_(size)
+#define _Deref_pre_opt_count_x_(size)
+#define _Deref_pre_opt_valid_
+#define _Deref_pre_opt_valid_bytecap_(size)
+#define _Deref_pre_opt_valid_bytecap_c_(size)
+#define _Deref_pre_opt_valid_bytecap_x_(size)
+#define _Deref_pre_opt_valid_cap_(size)
+#define _Deref_pre_opt_valid_cap_c_(size)
+#define _Deref_pre_opt_valid_cap_x_(size)
+#define _Deref_pre_opt_z_
+#define _Deref_pre_opt_z_bytecap_(size)
+#define _Deref_pre_opt_z_bytecap_c_(size)
+#define _Deref_pre_opt_z_bytecap_x_(size)
+#define _Deref_pre_opt_z_cap_(size)
+#define _Deref_pre_opt_z_cap_c_(size)
+#define _Deref_pre_opt_z_cap_x_(size)
+#define _Deref_pre_readonly_
+#define _Deref_pre_valid_
+#define _Deref_pre_valid_bytecap_(size)
+#define _Deref_pre_valid_bytecap_c_(size)
+#define _Deref_pre_valid_bytecap_x_(size)
+#define _Deref_pre_valid_cap_(size)
+#define _Deref_pre_valid_cap_c_(size)
+#define _Deref_pre_valid_cap_x_(size)
+#define _Deref_pre_writeonly_
+#define _Deref_pre_z_
+#define _Deref_pre_z_bytecap_(size)
+#define _Deref_pre_z_bytecap_c_(size)
+#define _Deref_pre_z_bytecap_x_(size)
+#define _Deref_pre_z_cap_(size)
+#define _Deref_pre_z_cap_c_(size)
+#define _Deref_pre_z_cap_x_(size)
+#define _Deref_prepost_bytecap_(size)
+#define _Deref_prepost_bytecap_x_(size)
+#define _Deref_prepost_bytecount_(size)
+#define _Deref_prepost_bytecount_x_(size)
+#define _Deref_prepost_cap_(size)
+#define _Deref_prepost_cap_x_(size)
+#define _Deref_prepost_count_(size)
+#define _Deref_prepost_count_x_(size)
+#define _Deref_prepost_opt_bytecap_(size)
+#define _Deref_prepost_opt_bytecap_x_(size)
+#define _Deref_prepost_opt_bytecount_(size)
+#define _Deref_prepost_opt_bytecount_x_(size)
+#define _Deref_prepost_opt_cap_(size)
+#define _Deref_prepost_opt_cap_x_(size)
+#define _Deref_prepost_opt_count_(size)
+#define _Deref_prepost_opt_count_x_(size)
+#define _Deref_prepost_opt_valid_
+#define _Deref_prepost_opt_valid_bytecap_(size)
+#define _Deref_prepost_opt_valid_bytecap_x_(size)
+#define _Deref_prepost_opt_valid_cap_(size)
+#define _Deref_prepost_opt_valid_cap_x_(size)
+#define _Deref_prepost_opt_z_
+#define _Deref_prepost_opt_z_bytecap_(size)
+#define _Deref_prepost_opt_z_cap_(size)
+#define _Deref_prepost_valid_
+#define _Deref_prepost_valid_bytecap_(size)
+#define _Deref_prepost_valid_bytecap_x_(size)
+#define _Deref_prepost_valid_cap_(size)
+#define _Deref_prepost_valid_cap_x_(size)
+#define _Deref_prepost_z_
+#define _Deref_prepost_z_bytecap_(size)
+#define _Deref_prepost_z_cap_(size)
+#define _Deref_ret_bound_
+#define _Deref_ret_opt_z_
+#define _Deref_ret_range_(lb,ub)
+#define _Deref_ret_z_
+#define _Field_range_(min,max)
+#define _Field_size_(size)
+#define _Field_size_bytes_(size)
+#define _Field_size_bytes_full_(size)
+#define _Field_size_bytes_full_opt_(size)
+#define _Field_size_bytes_opt_(size)
+#define _Field_size_bytes_part_(size, count)
+#define _Field_size_bytes_part_opt_(size, count)
+#define _Field_size_full_(size)
+#define _Field_size_full_opt_(size)
+#define _Field_size_opt_(size)
+#define _Field_size_part_(size, count)
+#define _Field_size_part_opt_(size, count)
+#define _Field_z_
+#define _Function_class_(x)
+#define _Group_(annos)
+#define _In_
+#define _In_bound_
+#define _In_bytecount_(size)
+#define _In_bytecount_c_(size)
+#define _In_bytecount_x_(size)
+#define _In_count_(size)
+#define _In_count_c_(size)
+#define _In_count_x_(size)
+#define _In_defensive_(annotes)
+#define _In_opt_
+#define _In_opt_bytecount_(size)
+#define _In_opt_bytecount_c_(size)
+#define _In_opt_bytecount_x_(size)
+#define _In_opt_count_(size)
+#define _In_opt_count_c_(size)
+#define _In_opt_count_x_(size)
+#define _In_opt_ptrdiff_count_(size)
+#define _In_opt_z_
+#define _In_opt_z_bytecount_(size)
+#define _In_opt_z_bytecount_c_(size)
+#define _In_opt_z_count_(size)
+#define _In_opt_z_count_c_(size)
+#define _In_ptrdiff_count_(size)
+#define _In_range_(lb,ub)
+#define _In_reads_(size)
+#define _In_reads_bytes_(size)
+#define _In_reads_bytes_opt_(size)
+#define _In_reads_opt_(size)
+#define _In_reads_opt_z_(size)
+#define _In_reads_or_z_(size)
+#define _In_reads_to_ptr_(ptr)
+#define _In_reads_to_ptr_opt_(ptr)
+#define _In_reads_to_ptr_opt_z_(ptr)
+#define _In_reads_to_ptr_z_(ptr)
+#define _In_reads_z_(size)
+#define _In_z_
+#define _In_z_bytecount_(size)
+#define _In_z_bytecount_c_(size)
+#define _In_z_count_(size)
+#define _In_z_count_c_(size)
+#define _Inout_
+#define _Inout_bytecap_(size)
+#define _Inout_bytecap_c_(size)
+#define _Inout_bytecap_x_(size)
+#define _Inout_bytecount_(size)
+#define _Inout_bytecount_c_(size)
+#define _Inout_bytecount_x_(size)
+#define _Inout_cap_(size)
+#define _Inout_cap_c_(size)
+#define _Inout_cap_x_(size)
+#define _Inout_count_(size)
+#define _Inout_count_c_(size)
+#define _Inout_count_x_(size)
+#define _Inout_defensive_(annotes)
+#define _Inout_opt_
+#define _Inout_opt_bytecap_(size)
+#define _Inout_opt_bytecap_c_(size)
+#define _Inout_opt_bytecap_x_(size)
+#define _Inout_opt_bytecount_(size)
+#define _Inout_opt_bytecount_c_(size)
+#define _Inout_opt_bytecount_x_(size)
+#define _Inout_opt_cap_(size)
+#define _Inout_opt_cap_c_(size)
+#define _Inout_opt_cap_x_(size)
+#define _Inout_opt_count_(size)
+#define _Inout_opt_count_c_(size)
+#define _Inout_opt_count_x_(size)
+#define _Inout_opt_ptrdiff_count_(size)
+#define _Inout_opt_z_
+#define _Inout_opt_z_bytecap_(size)
+#define _Inout_opt_z_bytecap_c_(size)
+#define _Inout_opt_z_bytecap_x_(size)
+#define _Inout_opt_z_bytecount_(size)
+#define _Inout_opt_z_bytecount_c_(size)
+#define _Inout_opt_z_cap_(size)
+#define _Inout_opt_z_cap_c_(size)
+#define _Inout_opt_z_cap_x_(size)
+#define _Inout_opt_z_count_(size)
+#define _Inout_opt_z_count_c_(size)
+#define _Inout_ptrdiff_count_(size)
+#define _Inout_updates_(size)
+#define _Inout_updates_all_(size)
+#define _Inout_updates_all_opt_(size)
+#define _Inout_updates_bytes_(size)
+#define _Inout_updates_bytes_all_(size)
+#define _Inout_updates_bytes_all_opt_(size)
+#define _Inout_updates_bytes_opt_(size)
+#define _Inout_updates_bytes_to_(size,count)
+#define _Inout_updates_bytes_to_opt_(size,count)
+#define _Inout_updates_opt_(size)
+#define _Inout_updates_opt_z_(size)
+#define _Inout_updates_to_(size,count)
+#define _Inout_updates_to_opt_(size,count)
+#define _Inout_updates_z_(size)
+#define _Inout_z_
+#define _Inout_z_bytecap_(size)
+#define _Inout_z_bytecap_c_(size)
+#define _Inout_z_bytecap_x_(size)
+#define _Inout_z_bytecount_(size)
+#define _Inout_z_bytecount_c_(size)
+#define _Inout_z_cap_(size)
+#define _Inout_z_cap_c_(size)
+#define _Inout_z_cap_x_(size)
+#define _Inout_z_count_(size)
+#define _Inout_z_count_c_(size)
+#define _Interlocked_operand_
+#define _Literal_
+#define _Maybe_raises_SEH_exception
+#define _Maybe_raises_SEH_exception_
+#define _Maybenull_
+#define _Maybevalid_
+#define _Must_inspect_result_
+#define _Notliteral_
+#define _Notnull_
+#define _Notref_
+#define _Notvalid_
+#define _NullNull_terminated_
+#define _Null_
+#define _Null_terminated_
+#define _On_failure_(annos)
+#define _Out_
+#define _Out_bound_
+#define _Out_bytecap_(size)
+#define _Out_bytecap_c_(size)
+#define _Out_bytecap_post_bytecount_(cap,count)
+#define _Out_bytecap_x_(size)
+#define _Out_bytecapcount_(capcount)
+#define _Out_bytecapcount_x_(capcount)
+#define _Out_cap_(size)
+#define _Out_cap_c_(size)
+#define _Out_cap_m_(mult,size)
+#define _Out_cap_post_count_(cap,count)
+#define _Out_cap_x_(size)
+#define _Out_capcount_(capcount)
+#define _Out_capcount_x_(capcount)
+#define _Out_defensive_(annotes)
+#define _Out_opt_
+#define _Out_opt_bytecap_(size)
+#define _Out_opt_bytecap_c_(size)
+#define _Out_opt_bytecap_post_bytecount_(cap,count)
+#define _Out_opt_bytecap_x_(size)
+#define _Out_opt_bytecapcount_(capcount)
+#define _Out_opt_bytecapcount_x_(capcount)
+#define _Out_opt_cap_(size)
+#define _Out_opt_cap_c_(size)
+#define _Out_opt_cap_m_(mult,size)
+#define _Out_opt_cap_post_count_(cap,count)
+#define _Out_opt_cap_x_(size)
+#define _Out_opt_capcount_(capcount)
+#define _Out_opt_capcount_x_(capcount)
+#define _Out_opt_ptrdiff_cap_(size)
+#define _Out_opt_z_bytecap_(size)
+#define _Out_opt_z_bytecap_c_(size)
+#define _Out_opt_z_bytecap_post_bytecount_(cap,count)
+#define _Out_opt_z_bytecap_x_(size)
+#define _Out_opt_z_bytecapcount_(capcount)
+#define _Out_opt_z_cap_(size)
+#define _Out_opt_z_cap_c_(size)
+#define _Out_opt_z_cap_m_(mult,size)
+#define _Out_opt_z_cap_post_count_(cap,count)
+#define _Out_opt_z_cap_x_(size)
+#define _Out_opt_z_capcount_(capcount)
+#define _Out_ptrdiff_cap_(size)
+#define _Out_range_(lb,ub)
+#define _Out_writes_(size)
+#define _Out_writes_all_(size)
+#define _Out_writes_all_opt_(size)
+#define _Out_writes_bytes_(size)
+#define _Out_writes_bytes_all_(size)
+#define _Out_writes_bytes_all_opt_(size)
+#define _Out_writes_bytes_opt_(size)
+#define _Out_writes_bytes_to_(size,count)
+#define _Out_writes_bytes_to_opt_(size,count)
+#define _Out_writes_opt_(size)
+#define _Out_writes_opt_z_(size)
+#define _Out_writes_to_(size,count)
+#define _Out_writes_to_opt_(size,count)
+#define _Out_writes_to_ptr_(ptr)
+#define _Out_writes_to_ptr_opt_(ptr)
+#define _Out_writes_to_ptr_opt_z_(ptr)
+#define _Out_writes_to_ptr_z_(ptr)
+#define _Out_writes_z_(size)
+#define _Out_z_bytecap_(size)
+#define _Out_z_bytecap_c_(size)
+#define _Out_z_bytecap_post_bytecount_(cap,count)
+#define _Out_z_bytecap_x_(size)
+#define _Out_z_bytecapcount_(capcount)
+#define _Out_z_cap_(size)
+#define _Out_z_cap_c_(size)
+#define _Out_z_cap_m_(mult,size)
+#define _Out_z_cap_post_count_(cap,count)
+#define _Out_z_cap_x_(size)
+#define _Out_z_capcount_(capcount)
+#define _Outptr_
+#define _Outptr_opt_
+#define _Outptr_opt_result_buffer_(size)
+#define _Outptr_opt_result_buffer_all_(size)
+#define _Outptr_opt_result_buffer_all_maybenull_(size)
+#define _Outptr_opt_result_buffer_maybenull_(size)
+#define _Outptr_opt_result_buffer_to_(size, count)
+#define _Outptr_opt_result_buffer_to_maybenull_(size, count)
+#define _Outptr_opt_result_bytebuffer_(size)
+#define _Outptr_opt_result_bytebuffer_all_(size)
+#define _Outptr_opt_result_bytebuffer_all_maybenull_(size)
+#define _Outptr_opt_result_bytebuffer_maybenull_(size)
+#define _Outptr_opt_result_bytebuffer_to_(size, count)
+#define _Outptr_opt_result_bytebuffer_to_maybenull_(size, count)
+#define _Outptr_opt_result_maybenull_
+#define _Outptr_opt_result_maybenull_z_
+#define _Outptr_opt_result_nullonfailure_
+#define _Outptr_opt_result_z_
+#define _Outptr_result_buffer_(size)
+#define _Outptr_result_buffer_all_(size)
+#define _Outptr_result_buffer_all_maybenull_(size)
+#define _Outptr_result_buffer_maybenull_(size)
+#define _Outptr_result_buffer_to_(size, count)
+#define _Outptr_result_buffer_to_maybenull_(size, count)
+#define _Outptr_result_bytebuffer_(size)
+#define _Outptr_result_bytebuffer_all_(size)
+#define _Outptr_result_bytebuffer_all_maybenull_(size)
+#define _Outptr_result_bytebuffer_maybenull_(size)
+#define _Outptr_result_bytebuffer_to_(size, count)
+#define _Outptr_result_bytebuffer_to_maybenull_(size, count)
+#define _Outptr_result_maybenull_
+#define _Outptr_result_maybenull_z_
+#define _Outptr_result_nullonfailure_
+#define _Outptr_result_z_
+#define _Outref_
+#define _Outref_result_buffer_(size)
+#define _Outref_result_buffer_all_(size)
+#define _Outref_result_buffer_all_maybenull_(size)
+#define _Outref_result_buffer_maybenull_(size)
+#define _Outref_result_buffer_to_(size, count)
+#define _Outref_result_buffer_to_maybenull_(size, count)
+#define _Outref_result_bytebuffer_(size)
+#define _Outref_result_bytebuffer_all_(size)
+#define _Outref_result_bytebuffer_all_maybenull_(size)
+#define _Outref_result_bytebuffer_maybenull_(size)
+#define _Outref_result_bytebuffer_to_(size, count)
+#define _Outref_result_bytebuffer_to_maybenull_(size, count)
+#define _Outref_result_maybenull_
+#define _Outref_result_nullonfailure_
+#define _Points_to_data_
+#define _Post_
+#define _Post_bytecap_(size)
+#define _Post_bytecount_(size)
+#define _Post_bytecount_c_(size)
+#define _Post_bytecount_x_(size)
+#define _Post_cap_(size)
+#define _Post_count_(size)
+#define _Post_count_c_(size)
+#define _Post_count_x_(size)
+#define _Post_defensive_
+#define _Post_equal_to_(expr)
+#define _Post_invalid_
+#define _Post_maybenull_
+#define _Post_maybez_
+#define _Post_notnull_
+#define _Post_null_
+#define _Post_ptr_invalid_
+#define _Post_readable_byte_size_(size)
+#define _Post_readable_size_(size)
+#define _Post_satisfies_(cond)
+#define _Post_valid_
+#define _Post_writable_byte_size_(size)
+#define _Post_writable_size_(size)
+#define _Post_z_
+#define _Post_z_bytecount_(size)
+#define _Post_z_bytecount_c_(size)
+#define _Post_z_bytecount_x_(size)
+#define _Post_z_count_(size)
+#define _Post_z_count_c_(size)
+#define _Post_z_count_x_(size)
+#define _Pre_
+#define _Pre_bytecap_(size)
+#define _Pre_bytecap_c_(size)
+#define _Pre_bytecap_x_(size)
+#define _Pre_bytecount_(size)
+#define _Pre_bytecount_c_(size)
+#define _Pre_bytecount_x_(size)
+#define _Pre_cap_(size)
+#define _Pre_cap_c_(size)
+#define _Pre_cap_c_one_
+#define _Pre_cap_for_(param)
+#define _Pre_cap_m_(mult,size)
+#define _Pre_cap_x_(size)
+#define _Pre_count_(size)
+#define _Pre_count_c_(size)
+#define _Pre_count_x_(size)
+#define _Pre_defensive_
+#define _Pre_equal_to_(expr)
+#define _Pre_invalid_
+#define _Pre_maybenull_
+#define _Pre_notnull_
+#define _Pre_null_
+#define _Pre_opt_bytecap_(size)
+#define _Pre_opt_bytecap_c_(size)
+#define _Pre_opt_bytecap_x_(size)
+#define _Pre_opt_bytecount_(size)
+#define _Pre_opt_bytecount_c_(size)
+#define _Pre_opt_bytecount_x_(size)
+#define _Pre_opt_cap_(size)
+#define _Pre_opt_cap_c_(size)
+#define _Pre_opt_cap_c_one_
+#define _Pre_opt_cap_for_(param)
+#define _Pre_opt_cap_m_(mult,size)
+#define _Pre_opt_cap_x_(size)
+#define _Pre_opt_count_(size)
+#define _Pre_opt_count_c_(size)
+#define _Pre_opt_count_x_(size)
+#define _Pre_opt_ptrdiff_cap_(ptr)
+#define _Pre_opt_ptrdiff_count_(ptr)
+#define _Pre_opt_valid_
+#define _Pre_opt_valid_bytecap_(size)
+#define _Pre_opt_valid_bytecap_c_(size)
+#define _Pre_opt_valid_bytecap_x_(size)
+#define _Pre_opt_valid_cap_(size)
+#define _Pre_opt_valid_cap_c_(size)
+#define _Pre_opt_valid_cap_x_(size)
+#define _Pre_opt_z_
+#define _Pre_opt_z_bytecap_(size)
+#define _Pre_opt_z_bytecap_c_(size)
+#define _Pre_opt_z_bytecap_x_(size)
+#define _Pre_opt_z_cap_(size)
+#define _Pre_opt_z_cap_c_(size)
+#define _Pre_opt_z_cap_x_(size)
+#define _Pre_ptrdiff_cap_(ptr)
+#define _Pre_ptrdiff_count_(ptr)
+#define _Pre_readable_byte_size_(size)
+#define _Pre_readable_size_(size)
+#define _Pre_readonly_
+#define _Pre_satisfies_(cond)
+#define _Pre_valid_
+#define _Pre_valid_bytecap_(size)
+#define _Pre_valid_bytecap_c_(size)
+#define _Pre_valid_bytecap_x_(size)
+#define _Pre_valid_cap_(size)
+#define _Pre_valid_cap_c_(size)
+#define _Pre_valid_cap_x_(size)
+#define _Pre_writable_byte_size_(size)
+#define _Pre_writable_size_(size)
+#define _Pre_writeonly_
+#define _Pre_z_
+#define _Pre_z_bytecap_(size)
+#define _Pre_z_bytecap_c_(size)
+#define _Pre_z_bytecap_x_(size)
+#define _Pre_z_cap_(size)
+#define _Pre_z_cap_c_(size)
+#define _Pre_z_cap_x_(size)
+#define _Prepost_bytecount_(size)
+#define _Prepost_bytecount_c_(size)
+#define _Prepost_bytecount_x_(size)
+#define _Prepost_count_(size)
+#define _Prepost_count_c_(size)
+#define _Prepost_count_x_(size)
+#define _Prepost_opt_bytecount_(size)
+#define _Prepost_opt_bytecount_c_(size)
+#define _Prepost_opt_bytecount_x_(size)
+#define _Prepost_opt_count_(size)
+#define _Prepost_opt_count_c_(size)
+#define _Prepost_opt_count_x_(size)
+#define _Prepost_opt_valid_
+#define _Prepost_opt_z_
+#define _Prepost_valid_
+#define _Prepost_z_
+#define _Printf_format_string_
+#define _Raises_SEH_exception_
+#define _Readable_bytes_(size)
+#define _Readable_elements_(size)
+#define _Reserved_
+#define _Result_nullonfailure_
+#define _Result_zeroonfailure_
+#define _Ret_
+#define _Ret_bound_
+#define _Ret_bytecap_(size)
+#define _Ret_bytecap_c_(size)
+#define _Ret_bytecap_x_(size)
+#define _Ret_bytecount_(size)
+#define _Ret_bytecount_c_(size)
+#define _Ret_bytecount_x_(size)
+#define _Ret_cap_(size)
+#define _Ret_cap_c_(size)
+#define _Ret_cap_x_(size)
+#define _Ret_count_(size)
+#define _Ret_count_c_(size)
+#define _Ret_count_x_(size)
+#define _Ret_maybenull_
+#define _Ret_maybenull_z_
+#define _Ret_notnull_
+#define _Ret_null_
+#define _Ret_opt_
+#define _Ret_opt_bytecap_(size)
+#define _Ret_opt_bytecap_c_(size)
+#define _Ret_opt_bytecap_x_(size)
+#define _Ret_opt_bytecount_(size)
+#define _Ret_opt_bytecount_c_(size)
+#define _Ret_opt_bytecount_x_(size)
+#define _Ret_opt_cap_(size)
+#define _Ret_opt_cap_c_(size)
+#define _Ret_opt_cap_x_(size)
+#define _Ret_opt_count_(size)
+#define _Ret_opt_count_c_(size)
+#define _Ret_opt_count_x_(size)
+#define _Ret_opt_valid_
+#define _Ret_opt_z_
+#define _Ret_opt_z_bytecap_(size)
+#define _Ret_opt_z_bytecount_(size)
+#define _Ret_opt_z_cap_(size)
+#define _Ret_opt_z_count_(size)
+#define _Ret_range_(lb,ub)
+#define _Ret_valid_
+#define _Ret_writes_(size)
+#define _Ret_writes_bytes_(size)
+#define _Ret_writes_bytes_maybenull_(size)
+#define _Ret_writes_bytes_to_(size,count)
+#define _Ret_writes_bytes_to_maybenull_(size,count)
+#define _Ret_writes_maybenull_(size)
+#define _Ret_writes_maybenull_z_(size)
+#define _Ret_writes_to_(size,count)
+#define _Ret_writes_to_maybenull_(size,count)
+#define _Ret_writes_z_(size)
+#define _Ret_z_
+#define _Ret_z_bytecap_(size)
+#define _Ret_z_bytecount_(size)
+#define _Ret_z_cap_(size)
+#define _Ret_z_count_(size)
+#define _Return_type_success_(expr)
+#define _Scanf_format_string_
+#define _Scanf_s_format_string_
+#define _Struct_size_bytes_(size)
+#define _Success_(expr)
+#define _Unchanged_(e)
+#define _Use_decl_annotations_
+#define _Valid_
+#define _When_(expr, annos)
+#define _Writable_bytes_(size)
+#define _Writable_elements_(size)
+#define __inner_callback
+#define __inner_exceptthat
+#define __inner_typefix(ctype)
+
#ifndef __fallthrough
# define __fallthrough __inner_fallthrough
#endif
diff --git a/3rdparty/bx/include/tinystl/buffer.h b/3rdparty/bx/include/tinystl/buffer.h
index 31654c64119..5fac2291486 100644
--- a/3rdparty/bx/include/tinystl/buffer.h
+++ b/3rdparty/bx/include/tinystl/buffer.h
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012 Matthew Endsley
+ * Copyright 2012-1015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,18 @@ namespace tinystl {
}
template<typename T>
+ static inline void buffer_fill_urange_traits(T* first, T* last, pod_traits<T, false>) {
+ for (; first < last; ++first)
+ new(placeholder(), first) T();
+ }
+
+ template<typename T>
+ static inline void buffer_fill_urange_traits(T* first, T* last, pod_traits<T, true>) {
+ for (; first < last; ++first)
+ *first = T();
+ }
+
+ template<typename T>
static inline void buffer_fill_urange_traits(T* first, T* last, const T& value, pod_traits<T, false>) {
for (; first < last; ++first)
new(placeholder(), first) T(value);
@@ -106,6 +118,11 @@ namespace tinystl {
}
template<typename T>
+ static inline void buffer_fill_urange(T* first, T* last) {
+ buffer_fill_urange_traits(first, last, pod_traits<T>());
+ }
+
+ template<typename T>
static inline void buffer_fill_urange(T* first, T* last, const T& value) {
buffer_fill_urange_traits(first, last, value, pod_traits<T>());
}
@@ -138,6 +155,15 @@ namespace tinystl {
}
template<typename T, typename Alloc>
+ static inline void buffer_resize(buffer<T, Alloc>* b, size_t size) {
+ buffer_reserve(b, size);
+
+ buffer_fill_urange(b->last, b->first + size);
+ buffer_destroy_range(b->first + size, b->last);
+ b->last = b->first + size;
+ }
+
+ template<typename T, typename Alloc>
static inline void buffer_resize(buffer<T, Alloc>* b, size_t size, const T& value) {
buffer_reserve(b, size);
@@ -169,22 +195,34 @@ namespace tinystl {
}
template<typename T, typename Alloc>
- static inline void buffer_insert(buffer<T, Alloc>* b, T* where, const T* first, const T* last) {
+ static inline T* buffer_insert_common(buffer<T, Alloc>* b, T* where, size_t count) {
const size_t offset = (size_t)(where - b->first);
- const size_t newsize = (size_t)((b->last - b->first) + (last - first));
+ const size_t newsize = (size_t)((b->last - b->first) + count);
if (b->first + newsize > b->capacity)
buffer_reserve(b, (newsize * 3) / 2);
where = b->first + offset;
- const size_t count = (size_t)(last - first);
if (where != b->last)
buffer_bmove_urange(where + count, where, b->last);
+ b->last = b->first + newsize;
+
+ return where;
+ }
+
+ template<typename T, typename Alloc, typename Param>
+ static inline void buffer_insert(buffer<T, Alloc>* b, T* where, const Param* first, const Param* last) {
+ where = buffer_insert_common(b, where, last - first);
for (; first != last; ++first, ++where)
new(placeholder(), where) T(*first);
+ }
- b->last = b->first + newsize;
+ template<typename T, typename Alloc>
+ static inline void buffer_insert(buffer<T, Alloc>* b, T* where, size_t count) {
+ where = buffer_insert_common(b, where, count);
+ for (size_t i = 0; i < count; ++i)
+ new(placeholder(), where) T();
}
template<typename T, typename Alloc>
diff --git a/3rdparty/bx/include/tinystl/vector.h b/3rdparty/bx/include/tinystl/vector.h
index 3a8e28a4551..96fe1b4ef62 100644
--- a/3rdparty/bx/include/tinystl/vector.h
+++ b/3rdparty/bx/include/tinystl/vector.h
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012 Matthew Endsley
+ * Copyright 2012-1015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,8 @@ namespace tinystl {
T& operator[](size_t idx);
const T& operator[](size_t idx) const;
+ const T& front() const;
+ T& front();
const T& back() const;
T& back();
@@ -67,6 +69,10 @@ namespace tinystl {
void push_back(const T& t);
void pop_back();
+ void emplace_back();
+ template<typename Param>
+ void emplace_back(const Param& param);
+
void shrink_to_fit();
void swap(vector& other);
@@ -81,9 +87,13 @@ namespace tinystl {
const_iterator begin() const;
const_iterator end() const;
+ void insert(iterator where);
void insert(iterator where, const T& value);
void insert(iterator where, const T* first, const T* last);
+ template<typename Param>
+ void emplace(iterator where, const Param& param);
+
iterator erase(iterator where);
iterator erase(iterator first, iterator last);
@@ -109,7 +119,7 @@ namespace tinystl {
template<typename T, typename Alloc>
inline vector<T, Alloc>::vector(size_t _size) {
buffer_init(&m_buffer);
- buffer_resize(&m_buffer, _size, T());
+ buffer_resize(&m_buffer, _size);
}
template<typename T, typename Alloc>
@@ -177,6 +187,16 @@ namespace tinystl {
}
template<typename T, typename Alloc>
+ inline const T& vector<T, Alloc>::front() const {
+ return m_buffer.first[0];
+ }
+
+ template<typename T, typename Alloc>
+ inline T& vector<T, Alloc>::front() {
+ return m_buffer.first[0];
+ }
+
+ template<typename T, typename Alloc>
inline const T& vector<T, Alloc>::back() const {
return m_buffer.last[-1];
}
@@ -188,7 +208,7 @@ namespace tinystl {
template<typename T, typename Alloc>
inline void vector<T, Alloc>::resize(size_t _size) {
- buffer_resize(&m_buffer, _size, T());
+ buffer_resize(&m_buffer, _size);
}
template<typename T, typename Alloc>
@@ -212,6 +232,19 @@ namespace tinystl {
}
template<typename T, typename Alloc>
+ inline void vector<T, Alloc>::emplace_back()
+ {
+ buffer_insert(&m_buffer, m_buffer.last, 1);
+ }
+
+ template<typename T, typename Alloc>
+ template<typename Param>
+ inline void vector<T, Alloc>::emplace_back(const Param& param)
+ {
+ buffer_insert(&m_buffer, m_buffer.last, &param, &param + 1);
+ }
+
+ template<typename T, typename Alloc>
inline void vector<T, Alloc>::pop_back() {
buffer_erase(&m_buffer, m_buffer.last - 1, m_buffer.last);
}
@@ -247,6 +280,11 @@ namespace tinystl {
}
template<typename T, typename Alloc>
+ inline void vector<T, Alloc>::insert(iterator where) {
+ buffer_insert(&m_buffer, where, 1);
+ }
+
+ template<typename T, typename Alloc>
inline void vector<T, Alloc>::insert(iterator where, const T& value) {
buffer_insert(&m_buffer, where, &value, &value + 1);
}
@@ -275,6 +313,12 @@ namespace tinystl {
inline typename vector<T, Alloc>::iterator vector<T, Alloc>::erase_unordered(iterator first, iterator last) {
return buffer_erase_unordered(&m_buffer, first, last);
}
+
+ template<typename T, typename Alloc>
+ template<typename Param>
+ void vector<T, Alloc>::emplace(iterator where, const Param& param) {
+ buffer_insert(&m_buffer, where, &param, &param + 1);
+ }
}
#endif
diff --git a/3rdparty/bx/scripts/genie.lua b/3rdparty/bx/scripts/genie.lua
index 3f9ea26cb20..152cd4b21ef 100644
--- a/3rdparty/bx/scripts/genie.lua
+++ b/3rdparty/bx/scripts/genie.lua
@@ -36,7 +36,6 @@ dofile "unittest++.lua"
dofile "bin2c.lua"
project "bx.test"
- uuid "8a653da8-23d6-11e3-acb4-887628d43830"
kind "ConsoleApp"
debugdir (path.join(BX_DIR, "tests"))
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index 0422db1105b..3f62914a71f 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -13,24 +13,29 @@ function toolchain(_buildDir, _libDir)
value = "GCC",
description = "Choose GCC flavor",
allowed = {
- { "android-arm", "Android - ARM" },
- { "android-mips", "Android - MIPS" },
- { "android-x86", "Android - x86" },
- { "asmjs", "Emscripten/asm.js" },
- { "freebsd", "FreeBSD" },
- { "linux-gcc", "Linux (GCC compiler)" },
- { "linux-gcc-5", "Linux (GCC-5 compiler)" },
- { "linux-clang", "Linux (Clang compiler)" },
- { "ios-arm", "iOS - ARM" },
- { "ios-simulator", "iOS - Simulator" },
- { "mingw-gcc", "MinGW" },
- { "mingw-clang", "MinGW (clang compiler)" },
- { "nacl", "Native Client" },
- { "nacl-arm", "Native Client - ARM" },
- { "osx", "OSX" },
- { "pnacl", "Native Client - PNaCl" },
- { "qnx-arm", "QNX/Blackberry - ARM" },
- { "rpi", "RaspberryPi" },
+ { "android-arm", "Android - ARM" },
+ { "android-mips", "Android - MIPS" },
+ { "android-x86", "Android - x86" },
+ { "asmjs", "Emscripten/asm.js" },
+ { "freebsd", "FreeBSD" },
+ { "linux-gcc", "Linux (GCC compiler)" },
+ { "linux-gcc-5", "Linux (GCC-5 compiler)" },
+ { "linux-clang", "Linux (Clang compiler)" },
+ { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
+ { "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
+ { "ios-arm", "iOS - ARM" },
+ { "ios-simulator", "iOS - Simulator" },
+ { "tvos-arm64", "tvOS - ARM64" },
+ { "tvos-simulator", "tvOS - Simulator" },
+ { "mingw-gcc", "MinGW" },
+ { "mingw-clang", "MinGW (clang compiler)" },
+ { "nacl", "Native Client" },
+ { "nacl-arm", "Native Client - ARM" },
+ { "osx", "OSX" },
+ { "pnacl", "Native Client - PNaCl" },
+ { "ps4", "PS4" },
+ { "qnx-arm", "QNX/Blackberry - ARM" },
+ { "rpi", "RaspberryPi" },
},
}
@@ -39,15 +44,15 @@ function toolchain(_buildDir, _libDir)
value = "toolset",
description = "Choose VS toolset",
allowed = {
- { "vs2012-clang", "Clang 3.6" },
- { "vs2013-clang", "Clang 3.6" },
+ { "vs2012-clang", "Clang 3.6" },
+ { "vs2013-clang", "Clang 3.6" },
{ "vs2012-xp", "Visual Studio 2012 targeting XP" },
{ "vs2013-xp", "Visual Studio 2013 targeting XP" },
{ "vs2015-xp", "Visual Studio 2015 targeting XP" },
- { "winphone8", "Windows Phone 8.0" },
- { "winphone81", "Windows Phone 8.1" },
- { "winstore81", "Windows Store 8.1" },
- { "winstore82", "Universal Windows App" }
+ { "winphone8", "Windows Phone 8.0" },
+ { "winphone81", "Windows Phone 8.1" },
+ { "winstore81", "Windows Store 8.1" },
+ { "winstore82", "Universal Windows App" },
},
}
@@ -59,6 +64,7 @@ function toolchain(_buildDir, _libDir)
allowed = {
{ "osx", "OSX" },
{ "ios", "iOS" },
+ { "tvos", "tvOS" },
}
}
@@ -74,6 +80,12 @@ function toolchain(_buildDir, _libDir)
description = "Set iOS target version (default: 8.0).",
}
+ newoption {
+ trigger = "with-tvos",
+ value = "#",
+ description = "Set tvOS target version (default: 9.0).",
+ }
+
-- Avoid error when invoking genie --help.
if (_ACTION == nil) then return false end
@@ -93,6 +105,11 @@ function toolchain(_buildDir, _libDir)
iosPlatform = _OPTIONS["with-ios"]
end
+ local tvosPlatform = ""
+ if _OPTIONS["with-tvos"] then
+ tvosPlatform = _OPTIONS["with-tvos"]
+ end
+
if _ACTION == "gmake" then
if nil == _OPTIONS["gcc"] then
@@ -153,17 +170,29 @@ function toolchain(_buildDir, _libDir)
location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
elseif "ios-arm" == _OPTIONS["gcc"] then
- premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
- premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
elseif "ios-simulator" == _OPTIONS["gcc"] then
- premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
- premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
+ elseif "tvos-arm64" == _OPTIONS["gcc"] then
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
+ premake.gcc.ar = "ar"
+ location (path.join(_buildDir, "projects", _ACTION .. "-tvos-arm64"))
+
+ elseif "tvos-simulator" == _OPTIONS["gcc"] then
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
+ premake.gcc.ar = "ar"
+ location (path.join(_buildDir, "projects", _ACTION .. "-tvos-simulator"))
+
elseif "linux-gcc" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
@@ -179,6 +208,12 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
+ elseif "linux-mips-gcc" == _OPTIONS["gcc"] then
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc"))
+
+ elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
+
elseif "mingw-gcc" == _OPTIONS["gcc"] then
premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
@@ -257,6 +292,19 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = naclToolchain .. "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-pnacl"))
+ elseif "ps4" == _OPTIONS["gcc"] then
+
+ if not os.getenv("PS4_SDK_ROOT") then
+ print("Set PS4_SDK_ROOT enviroment variables.")
+ end
+
+ ps4Toolchain = "$(PS4_SDK_ROOT)/host_tools/bin/orbis-"
+
+ premake.gcc.cc = ps4Toolchain .. "clang"
+ premake.gcc.cxx = ps4Toolchain .. "clang++"
+ premake.gcc.ar = ps4Toolchain .. "ar"
+ location (path.join(_buildDir, "projects", _ACTION .. "-ps4"))
+
elseif "qnx-arm" == _OPTIONS["gcc"] then
if not os.getenv("QNX_HOST") then
@@ -321,6 +369,10 @@ function toolchain(_buildDir, _libDir)
elseif "ios" == _OPTIONS["xcode"] then
premake.xcode.toolset = "iphoneos"
location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
+
+ elseif "tvos" == _OPTIONS["xcode"] then
+ premake.xcode.toolset = "appletvos"
+ location (path.join(_buildDir, "projects", _ACTION .. "-tvos"))
end
end
@@ -383,7 +435,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
libdirs {
path.join(_libDir, "lib/win32_" .. _ACTION),
- "$(DXSDK_DIR)/lib/x86",
}
configuration { "x64", "vs*" }
@@ -392,7 +443,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
libdirs {
path.join(_libDir, "lib/win64_" .. _ACTION),
- "$(DXSDK_DIR)/lib/x64",
}
configuration { "ARM", "vs*" }
@@ -448,7 +498,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
libdirs {
path.join(_libDir, "lib/win32_mingw-gcc"),
- "$(DXSDK_DIR)/lib/x86",
}
buildoptions { "-m32" }
@@ -457,8 +506,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
libdirs {
path.join(_libDir, "lib/win64_mingw-gcc"),
- "$(DXSDK_DIR)/lib/x64",
- "$(GLES_X64_DIR)",
}
buildoptions { "-m64" }
@@ -478,7 +525,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
libdirs {
path.join(_libDir, "lib/win32_mingw-clang"),
- "$(DXSDK_DIR)/lib/x86",
}
buildoptions { "-m32" }
@@ -487,8 +533,6 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
libdirs {
path.join(_libDir, "lib/win64_mingw-clang"),
- "$(DXSDK_DIR)/lib/x64",
- "$(GLES_X64_DIR)",
}
buildoptions { "-m64" }
@@ -507,12 +551,12 @@ function toolchain(_buildDir, _libDir)
-- "ubsan",
}
- configuration { "linux-g*" }
+ configuration { "linux-gcc" }
buildoptions {
- "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
+ "-mfpmath=sse",
}
- configuration { "linux-*" }
+ configuration { "linux-gcc or linux-clang" }
buildoptions {
"-msse2",
"-Wunused-value",
@@ -529,7 +573,7 @@ function toolchain(_buildDir, _libDir)
"-Wl,--gc-sections",
}
- configuration { "linux-g*", "x32" }
+ configuration { "linux-gcc*", "x32" }
targetdir (path.join(_buildDir, "linux32_gcc/bin"))
objdir (path.join(_buildDir, "linux32_gcc/obj"))
libdirs { path.join(_libDir, "lib/linux32_gcc") }
@@ -537,7 +581,7 @@ function toolchain(_buildDir, _libDir)
"-m32",
}
- configuration { "linux-g*", "x64" }
+ configuration { "linux-gcc*", "x64" }
targetdir (path.join(_buildDir, "linux64_gcc/bin"))
objdir (path.join(_buildDir, "linux64_gcc/obj"))
libdirs { path.join(_libDir, "lib/linux64_gcc") }
@@ -561,6 +605,44 @@ function toolchain(_buildDir, _libDir)
"-m64",
}
+ configuration { "linux-mips-gcc" }
+ targetdir (path.join(_buildDir, "linux32_mips_gcc/bin"))
+ objdir (path.join(_buildDir, "linux32_mips_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux32_mips_gcc") }
+ buildoptions {
+ "-Wunused-value",
+ "-Wundef",
+ }
+ buildoptions_cpp {
+ "-std=c++0x",
+ }
+ links {
+ "rt",
+ "dl",
+ }
+ linkoptions {
+ "-Wl,--gc-sections",
+ }
+
+ configuration { "linux-arm-gcc" }
+ targetdir (path.join(_buildDir, "linux32_arm_gcc/bin"))
+ objdir (path.join(_buildDir, "linux32_arm_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux32_arm_gcc") }
+ buildoptions {
+ "-Wunused-value",
+ "-Wundef",
+ }
+ buildoptions_cpp {
+ "-std=c++0x",
+ }
+ links {
+ "rt",
+ "dl",
+ }
+ linkoptions {
+ "-Wl,--gc-sections",
+ }
+
configuration { "android-*" }
flags {
"NoImportLib",
@@ -799,6 +881,10 @@ function toolchain(_buildDir, _libDir)
"-m64",
}
+ configuration { "osx", "Universal" }
+ targetdir (path.join(_buildDir, "osx_universal/bin"))
+ objdir (path.join(_buildDir, "osx_universal/bin"))
+
configuration { "osx" }
buildoptions {
"-Wfatal-errors",
@@ -819,6 +905,10 @@ function toolchain(_buildDir, _libDir)
}
includedirs { path.join(bxDir, "include/compat/ios") }
+ configuration { "xcode4", "ios*" }
+ targetdir (path.join(_buildDir, "ios-arm/bin"))
+ objdir (path.join(_buildDir, "ios-arm/obj"))
+
configuration { "ios-arm" }
targetdir (path.join(_buildDir, "ios-arm/bin"))
objdir (path.join(_buildDir, "ios-arm/obj"))
@@ -855,6 +945,74 @@ function toolchain(_buildDir, _libDir)
"--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" ..iosPlatform .. ".sdk",
}
+ configuration { "tvos*" }
+ linkoptions {
+ "-lc++",
+ }
+ buildoptions {
+ "-Wfatal-errors",
+ "-Wunused-value",
+ "-Wundef",
+ }
+ includedirs { path.join(bxDir, "include/compat/ios") }
+
+ configuration { "xcode4", "tvos*" }
+ targetdir (path.join(_buildDir, "tvos-arm64/bin"))
+ objdir (path.join(_buildDir, "tvos-arm64/obj"))
+
+ configuration { "tvos-arm64" }
+ targetdir (path.join(_buildDir, "tvos-arm64/bin"))
+ objdir (path.join(_buildDir, "tvos-arm64/obj"))
+ libdirs { path.join(_libDir, "lib/tvos-arm64") }
+ linkoptions {
+ "-mtvos-version-min=9.0",
+ "-arch arm64",
+ "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
+ "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/usr/lib/system",
+ "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
+ "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
+ }
+ buildoptions {
+ "-mtvos-version-min=9.0",
+ "-arch arm64",
+ "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS" ..tvosPlatform .. ".sdk",
+ }
+
+ configuration { "tvos-simulator" }
+ targetdir (path.join(_buildDir, "tvos-simulator/bin"))
+ objdir (path.join(_buildDir, "tvos-simulator/obj"))
+ libdirs { path.join(_libDir, "lib/tvos-simulator") }
+ linkoptions {
+ "-mtvos-simulator-version-min=9.0",
+ "-arch i386",
+ "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
+ "-L/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/usr/lib/system",
+ "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/Frameworks",
+ "-F/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk/System/Library/PrivateFrameworks",
+ }
+ buildoptions {
+ "-mtvos-simulator-version-min=9.0",
+ "-arch i386",
+ "--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator" ..tvosPlatform .. ".sdk",
+ }
+
+ configuration { "ps4" }
+ targetdir (path.join(_buildDir, "ps4/bin"))
+ objdir (path.join(_buildDir, "ps4/obj"))
+ libdirs { path.join(_libDir, "lib/ps4") }
+ includedirs {
+ path.join(bxDir, "include/compat/freebsd"),
+ "$(PS4_SDK_ROOT)/target/include",
+ "$(PS4_SDK_ROOT)/target/include_common",
+ }
+ buildoptions {
+ }
+ buildoptions_cpp {
+ "-std=c++0x",
+ }
+ linkoptions {
+ }
+
configuration { "qnx-arm" }
targetdir (path.join(_buildDir, "qnx-arm/bin"))
objdir (path.join(_buildDir, "qnx-arm/obj"))
@@ -951,8 +1109,14 @@ function strip()
configuration { "asmjs" }
postbuildcommands {
"$(SILENT) echo Running asmjs finalize.",
- "$(SILENT) $(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html"
- -- ALLOW_MEMORY_GROWTH
+ "$(SILENT) $(EMSCRIPTEN)/emcc -O2 "
+-- .. "-s EMTERPRETIFY=1 "
+-- .. "-s EMTERPRETIFY_ASYNC=1 "
+ .. "-s TOTAL_MEMORY=268435456 "
+-- .. "-s ALLOW_MEMORY_GROWTH=1 "
+ .. "--memory-init-file 1 "
+ .. "\"$(TARGET)\" -o \"$(TARGET)\".html "
+-- .. "--preload-file ../../../examples/runtime@/"
}
configuration {} -- reset configuration
diff --git a/3rdparty/bx/scripts/unittest++.lua b/3rdparty/bx/scripts/unittest++.lua
index 25c8e5245ff..02fef2c695f 100644
--- a/3rdparty/bx/scripts/unittest++.lua
+++ b/3rdparty/bx/scripts/unittest++.lua
@@ -4,7 +4,6 @@
--
project "UnitTest++"
- uuid "ab932f5c-2409-11e3-b000-887628d43830"
kind "StaticLib"
removeflags {
@@ -16,7 +15,7 @@ project "UnitTest++"
"../3rdparty/UnitTest++/src/*.h",
}
- configuration { "linux or osx or android-* or *nacl*" }
+ configuration { "linux or osx or android-* or *nacl* or ps4" }
files {
"../3rdparty/UnitTest++/src/Posix/**.cpp",
"../3rdparty/UnitTest++/src/Posix/**.h",
diff --git a/3rdparty/bx/tests/handle.cpp b/3rdparty/bx/tests/handle.cpp
new file mode 100644
index 00000000000..455e7e47f01
--- /dev/null
+++ b/3rdparty/bx/tests/handle.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2010-2015 Branimir Karadzic. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include "test.h"
+#include <bx/handlealloc.h>
+
+TEST(HandleListT)
+{
+ bx::HandleListT<32> list;
+
+ list.pushBack(16);
+ CHECK(list.getFront() == 16);
+ CHECK(list.getBack() == 16);
+
+ list.pushFront(7);
+ CHECK(list.getFront() == 7);
+ CHECK(list.getBack() == 16);
+
+ uint16_t expected0[] = { 15, 31, 7, 16, 17, 11, 13 };
+ list.pushBack(17);
+ list.pushBack(11);
+ list.pushBack(13);
+ list.pushFront(31);
+ list.pushFront(15);
+ uint16_t count = 0;
+ for (uint16_t it = list.getFront(); it != UINT16_MAX; it = list.getNext(it), ++count)
+ {
+ CHECK(it == expected0[count]);
+ }
+ CHECK(count == BX_COUNTOF(expected0) );
+
+ list.remove(17);
+ list.remove(31);
+ list.remove(16);
+ list.pushBack(16);
+ uint16_t expected1[] = { 15, 7, 11, 13, 16 };
+ count = 0;
+ for (uint16_t it = list.getFront(); it != UINT16_MAX; it = list.getNext(it), ++count)
+ {
+ CHECK(it == expected1[count]);
+ }
+ CHECK(count == BX_COUNTOF(expected1) );
+
+ list.popBack();
+ list.popFront();
+ list.popBack();
+ list.popBack();
+
+ CHECK(list.getFront() == 7);
+ CHECK(list.getBack() == 7);
+
+ list.popBack();
+ CHECK(list.getFront() == UINT16_MAX);
+ CHECK(list.getBack() == UINT16_MAX);
+}
+
+TEST(HandleAllocLruT)
+{
+ bx::HandleAllocLruT<16> lru;
+
+ uint16_t handle[4] =
+ {
+ lru.alloc(),
+ lru.alloc(),
+ lru.alloc(),
+ lru.alloc(),
+ };
+
+ lru.touch(handle[1]);
+
+ uint16_t expected0[] = { handle[1], handle[3], handle[2], handle[0] };
+ uint16_t count = 0;
+ for (uint16_t it = lru.getFront(); it != UINT16_MAX; it = lru.getNext(it), ++count)
+ {
+ CHECK(it == expected0[count]);
+ }
+}
diff --git a/3rdparty/bx/tests/misc.cpp b/3rdparty/bx/tests/misc.cpp
new file mode 100644
index 00000000000..aec1067a022
--- /dev/null
+++ b/3rdparty/bx/tests/misc.cpp
@@ -0,0 +1,8 @@
+#include "test.h"
+#include <bx/os.h>
+
+TEST(getProcessMemoryUsed)
+{
+ CHECK(0 != bx::getProcessMemoryUsed() );
+// DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
+}
diff --git a/3rdparty/bx/tests/uint32_t.cpp b/3rdparty/bx/tests/uint32_t.cpp
index b232ff63ac1..553c8e23942 100644
--- a/3rdparty/bx/tests/uint32_t.cpp
+++ b/3rdparty/bx/tests/uint32_t.cpp
@@ -20,3 +20,33 @@ TEST(StrideAlign)
CHECK(48 == bx::strideAlign16(ii+1, 12) );
}
}
+
+TEST(uint32_cnt)
+{
+ CHECK( 0 == bx::uint32_cnttz(UINT32_C(1) ) );
+ CHECK( 0 == bx::uint32_cnttz_ref(UINT32_C(1) ) );
+
+ CHECK(31 == bx::uint32_cntlz(UINT32_C(1) ) );
+ CHECK(31 == bx::uint32_cntlz_ref(UINT32_C(1) ) );
+
+ CHECK( 0 == bx::uint64_cnttz(UINT64_C(1) ) );
+ CHECK( 0 == bx::uint64_cnttz_ref(UINT64_C(1) ) );
+
+ CHECK(63 == bx::uint64_cntlz(UINT64_C(1) ) );
+ CHECK(63 == bx::uint64_cntlz_ref(UINT64_C(1) ) );
+
+ CHECK( 1 == bx::uint32_cntbits(1) );
+ CHECK( 1 == bx::uint32_cntbits_ref(1) );
+
+ CHECK(16 == bx::uint32_cntbits(UINT16_MAX) );
+ CHECK(16 == bx::uint32_cntbits_ref(UINT16_MAX) );
+
+ CHECK(32 == bx::uint32_cntbits(UINT32_MAX) );
+ CHECK(32 == bx::uint32_cntbits_ref(UINT32_MAX) );
+}
+
+TEST(uint32_part)
+{
+ CHECK(UINT32_C(0x55555555) == bx::uint32_part1by1(UINT16_MAX) );
+ CHECK(UINT32_C(0x09249249) == bx::uint32_part1by2(0x3ff) );
+}
diff --git a/3rdparty/bx/tests/unordered_map_nonpod.cpp b/3rdparty/bx/tests/unordered_map_nonpod.cpp
index f9607e35e3f..96aa55e416c 100644
--- a/3rdparty/bx/tests/unordered_map_nonpod.cpp
+++ b/3rdparty/bx/tests/unordered_map_nonpod.cpp
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012-2014 Matthew Endsley
+ * Copyright 2012-2015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,9 @@
#include <tinystl/allocator.h>
#include <tinystl/unordered_map.h>
-struct Foo { int bar; };
+namespace {
+ struct Foo { int bar; };
+}
TEST(uomap_nonpod_compiles) {
diff --git a/3rdparty/bx/tests/vector_complex.cpp b/3rdparty/bx/tests/vector_complex.cpp
index 97716fbc070..8deaa3fd3ff 100644
--- a/3rdparty/bx/tests/vector_complex.cpp
+++ b/3rdparty/bx/tests/vector_complex.cpp
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012 Matthew Endsley
+ * Copyright 2012-1015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -35,9 +35,9 @@
struct complex {
complex() {data = 0;}
- complex(const char* s) { data = _strdup(s); }
+ complex(const char* s) { data = strdup(s); }
~complex() { free(data); }
- complex(const complex& other) { data = 0; if (other.data) data = _strdup(other.data); }
+ complex(const complex& other) { data = 0; if (other.data) data = strdup(other.data); }
complex& operator=(const complex& other) { complex(other).swap(*this); return *this; }
void swap(complex& other) { std::swap(data, other.data); }
diff --git a/3rdparty/bx/tests/vector_header.cpp b/3rdparty/bx/tests/vector_header.cpp
index 82eba45ad6e..4822104dbc9 100644
--- a/3rdparty/bx/tests/vector_header.cpp
+++ b/3rdparty/bx/tests/vector_header.cpp
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012 Matthew Endsley
+ * Copyright 2012-1015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
diff --git a/3rdparty/bx/tests/vector_nocopy.cpp b/3rdparty/bx/tests/vector_nocopy.cpp
new file mode 100644
index 00000000000..960762f8c16
--- /dev/null
+++ b/3rdparty/bx/tests/vector_nocopy.cpp
@@ -0,0 +1,229 @@
+/*-
+ * Copyright 2012-1015 Matthew Endsley
+ * All rights reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted providing that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "test.h"
+
+#include <tinystl/allocator.h>
+#include <tinystl/vector.h>
+
+#include <algorithm>
+#include <string.h>
+#include <stdlib.h>
+
+struct nocopy {
+ nocopy() { data = 0; }
+ explicit nocopy(const char* s) { data = s; }
+ ~nocopy() { }
+ void swap(nocopy& other) { std::swap(data, other.data); }
+ void reset(const char* s) { data = s; }
+ const char* release() { const char* ret = data; data = 0; return ret; }
+
+ const char* data;
+
+private:
+ nocopy(const nocopy& other);
+ nocopy& operator=(const nocopy& other);
+};
+
+static inline bool operator==(const nocopy& lhs, const char* rhs) {
+ if (lhs.data == 0 && rhs == 0)
+ return true;
+ if (lhs.data != 0 && rhs != 0)
+ return 0 == strcmp(lhs.data, rhs);
+ return false;
+}
+
+static inline bool operator==(const nocopy& lhs, const nocopy& rhs) {
+ if (lhs.data == 0 && rhs.data == 0)
+ return true;
+ if (lhs.data != 0 && rhs.data != 0)
+ return 0 == strcmp(lhs.data, rhs.data);
+ return false;
+}
+
+TEST(vector_nocopy_constructor) {
+ typedef tinystl::vector<nocopy> vector;
+
+ {
+ vector v;
+ CHECK( v.empty() );
+ CHECK( v.size() == 0 );
+ }
+ {
+ vector v(10);
+ CHECK( v.size() == 10 );
+ for (tinystl::vector<nocopy>::iterator it = v.begin(); it != v.end(); ++it) {
+ CHECK( it->data == 0 );
+ }
+ }
+}
+
+TEST(vector_nocopy_pushback) {
+ tinystl::vector<nocopy> v;
+ v.emplace_back("42");
+ v.emplace_back();
+ v.back().reset("24");
+
+ CHECK( v.size() == 2 );
+ CHECK( v[0] == "42" );
+ CHECK( v[1] == "24" );
+}
+
+TEST(vector_nocopy_vector) {
+ tinystl::vector< tinystl::vector<nocopy> > v(10);
+
+ tinystl::vector< tinystl::vector<nocopy> >::iterator it = v.begin(), end = v.end();
+ for (; it != end; ++it) {
+ CHECK( (*it).empty() );
+ CHECK( (*it).size() == 0 );
+ CHECK( (*it).begin() == (*it).end() );
+ }
+}
+
+TEST(vector_nocopy_swap) {
+ tinystl::vector<nocopy> v1;
+ v1.emplace_back("12");
+ v1.emplace_back("20");
+
+ tinystl::vector<nocopy> v2;
+ v2.emplace_back("54");
+
+ v1.swap(v2);
+
+ CHECK(v1.size() == 1);
+ CHECK(v2.size() == 2);
+ CHECK(v1[0] == "54");
+ CHECK(v2[0] == "12");
+ CHECK(v2[1] == "20");
+}
+
+TEST(vector_nocopy_popback) {
+ tinystl::vector<nocopy> v;
+ v.emplace_back("12");
+ v.emplace_back("24");
+
+ CHECK(v.back() == "24");
+
+ v.pop_back();
+
+ CHECK(v.back() == "12");
+ CHECK(v.size() == 1);
+}
+
+TEST(vector_nocopy_erase) {
+ tinystl::vector<nocopy> v;
+ v.emplace_back("1");
+ v.emplace_back("2");
+ v.emplace_back("3");
+ v.emplace_back("4");
+ v.emplace_back("5");
+
+ tinystl::vector<nocopy>::iterator it = v.erase(v.begin());
+ CHECK(*it == "2");
+ CHECK(v.size() == 4);
+
+ it = v.erase(v.end() - 1);
+ CHECK(it == v.end());
+ CHECK(v.size() == 3);
+
+ v.erase(v.begin() + 1, v.end() - 1);
+ CHECK(v.size() == 2);
+ CHECK(v[0] == "2");
+ CHECK(v[1] == "4");
+}
+
+TEST(vector_nocopy_erase_unordered) {
+ typedef tinystl::vector<nocopy> vector;
+ vector v;
+ v.emplace_back("1");
+ v.emplace_back("2");
+ v.emplace_back("3");
+ v.emplace_back("4");
+ v.emplace_back("5");
+
+ const char* first = v.front().release();
+ vector::iterator it = v.erase_unordered(v.begin());
+ CHECK( it == v.begin() );
+ CHECK( v.size() == 4 );
+ CHECK( std::count(v.begin(), v.end(), first) == 0 );
+ for (it = v.begin(); it != v.end(); ++it) {
+ CHECK( std::count(v.begin(), v.end(), *it) == 1 );
+ }
+
+ const char* last = v.back().release();
+ it = v.erase_unordered(v.end() - 1);
+ CHECK( it == v.end() );
+ CHECK( v.size() == 3 );
+ CHECK( std::count(v.begin(), v.end(), last) == 0 );
+ for (it = v.begin(); it != v.end(); ++it) {
+ CHECK( std::count(v.begin(), v.end(), *it) == 1 );
+ }
+
+ first = v.begin()->data;
+ last = (v.end() - 1)->data;
+ v.erase_unordered(v.begin() + 1, v.end() - 1);
+ CHECK( v.size() == 2 );
+ CHECK( std::count(v.begin(), v.end(), first) == 1 );
+ CHECK( std::count(v.begin(), v.end(), last) == 1 );
+}
+
+TEST(vector_nocopy_insert) {
+ tinystl::vector<nocopy> v;
+ v.emplace_back("1");
+ v.emplace_back("2");
+ v.emplace_back("3");
+ v.emplace_back("4");
+ v.emplace_back("5");
+
+ v.emplace(v.begin(), "0");
+ CHECK( v.size() == 6 );
+ CHECK( v[0] == "0" );
+ CHECK( v[1] == "1" );
+ CHECK( v[5] == "5" );
+
+ v.emplace(v.end(), "6");
+ CHECK( v.size() == 7 );
+ CHECK( v.front() == "0" );
+ CHECK( v.back() == "6" );
+}
+
+TEST(vector_nocopy_iterator) {
+ tinystl::vector<nocopy> v(5);
+ v[0].reset("1");
+ v[1].reset("2");
+ v[2].reset("3");
+ v[3].reset("4");
+ v[4].reset("5");
+
+ const tinystl::vector<nocopy>& cv = v;
+
+ //CHECK(v.data() == &*v.begin());
+ //CHECK(v.data() == &v[0]);
+ //CHECK(v.data() + v.size() == &*v.end());
+ CHECK(v.begin() == cv.begin());
+ CHECK(v.end() == cv.end());
+ //CHECK(v.data() == cv.data());
+}
diff --git a/3rdparty/bx/tests/vector_nodefault.cpp b/3rdparty/bx/tests/vector_nodefault.cpp
index 319fd5546fb..4a8bc8cf1dd 100644
--- a/3rdparty/bx/tests/vector_nodefault.cpp
+++ b/3rdparty/bx/tests/vector_nodefault.cpp
@@ -1,5 +1,5 @@
/*-
- * Copyright 2012 Matthew Endsley
+ * Copyright 2012-1015 Matthew Endsley
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -33,14 +33,10 @@
#include <string.h>
#include <stdlib.h>
-#if !BX_COMPILER_MSVC
-# define _strdup strdup
-#endif // !BX_COMPILER_MSVC
-
struct nodefault {
- nodefault(const char* s) { data = _strdup(s); }
+ nodefault(const char* s) { data = strdup(s); }
~nodefault() { free(data); }
- nodefault(const nodefault& other) { data = 0; if (other.data) data = _strdup(other.data); }
+ nodefault(const nodefault& other) { data = 0; if (other.data) data = strdup(other.data); }
nodefault& operator=(const nodefault& other) { nodefault(other).swap(*this); return *this; }
void swap(nodefault& other) { std::swap(data, other.data); }
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index 37ee10c896c..d689fbcf76b 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index 703dda3c553..2e532ef9172 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index 7bb0013a709..5ca75020b6a 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ
diff --git a/3rdparty/dxsdk/Include/D2D1.h b/3rdparty/dxsdk/Include/D2D1.h
deleted file mode 100644
index e8768dfca5f..00000000000
--- a/3rdparty/dxsdk/Include/D2D1.h
+++ /dev/null
@@ -1,6996 +0,0 @@
-//---------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// This file is automatically generated. Please do not edit it directly.
-//
-// File name: D2D1.h
-//---------------------------------------------------------------------------
-#pragma once
-
-
-#ifndef _D2D1_H_
-#define _D2D1_H_
-
-#ifndef COM_NO_WINDOWS_H
-#include <windows.h>
-#endif // #ifndef COM_NO_WINDOWS_H
-#include <unknwn.h>
-#include <dcommon.h>
-#include <D2DErr.h>
-#include <D2DBaseTypes.h>
-#include <dxgiformat.h>
-#ifndef D2D_NO_INCLUDE_D3D10
-#include <d3d10_1.h>
-#endif // #ifndef D2D_NO_INCLUDE_D3D10
-
-#ifndef D2D_USE_C_DEFINITIONS
-
-//
-// We use the 'C' definitions if C++ is not defined
-//
-#ifndef __cplusplus
-#define D2D_USE_C_DEFINITIONS
-#endif
-
-#endif // #ifndef D2D_USE_C_DEFINITIONS
-
-#ifndef D2D1_DECLARE_INTERFACE
-#define D2D1_DECLARE_INTERFACE(X) DECLSPEC_UUID(X) DECLSPEC_NOVTABLE
-#endif
-
-//
-// Forward declarations here
-//
-
-typedef interface IDWriteTextFormat IDWriteTextFormat;
-typedef interface IDWriteTextLayout IDWriteTextLayout;
-typedef interface IDWriteRenderingParams IDWriteRenderingParams;
-typedef interface IDXGISurface IDXGISurface;
-typedef interface IWICBitmap IWICBitmap;
-typedef interface IWICBitmapSource IWICBitmapSource;
-
-typedef struct DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN;
-
-#ifndef D2D_USE_C_DEFINITIONS
-
-interface ID2D1Factory;
-interface ID2D1RenderTarget;
-interface ID2D1BitmapRenderTarget;
-interface ID2D1SimplifiedGeometrySink;
-interface ID2D1TessellationSink;
-interface ID2D1Geometry;
-interface ID2D1Brush;
-
-#else
-
-typedef interface ID2D1Factory ID2D1Factory;
-typedef interface ID2D1RenderTarget ID2D1RenderTarget;
-typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget;
-typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;;
-typedef interface ID2D1TessellationSink ID2D1TessellationSink;
-typedef interface ID2D1Geometry ID2D1Geometry;
-typedef interface ID2D1Brush ID2D1Brush;
-
-#endif
-
-#define D2D1_INVALID_TAG ULONGLONG_MAX
-#define D2D1_DEFAULT_FLATTENING_TOLERANCE (0.25f)
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_ALPHA_MODE
-//
-// Synopsis:
-// Qualifies how alpha is to be treated in a bitmap or render target containing
-// alpha.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_ALPHA_MODE
-{
-
- //
- // Alpha mode should be determined implicitly. Some target surfaces do not supply
- // or imply this information in which case alpha must be specified.
- //
- D2D1_ALPHA_MODE_UNKNOWN = 0,
-
- //
- // Treat the alpha as premultipled.
- //
- D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
-
- //
- // Opacity is in the 'A' component only.
- //
- D2D1_ALPHA_MODE_STRAIGHT = 2,
-
- //
- // Ignore any alpha channel information.
- //
- D2D1_ALPHA_MODE_IGNORE = 3,
- D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_ALPHA_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_GAMMA
-//
-// Synopsis:
-// This determines what gamma is used for interpolation/blending.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_GAMMA
-{
-
- //
- // Colors are manipulated in 2.2 gamma color space.
- //
- D2D1_GAMMA_2_2 = 0,
-
- //
- // Colors are manipulated in 1.0 gamma color space.
- //
- D2D1_GAMMA_1_0 = 1,
- D2D1_GAMMA_FORCE_DWORD = 0xffffffff
-
-} D2D1_GAMMA;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_OPACITY_MASK_CONTENT
-//
-// Synopsis:
-// Specifies what the contents are of an opacity mask.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_OPACITY_MASK_CONTENT
-{
-
- //
- // The mask contains geometries or bitmaps.
- //
- D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0,
-
- //
- // The mask contains text rendered using one of the natural text modes.
- //
- D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1,
-
- //
- // The mask contains text rendered using one of the GDI compatible text modes.
- //
- D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2,
- D2D1_OPACITY_MASK_CONTENT_FORCE_DWORD = 0xffffffff
-
-} D2D1_OPACITY_MASK_CONTENT;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_EXTEND_MODE
-//
-// Synopsis:
-// Enum which descibes how to sample from a source outside it's base tile.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_EXTEND_MODE
-{
-
- //
- // Extend the edges of the source out by clamping sample points outside the source
- // to the edges.
- //
- D2D1_EXTEND_MODE_CLAMP = 0,
-
- //
- // The base tile is drawn untransformed and the remainder are filled by repeating
- // the base tile.
- //
- D2D1_EXTEND_MODE_WRAP = 1,
-
- //
- // The same as wrap, but alternate tiles are flipped The base tile is drawn
- // untransformed.
- //
- D2D1_EXTEND_MODE_MIRROR = 2,
- D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_EXTEND_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_ANTIALIAS_MODE
-//
-// Synopsis:
-// Enum which descibes the manner in which we render edges of non-text primitives.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_ANTIALIAS_MODE
-{
-
- //
- // The edges of each primitive are antialiased sequentially.
- //
- D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0,
-
- //
- // Each pixel is rendered if its pixel center is contained by the geometry.
- //
- D2D1_ANTIALIAS_MODE_ALIASED = 1,
- D2D1_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_ANTIALIAS_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_TEXT_ANTIALIAS_MODE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_TEXT_ANTIALIAS_MODE
-{
-
- //
- // Render text using the current system setting.
- //
- D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0,
-
- //
- // Render text using ClearType.
- //
- D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1,
-
- //
- // Render text using gray-scale.
- //
- D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2,
-
- //
- // Render text aliased.
- //
- D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3,
- D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_TEXT_ANTIALIAS_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_BITMAP_INTERPOLATION_MODE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_BITMAP_INTERPOLATION_MODE
-{
-
- //
- // Nearest Neighbor filtering. Also known as nearest pixel or nearest point
- // sampling.
- //
- D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
-
- //
- // Linear filtering.
- //
- D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = 1,
- D2D1_BITMAP_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_BITMAP_INTERPOLATION_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_DRAW_TEXT_OPTIONS
-//
-// Synopsis:
-// Modifications made to the draw text call that influence how the text is
-// rendered.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_DRAW_TEXT_OPTIONS
-{
-
- //
- // Do not snap the baseline of the text vertically.
- //
- D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001,
-
- //
- // Clip the text to the content bounds.
- //
- D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002,
- D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000,
- D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD = 0xffffffff
-
-} D2D1_DRAW_TEXT_OPTIONS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_DRAW_TEXT_OPTIONS);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_PIXEL_FORMAT
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_PIXEL_FORMAT
-{
- DXGI_FORMAT format;
- D2D1_ALPHA_MODE alphaMode;
-
-} D2D1_PIXEL_FORMAT;
-
-typedef D2D_POINT_2U D2D1_POINT_2U;
-typedef D2D_POINT_2F D2D1_POINT_2F;
-typedef D2D_RECT_F D2D1_RECT_F;
-typedef D2D_RECT_U D2D1_RECT_U;
-typedef D2D_SIZE_F D2D1_SIZE_F;
-typedef D2D_SIZE_U D2D1_SIZE_U;
-typedef D2D_COLOR_F D2D1_COLOR_F;
-typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
-typedef UINT64 D2D1_TAG;
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_BITMAP_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_BITMAP_PROPERTIES
-{
- D2D1_PIXEL_FORMAT pixelFormat;
- FLOAT dpiX;
- FLOAT dpiY;
-
-} D2D1_BITMAP_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_GRADIENT_STOP
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_GRADIENT_STOP
-{
- FLOAT position;
- D2D1_COLOR_F color;
-
-} D2D1_GRADIENT_STOP;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_BRUSH_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_BRUSH_PROPERTIES
-{
- FLOAT opacity;
- D2D1_MATRIX_3X2_F transform;
-
-} D2D1_BRUSH_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_BITMAP_BRUSH_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_BITMAP_BRUSH_PROPERTIES
-{
- D2D1_EXTEND_MODE extendModeX;
- D2D1_EXTEND_MODE extendModeY;
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode;
-
-} D2D1_BITMAP_BRUSH_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
-{
- D2D1_POINT_2F startPoint;
- D2D1_POINT_2F endPoint;
-
-} D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
-{
- D2D1_POINT_2F center;
- D2D1_POINT_2F gradientOriginOffset;
- FLOAT radiusX;
- FLOAT radiusY;
-
-} D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_ARC_SIZE
-//
-// Synopsis:
-// Differentiates which of the two possible arcs could match the given arc
-// parameters.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_ARC_SIZE
-{
- D2D1_ARC_SIZE_SMALL = 0,
- D2D1_ARC_SIZE_LARGE = 1,
- D2D1_ARC_SIZE_FORCE_DWORD = 0xffffffff
-
-} D2D1_ARC_SIZE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_CAP_STYLE
-//
-// Synopsis:
-// Enum which descibes the drawing of the ends of a line.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_CAP_STYLE
-{
-
- //
- // Flat line cap.
- //
- D2D1_CAP_STYLE_FLAT = 0,
-
- //
- // Square line cap.
- //
- D2D1_CAP_STYLE_SQUARE = 1,
-
- //
- // Round line cap.
- //
- D2D1_CAP_STYLE_ROUND = 2,
-
- //
- // Triangle line cap.
- //
- D2D1_CAP_STYLE_TRIANGLE = 3,
- D2D1_CAP_STYLE_FORCE_DWORD = 0xffffffff
-
-} D2D1_CAP_STYLE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_DASH_STYLE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_DASH_STYLE
-{
- D2D1_DASH_STYLE_SOLID = 0,
- D2D1_DASH_STYLE_DASH = 1,
- D2D1_DASH_STYLE_DOT = 2,
- D2D1_DASH_STYLE_DASH_DOT = 3,
- D2D1_DASH_STYLE_DASH_DOT_DOT = 4,
- D2D1_DASH_STYLE_CUSTOM = 5,
- D2D1_DASH_STYLE_FORCE_DWORD = 0xffffffff
-
-} D2D1_DASH_STYLE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_LINE_JOIN
-//
-// Synopsis:
-// Enum which descibes the drawing of the corners on the line.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_LINE_JOIN
-{
-
- //
- // Miter join.
- //
- D2D1_LINE_JOIN_MITER = 0,
-
- //
- // Bevel join.
- //
- D2D1_LINE_JOIN_BEVEL = 1,
-
- //
- // Round join.
- //
- D2D1_LINE_JOIN_ROUND = 2,
-
- //
- // Miter/Bevel join.
- //
- D2D1_LINE_JOIN_MITER_OR_BEVEL = 3,
- D2D1_LINE_JOIN_FORCE_DWORD = 0xffffffff
-
-} D2D1_LINE_JOIN;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_COMBINE_MODE
-//
-// Synopsis:
-// This enumeration describes the type of combine operation to be performed.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_COMBINE_MODE
-{
-
- //
- // Produce a geometry representing the set of points contained in either
- // the first or the second geometry.
- //
- D2D1_COMBINE_MODE_UNION = 0,
-
- //
- // Produce a geometry representing the set of points common to the first
- // and the second geometries.
- //
- D2D1_COMBINE_MODE_INTERSECT = 1,
-
- //
- // Produce a geometry representing the set of points contained in the
- // first geometry or the second geometry, but not both.
- //
- D2D1_COMBINE_MODE_XOR = 2,
-
- //
- // Produce a geometry representing the set of points contained in the
- // first geometry but not the second geometry.
- //
- D2D1_COMBINE_MODE_EXCLUDE = 3,
- D2D1_COMBINE_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_COMBINE_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_GEOMETRY_RELATION
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_GEOMETRY_RELATION
-{
-
- //
- // The relation between the geometries couldn't be determined. This value is never
- // returned by any D2D method.
- //
- D2D1_GEOMETRY_RELATION_UNKNOWN = 0,
-
- //
- // The two geometries do not intersect at all.
- //
- D2D1_GEOMETRY_RELATION_DISJOINT = 1,
-
- //
- // The passed in geometry is entirely contained by the object.
- //
- D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2,
-
- //
- // The object entirely contains the passed in geometry.
- //
- D2D1_GEOMETRY_RELATION_CONTAINS = 3,
-
- //
- // The two geometries overlap but neither completely contains the other.
- //
- D2D1_GEOMETRY_RELATION_OVERLAP = 4,
- D2D1_GEOMETRY_RELATION_FORCE_DWORD = 0xffffffff
-
-} D2D1_GEOMETRY_RELATION;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_GEOMETRY_SIMPLIFICATION_OPTION
-//
-// Synopsis:
-// Specifies how simple the output of a simplified geometry sink should be.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION
-{
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0,
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1,
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = 0xffffffff
-
-} D2D1_GEOMETRY_SIMPLIFICATION_OPTION;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_FIGURE_BEGIN
-//
-// Synopsis:
-// Indicates whether the given figure is filled or hollow.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_FIGURE_BEGIN
-{
- D2D1_FIGURE_BEGIN_FILLED = 0,
- D2D1_FIGURE_BEGIN_HOLLOW = 1,
- D2D1_FIGURE_BEGIN_FORCE_DWORD = 0xffffffff
-
-} D2D1_FIGURE_BEGIN;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_FIGURE_END
-//
-// Synopsis:
-// Indicates whether the figure ir open or closed on its end point.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_FIGURE_END
-{
- D2D1_FIGURE_END_OPEN = 0,
- D2D1_FIGURE_END_CLOSED = 1,
- D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff
-
-} D2D1_FIGURE_END;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_BEZIER_SEGMENT
-//
-// Synopsis:
-// Describes a cubic bezier in a path.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_BEZIER_SEGMENT
-{
- D2D1_POINT_2F point1;
- D2D1_POINT_2F point2;
- D2D1_POINT_2F point3;
-
-} D2D1_BEZIER_SEGMENT;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_TRIANGLE
-//
-// Synopsis:
-// Describes a triangle.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_TRIANGLE
-{
- D2D1_POINT_2F point1;
- D2D1_POINT_2F point2;
- D2D1_POINT_2F point3;
-
-} D2D1_TRIANGLE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_PATH_SEGMENT
-//
-// Synopsis:
-// Indicates whether the given segment should be stroked, or, if the join between
-// this segment and the previous one should be smooth.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_PATH_SEGMENT
-{
- D2D1_PATH_SEGMENT_NONE = 0x00000000,
- D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001,
- D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002,
- D2D1_PATH_SEGMENT_FORCE_DWORD = 0xffffffff
-
-} D2D1_PATH_SEGMENT;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_PATH_SEGMENT);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_SWEEP_DIRECTION
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_SWEEP_DIRECTION
-{
- D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0,
- D2D1_SWEEP_DIRECTION_CLOCKWISE = 1,
- D2D1_SWEEP_DIRECTION_FORCE_DWORD = 0xffffffff
-
-} D2D1_SWEEP_DIRECTION;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_FILL_MODE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_FILL_MODE
-{
- D2D1_FILL_MODE_ALTERNATE = 0,
- D2D1_FILL_MODE_WINDING = 1,
- D2D1_FILL_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_FILL_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_ARC_SEGMENT
-//
-// Synopsis:
-// Describes an arc that is defined as part of a path.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_ARC_SEGMENT
-{
- D2D1_POINT_2F point;
- D2D1_SIZE_F size;
- FLOAT rotationAngle;
- D2D1_SWEEP_DIRECTION sweepDirection;
- D2D1_ARC_SIZE arcSize;
-
-} D2D1_ARC_SEGMENT;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_QUADRATIC_BEZIER_SEGMENT
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_QUADRATIC_BEZIER_SEGMENT
-{
- D2D1_POINT_2F point1;
- D2D1_POINT_2F point2;
-
-} D2D1_QUADRATIC_BEZIER_SEGMENT;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_ELLIPSE
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_ELLIPSE
-{
- D2D1_POINT_2F point;
- FLOAT radiusX;
- FLOAT radiusY;
-
-} D2D1_ELLIPSE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_ROUNDED_RECT
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_ROUNDED_RECT
-{
- D2D1_RECT_F rect;
- FLOAT radiusX;
- FLOAT radiusY;
-
-} D2D1_ROUNDED_RECT;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_STROKE_STYLE_PROPERTIES
-//
-// Synopsis:
-// Properties, aside from the width, that allow geometric penning to be specified.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_STROKE_STYLE_PROPERTIES
-{
- D2D1_CAP_STYLE startCap;
- D2D1_CAP_STYLE endCap;
- D2D1_CAP_STYLE dashCap;
- D2D1_LINE_JOIN lineJoin;
- FLOAT miterLimit;
- D2D1_DASH_STYLE dashStyle;
- FLOAT dashOffset;
-
-} D2D1_STROKE_STYLE_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_LAYER_OPTIONS
-//
-// Synopsis:
-// Specified options that can be applied when a layer resource is applied to create
-// a layer.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_LAYER_OPTIONS
-{
- D2D1_LAYER_OPTIONS_NONE = 0x00000000,
-
- //
- // The layer will render correctly for ClearType text. If the render target was set
- // to ClearType previously, the layer will continue to render ClearType. If the
- // render target was set to ClearType and this option is not specified, the render
- // target will be set to render gray-scale until the layer is popped. The caller
- // can override this default by calling SetTextAntialiasMode while within the
- // layer. This flag is slightly slower than the default.
- //
- D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001,
- D2D1_LAYER_OPTIONS_FORCE_DWORD = 0xffffffff
-
-} D2D1_LAYER_OPTIONS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_LAYER_PARAMETERS
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_LAYER_PARAMETERS
-{
-
- //
- // The rectangular clip that will be applied to the layer. The clip is affected by
- // the world transform. Content outside of the content bounds will not render.
- //
- D2D1_RECT_F contentBounds;
-
- //
- // A general mask that can be optionally applied to the content. Content not inside
- // the fill of the mask will not be rendered.
- //
- __field_ecount_opt(1) ID2D1Geometry *geometricMask;
-
- //
- // Specifies whether the mask should be aliased or antialiased.
- //
- D2D1_ANTIALIAS_MODE maskAntialiasMode;
-
- //
- // An additional transform that may be applied to the mask in addition to the
- // current world transform.
- //
- D2D1_MATRIX_3X2_F maskTransform;
-
- //
- // The opacity with which all of the content in the layer will be blended back to
- // the target when the layer is popped.
- //
- FLOAT opacity;
-
- //
- // An additional brush that can be applied to the layer. Only the opacity channel
- // is sampled from this brush and multiplied both with the layer content and the
- // over-all layer opacity.
- //
- __field_ecount_opt(1) ID2D1Brush *opacityBrush;
-
- //
- // Specifies if ClearType will be rendered into the layer.
- //
- D2D1_LAYER_OPTIONS layerOptions;
-
-} D2D1_LAYER_PARAMETERS;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_WINDOW_STATE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_WINDOW_STATE
-{
- D2D1_WINDOW_STATE_NONE = 0x0000000,
- D2D1_WINDOW_STATE_OCCLUDED = 0x0000001,
- D2D1_WINDOW_STATE_FORCE_DWORD = 0xffffffff
-
-} D2D1_WINDOW_STATE;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_WINDOW_STATE);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_RENDER_TARGET_TYPE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_RENDER_TARGET_TYPE
-{
-
- //
- // D2D is free to choose the render target type for the caller.
- //
- D2D1_RENDER_TARGET_TYPE_DEFAULT = 0,
-
- //
- // The render target will render using the CPU.
- //
- D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1,
-
- //
- // The render target will render using the GPU.
- //
- D2D1_RENDER_TARGET_TYPE_HARDWARE = 2,
- D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = 0xffffffff
-
-} D2D1_RENDER_TARGET_TYPE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_FEATURE_LEVEL
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_FEATURE_LEVEL
-{
-
- //
- // The caller does not require a particular underlying D3D device level.
- //
- D2D1_FEATURE_LEVEL_DEFAULT = 0,
-
- //
- // The D3D device level is DX9 compatible.
- //
- D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1,
-
- //
- // The D3D device level is DX10 compatible.
- //
- D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0,
- D2D1_FEATURE_LEVEL_FORCE_DWORD = 0xffffffff
-
-} D2D1_FEATURE_LEVEL;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_RENDER_TARGET_USAGE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_RENDER_TARGET_USAGE
-{
- D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000,
-
- //
- // Rendering will occur locally, if a terminal-services session is established, the
- // bitmap updates will be sent to the terminal services client.
- //
- D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001,
-
- //
- // The render target will allow a call to GetDC on the IGdiInteropRenderTarget
- // interface. Rendering will also occur locally.
- //
- D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002,
- D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = 0xffffffff
-
-} D2D1_RENDER_TARGET_USAGE;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_RENDER_TARGET_USAGE);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_PRESENT_OPTIONS
-//
-// Synopsis:
-// Describes how present should behave.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_PRESENT_OPTIONS
-{
- D2D1_PRESENT_OPTIONS_NONE = 0x00000000,
-
- //
- // Keep the target contents intact through present.
- //
- D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001,
-
- //
- // Do not wait for display refresh to commit changes to display.
- //
- D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002,
- D2D1_PRESENT_OPTIONS_FORCE_DWORD = 0xffffffff
-
-} D2D1_PRESENT_OPTIONS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_PRESENT_OPTIONS);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_RENDER_TARGET_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_RENDER_TARGET_PROPERTIES
-{
- D2D1_RENDER_TARGET_TYPE type;
- D2D1_PIXEL_FORMAT pixelFormat;
- FLOAT dpiX;
- FLOAT dpiY;
- D2D1_RENDER_TARGET_USAGE usage;
- D2D1_FEATURE_LEVEL minLevel;
-
-} D2D1_RENDER_TARGET_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_HWND_RENDER_TARGET_PROPERTIES
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES
-{
- HWND hwnd;
- D2D1_SIZE_U pixelSize;
- D2D1_PRESENT_OPTIONS presentOptions;
-
-} D2D1_HWND_RENDER_TARGET_PROPERTIES;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Flag:
-// D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
-{
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000,
-
- //
- // The compatible render target will allow a call to GetDC on the
- // IGdiInteropRenderTarget interface. This can be specified even if the parent
- // render target is not GDI compatible.
- //
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001,
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_FORCE_DWORD = 0xffffffff
-
-} D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS);
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_DRAWING_STATE_DESCRIPTION
-//
-// Synopsis:
-// Allows the drawing state to be atomically created. This also specifies the
-// drawing state that is saved into an IDrawingStateBlock object.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_DRAWING_STATE_DESCRIPTION
-{
- D2D1_ANTIALIAS_MODE antialiasMode;
- D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
- D2D1_TAG tag1;
- D2D1_TAG tag2;
- D2D1_MATRIX_3X2_F transform;
-
-} D2D1_DRAWING_STATE_DESCRIPTION;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_DC_INITIALIZE_MODE
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_DC_INITIALIZE_MODE
-{
-
- //
- // The contents of the D2D render target will be copied to the DC.
- //
- D2D1_DC_INITIALIZE_MODE_COPY = 0,
-
- //
- // The contents of the DC will be cleared.
- //
- D2D1_DC_INITIALIZE_MODE_CLEAR = 1,
- D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = 0xffffffff
-
-} D2D1_DC_INITIALIZE_MODE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_DEBUG_LEVEL
-//
-// Synopsis:
-// Indicates the debug level to be outputed by the debug layer.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_DEBUG_LEVEL
-{
- D2D1_DEBUG_LEVEL_NONE = 0,
- D2D1_DEBUG_LEVEL_ERROR = 1,
- D2D1_DEBUG_LEVEL_WARNING = 2,
- D2D1_DEBUG_LEVEL_INFORMATION = 3,
- D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff
-
-} D2D1_DEBUG_LEVEL;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Enum:
-// D2D1_FACTORY_TYPE
-//
-// Synopsis:
-// Specifies the threading model of the created factory and all of its derived
-// resources.
-//
-//------------------------------------------------------------------------------
-typedef enum D2D1_FACTORY_TYPE
-{
-
- //
- // The resulting factory and derived resources may only be invoked serially.
- // Reference counts on resources are interlocked, however, resource and render
- // target state is not protected from multi-threaded access.
- //
- D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
-
- //
- // The resulting factory may be invoked from multiple threads. Returned resources
- // use interlocked reference counting and their state is protected.
- //
- D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
- D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff
-
-} D2D1_FACTORY_TYPE;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D1_FACTORY_OPTIONS
-//
-// Synopsis:
-// Allows additional parameters for factory creation.
-//
-//------------------------------------------------------------------------------
-typedef struct D2D1_FACTORY_OPTIONS
-{
-
- //
- // Requests a certain level of debugging information from the debug layer. This
- // parameter is ignored if the debug layer DLL is not present.
- //
- D2D1_DEBUG_LEVEL debugLevel;
-
-} D2D1_FACTORY_OPTIONS;
-
-
-#ifndef D2D_USE_C_DEFINITIONS
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Resource
-//
-// Synopsis:
-// The root interface for all resources in D2D.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd90691-12e2-11dc-9fed-001143a055f9") ID2D1Resource : public IUnknown
-{
-
-
- //
- // Retrieve the factory associated with this resource.
- //
- STDMETHOD_(void, GetFactory)(
- __deref_out ID2D1Factory **factory
- ) CONST PURE;
-}; // interface ID2D1Resource
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Bitmap
-//
-// Synopsis:
-// Root bitmap resource, linearly scaled on a draw call.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("a2296057-ea42-4099-983b-539fb6505426") ID2D1Bitmap : public ID2D1Resource
-{
-
-
- //
- // Returns the size of the bitmap in resolution independent units.
- //
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ) CONST PURE;
-
-
- //
- // Returns the size of the bitmap in resolution dependent units, (pixels).
- //
- STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
- ) CONST PURE;
-
-
- //
- // Retrieve the format of the bitmap.
- //
- STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
- ) CONST PURE;
-
-
- //
- // Return the DPI of the bitmap.
- //
- STDMETHOD_(void, GetDpi)(
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) CONST PURE;
-
- STDMETHOD(CopyFromBitmap)(
- __in_opt CONST D2D1_POINT_2U *destPoint,
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_RECT_U *srcRect
- ) PURE;
-
- STDMETHOD(CopyFromRenderTarget)(
- __in_opt CONST D2D1_POINT_2U *destPoint,
- __in ID2D1RenderTarget *renderTarget,
- __in_opt CONST D2D1_RECT_U *srcRect
- ) PURE;
-
- STDMETHOD(CopyFromMemory)(
- __in_opt CONST D2D1_RECT_U *dstRect,
- __in CONST void *srcData,
- UINT32 pitch
- ) PURE;
-}; // interface ID2D1Bitmap
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1GradientStopCollection
-//
-// Synopsis:
-// Represents an collection of gradient stops that can then be the source resource
-// for either a linear or radial gradient brush.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a7-12e2-11dc-9fed-001143a055f9") ID2D1GradientStopCollection : public ID2D1Resource
-{
-
-
- //
- // Returns the number of stops in the gradient.
- //
- STDMETHOD_(UINT32, GetGradientStopCount)(
- ) CONST PURE;
-
-
- //
- // Copies the gradient stops from the collection into the caller's interface.
- //
- STDMETHOD_(void, GetGradientStops)(
- __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops,
- UINT gradientStopsCount
- ) CONST PURE;
-
-
- //
- // Returns whether the interpolation occurs with 1.0 or 2.2 gamma.
- //
- STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)(
- ) CONST PURE;
-}; // interface ID2D1GradientStopCollection
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Brush
-//
-// Synopsis:
-// The root brush interface. All brushes can be used to fill or pen a geometry.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a8-12e2-11dc-9fed-001143a055f9") ID2D1Brush : public ID2D1Resource
-{
-
-
- //
- // Sets the opacity for when the brush is drawn over the entire fill of the brush.
- //
- STDMETHOD_(void, SetOpacity)(
- FLOAT opacity
- ) PURE;
-
-
- //
- // Sets the transform that applies to everything drawn by the brush.
- //
- STDMETHOD_(void, SetTransform)(
- __in CONST D2D1_MATRIX_3X2_F *transform
- ) PURE;
-
- STDMETHOD_(FLOAT, GetOpacity)(
- ) CONST PURE;
-
- STDMETHOD_(void, GetTransform)(
- __out D2D1_MATRIX_3X2_F *transform
- ) CONST PURE;
-
- void
- SetTransform(
- CONST D2D1_MATRIX_3X2_F &transform
- )
- {
- SetTransform(&transform);
- }
-}; // interface ID2D1Brush
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1BitmapBrush
-//
-// Synopsis:
-// A bitmap brush allows a bitmap to be used to fill a geometry.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906aa-12e2-11dc-9fed-001143a055f9") ID2D1BitmapBrush : public ID2D1Brush
-{
-
-
- //
- // Sets how the bitmap is to be treated outside of its natural extent on the X
- // axis.
- //
- STDMETHOD_(void, SetExtendModeX)(
- D2D1_EXTEND_MODE extendModeX
- ) PURE;
-
-
- //
- // Sets how the bitmap is to be treated outside of its natural extent on the X
- // axis.
- //
- STDMETHOD_(void, SetExtendModeY)(
- D2D1_EXTEND_MODE extendModeY
- ) PURE;
-
-
- //
- // Sets the interpolation mode used when this brush is used.
- //
- STDMETHOD_(void, SetInterpolationMode)(
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode
- ) PURE;
-
-
- //
- // Sets the bitmap associated as the source of this brush.
- //
- STDMETHOD_(void, SetBitmap)(
- __in ID2D1Bitmap *bitmap
- ) PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)(
- ) CONST PURE;
-
- STDMETHOD_(void, GetBitmap)(
- __deref_out ID2D1Bitmap **bitmap
- ) CONST PURE;
-}; // interface ID2D1BitmapBrush
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1SolidColorBrush
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a9-12e2-11dc-9fed-001143a055f9") ID2D1SolidColorBrush : public ID2D1Brush
-{
-
- STDMETHOD_(void, SetColor)(
- __in CONST D2D1_COLOR_F *color
- ) PURE;
-
- STDMETHOD_(D2D1_COLOR_F, GetColor)(
- ) CONST PURE;
-
- void
- SetColor(
- CONST D2D1_COLOR_F &color
- )
- {
- SetColor(&color);
- }
-}; // interface ID2D1SolidColorBrush
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1LinearGradientBrush
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906ab-12e2-11dc-9fed-001143a055f9") ID2D1LinearGradientBrush : public ID2D1Brush
-{
-
- STDMETHOD_(void, SetStartPoint)(
- D2D1_POINT_2F startPoint
- ) PURE;
-
-
- //
- // Sets the end point of the gradient in local coordinate space. This is not
- // influenced by the geometry being filled.
- //
- STDMETHOD_(void, SetEndPoint)(
- D2D1_POINT_2F endPoint
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetStartPoint)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetEndPoint)(
- ) CONST PURE;
-
- STDMETHOD_(void, GetGradientStopCollection)(
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) CONST PURE;
-}; // interface ID2D1LinearGradientBrush
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1RadialGradientBrush
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906ac-12e2-11dc-9fed-001143a055f9") ID2D1RadialGradientBrush : public ID2D1Brush
-{
-
-
- //
- // Sets the center of the radial gradient. This will be in local coordinates and
- // will not depend on the geometry being filled.
- //
- STDMETHOD_(void, SetCenter)(
- D2D1_POINT_2F center
- ) PURE;
-
-
- //
- // Sets offset of the origin relative to the radial gradient center.
- //
- STDMETHOD_(void, SetGradientOriginOffset)(
- D2D1_POINT_2F gradientOriginOffset
- ) PURE;
-
- STDMETHOD_(void, SetRadiusX)(
- FLOAT radiusX
- ) PURE;
-
- STDMETHOD_(void, SetRadiusY)(
- FLOAT radiusY
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetCenter)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)(
- ) CONST PURE;
-
- STDMETHOD_(FLOAT, GetRadiusX)(
- ) CONST PURE;
-
- STDMETHOD_(FLOAT, GetRadiusY)(
- ) CONST PURE;
-
- STDMETHOD_(void, GetGradientStopCollection)(
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) CONST PURE;
-}; // interface ID2D1RadialGradientBrush
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1StrokeStyle
-//
-// Synopsis:
-// Resource interface that holds pen style properties.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd9069d-12e2-11dc-9fed-001143a055f9") ID2D1StrokeStyle : public ID2D1Resource
-{
-
- STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)(
- ) CONST PURE;
-
- STDMETHOD_(FLOAT, GetMiterLimit)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)(
- ) CONST PURE;
-
- STDMETHOD_(FLOAT, GetDashOffset)(
- ) CONST PURE;
-
- STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)(
- ) CONST PURE;
-
- STDMETHOD_(UINT32, GetDashesCount)(
- ) CONST PURE;
-
-
- //
- // Returns the dashes from the object into a user allocated array. The user must
- // call GetDashesCount to retrieve the required size.
- //
- STDMETHOD_(void, GetDashes)(
- __out_ecount(dashesCount) FLOAT *dashes,
- UINT dashesCount
- ) CONST PURE;
-}; // interface ID2D1StrokeStyle
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Geometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a1-12e2-11dc-9fed-001143a055f9") ID2D1Geometry : public ID2D1Resource
-{
-
-
- //
- // Retrieve the bounds of the geometry, with an optional applied transform.
- //
- STDMETHOD(GetBounds)(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out D2D1_RECT_F *bounds
- ) CONST PURE;
-
-
- //
- // Get the bounds of the corresponding geometry after it has been widened or have
- // an optional pen style applied.
- //
- STDMETHOD(GetWidenedBounds)(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out D2D1_RECT_F *bounds
- ) CONST PURE;
-
-
- //
- // Checks to see whether the corresponding penned and widened geometry contains the
- // given point.
- //
- STDMETHOD(StrokeContainsPoint)(
- D2D1_POINT_2F point,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) CONST PURE;
-
-
- //
- // Test whether the given fill of this geometry would contain this point.
- //
- STDMETHOD(FillContainsPoint)(
- D2D1_POINT_2F point,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) CONST PURE;
-
-
- //
- // Compare how one geometry intersects or contains another geometry.
- //
- STDMETHOD(CompareWithGeometry)(
- __in ID2D1Geometry *inputGeometry,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- FLOAT flatteningTolerance,
- __out D2D1_GEOMETRY_RELATION *relation
- ) CONST PURE;
-
-
- //
- // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
- // removed.
- //
- STDMETHOD(Simplify)(
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST PURE;
-
-
- //
- // Tessellates a geometry into triangles.
- //
- STDMETHOD(Tessellate)(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1TessellationSink *tessellationSink
- ) CONST PURE;
-
-
- //
- // Performs a combine operation between the two geometries to produce a resulting
- // geometry.
- //
- STDMETHOD(CombineWithGeometry)(
- __in ID2D1Geometry *inputGeometry,
- D2D1_COMBINE_MODE combineMode,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST PURE;
-
-
- //
- // Computes the outline of the geometry. The result is written back into a
- // simplified geometry sink.
- //
- STDMETHOD(Outline)(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST PURE;
-
-
- //
- // Computes the area of the geometry.
- //
- STDMETHOD(ComputeArea)(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *area
- ) CONST PURE;
-
-
- //
- // Computes the length of the geometry.
- //
- STDMETHOD(ComputeLength)(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *length
- ) CONST PURE;
-
-
- //
- // Computes the point and tangent a given distance along the path.
- //
- STDMETHOD(ComputePointAtLength)(
- FLOAT length,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out_opt D2D1_POINT_2F *point,
- __out_opt D2D1_POINT_2F *unitTangentVector
- ) CONST PURE;
-
-
- //
- // Get the geometry and widen it as well as apply an optional pen style.
- //
- STDMETHOD(Widen)(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST PURE;
-
-
- //
- // Retrieve the bounds of the geometry, with an optional applied transform.
- //
- HRESULT
- GetBounds(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out D2D1_RECT_F *bounds
- ) CONST
- {
- return GetBounds(&worldTransform, bounds);
- }
-
-
- //
- // Get the bounds of the corresponding geometry after it has been widened or have
- // an optional pen style applied.
- //
- HRESULT
- GetWidenedBounds(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out D2D1_RECT_F *bounds
- ) CONST
- {
- return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, bounds);
- }
-
-
- //
- // Get the bounds of the corresponding geometry after it has been widened or have
- // an optional pen style applied.
- //
- HRESULT
- GetWidenedBounds(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out D2D1_RECT_F *bounds
- ) CONST
- {
- return GetWidenedBounds(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds);
- }
-
-
- //
- // Get the bounds of the corresponding geometry after it has been widened or have
- // an optional pen style applied.
- //
- HRESULT
- GetWidenedBounds(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out D2D1_RECT_F *bounds
- ) CONST
- {
- return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds);
- }
-
- HRESULT
- StrokeContainsPoint(
- D2D1_POINT_2F point,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) CONST
- {
- return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, contains);
- }
-
-
- //
- // Checks to see whether the corresponding penned and widened geometry contains the
- // given point.
- //
- HRESULT
- StrokeContainsPoint(
- D2D1_POINT_2F point,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out BOOL *contains
- ) CONST
- {
- return StrokeContainsPoint(point, strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
- }
-
- HRESULT
- StrokeContainsPoint(
- D2D1_POINT_2F point,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out BOOL *contains
- ) CONST
- {
- return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
- }
-
- HRESULT
- FillContainsPoint(
- D2D1_POINT_2F point,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) CONST
- {
- return FillContainsPoint(point, &worldTransform, flatteningTolerance, contains);
- }
-
-
- //
- // Test whether the given fill of this geometry would contain this point.
- //
- HRESULT
- FillContainsPoint(
- D2D1_POINT_2F point,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out BOOL *contains
- ) CONST
- {
- return FillContainsPoint(point, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
- }
-
- HRESULT
- FillContainsPoint(
- D2D1_POINT_2F point,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out BOOL *contains
- ) CONST
- {
- return FillContainsPoint(point, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains);
- }
-
-
- //
- // Compare how one geometry intersects or contains another geometry.
- //
- HRESULT
- CompareWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
- FLOAT flatteningTolerance,
- __out D2D1_GEOMETRY_RELATION *relation
- ) CONST
- {
- return CompareWithGeometry(inputGeometry, &inputGeometryTransform, flatteningTolerance, relation);
- }
-
-
- //
- // Compare how one geometry intersects or contains another geometry.
- //
- HRESULT
- CompareWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- __out D2D1_GEOMETRY_RELATION *relation
- ) CONST
- {
- return CompareWithGeometry(inputGeometry, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation);
- }
-
-
- //
- // Compare how one geometry intersects or contains another geometry.
- //
- HRESULT
- CompareWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
- __out D2D1_GEOMETRY_RELATION *relation
- ) CONST
- {
- return CompareWithGeometry(inputGeometry, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation);
- }
-
-
- //
- // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
- // removed.
- //
- HRESULT
- Simplify(
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Simplify(simplificationOption, &worldTransform, flatteningTolerance, geometrySink);
- }
-
-
- //
- // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
- // removed.
- //
- HRESULT
- Simplify(
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Simplify(simplificationOption, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Converts a geometry to a simplified geometry that has arcs and quadratic beziers
- // removed.
- //
- HRESULT
- Simplify(
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Simplify(simplificationOption, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Tessellates a geometry into triangles.
- //
- HRESULT
- Tessellate(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1TessellationSink *tessellationSink
- ) CONST
- {
- return Tessellate(&worldTransform, flatteningTolerance, tessellationSink);
- }
-
-
- //
- // Tessellates a geometry into triangles.
- //
- HRESULT
- Tessellate(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __in ID2D1TessellationSink *tessellationSink
- ) CONST
- {
- return Tessellate(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink);
- }
-
-
- //
- // Tessellates a geometry into triangles.
- //
- HRESULT
- Tessellate(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __in ID2D1TessellationSink *tessellationSink
- ) CONST
- {
- return Tessellate(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink);
- }
-
-
- //
- // Performs a combine operation between the two geometries to produce a resulting
- // geometry.
- //
- HRESULT
- CombineWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- D2D1_COMBINE_MODE combineMode,
- CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, flatteningTolerance, geometrySink);
- }
-
-
- //
- // Performs a combine operation between the two geometries to produce a resulting
- // geometry.
- //
- HRESULT
- CombineWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- D2D1_COMBINE_MODE combineMode,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return CombineWithGeometry(inputGeometry, combineMode, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Performs a combine operation between the two geometries to produce a resulting
- // geometry.
- //
- HRESULT
- CombineWithGeometry(
- __in ID2D1Geometry *inputGeometry,
- D2D1_COMBINE_MODE combineMode,
- CONST D2D1_MATRIX_3X2_F &inputGeometryTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Computes the outline of the geometry. The result is written back into a
- // simplified geometry sink.
- //
- HRESULT
- Outline(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Outline(&worldTransform, flatteningTolerance, geometrySink);
- }
-
-
- //
- // Computes the outline of the geometry. The result is written back into a
- // simplified geometry sink.
- //
- HRESULT
- Outline(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Outline(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Computes the outline of the geometry. The result is written back into a
- // simplified geometry sink.
- //
- HRESULT
- Outline(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Outline(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Computes the area of the geometry.
- //
- HRESULT
- ComputeArea(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *area
- ) CONST
- {
- return ComputeArea(&worldTransform, flatteningTolerance, area);
- }
-
-
- //
- // Computes the area of the geometry.
- //
- HRESULT
- ComputeArea(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out FLOAT *area
- ) CONST
- {
- return ComputeArea(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area);
- }
-
-
- //
- // Computes the area of the geometry.
- //
- HRESULT
- ComputeArea(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out FLOAT *area
- ) CONST
- {
- return ComputeArea(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area);
- }
-
-
- //
- // Computes the length of the geometry.
- //
- HRESULT
- ComputeLength(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *length
- ) CONST
- {
- return ComputeLength(&worldTransform, flatteningTolerance, length);
- }
-
-
- //
- // Computes the length of the geometry.
- //
- HRESULT
- ComputeLength(
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out FLOAT *length
- ) CONST
- {
- return ComputeLength(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length);
- }
-
-
- //
- // Computes the length of the geometry.
- //
- HRESULT
- ComputeLength(
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out FLOAT *length
- ) CONST
- {
- return ComputeLength(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length);
- }
-
-
- //
- // Computes the point and tangent a given distance along the path.
- //
- HRESULT
- ComputePointAtLength(
- FLOAT length,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __out_opt D2D1_POINT_2F *point,
- __out_opt D2D1_POINT_2F *unitTangentVector
- ) CONST
- {
- return ComputePointAtLength(length, &worldTransform, flatteningTolerance, point, unitTangentVector);
- }
-
-
- //
- // Computes the point and tangent a given distance along the path.
- //
- HRESULT
- ComputePointAtLength(
- FLOAT length,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out_opt D2D1_POINT_2F *point,
- __out_opt D2D1_POINT_2F *unitTangentVector
- ) CONST
- {
- return ComputePointAtLength(length, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector);
- }
-
-
- //
- // Computes the point and tangent a given distance along the path.
- //
- HRESULT
- ComputePointAtLength(
- FLOAT length,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __out_opt D2D1_POINT_2F *point,
- __out_opt D2D1_POINT_2F *unitTangentVector
- ) CONST
- {
- return ComputePointAtLength(length, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector);
- }
-
-
- //
- // Get the geometry and widen it as well as apply an optional pen style.
- //
- HRESULT
- Widen(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Widen(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, geometrySink);
- }
-
-
- //
- // Get the geometry and widen it as well as apply an optional pen style.
- //
- HRESULT
- Widen(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Widen(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-
-
- //
- // Get the geometry and widen it as well as apply an optional pen style.
- //
- HRESULT
- Widen(
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- CONST D2D1_MATRIX_3X2_F &worldTransform,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) CONST
- {
- return Widen(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
- }
-}; // interface ID2D1Geometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1RectangleGeometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a2-12e2-11dc-9fed-001143a055f9") ID2D1RectangleGeometry : public ID2D1Geometry
-{
-
- STDMETHOD_(void, GetRect)(
- __out D2D1_RECT_F *rect
- ) CONST PURE;
-}; // interface ID2D1RectangleGeometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1RoundedRectangleGeometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a3-12e2-11dc-9fed-001143a055f9") ID2D1RoundedRectangleGeometry : public ID2D1Geometry
-{
-
- STDMETHOD_(void, GetRoundedRect)(
- __out D2D1_ROUNDED_RECT *roundedRect
- ) CONST PURE;
-}; // interface ID2D1RoundedRectangleGeometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1EllipseGeometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a4-12e2-11dc-9fed-001143a055f9") ID2D1EllipseGeometry : public ID2D1Geometry
-{
-
- STDMETHOD_(void, GetEllipse)(
- __out D2D1_ELLIPSE *ellipse
- ) CONST PURE;
-}; // interface ID2D1EllipseGeometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1GeometryGroup
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a6-12e2-11dc-9fed-001143a055f9") ID2D1GeometryGroup : public ID2D1Geometry
-{
-
- STDMETHOD_(D2D1_FILL_MODE, GetFillMode)(
- ) CONST PURE;
-
- STDMETHOD_(UINT32, GetSourceGeometryCount)(
- ) CONST PURE;
-
- STDMETHOD_(void, GetSourceGeometries)(
- __out_ecount(geometriesCount) ID2D1Geometry **geometries,
- UINT geometriesCount
- ) CONST PURE;
-}; // interface ID2D1GeometryGroup
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1TransformedGeometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906bb-12e2-11dc-9fed-001143a055f9") ID2D1TransformedGeometry : public ID2D1Geometry
-{
-
- STDMETHOD_(void, GetSourceGeometry)(
- __deref_out ID2D1Geometry **sourceGeometry
- ) CONST PURE;
-
- STDMETHOD_(void, GetTransform)(
- __out D2D1_MATRIX_3X2_F *transform
- ) CONST PURE;
-}; // interface ID2D1TransformedGeometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1SimplifiedGeometrySink
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd9069e-12e2-11dc-9fed-001143a055f9") ID2D1SimplifiedGeometrySink : public IUnknown
-{
-
- STDMETHOD_(void, SetFillMode)(
- D2D1_FILL_MODE fillMode
- ) PURE;
-
- STDMETHOD_(void, SetSegmentFlags)(
- D2D1_PATH_SEGMENT vertexFlags
- ) PURE;
-
- STDMETHOD_(void, BeginFigure)(
- D2D1_POINT_2F startPoint,
- D2D1_FIGURE_BEGIN figureBegin
- ) PURE;
-
- STDMETHOD_(void, AddLines)(
- __in_ecount(pointsCount) CONST D2D1_POINT_2F *points,
- UINT pointsCount
- ) PURE;
-
- STDMETHOD_(void, AddBeziers)(
- __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers,
- UINT beziersCount
- ) PURE;
-
- STDMETHOD_(void, EndFigure)(
- D2D1_FIGURE_END figureEnd
- ) PURE;
-
- STDMETHOD(Close)(
- ) PURE;
-}; // interface ID2D1SimplifiedGeometrySink
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1GeometrySink
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd9069f-12e2-11dc-9fed-001143a055f9") ID2D1GeometrySink : public ID2D1SimplifiedGeometrySink
-{
-
- STDMETHOD_(void, AddLine)(
- D2D1_POINT_2F point
- ) PURE;
-
- STDMETHOD_(void, AddBezier)(
- __in CONST D2D1_BEZIER_SEGMENT *bezier
- ) PURE;
-
- STDMETHOD_(void, AddQuadraticBezier)(
- __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier
- ) PURE;
-
- STDMETHOD_(void, AddQuadraticBeziers)(
- __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers,
- UINT beziersCount
- ) PURE;
-
- STDMETHOD_(void, AddArc)(
- __in CONST D2D1_ARC_SEGMENT *arc
- ) PURE;
-
- void
- AddBezier(
- CONST D2D1_BEZIER_SEGMENT &bezier
- )
- {
- AddBezier(&bezier);
- }
-
- void
- AddQuadraticBezier(
- CONST D2D1_QUADRATIC_BEZIER_SEGMENT &bezier
- )
- {
- AddQuadraticBezier(&bezier);
- }
-
- void
- AddArc(
- CONST D2D1_ARC_SEGMENT &arc
- )
- {
- AddArc(&arc);
- }
-}; // interface ID2D1GeometrySink
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1TessellationSink
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906c1-12e2-11dc-9fed-001143a055f9") ID2D1TessellationSink : public IUnknown
-{
-
- STDMETHOD_(void, AddTriangles)(
- __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles,
- UINT trianglesCount
- ) PURE;
-
- STDMETHOD(Close)(
- ) PURE;
-}; // interface ID2D1TessellationSink
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1PathGeometry
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906a5-12e2-11dc-9fed-001143a055f9") ID2D1PathGeometry : public ID2D1Geometry
-{
-
-
- //
- // Opens a geometry sink that will be used to create this path geometry.
- //
- STDMETHOD(Open)(
- __deref_out ID2D1GeometrySink **geometrySink
- ) PURE;
-
-
- //
- // Retrieve the contents of this geometry. The caller passes an implementation of a
- // ID2D1GeometrySink interface to receive the data.
- //
- STDMETHOD(Stream)(
- __in ID2D1GeometrySink *geometrySink
- ) CONST PURE;
-
- STDMETHOD(GetSegmentCount)(
- __out UINT32 *count
- ) CONST PURE;
-
- STDMETHOD(GetFigureCount)(
- __out UINT32 *count
- ) CONST PURE;
-}; // interface ID2D1PathGeometry
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Mesh
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd906c2-12e2-11dc-9fed-001143a055f9") ID2D1Mesh : public ID2D1Resource
-{
-
-
- //
- // Opens the mesh for population.
- //
- STDMETHOD(Open)(
- __deref_out ID2D1TessellationSink **tessellationSink
- ) PURE;
-}; // interface ID2D1Mesh
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Layer
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd9069b-12e2-11dc-9fed-001143a055f9") ID2D1Layer : public ID2D1Resource
-{
-
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ) CONST PURE;
-}; // interface ID2D1Layer
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1DrawingStateBlock
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("28506e39-ebf6-46a1-bb47-fd85565ab957") ID2D1DrawingStateBlock : public ID2D1Resource
-{
-
-
- //
- // Retrieves the state currently contained within this state block resource.
- //
- STDMETHOD_(void, GetDescription)(
- __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
- ) CONST PURE;
-
-
- //
- // Sets the state description of this state block resource.
- //
- STDMETHOD_(void, SetDescription)(
- __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
- ) PURE;
-
-
- //
- // Sets the text rendering parameters of this state block resource.
- //
- STDMETHOD_(void, SetTextRenderingParams)(
- __in_opt IDWriteRenderingParams *textRenderingParams = NULL
- ) PURE;
-
-
- //
- // Retrieves the text rendering parameters contained within this state block
- // resource. If a NULL text rendering parameter was specified, NULL will be
- // returned.
- //
- STDMETHOD_(void, GetTextRenderingParams)(
- __deref_out_opt IDWriteRenderingParams **textRenderingParams
- ) CONST PURE;
-
- void
- SetDescription(
- CONST D2D1_DRAWING_STATE_DESCRIPTION &stateDescription
- )
- {
- SetDescription(&stateDescription);
- }
-}; // interface ID2D1DrawingStateBlock
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1RenderTarget
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd90694-12e2-11dc-9fed-001143a055f9") ID2D1RenderTarget : public ID2D1Resource
-{
-
-
- //
- // Create a D2D bitmap by copying from memory, or create uninitialized.
- //
- STDMETHOD(CreateBitmap)(
- D2D1_SIZE_U size,
- __in_opt CONST void *srcData,
- UINT32 pitch,
- __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
-
- //
- // Create a D2D bitmap by copying a WIC bitmap.
- //
- STDMETHOD(CreateBitmapFromWicBitmap)(
- __in IWICBitmapSource *wicBitmapSource,
- __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
-
- //
- // Create a D2D bitmap by sharing bits from another resource. The bitmap must be
- // compatible with the render target for the call to succeed.
- // For example, an IWICBitmap can be shared with a software target, or a DXGI
- // surface can be shared with a DXGI render target.
- //
- STDMETHOD(CreateSharedBitmap)(
- __in REFIID riid,
- __inout void *data,
- __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
-
- //
- // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
- // or pen a geometry.
- //
- STDMETHOD(CreateBitmapBrush)(
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __deref_out ID2D1BitmapBrush **bitmapBrush
- ) PURE;
-
- STDMETHOD(CreateSolidColorBrush)(
- __in CONST D2D1_COLOR_F *color,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __deref_out ID2D1SolidColorBrush **solidColorBrush
- ) PURE;
-
-
- //
- // A gradient stop collection represents a set of stops in an ideal unit length.
- // This is the source resource for a linear gradient and radial gradient brush.
- //
- STDMETHOD(CreateGradientStopCollection)(
- __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
- __range(>=,1) UINT gradientStopsCount,
-
- //
- // Specifies which space the color interpolation occurs in.
- //
- D2D1_GAMMA colorInterpolationGamma,
-
- //
- // Specifies how the gradient will be extended outside of the unit length.
- //
- D2D1_EXTEND_MODE extendMode,
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) PURE;
-
- STDMETHOD(CreateLinearGradientBrush)(
- __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1LinearGradientBrush **linearGradientBrush
- ) PURE;
-
- STDMETHOD(CreateRadialGradientBrush)(
- __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1RadialGradientBrush **radialGradientBrush
- ) PURE;
-
-
- //
- // Creates a bitmap render target whose bitmap can be used as a source for
- // rendering in the API.
- //
- STDMETHOD(CreateCompatibleRenderTarget)(
-
- //
- // The requested size of the target in DIPs. If the pixel size is not specified,
- // the DPI is inherited from the parent target. However, the render target will
- // never contain a fractional number of pixels.
- //
- __in_opt CONST D2D1_SIZE_F *desiredSize,
-
- //
- // The requested size of the render target in pixels. If the DIP size is also
- // specified, the DPI is calculated from these two values. If the desired size is
- // not specified, the DPI is inherited from the parent render target. If neither
- // value is specified, the compatible render target will be the same size and have
- // the same DPI as the parent target.
- //
- __in_opt CONST D2D1_SIZE_U *desiredPixelSize,
-
- //
- // The desired pixel format. The format must be compatible with the parent render
- // target type. If the format is not specified, it will be inherited from the
- // parent render target.
- //
- __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat,
-
- //
- // Allows the caller to retrieve a GDI compatible render target.
- //
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
-
- //
- // The returned bitmap render target.
- //
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- ) PURE;
-
-
- //
- // Creates a layer resource that can be used on any target and which will resize
- // under the covers if necessary.
- //
- STDMETHOD(CreateLayer)(
-
- //
- // The resolution independent minimum size hint for the layer resource. Specify
- // this to prevent unwanted reallocation of the layer backing store. The size is in
- // DIPs, but, it is unaffected by the current world transform. If the size is
- // unspecified, the returned resource is a placeholder and the backing store will
- // be allocated to be the minimum size that can hold the content when the layer is
- // pushed.
- //
- __in_opt CONST D2D1_SIZE_F *size,
- __deref_out ID2D1Layer **layer
- ) PURE;
-
-
- //
- // Create a D2D mesh.
- //
- STDMETHOD(CreateMesh)(
- __deref_out ID2D1Mesh **mesh
- ) PURE;
-
- STDMETHOD_(void, DrawLine)(
- D2D1_POINT_2F point0,
- D2D1_POINT_2F point1,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- ) PURE;
-
- STDMETHOD_(void, DrawRectangle)(
- __in CONST D2D1_RECT_F *rect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- ) PURE;
-
- STDMETHOD_(void, FillRectangle)(
- __in CONST D2D1_RECT_F *rect,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawRoundedRectangle)(
- __in CONST D2D1_ROUNDED_RECT *roundedRect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- ) PURE;
-
- STDMETHOD_(void, FillRoundedRectangle)(
- __in CONST D2D1_ROUNDED_RECT *roundedRect,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawEllipse)(
- __in CONST D2D1_ELLIPSE *ellipse,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- ) PURE;
-
- STDMETHOD_(void, FillEllipse)(
- __in CONST D2D1_ELLIPSE *ellipse,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawGeometry)(
- __in ID2D1Geometry *geometry,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- ) PURE;
-
- STDMETHOD_(void, FillGeometry)(
- __in ID2D1Geometry *geometry,
- __in ID2D1Brush *brush,
-
- //
- // An optionally specified opacity brush. Only the alpha channel of the
- // corresponding brush will be sampled and will be applied to the entire fill of
- // the geometry. If this brush is specified, the fill brush must be a bitmap brush
- // with an extend mode of D2D1_EXTEND_MODE_CLAMP.
- //
- __in_opt ID2D1Brush *opacityBrush = NULL
- ) PURE;
-
-
- //
- // Fill a mesh. Since meshes can only render aliased content, the render target
- // antialiasing mode must be set to aliased.
- //
- STDMETHOD_(void, FillMesh)(
- __in ID2D1Mesh *mesh,
- __in ID2D1Brush *brush
- ) PURE;
-
-
- //
- // Fill using the opacity channel of the supplied bitmap as a mask. The alpha
- // channel of the bitmap is used to represent the coverage of the geometry at each
- // pixel, and this is filled appropriately with the brush. The render target
- // antialiasing mode must be set to aliased.
- //
- STDMETHOD_(void, FillOpacityMask)(
- __in ID2D1Bitmap *opacityMask,
- __in ID2D1Brush *brush,
- D2D1_OPACITY_MASK_CONTENT content,
- __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL,
- __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
- ) PURE;
-
- STDMETHOD_(void, DrawBitmap)(
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL,
- FLOAT opacity = 1.0f,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
- __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
- ) PURE;
-
-
- //
- // Draws the text within the given layout rectangle and by default also snaps and
- // clips it to the content bounds.
- //
- STDMETHOD_(void, DrawText)(
- __in_ecount(stringLength) CONST WCHAR *string,
- UINT stringLength,
- __in IDWriteTextFormat *textFormat,
- __in CONST D2D1_RECT_F *layoutRect,
- __in ID2D1Brush *defaultForegroundBrush,
- D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE,
- DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
- ) PURE;
-
-
- //
- // Draw a snapped text layout object. Since the layout is not subsequently changed,
- // this can be more effecient than DrawText when drawing the same layout
- // repeatedly.
- //
- STDMETHOD_(void, DrawTextLayout)(
- D2D1_POINT_2F origin,
- __in IDWriteTextLayout *textLayout,
- __in ID2D1Brush *defaultForegroundBrush,
-
- //
- // The specified text options. NOTE: By default the text is clipped to the layout
- // bounds. This is derived from the origin and the layout bounds of the
- // corresponding IDWriteTextLayout object.
- //
- D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE
- ) PURE;
-
- STDMETHOD_(void, DrawGlyphRun)(
- D2D1_POINT_2F baselineOrigin,
- __in CONST DWRITE_GLYPH_RUN *glyphRun,
- __in ID2D1Brush *foregroundBrush,
- DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
- ) PURE;
-
- STDMETHOD_(void, SetTransform)(
- __in CONST D2D1_MATRIX_3X2_F *transform
- ) PURE;
-
- STDMETHOD_(void, GetTransform)(
- __out D2D1_MATRIX_3X2_F *transform
- ) CONST PURE;
-
- STDMETHOD_(void, SetAntialiasMode)(
- D2D1_ANTIALIAS_MODE antialiasMode
- ) PURE;
-
- STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)(
- ) CONST PURE;
-
- STDMETHOD_(void, SetTextAntialiasMode)(
- D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
- ) PURE;
-
- STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)(
- ) CONST PURE;
-
- STDMETHOD_(void, SetTextRenderingParams)(
- __in_opt IDWriteRenderingParams *textRenderingParams = NULL
- ) PURE;
-
-
- //
- // Retrieve the text render parameters. NOTE: If NULL is specified to
- // SetTextRenderingParameters, NULL will be returned.
- //
- STDMETHOD_(void, GetTextRenderingParams)(
- __deref_out_opt IDWriteRenderingParams **textRenderingParams
- ) CONST PURE;
-
-
- //
- // Set a tag to correspond to the succeeding primitives. If an error occurs
- // rendering a primtive, the tags can be returned from the Flush or EndDraw call.
- //
- STDMETHOD_(void, SetTags)(
- D2D1_TAG tag1,
- D2D1_TAG tag2
- ) PURE;
-
-
- //
- // Retrieves the currently set tags. This does not retrieve the tags corresponding
- // to any primitive that is in error.
- //
- STDMETHOD_(void, GetTags)(
- __out_opt D2D1_TAG *tag1 = NULL,
- __out_opt D2D1_TAG *tag2 = NULL
- ) CONST PURE;
-
-
- //
- // Start a layer of drawing calls. The way in which the layer must be resolved is
- // specified first as well as the logical resource that stores the layer
- // parameters. The supplied layer resource might grow if the specified content
- // cannot fit inside it. The layer will grow monitonically on each axis.
- //
- STDMETHOD_(void, PushLayer)(
- __in CONST D2D1_LAYER_PARAMETERS *layerParameters,
- __in ID2D1Layer *layer
- ) PURE;
-
-
- //
- // Ends a layer that was defined with particular layer resources.
- //
- STDMETHOD_(void, PopLayer)(
- ) PURE;
-
- STDMETHOD(Flush)(
- __out_opt D2D1_TAG *tag1 = NULL,
- __out_opt D2D1_TAG *tag2 = NULL
- ) PURE;
-
-
- //
- // Gets the current drawing state and saves it into the supplied
- // IDrawingStatckBlock.
- //
- STDMETHOD_(void, SaveDrawingState)(
- __inout ID2D1DrawingStateBlock *drawingStateBlock
- ) CONST PURE;
-
-
- //
- // Copies the state stored in the block interface.
- //
- STDMETHOD_(void, RestoreDrawingState)(
- __in ID2D1DrawingStateBlock *drawingStateBlock
- ) PURE;
-
-
- //
- // Pushes a clip. The clip can be antialiased. The clip must be axis aligned. If
- // the current world transform is not axis preserving, then the bounding box of the
- // transformed clip rect will be used. The clip will remain in effect until a
- // PopAxisAligned clip call is made.
- //
- STDMETHOD_(void, PushAxisAlignedClip)(
- __in CONST D2D1_RECT_F *clipRect,
- D2D1_ANTIALIAS_MODE antialiasMode
- ) PURE;
-
- STDMETHOD_(void, PopAxisAlignedClip)(
- ) PURE;
-
- STDMETHOD_(void, Clear)(
- __in_opt CONST D2D1_COLOR_F *clearColor = NULL
- ) PURE;
-
-
- //
- // Start drawing on this render target. Draw calls can only be issued between a
- // BeginDraw and EndDraw call.
- //
- STDMETHOD_(void, BeginDraw)(
- ) PURE;
-
-
- //
- // Ends drawing on the render target, error results can be retrieved at this time,
- // or when calling flush.
- //
- STDMETHOD(EndDraw)(
- __out_opt D2D1_TAG *tag1 = NULL,
- __out_opt D2D1_TAG *tag2 = NULL
- ) PURE;
-
- STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
- ) CONST PURE;
-
-
- //
- // Sets the DPI on the render target. This results in the render target being
- // interpretted to a different scale. Neither DPI can be negative. If zero is
- // specified for both, the system DPI is chosen. If one is zero and the other
- // unspecified, the DPI is not changed.
- //
- STDMETHOD_(void, SetDpi)(
- FLOAT dpiX,
- FLOAT dpiY
- ) PURE;
-
-
- //
- // Return the current DPI from the target.
- //
- STDMETHOD_(void, GetDpi)(
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) CONST PURE;
-
-
- //
- // Returns the size of the render target in DIPs.
- //
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ) CONST PURE;
-
-
- //
- // Returns the size of the render target in pixels.
- //
- STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
- ) CONST PURE;
-
-
- //
- // Returns the maximum bitmap and render target size that is guaranteed to be
- // supported by the render target.
- //
- STDMETHOD_(UINT32, GetMaximumBitmapSize)(
- ) CONST PURE;
-
-
- //
- // Returns true if the given properties are supported by this render target. The
- // DPI is ignored. NOTE: If the render target type is software, then neither
- // D2D1_FEATURE_LEVEL_9 nor D2D1_FEATURE_LEVEL_10 will be considered to be
- // supported.
- //
- STDMETHOD_(BOOL, IsSupported)(
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties
- ) CONST PURE;
-
- HRESULT
- CreateBitmap(
- D2D1_SIZE_U size,
- __in_opt CONST void *srcData,
- UINT32 pitch,
- CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- )
- {
- return CreateBitmap(size, srcData, pitch, &bitmapProperties, bitmap);
- }
-
- HRESULT
- CreateBitmap(
- D2D1_SIZE_U size,
- CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- )
- {
- return CreateBitmap(size, NULL, 0, &bitmapProperties, bitmap);
- }
-
-
- //
- // Create a D2D bitmap by copying a WIC bitmap.
- //
- HRESULT
- CreateBitmapFromWicBitmap(
- __in IWICBitmapSource *wicBitmapSource,
- CONST D2D1_BITMAP_PROPERTIES &bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- )
- {
- return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap);
- }
-
-
- //
- // Create a D2D bitmap by copying a WIC bitmap.
- //
- HRESULT
- CreateBitmapFromWicBitmap(
- __in IWICBitmapSource *wicBitmapSource,
- __deref_out ID2D1Bitmap **bitmap
- )
- {
- return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap);
- }
-
-
- //
- // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
- // or pen a geometry.
- //
- HRESULT
- CreateBitmapBrush(
- __in ID2D1Bitmap *bitmap,
- __deref_out ID2D1BitmapBrush **bitmapBrush
- )
- {
- return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush);
- }
-
-
- //
- // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
- // or pen a geometry.
- //
- HRESULT
- CreateBitmapBrush(
- __in ID2D1Bitmap *bitmap,
- CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties,
- __deref_out ID2D1BitmapBrush **bitmapBrush
- )
- {
- return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush);
- }
-
-
- //
- // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill
- // or pen a geometry.
- //
- HRESULT
- CreateBitmapBrush(
- __in ID2D1Bitmap *bitmap,
- CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties,
- CONST D2D1_BRUSH_PROPERTIES &brushProperties,
- __deref_out ID2D1BitmapBrush **bitmapBrush
- )
- {
- return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush);
- }
-
- HRESULT
- CreateSolidColorBrush(
- CONST D2D1_COLOR_F &color,
- __deref_out ID2D1SolidColorBrush **solidColorBrush
- )
- {
- return CreateSolidColorBrush(&color, NULL, solidColorBrush);
- }
-
- HRESULT
- CreateSolidColorBrush(
- CONST D2D1_COLOR_F &color,
- CONST D2D1_BRUSH_PROPERTIES &brushProperties,
- __deref_out ID2D1SolidColorBrush **solidColorBrush
- )
- {
- return CreateSolidColorBrush(&color, &brushProperties, solidColorBrush);
- }
-
- HRESULT
- CreateGradientStopCollection(
- __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
- UINT gradientStopsCount,
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- )
- {
- return CreateGradientStopCollection(gradientStops, gradientStopsCount, D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, gradientStopCollection);
- }
-
- HRESULT
- CreateLinearGradientBrush(
- CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1LinearGradientBrush **linearGradientBrush
- )
- {
- return CreateLinearGradientBrush(&linearGradientBrushProperties, NULL, gradientStopCollection, linearGradientBrush);
- }
-
- HRESULT
- CreateLinearGradientBrush(
- CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties,
- CONST D2D1_BRUSH_PROPERTIES &brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1LinearGradientBrush **linearGradientBrush
- )
- {
- return CreateLinearGradientBrush(&linearGradientBrushProperties, &brushProperties, gradientStopCollection, linearGradientBrush);
- }
-
- HRESULT
- CreateRadialGradientBrush(
- CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1RadialGradientBrush **radialGradientBrush
- )
- {
- return CreateRadialGradientBrush(&radialGradientBrushProperties, NULL, gradientStopCollection, radialGradientBrush);
- }
-
- HRESULT
- CreateRadialGradientBrush(
- CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties,
- CONST D2D1_BRUSH_PROPERTIES &brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1RadialGradientBrush **radialGradientBrush
- )
- {
- return CreateRadialGradientBrush(&radialGradientBrushProperties, &brushProperties, gradientStopCollection, radialGradientBrush);
- }
-
- HRESULT
- CreateCompatibleRenderTarget(
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- )
- {
- return CreateCompatibleRenderTarget(NULL, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
- }
-
- HRESULT
- CreateCompatibleRenderTarget(
- D2D1_SIZE_F desiredSize,
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- )
- {
- return CreateCompatibleRenderTarget(&desiredSize, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
- }
-
- HRESULT
- CreateCompatibleRenderTarget(
- D2D1_SIZE_F desiredSize,
- D2D1_SIZE_U desiredPixelSize,
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- )
- {
- return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
- }
-
- HRESULT
- CreateCompatibleRenderTarget(
- D2D1_SIZE_F desiredSize,
- D2D1_SIZE_U desiredPixelSize,
- D2D1_PIXEL_FORMAT desiredFormat,
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- )
- {
- return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget);
- }
-
- HRESULT
- CreateCompatibleRenderTarget(
- D2D1_SIZE_F desiredSize,
- D2D1_SIZE_U desiredPixelSize,
- D2D1_PIXEL_FORMAT desiredFormat,
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- )
- {
- return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget);
- }
-
- HRESULT
- CreateLayer(
- D2D1_SIZE_F size,
- __deref_out ID2D1Layer **layer
- )
- {
- return CreateLayer(&size, layer);
- }
-
- HRESULT
- CreateLayer(
- __deref_out ID2D1Layer **layer
- )
- {
- return CreateLayer(NULL, layer);
- }
-
- void
- DrawRectangle(
- CONST D2D1_RECT_F &rect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- )
- {
- DrawRectangle(&rect, brush, strokeWidth, strokeStyle);
- }
-
- void
- FillRectangle(
- CONST D2D1_RECT_F &rect,
- __in ID2D1Brush *brush
- )
- {
- FillRectangle(&rect, brush);
- }
-
- void
- DrawRoundedRectangle(
- CONST D2D1_ROUNDED_RECT &roundedRect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- )
- {
- DrawRoundedRectangle(&roundedRect, brush, strokeWidth, strokeStyle);
- }
-
- void
- FillRoundedRectangle(
- CONST D2D1_ROUNDED_RECT &roundedRect,
- __in ID2D1Brush *brush
- )
- {
- FillRoundedRectangle(&roundedRect, brush);
- }
-
- void
- DrawEllipse(
- CONST D2D1_ELLIPSE &ellipse,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth = 1.0f,
- __in_opt ID2D1StrokeStyle *strokeStyle = NULL
- )
- {
- DrawEllipse(&ellipse, brush, strokeWidth, strokeStyle);
- }
-
- void
- FillEllipse(
- CONST D2D1_ELLIPSE &ellipse,
- __in ID2D1Brush *brush
- )
- {
- FillEllipse(&ellipse, brush);
- }
-
- void
- FillOpacityMask(
- __in ID2D1Bitmap *opacityMask,
- __in ID2D1Brush *brush,
- D2D1_OPACITY_MASK_CONTENT content,
- CONST D2D1_RECT_F &destinationRectangle,
- CONST D2D1_RECT_F &sourceRectangle
- )
- {
- FillOpacityMask(opacityMask, brush, content, &destinationRectangle, &sourceRectangle);
- }
-
- void
- DrawBitmap(
- __in ID2D1Bitmap *bitmap,
- CONST D2D1_RECT_F &destinationRectangle,
- FLOAT opacity = 1.0f,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
- __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL
- )
- {
- DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle);
- }
-
- void
- DrawBitmap(
- __in ID2D1Bitmap *bitmap,
- CONST D2D1_RECT_F &destinationRectangle,
- FLOAT opacity,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
- CONST D2D1_RECT_F &sourceRectangle
- )
- {
- DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle);
- }
-
- void
- SetTransform(
- CONST D2D1_MATRIX_3X2_F &transform
- )
- {
- SetTransform(&transform);
- }
-
- void
- PushLayer(
- CONST D2D1_LAYER_PARAMETERS &layerParameters,
- __in ID2D1Layer *layer
- )
- {
- PushLayer(&layerParameters, layer);
- }
-
- void
- PushAxisAlignedClip(
- CONST D2D1_RECT_F &clipRect,
- D2D1_ANTIALIAS_MODE antialiasMode
- )
- {
- return PushAxisAlignedClip(&clipRect, antialiasMode);
- }
-
- void
- Clear(
- CONST D2D1_COLOR_F &clearColor
- )
- {
- return Clear(&clearColor);
- }
-
-
- //
- // Draws the text within the given layout rectangle and by default also snaps and
- // clips it.
- //
- void
- DrawText(
- __in_ecount(stringLength) CONST WCHAR *string,
- UINT stringLength,
- __in IDWriteTextFormat *textFormat,
- CONST D2D1_RECT_F &layoutRect,
- __in ID2D1Brush *defaultForegroundBrush,
- D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE,
- DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL
- )
- {
- return DrawText(string, stringLength, textFormat, &layoutRect, defaultForegroundBrush, options, measuringMode);
- }
-
- BOOL
- IsSupported(
- CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties
- ) CONST
- {
- return IsSupported(&renderTargetProperties);
- }
-}; // interface ID2D1RenderTarget
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1BitmapRenderTarget
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd90695-12e2-11dc-9fed-001143a055f9") ID2D1BitmapRenderTarget : public ID2D1RenderTarget
-{
-
- STDMETHOD(GetBitmap)(
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-}; // interface ID2D1BitmapRenderTarget
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1HwndRenderTarget
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("2cd90698-12e2-11dc-9fed-001143a055f9") ID2D1HwndRenderTarget : public ID2D1RenderTarget
-{
-
- STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)(
- ) PURE;
-
-
- //
- // Resize the buffer underlying the render target. This operation might fail if
- // there is insufficent video memory or system memory, or if the render target is
- // resized beyond the maximum bitmap size. If the method fails, the render target
- // will be placed in a zombie state and D2DERR_RECREATE_TARGET will be returned
- // from it when EndDraw is called. In addition an appropriate failure result will
- // be returned from Resize.
- //
- STDMETHOD(Resize)(
- __in CONST D2D1_SIZE_U *pixelSize
- ) PURE;
-
- STDMETHOD_(HWND, GetHwnd)(
- ) CONST PURE;
-
- HRESULT
- Resize(
- CONST D2D1_SIZE_U &pixelSize
- )
- {
- return Resize(&pixelSize);
- }
-}; // interface ID2D1HwndRenderTarget
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1GdiInteropRenderTarget
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("e0db51c3-6f77-4bae-b3d5-e47509b35838") ID2D1GdiInteropRenderTarget : public IUnknown
-{
-
- STDMETHOD(GetDC)(
- D2D1_DC_INITIALIZE_MODE mode,
- __out HDC *hdc
- ) PURE;
-
- STDMETHOD(ReleaseDC)(
- __in_opt CONST RECT *update
- ) PURE;
-}; // interface ID2D1GdiInteropRenderTarget
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1DCRenderTarget
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("1c51bc64-de61-46fd-9899-63a5d8f03950") ID2D1DCRenderTarget : public ID2D1RenderTarget
-{
-
- STDMETHOD(BindDC)(
- __in CONST HDC hDC,
- __in CONST RECT *pSubRect
- ) PURE;
-}; // interface ID2D1DCRenderTarget
-
-
-
-//+-----------------------------------------------------------------------------
-//
-// Interface:
-// ID2D1Factory
-//
-// Synopsis:
-// The root factory interface for all of D2D's objects.
-//
-//------------------------------------------------------------------------------
-interface D2D1_DECLARE_INTERFACE("06152247-6f50-465a-9245-118bfd3b6007") ID2D1Factory : public IUnknown
-{
-
-
- //
- // Cause the factory to refresh any system metrics that it might have been snapped
- // on factory creation.
- //
- STDMETHOD(ReloadSystemMetrics)(
- ) PURE;
-
-
- //
- // Retrieves the current desktop DPI. To refresh this, call ReloadSystemMetrics.
- //
- STDMETHOD_(void, GetDesktopDpi)(
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) PURE;
-
- STDMETHOD(CreateRectangleGeometry)(
- __in CONST D2D1_RECT_F *rectangle,
- __deref_out ID2D1RectangleGeometry **rectangleGeometry
- ) PURE;
-
- STDMETHOD(CreateRoundedRectangleGeometry)(
- __in CONST D2D1_ROUNDED_RECT *roundedRectangle,
- __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
- ) PURE;
-
- STDMETHOD(CreateEllipseGeometry)(
- __in CONST D2D1_ELLIPSE *ellipse,
- __deref_out ID2D1EllipseGeometry **ellipseGeometry
- ) PURE;
-
-
- //
- // Create a geometry which holds other geometries.
- //
- STDMETHOD(CreateGeometryGroup)(
- D2D1_FILL_MODE fillMode,
- __in_ecount(geometriesCount) ID2D1Geometry **geometries,
- UINT geometriesCount,
- __deref_out ID2D1GeometryGroup **geometryGroup
- ) PURE;
-
- STDMETHOD(CreateTransformedGeometry)(
- __in ID2D1Geometry *sourceGeometry,
- __in CONST D2D1_MATRIX_3X2_F *transform,
- __deref_out ID2D1TransformedGeometry **transformedGeometry
- ) PURE;
-
-
- //
- // Returns an initially empty path geometry interface. A geometry sink is created
- // off the interface to populate it.
- //
- STDMETHOD(CreatePathGeometry)(
- __deref_out ID2D1PathGeometry **pathGeometry
- ) PURE;
-
-
- //
- // Allows a non-default stroke style to be specified for a given geometry at draw
- // time.
- //
- STDMETHOD(CreateStrokeStyle)(
- __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties,
- __in_ecount_opt(dashesCount) CONST FLOAT *dashes,
- UINT dashesCount,
- __deref_out ID2D1StrokeStyle **strokeStyle
- ) PURE;
-
-
- //
- // Creates a new drawing state block, this can be used in subsequent
- // SaveDrawingState and RestoreDrawingState operations on the render target.
- //
- STDMETHOD(CreateDrawingStateBlock)(
- __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription,
- __in_opt IDWriteRenderingParams *textRenderingParams,
- __deref_out ID2D1DrawingStateBlock **drawingStateBlock
- ) PURE;
-
-
- //
- // Creates a render target which is a source of bitmaps.
- //
- STDMETHOD(CreateWicBitmapRenderTarget)(
- __in IWICBitmap *target,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- ) PURE;
-
-
- //
- // Creates a render target that appears on the display.
- //
- STDMETHOD(CreateHwndRenderTarget)(
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties,
- __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
- ) PURE;
-
-
- //
- // Creates a render target that draws to a DXGI Surface. The device that owns the
- // surface is used for rendering.
- //
- STDMETHOD(CreateDxgiSurfaceRenderTarget)(
- __in IDXGISurface *dxgiSurface,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- ) PURE;
-
-
- //
- // Creates a render target that draws to a GDI device context.
- //
- STDMETHOD(CreateDCRenderTarget)(
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1DCRenderTarget **dcRenderTarget
- ) PURE;
-
- HRESULT
- CreateRectangleGeometry(
- CONST D2D1_RECT_F &rectangle,
- __deref_out ID2D1RectangleGeometry **rectangleGeometry
- )
- {
- return CreateRectangleGeometry(&rectangle, rectangleGeometry);
- }
-
- HRESULT
- CreateRoundedRectangleGeometry(
- CONST D2D1_ROUNDED_RECT &roundedRectangle,
- __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
- )
- {
- return CreateRoundedRectangleGeometry(&roundedRectangle, roundedRectangleGeometry);
- }
-
- HRESULT
- CreateEllipseGeometry(
- CONST D2D1_ELLIPSE &ellipse,
- __deref_out ID2D1EllipseGeometry **ellipseGeometry
- )
- {
- return CreateEllipseGeometry(&ellipse, ellipseGeometry);
- }
-
- HRESULT
- CreateTransformedGeometry(
- __in ID2D1Geometry *sourceGeometry,
- CONST D2D1_MATRIX_3X2_F &transform,
- __deref_out ID2D1TransformedGeometry **transformedGeometry
- )
- {
- return CreateTransformedGeometry(sourceGeometry, &transform, transformedGeometry);
- }
-
- HRESULT
- CreateStrokeStyle(
- CONST D2D1_STROKE_STYLE_PROPERTIES &strokeStyleProperties,
- __in_ecount(dashesCount) CONST FLOAT *dashes,
- UINT dashesCount,
- __deref_out ID2D1StrokeStyle **strokeStyle
- )
- {
- return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle);
- }
-
- HRESULT
- CreateDrawingStateBlock(
- CONST D2D1_DRAWING_STATE_DESCRIPTION &drawingStateDescription,
- __deref_out ID2D1DrawingStateBlock **drawingStateBlock
- )
- {
- return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock);
- }
-
- HRESULT
- CreateDrawingStateBlock(
- __deref_out ID2D1DrawingStateBlock **drawingStateBlock
- )
- {
- return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock);
- }
-
- HRESULT
- CreateWicBitmapRenderTarget(
- __in IWICBitmap *target,
- CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- )
- {
- return CreateWicBitmapRenderTarget(target, &renderTargetProperties, renderTarget);
- }
-
- HRESULT
- CreateHwndRenderTarget(
- CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
- CONST D2D1_HWND_RENDER_TARGET_PROPERTIES &hwndRenderTargetProperties,
- __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
- )
- {
- return CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, hwndRenderTarget);
- }
-
- HRESULT
- CreateDxgiSurfaceRenderTarget(
- __in IDXGISurface *dxgiSurface,
- CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- )
- {
- return CreateDxgiSurfaceRenderTarget(dxgiSurface, &renderTargetProperties, renderTarget);
- }
-}; // interface ID2D1Factory
-
-
-
-#endif
-
-
-EXTERN_C CONST IID IID_ID2D1Resource;
-EXTERN_C CONST IID IID_ID2D1Bitmap;
-EXTERN_C CONST IID IID_ID2D1GradientStopCollection;
-EXTERN_C CONST IID IID_ID2D1Brush;
-EXTERN_C CONST IID IID_ID2D1BitmapBrush;
-EXTERN_C CONST IID IID_ID2D1SolidColorBrush;
-EXTERN_C CONST IID IID_ID2D1LinearGradientBrush;
-EXTERN_C CONST IID IID_ID2D1RadialGradientBrush;
-EXTERN_C CONST IID IID_ID2D1StrokeStyle;
-EXTERN_C CONST IID IID_ID2D1Geometry;
-EXTERN_C CONST IID IID_ID2D1RectangleGeometry;
-EXTERN_C CONST IID IID_ID2D1RoundedRectangleGeometry;
-EXTERN_C CONST IID IID_ID2D1EllipseGeometry;
-EXTERN_C CONST IID IID_ID2D1GeometryGroup;
-EXTERN_C CONST IID IID_ID2D1TransformedGeometry;
-EXTERN_C CONST IID IID_ID2D1SimplifiedGeometrySink;
-EXTERN_C CONST IID IID_ID2D1GeometrySink;
-EXTERN_C CONST IID IID_ID2D1TessellationSink;
-EXTERN_C CONST IID IID_ID2D1PathGeometry;
-EXTERN_C CONST IID IID_ID2D1Mesh;
-EXTERN_C CONST IID IID_ID2D1Layer;
-EXTERN_C CONST IID IID_ID2D1DrawingStateBlock;
-EXTERN_C CONST IID IID_ID2D1RenderTarget;
-EXTERN_C CONST IID IID_ID2D1BitmapRenderTarget;
-EXTERN_C CONST IID IID_ID2D1HwndRenderTarget;
-EXTERN_C CONST IID IID_ID2D1GdiInteropRenderTarget;
-EXTERN_C CONST IID IID_ID2D1DCRenderTarget;
-EXTERN_C CONST IID IID_ID2D1Factory;
-
-
-#ifdef D2D_USE_C_DEFINITIONS
-
-
-typedef interface ID2D1Resource ID2D1Resource;
-
-typedef struct ID2D1ResourceVtbl
-{
-
- IUnknownVtbl Base;
-
-
- STDMETHOD_(void, GetFactory)(
- ID2D1Resource *This,
- __deref_out ID2D1Factory **factory
- ) PURE;
-} ID2D1ResourceVtbl;
-
-interface ID2D1Resource
-{
- CONST struct ID2D1ResourceVtbl *lpVtbl;
-};
-
-
-#define ID2D1Resource_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Resource_AddRef(This) \
- ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
-
-#define ID2D1Resource_Release(This) \
- ((This)->lpVtbl->Base.Release((IUnknown *)This))
-
-#define ID2D1Resource_GetFactory(This, factory) \
- ((This)->lpVtbl->GetFactory(This, factory))
-
-typedef interface ID2D1Bitmap ID2D1Bitmap;
-
-typedef struct ID2D1BitmapVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ID2D1Bitmap *This
- ) PURE;
-
- STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
- ID2D1Bitmap *This
- ) PURE;
-
- STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
- ID2D1Bitmap *This
- ) PURE;
-
- STDMETHOD_(void, GetDpi)(
- ID2D1Bitmap *This,
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) PURE;
-
- STDMETHOD(CopyFromBitmap)(
- ID2D1Bitmap *This,
- __in_opt CONST D2D1_POINT_2U *destPoint,
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_RECT_U *srcRect
- ) PURE;
-
- STDMETHOD(CopyFromRenderTarget)(
- ID2D1Bitmap *This,
- __in_opt CONST D2D1_POINT_2U *destPoint,
- __in ID2D1RenderTarget *renderTarget,
- __in_opt CONST D2D1_RECT_U *srcRect
- ) PURE;
-
- STDMETHOD(CopyFromMemory)(
- ID2D1Bitmap *This,
- __in_opt CONST D2D1_RECT_U *dstRect,
- __in CONST void *srcData,
- UINT32 pitch
- ) PURE;
-} ID2D1BitmapVtbl;
-
-interface ID2D1Bitmap
-{
- CONST struct ID2D1BitmapVtbl *lpVtbl;
-};
-
-
-#define ID2D1Bitmap_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Bitmap_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1Bitmap_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1Bitmap_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1Bitmap_GetSize(This) \
- ((This)->lpVtbl->GetSize(This))
-
-#define ID2D1Bitmap_GetPixelSize(This) \
- ((This)->lpVtbl->GetPixelSize(This))
-
-#define ID2D1Bitmap_GetPixelFormat(This) \
- ((This)->lpVtbl->GetPixelFormat(This))
-
-#define ID2D1Bitmap_GetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->GetDpi(This, dpiX, dpiY))
-
-#define ID2D1Bitmap_CopyFromBitmap(This, destPoint, bitmap, srcRect) \
- ((This)->lpVtbl->CopyFromBitmap(This, destPoint, bitmap, srcRect))
-
-#define ID2D1Bitmap_CopyFromRenderTarget(This, destPoint, renderTarget, srcRect) \
- ((This)->lpVtbl->CopyFromRenderTarget(This, destPoint, renderTarget, srcRect))
-
-#define ID2D1Bitmap_CopyFromMemory(This, dstRect, srcData, pitch) \
- ((This)->lpVtbl->CopyFromMemory(This, dstRect, srcData, pitch))
-
-typedef interface ID2D1GradientStopCollection ID2D1GradientStopCollection;
-
-typedef struct ID2D1GradientStopCollectionVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(UINT32, GetGradientStopCount)(
- ID2D1GradientStopCollection *This
- ) PURE;
-
- STDMETHOD_(void, GetGradientStops)(
- ID2D1GradientStopCollection *This,
- __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops,
- UINT gradientStopsCount
- ) PURE;
-
- STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)(
- ID2D1GradientStopCollection *This
- ) PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)(
- ID2D1GradientStopCollection *This
- ) PURE;
-} ID2D1GradientStopCollectionVtbl;
-
-interface ID2D1GradientStopCollection
-{
- CONST struct ID2D1GradientStopCollectionVtbl *lpVtbl;
-};
-
-
-#define ID2D1GradientStopCollection_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1GradientStopCollection_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1GradientStopCollection_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1GradientStopCollection_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1GradientStopCollection_GetGradientStopCount(This) \
- ((This)->lpVtbl->GetGradientStopCount(This))
-
-#define ID2D1GradientStopCollection_GetGradientStops(This, gradientStops, gradientStopsCount) \
- ((This)->lpVtbl->GetGradientStops(This, gradientStops, gradientStopsCount))
-
-#define ID2D1GradientStopCollection_GetColorInterpolationGamma(This) \
- ((This)->lpVtbl->GetColorInterpolationGamma(This))
-
-#define ID2D1GradientStopCollection_GetExtendMode(This) \
- ((This)->lpVtbl->GetExtendMode(This))
-
-typedef interface ID2D1Brush ID2D1Brush;
-
-typedef struct ID2D1BrushVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(void, SetOpacity)(
- ID2D1Brush *This,
- FLOAT opacity
- ) PURE;
-
- STDMETHOD_(void, SetTransform)(
- ID2D1Brush *This,
- __in CONST D2D1_MATRIX_3X2_F *transform
- ) PURE;
-
- STDMETHOD_(FLOAT, GetOpacity)(
- ID2D1Brush *This
- ) PURE;
-
- STDMETHOD_(void, GetTransform)(
- ID2D1Brush *This,
- __out D2D1_MATRIX_3X2_F *transform
- ) PURE;
-} ID2D1BrushVtbl;
-
-interface ID2D1Brush
-{
- CONST struct ID2D1BrushVtbl *lpVtbl;
-};
-
-
-#define ID2D1Brush_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Brush_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1Brush_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1Brush_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1Brush_SetOpacity(This, opacity) \
- ((This)->lpVtbl->SetOpacity(This, opacity))
-
-#define ID2D1Brush_SetTransform(This, transform) \
- ((This)->lpVtbl->SetTransform(This, transform))
-
-#define ID2D1Brush_GetOpacity(This) \
- ((This)->lpVtbl->GetOpacity(This))
-
-#define ID2D1Brush_GetTransform(This, transform) \
- ((This)->lpVtbl->GetTransform(This, transform))
-
-typedef interface ID2D1BitmapBrush ID2D1BitmapBrush;
-
-typedef struct ID2D1BitmapBrushVtbl
-{
-
- ID2D1BrushVtbl Base;
-
-
- STDMETHOD_(void, SetExtendModeX)(
- ID2D1BitmapBrush *This,
- D2D1_EXTEND_MODE extendModeX
- ) PURE;
-
- STDMETHOD_(void, SetExtendModeY)(
- ID2D1BitmapBrush *This,
- D2D1_EXTEND_MODE extendModeY
- ) PURE;
-
- STDMETHOD_(void, SetInterpolationMode)(
- ID2D1BitmapBrush *This,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode
- ) PURE;
-
- STDMETHOD_(void, SetBitmap)(
- ID2D1BitmapBrush *This,
- __in ID2D1Bitmap *bitmap
- ) PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)(
- ID2D1BitmapBrush *This
- ) PURE;
-
- STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)(
- ID2D1BitmapBrush *This
- ) PURE;
-
- STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)(
- ID2D1BitmapBrush *This
- ) PURE;
-
- STDMETHOD_(void, GetBitmap)(
- ID2D1BitmapBrush *This,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-} ID2D1BitmapBrushVtbl;
-
-interface ID2D1BitmapBrush
-{
- CONST struct ID2D1BitmapBrushVtbl *lpVtbl;
-};
-
-
-#define ID2D1BitmapBrush_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1BitmapBrush_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1BitmapBrush_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1BitmapBrush_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1BitmapBrush_SetOpacity(This, opacity) \
- ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
-
-#define ID2D1BitmapBrush_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1BitmapBrush_GetOpacity(This) \
- ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
-
-#define ID2D1BitmapBrush_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1BitmapBrush_SetExtendModeX(This, extendModeX) \
- ((This)->lpVtbl->SetExtendModeX(This, extendModeX))
-
-#define ID2D1BitmapBrush_SetExtendModeY(This, extendModeY) \
- ((This)->lpVtbl->SetExtendModeY(This, extendModeY))
-
-#define ID2D1BitmapBrush_SetInterpolationMode(This, interpolationMode) \
- ((This)->lpVtbl->SetInterpolationMode(This, interpolationMode))
-
-#define ID2D1BitmapBrush_SetBitmap(This, bitmap) \
- ((This)->lpVtbl->SetBitmap(This, bitmap))
-
-#define ID2D1BitmapBrush_GetExtendModeX(This) \
- ((This)->lpVtbl->GetExtendModeX(This))
-
-#define ID2D1BitmapBrush_GetExtendModeY(This) \
- ((This)->lpVtbl->GetExtendModeY(This))
-
-#define ID2D1BitmapBrush_GetInterpolationMode(This) \
- ((This)->lpVtbl->GetInterpolationMode(This))
-
-#define ID2D1BitmapBrush_GetBitmap(This, bitmap) \
- ((This)->lpVtbl->GetBitmap(This, bitmap))
-
-typedef interface ID2D1SolidColorBrush ID2D1SolidColorBrush;
-
-typedef struct ID2D1SolidColorBrushVtbl
-{
-
- ID2D1BrushVtbl Base;
-
-
- STDMETHOD_(void, SetColor)(
- ID2D1SolidColorBrush *This,
- __in CONST D2D1_COLOR_F *color
- ) PURE;
-
- STDMETHOD_(D2D1_COLOR_F, GetColor)(
- ID2D1SolidColorBrush *This
- ) PURE;
-} ID2D1SolidColorBrushVtbl;
-
-interface ID2D1SolidColorBrush
-{
- CONST struct ID2D1SolidColorBrushVtbl *lpVtbl;
-};
-
-
-#define ID2D1SolidColorBrush_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1SolidColorBrush_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1SolidColorBrush_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1SolidColorBrush_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1SolidColorBrush_SetOpacity(This, opacity) \
- ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
-
-#define ID2D1SolidColorBrush_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1SolidColorBrush_GetOpacity(This) \
- ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
-
-#define ID2D1SolidColorBrush_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1SolidColorBrush_SetColor(This, color) \
- ((This)->lpVtbl->SetColor(This, color))
-
-#define ID2D1SolidColorBrush_GetColor(This) \
- ((This)->lpVtbl->GetColor(This))
-
-typedef interface ID2D1LinearGradientBrush ID2D1LinearGradientBrush;
-
-typedef struct ID2D1LinearGradientBrushVtbl
-{
-
- ID2D1BrushVtbl Base;
-
-
- STDMETHOD_(void, SetStartPoint)(
- ID2D1LinearGradientBrush *This,
- D2D1_POINT_2F startPoint
- ) PURE;
-
- STDMETHOD_(void, SetEndPoint)(
- ID2D1LinearGradientBrush *This,
- D2D1_POINT_2F endPoint
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetStartPoint)(
- ID2D1LinearGradientBrush *This
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetEndPoint)(
- ID2D1LinearGradientBrush *This
- ) PURE;
-
- STDMETHOD_(void, GetGradientStopCollection)(
- ID2D1LinearGradientBrush *This,
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) PURE;
-} ID2D1LinearGradientBrushVtbl;
-
-interface ID2D1LinearGradientBrush
-{
- CONST struct ID2D1LinearGradientBrushVtbl *lpVtbl;
-};
-
-
-#define ID2D1LinearGradientBrush_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1LinearGradientBrush_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1LinearGradientBrush_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1LinearGradientBrush_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1LinearGradientBrush_SetOpacity(This, opacity) \
- ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
-
-#define ID2D1LinearGradientBrush_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1LinearGradientBrush_GetOpacity(This) \
- ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
-
-#define ID2D1LinearGradientBrush_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1LinearGradientBrush_SetStartPoint(This, startPoint) \
- ((This)->lpVtbl->SetStartPoint(This, startPoint))
-
-#define ID2D1LinearGradientBrush_SetEndPoint(This, endPoint) \
- ((This)->lpVtbl->SetEndPoint(This, endPoint))
-
-#define ID2D1LinearGradientBrush_GetStartPoint(This) \
- ((This)->lpVtbl->GetStartPoint(This))
-
-#define ID2D1LinearGradientBrush_GetEndPoint(This) \
- ((This)->lpVtbl->GetEndPoint(This))
-
-#define ID2D1LinearGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \
- ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection))
-
-typedef interface ID2D1RadialGradientBrush ID2D1RadialGradientBrush;
-
-typedef struct ID2D1RadialGradientBrushVtbl
-{
-
- ID2D1BrushVtbl Base;
-
-
- STDMETHOD_(void, SetCenter)(
- ID2D1RadialGradientBrush *This,
- D2D1_POINT_2F center
- ) PURE;
-
- STDMETHOD_(void, SetGradientOriginOffset)(
- ID2D1RadialGradientBrush *This,
- D2D1_POINT_2F gradientOriginOffset
- ) PURE;
-
- STDMETHOD_(void, SetRadiusX)(
- ID2D1RadialGradientBrush *This,
- FLOAT radiusX
- ) PURE;
-
- STDMETHOD_(void, SetRadiusY)(
- ID2D1RadialGradientBrush *This,
- FLOAT radiusY
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetCenter)(
- ID2D1RadialGradientBrush *This
- ) PURE;
-
- STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)(
- ID2D1RadialGradientBrush *This
- ) PURE;
-
- STDMETHOD_(FLOAT, GetRadiusX)(
- ID2D1RadialGradientBrush *This
- ) PURE;
-
- STDMETHOD_(FLOAT, GetRadiusY)(
- ID2D1RadialGradientBrush *This
- ) PURE;
-
- STDMETHOD_(void, GetGradientStopCollection)(
- ID2D1RadialGradientBrush *This,
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) PURE;
-} ID2D1RadialGradientBrushVtbl;
-
-interface ID2D1RadialGradientBrush
-{
- CONST struct ID2D1RadialGradientBrushVtbl *lpVtbl;
-};
-
-
-#define ID2D1RadialGradientBrush_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1RadialGradientBrush_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1RadialGradientBrush_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1RadialGradientBrush_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1RadialGradientBrush_SetOpacity(This, opacity) \
- ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity))
-
-#define ID2D1RadialGradientBrush_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1RadialGradientBrush_GetOpacity(This) \
- ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This))
-
-#define ID2D1RadialGradientBrush_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform))
-
-#define ID2D1RadialGradientBrush_SetCenter(This, center) \
- ((This)->lpVtbl->SetCenter(This, center))
-
-#define ID2D1RadialGradientBrush_SetGradientOriginOffset(This, gradientOriginOffset) \
- ((This)->lpVtbl->SetGradientOriginOffset(This, gradientOriginOffset))
-
-#define ID2D1RadialGradientBrush_SetRadiusX(This, radiusX) \
- ((This)->lpVtbl->SetRadiusX(This, radiusX))
-
-#define ID2D1RadialGradientBrush_SetRadiusY(This, radiusY) \
- ((This)->lpVtbl->SetRadiusY(This, radiusY))
-
-#define ID2D1RadialGradientBrush_GetCenter(This) \
- ((This)->lpVtbl->GetCenter(This))
-
-#define ID2D1RadialGradientBrush_GetGradientOriginOffset(This) \
- ((This)->lpVtbl->GetGradientOriginOffset(This))
-
-#define ID2D1RadialGradientBrush_GetRadiusX(This) \
- ((This)->lpVtbl->GetRadiusX(This))
-
-#define ID2D1RadialGradientBrush_GetRadiusY(This) \
- ((This)->lpVtbl->GetRadiusY(This))
-
-#define ID2D1RadialGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \
- ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection))
-
-typedef interface ID2D1StrokeStyle ID2D1StrokeStyle;
-
-typedef struct ID2D1StrokeStyleVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(FLOAT, GetMiterLimit)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(FLOAT, GetDashOffset)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(UINT32, GetDashesCount)(
- ID2D1StrokeStyle *This
- ) PURE;
-
- STDMETHOD_(void, GetDashes)(
- ID2D1StrokeStyle *This,
- __out_ecount(dashesCount) FLOAT *dashes,
- UINT dashesCount
- ) PURE;
-} ID2D1StrokeStyleVtbl;
-
-interface ID2D1StrokeStyle
-{
- CONST struct ID2D1StrokeStyleVtbl *lpVtbl;
-};
-
-
-#define ID2D1StrokeStyle_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1StrokeStyle_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1StrokeStyle_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1StrokeStyle_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1StrokeStyle_GetStartCap(This) \
- ((This)->lpVtbl->GetStartCap(This))
-
-#define ID2D1StrokeStyle_GetEndCap(This) \
- ((This)->lpVtbl->GetEndCap(This))
-
-#define ID2D1StrokeStyle_GetDashCap(This) \
- ((This)->lpVtbl->GetDashCap(This))
-
-#define ID2D1StrokeStyle_GetMiterLimit(This) \
- ((This)->lpVtbl->GetMiterLimit(This))
-
-#define ID2D1StrokeStyle_GetLineJoin(This) \
- ((This)->lpVtbl->GetLineJoin(This))
-
-#define ID2D1StrokeStyle_GetDashOffset(This) \
- ((This)->lpVtbl->GetDashOffset(This))
-
-#define ID2D1StrokeStyle_GetDashStyle(This) \
- ((This)->lpVtbl->GetDashStyle(This))
-
-#define ID2D1StrokeStyle_GetDashesCount(This) \
- ((This)->lpVtbl->GetDashesCount(This))
-
-#define ID2D1StrokeStyle_GetDashes(This, dashes, dashesCount) \
- ((This)->lpVtbl->GetDashes(This, dashes, dashesCount))
-
-typedef interface ID2D1Geometry ID2D1Geometry;
-
-typedef struct ID2D1GeometryVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD(GetBounds)(
- ID2D1Geometry *This,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- __out D2D1_RECT_F *bounds
- ) PURE;
-
- STDMETHOD(GetWidenedBounds)(
- ID2D1Geometry *This,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out D2D1_RECT_F *bounds
- ) PURE;
-
- STDMETHOD(StrokeContainsPoint)(
- ID2D1Geometry *This,
- D2D1_POINT_2F point,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) PURE;
-
- STDMETHOD(FillContainsPoint)(
- ID2D1Geometry *This,
- D2D1_POINT_2F point,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out BOOL *contains
- ) PURE;
-
- STDMETHOD(CompareWithGeometry)(
- ID2D1Geometry *This,
- __in ID2D1Geometry *inputGeometry,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- FLOAT flatteningTolerance,
- __out D2D1_GEOMETRY_RELATION *relation
- ) PURE;
-
- STDMETHOD(Simplify)(
- ID2D1Geometry *This,
- D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) PURE;
-
- STDMETHOD(Tessellate)(
- ID2D1Geometry *This,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1TessellationSink *tessellationSink
- ) PURE;
-
- STDMETHOD(CombineWithGeometry)(
- ID2D1Geometry *This,
- __in ID2D1Geometry *inputGeometry,
- D2D1_COMBINE_MODE combineMode,
- __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) PURE;
-
- STDMETHOD(Outline)(
- ID2D1Geometry *This,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) PURE;
-
- STDMETHOD(ComputeArea)(
- ID2D1Geometry *This,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *area
- ) PURE;
-
- STDMETHOD(ComputeLength)(
- ID2D1Geometry *This,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out FLOAT *length
- ) PURE;
-
- STDMETHOD(ComputePointAtLength)(
- ID2D1Geometry *This,
- FLOAT length,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __out_opt D2D1_POINT_2F *point,
- __out_opt D2D1_POINT_2F *unitTangentVector
- ) PURE;
-
- STDMETHOD(Widen)(
- ID2D1Geometry *This,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle,
- __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform,
- FLOAT flatteningTolerance,
- __in ID2D1SimplifiedGeometrySink *geometrySink
- ) PURE;
-} ID2D1GeometryVtbl;
-
-interface ID2D1Geometry
-{
- CONST struct ID2D1GeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1Geometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Geometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1Geometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1Geometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1Geometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->GetBounds(This, worldTransform, bounds))
-
-#define ID2D1Geometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1Geometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1Geometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1Geometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1Geometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1Geometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Tessellate(This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1Geometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1Geometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Outline(This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1Geometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->ComputeArea(This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1Geometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->ComputeLength(This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1Geometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1Geometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-typedef interface ID2D1RectangleGeometry ID2D1RectangleGeometry;
-
-typedef struct ID2D1RectangleGeometryVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD_(void, GetRect)(
- ID2D1RectangleGeometry *This,
- __out D2D1_RECT_F *rect
- ) PURE;
-} ID2D1RectangleGeometryVtbl;
-
-interface ID2D1RectangleGeometry
-{
- CONST struct ID2D1RectangleGeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1RectangleGeometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1RectangleGeometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1RectangleGeometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1RectangleGeometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1RectangleGeometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1RectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1RectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1RectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1RectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1RectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1RectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1RectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1RectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1RectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RectangleGeometry_GetRect(This, rect) \
- ((This)->lpVtbl->GetRect(This, rect))
-
-typedef interface ID2D1RoundedRectangleGeometry ID2D1RoundedRectangleGeometry;
-
-typedef struct ID2D1RoundedRectangleGeometryVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD_(void, GetRoundedRect)(
- ID2D1RoundedRectangleGeometry *This,
- __out D2D1_ROUNDED_RECT *roundedRect
- ) PURE;
-} ID2D1RoundedRectangleGeometryVtbl;
-
-interface ID2D1RoundedRectangleGeometry
-{
- CONST struct ID2D1RoundedRectangleGeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1RoundedRectangleGeometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1RoundedRectangleGeometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1RoundedRectangleGeometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1RoundedRectangleGeometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1RoundedRectangleGeometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1RoundedRectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1RoundedRectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1RoundedRectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1RoundedRectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1RoundedRectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RoundedRectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1RoundedRectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RoundedRectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RoundedRectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1RoundedRectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1RoundedRectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1RoundedRectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1RoundedRectangleGeometry_GetRoundedRect(This, roundedRect) \
- ((This)->lpVtbl->GetRoundedRect(This, roundedRect))
-
-typedef interface ID2D1EllipseGeometry ID2D1EllipseGeometry;
-
-typedef struct ID2D1EllipseGeometryVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD_(void, GetEllipse)(
- ID2D1EllipseGeometry *This,
- __out D2D1_ELLIPSE *ellipse
- ) PURE;
-} ID2D1EllipseGeometryVtbl;
-
-interface ID2D1EllipseGeometry
-{
- CONST struct ID2D1EllipseGeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1EllipseGeometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1EllipseGeometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1EllipseGeometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1EllipseGeometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1EllipseGeometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1EllipseGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1EllipseGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1EllipseGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1EllipseGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1EllipseGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1EllipseGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1EllipseGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1EllipseGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1EllipseGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1EllipseGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1EllipseGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1EllipseGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1EllipseGeometry_GetEllipse(This, ellipse) \
- ((This)->lpVtbl->GetEllipse(This, ellipse))
-
-typedef interface ID2D1GeometryGroup ID2D1GeometryGroup;
-
-typedef struct ID2D1GeometryGroupVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD_(D2D1_FILL_MODE, GetFillMode)(
- ID2D1GeometryGroup *This
- ) PURE;
-
- STDMETHOD_(UINT32, GetSourceGeometryCount)(
- ID2D1GeometryGroup *This
- ) PURE;
-
- STDMETHOD_(void, GetSourceGeometries)(
- ID2D1GeometryGroup *This,
- __out_ecount(geometriesCount) ID2D1Geometry **geometries,
- UINT geometriesCount
- ) PURE;
-} ID2D1GeometryGroupVtbl;
-
-interface ID2D1GeometryGroup
-{
- CONST struct ID2D1GeometryGroupVtbl *lpVtbl;
-};
-
-
-#define ID2D1GeometryGroup_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1GeometryGroup_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1GeometryGroup_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1GeometryGroup_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1GeometryGroup_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1GeometryGroup_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1GeometryGroup_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1GeometryGroup_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1GeometryGroup_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1GeometryGroup_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1GeometryGroup_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1GeometryGroup_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1GeometryGroup_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1GeometryGroup_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1GeometryGroup_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1GeometryGroup_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1GeometryGroup_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1GeometryGroup_GetFillMode(This) \
- ((This)->lpVtbl->GetFillMode(This))
-
-#define ID2D1GeometryGroup_GetSourceGeometryCount(This) \
- ((This)->lpVtbl->GetSourceGeometryCount(This))
-
-#define ID2D1GeometryGroup_GetSourceGeometries(This, geometries, geometriesCount) \
- ((This)->lpVtbl->GetSourceGeometries(This, geometries, geometriesCount))
-
-typedef interface ID2D1TransformedGeometry ID2D1TransformedGeometry;
-
-typedef struct ID2D1TransformedGeometryVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD_(void, GetSourceGeometry)(
- ID2D1TransformedGeometry *This,
- __deref_out ID2D1Geometry **sourceGeometry
- ) PURE;
-
- STDMETHOD_(void, GetTransform)(
- ID2D1TransformedGeometry *This,
- __out D2D1_MATRIX_3X2_F *transform
- ) PURE;
-} ID2D1TransformedGeometryVtbl;
-
-interface ID2D1TransformedGeometry
-{
- CONST struct ID2D1TransformedGeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1TransformedGeometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1TransformedGeometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1TransformedGeometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1TransformedGeometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1TransformedGeometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1TransformedGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1TransformedGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1TransformedGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1TransformedGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1TransformedGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1TransformedGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1TransformedGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1TransformedGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1TransformedGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1TransformedGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1TransformedGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1TransformedGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1TransformedGeometry_GetSourceGeometry(This, sourceGeometry) \
- ((This)->lpVtbl->GetSourceGeometry(This, sourceGeometry))
-
-#define ID2D1TransformedGeometry_GetTransform(This, transform) \
- ((This)->lpVtbl->GetTransform(This, transform))
-
-typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;
-
-typedef struct ID2D1SimplifiedGeometrySinkVtbl
-{
-
- IUnknownVtbl Base;
-
-
- STDMETHOD_(void, SetFillMode)(
- ID2D1SimplifiedGeometrySink *This,
- D2D1_FILL_MODE fillMode
- ) PURE;
-
- STDMETHOD_(void, SetSegmentFlags)(
- ID2D1SimplifiedGeometrySink *This,
- D2D1_PATH_SEGMENT vertexFlags
- ) PURE;
-
- STDMETHOD_(void, BeginFigure)(
- ID2D1SimplifiedGeometrySink *This,
- D2D1_POINT_2F startPoint,
- D2D1_FIGURE_BEGIN figureBegin
- ) PURE;
-
- STDMETHOD_(void, AddLines)(
- ID2D1SimplifiedGeometrySink *This,
- __in_ecount(pointsCount) CONST D2D1_POINT_2F *points,
- UINT pointsCount
- ) PURE;
-
- STDMETHOD_(void, AddBeziers)(
- ID2D1SimplifiedGeometrySink *This,
- __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers,
- UINT beziersCount
- ) PURE;
-
- STDMETHOD_(void, EndFigure)(
- ID2D1SimplifiedGeometrySink *This,
- D2D1_FIGURE_END figureEnd
- ) PURE;
-
- STDMETHOD(Close)(
- ID2D1SimplifiedGeometrySink *This
- ) PURE;
-} ID2D1SimplifiedGeometrySinkVtbl;
-
-interface ID2D1SimplifiedGeometrySink
-{
- CONST struct ID2D1SimplifiedGeometrySinkVtbl *lpVtbl;
-};
-
-
-#define ID2D1SimplifiedGeometrySink_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1SimplifiedGeometrySink_AddRef(This) \
- ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
-
-#define ID2D1SimplifiedGeometrySink_Release(This) \
- ((This)->lpVtbl->Base.Release((IUnknown *)This))
-
-#define ID2D1SimplifiedGeometrySink_SetFillMode(This, fillMode) \
- ((This)->lpVtbl->SetFillMode(This, fillMode))
-
-#define ID2D1SimplifiedGeometrySink_SetSegmentFlags(This, vertexFlags) \
- ((This)->lpVtbl->SetSegmentFlags(This, vertexFlags))
-
-#define ID2D1SimplifiedGeometrySink_BeginFigure(This, startPoint, figureBegin) \
- ((This)->lpVtbl->BeginFigure(This, startPoint, figureBegin))
-
-#define ID2D1SimplifiedGeometrySink_AddLines(This, points, pointsCount) \
- ((This)->lpVtbl->AddLines(This, points, pointsCount))
-
-#define ID2D1SimplifiedGeometrySink_AddBeziers(This, beziers, beziersCount) \
- ((This)->lpVtbl->AddBeziers(This, beziers, beziersCount))
-
-#define ID2D1SimplifiedGeometrySink_EndFigure(This, figureEnd) \
- ((This)->lpVtbl->EndFigure(This, figureEnd))
-
-#define ID2D1SimplifiedGeometrySink_Close(This) \
- ((This)->lpVtbl->Close(This))
-
-typedef interface ID2D1GeometrySink ID2D1GeometrySink;
-
-typedef struct ID2D1GeometrySinkVtbl
-{
-
- ID2D1SimplifiedGeometrySinkVtbl Base;
-
-
- STDMETHOD_(void, AddLine)(
- ID2D1GeometrySink *This,
- D2D1_POINT_2F point
- ) PURE;
-
- STDMETHOD_(void, AddBezier)(
- ID2D1GeometrySink *This,
- __in CONST D2D1_BEZIER_SEGMENT *bezier
- ) PURE;
-
- STDMETHOD_(void, AddQuadraticBezier)(
- ID2D1GeometrySink *This,
- __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier
- ) PURE;
-
- STDMETHOD_(void, AddQuadraticBeziers)(
- ID2D1GeometrySink *This,
- __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers,
- UINT beziersCount
- ) PURE;
-
- STDMETHOD_(void, AddArc)(
- ID2D1GeometrySink *This,
- __in CONST D2D1_ARC_SEGMENT *arc
- ) PURE;
-} ID2D1GeometrySinkVtbl;
-
-interface ID2D1GeometrySink
-{
- CONST struct ID2D1GeometrySinkVtbl *lpVtbl;
-};
-
-
-#define ID2D1GeometrySink_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1GeometrySink_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1GeometrySink_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1GeometrySink_SetFillMode(This, fillMode) \
- ((This)->lpVtbl->Base.SetFillMode((ID2D1SimplifiedGeometrySink *)This, fillMode))
-
-#define ID2D1GeometrySink_SetSegmentFlags(This, vertexFlags) \
- ((This)->lpVtbl->Base.SetSegmentFlags((ID2D1SimplifiedGeometrySink *)This, vertexFlags))
-
-#define ID2D1GeometrySink_BeginFigure(This, startPoint, figureBegin) \
- ((This)->lpVtbl->Base.BeginFigure((ID2D1SimplifiedGeometrySink *)This, startPoint, figureBegin))
-
-#define ID2D1GeometrySink_AddLines(This, points, pointsCount) \
- ((This)->lpVtbl->Base.AddLines((ID2D1SimplifiedGeometrySink *)This, points, pointsCount))
-
-#define ID2D1GeometrySink_AddBeziers(This, beziers, beziersCount) \
- ((This)->lpVtbl->Base.AddBeziers((ID2D1SimplifiedGeometrySink *)This, beziers, beziersCount))
-
-#define ID2D1GeometrySink_EndFigure(This, figureEnd) \
- ((This)->lpVtbl->Base.EndFigure((ID2D1SimplifiedGeometrySink *)This, figureEnd))
-
-#define ID2D1GeometrySink_Close(This) \
- ((This)->lpVtbl->Base.Close((ID2D1SimplifiedGeometrySink *)This))
-
-#define ID2D1GeometrySink_AddLine(This, point) \
- ((This)->lpVtbl->AddLine(This, point))
-
-#define ID2D1GeometrySink_AddBezier(This, bezier) \
- ((This)->lpVtbl->AddBezier(This, bezier))
-
-#define ID2D1GeometrySink_AddQuadraticBezier(This, bezier) \
- ((This)->lpVtbl->AddQuadraticBezier(This, bezier))
-
-#define ID2D1GeometrySink_AddQuadraticBeziers(This, beziers, beziersCount) \
- ((This)->lpVtbl->AddQuadraticBeziers(This, beziers, beziersCount))
-
-#define ID2D1GeometrySink_AddArc(This, arc) \
- ((This)->lpVtbl->AddArc(This, arc))
-
-typedef interface ID2D1TessellationSink ID2D1TessellationSink;
-
-typedef struct ID2D1TessellationSinkVtbl
-{
-
- IUnknownVtbl Base;
-
-
- STDMETHOD_(void, AddTriangles)(
- ID2D1TessellationSink *This,
- __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles,
- UINT trianglesCount
- ) PURE;
-
- STDMETHOD(Close)(
- ID2D1TessellationSink *This
- ) PURE;
-} ID2D1TessellationSinkVtbl;
-
-interface ID2D1TessellationSink
-{
- CONST struct ID2D1TessellationSinkVtbl *lpVtbl;
-};
-
-
-#define ID2D1TessellationSink_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1TessellationSink_AddRef(This) \
- ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
-
-#define ID2D1TessellationSink_Release(This) \
- ((This)->lpVtbl->Base.Release((IUnknown *)This))
-
-#define ID2D1TessellationSink_AddTriangles(This, triangles, trianglesCount) \
- ((This)->lpVtbl->AddTriangles(This, triangles, trianglesCount))
-
-#define ID2D1TessellationSink_Close(This) \
- ((This)->lpVtbl->Close(This))
-
-typedef interface ID2D1PathGeometry ID2D1PathGeometry;
-
-typedef struct ID2D1PathGeometryVtbl
-{
-
- ID2D1GeometryVtbl Base;
-
-
- STDMETHOD(Open)(
- ID2D1PathGeometry *This,
- __deref_out ID2D1GeometrySink **geometrySink
- ) PURE;
-
- STDMETHOD(Stream)(
- ID2D1PathGeometry *This,
- __in ID2D1GeometrySink *geometrySink
- ) PURE;
-
- STDMETHOD(GetSegmentCount)(
- ID2D1PathGeometry *This,
- __out UINT32 *count
- ) PURE;
-
- STDMETHOD(GetFigureCount)(
- ID2D1PathGeometry *This,
- __out UINT32 *count
- ) PURE;
-} ID2D1PathGeometryVtbl;
-
-interface ID2D1PathGeometry
-{
- CONST struct ID2D1PathGeometryVtbl *lpVtbl;
-};
-
-
-#define ID2D1PathGeometry_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1PathGeometry_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1PathGeometry_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1PathGeometry_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1PathGeometry_GetBounds(This, worldTransform, bounds) \
- ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds))
-
-#define ID2D1PathGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \
- ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds))
-
-#define ID2D1PathGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1PathGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \
- ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains))
-
-#define ID2D1PathGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \
- ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation))
-
-#define ID2D1PathGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1PathGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \
- ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink))
-
-#define ID2D1PathGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1PathGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1PathGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \
- ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area))
-
-#define ID2D1PathGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \
- ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length))
-
-#define ID2D1PathGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \
- ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector))
-
-#define ID2D1PathGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \
- ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink))
-
-#define ID2D1PathGeometry_Open(This, geometrySink) \
- ((This)->lpVtbl->Open(This, geometrySink))
-
-#define ID2D1PathGeometry_Stream(This, geometrySink) \
- ((This)->lpVtbl->Stream(This, geometrySink))
-
-#define ID2D1PathGeometry_GetSegmentCount(This, count) \
- ((This)->lpVtbl->GetSegmentCount(This, count))
-
-#define ID2D1PathGeometry_GetFigureCount(This, count) \
- ((This)->lpVtbl->GetFigureCount(This, count))
-
-typedef interface ID2D1Mesh ID2D1Mesh;
-
-typedef struct ID2D1MeshVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD(Open)(
- ID2D1Mesh *This,
- __deref_out ID2D1TessellationSink **tessellationSink
- ) PURE;
-} ID2D1MeshVtbl;
-
-interface ID2D1Mesh
-{
- CONST struct ID2D1MeshVtbl *lpVtbl;
-};
-
-
-#define ID2D1Mesh_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Mesh_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1Mesh_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1Mesh_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1Mesh_Open(This, tessellationSink) \
- ((This)->lpVtbl->Open(This, tessellationSink))
-
-typedef interface ID2D1Layer ID2D1Layer;
-
-typedef struct ID2D1LayerVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ID2D1Layer *This
- ) PURE;
-} ID2D1LayerVtbl;
-
-interface ID2D1Layer
-{
- CONST struct ID2D1LayerVtbl *lpVtbl;
-};
-
-
-#define ID2D1Layer_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Layer_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1Layer_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1Layer_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1Layer_GetSize(This) \
- ((This)->lpVtbl->GetSize(This))
-
-typedef interface ID2D1DrawingStateBlock ID2D1DrawingStateBlock;
-
-typedef struct ID2D1DrawingStateBlockVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD_(void, GetDescription)(
- ID2D1DrawingStateBlock *This,
- __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
- ) PURE;
-
- STDMETHOD_(void, SetDescription)(
- ID2D1DrawingStateBlock *This,
- __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription
- ) PURE;
-
- STDMETHOD_(void, SetTextRenderingParams)(
- ID2D1DrawingStateBlock *This,
- __in_opt IDWriteRenderingParams *textRenderingParams
- ) PURE;
-
- STDMETHOD_(void, GetTextRenderingParams)(
- ID2D1DrawingStateBlock *This,
- __deref_out_opt IDWriteRenderingParams **textRenderingParams
- ) PURE;
-} ID2D1DrawingStateBlockVtbl;
-
-interface ID2D1DrawingStateBlock
-{
- CONST struct ID2D1DrawingStateBlockVtbl *lpVtbl;
-};
-
-
-#define ID2D1DrawingStateBlock_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1DrawingStateBlock_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1DrawingStateBlock_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1DrawingStateBlock_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1DrawingStateBlock_GetDescription(This, stateDescription) \
- ((This)->lpVtbl->GetDescription(This, stateDescription))
-
-#define ID2D1DrawingStateBlock_SetDescription(This, stateDescription) \
- ((This)->lpVtbl->SetDescription(This, stateDescription))
-
-#define ID2D1DrawingStateBlock_SetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams))
-
-#define ID2D1DrawingStateBlock_GetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams))
-
-typedef interface ID2D1RenderTarget ID2D1RenderTarget;
-
-typedef struct ID2D1RenderTargetVtbl
-{
-
- ID2D1ResourceVtbl Base;
-
-
- STDMETHOD(CreateBitmap)(
- ID2D1RenderTarget *This,
- D2D1_SIZE_U size,
- __in_opt CONST void *srcData,
- UINT32 pitch,
- __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
- STDMETHOD(CreateBitmapFromWicBitmap)(
- ID2D1RenderTarget *This,
- __in IWICBitmapSource *wicBitmapSource,
- __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
- STDMETHOD(CreateSharedBitmap)(
- ID2D1RenderTarget *This,
- __in REFIID riid,
- __inout void *data,
- __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-
- STDMETHOD(CreateBitmapBrush)(
- ID2D1RenderTarget *This,
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __deref_out ID2D1BitmapBrush **bitmapBrush
- ) PURE;
-
- STDMETHOD(CreateSolidColorBrush)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_COLOR_F *color,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __deref_out ID2D1SolidColorBrush **solidColorBrush
- ) PURE;
-
- STDMETHOD(CreateGradientStopCollection)(
- ID2D1RenderTarget *This,
- __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops,
- __range(>=,1) UINT gradientStopsCount,
- D2D1_GAMMA colorInterpolationGamma,
- D2D1_EXTEND_MODE extendMode,
- __deref_out ID2D1GradientStopCollection **gradientStopCollection
- ) PURE;
-
- STDMETHOD(CreateLinearGradientBrush)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1LinearGradientBrush **linearGradientBrush
- ) PURE;
-
- STDMETHOD(CreateRadialGradientBrush)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties,
- __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties,
- __in ID2D1GradientStopCollection *gradientStopCollection,
- __deref_out ID2D1RadialGradientBrush **radialGradientBrush
- ) PURE;
-
- STDMETHOD(CreateCompatibleRenderTarget)(
- ID2D1RenderTarget *This,
- __in_opt CONST D2D1_SIZE_F *desiredSize,
- __in_opt CONST D2D1_SIZE_U *desiredPixelSize,
- __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat,
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
- __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget
- ) PURE;
-
- STDMETHOD(CreateLayer)(
- ID2D1RenderTarget *This,
- __in_opt CONST D2D1_SIZE_F *size,
- __deref_out ID2D1Layer **layer
- ) PURE;
-
- STDMETHOD(CreateMesh)(
- ID2D1RenderTarget *This,
- __deref_out ID2D1Mesh **mesh
- ) PURE;
-
- STDMETHOD_(void, DrawLine)(
- ID2D1RenderTarget *This,
- D2D1_POINT_2F point0,
- D2D1_POINT_2F point1,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle
- ) PURE;
-
- STDMETHOD_(void, DrawRectangle)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_RECT_F *rect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle
- ) PURE;
-
- STDMETHOD_(void, FillRectangle)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_RECT_F *rect,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawRoundedRectangle)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_ROUNDED_RECT *roundedRect,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle
- ) PURE;
-
- STDMETHOD_(void, FillRoundedRectangle)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_ROUNDED_RECT *roundedRect,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawEllipse)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_ELLIPSE *ellipse,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle
- ) PURE;
-
- STDMETHOD_(void, FillEllipse)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_ELLIPSE *ellipse,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, DrawGeometry)(
- ID2D1RenderTarget *This,
- __in ID2D1Geometry *geometry,
- __in ID2D1Brush *brush,
- FLOAT strokeWidth,
- __in_opt ID2D1StrokeStyle *strokeStyle
- ) PURE;
-
- STDMETHOD_(void, FillGeometry)(
- ID2D1RenderTarget *This,
- __in ID2D1Geometry *geometry,
- __in ID2D1Brush *brush,
- __in_opt ID2D1Brush *opacityBrush
- ) PURE;
-
- STDMETHOD_(void, FillMesh)(
- ID2D1RenderTarget *This,
- __in ID2D1Mesh *mesh,
- __in ID2D1Brush *brush
- ) PURE;
-
- STDMETHOD_(void, FillOpacityMask)(
- ID2D1RenderTarget *This,
- __in ID2D1Bitmap *opacityMask,
- __in ID2D1Brush *brush,
- D2D1_OPACITY_MASK_CONTENT content,
- __in_opt CONST D2D1_RECT_F *destinationRectangle,
- __in_opt CONST D2D1_RECT_F *sourceRectangle
- ) PURE;
-
- STDMETHOD_(void, DrawBitmap)(
- ID2D1RenderTarget *This,
- __in ID2D1Bitmap *bitmap,
- __in_opt CONST D2D1_RECT_F *destinationRectangle,
- FLOAT opacity,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
- __in_opt CONST D2D1_RECT_F *sourceRectangle
- ) PURE;
-
- STDMETHOD_(void, DrawText)(
- ID2D1RenderTarget *This,
- __in_ecount(stringLength) CONST WCHAR *string,
- UINT stringLength,
- __in IDWriteTextFormat *textFormat,
- __in CONST D2D1_RECT_F *layoutRect,
- __in ID2D1Brush *defaultForegroundBrush,
- D2D1_DRAW_TEXT_OPTIONS options,
- DWRITE_MEASURING_MODE measuringMode
- ) PURE;
-
- STDMETHOD_(void, DrawTextLayout)(
- ID2D1RenderTarget *This,
- D2D1_POINT_2F origin,
- __in IDWriteTextLayout *textLayout,
- __in ID2D1Brush *defaultForegroundBrush,
- D2D1_DRAW_TEXT_OPTIONS options
- ) PURE;
-
- STDMETHOD_(void, DrawGlyphRun)(
- ID2D1RenderTarget *This,
- D2D1_POINT_2F baselineOrigin,
- __in CONST DWRITE_GLYPH_RUN *glyphRun,
- __in ID2D1Brush *foregroundBrush,
- DWRITE_MEASURING_MODE measuringMode
- ) PURE;
-
- STDMETHOD_(void, SetTransform)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_MATRIX_3X2_F *transform
- ) PURE;
-
- STDMETHOD_(void, GetTransform)(
- ID2D1RenderTarget *This,
- __out D2D1_MATRIX_3X2_F *transform
- ) PURE;
-
- STDMETHOD_(void, SetAntialiasMode)(
- ID2D1RenderTarget *This,
- D2D1_ANTIALIAS_MODE antialiasMode
- ) PURE;
-
- STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(void, SetTextAntialiasMode)(
- ID2D1RenderTarget *This,
- D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
- ) PURE;
-
- STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(void, SetTextRenderingParams)(
- ID2D1RenderTarget *This,
- __in_opt IDWriteRenderingParams *textRenderingParams
- ) PURE;
-
- STDMETHOD_(void, GetTextRenderingParams)(
- ID2D1RenderTarget *This,
- __deref_out_opt IDWriteRenderingParams **textRenderingParams
- ) PURE;
-
- STDMETHOD_(void, SetTags)(
- ID2D1RenderTarget *This,
- D2D1_TAG tag1,
- D2D1_TAG tag2
- ) PURE;
-
- STDMETHOD_(void, GetTags)(
- ID2D1RenderTarget *This,
- __out_opt D2D1_TAG *tag1,
- __out_opt D2D1_TAG *tag2
- ) PURE;
-
- STDMETHOD_(void, PushLayer)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_LAYER_PARAMETERS *layerParameters,
- __in ID2D1Layer *layer
- ) PURE;
-
- STDMETHOD_(void, PopLayer)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD(Flush)(
- ID2D1RenderTarget *This,
- __out_opt D2D1_TAG *tag1,
- __out_opt D2D1_TAG *tag2
- ) PURE;
-
- STDMETHOD_(void, SaveDrawingState)(
- ID2D1RenderTarget *This,
- __inout ID2D1DrawingStateBlock *drawingStateBlock
- ) PURE;
-
- STDMETHOD_(void, RestoreDrawingState)(
- ID2D1RenderTarget *This,
- __in ID2D1DrawingStateBlock *drawingStateBlock
- ) PURE;
-
- STDMETHOD_(void, PushAxisAlignedClip)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_RECT_F *clipRect,
- D2D1_ANTIALIAS_MODE antialiasMode
- ) PURE;
-
- STDMETHOD_(void, PopAxisAlignedClip)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(void, Clear)(
- ID2D1RenderTarget *This,
- __in_opt CONST D2D1_COLOR_F *clearColor
- ) PURE;
-
- STDMETHOD_(void, BeginDraw)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD(EndDraw)(
- ID2D1RenderTarget *This,
- __out_opt D2D1_TAG *tag1,
- __out_opt D2D1_TAG *tag2
- ) PURE;
-
- STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(void, SetDpi)(
- ID2D1RenderTarget *This,
- FLOAT dpiX,
- FLOAT dpiY
- ) PURE;
-
- STDMETHOD_(void, GetDpi)(
- ID2D1RenderTarget *This,
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) PURE;
-
- STDMETHOD_(D2D1_SIZE_F, GetSize)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(D2D1_SIZE_U, GetPixelSize)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(UINT32, GetMaximumBitmapSize)(
- ID2D1RenderTarget *This
- ) PURE;
-
- STDMETHOD_(BOOL, IsSupported)(
- ID2D1RenderTarget *This,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties
- ) PURE;
-} ID2D1RenderTargetVtbl;
-
-interface ID2D1RenderTarget
-{
- CONST struct ID2D1RenderTargetVtbl *lpVtbl;
-};
-
-
-#define ID2D1RenderTarget_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1RenderTarget_AddRef(This) \
- ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1RenderTarget_Release(This) \
- ((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
-
-#define ID2D1RenderTarget_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1RenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
- ((This)->lpVtbl->CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap))
-
-#define ID2D1RenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
- ((This)->lpVtbl->CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap))
-
-#define ID2D1RenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
- ((This)->lpVtbl->CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap))
-
-#define ID2D1RenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
- ((This)->lpVtbl->CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
-
-#define ID2D1RenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
- ((This)->lpVtbl->CreateSolidColorBrush(This, color, brushProperties, solidColorBrush))
-
-#define ID2D1RenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
- ((This)->lpVtbl->CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
-
-#define ID2D1RenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
- ((This)->lpVtbl->CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
-
-#define ID2D1RenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
- ((This)->lpVtbl->CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
-
-#define ID2D1RenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
- ((This)->lpVtbl->CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
-
-#define ID2D1RenderTarget_CreateLayer(This, size, layer) \
- ((This)->lpVtbl->CreateLayer(This, size, layer))
-
-#define ID2D1RenderTarget_CreateMesh(This, mesh) \
- ((This)->lpVtbl->CreateMesh(This, mesh))
-
-#define ID2D1RenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle))
-
-#define ID2D1RenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->DrawRectangle(This, rect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1RenderTarget_FillRectangle(This, rect, brush) \
- ((This)->lpVtbl->FillRectangle(This, rect, brush))
-
-#define ID2D1RenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1RenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
- ((This)->lpVtbl->FillRoundedRectangle(This, roundedRect, brush))
-
-#define ID2D1RenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle))
-
-#define ID2D1RenderTarget_FillEllipse(This, ellipse, brush) \
- ((This)->lpVtbl->FillEllipse(This, ellipse, brush))
-
-#define ID2D1RenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle))
-
-#define ID2D1RenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
- ((This)->lpVtbl->FillGeometry(This, geometry, brush, opacityBrush))
-
-#define ID2D1RenderTarget_FillMesh(This, mesh, brush) \
- ((This)->lpVtbl->FillMesh(This, mesh, brush))
-
-#define ID2D1RenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
- ((This)->lpVtbl->FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
-
-#define ID2D1RenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
- ((This)->lpVtbl->DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
-
-#define ID2D1RenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
- ((This)->lpVtbl->DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
-
-#define ID2D1RenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
- ((This)->lpVtbl->DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options))
-
-#define ID2D1RenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
- ((This)->lpVtbl->DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
-
-#define ID2D1RenderTarget_SetTransform(This, transform) \
- ((This)->lpVtbl->SetTransform(This, transform))
-
-#define ID2D1RenderTarget_GetTransform(This, transform) \
- ((This)->lpVtbl->GetTransform(This, transform))
-
-#define ID2D1RenderTarget_SetAntialiasMode(This, antialiasMode) \
- ((This)->lpVtbl->SetAntialiasMode(This, antialiasMode))
-
-#define ID2D1RenderTarget_GetAntialiasMode(This) \
- ((This)->lpVtbl->GetAntialiasMode(This))
-
-#define ID2D1RenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
- ((This)->lpVtbl->SetTextAntialiasMode(This, textAntialiasMode))
-
-#define ID2D1RenderTarget_GetTextAntialiasMode(This) \
- ((This)->lpVtbl->GetTextAntialiasMode(This))
-
-#define ID2D1RenderTarget_SetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams))
-
-#define ID2D1RenderTarget_GetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams))
-
-#define ID2D1RenderTarget_SetTags(This, tag1, tag2) \
- ((This)->lpVtbl->SetTags(This, tag1, tag2))
-
-#define ID2D1RenderTarget_GetTags(This, tag1, tag2) \
- ((This)->lpVtbl->GetTags(This, tag1, tag2))
-
-#define ID2D1RenderTarget_PushLayer(This, layerParameters, layer) \
- ((This)->lpVtbl->PushLayer(This, layerParameters, layer))
-
-#define ID2D1RenderTarget_PopLayer(This) \
- ((This)->lpVtbl->PopLayer(This))
-
-#define ID2D1RenderTarget_Flush(This, tag1, tag2) \
- ((This)->lpVtbl->Flush(This, tag1, tag2))
-
-#define ID2D1RenderTarget_SaveDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->SaveDrawingState(This, drawingStateBlock))
-
-#define ID2D1RenderTarget_RestoreDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->RestoreDrawingState(This, drawingStateBlock))
-
-#define ID2D1RenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
- ((This)->lpVtbl->PushAxisAlignedClip(This, clipRect, antialiasMode))
-
-#define ID2D1RenderTarget_PopAxisAlignedClip(This) \
- ((This)->lpVtbl->PopAxisAlignedClip(This))
-
-#define ID2D1RenderTarget_Clear(This, clearColor) \
- ((This)->lpVtbl->Clear(This, clearColor))
-
-#define ID2D1RenderTarget_BeginDraw(This) \
- ((This)->lpVtbl->BeginDraw(This))
-
-#define ID2D1RenderTarget_EndDraw(This, tag1, tag2) \
- ((This)->lpVtbl->EndDraw(This, tag1, tag2))
-
-#define ID2D1RenderTarget_GetPixelFormat(This) \
- ((This)->lpVtbl->GetPixelFormat(This))
-
-#define ID2D1RenderTarget_SetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->SetDpi(This, dpiX, dpiY))
-
-#define ID2D1RenderTarget_GetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->GetDpi(This, dpiX, dpiY))
-
-#define ID2D1RenderTarget_GetSize(This) \
- ((This)->lpVtbl->GetSize(This))
-
-#define ID2D1RenderTarget_GetPixelSize(This) \
- ((This)->lpVtbl->GetPixelSize(This))
-
-#define ID2D1RenderTarget_GetMaximumBitmapSize(This) \
- ((This)->lpVtbl->GetMaximumBitmapSize(This))
-
-#define ID2D1RenderTarget_IsSupported(This, renderTargetProperties) \
- ((This)->lpVtbl->IsSupported(This, renderTargetProperties))
-
-typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget;
-
-typedef struct ID2D1BitmapRenderTargetVtbl
-{
-
- ID2D1RenderTargetVtbl Base;
-
-
- STDMETHOD(GetBitmap)(
- ID2D1BitmapRenderTarget *This,
- __deref_out ID2D1Bitmap **bitmap
- ) PURE;
-} ID2D1BitmapRenderTargetVtbl;
-
-interface ID2D1BitmapRenderTarget
-{
- CONST struct ID2D1BitmapRenderTargetVtbl *lpVtbl;
-};
-
-
-#define ID2D1BitmapRenderTarget_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1BitmapRenderTarget_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1BitmapRenderTarget_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1BitmapRenderTarget_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1BitmapRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
-
-#define ID2D1BitmapRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
-
-#define ID2D1BitmapRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
-
-#define ID2D1BitmapRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
- ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
-
-#define ID2D1BitmapRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
- ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
-
-#define ID2D1BitmapRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
- ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
-
-#define ID2D1BitmapRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
- ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
-
-#define ID2D1BitmapRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
- ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
-
-#define ID2D1BitmapRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
- ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
-
-#define ID2D1BitmapRenderTarget_CreateLayer(This, size, layer) \
- ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
-
-#define ID2D1BitmapRenderTarget_CreateMesh(This, mesh) \
- ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
-
-#define ID2D1BitmapRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
-
-#define ID2D1BitmapRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1BitmapRenderTarget_FillRectangle(This, rect, brush) \
- ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
-
-#define ID2D1BitmapRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1BitmapRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
- ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
-
-#define ID2D1BitmapRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
-
-#define ID2D1BitmapRenderTarget_FillEllipse(This, ellipse, brush) \
- ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
-
-#define ID2D1BitmapRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
-
-#define ID2D1BitmapRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
- ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
-
-#define ID2D1BitmapRenderTarget_FillMesh(This, mesh, brush) \
- ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
-
-#define ID2D1BitmapRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
- ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
-
-#define ID2D1BitmapRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
- ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
-
-#define ID2D1BitmapRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
- ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
-
-#define ID2D1BitmapRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
- ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
-
-#define ID2D1BitmapRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
- ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
-
-#define ID2D1BitmapRenderTarget_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1BitmapRenderTarget_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1BitmapRenderTarget_SetAntialiasMode(This, antialiasMode) \
- ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
-
-#define ID2D1BitmapRenderTarget_GetAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
- ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
-
-#define ID2D1BitmapRenderTarget_GetTextAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1BitmapRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1BitmapRenderTarget_SetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1BitmapRenderTarget_GetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1BitmapRenderTarget_PushLayer(This, layerParameters, layer) \
- ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
-
-#define ID2D1BitmapRenderTarget_PopLayer(This) \
- ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_Flush(This, tag1, tag2) \
- ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1BitmapRenderTarget_SaveDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1BitmapRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1BitmapRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
- ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
-
-#define ID2D1BitmapRenderTarget_PopAxisAlignedClip(This) \
- ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_Clear(This, clearColor) \
- ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
-
-#define ID2D1BitmapRenderTarget_BeginDraw(This) \
- ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_EndDraw(This, tag1, tag2) \
- ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1BitmapRenderTarget_GetPixelFormat(This) \
- ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_SetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1BitmapRenderTarget_GetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1BitmapRenderTarget_GetSize(This) \
- ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_GetPixelSize(This) \
- ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_GetMaximumBitmapSize(This) \
- ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
-
-#define ID2D1BitmapRenderTarget_IsSupported(This, renderTargetProperties) \
- ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
-
-#define ID2D1BitmapRenderTarget_GetBitmap(This, bitmap) \
- ((This)->lpVtbl->GetBitmap(This, bitmap))
-
-typedef interface ID2D1HwndRenderTarget ID2D1HwndRenderTarget;
-
-typedef struct ID2D1HwndRenderTargetVtbl
-{
-
- ID2D1RenderTargetVtbl Base;
-
-
- STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)(
- ID2D1HwndRenderTarget *This
- ) PURE;
-
- STDMETHOD(Resize)(
- ID2D1HwndRenderTarget *This,
- __in CONST D2D1_SIZE_U *pixelSize
- ) PURE;
-
- STDMETHOD_(HWND, GetHwnd)(
- ID2D1HwndRenderTarget *This
- ) PURE;
-} ID2D1HwndRenderTargetVtbl;
-
-interface ID2D1HwndRenderTarget
-{
- CONST struct ID2D1HwndRenderTargetVtbl *lpVtbl;
-};
-
-
-#define ID2D1HwndRenderTarget_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1HwndRenderTarget_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1HwndRenderTarget_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1HwndRenderTarget_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1HwndRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
-
-#define ID2D1HwndRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
-
-#define ID2D1HwndRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
-
-#define ID2D1HwndRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
- ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
-
-#define ID2D1HwndRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
- ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
-
-#define ID2D1HwndRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
- ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
-
-#define ID2D1HwndRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
- ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
-
-#define ID2D1HwndRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
- ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
-
-#define ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
- ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
-
-#define ID2D1HwndRenderTarget_CreateLayer(This, size, layer) \
- ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
-
-#define ID2D1HwndRenderTarget_CreateMesh(This, mesh) \
- ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
-
-#define ID2D1HwndRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
-
-#define ID2D1HwndRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1HwndRenderTarget_FillRectangle(This, rect, brush) \
- ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
-
-#define ID2D1HwndRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1HwndRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
- ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
-
-#define ID2D1HwndRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
-
-#define ID2D1HwndRenderTarget_FillEllipse(This, ellipse, brush) \
- ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
-
-#define ID2D1HwndRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
-
-#define ID2D1HwndRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
- ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
-
-#define ID2D1HwndRenderTarget_FillMesh(This, mesh, brush) \
- ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
-
-#define ID2D1HwndRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
- ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
-
-#define ID2D1HwndRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
- ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
-
-#define ID2D1HwndRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
- ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
-
-#define ID2D1HwndRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
- ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
-
-#define ID2D1HwndRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
- ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
-
-#define ID2D1HwndRenderTarget_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1HwndRenderTarget_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1HwndRenderTarget_SetAntialiasMode(This, antialiasMode) \
- ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
-
-#define ID2D1HwndRenderTarget_GetAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
- ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
-
-#define ID2D1HwndRenderTarget_GetTextAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1HwndRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1HwndRenderTarget_SetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1HwndRenderTarget_GetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1HwndRenderTarget_PushLayer(This, layerParameters, layer) \
- ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
-
-#define ID2D1HwndRenderTarget_PopLayer(This) \
- ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_Flush(This, tag1, tag2) \
- ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1HwndRenderTarget_SaveDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1HwndRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1HwndRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
- ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
-
-#define ID2D1HwndRenderTarget_PopAxisAlignedClip(This) \
- ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_Clear(This, clearColor) \
- ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
-
-#define ID2D1HwndRenderTarget_BeginDraw(This) \
- ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_EndDraw(This, tag1, tag2) \
- ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1HwndRenderTarget_GetPixelFormat(This) \
- ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_SetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1HwndRenderTarget_GetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1HwndRenderTarget_GetSize(This) \
- ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_GetPixelSize(This) \
- ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_GetMaximumBitmapSize(This) \
- ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
-
-#define ID2D1HwndRenderTarget_IsSupported(This, renderTargetProperties) \
- ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
-
-#define ID2D1HwndRenderTarget_CheckWindowState(This) \
- ((This)->lpVtbl->CheckWindowState(This))
-
-#define ID2D1HwndRenderTarget_Resize(This, pixelSize) \
- ((This)->lpVtbl->Resize(This, pixelSize))
-
-#define ID2D1HwndRenderTarget_GetHwnd(This) \
- ((This)->lpVtbl->GetHwnd(This))
-
-typedef interface ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget;
-
-typedef struct ID2D1GdiInteropRenderTargetVtbl
-{
-
- IUnknownVtbl Base;
-
-
- STDMETHOD(GetDC)(
- ID2D1GdiInteropRenderTarget *This,
- D2D1_DC_INITIALIZE_MODE mode,
- __out HDC *hdc
- ) PURE;
-
- STDMETHOD(ReleaseDC)(
- ID2D1GdiInteropRenderTarget *This,
- __in_opt CONST RECT *update
- ) PURE;
-} ID2D1GdiInteropRenderTargetVtbl;
-
-interface ID2D1GdiInteropRenderTarget
-{
- CONST struct ID2D1GdiInteropRenderTargetVtbl *lpVtbl;
-};
-
-
-#define ID2D1GdiInteropRenderTarget_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1GdiInteropRenderTarget_AddRef(This) \
- ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
-
-#define ID2D1GdiInteropRenderTarget_Release(This) \
- ((This)->lpVtbl->Base.Release((IUnknown *)This))
-
-#define ID2D1GdiInteropRenderTarget_GetDC(This, mode, hdc) \
- ((This)->lpVtbl->GetDC(This, mode, hdc))
-
-#define ID2D1GdiInteropRenderTarget_ReleaseDC(This, update) \
- ((This)->lpVtbl->ReleaseDC(This, update))
-
-typedef interface ID2D1DCRenderTarget ID2D1DCRenderTarget;
-
-typedef struct ID2D1DCRenderTargetVtbl
-{
-
- ID2D1RenderTargetVtbl Base;
-
-
- STDMETHOD(BindDC)(
- ID2D1DCRenderTarget *This,
- __in CONST HDC hDC,
- __in CONST RECT *pSubRect
- ) PURE;
-} ID2D1DCRenderTargetVtbl;
-
-interface ID2D1DCRenderTarget
-{
- CONST struct ID2D1DCRenderTargetVtbl *lpVtbl;
-};
-
-
-#define ID2D1DCRenderTarget_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1DCRenderTarget_AddRef(This) \
- ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
-
-#define ID2D1DCRenderTarget_Release(This) \
- ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
-
-#define ID2D1DCRenderTarget_GetFactory(This, factory) \
- ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
-
-#define ID2D1DCRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap))
-
-#define ID2D1DCRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap))
-
-#define ID2D1DCRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
- ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
-
-#define ID2D1DCRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
- ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
-
-#define ID2D1DCRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
- ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
-
-#define ID2D1DCRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \
- ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection))
-
-#define ID2D1DCRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
- ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
-
-#define ID2D1DCRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
- ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
-
-#define ID2D1DCRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
- ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
-
-#define ID2D1DCRenderTarget_CreateLayer(This, size, layer) \
- ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
-
-#define ID2D1DCRenderTarget_CreateMesh(This, mesh) \
- ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
-
-#define ID2D1DCRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
-
-#define ID2D1DCRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1DCRenderTarget_FillRectangle(This, rect, brush) \
- ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
-
-#define ID2D1DCRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
-
-#define ID2D1DCRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \
- ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
-
-#define ID2D1DCRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
-
-#define ID2D1DCRenderTarget_FillEllipse(This, ellipse, brush) \
- ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
-
-#define ID2D1DCRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
- ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
-
-#define ID2D1DCRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \
- ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
-
-#define ID2D1DCRenderTarget_FillMesh(This, mesh, brush) \
- ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
-
-#define ID2D1DCRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \
- ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle))
-
-#define ID2D1DCRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \
- ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle))
-
-#define ID2D1DCRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
- ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
-
-#define ID2D1DCRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
- ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
-
-#define ID2D1DCRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \
- ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode))
-
-#define ID2D1DCRenderTarget_SetTransform(This, transform) \
- ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1DCRenderTarget_GetTransform(This, transform) \
- ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform))
-
-#define ID2D1DCRenderTarget_SetAntialiasMode(This, antialiasMode) \
- ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
-
-#define ID2D1DCRenderTarget_GetAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \
- ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
-
-#define ID2D1DCRenderTarget_GetTextAntialiasMode(This) \
- ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_SetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1DCRenderTarget_GetTextRenderingParams(This, textRenderingParams) \
- ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
-
-#define ID2D1DCRenderTarget_SetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1DCRenderTarget_GetTags(This, tag1, tag2) \
- ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1DCRenderTarget_PushLayer(This, layerParameters, layer) \
- ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer))
-
-#define ID2D1DCRenderTarget_PopLayer(This) \
- ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_Flush(This, tag1, tag2) \
- ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1DCRenderTarget_SaveDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1DCRenderTarget_RestoreDrawingState(This, drawingStateBlock) \
- ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
-
-#define ID2D1DCRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \
- ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
-
-#define ID2D1DCRenderTarget_PopAxisAlignedClip(This) \
- ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_Clear(This, clearColor) \
- ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor))
-
-#define ID2D1DCRenderTarget_BeginDraw(This) \
- ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_EndDraw(This, tag1, tag2) \
- ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
-
-#define ID2D1DCRenderTarget_GetPixelFormat(This) \
- ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_SetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1DCRenderTarget_GetDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
-
-#define ID2D1DCRenderTarget_GetSize(This) \
- ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_GetPixelSize(This) \
- ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_GetMaximumBitmapSize(This) \
- ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
-
-#define ID2D1DCRenderTarget_IsSupported(This, renderTargetProperties) \
- ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
-
-#define ID2D1DCRenderTarget_BindDC(This, hDC, pSubRect) \
- ((This)->lpVtbl->BindDC(This, hDC, pSubRect))
-
-typedef interface ID2D1Factory ID2D1Factory;
-
-typedef struct ID2D1FactoryVtbl
-{
-
- IUnknownVtbl Base;
-
-
- STDMETHOD(ReloadSystemMetrics)(
- ID2D1Factory *This
- ) PURE;
-
- STDMETHOD_(void, GetDesktopDpi)(
- ID2D1Factory *This,
- __out FLOAT *dpiX,
- __out FLOAT *dpiY
- ) PURE;
-
- STDMETHOD(CreateRectangleGeometry)(
- ID2D1Factory *This,
- __in CONST D2D1_RECT_F *rectangle,
- __deref_out ID2D1RectangleGeometry **rectangleGeometry
- ) PURE;
-
- STDMETHOD(CreateRoundedRectangleGeometry)(
- ID2D1Factory *This,
- __in CONST D2D1_ROUNDED_RECT *roundedRectangle,
- __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry
- ) PURE;
-
- STDMETHOD(CreateEllipseGeometry)(
- ID2D1Factory *This,
- __in CONST D2D1_ELLIPSE *ellipse,
- __deref_out ID2D1EllipseGeometry **ellipseGeometry
- ) PURE;
-
- STDMETHOD(CreateGeometryGroup)(
- ID2D1Factory *This,
- D2D1_FILL_MODE fillMode,
- __in_ecount(geometriesCount) ID2D1Geometry **geometries,
- UINT geometriesCount,
- __deref_out ID2D1GeometryGroup **geometryGroup
- ) PURE;
-
- STDMETHOD(CreateTransformedGeometry)(
- ID2D1Factory *This,
- __in ID2D1Geometry *sourceGeometry,
- __in CONST D2D1_MATRIX_3X2_F *transform,
- __deref_out ID2D1TransformedGeometry **transformedGeometry
- ) PURE;
-
- STDMETHOD(CreatePathGeometry)(
- ID2D1Factory *This,
- __deref_out ID2D1PathGeometry **pathGeometry
- ) PURE;
-
- STDMETHOD(CreateStrokeStyle)(
- ID2D1Factory *This,
- __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties,
- __in_ecount_opt(dashesCount) CONST FLOAT *dashes,
- UINT dashesCount,
- __deref_out ID2D1StrokeStyle **strokeStyle
- ) PURE;
-
- STDMETHOD(CreateDrawingStateBlock)(
- ID2D1Factory *This,
- __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription,
- __in_opt IDWriteRenderingParams *textRenderingParams,
- __deref_out ID2D1DrawingStateBlock **drawingStateBlock
- ) PURE;
-
- STDMETHOD(CreateWicBitmapRenderTarget)(
- ID2D1Factory *This,
- __in IWICBitmap *target,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- ) PURE;
-
- STDMETHOD(CreateHwndRenderTarget)(
- ID2D1Factory *This,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties,
- __deref_out ID2D1HwndRenderTarget **hwndRenderTarget
- ) PURE;
-
- STDMETHOD(CreateDxgiSurfaceRenderTarget)(
- ID2D1Factory *This,
- __in IDXGISurface *dxgiSurface,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1RenderTarget **renderTarget
- ) PURE;
-
- STDMETHOD(CreateDCRenderTarget)(
- ID2D1Factory *This,
- __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties,
- __deref_out ID2D1DCRenderTarget **dcRenderTarget
- ) PURE;
-} ID2D1FactoryVtbl;
-
-interface ID2D1Factory
-{
- CONST struct ID2D1FactoryVtbl *lpVtbl;
-};
-
-
-#define ID2D1Factory_QueryInterface(This, riid, ppv) \
- ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv))
-
-#define ID2D1Factory_AddRef(This) \
- ((This)->lpVtbl->Base.AddRef((IUnknown *)This))
-
-#define ID2D1Factory_Release(This) \
- ((This)->lpVtbl->Base.Release((IUnknown *)This))
-
-#define ID2D1Factory_ReloadSystemMetrics(This) \
- ((This)->lpVtbl->ReloadSystemMetrics(This))
-
-#define ID2D1Factory_GetDesktopDpi(This, dpiX, dpiY) \
- ((This)->lpVtbl->GetDesktopDpi(This, dpiX, dpiY))
-
-#define ID2D1Factory_CreateRectangleGeometry(This, rectangle, rectangleGeometry) \
- ((This)->lpVtbl->CreateRectangleGeometry(This, rectangle, rectangleGeometry))
-
-#define ID2D1Factory_CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry) \
- ((This)->lpVtbl->CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry))
-
-#define ID2D1Factory_CreateEllipseGeometry(This, ellipse, ellipseGeometry) \
- ((This)->lpVtbl->CreateEllipseGeometry(This, ellipse, ellipseGeometry))
-
-#define ID2D1Factory_CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup) \
- ((This)->lpVtbl->CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup))
-
-#define ID2D1Factory_CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry) \
- ((This)->lpVtbl->CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry))
-
-#define ID2D1Factory_CreatePathGeometry(This, pathGeometry) \
- ((This)->lpVtbl->CreatePathGeometry(This, pathGeometry))
-
-#define ID2D1Factory_CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle) \
- ((This)->lpVtbl->CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle))
-
-#define ID2D1Factory_CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock) \
- ((This)->lpVtbl->CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock))
-
-#define ID2D1Factory_CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget) \
- ((This)->lpVtbl->CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget))
-
-#define ID2D1Factory_CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget) \
- ((This)->lpVtbl->CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget))
-
-#define ID2D1Factory_CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget) \
- ((This)->lpVtbl->CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget))
-
-#define ID2D1Factory_CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget) \
- ((This)->lpVtbl->CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget))
-
-
-#endif
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
- //
- // This export cannot be in a namespace because compiler name mangling isn't consistent
- // also, this must be 'C' callable.
- //
- HRESULT WINAPI
- D2D1CreateFactory(
- __in D2D1_FACTORY_TYPE factoryType,
- __in REFIID riid,
- __in_opt CONST D2D1_FACTORY_OPTIONS *pFactoryOptions,
- __out void **ppIFactory
- );
-
-
- void WINAPI
- D2D1MakeRotateMatrix(
- __in FLOAT angle,
- __in D2D1_POINT_2F center,
- __out D2D1_MATRIX_3X2_F *matrix
- );
-
- void WINAPI
- D2D1MakeSkewMatrix(
- __in FLOAT angleX,
- __in FLOAT angleY,
- __in D2D1_POINT_2F center,
- __out D2D1_MATRIX_3X2_F *matrix
- );
-
- BOOL WINAPI
- D2D1IsMatrixInvertible(
- __in CONST D2D1_MATRIX_3X2_F *matrix
- );
-
- BOOL WINAPI
- D2D1InvertMatrix(
- __inout D2D1_MATRIX_3X2_F *matrix
- );
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifndef D2D1FORCEINLINE
-#define D2D1FORCEINLINE FORCEINLINE
-#endif // #ifndef D2D1FORCEINLINE
-
-
-#include <d2d1helper.h>
-
-
-#ifndef D2D_USE_C_DEFINITIONS
-
-inline
-HRESULT
-D2D1CreateFactory(
- __in D2D1_FACTORY_TYPE factoryType,
- __in REFIID riid,
- __out void **factory
- )
-{
- return
- D2D1CreateFactory(
- factoryType,
- riid,
- NULL,
- factory);
-}
-
-
-template<class Factory>
-HRESULT
-D2D1CreateFactory(
- __in D2D1_FACTORY_TYPE factoryType,
- __out Factory **factory
- )
-{
- return
- D2D1CreateFactory(
- factoryType,
- __uuidof(Factory),
- reinterpret_cast<void **>(factory));
-}
-
-template<class Factory>
-HRESULT
-D2D1CreateFactory(
- __in D2D1_FACTORY_TYPE factoryType,
- __in CONST D2D1_FACTORY_OPTIONS &factoryOptions,
- __out Factory **ppFactory
- )
-{
- return
- D2D1CreateFactory(
- factoryType,
- __uuidof(Factory),
- &factoryOptions,
- reinterpret_cast<void **>(ppFactory));
-}
-
-#endif // #ifndef D2D_USE_C_DEFINITIONS
-#endif // #ifndef _D2D1_H_
diff --git a/3rdparty/dxsdk/Include/D2D1Helper.h b/3rdparty/dxsdk/Include/D2D1Helper.h
deleted file mode 100644
index 2f54ea2a376..00000000000
--- a/3rdparty/dxsdk/Include/D2D1Helper.h
+++ /dev/null
@@ -1,948 +0,0 @@
-
-/*=========================================================================*\
-
- Copyright (c) Microsoft Corporation. All rights reserved.
-
- File: D2D1helper.h
-
- Module Name: D2D
-
- Description: Helper files over the D2D interfaces and APIs.
-
-\*=========================================================================*/
-#pragma once
-
-#ifndef _D2D1_HELPER_H_
-#define _D2D1_HELPER_H_
-
-#ifndef _D2D1_H_
-#include <d2d1.h>
-#endif // #ifndef _D2D1_H_
-
-#ifndef D2D_USE_C_DEFINITIONS
-
-namespace D2D1
-{
- //
- // Forward declared IdentityMatrix function to allow matrix class to use
- // these constructors.
- //
- D2D1FORCEINLINE
- D2D1_MATRIX_3X2_F
- IdentityMatrix();
-
- //
- // The default trait type for objects in D2D is float.
- //
- template<typename Type>
- struct TypeTraits
- {
- typedef D2D1_POINT_2F Point;
- typedef D2D1_SIZE_F Size;
- typedef D2D1_RECT_F Rect;
- };
-
- template<>
- struct TypeTraits<UINT32>
- {
- typedef D2D1_POINT_2U Point;
- typedef D2D1_SIZE_U Size;
- typedef D2D1_RECT_U Rect;
- };
-
- static inline
- FLOAT FloatMax()
- {
- #ifdef FLT_MAX
- return FLT_MAX;
- #else
- return 3.402823466e+38F;
- #endif
- }
-
- //
- // Construction helpers
- //
- template<typename Type>
- D2D1FORCEINLINE
- typename TypeTraits<Type>::Point
- Point2(
- Type x,
- Type y
- )
- {
- typename TypeTraits<Type>::Point point = { x, y };
-
- return point;
- }
-
- D2D1FORCEINLINE
- D2D1_POINT_2F
- Point2F(
- FLOAT x = 0.f,
- FLOAT y = 0.f
- )
- {
- return Point2<FLOAT>(x, y);
- }
-
- D2D1FORCEINLINE
- D2D1_POINT_2U
- Point2U(
- UINT32 x = 0,
- UINT32 y = 0
- )
- {
- return Point2<UINT32>(x, y);
- }
-
- template<typename Type>
- D2D1FORCEINLINE
- typename TypeTraits<Type>::Size
- Size(
- Type width,
- Type height
- )
- {
- typename TypeTraits<Type>::Size size = { width, height };
-
- return size;
- }
-
- D2D1FORCEINLINE
- D2D1_SIZE_F
- SizeF(
- FLOAT width = 0.f,
- FLOAT height = 0.f
- )
- {
- return Size<FLOAT>(width, height);
- }
-
- D2D1FORCEINLINE
- D2D1_SIZE_U
- SizeU(
- UINT32 width = 0,
- UINT32 height = 0
- )
- {
- return Size<UINT32>(width, height);
- }
-
- template<typename Type>
- D2D1FORCEINLINE
- typename TypeTraits<Type>::Rect
- Rect(
- Type left,
- Type top,
- Type right,
- Type bottom
- )
- {
- typename TypeTraits<Type>::Rect rect = { left, top, right, bottom };
-
- return rect;
- }
-
- D2D1FORCEINLINE
- D2D1_RECT_F
- RectF(
- FLOAT left = 0.f,
- FLOAT top = 0.f,
- FLOAT right = 0.f,
- FLOAT bottom = 0.f
- )
- {
- return Rect<FLOAT>(left, top, right, bottom);
- }
-
- D2D1FORCEINLINE
- D2D1_RECT_U
- RectU(
- UINT32 left = 0,
- UINT32 top = 0,
- UINT32 right = 0,
- UINT32 bottom = 0
- )
- {
- return Rect<UINT32>(left, top, right, bottom);
- }
-
- D2D1FORCEINLINE
- D2D1_RECT_F
- InfiniteRect()
- {
- D2D1_RECT_F rect = { -FloatMax(), -FloatMax(), FloatMax(), FloatMax() };
-
- return rect;
- }
-
- D2D1FORCEINLINE
- D2D1_ARC_SEGMENT
- ArcSegment(
- __in CONST D2D1_POINT_2F &point,
- __in CONST D2D1_SIZE_F &size,
- __in FLOAT rotationAngle,
- __in D2D1_SWEEP_DIRECTION sweepDirection,
- __in D2D1_ARC_SIZE arcSize
- )
- {
- D2D1_ARC_SEGMENT arcSegment = { point, size, rotationAngle, sweepDirection, arcSize };
-
- return arcSegment;
- }
-
- D2D1FORCEINLINE
- D2D1_BEZIER_SEGMENT
- BezierSegment(
- __in CONST D2D1_POINT_2F &point1,
- __in CONST D2D1_POINT_2F &point2,
- __in CONST D2D1_POINT_2F &point3
- )
- {
- D2D1_BEZIER_SEGMENT bezierSegment = { point1, point2, point3 };
-
- return bezierSegment;
- }
-
- D2D1FORCEINLINE
- D2D1_ELLIPSE
- Ellipse(
- __in CONST D2D1_POINT_2F &center,
- FLOAT radiusX,
- FLOAT radiusY
- )
- {
- D2D1_ELLIPSE ellipse;
-
- ellipse.point = center;
- ellipse.radiusX = radiusX;
- ellipse.radiusY = radiusY;
-
- return ellipse;
- }
-
- D2D1FORCEINLINE
- D2D1_ROUNDED_RECT
- RoundedRect(
- __in CONST D2D1_RECT_F &rect,
- FLOAT radiusX,
- FLOAT radiusY
- )
- {
- D2D1_ROUNDED_RECT roundedRect;
-
- roundedRect.rect = rect;
- roundedRect.radiusX = radiusX;
- roundedRect.radiusY = radiusY;
-
- return roundedRect;
- }
-
- D2D1FORCEINLINE
- D2D1_BRUSH_PROPERTIES
- BrushProperties(
- __in FLOAT opacity = 1.0,
- __in CONST D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()
- )
- {
- D2D1_BRUSH_PROPERTIES brushProperties;
-
- brushProperties.opacity = opacity;
- brushProperties.transform = transform;
-
- return brushProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_GRADIENT_STOP
- GradientStop(
- FLOAT position,
- __in CONST D2D1_COLOR_F &color
- )
- {
- D2D1_GRADIENT_STOP gradientStop = { position, color };
-
- return gradientStop;
- }
-
- D2D1FORCEINLINE
- D2D1_QUADRATIC_BEZIER_SEGMENT
- QuadraticBezierSegment(
- __in CONST D2D1_POINT_2F &point1,
- __in CONST D2D1_POINT_2F &point2
- )
- {
- D2D1_QUADRATIC_BEZIER_SEGMENT quadraticBezier = { point1, point2 };
-
- return quadraticBezier;
- }
-
- D2D1FORCEINLINE
- D2D1_STROKE_STYLE_PROPERTIES
- StrokeStyleProperties(
- D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT,
- D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT,
- D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT,
- D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER,
- FLOAT miterLimit = 10.0f,
- D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID,
- FLOAT dashOffset = 0.0f
- )
- {
- D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties;
-
- strokeStyleProperties.startCap = startCap;
- strokeStyleProperties.endCap = endCap;
- strokeStyleProperties.dashCap = dashCap;
- strokeStyleProperties.lineJoin = lineJoin;
- strokeStyleProperties.miterLimit = miterLimit;
- strokeStyleProperties.dashStyle = dashStyle;
- strokeStyleProperties.dashOffset = dashOffset;
-
- return strokeStyleProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_BITMAP_BRUSH_PROPERTIES
- BitmapBrushProperties(
- D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
- D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
- D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR
- )
- {
- D2D1_BITMAP_BRUSH_PROPERTIES bitmapBrushProperties;
-
- bitmapBrushProperties.extendModeX = extendModeX;
- bitmapBrushProperties.extendModeY = extendModeY;
- bitmapBrushProperties.interpolationMode = interpolationMode;
-
- return bitmapBrushProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
- LinearGradientBrushProperties(
- __in CONST D2D1_POINT_2F &startPoint,
- __in CONST D2D1_POINT_2F &endPoint
- )
- {
- D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties;
-
- linearGradientBrushProperties.startPoint = startPoint;
- linearGradientBrushProperties.endPoint = endPoint;
-
- return linearGradientBrushProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
- RadialGradientBrushProperties(
- __in CONST D2D1_POINT_2F &center,
- __in CONST D2D1_POINT_2F &gradientOriginOffset,
- FLOAT radiusX,
- FLOAT radiusY
- )
- {
- D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties;
-
- radialGradientBrushProperties.center = center;
- radialGradientBrushProperties.gradientOriginOffset = gradientOriginOffset;
- radialGradientBrushProperties.radiusX = radiusX;
- radialGradientBrushProperties.radiusY = radiusY;
-
- return radialGradientBrushProperties;
- }
-
- //
- // PixelFormat
- //
- D2D1FORCEINLINE
- D2D1_PIXEL_FORMAT
- PixelFormat(
- __in DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN,
- __in D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_UNKNOWN
- )
- {
- D2D1_PIXEL_FORMAT pixelFormat;
-
- pixelFormat.format = dxgiFormat;
- pixelFormat.alphaMode = alphaMode;
-
- return pixelFormat;
- }
-
- //
- // Bitmaps
- //
- D2D1FORCEINLINE
- D2D1_BITMAP_PROPERTIES
- BitmapProperties(
- CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
- FLOAT dpiX = 96.0f,
- FLOAT dpiY = 96.0f
- )
- {
- D2D1_BITMAP_PROPERTIES bitmapProperties;
-
- bitmapProperties.pixelFormat = pixelFormat;
- bitmapProperties.dpiX = dpiX;
- bitmapProperties.dpiY = dpiY;
-
- return bitmapProperties;
- }
-
- //
- // Render Targets
- //
- D2D1FORCEINLINE
- D2D1_RENDER_TARGET_PROPERTIES
- RenderTargetProperties(
- D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT,
- __in CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
- FLOAT dpiX = 0.0,
- FLOAT dpiY = 0.0,
- D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE,
- D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT
- )
- {
- D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties;
-
- renderTargetProperties.type = type;
- renderTargetProperties.pixelFormat = pixelFormat;
- renderTargetProperties.dpiX = dpiX;
- renderTargetProperties.dpiY = dpiY;
- renderTargetProperties.usage = usage;
- renderTargetProperties.minLevel = minLevel;
-
- return renderTargetProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_HWND_RENDER_TARGET_PROPERTIES
- HwndRenderTargetProperties(
- __in HWND hwnd,
- __in D2D1_SIZE_U pixelSize = D2D1::Size(static_cast<UINT>(0), static_cast<UINT>(0)),
- __in D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE
- )
- {
- D2D1_HWND_RENDER_TARGET_PROPERTIES hwndRenderTargetProperties;
-
- hwndRenderTargetProperties.hwnd = hwnd;
- hwndRenderTargetProperties.pixelSize = pixelSize;
- hwndRenderTargetProperties.presentOptions = presentOptions;
-
- return hwndRenderTargetProperties;
- }
-
- D2D1FORCEINLINE
- D2D1_LAYER_PARAMETERS
- LayerParameters(
- __in CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
- __in_opt ID2D1Geometry *geometricMask = NULL,
- D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
- D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
- FLOAT opacity = 1.0,
- __in_opt ID2D1Brush *opacityBrush = NULL,
- D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE
- )
- {
- D2D1_LAYER_PARAMETERS layerParameters = { 0 };
-
- layerParameters.contentBounds = contentBounds;
- layerParameters.geometricMask = geometricMask;
- layerParameters.maskAntialiasMode = maskAntialiasMode;
- layerParameters.maskTransform = maskTransform;
- layerParameters.opacity = opacity;
- layerParameters.opacityBrush = opacityBrush;
- layerParameters.layerOptions = layerOptions;
-
- return layerParameters;
- }
-
- D2D1FORCEINLINE
- D2D1_DRAWING_STATE_DESCRIPTION
- DrawingStateDescription(
- D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
- D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT,
- D2D1_TAG tag1 = 0,
- D2D1_TAG tag2 = 0,
- __in const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()
- )
- {
- D2D1_DRAWING_STATE_DESCRIPTION drawingStateDescription;
-
- drawingStateDescription.antialiasMode = antialiasMode;
- drawingStateDescription.textAntialiasMode = textAntialiasMode;
- drawingStateDescription.tag1 = tag1;
- drawingStateDescription.tag2 = tag2;
- drawingStateDescription.transform = transform;
-
- return drawingStateDescription;
- }
-
- //
- // Colors, this enum defines a set of predefined colors.
- //
- class ColorF : public D2D1_COLOR_F
- {
- public:
-
- enum Enum
- {
- AliceBlue = 0xF0F8FF,
- AntiqueWhite = 0xFAEBD7,
- Aqua = 0x00FFFF,
- Aquamarine = 0x7FFFD4,
- Azure = 0xF0FFFF,
- Beige = 0xF5F5DC,
- Bisque = 0xFFE4C4,
- Black = 0x000000,
- BlanchedAlmond = 0xFFEBCD,
- Blue = 0x0000FF,
- BlueViolet = 0x8A2BE2,
- Brown = 0xA52A2A,
- BurlyWood = 0xDEB887,
- CadetBlue = 0x5F9EA0,
- Chartreuse = 0x7FFF00,
- Chocolate = 0xD2691E,
- Coral = 0xFF7F50,
- CornflowerBlue = 0x6495ED,
- Cornsilk = 0xFFF8DC,
- Crimson = 0xDC143C,
- Cyan = 0x00FFFF,
- DarkBlue = 0x00008B,
- DarkCyan = 0x008B8B,
- DarkGoldenrod = 0xB8860B,
- DarkGray = 0xA9A9A9,
- DarkGreen = 0x006400,
- DarkKhaki = 0xBDB76B,
- DarkMagenta = 0x8B008B,
- DarkOliveGreen = 0x556B2F,
- DarkOrange = 0xFF8C00,
- DarkOrchid = 0x9932CC,
- DarkRed = 0x8B0000,
- DarkSalmon = 0xE9967A,
- DarkSeaGreen = 0x8FBC8F,
- DarkSlateBlue = 0x483D8B,
- DarkSlateGray = 0x2F4F4F,
- DarkTurquoise = 0x00CED1,
- DarkViolet = 0x9400D3,
- DeepPink = 0xFF1493,
- DeepSkyBlue = 0x00BFFF,
- DimGray = 0x696969,
- DodgerBlue = 0x1E90FF,
- Firebrick = 0xB22222,
- FloralWhite = 0xFFFAF0,
- ForestGreen = 0x228B22,
- Fuchsia = 0xFF00FF,
- Gainsboro = 0xDCDCDC,
- GhostWhite = 0xF8F8FF,
- Gold = 0xFFD700,
- Goldenrod = 0xDAA520,
- Gray = 0x808080,
- Green = 0x008000,
- GreenYellow = 0xADFF2F,
- Honeydew = 0xF0FFF0,
- HotPink = 0xFF69B4,
- IndianRed = 0xCD5C5C,
- Indigo = 0x4B0082,
- Ivory = 0xFFFFF0,
- Khaki = 0xF0E68C,
- Lavender = 0xE6E6FA,
- LavenderBlush = 0xFFF0F5,
- LawnGreen = 0x7CFC00,
- LemonChiffon = 0xFFFACD,
- LightBlue = 0xADD8E6,
- LightCoral = 0xF08080,
- LightCyan = 0xE0FFFF,
- LightGoldenrodYellow = 0xFAFAD2,
- LightGreen = 0x90EE90,
- LightGray = 0xD3D3D3,
- LightPink = 0xFFB6C1,
- LightSalmon = 0xFFA07A,
- LightSeaGreen = 0x20B2AA,
- LightSkyBlue = 0x87CEFA,
- LightSlateGray = 0x778899,
- LightSteelBlue = 0xB0C4DE,
- LightYellow = 0xFFFFE0,
- Lime = 0x00FF00,
- LimeGreen = 0x32CD32,
- Linen = 0xFAF0E6,
- Magenta = 0xFF00FF,
- Maroon = 0x800000,
- MediumAquamarine = 0x66CDAA,
- MediumBlue = 0x0000CD,
- MediumOrchid = 0xBA55D3,
- MediumPurple = 0x9370DB,
- MediumSeaGreen = 0x3CB371,
- MediumSlateBlue = 0x7B68EE,
- MediumSpringGreen = 0x00FA9A,
- MediumTurquoise = 0x48D1CC,
- MediumVioletRed = 0xC71585,
- MidnightBlue = 0x191970,
- MintCream = 0xF5FFFA,
- MistyRose = 0xFFE4E1,
- Moccasin = 0xFFE4B5,
- NavajoWhite = 0xFFDEAD,
- Navy = 0x000080,
- OldLace = 0xFDF5E6,
- Olive = 0x808000,
- OliveDrab = 0x6B8E23,
- Orange = 0xFFA500,
- OrangeRed = 0xFF4500,
- Orchid = 0xDA70D6,
- PaleGoldenrod = 0xEEE8AA,
- PaleGreen = 0x98FB98,
- PaleTurquoise = 0xAFEEEE,
- PaleVioletRed = 0xDB7093,
- PapayaWhip = 0xFFEFD5,
- PeachPuff = 0xFFDAB9,
- Peru = 0xCD853F,
- Pink = 0xFFC0CB,
- Plum = 0xDDA0DD,
- PowderBlue = 0xB0E0E6,
- Purple = 0x800080,
- Red = 0xFF0000,
- RosyBrown = 0xBC8F8F,
- RoyalBlue = 0x4169E1,
- SaddleBrown = 0x8B4513,
- Salmon = 0xFA8072,
- SandyBrown = 0xF4A460,
- SeaGreen = 0x2E8B57,
- SeaShell = 0xFFF5EE,
- Sienna = 0xA0522D,
- Silver = 0xC0C0C0,
- SkyBlue = 0x87CEEB,
- SlateBlue = 0x6A5ACD,
- SlateGray = 0x708090,
- Snow = 0xFFFAFA,
- SpringGreen = 0x00FF7F,
- SteelBlue = 0x4682B4,
- Tan = 0xD2B48C,
- Teal = 0x008080,
- Thistle = 0xD8BFD8,
- Tomato = 0xFF6347,
- Turquoise = 0x40E0D0,
- Violet = 0xEE82EE,
- Wheat = 0xF5DEB3,
- White = 0xFFFFFF,
- WhiteSmoke = 0xF5F5F5,
- Yellow = 0xFFFF00,
- YellowGreen = 0x9ACD32,
- };
-
- //
- // Construct a color, note that the alpha value from the "rgb" component
- // is never used.
- //
- D2D1FORCEINLINE
- ColorF(
- UINT32 rgb,
- FLOAT a = 1.0
- )
- {
- Init(rgb, a);
- }
-
- D2D1FORCEINLINE
- ColorF(
- Enum knownColor,
- FLOAT a = 1.0
- )
- {
- Init(knownColor, a);
- }
-
- D2D1FORCEINLINE
- ColorF(
- FLOAT r,
- FLOAT g,
- FLOAT b,
- FLOAT a = 1.0
- )
- {
- this->r = r;
- this->g = g;
- this->b = b;
- this->a = a;
- }
-
- private:
-
- D2D1FORCEINLINE
- void
- Init(
- UINT32 rgb,
- FLOAT a
- )
- {
- this->r = static_cast<FLOAT>((rgb & sc_redMask) >> sc_redShift) / 255.f;
- this->g = static_cast<FLOAT>((rgb & sc_greenMask) >> sc_greenShift) / 255.f;
- this->b = static_cast<FLOAT>((rgb & sc_blueMask) >> sc_blueShift) / 255.f;
- this->a = a;
- }
-
- static const UINT32 sc_redShift = 16;
- static const UINT32 sc_greenShift = 8;
- static const UINT32 sc_blueShift = 0;
-
- static const UINT32 sc_redMask = 0xff << sc_redShift;
- static const UINT32 sc_greenMask = 0xff << sc_greenShift;
- static const UINT32 sc_blueMask = 0xff << sc_blueShift;
- };
-
- class Matrix3x2F : public D2D1_MATRIX_3X2_F
- {
- public:
-
- D2D1FORCEINLINE
- Matrix3x2F(
- FLOAT _11,
- FLOAT _12,
- FLOAT _21,
- FLOAT _22,
- FLOAT _31,
- FLOAT _32
- )
- {
- this->_11 = _11;
- this->_12 = _12;
- this->_21 = _21;
- this->_22 = _22;
- this->_31 = _31;
- this->_32 = _32;
- }
-
- //
- // Creates an identity matrix
- //
- D2D1FORCEINLINE
- Matrix3x2F(
- )
- {
- }
-
- //
- // Named quasi-constructors
- //
- static D2D1FORCEINLINE
- Matrix3x2F
- Identity()
- {
- Matrix3x2F identity;
-
- identity._11 = 1.f;
- identity._12 = 0.f;
- identity._21 = 0.f;
- identity._22 = 1.f;
- identity._31 = 0.f;
- identity._32 = 0.f;
-
- return identity;
- }
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Translation(
- D2D1_SIZE_F size
- )
- {
- Matrix3x2F translation;
-
- translation._11 = 1.0; translation._12 = 0.0;
- translation._21 = 0.0; translation._22 = 1.0;
- translation._31 = size.width; translation._32 = size.height;
-
- return translation;
- }
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Translation(
- FLOAT x,
- FLOAT y
- )
- {
- return Translation(SizeF(x, y));
- }
-
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Scale(
- D2D1_SIZE_F size,
- D2D1_POINT_2F center = D2D1::Point2F()
- )
- {
- Matrix3x2F scale;
-
- scale._11 = size.width; scale._12 = 0.0;
- scale._21 = 0.0; scale._22 = size.height;
- scale._31 = center.x - size.width * center.x;
- scale._32 = center.y - size.height * center.y;
-
- return scale;
- }
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Scale(
- FLOAT x,
- FLOAT y,
- D2D1_POINT_2F center = D2D1::Point2F()
- )
- {
- return Scale(SizeF(x, y), center);
- }
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Rotation(
- FLOAT angle,
- D2D1_POINT_2F center = D2D1::Point2F()
- )
- {
- Matrix3x2F rotation;
-
- D2D1MakeRotateMatrix(angle, center, &rotation);
-
- return rotation;
- }
-
- static D2D1FORCEINLINE
- Matrix3x2F
- Skew(
- FLOAT angleX,
- FLOAT angleY,
- D2D1_POINT_2F center = D2D1::Point2F()
- )
- {
- Matrix3x2F skew;
-
- D2D1MakeSkewMatrix(angleX, angleY, center, &skew);
-
- return skew;
- }
-
- //
- // Functions for convertion from the base D2D1_MATRIX_3X2_F to this type
- // without making a copy
- //
- static inline const Matrix3x2F* ReinterpretBaseType(const D2D1_MATRIX_3X2_F *pMatrix)
- {
- return static_cast<const Matrix3x2F *>(pMatrix);
- }
-
- static inline Matrix3x2F* ReinterpretBaseType(D2D1_MATRIX_3X2_F *pMatrix)
- {
- return static_cast<Matrix3x2F *>(pMatrix);
- }
-
- inline
- FLOAT
- Determinant() const
- {
- return (_11 * _22) - (_12 * _21);
- }
-
- inline
- bool
- IsInvertible() const
- {
- return !!D2D1IsMatrixInvertible(this);
- }
-
- inline
- bool
- Invert()
- {
- return !!D2D1InvertMatrix(this);
- }
-
- inline
- bool
- IsIdentity() const
- {
- return _11 == 1.f && _12 == 0.f
- && _21 == 0.f && _22 == 1.f
- && _31 == 0.f && _32 == 0.f;
- }
-
- inline
- void SetProduct(
- const Matrix3x2F &a,
- const Matrix3x2F &b
- )
- {
- _11 = a._11 * b._11 + a._12 * b._21;
- _12 = a._11 * b._12 + a._12 * b._22;
- _21 = a._21 * b._11 + a._22 * b._21;
- _22 = a._21 * b._12 + a._22 * b._22;
- _31 = a._31 * b._11 + a._32 * b._21 + b._31;
- _32 = a._31 * b._12 + a._32 * b._22 + b._32;
- }
-
- D2D1FORCEINLINE
- Matrix3x2F
- operator*(
- const Matrix3x2F &matrix
- ) const
- {
- Matrix3x2F result;
-
- result.SetProduct(*this, matrix);
-
- return result;
- }
-
- D2D1FORCEINLINE
- D2D1_POINT_2F
- TransformPoint(
- D2D1_POINT_2F point
- ) const
- {
- D2D1_POINT_2F result =
- {
- point.x * _11 + point.y * _21 + _31,
- point.x * _12 + point.y * _22 + _32
- };
-
- return result;
- }
- };
-
- D2D1FORCEINLINE
- D2D1_POINT_2F
- operator*(
- const D2D1_POINT_2F &point,
- const D2D1_MATRIX_3X2_F &matrix
- )
- {
- return Matrix3x2F::ReinterpretBaseType(&matrix)->TransformPoint(point);
- }
-
- D2D1_MATRIX_3X2_F
- IdentityMatrix()
- {
- return Matrix3x2F::Identity();
- }
-
-} // namespace D2D1
-
-D2D1FORCEINLINE
-D2D1_MATRIX_3X2_F
-operator*(
- const D2D1_MATRIX_3X2_F &matrix1,
- const D2D1_MATRIX_3X2_F &matrix2
- )
-{
- return
- (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix1)) *
- (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix2));
-}
-
-#endif // #ifndef D2D_USE_C_DEFINITIONS
-
-#endif // #ifndef _D2D1_HELPER_H_
-
diff --git a/3rdparty/dxsdk/Include/D2DBaseTypes.h b/3rdparty/dxsdk/Include/D2DBaseTypes.h
deleted file mode 100644
index c2ff5bb3b7a..00000000000
--- a/3rdparty/dxsdk/Include/D2DBaseTypes.h
+++ /dev/null
@@ -1,145 +0,0 @@
-//---------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// This file is automatically generated. Please do not edit it directly.
-//
-// File name: D2DBaseTypes.h
-//---------------------------------------------------------------------------
-#pragma once
-
-
-#ifndef _D2DBASETYPES_INCLUDED
-#define _D2DBASETYPES_INCLUDED
-
-#ifndef COM_NO_WINDOWS_H
-#include <windows.h>
-#endif // #ifndef COM_NO_WINDOWS_H
-
-#ifndef D3DCOLORVALUE_DEFINED
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D3DCOLORVALUE
-//
-//------------------------------------------------------------------------------
-typedef struct D3DCOLORVALUE
-{
- FLOAT r;
- FLOAT g;
- FLOAT b;
- FLOAT a;
-
-} D3DCOLORVALUE;
-
-#define D3DCOLORVALUE_DEFINED
-#endif
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_POINT_2U
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_POINT_2U
-{
- UINT32 x;
- UINT32 y;
-
-} D2D_POINT_2U;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_POINT_2F
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_POINT_2F
-{
- FLOAT x;
- FLOAT y;
-
-} D2D_POINT_2F;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_RECT_F
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_RECT_F
-{
- FLOAT left;
- FLOAT top;
- FLOAT right;
- FLOAT bottom;
-
-} D2D_RECT_F;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_RECT_U
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_RECT_U
-{
- UINT32 left;
- UINT32 top;
- UINT32 right;
- UINT32 bottom;
-
-} D2D_RECT_U;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_SIZE_F
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_SIZE_F
-{
- FLOAT width;
- FLOAT height;
-
-} D2D_SIZE_F;
-
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_SIZE_U
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_SIZE_U
-{
- UINT32 width;
- UINT32 height;
-
-} D2D_SIZE_U;
-
-typedef D3DCOLORVALUE D2D_COLOR_F;
-
-//+-----------------------------------------------------------------------------
-//
-// Struct:
-// D2D_MATRIX_3X2_F
-//
-//------------------------------------------------------------------------------
-typedef struct D2D_MATRIX_3X2_F
-{
- FLOAT _11;
- FLOAT _12;
- FLOAT _21;
- FLOAT _22;
- FLOAT _31;
- FLOAT _32;
-
-} D2D_MATRIX_3X2_F;
-
-#endif // #ifndef _D2DBASETYPES_INCLUDED
diff --git a/3rdparty/dxsdk/Include/D2Derr.h b/3rdparty/dxsdk/Include/D2Derr.h
deleted file mode 100644
index afbaa36d5c6..00000000000
--- a/3rdparty/dxsdk/Include/D2Derr.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*=========================================================================*\
-
- Copyright (c) Microsoft Corporation. All rights reserved.
-
-\*=========================================================================*/
-
-#pragma once
-
-/*=========================================================================*\
- D2D Status Codes
-\*=========================================================================*/
-
-#define FACILITY_D2D 0x899
-
-#define MAKE_D2DHR( sev, code )\
- MAKE_HRESULT( sev, FACILITY_D2D, (code) )
-
-#define MAKE_D2DHR_ERR( code )\
- MAKE_D2DHR( 1, code )
-
-
-//+----------------------------------------------------------------------------
-//
-// D2D error codes
-//
-//------------------------------------------------------------------------------
-
-//
-// Error codes shared with WINCODECS
-//
-
-//
-// The pixel format is not supported.
-//
-#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
-
-//
-// Error codes that were already returned in prior versions and were part of the
-// MIL facility.
-
-//
-// Error codes mapped from WIN32 where there isn't already another HRESULT based
-// define
-//
-
-//
-// The supplied buffer was too small to accomodate the data.
-//
-#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
-
-
-//
-// D2D specific codes
-//
-
-//
-// The object was not in the correct state to process the method.
-//
-#define D2DERR_WRONG_STATE MAKE_D2DHR_ERR(0x001)
-
-//
-// The object has not yet been initialized.
-//
-#define D2DERR_NOT_INITIALIZED MAKE_D2DHR_ERR(0x002)
-
-//
-// The requested opertion is not supported.
-//
-#define D2DERR_UNSUPPORTED_OPERATION MAKE_D2DHR_ERR(0x003)
-
-//
-// The geomery scanner failed to process the data.
-//
-#define D2DERR_SCANNER_FAILED MAKE_D2DHR_ERR(0x004)
-
-//
-// D2D could not access the screen.
-//
-#define D2DERR_SCREEN_ACCESS_DENIED MAKE_D2DHR_ERR(0x005)
-
-//
-// A valid display state could not be determined.
-//
-#define D2DERR_DISPLAY_STATE_INVALID MAKE_D2DHR_ERR(0x006)
-
-//
-// The supplied vector is vero.
-//
-#define D2DERR_ZERO_VECTOR MAKE_D2DHR_ERR(0x007)
-
-//
-// An internal error (D2D bug) occurred. On checked builds, we would assert.
-//
-// The application should close this instance of D2D and should consider
-// restarting its process.
-//
-#define D2DERR_INTERNAL_ERROR MAKE_D2DHR_ERR(0x008)
-
-//
-// The display format we need to render is not supported by the
-// hardware device.
-//
-#define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED MAKE_D2DHR_ERR(0x009)
-
-//
-// A call to this method is invalid.
-//
-#define D2DERR_INVALID_CALL MAKE_D2DHR_ERR(0x00A)
-
-//
-// No HW rendering device is available for this operation.
-//
-#define D2DERR_NO_HARDWARE_DEVICE MAKE_D2DHR_ERR(0x00B)
-
-//
-// There has been a presentation error that may be recoverable. The caller
-// needs to recreate, rerender the entire frame, and reattempt present.
-//
-#define D2DERR_RECREATE_TARGET MAKE_D2DHR_ERR(0x00C)
-
-//
-// Shader construction failed because it was too complex.
-//
-#define D2DERR_TOO_MANY_SHADER_ELEMENTS MAKE_D2DHR_ERR(0x00D)
-
-//
-// Shader compilation failed.
-//
-#define D2DERR_SHADER_COMPILE_FAILED MAKE_D2DHR_ERR(0x00E)
-
-//
-// Requested DX surface size exceeded maximum texture size.
-//
-#define D2DERR_MAX_TEXTURE_SIZE_EXCEEDED MAKE_D2DHR_ERR(0x00F)
-
-//
-// The requested D2D version is not supported.
-//
-#define D2DERR_UNSUPPORTED_VERSION MAKE_D2DHR_ERR(0x010)
-
-//
-// Invalid number.
-//
-#define D2DERR_BAD_NUMBER MAKE_D2DHR_ERR(0x0011)
-
-//
-// Objects used together must be created from the same factory instance.
-//
-#define D2DERR_WRONG_FACTORY MAKE_D2DHR_ERR(0x012)
-
-//
-// A layer resource can only be in use once at any point in time.
-//
-#define D2DERR_LAYER_ALREADY_IN_USE MAKE_D2DHR_ERR(0x013)
-
-//
-// The pop call did not match the corresponding push call
-//
-#define D2DERR_POP_CALL_DID_NOT_MATCH_PUSH MAKE_D2DHR_ERR(0x014)
-
-//
-// The resource was realized on the wrong render target
-//
-#define D2DERR_WRONG_RESOURCE_DOMAIN MAKE_D2DHR_ERR(0x015)
-
-//
-// The push and pop calls were unbalanced
-//
-#define D2DERR_PUSH_POP_UNBALANCED MAKE_D2DHR_ERR(0x016)
-
-//
-// Attempt to copy from a render target while a layer or clip rect is applied
-//
-#define D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT MAKE_D2DHR_ERR(0x017)
-
-//
-// The brush types are incompatible for the call.
-//
-#define D2DERR_INCOMPATIBLE_BRUSH_TYPES MAKE_D2DHR_ERR(0x018)
-
-//
-// An unknown win32 failure occurred.
-//
-#define D2DERR_WIN32_ERROR MAKE_D2DHR_ERR(0x019)
-
-//
-// The render target is not compatible with GDI
-//
-#define D2DERR_TARGET_NOT_GDI_COMPATIBLE MAKE_D2DHR_ERR(0x01A)
-
-//
-// A text client drawing effect object is of the wrong type
-//
-#define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE MAKE_D2DHR_ERR(0x01B)
-
-//
-// The application is holding a reference to the IDWriteTextRenderer interface
-// after the corresponding DrawText or DrawTextLayout call has returned. The
-// IDWriteTextRenderer instance will be zombied.
-//
-#define D2DERR_TEXT_RENDERER_NOT_RELEASED MAKE_D2DHR_ERR(0x01C)
-
-//
-// The requested size is larger than the guaranteed supported texture size.
-//
-#define D2DERR_EXCEEDS_MAX_BITMAP_SIZE MAKE_D2DHR_ERR(0x01D)
diff --git a/3rdparty/dxsdk/Include/D3DX10math.inl b/3rdparty/dxsdk/Include/D3DX10math.inl
deleted file mode 100644
index 56f11638ef5..00000000000
--- a/3rdparty/dxsdk/Include/D3DX10math.inl
+++ /dev/null
@@ -1,2228 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx10math.inl
-// Content: D3DX10 math inline functions
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3DXMATH_INL__
-#define __D3DXMATH_INL__
-
-
-//===========================================================================
-//
-// Inline Class Methods
-//
-//===========================================================================
-
-#ifdef __cplusplus
-
-//--------------------------
-// Float16
-//--------------------------
-
-D3DX10INLINE
-D3DXFLOAT16::D3DXFLOAT16( FLOAT f )
-{
- D3DXFloat32To16Array(this, &f, 1);
-}
-
-D3DX10INLINE
-D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f )
-{
- value = f.value;
-}
-
-// casting
-D3DX10INLINE
-D3DXFLOAT16::operator FLOAT ()
-{
- FLOAT f;
- D3DXFloat16To32Array(&f, this, 1);
- return f;
-}
-
-// binary operators
-D3DX10INLINE BOOL
-D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const
-{
- // At least one is NaN
- if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK))
- || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK)))
- return false;
- // +/- Zero
- else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0)
- return true;
- else
- return value == f.value;
-}
-
-D3DX10INLINE BOOL
-D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const
-{
- // At least one is NaN
- if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK))
- || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK)))
- return true;
- // +/- Zero
- else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0)
- return false;
- else
- return value != f.value;
-}
-
-
-//--------------------------
-// 2D Vector
-//--------------------------
-
-D3DX10INLINE
-D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- x = pf[0];
- y = pf[1];
-}
-
-D3DX10INLINE
-D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&x, pf, 2);
-}
-
-D3DX10INLINE
-D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy )
-{
- x = fx;
- y = fy;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR2::operator FLOAT* ()
-{
- return (FLOAT *) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR2::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &x;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXVECTOR2&
-D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v )
-{
- x += v.x;
- y += v.y;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR2&
-D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v )
-{
- x -= v.x;
- y -= v.y;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR2&
-D3DXVECTOR2::operator *= ( FLOAT f )
-{
- x *= f;
- y *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR2&
-D3DXVECTOR2::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- x *= fInv;
- y *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator - () const
-{
- return D3DXVECTOR2(-x, -y);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const
-{
- return D3DXVECTOR2(x + v.x, y + v.y);
-}
-
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const
-{
- return D3DXVECTOR2(x - v.x, y - v.y);
-}
-
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator * ( FLOAT f ) const
-{
- return D3DXVECTOR2(x * f, y * f);
-}
-
-D3DX10INLINE D3DXVECTOR2
-D3DXVECTOR2::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXVECTOR2(x * fInv, y * fInv);
-}
-
-D3DX10INLINE D3DXVECTOR2
-operator * ( FLOAT f, CONST D3DXVECTOR2& v )
-{
- return D3DXVECTOR2(f * v.x, f * v.y);
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const
-{
- return x == v.x && y == v.y;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const
-{
- return x != v.x || y != v.y;
-}
-
-
-
-//--------------------------
-// 2D Vector (16 bit)
-//--------------------------
-
-D3DX10INLINE
-D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat32To16Array(&x, pf, 2);
-}
-
-D3DX10INLINE
-D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- *((UINT *) &x) = *((UINT *) &pf[0]);
-}
-
-D3DX10INLINE
-D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy )
-{
- x = fx;
- y = fy;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR2_16F::operator D3DXFLOAT16* ()
-{
- return (D3DXFLOAT16*) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const
-{
- return (CONST D3DXFLOAT16*) &x;
-}
-
-
-// binary operators
-D3DX10INLINE BOOL
-D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const
-{
- return x == v.x && y == v.y;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const
-{
- return x != v.x || y != v.y;
-}
-
-
-//--------------------------
-// 3D Vector
-//--------------------------
-D3DX10INLINE
-D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- x = pf[0];
- y = pf[1];
- z = pf[2];
-}
-
-D3DX10INLINE
-D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v )
-{
- x = v.x;
- y = v.y;
- z = v.z;
-}
-
-D3DX10INLINE
-D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&x, pf, 3);
-}
-
-D3DX10INLINE
-D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz )
-{
- x = fx;
- y = fy;
- z = fz;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR3::operator FLOAT* ()
-{
- return (FLOAT *) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR3::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &x;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXVECTOR3&
-D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v )
-{
- x += v.x;
- y += v.y;
- z += v.z;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR3&
-D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v )
-{
- x -= v.x;
- y -= v.y;
- z -= v.z;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR3&
-D3DXVECTOR3::operator *= ( FLOAT f )
-{
- x *= f;
- y *= f;
- z *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR3&
-D3DXVECTOR3::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- x *= fInv;
- y *= fInv;
- z *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator - () const
-{
- return D3DXVECTOR3(-x, -y, -z);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const
-{
- return D3DXVECTOR3(x + v.x, y + v.y, z + v.z);
-}
-
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const
-{
- return D3DXVECTOR3(x - v.x, y - v.y, z - v.z);
-}
-
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator * ( FLOAT f ) const
-{
- return D3DXVECTOR3(x * f, y * f, z * f);
-}
-
-D3DX10INLINE D3DXVECTOR3
-D3DXVECTOR3::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXVECTOR3(x * fInv, y * fInv, z * fInv);
-}
-
-
-D3DX10INLINE D3DXVECTOR3
-operator * ( FLOAT f, CONST struct D3DXVECTOR3& v )
-{
- return D3DXVECTOR3(f * v.x, f * v.y, f * v.z);
-}
-
-
-D3DX10INLINE BOOL
-D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const
-{
- return x == v.x && y == v.y && z == v.z;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const
-{
- return x != v.x || y != v.y || z != v.z;
-}
-
-
-
-//--------------------------
-// 3D Vector (16 bit)
-//--------------------------
-
-D3DX10INLINE
-D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat32To16Array(&x, pf, 3);
-}
-
-D3DX10INLINE
-D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v )
-{
- D3DXFloat32To16Array(&x, &v.x, 1);
- D3DXFloat32To16Array(&y, &v.y, 1);
- D3DXFloat32To16Array(&z, &v.z, 1);
-}
-
-D3DX10INLINE
-D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- *((UINT *) &x) = *((UINT *) &pf[0]);
- *((WORD *) &z) = *((WORD *) &pf[2]);
-}
-
-D3DX10INLINE
-D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz )
-{
- x = fx;
- y = fy;
- z = fz;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR3_16F::operator D3DXFLOAT16* ()
-{
- return (D3DXFLOAT16*) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const
-{
- return (CONST D3DXFLOAT16*) &x;
-}
-
-
-// binary operators
-D3DX10INLINE BOOL
-D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const
-{
- return x == v.x && y == v.y && z == v.z;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const
-{
- return x != v.x || y != v.y || z != v.z;
-}
-
-
-//--------------------------
-// 4D Vector
-//--------------------------
-D3DX10INLINE
-D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- x = pf[0];
- y = pf[1];
- z = pf[2];
- w = pf[3];
-}
-
-D3DX10INLINE
-D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&x, pf, 4);
-}
-
-D3DX10INLINE
-D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f )
-{
- x = v.x;
- y = v.y;
- z = v.z;
- w = f;
-}
-
-D3DX10INLINE
-D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw )
-{
- x = fx;
- y = fy;
- z = fz;
- w = fw;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR4::operator FLOAT* ()
-{
- return (FLOAT *) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR4::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &x;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXVECTOR4&
-D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v )
-{
- x += v.x;
- y += v.y;
- z += v.z;
- w += v.w;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR4&
-D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v )
-{
- x -= v.x;
- y -= v.y;
- z -= v.z;
- w -= v.w;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR4&
-D3DXVECTOR4::operator *= ( FLOAT f )
-{
- x *= f;
- y *= f;
- z *= f;
- w *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR4&
-D3DXVECTOR4::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- x *= fInv;
- y *= fInv;
- z *= fInv;
- w *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator - () const
-{
- return D3DXVECTOR4(-x, -y, -z, -w);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const
-{
- return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w);
-}
-
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const
-{
- return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w);
-}
-
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator * ( FLOAT f ) const
-{
- return D3DXVECTOR4(x * f, y * f, z * f, w * f);
-}
-
-D3DX10INLINE D3DXVECTOR4
-D3DXVECTOR4::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv);
-}
-
-D3DX10INLINE D3DXVECTOR4
-operator * ( FLOAT f, CONST D3DXVECTOR4& v )
-{
- return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w);
-}
-
-
-D3DX10INLINE BOOL
-D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const
-{
- return x == v.x && y == v.y && z == v.z && w == v.w;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const
-{
- return x != v.x || y != v.y || z != v.z || w != v.w;
-}
-
-
-
-//--------------------------
-// 4D Vector (16 bit)
-//--------------------------
-
-D3DX10INLINE
-D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat32To16Array(&x, pf, 4);
-}
-
-D3DX10INLINE
-D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- *((UINT *) &x) = *((UINT *) &pf[0]);
- *((UINT *) &z) = *((UINT *) &pf[2]);
-}
-
-D3DX10INLINE
-D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f )
-{
- x = v.x;
- y = v.y;
- z = v.z;
- w = f;
-}
-
-D3DX10INLINE
-D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw )
-{
- x = fx;
- y = fy;
- z = fz;
- w = fw;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXVECTOR4_16F::operator D3DXFLOAT16* ()
-{
- return (D3DXFLOAT16*) &x;
-}
-
-D3DX10INLINE
-D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const
-{
- return (CONST D3DXFLOAT16*) &x;
-}
-
-
-// binary operators
-D3DX10INLINE BOOL
-D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const
-{
- return x == v.x && y == v.y && z == v.z && w == v.w;
-}
-
-D3DX10INLINE BOOL
-D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const
-{
- return x != v.x || y != v.y || z != v.z || w != v.w;
-}
-
-
-//--------------------------
-// Matrix
-//--------------------------
-D3DX10INLINE
-D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- memcpy(&_11, pf, sizeof(D3DXMATRIX));
-}
-
-D3DX10INLINE
-D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat )
-{
- memcpy(&_11, &mat, sizeof(D3DXMATRIX));
-}
-
-D3DX10INLINE
-D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&_11, pf, 16);
-}
-
-D3DX10INLINE
-D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
- FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
- FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
- FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 )
-{
- _11 = f11; _12 = f12; _13 = f13; _14 = f14;
- _21 = f21; _22 = f22; _23 = f23; _24 = f24;
- _31 = f31; _32 = f32; _33 = f33; _34 = f34;
- _41 = f41; _42 = f42; _43 = f43; _44 = f44;
-}
-
-
-
-// access grants
-D3DX10INLINE FLOAT&
-D3DXMATRIX::operator () ( UINT iRow, UINT iCol )
-{
- return m[iRow][iCol];
-}
-
-D3DX10INLINE FLOAT
-D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const
-{
- return m[iRow][iCol];
-}
-
-
-// casting operators
-D3DX10INLINE
-D3DXMATRIX::operator FLOAT* ()
-{
- return (FLOAT *) &_11;
-}
-
-D3DX10INLINE
-D3DXMATRIX::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &_11;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXMATRIX&
-D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat )
-{
- D3DXMatrixMultiply(this, this, &mat);
- return *this;
-}
-
-D3DX10INLINE D3DXMATRIX&
-D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat )
-{
- _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14;
- _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24;
- _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34;
- _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44;
- return *this;
-}
-
-D3DX10INLINE D3DXMATRIX&
-D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat )
-{
- _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14;
- _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24;
- _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34;
- _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44;
- return *this;
-}
-
-D3DX10INLINE D3DXMATRIX&
-D3DXMATRIX::operator *= ( FLOAT f )
-{
- _11 *= f; _12 *= f; _13 *= f; _14 *= f;
- _21 *= f; _22 *= f; _23 *= f; _24 *= f;
- _31 *= f; _32 *= f; _33 *= f; _34 *= f;
- _41 *= f; _42 *= f; _43 *= f; _44 *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXMATRIX&
-D3DXMATRIX::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv;
- _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv;
- _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv;
- _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator - () const
-{
- return D3DXMATRIX(-_11, -_12, -_13, -_14,
- -_21, -_22, -_23, -_24,
- -_31, -_32, -_33, -_34,
- -_41, -_42, -_43, -_44);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const
-{
- D3DXMATRIX matT;
- D3DXMatrixMultiply(&matT, this, &mat);
- return matT;
-}
-
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const
-{
- return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14,
- _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24,
- _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34,
- _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44);
-}
-
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const
-{
- return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14,
- _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24,
- _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34,
- _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44);
-}
-
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator * ( FLOAT f ) const
-{
- return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f,
- _21 * f, _22 * f, _23 * f, _24 * f,
- _31 * f, _32 * f, _33 * f, _34 * f,
- _41 * f, _42 * f, _43 * f, _44 * f);
-}
-
-D3DX10INLINE D3DXMATRIX
-D3DXMATRIX::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv,
- _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv,
- _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv,
- _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv);
-}
-
-
-D3DX10INLINE D3DXMATRIX
-operator * ( FLOAT f, CONST D3DXMATRIX& mat )
-{
- return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14,
- f * mat._21, f * mat._22, f * mat._23, f * mat._24,
- f * mat._31, f * mat._32, f * mat._33, f * mat._34,
- f * mat._41, f * mat._42, f * mat._43, f * mat._44);
-}
-
-
-D3DX10INLINE BOOL
-D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const
-{
- return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX));
-}
-
-D3DX10INLINE BOOL
-D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const
-{
- return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX));
-}
-
-
-
-//--------------------------
-// Aligned Matrices
-//--------------------------
-
-D3DX10INLINE
-_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) :
- D3DXMATRIX( f )
-{
-}
-
-D3DX10INLINE
-_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) :
- D3DXMATRIX( m )
-{
-}
-
-D3DX10INLINE
-_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) :
- D3DXMATRIX( f )
-{
-}
-
-D3DX10INLINE
-_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
- FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
- FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
- FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) :
- D3DXMATRIX(_11, _12, _13, _14,
- _21, _22, _23, _24,
- _31, _32, _33, _34,
- _41, _42, _43, _44)
-{
-}
-
-#ifndef SIZE_MAX
-#define SIZE_MAX ((SIZE_T)-1)
-#endif
-
-D3DX10INLINE void*
-_D3DXMATRIXA16::operator new( size_t s )
-{
- if (s > (SIZE_MAX-16))
- return NULL;
- LPBYTE p = ::new BYTE[s + 16];
- if (p)
- {
- BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
- p += offset;
- p[-1] = offset;
- }
- return p;
-}
-
-D3DX10INLINE void*
-_D3DXMATRIXA16::operator new[]( size_t s )
-{
- if (s > (SIZE_MAX-16))
- return NULL;
- LPBYTE p = ::new BYTE[s + 16];
- if (p)
- {
- BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15));
- p += offset;
- p[-1] = offset;
- }
- return p;
-}
-
-D3DX10INLINE void
-_D3DXMATRIXA16::operator delete(void* p)
-{
- if(p)
- {
- BYTE* pb = static_cast<BYTE*>(p);
- pb -= pb[-1];
- ::delete [] pb;
- }
-}
-
-D3DX10INLINE void
-_D3DXMATRIXA16::operator delete[](void* p)
-{
- if(p)
- {
- BYTE* pb = static_cast<BYTE*>(p);
- pb -= pb[-1];
- ::delete [] pb;
- }
-}
-
-D3DX10INLINE _D3DXMATRIXA16&
-_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs)
-{
- memcpy(&_11, &rhs, sizeof(D3DXMATRIX));
- return *this;
-}
-
-
-//--------------------------
-// Quaternion
-//--------------------------
-
-D3DX10INLINE
-D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- x = pf[0];
- y = pf[1];
- z = pf[2];
- w = pf[3];
-}
-
-D3DX10INLINE
-D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&x, pf, 4);
-}
-
-D3DX10INLINE
-D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw )
-{
- x = fx;
- y = fy;
- z = fz;
- w = fw;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXQUATERNION::operator FLOAT* ()
-{
- return (FLOAT *) &x;
-}
-
-D3DX10INLINE
-D3DXQUATERNION::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &x;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXQUATERNION&
-D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q )
-{
- x += q.x;
- y += q.y;
- z += q.z;
- w += q.w;
- return *this;
-}
-
-D3DX10INLINE D3DXQUATERNION&
-D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q )
-{
- x -= q.x;
- y -= q.y;
- z -= q.z;
- w -= q.w;
- return *this;
-}
-
-D3DX10INLINE D3DXQUATERNION&
-D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q )
-{
- D3DXQuaternionMultiply(this, this, &q);
- return *this;
-}
-
-D3DX10INLINE D3DXQUATERNION&
-D3DXQUATERNION::operator *= ( FLOAT f )
-{
- x *= f;
- y *= f;
- z *= f;
- w *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXQUATERNION&
-D3DXQUATERNION::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- x *= fInv;
- y *= fInv;
- z *= fInv;
- w *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator - () const
-{
- return D3DXQUATERNION(-x, -y, -z, -w);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const
-{
- return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w);
-}
-
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const
-{
- return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w);
-}
-
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const
-{
- D3DXQUATERNION qT;
- D3DXQuaternionMultiply(&qT, this, &q);
- return qT;
-}
-
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator * ( FLOAT f ) const
-{
- return D3DXQUATERNION(x * f, y * f, z * f, w * f);
-}
-
-D3DX10INLINE D3DXQUATERNION
-D3DXQUATERNION::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv);
-}
-
-
-D3DX10INLINE D3DXQUATERNION
-operator * (FLOAT f, CONST D3DXQUATERNION& q )
-{
- return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w);
-}
-
-
-D3DX10INLINE BOOL
-D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const
-{
- return x == q.x && y == q.y && z == q.z && w == q.w;
-}
-
-D3DX10INLINE BOOL
-D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const
-{
- return x != q.x || y != q.y || z != q.z || w != q.w;
-}
-
-
-
-//--------------------------
-// Plane
-//--------------------------
-
-D3DX10INLINE
-D3DXPLANE::D3DXPLANE( CONST FLOAT* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- a = pf[0];
- b = pf[1];
- c = pf[2];
- d = pf[3];
-}
-
-D3DX10INLINE
-D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&a, pf, 4);
-}
-
-D3DX10INLINE
-D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd )
-{
- a = fa;
- b = fb;
- c = fc;
- d = fd;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXPLANE::operator FLOAT* ()
-{
- return (FLOAT *) &a;
-}
-
-D3DX10INLINE
-D3DXPLANE::operator CONST FLOAT* () const
-{
- return (CONST FLOAT *) &a;
-}
-
-
-// assignment operators
-D3DX10INLINE D3DXPLANE&
-D3DXPLANE::operator *= ( FLOAT f )
-{
- a *= f;
- b *= f;
- c *= f;
- d *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXPLANE&
-D3DXPLANE::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- a *= fInv;
- b *= fInv;
- c *= fInv;
- d *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXPLANE
-D3DXPLANE::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXPLANE
-D3DXPLANE::operator - () const
-{
- return D3DXPLANE(-a, -b, -c, -d);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXPLANE
-D3DXPLANE::operator * ( FLOAT f ) const
-{
- return D3DXPLANE(a * f, b * f, c * f, d * f);
-}
-
-D3DX10INLINE D3DXPLANE
-D3DXPLANE::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv);
-}
-
-D3DX10INLINE D3DXPLANE
-operator * (FLOAT f, CONST D3DXPLANE& p )
-{
- return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d);
-}
-
-D3DX10INLINE BOOL
-D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const
-{
- return a == p.a && b == p.b && c == p.c && d == p.d;
-}
-
-D3DX10INLINE BOOL
-D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const
-{
- return a != p.a || b != p.b || c != p.c || d != p.d;
-}
-
-
-
-
-//--------------------------
-// Color
-//--------------------------
-
-D3DX10INLINE
-D3DXCOLOR::D3DXCOLOR( UINT dw )
-{
- CONST FLOAT f = 1.0f / 255.0f;
- r = f * (FLOAT) (unsigned char) (dw >> 16);
- g = f * (FLOAT) (unsigned char) (dw >> 8);
- b = f * (FLOAT) (unsigned char) (dw >> 0);
- a = f * (FLOAT) (unsigned char) (dw >> 24);
-}
-
-D3DX10INLINE
-D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- r = pf[0];
- g = pf[1];
- b = pf[2];
- a = pf[3];
-}
-
-D3DX10INLINE
-D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf )
-{
-#ifdef D3DX10_DEBUG
- if(!pf)
- return;
-#endif
-
- D3DXFloat16To32Array(&r, pf, 4);
-}
-
-D3DX10INLINE
-D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa )
-{
- r = fr;
- g = fg;
- b = fb;
- a = fa;
-}
-
-
-// casting
-D3DX10INLINE
-D3DXCOLOR::operator UINT () const
-{
- UINT dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (UINT) (r * 255.0f + 0.5f);
- UINT dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (UINT) (g * 255.0f + 0.5f);
- UINT dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (UINT) (b * 255.0f + 0.5f);
- UINT dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (UINT) (a * 255.0f + 0.5f);
-
- return (dwA << 24) | (dwR << 16) | (dwG << 8) | (dwB << 0);
-}
-
-
-D3DX10INLINE
-D3DXCOLOR::operator FLOAT * ()
-{
- return (FLOAT *) &r;
-}
-
-D3DX10INLINE
-D3DXCOLOR::operator CONST FLOAT * () const
-{
- return (CONST FLOAT *) &r;
-}
-
-// assignment operators
-D3DX10INLINE D3DXCOLOR&
-D3DXCOLOR::operator += ( CONST D3DXCOLOR& c )
-{
- r += c.r;
- g += c.g;
- b += c.b;
- a += c.a;
- return *this;
-}
-
-D3DX10INLINE D3DXCOLOR&
-D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c )
-{
- r -= c.r;
- g -= c.g;
- b -= c.b;
- a -= c.a;
- return *this;
-}
-
-D3DX10INLINE D3DXCOLOR&
-D3DXCOLOR::operator *= ( FLOAT f )
-{
- r *= f;
- g *= f;
- b *= f;
- a *= f;
- return *this;
-}
-
-D3DX10INLINE D3DXCOLOR&
-D3DXCOLOR::operator /= ( FLOAT f )
-{
- FLOAT fInv = 1.0f / f;
- r *= fInv;
- g *= fInv;
- b *= fInv;
- a *= fInv;
- return *this;
-}
-
-
-// unary operators
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator + () const
-{
- return *this;
-}
-
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator - () const
-{
- return D3DXCOLOR(-r, -g, -b, -a);
-}
-
-
-// binary operators
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const
-{
- return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a);
-}
-
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const
-{
- return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a);
-}
-
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator * ( FLOAT f ) const
-{
- return D3DXCOLOR(r * f, g * f, b * f, a * f);
-}
-
-D3DX10INLINE D3DXCOLOR
-D3DXCOLOR::operator / ( FLOAT f ) const
-{
- FLOAT fInv = 1.0f / f;
- return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv);
-}
-
-
-D3DX10INLINE D3DXCOLOR
-operator * (FLOAT f, CONST D3DXCOLOR& c )
-{
- return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a);
-}
-
-
-D3DX10INLINE BOOL
-D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const
-{
- return r == c.r && g == c.g && b == c.b && a == c.a;
-}
-
-D3DX10INLINE BOOL
-D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const
-{
- return r != c.r || g != c.g || b != c.b || a != c.a;
-}
-
-
-#endif //__cplusplus
-
-
-
-//===========================================================================
-//
-// Inline functions
-//
-//===========================================================================
-
-
-//--------------------------
-// 2D Vector
-//--------------------------
-
-D3DX10INLINE FLOAT D3DXVec2Length
- ( CONST D3DXVECTOR2 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
-#ifdef __cplusplus
- return sqrtf(pV->x * pV->x + pV->y * pV->y);
-#else
- return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y);
-#endif
-}
-
-D3DX10INLINE FLOAT D3DXVec2LengthSq
- ( CONST D3DXVECTOR2 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
- return pV->x * pV->x + pV->y * pV->y;
-}
-
-D3DX10INLINE FLOAT D3DXVec2Dot
- ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pV1 || !pV2)
- return 0.0f;
-#endif
-
- return pV1->x * pV2->x + pV1->y * pV2->y;
-}
-
-D3DX10INLINE FLOAT D3DXVec2CCW
- ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pV1 || !pV2)
- return 0.0f;
-#endif
-
- return pV1->x * pV2->y - pV1->y * pV2->x;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Add
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + pV2->x;
- pOut->y = pV1->y + pV2->y;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Subtract
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x - pV2->x;
- pOut->y = pV1->y - pV2->y;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Minimize
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Maximize
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Scale
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV)
- return NULL;
-#endif
-
- pOut->x = pV->x * s;
- pOut->y = pV->y * s;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR2* D3DXVec2Lerp
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
- FLOAT s )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + s * (pV2->x - pV1->x);
- pOut->y = pV1->y + s * (pV2->y - pV1->y);
- return pOut;
-}
-
-
-//--------------------------
-// 3D Vector
-//--------------------------
-
-D3DX10INLINE FLOAT D3DXVec3Length
- ( CONST D3DXVECTOR3 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
-#ifdef __cplusplus
- return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z);
-#else
- return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z);
-#endif
-}
-
-D3DX10INLINE FLOAT D3DXVec3LengthSq
- ( CONST D3DXVECTOR3 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
- return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z;
-}
-
-D3DX10INLINE FLOAT D3DXVec3Dot
- ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pV1 || !pV2)
- return 0.0f;
-#endif
-
- return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Cross
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
- D3DXVECTOR3 v;
-
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- v.x = pV1->y * pV2->z - pV1->z * pV2->y;
- v.y = pV1->z * pV2->x - pV1->x * pV2->z;
- v.z = pV1->x * pV2->y - pV1->y * pV2->x;
-
- *pOut = v;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Add
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + pV2->x;
- pOut->y = pV1->y + pV2->y;
- pOut->z = pV1->z + pV2->z;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Subtract
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x - pV2->x;
- pOut->y = pV1->y - pV2->y;
- pOut->z = pV1->z - pV2->z;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Minimize
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y;
- pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Maximize
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y;
- pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Scale
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV)
- return NULL;
-#endif
-
- pOut->x = pV->x * s;
- pOut->y = pV->y * s;
- pOut->z = pV->z * s;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR3* D3DXVec3Lerp
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
- FLOAT s )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + s * (pV2->x - pV1->x);
- pOut->y = pV1->y + s * (pV2->y - pV1->y);
- pOut->z = pV1->z + s * (pV2->z - pV1->z);
- return pOut;
-}
-
-
-//--------------------------
-// 4D Vector
-//--------------------------
-
-D3DX10INLINE FLOAT D3DXVec4Length
- ( CONST D3DXVECTOR4 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
-#ifdef __cplusplus
- return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w);
-#else
- return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w);
-#endif
-}
-
-D3DX10INLINE FLOAT D3DXVec4LengthSq
- ( CONST D3DXVECTOR4 *pV )
-{
-#ifdef D3DX10_DEBUG
- if(!pV)
- return 0.0f;
-#endif
-
- return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w;
-}
-
-D3DX10INLINE FLOAT D3DXVec4Dot
- ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pV1 || !pV2)
- return 0.0f;
-#endif
-
- return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Add
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + pV2->x;
- pOut->y = pV1->y + pV2->y;
- pOut->z = pV1->z + pV2->z;
- pOut->w = pV1->w + pV2->w;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Subtract
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x - pV2->x;
- pOut->y = pV1->y - pV2->y;
- pOut->z = pV1->z - pV2->z;
- pOut->w = pV1->w - pV2->w;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Minimize
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y;
- pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z;
- pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Maximize
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x;
- pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y;
- pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z;
- pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Scale
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV)
- return NULL;
-#endif
-
- pOut->x = pV->x * s;
- pOut->y = pV->y * s;
- pOut->z = pV->z * s;
- pOut->w = pV->w * s;
- return pOut;
-}
-
-D3DX10INLINE D3DXVECTOR4* D3DXVec4Lerp
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
- FLOAT s )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pV1 || !pV2)
- return NULL;
-#endif
-
- pOut->x = pV1->x + s * (pV2->x - pV1->x);
- pOut->y = pV1->y + s * (pV2->y - pV1->y);
- pOut->z = pV1->z + s * (pV2->z - pV1->z);
- pOut->w = pV1->w + s * (pV2->w - pV1->w);
- return pOut;
-}
-
-
-//--------------------------
-// 4D Matrix
-//--------------------------
-
-D3DX10INLINE D3DXMATRIX* D3DXMatrixIdentity
- ( D3DXMATRIX *pOut )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut)
- return NULL;
-#endif
-
- pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] =
- pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] =
- pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] =
- pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f;
-
- pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f;
- return pOut;
-}
-
-
-D3DX10INLINE BOOL D3DXMatrixIsIdentity
- ( CONST D3DXMATRIX *pM )
-{
-#ifdef D3DX10_DEBUG
- if(!pM)
- return FALSE;
-#endif
-
- return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f &&
- pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f &&
- pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f &&
- pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f;
-}
-
-
-//--------------------------
-// Quaternion
-//--------------------------
-
-D3DX10INLINE FLOAT D3DXQuaternionLength
- ( CONST D3DXQUATERNION *pQ )
-{
-#ifdef D3DX10_DEBUG
- if(!pQ)
- return 0.0f;
-#endif
-
-#ifdef __cplusplus
- return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w);
-#else
- return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w);
-#endif
-}
-
-D3DX10INLINE FLOAT D3DXQuaternionLengthSq
- ( CONST D3DXQUATERNION *pQ )
-{
-#ifdef D3DX10_DEBUG
- if(!pQ)
- return 0.0f;
-#endif
-
- return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w;
-}
-
-D3DX10INLINE FLOAT D3DXQuaternionDot
- ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 )
-{
-#ifdef D3DX10_DEBUG
- if(!pQ1 || !pQ2)
- return 0.0f;
-#endif
-
- return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w;
-}
-
-
-D3DX10INLINE D3DXQUATERNION* D3DXQuaternionIdentity
- ( D3DXQUATERNION *pOut )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut)
- return NULL;
-#endif
-
- pOut->x = pOut->y = pOut->z = 0.0f;
- pOut->w = 1.0f;
- return pOut;
-}
-
-D3DX10INLINE BOOL D3DXQuaternionIsIdentity
- ( CONST D3DXQUATERNION *pQ )
-{
-#ifdef D3DX10_DEBUG
- if(!pQ)
- return FALSE;
-#endif
-
- return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f;
-}
-
-
-D3DX10INLINE D3DXQUATERNION* D3DXQuaternionConjugate
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ )
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pQ)
- return NULL;
-#endif
-
- pOut->x = -pQ->x;
- pOut->y = -pQ->y;
- pOut->z = -pQ->z;
- pOut->w = pQ->w;
- return pOut;
-}
-
-
-//--------------------------
-// Plane
-//--------------------------
-
-D3DX10INLINE FLOAT D3DXPlaneDot
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV)
-{
-#ifdef D3DX10_DEBUG
- if(!pP || !pV)
- return 0.0f;
-#endif
-
- return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w;
-}
-
-D3DX10INLINE FLOAT D3DXPlaneDotCoord
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV)
-{
-#ifdef D3DX10_DEBUG
- if(!pP || !pV)
- return 0.0f;
-#endif
-
- return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d;
-}
-
-D3DX10INLINE FLOAT D3DXPlaneDotNormal
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV)
-{
-#ifdef D3DX10_DEBUG
- if(!pP || !pV)
- return 0.0f;
-#endif
-
- return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z;
-}
-
-D3DX10INLINE D3DXPLANE* D3DXPlaneScale
- (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pP)
- return NULL;
-#endif
-
- pOut->a = pP->a * s;
- pOut->b = pP->b * s;
- pOut->c = pP->c * s;
- pOut->d = pP->d * s;
- return pOut;
-}
-
-
-//--------------------------
-// Color
-//--------------------------
-
-D3DX10INLINE D3DXCOLOR* D3DXColorNegative
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC)
- return NULL;
-#endif
-
- pOut->r = 1.0f - pC->r;
- pOut->g = 1.0f - pC->g;
- pOut->b = 1.0f - pC->b;
- pOut->a = pC->a;
- return pOut;
-}
-
-D3DX10INLINE D3DXCOLOR* D3DXColorAdd
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC1 || !pC2)
- return NULL;
-#endif
-
- pOut->r = pC1->r + pC2->r;
- pOut->g = pC1->g + pC2->g;
- pOut->b = pC1->b + pC2->b;
- pOut->a = pC1->a + pC2->a;
- return pOut;
-}
-
-D3DX10INLINE D3DXCOLOR* D3DXColorSubtract
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC1 || !pC2)
- return NULL;
-#endif
-
- pOut->r = pC1->r - pC2->r;
- pOut->g = pC1->g - pC2->g;
- pOut->b = pC1->b - pC2->b;
- pOut->a = pC1->a - pC2->a;
- return pOut;
-}
-
-D3DX10INLINE D3DXCOLOR* D3DXColorScale
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC)
- return NULL;
-#endif
-
- pOut->r = pC->r * s;
- pOut->g = pC->g * s;
- pOut->b = pC->b * s;
- pOut->a = pC->a * s;
- return pOut;
-}
-
-D3DX10INLINE D3DXCOLOR* D3DXColorModulate
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC1 || !pC2)
- return NULL;
-#endif
-
- pOut->r = pC1->r * pC2->r;
- pOut->g = pC1->g * pC2->g;
- pOut->b = pC1->b * pC2->b;
- pOut->a = pC1->a * pC2->a;
- return pOut;
-}
-
-D3DX10INLINE D3DXCOLOR* D3DXColorLerp
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s)
-{
-#ifdef D3DX10_DEBUG
- if(!pOut || !pC1 || !pC2)
- return NULL;
-#endif
-
- pOut->r = pC1->r + s * (pC2->r - pC1->r);
- pOut->g = pC1->g + s * (pC2->g - pC1->g);
- pOut->b = pC1->b + s * (pC2->b - pC1->b);
- pOut->a = pC1->a + s * (pC2->a - pC1->a);
- return pOut;
-}
-
-
-#endif // __D3DXMATH_INL__
-
diff --git a/3rdparty/dxsdk/Include/D3DX_DXGIFormatConvert.inl b/3rdparty/dxsdk/Include/D3DX_DXGIFormatConvert.inl
deleted file mode 100644
index 1cfba727806..00000000000
--- a/3rdparty/dxsdk/Include/D3DX_DXGIFormatConvert.inl
+++ /dev/null
@@ -1,800 +0,0 @@
-//=============================================================================
-// D3D11 HLSL Routines for Manual Pack/Unpack of 32-bit DXGI_FORMAT_*
-//=============================================================================
-//
-// This file contains format conversion routines for use in the
-// Compute Shader or Pixel Shader on D3D11 Hardware.
-//
-// Skip to the end of this comment to see a summary of the routines
-// provided. The rest of the text below explains why they are needed
-// and how to use them.
-//
-// The scenario where these can be useful is if your application
-// needs to simultaneously both read and write texture - i.e. in-place
-// image editing.
-//
-// D3D11's Unordered Access View (UAV) of a Texture1D/2D/3D resource
-// allows random access reads and writes to memory from a Compute Shader
-// or Pixel Shader. However, the only texture format that supports this
-// is DXGI_FORMAT_R32_UINT. e.g. Other more interesting formats like
-// DXGI_FORMAT_R8G8B8A8_UNORM do not support simultaneous read and
-// write. You can use such formats for random access writing only
-// using a UAV, or reading only using a Shader Resource View (SRV).
-// But for simultaneous read+write, the format conversion hardware is
-// not available.
-//
-// There is a workaround to this limitation, involving casting the texture
-// to R32_UINT when creating a UAV, as long as the original format of the
-// resource supports it (most 32 bit per element formats). This allows
-// simultaneous read+write as long as the shader does manual format
-// unpacking on read and packing on write.
-//
-// The benefit is that later on, other views such as RenderTarget Views
-// or ShaderResource Views on the same texture can be used with the
-// proper format (e.g. DXGI_FORMAT_R16G16_FLOAT) so the hardware can
-// do the usual automatic format unpack/pack and do texture filtering etc.
-// where there are no hardware limitations.
-//
-// The sequence of actions for an application is the following:
-//
-// Suppose you want to make a texture than you can use a Pixel Shader
-// or Compute Shader to perform in-place editing, and that the format
-// you want the data to be stored in happens to be a descendent
-// of of one of these formats:
-//
-// DXGI_FORMAT_R10G10B10A2_TYPELESS
-// DXGI_FORMAT_R8G8B8A8_TYPELESS
-// DXGI_FORMAT_B8G8R8A8_TYPELESS
-// DXGI_FORMAT_B8G8R8X8_TYPELESS
-// DXGI_FORMAT_R16G16_TYPELESS
-//
-// e.g. DXGI_FORMAT_R10G10B10A2_UNORM is a descendent of
-// DXGI_FORMAT_R10G10B10A2_TYPELESS, so it supports the
-// usage pattern described here.
-//
-// (Formats descending from DXGI_FORMAT_R32_TYPELESS, such as
-// DXGI_FORMAT_R32_FLOAT, are trivially supported without
-// needing any of the format conversion help provided here.)
-//
-// Steps:
-//
-// (1) Create a texture with the appropriate _TYPELESS format above
-// along with the needed bind flags, such as
-// D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE.
-//
-// (2) For in-place image editing, create a UAV with the format
-// DXGI_FORMAT_R32_UINT. D3D normally doesn't allow casting
-// between different format "families", but the API makes
-// an exception here.
-//
-// (3) In the Compute Shader or Pixel Shader, use the appropriate
-// format pack/unpack routines provided in this file.
-// For example if the DXGI_FORMAT_R32_UINT UAV really holds
-// DXGI_FORMAT_R10G10B10A2_UNORM data, then, after reading a
-// uint from the UAV into the shader, unpack by calling:
-//
-// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
-//
-// Then to write to the UAV in the same shader, call the following
-// to pack shader data into a uint that can be written out:
-//
-// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// (4) Other views, such as SRVs, can be created with the desired format;
-// e.g. DXGI_FORMAT_R10G10B10A2_UNORM if the resource was created as
-// DXGI_FORMAT_R10G10B10A2_TYPELESS. When that view is accessed by a
-// shader, the hardware can do automatic type conversion as usual.
-//
-// Note, again, that if the shader only needs to write to a UAV, or read
-// as an SRV, then none of this is needed - fully typed UAV or SRVs can
-// be used. Only if simultaneous reading and writing to a UAV of a texture
-// is needed are the format conversion routines provided here potentially
-// useful.
-//
-// The following is the list of format conversion routines included in this
-// file, categorized by the DXGI_FORMAT they unpack/pack. Each of the
-// formats supported descends from one of the TYPELESS formats listed
-// above, and supports casting to DXGI_FORMAT_R32_UINT as a UAV.
-//
-// DXGI_FORMAT_R10G10B10A2_UNORM:
-//
-// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// DXGI_FORMAT_R10G10B10A2_UINT:
-//
-// XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
-// UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
-//
-// DXGI_FORMAT_R8G8B8A8_UNORM:
-//
-// XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-//
-// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
-// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// * The "_inexact" function above uses shader instructions that don't
-// have high enough precision to give the exact answer, albeit close.
-// The alternative function uses a lookup table stored in the shader
-// to give an exact SRGB->float conversion.
-//
-// DXGI_FORMAT_R8G8B8A8_UINT:
-//
-// XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
-// XMUINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
-//
-// DXGI_FORMAT_R8G8B8A8_SNORM:
-//
-// XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// DXGI_FORMAT_R8G8B8A8_SINT:
-//
-// XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
-// UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
-//
-// DXGI_FORMAT_B8G8R8A8_UNORM:
-//
-// XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
-//
-// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
-// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
-// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
-//
-// * The "_inexact" function above uses shader instructions that don't
-// have high enough precision to give the exact answer, albeit close.
-// The alternative function uses a lookup table stored in the shader
-// to give an exact SRGB->float conversion.
-//
-// DXGI_FORMAT_B8G8R8X8_UNORM:
-//
-// XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
-// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
-//
-// DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
-//
-// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput) *
-// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
-// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
-//
-// * The "_inexact" function above uses shader instructions that don't
-// have high enough precision to give the exact answer, albeit close.
-// The alternative function uses a lookup table stored in the shader
-// to give an exact SRGB->float conversion.
-//
-// DXGI_FORMAT_R16G16_FLOAT:
-//
-// XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
-// UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
-//
-// DXGI_FORMAT_R16G16_UNORM:
-//
-// XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
-// UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise FLOAT2 unpackedInput)
-//
-// DXGI_FORMAT_R16G16_UINT:
-//
-// XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
-// UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
-//
-// DXGI_FORMAT_R16G16_SNORM:
-//
-// XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
-// UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
-//
-// DXGI_FORMAT_R16G16_SINT:
-//
-// XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
-// UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
-//
-//=============================================================================
-
-#ifndef __D3DX_DXGI_FORMAT_CONVERT_INL___
-#define __D3DX_DXGI_FORMAT_CONVERT_INL___
-
-#if HLSL_VERSION > 0
-
-#define D3DX11INLINE
-
-typedef int INT;
-typedef uint UINT;
-
-typedef float2 XMFLOAT2;
-typedef float3 XMFLOAT3;
-typedef float4 XMFLOAT4;
-typedef int2 XMINT2;
-typedef int4 XMINT4;
-typedef uint2 XMUINT2;
-typedef uint4 XMUINT4;
-
-#define hlsl_precise precise
-
-#define D3DX_Saturate_FLOAT(_V) saturate(_V)
-#define D3DX_IsNan(_V) isnan(_V)
-#define D3DX_Truncate_FLOAT(_V) trunc(_V)
-
-#else // HLSL_VERSION > 0
-
-#ifndef __cplusplus
-#error C++ compilation required
-#endif
-
-#include <float.h>
-#include <xnamath.h>
-
-#define hlsl_precise
-
-D3DX11INLINE FLOAT D3DX_Saturate_FLOAT(FLOAT _V)
-{
- return min(max(_V, 0), 1);
-}
-D3DX11INLINE bool D3DX_IsNan(FLOAT _V)
-{
- return _V != _V;
-}
-D3DX11INLINE FLOAT D3DX_Truncate_FLOAT(FLOAT _V)
-{
- return _V >= 0 ? floor(_V) : ceil(_V);
-}
-
-// 2D Vector; 32 bit signed integer components
-typedef struct _XMINT2
-{
- INT x;
- INT y;
-} XMINT2;
-
-// 2D Vector; 32 bit unsigned integer components
-typedef struct _XMUINT2
-{
- UINT x;
- UINT y;
-} XMUINT2;
-
-// 4D Vector; 32 bit signed integer components
-typedef struct _XMINT4
-{
- INT x;
- INT y;
- INT z;
- INT w;
-} XMINT4;
-
-// 4D Vector; 32 bit unsigned integer components
-typedef struct _XMUINT4
-{
- UINT x;
- UINT y;
- UINT z;
- UINT w;
-} XMUINT4;
-
-#endif // HLSL_VERSION > 0
-
-//=============================================================================
-// SRGB Helper Functions Called By Conversions Further Below.
-//=============================================================================
-// SRGB_to_FLOAT_inexact is imprecise due to precision of pow implementations.
-// If exact SRGB->float conversion is needed, a table lookup is provided
-// further below.
-D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT_inexact(hlsl_precise FLOAT val)
-{
- if( val < 0.04045f )
- val /= 12.92f;
- else
- val = pow((val + 0.055f)/1.055f,2.4f);
- return val;
-}
-
-static const UINT D3DX_SRGBTable[] =
-{
- 0x00000000,0x399f22b4,0x3a1f22b4,0x3a6eb40e,0x3a9f22b4,0x3ac6eb61,0x3aeeb40e,0x3b0b3e5d,
- 0x3b1f22b4,0x3b33070b,0x3b46eb61,0x3b5b518d,0x3b70f18d,0x3b83e1c6,0x3b8fe616,0x3b9c87fd,
- 0x3ba9c9b7,0x3bb7ad6f,0x3bc63549,0x3bd56361,0x3be539c1,0x3bf5ba70,0x3c0373b5,0x3c0c6152,
- 0x3c15a703,0x3c1f45be,0x3c293e6b,0x3c3391f7,0x3c3e4149,0x3c494d43,0x3c54b6c7,0x3c607eb1,
- 0x3c6ca5df,0x3c792d22,0x3c830aa8,0x3c89af9f,0x3c9085db,0x3c978dc5,0x3c9ec7c2,0x3ca63433,
- 0x3cadd37d,0x3cb5a601,0x3cbdac20,0x3cc5e639,0x3cce54ab,0x3cd6f7d5,0x3cdfd010,0x3ce8ddb9,
- 0x3cf2212c,0x3cfb9ac1,0x3d02a569,0x3d0798dc,0x3d0ca7e6,0x3d11d2af,0x3d171963,0x3d1c7c2e,
- 0x3d21fb3c,0x3d2796b2,0x3d2d4ebb,0x3d332380,0x3d39152b,0x3d3f23e3,0x3d454fd1,0x3d4b991c,
- 0x3d51ffef,0x3d58846a,0x3d5f26b7,0x3d65e6fe,0x3d6cc564,0x3d73c20f,0x3d7add29,0x3d810b67,
- 0x3d84b795,0x3d887330,0x3d8c3e4a,0x3d9018f6,0x3d940345,0x3d97fd4a,0x3d9c0716,0x3da020bb,
- 0x3da44a4b,0x3da883d7,0x3daccd70,0x3db12728,0x3db59112,0x3dba0b3b,0x3dbe95b5,0x3dc33092,
- 0x3dc7dbe2,0x3dcc97b6,0x3dd1641f,0x3dd6412c,0x3ddb2eef,0x3de02d77,0x3de53cd5,0x3dea5d19,
- 0x3def8e52,0x3df4d091,0x3dfa23e8,0x3dff8861,0x3e027f07,0x3e054280,0x3e080ea3,0x3e0ae378,
- 0x3e0dc105,0x3e10a754,0x3e13966b,0x3e168e52,0x3e198f10,0x3e1c98ad,0x3e1fab30,0x3e22c6a3,
- 0x3e25eb09,0x3e29186c,0x3e2c4ed0,0x3e2f8e41,0x3e32d6c4,0x3e362861,0x3e39831e,0x3e3ce703,
- 0x3e405416,0x3e43ca5f,0x3e4749e4,0x3e4ad2ae,0x3e4e64c2,0x3e520027,0x3e55a4e6,0x3e595303,
- 0x3e5d0a8b,0x3e60cb7c,0x3e6495e0,0x3e6869bf,0x3e6c4720,0x3e702e0c,0x3e741e84,0x3e781890,
- 0x3e7c1c38,0x3e8014c2,0x3e82203c,0x3e84308d,0x3e8645ba,0x3e885fc5,0x3e8a7eb2,0x3e8ca283,
- 0x3e8ecb3d,0x3e90f8e1,0x3e932b74,0x3e9562f8,0x3e979f71,0x3e99e0e2,0x3e9c274e,0x3e9e72b7,
- 0x3ea0c322,0x3ea31892,0x3ea57308,0x3ea7d289,0x3eaa3718,0x3eaca0b7,0x3eaf0f69,0x3eb18333,
- 0x3eb3fc18,0x3eb67a18,0x3eb8fd37,0x3ebb8579,0x3ebe12e1,0x3ec0a571,0x3ec33d2d,0x3ec5da17,
- 0x3ec87c33,0x3ecb2383,0x3ecdd00b,0x3ed081cd,0x3ed338cc,0x3ed5f50b,0x3ed8b68d,0x3edb7d54,
- 0x3ede4965,0x3ee11ac1,0x3ee3f16b,0x3ee6cd67,0x3ee9aeb6,0x3eec955d,0x3eef815d,0x3ef272ba,
- 0x3ef56976,0x3ef86594,0x3efb6717,0x3efe6e02,0x3f00bd2d,0x3f02460e,0x3f03d1a7,0x3f055ff9,
- 0x3f06f106,0x3f0884cf,0x3f0a1b56,0x3f0bb49b,0x3f0d50a0,0x3f0eef67,0x3f1090f1,0x3f12353e,
- 0x3f13dc51,0x3f15862b,0x3f1732cd,0x3f18e239,0x3f1a946f,0x3f1c4971,0x3f1e0141,0x3f1fbbdf,
- 0x3f21794e,0x3f23398e,0x3f24fca0,0x3f26c286,0x3f288b41,0x3f2a56d3,0x3f2c253d,0x3f2df680,
- 0x3f2fca9e,0x3f31a197,0x3f337b6c,0x3f355820,0x3f3737b3,0x3f391a26,0x3f3aff7c,0x3f3ce7b5,
- 0x3f3ed2d2,0x3f40c0d4,0x3f42b1be,0x3f44a590,0x3f469c4b,0x3f4895f1,0x3f4a9282,0x3f4c9201,
- 0x3f4e946e,0x3f5099cb,0x3f52a218,0x3f54ad57,0x3f56bb8a,0x3f58ccb0,0x3f5ae0cd,0x3f5cf7e0,
- 0x3f5f11ec,0x3f612eee,0x3f634eef,0x3f6571e9,0x3f6797e3,0x3f69c0d6,0x3f6beccd,0x3f6e1bbf,
- 0x3f704db8,0x3f7282af,0x3f74baae,0x3f76f5ae,0x3f7933b9,0x3f7b74c6,0x3f7db8e0,0x3f800000
-};
-
-D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT(UINT val)
-{
-#if HLSL_VERSION > 0
- return asfloat(D3DX_SRGBTable[val]);
-#else
- return *(FLOAT*)&D3DX_SRGBTable[val];
-#endif
-}
-
-D3DX11INLINE FLOAT D3DX_FLOAT_to_SRGB(hlsl_precise FLOAT val)
-{
- if( val < 0.0031308f )
- val *= 12.92f;
- else
- val = 1.055f * pow(val,1.0f/2.4f) - 0.055f;
- return val;
-}
-
-D3DX11INLINE FLOAT D3DX_SaturateSigned_FLOAT(FLOAT _V)
-{
- if (D3DX_IsNan(_V))
- {
- return 0;
- }
-
- return min(max(_V, -1), 1);
-}
-
-D3DX11INLINE UINT D3DX_FLOAT_to_UINT(FLOAT _V,
- FLOAT _Scale)
-{
- return (UINT)floor(_V * _Scale + 0.5f);
-}
-
-D3DX11INLINE FLOAT D3DX_INT_to_FLOAT(INT _V,
- FLOAT _Scale)
-{
- FLOAT Scaled = (FLOAT)_V / _Scale;
- // The integer is a two's-complement signed
- // number so the negative range is slightly
- // larger than the positive range, meaning
- // the scaled value can be slight less than -1.
- // Clamp to keep the float range [-1, 1].
- return max(Scaled, -1.0f);
-}
-
-D3DX11INLINE INT D3DX_FLOAT_to_INT(FLOAT _V,
- FLOAT _Scale)
-{
- return (INT)D3DX_Truncate_FLOAT(_V * _Scale + (_V >= 0 ? 0.5f : -0.5f));
-}
-
-//=============================================================================
-// Conversion routines
-//=============================================================================
-//-----------------------------------------------------------------------------
-// R10B10G10A2_UNORM <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.x = (FLOAT) (packedInput & 0x000003ff) / 1023;
- unpackedOutput.y = (FLOAT)(((packedInput>>10) & 0x000003ff)) / 1023;
- unpackedOutput.z = (FLOAT)(((packedInput>>20) & 0x000003ff)) / 1023;
- unpackedOutput.w = (FLOAT)(((packedInput>>30) & 0x00000003)) / 3;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 1023)) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 1023)<<10) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 1023)<<20) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 3)<<30) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R10B10G10A2_UINT <-> UINT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
-{
- XMUINT4 unpackedOutput;
- unpackedOutput.x = packedInput & 0x000003ff;
- unpackedOutput.y = (packedInput>>10) & 0x000003ff;
- unpackedOutput.z = (packedInput>>20) & 0x000003ff;
- unpackedOutput.w = (packedInput>>30) & 0x00000003;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = min(unpackedInput.x, 0x000003ff);
- unpackedInput.y = min(unpackedInput.y, 0x000003ff);
- unpackedInput.z = min(unpackedInput.z, 0x000003ff);
- unpackedInput.w = min(unpackedInput.w, 0x00000003);
- packedOutput = ( (unpackedInput.x) |
- ((unpackedInput.y)<<10) |
- ((unpackedInput.z)<<20) |
- ((unpackedInput.w)<<30) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R8G8B8A8_UNORM <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.x = (FLOAT) (packedInput & 0x000000ff) / 255;
- unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
- unpackedOutput.z = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
- unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)<<16) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R8G8B8A8_UNORM_SRGB <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
- unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
- unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
- unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.x = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
- unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
- unpackedOutput.z = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
- unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
- unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
- unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
- unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
- packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)) |
- (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
- (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)<<16) |
- (D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R8G8B8A8_UINT <-> UINT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
-{
- XMUINT4 unpackedOutput;
- unpackedOutput.x = packedInput & 0x000000ff;
- unpackedOutput.y = (packedInput>> 8) & 0x000000ff;
- unpackedOutput.z = (packedInput>>16) & 0x000000ff;
- unpackedOutput.w = packedInput>>24;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = min(unpackedInput.x, 0x000000ff);
- unpackedInput.y = min(unpackedInput.y, 0x000000ff);
- unpackedInput.z = min(unpackedInput.z, 0x000000ff);
- unpackedInput.w = min(unpackedInput.w, 0x000000ff);
- packedOutput = ( unpackedInput.x |
- (unpackedInput.y<< 8) |
- (unpackedInput.z<<16) |
- (unpackedInput.w<<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R8G8B8A8_SNORM <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- XMINT4 signExtendedBits;
- signExtendedBits.x = (INT)(packedInput << 24) >> 24;
- signExtendedBits.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
- signExtendedBits.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
- signExtendedBits.w = (INT)(packedInput & 0xff000000) >> 24;
- unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 127);
- unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 127);
- unpackedOutput.z = D3DX_INT_to_FLOAT(signExtendedBits.z, 127);
- unpackedOutput.w = D3DX_INT_to_FLOAT(signExtendedBits.w, 127);
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 127) & 0x000000ff) |
- ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 127) & 0x000000ff)<< 8) |
- ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.z), 127) & 0x000000ff)<<16) |
- ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.w), 127)) <<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R8G8B8A8_SINT <-> INT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
-{
- XMINT4 unpackedOutput;
- unpackedOutput.x = (INT)(packedInput << 24) >> 24;
- unpackedOutput.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
- unpackedOutput.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
- unpackedOutput.w = (INT)(packedInput & 0xff000000) >> 24;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = max(min(unpackedInput.x,127),-128);
- unpackedInput.y = max(min(unpackedInput.y,127),-128);
- unpackedInput.z = max(min(unpackedInput.z,127),-128);
- unpackedInput.w = max(min(unpackedInput.w,127),-128);
- packedOutput = ( (unpackedInput.x & 0x000000ff) |
- ((unpackedInput.y & 0x000000ff)<< 8) |
- ((unpackedInput.z & 0x000000ff)<<16) |
- (unpackedInput.w <<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// B8G8R8A8_UNORM <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
- unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
- unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
- unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// B8G8R8A8_UNORM_SRGB <-> FLOAT4
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
- unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
- unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
- unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
-{
- hlsl_precise XMFLOAT4 unpackedOutput;
- unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
- unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
- unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
- unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
- unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
- unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
- unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
- packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
- (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
- (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) |
- (D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// B8G8R8X8_UNORM <-> FLOAT3
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
-{
- hlsl_precise XMFLOAT3 unpackedOutput;
- unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
- unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
- unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// B8G8R8X8_UNORM_SRGB <-> FLOAT3
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput)
-{
- hlsl_precise XMFLOAT3 unpackedOutput;
- unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
- unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
- unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
- return unpackedOutput;
-}
-
-D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
-{
- hlsl_precise XMFLOAT3 unpackedOutput;
- unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
- unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
- unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
- unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
- unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
- packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
- (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
- (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R16G16_FLOAT <-> FLOAT2
-//-----------------------------------------------------------------------------
-
-#if HLSL_VERSION > 0
-
-D3DX11INLINE XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
-{
- hlsl_precise XMFLOAT2 unpackedOutput;
- unpackedOutput.x = f16tof32(packedInput&0x0000ffff);
- unpackedOutput.y = f16tof32(packedInput>>16);
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = asuint(f32tof16(unpackedInput.x)) |
- (asuint(f32tof16(unpackedInput.y)) << 16);
- return packedOutput;
-}
-
-#endif // HLSL_VERSION > 0
-
-//-----------------------------------------------------------------------------
-// R16G16_UNORM <-> FLOAT2
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
-{
- hlsl_precise XMFLOAT2 unpackedOutput;
- unpackedOutput.x = (FLOAT) (packedInput & 0x0000ffff) / 65535;
- unpackedOutput.y = (FLOAT) (packedInput>>16) / 65535;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise XMFLOAT2 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 65535)) |
- (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 65535)<< 16) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R16G16_UINT <-> UINT2
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
-{
- XMUINT2 unpackedOutput;
- unpackedOutput.x = packedInput & 0x0000ffff;
- unpackedOutput.y = packedInput>>16;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = min(unpackedInput.x,0x0000ffff);
- unpackedInput.y = min(unpackedInput.y,0x0000ffff);
- packedOutput = ( unpackedInput.x |
- (unpackedInput.y<<16) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R16G16_SNORM <-> FLOAT2
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
-{
- hlsl_precise XMFLOAT2 unpackedOutput;
- XMINT2 signExtendedBits;
- signExtendedBits.x = (INT)(packedInput << 16) >> 16;
- signExtendedBits.y = (INT)(packedInput & 0xffff0000) >> 16;
- unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 32767);
- unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 32767);
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
-{
- UINT packedOutput;
- packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 32767) & 0x0000ffff) |
- (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 32767) <<16) );
- return packedOutput;
-}
-
-//-----------------------------------------------------------------------------
-// R16G16_SINT <-> INT2
-//-----------------------------------------------------------------------------
-D3DX11INLINE XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
-{
- XMINT2 unpackedOutput;
- unpackedOutput.x = (INT)(packedInput << 16) >> 16;
- unpackedOutput.y = (INT)(packedInput & 0xffff0000) >> 16;
- return unpackedOutput;
-}
-
-D3DX11INLINE UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
-{
- UINT packedOutput;
- unpackedInput.x = max(min(unpackedInput.x,32767),-32768);
- unpackedInput.y = max(min(unpackedInput.y,32767),-32768);
- packedOutput = ( (unpackedInput.x & 0x0000ffff) |
- (unpackedInput.y <<16) );
- return packedOutput;
-}
-
-#endif // __D3DX_DXGI_FORMAT_CONVERT_INL___
diff --git a/3rdparty/dxsdk/Include/DWrite.h b/3rdparty/dxsdk/Include/DWrite.h
deleted file mode 100644
index fc3b637ad33..00000000000
--- a/3rdparty/dxsdk/Include/DWrite.h
+++ /dev/null
@@ -1,4995 +0,0 @@
-//+--------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Abstract:
-// DirectX Typography Services public API definitions.
-//
-//----------------------------------------------------------------------------
-
-#ifndef DWRITE_H_INCLUDED
-#define DWRITE_H_INCLUDED
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#ifndef DWRITE_NO_WINDOWS_H
-
-#include <specstrings.h>
-#include <unknwn.h>
-
-#endif // DWRITE_NO_WINDOWS_H
-
-#include <dcommon.h>
-
-#ifndef DWRITE_DECLARE_INTERFACE
-#define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE
-#endif
-
-#ifndef DWRITE_EXPORT
-#define DWRITE_EXPORT __declspec(dllimport) WINAPI
-#endif
-
-/// <summary>
-/// The type of a font represented by a single font file.
-/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
-/// separate enum values for each of the file type.
-/// </summary>
-enum DWRITE_FONT_FILE_TYPE
-{
- /// <summary>
- /// Font type is not recognized by the DirectWrite font system.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_UNKNOWN,
-
- /// <summary>
- /// OpenType font with CFF outlines.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_CFF,
-
- /// <summary>
- /// OpenType font with TrueType outlines.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TRUETYPE,
-
- /// <summary>
- /// OpenType font that contains a TrueType collection.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
-
- /// <summary>
- /// Type 1 PFM font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TYPE1_PFM,
-
- /// <summary>
- /// Type 1 PFB font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TYPE1_PFB,
-
- /// <summary>
- /// Vector .FON font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_VECTOR,
-
- /// <summary>
- /// Bitmap .FON font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_BITMAP
-};
-
-/// <summary>
-/// The file format of a complete font face.
-/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
-/// a single enum entry.
-/// </summary>
-enum DWRITE_FONT_FACE_TYPE
-{
- /// <summary>
- /// OpenType font face with CFF outlines.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_CFF,
-
- /// <summary>
- /// OpenType font face with TrueType outlines.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TRUETYPE,
-
- /// <summary>
- /// OpenType font face that is a part of a TrueType collection.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
-
- /// <summary>
- /// A Type 1 font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TYPE1,
-
- /// <summary>
- /// A vector .FON format font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_VECTOR,
-
- /// <summary>
- /// A bitmap .FON format font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_BITMAP,
-
- /// <summary>
- /// Font face type is not recognized by the DirectWrite font system.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_UNKNOWN
-};
-
-/// <summary>
-/// Specifies algorithmic style simulations to be applied to the font face.
-/// Bold and oblique simulations can be combined via bitwise OR operation.
-/// </summary>
-enum DWRITE_FONT_SIMULATIONS
-{
- /// <summary>
- /// No simulations are performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
-
- /// <summary>
- /// Algorithmic emboldening is performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
-
- /// <summary>
- /// Algorithmic italicization is performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
-};
-
-#ifdef DEFINE_ENUM_FLAG_OPERATORS
-DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);
-#endif
-
-/// <summary>
-/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font.
-/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_WEIGHT
-{
- /// <summary>
- /// Predefined font weight : Thin (100).
- /// </summary>
- DWRITE_FONT_WEIGHT_THIN = 100,
-
- /// <summary>
- /// Predefined font weight : Extra-light (200).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200,
-
- /// <summary>
- /// Predefined font weight : Ultra-light (200).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
-
- /// <summary>
- /// Predefined font weight : Light (300).
- /// </summary>
- DWRITE_FONT_WEIGHT_LIGHT = 300,
-
- /// <summary>
- /// Predefined font weight : Normal (400).
- /// </summary>
- DWRITE_FONT_WEIGHT_NORMAL = 400,
-
- /// <summary>
- /// Predefined font weight : Regular (400).
- /// </summary>
- DWRITE_FONT_WEIGHT_REGULAR = 400,
-
- /// <summary>
- /// Predefined font weight : Medium (500).
- /// </summary>
- DWRITE_FONT_WEIGHT_MEDIUM = 500,
-
- /// <summary>
- /// Predefined font weight : Demi-bold (600).
- /// </summary>
- DWRITE_FONT_WEIGHT_DEMI_BOLD = 600,
-
- /// <summary>
- /// Predefined font weight : Semi-bold (600).
- /// </summary>
- DWRITE_FONT_WEIGHT_SEMI_BOLD = 600,
-
- /// <summary>
- /// Predefined font weight : Bold (700).
- /// </summary>
- DWRITE_FONT_WEIGHT_BOLD = 700,
-
- /// <summary>
- /// Predefined font weight : Extra-bold (800).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800,
-
- /// <summary>
- /// Predefined font weight : Ultra-bold (800).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800,
-
- /// <summary>
- /// Predefined font weight : Black (900).
- /// </summary>
- DWRITE_FONT_WEIGHT_BLACK = 900,
-
- /// <summary>
- /// Predefined font weight : Heavy (900).
- /// </summary>
- DWRITE_FONT_WEIGHT_HEAVY = 900,
-
- /// <summary>
- /// Predefined font weight : Extra-black (950).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950,
-
- /// <summary>
- /// Predefined font weight : Ultra-black (950).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
-};
-
-/// <summary>
-/// The font stretch enumeration describes relative change from the normal aspect ratio
-/// as specified by a font designer for the glyphs in a font.
-/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_STRETCH
-{
- /// <summary>
- /// Predefined font stretch : Not known (0).
- /// </summary>
- DWRITE_FONT_STRETCH_UNDEFINED = 0,
-
- /// <summary>
- /// Predefined font stretch : Ultra-condensed (1).
- /// </summary>
- DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1,
-
- /// <summary>
- /// Predefined font stretch : Extra-condensed (2).
- /// </summary>
- DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2,
-
- /// <summary>
- /// Predefined font stretch : Condensed (3).
- /// </summary>
- DWRITE_FONT_STRETCH_CONDENSED = 3,
-
- /// <summary>
- /// Predefined font stretch : Semi-condensed (4).
- /// </summary>
- DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4,
-
- /// <summary>
- /// Predefined font stretch : Normal (5).
- /// </summary>
- DWRITE_FONT_STRETCH_NORMAL = 5,
-
- /// <summary>
- /// Predefined font stretch : Medium (5).
- /// </summary>
- DWRITE_FONT_STRETCH_MEDIUM = 5,
-
- /// <summary>
- /// Predefined font stretch : Semi-expanded (6).
- /// </summary>
- DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
-
- /// <summary>
- /// Predefined font stretch : Expanded (7).
- /// </summary>
- DWRITE_FONT_STRETCH_EXPANDED = 7,
-
- /// <summary>
- /// Predefined font stretch : Extra-expanded (8).
- /// </summary>
- DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
-
- /// <summary>
- /// Predefined font stretch : Ultra-expanded (9).
- /// </summary>
- DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
-};
-
-/// <summary>
-/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique.
-/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_STYLE
-{
- /// <summary>
- /// Font slope style : Normal.
- /// </summary>
- DWRITE_FONT_STYLE_NORMAL,
-
- /// <summary>
- /// Font slope style : Oblique.
- /// </summary>
- DWRITE_FONT_STYLE_OBLIQUE,
-
- /// <summary>
- /// Font slope style : Italic.
- /// </summary>
- DWRITE_FONT_STYLE_ITALIC
-
-};
-
-/// <summary>
-/// The informational string enumeration identifies a string in a font.
-/// </summary>
-enum DWRITE_INFORMATIONAL_STRING_ID
-{
- /// <summary>
- /// Unspecified name ID.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_NONE,
-
- /// <summary>
- /// Copyright notice provided by the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE,
-
- /// <summary>
- /// String containing a version number.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS,
-
- /// <summary>
- /// Trademark information provided by the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_TRADEMARK,
-
- /// <summary>
- /// Name of the font manufacturer.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_MANUFACTURER,
-
- /// <summary>
- /// Name of the font designer.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESIGNER,
-
- /// <summary>
- /// URL of font designer (with protocol, e.g., http://, ftp://).
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESIGNER_URL,
-
- /// <summary>
- /// Description of the font. Can contain revision information, usage recommendations, history, features, etc.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESCRIPTION,
-
- /// <summary>
- /// URL of font vendor (with protocol, e.g., http://, ftp://). If a unique serial number is embedded in the URL, it can be used to register the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL,
-
- /// <summary>
- /// Description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION,
-
- /// <summary>
- /// URL where additional licensing information can be found.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL,
-
- /// <summary>
- /// GDI-compatible family name. Because GDI allows a maximum of four fonts per family, fonts in the same family may have different GDI-compatible family names
- /// (e.g., "Arial", "Arial Narrow", "Arial Black").
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
-
- /// <summary>
- /// GDI-compatible subfamily name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES,
-
- /// <summary>
- /// Family name preferred by the designer. This enables font designers to group more than four fonts in a single family without losing compatibility with
- /// GDI. This name is typically only present if it differs from the GDI-compatible family name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
-
- /// <summary>
- /// Subfamily name preferred by the designer. This name is typically only present if it differs from the GDI-compatible subfamily name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
-
- /// <summary>
- /// Sample text. This can be the font name or any other text that the designer thinks is the best example to display the font in.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
-};
-
-
-/// <summary>
-/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that
-/// are applicable to all glyphs within the font face.
-/// </summary>
-struct DWRITE_FONT_METRICS
-{
- /// <summary>
- /// The number of font design units per em unit.
- /// Font files use their own coordinate system of font design units.
- /// A font design unit is the smallest measurable unit in the em square,
- /// an imaginary square that is used to size and align glyphs.
- /// The concept of em square is used as a reference scale factor when defining font size and device transformation semantics.
- /// The size of one em square is also commonly used to compute the paragraph identation value.
- /// </summary>
- UINT16 designUnitsPerEm;
-
- /// <summary>
- /// Ascent value of the font face in font design units.
- /// Ascent is the distance from the top of font character alignment box to English baseline.
- /// </summary>
- UINT16 ascent;
-
- /// <summary>
- /// Descent value of the font face in font design units.
- /// Descent is the distance from the bottom of font character alignment box to English baseline.
- /// </summary>
- UINT16 descent;
-
- /// <summary>
- /// Line gap in font design units.
- /// Recommended additional white space to add between lines to improve legibility. The recommended line spacing
- /// (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually
- /// positive or zero but can be negative, in which case the recommended line spacing is less than the height
- /// of the character alignment box.
- /// </summary>
- INT16 lineGap;
-
- /// <summary>
- /// Cap height value of the font face in font design units.
- /// Cap height is the distance from English baseline to the top of a typical English capital.
- /// Capital "H" is often used as a reference character for the purpose of calculating the cap height value.
- /// </summary>
- UINT16 capHeight;
-
- /// <summary>
- /// x-height value of the font face in font design units.
- /// x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character.
- /// </summary>
- UINT16 xHeight;
-
- /// <summary>
- /// The underline position value of the font face in font design units.
- /// Underline position is the position of underline relative to the English baseline.
- /// The value is usually made negative in order to place the underline below the baseline.
- /// </summary>
- INT16 underlinePosition;
-
- /// <summary>
- /// The suggested underline thickness value of the font face in font design units.
- /// </summary>
- UINT16 underlineThickness;
-
- /// <summary>
- /// The strikethrough position value of the font face in font design units.
- /// Strikethrough position is the position of strikethrough relative to the English baseline.
- /// The value is usually made positive in order to place the strikethrough above the baseline.
- /// </summary>
- INT16 strikethroughPosition;
-
- /// <summary>
- /// The suggested strikethrough thickness value of the font face in font design units.
- /// </summary>
- UINT16 strikethroughThickness;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph.
-/// The units depend on how the metrics are obtained.
-/// </summary>
-struct DWRITE_GLYPH_METRICS
-{
- /// <summary>
- /// Specifies the X offset from the glyph origin to the left edge of the black box.
- /// The glyph origin is the current horizontal writing position.
- /// A negative value means the black box extends to the left of the origin (often true for lowercase italic 'f').
- /// </summary>
- INT32 leftSideBearing;
-
- /// <summary>
- /// Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writing horizontally.
- /// </summary>
- UINT32 advanceWidth;
-
- /// <summary>
- /// Specifies the X offset from the right edge of the black box to the origin of the next glyph when writing horizontally.
- /// The value is negative when the right edge of the black box overhangs the layout box.
- /// </summary>
- INT32 rightSideBearing;
-
- /// <summary>
- /// Specifies the vertical offset from the vertical origin to the top of the black box.
- /// Thus, a positive value adds whitespace whereas a negative value means the glyph overhangs the top of the layout box.
- /// </summary>
- INT32 topSideBearing;
-
- /// <summary>
- /// Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the next glyph when writing vertically.
- /// (Note that the term "origin" by itself denotes the horizontal origin. The vertical origin is different.
- /// Its Y coordinate is specified by verticalOriginY value,
- /// and its X coordinate is half the advanceWidth to the right of the horizontal origin).
- /// </summary>
- UINT32 advanceHeight;
-
- /// <summary>
- /// Specifies the vertical distance from the black box's bottom edge to the advance height.
- /// Positive when the bottom edge of the black box is within the layout box.
- /// Negative when the bottom edge of black box overhangs the layout box.
- /// </summary>
- INT32 bottomSideBearing;
-
- /// <summary>
- /// Specifies the Y coordinate of a glyph's vertical origin, in the font's design coordinate system.
- /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing
- /// and the top (i.e. yMax) of the glyph's bounding box.
- /// </summary>
- INT32 verticalOriginY;
-};
-
-/// <summary>
-/// Optional adjustment to a glyph's position. An glyph offset changes the position of a glyph without affecting
-/// the pen position. Offsets are in logical, pre-transform units.
-/// </summary>
-struct DWRITE_GLYPH_OFFSET
-{
- /// <summary>
- /// Offset in the advance direction of the run. A positive advance offset moves the glyph to the right
- /// (in pre-transform coordinates) if the run is left-to-right or to the left if the run is right-to-left.
- /// </summary>
- FLOAT advanceOffset;
-
- /// <summary>
- /// Offset in the ascent direction, i.e., the direction ascenders point. A positive ascender offset moves
- /// the glyph up (in pre-transform coordinates).
- /// </summary>
- FLOAT ascenderOffset;
-};
-
-/// <summary>
-/// Specifies the type of DirectWrite factory object.
-/// DirectWrite factory contains internal state such as font loader registration and cached font data.
-/// In most cases it is recommended to use the shared factory object, because it allows multiple components
-/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
-/// However, there are cases when it is desirable to reduce the impact of a component,
-/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
-/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
-/// component.
-/// </summary>
-enum DWRITE_FACTORY_TYPE
-{
- /// <summary>
- /// Shared factory allow for re-use of cached font data across multiple in process components.
- /// Such factories also take advantage of cross process font caching components for better performance.
- /// </summary>
- DWRITE_FACTORY_TYPE_SHARED,
-
- /// <summary>
- /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components.
- /// </summary>
- DWRITE_FACTORY_TYPE_ISOLATED
-};
-
-// Creates an OpenType tag as a 32bit integer such that
-// the first character in the tag is the lowest byte,
-// (least significant on little endian architectures)
-// which can be used to compare with tags in the font file.
-// This macro is compatible with DWRITE_FONT_FEATURE_TAG.
-//
-// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p')
-// Dword: 0x706D6363
-//
-#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \
- (static_cast<UINT32>(static_cast<UINT8>(d)) << 24) | \
- (static_cast<UINT32>(static_cast<UINT8>(c)) << 16) | \
- (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
- static_cast<UINT32>(static_cast<UINT8>(a)))
-
-interface IDWriteFontFileStream;
-
-/// <summary>
-/// Font file loader interface handles loading font file resources of a particular type from a key.
-/// The font file loader interface is recommended to be implemented by a singleton object.
-/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite factory
-/// inside their constructors and must not unregister themselves in their destructors, because
-/// registration and unregistraton operations increment and decrement the object reference count respectively.
-/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
-/// outside of the font file loader implementation as a separate step.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown
-{
- /// <summary>
- /// Creates a font file stream object that encapsulates an open file resource.
- /// The resource is closed when the last reference to fontFileStream is released.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="fontFileStream">Pointer to the newly created font file stream.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateStreamFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out IDWriteFontFileStream** fontFileStream
- ) PURE;
-};
-
-/// <summary>
-/// A built-in implementation of IDWriteFontFileLoader interface that operates on local font files
-/// and exposes local font file information from the font file reference key.
-/// Font file references created using CreateFontFileReference use this font file loader.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
-{
- /// <summary>
- /// Obtains the length of the absolute file path from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="filePathLength">Length of the file path string not including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFilePathLengthFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out UINT32* filePathLength
- ) PURE;
-
- /// <summary>
- /// Obtains the absolute font file path from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="filePath">Character array that receives the local file path.</param>
- /// <param name="filePathSize">Size of the filePath array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFilePathFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out_ecount_z(filePathSize) WCHAR* filePath,
- UINT32 filePathSize
- ) PURE;
-
- /// <summary>
- /// Obtains the last write time of the file from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="lastWriteTime">Last modified time of the font file.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLastWriteTimeFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out FILETIME* lastWriteTime
- ) PURE;
-};
-
-/// <summary>
-/// The interface for loading font file data.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown
-{
- /// <summary>
- /// Reads a fragment from a file.
- /// </summary>
- /// <param name="fragmentStart">Receives the pointer to the start of the font file fragment.</param>
- /// <param name="fileOffset">Offset of the fragment from the beginning of the font file.</param>
- /// <param name="fragmentSize">Size of the fragment in bytes.</param>
- /// <param name="fragmentContext">The client defined context to be passed to the ReleaseFileFragment.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// IMPORTANT: ReadFileFragment() implementations must check whether the requested file fragment
- /// is within the file bounds. Otherwise, an error should be returned from ReadFileFragment.
- /// </remarks>
- STDMETHOD(ReadFileFragment)(
- __deref_out_bcount(fragmentSize) void const** fragmentStart,
- UINT64 fileOffset,
- UINT64 fragmentSize,
- __out void** fragmentContext
- ) PURE;
-
- /// <summary>
- /// Releases a fragment from a file.
- /// </summary>
- /// <param name="fragmentContext">The client defined context of a font fragment returned from ReadFileFragment.</param>
- STDMETHOD_(void, ReleaseFileFragment)(
- void* fragmentContext
- ) PURE;
-
- /// <summary>
- /// Obtains the total size of a file.
- /// </summary>
- /// <param name="fileSize">Receives the total size of the file.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Implementing GetFileSize() for asynchronously loaded font files may require
- /// downloading the complete file contents, therefore this method should only be used for operations that
- /// either require complete font file to be loaded (e.g., copying a font file) or need to make
- /// decisions based on the value of the file size (e.g., validation against a persisted file size).
- /// </remarks>
- STDMETHOD(GetFileSize)(
- __out UINT64* fileSize
- ) PURE;
-
- /// <summary>
- /// Obtains the last modified time of the file. The last modified time is used by DirectWrite font selection algorithms
- /// to determine whether one font resource is more up to date than another one.
- /// </summary>
- /// <param name="lastWriteTime">Receives the last modifed time of the file in the format that represents
- /// the number of 100-nanosecond intervals since January 1, 1601 (UTC).</param>
- /// <returns>
- /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of
- /// GetLastWriteTime should return E_NOTIMPL.
- /// </returns>
- STDMETHOD(GetLastWriteTime)(
- __out UINT64* lastWriteTime
- ) PURE;
-};
-
-/// <summary>
-/// The interface that represents a reference to a font file.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown
-{
- /// <summary>
- /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released.
- /// </summary>
- /// <param name="fontFileReferenceKey">Pointer to the font file reference key.
- /// IMPORTANT: The pointer value is valid until the font file reference object it is obtained from is released.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetReferenceKey)(
- __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey,
- __out UINT32* fontFileReferenceKeySize
- ) PURE;
-
- /// <summary>
- /// Obtains the file loader associated with a font file object.
- /// </summary>
- /// <param name="fontFileLoader">The font file loader associated with the font file object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLoader)(
- __out IDWriteFontFileLoader** fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system.
- /// </summary>
- /// <param name="isSupportedFontType">TRUE if the font type is supported by the font system, FALSE otherwise.</param>
- /// <param name="fontFileType">The type of the font file. Note that even if isSupportedFontType is FALSE,
- /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNOWN.</param>
- /// <param name="fontFaceType">The type of the font face that can be constructed from the font file.
- /// Note that even if isSupportedFontType is FALSE, the fontFaceType value may be different from
- /// DWRITE_FONT_FACE_TYPE_UNKNOWN.</param>
- /// <param name="numberOfFaces">Number of font faces contained in the font file.</param>
- /// <returns>
- /// Standard HRESULT error code if there was a processing error during analysis.
- /// </returns>
- /// <remarks>
- /// IMPORTANT: certain font file types are recognized, but not supported by the font system.
- /// For example, the font system will recognize a file as a Type 1 font file,
- /// but will not be able to construct a font face object from it. In such situations, Analyze will set
- /// isSupportedFontType output parameter to FALSE.
- /// </remarks>
- STDMETHOD(Analyze)(
- __out BOOL* isSupportedFontType,
- __out DWRITE_FONT_FILE_TYPE* fontFileType,
- __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType,
- __out UINT32* numberOfFaces
- ) PURE;
-};
-
-/// <summary>
-/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red,
-/// green, and blue color components) that is assumed for purposes of rendering text.
-/// </summary>
-#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED
-enum DWRITE_PIXEL_GEOMETRY
-{
- /// <summary>
- /// The red, green, and blue color components of each pixel are assumed to occupy the same point.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_FLAT,
-
- /// <summary>
- /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and
- /// blue on the right. This is the most common pixel geometry for LCD monitors.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_RGB,
-
- /// <summary>
- /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and
- /// red on the right.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_BGR
-};
-#define DWRITE_PIXEL_GEOMETRY_DEFINED
-#endif
-
-/// <summary>
-/// Represents a method of rendering glyphs.
-/// </summary>
-enum DWRITE_RENDERING_MODE
-{
- /// <summary>
- /// Specifies that the rendering mode is determined automatically based on the font and size.
- /// </summary>
- DWRITE_RENDERING_MODE_DEFAULT,
-
- /// <summary>
- /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground
- /// color of the text or retains the color of the background.
- /// </summary>
- DWRITE_RENDERING_MODE_ALIASED,
-
- /// <summary>
- /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only
- /// be positioned on whole-pixel boundaries.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
-
- /// <summary>
- /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than
- /// with aliased text, but glyphs are still positioned on whole-pixel boundaries.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,
-
- /// <summary>
- /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is
- /// typically used with small to medium font sizes (up to 16 ppem).
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,
-
- /// <summary>
- /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions.
- /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at
- /// the expense of some softness.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
-
- /// <summary>
- /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is
- /// typically used at very large sizes.
- /// </summary>
- DWRITE_RENDERING_MODE_OUTLINE
-};
-
-/// <summary>
-/// The DWRITE_MATRIX structure specifies the graphics transform to be applied
-/// to rendered glyphs.
-/// </summary>
-struct DWRITE_MATRIX
-{
- /// <summary>
- /// Horizontal scaling / cosine of rotation
- /// </summary>
- FLOAT m11;
-
- /// <summary>
- /// Vertical shear / sine of rotation
- /// </summary>
- FLOAT m12;
-
- /// <summary>
- /// Horizontal shear / negative sine of rotation
- /// </summary>
- FLOAT m21;
-
- /// <summary>
- /// Vertical scaling / cosine of rotation
- /// </summary>
- FLOAT m22;
-
- /// <summary>
- /// Horizontal shift (always orthogonal regardless of rotation)
- /// </summary>
- FLOAT dx;
-
- /// <summary>
- /// Vertical shift (always orthogonal regardless of rotation)
- /// </summary>
- FLOAT dy;
-};
-
-/// <summary>
-/// The interface that represents text rendering settings for glyph rasterization and filtering.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown
-{
- /// <summary>
- /// Gets the gamma value used for gamma correction. Valid values must be
- /// greater than zero and cannot exceed 256.
- /// </summary>
- STDMETHOD_(FLOAT, GetGamma)() PURE;
-
- /// <summary>
- /// Gets the amount of contrast enhancement. Valid values are greater than
- /// or equal to zero.
- /// </summary>
- STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE;
-
- /// <summary>
- /// Gets the ClearType level. Valid values range from 0.0f (no ClearType)
- /// to 1.0f (full ClearType).
- /// </summary>
- STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE;
-
- /// <summary>
- /// Gets the pixel geometry.
- /// </summary>
- STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE;
-
- /// <summary>
- /// Gets the rendering mode.
- /// </summary>
- STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE;
-};
-
-// Forward declarations of D2D types
-interface ID2D1SimplifiedGeometrySink;
-
-typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
-
-/// <summary>
-/// The interface that represents an absolute reference to a font face.
-/// It contains font face type, appropriate file references and face identification data.
-/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown
-{
- /// <summary>
- /// Obtains the file format type of a font face.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE;
-
- /// <summary>
- /// Obtains the font files representing a font face.
- /// </summary>
- /// <param name="numberOfFiles">The number of files representing the font face.</param>
- /// <param name="fontFiles">User provided array that stores pointers to font files representing the font face.
- /// This parameter can be NULL if the user is only interested in the number of files representing the font face.
- /// This API increments reference count of the font file pointers returned according to COM conventions, and the client
- /// should release them when finished.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFiles)(
- __inout UINT32* numberOfFiles,
- __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles
- ) PURE;
-
- /// <summary>
- /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face,
- /// the return value is zero.
- /// </summary>
- STDMETHOD_(UINT32, GetIndex)() PURE;
-
- /// <summary>
- /// Obtains the algorithmic style simulation flags of a font face.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
-
- /// <summary>
- /// Determines whether the font is a symbol font.
- /// </summary>
- STDMETHOD_(BOOL, IsSymbolFont)() PURE;
-
- /// <summary>
- /// Obtains design units and common metrics for the font face.
- /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
- /// </summary>
- /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
- /// The metrics returned by this function are in font design units.</param>
- STDMETHOD_(void, GetMetrics)(
- __out DWRITE_FONT_METRICS* fontFaceMetrics
- ) PURE;
-
- /// <summary>
- /// Obtains the number of glyphs in the font face.
- /// </summary>
- STDMETHOD_(UINT16, GetGlyphCount)() PURE;
-
- /// <summary>
- /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning.
- /// </summary>
- /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
- /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
- /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
- /// The metrics returned by this function are in font design units.</param>
- /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
- /// This can affect the glyph metrics if the font has oblique simulation
- /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
- /// <returns>
- /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
- /// for the current font face, E_INVALIDARG will be returned.
- /// </returns>
- STDMETHOD(GetDesignGlyphMetrics)(
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- UINT32 glyphCount,
- __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
- BOOL isSideways = FALSE
- ) PURE;
-
- /// <summary>
- /// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.
- /// Note that this mapping is primarily provided for line layout engines built on top of the physical font API.
- /// Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond
- /// to how a Unicode string will map to glyph indices when rendering using a particular font face.
- /// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph.
- /// This call will always return the default variant.
- /// </summary>
- /// <param name="codePoints">An array of USC4 code points to obtain nominal glyph indices from.</param>
- /// <param name="codePointCount">The number of elements in the codePoints array.</param>
- /// <param name="glyphIndices">Array of nominal glyph indices filled by this function.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphIndices)(
- __in_ecount(codePointCount) UINT32 const* codePoints,
- UINT32 codePointCount,
- __out_ecount(codePointCount) UINT16* glyphIndices
- ) PURE;
-
- /// <summary>
- /// Finds the specified OpenType font table if it exists and returns a pointer to it.
- /// The function accesses the underling font data via the IDWriteFontStream interface
- /// implemented by the font file loader.
- /// </summary>
- /// <param name="openTypeTableTag">Four character tag of table to find.
- /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it.
- /// Unlike GDI, it does not support the special TTCF and null tags to access the whole font.</param>
- /// <param name="tableData">
- /// Pointer to base of table in memory.
- /// The pointer is only valid so long as the FontFace used to get the font table still exists
- /// (not any other FontFace, even if it actually refers to the same physical font).
- /// </param>
- /// <param name="tableSize">Byte size of table.</param>
- /// <param name="tableContext">
- /// Opaque context which must be freed by calling ReleaseFontTable.
- /// The context actually comes from the lower level IDWriteFontFileStream,
- /// which may be implemented by the application or DWrite itself.
- /// It is possible for a NULL tableContext to be returned, especially if
- /// the implementation directly memory maps the whole file.
- /// Nevertheless, always release it later, and do not use it as a test for function success.
- /// The same table can be queried multiple times,
- /// but each returned context can be different, so release each separately.
- /// </param>
- /// <param name="exists">True if table exists.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE.
- /// The context does not need to be freed if the table was not found.
- /// </returns>
- /// <remarks>
- /// The context for the same tag may be different for each call,
- /// so each one must be held and released separately.
- /// </remarks>
- STDMETHOD(TryGetFontTable)(
- __in UINT32 openTypeTableTag,
- __deref_out_bcount(*tableSize) const void** tableData,
- __out UINT32* tableSize,
- __out void** tableContext,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Releases the table obtained earlier from TryGetFontTable.
- /// </summary>
- /// <param name="tableContext">Opaque context from TryGetFontTable.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD_(void, ReleaseFontTable)(
- __in void* tableContext
- ) PURE;
-
- /// <summary>
- /// Computes the outline of a run of glyphs by calling back to the outline sink interface.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="glyphIndices">Array of glyph indices.</param>
- /// <param name="glyphAdvances">Optional array of glyph advances in DIPs.</param>
- /// <param name="glyphOffsets">Optional array of glyph offsets.</param>
- /// <param name="glyphCount">Number of glyphs.</param>
- /// <param name="isSideways">If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used.
- /// A client can render a vertical run by specifying isSideways = true and rotating the resulting geometry 90 degrees to the
- /// right using a transform. The isSideways and isRightToLeft parameters cannot both be true.</param>
- /// <param name="isRightToLeft">If true, specifies that the advance direction is right to left. By default, the advance direction
- /// is left to right.</param>
- /// <param name="geometrySink">Interface the function calls back to draw each element of the geometry.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphRunOutline)(
- FLOAT emSize,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances,
- __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets,
- UINT32 glyphCount,
- BOOL isSideways,
- BOOL isRightToLeft,
- IDWriteGeometrySink* geometrySink
- ) PURE;
-
- /// <summary>
- /// Determines the recommended rendering mode for the font given the specified size and rendering parameters.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="measuringMode">Specifies measuring method that will be used for glyphs in the font.
- /// Renderer implementations may choose different rendering modes for given measuring methods, but
- /// best results are seen when the corresponding modes match:
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
- /// </param>
- /// <param name="renderingParams">Rendering parameters object. This parameter is necessary in case the rendering parameters
- /// object overrides the rendering mode.</param>
- /// <param name="renderingMode">Receives the recommended rendering mode to use.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetRecommendedRenderingMode)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- DWRITE_MEASURING_MODE measuringMode,
- IDWriteRenderingParams* renderingParams,
- __out DWRITE_RENDERING_MODE* renderingMode
- ) PURE;
-
- /// <summary>
- /// Obtains design units and common metrics for the font face.
- /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
- /// The metrics returned by this function are in font design units.</param>
- STDMETHOD(GetGdiCompatibleMetrics)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- __out DWRITE_FONT_METRICS* fontFaceMetrics
- ) PURE;
-
-
- /// <summary>
- /// Obtains glyph metrics in font design units with the return values compatible with what GDI would produce.
- /// Glyphs metrics are used for positioning of individual glyphs.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
- /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
- /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
- /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
- /// The metrics returned by this function are in font design units.</param>
- /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
- /// This can affect the glyph metrics if the font has oblique simulation
- /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
- /// <returns>
- /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
- /// for the current font face, E_INVALIDARG will be returned.
- /// </returns>
- STDMETHOD(GetGdiCompatibleGlyphMetrics)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- UINT32 glyphCount,
- __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
- BOOL isSideways = FALSE
- ) PURE;
-};
-
-interface IDWriteFactory;
-interface IDWriteFontFileEnumerator;
-
-/// <summary>
-/// The font collection loader interface is used to construct a collection of fonts given a particular type of key.
-/// The font collection loader interface is recommended to be implemented by a singleton object.
-/// IMPORTANT: font collection loader implementations must not register themselves with a DirectWrite factory
-/// inside their constructors and must not unregister themselves in their destructors, because
-/// registration and unregistraton operations increment and decrement the object reference count respectively.
-/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
-/// outside of the font file loader implementation as a separate step.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown
-{
- /// <summary>
- /// Creates a font file enumerator object that encapsulates a collection of font files.
- /// The font system calls back to this interface to create a font collection.
- /// </summary>
- /// <param name="factory">Factory associated with the loader.</param>
- /// <param name="collectionKey">Font collection key that uniquely identifies the collection of font files within
- /// the scope of the font collection loader being used.</param>
- /// <param name="collectionKeySize">Size of the font collection key in bytes.</param>
- /// <param name="fontFileEnumerator">Pointer to the newly created font file enumerator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateEnumeratorFromKey)(
- IDWriteFactory* factory,
- __in_bcount(collectionKeySize) void const* collectionKey,
- UINT32 collectionKeySize,
- __out IDWriteFontFileEnumerator** fontFileEnumerator
- ) PURE;
-};
-
-/// <summary>
-/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface
-/// to enumerate font files when building a font collection.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown
-{
- /// <summary>
- /// Advances to the next font file in the collection. When it is first created, the enumerator is positioned
- /// before the first element of the collection and the first call to MoveNext advances to the first file.
- /// </summary>
- /// <param name="hasCurrentFile">Receives the value TRUE if the enumerator advances to a file, or FALSE if
- /// the enumerator advanced past the last file in the collection.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(MoveNext)(
- __out BOOL* hasCurrentFile
- ) PURE;
-
- /// <summary>
- /// Gets a reference to the current font file.
- /// </summary>
- /// <param name="fontFile">Pointer to the newly created font file object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentFontFile)(
- __out IDWriteFontFile** fontFile
- ) PURE;
-};
-
-/// <summary>
-/// Represents a collection of strings indexed by locale name.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown
-{
- /// <summary>
- /// Gets the number of language/string pairs.
- /// </summary>
- STDMETHOD_(UINT32, GetCount)() PURE;
-
- /// <summary>
- /// Gets the index of the item with the specified locale name.
- /// </summary>
- /// <param name="localeName">Locale name to look for.</param>
- /// <param name="index">Receives the zero-based index of the locale name/string pair.</param>
- /// <param name="exists">Receives TRUE if the locale name exists or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified locale name does not exist, the return value is S_OK,
- /// but *index is UINT_MAX and *exists is FALSE.
- /// </returns>
- STDMETHOD(FindLocaleName)(
- __in_z WCHAR const* localeName,
- __out UINT32* index,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets the length in characters (not including the null terminator) of the locale name with the specified index.
- /// </summary>
- /// <param name="index">Zero-based index of the locale name.</param>
- /// <param name="length">Receives the length in characters, not including the null terminator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleNameLength)(
- UINT32 index,
- __out UINT32* length
- ) PURE;
-
- /// <summary>
- /// Copies the locale name with the specified index to the specified array.
- /// </summary>
- /// <param name="index">Zero-based index of the locale name.</param>
- /// <param name="localeName">Character array that receives the locale name.</param>
- /// <param name="size">Size of the array in characters. The size must include space for the terminating
- /// null character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- UINT32 index,
- __out_ecount_z(size) WCHAR* localeName,
- UINT32 size
- ) PURE;
-
- /// <summary>
- /// Gets the length in characters (not including the null terminator) of the string with the specified index.
- /// </summary>
- /// <param name="index">Zero-based index of the string.</param>
- /// <param name="length">Receives the length in characters, not including the null terminator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetStringLength)(
- UINT32 index,
- __out UINT32* length
- ) PURE;
-
- /// <summary>
- /// Copies the string with the specified index to the specified array.
- /// </summary>
- /// <param name="index">Zero-based index of the string.</param>
- /// <param name="stringBuffer">Character array that receives the string.</param>
- /// <param name="size">Size of the array in characters. The size must include space for the terminating
- /// null character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetString)(
- UINT32 index,
- __out_ecount_z(size) WCHAR* stringBuffer,
- UINT32 size
- ) PURE;
-};
-
-interface IDWriteFontFamily;
-interface IDWriteFont;
-
-/// <summary>
-/// The IDWriteFontCollection encapsulates a collection of fonts.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown
-{
- /// <summary>
- /// Gets the number of font families in the collection.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFamilyCount)() PURE;
-
- /// <summary>
- /// Creates a font family object given a zero-based font family index.
- /// </summary>
- /// <param name="index">Zero-based index of the font family.</param>
- /// <param name="fontFamily">Receives a pointer the newly created font family object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamily)(
- UINT32 index,
- __out IDWriteFontFamily** fontFamily
- ) PURE;
-
- /// <summary>
- /// Finds the font family with the specified family name.
- /// </summary>
- /// <param name="familyName">Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection.</param>
- /// <param name="index">Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise.</param>
- /// <param name="exists">Receives TRUE if the family name exists or FALSE otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified family name does not exist, the return value is S_OK, but *index is UINT_MAX and *exists is FALSE.
- /// </returns>
- STDMETHOD(FindFamilyName)(
- __in_z WCHAR const* familyName,
- __out UINT32* index,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong
- /// to the font collection.
- /// </summary>
- /// <param name="fontFace">Font face object that specifies the physical font.</param>
- /// <param name="font">Receives a pointer to the newly created font object if successful or NULL otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT.
- /// </returns>
- STDMETHOD(GetFontFromFontFace)(
- IDWriteFontFace* fontFace,
- __out IDWriteFont** font
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFontList interface represents a list of fonts.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown
-{
- /// <summary>
- /// Gets the font collection that contains the fonts.
- /// </summary>
- /// <param name="fontCollection">Receives a pointer to the font collection object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Gets the number of fonts in the font list.
- /// </summary>
- STDMETHOD_(UINT32, GetFontCount)() PURE;
-
- /// <summary>
- /// Gets a font given its zero-based index.
- /// </summary>
- /// <param name="index">Zero-based index of the font in the font list.</param>
- /// <param name="font">Receives a pointer to the newly created font object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFont)(
- UINT32 index,
- __out IDWriteFont** font
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated
-/// by weight, stretch, and style.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList
-{
- /// <summary>
- /// Creates an localized strings object that contains the family names for the font family, indexed by locale name.
- /// </summary>
- /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFamilyNames)(
- __out IDWriteLocalizedStrings** names
- ) PURE;
-
- /// <summary>
- /// Gets the font that best matches the specified properties.
- /// </summary>
- /// <param name="weight">Requested font weight.</param>
- /// <param name="stretch">Requested font stretch.</param>
- /// <param name="style">Requested font style.</param>
- /// <param name="matchingFont">Receives a pointer to the newly created font object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFirstMatchingFont)(
- DWRITE_FONT_WEIGHT weight,
- DWRITE_FONT_STRETCH stretch,
- DWRITE_FONT_STYLE style,
- __out IDWriteFont** matchingFont
- ) PURE;
-
- /// <summary>
- /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties.
- /// </summary>
- /// <param name="weight">Requested font weight.</param>
- /// <param name="stretch">Requested font stretch.</param>
- /// <param name="style">Requested font style.</param>
- /// <param name="matchingFonts">Receives a pointer to the newly created font list object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetMatchingFonts)(
- DWRITE_FONT_WEIGHT weight,
- DWRITE_FONT_STRETCH stretch,
- DWRITE_FONT_STYLE style,
- __out IDWriteFontList** matchingFonts
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFont interface represents a physical font in a font collection.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown
-{
- /// <summary>
- /// Gets the font family to which the specified font belongs.
- /// </summary>
- /// <param name="fontFamily">Receives a pointer to the font family object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamily)(
- __out IDWriteFontFamily** fontFamily
- ) PURE;
-
- /// <summary>
- /// Gets the weight of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE;
-
- /// <summary>
- /// Gets the stretch (aka. width) of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE;
-
- /// <summary>
- /// Gets the style (aka. slope) of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE;
-
- /// <summary>
- /// Returns TRUE if the font is a symbol font or FALSE if not.
- /// </summary>
- STDMETHOD_(BOOL, IsSymbolFont)() PURE;
-
- /// <summary>
- /// Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name.
- /// </summary>
- /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFaceNames)(
- __out IDWriteLocalizedStrings** names
- ) PURE;
-
- /// <summary>
- /// Gets a localized strings collection containing the specified informational strings, indexed by locale name.
- /// </summary>
- /// <param name="informationalStringID">Identifies the string to get.</param>
- /// <param name="informationalStrings">Receives a pointer to the newly created localized strings object.</param>
- /// <param name="exists">Receives the value TRUE if the font contains the specified string ID or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but
- /// informationalStrings receives a NULL pointer and exists receives the value FALSE.
- /// </returns>
- STDMETHOD(GetInformationalStrings)(
- DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
- __out IDWriteLocalizedStrings** informationalStrings,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets a value that indicates what simulation are applied to the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
-
- /// <summary>
- /// Gets the metrics for the font.
- /// </summary>
- /// <param name="fontMetrics">Receives the font metrics.</param>
- STDMETHOD_(void, GetMetrics)(
- __out DWRITE_FONT_METRICS* fontMetrics
- ) PURE;
-
- /// <summary>
- /// Determines whether the font supports the specified character.
- /// </summary>
- /// <param name="unicodeValue">Unicode (UCS-4) character value.</param>
- /// <param name="exists">Receives the value TRUE if the font supports the specified character or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(HasCharacter)(
- UINT32 unicodeValue,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Creates a font face object for the font.
- /// </summary>
- /// <param name="fontFace">Receives a pointer to the newly created font face object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFace)(
- __out IDWriteFontFace** fontFace
- ) PURE;
-};
-
-/// <summary>
-/// Direction for how reading progresses.
-/// </summary>
-enum DWRITE_READING_DIRECTION
-{
- /// <summary>
- /// Reading progresses from left to right.
- /// </summary>
- DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
-
- /// <summary>
- /// Reading progresses from right to left.
- /// </summary>
- DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
-};
-
-/// <summary>
-/// Direction for how lines of text are placed relative to one another.
-/// </summary>
-enum DWRITE_FLOW_DIRECTION
-{
- /// <summary>
- /// Text lines are placed from top to bottom.
- /// </summary>
- DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
-};
-
-/// <summary>
-/// Alignment of paragraph text along the reading direction axis relative to
-/// the leading and trailing edge of the layout box.
-/// </summary>
-enum DWRITE_TEXT_ALIGNMENT
-{
- /// <summary>
- /// The leading edge of the paragraph text is aligned to the layout box's leading edge.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_LEADING,
-
- /// <summary>
- /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_TRAILING,
-
- /// <summary>
- /// The center of the paragraph text is aligned to the center of the layout box.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_CENTER
-};
-
-/// <summary>
-/// Alignment of paragraph text along the flow direction axis relative to the
-/// flow's beginning and ending edge of the layout box.
-/// </summary>
-enum DWRITE_PARAGRAPH_ALIGNMENT
-{
- /// <summary>
- /// The first line of paragraph is aligned to the flow's beginning edge of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
-
- /// <summary>
- /// The last line of paragraph is aligned to the flow's ending edge of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_FAR,
-
- /// <summary>
- /// The center of the paragraph is aligned to the center of the flow of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_CENTER
-};
-
-/// <summary>
-/// Word wrapping in multiline paragraph.
-/// </summary>
-enum DWRITE_WORD_WRAPPING
-{
- /// <summary>
- /// Words are broken across lines to avoid text overflowing the layout box.
- /// </summary>
- DWRITE_WORD_WRAPPING_WRAP,
-
- /// <summary>
- /// Words are kept within the same line even when it overflows the layout box.
- /// This option is often used with scrolling to reveal overflow text.
- /// </summary>
- DWRITE_WORD_WRAPPING_NO_WRAP
-};
-
-/// <summary>
-/// The method used for line spacing in layout.
-/// </summary>
-enum DWRITE_LINE_SPACING_METHOD
-{
- /// <summary>
- /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects.
- /// </summary>
- DWRITE_LINE_SPACING_METHOD_DEFAULT,
-
- /// <summary>
- /// Lines are explicitly set to uniform spacing, regardless of contained font sizes.
- /// This can be useful to avoid the uneven appearance that can occur from font fallback.
- /// </summary>
- DWRITE_LINE_SPACING_METHOD_UNIFORM
-};
-
-/// <summary>
-/// Text granularity used to trim text overflowing the layout box.
-/// </summary>
-enum DWRITE_TRIMMING_GRANULARITY
-{
- /// <summary>
- /// No trimming occurs. Text flows beyond the layout width.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_NONE,
-
- /// <summary>
- /// Trimming occurs at character cluster boundary.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_CHARACTER,
-
- /// <summary>
- /// Trimming occurs at word boundary.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_WORD
-};
-
-/// <summary>
-/// Typographic feature of text supplied by the font.
-/// </summary>
-enum DWRITE_FONT_FEATURE_TAG
-{
- DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc'
- DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc'
- DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt'
- DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case'
- DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig'
- DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh'
- DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs'
- DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt'
- DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig'
- DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt'
- DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac'
- DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid'
- DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half'
- DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln'
- DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt'
- DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist'
- DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna'
- DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig'
- DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid'
- DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo'
- DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04'
- DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78'
- DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83'
- DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90'
- DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern'
- DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga'
- DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum'
- DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl'
- DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark'
- DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk'
- DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk'
- DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt'
- DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck'
- DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum'
- DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt'
- DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid'
- DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid'
- DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig'
- DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt'
- DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf'
- DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp'
- DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20'
- DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs'
- DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups'
- DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh'
- DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl'
- DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam'
- DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum'
- DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad'
- DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid'
- DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic'
- DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero'
-};
-
-/// <summary>
-/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied.
-/// </summary>
-struct DWRITE_TEXT_RANGE
-{
- /// <summary>
- /// The start text position of the range.
- /// </summary>
- UINT32 startPosition;
-
- /// <summary>
- /// The number of text positions in the range.
- /// </summary>
- UINT32 length;
-};
-
-/// <summary>
-/// The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic feature in the font.
-/// </summary>
-struct DWRITE_FONT_FEATURE
-{
- /// <summary>
- /// The feature OpenType name identifier.
- /// </summary>
- DWRITE_FONT_FEATURE_TAG nameTag;
-
- /// <summary>
- /// Execution parameter of the feature.
- /// </summary>
- /// <remarks>
- /// The parameter should be non-zero to enable the feature. Once enabled, a feature can't be disabled again within
- /// the same range. Features requiring a selector use this value to indicate the selector index.
- /// </remarks>
- UINT32 parameter;
-};
-
-/// <summary>
-/// Defines a set of typographic features to be applied during shaping.
-/// Notice the character range which this feature list spans is specified
-/// as a separate parameter to GetGlyphs.
-/// </summary>
-struct DWRITE_TYPOGRAPHIC_FEATURES
-{
- /// <summary>
- /// Array of font features.
- /// </summary>
- __field_ecount(featureCount) DWRITE_FONT_FEATURE* features;
-
- /// <summary>
- /// The number of features.
- /// </summary>
- UINT32 featureCount;
-};
-
-/// <summary>
-/// The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box.
-/// </summary>
-struct DWRITE_TRIMMING
-{
- /// <summary>
- /// Text granularity of which trimming applies.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY granularity;
-
- /// <summary>
- /// Character code used as the delimiter signaling the beginning of the portion of text to be preserved,
- /// most useful for path ellipsis, where the delimeter would be a slash.
- /// </summary>
- UINT32 delimiter;
-
- /// <summary>
- /// How many occurences of the delimiter to step back.
- /// </summary>
- UINT32 delimiterCount;
-};
-
-
-interface IDWriteTypography;
-interface IDWriteInlineObject;
-
-/// <summary>
-/// The format of text used for text layout purpose.
-/// </summary>
-/// <remarks>
-/// This object may not be thread-safe and it may carry the state of text format change.
-/// </remarks>
-interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown
-{
- /// <summary>
- /// Set alignment option of text relative to layout box's leading and trailing edge.
- /// </summary>
- /// <param name="textAlignment">Text alignment option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTextAlignment)(
- DWRITE_TEXT_ALIGNMENT textAlignment
- ) PURE;
-
- /// <summary>
- /// Set alignment option of paragraph relative to layout box's top and bottom edge.
- /// </summary>
- /// <param name="paragraphAlignment">Paragraph alignment option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetParagraphAlignment)(
- DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment
- ) PURE;
-
- /// <summary>
- /// Set word wrapping option.
- /// </summary>
- /// <param name="wordWrapping">Word wrapping option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetWordWrapping)(
- DWRITE_WORD_WRAPPING wordWrapping
- ) PURE;
-
- /// <summary>
- /// Set paragraph reading direction.
- /// </summary>
- /// <param name="readingDirection">Text reading direction</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetReadingDirection)(
- DWRITE_READING_DIRECTION readingDirection
- ) PURE;
-
- /// <summary>
- /// Set paragraph flow direction.
- /// </summary>
- /// <param name="flowDirection">Paragraph flow direction</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFlowDirection)(
- DWRITE_FLOW_DIRECTION flowDirection
- ) PURE;
-
- /// <summary>
- /// Set incremental tab stop position.
- /// </summary>
- /// <param name="incrementalTabStop">The incremental tab stop value</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetIncrementalTabStop)(
- FLOAT incrementalTabStop
- ) PURE;
-
- /// <summary>
- /// Set trimming options for any trailing text exceeding the layout width
- /// or for any far text exceeding the layout height.
- /// </summary>
- /// <param name="trimmingOptions">Text trimming options.</param>
- /// <param name="trimmingSign">Application-defined omission sign. This parameter may be NULL if no trimming sign is desired.</param>
- /// <remarks>
- /// Any inline object can be used for the trimming sign, but CreateEllipsisTrimmingSign
- /// provides a typical ellipsis symbol. Trimming is also useful vertically for hiding
- /// partial lines.
- /// </remarks>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTrimming)(
- __in DWRITE_TRIMMING const* trimmingOptions,
- IDWriteInlineObject* trimmingSign
- ) PURE;
-
- /// <summary>
- /// Set line spacing.
- /// </summary>
- /// <param name="lineSpacingMethod">How to determine line height.</param>
- /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
- /// <param name="baseline">Distance from top of line to baseline. A reasonable ratio to lineSpacing is 80%.</param>
- /// <remarks>
- /// For the default method, spacing depends solely on the content.
- /// For uniform spacing, the given line height will override the content.
- /// </remarks>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetLineSpacing)(
- DWRITE_LINE_SPACING_METHOD lineSpacingMethod,
- FLOAT lineSpacing,
- FLOAT baseline
- ) PURE;
-
- /// <summary>
- /// Get alignment option of text relative to layout box's leading and trailing edge.
- /// </summary>
- STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE;
-
- /// <summary>
- /// Get alignment option of paragraph relative to layout box's top and bottom edge.
- /// </summary>
- STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE;
-
- /// <summary>
- /// Get word wrapping option.
- /// </summary>
- STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE;
-
- /// <summary>
- /// Get paragraph reading direction.
- /// </summary>
- STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE;
-
- /// <summary>
- /// Get paragraph flow direction.
- /// </summary>
- STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE;
-
- /// <summary>
- /// Get incremental tab stop position.
- /// </summary>
- STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE;
-
- /// <summary>
- /// Get trimming options for text overflowing the layout width.
- /// </summary>
- /// <param name="trimmingOptions">Text trimming options.</param>
- /// <param name="trimmingSign">Trimming omission sign. This parameter may be NULL.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetTrimming)(
- __out DWRITE_TRIMMING* trimmingOptions,
- __out IDWriteInlineObject** trimmingSign
- ) PURE;
-
- /// <summary>
- /// Get line spacing.
- /// </summary>
- /// <param name="lineSpacingMethod">How line height is determined.</param>
- /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
- /// <param name="baseline">Distance from top of line to baseline.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLineSpacing)(
- __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,
- __out FLOAT* lineSpacing,
- __out FLOAT* baseline
- ) PURE;
-
- /// <summary>
- /// Get the font collection.
- /// </summary>
- /// <param name="fontCollection">The current font collection.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Get the length of the font family name, in characters, not including the terminating NULL character.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE;
-
- /// <summary>
- /// Get a copy of the font family name.
- /// </summary>
- /// <param name="fontFamilyName">Character array that receives the current font family name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyName)(
- __out_ecount_z(nameSize) WCHAR* fontFamilyName,
- UINT32 nameSize
- ) PURE;
-
- /// <summary>
- /// Get the font weight.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE;
-
- /// <summary>
- /// Get the font style.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE;
-
- /// <summary>
- /// Get the font stretch.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE;
-
- /// <summary>
- /// Get the font em height.
- /// </summary>
- STDMETHOD_(FLOAT, GetFontSize)() PURE;
-
- /// <summary>
- /// Get the length of the locale name, in characters, not including the terminating NULL character.
- /// </summary>
- STDMETHOD_(UINT32, GetLocaleNameLength)() PURE;
-
- /// <summary>
- /// Get a copy of the locale name.
- /// </summary>
- /// <param name="localeName">Character array that receives the current locale name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- __out_ecount_z(nameSize) WCHAR* localeName,
- UINT32 nameSize
- ) PURE;
-};
-
-
-/// <summary>
-/// Font typography setting.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown
-{
- /// <summary>
- /// Add font feature.
- /// </summary>
- /// <param name="fontFeature">The font feature to add.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(AddFontFeature)(
- DWRITE_FONT_FEATURE fontFeature
- ) PURE;
-
- /// <summary>
- /// Get the number of font features.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFeatureCount)() PURE;
-
- /// <summary>
- /// Get the font feature at the specified index.
- /// </summary>
- /// <param name="fontFeatureIndex">The zero-based index of the font feature to get.</param>
- /// <param name="fontFeature">The font feature.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFeature)(
- UINT32 fontFeatureIndex,
- __out DWRITE_FONT_FEATURE* fontFeature
- ) PURE;
-};
-
-enum DWRITE_SCRIPT_SHAPES
-{
- /// <summary>
- /// No additional shaping requirement. Text is shaped with the writing system default behavior.
- /// </summary>
- DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
-
- /// <summary>
- /// Text should leave no visual on display i.e. control or format control characters.
- /// </summary>
- DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1
-};
-
-#ifdef DEFINE_ENUM_FLAG_OPERATORS
-DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);
-#endif
-
-/// <summary>
-/// Association of text and its writing system script as well as some display attributes.
-/// </summary>
-struct DWRITE_SCRIPT_ANALYSIS
-{
- /// <summary>
- /// Zero-based index representation of writing system script.
- /// </summary>
- UINT16 script;
-
- /// <summary>
- /// Additional shaping requirement of text.
- /// </summary>
- DWRITE_SCRIPT_SHAPES shapes;
-};
-
-/// <summary>
-/// Condition at the edges of inline object or text used to determine
-/// line-breaking behavior.
-/// </summary>
-enum DWRITE_BREAK_CONDITION
-{
- /// <summary>
- /// Whether a break is allowed is determined by the condition of the
- /// neighboring text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_NEUTRAL,
-
- /// <summary>
- /// A break is allowed, unless overruled by the condition of the
- /// neighboring text span or inline object, either prohibited by a
- /// May Not or forced by a Must.
- /// </summary>
- DWRITE_BREAK_CONDITION_CAN_BREAK,
-
- /// <summary>
- /// There should be no break, unless overruled by a Must condition from
- /// the neighboring text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_MAY_NOT_BREAK,
-
- /// <summary>
- /// The break must happen, regardless of the condition of the adjacent
- /// text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_MUST_BREAK
-};
-
-/// <summary>
-/// Line breakpoint characteristics of a character.
-/// </summary>
-struct DWRITE_LINE_BREAKPOINT
-{
- /// <summary>
- /// Breaking condition before the character.
- /// </summary>
- UINT8 breakConditionBefore : 2;
-
- /// <summary>
- /// Breaking condition after the character.
- /// </summary>
- UINT8 breakConditionAfter : 2;
-
- /// <summary>
- /// The character is some form of whitespace, which may be meaningful
- /// for justification.
- /// </summary>
- UINT8 isWhitespace : 1;
-
- /// <summary>
- /// The character is a soft hyphen, often used to indicate hyphenation
- /// points inside words.
- /// </summary>
- UINT8 isSoftHyphen : 1;
-
- UINT8 padding : 2;
-};
-
-/// <summary>
-/// How to apply number substitution on digits and related punctuation.
-/// </summary>
-enum DWRITE_NUMBER_SUBSTITUTION_METHOD
-{
- /// <summary>
- /// Specifies that the substitution method should be determined based
- /// on LOCALE_IDIGITSUBSTITUTION value of the specified text culture.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE,
-
- /// <summary>
- /// If the culture is Arabic or Farsi, specifies that the number shape
- /// depend on the context. Either traditional or nominal number shape
- /// are used depending on the nearest preceding strong character or (if
- /// there is none) the reading direction of the paragraph.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL,
-
- /// <summary>
- /// Specifies that code points 0x30-0x39 are always rendered as nominal numeral
- /// shapes (ones of the European number), i.e., no substitution is performed.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
-
- /// <summary>
- /// Specifies that number are rendered using the national number shape
- /// as specified by the LOCALE_SNATIVEDIGITS value of the specified text culture.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL,
-
- /// <summary>
- /// Specifies that number are rendered using the traditional shape
- /// for the specified culture. For most cultures, this is the same as
- /// NativeNational. However, NativeNational results in Latin number
- /// for some Arabic cultures, whereas this value results in Arabic
- /// number for all Arabic cultures.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
-};
-
-/// <summary>
-/// Holds the appropriate digits and numeric punctuation for a given locale.
-/// </summary>
-interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown
-{
-};
-
-/// <summary>
-/// Shaping output properties per input character.
-/// </summary>
-struct DWRITE_SHAPING_TEXT_PROPERTIES
-{
- /// <summary>
- /// This character can be shaped independently from the others
- /// (usually set for the space character).
- /// </summary>
- UINT16 isShapedAlone : 1;
-
- /// <summary>
- /// Reserved for use by shaping engine.
- /// </summary>
- UINT16 reserved : 15;
-};
-
-/// <summary>
-/// Shaping output properties per output glyph.
-/// </summary>
-struct DWRITE_SHAPING_GLYPH_PROPERTIES
-{
- /// <summary>
- /// Justification class, whether to use spacing, kashidas, or
- /// another method. This exists for backwards compatibility
- /// with Uniscribe's SCRIPT_JUSTIFY enum.
- /// </summary>
- UINT16 justification : 4;
-
- /// <summary>
- /// Indicates glyph is the first of a cluster.
- /// </summary>
- UINT16 isClusterStart : 1;
-
- /// <summary>
- /// Glyph is a diacritic.
- /// </summary>
- UINT16 isDiacritic : 1;
-
- /// <summary>
- /// Glyph has no width, blank, ZWJ, ZWNJ etc.
- /// </summary>
- UINT16 isZeroWidthSpace : 1;
-
- /// <summary>
- /// Reserved for use by shaping engine.
- /// </summary>
- UINT16 reserved : 9;
-};
-
-/// <summary>
-/// The interface implemented by the text analyzer's client to provide text to
-/// the analyzer. It allows the separation between the logical view of text as
-/// a continuous stream of characters identifiable by unique text positions,
-/// and the actual memory layout of potentially discrete blocks of text in the
-/// client's backing store.
-///
-/// If any of these callbacks returns an error, the analysis functions will
-/// stop prematurely and return a callback error. Rather than return E_NOTIMPL,
-/// an application should stub the method and return a constant/null and S_OK.
-/// </summary>
-interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown
-{
- /// <summary>
- /// Get a block of text starting at the specified text position.
- /// Returning NULL indicates the end of text - the position is after
- /// the last character. This function is called iteratively for
- /// each consecutive block, tying together several fragmented blocks
- /// in the backing store into a virtual contiguous string.
- /// </summary>
- /// <param name="textPosition">First position of the piece to obtain. All
- /// positions are in UTF16 code-units, not whole characters, which
- /// matters when supplementary characters are used.</param>
- /// <param name="textString">Address that receives a pointer to the text block
- /// at the specified position.</param>
- /// <param name="textLength">Number of UTF16 units of the retrieved chunk.
- /// The returned length is not the length of the block, but the length
- /// remaining in the block, from the given position until its end.
- /// So querying for a position that is 75 positions into a 100
- /// postition block would return 25.</param>
- /// <returns>Pointer to the first character at the given text position.
- /// NULL indicates no chunk available at the specified position, either
- /// because textPosition >= the entire text content length or because the
- /// queried position is not mapped into the app's backing store.</returns>
- /// <remarks>
- /// Although apps can implement sparse textual content that only maps part of
- /// the backing store, the app must map any text that is in the range passed
- /// to any analysis functions.
- /// </remarks>
- STDMETHOD(GetTextAtPosition)(
- UINT32 textPosition,
- __out WCHAR const** textString,
- __out UINT32* textLength
- ) PURE;
-
- /// <summary>
- /// Get a block of text immediately preceding the specified position.
- /// </summary>
- /// <param name="textPosition">Position immediately after the last position of the chunk to obtain.</param>
- /// <param name="textString">Address that receives a pointer to the text block
- /// at the specified position.</param>
- /// <param name="textLength">Number of UTF16 units of the retrieved block.
- /// The length returned is from the given position to the front of
- /// the block.</param>
- /// <returns>Pointer to the first character at (textPosition - textLength).
- /// NULL indicates no chunk available at the specified position, either
- /// because textPosition == 0,the textPosition > the entire text content
- /// length, or the queried position is not mapped into the app's backing
- /// store.</returns>
- /// <remarks>
- /// Although apps can implement sparse textual content that only maps part of
- /// the backing store, the app must map any text that is in the range passed
- /// to any analysis functions.
- /// </remarks>
- STDMETHOD(GetTextBeforePosition)(
- UINT32 textPosition,
- __out WCHAR const** textString,
- __out UINT32* textLength
- ) PURE;
-
- /// <summary>
- /// Get paragraph reading direction.
- /// </summary>
- STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE;
-
- /// <summary>
- /// Get locale name on the range affected by it.
- /// </summary>
- /// <param name="textPosition">Position to get the locale name of.</param>
- /// <param name="textLength">Receives the length from the given position up to the
- /// next differing locale.</param>
- /// <param name="localeName">Address that receives a pointer to the locale
- /// at the specified position.</param>
- /// <remarks>
- /// The localeName pointer must remain valid until the next call or until
- /// the analysis returns.
- /// </remarks>
- STDMETHOD(GetLocaleName)(
- UINT32 textPosition,
- __out UINT32* textLength,
- __out_z WCHAR const** localeName
- ) PURE;
-
- /// <summary>
- /// Get number substitution on the range affected by it.
- /// </summary>
- /// <param name="textPosition">Position to get the number substitution of.</param>
- /// <param name="textLength">Receives the length from the given position up to the
- /// next differing number substitution.</param>
- /// <param name="numberSubstitution">Address that receives a pointer to the number substitution
- /// at the specified position.</param>
- /// <remarks>
- /// Any implementation should return the number substitution with an
- /// incremented ref count, and the analysis will release when finished
- /// with it (either before the next call or before it returns). However,
- /// the sink callback may hold onto it after that.
- /// </remarks>
- STDMETHOD(GetNumberSubstitution)(
- UINT32 textPosition,
- __out UINT32* textLength,
- __out IDWriteNumberSubstitution** numberSubstitution
- ) PURE;
-};
-
-/// <summary>
-/// The interface implemented by the text analyzer's client to receive the
-/// output of a given text analysis. The Text analyzer disregards any current
-/// state of the analysis sink, therefore a Set method call on a range
-/// overwrites the previously set analysis result of the same range.
-/// </summary>
-interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown
-{
- /// <summary>
- /// Report script analysis for the text range.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="scriptAnalysis">Script analysis of characters in range.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetScriptAnalysis)(
- UINT32 textPosition,
- UINT32 textLength,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis
- ) PURE;
-
- /// <summary>
- /// Repport line-break opportunities for each character, starting from
- /// the specified position.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="lineBreakpoints">Breaking conditions for each character.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetLineBreakpoints)(
- UINT32 textPosition,
- UINT32 textLength,
- __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints
- ) PURE;
-
- /// <summary>
- /// Set bidirectional level on the range, called once per each
- /// level run change (either explicit or resolved implicit).
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="explicitLevel">Explicit level from embedded control codes
- /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules.</param>
- /// <param name="resolvedLevel">Final implicit level considering the
- /// explicit level and characters' natural directionality, after all
- /// Bidi rules have been applied.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetBidiLevel)(
- UINT32 textPosition,
- UINT32 textLength,
- UINT8 explicitLevel,
- UINT8 resolvedLevel
- ) PURE;
-
- /// <summary>
- /// Set number substitution on the range.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="numberSubstitution">The number substitution applicable to
- /// the returned range of text. The sink callback may hold onto it by
- /// incrementing its ref count.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- /// <remark>
- /// Unlike script and bidi analysis, where every character passed to the
- /// analyzer has a result, this will only be called for those ranges where
- /// substitution is applicable. For any other range, you will simply not
- /// be called.
- /// </remark>
- STDMETHOD(SetNumberSubstitution)(
- UINT32 textPosition,
- UINT32 textLength,
- __notnull IDWriteNumberSubstitution* numberSubstitution
- ) PURE;
-};
-
-/// <summary>
-/// Analyzes various text properties for complex script processing.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown
-{
- /// <summary>
- /// Analyzes a text range for script boundaries, reading text attributes
- /// from the source and reporting the Unicode script ID to the sink
- /// callback SetScript.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(AnalyzeScript)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for script directionality, reading attributes
- /// from the source and reporting levels to the sink callback SetBidiLevel.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple paragraphs, the text range
- /// should not arbitrarily split the middle of paragraphs. Otherwise the
- /// returned levels may be wrong, since the Bidi algorithm is meant to
- /// apply to the paragraph as a whole.
- /// </remarks>
- /// <remarks>
- /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
- /// </remarks>
- STDMETHOD(AnalyzeBidi)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for spans where number substitution is applicable,
- /// reading attributes from the source and reporting substitutable ranges
- /// to the sink callback SetNumberSubstitution.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple ranges of differing number
- /// substitutions, the text ranges should not arbitrarily split the
- /// middle of numbers. Otherwise it will treat the numbers separately
- /// and will not translate any intervening punctuation.
- /// </remarks>
- /// <remarks>
- /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
- /// </remarks>
- STDMETHOD(AnalyzeNumberSubstitution)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for potential breakpoint opportunities, reading
- /// attributes from the source and reporting breakpoint opportunities to
- /// the sink callback SetLineBreakpoints.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple paragraphs, the text range
- /// should not arbitrarily split the middle of paragraphs, unless the
- /// given text span is considered a whole unit. Otherwise the
- /// returned properties for the first and last characters will
- /// inappropriately allow breaks.
- /// </remarks>
- /// <remarks>
- /// Special cases include the first, last, and surrogate characters. Any
- /// text span is treated as if adjacent to inline objects on either side.
- /// So the rules with contingent-break opportunities are used, where the
- /// edge between text and inline objects is always treated as a potential
- /// break opportunity, dependent on any overriding rules of the adjacent
- /// objects to prohibit or force the break (see Unicode TR #14).
- /// Surrogate pairs never break between.
- /// </remarks>
- STDMETHOD(AnalyzeLineBreakpoints)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Parses the input text string and maps it to the set of glyphs and associated glyph data
- /// according to the font and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The string to convert to glyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="fontFace">The font face to get glyphs from.</param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="numberSubstitution">Optional number substitution which
- /// selects the appropriate glyphs for digits and related numeric characters,
- /// depending on the results obtained from AnalyzeNumberSubstitution. Passing
- /// null indicates that no substitution is needed and that the digits should
- /// receive nominal glyphs.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="maxGlyphCount">The maximum number of glyphs that can be
- /// returned.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges.</param>
- /// <param name="textProps">Per-character output properties.</param>
- /// <param name="glyphIndices">Output glyph indices.</param>
- /// <param name="glyphProps">Per-glyph output properties.</param>
- /// <param name="actualGlyphCount">The actual number of glyphs returned if
- /// the call succeeds.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Note that the mapping from characters to glyphs is, in general, many-
- /// to-many. The recommended estimate for the per-glyph output buffers is
- /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient.
- ///
- /// The value of the actualGlyphCount parameter is only valid if the call
- /// succeeds. In the event that maxGlyphCount is not big enough
- /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// will be returned. The application should allocate a larger buffer and try again.
- /// </remarks>
- STDMETHOD(GetGlyphs)(
- __in_ecount(textLength) WCHAR const* textString,
- UINT32 textLength,
- IDWriteFontFace* fontFace,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __maybenull IDWriteNumberSubstitution* numberSubstitution,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- UINT32 maxGlyphCount,
- __out_ecount(textLength) UINT16* clusterMap,
- __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- __out_ecount(maxGlyphCount) UINT16* glyphIndices,
- __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,
- __out UINT32* actualGlyphCount
- ) PURE;
-
- /// <summary>
- /// Place glyphs output from the GetGlyphs method according to the font
- /// and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The original string the glyphs came from.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges. Returned by GetGlyphs.</param>
- /// <param name="textProps">Per-character properties. Returned by
- /// GetGlyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
- /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
- /// <param name="glyphCount">The number of glyphs.</param>
- /// <param name="fontFace">The font face the glyphs came from.</param>
- /// <param name="fontEmSize">Logical font size in DIP's.</param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="glyphAdvances">The advance width of each glyph.</param>
- /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphPlacements)(
- __in_ecount(textLength) WCHAR const* textString,
- __in_ecount(textLength) UINT16 const* clusterMap,
- __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- UINT32 textLength,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
- UINT32 glyphCount,
- IDWriteFontFace * fontFace,
- FLOAT fontEmSize,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- __out_ecount(glyphCount) FLOAT* glyphAdvances,
- __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
- ) PURE;
-
- /// <summary>
- /// Place glyphs output from the GetGlyphs method according to the font
- /// and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The original string the glyphs came from.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges. Returned by GetGlyphs.</param>
- /// <param name="textProps">Per-character properties. Returned by
- /// GetGlyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
- /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
- /// <param name="glyphCount">The number of glyphs.</param>
- /// <param name="fontFace">The font face the glyphs came from.</param>
- /// <param name="fontEmSize">Logical font size in DIP's.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
- /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="glyphAdvances">The advance width of each glyph.</param>
- /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGdiCompatibleGlyphPlacements)(
- __in_ecount(textLength) WCHAR const* textString,
- __in_ecount(textLength) UINT16 const* clusterMap,
- __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- UINT32 textLength,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
- UINT32 glyphCount,
- IDWriteFontFace * fontFace,
- FLOAT fontEmSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- __out_ecount(glyphCount) FLOAT* glyphAdvances,
- __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
- ) PURE;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers
-/// to draw glyph runs. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_GLYPH_RUN
-{
- /// <summary>
- /// The physical font face to draw with.
- /// </summary>
- __notnull IDWriteFontFace* fontFace;
-
- /// <summary>
- /// Logical size of the font in DIPs, not points (equals 1/96 inch).
- /// </summary>
- FLOAT fontEmSize;
-
- /// <summary>
- /// The number of glyphs.
- /// </summary>
- UINT32 glyphCount;
-
- /// <summary>
- /// The indices to render.
- /// </summary>
- __field_ecount(glyphCount) UINT16 const* glyphIndices;
-
- /// <summary>
- /// Glyph advance widths.
- /// </summary>
- __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances;
-
- /// <summary>
- /// Glyph offsets.
- /// </summary>
- __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets;
-
- /// <summary>
- /// If true, specifies that glyphs are rotated 90 degrees to the left and
- /// vertical metrics are used. Vertical writing is achieved by specifying
- /// isSideways = true and rotating the entire run 90 degrees to the right
- /// via a rotate transform.
- /// </summary>
- BOOL isSideways;
-
- /// <summary>
- /// The implicit resolved bidi level of the run. Odd levels indicate
- /// right-to-left languages like Hebrew and Arabic, while even levels
- /// indicate left-to-right languages like English and Japanese (when
- /// written horizontally). For right-to-left languages, the text origin
- /// is on the right, and text should be drawn to the left.
- /// </summary>
- UINT32 bidiLevel;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties
-/// related to those in DWRITE_GLYPH_RUN.
-/// </summary>
-struct DWRITE_GLYPH_RUN_DESCRIPTION
-{
- /// <summary>
- /// The locale name associated with this run.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The text associated with the glyphs.
- /// </summary>
- __field_ecount(stringLength) WCHAR const* string;
-
- /// <summary>
- /// The number of characters (UTF16 code-units).
- /// Note that this may be different than the number of glyphs.
- /// </summary>
- UINT32 stringLength;
-
- /// <summary>
- /// An array of indices to the glyph indices array, of the first glyphs of
- /// all the glyph clusters of the glyphs to render.
- /// </summary>
- __field_ecount(stringLength) UINT16 const* clusterMap;
-
- /// <summary>
- /// Corresponding text position in the original string
- /// this glyph run came from.
- /// </summary>
- UINT32 textPosition;
-};
-
-/// <summary>
-/// The DWRITE_UNDERLINE structure contains about the size and placement of
-/// underlines. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_UNDERLINE
-{
- /// <summary>
- /// Width of the underline, measured parallel to the baseline.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Thickness of the underline, measured perpendicular to the
- /// baseline.
- /// </summary>
- FLOAT thickness;
-
- /// <summary>
- /// Offset of the underline from the baseline.
- /// A positive offset represents a position below the baseline and
- /// a negative offset is above.
- /// </summary>
- FLOAT offset;
-
- /// <summary>
- /// Height of the tallest run where the underline applies.
- /// </summary>
- FLOAT runHeight;
-
- /// <summary>
- /// Reading direction of the text associated with the underline. This
- /// value is used to interpret whether the width value runs horizontally
- /// or vertically.
- /// </summary>
- DWRITE_READING_DIRECTION readingDirection;
-
- /// <summary>
- /// Flow direction of the text associated with the underline. This value
- /// is used to interpret whether the thickness value advances top to
- /// bottom, left to right, or right to left.
- /// </summary>
- DWRITE_FLOW_DIRECTION flowDirection;
-
- /// <summary>
- /// Locale of the text the underline is being drawn under. Can be
- /// pertinent where the locale affects how the underline is drawn.
- /// For example, in vertical text, the underline belongs on the
- /// left for Chinese but on the right for Japanese.
- /// This choice is completely left up to higher levels.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The measuring mode can be useful to the renderer to determine how
- /// underlines are rendered, e.g. rounding the thickness to a whole pixel
- /// in GDI-compatible modes.
- /// </summary>
- DWRITE_MEASURING_MODE measuringMode;
-};
-
-/// <summary>
-/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of
-/// strickthroughs. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_STRIKETHROUGH
-{
- /// <summary>
- /// Width of the strikethrough, measured parallel to the baseline.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Thickness of the strikethrough, measured perpendicular to the
- /// baseline.
- /// </summary>
- FLOAT thickness;
-
- /// <summary>
- /// Offset of the stikethrough from the baseline.
- /// A positive offset represents a position below the baseline and
- /// a negative offset is above.
- /// </summary>
- FLOAT offset;
-
- /// <summary>
- /// Reading direction of the text associated with the strikethrough. This
- /// value is used to interpret whether the width value runs horizontally
- /// or vertically.
- /// </summary>
- DWRITE_READING_DIRECTION readingDirection;
-
- /// <summary>
- /// Flow direction of the text associated with the strikethrough. This
- /// value is used to interpret whether the thickness value advances top to
- /// bottom, left to right, or right to left.
- /// </summary>
- DWRITE_FLOW_DIRECTION flowDirection;
-
- /// <summary>
- /// Locale of the range. Can be pertinent where the locale affects the style.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The measuring mode can be useful to the renderer to determine how
- /// underlines are rendered, e.g. rounding the thickness to a whole pixel
- /// in GDI-compatible modes.
- /// </summary>
- DWRITE_MEASURING_MODE measuringMode;
-};
-
-/// <summary>
-/// The DWRITE_LINE_METRICS structure contains information about a formatted
-/// line of text.
-/// </summary>
-struct DWRITE_LINE_METRICS
-{
- /// <summary>
- /// The number of total text positions in the line.
- /// This includes any trailing whitespace and newline characters.
- /// </summary>
- UINT32 length;
-
- /// <summary>
- /// The number of whitespace positions at the end of the line. Newline
- /// sequences are considered whitespace.
- /// </summary>
- UINT32 trailingWhitespaceLength;
-
- /// <summary>
- /// The number of characters in the newline sequence at the end of the line.
- /// If the count is zero, then the line was either wrapped or it is the
- /// end of the text.
- /// </summary>
- UINT32 newlineLength;
-
- /// <summary>
- /// Height of the line as measured from top to bottom.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Distance from the top of the line to its baseline.
- /// </summary>
- FLOAT baseline;
-
- /// <summary>
- /// The line is trimmed.
- /// </summary>
- BOOL isTrimmed;
-};
-
-
-/// <summary>
-/// The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster.
-/// </summary>
-struct DWRITE_CLUSTER_METRICS
-{
- /// <summary>
- /// The total advance width of all glyphs in the cluster.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// The number of text positions in the cluster.
- /// </summary>
- UINT16 length;
-
- /// <summary>
- /// Indicate whether line can be broken right after the cluster.
- /// </summary>
- UINT16 canWrapLineAfter : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to whitespace character.
- /// </summary>
- UINT16 isWhitespace : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to a newline character.
- /// </summary>
- UINT16 isNewline : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to soft hyphen character.
- /// </summary>
- UINT16 isSoftHyphen : 1;
-
- /// <summary>
- /// Indicate whether the cluster is read from right to left.
- /// </summary>
- UINT16 isRightToLeft : 1;
-
- UINT16 padding : 11;
-};
-
-
-/// <summary>
-/// Overall metrics associated with text after layout.
-/// All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_TEXT_METRICS
-{
- /// <summary>
- /// Left-most point of formatted text relative to layout box
- /// (excluding any glyph overhang).
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// Top-most point of formatted text relative to layout box
- /// (excluding any glyph overhang).
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// The width of the formatted text ignoring trailing whitespace
- /// at the end of each line.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// The width of the formatted text taking into account the
- /// trailing whitespace at the end of each line.
- /// </summary>
- FLOAT widthIncludingTrailingWhitespace;
-
- /// <summary>
- /// The height of the formatted text. The height of an empty string
- /// is determined by the size of the default font's line height.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Initial width given to the layout. Depending on whether the text
- /// was wrapped or not, it can be either larger or smaller than the
- /// text content width.
- /// </summary>
- FLOAT layoutWidth;
-
- /// <summary>
- /// Initial height given to the layout. Depending on the length of the
- /// text, it may be larger or smaller than the text content height.
- /// </summary>
- FLOAT layoutHeight;
-
- /// <summary>
- /// The maximum reordering count of any line of text, used
- /// to calculate the most number of hit-testing boxes needed.
- /// If the layout has no bidirectional text or no text at all,
- /// the minimum level is 1.
- /// </summary>
- UINT32 maxBidiReorderingDepth;
-
- /// <summary>
- /// Total number of lines.
- /// </summary>
- UINT32 lineCount;
-};
-
-
-/// <summary>
-/// Properties describing the geometric measurement of an
-/// application-defined inline object.
-/// </summary>
-struct DWRITE_INLINE_OBJECT_METRICS
-{
- /// <summary>
- /// Width of the inline object.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Height of the inline object as measured from top to bottom.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Distance from the top of the object to the baseline where it is lined up with the adjacent text.
- /// If the baseline is at the bottom, baseline simply equals height.
- /// </summary>
- FLOAT baseline;
-
- /// <summary>
- /// Flag indicating whether the object is to be placed upright or alongside the text baseline
- /// for vertical text.
- /// </summary>
- BOOL supportsSideways;
-};
-
-
-/// <summary>
-/// The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels
-/// (in DIPs) overshoot each side of the layout or inline objects.
-/// </summary>
-/// <remarks>
-/// Positive overhangs indicate that the visible area extends outside the layout
-/// box or inline object, while negative values mean there is whitespace inside.
-/// The returned values are unaffected by rendering transforms or pixel snapping.
-/// Additionally, they may not exactly match final target's pixel bounds after
-/// applying grid fitting and hinting.
-/// </remarks>
-struct DWRITE_OVERHANG_METRICS
-{
- /// <summary>
- /// The distance from the left-most visible DIP to its left alignment edge.
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// The distance from the top-most visible DIP to its top alignment edge.
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// The distance from the right-most visible DIP to its right alignment edge.
- /// </summary>
- FLOAT right;
-
- /// <summary>
- /// The distance from the bottom-most visible DIP to its bottom alignment edge.
- /// </summary>
- FLOAT bottom;
-};
-
-
-/// <summary>
-/// Geometry enclosing of text positions.
-/// </summary>
-struct DWRITE_HIT_TEST_METRICS
-{
- /// <summary>
- /// First text position within the geometry.
- /// </summary>
- UINT32 textPosition;
-
- /// <summary>
- /// Number of text positions within the geometry.
- /// </summary>
- UINT32 length;
-
- /// <summary>
- /// Left position of the top-left coordinate of the geometry.
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// Top position of the top-left coordinate of the geometry.
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// Geometry's width.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Geometry's height.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Bidi level of text positions enclosed within the geometry.
- /// </summary>
- UINT32 bidiLevel;
-
- /// <summary>
- /// Geometry encloses text?
- /// </summary>
- BOOL isText;
-
- /// <summary>
- /// Range is trimmed.
- /// </summary>
- BOOL isTrimmed;
-};
-
-
-interface IDWriteTextRenderer;
-
-
-/// <summary>
-/// The IDWriteInlineObject interface wraps an application defined inline graphic,
-/// allowing DWrite to query metrics as if it was a glyph inline with the text.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown
-{
- /// <summary>
- /// The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject)
- /// can use this to draw the inline object without needing to cast or query the object
- /// type. The text layout does not call this method directly.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="renderer">The renderer passed to IDWriteTextLayout::Draw as the object's containing parent.</param>
- /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
- /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
- /// <param name="isSideways">The object should be drawn on its side.</param>
- /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Draw)(
- __maybenull void* clientDrawingContext,
- IDWriteTextRenderer* renderer,
- FLOAT originX,
- FLOAT originY,
- BOOL isSideways,
- BOOL isRightToLeft,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// TextLayout calls this callback function to get the measurement of the inline object.
- /// </summary>
- /// <param name="metrics">Returned metrics</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetMetrics)(
- __out DWRITE_INLINE_OBJECT_METRICS* metrics
- ) PURE;
-
- /// <summary>
- /// TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object.
- /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will
- /// simply be zeroes.
- /// </summary>
- /// <param name="overhangs">Overshoot of visible extents (in DIPs) outside the object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// The overhangs should be returned relative to the reported size of the object
- /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline
- /// adjusted. If you have an image that is actually 100x100 DIPs, but you want it
- /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you would
- /// return a width/height of 60x60 and four overhangs of 20 DIPs.
- /// </remarks>
- STDMETHOD(GetOverhangMetrics)(
- __out DWRITE_OVERHANG_METRICS* overhangs
- ) PURE;
-
- /// <summary>
- /// Layout uses this to determine the line breaking behavior of the inline object
- /// amidst the text.
- /// </summary>
- /// <param name="breakConditionBefore">Line-breaking condition between the object and the content immediately preceding it.</param>
- /// <param name="breakConditionAfter" >Line-breaking condition between the object and the content immediately following it.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetBreakConditions)(
- __out DWRITE_BREAK_CONDITION* breakConditionBefore,
- __out DWRITE_BREAK_CONDITION* breakConditionAfter
- ) PURE;
-};
-
-/// <summary>
-/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown
-{
- /// <summary>
- /// Determines whether pixel snapping is disabled. The recommended default is FALSE,
- /// unless doing animation that requires subpixel vertical placement.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="isDisabled">Receives TRUE if pixel snapping is disabled or FALSE if it not.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(IsPixelSnappingDisabled)(
- __maybenull void* clientDrawingContext,
- __out BOOL* isDisabled
- ) PURE;
-
- /// <summary>
- /// Gets the current transform that maps abstract coordinates to DIPs,
- /// which may disable pixel snapping upon any rotation or shear.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="transform">Receives the transform.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentTransform)(
- __maybenull void* clientDrawingContext,
- __out DWRITE_MATRIX* transform
- ) PURE;
-
- /// <summary>
- /// Gets the number of physical pixels per DIP. A DIP (device-independent pixel) is 1/96 inch,
- /// so the pixelsPerDip value is the number of logical pixels per inch divided by 96 (yielding
- /// a value of 1 for 96 DPI and 1.25 for 120).
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="pixelsPerDip">Receives the number of physical pixels per DIP.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetPixelsPerDip)(
- __maybenull void* clientDrawingContext,
- __out FLOAT* pixelsPerDip
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteTextLayout interface represents a set of application-defined
-/// callbacks that perform rendering of text, inline objects, and decorations
-/// such as underlines.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping
-{
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to
- /// render a run of glyphs.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
- /// Renderer implementations may choose different rendering modes for given measuring methods,
- /// but best results are seen when the rendering mode matches the corresponding measuring mode:
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
- /// </param>
- /// <param name="glyphRun">The glyph run to draw.</param>
- /// <param name="glyphRunDescription">Properties of the characters
- /// associated with this run.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DrawGlyphRun)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
- /// an underline.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="underline">Underline logical information.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// A single underline can be broken into multiple calls, depending on
- /// how the formatting changes attributes. If font sizes/styles change
- /// within an underline, the thickness and offset will be averaged
- /// weighted according to characters.
- /// To get the correct top coordinate of the underline rect, add underline::offset
- /// to the baseline's Y. Otherwise the underline will be immediately under the text.
- /// The x coordinate will always be passed as the left side, regardless
- /// of text directionality. This simplifies drawing and reduces the
- /// problem of round-off that could potentially cause gaps or a double
- /// stamped alpha blend. To avoid alpha overlap, round the end points
- /// to the nearest device pixel.
- /// </remarks>
- STDMETHOD(DrawUnderline)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __in DWRITE_UNDERLINE const* underline,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
- /// a strikethrough.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="strikethrough">Strikethrough logical information.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// A single strikethrough can be broken into multiple calls, depending on
- /// how the formatting changes attributes. Strikethrough is not averaged
- /// across font sizes/styles changes.
- /// To get the correct top coordinate of the strikethrough rect,
- /// add strikethrough::offset to the baseline's Y.
- /// Like underlines, the x coordinate will always be passed as the left side,
- /// regardless of text directionality.
- /// </remarks>
- STDMETHOD(DrawStrikethrough)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __in DWRITE_STRIKETHROUGH const* strikethrough,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this application callback when it needs to
- /// draw an inline object.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
- /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
- /// <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param>
- /// <param name="isSideways">The object should be drawn on its side.</param>
- /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// The right-to-left flag is a hint for those cases where it would look
- /// strange for the image to be shown normally (like an arrow pointing to
- /// right to indicate a submenu).
- /// </remarks>
- STDMETHOD(DrawInlineObject)(
- __maybenull void* clientDrawingContext,
- FLOAT originX,
- FLOAT originY,
- IDWriteInlineObject* inlineObject,
- BOOL isSideways,
- BOOL isRightToLeft,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteTextLayout interface represents a block of text after it has
-/// been fully analyzed and formatted.
-///
-/// All coordinates are in device independent pixels (DIPs).
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat
-{
- /// <summary>
- /// Set layout maximum width
- /// </summary>
- /// <param name="maxWidth">Layout maximum width</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetMaxWidth)(
- FLOAT maxWidth
- ) PURE;
-
- /// <summary>
- /// Set layout maximum height
- /// </summary>
- /// <param name="maxHeight">Layout maximum height</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetMaxHeight)(
- FLOAT maxHeight
- ) PURE;
-
- /// <summary>
- /// Set the font collection.
- /// </summary>
- /// <param name="fontCollection">The font collection to set</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontCollection)(
- IDWriteFontCollection* fontCollection,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set null-terminated font family name.
- /// </summary>
- /// <param name="fontFamilyName">Font family name</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontFamilyName)(
- __in_z WCHAR const* fontFamilyName,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font weight.
- /// </summary>
- /// <param name="fontWeight">Font weight</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontWeight)(
- DWRITE_FONT_WEIGHT fontWeight,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font style.
- /// </summary>
- /// <param name="fontStyle">Font style</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontStyle)(
- DWRITE_FONT_STYLE fontStyle,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font stretch.
- /// </summary>
- /// <param name="fontStretch">font stretch</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontStretch)(
- DWRITE_FONT_STRETCH fontStretch,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font em height.
- /// </summary>
- /// <param name="fontSize">Font em height</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontSize)(
- FLOAT fontSize,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set underline.
- /// </summary>
- /// <param name="hasUnderline">The Boolean flag indicates whether underline takes place</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetUnderline)(
- BOOL hasUnderline,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set strikethrough.
- /// </summary>
- /// <param name="hasStrikethrough">The Boolean flag indicates whether strikethrough takes place</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetStrikethrough)(
- BOOL hasStrikethrough,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set application-defined drawing effect.
- /// </summary>
- /// <param name="drawingEffect">Pointer to an application-defined drawing effect.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This drawing effect is associated with the specified range and will be passed back
- /// to the application via the callback when the range is drawn at drawing time.
- /// </remarks>
- STDMETHOD(SetDrawingEffect)(
- IUnknown* drawingEffect,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set inline object.
- /// </summary>
- /// <param name="inlineObject">Pointer to an application-implemented inline object.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This inline object applies to the specified range and will be passed back
- /// to the application via the DrawInlineObject callback when the range is drawn.
- /// Any text in that range will be suppressed.
- /// </remarks>
- STDMETHOD(SetInlineObject)(
- IDWriteInlineObject* inlineObject,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font typography features.
- /// </summary>
- /// <param name="typography">Pointer to font typography setting.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTypography)(
- IDWriteTypography* typography,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set locale name.
- /// </summary>
- /// <param name="localeName">Locale name</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetLocaleName)(
- __in_z WCHAR const* localeName,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Get layout maximum width
- /// </summary>
- STDMETHOD_(FLOAT, GetMaxWidth)() PURE;
-
- /// <summary>
- /// Get layout maximum height
- /// </summary>
- STDMETHOD_(FLOAT, GetMaxHeight)() PURE;
-
- /// <summary>
- /// Get the font collection where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontCollection">The current font collection</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- UINT32 currentPosition,
- __out IDWriteFontCollection** fontCollection,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the length of the font family name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyNameLength)(
- UINT32 currentPosition,
- __out UINT32* nameLength,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Copy the font family name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontFamilyName">Character array that receives the current font family name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyName)(
- UINT32 currentPosition,
- __out_ecount_z(nameSize) WCHAR* fontFamilyName,
- UINT32 nameSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font weight where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontWeight">The current font weight</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontWeight)(
- UINT32 currentPosition,
- __out DWRITE_FONT_WEIGHT* fontWeight,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font style where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontStyle">The current font style</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontStyle)(
- UINT32 currentPosition,
- __out DWRITE_FONT_STYLE* fontStyle,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font stretch where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontStretch">The current font stretch</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontStretch)(
- UINT32 currentPosition,
- __out DWRITE_FONT_STRETCH* fontStretch,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font em height where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontSize">The current font em height</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontSize)(
- UINT32 currentPosition,
- __out FLOAT* fontSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the underline presence where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="hasUnderline">The Boolean flag indicates whether text is underlined.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetUnderline)(
- UINT32 currentPosition,
- __out BOOL* hasUnderline,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the strikethrough presence where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="hasStrikethrough">The Boolean flag indicates whether text has strikethrough.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetStrikethrough)(
- UINT32 currentPosition,
- __out BOOL* hasStrikethrough,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the application-defined drawing effect where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="drawingEffect">The current application-defined drawing effect.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetDrawingEffect)(
- UINT32 currentPosition,
- __out IUnknown** drawingEffect,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the inline object at the given position.
- /// </summary>
- /// <param name="currentPosition">The given text position.</param>
- /// <param name="inlineObject">The inline object.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetInlineObject)(
- UINT32 currentPosition,
- __out IDWriteInlineObject** inlineObject,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the typography setting where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="typography">The current typography setting.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetTypography)(
- UINT32 currentPosition,
- __out IDWriteTypography** typography,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the length of the locale name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleNameLength)(
- UINT32 currentPosition,
- __out UINT32* nameLength,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the locale name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="localeName">Character array that receives the current locale name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- UINT32 currentPosition,
- __out_ecount_z(nameSize) WCHAR* localeName,
- UINT32 nameSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Initiate drawing of the text.
- /// </summary>
- /// <param name="clientDrawingContext">An application defined value
- /// included in rendering callbacks.</param>
- /// <param name="renderer">The set of application-defined callbacks that do
- /// the actual rendering.</param>
- /// <param name="originX">X-coordinate of the layout's left side.</param>
- /// <param name="originY">Y-coordinate of the layout's top side.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Draw)(
- __maybenull void* clientDrawingContext,
- IDWriteTextRenderer* renderer,
- FLOAT originX,
- FLOAT originY
- ) PURE;
-
- /// <summary>
- /// GetLineMetrics returns properties of each line.
- /// </summary>
- /// <param name="lineMetrics">The array to fill with line information.</param>
- /// <param name="maxLineCount">The maximum size of the lineMetrics array.</param>
- /// <param name="actualLineCount">The actual size of the lineMetrics
- /// array that is needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER,
- /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// is returned and *actualLineCount is set to the number of lines
- /// needed.
- /// </remarks>
- STDMETHOD(GetLineMetrics)(
- __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics,
- UINT32 maxLineCount,
- __out UINT32* actualLineCount
- ) PURE;
-
- /// <summary>
- /// GetMetrics retrieves overall metrics for the formatted string.
- /// </summary>
- /// <param name="textMetrics">The returned metrics.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Drawing effects like underline and strikethrough do not contribute
- /// to the text size, which is essentially the sum of advance widths and
- /// line heights. Additionally, visible swashes and other graphic
- /// adornments may extend outside the returned width and height.
- /// </remarks>
- STDMETHOD(GetMetrics)(
- __out DWRITE_TEXT_METRICS* textMetrics
- ) PURE;
-
- /// <summary>
- /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all
- /// objects contained in it, including text glyphs and inline objects.
- /// </summary>
- /// <param name="overhangs">Overshoots of visible extents (in DIPs) outside the layout.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Any underline and strikethrough do not contribute to the black box
- /// determination, since these are actually drawn by the renderer, which
- /// is allowed to draw them in any variety of styles.
- /// </remarks>
- STDMETHOD(GetOverhangMetrics)(
- __out DWRITE_OVERHANG_METRICS* overhangs
- ) PURE;
-
- /// <summary>
- /// Retrieve logical properties and measurement of each cluster.
- /// </summary>
- /// <param name="clusterMetrics">The array to fill with cluster information.</param>
- /// <param name="maxClusterCount">The maximum size of the clusterMetrics array.</param>
- /// <param name="actualClusterCount">The actual size of the clusterMetrics array that is needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER,
- /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// is returned and *actualClusterCount is set to the number of clusters
- /// needed.
- /// </remarks>
- STDMETHOD(GetClusterMetrics)(
- __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics,
- UINT32 maxClusterCount,
- __out UINT32* actualClusterCount
- ) PURE;
-
- /// <summary>
- /// Determines the minimum possible width the layout can be set to without
- /// emergency breaking between the characters of whole words.
- /// </summary>
- /// <param name="minWidth">Minimum width.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DetermineMinWidth)(
- __out FLOAT* minWidth
- ) PURE;
-
- /// <summary>
- /// Given a coordinate (in DIPs) relative to the top-left of the layout box,
- /// this returns the corresponding hit-test metrics of the text string where
- /// the hit-test has occurred. This is useful for mapping mouse clicks to caret
- /// positions. When the given coordinate is outside the text string, the function
- /// sets the output value *isInside to false but returns the nearest character
- /// position.
- /// </summary>
- /// <param name="pointX">X coordinate to hit-test, relative to the top-left location of the layout box.</param>
- /// <param name="pointY">Y coordinate to hit-test, relative to the top-left location of the layout box.</param>
- /// <param name="isTrailingHit">Output flag indicating whether the hit-test location is at the leading or the trailing
- /// side of the character. When the output *isInside value is set to false, this value is set according to the output
- /// *position value to represent the edge closest to the hit-test location. </param>
- /// <param name="isInside">Output flag indicating whether the hit-test location is inside the text string.
- /// When false, the position nearest the text's edge is returned.</param>
- /// <param name="hitTestMetrics">Output geometry fully enclosing the hit-test location. When the output *isInside value
- /// is set to false, this structure represents the geometry enclosing the edge closest to the hit-test location.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(HitTestPoint)(
- FLOAT pointX,
- FLOAT pointY,
- __out BOOL* isTrailingHit,
- __out BOOL* isInside,
- __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
- ) PURE;
-
- /// <summary>
- /// Given a text position and whether the caret is on the leading or trailing
- /// edge of that position, this returns the corresponding coordinate (in DIPs)
- /// relative to the top-left of the layout box. This is most useful for drawing
- /// the caret's current position, but it could also be used to anchor an IME to the
- /// typed text or attach a floating menu near the point of interest. It may also be
- /// used to programmatically obtain the geometry of a particular text position
- /// for UI automation.
- /// </summary>
- /// <param name="textPosition">Text position to get the coordinate of.</param>
- /// <param name="isTrailingHit">Flag indicating whether the location is of the leading or the trailing side of the specified text position. </param>
- /// <param name="pointX">Output caret X, relative to the top-left of the layout box.</param>
- /// <param name="pointY">Output caret Y, relative to the top-left of the layout box.</param>
- /// <param name="hitTestMetrics">Output geometry fully enclosing the specified text position.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// When drawing a caret at the returned X,Y, it should should be centered on X
- /// and drawn from the Y coordinate down. The height will be the size of the
- /// hit-tested text (which can vary in size within a line).
- /// Reading direction also affects which side of the character the caret is drawn.
- /// However, the returned X coordinate will be correct for either case.
- /// You can get a text length back that is larger than a single character.
- /// This happens for complex scripts when multiple characters form a single cluster,
- /// when diacritics join their base character, or when you test a surrogate pair.
- /// </remarks>
- STDMETHOD(HitTestTextPosition)(
- UINT32 textPosition,
- BOOL isTrailingHit,
- __out FLOAT* pointX,
- __out FLOAT* pointY,
- __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
- ) PURE;
-
- /// <summary>
- /// The application calls this function to get a set of hit-test metrics
- /// corresponding to a range of text positions. The main usage for this
- /// is to draw highlighted selection of the text string.
- ///
- /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to
- /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of
- /// hitTestMetrics is too small to hold all the regions calculated by the
- /// function. In such situation, the function sets the output value
- /// *actualHitTestMetricsCount to the number of geometries calculated.
- /// The application is responsible to allocate a new buffer of greater
- /// size and call the function again.
- ///
- /// A good value to use as an initial value for maxHitTestMetricsCount may
- /// be calculated from the following equation:
- /// maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth
- ///
- /// where lineCount is obtained from the value of the output argument
- /// *actualLineCount from the function IDWriteTextLayout::GetLineMetrics,
- /// and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS
- /// structure of the output argument *textMetrics from the function
- /// IDWriteFactory::CreateTextLayout.
- /// </summary>
- /// <param name="textPosition">First text position of the specified range.</param>
- /// <param name="textLength">Number of positions of the specified range.</param>
- /// <param name="originX">Offset of the X origin (left of the layout box) which is added to each of the hit-test metrics returned.</param>
- /// <param name="originY">Offset of the Y origin (top of the layout box) which is added to each of the hit-test metrics returned.</param>
- /// <param name="hitTestMetrics">Pointer to a buffer of the output geometry fully enclosing the specified position range.</param>
- /// <param name="maxHitTestMetricsCount">Maximum number of distinct metrics it could hold in its buffer memory.</param>
- /// <param name="actualHitTestMetricsCount">Actual number of metrics returned or needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// There are no gaps in the returned metrics. While there could be visual gaps,
- /// depending on bidi ordering, each range is contiguous and reports all the text,
- /// including any hidden characters and trimmed text.
- /// The height of each returned range will be the same within each line, regardless
- /// of how the font sizes vary.
- /// </remarks>
- STDMETHOD(HitTestTextRange)(
- UINT32 textPosition,
- UINT32 textLength,
- FLOAT originX,
- FLOAT originY,
- __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics,
- UINT32 maxHitTestMetricsCount,
- __out UINT32* actualHitTestMetricsCount
- ) PURE;
-};
-
-/// <summary>
-/// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown
-{
- /// <summary>
- /// Draws a run of glyphs to the bitmap.
- /// </summary>
- /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
- /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
- /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
- /// Renderer implementations may choose different rendering modes for different measuring methods, for example
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL,
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC, and
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL.
- /// </param>
- /// <param name="glyphRun">Structure containing the properties of the glyph run.</param>
- /// <param name="renderingParams">Object that controls rendering behavior.</param>
- /// <param name="textColor">Specifies the foreground color of the text.</param>
- /// <param name="blackBoxRect">Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by
- /// drawing the glyph run. The black box rectangle may extend beyond the dimensions of the bitmap.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DrawGlyphRun)(
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- IDWriteRenderingParams* renderingParams,
- COLORREF textColor,
- __out_opt RECT* blackBoxRect = NULL
- ) PURE;
-
- /// <summary>
- /// Gets a handle to the memory device context.
- /// </summary>
- /// <returns>
- /// Returns the device context handle.
- /// </returns>
- /// <remarks>
- /// An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle
- /// (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including
- /// a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit
- /// top-down DIB.
- /// </remarks>
- STDMETHOD_(HDC, GetMemoryDC)() PURE;
-
- /// <summary>
- /// Gets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
- /// if pixels per inch divided by 96.
- /// </summary>
- /// <returns>
- /// Returns the number of bitmap pixels per DIP.
- /// </returns>
- STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE;
-
- /// <summary>
- /// Sets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
- /// if pixels per inch divided by 96.
- /// </summary>
- /// <param name="pixelsPerDip">Specifies the number of pixels per DIP.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetPixelsPerDip)(
- FLOAT pixelsPerDip
- ) PURE;
-
- /// <summary>
- /// Gets the transform that maps abstract coordinate to DIPs. By default this is the identity
- /// transform. Note that this is unrelated to the world transform of the underlying device
- /// context.
- /// </summary>
- /// <param name="transform">Receives the transform.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentTransform)(
- __out DWRITE_MATRIX* transform
- ) PURE;
-
- /// <summary>
- /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world
- /// transform of the underlying device context.
- /// </summary>
- /// <param name="transform">Specifies the new transform. This parameter can be NULL, in which
- /// case the identity transform is implied.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetCurrentTransform)(
- __in_opt DWRITE_MATRIX const* transform
- ) PURE;
-
- /// <summary>
- /// Gets the dimensions of the bitmap.
- /// </summary>
- /// <param name="size">Receives the size of the bitmap in pixels.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetSize)(
- __out SIZE* size
- ) PURE;
-
- /// <summary>
- /// Resizes the bitmap.
- /// </summary>
- /// <param name="width">New bitmap width, in pixels.</param>
- /// <param name="height">New bitmap height, in pixels.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Resize)(
- UINT32 width,
- UINT32 height
- ) PURE;
-};
-
-/// <summary>
-/// The GDI interop interface provides interoperability with GDI.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown
-{
- /// <summary>
- /// Creates a font object that matches the properties specified by the LOGFONT structure.
- /// </summary>
- /// <param name="logFont">Structure containing a GDI-compatible font description.</param>
- /// <param name="font">Receives a newly created font object if successful, or NULL in case of error.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFromLOGFONT)(
- __in LOGFONTW const* logFont,
- __out IDWriteFont** font
- ) PURE;
-
- /// <summary>
- /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
- /// </summary>
- /// <param name="font">Specifies a font in the system font collection.</param>
- /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
- /// <param name="isSystemFont">Contains TRUE if the specified font object is part of the system font collection
- /// or FALSE otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(ConvertFontToLOGFONT)(
- IDWriteFont* font,
- __out LOGFONTW* logFont,
- __out BOOL* isSystemFont
- ) PURE;
-
- /// <summary>
- /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
- /// </summary>
- /// <param name="font">Specifies a font face.</param>
- /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(ConvertFontFaceToLOGFONT)(
- IDWriteFontFace* font,
- __out LOGFONTW* logFont
- ) PURE;
-
- /// <summary>
- /// Creates a font face object that corresponds to the currently selected HFONT.
- /// </summary>
- /// <param name="hdc">Handle to a device context into which a font has been selected. It is assumed that the client
- /// has already performed font mapping and that the font selected into the DC is the actual font that would be used
- /// for rendering glyphs.</param>
- /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFaceFromHdc)(
- HDC hdc,
- __out IDWriteFontFace** fontFace
- ) PURE;
-
- /// <summary>
- /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs.
- /// </summary>
- /// <param name="hdc">Optional device context used to create a compatible memory DC.</param>
- /// <param name="width">Width of the bitmap.</param>
- /// <param name="height">Height of the bitmap.</param>
- /// <param name="renderTarget">Receives a pointer to the newly created render target.</param>
- STDMETHOD(CreateBitmapRenderTarget)(
- __in_opt HDC hdc,
- UINT32 width,
- UINT32 height,
- __out IDWriteBitmapRenderTarget** renderTarget
- ) PURE;
-};
-
-/// <summary>
-/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An alpha texture is a bitmap of alpha values, each
-/// representing the darkness (i.e., opacity) of a pixel or subpixel.
-/// </summary>
-enum DWRITE_TEXTURE_TYPE
-{
- /// <summary>
- /// Specifies an alpha texture for aliased text rendering (i.e., bi-level, where each pixel is either fully opaque or fully transparent),
- /// with one byte per pixel.
- /// </summary>
- DWRITE_TEXTURE_ALIASED_1x1,
-
- /// <summary>
- /// Specifies an alpha texture for ClearType text rendering, with three bytes per pixel in the horizontal dimension and
- /// one byte per pixel in the vertical dimension.
- /// </summary>
- DWRITE_TEXTURE_CLEARTYPE_3x1
-};
-
-/// <summary>
-/// Maximum alpha value in a texture returned by IDWriteGlyphRunAnalysis::CreateAlphaTexture.
-/// </summary>
-#define DWRITE_ALPHA_MAX 255
-
-/// <summary>
-/// Interface that encapsulates information used to render a glyph run.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown
-{
- /// <summary>
- /// Gets the bounding rectangle of the physical pixels affected by the glyph run.
- /// </summary>
- /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
- /// bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only anti-aliased
- /// glyphs.</param>
- /// <param name="textureBounds">Receives the bounding rectangle, or an empty rectangle if there are no glyphs
- /// if the specified type.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetAlphaTextureBounds)(
- DWRITE_TEXTURE_TYPE textureType,
- __out RECT* textureBounds
- ) PURE;
-
- /// <summary>
- /// Creates an alpha texture of the specified type.
- /// </summary>
- /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
- /// texture contains only bi-level glyphs. Otherwise, the texture contains only anti-aliased glyphs.</param>
- /// <param name="textureBounds">Specifies the bounding rectangle of the texture, which can be different than
- /// the bounding rectangle returned by GetAlphaTextureBounds.</param>
- /// <param name="alphaValues">Receives the array of alpha values.</param>
- /// <param name="bufferSize">Size of the alphaValues array. The minimum size depends on the dimensions of the
- /// rectangle and the type of texture requested.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateAlphaTexture)(
- DWRITE_TEXTURE_TYPE textureType,
- __in RECT const* textureBounds,
- __out_bcount(bufferSize) BYTE* alphaValues,
- UINT32 bufferSize
- ) PURE;
-
- /// <summary>
- /// Gets properties required for ClearType blending.
- /// </summary>
- /// <param name="renderingParams">Rendering parameters object. In most cases, the values returned in the output
- /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode
- /// is specified.</param>
- /// <param name="blendGamma">Receives the gamma value to use for gamma correction.</param>
- /// <param name="blendEnhancedContrast">Receives the enhanced contrast value.</param>
- /// <param name="blendClearTypeLevel">Receives the ClearType level.</param>
- STDMETHOD(GetAlphaBlendParams)(
- IDWriteRenderingParams* renderingParams,
- __out FLOAT* blendGamma,
- __out FLOAT* blendEnhancedContrast,
- __out FLOAT* blendClearTypeLevel
- ) PURE;
-};
-
-/// <summary>
-/// The root factory interface for all DWrite objects.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown
-{
- /// <summary>
- /// Gets a font collection representing the set of installed fonts.
- /// </summary>
- /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
- /// <param name="checkForUpdates">If this parameter is nonzero, the function performs an immediate check for changes to the set of
- /// installed fonts. If this parameter is FALSE, the function will still detect changes if the font cache service is running, but
- /// there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to
- /// be sure the font collection contains that font.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetSystemFontCollection)(
- __out IDWriteFontCollection** fontCollection,
- BOOL checkForUpdates = FALSE
- ) PURE;
-
- /// <summary>
- /// Creates a font collection using a custom font collection loader.
- /// </summary>
- /// <param name="collectionLoader">Application-defined font collection loader, which must have been previously
- /// registered using RegisterFontCollectionLoader.</param>
- /// <param name="collectionKey">Key used by the loader to identify a collection of font files.</param>
- /// <param name="collectionKeySize">Size in bytes of the collection key.</param>
- /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateCustomFontCollection)(
- IDWriteFontCollectionLoader* collectionLoader,
- __in_bcount(collectionKeySize) void const* collectionKey,
- UINT32 collectionKeySize,
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Registers a custom font collection loader with the factory object.
- /// </summary>
- /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(RegisterFontCollectionLoader)(
- IDWriteFontCollectionLoader* fontCollectionLoader
- ) PURE;
-
- /// <summary>
- /// Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader.
- /// </summary>
- /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(UnregisterFontCollectionLoader)(
- IDWriteFontCollectionLoader* fontCollectionLoader
- ) PURE;
-
- /// <summary>
- /// CreateFontFileReference creates a font file reference object from a local font file.
- /// </summary>
- /// <param name="filePath">Absolute file path. Subsequent operations on the constructed object may fail
- /// if the user provided filePath doesn't correspond to a valid file on the disk.</param>
- /// <param name="lastWriteTime">Last modified time of the input file path. If the parameter is omitted,
- /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value
- /// to avoid extra disk access. Subsequent operations on the constructed object may fail
- /// if the user provided lastWriteTime doesn't match the file on the disk.</param>
- /// <param name="fontFile">Contains newly created font file reference object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFileReference)(
- __in_z WCHAR const* filePath,
- __in_opt FILETIME const* lastWriteTime,
- __out IDWriteFontFile** fontFile
- ) PURE;
-
- /// <summary>
- /// CreateCustomFontFileReference creates a reference to an application specific font file resource.
- /// This function enables an application or a document to use a font without having to install it on the system.
- /// The fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
- /// during the lifetime of fontFileLoader.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="fontFileLoader">Font file loader that will be used by the font system to load data from the file identified by
- /// fontFileReferenceKey.</param>
- /// <param name="fontFile">Contains the newly created font file object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This function is provided for cases when an application or a document needs to use a font
- /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope
- /// of the fontFileLoader used in this call.
- /// </remarks>
- STDMETHOD(CreateCustomFontFileReference)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- IDWriteFontFileLoader* fontFileLoader,
- __out IDWriteFontFile** fontFile
- ) PURE;
-
- /// <summary>
- /// Creates a font face object.
- /// </summary>
- /// <param name="fontFaceType">The file format of the font face.</param>
- /// <param name="numberOfFiles">The number of font files require to represent the font face.</param>
- /// <param name="fontFiles">Font files representing the font face. Since IDWriteFontFace maintains its own references
- /// to the input font file objects, it's OK to release them after this call.</param>
- /// <param name="faceIndex">The zero based index of a font face in cases when the font files contain a collection of font faces.
- /// If the font files contain a single face, this value should be zero.</param>
- /// <param name="fontFaceSimulationFlags">Font face simulation flags for algorithmic emboldening and italicization.</param>
- /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFace)(
- DWRITE_FONT_FACE_TYPE fontFaceType,
- UINT32 numberOfFiles,
- __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles,
- UINT32 faceIndex,
- DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
- __out IDWriteFontFace** fontFace
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with default settings for the primary monitor.
- /// </summary>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateRenderingParams)(
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with default settings for the specified monitor.
- /// </summary>
- /// <param name="monitor">The monitor to read the default values from.</param>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateMonitorRenderingParams)(
- HMONITOR monitor,
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with the specified properties.
- /// </summary>
- /// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param>
- /// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
- /// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param>
- /// <param name="pixelGeometry">The geometry of a device pixel.</param>
- /// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateCustomRenderingParams)(
- FLOAT gamma,
- FLOAT enhancedContrast,
- FLOAT clearTypeLevel,
- DWRITE_PIXEL_GEOMETRY pixelGeometry,
- DWRITE_RENDERING_MODE renderingMode,
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Registers a font file loader with DirectWrite.
- /// </summary>
- /// <param name="fontFileLoader">Pointer to the implementation of the IDWriteFontFileLoader for a particular file resource type.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This function registers a font file loader with DirectWrite.
- /// Font file loader interface handles loading font file resources of a particular type from a key.
- /// The font file loader interface is recommended to be implemented by a singleton object.
- /// A given instance can only be registered once.
- /// Succeeding attempts will return an error that it has already been registered.
- /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
- /// inside their constructors and must not unregister themselves in their destructors, because
- /// registration and unregistraton operations increment and decrement the object reference count respectively.
- /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
- /// outside of the font file loader implementation as a separate step.
- /// </remarks>
- STDMETHOD(RegisterFontFileLoader)(
- IDWriteFontFileLoader* fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.
- /// </summary>
- /// <param name="fontFileLoader">Pointer to the file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.</param>
- /// <returns>
- /// This function will succeed if the user loader is requested to be removed.
- /// It will fail if the pointer to the file loader identifies a standard DirectWrite loader,
- /// or a loader that is never registered or has already been unregistered.
- /// </returns>
- /// <remarks>
- /// This function unregisters font file loader callbacks with the DirectWrite font system.
- /// The font file loader interface is recommended to be implemented by a singleton object.
- /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
- /// inside their constructors and must not unregister themselves in their destructors, because
- /// registration and unregistraton operations increment and decrement the object reference count respectively.
- /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
- /// outside of the font file loader implementation as a separate step.
- /// </remarks>
- STDMETHOD(UnregisterFontFileLoader)(
- IDWriteFontFileLoader* fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Create a text format object used for text layout.
- /// </summary>
- /// <param name="fontFamilyName">Name of the font family</param>
- /// <param name="fontCollection">Font collection. NULL indicates the system font collection.</param>
- /// <param name="fontWeight">Font weight</param>
- /// <param name="fontStyle">Font style</param>
- /// <param name="fontStretch">Font stretch</param>
- /// <param name="fontSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="localeName">Locale name</param>
- /// <param name="textFormat">Contains newly created text format object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextFormat)(
- __in_z WCHAR const* fontFamilyName,
- __maybenull IDWriteFontCollection* fontCollection,
- DWRITE_FONT_WEIGHT fontWeight,
- DWRITE_FONT_STYLE fontStyle,
- DWRITE_FONT_STRETCH fontStretch,
- FLOAT fontSize,
- __in_z WCHAR const* localeName,
- __out IDWriteTextFormat** textFormat
- ) PURE;
-
- /// <summary>
- /// Create a typography object used in conjunction with text format for text layout.
- /// </summary>
- /// <param name="typography">Contains newly created typography object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTypography)(
- __out IDWriteTypography** typography
- ) PURE;
-
- /// <summary>
- /// Create an object used for interoperability with GDI.
- /// </summary>
- /// <param name="gdiInterop">Receives the GDI interop object if successful, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGdiInterop)(
- __out IDWriteGdiInterop** gdiInterop
- ) PURE;
-
- /// <summary>
- /// CreateTextLayout takes a string, format, and associated constraints
- /// and produces and object representing the fully analyzed
- /// and formatted result.
- /// </summary>
- /// <param name="string">The string to layout.</param>
- /// <param name="stringLength">The length of the string.</param>
- /// <param name="textFormat">The format to apply to the string.</param>
- /// <param name="maxWidth">Width of the layout box.</param>
- /// <param name="maxHeight">Height of the layout box.</param>
- /// <param name="textLayout">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextLayout)(
- __in_ecount(stringLength) WCHAR const* string,
- UINT32 stringLength,
- IDWriteTextFormat* textFormat,
- FLOAT maxWidth,
- FLOAT maxHeight,
- __out IDWriteTextLayout** textLayout
- ) PURE;
-
- /// <summary>
- /// CreateGdiCompatibleTextLayout takes a string, format, and associated constraints
- /// and produces and object representing the result formatted for a particular display resolution
- /// and measuring method. The resulting text layout should only be used for the intended resolution,
- /// and for cases where text scalability is desired, CreateTextLayout should be used instead.
- /// </summary>
- /// <param name="string">The string to layout.</param>
- /// <param name="stringLength">The length of the string.</param>
- /// <param name="textFormat">The format to apply to the string.</param>
- /// <param name="layoutWidth">Width of the layout box.</param>
- /// <param name="layoutHeight">Height of the layout box.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI device then pixelsPerDip
- /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text.
- /// When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="textLayout">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateGdiCompatibleTextLayout)(
- __in_ecount(stringLength) WCHAR const* string,
- UINT32 stringLength,
- IDWriteTextFormat* textFormat,
- FLOAT layoutWidth,
- FLOAT layoutHeight,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- __out IDWriteTextLayout** textLayout
- ) PURE;
-
- /// <summary>
- /// The application may call this function to create an inline object for trimming, using an ellipsis as the omission sign.
- /// The ellipsis will be created using the current settings of the format, including base font, style, and any effects.
- /// Alternate omission signs can be created by the application by implementing IDWriteInlineObject.
- /// </summary>
- /// <param name="textFormat">Text format used as a template for the omission sign.</param>
- /// <param name="trimmingSign">Created omission sign.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateEllipsisTrimmingSign)(
- IDWriteTextFormat* textFormat,
- __out IDWriteInlineObject** trimmingSign
- ) PURE;
-
- /// <summary>
- /// Return an interface to perform text analysis with.
- /// </summary>
- /// <param name="textAnalyzer">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextAnalyzer)(
- __out IDWriteTextAnalyzer** textAnalyzer
- ) PURE;
-
- /// <summary>
- /// Creates a number substitution object using a locale name,
- /// substitution method, and whether to ignore user overrides (uses NLS
- /// defaults for the given culture instead).
- /// </summary>
- /// <param name="substitutionMethod">Method of number substitution to use.</param>
- /// <param name="localeName">Which locale to obtain the digits from.</param>
- /// <param name="ignoreUserOverride">Ignore the user's settings and use the locale defaults</param>
- /// <param name="numberSubstitution">Receives a pointer to the newly created object.</param>
- STDMETHOD(CreateNumberSubstitution)(
- __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,
- __in_z WCHAR const* localeName,
- __in BOOL ignoreUserOverride,
- __out IDWriteNumberSubstitution** numberSubstitution
- ) PURE;
-
- /// <summary>
- /// Creates a glyph run analysis object, which encapsulates information
- /// used to render a glyph run.
- /// </summary>
- /// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI bitmap then pixelsPerDip
- /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified the emSize and pixelsPerDip.</param>
- /// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
- /// and not outline).</param>
- /// <param name="measuringMode">Specifies the method to measure glyphs.</param>
- /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs.</param>
- /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
- /// <param name="glyphRunAnalysis">Receives a pointer to the newly created object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateGlyphRunAnalysis)(
- __in DWRITE_GLYPH_RUN const* glyphRun,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- DWRITE_RENDERING_MODE renderingMode,
- DWRITE_MEASURING_MODE measuringMode,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __out IDWriteGlyphRunAnalysis** glyphRunAnalysis
- ) PURE;
-
-}; // interface IDWriteFactory
-
-/// <summary>
-/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects.
-/// </summary>
-/// <param name="factoryType">Identifies whether the factory object will be shared or isolated.</param>
-/// <param name="iid">Identifies the DirectWrite factory interface, such as __uuidof(IDWriteFactory).</param>
-/// <param name="factory">Receives the DirectWrite factory object.</param>
-/// <returns>
-/// Standard HRESULT error code.
-/// </returns>
-/// <remarks>
-/// Obtains DirectWrite factory object that is used for subsequent creation of individual DirectWrite classes.
-/// DirectWrite factory contains internal state such as font loader registration and cached font data.
-/// In most cases it is recommended to use the shared factory object, because it allows multiple components
-/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
-/// However, there are cases when it is desirable to reduce the impact of a component,
-/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
-/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
-/// component.
-/// </remarks>
-EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory(
- __in DWRITE_FACTORY_TYPE factoryType,
- __in REFIID iid,
- __out IUnknown **factory
- );
-
-// Macros used to define DirectWrite error codes.
-#define FACILITY_DWRITE 0x898
-#define DWRITE_ERR_BASE 0x5000
-#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))
-#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
-
-/// <summary>
-/// Indicates an error in an input file such as a font file.
-/// </summary>
-#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
-
-/// <summary>
-/// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from.
-/// </summary>
-#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
-
-/// <summary>
-/// Indicates the specified font does not exist.
-/// </summary>
-#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
-
-/// <summary>
-/// A font file could not be opened because the file, directory, network location, drive, or other storage
-/// location does not exist or is unavailable.
-/// </summary>
-#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
-
-/// <summary>
-/// A font file exists but could not be opened due to access denied, sharing violation, or similar error.
-/// </summary>
-#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
-
-/// <summary>
-/// A font collection is obsolete due to changes in the system.
-/// </summary>
-#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
-
-/// <summary>
-/// The given interface is already registered.
-/// </summary>
-#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
-
-#endif /* DWRITE_H_INCLUDED */
diff --git a/3rdparty/dxsdk/Include/DXGIType.h b/3rdparty/dxsdk/Include/DXGIType.h
deleted file mode 100644
index 89dd86a3122..00000000000
--- a/3rdparty/dxsdk/Include/DXGIType.h
+++ /dev/null
@@ -1,123 +0,0 @@
-
-#ifndef __dxgitype_h__
-#define __dxgitype_h__
-
-
-#include "dxgiformat.h"
-
-#define _FACDXGI 0x87a
-#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
-#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
-
-#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)
-#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)
-#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)
-#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)
-#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)
-#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)
-#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)
-
-
-#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
-#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)
-#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)
-#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)
-#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)
-#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)
-#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)
-#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)
-#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)
-#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)
-#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)
-#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)
-#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)
-#define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35)
-#define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36)
-
-
-
-#define DXGI_CPU_ACCESS_NONE ( 0 )
-#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
-#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
-#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
-#define DXGI_CPU_ACCESS_FIELD 15
-
-#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
-#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
-#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
-#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
-#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) )
-#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) )
-#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) )
-
-typedef struct DXGI_RGB
-{
- float Red;
- float Green;
- float Blue;
-} DXGI_RGB;
-
-typedef struct DXGI_GAMMA_CONTROL
-{
- DXGI_RGB Scale;
- DXGI_RGB Offset;
- DXGI_RGB GammaCurve[ 1025 ];
-} DXGI_GAMMA_CONTROL;
-
-typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
-{
- BOOL ScaleAndOffsetSupported;
- float MaxConvertedValue;
- float MinConvertedValue;
- UINT NumGammaControlPoints;
- float ControlPointPositions[1025];
-} DXGI_GAMMA_CONTROL_CAPABILITIES;
-
-typedef struct DXGI_RATIONAL
-{
- UINT Numerator;
- UINT Denominator;
-} DXGI_RATIONAL;
-
-typedef enum DXGI_MODE_SCANLINE_ORDER
-{
- DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
- DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
- DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
- DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
-} DXGI_MODE_SCANLINE_ORDER;
-
-typedef enum DXGI_MODE_SCALING
-{
- DXGI_MODE_SCALING_UNSPECIFIED = 0,
- DXGI_MODE_SCALING_CENTERED = 1,
- DXGI_MODE_SCALING_STRETCHED = 2
-} DXGI_MODE_SCALING;
-
-typedef enum DXGI_MODE_ROTATION
-{
- DXGI_MODE_ROTATION_UNSPECIFIED = 0,
- DXGI_MODE_ROTATION_IDENTITY = 1,
- DXGI_MODE_ROTATION_ROTATE90 = 2,
- DXGI_MODE_ROTATION_ROTATE180 = 3,
- DXGI_MODE_ROTATION_ROTATE270 = 4
-} DXGI_MODE_ROTATION;
-
-typedef struct DXGI_MODE_DESC
-{
- UINT Width;
- UINT Height;
- DXGI_RATIONAL RefreshRate;
- DXGI_FORMAT Format;
- DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
- DXGI_MODE_SCALING Scaling;
-} DXGI_MODE_DESC;
-
-typedef struct DXGI_SAMPLE_DESC
-{
- UINT Count;
- UINT Quality;
-} DXGI_SAMPLE_DESC;
-
-#endif // __dxgitype_h__
-
diff --git a/3rdparty/dxsdk/Include/Dcommon.h b/3rdparty/dxsdk/Include/Dcommon.h
deleted file mode 100644
index 4ecc5c174ba..00000000000
--- a/3rdparty/dxsdk/Include/Dcommon.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//+--------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Abstract:
-// Public API definitions for DWrite and D2D
-//
-//----------------------------------------------------------------------------
-
-#ifndef DCOMMON_H_INCLUDED
-#define DCOMMON_H_INCLUDED
-
-//
-//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview,
-//they are included here temporarily.
-//
-#ifndef DEFINE_ENUM_FLAG_OPERATORS
-#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
-extern "C++" { \
-inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \
-inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
-inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \
-inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
-inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \
-inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \
-inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
-}
-#endif
-
-#ifndef __field_ecount_opt
-#define __field_ecount_opt(x)
-#endif
-
-#ifndef __range
-#define __range(x,y)
-#endif
-
-#ifndef __field_ecount
-#define __field_ecount(x)
-#endif
-
-/// <summary>
-/// The measuring method used for text layout.
-/// </summary>
-typedef enum DWRITE_MEASURING_MODE
-{
- /// <summary>
- /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
- /// </summary>
- DWRITE_MEASURING_MODE_NATURAL,
-
- /// <summary>
- /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
- /// </summary>
- DWRITE_MEASURING_MODE_GDI_CLASSIC,
-
- /// <summary>
- /// Text is measured using the same glyph display metrics as text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </summary>
- DWRITE_MEASURING_MODE_GDI_NATURAL
-
-} DWRITE_MEASURING_MODE;
-
-#endif /* DCOMMON_H_INCLUDED */
diff --git a/3rdparty/dxsdk/Include/DxErr.h b/3rdparty/dxsdk/Include/DxErr.h
deleted file mode 100644
index 2bd75911973..00000000000
--- a/3rdparty/dxsdk/Include/DxErr.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxerr.h
- * Content: DirectX Error Library Include File
- *
- ****************************************************************************/
-
-#ifndef _DXERR_H_
-#define _DXERR_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-//
-// DXGetErrorString
-//
-// Desc: Converts a DirectX HRESULT to a string
-//
-// Args: HRESULT hr Can be any error code from
-// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
-//
-// Return: Converted string
-//
-const char* WINAPI DXGetErrorStringA(__in HRESULT hr);
-const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr);
-
-#ifdef UNICODE
-#define DXGetErrorString DXGetErrorStringW
-#else
-#define DXGetErrorString DXGetErrorStringA
-#endif
-
-
-//
-// DXGetErrorDescription
-//
-// Desc: Returns a string description of a DirectX HRESULT
-//
-// Args: HRESULT hr Can be any error code from
-// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
-//
-// Return: String description
-//
-const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr);
-const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr);
-
-#ifdef UNICODE
- #define DXGetErrorDescription DXGetErrorDescriptionW
-#else
- #define DXGetErrorDescription DXGetErrorDescriptionA
-#endif
-
-
-//
-// DXTrace
-//
-// Desc: Outputs a formatted error message to the debug stream
-//
-// Args: CHAR* strFile The current file, typically passed in using the
-// __FILE__ macro.
-// DWORD dwLine The current line number, typically passed in using the
-// __LINE__ macro.
-// HRESULT hr An HRESULT that will be traced to the debug stream.
-// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
-// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
-//
-// Return: The hr that was passed in.
-//
-HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox );
-HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox );
-
-#ifdef UNICODE
-#define DXTrace DXTraceW
-#else
-#define DXTrace DXTraceA
-#endif
-
-
-//
-// Helper macros
-//
-#if defined(DEBUG) | defined(_DEBUG)
-#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
-#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
-#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
-#else
-#define DXTRACE_MSG(str) (0L)
-#define DXTRACE_ERR(str,hr) (hr)
-#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif // _DXERR_H_
diff --git a/3rdparty/dxsdk/Include/PIXPlugin.h b/3rdparty/dxsdk/Include/PIXPlugin.h
deleted file mode 100644
index 9c249afc0a3..00000000000
--- a/3rdparty/dxsdk/Include/PIXPlugin.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//==================================================================================================
-// PIXPlugin.h
-//
-// Microsoft PIX Plugin Header
-//
-// Copyright (c) Microsoft Corporation, All rights reserved
-//==================================================================================================
-
-#pragma once
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-//==================================================================================================
-// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with.
-//==================================================================================================
-#define PIX_PLUGIN_SYSTEM_VERSION 0x101
-
-
-//==================================================================================================
-// PIXCOUNTERID - A unique identifier for each PIX plugin counter.
-//==================================================================================================
-typedef int PIXCOUNTERID;
-
-
-//==================================================================================================
-// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces.
-//==================================================================================================
-enum PIXCOUNTERDATATYPE
-{
- PCDT_RESERVED,
- PCDT_FLOAT,
- PCDT_INT,
- PCDT_INT64,
- PCDT_STRING,
-};
-
-
-//==================================================================================================
-// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX.
-//==================================================================================================
-struct PIXPLUGININFO
-{
- // Filled in by caller:
- HINSTANCE hinst;
-
- // Filled in by PIXGetPluginInfo:
- WCHAR* pstrPluginName; // Name of plugin
- int iPluginVersion; // Version of this particular plugin
- int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for
-};
-
-
-//==================================================================================================
-// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX
-// to allow PIX to determine information about the counters in the plugin.
-//==================================================================================================
-struct PIXCOUNTERINFO
-{
- PIXCOUNTERID counterID; // Used to uniquely ID this counter
- WCHAR* pstrName; // String name of the counter
- PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter
-};
-
-
-//==================================================================================================
-// PIXGetPluginInfo - This returns basic information about this plugin to PIX.
-//==================================================================================================
-BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo );
-
-
-//==================================================================================================
-// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX.
-// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained
-// in this plugin.
-//==================================================================================================
-BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList );
-
-
-//==================================================================================================
-// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter.
-//==================================================================================================
-BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc );
-
-
-//==================================================================================================
-// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts.
-//==================================================================================================
-BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication );
-
-
-//==================================================================================================
-// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the
-// counter value for that frame. Note that the pointer to the return data must
-// continue to point to valid counter data until the next call to PIXEndFrame (or
-// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same
-// pointer for multiple counters, or point to a local variable that will go out of
-// scope. See the sample PIX plugin for an example of how to structure a plugin
-// properly.
-//==================================================================================================
-BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData );
-
-
-//==================================================================================================
-// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends.
-//==================================================================================================
-BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id );
-
-
-#ifdef __cplusplus
-};
-#endif
-
-//==================================================================================================
-// eof: PIXPlugin.h
-//==================================================================================================
-
diff --git a/3rdparty/dxsdk/Include/X3DAudio.h b/3rdparty/dxsdk/Include/X3DAudio.h
deleted file mode 100644
index c25d98f40ea..00000000000
--- a/3rdparty/dxsdk/Include/X3DAudio.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/*-========================================================================-_
- | - X3DAUDIO - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |PROJECT: X3DAudio MODEL: Unmanaged User-mode |
- |VERSION: 1.7 EXCEPT: No Exceptions |
- |CLASS: N / A MINREQ: WinXP, Xbox360 |
- |BASE: N / A DIALECT: MSC++ 14.00 |
- |>------------------------------------------------------------------------<|
- | DUTY: Cross-platform stand-alone 3D audio math library |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS!
- Here's how:
- Copy X3DAudioDX_X.dll to where your application exists.
- The debug DLL can be found under %WINDIR%\system32.
- Rename X3DAudioDX_X.dll to X3DAudioX_X.dll to use the debug version.
-
- Only parameters required by DSP settings being calculated as
- stipulated by the calculation control flags are validated.
-
- 2. Definition of terms:
- LFE: Low Frequency Effect -- always omnidirectional.
- LPF: Low Pass Filter, divided into two classifications:
- Direct -- Applied to the direct signal path,
- used for obstruction/occlusion effects.
- Reverb -- Applied to the reverb signal path,
- used for occlusion effects only.
-
- 3. Volume level is expressed as a linear amplitude scaler:
- 1.0f represents no attenuation applied to the original signal,
- 0.5f denotes an attenuation of 6dB, and 0.0f results in silence.
- Amplification (volume > 1.0f) is also allowed, and is not clamped.
-
- LPF values range from 1.0f representing all frequencies pass through,
- to 0.0f which results in silence as all frequencies are filtered out.
-
- 4. X3DAudio uses a left-handed Cartesian coordinate system with values
- on the x-axis increasing from left to right, on the y-axis from
- bottom to top, and on the z-axis from near to far.
- Azimuths are measured clockwise from a given reference direction.
-
- Distance measurement is with respect to user-defined world units.
- Applications may provide coordinates using any system of measure
- as all non-normalized calculations are scale invariant, with such
- operations natively occurring in user-defined world unit space.
- Metric constants are supplied only as a convenience.
- Distance is calculated using the Euclidean norm formula.
-
- 5. Only real values are permissible with functions using 32-bit
- float parameters -- NAN and infinite values are not accepted.
- All computation occurs in 32-bit precision mode. */
-
-#pragma once
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
-#include <windef.h> // general windows types
-#if defined(_XBOX)
- #include <vectorintrinsics.h>
-#endif
-#include <d3d9types.h> // for D3DVECTOR
-
-// speaker geometry configuration flags, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask
-#if !defined(_SPEAKER_POSITIONS_)
- #define _SPEAKER_POSITIONS_
- #define SPEAKER_FRONT_LEFT 0x00000001
- #define SPEAKER_FRONT_RIGHT 0x00000002
- #define SPEAKER_FRONT_CENTER 0x00000004
- #define SPEAKER_LOW_FREQUENCY 0x00000008
- #define SPEAKER_BACK_LEFT 0x00000010
- #define SPEAKER_BACK_RIGHT 0x00000020
- #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
- #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
- #define SPEAKER_BACK_CENTER 0x00000100
- #define SPEAKER_SIDE_LEFT 0x00000200
- #define SPEAKER_SIDE_RIGHT 0x00000400
- #define SPEAKER_TOP_CENTER 0x00000800
- #define SPEAKER_TOP_FRONT_LEFT 0x00001000
- #define SPEAKER_TOP_FRONT_CENTER 0x00002000
- #define SPEAKER_TOP_FRONT_RIGHT 0x00004000
- #define SPEAKER_TOP_BACK_LEFT 0x00008000
- #define SPEAKER_TOP_BACK_CENTER 0x00010000
- #define SPEAKER_TOP_BACK_RIGHT 0x00020000
- #define SPEAKER_RESERVED 0x7FFC0000 // bit mask locations reserved for future use
- #define SPEAKER_ALL 0x80000000 // used to specify that any possible permutation of speaker configurations
-#endif
-
-// standard speaker geometry configurations, used with X3DAudioInitialize
-#if !defined(SPEAKER_MONO)
- #define SPEAKER_MONO SPEAKER_FRONT_CENTER
- #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
- #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
- #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
- #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
- #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
- #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
-#endif
-
-// Xbox360 speaker geometry configuration, used with X3DAudioInitialize
-#if defined(_XBOX)
- #define SPEAKER_XBOX SPEAKER_5POINT1
-#endif
-
-
-// size of instance handle in bytes
-#define X3DAUDIO_HANDLE_BYTESIZE 20
-
-// float math constants
-#define X3DAUDIO_PI 3.141592654f
-#define X3DAUDIO_2PI 6.283185307f
-
-// speed of sound in meters per second for dry air at approximately 20C, used with X3DAudioInitialize
-#define X3DAUDIO_SPEED_OF_SOUND 343.5f
-
-// calculation control flags, used with X3DAudioCalculate
-#define X3DAUDIO_CALCULATE_MATRIX 0x00000001 // enable matrix coefficient table calculation
-#define X3DAUDIO_CALCULATE_DELAY 0x00000002 // enable delay time array calculation (stereo final mix only)
-#define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 // enable LPF direct-path coefficient calculation
-#define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 // enable LPF reverb-path coefficient calculation
-#define X3DAUDIO_CALCULATE_REVERB 0x00000010 // enable reverb send level calculation
-#define X3DAUDIO_CALCULATE_DOPPLER 0x00000020 // enable doppler shift factor calculation
-#define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 // enable emitter-to-listener interior angle calculation
-
-#define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 // do not position to front center speaker, signal positioned to remaining speakers instead, front center destination channel will be zero in returned matrix coefficient table, valid only for matrix calculations with final mix formats that have a front center channel
-#define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 // apply equal mix of all source channels to LFE destination channel, valid only for matrix calculations with sources that have no LFE channel and final mix formats that have an LFE channel
-
-
-//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
-#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
-
-
-// primitive types
-typedef float FLOAT32; // 32-bit IEEE float
-typedef D3DVECTOR X3DAUDIO_VECTOR; // float 3D vector
-
-// instance handle of precalculated constants
-typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE];
-
-
-// Distance curve point:
-// Defines a DSP setting at a given normalized distance.
-typedef struct X3DAUDIO_DISTANCE_CURVE_POINT
-{
- FLOAT32 Distance; // normalized distance, must be within [0.0f, 1.0f]
- FLOAT32 DSPSetting; // DSP setting
-} X3DAUDIO_DISTANCE_CURVE_POINT, *LPX3DAUDIO_DISTANCE_CURVE_POINT;
-
-// Distance curve:
-// A piecewise curve made up of linear segments used to
-// define DSP behaviour with respect to normalized distance.
-//
-// Note that curve point distances are normalized within [0.0f, 1.0f].
-// X3DAUDIO_EMITTER.CurveDistanceScaler must be used to scale the
-// normalized distances to user-defined world units.
-// For distances beyond CurveDistanceScaler * 1.0f,
-// pPoints[PointCount-1].DSPSetting is used as the DSP setting.
-//
-// All distance curve spans must be such that:
-// pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values
-// For all points in the distance curve where 1 <= k < PointCount.
-typedef struct X3DAUDIO_DISTANCE_CURVE
-{
- X3DAUDIO_DISTANCE_CURVE_POINT* pPoints; // distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance
- UINT32 PointCount; // number of distance curve points, must be >= 2 as all distance curves must have at least two endpoints, defining DSP settings at 0.0f and 1.0f normalized distance
-} X3DAUDIO_DISTANCE_CURVE, *LPX3DAUDIO_DISTANCE_CURVE;
-static const X3DAUDIO_DISTANCE_CURVE_POINT X3DAudioDefault_LinearCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 0.0f };
-static const X3DAUDIO_DISTANCE_CURVE X3DAudioDefault_LinearCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&X3DAudioDefault_LinearCurvePoints[0], 2 };
-
-// Cone:
-// Specifies directionality for a listener or single-channel emitter by
-// modifying DSP behaviour with respect to its front orientation.
-// This is modeled using two sound cones: an inner cone and an outer cone.
-// On/within the inner cone, DSP settings are scaled by the inner values.
-// On/beyond the outer cone, DSP settings are scaled by the outer values.
-// If on both the cones, DSP settings are scaled by the inner values only.
-// Between the two cones, the scaler is linearly interpolated between the
-// inner and outer values. Set both cone angles to 0 or X3DAUDIO_2PI for
-// omnidirectionality using only the outer or inner values respectively.
-typedef struct X3DAUDIO_CONE
-{
- FLOAT32 InnerAngle; // inner cone angle in radians, must be within [0.0f, X3DAUDIO_2PI]
- FLOAT32 OuterAngle; // outer cone angle in radians, must be within [InnerAngle, X3DAUDIO_2PI]
-
- FLOAT32 InnerVolume; // volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
- FLOAT32 OuterVolume; // volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
- FLOAT32 InnerLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
- FLOAT32 OuterLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
- FLOAT32 InnerReverb; // reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
- FLOAT32 OuterReverb; // reverb send level scaler on/beyond outer cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
-} X3DAUDIO_CONE, *LPX3DAUDIO_CONE;
-static const X3DAUDIO_CONE X3DAudioDefault_DirectionalCone = { X3DAUDIO_PI/2, X3DAUDIO_PI, 1.0f, 0.708f, 0.0f, 0.25f, 0.708f, 1.0f };
-
-
-// Listener:
-// Defines a point of 3D audio reception.
-//
-// The cone is directed by the listener's front orientation.
-typedef struct X3DAUDIO_LISTENER
-{
- X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for matrix and delay calculations or listeners with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
- X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used
-
- X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
- X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
-
- X3DAUDIO_CONE* pCone; // sound cone, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality
-} X3DAUDIO_LISTENER, *LPX3DAUDIO_LISTENER;
-
-// Emitter:
-// Defines a 3D audio source, divided into two classifications:
-//
-// Single-point -- For use with single-channel sounds.
-// Positioned at the emitter base, i.e. the channel radius
-// and azimuth are ignored if the number of channels == 1.
-//
-// May be omnidirectional or directional using a cone.
-// The cone originates from the emitter base position,
-// and is directed by the emitter's front orientation.
-//
-// Multi-point -- For use with multi-channel sounds.
-// Each non-LFE channel is positioned using an
-// azimuth along the channel radius with respect to the
-// front orientation vector in the plane orthogonal to the
-// top orientation vector. An azimuth of X3DAUDIO_2PI
-// specifies a channel is an LFE. Such channels are
-// positioned at the emitter base and are calculated
-// with respect to pLFECurve only, never pVolumeCurve.
-//
-// Multi-point emitters are always omnidirectional,
-// i.e. the cone is ignored if the number of channels > 1.
-//
-// Note that many properties are shared among all channel points,
-// locking certain behaviour with respect to the emitter base position.
-// For example, doppler shift is always calculated with respect to the
-// emitter base position and so is constant for all its channel points.
-// Distance curve calculations are also with respect to the emitter base
-// position, with the curves being calculated independently of each other.
-// For instance, volume and LFE calculations do not affect one another.
-typedef struct X3DAUDIO_EMITTER
-{
- X3DAUDIO_CONE* pCone; // sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality
- X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
- X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used
-
- X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
- X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
-
- FLOAT32 InnerRadius; // inner radius, must be within [0.0f, FLT_MAX]
- FLOAT32 InnerRadiusAngle; // inner radius angle, must be within [0.0f, X3DAUDIO_PI/4.0)
-
- UINT32 ChannelCount; // number of sound channels, must be > 0
- FLOAT32 ChannelRadius; // channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0f when used
- FLOAT32* pChannelAzimuths; // channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or X3DAUDIO_2PI to specify an LFE channel, must have at least ChannelCount elements, all within [0.0f, X3DAUDIO_2PI] when used
-
- X3DAUDIO_DISTANCE_CURVE* pVolumeCurve; // volume level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
- X3DAUDIO_DISTANCE_CURVE* pLFECurve; // LFE level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
- X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve; // LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.75f]
- X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve; // LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, NULL specifies the default curve: [0.0f,0.75f], [1.0f,0.75f]
- X3DAUDIO_DISTANCE_CURVE* pReverbCurve; // reverb send level distance curve, used only for reverb calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f]
-
- FLOAT32 CurveDistanceScaler; // curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, must be within [FLT_MIN, FLT_MAX] when used
- FLOAT32 DopplerScaler; // doppler shift scaler, used to exaggerate doppler shift effect, used only for doppler calculations, must be within [0.0f, FLT_MAX] when used
-} X3DAUDIO_EMITTER, *LPX3DAUDIO_EMITTER;
-
-
-// DSP settings:
-// Receives results from a call to X3DAudioCalculate to be sent
-// to the low-level audio rendering API for 3D signal processing.
-//
-// The user is responsible for allocating the matrix coefficient table,
-// delay time array, and initializing the channel counts when used.
-typedef struct X3DAUDIO_DSP_SETTINGS
-{
- FLOAT32* pMatrixCoefficients; // [inout] matrix coefficient table, receives an array representing the volume level used to send from source channel S to destination channel D, stored as pMatrixCoefficients[SrcChannelCount * D + S], must have at least SrcChannelCount*DstChannelCount elements
- FLOAT32* pDelayTimes; // [inout] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only)
- UINT32 SrcChannelCount; // [in] number of source channels, must equal number of channels in respective emitter
- UINT32 DstChannelCount; // [in] number of destination channels, must equal number of channels of the final mix
-
- FLOAT32 LPFDirectCoefficient; // [out] LPF direct-path coefficient
- FLOAT32 LPFReverbCoefficient; // [out] LPF reverb-path coefficient
- FLOAT32 ReverbLevel; // [out] reverb send level
- FLOAT32 DopplerFactor; // [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency
- FLOAT32 EmitterToListenerAngle; // [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation
-
- FLOAT32 EmitterToListenerDistance; // [out] distance in user-defined world units from the emitter base to listener position, always calculated
- FLOAT32 EmitterVelocityComponent; // [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
- FLOAT32 ListenerVelocityComponent; // [out] component of listener velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
-} X3DAUDIO_DSP_SETTINGS, *LPX3DAUDIO_DSP_SETTINGS;
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
-// function storage-class attribute and calltype
-#if defined(_XBOX) || defined(X3DAUDIOSTATIC)
- #define X3DAUDIO_API_(type) EXTERN_C type STDAPIVCALLTYPE
-#else
- #if defined(X3DEXPORT)
- #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE
- #else
- #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE
- #endif
-#endif
-#define X3DAUDIO_IMP_(type) type STDMETHODVCALLTYPE
-
-
-//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
-// initializes instance handle
-X3DAUDIO_API_(void) X3DAudioInitialize (UINT32 SpeakerChannelMask, FLOAT32 SpeedOfSound, __out X3DAUDIO_HANDLE Instance);
-
-// calculates DSP settings with respect to 3D parameters
-X3DAUDIO_API_(void) X3DAudioCalculate (__in const X3DAUDIO_HANDLE Instance, __in const X3DAUDIO_LISTENER* pListener, __in const X3DAUDIO_EMITTER* pEmitter, UINT32 Flags, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings);
-
-
-#pragma pack(pop) // revert packing alignment
-//---------------------------------<-EOF->----------------------------------//
diff --git a/3rdparty/dxsdk/Include/XAPO.h b/3rdparty/dxsdk/Include/XAPO.h
deleted file mode 100644
index 17947d69097..00000000000
--- a/3rdparty/dxsdk/Include/XAPO.h
+++ /dev/null
@@ -1,645 +0,0 @@
-/*-========================================================================-_
- | - XAPO - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |PROJECT: XAPO MODEL: Unmanaged User-mode |
- |VERSION: 1.0 EXCEPT: No Exceptions |
- |CLASS: N / A MINREQ: WinXP, Xbox360 |
- |BASE: N / A DIALECT: MSC++ 14.00 |
- |>------------------------------------------------------------------------<|
- | DUTY: Cross-platform Audio Processing Object interfaces |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. Definition of terms:
- DSP: Digital Signal Processing.
-
- CBR: Constant BitRate -- DSP that consumes a constant number of
- input samples to produce an output sample.
- For example, a 22kHz to 44kHz resampler is CBR DSP.
- Even though the number of input to output samples differ,
- the ratio between input to output rate remains constant.
- All user-defined XAPOs are assumed to be CBR as
- XAudio2 only allows CBR DSP to be added to an effect chain.
-
- XAPO: Cross-platform Audio Processing Object --
- a thin wrapper that manages DSP code, allowing it
- to be easily plugged into an XAudio2 effect chain.
-
- Frame: A block of samples, one per channel,
- to be played simultaneously.
-
- In-Place: Processing such that the input buffer equals the
- output buffer (i.e. input data modified directly).
- This form of processing is generally more efficient
- than using separate memory for input and output.
- However, an XAPO may not perform format conversion
- when processing in-place.
-
- 2. XAPO member variables are divided into three classifications:
- Immutable: Set once via IXAPO::Initialize and remain
- constant during the lifespan of the XAPO.
-
- Locked: May change before the XAPO is locked via
- IXAPO::LockForProcess but remain constant
- until IXAPO::UnlockForProcess is called.
-
- Dynamic: May change from one processing pass to the next,
- usually via IXAPOParameters::SetParameters.
- XAPOs should assign reasonable defaults to their dynamic
- variables during IXAPO::Initialize/LockForProcess so
- that calling IXAPOParameters::SetParameters is not
- required before processing begins.
-
- When implementing an XAPO, determine the type of each variable and
- initialize them in the appropriate method. Immutable variables are
- generally preferable over locked which are preferable over dynamic.
- That is, one should strive to minimize XAPO state changes for
- best performance, maintainability, and ease of use.
-
- 3. To minimize glitches, the realtime audio processing thread must
- not block. XAPO methods called by the realtime thread are commented
- as non-blocking and therefore should not use blocking synchronization,
- allocate memory, access the disk, etc. The XAPO interfaces were
- designed to allow an effect implementer to move such operations
- into other methods called on an application controlled thread.
-
- 4. Extending functionality is accomplished through the addition of new
- COM interfaces. For example, if a new member is added to a parameter
- structure, a new interface using the new structure should be added,
- leaving the original interface unchanged.
- This ensures consistent communication between future versions of
- XAudio2 and various versions of XAPOs that may exist in an application.
-
- 5. All audio data is interleaved in XAudio2.
- The default audio format for an effect chain is WAVE_FORMAT_IEEE_FLOAT.
-
- 6. User-defined XAPOs should assume all input and output buffers are
- 16-byte aligned.
-
- 7. See XAPOBase.h for an XAPO base class which provides a default
- implementation for most of the interface methods defined below. */
-
-#pragma once
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
-#include "comdecl.h" // for DEFINE_IID
-
-// XAPO interface IDs
-DEFINE_IID(IXAPO, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 00);
-DEFINE_IID(IXAPOParameters, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 01);
-
-
-#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
- #if defined(_XBOX) // general windows and COM declarations
- #include <xtl.h>
- #include <xobjbase.h>
- #else
- #include <windows.h>
- #include <objbase.h>
- #endif
- #include "audiodefs.h" // for WAVEFORMATEX etc.
-
- // XAPO error codes
- #define FACILITY_XAPO 0x897
- #define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAPO, 0x01) // requested audio format unsupported
-
- // supported number of channels (samples per frame) range
- #define XAPO_MIN_CHANNELS 1
- #define XAPO_MAX_CHANNELS 64
-
- // supported framerate range
- #define XAPO_MIN_FRAMERATE 1000
- #define XAPO_MAX_FRAMERATE 200000
-
- // unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES
- #define XAPO_REGISTRATION_STRING_LENGTH 256
-
-
- // XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags:
- // Number of channels of input and output buffers must match,
- // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
- #define XAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001
-
- // Framerate of input and output buffers must match,
- // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
- #define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002
-
- // Bit depth of input and output buffers must match,
- // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
- // Container size of input and output buffers must also match if
- // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat is WAVEFORMATEXTENSIBLE.
- #define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004
-
- // Number of input and output buffers must match,
- // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.
- //
- // Also, XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount must
- // equal XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount and
- // XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount must equal
- // XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount when used.
- #define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008
-
- // XAPO must be run in-place. Use this flag only if your DSP
- // implementation cannot process separate input and output buffers.
- // If set, the following flags must also be set:
- // XAPO_FLAG_CHANNELS_MUST_MATCH
- // XAPO_FLAG_FRAMERATE_MUST_MATCH
- // XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH
- // XAPO_FLAG_BUFFERCOUNT_MUST_MATCH
- // XAPO_FLAG_INPLACE_SUPPORTED
- //
- // Multiple input and output buffers may be used with in-place XAPOs,
- // though the input buffer count must equal the output buffer count.
- // When multiple input/output buffers are used, the XAPO may assume
- // input buffer [N] equals output buffer [N] for in-place processing.
- #define XAPO_FLAG_INPLACE_REQUIRED 0x00000020
-
- // XAPO may be run in-place. If the XAPO is used in a chain
- // such that the requirements for XAPO_FLAG_INPLACE_REQUIRED are met,
- // XAudio2 will ensure the XAPO is run in-place. If not met, XAudio2
- // will still run the XAPO albeit with separate input and output buffers.
- //
- // For example, consider an effect which may be ran in stereo->5.1 mode or
- // mono->mono mode. When set to stereo->5.1, it will be run with separate
- // input and output buffers as format conversion is not permitted in-place.
- // However, if configured to run mono->mono, the same XAPO can be run
- // in-place. Thus the same implementation may be conveniently reused
- // for various input/output configurations, while taking advantage of
- // in-place processing when possible.
- #define XAPO_FLAG_INPLACE_SUPPORTED 0x00000010
-
-
-//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
- #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
-
-
- // XAPO registration properties, describes general XAPO characteristics, used with IXAPO::GetRegistrationProperties
- typedef struct XAPO_REGISTRATION_PROPERTIES {
- CLSID clsid; // COM class ID, used with CoCreate
- WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; // friendly name unicode string
- WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; // copyright information unicode string
- UINT32 MajorVersion; // major version
- UINT32 MinorVersion; // minor version
- UINT32 Flags; // XAPO property flags, describes supported input/output configuration
- UINT32 MinInputBufferCount; // minimum number of input buffers required for processing, can be 0
- UINT32 MaxInputBufferCount; // maximum number of input buffers supported for processing, must be >= MinInputBufferCount
- UINT32 MinOutputBufferCount; // minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
- UINT32 MaxOutputBufferCount; // maximum number of output buffers supported for processing, must be >= MinOutputBufferCount, must match MaxInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
- } XAPO_REGISTRATION_PROPERTIES;
-
-
- // LockForProcess buffer parameters:
- // Defines buffer parameters that remain constant while an XAPO is locked.
- // Used with IXAPO::LockForProcess.
- //
- // For CBR XAPOs, MaxFrameCount is the only number of frames
- // IXAPO::Process would have to handle for the respective buffer.
- typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS {
- const WAVEFORMATEX* pFormat; // buffer audio format
- UINT32 MaxFrameCount; // maximum number of frames in respective buffer that IXAPO::Process would have to handle, irrespective of dynamic variable settings, can be 0
- } XAPO_LOCKFORPROCESS_PARAMETERS;
-
- // Buffer flags:
- // Describes assumed content of the respective buffer.
- // Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags.
- //
- // This meta-data can be used by an XAPO to implement
- // optimizations that require knowledge of a buffer's content.
- //
- // For example, XAPOs that always produce silent output from silent input
- // can check the flag on the input buffer to determine if any signal
- // processing is necessary. If silent, the XAPO may simply set the flag
- // on the output buffer to silent and return, optimizing out the work of
- // processing silent data: XAPOs that generate silence for any reason may
- // set the buffer's flag accordingly rather than writing out silent
- // frames to the buffer itself.
- //
- // The flags represent what should be assumed is in the respective buffer.
- // The flags may not reflect what is actually stored in memory.
- typedef enum XAPO_BUFFER_FLAGS {
- XAPO_BUFFER_SILENT, // silent data should be assumed, respective memory may be uninitialized
- XAPO_BUFFER_VALID, // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized
- } XAPO_BUFFER_FLAGS;
-
- // Process buffer parameters:
- // Defines buffer parameters that may change from one
- // processing pass to the next. Used with IXAPO::Process.
- //
- // Note the byte size of the respective buffer must be at least:
- // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat->nBlockAlign
- //
- // Although the audio format and maximum size of the respective
- // buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS),
- // the actual memory address of the buffer given is permitted to change
- // from one processing pass to the next.
- //
- // For CBR XAPOs, ValidFrameCount is constant while locked and equals
- // the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount.
- typedef struct XAPO_PROCESS_BUFFER_PARAMETERS {
- void* pBuffer; // audio data buffer, must be non-NULL
- XAPO_BUFFER_FLAGS BufferFlags; // describes assumed content of pBuffer, does not affect ValidFrameCount
- UINT32 ValidFrameCount; // number of frames of valid data, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs, does not affect BufferFlags
- } XAPO_PROCESS_BUFFER_PARAMETERS;
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
- // Memory allocation macros that allow one module to allocate memory and
- // another to free it, by guaranteeing that the same heap manager is used
- // regardless of differences between build environments of the two modules.
- //
- // Used by IXAPO methods that must allocate arbitrary sized structures
- // such as WAVEFORMATEX that are subsequently returned to the application.
- #if defined(_XBOX)
- #define XAPO_ALLOC_ATTRIBUTES MAKE_XALLOC_ATTRIBUTES ( \
- 0, /* ObjectType */ \
- FALSE, /* HeapTracksAttributes */ \
- FALSE, /* MustSucceed */ \
- FALSE, /* FixedSize */ \
- eXALLOCAllocatorId_XAUDIO2, /* AllocatorId */ \
- XALLOC_ALIGNMENT_DEFAULT, /* Alignment */ \
- XALLOC_MEMPROTECT_READWRITE, /* MemoryProtect */ \
- FALSE, /* ZeroInitialize */ \
- XALLOC_MEMTYPE_HEAP /* MemoryType */ \
- )
- #define XAPOAlloc(size) XMemAlloc(size, XAPO_ALLOC_ATTRIBUTES)
- #define XAPOFree(p) XMemFree(p, XAPO_ALLOC_ATTRIBUTES)
- #else
- #define XAPOAlloc(size) CoTaskMemAlloc(size)
- #define XAPOFree(p) CoTaskMemFree(p)
- #endif
-
-
-//--------------<I-N-T-E-R-F-A-C-E-S>---------------------------------------//
- // IXAPO:
- // The only mandatory XAPO COM interface -- a thin wrapper that manages
- // DSP code, allowing it to be easily plugged into an XAudio2 effect chain.
- #undef INTERFACE
- #define INTERFACE IXAPO
- DECLARE_INTERFACE_(IXAPO, IUnknown) {
- ////
- // DESCRIPTION:
- // Allocates a copy of the registration properties of the XAPO.
- //
- // PARAMETERS:
- // ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure
- //
- // RETURN VALUE:
- // COM error code
- ////
- STDMETHOD(GetRegistrationProperties) (THIS_ __deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) PURE;
-
- ////
- // DESCRIPTION:
- // Queries if an input/output configuration is supported.
- //
- // REMARKS:
- // This method allows XAPOs to express dependency of input format
- // with respect to output format.
- //
- // If the input/output format pair configuration is unsupported,
- // this method also determines the nearest input format supported.
- // Nearest meaning closest bit depth, framerate, and channel count,
- // in that order of importance.
- //
- // The behaviour of this method should remain constant after the
- // XAPO has been initialized.
- //
- // PARAMETERS:
- // pOutputFormat - [in] output format known to be supported
- // pRequestedInputFormat - [in] input format to examine
- // ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
- //
- // RETURN VALUE:
- // COM error code, including:
- // S_OK - input/output configuration supported, ppSupportedInputFormat left untouched
- // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not NULL
- // E_INVALIDARG - either audio format invalid, ppSupportedInputFormat left untouched
- ////
- STDMETHOD(IsInputFormatSupported) (THIS_ const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat) PURE;
-
- ////
- // DESCRIPTION:
- // Queries if an input/output configuration is supported.
- //
- // REMARKS:
- // This method allows XAPOs to express dependency of output format
- // with respect to input format.
- //
- // If the input/output format pair configuration is unsupported,
- // this method also determines the nearest output format supported.
- // Nearest meaning closest bit depth, framerate, and channel count,
- // in that order of importance.
- //
- // The behaviour of this method should remain constant after the
- // XAPO has been initialized.
- //
- // PARAMETERS:
- // pInputFormat - [in] input format known to be supported
- // pRequestedOutputFormat - [in] output format to examine
- // ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
- //
- // RETURN VALUE:
- // COM error code, including:
- // S_OK - input/output configuration supported, ppSupportedOutputFormat left untouched
- // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not NULL
- // E_INVALIDARG - either audio format invalid, ppSupportedOutputFormat left untouched
- ////
- STDMETHOD(IsOutputFormatSupported) (THIS_ const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat) PURE;
-
- ////
- // DESCRIPTION:
- // Performs any effect-specific initialization if required.
- //
- // REMARKS:
- // The contents of pData are defined by the XAPO.
- // Immutable variables (constant during the lifespan of the XAPO)
- // should be set once via this method.
- // Once initialized, an XAPO cannot be initialized again.
- //
- // An XAPO should be initialized before passing it to XAudio2
- // as part of an effect chain. XAudio2 will not call this method;
- // it exists for future content-driven initialization by XACT.
- //
- // PARAMETERS:
- // pData - [in] effect-specific initialization parameters, may be NULL if DataByteSize == 0
- // DataByteSize - [in] size of pData in bytes, may be 0 if DataByteSize is NULL
- //
- // RETURN VALUE:
- // COM error code
- ////
- STDMETHOD(Initialize) (THIS_ __in_bcount_opt(DataByteSize) const void* pData, UINT32 DataByteSize) PURE;
-
- ////
- // DESCRIPTION:
- // Resets variables dependent on frame history.
- //
- // REMARKS:
- // All other variables remain unchanged, including variables set by
- // IXAPOParameters::SetParameters.
- //
- // For example, an effect with delay should zero out its delay line
- // during this method, but should not reallocate anything as the
- // XAPO remains locked with a constant input/output configuration.
- //
- // XAudio2 calls this method only if the XAPO is locked.
- // This method should not block as it is called from the
- // realtime thread.
- //
- // PARAMETERS:
- // void
- //
- // RETURN VALUE:
- // void
- ////
- STDMETHOD_(void, Reset) (THIS) PURE;
-
- ////
- // DESCRIPTION:
- // Locks the XAPO to a specific input/output configuration,
- // allowing it to do any final initialization before Process
- // is called on the realtime thread.
- //
- // REMARKS:
- // Once locked, the input/output configuration and any other locked
- // variables remain constant until UnlockForProcess is called.
- //
- // XAPOs should assert the input/output configuration is supported
- // and that any required effect-specific initialization is complete.
- // IsInputFormatSupported, IsOutputFormatSupported, and Initialize
- // should be called as necessary before this method is called.
- //
- // All internal memory buffers required for Process should be
- // allocated by the time this method returns successfully
- // as Process is non-blocking and should not allocate memory.
- //
- // Once locked, an XAPO cannot be locked again until
- // UnLockForProcess is called.
- //
- // PARAMETERS:
- // InputLockedParameterCount - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount]
- // pInputLockedParameters - [in] array of input locked buffer parameter structures, may be NULL if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements
- // OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
- // pOutputLockedParameters - [in] array of output locked buffer parameter structures, may be NULL if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements
- //
- // RETURN VALUE:
- // COM error code
- ////
- STDMETHOD(LockForProcess) (THIS_ UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) PURE;
-
- ////
- // DESCRIPTION:
- // Opposite of LockForProcess. Variables allocated during
- // LockForProcess should be deallocated by this method.
- //
- // REMARKS:
- // Unlocking an XAPO allows an XAPO instance to be reused with
- // different input/output configurations.
- //
- // PARAMETERS:
- // void
- //
- // RETURN VALUE:
- // void
- ////
- STDMETHOD_(void, UnlockForProcess) (THIS) PURE;
-
- ////
- // DESCRIPTION:
- // Runs the XAPO's DSP code on the given input/output buffers.
- //
- // REMARKS:
- // In addition to writing to the output buffers as appropriate,
- // an XAPO must set the BufferFlags and ValidFrameCount members
- // of all elements in pOutputProcessParameters accordingly.
- //
- // ppInputProcessParameters will not necessarily be the same as
- // ppOutputProcessParameters for in-place processing, rather
- // the pBuffer members of each will point to the same memory.
- //
- // Multiple input/output buffers may be used with in-place XAPOs,
- // though the input buffer count must equal the output buffer count.
- // When multiple input/output buffers are used with in-place XAPOs,
- // the XAPO may assume input buffer [N] equals output buffer [N].
- //
- // When IsEnabled is FALSE, the XAPO should process thru.
- // Thru processing means an XAPO should not apply its normal
- // processing to the given input/output buffers during Process.
- // It should instead pass data from input to output with as little
- // modification possible. Effects that perform format conversion
- // should continue to do so. The effect must ensure transitions
- // between normal and thru processing do not introduce
- // discontinuities into the signal.
- //
- // XAudio2 calls this method only if the XAPO is locked.
- // This method should not block as it is called from the
- // realtime thread.
- //
- // PARAMETERS:
- // InputProcessParameterCount - [in] number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess
- // pInputProcessParameters - [in] array of input process buffer parameter structures, may be NULL if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements
- // OutputProcessParameterCount - [in] number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess
- // pOutputProcessParameters - [in/out] array of output process buffer parameter structures, may be NULL if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements
- // IsEnabled - [in] TRUE to process normally, FALSE to process thru
- //
- // RETURN VALUE:
- // void
- ////
- STDMETHOD_(void, Process) (THIS_ UINT32 InputProcessParameterCount, __in_ecount_opt(InputProcessParameterCount) const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters, UINT32 OutputProcessParameterCount, __inout_ecount_opt(OutputProcessParameterCount) XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters, BOOL IsEnabled) PURE;
-
- ////
- // DESCRIPTION:
- // Returns the number of input frames required to generate the
- // requested number of output frames.
- //
- // REMARKS:
- // XAudio2 may call this method to determine how many input frames
- // an XAPO requires. This is constant for locked CBR XAPOs;
- // this method need only be called once while an XAPO is locked.
- //
- // XAudio2 calls this method only if the XAPO is locked.
- // This method should not block as it is called from the
- // realtime thread.
- //
- // PARAMETERS:
- // OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
- //
- // RETURN VALUE:
- // number of input frames required
- ////
- STDMETHOD_(UINT32, CalcInputFrames) (THIS_ UINT32 OutputFrameCount) PURE;
-
- ////
- // DESCRIPTION:
- // Returns the number of output frames generated for the
- // requested number of input frames.
- //
- // REMARKS:
- // XAudio2 may call this method to determine how many output frames
- // an XAPO will generate. This is constant for locked CBR XAPOs;
- // this method need only be called once while an XAPO is locked.
- //
- // XAudio2 calls this method only if the XAPO is locked.
- // This method should not block as it is called from the
- // realtime thread.
- //
- // PARAMETERS:
- // InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
- //
- // RETURN VALUE:
- // number of output frames generated
- ////
- STDMETHOD_(UINT32, CalcOutputFrames) (THIS_ UINT32 InputFrameCount) PURE;
- };
-
-
-
- // IXAPOParameters:
- // Optional XAPO COM interface that allows an XAPO to use
- // effect-specific parameters.
- #undef INTERFACE
- #define INTERFACE IXAPOParameters
- DECLARE_INTERFACE_(IXAPOParameters, IUnknown) {
- ////
- // DESCRIPTION:
- // Sets effect-specific parameters.
- //
- // REMARKS:
- // This method may only be called on the realtime thread;
- // no synchronization between it and IXAPO::Process is necessary.
- //
- // This method should not block as it is called from the
- // realtime thread.
- //
- // PARAMETERS:
- // pParameters - [in] effect-specific parameter block, must be != NULL
- // ParameterByteSize - [in] size of pParameters in bytes, must be > 0
- //
- // RETURN VALUE:
- // void
- ////
- STDMETHOD_(void, SetParameters) (THIS_ __in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize) PURE;
-
- ////
- // DESCRIPTION:
- // Gets effect-specific parameters.
- //
- // REMARKS:
- // Unlike SetParameters, XAudio2 does not call this method on the
- // realtime thread. Thus, the XAPO must protect variables shared
- // with SetParameters/Process using appropriate synchronization.
- //
- // PARAMETERS:
- // pParameters - [out] receives effect-specific parameter block, must be != NULL
- // ParameterByteSize - [in] size of pParameters in bytes, must be > 0
- //
- // RETURN VALUE:
- // void
- ////
- STDMETHOD_(void, GetParameters) (THIS_ __out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize) PURE;
- };
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
- // macros to allow XAPO interfaces to be used in C code
- #if !defined(__cplusplus)
- // IXAPO
- #define IXAPO_QueryInterface(This, riid, ppInterface) \
- ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
-
- #define IXAPO_AddRef(This) \
- ( (This)->lpVtbl->AddRef(This) )
-
- #define IXAPO_Release(This) \
- ( (This)->lpVtbl->Release(This) )
-
- #define IXAPO_GetRegistrationProperties(This, ppRegistrationProperties) \
- ( (This)->lpVtbl->GetRegistrationProperties(This, ppRegistrationProperties) )
-
- #define IXAPO_IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) \
- ( (This)->lpVtbl->IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) )
-
- #define IXAPO_IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) \
- ( (This)->lpVtbl->IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) )
-
- #define IXAPO_Initialize(This, pData, DataByteSize) \
- ( (This)->lpVtbl->Initialize(This, pData, DataByteSize) )
-
- #define IXAPO_Reset(This) \
- ( (This)->lpVtbl->Reset(This) )
-
- #define IXAPO_LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) \
- ( (This)->lpVtbl->LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) )
-
- #define IXAPO_UnlockForProcess(This) \
- ( (This)->lpVtbl->UnlockForProcess(This) )
-
- #define IXAPO_Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) \
- ( (This)->lpVtbl->Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) )
-
- #define IXAPO_CalcInputFrames(This, OutputFrameCount) \
- ( (This)->lpVtbl->CalcInputFrames(This, OutputFrameCount) )
-
- #define IXAPO_CalcOutputFrames(This, InputFrameCount) \
- ( (This)->lpVtbl->CalcOutputFrames(This, InputFrameCount) )
-
-
- // IXAPOParameters
- #define IXAPOParameters_QueryInterface(This, riid, ppInterface) \
- ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
-
- #define IXAPOParameters_AddRef(This) \
- ( (This)->lpVtbl->AddRef(This) )
-
- #define IXAPOParameters_Release(This) \
- ( (This)->lpVtbl->Release(This) )
-
- #define IXAPOParameters_SetParameters(This, pParameters, ParameterByteSize) \
- ( (This)->lpVtbl->SetParameters(This, pParameters, ParameterByteSize) )
-
- #define IXAPOParameters_GetParameters(This, pParameters, ParameterByteSize) \
- ( (This)->lpVtbl->GetParameters(This, pParameters, ParameterByteSize) )
- #endif // !defined(__cplusplus)
-
-
- #pragma pack(pop) // revert packing alignment
-#endif // !defined(GUID_DEFS_ONLY)
-//---------------------------------<-EOF->----------------------------------//
diff --git a/3rdparty/dxsdk/Include/XAPOBase.h b/3rdparty/dxsdk/Include/XAPOBase.h
deleted file mode 100644
index 24c5c6f64ed..00000000000
--- a/3rdparty/dxsdk/Include/XAPOBase.h
+++ /dev/null
@@ -1,337 +0,0 @@
-/*-========================================================================-_
- | - XAPO - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |PROJECT: XAPO MODEL: Unmanaged User-mode |
- |VERSION: 1.0 EXCEPT: No Exceptions |
- |CLASS: N / A MINREQ: WinXP, Xbox360 |
- |BASE: N / A DIALECT: MSC++ 14.00 |
- |>------------------------------------------------------------------------<|
- | DUTY: XAPO base classes |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. See XAPO.h for the rules governing XAPO interface behaviour. */
-
-#pragma once
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
-#include "XAPO.h"
-
-// default audio format ranges supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat
-#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used
-#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels
-#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels
-#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec
-#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec
-#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used
-
-// default XAPO property flags supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
-#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED)
-
-// default number of input and output buffers supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
-#define XAPOBASE_DEFAULT_BUFFER_COUNT 1
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
-// assertion
-#if !defined(XAPOASSERT)
- #if XAPODEBUG
- #define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
- #else
- #define XAPOASSERT(exp) __assume(exp)
- #endif
-#endif
-
-
-//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
-#pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned
-
-
-// primitive types
-typedef float FLOAT32; // 32-bit IEEE float
-
-
- ////
- // DESCRIPTION:
- // Default implementation of the IXAPO and IUnknown interfaces.
- // Provides overridable implementations for all methods save IXAPO::Process.
- ////
-class __declspec(novtable) CXAPOBase: public IXAPO {
-private:
- const XAPO_REGISTRATION_PROPERTIES* m_pRegistrationProperties; // pointer to registration properties of the XAPO, set via constructor
-
- void* m_pfnMatrixMixFunction; // optimal matrix function pointer, used for thru processing
- FLOAT32* m_pfl32MatrixCoefficients; // matrix coefficient table, used for thru processing
- UINT32 m_nSrcFormatType; // input format type, used for thru processing
- BOOL m_fIsScalarMatrix; // TRUE if m_pfl32MatrixCoefficients is diagonal matrix with all main diagonal entries equal, i.e. m_pfnMatrixMixFunction only used for type conversion (no channel conversion), used for thru processing
- BOOL m_fIsLocked; // TRUE if XAPO locked via CXAPOBase.LockForProcess
-
-
-protected:
- LONG m_lReferenceCount; // COM reference count, must be aligned for atomic operations
-
- ////
- // DESCRIPTION:
- // Verifies an audio format falls within the default ranges supported.
- //
- // REMARKS:
- // If pFormat is unsupported, and fOverwrite is TRUE,
- // pFormat is overwritten with the nearest format supported.
- // Nearest meaning closest bit depth, framerate, and channel count,
- // in that order of importance.
- //
- // PARAMETERS:
- // pFormat - [in/out] audio format to examine
- // fOverwrite - [in] TRUE to overwrite pFormat if audio format unsupported
- //
- // RETURN VALUE:
- // COM error code, including:
- // S_OK - audio format supported, pFormat left untouched
- // XAPO_E_FORMAT_UNSUPPORTED - audio format unsupported, pFormat overwritten with nearest audio format supported if fOverwrite TRUE
- // E_INVALIDARG - audio format invalid, pFormat left untouched
- ////
- virtual HRESULT ValidateFormatDefault (__inout WAVEFORMATEX* pFormat, BOOL fOverwrite);
-
- ////
- // DESCRIPTION:
- // Verifies that an input/output format pair configuration is supported
- // with respect to the XAPO property flags.
- //
- // REMARKS:
- // If pRequestedFormat is unsupported, and fOverwrite is TRUE,
- // pRequestedFormat is overwritten with the nearest format supported.
- // Nearest meaning closest bit depth, framerate, and channel count,
- // in that order of importance.
- //
- // PARAMETERS:
- // pSupportedFormat - [in] audio format known to be supported
- // pRequestedFormat - [in/out] audio format to examine, must be WAVEFORMATEXTENSIBLE if fOverwrite TRUE
- // fOverwrite - [in] TRUE to overwrite pRequestedFormat if input/output configuration unsupported
- //
- // RETURN VALUE:
- // COM error code, including:
- // S_OK - input/output configuration supported, pRequestedFormat left untouched
- // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, pRequestedFormat overwritten with nearest audio format supported if fOverwrite TRUE
- // E_INVALIDARG - either audio format invalid, pRequestedFormat left untouched
- ////
- HRESULT ValidateFormatPair (const WAVEFORMATEX* pSupportedFormat, __inout WAVEFORMATEX* pRequestedFormat, BOOL fOverwrite);
-
- ////
- // DESCRIPTION:
- // This method may be called by an IXAPO::Process implementation
- // for thru processing. It copies/mixes data from source to
- // destination, making as few changes as possible to the audio data.
- //
- // REMARKS:
- // However, this method is capable of channel upmix/downmix and uses
- // the same matrix coefficient table used by windows Vista to do so.
- //
- // For in-place processing (input buffer == output buffer)
- // this method does nothing.
- //
- // This method should be called only if the XAPO is locked and
- // XAPO_FLAG_FRAMERATE_MUST_MATCH is used.
- //
- // PARAMETERS:
- // pInputBuffer - [in] input buffer, format may be INT8, INT16, INT20 (contained in 24 or 32 bits), INT24 (contained in 24 or 32 bits), INT32, or FLOAT32
- // pOutputBuffer - [out] output buffer, format must be FLOAT32
- // FrameCount - [in] number of frames to process
- // InputChannelCount - [in] number of input channels
- // OutputChannelCount - [in] number of output channels
- // MixWithOutput - [in] TRUE to mix with output, FALSE to overwrite output
- //
- // RETURN VALUE:
- // void
- ////
- void ProcessThru (__in void* pInputBuffer, __inout FLOAT32* pOutputBuffer, UINT32 FrameCount, WORD InputChannelCount, WORD OutputChannelCount, BOOL MixWithOutput);
-
- // accessors
- const XAPO_REGISTRATION_PROPERTIES* GetRegistrationPropertiesInternal () { return m_pRegistrationProperties; }
- BOOL IsLocked () { return m_fIsLocked; }
-
-
-public:
- CXAPOBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties);
- virtual ~CXAPOBase ();
-
- // IUnknown methods:
- // retrieves the requested interface pointer if supported
- STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface)
- {
- XAPOASSERT(ppInterface != NULL);
- HRESULT hr = S_OK;
-
- if (riid == __uuidof(IXAPO)) {
- *ppInterface = static_cast<IXAPO*>(this);
- AddRef();
- } else if (riid == __uuidof(IUnknown)) {
- *ppInterface = static_cast<IUnknown*>(this);
- AddRef();
- } else {
- *ppInterface = NULL;
- hr = E_NOINTERFACE;
- }
-
- return hr;
- }
-
- // increments reference count
- STDMETHOD_(ULONG, AddRef) ()
- {
- return (ULONG)InterlockedIncrement(&m_lReferenceCount);
- }
-
- // decrements reference count and deletes the object if the reference count falls to zero
- STDMETHOD_(ULONG, Release) ()
- {
- ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount);
- if (uTmpReferenceCount == 0) {
- delete this;
- }
- return uTmpReferenceCount;
- }
-
- // IXAPO methods:
- // Allocates a copy of the registration properties of the XAPO.
- // This default implementation returns a copy of the registration
- // properties given to the constructor, allocated via XAPOAlloc.
- STDMETHOD(GetRegistrationProperties) (__deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties);
-
- // Queries if a specific input format is supported for a given output format.
- // This default implementation assumes only the format described by the
- // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
- STDMETHOD(IsInputFormatSupported) (const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat);
-
- // Queries if a specific output format is supported for a given input format.
- // This default implementation assumes only the format described by the
- // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
- STDMETHOD(IsOutputFormatSupported) (const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat);
-
- // Performs any effect-specific initialization.
- // This default implementation is a no-op and only returns S_OK.
- STDMETHOD(Initialize) (__in_bcount_opt(DataByteSize) const void*, UINT32 DataByteSize)
- {
- UNREFERENCED_PARAMETER(DataByteSize);
- return S_OK;
- }
-
- // Resets variables dependent on frame history.
- // This default implementation is a no-op: this base class contains no
- // relevant state to reset.
- STDMETHOD_(void, Reset) () { return; }
-
- // Notifies XAPO of buffer formats Process() will be given.
- // This default implementation performs basic input/output format
- // validation against the XAPO's registration properties.
- // Derived XAPOs should call the base implementation first.
- STDMETHOD(LockForProcess) (UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters);
-
- // Opposite of LockForProcess.
- // Derived XAPOs should call the base implementation first.
- STDMETHOD_(void, UnlockForProcess) ();
-
- // Returns the number of input frames required to generate the requested number of output frames.
- // By default, this method returns the same number of frames it was passed.
- STDMETHOD_(UINT32, CalcInputFrames) (UINT32 OutputFrameCount) { return OutputFrameCount; }
-
- // Returns the number of output frames generated for the requested number of input frames.
- // By default, this method returns the same number of frames it was passed.
- STDMETHOD_(UINT32, CalcOutputFrames) (UINT32 InputFrameCount) { return InputFrameCount; }
-};
-
-
-
-
-
-//--------------------------------------------------------------------------//
- ////
- // DESCRIPTION:
- // Extends CXAPOBase, providing a default implementation of the
- // IXAPOParameters interface with appropriate synchronization to
- // protect variables shared between IXAPOParameters::GetParameters
- // and IXAPOParameters::SetParameters/IXAPO::Process.
- //
- // This class is for parameter blocks whose size is larger than 4 bytes.
- // For smaller parameter blocks, use atomic operations directly
- // on the parameters for synchronization.
- ////
-class __declspec(novtable) CXAPOParametersBase: public CXAPOBase, public IXAPOParameters {
-private:
- BYTE* m_pParameterBlocks; // three contiguous process parameter blocks used for synchronization, user responsible for initialization of parameter blocks before IXAPO::Process/SetParameters/GetParameters called
- BYTE* m_pCurrentParameters; // pointer to current process parameters, must be aligned for atomic operations
- BYTE* m_pCurrentParametersInternal; // pointer to current process parameters (temp pointer read by SetParameters/BeginProcess/EndProcess)
- UINT32 m_uCurrentParametersIndex; // index of current process parameters
- UINT32 m_uParameterBlockByteSize; // size of a single parameter block in bytes, must be > 0
- BOOL m_fNewerResultsReady; // TRUE if there exists new processing results not yet picked up by GetParameters(), must be aligned for atomic operations
- BOOL m_fProducer; // IXAPO::Process produces data to be returned by GetParameters(); SetParameters() disallowed
-
-
-public:
- ////
- // PARAMETERS:
- // pRegistrationProperties - [in] registration properties of the XAPO
- // pParameterBlocks - [in] three contiguous process parameter blocks used for synchronization
- // uParameterBlockByteSize - [in] size of one of the parameter blocks, must be > 0
- // fProducer - [in] TRUE if IXAPO::Process produces data to be returned by GetParameters() (SetParameters() and ParametersChanged() disallowed)
- ////
- CXAPOParametersBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties, BYTE* pParameterBlocks, UINT32 uParameterBlockByteSize, BOOL fProducer);
- virtual ~CXAPOParametersBase ();
-
- // IUnknown methods:
- // retrieves the requested interface pointer if supported
- STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface)
- {
- XAPOASSERT(ppInterface != NULL);
- HRESULT hr = S_OK;
-
- if (riid == __uuidof(IXAPOParameters)) {
- *ppInterface = static_cast<IXAPOParameters*>(this);
- CXAPOBase::AddRef();
- } else {
- hr = CXAPOBase::QueryInterface(riid, ppInterface);
- }
-
- return hr;
- }
-
- // increments reference count
- STDMETHOD_(ULONG, AddRef)() { return CXAPOBase::AddRef(); }
-
- // decrements reference count and deletes the object if the reference count falls to zero
- STDMETHOD_(ULONG, Release)() { return CXAPOBase::Release(); }
-
- // IXAPOParameters methods:
- // Sets effect-specific parameters.
- // This method may only be called on the realtime audio processing thread.
- STDMETHOD_(void, SetParameters) (__in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize);
-
- // Gets effect-specific parameters.
- // This method may block and should not be called from the realtime thread.
- // Get the current parameters via BeginProcess.
- STDMETHOD_(void, GetParameters) (__out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize);
-
- // Called by SetParameters() to allow for user-defined parameter validation.
- // SetParameters validates that ParameterByteSize == m_uParameterBlockByteSize
- // so the user may assume/assert ParameterByteSize == m_uParameterBlockByteSize.
- // This method should not block as it is called from the realtime thread.
- virtual void OnSetParameters (const void*, UINT32) { }
-
- // Returns TRUE if SetParameters() has been called since the last processing pass.
- // May only be used within the XAPO's IXAPO::Process implementation,
- // before BeginProcess is called.
- BOOL ParametersChanged ();
-
- // Returns latest process parameters.
- // XAPOs must call this method within their IXAPO::Process
- // implementation to access latest process parameters in threadsafe manner.
- BYTE* BeginProcess ();
-
- // Notifies CXAPOParametersBase that the XAPO has finished accessing
- // the latest process parameters.
- // XAPOs must call this method within their IXAPO::Process
- // implementation to access latest process parameters in threadsafe manner.
- void EndProcess ();
-};
-
-
-#pragma pack(pop) // revert packing alignment
-//---------------------------------<-EOF->----------------------------------//
diff --git a/3rdparty/dxsdk/Include/XAPOFX.h b/3rdparty/dxsdk/Include/XAPOFX.h
deleted file mode 100644
index a5dbeef4b56..00000000000
--- a/3rdparty/dxsdk/Include/XAPOFX.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*-========================================================================-_
- | - XAPOFX - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |PROJECT: XAPOFX MODEL: Unmanaged User-mode |
- |VERSION: 1.3 EXCEPT: No Exceptions |
- |CLASS: N / A MINREQ: WinXP, Xbox360 |
- |BASE: N / A DIALECT: MSC++ 14.00 |
- |>------------------------------------------------------------------------<|
- | DUTY: Cross-platform Audio Processing Objects |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS!
- Here's how:
- Copy XAPOFXDX_X.dll to where your application exists.
- The debug DLL can be found under %WINDIR%\system32.
- Rename XAPOFXDX_X.dll to XAPOFXX_X.dll to use the debug version. */
-
-#pragma once
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
-#include "comdecl.h" // for DEFINE_CLSID
-
-// FX class IDs
-DEFINE_CLSID(FXEQ, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 00);
-DEFINE_CLSID(FXMasteringLimiter, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 01);
-DEFINE_CLSID(FXReverb, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 02);
-DEFINE_CLSID(FXEcho, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 03);
-
-
-#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
- #if defined(_XBOX) // general windows and COM declarations
- #include <xtl.h>
- #include <xobjbase.h>
- #else
- #include <windows.h>
- #include <objbase.h>
- #endif
- #include <float.h> // float bounds
-
-
- // EQ parameter bounds (inclusive), used with XEQ:
- #define FXEQ_MIN_FRAMERATE 22000
- #define FXEQ_MAX_FRAMERATE 48000
-
- #define FXEQ_MIN_FREQUENCY_CENTER 20.0f
- #define FXEQ_MAX_FREQUENCY_CENTER 20000.0f
- #define FXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f // band 0
- #define FXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f // band 1
- #define FXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f // band 2
- #define FXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f // band 3
-
- #define FXEQ_MIN_GAIN 0.126f // -18dB
- #define FXEQ_MAX_GAIN 7.94f // +18dB
- #define FXEQ_DEFAULT_GAIN 1.0f // 0dB change, all bands
-
- #define FXEQ_MIN_BANDWIDTH 0.1f
- #define FXEQ_MAX_BANDWIDTH 2.0f
- #define FXEQ_DEFAULT_BANDWIDTH 1.0f // all bands
-
-
- // Mastering limiter parameter bounds (inclusive), used with XMasteringLimiter:
- #define FXMASTERINGLIMITER_MIN_RELEASE 1
- #define FXMASTERINGLIMITER_MAX_RELEASE 20
- #define FXMASTERINGLIMITER_DEFAULT_RELEASE 6
-
- #define FXMASTERINGLIMITER_MIN_LOUDNESS 1
- #define FXMASTERINGLIMITER_MAX_LOUDNESS 1800
- #define FXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000
-
-
- // Reverb parameter bounds (inclusive), used with XReverb:
- #define FXREVERB_MIN_DIFFUSION 0.0f
- #define FXREVERB_MAX_DIFFUSION 1.0f
- #define FXREVERB_DEFAULT_DIFFUSION 0.9f
-
- #define FXREVERB_MIN_ROOMSIZE 0.0001f
- #define FXREVERB_MAX_ROOMSIZE 1.0f
- #define FXREVERB_DEFAULT_ROOMSIZE 0.6f
-
-
- // Echo parameter bounds (inclusive), used with XEcho:
- #define FXECHO_MIN_WETDRYMIX 0.0f
- #define FXECHO_MAX_WETDRYMIX 1.0f
- #define FXECHO_DEFAULT_WETDRYMIX 0.5f
-
- #define FXECHO_MIN_FEEDBACK 0.0f
- #define FXECHO_MAX_FEEDBACK 1.0f
- #define FXECHO_DEFAULT_FEEDBACK 0.5f
-
- #define FXECHO_MIN_DELAY 1.0f
- #define FXECHO_MAX_DELAY 2000.0f
- #define FXECHO_DEFAULT_DELAY 500.0f
-
-
-//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
- #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
-
-
- // EQ parameters (4 bands), used with IXAPOParameters::SetParameters:
- // The EQ supports only FLOAT32 audio foramts.
- // The framerate must be within [22000, 48000] Hz.
- typedef struct FXEQ_PARAMETERS {
- float FrequencyCenter0; // center frequency in Hz, band 0
- float Gain0; // boost/cut
- float Bandwidth0; // bandwidth, region of EQ is center frequency +/- bandwidth/2
- float FrequencyCenter1; // band 1
- float Gain1;
- float Bandwidth1;
- float FrequencyCenter2; // band 2
- float Gain2;
- float Bandwidth2;
- float FrequencyCenter3; // band 3
- float Gain3;
- float Bandwidth3;
- } FXEQ_PARAMETERS;
-
-
- // Mastering limiter parameters, used with IXAPOParameters::SetParameters:
- // The mastering limiter supports only FLOAT32 audio formats.
- typedef struct FXMASTERINGLIMITER_PARAMETERS {
- UINT32 Release; // release time (tuning factor with no specific units)
- UINT32 Loudness; // loudness target (threshold)
- } FXMASTERINGLIMITER_PARAMETERS;
-
-
- // Reverb parameters, used with IXAPOParameters::SetParameters:
- // The reverb supports only FLOAT32 audio formats with the following
- // channel configurations:
- // Input: Mono Output: Mono
- // Input: Stereo Output: Stereo
- typedef struct FXREVERB_PARAMETERS {
- float Diffusion; // diffusion
- float RoomSize; // room size
- } FXREVERB_PARAMETERS;
-
-
- // Echo parameters, used with IXAPOParameters::SetParameters:
- // The echo supports only FLOAT32 audio formats.
- typedef struct FXECHO_PARAMETERS {
- float WetDryMix; // ratio of wet (processed) signal to dry (original) signal
- float Feedback; // amount of output fed back into input
- float Delay; // delay (all channels) in milliseconds
- } FXECHO_PARAMETERS;
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
- // function storage-class attribute and calltype
- #if defined(_XBOX) || !defined(FXDLL)
- #define FX_API_(type) EXTERN_C type STDAPIVCALLTYPE
- #else
- #if defined(FXEXPORT)
- #define FX_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE
- #else
- #define FX_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE
- #endif
- #endif
- #define FX_IMP_(type) type STDMETHODVCALLTYPE
-
-
-//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
- // creates instance of requested XAPO, use Release to free instance
- FX_API_(HRESULT) CreateFX (REFCLSID clsid, __deref_out IUnknown** pEffect);
-
-
- #pragma pack(pop) // revert packing alignment
-#endif // !defined(GUID_DEFS_ONLY)
-//---------------------------------<-EOF->----------------------------------//
diff --git a/3rdparty/dxsdk/Include/XAudio2.h b/3rdparty/dxsdk/Include/XAudio2.h
deleted file mode 100644
index 885b92f919e..00000000000
--- a/3rdparty/dxsdk/Include/XAudio2.h
+++ /dev/null
@@ -1,1282 +0,0 @@
-/**************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: xaudio2.h
- * Content: Declarations for the XAudio2 game audio API.
- *
- **************************************************************************/
-
-#ifndef __XAUDIO2_INCLUDED__
-#define __XAUDIO2_INCLUDED__
-
-
-/**************************************************************************
- *
- * XAudio2 COM object class and interface IDs.
- *
- **************************************************************************/
-
-#include <comdecl.h> // For DEFINE_CLSID and DEFINE_IID
-
-// XAudio 2.0 (March 2008 SDK)
-//DEFINE_CLSID(XAudio2, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, aa);
-//DEFINE_CLSID(XAudio2_Debug, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, db);
-
-// XAudio 2.1 (June 2008 SDK)
-//DEFINE_CLSID(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08);
-//DEFINE_CLSID(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd);
-
-// XAudio 2.2 (August 2008 SDK)
-//DEFINE_CLSID(XAudio2, b802058a, 464a, 42db, bc, 10, b6, 50, d6, f2, 58, 6a);
-//DEFINE_CLSID(XAudio2_Debug, 97dfb7e7, 5161, 4015, 87, a9, c7, 9e, 6a, 19, 52, cc);
-
-// XAudio 2.3 (November 2008 SDK)
-//DEFINE_CLSID(XAudio2, 4c5e637a, 16c7, 4de3, 9c, 46, 5e, d2, 21, 81, 96, 2d);
-//DEFINE_CLSID(XAudio2_Debug, ef0aa05d, 8075, 4e5d, be, ad, 45, be, 0c, 3c, cb, b3);
-
-// XAudio 2.4 (March 2009 SDK)
-//DEFINE_CLSID(XAudio2, 03219e78, 5bc3, 44d1, b9, 2e, f6, 3d, 89, cc, 65, 26);
-//DEFINE_CLSID(XAudio2_Debug, 4256535c, 1ea4, 4d4b, 8a, d5, f9, db, 76, 2e, ca, 9e);
-
-// XAudio 2.5 (August 2009 SDK)
-//DEFINE_CLSID(XAudio2, 4c9b6dde, 6809, 46e6, a2, 78, 9b, 6a, 97, 58, 86, 70);
-//DEFINE_CLSID(XAudio2_Debug, 715bdd1a, aa82, 436b, b0, fa, 6a, ce, a3, 9b, d0, a1);
-
-// XAudio 2.6 (February 2010 SDK)
-//DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de);
-//DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e);
-
-// XAudio 2.7 (June 2010 SDK)
-DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af);
-DEFINE_CLSID(XAudio2_Debug, db05ea35, 0329, 4d4b, a5, 3a, 6d, ea, d0, 3d, 38, 52);
-DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
-
-
-// Ignore the rest of this header if only the GUID definitions were requested
-#ifndef GUID_DEFS_ONLY
-
-#ifdef _XBOX
- #include <xobjbase.h> // Xbox COM declarations (IUnknown, etc)
-#else
- #include <objbase.h> // Windows COM declarations
-#endif
-
-#include <sal.h> // Markers for documenting API semantics
-#include <audiodefs.h> // Basic audio data types and constants
-#include <xma2defs.h> // Data types and constants for XMA2 audio
-
-// All structures defined in this file use tight field packing
-#pragma pack(push, 1)
-
-
-/**************************************************************************
- *
- * XAudio2 constants, flags and error codes.
- *
- **************************************************************************/
-
-// Numeric boundary values
-#define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer
-#define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue
-#define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only)
-#define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream
-#define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported
-#define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported
-#define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24)
-#define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument
-#define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument
-#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument
-#define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ
-#define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency
-#define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount
-#define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360
-
-// For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio
-// argument and the voice's sample rate: the product of these numbers cannot exceed 600000
-// for one-channel voices or 300000 for voices with more than one channel.
-#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000
-#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000
-
-// Numeric values with special meanings
-#define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument
-#define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges
-#define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments
-#define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount
-#define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount
-#define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice
-#define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice
-
-// Flags
-#define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create on Windows only
-#define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice
-#define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice
-#define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice
-#define XAUDIO2_VOICE_MUSIC 0x0010 // Used in IXAudio2::CreateSourceVoice
-#define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop
-#define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags
-#define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags
-
-// Default parameters for the built-in filter
-#define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter
-#define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY
-#define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f
-
-// Internal XAudio2 constants
-#ifdef _XBOX
- #define XAUDIO2_QUANTUM_NUMERATOR 2 // On Xbox 360, XAudio2 processes audio
- #define XAUDIO2_QUANTUM_DENOMINATOR 375 // in 5.333ms chunks (= 2/375 seconds)
-#else
- #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio
- #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds)
-#endif
-#define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR)
-
-// XAudio2 error codes
-#define FACILITY_XAUDIO2 0x896
-#define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal
-#define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error
-#define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect
-#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc)
-
-
-/**************************************************************************
- *
- * Forward declarations for the XAudio2 interfaces.
- *
- **************************************************************************/
-
-#ifdef __cplusplus
- #define FWD_DECLARE(x) interface x
-#else
- #define FWD_DECLARE(x) typedef interface x x
-#endif
-
-FWD_DECLARE(IXAudio2);
-FWD_DECLARE(IXAudio2Voice);
-FWD_DECLARE(IXAudio2SourceVoice);
-FWD_DECLARE(IXAudio2SubmixVoice);
-FWD_DECLARE(IXAudio2MasteringVoice);
-FWD_DECLARE(IXAudio2EngineCallback);
-FWD_DECLARE(IXAudio2VoiceCallback);
-
-
-/**************************************************************************
- *
- * XAudio2 structures and enumerations.
- *
- **************************************************************************/
-
-// Used in IXAudio2::Initialize
-#ifdef _XBOX
- typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER
- {
- XboxThread0 = 0x01,
- XboxThread1 = 0x02,
- XboxThread2 = 0x04,
- XboxThread3 = 0x08,
- XboxThread4 = 0x10,
- XboxThread5 = 0x20,
- XAUDIO2_ANY_PROCESSOR = XboxThread4,
- XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
- } XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR;
-#else
- typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
- {
- Processor1 = 0x00000001,
- Processor2 = 0x00000002,
- Processor3 = 0x00000004,
- Processor4 = 0x00000008,
- Processor5 = 0x00000010,
- Processor6 = 0x00000020,
- Processor7 = 0x00000040,
- Processor8 = 0x00000080,
- Processor9 = 0x00000100,
- Processor10 = 0x00000200,
- Processor11 = 0x00000400,
- Processor12 = 0x00000800,
- Processor13 = 0x00001000,
- Processor14 = 0x00002000,
- Processor15 = 0x00004000,
- Processor16 = 0x00008000,
- Processor17 = 0x00010000,
- Processor18 = 0x00020000,
- Processor19 = 0x00040000,
- Processor20 = 0x00080000,
- Processor21 = 0x00100000,
- Processor22 = 0x00200000,
- Processor23 = 0x00400000,
- Processor24 = 0x00800000,
- Processor25 = 0x01000000,
- Processor26 = 0x02000000,
- Processor27 = 0x04000000,
- Processor28 = 0x08000000,
- Processor29 = 0x10000000,
- Processor30 = 0x20000000,
- Processor31 = 0x40000000,
- Processor32 = 0x80000000,
- XAUDIO2_ANY_PROCESSOR = 0xffffffff,
- XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
- } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR;
-#endif
-
-// Used in XAUDIO2_DEVICE_DETAILS below to describe the types of applications
-// that the user has specified each device as a default for. 0 means that the
-// device isn't the default for any role.
-typedef enum XAUDIO2_DEVICE_ROLE
-{
- NotDefaultDevice = 0x0,
- DefaultConsoleDevice = 0x1,
- DefaultMultimediaDevice = 0x2,
- DefaultCommunicationsDevice = 0x4,
- DefaultGameDevice = 0x8,
- GlobalDefaultDevice = 0xf,
- InvalidDeviceRole = ~GlobalDefaultDevice
-} XAUDIO2_DEVICE_ROLE;
-
-// Returned by IXAudio2::GetDeviceDetails
-typedef struct XAUDIO2_DEVICE_DETAILS
-{
- WCHAR DeviceID[256]; // String identifier for the audio device.
- WCHAR DisplayName[256]; // Friendly name suitable for display to a human.
- XAUDIO2_DEVICE_ROLE Role; // Roles that the device should be used for.
- WAVEFORMATEXTENSIBLE OutputFormat; // The device's native PCM audio output format.
-} XAUDIO2_DEVICE_DETAILS;
-
-// Returned by IXAudio2Voice::GetVoiceDetails
-typedef struct XAUDIO2_VOICE_DETAILS
-{
- UINT32 CreationFlags; // Flags the voice was created with.
- UINT32 InputChannels; // Channels in the voice's input audio.
- UINT32 InputSampleRate; // Sample rate of the voice's input audio.
-} XAUDIO2_VOICE_DETAILS;
-
-// Used in XAUDIO2_VOICE_SENDS below
-typedef struct XAUDIO2_SEND_DESCRIPTOR
-{
- UINT32 Flags; // Either 0 or XAUDIO2_SEND_USEFILTER.
- IXAudio2Voice* pOutputVoice; // This send's destination voice.
-} XAUDIO2_SEND_DESCRIPTOR;
-
-// Used in the voice creation functions and in IXAudio2Voice::SetOutputVoices
-typedef struct XAUDIO2_VOICE_SENDS
-{
- UINT32 SendCount; // Number of sends from this voice.
- XAUDIO2_SEND_DESCRIPTOR* pSends; // Array of SendCount send descriptors.
-} XAUDIO2_VOICE_SENDS;
-
-// Used in XAUDIO2_EFFECT_CHAIN below
-typedef struct XAUDIO2_EFFECT_DESCRIPTOR
-{
- IUnknown* pEffect; // Pointer to the effect object's IUnknown interface.
- BOOL InitialState; // TRUE if the effect should begin in the enabled state.
- UINT32 OutputChannels; // How many output channels the effect should produce.
-} XAUDIO2_EFFECT_DESCRIPTOR;
-
-// Used in the voice creation functions and in IXAudio2Voice::SetEffectChain
-typedef struct XAUDIO2_EFFECT_CHAIN
-{
- UINT32 EffectCount; // Number of effects in this voice's effect chain.
- XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; // Array of effect descriptors.
-} XAUDIO2_EFFECT_CHAIN;
-
-// Used in XAUDIO2_FILTER_PARAMETERS below
-typedef enum XAUDIO2_FILTER_TYPE
-{
- LowPassFilter, // Attenuates frequencies above the cutoff frequency.
- BandPassFilter, // Attenuates frequencies outside a given range.
- HighPassFilter, // Attenuates frequencies below the cutoff frequency.
- NotchFilter // Attenuates frequencies inside a given range.
-} XAUDIO2_FILTER_TYPE;
-
-// Used in IXAudio2Voice::Set/GetFilterParameters and Set/GetOutputFilterParameters
-typedef struct XAUDIO2_FILTER_PARAMETERS
-{
- XAUDIO2_FILTER_TYPE Type; // Low-pass, band-pass or high-pass.
- float Frequency; // Radian frequency (2 * sin(pi*CutoffFrequency/SampleRate));
- // must be >= 0 and <= XAUDIO2_MAX_FILTER_FREQUENCY
- // (giving a maximum CutoffFrequency of SampleRate/6).
- float OneOverQ; // Reciprocal of the filter's quality factor Q;
- // must be > 0 and <= XAUDIO2_MAX_FILTER_ONEOVERQ.
-} XAUDIO2_FILTER_PARAMETERS;
-
-// Used in IXAudio2SourceVoice::SubmitSourceBuffer
-typedef struct XAUDIO2_BUFFER
-{
- UINT32 Flags; // Either 0 or XAUDIO2_END_OF_STREAM.
- UINT32 AudioBytes; // Size of the audio data buffer in bytes.
- const BYTE* pAudioData; // Pointer to the audio data buffer.
- UINT32 PlayBegin; // First sample in this buffer to be played.
- UINT32 PlayLength; // Length of the region to be played in samples,
- // or 0 to play the whole buffer.
- UINT32 LoopBegin; // First sample of the region to be looped.
- UINT32 LoopLength; // Length of the desired loop region in samples,
- // or 0 to loop the entire buffer.
- UINT32 LoopCount; // Number of times to repeat the loop region,
- // or XAUDIO2_LOOP_INFINITE to loop forever.
- void* pContext; // Context value to be passed back in callbacks.
-} XAUDIO2_BUFFER;
-
-// Used in IXAudio2SourceVoice::SubmitSourceBuffer when submitting XWMA data.
-// NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's
-// pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from
-// all the entries in the next buffer's pDecodedPacketCumulativeBytes array.
-// And whether a sound is submitted in more than one buffer or not, the final
-// buffer of the sound should use the XAUDIO2_END_OF_STREAM flag, or else the
-// client must call IXAudio2SourceVoice::Discontinuity after submitting it.
-typedef struct XAUDIO2_BUFFER_WMA
-{
- const UINT32* pDecodedPacketCumulativeBytes; // Decoded packet's cumulative size array.
- // Each element is the number of bytes accumulated
- // when the corresponding XWMA packet is decoded in
- // order. The array must have PacketCount elements.
- UINT32 PacketCount; // Number of XWMA packets submitted. Must be >= 1 and
- // divide evenly into XAUDIO2_BUFFER.AudioBytes.
-} XAUDIO2_BUFFER_WMA;
-
-// Returned by IXAudio2SourceVoice::GetState
-typedef struct XAUDIO2_VOICE_STATE
-{
- void* pCurrentBufferContext; // The pContext value provided in the XAUDIO2_BUFFER
- // that is currently being processed, or NULL if
- // there are no buffers in the queue.
- UINT32 BuffersQueued; // Number of buffers currently queued on the voice
- // (including the one that is being processed).
- UINT64 SamplesPlayed; // Total number of samples produced by the voice since
- // it began processing the current audio stream.
-} XAUDIO2_VOICE_STATE;
-
-// Returned by IXAudio2::GetPerformanceData
-typedef struct XAUDIO2_PERFORMANCE_DATA
-{
- // CPU usage information
- UINT64 AudioCyclesSinceLastQuery; // CPU cycles spent on audio processing since the
- // last call to StartEngine or GetPerformanceData.
- UINT64 TotalCyclesSinceLastQuery; // Total CPU cycles elapsed since the last call
- // (only counts the CPU XAudio2 is running on).
- UINT32 MinimumCyclesPerQuantum; // Fewest CPU cycles spent processing any one
- // audio quantum since the last call.
- UINT32 MaximumCyclesPerQuantum; // Most CPU cycles spent processing any one
- // audio quantum since the last call.
-
- // Memory usage information
- UINT32 MemoryUsageInBytes; // Total heap space currently in use.
-
- // Audio latency and glitching information
- UINT32 CurrentLatencyInSamples; // Minimum delay from when a sample is read from a
- // source buffer to when it reaches the speakers.
- UINT32 GlitchesSinceEngineStarted; // Audio dropouts since the engine was started.
-
- // Data about XAudio2's current workload
- UINT32 ActiveSourceVoiceCount; // Source voices currently playing.
- UINT32 TotalSourceVoiceCount; // Source voices currently existing.
- UINT32 ActiveSubmixVoiceCount; // Submix voices currently playing/existing.
-
- UINT32 ActiveResamplerCount; // Resample xAPOs currently active.
- UINT32 ActiveMatrixMixCount; // MatrixMix xAPOs currently active.
-
- // Usage of the hardware XMA decoder (Xbox 360 only)
- UINT32 ActiveXmaSourceVoices; // Number of source voices decoding XMA data.
- UINT32 ActiveXmaStreams; // A voice can use more than one XMA stream.
-} XAUDIO2_PERFORMANCE_DATA;
-
-// Used in IXAudio2::SetDebugConfiguration
-typedef struct XAUDIO2_DEBUG_CONFIGURATION
-{
- UINT32 TraceMask; // Bitmap of enabled debug message types.
- UINT32 BreakMask; // Message types that will break into the debugger.
- BOOL LogThreadID; // Whether to log the thread ID with each message.
- BOOL LogFileline; // Whether to log the source file and line number.
- BOOL LogFunctionName; // Whether to log the function name.
- BOOL LogTiming; // Whether to log message timestamps.
-} XAUDIO2_DEBUG_CONFIGURATION;
-
-// Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS
-// are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and
-// FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS
-// and all the other settings are zero.
-#define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects.
-#define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable.
-#define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes).
-#define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat.
-#define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits.
-#define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits.
-#define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data.
-#define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes.
-#define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information.
-#define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information.
-
-
-/**************************************************************************
- *
- * IXAudio2: Top-level XAudio2 COM interface.
- *
- **************************************************************************/
-
-// Use default arguments if compiling as C++
-#ifdef __cplusplus
- #define X2DEFAULT(x) =x
-#else
- #define X2DEFAULT(x)
-#endif
-
-#undef INTERFACE
-#define INTERFACE IXAudio2
-DECLARE_INTERFACE_(IXAudio2, IUnknown)
-{
- // NAME: IXAudio2::QueryInterface
- // DESCRIPTION: Queries for a given COM interface on the XAudio2 object.
- // Only IID_IUnknown and IID_IXAudio2 are supported.
- //
- // ARGUMENTS:
- // riid - IID of the interface to be obtained.
- // ppvInterface - Returns a pointer to the requested interface.
- //
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, __deref_out void** ppvInterface) PURE;
-
- // NAME: IXAudio2::AddRef
- // DESCRIPTION: Adds a reference to the XAudio2 object.
- //
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
-
- // NAME: IXAudio2::Release
- // DESCRIPTION: Releases a reference to the XAudio2 object.
- //
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // NAME: IXAudio2::GetDeviceCount
- // DESCRIPTION: Returns the number of audio output devices available.
- //
- // ARGUMENTS:
- // pCount - Returns the device count.
- //
- STDMETHOD(GetDeviceCount) (THIS_ __out UINT32* pCount) PURE;
-
- // NAME: IXAudio2::GetDeviceDetails
- // DESCRIPTION: Returns information about the device with the given index.
- //
- // ARGUMENTS:
- // Index - Index of the device to be queried.
- // pDeviceDetails - Returns the device details.
- //
- STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, __out XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE;
-
- // NAME: IXAudio2::Initialize
- // DESCRIPTION: Sets global XAudio2 parameters and prepares it for use.
- //
- // ARGUMENTS:
- // Flags - Flags specifying the XAudio2 object's behavior. Currently unused.
- // XAudio2Processor - An XAUDIO2_PROCESSOR enumeration value that specifies
- // the hardware thread (Xbox) or processor (Windows) that XAudio2 will use.
- // The enumeration values are platform-specific; platform-independent code
- // can use XAUDIO2_DEFAULT_PROCESSOR to use the default on each platform.
- //
- STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0),
- XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE;
-
- // NAME: IXAudio2::RegisterForCallbacks
- // DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks.
- //
- // ARGUMENTS:
- // pCallback - Callback interface to be called during each processing pass.
- //
- STDMETHOD(RegisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE;
-
- // NAME: IXAudio2::UnregisterForCallbacks
- // DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks.
- //
- // ARGUMENTS:
- // pCallback - Previously registered callback interface to be removed.
- //
- STDMETHOD_(void, UnregisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE;
-
- // NAME: IXAudio2::CreateSourceVoice
- // DESCRIPTION: Creates and configures a source voice.
- //
- // ARGUMENTS:
- // ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface.
- // pSourceFormat - Format of the audio that will be fed to the voice.
- // Flags - XAUDIO2_VOICE flags specifying the source voice's behavior.
- // MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed.
- // pCallback - Optional pointer to a client-provided callback interface.
- // pSendList - Optional list of voices this voice should send audio to.
- // pEffectChain - Optional list of effects to apply to the audio data.
- //
- STDMETHOD(CreateSourceVoice) (THIS_ __deref_out IXAudio2SourceVoice** ppSourceVoice,
- __in const WAVEFORMATEX* pSourceFormat,
- UINT32 Flags X2DEFAULT(0),
- float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO),
- __in_opt IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL),
- __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
- __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
-
- // NAME: IXAudio2::CreateSubmixVoice
- // DESCRIPTION: Creates and configures a submix voice.
- //
- // ARGUMENTS:
- // ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface.
- // InputChannels - Number of channels in this voice's input audio data.
- // InputSampleRate - Sample rate of this voice's input audio data.
- // Flags - XAUDIO2_VOICE flags specifying the submix voice's behavior.
- // ProcessingStage - Arbitrary number that determines the processing order.
- // pSendList - Optional list of voices this voice should send audio to.
- // pEffectChain - Optional list of effects to apply to the audio data.
- //
- STDMETHOD(CreateSubmixVoice) (THIS_ __deref_out IXAudio2SubmixVoice** ppSubmixVoice,
- UINT32 InputChannels, UINT32 InputSampleRate,
- UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0),
- __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
- __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
-
-
- // NAME: IXAudio2::CreateMasteringVoice
- // DESCRIPTION: Creates and configures a mastering voice.
- //
- // ARGUMENTS:
- // ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface.
- // InputChannels - Number of channels in this voice's input audio data.
- // InputSampleRate - Sample rate of this voice's input audio data.
- // Flags - XAUDIO2_VOICE flags specifying the mastering voice's behavior.
- // DeviceIndex - Identifier of the device to receive the output audio.
- // pEffectChain - Optional list of effects to apply to the audio data.
- //
- STDMETHOD(CreateMasteringVoice) (THIS_ __deref_out IXAudio2MasteringVoice** ppMasteringVoice,
- UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS),
- UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE),
- UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0),
- __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
-
- // NAME: IXAudio2::StartEngine
- // DESCRIPTION: Creates and starts the audio processing thread.
- //
- STDMETHOD(StartEngine) (THIS) PURE;
-
- // NAME: IXAudio2::StopEngine
- // DESCRIPTION: Stops and destroys the audio processing thread.
- //
- STDMETHOD_(void, StopEngine) (THIS) PURE;
-
- // NAME: IXAudio2::CommitChanges
- // DESCRIPTION: Atomically applies a set of operations previously tagged
- // with a given identifier.
- //
- // ARGUMENTS:
- // OperationSet - Identifier of the set of operations to be applied.
- //
- STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
-
- // NAME: IXAudio2::GetPerformanceData
- // DESCRIPTION: Returns current resource usage details: memory, CPU, etc.
- //
- // ARGUMENTS:
- // pPerfData - Returns the performance data structure.
- //
- STDMETHOD_(void, GetPerformanceData) (THIS_ __out XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
-
- // NAME: IXAudio2::SetDebugConfiguration
- // DESCRIPTION: Configures XAudio2's debug output (in debug builds only).
- //
- // ARGUMENTS:
- // pDebugConfiguration - Structure describing the debug output behavior.
- // pReserved - Optional parameter; must be NULL.
- //
- STDMETHOD_(void, SetDebugConfiguration) (THIS_ __in_opt const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
- __in_opt __reserved void* pReserved X2DEFAULT(NULL)) PURE;
-};
-
-
-/**************************************************************************
- *
- * IXAudio2Voice: Base voice management interface.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2Voice
-DECLARE_INTERFACE(IXAudio2Voice)
-{
- // These methods are declared in a macro so that the same declarations
- // can be used in the derived voice types (IXAudio2SourceVoice, etc).
-
- #define Declare_IXAudio2Voice_Methods() \
- \
- /* NAME: IXAudio2Voice::GetVoiceDetails
- // DESCRIPTION: Returns the basic characteristics of this voice.
- //
- // ARGUMENTS:
- // pVoiceDetails - Returns the voice's details.
- */\
- STDMETHOD_(void, GetVoiceDetails) (THIS_ __out XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \
- \
- /* NAME: IXAudio2Voice::SetOutputVoices
- // DESCRIPTION: Replaces the set of submix/mastering voices that receive
- // this voice's output.
- //
- // ARGUMENTS:
- // pSendList - Optional list of voices this voice should send audio to.
- */\
- STDMETHOD(SetOutputVoices) (THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; \
- \
- /* NAME: IXAudio2Voice::SetEffectChain
- // DESCRIPTION: Replaces this voice's current effect chain with a new one.
- //
- // ARGUMENTS:
- // pEffectChain - Structure describing the new effect chain to be used.
- */\
- STDMETHOD(SetEffectChain) (THIS_ __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \
- \
- /* NAME: IXAudio2Voice::EnableEffect
- // DESCRIPTION: Enables an effect in this voice's effect chain.
- //
- // ARGUMENTS:
- // EffectIndex - Index of an effect within this voice's effect chain.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::DisableEffect
- // DESCRIPTION: Disables an effect in this voice's effect chain.
- //
- // ARGUMENTS:
- // EffectIndex - Index of an effect within this voice's effect chain.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetEffectState
- // DESCRIPTION: Returns the running state of an effect.
- //
- // ARGUMENTS:
- // EffectIndex - Index of an effect within this voice's effect chain.
- // pEnabled - Returns the enabled/disabled state of the given effect.
- */\
- STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, __out BOOL* pEnabled) PURE; \
- \
- /* NAME: IXAudio2Voice::SetEffectParameters
- // DESCRIPTION: Sets effect-specific parameters.
- //
- // REMARKS: Unlike IXAPOParameters::SetParameters, this method may
- // be called from any thread. XAudio2 implements
- // appropriate synchronization to copy the parameters to the
- // realtime audio processing thread.
- //
- // ARGUMENTS:
- // EffectIndex - Index of an effect within this voice's effect chain.
- // pParameters - Pointer to an effect-specific parameters block.
- // ParametersByteSize - Size of the pParameters array in bytes.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
- __in_bcount(ParametersByteSize) const void* pParameters, \
- UINT32 ParametersByteSize, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetEffectParameters
- // DESCRIPTION: Obtains the current effect-specific parameters.
- //
- // ARGUMENTS:
- // EffectIndex - Index of an effect within this voice's effect chain.
- // pParameters - Returns the current values of the effect-specific parameters.
- // ParametersByteSize - Size of the pParameters array in bytes.
- */\
- STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \
- __out_bcount(ParametersByteSize) void* pParameters, \
- UINT32 ParametersByteSize) PURE; \
- \
- /* NAME: IXAudio2Voice::SetFilterParameters
- // DESCRIPTION: Sets this voice's filter parameters.
- //
- // ARGUMENTS:
- // pParameters - Pointer to the filter's parameter structure.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetFilterParameters) (THIS_ __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetFilterParameters
- // DESCRIPTION: Returns this voice's current filter parameters.
- //
- // ARGUMENTS:
- // pParameters - Returns the filter parameters.
- */\
- STDMETHOD_(void, GetFilterParameters) (THIS_ __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
- \
- /* NAME: IXAudio2Voice::SetOutputFilterParameters
- // DESCRIPTION: Sets the filter parameters on one of this voice's sends.
- //
- // ARGUMENTS:
- // pDestinationVoice - Destination voice of the send whose filter parameters will be set.
- // pParameters - Pointer to the filter's parameter structure.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
- __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetOutputFilterParameters
- // DESCRIPTION: Returns the filter parameters from one of this voice's sends.
- //
- // ARGUMENTS:
- // pDestinationVoice - Destination voice of the send whose filter parameters will be read.
- // pParameters - Returns the filter parameters.
- */\
- STDMETHOD_(void, GetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
- __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
- \
- /* NAME: IXAudio2Voice::SetVolume
- // DESCRIPTION: Sets this voice's overall volume level.
- //
- // ARGUMENTS:
- // Volume - New overall volume level to be used, as an amplitude factor.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetVolume) (THIS_ float Volume, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetVolume
- // DESCRIPTION: Obtains this voice's current overall volume level.
- //
- // ARGUMENTS:
- // pVolume: Returns the voice's current overall volume level.
- */\
- STDMETHOD_(void, GetVolume) (THIS_ __out float* pVolume) PURE; \
- \
- /* NAME: IXAudio2Voice::SetChannelVolumes
- // DESCRIPTION: Sets this voice's per-channel volume levels.
- //
- // ARGUMENTS:
- // Channels - Used to confirm the voice's channel count.
- // pVolumes - Array of per-channel volume levels to be used.
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, __in_ecount(Channels) const float* pVolumes, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetChannelVolumes
- // DESCRIPTION: Returns this voice's current per-channel volume levels.
- //
- // ARGUMENTS:
- // Channels - Used to confirm the voice's channel count.
- // pVolumes - Returns an array of the current per-channel volume levels.
- */\
- STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, __out_ecount(Channels) float* pVolumes) PURE; \
- \
- /* NAME: IXAudio2Voice::SetOutputMatrix
- // DESCRIPTION: Sets the volume levels used to mix from each channel of this
- // voice's output audio to each channel of a given destination
- // voice's input audio.
- //
- // ARGUMENTS:
- // pDestinationVoice - The destination voice whose mix matrix to change.
- // SourceChannels - Used to confirm this voice's output channel count
- // (the number of channels produced by the last effect in the chain).
- // DestinationChannels - Confirms the destination voice's input channels.
- // pLevelMatrix - Array of [SourceChannels * DestinationChannels] send
- // levels. The level used to send from source channel S to destination
- // channel D should be in pLevelMatrix[S + SourceChannels * D].
- // OperationSet - Used to identify this call as part of a deferred batch.
- */\
- STDMETHOD(SetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
- UINT32 SourceChannels, UINT32 DestinationChannels, \
- __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix, \
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
- \
- /* NAME: IXAudio2Voice::GetOutputMatrix
- // DESCRIPTION: Obtains the volume levels used to send each channel of this
- // voice's output audio to each channel of a given destination
- // voice's input audio.
- //
- // ARGUMENTS:
- // pDestinationVoice - The destination voice whose mix matrix to obtain.
- // SourceChannels - Used to confirm this voice's output channel count
- // (the number of channels produced by the last effect in the chain).
- // DestinationChannels - Confirms the destination voice's input channels.
- // pLevelMatrix - Array of send levels, as above.
- */\
- STDMETHOD_(void, GetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
- UINT32 SourceChannels, UINT32 DestinationChannels, \
- __out_ecount(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \
- \
- /* NAME: IXAudio2Voice::DestroyVoice
- // DESCRIPTION: Destroys this voice, stopping it if necessary and removing
- // it from the XAudio2 graph.
- */\
- STDMETHOD_(void, DestroyVoice) (THIS) PURE
-
- Declare_IXAudio2Voice_Methods();
-};
-
-
-/**************************************************************************
- *
- * IXAudio2SourceVoice: Source voice management interface.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2SourceVoice
-DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice)
-{
- // Methods from IXAudio2Voice base interface
- Declare_IXAudio2Voice_Methods();
-
- // NAME: IXAudio2SourceVoice::Start
- // DESCRIPTION: Makes this voice start consuming and processing audio.
- //
- // ARGUMENTS:
- // Flags - Flags controlling how the voice should be started.
- // OperationSet - Used to identify this call as part of a deferred batch.
- //
- STDMETHOD(Start) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
-
- // NAME: IXAudio2SourceVoice::Stop
- // DESCRIPTION: Makes this voice stop consuming audio.
- //
- // ARGUMENTS:
- // Flags - Flags controlling how the voice should be stopped.
- // OperationSet - Used to identify this call as part of a deferred batch.
- //
- STDMETHOD(Stop) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
-
- // NAME: IXAudio2SourceVoice::SubmitSourceBuffer
- // DESCRIPTION: Adds a new audio buffer to this voice's input queue.
- //
- // ARGUMENTS:
- // pBuffer - Pointer to the buffer structure to be queued.
- // pBufferWMA - Additional structure used only when submitting XWMA data.
- //
- STDMETHOD(SubmitSourceBuffer) (THIS_ __in const XAUDIO2_BUFFER* pBuffer, __in_opt const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE;
-
- // NAME: IXAudio2SourceVoice::FlushSourceBuffers
- // DESCRIPTION: Removes all pending audio buffers from this voice's queue.
- //
- STDMETHOD(FlushSourceBuffers) (THIS) PURE;
-
- // NAME: IXAudio2SourceVoice::Discontinuity
- // DESCRIPTION: Notifies the voice of an intentional break in the stream of
- // audio buffers (e.g. the end of a sound), to prevent XAudio2
- // from interpreting an empty buffer queue as a glitch.
- //
- STDMETHOD(Discontinuity) (THIS) PURE;
-
- // NAME: IXAudio2SourceVoice::ExitLoop
- // DESCRIPTION: Breaks out of the current loop when its end is reached.
- //
- // ARGUMENTS:
- // OperationSet - Used to identify this call as part of a deferred batch.
- //
- STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
-
- // NAME: IXAudio2SourceVoice::GetState
- // DESCRIPTION: Returns the number of buffers currently queued on this voice,
- // the pContext value associated with the currently processing
- // buffer (if any), and other voice state information.
- //
- // ARGUMENTS:
- // pVoiceState - Returns the state information.
- //
- STDMETHOD_(void, GetState) (THIS_ __out XAUDIO2_VOICE_STATE* pVoiceState) PURE;
-
- // NAME: IXAudio2SourceVoice::SetFrequencyRatio
- // DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch.
- //
- // ARGUMENTS:
- // Ratio - Frequency change, expressed as source frequency / target frequency.
- // OperationSet - Used to identify this call as part of a deferred batch.
- //
- STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio,
- UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
-
- // NAME: IXAudio2SourceVoice::GetFrequencyRatio
- // DESCRIPTION: Returns this voice's current frequency adjustment ratio.
- //
- // ARGUMENTS:
- // pRatio - Returns the frequency adjustment.
- //
- STDMETHOD_(void, GetFrequencyRatio) (THIS_ __out float* pRatio) PURE;
-
- // NAME: IXAudio2SourceVoice::SetSourceSampleRate
- // DESCRIPTION: Reconfigures this voice to treat its source data as being
- // at a different sample rate than the original one specified
- // in CreateSourceVoice's pSourceFormat argument.
- //
- // ARGUMENTS:
- // UINT32 - The intended sample rate of further submitted source data.
- //
- STDMETHOD(SetSourceSampleRate) (THIS_ UINT32 NewSourceSampleRate) PURE;
-};
-
-
-/**************************************************************************
- *
- * IXAudio2SubmixVoice: Submixing voice management interface.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2SubmixVoice
-DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice)
-{
- // Methods from IXAudio2Voice base interface
- Declare_IXAudio2Voice_Methods();
-
- // There are currently no methods specific to submix voices.
-};
-
-
-/**************************************************************************
- *
- * IXAudio2MasteringVoice: Mastering voice management interface.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2MasteringVoice
-DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice)
-{
- // Methods from IXAudio2Voice base interface
- Declare_IXAudio2Voice_Methods();
-
- // There are currently no methods specific to mastering voices.
-};
-
-
-/**************************************************************************
- *
- * IXAudio2EngineCallback: Client notification interface for engine events.
- *
- * REMARKS: Contains methods to notify the client when certain events happen
- * in the XAudio2 engine. This interface should be implemented by
- * the client. XAudio2 will call these methods via the interface
- * pointer provided by the client when it calls XAudio2Create or
- * IXAudio2::Initialize.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2EngineCallback
-DECLARE_INTERFACE(IXAudio2EngineCallback)
-{
- // Called by XAudio2 just before an audio processing pass begins.
- STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE;
-
- // Called just after an audio processing pass ends.
- STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE;
-
- // Called in the event of a critical system error which requires XAudio2
- // to be closed down and restarted. The error code is given in Error.
- STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE;
-};
-
-
-/**************************************************************************
- *
- * IXAudio2VoiceCallback: Client notification interface for voice events.
- *
- * REMARKS: Contains methods to notify the client when certain events happen
- * in an XAudio2 voice. This interface should be implemented by the
- * client. XAudio2 will call these methods via an interface pointer
- * provided by the client in the IXAudio2::CreateSourceVoice call.
- *
- **************************************************************************/
-
-#undef INTERFACE
-#define INTERFACE IXAudio2VoiceCallback
-DECLARE_INTERFACE(IXAudio2VoiceCallback)
-{
- // Called just before this voice's processing pass begins.
- STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
-
- // Called just after this voice's processing pass ends.
- STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
-
- // Called when this voice has just finished playing a buffer stream
- // (as marked with the XAUDIO2_END_OF_STREAM flag on the last buffer).
- STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
-
- // Called when this voice is about to start processing a new buffer.
- STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE;
-
- // Called when this voice has just finished processing a buffer.
- // The buffer can now be reused or destroyed.
- STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE;
-
- // Called when this voice has just reached the end position of a loop.
- STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE;
-
- // Called in the event of a critical error during voice processing,
- // such as a failing xAPO or an error from the hardware XMA decoder.
- // The voice may have to be destroyed and re-created to recover from
- // the error. The callback arguments report which buffer was being
- // processed when the error occurred, and its HRESULT code.
- STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE;
-};
-
-
-/**************************************************************************
- *
- * Macros to make it easier to use the XAudio2 COM interfaces in C code.
- *
- **************************************************************************/
-
-#ifndef __cplusplus
-
-// IXAudio2
-#define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface))
-#define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This))
-#define IXAudio2_Release(This) ((This)->lpVtbl->Release(This))
-#define IXAudio2_GetDeviceCount(This,puCount) ((This)->lpVtbl->GetDeviceCount(This,puCount))
-#define IXAudio2_GetDeviceDetails(This,Index,pDeviceDetails) ((This)->lpVtbl->GetDeviceDetails(This,Index,pDeviceDetails))
-#define IXAudio2_Initialize(This,Flags,XAudio2Processor) ((This)->lpVtbl->Initialize(This,Flags,XAudio2Processor))
-#define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain))
-#define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain))
-#define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain))
-#define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This))
-#define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This))
-#define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet))
-#define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData))
-#define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved))
-
-// IXAudio2Voice
-#define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails))
-#define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList))
-#define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain))
-#define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet))
-#define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet))
-#define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled))
-#define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet))
-#define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize))
-#define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet))
-#define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters))
-#define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet))
-#define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters))
-#define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet))
-#define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume))
-#define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet))
-#define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes))
-#define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet))
-#define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix))
-#define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This))
-
-// IXAudio2SourceVoice
-#define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
-#define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
-#define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain
-#define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect
-#define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect
-#define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState
-#define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
-#define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
-#define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
-#define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
-#define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
-#define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
-#define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume
-#define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume
-#define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
-#define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
-#define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
-#define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
-#define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice
-#define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet))
-#define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet))
-#define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA))
-#define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This))
-#define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This))
-#define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet))
-#define IXAudio2SourceVoice_GetState(This,pVoiceState) ((This)->lpVtbl->GetState(This,pVoiceState))
-#define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet))
-#define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio))
-#define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate))
-
-// IXAudio2SubmixVoice
-#define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
-#define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
-#define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain
-#define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect
-#define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect
-#define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState
-#define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
-#define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
-#define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
-#define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
-#define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
-#define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
-#define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume
-#define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume
-#define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
-#define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
-#define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
-#define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
-#define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice
-
-// IXAudio2MasteringVoice
-#define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
-#define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
-#define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain
-#define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect
-#define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect
-#define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState
-#define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
-#define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
-#define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
-#define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
-#define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
-#define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
-#define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume
-#define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume
-#define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
-#define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
-#define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
-#define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
-#define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice
-
-#endif // #ifndef __cplusplus
-
-
-/**************************************************************************
- *
- * Utility functions used to convert from pitch in semitones and volume
- * in decibels to the frequency and amplitude ratio units used by XAudio2.
- * These are only defined if the client #defines XAUDIO2_HELPER_FUNCTIONS
- * prior to #including xaudio2.h.
- *
- **************************************************************************/
-
-#ifdef XAUDIO2_HELPER_FUNCTIONS
-
-#define _USE_MATH_DEFINES // Make math.h define M_PI
-#include <math.h> // For powf, log10f, sinf and asinf
-
-// Calculate the argument to SetVolume from a decibel value
-__inline float XAudio2DecibelsToAmplitudeRatio(float Decibels)
-{
- return powf(10.0f, Decibels / 20.0f);
-}
-
-// Recover a volume in decibels from an amplitude factor
-__inline float XAudio2AmplitudeRatioToDecibels(float Volume)
-{
- if (Volume == 0)
- {
- return -3.402823466e+38f; // Smallest float value (-FLT_MAX)
- }
- return 20.0f * log10f(Volume);
-}
-
-// Calculate the argument to SetFrequencyRatio from a semitone value
-__inline float XAudio2SemitonesToFrequencyRatio(float Semitones)
-{
- // FrequencyRatio = 2 ^ Octaves
- // = 2 ^ (Semitones / 12)
- return powf(2.0f, Semitones / 12.0f);
-}
-
-// Recover a pitch in semitones from a frequency ratio
-__inline float XAudio2FrequencyRatioToSemitones(float FrequencyRatio)
-{
- // Semitones = 12 * log2(FrequencyRatio)
- // = 12 * log2(10) * log10(FrequencyRatio)
- return 39.86313713864835f * log10f(FrequencyRatio);
-}
-
-// Convert from filter cutoff frequencies expressed in Hertz to the radian
-// frequency values used in XAUDIO2_FILTER_PARAMETERS.Frequency. Note that
-// the highest CutoffFrequency supported is SampleRate/6. Higher values of
-// CutoffFrequency will return XAUDIO2_MAX_FILTER_FREQUENCY.
-__inline float XAudio2CutoffFrequencyToRadians(float CutoffFrequency, UINT32 SampleRate)
-{
- if ((UINT32)(CutoffFrequency * 6.0f) >= SampleRate)
- {
- return XAUDIO2_MAX_FILTER_FREQUENCY;
- }
- return 2.0f * sinf((float)M_PI * CutoffFrequency / SampleRate);
-}
-
-// Convert from radian frequencies back to absolute frequencies in Hertz
-__inline float XAudio2RadiansToCutoffFrequency(float Radians, float SampleRate)
-{
- return SampleRate * asinf(Radians / 2.0f) / (float)M_PI;
-}
-#endif // #ifdef XAUDIO2_HELPER_FUNCTIONS
-
-
-/**************************************************************************
- *
- * XAudio2Create: Top-level function that creates an XAudio2 instance.
- *
- * On Windows this is just an inline function that calls CoCreateInstance
- * and Initialize. The arguments are described above, under Initialize,
- * except that the XAUDIO2_DEBUG_ENGINE flag can be used here to select
- * the debug version of XAudio2.
- *
- * On Xbox, this function is implemented in the XAudio2 library, and the
- * XAUDIO2_DEBUG_ENGINE flag has no effect; the client must explicitly
- * link with the debug version of the library to obtain debug behavior.
- *
- **************************************************************************/
-
-#ifdef _XBOX
-
-STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
- XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR));
-
-#else // Windows
-
-__inline HRESULT XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
- XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR))
-{
- // Instantiate the appropriate XAudio2 engine
- IXAudio2* pXAudio2;
-
- #ifdef __cplusplus
-
- HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? __uuidof(XAudio2_Debug) : __uuidof(XAudio2),
- NULL, CLSCTX_INPROC_SERVER, __uuidof(IXAudio2), (void**)&pXAudio2);
- if (SUCCEEDED(hr))
- {
- hr = pXAudio2->Initialize(Flags, XAudio2Processor);
-
- if (SUCCEEDED(hr))
- {
- *ppXAudio2 = pXAudio2;
- }
- else
- {
- pXAudio2->Release();
- }
- }
-
- #else
-
- HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? &CLSID_XAudio2_Debug : &CLSID_XAudio2,
- NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2);
- if (SUCCEEDED(hr))
- {
- hr = pXAudio2->lpVtbl->Initialize(pXAudio2, Flags, XAudio2Processor);
-
- if (SUCCEEDED(hr))
- {
- *ppXAudio2 = pXAudio2;
- }
- else
- {
- pXAudio2->lpVtbl->Release(pXAudio2);
- }
- }
-
- #endif // #ifdef __cplusplus
-
- return hr;
-}
-
-#endif // #ifdef _XBOX
-
-
-// Undo the #pragma pack(push, 1) directive at the top of this file
-#pragma pack(pop)
-
-#endif // #ifndef GUID_DEFS_ONLY
-#endif // #ifndef __XAUDIO2_INCLUDED__
diff --git a/3rdparty/dxsdk/Include/XAudio2fx.h b/3rdparty/dxsdk/Include/XAudio2fx.h
deleted file mode 100644
index 4284bd249f0..00000000000
--- a/3rdparty/dxsdk/Include/XAudio2fx.h
+++ /dev/null
@@ -1,431 +0,0 @@
-/**************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: xaudio2fx.h
- * Content: Declarations for the audio effects included with XAudio2.
- *
- **************************************************************************/
-
-#ifndef __XAUDIO2FX_INCLUDED__
-#define __XAUDIO2FX_INCLUDED__
-
-
-/**************************************************************************
- *
- * XAudio2 effect class IDs.
- *
- **************************************************************************/
-
-#include "comdecl.h" // For DEFINE_CLSID and DEFINE_IID
-
-// XAudio 2.0 (March 2008 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB);
-//DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63);
-//DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB);
-
-// XAudio 2.1 (June 2008 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2);
-//DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6);
-//DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2);
-
-// XAudio 2.2 (August 2008 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca);
-//DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51);
-//DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29);
-
-// XAudio 2.3 (November 2008 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01);
-//DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c);
-//DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b);
-
-// XAudio 2.4 (March 2009 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5);
-//DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af);
-//DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98);
-
-// XAudio 2.5 (March 2009 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0);
-//DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8);
-//DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72);
-
-// XAudio 2.6 (February 2010 SDK)
-//DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27);
-//DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4);
-//DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d);
-//DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7);
-
-// XAudio 2.7 (June 2010 SDK)
-DEFINE_CLSID(AudioVolumeMeter, cac1105f, 619b, 4d04, 83, 1a, 44, e1, cb, f1, 2d, 57);
-DEFINE_CLSID(AudioVolumeMeter_Debug, 2d9a0f9c, e67b, 4b24, ab, 44, 92, b3, e7, 70, c0, 20);
-DEFINE_CLSID(AudioReverb, 6a93130e, 1d53, 41d1, a9, cf, e7, 58, 80, 0b, b1, 79);
-DEFINE_CLSID(AudioReverb_Debug, c4f82dd4, cb4e, 4ce1, 8b, db, ee, 32, d4, 19, 82, 69);
-
-// Ignore the rest of this header if only the GUID definitions were requested
-#ifndef GUID_DEFS_ONLY
-
-#ifdef _XBOX
- #include <xobjbase.h> // Xbox COM declarations (IUnknown, etc)
-#else
- #include <objbase.h> // Windows COM declarations
-#endif
-#include <math.h> // For log10()
-
-
-// All structures defined in this file should use tight packing
-#pragma pack(push, 1)
-
-
-/**************************************************************************
- *
- * Effect creation functions. On Windows, these are just inline functions
- * that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can
- * be used to select the debug version of the effects. On Xbox, these map
- * to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag
- * is ignored; the application must link with the debug library to use the
- * debug functionality.
- *
- **************************************************************************/
-
-// Use default values for some parameters if building C++ code
-#ifdef __cplusplus
- #define DEFAULT(x) =x
-#else
- #define DEFAULT(x)
-#endif
-
-#define XAUDIO2FX_DEBUG 1 // To select the debug version of an effect
-
-#ifdef _XBOX
-
- STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo);
- STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo);
-
- __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
- {
- return CreateAudioVolumeMeter(ppApo);
- }
-
- __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
- {
- return CreateAudioReverb(ppApo);
- }
-
-#else // Windows
-
- __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
- {
- #ifdef __cplusplus
- return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioVolumeMeter_Debug)
- : __uuidof(AudioVolumeMeter),
- NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo);
- #else
- return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug
- : &CLSID_AudioVolumeMeter,
- NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
- #endif
- }
-
- __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
- {
- #ifdef __cplusplus
- return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioReverb_Debug)
- : __uuidof(AudioReverb),
- NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo);
- #else
- return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug
- : &CLSID_AudioReverb,
- NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
- #endif
- }
-
-#endif // #ifdef _XBOX
-
-
-
-/**************************************************************************
- *
- * Volume meter parameters.
- * The volume meter supports FLOAT32 audio formats and must be used in-place.
- *
- **************************************************************************/
-
-// XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters().
-// The user is responsible for allocating pPeakLevels, pRMSLevels, and
-// initializing ChannelCount accordingly.
-// The volume meter does not support SetEffectParameters().
-typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS
-{
- float* pPeakLevels; // Peak levels table: receives maximum absolute level for each channel
- // over a processing pass; may be NULL if pRMSLevls != NULL,
- // otherwise must have at least ChannelCount elements.
- float* pRMSLevels; // Root mean square levels table: receives RMS level for each channel
- // over a processing pass; may be NULL if pPeakLevels != NULL,
- // otherwise must have at least ChannelCount elements.
- UINT32 ChannelCount; // Number of channels being processed by the volume meter APO
-} XAUDIO2FX_VOLUMEMETER_LEVELS;
-
-
-
-/**************************************************************************
- *
- * Reverb parameters.
- * The reverb supports only FLOAT32 audio with the following channel
- * configurations:
- * Input: Mono Output: Mono
- * Input: Mono Output: 5.1
- * Input: Stereo Output: Stereo
- * Input: Stereo Output: 5.1
- * The framerate must be within [20000, 48000] Hz.
- *
- * When using mono input, delay filters associated with the right channel
- * are not executed. In this case, parameters such as PositionRight and
- * PositionMatrixRight have no effect. This also means the reverb uses
- * less CPU when hosted in a mono submix.
- *
- **************************************************************************/
-
-#define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000
-#define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000
-
-// XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect
-
-typedef struct XAUDIO2FX_REVERB_PARAMETERS
-{
- // ratio of wet (processed) signal to dry (original) signal
- float WetDryMix; // [0, 100] (percentage)
-
- // Delay times
- UINT32 ReflectionsDelay; // [0, 300] in ms
- BYTE ReverbDelay; // [0, 85] in ms
- BYTE RearDelay; // [0, 5] in ms
-
- // Indexed parameters
- BYTE PositionLeft; // [0, 30] no units
- BYTE PositionRight; // [0, 30] no units, ignored when configured to mono
- BYTE PositionMatrixLeft; // [0, 30] no units
- BYTE PositionMatrixRight; // [0, 30] no units, ignored when configured to mono
- BYTE EarlyDiffusion; // [0, 15] no units
- BYTE LateDiffusion; // [0, 15] no units
- BYTE LowEQGain; // [0, 12] no units
- BYTE LowEQCutoff; // [0, 9] no units
- BYTE HighEQGain; // [0, 8] no units
- BYTE HighEQCutoff; // [0, 14] no units
-
- // Direct parameters
- float RoomFilterFreq; // [20, 20000] in Hz
- float RoomFilterMain; // [-100, 0] in dB
- float RoomFilterHF; // [-100, 0] in dB
- float ReflectionsGain; // [-100, 20] in dB
- float ReverbGain; // [-100, 20] in dB
- float DecayTime; // [0.1, inf] in seconds
- float Density; // [0, 100] (percentage)
- float RoomSize; // [1, 100] in feet
-} XAUDIO2FX_REVERB_PARAMETERS;
-
-
-// Maximum, minimum and default values for the parameters above
-#define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX 0.0f
-#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY 0
-#define XAUDIO2FX_REVERB_MIN_REVERB_DELAY 0
-#define XAUDIO2FX_REVERB_MIN_REAR_DELAY 0
-#define XAUDIO2FX_REVERB_MIN_POSITION 0
-#define XAUDIO2FX_REVERB_MIN_DIFFUSION 0
-#define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN 0
-#define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF 0
-#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN 0
-#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF 0
-#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f
-#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f
-#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF -100.0f
-#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN -100.0f
-#define XAUDIO2FX_REVERB_MIN_REVERB_GAIN -100.0f
-#define XAUDIO2FX_REVERB_MIN_DECAY_TIME 0.1f
-#define XAUDIO2FX_REVERB_MIN_DENSITY 0.0f
-#define XAUDIO2FX_REVERB_MIN_ROOM_SIZE 0.0f
-
-#define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX 100.0f
-#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY 300
-#define XAUDIO2FX_REVERB_MAX_REVERB_DELAY 85
-#define XAUDIO2FX_REVERB_MAX_REAR_DELAY 5
-#define XAUDIO2FX_REVERB_MAX_POSITION 30
-#define XAUDIO2FX_REVERB_MAX_DIFFUSION 15
-#define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN 12
-#define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF 9
-#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN 8
-#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF 14
-#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f
-#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f
-#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF 0.0f
-#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN 20.0f
-#define XAUDIO2FX_REVERB_MAX_REVERB_GAIN 20.0f
-#define XAUDIO2FX_REVERB_MAX_DENSITY 100.0f
-#define XAUDIO2FX_REVERB_MAX_ROOM_SIZE 100.0f
-
-#define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX 100.0f
-#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY 5
-#define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY 5
-#define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY 5
-#define XAUDIO2FX_REVERB_DEFAULT_POSITION 6
-#define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX 27
-#define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION 8
-#define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION 8
-#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN 8
-#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4
-#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN 8
-#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4
-#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f
-#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f
-#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f
-#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f
-#define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN 0.0f
-#define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME 1.0f
-#define XAUDIO2FX_REVERB_DEFAULT_DENSITY 100.0f
-#define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE 100.0f
-
-
-// XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard
-
-typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS
-{
- // ratio of wet (processed) signal to dry (original) signal
- float WetDryMix; // [0, 100] (percentage)
-
- // Standard I3DL2 parameters
- INT32 Room; // [-10000, 0] in mB (hundredths of decibels)
- INT32 RoomHF; // [-10000, 0] in mB (hundredths of decibels)
- float RoomRolloffFactor; // [0.0, 10.0]
- float DecayTime; // [0.1, 20.0] in seconds
- float DecayHFRatio; // [0.1, 2.0]
- INT32 Reflections; // [-10000, 1000] in mB (hundredths of decibels)
- float ReflectionsDelay; // [0.0, 0.3] in seconds
- INT32 Reverb; // [-10000, 2000] in mB (hundredths of decibels)
- float ReverbDelay; // [0.0, 0.1] in seconds
- float Diffusion; // [0.0, 100.0] (percentage)
- float Density; // [0.0, 100.0] (percentage)
- float HFReference; // [20.0, 20000.0] in Hz
-} XAUDIO2FX_REVERB_I3DL2_PARAMETERS;
-
-
-// ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters
-
-__inline void ReverbConvertI3DL2ToNative
-(
- __in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2,
- __out XAUDIO2FX_REVERB_PARAMETERS* pNative
-)
-{
- float reflectionsDelay;
- float reverbDelay;
-
- // RoomRolloffFactor is ignored
-
- // These parameters have no equivalent in I3DL2
- pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5
- pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
- pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
- pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
- pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
- pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100
- pNative->LowEQCutoff = 4;
- pNative->HighEQCutoff = 6;
-
- // The rest of the I3DL2 parameters map to the native property set
- pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f;
- pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f;
-
- if (pI3DL2->DecayHFRatio >= 1.0f)
- {
- INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio));
- if (index < -8) index = -8;
- pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8);
- pNative->HighEQGain = 8;
- pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio;
- }
- else
- {
- INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio));
- if (index < -8) index = -8;
- pNative->LowEQGain = 8;
- pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8);
- pNative->DecayTime = pI3DL2->DecayTime;
- }
-
- reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f;
- if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300
- {
- reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1);
- }
- else if (reflectionsDelay <= 1)
- {
- reflectionsDelay = 1;
- }
- pNative->ReflectionsDelay = (UINT32)reflectionsDelay;
-
- reverbDelay = pI3DL2->ReverbDelay * 1000.0f;
- if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85
- {
- reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1);
- }
- pNative->ReverbDelay = (BYTE)reverbDelay;
-
- pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f;
- pNative->ReverbGain = pI3DL2->Reverb / 100.0f;
- pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f);
- pNative->LateDiffusion = pNative->EarlyDiffusion;
- pNative->Density = pI3DL2->Density;
- pNative->RoomFilterFreq = pI3DL2->HFReference;
-
- pNative->WetDryMix = pI3DL2->WetDryMix;
-}
-
-
-/**************************************************************************
- *
- * Standard I3DL2 reverb presets (100% wet).
- *
- **************************************************************************/
-
-#define XAUDIO2FX_I3DL2_PRESET_DEFAULT {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_GENERIC {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_ROOM {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_BATHROOM {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_STONEROOM {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_CAVE {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_ARENA {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_HANGAR {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_HALLWAY {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_ALLEY {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_FOREST {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_CITY {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_QUARRY {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_PLAIN {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_UNDERWATER {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_SMALLROOM {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_LARGEROOM {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_LARGEHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f}
-#define XAUDIO2FX_I3DL2_PRESET_PLATE {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f}
-
-
-// Undo the #pragma pack(push, 1) at the top of this file
-#pragma pack(pop)
-
-#endif // #ifndef GUID_DEFS_ONLY
-#endif // #ifndef __XAUDIO2FX_INCLUDED__
diff --git a/3rdparty/dxsdk/Include/XDSP.h b/3rdparty/dxsdk/Include/XDSP.h
deleted file mode 100644
index 6ed0dc546da..00000000000
--- a/3rdparty/dxsdk/Include/XDSP.h
+++ /dev/null
@@ -1,754 +0,0 @@
-/*-========================================================================-_
- | - XDSP - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |PROJECT: XDSP MODEL: Unmanaged User-mode |
- |VERSION: 1.2 EXCEPT: No Exceptions |
- |CLASS: N / A MINREQ: WinXP, Xbox360 |
- |BASE: N / A DIALECT: MSC++ 14.00 |
- |>------------------------------------------------------------------------<|
- | DUTY: DSP functions with CPU extension specific optimizations |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. Definition of terms:
- DSP: Digital Signal Processing.
- FFT: Fast Fourier Transform.
- Frame: A block of samples, one per channel,
- to be played simultaneously.
-
- 2. All buffer parameters must be 16-byte aligned.
-
- 3. All FFT functions support only FLOAT32 audio. */
-
-#pragma once
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
-#include <windef.h> // general windows types
-#include <math.h> // trigonometric functions
-#if defined(_XBOX) // SIMD intrinsics
- #include <ppcintrinsics.h>
-#else
- #include <emmintrin.h>
-#endif
-
-
-//--------------<M-A-C-R-O-S>-----------------------------------------------//
-// assertion
-#if !defined(DSPASSERT)
- #if DBG
- #define DSPASSERT(exp) if (!(exp)) { OutputDebugStringA("XDSP ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
- #else
- #define DSPASSERT(exp) __assume(exp)
- #endif
-#endif
-
-// true if n is a power of 2
-#if !defined(ISPOWEROF2)
- #define ISPOWEROF2(n) ( ((n)&((n)-1)) == 0 && (n) != 0 )
-#endif
-
-
-//--------------<H-E-L-P-E-R-S>---------------------------------------------//
-namespace XDSP {
-#pragma warning(push)
-#pragma warning(disable: 4328 4640) // disable "indirection alignment of formal parameter", "construction of local static object is not thread-safe" compile warnings
-
-
-// Helper functions, used by the FFT functions.
-// The application need not call them directly.
-
- // primitive types
- typedef __m128 XVECTOR;
- typedef XVECTOR& XVECTORREF;
- typedef const XVECTOR& XVECTORREFC;
-
-
- // Parallel multiplication of four complex numbers, assuming
- // real and imaginary values are stored in separate vectors.
- __forceinline void vmulComplex (__out XVECTORREF rResult, __out XVECTORREF iResult, __in XVECTORREFC r1, __in XVECTORREFC i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
- {
- // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
- XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
- XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
- XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
- XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
- rResult = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
- iResult = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
- }
- __forceinline void vmulComplex (__inout XVECTORREF r1, __inout XVECTORREF i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
- {
- // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
- XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
- XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
- XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
- XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
- r1 = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
- i1 = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
- }
-
-
- // Radix-4 decimation-in-time FFT butterfly.
- // This version assumes that all four elements of the butterfly are
- // adjacent in a single vector.
- //
- // Compute the product of the complex input vector and the
- // 4-element DFT matrix:
- // | 1 1 1 1 | | (r1X,i1X) |
- // | 1 -j -1 j | | (r1Y,i1Y) |
- // | 1 -1 1 -1 | | (r1Z,i1Z) |
- // | 1 j -1 -j | | (r1W,i1W) |
- //
- // This matrix can be decomposed into two simpler ones to reduce the
- // number of additions needed. The decomposed matrices look like this:
- // | 1 0 1 0 | | 1 0 1 0 |
- // | 0 1 0 -j | | 1 0 -1 0 |
- // | 1 0 -1 0 | | 0 1 0 1 |
- // | 0 1 0 j | | 0 1 0 -1 |
- //
- // Combine as follows:
- // | 1 0 1 0 | | (r1X,i1X) | | (r1X + r1Z, i1X + i1Z) |
- // Temp = | 1 0 -1 0 | * | (r1Y,i1Y) | = | (r1X - r1Z, i1X - i1Z) |
- // | 0 1 0 1 | | (r1Z,i1Z) | | (r1Y + r1W, i1Y + i1W) |
- // | 0 1 0 -1 | | (r1W,i1W) | | (r1Y - r1W, i1Y - i1W) |
- //
- // | 1 0 1 0 | | (rTempX,iTempX) | | (rTempX + rTempZ, iTempX + iTempZ) |
- // Result = | 0 1 0 -j | * | (rTempY,iTempY) | = | (rTempY + iTempW, iTempY - rTempW) |
- // | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) |
- // | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) |
- __forceinline void ButterflyDIT4_1 (__inout XVECTORREF r1, __inout XVECTORREF i1)
- {
- // sign constants for radix-4 butterflies
- const static XVECTOR vDFT4SignBits1 = { 0.0f, -0.0f, 0.0f, -0.0f };
- const static XVECTOR vDFT4SignBits2 = { 0.0f, 0.0f, -0.0f, -0.0f };
- const static XVECTOR vDFT4SignBits3 = { 0.0f, -0.0f, -0.0f, 0.0f };
-
-
- // calculating Temp
- XVECTOR rTemp = _mm_add_ps( _mm_shuffle_ps(r1, r1, _MM_SHUFFLE(1, 1, 0, 0)), // [r1X| r1X|r1Y| r1Y] +
- _mm_xor_ps(_mm_shuffle_ps(r1, r1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [r1Z|-r1Z|r1W|-r1W]
- XVECTOR iTemp = _mm_add_ps( _mm_shuffle_ps(i1, i1, _MM_SHUFFLE(1, 1, 0, 0)), // [i1X| i1X|i1Y| i1Y] +
- _mm_xor_ps(_mm_shuffle_ps(i1, i1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [i1Z|-i1Z|i1W|-i1W]
-
- // calculating Result
- XVECTOR rZrWiZiW = _mm_shuffle_ps(rTemp, iTemp, _MM_SHUFFLE(3, 2, 3, 2)); // [rTempZ|rTempW|iTempZ|iTempW]
- XVECTOR rZiWrZiW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(3, 0, 3, 0)); // [rTempZ|iTempW|rTempZ|iTempW]
- XVECTOR iZrWiZrW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(1, 2, 1, 2)); // [rTempZ|iTempW|rTempZ|iTempW]
- r1 = _mm_add_ps( _mm_shuffle_ps(rTemp, rTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [rTempX| rTempY| rTempX| rTempY] +
- _mm_xor_ps(rZiWrZiW, vDFT4SignBits2) ); // [rTempZ| iTempW|-rTempZ|-iTempW]
- i1 = _mm_add_ps( _mm_shuffle_ps(iTemp, iTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [iTempX| iTempY| iTempX| iTempY] +
- _mm_xor_ps(iZrWiZrW, vDFT4SignBits3) ); // [iTempZ|-rTempW|-iTempZ| rTempW]
- }
-
- // Radix-4 decimation-in-time FFT butterfly.
- // This version assumes that elements of the butterfly are
- // in different vectors, so that each vector in the input
- // contains elements from four different butterflies.
- // The four separate butterflies are processed in parallel.
- //
- // The calculations here are the same as the ones in the single-vector
- // radix-4 DFT, but instead of being done on a single vector (X,Y,Z,W)
- // they are done in parallel on sixteen independent complex values.
- // There is no interdependence between the vector elements:
- // | 1 0 1 0 | | (rIn0,iIn0) | | (rIn0 + rIn2, iIn0 + iIn2) |
- // | 1 0 -1 0 | * | (rIn1,iIn1) | = Temp = | (rIn0 - rIn2, iIn0 - iIn2) |
- // | 0 1 0 1 | | (rIn2,iIn2) | | (rIn1 + rIn3, iIn1 + iIn3) |
- // | 0 1 0 -1 | | (rIn3,iIn3) | | (rIn1 - rIn3, iIn1 - iIn3) |
- //
- // | 1 0 1 0 | | (rTemp0,iTemp0) | | (rTemp0 + rTemp2, iTemp0 + iTemp2) |
- // Result = | 0 1 0 -j | * | (rTemp1,iTemp1) | = | (rTemp1 + iTemp3, iTemp1 - rTemp3) |
- // | 1 0 -1 0 | | (rTemp2,iTemp2) | | (rTemp0 - rTemp2, iTemp0 - iTemp2) |
- // | 0 1 0 j | | (rTemp3,iTemp3) | | (rTemp1 - iTemp3, iTemp1 + rTemp3) |
- __forceinline void ButterflyDIT4_4 (__inout XVECTORREF r0,
- __inout XVECTORREF r1,
- __inout XVECTORREF r2,
- __inout XVECTORREF r3,
- __inout XVECTORREF i0,
- __inout XVECTORREF i1,
- __inout XVECTORREF i2,
- __inout XVECTORREF i3,
- __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableReal,
- __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableImaginary,
- const UINT32 uStride, const BOOL fLast)
- {
- DSPASSERT(pUnityTableReal != NULL);
- DSPASSERT(pUnityTableImaginary != NULL);
- DSPASSERT((UINT_PTR)pUnityTableReal % 16 == 0);
- DSPASSERT((UINT_PTR)pUnityTableImaginary % 16 == 0);
- DSPASSERT(ISPOWEROF2(uStride));
-
- XVECTOR rTemp0, rTemp1, rTemp2, rTemp3, rTemp4, rTemp5, rTemp6, rTemp7;
- XVECTOR iTemp0, iTemp1, iTemp2, iTemp3, iTemp4, iTemp5, iTemp6, iTemp7;
-
-
- // calculating Temp
- rTemp0 = _mm_add_ps(r0, r2); iTemp0 = _mm_add_ps(i0, i2);
- rTemp2 = _mm_add_ps(r1, r3); iTemp2 = _mm_add_ps(i1, i3);
- rTemp1 = _mm_sub_ps(r0, r2); iTemp1 = _mm_sub_ps(i0, i2);
- rTemp3 = _mm_sub_ps(r1, r3); iTemp3 = _mm_sub_ps(i1, i3);
- rTemp4 = _mm_add_ps(rTemp0, rTemp2); iTemp4 = _mm_add_ps(iTemp0, iTemp2);
- rTemp5 = _mm_add_ps(rTemp1, iTemp3); iTemp5 = _mm_sub_ps(iTemp1, rTemp3);
- rTemp6 = _mm_sub_ps(rTemp0, rTemp2); iTemp6 = _mm_sub_ps(iTemp0, iTemp2);
- rTemp7 = _mm_sub_ps(rTemp1, iTemp3); iTemp7 = _mm_add_ps(iTemp1, rTemp3);
-
- // calculating Result
- // vmulComplex(rTemp0, iTemp0, rTemp0, iTemp0, pUnityTableReal[0], pUnityTableImaginary[0]); // first one is always trivial
- vmulComplex(rTemp5, iTemp5, pUnityTableReal[uStride], pUnityTableImaginary[uStride]);
- vmulComplex(rTemp6, iTemp6, pUnityTableReal[uStride*2], pUnityTableImaginary[uStride*2]);
- vmulComplex(rTemp7, iTemp7, pUnityTableReal[uStride*3], pUnityTableImaginary[uStride*3]);
- if (fLast) {
- ButterflyDIT4_1(rTemp4, iTemp4);
- ButterflyDIT4_1(rTemp5, iTemp5);
- ButterflyDIT4_1(rTemp6, iTemp6);
- ButterflyDIT4_1(rTemp7, iTemp7);
- }
-
-
- r0 = rTemp4; i0 = iTemp4;
- r1 = rTemp5; i1 = iTemp5;
- r2 = rTemp6; i2 = iTemp6;
- r3 = rTemp7; i3 = iTemp7;
- }
-
-//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
-
- ////
- // DESCRIPTION:
- // 4-sample FFT.
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least uCount elements
- // pImaginary - [inout] imaginary components, must have at least uCount elements
- // uCount - [in] number of FFT iterations
- //
- // RETURN VALUE:
- // void
- ////
- __forceinline void FFT4 (__inout_ecount(uCount) XVECTOR* __restrict pReal, __inout_ecount(uCount) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
- {
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT(ISPOWEROF2(uCount));
-
- for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
- ButterflyDIT4_1(pReal[uIndex], pImaginary[uIndex]);
- }
- }
-
-
-
- ////
- // DESCRIPTION:
- // 8-sample FFT.
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least uCount*2 elements
- // pImaginary - [inout] imaginary components, must have at least uCount*2 elements
- // uCount - [in] number of FFT iterations
- //
- // RETURN VALUE:
- // void
- ////
- __forceinline void FFT8 (__inout_ecount(uCount*2) XVECTOR* __restrict pReal, __inout_ecount(uCount*2) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
- {
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT(ISPOWEROF2(uCount));
-
- static XVECTOR wr1 = { 1.0f, 0.70710677f, 0.0f, -0.70710677f };
- static XVECTOR wi1 = { 0.0f, -0.70710677f, -1.0f, -0.70710677f };
- static XVECTOR wr2 = { -1.0f, -0.70710677f, 0.0f, 0.70710677f };
- static XVECTOR wi2 = { 0.0f, 0.70710677f, 1.0f, 0.70710677f };
-
-
- for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
- XVECTOR* __restrict pR = pReal + uIndex*2;
- XVECTOR* __restrict pI = pImaginary + uIndex*2;
-
- XVECTOR oddsR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(3, 1, 3, 1));
- XVECTOR evensR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(2, 0, 2, 0));
- XVECTOR oddsI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(3, 1, 3, 1));
- XVECTOR evensI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(2, 0, 2, 0));
- ButterflyDIT4_1(oddsR, oddsI);
- ButterflyDIT4_1(evensR, evensI);
-
- XVECTOR r, i;
- vmulComplex(r, i, oddsR, oddsI, wr1, wi1);
- pR[0] = _mm_add_ps(evensR, r);
- pI[0] = _mm_add_ps(evensI, i);
-
- vmulComplex(r, i, oddsR, oddsI, wr2, wi2);
- pR[1] = _mm_add_ps(evensR, r);
- pI[1] = _mm_add_ps(evensI, i);
- }
- }
-
-
-
- ////
- // DESCRIPTION:
- // 16-sample FFT.
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least uCount*4 elements
- // pImaginary - [inout] imaginary components, must have at least uCount*4 elements
- // uCount - [in] number of FFT iterations
- //
- // RETURN VALUE:
- // void
- ////
- __forceinline void FFT16 (__inout_ecount(uCount*4) XVECTOR* __restrict pReal, __inout_ecount(uCount*4) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
- {
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT(ISPOWEROF2(uCount));
-
- XVECTOR aUnityTableReal[4] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.92387950f, 0.70710677f, 0.38268343f, 1.0f, 0.70710677f, -4.3711388e-008f, -0.70710677f, 1.0f, 0.38268343f, -0.70710677f, -0.92387950f };
- XVECTOR aUnityTableImaginary[4] = { -0.0f, -0.0f, -0.0f, -0.0f, -0.0f, -0.38268343f, -0.70710677f, -0.92387950f, -0.0f, -0.70710677f, -1.0f, -0.70710677f, -0.0f, -0.92387950f, -0.70710677f, 0.38268343f };
-
-
- for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
- ButterflyDIT4_4(pReal[uIndex*4],
- pReal[uIndex*4 + 1],
- pReal[uIndex*4 + 2],
- pReal[uIndex*4 + 3],
- pImaginary[uIndex*4],
- pImaginary[uIndex*4 + 1],
- pImaginary[uIndex*4 + 2],
- pImaginary[uIndex*4 + 3],
- aUnityTableReal,
- aUnityTableImaginary,
- 1, TRUE);
- }
- }
-
-
-
- ////
- // DESCRIPTION:
- // 2^N-sample FFT.
- //
- // REMARKS:
- // For FFTs length 16 and below, call FFT16(), FFT8(), or FFT4().
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least (uLength*uCount)/4 elements
- // pImaginary - [inout] imaginary components, must have at least (uLength*uCount)/4 elements
- // pUnityTable - [in] unity table, must have at least uLength*uCount elements, see FFTInitializeUnityTable()
- // uLength - [in] FFT length in samples, must be a power of 2 > 16
- // uCount - [in] number of FFT iterations
- //
- // RETURN VALUE:
- // void
- ////
- inline void FFT (__inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pReal, __inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(uLength*uCount) const XVECTOR* __restrict pUnityTable, const UINT32 uLength, const UINT32 uCount=1)
- {
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT(pUnityTable != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
- DSPASSERT(uLength > 16);
- DSPASSERT(ISPOWEROF2(uLength));
- DSPASSERT(ISPOWEROF2(uCount));
-
- const XVECTOR* __restrict pUnityTableReal = pUnityTable;
- const XVECTOR* __restrict pUnityTableImaginary = pUnityTable + (uLength>>2);
- const UINT32 uTotal = uCount * uLength;
- const UINT32 uTotal_vectors = uTotal >> 2;
- const UINT32 uStage_vectors = uLength >> 2;
- const UINT32 uStage_vectors_mask = uStage_vectors - 1;
- const UINT32 uStride = uLength >> 4; // stride between butterfly elements
- const UINT32 uStrideMask = uStride - 1;
- const UINT32 uStride2 = uStride * 2;
- const UINT32 uStride3 = uStride * 3;
- const UINT32 uStrideInvMask = ~uStrideMask;
-
-
- for (UINT32 uIndex=0; uIndex<(uTotal_vectors>>2); ++uIndex) {
- const UINT32 n = ((uIndex & uStrideInvMask) << 2) + (uIndex & uStrideMask);
- ButterflyDIT4_4(pReal[n],
- pReal[n + uStride],
- pReal[n + uStride2],
- pReal[n + uStride3],
- pImaginary[n ],
- pImaginary[n + uStride],
- pImaginary[n + uStride2],
- pImaginary[n + uStride3],
- pUnityTableReal + (n & uStage_vectors_mask),
- pUnityTableImaginary + (n & uStage_vectors_mask),
- uStride, FALSE);
- }
-
-
- if (uLength > 16*4) {
- FFT(pReal, pImaginary, pUnityTable+(uLength>>1), uLength>>2, uCount*4);
- } else if (uLength == 16*4) {
- FFT16(pReal, pImaginary, uCount*4);
- } else if (uLength == 8*4) {
- FFT8(pReal, pImaginary, uCount*4);
- } else if (uLength == 4*4) {
- FFT4(pReal, pImaginary, uCount*4);
- }
- }
-
-//--------------------------------------------------------------------------//
- ////
- // DESCRIPTION:
- // Initializes unity roots lookup table used by FFT functions.
- // Once initialized, the table need not be initialized again unless a
- // different FFT length is desired.
- //
- // REMARKS:
- // The unity tables of FFT length 16 and below are hard coded into the
- // respective FFT functions and so need not be initialized.
- //
- // PARAMETERS:
- // pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements
- // uLength - [in] FFT length in frames, must be a power of 2 > 16
- //
- // RETURN VALUE:
- // void
- ////
-inline void FFTInitializeUnityTable (__out_ecount(uLength) XVECTOR* __restrict pUnityTable, UINT32 uLength)
-{
- DSPASSERT(pUnityTable != NULL);
- DSPASSERT(uLength > 16);
- DSPASSERT(ISPOWEROF2(uLength));
-
- FLOAT32* __restrict pfUnityTable = (FLOAT32* __restrict)pUnityTable;
-
-
- // initialize unity table for recursive FFT lengths: uLength, uLength/4, uLength/16... > 16
- do {
- FLOAT32 flStep = 6.283185307f / uLength; // 2PI / FFT length
- uLength >>= 2;
-
- // pUnityTable[0 to uLength*4-1] contains real components for current FFT length
- // pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length
- for (UINT32 i=0; i<4; ++i) {
- for (UINT32 j=0; j<uLength; ++j) {
- UINT32 uIndex = (i*uLength) + j;
- pfUnityTable[uIndex] = cosf(FLOAT32(i)*FLOAT32(j)*flStep); // real component
- pfUnityTable[uIndex + uLength*4] = -sinf(FLOAT32(i)*FLOAT32(j)*flStep); // imaginary component
- }
- }
- pfUnityTable += uLength*8;
- } while (uLength > 16);
-}
-
-
- ////
- // DESCRIPTION:
- // The FFT functions generate output in bit reversed order.
- // Use this function to re-arrange them into order of increasing frequency.
- //
- // REMARKS:
- //
- // PARAMETERS:
- // pOutput - [out] output buffer, receives samples in order of increasing frequency, cannot overlap pInput, must have at least (1<<uLog2Length)/4 elements
- // pInput - [in] input buffer, samples in bit reversed order as generated by FFT functions, cannot overlap pOutput, must have at least (1<<uLog2Length)/4 elements
- // uLog2Length - [in] LOG (base 2) of FFT length in samples, must be >= 2
- //
- // RETURN VALUE:
- // void
- ////
-inline void FFTUnswizzle (__out_ecount((1<<uLog2Length)/4) XVECTOR* __restrict pOutput, __in_ecount((1<<uLog2Length)/4) const XVECTOR* __restrict pInput, const UINT32 uLog2Length)
-{
- DSPASSERT(pOutput != NULL);
- DSPASSERT(pInput != NULL);
- DSPASSERT(uLog2Length >= 2);
-
- FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
- const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
- const UINT32 uLength = UINT32(1 << uLog2Length);
-
-
- if ((uLog2Length & 0x1) == 0) {
- // even powers of two
- for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
- UINT32 n = uIndex;
- n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
- n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
- n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
- n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
- n >>= (32 - uLog2Length);
- pfOutput[n] = pfInput[uIndex];
- }
- } else {
- // odd powers of two
- for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
- UINT32 n = (uIndex>>3);
- n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
- n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
- n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
- n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
- n >>= (32 - (uLog2Length-3));
- n |= ((uIndex & 0x7) << (uLog2Length - 3));
- pfOutput[n] = pfInput[uIndex];
- }
- }
-}
-
-
- ////
- // DESCRIPTION:
- // Convert complex components to polar form.
- //
- // PARAMETERS:
- // pOutput - [out] output buffer, receives samples in polar form, must have at least uLength/4 elements
- // pInputReal - [in] input buffer (real components), must have at least uLength/4 elements
- // pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements
- // uLength - [in] FFT length in samples, must be a power of 2 >= 4
- //
- // RETURN VALUE:
- // void
- ////
-inline void FFTPolar (__out_ecount(uLength/4) XVECTOR* __restrict pOutput, __in_ecount(uLength/4) const XVECTOR* __restrict pInputReal, __in_ecount(uLength/4) const XVECTOR* __restrict pInputImaginary, const UINT32 uLength)
-{
- DSPASSERT(pOutput != NULL);
- DSPASSERT(pInputReal != NULL);
- DSPASSERT(pInputImaginary != NULL);
- DSPASSERT(uLength >= 4);
- DSPASSERT(ISPOWEROF2(uLength));
-
- FLOAT32 flOneOverLength = 1.0f / uLength;
-
-
- // result = sqrtf((real/uLength)^2 + (imaginary/uLength)^2) * 2
- XVECTOR vOneOverLength = _mm_set_ps1(flOneOverLength);
-
- for (UINT32 uIndex=0; uIndex<(uLength>>2); ++uIndex) {
- XVECTOR vReal = _mm_mul_ps(pInputReal[uIndex], vOneOverLength);
- XVECTOR vImaginary = _mm_mul_ps(pInputImaginary[uIndex], vOneOverLength);
- XVECTOR vRR = _mm_mul_ps(vReal, vReal);
- XVECTOR vII = _mm_mul_ps(vImaginary, vImaginary);
- XVECTOR vRRplusII = _mm_add_ps(vRR, vII);
- XVECTOR vTotal = _mm_sqrt_ps(vRRplusII);
- pOutput[uIndex] = _mm_add_ps(vTotal, vTotal);
- }
-}
-
-
-
-
-
-//--------------------------------------------------------------------------//
- ////
- // DESCRIPTION:
- // Deinterleaves audio samples such that all samples corresponding to
-
- //
- // REMARKS:
- // For example, audio of the form [LRLRLR] becomes [LLLRRR].
- //
- // PARAMETERS:
- // pOutput - [out] output buffer, receives samples in deinterleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
- // pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
- // uChannelCount - [in] number of channels, must be > 1
- // uFrameCount - [in] number of frames of valid data, must be > 0
- //
- // RETURN VALUE:
- // void
- ////
-inline void Deinterleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
-{
- DSPASSERT(pOutput != NULL);
- DSPASSERT(pInput != NULL);
- DSPASSERT(uChannelCount > 1);
- DSPASSERT(uFrameCount > 0);
-
- FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
- const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
-
-
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
- pfOutput[uChannel * uFrameCount + uFrame] = pfInput[uFrame * uChannelCount + uChannel];
- }
- }
-}
-
-
- ////
- // DESCRIPTION:
- // Interleaves audio samples such that all samples corresponding to
-
- //
- // REMARKS:
- // For example, audio of the form [LLLRRR] becomes [LRLRLR].
- //
- // PARAMETERS:
- // pOutput - [out] output buffer, receives samples in interleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
- // pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
- // uChannelCount - [in] number of channels, must be > 1
- // uFrameCount - [in] number of frames of valid data, must be > 0
- //
- // RETURN VALUE:
- // void
- ////
-inline void Interleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
-{
- DSPASSERT(pOutput != NULL);
- DSPASSERT(pInput != NULL);
- DSPASSERT(uChannelCount > 1);
- DSPASSERT(uFrameCount > 0);
-
- FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
- const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
-
-
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
- pfOutput[uFrame * uChannelCount + uChannel] = pfInput[uChannel * uFrameCount + uFrame];
- }
- }
-}
-
-
-
-
-
-//--------------------------------------------------------------------------//
- ////
- // DESCRIPTION:
- // This function applies a 2^N-sample FFT and unswizzles the result such
- // that the samples are in order of increasing frequency.
- // Audio is first deinterleaved if multichannel.
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
- // pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
- // pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
- // uChannelCount - [in] number of channels, must be within [1, 6]
- // uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 9]
- //
- // RETURN VALUE:
- // void
- ////
-inline void FFTInterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
-{
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT(pUnityTable != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
- DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
- DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
-
- XVECTOR vRealTemp[768];
- XVECTOR vImaginaryTemp[768];
- const UINT32 uLength = UINT32(1 << uLog2Length);
-
-
- if (uChannelCount > 1) {
- Deinterleave(vRealTemp, pReal, uChannelCount, uLength);
- } else {
- CopyMemory(vRealTemp, pReal, (uLength>>2)*sizeof(XVECTOR));
- }
- for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
- vImaginaryTemp[u] = _mm_setzero_ps();
- }
-
- if (uLength > 16) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
- }
- } else if (uLength == 16) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- } else if (uLength == 8) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- } else if (uLength == 4) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- }
-
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFTUnswizzle(&pReal[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
- FFTUnswizzle(&pImaginary[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], uLog2Length);
- }
-}
-
-
- ////
- // DESCRIPTION:
- // This function applies a 2^N-sample inverse FFT.
- // Audio is interleaved if multichannel.
- //
- // PARAMETERS:
- // pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
- // pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
- // pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
- // uChannelCount - [in] number of channels, must be > 0
- // uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 10]
- //
- // RETURN VALUE:
- // void
- ////
-inline void IFFTDeinterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
-{
- DSPASSERT(pReal != NULL);
- DSPASSERT(pImaginary != NULL);
- DSPASSERT(pUnityTable != NULL);
- DSPASSERT((UINT_PTR)pReal % 16 == 0);
- DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
- DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
- DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
- DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
-
- XVECTOR vRealTemp[768];
- XVECTOR vImaginaryTemp[768];
- const UINT32 uLength = UINT32(1 << uLog2Length);
-
-
- const XVECTOR vRnp = _mm_set_ps1(1.0f/uLength);
- const XVECTOR vRnm = _mm_set_ps1(-1.0f/uLength);
- for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
- vRealTemp[u] = _mm_mul_ps(pReal[u], vRnp);
- vImaginaryTemp[u] = _mm_mul_ps(pImaginary[u], vRnm);
- }
-
- if (uLength > 16) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
- }
- } else if (uLength == 16) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- } else if (uLength == 8) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- } else if (uLength == 4) {
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
- }
- }
-
- for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
- FFTUnswizzle(&vImaginaryTemp[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
- }
- if (uChannelCount > 1) {
- Interleave(pReal, vImaginaryTemp, uChannelCount, uLength);
- } else {
- CopyMemory(pReal, vImaginaryTemp, (uLength>>2)*sizeof(XVECTOR));
- }
-}
-
-
-#pragma warning(pop)
-}; // namespace XDSP
-//---------------------------------<-EOF->----------------------------------//
-
diff --git a/3rdparty/dxsdk/Include/XInput.h b/3rdparty/dxsdk/Include/XInput.h
deleted file mode 100644
index c50a5cb321b..00000000000
--- a/3rdparty/dxsdk/Include/XInput.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/***************************************************************************
-* *
-* XInput.h -- This module defines XBOX controller APIs *
-* and constansts for the Windows platform. *
-* *
-* Copyright (c) Microsoft Corp. All rights reserved. *
-* *
-***************************************************************************/
-#ifndef _XINPUT_H_
-#define _XINPUT_H_
-
-#include <windef.h>
-
-// Current name of the DLL shipped in the same SDK as this header.
-// The name reflects the current version
-#ifndef XINPUT_USE_9_1_0
-#define XINPUT_DLL_A "xinput1_3.dll"
-#define XINPUT_DLL_W L"xinput1_3.dll"
-#else
-#define XINPUT_DLL_A "xinput9_1_0.dll"
-#define XINPUT_DLL_W L"xinput9_1_0.dll"
-#endif
-#ifdef UNICODE
- #define XINPUT_DLL XINPUT_DLL_W
-#else
- #define XINPUT_DLL XINPUT_DLL_A
-#endif
-
-//
-// Device types available in XINPUT_CAPABILITIES
-//
-#define XINPUT_DEVTYPE_GAMEPAD 0x01
-
-//
-// Device subtypes available in XINPUT_CAPABILITIES
-//
-#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01
-
-#ifndef XINPUT_USE_9_1_0
-
-#define XINPUT_DEVSUBTYPE_WHEEL 0x02
-#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03
-#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04
-#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05
-#define XINPUT_DEVSUBTYPE_GUITAR 0x06
-#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08
-
-#endif // !XINPUT_USE_9_1_0
-
-
-
-//
-// Flags for XINPUT_CAPABILITIES
-//
-#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004
-
-//
-// Constants for gamepad buttons
-//
-#define XINPUT_GAMEPAD_DPAD_UP 0x0001
-#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
-#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004
-#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
-#define XINPUT_GAMEPAD_START 0x0010
-#define XINPUT_GAMEPAD_BACK 0x0020
-#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040
-#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
-#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
-#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
-#define XINPUT_GAMEPAD_A 0x1000
-#define XINPUT_GAMEPAD_B 0x2000
-#define XINPUT_GAMEPAD_X 0x4000
-#define XINPUT_GAMEPAD_Y 0x8000
-
-
-//
-// Gamepad thresholds
-//
-#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849
-#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
-#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30
-
-//
-// Flags to pass to XInputGetCapabilities
-//
-#define XINPUT_FLAG_GAMEPAD 0x00000001
-
-
-#ifndef XINPUT_USE_9_1_0
-
-//
-// Devices that support batteries
-//
-#define BATTERY_DEVTYPE_GAMEPAD 0x00
-#define BATTERY_DEVTYPE_HEADSET 0x01
-
-//
-// Flags for battery status level
-//
-#define BATTERY_TYPE_DISCONNECTED 0x00 // This device is not connected
-#define BATTERY_TYPE_WIRED 0x01 // Wired device, no battery
-#define BATTERY_TYPE_ALKALINE 0x02 // Alkaline battery source
-#define BATTERY_TYPE_NIMH 0x03 // Nickel Metal Hydride battery source
-#define BATTERY_TYPE_UNKNOWN 0xFF // Cannot determine the battery type
-
-// These are only valid for wireless, connected devices, with known battery types
-// The amount of use time remaining depends on the type of device.
-#define BATTERY_LEVEL_EMPTY 0x00
-#define BATTERY_LEVEL_LOW 0x01
-#define BATTERY_LEVEL_MEDIUM 0x02
-#define BATTERY_LEVEL_FULL 0x03
-
-// User index definitions
-#define XUSER_MAX_COUNT 4
-
-#define XUSER_INDEX_ANY 0x000000FF
-
-
-//
-// Codes returned for the gamepad keystroke
-//
-
-#define VK_PAD_A 0x5800
-#define VK_PAD_B 0x5801
-#define VK_PAD_X 0x5802
-#define VK_PAD_Y 0x5803
-#define VK_PAD_RSHOULDER 0x5804
-#define VK_PAD_LSHOULDER 0x5805
-#define VK_PAD_LTRIGGER 0x5806
-#define VK_PAD_RTRIGGER 0x5807
-
-#define VK_PAD_DPAD_UP 0x5810
-#define VK_PAD_DPAD_DOWN 0x5811
-#define VK_PAD_DPAD_LEFT 0x5812
-#define VK_PAD_DPAD_RIGHT 0x5813
-#define VK_PAD_START 0x5814
-#define VK_PAD_BACK 0x5815
-#define VK_PAD_LTHUMB_PRESS 0x5816
-#define VK_PAD_RTHUMB_PRESS 0x5817
-
-#define VK_PAD_LTHUMB_UP 0x5820
-#define VK_PAD_LTHUMB_DOWN 0x5821
-#define VK_PAD_LTHUMB_RIGHT 0x5822
-#define VK_PAD_LTHUMB_LEFT 0x5823
-#define VK_PAD_LTHUMB_UPLEFT 0x5824
-#define VK_PAD_LTHUMB_UPRIGHT 0x5825
-#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826
-#define VK_PAD_LTHUMB_DOWNLEFT 0x5827
-
-#define VK_PAD_RTHUMB_UP 0x5830
-#define VK_PAD_RTHUMB_DOWN 0x5831
-#define VK_PAD_RTHUMB_RIGHT 0x5832
-#define VK_PAD_RTHUMB_LEFT 0x5833
-#define VK_PAD_RTHUMB_UPLEFT 0x5834
-#define VK_PAD_RTHUMB_UPRIGHT 0x5835
-#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836
-#define VK_PAD_RTHUMB_DOWNLEFT 0x5837
-
-//
-// Flags used in XINPUT_KEYSTROKE
-//
-#define XINPUT_KEYSTROKE_KEYDOWN 0x0001
-#define XINPUT_KEYSTROKE_KEYUP 0x0002
-#define XINPUT_KEYSTROKE_REPEAT 0x0004
-
-#endif //!XINPUT_USE_9_1_0
-
-//
-// Structures used by XInput APIs
-//
-typedef struct _XINPUT_GAMEPAD
-{
- WORD wButtons;
- BYTE bLeftTrigger;
- BYTE bRightTrigger;
- SHORT sThumbLX;
- SHORT sThumbLY;
- SHORT sThumbRX;
- SHORT sThumbRY;
-} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
-
-typedef struct _XINPUT_STATE
-{
- DWORD dwPacketNumber;
- XINPUT_GAMEPAD Gamepad;
-} XINPUT_STATE, *PXINPUT_STATE;
-
-typedef struct _XINPUT_VIBRATION
-{
- WORD wLeftMotorSpeed;
- WORD wRightMotorSpeed;
-} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
-
-typedef struct _XINPUT_CAPABILITIES
-{
- BYTE Type;
- BYTE SubType;
- WORD Flags;
- XINPUT_GAMEPAD Gamepad;
- XINPUT_VIBRATION Vibration;
-} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
-
-#ifndef XINPUT_USE_9_1_0
-
-typedef struct _XINPUT_BATTERY_INFORMATION
-{
- BYTE BatteryType;
- BYTE BatteryLevel;
-} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
-
-typedef struct _XINPUT_KEYSTROKE
-{
- WORD VirtualKey;
- WCHAR Unicode;
- WORD Flags;
- BYTE UserIndex;
- BYTE HidCode;
-} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
-
-#endif // !XINPUT_USE_9_1_0
-
-//
-// XInput APIs
-//
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-DWORD WINAPI XInputGetState
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __out XINPUT_STATE* pState // Receives the current state
-);
-
-DWORD WINAPI XInputSetState
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller
-);
-
-DWORD WINAPI XInputGetCapabilities
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __in DWORD dwFlags, // Input flags that identify the device type
- __out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities
-);
-
-void WINAPI XInputEnable
-(
- __in BOOL enable // [in] Indicates whether xinput is enabled or disabled.
-);
-
-DWORD WINAPI XInputGetDSoundAudioDeviceGuids
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __out GUID* pDSoundRenderGuid, // DSound device ID for render
- __out GUID* pDSoundCaptureGuid // DSound device ID for capture
-);
-
-#ifndef XINPUT_USE_9_1_0
-
-DWORD WINAPI XInputGetBatteryInformation
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __in BYTE devType, // Which device on this user index
- __out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries
-);
-
-DWORD WINAPI XInputGetKeystroke
-(
- __in DWORD dwUserIndex, // Index of the gamer associated with the device
- __reserved DWORD dwReserved, // Reserved for future use
- __out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event.
-);
-
-#endif //!XINPUT_USE_9_1_0
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //_XINPUT_H_
-
diff --git a/3rdparty/dxsdk/Include/audiodefs.h b/3rdparty/dxsdk/Include/audiodefs.h
deleted file mode 100644
index ff995ecc7d3..00000000000
--- a/3rdparty/dxsdk/Include/audiodefs.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/***************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: audiodefs.h
- * Content: Basic constants and data types for audio work.
- *
- * Remarks: This header file defines all of the audio format constants and
- * structures required for XAudio2 and XACT work. Providing these
- * in a single location avoids certain dependency problems in the
- * legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h).
- *
- * NOTE: Including the legacy headers after this one may cause a
- * compilation error, because they define some of the same types
- * defined here without preprocessor guards to avoid multiple
- * definitions. If a source file needs one of the old headers,
- * it must include it before including audiodefs.h.
- *
- ***************************************************************************/
-
-#ifndef __AUDIODEFS_INCLUDED__
-#define __AUDIODEFS_INCLUDED__
-
-#include <windef.h> // For WORD, DWORD, etc.
-
-#pragma pack(push, 1) // Pack structures to 1-byte boundaries
-
-
-/**************************************************************************
- *
- * WAVEFORMATEX: Base structure for many audio formats. Format-specific
- * extensions can be defined for particular formats by using a non-zero
- * cbSize value and adding extra fields to the end of this structure.
- *
- ***************************************************************************/
-
-#ifndef _WAVEFORMATEX_
-
- #define _WAVEFORMATEX_
- typedef struct tWAVEFORMATEX
- {
- WORD wFormatTag; // Integer identifier of the format
- WORD nChannels; // Number of audio channels
- DWORD nSamplesPerSec; // Audio sample rate
- DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate)
- WORD nBlockAlign; // Size in bytes of a sample block (all channels)
- WORD wBitsPerSample; // Size in bits of a single per-channel sample
- WORD cbSize; // Bytes of extra data appended to this struct
- } WAVEFORMATEX;
-
-#endif
-
-// Defining pointer types outside of the #if block to make sure they are
-// defined even if mmreg.h or mmsystem.h is #included before this file
-
-typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
-typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX;
-
-
-/**************************************************************************
- *
- * WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be
- * used as a basis for all new audio formats. The format tag is replaced
- * with a GUID, allowing new formats to be defined without registering a
- * format tag with Microsoft. There are also new fields that can be used
- * to specify the spatial positions for each channel and the bit packing
- * used for wide samples (e.g. 24-bit PCM samples in 32-bit containers).
- *
- ***************************************************************************/
-
-#ifndef _WAVEFORMATEXTENSIBLE_
-
- #define _WAVEFORMATEXTENSIBLE_
- typedef struct
- {
- WAVEFORMATEX Format; // Base WAVEFORMATEX data
- union
- {
- WORD wValidBitsPerSample; // Valid bits in each sample container
- WORD wSamplesPerBlock; // Samples per block of audio data; valid
- // if wBitsPerSample=0 (but rarely used).
- WORD wReserved; // Zero if neither case above applies.
- } Samples;
- DWORD dwChannelMask; // Positions of the audio channels
- GUID SubFormat; // Format identifier GUID
- } WAVEFORMATEXTENSIBLE;
-
-#endif
-
-typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE;
-typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE;
-
-
-
-/**************************************************************************
- *
- * Define the most common wave format tags used in WAVEFORMATEX formats.
- *
- ***************************************************************************/
-
-#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation
-
- // If WAVE_FORMAT_PCM is not defined, we need to define some legacy types
- // for compatibility with the Windows mmreg.h / mmsystem.h header files.
-
- // Old general format structure (information common to all formats)
- typedef struct waveformat_tag
- {
- WORD wFormatTag;
- WORD nChannels;
- DWORD nSamplesPerSec;
- DWORD nAvgBytesPerSec;
- WORD nBlockAlign;
- } WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT;
-
- // Specific format structure for PCM data
- typedef struct pcmwaveformat_tag
- {
- WAVEFORMAT wf;
- WORD wBitsPerSample;
- } PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT;
-
- #define WAVE_FORMAT_PCM 0x0001
-
-#endif
-
-#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM
-
- // Replicate the Microsoft ADPCM type definitions from mmreg.h.
-
- typedef struct adpcmcoef_tag
- {
- short iCoef1;
- short iCoef2;
- } ADPCMCOEFSET;
-
- #pragma warning(push)
- #pragma warning(disable:4200) // Disable zero-sized array warnings
-
- typedef struct adpcmwaveformat_tag {
- WAVEFORMATEX wfx;
- WORD wSamplesPerBlock;
- WORD wNumCoef;
- ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM
- } ADPCMWAVEFORMAT;
-
- #pragma warning(pop)
-
- #define WAVE_FORMAT_ADPCM 0x0002
-
-#endif
-
-// Other frequently used format tags
-
-#ifndef WAVE_FORMAT_UNKNOWN
- #define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag
-#endif
-
-#ifndef WAVE_FORMAT_IEEE_FLOAT
- #define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point
-#endif
-
-#ifndef WAVE_FORMAT_MPEGLAYER3
- #define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3
-#endif
-
-#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
- #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF
-#endif
-
-#ifndef WAVE_FORMAT_WMAUDIO2
- #define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio
-#endif
-
-#ifndef WAVE_FORMAT_WMAUDIO3
- #define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro
-#endif
-
-#ifndef WAVE_FORMAT_WMASPDIF
- #define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF
-#endif
-
-#ifndef WAVE_FORMAT_EXTENSIBLE
- #define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats
-#endif
-
-
-/**************************************************************************
- *
- * Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE
- * formats. Note that including the Windows ksmedia.h header after this
- * one will cause build problems; this cannot be avoided, since ksmedia.h
- * defines these macros without preprocessor guards.
- *
- ***************************************************************************/
-
-#ifdef __cplusplus // uuid() and __uuidof() are only available in C++
-
- #ifndef KSDATAFORMAT_SUBTYPE_PCM
- struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT;
- #define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT)
- #endif
-
- #ifndef KSDATAFORMAT_SUBTYPE_ADPCM
- struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT;
- #define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT)
- #endif
-
- #ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
- struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT;
- #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT)
- #endif
-
-#endif
-
-
-/**************************************************************************
- *
- * Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field.
- *
- ***************************************************************************/
-
-#ifndef SPEAKER_FRONT_LEFT
- #define SPEAKER_FRONT_LEFT 0x00000001
- #define SPEAKER_FRONT_RIGHT 0x00000002
- #define SPEAKER_FRONT_CENTER 0x00000004
- #define SPEAKER_LOW_FREQUENCY 0x00000008
- #define SPEAKER_BACK_LEFT 0x00000010
- #define SPEAKER_BACK_RIGHT 0x00000020
- #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
- #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
- #define SPEAKER_BACK_CENTER 0x00000100
- #define SPEAKER_SIDE_LEFT 0x00000200
- #define SPEAKER_SIDE_RIGHT 0x00000400
- #define SPEAKER_TOP_CENTER 0x00000800
- #define SPEAKER_TOP_FRONT_LEFT 0x00001000
- #define SPEAKER_TOP_FRONT_CENTER 0x00002000
- #define SPEAKER_TOP_FRONT_RIGHT 0x00004000
- #define SPEAKER_TOP_BACK_LEFT 0x00008000
- #define SPEAKER_TOP_BACK_CENTER 0x00010000
- #define SPEAKER_TOP_BACK_RIGHT 0x00020000
- #define SPEAKER_RESERVED 0x7FFC0000
- #define SPEAKER_ALL 0x80000000
- #define _SPEAKER_POSITIONS_
-#endif
-
-#ifndef SPEAKER_STEREO
- #define SPEAKER_MONO (SPEAKER_FRONT_CENTER)
- #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
- #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
- #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
- #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
- #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
- #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
- #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
-#endif
-
-
-#pragma pack(pop)
-
-#endif // #ifndef __AUDIODEFS_INCLUDED__
diff --git a/3rdparty/dxsdk/Include/comdecl.h b/3rdparty/dxsdk/Include/comdecl.h
deleted file mode 100644
index 2ae9a961e93..00000000000
--- a/3rdparty/dxsdk/Include/comdecl.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// comdecl.h: Macros to facilitate COM interface and GUID declarations.
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-#ifndef _COMDECL_H_
-#define _COMDECL_H_
-
-#ifndef _XBOX
- #include <basetyps.h> // For standard COM interface macros
-#else
- #pragma warning(push)
- #pragma warning(disable:4061)
- #include <xtl.h> // Required by xobjbase.h
- #include <xobjbase.h> // Special definitions for Xbox build
- #pragma warning(pop)
-#endif
-
-// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to
-// be declared and defined in such a way that clients can obtain the GUIDs using
-// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names.
-// If using the latter approach, the client can also choose whether to get the
-// GUID definitions by defining the INITGUID preprocessor constant or by linking
-// to a GUID library. This works in either C or C++.
-
-#ifdef __cplusplus
-
- #define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
- #ifdef INITGUID
-
- #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
- EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className)
-
- #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
- EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName)
-
- #else // INITGUID
-
- #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
- EXTERN_C const GUID CLSID_##className
-
- #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
- EXTERN_C const GUID IID_##interfaceName
-
- #endif // INITGUID
-
-#else // __cplusplus
-
- #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
-
- #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
- DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
-
-#endif // __cplusplus
-
-#endif // #ifndef _COMDECL_H_
diff --git a/3rdparty/dxsdk/Include/d3d10sdklayers.h b/3rdparty/dxsdk/Include/d3d10sdklayers.h
deleted file mode 100644
index a67471f7114..00000000000
--- a/3rdparty/dxsdk/Include/d3d10sdklayers.h
+++ /dev/null
@@ -1,1363 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 7.00.0555 */
-/* Compiler settings for d3d10sdklayers.idl:
- Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555
- protocol : all , ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-/* @@MIDL_FILE_HEADING( ) */
-
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3d10sdklayers_h__
-#define __d3d10sdklayers_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D10Debug_FWD_DEFINED__
-#define __ID3D10Debug_FWD_DEFINED__
-typedef interface ID3D10Debug ID3D10Debug;
-#endif /* __ID3D10Debug_FWD_DEFINED__ */
-
-
-#ifndef __ID3D10SwitchToRef_FWD_DEFINED__
-#define __ID3D10SwitchToRef_FWD_DEFINED__
-typedef interface ID3D10SwitchToRef ID3D10SwitchToRef;
-#endif /* __ID3D10SwitchToRef_FWD_DEFINED__ */
-
-
-#ifndef __ID3D10InfoQueue_FWD_DEFINED__
-#define __ID3D10InfoQueue_FWD_DEFINED__
-typedef interface ID3D10InfoQueue ID3D10InfoQueue;
-#endif /* __ID3D10InfoQueue_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "dxgi.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3d10sdklayers_0000_0000 */
-/* [local] */
-
-#define D3D10_SDK_LAYERS_VERSION ( 11 )
-
-#define D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 )
-
-#define D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 )
-
-#define D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 )
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D10Debug_INTERFACE_DEFINED__
-#define __ID3D10Debug_INTERFACE_DEFINED__
-
-/* interface ID3D10Debug */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D10Debug;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("9B7E4E01-342C-4106-A19F-4F2704F689F0")
- ID3D10Debug : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
- UINT Mask) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay(
- UINT Milliseconds) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
- /* [annotation] */
- __in_opt IDXGISwapChain *pSwapChain) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetSwapChain(
- /* [annotation] */
- __out IDXGISwapChain **ppSwapChain) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Validate( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D10DebugVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D10Debug * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D10Debug * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D10Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D10Debug * This,
- UINT Mask);
-
- UINT ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D10Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )(
- ID3D10Debug * This,
- UINT Milliseconds);
-
- UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )(
- ID3D10Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetSwapChain )(
- ID3D10Debug * This,
- /* [annotation] */
- __in_opt IDXGISwapChain *pSwapChain);
-
- HRESULT ( STDMETHODCALLTYPE *GetSwapChain )(
- ID3D10Debug * This,
- /* [annotation] */
- __out IDXGISwapChain **ppSwapChain);
-
- HRESULT ( STDMETHODCALLTYPE *Validate )(
- ID3D10Debug * This);
-
- END_INTERFACE
- } ID3D10DebugVtbl;
-
- interface ID3D10Debug
- {
- CONST_VTBL struct ID3D10DebugVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D10Debug_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D10Debug_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D10Debug_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D10Debug_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D10Debug_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-#define ID3D10Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \
- ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) )
-
-#define ID3D10Debug_GetPresentPerRenderOpDelay(This) \
- ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) )
-
-#define ID3D10Debug_SetSwapChain(This,pSwapChain) \
- ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) )
-
-#define ID3D10Debug_GetSwapChain(This,ppSwapChain) \
- ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) )
-
-#define ID3D10Debug_Validate(This) \
- ( (This)->lpVtbl -> Validate(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D10Debug_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D10SwitchToRef_INTERFACE_DEFINED__
-#define __ID3D10SwitchToRef_INTERFACE_DEFINED__
-
-/* interface ID3D10SwitchToRef */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D10SwitchToRef;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("9B7E4E02-342C-4106-A19F-4F2704F689F0")
- ID3D10SwitchToRef : public IUnknown
- {
- public:
- virtual BOOL STDMETHODCALLTYPE SetUseRef(
- BOOL UseRef) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D10SwitchToRefVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D10SwitchToRef * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D10SwitchToRef * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D10SwitchToRef * This);
-
- BOOL ( STDMETHODCALLTYPE *SetUseRef )(
- ID3D10SwitchToRef * This,
- BOOL UseRef);
-
- BOOL ( STDMETHODCALLTYPE *GetUseRef )(
- ID3D10SwitchToRef * This);
-
- END_INTERFACE
- } ID3D10SwitchToRefVtbl;
-
- interface ID3D10SwitchToRef
- {
- CONST_VTBL struct ID3D10SwitchToRefVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D10SwitchToRef_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D10SwitchToRef_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D10SwitchToRef_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D10SwitchToRef_SetUseRef(This,UseRef) \
- ( (This)->lpVtbl -> SetUseRef(This,UseRef) )
-
-#define ID3D10SwitchToRef_GetUseRef(This) \
- ( (This)->lpVtbl -> GetUseRef(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D10SwitchToRef_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d10sdklayers_0000_0002 */
-/* [local] */
-
-typedef
-enum D3D10_MESSAGE_CATEGORY
- { D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
- D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
- D3D10_MESSAGE_CATEGORY_INITIALIZATION = ( D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
- D3D10_MESSAGE_CATEGORY_CLEANUP = ( D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
- D3D10_MESSAGE_CATEGORY_COMPILATION = ( D3D10_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
- D3D10_MESSAGE_CATEGORY_STATE_CREATION = ( D3D10_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
- D3D10_MESSAGE_CATEGORY_STATE_SETTING = ( D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
- D3D10_MESSAGE_CATEGORY_STATE_GETTING = ( D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
- D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
- D3D10_MESSAGE_CATEGORY_EXECUTION = ( D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 )
- } D3D10_MESSAGE_CATEGORY;
-
-typedef
-enum D3D10_MESSAGE_SEVERITY
- { D3D10_MESSAGE_SEVERITY_CORRUPTION = 0,
- D3D10_MESSAGE_SEVERITY_ERROR = ( D3D10_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
- D3D10_MESSAGE_SEVERITY_WARNING = ( D3D10_MESSAGE_SEVERITY_ERROR + 1 ) ,
- D3D10_MESSAGE_SEVERITY_INFO = ( D3D10_MESSAGE_SEVERITY_WARNING + 1 )
- } D3D10_MESSAGE_SEVERITY;
-
-typedef
-enum D3D10_MESSAGE_ID
- { D3D10_MESSAGE_ID_UNKNOWN = 0,
- D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_UNKNOWN + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_THIS = ( D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D10_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
- D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
- D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
- D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) ,
- D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
- D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
- D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
- D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
- D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
- D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) ,
- D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
- D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
- D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
- D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) ,
- D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
- D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
- D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
- D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
- D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
- D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_REF_THREADING_MODE = ( D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
- D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
- D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
- D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
- D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
- D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
- D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
- D3D10_MESSAGE_ID_REF_INFO = ( D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_REF_INFO + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
- D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
- D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) ,
- D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) ,
- D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
- D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) ,
- D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) ,
- D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) ,
- D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
- D3D10_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
- D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000,
- D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) ,
- D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) ,
- D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) ,
- D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) ,
- D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) ,
- D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) ,
- D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) ,
- D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) ,
- D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) ,
- D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) ,
- D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) ,
- D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) ,
- D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) ,
- D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) ,
- D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) ,
- D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) ,
- D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) ,
- D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) ,
- D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) ,
- D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 )
- } D3D10_MESSAGE_ID;
-
-typedef struct D3D10_MESSAGE
- {
- D3D10_MESSAGE_CATEGORY Category;
- D3D10_MESSAGE_SEVERITY Severity;
- D3D10_MESSAGE_ID ID;
- const char *pDescription;
- SIZE_T DescriptionByteLength;
- } D3D10_MESSAGE;
-
-typedef struct D3D10_INFO_QUEUE_FILTER_DESC
- {
- UINT NumCategories;
- D3D10_MESSAGE_CATEGORY *pCategoryList;
- UINT NumSeverities;
- D3D10_MESSAGE_SEVERITY *pSeverityList;
- UINT NumIDs;
- D3D10_MESSAGE_ID *pIDList;
- } D3D10_INFO_QUEUE_FILTER_DESC;
-
-typedef struct D3D10_INFO_QUEUE_FILTER
- {
- D3D10_INFO_QUEUE_FILTER_DESC AllowList;
- D3D10_INFO_QUEUE_FILTER_DESC DenyList;
- } D3D10_INFO_QUEUE_FILTER;
-
-#define D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_s_ifspec;
-
-#ifndef __ID3D10InfoQueue_INTERFACE_DEFINED__
-#define __ID3D10InfoQueue_INTERFACE_DEFINED__
-
-/* interface ID3D10InfoQueue */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D10InfoQueue;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("1b940b17-2642-4d1f-ab1f-b99bad0c395f")
- ID3D10InfoQueue : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
- /* [annotation] */
- __in UINT64 MessageCountLimit) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetMessage(
- /* [annotation] */
- __in UINT64 MessageIndex,
- /* [annotation] */
- __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage,
- /* [annotation] */
- __inout SIZE_T *pMessageByteLength) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddMessage(
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID,
- /* [annotation] */
- __in LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID) = 0;
-
- virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
- /* [annotation] */
- __in BOOL bMute) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D10InfoQueueVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D10InfoQueue * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D10InfoQueue * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in UINT64 MessageCountLimit);
-
- void ( STDMETHODCALLTYPE *ClearStoredMessages )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetMessage )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in UINT64 MessageIndex,
- /* [annotation] */
- __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage,
- /* [annotation] */
- __inout SIZE_T *pMessageByteLength);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
- ID3D10InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
- ID3D10InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
- ID3D10InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
- ID3D10InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
- ID3D10InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearStorageFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopStorageFilter )(
- ID3D10InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
- ID3D10InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
- ID3D10InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddMessage )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID,
- /* [annotation] */
- __in LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID,
- /* [annotation] */
- __in BOOL bEnable);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_CATEGORY Category);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_SEVERITY Severity);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in D3D10_MESSAGE_ID ID);
-
- void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
- ID3D10InfoQueue * This,
- /* [annotation] */
- __in BOOL bMute);
-
- BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
- ID3D10InfoQueue * This);
-
- END_INTERFACE
- } ID3D10InfoQueueVtbl;
-
- interface ID3D10InfoQueue
- {
- CONST_VTBL struct ID3D10InfoQueueVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D10InfoQueue_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D10InfoQueue_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D10InfoQueue_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D10InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
- ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
-
-#define ID3D10InfoQueue_ClearStoredMessages(This) \
- ( (This)->lpVtbl -> ClearStoredMessages(This) )
-
-#define ID3D10InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
- ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
-
-#define ID3D10InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
-
-#define ID3D10InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
-
-#define ID3D10InfoQueue_GetNumStoredMessages(This) \
- ( (This)->lpVtbl -> GetNumStoredMessages(This) )
-
-#define ID3D10InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
- ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
-
-#define ID3D10InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
-
-#define ID3D10InfoQueue_GetMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetMessageCountLimit(This) )
-
-#define ID3D10InfoQueue_AddStorageFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
-
-#define ID3D10InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D10InfoQueue_ClearStorageFilter(This) \
- ( (This)->lpVtbl -> ClearStorageFilter(This) )
-
-#define ID3D10InfoQueue_PushEmptyStorageFilter(This) \
- ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
-
-#define ID3D10InfoQueue_PushCopyOfStorageFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
-
-#define ID3D10InfoQueue_PushStorageFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
-
-#define ID3D10InfoQueue_PopStorageFilter(This) \
- ( (This)->lpVtbl -> PopStorageFilter(This) )
-
-#define ID3D10InfoQueue_GetStorageFilterStackSize(This) \
- ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
-
-#define ID3D10InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
-
-#define ID3D10InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D10InfoQueue_ClearRetrievalFilter(This) \
- ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
-
-#define ID3D10InfoQueue_PushEmptyRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
-
-#define ID3D10InfoQueue_PushCopyOfRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
-
-#define ID3D10InfoQueue_PushRetrievalFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
-
-#define ID3D10InfoQueue_PopRetrievalFilter(This) \
- ( (This)->lpVtbl -> PopRetrievalFilter(This) )
-
-#define ID3D10InfoQueue_GetRetrievalFilterStackSize(This) \
- ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
-
-#define ID3D10InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
- ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
-
-#define ID3D10InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
- ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
-
-#define ID3D10InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
-
-#define ID3D10InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
-
-#define ID3D10InfoQueue_SetBreakOnID(This,ID,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
-
-#define ID3D10InfoQueue_GetBreakOnCategory(This,Category) \
- ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
-
-#define ID3D10InfoQueue_GetBreakOnSeverity(This,Severity) \
- ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
-
-#define ID3D10InfoQueue_GetBreakOnID(This,ID) \
- ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
-
-#define ID3D10InfoQueue_SetMuteDebugOutput(This,bMute) \
- ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
-
-#define ID3D10InfoQueue_GetMuteDebugOutput(This) \
- ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D10InfoQueue_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d10sdklayers_0000_0003 */
-/* [local] */
-
-#define D3D10_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D")
-#define D3D10_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput")
-#define D3D10_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage")
-#define D3D10_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride")
-#define D3D10_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s")
-#define D3D10_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s")
-#define D3D10_MUTE_ID_STRING __TEXT("Mute_ID_%s")
-#define D3D10_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d")
-#define D3D10_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO")
-#define D3D10_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s")
-#define D3D10_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s")
-#define D3D10_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s")
-#define D3D10_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d")
-#define D3D10_APPSIZE_STRING __TEXT("Size")
-#define D3D10_APPNAME_STRING __TEXT("Name")
-DEFINE_GUID(IID_ID3D10Debug,0x9B7E4E01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
-DEFINE_GUID(IID_ID3D10SwitchToRef,0x9B7E4E02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0);
-DEFINE_GUID(IID_ID3D10InfoQueue,0x1b940b17,0x2642,0x4d1f,0xab,0x1f,0xb9,0x9b,0xad,0x0c,0x39,0x5f);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/dxsdk/Include/d3d11sdklayers.h b/3rdparty/dxsdk/Include/d3d11sdklayers.h
deleted file mode 100644
index 266503baa8e..00000000000
--- a/3rdparty/dxsdk/Include/d3d11sdklayers.h
+++ /dev/null
@@ -1,1671 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 7.00.0555 */
-/* Compiler settings for d3d11sdklayers.idl:
- Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555
- protocol : all , ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-/* @@MIDL_FILE_HEADING( ) */
-
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3d11sdklayers_h__
-#define __d3d11sdklayers_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D11Debug_FWD_DEFINED__
-#define __ID3D11Debug_FWD_DEFINED__
-typedef interface ID3D11Debug ID3D11Debug;
-#endif /* __ID3D11Debug_FWD_DEFINED__ */
-
-
-#ifndef __ID3D11SwitchToRef_FWD_DEFINED__
-#define __ID3D11SwitchToRef_FWD_DEFINED__
-typedef interface ID3D11SwitchToRef ID3D11SwitchToRef;
-#endif /* __ID3D11SwitchToRef_FWD_DEFINED__ */
-
-
-#ifndef __ID3D11InfoQueue_FWD_DEFINED__
-#define __ID3D11InfoQueue_FWD_DEFINED__
-typedef interface ID3D11InfoQueue ID3D11InfoQueue;
-#endif /* __ID3D11InfoQueue_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "d3d11.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3d11sdklayers_0000_0000 */
-/* [local] */
-
-#define D3D11_SDK_LAYERS_VERSION ( 1 )
-
-#define D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 )
-
-#define D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 )
-
-#define D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 )
-
-typedef
-enum D3D11_RLDO_FLAGS
- { D3D11_RLDO_SUMMARY = 0x1,
- D3D11_RLDO_DETAIL = 0x2
- } D3D11_RLDO_FLAGS;
-
-#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus )
-}
-inline D3D11_RLDO_FLAGS operator~( D3D11_RLDO_FLAGS a )
-{ return D3D11_RLDO_FLAGS( ~UINT( a ) ); }
-inline D3D11_RLDO_FLAGS operator&( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b )
-{ return D3D11_RLDO_FLAGS( UINT( a ) & UINT( b ) ); }
-inline D3D11_RLDO_FLAGS operator|( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b )
-{ return D3D11_RLDO_FLAGS( UINT( a ) | UINT( b ) ); }
-inline D3D11_RLDO_FLAGS operator^( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b )
-{ return D3D11_RLDO_FLAGS( UINT( a ) ^ UINT( b ) ); }
-inline D3D11_RLDO_FLAGS& operator&=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b )
-{ a = a & b; return a; }
-inline D3D11_RLDO_FLAGS& operator|=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b )
-{ a = a | b; return a; }
-inline D3D11_RLDO_FLAGS& operator^=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b )
-{ a = a ^ b; return a; }
-extern "C"{
-#endif
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D11Debug_INTERFACE_DEFINED__
-#define __ID3D11Debug_INTERFACE_DEFINED__
-
-/* interface ID3D11Debug */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D11Debug;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("79cf2233-7536-4948-9d36-1e4692dc5760")
- ID3D11Debug : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
- UINT Mask) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay(
- UINT Milliseconds) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetSwapChain(
- /* [annotation] */
- __in_opt IDXGISwapChain *pSwapChain) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetSwapChain(
- /* [annotation] */
- __out IDXGISwapChain **ppSwapChain) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE ValidateContext(
- /* [annotation] */
- __in ID3D11DeviceContext *pContext) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
- D3D11_RLDO_FLAGS Flags) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE ValidateContextForDispatch(
- /* [annotation] */
- __in ID3D11DeviceContext *pContext) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D11DebugVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D11Debug * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D11Debug * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D11Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D11Debug * This,
- UINT Mask);
-
- UINT ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D11Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )(
- ID3D11Debug * This,
- UINT Milliseconds);
-
- UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )(
- ID3D11Debug * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetSwapChain )(
- ID3D11Debug * This,
- /* [annotation] */
- __in_opt IDXGISwapChain *pSwapChain);
-
- HRESULT ( STDMETHODCALLTYPE *GetSwapChain )(
- ID3D11Debug * This,
- /* [annotation] */
- __out IDXGISwapChain **ppSwapChain);
-
- HRESULT ( STDMETHODCALLTYPE *ValidateContext )(
- ID3D11Debug * This,
- /* [annotation] */
- __in ID3D11DeviceContext *pContext);
-
- HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
- ID3D11Debug * This,
- D3D11_RLDO_FLAGS Flags);
-
- HRESULT ( STDMETHODCALLTYPE *ValidateContextForDispatch )(
- ID3D11Debug * This,
- /* [annotation] */
- __in ID3D11DeviceContext *pContext);
-
- END_INTERFACE
- } ID3D11DebugVtbl;
-
- interface ID3D11Debug
- {
- CONST_VTBL struct ID3D11DebugVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D11Debug_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D11Debug_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D11Debug_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D11Debug_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D11Debug_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-#define ID3D11Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \
- ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) )
-
-#define ID3D11Debug_GetPresentPerRenderOpDelay(This) \
- ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) )
-
-#define ID3D11Debug_SetSwapChain(This,pSwapChain) \
- ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) )
-
-#define ID3D11Debug_GetSwapChain(This,ppSwapChain) \
- ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) )
-
-#define ID3D11Debug_ValidateContext(This,pContext) \
- ( (This)->lpVtbl -> ValidateContext(This,pContext) )
-
-#define ID3D11Debug_ReportLiveDeviceObjects(This,Flags) \
- ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
-
-#define ID3D11Debug_ValidateContextForDispatch(This,pContext) \
- ( (This)->lpVtbl -> ValidateContextForDispatch(This,pContext) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D11Debug_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D11SwitchToRef_INTERFACE_DEFINED__
-#define __ID3D11SwitchToRef_INTERFACE_DEFINED__
-
-/* interface ID3D11SwitchToRef */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D11SwitchToRef;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("1ef337e3-58e7-4f83-a692-db221f5ed47e")
- ID3D11SwitchToRef : public IUnknown
- {
- public:
- virtual BOOL STDMETHODCALLTYPE SetUseRef(
- BOOL UseRef) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D11SwitchToRefVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D11SwitchToRef * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D11SwitchToRef * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D11SwitchToRef * This);
-
- BOOL ( STDMETHODCALLTYPE *SetUseRef )(
- ID3D11SwitchToRef * This,
- BOOL UseRef);
-
- BOOL ( STDMETHODCALLTYPE *GetUseRef )(
- ID3D11SwitchToRef * This);
-
- END_INTERFACE
- } ID3D11SwitchToRefVtbl;
-
- interface ID3D11SwitchToRef
- {
- CONST_VTBL struct ID3D11SwitchToRefVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D11SwitchToRef_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D11SwitchToRef_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D11SwitchToRef_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D11SwitchToRef_SetUseRef(This,UseRef) \
- ( (This)->lpVtbl -> SetUseRef(This,UseRef) )
-
-#define ID3D11SwitchToRef_GetUseRef(This) \
- ( (This)->lpVtbl -> GetUseRef(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D11SwitchToRef_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d11sdklayers_0000_0002 */
-/* [local] */
-
-typedef
-enum D3D11_MESSAGE_CATEGORY
- { D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
- D3D11_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
- D3D11_MESSAGE_CATEGORY_INITIALIZATION = ( D3D11_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
- D3D11_MESSAGE_CATEGORY_CLEANUP = ( D3D11_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
- D3D11_MESSAGE_CATEGORY_COMPILATION = ( D3D11_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
- D3D11_MESSAGE_CATEGORY_STATE_CREATION = ( D3D11_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
- D3D11_MESSAGE_CATEGORY_STATE_SETTING = ( D3D11_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
- D3D11_MESSAGE_CATEGORY_STATE_GETTING = ( D3D11_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
- D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D11_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
- D3D11_MESSAGE_CATEGORY_EXECUTION = ( D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 )
- } D3D11_MESSAGE_CATEGORY;
-
-typedef
-enum D3D11_MESSAGE_SEVERITY
- { D3D11_MESSAGE_SEVERITY_CORRUPTION = 0,
- D3D11_MESSAGE_SEVERITY_ERROR = ( D3D11_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
- D3D11_MESSAGE_SEVERITY_WARNING = ( D3D11_MESSAGE_SEVERITY_ERROR + 1 ) ,
- D3D11_MESSAGE_SEVERITY_INFO = ( D3D11_MESSAGE_SEVERITY_WARNING + 1 )
- } D3D11_MESSAGE_SEVERITY;
-
-typedef
-enum D3D11_MESSAGE_ID
- { D3D11_MESSAGE_ID_UNKNOWN = 0,
- D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_UNKNOWN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_THIS = ( D3D11_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D11_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
- D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
- D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
- D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
- D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
- D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
- D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
- D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
- D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) ,
- D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
- D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
- D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
- D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) ,
- D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
- D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
- D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
- D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_REF_THREADING_MODE = ( D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
- D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
- D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
- D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
- D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
- D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
- D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
- D3D11_MESSAGE_ID_REF_INFO = ( D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_REF_INFO + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) ,
- D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) ,
- D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) ,
- D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) ,
- D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
- D3D11_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) ,
- D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) ,
- D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) ,
- D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) ,
- D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) ,
- D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) ,
- D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) ,
- D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) ,
- D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) ,
- D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) ,
- D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) ,
- D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) ,
- D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) ,
- D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) ,
- D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) ,
- D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x200000,
- D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_D3D11_MESSAGES_START + 1 ) ,
- D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) ,
- D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) ,
- D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) ,
- D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_CONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_CONTEXT = ( D3D11_MESSAGE_ID_CREATE_CONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_CONTEXT = ( D3D11_MESSAGE_ID_LIVE_CONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_BUFFER = ( D3D11_MESSAGE_ID_DESTROY_CONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_BUFFER = ( D3D11_MESSAGE_ID_CREATE_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_BUFFER = ( D3D11_MESSAGE_ID_LIVE_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_TEXTURE1D = ( D3D11_MESSAGE_ID_DESTROY_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE1D + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_TEXTURE1D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_TEXTURE2D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE1D + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE2D + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_TEXTURE2D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_TEXTURE3D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE2D + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE3D + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_TEXTURE3D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE3D + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_VERTEXSHADER = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D11_MESSAGE_ID_CREATE_VERTEXSHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER = ( D3D11_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_HULLSHADER = ( D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_HULLSHADER = ( D3D11_MESSAGE_ID_CREATE_HULLSHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_HULLSHADER = ( D3D11_MESSAGE_ID_LIVE_HULLSHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_DOMAINSHADER = ( D3D11_MESSAGE_ID_DESTROY_HULLSHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_DOMAINSHADER = ( D3D11_MESSAGE_ID_CREATE_DOMAINSHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER = ( D3D11_MESSAGE_ID_LIVE_DOMAINSHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_PIXELSHADER = ( D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D11_MESSAGE_ID_CREATE_PIXELSHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_PIXELSHADER = ( D3D11_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_DESTROY_PIXELSHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT = ( D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_SAMPLER = ( D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_SAMPLER = ( D3D11_MESSAGE_ID_CREATE_SAMPLER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_SAMPLER = ( D3D11_MESSAGE_ID_LIVE_SAMPLER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_BLENDSTATE = ( D3D11_MESSAGE_ID_DESTROY_SAMPLER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D11_MESSAGE_ID_CREATE_BLENDSTATE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_BLENDSTATE = ( D3D11_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_DESTROY_BLENDSTATE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_QUERY = ( D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_QUERY = ( D3D11_MESSAGE_ID_CREATE_QUERY + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_QUERY = ( D3D11_MESSAGE_ID_LIVE_QUERY + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_PREDICATE = ( D3D11_MESSAGE_ID_DESTROY_QUERY + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_PREDICATE = ( D3D11_MESSAGE_ID_CREATE_PREDICATE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_PREDICATE = ( D3D11_MESSAGE_ID_LIVE_PREDICATE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_COUNTER = ( D3D11_MESSAGE_ID_DESTROY_PREDICATE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_COUNTER = ( D3D11_MESSAGE_ID_CREATE_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_COUNTER = ( D3D11_MESSAGE_ID_LIVE_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_COMMANDLIST = ( D3D11_MESSAGE_ID_DESTROY_COUNTER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_COMMANDLIST = ( D3D11_MESSAGE_ID_CREATE_COMMANDLIST + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_COMMANDLIST = ( D3D11_MESSAGE_ID_LIVE_COMMANDLIST + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_DESTROY_COMMANDLIST + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE = ( D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE = ( D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_DEVICE = ( D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D11_MESSAGE_ID_LIVE_DEVICE + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_COMPUTESHADER = ( D3D11_MESSAGE_ID_CREATE_COMPUTESHADER + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_COMPUTESHADER + 1 ) ,
- D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER + 1 ) ,
- D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL = ( D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) ,
- D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) ,
- D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
- D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) ,
- D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) ,
- D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + 1 ) ,
- D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) ,
- D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) ,
- D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) ,
- D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) ,
- D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) ,
- D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) ,
- D3D11_MESSAGE_ID_REF_WARNING = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) ,
- D3D11_MESSAGE_ID_D3D11_MESSAGES_END = ( D3D11_MESSAGE_ID_REF_WARNING + 1 )
- } D3D11_MESSAGE_ID;
-
-typedef struct D3D11_MESSAGE
- {
- D3D11_MESSAGE_CATEGORY Category;
- D3D11_MESSAGE_SEVERITY Severity;
- D3D11_MESSAGE_ID ID;
- const char *pDescription;
- SIZE_T DescriptionByteLength;
- } D3D11_MESSAGE;
-
-typedef struct D3D11_INFO_QUEUE_FILTER_DESC
- {
- UINT NumCategories;
- D3D11_MESSAGE_CATEGORY *pCategoryList;
- UINT NumSeverities;
- D3D11_MESSAGE_SEVERITY *pSeverityList;
- UINT NumIDs;
- D3D11_MESSAGE_ID *pIDList;
- } D3D11_INFO_QUEUE_FILTER_DESC;
-
-typedef struct D3D11_INFO_QUEUE_FILTER
- {
- D3D11_INFO_QUEUE_FILTER_DESC AllowList;
- D3D11_INFO_QUEUE_FILTER_DESC DenyList;
- } D3D11_INFO_QUEUE_FILTER;
-
-#define D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_s_ifspec;
-
-#ifndef __ID3D11InfoQueue_INTERFACE_DEFINED__
-#define __ID3D11InfoQueue_INTERFACE_DEFINED__
-
-/* interface ID3D11InfoQueue */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D11InfoQueue;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6")
- ID3D11InfoQueue : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
- /* [annotation] */
- __in UINT64 MessageCountLimit) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetMessage(
- /* [annotation] */
- __in UINT64 MessageIndex,
- /* [annotation] */
- __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage,
- /* [annotation] */
- __inout SIZE_T *pMessageByteLength) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddMessage(
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID,
- /* [annotation] */
- __in LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID,
- /* [annotation] */
- __in BOOL bEnable) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID) = 0;
-
- virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
- /* [annotation] */
- __in BOOL bMute) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D11InfoQueueVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D11InfoQueue * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D11InfoQueue * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in UINT64 MessageCountLimit);
-
- void ( STDMETHODCALLTYPE *ClearStoredMessages )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetMessage )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in UINT64 MessageIndex,
- /* [annotation] */
- __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage,
- /* [annotation] */
- __inout SIZE_T *pMessageByteLength);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
- ID3D11InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
- ID3D11InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
- ID3D11InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
- ID3D11InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
- ID3D11InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearStorageFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopStorageFilter )(
- ID3D11InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter,
- /* [annotation] */
- __inout SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
- ID3D11InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
- ID3D11InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddMessage )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID,
- /* [annotation] */
- __in LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category,
- /* [annotation] */
- __in BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity,
- /* [annotation] */
- __in BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID,
- /* [annotation] */
- __in BOOL bEnable);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_CATEGORY Category);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_SEVERITY Severity);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in D3D11_MESSAGE_ID ID);
-
- void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
- ID3D11InfoQueue * This,
- /* [annotation] */
- __in BOOL bMute);
-
- BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
- ID3D11InfoQueue * This);
-
- END_INTERFACE
- } ID3D11InfoQueueVtbl;
-
- interface ID3D11InfoQueue
- {
- CONST_VTBL struct ID3D11InfoQueueVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D11InfoQueue_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D11InfoQueue_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D11InfoQueue_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D11InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
- ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
-
-#define ID3D11InfoQueue_ClearStoredMessages(This) \
- ( (This)->lpVtbl -> ClearStoredMessages(This) )
-
-#define ID3D11InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
- ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
-
-#define ID3D11InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
-
-#define ID3D11InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
-
-#define ID3D11InfoQueue_GetNumStoredMessages(This) \
- ( (This)->lpVtbl -> GetNumStoredMessages(This) )
-
-#define ID3D11InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
- ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
-
-#define ID3D11InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
-
-#define ID3D11InfoQueue_GetMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetMessageCountLimit(This) )
-
-#define ID3D11InfoQueue_AddStorageFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
-
-#define ID3D11InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D11InfoQueue_ClearStorageFilter(This) \
- ( (This)->lpVtbl -> ClearStorageFilter(This) )
-
-#define ID3D11InfoQueue_PushEmptyStorageFilter(This) \
- ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
-
-#define ID3D11InfoQueue_PushCopyOfStorageFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
-
-#define ID3D11InfoQueue_PushStorageFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
-
-#define ID3D11InfoQueue_PopStorageFilter(This) \
- ( (This)->lpVtbl -> PopStorageFilter(This) )
-
-#define ID3D11InfoQueue_GetStorageFilterStackSize(This) \
- ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
-
-#define ID3D11InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
-
-#define ID3D11InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D11InfoQueue_ClearRetrievalFilter(This) \
- ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
-
-#define ID3D11InfoQueue_PushEmptyRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
-
-#define ID3D11InfoQueue_PushCopyOfRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
-
-#define ID3D11InfoQueue_PushRetrievalFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
-
-#define ID3D11InfoQueue_PopRetrievalFilter(This) \
- ( (This)->lpVtbl -> PopRetrievalFilter(This) )
-
-#define ID3D11InfoQueue_GetRetrievalFilterStackSize(This) \
- ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
-
-#define ID3D11InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
- ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
-
-#define ID3D11InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
- ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
-
-#define ID3D11InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
-
-#define ID3D11InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
-
-#define ID3D11InfoQueue_SetBreakOnID(This,ID,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
-
-#define ID3D11InfoQueue_GetBreakOnCategory(This,Category) \
- ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
-
-#define ID3D11InfoQueue_GetBreakOnSeverity(This,Severity) \
- ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
-
-#define ID3D11InfoQueue_GetBreakOnID(This,ID) \
- ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
-
-#define ID3D11InfoQueue_SetMuteDebugOutput(This,bMute) \
- ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
-
-#define ID3D11InfoQueue_GetMuteDebugOutput(This) \
- ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D11InfoQueue_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d11sdklayers_0000_0003 */
-/* [local] */
-
-#define D3D11_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D")
-#define D3D11_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput")
-#define D3D11_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage")
-#define D3D11_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride")
-#define D3D11_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s")
-#define D3D11_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s")
-#define D3D11_MUTE_ID_STRING __TEXT("Mute_ID_%s")
-#define D3D11_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d")
-#define D3D11_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO")
-#define D3D11_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s")
-#define D3D11_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s")
-#define D3D11_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s")
-#define D3D11_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d")
-#define D3D11_APPSIZE_STRING __TEXT("Size")
-#define D3D11_APPNAME_STRING __TEXT("Name")
-DEFINE_GUID(IID_ID3D11Debug,0x79cf2233,0x7536,0x4948,0x9d,0x36,0x1e,0x46,0x92,0xdc,0x57,0x60);
-DEFINE_GUID(IID_ID3D11SwitchToRef,0x1ef337e3,0x58e7,0x4f83,0xa6,0x92,0xdb,0x22,0x1f,0x5e,0xd4,0x7e);
-DEFINE_GUID(IID_ID3D11InfoQueue,0x6543dbb6,0x1b48,0x42f5,0xab,0x82,0xe9,0x7e,0xc7,0x43,0x26,0xf6);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/dxsdk/Include/d3d11shader.h b/3rdparty/dxsdk/Include/d3d11shader.h
deleted file mode 100644
index f91897c27de..00000000000
--- a/3rdparty/dxsdk/Include/d3d11shader.h
+++ /dev/null
@@ -1,296 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// File: D3D11Shader.h
-// Content: D3D11 Shader Types and APIs
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3D11SHADER_H__
-#define __D3D11SHADER_H__
-
-#include "d3dcommon.h"
-
-
-typedef enum D3D11_SHADER_VERSION_TYPE
-{
- D3D11_SHVER_PIXEL_SHADER = 0,
- D3D11_SHVER_VERTEX_SHADER = 1,
- D3D11_SHVER_GEOMETRY_SHADER = 2,
-
- // D3D11 Shaders
- D3D11_SHVER_HULL_SHADER = 3,
- D3D11_SHVER_DOMAIN_SHADER = 4,
- D3D11_SHVER_COMPUTE_SHADER = 5,
-} D3D11_SHADER_VERSION_TYPE;
-
-#define D3D11_SHVER_GET_TYPE(_Version) \
- (((_Version) >> 16) & 0xffff)
-#define D3D11_SHVER_GET_MAJOR(_Version) \
- (((_Version) >> 4) & 0xf)
-#define D3D11_SHVER_GET_MINOR(_Version) \
- (((_Version) >> 0) & 0xf)
-
-typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
-
-typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
-
-
-typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
-{
- LPCSTR SemanticName; // Name of the semantic
- UINT SemanticIndex; // Index of the semantic
- UINT Register; // Number of member variables
- D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
- D3D_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.)
- BYTE Mask; // Mask to indicate which components of the register
- // are used (combination of D3D10_COMPONENT_MASK values)
- BYTE ReadWriteMask; // Mask to indicate whether a given component is
- // never written (if this is an output signature) or
- // always read (if this is an input signature).
- // (combination of D3D10_COMPONENT_MASK values)
- UINT Stream; // Stream index
-} D3D11_SIGNATURE_PARAMETER_DESC;
-
-typedef struct _D3D11_SHADER_BUFFER_DESC
-{
- LPCSTR Name; // Name of the constant buffer
- D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
- UINT Variables; // Number of member variables
- UINT Size; // Size of CB (in bytes)
- UINT uFlags; // Buffer description flags
-} D3D11_SHADER_BUFFER_DESC;
-
-typedef struct _D3D11_SHADER_VARIABLE_DESC
-{
- LPCSTR Name; // Name of the variable
- UINT StartOffset; // Offset in constant buffer's backing store
- UINT Size; // Size of variable (in bytes)
- UINT uFlags; // Variable flags
- LPVOID DefaultValue; // Raw pointer to default value
- UINT StartTexture; // First texture index (or -1 if no textures used)
- UINT TextureSize; // Number of texture slots possibly used.
- UINT StartSampler; // First sampler index (or -1 if no textures used)
- UINT SamplerSize; // Number of sampler slots possibly used.
-} D3D11_SHADER_VARIABLE_DESC;
-
-typedef struct _D3D11_SHADER_TYPE_DESC
-{
- D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
- D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
- UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
- UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
- UINT Elements; // Number of elements (0 if not an array)
- UINT Members; // Number of members (0 if not a structure)
- UINT Offset; // Offset from the start of structure (0 if not a structure member)
- LPCSTR Name; // Name of type, can be NULL
-} D3D11_SHADER_TYPE_DESC;
-
-typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
-
-typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
-
-typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
-
-typedef struct _D3D11_SHADER_DESC
-{
- UINT Version; // Shader version
- LPCSTR Creator; // Creator string
- UINT Flags; // Shader compilation/parse flags
-
- UINT ConstantBuffers; // Number of constant buffers
- UINT BoundResources; // Number of bound resources
- UINT InputParameters; // Number of parameters in the input signature
- UINT OutputParameters; // Number of parameters in the output signature
-
- UINT InstructionCount; // Number of emitted instructions
- UINT TempRegisterCount; // Number of temporary registers used
- UINT TempArrayCount; // Number of temporary arrays used
- UINT DefCount; // Number of constant defines
- UINT DclCount; // Number of declarations (input + output)
- UINT TextureNormalInstructions; // Number of non-categorized texture instructions
- UINT TextureLoadInstructions; // Number of texture load instructions
- UINT TextureCompInstructions; // Number of texture comparison instructions
- UINT TextureBiasInstructions; // Number of texture bias instructions
- UINT TextureGradientInstructions; // Number of texture gradient instructions
- UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
- UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
- UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
- UINT StaticFlowControlCount; // Number of static flow control instructions used
- UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
- UINT MacroInstructionCount; // Number of macro instructions used
- UINT ArrayInstructionCount; // Number of array instructions used
- UINT CutInstructionCount; // Number of cut instructions used
- UINT EmitInstructionCount; // Number of emit instructions used
- D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
- UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
- D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
- UINT PatchConstantParameters; // Number of parameters in the patch constant signature
- UINT cGSInstanceCount; // Number of Geometry shader instances
- UINT cControlPoints; // Number of control points in the HS->DS stage
- D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
- D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
- D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
- // instruction counts
- UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
- UINT cInterlockedInstructions; // Number of interlocked instructions
- UINT cTextureStoreInstructions; // Number of texture writes
-} D3D11_SHADER_DESC;
-
-typedef struct _D3D11_SHADER_INPUT_BIND_DESC
-{
- LPCSTR Name; // Name of the resource
- D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
- UINT BindPoint; // Starting bind point
- UINT BindCount; // Number of contiguous bind points (for arrays)
-
- UINT uFlags; // Input binding flags
- D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
- D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
- UINT NumSamples; // Number of samples (0 if not MS texture)
-} D3D11_SHADER_INPUT_BIND_DESC;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Interfaces ////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType;
-typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE;
-
-typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable;
-typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE;
-
-typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer;
-typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER;
-
-typedef interface ID3D11ShaderReflection ID3D11ShaderReflection;
-typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION;
-
-// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
-DEFINE_GUID(IID_ID3D11ShaderReflectionType,
-0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
-
-#undef INTERFACE
-#define INTERFACE ID3D11ShaderReflectionType
-
-DECLARE_INTERFACE(ID3D11ShaderReflectionType)
-{
- STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_TYPE_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ __in UINT Index) PURE;
- STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ __in LPCSTR Name) PURE;
- STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ __in UINT Index) PURE;
-
- STDMETHOD(IsEqual)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE;
- STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
- STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
- STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
- STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ __in UINT uIndex) PURE;
- STDMETHOD(IsOfType)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE;
- STDMETHOD(ImplementsInterface)(THIS_ __in ID3D11ShaderReflectionType* pBase) PURE;
-};
-
-// {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
-DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
-0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
-
-#undef INTERFACE
-#define INTERFACE ID3D11ShaderReflectionVariable
-
-DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
-{
- STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
- STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
-
- STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ __in UINT uArrayIndex) PURE;
-};
-
-// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
-DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
-0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
-
-#undef INTERFACE
-#define INTERFACE ID3D11ShaderReflectionConstantBuffer
-
-DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
-{
- STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ __in UINT Index) PURE;
- STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE;
-};
-
-// The ID3D11ShaderReflection IID may change from SDK version to SDK version
-// if the reflection API changes. This prevents new code with the new API
-// from working with an old binary. Recompiling with the new header
-// will pick up the new IID.
-
-// 0a233719-3960-4578-9d7c-203b8b1d9cc1
-DEFINE_GUID(IID_ID3D11ShaderReflection,
-0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1);
-
-#undef INTERFACE
-#define INTERFACE ID3D11ShaderReflection
-
-DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ __in REFIID iid,
- __out LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ __in UINT Index) PURE;
- STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ __in LPCSTR Name) PURE;
-
- STDMETHOD(GetResourceBindingDesc)(THIS_ __in UINT ResourceIndex,
- __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
-
- STDMETHOD(GetInputParameterDesc)(THIS_ __in UINT ParameterIndex,
- __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetOutputParameterDesc)(THIS_ __in UINT ParameterIndex,
- __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
- STDMETHOD(GetPatchConstantParameterDesc)(THIS_ __in UINT ParameterIndex,
- __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
-
- STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE;
-
- STDMETHOD(GetResourceBindingDescByName)(THIS_ __in LPCSTR Name,
- __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
-
- STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
- STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
-
- STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
- STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
-
- STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
- STDMETHOD(GetMinFeatureLevel)(THIS_ __out enum D3D_FEATURE_LEVEL* pLevel) PURE;
-
- STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
- __out_opt UINT* pSizeX,
- __out_opt UINT* pSizeY,
- __out_opt UINT* pSizeZ) PURE;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-// APIs //////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3D11SHADER_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dcommon.h b/3rdparty/dxsdk/Include/d3dcommon.h
deleted file mode 100644
index 9305a040fc2..00000000000
--- a/3rdparty/dxsdk/Include/d3dcommon.h
+++ /dev/null
@@ -1,804 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 7.00.0555 */
-/* @@MIDL_FILE_HEADING( ) */
-
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3dcommon_h__
-#define __d3dcommon_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D10Blob_FWD_DEFINED__
-#define __ID3D10Blob_FWD_DEFINED__
-typedef interface ID3D10Blob ID3D10Blob;
-#endif /* __ID3D10Blob_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3dcommon_0000_0000 */
-/* [local] */
-
-typedef
-enum D3D_DRIVER_TYPE
- { D3D_DRIVER_TYPE_UNKNOWN = 0,
- D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) ,
- D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) ,
- D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) ,
- D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) ,
- D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 )
- } D3D_DRIVER_TYPE;
-
-typedef
-enum D3D_FEATURE_LEVEL
- { D3D_FEATURE_LEVEL_9_1 = 0x9100,
- D3D_FEATURE_LEVEL_9_2 = 0x9200,
- D3D_FEATURE_LEVEL_9_3 = 0x9300,
- D3D_FEATURE_LEVEL_10_0 = 0xa000,
- D3D_FEATURE_LEVEL_10_1 = 0xa100,
- D3D_FEATURE_LEVEL_11_0 = 0xb000
- } D3D_FEATURE_LEVEL;
-
-typedef
-#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
-#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096
-#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048
-#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096
-#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512
-#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096
-#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256
-#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2
-#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535
-#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575
-#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1
-#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4
-#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128
-#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048
-#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192
-enum D3D_PRIMITIVE_TOPOLOGY
- { D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
- D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
- D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
- D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
- D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
- D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
- D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
- D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
- D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
- D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
- D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
- D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
- D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
- D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
- D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
- D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
- D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
- D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
- D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
- D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
- D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
- D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
- D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
- D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
- D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
- D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
- D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
- D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
- D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
- D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
- D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
- D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
- D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
- D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
- D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
- D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
- D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
- D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
- D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
- D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
- D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
- D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
- D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
- D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
- D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
- D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
- D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
- D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
- D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
- D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
- D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
- D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
- D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
- D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
- D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
- D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
- D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
- D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
- D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
- D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
- } D3D_PRIMITIVE_TOPOLOGY;
-
-typedef
-enum D3D_PRIMITIVE
- { D3D_PRIMITIVE_UNDEFINED = 0,
- D3D_PRIMITIVE_POINT = 1,
- D3D_PRIMITIVE_LINE = 2,
- D3D_PRIMITIVE_TRIANGLE = 3,
- D3D_PRIMITIVE_LINE_ADJ = 6,
- D3D_PRIMITIVE_TRIANGLE_ADJ = 7,
- D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
- D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
- D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10,
- D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11,
- D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12,
- D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13,
- D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14,
- D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15,
- D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16,
- D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17,
- D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18,
- D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19,
- D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20,
- D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21,
- D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22,
- D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23,
- D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24,
- D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25,
- D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26,
- D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28,
- D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 29,
- D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 30,
- D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 31,
- D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 32,
- D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 33,
- D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 34,
- D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 35,
- D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 36,
- D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 37,
- D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 38,
- D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 39,
- D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 40,
- D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
- D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
- D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
- D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
- D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
- D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
- D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
- D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
- D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
- D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
- D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
- D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
- D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH,
- D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH
- } D3D_PRIMITIVE;
-
-typedef
-enum D3D_SRV_DIMENSION
- { D3D_SRV_DIMENSION_UNKNOWN = 0,
- D3D_SRV_DIMENSION_BUFFER = 1,
- D3D_SRV_DIMENSION_TEXTURE1D = 2,
- D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3,
- D3D_SRV_DIMENSION_TEXTURE2D = 4,
- D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5,
- D3D_SRV_DIMENSION_TEXTURE2DMS = 6,
- D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
- D3D_SRV_DIMENSION_TEXTURE3D = 8,
- D3D_SRV_DIMENSION_TEXTURECUBE = 9,
- D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
- D3D_SRV_DIMENSION_BUFFEREX = 11,
- D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
- D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
- D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
- D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
- D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
- D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
- D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
- D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
- D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
- D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
- D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
- D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
- D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
- D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
- D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
- D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
- D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
- D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
- D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
- D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
- D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
- D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
- D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
- D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
- D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
- D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
- D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
- D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
- D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
- D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
- D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
- D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
- D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
- } D3D_SRV_DIMENSION;
-
-typedef struct _D3D_SHADER_MACRO
- {
- LPCSTR Name;
- LPCSTR Definition;
- } D3D_SHADER_MACRO;
-
-typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO;
-
-DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D10Blob_INTERFACE_DEFINED__
-#define __ID3D10Blob_INTERFACE_DEFINED__
-
-/* interface ID3D10Blob */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D10Blob;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102")
- ID3D10Blob : public IUnknown
- {
- public:
- virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0;
-
- virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct ID3D10BlobVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D10Blob * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D10Blob * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D10Blob * This);
-
- LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
- ID3D10Blob * This);
-
- SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
- ID3D10Blob * This);
-
- END_INTERFACE
- } ID3D10BlobVtbl;
-
- interface ID3D10Blob
- {
- CONST_VTBL struct ID3D10BlobVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D10Blob_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D10Blob_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D10Blob_GetBufferPointer(This) \
- ( (This)->lpVtbl -> GetBufferPointer(This) )
-
-#define ID3D10Blob_GetBufferSize(This) \
- ( (This)->lpVtbl -> GetBufferSize(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3dcommon_0000_0001 */
-/* [local] */
-
-typedef interface ID3D10Blob* LPD3D10BLOB;
-typedef ID3D10Blob ID3DBlob;
-typedef ID3DBlob* LPD3DBLOB;
-#define IID_ID3DBlob IID_ID3D10Blob
-typedef
-enum _D3D_INCLUDE_TYPE
- { D3D_INCLUDE_LOCAL = 0,
- D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) ,
- D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL,
- D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM,
- D3D_INCLUDE_FORCE_DWORD = 0x7fffffff
- } D3D_INCLUDE_TYPE;
-
-typedef interface ID3DInclude ID3DInclude;
-#undef INTERFACE
-#define INTERFACE ID3DInclude
-DECLARE_INTERFACE(ID3DInclude)
-{
- STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
- STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
-};
-typedef ID3DInclude* LPD3DINCLUDE;
-typedef
-enum _D3D_SHADER_VARIABLE_CLASS
- { D3D_SVC_SCALAR = 0,
- D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) ,
- D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) ,
- D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) ,
- D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) ,
- D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) ,
- D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) ,
- D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) ,
- D3D10_SVC_SCALAR = D3D_SVC_SCALAR,
- D3D10_SVC_VECTOR = D3D_SVC_VECTOR,
- D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS,
- D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS,
- D3D10_SVC_OBJECT = D3D_SVC_OBJECT,
- D3D10_SVC_STRUCT = D3D_SVC_STRUCT,
- D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS,
- D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER,
- D3D_SVC_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_VARIABLE_CLASS;
-
-typedef
-enum _D3D_SHADER_VARIABLE_FLAGS
- { D3D_SVF_USERPACKED = 1,
- D3D_SVF_USED = 2,
- D3D_SVF_INTERFACE_POINTER = 4,
- D3D_SVF_INTERFACE_PARAMETER = 8,
- D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED,
- D3D10_SVF_USED = D3D_SVF_USED,
- D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER,
- D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER,
- D3D_SVF_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_VARIABLE_FLAGS;
-
-typedef
-enum _D3D_SHADER_VARIABLE_TYPE
- { D3D_SVT_VOID = 0,
- D3D_SVT_BOOL = 1,
- D3D_SVT_INT = 2,
- D3D_SVT_FLOAT = 3,
- D3D_SVT_STRING = 4,
- D3D_SVT_TEXTURE = 5,
- D3D_SVT_TEXTURE1D = 6,
- D3D_SVT_TEXTURE2D = 7,
- D3D_SVT_TEXTURE3D = 8,
- D3D_SVT_TEXTURECUBE = 9,
- D3D_SVT_SAMPLER = 10,
- D3D_SVT_SAMPLER1D = 11,
- D3D_SVT_SAMPLER2D = 12,
- D3D_SVT_SAMPLER3D = 13,
- D3D_SVT_SAMPLERCUBE = 14,
- D3D_SVT_PIXELSHADER = 15,
- D3D_SVT_VERTEXSHADER = 16,
- D3D_SVT_PIXELFRAGMENT = 17,
- D3D_SVT_VERTEXFRAGMENT = 18,
- D3D_SVT_UINT = 19,
- D3D_SVT_UINT8 = 20,
- D3D_SVT_GEOMETRYSHADER = 21,
- D3D_SVT_RASTERIZER = 22,
- D3D_SVT_DEPTHSTENCIL = 23,
- D3D_SVT_BLEND = 24,
- D3D_SVT_BUFFER = 25,
- D3D_SVT_CBUFFER = 26,
- D3D_SVT_TBUFFER = 27,
- D3D_SVT_TEXTURE1DARRAY = 28,
- D3D_SVT_TEXTURE2DARRAY = 29,
- D3D_SVT_RENDERTARGETVIEW = 30,
- D3D_SVT_DEPTHSTENCILVIEW = 31,
- D3D_SVT_TEXTURE2DMS = 32,
- D3D_SVT_TEXTURE2DMSARRAY = 33,
- D3D_SVT_TEXTURECUBEARRAY = 34,
- D3D_SVT_HULLSHADER = 35,
- D3D_SVT_DOMAINSHADER = 36,
- D3D_SVT_INTERFACE_POINTER = 37,
- D3D_SVT_COMPUTESHADER = 38,
- D3D_SVT_DOUBLE = 39,
- D3D_SVT_RWTEXTURE1D = 40,
- D3D_SVT_RWTEXTURE1DARRAY = 41,
- D3D_SVT_RWTEXTURE2D = 42,
- D3D_SVT_RWTEXTURE2DARRAY = 43,
- D3D_SVT_RWTEXTURE3D = 44,
- D3D_SVT_RWBUFFER = 45,
- D3D_SVT_BYTEADDRESS_BUFFER = 46,
- D3D_SVT_RWBYTEADDRESS_BUFFER = 47,
- D3D_SVT_STRUCTURED_BUFFER = 48,
- D3D_SVT_RWSTRUCTURED_BUFFER = 49,
- D3D_SVT_APPEND_STRUCTURED_BUFFER = 50,
- D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51,
- D3D10_SVT_VOID = D3D_SVT_VOID,
- D3D10_SVT_BOOL = D3D_SVT_BOOL,
- D3D10_SVT_INT = D3D_SVT_INT,
- D3D10_SVT_FLOAT = D3D_SVT_FLOAT,
- D3D10_SVT_STRING = D3D_SVT_STRING,
- D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE,
- D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D,
- D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D,
- D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D,
- D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE,
- D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER,
- D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D,
- D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D,
- D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D,
- D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE,
- D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER,
- D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER,
- D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT,
- D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT,
- D3D10_SVT_UINT = D3D_SVT_UINT,
- D3D10_SVT_UINT8 = D3D_SVT_UINT8,
- D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER,
- D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER,
- D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL,
- D3D10_SVT_BLEND = D3D_SVT_BLEND,
- D3D10_SVT_BUFFER = D3D_SVT_BUFFER,
- D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER,
- D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER,
- D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY,
- D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY,
- D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW,
- D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW,
- D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS,
- D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY,
- D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY,
- D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER,
- D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER,
- D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER,
- D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER,
- D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE,
- D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D,
- D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY,
- D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D,
- D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY,
- D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D,
- D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER,
- D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER,
- D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER,
- D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER,
- D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER,
- D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER,
- D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER,
- D3D_SVT_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_VARIABLE_TYPE;
-
-typedef
-enum _D3D_SHADER_INPUT_FLAGS
- { D3D_SIF_USERPACKED = 1,
- D3D_SIF_COMPARISON_SAMPLER = 2,
- D3D_SIF_TEXTURE_COMPONENT_0 = 4,
- D3D_SIF_TEXTURE_COMPONENT_1 = 8,
- D3D_SIF_TEXTURE_COMPONENTS = 12,
- D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED,
- D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER,
- D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0,
- D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1,
- D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS,
- D3D_SIF_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_INPUT_FLAGS;
-
-typedef
-enum _D3D_SHADER_INPUT_TYPE
- { D3D_SIT_CBUFFER = 0,
- D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) ,
- D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) ,
- D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) ,
- D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) ,
- D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) ,
- D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) ,
- D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) ,
- D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) ,
- D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
- D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
- D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
- D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
- D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
- D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
- D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER,
- D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED,
- D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED,
- D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED,
- D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS,
- D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS,
- D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED,
- D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED,
- D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER
- } D3D_SHADER_INPUT_TYPE;
-
-typedef
-enum _D3D_SHADER_CBUFFER_FLAGS
- { D3D_CBF_USERPACKED = 1,
- D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED,
- D3D_CBF_FORCE_DWORD = 0x7fffffff
- } D3D_SHADER_CBUFFER_FLAGS;
-
-typedef
-enum _D3D_CBUFFER_TYPE
- { D3D_CT_CBUFFER = 0,
- D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) ,
- D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) ,
- D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) ,
- D3D10_CT_CBUFFER = D3D_CT_CBUFFER,
- D3D10_CT_TBUFFER = D3D_CT_TBUFFER,
- D3D11_CT_CBUFFER = D3D_CT_CBUFFER,
- D3D11_CT_TBUFFER = D3D_CT_TBUFFER,
- D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS,
- D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO
- } D3D_CBUFFER_TYPE;
-
-typedef
-enum D3D_NAME
- { D3D_NAME_UNDEFINED = 0,
- D3D_NAME_POSITION = 1,
- D3D_NAME_CLIP_DISTANCE = 2,
- D3D_NAME_CULL_DISTANCE = 3,
- D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
- D3D_NAME_VIEWPORT_ARRAY_INDEX = 5,
- D3D_NAME_VERTEX_ID = 6,
- D3D_NAME_PRIMITIVE_ID = 7,
- D3D_NAME_INSTANCE_ID = 8,
- D3D_NAME_IS_FRONT_FACE = 9,
- D3D_NAME_SAMPLE_INDEX = 10,
- D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11,
- D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12,
- D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13,
- D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
- D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
- D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
- D3D_NAME_TARGET = 64,
- D3D_NAME_DEPTH = 65,
- D3D_NAME_COVERAGE = 66,
- D3D_NAME_DEPTH_GREATER_EQUAL = 67,
- D3D_NAME_DEPTH_LESS_EQUAL = 68,
- D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED,
- D3D10_NAME_POSITION = D3D_NAME_POSITION,
- D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE,
- D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE,
- D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX,
- D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX,
- D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID,
- D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID,
- D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID,
- D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE,
- D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX,
- D3D10_NAME_TARGET = D3D_NAME_TARGET,
- D3D10_NAME_DEPTH = D3D_NAME_DEPTH,
- D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE,
- D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
- D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
- D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR,
- D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
- D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
- D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
- D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
- D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL
- } D3D_NAME;
-
-typedef
-enum D3D_RESOURCE_RETURN_TYPE
- { D3D_RETURN_TYPE_UNORM = 1,
- D3D_RETURN_TYPE_SNORM = 2,
- D3D_RETURN_TYPE_SINT = 3,
- D3D_RETURN_TYPE_UINT = 4,
- D3D_RETURN_TYPE_FLOAT = 5,
- D3D_RETURN_TYPE_MIXED = 6,
- D3D_RETURN_TYPE_DOUBLE = 7,
- D3D_RETURN_TYPE_CONTINUED = 8,
- D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
- D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
- D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
- D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
- D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
- D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
- D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
- D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
- D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
- D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
- D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
- D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
- D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE,
- D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED
- } D3D_RESOURCE_RETURN_TYPE;
-
-typedef
-enum D3D_REGISTER_COMPONENT_TYPE
- { D3D_REGISTER_COMPONENT_UNKNOWN = 0,
- D3D_REGISTER_COMPONENT_UINT32 = 1,
- D3D_REGISTER_COMPONENT_SINT32 = 2,
- D3D_REGISTER_COMPONENT_FLOAT32 = 3,
- D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN,
- D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32,
- D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32,
- D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32
- } D3D_REGISTER_COMPONENT_TYPE;
-
-typedef
-enum D3D_TESSELLATOR_DOMAIN
- { D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0,
- D3D_TESSELLATOR_DOMAIN_ISOLINE = 1,
- D3D_TESSELLATOR_DOMAIN_TRI = 2,
- D3D_TESSELLATOR_DOMAIN_QUAD = 3,
- D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED,
- D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE,
- D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI,
- D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD
- } D3D_TESSELLATOR_DOMAIN;
-
-typedef
-enum D3D_TESSELLATOR_PARTITIONING
- { D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
- D3D_TESSELLATOR_PARTITIONING_INTEGER = 1,
- D3D_TESSELLATOR_PARTITIONING_POW2 = 2,
- D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3,
- D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4,
- D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED,
- D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER,
- D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2,
- D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
- D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN
- } D3D_TESSELLATOR_PARTITIONING;
-
-typedef
-enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
- { D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0,
- D3D_TESSELLATOR_OUTPUT_POINT = 1,
- D3D_TESSELLATOR_OUTPUT_LINE = 2,
- D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
- D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4,
- D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED,
- D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT,
- D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE,
- D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW,
- D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
- } D3D_TESSELLATOR_OUTPUT_PRIMITIVE;
-
-DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/dxsdk/Include/d3dcompiler.h b/3rdparty/dxsdk/Include/d3dcompiler.h
deleted file mode 100644
index fea519fd163..00000000000
--- a/3rdparty/dxsdk/Include/d3dcompiler.h
+++ /dev/null
@@ -1,397 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// File: D3DCompiler.h
-// Content: D3D Compilation Types and APIs
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3DCOMPILER_H__
-#define __D3DCOMPILER_H__
-
-// Current name of the DLL shipped in the same SDK as this header.
-
-
-#define D3DCOMPILER_DLL_W L"d3dcompiler_43.dll"
-#define D3DCOMPILER_DLL_A "d3dcompiler_43.dll"
-
-#ifdef UNICODE
- #define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
-#else
- #define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
-#endif
-
-#include "d3d11shader.h"
-
-//////////////////////////////////////////////////////////////////////////////
-// APIs //////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-//----------------------------------------------------------------------------
-// D3DCOMPILE flags:
-// -----------------
-// D3DCOMPILE_DEBUG
-// Insert debug file/line/type/symbol information.
-//
-// D3DCOMPILE_SKIP_VALIDATION
-// Do not validate the generated code against known capabilities and
-// constraints. This option is only recommended when compiling shaders
-// you KNOW will work. (ie. have compiled before without this option.)
-// Shaders are always validated by D3D before they are set to the device.
-//
-// D3DCOMPILE_SKIP_OPTIMIZATION
-// Instructs the compiler to skip optimization steps during code generation.
-// Unless you are trying to isolate a problem in your code using this option
-// is not recommended.
-//
-// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
-// Unless explicitly specified, matrices will be packed in row-major order
-// on input and output from the shader.
-//
-// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
-// Unless explicitly specified, matrices will be packed in column-major
-// order on input and output from the shader. This is generally more
-// efficient, since it allows vector-matrix multiplication to be performed
-// using a series of dot-products.
-//
-// D3DCOMPILE_PARTIAL_PRECISION
-// Force all computations in resulting shader to occur at partial precision.
-// This may result in faster evaluation of shaders on some hardware.
-//
-// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
-// Force compiler to compile against the next highest available software
-// target for vertex shaders. This flag also turns optimizations off,
-// and debugging on.
-//
-// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
-// Force compiler to compile against the next highest available software
-// target for pixel shaders. This flag also turns optimizations off,
-// and debugging on.
-//
-// D3DCOMPILE_NO_PRESHADER
-// Disables Preshaders. Using this flag will cause the compiler to not
-// pull out static expression for evaluation on the host cpu
-//
-// D3DCOMPILE_AVOID_FLOW_CONTROL
-// Hint compiler to avoid flow-control constructs where possible.
-//
-// D3DCOMPILE_PREFER_FLOW_CONTROL
-// Hint compiler to prefer flow-control constructs where possible.
-//
-// D3DCOMPILE_ENABLE_STRICTNESS
-// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
-// Specifying this flag enables the strict mode. Deprecated syntax may be
-// removed in a future release, and enabling syntax is a good way to make
-// sure your shaders comply to the latest spec.
-//
-// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
-// This enables older shaders to compile to 4_0 targets.
-//
-//----------------------------------------------------------------------------
-
-#define D3DCOMPILE_DEBUG (1 << 0)
-#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
-#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
-#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
-#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
-#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
-#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
-#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
-#define D3DCOMPILE_NO_PRESHADER (1 << 8)
-#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
-#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
-#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
-#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
-#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
-#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
-#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
-#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
-#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
-#define D3DCOMPILE_RESERVED16 (1 << 16)
-#define D3DCOMPILE_RESERVED17 (1 << 17)
-#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
-
-//----------------------------------------------------------------------------
-// D3DCOMPILE_EFFECT flags:
-// -------------------------------------
-// These flags are passed in when creating an effect, and affect
-// either compilation behavior or runtime effect behavior
-//
-// D3DCOMPILE_EFFECT_CHILD_EFFECT
-// Compile this .fx file to a child effect. Child effects have no
-// initializers for any shared values as these are initialied in the
-// master effect (pool).
-//
-// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
-// By default, performance mode is enabled. Performance mode
-// disallows mutable state objects by preventing non-literal
-// expressions from appearing in state object definitions.
-// Specifying this flag will disable the mode and allow for mutable
-// state objects.
-//
-//----------------------------------------------------------------------------
-
-#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
-#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
-
-//----------------------------------------------------------------------------
-// D3DCompile:
-// ----------
-// Compile source text into bytecode appropriate for the given target.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DCompile(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in_opt LPCSTR pSourceName,
- __in_xcount_opt(pDefines->Name != NULL) CONST D3D_SHADER_MACRO* pDefines,
- __in_opt ID3DInclude* pInclude,
- __in LPCSTR pEntrypoint,
- __in LPCSTR pTarget,
- __in UINT Flags1,
- __in UINT Flags2,
- __out ID3DBlob** ppCode,
- __out_opt ID3DBlob** ppErrorMsgs);
-
-typedef HRESULT (WINAPI *pD3DCompile)
- (LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- LPCSTR pFileName,
- CONST D3D_SHADER_MACRO* pDefines,
- ID3DInclude* pInclude,
- LPCSTR pEntrypoint,
- LPCSTR pTarget,
- UINT Flags1,
- UINT Flags2,
- ID3DBlob** ppCode,
- ID3DBlob** ppErrorMsgs);
-
-//----------------------------------------------------------------------------
-// D3DPreprocess:
-// ----------
-// Process source text with the compiler's preprocessor and return
-// the resulting text.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DPreprocess(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in_opt LPCSTR pSourceName,
- __in_opt CONST D3D_SHADER_MACRO* pDefines,
- __in_opt ID3DInclude* pInclude,
- __out ID3DBlob** ppCodeText,
- __out_opt ID3DBlob** ppErrorMsgs);
-
-typedef HRESULT (WINAPI *pD3DPreprocess)
- (LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- LPCSTR pFileName,
- CONST D3D_SHADER_MACRO* pDefines,
- ID3DInclude* pInclude,
- ID3DBlob** ppCodeText,
- ID3DBlob** ppErrorMsgs);
-
-//----------------------------------------------------------------------------
-// D3DGetDebugInfo:
-// -----------------------
-// Gets shader debug info. Debug info is generated by D3DCompile and is
-// embedded in the body of the shader.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DGetDebugInfo(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __out ID3DBlob** ppDebugInfo);
-
-//----------------------------------------------------------------------------
-// D3DReflect:
-// ----------
-// Shader code contains metadata that can be inspected via the
-// reflection APIs.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DReflect(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in REFIID pInterface,
- __out void** ppReflector);
-
-//----------------------------------------------------------------------------
-// D3DDisassemble:
-// ----------------------
-// Takes a binary shader and returns a buffer containing text assembly.
-//----------------------------------------------------------------------------
-
-#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
-#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
-#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
-#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
-#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
-
-HRESULT WINAPI
-D3DDisassemble(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in UINT Flags,
- __in_opt LPCSTR szComments,
- __out ID3DBlob** ppDisassembly);
-
-typedef HRESULT (WINAPI *pD3DDisassemble)
- (__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in UINT Flags,
- __in_opt LPCSTR szComments,
- __out ID3DBlob** ppDisassembly);
-
-//----------------------------------------------------------------------------
-// D3DDisassemble10Effect:
-// -----------------------
-// Takes a D3D10 effect interface and returns a
-// buffer containing text assembly.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DDisassemble10Effect(__in interface ID3D10Effect *pEffect,
- __in UINT Flags,
- __out ID3DBlob** ppDisassembly);
-
-//----------------------------------------------------------------------------
-// D3DGetInputSignatureBlob:
-// -----------------------
-// Retrieve the input signature from a compilation result.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DGetInputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __out ID3DBlob** ppSignatureBlob);
-
-//----------------------------------------------------------------------------
-// D3DGetOutputSignatureBlob:
-// -----------------------
-// Retrieve the output signature from a compilation result.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DGetOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __out ID3DBlob** ppSignatureBlob);
-
-//----------------------------------------------------------------------------
-// D3DGetInputAndOutputSignatureBlob:
-// -----------------------
-// Retrieve the input and output signatures from a compilation result.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DGetInputAndOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __out ID3DBlob** ppSignatureBlob);
-
-//----------------------------------------------------------------------------
-// D3DStripShader:
-// -----------------------
-// Removes unwanted blobs from a compilation result
-//----------------------------------------------------------------------------
-
-typedef enum D3DCOMPILER_STRIP_FLAGS
-{
- D3DCOMPILER_STRIP_REFLECTION_DATA = 1,
- D3DCOMPILER_STRIP_DEBUG_INFO = 2,
- D3DCOMPILER_STRIP_TEST_BLOBS = 4,
- D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
-} D3DCOMPILER_STRIP_FLAGS;
-
-HRESULT WINAPI
-D3DStripShader(__in_bcount(BytecodeLength) LPCVOID pShaderBytecode,
- __in SIZE_T BytecodeLength,
- __in UINT uStripFlags,
- __out ID3DBlob** ppStrippedBlob);
-
-//----------------------------------------------------------------------------
-// D3DGetBlobPart:
-// -----------------------
-// Extracts information from a compilation result.
-//----------------------------------------------------------------------------
-
-typedef enum D3D_BLOB_PART
-{
- D3D_BLOB_INPUT_SIGNATURE_BLOB,
- D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
- D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
- D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
- D3D_BLOB_ALL_SIGNATURE_BLOB,
- D3D_BLOB_DEBUG_INFO,
- D3D_BLOB_LEGACY_SHADER,
- D3D_BLOB_XNA_PREPASS_SHADER,
- D3D_BLOB_XNA_SHADER,
-
- // Test parts are only produced by special compiler versions and so
- // are usually not present in shaders.
- D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
- D3D_BLOB_TEST_COMPILE_DETAILS,
- D3D_BLOB_TEST_COMPILE_PERF,
-} D3D_BLOB_PART;
-
-HRESULT WINAPI
-D3DGetBlobPart(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in D3D_BLOB_PART Part,
- __in UINT Flags,
- __out ID3DBlob** ppPart);
-
-//----------------------------------------------------------------------------
-// D3DCompressShaders:
-// -----------------------
-// Compresses a set of shaders into a more compact form.
-//----------------------------------------------------------------------------
-
-typedef struct _D3D_SHADER_DATA
-{
- LPCVOID pBytecode;
- SIZE_T BytecodeLength;
-} D3D_SHADER_DATA;
-
-#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
-
-HRESULT WINAPI
-D3DCompressShaders(__in UINT uNumShaders,
- __in_ecount(uNumShaders) D3D_SHADER_DATA* pShaderData,
- __in UINT uFlags,
- __out ID3DBlob** ppCompressedData);
-
-//----------------------------------------------------------------------------
-// D3DDecompressShaders:
-// -----------------------
-// Decompresses one or more shaders from a compressed set.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DDecompressShaders(__in_bcount(SrcDataSize) LPCVOID pSrcData,
- __in SIZE_T SrcDataSize,
- __in UINT uNumShaders,
- __in UINT uStartIndex,
- __in_ecount_opt(uNumShaders) UINT* pIndices,
- __in UINT uFlags,
- __out_ecount(uNumShaders) ID3DBlob** ppShaders,
- __out_opt UINT* pTotalShaders);
-
-//----------------------------------------------------------------------------
-// D3DCreateBlob:
-// -----------------------
-// Create an ID3DBlob instance.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
-D3DCreateBlob(__in SIZE_T Size,
- __out ID3DBlob** ppBlob);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif // #ifndef __D3DCOMPILER_H__
diff --git a/3rdparty/dxsdk/Include/d3dcsx.h b/3rdparty/dxsdk/Include/d3dcsx.h
deleted file mode 100644
index 240cdbb451d..00000000000
--- a/3rdparty/dxsdk/Include/d3dcsx.h
+++ /dev/null
@@ -1,409 +0,0 @@
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// File: D3DX11GPGPU.h
-// Content: D3DX11 General Purpose GPU computing algorithms
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "d3dx11.h"
-
-#ifndef __D3DX11GPGPU_H__
-#define __D3DX11GPGPU_H__
-
-// Current name of the DLL shipped in the same SDK as this header.
-
-
-#define D3DCSX_DLL_W L"d3dcsx_43.dll"
-#define D3DCSX_DLL_A "d3dcsx_43.dll"
-
-#ifdef UNICODE
- #define D3DCSX_DLL D3DCSX_DLL_W
-#else
- #define D3DCSX_DLL D3DCSX_DLL_A
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-typedef enum D3DX11_SCAN_DATA_TYPE
-{
- D3DX11_SCAN_DATA_TYPE_FLOAT = 1,
- D3DX11_SCAN_DATA_TYPE_INT,
- D3DX11_SCAN_DATA_TYPE_UINT,
-} D3DX11_SCAN_DATA_TYPE;
-
-typedef enum D3DX11_SCAN_OPCODE
-{
- D3DX11_SCAN_OPCODE_ADD = 1,
- D3DX11_SCAN_OPCODE_MIN,
- D3DX11_SCAN_OPCODE_MAX,
- D3DX11_SCAN_OPCODE_MUL,
- D3DX11_SCAN_OPCODE_AND,
- D3DX11_SCAN_OPCODE_OR,
- D3DX11_SCAN_OPCODE_XOR,
-} D3DX11_SCAN_OPCODE;
-
-typedef enum D3DX11_SCAN_DIRECTION
-{
- D3DX11_SCAN_DIRECTION_FORWARD = 1,
- D3DX11_SCAN_DIRECTION_BACKWARD,
-} D3DX11_SCAN_DIRECTION;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX11Scan:
-//////////////////////////////////////////////////////////////////////////////
-
-// {5089b68f-e71d-4d38-be8e-f363b95a9405}
-DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05);
-
-#undef INTERFACE
-#define INTERFACE ID3DX11Scan
-
-DECLARE_INTERFACE_(ID3DX11Scan, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX11Scan
-
- STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
-
- //=============================================================================
- // Performs an unsegmented scan of a sequence in-place or out-of-place
- // ElementType element type
- // OpCode binary operation
- // Direction scan direction
- // ElementScanSize size of scan, in elements
- // pSrc input sequence on the device. pSrc==pDst for in-place scans
- // pDst output sequence on the device
- //=============================================================================
- STDMETHOD(Scan)( THIS_
- D3DX11_SCAN_DATA_TYPE ElementType,
- D3DX11_SCAN_OPCODE OpCode,
- UINT ElementScanSize,
- __in ID3D11UnorderedAccessView* pSrc,
- __in ID3D11UnorderedAccessView* pDst
- ) PURE;
-
- //=============================================================================
- // Performs a multiscan of a sequence in-place or out-of-place
- // ElementType element type
- // OpCode binary operation
- // Direction scan direction
- // ElementScanSize size of scan, in elements
- // ElementScanPitch pitch of the next scan, in elements
- // ScanCount number of scans in a multiscan
- // pSrc input sequence on the device. pSrc==pDst for in-place scans
- // pDst output sequence on the device
- //=============================================================================
- STDMETHOD(Multiscan)( THIS_
- D3DX11_SCAN_DATA_TYPE ElementType,
- D3DX11_SCAN_OPCODE OpCode,
- UINT ElementScanSize,
- UINT ElementScanPitch,
- UINT ScanCount,
- __in ID3D11UnorderedAccessView* pSrc,
- __in ID3D11UnorderedAccessView* pDst
- ) PURE;
-};
-
-
-//=============================================================================
-// Creates a scan context
-// pDevice the device context
-// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
-// MaxScanCount maximum number of scans in multiscan
-// ppScanContext new scan context
-//=============================================================================
-HRESULT WINAPI D3DX11CreateScan(
- __in ID3D11DeviceContext* pDeviceContext,
- UINT MaxElementScanSize,
- UINT MaxScanCount,
- __out ID3DX11Scan** ppScan );
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX11SegmentedScan:
-//////////////////////////////////////////////////////////////////////////////
-
-// {a915128c-d954-4c79-bfe1-64db923194d6}
-DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6);
-
-#undef INTERFACE
-#define INTERFACE ID3DX11SegmentedScan
-
-DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX11SegmentedScan
-
- STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
-
- //=============================================================================
- // Performs a segscan of a sequence in-place or out-of-place
- // ElementType element type
- // OpCode binary operation
- // Direction scan direction
- // pSrcElementFlags compact array of bits, one per element of pSrc. A set value
- // indicates the start of a new segment.
- // ElementScanSize size of scan, in elements
- // pSrc input sequence on the device. pSrc==pDst for in-place scans
- // pDst output sequence on the device
- //=============================================================================
- STDMETHOD(SegScan)( THIS_
- D3DX11_SCAN_DATA_TYPE ElementType,
- D3DX11_SCAN_OPCODE OpCode,
- UINT ElementScanSize,
- __in_opt ID3D11UnorderedAccessView* pSrc,
- __in ID3D11UnorderedAccessView* pSrcElementFlags,
- __in ID3D11UnorderedAccessView* pDst
- ) PURE;
-};
-
-
-//=============================================================================
-// Creates a segmented scan context
-// pDevice the device context
-// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
-// ppScanContext new scan context
-//=============================================================================
-HRESULT WINAPI D3DX11CreateSegmentedScan(
- __in ID3D11DeviceContext* pDeviceContext,
- UINT MaxElementScanSize,
- __out ID3DX11SegmentedScan** ppScan );
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-
-#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4
-#define D3DX11_FFT_MAX_TEMP_BUFFERS 4
-#define D3DX11_FFT_MAX_DIMENSIONS 32
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX11FFT:
-//////////////////////////////////////////////////////////////////////////////
-
-// {b3f7a938-4c93-4310-a675-b30d6de50553}
-DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53);
-
-#undef INTERFACE
-#define INTERFACE ID3DX11FFT
-
-DECLARE_INTERFACE_(ID3DX11FFT, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX11FFT
-
- // scale for forward transform (defaults to 1 if set to 0)
- STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE;
- STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE;
-
- // scale for inverse transform (defaults to 1/N if set to 0, where N is
- // the product of the transformed dimension lengths
- STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE;
- STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE;
-
- //------------------------------------------------------------------------------
- // Attaches buffers to the context and performs any required precomputation.
- // The buffers must be no smaller than the corresponding buffer sizes returned
- // by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts,
- // though care should be taken to concurrently execute multiple FFTs which share
- // temp buffers.
- //
- // NumTempBuffers number of buffers in ppTempBuffers
- // ppTempBuffers temp buffers to attach
- // NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes
- // ppPrecomputeBufferSizes buffers to hold precomputed data
- STDMETHOD(AttachBuffersAndPrecompute)( THIS_
- __in_range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers,
- __in_ecount(NumTempBuffers) ID3D11UnorderedAccessView*const* ppTempBuffers,
- __in_range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers,
- __in_ecount(NumPrecomputeBuffers) ID3D11UnorderedAccessView*const* ppPrecomputeBufferSizes ) PURE;
-
- //------------------------------------------------------------------------------
- // Call after buffers have been attached to the context, pInput and *ppOuput can
- // be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong
- // between temp buffers and the last buffer written to is stored at *ppOutput.
- // Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy).
- //
- // The format of complex data is interleaved components, e.g. (Real0, Imag0),
- // (Real1, Imag1) ... etc. Data is stored in row major order
- //
- // pInputBuffer view onto input buffer
- // ppOutpuBuffert pointer to view of output buffer
- STDMETHOD(ForwardTransform)( THIS_
- __in const ID3D11UnorderedAccessView* pInputBuffer,
- __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
-
- STDMETHOD(InverseTransform)( THIS_
- __in const ID3D11UnorderedAccessView* pInputBuffer,
- __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
-};
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX11FFT Creation Routines
-//////////////////////////////////////////////////////////////////////////////
-
-typedef enum D3DX11_FFT_DATA_TYPE
-{
- D3DX11_FFT_DATA_TYPE_REAL,
- D3DX11_FFT_DATA_TYPE_COMPLEX,
-} D3DX11_FFT_DATA_TYPE;
-
-typedef enum D3DX11_FFT_DIM_MASK
-{
- D3DX11_FFT_DIM_MASK_1D = 0x1,
- D3DX11_FFT_DIM_MASK_2D = 0x3,
- D3DX11_FFT_DIM_MASK_3D = 0x7,
-} D3DX11_FFT_DIM_MASK;
-
-typedef struct D3DX11_FFT_DESC
-{
- UINT NumDimensions; // number of dimensions
- UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension
- UINT DimensionMask; // a bit set for each dimensions to transform
- // (see D3DX11_FFT_DIM_MASK for common masks)
- D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain
-} D3DX11_FFT_DESC;
-
-
-//------------------------------------------------------------------------------
-// NumTempBufferSizes Number of temporary buffers needed
-// pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers
-// NumPrecomputeBufferSizes Number of precompute buffers needed
-// pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers
-//------------------------------------------------------------------------------
-
-typedef struct D3DX11_FFT_BUFFER_INFO
-{
- __range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes;
- UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS];
- __range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes;
- UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS];
-} D3DX11_FFT_BUFFER_INFO;
-
-
-typedef enum D3DX11_FFT_CREATE_FLAG
-{
- D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers
-} D3DX11_FFT_CREATE_FLAG;
-
-
-//------------------------------------------------------------------------------
-// Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT.
-// The descriptor describes the shape of the data as well as the scaling factors
-// that should be used for forward and inverse transforms.
-// The FFT computation may require temporaries that act as ping-pong buffers
-// and for other purposes. aTempSizes is a list of the sizes required for
-// temporaries. Likewise, some data may need to be precomputed and the sizes
-// of those sizes are returned in aPrecomputedBufferSizes.
-//
-// To perform a computation, follow these steps:
-// 1) Create the FFT context object
-// 2) Precompute (and Attach temp working buffers of at least the required size)
-// 3) Call Compute() on some input data
-//
-// Compute() may be called repeatedly with different inputs and transform
-// directions. When finished with the FFT work, release the FFT interface()
-//
-// Device Direct3DDeviceContext to use in
-// pDesc Descriptor for FFT transform in
-// Count the number of 1D FFTs to perform in
-// Flags See D3DX11_FFT_CREATE_FLAG in
-// pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out
-// ppFFT Pointer to returned context pointer out
-//------------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX11CreateFFT(
- ID3D11DeviceContext* pDeviceContext,
- __in const D3DX11_FFT_DESC* pDesc,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-
-HRESULT WINAPI D3DX11CreateFFT1DReal(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-HRESULT WINAPI D3DX11CreateFFT1DComplex(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-HRESULT WINAPI D3DX11CreateFFT2DReal(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Y,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-HRESULT WINAPI D3DX11CreateFFT2DComplex(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Y,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-HRESULT WINAPI D3DX11CreateFFT3DReal(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Y,
- UINT Z,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-HRESULT WINAPI D3DX11CreateFFT3DComplex(
- ID3D11DeviceContext* pDeviceContext,
- UINT X,
- UINT Y,
- UINT Z,
- UINT Flags,
- __out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
- __out ID3DX11FFT** ppFFT
- );
-
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3DX11GPGPU_H__
-
-
diff --git a/3rdparty/dxsdk/Include/d3dx10.h b/3rdparty/dxsdk/Include/d3dx10.h
deleted file mode 100644
index 5cdcd51d962..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx10.h
-// Content: D3DX10 utility library
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef __D3DX10_INTERNAL__
-#error Incorrect D3DX10 header used
-#endif
-
-#ifndef __D3DX10_H__
-#define __D3DX10_H__
-
-
-// Defines
-#include <limits.h>
-#include <float.h>
-
-#define D3DX10_DEFAULT ((UINT) -1)
-#define D3DX10_FROM_FILE ((UINT) -3)
-#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
-
-#ifndef D3DX10INLINE
-#ifdef _MSC_VER
- #if (_MSC_VER >= 1200)
- #define D3DX10INLINE __forceinline
- #else
- #define D3DX10INLINE __inline
- #endif
-#else
- #ifdef __cplusplus
- #define D3DX10INLINE inline
- #else
- #define D3DX10INLINE
- #endif
-#endif
-#endif
-
-
-
-// Includes
-#include "d3d10.h"
-#include "d3dx10.h"
-#include "d3dx10math.h"
-#include "d3dx10core.h"
-#include "d3dx10tex.h"
-#include "d3dx10mesh.h"
-#include "d3dx10async.h"
-
-
-// Errors
-#define _FACDD 0x876
-#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
-
-enum _D3DX10_ERR {
- D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
- D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
- D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
- D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
- D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
- D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
- D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
- D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
- D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
-};
-
-
-#endif //__D3DX10_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx10async.h b/3rdparty/dxsdk/Include/d3dx10async.h
deleted file mode 100644
index d1b1fc53b5c..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10async.h
+++ /dev/null
@@ -1,290 +0,0 @@
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// File: D3DX10Async.h
-// Content: D3DX10 Asynchronous Effect / Shader loaders / compilers
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3DX10ASYNC_H__
-#define __D3DX10ASYNC_H__
-
-#include "d3dx10.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-//----------------------------------------------------------------------------
-// D3DX10Compile:
-// ------------------
-// Compiles an effect or shader.
-//
-// Parameters:
-// pSrcFile
-// Source file name.
-// hSrcModule
-// Module handle. if NULL, current module will be used.
-// pSrcResource
-// Resource name in module.
-// pSrcData
-// Pointer to source code.
-// SrcDataLen
-// Size of source code, in bytes.
-// pDefines
-// Optional NULL-terminated array of preprocessor macro definitions.
-// pInclude
-// Optional interface pointer to use for handling #include directives.
-// If this parameter is NULL, #includes will be honored when compiling
-// from file, and will error when compiling from resource or memory.
-// pFunctionName
-// Name of the entrypoint function where execution should begin.
-// pProfile
-// Instruction set to be used when generating code. Currently supported
-// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
-// "vs_3_sw", "vs_4_0", "vs_4_1",
-// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
-// "ps_3_sw", "ps_4_0", "ps_4_1",
-// "gs_4_0", "gs_4_1",
-// "tx_1_0",
-// "fx_4_0", "fx_4_1"
-// Note that this entrypoint does not compile fx_2_0 targets, for that
-// you need to use the D3DX9 function.
-// Flags1
-// See D3D10_SHADER_xxx flags.
-// Flags2
-// See D3D10_EFFECT_xxx flags.
-// ppShader
-// Returns a buffer containing the created shader. This buffer contains
-// the compiled shader code, as well as any embedded debug and symbol
-// table info. (See D3D10GetShaderConstantTable)
-// ppErrorMsgs
-// Returns a buffer containing a listing of errors and warnings that were
-// encountered during the compile. If you are running in a debugger,
-// these are the same messages you will see in your debug output.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CompileFromFile D3DX10CompileFromFileW
-#else
-#define D3DX10CompileFromFile D3DX10CompileFromFileA
-#endif
-
-HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CompileFromResource D3DX10CompileFromResourceW
-#else
-#define D3DX10CompileFromResource D3DX10CompileFromResourceA
-#endif
-
-HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-//----------------------------------------------------------------------------
-// D3DX10CreateEffectFromXXXX:
-// --------------------------
-// Creates an effect from a binary effect or file
-//
-// Parameters:
-//
-// [in]
-//
-//
-// pFileName
-// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load
-//
-// hModule
-// Handle to the module containing the resource to compile from
-// pResourceName
-// Name of the resource within hModule to compile from
-//
-// pData
-// Blob of effect data, either ASCII (uncompiled) or binary (compiled)
-// DataLength
-// Length of the data blob
-//
-// pDefines
-// Optional NULL-terminated array of preprocessor macro definitions.
-// pInclude
-// Optional interface pointer to use for handling #include directives.
-// If this parameter is NULL, #includes will be honored when compiling
-// from file, and will error when compiling from resource or memory.
-// pProfile
-// Profile to use when compiling the effect.
-// HLSLFlags
-// Compilation flags pertaining to shaders and data types, honored by
-// the HLSL compiler
-// FXFlags
-// Compilation flags pertaining to Effect compilation, honored
-// by the Effect compiler
-// pDevice
-// Pointer to the D3D10 device on which to create Effect resources
-// pEffectPool
-// Pointer to an Effect pool to share variables with or NULL
-//
-// [out]
-//
-// ppEffect
-// Address of the newly created Effect interface
-// ppEffectPool
-// Address of the newly created Effect pool interface
-// ppErrors
-// If non-NULL, address of a buffer with error messages that occurred
-// during parsing or compilation
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//----------------------------------------------------------------------------
-
-
-HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-
-#ifdef UNICODE
-#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW
-#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW
-#else
-#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA
-#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA
-#endif
-
-HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
- ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
- ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
- ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
- ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW
-#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW
-#else
-#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA
-#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA
-#endif
-
-HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW
-#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW
-#else
-#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA
-#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA
-#endif
-
-//----------------------------------------------------------------------------
-// Async processors
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
- ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
-
-HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
-
-HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
- ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
-
-HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
-
-
-
-//----------------------------------------------------------------------------
-// D3DX10 Asynchronous texture I/O (advanced mode)
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
-
-#ifdef UNICODE
-#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW
-#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW
-#else
-#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA
-#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA
-#endif
-
-HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
-HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
-HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3DX10ASYNC_H__
-
-
diff --git a/3rdparty/dxsdk/Include/d3dx10core.h b/3rdparty/dxsdk/Include/d3dx10core.h
deleted file mode 100644
index 290a00421ed..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10core.h
+++ /dev/null
@@ -1,444 +0,0 @@
-///////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx10core.h
-// Content: D3DX10 core types and functions
-//
-///////////////////////////////////////////////////////////////////////////
-
-#include "d3dx10.h"
-
-#ifndef __D3DX10CORE_H__
-#define __D3DX10CORE_H__
-
-// Current name of the DLL shipped in the same SDK as this header.
-
-
-#define D3DX10_DLL_W L"d3dx10_43.dll"
-#define D3DX10_DLL_A "d3dx10_43.dll"
-
-#ifdef UNICODE
- #define D3DX10_DLL D3DX10_DLL_W
-#else
- #define D3DX10_DLL D3DX10_DLL_A
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-///////////////////////////////////////////////////////////////////////////
-// D3DX10_SDK_VERSION:
-// -----------------
-// This identifier is passed to D3DX10CheckVersion in order to ensure that an
-// application was built against the correct header files and lib files.
-// This number is incremented whenever a header (or other) change would
-// require applications to be rebuilt. If the version doesn't match,
-// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.)
-///////////////////////////////////////////////////////////////////////////
-
-
-#define D3DX10_SDK_VERSION 43
-
-
-///////////////////////////////////////////////////////////////////////////
-// D3DX10CreateDevice
-// D3DX10CreateDeviceAndSwapChain
-// D3DX10GetFeatureLevel1
-///////////////////////////////////////////////////////////////////////////
-HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter,
- D3D10_DRIVER_TYPE DriverType,
- HMODULE Software,
- UINT Flags,
- ID3D10Device **ppDevice);
-
-HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter,
- D3D10_DRIVER_TYPE DriverType,
- HMODULE Software,
- UINT Flags,
- DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
- IDXGISwapChain **ppSwapChain,
- ID3D10Device **ppDevice);
-
-typedef interface ID3D10Device1 ID3D10Device1;
-HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1);
-
-
-#ifdef D3D_DIAG_DLL
-BOOL WINAPI D3DX10DebugMute(BOOL Mute);
-#endif
-HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-
-//////////////////////////////////////////////////////////////////////////////
-// D3DX10_SPRITE flags:
-// -----------------
-// D3DX10_SPRITE_SAVE_STATE
-// Specifies device state should be saved and restored in Begin/End.
-// D3DX10SPRITE_SORT_TEXTURE
-// Sprites are sorted by texture prior to drawing. This is recommended when
-// drawing non-overlapping sprites of uniform depth. For example, drawing
-// screen-aligned text with ID3DX10Font.
-// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK
-// Sprites are sorted by depth front-to-back prior to drawing. This is
-// recommended when drawing opaque sprites of varying depths.
-// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT
-// Sprites are sorted by depth back-to-front prior to drawing. This is
-// recommended when drawing transparent sprites of varying depths.
-// D3DX10SPRITE_ADDREF_TEXTURES
-// AddRef/Release all textures passed in to DrawSpritesBuffered
-//////////////////////////////////////////////////////////////////////////////
-
-typedef enum _D3DX10_SPRITE_FLAG
-{
- D3DX10_SPRITE_SORT_TEXTURE = 0x01,
- D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02,
- D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04,
- D3DX10_SPRITE_SAVE_STATE = 0x08,
- D3DX10_SPRITE_ADDREF_TEXTURES = 0x10,
-} D3DX10_SPRITE_FLAG;
-
-typedef struct _D3DX10_SPRITE
-{
- D3DXMATRIX matWorld;
-
- D3DXVECTOR2 TexCoord;
- D3DXVECTOR2 TexSize;
-
- D3DXCOLOR ColorModulate;
-
- ID3D10ShaderResourceView *pTexture;
- UINT TextureIndex;
-} D3DX10_SPRITE;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX10Sprite:
-// ------------
-// This object intends to provide an easy way to drawing sprites using D3D.
-//
-// Begin -
-// Prepares device for drawing sprites.
-//
-// Draw -
-// Draws a sprite
-//
-// Flush -
-// Forces all batched sprites to submitted to the device.
-//
-// End -
-// Restores device state to how it was when Begin was called.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-typedef interface ID3DX10Sprite ID3DX10Sprite;
-typedef interface ID3DX10Sprite *LPD3DX10SPRITE;
-
-
-// {BA0B762D-8D28-43ec-B9DC-2F84443B0614}
-DEFINE_GUID(IID_ID3DX10Sprite,
-0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
-
-
-#undef INTERFACE
-#define INTERFACE ID3DX10Sprite
-
-DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX10Sprite
- STDMETHOD(Begin)(THIS_ UINT flags) PURE;
-
- STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE;
- STDMETHOD(Flush)(THIS) PURE;
-
- STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE;
- STDMETHOD(End)(THIS) PURE;
-
- STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
- STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
- STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
- STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
-
- STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
-};
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-HRESULT WINAPI
- D3DX10CreateSprite(
- ID3D10Device* pDevice,
- UINT cDeviceBufferSize,
- LPD3DX10SPRITE* ppSprite);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX10ThreadPump:
-//////////////////////////////////////////////////////////////////////////////
-
-#undef INTERFACE
-#define INTERFACE ID3DX10DataLoader
-
-DECLARE_INTERFACE(ID3DX10DataLoader)
-{
- STDMETHOD(Load)(THIS) PURE;
- STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE ID3DX10DataProcessor
-
-DECLARE_INTERFACE(ID3DX10DataProcessor)
-{
- STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
- STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
-};
-
-// {C93FECFA-6967-478a-ABBC-402D90621FCB}
-DEFINE_GUID(IID_ID3DX10ThreadPump,
-0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
-
-#undef INTERFACE
-#define INTERFACE ID3DX10ThreadPump
-
-DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX10ThreadPump
- STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
- STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
-
- STDMETHOD(WaitForAllItems)(THIS) PURE;
- STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
-
- STDMETHOD(PurgeAllItems)(THIS) PURE;
- STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
-
-};
-
-HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX10Font:
-// ----------
-// Font objects contain the textures and resources needed to render a specific
-// font on a specific device.
-//
-// GetGlyphData -
-// Returns glyph cache data, for a given glyph.
-//
-// PreloadCharacters/PreloadGlyphs/PreloadText -
-// Preloads glyphs into the glyph cache textures.
-//
-// DrawText -
-// Draws formatted text on a D3D device. Some parameters are
-// surprisingly similar to those of GDI's DrawText function. See GDI
-// documentation for a detailed description of these parameters.
-// If pSprite is NULL, an internal sprite object will be used.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-typedef struct _D3DX10_FONT_DESCA
-{
- INT Height;
- UINT Width;
- UINT Weight;
- UINT MipLevels;
- BOOL Italic;
- BYTE CharSet;
- BYTE OutputPrecision;
- BYTE Quality;
- BYTE PitchAndFamily;
- CHAR FaceName[LF_FACESIZE];
-
-} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA;
-
-typedef struct _D3DX10_FONT_DESCW
-{
- INT Height;
- UINT Width;
- UINT Weight;
- UINT MipLevels;
- BOOL Italic;
- BYTE CharSet;
- BYTE OutputPrecision;
- BYTE Quality;
- BYTE PitchAndFamily;
- WCHAR FaceName[LF_FACESIZE];
-
-} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW;
-
-#ifdef UNICODE
-typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC;
-typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC;
-#else
-typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC;
-typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC;
-#endif
-
-
-typedef interface ID3DX10Font ID3DX10Font;
-typedef interface ID3DX10Font *LPD3DX10FONT;
-
-
-// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
-DEFINE_GUID(IID_ID3DX10Font,
-0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
-
-
-#undef INTERFACE
-#define INTERFACE ID3DX10Font
-
-DECLARE_INTERFACE_(ID3DX10Font, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX10Font
- STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
- STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE;
- STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE;
- STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
- STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
-
- STDMETHOD_(HDC, GetDC)(THIS) PURE;
- STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
-
- STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
- STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
- STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
- STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
-
- STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
- STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
-
-#ifdef __cplusplus
-#ifdef UNICODE
- HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); }
- HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
-#else
- HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); }
- HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
-#endif
-#endif //__cplusplus
-};
-
-#ifndef GetTextMetrics
-#ifdef UNICODE
-#define GetTextMetrics GetTextMetricsW
-#else
-#define GetTextMetrics GetTextMetricsA
-#endif
-#endif
-
-#ifndef DrawText
-#ifdef UNICODE
-#define DrawText DrawTextW
-#else
-#define DrawText DrawTextA
-#endif
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-HRESULT WINAPI
- D3DX10CreateFontA(
- ID3D10Device* pDevice,
- INT Height,
- UINT Width,
- UINT Weight,
- UINT MipLevels,
- BOOL Italic,
- UINT CharSet,
- UINT OutputPrecision,
- UINT Quality,
- UINT PitchAndFamily,
- LPCSTR pFaceName,
- LPD3DX10FONT* ppFont);
-
-HRESULT WINAPI
- D3DX10CreateFontW(
- ID3D10Device* pDevice,
- INT Height,
- UINT Width,
- UINT Weight,
- UINT MipLevels,
- BOOL Italic,
- UINT CharSet,
- UINT OutputPrecision,
- UINT Quality,
- UINT PitchAndFamily,
- LPCWSTR pFaceName,
- LPD3DX10FONT* ppFont);
-
-#ifdef UNICODE
-#define D3DX10CreateFont D3DX10CreateFontW
-#else
-#define D3DX10CreateFont D3DX10CreateFontA
-#endif
-
-
-HRESULT WINAPI
- D3DX10CreateFontIndirectA(
- ID3D10Device* pDevice,
- CONST D3DX10_FONT_DESCA* pDesc,
- LPD3DX10FONT* ppFont);
-
-HRESULT WINAPI
- D3DX10CreateFontIndirectW(
- ID3D10Device* pDevice,
- CONST D3DX10_FONT_DESCW* pDesc,
- LPD3DX10FONT* ppFont);
-
-#ifdef UNICODE
-#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW
-#else
-#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA
-#endif
-
-HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-///////////////////////////////////////////////////////////////////////////
-
-#define _FACD3D 0x876
-#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
-#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
-
-#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
-#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
-
-#endif //__D3DX10CORE_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx10math.h b/3rdparty/dxsdk/Include/d3dx10math.h
deleted file mode 100644
index a4b8e2da166..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10math.h
+++ /dev/null
@@ -1,1866 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: D3DX10math.h
-// Content: D3DX10 math types and functions
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "D3DX10.h"
-
-// D3DX10 and D3DX9 math look the same. You can include either one into your project.
-// We are intentionally using the header define from D3DX9 math to prevent double-inclusion.
-#ifndef __D3DX9MATH_H__
-#define __D3DX9MATH_H__
-
-#include <math.h>
-#if _MSC_VER >= 1200
-#pragma warning(push)
-#endif
-#pragma warning(disable:4201) // anonymous unions warning
-
-//===========================================================================
-//
-// Type definitions from D3D9
-//
-//===========================================================================
-
-#ifndef D3DVECTOR_DEFINED
-typedef struct _D3DVECTOR {
- float x;
- float y;
- float z;
-} D3DVECTOR;
-#define D3DVECTOR_DEFINED
-#endif
-
-#ifndef D3DMATRIX_DEFINED
-typedef struct _D3DMATRIX {
- union {
- struct {
- float _11, _12, _13, _14;
- float _21, _22, _23, _24;
- float _31, _32, _33, _34;
- float _41, _42, _43, _44;
-
- };
- float m[4][4];
- };
-} D3DMATRIX;
-#define D3DMATRIX_DEFINED
-#endif
-
-//===========================================================================
-//
-// General purpose utilities
-//
-//===========================================================================
-#define D3DX_PI (3.14159265358979323846)
-#define D3DX_1BYPI ( 1.0 / D3DX_PI )
-
-#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0))
-#define D3DXToDegree( radian ) ((radian) * (180.0 / D3DX_PI))
-
-
-
-//===========================================================================
-//
-// 16 bit floating point numbers
-//
-//===========================================================================
-
-#define D3DX_16F_DIG 3 // # of decimal digits of precision
-#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0
-#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa
-#define D3DX_16F_MAX 6.550400e+004 // max value
-#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent
-#define D3DX_16F_MAX_EXP 15 // max binary exponent
-#define D3DX_16F_MIN 6.1035156e-5f // min positive value
-#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent
-#define D3DX_16F_MIN_EXP (-14) // min binary exponent
-#define D3DX_16F_RADIX 2 // exponent radix
-#define D3DX_16F_ROUNDS 1 // addition rounding: near
-#define D3DX_16F_SIGN_MASK 0x8000
-#define D3DX_16F_EXP_MASK 0x7C00
-#define D3DX_16F_FRAC_MASK 0x03FF
-
-typedef struct D3DXFLOAT16
-{
-#ifdef __cplusplus
-public:
- D3DXFLOAT16() {};
- D3DXFLOAT16( FLOAT );
- D3DXFLOAT16( CONST D3DXFLOAT16& );
-
- // casting
- operator FLOAT ();
-
- // binary operators
- BOOL operator == ( CONST D3DXFLOAT16& ) const;
- BOOL operator != ( CONST D3DXFLOAT16& ) const;
-
-protected:
-#endif //__cplusplus
- WORD value;
-} D3DXFLOAT16, *LPD3DXFLOAT16;
-
-
-
-//===========================================================================
-//
-// Vectors
-//
-//===========================================================================
-
-
-//--------------------------
-// 2D Vector
-//--------------------------
-typedef struct D3DXVECTOR2
-{
-#ifdef __cplusplus
-public:
- D3DXVECTOR2() {};
- D3DXVECTOR2( CONST FLOAT * );
- D3DXVECTOR2( CONST D3DXFLOAT16 * );
- D3DXVECTOR2( FLOAT x, FLOAT y );
-
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& );
- D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& );
- D3DXVECTOR2& operator *= ( FLOAT );
- D3DXVECTOR2& operator /= ( FLOAT );
-
- // unary operators
- D3DXVECTOR2 operator + () const;
- D3DXVECTOR2 operator - () const;
-
- // binary operators
- D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const;
- D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const;
- D3DXVECTOR2 operator * ( FLOAT ) const;
- D3DXVECTOR2 operator / ( FLOAT ) const;
-
- friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& );
-
- BOOL operator == ( CONST D3DXVECTOR2& ) const;
- BOOL operator != ( CONST D3DXVECTOR2& ) const;
-
-
-public:
-#endif //__cplusplus
- FLOAT x, y;
-} D3DXVECTOR2, *LPD3DXVECTOR2;
-
-
-
-//--------------------------
-// 2D Vector (16 bit)
-//--------------------------
-
-typedef struct D3DXVECTOR2_16F
-{
-#ifdef __cplusplus
-public:
- D3DXVECTOR2_16F() {};
- D3DXVECTOR2_16F( CONST FLOAT * );
- D3DXVECTOR2_16F( CONST D3DXFLOAT16 * );
- D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y );
-
- // casting
- operator D3DXFLOAT16* ();
- operator CONST D3DXFLOAT16* () const;
-
- // binary operators
- BOOL operator == ( CONST D3DXVECTOR2_16F& ) const;
- BOOL operator != ( CONST D3DXVECTOR2_16F& ) const;
-
-public:
-#endif //__cplusplus
- D3DXFLOAT16 x, y;
-
-} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F;
-
-
-
-//--------------------------
-// 3D Vector
-//--------------------------
-#ifdef __cplusplus
-typedef struct D3DXVECTOR3 : public D3DVECTOR
-{
-public:
- D3DXVECTOR3() {};
- D3DXVECTOR3( CONST FLOAT * );
- D3DXVECTOR3( CONST D3DVECTOR& );
- D3DXVECTOR3( CONST D3DXFLOAT16 * );
- D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z );
-
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
- D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& );
- D3DXVECTOR3& operator *= ( FLOAT );
- D3DXVECTOR3& operator /= ( FLOAT );
-
- // unary operators
- D3DXVECTOR3 operator + () const;
- D3DXVECTOR3 operator - () const;
-
- // binary operators
- D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const;
- D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const;
- D3DXVECTOR3 operator * ( FLOAT ) const;
- D3DXVECTOR3 operator / ( FLOAT ) const;
-
- friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& );
-
- BOOL operator == ( CONST D3DXVECTOR3& ) const;
- BOOL operator != ( CONST D3DXVECTOR3& ) const;
-
-} D3DXVECTOR3, *LPD3DXVECTOR3;
-
-#else //!__cplusplus
-typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
-#endif //!__cplusplus
-
-
-
-//--------------------------
-// 3D Vector (16 bit)
-//--------------------------
-typedef struct D3DXVECTOR3_16F
-{
-#ifdef __cplusplus
-public:
- D3DXVECTOR3_16F() {};
- D3DXVECTOR3_16F( CONST FLOAT * );
- D3DXVECTOR3_16F( CONST D3DVECTOR& );
- D3DXVECTOR3_16F( CONST D3DXFLOAT16 * );
- D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z );
-
- // casting
- operator D3DXFLOAT16* ();
- operator CONST D3DXFLOAT16* () const;
-
- // binary operators
- BOOL operator == ( CONST D3DXVECTOR3_16F& ) const;
- BOOL operator != ( CONST D3DXVECTOR3_16F& ) const;
-
-public:
-#endif //__cplusplus
- D3DXFLOAT16 x, y, z;
-
-} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F;
-
-
-
-//--------------------------
-// 4D Vector
-//--------------------------
-typedef struct D3DXVECTOR4
-{
-#ifdef __cplusplus
-public:
- D3DXVECTOR4() {};
- D3DXVECTOR4( CONST FLOAT* );
- D3DXVECTOR4( CONST D3DXFLOAT16* );
- D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w );
- D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
-
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& );
- D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& );
- D3DXVECTOR4& operator *= ( FLOAT );
- D3DXVECTOR4& operator /= ( FLOAT );
-
- // unary operators
- D3DXVECTOR4 operator + () const;
- D3DXVECTOR4 operator - () const;
-
- // binary operators
- D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const;
- D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const;
- D3DXVECTOR4 operator * ( FLOAT ) const;
- D3DXVECTOR4 operator / ( FLOAT ) const;
-
- friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& );
-
- BOOL operator == ( CONST D3DXVECTOR4& ) const;
- BOOL operator != ( CONST D3DXVECTOR4& ) const;
-
-public:
-#endif //__cplusplus
- FLOAT x, y, z, w;
-} D3DXVECTOR4, *LPD3DXVECTOR4;
-
-
-//--------------------------
-// 4D Vector (16 bit)
-//--------------------------
-typedef struct D3DXVECTOR4_16F
-{
-#ifdef __cplusplus
-public:
- D3DXVECTOR4_16F() {};
- D3DXVECTOR4_16F( CONST FLOAT * );
- D3DXVECTOR4_16F( CONST D3DXFLOAT16* );
- D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w );
- D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w );
-
- // casting
- operator D3DXFLOAT16* ();
- operator CONST D3DXFLOAT16* () const;
-
- // binary operators
- BOOL operator == ( CONST D3DXVECTOR4_16F& ) const;
- BOOL operator != ( CONST D3DXVECTOR4_16F& ) const;
-
-public:
-#endif //__cplusplus
- D3DXFLOAT16 x, y, z, w;
-
-} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F;
-
-
-
-//===========================================================================
-//
-// Matrices
-//
-//===========================================================================
-#ifdef __cplusplus
-typedef struct D3DXMATRIX : public D3DMATRIX
-{
-public:
- D3DXMATRIX() {};
- D3DXMATRIX( CONST FLOAT * );
- D3DXMATRIX( CONST D3DMATRIX& );
- D3DXMATRIX( CONST D3DXFLOAT16 * );
- D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
- FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
- FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
- FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 );
-
-
- // access grants
- FLOAT& operator () ( UINT Row, UINT Col );
- FLOAT operator () ( UINT Row, UINT Col ) const;
-
- // casting operators
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXMATRIX& operator *= ( CONST D3DXMATRIX& );
- D3DXMATRIX& operator += ( CONST D3DXMATRIX& );
- D3DXMATRIX& operator -= ( CONST D3DXMATRIX& );
- D3DXMATRIX& operator *= ( FLOAT );
- D3DXMATRIX& operator /= ( FLOAT );
-
- // unary operators
- D3DXMATRIX operator + () const;
- D3DXMATRIX operator - () const;
-
- // binary operators
- D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const;
- D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const;
- D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const;
- D3DXMATRIX operator * ( FLOAT ) const;
- D3DXMATRIX operator / ( FLOAT ) const;
-
- friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& );
-
- BOOL operator == ( CONST D3DXMATRIX& ) const;
- BOOL operator != ( CONST D3DXMATRIX& ) const;
-
-} D3DXMATRIX, *LPD3DXMATRIX;
-
-#else //!__cplusplus
-typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
-#endif //!__cplusplus
-
-
-//---------------------------------------------------------------------------
-// Aligned Matrices
-//
-// This class helps keep matrices 16-byte aligned as preferred by P4 cpus.
-// It aligns matrices on the stack and on the heap or in global scope.
-// It does this using __declspec(align(16)) which works on VC7 and on VC 6
-// with the processor pack. Unfortunately there is no way to detect the
-// latter so this is turned on only on VC7. On other compilers this is the
-// the same as D3DXMATRIX.
-//
-// Using this class on a compiler that does not actually do the alignment
-// can be dangerous since it will not expose bugs that ignore alignment.
-// E.g if an object of this class in inside a struct or class, and some code
-// memcopys data in it assuming tight packing. This could break on a compiler
-// that eventually start aligning the matrix.
-//---------------------------------------------------------------------------
-#ifdef __cplusplus
-typedef struct _D3DXMATRIXA16 : public D3DXMATRIX
-{
- _D3DXMATRIXA16() {};
- _D3DXMATRIXA16( CONST FLOAT * );
- _D3DXMATRIXA16( CONST D3DMATRIX& );
- _D3DXMATRIXA16( CONST D3DXFLOAT16 * );
- _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14,
- FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24,
- FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34,
- FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 );
-
- // new operators
- void* operator new ( size_t );
- void* operator new[] ( size_t );
-
- // delete operators
- void operator delete ( void* ); // These are NOT virtual; Do not
- void operator delete[] ( void* ); // cast to D3DXMATRIX and delete.
-
- // assignment operators
- _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& );
-
-} _D3DXMATRIXA16;
-
-#else //!__cplusplus
-typedef D3DXMATRIX _D3DXMATRIXA16;
-#endif //!__cplusplus
-
-
-
-#if _MSC_VER >= 1300 // VC7
-#define D3DX_ALIGN16 __declspec(align(16))
-#else
-#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing.
-#endif
-
-typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16;
-
-
-
-//===========================================================================
-//
-// Quaternions
-//
-//===========================================================================
-typedef struct D3DXQUATERNION
-{
-#ifdef __cplusplus
-public:
- D3DXQUATERNION() {};
- D3DXQUATERNION( CONST FLOAT * );
- D3DXQUATERNION( CONST D3DXFLOAT16 * );
- D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
-
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& );
- D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& );
- D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& );
- D3DXQUATERNION& operator *= ( FLOAT );
- D3DXQUATERNION& operator /= ( FLOAT );
-
- // unary operators
- D3DXQUATERNION operator + () const;
- D3DXQUATERNION operator - () const;
-
- // binary operators
- D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const;
- D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const;
- D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const;
- D3DXQUATERNION operator * ( FLOAT ) const;
- D3DXQUATERNION operator / ( FLOAT ) const;
-
- friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& );
-
- BOOL operator == ( CONST D3DXQUATERNION& ) const;
- BOOL operator != ( CONST D3DXQUATERNION& ) const;
-
-#endif //__cplusplus
- FLOAT x, y, z, w;
-} D3DXQUATERNION, *LPD3DXQUATERNION;
-
-
-//===========================================================================
-//
-// Planes
-//
-//===========================================================================
-typedef struct D3DXPLANE
-{
-#ifdef __cplusplus
-public:
- D3DXPLANE() {};
- D3DXPLANE( CONST FLOAT* );
- D3DXPLANE( CONST D3DXFLOAT16* );
- D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d );
-
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXPLANE& operator *= ( FLOAT );
- D3DXPLANE& operator /= ( FLOAT );
-
- // unary operators
- D3DXPLANE operator + () const;
- D3DXPLANE operator - () const;
-
- // binary operators
- D3DXPLANE operator * ( FLOAT ) const;
- D3DXPLANE operator / ( FLOAT ) const;
-
- friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& );
-
- BOOL operator == ( CONST D3DXPLANE& ) const;
- BOOL operator != ( CONST D3DXPLANE& ) const;
-
-#endif //__cplusplus
- FLOAT a, b, c, d;
-} D3DXPLANE, *LPD3DXPLANE;
-
-
-//===========================================================================
-//
-// Colors
-//
-//===========================================================================
-
-typedef struct D3DXCOLOR
-{
-#ifdef __cplusplus
-public:
- D3DXCOLOR() {};
- D3DXCOLOR( UINT argb );
- D3DXCOLOR( CONST FLOAT * );
- D3DXCOLOR( CONST D3DXFLOAT16 * );
- D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a );
-
- // casting
- operator UINT () const;
-
- operator FLOAT* ();
- operator CONST FLOAT* () const;
-
- // assignment operators
- D3DXCOLOR& operator += ( CONST D3DXCOLOR& );
- D3DXCOLOR& operator -= ( CONST D3DXCOLOR& );
- D3DXCOLOR& operator *= ( FLOAT );
- D3DXCOLOR& operator /= ( FLOAT );
-
- // unary operators
- D3DXCOLOR operator + () const;
- D3DXCOLOR operator - () const;
-
- // binary operators
- D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const;
- D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const;
- D3DXCOLOR operator * ( FLOAT ) const;
- D3DXCOLOR operator / ( FLOAT ) const;
-
- friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& );
-
- BOOL operator == ( CONST D3DXCOLOR& ) const;
- BOOL operator != ( CONST D3DXCOLOR& ) const;
-
-#endif //__cplusplus
- FLOAT r, g, b, a;
-} D3DXCOLOR, *LPD3DXCOLOR;
-
-
-
-//===========================================================================
-//
-// D3DX math functions:
-//
-// NOTE:
-// * All these functions can take the same object as in and out parameters.
-//
-// * Out parameters are typically also returned as return values, so that
-// the output of one function may be used as a parameter to another.
-//
-//===========================================================================
-
-//--------------------------
-// Float16
-//--------------------------
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Converts an array 32-bit floats to 16-bit floats
-D3DXFLOAT16* WINAPI D3DXFloat32To16Array
- ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n );
-
-// Converts an array 16-bit floats to 32-bit floats
-FLOAT* WINAPI D3DXFloat16To32Array
- ( __out_ecount(n) FLOAT *pOut, __in_ecount(n) CONST D3DXFLOAT16 *pIn, UINT n );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// 2D Vector
-//--------------------------
-
-// inline
-
-FLOAT D3DXVec2Length
- ( CONST D3DXVECTOR2 *pV );
-
-FLOAT D3DXVec2LengthSq
- ( CONST D3DXVECTOR2 *pV );
-
-FLOAT D3DXVec2Dot
- ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-// Z component of ((x1,y1,0) cross (x2,y2,0))
-FLOAT D3DXVec2CCW
- ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-D3DXVECTOR2* D3DXVec2Add
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-D3DXVECTOR2* D3DXVec2Subtract
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-// Minimize each component. x = min(x1, x2), y = min(y1, y2)
-D3DXVECTOR2* D3DXVec2Minimize
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-// Maximize each component. x = max(x1, x2), y = max(y1, y2)
-D3DXVECTOR2* D3DXVec2Maximize
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 );
-
-D3DXVECTOR2* D3DXVec2Scale
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s );
-
-// Linear interpolation. V1 + s(V2-V1)
-D3DXVECTOR2* D3DXVec2Lerp
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
- FLOAT s );
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-D3DXVECTOR2* WINAPI D3DXVec2Normalize
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV );
-
-// Hermite interpolation between position V1, tangent T1 (when s == 0)
-// and position V2, tangent T2 (when s == 1).
-D3DXVECTOR2* WINAPI D3DXVec2Hermite
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
- CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s );
-
-// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
-D3DXVECTOR2* WINAPI D3DXVec2CatmullRom
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
- CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s );
-
-// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
-D3DXVECTOR2* WINAPI D3DXVec2BaryCentric
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
- CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g);
-
-// Transform (x, y, 0, 1) by matrix.
-D3DXVECTOR4* WINAPI D3DXVec2Transform
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
-
-// Transform (x, y, 0, 1) by matrix, project result back into w=1.
-D3DXVECTOR2* WINAPI D3DXVec2TransformCoord
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
-
-// Transform (x, y, 0, 0) by matrix.
-D3DXVECTOR2* WINAPI D3DXVec2TransformNormal
- ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
-
-// Transform Array (x, y, 0, 1) by matrix.
-D3DXVECTOR4* WINAPI D3DXVec2TransformArray
- ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n);
-
-// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
-D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray
- ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-// Transform Array (x, y, 0, 0) by matrix.
-D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray
- ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// 3D Vector
-//--------------------------
-
-// inline
-
-FLOAT D3DXVec3Length
- ( CONST D3DXVECTOR3 *pV );
-
-FLOAT D3DXVec3LengthSq
- ( CONST D3DXVECTOR3 *pV );
-
-FLOAT D3DXVec3Dot
- ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-D3DXVECTOR3* D3DXVec3Cross
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-D3DXVECTOR3* D3DXVec3Add
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-D3DXVECTOR3* D3DXVec3Subtract
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-// Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
-D3DXVECTOR3* D3DXVec3Minimize
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-// Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
-D3DXVECTOR3* D3DXVec3Maximize
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 );
-
-D3DXVECTOR3* D3DXVec3Scale
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s);
-
-// Linear interpolation. V1 + s(V2-V1)
-D3DXVECTOR3* D3DXVec3Lerp
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
- FLOAT s );
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-D3DXVECTOR3* WINAPI D3DXVec3Normalize
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV );
-
-// Hermite interpolation between position V1, tangent T1 (when s == 0)
-// and position V2, tangent T2 (when s == 1).
-D3DXVECTOR3* WINAPI D3DXVec3Hermite
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
- CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s );
-
-// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
-D3DXVECTOR3* WINAPI D3DXVec3CatmullRom
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
- CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s );
-
-// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
-D3DXVECTOR3* WINAPI D3DXVec3BaryCentric
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
- CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g);
-
-// Transform (x, y, z, 1) by matrix.
-D3DXVECTOR4* WINAPI D3DXVec3Transform
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
-
-// Transform (x, y, z, 1) by matrix, project result back into w=1.
-D3DXVECTOR3* WINAPI D3DXVec3TransformCoord
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
-
-// Transform (x, y, z, 0) by matrix. If you transforming a normal by a
-// non-affine matrix, the matrix you pass to this function should be the
-// transpose of the inverse of the matrix you would use to transform a coord.
-D3DXVECTOR3* WINAPI D3DXVec3TransformNormal
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );
-
-
-// Transform Array (x, y, z, 1) by matrix.
-D3DXVECTOR4* WINAPI D3DXVec3TransformArray
- ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
-D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray
- ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-// Transform (x, y, z, 0) by matrix. If you transforming a normal by a
-// non-affine matrix, the matrix you pass to this function should be the
-// transpose of the inverse of the matrix you would use to transform a coord.
-D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray
- ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-// Project vector from object space into screen space
-D3DXVECTOR3* WINAPI D3DXVec3Project
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
- CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
-
-// Project vector from screen space into object space
-D3DXVECTOR3* WINAPI D3DXVec3Unproject
- ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
- CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);
-
-// Project vector Array from object space into screen space
-D3DXVECTOR3* WINAPI D3DXVec3ProjectArray
- ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3D10_VIEWPORT *pViewport,
- CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
-
-// Project vector Array from screen space into object space
-D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray
- ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3D10_VIEWPORT *pViewport,
- CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-//--------------------------
-// 4D Vector
-//--------------------------
-
-// inline
-
-FLOAT D3DXVec4Length
- ( CONST D3DXVECTOR4 *pV );
-
-FLOAT D3DXVec4LengthSq
- ( CONST D3DXVECTOR4 *pV );
-
-FLOAT D3DXVec4Dot
- ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 );
-
-D3DXVECTOR4* D3DXVec4Add
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
-
-D3DXVECTOR4* D3DXVec4Subtract
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
-
-// Minimize each component. x = min(x1, x2), y = min(y1, y2), ...
-D3DXVECTOR4* D3DXVec4Minimize
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
-
-// Maximize each component. x = max(x1, x2), y = max(y1, y2), ...
-D3DXVECTOR4* D3DXVec4Maximize
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2);
-
-D3DXVECTOR4* D3DXVec4Scale
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s);
-
-// Linear interpolation. V1 + s(V2-V1)
-D3DXVECTOR4* D3DXVec4Lerp
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
- FLOAT s );
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Cross-product in 4 dimensions.
-D3DXVECTOR4* WINAPI D3DXVec4Cross
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
- CONST D3DXVECTOR4 *pV3);
-
-D3DXVECTOR4* WINAPI D3DXVec4Normalize
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV );
-
-// Hermite interpolation between position V1, tangent T1 (when s == 0)
-// and position V2, tangent T2 (when s == 1).
-D3DXVECTOR4* WINAPI D3DXVec4Hermite
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
- CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s );
-
-// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
-D3DXVECTOR4* WINAPI D3DXVec4CatmullRom
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
- CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s );
-
-// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1)
-D3DXVECTOR4* WINAPI D3DXVec4BaryCentric
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
- CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g);
-
-// Transform vector by matrix.
-D3DXVECTOR4* WINAPI D3DXVec4Transform
- ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM );
-
-// Transform vector array by matrix.
-D3DXVECTOR4* WINAPI D3DXVec4TransformArray
- ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// 4D Matrix
-//--------------------------
-
-// inline
-
-D3DXMATRIX* D3DXMatrixIdentity
- ( D3DXMATRIX *pOut );
-
-BOOL D3DXMatrixIsIdentity
- ( CONST D3DXMATRIX *pM );
-
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-FLOAT WINAPI D3DXMatrixDeterminant
- ( CONST D3DXMATRIX *pM );
-
-HRESULT WINAPI D3DXMatrixDecompose
- ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation,
- D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM );
-
-D3DXMATRIX* WINAPI D3DXMatrixTranspose
- ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM );
-
-// Matrix multiplication. The result represents the transformation M2
-// followed by the transformation M1. (Out = M1 * M2)
-D3DXMATRIX* WINAPI D3DXMatrixMultiply
- ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );
-
-// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
-D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose
- ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );
-
-// Calculate inverse of matrix. Inversion my fail, in which case NULL will
-// be returned. The determinant of pM is also returned it pfDeterminant
-// is non-NULL.
-D3DXMATRIX* WINAPI D3DXMatrixInverse
- ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM );
-
-// Build a matrix which scales by (sx, sy, sz)
-D3DXMATRIX* WINAPI D3DXMatrixScaling
- ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz );
-
-// Build a matrix which translates by (x, y, z)
-D3DXMATRIX* WINAPI D3DXMatrixTranslation
- ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z );
-
-// Build a matrix which rotates around the X axis
-D3DXMATRIX* WINAPI D3DXMatrixRotationX
- ( D3DXMATRIX *pOut, FLOAT Angle );
-
-// Build a matrix which rotates around the Y axis
-D3DXMATRIX* WINAPI D3DXMatrixRotationY
- ( D3DXMATRIX *pOut, FLOAT Angle );
-
-// Build a matrix which rotates around the Z axis
-D3DXMATRIX* WINAPI D3DXMatrixRotationZ
- ( D3DXMATRIX *pOut, FLOAT Angle );
-
-// Build a matrix which rotates around an arbitrary axis
-D3DXMATRIX* WINAPI D3DXMatrixRotationAxis
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
-
-// Build a matrix from a quaternion
-D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion
- ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ);
-
-// Yaw around the Y axis, a pitch around the X axis,
-// and a roll around the Z axis.
-D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll
- ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
-
-// Build transformation matrix. NULL arguments are treated as identity.
-// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
-D3DXMATRIX* WINAPI D3DXMatrixTransformation
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
- CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
- CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
- CONST D3DXVECTOR3 *pTranslation);
-
-// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity.
-// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
-D3DXMATRIX* WINAPI D3DXMatrixTransformation2D
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter,
- FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling,
- CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation,
- CONST D3DXVECTOR2* pTranslation);
-
-// Build affine transformation matrix. NULL arguments are treated as identity.
-// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
-D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation
- ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
- CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation);
-
-// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity.
-// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
-D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D
- ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter,
- FLOAT Rotation, CONST D3DXVECTOR2* pTranslation);
-
-// Build a lookat matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixLookAtRH
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
- CONST D3DXVECTOR3 *pUp );
-
-// Build a lookat matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixLookAtLH
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
- CONST D3DXVECTOR3 *pUp );
-
-// Build a perspective projection matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH
- ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
-
-// Build a perspective projection matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH
- ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
-
-// Build a perspective projection matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH
- ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
-
-// Build a perspective projection matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH
- ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );
-
-// Build a perspective projection matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH
- ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
- FLOAT zf );
-
-// Build a perspective projection matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH
- ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
- FLOAT zf );
-
-// Build an ortho projection matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixOrthoRH
- ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
-
-// Build an ortho projection matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixOrthoLH
- ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );
-
-// Build an ortho projection matrix. (right-handed)
-D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH
- ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
- FLOAT zf );
-
-// Build an ortho projection matrix. (left-handed)
-D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH
- ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
- FLOAT zf );
-
-// Build a matrix which flattens geometry into a plane, as if casting
-// a shadow from a light.
-D3DXMATRIX* WINAPI D3DXMatrixShadow
- ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
- CONST D3DXPLANE *pPlane );
-
-// Build a matrix which reflects the coordinate system about a plane
-D3DXMATRIX* WINAPI D3DXMatrixReflect
- ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// Quaternion
-//--------------------------
-
-// inline
-
-FLOAT D3DXQuaternionLength
- ( CONST D3DXQUATERNION *pQ );
-
-// Length squared, or "norm"
-FLOAT D3DXQuaternionLengthSq
- ( CONST D3DXQUATERNION *pQ );
-
-FLOAT D3DXQuaternionDot
- ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 );
-
-// (0, 0, 0, 1)
-D3DXQUATERNION* D3DXQuaternionIdentity
- ( D3DXQUATERNION *pOut );
-
-BOOL D3DXQuaternionIsIdentity
- ( CONST D3DXQUATERNION *pQ );
-
-// (-x, -y, -z, w)
-D3DXQUATERNION* D3DXQuaternionConjugate
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
-
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
-void WINAPI D3DXQuaternionToAxisAngle
- ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle );
-
-// Build a quaternion from a rotation matrix.
-D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix
- ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM);
-
-// Rotation about arbitrary axis.
-D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis
- ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );
-
-// Yaw around the Y axis, a pitch around the X axis,
-// and a roll around the Z axis.
-D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll
- ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );
-
-// Quaternion multiplication. The result represents the rotation Q2
-// followed by the rotation Q1. (Out = Q2 * Q1)
-D3DXQUATERNION* WINAPI D3DXQuaternionMultiply
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
- CONST D3DXQUATERNION *pQ2 );
-
-D3DXQUATERNION* WINAPI D3DXQuaternionNormalize
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
-
-// Conjugate and re-norm
-D3DXQUATERNION* WINAPI D3DXQuaternionInverse
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
-
-// Expects unit quaternions.
-// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
-D3DXQUATERNION* WINAPI D3DXQuaternionLn
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
-
-// Expects pure quaternions. (w == 0) w is ignored in calculation.
-// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
-D3DXQUATERNION* WINAPI D3DXQuaternionExp
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
-
-// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
-// Expects unit quaternions.
-D3DXQUATERNION* WINAPI D3DXQuaternionSlerp
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
- CONST D3DXQUATERNION *pQ2, FLOAT t );
-
-// Spherical quadrangle interpolation.
-// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
-D3DXQUATERNION* WINAPI D3DXQuaternionSquad
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
- CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB,
- CONST D3DXQUATERNION *pC, FLOAT t );
-
-// Setup control points for spherical quadrangle interpolation
-// from Q1 to Q2. The control points are chosen in such a way
-// to ensure the continuity of tangents with adjacent segments.
-void WINAPI D3DXQuaternionSquadSetup
- ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,
- CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1,
- CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 );
-
-// Barycentric interpolation.
-// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
-D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric
- ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
- CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
- FLOAT f, FLOAT g );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// Plane
-//--------------------------
-
-// inline
-
-// ax + by + cz + dw
-FLOAT D3DXPlaneDot
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV);
-
-// ax + by + cz + d
-FLOAT D3DXPlaneDotCoord
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
-
-// ax + by + cz
-FLOAT D3DXPlaneDotNormal
- ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV);
-
-D3DXPLANE* D3DXPlaneScale
- (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s);
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Normalize plane (so that |a,b,c| == 1)
-D3DXPLANE* WINAPI D3DXPlaneNormalize
- ( D3DXPLANE *pOut, CONST D3DXPLANE *pP);
-
-// Find the intersection between a plane and a line. If the line is
-// parallel to the plane, NULL is returned.
-D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine
- ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
- CONST D3DXVECTOR3 *pV2);
-
-// Construct a plane from a point and a normal
-D3DXPLANE* WINAPI D3DXPlaneFromPointNormal
- ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal);
-
-// Construct a plane from 3 points
-D3DXPLANE* WINAPI D3DXPlaneFromPoints
- ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
- CONST D3DXVECTOR3 *pV3);
-
-// Transform a plane by a matrix. The vector (a,b,c) must be normal.
-// M should be the inverse transpose of the transformation desired.
-D3DXPLANE* WINAPI D3DXPlaneTransform
- ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM );
-
-// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal.
-// M should be the inverse transpose of the transformation desired.
-D3DXPLANE* WINAPI D3DXPlaneTransformArray
- ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-//--------------------------
-// Color
-//--------------------------
-
-// inline
-
-// (1-r, 1-g, 1-b, a)
-D3DXCOLOR* D3DXColorNegative
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC);
-
-D3DXCOLOR* D3DXColorAdd
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
-
-D3DXCOLOR* D3DXColorSubtract
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
-
-D3DXCOLOR* D3DXColorScale
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
-
-// (r1*r2, g1*g2, b1*b2, a1*a2)
-D3DXCOLOR* D3DXColorModulate
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2);
-
-// Linear interpolation of r,g,b, and a. C1 + s(C2-C1)
-D3DXCOLOR* D3DXColorLerp
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s);
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Interpolate r,g,b between desaturated color and color.
-// DesaturatedColor + s(Color - DesaturatedColor)
-D3DXCOLOR* WINAPI D3DXColorAdjustSaturation
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);
-
-// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey)
-D3DXCOLOR* WINAPI D3DXColorAdjustContrast
- (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-
-//--------------------------
-// Misc
-//--------------------------
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Calculate Fresnel term given the cosine of theta (likely obtained by
-// taking the dot of two normals), and the refraction index of the material.
-FLOAT WINAPI D3DXFresnelTerm
- (FLOAT CosTheta, FLOAT RefractionIndex);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-//===========================================================================
-//
-// Matrix Stack
-//
-//===========================================================================
-
-typedef interface ID3DXMatrixStack ID3DXMatrixStack;
-typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK;
-
-// {C7885BA7-F990-4fe7-922D-8515E477DD85}
-DEFINE_GUID(IID_ID3DXMatrixStack,
-0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
-
-
-#undef INTERFACE
-#define INTERFACE ID3DXMatrixStack
-
-DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
-{
- //
- // IUnknown methods
- //
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- //
- // ID3DXMatrixStack methods
- //
-
- // Pops the top of the stack, returns the current top
- // *after* popping the top.
- STDMETHOD(Pop)(THIS) PURE;
-
- // Pushes the stack by one, duplicating the current matrix.
- STDMETHOD(Push)(THIS) PURE;
-
- // Loads identity in the current matrix.
- STDMETHOD(LoadIdentity)(THIS) PURE;
-
- // Loads the given matrix into the current matrix
- STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-
- // Right-Multiplies the given matrix to the current matrix.
- // (transformation is about the current world origin)
- STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-
- // Left-Multiplies the given matrix to the current matrix
- // (transformation is about the local origin of the object)
- STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
-
- // Right multiply the current matrix with the computed rotation
- // matrix, counterclockwise about the given axis with the given angle.
- // (rotation is about the current world origin)
- STDMETHOD(RotateAxis)
- (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
-
- // Left multiply the current matrix with the computed rotation
- // matrix, counterclockwise about the given axis with the given angle.
- // (rotation is about the local origin of the object)
- STDMETHOD(RotateAxisLocal)
- (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
-
- // Right multiply the current matrix with the computed rotation
- // matrix. All angles are counterclockwise. (rotation is about the
- // current world origin)
-
- // The rotation is composed of a yaw around the Y axis, a pitch around
- // the X axis, and a roll around the Z axis.
- STDMETHOD(RotateYawPitchRoll)
- (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
-
- // Left multiply the current matrix with the computed rotation
- // matrix. All angles are counterclockwise. (rotation is about the
- // local origin of the object)
-
- // The rotation is composed of a yaw around the Y axis, a pitch around
- // the X axis, and a roll around the Z axis.
- STDMETHOD(RotateYawPitchRollLocal)
- (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
-
- // Right multiply the current matrix with the computed scale
- // matrix. (transformation is about the current world origin)
- STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-
- // Left multiply the current matrix with the computed scale
- // matrix. (transformation is about the local origin of the object)
- STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-
- // Right multiply the current matrix with the computed translation
- // matrix. (transformation is about the current world origin)
- STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
-
- // Left multiply the current matrix with the computed translation
- // matrix. (transformation is about the local origin of the object)
- STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
-
- // Obtain the current matrix at the top of the stack
- STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HRESULT WINAPI
- D3DXCreateMatrixStack(
- UINT Flags,
- LPD3DXMATRIXSTACK* ppStack);
-
-#ifdef __cplusplus
-}
-#endif
-
-// non-inline
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//============================================================================
-//
-// Basic Spherical Harmonic math routines
-//
-//============================================================================
-
-#define D3DXSH_MINORDER 2
-#define D3DXSH_MAXORDER 6
-
-//============================================================================
-//
-// D3DXSHEvalDirection:
-// --------------------
-// Evaluates the Spherical Harmonic basis functions
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned.
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pDir
-// Direction to evaluate in - assumed to be normalized
-//
-//============================================================================
-
-FLOAT* WINAPI D3DXSHEvalDirection
- ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir );
-
-//============================================================================
-//
-// D3DXSHRotate:
-// --------------------
-// Rotates SH vector by a rotation matrix
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned (should not alias with pIn.)
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pMatrix
-// Matrix used for rotation - rotation sub matrix should be orthogonal
-// and have a unit determinant.
-// pIn
-// Input SH coeffs (rotated), incorect results if this is also output.
-//
-//============================================================================
-
-FLOAT* WINAPI D3DXSHRotate
- ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn );
-
-//============================================================================
-//
-// D3DXSHRotateZ:
-// --------------------
-// Rotates the SH vector in the Z axis by an angle
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned (should not alias with pIn.)
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// Angle
-// Angle in radians to rotate around the Z axis.
-// pIn
-// Input SH coeffs (rotated), incorect results if this is also output.
-//
-//============================================================================
-
-
-FLOAT* WINAPI D3DXSHRotateZ
- ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn );
-
-//============================================================================
-//
-// D3DXSHAdd:
-// --------------------
-// Adds two SH vectors, pOut[i] = pA[i] + pB[i];
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned.
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pA
-// Input SH coeffs.
-// pB
-// Input SH coeffs (second vector.)
-//
-//============================================================================
-
-FLOAT* WINAPI D3DXSHAdd
- ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
-
-//============================================================================
-//
-// D3DXSHScale:
-// --------------------
-// Adds two SH vectors, pOut[i] = pA[i]*Scale;
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned.
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pIn
-// Input SH coeffs.
-// Scale
-// Scale factor.
-//
-//============================================================================
-
-FLOAT* WINAPI D3DXSHScale
- ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale );
-
-//============================================================================
-//
-// D3DXSHDot:
-// --------------------
-// Computes the dot product of two SH vectors
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pA
-// Input SH coeffs.
-// pB
-// Second set of input SH coeffs.
-//
-//============================================================================
-
-FLOAT WINAPI D3DXSHDot
- ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
-
-//============================================================================
-//
-// D3DXSHMultiply[O]:
-// --------------------
-// Computes the product of two functions represented using SH (f and g), where:
-// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis
-// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O
-// determines the lengths of the arrays, where there should always be O^2
-// coefficients. In general the product of two SH functions of order O generates
-// and SH function of order 2*O - 1, but we truncate the result. This means
-// that the product commutes (f*g == g*f) but doesn't associate
-// (f*(g*h) != (f*g)*h.
-//
-// Parameters:
-// pOut
-// Output SH coefficients - basis function Ylm is stored at l*l + m+l
-// This is the pointer that is returned.
-// pF
-// Input SH coeffs for first function.
-// pG
-// Second set of input SH coeffs.
-//
-//============================================================================
-
-__out_ecount(4) FLOAT* WINAPI D3DXSHMultiply2(__out_ecount(4) FLOAT *pOut,__in_ecount(4) CONST FLOAT *pF,__in_ecount(4) CONST FLOAT *pG);
-__out_ecount(9) FLOAT* WINAPI D3DXSHMultiply3(__out_ecount(9) FLOAT *pOut,__in_ecount(9) CONST FLOAT *pF,__in_ecount(9) CONST FLOAT *pG);
-__out_ecount(16) FLOAT* WINAPI D3DXSHMultiply4(__out_ecount(16) FLOAT *pOut,__in_ecount(16) CONST FLOAT *pF,__in_ecount(16) CONST FLOAT *pG);
-__out_ecount(25) FLOAT* WINAPI D3DXSHMultiply5(__out_ecount(25) FLOAT *pOut,__in_ecount(25) CONST FLOAT *pF,__in_ecount(25) CONST FLOAT *pG);
-__out_ecount(36) FLOAT* WINAPI D3DXSHMultiply6(__out_ecount(36) FLOAT *pOut,__in_ecount(36) CONST FLOAT *pF,__in_ecount(36) CONST FLOAT *pG);
-
-
-//============================================================================
-//
-// Basic Spherical Harmonic lighting routines
-//
-//============================================================================
-
-//============================================================================
-//
-// D3DXSHEvalDirectionalLight:
-// --------------------
-// Evaluates a directional light and returns spectral SH data. The output
-// vector is computed so that if the intensity of R/G/B is unit the resulting
-// exit radiance of a point directly under the light on a diffuse object with
-// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut
-// has to be specified, while pGout and pBout are optional.
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pDir
-// Direction light is coming from (assumed to be normalized.)
-// RIntensity
-// Red intensity of light.
-// GIntensity
-// Green intensity of light.
-// BIntensity
-// Blue intensity of light.
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green (optional.)
-// pBOut
-// Output SH vector for Blue (optional.)
-//
-//============================================================================
-
-HRESULT WINAPI D3DXSHEvalDirectionalLight
- ( UINT Order, CONST D3DXVECTOR3 *pDir,
- FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
- __out_ecount_opt(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut );
-
-//============================================================================
-//
-// D3DXSHEvalSphericalLight:
-// --------------------
-// Evaluates a spherical light and returns spectral SH data. There is no
-// normalization of the intensity of the light like there is for directional
-// lights, care has to be taken when specifiying the intensities. This will
-// compute 3 spectral samples, pROut has to be specified, while pGout and
-// pBout are optional.
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pPos
-// Position of light - reciever is assumed to be at the origin.
-// Radius
-// Radius of the spherical light source.
-// RIntensity
-// Red intensity of light.
-// GIntensity
-// Green intensity of light.
-// BIntensity
-// Blue intensity of light.
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green (optional.)
-// pBOut
-// Output SH vector for Blue (optional.)
-//
-//============================================================================
-
-HRESULT WINAPI D3DXSHEvalSphericalLight
- ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
- FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
- __out_ecount_opt(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut );
-
-//============================================================================
-//
-// D3DXSHEvalConeLight:
-// --------------------
-// Evaluates a light that is a cone of constant intensity and returns spectral
-// SH data. The output vector is computed so that if the intensity of R/G/B is
-// unit the resulting exit radiance of a point directly under the light oriented
-// in the cone direction on a diffuse object with an albedo of 1 would be 1.0.
-// This will compute 3 spectral samples, pROut has to be specified, while pGout
-// and pBout are optional.
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pDir
-// Direction light is coming from (assumed to be normalized.)
-// Radius
-// Radius of cone in radians.
-// RIntensity
-// Red intensity of light.
-// GIntensity
-// Green intensity of light.
-// BIntensity
-// Blue intensity of light.
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green (optional.)
-// pBOut
-// Output SH vector for Blue (optional.)
-//
-//============================================================================
-
-HRESULT WINAPI D3DXSHEvalConeLight
- ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
- FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
- __out_ecount_opt(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut );
-
-//============================================================================
-//
-// D3DXSHEvalHemisphereLight:
-// --------------------
-// Evaluates a light that is a linear interpolant between two colors over the
-// sphere. The interpolant is linear along the axis of the two points, not
-// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in
-// Z, not in the azimuthal angle.) The resulting spherical lighting function
-// is normalized so that a point on a perfectly diffuse surface with no
-// shadowing and a normal pointed in the direction pDir would result in exit
-// radiance with a value of 1 if the top color was white and the bottom color
-// was black. This is a very simple model where Top represents the intensity
-// of the "sky" and Bottom represents the intensity of the "ground".
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pDir
-// Axis of the hemisphere.
-// Top
-// Color of the upper hemisphere.
-// Bottom
-// Color of the lower hemisphere.
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green
-// pBOut
-// Output SH vector for Blue
-//
-//============================================================================
-
-HRESULT WINAPI D3DXSHEvalHemisphereLight
- ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
- __out_ecount_opt(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut );
-
-// Math intersection functions
-
-BOOL WINAPI D3DXIntersectTri
-(
- CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position
- CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position
- CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position
- CONST D3DXVECTOR3 *pRayPos, // Ray origin
- CONST D3DXVECTOR3 *pRayDir, // Ray direction
- FLOAT *pU, // Barycentric Hit Coordinates
- FLOAT *pV, // Barycentric Hit Coordinates
- FLOAT *pDist); // Ray-Intersection Parameter Distance
-
-BOOL WINAPI
- D3DXSphereBoundProbe(
- CONST D3DXVECTOR3 *pCenter,
- FLOAT Radius,
- CONST D3DXVECTOR3 *pRayPosition,
- CONST D3DXVECTOR3 *pRayDirection);
-
-BOOL WINAPI
- D3DXBoxBoundProbe(
- CONST D3DXVECTOR3 *pMin,
- CONST D3DXVECTOR3 *pMax,
- CONST D3DXVECTOR3 *pRayPosition,
- CONST D3DXVECTOR3 *pRayDirection);
-
-HRESULT WINAPI
- D3DXComputeBoundingSphere(
- CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position
- DWORD NumVertices,
- DWORD dwStride, // count in bytes to subsequent position vectors
- D3DXVECTOR3 *pCenter,
- FLOAT *pRadius);
-
-HRESULT WINAPI
- D3DXComputeBoundingBox(
- CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position
- DWORD NumVertices,
- DWORD dwStride, // count in bytes to subsequent position vectors
- D3DXVECTOR3 *pMin,
- D3DXVECTOR3 *pMax);
-
-
-///////////////////////////////////////////////////////////////////////////
-// CPU Optimization:
-///////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------
-// D3DX_CPU_OPTIMIZATION flags:
-// ----------------------------
-// D3DX_NOT_OPTIMIZED Use Intel Pentium optimizations
-// D3DX_3DNOW_OPTIMIZED Use AMD 3DNow optimizations
-// D3DX_SSE_OPTIMIZED Use Intel Pentium III SSE optimizations
-// D3DX_SSE2_OPTIMIZED Use Intel Pentium IV SSE2 optimizations
-//-------------------------------------------------------------------------
-
-
-typedef enum _D3DX_CPU_OPTIMIZATION
-{
- D3DX_NOT_OPTIMIZED = 0,
- D3DX_3DNOW_OPTIMIZED,
- D3DX_SSE2_OPTIMIZED,
- D3DX_SSE_OPTIMIZED
-} D3DX_CPU_OPTIMIZATION;
-
-
-//-------------------------------------------------------------------------
-// D3DXCpuOptimizations:
-// ---------------------
-// Enables or disables CPU optimizations. Returns the type of CPU, which
-// was detected, and for which optimizations exist.
-//
-// Parameters:
-// Enable
-// TRUE to enable CPU optimizations. FALSE to disable.
-//-------------------------------------------------------------------------
-
-D3DX_CPU_OPTIMIZATION WINAPI
- D3DXCpuOptimizations(BOOL Enable);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#include "D3DX10math.inl"
-
-#if _MSC_VER >= 1200
-#pragma warning(pop)
-#else
-#pragma warning(default:4201)
-#endif
-
-#endif // __D3DX9MATH_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx10mesh.h b/3rdparty/dxsdk/Include/d3dx10mesh.h
deleted file mode 100644
index e5fed8fc93f..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10mesh.h
+++ /dev/null
@@ -1,286 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx10mesh.h
-// Content: D3DX10 mesh types and functions
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "d3dx10.h"
-
-#ifndef __D3DX10MESH_H__
-#define __D3DX10MESH_H__
-
-// {7ED943DD-52E8-40b5-A8D8-76685C406330}
-DEFINE_GUID(IID_ID3DX10BaseMesh,
-0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
-
-// {04B0D117-1041-46b1-AA8A-3952848BA22E}
-DEFINE_GUID(IID_ID3DX10MeshBuffer,
-0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e);
-
-// {4020E5C2-1403-4929-883F-E2E849FAC195}
-DEFINE_GUID(IID_ID3DX10Mesh,
-0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
-
-// {8875769A-D579-4088-AAEB-534D1AD84E96}
-DEFINE_GUID(IID_ID3DX10PMesh,
-0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
-
-// {667EA4C7-F1CD-4386-B523-7C0290B83CC5}
-DEFINE_GUID(IID_ID3DX10SPMesh,
-0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5);
-
-// {3CE6CC22-DBF2-44f4-894D-F9C34A337139}
-DEFINE_GUID(IID_ID3DX10PatchMesh,
-0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
-
-
-// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags
-enum _D3DX10_MESH {
- D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
- D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input.
-
-};
-
-typedef struct _D3DX10_ATTRIBUTE_RANGE
-{
- UINT AttribId;
- UINT FaceStart;
- UINT FaceCount;
- UINT VertexStart;
- UINT VertexCount;
-} D3DX10_ATTRIBUTE_RANGE;
-
-typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE;
-
-typedef enum _D3DX10_MESH_DISCARD_FLAGS
-{
- D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01,
- D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02,
- D3DX10_MESH_DISCARD_POINTREPS = 0x04,
- D3DX10_MESH_DISCARD_ADJACENCY = 0x08,
- D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10,
-
-} D3DX10_MESH_DISCARD_FLAGS;
-
-typedef struct _D3DX10_WELD_EPSILONS
-{
- FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency
- // in general, it should be the same value or greater than the one passed to GeneratedAdjacency
- FLOAT BlendWeights;
- FLOAT Normal;
- FLOAT PSize;
- FLOAT Specular;
- FLOAT Diffuse;
- FLOAT Texcoord[8];
- FLOAT Tangent;
- FLOAT Binormal;
- FLOAT TessFactor;
-} D3DX10_WELD_EPSILONS;
-
-typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS;
-
-typedef struct _D3DX10_INTERSECT_INFO
-{
- UINT FaceIndex; // index of face intersected
- FLOAT U; // Barycentric Hit Coordinates
- FLOAT V; // Barycentric Hit Coordinates
- FLOAT Dist; // Ray-Intersection Parameter Distance
-} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO;
-
-// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers
-#undef INTERFACE
-#define INTERFACE ID3DX10MeshBuffer
-
-DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX10MeshBuffer
- STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE;
- STDMETHOD(Unmap)(THIS) PURE;
- STDMETHOD_(SIZE_T, GetSize)(THIS) PURE;
-};
-
-// D3DX10 Mesh interfaces
-#undef INTERFACE
-#define INTERFACE ID3DX10Mesh
-
-DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX10Mesh
- STDMETHOD_(UINT, GetFaceCount)(THIS) PURE;
- STDMETHOD_(UINT, GetVertexCount)(THIS) PURE;
- STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE;
- STDMETHOD_(UINT, GetFlags)(THIS) PURE;
- STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE;
-
- STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE;
- STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE;
-
- STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE;
- STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE;
-
- STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE;
- STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE;
-
- STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE;
- STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE;
-
- STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE;
- STDMETHOD(GenerateGSAdjacency)(THIS) PURE;
-
- STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE;
- STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE;
-
- STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE;
- STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE;
-
- STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE;
- STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE;
-
- STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE;
- STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE;
-
- STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
- UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
- STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
- UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
-
- // ID3DX10Mesh - Device functions
- STDMETHOD(CommitToDevice)(THIS) PURE;
- STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE;
- STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE;
-
- STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE;
- STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE;
-};
-
-
-// Flat API
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-HRESULT WINAPI
- D3DX10CreateMesh(
- ID3D10Device *pDevice,
- CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration,
- UINT DeclCount,
- LPCSTR pPositionSemantic,
- UINT VertexCount,
- UINT FaceCount,
- UINT Options,
- ID3DX10Mesh **ppMesh);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-
-// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags
-enum _D3DX10_MESHOPT {
- D3DX10_MESHOPT_COMPACT = 0x01000000,
- D3DX10_MESHOPT_ATTR_SORT = 0x02000000,
- D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000,
- D3DX10_MESHOPT_STRIP_REORDER = 0x08000000,
- D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices
- D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting
- D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards
-
- // D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead
-
-};
-
-
-//////////////////////////////////////////////////////////////////////////
-// ID3DXSkinInfo
-//////////////////////////////////////////////////////////////////////////
-
-// {420BD604-1C76-4a34-A466-E45D0658A32C}
-DEFINE_GUID(IID_ID3DX10SkinInfo,
-0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c);
-
-// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh()
-#define D3DX10_SKININFO_NO_SCALING 0
-#define D3DX10_SKININFO_SCALE_TO_1 1
-#define D3DX10_SKININFO_SCALE_TO_TOTAL 2
-
-typedef struct _D3DX10_SKINNING_CHANNEL
-{
- UINT SrcOffset;
- UINT DestOffset;
- BOOL IsNormal;
-} D3DX10_SKINNING_CHANNEL;
-
-#undef INTERFACE
-#define INTERFACE ID3DX10SkinInfo
-
-typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO;
-
-DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- STDMETHOD_(UINT , GetNumVertices)(THIS) PURE;
- STDMETHOD_(UINT , GetNumBones)(THIS) PURE;
- STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE;
-
- STDMETHOD(AddVertices)(THIS_ UINT Count) PURE;
- STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE;
-
- STDMETHOD(AddBones)(THIS_ UINT Count) PURE;
- STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE;
- STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE;
-
- STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE;
- STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE;
- STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE;
- STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE;
- STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE;
- STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE;
- STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE;
-
- STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE;
- STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-HRESULT WINAPI
- D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-typedef struct _D3DX10_ATTRIBUTE_WEIGHTS
-{
- FLOAT Position;
- FLOAT Boundary;
- FLOAT Normal;
- FLOAT Diffuse;
- FLOAT Specular;
- FLOAT Texcoord[8];
- FLOAT Tangent;
- FLOAT Binormal;
-} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS;
-
-#endif //__D3DX10MESH_H__
-
-
diff --git a/3rdparty/dxsdk/Include/d3dx10tex.h b/3rdparty/dxsdk/Include/d3dx10tex.h
deleted file mode 100644
index a6d8bb958b8..00000000000
--- a/3rdparty/dxsdk/Include/d3dx10tex.h
+++ /dev/null
@@ -1,766 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx10tex.h
-// Content: D3DX10 texturing APIs
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "d3dx10.h"
-
-#ifndef __D3DX10TEX_H__
-#define __D3DX10TEX_H__
-
-
-//----------------------------------------------------------------------------
-// D3DX10_FILTER flags:
-// ------------------
-//
-// A valid filter must contain one of these values:
-//
-// D3DX10_FILTER_NONE
-// No scaling or filtering will take place. Pixels outside the bounds
-// of the source image are assumed to be transparent black.
-// D3DX10_FILTER_POINT
-// Each destination pixel is computed by sampling the nearest pixel
-// from the source image.
-// D3DX10_FILTER_LINEAR
-// Each destination pixel is computed by linearly interpolating between
-// the nearest pixels in the source image. This filter works best
-// when the scale on each axis is less than 2.
-// D3DX10_FILTER_TRIANGLE
-// Every pixel in the source image contributes equally to the
-// destination image. This is the slowest of all the filters.
-// D3DX10_FILTER_BOX
-// Each pixel is computed by averaging a 2x2(x2) box pixels from
-// the source image. Only works when the dimensions of the
-// destination are half those of the source. (as with mip maps)
-//
-// And can be OR'd with any of these optional flags:
-//
-// D3DX10_FILTER_MIRROR_U
-// Indicates that pixels off the edge of the texture on the U-axis
-// should be mirrored, not wraped.
-// D3DX10_FILTER_MIRROR_V
-// Indicates that pixels off the edge of the texture on the V-axis
-// should be mirrored, not wraped.
-// D3DX10_FILTER_MIRROR_W
-// Indicates that pixels off the edge of the texture on the W-axis
-// should be mirrored, not wraped.
-// D3DX10_FILTER_MIRROR
-// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V |
-// D3DX10_FILTER_MIRROR_V
-// D3DX10_FILTER_DITHER
-// Dithers the resulting image using a 4x4 order dither pattern.
-// D3DX10_FILTER_SRGB_IN
-// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
-// D3DX10_FILTER_SRGB_OUT
-// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
-// D3DX10_FILTER_SRGB
-// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX10_FILTER_FLAG
-{
- D3DX10_FILTER_NONE = (1 << 0),
- D3DX10_FILTER_POINT = (2 << 0),
- D3DX10_FILTER_LINEAR = (3 << 0),
- D3DX10_FILTER_TRIANGLE = (4 << 0),
- D3DX10_FILTER_BOX = (5 << 0),
-
- D3DX10_FILTER_MIRROR_U = (1 << 16),
- D3DX10_FILTER_MIRROR_V = (2 << 16),
- D3DX10_FILTER_MIRROR_W = (4 << 16),
- D3DX10_FILTER_MIRROR = (7 << 16),
-
- D3DX10_FILTER_DITHER = (1 << 19),
- D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19),
-
- D3DX10_FILTER_SRGB_IN = (1 << 21),
- D3DX10_FILTER_SRGB_OUT = (2 << 21),
- D3DX10_FILTER_SRGB = (3 << 21),
-} D3DX10_FILTER_FLAG;
-
-//----------------------------------------------------------------------------
-// D3DX10_NORMALMAP flags:
-// ---------------------
-// These flags are used to control how D3DX10ComputeNormalMap generates normal
-// maps. Any number of these flags may be OR'd together in any combination.
-//
-// D3DX10_NORMALMAP_MIRROR_U
-// Indicates that pixels off the edge of the texture on the U-axis
-// should be mirrored, not wraped.
-// D3DX10_NORMALMAP_MIRROR_V
-// Indicates that pixels off the edge of the texture on the V-axis
-// should be mirrored, not wraped.
-// D3DX10_NORMALMAP_MIRROR
-// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V
-// D3DX10_NORMALMAP_INVERTSIGN
-// Inverts the direction of each normal
-// D3DX10_NORMALMAP_COMPUTE_OCCLUSION
-// Compute the per pixel Occlusion term and encodes it into the alpha.
-// An Alpha of 1 means that the pixel is not obscured in anyway, and
-// an alpha of 0 would mean that the pixel is completly obscured.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX10_NORMALMAP_FLAG
-{
- D3DX10_NORMALMAP_MIRROR_U = (1 << 16),
- D3DX10_NORMALMAP_MIRROR_V = (2 << 16),
- D3DX10_NORMALMAP_MIRROR = (3 << 16),
- D3DX10_NORMALMAP_INVERTSIGN = (8 << 16),
- D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
-} D3DX10_NORMALMAP_FLAG;
-
-//----------------------------------------------------------------------------
-// D3DX10_CHANNEL flags:
-// -------------------
-// These flags are used by functions which operate on or more channels
-// in a texture.
-//
-// D3DX10_CHANNEL_RED
-// Indicates the red channel should be used
-// D3DX10_CHANNEL_BLUE
-// Indicates the blue channel should be used
-// D3DX10_CHANNEL_GREEN
-// Indicates the green channel should be used
-// D3DX10_CHANNEL_ALPHA
-// Indicates the alpha channel should be used
-// D3DX10_CHANNEL_LUMINANCE
-// Indicates the luminaces of the red green and blue channels should be
-// used.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX10_CHANNEL_FLAG
-{
- D3DX10_CHANNEL_RED = (1 << 0),
- D3DX10_CHANNEL_BLUE = (1 << 1),
- D3DX10_CHANNEL_GREEN = (1 << 2),
- D3DX10_CHANNEL_ALPHA = (1 << 3),
- D3DX10_CHANNEL_LUMINANCE = (1 << 4),
-} D3DX10_CHANNEL_FLAG;
-
-
-
-//----------------------------------------------------------------------------
-// D3DX10_IMAGE_FILE_FORMAT:
-// ---------------------
-// This enum is used to describe supported image file formats.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX10_IMAGE_FILE_FORMAT
-{
- D3DX10_IFF_BMP = 0,
- D3DX10_IFF_JPG = 1,
- D3DX10_IFF_PNG = 3,
- D3DX10_IFF_DDS = 4,
- D3DX10_IFF_TIFF = 10,
- D3DX10_IFF_GIF = 11,
- D3DX10_IFF_WMP = 12,
- D3DX10_IFF_FORCE_DWORD = 0x7fffffff
-
-} D3DX10_IMAGE_FILE_FORMAT;
-
-
-//----------------------------------------------------------------------------
-// D3DX10_SAVE_TEXTURE_FLAG:
-// ---------------------
-// This enum is used to support texture saving options.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX10_SAVE_TEXTURE_FLAG
-{
- D3DX10_STF_USEINPUTBLOB = 0x0001,
-} D3DX10_SAVE_TEXTURE_FLAG;
-
-
-
-//----------------------------------------------------------------------------
-// D3DX10_IMAGE_INFO:
-// ---------------
-// This structure is used to return a rough description of what the
-// the original contents of an image file looked like.
-//
-// Width
-// Width of original image in pixels
-// Height
-// Height of original image in pixels
-// Depth
-// Depth of original image in pixels
-// ArraySize
-// Array size in textures
-// MipLevels
-// Number of mip levels in original image
-// MiscFlags
-// Miscellaneous flags
-// Format
-// D3D format which most closely describes the data in original image
-// ResourceDimension
-// D3D10_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
-// D3D10_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
-// ImageFileFormat
-// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file.
-//----------------------------------------------------------------------------
-
-typedef struct D3DX10_IMAGE_INFO
-{
- UINT Width;
- UINT Height;
- UINT Depth;
- UINT ArraySize;
- UINT MipLevels;
- UINT MiscFlags;
- DXGI_FORMAT Format;
- D3D10_RESOURCE_DIMENSION ResourceDimension;
- D3DX10_IMAGE_FILE_FORMAT ImageFileFormat;
-} D3DX10_IMAGE_INFO;
-
-
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Image File APIs ///////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX10_IMAGE_LOAD_INFO:
-// ---------------
-// This structure can be optionally passed in to texture loader APIs to
-// control how textures get loaded. Pass in D3DX10_DEFAULT for any of these
-// to have D3DX automatically pick defaults based on the source file.
-//
-// Width
-// Rescale texture to Width texels wide
-// Height
-// Rescale texture to Height texels high
-// Depth
-// Rescale texture to Depth texels deep
-// FirstMipLevel
-// First mip level to load
-// MipLevels
-// Number of mip levels to load after the first level
-// Usage
-// D3D10_USAGE flag for the new texture
-// BindFlags
-// D3D10 Bind flags for the new texture
-// CpuAccessFlags
-// D3D10 CPU Access flags for the new texture
-// MiscFlags
-// Reserved. Must be 0
-// Format
-// Resample texture to the specified format
-// Filter
-// Filter the texture using the specified filter (only when resampling)
-// MipFilter
-// Filter the texture mip levels using the specified filter (only if
-// generating mips)
-// pSrcInfo
-// (optional) pointer to a D3DX10_IMAGE_INFO structure that will get
-// populated with source image information
-//----------------------------------------------------------------------------
-
-
-typedef struct D3DX10_IMAGE_LOAD_INFO
-{
- UINT Width;
- UINT Height;
- UINT Depth;
- UINT FirstMipLevel;
- UINT MipLevels;
- D3D10_USAGE Usage;
- UINT BindFlags;
- UINT CpuAccessFlags;
- UINT MiscFlags;
- DXGI_FORMAT Format;
- UINT Filter;
- UINT MipFilter;
- D3DX10_IMAGE_INFO* pSrcInfo;
-
-#ifdef __cplusplus
- D3DX10_IMAGE_LOAD_INFO()
- {
- Width = D3DX10_DEFAULT;
- Height = D3DX10_DEFAULT;
- Depth = D3DX10_DEFAULT;
- FirstMipLevel = D3DX10_DEFAULT;
- MipLevels = D3DX10_DEFAULT;
- Usage = (D3D10_USAGE) D3DX10_DEFAULT;
- BindFlags = D3DX10_DEFAULT;
- CpuAccessFlags = D3DX10_DEFAULT;
- MiscFlags = D3DX10_DEFAULT;
- Format = DXGI_FORMAT_FROM_FILE;
- Filter = D3DX10_DEFAULT;
- MipFilter = D3DX10_DEFAULT;
- pSrcInfo = NULL;
- }
-#endif
-
-} D3DX10_IMAGE_LOAD_INFO;
-
-//-------------------------------------------------------------------------------
-// GetImageInfoFromFile/Resource/Memory:
-// ------------------------------
-// Fills in a D3DX10_IMAGE_INFO struct with information about an image file.
-//
-// Parameters:
-// pSrcFile
-// File name of the source image.
-// pSrcModule
-// Module where resource is located, or NULL for module associated
-// with image the os used to create the current process.
-// pSrcResource
-// Resource name.
-// pSrcData
-// Pointer to file in memory.
-// SrcDataSize
-// Size in bytes of file in memory.
-// pPump
-// Optional pointer to a thread pump object to use.
-// pSrcInfo
-// Pointer to a D3DX10_IMAGE_INFO structure to be filled in with the
-// description of the data in the source image file.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//-------------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10GetImageInfoFromFileA(
- LPCSTR pSrcFile,
- ID3DX10ThreadPump* pPump,
- D3DX10_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10GetImageInfoFromFileW(
- LPCWSTR pSrcFile,
- ID3DX10ThreadPump* pPump,
- D3DX10_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW
-#else
-#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA
-#endif
-
-
-HRESULT WINAPI
- D3DX10GetImageInfoFromResourceA(
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- ID3DX10ThreadPump* pPump,
- D3DX10_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10GetImageInfoFromResourceW(
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- ID3DX10ThreadPump* pPump,
- D3DX10_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW
-#else
-#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA
-#endif
-
-
-HRESULT WINAPI
- D3DX10GetImageInfoFromMemory(
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- ID3DX10ThreadPump* pPump,
- D3DX10_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Create/Save Texture APIs //////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX10CreateTextureFromFile/Resource/Memory:
-// D3DX10CreateShaderResourceViewFromFile/Resource/Memory:
-// -----------------------------------
-// Create a texture object from a file or resource.
-//
-// Parameters:
-//
-// pDevice
-// The D3D device with which the texture is going to be used.
-// pSrcFile
-// File name.
-// hSrcModule
-// Module handle. if NULL, current module will be used.
-// pSrcResource
-// Resource name in module
-// pvSrcData
-// Pointer to file in memory.
-// SrcDataSize
-// Size in bytes of file in memory.
-// pLoadInfo
-// Optional pointer to a D3DX10_IMAGE_LOAD_INFO structure that
-// contains additional loader parameters.
-// pPump
-// Optional pointer to a thread pump object to use.
-// ppTexture
-// [out] Created texture object.
-// ppShaderResourceView
-// [out] Shader resource view object created.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//
-//----------------------------------------------------------------------------
-
-
-// FromFile
-
-HRESULT WINAPI
- D3DX10CreateShaderResourceViewFromFileA(
- ID3D10Device* pDevice,
- LPCSTR pSrcFile,
- D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10CreateShaderResourceViewFromFileW(
- ID3D10Device* pDevice,
- LPCWSTR pSrcFile,
- D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW
-#else
-#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA
-#endif
-
-HRESULT WINAPI
- D3DX10CreateTextureFromFileA(
- ID3D10Device* pDevice,
- LPCSTR pSrcFile,
- D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10Resource** ppTexture,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10CreateTextureFromFileW(
- ID3D10Device* pDevice,
- LPCWSTR pSrcFile,
- D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10Resource** ppTexture,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW
-#else
-#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA
-#endif
-
-
-// FromResource (resources in dll/exes)
-
-HRESULT WINAPI
- D3DX10CreateShaderResourceViewFromResourceA(
- ID3D10Device* pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10CreateShaderResourceViewFromResourceW(
- ID3D10Device* pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW
-#else
-#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA
-#endif
-
-HRESULT WINAPI
- D3DX10CreateTextureFromResourceA(
- ID3D10Device* pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10Resource** ppTexture,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10CreateTextureFromResourceW(
- ID3D10Device* pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10Resource** ppTexture,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW
-#else
-#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA
-#endif
-
-
-// FromFileInMemory
-
-HRESULT WINAPI
- D3DX10CreateShaderResourceViewFromMemory(
- ID3D10Device* pDevice,
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX10CreateTextureFromMemory(
- ID3D10Device* pDevice,
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX10ThreadPump* pPump,
- ID3D10Resource** ppTexture,
- HRESULT* pHResult);
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Misc Texture APIs /////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX10_TEXTURE_LOAD_INFO:
-// ------------------------
-//
-//----------------------------------------------------------------------------
-
-typedef struct _D3DX10_TEXTURE_LOAD_INFO
-{
- D3D10_BOX *pSrcBox;
- D3D10_BOX *pDstBox;
- UINT SrcFirstMip;
- UINT DstFirstMip;
- UINT NumMips;
- UINT SrcFirstElement;
- UINT DstFirstElement;
- UINT NumElements;
- UINT Filter;
- UINT MipFilter;
-
-#ifdef __cplusplus
- _D3DX10_TEXTURE_LOAD_INFO()
- {
- pSrcBox = NULL;
- pDstBox = NULL;
- SrcFirstMip = 0;
- DstFirstMip = 0;
- NumMips = D3DX10_DEFAULT;
- SrcFirstElement = 0;
- DstFirstElement = 0;
- NumElements = D3DX10_DEFAULT;
- Filter = D3DX10_DEFAULT;
- MipFilter = D3DX10_DEFAULT;
- }
-#endif
-
-} D3DX10_TEXTURE_LOAD_INFO;
-
-
-//----------------------------------------------------------------------------
-// D3DX10LoadTextureFromTexture:
-// ----------------------------
-// Load a texture from a texture.
-//
-// Parameters:
-//
-//----------------------------------------------------------------------------
-
-
-HRESULT WINAPI
- D3DX10LoadTextureFromTexture(
- ID3D10Resource *pSrcTexture,
- D3DX10_TEXTURE_LOAD_INFO *pLoadInfo,
- ID3D10Resource *pDstTexture);
-
-
-//----------------------------------------------------------------------------
-// D3DX10FilterTexture:
-// ------------------
-// Filters mipmaps levels of a texture.
-//
-// Parameters:
-// pBaseTexture
-// The texture object to be filtered
-// SrcLevel
-// The level whose image is used to generate the subsequent levels.
-// MipFilter
-// D3DX10_FILTER flags controlling how each miplevel is filtered.
-// Or D3DX10_DEFAULT for D3DX10_FILTER_BOX,
-//
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10FilterTexture(
- ID3D10Resource *pTexture,
- UINT SrcLevel,
- UINT MipFilter);
-
-
-//----------------------------------------------------------------------------
-// D3DX10SaveTextureToFile:
-// ----------------------
-// Save a texture to a file.
-//
-// Parameters:
-// pDestFile
-// File name of the destination file
-// DestFormat
-// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
-// pSrcTexture
-// Source texture, containing the image to be saved
-//
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10SaveTextureToFileA(
- ID3D10Resource *pSrcTexture,
- D3DX10_IMAGE_FILE_FORMAT DestFormat,
- LPCSTR pDestFile);
-
-HRESULT WINAPI
- D3DX10SaveTextureToFileW(
- ID3D10Resource *pSrcTexture,
- D3DX10_IMAGE_FILE_FORMAT DestFormat,
- LPCWSTR pDestFile);
-
-#ifdef UNICODE
-#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW
-#else
-#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA
-#endif
-
-
-//----------------------------------------------------------------------------
-// D3DX10SaveTextureToMemory:
-// ----------------------
-// Save a texture to a blob.
-//
-// Parameters:
-// pSrcTexture
-// Source texture, containing the image to be saved
-// DestFormat
-// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
-// ppDestBuf
-// address of a d3dxbuffer pointer to return the image data
-// Flags
-// optional flags
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10SaveTextureToMemory(
- ID3D10Resource* pSrcTexture,
- D3DX10_IMAGE_FILE_FORMAT DestFormat,
- LPD3D10BLOB* ppDestBuf,
- UINT Flags);
-
-
-//----------------------------------------------------------------------------
-// D3DX10ComputeNormalMap:
-// ---------------------
-// Converts a height map into a normal map. The (x,y,z) components of each
-// normal are mapped to the (r,g,b) channels of the output texture.
-//
-// Parameters
-// pSrcTexture
-// Pointer to the source heightmap texture
-// Flags
-// D3DX10_NORMALMAP flags
-// Channel
-// D3DX10_CHANNEL specifying source of height information
-// Amplitude
-// The constant value which the height information is multiplied by.
-// pDestTexture
-// Pointer to the destination texture
-//---------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10ComputeNormalMap(
- ID3D10Texture2D *pSrcTexture,
- UINT Flags,
- UINT Channel,
- FLOAT Amplitude,
- ID3D10Texture2D *pDestTexture);
-
-
-//----------------------------------------------------------------------------
-// D3DX10SHProjectCubeMap:
-// ----------------------
-// Projects a function represented in a cube map into spherical harmonics.
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pCubeMap
-// CubeMap that is going to be projected into spherical harmonics
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green
-// pBOut
-// Output SH vector for Blue
-//
-//---------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX10SHProjectCubeMap(
- __in_range(2,6) UINT Order,
- ID3D10Texture2D *pCubeMap,
- __out_ecount(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3DX10TEX_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx11.h b/3rdparty/dxsdk/Include/d3dx11.h
deleted file mode 100644
index 103c782f17b..00000000000
--- a/3rdparty/dxsdk/Include/d3dx11.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx11.h
-// Content: D3DX11 utility library
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef __D3DX11_INTERNAL__
-#error Incorrect D3DX11 header used
-#endif
-
-#ifndef __D3DX11_H__
-#define __D3DX11_H__
-
-
-// Defines
-#include <limits.h>
-#include <float.h>
-
-#ifdef ALLOW_THROWING_NEW
-#include <new>
-#endif
-
-#define D3DX11_DEFAULT ((UINT) -1)
-#define D3DX11_FROM_FILE ((UINT) -3)
-#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
-
-#ifndef D3DX11INLINE
-#ifdef _MSC_VER
- #if (_MSC_VER >= 1200)
- #define D3DX11INLINE __forceinline
- #else
- #define D3DX11INLINE __inline
- #endif
-#else
- #ifdef __cplusplus
- #define D3DX11INLINE inline
- #else
- #define D3DX11INLINE
- #endif
-#endif
-#endif
-
-
-
-// Includes
-#include "d3d11.h"
-#include "d3dx11.h"
-#include "d3dx11core.h"
-#include "d3dx11tex.h"
-#include "d3dx11async.h"
-
-
-// Errors
-#define _FACDD 0x876
-#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
-
-enum _D3DX11_ERR {
- D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
- D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
- D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
- D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
- D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
- D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
- D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
- D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
- D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
-};
-
-
-#endif //__D3DX11_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx11async.h b/3rdparty/dxsdk/Include/d3dx11async.h
deleted file mode 100644
index 4586c55ecd2..00000000000
--- a/3rdparty/dxsdk/Include/d3dx11async.h
+++ /dev/null
@@ -1,164 +0,0 @@
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// File: D3DX11Async.h
-// Content: D3DX11 Asynchronous Shader loaders / compilers
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3DX11ASYNC_H__
-#define __D3DX11ASYNC_H__
-
-#include "d3dx11.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-//----------------------------------------------------------------------------
-// D3DX11Compile:
-// ------------------
-// Compiles an effect or shader.
-//
-// Parameters:
-// pSrcFile
-// Source file name.
-// hSrcModule
-// Module handle. if NULL, current module will be used.
-// pSrcResource
-// Resource name in module.
-// pSrcData
-// Pointer to source code.
-// SrcDataLen
-// Size of source code, in bytes.
-// pDefines
-// Optional NULL-terminated array of preprocessor macro definitions.
-// pInclude
-// Optional interface pointer to use for handling #include directives.
-// If this parameter is NULL, #includes will be honored when compiling
-// from file, and will error when compiling from resource or memory.
-// pFunctionName
-// Name of the entrypoint function where execution should begin.
-// pProfile
-// Instruction set to be used when generating code. Currently supported
-// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
-// "vs_3_sw", "vs_4_0", "vs_4_1",
-// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
-// "ps_3_sw", "ps_4_0", "ps_4_1",
-// "gs_4_0", "gs_4_1",
-// "tx_1_0",
-// "fx_4_0", "fx_4_1"
-// Note that this entrypoint does not compile fx_2_0 targets, for that
-// you need to use the D3DX9 function.
-// Flags1
-// See D3D10_SHADER_xxx flags.
-// Flags2
-// See D3D10_EFFECT_xxx flags.
-// ppShader
-// Returns a buffer containing the created shader. This buffer contains
-// the compiled shader code, as well as any embedded debug and symbol
-// table info. (See D3D10GetShaderConstantTable)
-// ppErrorMsgs
-// Returns a buffer containing a listing of errors and warnings that were
-// encountered during the compile. If you are running in a debugger,
-// these are the same messages you will see in your debug output.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CompileFromFile D3DX11CompileFromFileW
-#else
-#define D3DX11CompileFromFile D3DX11CompileFromFileA
-#endif
-
-HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CompileFromResource D3DX11CompileFromResourceW
-#else
-#define D3DX11CompileFromResource D3DX11CompileFromResourceA
-#endif
-
-HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
- LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW
-#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW
-#else
-#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA
-#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA
-#endif
-
-//----------------------------------------------------------------------------
-// Async processors
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
- ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
-
-HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
- ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
-
-//----------------------------------------------------------------------------
-// D3DX11 Asynchronous texture I/O (advanced mode)
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
-HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
-
-#ifdef UNICODE
-#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW
-#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW
-#else
-#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA
-#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA
-#endif
-
-HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
-HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor);
-HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3DX11ASYNC_H__
-
-
diff --git a/3rdparty/dxsdk/Include/d3dx11core.h b/3rdparty/dxsdk/Include/d3dx11core.h
deleted file mode 100644
index 18e99351e08..00000000000
--- a/3rdparty/dxsdk/Include/d3dx11core.h
+++ /dev/null
@@ -1,128 +0,0 @@
-///////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx11core.h
-// Content: D3DX11 core types and functions
-//
-///////////////////////////////////////////////////////////////////////////
-
-#include "d3dx11.h"
-
-#ifndef __D3DX11CORE_H__
-#define __D3DX11CORE_H__
-
-// Current name of the DLL shipped in the same SDK as this header.
-
-
-#define D3DX11_DLL_W L"d3dx11_43.dll"
-#define D3DX11_DLL_A "d3dx11_43.dll"
-
-#ifdef UNICODE
- #define D3DX11_DLL D3DX11_DLL_W
-#else
- #define D3DX11_DLL D3DX11_DLL_A
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-///////////////////////////////////////////////////////////////////////////
-// D3DX11_SDK_VERSION:
-// -----------------
-// This identifier is passed to D3DX11CheckVersion in order to ensure that an
-// application was built against the correct header files and lib files.
-// This number is incremented whenever a header (or other) change would
-// require applications to be rebuilt. If the version doesn't match,
-// D3DX11CreateVersion will return FALSE. (The number itself has no meaning.)
-///////////////////////////////////////////////////////////////////////////
-
-
-#define D3DX11_SDK_VERSION 43
-
-
-#ifdef D3D_DIAG_DLL
-BOOL WINAPI D3DX11DebugMute(BOOL Mute);
-#endif
-HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// ID3DX11ThreadPump:
-//////////////////////////////////////////////////////////////////////////////
-
-#undef INTERFACE
-#define INTERFACE ID3DX11DataLoader
-
-DECLARE_INTERFACE(ID3DX11DataLoader)
-{
- STDMETHOD(Load)(THIS) PURE;
- STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE ID3DX11DataProcessor
-
-DECLARE_INTERFACE(ID3DX11DataProcessor)
-{
- STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
- STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
-};
-
-// {C93FECFA-6967-478a-ABBC-402D90621FCB}
-DEFINE_GUID(IID_ID3DX11ThreadPump,
-0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
-
-#undef INTERFACE
-#define INTERFACE ID3DX11ThreadPump
-
-DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown)
-{
- // IUnknown
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- // ID3DX11ThreadPump
- STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
- STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
-
- STDMETHOD(WaitForAllItems)(THIS) PURE;
- STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
-
- STDMETHOD(PurgeAllItems)(THIS) PURE;
- STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
-
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump);
-
-HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-///////////////////////////////////////////////////////////////////////////
-
-#define _FACD3D 0x876
-#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
-#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
-
-#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
-#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
-
-#endif //__D3DX11CORE_H__
-
diff --git a/3rdparty/dxsdk/Include/d3dx11tex.h b/3rdparty/dxsdk/Include/d3dx11tex.h
deleted file mode 100644
index 16c04091368..00000000000
--- a/3rdparty/dxsdk/Include/d3dx11tex.h
+++ /dev/null
@@ -1,772 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx11tex.h
-// Content: D3DX11 texturing APIs
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include "d3dx11.h"
-
-#ifndef __D3DX11TEX_H__
-#define __D3DX11TEX_H__
-
-
-//----------------------------------------------------------------------------
-// D3DX11_FILTER flags:
-// ------------------
-//
-// A valid filter must contain one of these values:
-//
-// D3DX11_FILTER_NONE
-// No scaling or filtering will take place. Pixels outside the bounds
-// of the source image are assumed to be transparent black.
-// D3DX11_FILTER_POINT
-// Each destination pixel is computed by sampling the nearest pixel
-// from the source image.
-// D3DX11_FILTER_LINEAR
-// Each destination pixel is computed by linearly interpolating between
-// the nearest pixels in the source image. This filter works best
-// when the scale on each axis is less than 2.
-// D3DX11_FILTER_TRIANGLE
-// Every pixel in the source image contributes equally to the
-// destination image. This is the slowest of all the filters.
-// D3DX11_FILTER_BOX
-// Each pixel is computed by averaging a 2x2(x2) box pixels from
-// the source image. Only works when the dimensions of the
-// destination are half those of the source. (as with mip maps)
-//
-// And can be OR'd with any of these optional flags:
-//
-// D3DX11_FILTER_MIRROR_U
-// Indicates that pixels off the edge of the texture on the U-axis
-// should be mirrored, not wraped.
-// D3DX11_FILTER_MIRROR_V
-// Indicates that pixels off the edge of the texture on the V-axis
-// should be mirrored, not wraped.
-// D3DX11_FILTER_MIRROR_W
-// Indicates that pixels off the edge of the texture on the W-axis
-// should be mirrored, not wraped.
-// D3DX11_FILTER_MIRROR
-// Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V |
-// D3DX11_FILTER_MIRROR_V
-// D3DX11_FILTER_DITHER
-// Dithers the resulting image using a 4x4 order dither pattern.
-// D3DX11_FILTER_SRGB_IN
-// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
-// D3DX11_FILTER_SRGB_OUT
-// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
-// D3DX11_FILTER_SRGB
-// Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX11_FILTER_FLAG
-{
- D3DX11_FILTER_NONE = (1 << 0),
- D3DX11_FILTER_POINT = (2 << 0),
- D3DX11_FILTER_LINEAR = (3 << 0),
- D3DX11_FILTER_TRIANGLE = (4 << 0),
- D3DX11_FILTER_BOX = (5 << 0),
-
- D3DX11_FILTER_MIRROR_U = (1 << 16),
- D3DX11_FILTER_MIRROR_V = (2 << 16),
- D3DX11_FILTER_MIRROR_W = (4 << 16),
- D3DX11_FILTER_MIRROR = (7 << 16),
-
- D3DX11_FILTER_DITHER = (1 << 19),
- D3DX11_FILTER_DITHER_DIFFUSION= (2 << 19),
-
- D3DX11_FILTER_SRGB_IN = (1 << 21),
- D3DX11_FILTER_SRGB_OUT = (2 << 21),
- D3DX11_FILTER_SRGB = (3 << 21),
-} D3DX11_FILTER_FLAG;
-
-//----------------------------------------------------------------------------
-// D3DX11_NORMALMAP flags:
-// ---------------------
-// These flags are used to control how D3DX11ComputeNormalMap generates normal
-// maps. Any number of these flags may be OR'd together in any combination.
-//
-// D3DX11_NORMALMAP_MIRROR_U
-// Indicates that pixels off the edge of the texture on the U-axis
-// should be mirrored, not wraped.
-// D3DX11_NORMALMAP_MIRROR_V
-// Indicates that pixels off the edge of the texture on the V-axis
-// should be mirrored, not wraped.
-// D3DX11_NORMALMAP_MIRROR
-// Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V
-// D3DX11_NORMALMAP_INVERTSIGN
-// Inverts the direction of each normal
-// D3DX11_NORMALMAP_COMPUTE_OCCLUSION
-// Compute the per pixel Occlusion term and encodes it into the alpha.
-// An Alpha of 1 means that the pixel is not obscured in anyway, and
-// an alpha of 0 would mean that the pixel is completly obscured.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX11_NORMALMAP_FLAG
-{
- D3DX11_NORMALMAP_MIRROR_U = (1 << 16),
- D3DX11_NORMALMAP_MIRROR_V = (2 << 16),
- D3DX11_NORMALMAP_MIRROR = (3 << 16),
- D3DX11_NORMALMAP_INVERTSIGN = (8 << 16),
- D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
-} D3DX11_NORMALMAP_FLAG;
-
-//----------------------------------------------------------------------------
-// D3DX11_CHANNEL flags:
-// -------------------
-// These flags are used by functions which operate on or more channels
-// in a texture.
-//
-// D3DX11_CHANNEL_RED
-// Indicates the red channel should be used
-// D3DX11_CHANNEL_BLUE
-// Indicates the blue channel should be used
-// D3DX11_CHANNEL_GREEN
-// Indicates the green channel should be used
-// D3DX11_CHANNEL_ALPHA
-// Indicates the alpha channel should be used
-// D3DX11_CHANNEL_LUMINANCE
-// Indicates the luminaces of the red green and blue channels should be
-// used.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX11_CHANNEL_FLAG
-{
- D3DX11_CHANNEL_RED = (1 << 0),
- D3DX11_CHANNEL_BLUE = (1 << 1),
- D3DX11_CHANNEL_GREEN = (1 << 2),
- D3DX11_CHANNEL_ALPHA = (1 << 3),
- D3DX11_CHANNEL_LUMINANCE = (1 << 4),
-} D3DX11_CHANNEL_FLAG;
-
-
-
-//----------------------------------------------------------------------------
-// D3DX11_IMAGE_FILE_FORMAT:
-// ---------------------
-// This enum is used to describe supported image file formats.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX11_IMAGE_FILE_FORMAT
-{
- D3DX11_IFF_BMP = 0,
- D3DX11_IFF_JPG = 1,
- D3DX11_IFF_PNG = 3,
- D3DX11_IFF_DDS = 4,
- D3DX11_IFF_TIFF = 10,
- D3DX11_IFF_GIF = 11,
- D3DX11_IFF_WMP = 12,
- D3DX11_IFF_FORCE_DWORD = 0x7fffffff
-
-} D3DX11_IMAGE_FILE_FORMAT;
-
-
-//----------------------------------------------------------------------------
-// D3DX11_SAVE_TEXTURE_FLAG:
-// ---------------------
-// This enum is used to support texture saving options.
-//
-//----------------------------------------------------------------------------
-
-typedef enum D3DX11_SAVE_TEXTURE_FLAG
-{
- D3DX11_STF_USEINPUTBLOB = 0x0001,
-} D3DX11_SAVE_TEXTURE_FLAG;
-
-
-//----------------------------------------------------------------------------
-// D3DX11_IMAGE_INFO:
-// ---------------
-// This structure is used to return a rough description of what the
-// the original contents of an image file looked like.
-//
-// Width
-// Width of original image in pixels
-// Height
-// Height of original image in pixels
-// Depth
-// Depth of original image in pixels
-// ArraySize
-// Array size in textures
-// MipLevels
-// Number of mip levels in original image
-// MiscFlags
-// Miscellaneous flags
-// Format
-// D3D format which most closely describes the data in original image
-// ResourceDimension
-// D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
-// D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
-// ImageFileFormat
-// D3DX11_IMAGE_FILE_FORMAT representing the format of the image file.
-//----------------------------------------------------------------------------
-
-typedef struct D3DX11_IMAGE_INFO
-{
- UINT Width;
- UINT Height;
- UINT Depth;
- UINT ArraySize;
- UINT MipLevels;
- UINT MiscFlags;
- DXGI_FORMAT Format;
- D3D11_RESOURCE_DIMENSION ResourceDimension;
- D3DX11_IMAGE_FILE_FORMAT ImageFileFormat;
-} D3DX11_IMAGE_INFO;
-
-
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Image File APIs ///////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX11_IMAGE_LOAD_INFO:
-// ---------------
-// This structure can be optionally passed in to texture loader APIs to
-// control how textures get loaded. Pass in D3DX11_DEFAULT for any of these
-// to have D3DX automatically pick defaults based on the source file.
-//
-// Width
-// Rescale texture to Width texels wide
-// Height
-// Rescale texture to Height texels high
-// Depth
-// Rescale texture to Depth texels deep
-// FirstMipLevel
-// First mip level to load
-// MipLevels
-// Number of mip levels to load after the first level
-// Usage
-// D3D11_USAGE flag for the new texture
-// BindFlags
-// D3D11 Bind flags for the new texture
-// CpuAccessFlags
-// D3D11 CPU Access flags for the new texture
-// MiscFlags
-// Reserved. Must be 0
-// Format
-// Resample texture to the specified format
-// Filter
-// Filter the texture using the specified filter (only when resampling)
-// MipFilter
-// Filter the texture mip levels using the specified filter (only if
-// generating mips)
-// pSrcInfo
-// (optional) pointer to a D3DX11_IMAGE_INFO structure that will get
-// populated with source image information
-//----------------------------------------------------------------------------
-
-
-typedef struct D3DX11_IMAGE_LOAD_INFO
-{
- UINT Width;
- UINT Height;
- UINT Depth;
- UINT FirstMipLevel;
- UINT MipLevels;
- D3D11_USAGE Usage;
- UINT BindFlags;
- UINT CpuAccessFlags;
- UINT MiscFlags;
- DXGI_FORMAT Format;
- UINT Filter;
- UINT MipFilter;
- D3DX11_IMAGE_INFO* pSrcInfo;
-
-#ifdef __cplusplus
- D3DX11_IMAGE_LOAD_INFO()
- {
- Width = D3DX11_DEFAULT;
- Height = D3DX11_DEFAULT;
- Depth = D3DX11_DEFAULT;
- FirstMipLevel = D3DX11_DEFAULT;
- MipLevels = D3DX11_DEFAULT;
- Usage = (D3D11_USAGE) D3DX11_DEFAULT;
- BindFlags = D3DX11_DEFAULT;
- CpuAccessFlags = D3DX11_DEFAULT;
- MiscFlags = D3DX11_DEFAULT;
- Format = DXGI_FORMAT_FROM_FILE;
- Filter = D3DX11_DEFAULT;
- MipFilter = D3DX11_DEFAULT;
- pSrcInfo = NULL;
- }
-#endif
-
-} D3DX11_IMAGE_LOAD_INFO;
-
-//-------------------------------------------------------------------------------
-// GetImageInfoFromFile/Resource/Memory:
-// ------------------------------
-// Fills in a D3DX11_IMAGE_INFO struct with information about an image file.
-//
-// Parameters:
-// pSrcFile
-// File name of the source image.
-// pSrcModule
-// Module where resource is located, or NULL for module associated
-// with image the os used to create the current process.
-// pSrcResource
-// Resource name.
-// pSrcData
-// Pointer to file in memory.
-// SrcDataSize
-// Size in bytes of file in memory.
-// pPump
-// Optional pointer to a thread pump object to use.
-// pSrcInfo
-// Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the
-// description of the data in the source image file.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//-------------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11GetImageInfoFromFileA(
- LPCSTR pSrcFile,
- ID3DX11ThreadPump* pPump,
- D3DX11_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11GetImageInfoFromFileW(
- LPCWSTR pSrcFile,
- ID3DX11ThreadPump* pPump,
- D3DX11_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileW
-#else
-#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileA
-#endif
-
-
-HRESULT WINAPI
- D3DX11GetImageInfoFromResourceA(
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- ID3DX11ThreadPump* pPump,
- D3DX11_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11GetImageInfoFromResourceW(
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- ID3DX11ThreadPump* pPump,
- D3DX11_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceW
-#else
-#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceA
-#endif
-
-
-HRESULT WINAPI
- D3DX11GetImageInfoFromMemory(
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- ID3DX11ThreadPump* pPump,
- D3DX11_IMAGE_INFO* pSrcInfo,
- HRESULT* pHResult);
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Create/Save Texture APIs //////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX11CreateTextureFromFile/Resource/Memory:
-// D3DX11CreateShaderResourceViewFromFile/Resource/Memory:
-// -----------------------------------
-// Create a texture object from a file or resource.
-//
-// Parameters:
-//
-// pDevice
-// The D3D device with which the texture is going to be used.
-// pSrcFile
-// File name.
-// hSrcModule
-// Module handle. if NULL, current module will be used.
-// pSrcResource
-// Resource name in module
-// pvSrcData
-// Pointer to file in memory.
-// SrcDataSize
-// Size in bytes of file in memory.
-// pLoadInfo
-// Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that
-// contains additional loader parameters.
-// pPump
-// Optional pointer to a thread pump object to use.
-// ppTexture
-// [out] Created texture object.
-// ppShaderResourceView
-// [out] Shader resource view object created.
-// pHResult
-// Pointer to a memory location to receive the return value upon completion.
-// Maybe NULL if not needed.
-// If pPump != NULL, pHResult must be a valid memory location until the
-// the asynchronous execution completes.
-//
-//----------------------------------------------------------------------------
-
-
-// FromFile
-
-HRESULT WINAPI
- D3DX11CreateShaderResourceViewFromFileA(
- ID3D11Device* pDevice,
- LPCSTR pSrcFile,
- D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11CreateShaderResourceViewFromFileW(
- ID3D11Device* pDevice,
- LPCWSTR pSrcFile,
- D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileW
-#else
-#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileA
-#endif
-
-HRESULT WINAPI
- D3DX11CreateTextureFromFileA(
- ID3D11Device* pDevice,
- LPCSTR pSrcFile,
- D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11Resource** ppTexture,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11CreateTextureFromFileW(
- ID3D11Device* pDevice,
- LPCWSTR pSrcFile,
- D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11Resource** ppTexture,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileW
-#else
-#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileA
-#endif
-
-
-// FromResource (resources in dll/exes)
-
-HRESULT WINAPI
- D3DX11CreateShaderResourceViewFromResourceA(
- ID3D11Device* pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11CreateShaderResourceViewFromResourceW(
- ID3D11Device* pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceW
-#else
-#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceA
-#endif
-
-HRESULT WINAPI
- D3DX11CreateTextureFromResourceA(
- ID3D11Device* pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11Resource** ppTexture,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11CreateTextureFromResourceW(
- ID3D11Device* pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11Resource** ppTexture,
- HRESULT* pHResult);
-
-#ifdef UNICODE
-#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceW
-#else
-#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceA
-#endif
-
-
-// FromFileInMemory
-
-HRESULT WINAPI
- D3DX11CreateShaderResourceViewFromMemory(
- ID3D11Device* pDevice,
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11ShaderResourceView** ppShaderResourceView,
- HRESULT* pHResult);
-
-HRESULT WINAPI
- D3DX11CreateTextureFromMemory(
- ID3D11Device* pDevice,
- LPCVOID pSrcData,
- SIZE_T SrcDataSize,
- D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
- ID3DX11ThreadPump* pPump,
- ID3D11Resource** ppTexture,
- HRESULT* pHResult);
-
-
-//////////////////////////////////////////////////////////////////////////////
-// Misc Texture APIs /////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-//----------------------------------------------------------------------------
-// D3DX11_TEXTURE_LOAD_INFO:
-// ------------------------
-//
-//----------------------------------------------------------------------------
-
-typedef struct _D3DX11_TEXTURE_LOAD_INFO
-{
- D3D11_BOX *pSrcBox;
- D3D11_BOX *pDstBox;
- UINT SrcFirstMip;
- UINT DstFirstMip;
- UINT NumMips;
- UINT SrcFirstElement;
- UINT DstFirstElement;
- UINT NumElements;
- UINT Filter;
- UINT MipFilter;
-
-#ifdef __cplusplus
- _D3DX11_TEXTURE_LOAD_INFO()
- {
- pSrcBox = NULL;
- pDstBox = NULL;
- SrcFirstMip = 0;
- DstFirstMip = 0;
- NumMips = D3DX11_DEFAULT;
- SrcFirstElement = 0;
- DstFirstElement = 0;
- NumElements = D3DX11_DEFAULT;
- Filter = D3DX11_DEFAULT;
- MipFilter = D3DX11_DEFAULT;
- }
-#endif
-
-} D3DX11_TEXTURE_LOAD_INFO;
-
-
-//----------------------------------------------------------------------------
-// D3DX11LoadTextureFromTexture:
-// ----------------------------
-// Load a texture from a texture.
-//
-// Parameters:
-//
-//----------------------------------------------------------------------------
-
-
-HRESULT WINAPI
- D3DX11LoadTextureFromTexture(
- ID3D11DeviceContext *pContext,
- ID3D11Resource *pSrcTexture,
- D3DX11_TEXTURE_LOAD_INFO *pLoadInfo,
- ID3D11Resource *pDstTexture);
-
-
-//----------------------------------------------------------------------------
-// D3DX11FilterTexture:
-// ------------------
-// Filters mipmaps levels of a texture.
-//
-// Parameters:
-// pBaseTexture
-// The texture object to be filtered
-// SrcLevel
-// The level whose image is used to generate the subsequent levels.
-// MipFilter
-// D3DX11_FILTER flags controlling how each miplevel is filtered.
-// Or D3DX11_DEFAULT for D3DX11_FILTER_BOX,
-//
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11FilterTexture(
- ID3D11DeviceContext *pContext,
- ID3D11Resource *pTexture,
- UINT SrcLevel,
- UINT MipFilter);
-
-
-//----------------------------------------------------------------------------
-// D3DX11SaveTextureToFile:
-// ----------------------
-// Save a texture to a file.
-//
-// Parameters:
-// pDestFile
-// File name of the destination file
-// DestFormat
-// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
-// pSrcTexture
-// Source texture, containing the image to be saved
-//
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11SaveTextureToFileA(
- ID3D11DeviceContext *pContext,
- ID3D11Resource *pSrcTexture,
- D3DX11_IMAGE_FILE_FORMAT DestFormat,
- LPCSTR pDestFile);
-
-HRESULT WINAPI
- D3DX11SaveTextureToFileW(
- ID3D11DeviceContext *pContext,
- ID3D11Resource *pSrcTexture,
- D3DX11_IMAGE_FILE_FORMAT DestFormat,
- LPCWSTR pDestFile);
-
-#ifdef UNICODE
-#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileW
-#else
-#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileA
-#endif
-
-
-//----------------------------------------------------------------------------
-// D3DX11SaveTextureToMemory:
-// ----------------------
-// Save a texture to a blob.
-//
-// Parameters:
-// pSrcTexture
-// Source texture, containing the image to be saved
-// DestFormat
-// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
-// ppDestBuf
-// address of a d3dxbuffer pointer to return the image data
-// Flags
-// optional flags
-//----------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11SaveTextureToMemory(
- ID3D11DeviceContext *pContext,
- ID3D11Resource* pSrcTexture,
- D3DX11_IMAGE_FILE_FORMAT DestFormat,
- ID3D10Blob** ppDestBuf,
- UINT Flags);
-
-
-//----------------------------------------------------------------------------
-// D3DX11ComputeNormalMap:
-// ---------------------
-// Converts a height map into a normal map. The (x,y,z) components of each
-// normal are mapped to the (r,g,b) channels of the output texture.
-//
-// Parameters
-// pSrcTexture
-// Pointer to the source heightmap texture
-// Flags
-// D3DX11_NORMALMAP flags
-// Channel
-// D3DX11_CHANNEL specifying source of height information
-// Amplitude
-// The constant value which the height information is multiplied by.
-// pDestTexture
-// Pointer to the destination texture
-//---------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11ComputeNormalMap(
- ID3D11DeviceContext *pContext,
- ID3D11Texture2D *pSrcTexture,
- UINT Flags,
- UINT Channel,
- FLOAT Amplitude,
- ID3D11Texture2D *pDestTexture);
-
-
-//----------------------------------------------------------------------------
-// D3DX11SHProjectCubeMap:
-// ----------------------
-// Projects a function represented in a cube map into spherical harmonics.
-//
-// Parameters:
-// Order
-// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
-// pCubeMap
-// CubeMap that is going to be projected into spherical harmonics
-// pROut
-// Output SH vector for Red.
-// pGOut
-// Output SH vector for Green
-// pBOut
-// Output SH vector for Blue
-//
-//---------------------------------------------------------------------------
-
-HRESULT WINAPI
- D3DX11SHProjectCubeMap(
- ID3D11DeviceContext *pContext,
- __in_range(2,6) UINT Order,
- ID3D11Texture2D *pCubeMap,
- __out_ecount(Order*Order) FLOAT *pROut,
- __out_ecount_opt(Order*Order) FLOAT *pGOut,
- __out_ecount_opt(Order*Order) FLOAT *pBOut);
-
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-#endif //__D3DX11TEX_H__
-
diff --git a/3rdparty/dxsdk/Include/dinput.h b/3rdparty/dxsdk/Include/dinput.h
deleted file mode 100644
index 5aac2563824..00000000000
--- a/3rdparty/dxsdk/Include/dinput.h
+++ /dev/null
@@ -1,4417 +0,0 @@
-/****************************************************************************
- *
- * Copyright (C) 1996-2000 Microsoft Corporation. All Rights Reserved.
- *
- * File: dinput.h
- * Content: DirectInput include file
- *
- ****************************************************************************/
-
-#ifndef __DINPUT_INCLUDED__
-#define __DINPUT_INCLUDED__
-
-#ifndef DIJ_RINGZERO
-
-#ifdef _WIN32
-#define COM_NO_WINDOWS_H
-#include <objbase.h>
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-
-
-/*
- * To build applications for older versions of DirectInput
- *
- * #define DIRECTINPUT_VERSION [ 0x0300 | 0x0500 | 0x0700 ]
- *
- * before #include <dinput.h>. By default, #include <dinput.h>
- * will produce a DirectX 8-compatible header file.
- *
- */
-
-#define DIRECTINPUT_HEADER_VERSION 0x0800
-#ifndef DIRECTINPUT_VERSION
-#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION
-#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
-#endif
-
-#ifndef DIJ_RINGZERO
-
-/****************************************************************************
- *
- * Class IDs
- *
- ****************************************************************************/
-
-DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(CLSID_DirectInputDevice8,0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-/****************************************************************************
- *
- * Interfaces
- *
- ****************************************************************************/
-
-DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
-DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
-DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
-DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
-DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputDevice7A,0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
-DEFINE_GUID(IID_IDirectInputDevice7W,0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
-DEFINE_GUID(IID_IDirectInputDevice8A,0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
-DEFINE_GUID(IID_IDirectInputDevice8W,0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
-DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-
-/****************************************************************************
- *
- * Predefined object types
- *
- ****************************************************************************/
-
-DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-/****************************************************************************
- *
- * Predefined product GUIDs
- *
- ****************************************************************************/
-
-DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-
-/****************************************************************************
- *
- * Predefined force feedback effects
- *
- ****************************************************************************/
-
-DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-
-#endif /* DIJ_RINGZERO */
-
-/****************************************************************************
- *
- * Interfaces and Structures...
- *
- ****************************************************************************/
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-
-/****************************************************************************
- *
- * IDirectInputEffect
- *
- ****************************************************************************/
-
-#define DIEFT_ALL 0x00000000
-
-#define DIEFT_CONSTANTFORCE 0x00000001
-#define DIEFT_RAMPFORCE 0x00000002
-#define DIEFT_PERIODIC 0x00000003
-#define DIEFT_CONDITION 0x00000004
-#define DIEFT_CUSTOMFORCE 0x00000005
-#define DIEFT_HARDWARE 0x000000FF
-#define DIEFT_FFATTACK 0x00000200
-#define DIEFT_FFFADE 0x00000400
-#define DIEFT_SATURATION 0x00000800
-#define DIEFT_POSNEGCOEFFICIENTS 0x00001000
-#define DIEFT_POSNEGSATURATION 0x00002000
-#define DIEFT_DEADBAND 0x00004000
-#define DIEFT_STARTDELAY 0x00008000
-#define DIEFT_GETTYPE(n) LOBYTE(n)
-
-#define DI_DEGREES 100
-#define DI_FFNOMINALMAX 10000
-#define DI_SECONDS 1000000
-
-typedef struct DICONSTANTFORCE {
- LONG lMagnitude;
-} DICONSTANTFORCE, *LPDICONSTANTFORCE;
-typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
-
-typedef struct DIRAMPFORCE {
- LONG lStart;
- LONG lEnd;
-} DIRAMPFORCE, *LPDIRAMPFORCE;
-typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
-
-typedef struct DIPERIODIC {
- DWORD dwMagnitude;
- LONG lOffset;
- DWORD dwPhase;
- DWORD dwPeriod;
-} DIPERIODIC, *LPDIPERIODIC;
-typedef const DIPERIODIC *LPCDIPERIODIC;
-
-typedef struct DICONDITION {
- LONG lOffset;
- LONG lPositiveCoefficient;
- LONG lNegativeCoefficient;
- DWORD dwPositiveSaturation;
- DWORD dwNegativeSaturation;
- LONG lDeadBand;
-} DICONDITION, *LPDICONDITION;
-typedef const DICONDITION *LPCDICONDITION;
-
-typedef struct DICUSTOMFORCE {
- DWORD cChannels;
- DWORD dwSamplePeriod;
- DWORD cSamples;
- LPLONG rglForceData;
-} DICUSTOMFORCE, *LPDICUSTOMFORCE;
-typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
-
-
-typedef struct DIENVELOPE {
- DWORD dwSize; /* sizeof(DIENVELOPE) */
- DWORD dwAttackLevel;
- DWORD dwAttackTime; /* Microseconds */
- DWORD dwFadeLevel;
- DWORD dwFadeTime; /* Microseconds */
-} DIENVELOPE, *LPDIENVELOPE;
-typedef const DIENVELOPE *LPCDIENVELOPE;
-
-
-/* This structure is defined for DirectX 5.0 compatibility */
-typedef struct DIEFFECT_DX5 {
- DWORD dwSize; /* sizeof(DIEFFECT_DX5) */
- DWORD dwFlags; /* DIEFF_* */
- DWORD dwDuration; /* Microseconds */
- DWORD dwSamplePeriod; /* Microseconds */
- DWORD dwGain;
- DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
- DWORD dwTriggerRepeatInterval; /* Microseconds */
- DWORD cAxes; /* Number of axes */
- LPDWORD rgdwAxes; /* Array of axes */
- LPLONG rglDirection; /* Array of directions */
- LPDIENVELOPE lpEnvelope; /* Optional */
- DWORD cbTypeSpecificParams; /* Size of params */
- LPVOID lpvTypeSpecificParams; /* Pointer to params */
-} DIEFFECT_DX5, *LPDIEFFECT_DX5;
-typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5;
-
-typedef struct DIEFFECT {
- DWORD dwSize; /* sizeof(DIEFFECT) */
- DWORD dwFlags; /* DIEFF_* */
- DWORD dwDuration; /* Microseconds */
- DWORD dwSamplePeriod; /* Microseconds */
- DWORD dwGain;
- DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */
- DWORD dwTriggerRepeatInterval; /* Microseconds */
- DWORD cAxes; /* Number of axes */
- LPDWORD rgdwAxes; /* Array of axes */
- LPLONG rglDirection; /* Array of directions */
- LPDIENVELOPE lpEnvelope; /* Optional */
- DWORD cbTypeSpecificParams; /* Size of params */
- LPVOID lpvTypeSpecificParams; /* Pointer to params */
-#if(DIRECTINPUT_VERSION >= 0x0600)
- DWORD dwStartDelay; /* Microseconds */
-#endif /* DIRECTINPUT_VERSION >= 0x0600 */
-} DIEFFECT, *LPDIEFFECT;
-typedef DIEFFECT DIEFFECT_DX6;
-typedef LPDIEFFECT LPDIEFFECT_DX6;
-typedef const DIEFFECT *LPCDIEFFECT;
-
-
-#if(DIRECTINPUT_VERSION >= 0x0700)
-#ifndef DIJ_RINGZERO
-typedef struct DIFILEEFFECT{
- DWORD dwSize;
- GUID GuidEffect;
- LPCDIEFFECT lpDiEffect;
- CHAR szFriendlyName[MAX_PATH];
-}DIFILEEFFECT, *LPDIFILEEFFECT;
-typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
-typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
-#endif /* DIJ_RINGZERO */
-#endif /* DIRECTINPUT_VERSION >= 0x0700 */
-
-#define DIEFF_OBJECTIDS 0x00000001
-#define DIEFF_OBJECTOFFSETS 0x00000002
-#define DIEFF_CARTESIAN 0x00000010
-#define DIEFF_POLAR 0x00000020
-#define DIEFF_SPHERICAL 0x00000040
-
-#define DIEP_DURATION 0x00000001
-#define DIEP_SAMPLEPERIOD 0x00000002
-#define DIEP_GAIN 0x00000004
-#define DIEP_TRIGGERBUTTON 0x00000008
-#define DIEP_TRIGGERREPEATINTERVAL 0x00000010
-#define DIEP_AXES 0x00000020
-#define DIEP_DIRECTION 0x00000040
-#define DIEP_ENVELOPE 0x00000080
-#define DIEP_TYPESPECIFICPARAMS 0x00000100
-#if(DIRECTINPUT_VERSION >= 0x0600)
-#define DIEP_STARTDELAY 0x00000200
-#define DIEP_ALLPARAMS_DX5 0x000001FF
-#define DIEP_ALLPARAMS 0x000003FF
-#else /* DIRECTINPUT_VERSION < 0x0600 */
-#define DIEP_ALLPARAMS 0x000001FF
-#endif /* DIRECTINPUT_VERSION < 0x0600 */
-#define DIEP_START 0x20000000
-#define DIEP_NORESTART 0x40000000
-#define DIEP_NODOWNLOAD 0x80000000
-#define DIEB_NOTRIGGER 0xFFFFFFFF
-
-#define DIES_SOLO 0x00000001
-#define DIES_NODOWNLOAD 0x80000000
-
-#define DIEGES_PLAYING 0x00000001
-#define DIEGES_EMULATED 0x00000002
-
-typedef struct DIEFFESCAPE {
- DWORD dwSize;
- DWORD dwCommand;
- LPVOID lpvInBuffer;
- DWORD cbInBuffer;
- LPVOID lpvOutBuffer;
- DWORD cbOutBuffer;
-} DIEFFESCAPE, *LPDIEFFESCAPE;
-
-#ifndef DIJ_RINGZERO
-
-#undef INTERFACE
-#define INTERFACE IDirectInputEffect
-
-DECLARE_INTERFACE_(IDirectInputEffect, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputEffect methods ***/
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
- STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE;
- STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE;
- STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE;
- STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE;
- STDMETHOD(Stop)(THIS) PURE;
- STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE;
- STDMETHOD(Download)(THIS) PURE;
- STDMETHOD(Unload)(THIS) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
-};
-
-typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
-#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a)
-#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b)
-#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b)
-#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b)
-#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p)
-#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a)
-#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p)
-#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p)
-#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a)
-#else
-#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputEffect_AddRef(p) (p)->AddRef()
-#define IDirectInputEffect_Release(p) (p)->Release()
-#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
-#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a)
-#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b)
-#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b)
-#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b)
-#define IDirectInputEffect_Stop(p) (p)->Stop()
-#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a)
-#define IDirectInputEffect_Download(p) (p)->Download()
-#define IDirectInputEffect_Unload(p) (p)->Unload()
-#define IDirectInputEffect_Escape(p,a) (p)->Escape(a)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-/****************************************************************************
- *
- * IDirectInputDevice
- *
- ****************************************************************************/
-
-#if DIRECTINPUT_VERSION <= 0x700
-#define DIDEVTYPE_DEVICE 1
-#define DIDEVTYPE_MOUSE 2
-#define DIDEVTYPE_KEYBOARD 3
-#define DIDEVTYPE_JOYSTICK 4
-
-#else
-#define DI8DEVCLASS_ALL 0
-#define DI8DEVCLASS_DEVICE 1
-#define DI8DEVCLASS_POINTER 2
-#define DI8DEVCLASS_KEYBOARD 3
-#define DI8DEVCLASS_GAMECTRL 4
-
-#define DI8DEVTYPE_DEVICE 0x11
-#define DI8DEVTYPE_MOUSE 0x12
-#define DI8DEVTYPE_KEYBOARD 0x13
-#define DI8DEVTYPE_JOYSTICK 0x14
-#define DI8DEVTYPE_GAMEPAD 0x15
-#define DI8DEVTYPE_DRIVING 0x16
-#define DI8DEVTYPE_FLIGHT 0x17
-#define DI8DEVTYPE_1STPERSON 0x18
-#define DI8DEVTYPE_DEVICECTRL 0x19
-#define DI8DEVTYPE_SCREENPOINTER 0x1A
-#define DI8DEVTYPE_REMOTE 0x1B
-#define DI8DEVTYPE_SUPPLEMENTAL 0x1C
-#endif /* DIRECTINPUT_VERSION <= 0x700 */
-
-#define DIDEVTYPE_HID 0x00010000
-
-#if DIRECTINPUT_VERSION <= 0x700
-#define DIDEVTYPEMOUSE_UNKNOWN 1
-#define DIDEVTYPEMOUSE_TRADITIONAL 2
-#define DIDEVTYPEMOUSE_FINGERSTICK 3
-#define DIDEVTYPEMOUSE_TOUCHPAD 4
-#define DIDEVTYPEMOUSE_TRACKBALL 5
-
-#define DIDEVTYPEKEYBOARD_UNKNOWN 0
-#define DIDEVTYPEKEYBOARD_PCXT 1
-#define DIDEVTYPEKEYBOARD_OLIVETTI 2
-#define DIDEVTYPEKEYBOARD_PCAT 3
-#define DIDEVTYPEKEYBOARD_PCENH 4
-#define DIDEVTYPEKEYBOARD_NOKIA1050 5
-#define DIDEVTYPEKEYBOARD_NOKIA9140 6
-#define DIDEVTYPEKEYBOARD_NEC98 7
-#define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
-#define DIDEVTYPEKEYBOARD_NEC98106 9
-#define DIDEVTYPEKEYBOARD_JAPAN106 10
-#define DIDEVTYPEKEYBOARD_JAPANAX 11
-#define DIDEVTYPEKEYBOARD_J3100 12
-
-#define DIDEVTYPEJOYSTICK_UNKNOWN 1
-#define DIDEVTYPEJOYSTICK_TRADITIONAL 2
-#define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
-#define DIDEVTYPEJOYSTICK_GAMEPAD 4
-#define DIDEVTYPEJOYSTICK_RUDDER 5
-#define DIDEVTYPEJOYSTICK_WHEEL 6
-#define DIDEVTYPEJOYSTICK_HEADTRACKER 7
-
-#else
-#define DI8DEVTYPEMOUSE_UNKNOWN 1
-#define DI8DEVTYPEMOUSE_TRADITIONAL 2
-#define DI8DEVTYPEMOUSE_FINGERSTICK 3
-#define DI8DEVTYPEMOUSE_TOUCHPAD 4
-#define DI8DEVTYPEMOUSE_TRACKBALL 5
-#define DI8DEVTYPEMOUSE_ABSOLUTE 6
-
-#define DI8DEVTYPEKEYBOARD_UNKNOWN 0
-#define DI8DEVTYPEKEYBOARD_PCXT 1
-#define DI8DEVTYPEKEYBOARD_OLIVETTI 2
-#define DI8DEVTYPEKEYBOARD_PCAT 3
-#define DI8DEVTYPEKEYBOARD_PCENH 4
-#define DI8DEVTYPEKEYBOARD_NOKIA1050 5
-#define DI8DEVTYPEKEYBOARD_NOKIA9140 6
-#define DI8DEVTYPEKEYBOARD_NEC98 7
-#define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8
-#define DI8DEVTYPEKEYBOARD_NEC98106 9
-#define DI8DEVTYPEKEYBOARD_JAPAN106 10
-#define DI8DEVTYPEKEYBOARD_JAPANAX 11
-#define DI8DEVTYPEKEYBOARD_J3100 12
-
-#define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1
-
-#define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
-#define DI8DEVTYPEJOYSTICK_STANDARD 2
-
-#define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
-#define DI8DEVTYPEGAMEPAD_STANDARD 2
-#define DI8DEVTYPEGAMEPAD_TILT 3
-
-#define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
-#define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2
-#define DI8DEVTYPEDRIVING_DUALPEDALS 3
-#define DI8DEVTYPEDRIVING_THREEPEDALS 4
-#define DI8DEVTYPEDRIVING_HANDHELD 5
-
-#define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
-#define DI8DEVTYPEFLIGHT_STICK 2
-#define DI8DEVTYPEFLIGHT_YOKE 3
-#define DI8DEVTYPEFLIGHT_RC 4
-
-#define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
-#define DI8DEVTYPE1STPERSON_UNKNOWN 2
-#define DI8DEVTYPE1STPERSON_SIXDOF 3
-#define DI8DEVTYPE1STPERSON_SHOOTER 4
-
-#define DI8DEVTYPESCREENPTR_UNKNOWN 2
-#define DI8DEVTYPESCREENPTR_LIGHTGUN 3
-#define DI8DEVTYPESCREENPTR_LIGHTPEN 4
-#define DI8DEVTYPESCREENPTR_TOUCH 5
-
-#define DI8DEVTYPEREMOTE_UNKNOWN 2
-
-#define DI8DEVTYPEDEVICECTRL_UNKNOWN 2
-#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3
-#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4
-
-#define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2
-#define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3
-#define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4
-#define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5
-#define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6
-#define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7
-#define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8
-#define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9
-#define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10
-#define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11
-#define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12
-#define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13
-#endif /* DIRECTINPUT_VERSION <= 0x700 */
-
-#define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType)
-#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-/* This structure is defined for DirectX 3.0 compatibility */
-typedef struct DIDEVCAPS_DX3 {
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwDevType;
- DWORD dwAxes;
- DWORD dwButtons;
- DWORD dwPOVs;
-} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-typedef struct DIDEVCAPS {
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwDevType;
- DWORD dwAxes;
- DWORD dwButtons;
- DWORD dwPOVs;
-#if(DIRECTINPUT_VERSION >= 0x0500)
- DWORD dwFFSamplePeriod;
- DWORD dwFFMinTimeResolution;
- DWORD dwFirmwareRevision;
- DWORD dwHardwareRevision;
- DWORD dwFFDriverVersion;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-} DIDEVCAPS, *LPDIDEVCAPS;
-
-#define DIDC_ATTACHED 0x00000001
-#define DIDC_POLLEDDEVICE 0x00000002
-#define DIDC_EMULATED 0x00000004
-#define DIDC_POLLEDDATAFORMAT 0x00000008
-#if(DIRECTINPUT_VERSION >= 0x0500)
-#define DIDC_FORCEFEEDBACK 0x00000100
-#define DIDC_FFATTACK 0x00000200
-#define DIDC_FFFADE 0x00000400
-#define DIDC_SATURATION 0x00000800
-#define DIDC_POSNEGCOEFFICIENTS 0x00001000
-#define DIDC_POSNEGSATURATION 0x00002000
-#define DIDC_DEADBAND 0x00004000
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-#define DIDC_STARTDELAY 0x00008000
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIDC_ALIAS 0x00010000
-#define DIDC_PHANTOM 0x00020000
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define DIDC_HIDDEN 0x00040000
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#define DIDFT_ALL 0x00000000
-
-#define DIDFT_RELAXIS 0x00000001
-#define DIDFT_ABSAXIS 0x00000002
-#define DIDFT_AXIS 0x00000003
-
-#define DIDFT_PSHBUTTON 0x00000004
-#define DIDFT_TGLBUTTON 0x00000008
-#define DIDFT_BUTTON 0x0000000C
-
-#define DIDFT_POV 0x00000010
-#define DIDFT_COLLECTION 0x00000040
-#define DIDFT_NODATA 0x00000080
-
-#define DIDFT_ANYINSTANCE 0x00FFFF00
-#define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
-#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
-#define DIDFT_GETTYPE(n) LOBYTE(n)
-#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
-#define DIDFT_FFACTUATOR 0x01000000
-#define DIDFT_FFEFFECTTRIGGER 0x02000000
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIDFT_OUTPUT 0x10000000
-#define DIDFT_VENDORDEFINED 0x04000000
-#define DIDFT_ALIAS 0x08000000
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-#ifndef DIDFT_OPTIONAL
-#define DIDFT_OPTIONAL 0x80000000
-#endif
-
-#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
-#define DIDFT_NOCOLLECTION 0x00FFFF00
-
-#ifndef DIJ_RINGZERO
-
-typedef struct _DIOBJECTDATAFORMAT {
- const GUID *pguid;
- DWORD dwOfs;
- DWORD dwType;
- DWORD dwFlags;
-} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
-typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
-
-typedef struct _DIDATAFORMAT {
- DWORD dwSize;
- DWORD dwObjSize;
- DWORD dwFlags;
- DWORD dwDataSize;
- DWORD dwNumObjs;
- LPDIOBJECTDATAFORMAT rgodf;
-} DIDATAFORMAT, *LPDIDATAFORMAT;
-typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
-
-#define DIDF_ABSAXIS 0x00000001
-#define DIDF_RELAXIS 0x00000002
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern const DIDATAFORMAT c_dfDIMouse;
-
-#if(DIRECTINPUT_VERSION >= 0x0700)
-extern const DIDATAFORMAT c_dfDIMouse2;
-#endif /* DIRECTINPUT_VERSION >= 0x0700 */
-
-extern const DIDATAFORMAT c_dfDIKeyboard;
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-extern const DIDATAFORMAT c_dfDIJoystick;
-extern const DIDATAFORMAT c_dfDIJoystick2;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-#ifdef __cplusplus
-};
-#endif
-
-
-#if DIRECTINPUT_VERSION > 0x0700
-
-typedef struct _DIACTIONA {
- UINT_PTR uAppData;
- DWORD dwSemantic;
- OPTIONAL DWORD dwFlags;
- OPTIONAL union {
- LPCSTR lptszActionName;
- UINT uResIdString;
- };
- OPTIONAL GUID guidInstance;
- OPTIONAL DWORD dwObjID;
- OPTIONAL DWORD dwHow;
-} DIACTIONA, *LPDIACTIONA ;
-typedef struct _DIACTIONW {
- UINT_PTR uAppData;
- DWORD dwSemantic;
- OPTIONAL DWORD dwFlags;
- OPTIONAL union {
- LPCWSTR lptszActionName;
- UINT uResIdString;
- };
- OPTIONAL GUID guidInstance;
- OPTIONAL DWORD dwObjID;
- OPTIONAL DWORD dwHow;
-} DIACTIONW, *LPDIACTIONW ;
-#ifdef UNICODE
-typedef DIACTIONW DIACTION;
-typedef LPDIACTIONW LPDIACTION;
-#else
-typedef DIACTIONA DIACTION;
-typedef LPDIACTIONA LPDIACTION;
-#endif // UNICODE
-
-typedef const DIACTIONA *LPCDIACTIONA;
-typedef const DIACTIONW *LPCDIACTIONW;
-#ifdef UNICODE
-typedef DIACTIONW DIACTION;
-typedef LPCDIACTIONW LPCDIACTION;
-#else
-typedef DIACTIONA DIACTION;
-typedef LPCDIACTIONA LPCDIACTION;
-#endif // UNICODE
-typedef const DIACTION *LPCDIACTION;
-
-
-#define DIA_FORCEFEEDBACK 0x00000001
-#define DIA_APPMAPPED 0x00000002
-#define DIA_APPNOMAP 0x00000004
-#define DIA_NORANGE 0x00000008
-#define DIA_APPFIXED 0x00000010
-
-#define DIAH_UNMAPPED 0x00000000
-#define DIAH_USERCONFIG 0x00000001
-#define DIAH_APPREQUESTED 0x00000002
-#define DIAH_HWAPP 0x00000004
-#define DIAH_HWDEFAULT 0x00000008
-#define DIAH_DEFAULT 0x00000020
-#define DIAH_ERROR 0x80000000
-
-typedef struct _DIACTIONFORMATA {
- DWORD dwSize;
- DWORD dwActionSize;
- DWORD dwDataSize;
- DWORD dwNumActions;
- LPDIACTIONA rgoAction;
- GUID guidActionMap;
- DWORD dwGenre;
- DWORD dwBufferSize;
- OPTIONAL LONG lAxisMin;
- OPTIONAL LONG lAxisMax;
- OPTIONAL HINSTANCE hInstString;
- FILETIME ftTimeStamp;
- DWORD dwCRC;
- CHAR tszActionMap[MAX_PATH];
-} DIACTIONFORMATA, *LPDIACTIONFORMATA;
-typedef struct _DIACTIONFORMATW {
- DWORD dwSize;
- DWORD dwActionSize;
- DWORD dwDataSize;
- DWORD dwNumActions;
- LPDIACTIONW rgoAction;
- GUID guidActionMap;
- DWORD dwGenre;
- DWORD dwBufferSize;
- OPTIONAL LONG lAxisMin;
- OPTIONAL LONG lAxisMax;
- OPTIONAL HINSTANCE hInstString;
- FILETIME ftTimeStamp;
- DWORD dwCRC;
- WCHAR tszActionMap[MAX_PATH];
-} DIACTIONFORMATW, *LPDIACTIONFORMATW;
-#ifdef UNICODE
-typedef DIACTIONFORMATW DIACTIONFORMAT;
-typedef LPDIACTIONFORMATW LPDIACTIONFORMAT;
-#else
-typedef DIACTIONFORMATA DIACTIONFORMAT;
-typedef LPDIACTIONFORMATA LPDIACTIONFORMAT;
-#endif // UNICODE
-typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA;
-typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW;
-#ifdef UNICODE
-typedef DIACTIONFORMATW DIACTIONFORMAT;
-typedef LPCDIACTIONFORMATW LPCDIACTIONFORMAT;
-#else
-typedef DIACTIONFORMATA DIACTIONFORMAT;
-typedef LPCDIACTIONFORMATA LPCDIACTIONFORMAT;
-#endif // UNICODE
-typedef const DIACTIONFORMAT *LPCDIACTIONFORMAT;
-
-#define DIAFTS_NEWDEVICELOW 0xFFFFFFFF
-#define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF
-#define DIAFTS_UNUSEDDEVICELOW 0x00000000
-#define DIAFTS_UNUSEDDEVICEHIGH 0x00000000
-
-#define DIDBAM_DEFAULT 0x00000000
-#define DIDBAM_PRESERVE 0x00000001
-#define DIDBAM_INITIALIZE 0x00000002
-#define DIDBAM_HWDEFAULTS 0x00000004
-
-#define DIDSAM_DEFAULT 0x00000000
-#define DIDSAM_NOUSER 0x00000001
-#define DIDSAM_FORCESAVE 0x00000002
-
-#define DICD_DEFAULT 0x00000000
-#define DICD_EDIT 0x00000001
-
-/*
- * The following definition is normally defined in d3dtypes.h
- */
-#ifndef D3DCOLOR_DEFINED
-typedef DWORD D3DCOLOR;
-#define D3DCOLOR_DEFINED
-#endif
-
-typedef struct _DICOLORSET{
- DWORD dwSize;
- D3DCOLOR cTextFore;
- D3DCOLOR cTextHighlight;
- D3DCOLOR cCalloutLine;
- D3DCOLOR cCalloutHighlight;
- D3DCOLOR cBorder;
- D3DCOLOR cControlFill;
- D3DCOLOR cHighlightFill;
- D3DCOLOR cAreaFill;
-} DICOLORSET, *LPDICOLORSET;
-typedef const DICOLORSET *LPCDICOLORSET;
-
-
-typedef struct _DICONFIGUREDEVICESPARAMSA{
- DWORD dwSize;
- DWORD dwcUsers;
- LPSTR lptszUserNames;
- DWORD dwcFormats;
- LPDIACTIONFORMATA lprgFormats;
- HWND hwnd;
- DICOLORSET dics;
- IUnknown FAR * lpUnkDDSTarget;
-} DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA;
-typedef struct _DICONFIGUREDEVICESPARAMSW{
- DWORD dwSize;
- DWORD dwcUsers;
- LPWSTR lptszUserNames;
- DWORD dwcFormats;
- LPDIACTIONFORMATW lprgFormats;
- HWND hwnd;
- DICOLORSET dics;
- IUnknown FAR * lpUnkDDSTarget;
-} DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW;
-#ifdef UNICODE
-typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS;
-typedef LPDICONFIGUREDEVICESPARAMSW LPDICONFIGUREDEVICESPARAMS;
-#else
-typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS;
-typedef LPDICONFIGUREDEVICESPARAMSA LPDICONFIGUREDEVICESPARAMS;
-#endif // UNICODE
-typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA;
-typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW;
-#ifdef UNICODE
-typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS;
-typedef LPCDICONFIGUREDEVICESPARAMSW LPCDICONFIGUREDEVICESPARAMS;
-#else
-typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS;
-typedef LPCDICONFIGUREDEVICESPARAMSA LPCDICONFIGUREDEVICESPARAMS;
-#endif // UNICODE
-typedef const DICONFIGUREDEVICESPARAMS *LPCDICONFIGUREDEVICESPARAMS;
-
-
-#define DIDIFT_CONFIGURATION 0x00000001
-#define DIDIFT_OVERLAY 0x00000002
-
-#define DIDAL_CENTERED 0x00000000
-#define DIDAL_LEFTALIGNED 0x00000001
-#define DIDAL_RIGHTALIGNED 0x00000002
-#define DIDAL_MIDDLE 0x00000000
-#define DIDAL_TOPALIGNED 0x00000004
-#define DIDAL_BOTTOMALIGNED 0x00000008
-
-typedef struct _DIDEVICEIMAGEINFOA {
- CHAR tszImagePath[MAX_PATH];
- DWORD dwFlags;
- // These are valid if DIDIFT_OVERLAY is present in dwFlags.
- DWORD dwViewID;
- RECT rcOverlay;
- DWORD dwObjID;
- DWORD dwcValidPts;
- POINT rgptCalloutLine[5];
- RECT rcCalloutRect;
- DWORD dwTextAlign;
-} DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA;
-typedef struct _DIDEVICEIMAGEINFOW {
- WCHAR tszImagePath[MAX_PATH];
- DWORD dwFlags;
- // These are valid if DIDIFT_OVERLAY is present in dwFlags.
- DWORD dwViewID;
- RECT rcOverlay;
- DWORD dwObjID;
- DWORD dwcValidPts;
- POINT rgptCalloutLine[5];
- RECT rcCalloutRect;
- DWORD dwTextAlign;
-} DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW;
-#ifdef UNICODE
-typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO;
-typedef LPDIDEVICEIMAGEINFOW LPDIDEVICEIMAGEINFO;
-#else
-typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO;
-typedef LPDIDEVICEIMAGEINFOA LPDIDEVICEIMAGEINFO;
-#endif // UNICODE
-typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA;
-typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW;
-#ifdef UNICODE
-typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO;
-typedef LPCDIDEVICEIMAGEINFOW LPCDIDEVICEIMAGEINFO;
-#else
-typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO;
-typedef LPCDIDEVICEIMAGEINFOA LPCDIDEVICEIMAGEINFO;
-#endif // UNICODE
-typedef const DIDEVICEIMAGEINFO *LPCDIDEVICEIMAGEINFO;
-
-typedef struct _DIDEVICEIMAGEINFOHEADERA {
- DWORD dwSize;
- DWORD dwSizeImageInfo;
- DWORD dwcViews;
- DWORD dwcButtons;
- DWORD dwcAxes;
- DWORD dwcPOVs;
- DWORD dwBufferSize;
- DWORD dwBufferUsed;
- LPDIDEVICEIMAGEINFOA lprgImageInfoArray;
-} DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA;
-typedef struct _DIDEVICEIMAGEINFOHEADERW {
- DWORD dwSize;
- DWORD dwSizeImageInfo;
- DWORD dwcViews;
- DWORD dwcButtons;
- DWORD dwcAxes;
- DWORD dwcPOVs;
- DWORD dwBufferSize;
- DWORD dwBufferUsed;
- LPDIDEVICEIMAGEINFOW lprgImageInfoArray;
-} DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW;
-#ifdef UNICODE
-typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER;
-typedef LPDIDEVICEIMAGEINFOHEADERW LPDIDEVICEIMAGEINFOHEADER;
-#else
-typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER;
-typedef LPDIDEVICEIMAGEINFOHEADERA LPDIDEVICEIMAGEINFOHEADER;
-#endif // UNICODE
-typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA;
-typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW;
-#ifdef UNICODE
-typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER;
-typedef LPCDIDEVICEIMAGEINFOHEADERW LPCDIDEVICEIMAGEINFOHEADER;
-#else
-typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER;
-typedef LPCDIDEVICEIMAGEINFOHEADERA LPCDIDEVICEIMAGEINFOHEADER;
-#endif // UNICODE
-typedef const DIDEVICEIMAGEINFOHEADER *LPCDIDEVICEIMAGEINFOHEADER;
-
-#endif /* DIRECTINPUT_VERSION > 0x0700 */
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-/* These structures are defined for DirectX 3.0 compatibility */
-
-typedef struct DIDEVICEOBJECTINSTANCE_DX3A {
- DWORD dwSize;
- GUID guidType;
- DWORD dwOfs;
- DWORD dwType;
- DWORD dwFlags;
- CHAR tszName[MAX_PATH];
-} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A;
-typedef struct DIDEVICEOBJECTINSTANCE_DX3W {
- DWORD dwSize;
- GUID guidType;
- DWORD dwOfs;
- DWORD dwType;
- DWORD dwFlags;
- WCHAR tszName[MAX_PATH];
-} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W;
-#ifdef UNICODE
-typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3;
-typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3;
-#else
-typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3;
-typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3;
-#endif // UNICODE
-typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
-typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
-typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-typedef struct DIDEVICEOBJECTINSTANCEA {
- DWORD dwSize;
- GUID guidType;
- DWORD dwOfs;
- DWORD dwType;
- DWORD dwFlags;
- CHAR tszName[MAX_PATH];
-#if(DIRECTINPUT_VERSION >= 0x0500)
- DWORD dwFFMaxForce;
- DWORD dwFFForceResolution;
- WORD wCollectionNumber;
- WORD wDesignatorIndex;
- WORD wUsagePage;
- WORD wUsage;
- DWORD dwDimension;
- WORD wExponent;
- WORD wReportId;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA;
-typedef struct DIDEVICEOBJECTINSTANCEW {
- DWORD dwSize;
- GUID guidType;
- DWORD dwOfs;
- DWORD dwType;
- DWORD dwFlags;
- WCHAR tszName[MAX_PATH];
-#if(DIRECTINPUT_VERSION >= 0x0500)
- DWORD dwFFMaxForce;
- DWORD dwFFForceResolution;
- WORD wCollectionNumber;
- WORD wDesignatorIndex;
- WORD wUsagePage;
- WORD wUsage;
- DWORD dwDimension;
- WORD wExponent;
- WORD wReportId;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW;
-#ifdef UNICODE
-typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE;
-typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE;
-#else
-typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE;
-typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE;
-#endif // UNICODE
-typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
-typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
-typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE;
-
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID);
-#ifdef UNICODE
-#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKW
-#else
-#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKA
-#endif // !UNICODE
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-#define DIDOI_FFACTUATOR 0x00000001
-#define DIDOI_FFEFFECTTRIGGER 0x00000002
-#define DIDOI_POLLED 0x00008000
-#define DIDOI_ASPECTPOSITION 0x00000100
-#define DIDOI_ASPECTVELOCITY 0x00000200
-#define DIDOI_ASPECTACCEL 0x00000300
-#define DIDOI_ASPECTFORCE 0x00000400
-#define DIDOI_ASPECTMASK 0x00000F00
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIDOI_GUIDISUSAGE 0x00010000
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-
-typedef struct DIPROPHEADER {
- DWORD dwSize;
- DWORD dwHeaderSize;
- DWORD dwObj;
- DWORD dwHow;
-} DIPROPHEADER, *LPDIPROPHEADER;
-typedef const DIPROPHEADER *LPCDIPROPHEADER;
-
-#define DIPH_DEVICE 0
-#define DIPH_BYOFFSET 1
-#define DIPH_BYID 2
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIPH_BYUSAGE 3
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIMAKEUSAGEDWORD(UsagePage, Usage) \
- (DWORD)MAKELONG(Usage, UsagePage)
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-
-typedef struct DIPROPDWORD {
- DIPROPHEADER diph;
- DWORD dwData;
-} DIPROPDWORD, *LPDIPROPDWORD;
-typedef const DIPROPDWORD *LPCDIPROPDWORD;
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-typedef struct DIPROPPOINTER {
- DIPROPHEADER diph;
- UINT_PTR uData;
-} DIPROPPOINTER, *LPDIPROPPOINTER;
-typedef const DIPROPPOINTER *LPCDIPROPPOINTER;
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-typedef struct DIPROPRANGE {
- DIPROPHEADER diph;
- LONG lMin;
- LONG lMax;
-} DIPROPRANGE, *LPDIPROPRANGE;
-typedef const DIPROPRANGE *LPCDIPROPRANGE;
-
-#define DIPROPRANGE_NOMIN ((LONG)0x80000000)
-#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
-
-#if(DIRECTINPUT_VERSION >= 0x050a)
-typedef struct DIPROPCAL {
- DIPROPHEADER diph;
- LONG lMin;
- LONG lCenter;
- LONG lMax;
-} DIPROPCAL, *LPDIPROPCAL;
-typedef const DIPROPCAL *LPCDIPROPCAL;
-
-typedef struct DIPROPCALPOV {
- DIPROPHEADER diph;
- LONG lMin[5];
- LONG lMax[5];
-} DIPROPCALPOV, *LPDIPROPCALPOV;
-typedef const DIPROPCALPOV *LPCDIPROPCALPOV;
-
-typedef struct DIPROPGUIDANDPATH {
- DIPROPHEADER diph;
- GUID guidClass;
- WCHAR wszPath[MAX_PATH];
-} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH;
-typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
-
-typedef struct DIPROPSTRING {
- DIPROPHEADER diph;
- WCHAR wsz[MAX_PATH];
-} DIPROPSTRING, *LPDIPROPSTRING;
-typedef const DIPROPSTRING *LPCDIPROPSTRING;
-
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define MAXCPOINTSNUM 8
-
-typedef struct _CPOINT
-{
- LONG lP; // raw value
- DWORD dwLog; // logical_value / max_logical_value * 10000
-} CPOINT, *PCPOINT;
-
-typedef struct DIPROPCPOINTS {
- DIPROPHEADER diph;
- DWORD dwCPointsNum;
- CPOINT cp[MAXCPOINTSNUM];
-} DIPROPCPOINTS, *LPDIPROPCPOINTS;
-typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS;
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-
-#ifdef __cplusplus
-#define MAKEDIPROP(prop) (*(const GUID *)(prop))
-#else
-#define MAKEDIPROP(prop) ((REFGUID)(prop))
-#endif
-
-#define DIPROP_BUFFERSIZE MAKEDIPROP(1)
-
-#define DIPROP_AXISMODE MAKEDIPROP(2)
-
-#define DIPROPAXISMODE_ABS 0
-#define DIPROPAXISMODE_REL 1
-
-#define DIPROP_GRANULARITY MAKEDIPROP(3)
-
-#define DIPROP_RANGE MAKEDIPROP(4)
-
-#define DIPROP_DEADZONE MAKEDIPROP(5)
-
-#define DIPROP_SATURATION MAKEDIPROP(6)
-
-#define DIPROP_FFGAIN MAKEDIPROP(7)
-
-#define DIPROP_FFLOAD MAKEDIPROP(8)
-
-#define DIPROP_AUTOCENTER MAKEDIPROP(9)
-
-#define DIPROPAUTOCENTER_OFF 0
-#define DIPROPAUTOCENTER_ON 1
-
-#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
-
-#define DIPROPCALIBRATIONMODE_COOKED 0
-#define DIPROPCALIBRATIONMODE_RAW 1
-
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIPROP_CALIBRATION MAKEDIPROP(11)
-
-#define DIPROP_GUIDANDPATH MAKEDIPROP(12)
-
-#define DIPROP_INSTANCENAME MAKEDIPROP(13)
-
-#define DIPROP_PRODUCTNAME MAKEDIPROP(14)
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-
-#if(DIRECTINPUT_VERSION >= 0x05b2)
-#define DIPROP_JOYSTICKID MAKEDIPROP(15)
-
-#define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16)
-
-#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
-
-#if(DIRECTINPUT_VERSION >= 0x0700)
-#define DIPROP_PHYSICALRANGE MAKEDIPROP(18)
-
-#define DIPROP_LOGICALRANGE MAKEDIPROP(19)
-#endif /* DIRECTINPUT_VERSION >= 0x0700 */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define DIPROP_KEYNAME MAKEDIPROP(20)
-
-#define DIPROP_CPOINTS MAKEDIPROP(21)
-
-#define DIPROP_APPDATA MAKEDIPROP(22)
-
-#define DIPROP_SCANCODE MAKEDIPROP(23)
-
-#define DIPROP_VIDPID MAKEDIPROP(24)
-
-#define DIPROP_USERNAME MAKEDIPROP(25)
-
-#define DIPROP_TYPENAME MAKEDIPROP(26)
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-
-typedef struct DIDEVICEOBJECTDATA_DX3 {
- DWORD dwOfs;
- DWORD dwData;
- DWORD dwTimeStamp;
- DWORD dwSequence;
-} DIDEVICEOBJECTDATA_DX3, *LPDIDEVICEOBJECTDATA_DX3;
-typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX;
-
-typedef struct DIDEVICEOBJECTDATA {
- DWORD dwOfs;
- DWORD dwData;
- DWORD dwTimeStamp;
- DWORD dwSequence;
-#if(DIRECTINPUT_VERSION >= 0x0800)
- UINT_PTR uAppData;
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;
-typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
-
-#define DIGDD_PEEK 0x00000001
-
-#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \
- ((int)((dwSequence1) - (dwSequence2)) cmp 0)
-#define DISCL_EXCLUSIVE 0x00000001
-#define DISCL_NONEXCLUSIVE 0x00000002
-#define DISCL_FOREGROUND 0x00000004
-#define DISCL_BACKGROUND 0x00000008
-#define DISCL_NOWINKEY 0x00000010
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-/* These structures are defined for DirectX 3.0 compatibility */
-
-typedef struct DIDEVICEINSTANCE_DX3A {
- DWORD dwSize;
- GUID guidInstance;
- GUID guidProduct;
- DWORD dwDevType;
- CHAR tszInstanceName[MAX_PATH];
- CHAR tszProductName[MAX_PATH];
-} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A;
-typedef struct DIDEVICEINSTANCE_DX3W {
- DWORD dwSize;
- GUID guidInstance;
- GUID guidProduct;
- DWORD dwDevType;
- WCHAR tszInstanceName[MAX_PATH];
- WCHAR tszProductName[MAX_PATH];
-} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W;
-#ifdef UNICODE
-typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3;
-typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3;
-#else
-typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3;
-typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3;
-#endif // UNICODE
-typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
-typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
-typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-typedef struct DIDEVICEINSTANCEA {
- DWORD dwSize;
- GUID guidInstance;
- GUID guidProduct;
- DWORD dwDevType;
- CHAR tszInstanceName[MAX_PATH];
- CHAR tszProductName[MAX_PATH];
-#if(DIRECTINPUT_VERSION >= 0x0500)
- GUID guidFFDriver;
- WORD wUsagePage;
- WORD wUsage;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA;
-typedef struct DIDEVICEINSTANCEW {
- DWORD dwSize;
- GUID guidInstance;
- GUID guidProduct;
- DWORD dwDevType;
- WCHAR tszInstanceName[MAX_PATH];
- WCHAR tszProductName[MAX_PATH];
-#if(DIRECTINPUT_VERSION >= 0x0500)
- GUID guidFFDriver;
- WORD wUsagePage;
- WORD wUsage;
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW;
-#ifdef UNICODE
-typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE;
-typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE;
-#else
-typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE;
-typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE;
-#endif // UNICODE
-
-typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
-typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
-#ifdef UNICODE
-typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE;
-typedef LPCDIDEVICEINSTANCEW LPCDIDEVICEINSTANCE;
-#else
-typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE;
-typedef LPCDIDEVICEINSTANCEA LPCDIDEVICEINSTANCE;
-#endif // UNICODE
-typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDeviceW
-
-DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDeviceW methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
-};
-
-typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDeviceA
-
-DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDeviceA methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
-};
-
-typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA;
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice IID_IDirectInputDeviceW
-#define IDirectInputDevice IDirectInputDeviceW
-#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl
-#else
-#define IID_IDirectInputDevice IID_IDirectInputDeviceA
-#define IDirectInputDevice IDirectInputDeviceA
-#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl
-#endif
-typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
-#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
-#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
-#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
-#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
-#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
-#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
-#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
-#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
-#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
-#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
-#else
-#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputDevice_AddRef(p) (p)->AddRef()
-#define IDirectInputDevice_Release(p) (p)->Release()
-#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a)
-#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
-#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b)
-#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b)
-#define IDirectInputDevice_Acquire(p) (p)->Acquire()
-#define IDirectInputDevice_Unacquire(p) (p)->Unacquire()
-#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
-#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
-#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a)
-#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a)
-#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
-#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
-#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-
-#if(DIRECTINPUT_VERSION >= 0x0500)
-
-#define DISFFC_RESET 0x00000001
-#define DISFFC_STOPALL 0x00000002
-#define DISFFC_PAUSE 0x00000004
-#define DISFFC_CONTINUE 0x00000008
-#define DISFFC_SETACTUATORSON 0x00000010
-#define DISFFC_SETACTUATORSOFF 0x00000020
-
-#define DIGFFS_EMPTY 0x00000001
-#define DIGFFS_STOPPED 0x00000002
-#define DIGFFS_PAUSED 0x00000004
-#define DIGFFS_ACTUATORSON 0x00000010
-#define DIGFFS_ACTUATORSOFF 0x00000020
-#define DIGFFS_POWERON 0x00000040
-#define DIGFFS_POWEROFF 0x00000080
-#define DIGFFS_SAFETYSWITCHON 0x00000100
-#define DIGFFS_SAFETYSWITCHOFF 0x00000200
-#define DIGFFS_USERFFSWITCHON 0x00000400
-#define DIGFFS_USERFFSWITCHOFF 0x00000800
-#define DIGFFS_DEVICELOST 0x80000000
-
-#ifndef DIJ_RINGZERO
-
-typedef struct DIEFFECTINFOA {
- DWORD dwSize;
- GUID guid;
- DWORD dwEffType;
- DWORD dwStaticParams;
- DWORD dwDynamicParams;
- CHAR tszName[MAX_PATH];
-} DIEFFECTINFOA, *LPDIEFFECTINFOA;
-typedef struct DIEFFECTINFOW {
- DWORD dwSize;
- GUID guid;
- DWORD dwEffType;
- DWORD dwStaticParams;
- DWORD dwDynamicParams;
- WCHAR tszName[MAX_PATH];
-} DIEFFECTINFOW, *LPDIEFFECTINFOW;
-#ifdef UNICODE
-typedef DIEFFECTINFOW DIEFFECTINFO;
-typedef LPDIEFFECTINFOW LPDIEFFECTINFO;
-#else
-typedef DIEFFECTINFOA DIEFFECTINFO;
-typedef LPDIEFFECTINFOA LPDIEFFECTINFO;
-#endif // UNICODE
-typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
-typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
-typedef const DIEFFECTINFO *LPCDIEFFECTINFO;
-
-#define DISDD_CONTINUE 0x00000001
-
-typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
-typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
-#ifdef UNICODE
-#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKW
-#else
-#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKA
-#endif // !UNICODE
-typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice2W
-
-DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDeviceW methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
-
- /*** IDirectInputDevice2W methods ***/
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
-};
-
-typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice2A
-
-DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDeviceA methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
-
- /*** IDirectInputDevice2A methods ***/
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
-};
-
-typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A;
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W
-#define IDirectInputDevice2 IDirectInputDevice2W
-#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl
-#else
-#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A
-#define IDirectInputDevice2 IDirectInputDevice2A
-#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl
-#endif
-typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
-#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
-#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
-#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
-#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
-#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
-#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
-#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
-#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
-#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
-#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
-#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
-#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
-#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
-#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
-#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
-#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
-#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a)
-#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p)
-#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
-#else
-#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputDevice2_AddRef(p) (p)->AddRef()
-#define IDirectInputDevice2_Release(p) (p)->Release()
-#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a)
-#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
-#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b)
-#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b)
-#define IDirectInputDevice2_Acquire(p) (p)->Acquire()
-#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire()
-#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
-#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
-#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a)
-#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a)
-#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
-#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
-#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
-#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
-#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
-#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
-#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
-#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
-#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
-#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a)
-#define IDirectInputDevice2_Poll(p) (p)->Poll()
-#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-
-#if(DIRECTINPUT_VERSION >= 0x0700)
-#define DIFEF_DEFAULT 0x00000000
-#define DIFEF_INCLUDENONSTANDARD 0x00000001
-#define DIFEF_MODIFYIFNEEDED 0x00000010
-
-#ifndef DIJ_RINGZERO
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice7W
-
-DECLARE_INTERFACE_(IDirectInputDevice7W, IDirectInputDevice2W)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDevice2W methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
-
- /*** IDirectInputDevice7W methods ***/
- STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
-};
-
-typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice7A
-
-DECLARE_INTERFACE_(IDirectInputDevice7A, IDirectInputDevice2A)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDevice2A methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
-
- /*** IDirectInputDevice7A methods ***/
- STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
-};
-
-typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A;
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice7 IID_IDirectInputDevice7W
-#define IDirectInputDevice7 IDirectInputDevice7W
-#define IDirectInputDevice7Vtbl IDirectInputDevice7WVtbl
-#else
-#define IID_IDirectInputDevice7 IID_IDirectInputDevice7A
-#define IDirectInputDevice7 IDirectInputDevice7A
-#define IDirectInputDevice7Vtbl IDirectInputDevice7AVtbl
-#endif
-typedef struct IDirectInputDevice7 *LPDIRECTINPUTDEVICE7;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
-#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
-#define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
-#define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
-#define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
-#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
-#define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
-#define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
-#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
-#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
-#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
-#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
-#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
-#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
-#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
-#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
-#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
-#define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a)
-#define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p)
-#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
-#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
-#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
-#else
-#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputDevice7_AddRef(p) (p)->AddRef()
-#define IDirectInputDevice7_Release(p) (p)->Release()
-#define IDirectInputDevice7_GetCapabilities(p,a) (p)->GetCapabilities(a)
-#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
-#define IDirectInputDevice7_GetProperty(p,a,b) (p)->GetProperty(a,b)
-#define IDirectInputDevice7_SetProperty(p,a,b) (p)->SetProperty(a,b)
-#define IDirectInputDevice7_Acquire(p) (p)->Acquire()
-#define IDirectInputDevice7_Unacquire(p) (p)->Unacquire()
-#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
-#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
-#define IDirectInputDevice7_SetDataFormat(p,a) (p)->SetDataFormat(a)
-#define IDirectInputDevice7_SetEventNotification(p,a) (p)->SetEventNotification(a)
-#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
-#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
-#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
-#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
-#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
-#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
-#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
-#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
-#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
-#define IDirectInputDevice7_Escape(p,a) (p)->Escape(a)
-#define IDirectInputDevice7_Poll(p) (p)->Poll()
-#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
-#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d)
-#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#endif /* DIRECTINPUT_VERSION >= 0x0700 */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-
-#ifndef DIJ_RINGZERO
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice8W
-
-DECLARE_INTERFACE_(IDirectInputDevice8W, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDevice8W methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
- STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
- STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
- STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW) PURE;
-};
-
-typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputDevice8A
-
-DECLARE_INTERFACE_(IDirectInputDevice8A, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputDevice8A methods ***/
- STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE;
- STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE;
- STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE;
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
- STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE;
- STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE;
- STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE;
- STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE;
- STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE;
- STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
- STDMETHOD(Poll)(THIS) PURE;
- STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE;
- STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE;
- STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE;
- STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE;
- STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE;
- STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA) PURE;
-};
-
-typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A;
-
-#ifdef UNICODE
-#define IID_IDirectInputDevice8 IID_IDirectInputDevice8W
-#define IDirectInputDevice8 IDirectInputDevice8W
-#define IDirectInputDevice8Vtbl IDirectInputDevice8WVtbl
-#else
-#define IID_IDirectInputDevice8 IID_IDirectInputDevice8A
-#define IDirectInputDevice8 IDirectInputDevice8A
-#define IDirectInputDevice8Vtbl IDirectInputDevice8AVtbl
-#endif
-typedef struct IDirectInputDevice8 *LPDIRECTINPUTDEVICE8;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputDevice8_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputDevice8_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputDevice8_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
-#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
-#define IDirectInputDevice8_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
-#define IDirectInputDevice8_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
-#define IDirectInputDevice8_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputDevice8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
-#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
-#define IDirectInputDevice8_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
-#define IDirectInputDevice8_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
-#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
-#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
-#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
-#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
-#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
-#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
-#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
-#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
-#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
-#define IDirectInputDevice8_Escape(p,a) (p)->lpVtbl->Escape(p,a)
-#define IDirectInputDevice8_Poll(p) (p)->lpVtbl->Poll(p)
-#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
-#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
-#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
-#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c)
-#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->lpVtbl->SetActionMap(p,a,b,c)
-#define IDirectInputDevice8_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a)
-#else
-#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputDevice8_AddRef(p) (p)->AddRef()
-#define IDirectInputDevice8_Release(p) (p)->Release()
-#define IDirectInputDevice8_GetCapabilities(p,a) (p)->GetCapabilities(a)
-#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c)
-#define IDirectInputDevice8_GetProperty(p,a,b) (p)->GetProperty(a,b)
-#define IDirectInputDevice8_SetProperty(p,a,b) (p)->SetProperty(a,b)
-#define IDirectInputDevice8_Acquire(p) (p)->Acquire()
-#define IDirectInputDevice8_Unacquire(p) (p)->Unacquire()
-#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
-#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d)
-#define IDirectInputDevice8_SetDataFormat(p,a) (p)->SetDataFormat(a)
-#define IDirectInputDevice8_SetEventNotification(p,a) (p)->SetEventNotification(a)
-#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c)
-#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a)
-#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
-#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d)
-#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c)
-#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b)
-#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a)
-#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a)
-#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
-#define IDirectInputDevice8_Escape(p,a) (p)->Escape(a)
-#define IDirectInputDevice8_Poll(p) (p)->Poll()
-#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d)
-#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d)
-#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d)
-#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->BuildActionMap(a,b,c)
-#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->SetActionMap(a,b,c)
-#define IDirectInputDevice8_GetImageInfo(p,a) (p)->GetImageInfo(a)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-/****************************************************************************
- *
- * Mouse
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-typedef struct _DIMOUSESTATE {
- LONG lX;
- LONG lY;
- LONG lZ;
- BYTE rgbButtons[4];
-} DIMOUSESTATE, *LPDIMOUSESTATE;
-
-#if DIRECTINPUT_VERSION >= 0x0700
-typedef struct _DIMOUSESTATE2 {
- LONG lX;
- LONG lY;
- LONG lZ;
- BYTE rgbButtons[8];
-} DIMOUSESTATE2, *LPDIMOUSESTATE2;
-#endif
-
-
-#define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
-#define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
-#define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
-#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
-#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
-#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
-#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
-#if (DIRECTINPUT_VERSION >= 0x0700)
-#define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4)
-#define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5)
-#define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6)
-#define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7)
-#endif
-#endif /* DIJ_RINGZERO */
-
-/****************************************************************************
- *
- * Keyboard
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-/****************************************************************************
- *
- * DirectInput keyboard scan codes
- *
- ****************************************************************************/
-#define DIK_ESCAPE 0x01
-#define DIK_1 0x02
-#define DIK_2 0x03
-#define DIK_3 0x04
-#define DIK_4 0x05
-#define DIK_5 0x06
-#define DIK_6 0x07
-#define DIK_7 0x08
-#define DIK_8 0x09
-#define DIK_9 0x0A
-#define DIK_0 0x0B
-#define DIK_MINUS 0x0C /* - on main keyboard */
-#define DIK_EQUALS 0x0D
-#define DIK_BACK 0x0E /* backspace */
-#define DIK_TAB 0x0F
-#define DIK_Q 0x10
-#define DIK_W 0x11
-#define DIK_E 0x12
-#define DIK_R 0x13
-#define DIK_T 0x14
-#define DIK_Y 0x15
-#define DIK_U 0x16
-#define DIK_I 0x17
-#define DIK_O 0x18
-#define DIK_P 0x19
-#define DIK_LBRACKET 0x1A
-#define DIK_RBRACKET 0x1B
-#define DIK_RETURN 0x1C /* Enter on main keyboard */
-#define DIK_LCONTROL 0x1D
-#define DIK_A 0x1E
-#define DIK_S 0x1F
-#define DIK_D 0x20
-#define DIK_F 0x21
-#define DIK_G 0x22
-#define DIK_H 0x23
-#define DIK_J 0x24
-#define DIK_K 0x25
-#define DIK_L 0x26
-#define DIK_SEMICOLON 0x27
-#define DIK_APOSTROPHE 0x28
-#define DIK_GRAVE 0x29 /* accent grave */
-#define DIK_LSHIFT 0x2A
-#define DIK_BACKSLASH 0x2B
-#define DIK_Z 0x2C
-#define DIK_X 0x2D
-#define DIK_C 0x2E
-#define DIK_V 0x2F
-#define DIK_B 0x30
-#define DIK_N 0x31
-#define DIK_M 0x32
-#define DIK_COMMA 0x33
-#define DIK_PERIOD 0x34 /* . on main keyboard */
-#define DIK_SLASH 0x35 /* / on main keyboard */
-#define DIK_RSHIFT 0x36
-#define DIK_MULTIPLY 0x37 /* * on numeric keypad */
-#define DIK_LMENU 0x38 /* left Alt */
-#define DIK_SPACE 0x39
-#define DIK_CAPITAL 0x3A
-#define DIK_F1 0x3B
-#define DIK_F2 0x3C
-#define DIK_F3 0x3D
-#define DIK_F4 0x3E
-#define DIK_F5 0x3F
-#define DIK_F6 0x40
-#define DIK_F7 0x41
-#define DIK_F8 0x42
-#define DIK_F9 0x43
-#define DIK_F10 0x44
-#define DIK_NUMLOCK 0x45
-#define DIK_SCROLL 0x46 /* Scroll Lock */
-#define DIK_NUMPAD7 0x47
-#define DIK_NUMPAD8 0x48
-#define DIK_NUMPAD9 0x49
-#define DIK_SUBTRACT 0x4A /* - on numeric keypad */
-#define DIK_NUMPAD4 0x4B
-#define DIK_NUMPAD5 0x4C
-#define DIK_NUMPAD6 0x4D
-#define DIK_ADD 0x4E /* + on numeric keypad */
-#define DIK_NUMPAD1 0x4F
-#define DIK_NUMPAD2 0x50
-#define DIK_NUMPAD3 0x51
-#define DIK_NUMPAD0 0x52
-#define DIK_DECIMAL 0x53 /* . on numeric keypad */
-#define DIK_OEM_102 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */
-#define DIK_F11 0x57
-#define DIK_F12 0x58
-#define DIK_F13 0x64 /* (NEC PC98) */
-#define DIK_F14 0x65 /* (NEC PC98) */
-#define DIK_F15 0x66 /* (NEC PC98) */
-#define DIK_KANA 0x70 /* (Japanese keyboard) */
-#define DIK_ABNT_C1 0x73 /* /? on Brazilian keyboard */
-#define DIK_CONVERT 0x79 /* (Japanese keyboard) */
-#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
-#define DIK_YEN 0x7D /* (Japanese keyboard) */
-#define DIK_ABNT_C2 0x7E /* Numpad . on Brazilian keyboard */
-#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
-#define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
-#define DIK_AT 0x91 /* (NEC PC98) */
-#define DIK_COLON 0x92 /* (NEC PC98) */
-#define DIK_UNDERLINE 0x93 /* (NEC PC98) */
-#define DIK_KANJI 0x94 /* (Japanese keyboard) */
-#define DIK_STOP 0x95 /* (NEC PC98) */
-#define DIK_AX 0x96 /* (Japan AX) */
-#define DIK_UNLABELED 0x97 /* (J3100) */
-#define DIK_NEXTTRACK 0x99 /* Next Track */
-#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
-#define DIK_RCONTROL 0x9D
-#define DIK_MUTE 0xA0 /* Mute */
-#define DIK_CALCULATOR 0xA1 /* Calculator */
-#define DIK_PLAYPAUSE 0xA2 /* Play / Pause */
-#define DIK_MEDIASTOP 0xA4 /* Media Stop */
-#define DIK_VOLUMEDOWN 0xAE /* Volume - */
-#define DIK_VOLUMEUP 0xB0 /* Volume + */
-#define DIK_WEBHOME 0xB2 /* Web home */
-#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
-#define DIK_DIVIDE 0xB5 /* / on numeric keypad */
-#define DIK_SYSRQ 0xB7
-#define DIK_RMENU 0xB8 /* right Alt */
-#define DIK_PAUSE 0xC5 /* Pause */
-#define DIK_HOME 0xC7 /* Home on arrow keypad */
-#define DIK_UP 0xC8 /* UpArrow on arrow keypad */
-#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
-#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
-#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
-#define DIK_END 0xCF /* End on arrow keypad */
-#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
-#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
-#define DIK_INSERT 0xD2 /* Insert on arrow keypad */
-#define DIK_DELETE 0xD3 /* Delete on arrow keypad */
-#define DIK_LWIN 0xDB /* Left Windows key */
-#define DIK_RWIN 0xDC /* Right Windows key */
-#define DIK_APPS 0xDD /* AppMenu key */
-#define DIK_POWER 0xDE /* System Power */
-#define DIK_SLEEP 0xDF /* System Sleep */
-#define DIK_WAKE 0xE3 /* System Wake */
-#define DIK_WEBSEARCH 0xE5 /* Web Search */
-#define DIK_WEBFAVORITES 0xE6 /* Web Favorites */
-#define DIK_WEBREFRESH 0xE7 /* Web Refresh */
-#define DIK_WEBSTOP 0xE8 /* Web Stop */
-#define DIK_WEBFORWARD 0xE9 /* Web Forward */
-#define DIK_WEBBACK 0xEA /* Web Back */
-#define DIK_MYCOMPUTER 0xEB /* My Computer */
-#define DIK_MAIL 0xEC /* Mail */
-#define DIK_MEDIASELECT 0xED /* Media Select */
-
-/*
- * Alternate names for keys, to facilitate transition from DOS.
- */
-#define DIK_BACKSPACE DIK_BACK /* backspace */
-#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
-#define DIK_LALT DIK_LMENU /* left Alt */
-#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
-#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
-#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
-#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
-#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
-#define DIK_RALT DIK_RMENU /* right Alt */
-#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
-#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
-#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
-#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
-#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
-#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
-
-/*
- * Alternate names for keys originally not used on US keyboards.
- */
-#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */
-
-#endif /* DIJ_RINGZERO */
-
-/****************************************************************************
- *
- * Joystick
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-typedef struct DIJOYSTATE {
- LONG lX; /* x-axis position */
- LONG lY; /* y-axis position */
- LONG lZ; /* z-axis position */
- LONG lRx; /* x-axis rotation */
- LONG lRy; /* y-axis rotation */
- LONG lRz; /* z-axis rotation */
- LONG rglSlider[2]; /* extra axes positions */
- DWORD rgdwPOV[4]; /* POV directions */
- BYTE rgbButtons[32]; /* 32 buttons */
-} DIJOYSTATE, *LPDIJOYSTATE;
-
-typedef struct DIJOYSTATE2 {
- LONG lX; /* x-axis position */
- LONG lY; /* y-axis position */
- LONG lZ; /* z-axis position */
- LONG lRx; /* x-axis rotation */
- LONG lRy; /* y-axis rotation */
- LONG lRz; /* z-axis rotation */
- LONG rglSlider[2]; /* extra axes positions */
- DWORD rgdwPOV[4]; /* POV directions */
- BYTE rgbButtons[128]; /* 128 buttons */
- LONG lVX; /* x-axis velocity */
- LONG lVY; /* y-axis velocity */
- LONG lVZ; /* z-axis velocity */
- LONG lVRx; /* x-axis angular velocity */
- LONG lVRy; /* y-axis angular velocity */
- LONG lVRz; /* z-axis angular velocity */
- LONG rglVSlider[2]; /* extra axes velocities */
- LONG lAX; /* x-axis acceleration */
- LONG lAY; /* y-axis acceleration */
- LONG lAZ; /* z-axis acceleration */
- LONG lARx; /* x-axis angular acceleration */
- LONG lARy; /* y-axis angular acceleration */
- LONG lARz; /* z-axis angular acceleration */
- LONG rglASlider[2]; /* extra axes accelerations */
- LONG lFX; /* x-axis force */
- LONG lFY; /* y-axis force */
- LONG lFZ; /* z-axis force */
- LONG lFRx; /* x-axis torque */
- LONG lFRy; /* y-axis torque */
- LONG lFRz; /* z-axis torque */
- LONG rglFSlider[2]; /* extra axes forces */
-} DIJOYSTATE2, *LPDIJOYSTATE2;
-
-#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
-#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
-#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
-#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
-#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
-#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
-#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
- (n) * sizeof(LONG))
-#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
- (n) * sizeof(DWORD))
-#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
-#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
-#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
-#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
-#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
-#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
-#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
-#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
-#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
-#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
-#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
-#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
-#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
-#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
-#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
-#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
-#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
-#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
-#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
-#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
-#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
-#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
-#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
-#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
-#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
-#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
-#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
-#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
-#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
-#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
-#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
-#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
-#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
-
-
-#endif /* DIJ_RINGZERO */
-
-/****************************************************************************
- *
- * IDirectInput
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-#define DIENUM_STOP 0
-#define DIENUM_CONTINUE 1
-
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID);
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID);
-#ifdef UNICODE
-#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKW
-#else
-#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKA
-#endif // !UNICODE
-typedef BOOL (FAR PASCAL * LPDICONFIGUREDEVICESCALLBACK)(IUnknown FAR *, LPVOID);
-
-#define DIEDFL_ALLDEVICES 0x00000000
-#define DIEDFL_ATTACHEDONLY 0x00000001
-#if(DIRECTINPUT_VERSION >= 0x0500)
-#define DIEDFL_FORCEFEEDBACK 0x00000100
-#endif /* DIRECTINPUT_VERSION >= 0x0500 */
-#if(DIRECTINPUT_VERSION >= 0x050a)
-#define DIEDFL_INCLUDEALIASES 0x00010000
-#define DIEDFL_INCLUDEPHANTOMS 0x00020000
-#endif /* DIRECTINPUT_VERSION >= 0x050a */
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define DIEDFL_INCLUDEHIDDEN 0x00040000
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA, LPDIRECTINPUTDEVICE8A, DWORD, DWORD, LPVOID);
-typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW, LPDIRECTINPUTDEVICE8W, DWORD, DWORD, LPVOID);
-#ifdef UNICODE
-#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBW
-#else
-#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBA
-#endif // !UNICODE
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define DIEDBS_MAPPEDPRI1 0x00000001
-#define DIEDBS_MAPPEDPRI2 0x00000002
-#define DIEDBS_RECENTDEVICE 0x00000010
-#define DIEDBS_NEWDEVICE 0x00000020
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#define DIEDBSFL_ATTACHEDONLY 0x00000000
-#define DIEDBSFL_THISUSER 0x00000010
-#define DIEDBSFL_FORCEFEEDBACK DIEDFL_FORCEFEEDBACK
-#define DIEDBSFL_AVAILABLEDEVICES 0x00001000
-#define DIEDBSFL_MULTIMICEKEYBOARDS 0x00002000
-#define DIEDBSFL_NONGAMINGDEVICES 0x00004000
-#define DIEDBSFL_VALID 0x00007110
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#undef INTERFACE
-#define INTERFACE IDirectInputW
-
-DECLARE_INTERFACE_(IDirectInputW, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputW methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
-};
-
-typedef struct IDirectInputW *LPDIRECTINPUTW;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputA
-
-DECLARE_INTERFACE_(IDirectInputA, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputA methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
-};
-
-typedef struct IDirectInputA *LPDIRECTINPUTA;
-
-#ifdef UNICODE
-#define IID_IDirectInput IID_IDirectInputW
-#define IDirectInput IDirectInputW
-#define IDirectInputVtbl IDirectInputWVtbl
-#else
-#define IID_IDirectInput IID_IDirectInputA
-#define IDirectInput IDirectInputA
-#define IDirectInputVtbl IDirectInputAVtbl
-#endif
-typedef struct IDirectInput *LPDIRECTINPUT;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInput_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
-#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
-#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
-#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#else
-#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInput_AddRef(p) (p)->AddRef()
-#define IDirectInput_Release(p) (p)->Release()
-#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
-#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
-#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
-#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b)
-#endif
-
-#undef INTERFACE
-#define INTERFACE IDirectInput2W
-
-DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputW methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
-
- /*** IDirectInput2W methods ***/
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
-};
-
-typedef struct IDirectInput2W *LPDIRECTINPUT2W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInput2A
-
-DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputA methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
-
- /*** IDirectInput2A methods ***/
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
-};
-
-typedef struct IDirectInput2A *LPDIRECTINPUT2A;
-
-#ifdef UNICODE
-#define IID_IDirectInput2 IID_IDirectInput2W
-#define IDirectInput2 IDirectInput2W
-#define IDirectInput2Vtbl IDirectInput2WVtbl
-#else
-#define IID_IDirectInput2 IID_IDirectInput2A
-#define IDirectInput2 IDirectInput2A
-#define IDirectInput2Vtbl IDirectInput2AVtbl
-#endif
-typedef struct IDirectInput2 *LPDIRECTINPUT2;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
-#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
-#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
-#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
-#else
-#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInput2_AddRef(p) (p)->AddRef()
-#define IDirectInput2_Release(p) (p)->Release()
-#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
-#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
-#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
-#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b)
-#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
-#endif
-
-
-#undef INTERFACE
-#define INTERFACE IDirectInput7W
-
-DECLARE_INTERFACE_(IDirectInput7W, IDirectInput2W)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInput2W methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
-
- /*** IDirectInput7W methods ***/
- STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE;
-};
-
-typedef struct IDirectInput7W *LPDIRECTINPUT7W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInput7A
-
-DECLARE_INTERFACE_(IDirectInput7A, IDirectInput2A)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInput2A methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
-
- /*** IDirectInput7A methods ***/
- STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE;
-};
-
-typedef struct IDirectInput7A *LPDIRECTINPUT7A;
-
-#ifdef UNICODE
-#define IID_IDirectInput7 IID_IDirectInput7W
-#define IDirectInput7 IDirectInput7W
-#define IDirectInput7Vtbl IDirectInput7WVtbl
-#else
-#define IID_IDirectInput7 IID_IDirectInput7A
-#define IDirectInput7 IDirectInput7A
-#define IDirectInput7Vtbl IDirectInput7AVtbl
-#endif
-typedef struct IDirectInput7 *LPDIRECTINPUT7;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInput7_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
-#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
-#define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
-#define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
-#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d)
-#else
-#define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInput7_AddRef(p) (p)->AddRef()
-#define IDirectInput7_Release(p) (p)->Release()
-#define IDirectInput7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
-#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
-#define IDirectInput7_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
-#define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInput7_Initialize(p,a,b) (p)->Initialize(a,b)
-#define IDirectInput7_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
-#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d)
-#endif
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-#undef INTERFACE
-#define INTERFACE IDirectInput8W
-
-DECLARE_INTERFACE_(IDirectInput8W, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInput8W methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8W *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE;
- STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR,LPDIACTIONFORMATW,LPDIENUMDEVICESBYSEMANTICSCBW,LPVOID,DWORD) PURE;
- STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSW,DWORD,LPVOID) PURE;
-};
-
-typedef struct IDirectInput8W *LPDIRECTINPUT8W;
-
-#undef INTERFACE
-#define INTERFACE IDirectInput8A
-
-DECLARE_INTERFACE_(IDirectInput8A, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInput8A methods ***/
- STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8A *,LPUNKNOWN) PURE;
- STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE;
- STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE;
- STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE;
- STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE;
- STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR,LPDIACTIONFORMATA,LPDIENUMDEVICESBYSEMANTICSCBA,LPVOID,DWORD) PURE;
- STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSA,DWORD,LPVOID) PURE;
-};
-
-typedef struct IDirectInput8A *LPDIRECTINPUT8A;
-
-#ifdef UNICODE
-#define IID_IDirectInput8 IID_IDirectInput8W
-#define IDirectInput8 IDirectInput8W
-#define IDirectInput8Vtbl IDirectInput8WVtbl
-#else
-#define IID_IDirectInput8 IID_IDirectInput8A
-#define IDirectInput8 IDirectInput8A
-#define IDirectInput8Vtbl IDirectInput8AVtbl
-#endif
-typedef struct IDirectInput8 *LPDIRECTINPUT8;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInput8_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInput8_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInput8_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
-#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
-#define IDirectInput8_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
-#define IDirectInput8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
-#define IDirectInput8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectInput8_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
-#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e)
-#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d)
-#else
-#define IDirectInput8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInput8_AddRef(p) (p)->AddRef()
-#define IDirectInput8_Release(p) (p)->Release()
-#define IDirectInput8_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
-#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
-#define IDirectInput8_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a)
-#define IDirectInput8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
-#define IDirectInput8_Initialize(p,a,b) (p)->Initialize(a,b)
-#define IDirectInput8_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c)
-#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->EnumDevicesBySemantics(a,b,c,d,e)
-#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d)
-#endif
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#if DIRECTINPUT_VERSION > 0x0700
-
-extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
-
-#else
-extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
-extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
-#ifdef UNICODE
-#define DirectInputCreate DirectInputCreateW
-#else
-#define DirectInputCreate DirectInputCreateA
-#endif // !UNICODE
-
-extern HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
-
-#endif /* DIRECTINPUT_VERSION > 0x700 */
-
-#endif /* DIJ_RINGZERO */
-
-
-/****************************************************************************
- *
- * Return Codes
- *
- ****************************************************************************/
-
-/*
- * The operation completed successfully.
- */
-#define DI_OK S_OK
-
-/*
- * The device exists but is not currently attached.
- */
-#define DI_NOTATTACHED S_FALSE
-
-/*
- * The device buffer overflowed. Some input was lost.
- */
-#define DI_BUFFEROVERFLOW S_FALSE
-
-/*
- * The change in device properties had no effect.
- */
-#define DI_PROPNOEFFECT S_FALSE
-
-/*
- * The operation had no effect.
- */
-#define DI_NOEFFECT S_FALSE
-
-/*
- * The device is a polled device. As a result, device buffering
- * will not collect any data and event notifications will not be
- * signalled until GetDeviceState is called.
- */
-#define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
-
-/*
- * The parameters of the effect were successfully updated by
- * IDirectInputEffect::SetParameters, but the effect was not
- * downloaded because the device is not exclusively acquired
- * or because the DIEP_NODOWNLOAD flag was passed.
- */
-#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
-
-/*
- * The parameters of the effect were successfully updated by
- * IDirectInputEffect::SetParameters, but in order to change
- * the parameters, the effect needed to be restarted.
- */
-#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
-
-/*
- * The parameters of the effect were successfully updated by
- * IDirectInputEffect::SetParameters, but some of them were
- * beyond the capabilities of the device and were truncated.
- */
-#define DI_TRUNCATED ((HRESULT)0x00000008L)
-
-/*
- * The settings have been successfully applied but could not be
- * persisted.
- */
-#define DI_SETTINGSNOTSAVED ((HRESULT)0x0000000BL)
-
-/*
- * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED.
- */
-#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
-
-/*
- * A SUCCESS code indicating that settings cannot be modified.
- */
-#define DI_WRITEPROTECT ((HRESULT)0x00000013L)
-
-/*
- * The application requires a newer version of DirectInput.
- */
-#define DIERR_OLDDIRECTINPUTVERSION \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
-
-/*
- * The application was written for an unsupported prerelease version
- * of DirectInput.
- */
-#define DIERR_BETADIRECTINPUTVERSION \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
-
-/*
- * The object could not be created due to an incompatible driver version
- * or mismatched or incomplete driver components.
- */
-#define DIERR_BADDRIVERVER \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
-
-/*
- * The device or device instance or effect is not registered with DirectInput.
- */
-#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
-
-/*
- * The requested object does not exist.
- */
-#define DIERR_NOTFOUND \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
-
-/*
- * The requested object does not exist.
- */
-#define DIERR_OBJECTNOTFOUND \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
-
-/*
- * An invalid parameter was passed to the returning function,
- * or the object was not in a state that admitted the function
- * to be called.
- */
-#define DIERR_INVALIDPARAM E_INVALIDARG
-
-/*
- * The specified interface is not supported by the object
- */
-#define DIERR_NOINTERFACE E_NOINTERFACE
-
-/*
- * An undetermined error occured inside the DInput subsystem
- */
-#define DIERR_GENERIC E_FAIL
-
-/*
- * The DInput subsystem couldn't allocate sufficient memory to complete the
- * caller's request.
- */
-#define DIERR_OUTOFMEMORY E_OUTOFMEMORY
-
-/*
- * The function called is not supported at this time
- */
-#define DIERR_UNSUPPORTED E_NOTIMPL
-
-/*
- * This object has not been initialized
- */
-#define DIERR_NOTINITIALIZED \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
-
-/*
- * This object is already initialized
- */
-#define DIERR_ALREADYINITIALIZED \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
-
-/*
- * This object does not support aggregation
- */
-#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
-
-/*
- * Another app has a higher priority level, preventing this call from
- * succeeding.
- */
-#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
-
-/*
- * Access to the device has been lost. It must be re-acquired.
- */
-#define DIERR_INPUTLOST \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
-
-/*
- * The operation cannot be performed while the device is acquired.
- */
-#define DIERR_ACQUIRED \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
-
-/*
- * The operation cannot be performed unless the device is acquired.
- */
-#define DIERR_NOTACQUIRED \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
-
-/*
- * The specified property cannot be changed.
- */
-#define DIERR_READONLY E_ACCESSDENIED
-
-/*
- * The device already has an event notification associated with it.
- */
-#define DIERR_HANDLEEXISTS E_ACCESSDENIED
-
-/*
- * Data is not yet available.
- */
-#ifndef E_PENDING
-#define E_PENDING 0x8000000AL
-#endif
-
-/*
- * Unable to IDirectInputJoyConfig_Acquire because the user
- * does not have sufficient privileges to change the joystick
- * configuration.
- */
-#define DIERR_INSUFFICIENTPRIVS 0x80040200L
-
-/*
- * The device is full.
- */
-#define DIERR_DEVICEFULL 0x80040201L
-
-/*
- * Not all the requested information fit into the buffer.
- */
-#define DIERR_MOREDATA 0x80040202L
-
-/*
- * The effect is not downloaded.
- */
-#define DIERR_NOTDOWNLOADED 0x80040203L
-
-/*
- * The device cannot be reinitialized because there are still effects
- * attached to it.
- */
-#define DIERR_HASEFFECTS 0x80040204L
-
-/*
- * The operation cannot be performed unless the device is acquired
- * in DISCL_EXCLUSIVE mode.
- */
-#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
-
-/*
- * The effect could not be downloaded because essential information
- * is missing. For example, no axes have been associated with the
- * effect, or no type-specific information has been created.
- */
-#define DIERR_INCOMPLETEEFFECT 0x80040206L
-
-/*
- * Attempted to read buffered device data from a device that is
- * not buffered.
- */
-#define DIERR_NOTBUFFERED 0x80040207L
-
-/*
- * An attempt was made to modify parameters of an effect while it is
- * playing. Not all hardware devices support altering the parameters
- * of an effect while it is playing.
- */
-#define DIERR_EFFECTPLAYING 0x80040208L
-
-/*
- * The operation could not be completed because the device is not
- * plugged in.
- */
-#define DIERR_UNPLUGGED 0x80040209L
-
-/*
- * SendDeviceData failed because more information was requested
- * to be sent than can be sent to the device. Some devices have
- * restrictions on how much data can be sent to them. (For example,
- * there might be a limit on the number of buttons that can be
- * pressed at once.)
- */
-#define DIERR_REPORTFULL 0x8004020AL
-
-
-/*
- * A mapper file function failed because reading or writing the user or IHV
- * settings file failed.
- */
-#define DIERR_MAPFILEFAIL 0x8004020BL
-
-
-/*--- DINPUT Mapper Definitions: New for Dx8 ---*/
-
-
-/*--- Keyboard
- Physical Keyboard Device ---*/
-
-#define DIKEYBOARD_ESCAPE 0x81000401
-#define DIKEYBOARD_1 0x81000402
-#define DIKEYBOARD_2 0x81000403
-#define DIKEYBOARD_3 0x81000404
-#define DIKEYBOARD_4 0x81000405
-#define DIKEYBOARD_5 0x81000406
-#define DIKEYBOARD_6 0x81000407
-#define DIKEYBOARD_7 0x81000408
-#define DIKEYBOARD_8 0x81000409
-#define DIKEYBOARD_9 0x8100040A
-#define DIKEYBOARD_0 0x8100040B
-#define DIKEYBOARD_MINUS 0x8100040C /* - on main keyboard */
-#define DIKEYBOARD_EQUALS 0x8100040D
-#define DIKEYBOARD_BACK 0x8100040E /* backspace */
-#define DIKEYBOARD_TAB 0x8100040F
-#define DIKEYBOARD_Q 0x81000410
-#define DIKEYBOARD_W 0x81000411
-#define DIKEYBOARD_E 0x81000412
-#define DIKEYBOARD_R 0x81000413
-#define DIKEYBOARD_T 0x81000414
-#define DIKEYBOARD_Y 0x81000415
-#define DIKEYBOARD_U 0x81000416
-#define DIKEYBOARD_I 0x81000417
-#define DIKEYBOARD_O 0x81000418
-#define DIKEYBOARD_P 0x81000419
-#define DIKEYBOARD_LBRACKET 0x8100041A
-#define DIKEYBOARD_RBRACKET 0x8100041B
-#define DIKEYBOARD_RETURN 0x8100041C /* Enter on main keyboard */
-#define DIKEYBOARD_LCONTROL 0x8100041D
-#define DIKEYBOARD_A 0x8100041E
-#define DIKEYBOARD_S 0x8100041F
-#define DIKEYBOARD_D 0x81000420
-#define DIKEYBOARD_F 0x81000421
-#define DIKEYBOARD_G 0x81000422
-#define DIKEYBOARD_H 0x81000423
-#define DIKEYBOARD_J 0x81000424
-#define DIKEYBOARD_K 0x81000425
-#define DIKEYBOARD_L 0x81000426
-#define DIKEYBOARD_SEMICOLON 0x81000427
-#define DIKEYBOARD_APOSTROPHE 0x81000428
-#define DIKEYBOARD_GRAVE 0x81000429 /* accent grave */
-#define DIKEYBOARD_LSHIFT 0x8100042A
-#define DIKEYBOARD_BACKSLASH 0x8100042B
-#define DIKEYBOARD_Z 0x8100042C
-#define DIKEYBOARD_X 0x8100042D
-#define DIKEYBOARD_C 0x8100042E
-#define DIKEYBOARD_V 0x8100042F
-#define DIKEYBOARD_B 0x81000430
-#define DIKEYBOARD_N 0x81000431
-#define DIKEYBOARD_M 0x81000432
-#define DIKEYBOARD_COMMA 0x81000433
-#define DIKEYBOARD_PERIOD 0x81000434 /* . on main keyboard */
-#define DIKEYBOARD_SLASH 0x81000435 /* / on main keyboard */
-#define DIKEYBOARD_RSHIFT 0x81000436
-#define DIKEYBOARD_MULTIPLY 0x81000437 /* * on numeric keypad */
-#define DIKEYBOARD_LMENU 0x81000438 /* left Alt */
-#define DIKEYBOARD_SPACE 0x81000439
-#define DIKEYBOARD_CAPITAL 0x8100043A
-#define DIKEYBOARD_F1 0x8100043B
-#define DIKEYBOARD_F2 0x8100043C
-#define DIKEYBOARD_F3 0x8100043D
-#define DIKEYBOARD_F4 0x8100043E
-#define DIKEYBOARD_F5 0x8100043F
-#define DIKEYBOARD_F6 0x81000440
-#define DIKEYBOARD_F7 0x81000441
-#define DIKEYBOARD_F8 0x81000442
-#define DIKEYBOARD_F9 0x81000443
-#define DIKEYBOARD_F10 0x81000444
-#define DIKEYBOARD_NUMLOCK 0x81000445
-#define DIKEYBOARD_SCROLL 0x81000446 /* Scroll Lock */
-#define DIKEYBOARD_NUMPAD7 0x81000447
-#define DIKEYBOARD_NUMPAD8 0x81000448
-#define DIKEYBOARD_NUMPAD9 0x81000449
-#define DIKEYBOARD_SUBTRACT 0x8100044A /* - on numeric keypad */
-#define DIKEYBOARD_NUMPAD4 0x8100044B
-#define DIKEYBOARD_NUMPAD5 0x8100044C
-#define DIKEYBOARD_NUMPAD6 0x8100044D
-#define DIKEYBOARD_ADD 0x8100044E /* + on numeric keypad */
-#define DIKEYBOARD_NUMPAD1 0x8100044F
-#define DIKEYBOARD_NUMPAD2 0x81000450
-#define DIKEYBOARD_NUMPAD3 0x81000451
-#define DIKEYBOARD_NUMPAD0 0x81000452
-#define DIKEYBOARD_DECIMAL 0x81000453 /* . on numeric keypad */
-#define DIKEYBOARD_OEM_102 0x81000456 /* <> or \| on RT 102-key keyboard (Non-U.S.) */
-#define DIKEYBOARD_F11 0x81000457
-#define DIKEYBOARD_F12 0x81000458
-#define DIKEYBOARD_F13 0x81000464 /* (NEC PC98) */
-#define DIKEYBOARD_F14 0x81000465 /* (NEC PC98) */
-#define DIKEYBOARD_F15 0x81000466 /* (NEC PC98) */
-#define DIKEYBOARD_KANA 0x81000470 /* (Japanese keyboard) */
-#define DIKEYBOARD_ABNT_C1 0x81000473 /* /? on Brazilian keyboard */
-#define DIKEYBOARD_CONVERT 0x81000479 /* (Japanese keyboard) */
-#define DIKEYBOARD_NOCONVERT 0x8100047B /* (Japanese keyboard) */
-#define DIKEYBOARD_YEN 0x8100047D /* (Japanese keyboard) */
-#define DIKEYBOARD_ABNT_C2 0x8100047E /* Numpad . on Brazilian keyboard */
-#define DIKEYBOARD_NUMPADEQUALS 0x8100048D /* = on numeric keypad (NEC PC98) */
-#define DIKEYBOARD_PREVTRACK 0x81000490 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
-#define DIKEYBOARD_AT 0x81000491 /* (NEC PC98) */
-#define DIKEYBOARD_COLON 0x81000492 /* (NEC PC98) */
-#define DIKEYBOARD_UNDERLINE 0x81000493 /* (NEC PC98) */
-#define DIKEYBOARD_KANJI 0x81000494 /* (Japanese keyboard) */
-#define DIKEYBOARD_STOP 0x81000495 /* (NEC PC98) */
-#define DIKEYBOARD_AX 0x81000496 /* (Japan AX) */
-#define DIKEYBOARD_UNLABELED 0x81000497 /* (J3100) */
-#define DIKEYBOARD_NEXTTRACK 0x81000499 /* Next Track */
-#define DIKEYBOARD_NUMPADENTER 0x8100049C /* Enter on numeric keypad */
-#define DIKEYBOARD_RCONTROL 0x8100049D
-#define DIKEYBOARD_MUTE 0x810004A0 /* Mute */
-#define DIKEYBOARD_CALCULATOR 0x810004A1 /* Calculator */
-#define DIKEYBOARD_PLAYPAUSE 0x810004A2 /* Play / Pause */
-#define DIKEYBOARD_MEDIASTOP 0x810004A4 /* Media Stop */
-#define DIKEYBOARD_VOLUMEDOWN 0x810004AE /* Volume - */
-#define DIKEYBOARD_VOLUMEUP 0x810004B0 /* Volume + */
-#define DIKEYBOARD_WEBHOME 0x810004B2 /* Web home */
-#define DIKEYBOARD_NUMPADCOMMA 0x810004B3 /* , on numeric keypad (NEC PC98) */
-#define DIKEYBOARD_DIVIDE 0x810004B5 /* / on numeric keypad */
-#define DIKEYBOARD_SYSRQ 0x810004B7
-#define DIKEYBOARD_RMENU 0x810004B8 /* right Alt */
-#define DIKEYBOARD_PAUSE 0x810004C5 /* Pause */
-#define DIKEYBOARD_HOME 0x810004C7 /* Home on arrow keypad */
-#define DIKEYBOARD_UP 0x810004C8 /* UpArrow on arrow keypad */
-#define DIKEYBOARD_PRIOR 0x810004C9 /* PgUp on arrow keypad */
-#define DIKEYBOARD_LEFT 0x810004CB /* LeftArrow on arrow keypad */
-#define DIKEYBOARD_RIGHT 0x810004CD /* RightArrow on arrow keypad */
-#define DIKEYBOARD_END 0x810004CF /* End on arrow keypad */
-#define DIKEYBOARD_DOWN 0x810004D0 /* DownArrow on arrow keypad */
-#define DIKEYBOARD_NEXT 0x810004D1 /* PgDn on arrow keypad */
-#define DIKEYBOARD_INSERT 0x810004D2 /* Insert on arrow keypad */
-#define DIKEYBOARD_DELETE 0x810004D3 /* Delete on arrow keypad */
-#define DIKEYBOARD_LWIN 0x810004DB /* Left Windows key */
-#define DIKEYBOARD_RWIN 0x810004DC /* Right Windows key */
-#define DIKEYBOARD_APPS 0x810004DD /* AppMenu key */
-#define DIKEYBOARD_POWER 0x810004DE /* System Power */
-#define DIKEYBOARD_SLEEP 0x810004DF /* System Sleep */
-#define DIKEYBOARD_WAKE 0x810004E3 /* System Wake */
-#define DIKEYBOARD_WEBSEARCH 0x810004E5 /* Web Search */
-#define DIKEYBOARD_WEBFAVORITES 0x810004E6 /* Web Favorites */
-#define DIKEYBOARD_WEBREFRESH 0x810004E7 /* Web Refresh */
-#define DIKEYBOARD_WEBSTOP 0x810004E8 /* Web Stop */
-#define DIKEYBOARD_WEBFORWARD 0x810004E9 /* Web Forward */
-#define DIKEYBOARD_WEBBACK 0x810004EA /* Web Back */
-#define DIKEYBOARD_MYCOMPUTER 0x810004EB /* My Computer */
-#define DIKEYBOARD_MAIL 0x810004EC /* Mail */
-#define DIKEYBOARD_MEDIASELECT 0x810004ED /* Media Select */
-
-
-/*--- MOUSE
- Physical Mouse Device ---*/
-
-#define DIMOUSE_XAXISAB (0x82000200 |DIMOFS_X ) /* X Axis-absolute: Some mice natively report absolute coordinates */
-#define DIMOUSE_YAXISAB (0x82000200 |DIMOFS_Y ) /* Y Axis-absolute: Some mice natively report absolute coordinates */
-#define DIMOUSE_XAXIS (0x82000300 |DIMOFS_X ) /* X Axis */
-#define DIMOUSE_YAXIS (0x82000300 |DIMOFS_Y ) /* Y Axis */
-#define DIMOUSE_WHEEL (0x82000300 |DIMOFS_Z ) /* Z Axis */
-#define DIMOUSE_BUTTON0 (0x82000400 |DIMOFS_BUTTON0) /* Button 0 */
-#define DIMOUSE_BUTTON1 (0x82000400 |DIMOFS_BUTTON1) /* Button 1 */
-#define DIMOUSE_BUTTON2 (0x82000400 |DIMOFS_BUTTON2) /* Button 2 */
-#define DIMOUSE_BUTTON3 (0x82000400 |DIMOFS_BUTTON3) /* Button 3 */
-#define DIMOUSE_BUTTON4 (0x82000400 |DIMOFS_BUTTON4) /* Button 4 */
-#define DIMOUSE_BUTTON5 (0x82000400 |DIMOFS_BUTTON5) /* Button 5 */
-#define DIMOUSE_BUTTON6 (0x82000400 |DIMOFS_BUTTON6) /* Button 6 */
-#define DIMOUSE_BUTTON7 (0x82000400 |DIMOFS_BUTTON7) /* Button 7 */
-
-
-/*--- VOICE
- Physical Dplay Voice Device ---*/
-
-#define DIVOICE_CHANNEL1 0x83000401
-#define DIVOICE_CHANNEL2 0x83000402
-#define DIVOICE_CHANNEL3 0x83000403
-#define DIVOICE_CHANNEL4 0x83000404
-#define DIVOICE_CHANNEL5 0x83000405
-#define DIVOICE_CHANNEL6 0x83000406
-#define DIVOICE_CHANNEL7 0x83000407
-#define DIVOICE_CHANNEL8 0x83000408
-#define DIVOICE_TEAM 0x83000409
-#define DIVOICE_ALL 0x8300040A
-#define DIVOICE_RECORDMUTE 0x8300040B
-#define DIVOICE_PLAYBACKMUTE 0x8300040C
-#define DIVOICE_TRANSMIT 0x8300040D
-
-#define DIVOICE_VOICECOMMAND 0x83000410
-
-
-/*--- Driving Simulator - Racing
- Vehicle control is primary objective ---*/
-#define DIVIRTUAL_DRIVING_RACE 0x01000000
-#define DIAXIS_DRIVINGR_STEER 0x01008A01 /* Steering */
-#define DIAXIS_DRIVINGR_ACCELERATE 0x01039202 /* Accelerate */
-#define DIAXIS_DRIVINGR_BRAKE 0x01041203 /* Brake-Axis */
-#define DIBUTTON_DRIVINGR_SHIFTUP 0x01000C01 /* Shift to next higher gear */
-#define DIBUTTON_DRIVINGR_SHIFTDOWN 0x01000C02 /* Shift to next lower gear */
-#define DIBUTTON_DRIVINGR_VIEW 0x01001C03 /* Cycle through view options */
-#define DIBUTTON_DRIVINGR_MENU 0x010004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIAXIS_DRIVINGR_ACCEL_AND_BRAKE 0x01014A04 /* Some devices combine accelerate and brake in a single axis */
-#define DIHATSWITCH_DRIVINGR_GLANCE 0x01004601 /* Look around */
-#define DIBUTTON_DRIVINGR_BRAKE 0x01004C04 /* Brake-button */
-#define DIBUTTON_DRIVINGR_DASHBOARD 0x01004405 /* Select next dashboard option */
-#define DIBUTTON_DRIVINGR_AIDS 0x01004406 /* Driver correction aids */
-#define DIBUTTON_DRIVINGR_MAP 0x01004407 /* Display Driving Map */
-#define DIBUTTON_DRIVINGR_BOOST 0x01004408 /* Turbo Boost */
-#define DIBUTTON_DRIVINGR_PIT 0x01004409 /* Pit stop notification */
-#define DIBUTTON_DRIVINGR_ACCELERATE_LINK 0x0103D4E0 /* Fallback Accelerate button */
-#define DIBUTTON_DRIVINGR_STEER_LEFT_LINK 0x0100CCE4 /* Fallback Steer Left button */
-#define DIBUTTON_DRIVINGR_STEER_RIGHT_LINK 0x0100CCEC /* Fallback Steer Right button */
-#define DIBUTTON_DRIVINGR_GLANCE_LEFT_LINK 0x0107C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_DRIVINGR_GLANCE_RIGHT_LINK 0x0107C4EC /* Fallback Glance Right button */
-#define DIBUTTON_DRIVINGR_DEVICE 0x010044FE /* Show input device and controls */
-#define DIBUTTON_DRIVINGR_PAUSE 0x010044FC /* Start / Pause / Restart game */
-
-/*--- Driving Simulator - Combat
- Combat from within a vehicle is primary objective ---*/
-#define DIVIRTUAL_DRIVING_COMBAT 0x02000000
-#define DIAXIS_DRIVINGC_STEER 0x02008A01 /* Steering */
-#define DIAXIS_DRIVINGC_ACCELERATE 0x02039202 /* Accelerate */
-#define DIAXIS_DRIVINGC_BRAKE 0x02041203 /* Brake-axis */
-#define DIBUTTON_DRIVINGC_FIRE 0x02000C01 /* Fire */
-#define DIBUTTON_DRIVINGC_WEAPONS 0x02000C02 /* Select next weapon */
-#define DIBUTTON_DRIVINGC_TARGET 0x02000C03 /* Select next available target */
-#define DIBUTTON_DRIVINGC_MENU 0x020004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIAXIS_DRIVINGC_ACCEL_AND_BRAKE 0x02014A04 /* Some devices combine accelerate and brake in a single axis */
-#define DIHATSWITCH_DRIVINGC_GLANCE 0x02004601 /* Look around */
-#define DIBUTTON_DRIVINGC_SHIFTUP 0x02004C04 /* Shift to next higher gear */
-#define DIBUTTON_DRIVINGC_SHIFTDOWN 0x02004C05 /* Shift to next lower gear */
-#define DIBUTTON_DRIVINGC_DASHBOARD 0x02004406 /* Select next dashboard option */
-#define DIBUTTON_DRIVINGC_AIDS 0x02004407 /* Driver correction aids */
-#define DIBUTTON_DRIVINGC_BRAKE 0x02004C08 /* Brake-button */
-#define DIBUTTON_DRIVINGC_FIRESECONDARY 0x02004C09 /* Alternative fire button */
-#define DIBUTTON_DRIVINGC_ACCELERATE_LINK 0x0203D4E0 /* Fallback Accelerate button */
-#define DIBUTTON_DRIVINGC_STEER_LEFT_LINK 0x0200CCE4 /* Fallback Steer Left button */
-#define DIBUTTON_DRIVINGC_STEER_RIGHT_LINK 0x0200CCEC /* Fallback Steer Right button */
-#define DIBUTTON_DRIVINGC_GLANCE_LEFT_LINK 0x0207C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_DRIVINGC_GLANCE_RIGHT_LINK 0x0207C4EC /* Fallback Glance Right button */
-#define DIBUTTON_DRIVINGC_DEVICE 0x020044FE /* Show input device and controls */
-#define DIBUTTON_DRIVINGC_PAUSE 0x020044FC /* Start / Pause / Restart game */
-
-/*--- Driving Simulator - Tank
- Combat from withing a tank is primary objective ---*/
-#define DIVIRTUAL_DRIVING_TANK 0x03000000
-#define DIAXIS_DRIVINGT_STEER 0x03008A01 /* Turn tank left / right */
-#define DIAXIS_DRIVINGT_BARREL 0x03010202 /* Raise / lower barrel */
-#define DIAXIS_DRIVINGT_ACCELERATE 0x03039203 /* Accelerate */
-#define DIAXIS_DRIVINGT_ROTATE 0x03020204 /* Turn barrel left / right */
-#define DIBUTTON_DRIVINGT_FIRE 0x03000C01 /* Fire */
-#define DIBUTTON_DRIVINGT_WEAPONS 0x03000C02 /* Select next weapon */
-#define DIBUTTON_DRIVINGT_TARGET 0x03000C03 /* Selects next available target */
-#define DIBUTTON_DRIVINGT_MENU 0x030004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_DRIVINGT_GLANCE 0x03004601 /* Look around */
-#define DIAXIS_DRIVINGT_BRAKE 0x03045205 /* Brake-axis */
-#define DIAXIS_DRIVINGT_ACCEL_AND_BRAKE 0x03014A06 /* Some devices combine accelerate and brake in a single axis */
-#define DIBUTTON_DRIVINGT_VIEW 0x03005C04 /* Cycle through view options */
-#define DIBUTTON_DRIVINGT_DASHBOARD 0x03005C05 /* Select next dashboard option */
-#define DIBUTTON_DRIVINGT_BRAKE 0x03004C06 /* Brake-button */
-#define DIBUTTON_DRIVINGT_FIRESECONDARY 0x03004C07 /* Alternative fire button */
-#define DIBUTTON_DRIVINGT_ACCELERATE_LINK 0x0303D4E0 /* Fallback Accelerate button */
-#define DIBUTTON_DRIVINGT_STEER_LEFT_LINK 0x0300CCE4 /* Fallback Steer Left button */
-#define DIBUTTON_DRIVINGT_STEER_RIGHT_LINK 0x0300CCEC /* Fallback Steer Right button */
-#define DIBUTTON_DRIVINGT_BARREL_UP_LINK 0x030144E0 /* Fallback Barrel up button */
-#define DIBUTTON_DRIVINGT_BARREL_DOWN_LINK 0x030144E8 /* Fallback Barrel down button */
-#define DIBUTTON_DRIVINGT_ROTATE_LEFT_LINK 0x030244E4 /* Fallback Rotate left button */
-#define DIBUTTON_DRIVINGT_ROTATE_RIGHT_LINK 0x030244EC /* Fallback Rotate right button */
-#define DIBUTTON_DRIVINGT_GLANCE_LEFT_LINK 0x0307C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_DRIVINGT_GLANCE_RIGHT_LINK 0x0307C4EC /* Fallback Glance Right button */
-#define DIBUTTON_DRIVINGT_DEVICE 0x030044FE /* Show input device and controls */
-#define DIBUTTON_DRIVINGT_PAUSE 0x030044FC /* Start / Pause / Restart game */
-
-/*--- Flight Simulator - Civilian
- Plane control is the primary objective ---*/
-#define DIVIRTUAL_FLYING_CIVILIAN 0x04000000
-#define DIAXIS_FLYINGC_BANK 0x04008A01 /* Roll ship left / right */
-#define DIAXIS_FLYINGC_PITCH 0x04010A02 /* Nose up / down */
-#define DIAXIS_FLYINGC_THROTTLE 0x04039203 /* Throttle */
-#define DIBUTTON_FLYINGC_VIEW 0x04002401 /* Cycle through view options */
-#define DIBUTTON_FLYINGC_DISPLAY 0x04002402 /* Select next dashboard / heads up display option */
-#define DIBUTTON_FLYINGC_GEAR 0x04002C03 /* Gear up / down */
-#define DIBUTTON_FLYINGC_MENU 0x040004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_FLYINGC_GLANCE 0x04004601 /* Look around */
-#define DIAXIS_FLYINGC_BRAKE 0x04046A04 /* Apply Brake */
-#define DIAXIS_FLYINGC_RUDDER 0x04025205 /* Yaw ship left/right */
-#define DIAXIS_FLYINGC_FLAPS 0x04055A06 /* Flaps */
-#define DIBUTTON_FLYINGC_FLAPSUP 0x04006404 /* Increment stepping up until fully retracted */
-#define DIBUTTON_FLYINGC_FLAPSDOWN 0x04006405 /* Decrement stepping down until fully extended */
-#define DIBUTTON_FLYINGC_BRAKE_LINK 0x04046CE0 /* Fallback brake button */
-#define DIBUTTON_FLYINGC_FASTER_LINK 0x0403D4E0 /* Fallback throttle up button */
-#define DIBUTTON_FLYINGC_SLOWER_LINK 0x0403D4E8 /* Fallback throttle down button */
-#define DIBUTTON_FLYINGC_GLANCE_LEFT_LINK 0x0407C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_FLYINGC_GLANCE_RIGHT_LINK 0x0407C4EC /* Fallback Glance Right button */
-#define DIBUTTON_FLYINGC_GLANCE_UP_LINK 0x0407C4E0 /* Fallback Glance Up button */
-#define DIBUTTON_FLYINGC_GLANCE_DOWN_LINK 0x0407C4E8 /* Fallback Glance Down button */
-#define DIBUTTON_FLYINGC_DEVICE 0x040044FE /* Show input device and controls */
-#define DIBUTTON_FLYINGC_PAUSE 0x040044FC /* Start / Pause / Restart game */
-
-/*--- Flight Simulator - Military
- Aerial combat is the primary objective ---*/
-#define DIVIRTUAL_FLYING_MILITARY 0x05000000
-#define DIAXIS_FLYINGM_BANK 0x05008A01 /* Bank - Roll ship left / right */
-#define DIAXIS_FLYINGM_PITCH 0x05010A02 /* Pitch - Nose up / down */
-#define DIAXIS_FLYINGM_THROTTLE 0x05039203 /* Throttle - faster / slower */
-#define DIBUTTON_FLYINGM_FIRE 0x05000C01 /* Fire */
-#define DIBUTTON_FLYINGM_WEAPONS 0x05000C02 /* Select next weapon */
-#define DIBUTTON_FLYINGM_TARGET 0x05000C03 /* Selects next available target */
-#define DIBUTTON_FLYINGM_MENU 0x050004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_FLYINGM_GLANCE 0x05004601 /* Look around */
-#define DIBUTTON_FLYINGM_COUNTER 0x05005C04 /* Activate counter measures */
-#define DIAXIS_FLYINGM_RUDDER 0x05024A04 /* Rudder - Yaw ship left/right */
-#define DIAXIS_FLYINGM_BRAKE 0x05046205 /* Brake-axis */
-#define DIBUTTON_FLYINGM_VIEW 0x05006405 /* Cycle through view options */
-#define DIBUTTON_FLYINGM_DISPLAY 0x05006406 /* Select next dashboard option */
-#define DIAXIS_FLYINGM_FLAPS 0x05055206 /* Flaps */
-#define DIBUTTON_FLYINGM_FLAPSUP 0x05005407 /* Increment stepping up until fully retracted */
-#define DIBUTTON_FLYINGM_FLAPSDOWN 0x05005408 /* Decrement stepping down until fully extended */
-#define DIBUTTON_FLYINGM_FIRESECONDARY 0x05004C09 /* Alternative fire button */
-#define DIBUTTON_FLYINGM_GEAR 0x0500640A /* Gear up / down */
-#define DIBUTTON_FLYINGM_BRAKE_LINK 0x050464E0 /* Fallback brake button */
-#define DIBUTTON_FLYINGM_FASTER_LINK 0x0503D4E0 /* Fallback throttle up button */
-#define DIBUTTON_FLYINGM_SLOWER_LINK 0x0503D4E8 /* Fallback throttle down button */
-#define DIBUTTON_FLYINGM_GLANCE_LEFT_LINK 0x0507C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_FLYINGM_GLANCE_RIGHT_LINK 0x0507C4EC /* Fallback Glance Right button */
-#define DIBUTTON_FLYINGM_GLANCE_UP_LINK 0x0507C4E0 /* Fallback Glance Up button */
-#define DIBUTTON_FLYINGM_GLANCE_DOWN_LINK 0x0507C4E8 /* Fallback Glance Down button */
-#define DIBUTTON_FLYINGM_DEVICE 0x050044FE /* Show input device and controls */
-#define DIBUTTON_FLYINGM_PAUSE 0x050044FC /* Start / Pause / Restart game */
-
-/*--- Flight Simulator - Combat Helicopter
- Combat from helicopter is primary objective ---*/
-#define DIVIRTUAL_FLYING_HELICOPTER 0x06000000
-#define DIAXIS_FLYINGH_BANK 0x06008A01 /* Bank - Roll ship left / right */
-#define DIAXIS_FLYINGH_PITCH 0x06010A02 /* Pitch - Nose up / down */
-#define DIAXIS_FLYINGH_COLLECTIVE 0x06018A03 /* Collective - Blade pitch/power */
-#define DIBUTTON_FLYINGH_FIRE 0x06001401 /* Fire */
-#define DIBUTTON_FLYINGH_WEAPONS 0x06001402 /* Select next weapon */
-#define DIBUTTON_FLYINGH_TARGET 0x06001403 /* Selects next available target */
-#define DIBUTTON_FLYINGH_MENU 0x060004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_FLYINGH_GLANCE 0x06004601 /* Look around */
-#define DIAXIS_FLYINGH_TORQUE 0x06025A04 /* Torque - Rotate ship around left / right axis */
-#define DIAXIS_FLYINGH_THROTTLE 0x0603DA05 /* Throttle */
-#define DIBUTTON_FLYINGH_COUNTER 0x06005404 /* Activate counter measures */
-#define DIBUTTON_FLYINGH_VIEW 0x06006405 /* Cycle through view options */
-#define DIBUTTON_FLYINGH_GEAR 0x06006406 /* Gear up / down */
-#define DIBUTTON_FLYINGH_FIRESECONDARY 0x06004C07 /* Alternative fire button */
-#define DIBUTTON_FLYINGH_FASTER_LINK 0x0603DCE0 /* Fallback throttle up button */
-#define DIBUTTON_FLYINGH_SLOWER_LINK 0x0603DCE8 /* Fallback throttle down button */
-#define DIBUTTON_FLYINGH_GLANCE_LEFT_LINK 0x0607C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_FLYINGH_GLANCE_RIGHT_LINK 0x0607C4EC /* Fallback Glance Right button */
-#define DIBUTTON_FLYINGH_GLANCE_UP_LINK 0x0607C4E0 /* Fallback Glance Up button */
-#define DIBUTTON_FLYINGH_GLANCE_DOWN_LINK 0x0607C4E8 /* Fallback Glance Down button */
-#define DIBUTTON_FLYINGH_DEVICE 0x060044FE /* Show input device and controls */
-#define DIBUTTON_FLYINGH_PAUSE 0x060044FC /* Start / Pause / Restart game */
-
-/*--- Space Simulator - Combat
- Space Simulator with weapons ---*/
-#define DIVIRTUAL_SPACESIM 0x07000000
-#define DIAXIS_SPACESIM_LATERAL 0x07008201 /* Move ship left / right */
-#define DIAXIS_SPACESIM_MOVE 0x07010202 /* Move ship forward/backward */
-#define DIAXIS_SPACESIM_THROTTLE 0x07038203 /* Throttle - Engine speed */
-#define DIBUTTON_SPACESIM_FIRE 0x07000401 /* Fire */
-#define DIBUTTON_SPACESIM_WEAPONS 0x07000402 /* Select next weapon */
-#define DIBUTTON_SPACESIM_TARGET 0x07000403 /* Selects next available target */
-#define DIBUTTON_SPACESIM_MENU 0x070004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_SPACESIM_GLANCE 0x07004601 /* Look around */
-#define DIAXIS_SPACESIM_CLIMB 0x0701C204 /* Climb - Pitch ship up/down */
-#define DIAXIS_SPACESIM_ROTATE 0x07024205 /* Rotate - Turn ship left/right */
-#define DIBUTTON_SPACESIM_VIEW 0x07004404 /* Cycle through view options */
-#define DIBUTTON_SPACESIM_DISPLAY 0x07004405 /* Select next dashboard / heads up display option */
-#define DIBUTTON_SPACESIM_RAISE 0x07004406 /* Raise ship while maintaining current pitch */
-#define DIBUTTON_SPACESIM_LOWER 0x07004407 /* Lower ship while maintaining current pitch */
-#define DIBUTTON_SPACESIM_GEAR 0x07004408 /* Gear up / down */
-#define DIBUTTON_SPACESIM_FIRESECONDARY 0x07004409 /* Alternative fire button */
-#define DIBUTTON_SPACESIM_LEFT_LINK 0x0700C4E4 /* Fallback move left button */
-#define DIBUTTON_SPACESIM_RIGHT_LINK 0x0700C4EC /* Fallback move right button */
-#define DIBUTTON_SPACESIM_FORWARD_LINK 0x070144E0 /* Fallback move forward button */
-#define DIBUTTON_SPACESIM_BACKWARD_LINK 0x070144E8 /* Fallback move backwards button */
-#define DIBUTTON_SPACESIM_FASTER_LINK 0x0703C4E0 /* Fallback throttle up button */
-#define DIBUTTON_SPACESIM_SLOWER_LINK 0x0703C4E8 /* Fallback throttle down button */
-#define DIBUTTON_SPACESIM_TURN_LEFT_LINK 0x070244E4 /* Fallback turn left button */
-#define DIBUTTON_SPACESIM_TURN_RIGHT_LINK 0x070244EC /* Fallback turn right button */
-#define DIBUTTON_SPACESIM_GLANCE_LEFT_LINK 0x0707C4E4 /* Fallback Glance Left button */
-#define DIBUTTON_SPACESIM_GLANCE_RIGHT_LINK 0x0707C4EC /* Fallback Glance Right button */
-#define DIBUTTON_SPACESIM_GLANCE_UP_LINK 0x0707C4E0 /* Fallback Glance Up button */
-#define DIBUTTON_SPACESIM_GLANCE_DOWN_LINK 0x0707C4E8 /* Fallback Glance Down button */
-#define DIBUTTON_SPACESIM_DEVICE 0x070044FE /* Show input device and controls */
-#define DIBUTTON_SPACESIM_PAUSE 0x070044FC /* Start / Pause / Restart game */
-
-/*--- Fighting - First Person
- Hand to Hand combat is primary objective ---*/
-#define DIVIRTUAL_FIGHTING_HAND2HAND 0x08000000
-#define DIAXIS_FIGHTINGH_LATERAL 0x08008201 /* Sidestep left/right */
-#define DIAXIS_FIGHTINGH_MOVE 0x08010202 /* Move forward/backward */
-#define DIBUTTON_FIGHTINGH_PUNCH 0x08000401 /* Punch */
-#define DIBUTTON_FIGHTINGH_KICK 0x08000402 /* Kick */
-#define DIBUTTON_FIGHTINGH_BLOCK 0x08000403 /* Block */
-#define DIBUTTON_FIGHTINGH_CROUCH 0x08000404 /* Crouch */
-#define DIBUTTON_FIGHTINGH_JUMP 0x08000405 /* Jump */
-#define DIBUTTON_FIGHTINGH_SPECIAL1 0x08000406 /* Apply first special move */
-#define DIBUTTON_FIGHTINGH_SPECIAL2 0x08000407 /* Apply second special move */
-#define DIBUTTON_FIGHTINGH_MENU 0x080004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_FIGHTINGH_SELECT 0x08004408 /* Select special move */
-#define DIHATSWITCH_FIGHTINGH_SLIDE 0x08004601 /* Look around */
-#define DIBUTTON_FIGHTINGH_DISPLAY 0x08004409 /* Shows next on-screen display option */
-#define DIAXIS_FIGHTINGH_ROTATE 0x08024203 /* Rotate - Turn body left/right */
-#define DIBUTTON_FIGHTINGH_DODGE 0x0800440A /* Dodge */
-#define DIBUTTON_FIGHTINGH_LEFT_LINK 0x0800C4E4 /* Fallback left sidestep button */
-#define DIBUTTON_FIGHTINGH_RIGHT_LINK 0x0800C4EC /* Fallback right sidestep button */
-#define DIBUTTON_FIGHTINGH_FORWARD_LINK 0x080144E0 /* Fallback forward button */
-#define DIBUTTON_FIGHTINGH_BACKWARD_LINK 0x080144E8 /* Fallback backward button */
-#define DIBUTTON_FIGHTINGH_DEVICE 0x080044FE /* Show input device and controls */
-#define DIBUTTON_FIGHTINGH_PAUSE 0x080044FC /* Start / Pause / Restart game */
-
-/*--- Fighting - First Person Shooting
- Navigation and combat are primary objectives ---*/
-#define DIVIRTUAL_FIGHTING_FPS 0x09000000
-#define DIAXIS_FPS_ROTATE 0x09008201 /* Rotate character left/right */
-#define DIAXIS_FPS_MOVE 0x09010202 /* Move forward/backward */
-#define DIBUTTON_FPS_FIRE 0x09000401 /* Fire */
-#define DIBUTTON_FPS_WEAPONS 0x09000402 /* Select next weapon */
-#define DIBUTTON_FPS_APPLY 0x09000403 /* Use item */
-#define DIBUTTON_FPS_SELECT 0x09000404 /* Select next inventory item */
-#define DIBUTTON_FPS_CROUCH 0x09000405 /* Crouch/ climb down/ swim down */
-#define DIBUTTON_FPS_JUMP 0x09000406 /* Jump/ climb up/ swim up */
-#define DIAXIS_FPS_LOOKUPDOWN 0x09018203 /* Look up / down */
-#define DIBUTTON_FPS_STRAFE 0x09000407 /* Enable strafing while active */
-#define DIBUTTON_FPS_MENU 0x090004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_FPS_GLANCE 0x09004601 /* Look around */
-#define DIBUTTON_FPS_DISPLAY 0x09004408 /* Shows next on-screen display option/ map */
-#define DIAXIS_FPS_SIDESTEP 0x09024204 /* Sidestep */
-#define DIBUTTON_FPS_DODGE 0x09004409 /* Dodge */
-#define DIBUTTON_FPS_GLANCEL 0x0900440A /* Glance Left */
-#define DIBUTTON_FPS_GLANCER 0x0900440B /* Glance Right */
-#define DIBUTTON_FPS_FIRESECONDARY 0x0900440C /* Alternative fire button */
-#define DIBUTTON_FPS_ROTATE_LEFT_LINK 0x0900C4E4 /* Fallback rotate left button */
-#define DIBUTTON_FPS_ROTATE_RIGHT_LINK 0x0900C4EC /* Fallback rotate right button */
-#define DIBUTTON_FPS_FORWARD_LINK 0x090144E0 /* Fallback forward button */
-#define DIBUTTON_FPS_BACKWARD_LINK 0x090144E8 /* Fallback backward button */
-#define DIBUTTON_FPS_GLANCE_UP_LINK 0x0901C4E0 /* Fallback look up button */
-#define DIBUTTON_FPS_GLANCE_DOWN_LINK 0x0901C4E8 /* Fallback look down button */
-#define DIBUTTON_FPS_STEP_LEFT_LINK 0x090244E4 /* Fallback step left button */
-#define DIBUTTON_FPS_STEP_RIGHT_LINK 0x090244EC /* Fallback step right button */
-#define DIBUTTON_FPS_DEVICE 0x090044FE /* Show input device and controls */
-#define DIBUTTON_FPS_PAUSE 0x090044FC /* Start / Pause / Restart game */
-
-/*--- Fighting - Third Person action
- Perspective of camera is behind the main character ---*/
-#define DIVIRTUAL_FIGHTING_THIRDPERSON 0x0A000000
-#define DIAXIS_TPS_TURN 0x0A020201 /* Turn left/right */
-#define DIAXIS_TPS_MOVE 0x0A010202 /* Move forward/backward */
-#define DIBUTTON_TPS_RUN 0x0A000401 /* Run or walk toggle switch */
-#define DIBUTTON_TPS_ACTION 0x0A000402 /* Action Button */
-#define DIBUTTON_TPS_SELECT 0x0A000403 /* Select next weapon */
-#define DIBUTTON_TPS_USE 0x0A000404 /* Use inventory item currently selected */
-#define DIBUTTON_TPS_JUMP 0x0A000405 /* Character Jumps */
-#define DIBUTTON_TPS_MENU 0x0A0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_TPS_GLANCE 0x0A004601 /* Look around */
-#define DIBUTTON_TPS_VIEW 0x0A004406 /* Select camera view */
-#define DIBUTTON_TPS_STEPLEFT 0x0A004407 /* Character takes a left step */
-#define DIBUTTON_TPS_STEPRIGHT 0x0A004408 /* Character takes a right step */
-#define DIAXIS_TPS_STEP 0x0A00C203 /* Character steps left/right */
-#define DIBUTTON_TPS_DODGE 0x0A004409 /* Character dodges or ducks */
-#define DIBUTTON_TPS_INVENTORY 0x0A00440A /* Cycle through inventory */
-#define DIBUTTON_TPS_TURN_LEFT_LINK 0x0A0244E4 /* Fallback turn left button */
-#define DIBUTTON_TPS_TURN_RIGHT_LINK 0x0A0244EC /* Fallback turn right button */
-#define DIBUTTON_TPS_FORWARD_LINK 0x0A0144E0 /* Fallback forward button */
-#define DIBUTTON_TPS_BACKWARD_LINK 0x0A0144E8 /* Fallback backward button */
-#define DIBUTTON_TPS_GLANCE_UP_LINK 0x0A07C4E0 /* Fallback look up button */
-#define DIBUTTON_TPS_GLANCE_DOWN_LINK 0x0A07C4E8 /* Fallback look down button */
-#define DIBUTTON_TPS_GLANCE_LEFT_LINK 0x0A07C4E4 /* Fallback glance up button */
-#define DIBUTTON_TPS_GLANCE_RIGHT_LINK 0x0A07C4EC /* Fallback glance right button */
-#define DIBUTTON_TPS_DEVICE 0x0A0044FE /* Show input device and controls */
-#define DIBUTTON_TPS_PAUSE 0x0A0044FC /* Start / Pause / Restart game */
-
-/*--- Strategy - Role Playing
- Navigation and problem solving are primary actions ---*/
-#define DIVIRTUAL_STRATEGY_ROLEPLAYING 0x0B000000
-#define DIAXIS_STRATEGYR_LATERAL 0x0B008201 /* sidestep - left/right */
-#define DIAXIS_STRATEGYR_MOVE 0x0B010202 /* move forward/backward */
-#define DIBUTTON_STRATEGYR_GET 0x0B000401 /* Acquire item */
-#define DIBUTTON_STRATEGYR_APPLY 0x0B000402 /* Use selected item */
-#define DIBUTTON_STRATEGYR_SELECT 0x0B000403 /* Select nextitem */
-#define DIBUTTON_STRATEGYR_ATTACK 0x0B000404 /* Attack */
-#define DIBUTTON_STRATEGYR_CAST 0x0B000405 /* Cast Spell */
-#define DIBUTTON_STRATEGYR_CROUCH 0x0B000406 /* Crouch */
-#define DIBUTTON_STRATEGYR_JUMP 0x0B000407 /* Jump */
-#define DIBUTTON_STRATEGYR_MENU 0x0B0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_STRATEGYR_GLANCE 0x0B004601 /* Look around */
-#define DIBUTTON_STRATEGYR_MAP 0x0B004408 /* Cycle through map options */
-#define DIBUTTON_STRATEGYR_DISPLAY 0x0B004409 /* Shows next on-screen display option */
-#define DIAXIS_STRATEGYR_ROTATE 0x0B024203 /* Turn body left/right */
-#define DIBUTTON_STRATEGYR_LEFT_LINK 0x0B00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_STRATEGYR_RIGHT_LINK 0x0B00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_STRATEGYR_FORWARD_LINK 0x0B0144E0 /* Fallback move forward button */
-#define DIBUTTON_STRATEGYR_BACK_LINK 0x0B0144E8 /* Fallback move backward button */
-#define DIBUTTON_STRATEGYR_ROTATE_LEFT_LINK 0x0B0244E4 /* Fallback turn body left button */
-#define DIBUTTON_STRATEGYR_ROTATE_RIGHT_LINK 0x0B0244EC /* Fallback turn body right button */
-#define DIBUTTON_STRATEGYR_DEVICE 0x0B0044FE /* Show input device and controls */
-#define DIBUTTON_STRATEGYR_PAUSE 0x0B0044FC /* Start / Pause / Restart game */
-
-/*--- Strategy - Turn based
- Navigation and problem solving are primary actions ---*/
-#define DIVIRTUAL_STRATEGY_TURN 0x0C000000
-#define DIAXIS_STRATEGYT_LATERAL 0x0C008201 /* Sidestep left/right */
-#define DIAXIS_STRATEGYT_MOVE 0x0C010202 /* Move forward/backwards */
-#define DIBUTTON_STRATEGYT_SELECT 0x0C000401 /* Select unit or object */
-#define DIBUTTON_STRATEGYT_INSTRUCT 0x0C000402 /* Cycle through instructions */
-#define DIBUTTON_STRATEGYT_APPLY 0x0C000403 /* Apply selected instruction */
-#define DIBUTTON_STRATEGYT_TEAM 0x0C000404 /* Select next team / cycle through all */
-#define DIBUTTON_STRATEGYT_TURN 0x0C000405 /* Indicate turn over */
-#define DIBUTTON_STRATEGYT_MENU 0x0C0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_STRATEGYT_ZOOM 0x0C004406 /* Zoom - in / out */
-#define DIBUTTON_STRATEGYT_MAP 0x0C004407 /* cycle through map options */
-#define DIBUTTON_STRATEGYT_DISPLAY 0x0C004408 /* shows next on-screen display options */
-#define DIBUTTON_STRATEGYT_LEFT_LINK 0x0C00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_STRATEGYT_RIGHT_LINK 0x0C00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_STRATEGYT_FORWARD_LINK 0x0C0144E0 /* Fallback move forward button */
-#define DIBUTTON_STRATEGYT_BACK_LINK 0x0C0144E8 /* Fallback move back button */
-#define DIBUTTON_STRATEGYT_DEVICE 0x0C0044FE /* Show input device and controls */
-#define DIBUTTON_STRATEGYT_PAUSE 0x0C0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Hunting
- Hunting ---*/
-#define DIVIRTUAL_SPORTS_HUNTING 0x0D000000
-#define DIAXIS_HUNTING_LATERAL 0x0D008201 /* sidestep left/right */
-#define DIAXIS_HUNTING_MOVE 0x0D010202 /* move forward/backwards */
-#define DIBUTTON_HUNTING_FIRE 0x0D000401 /* Fire selected weapon */
-#define DIBUTTON_HUNTING_AIM 0x0D000402 /* Select aim/move */
-#define DIBUTTON_HUNTING_WEAPON 0x0D000403 /* Select next weapon */
-#define DIBUTTON_HUNTING_BINOCULAR 0x0D000404 /* Look through Binoculars */
-#define DIBUTTON_HUNTING_CALL 0x0D000405 /* Make animal call */
-#define DIBUTTON_HUNTING_MAP 0x0D000406 /* View Map */
-#define DIBUTTON_HUNTING_SPECIAL 0x0D000407 /* Special game operation */
-#define DIBUTTON_HUNTING_MENU 0x0D0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_HUNTING_GLANCE 0x0D004601 /* Look around */
-#define DIBUTTON_HUNTING_DISPLAY 0x0D004408 /* show next on-screen display option */
-#define DIAXIS_HUNTING_ROTATE 0x0D024203 /* Turn body left/right */
-#define DIBUTTON_HUNTING_CROUCH 0x0D004409 /* Crouch/ Climb / Swim down */
-#define DIBUTTON_HUNTING_JUMP 0x0D00440A /* Jump/ Climb up / Swim up */
-#define DIBUTTON_HUNTING_FIRESECONDARY 0x0D00440B /* Alternative fire button */
-#define DIBUTTON_HUNTING_LEFT_LINK 0x0D00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_HUNTING_RIGHT_LINK 0x0D00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_HUNTING_FORWARD_LINK 0x0D0144E0 /* Fallback move forward button */
-#define DIBUTTON_HUNTING_BACK_LINK 0x0D0144E8 /* Fallback move back button */
-#define DIBUTTON_HUNTING_ROTATE_LEFT_LINK 0x0D0244E4 /* Fallback turn body left button */
-#define DIBUTTON_HUNTING_ROTATE_RIGHT_LINK 0x0D0244EC /* Fallback turn body right button */
-#define DIBUTTON_HUNTING_DEVICE 0x0D0044FE /* Show input device and controls */
-#define DIBUTTON_HUNTING_PAUSE 0x0D0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Fishing
- Catching Fish is primary objective ---*/
-#define DIVIRTUAL_SPORTS_FISHING 0x0E000000
-#define DIAXIS_FISHING_LATERAL 0x0E008201 /* sidestep left/right */
-#define DIAXIS_FISHING_MOVE 0x0E010202 /* move forward/backwards */
-#define DIBUTTON_FISHING_CAST 0x0E000401 /* Cast line */
-#define DIBUTTON_FISHING_TYPE 0x0E000402 /* Select cast type */
-#define DIBUTTON_FISHING_BINOCULAR 0x0E000403 /* Look through Binocular */
-#define DIBUTTON_FISHING_BAIT 0x0E000404 /* Select type of Bait */
-#define DIBUTTON_FISHING_MAP 0x0E000405 /* View Map */
-#define DIBUTTON_FISHING_MENU 0x0E0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_FISHING_GLANCE 0x0E004601 /* Look around */
-#define DIBUTTON_FISHING_DISPLAY 0x0E004406 /* Show next on-screen display option */
-#define DIAXIS_FISHING_ROTATE 0x0E024203 /* Turn character left / right */
-#define DIBUTTON_FISHING_CROUCH 0x0E004407 /* Crouch/ Climb / Swim down */
-#define DIBUTTON_FISHING_JUMP 0x0E004408 /* Jump/ Climb up / Swim up */
-#define DIBUTTON_FISHING_LEFT_LINK 0x0E00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_FISHING_RIGHT_LINK 0x0E00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_FISHING_FORWARD_LINK 0x0E0144E0 /* Fallback move forward button */
-#define DIBUTTON_FISHING_BACK_LINK 0x0E0144E8 /* Fallback move back button */
-#define DIBUTTON_FISHING_ROTATE_LEFT_LINK 0x0E0244E4 /* Fallback turn body left button */
-#define DIBUTTON_FISHING_ROTATE_RIGHT_LINK 0x0E0244EC /* Fallback turn body right button */
-#define DIBUTTON_FISHING_DEVICE 0x0E0044FE /* Show input device and controls */
-#define DIBUTTON_FISHING_PAUSE 0x0E0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Baseball - Batting
- Batter control is primary objective ---*/
-#define DIVIRTUAL_SPORTS_BASEBALL_BAT 0x0F000000
-#define DIAXIS_BASEBALLB_LATERAL 0x0F008201 /* Aim left / right */
-#define DIAXIS_BASEBALLB_MOVE 0x0F010202 /* Aim up / down */
-#define DIBUTTON_BASEBALLB_SELECT 0x0F000401 /* cycle through swing options */
-#define DIBUTTON_BASEBALLB_NORMAL 0x0F000402 /* normal swing */
-#define DIBUTTON_BASEBALLB_POWER 0x0F000403 /* swing for the fence */
-#define DIBUTTON_BASEBALLB_BUNT 0x0F000404 /* bunt */
-#define DIBUTTON_BASEBALLB_STEAL 0x0F000405 /* Base runner attempts to steal a base */
-#define DIBUTTON_BASEBALLB_BURST 0x0F000406 /* Base runner invokes burst of speed */
-#define DIBUTTON_BASEBALLB_SLIDE 0x0F000407 /* Base runner slides into base */
-#define DIBUTTON_BASEBALLB_CONTACT 0x0F000408 /* Contact swing */
-#define DIBUTTON_BASEBALLB_MENU 0x0F0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_BASEBALLB_NOSTEAL 0x0F004409 /* Base runner goes back to a base */
-#define DIBUTTON_BASEBALLB_BOX 0x0F00440A /* Enter or exit batting box */
-#define DIBUTTON_BASEBALLB_LEFT_LINK 0x0F00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_BASEBALLB_RIGHT_LINK 0x0F00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_BASEBALLB_FORWARD_LINK 0x0F0144E0 /* Fallback move forward button */
-#define DIBUTTON_BASEBALLB_BACK_LINK 0x0F0144E8 /* Fallback move back button */
-#define DIBUTTON_BASEBALLB_DEVICE 0x0F0044FE /* Show input device and controls */
-#define DIBUTTON_BASEBALLB_PAUSE 0x0F0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Baseball - Pitching
- Pitcher control is primary objective ---*/
-#define DIVIRTUAL_SPORTS_BASEBALL_PITCH 0x10000000
-#define DIAXIS_BASEBALLP_LATERAL 0x10008201 /* Aim left / right */
-#define DIAXIS_BASEBALLP_MOVE 0x10010202 /* Aim up / down */
-#define DIBUTTON_BASEBALLP_SELECT 0x10000401 /* cycle through pitch selections */
-#define DIBUTTON_BASEBALLP_PITCH 0x10000402 /* throw pitch */
-#define DIBUTTON_BASEBALLP_BASE 0x10000403 /* select base to throw to */
-#define DIBUTTON_BASEBALLP_THROW 0x10000404 /* throw to base */
-#define DIBUTTON_BASEBALLP_FAKE 0x10000405 /* Fake a throw to a base */
-#define DIBUTTON_BASEBALLP_MENU 0x100004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_BASEBALLP_WALK 0x10004406 /* Throw intentional walk / pitch out */
-#define DIBUTTON_BASEBALLP_LOOK 0x10004407 /* Look at runners on bases */
-#define DIBUTTON_BASEBALLP_LEFT_LINK 0x1000C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_BASEBALLP_RIGHT_LINK 0x1000C4EC /* Fallback sidestep right button */
-#define DIBUTTON_BASEBALLP_FORWARD_LINK 0x100144E0 /* Fallback move forward button */
-#define DIBUTTON_BASEBALLP_BACK_LINK 0x100144E8 /* Fallback move back button */
-#define DIBUTTON_BASEBALLP_DEVICE 0x100044FE /* Show input device and controls */
-#define DIBUTTON_BASEBALLP_PAUSE 0x100044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Baseball - Fielding
- Fielder control is primary objective ---*/
-#define DIVIRTUAL_SPORTS_BASEBALL_FIELD 0x11000000
-#define DIAXIS_BASEBALLF_LATERAL 0x11008201 /* Aim left / right */
-#define DIAXIS_BASEBALLF_MOVE 0x11010202 /* Aim up / down */
-#define DIBUTTON_BASEBALLF_NEAREST 0x11000401 /* Switch to fielder nearest to the ball */
-#define DIBUTTON_BASEBALLF_THROW1 0x11000402 /* Make conservative throw */
-#define DIBUTTON_BASEBALLF_THROW2 0x11000403 /* Make aggressive throw */
-#define DIBUTTON_BASEBALLF_BURST 0x11000404 /* Invoke burst of speed */
-#define DIBUTTON_BASEBALLF_JUMP 0x11000405 /* Jump to catch ball */
-#define DIBUTTON_BASEBALLF_DIVE 0x11000406 /* Dive to catch ball */
-#define DIBUTTON_BASEBALLF_MENU 0x110004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_BASEBALLF_SHIFTIN 0x11004407 /* Shift the infield positioning */
-#define DIBUTTON_BASEBALLF_SHIFTOUT 0x11004408 /* Shift the outfield positioning */
-#define DIBUTTON_BASEBALLF_AIM_LEFT_LINK 0x1100C4E4 /* Fallback aim left button */
-#define DIBUTTON_BASEBALLF_AIM_RIGHT_LINK 0x1100C4EC /* Fallback aim right button */
-#define DIBUTTON_BASEBALLF_FORWARD_LINK 0x110144E0 /* Fallback move forward button */
-#define DIBUTTON_BASEBALLF_BACK_LINK 0x110144E8 /* Fallback move back button */
-#define DIBUTTON_BASEBALLF_DEVICE 0x110044FE /* Show input device and controls */
-#define DIBUTTON_BASEBALLF_PAUSE 0x110044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Basketball - Offense
- Offense ---*/
-#define DIVIRTUAL_SPORTS_BASKETBALL_OFFENSE 0x12000000
-#define DIAXIS_BBALLO_LATERAL 0x12008201 /* left / right */
-#define DIAXIS_BBALLO_MOVE 0x12010202 /* up / down */
-#define DIBUTTON_BBALLO_SHOOT 0x12000401 /* shoot basket */
-#define DIBUTTON_BBALLO_DUNK 0x12000402 /* dunk basket */
-#define DIBUTTON_BBALLO_PASS 0x12000403 /* throw pass */
-#define DIBUTTON_BBALLO_FAKE 0x12000404 /* fake shot or pass */
-#define DIBUTTON_BBALLO_SPECIAL 0x12000405 /* apply special move */
-#define DIBUTTON_BBALLO_PLAYER 0x12000406 /* select next player */
-#define DIBUTTON_BBALLO_BURST 0x12000407 /* invoke burst */
-#define DIBUTTON_BBALLO_CALL 0x12000408 /* call for ball / pass to me */
-#define DIBUTTON_BBALLO_MENU 0x120004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_BBALLO_GLANCE 0x12004601 /* scroll view */
-#define DIBUTTON_BBALLO_SCREEN 0x12004409 /* Call for screen */
-#define DIBUTTON_BBALLO_PLAY 0x1200440A /* Call for specific offensive play */
-#define DIBUTTON_BBALLO_JAB 0x1200440B /* Initiate fake drive to basket */
-#define DIBUTTON_BBALLO_POST 0x1200440C /* Perform post move */
-#define DIBUTTON_BBALLO_TIMEOUT 0x1200440D /* Time Out */
-#define DIBUTTON_BBALLO_SUBSTITUTE 0x1200440E /* substitute one player for another */
-#define DIBUTTON_BBALLO_LEFT_LINK 0x1200C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_BBALLO_RIGHT_LINK 0x1200C4EC /* Fallback sidestep right button */
-#define DIBUTTON_BBALLO_FORWARD_LINK 0x120144E0 /* Fallback move forward button */
-#define DIBUTTON_BBALLO_BACK_LINK 0x120144E8 /* Fallback move back button */
-#define DIBUTTON_BBALLO_DEVICE 0x120044FE /* Show input device and controls */
-#define DIBUTTON_BBALLO_PAUSE 0x120044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Basketball - Defense
- Defense ---*/
-#define DIVIRTUAL_SPORTS_BASKETBALL_DEFENSE 0x13000000
-#define DIAXIS_BBALLD_LATERAL 0x13008201 /* left / right */
-#define DIAXIS_BBALLD_MOVE 0x13010202 /* up / down */
-#define DIBUTTON_BBALLD_JUMP 0x13000401 /* jump to block shot */
-#define DIBUTTON_BBALLD_STEAL 0x13000402 /* attempt to steal ball */
-#define DIBUTTON_BBALLD_FAKE 0x13000403 /* fake block or steal */
-#define DIBUTTON_BBALLD_SPECIAL 0x13000404 /* apply special move */
-#define DIBUTTON_BBALLD_PLAYER 0x13000405 /* select next player */
-#define DIBUTTON_BBALLD_BURST 0x13000406 /* invoke burst */
-#define DIBUTTON_BBALLD_PLAY 0x13000407 /* call for specific defensive play */
-#define DIBUTTON_BBALLD_MENU 0x130004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_BBALLD_GLANCE 0x13004601 /* scroll view */
-#define DIBUTTON_BBALLD_TIMEOUT 0x13004408 /* Time Out */
-#define DIBUTTON_BBALLD_SUBSTITUTE 0x13004409 /* substitute one player for another */
-#define DIBUTTON_BBALLD_LEFT_LINK 0x1300C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_BBALLD_RIGHT_LINK 0x1300C4EC /* Fallback sidestep right button */
-#define DIBUTTON_BBALLD_FORWARD_LINK 0x130144E0 /* Fallback move forward button */
-#define DIBUTTON_BBALLD_BACK_LINK 0x130144E8 /* Fallback move back button */
-#define DIBUTTON_BBALLD_DEVICE 0x130044FE /* Show input device and controls */
-#define DIBUTTON_BBALLD_PAUSE 0x130044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Football - Play
- Play selection ---*/
-#define DIVIRTUAL_SPORTS_FOOTBALL_FIELD 0x14000000
-#define DIBUTTON_FOOTBALLP_PLAY 0x14000401 /* cycle through available plays */
-#define DIBUTTON_FOOTBALLP_SELECT 0x14000402 /* select play */
-#define DIBUTTON_FOOTBALLP_HELP 0x14000403 /* Bring up pop-up help */
-#define DIBUTTON_FOOTBALLP_MENU 0x140004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_FOOTBALLP_DEVICE 0x140044FE /* Show input device and controls */
-#define DIBUTTON_FOOTBALLP_PAUSE 0x140044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Football - QB
- Offense: Quarterback / Kicker ---*/
-#define DIVIRTUAL_SPORTS_FOOTBALL_QBCK 0x15000000
-#define DIAXIS_FOOTBALLQ_LATERAL 0x15008201 /* Move / Aim: left / right */
-#define DIAXIS_FOOTBALLQ_MOVE 0x15010202 /* Move / Aim: up / down */
-#define DIBUTTON_FOOTBALLQ_SELECT 0x15000401 /* Select */
-#define DIBUTTON_FOOTBALLQ_SNAP 0x15000402 /* snap ball - start play */
-#define DIBUTTON_FOOTBALLQ_JUMP 0x15000403 /* jump over defender */
-#define DIBUTTON_FOOTBALLQ_SLIDE 0x15000404 /* Dive/Slide */
-#define DIBUTTON_FOOTBALLQ_PASS 0x15000405 /* throws pass to receiver */
-#define DIBUTTON_FOOTBALLQ_FAKE 0x15000406 /* pump fake pass or fake kick */
-#define DIBUTTON_FOOTBALLQ_MENU 0x150004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_FOOTBALLQ_FAKESNAP 0x15004407 /* Fake snap */
-#define DIBUTTON_FOOTBALLQ_MOTION 0x15004408 /* Send receivers in motion */
-#define DIBUTTON_FOOTBALLQ_AUDIBLE 0x15004409 /* Change offensive play at line of scrimmage */
-#define DIBUTTON_FOOTBALLQ_LEFT_LINK 0x1500C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_FOOTBALLQ_RIGHT_LINK 0x1500C4EC /* Fallback sidestep right button */
-#define DIBUTTON_FOOTBALLQ_FORWARD_LINK 0x150144E0 /* Fallback move forward button */
-#define DIBUTTON_FOOTBALLQ_BACK_LINK 0x150144E8 /* Fallback move back button */
-#define DIBUTTON_FOOTBALLQ_DEVICE 0x150044FE /* Show input device and controls */
-#define DIBUTTON_FOOTBALLQ_PAUSE 0x150044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Football - Offense
- Offense - Runner ---*/
-#define DIVIRTUAL_SPORTS_FOOTBALL_OFFENSE 0x16000000
-#define DIAXIS_FOOTBALLO_LATERAL 0x16008201 /* Move / Aim: left / right */
-#define DIAXIS_FOOTBALLO_MOVE 0x16010202 /* Move / Aim: up / down */
-#define DIBUTTON_FOOTBALLO_JUMP 0x16000401 /* jump or hurdle over defender */
-#define DIBUTTON_FOOTBALLO_LEFTARM 0x16000402 /* holds out left arm */
-#define DIBUTTON_FOOTBALLO_RIGHTARM 0x16000403 /* holds out right arm */
-#define DIBUTTON_FOOTBALLO_THROW 0x16000404 /* throw pass or lateral ball to another runner */
-#define DIBUTTON_FOOTBALLO_SPIN 0x16000405 /* Spin to avoid defenders */
-#define DIBUTTON_FOOTBALLO_MENU 0x160004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_FOOTBALLO_JUKE 0x16004406 /* Use special move to avoid defenders */
-#define DIBUTTON_FOOTBALLO_SHOULDER 0x16004407 /* Lower shoulder to run over defenders */
-#define DIBUTTON_FOOTBALLO_TURBO 0x16004408 /* Speed burst past defenders */
-#define DIBUTTON_FOOTBALLO_DIVE 0x16004409 /* Dive over defenders */
-#define DIBUTTON_FOOTBALLO_ZOOM 0x1600440A /* Zoom view in / out */
-#define DIBUTTON_FOOTBALLO_SUBSTITUTE 0x1600440B /* substitute one player for another */
-#define DIBUTTON_FOOTBALLO_LEFT_LINK 0x1600C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_FOOTBALLO_RIGHT_LINK 0x1600C4EC /* Fallback sidestep right button */
-#define DIBUTTON_FOOTBALLO_FORWARD_LINK 0x160144E0 /* Fallback move forward button */
-#define DIBUTTON_FOOTBALLO_BACK_LINK 0x160144E8 /* Fallback move back button */
-#define DIBUTTON_FOOTBALLO_DEVICE 0x160044FE /* Show input device and controls */
-#define DIBUTTON_FOOTBALLO_PAUSE 0x160044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Football - Defense
- Defense ---*/
-#define DIVIRTUAL_SPORTS_FOOTBALL_DEFENSE 0x17000000
-#define DIAXIS_FOOTBALLD_LATERAL 0x17008201 /* Move / Aim: left / right */
-#define DIAXIS_FOOTBALLD_MOVE 0x17010202 /* Move / Aim: up / down */
-#define DIBUTTON_FOOTBALLD_PLAY 0x17000401 /* cycle through available plays */
-#define DIBUTTON_FOOTBALLD_SELECT 0x17000402 /* select player closest to the ball */
-#define DIBUTTON_FOOTBALLD_JUMP 0x17000403 /* jump to intercept or block */
-#define DIBUTTON_FOOTBALLD_TACKLE 0x17000404 /* tackler runner */
-#define DIBUTTON_FOOTBALLD_FAKE 0x17000405 /* hold down to fake tackle or intercept */
-#define DIBUTTON_FOOTBALLD_SUPERTACKLE 0x17000406 /* Initiate special tackle */
-#define DIBUTTON_FOOTBALLD_MENU 0x170004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_FOOTBALLD_SPIN 0x17004407 /* Spin to beat offensive line */
-#define DIBUTTON_FOOTBALLD_SWIM 0x17004408 /* Swim to beat the offensive line */
-#define DIBUTTON_FOOTBALLD_BULLRUSH 0x17004409 /* Bull rush the offensive line */
-#define DIBUTTON_FOOTBALLD_RIP 0x1700440A /* Rip the offensive line */
-#define DIBUTTON_FOOTBALLD_AUDIBLE 0x1700440B /* Change defensive play at the line of scrimmage */
-#define DIBUTTON_FOOTBALLD_ZOOM 0x1700440C /* Zoom view in / out */
-#define DIBUTTON_FOOTBALLD_SUBSTITUTE 0x1700440D /* substitute one player for another */
-#define DIBUTTON_FOOTBALLD_LEFT_LINK 0x1700C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_FOOTBALLD_RIGHT_LINK 0x1700C4EC /* Fallback sidestep right button */
-#define DIBUTTON_FOOTBALLD_FORWARD_LINK 0x170144E0 /* Fallback move forward button */
-#define DIBUTTON_FOOTBALLD_BACK_LINK 0x170144E8 /* Fallback move back button */
-#define DIBUTTON_FOOTBALLD_DEVICE 0x170044FE /* Show input device and controls */
-#define DIBUTTON_FOOTBALLD_PAUSE 0x170044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Golf
- ---*/
-#define DIVIRTUAL_SPORTS_GOLF 0x18000000
-#define DIAXIS_GOLF_LATERAL 0x18008201 /* Move / Aim: left / right */
-#define DIAXIS_GOLF_MOVE 0x18010202 /* Move / Aim: up / down */
-#define DIBUTTON_GOLF_SWING 0x18000401 /* swing club */
-#define DIBUTTON_GOLF_SELECT 0x18000402 /* cycle between: club / swing strength / ball arc / ball spin */
-#define DIBUTTON_GOLF_UP 0x18000403 /* increase selection */
-#define DIBUTTON_GOLF_DOWN 0x18000404 /* decrease selection */
-#define DIBUTTON_GOLF_TERRAIN 0x18000405 /* shows terrain detail */
-#define DIBUTTON_GOLF_FLYBY 0x18000406 /* view the hole via a flyby */
-#define DIBUTTON_GOLF_MENU 0x180004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_GOLF_SCROLL 0x18004601 /* scroll view */
-#define DIBUTTON_GOLF_ZOOM 0x18004407 /* Zoom view in / out */
-#define DIBUTTON_GOLF_TIMEOUT 0x18004408 /* Call for time out */
-#define DIBUTTON_GOLF_SUBSTITUTE 0x18004409 /* substitute one player for another */
-#define DIBUTTON_GOLF_LEFT_LINK 0x1800C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_GOLF_RIGHT_LINK 0x1800C4EC /* Fallback sidestep right button */
-#define DIBUTTON_GOLF_FORWARD_LINK 0x180144E0 /* Fallback move forward button */
-#define DIBUTTON_GOLF_BACK_LINK 0x180144E8 /* Fallback move back button */
-#define DIBUTTON_GOLF_DEVICE 0x180044FE /* Show input device and controls */
-#define DIBUTTON_GOLF_PAUSE 0x180044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Hockey - Offense
- Offense ---*/
-#define DIVIRTUAL_SPORTS_HOCKEY_OFFENSE 0x19000000
-#define DIAXIS_HOCKEYO_LATERAL 0x19008201 /* Move / Aim: left / right */
-#define DIAXIS_HOCKEYO_MOVE 0x19010202 /* Move / Aim: up / down */
-#define DIBUTTON_HOCKEYO_SHOOT 0x19000401 /* Shoot */
-#define DIBUTTON_HOCKEYO_PASS 0x19000402 /* pass the puck */
-#define DIBUTTON_HOCKEYO_BURST 0x19000403 /* invoke speed burst */
-#define DIBUTTON_HOCKEYO_SPECIAL 0x19000404 /* invoke special move */
-#define DIBUTTON_HOCKEYO_FAKE 0x19000405 /* hold down to fake pass or kick */
-#define DIBUTTON_HOCKEYO_MENU 0x190004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_HOCKEYO_SCROLL 0x19004601 /* scroll view */
-#define DIBUTTON_HOCKEYO_ZOOM 0x19004406 /* Zoom view in / out */
-#define DIBUTTON_HOCKEYO_STRATEGY 0x19004407 /* Invoke coaching menu for strategy help */
-#define DIBUTTON_HOCKEYO_TIMEOUT 0x19004408 /* Call for time out */
-#define DIBUTTON_HOCKEYO_SUBSTITUTE 0x19004409 /* substitute one player for another */
-#define DIBUTTON_HOCKEYO_LEFT_LINK 0x1900C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_HOCKEYO_RIGHT_LINK 0x1900C4EC /* Fallback sidestep right button */
-#define DIBUTTON_HOCKEYO_FORWARD_LINK 0x190144E0 /* Fallback move forward button */
-#define DIBUTTON_HOCKEYO_BACK_LINK 0x190144E8 /* Fallback move back button */
-#define DIBUTTON_HOCKEYO_DEVICE 0x190044FE /* Show input device and controls */
-#define DIBUTTON_HOCKEYO_PAUSE 0x190044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Hockey - Defense
- Defense ---*/
-#define DIVIRTUAL_SPORTS_HOCKEY_DEFENSE 0x1A000000
-#define DIAXIS_HOCKEYD_LATERAL 0x1A008201 /* Move / Aim: left / right */
-#define DIAXIS_HOCKEYD_MOVE 0x1A010202 /* Move / Aim: up / down */
-#define DIBUTTON_HOCKEYD_PLAYER 0x1A000401 /* control player closest to the puck */
-#define DIBUTTON_HOCKEYD_STEAL 0x1A000402 /* attempt steal */
-#define DIBUTTON_HOCKEYD_BURST 0x1A000403 /* speed burst or body check */
-#define DIBUTTON_HOCKEYD_BLOCK 0x1A000404 /* block puck */
-#define DIBUTTON_HOCKEYD_FAKE 0x1A000405 /* hold down to fake tackle or intercept */
-#define DIBUTTON_HOCKEYD_MENU 0x1A0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_HOCKEYD_SCROLL 0x1A004601 /* scroll view */
-#define DIBUTTON_HOCKEYD_ZOOM 0x1A004406 /* Zoom view in / out */
-#define DIBUTTON_HOCKEYD_STRATEGY 0x1A004407 /* Invoke coaching menu for strategy help */
-#define DIBUTTON_HOCKEYD_TIMEOUT 0x1A004408 /* Call for time out */
-#define DIBUTTON_HOCKEYD_SUBSTITUTE 0x1A004409 /* substitute one player for another */
-#define DIBUTTON_HOCKEYD_LEFT_LINK 0x1A00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_HOCKEYD_RIGHT_LINK 0x1A00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_HOCKEYD_FORWARD_LINK 0x1A0144E0 /* Fallback move forward button */
-#define DIBUTTON_HOCKEYD_BACK_LINK 0x1A0144E8 /* Fallback move back button */
-#define DIBUTTON_HOCKEYD_DEVICE 0x1A0044FE /* Show input device and controls */
-#define DIBUTTON_HOCKEYD_PAUSE 0x1A0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Hockey - Goalie
- Goal tending ---*/
-#define DIVIRTUAL_SPORTS_HOCKEY_GOALIE 0x1B000000
-#define DIAXIS_HOCKEYG_LATERAL 0x1B008201 /* Move / Aim: left / right */
-#define DIAXIS_HOCKEYG_MOVE 0x1B010202 /* Move / Aim: up / down */
-#define DIBUTTON_HOCKEYG_PASS 0x1B000401 /* pass puck */
-#define DIBUTTON_HOCKEYG_POKE 0x1B000402 /* poke / check / hack */
-#define DIBUTTON_HOCKEYG_STEAL 0x1B000403 /* attempt steal */
-#define DIBUTTON_HOCKEYG_BLOCK 0x1B000404 /* block puck */
-#define DIBUTTON_HOCKEYG_MENU 0x1B0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_HOCKEYG_SCROLL 0x1B004601 /* scroll view */
-#define DIBUTTON_HOCKEYG_ZOOM 0x1B004405 /* Zoom view in / out */
-#define DIBUTTON_HOCKEYG_STRATEGY 0x1B004406 /* Invoke coaching menu for strategy help */
-#define DIBUTTON_HOCKEYG_TIMEOUT 0x1B004407 /* Call for time out */
-#define DIBUTTON_HOCKEYG_SUBSTITUTE 0x1B004408 /* substitute one player for another */
-#define DIBUTTON_HOCKEYG_LEFT_LINK 0x1B00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_HOCKEYG_RIGHT_LINK 0x1B00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_HOCKEYG_FORWARD_LINK 0x1B0144E0 /* Fallback move forward button */
-#define DIBUTTON_HOCKEYG_BACK_LINK 0x1B0144E8 /* Fallback move back button */
-#define DIBUTTON_HOCKEYG_DEVICE 0x1B0044FE /* Show input device and controls */
-#define DIBUTTON_HOCKEYG_PAUSE 0x1B0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Mountain Biking
- ---*/
-#define DIVIRTUAL_SPORTS_BIKING_MOUNTAIN 0x1C000000
-#define DIAXIS_BIKINGM_TURN 0x1C008201 /* left / right */
-#define DIAXIS_BIKINGM_PEDAL 0x1C010202 /* Pedal faster / slower / brake */
-#define DIBUTTON_BIKINGM_JUMP 0x1C000401 /* jump over obstacle */
-#define DIBUTTON_BIKINGM_CAMERA 0x1C000402 /* switch camera view */
-#define DIBUTTON_BIKINGM_SPECIAL1 0x1C000403 /* perform first special move */
-#define DIBUTTON_BIKINGM_SELECT 0x1C000404 /* Select */
-#define DIBUTTON_BIKINGM_SPECIAL2 0x1C000405 /* perform second special move */
-#define DIBUTTON_BIKINGM_MENU 0x1C0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_BIKINGM_SCROLL 0x1C004601 /* scroll view */
-#define DIBUTTON_BIKINGM_ZOOM 0x1C004406 /* Zoom view in / out */
-#define DIAXIS_BIKINGM_BRAKE 0x1C044203 /* Brake axis */
-#define DIBUTTON_BIKINGM_LEFT_LINK 0x1C00C4E4 /* Fallback turn left button */
-#define DIBUTTON_BIKINGM_RIGHT_LINK 0x1C00C4EC /* Fallback turn right button */
-#define DIBUTTON_BIKINGM_FASTER_LINK 0x1C0144E0 /* Fallback pedal faster button */
-#define DIBUTTON_BIKINGM_SLOWER_LINK 0x1C0144E8 /* Fallback pedal slower button */
-#define DIBUTTON_BIKINGM_BRAKE_BUTTON_LINK 0x1C0444E8 /* Fallback brake button */
-#define DIBUTTON_BIKINGM_DEVICE 0x1C0044FE /* Show input device and controls */
-#define DIBUTTON_BIKINGM_PAUSE 0x1C0044FC /* Start / Pause / Restart game */
-
-/*--- Sports: Skiing / Snowboarding / Skateboarding
- ---*/
-#define DIVIRTUAL_SPORTS_SKIING 0x1D000000
-#define DIAXIS_SKIING_TURN 0x1D008201 /* left / right */
-#define DIAXIS_SKIING_SPEED 0x1D010202 /* faster / slower */
-#define DIBUTTON_SKIING_JUMP 0x1D000401 /* Jump */
-#define DIBUTTON_SKIING_CROUCH 0x1D000402 /* crouch down */
-#define DIBUTTON_SKIING_CAMERA 0x1D000403 /* switch camera view */
-#define DIBUTTON_SKIING_SPECIAL1 0x1D000404 /* perform first special move */
-#define DIBUTTON_SKIING_SELECT 0x1D000405 /* Select */
-#define DIBUTTON_SKIING_SPECIAL2 0x1D000406 /* perform second special move */
-#define DIBUTTON_SKIING_MENU 0x1D0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_SKIING_GLANCE 0x1D004601 /* scroll view */
-#define DIBUTTON_SKIING_ZOOM 0x1D004407 /* Zoom view in / out */
-#define DIBUTTON_SKIING_LEFT_LINK 0x1D00C4E4 /* Fallback turn left button */
-#define DIBUTTON_SKIING_RIGHT_LINK 0x1D00C4EC /* Fallback turn right button */
-#define DIBUTTON_SKIING_FASTER_LINK 0x1D0144E0 /* Fallback increase speed button */
-#define DIBUTTON_SKIING_SLOWER_LINK 0x1D0144E8 /* Fallback decrease speed button */
-#define DIBUTTON_SKIING_DEVICE 0x1D0044FE /* Show input device and controls */
-#define DIBUTTON_SKIING_PAUSE 0x1D0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Soccer - Offense
- Offense ---*/
-#define DIVIRTUAL_SPORTS_SOCCER_OFFENSE 0x1E000000
-#define DIAXIS_SOCCERO_LATERAL 0x1E008201 /* Move / Aim: left / right */
-#define DIAXIS_SOCCERO_MOVE 0x1E010202 /* Move / Aim: up / down */
-#define DIAXIS_SOCCERO_BEND 0x1E018203 /* Bend to soccer shot/pass */
-#define DIBUTTON_SOCCERO_SHOOT 0x1E000401 /* Shoot the ball */
-#define DIBUTTON_SOCCERO_PASS 0x1E000402 /* Pass */
-#define DIBUTTON_SOCCERO_FAKE 0x1E000403 /* Fake */
-#define DIBUTTON_SOCCERO_PLAYER 0x1E000404 /* Select next player */
-#define DIBUTTON_SOCCERO_SPECIAL1 0x1E000405 /* Apply special move */
-#define DIBUTTON_SOCCERO_SELECT 0x1E000406 /* Select special move */
-#define DIBUTTON_SOCCERO_MENU 0x1E0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_SOCCERO_GLANCE 0x1E004601 /* scroll view */
-#define DIBUTTON_SOCCERO_SUBSTITUTE 0x1E004407 /* Substitute one player for another */
-#define DIBUTTON_SOCCERO_SHOOTLOW 0x1E004408 /* Shoot the ball low */
-#define DIBUTTON_SOCCERO_SHOOTHIGH 0x1E004409 /* Shoot the ball high */
-#define DIBUTTON_SOCCERO_PASSTHRU 0x1E00440A /* Make a thru pass */
-#define DIBUTTON_SOCCERO_SPRINT 0x1E00440B /* Sprint / turbo boost */
-#define DIBUTTON_SOCCERO_CONTROL 0x1E00440C /* Obtain control of the ball */
-#define DIBUTTON_SOCCERO_HEAD 0x1E00440D /* Attempt to head the ball */
-#define DIBUTTON_SOCCERO_LEFT_LINK 0x1E00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_SOCCERO_RIGHT_LINK 0x1E00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_SOCCERO_FORWARD_LINK 0x1E0144E0 /* Fallback move forward button */
-#define DIBUTTON_SOCCERO_BACK_LINK 0x1E0144E8 /* Fallback move back button */
-#define DIBUTTON_SOCCERO_DEVICE 0x1E0044FE /* Show input device and controls */
-#define DIBUTTON_SOCCERO_PAUSE 0x1E0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Soccer - Defense
- Defense ---*/
-#define DIVIRTUAL_SPORTS_SOCCER_DEFENSE 0x1F000000
-#define DIAXIS_SOCCERD_LATERAL 0x1F008201 /* Move / Aim: left / right */
-#define DIAXIS_SOCCERD_MOVE 0x1F010202 /* Move / Aim: up / down */
-#define DIBUTTON_SOCCERD_BLOCK 0x1F000401 /* Attempt to block shot */
-#define DIBUTTON_SOCCERD_STEAL 0x1F000402 /* Attempt to steal ball */
-#define DIBUTTON_SOCCERD_FAKE 0x1F000403 /* Fake a block or a steal */
-#define DIBUTTON_SOCCERD_PLAYER 0x1F000404 /* Select next player */
-#define DIBUTTON_SOCCERD_SPECIAL 0x1F000405 /* Apply special move */
-#define DIBUTTON_SOCCERD_SELECT 0x1F000406 /* Select special move */
-#define DIBUTTON_SOCCERD_SLIDE 0x1F000407 /* Attempt a slide tackle */
-#define DIBUTTON_SOCCERD_MENU 0x1F0004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_SOCCERD_GLANCE 0x1F004601 /* scroll view */
-#define DIBUTTON_SOCCERD_FOUL 0x1F004408 /* Initiate a foul / hard-foul */
-#define DIBUTTON_SOCCERD_HEAD 0x1F004409 /* Attempt a Header */
-#define DIBUTTON_SOCCERD_CLEAR 0x1F00440A /* Attempt to clear the ball down the field */
-#define DIBUTTON_SOCCERD_GOALIECHARGE 0x1F00440B /* Make the goalie charge out of the box */
-#define DIBUTTON_SOCCERD_SUBSTITUTE 0x1F00440C /* Substitute one player for another */
-#define DIBUTTON_SOCCERD_LEFT_LINK 0x1F00C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_SOCCERD_RIGHT_LINK 0x1F00C4EC /* Fallback sidestep right button */
-#define DIBUTTON_SOCCERD_FORWARD_LINK 0x1F0144E0 /* Fallback move forward button */
-#define DIBUTTON_SOCCERD_BACK_LINK 0x1F0144E8 /* Fallback move back button */
-#define DIBUTTON_SOCCERD_DEVICE 0x1F0044FE /* Show input device and controls */
-#define DIBUTTON_SOCCERD_PAUSE 0x1F0044FC /* Start / Pause / Restart game */
-
-/*--- Sports - Racquet
- Tennis - Table-Tennis - Squash ---*/
-#define DIVIRTUAL_SPORTS_RACQUET 0x20000000
-#define DIAXIS_RACQUET_LATERAL 0x20008201 /* Move / Aim: left / right */
-#define DIAXIS_RACQUET_MOVE 0x20010202 /* Move / Aim: up / down */
-#define DIBUTTON_RACQUET_SWING 0x20000401 /* Swing racquet */
-#define DIBUTTON_RACQUET_BACKSWING 0x20000402 /* Swing backhand */
-#define DIBUTTON_RACQUET_SMASH 0x20000403 /* Smash shot */
-#define DIBUTTON_RACQUET_SPECIAL 0x20000404 /* Special shot */
-#define DIBUTTON_RACQUET_SELECT 0x20000405 /* Select special shot */
-#define DIBUTTON_RACQUET_MENU 0x200004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_RACQUET_GLANCE 0x20004601 /* scroll view */
-#define DIBUTTON_RACQUET_TIMEOUT 0x20004406 /* Call for time out */
-#define DIBUTTON_RACQUET_SUBSTITUTE 0x20004407 /* Substitute one player for another */
-#define DIBUTTON_RACQUET_LEFT_LINK 0x2000C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_RACQUET_RIGHT_LINK 0x2000C4EC /* Fallback sidestep right button */
-#define DIBUTTON_RACQUET_FORWARD_LINK 0x200144E0 /* Fallback move forward button */
-#define DIBUTTON_RACQUET_BACK_LINK 0x200144E8 /* Fallback move back button */
-#define DIBUTTON_RACQUET_DEVICE 0x200044FE /* Show input device and controls */
-#define DIBUTTON_RACQUET_PAUSE 0x200044FC /* Start / Pause / Restart game */
-
-/*--- Arcade- 2D
- Side to Side movement ---*/
-#define DIVIRTUAL_ARCADE_SIDE2SIDE 0x21000000
-#define DIAXIS_ARCADES_LATERAL 0x21008201 /* left / right */
-#define DIAXIS_ARCADES_MOVE 0x21010202 /* up / down */
-#define DIBUTTON_ARCADES_THROW 0x21000401 /* throw object */
-#define DIBUTTON_ARCADES_CARRY 0x21000402 /* carry object */
-#define DIBUTTON_ARCADES_ATTACK 0x21000403 /* attack */
-#define DIBUTTON_ARCADES_SPECIAL 0x21000404 /* apply special move */
-#define DIBUTTON_ARCADES_SELECT 0x21000405 /* select special move */
-#define DIBUTTON_ARCADES_MENU 0x210004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_ARCADES_VIEW 0x21004601 /* scroll view left / right / up / down */
-#define DIBUTTON_ARCADES_LEFT_LINK 0x2100C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_ARCADES_RIGHT_LINK 0x2100C4EC /* Fallback sidestep right button */
-#define DIBUTTON_ARCADES_FORWARD_LINK 0x210144E0 /* Fallback move forward button */
-#define DIBUTTON_ARCADES_BACK_LINK 0x210144E8 /* Fallback move back button */
-#define DIBUTTON_ARCADES_VIEW_UP_LINK 0x2107C4E0 /* Fallback scroll view up button */
-#define DIBUTTON_ARCADES_VIEW_DOWN_LINK 0x2107C4E8 /* Fallback scroll view down button */
-#define DIBUTTON_ARCADES_VIEW_LEFT_LINK 0x2107C4E4 /* Fallback scroll view left button */
-#define DIBUTTON_ARCADES_VIEW_RIGHT_LINK 0x2107C4EC /* Fallback scroll view right button */
-#define DIBUTTON_ARCADES_DEVICE 0x210044FE /* Show input device and controls */
-#define DIBUTTON_ARCADES_PAUSE 0x210044FC /* Start / Pause / Restart game */
-
-/*--- Arcade - Platform Game
- Character moves around on screen ---*/
-#define DIVIRTUAL_ARCADE_PLATFORM 0x22000000
-#define DIAXIS_ARCADEP_LATERAL 0x22008201 /* Left / right */
-#define DIAXIS_ARCADEP_MOVE 0x22010202 /* Up / down */
-#define DIBUTTON_ARCADEP_JUMP 0x22000401 /* Jump */
-#define DIBUTTON_ARCADEP_FIRE 0x22000402 /* Fire */
-#define DIBUTTON_ARCADEP_CROUCH 0x22000403 /* Crouch */
-#define DIBUTTON_ARCADEP_SPECIAL 0x22000404 /* Apply special move */
-#define DIBUTTON_ARCADEP_SELECT 0x22000405 /* Select special move */
-#define DIBUTTON_ARCADEP_MENU 0x220004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_ARCADEP_VIEW 0x22004601 /* Scroll view */
-#define DIBUTTON_ARCADEP_FIRESECONDARY 0x22004406 /* Alternative fire button */
-#define DIBUTTON_ARCADEP_LEFT_LINK 0x2200C4E4 /* Fallback sidestep left button */
-#define DIBUTTON_ARCADEP_RIGHT_LINK 0x2200C4EC /* Fallback sidestep right button */
-#define DIBUTTON_ARCADEP_FORWARD_LINK 0x220144E0 /* Fallback move forward button */
-#define DIBUTTON_ARCADEP_BACK_LINK 0x220144E8 /* Fallback move back button */
-#define DIBUTTON_ARCADEP_VIEW_UP_LINK 0x2207C4E0 /* Fallback scroll view up button */
-#define DIBUTTON_ARCADEP_VIEW_DOWN_LINK 0x2207C4E8 /* Fallback scroll view down button */
-#define DIBUTTON_ARCADEP_VIEW_LEFT_LINK 0x2207C4E4 /* Fallback scroll view left button */
-#define DIBUTTON_ARCADEP_VIEW_RIGHT_LINK 0x2207C4EC /* Fallback scroll view right button */
-#define DIBUTTON_ARCADEP_DEVICE 0x220044FE /* Show input device and controls */
-#define DIBUTTON_ARCADEP_PAUSE 0x220044FC /* Start / Pause / Restart game */
-
-/*--- CAD - 2D Object Control
- Controls to select and move objects in 2D ---*/
-#define DIVIRTUAL_CAD_2DCONTROL 0x23000000
-#define DIAXIS_2DCONTROL_LATERAL 0x23008201 /* Move view left / right */
-#define DIAXIS_2DCONTROL_MOVE 0x23010202 /* Move view up / down */
-#define DIAXIS_2DCONTROL_INOUT 0x23018203 /* Zoom - in / out */
-#define DIBUTTON_2DCONTROL_SELECT 0x23000401 /* Select Object */
-#define DIBUTTON_2DCONTROL_SPECIAL1 0x23000402 /* Do first special operation */
-#define DIBUTTON_2DCONTROL_SPECIAL 0x23000403 /* Select special operation */
-#define DIBUTTON_2DCONTROL_SPECIAL2 0x23000404 /* Do second special operation */
-#define DIBUTTON_2DCONTROL_MENU 0x230004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_2DCONTROL_HATSWITCH 0x23004601 /* Hat switch */
-#define DIAXIS_2DCONTROL_ROTATEZ 0x23024204 /* Rotate view clockwise / counterclockwise */
-#define DIBUTTON_2DCONTROL_DISPLAY 0x23004405 /* Shows next on-screen display options */
-#define DIBUTTON_2DCONTROL_DEVICE 0x230044FE /* Show input device and controls */
-#define DIBUTTON_2DCONTROL_PAUSE 0x230044FC /* Start / Pause / Restart game */
-
-/*--- CAD - 3D object control
- Controls to select and move objects within a 3D environment ---*/
-#define DIVIRTUAL_CAD_3DCONTROL 0x24000000
-#define DIAXIS_3DCONTROL_LATERAL 0x24008201 /* Move view left / right */
-#define DIAXIS_3DCONTROL_MOVE 0x24010202 /* Move view up / down */
-#define DIAXIS_3DCONTROL_INOUT 0x24018203 /* Zoom - in / out */
-#define DIBUTTON_3DCONTROL_SELECT 0x24000401 /* Select Object */
-#define DIBUTTON_3DCONTROL_SPECIAL1 0x24000402 /* Do first special operation */
-#define DIBUTTON_3DCONTROL_SPECIAL 0x24000403 /* Select special operation */
-#define DIBUTTON_3DCONTROL_SPECIAL2 0x24000404 /* Do second special operation */
-#define DIBUTTON_3DCONTROL_MENU 0x240004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_3DCONTROL_HATSWITCH 0x24004601 /* Hat switch */
-#define DIAXIS_3DCONTROL_ROTATEX 0x24034204 /* Rotate view forward or up / backward or down */
-#define DIAXIS_3DCONTROL_ROTATEY 0x2402C205 /* Rotate view clockwise / counterclockwise */
-#define DIAXIS_3DCONTROL_ROTATEZ 0x24024206 /* Rotate view left / right */
-#define DIBUTTON_3DCONTROL_DISPLAY 0x24004405 /* Show next on-screen display options */
-#define DIBUTTON_3DCONTROL_DEVICE 0x240044FE /* Show input device and controls */
-#define DIBUTTON_3DCONTROL_PAUSE 0x240044FC /* Start / Pause / Restart game */
-
-/*--- CAD - 3D Navigation - Fly through
- Controls for 3D modeling ---*/
-#define DIVIRTUAL_CAD_FLYBY 0x25000000
-#define DIAXIS_CADF_LATERAL 0x25008201 /* move view left / right */
-#define DIAXIS_CADF_MOVE 0x25010202 /* move view up / down */
-#define DIAXIS_CADF_INOUT 0x25018203 /* in / out */
-#define DIBUTTON_CADF_SELECT 0x25000401 /* Select Object */
-#define DIBUTTON_CADF_SPECIAL1 0x25000402 /* do first special operation */
-#define DIBUTTON_CADF_SPECIAL 0x25000403 /* Select special operation */
-#define DIBUTTON_CADF_SPECIAL2 0x25000404 /* do second special operation */
-#define DIBUTTON_CADF_MENU 0x250004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_CADF_HATSWITCH 0x25004601 /* Hat switch */
-#define DIAXIS_CADF_ROTATEX 0x25034204 /* Rotate view forward or up / backward or down */
-#define DIAXIS_CADF_ROTATEY 0x2502C205 /* Rotate view clockwise / counterclockwise */
-#define DIAXIS_CADF_ROTATEZ 0x25024206 /* Rotate view left / right */
-#define DIBUTTON_CADF_DISPLAY 0x25004405 /* shows next on-screen display options */
-#define DIBUTTON_CADF_DEVICE 0x250044FE /* Show input device and controls */
-#define DIBUTTON_CADF_PAUSE 0x250044FC /* Start / Pause / Restart game */
-
-/*--- CAD - 3D Model Control
- Controls for 3D modeling ---*/
-#define DIVIRTUAL_CAD_MODEL 0x26000000
-#define DIAXIS_CADM_LATERAL 0x26008201 /* move view left / right */
-#define DIAXIS_CADM_MOVE 0x26010202 /* move view up / down */
-#define DIAXIS_CADM_INOUT 0x26018203 /* in / out */
-#define DIBUTTON_CADM_SELECT 0x26000401 /* Select Object */
-#define DIBUTTON_CADM_SPECIAL1 0x26000402 /* do first special operation */
-#define DIBUTTON_CADM_SPECIAL 0x26000403 /* Select special operation */
-#define DIBUTTON_CADM_SPECIAL2 0x26000404 /* do second special operation */
-#define DIBUTTON_CADM_MENU 0x260004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIHATSWITCH_CADM_HATSWITCH 0x26004601 /* Hat switch */
-#define DIAXIS_CADM_ROTATEX 0x26034204 /* Rotate view forward or up / backward or down */
-#define DIAXIS_CADM_ROTATEY 0x2602C205 /* Rotate view clockwise / counterclockwise */
-#define DIAXIS_CADM_ROTATEZ 0x26024206 /* Rotate view left / right */
-#define DIBUTTON_CADM_DISPLAY 0x26004405 /* shows next on-screen display options */
-#define DIBUTTON_CADM_DEVICE 0x260044FE /* Show input device and controls */
-#define DIBUTTON_CADM_PAUSE 0x260044FC /* Start / Pause / Restart game */
-
-/*--- Control - Media Equipment
- Remote ---*/
-#define DIVIRTUAL_REMOTE_CONTROL 0x27000000
-#define DIAXIS_REMOTE_SLIDER 0x27050201 /* Slider for adjustment: volume / color / bass / etc */
-#define DIBUTTON_REMOTE_MUTE 0x27000401 /* Set volume on current device to zero */
-#define DIBUTTON_REMOTE_SELECT 0x27000402 /* Next/previous: channel/ track / chapter / picture / station */
-#define DIBUTTON_REMOTE_PLAY 0x27002403 /* Start or pause entertainment on current device */
-#define DIBUTTON_REMOTE_CUE 0x27002404 /* Move through current media */
-#define DIBUTTON_REMOTE_REVIEW 0x27002405 /* Move through current media */
-#define DIBUTTON_REMOTE_CHANGE 0x27002406 /* Select next device */
-#define DIBUTTON_REMOTE_RECORD 0x27002407 /* Start recording the current media */
-#define DIBUTTON_REMOTE_MENU 0x270004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIAXIS_REMOTE_SLIDER2 0x27054202 /* Slider for adjustment: volume */
-#define DIBUTTON_REMOTE_TV 0x27005C08 /* Select TV */
-#define DIBUTTON_REMOTE_CABLE 0x27005C09 /* Select cable box */
-#define DIBUTTON_REMOTE_CD 0x27005C0A /* Select CD player */
-#define DIBUTTON_REMOTE_VCR 0x27005C0B /* Select VCR */
-#define DIBUTTON_REMOTE_TUNER 0x27005C0C /* Select tuner */
-#define DIBUTTON_REMOTE_DVD 0x27005C0D /* Select DVD player */
-#define DIBUTTON_REMOTE_ADJUST 0x27005C0E /* Enter device adjustment menu */
-#define DIBUTTON_REMOTE_DIGIT0 0x2700540F /* Digit 0 */
-#define DIBUTTON_REMOTE_DIGIT1 0x27005410 /* Digit 1 */
-#define DIBUTTON_REMOTE_DIGIT2 0x27005411 /* Digit 2 */
-#define DIBUTTON_REMOTE_DIGIT3 0x27005412 /* Digit 3 */
-#define DIBUTTON_REMOTE_DIGIT4 0x27005413 /* Digit 4 */
-#define DIBUTTON_REMOTE_DIGIT5 0x27005414 /* Digit 5 */
-#define DIBUTTON_REMOTE_DIGIT6 0x27005415 /* Digit 6 */
-#define DIBUTTON_REMOTE_DIGIT7 0x27005416 /* Digit 7 */
-#define DIBUTTON_REMOTE_DIGIT8 0x27005417 /* Digit 8 */
-#define DIBUTTON_REMOTE_DIGIT9 0x27005418 /* Digit 9 */
-#define DIBUTTON_REMOTE_DEVICE 0x270044FE /* Show input device and controls */
-#define DIBUTTON_REMOTE_PAUSE 0x270044FC /* Start / Pause / Restart game */
-
-/*--- Control- Web
- Help or Browser ---*/
-#define DIVIRTUAL_BROWSER_CONTROL 0x28000000
-#define DIAXIS_BROWSER_LATERAL 0x28008201 /* Move on screen pointer */
-#define DIAXIS_BROWSER_MOVE 0x28010202 /* Move on screen pointer */
-#define DIBUTTON_BROWSER_SELECT 0x28000401 /* Select current item */
-#define DIAXIS_BROWSER_VIEW 0x28018203 /* Move view up/down */
-#define DIBUTTON_BROWSER_REFRESH 0x28000402 /* Refresh */
-#define DIBUTTON_BROWSER_MENU 0x280004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_BROWSER_SEARCH 0x28004403 /* Use search tool */
-#define DIBUTTON_BROWSER_STOP 0x28004404 /* Cease current update */
-#define DIBUTTON_BROWSER_HOME 0x28004405 /* Go directly to "home" location */
-#define DIBUTTON_BROWSER_FAVORITES 0x28004406 /* Mark current site as favorite */
-#define DIBUTTON_BROWSER_NEXT 0x28004407 /* Select Next page */
-#define DIBUTTON_BROWSER_PREVIOUS 0x28004408 /* Select Previous page */
-#define DIBUTTON_BROWSER_HISTORY 0x28004409 /* Show/Hide History */
-#define DIBUTTON_BROWSER_PRINT 0x2800440A /* Print current page */
-#define DIBUTTON_BROWSER_DEVICE 0x280044FE /* Show input device and controls */
-#define DIBUTTON_BROWSER_PAUSE 0x280044FC /* Start / Pause / Restart game */
-
-/*--- Driving Simulator - Giant Walking Robot
- Walking tank with weapons ---*/
-#define DIVIRTUAL_DRIVING_MECHA 0x29000000
-#define DIAXIS_MECHA_STEER 0x29008201 /* Turns mecha left/right */
-#define DIAXIS_MECHA_TORSO 0x29010202 /* Tilts torso forward/backward */
-#define DIAXIS_MECHA_ROTATE 0x29020203 /* Turns torso left/right */
-#define DIAXIS_MECHA_THROTTLE 0x29038204 /* Engine Speed */
-#define DIBUTTON_MECHA_FIRE 0x29000401 /* Fire */
-#define DIBUTTON_MECHA_WEAPONS 0x29000402 /* Select next weapon group */
-#define DIBUTTON_MECHA_TARGET 0x29000403 /* Select closest enemy available target */
-#define DIBUTTON_MECHA_REVERSE 0x29000404 /* Toggles throttle in/out of reverse */
-#define DIBUTTON_MECHA_ZOOM 0x29000405 /* Zoom in/out targeting reticule */
-#define DIBUTTON_MECHA_JUMP 0x29000406 /* Fires jump jets */
-#define DIBUTTON_MECHA_MENU 0x290004FD /* Show menu options */
-/*--- Priority 2 controls ---*/
-
-#define DIBUTTON_MECHA_CENTER 0x29004407 /* Center torso to legs */
-#define DIHATSWITCH_MECHA_GLANCE 0x29004601 /* Look around */
-#define DIBUTTON_MECHA_VIEW 0x29004408 /* Cycle through view options */
-#define DIBUTTON_MECHA_FIRESECONDARY 0x29004409 /* Alternative fire button */
-#define DIBUTTON_MECHA_LEFT_LINK 0x2900C4E4 /* Fallback steer left button */
-#define DIBUTTON_MECHA_RIGHT_LINK 0x2900C4EC /* Fallback steer right button */
-#define DIBUTTON_MECHA_FORWARD_LINK 0x290144E0 /* Fallback tilt torso forward button */
-#define DIBUTTON_MECHA_BACK_LINK 0x290144E8 /* Fallback tilt toroso backward button */
-#define DIBUTTON_MECHA_ROTATE_LEFT_LINK 0x290244E4 /* Fallback rotate toroso right button */
-#define DIBUTTON_MECHA_ROTATE_RIGHT_LINK 0x290244EC /* Fallback rotate torso left button */
-#define DIBUTTON_MECHA_FASTER_LINK 0x2903C4E0 /* Fallback increase engine speed */
-#define DIBUTTON_MECHA_SLOWER_LINK 0x2903C4E8 /* Fallback decrease engine speed */
-#define DIBUTTON_MECHA_DEVICE 0x290044FE /* Show input device and controls */
-#define DIBUTTON_MECHA_PAUSE 0x290044FC /* Start / Pause / Restart game */
-
-/*
- * "ANY" semantics can be used as a last resort to get mappings for actions
- * that match nothing in the chosen virtual genre. These semantics will be
- * mapped at a lower priority that virtual genre semantics. Also, hardware
- * vendors will not be able to provide sensible mappings for these unless
- * they provide application specific mappings.
- */
-#define DIAXIS_ANY_X_1 0xFF00C201
-#define DIAXIS_ANY_X_2 0xFF00C202
-#define DIAXIS_ANY_Y_1 0xFF014201
-#define DIAXIS_ANY_Y_2 0xFF014202
-#define DIAXIS_ANY_Z_1 0xFF01C201
-#define DIAXIS_ANY_Z_2 0xFF01C202
-#define DIAXIS_ANY_R_1 0xFF024201
-#define DIAXIS_ANY_R_2 0xFF024202
-#define DIAXIS_ANY_U_1 0xFF02C201
-#define DIAXIS_ANY_U_2 0xFF02C202
-#define DIAXIS_ANY_V_1 0xFF034201
-#define DIAXIS_ANY_V_2 0xFF034202
-#define DIAXIS_ANY_A_1 0xFF03C201
-#define DIAXIS_ANY_A_2 0xFF03C202
-#define DIAXIS_ANY_B_1 0xFF044201
-#define DIAXIS_ANY_B_2 0xFF044202
-#define DIAXIS_ANY_C_1 0xFF04C201
-#define DIAXIS_ANY_C_2 0xFF04C202
-#define DIAXIS_ANY_S_1 0xFF054201
-#define DIAXIS_ANY_S_2 0xFF054202
-
-#define DIAXIS_ANY_1 0xFF004201
-#define DIAXIS_ANY_2 0xFF004202
-#define DIAXIS_ANY_3 0xFF004203
-#define DIAXIS_ANY_4 0xFF004204
-
-#define DIPOV_ANY_1 0xFF004601
-#define DIPOV_ANY_2 0xFF004602
-#define DIPOV_ANY_3 0xFF004603
-#define DIPOV_ANY_4 0xFF004604
-
-#define DIBUTTON_ANY(instance) ( 0xFF004400 | instance )
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* __DINPUT_INCLUDED__ */
-
-/****************************************************************************
- *
- * Definitions for non-IDirectInput (VJoyD) features defined more recently
- * than the current sdk files
- *
- ****************************************************************************/
-
-#ifdef _INC_MMSYSTEM
-#ifndef MMNOJOY
-
-#ifndef __VJOYDX_INCLUDED__
-#define __VJOYDX_INCLUDED__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure
- * contains mini-driver specific data to be passed by VJoyD to the mini-
- * driver instead of doing a poll.
- */
-#define JOY_PASSDRIVERDATA 0x10000000l
-
-/*
- * Informs the joystick driver that the configuration has been changed
- * and should be reloaded from the registery.
- * dwFlags is reserved and should be set to zero
- */
-WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags );
-
-#ifndef DIJ_RINGZERO
-/*
- * Invoke the joystick control panel directly, using the passed window handle
- * as the parent of the dialog. This API is only supported for compatibility
- * purposes; new applications should use the RunControlPanel method of a
- * device interface for a game controller.
- * The API is called by using the function pointer returned by
- * GetProcAddress( hCPL, TEXT("ShowJoyCPL") ) where hCPL is a HMODULE returned
- * by LoadLibrary( TEXT("joy.cpl") ). The typedef is provided to allow
- * declaration and casting of an appropriately typed variable.
- */
-void WINAPI ShowJoyCPL( HWND hWnd );
-typedef void (WINAPI* LPFNSHOWJOYCPL)( HWND hWnd );
-#endif /* DIJ_RINGZERO */
-
-
-/*
- * Hardware Setting indicating that the device is a headtracker
- */
-#define JOY_HWS_ISHEADTRACKER 0x02000000l
-
-/*
- * Hardware Setting indicating that the VxD is used to replace
- * the standard analog polling
- */
-#define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l
-
-/*
- * Hardware Setting indicating that the driver needs a standard
- * gameport in order to communicate with the device.
- */
-#define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l
-
-/*
- * Hardware Setting indicating that VJoyD should not load this
- * driver, it will be loaded externally and will register with
- * VJoyD of it's own accord.
- */
-#define JOY_HWS_AUTOLOAD 0x10000000l
-
-/*
- * Hardware Setting indicating that the driver acquires any
- * resources needed without needing a devnode through VJoyD.
- */
-#define JOY_HWS_NODEVNODE 0x20000000l
-
-
-/*
- * Hardware Setting indicating that the device is a gameport bus
- */
-#define JOY_HWS_ISGAMEPORTBUS 0x80000000l
-#define JOY_HWS_GAMEPORTBUSBUSY 0x00000001l
-
-/*
- * Usage Setting indicating that the settings are volatile and
- * should be removed if still present on a reboot.
- */
-#define JOY_US_VOLATILE 0x00000008L
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* __VJOYDX_INCLUDED__ */
-
-#endif /* not MMNOJOY */
-#endif /* _INC_MMSYSTEM */
-
-/****************************************************************************
- *
- * Definitions for non-IDirectInput (VJoyD) features defined more recently
- * than the current ddk files
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-#ifdef _INC_MMDDK
-#ifndef MMNOJOYDEV
-
-#ifndef __VJOYDXD_INCLUDED__
-#define __VJOYDXD_INCLUDED__
-/*
- * Poll type in which the do_other field of the JOYOEMPOLLDATA
- * structure contains mini-driver specific data passed from an app.
- */
-#define JOY_OEMPOLL_PASSDRIVERDATA 7
-
-#endif /* __VJOYDXD_INCLUDED__ */
-
-#endif /* not MMNOJOYDEV */
-#endif /* _INC_MMDDK */
-
-#endif /* DIJ_RINGZERO */
-
diff --git a/3rdparty/dxsdk/Include/dinputd.h b/3rdparty/dxsdk/Include/dinputd.h
deleted file mode 100644
index f53435385a5..00000000000
--- a/3rdparty/dxsdk/Include/dinputd.h
+++ /dev/null
@@ -1,755 +0,0 @@
-/****************************************************************************
- *
- * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
- *
- * File: dinputd.h
- * Content: DirectInput include file for device driver implementors
- *
- ****************************************************************************/
-#ifndef __DINPUTD_INCLUDED__
-#define __DINPUTD_INCLUDED__
-
-#ifndef DIRECTINPUT_VERSION
-#define DIRECTINPUT_VERSION 0x0800
-#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/****************************************************************************
- *
- * Interfaces
- *
- ****************************************************************************/
-
-#ifndef DIJ_RINGZERO
-
-DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
-DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
-DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
-
-DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
-
-#endif /* DIJ_RINGZERO */
-
-
-/****************************************************************************
- *
- * IDirectInputEffectDriver
- *
- ****************************************************************************/
-
-typedef struct DIOBJECTATTRIBUTES {
- DWORD dwFlags;
- WORD wUsagePage;
- WORD wUsage;
-} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
-typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
-
-typedef struct DIFFOBJECTATTRIBUTES {
- DWORD dwFFMaxForce;
- DWORD dwFFForceResolution;
-} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
-typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
-
-typedef struct DIOBJECTCALIBRATION {
- LONG lMin;
- LONG lCenter;
- LONG lMax;
-} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
-typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
-
-typedef struct DIPOVCALIBRATION {
- LONG lMin[5];
- LONG lMax[5];
-} DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
-typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
-
-typedef struct DIEFFECTATTRIBUTES {
- DWORD dwEffectId;
- DWORD dwEffType;
- DWORD dwStaticParams;
- DWORD dwDynamicParams;
- DWORD dwCoords;
-} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
-typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
-
-typedef struct DIFFDEVICEATTRIBUTES {
- DWORD dwFlags;
- DWORD dwFFSamplePeriod;
- DWORD dwFFMinTimeResolution;
-} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
-typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
-
-typedef struct DIDRIVERVERSIONS {
- DWORD dwSize;
- DWORD dwFirmwareRevision;
- DWORD dwHardwareRevision;
- DWORD dwFFDriverVersion;
-} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
-typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
-
-typedef struct DIDEVICESTATE {
- DWORD dwSize;
- DWORD dwState;
- DWORD dwLoad;
-} DIDEVICESTATE, *LPDIDEVICESTATE;
-
-#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
-
-#ifndef DIJ_RINGZERO
-
-typedef struct DIHIDFFINITINFO {
- DWORD dwSize;
- LPWSTR pwszDeviceInterface;
- GUID GuidInstance;
-} DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
-
-#undef INTERFACE
-#define INTERFACE IDirectInputEffectDriver
-
-DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputEffectDriver methods ***/
- STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
- STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
- STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
- STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
- STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
- STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
- STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
- STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
- STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
- STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
- STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
-};
-
-typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
-#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
-#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
-#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
-#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
-#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
-#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
-#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
-#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
-#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
-#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
-#else
-#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
-#define IDirectInputEffectDriver_Release(p) (p)->Release()
-#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
-#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
-#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
-#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
-#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
-#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
-#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
-#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
-#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
-#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
-#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
-#endif
-
-
-#endif /* DIJ_RINGZERO */
-
-
-/****************************************************************************
- *
- * IDirectInputJoyConfig
- *
- ****************************************************************************/
-
-/****************************************************************************
- *
- * Definitions copied from the DDK
- *
- ****************************************************************************/
-
-#ifndef JOY_HW_NONE
-
-/* pre-defined joystick types */
-#define JOY_HW_NONE 0
-#define JOY_HW_CUSTOM 1
-#define JOY_HW_2A_2B_GENERIC 2
-#define JOY_HW_2A_4B_GENERIC 3
-#define JOY_HW_2B_GAMEPAD 4
-#define JOY_HW_2B_FLIGHTYOKE 5
-#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
-#define JOY_HW_3A_2B_GENERIC 7
-#define JOY_HW_3A_4B_GENERIC 8
-#define JOY_HW_4B_GAMEPAD 9
-#define JOY_HW_4B_FLIGHTYOKE 10
-#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
-#define JOY_HW_TWO_2A_2B_WITH_Y 12
-#define JOY_HW_LASTENTRY 13
-
-
-/* calibration flags */
-#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
-#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
-#define JOY_ISCAL_R 0x00000004l /* R is calibrated */
-#define JOY_ISCAL_U 0x00000008l /* U is calibrated */
-#define JOY_ISCAL_V 0x00000010l /* V is calibrated */
-#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
-
-/* point of view constants */
-#define JOY_POV_NUMDIRS 4
-#define JOY_POVVAL_FORWARD 0
-#define JOY_POVVAL_BACKWARD 1
-#define JOY_POVVAL_LEFT 2
-#define JOY_POVVAL_RIGHT 3
-
-/* Specific settings for joystick hardware */
-#define JOY_HWS_HASZ 0x00000001l /* has Z info? */
-#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
-#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
-#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
-#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
-#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
-#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
-/* X defaults to J1 X axis */
-#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
-#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
-#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
-/* Y defaults to J1 Y axis */
-#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
-#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
-#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
-/* Z defaults to J2 Y axis */
-#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
-#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
-#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
-/* POV defaults to J2 Y axis, if it is not button based */
-#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
-#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
-#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
-/* R defaults to J2 X axis */
-#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
-#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
-#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
-#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
-/* U & V for future hardware */
-#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
-#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
-
-/* Usage settings */
-#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
-#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
-#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
-
-/* reserved for future use -> as link to next possible dword */
-#define JOY_US_RESERVED 0x80000000l /* reserved */
-
-
-/* Settings for TypeInfo Flags1 */
-#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
-#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
-#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
-#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
-#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
-
-/* Settings for TypeInfo Flags2 */
-#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
-#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
-#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
-#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
-#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
-#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
-#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
-#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
-#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
-#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
-#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
-#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
-#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
-#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
-
-/* struct for storing x,y, z, and rudder values */
-typedef struct joypos_tag {
- DWORD dwX;
- DWORD dwY;
- DWORD dwZ;
- DWORD dwR;
- DWORD dwU;
- DWORD dwV;
-} JOYPOS, FAR *LPJOYPOS;
-
-/* struct for storing ranges */
-typedef struct joyrange_tag {
- JOYPOS jpMin;
- JOYPOS jpMax;
- JOYPOS jpCenter;
-} JOYRANGE,FAR *LPJOYRANGE;
-
-/*
- * dwTimeout - value at which to timeout joystick polling
- * jrvRanges - range of values app wants returned for axes
- * jpDeadZone - area around center to be considered
- * as "dead". specified as a percentage
- * (0-100). Only X & Y handled by system driver
- */
-typedef struct joyreguservalues_tag {
- DWORD dwTimeOut;
- JOYRANGE jrvRanges;
- JOYPOS jpDeadZone;
-} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
-
-typedef struct joyreghwsettings_tag {
- DWORD dwFlags;
- DWORD dwNumButtons;
-} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
-
-/* range of values returned by the hardware (filled in by calibration) */
-/*
- * jrvHardware - values returned by hardware
- * dwPOVValues - POV values returned by hardware
- * dwCalFlags - what has been calibrated
- */
-typedef struct joyreghwvalues_tag {
- JOYRANGE jrvHardware;
- DWORD dwPOVValues[JOY_POV_NUMDIRS];
- DWORD dwCalFlags;
-} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
-
-/* hardware configuration */
-/*
- * hws - hardware settings
- * dwUsageSettings - usage settings
- * hwv - values returned by hardware
- * dwType - type of joystick
- * dwReserved - reserved for OEM drivers
- */
-typedef struct joyreghwconfig_tag {
- JOYREGHWSETTINGS hws;
- DWORD dwUsageSettings;
- JOYREGHWVALUES hwv;
- DWORD dwType;
- DWORD dwReserved;
-} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
-
-/* joystick calibration info structure */
-typedef struct joycalibrate_tag {
- UINT wXbase;
- UINT wXdelta;
- UINT wYbase;
- UINT wYdelta;
- UINT wZbase;
- UINT wZdelta;
-} JOYCALIBRATE;
-typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
-
-#endif
-
-#ifndef DIJ_RINGZERO
-
-#define MAX_JOYSTRING 256
-typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
-
-#ifndef MAX_JOYSTICKOEMVXDNAME
-#define MAX_JOYSTICKOEMVXDNAME 260
-#endif
-
-#define DITC_REGHWSETTINGS 0x00000001
-#define DITC_CLSIDCONFIG 0x00000002
-#define DITC_DISPLAYNAME 0x00000004
-#define DITC_CALLOUT 0x00000008
-#define DITC_HARDWAREID 0x00000010
-#define DITC_FLAGS1 0x00000020
-#define DITC_FLAGS2 0x00000040
-#define DITC_MAPFILE 0x00000080
-
-
-
-/* This structure is defined for DirectX 5.0 compatibility */
-
-typedef struct DIJOYTYPEINFO_DX5 {
- DWORD dwSize;
- JOYREGHWSETTINGS hws;
- CLSID clsidConfig;
- WCHAR wszDisplayName[MAX_JOYSTRING];
- WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
-} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
-typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
-
-/* This structure is defined for DirectX 6.1 compatibility */
-typedef struct DIJOYTYPEINFO_DX6 {
- DWORD dwSize;
- JOYREGHWSETTINGS hws;
- CLSID clsidConfig;
- WCHAR wszDisplayName[MAX_JOYSTRING];
- WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
- WCHAR wszHardwareId[MAX_JOYSTRING];
- DWORD dwFlags1;
-} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
-typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
-
-typedef struct DIJOYTYPEINFO {
- DWORD dwSize;
- JOYREGHWSETTINGS hws;
- CLSID clsidConfig;
- WCHAR wszDisplayName[MAX_JOYSTRING];
- WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
-#if(DIRECTINPUT_VERSION >= 0x05b2)
- WCHAR wszHardwareId[MAX_JOYSTRING];
- DWORD dwFlags1;
-#if(DIRECTINPUT_VERSION >= 0x0800)
- DWORD dwFlags2;
- WCHAR wszMapFile[MAX_JOYSTRING];
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
-} DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
-typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
-#define DIJC_GUIDINSTANCE 0x00000001
-#define DIJC_REGHWCONFIGTYPE 0x00000002
-#define DIJC_GAIN 0x00000004
-#define DIJC_CALLOUT 0x00000008
-#define DIJC_WDMGAMEPORT 0x00000010
-
-/* This structure is defined for DirectX 5.0 compatibility */
-
-typedef struct DIJOYCONFIG_DX5 {
- DWORD dwSize;
- GUID guidInstance;
- JOYREGHWCONFIG hwc;
- DWORD dwGain;
- WCHAR wszType[MAX_JOYSTRING];
- WCHAR wszCallout[MAX_JOYSTRING];
-} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
-typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
-
-typedef struct DIJOYCONFIG {
- DWORD dwSize;
- GUID guidInstance;
- JOYREGHWCONFIG hwc;
- DWORD dwGain;
- WCHAR wszType[MAX_JOYSTRING];
- WCHAR wszCallout[MAX_JOYSTRING];
-#if(DIRECTINPUT_VERSION >= 0x05b2)
- GUID guidGameport;
-#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
- } DIJOYCONFIG, *LPDIJOYCONFIG;
-typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
-
-
-#define DIJU_USERVALUES 0x00000001
-#define DIJU_GLOBALDRIVER 0x00000002
-#define DIJU_GAMEPORTEMULATOR 0x00000004
-
-typedef struct DIJOYUSERVALUES {
- DWORD dwSize;
- JOYREGUSERVALUES ruv;
- WCHAR wszGlobalDriver[MAX_JOYSTRING];
- WCHAR wszGameportEmulator[MAX_JOYSTRING];
-} DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
-typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
-
-DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
-DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
-DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
-DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
-
-#undef INTERFACE
-#define INTERFACE IDirectInputJoyConfig
-
-DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputJoyConfig methods ***/
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(SendNotify)(THIS) PURE;
- STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
- STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
- STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
- STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
- STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
- STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
- STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
- STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
- STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
- STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
- STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
- STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
-};
-
-typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
-#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
-#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
-#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
-#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
-#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
-#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
-#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
-#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
-#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
-#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
-#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
-#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
-#else
-#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
-#define IDirectInputJoyConfig_Release(p) (p)->Release()
-#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
-#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
-#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
-#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
-#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
-#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
-#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
-#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
-#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
-#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
-#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
-#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
-#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
-#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
-#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-#if(DIRECTINPUT_VERSION >= 0x0800)
-
-#ifndef DIJ_RINGZERO
-
-#undef INTERFACE
-#define INTERFACE IDirectInputJoyConfig8
-
-DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
-
- /*** IDirectInputJoyConfig8 methods ***/
- STDMETHOD(Acquire)(THIS) PURE;
- STDMETHOD(Unacquire)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
- STDMETHOD(SendNotify)(THIS) PURE;
- STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
- STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
- STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
- STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
- STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
- STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
- STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
- STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
- STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
- STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
- STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
- STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
-};
-
-typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
-#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
-#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
-#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
-#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
-#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
-#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
-#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
-#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
-#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
-#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
-#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
-#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
-#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
-#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
-#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
-#else
-#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
-#define IDirectInputJoyConfig8_Release(p) (p)->Release()
-#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
-#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
-#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
-#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
-#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
-#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
-#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
-#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
-#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
-#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
-#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
-#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
-#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
-#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
-#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
-#endif
-
-#endif /* DIJ_RINGZERO */
-
-/****************************************************************************
- *
- * Notification Messages
- *
- ****************************************************************************/
-
-/* RegisterWindowMessage with this to get DirectInput notification messages */
-#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
-#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
-
-#ifdef UNICODE
-#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
-#else
-#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
-#endif
-
-#define DIMSGWP_NEWAPPSTART 0x00000001
-#define DIMSGWP_DX8APPSTART 0x00000002
-#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
-
-#endif /* DIRECTINPUT_VERSION >= 0x0800 */
-
-#define DIAPPIDFLAG_NOTIME 0x00000001
-#define DIAPPIDFLAG_NOSIZE 0x00000002
-
-#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
-#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
-#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
-#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
-#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
-#define DIRECTINPUT_REGSTR_VAL_IDA "Id"
-#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
-#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
-
-#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
-#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
-#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
-#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
-#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
-#define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
-#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
-#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
-
-#ifdef UNICODE
-#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
-#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
-#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
-#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
-#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
-#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
-#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
-#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
-#else
-#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
-#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
-#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
-#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
-#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
-#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
-#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
-#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
-#endif
-
-
-/****************************************************************************
- *
- * Return Codes
- *
- ****************************************************************************/
-
-#define DIERR_NOMOREITEMS \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
-
-/*
- * Device driver-specific codes.
- */
-
-#define DIERR_DRIVERFIRST 0x80040300L
-#define DIERR_DRIVERLAST 0x800403FFL
-
-/*
- * Unless the specific driver has been precisely identified, no meaning
- * should be attributed to these values other than that the driver
- * originated the error. However, to illustrate the types of error that
- * may be causing the failure, the PID force feedback driver distributed
- * with DirectX 7 could return the following errors:
- *
- * DIERR_DRIVERFIRST + 1
- * The requested usage was not found.
- * DIERR_DRIVERFIRST + 2
- * The parameter block couldn't be downloaded to the device.
- * DIERR_DRIVERFIRST + 3
- * PID initialization failed.
- * DIERR_DRIVERFIRST + 4
- * The provided values couldn't be scaled.
- */
-
-
-/*
- * Device installer errors.
- */
-
-/*
- * Registry entry or DLL for class installer invalid
- * or class installer not found.
- */
-#define DIERR_INVALIDCLASSINSTALLER 0x80040400L
-
-/*
- * The user cancelled the install operation.
- */
-#define DIERR_CANCELLED 0x80040401L
-
-/*
- * The INF file for the selected device could not be
- * found or is invalid or is damaged.
- */
-#define DIERR_BADINF 0x80040402L
-
-/****************************************************************************
- *
- * Map files
- *
- ****************************************************************************/
-
-/*
- * Delete particular data from default map file.
- */
-#define DIDIFT_DELETE 0x01000000
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* __DINPUTD_INCLUDED__ */
diff --git a/3rdparty/dxsdk/Include/dsconf.h b/3rdparty/dxsdk/Include/dsconf.h
deleted file mode 100644
index 018f65a0acf..00000000000
--- a/3rdparty/dxsdk/Include/dsconf.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*==========================================================================;
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: dsconf.h
- * Content: DirectSound configuration interface include file
- *
- **************************************************************************/
-
-#ifndef __DSCONF_INCLUDED__
-#define __DSCONF_INCLUDED__
-
-#ifndef __DSOUND_INCLUDED__
-#error dsound.h not included
-#endif // __DSOUND_INCLUDED__
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-
-// DirectSound Private Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA}
-DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
-
-
-//
-// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA}
-//
-
-DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
-
-typedef enum
-{
- DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1,
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2,
- DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3,
- DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4,
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5,
- DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6,
- DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7,
- DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8,
-} DSPROPERTY_DIRECTSOUNDDEVICE;
-
-#if DIRECTSOUND_VERSION >= 0x0700
-#ifdef UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
-#else // UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
-#endif // UNICODE
-#else // DIRECTSOUND_VERSION >= 0x0700
-#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
-#endif // DIRECTSOUND_VERSION >= 0x0700
-
-typedef enum
-{
- DIRECTSOUNDDEVICE_TYPE_EMULATED,
- DIRECTSOUNDDEVICE_TYPE_VXD,
- DIRECTSOUNDDEVICE_TYPE_WDM
-} DIRECTSOUNDDEVICE_TYPE;
-
-typedef enum
-{
- DIRECTSOUNDDEVICE_DATAFLOW_RENDER,
- DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
-} DIRECTSOUNDDEVICE_DATAFLOW;
-
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
-{
- LPSTR DeviceName; // waveIn/waveOut device name
- DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
- GUID DeviceId; // DirectSound device id
-} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA;
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
-{
- LPWSTR DeviceName; // waveIn/waveOut device name
- DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
- GUID DeviceId; // DirectSound device id
-} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA;
-
-#ifdef UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
-#else // UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
-#endif // UNICODE
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
-{
- GUID DeviceId; // DirectSound device id
- CHAR DescriptionA[0x100]; // Device description (ANSI)
- WCHAR DescriptionW[0x100]; // Device description (Unicode)
- CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI)
- WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode)
- DIRECTSOUNDDEVICE_TYPE Type; // Device type
- DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
- ULONG WaveDeviceId; // Wave device id
- ULONG Devnode; // Devnode (or DevInst)
-} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA;
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
-{
- DIRECTSOUNDDEVICE_TYPE Type; // Device type
- DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
- GUID DeviceId; // DirectSound device id
- LPSTR Description; // Device description
- LPSTR Module; // Device driver module
- LPSTR Interface; // Device interface
- ULONG WaveDeviceId; // Wave device id
-} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA;
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
-{
- DIRECTSOUNDDEVICE_TYPE Type; // Device type
- DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
- GUID DeviceId; // DirectSound device id
- LPWSTR Description; // Device description
- LPWSTR Module; // Device driver module
- LPWSTR Interface; // Device interface
- ULONG WaveDeviceId; // Wave device id
-} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA;
-
-#if DIRECTSOUND_VERSION >= 0x0700
-#ifdef UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
-#else // UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
-#endif // UNICODE
-#else // DIRECTSOUND_VERSION >= 0x0700
-#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
-#endif // DIRECTSOUND_VERSION >= 0x0700
-
-typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID);
-typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID);
-typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID);
-
-#if DIRECTSOUND_VERSION >= 0x0700
-#ifdef UNICODE
-#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW
-#else // UNICODE
-#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA
-#endif // UNICODE
-#else // DIRECTSOUND_VERSION >= 0x0700
-#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1
-#endif // DIRECTSOUND_VERSION >= 0x0700
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
-{
- LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer
- LPVOID Context; // Callback function context argument
-} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA;
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
-{
- LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer
- LPVOID Context; // Callback function context argument
-} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA;
-
-typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
-{
- LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer
- LPVOID Context; // Callback function context argument
-} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA;
-
-#if DIRECTSOUND_VERSION >= 0x0700
-#ifdef UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
-#else // UNICODE
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
-#endif // UNICODE
-#else // DIRECTSOUND_VERSION >= 0x0700
-#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
-#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
-#endif // DIRECTSOUND_VERSION >= 0x0700
-
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // __DSCONF_INCLUDED__
-
diff --git a/3rdparty/dxsdk/Include/dsetup.h b/3rdparty/dxsdk/Include/dsetup.h
deleted file mode 100644
index ebada13fd3d..00000000000
--- a/3rdparty/dxsdk/Include/dsetup.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*==========================================================================
- *
- * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
- *
- * File: dsetup.h
- * Content: DirectXSetup, error codes and flags
- ***************************************************************************/
-
-#ifndef __DSETUP_H__
-#define __DSETUP_H__
-
-#include <windows.h> // windows stuff
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define FOURCC_VERS mmioFOURCC('v','e','r','s')
-
-// DSETUP Error Codes, must remain compatible with previous setup.
-#define DSETUPERR_SUCCESS_RESTART 1
-#define DSETUPERR_SUCCESS 0
-#define DSETUPERR_BADWINDOWSVERSION -1
-#define DSETUPERR_SOURCEFILENOTFOUND -2
-#define DSETUPERR_NOCOPY -5
-#define DSETUPERR_OUTOFDISKSPACE -6
-#define DSETUPERR_CANTFINDINF -7
-#define DSETUPERR_CANTFINDDIR -8
-#define DSETUPERR_INTERNAL -9
-#define DSETUPERR_UNKNOWNOS -11
-#define DSETUPERR_NEWERVERSION -14
-#define DSETUPERR_NOTADMIN -15
-#define DSETUPERR_UNSUPPORTEDPROCESSOR -16
-#define DSETUPERR_MISSINGCAB_MANAGEDDX -17
-#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18
-#define DSETUPERR_CABDOWNLOADFAIL -19
-#define DSETUPERR_DXCOMPONENTFILEINUSE -20
-#define DSETUPERR_UNTRUSTEDCABINETFILE -21
-
-// DSETUP flags. DirectX 5.0 apps should use these flags only.
-#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
-#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
-#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
-#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
-#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */
-#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
-
-// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
-// They are present to allow DX3 apps to be recompiled with DX5 and still work.
-// DO NOT USE THEM for DX5. They will go away in future DX releases.
-#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
-#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
-#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
-#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
-#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
-#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
-#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
-#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
-#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
-#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
-#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
-
-
-
-//******************************************************************
-// DirectX Setup Callback mechanism
-//******************************************************************
-
-// DSETUP Message Info Codes, passed to callback as Reason parameter.
-#define DSETUP_CB_MSG_NOMESSAGE 0
-#define DSETUP_CB_MSG_INTERNAL_ERROR 10
-#define DSETUP_CB_MSG_BEGIN_INSTALL 13
-#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
-#define DSETUP_CB_MSG_PROGRESS 18
-#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19
-
-
-
-
-
-
-typedef struct _DSETUP_CB_PROGRESS
-{
- DWORD dwPhase;
- DWORD dwInPhaseMaximum;
- DWORD dwInPhaseProgress;
- DWORD dwOverallMaximum;
- DWORD dwOverallProgress;
-} DSETUP_CB_PROGRESS;
-
-
-enum _DSETUP_CB_PROGRESS_PHASE
-{
- DSETUP_INITIALIZING,
- DSETUP_EXTRACTING,
- DSETUP_COPYING,
- DSETUP_FINALIZING
-};
-
-
-#ifdef _WIN32
-//
-// Data Structures
-//
-#ifndef UNICODE_ONLY
-
-typedef struct _DIRECTXREGISTERAPPA {
- DWORD dwSize;
- DWORD dwFlags;
- LPSTR lpszApplicationName;
- LPGUID lpGUID;
- LPSTR lpszFilename;
- LPSTR lpszCommandLine;
- LPSTR lpszPath;
- LPSTR lpszCurrentDirectory;
-} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
-
-typedef struct _DIRECTXREGISTERAPP2A {
- DWORD dwSize;
- DWORD dwFlags;
- LPSTR lpszApplicationName;
- LPGUID lpGUID;
- LPSTR lpszFilename;
- LPSTR lpszCommandLine;
- LPSTR lpszPath;
- LPSTR lpszCurrentDirectory;
- LPSTR lpszLauncherName;
-} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
-
-#endif //!UNICODE_ONLY
-#ifndef ANSI_ONLY
-
-typedef struct _DIRECTXREGISTERAPPW {
- DWORD dwSize;
- DWORD dwFlags;
- LPWSTR lpszApplicationName;
- LPGUID lpGUID;
- LPWSTR lpszFilename;
- LPWSTR lpszCommandLine;
- LPWSTR lpszPath;
- LPWSTR lpszCurrentDirectory;
-} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
-
-typedef struct _DIRECTXREGISTERAPP2W {
- DWORD dwSize;
- DWORD dwFlags;
- LPWSTR lpszApplicationName;
- LPGUID lpGUID;
- LPWSTR lpszFilename;
- LPWSTR lpszCommandLine;
- LPWSTR lpszPath;
- LPWSTR lpszCurrentDirectory;
- LPWSTR lpszLauncherName;
-} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
-#endif //!ANSI_ONLY
-#ifdef UNICODE
-typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
-typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
-typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
-typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
-typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
-typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
-#else
-typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
-typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
-typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
-typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
-typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
-typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
-#endif // UNICODE
-
-
-//
-// API
-//
-
-#ifndef UNICODE_ONLY
-INT
-WINAPI
-DirectXSetupA(
- HWND hWnd,
- __in_opt LPSTR lpszRootPath,
- DWORD dwFlags
- );
-#endif //!UNICODE_ONLY
-#ifndef ANSI_ONLY
-INT
-WINAPI
-DirectXSetupW(
- HWND hWnd,
- __in_opt LPWSTR lpszRootPath,
- DWORD dwFlags
- );
-#endif //!ANSI_ONLY
-#ifdef UNICODE
-#define DirectXSetup DirectXSetupW
-#else
-#define DirectXSetup DirectXSetupA
-#endif // !UNICODE
-
-#ifndef UNICODE_ONLY
-INT
-WINAPI
-DirectXRegisterApplicationA(
- HWND hWnd,
- LPVOID lpDXRegApp
- );
-#endif //!UNICODE_ONLY
-#ifndef ANSI_ONLY
-INT
-WINAPI
-DirectXRegisterApplicationW(
- HWND hWnd,
- LPVOID lpDXRegApp
- );
-#endif //!ANSI_ONLY
-#ifdef UNICODE
-#define DirectXRegisterApplication DirectXRegisterApplicationW
-#else
-#define DirectXRegisterApplication DirectXRegisterApplicationA
-#endif // !UNICODE
-
-INT
-WINAPI
-DirectXUnRegisterApplication(
- HWND hWnd,
- LPGUID lpGUID
- );
-
-//
-// Function Pointers
-//
-#ifdef UNICODE
-typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
-typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
-#else
-typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
-typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
-#endif // UNICODE
-
-typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
- DWORD MsgType, /* Same as flags to MessageBox */
- LPSTR szMessage,
- LPSTR szName,
- void *pInfo);
-
-INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
-INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
-INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
-#ifndef UNICODE_ONLY
-UINT
-WINAPI
-DirectXSetupGetEULAA(
- __out_ecount(cchEULA) LPSTR lpszEULA,
- UINT cchEULA,
- WORD LangID
- );
-#endif //!UNICODE_ONLY
-#ifndef ANSI_ONLY
-UINT
-WINAPI
-DirectXSetupGetEULAW(
- __out_ecount(cchEULA) LPWSTR lpszEULA,
- UINT cchEULA,
- WORD LangID
- );
-#endif //!ANSI_ONLY
-#ifdef UNICODE
-#define DirectXSetupGetEULA DirectXSetupGetEULAW
-typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD);
-#else
-#define DirectXSetupGetEULA DirectXSetupGetEULAA
-typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD);
-#endif // !UNICODE
-
-#endif // WIN32
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
diff --git a/3rdparty/dxsdk/Include/dsound.h b/3rdparty/dxsdk/Include/dsound.h
deleted file mode 100644
index 34e4c3048b9..00000000000
--- a/3rdparty/dxsdk/Include/dsound.h
+++ /dev/null
@@ -1,2385 +0,0 @@
-/*==========================================================================;
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: dsound.h
- * Content: DirectSound include file
- *
- **************************************************************************/
-
-#define COM_NO_WINDOWS_H
-#include <objbase.h>
-#include <float.h>
-#include <sal.h>
-
-#ifndef DIRECTSOUND_VERSION
-
-#if (NTDDI_VERSION < NTDDI_WINXP) /* Windows 2000 */
-#define DIRECTSOUND_VERSION 0x0700 /* Version 7.0 */
-#elif (NTDDI_VERSION < NTDDI_WINXPSP2 || NTDDI_VERSION == NTDDI_WS03) /* Windows XP and SP1, or Windows Server 2003 */
-#define DIRECTSOUND_VERSION 0x0800 /* Version 8.0 */
-#else /* Windows XP SP2 and higher, Windows Server 2003 SP1 and higher, Longhorn, or higher */
-#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */
-#endif
-
-#endif // DIRECTSOUND_VERSION
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#ifndef __DSOUND_INCLUDED__
-#define __DSOUND_INCLUDED__
-
-/* Type definitions shared with Direct3D */
-
-#ifndef DX_SHARED_DEFINES
-
-typedef float D3DVALUE, *LPD3DVALUE;
-
-#ifndef D3DCOLOR_DEFINED
-typedef DWORD D3DCOLOR;
-#define D3DCOLOR_DEFINED
-#endif
-
-#ifndef LPD3DCOLOR_DEFINED
-typedef DWORD *LPD3DCOLOR;
-#define LPD3DCOLOR_DEFINED
-#endif
-
-#ifndef D3DVECTOR_DEFINED
-typedef struct _D3DVECTOR {
- float x;
- float y;
- float z;
-} D3DVECTOR;
-#define D3DVECTOR_DEFINED
-#endif
-
-#ifndef LPD3DVECTOR_DEFINED
-typedef D3DVECTOR *LPD3DVECTOR;
-#define LPD3DVECTOR_DEFINED
-#endif
-
-#define DX_SHARED_DEFINES
-#endif // DX_SHARED_DEFINES
-
-#define _FACDS 0x878 /* DirectSound's facility code */
-#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
-
-// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
-DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
-
-// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
-DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
-
-// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16}
-DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}
-DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
-
-// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D}
-DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
-
-
-// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03}
-DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
-
-// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03}
-DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
-
-// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03}
-DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
-
-// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03}
-DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
-
-
-//
-// Forward declarations for interfaces.
-// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
-//
-
-#ifdef __cplusplus
-struct IDirectSound;
-struct IDirectSoundBuffer;
-struct IDirectSound3DListener;
-struct IDirectSound3DBuffer;
-struct IDirectSoundCapture;
-struct IDirectSoundCaptureBuffer;
-struct IDirectSoundNotify;
-#endif // __cplusplus
-
-//
-// DirectSound 8.0 interfaces.
-//
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-#ifdef __cplusplus
-struct IDirectSound8;
-struct IDirectSoundBuffer8;
-struct IDirectSoundCaptureBuffer8;
-struct IDirectSoundFXGargle;
-struct IDirectSoundFXChorus;
-struct IDirectSoundFXFlanger;
-struct IDirectSoundFXEcho;
-struct IDirectSoundFXDistortion;
-struct IDirectSoundFXCompressor;
-struct IDirectSoundFXParamEq;
-struct IDirectSoundFXWavesReverb;
-struct IDirectSoundFXI3DL2Reverb;
-struct IDirectSoundCaptureFXAec;
-struct IDirectSoundCaptureFXNoiseSuppress;
-struct IDirectSoundFullDuplex;
-#endif // __cplusplus
-
-// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the
-// only DirectSound 7.0 interfaces with changed functionality in version 8.0.
-// The other level 8 interfaces as equivalent to their level 7 counterparts:
-
-#define IDirectSoundCapture8 IDirectSoundCapture
-#define IDirectSound3DListener8 IDirectSound3DListener
-#define IDirectSound3DBuffer8 IDirectSound3DBuffer
-#define IDirectSoundNotify8 IDirectSoundNotify
-#define IDirectSoundFXGargle8 IDirectSoundFXGargle
-#define IDirectSoundFXChorus8 IDirectSoundFXChorus
-#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger
-#define IDirectSoundFXEcho8 IDirectSoundFXEcho
-#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion
-#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor
-#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq
-#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb
-#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb
-#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec
-#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress
-#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-typedef struct IDirectSound *LPDIRECTSOUND;
-typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
-typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
-typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
-typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
-typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
-typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE;
-typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS;
-typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER;
-typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO;
-typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION;
-typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR;
-typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ;
-typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB;
-typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB;
-typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC;
-typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS;
-typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
-
-typedef struct IDirectSound8 *LPDIRECTSOUND8;
-typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8;
-typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8;
-typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8;
-typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8;
-typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8;
-typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8;
-typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8;
-typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8;
-typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8;
-typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8;
-typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8;
-typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8;
-typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8;
-typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8;
-typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8;
-typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8;
-typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8;
-typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8;
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IID definitions for the unchanged DirectSound 8.0 interfaces
-//
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture
-#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener
-#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer
-#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify
-#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle
-#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus
-#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger
-#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho
-#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion
-#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor
-#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq
-#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb
-#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb
-#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec
-#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress
-#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// Compatibility typedefs
-//
-
-#ifndef _LPCWAVEFORMATEX_DEFINED
-#define _LPCWAVEFORMATEX_DEFINED
-typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
-#endif // _LPCWAVEFORMATEX_DEFINED
-
-#ifndef __LPCGUID_DEFINED__
-#define __LPCGUID_DEFINED__
-typedef const GUID *LPCGUID;
-#endif // __LPCGUID_DEFINED__
-
-typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
-typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
-typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
-typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
-typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
-typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
-typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
-
-#if DIRECTSOUND_VERSION >= 0x0800
-typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8;
-typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8;
-typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8;
-typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8;
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// Structures
-//
-
-typedef struct _DSCAPS
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwMinSecondarySampleRate;
- DWORD dwMaxSecondarySampleRate;
- DWORD dwPrimaryBuffers;
- DWORD dwMaxHwMixingAllBuffers;
- DWORD dwMaxHwMixingStaticBuffers;
- DWORD dwMaxHwMixingStreamingBuffers;
- DWORD dwFreeHwMixingAllBuffers;
- DWORD dwFreeHwMixingStaticBuffers;
- DWORD dwFreeHwMixingStreamingBuffers;
- DWORD dwMaxHw3DAllBuffers;
- DWORD dwMaxHw3DStaticBuffers;
- DWORD dwMaxHw3DStreamingBuffers;
- DWORD dwFreeHw3DAllBuffers;
- DWORD dwFreeHw3DStaticBuffers;
- DWORD dwFreeHw3DStreamingBuffers;
- DWORD dwTotalHwMemBytes;
- DWORD dwFreeHwMemBytes;
- DWORD dwMaxContigFreeHwMemBytes;
- DWORD dwUnlockTransferRateHwBuffers;
- DWORD dwPlayCpuOverheadSwBuffers;
- DWORD dwReserved1;
- DWORD dwReserved2;
-} DSCAPS, *LPDSCAPS;
-
-typedef const DSCAPS *LPCDSCAPS;
-
-typedef struct _DSBCAPS
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwUnlockTransferRate;
- DWORD dwPlayCpuOverhead;
-} DSBCAPS, *LPDSBCAPS;
-
-typedef const DSBCAPS *LPCDSBCAPS;
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
- typedef struct _DSEFFECTDESC
- {
- DWORD dwSize;
- DWORD dwFlags;
- GUID guidDSFXClass;
- DWORD_PTR dwReserved1;
- DWORD_PTR dwReserved2;
- } DSEFFECTDESC, *LPDSEFFECTDESC;
- typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
-
- #define DSFX_LOCHARDWARE 0x00000001
- #define DSFX_LOCSOFTWARE 0x00000002
-
- enum
- {
- DSFXR_PRESENT, // 0
- DSFXR_LOCHARDWARE, // 1
- DSFXR_LOCSOFTWARE, // 2
- DSFXR_UNALLOCATED, // 3
- DSFXR_FAILED, // 4
- DSFXR_UNKNOWN, // 5
- DSFXR_SENDLOOP // 6
- };
-
- typedef struct _DSCEFFECTDESC
- {
- DWORD dwSize;
- DWORD dwFlags;
- GUID guidDSCFXClass;
- GUID guidDSCFXInstance;
- DWORD dwReserved1;
- DWORD dwReserved2;
- } DSCEFFECTDESC, *LPDSCEFFECTDESC;
- typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
-
- #define DSCFX_LOCHARDWARE 0x00000001
- #define DSCFX_LOCSOFTWARE 0x00000002
-
- #define DSCFXR_LOCHARDWARE 0x00000010
- #define DSCFXR_LOCSOFTWARE 0x00000020
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-typedef struct _DSBUFFERDESC
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwReserved;
- LPWAVEFORMATEX lpwfxFormat;
-#if DIRECTSOUND_VERSION >= 0x0700
- GUID guid3DAlgorithm;
-#endif
-} DSBUFFERDESC, *LPDSBUFFERDESC;
-
-typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
-
-// Older version of this structure:
-
-typedef struct _DSBUFFERDESC1
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwReserved;
- LPWAVEFORMATEX lpwfxFormat;
-} DSBUFFERDESC1, *LPDSBUFFERDESC1;
-
-typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
-
-typedef struct _DS3DBUFFER
-{
- DWORD dwSize;
- D3DVECTOR vPosition;
- D3DVECTOR vVelocity;
- DWORD dwInsideConeAngle;
- DWORD dwOutsideConeAngle;
- D3DVECTOR vConeOrientation;
- LONG lConeOutsideVolume;
- D3DVALUE flMinDistance;
- D3DVALUE flMaxDistance;
- DWORD dwMode;
-} DS3DBUFFER, *LPDS3DBUFFER;
-
-typedef const DS3DBUFFER *LPCDS3DBUFFER;
-
-typedef struct _DS3DLISTENER
-{
- DWORD dwSize;
- D3DVECTOR vPosition;
- D3DVECTOR vVelocity;
- D3DVECTOR vOrientFront;
- D3DVECTOR vOrientTop;
- D3DVALUE flDistanceFactor;
- D3DVALUE flRolloffFactor;
- D3DVALUE flDopplerFactor;
-} DS3DLISTENER, *LPDS3DLISTENER;
-
-typedef const DS3DLISTENER *LPCDS3DLISTENER;
-
-typedef struct _DSCCAPS
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwFormats;
- DWORD dwChannels;
-} DSCCAPS, *LPDSCCAPS;
-
-typedef const DSCCAPS *LPCDSCCAPS;
-
-typedef struct _DSCBUFFERDESC1
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwReserved;
- LPWAVEFORMATEX lpwfxFormat;
-} DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
-
-typedef struct _DSCBUFFERDESC
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwReserved;
- LPWAVEFORMATEX lpwfxFormat;
-#if DIRECTSOUND_VERSION >= 0x0800
- DWORD dwFXCount;
- LPDSCEFFECTDESC lpDSCFXDesc;
-#endif
-} DSCBUFFERDESC, *LPDSCBUFFERDESC;
-
-typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
-
-typedef struct _DSCBCAPS
-{
- DWORD dwSize;
- DWORD dwFlags;
- DWORD dwBufferBytes;
- DWORD dwReserved;
-} DSCBCAPS, *LPDSCBCAPS;
-
-typedef const DSCBCAPS *LPCDSCBCAPS;
-
-typedef struct _DSBPOSITIONNOTIFY
-{
- DWORD dwOffset;
- HANDLE hEventNotify;
-} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
-
-typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
-
-//
-// DirectSound API
-//
-
-typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
-typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
-
-extern HRESULT WINAPI DirectSoundCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND *ppDS, __null LPUNKNOWN pUnkOuter);
-extern HRESULT WINAPI DirectSoundEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext);
-extern HRESULT WINAPI DirectSoundEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext);
-
-extern HRESULT WINAPI DirectSoundCaptureCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE *ppDSC, __null LPUNKNOWN pUnkOuter);
-extern HRESULT WINAPI DirectSoundCaptureEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext);
-extern HRESULT WINAPI DirectSoundCaptureEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext);
-
-#if DIRECTSOUND_VERSION >= 0x0800
-extern HRESULT WINAPI DirectSoundCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND8 *ppDS8, __null LPUNKNOWN pUnkOuter);
-extern HRESULT WINAPI DirectSoundCaptureCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE8 *ppDSC8, __null LPUNKNOWN pUnkOuter);
-extern HRESULT WINAPI DirectSoundFullDuplexCreate
-(
- __in_opt LPCGUID pcGuidCaptureDevice,
- __in_opt LPCGUID pcGuidRenderDevice,
- __in LPCDSCBUFFERDESC pcDSCBufferDesc,
- __in LPCDSBUFFERDESC pcDSBufferDesc,
- HWND hWnd,
- DWORD dwLevel,
- __deref_out LPDIRECTSOUNDFULLDUPLEX* ppDSFD,
- __deref_out LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8,
- __deref_out LPDIRECTSOUNDBUFFER8 *ppDSBuffer8,
- __null LPUNKNOWN pUnkOuter
-);
-#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
-
-extern HRESULT WINAPI GetDeviceID(__in_opt LPCGUID pGuidSrc, __out LPGUID pGuidDest);
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-#ifdef UNICODE
-#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
-#define DirectSoundEnumerate DirectSoundEnumerateW
-#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
-#else // UNICODE
-#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
-#define DirectSoundEnumerate DirectSoundEnumerateA
-#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
-#endif // UNICODE
-
-//
-// IUnknown
-//
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#ifndef IUnknown_QueryInterface
-#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#endif // IUnknown_QueryInterface
-#ifndef IUnknown_AddRef
-#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p)
-#endif // IUnknown_AddRef
-#ifndef IUnknown_Release
-#define IUnknown_Release(p) (p)->lpVtbl->Release(p)
-#endif // IUnknown_Release
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#ifndef IUnknown_QueryInterface
-#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
-#endif // IUnknown_QueryInterface
-#ifndef IUnknown_AddRef
-#define IUnknown_AddRef(p) (p)->AddRef()
-#endif // IUnknown_AddRef
-#ifndef IUnknown_Release
-#define IUnknown_Release(p) (p)->Release()
-#endif // IUnknown_Release
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#ifndef __IReferenceClock_INTERFACE_DEFINED__
-#define __IReferenceClock_INTERFACE_DEFINED__
-
-typedef LONGLONG REFERENCE_TIME;
-typedef REFERENCE_TIME *LPREFERENCE_TIME;
-
-DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
-
-#undef INTERFACE
-#define INTERFACE IReferenceClock
-
-DECLARE_INTERFACE_(IReferenceClock, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IReferenceClock methods
- STDMETHOD(GetTime) (THIS_ __out REFERENCE_TIME *pTime) PURE;
- STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime,
- HANDLE hEvent, __out LPDWORD pdwAdviseCookie) PURE;
- STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime,
- HANDLE hSemaphore, __out LPDWORD pdwAdviseCookie) PURE;
- STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE;
-};
-
-#endif // __IReferenceClock_INTERFACE_DEFINED__
-
-#ifndef IReferenceClock_QueryInterface
-
-#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IReferenceClock_AddRef(p) IUnknown_AddRef(p)
-#define IReferenceClock_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a)
-#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d)
-#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d)
-#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IReferenceClock_GetTime(p,a) (p)->GetTime(a)
-#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d)
-#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d)
-#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // IReferenceClock_QueryInterface
-
-//
-// IDirectSound
-//
-
-DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
-#undef INTERFACE
-#define INTERFACE IDirectSound
-
-DECLARE_INTERFACE_(IDirectSound, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSound methods
- STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __deref_out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE;
- STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE;
- STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __deref_out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
- STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE;
- STDMETHOD(Compact) (THIS) PURE;
- STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE;
- STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE;
- STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE;
-};
-
-#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSound_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSound_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
-#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
-#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
-#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
-#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
-#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
-#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
-#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
-#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
-#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
-#define IDirectSound_Compact(p) (p)->Compact()
-#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
-#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
-#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSound8
-//
-
-DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66);
-
-#undef INTERFACE
-#define INTERFACE IDirectSound8
-
-DECLARE_INTERFACE_(IDirectSound8, IDirectSound)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSound methods
- STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE;
- STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE;
- STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
- STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE;
- STDMETHOD(Compact) (THIS) PURE;
- STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE;
- STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE;
- STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE;
-
- // IDirectSound8 methods
- STDMETHOD(VerifyCertification) (THIS_ __out LPDWORD pdwCertified) PURE;
-};
-
-#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b)
-#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p)
-#define IDirectSound8_Release(p) IDirectSound_Release(p)
-#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c)
-#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a)
-#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b)
-#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b)
-#define IDirectSound8_Compact(p) IDirectSound_Compact(p)
-#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a)
-#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a)
-#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSoundBuffer
-//
-
-DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundBuffer
-
-DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundBuffer methods
- STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE;
- STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE;
- STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE;
- STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE;
- STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE;
- STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE;
- STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE;
- STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE;
- STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes,
- __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1,
- __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
- STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
- STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE;
- STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE;
- STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE;
- STDMETHOD(SetPan) (THIS_ LONG lPan) PURE;
- STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE;
- STDMETHOD(Stop) (THIS) PURE;
- STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1,
- __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
- STDMETHOD(Restore) (THIS) PURE;
-};
-
-#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundBuffer_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
-#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
-#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
-#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
-#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
-#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
-#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
-#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
-#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
-#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
-#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
-#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
-#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
-#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
-#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
-#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
-#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
-#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
-#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
-#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
-#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
-#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
-#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
-#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
-#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
-#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
-#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
-#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
-#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
-#define IDirectSoundBuffer_Stop(p) (p)->Stop()
-#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
-#define IDirectSoundBuffer_Restore(p) (p)->Restore()
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSoundBuffer8
-//
-
-DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundBuffer8
-
-DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundBuffer methods
- STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE;
- STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE;
- STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE;
- STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE;
- STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE;
- STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE;
- STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE;
- STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE;
- STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes,
- __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1,
- __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
- STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
- STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE;
- STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE;
- STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE;
- STDMETHOD(SetPan) (THIS_ LONG lPan) PURE;
- STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE;
- STDMETHOD(Stop) (THIS) PURE;
- STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1,
- __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
- STDMETHOD(Restore) (THIS) PURE;
-
- // IDirectSoundBuffer8 methods
- STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, __in_ecount_opt(dwEffectsCount) LPDSEFFECTDESC pDSFXDesc, __out_ecount_opt(dwEffectsCount) LPDWORD pdwResultCodes) PURE;
- STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwResultCodes) PURE;
- STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE;
-};
-
-// Special GUID meaning "select all objects" for use in GetObjectInPath()
-DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5);
-
-#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p)
-
-#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a)
-#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b)
-#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c)
-#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a)
-#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a)
-#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a)
-#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a)
-#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b)
-#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c)
-#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a)
-#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a)
-#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a)
-#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a)
-#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a)
-#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p)
-#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d)
-#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c)
-#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c)
-#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c)
-#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c)
-#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSound3DListener
-//
-
-DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
-#undef INTERFACE
-#define INTERFACE IDirectSound3DListener
-
-DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSound3DListener methods
- STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DLISTENER pListener) PURE;
- STDMETHOD(GetDistanceFactor) (THIS_ __out D3DVALUE* pflDistanceFactor) PURE;
- STDMETHOD(GetDopplerFactor) (THIS_ __out D3DVALUE* pflDopplerFactor) PURE;
- STDMETHOD(GetOrientation) (THIS_ __out D3DVECTOR* pvOrientFront, __out D3DVECTOR* pvOrientTop) PURE;
- STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE;
- STDMETHOD(GetRolloffFactor) (THIS_ __out D3DVALUE* pflRolloffFactor) PURE;
- STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE;
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DLISTENER pcListener, DWORD dwApply) PURE;
- STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
- STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
- STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront,
- D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
- STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
- STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
- STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
- STDMETHOD(CommitDeferredSettings) (THIS) PURE;
-};
-
-#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSound3DListener_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
-#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
-#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
-#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
-#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
-#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
-#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
-#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
-#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
-#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
-#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
-#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
-#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
-#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
-#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
-#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
-#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
-#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
-#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
-#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
-#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
-#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
-#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
-#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
-#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
-#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
-#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSound3DBuffer
-//
-
-DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
-#undef INTERFACE
-#define INTERFACE IDirectSound3DBuffer
-
-DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSound3DBuffer methods
- STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DBUFFER pDs3dBuffer) PURE;
- STDMETHOD(GetConeAngles) (THIS_ __out LPDWORD pdwInsideConeAngle, __out LPDWORD pdwOutsideConeAngle) PURE;
- STDMETHOD(GetConeOrientation) (THIS_ __out D3DVECTOR* pvOrientation) PURE;
- STDMETHOD(GetConeOutsideVolume) (THIS_ __out LPLONG plConeOutsideVolume) PURE;
- STDMETHOD(GetMaxDistance) (THIS_ __out D3DVALUE* pflMaxDistance) PURE;
- STDMETHOD(GetMinDistance) (THIS_ __out D3DVALUE* pflMinDistance) PURE;
- STDMETHOD(GetMode) (THIS_ __out LPDWORD pdwMode) PURE;
- STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE;
- STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE;
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE;
- STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
- STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
- STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
- STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
- STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
- STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE;
- STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
- STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
-};
-
-#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
-#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
-#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
-#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
-#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
-#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
-#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
-#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
-#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
-#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
-#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
-#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
-#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
-#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
-#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
-#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
-#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
-#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
-#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
-#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
-#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
-#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
-#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
-#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
-#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
-#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
-#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
-#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b)
-#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
-#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
-#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
-#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
-#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundCapture
-//
-
-DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundCapture
-
-DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundCapture methods
- STDMETHOD(CreateCaptureBuffer) (THIS_ __in LPCDSCBUFFERDESC pcDSCBufferDesc, __deref_out LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, __null LPUNKNOWN pUnkOuter) PURE;
- STDMETHOD(GetCaps) (THIS_ __out LPDSCCAPS pDSCCaps) PURE;
- STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE;
-};
-
-#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundCapture_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
-#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
-#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
-#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundCaptureBuffer
-//
-
-DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundCaptureBuffer
-
-DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundCaptureBuffer methods
- STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE;
- STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE;
- STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE;
- STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE;
- STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
- STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes,
- __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1,
- __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
- STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
- STDMETHOD(Stop) (THIS) PURE;
- STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1,
- __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
-};
-
-#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
-#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
-#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
-#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
-#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
-#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
-#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
-#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
-#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
-#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
-#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
-#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
-#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
-#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSoundCaptureBuffer8
-//
-
-DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundCaptureBuffer8
-
-DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundCaptureBuffer methods
- STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE;
- STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE;
- STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE;
- STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE;
- STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
- STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes,
- __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1,
- __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
- STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
- STDMETHOD(Stop) (THIS) PURE;
- STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1,
- __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
-
- // IDirectSoundCaptureBuffer8 methods
- STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE;
- STDMETHOD(GetFXStatus) (DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwFXStatus) PURE;
-};
-
-#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p)
-
-#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a)
-#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)
-#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)
-#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a)
-#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b)
-#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a)
-#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p))
-#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
-#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
-#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSoundNotify
-//
-
-DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundNotify
-
-DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundNotify methods
- STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, __in_ecount(dwPositionNotifies) LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
-};
-
-#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundNotify_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IKsPropertySet
-//
-
-#ifndef _IKsPropertySet_
-#define _IKsPropertySet_
-
-#ifdef __cplusplus
-// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
-struct IKsPropertySet;
-#endif // __cplusplus
-
-typedef struct IKsPropertySet *LPKSPROPERTYSET;
-
-#define KSPROPERTY_SUPPORT_GET 0x00000001
-#define KSPROPERTY_SUPPORT_SET 0x00000002
-
-DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
-
-#undef INTERFACE
-#define INTERFACE IKsPropertySet
-
-DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IKsPropertySet methods
- STDMETHOD(Get) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength,
- __out_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength, __out PULONG pulBytesReturned) PURE;
- STDMETHOD(Set) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength,
- __in_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength) PURE;
- STDMETHOD(QuerySupport) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __out PULONG pulTypeSupport) PURE;
-};
-
-#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p)
-#define IKsPropertySet_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
-#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
-#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
-#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
-#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // _IKsPropertySet_
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-//
-// IDirectSoundFXGargle
-//
-
-DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3);
-
-typedef struct _DSFXGargle
-{
- DWORD dwRateHz; // Rate of modulation in hz
- DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx
-} DSFXGargle, *LPDSFXGargle;
-
-#define DSFXGARGLE_WAVE_TRIANGLE 0
-#define DSFXGARGLE_WAVE_SQUARE 1
-
-typedef const DSFXGargle *LPCDSFXGargle;
-
-#define DSFXGARGLE_RATEHZ_MIN 1
-#define DSFXGARGLE_RATEHZ_MAX 1000
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXGargle
-
-DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXGargle methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXGargle pcDsFxGargle) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXGargle pDsFxGargle) PURE;
-};
-
-#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXChorus
-//
-
-DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47);
-
-typedef struct _DSFXChorus
-{
- FLOAT fWetDryMix;
- FLOAT fDepth;
- FLOAT fFeedback;
- FLOAT fFrequency;
- LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx
- FLOAT fDelay;
- LONG lPhase;
-} DSFXChorus, *LPDSFXChorus;
-
-typedef const DSFXChorus *LPCDSFXChorus;
-
-#define DSFXCHORUS_WAVE_TRIANGLE 0
-#define DSFXCHORUS_WAVE_SIN 1
-
-#define DSFXCHORUS_WETDRYMIX_MIN 0.0f
-#define DSFXCHORUS_WETDRYMIX_MAX 100.0f
-#define DSFXCHORUS_DEPTH_MIN 0.0f
-#define DSFXCHORUS_DEPTH_MAX 100.0f
-#define DSFXCHORUS_FEEDBACK_MIN -99.0f
-#define DSFXCHORUS_FEEDBACK_MAX 99.0f
-#define DSFXCHORUS_FREQUENCY_MIN 0.0f
-#define DSFXCHORUS_FREQUENCY_MAX 10.0f
-#define DSFXCHORUS_DELAY_MIN 0.0f
-#define DSFXCHORUS_DELAY_MAX 20.0f
-#define DSFXCHORUS_PHASE_MIN 0
-#define DSFXCHORUS_PHASE_MAX 4
-
-#define DSFXCHORUS_PHASE_NEG_180 0
-#define DSFXCHORUS_PHASE_NEG_90 1
-#define DSFXCHORUS_PHASE_ZERO 2
-#define DSFXCHORUS_PHASE_90 3
-#define DSFXCHORUS_PHASE_180 4
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXChorus
-
-DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXChorus methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXChorus pcDsFxChorus) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXChorus pDsFxChorus) PURE;
-};
-
-#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXFlanger
-//
-
-DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83);
-
-typedef struct _DSFXFlanger
-{
- FLOAT fWetDryMix;
- FLOAT fDepth;
- FLOAT fFeedback;
- FLOAT fFrequency;
- LONG lWaveform;
- FLOAT fDelay;
- LONG lPhase;
-} DSFXFlanger, *LPDSFXFlanger;
-
-typedef const DSFXFlanger *LPCDSFXFlanger;
-
-#define DSFXFLANGER_WAVE_TRIANGLE 0
-#define DSFXFLANGER_WAVE_SIN 1
-
-#define DSFXFLANGER_WETDRYMIX_MIN 0.0f
-#define DSFXFLANGER_WETDRYMIX_MAX 100.0f
-#define DSFXFLANGER_FREQUENCY_MIN 0.0f
-#define DSFXFLANGER_FREQUENCY_MAX 10.0f
-#define DSFXFLANGER_DEPTH_MIN 0.0f
-#define DSFXFLANGER_DEPTH_MAX 100.0f
-#define DSFXFLANGER_PHASE_MIN 0
-#define DSFXFLANGER_PHASE_MAX 4
-#define DSFXFLANGER_FEEDBACK_MIN -99.0f
-#define DSFXFLANGER_FEEDBACK_MAX 99.0f
-#define DSFXFLANGER_DELAY_MIN 0.0f
-#define DSFXFLANGER_DELAY_MAX 4.0f
-
-#define DSFXFLANGER_PHASE_NEG_180 0
-#define DSFXFLANGER_PHASE_NEG_90 1
-#define DSFXFLANGER_PHASE_ZERO 2
-#define DSFXFLANGER_PHASE_90 3
-#define DSFXFLANGER_PHASE_180 4
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXFlanger
-
-DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXFlanger methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXFlanger pcDsFxFlanger) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXFlanger pDsFxFlanger) PURE;
-};
-
-#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXEcho
-//
-
-DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42);
-
-typedef struct _DSFXEcho
-{
- FLOAT fWetDryMix;
- FLOAT fFeedback;
- FLOAT fLeftDelay;
- FLOAT fRightDelay;
- LONG lPanDelay;
-} DSFXEcho, *LPDSFXEcho;
-
-typedef const DSFXEcho *LPCDSFXEcho;
-
-#define DSFXECHO_WETDRYMIX_MIN 0.0f
-#define DSFXECHO_WETDRYMIX_MAX 100.0f
-#define DSFXECHO_FEEDBACK_MIN 0.0f
-#define DSFXECHO_FEEDBACK_MAX 100.0f
-#define DSFXECHO_LEFTDELAY_MIN 1.0f
-#define DSFXECHO_LEFTDELAY_MAX 2000.0f
-#define DSFXECHO_RIGHTDELAY_MIN 1.0f
-#define DSFXECHO_RIGHTDELAY_MAX 2000.0f
-#define DSFXECHO_PANDELAY_MIN 0
-#define DSFXECHO_PANDELAY_MAX 1
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXEcho
-
-DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXEcho methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXEcho pcDsFxEcho) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXEcho pDsFxEcho) PURE;
-};
-
-#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXDistortion
-//
-
-DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b);
-
-typedef struct _DSFXDistortion
-{
- FLOAT fGain;
- FLOAT fEdge;
- FLOAT fPostEQCenterFrequency;
- FLOAT fPostEQBandwidth;
- FLOAT fPreLowpassCutoff;
-} DSFXDistortion, *LPDSFXDistortion;
-
-typedef const DSFXDistortion *LPCDSFXDistortion;
-
-#define DSFXDISTORTION_GAIN_MIN -60.0f
-#define DSFXDISTORTION_GAIN_MAX 0.0f
-#define DSFXDISTORTION_EDGE_MIN 0.0f
-#define DSFXDISTORTION_EDGE_MAX 100.0f
-#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f
-#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f
-#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f
-#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f
-#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f
-#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXDistortion
-
-DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXDistortion methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXDistortion pcDsFxDistortion) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXDistortion pDsFxDistortion) PURE;
-};
-
-#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXCompressor
-//
-
-DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0);
-
-typedef struct _DSFXCompressor
-{
- FLOAT fGain;
- FLOAT fAttack;
- FLOAT fRelease;
- FLOAT fThreshold;
- FLOAT fRatio;
- FLOAT fPredelay;
-} DSFXCompressor, *LPDSFXCompressor;
-
-typedef const DSFXCompressor *LPCDSFXCompressor;
-
-#define DSFXCOMPRESSOR_GAIN_MIN -60.0f
-#define DSFXCOMPRESSOR_GAIN_MAX 60.0f
-#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f
-#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f
-#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f
-#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f
-#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f
-#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f
-#define DSFXCOMPRESSOR_RATIO_MIN 1.0f
-#define DSFXCOMPRESSOR_RATIO_MAX 100.0f
-#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f
-#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXCompressor
-
-DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXCompressor methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXCompressor pcDsFxCompressor) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXCompressor pDsFxCompressor) PURE;
-};
-
-#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXParamEq
-//
-
-DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda);
-
-typedef struct _DSFXParamEq
-{
- FLOAT fCenter;
- FLOAT fBandwidth;
- FLOAT fGain;
-} DSFXParamEq, *LPDSFXParamEq;
-
-typedef const DSFXParamEq *LPCDSFXParamEq;
-
-#define DSFXPARAMEQ_CENTER_MIN 80.0f
-#define DSFXPARAMEQ_CENTER_MAX 16000.0f
-#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f
-#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f
-#define DSFXPARAMEQ_GAIN_MIN -15.0f
-#define DSFXPARAMEQ_GAIN_MAX 15.0f
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXParamEq
-
-DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXParamEq methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXParamEq pcDsFxParamEq) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXParamEq pDsFxParamEq) PURE;
-};
-
-#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXI3DL2Reverb
-//
-
-DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4);
-
-typedef struct _DSFXI3DL2Reverb
-{
- LONG lRoom; // [-10000, 0] default: -1000 mB
- LONG lRoomHF; // [-10000, 0] default: 0 mB
- FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0
- FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s
- FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83
- LONG lReflections; // [-10000, 1000] default: -2602 mB
- FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s
- LONG lReverb; // [-10000, 2000] default: 200 mB
- FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s
- FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 %
- FLOAT flDensity; // [0.0, 100.0] default: 100.0 %
- FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz
-} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb;
-
-typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb;
-
-#define DSFX_I3DL2REVERB_ROOM_MIN (-10000)
-#define DSFX_I3DL2REVERB_ROOM_MAX 0
-#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000)
-
-#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000)
-#define DSFX_I3DL2REVERB_ROOMHF_MAX 0
-#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100)
-
-#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f
-#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f
-#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f
-
-#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f
-#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f
-#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f
-
-#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f
-#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f
-#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f
-
-#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000)
-#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000
-#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602)
-
-#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f
-#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f
-#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f
-
-#define DSFX_I3DL2REVERB_REVERB_MIN (-10000)
-#define DSFX_I3DL2REVERB_REVERB_MAX 2000
-#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200)
-
-#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f
-#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f
-#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f
-
-#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f
-#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f
-#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f
-
-#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f
-#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f
-#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f
-
-#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f
-#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f
-#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f
-
-#define DSFX_I3DL2REVERB_QUALITY_MIN 0
-#define DSFX_I3DL2REVERB_QUALITY_MAX 3
-#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXI3DL2Reverb
-
-DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXI3DL2Reverb methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE;
- STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE;
- STDMETHOD(GetPreset) (THIS_ __out LPDWORD pdwPreset) PURE;
- STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE;
- STDMETHOD(GetQuality) (THIS_ __out LONG *plQuality) PURE;
-};
-
-#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a)
-#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a)
-#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundFXWavesReverb
-//
-
-DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25);
-
-typedef struct _DSFXWavesReverb
-{
- FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB
- FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db
- FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms
- FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001
-} DSFXWavesReverb, *LPDSFXWavesReverb;
-
-typedef const DSFXWavesReverb *LPCDSFXWavesReverb;
-
-#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f
-#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f
-#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f
-#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f
-#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f
-#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f
-#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f
-#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f
-#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f
-#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f
-#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f
-#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFXWavesReverb
-
-DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFXWavesReverb methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXWavesReverb pcDsFxWavesReverb) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXWavesReverb pDsFxWavesReverb) PURE;
-};
-
-#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundCaptureFXAec
-//
-
-DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65);
-
-typedef struct _DSCFXAec
-{
- BOOL fEnable;
- BOOL fNoiseFill;
- DWORD dwMode;
-} DSCFXAec, *LPDSCFXAec;
-
-typedef const DSCFXAec *LPCDSCFXAec;
-
-// These match the AEC_MODE_* constants in the DDK's ksmedia.h file
-#define DSCFX_AEC_MODE_PASS_THROUGH 0x0
-#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1
-#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2
-
-// These match the AEC_STATUS_* constants in ksmedia.h
-#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0
-#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1
-#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2
-#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundCaptureFXAec
-
-DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundCaptureFXAec methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXAec pDscFxAec) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXAec pDscFxAec) PURE;
- STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE;
- STDMETHOD(Reset) (THIS) PURE;
-};
-
-#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-
-//
-// IDirectSoundCaptureFXNoiseSuppress
-//
-
-DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca);
-
-typedef struct _DSCFXNoiseSuppress
-{
- BOOL fEnable;
-} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress;
-
-typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress;
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundCaptureFXNoiseSuppress
-
-DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundCaptureFXNoiseSuppress methods
- STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE;
- STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE;
- STDMETHOD(Reset) (THIS) PURE;
-};
-
-#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
-#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a)
-#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-
-//
-// IDirectSoundFullDuplex
-//
-
-#ifndef _IDirectSoundFullDuplex_
-#define _IDirectSoundFullDuplex_
-
-#ifdef __cplusplus
-// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
-struct IDirectSoundFullDuplex;
-#endif // __cplusplus
-
-typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
-
-DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d);
-
-#undef INTERFACE
-#define INTERFACE IDirectSoundFullDuplex
-
-DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown)
-{
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- // IDirectSoundFullDuplex methods
- STDMETHOD(Initialize) (THIS_ __in LPCGUID pCaptureGuid, __in LPCGUID pRenderGuid, __in LPCDSCBUFFERDESC lpDscBufferDesc, __in LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel,
- __deref_out LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, __deref_out LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
-};
-
-#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
-#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p)
-#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p)
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // _IDirectSoundFullDuplex_
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-//
-// Return Codes
-//
-
-// The function completed successfully
-#define DS_OK S_OK
-
-// The call succeeded, but we had to substitute the 3D algorithm
-#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10)
-
-// The call failed because resources (such as a priority level)
-// were already being used by another caller
-#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
-
-// The control (vol, pan, etc.) requested by the caller is not available
-#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
-
-// An invalid parameter was passed to the returning function
-#define DSERR_INVALIDPARAM E_INVALIDARG
-
-// This call is not valid for the current state of this object
-#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
-
-// An undetermined error occurred inside the DirectSound subsystem
-#define DSERR_GENERIC E_FAIL
-
-// The caller does not have the priority level required for the function to
-// succeed
-#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
-
-// Not enough free memory is available to complete the operation
-#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
-
-// The specified WAVE format is not supported
-#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
-
-// The function called is not supported at this time
-#define DSERR_UNSUPPORTED E_NOTIMPL
-
-// No sound driver is available for use
-#define DSERR_NODRIVER MAKE_DSHRESULT(120)
-
-// This object is already initialized
-#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
-
-// This object does not support aggregation
-#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
-
-// The buffer memory has been lost, and must be restored
-#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
-
-// Another app has a higher priority level, preventing this call from
-// succeeding
-#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
-
-// This object has not been initialized
-#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
-
-// The requested COM interface is not available
-#define DSERR_NOINTERFACE E_NOINTERFACE
-
-// Access is denied
-#define DSERR_ACCESSDENIED E_ACCESSDENIED
-
-// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds
-#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180)
-
-// Attempt to use DirectSound 8 functionality on an older DirectSound object
-#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190)
-
-// A circular loop of send effects was detected
-#define DSERR_SENDLOOP MAKE_DSHRESULT(200)
-
-// The GUID specified in an audiopath file does not match a valid MIXIN buffer
-#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210)
-
-// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)
-#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449)
-
-// The effects requested could not be found on the system, or they were found
-// but in the wrong order, or in the wrong hardware/software locations.
-#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220)
-
-//
-// Flags
-//
-
-#define DSCAPS_PRIMARYMONO 0x00000001
-#define DSCAPS_PRIMARYSTEREO 0x00000002
-#define DSCAPS_PRIMARY8BIT 0x00000004
-#define DSCAPS_PRIMARY16BIT 0x00000008
-#define DSCAPS_CONTINUOUSRATE 0x00000010
-#define DSCAPS_EMULDRIVER 0x00000020
-#define DSCAPS_CERTIFIED 0x00000040
-#define DSCAPS_SECONDARYMONO 0x00000100
-#define DSCAPS_SECONDARYSTEREO 0x00000200
-#define DSCAPS_SECONDARY8BIT 0x00000400
-#define DSCAPS_SECONDARY16BIT 0x00000800
-
-#define DSSCL_NORMAL 0x00000001
-#define DSSCL_PRIORITY 0x00000002
-#define DSSCL_EXCLUSIVE 0x00000003
-#define DSSCL_WRITEPRIMARY 0x00000004
-
-#define DSSPEAKER_DIRECTOUT 0x00000000
-#define DSSPEAKER_HEADPHONE 0x00000001
-#define DSSPEAKER_MONO 0x00000002
-#define DSSPEAKER_QUAD 0x00000003
-#define DSSPEAKER_STEREO 0x00000004
-#define DSSPEAKER_SURROUND 0x00000005
-#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting
-#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting
-#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting
-#define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting
-#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1
-#define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1
-
-#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
-#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
-#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
-#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
-
-#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
-#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
-#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
-
-#define DSBCAPS_PRIMARYBUFFER 0x00000001
-#define DSBCAPS_STATIC 0x00000002
-#define DSBCAPS_LOCHARDWARE 0x00000004
-#define DSBCAPS_LOCSOFTWARE 0x00000008
-#define DSBCAPS_CTRL3D 0x00000010
-#define DSBCAPS_CTRLFREQUENCY 0x00000020
-#define DSBCAPS_CTRLPAN 0x00000040
-#define DSBCAPS_CTRLVOLUME 0x00000080
-#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
-#define DSBCAPS_CTRLFX 0x00000200
-#define DSBCAPS_STICKYFOCUS 0x00004000
-#define DSBCAPS_GLOBALFOCUS 0x00008000
-#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
-#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
-#define DSBCAPS_LOCDEFER 0x00040000
-#define DSBCAPS_TRUEPLAYPOSITION 0x00080000
-
-#define DSBPLAY_LOOPING 0x00000001
-#define DSBPLAY_LOCHARDWARE 0x00000002
-#define DSBPLAY_LOCSOFTWARE 0x00000004
-#define DSBPLAY_TERMINATEBY_TIME 0x00000008
-#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010
-#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020
-
-#define DSBSTATUS_PLAYING 0x00000001
-#define DSBSTATUS_BUFFERLOST 0x00000002
-#define DSBSTATUS_LOOPING 0x00000004
-#define DSBSTATUS_LOCHARDWARE 0x00000008
-#define DSBSTATUS_LOCSOFTWARE 0x00000010
-#define DSBSTATUS_TERMINATED 0x00000020
-
-#define DSBLOCK_FROMWRITECURSOR 0x00000001
-#define DSBLOCK_ENTIREBUFFER 0x00000002
-
-#define DSBFREQUENCY_ORIGINAL 0
-#define DSBFREQUENCY_MIN 100
-#if DIRECTSOUND_VERSION >= 0x0900
-#define DSBFREQUENCY_MAX 200000
-#else
-#define DSBFREQUENCY_MAX 100000
-#endif
-
-#define DSBPAN_LEFT -10000
-#define DSBPAN_CENTER 0
-#define DSBPAN_RIGHT 10000
-
-#define DSBVOLUME_MIN -10000
-#define DSBVOLUME_MAX 0
-
-#define DSBSIZE_MIN 4
-#define DSBSIZE_MAX 0x0FFFFFFF
-#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes
-
-#define DSBNOTIFICATIONS_MAX 100000UL
-
-#define DS3DMODE_NORMAL 0x00000000
-#define DS3DMODE_HEADRELATIVE 0x00000001
-#define DS3DMODE_DISABLE 0x00000002
-
-#define DS3D_IMMEDIATE 0x00000000
-#define DS3D_DEFERRED 0x00000001
-
-#define DS3D_MINDISTANCEFACTOR FLT_MIN
-#define DS3D_MAXDISTANCEFACTOR FLT_MAX
-#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
-
-#define DS3D_MINROLLOFFFACTOR 0.0f
-#define DS3D_MAXROLLOFFFACTOR 10.0f
-#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
-
-#define DS3D_MINDOPPLERFACTOR 0.0f
-#define DS3D_MAXDOPPLERFACTOR 10.0f
-#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
-
-#define DS3D_DEFAULTMINDISTANCE 1.0f
-#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
-
-#define DS3D_MINCONEANGLE 0
-#define DS3D_MAXCONEANGLE 360
-#define DS3D_DEFAULTCONEANGLE 360
-
-#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
-
-// IDirectSoundCapture attributes
-
-#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER
-#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED
-#define DSCCAPS_MULTIPLECAPTURE 0x00000001
-
-// IDirectSoundCaptureBuffer attributes
-
-#define DSCBCAPS_WAVEMAPPED 0x80000000
-#if DIRECTSOUND_VERSION >= 0x0800
-#define DSCBCAPS_CTRLFX 0x00000200
-#endif
-
-#define DSCBLOCK_ENTIREBUFFER 0x00000001
-
-#define DSCBSTATUS_CAPTURING 0x00000001
-#define DSCBSTATUS_LOOPING 0x00000002
-
-#define DSCBSTART_LOOPING 0x00000001
-
-#define DSBPN_OFFSETSTOP 0xFFFFFFFF
-
-#define DS_CERTIFIED 0x00000000
-#define DS_UNCERTIFIED 0x00000001
-
-//
-// Flags for the I3DL2 effects
-//
-
-//
-// I3DL2 Material Presets
-//
-
-enum
-{
- DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW,
- DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW,
- DSFX_I3DL2_MATERIAL_PRESET_THINDOOR,
- DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR,
- DSFX_I3DL2_MATERIAL_PRESET_WOODWALL,
- DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL,
- DSFX_I3DL2_MATERIAL_PRESET_STONEWALL,
- DSFX_I3DL2_MATERIAL_PRESET_CURTAIN
-};
-
-#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f
-#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f
-#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f
-#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f
-#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f
-#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f
-#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f
-#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f
-
-enum
-{
- DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT,
- DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC,
- DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL,
- DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL,
- DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE,
- DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA,
- DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR,
- DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY,
- DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY,
- DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR,
- DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY,
- DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST,
- DSFX_I3DL2_ENVIRONMENT_PRESET_CITY,
- DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS,
- DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY,
- DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN,
- DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT,
- DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE,
- DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER,
- DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM,
- DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL,
- DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL,
- DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE
-};
-
-//
-// I3DL2 Reverberation Presets Values
-//
-
-#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f
-
-//
-// Examples simulating 'musical' reverb presets
-//
-// Name Decay time Description
-// Small Room 1.1s A small size room with a length of 5m or so.
-// Medium Room 1.3s A medium size room with a length of 10m or so.
-// Large Room 1.5s A large size room suitable for live performances.
-// Medium Hall 1.8s A medium size concert hall.
-// Large Hall 1.8s A large size concert hall suitable for a full orchestra.
-// Plate 1.3s A plate reverb simulation.
-//
-
-#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f
-#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f
-
-//
-// DirectSound3D Algorithms
-//
-
-// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
-#define DS3DALG_DEFAULT GUID_NULL
-
-// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
-DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
-
-// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
-DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
-
-// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
-DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
-
-
-#if DIRECTSOUND_VERSION >= 0x0800
-
-//
-// DirectSound Internal Effect Algorithms
-//
-
-
-// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF}
-DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf);
-
-// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6}
-DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6);
-
-// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98}
-DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98);
-
-// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D}
-DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d);
-
-// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21}
-DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21);
-
-// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57}
-DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57);
-
-// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231}
-DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31);
-
-// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4}
-DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4);
-
-// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
-DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c);
-
-//
-// DirectSound Capture Effect Algorithms
-//
-
-
-// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1}
-// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h
-DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
-
-// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40}
-DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40);
-
-// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810}
-DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10);
-
-// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5}
-// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h
-DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5);
-
-// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D}
-DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d);
-
-// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0}
-DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0);
-
-#endif // DIRECTSOUND_VERSION >= 0x0800
-
-#endif // __DSOUND_INCLUDED__
-
-
-
-#ifdef __cplusplus
-};
-#endif // __cplusplus
-
diff --git a/3rdparty/dxsdk/Include/dxdiag.h b/3rdparty/dxsdk/Include/dxdiag.h
deleted file mode 100644
index 602c88f0189..00000000000
--- a/3rdparty/dxsdk/Include/dxdiag.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*==========================================================================;
- *
- * Copyright (C) Microsoft Corporation. All Rights Reserved.
- *
- * File: dxdiag.h
- * Content: DirectX Diagnostic Tool include file
- *
- ****************************************************************************/
-
-#ifndef _DXDIAG_H_
-#define _DXDIAG_H_
-
-#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
-
-// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an
-// application was built against the correct header files. This number is
-// incremented whenever a header (or other) change would require applications
-// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail.
-// (The number itself has no meaning.)
-#define DXDIAG_DX9_SDK_VERSION 111
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/****************************************************************************
- *
- * DxDiag Errors
- *
- ****************************************************************************/
-#define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
-
-
-/****************************************************************************
- *
- * DxDiag CLSIDs
- *
- ****************************************************************************/
-
-// {A65B8071-3BFE-4213-9A5B-491DA4461CA7}
-DEFINE_GUID(CLSID_DxDiagProvider,
-0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
-
-
-/****************************************************************************
- *
- * DxDiag Interface IIDs
- *
- ****************************************************************************/
-
-// {9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}
-DEFINE_GUID(IID_IDxDiagProvider,
-0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
-
-// {0x7D0F462F-0x4064-0x4862-BC7F-933E5058C10F}
-DEFINE_GUID(IID_IDxDiagContainer,
-0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
-
-
-/****************************************************************************
- *
- * DxDiag Interface Pointer definitions
- *
- ****************************************************************************/
-
-typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
-
-typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
-
-
-/****************************************************************************
- *
- * DxDiag Structures
- *
- ****************************************************************************/
-
-typedef struct _DXDIAG_INIT_PARAMS
-{
- DWORD dwSize; // Size of this structure.
- DWORD dwDxDiagHeaderVersion; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies
- // the header and dll are correctly matched.
- BOOL bAllowWHQLChecks; // If true, allow dxdiag to check if drivers are
- // digital signed as logo'd by WHQL which may
- // connect via internet to update WHQL certificates.
- VOID* pReserved; // Reserved. Must be NULL.
-} DXDIAG_INIT_PARAMS;
-
-
-/****************************************************************************
- *
- * DxDiag Application Interfaces
- *
- ****************************************************************************/
-
-//
-// COM definition for IDxDiagProvider
-//
-#undef INTERFACE // External COM Implementation
-#define INTERFACE IDxDiagProvider
-DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- /*** IDxDiagProvider methods ***/
- STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
- STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE;
-};
-
-
-//
-// COM definition for IDxDiagContainer
-//
-#undef INTERFACE // External COM Implementation
-#define INTERFACE IDxDiagContainer
-DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
-{
- /*** IUnknown methods ***/
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
-
- /*** IDxDiagContainer methods ***/
- STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE;
- STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
- STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE;
- STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE;
- STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
- STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE;
-};
-
-
-/****************************************************************************
- *
- * DxDiag application interface macros
- *
- ****************************************************************************/
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-
-#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
-#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
-#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
-
-#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
-#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
-#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
-#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
-#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
-#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c)
-#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
-
-#else /* C++ */
-
-#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
-#define IDxDiagProvider_AddRef(p) (p)->AddRef(p)
-#define IDxDiagProvider_Release(p) (p)->Release(p)
-#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(p,a,b)
-#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(p,a)
-
-#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
-#define IDxDiagContainer_AddRef(p) (p)->AddRef(p)
-#define IDxDiagContainer_Release(p) (p)->Release(p)
-#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(p,a)
-#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(p,a,b,c)
-#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(p,a,b)
-#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(p,a)
-#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(p,a,b,c)
-#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(p,a,b)
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DXDIAG_H_ */
-
-
diff --git a/3rdparty/dxsdk/Include/dxfile.h b/3rdparty/dxsdk/Include/dxfile.h
deleted file mode 100644
index 74e80e585b4..00000000000
--- a/3rdparty/dxsdk/Include/dxfile.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/***************************************************************************
- *
- * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
- *
- * File: dxfile.h
- *
- * Content: DirectX File public header file
- *
- ***************************************************************************/
-
-#ifndef __DXFILE_H__
-#define __DXFILE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef DWORD DXFILEFORMAT;
-
-#define DXFILEFORMAT_BINARY 0
-#define DXFILEFORMAT_TEXT 1
-#define DXFILEFORMAT_COMPRESSED 2
-
-typedef DWORD DXFILELOADOPTIONS;
-
-#define DXFILELOAD_FROMFILE 0x00L
-#define DXFILELOAD_FROMRESOURCE 0x01L
-#define DXFILELOAD_FROMMEMORY 0x02L
-#define DXFILELOAD_FROMSTREAM 0x04L
-#define DXFILELOAD_FROMURL 0x08L
-
-typedef struct _DXFILELOADRESOURCE {
- HMODULE hModule;
- LPCTSTR lpName;
- LPCTSTR lpType;
-}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
-
-typedef struct _DXFILELOADMEMORY {
- LPVOID lpMemory;
- DWORD dSize;
-}DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
-
-/*
- * DirectX File object types.
- */
-
-#ifndef WIN_TYPES
-#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
-#endif
-
-WIN_TYPES(IDirectXFile, DIRECTXFILE);
-WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT);
-WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT);
-WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT);
-WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA);
-WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE);
-WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY);
-
-/*
- * API for creating IDirectXFile interface.
- */
-
-STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
-
-/*
- * The methods for IUnknown
- */
-
-#define IUNKNOWN_METHODS(kind) \
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
- STDMETHOD_(ULONG, AddRef) (THIS) kind; \
- STDMETHOD_(ULONG, Release) (THIS) kind
-
-/*
- * The methods for IDirectXFileObject
- */
-
-#define IDIRECTXFILEOBJECT_METHODS(kind) \
- STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
- STDMETHOD(GetId) (THIS_ LPGUID) kind
-
-/*
- * DirectX File interfaces.
- */
-
-#undef INTERFACE
-#define INTERFACE IDirectXFile
-
-DECLARE_INTERFACE_(IDirectXFile, IUnknown)
-{
- IUNKNOWN_METHODS(PURE);
- STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS,
- LPDIRECTXFILEENUMOBJECT *) PURE;
- STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT,
- LPDIRECTXFILESAVEOBJECT *) PURE;
- STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileEnumObject
-
-DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown)
-{
- IUNKNOWN_METHODS(PURE);
- STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE;
- STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE;
- STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileSaveObject
-
-DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown)
-{
- IUNKNOWN_METHODS(PURE);
- STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE;
- STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *,
- DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE;
- STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
-};
-
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileObject
-
-DECLARE_INTERFACE_(IDirectXFileObject, IUnknown)
-{
- IUNKNOWN_METHODS(PURE);
- IDIRECTXFILEOBJECT_METHODS(PURE);
-};
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileData
-
-DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject)
-{
- IUNKNOWN_METHODS(PURE);
- IDIRECTXFILEOBJECT_METHODS(PURE);
-
- STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE;
- STDMETHOD(GetType) (THIS_ const GUID **) PURE;
- STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE;
- STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE;
- STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE;
- STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileDataReference
-
-DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject)
-{
- IUNKNOWN_METHODS(PURE);
- IDIRECTXFILEOBJECT_METHODS(PURE);
-
- STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
-};
-
-#undef INTERFACE
-#define INTERFACE IDirectXFileBinary
-
-DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject)
-{
- IUNKNOWN_METHODS(PURE);
- IDIRECTXFILEOBJECT_METHODS(PURE);
-
- STDMETHOD(GetSize) (THIS_ DWORD *) PURE;
- STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE;
- STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
-};
-
-/*
- * DirectXFile Object Class Id (for CoCreateInstance())
- */
-
-DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
-
-/*
- * DirectX File Interface GUIDs.
- */
-
-DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/*
- * DirectX File Header template's GUID.
- */
-
-DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-
-/*
- * DirectX File errors.
- */
-
-#define _FACDD 0x876
-#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
-
-#define DXFILE_OK 0
-
-#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
-#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
-#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
-#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
-#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
-#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
-#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
-#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
-#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
-#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
-#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
-#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
-#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
-#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
-#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
-#define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
-#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
-#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
-#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
-#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
-#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
-#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
-#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
-#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
-#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
-#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
-#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _DXFILE_H_ */
diff --git a/3rdparty/dxsdk/Include/dxsdkver.h b/3rdparty/dxsdk/Include/dxsdkver.h
deleted file mode 100644
index 7d88bbbb03d..00000000000
--- a/3rdparty/dxsdk/Include/dxsdkver.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*==========================================================================;
- *
- *
- * File: dxsdkver.h
- * Content: DirectX SDK Version Include File
- *
- ****************************************************************************/
-
-#ifndef _DXSDKVER_H_
-#define _DXSDKVER_H_
-
-#define _DXSDK_PRODUCT_MAJOR 9
-#define _DXSDK_PRODUCT_MINOR 29
-#define _DXSDK_BUILD_MAJOR 1962
-#define _DXSDK_BUILD_MINOR 0
-
-#endif // _DXSDKVER_H_
-
diff --git a/3rdparty/dxsdk/Include/gameux.h b/3rdparty/dxsdk/Include/gameux.h
deleted file mode 100644
index 891ede00c84..00000000000
--- a/3rdparty/dxsdk/Include/gameux.h
+++ /dev/null
@@ -1,721 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 7.00.0550 */
-/* Compiler settings for gameux.idl:
- Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0550
- protocol : dce , ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-/* @@MIDL_FILE_HEADING( ) */
-
-#ifdef _MSC_VER
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-#endif // _MSC_VER
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 475
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __gameux_h__
-#define __gameux_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __IGameExplorer_FWD_DEFINED__
-#define __IGameExplorer_FWD_DEFINED__
-typedef interface IGameExplorer IGameExplorer;
-#endif /* __IGameExplorer_FWD_DEFINED__ */
-
-
-#ifndef __IGameStatistics_FWD_DEFINED__
-#define __IGameStatistics_FWD_DEFINED__
-typedef interface IGameStatistics IGameStatistics;
-#endif /* __IGameStatistics_FWD_DEFINED__ */
-
-
-#ifndef __IGameStatisticsMgr_FWD_DEFINED__
-#define __IGameStatisticsMgr_FWD_DEFINED__
-typedef interface IGameStatisticsMgr IGameStatisticsMgr;
-#endif /* __IGameStatisticsMgr_FWD_DEFINED__ */
-
-
-#ifndef __IGameExplorer2_FWD_DEFINED__
-#define __IGameExplorer2_FWD_DEFINED__
-typedef interface IGameExplorer2 IGameExplorer2;
-#endif /* __IGameExplorer2_FWD_DEFINED__ */
-
-
-#ifndef __GameExplorer_FWD_DEFINED__
-#define __GameExplorer_FWD_DEFINED__
-
-#ifdef __cplusplus
-typedef class GameExplorer GameExplorer;
-#else
-typedef struct GameExplorer GameExplorer;
-#endif /* __cplusplus */
-
-#endif /* __GameExplorer_FWD_DEFINED__ */
-
-
-#ifndef __GameStatistics_FWD_DEFINED__
-#define __GameStatistics_FWD_DEFINED__
-
-#ifdef __cplusplus
-typedef class GameStatistics GameStatistics;
-#else
-typedef struct GameStatistics GameStatistics;
-#endif /* __cplusplus */
-
-#endif /* __GameStatistics_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "shobjidl.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_gameux_0000_0000 */
-/* [local] */
-
-#define ID_GDF_XML __GDF_XML
-#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL
-#define ID_ICON_ICO __ICON_ICO
-#define ID_GDF_XML_STR L"__GDF_XML"
-#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL"
-typedef /* [v1_enum] */
-enum GAME_INSTALL_SCOPE
- { GIS_NOT_INSTALLED = 1,
- GIS_CURRENT_USER = 2,
- GIS_ALL_USERS = 3
- } GAME_INSTALL_SCOPE;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec;
-
-#ifndef __IGameExplorer_INTERFACE_DEFINED__
-#define __IGameExplorer_INTERFACE_DEFINED__
-
-/* interface IGameExplorer */
-/* [unique][helpstring][uuid][object] */
-
-
-EXTERN_C const IID IID_IGameExplorer;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E")
- IGameExplorer : public IUnknown
- {
- public:
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame(
- /* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
- /* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
- /* [in] */ GAME_INSTALL_SCOPE installScope,
- /* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame(
- /* [in] */ GUID guidInstanceID) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame(
- /* [in] */ GUID guidInstanceID) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess(
- /* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
- /* [out] */ __RPC__out BOOL *pfHasAccess) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct IGameExplorerVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- __RPC__in IGameExplorer * This,
- /* [in] */ __RPC__in REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- __RPC__in IGameExplorer * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- __RPC__in IGameExplorer * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )(
- __RPC__in IGameExplorer * This,
- /* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
- /* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
- /* [in] */ GAME_INSTALL_SCOPE installScope,
- /* [out][in] */ __RPC__inout GUID *pguidInstanceID);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )(
- __RPC__in IGameExplorer * This,
- /* [in] */ GUID guidInstanceID);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )(
- __RPC__in IGameExplorer * This,
- /* [in] */ GUID guidInstanceID);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )(
- __RPC__in IGameExplorer * This,
- /* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
- /* [out] */ __RPC__out BOOL *pfHasAccess);
-
- END_INTERFACE
- } IGameExplorerVtbl;
-
- interface IGameExplorer
- {
- CONST_VTBL struct IGameExplorerVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGameExplorer_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define IGameExplorer_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define IGameExplorer_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \
- ( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) )
-
-#define IGameExplorer_RemoveGame(This,guidInstanceID) \
- ( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) )
-
-#define IGameExplorer_UpdateGame(This,guidInstanceID) \
- ( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) )
-
-#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \
- ( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __IGameExplorer_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_gameux_0000_0001 */
-/* [local] */
-
-typedef /* [v1_enum] */
-enum GAMESTATS_OPEN_TYPE
- { GAMESTATS_OPEN_OPENORCREATE = 0,
- GAMESTATS_OPEN_OPENONLY = 1
- } GAMESTATS_OPEN_TYPE;
-
-typedef /* [v1_enum] */
-enum GAMESTATS_OPEN_RESULT
- { GAMESTATS_OPEN_CREATED = 0,
- GAMESTATS_OPEN_OPENED = 1
- } GAMESTATS_OPEN_RESULT;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_s_ifspec;
-
-#ifndef __IGameStatistics_INTERFACE_DEFINED__
-#define __IGameStatistics_INTERFACE_DEFINED__
-
-/* interface IGameStatistics */
-/* [unique][helpstring][uuid][object] */
-
-
-EXTERN_C const IID IID_IGameStatistics;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("3887C9CA-04A0-42ae-BC4C-5FA6C7721145")
- IGameStatistics : public IUnknown
- {
- public:
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategoryLength(
- /* [retval][out] */ __RPC__out UINT *cch) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxNameLength(
- /* [retval][out] */ __RPC__out UINT *cch) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxValueLength(
- /* [retval][out] */ __RPC__out UINT *cch) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategories(
- /* [retval][out] */ __RPC__out WORD *pMax) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxStatsPerCategory(
- /* [retval][out] */ __RPC__out WORD *pMax) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCategoryTitle(
- /* [in] */ WORD categoryIndex,
- /* [string][in] */ __RPC__in_string LPCWSTR title) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCategoryTitle(
- /* [in] */ WORD categoryIndex,
- /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatistic(
- /* [in] */ WORD categoryIndex,
- /* [in] */ WORD statIndex,
- /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
- /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStatistic(
- /* [in] */ WORD categoryIndex,
- /* [in] */ WORD statIndex,
- /* [string][in] */ __RPC__in_string LPCWSTR name,
- /* [string][in] */ __RPC__in_string LPCWSTR value) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save(
- /* [in] */ BOOL trackChanges) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLastPlayedCategory(
- /* [in] */ UINT categoryIndex) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastPlayedCategory(
- /* [retval][out] */ __RPC__out UINT *pCategoryIndex) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct IGameStatisticsVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- __RPC__in IGameStatistics * This,
- /* [in] */ __RPC__in REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- __RPC__in IGameStatistics * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- __RPC__in IGameStatistics * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategoryLength )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out UINT *cch);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxNameLength )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out UINT *cch);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxValueLength )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out UINT *cch);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategories )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out WORD *pMax);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxStatsPerCategory )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out WORD *pMax);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCategoryTitle )(
- __RPC__in IGameStatistics * This,
- /* [in] */ WORD categoryIndex,
- /* [string][in] */ __RPC__in_string LPCWSTR title);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCategoryTitle )(
- __RPC__in IGameStatistics * This,
- /* [in] */ WORD categoryIndex,
- /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatistic )(
- __RPC__in IGameStatistics * This,
- /* [in] */ WORD categoryIndex,
- /* [in] */ WORD statIndex,
- /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
- /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStatistic )(
- __RPC__in IGameStatistics * This,
- /* [in] */ WORD categoryIndex,
- /* [in] */ WORD statIndex,
- /* [string][in] */ __RPC__in_string LPCWSTR name,
- /* [string][in] */ __RPC__in_string LPCWSTR value);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Save )(
- __RPC__in IGameStatistics * This,
- /* [in] */ BOOL trackChanges);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLastPlayedCategory )(
- __RPC__in IGameStatistics * This,
- /* [in] */ UINT categoryIndex);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastPlayedCategory )(
- __RPC__in IGameStatistics * This,
- /* [retval][out] */ __RPC__out UINT *pCategoryIndex);
-
- END_INTERFACE
- } IGameStatisticsVtbl;
-
- interface IGameStatistics
- {
- CONST_VTBL struct IGameStatisticsVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGameStatistics_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define IGameStatistics_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define IGameStatistics_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define IGameStatistics_GetMaxCategoryLength(This,cch) \
- ( (This)->lpVtbl -> GetMaxCategoryLength(This,cch) )
-
-#define IGameStatistics_GetMaxNameLength(This,cch) \
- ( (This)->lpVtbl -> GetMaxNameLength(This,cch) )
-
-#define IGameStatistics_GetMaxValueLength(This,cch) \
- ( (This)->lpVtbl -> GetMaxValueLength(This,cch) )
-
-#define IGameStatistics_GetMaxCategories(This,pMax) \
- ( (This)->lpVtbl -> GetMaxCategories(This,pMax) )
-
-#define IGameStatistics_GetMaxStatsPerCategory(This,pMax) \
- ( (This)->lpVtbl -> GetMaxStatsPerCategory(This,pMax) )
-
-#define IGameStatistics_SetCategoryTitle(This,categoryIndex,title) \
- ( (This)->lpVtbl -> SetCategoryTitle(This,categoryIndex,title) )
-
-#define IGameStatistics_GetCategoryTitle(This,categoryIndex,pTitle) \
- ( (This)->lpVtbl -> GetCategoryTitle(This,categoryIndex,pTitle) )
-
-#define IGameStatistics_GetStatistic(This,categoryIndex,statIndex,pName,pValue) \
- ( (This)->lpVtbl -> GetStatistic(This,categoryIndex,statIndex,pName,pValue) )
-
-#define IGameStatistics_SetStatistic(This,categoryIndex,statIndex,name,value) \
- ( (This)->lpVtbl -> SetStatistic(This,categoryIndex,statIndex,name,value) )
-
-#define IGameStatistics_Save(This,trackChanges) \
- ( (This)->lpVtbl -> Save(This,trackChanges) )
-
-#define IGameStatistics_SetLastPlayedCategory(This,categoryIndex) \
- ( (This)->lpVtbl -> SetLastPlayedCategory(This,categoryIndex) )
-
-#define IGameStatistics_GetLastPlayedCategory(This,pCategoryIndex) \
- ( (This)->lpVtbl -> GetLastPlayedCategory(This,pCategoryIndex) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __IGameStatistics_INTERFACE_DEFINED__ */
-
-
-#ifndef __IGameStatisticsMgr_INTERFACE_DEFINED__
-#define __IGameStatisticsMgr_INTERFACE_DEFINED__
-
-/* interface IGameStatisticsMgr */
-/* [unique][helpstring][uuid][object] */
-
-
-EXTERN_C const IID IID_IGameStatisticsMgr;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("AFF3EA11-E70E-407d-95DD-35E612C41CE2")
- IGameStatisticsMgr : public IUnknown
- {
- public:
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGameStatistics(
- /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
- /* [in] */ GAMESTATS_OPEN_TYPE openType,
- /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
- /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGameStatistics(
- /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct IGameStatisticsMgrVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- __RPC__in IGameStatisticsMgr * This,
- /* [in] */ __RPC__in REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- __RPC__in IGameStatisticsMgr * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- __RPC__in IGameStatisticsMgr * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGameStatistics )(
- __RPC__in IGameStatisticsMgr * This,
- /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
- /* [in] */ GAMESTATS_OPEN_TYPE openType,
- /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
- /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGameStatistics )(
- __RPC__in IGameStatisticsMgr * This,
- /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath);
-
- END_INTERFACE
- } IGameStatisticsMgrVtbl;
-
- interface IGameStatisticsMgr
- {
- CONST_VTBL struct IGameStatisticsMgrVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGameStatisticsMgr_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define IGameStatisticsMgr_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define IGameStatisticsMgr_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define IGameStatisticsMgr_GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) \
- ( (This)->lpVtbl -> GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) )
-
-#define IGameStatisticsMgr_RemoveGameStatistics(This,GDFBinaryPath) \
- ( (This)->lpVtbl -> RemoveGameStatistics(This,GDFBinaryPath) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __IGameStatisticsMgr_INTERFACE_DEFINED__ */
-
-
-#ifndef __IGameExplorer2_INTERFACE_DEFINED__
-#define __IGameExplorer2_INTERFACE_DEFINED__
-
-/* interface IGameExplorer2 */
-/* [unique][helpstring][uuid][object] */
-
-
-EXTERN_C const IID IID_IGameExplorer2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("86874AA7-A1ED-450d-A7EB-B89E20B2FFF3")
- IGameExplorer2 : public IUnknown
- {
- public:
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InstallGame(
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
- /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
- /* [in] */ GAME_INSTALL_SCOPE installScope) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UninstallGame(
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath) = 0;
-
- virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckAccess(
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
- /* [retval][out] */ __RPC__out BOOL *pHasAccess) = 0;
-
- };
-
-#else /* C style interface */
-
- typedef struct IGameExplorer2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- __RPC__in IGameExplorer2 * This,
- /* [in] */ __RPC__in REFIID riid,
- /* [annotation][iid_is][out] */
- __RPC__deref_out void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- __RPC__in IGameExplorer2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- __RPC__in IGameExplorer2 * This);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InstallGame )(
- __RPC__in IGameExplorer2 * This,
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
- /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
- /* [in] */ GAME_INSTALL_SCOPE installScope);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UninstallGame )(
- __RPC__in IGameExplorer2 * This,
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath);
-
- /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckAccess )(
- __RPC__in IGameExplorer2 * This,
- /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
- /* [retval][out] */ __RPC__out BOOL *pHasAccess);
-
- END_INTERFACE
- } IGameExplorer2Vtbl;
-
- interface IGameExplorer2
- {
- CONST_VTBL struct IGameExplorer2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define IGameExplorer2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define IGameExplorer2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define IGameExplorer2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define IGameExplorer2_InstallGame(This,binaryGDFPath,installDirectory,installScope) \
- ( (This)->lpVtbl -> InstallGame(This,binaryGDFPath,installDirectory,installScope) )
-
-#define IGameExplorer2_UninstallGame(This,binaryGDFPath) \
- ( (This)->lpVtbl -> UninstallGame(This,binaryGDFPath) )
-
-#define IGameExplorer2_CheckAccess(This,binaryGDFPath,pHasAccess) \
- ( (This)->lpVtbl -> CheckAccess(This,binaryGDFPath,pHasAccess) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __IGameExplorer2_INTERFACE_DEFINED__ */
-
-
-
-#ifndef __gameuxLib_LIBRARY_DEFINED__
-#define __gameuxLib_LIBRARY_DEFINED__
-
-/* library gameuxLib */
-/* [helpstring][version][uuid] */
-
-
-EXTERN_C const IID LIBID_gameuxLib;
-
-EXTERN_C const CLSID CLSID_GameExplorer;
-
-#ifdef __cplusplus
-
-class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC")
-GameExplorer;
-#endif
-
-EXTERN_C const CLSID CLSID_GameStatistics;
-
-#ifdef __cplusplus
-
-class DECLSPEC_UUID("DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4")
-GameStatistics;
-#endif
-#endif /* __gameuxLib_LIBRARY_DEFINED__ */
-
-/* Additional Prototypes for ALL interfaces */
-
-unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
-unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
-unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
-void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * );
-
-unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
-unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
-unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
-void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * );
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
diff --git a/3rdparty/dxsdk/Include/rmxfguid.h b/3rdparty/dxsdk/Include/rmxfguid.h
deleted file mode 100644
index d3326ccc9aa..00000000000
--- a/3rdparty/dxsdk/Include/rmxfguid.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/***************************************************************************
- *
- * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
- *
- * File: rmxfguid.h
- *
- * Content: Defines GUIDs of D3DRM's templates.
- *
- ***************************************************************************/
-
-#ifndef __RMXFGUID_H_
-#define __RMXFGUID_H_
-
-/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMInfo,
-0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMMesh,
-0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMVector,
-0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMMeshFace,
-0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMMaterial,
-0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialArray,
-0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMFrame,
-0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {F6F23F41-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMFrameTransformMatrix,
-0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F6F23F42-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMeshMaterialList,
-0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F6F23F40-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMeshTextureCoords,
-0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F6F23F43-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMeshNormals,
-0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F6F23F44-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMCoords2d,
-0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F6F23F45-7686-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMatrix4x4,
-0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMAnimation,
-0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMAnimationSet,
-0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {10DD46A8-775B-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMAnimationKey,
-0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {10DD46A9-775B-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMFloatKeys,
-0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {01411840-7786-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialAmbientColor,
-0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {01411841-7786-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialDiffuseColor,
-0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {01411842-7786-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialSpecularColor,
-0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {D3E16E80-7835-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialEmissiveColor,
-0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {01411843-7786-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialPower,
-0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMColorRGBA,
-0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
-
-/* {D3E16E81-7835-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMColorRGB,
-0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {A42790E0-7810-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMGuid,
-0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {A42790E1-7810-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMTextureFilename,
-0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {A42790E2-7810-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMTextureReference,
-0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {1630B820-7842-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMIndexedColor,
-0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {1630B821-7842-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMeshVertexColors,
-0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {4885AE60-78E8-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMMaterialWrap,
-0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */
-DEFINE_GUID(TID_D3DRMBoolean,
-0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
-
-/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */
-DEFINE_GUID(TID_D3DRMMeshFaceWraps,
-0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
-
-/* {4885AE63-78E8-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMBoolean2d,
-0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {F406B180-7B3B-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMTimedFloatKeys,
-0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMAnimationOptions,
-0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMFramePosition,
-0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMFrameVelocity,
-0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */
-DEFINE_GUID(TID_D3DRMFrameRotation,
-0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
-
-/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMLight,
-0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMCamera,
-0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */
-DEFINE_GUID(TID_D3DRMAppData,
-0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
-
-/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */
-DEFINE_GUID(TID_D3DRMLightUmbra,
-0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
-
-/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */
-DEFINE_GUID(TID_D3DRMLightRange,
-0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
-
-/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */
-DEFINE_GUID(TID_D3DRMLightPenumbra,
-0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
-
-/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */
-DEFINE_GUID(TID_D3DRMLightAttenuation,
-0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
-
-/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMInlineData,
-0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */
-DEFINE_GUID(TID_D3DRMUrl,
-0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
-
-/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */
-DEFINE_GUID(TID_D3DRMProgressiveMesh,
-0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B);
-
-/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */
-DEFINE_GUID(TID_D3DRMExternalVisual,
-0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71);
-
-/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */
-DEFINE_GUID(TID_D3DRMStringProperty,
-0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
-
-/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */
-DEFINE_GUID(TID_D3DRMPropertyBag,
-0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
-
-// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
-DEFINE_GUID(TID_D3DRMRightHanded,
-0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
-
-#endif /* __RMXFGUID_H_ */
-
diff --git a/3rdparty/dxsdk/Include/rmxftmpl.h b/3rdparty/dxsdk/Include/rmxftmpl.h
deleted file mode 100644
index e0018d04615..00000000000
--- a/3rdparty/dxsdk/Include/rmxftmpl.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/* D3DRM XFile templates in binary form */
-
-#ifndef _RMXFTMPL_H_
-#define _RMXFTMPL_H_
-
-unsigned char D3DRM_XTEMPLATES[] = {
- 0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62,
- 0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1,
- 0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65,
- 0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda,
- 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
- 0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d,
- 0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0,
- 0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14,
- 0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d,
- 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71,
- 0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0,
- 0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
- 0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
- 0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
- 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
- 0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2,
- 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
- 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
- 0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
- 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
- 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
- 0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f,
- 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
- 0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0,
- 0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78,
- 0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0,
- 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0,
- 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
- 0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c,
- 0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94,
- 0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72,
- 0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0,
- 0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a,
- 0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75,
- 0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0,
- 0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0,
- 0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f,
- 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0,
- 0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52,
- 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0,
- 0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a,
- 0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65,
- 0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0,
- 0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0,
- 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e,
- 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78,
- 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
- 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e,
- 0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0,
- 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41,
- 0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65,
- 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0,
- 0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f,
- 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0,
- 0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0,
- 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9,
- 0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c,
- 0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
- 0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
- 0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85,
- 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
- 0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42,
- 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0,
- 0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0,
- 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0,
- 0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f,
- 0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74,
- 0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa,
- 0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf,
- 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
- 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65,
- 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14,
- 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f,
- 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0,
- 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf,
- 0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
- 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0,
- 0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11,
- 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0,
- 0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65,
- 0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65,
- 0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab,
- 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20,
- 0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1,
- 0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43,
- 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0,
- 0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14,
- 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c,
- 0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0,
- 0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43,
- 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0,
- 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
- 0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73,
- 0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14,
- 0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf,
- 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0,
- 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa,
- 0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
- 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
- 0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61,
- 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e,
- 0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29,
- 0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63,
- 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64,
- 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0,
- 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72,
- 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73,
- 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
- 0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61,
- 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5,
- 0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94,
- 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1,
- 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
- 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
- 0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0,
- 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1,
- 0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57,
- 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe,
- 0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61,
- 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
- 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
- 0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2,
- 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
- 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0,
- 0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43,
- 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1,
- 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
- 0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74,
- 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
- 0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0,
- 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f,
- 0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0,
- 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65,
- 0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c,
- 0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f,
- 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
- 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0,
- 0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61,
- 0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0,
- 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64,
- 0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0,
- 0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
- 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1,
- 0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
- 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14,
- 0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d,
- 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d,
- 0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
- 0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76,
- 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
- 0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e,
- 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0,
- 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f,
- 0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8,
- 0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
- 0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc,
- 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f,
- 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1,
- 0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46,
- 0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66,
- 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
- 0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46,
- 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
- 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
- 0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65,
- 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
- 0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78,
- 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
- 0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56,
- 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0,
- 0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f,
- 0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76,
- 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e,
- 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
- 0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
- 0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62,
- 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
- 0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56,
- 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34,
- 0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76,
- 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1,
- 0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74,
- 0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0,
- 0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63,
- 0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0,
- 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65,
- 0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
- 0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e,
- 0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe,
- 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46,
- 0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa,
- 0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf,
- 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
- 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
- 0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0,
- 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69,
- 0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5,
- 0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0,
- 0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11,
- 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0,
- 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0,
- 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c,
- 0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5,
- 0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f,
- 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1,
- 0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0,
- 0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
- 0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56,
- 0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54,
- 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b,
- 0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6,
- 0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
- 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0,
- 0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9,
- 0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
- 0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66,
- 0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0,
- 0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11,
- 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0,
- 0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54,
- 0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5,
- 0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0,
- 0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69,
- 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
- 0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65,
- 0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0,
- 0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41,
- 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0,
- 0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0,
- 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa,
- 0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
- 0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf,
- 0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
- 0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0,
- 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0,
- 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa,
- 0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
- 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe,
- 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41,
- 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65,
- 0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda,
- 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
- 0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41,
- 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0,
- 0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0,
- 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61,
- 0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94,
- 0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
- 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49,
- 0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0,
- 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa,
- 0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0,
- 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
- 0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72,
- 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0,
- 0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0,
- 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c,
- 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
- 0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72,
- 0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68,
- 0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99,
- 0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b,
- 0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72,
- 0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49,
- 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf,
- 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0,
- 0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0,
- 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0,
- 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5,
- 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0,
- 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61,
- 0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5,
- 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0,
- 0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0,
- 0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8,
- 0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f,
- 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72,
- 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
- 0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1,
- 0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72,
- 0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b,
- 0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0,
- 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb,
- 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50,
- 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67,
- 0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf,
- 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71,
- 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74,
- 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
- 0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
- 0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
- 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0,
- 0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11,
- 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0,
- 0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0,
- 0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78,
- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75,
- 0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0,
- 0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
- 0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
- 0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0,
- 0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0,
- 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc,
- 0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
- 0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0
-};
-
-#define D3DRM_XTEMPLATE_BYTES 3278
-
-#endif /* _RMXFTMPL_H_ */
diff --git a/3rdparty/dxsdk/Include/rpcsal.h b/3rdparty/dxsdk/Include/rpcsal.h
deleted file mode 100644
index 484ddc94894..00000000000
--- a/3rdparty/dxsdk/Include/rpcsal.h
+++ /dev/null
@@ -1,499 +0,0 @@
-/****************************************************************\
-* *
-* rpcsal.h - markers for documenting the semantics of RPC APIs *
-* *
-* Version 1.0 *
-* *
-* Copyright (c) 2004 Microsoft Corporation. All rights reserved. *
-* *
-\****************************************************************/
-
-// -------------------------------------------------------------------------------
-// Introduction
-//
-// rpcsal.h provides a set of annotations to describe how RPC functions use their
-// parameters - the assumptions it makes about them, adn the guarantees it makes
-// upon finishing. These annotations are similar to those found in specstrings.h,
-// but are designed to be used by the MIDL compiler when it generates annotations
-// enabled header files.
-//
-// IDL authors do not need to annotate their functions declarations. The MIDL compiler
-// will interpret the IDL directives and use one of the annotations contained
-// in this header. This documentation is intended to help those trying to understand
-// the MIDL-generated header files or those who maintain their own copies of these files.
-//
-// -------------------------------------------------------------------------------
-// Differences between rpcsal.h and specstrings.h
-//
-// There are a few important differences between the annotations found in rpcsal.h and
-// those in specstrings.h:
-//
-// 1. [in] parameters are not marked as read-only. They may be used for scratch space
-// at the server and changes will not affect the client.
-// 2. String versions of each macro alleviates the need for a special type definition
-//
-// -------------------------------------------------------------------------------
-// Interpreting RPC Annotations
-//
-// These annotations are interpreted precisely in the same way as those in specstrings.h.
-// Please refer to that header for information related to general usage in annotations.
-//
-// To construct an RPC annotation, concatenate the appropriate value from each category
-// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string".
-//
-// |----------------------------------------------------------------------------------|
-// | RPC Annotations |
-// |------------|------------|---------|--------|----------|----------|---------------|
-// | Level | Usage | Size | Output | Optional | String | Parameters |
-// |------------|------------|---------|--------|----------|----------|---------------|
-// | <> | <> | <> | <> | <> | <> | <> |
-// | _deref | _in | _ecount | _full | _opt | _string | (size) |
-// | _deref_opt | _out | _bcount | _part | | | (size,length) |
-// | | _inout | | | | | |
-// | | | | | | | |
-// |------------|------------|---------|--------|----------|----------|---------------|
-//
-// Level: Describes the buffer pointer's level of indirection from the parameter or
-// return value 'p'.
-//
-// <> : p is the buffer pointer.
-// _deref : *p is the buffer pointer. p must not be NULL.
-// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
-// the annotation is ignored.
-//
-// Usage: Describes how the function uses the buffer.
-//
-// <> : The buffer is not accessed. If used on the return value or with _deref, the
-// function will provide the buffer, and it will be uninitialized at exit.
-// Otherwise, the caller must provide the buffer. This should only be used
-// for alloc and free functions.
-// _in : The function will only read from the buffer. The caller must provide the
-// buffer and initialize it. Cannot be used with _deref.
-// _out : The function will only write to the buffer. If used on the return value or
-// with _deref, the function will provide the buffer and initialize it.
-// Otherwise, the caller must provide the buffer, and the function will
-// initialize it.
-// _inout : The function may freely read from and write to the buffer. The caller must
-// provide the buffer and initialize it. If used with _deref, the buffer may
-// be reallocated by the function.
-//
-// Size: Describes the total size of the buffer. This may be less than the space actually
-// allocated for the buffer, in which case it describes the accessible amount.
-//
-// <> : No buffer size is given. If the type specifies the buffer size (such as
-// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
-// element long. Must be used with _in, _out, or _inout.
-// _ecount : The buffer size is an explicit element count.
-// _bcount : The buffer size is an explicit byte count.
-//
-// Output: Describes how much of the buffer will be initialized by the function. For
-// _inout buffers, this also describes how much is initialized at entry. Omit this
-// category for _in buffers; they must be fully initialized by the caller.
-//
-// <> : The type specifies how much is initialized. For instance, a function initializing
-// an LPWSTR must NULL-terminate the string.
-// _full : The function initializes the entire buffer.
-// _part : The function initializes part of the buffer, and explicitly indicates how much.
-//
-// Optional: Describes if the buffer itself is optional.
-//
-// <> : The pointer to the buffer must not be NULL.
-// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
-//
-// String: Describes if the buffer is NULL terminated
-//
-// <> : The buffer is not assumed to be NULL terminated
-// _string : The buffer is assumed to be NULL terminated once it has been initialized
-//
-// Parameters: Gives explicit counts for the size and length of the buffer.
-//
-// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
-// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
-// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
-// and _bcount_part.
-//
-// Notes:
-//
-// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior
-// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6)
-//
-// 2. The size of the buffer and the amount that has been initialized are separate concepts.
-// Specify the size using _ecount or _bcount. Specify the amount that is initialized using
-// _full, _part, or _string. As a special case, a single element buffer does not need
-// _ecount, _bcount, _full, or _part
-//
-// 3. The count may be less than the total size of the buffer in which case it describes the
-// accessible portion.
-//
-// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations.
-//
-// 5. The placement of _opt when using _deref is important:
-// __RPC__deref_opt_... : Input may be NULL
-// __RPC__deref_..._opt : Output may be NULL
-// __RPC__deref_opt_..._opt : Both input and output may be NULL
-//
-
-#pragma once
-
-#include <specstrings.h>
-
-#ifndef __RPCSAL_H_VERSION__
-#define __RPCSAL_H_VERSION__ ( 100 )
-#endif // __RPCSAL_H_VERSION__
-
-#ifdef __REQUIRED_RPCSAL_H_VERSION__
- #if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ )
- #error incorrect <rpcsal.h> version. Use the header that matches with the MIDL compiler.
- #endif
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif // #ifdef __cplusplus
-
-#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
-
-
-// [in]
-#define __RPC__in __pre __valid
-#define __RPC__in_string __RPC__in __pre __nullterminated
-#define __RPC__in_ecount(size) __RPC__in __pre __elem_readableTo(size)
-#define __RPC__in_ecount_full(size) __RPC__in_ecount(size)
-#define __RPC__in_ecount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated
-#define __RPC__in_ecount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size)
-#define __RPC__in_ecount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull
-#define __RPC__in_ecount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated
-#define __RPC__in_ecount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull
-#define __RPC__in_xcount(size) __RPC__in __pre __elem_readableTo(size)
-#define __RPC__in_xcount_full(size) __RPC__in_ecount(size)
-#define __RPC__in_xcount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated
-#define __RPC__in_xcount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size)
-#define __RPC__in_xcount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull
-#define __RPC__in_xcount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated
-#define __RPC__in_xcount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull
-
-
-#define __RPC__deref_in __RPC__in __deref __notnull
-#define __RPC__deref_in_string __RPC__in __pre __deref __nullterminated
-#define __RPC__deref_in_opt __RPC__deref_in __deref __exceptthat __maybenull
-#define __RPC__deref_in_opt_string __RPC__deref_in_opt __pre __deref __nullterminated
-#define __RPC__deref_opt_in __RPC__in __exceptthat __maybenull
-#define __RPC__deref_opt_in_string __RPC__deref_opt_in __pre __deref __nullterminated
-#define __RPC__deref_opt_in_opt __RPC__deref_opt_in __pre __deref __exceptthat __maybenull
-#define __RPC__deref_opt_in_opt_string __RPC__deref_opt_in_opt __pre __deref __nullterminated
-#define __RPC__deref_in_ecount(size) __RPC__in __pre __deref __elem_readableTo(size)
-#define __RPC__deref_in_ecount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length)
-#define __RPC__deref_in_ecount_full(size) __RPC__deref_in_ecount_part(size, size)
-#define __RPC__deref_in_ecount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull
-#define __RPC__deref_in_ecount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated
-#define __RPC__deref_in_ecount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated
-#define __RPC__deref_in_ecount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull
-#define __RPC__deref_in_ecount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated
-#define __RPC__deref_in_ecount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length)
-#define __RPC__deref_in_xcount(size) __RPC__in __pre __deref __elem_readableTo(size)
-#define __RPC__deref_in_xcount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length)
-#define __RPC__deref_in_xcount_full(size) __RPC__deref_in_ecount_part(size, size)
-#define __RPC__deref_in_xcount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull
-#define __RPC__deref_in_xcount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated
-#define __RPC__deref_in_xcount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated
-#define __RPC__deref_in_xcount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull
-#define __RPC__deref_in_xcount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated
-#define __RPC__deref_in_xcount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length)
-
-// [out]
-#define __RPC__out __out
-#define __RPC__out_ecount(size) __out_ecount(size) __post __elem_writableTo(size)
-#define __RPC__out_ecount_string(size) __RPC__out_ecount(size) __post __nullterminated
-#define __RPC__out_ecount_part(size, length) __RPC__out_ecount(size) __post __elem_readableTo(length)
-#define __RPC__out_ecount_full(size) __RPC__out_ecount_part(size, size)
-#define __RPC__out_ecount_full_string(size) __RPC__out_ecount_full(size) __post __nullterminated
-#define __RPC__out_xcount(size) __out
-#define __RPC__out_xcount_string(size) __RPC__out __post __nullterminated
-#define __RPC__out_xcount_part(size, length) __RPC__out
-#define __RPC__out_xcount_full(size) __RPC__out
-#define __RPC__out_xcount_full_string(size) __RPC__out __post __nullterminated
-
-// [in,out]
-#define __RPC__inout __inout
-#define __RPC__inout_string __RPC__inout __pre __nullterminated __post __nullterminated
-#define __RPC__inout_ecount(size) __inout_ecount(size)
-#define __RPC__inout_ecount_part(size, length) __inout_ecount_part(size, length)
-#define __RPC__inout_ecount_full(size) __RPC__inout_ecount_part(size, size)
-#define __RPC__inout_ecount_full_string(size) __RPC__inout_ecount_full(size) __pre __nullterminated __post __nullterminated
-#define __RPC__inout_xcount(size) __inout
-#define __RPC__inout_xcount_part(size, length) __inout
-#define __RPC__inout_xcount_full(size) __RPC__inout
-#define __RPC__inout_xcount_full_string(size) __RPC__inout __pre __nullterminated __post __nullterminated
-
-// [in,unique]
-#define __RPC__in_opt __RPC__in __pre __exceptthat __maybenull
-#define __RPC__in_opt_string __RPC__in_opt __pre __nullterminated
-#define __RPC__in_ecount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull
-#define __RPC__in_ecount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated
-#define __RPC__in_xcount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull
-#define __RPC__in_xcount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated
-
-// [in,out,unique]
-#define __RPC__inout_opt __inout_opt
-#define __RPC__inout_opt_string __RPC__inout_opt __pre __nullterminated
-#define __RPC__inout_ecount_opt(size) __inout_ecount_opt(size)
-#define __RPC__inout_ecount_part_opt(size, length) __inout_ecount_part_opt(size, length)
-#define __RPC__inout_ecount_full_opt(size) __RPC__inout_ecount_part_opt(size, size)
-#define __RPC__inout_ecount_full_opt_string(size) __RPC__inout_ecount_full_opt(size) __pre __nullterminated __post __nullterminated
-#define __RPC__inout_xcount_opt(size) __inout_opt
-#define __RPC__inout_xcount_part_opt(size, length) __inout_opt
-#define __RPC__inout_xcount_full_opt(size) __RPC__inout_opt
-#define __RPC__inout_xcount_full_opt_string(size) __RPC__inout_opt __pre __nullterminated __post __nullterminated
-
-// [out] **
-#define __RPC__deref_out __deref_out
-#define __RPC__deref_out_string __RPC__deref_out __post __deref __nullterminated
-// Removed "__post __deref __exceptthat __maybenull" so return values from QueryInterface and the like can be trusted without an explicit NULL check.
-// This is a temporary fix until midl.exe can be rev'd to produce more accurate annotations.
-#define __RPC__deref_out_opt __RPC__deref_out
-#define __RPC__deref_out_opt_string __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null
-#define __RPC__deref_out_ecount(size) __deref_out_ecount(size) __post __deref __elem_writableTo(size)
-#define __RPC__deref_out_ecount_part(size, length) __RPC__deref_out_ecount(size) __post __deref __elem_readableTo(length)
-#define __RPC__deref_out_ecount_full(size) __RPC__deref_out_ecount_part(size,size)
-#define __RPC__deref_out_ecount_full_string(size) __RPC__deref_out_ecount_full(size) __post __deref __nullterminated
-#define __RPC__deref_out_xcount(size) __deref_out __post __deref
-#define __RPC__deref_out_xcount_part(size, length) __RPC__deref_out __post __deref
-#define __RPC__deref_out_xcount_full(size) __RPC__deref_out
-#define __RPC__deref_out_xcount_full_string(size) __RPC__deref_out __post __deref __nullterminated
-
-// [in,out] **, second pointer decoration.
-#define __RPC__deref_inout __deref_inout
-#define __RPC__deref_inout_string __RPC__deref_inout __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_inout_opt __deref_inout_opt
-#define __RPC__deref_inout_opt_string __RPC__deref_inout_opt __deref __nullterminated
-#define __RPC__deref_inout_ecount_opt(size) __deref_inout_ecount_opt(size)
-#define __RPC__deref_inout_ecount_part_opt(size, length) __deref_inout_ecount_part_opt(size , length)
-#define __RPC__deref_inout_ecount_full_opt(size) __RPC__deref_inout_ecount_part_opt(size, size)
-#define __RPC__deref_inout_ecount_full(size) __deref_inout_ecount_full(size)
-#define __RPC__deref_inout_ecount_full_string(size) __RPC__deref_inout_ecount_full(size) __post __deref __nullterminated
-#define __RPC__deref_inout_ecount_full_opt_string(size) __RPC__deref_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_inout_xcount_opt(size) __deref_inout_opt
-#define __RPC__deref_inout_xcount_part_opt(size, length) __deref_inout_opt
-#define __RPC__deref_inout_xcount_full_opt(size) __RPC__deref_inout_opt
-#define __RPC__deref_inout_xcount_full(size) __deref_inout
-#define __RPC__deref_inout_xcount_full_string(size) __RPC__deref_inout __post __deref __nullterminated
-#define __RPC__deref_inout_xcount_full_opt_string(size) __RPC__deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
-
-
-// #define __RPC_out_opt out_opt is not allowed in rpc
-
-// [in,out,unique]
-#define __RPC__deref_opt_inout __deref_opt_inout
-#define __RPC__deref_opt_inout_ecount(size) __deref_opt_inout_ecount(size)
-#define __RPC__deref_opt_inout_string __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_opt_inout_ecount_part(size, length) __deref_opt_inout_ecount_part(size, length)
-#define __RPC__deref_opt_inout_ecount_full(size) __deref_opt_inout_ecount_full(size)
-#define __RPC__deref_opt_inout_ecount_full_string(size) __RPC__deref_opt_inout_ecount_full(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_opt_inout_xcount_part(size, length) __deref_opt_inout
-#define __RPC__deref_opt_inout_xcount_full(size) __deref_opt_inout
-#define __RPC__deref_opt_inout_xcount_full_string(size) __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
-
-
-// We don't need to specify __pre __deref __exceptthat __maybenull : this is default behavior. While this might not hold in SAL 1.1 syntax, SAL team
-// believes it's OK. We can revisit if SAL 1.1 can survive.
-#define __RPC__deref_out_ecount_opt(size) __RPC__out_ecount(size) __post __deref __exceptthat __maybenull __pre __deref __null
-#define __RPC__deref_out_ecount_part_opt(size, length) __RPC__deref_out_ecount_part(size, length) __post __deref __exceptthat __maybenull __pre __deref __null
-#define __RPC__deref_out_ecount_full_opt(size) __RPC__deref_out_ecount_part_opt(size, size) __pre __deref __null
-#define __RPC__deref_out_ecount_full_opt_string(size) __RPC__deref_out_ecount_part_opt(size, size) __post __deref __nullterminated __pre __deref __null
-#define __RPC__deref_out_xcount_opt(size) __RPC__out __post __deref __exceptthat __maybenull __pre __deref __null
-#define __RPC__deref_out_xcount_part_opt(size, length) __RPC__deref_out __post __deref __exceptthat __maybenull __pre __deref __null
-#define __RPC__deref_out_xcount_full_opt(size) __RPC__deref_out_opt __pre __deref __null
-#define __RPC__deref_out_xcount_full_opt_string(size) __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null
-
-#define __RPC__deref_opt_inout_opt __deref_opt_inout_opt
-#define __RPC__deref_opt_inout_opt_string __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_opt_inout_ecount_opt(size) __deref_opt_inout_ecount_opt(size)
-#define __RPC__deref_opt_inout_ecount_part_opt(size, length) __deref_opt_inout_ecount_part_opt(size, length)
-#define __RPC__deref_opt_inout_ecount_full_opt(size) __RPC__deref_opt_inout_ecount_part_opt(size, size)
-#define __RPC__deref_opt_inout_ecount_full_opt_string(size) __RPC__deref_opt_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __RPC__deref_opt_inout_xcount_opt(size) __deref_opt_inout_opt
-#define __RPC__deref_opt_inout_xcount_part_opt(size, length) __deref_opt_inout_opt
-#define __RPC__deref_opt_inout_xcount_full_opt(size) __RPC__deref_opt_inout_opt
-#define __RPC__deref_opt_inout_xcount_full_opt_string(size) __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
-
-#define __RPC_full_pointer __maybenull
-#define __RPC_unique_pointer __maybenull
-#define __RPC_ref_pointer __notnull
-#define __RPC_string __nullterminated
-
-#define __RPC__range(min,max) __range(min,max)
-#define __RPC__in_range(min,max) __in_range(min,max)
-
-#else // not prefast
-
-#define __RPC__range(min,max)
-#define __RPC__in_range(min,max)
-
-#define __RPC__in
-#define __RPC__in_string
-#define __RPC__in_opt_string
-#define __RPC__in_ecount(size)
-#define __RPC__in_ecount_full(size)
-#define __RPC__in_ecount_full_string(size)
-#define __RPC__in_ecount_part(size, length)
-#define __RPC__in_ecount_full_opt(size)
-#define __RPC__in_ecount_full_opt_string(size)
-#define __RPC__inout_ecount_full_opt_string(size)
-#define __RPC__in_ecount_part_opt(size, length)
-#define __RPC__in_xcount(size)
-#define __RPC__in_xcount_full(size)
-#define __RPC__in_xcount_full_string(size)
-#define __RPC__in_xcount_part(size, length)
-#define __RPC__in_xcount_full_opt(size)
-#define __RPC__in_xcount_full_opt_string(size)
-#define __RPC__inout_xcount_full_opt_string(size)
-#define __RPC__in_xcount_part_opt(size, length)
-
-#define __RPC__deref_in
-#define __RPC__deref_in_string
-#define __RPC__deref_in_opt
-#define __RPC__deref_in_opt_string
-#define __RPC__deref_opt_in
-#define __RPC__deref_opt_in_string
-#define __RPC__deref_opt_in_opt
-#define __RPC__deref_opt_in_opt_string
-#define __RPC__deref_in_ecount(size)
-#define __RPC__deref_in_ecount_part(size, length)
-#define __RPC__deref_in_ecount_full(size)
-#define __RPC__deref_in_ecount_full_opt(size)
-#define __RPC__deref_in_ecount_full_string(size)
-#define __RPC__deref_in_ecount_full_opt_string(size)
-#define __RPC__deref_in_ecount_opt(size)
-#define __RPC__deref_in_ecount_opt_string(size)
-#define __RPC__deref_in_ecount_part_opt(size, length)
-#define __RPC__deref_in_xcount(size)
-#define __RPC__deref_in_xcount_part(size, length)
-#define __RPC__deref_in_xcount_full(size)
-#define __RPC__deref_in_xcount_full_opt(size)
-#define __RPC__deref_in_xcount_full_string(size)
-#define __RPC__deref_in_xcount_full_opt_string(size)
-#define __RPC__deref_in_xcount_opt(size)
-#define __RPC__deref_in_xcount_opt_string(size)
-#define __RPC__deref_in_xcount_part_opt(size, length)
-
-// [out]
-#define __RPC__out
-#define __RPC__out_ecount(size)
-#define __RPC__out_ecount_part(size, length)
-#define __RPC__out_ecount_full(size)
-#define __RPC__out_ecount_full_string(size)
-#define __RPC__out_xcount(size)
-#define __RPC__out_xcount_part(size, length)
-#define __RPC__out_xcount_full(size)
-#define __RPC__out_xcount_full_string(size)
-
-// [in,out]
-#define __RPC__inout
-#define __RPC__inout_string
-#define __RPC__opt_inout
-#define __RPC__inout_ecount(size)
-#define __RPC__inout_ecount_part(size, length)
-#define __RPC__inout_ecount_full(size)
-#define __RPC__inout_ecount_full_string(size)
-#define __RPC__inout_xcount(size)
-#define __RPC__inout_xcount_part(size, length)
-#define __RPC__inout_xcount_full(size)
-#define __RPC__inout_xcount_full_string(size)
-
-// [in,unique]
-#define __RPC__in_opt
-#define __RPC__in_ecount_opt(size)
-#define __RPC__in_xcount_opt(size)
-
-
-// [in,out,unique]
-#define __RPC__inout_opt
-#define __RPC__inout_opt_string
-#define __RPC__inout_ecount_opt(size)
-#define __RPC__inout_ecount_part_opt(size, length)
-#define __RPC__inout_ecount_full_opt(size)
-#define __RPC__inout_ecount_full_string(size)
-#define __RPC__inout_xcount_opt(size)
-#define __RPC__inout_xcount_part_opt(size, length)
-#define __RPC__inout_xcount_full_opt(size)
-#define __RPC__inout_xcount_full_string(size)
-
-// [out] **
-#define __RPC__deref_out
-#define __RPC__deref_out_string
-#define __RPC__deref_out_opt
-#define __RPC__deref_out_opt_string
-#define __RPC__deref_out_ecount(size)
-#define __RPC__deref_out_ecount_part(size, length)
-#define __RPC__deref_out_ecount_full(size)
-#define __RPC__deref_out_ecount_full_string(size)
-#define __RPC__deref_out_xcount(size)
-#define __RPC__deref_out_xcount_part(size, length)
-#define __RPC__deref_out_xcount_full(size)
-#define __RPC__deref_out_xcount_full_string(size)
-
-
-// [in,out] **, second pointer decoration.
-#define __RPC__deref_inout
-#define __RPC__deref_inout_string
-#define __RPC__deref_inout_opt
-#define __RPC__deref_inout_opt_string
-#define __RPC__deref_inout_ecount_full(size)
-#define __RPC__deref_inout_ecount_full_string(size)
-#define __RPC__deref_inout_ecount_opt(size)
-#define __RPC__deref_inout_ecount_part_opt(size, length)
-#define __RPC__deref_inout_ecount_full_opt(size)
-#define __RPC__deref_inout_ecount_full_opt_string(size)
-#define __RPC__deref_inout_xcount_full(size)
-#define __RPC__deref_inout_xcount_full_string(size)
-#define __RPC__deref_inout_xcount_opt(size)
-#define __RPC__deref_inout_xcount_part_opt(size, length)
-#define __RPC__deref_inout_xcount_full_opt(size)
-#define __RPC__deref_inout_xcount_full_opt_string(size)
-
-// #define __RPC_out_opt out_opt is not allowed in rpc
-
-// [in,out,unique]
-#define __RPC__deref_opt_inout
-#define __RPC__deref_opt_inout_string
-#define __RPC__deref_opt_inout_ecount(size)
-#define __RPC__deref_opt_inout_ecount_part(size, length)
-#define __RPC__deref_opt_inout_ecount_full(size)
-#define __RPC__deref_opt_inout_ecount_full_string(size)
-#define __RPC__deref_opt_inout_xcount(size)
-#define __RPC__deref_opt_inout_xcount_part(size, length)
-#define __RPC__deref_opt_inout_xcount_full(size)
-#define __RPC__deref_opt_inout_xcount_full_string(size)
-
-#define __RPC__deref_out_ecount_opt(size)
-#define __RPC__deref_out_ecount_part_opt(size, length)
-#define __RPC__deref_out_ecount_full_opt(size)
-#define __RPC__deref_out_ecount_full_opt_string(size)
-#define __RPC__deref_out_xcount_opt(size)
-#define __RPC__deref_out_xcount_part_opt(size, length)
-#define __RPC__deref_out_xcount_full_opt(size)
-#define __RPC__deref_out_xcount_full_opt_string(size)
-
-#define __RPC__deref_opt_inout_opt
-#define __RPC__deref_opt_inout_opt_string
-#define __RPC__deref_opt_inout_ecount_opt(size)
-#define __RPC__deref_opt_inout_ecount_part_opt(size, length)
-#define __RPC__deref_opt_inout_ecount_full_opt(size)
-#define __RPC__deref_opt_inout_ecount_full_opt_string(size)
-#define __RPC__deref_opt_inout_xcount_opt(size)
-#define __RPC__deref_opt_inout_xcount_part_opt(size, length)
-#define __RPC__deref_opt_inout_xcount_full_opt(size)
-#define __RPC__deref_opt_inout_xcount_full_opt_string(size)
-
-#define __RPC_full_pointer
-#define __RPC_unique_pointer
-#define __RPC_ref_pointer
-#define __RPC_string
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/3rdparty/dxsdk/Include/xact3.h b/3rdparty/dxsdk/Include/xact3.h
deleted file mode 100644
index c27d5639685..00000000000
--- a/3rdparty/dxsdk/Include/xact3.h
+++ /dev/null
@@ -1,1551 +0,0 @@
-/**************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * Module Name:
- *
- * xact3.h
- *
- * Abstract:
- *
- * XACT public interfaces, functions and data types
- *
- **************************************************************************/
-
-#pragma once
-
-#ifndef _XACT3_H_
-#define _XACT3_H_
-
-//------------------------------------------------------------------------------
-// XACT class and interface IDs (Version 3.7)
-//------------------------------------------------------------------------------
-#ifndef _XBOX // XACT COM support only exists on Windows
- #include <comdecl.h> // For DEFINE_CLSID, DEFINE_IID and DECLARE_INTERFACE
- DEFINE_CLSID(XACTEngine, bcc782bc, 6492, 4c22, 8c, 35, f5, d7, 2f, e7, 3c, 6e);
- DEFINE_CLSID(XACTAuditionEngine, 9ecdd80d, 0e81, 40d8, 89, 03, 2b, f7, b1, 31, ac, 43);
- DEFINE_CLSID(XACTDebugEngine, 02860630, bf3b, 42a8, b1, 4e, 91, ed, a2, f5, 1e, a5);
- DEFINE_IID(IXACT3Engine, b1ee676a, d9cd, 4d2a, 89, a8, fa, 53, eb, 9e, 48, 0b);
-#endif
-
-// Ignore the rest of this header if only the GUID definitions were requested:
-#ifndef GUID_DEFS_ONLY
-
-//------------------------------------------------------------------------------
-// Includes
-//------------------------------------------------------------------------------
-
-#ifndef _XBOX
- #include <windows.h>
- #include <objbase.h>
- #include <float.h>
-#endif
-#include <limits.h>
-#include <xact3wb.h>
-#include <xaudio2.h>
-
-//------------------------------------------------------------------------------
-// Forward Declarations
-//------------------------------------------------------------------------------
-
-typedef struct IXACT3SoundBank IXACT3SoundBank;
-typedef struct IXACT3WaveBank IXACT3WaveBank;
-typedef struct IXACT3Cue IXACT3Cue;
-typedef struct IXACT3Wave IXACT3Wave;
-typedef struct IXACT3Engine IXACT3Engine;
-typedef struct XACT_NOTIFICATION XACT_NOTIFICATION;
-
-
-//------------------------------------------------------------------------------
-// Typedefs
-//------------------------------------------------------------------------------
-
-typedef WORD XACTINDEX; // All normal indices
-typedef BYTE XACTNOTIFICATIONTYPE; // Notification type
-typedef FLOAT XACTVARIABLEVALUE; // Variable value
-typedef WORD XACTVARIABLEINDEX; // Variable index
-typedef WORD XACTCATEGORY; // Sound category
-typedef BYTE XACTCHANNEL; // Audio channel
-typedef FLOAT XACTVOLUME; // Volume value
-typedef LONG XACTTIME; // Time (in ms)
-typedef SHORT XACTPITCH; // Pitch value
-typedef BYTE XACTLOOPCOUNT; // For all loops / recurrences
-typedef BYTE XACTVARIATIONWEIGHT; // Variation weight
-typedef BYTE XACTPRIORITY; // Sound priority
-typedef BYTE XACTINSTANCELIMIT; // Instance limitations
-
-//------------------------------------------------------------------------------
-// Standard win32 multimedia definitions
-//------------------------------------------------------------------------------
-#ifndef WAVE_FORMAT_IEEE_FLOAT
- #define WAVE_FORMAT_IEEE_FLOAT 0x0003
-#endif
-
-#ifndef WAVE_FORMAT_EXTENSIBLE
- #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
-#endif
-
-#ifndef _WAVEFORMATEX_
-#define _WAVEFORMATEX_
- #pragma pack(push, 1)
- typedef struct tWAVEFORMATEX
- {
- WORD wFormatTag; // format type
- WORD nChannels; // number of channels (i.e. mono, stereo...)
- DWORD nSamplesPerSec; // sample rate
- DWORD nAvgBytesPerSec; // for buffer estimation
- WORD nBlockAlign; // block size of data
- WORD wBitsPerSample; // Number of bits per sample of mono data
- WORD cbSize; // The count in bytes of the size of extra information (after cbSize)
-
- } WAVEFORMATEX, *PWAVEFORMATEX;
- typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX;
- typedef WAVEFORMATEX FAR *LPWAVEFORMATEX;
- #pragma pack(pop)
-#endif
-
-#ifndef _WAVEFORMATEXTENSIBLE_
-#define _WAVEFORMATEXTENSIBLE_
- #pragma pack(push, 1)
- typedef struct
- {
- WAVEFORMATEX Format; // WAVEFORMATEX data
-
- union
- {
- WORD wValidBitsPerSample; // Bits of precision
- WORD wSamplesPerBlock; // Samples per block of audio data, valid if wBitsPerSample==0
- WORD wReserved; // Unused -- If neither applies, set to zero.
- } Samples;
-
- DWORD dwChannelMask; // Speaker usage bitmask
- GUID SubFormat; // Sub-format identifier
- } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
- #pragma pack(pop)
-#endif
-
-//------------------------------------------------------------------------------
-// Constants
-//------------------------------------------------------------------------------
-static const XACTTIME XACTTIME_MIN = LONG_MIN;
-static const XACTTIME XACTTIME_MAX = LONG_MAX; // 24 days 20:31:23.647
-static const XACTTIME XACTTIME_INFINITE = LONG_MAX;
-static const XACTINSTANCELIMIT XACTINSTANCELIMIT_INFINITE = 0xff;
-static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MIN = 0x00; // == 1 instance total (0 additional instances)
-static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MAX = 0xfe; // == 255 instances total (254 additional instances)
-static const XACTINDEX XACTINDEX_MIN = 0x0;
-static const XACTINDEX XACTINDEX_MAX = 0xfffe;
-static const XACTINDEX XACTINDEX_INVALID = 0xffff;
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MIN = 0x00;
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MAX = 0xff;
-static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MIN = -FLT_MAX;
-static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MAX = FLT_MAX;
-static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MIN = 0x0000;
-static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MAX = 0xfffe;
-static const XACTVARIABLEINDEX XACTVARIABLEINDEX_INVALID = 0xffff;
-static const XACTCATEGORY XACTCATEGORY_MIN = 0x0;
-static const XACTCATEGORY XACTCATEGORY_MAX = 0xfffe;
-static const XACTCATEGORY XACTCATEGORY_INVALID = 0xffff;
-static const XACTCHANNEL XACTCHANNEL_MIN = 0;
-static const XACTCHANNEL XACTCHANNEL_MAX = 0xFF;
-static const XACTPITCH XACTPITCH_MIN = -1200; // pitch change allowable per individual content field
-static const XACTPITCH XACTPITCH_MAX = 1200;
-static const XACTPITCH XACTPITCH_MIN_TOTAL = -2400; // total allowable pitch change, use with IXACTWave.SetPitch()
-static const XACTPITCH XACTPITCH_MAX_TOTAL = 2400;
-static const XACTVOLUME XACTVOLUME_MIN = 0.0f;
-static const XACTVOLUME XACTVOLUME_MAX = 16777216.0f; // Maximum acceptable volume level (2^24) - matches XAudio2 max volume
-static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MIN = -FLT_MAX;
-static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MAX = FLT_MAX;
-static const XACTLOOPCOUNT XACTLOOPCOUNT_MIN = 0x0;
-static const XACTLOOPCOUNT XACTLOOPCOUNT_MAX = 0xfe;
-static const XACTLOOPCOUNT XACTLOOPCOUNT_INFINITE = 0xff;
-static const DWORD XACTWAVEALIGNMENT_MIN = 2048;
-#ifdef _XBOX
-static const BYTE XACTMAXOUTPUTVOICECOUNT = 3;
-#endif // _XBOX
-
-
-// -----------------------------------------------------------------------------
-// Cue friendly name length
-// -----------------------------------------------------------------------------
-#define XACT_CUE_NAME_LENGTH 0xFF
-
-// -----------------------------------------------------------------------------
-// Current Content Tool Version
-// -----------------------------------------------------------------------------
-#define XACT_CONTENT_VERSION 46
-
-// -----------------------------------------------------------------------------
-// XACT Stop Flags
-// -----------------------------------------------------------------------------
-static const DWORD XACT_FLAG_STOP_RELEASE = 0x00000000; // Stop with release envelope (or as authored), for looping waves this acts as break loop.
-static const DWORD XACT_FLAG_STOP_IMMEDIATE = 0x00000001; // Stop immediately
-
-// -----------------------------------------------------------------------------
-// XACT Manage Data Flag - XACT will manage the lifetime of this data
-// -----------------------------------------------------------------------------
-static const DWORD XACT_FLAG_MANAGEDATA = 0x00000001;
-
-// -----------------------------------------------------------------------------
-// XACT Content Preparation Flags
-// -----------------------------------------------------------------------------
-static const DWORD XACT_FLAG_BACKGROUND_MUSIC = 0x00000002; // Marks the waves as background music.
-static const DWORD XACT_FLAG_UNITS_MS = 0x00000004; // Indicates that the units passed in are in milliseconds.
-static const DWORD XACT_FLAG_UNITS_SAMPLES = 0x00000008; // Indicates that the units passed in are in samples.
-
-// -----------------------------------------------------------------------------
-// XACT State flags
-// -----------------------------------------------------------------------------
-static const DWORD XACT_STATE_CREATED = 0x00000001; // Created, but nothing else
-static const DWORD XACT_STATE_PREPARING = 0x00000002; // In the middle of preparing
-static const DWORD XACT_STATE_PREPARED = 0x00000004; // Prepared, but not yet played
-static const DWORD XACT_STATE_PLAYING = 0x00000008; // Playing (though could be paused)
-static const DWORD XACT_STATE_STOPPING = 0x00000010; // Stopping
-static const DWORD XACT_STATE_STOPPED = 0x00000020; // Stopped
-static const DWORD XACT_STATE_PAUSED = 0x00000040; // Paused (Can be combined with some of the other state flags above)
-static const DWORD XACT_STATE_INUSE = 0x00000080; // Object is in use (used by wavebanks and soundbanks).
-static const DWORD XACT_STATE_PREPAREFAILED = 0x80000000; // Object preparation failed.
-
-//------------------------------------------------------------------------------
-// XACT Parameters
-//------------------------------------------------------------------------------
-
-#define XACT_FLAG_GLOBAL_SETTINGS_MANAGEDATA XACT_FLAG_MANAGEDATA
-
-// -----------------------------------------------------------------------------
-// File IO Callbacks
-// -----------------------------------------------------------------------------
-typedef BOOL (__stdcall * XACT_READFILE_CALLBACK)(__in HANDLE hFile, __out_bcount(nNumberOfBytesToRead) LPVOID lpBuffer, DWORD nNumberOfBytesToRead, __out LPDWORD lpNumberOfBytesRead, __inout LPOVERLAPPED lpOverlapped);
-typedef BOOL (__stdcall * XACT_GETOVERLAPPEDRESULT_CALLBACK)(__in HANDLE hFile, __inout LPOVERLAPPED lpOverlapped, __out LPDWORD lpNumberOfBytesTransferred, BOOL bWait);
-
-typedef struct XACT_FILEIO_CALLBACKS
-{
- XACT_READFILE_CALLBACK readFileCallback;
- XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback;
-
-} XACT_FILEIO_CALLBACKS, *PXACT_FILEIO_CALLBACKS;
-typedef const XACT_FILEIO_CALLBACKS *PCXACT_FILEIO_CALLBACKS;
-
-// -----------------------------------------------------------------------------
-// Notification Callback
-// -----------------------------------------------------------------------------
-typedef void (__stdcall * XACT_NOTIFICATION_CALLBACK)(__in const XACT_NOTIFICATION* pNotification);
-
-#define XACT_RENDERER_ID_LENGTH 0xff // Maximum number of characters allowed in the renderer ID
-#define XACT_RENDERER_NAME_LENGTH 0xff // Maximum number of characters allowed in the renderer display name.
-
-// -----------------------------------------------------------------------------
-// Renderer Details
-// -----------------------------------------------------------------------------
-typedef struct XACT_RENDERER_DETAILS
-{
- WCHAR rendererID[XACT_RENDERER_ID_LENGTH]; // The string ID for the rendering device.
- WCHAR displayName[XACT_RENDERER_NAME_LENGTH]; // A friendly name suitable for display to a human.
- BOOL defaultDevice; // Set to TRUE if this device is the primary audio device on the system.
-
-} XACT_RENDERER_DETAILS, *LPXACT_RENDERER_DETAILS;
-
-// -----------------------------------------------------------------------------
-// Engine Look-Ahead Time
-// -----------------------------------------------------------------------------
-#define XACT_ENGINE_LOOKAHEAD_DEFAULT 250 // Default look-ahead time of 250ms can be used during XACT engine initialization.
-
-// -----------------------------------------------------------------------------
-// Runtime (engine) parameters
-// -----------------------------------------------------------------------------
-typedef struct XACT_RUNTIME_PARAMETERS
-{
- DWORD lookAheadTime; // Time in ms
- void* pGlobalSettingsBuffer; // Buffer containing the global settings file
- DWORD globalSettingsBufferSize; // Size of global settings buffer
- DWORD globalSettingsFlags; // Flags for global settings
- DWORD globalSettingsAllocAttributes; // Global settings buffer allocation attributes (see XMemAlloc)
- XACT_FILEIO_CALLBACKS fileIOCallbacks; // File I/O callbacks
- XACT_NOTIFICATION_CALLBACK fnNotificationCallback; // Callback that receives notifications.
- PWSTR pRendererID; // Ptr to the ID for the audio renderer the engine should connect to.
- IXAudio2* pXAudio2; // XAudio2 object to be used by the engine (NULL if one needs to be created)
- IXAudio2MasteringVoice* pMasteringVoice; // Mastering voice to be used by the engine, if pXAudio2 is not NULL.
-
-} XACT_RUNTIME_PARAMETERS, *LPXACT_RUNTIME_PARAMETERS;
-typedef const XACT_RUNTIME_PARAMETERS *LPCXACT_RUNTIME_PARAMETERS;
-
-//------------------------------------------------------------------------------
-// Streaming Parameters
-//------------------------------------------------------------------------------
-
-typedef struct XACT_STREAMING_PARAMETERS
-{
- HANDLE file; // File handle associated with wavebank data
- DWORD offset; // Offset within file of wavebank header (must be sector aligned)
- DWORD flags; // Flags (none currently)
- WORD packetSize; // Stream packet size (in sectors) to use for each stream (min = 2)
- // number of sectors (DVD = 2048 bytes: 2 = 4096, 3 = 6144, 4 = 8192 etc.)
- // optimal DVD size is a multiple of 16 (DVD block = 16 DVD sectors)
-
-} XACT_WAVEBANK_STREAMING_PARAMETERS, *LPXACT_WAVEBANK_STREAMING_PARAMETERS, XACT_STREAMING_PARAMETERS, *LPXACT_STREAMING_PARAMETERS;
-typedef const XACT_STREAMING_PARAMETERS *LPCXACT_STREAMING_PARAMETERS;
-typedef const XACT_WAVEBANK_STREAMING_PARAMETERS *LPCXACT_WAVEBANK_STREAMING_PARAMETERS;
-
-// Structure used to report cue properties back to the client.
-typedef struct XACT_CUE_PROPERTIES
-{
- CHAR friendlyName[XACT_CUE_NAME_LENGTH]; // Empty if the soundbank doesn't contain any friendly names
- BOOL interactive; // TRUE if an IA cue; FALSE otherwise
- XACTINDEX iaVariableIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise
- XACTINDEX numVariations; // Number of variations in the cue
- XACTINSTANCELIMIT maxInstances; // Number of maximum instances for this cue
- XACTINSTANCELIMIT currentInstances; // Current active instances of this cue
-
-} XACT_CUE_PROPERTIES, *LPXACT_CUE_PROPERTIES;
-
-// Strucutre used to return the track properties.
-typedef struct XACT_TRACK_PROPERTIES
-{
- XACTTIME duration; // Duration of the track in ms
- XACTINDEX numVariations; // Number of wave variations in the track
- XACTCHANNEL numChannels; // Number of channels for the active wave variation on this track
- XACTINDEX waveVariation; // Index of the active wave variation
- XACTLOOPCOUNT loopCount; // Current loop count on this track
-
-} XACT_TRACK_PROPERTIES, *LPXACT_TRACK_PROPERTIES;
-
-// Structure used to return the properties of a variation.
-typedef struct XACT_VARIATION_PROPERTIES
-{
- XACTINDEX index; // Index of the variation in the cue's variation list
- XACTVARIATIONWEIGHT weight; // Weight for the active variation. Valid only for complex cues
- XACTVARIABLEVALUE iaVariableMin; // Valid only for IA cues
- XACTVARIABLEVALUE iaVariableMax; // Valid only for IA cues
- BOOL linger; // Valid only for IA cues
-
-} XACT_VARIATION_PROPERTIES, *LPXACT_VARIATION_PROPERTIES;
-
-// Structure used to return the properties of the sound referenced by a variation.
-typedef struct XACT_SOUND_PROPERTIES
-{
- XACTCATEGORY category; // Category this sound belongs to
- BYTE priority; // Priority of this variation
- XACTPITCH pitch; // Current pitch set on the active variation
- XACTVOLUME volume; // Current volume set on the active variation
- XACTINDEX numTracks; // Number of tracks in the active variation
- XACT_TRACK_PROPERTIES arrTrackProperties[1]; // Array of active track properties (has numTracks number of elements)
-
-} XACT_SOUND_PROPERTIES, *LPXACT_SOUND_PROPERTIES;
-
-// Structure used to return the properties of the active variation and the sound referenced.
-typedef struct XACT_SOUND_VARIATION_PROPERTIES
-{
- XACT_VARIATION_PROPERTIES variationProperties;// Properties for this variation
- XACT_SOUND_PROPERTIES soundProperties; // Proeprties for the sound referenced by this variation
-
-} XACT_SOUND_VARIATION_PROPERTIES, *LPXACT_SOUND_VARIATION_PROPERTIES;
-
-// Structure used to return the properties of an active cue instance.
-typedef struct XACT_CUE_INSTANCE_PROPERTIES
-{
- DWORD allocAttributes; // Buffer allocation attributes (see XMemAlloc)
- XACT_CUE_PROPERTIES cueProperties; // Properties of the cue that are shared by all instances.
- XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties; // Properties if the currently active variation.
-
-} XACT_CUE_INSTANCE_PROPERTIES, *LPXACT_CUE_INSTANCE_PROPERTIES;
-
-// Structure used to return the common wave properties.
-typedef struct XACT_WAVE_PROPERTIES
-{
- char friendlyName[WAVEBANK_ENTRYNAME_LENGTH]; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names.
- WAVEBANKMINIWAVEFORMAT format; // Format for the wave.
- DWORD durationInSamples; // Duration of the wave in units of one sample
- WAVEBANKSAMPLEREGION loopRegion; // Loop region defined in samples.
- BOOL streaming; // Set to TRUE if the wave is streaming; FALSE otherwise.
-
-} XACT_WAVE_PROPERTIES, *LPXACT_WAVE_PROPERTIES;
-typedef const XACT_WAVE_PROPERTIES* LPCXACT_WAVE_PROPERTIES;
-
-// Structure used to return the properties specific to a wave instance.
-typedef struct XACT_WAVE_INSTANCE_PROPERTIES
-{
- XACT_WAVE_PROPERTIES properties; // Static properties common to all the wave instances.
- BOOL backgroundMusic; // Set to TRUE if the wave is tagged as background music; FALSE otherwise.
-
-} XACT_WAVE_INSTANCE_PROPERTIES, *LPXACT_WAVE_INSTANCE_PROPERTIES;
-typedef const XACT_WAVE_INSTANCE_PROPERTIES* LPCXACT_WAVE_INSTANCE_PROPERTIES;
-
-//------------------------------------------------------------------------------
-// Channel Mapping / Speaker Panning
-//------------------------------------------------------------------------------
-
-typedef struct XACTCHANNELMAPENTRY
-{
- XACTCHANNEL InputChannel;
- XACTCHANNEL OutputChannel;
- XACTVOLUME Volume;
-
-} XACTCHANNELMAPENTRY, *LPXACTCHANNELMAPENTRY;
-typedef const XACTCHANNELMAPENTRY *LPCXACTCHANNELMAPENTRY;
-
-typedef struct XACTCHANNELMAP
-{
- XACTCHANNEL EntryCount;
- XACTCHANNELMAPENTRY* paEntries;
-
-} XACTCHANNELMAP, *LPXACTCHANNELMAP;
-typedef const XACTCHANNELMAP *LPCXACTCHANNELMAP;
-
-typedef struct XACTCHANNELVOLUMEENTRY
-{
- XACTCHANNEL EntryIndex;
- XACTVOLUME Volume;
-
-} XACTCHANNELVOLUMEENTRY, *LPXACTCHANNELVOLUMEENTRY;
-typedef const XACTCHANNELVOLUMEENTRY *LPCXACTCHANNELVOLUMEENTRY;
-
-typedef struct XACTCHANNELVOLUME
-{
- XACTCHANNEL EntryCount;
- XACTCHANNELVOLUMEENTRY* paEntries;
-
-} XACTCHANNELVOLUME, *LPXACTCHANNELVOLUME;
-typedef const XACTCHANNELVOLUME *LPCXACTCHANNELVOLUME;
-
-//------------------------------------------------------------------------------
-// Notifications
-//------------------------------------------------------------------------------
-
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPREPARED = 1; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPLAY = 2; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUESTOP = 3; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MARKER = 5; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; // None, SoundBank
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; // None, WaveBank
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; // None, SoundBank, SoundBank & cue index, cue instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; // None
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUICONNECTED = 10; // None
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; // None
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPREPARED = 12; // None, WaveBank & wave index, wave instance.
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPLAY = 13; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVESTOP = 14; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVELOOPED = 15; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; // None, WaveBank & wave index, wave instance.
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; // None, WaveBank
-static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; // None, WaveBank
-
-static const BYTE XACT_FLAG_NOTIFICATION_PERSIST = 0x01;
-
-// Pack the notification structures
-#pragma pack(push, 1)
-
-// Notification description used for registering, un-registering and flushing notifications
-typedef struct XACT_NOTIFICATION_DESCRIPTION
-{
- XACTNOTIFICATIONTYPE type; // Notification type
- BYTE flags; // Flags
- IXACT3SoundBank* pSoundBank; // SoundBank instance
- IXACT3WaveBank* pWaveBank; // WaveBank instance
- IXACT3Cue* pCue; // Cue instance
- IXACT3Wave* pWave; // Wave instance
- XACTINDEX cueIndex; // Cue index
- XACTINDEX waveIndex; // Wave index
- PVOID pvContext; // User context (optional)
-
-} XACT_NOTIFICATION_DESCRIPTION, *LPXACT_NOTIFICATION_DESCRIPTION;
-typedef const XACT_NOTIFICATION_DESCRIPTION *LPCXACT_NOTIFICATION_DESCRIPTION;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications
-typedef struct XACT_NOTIFICATION_CUE
-{
- XACTINDEX cueIndex; // Cue index
- IXACT3SoundBank* pSoundBank; // SoundBank instance
- IXACT3Cue* pCue; // Cue instance
-
-} XACT_NOTIFICATION_CUE, *LPXACT_NOTIFICATION_CUE;
-typedef const XACT_NOTIFICATION_CUE *LPCXACT_NOTIFICATION_CUE;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications
-typedef struct XACT_NOTIFICATION_MARKER
-{
- XACTINDEX cueIndex; // Cue index
- IXACT3SoundBank* pSoundBank; // SoundBank instance
- IXACT3Cue* pCue; // Cue instance
- DWORD marker; // Marker value
-
-} XACT_NOTIFICATION_MARKER, *LPXACT_NOTIFICATION_MARKER;
-typedef const XACT_NOTIFICATION_MARKER *LPCXACT_NOTIFICATION_MARKER;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications
-typedef struct XACT_NOTIFICATION_SOUNDBANK
-{
- IXACT3SoundBank* pSoundBank; // SoundBank instance
-
-} XACT_NOTIFICATION_SOUNDBANK, *LPXACT_NOTIFICATION_SOUNDBANK;
-typedef const XACT_NOTIFICATION_SOUNDBANK *LPCXACT_NOTIFICATION_SOUNDBANK;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications
-typedef struct XACT_NOTIFICATION_WAVEBANK
-{
- IXACT3WaveBank* pWaveBank; // WaveBank instance
-
-} XACT_NOTIFICATION_WAVEBANK, *LPXACT_NOTIFICATION_WAVEBANK;
-typedef const XACT_NOTIFICATION_WAVEBANK *LPCXACT_NOTIFICATION_WAVEBANK;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications
-typedef struct XACT_NOTIFICATION_VARIABLE
-{
- XACTINDEX cueIndex; // Cue index
- IXACT3SoundBank* pSoundBank; // SoundBank instance
- IXACT3Cue* pCue; // Cue instance
- XACTVARIABLEINDEX variableIndex; // Variable index
- XACTVARIABLEVALUE variableValue; // Variable value
- BOOL local; // TRUE if a local variable
-
-} XACT_NOTIFICATION_VARIABLE, *LPXACT_NOTIFICATION_VARIABLE;
-typedef const XACT_NOTIFICATION_VARIABLE *LPCXACT_NOTIFICATION_VARIABLE;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications
-typedef struct XACT_NOTIFICATION_GUI
-{
- DWORD reserved; // Reserved
-} XACT_NOTIFICATION_GUI, *LPXACT_NOTIFICATION_GUI;
-typedef const XACT_NOTIFICATION_GUI *LPCXACT_NOTIFICATION_GUI;
-
-// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications
-typedef struct XACT_NOTIFICATION_WAVE
-{
- IXACT3WaveBank* pWaveBank; // WaveBank
- XACTINDEX waveIndex; // Wave index
- XACTINDEX cueIndex; // Cue index
- IXACT3SoundBank* pSoundBank; // SoundBank instance
- IXACT3Cue* pCue; // Cue instance
- IXACT3Wave* pWave; // Wave instance
-
-} XACT_NOTIFICATION_WAVE, *LPXACT_NOTIFICATION_WAVE;
-typedef const XACT_NOTIFICATION_WAVE *LPCXACT_NOTIFICATION_WAVE;
-
-// General notification structure
-typedef struct XACT_NOTIFICATION
-{
- XACTNOTIFICATIONTYPE type; // Notification type
- LONG timeStamp; // Timestamp of notification (milliseconds)
- PVOID pvContext; // User context (optional)
- union
- {
- XACT_NOTIFICATION_CUE cue; // XACTNOTIFICATIONTYPE_CUE*
- XACT_NOTIFICATION_MARKER marker; // XACTNOTIFICATIONTYPE_MARKER*
- XACT_NOTIFICATION_SOUNDBANK soundBank; // XACTNOTIFICATIONTYPE_SOUNDBANK*
- XACT_NOTIFICATION_WAVEBANK waveBank; // XACTNOTIFICATIONTYPE_WAVEBANK*
- XACT_NOTIFICATION_VARIABLE variable; // XACTNOTIFICATIONTYPE_VARIABLE*
- XACT_NOTIFICATION_GUI gui; // XACTNOTIFICATIONTYPE_GUI*
- XACT_NOTIFICATION_WAVE wave; // XACTNOTIFICATIONTYPE_WAVE*
- };
-
-} XACT_NOTIFICATION, *LPXACT_NOTIFICATION;
-typedef const XACT_NOTIFICATION *LPCXACT_NOTIFICATION;
-
-#pragma pack(pop)
-
-//------------------------------------------------------------------------------
-// IXACT3SoundBank
-//------------------------------------------------------------------------------
-
-#define XACT_FLAG_SOUNDBANK_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE
-#define XACT_SOUNDBANKSTATE_INUSE XACT_STATE_INUSE
-
-STDAPI_(XACTINDEX) IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName);
-STDAPI IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues);
-STDAPI IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties);
-STDAPI IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue);
-STDAPI IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue);
-STDAPI IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags);
-STDAPI IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank);
-STDAPI IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState);
-
-#undef INTERFACE
-#define INTERFACE IXACT3SoundBank
-
-DECLARE_INTERFACE(IXACT3SoundBank)
-{
- STDMETHOD_(XACTINDEX, GetCueIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
- STDMETHOD(GetNumCues)(THIS_ __out XACTINDEX* pnNumCues) PURE;
- STDMETHOD(GetCueProperties)(THIS_ XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) PURE;
- STDMETHOD(Prepare)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) PURE;
- STDMETHOD(Play)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) PURE;
- STDMETHOD(Stop)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
- STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
-};
-
-#ifdef __cplusplus
-
-__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank)
-{
- return pSoundBank->Destroy();
-}
-
-__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName)
-{
- return pSoundBank->GetCueIndex(szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues)
-{
- return pSoundBank->GetNumCues(pnNumCues);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties)
-{
- return pSoundBank->GetCueProperties(nCueIndex, pProperties);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue)
-{
- return pSoundBank->Prepare(nCueIndex, dwFlags, timeOffset, ppCue);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue)
-{
- return pSoundBank->Play(nCueIndex, dwFlags, timeOffset, ppCue);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags)
-{
- return pSoundBank->Stop(nCueIndex, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState)
-{
- return pSoundBank->GetState(pdwState);
-}
-
-#else // __cplusplus
-
-__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank)
-{
- return pSoundBank->lpVtbl->Destroy(pSoundBank);
-}
-
-__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName)
-{
- return pSoundBank->lpVtbl->GetCueIndex(pSoundBank, szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues)
-{
- return pSoundBank->lpVtbl->GetNumCues(pSoundBank, pnNumCues);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties)
-{
- return pSoundBank->lpVtbl->GetCueProperties(pSoundBank, nCueIndex, pProperties);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue)
-{
- return pSoundBank->lpVtbl->Prepare(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue)
-{
- return pSoundBank->lpVtbl->Play(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags)
-{
- return pSoundBank->lpVtbl->Stop(pSoundBank, nCueIndex, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState)
-{
- return pSoundBank->lpVtbl->GetState(pSoundBank, pdwState);
-}
-
-#endif // __cplusplus
-
-//------------------------------------------------------------------------------
-// IXACT3WaveBank
-//------------------------------------------------------------------------------
-#define XACT_WAVEBANKSTATE_INUSE XACT_STATE_INUSE // Currently in-use
-#define XACT_WAVEBANKSTATE_PREPARED XACT_STATE_PREPARED // Prepared
-#define XACT_WAVEBANKSTATE_PREPAREFAILED XACT_STATE_PREPAREFAILED // Prepare failed.
-
-
-STDAPI IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank);
-STDAPI IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState);
-STDAPI IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves);
-STDAPI_(XACTINDEX) IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName);
-STDAPI IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties);
-STDAPI IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
-STDAPI IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
-STDAPI IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags);
-
-#undef INTERFACE
-#define INTERFACE IXACT3WaveBank
-
-DECLARE_INTERFACE(IXACT3WaveBank)
-{
- STDMETHOD(Destroy)(THIS) PURE;
- STDMETHOD(GetNumWaves)(THIS_ __out XACTINDEX* pnNumWaves) PURE;
- STDMETHOD_(XACTINDEX, GetWaveIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
- STDMETHOD(GetWaveProperties)(THIS_ XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) PURE;
- STDMETHOD(Prepare)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
- STDMETHOD(Play)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
- STDMETHOD(Stop)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags) PURE;
- STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
-};
-
-#ifdef __cplusplus
-
-__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank)
-{
- return pWaveBank->Destroy();
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves)
-{
- return pWaveBank->GetNumWaves(pnNumWaves);
-}
-
-__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName)
-{
- return pWaveBank->GetWaveIndex(szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties)
-{
- return pWaveBank->GetWaveProperties(nWaveIndex, pWaveProperties);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pWaveBank->Prepare(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pWaveBank->Play(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags)
-{
- return pWaveBank->Stop(nWaveIndex, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState)
-{
- return pWaveBank->GetState(pdwState);
-}
-
-#else // __cplusplus
-
-__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank)
-{
- return pWaveBank->lpVtbl->Destroy(pWaveBank);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves)
-{
- return pWaveBank->lpVtbl->GetNumWaves(pWaveBank, pnNumWaves);
-}
-
-__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName)
-{
- return pWaveBank->lpVtbl->GetWaveIndex(pWaveBank, szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties)
-{
- return pWaveBank->lpVtbl->GetWaveProperties(pWaveBank, nWaveIndex, pWaveProperties);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pWaveBank->lpVtbl->Prepare(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pWaveBank->lpVtbl->Play(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags)
-{
- return pWaveBank->lpVtbl->Stop(pWaveBank, nWaveIndex, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState)
-{
- return pWaveBank->lpVtbl->GetState(pWaveBank, pdwState);
-}
-#endif // __cplusplus
-
-
-//------------------------------------------------------------------------------
-// IXACT3Wave
-//------------------------------------------------------------------------------
-
-STDAPI IXACT3Wave_Destroy(__in IXACT3Wave* pWave);
-STDAPI IXACT3Wave_Play(__in IXACT3Wave* pWave);
-STDAPI IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags);
-STDAPI IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause);
-STDAPI IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState);
-STDAPI IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch);
-STDAPI IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume);
-STDAPI IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients);
-STDAPI IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties);
-
-#undef INTERFACE
-#define INTERFACE IXACT3Wave
-
-DECLARE_INTERFACE(IXACT3Wave)
-{
- STDMETHOD(Destroy)(THIS) PURE;
- STDMETHOD(Play)(THIS) PURE;
- STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(Pause)(THIS_ BOOL fPause) PURE;
- STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
- STDMETHOD(SetPitch)(THIS_ XACTPITCH pitch) PURE;
- STDMETHOD(SetVolume)(THIS_ XACTVOLUME volume) PURE;
- STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE;
- STDMETHOD(GetProperties)(THIS_ __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) PURE;
-};
-
-#ifdef __cplusplus
-
-__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave)
-{
- return pWave->Destroy();
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave)
-{
- return pWave->Play();
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags)
-{
- return pWave->Stop(dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause)
-{
- return pWave->Pause(fPause);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState)
-{
- return pWave->GetState(pdwState);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch)
-{
- return pWave->SetPitch(pitch);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume)
-{
- return pWave->SetVolume(volume);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
-{
- return pWave->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties)
-{
- return pWave->GetProperties(pProperties);
-}
-
-#else // __cplusplus
-
-__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave)
-{
- return pWave->lpVtbl->Destroy(pWave);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave)
-{
- return pWave->lpVtbl->Play(pWave);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags)
-{
- return pWave->lpVtbl->Stop(pWave, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause)
-{
- return pWave->lpVtbl->Pause(pWave, fPause);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState)
-{
- return pWave->lpVtbl->GetState(pWave, pdwState);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch)
-{
- return pWave->lpVtbl->SetPitch(pWave, pitch);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume)
-{
- return pWave->lpVtbl->SetVolume(pWave, volume);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
-{
- return pWave->lpVtbl->SetMatrixCoefficients(pWave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
-}
-
-__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties)
-{
- return pWave->lpVtbl->GetProperties(pWave, pProperties);
-}
-#endif // __cplusplus
-
-//------------------------------------------------------------------------------
-// IXACT3Cue
-//------------------------------------------------------------------------------
-
-// Cue Flags
-#define XACT_FLAG_CUE_STOP_RELEASE XACT_FLAG_STOP_RELEASE
-#define XACT_FLAG_CUE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE
-
-// Mutually exclusive states
-#define XACT_CUESTATE_CREATED XACT_STATE_CREATED // Created, but nothing else
-#define XACT_CUESTATE_PREPARING XACT_STATE_PREPARING // In the middle of preparing
-#define XACT_CUESTATE_PREPARED XACT_STATE_PREPARED // Prepared, but not yet played
-#define XACT_CUESTATE_PLAYING XACT_STATE_PLAYING // Playing (though could be paused)
-#define XACT_CUESTATE_STOPPING XACT_STATE_STOPPING // Stopping
-#define XACT_CUESTATE_STOPPED XACT_STATE_STOPPED // Stopped
-#define XACT_CUESTATE_PAUSED XACT_STATE_PAUSED // Paused (can be combined with other states)
-
-STDAPI IXACT3Cue_Destroy(__in IXACT3Cue* pCue);
-STDAPI IXACT3Cue_Play(__in IXACT3Cue* pCue);
-STDAPI IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags);
-STDAPI IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState);
-STDAPI IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue*, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients);
-STDAPI_(XACTVARIABLEINDEX) IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName);
-STDAPI IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue);
-STDAPI IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue);
-STDAPI IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause);
-STDAPI IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties);
-STDAPI IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList);
-STDAPI IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix);
-
-#undef INTERFACE
-#define INTERFACE IXACT3Cue
-
-DECLARE_INTERFACE(IXACT3Cue)
-{
- STDMETHOD(Play)(THIS) PURE;
- STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE;
- STDMETHOD(Destroy)(THIS) PURE;
- STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE;
- STDMETHOD_(XACTVARIABLEINDEX, GetVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
- STDMETHOD(SetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE;
- STDMETHOD(GetVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE;
- STDMETHOD(Pause)(THIS_ BOOL fPause) PURE;
- STDMETHOD(GetProperties)(THIS_ __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) PURE;
- STDMETHOD(SetOutputVoices)(THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE;
- STDMETHOD(SetOutputVoiceMatrix)(THIS_ __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) PURE;
-};
-
-#ifdef __cplusplus
-
-__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue)
-{
- return pCue->Play();
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags)
-{
- return pCue->Stop(dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState)
-{
- return pCue->GetState(pdwState);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue)
-{
- return pCue->Destroy();
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
-{
- return pCue->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
-}
-
-__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName)
-{
- return pCue->GetVariableIndex(szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue)
-{
- return pCue->SetVariable(nIndex, nValue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue)
-{
- return pCue->GetVariable(nIndex, pnValue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause)
-{
- return pCue->Pause(fPause);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties)
-{
- return pCue->GetProperties(ppProperties);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList)
-{
- return pCue->SetOutputVoices(pSendList);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix)
-{
- return pCue->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix);
-}
-
-#else // __cplusplus
-
-__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue)
-{
- return pCue->lpVtbl->Play(pCue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags)
-{
- return pCue->lpVtbl->Stop(pCue, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState)
-{
- return pCue->lpVtbl->GetState(pCue, pdwState);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue)
-{
- return pCue->lpVtbl->Destroy(pCue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients)
-{
- return pCue->lpVtbl->SetMatrixCoefficients(pCue, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients);
-}
-
-__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName)
-{
- return pCue->lpVtbl->GetVariableIndex(pCue, szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue)
-{
- return pCue->lpVtbl->SetVariable(pCue, nIndex, nValue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue)
-{
- return pCue->lpVtbl->GetVariable(pCue, nIndex, pnValue);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause)
-{
- return pCue->lpVtbl->Pause(pCue, fPause);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties)
-{
- return pCue->lpVtbl->GetProperties(pCue, ppProperties);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList)
-{
- return pCue->lpVtbl->SetOutputVoices(pSendList);
-}
-
-__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix)
-{
- return pCue->lpVtbl->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix);
-}
-
-#endif // __cplusplus
-
-//------------------------------------------------------------------------------
-// IXACT3Engine
-//------------------------------------------------------------------------------
-
-// Engine flags
-#define XACT_FLAG_ENGINE_CREATE_MANAGEDATA XACT_FLAG_MANAGEDATA
-#define XACT_FLAG_ENGINE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE
-
-STDAPI_(ULONG) IXACT3Engine_AddRef(__in IXACT3Engine* pEngine);
-STDAPI_(ULONG) IXACT3Engine_Release(__in IXACT3Engine* pEngine);
-STDAPI IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount);
-STDAPI IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails);
-STDAPI IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat);
-STDAPI IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams);
-STDAPI IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine);
-STDAPI IXACT3Engine_DoWork(__in IXACT3Engine* pEngine);
-STDAPI IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank);
-STDAPI IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank);
-STDAPI IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank);
-STDAPI IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
-STDAPI IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
-STDAPI IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave);
-STDAPI IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc);
-STDAPI IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc);
-STDAPI_(XACTCATEGORY) IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName);
-STDAPI IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags);
-STDAPI IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume);
-STDAPI IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause);
-STDAPI_(XACTVARIABLEINDEX) IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName);
-STDAPI IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue);
-STDAPI IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue);
-
-#undef INTERFACE
-#define INTERFACE IXACT3Engine
-
-#ifdef _XBOX
-DECLARE_INTERFACE(IXACT3Engine)
-{
-#else
-DECLARE_INTERFACE_(IXACT3Engine, IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ __in REFIID riid, __deref_out void** ppvObj) PURE;
-#endif
-
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- STDMETHOD(GetRendererCount)(THIS_ __out XACTINDEX* pnRendererCount) PURE;
- STDMETHOD(GetRendererDetails)(THIS_ XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) PURE;
-
- STDMETHOD(GetFinalMixFormat)(THIS_ __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) PURE;
- STDMETHOD(Initialize)(THIS_ __in const XACT_RUNTIME_PARAMETERS* pParams) PURE;
- STDMETHOD(ShutDown)(THIS) PURE;
-
- STDMETHOD(DoWork)(THIS) PURE;
-
- STDMETHOD(CreateSoundBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) PURE;
- STDMETHOD(CreateInMemoryWaveBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) PURE;
- STDMETHOD(CreateStreamingWaveBank)(THIS_ __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) PURE;
-
- STDMETHOD(PrepareWave)(THIS_ DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
- STDMETHOD(PrepareInMemoryWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
- STDMETHOD(PrepareStreamingWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE;
-
- STDMETHOD(RegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE;
- STDMETHOD(UnRegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE;
-
- STDMETHOD_(XACTCATEGORY, GetCategory)(THIS_ __in PCSTR szFriendlyName) PURE;
- STDMETHOD(Stop)(THIS_ XACTCATEGORY nCategory, DWORD dwFlags) PURE;
- STDMETHOD(SetVolume)(THIS_ XACTCATEGORY nCategory, XACTVOLUME nVolume) PURE;
- STDMETHOD(Pause)(THIS_ XACTCATEGORY nCategory, BOOL fPause) PURE;
-
- STDMETHOD_(XACTVARIABLEINDEX, GetGlobalVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE;
- STDMETHOD(SetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE;
- STDMETHOD(GetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE;
-};
-
-#ifdef __cplusplus
-
-__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine)
-{
- return pEngine->AddRef();
-}
-
-__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine)
-{
- return pEngine->Release();
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount)
-{
- return pEngine->GetRendererCount(pnRendererCount);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails)
-{
- return pEngine->GetRendererDetails(nRendererIndex, pRendererDetails);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat)
-{
- return pEngine->GetFinalMixFormat(pFinalMixFormat);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams)
-{
- return pEngine->Initialize(pParams);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine)
-{
- return pEngine->ShutDown();
-}
-
-__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine)
-{
- return pEngine->DoWork();
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank)
-{
- return pEngine->CreateSoundBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank)
-{
- return pEngine->CreateInMemoryWaveBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank)
-{
- return pEngine->CreateStreamingWaveBank(pParms, ppWaveBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->PrepareWave(dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->PrepareInMemoryWave(dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->PrepareStreamingWave(dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc)
-{
- return pEngine->RegisterNotification(pNotificationDesc);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc)
-{
- return pEngine->UnRegisterNotification(pNotificationDesc);
-}
-
-__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName)
-{
- return pEngine->GetCategory(szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags)
-{
- return pEngine->Stop(nCategory, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume)
-{
- return pEngine->SetVolume(nCategory, nVolume);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause)
-{
- return pEngine->Pause(nCategory, fPause);
-}
-
-__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName)
-{
- return pEngine->GetGlobalVariableIndex(szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue)
-{
- return pEngine->SetGlobalVariable(nIndex, nValue);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue)
-{
- return pEngine->GetGlobalVariable(nIndex, nValue);
-}
-
-#else // __cplusplus
-
-__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine)
-{
- return pEngine->lpVtbl->AddRef(pEngine);
-}
-
-__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine)
-{
- return pEngine->lpVtbl->Release(pEngine);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount)
-{
- return pEngine->lpVtbl->GetRendererCount(pEngine, pnRendererCount);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails)
-{
- return pEngine->lpVtbl->GetRendererDetails(pEngine, nRendererIndex, pRendererDetails);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat)
-{
- return pEngine->lpVtbl->GetFinalMixFormat(pEngine, pFinalMixFormat);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams)
-{
- return pEngine->lpVtbl->Initialize(pEngine, pParams);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine)
-{
- return pEngine->lpVtbl->ShutDown(pEngine);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine)
-{
- return pEngine->lpVtbl->DoWork(pEngine);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank)
-{
- return pEngine->lpVtbl->CreateSoundBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank)
-{
- return pEngine->lpVtbl->CreateInMemoryWaveBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank)
-{
- return pEngine->lpVtbl->CreateStreamingWaveBank(pEngine, pParms, ppWaveBank);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->lpVtbl->PrepareWave(pEngine, dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->lpVtbl->PrepareInMemoryWave(pEngine, dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave)
-{
- return pEngine->lpVtbl->PrepareStreamingWave(pEngine, dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave);
-}
-
-
-__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc)
-{
- return pEngine->lpVtbl->RegisterNotification(pEngine, pNotificationDesc);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc)
-{
- return pEngine->lpVtbl->UnRegisterNotification(pEngine, pNotificationDesc);
-}
-
-__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName)
-{
- return pEngine->lpVtbl->GetCategory(pEngine, szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags)
-{
- return pEngine->lpVtbl->Stop(pEngine, nCategory, dwFlags);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume)
-{
- return pEngine->lpVtbl->SetVolume(pEngine, nCategory, nVolume);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause)
-{
- return pEngine->lpVtbl->Pause(pEngine, nCategory, fPause);
-}
-
-__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName)
-{
- return pEngine->lpVtbl->GetGlobalVariableIndex(pEngine, szFriendlyName);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue)
-{
- return pEngine->lpVtbl->SetGlobalVariable(pEngine, nIndex, nValue);
-}
-
-__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue)
-{
- return pEngine->lpVtbl->GetGlobalVariable(pEngine, nIndex, nValue);
-}
-
-#endif // __cplusplus
-
-//------------------------------------------------------------------------------
-// Create Engine
-//------------------------------------------------------------------------------
-
-// Flags used only in XACT3CreateEngine below. These flags are valid but ignored
-// when building for Xbox 360; to enable auditioning on that platform you must
-// link explicitly to an auditioning version of the XACT static library.
-static const DWORD XACT_FLAG_API_AUDITION_MODE = 0x00000001;
-static const DWORD XACT_FLAG_API_DEBUG_MODE = 0x00000002;
-
-#ifdef _XBOX
-
-STDAPI XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine);
-
-#else // #ifdef _XBOX
-
-#define XACT_DEBUGENGINE_REGISTRY_KEY TEXT("Software\\Microsoft\\XACT")
-#define XACT_DEBUGENGINE_REGISTRY_VALUE TEXT("DebugEngine")
-
-
-#ifdef __cplusplus
-
-__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine)
-{
- HRESULT hr;
- HKEY key;
- DWORD data;
- DWORD type = REG_DWORD;
- DWORD dataSize = sizeof(DWORD);
- BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE;
- BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE;
-
- // If neither the debug nor audition flags are set, see if the debug registry key is set
- if(!debug && !audition &&
- (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS))
- {
- if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS)
- {
- if(data)
- {
- debug = TRUE;
- }
- }
- RegCloseKey(key);
- }
-
- // Priority order: Audition, Debug, Retail
- hr = CoCreateInstance(audition ? __uuidof(XACTAuditionEngine)
- : (debug ? __uuidof(XACTDebugEngine) : __uuidof(XACTEngine)),
- NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine);
-
- // If debug engine does not exist fallback to retail version
- if(FAILED(hr) && debug && !audition)
- {
- hr = CoCreateInstance(__uuidof(XACTEngine), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine);
- }
-
- return hr;
-}
-
-#else // #ifdef __cplusplus
-
-__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine)
-{
- HRESULT hr;
- HKEY key;
- DWORD data;
- DWORD type = REG_DWORD;
- DWORD dataSize = sizeof(DWORD);
- BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE;
- BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE;
-
- // If neither the debug nor audition flags are set, see if the debug registry key is set
- if(!debug && !audition &&
- (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS))
- {
- if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS)
- {
- if(data)
- {
- debug = TRUE;
- }
- }
- RegCloseKey(key);
- }
-
- // Priority order: Audition, Debug, Retail
- hr = CoCreateInstance(audition ? &CLSID_XACTAuditionEngine
- : (debug ? &CLSID_XACTDebugEngine : &CLSID_XACTEngine),
- NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine);
-
- // If debug engine does not exist fallback to retail version
- if(FAILED(hr) && debug && !audition)
- {
- hr = CoCreateInstance(&CLSID_XACTEngine, NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine);
- }
-
- return hr;
-}
-
-#endif // #ifdef __cplusplus
-
-#endif // #ifdef _XBOX
-
-//------------------------------------------------------------------------------
-// XACT specific error codes
-//------------------------------------------------------------------------------
-
-#define FACILITY_XACTENGINE 0xAC7
-#define XACTENGINEERROR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XACTENGINE, n)
-
-#define XACTENGINE_E_OUTOFMEMORY E_OUTOFMEMORY // Out of memory
-#define XACTENGINE_E_INVALIDARG E_INVALIDARG // Invalid arg
-#define XACTENGINE_E_NOTIMPL E_NOTIMPL // Not implemented
-#define XACTENGINE_E_FAIL E_FAIL // Unknown error
-
-#define XACTENGINE_E_ALREADYINITIALIZED XACTENGINEERROR(0x001) // The engine is already initialized
-#define XACTENGINE_E_NOTINITIALIZED XACTENGINEERROR(0x002) // The engine has not been initialized
-#define XACTENGINE_E_EXPIRED XACTENGINEERROR(0x003) // The engine has expired (demo or pre-release version)
-#define XACTENGINE_E_NONOTIFICATIONCALLBACK XACTENGINEERROR(0x004) // No notification callback
-#define XACTENGINE_E_NOTIFICATIONREGISTERED XACTENGINEERROR(0x005) // Notification already registered
-#define XACTENGINE_E_INVALIDUSAGE XACTENGINEERROR(0x006) // Invalid usage
-#define XACTENGINE_E_INVALIDDATA XACTENGINEERROR(0x007) // Invalid data
-#define XACTENGINE_E_INSTANCELIMITFAILTOPLAY XACTENGINEERROR(0x008) // Fail to play due to instance limit
-#define XACTENGINE_E_NOGLOBALSETTINGS XACTENGINEERROR(0x009) // Global Settings not loaded
-#define XACTENGINE_E_INVALIDVARIABLEINDEX XACTENGINEERROR(0x00a) // Invalid variable index
-#define XACTENGINE_E_INVALIDCATEGORY XACTENGINEERROR(0x00b) // Invalid category
-#define XACTENGINE_E_INVALIDCUEINDEX XACTENGINEERROR(0x00c) // Invalid cue index
-#define XACTENGINE_E_INVALIDWAVEINDEX XACTENGINEERROR(0x00d) // Invalid wave index
-#define XACTENGINE_E_INVALIDTRACKINDEX XACTENGINEERROR(0x00e) // Invalid track index
-#define XACTENGINE_E_INVALIDSOUNDOFFSETORINDEX XACTENGINEERROR(0x00f) // Invalid sound offset or index
-#define XACTENGINE_E_READFILE XACTENGINEERROR(0x010) // Error reading a file
-#define XACTENGINE_E_UNKNOWNEVENT XACTENGINEERROR(0x011) // Unknown event type
-#define XACTENGINE_E_INCALLBACK XACTENGINEERROR(0x012) // Invalid call of method of function from callback
-#define XACTENGINE_E_NOWAVEBANK XACTENGINEERROR(0x013) // No wavebank exists for desired operation
-#define XACTENGINE_E_SELECTVARIATION XACTENGINEERROR(0x014) // Unable to select a variation
-#define XACTENGINE_E_MULTIPLEAUDITIONENGINES XACTENGINEERROR(0x015) // There can be only one audition engine
-#define XACTENGINE_E_WAVEBANKNOTPREPARED XACTENGINEERROR(0x016) // The wavebank is not prepared
-#define XACTENGINE_E_NORENDERER XACTENGINEERROR(0x017) // No audio device found on.
-#define XACTENGINE_E_INVALIDENTRYCOUNT XACTENGINEERROR(0x018) // Invalid entry count for channel maps
-#define XACTENGINE_E_SEEKTIMEBEYONDCUEEND XACTENGINEERROR(0x019) // Time offset for seeking is beyond the cue end.
-#define XACTENGINE_E_SEEKTIMEBEYONDWAVEEND XACTENGINEERROR(0x01a) // Time offset for seeking is beyond the wave end.
-#define XACTENGINE_E_NOFRIENDLYNAMES XACTENGINEERROR(0x01b) // Friendly names are not included in the bank.
-
-#define XACTENGINE_E_AUDITION_WRITEFILE XACTENGINEERROR(0x101) // Error writing a file during auditioning
-#define XACTENGINE_E_AUDITION_NOSOUNDBANK XACTENGINEERROR(0x102) // Missing a soundbank
-#define XACTENGINE_E_AUDITION_INVALIDRPCINDEX XACTENGINEERROR(0x103) // Missing an RPC curve
-#define XACTENGINE_E_AUDITION_MISSINGDATA XACTENGINEERROR(0x104) // Missing data for an audition command
-#define XACTENGINE_E_AUDITION_UNKNOWNCOMMAND XACTENGINEERROR(0x105) // Unknown command
-#define XACTENGINE_E_AUDITION_INVALIDDSPINDEX XACTENGINEERROR(0x106) // Missing a DSP parameter
-#define XACTENGINE_E_AUDITION_MISSINGWAVE XACTENGINEERROR(0x107) // Wave does not exist in auditioned wavebank
-#define XACTENGINE_E_AUDITION_CREATEDIRECTORYFAILED XACTENGINEERROR(0x108) // Failed to create a directory for streaming wavebank data
-#define XACTENGINE_E_AUDITION_INVALIDSESSION XACTENGINEERROR(0x109) // Invalid audition session
-
-#endif // #ifndef GUID_DEFS_ONLY
-
-#endif // #ifndef _XACT3_H_
diff --git a/3rdparty/dxsdk/Include/xact3d3.h b/3rdparty/dxsdk/Include/xact3d3.h
deleted file mode 100644
index f17e1e56a51..00000000000
--- a/3rdparty/dxsdk/Include/xact3d3.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/*-========================================================================-_
- | - XACT3D3 - |
- | Copyright (c) Microsoft Corporation. All rights reserved. |
- |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
- |VERSION: 0.1 MODEL: Unmanaged User-mode |
- |CONTRACT: N / A EXCEPT: No Exceptions |
- |PARENT: N / A MINREQ: Win2000, Xbox360 |
- |PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 |
- |>------------------------------------------------------------------------<|
- | DUTY: XACT 3D support |
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
- NOTES:
- 1. See X3DAudio.h for information regarding X3DAudio types. */
-
-
-#ifndef __XACT3D3_H__
-#define __XACT3D3_H__
-
-//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
- #include <x3daudio.h>
- #include <xact3.h>
-
- #pragma warning(push)
- #pragma warning(disable: 4701) // disable "local variable may be used without having been initialized" compile warning
-
- // Supported speaker positions, represented as azimuth angles.
- //
- // Here's a picture of the azimuth angles for the 8 cardinal points,
- // seen from above. The emitter's base position is at the origin 0.
- //
- // FRONT
- // | 0 <-- azimuth
- // |
- // 7pi/4 \ | / pi/4
- // \ | /
- // LEFT \|/ RIGHT
- // 3pi/2-------0-------pi/2
- // /|\
- // / | \
- // 5pi/4 / | \ 3pi/4
- // |
- // | pi
- // BACK
- //
- #define LEFT_AZIMUTH (3*X3DAUDIO_PI/2)
- #define RIGHT_AZIMUTH (X3DAUDIO_PI/2)
- #define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4)
- #define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4)
- #define FRONT_CENTER_AZIMUTH 0.0f
- #define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI
- #define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4)
- #define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4)
- #define BACK_CENTER_AZIMUTH X3DAUDIO_PI
- #define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8)
- #define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8)
-
-
-//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
- // Supported emitter channel layouts:
- static const float aStereoLayout[] =
- {
- LEFT_AZIMUTH,
- RIGHT_AZIMUTH
- };
- static const float a2Point1Layout[] =
- {
- LEFT_AZIMUTH,
- RIGHT_AZIMUTH,
- LOW_FREQUENCY_AZIMUTH
- };
- static const float aQuadLayout[] =
- {
- FRONT_LEFT_AZIMUTH,
- FRONT_RIGHT_AZIMUTH,
- BACK_LEFT_AZIMUTH,
- BACK_RIGHT_AZIMUTH
- };
- static const float a4Point1Layout[] =
- {
- FRONT_LEFT_AZIMUTH,
- FRONT_RIGHT_AZIMUTH,
- LOW_FREQUENCY_AZIMUTH,
- BACK_LEFT_AZIMUTH,
- BACK_RIGHT_AZIMUTH
- };
- static const float a5Point1Layout[] =
- {
- FRONT_LEFT_AZIMUTH,
- FRONT_RIGHT_AZIMUTH,
- FRONT_CENTER_AZIMUTH,
- LOW_FREQUENCY_AZIMUTH,
- BACK_LEFT_AZIMUTH,
- BACK_RIGHT_AZIMUTH
- };
- static const float a7Point1Layout[] =
- {
- FRONT_LEFT_AZIMUTH,
- FRONT_RIGHT_AZIMUTH,
- FRONT_CENTER_AZIMUTH,
- LOW_FREQUENCY_AZIMUTH,
- BACK_LEFT_AZIMUTH,
- BACK_RIGHT_AZIMUTH,
- LEFT_AZIMUTH,
- RIGHT_AZIMUTH
- };
-
-
-//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
- ////
- // DESCRIPTION:
- // Initializes the 3D API's:
- //
- // REMARKS:
- // This method only needs to be called once.
- // X3DAudio will be initialized such that its speaker channel mask
- // matches the format of the given XACT engine's final mix.
- //
- // PARAMETERS:
- // pEngine - [in] XACT engine
- // X3DInstance - [out] X3DAudio instance handle
- //
- // RETURN VALUE:
- // HResult error code
- ////
- EXTERN_C HRESULT inline XACT3DInitialize (__in IXACT3Engine* pEngine, __in X3DAUDIO_HANDLE X3DInstance)
- {
- HRESULT hr = S_OK;
- if (pEngine == NULL) {
- hr = E_POINTER;
- }
-
- XACTVARIABLEVALUE nSpeedOfSound;
- if (SUCCEEDED(hr)) {
- XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound");
- hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound);
- }
-
- if (SUCCEEDED(hr)) {
- WAVEFORMATEXTENSIBLE wfxFinalMixFormat;
- hr = pEngine->GetFinalMixFormat(&wfxFinalMixFormat);
- if (SUCCEEDED(hr)) {
- X3DAudioInitialize(wfxFinalMixFormat.dwChannelMask, nSpeedOfSound, X3DInstance);
- }
- }
- return hr;
- }
-
-
- ////
- // DESCRIPTION:
- // Calculates DSP settings with respect to 3D parameters:
- //
- // REMARKS:
- // Note the following flags are always specified for XACT3D calculation:
- // X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE
- //
- // This means the caller must set at least the following fields:
- // X3DAUDIO_LISTENER.OrientFront
- // X3DAUDIO_LISTENER.OrientTop
- // X3DAUDIO_LISTENER.Position
- // X3DAUDIO_LISTENER.Velocity
- //
- // X3DAUDIO_EMITTER.OrientFront
- // X3DAUDIO_EMITTER.OrientTop, if emitter is multi-channel
- // X3DAUDIO_EMITTER.Position
- // X3DAUDIO_EMITTER.Velocity
- // X3DAUDIO_EMITTER.InnerRadius
- // X3DAUDIO_EMITTER.InnerRadiusAngle
- // X3DAUDIO_EMITTER.ChannelCount
- // X3DAUDIO_EMITTER.CurveDistanceScaler
- // X3DAUDIO_EMITTER.DopplerScaler
- //
- // X3DAUDIO_DSP_SETTINGS.pMatrixCoefficients, the caller need only allocate space for SrcChannelCount*DstChannelCount elements
- // X3DAUDIO_DSP_SETTINGS.SrcChannelCount
- // X3DAUDIO_DSP_SETTINGS.DstChannelCount
- //
- // If X3DAUDIO_EMITTER.pChannelAzimuths is left NULL for multi-channel emitters,
- // a default channel radius and channel azimuth array will be applied below.
- // Distance curves such as X3DAUDIO_EMITTER.pVolumeCurve should be
- // left NULL as XACT's native RPCs will be used to define DSP behaviour
- // with respect to normalized distance.
- //
- // See X3DAudio.h for information regarding X3DAudio types.
- //
- // PARAMETERS:
- // X3DInstance - [in] X3DAudio instance handle, returned from XACT3DInitialize()
- // pListener - [in] point of 3D audio reception
- // pEmitter - [in] 3D audio source
- // pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply()
- //
- // RETURN VALUE:
- // HResult error code
- ////
- EXTERN_C HRESULT inline XACT3DCalculate (__in X3DAUDIO_HANDLE X3DInstance, __in const X3DAUDIO_LISTENER* pListener, __inout X3DAUDIO_EMITTER* pEmitter, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings)
- {
- HRESULT hr = S_OK;
- if (pListener == NULL || pEmitter == NULL || pDSPSettings == NULL) {
- hr = E_POINTER;
- }
-
- if (SUCCEEDED(hr)) {
- if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) {
- pEmitter->ChannelRadius = 1.0f;
-
- switch (pEmitter->ChannelCount) {
- case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break;
- case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break;
- case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break;
- case 5: pEmitter->pChannelAzimuths = (float*)&a4Point1Layout[0]; break;
- case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break;
- case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break;
- default: hr = E_FAIL; break;
- }
- }
- }
-
- if (SUCCEEDED(hr)) {
- static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f };
- static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 };
- if (pEmitter->pVolumeCurve == NULL) {
- pEmitter->pVolumeCurve = &DefaultCurve;
- }
- if (pEmitter->pLFECurve == NULL) {
- pEmitter->pLFECurve = &DefaultCurve;
- }
-
- X3DAudioCalculate(X3DInstance, pListener, pEmitter, (X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE), pDSPSettings);
- }
-
- return hr;
- }
-
-
- ////
- // DESCRIPTION:
- // Applies results from a call to XACT3DCalculate() to a cue.
- //
- // PARAMETERS:
- // pDSPSettings - [in] calculation results generated by XACT3DCalculate()
- // pCue - [in] cue to which to apply pDSPSettings
- //
- // RETURN VALUE:
- // HResult error code
- ////
- EXTERN_C HRESULT inline XACT3DApply (__in const X3DAUDIO_DSP_SETTINGS* pDSPSettings, __in IXACT3Cue* pCue)
- {
- HRESULT hr = S_OK;
- if (pDSPSettings == NULL || pCue == NULL) {
- hr = E_POINTER;
- }
-
- if (SUCCEEDED(hr)) {
- hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients);
- }
- if (SUCCEEDED(hr)) {
- XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance");
- hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance);
- }
- if (SUCCEEDED(hr)) {
- XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar");
- hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor);
- }
- if (SUCCEEDED(hr)) {
- XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle");
- hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI));
- }
-
- return hr;
- }
-
-
- #pragma warning(pop)
-
-#endif // __XACT3D3_H__
-//---------------------------------<-EOF->----------------------------------//
diff --git a/3rdparty/dxsdk/Include/xact3wb.h b/3rdparty/dxsdk/Include/xact3wb.h
deleted file mode 100644
index 521667b0f84..00000000000
--- a/3rdparty/dxsdk/Include/xact3wb.h
+++ /dev/null
@@ -1,598 +0,0 @@
-/***************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: xact3wb.h
- * Content: XACT 3 wave bank definitions.
- *
- ****************************************************************************/
-
-#ifndef __XACT3WB_H__
-#define __XACT3WB_H__
-
-#ifdef _XBOX
-# include <xtl.h>
-#else
-# include <math.h>
-#endif
-
-#include <audiodefs.h>
-#include <xma2defs.h>
-
-#pragma warning(push)
-#pragma warning(disable:4201)
-#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int
-
-#pragma pack(push, 1)
-#if !defined(_X86_)
- #define XACTUNALIGNED __unaligned
-#else
- #define XACTUNALIGNED
-#endif
-
-#ifdef _M_PPCBE
-#pragma bitfield_order(push, lsb_to_msb)
-#endif
-
-#define WAVEBANK_HEADER_SIGNATURE 'DNBW' // WaveBank RIFF chunk signature
-#define WAVEBANK_HEADER_VERSION 44 // Current wavebank file version
-
-#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters
-#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters
-
-#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes
-#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes
-
-typedef DWORD WAVEBANKOFFSET;
-
-//
-// Bank flags
-//
-
-#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer
-#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming
-#define WAVEBANK_TYPE_MASK 0x00000001
-
-#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names
-#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format
-#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync
-#define WAVEBANK_FLAGS_SEEKTABLES 0x00080000 // Bank includes seek tables.
-#define WAVEBANK_FLAGS_MASK 0x000F0000
-
-//
-// Entry flags
-//
-
-#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead
-#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave
-#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region
-#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used
-#define WAVEBANKENTRY_FLAGS_MASK 0x00000008
-
-//
-// Entry wave format identifiers
-//
-
-#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data
-#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data
-#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data
-#define WAVEBANKMINIFORMAT_TAG_WMA 0x3 // WMA data
-
-#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only)
-#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only)
-
-//
-// Arbitrary fixed sizes
-//
-#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio
-#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX)
-
-//
-// DVD data sizes
-//
-
-#define WAVEBANK_DVD_SECTOR_SIZE 2048
-#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16)
-
-//
-// Bank alignment presets
-//
-
-#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment
-#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment
-
-//
-// Wave bank segment identifiers
-//
-
-typedef enum WAVEBANKSEGIDX
-{
- WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data
- WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data
- WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves.
- WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names
- WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data
- WAVEBANK_SEGIDX_COUNT
-} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX;
-
-typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX;
-
-//
-// Endianness
-//
-
-#ifdef __cplusplus
-
-namespace XACTWaveBank
-{
- __inline void SwapBytes(XACTUNALIGNED DWORD &dw)
- {
-
-#ifdef _X86_
-
- __asm
- {
- mov edi, dw
- mov eax, [edi]
- bswap eax
- mov [edi], eax
- }
-
-#else // _X86_
-
- dw = _byteswap_ulong(dw);
-
-#endif // _X86_
-
- }
-
- __inline void SwapBytes(XACTUNALIGNED WORD &w)
- {
-
-#ifdef _X86_
-
- __asm
- {
- mov edi, w
- mov ax, [edi]
- xchg ah, al
- mov [edi], ax
- }
-
-#else // _X86_
-
- w = _byteswap_ushort(w);
-
-#endif // _X86_
-
- }
-
-}
-
-#endif // __cplusplus
-
-//
-// Wave bank region in bytes.
-//
-
-typedef struct WAVEBANKREGION
-{
- DWORD dwOffset; // Region offset, in bytes.
- DWORD dwLength; // Region length, in bytes.
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwOffset);
- XACTWaveBank::SwapBytes(dwLength);
- }
-
-#endif // __cplusplus
-
-} WAVEBANKREGION, *LPWAVEBANKREGION;
-
-typedef const WAVEBANKREGION *LPCWAVEBANKREGION;
-
-
-//
-// Wave bank region in samples.
-//
-
-typedef struct WAVEBANKSAMPLEREGION
-{
- DWORD dwStartSample; // Start sample for the region.
- DWORD dwTotalSamples; // Region length in samples.
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwStartSample);
- XACTWaveBank::SwapBytes(dwTotalSamples);
- }
-
-#endif // __cplusplus
-
-} WAVEBANKSAMPLEREGION, *LPWAVEBANKSAMPLEREGION;
-
-typedef const WAVEBANKSAMPLEREGION *LPCWAVEBANKSAMPLEREGION;
-
-
-//
-// Wave bank file header
-//
-
-typedef struct WAVEBANKHEADER
-{
- DWORD dwSignature; // File signature
- DWORD dwVersion; // Version of the tool that created the file
- DWORD dwHeaderVersion; // Version of the file format
- WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwSignature);
- XACTWaveBank::SwapBytes(dwVersion);
- XACTWaveBank::SwapBytes(dwHeaderVersion);
-
- for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++)
- {
- Segments[i].SwapBytes();
- }
- }
-
-#endif // __cplusplus
-
-} WAVEBANKHEADER, *LPWAVEBANKHEADER;
-
-typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER;
-
-//
-// Table for converting WMA Average Bytes per Second values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field
-// NOTE: There can be a max of 8 values in the table.
-//
-
-#define MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7
-
-static const DWORD aWMAAvgBytesPerSec[] =
-{
- 12000,
- 24000,
- 4000,
- 6000,
- 8000,
- 20000,
- 2500
-};
-// bitrate = entry * 8
-
-//
-// Table for converting WMA Block Align values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field
-// NOTE: There can be a max of 32 values in the table.
-//
-
-#define MAX_WMA_BLOCK_ALIGN_ENTRIES 17
-
-static const DWORD aWMABlockAlign[] =
-{
- 929,
- 1487,
- 1280,
- 2230,
- 8917,
- 8192,
- 4459,
- 5945,
- 2304,
- 1536,
- 1485,
- 1008,
- 2731,
- 4096,
- 6827,
- 5462,
- 1280
-};
-
-struct WAVEBANKENTRY;
-
-//
-// Entry compressed data format
-//
-
-typedef union WAVEBANKMINIWAVEFORMAT
-{
- struct
- {
- DWORD wFormatTag : 2; // Format tag
- DWORD nChannels : 3; // Channel count (1 - 6)
- DWORD nSamplesPerSec : 18; // Sampling rate
- DWORD wBlockAlign : 8; // Block alignment. For WMA, lower 6 bits block alignment index, upper 2 bits bytes-per-second index.
- DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only); WMAudio2/WMAudio3 (for WMA)
- };
-
- DWORD dwValue;
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwValue);
- }
-
- WORD BitsPerSample() const
- {
- if (wFormatTag == WAVEBANKMINIFORMAT_TAG_XMA)
- return XMA_OUTPUT_SAMPLE_BITS; // First, because most common on Xbox 360
- if (wFormatTag == WAVEBANKMINIFORMAT_TAG_WMA)
- return 16;
- if (wFormatTag == WAVEBANKMINIFORMAT_TAG_ADPCM)
- return 4; // MSADPCM_BITS_PER_SAMPLE == 4
-
- // wFormatTag must be WAVEBANKMINIFORMAT_TAG_PCM (2 bits can only represent 4 different values)
- return (wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16) ? 16 : 8;
- }
-
- #define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22
- DWORD BlockAlign() const
- {
- DWORD dwReturn = 0;
-
- switch (wFormatTag)
- {
- case WAVEBANKMINIFORMAT_TAG_PCM:
- dwReturn = wBlockAlign;
- break;
-
- case WAVEBANKMINIFORMAT_TAG_XMA:
- dwReturn = nChannels * XMA_OUTPUT_SAMPLE_BITS / 8;
- break;
-
- case WAVEBANKMINIFORMAT_TAG_ADPCM:
- dwReturn = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels;
- break;
-
- case WAVEBANKMINIFORMAT_TAG_WMA:
- {
- DWORD dwBlockAlignIndex = wBlockAlign & 0x1F;
- if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES)
- dwReturn = aWMABlockAlign[dwBlockAlignIndex];
- }
- break;
- }
-
- return dwReturn;
- }
-
- DWORD AvgBytesPerSec() const
- {
- DWORD dwReturn = 0;
-
- switch (wFormatTag)
- {
- case WAVEBANKMINIFORMAT_TAG_PCM:
- case WAVEBANKMINIFORMAT_TAG_XMA:
- dwReturn = nSamplesPerSec * wBlockAlign;
- break;
-
- case WAVEBANKMINIFORMAT_TAG_ADPCM:
- {
- DWORD blockAlign = BlockAlign();
- DWORD samplesPerAdpcmBlock = AdpcmSamplesPerBlock();
- dwReturn = blockAlign * nSamplesPerSec / samplesPerAdpcmBlock;
- }
- break;
-
- case WAVEBANKMINIFORMAT_TAG_WMA:
- {
- DWORD dwBytesPerSecIndex = wBlockAlign >> 5;
- if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES)
- dwReturn = aWMAAvgBytesPerSec[dwBytesPerSecIndex];
- }
- break;
- }
-
- return dwReturn;
- }
-
- DWORD EncodeWMABlockAlign(DWORD dwBlockAlign, DWORD dwAvgBytesPerSec) const
- {
- DWORD dwReturn = 0;
- DWORD dwBlockAlignIndex = 0;
- DWORD dwBytesPerSecIndex = 0;
-
- for (; dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES && dwBlockAlign != aWMABlockAlign[dwBlockAlignIndex]; dwBlockAlignIndex++);
-
- if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES)
- {
- for (; dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES && dwAvgBytesPerSec != aWMAAvgBytesPerSec[dwBytesPerSecIndex]; dwBytesPerSecIndex++);
-
- if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES)
- {
- dwReturn = dwBlockAlignIndex | (dwBytesPerSecIndex << 5);
- }
- }
-
- return dwReturn;
- }
-
-
- void XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const struct WAVEBANKENTRY* entry) const;
-
- DWORD AdpcmSamplesPerBlock() const
- {
- DWORD nBlockAlign = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels;
- return nBlockAlign * 2 / (DWORD)nChannels - 12;
- }
-
- void AdpcmFillCoefficientTable(ADPCMWAVEFORMAT *fmt) const
- {
- // These are fixed since we are always using MS ADPCM
- fmt->wNumCoef = 7; /* MSADPCM_NUM_COEFFICIENTS */
-
- static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} };
- memcpy( &fmt->aCoef, aCoef, sizeof(aCoef) );
- }
-
-#endif // __cplusplus
-
-} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT;
-
-typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT;
-
-//
-// Entry meta-data
-//
-
-typedef struct WAVEBANKENTRY
-{
- union
- {
- struct
- {
- // Entry flags
- DWORD dwFlags : 4;
-
- // Duration of the wave, in units of one sample.
- // For instance, a ten second long wave sampled
- // at 48KHz would have a duration of 480,000.
- // This value is not affected by the number of
- // channels, the number of bits per sample, or the
- // compression format of the wave.
- DWORD Duration : 28;
- };
- DWORD dwFlagsAndDuration;
- };
-
- WAVEBANKMINIWAVEFORMAT Format; // Entry format.
- WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry.
- WAVEBANKSAMPLEREGION LoopRegion; // Region within the wave data (in samples) that should loop.
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwFlagsAndDuration);
- Format.SwapBytes();
- PlayRegion.SwapBytes();
- LoopRegion.SwapBytes();
- }
-
-#endif // __cplusplus
-
-} WAVEBANKENTRY, *LPWAVEBANKENTRY;
-
-typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY;
-
-//
-// Compact entry meta-data
-//
-
-typedef struct WAVEBANKENTRYCOMPACT
-{
- DWORD dwOffset : 21; // Data offset, in sectors
- DWORD dwLengthDeviation : 11; // Data length deviation, in bytes
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(*(LPDWORD)this);
- }
-
-#endif // __cplusplus
-
-} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT;
-
-typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT;
-
-//
-// Bank data segment
-//
-
-typedef struct WAVEBANKDATA
-{
- DWORD dwFlags; // Bank flags
- DWORD dwEntryCount; // Number of entries in the bank
- CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name
- DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes
- DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes
- DWORD dwAlignment; // Entry alignment, in bytes
- WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank
- FILETIME BuildTime; // Build timestamp
-
-#ifdef __cplusplus
-
- void SwapBytes(void)
- {
- XACTWaveBank::SwapBytes(dwFlags);
- XACTWaveBank::SwapBytes(dwEntryCount);
- XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize);
- XACTWaveBank::SwapBytes(dwEntryNameElementSize);
- XACTWaveBank::SwapBytes(dwAlignment);
- CompactFormat.SwapBytes();
- XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime);
- XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime);
- }
-
-#endif // __cplusplus
-
-} WAVEBANKDATA, *LPWAVEBANKDATA;
-
-typedef const WAVEBANKDATA *LPCWAVEBANKDATA;
-
-inline void WAVEBANKMINIWAVEFORMAT::XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const WAVEBANKENTRY* entry) const
-{
- // Note caller is responsbile for filling out fmt->wfx with other helper functions.
-
- fmt->NumStreams = (WORD)( (nChannels + 1) / 2 );
-
- switch (nChannels)
- {
- case 1: fmt->ChannelMask = SPEAKER_MONO; break;
- case 2: fmt->ChannelMask = SPEAKER_STEREO; break;
- case 3: fmt->ChannelMask = SPEAKER_2POINT1; break;
- case 4: fmt->ChannelMask = SPEAKER_QUAD; break;
- case 5: fmt->ChannelMask = SPEAKER_4POINT1; break;
- case 6: fmt->ChannelMask = SPEAKER_5POINT1; break;
- case 7: fmt->ChannelMask = SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; break;
- case 8: fmt->ChannelMask = SPEAKER_7POINT1; break;
- default: fmt->ChannelMask = 0; break;
- }
-
- fmt->SamplesEncoded = entry->Duration;
- fmt->BytesPerBlock = 65536; /* XACT_FIXED_XMA_BLOCK_SIZE */
-
- fmt->PlayBegin = entry->PlayRegion.dwOffset;
- fmt->PlayLength = entry->PlayRegion.dwLength;
-
- if (entry->LoopRegion.dwTotalSamples > 0)
- {
- fmt->LoopBegin = entry->LoopRegion.dwStartSample;
- fmt->LoopLength = entry->LoopRegion.dwTotalSamples;
- fmt->LoopCount = 0xff; /* XACTLOOPCOUNT_INFINITE */
- }
- else
- {
- fmt->LoopBegin = 0;
- fmt->LoopLength = 0;
- fmt->LoopCount = 0;
- }
-
- fmt->EncoderVersion = 4; // XMAENCODER_VERSION_XMA2
-
- fmt->BlockCount = blockCount;
-}
-
-#ifdef _M_PPCBE
-#pragma bitfield_order(pop)
-#endif
-
-#pragma warning(pop)
-#pragma pack(pop)
-
-#endif // __XACTWB_H__
-
diff --git a/3rdparty/dxsdk/Include/xma2defs.h b/3rdparty/dxsdk/Include/xma2defs.h
deleted file mode 100644
index 13a4306cb87..00000000000
--- a/3rdparty/dxsdk/Include/xma2defs.h
+++ /dev/null
@@ -1,718 +0,0 @@
-/***************************************************************************
- *
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * File: xma2defs.h
- * Content: Constants, data types and functions for XMA2 compressed audio.
- *
- ***************************************************************************/
-
-#ifndef __XMA2DEFS_INCLUDED__
-#define __XMA2DEFS_INCLUDED__
-
-#include <sal.h> // Markers for documenting API semantics
-#include <winerror.h> // For S_OK, E_FAIL
-#include <audiodefs.h> // Basic data types and constants for audio work
-
-
-/***************************************************************************
- * Overview
- ***************************************************************************/
-
-// A typical XMA2 file contains these RIFF chunks:
-//
-// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure
-// and characteristics (length, channels, sample rate, loops, block size, etc).
-//
-// 'seek' chunk: A seek table to help navigate the XMA data.
-//
-// 'data' chunk: The encoded XMA2 data.
-//
-// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS,
-// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames
-// in a file may also be divided into several subsets, called STREAMS.
-//
-// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono
-// or stereo PCM samples. This is the smallest unit of XMA data that can
-// be decoded in isolation. Frames are an arbitrary number of bits in
-// length, and need not be byte-aligned. See "XMA frame structure" below.
-//
-// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo
-// samples. The XMA decoder cannot decode a subframe in isolation; it needs
-// a whole frame to work with. However, it can begin emitting the frame's
-// decoded samples at any one of the four subframe boundaries. Subframes
-// can be addressed for seeking and looping purposes.
-//
-// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames
-// can (and usually do) span packets. A packet's header includes the offset
-// in bits of the first frame that begins within that packet. All of the
-// frames that begin in a given packet belong to the same "stream" (see the
-// Multichannel Audio section below).
-//
-// STREAM: A set of packets within an XMA file that all contain data for the
-// same mono or stereo component of a PCM file with more than two channels.
-// The packets comprising a given stream may be interleaved with each other
-// more or less arbitrarily; see Multichannel Audio.
-//
-// BLOCK: An array of XMA packets; or, to break it down differently, a series of
-// consecutive XMA frames, padded at the end with reserved data. A block
-// must contain at least one 2Kb packet per stream, and it can hold up to
-// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range.
-// (The size chosen involves a trade-off between memory use and efficiency
-// of reading from permanent storage.)
-//
-// XMA frames do not span blocks, so a block is guaranteed to begin with a
-// set of complete frames, one per stream. Also, a block in a multi-stream
-// XMA2 file always contains the same number of samples for each stream;
-// see Multichannel Audio.
-//
-// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA
-// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes)
-// except for the last one, which may be shorter.
-
-
-// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either
-// mono or stereo PCM data. In order to encode a 6-channel file (say), the file
-// must be deinterleaved into 3 stereo streams that are encoded independently,
-// producing 3 encoded XMA data streams. Then the packets in these 3 streams
-// are interleaved to produce a single XMA2 file, and some information is added
-// to the file so that the original 6-channel audio can be reconstructed at
-// decode time. This works using the concept of an XMA stream (see above).
-//
-// The frames for all the streams in an XMA file are interleaved in an arbitrary
-// order. To locate a frame that belongs to a given stream in a given XMA block,
-// you must examine the first few packets in the block. Here (and only here) the
-// packets are guaranteed to be presented in stream order, so that all frames
-// beginning in packet 0 belong to stream 0 (the first stereo pair), etc.
-//
-// (This means that when decoding multi-stream XMA files, only entire XMA blocks
-// should be submitted to the decoder; otherwise it cannot know which frames
-// belong to which stream.)
-//
-// Once you have one frame that belongs to a given stream, you can find the next
-// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in
-// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function
-// uses this technique.
-
-
-// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and
-// subframe in an XMA2 file which will contain sample S when decoded.
-//
-// 1. Traverse the seek table to find the XMA2 block containing sample S. The
-// seek table is an array of big-endian DWORDs, one per block in the file.
-// The Nth DWORD is the total number of PCM samples that would be obtained
-// by decoding the entire XMA file up to the end of block N. Hence, the
-// block we want is the first one whose seek table entry is greater than S.
-// (See the GetXmaBlockContainingSample helper function.)
-//
-// 2. Calculate which frame F within the block found above contains sample S.
-// Since each frame decodes to 512 samples, this is straightforward. The
-// first frame in the block produces samples X to X + 512, where X is the
-// seek table entry for the prior block. So F is (S - X) / 512.
-//
-// 3. Find the bit offset within the block where frame F starts. Since frames
-// are variable-sized, this can only be done by traversing all the frames in
-// the block until we reach frame F. (See GetXmaFrameBitPosition.)
-//
-// 4. Frame F has four 128-sample subframes. To find the subframe containing S,
-// we can use the formula (S % 512) / 128.
-//
-// In the case of multi-stream XMA files, sample S is a multichannel sample with
-// parts coming from several frames, one per stream. To find all these frames,
-// steps 2-4 need to be repeated for each stream N, using the knowledge that the
-// first packets in a block are presented in stream order. The frame traversal
-// in step 3 must be started at the first frame in the Nth packet of the block,
-// which will be the first frame for stream N. (And the packet header will tell
-// you the first frame's start position within the packet.)
-//
-// Step 1 can be performed using the GetXmaBlockContainingSample function below,
-// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream.
-
-
-
-/***************************************************************************
- * XMA constants
- ***************************************************************************/
-
-// Size of the PCM samples produced by the XMA decoder
-#define XMA_OUTPUT_SAMPLE_BYTES 2u
-#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u)
-
-// Size of an XMA packet
-#define XMA_BYTES_PER_PACKET 2048u
-#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u)
-
-// Size of an XMA packet header
-#define XMA_PACKET_HEADER_BYTES 4u
-#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u)
-
-// Sample blocks in a decoded XMA frame
-#define XMA_SAMPLES_PER_FRAME 512u
-
-// Sample blocks in a decoded XMA subframe
-#define XMA_SAMPLES_PER_SUBFRAME 128u
-
-// Maximum encoded data that can be submitted to the XMA decoder at a time
-#define XMA_READBUFFER_MAX_PACKETS 4095u
-#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET)
-
-// Maximum size allowed for the XMA decoder's output buffers
-#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u)
-
-// Required byte alignment of the XMA decoder's output buffers
-#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u
-
-// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field
-#define XMA_MIN_SUBFRAMES_TO_DECODE 1u
-#define XMA_MAX_SUBFRAMES_TO_DECODE 8u
-#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u
-
-// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping
-#define XMA_MAX_LOOPCOUNT 254u
-#define XMA_INFINITE_LOOP 255u
-
-
-
-/***************************************************************************
- * XMA format structures
- ***************************************************************************/
-
-// The currently recommended way to express format information for XMA2 files
-// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with
-// the WAVEFORMATEX standard and contains all the information needed to parse
-// and manage XMA2 files in a compact way.
-
-#define WAVE_FORMAT_XMA2 0x166
-
-typedef struct XMA2WAVEFORMATEX
-{
- WAVEFORMATEX wfx;
- // Meaning of the WAVEFORMATEX fields here:
- // wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2
- // nChannels; // Channel count of the decoded audio
- // nSamplesPerSec; // Sample rate of the decoded audio
- // nAvgBytesPerSec; // Used internally by the XMA encoder
- // nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8
- // wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA
- // cbSize; // Size in bytes of the rest of this structure (34)
-
- WORD NumStreams; // Number of audio streams (1 or 2 channels each)
- DWORD ChannelMask; // Spatial positions of the channels in this file,
- // stored as SPEAKER_xxx values (see audiodefs.h)
- DWORD SamplesEncoded; // Total number of PCM samples the file decodes to
- DWORD BytesPerBlock; // XMA block size (but the last one may be shorter)
- DWORD PlayBegin; // First valid sample in the decoded audio
- DWORD PlayLength; // Length of the valid part of the decoded audio
- DWORD LoopBegin; // Beginning of the loop region in decoded sample terms
- DWORD LoopLength; // Length of the loop region in decoded sample terms
- BYTE LoopCount; // Number of loop repetitions; 255 = infinite
- BYTE EncoderVersion; // Version of XMA encoder that generated the file
- WORD BlockCount; // XMA blocks in file (and entries in its seek table)
-} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX;
-
-
-// The legacy XMA format structures are described here for reference, but they
-// should not be used in new content. XMAWAVEFORMAT was the structure used in
-// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not
-// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk.
-
-#ifndef WAVE_FORMAT_XMA
-#define WAVE_FORMAT_XMA 0x0165
-
-// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx
-// values defined in audiodefs.h, but modified to fit in a single byte.
-#ifndef XMA_SPEAKER_LEFT
- #define XMA_SPEAKER_LEFT 0x01
- #define XMA_SPEAKER_RIGHT 0x02
- #define XMA_SPEAKER_CENTER 0x04
- #define XMA_SPEAKER_LFE 0x08
- #define XMA_SPEAKER_LEFT_SURROUND 0x10
- #define XMA_SPEAKER_RIGHT_SURROUND 0x20
- #define XMA_SPEAKER_LEFT_BACK 0x40
- #define XMA_SPEAKER_RIGHT_BACK 0x80
-#endif
-
-
-// Used in XMAWAVEFORMAT for per-stream data
-typedef struct XMASTREAMFORMAT
-{
- DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons)
- DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files,
- // this is the same for all streams in the file).
- DWORD LoopStart; // Bit offset of the frame containing the loop start
- // point, relative to the beginning of the stream.
- DWORD LoopEnd; // Bit offset of the frame containing the loop end.
- BYTE SubframeData; // Two 4-bit numbers specifying the exact location of
- // the loop points within the frames that contain them.
- // SubframeEnd: Subframe of the loop end frame where
- // the loop ends. Ranges from 0 to 3.
- // SubframeSkip: Subframes to skip in the start frame to
- // reach the loop. Ranges from 0 to 4.
- BYTE Channels; // Number of channels in the stream (1 or 2)
- WORD ChannelMask; // Spatial positions of the channels in the stream
-} XMASTREAMFORMAT;
-
-// Legacy XMA1 format structure
-typedef struct XMAWAVEFORMAT
-{
- WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA)
- WORD BitsPerSample; // Bit depth (currently required to be 16)
- WORD EncodeOptions; // Options for XMA encoder/decoder
- WORD LargestSkip; // Largest skip used in interleaving streams
- WORD NumStreams; // Number of interleaved audio streams
- BYTE LoopCount; // Number of loop repetitions; 255 = infinite
- BYTE Version; // XMA encoder version that generated the file.
- // Always 3 or higher for XMA2 files.
- XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual
- // array length is in the NumStreams field.
-} XMAWAVEFORMAT;
-
-
-// Used in XMA2WAVEFORMAT for per-stream data
-typedef struct XMA2STREAMFORMAT
-{
- BYTE Channels; // Number of channels in the stream (1 or 2)
- BYTE RESERVED; // Reserved for future use
- WORD ChannelMask; // Spatial positions of the channels in the stream
-} XMA2STREAMFORMAT;
-
-// Legacy XMA2 format structure (big-endian byte ordering)
-typedef struct XMA2WAVEFORMAT
-{
- BYTE Version; // XMA encoder version that generated the file.
- // Always 3 or higher for XMA2 files.
- BYTE NumStreams; // Number of interleaved audio streams
- BYTE RESERVED; // Reserved for future use
- BYTE LoopCount; // Number of loop repetitions; 255 = infinite
- DWORD LoopBegin; // Loop begin point, in samples
- DWORD LoopEnd; // Loop end point, in samples
- DWORD SampleRate; // The file's decoded sample rate
- DWORD EncodeOptions; // Options for the XMA encoder/decoder
- DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder
- DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except
- // possibly the last one). Always a multiple of
- // 2Kb, since XMA blocks are arrays of 2Kb packets.
- DWORD SamplesEncoded; // Total number of PCM samples encoded in this file
- DWORD SamplesInSource; // Actual number of PCM samples in the source
- // material used to generate this file
- DWORD BlockCount; // Number of XMA blocks in this file (and hence
- // also the number of entries in its seek table)
- XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual
- // array length is in the NumStreams field.
-} XMA2WAVEFORMAT;
-
-#endif // #ifndef WAVE_FORMAT_XMA
-
-
-
-/***************************************************************************
- * XMA packet structure (in big-endian form)
- ***************************************************************************/
-
-typedef struct XMA2PACKET
-{
- int FrameCount : 6; // Number of XMA frames that begin in this packet
- int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins
- int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2)
- int PacketSkipCount : 8; // How many packets belonging to other streams must be
- // skipped to find the next packet belonging to this one
- BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data
-} XMA2PACKET;
-
-// E.g. if the first DWORD of a packet is 0x30107902:
-//
-// 001100 000001000001111 001 00000010
-// | | | |____ Skip 2 packets to find the next one for this stream
-// | | |___________ XMA2 signature (always 001)
-// | |_____________________ First frame starts 527 bits into packet
-// |________________________________ Packet contains 12 frames
-
-
-// Helper functions to extract the fields above from an XMA packet. (Note that
-// the bitfields cannot be read directly on little-endian architectures such as
-// the Intel x86, as they are laid out in big-endian form.)
-
-__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket)
-{
- return (DWORD)(pPacket[0] >> 2);
-}
-
-__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket)
-{
- return ((DWORD)(pPacket[0] & 0x3) << 13) |
- ((DWORD)(pPacket[1]) << 5) |
- ((DWORD)(pPacket[2]) >> 3);
-}
-
-__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket)
-{
- return (DWORD)(pPacket[2] & 0x7);
-}
-
-__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket)
-{
- return (DWORD)(pPacket[3]);
-}
-
-
-
-/***************************************************************************
- * XMA frame structure
- ***************************************************************************/
-
-// There is no way to represent the XMA frame as a C struct, since it is a
-// variable-sized string of bits that need not be stored at a byte-aligned
-// position in memory. This is the layout:
-//
-// XMAFRAME
-// {
-// LengthInBits: A 15-bit number representing the length of this frame.
-// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15).
-// }
-
-// Size in bits of the frame's initial LengthInBits field
-#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15
-
-// Special LengthInBits value that marks an invalid final frame
-#define XMA_FINAL_FRAME_MARKER 0x7FFF
-
-
-
-/***************************************************************************
- * XMA helper functions
- ***************************************************************************/
-
-// We define a local ASSERT macro to equal the global one if it exists.
-// You can define XMA2DEFS_ASSERT in advance to override this default.
-#ifndef XMA2DEFS_ASSERT
- #ifdef ASSERT
- #define XMA2DEFS_ASSERT ASSERT
- #else
- #define XMA2DEFS_ASSERT(a) /* No-op by default */
- #endif
-#endif
-
-
-// GetXmaBlockContainingSample: Use a given seek table to find the XMA block
-// containing a given decoded sample. Note that the seek table entries in an
-// XMA file are stored in big-endian form and may need to be converted prior
-// to calling this function.
-
-__inline HRESULT GetXmaBlockContainingSample
-(
- DWORD nBlockCount, // Blocks in the file (= seek table entries)
- __in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data
- DWORD nDesiredSample, // Decoded sample to locate
- __out DWORD* pnBlockContainingSample, // Index of the block containing the sample
- __out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block
-)
-{
- DWORD nPreviousTotalSamples = 0;
- DWORD nBlock;
- DWORD nTotalSamplesSoFar;
-
- XMA2DEFS_ASSERT(pSeekTable);
- XMA2DEFS_ASSERT(pnBlockContainingSample);
- XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock);
-
- for (nBlock = 0; nBlock < nBlockCount; ++nBlock)
- {
- nTotalSamplesSoFar = pSeekTable[nBlock];
- if (nTotalSamplesSoFar > nDesiredSample)
- {
- *pnBlockContainingSample = nBlock;
- *pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples;
- return S_OK;
- }
- nPreviousTotalSamples = nTotalSamplesSoFar;
- }
-
- return E_FAIL;
-}
-
-
-// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field.
-
-__inline DWORD GetXmaFrameLengthInBits
-(
- __in_bcount(nBitPosition / 8 + 3)
- __in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame
- DWORD nBitPosition // Bit offset of the frame within this packet
-)
-{
- DWORD nRegion;
- DWORD nBytePosition = nBitPosition / 8;
- DWORD nBitOffset = nBitPosition % 8;
-
- if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more)
- {
- nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 |
- (DWORD)(pPacket[nBytePosition+1]);
- return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits
- }
- else // Need to read 3 bytes
- {
- nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 |
- (DWORD)(pPacket[nBytePosition+1]) << 8 |
- (DWORD)(pPacket[nBytePosition+2]);
- return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits
- }
-}
-
-
-// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within
-// an XMA block or set of blocks. Returns 0 on failure.
-
-__inline DWORD GetXmaFrameBitPosition
-(
- __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
- DWORD nXmaDataBytes, // Size of pXmaData in bytes
- DWORD nStreamIndex, // Stream within which to seek
- DWORD nDesiredFrame // Frame sought
-)
-{
- const BYTE* pCurrentPacket;
- DWORD nPacketsExamined = 0;
- DWORD nFrameCountSoFar = 0;
- DWORD nFramesToSkip;
- DWORD nFrameBitOffset;
-
- XMA2DEFS_ASSERT(pXmaData);
- XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
-
- // Get the first XMA packet belonging to the desired stream, relying on the
- // fact that the first packets for each stream are in consecutive order at
- // the beginning of an XMA block.
-
- pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
- for (;;)
- {
- // If we have exceeded the size of the XMA data, return failure
- if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
- {
- return 0;
- }
-
- // If the current packet contains the frame we are looking for...
- if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame)
- {
- // See how many frames in this packet we need to skip to get to it
- XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar);
- nFramesToSkip = nDesiredFrame - nFrameCountSoFar;
-
- // Get the bit offset of the first frame in this packet
- nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket);
-
- // Advance nFrameBitOffset to the frame of interest
- while (nFramesToSkip--)
- {
- nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset);
- }
-
- // The bit offset to return is the number of bits from pXmaData to
- // pCurrentPacket plus the bit offset of the frame of interest
- return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset;
- }
-
- // If we haven't found the right packet yet, advance our counters
- ++nPacketsExamined;
- nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket);
-
- // And skip to the next packet belonging to the same stream
- pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1);
- }
-}
-
-
-// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete
-// frame in an XMA block or set of blocks.
-
-__inline DWORD GetLastXmaFrameBitPosition
-(
- __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
- DWORD nXmaDataBytes, // Size of pXmaData in bytes
- DWORD nStreamIndex // Stream within which to seek
-)
-{
- const BYTE* pLastPacket;
- DWORD nBytesToNextPacket;
- DWORD nFrameBitOffset;
- DWORD nFramesInLastPacket;
-
- XMA2DEFS_ASSERT(pXmaData);
- XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
- XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1));
-
- // Get the first XMA packet belonging to the desired stream, relying on the
- // fact that the first packets for each stream are in consecutive order at
- // the beginning of an XMA block.
- pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
-
- // Search for the last packet belonging to the desired stream
- for (;;)
- {
- nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1);
- XMA2DEFS_ASSERT(nBytesToNextPacket);
- if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
- {
- break; // The next packet would extend beyond the end of pXmaData
- }
- pLastPacket += nBytesToNextPacket;
- }
-
- // The last packet can sometimes have no seekable frames, in which case we
- // have to use the previous one
- if (GetXmaPacketFrameCount(pLastPacket) == 0)
- {
- pLastPacket -= nBytesToNextPacket;
- }
-
- // Found the last packet. Get the bit offset of its first frame.
- nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket);
-
- // Traverse frames until we reach the last one
- nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket);
- while (--nFramesInLastPacket)
- {
- nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset);
- }
-
- // The bit offset to return is the number of bits from pXmaData to
- // pLastPacket plus the offset of the last frame in this packet.
- return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset;
-}
-
-
-// GetXmaDecodePositionForSample: Obtains the information needed to make the
-// decoder generate audio starting at a given sample position relative to the
-// beginning of the given XMA block: the bit offset of the appropriate frame,
-// and the right subframe within that frame. This data can be passed directly
-// to the XMAPlaybackSetDecodePosition function.
-
-__inline HRESULT GetXmaDecodePositionForSample
-(
- __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
- DWORD nXmaDataBytes, // Size of pXmaData in bytes
- DWORD nStreamIndex, // Stream within which to seek
- DWORD nDesiredSample, // Sample sought
- __out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of
- // the frame containing the sample sought
- __out DWORD* pnSubFrame // Returns the subframe containing the sample
-)
-{
- DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME;
- DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME;
- DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame);
-
- XMA2DEFS_ASSERT(pnBitOffset);
- XMA2DEFS_ASSERT(pnSubFrame);
-
- if (nBitOffset)
- {
- *pnBitOffset = nBitOffset;
- *pnSubFrame = nSubFrame;
- return S_OK;
- }
- else
- {
- return E_FAIL;
- }
-}
-
-
-// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz)
-// corresponding to a generic sample rate.
-
-__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate)
-{
- DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz
-
- if (dwGeneralRate <= 24000) dwXmaRate = 24000;
- else if (dwGeneralRate <= 32000) dwXmaRate = 32000;
- else if (dwGeneralRate <= 44100) dwXmaRate = 44100;
-
- return dwXmaRate;
-}
-
-
-// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations
-// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which
-// are limited to eight possible speaker positions: left, right, center, low
-// frequency, side left, side right, back left and back right).
-
-__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask)
-{
- DWORD dwStandardMask = 0;
-
- if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT;
- if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT;
- if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER;
- if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY;
- if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT;
- if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT;
- if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT;
- if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT;
-
- return dwStandardMask;
-}
-
-__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask)
-{
- BYTE bXmaMask = 0;
-
- if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT;
- if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT;
- if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER;
- if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE;
- if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND;
- if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND;
- if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK;
- if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK;
-
- return bXmaMask;
-}
-
-
-// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply
-// with the current platform's byte-ordering rules (little- or big-endian).
-
-__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format)
-{
- #define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8)))
- #define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8))
-
- if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2)
- {
- return S_OK;
- }
- else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2)
- {
- pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag);
- pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels);
- pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec);
- pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec);
- pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign);
- pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample);
- pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize);
- pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams);
- pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask);
- pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded);
- pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock);
- pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin);
- pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength);
- pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin);
- pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength);
- pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount);
- return S_OK;
- }
- else
- {
- return E_FAIL; // Not a recognizable XMA2 format
- }
-
- #undef XMASWAP2BYTES
- #undef XMASWAP4BYTES
-}
-
-
-#endif // #ifndef __XMA2DEFS_INCLUDED__
diff --git a/3rdparty/dxsdk/Include/xnamath.h b/3rdparty/dxsdk/Include/xnamath.h
deleted file mode 100644
index daaba0b5593..00000000000
--- a/3rdparty/dxsdk/Include/xnamath.h
+++ /dev/null
@@ -1,2938 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- xnamath.h
-
-Abstract:
-
- XNA math library for Windows and Xbox 360
---*/
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#ifndef __XNAMATH_H__
-#define __XNAMATH_H__
-
-#ifdef __XBOXMATH_H__
-#error XNAMATH and XBOXMATH are incompatible in the same compilation module. Use one or the other.
-#endif
-
-#define XNAMATH_VERSION 203
-
-#if !defined(_XM_X64_) && !defined(_XM_X86_)
-#if defined(_M_AMD64) || defined(_AMD64_)
-#define _XM_X64_
-#elif defined(_M_IX86) || defined(_X86_)
-#define _XM_X86_
-#endif
-#endif
-
-#if !defined(_XM_BIGENDIAN_) && !defined(_XM_LITTLEENDIAN_)
-#if defined(_XM_X64_) || defined(_XM_X86_)
-#define _XM_LITTLEENDIAN_
-#elif defined(_XBOX_VER)
-#define _XM_BIGENDIAN_
-#else
-#error xnamath.h only supports x86, x64, or XBox 360 targets
-#endif
-#endif
-
-#if defined(_XM_X86_) || defined(_XM_X64_)
-#define _XM_SSE_INTRINSICS_
-#if !defined(__cplusplus) && !defined(_XM_NO_INTRINSICS_)
-#error xnamath.h only supports C compliation for Xbox 360 targets and no intrinsics cases for x86/x64
-#endif
-#elif defined(_XBOX_VER)
-#if !defined(__VMX128_SUPPORTED) && !defined(_XM_NO_INTRINSICS_)
-#error xnamath.h requires VMX128 compiler support for XBOX 360
-#endif // !__VMX128_SUPPORTED && !_XM_NO_INTRINSICS_
-#define _XM_VMX128_INTRINSICS_
-#else
-#error xnamath.h only supports x86, x64, or XBox 360 targets
-#endif
-
-
-#if defined(_XM_SSE_INTRINSICS_)
-#ifndef _XM_NO_INTRINSICS_
-#include <xmmintrin.h>
-#include <emmintrin.h>
-#endif
-#elif defined(_XM_VMX128_INTRINSICS_)
-#error This version of xnamath.h is for Windows use only
-#endif
-
-#if defined(_XM_SSE_INTRINSICS_)
-#pragma warning(push)
-#pragma warning(disable:4985)
-#endif
-#include <math.h>
-#if defined(_XM_SSE_INTRINSICS_)
-#pragma warning(pop)
-#endif
-
-#include <sal.h>
-
-#if !defined(XMINLINE)
-#if !defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#define XMINLINE __inline
-#else
-#define XMINLINE __forceinline
-#endif
-#endif
-
-#if !defined(XMFINLINE)
-#define XMFINLINE __forceinline
-#endif
-
-#if !defined(XMDEBUG)
-#if defined(_DEBUG)
-#define XMDEBUG
-#endif
-#endif // !XMDEBUG
-
-#if !defined(XMASSERT)
-#if defined(_PREFAST_)
-#define XMASSERT(Expression) __analysis_assume((Expression))
-#elif defined(XMDEBUG) // !_PREFAST_
-#define XMASSERT(Expression) ((VOID)((Expression) || (XMAssert(#Expression, __FILE__, __LINE__), 0)))
-#else // !XMDEBUG
-#define XMASSERT(Expression) ((VOID)0)
-#endif // !XMDEBUG
-#endif // !XMASSERT
-
-#if !defined(XM_NO_ALIGNMENT)
-#define _DECLSPEC_ALIGN_16_ __declspec(align(16))
-#else
-#define _DECLSPEC_ALIGN_16_
-#endif
-
-
-#if defined(_MSC_VER) && (_MSC_VER<1500) && (_MSC_VER>=1400)
-#define _XM_ISVS2005_
-#endif
-
-/****************************************************************************
- *
- * Constant definitions
- *
- ****************************************************************************/
-
-#define XM_PI 3.141592654f
-#define XM_2PI 6.283185307f
-#define XM_1DIVPI 0.318309886f
-#define XM_1DIV2PI 0.159154943f
-#define XM_PIDIV2 1.570796327f
-#define XM_PIDIV4 0.785398163f
-
-#define XM_SELECT_0 0x00000000
-#define XM_SELECT_1 0xFFFFFFFF
-
-#define XM_PERMUTE_0X 0x00010203
-#define XM_PERMUTE_0Y 0x04050607
-#define XM_PERMUTE_0Z 0x08090A0B
-#define XM_PERMUTE_0W 0x0C0D0E0F
-#define XM_PERMUTE_1X 0x10111213
-#define XM_PERMUTE_1Y 0x14151617
-#define XM_PERMUTE_1Z 0x18191A1B
-#define XM_PERMUTE_1W 0x1C1D1E1F
-
-#define XM_CRMASK_CR6 0x000000F0
-#define XM_CRMASK_CR6TRUE 0x00000080
-#define XM_CRMASK_CR6FALSE 0x00000020
-#define XM_CRMASK_CR6BOUNDS XM_CRMASK_CR6FALSE
-
-#define XM_CACHE_LINE_SIZE 64
-
-/****************************************************************************
- *
- * Macros
- *
- ****************************************************************************/
-
-// Unit conversion
-
-XMFINLINE FLOAT XMConvertToRadians(FLOAT fDegrees) { return fDegrees * (XM_PI / 180.0f); }
-XMFINLINE FLOAT XMConvertToDegrees(FLOAT fRadians) { return fRadians * (180.0f / XM_PI); }
-
-// Condition register evaluation proceeding a recording (Rc) comparison
-
-#define XMComparisonAllTrue(CR) (((CR) & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE)
-#define XMComparisonAnyTrue(CR) (((CR) & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE)
-#define XMComparisonAllFalse(CR) (((CR) & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE)
-#define XMComparisonAnyFalse(CR) (((CR) & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE)
-#define XMComparisonMixed(CR) (((CR) & XM_CRMASK_CR6) == 0)
-#define XMComparisonAllInBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS)
-#define XMComparisonAnyOutOfBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS)
-
-
-#define XMMin(a, b) (((a) < (b)) ? (a) : (b))
-#define XMMax(a, b) (((a) > (b)) ? (a) : (b))
-
-/****************************************************************************
- *
- * Data types
- *
- ****************************************************************************/
-
-#pragma warning(push)
-#pragma warning(disable:4201 4365 4324)
-
-#if !defined (_XM_X86_) && !defined(_XM_X64_)
-#pragma bitfield_order(push)
-#pragma bitfield_order(lsb_to_msb)
-#endif // !_XM_X86_ && !_XM_X64_
-
-#if defined(_XM_NO_INTRINSICS_) && !defined(_XBOX_VER)
-// The __vector4 structure is an intrinsic on Xbox but must be separately defined
-// for x86/x64
-typedef struct __vector4
-{
- union
- {
- float vector4_f32[4];
- unsigned int vector4_u32[4];
-#ifndef XM_STRICT_VECTOR4
- struct
- {
- FLOAT x;
- FLOAT y;
- FLOAT z;
- FLOAT w;
- };
- FLOAT v[4];
- UINT u[4];
-#endif // !XM_STRICT_VECTOR4
- };
-} __vector4;
-#endif // _XM_NO_INTRINSICS_
-
-#if (defined (_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_)
-typedef UINT __vector4i[4];
-#else
-typedef __declspec(align(16)) UINT __vector4i[4];
-#endif
-
-// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte
-// boundary and mapped to hardware vector registers
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
-typedef __m128 XMVECTOR;
-#else
-typedef __vector4 XMVECTOR;
-#endif
-
-// Conversion types for constants
-typedef _DECLSPEC_ALIGN_16_ struct XMVECTORF32 {
- union {
- float f[4];
- XMVECTOR v;
- };
-
-#if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
-#endif
-#endif // __cplusplus
-} XMVECTORF32;
-
-typedef _DECLSPEC_ALIGN_16_ struct XMVECTORI32 {
- union {
- INT i[4];
- XMVECTOR v;
- };
-#if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
-#endif
-#endif // __cplusplus
-} XMVECTORI32;
-
-typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU8 {
- union {
- BYTE u[16];
- XMVECTOR v;
- };
-#if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
-#endif
-#endif // __cplusplus
-} XMVECTORU8;
-
-typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU32 {
- union {
- UINT u[4];
- XMVECTOR v;
- };
-#if defined(__cplusplus)
- inline operator XMVECTOR() const { return v; }
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_)
- inline operator __m128i() const { return reinterpret_cast<const __m128i *>(&v)[0]; }
- inline operator __m128d() const { return reinterpret_cast<const __m128d *>(&v)[0]; }
-#endif
-#endif // __cplusplus
-} XMVECTORU32;
-
-// Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86 and Xbox 360, but not for other targets
-#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
-typedef const XMVECTOR FXMVECTOR;
-#elif defined(_XM_X86_) && !defined(_XM_NO_INTRINSICS_)
-typedef const XMVECTOR FXMVECTOR;
-#elif defined(__cplusplus)
-typedef const XMVECTOR& FXMVECTOR;
-#else
-typedef const XMVECTOR FXMVECTOR;
-#endif
-
-// Fix-up for (4th+) XMVECTOR parameters to pass in-register for Xbox 360 and by reference otherwise
-#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
-typedef const XMVECTOR CXMVECTOR;
-#elif defined(__cplusplus)
-typedef const XMVECTOR& CXMVECTOR;
-#else
-typedef const XMVECTOR CXMVECTOR;
-#endif
-
-// Vector operators
-#if defined(__cplusplus) && !defined(XM_NO_OPERATOR_OVERLOADS)
-
-XMVECTOR operator+ (FXMVECTOR V);
-XMVECTOR operator- (FXMVECTOR V);
-
-XMVECTOR& operator+= (XMVECTOR& V1, FXMVECTOR V2);
-XMVECTOR& operator-= (XMVECTOR& V1, FXMVECTOR V2);
-XMVECTOR& operator*= (XMVECTOR& V1, FXMVECTOR V2);
-XMVECTOR& operator/= (XMVECTOR& V1, FXMVECTOR V2);
-XMVECTOR& operator*= (XMVECTOR& V, FLOAT S);
-XMVECTOR& operator/= (XMVECTOR& V, FLOAT S);
-
-XMVECTOR operator+ (FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR operator- (FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR operator* (FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR operator/ (FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR operator* (FXMVECTOR V, FLOAT S);
-XMVECTOR operator* (FLOAT S, FXMVECTOR V);
-XMVECTOR operator/ (FXMVECTOR V, FLOAT S);
-
-#endif // __cplusplus && !XM_NO_OPERATOR_OVERLOADS
-
-// Matrix type: Sixteen 32 bit floating point components aligned on a
-// 16 byte boundary and mapped to four hardware vector registers
-#if (defined(_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_)
-typedef struct _XMMATRIX
-#else
-typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX
-#endif
-{
- union
- {
- XMVECTOR r[4];
- struct
- {
- FLOAT _11, _12, _13, _14;
- FLOAT _21, _22, _23, _24;
- FLOAT _31, _32, _33, _34;
- FLOAT _41, _42, _43, _44;
- };
- FLOAT m[4][4];
- };
-
-#ifdef __cplusplus
-
- _XMMATRIX() {};
- _XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, CXMVECTOR R3);
- _XMMATRIX(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
- _XMMATRIX(CONST FLOAT *pArray);
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- _XMMATRIX& operator= (CONST _XMMATRIX& M);
-
-#ifndef XM_NO_OPERATOR_OVERLOADS
- _XMMATRIX& operator*= (CONST _XMMATRIX& M);
- _XMMATRIX operator* (CONST _XMMATRIX& M) CONST;
-#endif // !XM_NO_OPERATOR_OVERLOADS
-
-#endif // __cplusplus
-
-} XMMATRIX;
-
-// Fix-up for XMMATRIX parameters to pass in-register on Xbox 360, by reference otherwise
-#if defined(_XM_VMX128_INTRINSICS_)
-typedef const XMMATRIX CXMMATRIX;
-#elif defined(__cplusplus)
-typedef const XMMATRIX& CXMMATRIX;
-#else
-typedef const XMMATRIX CXMMATRIX;
-#endif
-
-// 16 bit floating point number consisting of a sign bit, a 5 bit biased
-// exponent, and a 10 bit mantissa
-//typedef WORD HALF;
-typedef USHORT HALF;
-
-// 2D Vector; 32 bit floating point components
-typedef struct _XMFLOAT2
-{
- FLOAT x;
- FLOAT y;
-
-#ifdef __cplusplus
-
- _XMFLOAT2() {};
- _XMFLOAT2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {};
- _XMFLOAT2(CONST FLOAT *pArray);
-
- _XMFLOAT2& operator= (CONST _XMFLOAT2& Float2);
-
-#endif // __cplusplus
-
-} XMFLOAT2;
-
-// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary
-#ifdef __cplusplus
-__declspec(align(16)) struct XMFLOAT2A : public XMFLOAT2
-{
- XMFLOAT2A() : XMFLOAT2() {};
- XMFLOAT2A(FLOAT _x, FLOAT _y) : XMFLOAT2(_x, _y) {};
- XMFLOAT2A(CONST FLOAT *pArray) : XMFLOAT2(pArray) {};
-
- XMFLOAT2A& operator= (CONST XMFLOAT2A& Float2);
-};
-#else
-typedef __declspec(align(16)) XMFLOAT2 XMFLOAT2A;
-#endif // __cplusplus
-
-// 2D Vector; 16 bit floating point components
-typedef struct _XMHALF2
-{
- HALF x;
- HALF y;
-
-#ifdef __cplusplus
-
- _XMHALF2() {};
- _XMHALF2(HALF _x, HALF _y) : x(_x), y(_y) {};
- _XMHALF2(CONST HALF *pArray);
- _XMHALF2(FLOAT _x, FLOAT _y);
- _XMHALF2(CONST FLOAT *pArray);
-
- _XMHALF2& operator= (CONST _XMHALF2& Half2);
-
-#endif // __cplusplus
-
-} XMHALF2;
-
-// 2D Vector; 16 bit signed normalized integer components
-typedef struct _XMSHORTN2
-{
- SHORT x;
- SHORT y;
-
-#ifdef __cplusplus
-
- _XMSHORTN2() {};
- _XMSHORTN2(SHORT _x, SHORT _y) : x(_x), y(_y) {};
- _XMSHORTN2(CONST SHORT *pArray);
- _XMSHORTN2(FLOAT _x, FLOAT _y);
- _XMSHORTN2(CONST FLOAT *pArray);
-
- _XMSHORTN2& operator= (CONST _XMSHORTN2& ShortN2);
-
-#endif // __cplusplus
-
-} XMSHORTN2;
-
-// 2D Vector; 16 bit signed integer components
-typedef struct _XMSHORT2
-{
- SHORT x;
- SHORT y;
-
-#ifdef __cplusplus
-
- _XMSHORT2() {};
- _XMSHORT2(SHORT _x, SHORT _y) : x(_x), y(_y) {};
- _XMSHORT2(CONST SHORT *pArray);
- _XMSHORT2(FLOAT _x, FLOAT _y);
- _XMSHORT2(CONST FLOAT *pArray);
-
- _XMSHORT2& operator= (CONST _XMSHORT2& Short2);
-
-#endif // __cplusplus
-
-} XMSHORT2;
-
-// 2D Vector; 16 bit unsigned normalized integer components
-typedef struct _XMUSHORTN2
-{
- USHORT x;
- USHORT y;
-
-#ifdef __cplusplus
-
- _XMUSHORTN2() {};
- _XMUSHORTN2(USHORT _x, USHORT _y) : x(_x), y(_y) {};
- _XMUSHORTN2(CONST USHORT *pArray);
- _XMUSHORTN2(FLOAT _x, FLOAT _y);
- _XMUSHORTN2(CONST FLOAT *pArray);
-
- _XMUSHORTN2& operator= (CONST _XMUSHORTN2& UShortN2);
-
-#endif // __cplusplus
-
-} XMUSHORTN2;
-
-// 2D Vector; 16 bit unsigned integer components
-typedef struct _XMUSHORT2
-{
- USHORT x;
- USHORT y;
-
-#ifdef __cplusplus
-
- _XMUSHORT2() {};
- _XMUSHORT2(USHORT _x, USHORT _y) : x(_x), y(_y) {};
- _XMUSHORT2(CONST USHORT *pArray);
- _XMUSHORT2(FLOAT _x, FLOAT _y);
- _XMUSHORT2(CONST FLOAT *pArray);
-
- _XMUSHORT2& operator= (CONST _XMUSHORT2& UShort2);
-
-#endif // __cplusplus
-
-} XMUSHORT2;
-
-// 3D Vector; 32 bit floating point components
-typedef struct _XMFLOAT3
-{
- FLOAT x;
- FLOAT y;
- FLOAT z;
-
-#ifdef __cplusplus
-
- _XMFLOAT3() {};
- _XMFLOAT3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {};
- _XMFLOAT3(CONST FLOAT *pArray);
-
- _XMFLOAT3& operator= (CONST _XMFLOAT3& Float3);
-
-#endif // __cplusplus
-
-} XMFLOAT3;
-
-// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary
-#ifdef __cplusplus
-__declspec(align(16)) struct XMFLOAT3A : public XMFLOAT3
-{
- XMFLOAT3A() : XMFLOAT3() {};
- XMFLOAT3A(FLOAT _x, FLOAT _y, FLOAT _z) : XMFLOAT3(_x, _y, _z) {};
- XMFLOAT3A(CONST FLOAT *pArray) : XMFLOAT3(pArray) {};
-
- XMFLOAT3A& operator= (CONST XMFLOAT3A& Float3);
-};
-#else
-typedef __declspec(align(16)) XMFLOAT3 XMFLOAT3A;
-#endif // __cplusplus
-
-// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer
-// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed,
-// normalized integer for the z component and 11 bit signed, normalized
-// integers for the x and y components. The z component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
-typedef struct _XMHENDN3
-{
- union
- {
- struct
- {
- INT x : 11; // -1023/1023 to 1023/1023
- INT y : 11; // -1023/1023 to 1023/1023
- INT z : 10; // -511/511 to 511/511
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMHENDN3() {};
- _XMHENDN3(UINT Packed) : v(Packed) {};
- _XMHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMHENDN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMHENDN3& operator= (CONST _XMHENDN3& HenDN3);
- _XMHENDN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMHENDN3;
-
-// 3D Vector; 11-11-10 bit components packed into a 32 bit integer
-// The 3D Vector is packed into 32 bits as follows: a 10 bit signed,
-// integer for the z component and 11 bit signed integers for the
-// x and y components. The z component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
-typedef struct _XMHEND3
-{
- union
- {
- struct
- {
- INT x : 11; // -1023 to 1023
- INT y : 11; // -1023 to 1023
- INT z : 10; // -511 to 511
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMHEND3() {};
- _XMHEND3(UINT Packed) : v(Packed) {};
- _XMHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMHEND3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMHEND3& operator= (CONST _XMHEND3& HenD3);
- _XMHEND3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMHEND3;
-
-// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer
-// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
-// normalized integer for the z component and 11 bit unsigned, normalized
-// integers for the x and y components. The z component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
-typedef struct _XMUHENDN3
-{
- union
- {
- struct
- {
- UINT x : 11; // 0/2047 to 2047/2047
- UINT y : 11; // 0/2047 to 2047/2047
- UINT z : 10; // 0/1023 to 1023/1023
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUHENDN3() {};
- _XMUHENDN3(UINT Packed) : v(Packed) {};
- _XMUHENDN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUHENDN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUHENDN3& operator= (CONST _XMUHENDN3& UHenDN3);
- _XMUHENDN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUHENDN3;
-
-// 3D Vector; 11-11-10 bit components packed into a 32 bit integer
-// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned
-// integer for the z component and 11 bit unsigned integers
-// for the x and y components. The z component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0]
-typedef struct _XMUHEND3
-{
- union
- {
- struct
- {
- UINT x : 11; // 0 to 2047
- UINT y : 11; // 0 to 2047
- UINT z : 10; // 0 to 1023
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUHEND3() {};
- _XMUHEND3(UINT Packed) : v(Packed) {};
- _XMUHEND3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUHEND3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUHEND3& operator= (CONST _XMUHEND3& UHenD3);
- _XMUHEND3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUHEND3;
-
-// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer
-// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed,
-// normalized integer for the x component and 11 bit signed, normalized
-// integers for the y and z components. The z component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMDHENN3
-{
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 11; // -1023/1023 to 1023/1023
- INT z : 11; // -1023/1023 to 1023/1023
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMDHENN3() {};
- _XMDHENN3(UINT Packed) : v(Packed) {};
- _XMDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMDHENN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMDHENN3& operator= (CONST _XMDHENN3& DHenN3);
- _XMDHENN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMDHENN3;
-
-// 3D Vector; 10-11-11 bit components packed into a 32 bit integer
-// The 3D Vector is packed into 32 bits as follows: a 10 bit signed,
-// integer for the x component and 11 bit signed integers for the
-// y and z components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMDHEN3
-{
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 11; // -1023 to 1023
- INT z : 11; // -1023 to 1023
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMDHEN3() {};
- _XMDHEN3(UINT Packed) : v(Packed) {};
- _XMDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMDHEN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMDHEN3& operator= (CONST _XMDHEN3& DHen3);
- _XMDHEN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMDHEN3;
-
-// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer
-// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
-// normalized integer for the x component and 11 bit unsigned, normalized
-// integers for the y and z components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMUDHENN3
-{
- union
- {
- struct
- {
- UINT x : 10; // 0/1023 to 1023/1023
- UINT y : 11; // 0/2047 to 2047/2047
- UINT z : 11; // 0/2047 to 2047/2047
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUDHENN3() {};
- _XMUDHENN3(UINT Packed) : v(Packed) {};
- _XMUDHENN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUDHENN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUDHENN3& operator= (CONST _XMUDHENN3& UDHenN3);
- _XMUDHENN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUDHENN3;
-
-// 3D Vector; 10-11-11 bit components packed into a 32 bit integer
-// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned,
-// integer for the x component and 11 bit unsigned integers
-// for the y and z components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMUDHEN3
-{
- union
- {
- struct
- {
- UINT x : 10; // 0 to 1023
- UINT y : 11; // 0 to 2047
- UINT z : 11; // 0 to 2047
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUDHEN3() {};
- _XMUDHEN3(UINT Packed) : v(Packed) {};
- _XMUDHEN3(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMUDHEN3(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUDHEN3& operator= (CONST _XMUDHEN3& UDHen3);
- _XMUDHEN3& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUDHEN3;
-
-// 3D vector: 5/6/5 unsigned integer components
-typedef struct _XMU565
-{
- union
- {
- struct
- {
- USHORT x : 5;
- USHORT y : 6;
- USHORT z : 5;
- };
- USHORT v;
- };
-
-#ifdef __cplusplus
-
- _XMU565() {};
- _XMU565(USHORT Packed) : v(Packed) {};
- _XMU565(CHAR _x, CHAR _y, CHAR _z) : x(_x), y(_y), z(_z) {};
- _XMU565(CONST CHAR *pArray);
- _XMU565(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMU565(CONST FLOAT *pArray);
-
- operator USHORT () { return v; }
-
- _XMU565& operator= (CONST _XMU565& U565);
- _XMU565& operator= (CONST USHORT Packed);
-
-#endif // __cplusplus
-
-} XMU565;
-
-// 3D vector: 11/11/10 floating-point components
-// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
-// and 6-bit mantissa for x component, a 5-bit biased exponent and
-// 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit
-// mantissa for z. The z component is stored in the most significant bits
-// and the x component in the least significant bits. No sign bits so
-// all partial-precision numbers are positive.
-// (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0]
-typedef struct _XMFLOAT3PK
-{
- union
- {
- struct
- {
- UINT xm : 6;
- UINT xe : 5;
- UINT ym : 6;
- UINT ye : 5;
- UINT zm : 5;
- UINT ze : 5;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMFLOAT3PK() {};
- _XMFLOAT3PK(UINT Packed) : v(Packed) {};
- _XMFLOAT3PK(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMFLOAT3PK(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMFLOAT3PK& operator= (CONST _XMFLOAT3PK& float3pk);
- _XMFLOAT3PK& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMFLOAT3PK;
-
-// 3D vector: 9/9/9 floating-point components with shared 5-bit exponent
-// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent
-// with 9-bit mantissa for the x, y, and z component. The shared exponent
-// is stored in the most significant bits and the x component mantissa is in
-// the least significant bits. No sign bits so all partial-precision numbers
-// are positive.
-// (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0]
-typedef struct _XMFLOAT3SE
-{
- union
- {
- struct
- {
- UINT xm : 9;
- UINT ym : 9;
- UINT zm : 9;
- UINT e : 5;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMFLOAT3SE() {};
- _XMFLOAT3SE(UINT Packed) : v(Packed) {};
- _XMFLOAT3SE(FLOAT _x, FLOAT _y, FLOAT _z);
- _XMFLOAT3SE(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMFLOAT3SE& operator= (CONST _XMFLOAT3SE& float3se);
- _XMFLOAT3SE& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMFLOAT3SE;
-
-// 4D Vector; 32 bit floating point components
-typedef struct _XMFLOAT4
-{
- FLOAT x;
- FLOAT y;
- FLOAT z;
- FLOAT w;
-
-#ifdef __cplusplus
-
- _XMFLOAT4() {};
- _XMFLOAT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMFLOAT4(CONST FLOAT *pArray);
-
- _XMFLOAT4& operator= (CONST _XMFLOAT4& Float4);
-
-#endif // __cplusplus
-
-} XMFLOAT4;
-
-// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary
-#ifdef __cplusplus
-__declspec(align(16)) struct XMFLOAT4A : public XMFLOAT4
-{
- XMFLOAT4A() : XMFLOAT4() {};
- XMFLOAT4A(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : XMFLOAT4(_x, _y, _z, _w) {};
- XMFLOAT4A(CONST FLOAT *pArray) : XMFLOAT4(pArray) {};
-
- XMFLOAT4A& operator= (CONST XMFLOAT4A& Float4);
-};
-#else
-typedef __declspec(align(16)) XMFLOAT4 XMFLOAT4A;
-#endif // __cplusplus
-
-// 4D Vector; 16 bit floating point components
-typedef struct _XMHALF4
-{
- HALF x;
- HALF y;
- HALF z;
- HALF w;
-
-#ifdef __cplusplus
-
- _XMHALF4() {};
- _XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMHALF4(CONST HALF *pArray);
- _XMHALF4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMHALF4(CONST FLOAT *pArray);
-
- _XMHALF4& operator= (CONST _XMHALF4& Half4);
-
-#endif // __cplusplus
-
-} XMHALF4;
-
-// 4D Vector; 16 bit signed normalized integer components
-typedef struct _XMSHORTN4
-{
- SHORT x;
- SHORT y;
- SHORT z;
- SHORT w;
-
-#ifdef __cplusplus
-
- _XMSHORTN4() {};
- _XMSHORTN4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMSHORTN4(CONST SHORT *pArray);
- _XMSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMSHORTN4(CONST FLOAT *pArray);
-
- _XMSHORTN4& operator= (CONST _XMSHORTN4& ShortN4);
-
-#endif // __cplusplus
-
-} XMSHORTN4;
-
-// 4D Vector; 16 bit signed integer components
-typedef struct _XMSHORT4
-{
- SHORT x;
- SHORT y;
- SHORT z;
- SHORT w;
-
-#ifdef __cplusplus
-
- _XMSHORT4() {};
- _XMSHORT4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMSHORT4(CONST SHORT *pArray);
- _XMSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMSHORT4(CONST FLOAT *pArray);
-
- _XMSHORT4& operator= (CONST _XMSHORT4& Short4);
-
-#endif // __cplusplus
-
-} XMSHORT4;
-
-// 4D Vector; 16 bit unsigned normalized integer components
-typedef struct _XMUSHORTN4
-{
- USHORT x;
- USHORT y;
- USHORT z;
- USHORT w;
-
-#ifdef __cplusplus
-
- _XMUSHORTN4() {};
- _XMUSHORTN4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUSHORTN4(CONST USHORT *pArray);
- _XMUSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUSHORTN4(CONST FLOAT *pArray);
-
- _XMUSHORTN4& operator= (CONST _XMUSHORTN4& UShortN4);
-
-#endif // __cplusplus
-
-} XMUSHORTN4;
-
-// 4D Vector; 16 bit unsigned integer components
-typedef struct _XMUSHORT4
-{
- USHORT x;
- USHORT y;
- USHORT z;
- USHORT w;
-
-#ifdef __cplusplus
-
- _XMUSHORT4() {};
- _XMUSHORT4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUSHORT4(CONST USHORT *pArray);
- _XMUSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUSHORT4(CONST FLOAT *pArray);
-
- _XMUSHORT4& operator= (CONST _XMUSHORT4& UShort4);
-
-#endif // __cplusplus
-
-} XMUSHORT4;
-
-// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
-// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
-// normalized integer for the w component and 10 bit signed, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMXDECN4
-{
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 10; // -511/511 to 511/511
- INT z : 10; // -511/511 to 511/511
- UINT w : 2; // 0/3 to 3/3
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMXDECN4() {};
- _XMXDECN4(UINT Packed) : v(Packed) {};
- _XMXDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXDECN4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMXDECN4& operator= (CONST _XMXDECN4& XDecN4);
- _XMXDECN4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMXDECN4;
-
-// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
-// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned
-// integer for the w component and 10 bit signed integers for the
-// z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMXDEC4
-{
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 10; // -511 to 511
- INT z : 10; // -511 to 511
- UINT w : 2; // 0 to 3
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMXDEC4() {};
- _XMXDEC4(UINT Packed) : v(Packed) {};
- _XMXDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXDEC4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMXDEC4& operator= (CONST _XMXDEC4& XDec4);
- _XMXDEC4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMXDEC4;
-
-// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
-// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed,
-// normalized integer for the w component and 10 bit signed, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMDECN4
-{
- union
- {
- struct
- {
- INT x : 10; // -511/511 to 511/511
- INT y : 10; // -511/511 to 511/511
- INT z : 10; // -511/511 to 511/511
- INT w : 2; // -1/1 to 1/1
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMDECN4() {};
- _XMDECN4(UINT Packed) : v(Packed) {};
- _XMDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMDECN4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMDECN4& operator= (CONST _XMDECN4& DecN4);
- _XMDECN4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMDECN4;
-
-// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
-// The 4D Vector is packed into 32 bits as follows: a 2 bit signed,
-// integer for the w component and 10 bit signed integers for the
-// z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMDEC4
-{
- union
- {
- struct
- {
- INT x : 10; // -511 to 511
- INT y : 10; // -511 to 511
- INT z : 10; // -511 to 511
- INT w : 2; // -1 to 1
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMDEC4() {};
- _XMDEC4(UINT Packed) : v(Packed) {};
- _XMDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMDEC4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMDEC4& operator= (CONST _XMDEC4& Dec4);
- _XMDEC4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMDEC4;
-
-// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer
-// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
-// normalized integer for the w component and 10 bit unsigned, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMUDECN4
-{
- union
- {
- struct
- {
- UINT x : 10; // 0/1023 to 1023/1023
- UINT y : 10; // 0/1023 to 1023/1023
- UINT z : 10; // 0/1023 to 1023/1023
- UINT w : 2; // 0/3 to 3/3
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUDECN4() {};
- _XMUDECN4(UINT Packed) : v(Packed) {};
- _XMUDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUDECN4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUDECN4& operator= (CONST _XMUDECN4& UDecN4);
- _XMUDECN4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUDECN4;
-
-// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer
-// The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned,
-// integer for the w component and 10 bit unsigned integers
-// for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0]
-typedef struct _XMUDEC4
-{
- union
- {
- struct
- {
- UINT x : 10; // 0 to 1023
- UINT y : 10; // 0 to 1023
- UINT z : 10; // 0 to 1023
- UINT w : 2; // 0 to 3
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUDEC4() {};
- _XMUDEC4(UINT Packed) : v(Packed) {};
- _XMUDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUDEC4(CONST FLOAT *pArray);
-
- operator UINT () { return v; }
-
- _XMUDEC4& operator= (CONST _XMUDEC4& UDec4);
- _XMUDEC4& operator= (CONST UINT Packed);
-
-#endif // __cplusplus
-
-} XMUDEC4;
-
-// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
-// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned,
-// normalized integer for the w component and 20 bit signed, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMXICON4
-{
- union
- {
- struct
- {
- INT64 x : 20; // -524287/524287 to 524287/524287
- INT64 y : 20; // -524287/524287 to 524287/524287
- INT64 z : 20; // -524287/524287 to 524287/524287
- UINT64 w : 4; // 0/15 to 15/15
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMXICON4() {};
- _XMXICON4(UINT64 Packed) : v(Packed) {};
- _XMXICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXICON4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMXICON4& operator= (CONST _XMXICON4& XIcoN4);
- _XMXICON4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMXICON4;
-
-// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
-// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned
-// integer for the w component and 20 bit signed integers for the
-// z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMXICO4
-{
- union
- {
- struct
- {
- INT64 x : 20; // -524287 to 524287
- INT64 y : 20; // -524287 to 524287
- INT64 z : 20; // -524287 to 524287
- UINT64 w : 4; // 0 to 15
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMXICO4() {};
- _XMXICO4(UINT64 Packed) : v(Packed) {};
- _XMXICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMXICO4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMXICO4& operator= (CONST _XMXICO4& XIco4);
- _XMXICO4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMXICO4;
-
-// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
-// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit signed,
-// normalized integer for the w component and 20 bit signed, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMICON4
-{
- union
- {
- struct
- {
- INT64 x : 20; // -524287/524287 to 524287/524287
- INT64 y : 20; // -524287/524287 to 524287/524287
- INT64 z : 20; // -524287/524287 to 524287/524287
- INT64 w : 4; // -7/7 to 7/7
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMICON4() {};
- _XMICON4(UINT64 Packed) : v(Packed) {};
- _XMICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMICON4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMICON4& operator= (CONST _XMICON4& IcoN4);
- _XMICON4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMICON4;
-
-// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
-// The 4D Vector is packed into 64 bits as follows: a 4 bit signed,
-// integer for the w component and 20 bit signed integers for the
-// z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMICO4
-{
- union
- {
- struct
- {
- INT64 x : 20; // -524287 to 524287
- INT64 y : 20; // -524287 to 524287
- INT64 z : 20; // -524287 to 524287
- INT64 w : 4; // -7 to 7
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMICO4() {};
- _XMICO4(UINT64 Packed) : v(Packed) {};
- _XMICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMICO4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMICO4& operator= (CONST _XMICO4& Ico4);
- _XMICO4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMICO4;
-
-// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer
-// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned,
-// normalized integer for the w component and 20 bit unsigned, normalized
-// integers for the z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMUICON4
-{
- union
- {
- struct
- {
- UINT64 x : 20; // 0/1048575 to 1048575/1048575
- UINT64 y : 20; // 0/1048575 to 1048575/1048575
- UINT64 z : 20; // 0/1048575 to 1048575/1048575
- UINT64 w : 4; // 0/15 to 15/15
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMUICON4() {};
- _XMUICON4(UINT64 Packed) : v(Packed) {};
- _XMUICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUICON4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMUICON4& operator= (CONST _XMUICON4& UIcoN4);
- _XMUICON4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMUICON4;
-
-// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer
-// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned
-// integer for the w component and 20 bit unsigned integers for the
-// z, y, and x components. The w component is stored in the
-// most significant bits and the x component in the least significant bits
-// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0]
-typedef struct _XMUICO4
-{
- union
- {
- struct
- {
- UINT64 x : 20; // 0 to 1048575
- UINT64 y : 20; // 0 to 1048575
- UINT64 z : 20; // 0 to 1048575
- UINT64 w : 4; // 0 to 15
- };
- UINT64 v;
- };
-
-#ifdef __cplusplus
-
- _XMUICO4() {};
- _XMUICO4(UINT64 Packed) : v(Packed) {};
- _XMUICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUICO4(CONST FLOAT *pArray);
-
- operator UINT64 () { return v; }
-
- _XMUICO4& operator= (CONST _XMUICO4& UIco4);
- _XMUICO4& operator= (CONST UINT64 Packed);
-
-#endif // __cplusplus
-
-} XMUICO4;
-
-// ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into
-// a 32 bit integer. The normalized color is packed into 32 bits using 8 bit
-// unsigned, normalized integers for the alpha, red, green, and blue components.
-// The alpha component is stored in the most significant bits and the blue
-// component in the least significant bits (A8R8G8B8):
-// [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0]
-typedef struct _XMCOLOR
-{
- union
- {
- struct
- {
- UINT b : 8; // Blue: 0/255 to 255/255
- UINT g : 8; // Green: 0/255 to 255/255
- UINT r : 8; // Red: 0/255 to 255/255
- UINT a : 8; // Alpha: 0/255 to 255/255
- };
- UINT c;
- };
-
-#ifdef __cplusplus
-
- _XMCOLOR() {};
- _XMCOLOR(UINT Color) : c(Color) {};
- _XMCOLOR(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a);
- _XMCOLOR(CONST FLOAT *pArray);
-
- operator UINT () { return c; }
-
- _XMCOLOR& operator= (CONST _XMCOLOR& Color);
- _XMCOLOR& operator= (CONST UINT Color);
-
-#endif // __cplusplus
-
-} XMCOLOR;
-
-// 4D Vector; 8 bit signed normalized integer components
-typedef struct _XMBYTEN4
-{
- union
- {
- struct
- {
- CHAR x;
- CHAR y;
- CHAR z;
- CHAR w;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMBYTEN4() {};
- _XMBYTEN4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMBYTEN4(UINT Packed) : v(Packed) {};
- _XMBYTEN4(CONST CHAR *pArray);
- _XMBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMBYTEN4(CONST FLOAT *pArray);
-
- _XMBYTEN4& operator= (CONST _XMBYTEN4& ByteN4);
-
-#endif // __cplusplus
-
-} XMBYTEN4;
-
-// 4D Vector; 8 bit signed integer components
-typedef struct _XMBYTE4
-{
- union
- {
- struct
- {
- CHAR x;
- CHAR y;
- CHAR z;
- CHAR w;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMBYTE4() {};
- _XMBYTE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMBYTE4(UINT Packed) : v(Packed) {};
- _XMBYTE4(CONST CHAR *pArray);
- _XMBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMBYTE4(CONST FLOAT *pArray);
-
- _XMBYTE4& operator= (CONST _XMBYTE4& Byte4);
-
-#endif // __cplusplus
-
-} XMBYTE4;
-
-// 4D Vector; 8 bit unsigned normalized integer components
-typedef struct _XMUBYTEN4
-{
- union
- {
- struct
- {
- BYTE x;
- BYTE y;
- BYTE z;
- BYTE w;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUBYTEN4() {};
- _XMUBYTEN4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUBYTEN4(UINT Packed) : v(Packed) {};
- _XMUBYTEN4(CONST BYTE *pArray);
- _XMUBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUBYTEN4(CONST FLOAT *pArray);
-
- _XMUBYTEN4& operator= (CONST _XMUBYTEN4& UByteN4);
-
-#endif // __cplusplus
-
-} XMUBYTEN4;
-
-// 4D Vector; 8 bit unsigned integer components
-typedef struct _XMUBYTE4
-{
- union
- {
- struct
- {
- BYTE x;
- BYTE y;
- BYTE z;
- BYTE w;
- };
- UINT v;
- };
-
-#ifdef __cplusplus
-
- _XMUBYTE4() {};
- _XMUBYTE4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUBYTE4(UINT Packed) : v(Packed) {};
- _XMUBYTE4(CONST BYTE *pArray);
- _XMUBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUBYTE4(CONST FLOAT *pArray);
-
- _XMUBYTE4& operator= (CONST _XMUBYTE4& UByte4);
-
-#endif // __cplusplus
-
-} XMUBYTE4;
-
-// 4D vector; 4 bit unsigned integer components
-typedef struct _XMUNIBBLE4
-{
- union
- {
- struct
- {
- USHORT x : 4;
- USHORT y : 4;
- USHORT z : 4;
- USHORT w : 4;
- };
- USHORT v;
- };
-
-#ifdef __cplusplus
-
- _XMUNIBBLE4() {};
- _XMUNIBBLE4(USHORT Packed) : v(Packed) {};
- _XMUNIBBLE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {};
- _XMUNIBBLE4(CONST CHAR *pArray);
- _XMUNIBBLE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w);
- _XMUNIBBLE4(CONST FLOAT *pArray);
-
- operator USHORT () { return v; }
-
- _XMUNIBBLE4& operator= (CONST _XMUNIBBLE4& UNibble4);
- _XMUNIBBLE4& operator= (CONST USHORT Packed);
-
-#endif // __cplusplus
-
-} XMUNIBBLE4;
-
-// 4D vector: 5/5/5/1 unsigned integer components
-typedef struct _XMU555
-{
- union
- {
- struct
- {
- USHORT x : 5;
- USHORT y : 5;
- USHORT z : 5;
- USHORT w : 1;
- };
- USHORT v;
- };
-
-#ifdef __cplusplus
-
- _XMU555() {};
- _XMU555(USHORT Packed) : v(Packed) {};
- _XMU555(CHAR _x, CHAR _y, CHAR _z, BOOL _w) : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {};
- _XMU555(CONST CHAR *pArray, BOOL _w);
- _XMU555(FLOAT _x, FLOAT _y, FLOAT _z, BOOL _w);
- _XMU555(CONST FLOAT *pArray, BOOL _w);
-
- operator USHORT () { return v; }
-
- _XMU555& operator= (CONST _XMU555& U555);
- _XMU555& operator= (CONST USHORT Packed);
-
-#endif // __cplusplus
-
-} XMU555;
-
-// 3x3 Matrix: 32 bit floating point components
-typedef struct _XMFLOAT3X3
-{
- union
- {
- struct
- {
- FLOAT _11, _12, _13;
- FLOAT _21, _22, _23;
- FLOAT _31, _32, _33;
- };
- FLOAT m[3][3];
- };
-
-#ifdef __cplusplus
-
- _XMFLOAT3X3() {};
- _XMFLOAT3X3(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22);
- _XMFLOAT3X3(CONST FLOAT *pArray);
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- _XMFLOAT3X3& operator= (CONST _XMFLOAT3X3& Float3x3);
-
-#endif // __cplusplus
-
-} XMFLOAT3X3;
-
-// 4x3 Matrix: 32 bit floating point components
-typedef struct _XMFLOAT4X3
-{
- union
- {
- struct
- {
- FLOAT _11, _12, _13;
- FLOAT _21, _22, _23;
- FLOAT _31, _32, _33;
- FLOAT _41, _42, _43;
- };
- FLOAT m[4][3];
- };
-
-#ifdef __cplusplus
-
- _XMFLOAT4X3() {};
- _XMFLOAT4X3(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22,
- FLOAT m30, FLOAT m31, FLOAT m32);
- _XMFLOAT4X3(CONST FLOAT *pArray);
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- _XMFLOAT4X3& operator= (CONST _XMFLOAT4X3& Float4x3);
-
-#endif // __cplusplus
-
-} XMFLOAT4X3;
-
-// 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary
-#ifdef __cplusplus
-__declspec(align(16)) struct XMFLOAT4X3A : public XMFLOAT4X3
-{
- XMFLOAT4X3A() : XMFLOAT4X3() {};
- XMFLOAT4X3A(FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22,
- FLOAT m30, FLOAT m31, FLOAT m32) :
- XMFLOAT4X3(m00,m01,m02,m10,m11,m12,m20,m21,m22,m30,m31,m32) {};
- XMFLOAT4X3A(CONST FLOAT *pArray) : XMFLOAT4X3(pArray) {}
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- XMFLOAT4X3A& operator= (CONST XMFLOAT4X3A& Float4x3);
-};
-#else
-typedef __declspec(align(16)) XMFLOAT4X3 XMFLOAT4X3A;
-#endif // __cplusplus
-
-// 4x4 Matrix: 32 bit floating point components
-typedef struct _XMFLOAT4X4
-{
- union
- {
- struct
- {
- FLOAT _11, _12, _13, _14;
- FLOAT _21, _22, _23, _24;
- FLOAT _31, _32, _33, _34;
- FLOAT _41, _42, _43, _44;
- };
- FLOAT m[4][4];
- };
-
-#ifdef __cplusplus
-
- _XMFLOAT4X4() {};
- _XMFLOAT4X4(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
- _XMFLOAT4X4(CONST FLOAT *pArray);
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- _XMFLOAT4X4& operator= (CONST _XMFLOAT4X4& Float4x4);
-
-#endif // __cplusplus
-
-} XMFLOAT4X4;
-
-// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary
-#ifdef __cplusplus
-__declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4
-{
- XMFLOAT4X4A() : XMFLOAT4X4() {};
- XMFLOAT4X4A(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33)
- : XMFLOAT4X4(m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33) {};
- XMFLOAT4X4A(CONST FLOAT *pArray) : XMFLOAT4X4(pArray) {}
-
- FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; }
- FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; }
-
- XMFLOAT4X4A& operator= (CONST XMFLOAT4X4A& Float4x4);
-};
-#else
-typedef __declspec(align(16)) XMFLOAT4X4 XMFLOAT4X4A;
-#endif // __cplusplus
-
-#if !defined(_XM_X86_) && !defined(_XM_X64_)
-#pragma bitfield_order(pop)
-#endif // !_XM_X86_ && !_XM_X64_
-
-#pragma warning(pop)
-
-
-/****************************************************************************
- *
- * Data conversion operations
- *
- ****************************************************************************/
-
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
-#else
-XMVECTOR XMConvertVectorIntToFloat(FXMVECTOR VInt, UINT DivExponent);
-XMVECTOR XMConvertVectorFloatToInt(FXMVECTOR VFloat, UINT MulExponent);
-XMVECTOR XMConvertVectorUIntToFloat(FXMVECTOR VUInt, UINT DivExponent);
-XMVECTOR XMConvertVectorFloatToUInt(FXMVECTOR VFloat, UINT MulExponent);
-#endif
-
-FLOAT XMConvertHalfToFloat(HALF Value);
-FLOAT* XMConvertHalfToFloatStream(_Out_bytecap_x_(sizeof(FLOAT)+OutputStride*(HalfCount-1)) FLOAT* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(HALF)+InputStride*(HalfCount-1)) CONST HALF* pInputStream,
- _In_ UINT InputStride, _In_ UINT HalfCount);
-HALF XMConvertFloatToHalf(FLOAT Value);
-HALF* XMConvertFloatToHalfStream(_Out_bytecap_x_(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(FLOAT)+InputStride*(FloatCount-1)) CONST FLOAT* pInputStream,
- _In_ UINT InputStride, _In_ UINT FloatCount);
-
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
-#else
-XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3);
-XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent);
-XMVECTOR XMVectorSplatConstantInt(INT IntConstant);
-#endif
-
-/****************************************************************************
- *
- * Load operations
- *
- ****************************************************************************/
-
-XMVECTOR XMLoadInt(_In_ CONST UINT* pSource);
-XMVECTOR XMLoadFloat(_In_ CONST FLOAT* pSource);
-
-XMVECTOR XMLoadInt2(_In_count_c_(2) CONST UINT* pSource);
-XMVECTOR XMLoadInt2A(_In_count_c_(2) CONST UINT* PSource);
-XMVECTOR XMLoadFloat2(_In_ CONST XMFLOAT2* pSource);
-XMVECTOR XMLoadFloat2A(_In_ CONST XMFLOAT2A* pSource);
-XMVECTOR XMLoadHalf2(_In_ CONST XMHALF2* pSource);
-XMVECTOR XMLoadShortN2(_In_ CONST XMSHORTN2* pSource);
-XMVECTOR XMLoadShort2(_In_ CONST XMSHORT2* pSource);
-XMVECTOR XMLoadUShortN2(_In_ CONST XMUSHORTN2* pSource);
-XMVECTOR XMLoadUShort2(_In_ CONST XMUSHORT2* pSource);
-
-XMVECTOR XMLoadInt3(_In_count_c_(3) CONST UINT* pSource);
-XMVECTOR XMLoadInt3A(_In_count_c_(3) CONST UINT* pSource);
-XMVECTOR XMLoadFloat3(_In_ CONST XMFLOAT3* pSource);
-XMVECTOR XMLoadFloat3A(_In_ CONST XMFLOAT3A* pSource);
-XMVECTOR XMLoadHenDN3(_In_ CONST XMHENDN3* pSource);
-XMVECTOR XMLoadHenD3(_In_ CONST XMHEND3* pSource);
-XMVECTOR XMLoadUHenDN3(_In_ CONST XMUHENDN3* pSource);
-XMVECTOR XMLoadUHenD3(_In_ CONST XMUHEND3* pSource);
-XMVECTOR XMLoadDHenN3(_In_ CONST XMDHENN3* pSource);
-XMVECTOR XMLoadDHen3(_In_ CONST XMDHEN3* pSource);
-XMVECTOR XMLoadUDHenN3(_In_ CONST XMUDHENN3* pSource);
-XMVECTOR XMLoadUDHen3(_In_ CONST XMUDHEN3* pSource);
-XMVECTOR XMLoadU565(_In_ CONST XMU565* pSource);
-XMVECTOR XMLoadFloat3PK(_In_ CONST XMFLOAT3PK* pSource);
-XMVECTOR XMLoadFloat3SE(_In_ CONST XMFLOAT3SE* pSource);
-
-XMVECTOR XMLoadInt4(_In_count_c_(4) CONST UINT* pSource);
-XMVECTOR XMLoadInt4A(_In_count_c_(4) CONST UINT* pSource);
-XMVECTOR XMLoadFloat4(_In_ CONST XMFLOAT4* pSource);
-XMVECTOR XMLoadFloat4A(_In_ CONST XMFLOAT4A* pSource);
-XMVECTOR XMLoadHalf4(_In_ CONST XMHALF4* pSource);
-XMVECTOR XMLoadShortN4(_In_ CONST XMSHORTN4* pSource);
-XMVECTOR XMLoadShort4(_In_ CONST XMSHORT4* pSource);
-XMVECTOR XMLoadUShortN4(_In_ CONST XMUSHORTN4* pSource);
-XMVECTOR XMLoadUShort4(_In_ CONST XMUSHORT4* pSource);
-XMVECTOR XMLoadXIcoN4(_In_ CONST XMXICON4* pSource);
-XMVECTOR XMLoadXIco4(_In_ CONST XMXICO4* pSource);
-XMVECTOR XMLoadIcoN4(_In_ CONST XMICON4* pSource);
-XMVECTOR XMLoadIco4(_In_ CONST XMICO4* pSource);
-XMVECTOR XMLoadUIcoN4(_In_ CONST XMUICON4* pSource);
-XMVECTOR XMLoadUIco4(_In_ CONST XMUICO4* pSource);
-XMVECTOR XMLoadXDecN4(_In_ CONST XMXDECN4* pSource);
-XMVECTOR XMLoadXDec4(_In_ CONST XMXDEC4* pSource);
-XMVECTOR XMLoadDecN4(_In_ CONST XMDECN4* pSource);
-XMVECTOR XMLoadDec4(_In_ CONST XMDEC4* pSource);
-XMVECTOR XMLoadUDecN4(_In_ CONST XMUDECN4* pSource);
-XMVECTOR XMLoadUDec4(_In_ CONST XMUDEC4* pSource);
-XMVECTOR XMLoadByteN4(_In_ CONST XMBYTEN4* pSource);
-XMVECTOR XMLoadByte4(_In_ CONST XMBYTE4* pSource);
-XMVECTOR XMLoadUByteN4(_In_ CONST XMUBYTEN4* pSource);
-XMVECTOR XMLoadUByte4(_In_ CONST XMUBYTE4* pSource);
-XMVECTOR XMLoadUNibble4(_In_ CONST XMUNIBBLE4* pSource);
-XMVECTOR XMLoadU555(_In_ CONST XMU555* pSource);
-XMVECTOR XMLoadColor(_In_ CONST XMCOLOR* pSource);
-
-XMMATRIX XMLoadFloat3x3(_In_ CONST XMFLOAT3X3* pSource);
-XMMATRIX XMLoadFloat4x3(_In_ CONST XMFLOAT4X3* pSource);
-XMMATRIX XMLoadFloat4x3A(_In_ CONST XMFLOAT4X3A* pSource);
-XMMATRIX XMLoadFloat4x4(_In_ CONST XMFLOAT4X4* pSource);
-XMMATRIX XMLoadFloat4x4A(_In_ CONST XMFLOAT4X4A* pSource);
-
-/****************************************************************************
- *
- * Store operations
- *
- ****************************************************************************/
-
-VOID XMStoreInt(_Out_ UINT* pDestination, FXMVECTOR V);
-VOID XMStoreFloat(_Out_ FLOAT* pDestination, FXMVECTOR V);
-
-VOID XMStoreInt2(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreInt2A(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreFloat2(_Out_ XMFLOAT2* pDestination, FXMVECTOR V);
-VOID XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, FXMVECTOR V);
-VOID XMStoreHalf2(_Out_ XMHALF2* pDestination, FXMVECTOR V);
-VOID XMStoreShortN2(_Out_ XMSHORTN2* pDestination, FXMVECTOR V);
-VOID XMStoreShort2(_Out_ XMSHORT2* pDestination, FXMVECTOR V);
-VOID XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, FXMVECTOR V);
-VOID XMStoreUShort2(_Out_ XMUSHORT2* pDestination, FXMVECTOR V);
-
-VOID XMStoreInt3(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreInt3A(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreFloat3(_Out_ XMFLOAT3* pDestination, FXMVECTOR V);
-VOID XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, FXMVECTOR V);
-VOID XMStoreHenDN3(_Out_ XMHENDN3* pDestination, FXMVECTOR V);
-VOID XMStoreHenD3(_Out_ XMHEND3* pDestination, FXMVECTOR V);
-VOID XMStoreUHenDN3(_Out_ XMUHENDN3* pDestination, FXMVECTOR V);
-VOID XMStoreUHenD3(_Out_ XMUHEND3* pDestination, FXMVECTOR V);
-VOID XMStoreDHenN3(_Out_ XMDHENN3* pDestination, FXMVECTOR V);
-VOID XMStoreDHen3(_Out_ XMDHEN3* pDestination, FXMVECTOR V);
-VOID XMStoreUDHenN3(_Out_ XMUDHENN3* pDestination, FXMVECTOR V);
-VOID XMStoreUDHen3(_Out_ XMUDHEN3* pDestination, FXMVECTOR V);
-VOID XMStoreU565(_Out_ XMU565* pDestination, FXMVECTOR V);
-VOID XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, FXMVECTOR V);
-VOID XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, FXMVECTOR V);
-
-VOID XMStoreInt4(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreInt4A(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V);
-VOID XMStoreInt4NC(_Out_ UINT* pDestination, FXMVECTOR V);
-VOID XMStoreFloat4(_Out_ XMFLOAT4* pDestination, FXMVECTOR V);
-VOID XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, FXMVECTOR V);
-VOID XMStoreFloat4NC(_Out_ XMFLOAT4* pDestination, FXMVECTOR V);
-VOID XMStoreHalf4(_Out_ XMHALF4* pDestination, FXMVECTOR V);
-VOID XMStoreShortN4(_Out_ XMSHORTN4* pDestination, FXMVECTOR V);
-VOID XMStoreShort4(_Out_ XMSHORT4* pDestination, FXMVECTOR V);
-VOID XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, FXMVECTOR V);
-VOID XMStoreUShort4(_Out_ XMUSHORT4* pDestination, FXMVECTOR V);
-VOID XMStoreXIcoN4(_Out_ XMXICON4* pDestination, FXMVECTOR V);
-VOID XMStoreXIco4(_Out_ XMXICO4* pDestination, FXMVECTOR V);
-VOID XMStoreIcoN4(_Out_ XMICON4* pDestination, FXMVECTOR V);
-VOID XMStoreIco4(_Out_ XMICO4* pDestination, FXMVECTOR V);
-VOID XMStoreUIcoN4(_Out_ XMUICON4* pDestination, FXMVECTOR V);
-VOID XMStoreUIco4(_Out_ XMUICO4* pDestination, FXMVECTOR V);
-VOID XMStoreXDecN4(_Out_ XMXDECN4* pDestination, FXMVECTOR V);
-VOID XMStoreXDec4(_Out_ XMXDEC4* pDestination, FXMVECTOR V);
-VOID XMStoreDecN4(_Out_ XMDECN4* pDestination, FXMVECTOR V);
-VOID XMStoreDec4(_Out_ XMDEC4* pDestination, FXMVECTOR V);
-VOID XMStoreUDecN4(_Out_ XMUDECN4* pDestination, FXMVECTOR V);
-VOID XMStoreUDec4(_Out_ XMUDEC4* pDestination, FXMVECTOR V);
-VOID XMStoreByteN4(_Out_ XMBYTEN4* pDestination, FXMVECTOR V);
-VOID XMStoreByte4(_Out_ XMBYTE4* pDestination, FXMVECTOR V);
-VOID XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, FXMVECTOR V);
-VOID XMStoreUByte4(_Out_ XMUBYTE4* pDestination, FXMVECTOR V);
-VOID XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, FXMVECTOR V);
-VOID XMStoreU555(_Out_ XMU555* pDestination, FXMVECTOR V);
-VOID XMStoreColor(_Out_ XMCOLOR* pDestination, FXMVECTOR V);
-
-VOID XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M);
-VOID XMStoreFloat3x3NC(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x3NC(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, CXMMATRIX M);
-VOID XMStoreFloat4x4NC(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M);
-
-/****************************************************************************
- *
- * General vector operations
- *
- ****************************************************************************/
-
-XMVECTOR XMVectorZero();
-XMVECTOR XMVectorSet(FLOAT x, FLOAT y, FLOAT z, FLOAT w);
-XMVECTOR XMVectorSetInt(UINT x, UINT y, UINT z, UINT w);
-XMVECTOR XMVectorReplicate(FLOAT Value);
-XMVECTOR XMVectorReplicatePtr(_In_ CONST FLOAT *pValue);
-XMVECTOR XMVectorReplicateInt(UINT Value);
-XMVECTOR XMVectorReplicateIntPtr(_In_ CONST UINT *pValue);
-XMVECTOR XMVectorTrueInt();
-XMVECTOR XMVectorFalseInt();
-XMVECTOR XMVectorSplatX(FXMVECTOR V);
-XMVECTOR XMVectorSplatY(FXMVECTOR V);
-XMVECTOR XMVectorSplatZ(FXMVECTOR V);
-XMVECTOR XMVectorSplatW(FXMVECTOR V);
-XMVECTOR XMVectorSplatOne();
-XMVECTOR XMVectorSplatInfinity();
-XMVECTOR XMVectorSplatQNaN();
-XMVECTOR XMVectorSplatEpsilon();
-XMVECTOR XMVectorSplatSignMask();
-
-FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i);
-FLOAT XMVectorGetX(FXMVECTOR V);
-FLOAT XMVectorGetY(FXMVECTOR V);
-FLOAT XMVectorGetZ(FXMVECTOR V);
-FLOAT XMVectorGetW(FXMVECTOR V);
-
-VOID XMVectorGetByIndexPtr(_Out_ FLOAT *f, FXMVECTOR V, UINT i);
-VOID XMVectorGetXPtr(_Out_ FLOAT *x, FXMVECTOR V);
-VOID XMVectorGetYPtr(_Out_ FLOAT *y, FXMVECTOR V);
-VOID XMVectorGetZPtr(_Out_ FLOAT *z, FXMVECTOR V);
-VOID XMVectorGetWPtr(_Out_ FLOAT *w, FXMVECTOR V);
-
-UINT XMVectorGetIntByIndex(FXMVECTOR V,UINT i);
-UINT XMVectorGetIntX(FXMVECTOR V);
-UINT XMVectorGetIntY(FXMVECTOR V);
-UINT XMVectorGetIntZ(FXMVECTOR V);
-UINT XMVectorGetIntW(FXMVECTOR V);
-
-VOID XMVectorGetIntByIndexPtr(_Out_ UINT *x,FXMVECTOR V, UINT i);
-VOID XMVectorGetIntXPtr(_Out_ UINT *x, FXMVECTOR V);
-VOID XMVectorGetIntYPtr(_Out_ UINT *y, FXMVECTOR V);
-VOID XMVectorGetIntZPtr(_Out_ UINT *z, FXMVECTOR V);
-VOID XMVectorGetIntWPtr(_Out_ UINT *w, FXMVECTOR V);
-
-XMVECTOR XMVectorSetByIndex(FXMVECTOR V,FLOAT f,UINT i);
-XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x);
-XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y);
-XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z);
-XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w);
-
-XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V, _In_ CONST FLOAT *f, UINT i);
-XMVECTOR XMVectorSetXPtr(FXMVECTOR V, _In_ CONST FLOAT *x);
-XMVECTOR XMVectorSetYPtr(FXMVECTOR V, _In_ CONST FLOAT *y);
-XMVECTOR XMVectorSetZPtr(FXMVECTOR V, _In_ CONST FLOAT *z);
-XMVECTOR XMVectorSetWPtr(FXMVECTOR V, _In_ CONST FLOAT *w);
-
-XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x,UINT i);
-XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x);
-XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y);
-XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z);
-XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w);
-
-XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, _In_ CONST UINT *x, UINT i);
-XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V, _In_ CONST UINT *x);
-XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V, _In_ CONST UINT *y);
-XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V, _In_ CONST UINT *z);
-XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V, _In_ CONST UINT *w);
-
-XMVECTOR XMVectorPermuteControl(UINT ElementIndex0, UINT ElementIndex1, UINT ElementIndex2, UINT ElementIndex3);
-XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control);
-XMVECTOR XMVectorSelectControl(UINT VectorIndex0, UINT VectorIndex1, UINT VectorIndex2, UINT VectorIndex3);
-XMVECTOR XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control);
-XMVECTOR XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2);
-
-#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_)
-#else
-XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements);
-XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements);
-XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements);
-XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3);
-XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements,
- UINT Select0, UINT Select1, UINT Select2, UINT Select3);
-#endif
-
-XMVECTOR XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorEqualIntR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR V2);
-XMVECTOR XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
-XMVECTOR XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorGreaterR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorGreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorGreaterOrEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorLess(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds);
-XMVECTOR XMVectorInBoundsR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR Bounds);
-
-XMVECTOR XMVectorIsNaN(FXMVECTOR V);
-XMVECTOR XMVectorIsInfinite(FXMVECTOR V);
-
-XMVECTOR XMVectorMin(FXMVECTOR V1,FXMVECTOR V2);
-XMVECTOR XMVectorMax(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorRound(FXMVECTOR V);
-XMVECTOR XMVectorTruncate(FXMVECTOR V);
-XMVECTOR XMVectorFloor(FXMVECTOR V);
-XMVECTOR XMVectorCeiling(FXMVECTOR V);
-XMVECTOR XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, FXMVECTOR Max);
-XMVECTOR XMVectorSaturate(FXMVECTOR V);
-
-XMVECTOR XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2);
-
-XMVECTOR XMVectorNegate(FXMVECTOR V);
-XMVECTOR XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorSubtractAngles(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
-XMVECTOR XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorNegativeMultiplySubtract(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
-XMVECTOR XMVectorScale(FXMVECTOR V, FLOAT ScaleFactor);
-XMVECTOR XMVectorReciprocalEst(FXMVECTOR V);
-XMVECTOR XMVectorReciprocal(FXMVECTOR V);
-XMVECTOR XMVectorSqrtEst(FXMVECTOR V);
-XMVECTOR XMVectorSqrt(FXMVECTOR V);
-XMVECTOR XMVectorReciprocalSqrtEst(FXMVECTOR V);
-XMVECTOR XMVectorReciprocalSqrt(FXMVECTOR V);
-XMVECTOR XMVectorExpEst(FXMVECTOR V);
-XMVECTOR XMVectorExp(FXMVECTOR V);
-XMVECTOR XMVectorLogEst(FXMVECTOR V);
-XMVECTOR XMVectorLog(FXMVECTOR V);
-XMVECTOR XMVectorPowEst(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorPow(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorAbs(FXMVECTOR V);
-XMVECTOR XMVectorMod(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVectorModAngles(FXMVECTOR Angles);
-XMVECTOR XMVectorSin(FXMVECTOR V);
-XMVECTOR XMVectorSinEst(FXMVECTOR V);
-XMVECTOR XMVectorCos(FXMVECTOR V);
-XMVECTOR XMVectorCosEst(FXMVECTOR V);
-VOID XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V);
-VOID XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V);
-XMVECTOR XMVectorTan(FXMVECTOR V);
-XMVECTOR XMVectorTanEst(FXMVECTOR V);
-XMVECTOR XMVectorSinH(FXMVECTOR V);
-XMVECTOR XMVectorSinHEst(FXMVECTOR V);
-XMVECTOR XMVectorCosH(FXMVECTOR V);
-XMVECTOR XMVectorCosHEst(FXMVECTOR V);
-XMVECTOR XMVectorTanH(FXMVECTOR V);
-XMVECTOR XMVectorTanHEst(FXMVECTOR V);
-XMVECTOR XMVectorASin(FXMVECTOR V);
-XMVECTOR XMVectorASinEst(FXMVECTOR V);
-XMVECTOR XMVectorACos(FXMVECTOR V);
-XMVECTOR XMVectorACosEst(FXMVECTOR V);
-XMVECTOR XMVectorATan(FXMVECTOR V);
-XMVECTOR XMVectorATanEst(FXMVECTOR V);
-XMVECTOR XMVectorATan2(FXMVECTOR Y, FXMVECTOR X);
-XMVECTOR XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X);
-XMVECTOR XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, FLOAT t);
-XMVECTOR XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR T);
-XMVECTOR XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, FLOAT t);
-XMVECTOR XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, CXMVECTOR T);
-XMVECTOR XMVectorCatmullRom(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, FLOAT t);
-XMVECTOR XMVectorCatmullRomV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, CXMVECTOR T);
-XMVECTOR XMVectorBaryCentric(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, FLOAT f, FLOAT g);
-XMVECTOR XMVectorBaryCentricV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR F, CXMVECTOR G);
-
-/****************************************************************************
- *
- * 2D vector operations
- *
- ****************************************************************************/
-
-
-BOOL XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
-BOOL XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2Less(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds);
-UINT XMVector2InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
-
-BOOL XMVector2IsNaN(FXMVECTOR V);
-BOOL XMVector2IsInfinite(FXMVECTOR V);
-
-XMVECTOR XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector2LengthSq(FXMVECTOR V);
-XMVECTOR XMVector2ReciprocalLengthEst(FXMVECTOR V);
-XMVECTOR XMVector2ReciprocalLength(FXMVECTOR V);
-XMVECTOR XMVector2LengthEst(FXMVECTOR V);
-XMVECTOR XMVector2Length(FXMVECTOR V);
-XMVECTOR XMVector2NormalizeEst(FXMVECTOR V);
-XMVECTOR XMVector2Normalize(FXMVECTOR V);
-XMVECTOR XMVector2ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
-XMVECTOR XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
-XMVECTOR XMVector2Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
-XMVECTOR XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
-XMVECTOR XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
-XMVECTOR XMVector2Orthogonal(FXMVECTOR V);
-XMVECTOR XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector2AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector2AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point);
-XMVECTOR XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, CXMVECTOR Line2Point2);
-XMVECTOR XMVector2Transform(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT4* XMVector2TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMFLOAT4* XMVector2TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMVECTOR XMVector2TransformCoord(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT2* XMVector2TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMVECTOR XMVector2TransformNormal(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT2* XMVector2TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-
-/****************************************************************************
- *
- * 3D vector operations
- *
- ****************************************************************************/
-
-
-BOOL XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
-BOOL XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3Less(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds);
-UINT XMVector3InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
-
-BOOL XMVector3IsNaN(FXMVECTOR V);
-BOOL XMVector3IsInfinite(FXMVECTOR V);
-
-XMVECTOR XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector3LengthSq(FXMVECTOR V);
-XMVECTOR XMVector3ReciprocalLengthEst(FXMVECTOR V);
-XMVECTOR XMVector3ReciprocalLength(FXMVECTOR V);
-XMVECTOR XMVector3LengthEst(FXMVECTOR V);
-XMVECTOR XMVector3Length(FXMVECTOR V);
-XMVECTOR XMVector3NormalizeEst(FXMVECTOR V);
-XMVECTOR XMVector3Normalize(FXMVECTOR V);
-XMVECTOR XMVector3ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
-XMVECTOR XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
-XMVECTOR XMVector3Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
-XMVECTOR XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
-XMVECTOR XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
-XMVECTOR XMVector3Orthogonal(FXMVECTOR V);
-XMVECTOR XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector3AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector3AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector3LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point);
-VOID XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, _Out_ XMVECTOR* pPerpendicular, FXMVECTOR V, FXMVECTOR Normal);
-XMVECTOR XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
-XMVECTOR XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion);
-XMVECTOR XMVector3Transform(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT4* XMVector3TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMFLOAT4* XMVector3TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMVECTOR XMVector3TransformCoord(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT3* XMVector3TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMVECTOR XMVector3TransformNormal(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT3* XMVector3TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-XMVECTOR XMVector3Project(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
-XMFLOAT3* XMVector3ProjectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount,
- FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
-XMVECTOR XMVector3Unproject(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
-XMFLOAT3* XMVector3UnprojectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount,
- FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ,
- CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World);
-
-/****************************************************************************
- *
- * 4D vector operations
- *
- ****************************************************************************/
-
-BOOL XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon);
-BOOL XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-UINT XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4Less(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2);
-BOOL XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds);
-UINT XMVector4InBoundsR(FXMVECTOR V, FXMVECTOR Bounds);
-
-BOOL XMVector4IsNaN(FXMVECTOR V);
-BOOL XMVector4IsInfinite(FXMVECTOR V);
-
-XMVECTOR XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3);
-XMVECTOR XMVector4LengthSq(FXMVECTOR V);
-XMVECTOR XMVector4ReciprocalLengthEst(FXMVECTOR V);
-XMVECTOR XMVector4ReciprocalLength(FXMVECTOR V);
-XMVECTOR XMVector4LengthEst(FXMVECTOR V);
-XMVECTOR XMVector4Length(FXMVECTOR V);
-XMVECTOR XMVector4NormalizeEst(FXMVECTOR V);
-XMVECTOR XMVector4Normalize(FXMVECTOR V);
-XMVECTOR XMVector4ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax);
-XMVECTOR XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax);
-XMVECTOR XMVector4Reflect(FXMVECTOR Incident, FXMVECTOR Normal);
-XMVECTOR XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex);
-XMVECTOR XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex);
-XMVECTOR XMVector4Orthogonal(FXMVECTOR V);
-XMVECTOR XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2);
-XMVECTOR XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2);
-XMVECTOR XMVector4Transform(FXMVECTOR V, CXMMATRIX M);
-XMFLOAT4* XMVector4TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(VectorCount-1)) CONST XMFLOAT4* pInputStream,
- _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M);
-
-/****************************************************************************
- *
- * Matrix operations
- *
- ****************************************************************************/
-
-BOOL XMMatrixIsNaN(CXMMATRIX M);
-BOOL XMMatrixIsInfinite(CXMMATRIX M);
-BOOL XMMatrixIsIdentity(CXMMATRIX M);
-
-XMMATRIX XMMatrixMultiply(CXMMATRIX M1, CXMMATRIX M2);
-XMMATRIX XMMatrixMultiplyTranspose(CXMMATRIX M1, CXMMATRIX M2);
-XMMATRIX XMMatrixTranspose(CXMMATRIX M);
-XMMATRIX XMMatrixInverse(_Out_ XMVECTOR* pDeterminant, CXMMATRIX M);
-XMVECTOR XMMatrixDeterminant(CXMMATRIX M);
-BOOL XMMatrixDecompose(_Out_ XMVECTOR *outScale, _Out_ XMVECTOR *outRotQuat, _Out_ XMVECTOR *outTrans, CXMMATRIX M);
-
-XMMATRIX XMMatrixIdentity();
-XMMATRIX XMMatrixSet(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33);
-XMMATRIX XMMatrixTranslation(FLOAT OffsetX, FLOAT OffsetY, FLOAT OffsetZ);
-XMMATRIX XMMatrixTranslationFromVector(FXMVECTOR Offset);
-XMMATRIX XMMatrixScaling(FLOAT ScaleX, FLOAT ScaleY, FLOAT ScaleZ);
-XMMATRIX XMMatrixScalingFromVector(FXMVECTOR Scale);
-XMMATRIX XMMatrixRotationX(FLOAT Angle);
-XMMATRIX XMMatrixRotationY(FLOAT Angle);
-XMMATRIX XMMatrixRotationZ(FLOAT Angle);
-XMMATRIX XMMatrixRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll);
-XMMATRIX XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles);
-XMMATRIX XMMatrixRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle);
-XMMATRIX XMMatrixRotationAxis(FXMVECTOR Axis, FLOAT Angle);
-XMMATRIX XMMatrixRotationQuaternion(FXMVECTOR Quaternion);
-XMMATRIX XMMatrixTransformation2D(FXMVECTOR ScalingOrigin, FLOAT ScalingOrientation, FXMVECTOR Scaling,
- FXMVECTOR RotationOrigin, FLOAT Rotation, CXMVECTOR Translation);
-XMMATRIX XMMatrixTransformation(FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, FXMVECTOR Scaling,
- CXMVECTOR RotationOrigin, CXMVECTOR RotationQuaternion, CXMVECTOR Translation);
-XMMATRIX XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FLOAT Rotation, FXMVECTOR Translation);
-XMMATRIX XMMatrixAffineTransformation(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, CXMVECTOR Translation);
-XMMATRIX XMMatrixReflect(FXMVECTOR ReflectionPlane);
-XMMATRIX XMMatrixShadow(FXMVECTOR ShadowPlane, FXMVECTOR LightPosition);
-
-XMMATRIX XMMatrixLookAtLH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection);
-XMMATRIX XMMatrixLookAtRH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection);
-XMMATRIX XMMatrixLookToLH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection);
-XMMATRIX XMMatrixLookToRH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection);
-XMMATRIX XMMatrixPerspectiveLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixPerspectiveRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixPerspectiveFovLH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixPerspectiveFovRH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixPerspectiveOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixPerspectiveOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixOrthographicLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixOrthographicRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixOrthographicOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
-XMMATRIX XMMatrixOrthographicOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ);
-
-/****************************************************************************
- *
- * Quaternion operations
- *
- ****************************************************************************/
-
-BOOL XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2);
-BOOL XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2);
-
-BOOL XMQuaternionIsNaN(FXMVECTOR Q);
-BOOL XMQuaternionIsInfinite(FXMVECTOR Q);
-BOOL XMQuaternionIsIdentity(FXMVECTOR Q);
-
-XMVECTOR XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2);
-XMVECTOR XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2);
-XMVECTOR XMQuaternionLengthSq(FXMVECTOR Q);
-XMVECTOR XMQuaternionReciprocalLength(FXMVECTOR Q);
-XMVECTOR XMQuaternionLength(FXMVECTOR Q);
-XMVECTOR XMQuaternionNormalizeEst(FXMVECTOR Q);
-XMVECTOR XMQuaternionNormalize(FXMVECTOR Q);
-XMVECTOR XMQuaternionConjugate(FXMVECTOR Q);
-XMVECTOR XMQuaternionInverse(FXMVECTOR Q);
-XMVECTOR XMQuaternionLn(FXMVECTOR Q);
-XMVECTOR XMQuaternionExp(FXMVECTOR Q);
-XMVECTOR XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, FLOAT t);
-XMVECTOR XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR T);
-XMVECTOR XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, FLOAT t);
-XMVECTOR XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, CXMVECTOR T);
-VOID XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, _Out_ XMVECTOR* pC, FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3);
-XMVECTOR XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, FLOAT f, FLOAT g);
-XMVECTOR XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR F, CXMVECTOR G);
-
-XMVECTOR XMQuaternionIdentity();
-XMVECTOR XMQuaternionRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll);
-XMVECTOR XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles);
-XMVECTOR XMQuaternionRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle);
-XMVECTOR XMQuaternionRotationAxis(FXMVECTOR Axis, FLOAT Angle);
-XMVECTOR XMQuaternionRotationMatrix(CXMMATRIX M);
-
-VOID XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, _Out_ FLOAT* pAngle, FXMVECTOR Q);
-
-/****************************************************************************
- *
- * Plane operations
- *
- ****************************************************************************/
-
-BOOL XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2);
-BOOL XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, FXMVECTOR Epsilon);
-BOOL XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2);
-
-BOOL XMPlaneIsNaN(FXMVECTOR P);
-BOOL XMPlaneIsInfinite(FXMVECTOR P);
-
-XMVECTOR XMPlaneDot(FXMVECTOR P, FXMVECTOR V);
-XMVECTOR XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V);
-XMVECTOR XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V);
-XMVECTOR XMPlaneNormalizeEst(FXMVECTOR P);
-XMVECTOR XMPlaneNormalize(FXMVECTOR P);
-XMVECTOR XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2);
-VOID XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, FXMVECTOR P1, FXMVECTOR P2);
-XMVECTOR XMPlaneTransform(FXMVECTOR P, CXMMATRIX M);
-XMFLOAT4* XMPlaneTransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(PlaneCount-1)) XMFLOAT4* pOutputStream,
- _In_ UINT OutputStride,
- _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(PlaneCount-1)) CONST XMFLOAT4* pInputStream,
- _In_ UINT InputStride, _In_ UINT PlaneCount, CXMMATRIX M);
-
-XMVECTOR XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal);
-XMVECTOR XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3);
-
-/****************************************************************************
- *
- * Color operations
- *
- ****************************************************************************/
-
-BOOL XMColorEqual(FXMVECTOR C1, FXMVECTOR C2);
-BOOL XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2);
-BOOL XMColorGreater(FXMVECTOR C1, FXMVECTOR C2);
-BOOL XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2);
-BOOL XMColorLess(FXMVECTOR C1, FXMVECTOR C2);
-BOOL XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2);
-
-BOOL XMColorIsNaN(FXMVECTOR C);
-BOOL XMColorIsInfinite(FXMVECTOR C);
-
-XMVECTOR XMColorNegative(FXMVECTOR C);
-XMVECTOR XMColorModulate(FXMVECTOR C1, FXMVECTOR C2);
-XMVECTOR XMColorAdjustSaturation(FXMVECTOR C, FLOAT Saturation);
-XMVECTOR XMColorAdjustContrast(FXMVECTOR C, FLOAT Contrast);
-
-/****************************************************************************
- *
- * Miscellaneous operations
- *
- ****************************************************************************/
-
-BOOL XMVerifyCPUSupport();
-
-VOID XMAssert(_In_z_ CONST CHAR* pExpression, _In_z_ CONST CHAR* pFileName, UINT LineNumber);
-
-XMVECTOR XMFresnelTerm(FXMVECTOR CosIncidentAngle, FXMVECTOR RefractionIndex);
-
-BOOL XMScalarNearEqual(FLOAT S1, FLOAT S2, FLOAT Epsilon);
-FLOAT XMScalarModAngle(FLOAT Value);
-FLOAT XMScalarSin(FLOAT Value);
-FLOAT XMScalarCos(FLOAT Value);
-VOID XMScalarSinCos(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value);
-FLOAT XMScalarASin(FLOAT Value);
-FLOAT XMScalarACos(FLOAT Value);
-FLOAT XMScalarSinEst(FLOAT Value);
-FLOAT XMScalarCosEst(FLOAT Value);
-VOID XMScalarSinCosEst(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value);
-FLOAT XMScalarASinEst(FLOAT Value);
-FLOAT XMScalarACosEst(FLOAT Value);
-
-/****************************************************************************
- *
- * Globals
- *
- ****************************************************************************/
-
-// The purpose of the following global constants is to prevent redundant
-// reloading of the constants when they are referenced by more than one
-// separate inline math routine called within the same function. Declaring
-// a constant locally within a routine is sufficient to prevent redundant
-// reloads of that constant when that single routine is called multiple
-// times in a function, but if the constant is used (and declared) in a
-// separate math routine it would be reloaded.
-
-#define XMGLOBALCONST extern CONST __declspec(selectany)
-
-XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = {1.0f, -0.166666667f, 8.333333333e-3f, -1.984126984e-4f};
-XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = {2.755731922e-6f, -2.505210839e-8f, 1.605904384e-10f, -7.647163732e-13f};
-XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients2 = {2.811457254e-15f, -8.220635247e-18f, 1.957294106e-20f, -3.868170171e-23f};
-XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = {1.0f, -0.5f, 4.166666667e-2f, -1.388888889e-3f};
-XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = {2.480158730e-5f, -2.755731922e-7f, 2.087675699e-9f, -1.147074560e-11f};
-XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients2 = {4.779477332e-14f, -1.561920697e-16f, 4.110317623e-19f, -8.896791392e-22f};
-XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = {1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f};
-XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = {2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f};
-XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = {5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f};
-XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients0 = {-0.05806367563904f, -0.41861972469416f, 0.22480114791621f, 2.17337241360606f};
-XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients1 = {0.61657275907170f, 4.29696498283455f, -1.18942822255452f, -6.53784832094831f};
-XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients2 = {-1.36926553863413f, -4.48179294237210f, 1.41810672941833f, 5.48179257935713f};
-XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = {1.0f, 0.333333334f, 0.2f, 0.142857143f};
-XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = {1.111111111e-1f, 9.090909091e-2f, 7.692307692e-2f, 6.666666667e-2f};
-XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients2 = {5.882352941e-2f, 5.263157895e-2f, 4.761904762e-2f, 4.347826087e-2f};
-XMGLOBALCONST XMVECTORF32 g_XMSinEstCoefficients = {1.0f, -1.66521856991541e-1f, 8.199913018755e-3f, -1.61475937228e-4f};
-XMGLOBALCONST XMVECTORF32 g_XMCosEstCoefficients = {1.0f, -4.95348008918096e-1f, 3.878259962881e-2f, -9.24587976263e-4f};
-XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = {2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI};
-XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients = {7.689891418951e-1f, 1.104742493348f, 8.661844266006e-1f, XM_PIDIV2};
-XMGLOBALCONST XMVECTORF32 g_XMASinEstCoefficients = {-1.36178272886711f, 2.37949493464538f, -8.08228565650486e-1f, 2.78440142746736e-1f};
-XMGLOBALCONST XMVECTORF32 g_XMASinEstConstants = {1.00000011921f, XM_PIDIV2, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = {XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI};
-XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {1.0f, 0.0f, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {0.0f, 1.0f, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {0.0f, 0.0f, 1.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {0.0f, 0.0f, 0.0f, 1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {-1.0f,0.0f, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {0.0f,-1.0f, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {0.0f, 0.0f,-1.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {0.0f, 0.0f, 0.0f,-1.0f};
-XMGLOBALCONST XMVECTORI32 g_XMNegativeZero = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
-XMGLOBALCONST XMVECTORI32 g_XMNegate3 = {0x80000000, 0x80000000, 0x80000000, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMMask3 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMMaskX = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMMaskY = {0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMMaskZ = {0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMMaskW = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF};
-XMGLOBALCONST XMVECTORF32 g_XMOne = { 1.0f, 1.0f, 1.0f, 1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMOne3 = { 1.0f, 1.0f, 1.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMZero = { 0.0f, 0.0f, 0.0f, 0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {-1.0f,-1.0f,-1.0f,-1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMOneHalf = { 0.5f, 0.5f, 0.5f, 0.5f};
-XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = {-0.5f,-0.5f,-0.5f,-0.5f};
-XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = {-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI};
-XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {-XM_PI, -XM_PI, -XM_PI, -XM_PI};
-XMGLOBALCONST XMVECTORF32 g_XMHalfPi = {XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2};
-XMGLOBALCONST XMVECTORF32 g_XMPi = {XM_PI, XM_PI, XM_PI, XM_PI};
-XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = {XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI};
-XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {XM_2PI, XM_2PI, XM_2PI, XM_2PI};
-XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = {XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI};
-XMGLOBALCONST XMVECTORF32 g_XMEpsilon = {1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f};
-XMGLOBALCONST XMVECTORI32 g_XMInfinity = {0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000};
-XMGLOBALCONST XMVECTORI32 g_XMQNaN = {0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000};
-XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = {0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF};
-XMGLOBALCONST XMVECTORI32 g_XMAbsMask = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
-XMGLOBALCONST XMVECTORI32 g_XMFltMin = {0x00800000, 0x00800000, 0x00800000, 0x00800000};
-XMGLOBALCONST XMVECTORI32 g_XMFltMax = {0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF};
-XMGLOBALCONST XMVECTORI32 g_XMNegOneMask = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
-XMGLOBALCONST XMVECTORI32 g_XMMaskA8R8G8B8 = {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipA8R8G8B8 = {0x00000000, 0x00000000, 0x00000000, 0x80000000};
-XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = {0.0f,0.0f,0.0f,(float)(0x80000000U)};
-XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = {1.0f/(255.0f*(float)(0x10000)),1.0f/(255.0f*(float)(0x100)),1.0f/255.0f,1.0f/(255.0f*(float)(0x1000000))};
-XMGLOBALCONST XMVECTORI32 g_XMMaskA2B10G10R10 = {0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipA2B10G10R10 = {0x00000200, 0x00080000, 0x20000000, 0x80000000};
-XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = {-512.0f,-512.0f*(float)(0x400),-512.0f*(float)(0x100000),(float)(0x80000000U)};
-XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = {1.0f/511.0f,1.0f/(511.0f*(float)(0x400)),1.0f/(511.0f*(float)(0x100000)),1.0f/(3.0f*(float)(0x40000000))};
-XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16 = {0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = {0x00008000, 0x00000000, 0x00000000, 0x00000000};
-XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {-32768.0f,0.0f,0.0f,0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = {1.0f/32767.0f,1.0f/(32767.0f*65536.0f),0.0f,0.0f};
-XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16Z16W16 = {0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = {0x00008000, 0x00008000, 0x00000000, 0x00000000};
-XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = {-32768.0f,-32768.0f,0.0f,0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = {1.0f/32767.0f,1.0f/32767.0f,1.0f/(32767.0f*65536.0f),1.0f/(32767.0f*65536.0f)};
-XMGLOBALCONST XMVECTORF32 g_XMNoFraction = {8388608.0f,8388608.0f,8388608.0f,8388608.0f};
-XMGLOBALCONST XMVECTORI32 g_XMMaskByte = {0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF};
-XMGLOBALCONST XMVECTORF32 g_XMNegateX = {-1.0f, 1.0f, 1.0f, 1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegateY = { 1.0f,-1.0f, 1.0f, 1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegateZ = { 1.0f, 1.0f,-1.0f, 1.0f};
-XMGLOBALCONST XMVECTORF32 g_XMNegateW = { 1.0f, 1.0f, 1.0f,-1.0f};
-XMGLOBALCONST XMVECTORI32 g_XMSelect0101 = {XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1};
-XMGLOBALCONST XMVECTORI32 g_XMSelect1010 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0};
-XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD};
-XMGLOBALCONST XMVECTORI32 g_XMSelect1000 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0};
-XMGLOBALCONST XMVECTORI32 g_XMSelect1100 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0};
-XMGLOBALCONST XMVECTORI32 g_XMSelect1110 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0};
-XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYXY = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Y};
-XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYZX = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X};
-XMGLOBALCONST XMVECTORI32 g_XMSwizzleYXZW = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_0W};
-XMGLOBALCONST XMVECTORI32 g_XMSwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W};
-XMGLOBALCONST XMVECTORI32 g_XMSwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W};
-XMGLOBALCONST XMVECTORI32 g_XMPermute0X0Y1X1Y = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y};
-XMGLOBALCONST XMVECTORI32 g_XMPermute0Z0W1Z1W = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_1W};
-XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = {1.0f,1.0f/65536.0f,0.0f,0.0f};
-XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = {1.0f,1.0f,1.0f/65536.0f,1.0f/65536.0f};
-XMGLOBALCONST XMVECTORI32 g_XMFlipY = {0,0x80000000,0,0};
-XMGLOBALCONST XMVECTORI32 g_XMFlipZ = {0,0,0x80000000,0};
-XMGLOBALCONST XMVECTORI32 g_XMFlipW = {0,0,0,0x80000000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0,0x80000000,0x80000000,0};
-XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0,0,0x80000000,0x80000000};
-XMGLOBALCONST XMVECTORI32 g_XMFlipYW = {0,0x80000000,0,0x80000000};
-XMGLOBALCONST XMVECTORI32 g_XMMaskHenD3 = {0x7FF,0x7ff<<11,0x3FF<<22,0};
-XMGLOBALCONST XMVECTORI32 g_XMMaskDHen3 = {0x3FF,0x7ff<<10,0x7FF<<21,0};
-XMGLOBALCONST XMVECTORF32 g_XMAddUHenD3 = {0,0,32768.0f*65536.0f,0};
-XMGLOBALCONST XMVECTORF32 g_XMAddHenD3 = {-1024.0f,-1024.0f*2048.0f,0,0};
-XMGLOBALCONST XMVECTORF32 g_XMAddDHen3 = {-512.0f,-1024.0f*1024.0f,0,0};
-XMGLOBALCONST XMVECTORF32 g_XMMulHenD3 = {1.0f,1.0f/2048.0f,1.0f/(2048.0f*2048.0f),0};
-XMGLOBALCONST XMVECTORF32 g_XMMulDHen3 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*2048.0f),0};
-XMGLOBALCONST XMVECTORI32 g_XMXorHenD3 = {0x400,0x400<<11,0,0};
-XMGLOBALCONST XMVECTORI32 g_XMXorDHen3 = {0x200,0x400<<10,0,0};
-XMGLOBALCONST XMVECTORI32 g_XMMaskIco4 = {0xFFFFF,0xFFFFF000,0xFFFFF,0xF0000000};
-XMGLOBALCONST XMVECTORI32 g_XMXorXIco4 = {0x80000,0,0x80000,0x80000000};
-XMGLOBALCONST XMVECTORI32 g_XMXorIco4 = {0x80000,0,0x80000,0};
-XMGLOBALCONST XMVECTORF32 g_XMAddXIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,32768.0f*65536.0f};
-XMGLOBALCONST XMVECTORF32 g_XMAddUIco4 = {0,32768.0f*65536.0f,0,32768.0f*65536.0f};
-XMGLOBALCONST XMVECTORF32 g_XMAddIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,0};
-XMGLOBALCONST XMVECTORF32 g_XMMulIco4 = {1.0f,1.0f/4096.0f,1.0f,1.0f/(4096.0f*65536.0f)};
-XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30};
-XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200,0x200<<10,0x200<<20,0};
-XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {0,0,0,32768.0f*65536.0f};
-XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,0};
-XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)};
-XMGLOBALCONST XMVECTORI32 g_XMMaskByte4 = {0xFF,0xFF00,0xFF0000,0xFF000000};
-XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = {0x80,0x8000,0x800000,0x00000000};
-XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = {-128.0f,-128.0f*256.0f,-128.0f*65536.0f,0};
-
-/****************************************************************************
- *
- * Implementation
- *
- ****************************************************************************/
-
-#pragma warning(push)
-#pragma warning(disable:4214 4204 4365 4616 6001)
-
-#if !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_)
-
-/* Work around VC 2005 bug where math.h defines logf with a semicolon at the end.
- * Note this is fixed as of Visual Studio 2005 Service Pack 1
- */
-
-#undef logf
-#define logf(x) ((float)log((double)(x)))
-
-#endif // !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_)
-
-//------------------------------------------------------------------------------
-
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
-XMFINLINE XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTORU32 vResult;
- vResult.u[0] = (0-(C0&1)) & 0x3F800000;
- vResult.u[1] = (0-(C1&1)) & 0x3F800000;
- vResult.u[2] = (0-(C2&1)) & 0x3F800000;
- vResult.u[3] = (0-(C3&1)) & 0x3F800000;
- return vResult.v;
-#else // XM_SSE_INTRINSICS_
- static const XMVECTORU32 g_vMask1 = {1,1,1,1};
- // Move the parms to a vector
- __m128i vTemp = _mm_set_epi32(C3,C2,C1,C0);
- // Mask off the low bits
- vTemp = _mm_and_si128(vTemp,g_vMask1);
- // 0xFFFFFFFF on true bits
- vTemp = _mm_cmpeq_epi32(vTemp,g_vMask1);
- // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f
- vTemp = _mm_and_si128(vTemp,g_XMOne);
- return reinterpret_cast<const __m128 *>(&vTemp)[0];
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- XMASSERT(DivExponent<32);
- {
- XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant };
- return XMConvertVectorIntToFloat( V.v, DivExponent);
- }
-#else // XM_SSE_INTRINSICS_
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- XMASSERT(DivExponent<32);
- // Splat the int
- __m128i vScale = _mm_set1_epi32(IntConstant);
- // Convert to a float
- XMVECTOR vResult = _mm_cvtepi32_ps(vScale);
- // Convert DivExponent into 1.0f/(1<<DivExponent)
- UINT uScale = 0x3F800000U - (DivExponent << 23);
- // Splat the scalar value (It's really a float)
- vScale = _mm_set1_epi32(uScale);
- // Multiply by the reciprocal (Perform a right shift by DivExponent)
- vResult = _mm_mul_ps(vResult,reinterpret_cast<const __m128 *>(&vScale)[0]);
- return vResult;
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSplatConstantInt(INT IntConstant)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- {
- XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant };
- return V.v;
- }
-#else // XM_SSE_INTRINSICS_
- XMASSERT( IntConstant >= -16 && IntConstant <= 15 );
- __m128i V = _mm_set1_epi32( IntConstant );
- return reinterpret_cast<__m128 *>(&V)[0];
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements)
-{
- return XMVectorPermute(V1, V2, XMVectorPermuteControl((Elements), ((Elements) + 1), ((Elements) + 2), ((Elements) + 3)));
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT( Elements < 4 );
- {
- XMVECTORF32 vResult = { V.vector4_f32[Elements & 3], V.vector4_f32[(Elements + 1) & 3],
- V.vector4_f32[(Elements + 2) & 3], V.vector4_f32[(Elements + 3) & 3] };
- return vResult.v;
- }
-#else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,(Elements) & 3);
- FLOAT fy = XMVectorGetByIndex(V,((Elements) + 1) & 3);
- FLOAT fz = XMVectorGetByIndex(V,((Elements) + 2) & 3);
- FLOAT fw = XMVectorGetByIndex(V,((Elements) + 3) & 3);
- return _mm_set_ps( fw, fz, fy, fx );
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT( Elements < 4 );
- {
- XMVECTORF32 vResult = { V.vector4_f32[(4 - (Elements)) & 3], V.vector4_f32[(5 - (Elements)) & 3],
- V.vector4_f32[(6 - (Elements)) & 3], V.vector4_f32[(7 - (Elements)) & 3] };
- return vResult.v;
- }
-#else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,(4 - (Elements)) & 3);
- FLOAT fy = XMVectorGetByIndex(V,(5 - (Elements)) & 3);
- FLOAT fz = XMVectorGetByIndex(V,(6 - (Elements)) & 3);
- FLOAT fw = XMVectorGetByIndex(V,(7 - (Elements)) & 3);
- return _mm_set_ps( fw, fz, fy, fx );
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT( (E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4) );
- {
- XMVECTORF32 vResult = { V.vector4_f32[E0], V.vector4_f32[E1], V.vector4_f32[E2], V.vector4_f32[E3] };
- return vResult.v;
- }
-#else // XM_SSE_INTRINSICS_
- FLOAT fx = XMVectorGetByIndex(V,E0);
- FLOAT fy = XMVectorGetByIndex(V,E1);
- FLOAT fz = XMVectorGetByIndex(V,E2);
- FLOAT fw = XMVectorGetByIndex(V,E3);
- return _mm_set_ps( fw, fz, fy, fx );
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements,
- UINT Select0, UINT Select1, UINT Select2, UINT Select3)
-{
- XMVECTOR Control = XMVectorSelectControl(Select0&1, Select1&1, Select2&1, Select3&1);
- return XMVectorSelect( VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control );
-}
-
-// Implemented for VMX128 intrinsics as #defines aboves
-#endif _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_
-
-//------------------------------------------------------------------------------
-
-#include "xnamathconvert.inl"
-#include "xnamathvector.inl"
-#include "xnamathmatrix.inl"
-#include "xnamathmisc.inl"
-
-#pragma warning(pop)
-
-#endif // __XNAMATH_H__
-
diff --git a/3rdparty/dxsdk/Include/xnamathconvert.inl b/3rdparty/dxsdk/Include/xnamathconvert.inl
deleted file mode 100644
index 370d27d290a..00000000000
--- a/3rdparty/dxsdk/Include/xnamathconvert.inl
+++ /dev/null
@@ -1,5785 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- xnamathconvert.inl
-
-Abstract:
-
- XNA math library for Windows and Xbox 360: Conversion, loading, and storing functions.
---*/
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#ifndef __XNAMATHCONVERT_INL__
-#define __XNAMATHCONVERT_INL__
-
-#define XM_PACK_FACTOR (FLOAT)(1 << 22)
-#define XM_UNPACK_FACTOR_UNSIGNED (FLOAT)(1 << 23)
-#define XM_UNPACK_FACTOR_SIGNED XM_PACK_FACTOR
-
-#define XM_UNPACK_UNSIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \
- {-XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \
- -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \
- -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \
- -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)}
-
-#define XM_UNPACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \
- {XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \
- XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \
- XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \
- XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)}
-
-#define XM_UNPACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \
- {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1), \
- -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1), \
- -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1), \
- -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1)}
-
-//#define XM_UNPACK_SIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \
-// {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1) * 3.0f, \
-// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1) * 3.0f, \
-// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1) * 3.0f, \
-// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1) * 3.0f}
-
-#define XM_PACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \
- {-(FLOAT)((1 << (BitsX)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << (BitsY)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << (BitsZ)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << (BitsW)) - 1) / XM_PACK_FACTOR}
-
-#define XM_PACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \
- {-(FLOAT)((1 << ((BitsX) - 1)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << ((BitsY) - 1)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << ((BitsZ) - 1)) - 1) / XM_PACK_FACTOR, \
- -(FLOAT)((1 << ((BitsW) - 1)) - 1) / XM_PACK_FACTOR}
-
-#define XM_PACK_OFFSET XMVectorSplatConstant(3, 0)
-//#define XM_UNPACK_OFFSET XM_PACK_OFFSET
-
-/****************************************************************************
- *
- * Data conversion
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE FLOAT XMConvertHalfToFloat
-(
- HALF Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
- UINT Mantissa;
- UINT Exponent;
- UINT Result;
-
- Mantissa = (UINT)(Value & 0x03FF);
-
- if ((Value & 0x7C00) != 0) // The value is normalized
- {
- Exponent = (UINT)((Value >> 10) & 0x1F);
- }
- else if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x0400) == 0);
-
- Mantissa &= 0x03FF;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result = ((Value & 0x8000) << 16) | // Sign
- ((Exponent + 112) << 23) | // Exponent
- (Mantissa << 13); // Mantissa
-
- return *(FLOAT*)&Result;
-
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE FLOAT* XMConvertHalfToFloatStream
-(
- FLOAT* pOutputStream,
- UINT OutputStride,
- CONST HALF* pInputStream,
- UINT InputStride,
- UINT HalfCount
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
- UINT i;
- BYTE* pHalf = (BYTE*)pInputStream;
- BYTE* pFloat = (BYTE*)pOutputStream;
-
- XMASSERT(pOutputStream);
- XMASSERT(pInputStream);
-
- for (i = 0; i < HalfCount; i++)
- {
- *(FLOAT*)pFloat = XMConvertHalfToFloat(*(HALF*)pHalf);
- pHalf += InputStride;
- pFloat += OutputStride;
- }
-
- return pOutputStream;
-
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE HALF XMConvertFloatToHalf
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
- UINT Result;
-
- UINT IValue = ((UINT *)(&Value))[0];
- UINT Sign = (IValue & 0x80000000U) >> 16U;
- IValue = IValue & 0x7FFFFFFFU; // Hack off the sign
-
- if (IValue > 0x47FFEFFFU)
- {
- // The number is too large to be represented as a half. Saturate to infinity.
- Result = 0x7FFFU;
- }
- else
- {
- if (IValue < 0x38800000U)
- {
- // The number is too small to be represented as a normalized half.
- // Convert it to a denormalized value.
- UINT Shift = 113U - (IValue >> 23U);
- IValue = (0x800000U | (IValue & 0x7FFFFFU)) >> Shift;
- }
- else
- {
- // Rebias the exponent to represent the value as a normalized half.
- IValue += 0xC8000000U;
- }
-
- Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U)&0x7FFFU;
- }
- return (HALF)(Result|Sign);
-
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE HALF* XMConvertFloatToHalfStream
-(
- HALF* pOutputStream,
- UINT OutputStride,
- CONST FLOAT* pInputStream,
- UINT InputStride,
- UINT FloatCount
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
- UINT i;
- BYTE* pFloat = (BYTE*)pInputStream;
- BYTE* pHalf = (BYTE*)pOutputStream;
-
- XMASSERT(pOutputStream);
- XMASSERT(pInputStream);
-
- for (i = 0; i < FloatCount; i++)
- {
- *(HALF*)pHalf = XMConvertFloatToHalf(*(FLOAT*)pFloat);
- pFloat += InputStride;
- pHalf += OutputStride;
- }
- return pOutputStream;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-// For VMX128, these routines are all defines in the main header
-
-#pragma warning(push)
-#pragma warning(disable:4701) // Prevent warnings about 'Result' potentially being used without having been initialized
-
-XMINLINE XMVECTOR XMConvertVectorIntToFloat
-(
- FXMVECTOR VInt,
- UINT DivExponent
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ElementIndex;
- FLOAT fScale;
- XMVECTOR Result;
- XMASSERT(DivExponent<32);
- fScale = 1.0f / (FLOAT)(1U << DivExponent);
- ElementIndex = 0;
- do {
- INT iTemp = (INT)VInt.vector4_u32[ElementIndex];
- Result.vector4_f32[ElementIndex] = ((FLOAT)iTemp) * fScale;
- } while (++ElementIndex<4);
- return Result;
-#else // _XM_SSE_INTRINSICS_
- XMASSERT(DivExponent<32);
- // Convert to floats
- XMVECTOR vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&VInt)[0]);
- // Convert DivExponent into 1.0f/(1<<DivExponent)
- UINT uScale = 0x3F800000U - (DivExponent << 23);
- // Splat the scalar value
- __m128i vScale = _mm_set1_epi32(uScale);
- vResult = _mm_mul_ps(vResult,reinterpret_cast<const __m128 *>(&vScale)[0]);
- return vResult;
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMConvertVectorFloatToInt
-(
- FXMVECTOR VFloat,
- UINT MulExponent
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ElementIndex;
- XMVECTOR Result;
- FLOAT fScale;
- XMASSERT(MulExponent<32);
- // Get the scalar factor.
- fScale = (FLOAT)(1U << MulExponent);
- ElementIndex = 0;
- do {
- INT iResult;
- FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale;
- if (fTemp <= -(65536.0f*32768.0f)) {
- iResult = (-0x7FFFFFFF)-1;
- } else if (fTemp > (65536.0f*32768.0f)-128.0f) {
- iResult = 0x7FFFFFFF;
- } else {
- iResult = (INT)fTemp;
- }
- Result.vector4_u32[ElementIndex] = (UINT)iResult;
- } while (++ElementIndex<4);
- return Result;
-#else // _XM_SSE_INTRINSICS_
- XMASSERT(MulExponent<32);
- static const XMVECTORF32 MaxInt = {65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f};
- XMVECTOR vResult = _mm_set_ps1((FLOAT)(1U << MulExponent));
- vResult = _mm_mul_ps(vResult,VFloat);
- // In case of positive overflow, detect it
- XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxInt);
- // Float to int conversion
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // If there was positive overflow, set to 0x7FFFFFFF
- vResult = _mm_and_ps(vOverflow,g_XMAbsMask);
- vOverflow = _mm_andnot_ps(vOverflow,reinterpret_cast<const __m128 *>(&vResulti)[0]);
- vOverflow = _mm_or_ps(vOverflow,vResult);
- return vOverflow;
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMConvertVectorUIntToFloat
-(
- FXMVECTOR VUInt,
- UINT DivExponent
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ElementIndex;
- FLOAT fScale;
- XMVECTOR Result;
- XMASSERT(DivExponent<32);
- fScale = 1.0f / (FLOAT)(1U << DivExponent);
- ElementIndex = 0;
- do {
- Result.vector4_f32[ElementIndex] = (FLOAT)VUInt.vector4_u32[ElementIndex] * fScale;
- } while (++ElementIndex<4);
- return Result;
-#else // _XM_SSE_INTRINSICS_
- XMASSERT(DivExponent<32);
- static const XMVECTORF32 FixUnsigned = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f};
- // For the values that are higher than 0x7FFFFFFF, a fixup is needed
- // Determine which ones need the fix.
- XMVECTOR vMask = _mm_and_ps(VUInt,g_XMNegativeZero);
- // Force all values positive
- XMVECTOR vResult = _mm_xor_ps(VUInt,vMask);
- // Convert to floats
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert 0x80000000 -> 0xFFFFFFFF
- __m128i iMask = _mm_srai_epi32(reinterpret_cast<const __m128i *>(&vMask)[0],31);
- // For only the ones that are too big, add the fixup
- vMask = _mm_and_ps(reinterpret_cast<const __m128 *>(&iMask)[0],FixUnsigned);
- vResult = _mm_add_ps(vResult,vMask);
- // Convert DivExponent into 1.0f/(1<<DivExponent)
- UINT uScale = 0x3F800000U - (DivExponent << 23);
- // Splat
- iMask = _mm_set1_epi32(uScale);
- vResult = _mm_mul_ps(vResult,reinterpret_cast<const __m128 *>(&iMask)[0]);
- return vResult;
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMConvertVectorFloatToUInt
-(
- FXMVECTOR VFloat,
- UINT MulExponent
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ElementIndex;
- XMVECTOR Result;
- FLOAT fScale;
- XMASSERT(MulExponent<32);
- // Get the scalar factor.
- fScale = (FLOAT)(1U << MulExponent);
- ElementIndex = 0;
- do {
- UINT uResult;
- FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale;
- if (fTemp <= 0.0f) {
- uResult = 0;
- } else if (fTemp >= (65536.0f*65536.0f)) {
- uResult = 0xFFFFFFFFU;
- } else {
- uResult = (UINT)fTemp;
- }
- Result.vector4_u32[ElementIndex] = uResult;
- } while (++ElementIndex<4);
- return Result;
-#else // _XM_SSE_INTRINSICS_
- XMASSERT(MulExponent<32);
- static const XMVECTORF32 MaxUInt = {65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f};
- static const XMVECTORF32 UnsignedFix = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f};
- XMVECTOR vResult = _mm_set_ps1(static_cast<float>(1U << MulExponent));
- vResult = _mm_mul_ps(vResult,VFloat);
- // Clamp to >=0
- vResult = _mm_max_ps(vResult,g_XMZero);
- // Any numbers that are too big, set to 0xFFFFFFFFU
- XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxUInt);
- XMVECTOR vValue = UnsignedFix;
- // Too large for a signed integer?
- XMVECTOR vMask = _mm_cmpge_ps(vResult,vValue);
- // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise
- vValue = _mm_and_ps(vValue,vMask);
- // Perform fixup only on numbers too large (Keeps low bit precision)
- vResult = _mm_sub_ps(vResult,vValue);
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Convert from signed to unsigned pnly if greater than 0x80000000
- vMask = _mm_and_ps(vMask,g_XMNegativeZero);
- vResult = _mm_xor_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],vMask);
- // On those that are too large, set to 0xFFFFFFFF
- vResult = _mm_or_ps(vResult,vOverflow);
- return vResult;
-#endif
-}
-
-#pragma warning(pop)
-
-#endif // _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_
-
-/****************************************************************************
- *
- * Vector and matrix load operations
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt(CONST UINT* pSource)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 3) == 0);
-
- V.vector4_u32[0] = *pSource;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 3) == 0);
-
- return _mm_load_ss( (const float*)pSource );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat(CONST FLOAT* pSource)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 3) == 0);
-
- V.vector4_f32[0] = *pSource;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 3) == 0);
-
- return _mm_load_ss( pSource );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt2
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
-
- return V;
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pSource);
-
- __m128 x = _mm_load_ss( (const float*)pSource );
- __m128 y = _mm_load_ss( (const float*)(pSource+1) );
- return _mm_unpacklo_ps( x, y );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt2A
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- __m128i V = _mm_loadl_epi64( (const __m128i*)pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat2
-(
- CONST XMFLOAT2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR V;
- XMASSERT(pSource);
-
- ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0];
- ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0];
- return V;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
-
- __m128 x = _mm_load_ss( &pSource->x );
- __m128 y = _mm_load_ss( &pSource->y );
- return _mm_unpacklo_ps( x, y );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat2A
-(
- CONST XMFLOAT2A* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_f32[0] = pSource->x;
- V.vector4_f32[1] = pSource->y;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- __m128i V = _mm_loadl_epi64( (const __m128i*)pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadHalf2
-(
- CONST XMHALF2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT(pSource);
- {
- XMVECTOR vResult = {
- XMConvertHalfToFloat(pSource->x),
- XMConvertHalfToFloat(pSource->y),
- 0.0f,
- 0.0f
- };
- return vResult;
- }
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMVECTOR vResult = {
- XMConvertHalfToFloat(pSource->x),
- XMConvertHalfToFloat(pSource->y),
- 0.0f,
- 0.0f
- };
- return vResult;
-
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadShortN2
-(
- CONST XMSHORTN2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- {
- XMVECTOR vResult = {
- (FLOAT)pSource->x * (1.0f/32767.0f),
- (FLOAT)pSource->y * (1.0f/32767.0f),
- 0.0f,
- 0.0f
- };
- return vResult;
- }
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- // Splat the two shorts in all four entries (WORD alignment okay,
- // DWORD alignment preferred)
- __m128 vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0
- vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16);
- // x needs to be sign extended
- vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x - 0x8000 to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16);
- // Convert 0-32767 to 0.0f-1.0f
- return _mm_mul_ps(vTemp,g_XMNormalizeX16Y16);
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadShort2
-(
- CONST XMSHORT2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- // Splat the two shorts in all four entries (WORD alignment okay,
- // DWORD alignment preferred)
- __m128 vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0
- vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16);
- // x needs to be sign extended
- vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x - 0x8000 to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16);
- // Y is 65536 too large
- return _mm_mul_ps(vTemp,g_XMFixupY16);
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUShortN2
-(
- CONST XMUSHORTN2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f;
- V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 FixupY16 = {1.0f/65535.0f,1.0f/(65535.0f*65536.0f),0.0f,0.0f};
- static const XMVECTORF32 FixaddY16 = {0,32768.0f*65536.0f,0,0};
- XMASSERT(pSource);
- // Splat the two shorts in all four entries (WORD alignment okay,
- // DWORD alignment preferred)
- __m128 vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0
- vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16);
- // y needs to be sign flipped
- vTemp = _mm_xor_ps(vTemp,g_XMFlipY);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // y + 0x8000 to undo the signed order.
- vTemp = _mm_add_ps(vTemp,FixaddY16);
- // Y is 65536 times too large
- vTemp = _mm_mul_ps(vTemp,FixupY16);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUShort2
-(
- CONST XMUSHORT2* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 FixaddY16 = {0,32768.0f,0,0};
- XMASSERT(pSource);
- // Splat the two shorts in all four entries (WORD alignment okay,
- // DWORD alignment preferred)
- __m128 vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0
- vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16);
- // y needs to be sign flipped
- vTemp = _mm_xor_ps(vTemp,g_XMFlipY);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // Y is 65536 times too large
- vTemp = _mm_mul_ps(vTemp,g_XMFixupY16);
- // y + 0x8000 to undo the signed order.
- vTemp = _mm_add_ps(vTemp,FixaddY16);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt3
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
- V.vector4_u32[2] = pSource[2];
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
-
-#ifdef _XM_ISVS2005_
- __m128i V = _mm_set_epi32( 0, *(pSource+2), *(pSource+1), *pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else
- __m128 x = _mm_load_ss( (const float*)pSource );
- __m128 y = _mm_load_ss( (const float*)(pSource+1) );
- __m128 z = _mm_load_ss( (const float*)(pSource+2) );
- __m128 xy = _mm_unpacklo_ps( x, y );
- return _mm_movelh_ps( xy, z );
-#endif // !_XM_ISVS2005_
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt3A
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
- V.vector4_u32[2] = pSource[2];
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
-
- // Reads an extra integer that is 'undefined'
-
- __m128i V = _mm_load_si128( (const __m128i*)pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat3
-(
- CONST XMFLOAT3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR V;
- XMASSERT(pSource);
-
- ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0];
- ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0];
- ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0];
- return V;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
-
-#ifdef _XM_ISVS2005_
- // This reads 1 floats past the memory that should be ignored.
- // Need to continue to do this for VS 2005 due to compiler issue but prefer new method
- // to avoid triggering issues with memory debug tools (like AV)
- return _mm_loadu_ps( &pSource->x );
-#else
- __m128 x = _mm_load_ss( &pSource->x );
- __m128 y = _mm_load_ss( &pSource->y );
- __m128 z = _mm_load_ss( &pSource->z );
- __m128 xy = _mm_unpacklo_ps( x, y );
- return _mm_movelh_ps( xy, z );
-#endif // !_XM_ISVS2005_
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat3A
-(
- CONST XMFLOAT3A* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_f32[0] = pSource->x;
- V.vector4_f32[1] = pSource->y;
- V.vector4_f32[2] = pSource->z;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- // This reads 1 floats past the memory that should be ignored.
- return _mm_load_ps( &pSource->x );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUHenDN3
-(
- CONST XMUHENDN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x7FF;
- V.vector4_f32[0] = (FLOAT)Element / 2047.0f;
- Element = (pSource->v >> 11) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)Element / 2047.0f;
- Element = (pSource->v >> 22) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)Element / 1023.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 UHenDN3Mul = {1.0f/2047.0f,1.0f/(2047.0f*2048.0f),1.0f/(1023.0f*2048.0f*2048.0f),0};
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskHenD3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMFlipZ);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddUHenD3);
- // Normalize x,y and z to -1.0f-1.0f
- vResult = _mm_mul_ps(vResult,UHenDN3Mul);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUHenD3
-(
- CONST XMUHEND3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x7FF;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 11) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 22) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)Element;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskHenD3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMFlipZ);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddUHenD3);
- // Normalize x and y to -1024-1023.0f and z to -512-511.0f
- vResult = _mm_mul_ps(vResult,g_XMMulHenD3);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadHenDN3
-(
- CONST XMHENDN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800};
- static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200);
-
- Element = pSource->v & 0x7FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f;
- Element = (pSource->v >> 11) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f;
- Element = (pSource->v >> 22) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]) / 511.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 HenDN3Mul = {1.0f/1023.0f,1.0f/(1023.0f*2048.0f),1.0f/(511.0f*2048.0f*2048.0f),0};
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskHenD3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMXorHenD3);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddHenD3);
- // Normalize x,y and z to -1.0f-1.0f
- vResult = _mm_mul_ps(vResult,HenDN3Mul);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadHenD3
-(
- CONST XMHEND3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800};
- static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200);
-
- Element = pSource->v & 0x7FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]);
- Element = (pSource->v >> 11) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]);
- Element = (pSource->v >> 22) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskHenD3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMXorHenD3);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddHenD3);
- // Normalize x and y to -1024-1023.0f and z to -512-511.0f
- vResult = _mm_mul_ps(vResult,g_XMMulHenD3);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUDHenN3
-(
- CONST XMUDHENN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)Element / 1023.0f;
- Element = (pSource->v >> 10) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)Element / 2047.0f;
- Element = (pSource->v >> 21) & 0x7FF;
- V.vector4_f32[2] = (FLOAT)Element / 2047.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 UDHenN3Mul = {1.0f/1023.0f,1.0f/(2047.0f*1024.0f),1.0f/(2047.0f*1024.0f*2048.0f),0};
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskDHen3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMFlipZ);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddUHenD3);
- // Normalize x,y and z to -1.0f-1.0f
- vResult = _mm_mul_ps(vResult,UDHenN3Mul);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUDHen3
-(
- CONST XMUDHEN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 10) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 21) & 0x7FF;
- V.vector4_f32[2] = (FLOAT)Element;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskDHen3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMFlipZ);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddUHenD3);
- // Normalize x to 0-1023.0f and y and z to 0-2047.0f
- vResult = _mm_mul_ps(vResult,g_XMMulDHen3);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadDHenN3
-(
- CONST XMDHENN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00};
- static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]) / 511.0f;
- Element = (pSource->v >> 10) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f;
- Element = (pSource->v >> 21) & 0x7FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 DHenN3Mul = {1.0f/511.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*2048.0f),0};
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskDHen3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMXorDHen3);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddDHen3);
- // Normalize x,y and z to -1.0f-1.0f
- vResult = _mm_mul_ps(vResult,DHenN3Mul);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadDHen3
-(
- CONST XMDHEN3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00};
- static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]);
- Element = (pSource->v >> 10) & 0x7FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]);
- Element = (pSource->v >> 21) & 0x7FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400);
- XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,g_XMMaskDHen3);
- // Convert x and y to unsigned
- vResult = _mm_xor_ps(vResult,g_XMXorDHen3);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Convert x and y back to signed
- vResult = _mm_add_ps(vResult,g_XMAddDHen3);
- // Normalize x to -210-511.0f and y and z to -1024-1023.0f
- vResult = _mm_mul_ps(vResult,g_XMMulDHen3);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadU565
-(
- CONST XMU565* pSource
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- static const XMVECTORI32 U565And = {0x1F,0x3F<<5,0x1F<<11,0};
- static const XMVECTORF32 U565Mul = {1.0f,1.0f/32.0f,1.0f/2048.f,0};
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,U565And);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Normalize x, y, and z
- vResult = _mm_mul_ps(vResult,U565Mul);
- return vResult;
-#else
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x1F;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 5) & 0x3F;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 11) & 0x1F;
- V.vector4_f32[2] = (FLOAT)Element;
-
- return V;
-#endif // !_XM_SSE_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat3PK
-(
- CONST XMFLOAT3PK* pSource
-)
-{
- _DECLSPEC_ALIGN_16_ UINT Result[4];
- UINT Mantissa;
- UINT Exponent;
-
- XMASSERT(pSource);
-
- // X Channel (6-bit mantissa)
- Mantissa = pSource->xm;
-
- if ( pSource->xe == 0x1f ) // INF or NAN
- {
- Result[0] = 0x7f800000 | (pSource->xm << 17);
- }
- else
- {
- if ( pSource->xe != 0 ) // The value is normalized
- {
- Exponent = pSource->xe;
- }
- else if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x40) == 0);
-
- Mantissa &= 0x3F;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17);
- }
-
- // Y Channel (6-bit mantissa)
- Mantissa = pSource->ym;
-
- if ( pSource->ye == 0x1f ) // INF or NAN
- {
- Result[1] = 0x7f800000 | (pSource->ym << 17);
- }
- else
- {
- if ( pSource->ye != 0 ) // The value is normalized
- {
- Exponent = pSource->ye;
- }
- else if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x40) == 0);
-
- Mantissa &= 0x3F;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17);
- }
-
- // Z Channel (5-bit mantissa)
- Mantissa = pSource->zm;
-
- if ( pSource->ze == 0x1f ) // INF or NAN
- {
- Result[2] = 0x7f800000 | (pSource->zm << 17);
- }
- else
- {
- if ( pSource->ze != 0 ) // The value is normalized
- {
- Exponent = pSource->ze;
- }
- else if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x20) == 0);
-
- Mantissa &= 0x1F;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18);
- }
-
- return XMLoadFloat3A( (XMFLOAT3A*)&Result );
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat3SE
-(
- CONST XMFLOAT3SE* pSource
-)
-{
- _DECLSPEC_ALIGN_16_ UINT Result[4];
- UINT Mantissa;
- UINT Exponent, ExpBits;
-
- XMASSERT(pSource);
-
- if ( pSource->e == 0x1f ) // INF or NAN
- {
- Result[0] = 0x7f800000 | (pSource->xm << 14);
- Result[1] = 0x7f800000 | (pSource->ym << 14);
- Result[2] = 0x7f800000 | (pSource->zm << 14);
- }
- else if ( pSource->e != 0 ) // The values are all normalized
- {
- Exponent = pSource->e;
-
- ExpBits = (Exponent + 112) << 23;
-
- Mantissa = pSource->xm;
- Result[0] = ExpBits | (Mantissa << 14);
-
- Mantissa = pSource->ym;
- Result[1] = ExpBits | (Mantissa << 14);
-
- Mantissa = pSource->zm;
- Result[2] = ExpBits | (Mantissa << 14);
- }
- else
- {
- // X Channel
- Mantissa = pSource->xm;
-
- if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x200) == 0);
-
- Mantissa &= 0x1FF;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[0] = ((Exponent + 112) << 23) | (Mantissa << 14);
-
- // Y Channel
- Mantissa = pSource->ym;
-
- if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x200) == 0);
-
- Mantissa &= 0x1FF;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[1] = ((Exponent + 112) << 23) | (Mantissa << 14);
-
- // Z Channel
- Mantissa = pSource->zm;
-
- if (Mantissa != 0) // The value is denormalized
- {
- // Normalize the value in the resulting float
- Exponent = 1;
-
- do
- {
- Exponent--;
- Mantissa <<= 1;
- } while ((Mantissa & 0x200) == 0);
-
- Mantissa &= 0x1FF;
- }
- else // The value is zero
- {
- Exponent = (UINT)-112;
- }
-
- Result[2] = ((Exponent + 112) << 23) | (Mantissa << 14);
- }
-
- return XMLoadFloat3A( (XMFLOAT3A*)&Result );
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt4
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
- V.vector4_u32[2] = pSource[2];
- V.vector4_u32[3] = pSource[3];
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pSource);
-
- __m128i V = _mm_loadu_si128( (const __m128i*)pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadInt4A
-(
- CONST UINT* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_u32[0] = pSource[0];
- V.vector4_u32[1] = pSource[1];
- V.vector4_u32[2] = pSource[2];
- V.vector4_u32[3] = pSource[3];
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- __m128i V = _mm_load_si128( (const __m128i*)pSource );
- return reinterpret_cast<__m128 *>(&V)[0];
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat4
-(
- CONST XMFLOAT4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR V;
- XMASSERT(pSource);
-
- ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0];
- ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0];
- ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0];
- ((UINT *)(&V.vector4_f32[3]))[0] = ((const UINT *)(&pSource->w))[0];
- return V;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
-
- return _mm_loadu_ps( &pSource->x );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadFloat4A
-(
- CONST XMFLOAT4A* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- V.vector4_f32[0] = pSource->x;
- V.vector4_f32[1] = pSource->y;
- V.vector4_f32[2] = pSource->z;
- V.vector4_f32[3] = pSource->w;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- return _mm_load_ps( &pSource->x );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadHalf4
-(
- CONST XMHALF4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT(pSource);
- {
- XMVECTOR vResult = {
- XMConvertHalfToFloat(pSource->x),
- XMConvertHalfToFloat(pSource->y),
- XMConvertHalfToFloat(pSource->z),
- XMConvertHalfToFloat(pSource->w)
- };
- return vResult;
- }
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMVECTOR vResult = {
- XMConvertHalfToFloat(pSource->x),
- XMConvertHalfToFloat(pSource->y),
- XMConvertHalfToFloat(pSource->z),
- XMConvertHalfToFloat(pSource->w)
- };
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadShortN4
-(
- CONST XMSHORTN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- XMASSERT(pSource->z != -32768);
- XMASSERT(pSource->w != -32768);
- {
- XMVECTOR vResult = {
- (FLOAT)pSource->x * (1.0f/32767.0f),
- (FLOAT)pSource->y * (1.0f/32767.0f),
- (FLOAT)pSource->z * (1.0f/32767.0f),
- (FLOAT)pSource->w * (1.0f/32767.0f)
- };
- return vResult;
- }
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- XMASSERT(pSource->z != -32768);
- XMASSERT(pSource->w != -32768);
- // Splat the color in all four entries (x,z,y,w)
- __m128d vIntd = _mm_load1_pd(reinterpret_cast<const double *>(&pSource->x));
- // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000
- __m128 vTemp = _mm_and_ps(reinterpret_cast<const __m128 *>(&vIntd)[0],g_XMMaskX16Y16Z16W16);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x8000 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16);
- // Convert -32767-32767 to -1.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,g_XMNormalizeX16Y16Z16W16);
- // Very important! The entries are x,z,y,w, flip it to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0));
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadShort4
-(
- CONST XMSHORT4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- XMASSERT(pSource->z != -32768);
- XMASSERT(pSource->w != -32768);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
- V.vector4_f32[2] = (FLOAT)pSource->z;
- V.vector4_f32[3] = (FLOAT)pSource->w;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT(pSource->x != -32768);
- XMASSERT(pSource->y != -32768);
- XMASSERT(pSource->z != -32768);
- XMASSERT(pSource->w != -32768);
- // Splat the color in all four entries (x,z,y,w)
- __m128d vIntd = _mm_load1_pd(reinterpret_cast<const double *>(&pSource->x));
- // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000
- __m128 vTemp = _mm_and_ps(reinterpret_cast<const __m128 *>(&vIntd)[0],g_XMMaskX16Y16Z16W16);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x8000 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16);
- // Fix y and w because they are 65536 too large
- vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16);
- // Very important! The entries are x,z,y,w, flip it to x,y,z,w
- return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0));
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUShortN4
-(
- CONST XMUSHORTN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f;
- V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f;
- V.vector4_f32[2] = (FLOAT)pSource->z / 65535.0f;
- V.vector4_f32[3] = (FLOAT)pSource->w / 65535.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- static const XMVECTORF32 FixupY16W16 = {1.0f/65535.0f,1.0f/65535.0f,1.0f/(65535.0f*65536.0f),1.0f/(65535.0f*65536.0f)};
- static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f*65536.0f,32768.0f*65536.0f};
- XMASSERT(pSource);
- // Splat the color in all four entries (x,z,y,w)
- __m128d vIntd = _mm_load1_pd(reinterpret_cast<const double *>(&pSource->x));
- // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000
- __m128 vTemp = _mm_and_ps(reinterpret_cast<const __m128 *>(&vIntd)[0],g_XMMaskX16Y16Z16W16);
- // y and w are signed! Flip the bits to convert the order to unsigned
- vTemp = _mm_xor_ps(vTemp,g_XMFlipZW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // y and w + 0x8000 to complete the conversion
- vTemp = _mm_add_ps(vTemp,FixaddY16W16);
- // Fix y and w because they are 65536 too large
- vTemp = _mm_mul_ps(vTemp,FixupY16W16);
- // Very important! The entries are x,z,y,w, flip it to x,y,z,w
- return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0));
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUShort4
-(
- CONST XMUSHORT4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
- V.vector4_f32[2] = (FLOAT)pSource->z;
- V.vector4_f32[3] = (FLOAT)pSource->w;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f,32768.0f};
- XMASSERT(pSource);
- // Splat the color in all four entries (x,z,y,w)
- __m128d vIntd = _mm_load1_pd(reinterpret_cast<const double *>(&pSource->x));
- // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000
- __m128 vTemp = _mm_and_ps(reinterpret_cast<const __m128 *>(&vIntd)[0],g_XMMaskX16Y16Z16W16);
- // y and w are signed! Flip the bits to convert the order to unsigned
- vTemp = _mm_xor_ps(vTemp,g_XMFlipZW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // Fix y and w because they are 65536 too large
- vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16);
- // y and w + 0x8000 to complete the conversion
- vTemp = _mm_add_ps(vTemp,FixaddY16W16);
- // Very important! The entries are x,z,y,w, flip it to x,y,z,w
- return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0));
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadXIcoN4
-(
- CONST XMXICON4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull);
-
- Element = (UINT)(pSource->v & 0xFFFFF);
- V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- Element = (UINT)((pSource->v >> 20) & 0xFFFFF);
- V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- Element = (UINT)((pSource->v >> 40) & 0xFFFFF);
- V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull);
- static const XMVECTORF32 LoadXIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(15.0f*4096.0f*65536.0f)};
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddXIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadXIcoN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadXIco4
-(
- CONST XMXICO4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull);
-
- Element = (UINT)(pSource->v & 0xFFFFF);
- V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- Element = (UINT)((pSource->v >> 20) & 0xFFFFF);
- V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- Element = (UINT)((pSource->v >> 40) & 0xFFFFF);
- V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 60);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull);
- XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull);
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddXIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,g_XMMulIco4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUIcoN4
-(
- CONST XMUICON4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF) / 1048575.0f;
- V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF) / 1048575.0f;
- V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF) / 1048575.0f;
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadUIcoN4Mul = {1.0f/1048575.0f,1.0f/(1048575.0f*4096.0f),1.0f/1048575.0f,1.0f/(15.0f*4096.0f*65536.0f)};
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipYW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddUIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadUIcoN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUIco4
-(
- CONST XMUICO4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF);
- V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF);
- V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF);
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 60);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipYW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddUIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,g_XMMulIco4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadIcoN4
-(
- CONST XMICON4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000};
- static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0};
-
- XMASSERT(pSource);
-
- Element = (UINT)(pSource->v & 0xFFFFF);
- V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- Element = (UINT)((pSource->v >> 20) & 0xFFFFF);
- V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- Element = (UINT)((pSource->v >> 40) & 0xFFFFF);
- V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f;
- Element = (UINT)(pSource->v >> 60);
- V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]) / 7.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(7.0f*4096.0f*65536.0f)};
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorIco4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadIcoN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadIco4
-(
- CONST XMICO4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000};
- static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0};
-
- XMASSERT(pSource);
-
- Element = (UINT)(pSource->v & 0xFFFFF);
- V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- Element = (UINT)((pSource->v >> 20) & 0xFFFFF);
- V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- Element = (UINT)((pSource->v >> 40) & 0xFFFFF);
- V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]);
- Element = (UINT)(pSource->v >> 60);
- V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Grab the 64 bit structure
- __m128d vResultd = _mm_load_sd(reinterpret_cast<const double *>(&pSource->v));
- // By shifting down 8 bits, y and z are in seperate 32 bit elements
- __m128i vResulti = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vResultd)[0],8/8);
- // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z
- XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResultd)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(1,0,1,0));
- // Fix the entries to x,y,z,w
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0));
- // Mask x,y,z and w
- vTemp = _mm_and_ps(vTemp,g_XMMaskIco4);
- // x and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorIco4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddIco4);
- // Fix y and w because they are too large
- vTemp = _mm_mul_ps(vTemp,g_XMMulIco4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadXDecN4
-(
- CONST XMXDECN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Splat the color in all four entries
- __m128 vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskA2B10G10R10);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipA2B10G10R10);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMFixAA2B10G10R10);
- // Convert 0-255 to 0.0f-1.0f
- return _mm_mul_ps(vTemp,g_XMNormalizeA2B10G10R10);
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadXDec4
-(
- CONST XMXDEC4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 30);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
- static const XMVECTORI32 XDec4Xor = {0x200, 0x200<<10, 0x200<<20, 0x80000000};
- static const XMVECTORF32 XDec4Add = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,32768*65536.0f};
- XMASSERT(pSource);
- // Splat the color in all four entries
- XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskDec4);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,XDec4Xor);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,XDec4Add);
- // Convert 0-255 to 0.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,g_XMMulDec4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUDecN4
-(
- CONST XMUDECN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)Element / 1023.0f;
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)Element / 1023.0f;
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)Element / 1023.0f;
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- static const XMVECTORF32 UDecN4Mul = {1.0f/1023.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*1024.0f),1.0f/(3.0f*1024.0f*1024.0f*1024.0f)};
- // Splat the color in all four entries
- XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskDec4);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMAddUDec4);
- // Convert 0-255 to 0.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,UDecN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUDec4
-(
- CONST XMUDEC4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)Element;
- V.vector4_f32[3] = (FLOAT)(pSource->v >> 30);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Splat the color in all four entries
- XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskDec4);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMFlipW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMAddUDec4);
- // Convert 0-255 to 0.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,g_XMMulDec4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadDecN4
-(
- CONST XMDECN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00};
- static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 30) & 0x3) != 0x2);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f;
- Element = pSource->v >> 30;
- V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 30) & 0x3) != 0x2);
- static const XMVECTORF32 DecN4Mul = {1.0f/511.0f,1.0f/(511.0f*1024.0f),1.0f/(511.0f*1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)};
- // Splat the color in all four entries
- XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskDec4);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorDec4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMAddDec4);
- // Convert 0-255 to 0.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,DecN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadDec4
-(
- CONST XMDEC4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- UINT Element;
- static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00};
- static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC};
-
- XMASSERT(pSource);
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 30) & 0x3) != 0x2);
-
- Element = pSource->v & 0x3FF;
- V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- Element = (pSource->v >> 10) & 0x3FF;
- V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- Element = (pSource->v >> 20) & 0x3FF;
- V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]);
- Element = pSource->v >> 30;
- V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]);
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT((pSource->v & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200);
- XMASSERT(((pSource->v >> 30) & 0x3) != 0x2);
- XMASSERT(pSource);
- // Splat the color in all four entries
- XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskDec4);
- // a is unsigned! Flip the bit to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorDec4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMAddDec4);
- // Convert 0-255 to 0.0f-1.0f
- vTemp = _mm_mul_ps(vTemp,g_XMMulDec4);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUByteN4
-(
- CONST XMUBYTEN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x / 255.0f;
- V.vector4_f32[1] = (FLOAT)pSource->y / 255.0f;
- V.vector4_f32[2] = (FLOAT)pSource->z / 255.0f;
- V.vector4_f32[3] = (FLOAT)pSource->w / 255.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadUByteN4Mul = {1.0f/255.0f,1.0f/(255.0f*256.0f),1.0f/(255.0f*65536.0f),1.0f/(255.0f*65536.0f*256.0f)};
- XMASSERT(pSource);
- // Splat the color in all four entries (x,z,y,w)
- XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskByte4);
- // w is signed! Flip the bits to convert the order to unsigned
- vTemp = _mm_xor_ps(vTemp,g_XMFlipW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // w + 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddUDec4);
- // Fix y, z and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadUByteN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUByte4
-(
- CONST XMUBYTE4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
- V.vector4_f32[2] = (FLOAT)pSource->z;
- V.vector4_f32[3] = (FLOAT)pSource->w;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadUByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)};
- XMASSERT(pSource);
- // Splat the color in all four entries (x,z,y,w)
- XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskByte4);
- // w is signed! Flip the bits to convert the order to unsigned
- vTemp = _mm_xor_ps(vTemp,g_XMFlipW);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // w + 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddUDec4);
- // Fix y, z and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadUByte4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadByteN4
-(
- CONST XMBYTEN4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(pSource->x != -128);
- XMASSERT(pSource->y != -128);
- XMASSERT(pSource->z != -128);
- XMASSERT(pSource->w != -128);
-
- V.vector4_f32[0] = (FLOAT)pSource->x / 127.0f;
- V.vector4_f32[1] = (FLOAT)pSource->y / 127.0f;
- V.vector4_f32[2] = (FLOAT)pSource->z / 127.0f;
- V.vector4_f32[3] = (FLOAT)pSource->w / 127.0f;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadByteN4Mul = {1.0f/127.0f,1.0f/(127.0f*256.0f),1.0f/(127.0f*65536.0f),1.0f/(127.0f*65536.0f*256.0f)};
- XMASSERT(pSource);
- XMASSERT(pSource->x != -128);
- XMASSERT(pSource->y != -128);
- XMASSERT(pSource->z != -128);
- XMASSERT(pSource->w != -128);
- // Splat the color in all four entries (x,z,y,w)
- XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskByte4);
- // x,y and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorByte4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x, y and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddByte4);
- // Fix y, z and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadByteN4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadByte4
-(
- CONST XMBYTE4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
-
- XMASSERT(pSource);
- XMASSERT(pSource->x != -128);
- XMASSERT(pSource->y != -128);
- XMASSERT(pSource->z != -128);
- XMASSERT(pSource->w != -128);
-
- V.vector4_f32[0] = (FLOAT)pSource->x;
- V.vector4_f32[1] = (FLOAT)pSource->y;
- V.vector4_f32[2] = (FLOAT)pSource->z;
- V.vector4_f32[3] = (FLOAT)pSource->w;
-
- return V;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 LoadByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)};
- XMASSERT(pSource);
- XMASSERT(pSource->x != -128);
- XMASSERT(pSource->y != -128);
- XMASSERT(pSource->z != -128);
- XMASSERT(pSource->w != -128);
- // Splat the color in all four entries (x,z,y,w)
- XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast<const float *>(&pSource->x));
- // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000
- vTemp = _mm_and_ps(vTemp,g_XMMaskByte4);
- // x,y and z are unsigned! Flip the bits to convert the order to signed
- vTemp = _mm_xor_ps(vTemp,g_XMXorByte4);
- // Convert to floating point numbers
- vTemp = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vTemp)[0]);
- // x, y and z - 0x80 to complete the conversion
- vTemp = _mm_add_ps(vTemp,g_XMAddByte4);
- // Fix y, z and w because they are too large
- vTemp = _mm_mul_ps(vTemp,LoadByte4Mul);
- return vTemp;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadUNibble4
-(
- CONST XMUNIBBLE4* pSource
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- static const XMVECTORI32 UNibble4And = {0xF,0xF0,0xF00,0xF000};
- static const XMVECTORF32 UNibble4Mul = {1.0f,1.0f/16.f,1.0f/256.f,1.0f/4096.f};
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,UNibble4And);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Normalize x, y, and z
- vResult = _mm_mul_ps(vResult,UNibble4Mul);
- return vResult;
-#else
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0xF;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 4) & 0xF;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 8) & 0xF;
- V.vector4_f32[2] = (FLOAT)Element;
- Element = (pSource->v >> 12) & 0xF;
- V.vector4_f32[3] = (FLOAT)Element;
-
- return V;
-#endif // !_XM_SSE_INTRISICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadU555
-(
- CONST XMU555* pSource
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- static const XMVECTORI32 U555And = {0x1F,0x1F<<5,0x1F<<10,0x8000};
- static const XMVECTORF32 U555Mul = {1.0f,1.0f/32.f,1.0f/1024.f,1.0f/32768.f};
- XMASSERT(pSource);
- // Get the 32 bit value and splat it
- XMVECTOR vResult = _mm_load_ps1(reinterpret_cast<const float *>(&pSource->v));
- // Mask off x, y and z
- vResult = _mm_and_ps(vResult,U555And);
- // Convert to float
- vResult = _mm_cvtepi32_ps(reinterpret_cast<const __m128i *>(&vResult)[0]);
- // Normalize x, y, and z
- vResult = _mm_mul_ps(vResult,U555Mul);
- return vResult;
-#else
- XMVECTOR V;
- UINT Element;
-
- XMASSERT(pSource);
-
- Element = pSource->v & 0x1F;
- V.vector4_f32[0] = (FLOAT)Element;
- Element = (pSource->v >> 5) & 0x1F;
- V.vector4_f32[1] = (FLOAT)Element;
- Element = (pSource->v >> 10) & 0x1F;
- V.vector4_f32[2] = (FLOAT)Element;
- Element = (pSource->v >> 15) & 0x1;
- V.vector4_f32[3] = (FLOAT)Element;
-
- return V;
-#endif // !_XM_SSE_INTRISICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMLoadColor
-(
- CONST XMCOLOR* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMASSERT(pSource);
- {
- // INT -> Float conversions are done in one instruction.
- // UINT -> Float calls a runtime function. Keep in INT
- INT iColor = (INT)(pSource->c);
- XMVECTOR vColor = {
- (FLOAT)((iColor >> 16) & 0xFF) * (1.0f/255.0f),
- (FLOAT)((iColor >> 8) & 0xFF) * (1.0f/255.0f),
- (FLOAT)(iColor & 0xFF) * (1.0f/255.0f),
- (FLOAT)((iColor >> 24) & 0xFF) * (1.0f/255.0f)
- };
- return vColor;
- }
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Splat the color in all four entries
- __m128i vInt = _mm_set1_epi32(pSource->c);
- // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000
- vInt = _mm_and_si128(vInt,g_XMMaskA8R8G8B8);
- // a is unsigned! Flip the bit to convert the order to signed
- vInt = _mm_xor_si128(vInt,g_XMFlipA8R8G8B8);
- // Convert to floating point numbers
- XMVECTOR vTemp = _mm_cvtepi32_ps(vInt);
- // RGB + 0, A + 0x80000000.f to undo the signed order.
- vTemp = _mm_add_ps(vTemp,g_XMFixAA8R8G8B8);
- // Convert 0-255 to 0.0f-1.0f
- return _mm_mul_ps(vTemp,g_XMNormalizeA8R8G8B8);
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMLoadFloat3x3
-(
- CONST XMFLOAT3X3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- XMASSERT(pSource);
-
- M.r[0].vector4_f32[0] = pSource->m[0][0];
- M.r[0].vector4_f32[1] = pSource->m[0][1];
- M.r[0].vector4_f32[2] = pSource->m[0][2];
- M.r[0].vector4_f32[3] = 0.0f;
-
- M.r[1].vector4_f32[0] = pSource->m[1][0];
- M.r[1].vector4_f32[1] = pSource->m[1][1];
- M.r[1].vector4_f32[2] = pSource->m[1][2];
- M.r[1].vector4_f32[3] = 0.0f;
-
- M.r[2].vector4_f32[0] = pSource->m[2][0];
- M.r[2].vector4_f32[1] = pSource->m[2][1];
- M.r[2].vector4_f32[2] = pSource->m[2][2];
- M.r[2].vector4_f32[3] = 0.0f;
-
- M.r[3].vector4_f32[0] = 0.0f;
- M.r[3].vector4_f32[1] = 0.0f;
- M.r[3].vector4_f32[2] = 0.0f;
- M.r[3].vector4_f32[3] = 1.0f;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMVECTOR V1, V2, V3, Z, T1, T2, T3, T4, T5;
-
- Z = _mm_setzero_ps();
-
- XMASSERT(pSource);
-
- V1 = _mm_loadu_ps( &pSource->m[0][0] );
- V2 = _mm_loadu_ps( &pSource->m[1][1] );
- V3 = _mm_load_ss( &pSource->m[2][2] );
-
- T1 = _mm_unpackhi_ps( V1, Z );
- T2 = _mm_unpacklo_ps( V2, Z );
- T3 = _mm_shuffle_ps( V3, T2, _MM_SHUFFLE( 0, 1, 0, 0 ) );
- T4 = _mm_movehl_ps( T2, T3 );
- T5 = _mm_movehl_ps( Z, T1 );
-
- M.r[0] = _mm_movelh_ps( V1, T1 );
- M.r[1] = _mm_add_ps( T4, T5 );
- M.r[2] = _mm_shuffle_ps( V2, V3, _MM_SHUFFLE(1, 0, 3, 2) );
- M.r[3] = g_XMIdentityR3;
-
- return M;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMLoadFloat4x3
-(
- CONST XMFLOAT4X3* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
- XMASSERT(pSource);
-
- ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0];
- ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0];
- ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0];
- M.r[0].vector4_f32[3] = 0.0f;
-
- ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0];
- ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0];
- ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0];
- M.r[1].vector4_f32[3] = 0.0f;
-
- ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0];
- ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0];
- ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0];
- M.r[2].vector4_f32[3] = 0.0f;
-
- ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0];
- ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0];
- ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0];
- M.r[3].vector4_f32[3] = 1.0f;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Use unaligned load instructions to
- // load the 12 floats
- // vTemp1 = x1,y1,z1,x2
- XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]);
- // vTemp2 = y2,z2,x3,y3
- XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]);
- // vTemp4 = z3,x4,y4,z4
- XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]);
- // vTemp3 = x3,y3,z3,z3
- XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2));
- // vTemp2 = y2,z2,x2,x2
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0));
- // vTemp2 = x2,y2,z2,z2
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2));
- // vTemp1 = x1,y1,z1,0
- vTemp1 = _mm_and_ps(vTemp1,g_XMMask3);
- // vTemp2 = x2,y2,z2,0
- vTemp2 = _mm_and_ps(vTemp2,g_XMMask3);
- // vTemp3 = x3,y3,z3,0
- vTemp3 = _mm_and_ps(vTemp3,g_XMMask3);
- // vTemp4i = x4,y4,z4,0
- __m128i vTemp4i = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vTemp4)[0],32/8);
- // vTemp4i = x4,y4,z4,1.0f
- vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3);
- XMMATRIX M(vTemp1,
- vTemp2,
- vTemp3,
- reinterpret_cast<const __m128 *>(&vTemp4i)[0]);
- return M;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMLoadFloat4x3A
-(
- CONST XMFLOAT4X3A* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- M.r[0].vector4_f32[0] = pSource->m[0][0];
- M.r[0].vector4_f32[1] = pSource->m[0][1];
- M.r[0].vector4_f32[2] = pSource->m[0][2];
- M.r[0].vector4_f32[3] = 0.0f;
-
- M.r[1].vector4_f32[0] = pSource->m[1][0];
- M.r[1].vector4_f32[1] = pSource->m[1][1];
- M.r[1].vector4_f32[2] = pSource->m[1][2];
- M.r[1].vector4_f32[3] = 0.0f;
-
- M.r[2].vector4_f32[0] = pSource->m[2][0];
- M.r[2].vector4_f32[1] = pSource->m[2][1];
- M.r[2].vector4_f32[2] = pSource->m[2][2];
- M.r[2].vector4_f32[3] = 0.0f;
-
- M.r[3].vector4_f32[0] = pSource->m[3][0];
- M.r[3].vector4_f32[1] = pSource->m[3][1];
- M.r[3].vector4_f32[2] = pSource->m[3][2];
- M.r[3].vector4_f32[3] = 1.0f;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- // Use aligned load instructions to
- // load the 12 floats
- // vTemp1 = x1,y1,z1,x2
- XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]);
- // vTemp2 = y2,z2,x3,y3
- XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]);
- // vTemp4 = z3,x4,y4,z4
- XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]);
- // vTemp3 = x3,y3,z3,z3
- XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2));
- // vTemp2 = y2,z2,x2,x2
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0));
- // vTemp2 = x2,y2,z2,z2
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2));
- // vTemp1 = x1,y1,z1,0
- vTemp1 = _mm_and_ps(vTemp1,g_XMMask3);
- // vTemp2 = x2,y2,z2,0
- vTemp2 = _mm_and_ps(vTemp2,g_XMMask3);
- // vTemp3 = x3,y3,z3,0
- vTemp3 = _mm_and_ps(vTemp3,g_XMMask3);
- // vTemp4i = x4,y4,z4,0
- __m128i vTemp4i = _mm_srli_si128(reinterpret_cast<const __m128i *>(&vTemp4)[0],32/8);
- // vTemp4i = x4,y4,z4,1.0f
- vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3);
- XMMATRIX M(vTemp1,
- vTemp2,
- vTemp3,
- reinterpret_cast<const __m128 *>(&vTemp4i)[0]);
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMLoadFloat4x4
-(
- CONST XMFLOAT4X4* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
- XMASSERT(pSource);
-
- ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0];
- ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0];
- ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0];
- ((UINT *)(&M.r[0].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[0][3]))[0];
-
- ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0];
- ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0];
- ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0];
- ((UINT *)(&M.r[1].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[1][3]))[0];
-
- ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0];
- ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0];
- ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0];
- ((UINT *)(&M.r[2].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[2][3]))[0];
-
- ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0];
- ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0];
- ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0];
- ((UINT *)(&M.r[3].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[3][3]))[0];
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSource);
- XMMATRIX M;
-
- M.r[0] = _mm_loadu_ps( &pSource->_11 );
- M.r[1] = _mm_loadu_ps( &pSource->_21 );
- M.r[2] = _mm_loadu_ps( &pSource->_31 );
- M.r[3] = _mm_loadu_ps( &pSource->_41 );
-
- return M;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMLoadFloat4x4A
-(
- CONST XMFLOAT4X4A* pSource
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- XMASSERT(pSource);
- XMASSERT(((UINT_PTR)pSource & 0xF) == 0);
-
- M.r[0].vector4_f32[0] = pSource->m[0][0];
- M.r[0].vector4_f32[1] = pSource->m[0][1];
- M.r[0].vector4_f32[2] = pSource->m[0][2];
- M.r[0].vector4_f32[3] = pSource->m[0][3];
-
- M.r[1].vector4_f32[0] = pSource->m[1][0];
- M.r[1].vector4_f32[1] = pSource->m[1][1];
- M.r[1].vector4_f32[2] = pSource->m[1][2];
- M.r[1].vector4_f32[3] = pSource->m[1][3];
-
- M.r[2].vector4_f32[0] = pSource->m[2][0];
- M.r[2].vector4_f32[1] = pSource->m[2][1];
- M.r[2].vector4_f32[2] = pSource->m[2][2];
- M.r[2].vector4_f32[3] = pSource->m[2][3];
-
- M.r[3].vector4_f32[0] = pSource->m[3][0];
- M.r[3].vector4_f32[1] = pSource->m[3][1];
- M.r[3].vector4_f32[2] = pSource->m[3][2];
- M.r[3].vector4_f32[3] = pSource->m[3][3];
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
-
- XMASSERT(pSource);
-
- M.r[0] = _mm_load_ps( &pSource->_11 );
- M.r[1] = _mm_load_ps( &pSource->_21 );
- M.r[2] = _mm_load_ps( &pSource->_31 );
- M.r[3] = _mm_load_ps( &pSource->_41 );
-
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-/****************************************************************************
- *
- * Vector and matrix store operations
- *
- ****************************************************************************/
-
-XMFINLINE VOID XMStoreInt
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- *pDestination = XMVectorGetIntX( V );
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- _mm_store_ss( (float*)pDestination, V );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat
-(
- FLOAT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- *pDestination = XMVectorGetX( V );
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- _mm_store_ss( pDestination, V );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt2
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) );
- _mm_store_ss( (float*)&pDestination[0], V );
- _mm_store_ss( (float*)&pDestination[1], T );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt2A
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat2
-(
- XMFLOAT2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) );
- _mm_store_ss( &pDestination->x, V );
- _mm_store_ss( &pDestination->y, T );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat2A
-(
- XMFLOAT2A* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreHalf2
-(
- XMHALF2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]);
- pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V));
- pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreShortN2
-(
- XMSHORTN2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- vResult = _mm_mul_ps(vResult,Scale);
- __m128i vResulti = _mm_cvtps_epi32(vResult);
- vResulti = _mm_packs_epi32(vResulti,vResulti);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->x),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreShort2
-(
- XMSHORT2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f};
- static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f};
- static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,Min);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Pack the ints into shorts
- vInt = _mm_packs_epi32(vInt,vInt);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->x),reinterpret_cast<const __m128 *>(&vInt)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUShortN2
-(
- XMUSHORTN2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v);
- N = XMVectorTruncate(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- vResult = _mm_mul_ps(vResult,Scale);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Since the SSE pack instruction clamps using signed rules,
- // manually extract the values to store them to memory
- pDestination->x = static_cast<SHORT>(_mm_extract_epi16(vInt,0));
- pDestination->y = static_cast<SHORT>(_mm_extract_epi16(vInt,2));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUShort2
-(
- XMUSHORT2* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Since the SSE pack instruction clamps using signed rules,
- // manually extract the values to store them to memory
- pDestination->x = static_cast<SHORT>(_mm_extract_epi16(vInt,0));
- pDestination->y = static_cast<SHORT>(_mm_extract_epi16(vInt,2));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt3
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
- pDestination[2] = V.vector4_u32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_store_ss( (float*)pDestination, V );
- _mm_store_ss( (float*)&pDestination[1], T1 );
- _mm_store_ss( (float*)&pDestination[2], T2 );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt3A
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
- pDestination[2] = V.vector4_u32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
- _mm_store_ss( (float*)&pDestination[2], T );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3
-(
- XMFLOAT3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
- pDestination->z = V.vector4_f32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_store_ss( &pDestination->x, V );
- _mm_store_ss( &pDestination->y, T1 );
- _mm_store_ss( &pDestination->z, T2 );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3A
-(
- XMFLOAT3A* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
- pDestination->z = V.vector4_f32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
- _mm_store_ss( &pDestination->z, T );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUHenDN3
-(
- XMUHENDN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {2047.0f, 2047.0f, 1023.0f, 0.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) |
- (((UINT)N.vector4_f32[1] & 0x7FF) << 11) |
- (((UINT)N.vector4_f32[0] & 0x7FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleUHenDN3 = {2047.0f, 2047.0f*2048.0f,1023.0f*(2048.0f*2048.0f)/2.0f,1.0f};
- static const XMVECTORI32 MaskUHenDN3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUHenDN3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUHenDN3);
- // Do a horizontal or of 3 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1));
- // i = x|y
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1));
- // Add Z to itself to perform a single bit left shift
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUHenD3
-(
- XMUHEND3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {2047.0f, 2047.0f, 1023.0f, 0.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
-
- pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) |
- (((UINT)N.vector4_f32[1] & 0x7FF) << 11) |
- (((UINT)N.vector4_f32[0] & 0x7FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MaxUHenD3 = { 2047.0f, 2047.0f, 1023.0f, 1.0f};
- static const XMVECTORF32 ScaleUHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f)/2.0f,1.0f};
- static const XMVECTORI32 MaskUHenD3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,MaxUHenD3);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUHenD3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUHenD3);
- // Do a horizontal or of 3 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1));
- // i = x|y
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1));
- // Add Z to itself to perform a single bit left shift
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreHenDN3
-(
- XMHENDN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 511.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) |
- (((INT)N.vector4_f32[1] & 0x7FF) << 11) |
- (((INT)N.vector4_f32[0] & 0x7FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleHenDN3 = {1023.0f, 1023.0f*2048.0f,511.0f*(2048.0f*2048.0f),1.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleHenDN3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3);
- // Do a horizontal or of all 4 entries
- vResult = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreHenD3
-(
- XMHEND3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-1023.0f, -1023.0f, -511.0f, -1.0f};
- static CONST XMVECTOR Max = {1023.0f, 1023.0f, 511.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
-
- pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) |
- (((INT)N.vector4_f32[1] & 0x7FF) << 11) |
- (((INT)N.vector4_f32[0] & 0x7FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MinHenD3 = {-1023.0f,-1023.0f,-511.0f,-1.0f};
- static const XMVECTORF32 MaxHenD3 = { 1023.0f, 1023.0f, 511.0f, 1.0f};
- static const XMVECTORF32 ScaleHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f),1.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,MinHenD3);
- vResult = _mm_min_ps(vResult,MaxHenD3);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleHenD3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3);
- // Do a horizontal or of all 4 entries
- vResult = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUDHenN3
-(
- XMUDHENN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {1023.0f, 2047.0f, 2047.0f, 0.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) |
- (((UINT)N.vector4_f32[1] & 0x7FF) << 10) |
- (((UINT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleUDHenN3 = {1023.0f,2047.0f*1024.0f,2047.0f*(1024.0f*2048.0f)/2.0f,1.0f};
- static const XMVECTORI32 MaskUDHenN3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUDHenN3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUDHenN3);
- // Do a horizontal or of 3 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1));
- // i = x|y
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1));
- // Add Z to itself to perform a single bit left shift
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUDHen3
-(
- XMUDHEN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {1023.0f, 2047.0f, 2047.0f, 0.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
-
- pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) |
- (((UINT)N.vector4_f32[1] & 0x7FF) << 10) |
- (((UINT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MaxUDHen3 = { 1023.0f, 2047.0f, 2047.0f, 1.0f};
- static const XMVECTORF32 ScaleUDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f)/2.0f,1.0f};
- static const XMVECTORI32 MaskUDHen3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,MaxUDHen3);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUDHen3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUDHen3);
- // Do a horizontal or of 3 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1));
- // i = x|y
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1));
- // Add Z to itself to perform a single bit left shift
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreDHenN3
-(
- XMDHENN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {511.0f, 1023.0f, 1023.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) |
- (((INT)N.vector4_f32[1] & 0x7FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleDHenN3 = {511.0f, 1023.0f*1024.0f,1023.0f*(1024.0f*2048.0f),1.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleDHenN3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3);
- // Do a horizontal or of all 4 entries
- vResult = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreDHen3
-(
- XMDHEN3* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-511.0f, -1023.0f, -1023.0f, -1.0f};
- static CONST XMVECTOR Max = {511.0f, 1023.0f, 1023.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
-
- pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) |
- (((INT)N.vector4_f32[1] & 0x7FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MinDHen3 = {-511.0f,-1023.0f,-1023.0f,-1.0f};
- static const XMVECTORF32 MaxDHen3 = { 511.0f, 1023.0f, 1023.0f, 1.0f};
- static const XMVECTORF32 ScaleDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f),1.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,MinDHen3);
- vResult = _mm_min_ps(vResult,MaxDHen3);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleDHen3);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3);
- // Do a horizontal or of all 4 entries
- vResult = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreU565
-(
- XMU565* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // No SSE operations will write to 16-bit values, so we have to extract them manually
- USHORT x = static_cast<USHORT>(_mm_extract_epi16(vInt,0));
- USHORT y = static_cast<USHORT>(_mm_extract_epi16(vInt,2));
- USHORT z = static_cast<USHORT>(_mm_extract_epi16(vInt,4));
- pDestination->v = ((z & 0x1F) << 11) |
- ((y & 0x3F) << 5) |
- ((x & 0x1F));
-#else
- XMVECTOR N;
- static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max.v);
- N = XMVectorRound(N);
-
- pDestination->v = (((USHORT)N.vector4_f32[2] & 0x1F) << 11) |
- (((USHORT)N.vector4_f32[1] & 0x3F) << 5) |
- (((USHORT)N.vector4_f32[0] & 0x1F));
-#endif !_XM_SSE_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3PK
-(
- XMFLOAT3PK* pDestination,
- FXMVECTOR V
-)
-{
- _DECLSPEC_ALIGN_16_ UINT IValue[4];
- UINT I, Sign, j;
- UINT Result[3];
-
- XMASSERT(pDestination);
-
- XMStoreFloat3A( (XMFLOAT3A*)&IValue, V );
-
- // X & Y Channels (5-bit exponent, 6-bit mantissa)
- for(j=0; j < 2; ++j)
- {
- Sign = IValue[j] & 0x80000000;
- I = IValue[j] & 0x7FFFFFFF;
-
- if ((I & 0x7F800000) == 0x7F800000)
- {
- // INF or NAN
- Result[j] = 0x7c0;
- if (( I & 0x7FFFFF ) != 0)
- {
- Result[j] = 0x7c0 | (((I>>17)|(I>11)|(I>>6)|(I))&0x3f);
- }
- else if ( Sign )
- {
- // -INF is clamped to 0 since 3PK is positive only
- Result[j] = 0;
- }
- }
- else if ( Sign )
- {
- // 3PK is positive only, so clamp to zero
- Result[j] = 0;
- }
- else if (I > 0x477E0000U)
- {
- // The number is too large to be represented as a float11, set to max
- Result[j] = 0x7BF;
- }
- else
- {
- if (I < 0x38800000U)
- {
- // The number is too small to be represented as a normalized float11
- // Convert it to a denormalized value.
- UINT Shift = 113U - (I >> 23U);
- I = (0x800000U | (I & 0x7FFFFFU)) >> Shift;
- }
- else
- {
- // Rebias the exponent to represent the value as a normalized float11
- I += 0xC8000000U;
- }
-
- Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U)&0x7ffU;
- }
- }
-
- // Z Channel (5-bit exponent, 5-bit mantissa)
- Sign = IValue[2] & 0x80000000;
- I = IValue[2] & 0x7FFFFFFF;
-
- if ((I & 0x7F800000) == 0x7F800000)
- {
- // INF or NAN
- Result[2] = 0x3e0;
- if ( I & 0x7FFFFF )
- {
- Result[2] = 0x3e0 | (((I>>18)|(I>13)|(I>>3)|(I))&0x1f);
- }
- else if ( Sign )
- {
- // -INF is clamped to 0 since 3PK is positive only
- Result[2] = 0;
- }
- }
- else if ( Sign )
- {
- // 3PK is positive only, so clamp to zero
- Result[2] = 0;
- }
- else if (I > 0x477C0000U)
- {
- // The number is too large to be represented as a float10, set to max
- Result[2] = 0x3df;
- }
- else
- {
- if (I < 0x38800000U)
- {
- // The number is too small to be represented as a normalized float10
- // Convert it to a denormalized value.
- UINT Shift = 113U - (I >> 23U);
- I = (0x800000U | (I & 0x7FFFFFU)) >> Shift;
- }
- else
- {
- // Rebias the exponent to represent the value as a normalized float10
- I += 0xC8000000U;
- }
-
- Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U)&0x3ffU;
- }
-
- // Pack Result into memory
- pDestination->v = (Result[0] & 0x7ff)
- | ( (Result[1] & 0x7ff) << 11 )
- | ( (Result[2] & 0x3ff) << 22 );
-}
-
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3SE
-(
- XMFLOAT3SE* pDestination,
- FXMVECTOR V
-)
-{
- _DECLSPEC_ALIGN_16_ UINT IValue[4];
- UINT I, Sign, j, T;
- UINT Frac[3];
- UINT Exp[3];
-
-
- XMASSERT(pDestination);
-
- XMStoreFloat3A( (XMFLOAT3A*)&IValue, V );
-
- // X, Y, Z Channels (5-bit exponent, 9-bit mantissa)
- for(j=0; j < 3; ++j)
- {
- Sign = IValue[j] & 0x80000000;
- I = IValue[j] & 0x7FFFFFFF;
-
- if ((I & 0x7F800000) == 0x7F800000)
- {
- // INF or NAN
- Exp[j] = 0x1f;
- if (( I & 0x7FFFFF ) != 0)
- {
- Frac[j] = ((I>>14)|(I>5)|(I))&0x1ff;
- }
- else if ( Sign )
- {
- // -INF is clamped to 0 since 3SE is positive only
- Exp[j] = Frac[j] = 0;
- }
- }
- else if ( Sign )
- {
- // 3SE is positive only, so clamp to zero
- Exp[j] = Frac[j] = 0;
- }
- else if (I > 0x477FC000U)
- {
- // The number is too large, set to max
- Exp[j] = 0x1e;
- Frac[j] = 0x1ff;
- }
- else
- {
- if (I < 0x38800000U)
- {
- // The number is too small to be represented as a normalized float11
- // Convert it to a denormalized value.
- UINT Shift = 113U - (I >> 23U);
- I = (0x800000U | (I & 0x7FFFFFU)) >> Shift;
- }
- else
- {
- // Rebias the exponent to represent the value as a normalized float11
- I += 0xC8000000U;
- }
-
- T = ((I + 0x1FFFU + ((I >> 14U) & 1U)) >> 14U)&0x3fffU;
-
- Exp[j] = (T & 0x3E00) >> 9;
- Frac[j] = T & 0x1ff;
- }
- }
-
- // Adjust to a shared exponent
- T = XMMax( Exp[0], XMMax( Exp[1], Exp[2] ) );
-
- Frac[0] = Frac[0] >> (T - Exp[0]);
- Frac[1] = Frac[1] >> (T - Exp[1]);
- Frac[2] = Frac[2] >> (T - Exp[2]);
-
- // Store packed into memory
- pDestination->xm = Frac[0];
- pDestination->ym = Frac[1];
- pDestination->zm = Frac[2];
- pDestination->e = T;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt4
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
- pDestination[2] = V.vector4_u32[2];
- pDestination[3] = V.vector4_u32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
-
- _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt4A
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
- pDestination[2] = V.vector4_u32[2];
- pDestination[3] = V.vector4_u32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- _mm_store_si128( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreInt4NC
-(
- UINT* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination[0] = V.vector4_u32[0];
- pDestination[1] = V.vector4_u32[1];
- pDestination[2] = V.vector4_u32[2];
- pDestination[3] = V.vector4_u32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast<const __m128i *>(&V)[0] );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4
-(
- XMFLOAT4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
- pDestination->z = V.vector4_f32[2];
- pDestination->w = V.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
-
- _mm_storeu_ps( &pDestination->x, V );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4A
-(
- XMFLOAT4A* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
- pDestination->z = V.vector4_f32[2];
- pDestination->w = V.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- _mm_store_ps( &pDestination->x, V );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4NC
-(
- XMFLOAT4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- pDestination->x = V.vector4_f32[0];
- pDestination->y = V.vector4_f32[1];
- pDestination->z = V.vector4_f32[2];
- pDestination->w = V.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 3) == 0);
-
- _mm_storeu_ps( &pDestination->x, V );
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreHalf4
-(
- XMHALF4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]);
- pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]);
- pDestination->z = XMConvertFloatToHalf(V.vector4_f32[2]);
- pDestination->w = XMConvertFloatToHalf(V.vector4_f32[3]);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V));
- pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V));
- pDestination->z = XMConvertFloatToHalf(XMVectorGetZ(V));
- pDestination->w = XMConvertFloatToHalf(XMVectorGetW(V));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreShortN4
-(
- XMSHORTN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
- pDestination->z = (SHORT)N.vector4_f32[2];
- pDestination->w = (SHORT)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- vResult = _mm_mul_ps(vResult,Scale);
- __m128i vResulti = _mm_cvtps_epi32(vResult);
- vResulti = _mm_packs_epi32(vResulti,vResulti);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->x),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreShort4
-(
- XMSHORT4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f};
- static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
- pDestination->z = (SHORT)N.vector4_f32[2];
- pDestination->w = (SHORT)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f};
- static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,Min);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Pack the ints into shorts
- vInt = _mm_packs_epi32(vInt,vInt);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->x),reinterpret_cast<const __m128d *>(&vInt)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUShortN4
-(
- XMUSHORTN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v);
- N = XMVectorTruncate(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
- pDestination->z = (SHORT)N.vector4_f32[2];
- pDestination->w = (SHORT)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- vResult = _mm_mul_ps(vResult,Scale);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Since the SSE pack instruction clamps using signed rules,
- // manually extract the values to store them to memory
- pDestination->x = static_cast<SHORT>(_mm_extract_epi16(vInt,0));
- pDestination->y = static_cast<SHORT>(_mm_extract_epi16(vInt,2));
- pDestination->z = static_cast<SHORT>(_mm_extract_epi16(vInt,4));
- pDestination->w = static_cast<SHORT>(_mm_extract_epi16(vInt,6));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUShort4
-(
- XMUSHORT4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
- N = XMVectorRound(N);
-
- pDestination->x = (SHORT)N.vector4_f32[0];
- pDestination->y = (SHORT)N.vector4_f32[1];
- pDestination->z = (SHORT)N.vector4_f32[2];
- pDestination->w = (SHORT)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Since the SSE pack instruction clamps using signed rules,
- // manually extract the values to store them to memory
- pDestination->x = static_cast<SHORT>(_mm_extract_epi16(vInt,0));
- pDestination->y = static_cast<SHORT>(_mm_extract_epi16(vInt,2));
- pDestination->z = static_cast<SHORT>(_mm_extract_epi16(vInt,4));
- pDestination->w = static_cast<SHORT>(_mm_extract_epi16(vInt,6));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreXIcoN4
-(
- XMXICON4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f};
- static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 15.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->v = ((UINT64)N.vector4_f32[3] << 60) |
- (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((INT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 MinXIcoN4 = {-1.0f, 0.0f,-1.0f,-1.0f};
- static const XMVECTORF32 ScaleXIcoN4 = {524287.0f,15.0f*4096.0f*65536.0f*0.5f,524287.0f*4096.0f,524287.0f};
- static const XMVECTORI32 MaskXIcoN4 = {0xFFFFF,0xF<<((60-32)-1),0xFFFFF000,0xFFFFF};
-
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,MinXIcoN4);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleXIcoN4);
- // Convert to integer (w is unsigned)
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off unused bits
- vResulti = _mm_and_si128(vResulti,MaskXIcoN4);
- // Isolate Y
- __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY);
- // Double Y (Really W) to fixup for unsigned conversion
- vResulti = _mm_add_epi32(vResulti,vResulti2);
- // Shift y and z to straddle the 32-bit boundary
- vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreXIco4
-(
- XMXICO4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Min = {-524287.0f, -524287.0f, -524287.0f, 0.0f};
- static CONST XMVECTORF32 Max = {524287.0f, 524287.0f, 524287.0f, 15.0f};
-
- XMASSERT(pDestination);
- N = XMVectorClamp(V, Min.v, Max.v);
- pDestination->v = ((UINT64)N.vector4_f32[3] << 60) |
- (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((INT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 MinXIco4 = {-524287.0f, 0.0f,-524287.0f,-524287.0f};
- static const XMVECTORF32 MaxXIco4 = { 524287.0f,15.0f, 524287.0f, 524287.0f};
- static const XMVECTORF32 ScaleXIco4 = {1.0f,4096.0f*65536.0f*0.5f,4096.0f,1.0f};
- static const XMVECTORI32 MaskXIco4 = {0xFFFFF,0xF<<((60-1)-32),0xFFFFF000,0xFFFFF};
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,MinXIco4);
- vResult = _mm_min_ps(vResult,MaxXIco4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleXIco4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskXIco4);
- // Isolate Y
- __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY);
- // Double Y (Really W) to fixup for unsigned conversion
- vResulti = _mm_add_epi32(vResulti,vResulti2);
- // Shift y and z to straddle the 32-bit boundary
- vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUIcoN4
-(
- XMUICON4* pDestination,
- FXMVECTOR V
-)
-{
- #define XM_URange ((FLOAT)(1 << 20))
- #define XM_URangeDiv2 ((FLOAT)(1 << 19))
- #define XM_UMaxXYZ ((FLOAT)((1 << 20) - 1))
- #define XM_UMaxW ((FLOAT)((1 << 4) - 1))
- #define XM_ScaleXYZ (-(FLOAT)((1 << 20) - 1) / XM_PACK_FACTOR)
- #define XM_ScaleW (-(FLOAT)((1 << 4) - 1) / XM_PACK_FACTOR)
- #define XM_Scale (-1.0f / XM_PACK_FACTOR)
- #define XM_Offset (3.0f)
-
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v);
-
- pDestination->v = ((UINT64)N.vector4_f32[3] << 60) |
- (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((UINT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 ScaleUIcoN4 = {1048575.0f,15.0f*4096.0f*65536.0f,1048575.0f*4096.0f,1048575.0f};
- static const XMVECTORI32 MaskUIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF};
- static const XMVECTORF32 AddUIcoN4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUIcoN4);
- // Adjust for unsigned entries
- vResult = _mm_add_ps(vResult,AddUIcoN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Fix the signs on the unsigned entries
- vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUIcoN4);
- // Shift y and z to straddle the 32-bit boundary
- __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-
- #undef XM_URange
- #undef XM_URangeDiv2
- #undef XM_UMaxXYZ
- #undef XM_UMaxW
- #undef XM_ScaleXYZ
- #undef XM_ScaleW
- #undef XM_Scale
- #undef XM_Offset
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUIco4
-(
- XMUICO4* pDestination,
- FXMVECTOR V
-)
-{
- #define XM_Scale (-1.0f / XM_PACK_FACTOR)
- #define XM_URange ((FLOAT)(1 << 20))
- #define XM_URangeDiv2 ((FLOAT)(1 << 19))
-
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
- N = XMVectorRound(N);
-
- pDestination->v = ((UINT64)N.vector4_f32[3] << 60) |
- (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((UINT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 MaxUIco4 = { 1048575.0f, 15.0f, 1048575.0f, 1048575.0f};
- static const XMVECTORF32 ScaleUIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f};
- static const XMVECTORI32 MaskUIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF};
- static const XMVECTORF32 AddUIco4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f};
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,g_XMZero);
- vResult = _mm_min_ps(vResult,MaxUIco4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUIco4);
- vResult = _mm_add_ps(vResult,AddUIco4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUIco4);
- // Shift y and z to straddle the 32-bit boundary
- __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-
- #undef XM_Scale
- #undef XM_URange
- #undef XM_URangeDiv2
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreIcoN4
-(
- XMICON4* pDestination,
- FXMVECTOR V
-)
-{
- #define XM_Scale (-1.0f / XM_PACK_FACTOR)
- #define XM_URange ((FLOAT)(1 << 4))
- #define XM_Offset (3.0f)
- #define XM_UMaxXYZ ((FLOAT)((1 << (20 - 1)) - 1))
- #define XM_UMaxW ((FLOAT)((1 << (4 - 1)) - 1))
-
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 7.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiplyAdd(N, Scale.v, g_XMNegativeZero.v);
- N = XMVectorRound(N);
-
- pDestination->v = ((UINT64)N.vector4_f32[3] << 60) |
- (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((UINT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 ScaleIcoN4 = {524287.0f,7.0f*4096.0f*65536.0f,524287.0f*4096.0f,524287.0f};
- static const XMVECTORI32 MaskIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF};
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleIcoN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskIcoN4);
- // Shift y and z to straddle the 32-bit boundary
- __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-
- #undef XM_Scale
- #undef XM_URange
- #undef XM_Offset
- #undef XM_UMaxXYZ
- #undef XM_UMaxW
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreIco4
-(
- XMICO4* pDestination,
- FXMVECTOR V
-)
-{
- #define XM_Scale (-1.0f / XM_PACK_FACTOR)
- #define XM_URange ((FLOAT)(1 << 4))
- #define XM_Offset (3.0f)
-
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-524287.0f, -524287.0f, -524287.0f, -7.0f};
- static CONST XMVECTOR Max = {524287.0f, 524287.0f, 524287.0f, 7.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
- N = XMVectorRound(N);
-
- pDestination->v = ((INT64)N.vector4_f32[3] << 60) |
- (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) |
- (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) |
- (((INT64)N.vector4_f32[0] & 0xFFFFF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- // Note: Masks are x,w,y and z
- static const XMVECTORF32 MinIco4 = {-524287.0f,-7.0f,-524287.0f,-524287.0f};
- static const XMVECTORF32 MaxIco4 = { 524287.0f, 7.0f, 524287.0f, 524287.0f};
- static const XMVECTORF32 ScaleIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f};
- static const XMVECTORI32 MaskIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF};
- // Clamp to bounds
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0));
- vResult = _mm_max_ps(vResult,MinIco4);
- vResult = _mm_min_ps(vResult,MaxIco4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleIco4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskIco4);
- // Shift y and z to straddle the 32-bit boundary
- __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8);
- // Shift it into place
- vResulti2 = _mm_slli_si128(vResulti2,20/8);
- // i = x|y<<20|z<<40|w<<60
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_sd(reinterpret_cast<double *>(&pDestination->v),reinterpret_cast<const __m128d *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-
- #undef XM_Scale
- #undef XM_URange
- #undef XM_Offset
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreXDecN4
-(
- XMXDECN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f};
- static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 3.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->v = ((UINT)N.vector4_f32[3] << 30) |
- (((INT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((INT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f};
- static const XMVECTORF32 Scale = {511.0f, 511.0f*1024.0f, 511.0f*1048576.0f,3.0f*536870912.0f};
- static const XMVECTORI32 ScaleMask = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<29};
- XMASSERT(pDestination);
- XMVECTOR vResult = _mm_max_ps(V,Min);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,Scale);
- // Convert to int (W is unsigned)
- __m128i vResulti = _mm_cvtps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,ScaleMask);
- // To fix W, add itself to shift it up to <<30 instead of <<29
- __m128i vResultw = _mm_and_si128(vResulti,g_XMMaskW);
- vResulti = _mm_add_epi32(vResulti,vResultw);
- // Do a horizontal or of all 4 entries
- vResult = _mm_shuffle_ps(reinterpret_cast<const __m128 *>(&vResulti)[0],reinterpret_cast<const __m128 *>(&vResulti)[0],_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1));
- vResulti = _mm_or_si128(vResulti,reinterpret_cast<const __m128i *>(&vResult)[0]);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreXDec4
-(
- XMXDEC4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, 0.0f};
- static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 3.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
-
- pDestination->v = ((UINT)N.vector4_f32[3] << 30) |
- (((INT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((INT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MinXDec4 = {-511.0f,-511.0f,-511.0f, 0.0f};
- static const XMVECTORF32 MaxXDec4 = { 511.0f, 511.0f, 511.0f, 3.0f};
- static const XMVECTORF32 ScaleXDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f};
- static const XMVECTORI32 MaskXDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,MinXDec4);
- vResult = _mm_min_ps(vResult,MaxXDec4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleXDec4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskXDec4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // Perform a single bit left shift on y|w
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUDecN4
-(
- XMUDECN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 1023.0f, 3.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = ((UINT)N.vector4_f32[3] << 30) |
- (((UINT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((UINT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((UINT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleUDecN4 = {1023.0f,1023.0f*1024.0f*0.5f,1023.0f*1024.0f*1024.0f,3.0f*1024.0f*1024.0f*1024.0f*0.5f};
- static const XMVECTORI32 MaskUDecN4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUDecN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUDecN4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // Perform a left shift by one bit on y|w
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUDec4
-(
- XMUDEC4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {1023.0f, 1023.0f, 1023.0f, 3.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
-
- pDestination->v = ((UINT)N.vector4_f32[3] << 30) |
- (((UINT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((UINT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((UINT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MaxUDec4 = { 1023.0f, 1023.0f, 1023.0f, 3.0f};
- static const XMVECTORF32 ScaleUDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f};
- static const XMVECTORI32 MaskUDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,MaxUDec4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUDec4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUDec4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // Perform a left shift by one bit on y|w
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreDecN4
-(
- XMDECN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
- N = XMVectorMultiply(N, Scale.v);
-
- pDestination->v = ((INT)N.vector4_f32[3] << 30) |
- (((INT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((INT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleDecN4 = {511.0f,511.0f*1024.0f,511.0f*1024.0f*1024.0f,1.0f*1024.0f*1024.0f*1024.0f};
- static const XMVECTORI32 MaskDecN4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleDecN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskDecN4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreDec4
-(
- XMDEC4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, -1.0f};
- static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
-
- pDestination->v = ((INT)N.vector4_f32[3] << 30) |
- (((INT)N.vector4_f32[2] & 0x3FF) << 20) |
- (((INT)N.vector4_f32[1] & 0x3FF) << 10) |
- (((INT)N.vector4_f32[0] & 0x3FF));
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MinDec4 = {-511.0f,-511.0f,-511.0f,-1.0f};
- static const XMVECTORF32 MaxDec4 = { 511.0f, 511.0f, 511.0f, 1.0f};
- static const XMVECTORF32 ScaleDec4 = {1.0f,1024.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f};
- static const XMVECTORI32 MaskDec4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,MinDec4);
- vResult = _mm_min_ps(vResult,MaxDec4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleDec4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskDec4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUByteN4
-(
- XMUBYTEN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorSaturate(V);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->x = (BYTE)N.vector4_f32[0];
- pDestination->y = (BYTE)N.vector4_f32[1];
- pDestination->z = (BYTE)N.vector4_f32[2];
- pDestination->w = (BYTE)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleUByteN4 = {255.0f,255.0f*256.0f*0.5f,255.0f*256.0f*256.0f,255.0f*256.0f*256.0f*256.0f*0.5f};
- static const XMVECTORI32 MaskUByteN4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUByteN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUByteN4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // Perform a single bit left shift to fix y|w
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUByte4
-(
- XMUBYTE4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Max = {255.0f, 255.0f, 255.0f, 255.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max);
- N = XMVectorRound(N);
-
- pDestination->x = (BYTE)N.vector4_f32[0];
- pDestination->y = (BYTE)N.vector4_f32[1];
- pDestination->z = (BYTE)N.vector4_f32[2];
- pDestination->w = (BYTE)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MaxUByte4 = { 255.0f, 255.0f, 255.0f, 255.0f};
- static const XMVECTORF32 ScaleUByte4 = {1.0f,256.0f*0.5f,256.0f*256.0f,256.0f*256.0f*256.0f*0.5f};
- static const XMVECTORI32 MaskUByte4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,MaxUByte4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleUByte4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskUByte4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // Perform a single bit left shift to fix y|w
- vResulti2 = _mm_add_epi32(vResulti2,vResulti2);
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreByteN4
-(
- XMBYTEN4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {127.0f, 127.0f, 127.0f, 127.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorMultiply(V, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->x = (CHAR)N.vector4_f32[0];
- pDestination->y = (CHAR)N.vector4_f32[1];
- pDestination->z = (CHAR)N.vector4_f32[2];
- pDestination->w = (CHAR)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 ScaleByteN4 = {127.0f,127.0f*256.0f,127.0f*256.0f*256.0f,127.0f*256.0f*256.0f*256.0f};
- static const XMVECTORI32 MaskByteN4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne);
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleByteN4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskByteN4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreByte4
-(
- XMBYTE4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTOR Min = {-127.0f, -127.0f, -127.0f, -127.0f};
- static CONST XMVECTOR Max = {127.0f, 127.0f, 127.0f, 127.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, Min, Max);
- N = XMVectorRound(N);
-
- pDestination->x = (CHAR)N.vector4_f32[0];
- pDestination->y = (CHAR)N.vector4_f32[1];
- pDestination->z = (CHAR)N.vector4_f32[2];
- pDestination->w = (CHAR)N.vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static const XMVECTORF32 MinByte4 = {-127.0f,-127.0f,-127.0f,-127.0f};
- static const XMVECTORF32 MaxByte4 = { 127.0f, 127.0f, 127.0f, 127.0f};
- static const XMVECTORF32 ScaleByte4 = {1.0f,256.0f,256.0f*256.0f,256.0f*256.0f*256.0f};
- static const XMVECTORI32 MaskByte4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24};
- // Clamp to bounds
- XMVECTOR vResult = _mm_max_ps(V,MinByte4);
- vResult = _mm_min_ps(vResult,MaxByte4);
- // Scale by multiplication
- vResult = _mm_mul_ps(vResult,ScaleByte4);
- // Convert to int
- __m128i vResulti = _mm_cvttps_epi32(vResult);
- // Mask off any fraction
- vResulti = _mm_and_si128(vResulti,MaskByte4);
- // Do a horizontal or of 4 entries
- __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2));
- // x = x|z, y = y|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- // Move Z to the x position
- vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1));
- // i = x|y|z|w
- vResulti = _mm_or_si128(vResulti,vResulti2);
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->v),reinterpret_cast<const __m128 *>(&vResulti)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreUNibble4
-(
- XMUNIBBLE4* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // No SSE operations will write to 16-bit values, so we have to extract them manually
- USHORT x = static_cast<USHORT>(_mm_extract_epi16(vInt,0));
- USHORT y = static_cast<USHORT>(_mm_extract_epi16(vInt,2));
- USHORT z = static_cast<USHORT>(_mm_extract_epi16(vInt,4));
- USHORT w = static_cast<USHORT>(_mm_extract_epi16(vInt,6));
- pDestination->v = ((w & 0xF) << 12) |
- ((z & 0xF) << 8) |
- ((y & 0xF) << 4) |
- ((x & 0xF));
-#else
- XMVECTOR N;
- static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max.v);
- N = XMVectorRound(N);
-
- pDestination->v = (((USHORT)N.vector4_f32[3] & 0xF) << 12) |
- (((USHORT)N.vector4_f32[2] & 0xF) << 8) |
- (((USHORT)N.vector4_f32[1] & 0xF) << 4) |
- (((USHORT)N.vector4_f32[0] & 0xF));
-#endif !_XM_SSE_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreU555(
- XMU555* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f};
- // Bounds check
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- vResult = _mm_min_ps(vResult,Max);
- // Convert to int with rounding
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // No SSE operations will write to 16-bit values, so we have to extract them manually
- USHORT x = static_cast<USHORT>(_mm_extract_epi16(vInt,0));
- USHORT y = static_cast<USHORT>(_mm_extract_epi16(vInt,2));
- USHORT z = static_cast<USHORT>(_mm_extract_epi16(vInt,4));
- USHORT w = static_cast<USHORT>(_mm_extract_epi16(vInt,6));
- pDestination->v = ((w) ? 0x8000 : 0) |
- ((z & 0x1F) << 10) |
- ((y & 0x1F) << 5) |
- ((x & 0x1F));
-#else
- XMVECTOR N;
- static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorClamp(V, XMVectorZero(), Max.v);
- N = XMVectorRound(N);
-
- pDestination->v = ((N.vector4_f32[3] > 0.f) ? 0x8000 : 0) |
- (((USHORT)N.vector4_f32[2] & 0x1F) << 10) |
- (((USHORT)N.vector4_f32[1] & 0x1F) << 5) |
- (((USHORT)N.vector4_f32[0] & 0x1F));
-#endif !_XM_SSE_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreColor
-(
- XMCOLOR* pDestination,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f};
-
- XMASSERT(pDestination);
-
- N = XMVectorSaturate(V);
- N = XMVectorMultiply(N, Scale.v);
- N = XMVectorRound(N);
-
- pDestination->c = ((UINT)N.vector4_f32[3] << 24) |
- ((UINT)N.vector4_f32[0] << 16) |
- ((UINT)N.vector4_f32[1] << 8) |
- ((UINT)N.vector4_f32[2]);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- static CONST XMVECTORF32 Scale = {255.0f,255.0f,255.0f,255.0f};
- // Set <0 to 0
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- // Set>1 to 1
- vResult = _mm_min_ps(vResult,g_XMOne);
- // Convert to 0-255
- vResult = _mm_mul_ps(vResult,Scale);
- // Shuffle RGBA to ARGB
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2));
- // Convert to int
- __m128i vInt = _mm_cvtps_epi32(vResult);
- // Mash to shorts
- vInt = _mm_packs_epi32(vInt,vInt);
- // Mash to bytes
- vInt = _mm_packus_epi16(vInt,vInt);
- // Store the color
- _mm_store_ss(reinterpret_cast<float *>(&pDestination->c),reinterpret_cast<__m128 *>(&vInt)[0]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3x3
-(
- XMFLOAT3X3* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_)
-
- XMStoreFloat3x3NC(pDestination, M);
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat3x3NC
-(
- XMFLOAT3X3* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->m[0][0] = M.r[0].vector4_f32[0];
- pDestination->m[0][1] = M.r[0].vector4_f32[1];
- pDestination->m[0][2] = M.r[0].vector4_f32[2];
-
- pDestination->m[1][0] = M.r[1].vector4_f32[0];
- pDestination->m[1][1] = M.r[1].vector4_f32[1];
- pDestination->m[1][2] = M.r[1].vector4_f32[2];
-
- pDestination->m[2][0] = M.r[2].vector4_f32[0];
- pDestination->m[2][1] = M.r[2].vector4_f32[1];
- pDestination->m[2][2] = M.r[2].vector4_f32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMVECTOR vTemp1 = M.r[0];
- XMVECTOR vTemp2 = M.r[1];
- XMVECTOR vTemp3 = M.r[2];
- XMVECTOR vWork = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,0,2,2));
- vTemp1 = _mm_shuffle_ps(vTemp1,vWork,_MM_SHUFFLE(2,0,1,0));
- _mm_storeu_ps(&pDestination->m[0][0],vTemp1);
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1));
- _mm_storeu_ps(&pDestination->m[1][1],vTemp2);
- vTemp3 = _mm_shuffle_ps(vTemp3,vTemp3,_MM_SHUFFLE(2,2,2,2));
- _mm_store_ss(&pDestination->m[2][2],vTemp3);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x3
-(
- XMFLOAT4X3* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_)
-
- XMStoreFloat4x3NC(pDestination, M);
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x3A
-(
- XMFLOAT4X3A* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination->m[0][0] = M.r[0].vector4_f32[0];
- pDestination->m[0][1] = M.r[0].vector4_f32[1];
- pDestination->m[0][2] = M.r[0].vector4_f32[2];
-
- pDestination->m[1][0] = M.r[1].vector4_f32[0];
- pDestination->m[1][1] = M.r[1].vector4_f32[1];
- pDestination->m[1][2] = M.r[1].vector4_f32[2];
-
- pDestination->m[2][0] = M.r[2].vector4_f32[0];
- pDestination->m[2][1] = M.r[2].vector4_f32[1];
- pDestination->m[2][2] = M.r[2].vector4_f32[2];
-
- pDestination->m[3][0] = M.r[3].vector4_f32[0];
- pDestination->m[3][1] = M.r[3].vector4_f32[1];
- pDestination->m[3][2] = M.r[3].vector4_f32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
- // x1,y1,z1,w1
- XMVECTOR vTemp1 = M.r[0];
- // x2,y2,z2,w2
- XMVECTOR vTemp2 = M.r[1];
- // x3,y3,z3,w3
- XMVECTOR vTemp3 = M.r[2];
- // x4,y4,z4,w4
- XMVECTOR vTemp4 = M.r[3];
- // z1,z1,x2,y2
- XMVECTOR vTemp = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(1,0,2,2));
- // y2,z2,x3,y3 (Final)
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1));
- // x1,y1,z1,x2 (Final)
- vTemp1 = _mm_shuffle_ps(vTemp1,vTemp,_MM_SHUFFLE(2,0,1,0));
- // z3,z3,x4,x4
- vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2));
- // z3,x4,y4,z4 (Final)
- vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0));
- // Store in 3 operations
- _mm_store_ps(&pDestination->m[0][0],vTemp1);
- _mm_store_ps(&pDestination->m[1][1],vTemp2);
- _mm_store_ps(&pDestination->m[2][2],vTemp3);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x3NC
-(
- XMFLOAT4X3* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->m[0][0] = M.r[0].vector4_f32[0];
- pDestination->m[0][1] = M.r[0].vector4_f32[1];
- pDestination->m[0][2] = M.r[0].vector4_f32[2];
-
- pDestination->m[1][0] = M.r[1].vector4_f32[0];
- pDestination->m[1][1] = M.r[1].vector4_f32[1];
- pDestination->m[1][2] = M.r[1].vector4_f32[2];
-
- pDestination->m[2][0] = M.r[2].vector4_f32[0];
- pDestination->m[2][1] = M.r[2].vector4_f32[1];
- pDestination->m[2][2] = M.r[2].vector4_f32[2];
-
- pDestination->m[3][0] = M.r[3].vector4_f32[0];
- pDestination->m[3][1] = M.r[3].vector4_f32[1];
- pDestination->m[3][2] = M.r[3].vector4_f32[2];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- XMVECTOR vTemp1 = M.r[0];
- XMVECTOR vTemp2 = M.r[1];
- XMVECTOR vTemp3 = M.r[2];
- XMVECTOR vTemp4 = M.r[3];
- XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1));
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(2,2,0,0));
- vTemp1 = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,2,1,0));
- vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2));
- vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0));
- _mm_storeu_ps(&pDestination->m[0][0],vTemp1);
- _mm_storeu_ps(&pDestination->m[1][1],vTemp2x);
- _mm_storeu_ps(&pDestination->m[2][2],vTemp3);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x4
-(
- XMFLOAT4X4* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-
- XMStoreFloat4x4NC(pDestination, M);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
-
- _mm_storeu_ps( &pDestination->_11, M.r[0] );
- _mm_storeu_ps( &pDestination->_21, M.r[1] );
- _mm_storeu_ps( &pDestination->_31, M.r[2] );
- _mm_storeu_ps( &pDestination->_41, M.r[3] );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x4A
-(
- XMFLOAT4X4A* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
- XMASSERT(((UINT_PTR)pDestination & 0xF) == 0);
-
- pDestination->m[0][0] = M.r[0].vector4_f32[0];
- pDestination->m[0][1] = M.r[0].vector4_f32[1];
- pDestination->m[0][2] = M.r[0].vector4_f32[2];
- pDestination->m[0][3] = M.r[0].vector4_f32[3];
-
- pDestination->m[1][0] = M.r[1].vector4_f32[0];
- pDestination->m[1][1] = M.r[1].vector4_f32[1];
- pDestination->m[1][2] = M.r[1].vector4_f32[2];
- pDestination->m[1][3] = M.r[1].vector4_f32[3];
-
- pDestination->m[2][0] = M.r[2].vector4_f32[0];
- pDestination->m[2][1] = M.r[2].vector4_f32[1];
- pDestination->m[2][2] = M.r[2].vector4_f32[2];
- pDestination->m[2][3] = M.r[2].vector4_f32[3];
-
- pDestination->m[3][0] = M.r[3].vector4_f32[0];
- pDestination->m[3][1] = M.r[3].vector4_f32[1];
- pDestination->m[3][2] = M.r[3].vector4_f32[2];
- pDestination->m[3][3] = M.r[3].vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
-
- _mm_store_ps( &pDestination->_11, M.r[0] );
- _mm_store_ps( &pDestination->_21, M.r[1] );
- _mm_store_ps( &pDestination->_31, M.r[2] );
- _mm_store_ps( &pDestination->_41, M.r[3] );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMStoreFloat4x4NC
-(
- XMFLOAT4X4* pDestination,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMASSERT(pDestination);
-
- pDestination->m[0][0] = M.r[0].vector4_f32[0];
- pDestination->m[0][1] = M.r[0].vector4_f32[1];
- pDestination->m[0][2] = M.r[0].vector4_f32[2];
- pDestination->m[0][3] = M.r[0].vector4_f32[3];
-
- pDestination->m[1][0] = M.r[1].vector4_f32[0];
- pDestination->m[1][1] = M.r[1].vector4_f32[1];
- pDestination->m[1][2] = M.r[1].vector4_f32[2];
- pDestination->m[1][3] = M.r[1].vector4_f32[3];
-
- pDestination->m[2][0] = M.r[2].vector4_f32[0];
- pDestination->m[2][1] = M.r[2].vector4_f32[1];
- pDestination->m[2][2] = M.r[2].vector4_f32[2];
- pDestination->m[2][3] = M.r[2].vector4_f32[3];
-
- pDestination->m[3][0] = M.r[3].vector4_f32[0];
- pDestination->m[3][1] = M.r[3].vector4_f32[1];
- pDestination->m[3][2] = M.r[3].vector4_f32[2];
- pDestination->m[3][3] = M.r[3].vector4_f32[3];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDestination);
- _mm_storeu_ps(&pDestination->m[0][0],M.r[0]);
- _mm_storeu_ps(&pDestination->m[1][0],M.r[1]);
- _mm_storeu_ps(&pDestination->m[2][0],M.r[2]);
- _mm_storeu_ps(&pDestination->m[3][0],M.r[3]);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-#endif // __XNAMATHCONVERT_INL__
-
diff --git a/3rdparty/dxsdk/Include/xnamathmatrix.inl b/3rdparty/dxsdk/Include/xnamathmatrix.inl
deleted file mode 100644
index 7ce4c1f238e..00000000000
--- a/3rdparty/dxsdk/Include/xnamathmatrix.inl
+++ /dev/null
@@ -1,3254 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- xnamathmatrix.inl
-
-Abstract:
-
- XNA math library for Windows and Xbox 360: Matrix functions
---*/
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#ifndef __XNAMATHMATRIX_INL__
-#define __XNAMATHMATRIX_INL__
-
-/****************************************************************************
- *
- * Matrix
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-// Return TRUE if any entry in the matrix is NaN
-XMFINLINE BOOL XMMatrixIsNaN
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT i, uTest;
- const UINT *pWork;
-
- i = 16;
- pWork = (const UINT *)(&M.m[0][0]);
- do {
- // Fetch value into integer unit
- uTest = pWork[0];
- // Remove sign
- uTest &= 0x7FFFFFFFU;
- // NaN is 0x7F800001 through 0x7FFFFFFF inclusive
- uTest -= 0x7F800001U;
- if (uTest<0x007FFFFFU) {
- break; // NaN found
- }
- ++pWork; // Next entry
- } while (--i);
- return (i!=0); // i == 0 if nothing matched
-#elif defined(_XM_SSE_INTRINSICS_)
- // Load in registers
- XMVECTOR vX = M.r[0];
- XMVECTOR vY = M.r[1];
- XMVECTOR vZ = M.r[2];
- XMVECTOR vW = M.r[3];
- // Test themselves to check for NaN
- vX = _mm_cmpneq_ps(vX,vX);
- vY = _mm_cmpneq_ps(vY,vY);
- vZ = _mm_cmpneq_ps(vZ,vZ);
- vW = _mm_cmpneq_ps(vW,vW);
- // Or all the results
- vX = _mm_or_ps(vX,vZ);
- vY = _mm_or_ps(vY,vW);
- vX = _mm_or_ps(vX,vY);
- // If any tested true, return true
- return (_mm_movemask_ps(vX)!=0);
-#else
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-// Return TRUE if any entry in the matrix is +/-INF
-XMFINLINE BOOL XMMatrixIsInfinite
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT i, uTest;
- const UINT *pWork;
-
- i = 16;
- pWork = (const UINT *)(&M.m[0][0]);
- do {
- // Fetch value into integer unit
- uTest = pWork[0];
- // Remove sign
- uTest &= 0x7FFFFFFFU;
- // INF is 0x7F800000
- if (uTest==0x7F800000U) {
- break; // INF found
- }
- ++pWork; // Next entry
- } while (--i);
- return (i!=0); // i == 0 if nothing matched
-#elif defined(_XM_SSE_INTRINSICS_)
- // Mask off the sign bits
- XMVECTOR vTemp1 = _mm_and_ps(M.r[0],g_XMAbsMask);
- XMVECTOR vTemp2 = _mm_and_ps(M.r[1],g_XMAbsMask);
- XMVECTOR vTemp3 = _mm_and_ps(M.r[2],g_XMAbsMask);
- XMVECTOR vTemp4 = _mm_and_ps(M.r[3],g_XMAbsMask);
- // Compare to infinity
- vTemp1 = _mm_cmpeq_ps(vTemp1,g_XMInfinity);
- vTemp2 = _mm_cmpeq_ps(vTemp2,g_XMInfinity);
- vTemp3 = _mm_cmpeq_ps(vTemp3,g_XMInfinity);
- vTemp4 = _mm_cmpeq_ps(vTemp4,g_XMInfinity);
- // Or the answers together
- vTemp1 = _mm_or_ps(vTemp1,vTemp2);
- vTemp3 = _mm_or_ps(vTemp3,vTemp4);
- vTemp1 = _mm_or_ps(vTemp1,vTemp3);
- // If any are infinity, the signs are true.
- return (_mm_movemask_ps(vTemp1)!=0);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Return TRUE if the XMMatrix is equal to identity
-XMFINLINE BOOL XMMatrixIsIdentity
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- unsigned int uOne, uZero;
- const unsigned int *pWork;
-
- // Use the integer pipeline to reduce branching to a minimum
- pWork = (const unsigned int*)(&M.m[0][0]);
- // Convert 1.0f to zero and or them together
- uOne = pWork[0]^0x3F800000U;
- // Or all the 0.0f entries together
- uZero = pWork[1];
- uZero |= pWork[2];
- uZero |= pWork[3];
- // 2nd row
- uZero |= pWork[4];
- uOne |= pWork[5]^0x3F800000U;
- uZero |= pWork[6];
- uZero |= pWork[7];
- // 3rd row
- uZero |= pWork[8];
- uZero |= pWork[9];
- uOne |= pWork[10]^0x3F800000U;
- uZero |= pWork[11];
- // 4th row
- uZero |= pWork[12];
- uZero |= pWork[13];
- uZero |= pWork[14];
- uOne |= pWork[15]^0x3F800000U;
- // If all zero entries are zero, the uZero==0
- uZero &= 0x7FFFFFFF; // Allow -0.0f
- // If all 1.0f entries are 1.0f, then uOne==0
- uOne |= uZero;
- return (uOne==0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0],g_XMIdentityR0);
- XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1],g_XMIdentityR1);
- XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2],g_XMIdentityR2);
- XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3],g_XMIdentityR3);
- vTemp1 = _mm_and_ps(vTemp1,vTemp2);
- vTemp3 = _mm_and_ps(vTemp3,vTemp4);
- vTemp1 = _mm_and_ps(vTemp1,vTemp3);
- return (_mm_movemask_ps(vTemp1)==0x0f);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Perform a 4x4 matrix multiply by a 4x4 matrix
-XMFINLINE XMMATRIX XMMatrixMultiply
-(
- CXMMATRIX M1,
- CXMMATRIX M2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX mResult;
- // Cache the invariants in registers
- float x = M1.m[0][0];
- float y = M1.m[0][1];
- float z = M1.m[0][2];
- float w = M1.m[0][3];
- // Perform the operation on the first row
- mResult.m[0][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w);
- mResult.m[0][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w);
- mResult.m[0][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w);
- mResult.m[0][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w);
- // Repeat for all the other rows
- x = M1.m[1][0];
- y = M1.m[1][1];
- z = M1.m[1][2];
- w = M1.m[1][3];
- mResult.m[1][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w);
- mResult.m[1][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w);
- mResult.m[1][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w);
- mResult.m[1][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w);
- x = M1.m[2][0];
- y = M1.m[2][1];
- z = M1.m[2][2];
- w = M1.m[2][3];
- mResult.m[2][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w);
- mResult.m[2][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w);
- mResult.m[2][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w);
- mResult.m[2][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w);
- x = M1.m[3][0];
- y = M1.m[3][1];
- z = M1.m[3][2];
- w = M1.m[3][3];
- mResult.m[3][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w);
- mResult.m[3][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w);
- mResult.m[3][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w);
- mResult.m[3][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w);
- return mResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX mResult;
- // Use vW to hold the original row
- XMVECTOR vW = M1.r[0];
- // Splat the component X,Y,Z then W
- XMVECTOR vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0));
- XMVECTOR vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2));
- vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3));
- // Perform the opertion on the first row
- vX = _mm_mul_ps(vX,M2.r[0]);
- vY = _mm_mul_ps(vY,M2.r[1]);
- vZ = _mm_mul_ps(vZ,M2.r[2]);
- vW = _mm_mul_ps(vW,M2.r[3]);
- // Perform a binary add to reduce cumulative errors
- vX = _mm_add_ps(vX,vZ);
- vY = _mm_add_ps(vY,vW);
- vX = _mm_add_ps(vX,vY);
- mResult.r[0] = vX;
- // Repeat for the other 3 rows
- vW = M1.r[1];
- vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0));
- vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1));
- vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2));
- vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3));
- vX = _mm_mul_ps(vX,M2.r[0]);
- vY = _mm_mul_ps(vY,M2.r[1]);
- vZ = _mm_mul_ps(vZ,M2.r[2]);
- vW = _mm_mul_ps(vW,M2.r[3]);
- vX = _mm_add_ps(vX,vZ);
- vY = _mm_add_ps(vY,vW);
- vX = _mm_add_ps(vX,vY);
- mResult.r[1] = vX;
- vW = M1.r[2];
- vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0));
- vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1));
- vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2));
- vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3));
- vX = _mm_mul_ps(vX,M2.r[0]);
- vY = _mm_mul_ps(vY,M2.r[1]);
- vZ = _mm_mul_ps(vZ,M2.r[2]);
- vW = _mm_mul_ps(vW,M2.r[3]);
- vX = _mm_add_ps(vX,vZ);
- vY = _mm_add_ps(vY,vW);
- vX = _mm_add_ps(vX,vY);
- mResult.r[2] = vX;
- vW = M1.r[3];
- vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0));
- vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1));
- vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2));
- vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3));
- vX = _mm_mul_ps(vX,M2.r[0]);
- vY = _mm_mul_ps(vY,M2.r[1]);
- vZ = _mm_mul_ps(vZ,M2.r[2]);
- vW = _mm_mul_ps(vW,M2.r[3]);
- vX = _mm_add_ps(vX,vZ);
- vY = _mm_add_ps(vY,vW);
- vX = _mm_add_ps(vX,vY);
- mResult.r[3] = vX;
- return mResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixMultiplyTranspose
-(
- CXMMATRIX M1,
- CXMMATRIX M2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX mResult;
- // Cache the invariants in registers
- float x = M2.m[0][0];
- float y = M2.m[1][0];
- float z = M2.m[2][0];
- float w = M2.m[3][0];
- // Perform the operation on the first row
- mResult.m[0][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w);
- mResult.m[0][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w);
- mResult.m[0][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w);
- mResult.m[0][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w);
- // Repeat for all the other rows
- x = M2.m[0][1];
- y = M2.m[1][1];
- z = M2.m[2][1];
- w = M2.m[3][1];
- mResult.m[1][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w);
- mResult.m[1][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w);
- mResult.m[1][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w);
- mResult.m[1][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w);
- x = M2.m[0][2];
- y = M2.m[1][2];
- z = M2.m[2][2];
- w = M2.m[3][2];
- mResult.m[2][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w);
- mResult.m[2][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w);
- mResult.m[2][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w);
- mResult.m[2][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w);
- x = M2.m[0][3];
- y = M2.m[1][3];
- z = M2.m[2][3];
- w = M2.m[3][3];
- mResult.m[3][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w);
- mResult.m[3][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w);
- mResult.m[3][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w);
- mResult.m[3][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w);
- return mResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX Product;
- XMMATRIX Result;
- Product = XMMatrixMultiply(M1, M2);
- Result = XMMatrixTranspose(Product);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixTranspose
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX P;
- XMMATRIX MT;
-
- // Original matrix:
- //
- // m00m01m02m03
- // m10m11m12m13
- // m20m21m22m23
- // m30m31m32m33
-
- P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21
- P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31
- P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23
- P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33
-
- MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30
- MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31
- MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32
- MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33
-
- return MT;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // x.x,x.y,y.x,y.y
- XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(1,0,1,0));
- // x.z,x.w,y.z,y.w
- XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(3,2,3,2));
- // z.x,z.y,w.x,w.y
- XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(1,0,1,0));
- // z.z,z.w,w.z,w.w
- XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(3,2,3,2));
- XMMATRIX mResult;
-
- // x.x,y.x,z.x,w.x
- mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(2,0,2,0));
- // x.y,y.y,z.y,w.y
- mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(3,1,3,1));
- // x.z,y.z,z.z,w.z
- mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(2,0,2,0));
- // x.w,y.w,z.w,w.w
- mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(3,1,3,1));
- return mResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return the inverse and the determinant of a 4x4 matrix
-XMINLINE XMMATRIX XMMatrixInverse
-(
- XMVECTOR* pDeterminant,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX R;
- XMMATRIX MT;
- XMVECTOR D0, D1, D2;
- XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7;
- XMVECTOR V0[4], V1[4];
- XMVECTOR Determinant;
- XMVECTOR Reciprocal;
- XMMATRIX Result;
- static CONST XMVECTORU32 SwizzleXXYY = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 SwizzleZWZW = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W};
- static CONST XMVECTORU32 SwizzleYZXY = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 SwizzleZWYZ = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 SwizzleWXWX = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_0X};
- static CONST XMVECTORU32 SwizzleZXYX = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X};
- static CONST XMVECTORU32 SwizzleYWXZ = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 SwizzleWZWY = {XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 Permute0X0Z1X1Z = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Z};
- static CONST XMVECTORU32 Permute0Y0W1Y1W = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_1W};
- static CONST XMVECTORU32 Permute1Y0Y0W0X = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X};
- static CONST XMVECTORU32 Permute0W0X0Y1X = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X};
- static CONST XMVECTORU32 Permute0Z1Y1X0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1X, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 Permute0W1Y0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 Permute0Z0Y1X0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0X};
- static CONST XMVECTORU32 Permute1Y0X0W1X = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1X};
- static CONST XMVECTORU32 Permute1W0Y0W0X = {XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X};
- static CONST XMVECTORU32 Permute0W0X0Y1Z = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1Z};
- static CONST XMVECTORU32 Permute0Z1W1Z0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1W, XM_PERMUTE_1Z, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 Permute0W1W0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 Permute0Z0Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1Z, XM_PERMUTE_0X};
- static CONST XMVECTORU32 Permute1W0X0W1Z = {XM_PERMUTE_1W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z};
-
- XMASSERT(pDeterminant);
-
- MT = XMMatrixTranspose(M);
-
- V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleXXYY.v);
- V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWZW.v);
- V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleXXYY.v);
- V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWZW.v);
- V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0X0Z1X1Z.v);
- V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0Y0W1Y1W.v);
-
- D0 = XMVectorMultiply(V0[0], V1[0]);
- D1 = XMVectorMultiply(V0[1], V1[1]);
- D2 = XMVectorMultiply(V0[2], V1[2]);
-
- V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZWZW.v);
- V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleXXYY.v);
- V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZWZW.v);
- V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleXXYY.v);
- V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0Y0W1Y1W.v);
- V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0X0Z1X1Z.v);
-
- D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0);
- D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1);
- D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2);
-
- V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleYZXY.v);
- V1[0] = XMVectorPermute(D0, D2, Permute1Y0Y0W0X.v);
- V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZXYX.v);
- V1[1] = XMVectorPermute(D0, D2, Permute0W1Y0Y0Z.v);
- V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleYZXY.v);
- V1[2] = XMVectorPermute(D1, D2, Permute1W0Y0W0X.v);
- V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZXYX.v);
- V1[3] = XMVectorPermute(D1, D2, Permute0W1W0Y0Z.v);
-
- C0 = XMVectorMultiply(V0[0], V1[0]);
- C2 = XMVectorMultiply(V0[1], V1[1]);
- C4 = XMVectorMultiply(V0[2], V1[2]);
- C6 = XMVectorMultiply(V0[3], V1[3]);
-
- V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWYZ.v);
- V1[0] = XMVectorPermute(D0, D2, Permute0W0X0Y1X.v);
- V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleWZWY.v);
- V1[1] = XMVectorPermute(D0, D2, Permute0Z0Y1X0X.v);
- V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWYZ.v);
- V1[2] = XMVectorPermute(D1, D2, Permute0W0X0Y1Z.v);
- V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleWZWY.v);
- V1[3] = XMVectorPermute(D1, D2, Permute0Z0Y1Z0X.v);
-
- C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0);
- C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2);
- C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4);
- C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6);
-
- V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleWXWX.v);
- V1[0] = XMVectorPermute(D0, D2, Permute0Z1Y1X0Z.v);
- V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleYWXZ.v);
- V1[1] = XMVectorPermute(D0, D2, Permute1Y0X0W1X.v);
- V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleWXWX.v);
- V1[2] = XMVectorPermute(D1, D2, Permute0Z1W1Z0Z.v);
- V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleYWXZ.v);
- V1[3] = XMVectorPermute(D1, D2, Permute1W0X0W1Z.v);
-
- C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0);
- C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0);
- C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2);
- C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2);
- C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4);
- C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4);
- C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6);
- C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6);
-
- R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v);
- R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v);
- R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v);
- R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v);
-
- Determinant = XMVector4Dot(R.r[0], MT.r[0]);
-
- *pDeterminant = Determinant;
-
- Reciprocal = XMVectorReciprocal(Determinant);
-
- Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal);
- Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal);
- Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal);
- Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pDeterminant);
- XMMATRIX MT = XMMatrixTranspose(M);
- XMVECTOR V00 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,1,0,0));
- XMVECTOR V10 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(3,2,3,2));
- XMVECTOR V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,1,0,0));
- XMVECTOR V11 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(3,2,3,2));
- XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0],_MM_SHUFFLE(2,0,2,0));
- XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1],_MM_SHUFFLE(3,1,3,1));
-
- XMVECTOR D0 = _mm_mul_ps(V00,V10);
- XMVECTOR D1 = _mm_mul_ps(V01,V11);
- XMVECTOR D2 = _mm_mul_ps(V02,V12);
-
- V00 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(3,2,3,2));
- V10 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(1,1,0,0));
- V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(3,2,3,2));
- V11 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(1,1,0,0));
- V02 = _mm_shuffle_ps(MT.r[2],MT.r[0],_MM_SHUFFLE(3,1,3,1));
- V12 = _mm_shuffle_ps(MT.r[3],MT.r[1],_MM_SHUFFLE(2,0,2,0));
-
- V00 = _mm_mul_ps(V00,V10);
- V01 = _mm_mul_ps(V01,V11);
- V02 = _mm_mul_ps(V02,V12);
- D0 = _mm_sub_ps(D0,V00);
- D1 = _mm_sub_ps(D1,V01);
- D2 = _mm_sub_ps(D2,V02);
- // V11 = D0Y,D0W,D2Y,D2Y
- V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,1,3,1));
- V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(1,0,2,1));
- V10 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(0,3,0,2));
- V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(0,1,0,2));
- V11 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(2,1,2,1));
- // V13 = D1Y,D1W,D2W,D2W
- XMVECTOR V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,3,3,1));
- V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(1,0,2,1));
- V12 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(0,3,0,2));
- XMVECTOR V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(0,1,0,2));
- V13 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(2,1,2,1));
-
- XMVECTOR C0 = _mm_mul_ps(V00,V10);
- XMVECTOR C2 = _mm_mul_ps(V01,V11);
- XMVECTOR C4 = _mm_mul_ps(V02,V12);
- XMVECTOR C6 = _mm_mul_ps(V03,V13);
-
- // V11 = D0X,D0Y,D2X,D2X
- V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(0,0,1,0));
- V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(2,1,3,2));
- V10 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(2,1,0,3));
- V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,3,2,3));
- V11 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(0,2,1,2));
- // V13 = D1X,D1Y,D2Z,D2Z
- V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(2,2,1,0));
- V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(2,1,3,2));
- V12 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(2,1,0,3));
- V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,3,2,3));
- V13 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(0,2,1,2));
-
- V00 = _mm_mul_ps(V00,V10);
- V01 = _mm_mul_ps(V01,V11);
- V02 = _mm_mul_ps(V02,V12);
- V03 = _mm_mul_ps(V03,V13);
- C0 = _mm_sub_ps(C0,V00);
- C2 = _mm_sub_ps(C2,V01);
- C4 = _mm_sub_ps(C4,V02);
- C6 = _mm_sub_ps(C6,V03);
-
- V00 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(0,3,0,3));
- // V10 = D0Z,D0Z,D2X,D2Y
- V10 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,2,2));
- V10 = _mm_shuffle_ps(V10,V10,_MM_SHUFFLE(0,2,3,0));
- V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(2,0,3,1));
- // V11 = D0X,D0W,D2X,D2Y
- V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,3,0));
- V11 = _mm_shuffle_ps(V11,V11,_MM_SHUFFLE(2,1,0,3));
- V02 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(0,3,0,3));
- // V12 = D1Z,D1Z,D2Z,D2W
- V12 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,2,2));
- V12 = _mm_shuffle_ps(V12,V12,_MM_SHUFFLE(0,2,3,0));
- V03 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(2,0,3,1));
- // V13 = D1X,D1W,D2Z,D2W
- V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,3,0));
- V13 = _mm_shuffle_ps(V13,V13,_MM_SHUFFLE(2,1,0,3));
-
- V00 = _mm_mul_ps(V00,V10);
- V01 = _mm_mul_ps(V01,V11);
- V02 = _mm_mul_ps(V02,V12);
- V03 = _mm_mul_ps(V03,V13);
- XMVECTOR C1 = _mm_sub_ps(C0,V00);
- C0 = _mm_add_ps(C0,V00);
- XMVECTOR C3 = _mm_add_ps(C2,V01);
- C2 = _mm_sub_ps(C2,V01);
- XMVECTOR C5 = _mm_sub_ps(C4,V02);
- C4 = _mm_add_ps(C4,V02);
- XMVECTOR C7 = _mm_add_ps(C6,V03);
- C6 = _mm_sub_ps(C6,V03);
-
- C0 = _mm_shuffle_ps(C0,C1,_MM_SHUFFLE(3,1,2,0));
- C2 = _mm_shuffle_ps(C2,C3,_MM_SHUFFLE(3,1,2,0));
- C4 = _mm_shuffle_ps(C4,C5,_MM_SHUFFLE(3,1,2,0));
- C6 = _mm_shuffle_ps(C6,C7,_MM_SHUFFLE(3,1,2,0));
- C0 = _mm_shuffle_ps(C0,C0,_MM_SHUFFLE(3,1,2,0));
- C2 = _mm_shuffle_ps(C2,C2,_MM_SHUFFLE(3,1,2,0));
- C4 = _mm_shuffle_ps(C4,C4,_MM_SHUFFLE(3,1,2,0));
- C6 = _mm_shuffle_ps(C6,C6,_MM_SHUFFLE(3,1,2,0));
- // Get the determinate
- XMVECTOR vTemp = XMVector4Dot(C0,MT.r[0]);
- *pDeterminant = vTemp;
- vTemp = _mm_div_ps(g_XMOne,vTemp);
- XMMATRIX mResult;
- mResult.r[0] = _mm_mul_ps(C0,vTemp);
- mResult.r[1] = _mm_mul_ps(C2,vTemp);
- mResult.r[2] = _mm_mul_ps(C4,vTemp);
- mResult.r[3] = _mm_mul_ps(C6,vTemp);
- return mResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMMatrixDeterminant
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V0, V1, V2, V3, V4, V5;
- XMVECTOR P0, P1, P2, R, S;
- XMVECTOR Result;
- static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X};
- static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z};
- static CONST XMVECTOR Sign = {1.0f, -1.0f, 1.0f, -1.0f};
-
- V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v);
- V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v);
- V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v);
- V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v);
- V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v);
- V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v);
-
- P0 = XMVectorMultiply(V0, V1);
- P1 = XMVectorMultiply(V2, V3);
- P2 = XMVectorMultiply(V4, V5);
-
- V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v);
- V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v);
- V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v);
- V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v);
- V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v);
- V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v);
-
- P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0);
- P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1);
- P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2);
-
- V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ.v);
- V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY.v);
- V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX.v);
-
- S = XMVectorMultiply(M.r[0], Sign);
- R = XMVectorMultiply(V0, P0);
- R = XMVectorNegativeMultiplySubtract(V1, P1, R);
- R = XMVectorMultiplyAdd(V2, P2, R);
-
- Result = XMVector4Dot(S, R);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V0, V1, V2, V3, V4, V5;
- XMVECTOR P0, P1, P2, R, S;
- XMVECTOR Result;
- static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X};
- static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z};
- static CONST XMVECTORF32 Sign = {1.0f, -1.0f, 1.0f, -1.0f};
-
- V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX);
- V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY);
- V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX);
- V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ);
- V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY);
- V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ);
-
- P0 = _mm_mul_ps(V0, V1);
- P1 = _mm_mul_ps(V2, V3);
- P2 = _mm_mul_ps(V4, V5);
-
- V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY);
- V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX);
- V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ);
- V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX);
- V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ);
- V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY);
-
- P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0);
- P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1);
- P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2);
-
- V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ);
- V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY);
- V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX);
-
- S = _mm_mul_ps(M.r[0], Sign);
- R = _mm_mul_ps(V0, P0);
- R = XMVectorNegativeMultiplySubtract(V1, P1, R);
- R = XMVectorMultiplyAdd(V2, P2, R);
-
- Result = XMVector4Dot(S, R);
-
- return Result;
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-#define XMRANKDECOMPOSE(a, b, c, x, y, z) \
- if((x) < (y)) \
- { \
- if((y) < (z)) \
- { \
- (a) = 2; \
- (b) = 1; \
- (c) = 0; \
- } \
- else \
- { \
- (a) = 1; \
- \
- if((x) < (z)) \
- { \
- (b) = 2; \
- (c) = 0; \
- } \
- else \
- { \
- (b) = 0; \
- (c) = 2; \
- } \
- } \
- } \
- else \
- { \
- if((x) < (z)) \
- { \
- (a) = 2; \
- (b) = 0; \
- (c) = 1; \
- } \
- else \
- { \
- (a) = 0; \
- \
- if((y) < (z)) \
- { \
- (b) = 2; \
- (c) = 1; \
- } \
- else \
- { \
- (b) = 1; \
- (c) = 2; \
- } \
- } \
- }
-
-#define XM_DECOMP_EPSILON 0.0001f
-
-XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVECTOR *outTrans, CXMMATRIX M )
-{
- FLOAT fDet;
- FLOAT *pfScales;
- XMVECTOR *ppvBasis[3];
- XMMATRIX matTemp;
- UINT a, b, c;
- static const XMVECTOR *pvCanonicalBasis[3] = {
- &g_XMIdentityR0.v,
- &g_XMIdentityR1.v,
- &g_XMIdentityR2.v
- };
-
- // Get the translation
- outTrans[0] = M.r[3];
-
- ppvBasis[0] = &matTemp.r[0];
- ppvBasis[1] = &matTemp.r[1];
- ppvBasis[2] = &matTemp.r[2];
-
- matTemp.r[0] = M.r[0];
- matTemp.r[1] = M.r[1];
- matTemp.r[2] = M.r[2];
- matTemp.r[3] = g_XMIdentityR3.v;
-
- pfScales = (FLOAT *)outScale;
-
- XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0]));
- XMVectorGetXPtr(&pfScales[1],XMVector3Length(ppvBasis[1][0]));
- XMVectorGetXPtr(&pfScales[2],XMVector3Length(ppvBasis[2][0]));
-
- XMRANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2])
-
- if(pfScales[a] < XM_DECOMP_EPSILON)
- {
- ppvBasis[a][0] = pvCanonicalBasis[a][0];
- }
- ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]);
-
- if(pfScales[b] < XM_DECOMP_EPSILON)
- {
- UINT aa, bb, cc;
- FLOAT fAbsX, fAbsY, fAbsZ;
-
- fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0]));
- fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0]));
- fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0]));
-
- XMRANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ)
-
- ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0],pvCanonicalBasis[cc][0]);
- }
-
- ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]);
-
- if(pfScales[c] < XM_DECOMP_EPSILON)
- {
- ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0],ppvBasis[b][0]);
- }
-
- ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]);
-
- fDet = XMVectorGetX(XMMatrixDeterminant(matTemp));
-
- // use Kramer's rule to check for handedness of coordinate system
- if(fDet < 0.0f)
- {
- // switch coordinate system by negating the scale and inverting the basis vector on the x-axis
- pfScales[a] = -pfScales[a];
- ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]);
-
- fDet = -fDet;
- }
-
- fDet -= 1.0f;
- fDet *= fDet;
-
- if(XM_DECOMP_EPSILON < fDet)
- {
-// Non-SRT matrix encountered
- return FALSE;
- }
-
- // generate the quaternion from the matrix
- outRotQuat[0] = XMQuaternionRotationMatrix(matTemp);
- return TRUE;
-}
-
-//------------------------------------------------------------------------------
-// Transformation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixIdentity()
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- M.r[0] = g_XMIdentityR0.v;
- M.r[1] = g_XMIdentityR1.v;
- M.r[2] = g_XMIdentityR2.v;
- M.r[3] = g_XMIdentityR3.v;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- M.r[0] = g_XMIdentityR0;
- M.r[1] = g_XMIdentityR1;
- M.r[2] = g_XMIdentityR2;
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixSet
-(
- FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33
-)
-{
- XMMATRIX M;
-
- M.r[0] = XMVectorSet(m00, m01, m02, m03);
- M.r[1] = XMVectorSet(m10, m11, m12, m13);
- M.r[2] = XMVectorSet(m20, m21, m22, m23);
- M.r[3] = XMVectorSet(m30, m31, m32, m33);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixTranslation
-(
- FLOAT OffsetX,
- FLOAT OffsetY,
- FLOAT OffsetZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- M.m[0][0] = 1.0f;
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = 1.0f;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = 1.0f;
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = OffsetX;
- M.m[3][1] = OffsetY;
- M.m[3][2] = OffsetZ;
- M.m[3][3] = 1.0f;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- M.r[0] = g_XMIdentityR0;
- M.r[1] = g_XMIdentityR1;
- M.r[2] = g_XMIdentityR2;
- M.r[3] = _mm_set_ps(1.0f,OffsetZ,OffsetY,OffsetX);
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixTranslationFromVector
-(
- FXMVECTOR Offset
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- M.m[0][0] = 1.0f;
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = 1.0f;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = 1.0f;
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = Offset.vector4_f32[0];
- M.m[3][1] = Offset.vector4_f32[1];
- M.m[3][2] = Offset.vector4_f32[2];
- M.m[3][3] = 1.0f;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_and_ps(Offset,g_XMMask3);
- vTemp = _mm_or_ps(vTemp,g_XMIdentityR3);
- XMMATRIX M;
- M.r[0] = g_XMIdentityR0;
- M.r[1] = g_XMIdentityR1;
- M.r[2] = g_XMIdentityR2;
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixScaling
-(
- FLOAT ScaleX,
- FLOAT ScaleY,
- FLOAT ScaleZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- M.r[0] = XMVectorSet(ScaleX, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, ScaleY, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, ScaleZ, 0.0f);
-
- M.r[3] = g_XMIdentityR3.v;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- M.r[0] = _mm_set_ps( 0, 0, 0, ScaleX );
- M.r[1] = _mm_set_ps( 0, 0, ScaleY, 0 );
- M.r[2] = _mm_set_ps( 0, ScaleZ, 0, 0 );
- M.r[3] = g_XMIdentityR3;
- return M;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixScalingFromVector
-(
- FXMVECTOR Scale
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
- M.m[0][0] = Scale.vector4_f32[0];
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = Scale.vector4_f32[1];
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = Scale.vector4_f32[2];
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = 0.0f;
- M.m[3][3] = 1.0f;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- M.r[0] = _mm_and_ps(Scale,g_XMMaskX);
- M.r[1] = _mm_and_ps(Scale,g_XMMaskY);
- M.r[2] = _mm_and_ps(Scale,g_XMMaskZ);
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationX
-(
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
-
- FLOAT fSinAngle = sinf(Angle);
- FLOAT fCosAngle = cosf(Angle);
-
- M.m[0][0] = 1.0f;
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = fCosAngle;
- M.m[1][2] = fSinAngle;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = -fSinAngle;
- M.m[2][2] = fCosAngle;
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = 0.0f;
- M.m[3][3] = 1.0f;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- FLOAT SinAngle = sinf(Angle);
- FLOAT CosAngle = cosf(Angle);
-
- XMVECTOR vSin = _mm_set_ss(SinAngle);
- XMVECTOR vCos = _mm_set_ss(CosAngle);
- // x = 0,y = cos,z = sin, w = 0
- vCos = _mm_shuffle_ps(vCos,vSin,_MM_SHUFFLE(3,0,0,3));
- XMMATRIX M;
- M.r[0] = g_XMIdentityR0;
- M.r[1] = vCos;
- // x = 0,y = sin,z = cos, w = 0
- vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,1,2,0));
- // x = 0,y = -sin,z = cos, w = 0
- vCos = _mm_mul_ps(vCos,g_XMNegateY);
- M.r[2] = vCos;
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationY
-(
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
-
- FLOAT fSinAngle = sinf(Angle);
- FLOAT fCosAngle = cosf(Angle);
-
- M.m[0][0] = fCosAngle;
- M.m[0][1] = 0.0f;
- M.m[0][2] = -fSinAngle;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = 1.0f;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = fSinAngle;
- M.m[2][1] = 0.0f;
- M.m[2][2] = fCosAngle;
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = 0.0f;
- M.m[3][3] = 1.0f;
- return M;
-#elif defined(_XM_SSE_INTRINSICS_)
- FLOAT SinAngle = sinf(Angle);
- FLOAT CosAngle = cosf(Angle);
-
- XMVECTOR vSin = _mm_set_ss(SinAngle);
- XMVECTOR vCos = _mm_set_ss(CosAngle);
- // x = sin,y = 0,z = cos, w = 0
- vSin = _mm_shuffle_ps(vSin,vCos,_MM_SHUFFLE(3,0,3,0));
- XMMATRIX M;
- M.r[2] = vSin;
- M.r[1] = g_XMIdentityR1;
- // x = cos,y = 0,z = sin, w = 0
- vSin = _mm_shuffle_ps(vSin,vSin,_MM_SHUFFLE(3,0,1,2));
- // x = cos,y = 0,z = -sin, w = 0
- vSin = _mm_mul_ps(vSin,g_XMNegateZ);
- M.r[0] = vSin;
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationZ
-(
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMMATRIX M;
-
- FLOAT fSinAngle = sinf(Angle);
- FLOAT fCosAngle = cosf(Angle);
-
- M.m[0][0] = fCosAngle;
- M.m[0][1] = fSinAngle;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = -fSinAngle;
- M.m[1][1] = fCosAngle;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = 1.0f;
- M.m[2][3] = 0.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = 0.0f;
- M.m[3][3] = 1.0f;
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- FLOAT SinAngle = sinf(Angle);
- FLOAT CosAngle = cosf(Angle);
-
- XMVECTOR vSin = _mm_set_ss(SinAngle);
- XMVECTOR vCos = _mm_set_ss(CosAngle);
- // x = cos,y = sin,z = 0, w = 0
- vCos = _mm_unpacklo_ps(vCos,vSin);
- XMMATRIX M;
- M.r[0] = vCos;
- // x = sin,y = cos,z = 0, w = 0
- vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,2,0,1));
- // x = cos,y = -sin,z = 0, w = 0
- vCos = _mm_mul_ps(vCos,g_XMNegateX);
- M.r[1] = vCos;
- M.r[2] = g_XMIdentityR2;
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationRollPitchYaw
-(
- FLOAT Pitch,
- FLOAT Yaw,
- FLOAT Roll
-)
-{
- XMVECTOR Angles;
- XMMATRIX M;
-
- Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f);
- M = XMMatrixRotationRollPitchYawFromVector(Angles);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationRollPitchYawFromVector
-(
- FXMVECTOR Angles // <Pitch, Yaw, Roll, undefined>
-)
-{
- XMVECTOR Q;
- XMMATRIX M;
-
- Q = XMQuaternionRotationRollPitchYawFromVector(Angles);
- M = XMMatrixRotationQuaternion(Q);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationNormal
-(
- FXMVECTOR NormalAxis,
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR A;
- XMVECTOR N0, N1;
- XMVECTOR V0, V1, V2;
- XMVECTOR R0, R1, R2;
- XMVECTOR C0, C1, C2;
- XMMATRIX M;
- static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W};
- static CONST XMVECTORU32 SwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute0Z1Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0X};
- static CONST XMVECTORU32 Permute0Y1X0Y1X = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1X};
- static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W};
-
- FLOAT fSinAngle = sinf(Angle);
- FLOAT fCosAngle = cosf(Angle);
-
- A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f);
-
- C2 = XMVectorSplatZ(A);
- C1 = XMVectorSplatY(A);
- C0 = XMVectorSplatX(A);
-
- N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW.v);
- N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW.v);
-
- V0 = XMVectorMultiply(C2, N0);
- V0 = XMVectorMultiply(V0, N1);
-
- R0 = XMVectorMultiply(C2, NormalAxis);
- R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1);
-
- R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0);
- R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0);
-
- V0 = XMVectorSelect(A, R0, g_XMSelect1110.v);
- V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X.v);
- V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X.v);
-
- M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W.v);
- M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W.v);
- M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W.v);
- M.r[3] = g_XMIdentityR3.v;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR N0, N1;
- XMVECTOR V0, V1, V2;
- XMVECTOR R0, R1, R2;
- XMVECTOR C0, C1, C2;
- XMMATRIX M;
-
- FLOAT fSinAngle = sinf(Angle);
- FLOAT fCosAngle = cosf(Angle);
-
- C2 = _mm_set_ps1(1.0f - fCosAngle);
- C1 = _mm_set_ps1(fCosAngle);
- C0 = _mm_set_ps1(fSinAngle);
-
- N0 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,0,2,1));
-// N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW);
- N1 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,1,0,2));
-// N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW);
-
- V0 = _mm_mul_ps(C2, N0);
- V0 = _mm_mul_ps(V0, N1);
-
- R0 = _mm_mul_ps(C2, NormalAxis);
- R0 = _mm_mul_ps(R0, NormalAxis);
- R0 = _mm_add_ps(R0, C1);
-
- R1 = _mm_mul_ps(C0, NormalAxis);
- R1 = _mm_add_ps(R1, V0);
- R2 = _mm_mul_ps(C0, NormalAxis);
- R2 = _mm_sub_ps(V0,R2);
-
- V0 = _mm_and_ps(R0,g_XMMask3);
-// V0 = XMVectorSelect(A, R0, g_XMSelect1110);
- V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,1,2,0));
- V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(0,3,2,1));
-// V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X);
- V2 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(0,0,1,1));
- V2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,0,2,0));
-// V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X);
-
- R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(1,0,3,0));
- R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,2,0));
- M.r[0] = R2;
-// M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W);
- R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(3,2,3,1));
- R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,0,2));
- M.r[1] = R2;
-// M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W);
- V2 = _mm_shuffle_ps(V2,V0,_MM_SHUFFLE(3,2,1,0));
-// R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(3,2,1,0));
- M.r[2] = V2;
-// M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W);
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixRotationAxis
-(
- FXMVECTOR Axis,
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Normal;
- XMMATRIX M;
-
- XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(Axis));
-
- Normal = XMVector3Normalize(Axis);
- M = XMMatrixRotationNormal(Normal, Angle);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(Axis));
- XMVECTOR Normal = XMVector3Normalize(Axis);
- XMMATRIX M = XMMatrixRotationNormal(Normal, Angle);
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixRotationQuaternion
-(
- FXMVECTOR Quaternion
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- XMVECTOR Q0, Q1;
- XMVECTOR V0, V1, V2;
- XMVECTOR R0, R1, R2;
- static CONST XMVECTOR Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f};
- static CONST XMVECTORU32 SwizzleXXYW = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W};
- static CONST XMVECTORU32 SwizzleZYZW = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0W};
- static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute0Y0X0X1W = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_1W};
- static CONST XMVECTORU32 Permute0Z0Z0Y1W = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1W};
- static CONST XMVECTORU32 Permute0Y1X1Y0Z = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 Permute0X1Z0X1Z = {XM_PERMUTE_0X, XM_PERMUTE_1Z, XM_PERMUTE_0X, XM_PERMUTE_1Z};
- static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W};
-
- Q0 = XMVectorAdd(Quaternion, Quaternion);
- Q1 = XMVectorMultiply(Quaternion, Q0);
-
- V0 = XMVectorPermute(Q1, Constant1110, Permute0Y0X0X1W.v);
- V1 = XMVectorPermute(Q1, Constant1110, Permute0Z0Z0Y1W.v);
- R0 = XMVectorSubtract(Constant1110, V0);
- R0 = XMVectorSubtract(R0, V1);
-
- V0 = XMVectorPermute(Quaternion, Quaternion, SwizzleXXYW.v);
- V1 = XMVectorPermute(Q0, Q0, SwizzleZYZW.v);
- V0 = XMVectorMultiply(V0, V1);
-
- V1 = XMVectorSplatW(Quaternion);
- V2 = XMVectorPermute(Q0, Q0, SwizzleYZXW.v);
- V1 = XMVectorMultiply(V1, V2);
-
- R1 = XMVectorAdd(V0, V1);
- R2 = XMVectorSubtract(V0, V1);
-
- V0 = XMVectorPermute(R1, R2, Permute0Y1X1Y0Z.v);
- V1 = XMVectorPermute(R1, R2, Permute0X1Z0X1Z.v);
-
- M.r[0] = XMVectorPermute(R0, V0, Permute0X1X1Y0W.v);
- M.r[1] = XMVectorPermute(R0, V0, Permute1Z0Y1W0W.v);
- M.r[2] = XMVectorPermute(R0, V1, Permute1X1Y0Z0W.v);
- M.r[3] = g_XMIdentityR3.v;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMVECTOR Q0, Q1;
- XMVECTOR V0, V1, V2;
- XMVECTOR R0, R1, R2;
- static CONST XMVECTORF32 Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f};
-
- Q0 = _mm_add_ps(Quaternion,Quaternion);
- Q1 = _mm_mul_ps(Quaternion,Q0);
-
- V0 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,0,0,1));
- V0 = _mm_and_ps(V0,g_XMMask3);
-// V0 = XMVectorPermute(Q1, Constant1110,Permute0Y0X0X1W);
- V1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,1,2,2));
- V1 = _mm_and_ps(V1,g_XMMask3);
-// V1 = XMVectorPermute(Q1, Constant1110,Permute0Z0Z0Y1W);
- R0 = _mm_sub_ps(Constant1110,V0);
- R0 = _mm_sub_ps(R0, V1);
-
- V0 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,1,0,0));
-// V0 = XMVectorPermute(Quaternion, Quaternion,SwizzleXXYW);
- V1 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,2,1,2));
-// V1 = XMVectorPermute(Q0, Q0,SwizzleZYZW);
- V0 = _mm_mul_ps(V0, V1);
-
- V1 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,3,3,3));
-// V1 = XMVectorSplatW(Quaternion);
- V2 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,0,2,1));
-// V2 = XMVectorPermute(Q0, Q0,SwizzleYZXW);
- V1 = _mm_mul_ps(V1, V2);
-
- R1 = _mm_add_ps(V0, V1);
- R2 = _mm_sub_ps(V0, V1);
-
- V0 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(1,0,2,1));
- V0 = _mm_shuffle_ps(V0,V0,_MM_SHUFFLE(1,3,2,0));
-// V0 = XMVectorPermute(R1, R2,Permute0Y1X1Y0Z);
- V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,2,0,0));
- V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(2,0,2,0));
-// V1 = XMVectorPermute(R1, R2,Permute0X1Z0X1Z);
-
- Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(1,0,3,0));
- Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,2,0));
- M.r[0] = Q1;
-// M.r[0] = XMVectorPermute(R0, V0,Permute0X1X1Y0W);
- Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(3,2,3,1));
- Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,0,2));
- M.r[1] = Q1;
-// M.r[1] = XMVectorPermute(R0, V0,Permute1Z0Y1W0W);
- Q1 = _mm_shuffle_ps(V1,R0,_MM_SHUFFLE(3,2,1,0));
- M.r[2] = Q1;
-// M.r[2] = XMVectorPermute(R0, V1,Permute1X1Y0Z0W);
- M.r[3] = g_XMIdentityR3;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixTransformation2D
-(
- FXMVECTOR ScalingOrigin,
- FLOAT ScalingOrientation,
- FXMVECTOR Scaling,
- FXMVECTOR RotationOrigin,
- FLOAT Rotation,
- CXMVECTOR Translation
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- XMVECTOR VScaling;
- XMVECTOR NegScalingOrigin;
- XMVECTOR VScalingOrigin;
- XMMATRIX MScalingOriginI;
- XMMATRIX MScalingOrientation;
- XMMATRIX MScalingOrientationT;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation *
- // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v);
- NegScalingOrigin = XMVectorNegate(VScalingOrigin);
-
- MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin);
- MScalingOrientation = XMMatrixRotationZ(ScalingOrientation);
- MScalingOrientationT = XMMatrixTranspose(MScalingOrientation);
- VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v);
- MScaling = XMMatrixScalingFromVector(VScaling);
- VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v);
- MRotation = XMMatrixRotationZ(Rotation);
- VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v);
-
- M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT);
- M = XMMatrixMultiply(M, MScaling);
- M = XMMatrixMultiply(M, MScalingOrientation);
- M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin);
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMVECTOR VScaling;
- XMVECTOR NegScalingOrigin;
- XMVECTOR VScalingOrigin;
- XMMATRIX MScalingOriginI;
- XMMATRIX MScalingOrientation;
- XMMATRIX MScalingOrientationT;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation *
- // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
- static const XMVECTORU32 Mask2 = {0xFFFFFFFF,0xFFFFFFFF,0,0};
- static const XMVECTORF32 ZWOne = {0,0,1.0f,1.0f};
-
- VScalingOrigin = _mm_and_ps(ScalingOrigin, Mask2);
- NegScalingOrigin = XMVectorNegate(VScalingOrigin);
-
- MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin);
- MScalingOrientation = XMMatrixRotationZ(ScalingOrientation);
- MScalingOrientationT = XMMatrixTranspose(MScalingOrientation);
- VScaling = _mm_and_ps(Scaling, Mask2);
- VScaling = _mm_or_ps(VScaling,ZWOne);
- MScaling = XMMatrixScalingFromVector(VScaling);
- VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2);
- MRotation = XMMatrixRotationZ(Rotation);
- VTranslation = _mm_and_ps(Translation, Mask2);
-
- M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT);
- M = XMMatrixMultiply(M, MScaling);
- M = XMMatrixMultiply(M, MScalingOrientation);
- M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin);
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixTransformation
-(
- FXMVECTOR ScalingOrigin,
- FXMVECTOR ScalingOrientationQuaternion,
- FXMVECTOR Scaling,
- CXMVECTOR RotationOrigin,
- CXMVECTOR RotationQuaternion,
- CXMVECTOR Translation
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- XMVECTOR NegScalingOrigin;
- XMVECTOR VScalingOrigin;
- XMMATRIX MScalingOriginI;
- XMMATRIX MScalingOrientation;
- XMMATRIX MScalingOrientationT;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation *
- // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v);
- NegScalingOrigin = XMVectorNegate(ScalingOrigin);
-
- MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin);
- MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion);
- MScalingOrientationT = XMMatrixTranspose(MScalingOrientation);
- MScaling = XMMatrixScalingFromVector(Scaling);
- VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v);
- MRotation = XMMatrixRotationQuaternion(RotationQuaternion);
- VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v);
-
- M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT);
- M = XMMatrixMultiply(M, MScaling);
- M = XMMatrixMultiply(M, MScalingOrientation);
- M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin);
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMVECTOR NegScalingOrigin;
- XMVECTOR VScalingOrigin;
- XMMATRIX MScalingOriginI;
- XMMATRIX MScalingOrientation;
- XMMATRIX MScalingOrientationT;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation *
- // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- VScalingOrigin = _mm_and_ps(ScalingOrigin,g_XMMask3);
- NegScalingOrigin = XMVectorNegate(ScalingOrigin);
-
- MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin);
- MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion);
- MScalingOrientationT = XMMatrixTranspose(MScalingOrientation);
- MScaling = XMMatrixScalingFromVector(Scaling);
- VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3);
- MRotation = XMMatrixRotationQuaternion(RotationQuaternion);
- VTranslation = _mm_and_ps(Translation,g_XMMask3);
-
- M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT);
- M = XMMatrixMultiply(M, MScaling);
- M = XMMatrixMultiply(M, MScalingOrientation);
- M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin);
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixAffineTransformation2D
-(
- FXMVECTOR Scaling,
- FXMVECTOR RotationOrigin,
- FLOAT Rotation,
- FXMVECTOR Translation
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- XMVECTOR VScaling;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v);
- MScaling = XMMatrixScalingFromVector(VScaling);
- VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v);
- MRotation = XMMatrixRotationZ(Rotation);
- VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v);
-
- M = MScaling;
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMVECTOR VScaling;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
- static const XMVECTORU32 Mask2 = {0xFFFFFFFFU,0xFFFFFFFFU,0,0};
- static const XMVECTORF32 ZW1 = {0,0,1.0f,1.0f};
-
- // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- VScaling = _mm_and_ps(Scaling, Mask2);
- VScaling = _mm_or_ps(VScaling, ZW1);
- MScaling = XMMatrixScalingFromVector(VScaling);
- VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2);
- MRotation = XMMatrixRotationZ(Rotation);
- VTranslation = _mm_and_ps(Translation, Mask2);
-
- M = MScaling;
- M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin);
- M.r[3] = _mm_add_ps(M.r[3], VTranslation);
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixAffineTransformation
-(
- FXMVECTOR Scaling,
- FXMVECTOR RotationOrigin,
- FXMVECTOR RotationQuaternion,
- CXMVECTOR Translation
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- MScaling = XMMatrixScalingFromVector(Scaling);
- VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin,g_XMSelect1110.v);
- MRotation = XMMatrixRotationQuaternion(RotationQuaternion);
- VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation,g_XMSelect1110.v);
-
- M = MScaling;
- M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin);
- M.r[3] = XMVectorAdd(M.r[3], VTranslation);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMMATRIX MScaling;
- XMVECTOR VRotationOrigin;
- XMMATRIX MRotation;
- XMVECTOR VTranslation;
-
- // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation;
-
- MScaling = XMMatrixScalingFromVector(Scaling);
- VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3);
- MRotation = XMMatrixRotationQuaternion(RotationQuaternion);
- VTranslation = _mm_and_ps(Translation,g_XMMask3);
-
- M = MScaling;
- M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin);
- M = XMMatrixMultiply(M, MRotation);
- M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin);
- M.r[3] = _mm_add_ps(M.r[3], VTranslation);
-
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixReflect
-(
- FXMVECTOR ReflectionPlane
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR P;
- XMVECTOR S;
- XMVECTOR A, B, C, D;
- XMMATRIX M;
- static CONST XMVECTOR NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f};
-
- XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero()));
- XMASSERT(!XMPlaneIsInfinite(ReflectionPlane));
-
- P = XMPlaneNormalize(ReflectionPlane);
- S = XMVectorMultiply(P, NegativeTwo);
-
- A = XMVectorSplatX(P);
- B = XMVectorSplatY(P);
- C = XMVectorSplatZ(P);
- D = XMVectorSplatW(P);
-
- M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v);
- M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v);
- M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v);
- M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- static CONST XMVECTORF32 NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f};
-
- XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero()));
- XMASSERT(!XMPlaneIsInfinite(ReflectionPlane));
-
- XMVECTOR P = XMPlaneNormalize(ReflectionPlane);
- XMVECTOR S = _mm_mul_ps(P,NegativeTwo);
- XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0));
- XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2));
- P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3));
- X = _mm_mul_ps(X,S);
- Y = _mm_mul_ps(Y,S);
- Z = _mm_mul_ps(Z,S);
- P = _mm_mul_ps(P,S);
- X = _mm_add_ps(X,g_XMIdentityR0);
- Y = _mm_add_ps(Y,g_XMIdentityR1);
- Z = _mm_add_ps(Z,g_XMIdentityR2);
- P = _mm_add_ps(P,g_XMIdentityR3);
- M.r[0] = X;
- M.r[1] = Y;
- M.r[2] = Z;
- M.r[3] = P;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixShadow
-(
- FXMVECTOR ShadowPlane,
- FXMVECTOR LightPosition
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR P;
- XMVECTOR Dot;
- XMVECTOR A, B, C, D;
- XMMATRIX M;
- static CONST XMVECTORU32 Select0001 = {XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1};
-
- XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero()));
- XMASSERT(!XMPlaneIsInfinite(ShadowPlane));
-
- P = XMPlaneNormalize(ShadowPlane);
- Dot = XMPlaneDot(P, LightPosition);
- P = XMVectorNegate(P);
- D = XMVectorSplatW(P);
- C = XMVectorSplatZ(P);
- B = XMVectorSplatY(P);
- A = XMVectorSplatX(P);
- Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v);
- M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot);
- Dot = XMVectorRotateLeft(Dot, 1);
- M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot);
- Dot = XMVectorRotateLeft(Dot, 1);
- M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot);
- Dot = XMVectorRotateLeft(Dot, 1);
- M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot);
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero()));
- XMASSERT(!XMPlaneIsInfinite(ShadowPlane));
- XMVECTOR P = XMPlaneNormalize(ShadowPlane);
- XMVECTOR Dot = XMPlaneDot(P,LightPosition);
- // Negate
- P = _mm_mul_ps(P,g_XMNegativeOne);
- XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0));
- XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2));
- P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3));
- Dot = _mm_and_ps(Dot,g_XMMaskW);
- X = _mm_mul_ps(X,LightPosition);
- Y = _mm_mul_ps(Y,LightPosition);
- Z = _mm_mul_ps(Z,LightPosition);
- P = _mm_mul_ps(P,LightPosition);
- P = _mm_add_ps(P,Dot);
- Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1));
- Z = _mm_add_ps(Z,Dot);
- Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1));
- Y = _mm_add_ps(Y,Dot);
- Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1));
- X = _mm_add_ps(X,Dot);
- // Store the resulting matrix
- M.r[0] = X;
- M.r[1] = Y;
- M.r[2] = Z;
- M.r[3] = P;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// View and projection initialization operations
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixLookAtLH
-(
- FXMVECTOR EyePosition,
- FXMVECTOR FocusPosition,
- FXMVECTOR UpDirection
-)
-{
- XMVECTOR EyeDirection;
- XMMATRIX M;
-
- EyeDirection = XMVectorSubtract(FocusPosition, EyePosition);
- M = XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixLookAtRH
-(
- FXMVECTOR EyePosition,
- FXMVECTOR FocusPosition,
- FXMVECTOR UpDirection
-)
-{
- XMVECTOR NegEyeDirection;
- XMMATRIX M;
-
- NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition);
- M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMMATRIX XMMatrixLookToLH
-(
- FXMVECTOR EyePosition,
- FXMVECTOR EyeDirection,
- FXMVECTOR UpDirection
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR NegEyePosition;
- XMVECTOR D0, D1, D2;
- XMVECTOR R0, R1, R2;
- XMMATRIX M;
-
- XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(EyeDirection));
- XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(UpDirection));
-
- R2 = XMVector3Normalize(EyeDirection);
-
- R0 = XMVector3Cross(UpDirection, R2);
- R0 = XMVector3Normalize(R0);
-
- R1 = XMVector3Cross(R2, R0);
-
- NegEyePosition = XMVectorNegate(EyePosition);
-
- D0 = XMVector3Dot(R0, NegEyePosition);
- D1 = XMVector3Dot(R1, NegEyePosition);
- D2 = XMVector3Dot(R2, NegEyePosition);
-
- M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v);
- M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v);
- M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v);
- M.r[3] = g_XMIdentityR3.v;
-
- M = XMMatrixTranspose(M);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
-
- XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(EyeDirection));
- XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(UpDirection));
-
- XMVECTOR R2 = XMVector3Normalize(EyeDirection);
- XMVECTOR R0 = XMVector3Cross(UpDirection, R2);
- R0 = XMVector3Normalize(R0);
- XMVECTOR R1 = XMVector3Cross(R2,R0);
- XMVECTOR NegEyePosition = _mm_mul_ps(EyePosition,g_XMNegativeOne);
- XMVECTOR D0 = XMVector3Dot(R0,NegEyePosition);
- XMVECTOR D1 = XMVector3Dot(R1,NegEyePosition);
- XMVECTOR D2 = XMVector3Dot(R2,NegEyePosition);
- R0 = _mm_and_ps(R0,g_XMMask3);
- R1 = _mm_and_ps(R1,g_XMMask3);
- R2 = _mm_and_ps(R2,g_XMMask3);
- D0 = _mm_and_ps(D0,g_XMMaskW);
- D1 = _mm_and_ps(D1,g_XMMaskW);
- D2 = _mm_and_ps(D2,g_XMMaskW);
- D0 = _mm_or_ps(D0,R0);
- D1 = _mm_or_ps(D1,R1);
- D2 = _mm_or_ps(D2,R2);
- M.r[0] = D0;
- M.r[1] = D1;
- M.r[2] = D2;
- M.r[3] = g_XMIdentityR3;
- M = XMMatrixTranspose(M);
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixLookToRH
-(
- FXMVECTOR EyePosition,
- FXMVECTOR EyeDirection,
- FXMVECTOR UpDirection
-)
-{
- XMVECTOR NegEyeDirection;
- XMMATRIX M;
-
- NegEyeDirection = XMVectorNegate(EyeDirection);
- M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection);
-
- return M;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveLH
-(
- FLOAT ViewWidth,
- FLOAT ViewHeight,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT TwoNearZ, fRange;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- TwoNearZ = NearZ + NearZ;
- fRange = FarZ / (FarZ - NearZ);
- M.m[0][0] = TwoNearZ / ViewWidth;
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = TwoNearZ / ViewHeight;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = fRange;
- M.m[2][3] = 1.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = -fRange * NearZ;
- M.m[3][3] = 0.0f;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- XMMATRIX M;
- FLOAT TwoNearZ = NearZ + NearZ;
- FLOAT fRange = FarZ / (FarZ - NearZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- TwoNearZ / ViewWidth,
- TwoNearZ / ViewHeight,
- fRange,
- -fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // TwoNearZ / ViewWidth,0,0,0
- M.r[0] = vTemp;
- // 0,TwoNearZ / ViewHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=-fRange * NearZ,0,1.0f
- vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,1.0f
- vTemp = _mm_setzero_ps();
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0));
- M.r[2] = vTemp;
- // 0,0,-fRange * NearZ,0
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0));
- M.r[3] = vTemp;
-
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveRH
-(
- FLOAT ViewWidth,
- FLOAT ViewHeight,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT TwoNearZ, fRange;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- TwoNearZ = NearZ + NearZ;
- fRange = FarZ / (NearZ - FarZ);
- M.m[0][0] = TwoNearZ / ViewWidth;
- M.m[0][1] = 0.0f;
- M.m[0][2] = 0.0f;
- M.m[0][3] = 0.0f;
-
- M.m[1][0] = 0.0f;
- M.m[1][1] = TwoNearZ / ViewHeight;
- M.m[1][2] = 0.0f;
- M.m[1][3] = 0.0f;
-
- M.m[2][0] = 0.0f;
- M.m[2][1] = 0.0f;
- M.m[2][2] = fRange;
- M.m[2][3] = -1.0f;
-
- M.m[3][0] = 0.0f;
- M.m[3][1] = 0.0f;
- M.m[3][2] = fRange * NearZ;
- M.m[3][3] = 0.0f;
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- XMMATRIX M;
- FLOAT TwoNearZ = NearZ + NearZ;
- FLOAT fRange = FarZ / (NearZ-FarZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- TwoNearZ / ViewWidth,
- TwoNearZ / ViewHeight,
- fRange,
- fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // TwoNearZ / ViewWidth,0,0,0
- M.r[0] = vTemp;
- // 0,TwoNearZ / ViewHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=-fRange * NearZ,0,-1.0f
- vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,-1.0f
- vTemp = _mm_setzero_ps();
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0));
- M.r[2] = vTemp;
- // 0,0,-fRange * NearZ,0
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0));
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveFovLH
-(
- FLOAT FovAngleY,
- FLOAT AspectRatio,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT SinFov;
- FLOAT CosFov;
- FLOAT Height;
- FLOAT Width;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f));
- XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY);
-
- Height = CosFov / SinFov;
- Width = Height / AspectRatio;
-
- M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (FarZ - NearZ), 1.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f));
- XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
- XMMATRIX M;
- FLOAT SinFov;
- FLOAT CosFov;
- XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY);
- FLOAT fRange = FarZ / (FarZ-NearZ);
- // Note: This is recorded on the stack
- FLOAT Height = CosFov / SinFov;
- XMVECTOR rMem = {
- Height / AspectRatio,
- Height,
- fRange,
- -fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // CosFov / SinFov,0,0,0
- M.r[0] = vTemp;
- // 0,Height / AspectRatio,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=-fRange * NearZ,0,1.0f
- vTemp = _mm_setzero_ps();
- vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,1.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0));
- M.r[2] = vTemp;
- // 0,0,-fRange * NearZ,0.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0));
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveFovRH
-(
- FLOAT FovAngleY,
- FLOAT AspectRatio,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT SinFov;
- FLOAT CosFov;
- FLOAT Height;
- FLOAT Width;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f));
- XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY);
-
- Height = CosFov / SinFov;
- Width = Height / AspectRatio;
-
- M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (NearZ - FarZ), -1.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f));
- XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
- XMMATRIX M;
- FLOAT SinFov;
- FLOAT CosFov;
- XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY);
- FLOAT fRange = FarZ / (NearZ-FarZ);
- // Note: This is recorded on the stack
- FLOAT Height = CosFov / SinFov;
- XMVECTOR rMem = {
- Height / AspectRatio,
- Height,
- fRange,
- fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // CosFov / SinFov,0,0,0
- M.r[0] = vTemp;
- // 0,Height / AspectRatio,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=-fRange * NearZ,0,-1.0f
- vTemp = _mm_setzero_ps();
- vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,-1.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0));
- M.r[2] = vTemp;
- // 0,0,fRange * NearZ,0.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0));
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH
-(
- FLOAT ViewLeft,
- FLOAT ViewRight,
- FLOAT ViewBottom,
- FLOAT ViewTop,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT TwoNearZ;
- FLOAT ReciprocalWidth;
- FLOAT ReciprocalHeight;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- TwoNearZ = NearZ + NearZ;
- ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
-
- M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth,
- -(ViewTop + ViewBottom) * ReciprocalHeight,
- FarZ / (FarZ - NearZ),
- 1.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
- XMMATRIX M;
- FLOAT TwoNearZ = NearZ+NearZ;
- FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
- FLOAT fRange = FarZ / (FarZ-NearZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- TwoNearZ*ReciprocalWidth,
- TwoNearZ*ReciprocalHeight,
- -fRange * NearZ,
- 0
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // TwoNearZ*ReciprocalWidth,0,0,0
- M.r[0] = vTemp;
- // 0,TwoNearZ*ReciprocalHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // 0,0,fRange,1.0f
- M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth;
- M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight;
- M.m[2][2] = fRange;
- M.m[2][3] = 1.0f;
- // 0,0,-fRange * NearZ,0.0f
- vValues = _mm_and_ps(vValues,g_XMMaskZ);
- M.r[3] = vValues;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH
-(
- FLOAT ViewLeft,
- FLOAT ViewRight,
- FLOAT ViewBottom,
- FLOAT ViewTop,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT TwoNearZ;
- FLOAT ReciprocalWidth;
- FLOAT ReciprocalHeight;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- TwoNearZ = NearZ + NearZ;
- ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
-
- M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth,
- (ViewTop + ViewBottom) * ReciprocalHeight,
- FarZ / (NearZ - FarZ),
- -1.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- XMMATRIX M;
- FLOAT TwoNearZ = NearZ+NearZ;
- FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
- FLOAT fRange = FarZ / (NearZ-FarZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- TwoNearZ*ReciprocalWidth,
- TwoNearZ*ReciprocalHeight,
- fRange * NearZ,
- 0
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // TwoNearZ*ReciprocalWidth,0,0,0
- M.r[0] = vTemp;
- // 0,TwoNearZ*ReciprocalHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // 0,0,fRange,1.0f
- M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth;
- M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight;
- M.m[2][2] = fRange;
- M.m[2][3] = -1.0f;
- // 0,0,-fRange * NearZ,0.0f
- vValues = _mm_and_ps(vValues,g_XMMaskZ);
- M.r[3] = vValues;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixOrthographicLH
-(
- FLOAT ViewWidth,
- FLOAT ViewHeight,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT fRange;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- fRange = 1.0f / (FarZ-NearZ);
- M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, fRange, 0.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, -fRange * NearZ, 1.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
- XMMATRIX M;
- FLOAT fRange = 1.0f / (FarZ-NearZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- 2.0f / ViewWidth,
- 2.0f / ViewHeight,
- fRange,
- -fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // 2.0f / ViewWidth,0,0,0
- M.r[0] = vTemp;
- // 0,2.0f / ViewHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=-fRange * NearZ,0,1.0f
- vTemp = _mm_setzero_ps();
- vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,0.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0));
- M.r[2] = vTemp;
- // 0,0,-fRange * NearZ,1.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0));
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixOrthographicRH
-(
- FLOAT ViewWidth,
- FLOAT ViewHeight,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f);
- M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 1.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
- XMMATRIX M;
- FLOAT fRange = 1.0f / (NearZ-FarZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- 2.0f / ViewWidth,
- 2.0f / ViewHeight,
- fRange,
- fRange * NearZ
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // 2.0f / ViewWidth,0,0,0
- M.r[0] = vTemp;
- // 0,2.0f / ViewHeight,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- M.r[1] = vTemp;
- // x=fRange,y=fRange * NearZ,0,1.0f
- vTemp = _mm_setzero_ps();
- vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2));
- // 0,0,fRange,0.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0));
- M.r[2] = vTemp;
- // 0,0,fRange * NearZ,1.0f
- vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0));
- M.r[3] = vTemp;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterLH
-(
- FLOAT ViewLeft,
- FLOAT ViewRight,
- FLOAT ViewBottom,
- FLOAT ViewTop,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ReciprocalWidth;
- FLOAT ReciprocalHeight;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
-
- M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (FarZ - NearZ), 0.0f);
- M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth,
- -(ViewTop + ViewBottom) * ReciprocalHeight,
- -M.r[2].vector4_f32[2] * NearZ,
- 1.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
- FLOAT fRange = 1.0f / (FarZ-NearZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- fReciprocalWidth,
- fReciprocalHeight,
- fRange,
- 1.0f
- };
- XMVECTOR rMem2 = {
- -(ViewLeft + ViewRight),
- -(ViewTop + ViewBottom),
- -NearZ,
- 1.0f
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // fReciprocalWidth*2,0,0,0
- vTemp = _mm_add_ss(vTemp,vTemp);
- M.r[0] = vTemp;
- // 0,fReciprocalHeight*2,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- vTemp = _mm_add_ps(vTemp,vTemp);
- M.r[1] = vTemp;
- // 0,0,fRange,0.0f
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskZ);
- M.r[2] = vTemp;
- // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f
- vValues = _mm_mul_ps(vValues,rMem2);
- M.r[3] = vValues;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterRH
-(
- FLOAT ViewLeft,
- FLOAT ViewRight,
- FLOAT ViewBottom,
- FLOAT ViewTop,
- FLOAT NearZ,
- FLOAT FarZ
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ReciprocalWidth;
- FLOAT ReciprocalHeight;
- XMMATRIX M;
-
- XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f));
- XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f));
- XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f));
-
- ReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- ReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
-
- M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f);
- M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f);
- M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f);
- M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth,
- -(ViewTop + ViewBottom) * ReciprocalHeight,
- M.r[2].vector4_f32[2] * NearZ,
- 1.0f);
-
- return M;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMMATRIX M;
- FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft);
- FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom);
- FLOAT fRange = 1.0f / (NearZ-FarZ);
- // Note: This is recorded on the stack
- XMVECTOR rMem = {
- fReciprocalWidth,
- fReciprocalHeight,
- fRange,
- 1.0f
- };
- XMVECTOR rMem2 = {
- -(ViewLeft + ViewRight),
- -(ViewTop + ViewBottom),
- NearZ,
- 1.0f
- };
- // Copy from memory to SSE register
- XMVECTOR vValues = rMem;
- XMVECTOR vTemp = _mm_setzero_ps();
- // Copy x only
- vTemp = _mm_move_ss(vTemp,vValues);
- // fReciprocalWidth*2,0,0,0
- vTemp = _mm_add_ss(vTemp,vTemp);
- M.r[0] = vTemp;
- // 0,fReciprocalHeight*2,0,0
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskY);
- vTemp = _mm_add_ps(vTemp,vTemp);
- M.r[1] = vTemp;
- // 0,0,fRange,0.0f
- vTemp = vValues;
- vTemp = _mm_and_ps(vTemp,g_XMMaskZ);
- M.r[2] = vTemp;
- // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f
- vValues = _mm_mul_ps(vValues,rMem2);
- M.r[3] = vValues;
- return M;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-#ifdef __cplusplus
-
-/****************************************************************************
- *
- * XMMATRIX operators and methods
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMMATRIX::_XMMATRIX
-(
- FXMVECTOR R0,
- FXMVECTOR R1,
- FXMVECTOR R2,
- CXMVECTOR R3
-)
-{
- r[0] = R0;
- r[1] = R1;
- r[2] = R2;
- r[3] = R3;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMMATRIX::_XMMATRIX
-(
- FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33
-)
-{
- r[0] = XMVectorSet(m00, m01, m02, m03);
- r[1] = XMVectorSet(m10, m11, m12, m13);
- r[2] = XMVectorSet(m20, m21, m22, m23);
- r[3] = XMVectorSet(m30, m31, m32, m33);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMMATRIX::_XMMATRIX
-(
- CONST FLOAT* pArray
-)
-{
- r[0] = XMLoadFloat4((XMFLOAT4*)pArray);
- r[1] = XMLoadFloat4((XMFLOAT4*)(pArray + 4));
- r[2] = XMLoadFloat4((XMFLOAT4*)(pArray + 8));
- r[3] = XMLoadFloat4((XMFLOAT4*)(pArray + 12));
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMMATRIX& _XMMATRIX::operator=
-(
- CONST _XMMATRIX& M
-)
-{
- r[0] = M.r[0];
- r[1] = M.r[1];
- r[2] = M.r[2];
- r[3] = M.r[3];
- return *this;
-}
-
-//------------------------------------------------------------------------------
-
-#ifndef XM_NO_OPERATOR_OVERLOADS
-
-#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_)
-#pragma warning(push)
-#pragma warning(disable : 4328)
-#endif
-
-XMFINLINE _XMMATRIX& _XMMATRIX::operator*=
-(
- CONST _XMMATRIX& M
-)
-{
- *this = XMMatrixMultiply(*this, M);
- return *this;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMMATRIX _XMMATRIX::operator*
-(
- CONST _XMMATRIX& M
-) CONST
-{
- return XMMatrixMultiply(*this, M);
-}
-
-#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_)
-#pragma warning(pop)
-#endif
-
-#endif // !XM_NO_OPERATOR_OVERLOADS
-
-/****************************************************************************
- *
- * XMFLOAT3X3 operators
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3
-(
- FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22
-)
-{
- m[0][0] = m00;
- m[0][1] = m01;
- m[0][2] = m02;
-
- m[1][0] = m10;
- m[1][1] = m11;
- m[1][2] = m12;
-
- m[2][0] = m20;
- m[2][1] = m21;
- m[2][2] = m22;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3
-(
- CONST FLOAT* pArray
-)
-{
- UINT Row;
- UINT Column;
-
- for (Row = 0; Row < 3; Row++)
- {
- for (Column = 0; Column < 3; Column++)
- {
- m[Row][Column] = pArray[Row * 3 + Column];
- }
- }
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT3X3& _XMFLOAT3X3::operator=
-(
- CONST _XMFLOAT3X3& Float3x3
-)
-{
- _11 = Float3x3._11;
- _12 = Float3x3._12;
- _13 = Float3x3._13;
- _21 = Float3x3._21;
- _22 = Float3x3._22;
- _23 = Float3x3._23;
- _31 = Float3x3._31;
- _32 = Float3x3._32;
- _33 = Float3x3._33;
-
- return *this;
-}
-
-/****************************************************************************
- *
- * XMFLOAT4X3 operators
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3
-(
- FLOAT m00, FLOAT m01, FLOAT m02,
- FLOAT m10, FLOAT m11, FLOAT m12,
- FLOAT m20, FLOAT m21, FLOAT m22,
- FLOAT m30, FLOAT m31, FLOAT m32
-)
-{
- m[0][0] = m00;
- m[0][1] = m01;
- m[0][2] = m02;
-
- m[1][0] = m10;
- m[1][1] = m11;
- m[1][2] = m12;
-
- m[2][0] = m20;
- m[2][1] = m21;
- m[2][2] = m22;
-
- m[3][0] = m30;
- m[3][1] = m31;
- m[3][2] = m32;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3
-(
- CONST FLOAT* pArray
-)
-{
- UINT Row;
- UINT Column;
-
- for (Row = 0; Row < 4; Row++)
- {
- for (Column = 0; Column < 3; Column++)
- {
- m[Row][Column] = pArray[Row * 3 + Column];
- }
- }
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X3& _XMFLOAT4X3::operator=
-(
- CONST _XMFLOAT4X3& Float4x3
-)
-{
- XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x3._11);
- XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x3._22);
- XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x3._33);
-
- XMStoreFloat4((XMFLOAT4*)&_11, V1);
- XMStoreFloat4((XMFLOAT4*)&_22, V2);
- XMStoreFloat4((XMFLOAT4*)&_33, V3);
-
- return *this;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMFLOAT4X3A& XMFLOAT4X3A::operator=
-(
- CONST XMFLOAT4X3A& Float4x3
-)
-{
- XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._11);
- XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._22);
- XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._33);
-
- XMStoreFloat4A((XMFLOAT4A*)&_11, V1);
- XMStoreFloat4A((XMFLOAT4A*)&_22, V2);
- XMStoreFloat4A((XMFLOAT4A*)&_33, V3);
-
- return *this;
-}
-
-/****************************************************************************
- *
- * XMFLOAT4X4 operators
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4
-(
- FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03,
- FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13,
- FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23,
- FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33
-)
-{
- m[0][0] = m00;
- m[0][1] = m01;
- m[0][2] = m02;
- m[0][3] = m03;
-
- m[1][0] = m10;
- m[1][1] = m11;
- m[1][2] = m12;
- m[1][3] = m13;
-
- m[2][0] = m20;
- m[2][1] = m21;
- m[2][2] = m22;
- m[2][3] = m23;
-
- m[3][0] = m30;
- m[3][1] = m31;
- m[3][2] = m32;
- m[3][3] = m33;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4
-(
- CONST FLOAT* pArray
-)
-{
- UINT Row;
- UINT Column;
-
- for (Row = 0; Row < 4; Row++)
- {
- for (Column = 0; Column < 4; Column++)
- {
- m[Row][Column] = pArray[Row * 4 + Column];
- }
- }
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE _XMFLOAT4X4& _XMFLOAT4X4::operator=
-(
- CONST _XMFLOAT4X4& Float4x4
-)
-{
- XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x4._11);
- XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x4._21);
- XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x4._31);
- XMVECTOR V4 = XMLoadFloat4((XMFLOAT4*)&Float4x4._41);
-
- XMStoreFloat4((XMFLOAT4*)&_11, V1);
- XMStoreFloat4((XMFLOAT4*)&_21, V2);
- XMStoreFloat4((XMFLOAT4*)&_31, V3);
- XMStoreFloat4((XMFLOAT4*)&_41, V4);
-
- return *this;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMFLOAT4X4A& XMFLOAT4X4A::operator=
-(
- CONST XMFLOAT4X4A& Float4x4
-)
-{
- XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._11);
- XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._21);
- XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._31);
- XMVECTOR V4 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._41);
-
- XMStoreFloat4A((XMFLOAT4A*)&_11, V1);
- XMStoreFloat4A((XMFLOAT4A*)&_21, V2);
- XMStoreFloat4A((XMFLOAT4A*)&_31, V3);
- XMStoreFloat4A((XMFLOAT4A*)&_41, V4);
-
- return *this;
-}
-
-#endif // __cplusplus
-
-#endif // __XNAMATHMATRIX_INL__
-
diff --git a/3rdparty/dxsdk/Include/xnamathmisc.inl b/3rdparty/dxsdk/Include/xnamathmisc.inl
deleted file mode 100644
index c937ee1d0bd..00000000000
--- a/3rdparty/dxsdk/Include/xnamathmisc.inl
+++ /dev/null
@@ -1,2464 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- xnamathmisc.inl
-
-Abstract:
-
- XNA math library for Windows and Xbox 360: Quaternion, plane, and color functions.
---*/
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#ifndef __XNAMATHMISC_INL__
-#define __XNAMATHMISC_INL__
-
-/****************************************************************************
- *
- * Quaternion
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMQuaternionEqual
-(
- FXMVECTOR Q1,
- FXMVECTOR Q2
-)
-{
- return XMVector4Equal(Q1, Q2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMQuaternionNotEqual
-(
- FXMVECTOR Q1,
- FXMVECTOR Q2
-)
-{
- return XMVector4NotEqual(Q1, Q2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMQuaternionIsNaN
-(
- FXMVECTOR Q
-)
-{
- return XMVector4IsNaN(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMQuaternionIsInfinite
-(
- FXMVECTOR Q
-)
-{
- return XMVector4IsInfinite(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMQuaternionIsIdentity
-(
- FXMVECTOR Q
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- return XMVector4Equal(Q, g_XMIdentityR3.v);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpeq_ps(Q,g_XMIdentityR3);
- return (_mm_movemask_ps(vTemp)==0x0f) ? true : false;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionDot
-(
- FXMVECTOR Q1,
- FXMVECTOR Q2
-)
-{
- return XMVector4Dot(Q1, Q2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionMultiply
-(
- FXMVECTOR Q1,
- FXMVECTOR Q2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR NegativeQ1;
- XMVECTOR Q2X;
- XMVECTOR Q2Y;
- XMVECTOR Q2Z;
- XMVECTOR Q2W;
- XMVECTOR Q1WZYX;
- XMVECTOR Q1ZWXY;
- XMVECTOR Q1YXWZ;
- XMVECTOR Result;
- CONST XMVECTORU32 ControlWZYX = {XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1X};
- CONST XMVECTORU32 ControlZWXY = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1X, XM_PERMUTE_1Y};
- CONST XMVECTORU32 ControlYXWZ = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z};
-
- NegativeQ1 = XMVectorNegate(Q1);
-
- Q2W = XMVectorSplatW(Q2);
- Q2X = XMVectorSplatX(Q2);
- Q2Y = XMVectorSplatY(Q2);
- Q2Z = XMVectorSplatZ(Q2);
-
- Q1WZYX = XMVectorPermute(Q1, NegativeQ1, ControlWZYX.v);
- Q1ZWXY = XMVectorPermute(Q1, NegativeQ1, ControlZWXY.v);
- Q1YXWZ = XMVectorPermute(Q1, NegativeQ1, ControlYXWZ.v);
-
- Result = XMVectorMultiply(Q1, Q2W);
- Result = XMVectorMultiplyAdd(Q1WZYX, Q2X, Result);
- Result = XMVectorMultiplyAdd(Q1ZWXY, Q2Y, Result);
- Result = XMVectorMultiplyAdd(Q1YXWZ, Q2Z, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 ControlWZYX = { 1.0f,-1.0f, 1.0f,-1.0f};
- static CONST XMVECTORF32 ControlZWXY = { 1.0f, 1.0f,-1.0f,-1.0f};
- static CONST XMVECTORF32 ControlYXWZ = {-1.0f, 1.0f, 1.0f,-1.0f};
- // Copy to SSE registers and use as few as possible for x86
- XMVECTOR Q2X = Q2;
- XMVECTOR Q2Y = Q2;
- XMVECTOR Q2Z = Q2;
- XMVECTOR vResult = Q2;
- // Splat with one instruction
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3));
- Q2X = _mm_shuffle_ps(Q2X,Q2X,_MM_SHUFFLE(0,0,0,0));
- Q2Y = _mm_shuffle_ps(Q2Y,Q2Y,_MM_SHUFFLE(1,1,1,1));
- Q2Z = _mm_shuffle_ps(Q2Z,Q2Z,_MM_SHUFFLE(2,2,2,2));
- // Retire Q1 and perform Q1*Q2W
- vResult = _mm_mul_ps(vResult,Q1);
- XMVECTOR Q1Shuffle = Q1;
- // Shuffle the copies of Q1
- Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3));
- // Mul by Q1WZYX
- Q2X = _mm_mul_ps(Q2X,Q1Shuffle);
- Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(2,3,0,1));
- // Flip the signs on y and z
- Q2X = _mm_mul_ps(Q2X,ControlWZYX);
- // Mul by Q1ZWXY
- Q2Y = _mm_mul_ps(Q2Y,Q1Shuffle);
- Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3));
- // Flip the signs on z and w
- Q2Y = _mm_mul_ps(Q2Y,ControlZWXY);
- // Mul by Q1YXWZ
- Q2Z = _mm_mul_ps(Q2Z,Q1Shuffle);
- vResult = _mm_add_ps(vResult,Q2X);
- // Flip the signs on x and w
- Q2Z = _mm_mul_ps(Q2Z,ControlYXWZ);
- Q2Y = _mm_add_ps(Q2Y,Q2Z);
- vResult = _mm_add_ps(vResult,Q2Y);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionLengthSq
-(
- FXMVECTOR Q
-)
-{
- return XMVector4LengthSq(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionReciprocalLength
-(
- FXMVECTOR Q
-)
-{
- return XMVector4ReciprocalLength(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionLength
-(
- FXMVECTOR Q
-)
-{
- return XMVector4Length(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionNormalizeEst
-(
- FXMVECTOR Q
-)
-{
- return XMVector4NormalizeEst(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionNormalize
-(
- FXMVECTOR Q
-)
-{
- return XMVector4Normalize(Q);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionConjugate
-(
- FXMVECTOR Q
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result = {
- -Q.vector4_f32[0],
- -Q.vector4_f32[1],
- -Q.vector4_f32[2],
- Q.vector4_f32[3]
- };
- return Result;
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 NegativeOne3 = {-1.0f,-1.0f,-1.0f,1.0f};
- XMVECTOR Result = _mm_mul_ps(Q,NegativeOne3);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionInverse
-(
- FXMVECTOR Q
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Conjugate;
- XMVECTOR L;
- XMVECTOR Control;
- XMVECTOR Result;
- CONST XMVECTOR Zero = XMVectorZero();
-
- L = XMVector4LengthSq(Q);
- Conjugate = XMQuaternionConjugate(Q);
-
- Control = XMVectorLessOrEqual(L, g_XMEpsilon.v);
-
- L = XMVectorReciprocal(L);
- Result = XMVectorMultiply(Conjugate, L);
-
- Result = XMVectorSelect(Result, Zero, Control);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Conjugate;
- XMVECTOR L;
- XMVECTOR Control;
- XMVECTOR Result;
- XMVECTOR Zero = XMVectorZero();
-
- L = XMVector4LengthSq(Q);
- Conjugate = XMQuaternionConjugate(Q);
- Control = XMVectorLessOrEqual(L, g_XMEpsilon);
- Result = _mm_div_ps(Conjugate,L);
- Result = XMVectorSelect(Result, Zero, Control);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionLn
-(
- FXMVECTOR Q
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Q0;
- XMVECTOR QW;
- XMVECTOR Theta;
- XMVECTOR SinTheta;
- XMVECTOR S;
- XMVECTOR ControlW;
- XMVECTOR Result;
- static CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f};
-
- QW = XMVectorSplatW(Q);
- Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v);
-
- ControlW = XMVectorInBounds(QW, OneMinusEpsilon);
-
- Theta = XMVectorACos(QW);
- SinTheta = XMVectorSin(Theta);
-
- S = XMVectorReciprocal(SinTheta);
- S = XMVectorMultiply(Theta, S);
-
- Result = XMVectorMultiply(Q0, S);
-
- Result = XMVectorSelect(Q0, Result, ControlW);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f};
- static CONST XMVECTORF32 NegOneMinusEpsilon = {-(1.0f - 0.00001f), -(1.0f - 0.00001f),-(1.0f - 0.00001f),-(1.0f - 0.00001f)};
- // Get W only
- XMVECTOR QW = _mm_shuffle_ps(Q,Q,_MM_SHUFFLE(3,3,3,3));
- // W = 0
- XMVECTOR Q0 = _mm_and_ps(Q,g_XMMask3);
- // Use W if within bounds
- XMVECTOR ControlW = _mm_cmple_ps(QW,OneMinusEpsilon);
- XMVECTOR vTemp2 = _mm_cmpge_ps(QW,NegOneMinusEpsilon);
- ControlW = _mm_and_ps(ControlW,vTemp2);
- // Get theta
- XMVECTOR vTheta = XMVectorACos(QW);
- // Get Sine of theta
- vTemp2 = XMVectorSin(vTheta);
- // theta/sine of theta
- vTheta = _mm_div_ps(vTheta,vTemp2);
- // Here's the answer
- vTheta = _mm_mul_ps(vTheta,Q0);
- // Was W in bounds? If not, return input as is
- vTheta = XMVectorSelect(Q0,vTheta,ControlW);
- return vTheta;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionExp
-(
- FXMVECTOR Q
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Theta;
- XMVECTOR SinTheta;
- XMVECTOR CosTheta;
- XMVECTOR S;
- XMVECTOR Control;
- XMVECTOR Zero;
- XMVECTOR Result;
-
- Theta = XMVector3Length(Q);
- XMVectorSinCos(&SinTheta, &CosTheta, Theta);
-
- S = XMVectorReciprocal(Theta);
- S = XMVectorMultiply(SinTheta, S);
-
- Result = XMVectorMultiply(Q, S);
-
- Zero = XMVectorZero();
- Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v);
- Result = XMVectorSelect(Result, Q, Control);
-
- Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Theta;
- XMVECTOR SinTheta;
- XMVECTOR CosTheta;
- XMVECTOR S;
- XMVECTOR Control;
- XMVECTOR Zero;
- XMVECTOR Result;
- Theta = XMVector3Length(Q);
- XMVectorSinCos(&SinTheta, &CosTheta, Theta);
- S = _mm_div_ps(SinTheta,Theta);
- Result = _mm_mul_ps(Q, S);
- Zero = XMVectorZero();
- Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon);
- Result = XMVectorSelect(Result,Q,Control);
- Result = _mm_and_ps(Result,g_XMMask3);
- CosTheta = _mm_and_ps(CosTheta,g_XMMaskW);
- Result = _mm_or_ps(Result,CosTheta);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMQuaternionSlerp
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FLOAT t
-)
-{
- XMVECTOR T = XMVectorReplicate(t);
- return XMQuaternionSlerpV(Q0, Q1, T);
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMQuaternionSlerpV
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR T
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega)
- XMVECTOR Omega;
- XMVECTOR CosOmega;
- XMVECTOR SinOmega;
- XMVECTOR InvSinOmega;
- XMVECTOR V01;
- XMVECTOR C1000;
- XMVECTOR SignMask;
- XMVECTOR S0;
- XMVECTOR S1;
- XMVECTOR Sign;
- XMVECTOR Control;
- XMVECTOR Result;
- XMVECTOR Zero;
- CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f};
-
- XMASSERT((T.vector4_f32[1] == T.vector4_f32[0]) && (T.vector4_f32[2] == T.vector4_f32[0]) && (T.vector4_f32[3] == T.vector4_f32[0]));
-
- CosOmega = XMQuaternionDot(Q0, Q1);
-
- Zero = XMVectorZero();
- Control = XMVectorLess(CosOmega, Zero);
- Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control);
-
- CosOmega = XMVectorMultiply(CosOmega, Sign);
-
- Control = XMVectorLess(CosOmega, OneMinusEpsilon);
-
- SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v);
- SinOmega = XMVectorSqrt(SinOmega);
-
- Omega = XMVectorATan2(SinOmega, CosOmega);
-
- SignMask = XMVectorSplatSignMask();
- C1000 = XMVectorSetBinaryConstant(1, 0, 0, 0);
- V01 = XMVectorShiftLeft(T, Zero, 2);
- SignMask = XMVectorShiftLeft(SignMask, Zero, 3);
- V01 = XMVectorXorInt(V01, SignMask);
- V01 = XMVectorAdd(C1000, V01);
-
- InvSinOmega = XMVectorReciprocal(SinOmega);
-
- S0 = XMVectorMultiply(V01, Omega);
- S0 = XMVectorSin(S0);
- S0 = XMVectorMultiply(S0, InvSinOmega);
-
- S0 = XMVectorSelect(V01, S0, Control);
-
- S1 = XMVectorSplatY(S0);
- S0 = XMVectorSplatX(S0);
-
- S1 = XMVectorMultiply(S1, Sign);
-
- Result = XMVectorMultiply(Q0, S0);
- Result = XMVectorMultiplyAdd(Q1, S1, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega)
- XMVECTOR Omega;
- XMVECTOR CosOmega;
- XMVECTOR SinOmega;
- XMVECTOR V01;
- XMVECTOR S0;
- XMVECTOR S1;
- XMVECTOR Sign;
- XMVECTOR Control;
- XMVECTOR Result;
- XMVECTOR Zero;
- static const XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f};
- static const XMVECTORI32 SignMask2 = {0x80000000,0x00000000,0x00000000,0x00000000};
- static const XMVECTORI32 MaskXY = {0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000};
-
- XMASSERT((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T)));
-
- CosOmega = XMQuaternionDot(Q0, Q1);
-
- Zero = XMVectorZero();
- Control = XMVectorLess(CosOmega, Zero);
- Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control);
-
- CosOmega = _mm_mul_ps(CosOmega, Sign);
-
- Control = XMVectorLess(CosOmega, OneMinusEpsilon);
-
- SinOmega = _mm_mul_ps(CosOmega,CosOmega);
- SinOmega = _mm_sub_ps(g_XMOne,SinOmega);
- SinOmega = _mm_sqrt_ps(SinOmega);
-
- Omega = XMVectorATan2(SinOmega, CosOmega);
-
- V01 = _mm_shuffle_ps(T,T,_MM_SHUFFLE(2,3,0,1));
- V01 = _mm_and_ps(V01,MaskXY);
- V01 = _mm_xor_ps(V01,SignMask2);
- V01 = _mm_add_ps(g_XMIdentityR0, V01);
-
- S0 = _mm_mul_ps(V01, Omega);
- S0 = XMVectorSin(S0);
- S0 = _mm_div_ps(S0, SinOmega);
-
- S0 = XMVectorSelect(V01, S0, Control);
-
- S1 = XMVectorSplatY(S0);
- S0 = XMVectorSplatX(S0);
-
- S1 = _mm_mul_ps(S1, Sign);
- Result = _mm_mul_ps(Q0, S0);
- S1 = _mm_mul_ps(S1, Q1);
- Result = _mm_add_ps(Result,S1);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionSquad
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR Q2,
- CXMVECTOR Q3,
- FLOAT t
-)
-{
- XMVECTOR T = XMVectorReplicate(t);
- return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionSquadV
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR Q2,
- CXMVECTOR Q3,
- CXMVECTOR T
-)
-{
- XMVECTOR Q03;
- XMVECTOR Q12;
- XMVECTOR TP;
- XMVECTOR Two;
- XMVECTOR Result;
-
- XMASSERT( (XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T)) );
-
- TP = T;
- Two = XMVectorSplatConstant(2, 0);
-
- Q03 = XMQuaternionSlerpV(Q0, Q3, T);
- Q12 = XMQuaternionSlerpV(Q1, Q2, T);
-
- TP = XMVectorNegativeMultiplySubtract(TP, TP, TP);
- TP = XMVectorMultiply(TP, Two);
-
- Result = XMQuaternionSlerpV(Q03, Q12, TP);
-
- return Result;
-
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE VOID XMQuaternionSquadSetup
-(
- XMVECTOR* pA,
- XMVECTOR* pB,
- XMVECTOR* pC,
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR Q2,
- CXMVECTOR Q3
-)
-{
- XMVECTOR SQ0, SQ2, SQ3;
- XMVECTOR InvQ1, InvQ2;
- XMVECTOR LnQ0, LnQ1, LnQ2, LnQ3;
- XMVECTOR ExpQ02, ExpQ13;
- XMVECTOR LS01, LS12, LS23;
- XMVECTOR LD01, LD12, LD23;
- XMVECTOR Control0, Control1, Control2;
- XMVECTOR NegativeOneQuarter;
-
- XMASSERT(pA);
- XMASSERT(pB);
- XMASSERT(pC);
-
- LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2));
- LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2));
- SQ2 = XMVectorNegate(Q2);
-
- Control1 = XMVectorLess(LS12, LD12);
- SQ2 = XMVectorSelect(Q2, SQ2, Control1);
-
- LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1));
- LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1));
- SQ0 = XMVectorNegate(Q0);
-
- LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3));
- LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3));
- SQ3 = XMVectorNegate(Q3);
-
- Control0 = XMVectorLess(LS01, LD01);
- Control2 = XMVectorLess(LS23, LD23);
-
- SQ0 = XMVectorSelect(Q0, SQ0, Control0);
- SQ3 = XMVectorSelect(Q3, SQ3, Control2);
-
- InvQ1 = XMQuaternionInverse(Q1);
- InvQ2 = XMQuaternionInverse(SQ2);
-
- LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0));
- LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2));
- LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1));
- LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3));
-
- NegativeOneQuarter = XMVectorSplatConstant(-1, 2);
-
- ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter);
- ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter);
- ExpQ02 = XMQuaternionExp(ExpQ02);
- ExpQ13 = XMQuaternionExp(ExpQ13);
-
- *pA = XMQuaternionMultiply(Q1, ExpQ02);
- *pB = XMQuaternionMultiply(SQ2, ExpQ13);
- *pC = SQ2;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionBaryCentric
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR Q2,
- FLOAT f,
- FLOAT g
-)
-{
- XMVECTOR Q01;
- XMVECTOR Q02;
- FLOAT s;
- XMVECTOR Result;
-
- s = f + g;
-
- if ((s < 0.00001f) && (s > -0.00001f))
- {
- Result = Q0;
- }
- else
- {
- Q01 = XMQuaternionSlerp(Q0, Q1, s);
- Q02 = XMQuaternionSlerp(Q0, Q2, s);
-
- Result = XMQuaternionSlerp(Q01, Q02, g / s);
- }
-
- return Result;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionBaryCentricV
-(
- FXMVECTOR Q0,
- FXMVECTOR Q1,
- FXMVECTOR Q2,
- CXMVECTOR F,
- CXMVECTOR G
-)
-{
- XMVECTOR Q01;
- XMVECTOR Q02;
- XMVECTOR S, GS;
- XMVECTOR Epsilon;
- XMVECTOR Result;
-
- XMASSERT( (XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F)) );
- XMASSERT( (XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G)) );
-
- Epsilon = XMVectorSplatConstant(1, 16);
-
- S = XMVectorAdd(F, G);
-
- if (XMVector4InBounds(S, Epsilon))
- {
- Result = Q0;
- }
- else
- {
- Q01 = XMQuaternionSlerpV(Q0, Q1, S);
- Q02 = XMQuaternionSlerpV(Q0, Q2, S);
- GS = XMVectorReciprocal(S);
- GS = XMVectorMultiply(G, GS);
-
- Result = XMQuaternionSlerpV(Q01, Q02, GS);
- }
-
- return Result;
-}
-
-//------------------------------------------------------------------------------
-// Transformation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionIdentity()
-{
-#if defined(_XM_NO_INTRINSICS_)
- return g_XMIdentityR3.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- return g_XMIdentityR3;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYaw
-(
- FLOAT Pitch,
- FLOAT Yaw,
- FLOAT Roll
-)
-{
- XMVECTOR Angles;
- XMVECTOR Q;
-
- Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f);
- Q = XMQuaternionRotationRollPitchYawFromVector(Angles);
-
- return Q;
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYawFromVector
-(
- FXMVECTOR Angles // <Pitch, Yaw, Roll, 0>
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Q, Q0, Q1;
- XMVECTOR P0, P1, Y0, Y1, R0, R1;
- XMVECTOR HalfAngles;
- XMVECTOR SinAngles, CosAngles;
- static CONST XMVECTORU32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X};
- static CONST XMVECTORU32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y};
- static CONST XMVECTORU32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z};
- static CONST XMVECTOR Sign = {1.0f, -1.0f, -1.0f, 1.0f};
-
- HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v);
- XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles);
-
- P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch.v);
- Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw.v);
- R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll.v);
- P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch.v);
- Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw.v);
- R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll.v);
-
- Q1 = XMVectorMultiply(P1, Sign);
- Q0 = XMVectorMultiply(P0, Y0);
- Q1 = XMVectorMultiply(Q1, Y1);
- Q0 = XMVectorMultiply(Q0, R0);
- Q = XMVectorMultiplyAdd(Q1, R1, Q0);
-
- return Q;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Q, Q0, Q1;
- XMVECTOR P0, P1, Y0, Y1, R0, R1;
- XMVECTOR HalfAngles;
- XMVECTOR SinAngles, CosAngles;
- static CONST XMVECTORI32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X};
- static CONST XMVECTORI32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y};
- static CONST XMVECTORI32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z};
- static CONST XMVECTORF32 Sign = {1.0f, -1.0f, -1.0f, 1.0f};
-
- HalfAngles = _mm_mul_ps(Angles, g_XMOneHalf);
- XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles);
-
- P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch);
- Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw);
- R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll);
- P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch);
- Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw);
- R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll);
-
- Q1 = _mm_mul_ps(P1, Sign);
- Q0 = _mm_mul_ps(P0, Y0);
- Q1 = _mm_mul_ps(Q1, Y1);
- Q0 = _mm_mul_ps(Q0, R0);
- Q = _mm_mul_ps(Q1, R1);
- Q = _mm_add_ps(Q,Q0);
- return Q;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionRotationNormal
-(
- FXMVECTOR NormalAxis,
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Q;
- XMVECTOR N;
- XMVECTOR Scale;
-
- N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v);
-
- XMScalarSinCos(&Scale.vector4_f32[2], &Scale.vector4_f32[3], 0.5f * Angle);
-
- Scale.vector4_f32[0] = Scale.vector4_f32[1] = Scale.vector4_f32[2];
-
- Q = XMVectorMultiply(N, Scale);
-
- return Q;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR N = _mm_and_ps(NormalAxis,g_XMMask3);
- N = _mm_or_ps(N,g_XMIdentityR3);
- XMVECTOR Scale = _mm_set_ps1(0.5f * Angle);
- XMVECTOR vSine;
- XMVECTOR vCosine;
- XMVectorSinCos(&vSine,&vCosine,Scale);
- Scale = _mm_and_ps(vSine,g_XMMask3);
- vCosine = _mm_and_ps(vCosine,g_XMMaskW);
- Scale = _mm_or_ps(Scale,vCosine);
- N = _mm_mul_ps(N,Scale);
- return N;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMQuaternionRotationAxis
-(
- FXMVECTOR Axis,
- FLOAT Angle
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Normal;
- XMVECTOR Q;
-
- XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(Axis));
-
- Normal = XMVector3Normalize(Axis);
- Q = XMQuaternionRotationNormal(Normal, Angle);
-
- return Q;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Normal;
- XMVECTOR Q;
-
- XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
- XMASSERT(!XMVector3IsInfinite(Axis));
-
- Normal = XMVector3Normalize(Axis);
- Q = XMQuaternionRotationNormal(Normal, Angle);
- return Q;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMQuaternionRotationMatrix
-(
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
- XMVECTOR Q0, Q1, Q2;
- XMVECTOR M00, M11, M22;
- XMVECTOR CQ0, CQ1, C;
- XMVECTOR CX, CY, CZ, CW;
- XMVECTOR SQ1, Scale;
- XMVECTOR Rsq, Sqrt, VEqualsNaN;
- XMVECTOR A, B, P;
- XMVECTOR PermuteSplat, PermuteSplatT;
- XMVECTOR SignB, SignBT;
- XMVECTOR PermuteControl, PermuteControlT;
- XMVECTOR Result;
- static CONST XMVECTORF32 OneQuarter = {0.25f, 0.25f, 0.25f, 0.25f};
- static CONST XMVECTORF32 SignPNNP = {1.0f, -1.0f, -1.0f, 1.0f};
- static CONST XMVECTORF32 SignNPNP = {-1.0f, 1.0f, -1.0f, 1.0f};
- static CONST XMVECTORF32 SignNNPP = {-1.0f, -1.0f, 1.0f, 1.0f};
- static CONST XMVECTORF32 SignPNPP = {1.0f, -1.0f, 1.0f, 1.0f};
- static CONST XMVECTORF32 SignPPNP = {1.0f, 1.0f, -1.0f, 1.0f};
- static CONST XMVECTORF32 SignNPPP = {-1.0f, 1.0f, 1.0f, 1.0f};
- static CONST XMVECTORU32 Permute0X0X0Y0W = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute0Y0Z0Z1W = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_1W};
- static CONST XMVECTORU32 SplatX = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X};
- static CONST XMVECTORU32 SplatY = {XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y};
- static CONST XMVECTORU32 SplatZ = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z};
- static CONST XMVECTORU32 SplatW = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W};
- static CONST XMVECTORU32 PermuteC = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Y};
- static CONST XMVECTORU32 PermuteA = {XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0W};
- static CONST XMVECTORU32 PermuteB = {XM_PERMUTE_1X, XM_PERMUTE_1W, XM_PERMUTE_0Z, XM_PERMUTE_0W};
- static CONST XMVECTORU32 Permute0 = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Z, XM_PERMUTE_1Y};
- static CONST XMVECTORU32 Permute1 = {XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z};
- static CONST XMVECTORU32 Permute2 = {XM_PERMUTE_1Z, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_1X};
- static CONST XMVECTORU32 Permute3 = {XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_1X, XM_PERMUTE_0W};
-
- M00 = XMVectorSplatX(M.r[0]);
- M11 = XMVectorSplatY(M.r[1]);
- M22 = XMVectorSplatZ(M.r[2]);
-
- Q0 = XMVectorMultiply(SignPNNP.v, M00);
- Q0 = XMVectorMultiplyAdd(SignNPNP.v, M11, Q0);
- Q0 = XMVectorMultiplyAdd(SignNNPP.v, M22, Q0);
-
- Q1 = XMVectorAdd(Q0, g_XMOne.v);
-
- Rsq = XMVectorReciprocalSqrt(Q1);
- VEqualsNaN = XMVectorIsNaN(Rsq);
- Sqrt = XMVectorMultiply(Q1, Rsq);
- Q1 = XMVectorSelect(Sqrt, Q1, VEqualsNaN);
-
- Q1 = XMVectorMultiply(Q1, g_XMOneHalf.v);
-
- SQ1 = XMVectorMultiply(Rsq, g_XMOneHalf.v);
-
- CQ0 = XMVectorPermute(Q0, Q0, Permute0X0X0Y0W.v);
- CQ1 = XMVectorPermute(Q0, g_XMEpsilon.v, Permute0Y0Z0Z1W.v);
- C = XMVectorGreaterOrEqual(CQ0, CQ1);
-
- CX = XMVectorSplatX(C);
- CY = XMVectorSplatY(C);
- CZ = XMVectorSplatZ(C);
- CW = XMVectorSplatW(C);
-
- PermuteSplat = XMVectorSelect(SplatZ.v, SplatY.v, CZ);
- SignB = XMVectorSelect(SignNPPP.v, SignPPNP.v, CZ);
- PermuteControl = XMVectorSelect(Permute2.v, Permute1.v, CZ);
-
- PermuteSplat = XMVectorSelect(PermuteSplat, SplatZ.v, CX);
- SignB = XMVectorSelect(SignB, SignNPPP.v, CX);
- PermuteControl = XMVectorSelect(PermuteControl, Permute2.v, CX);
-
- PermuteSplatT = XMVectorSelect(PermuteSplat,SplatX.v, CY);
- SignBT = XMVectorSelect(SignB, SignPNPP.v, CY);
- PermuteControlT = XMVectorSelect(PermuteControl,Permute0.v, CY);
-
- PermuteSplat = XMVectorSelect(PermuteSplat, PermuteSplatT, CX);
- SignB = XMVectorSelect(SignB, SignBT, CX);
- PermuteControl = XMVectorSelect(PermuteControl, PermuteControlT, CX);
-
- PermuteSplat = XMVectorSelect(PermuteSplat,SplatW.v, CW);
- SignB = XMVectorSelect(SignB, g_XMNegativeOne.v, CW);
- PermuteControl = XMVectorSelect(PermuteControl,Permute3.v, CW);
-
- Scale = XMVectorPermute(SQ1, SQ1, PermuteSplat);
-
- P = XMVectorPermute(M.r[1], M.r[2],PermuteC.v); // {M10, M12, M20, M21}
- A = XMVectorPermute(M.r[0], P, PermuteA.v); // {M01, M12, M20, M03}
- B = XMVectorPermute(M.r[0], P, PermuteB.v); // {M10, M21, M02, M03}
-
- Q2 = XMVectorMultiplyAdd(SignB, B, A);
- Q2 = XMVectorMultiply(Q2, Scale);
-
- Result = XMVectorPermute(Q1, Q2, PermuteControl);
-
- return Result;
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Conversion operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMQuaternionToAxisAngle
-(
- XMVECTOR* pAxis,
- FLOAT* pAngle,
- FXMVECTOR Q
-)
-{
- XMASSERT(pAxis);
- XMASSERT(pAngle);
-
- *pAxis = Q;
-
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- *pAngle = 2.0f * acosf(XMVectorGetW(Q));
-#else
- *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q));
-#endif
-}
-
-/****************************************************************************
- *
- * Plane
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMPlaneEqual
-(
- FXMVECTOR P1,
- FXMVECTOR P2
-)
-{
- return XMVector4Equal(P1, P2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMPlaneNearEqual
-(
- FXMVECTOR P1,
- FXMVECTOR P2,
- FXMVECTOR Epsilon
-)
-{
- XMVECTOR NP1 = XMPlaneNormalize(P1);
- XMVECTOR NP2 = XMPlaneNormalize(P2);
- return XMVector4NearEqual(NP1, NP2, Epsilon);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMPlaneNotEqual
-(
- FXMVECTOR P1,
- FXMVECTOR P2
-)
-{
- return XMVector4NotEqual(P1, P2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMPlaneIsNaN
-(
- FXMVECTOR P
-)
-{
- return XMVector4IsNaN(P);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMPlaneIsInfinite
-(
- FXMVECTOR P
-)
-{
- return XMVector4IsInfinite(P);
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneDot
-(
- FXMVECTOR P,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- return XMVector4Dot(P, V);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128 vTemp2 = V;
- __m128 vTemp = _mm_mul_ps(P,vTemp2);
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position
- vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W;
- vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position
- vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together
- return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneDotCoord
-(
- FXMVECTOR P,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V3;
- XMVECTOR Result;
-
- // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3]
- V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v);
- Result = XMVector4Dot(P, V3);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp2 = _mm_and_ps(V,g_XMMask3);
- vTemp2 = _mm_or_ps(vTemp2,g_XMIdentityR3);
- XMVECTOR vTemp = _mm_mul_ps(P,vTemp2);
- vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position
- vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W;
- vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position
- vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together
- return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneDotNormal
-(
- FXMVECTOR P,
- FXMVECTOR V
-)
-{
- return XMVector3Dot(P, V);
-}
-
-//------------------------------------------------------------------------------
-// XMPlaneNormalizeEst uses a reciprocal estimate and
-// returns QNaN on zero and infinite vectors.
-
-XMFINLINE XMVECTOR XMPlaneNormalizeEst
-(
- FXMVECTOR P
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result = XMVector3ReciprocalLength(P);
- Result = XMVectorMultiply(P, Result);
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product
- XMVECTOR vDot = _mm_mul_ps(P,P);
- // x=Dot.y, y=Dot.z
- XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1));
- // Result.x = x+y
- vDot = _mm_add_ss(vDot,vTemp);
- // x=Dot.z
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1));
- // Result.x = (x+y)+z
- vDot = _mm_add_ss(vDot,vTemp);
- // Splat x
- vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0));
- // Get the reciprocal
- vDot = _mm_rsqrt_ps(vDot);
- // Get the reciprocal
- vDot = _mm_mul_ps(vDot,P);
- return vDot;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneNormalize
-(
- FXMVECTOR P
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT fLengthSq = sqrtf((P.vector4_f32[0]*P.vector4_f32[0])+(P.vector4_f32[1]*P.vector4_f32[1])+(P.vector4_f32[2]*P.vector4_f32[2]));
- // Prevent divide by zero
- if (fLengthSq) {
- fLengthSq = 1.0f/fLengthSq;
- }
- {
- XMVECTOR vResult = {
- P.vector4_f32[0]*fLengthSq,
- P.vector4_f32[1]*fLengthSq,
- P.vector4_f32[2]*fLengthSq,
- P.vector4_f32[3]*fLengthSq
- };
- return vResult;
- }
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x,y and z only
- XMVECTOR vLengthSq = _mm_mul_ps(P,P);
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,1,2,1));
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1));
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- // Prepare for the division
- XMVECTOR vResult = _mm_sqrt_ps(vLengthSq);
- // Failsafe on zero (Or epsilon) length planes
- // If the length is infinity, set the elements to zero
- vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity);
- // Reciprocal mul to perform the normalization
- vResult = _mm_div_ps(P,vResult);
- // Any that are infinity, set to zero
- vResult = _mm_and_ps(vResult,vLengthSq);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneIntersectLine
-(
- FXMVECTOR P,
- FXMVECTOR LinePoint1,
- FXMVECTOR LinePoint2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1;
- XMVECTOR V2;
- XMVECTOR D;
- XMVECTOR ReciprocalD;
- XMVECTOR VT;
- XMVECTOR Point;
- XMVECTOR Zero;
- XMVECTOR Control;
- XMVECTOR Result;
-
- V1 = XMVector3Dot(P, LinePoint1);
- V2 = XMVector3Dot(P, LinePoint2);
- D = XMVectorSubtract(V1, V2);
-
- ReciprocalD = XMVectorReciprocal(D);
- VT = XMPlaneDotCoord(P, LinePoint1);
- VT = XMVectorMultiply(VT, ReciprocalD);
-
- Point = XMVectorSubtract(LinePoint2, LinePoint1);
- Point = XMVectorMultiplyAdd(Point, VT, LinePoint1);
-
- Zero = XMVectorZero();
- Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v);
-
- Result = XMVectorSelect(Point, g_XMQNaN.v, Control);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1;
- XMVECTOR V2;
- XMVECTOR D;
- XMVECTOR VT;
- XMVECTOR Point;
- XMVECTOR Zero;
- XMVECTOR Control;
- XMVECTOR Result;
-
- V1 = XMVector3Dot(P, LinePoint1);
- V2 = XMVector3Dot(P, LinePoint2);
- D = _mm_sub_ps(V1, V2);
-
- VT = XMPlaneDotCoord(P, LinePoint1);
- VT = _mm_div_ps(VT, D);
-
- Point = _mm_sub_ps(LinePoint2, LinePoint1);
- Point = _mm_mul_ps(Point,VT);
- Point = _mm_add_ps(Point,LinePoint1);
- Zero = XMVectorZero();
- Control = XMVectorNearEqual(D, Zero, g_XMEpsilon);
- Result = XMVectorSelect(Point, g_XMQNaN, Control);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE VOID XMPlaneIntersectPlane
-(
- XMVECTOR* pLinePoint1,
- XMVECTOR* pLinePoint2,
- FXMVECTOR P1,
- FXMVECTOR P2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1;
- XMVECTOR V2;
- XMVECTOR V3;
- XMVECTOR LengthSq;
- XMVECTOR RcpLengthSq;
- XMVECTOR Point;
- XMVECTOR P1W;
- XMVECTOR P2W;
- XMVECTOR Control;
- XMVECTOR LinePoint1;
- XMVECTOR LinePoint2;
-
- XMASSERT(pLinePoint1);
- XMASSERT(pLinePoint2);
-
- V1 = XMVector3Cross(P2, P1);
-
- LengthSq = XMVector3LengthSq(V1);
-
- V2 = XMVector3Cross(P2, V1);
-
- P1W = XMVectorSplatW(P1);
- Point = XMVectorMultiply(V2, P1W);
-
- V3 = XMVector3Cross(V1, P1);
-
- P2W = XMVectorSplatW(P2);
- Point = XMVectorMultiplyAdd(V3, P2W, Point);
-
- RcpLengthSq = XMVectorReciprocal(LengthSq);
- LinePoint1 = XMVectorMultiply(Point, RcpLengthSq);
-
- LinePoint2 = XMVectorAdd(LinePoint1, V1);
-
- Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v);
- *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN.v, Control);
- *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN.v, Control);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pLinePoint1);
- XMASSERT(pLinePoint2);
- XMVECTOR V1;
- XMVECTOR V2;
- XMVECTOR V3;
- XMVECTOR LengthSq;
- XMVECTOR Point;
- XMVECTOR P1W;
- XMVECTOR P2W;
- XMVECTOR Control;
- XMVECTOR LinePoint1;
- XMVECTOR LinePoint2;
-
- V1 = XMVector3Cross(P2, P1);
-
- LengthSq = XMVector3LengthSq(V1);
-
- V2 = XMVector3Cross(P2, V1);
-
- P1W = _mm_shuffle_ps(P1,P1,_MM_SHUFFLE(3,3,3,3));
- Point = _mm_mul_ps(V2, P1W);
-
- V3 = XMVector3Cross(V1, P1);
-
- P2W = _mm_shuffle_ps(P2,P2,_MM_SHUFFLE(3,3,3,3));
- V3 = _mm_mul_ps(V3,P2W);
- Point = _mm_add_ps(Point,V3);
- LinePoint1 = _mm_div_ps(Point,LengthSq);
-
- LinePoint2 = _mm_add_ps(LinePoint1, V1);
-
- Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon);
- *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN, Control);
- *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN, Control);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneTransform
-(
- FXMVECTOR P,
- CXMMATRIX M
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR X;
- XMVECTOR Y;
- XMVECTOR Z;
- XMVECTOR W;
- XMVECTOR Result;
-
- W = XMVectorSplatW(P);
- Z = XMVectorSplatZ(P);
- Y = XMVectorSplatY(P);
- X = XMVectorSplatX(P);
-
- Result = XMVectorMultiply(W, M.r[3]);
- Result = XMVectorMultiplyAdd(Z, M.r[2], Result);
- Result = XMVectorMultiplyAdd(Y, M.r[1], Result);
- Result = XMVectorMultiplyAdd(X, M.r[0], Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0));
- XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1));
- XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2));
- XMVECTOR W = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3));
- X = _mm_mul_ps(X, M.r[0]);
- Y = _mm_mul_ps(Y, M.r[1]);
- Z = _mm_mul_ps(Z, M.r[2]);
- W = _mm_mul_ps(W, M.r[3]);
- X = _mm_add_ps(X,Z);
- Y = _mm_add_ps(Y,W);
- X = _mm_add_ps(X,Y);
- return X;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMFLOAT4* XMPlaneTransformStream
-(
- XMFLOAT4* pOutputStream,
- UINT OutputStride,
- CONST XMFLOAT4* pInputStream,
- UINT InputStride,
- UINT PlaneCount,
- CXMMATRIX M
-)
-{
- return XMVector4TransformStream(pOutputStream,
- OutputStride,
- pInputStream,
- InputStride,
- PlaneCount,
- M);
-}
-
-//------------------------------------------------------------------------------
-// Conversion operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneFromPointNormal
-(
- FXMVECTOR Point,
- FXMVECTOR Normal
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR W;
- XMVECTOR Result;
-
- W = XMVector3Dot(Point, Normal);
- W = XMVectorNegate(W);
- Result = XMVectorSelect(W, Normal, g_XMSelect1110.v);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR W;
- XMVECTOR Result;
- W = XMVector3Dot(Point,Normal);
- W = _mm_mul_ps(W,g_XMNegativeOne);
- Result = _mm_and_ps(Normal,g_XMMask3);
- W = _mm_and_ps(W,g_XMMaskW);
- Result = _mm_or_ps(Result,W);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMPlaneFromPoints
-(
- FXMVECTOR Point1,
- FXMVECTOR Point2,
- FXMVECTOR Point3
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR N;
- XMVECTOR D;
- XMVECTOR V21;
- XMVECTOR V31;
- XMVECTOR Result;
-
- V21 = XMVectorSubtract(Point1, Point2);
- V31 = XMVectorSubtract(Point1, Point3);
-
- N = XMVector3Cross(V21, V31);
- N = XMVector3Normalize(N);
-
- D = XMPlaneDotNormal(N, Point1);
- D = XMVectorNegate(D);
-
- Result = XMVectorSelect(D, N, g_XMSelect1110.v);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR N;
- XMVECTOR D;
- XMVECTOR V21;
- XMVECTOR V31;
- XMVECTOR Result;
-
- V21 = _mm_sub_ps(Point1, Point2);
- V31 = _mm_sub_ps(Point1, Point3);
-
- N = XMVector3Cross(V21, V31);
- N = XMVector3Normalize(N);
-
- D = XMPlaneDotNormal(N, Point1);
- D = _mm_mul_ps(D,g_XMNegativeOne);
- N = _mm_and_ps(N,g_XMMask3);
- D = _mm_and_ps(D,g_XMMaskW);
- Result = _mm_or_ps(D,N);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-/****************************************************************************
- *
- * Color
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorEqual
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4Equal(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorNotEqual
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4NotEqual(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorGreater
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4Greater(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorGreaterOrEqual
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4GreaterOrEqual(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorLess
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4Less(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorLessOrEqual
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVector4LessOrEqual(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorIsNaN
-(
- FXMVECTOR C
-)
-{
- return XMVector4IsNaN(C);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMColorIsInfinite
-(
- FXMVECTOR C
-)
-{
- return XMVector4IsInfinite(C);
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMColorNegative
-(
- FXMVECTOR vColor
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-// XMASSERT(XMVector4GreaterOrEqual(C, XMVectorReplicate(0.0f)));
-// XMASSERT(XMVector4LessOrEqual(C, XMVectorReplicate(1.0f)));
- XMVECTOR vResult = {
- 1.0f - vColor.vector4_f32[0],
- 1.0f - vColor.vector4_f32[1],
- 1.0f - vColor.vector4_f32[2],
- vColor.vector4_f32[3]
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Negate only x,y and z.
- XMVECTOR vTemp = _mm_xor_ps(vColor,g_XMNegate3);
- // Add 1,1,1,0 to -x,-y,-z,w
- return _mm_add_ps(vTemp,g_XMOne3);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMColorModulate
-(
- FXMVECTOR C1,
- FXMVECTOR C2
-)
-{
- return XMVectorMultiply(C1, C2);
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMColorAdjustSaturation
-(
- FXMVECTOR vColor,
- FLOAT fSaturation
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- CONST XMVECTOR gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f};
-
- // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2];
- // Result = (C - Luminance) * Saturation + Luminance;
-
- FLOAT fLuminance = (vColor.vector4_f32[0]*gvLuminance.vector4_f32[0])+(vColor.vector4_f32[1]*gvLuminance.vector4_f32[1])+(vColor.vector4_f32[2]*gvLuminance.vector4_f32[2]);
- XMVECTOR vResult = {
- ((vColor.vector4_f32[0] - fLuminance)*fSaturation)+fLuminance,
- ((vColor.vector4_f32[1] - fLuminance)*fSaturation)+fLuminance,
- ((vColor.vector4_f32[2] - fLuminance)*fSaturation)+fLuminance,
- vColor.vector4_f32[3]};
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f};
-// Mul RGB by intensity constants
- XMVECTOR vLuminance = _mm_mul_ps(vColor,gvLuminance);
-// vResult.x = vLuminance.y, vResult.y = vLuminance.y,
-// vResult.z = vLuminance.z, vResult.w = vLuminance.z
- XMVECTOR vResult = vLuminance;
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,1,1));
-// vLuminance.x += vLuminance.y
- vLuminance = _mm_add_ss(vLuminance,vResult);
-// Splat vLuminance.z
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,2,2));
-// vLuminance.x += vLuminance.z (Dot product)
- vLuminance = _mm_add_ss(vLuminance,vResult);
-// Splat vLuminance
- vLuminance = _mm_shuffle_ps(vLuminance,vLuminance,_MM_SHUFFLE(0,0,0,0));
-// Splat fSaturation
- XMVECTOR vSaturation = _mm_set_ps1(fSaturation);
-// vResult = ((vColor-vLuminance)*vSaturation)+vLuminance;
- vResult = _mm_sub_ps(vColor,vLuminance);
- vResult = _mm_mul_ps(vResult,vSaturation);
- vResult = _mm_add_ps(vResult,vLuminance);
-// Retain w from the source color
- vLuminance = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w
- vResult = _mm_shuffle_ps(vResult,vLuminance,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMColorAdjustContrast
-(
- FXMVECTOR vColor,
- FLOAT fContrast
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- // Result = (vColor - 0.5f) * fContrast + 0.5f;
- XMVECTOR vResult = {
- ((vColor.vector4_f32[0]-0.5f) * fContrast) + 0.5f,
- ((vColor.vector4_f32[1]-0.5f) * fContrast) + 0.5f,
- ((vColor.vector4_f32[2]-0.5f) * fContrast) + 0.5f,
- vColor.vector4_f32[3] // Leave W untouched
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale
- XMVECTOR vResult = _mm_sub_ps(vColor,g_XMOneHalf); // Subtract 0.5f from the source (Saving source)
- vResult = _mm_mul_ps(vResult,vScale); // Mul by scale
- vResult = _mm_add_ps(vResult,g_XMOneHalf); // Add 0.5f
-// Retain w from the source color
- vScale = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w
- vResult = _mm_shuffle_ps(vResult,vScale,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-/****************************************************************************
- *
- * Miscellaneous
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-
-XMINLINE BOOL XMVerifyCPUSupport()
-{
-#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_SSE_INTRINSICS_)
- return TRUE;
-#else // _XM_SSE_INTRINSICS_
- // Note that on Windows 2000 or older, SSE2 detection is not supported so this will always fail
- // Detecting SSE2 on older versions of Windows would require using cpuid directly
- return ( IsProcessorFeaturePresent( PF_XMMI_INSTRUCTIONS_AVAILABLE ) && IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ) );
-#endif
-}
-
-
-//------------------------------------------------------------------------------
-
-#define XMASSERT_LINE_STRING_SIZE 16
-
-XMINLINE VOID XMAssert
-(
- CONST CHAR* pExpression,
- CONST CHAR* pFileName,
- UINT LineNumber
-)
-{
- CHAR aLineString[XMASSERT_LINE_STRING_SIZE];
- CHAR* pLineString;
- UINT Line;
-
- aLineString[XMASSERT_LINE_STRING_SIZE - 2] = '0';
- aLineString[XMASSERT_LINE_STRING_SIZE - 1] = '\0';
- for (Line = LineNumber, pLineString = aLineString + XMASSERT_LINE_STRING_SIZE - 2;
- Line != 0 && pLineString >= aLineString;
- Line /= 10, pLineString--)
- {
- *pLineString = (CHAR)('0' + (Line % 10));
- }
-
-#ifndef NO_OUTPUT_DEBUG_STRING
- OutputDebugStringA("Assertion failed: ");
- OutputDebugStringA(pExpression);
- OutputDebugStringA(", file ");
- OutputDebugStringA(pFileName);
- OutputDebugStringA(", line ");
- OutputDebugStringA(pLineString + 1);
- OutputDebugStringA("\r\n");
-#else
- DbgPrint("Assertion failed: %s, file %s, line %d\r\n", pExpression, pFileName, LineNumber);
-#endif
-
- __debugbreak();
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMFresnelTerm
-(
- FXMVECTOR CosIncidentAngle,
- FXMVECTOR RefractionIndex
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR G;
- XMVECTOR D, S;
- XMVECTOR V0, V1, V2, V3;
- XMVECTOR Result;
-
- // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where
- // c = CosIncidentAngle
- // g = sqrt(c^2 + RefractionIndex^2 - 1)
-
- XMASSERT(!XMVector4IsInfinite(CosIncidentAngle));
-
- G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v);
- G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G);
- G = XMVectorAbs(G);
- G = XMVectorSqrt(G);
-
- S = XMVectorAdd(G, CosIncidentAngle);
- D = XMVectorSubtract(G, CosIncidentAngle);
-
- V0 = XMVectorMultiply(D, D);
- V1 = XMVectorMultiply(S, S);
- V1 = XMVectorReciprocal(V1);
- V0 = XMVectorMultiply(g_XMOneHalf.v, V0);
- V0 = XMVectorMultiply(V0, V1);
-
- V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v);
- V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v);
- V2 = XMVectorMultiply(V2, V2);
- V3 = XMVectorMultiply(V3, V3);
- V3 = XMVectorReciprocal(V3);
- V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v);
-
- Result = XMVectorMultiply(V0, V2);
-
- Result = XMVectorSaturate(Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where
- // c = CosIncidentAngle
- // g = sqrt(c^2 + RefractionIndex^2 - 1)
-
- XMASSERT(!XMVector4IsInfinite(CosIncidentAngle));
-
- // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2))
- XMVECTOR G = _mm_mul_ps(RefractionIndex,RefractionIndex);
- XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle,CosIncidentAngle);
- G = _mm_sub_ps(G,g_XMOne);
- vTemp = _mm_add_ps(vTemp,G);
- // max((0-vTemp),vTemp) == abs(vTemp)
- // The abs is needed to deal with refraction and cosine being zero
- G = _mm_setzero_ps();
- G = _mm_sub_ps(G,vTemp);
- G = _mm_max_ps(G,vTemp);
- // Last operation, the sqrt()
- G = _mm_sqrt_ps(G);
-
- // Calc G-C and G+C
- XMVECTOR GAddC = _mm_add_ps(G,CosIncidentAngle);
- XMVECTOR GSubC = _mm_sub_ps(G,CosIncidentAngle);
- // Perform the term (0.5f *(g - c)^2) / (g + c)^2
- XMVECTOR vResult = _mm_mul_ps(GSubC,GSubC);
- vTemp = _mm_mul_ps(GAddC,GAddC);
- vResult = _mm_mul_ps(vResult,g_XMOneHalf);
- vResult = _mm_div_ps(vResult,vTemp);
- // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1)
- GAddC = _mm_mul_ps(GAddC,CosIncidentAngle);
- GSubC = _mm_mul_ps(GSubC,CosIncidentAngle);
- GAddC = _mm_sub_ps(GAddC,g_XMOne);
- GSubC = _mm_add_ps(GSubC,g_XMOne);
- GAddC = _mm_mul_ps(GAddC,GAddC);
- GSubC = _mm_mul_ps(GSubC,GSubC);
- GAddC = _mm_div_ps(GAddC,GSubC);
- GAddC = _mm_add_ps(GAddC,g_XMOne);
- // Multiply the two term parts
- vResult = _mm_mul_ps(vResult,GAddC);
- // Clamp to 0.0 - 1.0f
- vResult = _mm_max_ps(vResult,g_XMZero);
- vResult = _mm_min_ps(vResult,g_XMOne);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMScalarNearEqual
-(
- FLOAT S1,
- FLOAT S2,
- FLOAT Epsilon
-)
-{
- FLOAT Delta = S1 - S2;
-#if defined(_XM_NO_INTRINSICS_)
- UINT AbsDelta = *(UINT*)&Delta & 0x7FFFFFFF;
- return (*(FLOAT*)&AbsDelta <= Epsilon);
-#elif defined(_XM_SSE_INTRINSICS_)
- return (fabsf(Delta) <= Epsilon);
-#else
- return (__fabs(Delta) <= Epsilon);
-#endif
-}
-
-//------------------------------------------------------------------------------
-// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI
-XMFINLINE FLOAT XMScalarModAngle
-(
- FLOAT Angle
-)
-{
- // Note: The modulo is performed with unsigned math only to work
- // around a precision error on numbers that are close to PI
- float fTemp;
-#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_VMX128_INTRINSICS_)
- // Normalize the range from 0.0f to XM_2PI
- Angle = Angle + XM_PI;
- // Perform the modulo, unsigned
- fTemp = fabsf(Angle);
- fTemp = fTemp - (XM_2PI * (FLOAT)((INT)(fTemp/XM_2PI)));
- // Restore the number to the range of -XM_PI to XM_PI-epsilon
- fTemp = fTemp - XM_PI;
- // If the modulo'd value was negative, restore negation
- if (Angle<0.0f) {
- fTemp = -fTemp;
- }
- return fTemp;
-#else
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE FLOAT XMScalarSin
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ValueMod;
- FLOAT ValueSq;
- XMVECTOR V0123, V0246, V1357, V9111315, V17192123;
- XMVECTOR V1, V7, V8;
- XMVECTOR R0, R1, R2;
-
- ValueMod = XMScalarModAngle(Value);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! +
- // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
-
- ValueSq = ValueMod * ValueMod;
-
- V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod);
- V1 = XMVectorSplatY(V0123);
- V0246 = XMVectorMultiply(V0123, V0123);
- V1357 = XMVectorMultiply(V0246, V1);
- V7 = XMVectorSplatW(V1357);
- V8 = XMVectorMultiply(V7, V1);
- V9111315 = XMVectorMultiply(V1357, V8);
- V17192123 = XMVectorMultiply(V9111315, V8);
-
- R0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v);
- R1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v);
- R2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v);
-
- return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return sinf( Value );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE FLOAT XMScalarCos
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ValueMod;
- FLOAT ValueSq;
- XMVECTOR V0123, V0246, V8101214, V16182022;
- XMVECTOR V2, V6, V8;
- XMVECTOR R0, R1, R2;
-
- ValueMod = XMScalarModAngle(Value);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! +
- // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
-
- ValueSq = ValueMod * ValueMod;
-
- V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod);
- V0246 = XMVectorMultiply(V0123, V0123);
-
- V2 = XMVectorSplatZ(V0123);
- V6 = XMVectorSplatW(V0246);
- V8 = XMVectorMultiply(V6, V2);
-
- V8101214 = XMVectorMultiply(V0246, V8);
- V16182022 = XMVectorMultiply(V8101214, V8);
-
- R0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v);
- R1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v);
- R2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v);
-
- return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return cosf(Value);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE VOID XMScalarSinCos
-(
- FLOAT* pSin,
- FLOAT* pCos,
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ValueMod;
- FLOAT ValueSq;
- XMVECTOR V0123, V0246, V1357, V8101214, V9111315, V16182022, V17192123;
- XMVECTOR V1, V2, V6, V8;
- XMVECTOR S0, S1, S2, C0, C1, C2;
-
- XMASSERT(pSin);
- XMASSERT(pCos);
-
- ValueMod = XMScalarModAngle(Value);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! +
- // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! +
- // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
-
- ValueSq = ValueMod * ValueMod;
-
- V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod);
-
- V1 = XMVectorSplatY(V0123);
- V2 = XMVectorSplatZ(V0123);
-
- V0246 = XMVectorMultiply(V0123, V0123);
- V1357 = XMVectorMultiply(V0246, V1);
-
- V6 = XMVectorSplatW(V0246);
- V8 = XMVectorMultiply(V6, V2);
-
- V8101214 = XMVectorMultiply(V0246, V8);
- V9111315 = XMVectorMultiply(V1357, V8);
- V16182022 = XMVectorMultiply(V8101214, V8);
- V17192123 = XMVectorMultiply(V9111315, V8);
-
- C0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v);
- S0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v);
- C1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v);
- S1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v);
- C2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v);
- S2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v);
-
- *pCos = C0.vector4_f32[0] + C1.vector4_f32[0] + C2.vector4_f32[0];
- *pSin = S0.vector4_f32[0] + S1.vector4_f32[0] + S2.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSin);
- XMASSERT(pCos);
-
- *pSin = sinf(Value);
- *pCos = cosf(Value);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE FLOAT XMScalarASin
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT AbsValue, Value2, Value3, D;
- XMVECTOR AbsV, R0, R1, Result;
- XMVECTOR V3;
-
- *(UINT*)&AbsValue = *(UINT*)&Value & 0x7FFFFFFF;
-
- Value2 = Value * AbsValue;
- Value3 = Value * Value2;
- D = (Value - Value2) / sqrtf(1.00000011921f - AbsValue);
-
- AbsV = XMVectorReplicate(AbsValue);
-
- V3.vector4_f32[0] = Value3;
- V3.vector4_f32[1] = 1.0f;
- V3.vector4_f32[2] = Value3;
- V3.vector4_f32[3] = 1.0f;
-
- R1 = XMVectorSet(D, D, Value, Value);
- R1 = XMVectorMultiply(R1, V3);
-
- R0 = XMVectorMultiplyAdd(AbsV, g_XMASinCoefficients0.v, g_XMASinCoefficients1.v);
- R0 = XMVectorMultiplyAdd(AbsV, R0, g_XMASinCoefficients2.v);
-
- Result = XMVector4Dot(R0, R1);
-
- return Result.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return asinf(Value);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE FLOAT XMScalarACos
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- return XM_PIDIV2 - XMScalarASin(Value);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return acosf(Value);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE FLOAT XMScalarSinEst
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ValueSq;
- XMVECTOR V;
- XMVECTOR Y;
- XMVECTOR Result;
-
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
-
- ValueSq = Value * Value;
-
- V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value);
- Y = XMVectorSplatY(V);
- V = XMVectorMultiply(V, V);
- V = XMVectorMultiply(V, Y);
-
- Result = XMVector4Dot(V, g_XMSinEstCoefficients.v);
-
- return Result.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
- float ValueSq = Value*Value;
- XMVECTOR vValue = _mm_set_ps1(Value);
- XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f);
- vTemp = _mm_mul_ps(vTemp,vTemp);
- vTemp = _mm_mul_ps(vTemp,vValue);
- // vTemp = Value,Value^3,Value^5,Value^7
- vTemp = _mm_mul_ps(vTemp,g_XMSinEstCoefficients);
- vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position
- vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W;
- vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position
- vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- return _mm_cvtss_f32(vTemp);
-#else
- return vTemp.m128_f32[0];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE FLOAT XMScalarCosEst
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT ValueSq;
- XMVECTOR V;
- XMVECTOR Result;
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI)
- ValueSq = Value * Value;
- V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value);
- V = XMVectorMultiply(V, V);
- Result = XMVector4Dot(V, g_XMCosEstCoefficients.v);
- return Result.vector4_f32[0];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
- float ValueSq = Value*Value;
- XMVECTOR vValue = _mm_setzero_ps();
- XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f);
- vTemp = _mm_mul_ps(vTemp,vTemp);
- // vTemp = 1.0f,Value^2,Value^4,Value^6
- vTemp = _mm_mul_ps(vTemp,g_XMCosEstCoefficients);
- vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position
- vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W;
- vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position
- vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together
- vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- return _mm_cvtss_f32(vTemp);
-#else
- return vTemp.m128_f32[0];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMScalarSinCosEst
-(
- FLOAT* pSin,
- FLOAT* pCos,
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT ValueSq;
- XMVECTOR V, Sin, Cos;
- XMVECTOR Y;
-
- XMASSERT(pSin);
- XMASSERT(pCos);
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI)
-
- ValueSq = Value * Value;
- V = XMVectorSet(1.0f, Value, ValueSq, Value * ValueSq);
- Y = XMVectorSplatY(V);
- Cos = XMVectorMultiply(V, V);
- Sin = XMVectorMultiply(Cos, Y);
-
- Cos = XMVector4Dot(Cos, g_XMCosEstCoefficients.v);
- Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients.v);
-
- *pCos = Cos.vector4_f32[0];
- *pSin = Sin.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSin);
- XMASSERT(pCos);
- XMASSERT(Value >= -XM_PI);
- XMASSERT(Value < XM_PI);
- float ValueSq = Value * Value;
- XMVECTOR Cos = _mm_set_ps(Value * ValueSq,ValueSq,Value,1.0f);
- XMVECTOR Sin = _mm_set_ps1(Value);
- Cos = _mm_mul_ps(Cos,Cos);
- Sin = _mm_mul_ps(Sin,Cos);
- // Cos = 1.0f,Value^2,Value^4,Value^6
- Cos = XMVector4Dot(Cos,g_XMCosEstCoefficients);
- _mm_store_ss(pCos,Cos);
- // Sin = Value,Value^3,Value^5,Value^7
- Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients);
- _mm_store_ss(pSin,Sin);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE FLOAT XMScalarASinEst
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR VR, CR, CS;
- XMVECTOR Result;
- FLOAT AbsV, V2, D;
- CONST FLOAT OnePlusEps = 1.00000011921f;
-
- *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF;
- V2 = Value * AbsV;
- D = OnePlusEps - AbsV;
-
- CS = XMVectorSet(Value, 1.0f, 1.0f, V2);
- VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV);
- CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v);
-
- Result = XMVector4Dot(VR, CR);
-
- return Result.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- CONST FLOAT OnePlusEps = 1.00000011921f;
- FLOAT AbsV = fabsf(Value);
- FLOAT V2 = Value * AbsV; // Square with sign retained
- FLOAT D = OnePlusEps - AbsV;
-
- XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value);
- XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D));
- Result = _mm_mul_ps(Result, g_XMASinEstCoefficients);
- Result = XMVector4Dot(VR,Result);
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- return _mm_cvtss_f32(Result);
-#else
- return Result.m128_f32[0];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE FLOAT XMScalarACosEst
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR VR, CR, CS;
- XMVECTOR Result;
- FLOAT AbsV, V2, D;
- CONST FLOAT OnePlusEps = 1.00000011921f;
-
- // return XM_PIDIV2 - XMScalarASin(Value);
-
- *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF;
- V2 = Value * AbsV;
- D = OnePlusEps - AbsV;
-
- CS = XMVectorSet(Value, 1.0f, 1.0f, V2);
- VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV);
- CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v);
-
- Result = XMVector4Dot(VR, CR);
-
- return XM_PIDIV2 - Result.vector4_f32[0];
-
-#elif defined(_XM_SSE_INTRINSICS_)
- CONST FLOAT OnePlusEps = 1.00000011921f;
- FLOAT AbsV = fabsf(Value);
- FLOAT V2 = Value * AbsV; // Value^2 retaining sign
- FLOAT D = OnePlusEps - AbsV;
- XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value);
- XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D));
- Result = _mm_mul_ps(Result,g_XMASinEstCoefficients);
- Result = XMVector4Dot(VR,Result);
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- return XM_PIDIV2 - _mm_cvtss_f32(Result);
-#else
- return XM_PIDIV2 - Result.m128_f32[0];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-#endif // __XNAMATHMISC_INL__
-
diff --git a/3rdparty/dxsdk/Include/xnamathvector.inl b/3rdparty/dxsdk/Include/xnamathvector.inl
deleted file mode 100644
index bfea1d00035..00000000000
--- a/3rdparty/dxsdk/Include/xnamathvector.inl
+++ /dev/null
@@ -1,13279 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation. All rights reserved.
-
-Module Name:
-
- xnamathvector.inl
-
-Abstract:
-
- XNA math library for Windows and Xbox 360: Vector functions
---*/
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#ifndef __XNAMATHVECTOR_INL__
-#define __XNAMATHVECTOR_INL__
-
-#if defined(_XM_NO_INTRINSICS_)
-#define XMISNAN(x) ((*(UINT*)&(x) & 0x7F800000) == 0x7F800000 && (*(UINT*)&(x) & 0x7FFFFF) != 0)
-#define XMISINF(x) ((*(UINT*)&(x) & 0x7FFFFFFF) == 0x7F800000)
-#endif
-
-/****************************************************************************
- *
- * General Vector
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Assignment operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Return a vector with all elements equaling zero
-XMFINLINE XMVECTOR XMVectorZero()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f};
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_setzero_ps();
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with four floating point values
-XMFINLINE XMVECTOR XMVectorSet
-(
- FLOAT x,
- FLOAT y,
- FLOAT z,
- FLOAT w
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTORF32 vResult = {x,y,z,w};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_set_ps( w, z, y, x );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with four integer values
-XMFINLINE XMVECTOR XMVectorSetInt
-(
- UINT x,
- UINT y,
- UINT z,
- UINT w
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTORU32 vResult = {x,y,z,w};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_set_epi32( w, z, y, x );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with a replicated floating point value
-XMFINLINE XMVECTOR XMVectorReplicate
-(
- FLOAT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
- XMVECTORF32 vResult = {Value,Value,Value,Value};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_set_ps1( Value );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with a replicated floating point value passed by pointer
-XMFINLINE XMVECTOR XMVectorReplicatePtr
-(
- CONST FLOAT *pValue
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
- FLOAT Value = pValue[0];
- XMVECTORF32 vResult = {Value,Value,Value,Value};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_load_ps1( pValue );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with a replicated integer value
-XMFINLINE XMVECTOR XMVectorReplicateInt
-(
- UINT Value
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
- XMVECTORU32 vResult = {Value,Value,Value,Value};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vTemp = _mm_set1_epi32( Value );
- return reinterpret_cast<const __m128 *>(&vTemp)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with a replicated integer value passed by pointer
-XMFINLINE XMVECTOR XMVectorReplicateIntPtr
-(
- CONST UINT *pValue
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
- UINT Value = pValue[0];
- XMVECTORU32 vResult = {Value,Value,Value,Value};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_load_ps1(reinterpret_cast<const float *>(pValue));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with all bits set (true mask)
-XMFINLINE XMVECTOR XMVectorTrueInt()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTORU32 vResult = {0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU};
- return vResult.v;
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_set1_epi32(-1);
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Initialize a vector with all bits clear (false mask)
-XMFINLINE XMVECTOR XMVectorFalseInt()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f};
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_setzero_ps();
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Replicate the x component of the vector
-XMFINLINE XMVECTOR XMVectorSplatX
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_f32[0] =
- vResult.vector4_f32[1] =
- vResult.vector4_f32[2] =
- vResult.vector4_f32[3] = V.vector4_f32[0];
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_shuffle_ps( V, V, _MM_SHUFFLE(0, 0, 0, 0) );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Replicate the y component of the vector
-XMFINLINE XMVECTOR XMVectorSplatY
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_f32[0] =
- vResult.vector4_f32[1] =
- vResult.vector4_f32[2] =
- vResult.vector4_f32[3] = V.vector4_f32[1];
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_shuffle_ps( V, V, _MM_SHUFFLE(1, 1, 1, 1) );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Replicate the z component of the vector
-XMFINLINE XMVECTOR XMVectorSplatZ
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_f32[0] =
- vResult.vector4_f32[1] =
- vResult.vector4_f32[2] =
- vResult.vector4_f32[3] = V.vector4_f32[2];
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_shuffle_ps( V, V, _MM_SHUFFLE(2, 2, 2, 2) );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Replicate the w component of the vector
-XMFINLINE XMVECTOR XMVectorSplatW
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_f32[0] =
- vResult.vector4_f32[1] =
- vResult.vector4_f32[2] =
- vResult.vector4_f32[3] = V.vector4_f32[3];
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_shuffle_ps( V, V, _MM_SHUFFLE(3, 3, 3, 3) );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a vector of 1.0f,1.0f,1.0f,1.0f
-XMFINLINE XMVECTOR XMVectorSplatOne()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_f32[0] =
- vResult.vector4_f32[1] =
- vResult.vector4_f32[2] =
- vResult.vector4_f32[3] = 1.0f;
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return g_XMOne;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a vector of INF,INF,INF,INF
-XMFINLINE XMVECTOR XMVectorSplatInfinity()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_u32[0] =
- vResult.vector4_u32[1] =
- vResult.vector4_u32[2] =
- vResult.vector4_u32[3] = 0x7F800000;
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return g_XMInfinity;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN
-XMFINLINE XMVECTOR XMVectorSplatQNaN()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_u32[0] =
- vResult.vector4_u32[1] =
- vResult.vector4_u32[2] =
- vResult.vector4_u32[3] = 0x7FC00000;
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return g_XMQNaN;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f
-XMFINLINE XMVECTOR XMVectorSplatEpsilon()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_u32[0] =
- vResult.vector4_u32[1] =
- vResult.vector4_u32[2] =
- vResult.vector4_u32[3] = 0x34000000;
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- return g_XMEpsilon;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f
-XMFINLINE XMVECTOR XMVectorSplatSignMask()
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult;
- vResult.vector4_u32[0] =
- vResult.vector4_u32[1] =
- vResult.vector4_u32[2] =
- vResult.vector4_u32[3] = 0x80000000U;
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_set1_epi32( 0x80000000 );
- return reinterpret_cast<__m128*>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return a floating point value via an index. This is not a recommended
-// function to use due to performance loss.
-XMFINLINE FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i)
-{
- XMASSERT( i <= 3 );
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_f32[i];
-#elif defined(_XM_SSE_INTRINSICS_)
- return V.m128_f32[i];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return the X component in an FPU register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE FLOAT XMVectorGetX(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_f32[0];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- return _mm_cvtss_f32(V);
-#else
- return V.m128_f32[0];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the Y component in an FPU register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE FLOAT XMVectorGetY(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_f32[1];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1));
- return _mm_cvtss_f32(vTemp);
-#else
- return V.m128_f32[1];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the Z component in an FPU register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE FLOAT XMVectorGetZ(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_f32[2];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- return _mm_cvtss_f32(vTemp);
-#else
- return V.m128_f32[2];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the W component in an FPU register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE FLOAT XMVectorGetW(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_f32[3];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER>=1500)
- XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3));
- return _mm_cvtss_f32(vTemp);
-#else
- return V.m128_f32[3];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Store a component indexed by i into a 32 bit float location in memory.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE VOID XMVectorGetByIndexPtr(FLOAT *f,FXMVECTOR V,UINT i)
-{
- XMASSERT( f != 0 );
- XMASSERT( i < 4 );
-#if defined(_XM_NO_INTRINSICS_)
- *f = V.vector4_f32[i];
-#elif defined(_XM_SSE_INTRINSICS_)
- *f = V.m128_f32[i];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Store the X component into a 32 bit float location in memory.
-XMFINLINE VOID XMVectorGetXPtr(FLOAT *x,FXMVECTOR V)
-{
- XMASSERT( x != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *x = V.vector4_f32[0];
-#elif defined(_XM_SSE_INTRINSICS_)
- _mm_store_ss(x,V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the Y component into a 32 bit float location in memory.
-XMFINLINE VOID XMVectorGetYPtr(FLOAT *y,FXMVECTOR V)
-{
- XMASSERT( y != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *y = V.vector4_f32[1];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1));
- _mm_store_ss(y,vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the Z component into a 32 bit float location in memory.
-XMFINLINE VOID XMVectorGetZPtr(FLOAT *z,FXMVECTOR V)
-{
- XMASSERT( z != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *z = V.vector4_f32[2];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_store_ss(z,vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the W component into a 32 bit float location in memory.
-XMFINLINE VOID XMVectorGetWPtr(FLOAT *w,FXMVECTOR V)
-{
- XMASSERT( w != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *w = V.vector4_f32[3];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3));
- _mm_store_ss(w,vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Return an integer value via an index. This is not a recommended
-// function to use due to performance loss.
-XMFINLINE UINT XMVectorGetIntByIndex(FXMVECTOR V, UINT i)
-{
- XMASSERT( i < 4 );
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_u32[i];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER<1400)
- XMVECTORU32 tmp;
- tmp.v = V;
- return tmp.u[i];
-#else
- return V.m128_u32[i];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Return the X component in an integer register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE UINT XMVectorGetIntX(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_u32[0];
-#elif defined(_XM_SSE_INTRINSICS_)
- return static_cast<UINT>(_mm_cvtsi128_si32(reinterpret_cast<const __m128i *>(&V)[0]));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the Y component in an integer register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE UINT XMVectorGetIntY(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_u32[1];
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast<const __m128i *>(&V)[0],_MM_SHUFFLE(1,1,1,1));
- return static_cast<UINT>(_mm_cvtsi128_si32(vResulti));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the Z component in an integer register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE UINT XMVectorGetIntZ(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_u32[2];
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast<const __m128i *>(&V)[0],_MM_SHUFFLE(2,2,2,2));
- return static_cast<UINT>(_mm_cvtsi128_si32(vResulti));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Return the W component in an integer register.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE UINT XMVectorGetIntW(FXMVECTOR V)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return V.vector4_u32[3];
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast<const __m128i *>(&V)[0],_MM_SHUFFLE(3,3,3,3));
- return static_cast<UINT>(_mm_cvtsi128_si32(vResulti));
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Store a component indexed by i into a 32 bit integer location in memory.
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE VOID XMVectorGetIntByIndexPtr(UINT *x,FXMVECTOR V,UINT i)
-{
- XMASSERT( x != 0 );
- XMASSERT( i < 4 );
-#if defined(_XM_NO_INTRINSICS_)
- *x = V.vector4_u32[i];
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_MSC_VER) && (_MSC_VER<1400)
- XMVECTORU32 tmp;
- tmp.v = V;
- *x = tmp.u[i];
-#else
- *x = V.m128_u32[i];
-#endif
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Store the X component into a 32 bit integer location in memory.
-XMFINLINE VOID XMVectorGetIntXPtr(UINT *x,FXMVECTOR V)
-{
- XMASSERT( x != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *x = V.vector4_u32[0];
-#elif defined(_XM_SSE_INTRINSICS_)
- _mm_store_ss(reinterpret_cast<float *>(x),V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the Y component into a 32 bit integer location in memory.
-XMFINLINE VOID XMVectorGetIntYPtr(UINT *y,FXMVECTOR V)
-{
- XMASSERT( y != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *y = V.vector4_u32[1];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1));
- _mm_store_ss(reinterpret_cast<float *>(y),vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the Z component into a 32 bit integer locaCantion in memory.
-XMFINLINE VOID XMVectorGetIntZPtr(UINT *z,FXMVECTOR V)
-{
- XMASSERT( z != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *z = V.vector4_u32[2];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2));
- _mm_store_ss(reinterpret_cast<float *>(z),vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Store the W component into a 32 bit integer location in memory.
-XMFINLINE VOID XMVectorGetIntWPtr(UINT *w,FXMVECTOR V)
-{
- XMASSERT( w != 0 );
-#if defined(_XM_NO_INTRINSICS_)
- *w = V.vector4_u32[3];
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3));
- _mm_store_ss(reinterpret_cast<float *>(w),vResult);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Set a single indexed floating point component
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetByIndex(FXMVECTOR V, FLOAT f,UINT i)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( i <= 3 );
- U = V;
- U.vector4_f32[i] = f;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( i <= 3 );
- XMVECTOR U = V;
- U.m128_f32[i] = f;
- return U;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets the X component of a vector to a passed floating point value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_f32[0] = x;
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_f32[0] = x;
- return vResult;
-#else
- XMVECTOR vResult = _mm_set_ss(x);
- vResult = _mm_move_ss(V,vResult);
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Y component of a vector to a passed floating point value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = y;
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_f32[1] = y;
- return vResult;
-#else
- // Swap y and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1));
- // Convert input to vector
- XMVECTOR vTemp = _mm_set_ss(y);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap y and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-// Sets the Z component of a vector to a passed floating point value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = z;
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_f32[2] = z;
- return vResult;
-#else
- // Swap z and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2));
- // Convert input to vector
- XMVECTOR vTemp = _mm_set_ss(z);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap z and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the W component of a vector to a passed floating point value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = w;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_f32[3] = w;
- return vResult;
-#else
- // Swap w and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3));
- // Convert input to vector
- XMVECTOR vTemp = _mm_set_ss(w);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap w and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets a component of a vector to a floating point value passed by pointer
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V,CONST FLOAT *f,UINT i)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( f != 0 );
- XMASSERT( i <= 3 );
- U = V;
- U.vector4_f32[i] = *f;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( f != 0 );
- XMASSERT( i <= 3 );
- XMVECTOR U = V;
- U.m128_f32[i] = *f;
- return U;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets the X component of a vector to a floating point value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetXPtr(FXMVECTOR V,CONST FLOAT *x)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( x != 0 );
- U.vector4_f32[0] = *x;
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( x != 0 );
- XMVECTOR vResult = _mm_load_ss(x);
- vResult = _mm_move_ss(V,vResult);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Y component of a vector to a floating point value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetYPtr(FXMVECTOR V,CONST FLOAT *y)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( y != 0 );
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = *y;
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( y != 0 );
- // Swap y and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(y);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap y and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Z component of a vector to a floating point value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetZPtr(FXMVECTOR V,CONST FLOAT *z)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( z != 0 );
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = *z;
- U.vector4_f32[3] = V.vector4_f32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( z != 0 );
- // Swap z and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(z);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap z and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the W component of a vector to a floating point value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetWPtr(FXMVECTOR V,CONST FLOAT *w)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( w != 0 );
- U.vector4_f32[0] = V.vector4_f32[0];
- U.vector4_f32[1] = V.vector4_f32[1];
- U.vector4_f32[2] = V.vector4_f32[2];
- U.vector4_f32[3] = *w;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( w != 0 );
- // Swap w and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(w);
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap w and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets a component of a vector to an integer passed by value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x, UINT i)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( i <= 3 );
- U = V;
- U.vector4_u32[i] = x;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( i <= 3 );
- XMVECTORU32 tmp;
- tmp.v = V;
- tmp.u[i] = x;
- return tmp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets the X component of a vector to an integer passed by value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_u32[0] = x;
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_i32[0] = x;
- return vResult;
-#else
- __m128i vTemp = _mm_cvtsi32_si128(x);
- XMVECTOR vResult = _mm_move_ss(V,reinterpret_cast<const __m128 *>(&vTemp)[0]);
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Y component of a vector to an integer passed by value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = y;
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_i32[1] = y;
- return vResult;
-#else // Swap y and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1));
- // Convert input to vector
- __m128i vTemp = _mm_cvtsi32_si128(y);
- // Replace the x component
- vResult = _mm_move_ss(vResult,reinterpret_cast<const __m128 *>(&vTemp)[0]);
- // Swap y and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Z component of a vector to an integer passed by value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = z;
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_i32[2] = z;
- return vResult;
-#else
- // Swap z and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2));
- // Convert input to vector
- __m128i vTemp = _mm_cvtsi32_si128(z);
- // Replace the x component
- vResult = _mm_move_ss(vResult,reinterpret_cast<const __m128 *>(&vTemp)[0]);
- // Swap z and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the W component of a vector to an integer passed by value
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = w;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_XM_ISVS2005_)
- XMVECTOR vResult = V;
- vResult.m128_i32[3] = w;
- return vResult;
-#else
- // Swap w and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3));
- // Convert input to vector
- __m128i vTemp = _mm_cvtsi32_si128(w);
- // Replace the x component
- vResult = _mm_move_ss(vResult,reinterpret_cast<const __m128 *>(&vTemp)[0]);
- // Swap w and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3));
- return vResult;
-#endif // _XM_ISVS2005_
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets a component of a vector to an integer value passed by pointer
-// This causes Load/Hit/Store on VMX targets
-XMFINLINE XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, CONST UINT *x,UINT i)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( x != 0 );
- XMASSERT( i <= 3 );
- U = V;
- U.vector4_u32[i] = *x;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( x != 0 );
- XMASSERT( i <= 3 );
- XMVECTORU32 tmp;
- tmp.v = V;
- tmp.u[i] = *x;
- return tmp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-// Sets the X component of a vector to an integer value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V,CONST UINT *x)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( x != 0 );
- U.vector4_u32[0] = *x;
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( x != 0 );
- XMVECTOR vTemp = _mm_load_ss(reinterpret_cast<const float *>(x));
- XMVECTOR vResult = _mm_move_ss(V,vTemp);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Y component of a vector to an integer value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V,CONST UINT *y)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( y != 0 );
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = *y;
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( y != 0 );
- // Swap y and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(reinterpret_cast<const float *>(y));
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap y and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the Z component of a vector to an integer value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V,CONST UINT *z)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( z != 0 );
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = *z;
- U.vector4_u32[3] = V.vector4_u32[3];
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( z != 0 );
- // Swap z and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(reinterpret_cast<const float *>(z));
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap z and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-// Sets the W component of a vector to an integer value passed by pointer
-XMFINLINE XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V,CONST UINT *w)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR U;
- XMASSERT( w != 0 );
- U.vector4_u32[0] = V.vector4_u32[0];
- U.vector4_u32[1] = V.vector4_u32[1];
- U.vector4_u32[2] = V.vector4_u32[2];
- U.vector4_u32[3] = *w;
- return U;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( w != 0 );
- // Swap w and x
- XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3));
- // Convert input to vector
- XMVECTOR vTemp = _mm_load_ss(reinterpret_cast<const float *>(w));
- // Replace the x component
- vResult = _mm_move_ss(vResult,vTemp);
- // Swap w and x again
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Define a control vector to be used in XMVectorPermute
-// operations. Visualize the two vectors V1 and V2 given
-// in a permute as arranged back to back in a linear fashion,
-// such that they form an array of 8 floating point values.
-// The four integers specified in XMVectorPermuteControl
-// will serve as indices into the array to select components
-// from the two vectors. ElementIndex0 is used to select
-// an element from the vectors to be placed in the first
-// component of the resulting vector, ElementIndex1 is used
-// to select an element for the second component, etc.
-
-XMFINLINE XMVECTOR XMVectorPermuteControl
-(
- UINT ElementIndex0,
- UINT ElementIndex1,
- UINT ElementIndex2,
- UINT ElementIndex3
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) || defined(_XM_NO_INTRINSICS_)
- XMVECTORU32 vControl;
- static CONST UINT ControlElement[] = {
- XM_PERMUTE_0X,
- XM_PERMUTE_0Y,
- XM_PERMUTE_0Z,
- XM_PERMUTE_0W,
- XM_PERMUTE_1X,
- XM_PERMUTE_1Y,
- XM_PERMUTE_1Z,
- XM_PERMUTE_1W
- };
- XMASSERT(ElementIndex0 < 8);
- XMASSERT(ElementIndex1 < 8);
- XMASSERT(ElementIndex2 < 8);
- XMASSERT(ElementIndex3 < 8);
-
- vControl.u[0] = ControlElement[ElementIndex0];
- vControl.u[1] = ControlElement[ElementIndex1];
- vControl.u[2] = ControlElement[ElementIndex2];
- vControl.u[3] = ControlElement[ElementIndex3];
- return vControl.v;
-#else
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-// Using a control vector made up of 16 bytes from 0-31, remap V1 and V2's byte
-// entries into a single 16 byte vector and return it. Index 0-15 = V1,
-// 16-31 = V2
-XMFINLINE XMVECTOR XMVectorPermute
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR Control
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- const BYTE *aByte[2];
- XMVECTOR Result;
- UINT i, uIndex, VectorIndex;
- const BYTE *pControl;
- BYTE *pWork;
-
- // Indices must be in range from 0 to 31
- XMASSERT((Control.vector4_u32[0] & 0xE0E0E0E0) == 0);
- XMASSERT((Control.vector4_u32[1] & 0xE0E0E0E0) == 0);
- XMASSERT((Control.vector4_u32[2] & 0xE0E0E0E0) == 0);
- XMASSERT((Control.vector4_u32[3] & 0xE0E0E0E0) == 0);
-
- // 0-15 = V1, 16-31 = V2
- aByte[0] = (const BYTE*)(&V1);
- aByte[1] = (const BYTE*)(&V2);
- i = 16;
- pControl = (const BYTE *)(&Control);
- pWork = (BYTE *)(&Result);
- do {
- // Get the byte to map from
- uIndex = pControl[0];
- ++pControl;
- VectorIndex = (uIndex>>4)&1;
- uIndex &= 0x0F;
-#if defined(_XM_LITTLEENDIAN_)
- uIndex ^= 3; // Swap byte ordering on little endian machines
-#endif
- pWork[0] = aByte[VectorIndex][uIndex];
- ++pWork;
- } while (--i);
- return Result;
-#elif defined(_XM_SSE_INTRINSICS_)
-#if defined(_PREFAST_) || defined(XMDEBUG)
- // Indices must be in range from 0 to 31
- static const XMVECTORI32 PremuteTest = {0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0};
- XMVECTOR vAssert = _mm_and_ps(Control,PremuteTest);
- __m128i vAsserti = _mm_cmpeq_epi32(reinterpret_cast<const __m128i *>(&vAssert)[0],g_XMZero);
- XMASSERT(_mm_movemask_ps(*reinterpret_cast<const __m128 *>(&vAsserti)) == 0xf);
-#endif
- // Store the vectors onto local memory on the stack
- XMVECTOR Array[2];
- Array[0] = V1;
- Array[1] = V2;
- // Output vector, on the stack
- XMVECTORU8 vResult;
- // Get pointer to the two vectors on the stack
- const BYTE *pInput = reinterpret_cast<const BYTE *>(Array);
- // Store the Control vector on the stack to access the bytes
- // don't use Control, it can cause a register variable to spill on the stack.
- XMVECTORU8 vControl;
- vControl.v = Control; // Write to memory
- UINT i = 0;
- do {
- UINT ComponentIndex = vControl.u[i] & 0x1FU;
- ComponentIndex ^= 3; // Swap byte ordering
- vResult.u[i] = pInput[ComponentIndex];
- } while (++i<16);
- return vResult;
-#else // _XM_SSE_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Define a control vector to be used in XMVectorSelect
-// operations. The four integers specified in XMVectorSelectControl
-// serve as indices to select between components in two vectors.
-// The first index controls selection for the first component of
-// the vectors involved in a select operation, the second index
-// controls selection for the second component etc. A value of
-// zero for an index causes the corresponding component from the first
-// vector to be selected whereas a one causes the component from the
-// second vector to be selected instead.
-
-XMFINLINE XMVECTOR XMVectorSelectControl
-(
- UINT VectorIndex0,
- UINT VectorIndex1,
- UINT VectorIndex2,
- UINT VectorIndex3
-)
-{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
- // x=Index0,y=Index1,z=Index2,w=Index3
- __m128i vTemp = _mm_set_epi32(VectorIndex3,VectorIndex2,VectorIndex1,VectorIndex0);
- // Any non-zero entries become 0xFFFFFFFF else 0
- vTemp = _mm_cmpgt_epi32(vTemp,g_XMZero);
- return reinterpret_cast<__m128 *>(&vTemp)[0];
-#else
- XMVECTOR ControlVector;
- CONST UINT ControlElement[] =
- {
- XM_SELECT_0,
- XM_SELECT_1
- };
-
- XMASSERT(VectorIndex0 < 2);
- XMASSERT(VectorIndex1 < 2);
- XMASSERT(VectorIndex2 < 2);
- XMASSERT(VectorIndex3 < 2);
-
- ControlVector.vector4_u32[0] = ControlElement[VectorIndex0];
- ControlVector.vector4_u32[1] = ControlElement[VectorIndex1];
- ControlVector.vector4_u32[2] = ControlElement[VectorIndex2];
- ControlVector.vector4_u32[3] = ControlElement[VectorIndex3];
-
- return ControlVector;
-
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSelect
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR Control
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]);
- Result.vector4_u32[1] = (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]);
- Result.vector4_u32[2] = (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]);
- Result.vector4_u32[3] = (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp1 = _mm_andnot_ps(Control,V1);
- XMVECTOR vTemp2 = _mm_and_ps(V2,Control);
- return _mm_or_ps(vTemp1,vTemp2);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMergeXY
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[0];
- Result.vector4_u32[1] = V2.vector4_u32[0];
- Result.vector4_u32[2] = V1.vector4_u32[1];
- Result.vector4_u32[3] = V2.vector4_u32[1];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_unpacklo_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMergeZW
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[2];
- Result.vector4_u32[1] = V2.vector4_u32[2];
- Result.vector4_u32[2] = V1.vector4_u32[3];
- Result.vector4_u32[3] = V2.vector4_u32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_unpackhi_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
-
- Control.vector4_u32[0] = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
-
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmpeq_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorEqualR
-(
- UINT* pCR,
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ux, uy, uz, uw, CR;
- XMVECTOR Control;
-
- XMASSERT( pCR );
-
- ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
- CR = 0;
- if (ux&uy&uz&uw)
- {
- // All elements are greater
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!(ux|uy|uz|uw))
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- Control.vector4_u32[0] = ux;
- Control.vector4_u32[1] = uy;
- Control.vector4_u32[2] = uz;
- Control.vector4_u32[3] = uw;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( pCR );
- XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2);
- UINT CR = 0;
- int iTest = _mm_movemask_ps(vTemp);
- if (iTest==0xf)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- return vTemp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Treat the components of the vectors as unsigned integers and
-// compare individual bits between the two. This is useful for
-// comparing control vectors and result vectors returned from
-// other comparison operations.
-
-XMFINLINE XMVECTOR XMVectorEqualInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
-
- Control.vector4_u32[0] = (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0;
-
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_cmpeq_epi32( reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0] );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorEqualIntR
-(
- UINT* pCR,
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
-
- XMASSERT(pCR);
-
- Control = XMVectorEqualInt(V1, V2);
-
- *pCR = 0;
-
- if (XMVector4EqualInt(Control, XMVectorTrueInt()))
- {
- // All elements are equal
- *pCR |= XM_CRMASK_CR6TRUE;
- }
- else if (XMVector4EqualInt(Control, XMVectorFalseInt()))
- {
- // All elements are not equal
- *pCR |= XM_CRMASK_CR6FALSE;
- }
-
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pCR);
- __m128i V = _mm_cmpeq_epi32( reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0] );
- int iTemp = _mm_movemask_ps(reinterpret_cast<const __m128*>(&V)[0]);
- UINT CR = 0;
- if (iTemp==0x0F)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTemp)
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNearEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR Epsilon
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT fDeltax, fDeltay, fDeltaz, fDeltaw;
- XMVECTOR Control;
-
- fDeltax = V1.vector4_f32[0]-V2.vector4_f32[0];
- fDeltay = V1.vector4_f32[1]-V2.vector4_f32[1];
- fDeltaz = V1.vector4_f32[2]-V2.vector4_f32[2];
- fDeltaw = V1.vector4_f32[3]-V2.vector4_f32[3];
-
- fDeltax = fabsf(fDeltax);
- fDeltay = fabsf(fDeltay);
- fDeltaz = fabsf(fDeltaz);
- fDeltaw = fabsf(fDeltaw);
-
- Control.vector4_u32[0] = (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[1] = (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[2] = (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[3] = (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
-
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Get the difference
- XMVECTOR vDelta = _mm_sub_ps(V1,V2);
- // Get the absolute value of the difference
- XMVECTOR vTemp = _mm_setzero_ps();
- vTemp = _mm_sub_ps(vTemp,vDelta);
- vTemp = _mm_max_ps(vTemp,vDelta);
- vTemp = _mm_cmple_ps(vTemp,Epsilon);
- return vTemp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNotEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmpneq_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNotEqualInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[1] = (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[2] = (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[3] = (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_cmpeq_epi32( reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0] );
- return _mm_xor_ps(reinterpret_cast<__m128 *>(&V)[0],g_XMNegOneMask);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorGreater
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmpgt_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorGreaterR
-(
- UINT* pCR,
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ux, uy, uz, uw, CR;
- XMVECTOR Control;
-
- XMASSERT( pCR );
-
- ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
- CR = 0;
- if (ux&uy&uz&uw)
- {
- // All elements are greater
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!(ux|uy|uz|uw))
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- Control.vector4_u32[0] = ux;
- Control.vector4_u32[1] = uy;
- Control.vector4_u32[2] = uz;
- Control.vector4_u32[3] = uw;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( pCR );
- XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2);
- UINT CR = 0;
- int iTest = _mm_movemask_ps(vTemp);
- if (iTest==0xf)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- return vTemp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorGreaterOrEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmpge_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorGreaterOrEqualR
-(
- UINT* pCR,
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ux, uy, uz, uw, CR;
- XMVECTOR Control;
-
- XMASSERT( pCR );
-
- ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
- CR = 0;
- if (ux&uy&uz&uw)
- {
- // All elements are greater
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!(ux|uy|uz|uw))
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- Control.vector4_u32[0] = ux;
- Control.vector4_u32[1] = uy;
- Control.vector4_u32[2] = uz;
- Control.vector4_u32[3] = uw;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( pCR );
- XMVECTOR vTemp = _mm_cmpge_ps(V1,V2);
- UINT CR = 0;
- int iTest = _mm_movemask_ps(vTemp);
- if (iTest==0xf)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- // All elements are not greater
- CR = XM_CRMASK_CR6FALSE;
- }
- *pCR = CR;
- return vTemp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorLess
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmplt_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorLessOrEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_cmple_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorInBounds
-(
- FXMVECTOR V,
- FXMVECTOR Bounds
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[1] = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[2] = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0;
- Control.vector4_u32[3] = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Test if less than or equal
- XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds);
- // Negate the bounds
- XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne);
- // Test if greater or equal (Reversed)
- vTemp2 = _mm_cmple_ps(vTemp2,V);
- // Blend answers
- vTemp1 = _mm_and_ps(vTemp1,vTemp2);
- return vTemp1;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorInBoundsR
-(
- UINT* pCR,
- FXMVECTOR V,
- FXMVECTOR Bounds
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT ux, uy, uz, uw, CR;
- XMVECTOR Control;
-
- XMASSERT( pCR != 0 );
-
- ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
-
- CR = 0;
-
- if (ux&uy&uz&uw)
- {
- // All elements are in bounds
- CR = XM_CRMASK_CR6BOUNDS;
- }
- *pCR = CR;
- Control.vector4_u32[0] = ux;
- Control.vector4_u32[1] = uy;
- Control.vector4_u32[2] = uz;
- Control.vector4_u32[3] = uw;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT( pCR != 0 );
- // Test if less than or equal
- XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds);
- // Negate the bounds
- XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne);
- // Test if greater or equal (Reversed)
- vTemp2 = _mm_cmple_ps(vTemp2,V);
- // Blend answers
- vTemp1 = _mm_and_ps(vTemp1,vTemp2);
-
- UINT CR = 0;
- if (_mm_movemask_ps(vTemp1)==0xf) {
- // All elements are in bounds
- CR = XM_CRMASK_CR6BOUNDS;
- }
- *pCR = CR;
- return vTemp1;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorIsNaN
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[1] = XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[2] = XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[3] = XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Mask off the exponent
- __m128i vTempInf = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMInfinity);
- // Mask off the mantissa
- __m128i vTempNan = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMQNaNTest);
- // Are any of the exponents == 0x7F800000?
- vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity);
- // Are any of the mantissa's zero? (SSE2 doesn't have a neq test)
- vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero);
- // Perform a not on the NaN test to be true on NON-zero mantissas
- vTempNan = _mm_andnot_si128(vTempNan,vTempInf);
- // If any are NaN, the signs are true after the merge above
- return reinterpret_cast<const XMVECTOR *>(&vTempNan)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorIsInfinite
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Control;
- Control.vector4_u32[0] = XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[1] = XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[2] = XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0;
- Control.vector4_u32[3] = XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0;
- return Control;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Mask off the sign bit
- __m128 vTemp = _mm_and_ps(V,g_XMAbsMask);
- // Compare to infinity
- vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity);
- // If any are infinity, the signs are true.
- return vTemp;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Rounding and clamping operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMin
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result.vector4_f32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0];
- Result.vector4_f32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1];
- Result.vector4_f32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2];
- Result.vector4_f32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3];
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_min_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMax
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result.vector4_f32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0];
- Result.vector4_f32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1];
- Result.vector4_f32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2];
- Result.vector4_f32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3];
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_max_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorRound
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- XMVECTOR Bias;
- CONST XMVECTOR Zero = XMVectorZero();
- CONST XMVECTOR BiasPos = XMVectorReplicate(0.5f);
- CONST XMVECTOR BiasNeg = XMVectorReplicate(-0.5f);
-
- Bias = XMVectorLess(V, Zero);
- Bias = XMVectorSelect(BiasPos, BiasNeg, Bias);
- Result = XMVectorAdd(V, Bias);
- Result = XMVectorTruncate(Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // To handle NAN, INF and numbers greater than 8388608, use masking
- // Get the abs value
- __m128i vTest = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMAbsMask);
- // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF
- vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction);
- // Convert to int and back to float for rounding
- __m128i vInt = _mm_cvtps_epi32(V);
- // Convert back to floats
- XMVECTOR vResult = _mm_cvtepi32_ps(vInt);
- // All numbers less than 8388608 will use the round to int
- vResult = _mm_and_ps(vResult,reinterpret_cast<const XMVECTOR *>(&vTest)[0]);
- // All others, use the ORIGINAL value
- vTest = _mm_andnot_si128(vTest,reinterpret_cast<const __m128i *>(&V)[0]);
- vResult = _mm_or_ps(vResult,reinterpret_cast<const XMVECTOR *>(&vTest)[0]);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorTruncate
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Result;
- UINT i;
-
- // Avoid C4701
- Result.vector4_f32[0] = 0.0f;
-
- for (i = 0; i < 4; i++)
- {
- if (XMISNAN(V.vector4_f32[i]))
- {
- Result.vector4_u32[i] = 0x7FC00000;
- }
- else if (fabsf(V.vector4_f32[i]) < 8388608.0f)
- {
- Result.vector4_f32[i] = (FLOAT)((INT)V.vector4_f32[i]);
- }
- else
- {
- Result.vector4_f32[i] = V.vector4_f32[i];
- }
- }
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // To handle NAN, INF and numbers greater than 8388608, use masking
- // Get the abs value
- __m128i vTest = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMAbsMask);
- // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF
- vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction);
- // Convert to int and back to float for rounding with truncation
- __m128i vInt = _mm_cvttps_epi32(V);
- // Convert back to floats
- XMVECTOR vResult = _mm_cvtepi32_ps(vInt);
- // All numbers less than 8388608 will use the round to int
- vResult = _mm_and_ps(vResult,reinterpret_cast<const XMVECTOR *>(&vTest)[0]);
- // All others, use the ORIGINAL value
- vTest = _mm_andnot_si128(vTest,reinterpret_cast<const __m128i *>(&V)[0]);
- vResult = _mm_or_ps(vResult,reinterpret_cast<const XMVECTOR *>(&vTest)[0]);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorFloor
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR vResult = {
- floorf(V.vector4_f32[0]),
- floorf(V.vector4_f32[1]),
- floorf(V.vector4_f32[2]),
- floorf(V.vector4_f32[3])
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_sub_ps(V,g_XMOneHalfMinusEpsilon);
- __m128i vInt = _mm_cvtps_epi32(vResult);
- vResult = _mm_cvtepi32_ps(vInt);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorCeiling
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {
- ceilf(V.vector4_f32[0]),
- ceilf(V.vector4_f32[1]),
- ceilf(V.vector4_f32[2]),
- ceilf(V.vector4_f32[3])
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_add_ps(V,g_XMOneHalfMinusEpsilon);
- __m128i vInt = _mm_cvtps_epi32(vResult);
- vResult = _mm_cvtepi32_ps(vInt);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorClamp
-(
- FXMVECTOR V,
- FXMVECTOR Min,
- FXMVECTOR Max
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- XMASSERT(XMVector4LessOrEqual(Min, Max));
-
- Result = XMVectorMax(Min, V);
- Result = XMVectorMin(Max, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult;
- XMASSERT(XMVector4LessOrEqual(Min, Max));
- vResult = _mm_max_ps(Min,V);
- vResult = _mm_min_ps(vResult,Max);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSaturate
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- CONST XMVECTOR Zero = XMVectorZero();
-
- return XMVectorClamp(V, Zero, g_XMOne.v);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Set <0 to 0
- XMVECTOR vResult = _mm_max_ps(V,g_XMZero);
- // Set>1 to 1
- return _mm_min_ps(vResult,g_XMOne);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Bitwise logical operations
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorAndInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[0] & V2.vector4_u32[0];
- Result.vector4_u32[1] = V1.vector4_u32[1] & V2.vector4_u32[1];
- Result.vector4_u32[2] = V1.vector4_u32[2] & V2.vector4_u32[2];
- Result.vector4_u32[3] = V1.vector4_u32[3] & V2.vector4_u32[3];
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_and_ps(V1,V2);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorAndCInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[0] & ~V2.vector4_u32[0];
- Result.vector4_u32[1] = V1.vector4_u32[1] & ~V2.vector4_u32[1];
- Result.vector4_u32[2] = V1.vector4_u32[2] & ~V2.vector4_u32[2];
- Result.vector4_u32[3] = V1.vector4_u32[3] & ~V2.vector4_u32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_andnot_si128( reinterpret_cast<const __m128i *>(&V2)[0], reinterpret_cast<const __m128i *>(&V1)[0] );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorOrInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[0] | V2.vector4_u32[0];
- Result.vector4_u32[1] = V1.vector4_u32[1] | V2.vector4_u32[1];
- Result.vector4_u32[2] = V1.vector4_u32[2] | V2.vector4_u32[2];
- Result.vector4_u32[3] = V1.vector4_u32[3] | V2.vector4_u32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_or_si128( reinterpret_cast<const __m128i *>(&V1)[0], reinterpret_cast<const __m128i *>(&V2)[0] );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNorInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = ~(V1.vector4_u32[0] | V2.vector4_u32[0]);
- Result.vector4_u32[1] = ~(V1.vector4_u32[1] | V2.vector4_u32[1]);
- Result.vector4_u32[2] = ~(V1.vector4_u32[2] | V2.vector4_u32[2]);
- Result.vector4_u32[3] = ~(V1.vector4_u32[3] | V2.vector4_u32[3]);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i Result;
- Result = _mm_or_si128( reinterpret_cast<const __m128i *>(&V1)[0], reinterpret_cast<const __m128i *>(&V2)[0] );
- Result = _mm_andnot_si128( Result,g_XMNegOneMask);
- return reinterpret_cast<__m128 *>(&Result)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorXorInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_u32[0] = V1.vector4_u32[0] ^ V2.vector4_u32[0];
- Result.vector4_u32[1] = V1.vector4_u32[1] ^ V2.vector4_u32[1];
- Result.vector4_u32[2] = V1.vector4_u32[2] ^ V2.vector4_u32[2];
- Result.vector4_u32[3] = V1.vector4_u32[3] ^ V2.vector4_u32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i V = _mm_xor_si128( reinterpret_cast<const __m128i *>(&V1)[0], reinterpret_cast<const __m128i *>(&V2)[0] );
- return reinterpret_cast<__m128 *>(&V)[0];
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNegate
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_f32[0] = -V.vector4_f32[0];
- Result.vector4_f32[1] = -V.vector4_f32[1];
- Result.vector4_f32[2] = -V.vector4_f32[2];
- Result.vector4_f32[3] = -V.vector4_f32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Z;
-
- Z = _mm_setzero_ps();
-
- return _mm_sub_ps( Z, V );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorAdd
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_f32[0] = V1.vector4_f32[0] + V2.vector4_f32[0];
- Result.vector4_f32[1] = V1.vector4_f32[1] + V2.vector4_f32[1];
- Result.vector4_f32[2] = V1.vector4_f32[2] + V2.vector4_f32[2];
- Result.vector4_f32[3] = V1.vector4_f32[3] + V2.vector4_f32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_add_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorAddAngles
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Mask;
- XMVECTOR Offset;
- XMVECTOR Result;
- CONST XMVECTOR Zero = XMVectorZero();
-
- // Add the given angles together. If the range of V1 is such
- // that -Pi <= V1 < Pi and the range of V2 is such that
- // -2Pi <= V2 <= 2Pi, then the range of the resulting angle
- // will be -Pi <= Result < Pi.
- Result = XMVectorAdd(V1, V2);
-
- Mask = XMVectorLess(Result, g_XMNegativePi.v);
- Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask);
-
- Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v);
- Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask);
-
- Result = XMVectorAdd(Result, Offset);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Adjust the angles
- XMVECTOR vResult = _mm_add_ps(V1,V2);
- // Less than Pi?
- XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi);
- vOffset = _mm_and_ps(vOffset,g_XMTwoPi);
- // Add 2Pi to all entries less than -Pi
- vResult = _mm_add_ps(vResult,vOffset);
- // Greater than or equal to Pi?
- vOffset = _mm_cmpge_ps(vResult,g_XMPi);
- vOffset = _mm_and_ps(vOffset,g_XMTwoPi);
- // Sub 2Pi to all entries greater than Pi
- vResult = _mm_sub_ps(vResult,vOffset);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSubtract
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_f32[0] = V1.vector4_f32[0] - V2.vector4_f32[0];
- Result.vector4_f32[1] = V1.vector4_f32[1] - V2.vector4_f32[1];
- Result.vector4_f32[2] = V1.vector4_f32[2] - V2.vector4_f32[2];
- Result.vector4_f32[3] = V1.vector4_f32[3] - V2.vector4_f32[3];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_sub_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSubtractAngles
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Mask;
- XMVECTOR Offset;
- XMVECTOR Result;
- CONST XMVECTOR Zero = XMVectorZero();
-
- // Subtract the given angles. If the range of V1 is such
- // that -Pi <= V1 < Pi and the range of V2 is such that
- // -2Pi <= V2 <= 2Pi, then the range of the resulting angle
- // will be -Pi <= Result < Pi.
- Result = XMVectorSubtract(V1, V2);
-
- Mask = XMVectorLess(Result, g_XMNegativePi.v);
- Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask);
-
- Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v);
- Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask);
-
- Result = XMVectorAdd(Result, Offset);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Adjust the angles
- XMVECTOR vResult = _mm_sub_ps(V1,V2);
- // Less than Pi?
- XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi);
- vOffset = _mm_and_ps(vOffset,g_XMTwoPi);
- // Add 2Pi to all entries less than -Pi
- vResult = _mm_add_ps(vResult,vOffset);
- // Greater than or equal to Pi?
- vOffset = _mm_cmpge_ps(vResult,g_XMPi);
- vOffset = _mm_and_ps(vOffset,g_XMTwoPi);
- // Sub 2Pi to all entries greater than Pi
- vResult = _mm_sub_ps(vResult,vOffset);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMultiply
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Result = {
- V1.vector4_f32[0] * V2.vector4_f32[0],
- V1.vector4_f32[1] * V2.vector4_f32[1],
- V1.vector4_f32[2] * V2.vector4_f32[2],
- V1.vector4_f32[3] * V2.vector4_f32[3]
- };
- return Result;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_mul_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMultiplyAdd
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR V3
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {
- (V1.vector4_f32[0] * V2.vector4_f32[0]) + V3.vector4_f32[0],
- (V1.vector4_f32[1] * V2.vector4_f32[1]) + V3.vector4_f32[1],
- (V1.vector4_f32[2] * V2.vector4_f32[2]) + V3.vector4_f32[2],
- (V1.vector4_f32[3] * V2.vector4_f32[3]) + V3.vector4_f32[3]
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_mul_ps( V1, V2 );
- return _mm_add_ps(vResult, V3 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorDivide
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Result;
- Result.vector4_f32[0] = V1.vector4_f32[0] / V2.vector4_f32[0];
- Result.vector4_f32[1] = V1.vector4_f32[1] / V2.vector4_f32[1];
- Result.vector4_f32[2] = V1.vector4_f32[2] / V2.vector4_f32[2];
- Result.vector4_f32[3] = V1.vector4_f32[3] / V2.vector4_f32[3];
- return Result;
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_div_ps( V1, V2 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorNegativeMultiplySubtract
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR V3
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR vResult = {
- V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]),
- V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]),
- V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]),
- V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3])
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR R = _mm_mul_ps( V1, V2 );
- return _mm_sub_ps( V3, R );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorScale
-(
- FXMVECTOR V,
- FLOAT ScaleFactor
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {
- V.vector4_f32[0] * ScaleFactor,
- V.vector4_f32[1] * ScaleFactor,
- V.vector4_f32[2] * ScaleFactor,
- V.vector4_f32[3] * ScaleFactor
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_set_ps1(ScaleFactor);
- return _mm_mul_ps(vResult,V);
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorReciprocalEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Result;
- UINT i;
-
- // Avoid C4701
- Result.vector4_f32[0] = 0.0f;
-
- for (i = 0; i < 4; i++)
- {
- if (XMISNAN(V.vector4_f32[i]))
- {
- Result.vector4_u32[i] = 0x7FC00000;
- }
- else if (V.vector4_f32[i] == 0.0f || V.vector4_f32[i] == -0.0f)
- {
- Result.vector4_u32[i] = 0x7F800000 | (V.vector4_u32[i] & 0x80000000);
- }
- else
- {
- Result.vector4_f32[i] = 1.f / V.vector4_f32[i];
- }
- }
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_rcp_ps(V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorReciprocal
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return XMVectorReciprocalEst(V);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_div_ps(g_XMOne,V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Return an estimated square root
-XMFINLINE XMVECTOR XMVectorSqrtEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Select;
-
- // if (x == +Infinity) sqrt(x) = +Infinity
- // if (x == +0.0f) sqrt(x) = +0.0f
- // if (x == -0.0f) sqrt(x) = -0.0f
- // if (x < 0.0f) sqrt(x) = QNaN
-
- XMVECTOR Result = XMVectorReciprocalSqrtEst(V);
- XMVECTOR Zero = XMVectorZero();
- XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v);
- XMVECTOR VEqualsZero = XMVectorEqual(V, Zero);
- Result = XMVectorMultiply(V, Result);
- Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero);
- Result = XMVectorSelect(V, Result, Select);
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_sqrt_ps(V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSqrt
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Zero;
- XMVECTOR VEqualsInfinity, VEqualsZero;
- XMVECTOR Select;
- XMVECTOR Result;
-
- // if (x == +Infinity) sqrt(x) = +Infinity
- // if (x == +0.0f) sqrt(x) = +0.0f
- // if (x == -0.0f) sqrt(x) = -0.0f
- // if (x < 0.0f) sqrt(x) = QNaN
-
- Result = XMVectorReciprocalSqrt(V);
- Zero = XMVectorZero();
- VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v);
- VEqualsZero = XMVectorEqual(V, Zero);
- Result = XMVectorMultiply(V, Result);
- Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero);
- Result = XMVectorSelect(V, Result, Select);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_sqrt_ps(V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorReciprocalSqrtEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // if (x == +Infinity) rsqrt(x) = 0
- // if (x == +0.0f) rsqrt(x) = +Infinity
- // if (x == -0.0f) rsqrt(x) = -Infinity
- // if (x < 0.0f) rsqrt(x) = QNaN
-
- XMVECTOR Result;
- UINT i;
-
- // Avoid C4701
- Result.vector4_f32[0] = 0.0f;
-
- for (i = 0; i < 4; i++)
- {
- if (XMISNAN(V.vector4_f32[i]))
- {
- Result.vector4_u32[i] = 0x7FC00000;
- }
- else if (V.vector4_f32[i] == 0.0f || V.vector4_f32[i] == -0.0f)
- {
- Result.vector4_u32[i] = 0x7F800000 | (V.vector4_u32[i] & 0x80000000);
- }
- else if (V.vector4_f32[i] < 0.0f)
- {
- Result.vector4_u32[i] = 0x7FFFFFFF;
- }
- else if (XMISINF(V.vector4_f32[i]))
- {
- Result.vector4_f32[i] = 0.0f;
- }
- else
- {
- Result.vector4_f32[i] = 1.0f / sqrtf(V.vector4_f32[i]);
- }
- }
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- return _mm_rsqrt_ps(V);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorReciprocalSqrt
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- return XMVectorReciprocalSqrtEst(V);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_sqrt_ps(V);
- vResult = _mm_div_ps(g_XMOne,vResult);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorExpEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result.vector4_f32[0] = powf(2.0f, V.vector4_f32[0]);
- Result.vector4_f32[1] = powf(2.0f, V.vector4_f32[1]);
- Result.vector4_f32[2] = powf(2.0f, V.vector4_f32[2]);
- Result.vector4_f32[3] = powf(2.0f, V.vector4_f32[3]);
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_setr_ps(
- powf(2.0f,XMVectorGetX(V)),
- powf(2.0f,XMVectorGetY(V)),
- powf(2.0f,XMVectorGetZ(V)),
- powf(2.0f,XMVectorGetW(V)));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorExp
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR E, S;
- XMVECTOR R, R2, R3, R4;
- XMVECTOR V0, V1;
- XMVECTOR C0X, C0Y, C0Z, C0W;
- XMVECTOR C1X, C1Y, C1Z, C1W;
- XMVECTOR Result;
- static CONST XMVECTOR C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f};
- static CONST XMVECTOR C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f};
-
- R = XMVectorFloor(V);
- E = XMVectorExpEst(R);
- R = XMVectorSubtract(V, R);
- R2 = XMVectorMultiply(R, R);
- R3 = XMVectorMultiply(R, R2);
- R4 = XMVectorMultiply(R2, R2);
-
- C0X = XMVectorSplatX(C0);
- C0Y = XMVectorSplatY(C0);
- C0Z = XMVectorSplatZ(C0);
- C0W = XMVectorSplatW(C0);
-
- C1X = XMVectorSplatX(C1);
- C1Y = XMVectorSplatY(C1);
- C1Z = XMVectorSplatZ(C1);
- C1W = XMVectorSplatW(C1);
-
- V0 = XMVectorMultiplyAdd(R, C0Y, C0X);
- V0 = XMVectorMultiplyAdd(R2, C0Z, V0);
- V0 = XMVectorMultiplyAdd(R3, C0W, V0);
-
- V1 = XMVectorMultiplyAdd(R, C1Y, C1X);
- V1 = XMVectorMultiplyAdd(R2, C1Z, V1);
- V1 = XMVectorMultiplyAdd(R3, C1W, V1);
-
- S = XMVectorMultiplyAdd(R4, V1, V0);
-
- S = XMVectorReciprocal(S);
- Result = XMVectorMultiply(E, S);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f};
- static CONST XMVECTORF32 C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f};
-
- // Get the integer of the input
- XMVECTOR R = XMVectorFloor(V);
- // Get the exponent estimate
- XMVECTOR E = XMVectorExpEst(R);
- // Get the fractional only
- R = _mm_sub_ps(V,R);
- // Get R^2
- XMVECTOR R2 = _mm_mul_ps(R,R);
- // And R^3
- XMVECTOR R3 = _mm_mul_ps(R,R2);
-
- XMVECTOR V0 = _mm_load_ps1(&C0.f[1]);
- V0 = _mm_mul_ps(V0,R);
- XMVECTOR vConstants = _mm_load_ps1(&C0.f[0]);
- V0 = _mm_add_ps(V0,vConstants);
- vConstants = _mm_load_ps1(&C0.f[2]);
- vConstants = _mm_mul_ps(vConstants,R2);
- V0 = _mm_add_ps(V0,vConstants);
- vConstants = _mm_load_ps1(&C0.f[3]);
- vConstants = _mm_mul_ps(vConstants,R3);
- V0 = _mm_add_ps(V0,vConstants);
-
- XMVECTOR V1 = _mm_load_ps1(&C1.f[1]);
- V1 = _mm_mul_ps(V1,R);
- vConstants = _mm_load_ps1(&C1.f[0]);
- V1 = _mm_add_ps(V1,vConstants);
- vConstants = _mm_load_ps1(&C1.f[2]);
- vConstants = _mm_mul_ps(vConstants,R2);
- V1 = _mm_add_ps(V1,vConstants);
- vConstants = _mm_load_ps1(&C1.f[3]);
- vConstants = _mm_mul_ps(vConstants,R3);
- V1 = _mm_add_ps(V1,vConstants);
- // R2 = R^4
- R2 = _mm_mul_ps(R2,R2);
- R2 = _mm_mul_ps(R2,V1);
- R2 = _mm_add_ps(R2,V0);
- E = _mm_div_ps(E,R2);
- return E;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorLogEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- FLOAT fScale = (1.0f / logf(2.0f));
- XMVECTOR Result;
-
- Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale;
- Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale;
- Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale;
- Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale;
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f));
- XMVECTOR vResult = _mm_setr_ps(
- logf(XMVectorGetX(V)),
- logf(XMVectorGetY(V)),
- logf(XMVectorGetZ(V)),
- logf(XMVectorGetW(V)));
- vResult = _mm_mul_ps(vResult,vScale);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorLog
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT fScale = (1.0f / logf(2.0f));
- XMVECTOR Result;
-
- Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale;
- Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale;
- Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale;
- Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale;
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f));
- XMVECTOR vResult = _mm_setr_ps(
- logf(XMVectorGetX(V)),
- logf(XMVectorGetY(V)),
- logf(XMVectorGetZ(V)),
- logf(XMVectorGetW(V)));
- vResult = _mm_mul_ps(vResult,vScale);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorPowEst
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_f32[0] = powf(V1.vector4_f32[0], V2.vector4_f32[0]);
- Result.vector4_f32[1] = powf(V1.vector4_f32[1], V2.vector4_f32[1]);
- Result.vector4_f32[2] = powf(V1.vector4_f32[2], V2.vector4_f32[2]);
- Result.vector4_f32[3] = powf(V1.vector4_f32[3], V2.vector4_f32[3]);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_setr_ps(
- powf(XMVectorGetX(V1),XMVectorGetX(V2)),
- powf(XMVectorGetY(V1),XMVectorGetY(V2)),
- powf(XMVectorGetZ(V1),XMVectorGetZ(V2)),
- powf(XMVectorGetW(V1),XMVectorGetW(V2)));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorPow
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_)
-
- return XMVectorPowEst(V1, V2);
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorAbs
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR vResult = {
- fabsf(V.vector4_f32[0]),
- fabsf(V.vector4_f32[1]),
- fabsf(V.vector4_f32[2]),
- fabsf(V.vector4_f32[3])
- };
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_setzero_ps();
- vResult = _mm_sub_ps(vResult,V);
- vResult = _mm_max_ps(vResult,V);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorMod
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Reciprocal;
- XMVECTOR Quotient;
- XMVECTOR Result;
-
- // V1 % V2 = V1 - V2 * truncate(V1 / V2)
- Reciprocal = XMVectorReciprocal(V2);
- Quotient = XMVectorMultiply(V1, Reciprocal);
- Quotient = XMVectorTruncate(Quotient);
- Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vResult = _mm_div_ps(V1, V2);
- vResult = XMVectorTruncate(vResult);
- vResult = _mm_mul_ps(vResult,V2);
- vResult = _mm_sub_ps(V1,vResult);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorModAngles
-(
- FXMVECTOR Angles
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V;
- XMVECTOR Result;
-
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v);
- V = XMVectorRound(V);
- Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI
- XMVECTOR vResult = _mm_mul_ps(Angles,g_XMReciprocalTwoPi);
- // Use the inline function due to complexity for rounding
- vResult = XMVectorRound(vResult);
- vResult = _mm_mul_ps(vResult,g_XMTwoPi);
- vResult = _mm_sub_ps(Angles,vResult);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorSin
-(
- FXMVECTOR V
-)
-{
-
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23;
- XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- XMVECTOR Result;
-
- V1 = XMVectorModAngles(V);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- V2 = XMVectorMultiply(V1, V1);
- V3 = XMVectorMultiply(V2, V1);
- V5 = XMVectorMultiply(V3, V2);
- V7 = XMVectorMultiply(V5, V2);
- V9 = XMVectorMultiply(V7, V2);
- V11 = XMVectorMultiply(V9, V2);
- V13 = XMVectorMultiply(V11, V2);
- V15 = XMVectorMultiply(V13, V2);
- V17 = XMVectorMultiply(V15, V2);
- V19 = XMVectorMultiply(V17, V2);
- V21 = XMVectorMultiply(V19, V2);
- V23 = XMVectorMultiply(V21, V2);
-
- S1 = XMVectorSplatY(g_XMSinCoefficients0.v);
- S2 = XMVectorSplatZ(g_XMSinCoefficients0.v);
- S3 = XMVectorSplatW(g_XMSinCoefficients0.v);
- S4 = XMVectorSplatX(g_XMSinCoefficients1.v);
- S5 = XMVectorSplatY(g_XMSinCoefficients1.v);
- S6 = XMVectorSplatZ(g_XMSinCoefficients1.v);
- S7 = XMVectorSplatW(g_XMSinCoefficients1.v);
- S8 = XMVectorSplatX(g_XMSinCoefficients2.v);
- S9 = XMVectorSplatY(g_XMSinCoefficients2.v);
- S10 = XMVectorSplatZ(g_XMSinCoefficients2.v);
- S11 = XMVectorSplatW(g_XMSinCoefficients2.v);
-
- Result = XMVectorMultiplyAdd(S1, V3, V1);
- Result = XMVectorMultiplyAdd(S2, V5, Result);
- Result = XMVectorMultiplyAdd(S3, V7, Result);
- Result = XMVectorMultiplyAdd(S4, V9, Result);
- Result = XMVectorMultiplyAdd(S5, V11, Result);
- Result = XMVectorMultiplyAdd(S6, V13, Result);
- Result = XMVectorMultiplyAdd(S7, V15, Result);
- Result = XMVectorMultiplyAdd(S8, V17, Result);
- Result = XMVectorMultiplyAdd(S9, V19, Result);
- Result = XMVectorMultiplyAdd(S10, V21, Result);
- Result = XMVectorMultiplyAdd(S11, V23, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Force the value within the bounds of pi
- XMVECTOR vResult = XMVectorModAngles(V);
- // Each on is V to the "num" power
- // V2 = V1^2
- XMVECTOR V2 = _mm_mul_ps(vResult,vResult);
- // V1^3
- XMVECTOR vPower = _mm_mul_ps(vResult,V2);
- XMVECTOR vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[1]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^5
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^7
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^9
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[0]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^11
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[1]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^13
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^15
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^17
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[0]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^19
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[1]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^21
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^23
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorCos
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22;
- XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- XMVECTOR Result;
-
- V1 = XMVectorModAngles(V);
-
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
- V2 = XMVectorMultiply(V1, V1);
- V4 = XMVectorMultiply(V2, V2);
- V6 = XMVectorMultiply(V4, V2);
- V8 = XMVectorMultiply(V4, V4);
- V10 = XMVectorMultiply(V6, V4);
- V12 = XMVectorMultiply(V6, V6);
- V14 = XMVectorMultiply(V8, V6);
- V16 = XMVectorMultiply(V8, V8);
- V18 = XMVectorMultiply(V10, V8);
- V20 = XMVectorMultiply(V10, V10);
- V22 = XMVectorMultiply(V12, V10);
-
- C1 = XMVectorSplatY(g_XMCosCoefficients0.v);
- C2 = XMVectorSplatZ(g_XMCosCoefficients0.v);
- C3 = XMVectorSplatW(g_XMCosCoefficients0.v);
- C4 = XMVectorSplatX(g_XMCosCoefficients1.v);
- C5 = XMVectorSplatY(g_XMCosCoefficients1.v);
- C6 = XMVectorSplatZ(g_XMCosCoefficients1.v);
- C7 = XMVectorSplatW(g_XMCosCoefficients1.v);
- C8 = XMVectorSplatX(g_XMCosCoefficients2.v);
- C9 = XMVectorSplatY(g_XMCosCoefficients2.v);
- C10 = XMVectorSplatZ(g_XMCosCoefficients2.v);
- C11 = XMVectorSplatW(g_XMCosCoefficients2.v);
-
- Result = XMVectorMultiplyAdd(C1, V2, g_XMOne.v);
- Result = XMVectorMultiplyAdd(C2, V4, Result);
- Result = XMVectorMultiplyAdd(C3, V6, Result);
- Result = XMVectorMultiplyAdd(C4, V8, Result);
- Result = XMVectorMultiplyAdd(C5, V10, Result);
- Result = XMVectorMultiplyAdd(C6, V12, Result);
- Result = XMVectorMultiplyAdd(C7, V14, Result);
- Result = XMVectorMultiplyAdd(C8, V16, Result);
- Result = XMVectorMultiplyAdd(C9, V18, Result);
- Result = XMVectorMultiplyAdd(C10, V20, Result);
- Result = XMVectorMultiplyAdd(C11, V22, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Force the value within the bounds of pi
- XMVECTOR V2 = XMVectorModAngles(V);
- // Each on is V to the "num" power
- // V2 = V1^2
- V2 = _mm_mul_ps(V2,V2);
- // V^2
- XMVECTOR vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[1]);
- vConstants = _mm_mul_ps(vConstants,V2);
- XMVECTOR vResult = _mm_add_ps(vConstants,g_XMOne);
-
- // V^4
- XMVECTOR vPower = _mm_mul_ps(V2,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^6
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^8
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[0]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^10
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[1]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^12
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^14
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^16
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[0]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^18
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[1]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^20
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[2]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
-
- // V^22
- vPower = _mm_mul_ps(vPower,V2);
- vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[3]);
- vConstants = _mm_mul_ps(vConstants,vPower);
- vResult = _mm_add_ps(vResult,vConstants);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE VOID XMVectorSinCos
-(
- XMVECTOR* pSin,
- XMVECTOR* pCos,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13;
- XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23;
- XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- XMVECTOR Sin, Cos;
-
- XMASSERT(pSin);
- XMASSERT(pCos);
-
- V1 = XMVectorModAngles(V);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
-
- V2 = XMVectorMultiply(V1, V1);
- V3 = XMVectorMultiply(V2, V1);
- V4 = XMVectorMultiply(V2, V2);
- V5 = XMVectorMultiply(V3, V2);
- V6 = XMVectorMultiply(V3, V3);
- V7 = XMVectorMultiply(V4, V3);
- V8 = XMVectorMultiply(V4, V4);
- V9 = XMVectorMultiply(V5, V4);
- V10 = XMVectorMultiply(V5, V5);
- V11 = XMVectorMultiply(V6, V5);
- V12 = XMVectorMultiply(V6, V6);
- V13 = XMVectorMultiply(V7, V6);
- V14 = XMVectorMultiply(V7, V7);
- V15 = XMVectorMultiply(V8, V7);
- V16 = XMVectorMultiply(V8, V8);
- V17 = XMVectorMultiply(V9, V8);
- V18 = XMVectorMultiply(V9, V9);
- V19 = XMVectorMultiply(V10, V9);
- V20 = XMVectorMultiply(V10, V10);
- V21 = XMVectorMultiply(V11, V10);
- V22 = XMVectorMultiply(V11, V11);
- V23 = XMVectorMultiply(V12, V11);
-
- S1 = XMVectorSplatY(g_XMSinCoefficients0.v);
- S2 = XMVectorSplatZ(g_XMSinCoefficients0.v);
- S3 = XMVectorSplatW(g_XMSinCoefficients0.v);
- S4 = XMVectorSplatX(g_XMSinCoefficients1.v);
- S5 = XMVectorSplatY(g_XMSinCoefficients1.v);
- S6 = XMVectorSplatZ(g_XMSinCoefficients1.v);
- S7 = XMVectorSplatW(g_XMSinCoefficients1.v);
- S8 = XMVectorSplatX(g_XMSinCoefficients2.v);
- S9 = XMVectorSplatY(g_XMSinCoefficients2.v);
- S10 = XMVectorSplatZ(g_XMSinCoefficients2.v);
- S11 = XMVectorSplatW(g_XMSinCoefficients2.v);
-
- C1 = XMVectorSplatY(g_XMCosCoefficients0.v);
- C2 = XMVectorSplatZ(g_XMCosCoefficients0.v);
- C3 = XMVectorSplatW(g_XMCosCoefficients0.v);
- C4 = XMVectorSplatX(g_XMCosCoefficients1.v);
- C5 = XMVectorSplatY(g_XMCosCoefficients1.v);
- C6 = XMVectorSplatZ(g_XMCosCoefficients1.v);
- C7 = XMVectorSplatW(g_XMCosCoefficients1.v);
- C8 = XMVectorSplatX(g_XMCosCoefficients2.v);
- C9 = XMVectorSplatY(g_XMCosCoefficients2.v);
- C10 = XMVectorSplatZ(g_XMCosCoefficients2.v);
- C11 = XMVectorSplatW(g_XMCosCoefficients2.v);
-
- Sin = XMVectorMultiplyAdd(S1, V3, V1);
- Sin = XMVectorMultiplyAdd(S2, V5, Sin);
- Sin = XMVectorMultiplyAdd(S3, V7, Sin);
- Sin = XMVectorMultiplyAdd(S4, V9, Sin);
- Sin = XMVectorMultiplyAdd(S5, V11, Sin);
- Sin = XMVectorMultiplyAdd(S6, V13, Sin);
- Sin = XMVectorMultiplyAdd(S7, V15, Sin);
- Sin = XMVectorMultiplyAdd(S8, V17, Sin);
- Sin = XMVectorMultiplyAdd(S9, V19, Sin);
- Sin = XMVectorMultiplyAdd(S10, V21, Sin);
- Sin = XMVectorMultiplyAdd(S11, V23, Sin);
-
- Cos = XMVectorMultiplyAdd(C1, V2, g_XMOne.v);
- Cos = XMVectorMultiplyAdd(C2, V4, Cos);
- Cos = XMVectorMultiplyAdd(C3, V6, Cos);
- Cos = XMVectorMultiplyAdd(C4, V8, Cos);
- Cos = XMVectorMultiplyAdd(C5, V10, Cos);
- Cos = XMVectorMultiplyAdd(C6, V12, Cos);
- Cos = XMVectorMultiplyAdd(C7, V14, Cos);
- Cos = XMVectorMultiplyAdd(C8, V16, Cos);
- Cos = XMVectorMultiplyAdd(C9, V18, Cos);
- Cos = XMVectorMultiplyAdd(C10, V20, Cos);
- Cos = XMVectorMultiplyAdd(C11, V22, Cos);
-
- *pSin = Sin;
- *pCos = Cos;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSin);
- XMASSERT(pCos);
- XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13;
- XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23;
- XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11;
- XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- XMVECTOR Sin, Cos;
-
- V1 = XMVectorModAngles(V);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! -
- // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! -
- // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI)
-
- V2 = XMVectorMultiply(V1, V1);
- V3 = XMVectorMultiply(V2, V1);
- V4 = XMVectorMultiply(V2, V2);
- V5 = XMVectorMultiply(V3, V2);
- V6 = XMVectorMultiply(V3, V3);
- V7 = XMVectorMultiply(V4, V3);
- V8 = XMVectorMultiply(V4, V4);
- V9 = XMVectorMultiply(V5, V4);
- V10 = XMVectorMultiply(V5, V5);
- V11 = XMVectorMultiply(V6, V5);
- V12 = XMVectorMultiply(V6, V6);
- V13 = XMVectorMultiply(V7, V6);
- V14 = XMVectorMultiply(V7, V7);
- V15 = XMVectorMultiply(V8, V7);
- V16 = XMVectorMultiply(V8, V8);
- V17 = XMVectorMultiply(V9, V8);
- V18 = XMVectorMultiply(V9, V9);
- V19 = XMVectorMultiply(V10, V9);
- V20 = XMVectorMultiply(V10, V10);
- V21 = XMVectorMultiply(V11, V10);
- V22 = XMVectorMultiply(V11, V11);
- V23 = XMVectorMultiply(V12, V11);
-
- S1 = _mm_load_ps1(&g_XMSinCoefficients0.f[1]);
- S2 = _mm_load_ps1(&g_XMSinCoefficients0.f[2]);
- S3 = _mm_load_ps1(&g_XMSinCoefficients0.f[3]);
- S4 = _mm_load_ps1(&g_XMSinCoefficients1.f[0]);
- S5 = _mm_load_ps1(&g_XMSinCoefficients1.f[1]);
- S6 = _mm_load_ps1(&g_XMSinCoefficients1.f[2]);
- S7 = _mm_load_ps1(&g_XMSinCoefficients1.f[3]);
- S8 = _mm_load_ps1(&g_XMSinCoefficients2.f[0]);
- S9 = _mm_load_ps1(&g_XMSinCoefficients2.f[1]);
- S10 = _mm_load_ps1(&g_XMSinCoefficients2.f[2]);
- S11 = _mm_load_ps1(&g_XMSinCoefficients2.f[3]);
-
- C1 = _mm_load_ps1(&g_XMCosCoefficients0.f[1]);
- C2 = _mm_load_ps1(&g_XMCosCoefficients0.f[2]);
- C3 = _mm_load_ps1(&g_XMCosCoefficients0.f[3]);
- C4 = _mm_load_ps1(&g_XMCosCoefficients1.f[0]);
- C5 = _mm_load_ps1(&g_XMCosCoefficients1.f[1]);
- C6 = _mm_load_ps1(&g_XMCosCoefficients1.f[2]);
- C7 = _mm_load_ps1(&g_XMCosCoefficients1.f[3]);
- C8 = _mm_load_ps1(&g_XMCosCoefficients2.f[0]);
- C9 = _mm_load_ps1(&g_XMCosCoefficients2.f[1]);
- C10 = _mm_load_ps1(&g_XMCosCoefficients2.f[2]);
- C11 = _mm_load_ps1(&g_XMCosCoefficients2.f[3]);
-
- S1 = _mm_mul_ps(S1,V3);
- Sin = _mm_add_ps(S1,V1);
- Sin = XMVectorMultiplyAdd(S2, V5, Sin);
- Sin = XMVectorMultiplyAdd(S3, V7, Sin);
- Sin = XMVectorMultiplyAdd(S4, V9, Sin);
- Sin = XMVectorMultiplyAdd(S5, V11, Sin);
- Sin = XMVectorMultiplyAdd(S6, V13, Sin);
- Sin = XMVectorMultiplyAdd(S7, V15, Sin);
- Sin = XMVectorMultiplyAdd(S8, V17, Sin);
- Sin = XMVectorMultiplyAdd(S9, V19, Sin);
- Sin = XMVectorMultiplyAdd(S10, V21, Sin);
- Sin = XMVectorMultiplyAdd(S11, V23, Sin);
-
- Cos = _mm_mul_ps(C1,V2);
- Cos = _mm_add_ps(Cos,g_XMOne);
- Cos = XMVectorMultiplyAdd(C2, V4, Cos);
- Cos = XMVectorMultiplyAdd(C3, V6, Cos);
- Cos = XMVectorMultiplyAdd(C4, V8, Cos);
- Cos = XMVectorMultiplyAdd(C5, V10, Cos);
- Cos = XMVectorMultiplyAdd(C6, V12, Cos);
- Cos = XMVectorMultiplyAdd(C7, V14, Cos);
- Cos = XMVectorMultiplyAdd(C8, V16, Cos);
- Cos = XMVectorMultiplyAdd(C9, V18, Cos);
- Cos = XMVectorMultiplyAdd(C10, V20, Cos);
- Cos = XMVectorMultiplyAdd(C11, V22, Cos);
-
- *pSin = Sin;
- *pCos = Cos;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorTan
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Cody and Waite algorithm to compute tangent.
-
- XMVECTOR VA, VB, VC, VC2;
- XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7;
- XMVECTOR C0, C1, TwoDivPi, Epsilon;
- XMVECTOR N, D;
- XMVECTOR R0, R1;
- XMVECTOR VIsZero, VCNearZero, VBIsEven;
- XMVECTOR Zero;
- XMVECTOR Result;
- UINT i;
- static CONST XMVECTOR TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f};
- static CONST XMVECTOR TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f};
- static CONST XMVECTOR TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI};
- static CONST XMVECTORU32 Mask = {0x1, 0x1, 0x1, 0x1};
-
- TwoDivPi = XMVectorSplatW(TanConstants);
-
- Zero = XMVectorZero();
-
- C0 = XMVectorSplatX(TanConstants);
- C1 = XMVectorSplatY(TanConstants);
- Epsilon = XMVectorSplatZ(TanConstants);
-
- VA = XMVectorMultiply(V, TwoDivPi);
-
- VA = XMVectorRound(VA);
-
- VC = XMVectorNegativeMultiplySubtract(VA, C0, V);
-
- VB = XMVectorAbs(VA);
-
- VC = XMVectorNegativeMultiplySubtract(VA, C1, VC);
-
- for (i = 0; i < 4; i++)
- {
- VB.vector4_u32[i] = (UINT)VB.vector4_f32[i];
- }
-
- VC2 = XMVectorMultiply(VC, VC);
-
- T7 = XMVectorSplatW(TanCoefficients1);
- T6 = XMVectorSplatZ(TanCoefficients1);
- T4 = XMVectorSplatX(TanCoefficients1);
- T3 = XMVectorSplatW(TanCoefficients0);
- T5 = XMVectorSplatY(TanCoefficients1);
- T2 = XMVectorSplatZ(TanCoefficients0);
- T1 = XMVectorSplatY(TanCoefficients0);
- T0 = XMVectorSplatX(TanCoefficients0);
-
- VBIsEven = XMVectorAndInt(VB, Mask.v);
- VBIsEven = XMVectorEqualInt(VBIsEven, Zero);
-
- N = XMVectorMultiplyAdd(VC2, T7, T6);
- D = XMVectorMultiplyAdd(VC2, T4, T3);
- N = XMVectorMultiplyAdd(VC2, N, T5);
- D = XMVectorMultiplyAdd(VC2, D, T2);
- N = XMVectorMultiply(VC2, N);
- D = XMVectorMultiplyAdd(VC2, D, T1);
- N = XMVectorMultiplyAdd(VC, N, VC);
- VCNearZero = XMVectorInBounds(VC, Epsilon);
- D = XMVectorMultiplyAdd(VC2, D, T0);
-
- N = XMVectorSelect(N, VC, VCNearZero);
- D = XMVectorSelect(D, g_XMOne.v, VCNearZero);
-
- R0 = XMVectorNegate(N);
- R1 = XMVectorReciprocal(D);
- R0 = XMVectorReciprocal(R0);
- R1 = XMVectorMultiply(N, R1);
- R0 = XMVectorMultiply(D, R0);
-
- VIsZero = XMVectorEqual(V, Zero);
-
- Result = XMVectorSelect(R0, R1, VBIsEven);
-
- Result = XMVectorSelect(Result, Zero, VIsZero);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Cody and Waite algorithm to compute tangent.
-
- XMVECTOR VA, VB, VC, VC2;
- XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7;
- XMVECTOR C0, C1, TwoDivPi, Epsilon;
- XMVECTOR N, D;
- XMVECTOR R0, R1;
- XMVECTOR VIsZero, VCNearZero, VBIsEven;
- XMVECTOR Zero;
- XMVECTOR Result;
- static CONST XMVECTORF32 TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f};
- static CONST XMVECTORF32 TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f};
- static CONST XMVECTORF32 TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI};
- static CONST XMVECTORI32 Mask = {0x1, 0x1, 0x1, 0x1};
-
- TwoDivPi = XMVectorSplatW(TanConstants);
-
- Zero = XMVectorZero();
-
- C0 = XMVectorSplatX(TanConstants);
- C1 = XMVectorSplatY(TanConstants);
- Epsilon = XMVectorSplatZ(TanConstants);
-
- VA = XMVectorMultiply(V, TwoDivPi);
-
- VA = XMVectorRound(VA);
-
- VC = XMVectorNegativeMultiplySubtract(VA, C0, V);
-
- VB = XMVectorAbs(VA);
-
- VC = XMVectorNegativeMultiplySubtract(VA, C1, VC);
-
- reinterpret_cast<__m128i *>(&VB)[0] = _mm_cvttps_epi32(VB);
-
- VC2 = XMVectorMultiply(VC, VC);
-
- T7 = XMVectorSplatW(TanCoefficients1);
- T6 = XMVectorSplatZ(TanCoefficients1);
- T4 = XMVectorSplatX(TanCoefficients1);
- T3 = XMVectorSplatW(TanCoefficients0);
- T5 = XMVectorSplatY(TanCoefficients1);
- T2 = XMVectorSplatZ(TanCoefficients0);
- T1 = XMVectorSplatY(TanCoefficients0);
- T0 = XMVectorSplatX(TanCoefficients0);
-
- VBIsEven = XMVectorAndInt(VB,Mask);
- VBIsEven = XMVectorEqualInt(VBIsEven, Zero);
-
- N = XMVectorMultiplyAdd(VC2, T7, T6);
- D = XMVectorMultiplyAdd(VC2, T4, T3);
- N = XMVectorMultiplyAdd(VC2, N, T5);
- D = XMVectorMultiplyAdd(VC2, D, T2);
- N = XMVectorMultiply(VC2, N);
- D = XMVectorMultiplyAdd(VC2, D, T1);
- N = XMVectorMultiplyAdd(VC, N, VC);
- VCNearZero = XMVectorInBounds(VC, Epsilon);
- D = XMVectorMultiplyAdd(VC2, D, T0);
-
- N = XMVectorSelect(N, VC, VCNearZero);
- D = XMVectorSelect(D, g_XMOne, VCNearZero);
- R0 = XMVectorNegate(N);
- R1 = _mm_div_ps(N,D);
- R0 = _mm_div_ps(D,R0);
- VIsZero = XMVectorEqual(V, Zero);
- Result = XMVectorSelect(R0, R1, VBIsEven);
- Result = XMVectorSelect(Result, Zero, VIsZero);
-
- return Result;
-
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorSinH
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v);
- V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v);
-
- E1 = XMVectorExp(V1);
- E2 = XMVectorExp(V2);
-
- Result = XMVectorSubtract(E1, E2);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = _mm_mul_ps(V, Scale);
- V1 = _mm_add_ps(V1,g_XMNegativeOne);
- V2 = _mm_mul_ps(V, Scale);
- V2 = _mm_sub_ps(g_XMNegativeOne,V2);
- E1 = XMVectorExp(V1);
- E2 = XMVectorExp(V2);
-
- Result = _mm_sub_ps(E1, E2);
-
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorCosH
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v);
- V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v);
-
- E1 = XMVectorExp(V1);
- E2 = XMVectorExp(V2);
-
- Result = XMVectorAdd(E1, E2);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = _mm_mul_ps(V,Scale);
- V1 = _mm_add_ps(V1,g_XMNegativeOne);
- V2 = _mm_mul_ps(V, Scale);
- V2 = _mm_sub_ps(g_XMNegativeOne,V2);
- E1 = XMVectorExp(V1);
- E2 = XMVectorExp(V2);
- Result = _mm_add_ps(E1, E2);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorTanH
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR E;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f)
-
- E = XMVectorMultiply(V, Scale.v);
- E = XMVectorExp(E);
- E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v);
- E = XMVectorReciprocal(E);
-
- Result = XMVectorSubtract(g_XMOne.v, E);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f)
-
- XMVECTOR E = _mm_mul_ps(V, Scale);
- E = XMVectorExp(E);
- E = _mm_mul_ps(E,g_XMOneHalf);
- E = _mm_add_ps(E,g_XMOneHalf);
- E = XMVectorReciprocal(E);
- E = _mm_sub_ps(g_XMOne, E);
- return E;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorASin
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V2, V3, AbsV;
- XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- XMVECTOR R0, R1, R2, R3, R4;
- XMVECTOR OneMinusAbsV;
- XMVECTOR Rsq;
- XMVECTOR Result;
- static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f};
-
- // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) *
- // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5)
-
- AbsV = XMVectorAbs(V);
-
- V2 = XMVectorMultiply(V, V);
- V3 = XMVectorMultiply(V2, AbsV);
-
- R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V);
-
- OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV);
- Rsq = XMVectorReciprocalSqrt(OneMinusAbsV);
-
- C0 = XMVectorSplatX(g_XMASinCoefficients0.v);
- C1 = XMVectorSplatY(g_XMASinCoefficients0.v);
- C2 = XMVectorSplatZ(g_XMASinCoefficients0.v);
- C3 = XMVectorSplatW(g_XMASinCoefficients0.v);
-
- C4 = XMVectorSplatX(g_XMASinCoefficients1.v);
- C5 = XMVectorSplatY(g_XMASinCoefficients1.v);
- C6 = XMVectorSplatZ(g_XMASinCoefficients1.v);
- C7 = XMVectorSplatW(g_XMASinCoefficients1.v);
-
- C8 = XMVectorSplatX(g_XMASinCoefficients2.v);
- C9 = XMVectorSplatY(g_XMASinCoefficients2.v);
- C10 = XMVectorSplatZ(g_XMASinCoefficients2.v);
- C11 = XMVectorSplatW(g_XMASinCoefficients2.v);
-
- R0 = XMVectorMultiplyAdd(C3, AbsV, C7);
- R1 = XMVectorMultiplyAdd(C1, AbsV, C5);
- R2 = XMVectorMultiplyAdd(C2, AbsV, C6);
- R3 = XMVectorMultiplyAdd(C0, AbsV, C4);
-
- R0 = XMVectorMultiplyAdd(R0, AbsV, C11);
- R1 = XMVectorMultiplyAdd(R1, AbsV, C9);
- R2 = XMVectorMultiplyAdd(R2, AbsV, C10);
- R3 = XMVectorMultiplyAdd(R3, AbsV, C8);
-
- R0 = XMVectorMultiplyAdd(R2, V3, R0);
- R1 = XMVectorMultiplyAdd(R3, V3, R1);
-
- R0 = XMVectorMultiply(V, R0);
- R1 = XMVectorMultiply(R4, R1);
-
- Result = XMVectorMultiplyAdd(R1, Rsq, R0);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f};
-
- // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) *
- // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5)
- // Get abs(V)
- XMVECTOR vAbsV = _mm_setzero_ps();
- vAbsV = _mm_sub_ps(vAbsV,V);
- vAbsV = _mm_max_ps(vAbsV,V);
-
- XMVECTOR R0 = vAbsV;
- XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]);
- R0 = _mm_mul_ps(R0,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]);
- R0 = _mm_add_ps(R0,vConstants);
-
- XMVECTOR R1 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]);
- R1 = _mm_mul_ps(R1,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]);
- R1 = _mm_add_ps(R1, vConstants);
-
- XMVECTOR R2 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]);
- R2 = _mm_mul_ps(R2,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]);
- R2 = _mm_add_ps(R2, vConstants);
-
- XMVECTOR R3 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]);
- R3 = _mm_mul_ps(R3,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]);
- R3 = _mm_add_ps(R3, vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]);
- R0 = _mm_mul_ps(R0,vAbsV);
- R0 = _mm_add_ps(R0,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]);
- R1 = _mm_mul_ps(R1,vAbsV);
- R1 = _mm_add_ps(R1,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]);
- R2 = _mm_mul_ps(R2,vAbsV);
- R2 = _mm_add_ps(R2,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]);
- R3 = _mm_mul_ps(R3,vAbsV);
- R3 = _mm_add_ps(R3,vConstants);
-
- // V3 = V^3
- vConstants = _mm_mul_ps(V,V);
- vConstants = _mm_mul_ps(vConstants, vAbsV);
- // Mul by V^3
- R2 = _mm_mul_ps(R2,vConstants);
- R3 = _mm_mul_ps(R3,vConstants);
- // Merge the results
- R0 = _mm_add_ps(R0,R2);
- R1 = _mm_add_ps(R1,R3);
-
- R0 = _mm_mul_ps(R0,V);
- // vConstants = V-(V^2 retaining sign)
- vConstants = _mm_mul_ps(vAbsV, V);
- vConstants = _mm_sub_ps(V,vConstants);
- R1 = _mm_mul_ps(R1,vConstants);
- vConstants = _mm_sub_ps(OnePlusEpsilon,vAbsV);
- // Do NOT use rsqrt/mul. This needs the precision
- vConstants = _mm_sqrt_ps(vConstants);
- R1 = _mm_div_ps(R1,vConstants);
- R0 = _mm_add_ps(R0,R1);
- return R0;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorACos
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V2, V3, AbsV;
- XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11;
- XMVECTOR R0, R1, R2, R3, R4;
- XMVECTOR OneMinusAbsV;
- XMVECTOR Rsq;
- XMVECTOR Result;
- static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f};
-
- // acos(V) = PI / 2 - asin(V)
-
- AbsV = XMVectorAbs(V);
-
- V2 = XMVectorMultiply(V, V);
- V3 = XMVectorMultiply(V2, AbsV);
-
- R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V);
-
- OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV);
- Rsq = XMVectorReciprocalSqrt(OneMinusAbsV);
-
- C0 = XMVectorSplatX(g_XMASinCoefficients0.v);
- C1 = XMVectorSplatY(g_XMASinCoefficients0.v);
- C2 = XMVectorSplatZ(g_XMASinCoefficients0.v);
- C3 = XMVectorSplatW(g_XMASinCoefficients0.v);
-
- C4 = XMVectorSplatX(g_XMASinCoefficients1.v);
- C5 = XMVectorSplatY(g_XMASinCoefficients1.v);
- C6 = XMVectorSplatZ(g_XMASinCoefficients1.v);
- C7 = XMVectorSplatW(g_XMASinCoefficients1.v);
-
- C8 = XMVectorSplatX(g_XMASinCoefficients2.v);
- C9 = XMVectorSplatY(g_XMASinCoefficients2.v);
- C10 = XMVectorSplatZ(g_XMASinCoefficients2.v);
- C11 = XMVectorSplatW(g_XMASinCoefficients2.v);
-
- R0 = XMVectorMultiplyAdd(C3, AbsV, C7);
- R1 = XMVectorMultiplyAdd(C1, AbsV, C5);
- R2 = XMVectorMultiplyAdd(C2, AbsV, C6);
- R3 = XMVectorMultiplyAdd(C0, AbsV, C4);
-
- R0 = XMVectorMultiplyAdd(R0, AbsV, C11);
- R1 = XMVectorMultiplyAdd(R1, AbsV, C9);
- R2 = XMVectorMultiplyAdd(R2, AbsV, C10);
- R3 = XMVectorMultiplyAdd(R3, AbsV, C8);
-
- R0 = XMVectorMultiplyAdd(R2, V3, R0);
- R1 = XMVectorMultiplyAdd(R3, V3, R1);
-
- R0 = XMVectorMultiply(V, R0);
- R1 = XMVectorMultiply(R4, R1);
-
- Result = XMVectorMultiplyAdd(R1, Rsq, R0);
-
- Result = XMVectorSubtract(g_XMHalfPi.v, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f};
- // Uses only 6 registers for good code on x86 targets
- // acos(V) = PI / 2 - asin(V)
- // Get abs(V)
- XMVECTOR vAbsV = _mm_setzero_ps();
- vAbsV = _mm_sub_ps(vAbsV,V);
- vAbsV = _mm_max_ps(vAbsV,V);
- // Perform the series in precision groups to
- // retain precision across 20 bits. (3 bits of imprecision due to operations)
- XMVECTOR R0 = vAbsV;
- XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]);
- R0 = _mm_mul_ps(R0,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]);
- R0 = _mm_add_ps(R0,vConstants);
- R0 = _mm_mul_ps(R0,vAbsV);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]);
- R0 = _mm_add_ps(R0,vConstants);
-
- XMVECTOR R1 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]);
- R1 = _mm_mul_ps(R1,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]);
- R1 = _mm_add_ps(R1,vConstants);
- R1 = _mm_mul_ps(R1, vAbsV);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]);
- R1 = _mm_add_ps(R1,vConstants);
-
- XMVECTOR R2 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]);
- R2 = _mm_mul_ps(R2,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]);
- R2 = _mm_add_ps(R2,vConstants);
- R2 = _mm_mul_ps(R2, vAbsV);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]);
- R2 = _mm_add_ps(R2,vConstants);
-
- XMVECTOR R3 = vAbsV;
- vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]);
- R3 = _mm_mul_ps(R3,vConstants);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]);
- R3 = _mm_add_ps(R3,vConstants);
- R3 = _mm_mul_ps(R3, vAbsV);
- vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]);
- R3 = _mm_add_ps(R3,vConstants);
-
- // vConstants = V^3
- vConstants = _mm_mul_ps(V,V);
- vConstants = _mm_mul_ps(vConstants,vAbsV);
- R2 = _mm_mul_ps(R2,vConstants);
- R3 = _mm_mul_ps(R3,vConstants);
- // Add the pair of values together here to retain
- // as much precision as possible
- R0 = _mm_add_ps(R0,R2);
- R1 = _mm_add_ps(R1,R3);
-
- R0 = _mm_mul_ps(R0,V);
- // vConstants = V-(V*abs(V))
- vConstants = _mm_mul_ps(V,vAbsV);
- vConstants = _mm_sub_ps(V,vConstants);
- R1 = _mm_mul_ps(R1,vConstants);
- // Episilon exists to allow 1.0 as an answer
- vConstants = _mm_sub_ps(OnePlusEpsilon, vAbsV);
- // Use sqrt instead of rsqrt for precision
- vConstants = _mm_sqrt_ps(vConstants);
- R1 = _mm_div_ps(R1,vConstants);
- R1 = _mm_add_ps(R1,R0);
- vConstants = _mm_sub_ps(g_XMHalfPi,R1);
- return vConstants;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorATan
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Cody and Waite algorithm to compute inverse tangent.
-
- XMVECTOR N, D;
- XMVECTOR VF, G, ReciprocalF, AbsF, FA, FB;
- XMVECTOR Sqrt3, Sqrt3MinusOne, TwoMinusSqrt3;
- XMVECTOR HalfPi, OneThirdPi, OneSixthPi, Epsilon, MinV, MaxV;
- XMVECTOR Zero;
- XMVECTOR NegativeHalfPi;
- XMVECTOR Angle1, Angle2;
- XMVECTOR F_GT_One, F_GT_TwoMinusSqrt3, AbsF_LT_Epsilon, V_LT_Zero, V_GT_MaxV, V_LT_MinV;
- XMVECTOR NegativeResult, Result;
- XMVECTOR P0, P1, P2, P3, Q0, Q1, Q2, Q3;
- static CONST XMVECTOR ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f};
- static CONST XMVECTOR ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f};
- static CONST XMVECTOR ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // <sqrt(3), sqrt(3) - 1, 2 - sqrt(3), Epsilon>
- static CONST XMVECTOR ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // <Pi / 2, Pi / 3, Pi / 6, MaxV>
-
- Zero = XMVectorZero();
-
- P0 = XMVectorSplatX(ATanConstants0);
- P1 = XMVectorSplatY(ATanConstants0);
- P2 = XMVectorSplatZ(ATanConstants0);
- P3 = XMVectorSplatW(ATanConstants0);
-
- Q0 = XMVectorSplatX(ATanConstants1);
- Q1 = XMVectorSplatY(ATanConstants1);
- Q2 = XMVectorSplatZ(ATanConstants1);
- Q3 = XMVectorSplatW(ATanConstants1);
-
- Sqrt3 = XMVectorSplatX(ATanConstants2);
- Sqrt3MinusOne = XMVectorSplatY(ATanConstants2);
- TwoMinusSqrt3 = XMVectorSplatZ(ATanConstants2);
- Epsilon = XMVectorSplatW(ATanConstants2);
-
- HalfPi = XMVectorSplatX(ATanConstants3);
- OneThirdPi = XMVectorSplatY(ATanConstants3);
- OneSixthPi = XMVectorSplatZ(ATanConstants3);
- MaxV = XMVectorSplatW(ATanConstants3);
-
- VF = XMVectorAbs(V);
- ReciprocalF = XMVectorReciprocal(VF);
-
- F_GT_One = XMVectorGreater(VF, g_XMOne.v);
-
- VF = XMVectorSelect(VF, ReciprocalF, F_GT_One);
- Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One);
- Angle2 = XMVectorSelect(OneSixthPi, OneThirdPi, F_GT_One);
-
- F_GT_TwoMinusSqrt3 = XMVectorGreater(VF, TwoMinusSqrt3);
-
- FA = XMVectorMultiplyAdd(Sqrt3MinusOne, VF, VF);
- FA = XMVectorAdd(FA, g_XMNegativeOne.v);
- FB = XMVectorAdd(VF, Sqrt3);
- FB = XMVectorReciprocal(FB);
- FA = XMVectorMultiply(FA, FB);
-
- VF = XMVectorSelect(VF, FA, F_GT_TwoMinusSqrt3);
- Angle1 = XMVectorSelect(Angle1, Angle2, F_GT_TwoMinusSqrt3);
-
- AbsF = XMVectorAbs(VF);
- AbsF_LT_Epsilon = XMVectorLess(AbsF, Epsilon);
-
- G = XMVectorMultiply(VF, VF);
-
- D = XMVectorAdd(G, Q3);
- D = XMVectorMultiplyAdd(D, G, Q2);
- D = XMVectorMultiplyAdd(D, G, Q1);
- D = XMVectorMultiplyAdd(D, G, Q0);
- D = XMVectorReciprocal(D);
-
- N = XMVectorMultiplyAdd(P3, G, P2);
- N = XMVectorMultiplyAdd(N, G, P1);
- N = XMVectorMultiplyAdd(N, G, P0);
- N = XMVectorMultiply(N, G);
- Result = XMVectorMultiply(N, D);
-
- Result = XMVectorMultiplyAdd(Result, VF, VF);
-
- Result = XMVectorSelect(Result, VF, AbsF_LT_Epsilon);
-
- NegativeResult = XMVectorNegate(Result);
- Result = XMVectorSelect(Result, NegativeResult, F_GT_One);
-
- Result = XMVectorAdd(Result, Angle1);
-
- V_LT_Zero = XMVectorLess(V, Zero);
- NegativeResult = XMVectorNegate(Result);
- Result = XMVectorSelect(Result, NegativeResult, V_LT_Zero);
-
- MinV = XMVectorNegate(MaxV);
- NegativeHalfPi = XMVectorNegate(HalfPi);
- V_GT_MaxV = XMVectorGreater(V, MaxV);
- V_LT_MinV = XMVectorLess(V, MinV);
- Result = XMVectorSelect(Result, g_XMHalfPi.v, V_GT_MaxV);
- Result = XMVectorSelect(Result, NegativeHalfPi, V_LT_MinV);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f};
- static CONST XMVECTORF32 ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f};
- static CONST XMVECTORF32 ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // <sqrt(3), sqrt(3) - 1, 2 - sqrt(3), Epsilon>
- static CONST XMVECTORF32 ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // <Pi / 2, Pi / 3, Pi / 6, MaxV>
-
- XMVECTOR VF = XMVectorAbs(V);
- XMVECTOR F_GT_One = _mm_cmpgt_ps(VF,g_XMOne);
- XMVECTOR ReciprocalF = XMVectorReciprocal(VF);
- VF = XMVectorSelect(VF, ReciprocalF, F_GT_One);
- XMVECTOR Zero = XMVectorZero();
- XMVECTOR HalfPi = _mm_load_ps1(&ATanConstants3.f[0]);
- XMVECTOR Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One);
- // Pi/3
- XMVECTOR vConstants = _mm_load_ps1(&ATanConstants3.f[1]);
- // Pi/6
- XMVECTOR Angle2 = _mm_load_ps1(&ATanConstants3.f[2]);
- Angle2 = XMVectorSelect(Angle2, vConstants, F_GT_One);
-
- // 1-sqrt(3)
- XMVECTOR FA = _mm_load_ps1(&ATanConstants2.f[1]);
- FA = _mm_mul_ps(FA,VF);
- FA = _mm_add_ps(FA,VF);
- FA = _mm_add_ps(FA,g_XMNegativeOne);
- // sqrt(3)
- vConstants = _mm_load_ps1(&ATanConstants2.f[0]);
- vConstants = _mm_add_ps(vConstants,VF);
- FA = _mm_div_ps(FA,vConstants);
-
- // 2-sqrt(3)
- vConstants = _mm_load_ps1(&ATanConstants2.f[2]);
- // >2-sqrt(3)?
- vConstants = _mm_cmpgt_ps(VF,vConstants);
- VF = XMVectorSelect(VF, FA, vConstants);
- Angle1 = XMVectorSelect(Angle1, Angle2, vConstants);
-
- XMVECTOR AbsF = XMVectorAbs(VF);
-
- XMVECTOR G = _mm_mul_ps(VF,VF);
- XMVECTOR D = _mm_load_ps1(&ATanConstants1.f[3]);
- D = _mm_add_ps(D,G);
- D = _mm_mul_ps(D,G);
- vConstants = _mm_load_ps1(&ATanConstants1.f[2]);
- D = _mm_add_ps(D,vConstants);
- D = _mm_mul_ps(D,G);
- vConstants = _mm_load_ps1(&ATanConstants1.f[1]);
- D = _mm_add_ps(D,vConstants);
- D = _mm_mul_ps(D,G);
- vConstants = _mm_load_ps1(&ATanConstants1.f[0]);
- D = _mm_add_ps(D,vConstants);
-
- XMVECTOR N = _mm_load_ps1(&ATanConstants0.f[3]);
- N = _mm_mul_ps(N,G);
- vConstants = _mm_load_ps1(&ATanConstants0.f[2]);
- N = _mm_add_ps(N,vConstants);
- N = _mm_mul_ps(N,G);
- vConstants = _mm_load_ps1(&ATanConstants0.f[1]);
- N = _mm_add_ps(N,vConstants);
- N = _mm_mul_ps(N,G);
- vConstants = _mm_load_ps1(&ATanConstants0.f[0]);
- N = _mm_add_ps(N,vConstants);
- N = _mm_mul_ps(N,G);
- XMVECTOR Result = _mm_div_ps(N,D);
-
- Result = _mm_mul_ps(Result,VF);
- Result = _mm_add_ps(Result,VF);
- // Epsilon
- vConstants = _mm_load_ps1(&ATanConstants2.f[3]);
- vConstants = _mm_cmpge_ps(vConstants,AbsF);
- Result = XMVectorSelect(Result,VF,vConstants);
-
- XMVECTOR NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne);
- Result = XMVectorSelect(Result,NegativeResult,F_GT_One);
- Result = _mm_add_ps(Result,Angle1);
-
- Zero = _mm_cmpge_ps(Zero,V);
- NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne);
- Result = XMVectorSelect(Result,NegativeResult,Zero);
-
- XMVECTOR MaxV = _mm_load_ps1(&ATanConstants3.f[3]);
- XMVECTOR MinV = _mm_mul_ps(MaxV,g_XMNegativeOne);
- // Negate HalfPi
- HalfPi = _mm_mul_ps(HalfPi,g_XMNegativeOne);
- MaxV = _mm_cmple_ps(MaxV,V);
- MinV = _mm_cmpge_ps(MinV,V);
- Result = XMVectorSelect(Result,g_XMHalfPi,MaxV);
- // HalfPi = -HalfPi
- Result = XMVectorSelect(Result,HalfPi,MinV);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMINLINE XMVECTOR XMVectorATan2
-(
- FXMVECTOR Y,
- FXMVECTOR X
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions:
-
- // Y == 0 and X is Negative -> Pi with the sign of Y
- // y == 0 and x is positive -> 0 with the sign of y
- // Y != 0 and X == 0 -> Pi / 2 with the sign of Y
- // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y)
- // X == -Infinity and Finite Y -> Pi with the sign of Y
- // X == +Infinity and Finite Y -> 0 with the sign of Y
- // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y
- // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y
- // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y
-
- XMVECTOR Reciprocal;
- XMVECTOR V;
- XMVECTOR YSign;
- XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour;
- XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity;
- XMVECTOR ATanResultValid;
- XMVECTOR R0, R1, R2, R3, R4, R5;
- XMVECTOR Zero;
- XMVECTOR Result;
- static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f};
-
- Zero = XMVectorZero();
- ATanResultValid = XMVectorTrueInt();
-
- Pi = XMVectorSplatX(ATan2Constants);
- PiOverTwo = XMVectorSplatY(ATan2Constants);
- PiOverFour = XMVectorSplatZ(ATan2Constants);
- ThreePiOverFour = XMVectorSplatW(ATan2Constants);
-
- YEqualsZero = XMVectorEqual(Y, Zero);
- XEqualsZero = XMVectorEqual(X, Zero);
- XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v);
- XIsPositive = XMVectorEqualInt(XIsPositive, Zero);
- YEqualsInfinity = XMVectorIsInfinite(Y);
- XEqualsInfinity = XMVectorIsInfinite(X);
-
- YSign = XMVectorAndInt(Y, g_XMNegativeZero.v);
- Pi = XMVectorOrInt(Pi, YSign);
- PiOverTwo = XMVectorOrInt(PiOverTwo, YSign);
- PiOverFour = XMVectorOrInt(PiOverFour, YSign);
- ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign);
-
- R1 = XMVectorSelect(Pi, YSign, XIsPositive);
- R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero);
- R3 = XMVectorSelect(R2, R1, YEqualsZero);
- R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive);
- R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity);
- Result = XMVectorSelect(R3, R5, YEqualsInfinity);
- ATanResultValid = XMVectorEqualInt(Result, ATanResultValid);
-
- Reciprocal = XMVectorReciprocal(X);
- V = XMVectorMultiply(Y, Reciprocal);
- R0 = XMVectorATan(V);
-
- R1 = XMVectorSelect( Pi, Zero, XIsPositive );
- R2 = XMVectorAdd(R0, R1);
-
- Result = XMVectorSelect(Result, R2, ATanResultValid);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f};
-
- // Mask if Y>0 && Y!=INF
- XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y);
- // Get the sign of (Y&0x80000000)
- XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero);
- // Get the sign bits of X
- XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero);
- // Change them to masks
- XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero);
- // Get Pi
- XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]);
- // Copy the sign of Y
- Pi = _mm_or_ps(Pi,YSign);
- XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive);
- // Mask for X==0
- XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero);
- // Get Pi/2 with with sign of Y
- XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]);
- PiOverTwo = _mm_or_ps(PiOverTwo,YSign);
- XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants);
- // Mask for Y==0
- vConstants = _mm_cmpeq_ps(Y,g_XMZero);
- R2 = XMVectorSelect(R2,R1,vConstants);
- // Get Pi/4 with sign of Y
- XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]);
- PiOverFour = _mm_or_ps(PiOverFour,YSign);
- // Get (Pi*3)/4 with sign of Y
- XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]);
- ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign);
- vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive);
- XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X);
- vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity);
-
- XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity);
- vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity);
- // At this point, any entry that's zero will get the result
- // from XMVectorATan(), otherwise, return the failsafe value
- vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity);
- // Any entries not 0xFFFFFFFF, are considered precalculated
- XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask);
- // Let's do the ATan2 function
- vConstants = _mm_div_ps(Y,X);
- vConstants = XMVectorATan(vConstants);
- // Discard entries that have been declared void
-
- XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive );
- vConstants = _mm_add_ps( vConstants, R3 );
-
- vResult = XMVectorSelect(vResult,vConstants,ATanResultValid);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSinEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V2, V3, V5, V7;
- XMVECTOR S1, S2, S3;
- XMVECTOR Result;
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
- V2 = XMVectorMultiply(V, V);
- V3 = XMVectorMultiply(V2, V);
- V5 = XMVectorMultiply(V3, V2);
- V7 = XMVectorMultiply(V5, V2);
-
- S1 = XMVectorSplatY(g_XMSinEstCoefficients.v);
- S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v);
- S3 = XMVectorSplatW(g_XMSinEstCoefficients.v);
-
- Result = XMVectorMultiplyAdd(S1, V3, V);
- Result = XMVectorMultiplyAdd(S2, V5, Result);
- Result = XMVectorMultiplyAdd(S3, V7, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
- XMVECTOR V2 = _mm_mul_ps(V,V);
- XMVECTOR V3 = _mm_mul_ps(V2,V);
- XMVECTOR vResult = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]);
- vResult = _mm_mul_ps(vResult,V3);
- vResult = _mm_add_ps(vResult,V);
- XMVECTOR vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]);
- // V^5
- V3 = _mm_mul_ps(V3,V2);
- vConstants = _mm_mul_ps(vConstants,V3);
- vResult = _mm_add_ps(vResult,vConstants);
- vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]);
- // V^7
- V3 = _mm_mul_ps(V3,V2);
- vConstants = _mm_mul_ps(vConstants,V3);
- vResult = _mm_add_ps(vResult,vConstants);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorCosEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V2, V4, V6;
- XMVECTOR C0, C1, C2, C3;
- XMVECTOR Result;
-
- V2 = XMVectorMultiply(V, V);
- V4 = XMVectorMultiply(V2, V2);
- V6 = XMVectorMultiply(V4, V2);
-
- C0 = XMVectorSplatX(g_XMCosEstCoefficients.v);
- C1 = XMVectorSplatY(g_XMCosEstCoefficients.v);
- C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v);
- C3 = XMVectorSplatW(g_XMCosEstCoefficients.v);
-
- Result = XMVectorMultiplyAdd(C1, V2, C0);
- Result = XMVectorMultiplyAdd(C2, V4, Result);
- Result = XMVectorMultiplyAdd(C3, V6, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Get V^2
- XMVECTOR V2 = _mm_mul_ps(V,V);
- XMVECTOR vResult = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]);
- vResult = _mm_mul_ps(vResult,V2);
- XMVECTOR vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]);
- vResult = _mm_add_ps(vResult,vConstants);
- vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]);
- // Get V^4
- XMVECTOR V4 = _mm_mul_ps(V2, V2);
- vConstants = _mm_mul_ps(vConstants,V4);
- vResult = _mm_add_ps(vResult,vConstants);
- vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]);
- // It's really V^6
- V4 = _mm_mul_ps(V4,V2);
- vConstants = _mm_mul_ps(vConstants,V4);
- vResult = _mm_add_ps(vResult,vConstants);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE VOID XMVectorSinCosEst
-(
- XMVECTOR* pSin,
- XMVECTOR* pCos,
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V2, V3, V4, V5, V6, V7;
- XMVECTOR S1, S2, S3;
- XMVECTOR C0, C1, C2, C3;
- XMVECTOR Sin, Cos;
-
- XMASSERT(pSin);
- XMASSERT(pCos);
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI)
- V2 = XMVectorMultiply(V, V);
- V3 = XMVectorMultiply(V2, V);
- V4 = XMVectorMultiply(V2, V2);
- V5 = XMVectorMultiply(V3, V2);
- V6 = XMVectorMultiply(V3, V3);
- V7 = XMVectorMultiply(V4, V3);
-
- S1 = XMVectorSplatY(g_XMSinEstCoefficients.v);
- S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v);
- S3 = XMVectorSplatW(g_XMSinEstCoefficients.v);
-
- C0 = XMVectorSplatX(g_XMCosEstCoefficients.v);
- C1 = XMVectorSplatY(g_XMCosEstCoefficients.v);
- C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v);
- C3 = XMVectorSplatW(g_XMCosEstCoefficients.v);
-
- Sin = XMVectorMultiplyAdd(S1, V3, V);
- Sin = XMVectorMultiplyAdd(S2, V5, Sin);
- Sin = XMVectorMultiplyAdd(S3, V7, Sin);
-
- Cos = XMVectorMultiplyAdd(C1, V2, C0);
- Cos = XMVectorMultiplyAdd(C2, V4, Cos);
- Cos = XMVectorMultiplyAdd(C3, V6, Cos);
-
- *pSin = Sin;
- *pCos = Cos;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMASSERT(pSin);
- XMASSERT(pCos);
- XMVECTOR V2, V3, V4, V5, V6, V7;
- XMVECTOR S1, S2, S3;
- XMVECTOR C0, C1, C2, C3;
- XMVECTOR Sin, Cos;
-
- // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI)
- // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI)
- V2 = XMVectorMultiply(V, V);
- V3 = XMVectorMultiply(V2, V);
- V4 = XMVectorMultiply(V2, V2);
- V5 = XMVectorMultiply(V3, V2);
- V6 = XMVectorMultiply(V3, V3);
- V7 = XMVectorMultiply(V4, V3);
-
- S1 = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]);
- S2 = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]);
- S3 = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]);
-
- C0 = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]);
- C1 = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]);
- C2 = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]);
- C3 = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]);
-
- Sin = XMVectorMultiplyAdd(S1, V3, V);
- Sin = XMVectorMultiplyAdd(S2, V5, Sin);
- Sin = XMVectorMultiplyAdd(S3, V7, Sin);
-
- Cos = XMVectorMultiplyAdd(C1, V2, C0);
- Cos = XMVectorMultiplyAdd(C2, V4, Cos);
- Cos = XMVectorMultiplyAdd(C3, V6, Cos);
-
- *pSin = Sin;
- *pCos = Cos;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorTanEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2, V1T0, V1T1, V2T2;
- XMVECTOR T0, T1, T2;
- XMVECTOR N, D;
- XMVECTOR OneOverPi;
- XMVECTOR Result;
-
- OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v);
-
- V1 = XMVectorMultiply(V, OneOverPi);
- V1 = XMVectorRound(V1);
-
- V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V);
-
- T0 = XMVectorSplatX(g_XMTanEstCoefficients.v);
- T1 = XMVectorSplatY(g_XMTanEstCoefficients.v);
- T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v);
-
- V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2);
- V2 = XMVectorMultiply(V1, V1);
- V1T0 = XMVectorMultiply(V1, T0);
- V1T1 = XMVectorMultiply(V1, T1);
-
- D = XMVectorReciprocalEst(V2T2);
- N = XMVectorMultiplyAdd(V2, V1T1, V1T0);
-
- Result = XMVectorMultiply(N, D);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1, V2, V1T0, V1T1, V2T2;
- XMVECTOR T0, T1, T2;
- XMVECTOR N, D;
- XMVECTOR OneOverPi;
- XMVECTOR Result;
-
- OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients);
-
- V1 = XMVectorMultiply(V, OneOverPi);
- V1 = XMVectorRound(V1);
-
- V1 = XMVectorNegativeMultiplySubtract(g_XMPi, V1, V);
-
- T0 = XMVectorSplatX(g_XMTanEstCoefficients);
- T1 = XMVectorSplatY(g_XMTanEstCoefficients);
- T2 = XMVectorSplatZ(g_XMTanEstCoefficients);
-
- V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2);
- V2 = XMVectorMultiply(V1, V1);
- V1T0 = XMVectorMultiply(V1, T0);
- V1T1 = XMVectorMultiply(V1, T1);
-
- D = XMVectorReciprocalEst(V2T2);
- N = XMVectorMultiplyAdd(V2, V1T1, V1T0);
-
- Result = XMVectorMultiply(N, D);
-
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorSinHEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v);
- V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v);
-
- E1 = XMVectorExpEst(V1);
- E2 = XMVectorExpEst(V2);
-
- Result = XMVectorSubtract(E1, E2);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = _mm_mul_ps(V,Scale);
- V1 = _mm_add_ps(V1,g_XMNegativeOne);
- V2 = _mm_mul_ps(V,Scale);
- V2 = _mm_sub_ps(g_XMNegativeOne,V2);
- E1 = XMVectorExpEst(V1);
- E2 = XMVectorExpEst(V2);
- Result = _mm_sub_ps(E1, E2);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorCosHEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v);
- V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v);
-
- E1 = XMVectorExpEst(V1);
- E2 = XMVectorExpEst(V2);
-
- Result = XMVectorAdd(E1, E2);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR V1, V2;
- XMVECTOR E1, E2;
- XMVECTOR Result;
- static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f)
-
- V1 = _mm_mul_ps(V,Scale);
- V1 = _mm_add_ps(V1,g_XMNegativeOne);
- V2 = _mm_mul_ps(V, Scale);
- V2 = _mm_sub_ps(g_XMNegativeOne,V2);
- E1 = XMVectorExpEst(V1);
- E2 = XMVectorExpEst(V2);
- Result = _mm_add_ps(E1, E2);
- return Result;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorTanHEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR E;
- XMVECTOR Result;
- static CONST XMVECTOR Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f)
-
- E = XMVectorMultiply(V, Scale);
- E = XMVectorExpEst(E);
- E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v);
- E = XMVectorReciprocalEst(E);
-
- Result = XMVectorSubtract(g_XMOne.v, E);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f)
-
- XMVECTOR E = _mm_mul_ps(V, Scale);
- E = XMVectorExpEst(E);
- E = _mm_mul_ps(E,g_XMOneHalf);
- E = _mm_add_ps(E,g_XMOneHalf);
- E = XMVectorReciprocalEst(E);
- E = _mm_sub_ps(g_XMOne, E);
- return E;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorASinEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR AbsV, V2, VD, VC0, V2C3;
- XMVECTOR C0, C1, C2, C3;
- XMVECTOR D, Rsq, SqrtD;
- XMVECTOR OnePlusEps;
- XMVECTOR Result;
-
- AbsV = XMVectorAbs(V);
-
- OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v);
-
- C0 = XMVectorSplatX(g_XMASinEstCoefficients.v);
- C1 = XMVectorSplatY(g_XMASinEstCoefficients.v);
- C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v);
- C3 = XMVectorSplatW(g_XMASinEstCoefficients.v);
-
- D = XMVectorSubtract(OnePlusEps, AbsV);
-
- Rsq = XMVectorReciprocalSqrtEst(D);
- SqrtD = XMVectorMultiply(D, Rsq);
-
- V2 = XMVectorMultiply(V, AbsV);
- V2C3 = XMVectorMultiply(V2, C3);
- VD = XMVectorMultiply(D, AbsV);
- VC0 = XMVectorMultiply(V, C0);
-
- Result = XMVectorMultiply(V, C1);
- Result = XMVectorMultiplyAdd(V2, C2, Result);
- Result = XMVectorMultiplyAdd(V2C3, VD, Result);
- Result = XMVectorMultiplyAdd(VC0, SqrtD, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Get abs(V)
- XMVECTOR vAbsV = _mm_setzero_ps();
- vAbsV = _mm_sub_ps(vAbsV,V);
- vAbsV = _mm_max_ps(vAbsV,V);
-
- XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]);
- D = _mm_sub_ps(D,vAbsV);
- // Since this is an estimate, rqsrt is okay
- XMVECTOR vConstants = _mm_rsqrt_ps(D);
- XMVECTOR SqrtD = _mm_mul_ps(D,vConstants);
- // V2 = V^2 retaining sign
- XMVECTOR V2 = _mm_mul_ps(V,vAbsV);
- D = _mm_mul_ps(D,vAbsV);
-
- XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]);
- vResult = _mm_mul_ps(vResult,V);
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]);
- vConstants = _mm_mul_ps(vConstants,V2);
- vResult = _mm_add_ps(vResult,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]);
- vConstants = _mm_mul_ps(vConstants,V2);
- vConstants = _mm_mul_ps(vConstants,D);
- vResult = _mm_add_ps(vResult,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]);
- vConstants = _mm_mul_ps(vConstants,V);
- vConstants = _mm_mul_ps(vConstants,SqrtD);
- vResult = _mm_add_ps(vResult,vConstants);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorACosEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR AbsV, V2, VD, VC0, V2C3;
- XMVECTOR C0, C1, C2, C3;
- XMVECTOR D, Rsq, SqrtD;
- XMVECTOR OnePlusEps, HalfPi;
- XMVECTOR Result;
-
- // acos(V) = PI / 2 - asin(V)
-
- AbsV = XMVectorAbs(V);
-
- OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v);
- HalfPi = XMVectorSplatY(g_XMASinEstConstants.v);
-
- C0 = XMVectorSplatX(g_XMASinEstCoefficients.v);
- C1 = XMVectorSplatY(g_XMASinEstCoefficients.v);
- C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v);
- C3 = XMVectorSplatW(g_XMASinEstCoefficients.v);
-
- D = XMVectorSubtract(OnePlusEps, AbsV);
-
- Rsq = XMVectorReciprocalSqrtEst(D);
- SqrtD = XMVectorMultiply(D, Rsq);
-
- V2 = XMVectorMultiply(V, AbsV);
- V2C3 = XMVectorMultiply(V2, C3);
- VD = XMVectorMultiply(D, AbsV);
- VC0 = XMVectorMultiply(V, C0);
-
- Result = XMVectorMultiply(V, C1);
- Result = XMVectorMultiplyAdd(V2, C2, Result);
- Result = XMVectorMultiplyAdd(V2C3, VD, Result);
- Result = XMVectorMultiplyAdd(VC0, SqrtD, Result);
- Result = XMVectorSubtract(HalfPi, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // acos(V) = PI / 2 - asin(V)
- // Get abs(V)
- XMVECTOR vAbsV = _mm_setzero_ps();
- vAbsV = _mm_sub_ps(vAbsV,V);
- vAbsV = _mm_max_ps(vAbsV,V);
- // Calc D
- XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]);
- D = _mm_sub_ps(D,vAbsV);
- // SqrtD = sqrt(D-abs(V)) estimated
- XMVECTOR vConstants = _mm_rsqrt_ps(D);
- XMVECTOR SqrtD = _mm_mul_ps(D,vConstants);
- // V2 = V^2 while retaining sign
- XMVECTOR V2 = _mm_mul_ps(V, vAbsV);
- // Drop vAbsV here. D = (Const-abs(V))*abs(V)
- D = _mm_mul_ps(D, vAbsV);
-
- XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]);
- vResult = _mm_mul_ps(vResult,V);
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]);
- vConstants = _mm_mul_ps(vConstants,V2);
- vResult = _mm_add_ps(vResult,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]);
- vConstants = _mm_mul_ps(vConstants,V2);
- vConstants = _mm_mul_ps(vConstants,D);
- vResult = _mm_add_ps(vResult,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]);
- vConstants = _mm_mul_ps(vConstants,V);
- vConstants = _mm_mul_ps(vConstants,SqrtD);
- vResult = _mm_add_ps(vResult,vConstants);
-
- vConstants = _mm_load_ps1(&g_XMASinEstConstants.f[1]);
- vResult = _mm_sub_ps(vConstants,vResult);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorATanEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR AbsV, V2S2, N, D;
- XMVECTOR S0, S1, S2;
- XMVECTOR HalfPi;
- XMVECTOR Result;
-
- S0 = XMVectorSplatX(g_XMATanEstCoefficients.v);
- S1 = XMVectorSplatY(g_XMATanEstCoefficients.v);
- S2 = XMVectorSplatZ(g_XMATanEstCoefficients.v);
- HalfPi = XMVectorSplatW(g_XMATanEstCoefficients.v);
-
- AbsV = XMVectorAbs(V);
-
- V2S2 = XMVectorMultiplyAdd(V, V, S2);
- N = XMVectorMultiplyAdd(AbsV, HalfPi, S0);
- D = XMVectorMultiplyAdd(AbsV, S1, V2S2);
- N = XMVectorMultiply(N, V);
- D = XMVectorReciprocalEst(D);
-
- Result = XMVectorMultiply(N, D);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Get abs(V)
- XMVECTOR vAbsV = _mm_setzero_ps();
- vAbsV = _mm_sub_ps(vAbsV,V);
- vAbsV = _mm_max_ps(vAbsV,V);
-
- XMVECTOR vResult = _mm_load_ps1(&g_XMATanEstCoefficients.f[3]);
- vResult = _mm_mul_ps(vResult,vAbsV);
- XMVECTOR vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[0]);
- vResult = _mm_add_ps(vResult,vConstants);
- vResult = _mm_mul_ps(vResult,V);
-
- XMVECTOR D = _mm_mul_ps(V,V);
- vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[2]);
- D = _mm_add_ps(D,vConstants);
- vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[1]);
- vConstants = _mm_mul_ps(vConstants,vAbsV);
- D = _mm_add_ps(D,vConstants);
- vResult = _mm_div_ps(vResult,D);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorATan2Est
-(
- FXMVECTOR Y,
- FXMVECTOR X
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Reciprocal;
- XMVECTOR V;
- XMVECTOR YSign;
- XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour;
- XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity;
- XMVECTOR ATanResultValid;
- XMVECTOR R0, R1, R2, R3, R4, R5;
- XMVECTOR Zero;
- XMVECTOR Result;
- static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f};
-
- Zero = XMVectorZero();
- ATanResultValid = XMVectorTrueInt();
-
- Pi = XMVectorSplatX(ATan2Constants);
- PiOverTwo = XMVectorSplatY(ATan2Constants);
- PiOverFour = XMVectorSplatZ(ATan2Constants);
- ThreePiOverFour = XMVectorSplatW(ATan2Constants);
-
- YEqualsZero = XMVectorEqual(Y, Zero);
- XEqualsZero = XMVectorEqual(X, Zero);
- XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v);
- XIsPositive = XMVectorEqualInt(XIsPositive, Zero);
- YEqualsInfinity = XMVectorIsInfinite(Y);
- XEqualsInfinity = XMVectorIsInfinite(X);
-
- YSign = XMVectorAndInt(Y, g_XMNegativeZero.v);
- Pi = XMVectorOrInt(Pi, YSign);
- PiOverTwo = XMVectorOrInt(PiOverTwo, YSign);
- PiOverFour = XMVectorOrInt(PiOverFour, YSign);
- ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign);
-
- R1 = XMVectorSelect(Pi, YSign, XIsPositive);
- R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero);
- R3 = XMVectorSelect(R2, R1, YEqualsZero);
- R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive);
- R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity);
- Result = XMVectorSelect(R3, R5, YEqualsInfinity);
- ATanResultValid = XMVectorEqualInt(Result, ATanResultValid);
-
- Reciprocal = XMVectorReciprocalEst(X);
- V = XMVectorMultiply(Y, Reciprocal);
- R0 = XMVectorATanEst(V);
-
- R1 = XMVectorSelect( Pi, Zero, XIsPositive );
- R2 = XMVectorAdd(R0, R1);
-
- Result = XMVectorSelect(Result, R2, ATanResultValid);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f};
-
- // Mask if Y>0 && Y!=INF
- XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y);
- // Get the sign of (Y&0x80000000)
- XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero);
- // Get the sign bits of X
- XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero);
- // Change them to masks
- XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero);
- // Get Pi
- XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]);
- // Copy the sign of Y
- Pi = _mm_or_ps(Pi,YSign);
- XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive);
- // Mask for X==0
- XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero);
- // Get Pi/2 with with sign of Y
- XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]);
- PiOverTwo = _mm_or_ps(PiOverTwo,YSign);
- XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants);
- // Mask for Y==0
- vConstants = _mm_cmpeq_ps(Y,g_XMZero);
- R2 = XMVectorSelect(R2,R1,vConstants);
- // Get Pi/4 with sign of Y
- XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]);
- PiOverFour = _mm_or_ps(PiOverFour,YSign);
- // Get (Pi*3)/4 with sign of Y
- XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]);
- ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign);
- vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive);
- XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X);
- vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity);
-
- XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity);
- vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity);
- // At this point, any entry that's zero will get the result
- // from XMVectorATan(), otherwise, return the failsafe value
- vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity);
- // Any entries not 0xFFFFFFFF, are considered precalculated
- XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask);
- // Let's do the ATan2 function
- XMVECTOR Reciprocal = _mm_rcp_ps(X);
- vConstants = _mm_mul_ps(Y, Reciprocal);
- vConstants = XMVectorATanEst(vConstants);
- // Discard entries that have been declared void
-
- XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive );
- vConstants = _mm_add_ps( vConstants, R3 );
-
- vResult = XMVectorSelect(vResult,vConstants,ATanResultValid);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorLerp
-(
- FXMVECTOR V0,
- FXMVECTOR V1,
- FLOAT t
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Scale;
- XMVECTOR Length;
- XMVECTOR Result;
-
- // V0 + t * (V1 - V0)
- Scale = XMVectorReplicate(t);
- Length = XMVectorSubtract(V1, V0);
- Result = XMVectorMultiplyAdd(Length, Scale, V0);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR L, S;
- XMVECTOR Result;
-
- L = _mm_sub_ps( V1, V0 );
-
- S = _mm_set_ps1( t );
-
- Result = _mm_mul_ps( L, S );
-
- return _mm_add_ps( Result, V0 );
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorLerpV
-(
- FXMVECTOR V0,
- FXMVECTOR V1,
- FXMVECTOR T
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Length;
- XMVECTOR Result;
-
- // V0 + T * (V1 - V0)
- Length = XMVectorSubtract(V1, V0);
- Result = XMVectorMultiplyAdd(Length, T, V0);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR Length;
- XMVECTOR Result;
-
- Length = _mm_sub_ps( V1, V0 );
-
- Result = _mm_mul_ps( Length, T );
-
- return _mm_add_ps( Result, V0 );
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorHermite
-(
- FXMVECTOR Position0,
- FXMVECTOR Tangent0,
- FXMVECTOR Position1,
- CXMVECTOR Tangent1,
- FLOAT t
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR P0;
- XMVECTOR T0;
- XMVECTOR P1;
- XMVECTOR T1;
- XMVECTOR Result;
- FLOAT t2;
- FLOAT t3;
-
- // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 +
- // (t^3 - 2 * t^2 + t) * Tangent0 +
- // (-2 * t^3 + 3 * t^2) * Position1 +
- // (t^3 - t^2) * Tangent1
- t2 = t * t;
- t3 = t * t2;
-
- P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f);
- T0 = XMVectorReplicate(t3 - 2.0f * t2 + t);
- P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2);
- T1 = XMVectorReplicate(t3 - t2);
-
- Result = XMVectorMultiply(P0, Position0);
- Result = XMVectorMultiplyAdd(T0, Tangent0, Result);
- Result = XMVectorMultiplyAdd(P1, Position1, Result);
- Result = XMVectorMultiplyAdd(T1, Tangent1, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- FLOAT t2 = t * t;
- FLOAT t3 = t * t2;
-
- XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f);
- XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t);
- XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2);
- XMVECTOR T1 = _mm_set_ps1(t3 - t2);
-
- XMVECTOR vResult = _mm_mul_ps(P0, Position0);
- XMVECTOR vTemp = _mm_mul_ps(T0, Tangent0);
- vResult = _mm_add_ps(vResult,vTemp);
- vTemp = _mm_mul_ps(P1, Position1);
- vResult = _mm_add_ps(vResult,vTemp);
- vTemp = _mm_mul_ps(T1, Tangent1);
- vResult = _mm_add_ps(vResult,vTemp);
- return vResult;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorHermiteV
-(
- FXMVECTOR Position0,
- FXMVECTOR Tangent0,
- FXMVECTOR Position1,
- CXMVECTOR Tangent1,
- CXMVECTOR T
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR P0;
- XMVECTOR T0;
- XMVECTOR P1;
- XMVECTOR T1;
- XMVECTOR Result;
- XMVECTOR T2;
- XMVECTOR T3;
-
- // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 +
- // (t^3 - 2 * t^2 + t) * Tangent0 +
- // (-2 * t^3 + 3 * t^2) * Position1 +
- // (t^3 - t^2) * Tangent1
- T2 = XMVectorMultiply(T, T);
- T3 = XMVectorMultiply(T , T2);
-
- P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f);
- T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]);
- P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]);
- T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]);
-
- Result = XMVectorMultiply(P0, Position0);
- Result = XMVectorMultiplyAdd(T0, Tangent0, Result);
- Result = XMVectorMultiplyAdd(P1, Position1, Result);
- Result = XMVectorMultiplyAdd(T1, Tangent1, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 CatMulT2 = {-3.0f,-2.0f,3.0f,-1.0f};
- static const XMVECTORF32 CatMulT3 = {2.0f,1.0f,-2.0f,1.0f};
-
- // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 +
- // (t^3 - 2 * t^2 + t) * Tangent0 +
- // (-2 * t^3 + 3 * t^2) * Position1 +
- // (t^3 - t^2) * Tangent1
- XMVECTOR T2 = _mm_mul_ps(T,T);
- XMVECTOR T3 = _mm_mul_ps(T,T2);
- // Mul by the constants against t^2
- T2 = _mm_mul_ps(T2,CatMulT2);
- // Mul by the constants against t^3
- T3 = _mm_mul_ps(T3,CatMulT3);
- // T3 now has the pre-result.
- T3 = _mm_add_ps(T3,T2);
- // I need to add t.y only
- T2 = _mm_and_ps(T,g_XMMaskY);
- T3 = _mm_add_ps(T3,T2);
- // Add 1.0f to x
- T3 = _mm_add_ps(T3,g_XMIdentityR0);
- // Now, I have the constants created
- // Mul the x constant to Position0
- XMVECTOR vResult = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(0,0,0,0));
- vResult = _mm_mul_ps(vResult,Position0);
- // Mul the y constant to Tangent0
- T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(1,1,1,1));
- T2 = _mm_mul_ps(T2,Tangent0);
- vResult = _mm_add_ps(vResult,T2);
- // Mul the z constant to Position1
- T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(2,2,2,2));
- T2 = _mm_mul_ps(T2,Position1);
- vResult = _mm_add_ps(vResult,T2);
- // Mul the w constant to Tangent1
- T3 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(3,3,3,3));
- T3 = _mm_mul_ps(T3,Tangent1);
- vResult = _mm_add_ps(vResult,T3);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorCatmullRom
-(
- FXMVECTOR Position0,
- FXMVECTOR Position1,
- FXMVECTOR Position2,
- CXMVECTOR Position3,
- FLOAT t
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR P0;
- XMVECTOR P1;
- XMVECTOR P2;
- XMVECTOR P3;
- XMVECTOR Result;
- FLOAT t2;
- FLOAT t3;
-
- // Result = ((-t^3 + 2 * t^2 - t) * Position0 +
- // (3 * t^3 - 5 * t^2 + 2) * Position1 +
- // (-3 * t^3 + 4 * t^2 + t) * Position2 +
- // (t^3 - t^2) * Position3) * 0.5
- t2 = t * t;
- t3 = t * t2;
-
- P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f);
- P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f);
- P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f);
- P3 = XMVectorReplicate((t3 - t2) * 0.5f);
-
- Result = XMVectorMultiply(P0, Position0);
- Result = XMVectorMultiplyAdd(P1, Position1, Result);
- Result = XMVectorMultiplyAdd(P2, Position2, Result);
- Result = XMVectorMultiplyAdd(P3, Position3, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- FLOAT t2 = t * t;
- FLOAT t3 = t * t2;
-
- XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f);
- XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f);
- XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f);
- XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f);
-
- P0 = _mm_mul_ps(P0, Position0);
- P1 = _mm_mul_ps(P1, Position1);
- P2 = _mm_mul_ps(P2, Position2);
- P3 = _mm_mul_ps(P3, Position3);
- P0 = _mm_add_ps(P0,P1);
- P2 = _mm_add_ps(P2,P3);
- P0 = _mm_add_ps(P0,P2);
- return P0;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorCatmullRomV
-(
- FXMVECTOR Position0,
- FXMVECTOR Position1,
- FXMVECTOR Position2,
- CXMVECTOR Position3,
- CXMVECTOR T
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- float fx = T.vector4_f32[0];
- float fy = T.vector4_f32[1];
- float fz = T.vector4_f32[2];
- float fw = T.vector4_f32[3];
- XMVECTOR vResult = {
- 0.5f*((-fx*fx*fx+2*fx*fx-fx)*Position0.vector4_f32[0]+
- (3*fx*fx*fx-5*fx*fx+2)*Position1.vector4_f32[0]+
- (-3*fx*fx*fx+4*fx*fx+fx)*Position2.vector4_f32[0]+
- (fx*fx*fx-fx*fx)*Position3.vector4_f32[0]),
- 0.5f*((-fy*fy*fy+2*fy*fy-fy)*Position0.vector4_f32[1]+
- (3*fy*fy*fy-5*fy*fy+2)*Position1.vector4_f32[1]+
- (-3*fy*fy*fy+4*fy*fy+fy)*Position2.vector4_f32[1]+
- (fy*fy*fy-fy*fy)*Position3.vector4_f32[1]),
- 0.5f*((-fz*fz*fz+2*fz*fz-fz)*Position0.vector4_f32[2]+
- (3*fz*fz*fz-5*fz*fz+2)*Position1.vector4_f32[2]+
- (-3*fz*fz*fz+4*fz*fz+fz)*Position2.vector4_f32[2]+
- (fz*fz*fz-fz*fz)*Position3.vector4_f32[2]),
- 0.5f*((-fw*fw*fw+2*fw*fw-fw)*Position0.vector4_f32[3]+
- (3*fw*fw*fw-5*fw*fw+2)*Position1.vector4_f32[3]+
- (-3*fw*fw*fw+4*fw*fw+fw)*Position2.vector4_f32[3]+
- (fw*fw*fw-fw*fw)*Position3.vector4_f32[3])
- };
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- static const XMVECTORF32 Catmul2 = {2.0f,2.0f,2.0f,2.0f};
- static const XMVECTORF32 Catmul3 = {3.0f,3.0f,3.0f,3.0f};
- static const XMVECTORF32 Catmul4 = {4.0f,4.0f,4.0f,4.0f};
- static const XMVECTORF32 Catmul5 = {5.0f,5.0f,5.0f,5.0f};
- // Cache T^2 and T^3
- XMVECTOR T2 = _mm_mul_ps(T,T);
- XMVECTOR T3 = _mm_mul_ps(T,T2);
- // Perform the Position0 term
- XMVECTOR vResult = _mm_add_ps(T2,T2);
- vResult = _mm_sub_ps(vResult,T);
- vResult = _mm_sub_ps(vResult,T3);
- vResult = _mm_mul_ps(vResult,Position0);
- // Perform the Position1 term and add
- XMVECTOR vTemp = _mm_mul_ps(T3,Catmul3);
- XMVECTOR vTemp2 = _mm_mul_ps(T2,Catmul5);
- vTemp = _mm_sub_ps(vTemp,vTemp2);
- vTemp = _mm_add_ps(vTemp,Catmul2);
- vTemp = _mm_mul_ps(vTemp,Position1);
- vResult = _mm_add_ps(vResult,vTemp);
- // Perform the Position2 term and add
- vTemp = _mm_mul_ps(T2,Catmul4);
- vTemp2 = _mm_mul_ps(T3,Catmul3);
- vTemp = _mm_sub_ps(vTemp,vTemp2);
- vTemp = _mm_add_ps(vTemp,T);
- vTemp = _mm_mul_ps(vTemp,Position2);
- vResult = _mm_add_ps(vResult,vTemp);
- // Position3 is the last term
- T3 = _mm_sub_ps(T3,T2);
- T3 = _mm_mul_ps(T3,Position3);
- vResult = _mm_add_ps(vResult,T3);
- // Multiply by 0.5f and exit
- vResult = _mm_mul_ps(vResult,g_XMOneHalf);
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorBaryCentric
-(
- FXMVECTOR Position0,
- FXMVECTOR Position1,
- FXMVECTOR Position2,
- FLOAT f,
- FLOAT g
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0)
- XMVECTOR P10;
- XMVECTOR P20;
- XMVECTOR ScaleF;
- XMVECTOR ScaleG;
- XMVECTOR Result;
-
- P10 = XMVectorSubtract(Position1, Position0);
- ScaleF = XMVectorReplicate(f);
-
- P20 = XMVectorSubtract(Position2, Position0);
- ScaleG = XMVectorReplicate(g);
-
- Result = XMVectorMultiplyAdd(P10, ScaleF, Position0);
- Result = XMVectorMultiplyAdd(P20, ScaleG, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR R1 = _mm_sub_ps(Position1,Position0);
- XMVECTOR SF = _mm_set_ps1(f);
- XMVECTOR R2 = _mm_sub_ps(Position2,Position0);
- XMVECTOR SG = _mm_set_ps1(g);
- R1 = _mm_mul_ps(R1,SF);
- R2 = _mm_mul_ps(R2,SG);
- R1 = _mm_add_ps(R1,Position0);
- R1 = _mm_add_ps(R1,R2);
- return R1;
-#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS)
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVectorBaryCentricV
-(
- FXMVECTOR Position0,
- FXMVECTOR Position1,
- FXMVECTOR Position2,
- CXMVECTOR F,
- CXMVECTOR G
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0)
- XMVECTOR P10;
- XMVECTOR P20;
- XMVECTOR Result;
-
- P10 = XMVectorSubtract(Position1, Position0);
- P20 = XMVectorSubtract(Position2, Position0);
-
- Result = XMVectorMultiplyAdd(P10, F, Position0);
- Result = XMVectorMultiplyAdd(P20, G, Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR R1 = _mm_sub_ps(Position1,Position0);
- XMVECTOR R2 = _mm_sub_ps(Position2,Position0);
- R1 = _mm_mul_ps(R1,F);
- R2 = _mm_mul_ps(R2,G);
- R1 = _mm_add_ps(R1,Position0);
- R1 = _mm_add_ps(R1,R2);
- return R1;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-/****************************************************************************
- *
- * 2D Vector
- *
- ****************************************************************************/
-
-//------------------------------------------------------------------------------
-// Comparison operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2Equal
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2);
-// z and w are don't care
- return (((_mm_movemask_ps(vTemp)&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2EqualR(V1, V2));
-#endif
-}
-
-
-//------------------------------------------------------------------------------
-
-XMFINLINE UINT XMVector2EqualR
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- UINT CR = 0;
-
- if ((V1.vector4_f32[0] == V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] == V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] != V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2);
-// z and w are don't care
- int iTest = _mm_movemask_ps(vTemp)&3;
- UINT CR = 0;
- if (iTest==3)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2EqualInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0]);
- return (((_mm_movemask_ps(reinterpret_cast<const __m128 *>(&vTemp)[0])&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2EqualIntR(V1, V2));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE UINT XMVector2EqualIntR
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- UINT CR = 0;
- if ((V1.vector4_u32[0] == V2.vector4_u32[0]) &&
- (V1.vector4_u32[1] == V2.vector4_u32[1]))
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) &&
- (V1.vector4_u32[1] != V2.vector4_u32[1]))
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0]);
- int iTest = _mm_movemask_ps(reinterpret_cast<const __m128 *>(&vTemp)[0])&3;
- UINT CR = 0;
- if (iTest==3)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2NearEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2,
- FXMVECTOR Epsilon
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT dx, dy;
- dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]);
- dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]);
- return ((dx <= Epsilon.vector4_f32[0]) &&
- (dy <= Epsilon.vector4_f32[1]));
-#elif defined(_XM_SSE_INTRINSICS_)
- // Get the difference
- XMVECTOR vDelta = _mm_sub_ps(V1,V2);
- // Get the absolute value of the difference
- XMVECTOR vTemp = _mm_setzero_ps();
- vTemp = _mm_sub_ps(vTemp,vDelta);
- vTemp = _mm_max_ps(vTemp,vDelta);
- vTemp = _mm_cmple_ps(vTemp,Epsilon);
- // z and w are don't care
- return (((_mm_movemask_ps(vTemp)&3)==0x3) != 0);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2NotEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2);
-// z and w are don't care
- return (((_mm_movemask_ps(vTemp)&3)!=3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAnyFalse(XMVector2EqualR(V1, V2));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2NotEqualInt
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast<const __m128i *>(&V1)[0],reinterpret_cast<const __m128i *>(&V2)[0]);
- return (((_mm_movemask_ps(reinterpret_cast<const __m128 *>(&vTemp)[0])&3)!=3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAnyFalse(XMVector2EqualIntR(V1, V2));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2Greater
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0);
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2);
-// z and w are don't care
- return (((_mm_movemask_ps(vTemp)&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2GreaterR(V1, V2));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE UINT XMVector2GreaterR
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- UINT CR = 0;
- if ((V1.vector4_f32[0] > V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] > V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] <= V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2);
- int iTest = _mm_movemask_ps(vTemp)&3;
- UINT CR = 0;
- if (iTest==3)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2GreaterOrEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpge_ps(V1,V2);
- return (((_mm_movemask_ps(vTemp)&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V1, V2));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE UINT XMVector2GreaterOrEqualR
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT CR = 0;
- if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] >= V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) &&
- (V1.vector4_f32[1] < V2.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmpge_ps(V1,V2);
- int iTest = _mm_movemask_ps(vTemp)&3;
- UINT CR = 0;
- if (iTest == 3)
- {
- CR = XM_CRMASK_CR6TRUE;
- }
- else if (!iTest)
- {
- CR = XM_CRMASK_CR6FALSE;
- }
- return CR;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2Less
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmplt_ps(V1,V2);
- return (((_mm_movemask_ps(vTemp)&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2GreaterR(V2, V1));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2LessOrEqual
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0);
-#elif defined(_XM_SSE_INTRINSICS_)
- XMVECTOR vTemp = _mm_cmple_ps(V1,V2);
- return (((_mm_movemask_ps(vTemp)&3)==3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V2, V1));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2InBounds
-(
- FXMVECTOR V,
- FXMVECTOR Bounds
-)
-{
- #if defined(_XM_NO_INTRINSICS_)
- return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) &&
- (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0);
- #elif defined(_XM_SSE_INTRINSICS_)
- // Test if less than or equal
- XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds);
- // Negate the bounds
- XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne);
- // Test if greater or equal (Reversed)
- vTemp2 = _mm_cmple_ps(vTemp2,V);
- // Blend answers
- vTemp1 = _mm_and_ps(vTemp1,vTemp2);
- // x and y in bounds? (z and w are don't care)
- return (((_mm_movemask_ps(vTemp1)&0x3)==0x3) != 0);
-#else // _XM_VMX128_INTRINSICS_
- return XMComparisonAllInBounds(XMVector2InBoundsR(V, Bounds));
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE UINT XMVector2InBoundsR
-(
- FXMVECTOR V,
- FXMVECTOR Bounds
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- UINT CR = 0;
- if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) &&
- (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]))
- {
- CR = XM_CRMASK_CR6BOUNDS;
- }
- return CR;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Test if less than or equal
- XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds);
- // Negate the bounds
- XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne);
- // Test if greater or equal (Reversed)
- vTemp2 = _mm_cmple_ps(vTemp2,V);
- // Blend answers
- vTemp1 = _mm_and_ps(vTemp1,vTemp2);
- // x and y in bounds? (z and w are don't care)
- return ((_mm_movemask_ps(vTemp1)&0x3)==0x3) ? XM_CRMASK_CR6BOUNDS : 0;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2IsNaN
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return (XMISNAN(V.vector4_f32[0]) ||
- XMISNAN(V.vector4_f32[1]));
-#elif defined(_XM_SSE_INTRINSICS_)
- // Mask off the exponent
- __m128i vTempInf = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMInfinity);
- // Mask off the mantissa
- __m128i vTempNan = _mm_and_si128(reinterpret_cast<const __m128i *>(&V)[0],g_XMQNaNTest);
- // Are any of the exponents == 0x7F800000?
- vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity);
- // Are any of the mantissa's zero? (SSE2 doesn't have a neq test)
- vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero);
- // Perform a not on the NaN test to be true on NON-zero mantissas
- vTempNan = _mm_andnot_si128(vTempNan,vTempInf);
- // If x or y are NaN, the signs are true after the merge above
- return ((_mm_movemask_ps(reinterpret_cast<const __m128 *>(&vTempNan)[0])&3) != 0);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE BOOL XMVector2IsInfinite
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- return (XMISINF(V.vector4_f32[0]) ||
- XMISINF(V.vector4_f32[1]));
-#elif defined(_XM_SSE_INTRINSICS_)
- // Mask off the sign bit
- __m128 vTemp = _mm_and_ps(V,g_XMAbsMask);
- // Compare to infinity
- vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity);
- // If x or z are infinity, the signs are true.
- return ((_mm_movemask_ps(vTemp)&3) != 0);
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// Computation operations
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2Dot
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result.vector4_f32[0] =
- Result.vector4_f32[1] =
- Result.vector4_f32[2] =
- Result.vector4_f32[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1];
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V1,V2);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2Cross
-(
- FXMVECTOR V1,
- FXMVECTOR V2
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]);
- XMVECTOR vResult = {
- fCross,
- fCross,
- fCross,
- fCross
- };
- return vResult;
-#elif defined(_XM_SSE_INTRINSICS_)
- // Swap x and y
- XMVECTOR vResult = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(0,1,0,1));
- // Perform the muls
- vResult = _mm_mul_ps(vResult,V1);
- // Splat y
- XMVECTOR vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(1,1,1,1));
- // Sub the values
- vResult = _mm_sub_ss(vResult,vTemp);
- // Splat the cross product
- vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,0,0,0));
- return vResult;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2LengthSq
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- return XMVector2Dot(V, V);
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- return vLengthSq;
-#else
- return XMVector2Dot(V, V);
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2ReciprocalLengthEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result = XMVector2LengthSq(V);
- Result = XMVectorReciprocalSqrtEst(Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_rsqrt_ss(vLengthSq);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2ReciprocalLength
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
-
- Result = XMVector2LengthSq(V);
- Result = XMVectorReciprocalSqrt(Result);
-
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_sqrt_ss(vLengthSq);
- vLengthSq = _mm_div_ss(g_XMOne,vLengthSq);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2LengthEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- XMVECTOR Result;
- Result = XMVector2LengthSq(V);
- Result = XMVectorSqrtEst(Result);
- return Result;
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_sqrt_ss(vLengthSq);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2Length
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result = XMVector2LengthSq(V);
- Result = XMVectorSqrt(Result);
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- vLengthSq = _mm_sqrt_ps(vLengthSq);
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-// XMVector2NormalizeEst uses a reciprocal estimate and
-// returns QNaN on zero and infinite vectors.
-
-XMFINLINE XMVECTOR XMVector2NormalizeEst
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
-
- XMVECTOR Result;
- Result = XMVector2ReciprocalLength(V);
- Result = XMVectorMultiply(V, Result);
- return Result;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- // vTemp has y splatted
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- // x+y
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_rsqrt_ss(vLengthSq);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- vLengthSq = _mm_mul_ps(vLengthSq,V);
- return vLengthSq;
-#else // _XM_VMX128_INTRINSICS_
-#endif // _XM_VMX128_INTRINSICS_
-}
-
-//------------------------------------------------------------------------------
-
-XMFINLINE XMVECTOR XMVector2Normalize
-(
- FXMVECTOR V
-)
-{
-#if defined(_XM_NO_INTRINSICS_)
- FLOAT fLength;
- XMVECTOR vResult;
-
- vResult = XMVector2Length( V );
- fLength = vResult.vector4_f32[0];
-
- // Prevent divide by zero
- if (fLength > 0) {
- fLength = 1.0f/fLength;
- }
-
- vResult.vector4_f32[0] = V.vector4_f32[0]*fLength;
- vResult.vector4_f32[1] = V.vector4_f32[1]*fLength;
- vResult.vector4_f32[2] = V.vector4_f32[2]*fLength;
- vResult.vector4_f32[3] = V.vector4_f32[3]*fLength;
- return vResult;
-
-#elif defined(_XM_SSE_INTRINSICS_)
- // Perform the dot product on x and y only
- XMVECTOR vLengthSq = _mm_mul_ps(V,V);
- XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1));
- vLengthSq = _mm_add_ss(vLengthSq,vTemp);
- vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0));
- // Prepare for the division